From: Andrea Amorese Date: Tue, 10 Aug 2021 15:48:16 +0000 (+0200) Subject: Built motion from commit 4b1d1c16.|2.5.33 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22angular-material.layout.css/%22?a=commitdiff_plain;h=350d4b31dd1a965989e5ed9ff1198b79032f0e10;p=motion2.git Built motion from commit 4b1d1c16.|2.5.33 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index e0ad44f..5ab6d0d 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-10T15:24:50.802Z", + "time": "2021-08-10T15:36:55.605Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 89c5067..5477467 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-08-10T15:24:50.802Z", + "time": "2021-08-10T15:36:55.605Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 5add016..8a5539f 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 _0x4c00=['action','STRING','contactManager','jscripty','urlForward','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]','TEXT','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x213881,_0x5375eb){var _0x2f6527=function(_0x4b4bbf){while(--_0x4b4bbf){_0x213881['push'](_0x213881['shift']());}};_0x2f6527(++_0x5375eb);}(_0x4c00,0x1cc));var _0x04c0=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x4c00[_0x67f95e];return _0x538f5a;};'use strict';var Sequelize=require(_0x04c0('0x0'));module[_0x04c0('0x1')]={'name':{'type':Sequelize[_0x04c0('0x2')],'get':function(_0x26780b){return this[_0x04c0('0x3')](_0x04c0('0x4'));}},'action':{'type':Sequelize[_0x04c0('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x04c0('0x6'),'integration','motionbar',_0x04c0('0x7'),_0x04c0('0x8'),'browser',_0x04c0('0x9'),_0x04c0('0xa')]],'msg':_0x04c0('0xb')}},'comment':_0x04c0('0xb')},'data1':{'type':Sequelize[_0x04c0('0x5')](0x1000),'comment':_0x04c0('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x04c0('0xd')},'data3':{'type':Sequelize[_0x04c0('0x5')](0x1000),'comment':_0x04c0('0xe')},'data4':{'type':Sequelize[_0x04c0('0x5')](0x1000)},'data5':{'type':Sequelize[_0x04c0('0x5')](0x1000)},'data6':{'type':Sequelize[_0x04c0('0x5')]},'data7':{'type':Sequelize[_0x04c0('0xf')]}}; \ No newline at end of file +var _0xd696=['bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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]','sequelize','exports','VIRTUAL','action','contactManager','integration','motionbar','jscripty','urlForward','browser'];(function(_0x3f5b62,_0x5cc596){var _0x1c6ea4=function(_0x953815){while(--_0x953815){_0x3f5b62['push'](_0x3f5b62['shift']());}};_0x1c6ea4(++_0x5cc596);}(_0xd696,0x1d6));var _0x6d69=function(_0x310ca4,_0x195e91){_0x310ca4=_0x310ca4-0x0;var _0x303c6f=_0xd696[_0x310ca4];return _0x303c6f;};'use strict';var Sequelize=require(_0x6d69('0x0'));module[_0x6d69('0x1')]={'name':{'type':Sequelize[_0x6d69('0x2')],'get':function(_0x42d6f3){return this['getDataValue'](_0x6d69('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x6d69('0x4'),_0x6d69('0x5'),_0x6d69('0x6'),_0x6d69('0x7'),_0x6d69('0x8'),_0x6d69('0x9'),_0x6d69('0xa'),'script']],'msg':_0x6d69('0xb')}},'comment':_0x6d69('0xb')},'data1':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xd')},'data2':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xe')},'data3':{'type':Sequelize[_0x6d69('0xc')](0x1000),'comment':_0x6d69('0xf')},'data4':{'type':Sequelize[_0x6d69('0xc')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x6d69('0xc')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 35b1004..a0a69ce 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 _0x874e=['send','update','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','sendStatus','stack','name'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x874e,0x109));var _0xe874=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x874e[_0xdd2bfa];return _0x55397e;};'use strict';var emlformat=require(_0xe874('0x0'));var rimraf=require(_0xe874('0x1'));var zipdir=require(_0xe874('0x2'));var jsonpatch=require(_0xe874('0x3'));var rp=require('request-promise');var moment=require(_0xe874('0x4'));var BPromise=require(_0xe874('0x5'));var Mustache=require(_0xe874('0x6'));var util=require(_0xe874('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe874('0x8'));var ejs=require(_0xe874('0x9'));var fs=require('fs');var fs_extra=require(_0xe874('0xa'));var _=require(_0xe874('0xb'));var squel=require(_0xe874('0xc'));var crypto=require(_0xe874('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe874('0xe'));var toCsv=require(_0xe874('0x8'));var querystring=require(_0xe874('0xf'));var Papa=require(_0xe874('0x10'));var Redis=require('ioredis');var authService=require(_0xe874('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe874('0x12'));var logger=require(_0xe874('0x13'))(_0xe874('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe874('0x15'))['db'];function respondWithStatusCode(_0x2f878d,_0x822b6b){_0x822b6b=_0x822b6b||0xcc;return function(_0x6de07a){if(_0x6de07a){return _0x2f878d['sendStatus'](_0x822b6b);}return _0x2f878d['status'](_0x822b6b)[_0xe874('0x16')]();};}function respondWithResult(_0x4ce41a,_0x2fb84c){_0x2fb84c=_0x2fb84c||0xc8;return function(_0x1db77e){if(_0x1db77e){return _0x4ce41a[_0xe874('0x17')](_0x2fb84c)[_0xe874('0x18')](_0x1db77e);}};}function respondWithFilteredResult(_0x25e4a3,_0x24a0c7){return function(_0x2277a0){if(_0x2277a0){var _0xb3238f=typeof _0x24a0c7[_0xe874('0x19')]===_0xe874('0x1a')&&typeof _0x24a0c7[_0xe874('0x1b')]==='undefined';var _0x4dd5dd=_0x2277a0[_0xe874('0x1c')];var _0x358333=_0xb3238f?0x0:_0x24a0c7[_0xe874('0x19')];var _0x981775=_0xb3238f?_0x2277a0[_0xe874('0x1c')]:_0x24a0c7['offset']+_0x24a0c7[_0xe874('0x1b')];var _0x135595;if(_0x981775>=_0x4dd5dd){_0x981775=_0x4dd5dd;_0x135595=0xc8;}else{_0x135595=0xce;}_0x25e4a3[_0xe874('0x17')](_0x135595);return _0x25e4a3['set'](_0xe874('0x1d'),_0x358333+'-'+_0x981775+'/'+_0x4dd5dd)[_0xe874('0x18')](_0x2277a0);}return null;};}function patchUpdates(_0x3e3ed0){return function(_0x1b5c69){try{jsonpatch[_0xe874('0x1e')](_0x1b5c69,_0x3e3ed0,!![]);}catch(_0x41050b){return BPromise['reject'](_0x41050b);}return _0x1b5c69[_0xe874('0x1f')]();};}function saveUpdates(_0x40342e,_0x515fb8){return function(_0x54dd45){if(_0x54dd45){return _0x54dd45['update'](_0x40342e)[_0xe874('0x20')](function(_0x173dcb){return _0x173dcb;});}return null;};}function removeEntity(_0x15f890,_0x36f89c){return function(_0x2fce79){if(_0x2fce79){return _0x2fce79['destroy']()[_0xe874('0x20')](function(){_0x15f890[_0xe874('0x17')](0xcc)[_0xe874('0x16')]();});}};}function handleEntityNotFound(_0xa61603,_0x5c1a02){return function(_0x579f53){if(!_0x579f53){_0xa61603[_0xe874('0x21')](0x194);}return _0x579f53;};}function handleError(_0x43fad7,_0x119851){_0x119851=_0x119851||0x1f4;return function(_0x42d5fb){logger['error'](_0x42d5fb[_0xe874('0x22')]);if(_0x42d5fb[_0xe874('0x23')]){delete _0x42d5fb['name'];}_0x43fad7[_0xe874('0x17')](_0x119851)[_0xe874('0x24')](_0x42d5fb);};}exports[_0xe874('0x25')]=function(_0x2c5b84,_0x197167){if(_0x2c5b84[_0xe874('0x26')]['id']){delete _0x2c5b84[_0xe874('0x26')]['id'];}return db[_0xe874('0x27')][_0xe874('0x28')]({'where':{'id':_0x2c5b84['params']['id']}})[_0xe874('0x20')](handleEntityNotFound(_0x197167,null))['then'](saveUpdates(_0x2c5b84[_0xe874('0x26')],null))[_0xe874('0x20')](respondWithResult(_0x197167,null))[_0xe874('0x29')](handleError(_0x197167,null));};exports['destroy']=function(_0x52f56a,_0x55942c){return db[_0xe874('0x27')][_0xe874('0x28')]({'where':{'id':_0x52f56a[_0xe874('0x2a')]['id']}})[_0xe874('0x20')](handleEntityNotFound(_0x55942c,null))[_0xe874('0x20')](removeEntity(_0x55942c,null))[_0xe874('0x29')](handleError(_0x55942c,null));}; \ No newline at end of file +var _0x9f96=['send','body','Action','find','params','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','update','then','destroy','error','stack','name'];(function(_0x3e7122,_0x40e109){var _0x13480f=function(_0x499da4){while(--_0x499da4){_0x3e7122['push'](_0x3e7122['shift']());}};_0x13480f(++_0x40e109);}(_0x9f96,0xef));var _0x69f9=function(_0x209aa2,_0x23094d){_0x209aa2=_0x209aa2-0x0;var _0x1526ad=_0x9f96[_0x209aa2];return _0x1526ad;};'use strict';var emlformat=require(_0x69f9('0x0'));var rimraf=require(_0x69f9('0x1'));var zipdir=require(_0x69f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x69f9('0x3'));var BPromise=require(_0x69f9('0x4'));var Mustache=require('mustache');var util=require(_0x69f9('0x5'));var path=require(_0x69f9('0x6'));var sox=require(_0x69f9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69f9('0x8'));var squel=require(_0x69f9('0x9'));var crypto=require(_0x69f9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x69f9('0xb'));var toCsv=require(_0x69f9('0xc'));var querystring=require(_0x69f9('0xd'));var Papa=require('papaparse');var Redis=require(_0x69f9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x69f9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x69f9('0x10'));var utils=require(_0x69f9('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x69f9('0x12'))['db'];function respondWithStatusCode(_0x35b908,_0x57c084){_0x57c084=_0x57c084||0xcc;return function(_0x3f0dd4){if(_0x3f0dd4){return _0x35b908[_0x69f9('0x13')](_0x57c084);}return _0x35b908['status'](_0x57c084)[_0x69f9('0x14')]();};}function respondWithResult(_0x3e532d,_0x2ada5e){_0x2ada5e=_0x2ada5e||0xc8;return function(_0x285dd8){if(_0x285dd8){return _0x3e532d[_0x69f9('0x15')](_0x2ada5e)[_0x69f9('0x16')](_0x285dd8);}};}function respondWithFilteredResult(_0x4c7bd3,_0x21a6b0){return function(_0x4ab28c){if(_0x4ab28c){var _0x8c3b76=typeof _0x21a6b0[_0x69f9('0x17')]===_0x69f9('0x18')&&typeof _0x21a6b0[_0x69f9('0x19')]===_0x69f9('0x18');var _0x3f2153=_0x4ab28c['count'];var _0x273bd8=_0x8c3b76?0x0:_0x21a6b0[_0x69f9('0x17')];var _0x396d16=_0x8c3b76?_0x4ab28c[_0x69f9('0x1a')]:_0x21a6b0[_0x69f9('0x17')]+_0x21a6b0['limit'];var _0x154c0;if(_0x396d16>=_0x3f2153){_0x396d16=_0x3f2153;_0x154c0=0xc8;}else{_0x154c0=0xce;}_0x4c7bd3[_0x69f9('0x15')](_0x154c0);return _0x4c7bd3['set']('Content-Range',_0x273bd8+'-'+_0x396d16+'/'+_0x3f2153)[_0x69f9('0x16')](_0x4ab28c);}return null;};}function patchUpdates(_0x35694f){return function(_0x36e4f7){try{jsonpatch[_0x69f9('0x1b')](_0x36e4f7,_0x35694f,!![]);}catch(_0x488ffe){return BPromise['reject'](_0x488ffe);}return _0x36e4f7['save']();};}function saveUpdates(_0x1a0e86,_0xfa0afe){return function(_0x5be662){if(_0x5be662){return _0x5be662[_0x69f9('0x1c')](_0x1a0e86)[_0x69f9('0x1d')](function(_0x339cde){return _0x339cde;});}return null;};}function removeEntity(_0x4699a6,_0x366295){return function(_0x145271){if(_0x145271){return _0x145271[_0x69f9('0x1e')]()[_0x69f9('0x1d')](function(){_0x4699a6['status'](0xcc)[_0x69f9('0x14')]();});}};}function handleEntityNotFound(_0x25317f,_0x29ebd6){return function(_0x54a95b){if(!_0x54a95b){_0x25317f[_0x69f9('0x13')](0x194);}return _0x54a95b;};}function handleError(_0x21d876,_0x40cfb0){_0x40cfb0=_0x40cfb0||0x1f4;return function(_0x1c45db){logger[_0x69f9('0x1f')](_0x1c45db[_0x69f9('0x20')]);if(_0x1c45db[_0x69f9('0x21')]){delete _0x1c45db[_0x69f9('0x21')];}_0x21d876[_0x69f9('0x15')](_0x40cfb0)[_0x69f9('0x22')](_0x1c45db);};}exports['update']=function(_0x27f05a,_0x41c4c4){if(_0x27f05a[_0x69f9('0x23')]['id']){delete _0x27f05a[_0x69f9('0x23')]['id'];}return db[_0x69f9('0x24')][_0x69f9('0x25')]({'where':{'id':_0x27f05a[_0x69f9('0x26')]['id']}})[_0x69f9('0x1d')](handleEntityNotFound(_0x41c4c4,null))[_0x69f9('0x1d')](saveUpdates(_0x27f05a[_0x69f9('0x23')],null))[_0x69f9('0x1d')](respondWithResult(_0x41c4c4,null))['catch'](handleError(_0x41c4c4,null));};exports[_0x69f9('0x1e')]=function(_0x57aba3,_0x1fd214){return db[_0x69f9('0x24')][_0x69f9('0x25')]({'where':{'id':_0x57aba3[_0x69f9('0x26')]['id']}})['then'](handleEntityNotFound(_0x1fd214,null))[_0x69f9('0x1d')](removeEntity(_0x1fd214,null))['catch'](handleError(_0x1fd214,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 7742dc6..36c4feb 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 _0xf3f2=['bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x79ed02,_0x35045f){var _0x801a1=function(_0x11bb9c){while(--_0x11bb9c){_0x79ed02['push'](_0x79ed02['shift']());}};_0x801a1(++_0x35045f);}(_0xf3f2,0x140));var _0x2f3f=function(_0x20117b,_0x453b59){_0x20117b=_0x20117b-0x0;var _0x271dc6=_0xf3f2[_0x20117b];return _0x271dc6;};'use strict';var _=require(_0x2f3f('0x0'));var util=require(_0x2f3f('0x1'));var logger=require(_0x2f3f('0x2'))(_0x2f3f('0x3'));var moment=require(_0x2f3f('0x4'));var BPromise=require(_0x2f3f('0x5'));var rp=require(_0x2f3f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3f('0x7'));var config=require(_0x2f3f('0x8'));var attributes=require(_0x2f3f('0x9'));module[_0x2f3f('0xa')]=function(_0x361aff,_0x47d0d4){return _0x361aff['define'](_0x2f3f('0xb'),attributes,{'tableName':_0x2f3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48b6=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./action.attributes','exports','define','Action'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48b6,0x1bb));var _0x648b=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x48b6[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x648b('0x0'));var util=require(_0x648b('0x1'));var logger=require(_0x648b('0x2'))(_0x648b('0x3'));var moment=require(_0x648b('0x4'));var BPromise=require(_0x648b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x648b('0x6'));var rimraf=require(_0x648b('0x7'));var config=require('../../config/environment');var attributes=require(_0x648b('0x8'));module[_0x648b('0x9')]=function(_0x180e64,_0xeaaf5a){return _0x180e64[_0x648b('0xa')](_0x648b('0xb'),attributes,{'tableName':_0x648b('0xc'),'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 8a82702..d07f797 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x4b5fb9,_0x1772fd){var _0x149e32=function(_0x4a5bfe){while(--_0x4a5bfe){_0x4b5fb9['push'](_0x4b5fb9['shift']());}};_0x149e32(++_0x1772fd);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xf494,0x1c6));var _0x4f49=function(_0x1db5d9,_0x53c693){_0x1db5d9=_0x1db5d9-0x0;var _0x4bf4b4=_0xf494[_0x1db5d9];return _0x4bf4b4;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 53ffb08..225d9be 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 _0x92ee=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b8d99,_0x452592){var _0x9938c1=function(_0x58453b){while(--_0x58453b){_0x2b8d99['push'](_0x2b8d99['shift']());}};_0x9938c1(++_0x452592);}(_0x92ee,0x126));var _0xe92e=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0x92ee[_0x1b3a09];return _0x357bb8;};'use strict';var multer=require(_0xe92e('0x0'));var util=require('util');var path=require(_0xe92e('0x1'));var timeout=require(_0xe92e('0x2'));var express=require(_0xe92e('0x3'));var router=express['Router']();var fs_extra=require(_0xe92e('0x4'));var auth=require(_0xe92e('0x5'));var interaction=require(_0xe92e('0x6'));var config=require(_0xe92e('0x7'));var controller=require(_0xe92e('0x8'));router[_0xe92e('0x9')](_0xe92e('0xa'),auth['isAuthenticated'](),controller[_0xe92e('0xb')]);router[_0xe92e('0xc')](_0xe92e('0xa'),auth['isAuthenticated'](),controller[_0xe92e('0xd')]);module[_0xe92e('0xe')]=router; \ No newline at end of file +var _0x042c=['./action.controller','put','isAuthenticated','update','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5dddf3,_0x3318e5){var _0x1d491c=function(_0x13563a){while(--_0x13563a){_0x5dddf3['push'](_0x5dddf3['shift']());}};_0x1d491c(++_0x3318e5);}(_0x042c,0xf0));var _0xc042=function(_0x2dea7d,_0x2fc0d8){_0x2dea7d=_0x2dea7d-0x0;var _0x13beed=_0x042c[_0x2dea7d];return _0x13beed;};'use strict';var multer=require(_0xc042('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc042('0x1'));var express=require(_0xc042('0x2'));var router=express[_0xc042('0x3')]();var fs_extra=require(_0xc042('0x4'));var auth=require(_0xc042('0x5'));var interaction=require(_0xc042('0x6'));var config=require('../../config/environment');var controller=require(_0xc042('0x7'));router[_0xc042('0x8')]('/:id',auth[_0xc042('0x9')](),controller[_0xc042('0xa')]);router['delete'](_0xc042('0xb'),auth[_0xc042('0x9')](),controller[_0xc042('0xc')]);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 43dd5d1..9ec0b29 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 _0x5d58=['TEXT','STRING'];(function(_0x337df7,_0x5ccce7){var _0x4b519a=function(_0x4ca772){while(--_0x4ca772){_0x337df7['push'](_0x337df7['shift']());}};_0x4b519a(++_0x5ccce7);}(_0x5d58,0x187));var _0x85d5=function(_0x5388fb,_0x546415){_0x5388fb=_0x5388fb-0x0;var _0x5ea57a=_0x5d58[_0x5388fb];return _0x5ea57a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x186244,_0x412e23){var _0xc2a1e2=function(_0x402ba1){while(--_0x402ba1){_0x186244['push'](_0x186244['shift']());}};_0xc2a1e2(++_0x412e23);}(_0xeff8,0x186));var _0x8eff=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xeff8[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f1153a6..e944495 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 _0xf24a=['join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','ROUND(%s)','IS\x20NOT\x20EMPTY','AnalyticMetric','metric','output','web','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','sendStatus','error','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview'];(function(_0x4af21a,_0x584374){var _0x4f2331=function(_0x373abe){while(--_0x373abe){_0x4af21a['push'](_0x4af21a['shift']());}};_0x4f2331(++_0x584374);}(_0xf24a,0xf5));var _0xaf24=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf24a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf24('0x0'));var zipdir=require(_0xaf24('0x1'));var jsonpatch=require(_0xaf24('0x2'));var rp=require(_0xaf24('0x3'));var moment=require(_0xaf24('0x4'));var BPromise=require(_0xaf24('0x5'));var Mustache=require(_0xaf24('0x6'));var util=require(_0xaf24('0x7'));var path=require(_0xaf24('0x8'));var sox=require('sox');var csv=require(_0xaf24('0x9'));var ejs=require(_0xaf24('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf24('0xb'));var squel=require('squel');var crypto=require(_0xaf24('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaf24('0xd'));var toCsv=require(_0xaf24('0x9'));var querystring=require('querystring');var Papa=require(_0xaf24('0xe'));var Redis=require(_0xaf24('0xf'));var authService=require(_0xaf24('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaf24('0x11'));var hardwareService=require(_0xaf24('0x12'));var logger=require(_0xaf24('0x13'))('api');var utils=require(_0xaf24('0x14'));var config=require(_0xaf24('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaf24('0x16'))['db'];var dbH=require(_0xaf24('0x16'))[_0xaf24('0x17')];function respondWithStatusCode(_0x34f1bb,_0x14e8c0){_0x14e8c0=_0x14e8c0||0xcc;return function(_0x95ea8e){if(_0x95ea8e){return _0x34f1bb['sendStatus'](_0x14e8c0);}return _0x34f1bb[_0xaf24('0x18')](_0x14e8c0)[_0xaf24('0x19')]();};}function respondWithResult(_0x104a80,_0x4aecd1){_0x4aecd1=_0x4aecd1||0xc8;return function(_0x4aea1b){if(_0x4aea1b){return _0x104a80[_0xaf24('0x18')](_0x4aecd1)[_0xaf24('0x1a')](_0x4aea1b);}};}function respondWithFilteredResult(_0x35e724,_0x5d14f3){return function(_0x47f5f6){if(_0x47f5f6){var _0x358083=typeof _0x5d14f3[_0xaf24('0x1b')]===_0xaf24('0x1c')&&typeof _0x5d14f3[_0xaf24('0x1d')]===_0xaf24('0x1c');var _0x151546=_0x47f5f6[_0xaf24('0x1e')];var _0x216d59=_0x358083?0x0:_0x5d14f3['offset'];var _0x4c5565=_0x358083?_0x47f5f6[_0xaf24('0x1e')]:_0x5d14f3[_0xaf24('0x1b')]+_0x5d14f3[_0xaf24('0x1d')];var _0x4f7a0b;if(_0x4c5565>=_0x151546){_0x4c5565=_0x151546;_0x4f7a0b=0xc8;}else{_0x4f7a0b=0xce;}_0x35e724['status'](_0x4f7a0b);return _0x35e724[_0xaf24('0x1f')](_0xaf24('0x20'),_0x216d59+'-'+_0x4c5565+'/'+_0x151546)[_0xaf24('0x1a')](_0x47f5f6);}return null;};}function patchUpdates(_0x255f9f){return function(_0x5e96ec){try{jsonpatch[_0xaf24('0x21')](_0x5e96ec,_0x255f9f,!![]);}catch(_0x9e0527){return BPromise[_0xaf24('0x22')](_0x9e0527);}return _0x5e96ec[_0xaf24('0x23')]();};}function saveUpdates(_0xc7f826,_0x1298d5){return function(_0x3cc1cb){if(_0x3cc1cb){return _0x3cc1cb[_0xaf24('0x24')](_0xc7f826)[_0xaf24('0x25')](function(_0x389b41){return _0x389b41;});}return null;};}function removeEntity(_0x1eb12c,_0x3ebcc6){return function(_0x478550){if(_0x478550){return _0x478550[_0xaf24('0x26')]()[_0xaf24('0x25')](function(){var _0x66c68d=_0x478550[_0xaf24('0x27')]({'plain':!![]});var _0x418bda='CustomReports';return db['UserProfileResource'][_0xaf24('0x26')]({'where':{'type':_0x418bda,'resourceId':_0x66c68d['id']}})['then'](function(){return _0x478550;});})[_0xaf24('0x25')](function(){_0x1eb12c[_0xaf24('0x18')](0xcc)[_0xaf24('0x19')]();});}};}function handleEntityNotFound(_0x23ec38,_0x3ec28c){return function(_0x21eb8c){if(!_0x21eb8c){_0x23ec38[_0xaf24('0x28')](0x194);}return _0x21eb8c;};}function handleError(_0x16814b,_0x3f3513){_0x3f3513=_0x3f3513||0x1f4;return function(_0x1876d6){logger[_0xaf24('0x29')](_0x1876d6['stack']);if(_0x1876d6['name']){delete _0x1876d6[_0xaf24('0x2a')];}_0x16814b[_0xaf24('0x18')](_0x3f3513)['send'](_0x1876d6);};}exports[_0xaf24('0x2b')]=function(_0x5a4d20,_0x2069c9){var _0x5d2166={},_0x2001d4={},_0x4a01f3={'count':0x0,'rows':[]};var _0x9649bc=_[_0xaf24('0x2c')](db[_0xaf24('0x2d')][_0xaf24('0x2e')],function(_0x5e7c59){return{'name':_0x5e7c59[_0xaf24('0x2f')],'type':_0x5e7c59['type'][_0xaf24('0x30')]};});_0x2001d4[_0xaf24('0x31')]=_[_0xaf24('0x2c')](_0x9649bc,_0xaf24('0x2a'));_0x2001d4[_0xaf24('0x32')]=_[_0xaf24('0x33')](_0x5a4d20[_0xaf24('0x32')]);_0x2001d4[_0xaf24('0x34')]=_[_0xaf24('0x35')](_0x2001d4[_0xaf24('0x31')],_0x2001d4[_0xaf24('0x32')]);_0x5d2166['attributes']=_[_0xaf24('0x35')](_0x2001d4['model'],qs['fields'](_0x5a4d20[_0xaf24('0x32')]['fields']));_0x5d2166[_0xaf24('0x36')]=_0x5d2166[_0xaf24('0x36')][_0xaf24('0x37')]?_0x5d2166['attributes']:_0x2001d4['model'];if(!_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x38')](_0xaf24('0x39'))){_0x5d2166[_0xaf24('0x1d')]=qs[_0xaf24('0x1d')](_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x1d')]);_0x5d2166[_0xaf24('0x1b')]=qs[_0xaf24('0x1b')](_0x5a4d20['query'][_0xaf24('0x1b')]);}_0x5d2166[_0xaf24('0x3a')]=qs['sort'](_0x5a4d20[_0xaf24('0x32')][_0xaf24('0x3b')]);_0x5d2166['where']=qs[_0xaf24('0x34')](_[_0xaf24('0x3c')](_0x5a4d20[_0xaf24('0x32')],_0x2001d4[_0xaf24('0x34')]),_0x9649bc);if(_0x5a4d20['query']['filter']){_0x5d2166[_0xaf24('0x3d')]=_[_0xaf24('0x3e')](_0x5d2166[_0xaf24('0x3d')],{'$or':_[_0xaf24('0x2c')](_0x9649bc,function(_0x3f7b28){if(_0x3f7b28[_0xaf24('0x3f')]!==_0xaf24('0x40')){var _0x162097={};_0x162097[_0x3f7b28[_0xaf24('0x2a')]]={'$like':'%'+_0x5a4d20[_0xaf24('0x32')]['filter']+'%'};return _0x162097;}})});}_0x5d2166=_['merge']({},_0x5d2166,_0x5a4d20[_0xaf24('0x41')]);var _0x3c918d={'where':_0x5d2166[_0xaf24('0x3d')]};return db[_0xaf24('0x2d')][_0xaf24('0x1e')](_0x3c918d)[_0xaf24('0x25')](function(_0x2f659c){_0x4a01f3['count']=_0x2f659c;if(_0x5a4d20['query'][_0xaf24('0x42')]){_0x5d2166[_0xaf24('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xaf24('0x44')](_0x5d2166);})[_0xaf24('0x25')](function(_0x499778){_0x4a01f3[_0xaf24('0x45')]=_0x499778;return _0x4a01f3;})[_0xaf24('0x25')](respondWithFilteredResult(_0x2069c9,_0x5d2166))[_0xaf24('0x46')](handleError(_0x2069c9,null));};exports[_0xaf24('0x47')]=function(_0xe8c4db,_0x49b06a){var _0x1b468a={'raw':![],'where':{'id':_0xe8c4db[_0xaf24('0x48')]['id']}},_0x4f40ff={};_0x4f40ff[_0xaf24('0x31')]=_[_0xaf24('0x33')](db[_0xaf24('0x2d')]['rawAttributes']);_0x4f40ff[_0xaf24('0x32')]=_[_0xaf24('0x33')](_0xe8c4db[_0xaf24('0x32')]);_0x4f40ff[_0xaf24('0x34')]=_[_0xaf24('0x35')](_0x4f40ff[_0xaf24('0x31')],_0x4f40ff[_0xaf24('0x32')]);_0x1b468a[_0xaf24('0x36')]=_['intersection'](_0x4f40ff[_0xaf24('0x31')],qs[_0xaf24('0x49')](_0xe8c4db[_0xaf24('0x32')]['fields']));_0x1b468a['attributes']=_0x1b468a[_0xaf24('0x36')][_0xaf24('0x37')]?_0x1b468a[_0xaf24('0x36')]:_0x4f40ff[_0xaf24('0x31')];if(_0xe8c4db[_0xaf24('0x32')][_0xaf24('0x42')]){_0x1b468a[_0xaf24('0x43')]=[{'all':!![]}];}_0x1b468a=_[_0xaf24('0x3e')]({},_0x1b468a,_0xe8c4db[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x1b468a)[_0xaf24('0x25')](handleEntityNotFound(_0x49b06a,null))['then'](respondWithResult(_0x49b06a,null))[_0xaf24('0x46')](handleError(_0x49b06a,null));};exports[_0xaf24('0x4b')]=function(_0x4f9e16,_0x669b5e){return db[_0xaf24('0x2d')]['create'](_0x4f9e16['body'],{})[_0xaf24('0x25')](function(_0x12ebe3){var _0x586311=_0x4f9e16['user'][_0xaf24('0x27')]({'plain':!![]});if(!_0x586311)throw new Error(_0xaf24('0x4c'));if(_0x586311[_0xaf24('0x4d')]===_0xaf24('0x4e')){var _0x21d03c=_0x12ebe3[_0xaf24('0x27')]({'plain':!![]});var _0xae32a=_0xaf24('0x4f');return db[_0xaf24('0x50')]['find']({'where':{'name':_0xae32a,'userProfileId':_0x586311[_0xaf24('0x51')]},'raw':!![]})[_0xaf24('0x25')](function(_0x37fb97){if(_0x37fb97&&_0x37fb97[_0xaf24('0x52')]===0x0){return db['UserProfileResource'][_0xaf24('0x4b')]({'name':_0x21d03c[_0xaf24('0x2a')],'resourceId':_0x21d03c['id'],'type':_0xaf24('0x53'),'sectionId':_0x37fb97['id']},{})[_0xaf24('0x25')](function(){return _0x12ebe3;});}else{return _0x12ebe3;}})[_0xaf24('0x46')](function(_0x1cd123){logger[_0xaf24('0x29')](_0xaf24('0x54'),_0x1cd123);throw _0x1cd123;});}return _0x12ebe3;})['then'](respondWithResult(_0x669b5e,0xc9))[_0xaf24('0x46')](handleError(_0x669b5e,null));};exports[_0xaf24('0x24')]=function(_0x2f2863,_0x2dbfdc){if(_0x2f2863[_0xaf24('0x55')]['id']){delete _0x2f2863['body']['id'];}return db[_0xaf24('0x2d')][_0xaf24('0x4a')]({'where':{'id':_0x2f2863[_0xaf24('0x48')]['id']}})['then'](handleEntityNotFound(_0x2dbfdc,null))[_0xaf24('0x25')](saveUpdates(_0x2f2863[_0xaf24('0x55')],null))['then'](respondWithResult(_0x2dbfdc,null))[_0xaf24('0x46')](handleError(_0x2dbfdc,null));};exports[_0xaf24('0x26')]=function(_0x42a620,_0x24af3b){return db[_0xaf24('0x2d')]['find']({'where':{'id':_0x42a620[_0xaf24('0x48')]['id']}})[_0xaf24('0x25')](handleEntityNotFound(_0x24af3b,null))[_0xaf24('0x25')](removeEntity(_0x24af3b,null))[_0xaf24('0x46')](handleError(_0x24af3b,null));};exports[_0xaf24('0x56')]=function(_0x294657,_0x121d06){var _0x476db9=0xa;var _0x1debe0=[_0xaf24('0x57'),_0xaf24('0x58'),_0xaf24('0x59'),_0xaf24('0x5a')];var _0x41efbd={'SUM':_0xaf24('0x5b'),'COUNT':_0xaf24('0x5c'),'COUNT DISTINCT':_0xaf24('0x5d'),'MAX':_0xaf24('0x5e'),'MIN':_0xaf24('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf24('0x60')};var _0x3d877a={'SEC_TO_TIME':_0xaf24('0x61'),'DATE':_0xaf24('0x62'),'HOUR':_0xaf24('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5ba29b=function(_0x5a078b){return!_[_0xaf24('0x64')]([_0xaf24('0x65'),_0xaf24('0x66'),_0xaf24('0x67'),'IS\x20NOT\x20EMPTY'],_0x5a078b);};var _0xe52dd9=function(_0x1f62d7){if(!_0x1f62d7||!_0x1f62d7[_0xaf24('0x68')][_0xaf24('0x37')]){return'';}for(var _0x16d12d='(',_0xb5d7a4=0x0;_0xb5d7a4<_0x1f62d7[_0xaf24('0x68')][_0xaf24('0x37')];_0xb5d7a4+=0x1){_0xb5d7a4>0x0&&(_0x16d12d+='\x20'+_0x1f62d7[_0xaf24('0x69')]+'\x20');_0x16d12d+=_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6a')]?_0xe52dd9(_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6a')]):_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6b')]+'\x20'+_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4]['condition']+(_0x5ba29b(_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6c')])?'\x20'+_0x1f62d7[_0xaf24('0x68')][_0xb5d7a4][_0xaf24('0x6d')]:'');}return _0x16d12d+')';};var _0x211bc3={'where':{'id':_0x294657['params']['id']}},_0x3036e9,_0x5de122,_0xd3e34e,_0x589593,_0x53b23b;_0x211bc3=_[_0xaf24('0x3e')]({},_0x211bc3,_0x294657[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x211bc3)[_0xaf24('0x25')](function(_0x5175a2){if(_0x5175a2){_0x3036e9=_0x5175a2;return _0x5175a2[_0xaf24('0x6e')]();}return null;})['then'](function(_0x267d2e){if(_0x267d2e){if(!_0x267d2e[_0xaf24('0x37')]){throw new db[(_0xaf24('0x6f'))][(_0xaf24('0x70'))](_0xaf24('0x71'),0x193);}_0x5de122=_0x267d2e;return db['AnalyticMetric'][_0xaf24('0x44')]({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x170f77){if(_0x170f77){_0xd3e34e=_[_0xaf24('0x72')](_0x170f77,'id');var _0xbae24e;var _0x2c3833=squel[_0xaf24('0x73')]();_0x2c3833[_0xaf24('0x74')](_0x3036e9[_0xaf24('0x75')]);for(var _0x443550=0x0;_0x443550<_0x5de122[_0xaf24('0x37')];_0x443550+=0x1){_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x76')]?_0xd3e34e[_0x5de122[_0x443550][_0xaf24('0x76')]]['metric']:_0x5de122[_0x443550][_0xaf24('0x6b')];_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x77')]?_[_0xaf24('0x78')](_0x41efbd[_0x5de122[_0x443550]['function']],'%s',_0xbae24e):_0xbae24e;_0xbae24e=_0x5de122[_0x443550][_0xaf24('0x79')]?_[_0xaf24('0x78')](_0x3d877a[_0x5de122[_0x443550][_0xaf24('0x79')]],'%s',_0xbae24e):_0xbae24e;if(_0x5de122[_0x443550][_0xaf24('0x7a')]){_0x2c3833[_0xaf24('0x6a')](_0xbae24e);}_0x5de122[_0x443550][_0xaf24('0x7b')]&&_0x2c3833['order'](_0xbae24e,_0x5de122[_0x443550][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x2c3833[_0xaf24('0x6b')](_0xbae24e,_0x5de122[_0x443550][_0xaf24('0x7d')]||_0xbae24e);}if(_0x3036e9[_0xaf24('0x7e')]){_0x3036e9[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x3036e9[_0xaf24('0x7e')]);for(var _0x5ea3b3=0x0;_0x5ea3b3<_0x3036e9['joins'][_0xaf24('0x37')];_0x5ea3b3+=0x1){if(_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x1debe0,_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x3f')])&&_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x80')]&&_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x81')]&&_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3]['foreignKey']){_0x2c3833[_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x3f')]](_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x81')],null,util[_0xaf24('0x79')](_0xaf24('0x82'),_0x3036e9[_0xaf24('0x75')],_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x80')],_0x3036e9['joins'][_0x5ea3b3][_0xaf24('0x81')],_0x3036e9[_0xaf24('0x7e')][_0x5ea3b3][_0xaf24('0x83')]));}}}if(_0x3036e9['conditions']){_0x3036e9[_0xaf24('0x84')]=JSON['parse'](_0x3036e9[_0xaf24('0x84')]);_0x2c3833[_0xaf24('0x3d')](_0xe52dd9(_0x3036e9[_0xaf24('0x84')][_0xaf24('0x6a')]));}_0x53b23b=_0x2c3833[_0xaf24('0x85')]();_0x2c3833[_0xaf24('0x1d')](_0x476db9);_0x2c3833['offset'](0x0);logger[_0xaf24('0x86')]('Limited\x20Query:',_0x2c3833[_0xaf24('0x87')]());return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x2c3833[_0xaf24('0x87')](),{'type':dbH['sequelize'][_0xaf24('0x89')][_0xaf24('0x8a')]});}})[_0xaf24('0x25')](respondWithResult(_0x121d06,null))[_0xaf24('0x46')](handleError(_0x121d06,null));};function runReport(_0xaa0e7d,_0x5bcbcf,_0x2e4f11){var _0xfd6b67=_0x5bcbcf[_0xaf24('0x2a')];var _0x22200f=0xa;var _0x4dea40=[_0xaf24('0x57'),_0xaf24('0x58'),'right_join','cross_join'];var _0x383cb3={'SUM':_0xaf24('0x5b'),'COUNT':_0xaf24('0x5c'),'COUNT DISTINCT':_0xaf24('0x5d'),'MAX':_0xaf24('0x5e'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xaf24('0x8b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x13b8ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaf24('0x62'),'HOUR':_0xaf24('0x63'),'ROUND':_0xaf24('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e1c28=function(_0x28e967){return!_[_0xaf24('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xaf24('0x67'),_0xaf24('0x8d')],_0x28e967);};var _0x214a79=function(_0x16cf37){if(!_0x16cf37||!_0x16cf37['rules'][_0xaf24('0x37')]){return'';}for(var _0x3b3882='(',_0x3620d4=0x0;_0x3620d4<_0x16cf37[_0xaf24('0x68')][_0xaf24('0x37')];_0x3620d4+=0x1){_0x3620d4>0x0&&(_0x3b3882+='\x20'+_0x16cf37[_0xaf24('0x69')]+'\x20');_0x3b3882+=_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6a')]?_0x214a79(_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6a')]):_0x16cf37[_0xaf24('0x68')][_0x3620d4][_0xaf24('0x6b')]+'\x20'+_0x16cf37[_0xaf24('0x68')][_0x3620d4]['condition']+(_0x4e1c28(_0x16cf37[_0xaf24('0x68')][_0x3620d4]['condition'])?'\x20'+_0x16cf37[_0xaf24('0x68')][_0x3620d4]['value']:'');}return _0x3b3882+')';};var _0xbfd56c={'where':{'id':_0xaa0e7d['id']}},_0x58adb8,_0x2710bb,_0x173d23,_0x2a773e,_0x15baaf;_0xbfd56c=_[_0xaf24('0x3e')]({},_0xbfd56c,_0x2e4f11);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0xbfd56c)[_0xaf24('0x25')](function(_0x31ed68){if(_0x31ed68){_0x58adb8=_0x31ed68;return _0x31ed68[_0xaf24('0x6e')]();}return null;})[_0xaf24('0x25')](function(_0x5ac55c){if(_0x5ac55c){if(!_0x5ac55c['length']){throw new db[(_0xaf24('0x6f'))][(_0xaf24('0x70'))](_0xaf24('0x71'),0x193);}_0x2710bb=_0x5ac55c;return db[_0xaf24('0x8e')][_0xaf24('0x44')]({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x3410cf){if(_0x3410cf){_0x173d23=_['keyBy'](_0x3410cf,'id');var _0x2ad727;var _0x2f7f0d=squel['select']();_0x2f7f0d['from'](_0x58adb8[_0xaf24('0x75')]);for(var _0x3c5d5e=0x0;_0x3c5d5e<_0x2710bb[_0xaf24('0x37')];_0x3c5d5e+=0x1){_0x2ad727=_0x2710bb[_0x3c5d5e][_0xaf24('0x76')]?_0x173d23[_0x2710bb[_0x3c5d5e][_0xaf24('0x76')]][_0xaf24('0x8f')]:_0x2710bb[_0x3c5d5e][_0xaf24('0x6b')];_0x2ad727=_0x2710bb[_0x3c5d5e]['function']?_[_0xaf24('0x78')](_0x383cb3[_0x2710bb[_0x3c5d5e]['function']],'%s',_0x2ad727):_0x2ad727;_0x2ad727=_0x2710bb[_0x3c5d5e]['format']?_[_0xaf24('0x78')](_0x13b8ed[_0x2710bb[_0x3c5d5e]['format']],'%s',_0x2ad727):_0x2ad727;if(_0x2710bb[_0x3c5d5e]['groupBy']){_0x2f7f0d[_0xaf24('0x6a')](_0x2ad727);}_0x2710bb[_0x3c5d5e]['orderBy']&&_0x2f7f0d[_0xaf24('0x3a')](_0x2ad727,_0x2710bb[_0x3c5d5e][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x2f7f0d[_0xaf24('0x6b')](_0x2ad727,_0x2710bb[_0x3c5d5e]['alias']||_0x2ad727);}if(_0x58adb8[_0xaf24('0x7e')]){_0x58adb8[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x58adb8[_0xaf24('0x7e')]);for(var _0x44d00b=0x0;_0x44d00b<_0x58adb8['joins'][_0xaf24('0x37')];_0x44d00b+=0x1){if(_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x4dea40,_0x58adb8[_0xaf24('0x7e')][_0x44d00b]['type'])&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x80')]&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')]&&_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x83')]){_0x2f7f0d[_0x58adb8['joins'][_0x44d00b][_0xaf24('0x3f')]](_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')],null,util[_0xaf24('0x79')](_0xaf24('0x82'),_0x58adb8['table'],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x80')],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x81')],_0x58adb8[_0xaf24('0x7e')][_0x44d00b][_0xaf24('0x83')]));}}}if(_0x58adb8['conditions']){_0x58adb8['conditions']=JSON[_0xaf24('0x7f')](_0x58adb8[_0xaf24('0x84')]);_0x2f7f0d[_0xaf24('0x3d')](_0x214a79(_0x58adb8['conditions'][_0xaf24('0x6a')]));}_0x15baaf=_0x2f7f0d[_0xaf24('0x85')]();_0x2f7f0d['limit'](_0x22200f);_0x2f7f0d[_0xaf24('0x1b')](0x0);return;}})[_0xaf24('0x25')](function(){if(_0x5bcbcf[_0xaf24('0x90')]===_0xaf24('0x91')){return null;}var _0x4574f7=_['merge'](_0x5bcbcf,{'name':_0x5bcbcf['fullPath']||_0x5bcbcf[_0xaf24('0x2a')]||_0x58adb8[_0xaf24('0x2a')],'basename':_0xfd6b67,'savename':util[_0xaf24('0x79')](_0xaf24('0x92'),_0x5bcbcf[_0xaf24('0x2a')]||_0x58adb8[_0xaf24('0x2a')],require(_0xaf24('0x93'))[_0xaf24('0x94')](0x4),_0x5bcbcf[_0xaf24('0x90')]||'csv'),'reportId':_0x58adb8['id'],'reportType':_0xaf24('0x95')});return db[_0xaf24('0x96')][_0xaf24('0x4b')](_0x4574f7,{'raw':!![]});})[_0xaf24('0x25')](function(_0x59eca9){if(_0x58adb8[_0xaf24('0x75')]==='cdr'){_0x15baaf[_0xaf24('0x3d')](_0x58adb8['table']+_0xaf24('0x97'),_0x5bcbcf['startDate'],_0x5bcbcf['endDate']);}else{_0x15baaf[_0xaf24('0x3d')](_0x58adb8['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5bcbcf[_0xaf24('0x98')],_0x5bcbcf[_0xaf24('0x99')]);}if(_0x59eca9){logger[_0xaf24('0x9a')](_0xaf24('0x9b'),_0x15baaf['toString']());require('child_process')['fork'](path[_0xaf24('0x57')](__dirname,_0xaf24('0x9c'),_0x59eca9['output']),[_0x59eca9['id'],_0x15baaf['toString'](),path[_0xaf24('0x57')](__dirname,_0xaf24('0x9d'),_0x59eca9[_0xaf24('0x9e')]),_0xfd6b67]);return _0x59eca9;}else{var _0x567585=squel['select']();_0x567585['from']('('+_0x15baaf['toString']()+')',_0xaf24('0x9f'));_0x567585[_0xaf24('0x6b')](_0xaf24('0xa0'),_0xaf24('0x1e'));_0x15baaf[_0xaf24('0x1d')](_0x5bcbcf[_0xaf24('0x1d')]||_0x22200f);_0x15baaf['offset'](_0x5bcbcf[_0xaf24('0x1b')]||0x0);return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x567585[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')]['SELECT']})[_0xaf24('0x25')](function(_0x2f0f56){if(!_0x2f0f56['length']){_0x2a773e=0x0;}else{_0x2a773e=_0x2f0f56[0x0][_0xaf24('0x1e')]||0x0;}return dbH[_0xaf24('0x88')][_0xaf24('0x32')](_0x15baaf[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')][_0xaf24('0x8a')]});})[_0xaf24('0x25')](function(_0x11fcaf){return{'rows':_0x11fcaf||[],'count':_0x2a773e};});}});}exports['run']=function(_0x35ff50,_0x263f51){return runReport(_0x35ff50[_0xaf24('0x48')],_0x35ff50['query'],_0x35ff50[_0xaf24('0x41')])[_0xaf24('0x25')](respondWithResult(_0x263f51,null))['catch'](handleError(_0x263f51,null));};exports[_0xaf24('0xa1')]=runReport;exports[_0xaf24('0x32')]=function(_0x2344af,_0x3b4d8f){var _0x5ce8e6=0xa;var _0x5af126=[_0xaf24('0x57'),_0xaf24('0x58'),_0xaf24('0x59'),_0xaf24('0x5a')];var _0x179ee9={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xaf24('0x5e'),'MIN':_0xaf24('0x5f'),'AVG':_0xaf24('0xa2'),'GROUP_CONCAT':_0xaf24('0x8b'),'GROUP_CONCAT ASC':_0xaf24('0xa3'),'GROUP_CONCAT DESC':_0xaf24('0x60')};var _0x416380={'SEC_TO_TIME':_0xaf24('0x61'),'DATE':'DATE(%s)','HOUR':_0xaf24('0x63'),'ROUND':_0xaf24('0x8c'),'UNIX_TIMESTAMP':_0xaf24('0xa4')};var _0x3c2041=function(_0x26a220){return!_[_0xaf24('0x64')]([_0xaf24('0x65'),_0xaf24('0x66'),_0xaf24('0x67'),_0xaf24('0x8d')],_0x26a220);};var _0x2ae2d9=function(_0x5ae012){if(!_0x5ae012||!_0x5ae012[_0xaf24('0x68')]['length']){return'';}for(var _0x2ccf58='(',_0x10eea6=0x0;_0x10eea6<_0x5ae012['rules'][_0xaf24('0x37')];_0x10eea6+=0x1){_0x10eea6>0x0&&(_0x2ccf58+='\x20'+_0x5ae012[_0xaf24('0x69')]+'\x20');_0x2ccf58+=_0x5ae012['rules'][_0x10eea6][_0xaf24('0x6a')]?_0x2ae2d9(_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6a')]):_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6b')]+'\x20'+_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6c')]+(_0x3c2041(_0x5ae012['rules'][_0x10eea6][_0xaf24('0x6c')])?'\x20'+_0x5ae012[_0xaf24('0x68')][_0x10eea6][_0xaf24('0x6d')]:'');}return _0x2ccf58+')';};var _0x499209={'where':{'id':_0x2344af[_0xaf24('0x48')]['id']}},_0x1652ae,_0x1b7f02,_0x47f66a,_0x56311e,_0x58ec26;_0x499209=_[_0xaf24('0x3e')]({},_0x499209,_0x2344af[_0xaf24('0x41')]);return db[_0xaf24('0x2d')][_0xaf24('0x4a')](_0x499209)[_0xaf24('0x25')](function(_0x309b43){if(_0x309b43){_0x1652ae=_0x309b43;return _0x309b43[_0xaf24('0x6e')]();}return null;})[_0xaf24('0x25')](function(_0xee8041){if(_0xee8041){if(!_0xee8041[_0xaf24('0x37')]){throw new db[(_0xaf24('0x6f'))]['ValidationErrorItem'](_0xaf24('0x71'),0x193);}_0x1b7f02=_0xee8041;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xaf24('0x25')](function(_0x248d54){if(_0x248d54){_0x47f66a=_['keyBy'](_0x248d54,'id');var _0x5221b4;var _0x381739=squel[_0xaf24('0x73')]();_0x381739[_0xaf24('0x74')](_0x1652ae['table']);for(var _0x4d72ec=0x0;_0x4d72ec<_0x1b7f02[_0xaf24('0x37')];_0x4d72ec+=0x1){_0x5221b4=_0x1b7f02[_0x4d72ec][_0xaf24('0x76')]?_0x47f66a[_0x1b7f02[_0x4d72ec]['MetricId']][_0xaf24('0x8f')]:_0x1b7f02[_0x4d72ec]['field'];_0x5221b4=_0x1b7f02[_0x4d72ec][_0xaf24('0x77')]?_['replace'](_0x179ee9[_0x1b7f02[_0x4d72ec][_0xaf24('0x77')]],'%s',_0x5221b4):_0x5221b4;_0x5221b4=_0x1b7f02[_0x4d72ec]['format']?_[_0xaf24('0x78')](_0x416380[_0x1b7f02[_0x4d72ec][_0xaf24('0x79')]],'%s',_0x5221b4):_0x5221b4;if(_0x1b7f02[_0x4d72ec]['groupBy']){_0x381739[_0xaf24('0x6a')](_0x5221b4);}_0x1b7f02[_0x4d72ec][_0xaf24('0x7b')]&&_0x381739['order'](_0x5221b4,_0x1b7f02[_0x4d72ec][_0xaf24('0x7b')]===_0xaf24('0x7c')?![]:!![]);_0x381739[_0xaf24('0x6b')](_0x5221b4,_0x1b7f02[_0x4d72ec][_0xaf24('0x7d')]||_0x5221b4);}if(_0x1652ae['joins']){_0x1652ae[_0xaf24('0x7e')]=JSON[_0xaf24('0x7f')](_0x1652ae[_0xaf24('0x7e')]);for(var _0x257860=0x0;_0x257860<_0x1652ae[_0xaf24('0x7e')][_0xaf24('0x37')];_0x257860+=0x1){if(_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x3f')]&&_[_0xaf24('0x64')](_0x5af126,_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x3f')])&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x80')]&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x81')]&&_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x83')]){_0x381739[_0x1652ae['joins'][_0x257860][_0xaf24('0x3f')]](_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x81')],null,util['format'](_0xaf24('0x82'),_0x1652ae[_0xaf24('0x75')],_0x1652ae[_0xaf24('0x7e')][_0x257860][_0xaf24('0x80')],_0x1652ae['joins'][_0x257860][_0xaf24('0x81')],_0x1652ae['joins'][_0x257860][_0xaf24('0x83')]));}}}if(_0x1652ae[_0xaf24('0x84')]){_0x1652ae[_0xaf24('0x84')]=JSON[_0xaf24('0x7f')](_0x1652ae[_0xaf24('0x84')]);_0x381739[_0xaf24('0x3d')](_0x2ae2d9(_0x1652ae[_0xaf24('0x84')]['group']));}_0x58ec26=_0x381739['clone']();_0x381739[_0xaf24('0x1d')](_0x5ce8e6);_0x381739[_0xaf24('0x1b')](0x0);logger[_0xaf24('0x86')](_0xaf24('0xa5'),_0x381739['toString']());return dbH['sequelize']['query'](_0x381739[_0xaf24('0x87')](),{'type':dbH[_0xaf24('0x88')][_0xaf24('0x89')][_0xaf24('0x8a')]});}})[_0xaf24('0x25')](function(){return{'sql':_0x58ec26[_0xaf24('0x87')]()};})[_0xaf24('0x25')](respondWithResult(_0x3b4d8f,null))[_0xaf24('0x46')](handleError(_0x3b4d8f,null));}; \ No newline at end of file +var _0xbecf=['generate','csv','custom','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','CustomReports','end','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','length','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NULL','operator','value','Sequelize','ValidationErrorItem','AnalyticMetric','groupBy','output','web','fullPath','%s-%s.%s'];(function(_0x22b430,_0x1aede5){var _0x338d2a=function(_0x1335f7){while(--_0x1335f7){_0x22b430['push'](_0x22b430['shift']());}};_0x338d2a(++_0x1aede5);}(_0xbecf,0x15c));var _0xfbec=function(_0x234095,_0x5771a2){_0x234095=_0x234095-0x0;var _0x5b4889=_0xbecf[_0x234095];return _0x5b4889;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfbec('0x0'));var jsonpatch=require(_0xfbec('0x1'));var rp=require(_0xfbec('0x2'));var moment=require(_0xfbec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfbec('0x4'));var util=require(_0xfbec('0x5'));var path=require(_0xfbec('0x6'));var sox=require(_0xfbec('0x7'));var csv=require(_0xfbec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbec('0x9'));var _=require(_0xfbec('0xa'));var squel=require(_0xfbec('0xb'));var crypto=require(_0xfbec('0xc'));var jsforce=require(_0xfbec('0xd'));var deskjs=require(_0xfbec('0xe'));var toCsv=require(_0xfbec('0x8'));var querystring=require(_0xfbec('0xf'));var Papa=require(_0xfbec('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfbec('0x11'));var hardwareService=require(_0xfbec('0x12'));var logger=require(_0xfbec('0x13'))(_0xfbec('0x14'));var utils=require(_0xfbec('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfbec('0x16'));var db=require(_0xfbec('0x17'))['db'];var dbH=require(_0xfbec('0x17'))[_0xfbec('0x18')];function respondWithStatusCode(_0x4859ea,_0x276713){_0x276713=_0x276713||0xcc;return function(_0x411562){if(_0x411562){return _0x4859ea[_0xfbec('0x19')](_0x276713);}return _0x4859ea[_0xfbec('0x1a')](_0x276713)['end']();};}function respondWithResult(_0x93609b,_0x5e021e){_0x5e021e=_0x5e021e||0xc8;return function(_0x8b2f89){if(_0x8b2f89){return _0x93609b['status'](_0x5e021e)[_0xfbec('0x1b')](_0x8b2f89);}};}function respondWithFilteredResult(_0x923681,_0x171721){return function(_0x4aa49e){if(_0x4aa49e){var _0xe91fb8=typeof _0x171721[_0xfbec('0x1c')]===_0xfbec('0x1d')&&typeof _0x171721['limit']===_0xfbec('0x1d');var _0x267a4b=_0x4aa49e[_0xfbec('0x1e')];var _0x6fc8f=_0xe91fb8?0x0:_0x171721[_0xfbec('0x1c')];var _0x265534=_0xe91fb8?_0x4aa49e[_0xfbec('0x1e')]:_0x171721['offset']+_0x171721['limit'];var _0x5da567;if(_0x265534>=_0x267a4b){_0x265534=_0x267a4b;_0x5da567=0xc8;}else{_0x5da567=0xce;}_0x923681[_0xfbec('0x1a')](_0x5da567);return _0x923681[_0xfbec('0x1f')](_0xfbec('0x20'),_0x6fc8f+'-'+_0x265534+'/'+_0x267a4b)['json'](_0x4aa49e);}return null;};}function patchUpdates(_0x315e9b){return function(_0x383405){try{jsonpatch['apply'](_0x383405,_0x315e9b,!![]);}catch(_0x3150f1){return BPromise[_0xfbec('0x21')](_0x3150f1);}return _0x383405['save']();};}function saveUpdates(_0xe1f8d6,_0x4048b7){return function(_0x3e28ef){if(_0x3e28ef){return _0x3e28ef[_0xfbec('0x22')](_0xe1f8d6)[_0xfbec('0x23')](function(_0x57b3ce){return _0x57b3ce;});}return null;};}function removeEntity(_0x2e172e,_0x4bc10a){return function(_0x1bed47){if(_0x1bed47){return _0x1bed47[_0xfbec('0x24')]()['then'](function(){var _0x50e0ef=_0x1bed47['get']({'plain':!![]});var _0x10f5d3=_0xfbec('0x25');return db['UserProfileResource'][_0xfbec('0x24')]({'where':{'type':_0x10f5d3,'resourceId':_0x50e0ef['id']}})[_0xfbec('0x23')](function(){return _0x1bed47;});})[_0xfbec('0x23')](function(){_0x2e172e['status'](0xcc)[_0xfbec('0x26')]();});}};}function handleEntityNotFound(_0x2d9acb,_0x437b7e){return function(_0x14aa8a){if(!_0x14aa8a){_0x2d9acb[_0xfbec('0x19')](0x194);}return _0x14aa8a;};}function handleError(_0x5b359b,_0x4aff99){_0x4aff99=_0x4aff99||0x1f4;return function(_0x163987){logger[_0xfbec('0x27')](_0x163987[_0xfbec('0x28')]);if(_0x163987[_0xfbec('0x29')]){delete _0x163987[_0xfbec('0x29')];}_0x5b359b[_0xfbec('0x1a')](_0x4aff99)[_0xfbec('0x2a')](_0x163987);};}exports['index']=function(_0xa0084a,_0x55ffd2){var _0x5260b2={},_0x5a3829={},_0x22a487={'count':0x0,'rows':[]};var _0x49cc9a=_['map'](db['AnalyticCustomReport'][_0xfbec('0x2b')],function(_0xab9f46){return{'name':_0xab9f46[_0xfbec('0x2c')],'type':_0xab9f46[_0xfbec('0x2d')][_0xfbec('0x2e')]};});_0x5a3829['model']=_[_0xfbec('0x2f')](_0x49cc9a,_0xfbec('0x29'));_0x5a3829['query']=_[_0xfbec('0x30')](_0xa0084a['query']);_0x5a3829['filters']=_[_0xfbec('0x31')](_0x5a3829[_0xfbec('0x32')],_0x5a3829[_0xfbec('0x33')]);_0x5260b2[_0xfbec('0x34')]=_['intersection'](_0x5a3829[_0xfbec('0x32')],qs[_0xfbec('0x35')](_0xa0084a[_0xfbec('0x33')]['fields']));_0x5260b2['attributes']=_0x5260b2[_0xfbec('0x34')]['length']?_0x5260b2[_0xfbec('0x34')]:_0x5a3829[_0xfbec('0x32')];if(!_0xa0084a[_0xfbec('0x33')][_0xfbec('0x36')](_0xfbec('0x37'))){_0x5260b2[_0xfbec('0x38')]=qs['limit'](_0xa0084a['query'][_0xfbec('0x38')]);_0x5260b2[_0xfbec('0x1c')]=qs[_0xfbec('0x1c')](_0xa0084a[_0xfbec('0x33')]['offset']);}_0x5260b2[_0xfbec('0x39')]=qs['sort'](_0xa0084a['query'][_0xfbec('0x3a')]);_0x5260b2[_0xfbec('0x3b')]=qs[_0xfbec('0x3c')](_[_0xfbec('0x3d')](_0xa0084a[_0xfbec('0x33')],_0x5a3829[_0xfbec('0x3c')]),_0x49cc9a);if(_0xa0084a[_0xfbec('0x33')][_0xfbec('0x3e')]){_0x5260b2[_0xfbec('0x3b')]=_[_0xfbec('0x3f')](_0x5260b2['where'],{'$or':_['map'](_0x49cc9a,function(_0x3b2b41){if(_0x3b2b41[_0xfbec('0x2d')]!==_0xfbec('0x40')){var _0x36f2b4={};_0x36f2b4[_0x3b2b41['name']]={'$like':'%'+_0xa0084a[_0xfbec('0x33')][_0xfbec('0x3e')]+'%'};return _0x36f2b4;}})});}_0x5260b2=_[_0xfbec('0x3f')]({},_0x5260b2,_0xa0084a[_0xfbec('0x41')]);var _0x1f6a31={'where':_0x5260b2[_0xfbec('0x3b')]};return db[_0xfbec('0x42')]['count'](_0x1f6a31)[_0xfbec('0x23')](function(_0x40bb85){_0x22a487['count']=_0x40bb85;if(_0xa0084a[_0xfbec('0x33')][_0xfbec('0x43')]){_0x5260b2[_0xfbec('0x44')]=[{'all':!![]}];}return db[_0xfbec('0x42')][_0xfbec('0x45')](_0x5260b2);})[_0xfbec('0x23')](function(_0x154de6){_0x22a487['rows']=_0x154de6;return _0x22a487;})[_0xfbec('0x23')](respondWithFilteredResult(_0x55ffd2,_0x5260b2))[_0xfbec('0x46')](handleError(_0x55ffd2,null));};exports['show']=function(_0x18eb22,_0x5e7d1c){var _0x117fd3={'raw':![],'where':{'id':_0x18eb22[_0xfbec('0x47')]['id']}},_0x5e94a7={};_0x5e94a7[_0xfbec('0x32')]=_[_0xfbec('0x30')](db[_0xfbec('0x42')][_0xfbec('0x2b')]);_0x5e94a7[_0xfbec('0x33')]=_[_0xfbec('0x30')](_0x18eb22['query']);_0x5e94a7[_0xfbec('0x3c')]=_[_0xfbec('0x31')](_0x5e94a7[_0xfbec('0x32')],_0x5e94a7[_0xfbec('0x33')]);_0x117fd3['attributes']=_[_0xfbec('0x31')](_0x5e94a7[_0xfbec('0x32')],qs[_0xfbec('0x35')](_0x18eb22[_0xfbec('0x33')][_0xfbec('0x35')]));_0x117fd3[_0xfbec('0x34')]=_0x117fd3[_0xfbec('0x34')]['length']?_0x117fd3[_0xfbec('0x34')]:_0x5e94a7[_0xfbec('0x32')];if(_0x18eb22['query'][_0xfbec('0x43')]){_0x117fd3[_0xfbec('0x44')]=[{'all':!![]}];}_0x117fd3=_[_0xfbec('0x3f')]({},_0x117fd3,_0x18eb22[_0xfbec('0x41')]);return db[_0xfbec('0x42')]['find'](_0x117fd3)[_0xfbec('0x23')](handleEntityNotFound(_0x5e7d1c,null))[_0xfbec('0x23')](respondWithResult(_0x5e7d1c,null))[_0xfbec('0x46')](handleError(_0x5e7d1c,null));};exports[_0xfbec('0x48')]=function(_0x2bed4c,_0x5c05a3){return db[_0xfbec('0x42')][_0xfbec('0x48')](_0x2bed4c[_0xfbec('0x49')],{})[_0xfbec('0x23')](function(_0x458ee4){var _0x4e79ff=_0x2bed4c[_0xfbec('0x4a')][_0xfbec('0x4b')]({'plain':!![]});if(!_0x4e79ff)throw new Error(_0xfbec('0x4c'));if(_0x4e79ff[_0xfbec('0x4d')]===_0xfbec('0x4a')){var _0x4e87ea=_0x458ee4[_0xfbec('0x4b')]({'plain':!![]});var _0x30fe9b=_0xfbec('0x4e');return db[_0xfbec('0x4f')][_0xfbec('0x50')]({'where':{'name':_0x30fe9b,'userProfileId':_0x4e79ff[_0xfbec('0x51')]},'raw':!![]})[_0xfbec('0x23')](function(_0x3cb620){if(_0x3cb620&&_0x3cb620[_0xfbec('0x52')]===0x0){return db[_0xfbec('0x53')][_0xfbec('0x48')]({'name':_0x4e87ea[_0xfbec('0x29')],'resourceId':_0x4e87ea['id'],'type':_0xfbec('0x25'),'sectionId':_0x3cb620['id']},{})['then'](function(){return _0x458ee4;});}else{return _0x458ee4;}})[_0xfbec('0x46')](function(_0x358adf){logger[_0xfbec('0x27')](_0xfbec('0x54'),_0x358adf);throw _0x358adf;});}return _0x458ee4;})[_0xfbec('0x23')](respondWithResult(_0x5c05a3,0xc9))[_0xfbec('0x46')](handleError(_0x5c05a3,null));};exports[_0xfbec('0x22')]=function(_0x4a6c0d,_0x4e7a08){if(_0x4a6c0d[_0xfbec('0x49')]['id']){delete _0x4a6c0d[_0xfbec('0x49')]['id'];}return db[_0xfbec('0x42')][_0xfbec('0x50')]({'where':{'id':_0x4a6c0d[_0xfbec('0x47')]['id']}})[_0xfbec('0x23')](handleEntityNotFound(_0x4e7a08,null))['then'](saveUpdates(_0x4a6c0d[_0xfbec('0x49')],null))[_0xfbec('0x23')](respondWithResult(_0x4e7a08,null))[_0xfbec('0x46')](handleError(_0x4e7a08,null));};exports[_0xfbec('0x24')]=function(_0x15e9a0,_0x2296c4){return db[_0xfbec('0x42')]['find']({'where':{'id':_0x15e9a0[_0xfbec('0x47')]['id']}})[_0xfbec('0x23')](handleEntityNotFound(_0x2296c4,null))['then'](removeEntity(_0x2296c4,null))[_0xfbec('0x46')](handleError(_0x2296c4,null));};exports[_0xfbec('0x55')]=function(_0x19cc60,_0x3c587e){var _0x2ca934=0xa;var _0x4fbf88=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),_0xfbec('0x59')];var _0x2b8f02={'SUM':_0xfbec('0x5a'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfbec('0x5b'),'MIN':_0xfbec('0x5c'),'AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x3c2b99={'SEC_TO_TIME':_0xfbec('0x61'),'DATE':'DATE(%s)','HOUR':_0xfbec('0x62'),'ROUND':_0xfbec('0x63'),'UNIX_TIMESTAMP':_0xfbec('0x64')};var _0x3aca57=function(_0x4e77e4){return!_[_0xfbec('0x65')](['IS\x20NULL',_0xfbec('0x66'),'IS\x20EMPTY',_0xfbec('0x67')],_0x4e77e4);};var _0x5ec95b=function(_0x139660){if(!_0x139660||!_0x139660[_0xfbec('0x68')]['length']){return'';}for(var _0x1ee9a5='(',_0x644902=0x0;_0x644902<_0x139660['rules'][_0xfbec('0x69')];_0x644902+=0x1){_0x644902>0x0&&(_0x1ee9a5+='\x20'+_0x139660['operator']+'\x20');_0x1ee9a5+=_0x139660['rules'][_0x644902][_0xfbec('0x6a')]?_0x5ec95b(_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6a')]):_0x139660['rules'][_0x644902][_0xfbec('0x6b')]+'\x20'+_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6c')]+(_0x3aca57(_0x139660[_0xfbec('0x68')][_0x644902][_0xfbec('0x6c')])?'\x20'+_0x139660[_0xfbec('0x68')][_0x644902]['value']:'');}return _0x1ee9a5+')';};var _0x2b4c76={'where':{'id':_0x19cc60[_0xfbec('0x47')]['id']}},_0xc0356a,_0x23d302,_0xa5849e,_0x576fc6,_0x53ca19;_0x2b4c76=_[_0xfbec('0x3f')]({},_0x2b4c76,_0x19cc60[_0xfbec('0x41')]);return db[_0xfbec('0x42')][_0xfbec('0x50')](_0x2b4c76)['then'](function(_0x2654e1){if(_0x2654e1){_0xc0356a=_0x2654e1;return _0x2654e1[_0xfbec('0x6d')]();}return null;})[_0xfbec('0x23')](function(_0x3e4c0c){if(_0x3e4c0c){if(!_0x3e4c0c[_0xfbec('0x69')]){throw new db['Sequelize']['ValidationErrorItem'](_0xfbec('0x6e'),0x193);}_0x23d302=_0x3e4c0c;return db['AnalyticMetric'][_0xfbec('0x45')]({'raw':!![]});}return null;})[_0xfbec('0x23')](function(_0x5c6269){if(_0x5c6269){_0xa5849e=_[_0xfbec('0x6f')](_0x5c6269,'id');var _0x4c3844;var _0x1e2187=squel[_0xfbec('0x70')]();_0x1e2187[_0xfbec('0x71')](_0xc0356a['table']);for(var _0x5dcd8a=0x0;_0x5dcd8a<_0x23d302['length'];_0x5dcd8a+=0x1){_0x4c3844=_0x23d302[_0x5dcd8a][_0xfbec('0x72')]?_0xa5849e[_0x23d302[_0x5dcd8a][_0xfbec('0x72')]]['metric']:_0x23d302[_0x5dcd8a][_0xfbec('0x6b')];_0x4c3844=_0x23d302[_0x5dcd8a][_0xfbec('0x73')]?_['replace'](_0x2b8f02[_0x23d302[_0x5dcd8a][_0xfbec('0x73')]],'%s',_0x4c3844):_0x4c3844;_0x4c3844=_0x23d302[_0x5dcd8a]['format']?_[_0xfbec('0x74')](_0x3c2b99[_0x23d302[_0x5dcd8a][_0xfbec('0x75')]],'%s',_0x4c3844):_0x4c3844;if(_0x23d302[_0x5dcd8a]['groupBy']){_0x1e2187[_0xfbec('0x6a')](_0x4c3844);}_0x23d302[_0x5dcd8a][_0xfbec('0x76')]&&_0x1e2187['order'](_0x4c3844,_0x23d302[_0x5dcd8a]['orderBy']===_0xfbec('0x77')?![]:!![]);_0x1e2187[_0xfbec('0x6b')](_0x4c3844,_0x23d302[_0x5dcd8a][_0xfbec('0x78')]||_0x4c3844);}if(_0xc0356a[_0xfbec('0x79')]){_0xc0356a[_0xfbec('0x79')]=JSON[_0xfbec('0x7a')](_0xc0356a[_0xfbec('0x79')]);for(var _0x53475a=0x0;_0x53475a<_0xc0356a[_0xfbec('0x79')][_0xfbec('0x69')];_0x53475a+=0x1){if(_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x2d')]&&_['includes'](_0x4fbf88,_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x2d')])&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7b')]&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7c')]&&_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7d')]){_0x1e2187[_0xc0356a['joins'][_0x53475a][_0xfbec('0x2d')]](_0xc0356a[_0xfbec('0x79')][_0x53475a]['foreignTable'],null,util[_0xfbec('0x75')](_0xfbec('0x7e'),_0xc0356a[_0xfbec('0x7f')],_0xc0356a[_0xfbec('0x79')][_0x53475a][_0xfbec('0x7b')],_0xc0356a[_0xfbec('0x79')][_0x53475a]['foreignTable'],_0xc0356a['joins'][_0x53475a][_0xfbec('0x7d')]));}}}if(_0xc0356a['conditions']){_0xc0356a['conditions']=JSON['parse'](_0xc0356a[_0xfbec('0x80')]);_0x1e2187['where'](_0x5ec95b(_0xc0356a[_0xfbec('0x80')]['group']));}_0x53ca19=_0x1e2187[_0xfbec('0x81')]();_0x1e2187['limit'](_0x2ca934);_0x1e2187[_0xfbec('0x1c')](0x0);logger[_0xfbec('0x82')](_0xfbec('0x83'),_0x1e2187[_0xfbec('0x84')]());return dbH[_0xfbec('0x85')][_0xfbec('0x33')](_0x1e2187[_0xfbec('0x84')](),{'type':dbH['sequelize'][_0xfbec('0x86')][_0xfbec('0x87')]});}})[_0xfbec('0x23')](respondWithResult(_0x3c587e,null))['catch'](handleError(_0x3c587e,null));};function runReport(_0x43d9bb,_0x4bc655,_0xdd9aa){var _0x9f2c3a=_0x4bc655['name'];var _0x59db5b=0xa;var _0x2d8fbd=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),'cross_join'];var _0x2e7287={'SUM':_0xfbec('0x5a'),'COUNT':_0xfbec('0x88'),'COUNT DISTINCT':_0xfbec('0x89'),'MAX':_0xfbec('0x5b'),'MIN':'MIN(%s)','AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x5b2364={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbec('0x8a'),'HOUR':_0xfbec('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c05e4=function(_0x2d340e){return!_['includes']([_0xfbec('0x8b'),_0xfbec('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x2d340e);};var _0x40713a=function(_0x52d71f){if(!_0x52d71f||!_0x52d71f['rules']['length']){return'';}for(var _0x2b3aa3='(',_0x224751=0x0;_0x224751<_0x52d71f[_0xfbec('0x68')][_0xfbec('0x69')];_0x224751+=0x1){_0x224751>0x0&&(_0x2b3aa3+='\x20'+_0x52d71f[_0xfbec('0x8c')]+'\x20');_0x2b3aa3+=_0x52d71f[_0xfbec('0x68')][_0x224751]['group']?_0x40713a(_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x6a')]):_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x6b')]+'\x20'+_0x52d71f[_0xfbec('0x68')][_0x224751]['condition']+(_0x1c05e4(_0x52d71f[_0xfbec('0x68')][_0x224751]['condition'])?'\x20'+_0x52d71f[_0xfbec('0x68')][_0x224751][_0xfbec('0x8d')]:'');}return _0x2b3aa3+')';};var _0x148cb9={'where':{'id':_0x43d9bb['id']}},_0x27d921,_0x10e58f,_0x5e70d6,_0x4bf568,_0x79e2f4;_0x148cb9=_[_0xfbec('0x3f')]({},_0x148cb9,_0xdd9aa);return db[_0xfbec('0x42')][_0xfbec('0x50')](_0x148cb9)[_0xfbec('0x23')](function(_0x1e6a4e){if(_0x1e6a4e){_0x27d921=_0x1e6a4e;return _0x1e6a4e[_0xfbec('0x6d')]();}return null;})['then'](function(_0x5d748c){if(_0x5d748c){if(!_0x5d748c[_0xfbec('0x69')]){throw new db[(_0xfbec('0x8e'))][(_0xfbec('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10e58f=_0x5d748c;return db[_0xfbec('0x90')][_0xfbec('0x45')]({'raw':!![]});}return null;})[_0xfbec('0x23')](function(_0x27fb9a){if(_0x27fb9a){_0x5e70d6=_[_0xfbec('0x6f')](_0x27fb9a,'id');var _0x102dcf;var _0x144ba8=squel[_0xfbec('0x70')]();_0x144ba8[_0xfbec('0x71')](_0x27d921[_0xfbec('0x7f')]);for(var _0x563295=0x0;_0x563295<_0x10e58f['length'];_0x563295+=0x1){_0x102dcf=_0x10e58f[_0x563295]['MetricId']?_0x5e70d6[_0x10e58f[_0x563295][_0xfbec('0x72')]]['metric']:_0x10e58f[_0x563295][_0xfbec('0x6b')];_0x102dcf=_0x10e58f[_0x563295][_0xfbec('0x73')]?_['replace'](_0x2e7287[_0x10e58f[_0x563295][_0xfbec('0x73')]],'%s',_0x102dcf):_0x102dcf;_0x102dcf=_0x10e58f[_0x563295]['format']?_['replace'](_0x5b2364[_0x10e58f[_0x563295][_0xfbec('0x75')]],'%s',_0x102dcf):_0x102dcf;if(_0x10e58f[_0x563295][_0xfbec('0x91')]){_0x144ba8[_0xfbec('0x6a')](_0x102dcf);}_0x10e58f[_0x563295]['orderBy']&&_0x144ba8[_0xfbec('0x39')](_0x102dcf,_0x10e58f[_0x563295][_0xfbec('0x76')]===_0xfbec('0x77')?![]:!![]);_0x144ba8[_0xfbec('0x6b')](_0x102dcf,_0x10e58f[_0x563295]['alias']||_0x102dcf);}if(_0x27d921[_0xfbec('0x79')]){_0x27d921['joins']=JSON[_0xfbec('0x7a')](_0x27d921['joins']);for(var _0x345f61=0x0;_0x345f61<_0x27d921[_0xfbec('0x79')][_0xfbec('0x69')];_0x345f61+=0x1){if(_0x27d921['joins'][_0x345f61][_0xfbec('0x2d')]&&_[_0xfbec('0x65')](_0x2d8fbd,_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x2d')])&&_0x27d921['joins'][_0x345f61][_0xfbec('0x7b')]&&_0x27d921[_0xfbec('0x79')][_0x345f61]['foreignTable']&&_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7d')]){_0x144ba8[_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x2d')]](_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7c')],null,util['format'](_0xfbec('0x7e'),_0x27d921['table'],_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7b')],_0x27d921[_0xfbec('0x79')][_0x345f61]['foreignTable'],_0x27d921[_0xfbec('0x79')][_0x345f61][_0xfbec('0x7d')]));}}}if(_0x27d921[_0xfbec('0x80')]){_0x27d921[_0xfbec('0x80')]=JSON[_0xfbec('0x7a')](_0x27d921[_0xfbec('0x80')]);_0x144ba8['where'](_0x40713a(_0x27d921['conditions'][_0xfbec('0x6a')]));}_0x79e2f4=_0x144ba8['clone']();_0x144ba8[_0xfbec('0x38')](_0x59db5b);_0x144ba8['offset'](0x0);return;}})['then'](function(){if(_0x4bc655[_0xfbec('0x92')]===_0xfbec('0x93')){return null;}var _0xce0709=_[_0xfbec('0x3f')](_0x4bc655,{'name':_0x4bc655[_0xfbec('0x94')]||_0x4bc655[_0xfbec('0x29')]||_0x27d921['name'],'basename':_0x9f2c3a,'savename':util[_0xfbec('0x75')](_0xfbec('0x95'),_0x4bc655['name']||_0x27d921['name'],require('randomstring')[_0xfbec('0x96')](0x4),_0x4bc655[_0xfbec('0x92')]||_0xfbec('0x97')),'reportId':_0x27d921['id'],'reportType':_0xfbec('0x98')});return db['AnalyticExtractedReport']['create'](_0xce0709,{'raw':!![]});})['then'](function(_0x54890d){if(_0x27d921[_0xfbec('0x7f')]==='cdr'){_0x79e2f4[_0xfbec('0x3b')](_0x27d921[_0xfbec('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4bc655[_0xfbec('0x99')],_0x4bc655[_0xfbec('0x9a')]);}else{_0x79e2f4[_0xfbec('0x3b')](_0x27d921['table']+_0xfbec('0x9b'),_0x4bc655[_0xfbec('0x99')],_0x4bc655[_0xfbec('0x9a')]);}if(_0x54890d){logger[_0xfbec('0x9c')](_0xfbec('0x9d'),_0x79e2f4[_0xfbec('0x84')]());require(_0xfbec('0x9e'))[_0xfbec('0x9f')](path[_0xfbec('0x56')](__dirname,'../../components/export/',_0x54890d[_0xfbec('0x92')]),[_0x54890d['id'],_0x79e2f4[_0xfbec('0x84')](),path[_0xfbec('0x56')](__dirname,'../../files/reports',_0x54890d[_0xfbec('0xa0')]),_0x9f2c3a]);return _0x54890d;}else{var _0x3cde63=squel[_0xfbec('0x70')]();_0x3cde63['from']('('+_0x79e2f4[_0xfbec('0x84')]()+')',_0xfbec('0xa1'));_0x3cde63['field'](_0xfbec('0xa2'),_0xfbec('0x1e'));_0x79e2f4[_0xfbec('0x38')](_0x4bc655[_0xfbec('0x38')]||_0x59db5b);_0x79e2f4[_0xfbec('0x1c')](_0x4bc655[_0xfbec('0x1c')]||0x0);return dbH['sequelize'][_0xfbec('0x33')](_0x3cde63[_0xfbec('0x84')](),{'type':dbH[_0xfbec('0x85')][_0xfbec('0x86')][_0xfbec('0x87')]})[_0xfbec('0x23')](function(_0x10bca6){if(!_0x10bca6[_0xfbec('0x69')]){_0x4bf568=0x0;}else{_0x4bf568=_0x10bca6[0x0]['count']||0x0;}return dbH['sequelize'][_0xfbec('0x33')](_0x79e2f4[_0xfbec('0x84')](),{'type':dbH[_0xfbec('0x85')][_0xfbec('0x86')][_0xfbec('0x87')]});})[_0xfbec('0x23')](function(_0x182965){return{'rows':_0x182965||[],'count':_0x4bf568};});}});}exports[_0xfbec('0xa3')]=function(_0x3cd51d,_0x3e4c53){return runReport(_0x3cd51d[_0xfbec('0x47')],_0x3cd51d[_0xfbec('0x33')],_0x3cd51d[_0xfbec('0x41')])[_0xfbec('0x23')](respondWithResult(_0x3e4c53,null))['catch'](handleError(_0x3e4c53,null));};exports[_0xfbec('0xa4')]=runReport;exports['query']=function(_0x5dd751,_0x3712df){var _0x3aa1f2=0xa;var _0x52ea04=[_0xfbec('0x56'),_0xfbec('0x57'),_0xfbec('0x58'),_0xfbec('0x59')];var _0x37ed45={'SUM':'SUM(%s)','COUNT':_0xfbec('0x88'),'COUNT DISTINCT':_0xfbec('0x89'),'MAX':_0xfbec('0x5b'),'MIN':_0xfbec('0x5c'),'AVG':_0xfbec('0x5d'),'GROUP_CONCAT':_0xfbec('0x5e'),'GROUP_CONCAT ASC':_0xfbec('0x5f'),'GROUP_CONCAT DESC':_0xfbec('0x60')};var _0x42e5ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfbec('0x8a'),'HOUR':_0xfbec('0x62'),'ROUND':_0xfbec('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x14fc6f=function(_0x28e4f5){return!_['includes']([_0xfbec('0x8b'),_0xfbec('0x66'),_0xfbec('0xa5'),'IS\x20NOT\x20EMPTY'],_0x28e4f5);};var _0x39f7b8=function(_0x1bf11e){if(!_0x1bf11e||!_0x1bf11e[_0xfbec('0x68')]['length']){return'';}for(var _0x474a30='(',_0x49c3c1=0x0;_0x49c3c1<_0x1bf11e[_0xfbec('0x68')]['length'];_0x49c3c1+=0x1){_0x49c3c1>0x0&&(_0x474a30+='\x20'+_0x1bf11e[_0xfbec('0x8c')]+'\x20');_0x474a30+=_0x1bf11e['rules'][_0x49c3c1]['group']?_0x39f7b8(_0x1bf11e['rules'][_0x49c3c1]['group']):_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6b')]+'\x20'+_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6c')]+(_0x14fc6f(_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x6c')])?'\x20'+_0x1bf11e[_0xfbec('0x68')][_0x49c3c1][_0xfbec('0x8d')]:'');}return _0x474a30+')';};var _0x105556={'where':{'id':_0x5dd751['params']['id']}},_0x1c14d8,_0x477080,_0x12d0e7,_0x31ef74,_0x2cc5c4;_0x105556=_['merge']({},_0x105556,_0x5dd751[_0xfbec('0x41')]);return db[_0xfbec('0x42')]['find'](_0x105556)[_0xfbec('0x23')](function(_0x37e273){if(_0x37e273){_0x1c14d8=_0x37e273;return _0x37e273[_0xfbec('0x6d')]();}return null;})[_0xfbec('0x23')](function(_0x126df9){if(_0x126df9){if(!_0x126df9[_0xfbec('0x69')]){throw new db['Sequelize'][(_0xfbec('0x8f'))](_0xfbec('0x6e'),0x193);}_0x477080=_0x126df9;return db[_0xfbec('0x90')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x25cf73){if(_0x25cf73){_0x12d0e7=_[_0xfbec('0x6f')](_0x25cf73,'id');var _0x5df29a;var _0x145086=squel[_0xfbec('0x70')]();_0x145086[_0xfbec('0x71')](_0x1c14d8[_0xfbec('0x7f')]);for(var _0x52445c=0x0;_0x52445c<_0x477080[_0xfbec('0x69')];_0x52445c+=0x1){_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x72')]?_0x12d0e7[_0x477080[_0x52445c]['MetricId']]['metric']:_0x477080[_0x52445c]['field'];_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x73')]?_[_0xfbec('0x74')](_0x37ed45[_0x477080[_0x52445c]['function']],'%s',_0x5df29a):_0x5df29a;_0x5df29a=_0x477080[_0x52445c][_0xfbec('0x75')]?_[_0xfbec('0x74')](_0x42e5ed[_0x477080[_0x52445c]['format']],'%s',_0x5df29a):_0x5df29a;if(_0x477080[_0x52445c][_0xfbec('0x91')]){_0x145086[_0xfbec('0x6a')](_0x5df29a);}_0x477080[_0x52445c][_0xfbec('0x76')]&&_0x145086[_0xfbec('0x39')](_0x5df29a,_0x477080[_0x52445c][_0xfbec('0x76')]===_0xfbec('0x77')?![]:!![]);_0x145086['field'](_0x5df29a,_0x477080[_0x52445c]['alias']||_0x5df29a);}if(_0x1c14d8[_0xfbec('0x79')]){_0x1c14d8[_0xfbec('0x79')]=JSON[_0xfbec('0x7a')](_0x1c14d8[_0xfbec('0x79')]);for(var _0x39372d=0x0;_0x39372d<_0x1c14d8[_0xfbec('0x79')]['length'];_0x39372d+=0x1){if(_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x2d')]&&_['includes'](_0x52ea04,_0x1c14d8['joins'][_0x39372d][_0xfbec('0x2d')])&&_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7b')]&&_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7c')]&&_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7d')]){_0x145086[_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x2d')]](_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7c')],null,util['format'](_0xfbec('0x7e'),_0x1c14d8[_0xfbec('0x7f')],_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7b')],_0x1c14d8[_0xfbec('0x79')][_0x39372d][_0xfbec('0x7c')],_0x1c14d8['joins'][_0x39372d][_0xfbec('0x7d')]));}}}if(_0x1c14d8[_0xfbec('0x80')]){_0x1c14d8['conditions']=JSON[_0xfbec('0x7a')](_0x1c14d8[_0xfbec('0x80')]);_0x145086[_0xfbec('0x3b')](_0x39f7b8(_0x1c14d8[_0xfbec('0x80')][_0xfbec('0x6a')]));}_0x2cc5c4=_0x145086['clone']();_0x145086[_0xfbec('0x38')](_0x3aa1f2);_0x145086[_0xfbec('0x1c')](0x0);logger[_0xfbec('0x82')](_0xfbec('0x83'),_0x145086[_0xfbec('0x84')]());return dbH[_0xfbec('0x85')]['query'](_0x145086['toString'](),{'type':dbH['sequelize'][_0xfbec('0x86')][_0xfbec('0x87')]});}})[_0xfbec('0x23')](function(){return{'sql':_0x2cc5c4[_0xfbec('0x84')]()};})[_0xfbec('0x23')](respondWithResult(_0x3712df,null))[_0xfbec('0x46')](handleError(_0x3712df,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index db5b021..0ce6c60 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 _0x51b5=['api','moment','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x14fd8d,_0x2619a8){var _0x4b3548=function(_0xa32e46){while(--_0xa32e46){_0x14fd8d['push'](_0x14fd8d['shift']());}};_0x4b3548(++_0x2619a8);}(_0x51b5,0x11b));var _0x551b=function(_0x1b5edd,_0x2aab3c){_0x1b5edd=_0x1b5edd-0x0;var _0x3076a3=_0x51b5[_0x1b5edd];return _0x3076a3;};'use strict';var _=require(_0x551b('0x0'));var util=require(_0x551b('0x1'));var logger=require(_0x551b('0x2'))(_0x551b('0x3'));var moment=require(_0x551b('0x4'));var BPromise=require('bluebird');var rp=require(_0x551b('0x5'));var fs=require('fs');var path=require(_0x551b('0x6'));var rimraf=require(_0x551b('0x7'));var config=require('../../config/environment');var attributes=require(_0x551b('0x8'));module[_0x551b('0x9')]=function(_0x53a106,_0x14e847){return _0x53a106[_0x551b('0xa')](_0x551b('0xb'),attributes,{'tableName':_0x551b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5be=['define','AnalyticCustomReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xd5be,0xd3));var _0xed5b=function(_0x4de1b5,_0x2a7626){_0x4de1b5=_0x4de1b5-0x0;var _0xed55cf=_0xd5be[_0x4de1b5];return _0xed55cf;};'use strict';var _=require(_0xed5b('0x0'));var util=require('util');var logger=require(_0xed5b('0x1'))(_0xed5b('0x2'));var moment=require(_0xed5b('0x3'));var BPromise=require(_0xed5b('0x4'));var rp=require(_0xed5b('0x5'));var fs=require('fs');var path=require(_0xed5b('0x6'));var rimraf=require(_0xed5b('0x7'));var config=require('../../config/environment');var attributes=require(_0xed5b('0x8'));module['exports']=function(_0x4735f1,_0xd04360){return _0x4735f1[_0xed5b('0x9')](_0xed5b('0xa'),attributes,{'tableName':'analytics_custom_reports','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 cf9d6a6..a10b22b 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 _0xfe27=['error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','stringify'];(function(_0x34f7f8,_0x2a3a03){var _0x3a5c8c=function(_0x58d180){while(--_0x58d180){_0x34f7f8['push'](_0x34f7f8['shift']());}};_0x3a5c8c(++_0x2a3a03);}(_0xfe27,0x175));var _0x7fe2=function(_0x1eb2b7,_0x37c80f){_0x1eb2b7=_0x1eb2b7-0x0;var _0x3284ad=_0xfe27[_0x1eb2b7];return _0x3284ad;};'use strict';var _=require(_0x7fe2('0x0'));var util=require(_0x7fe2('0x1'));var moment=require(_0x7fe2('0x2'));var BPromise=require(_0x7fe2('0x3'));var rs=require(_0x7fe2('0x4'));var fs=require('fs');var Redis=require(_0x7fe2('0x5'));var db=require(_0x7fe2('0x6'))['db'];var utils=require(_0x7fe2('0x7'));var logger=require(_0x7fe2('0x8'))(_0x7fe2('0x9'));var config=require(_0x7fe2('0xa'));var jayson=require(_0x7fe2('0xb'));var client=jayson[_0x7fe2('0xc')][_0x7fe2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28a7e0,_0x554131,_0x43792a){return new BPromise(function(_0x56caa1,_0x5ea6c3){return client['request'](_0x28a7e0,_0x43792a)['then'](function(_0x418a45){logger[_0x7fe2('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x554131,_0x7fe2('0xf'));logger[_0x7fe2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x554131,_0x7fe2('0xf'),JSON[_0x7fe2('0x11')](_0x418a45));if(_0x418a45[_0x7fe2('0x12')]){if(_0x418a45[_0x7fe2('0x12')]['code']===0x1f4){logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x418a45[_0x7fe2('0x12')][_0x7fe2('0x14')]);return _0x5ea6c3(_0x418a45['error']['message']);}logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x418a45[_0x7fe2('0x12')]['message']);return _0x56caa1(_0x418a45[_0x7fe2('0x12')][_0x7fe2('0x14')]);}else{logger[_0x7fe2('0xe')](_0x7fe2('0x13'),_0x554131,_0x7fe2('0xf'));_0x56caa1(_0x418a45[_0x7fe2('0x15')][_0x7fe2('0x14')]);}})[_0x7fe2('0x16')](function(_0x3de449){logger[_0x7fe2('0x12')](_0x7fe2('0x13'),_0x554131,_0x3de449);_0x5ea6c3(_0x3de449);});});} \ No newline at end of file +var _0x2f82=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f82,0xf9));var _0x22f8=function(_0x416d75,_0x2c8e81){_0x416d75=_0x416d75-0x0;var _0x10af66=_0x2f82[_0x416d75];return _0x10af66;};'use strict';var _=require('lodash');var util=require(_0x22f8('0x0'));var moment=require(_0x22f8('0x1'));var BPromise=require(_0x22f8('0x2'));var rs=require(_0x22f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22f8('0x4'))['db'];var utils=require(_0x22f8('0x5'));var logger=require(_0x22f8('0x6'))('rpc');var config=require(_0x22f8('0x7'));var jayson=require(_0x22f8('0x8'));var client=jayson[_0x22f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336aad,_0x268449,_0xdf18e6){return new BPromise(function(_0x399bd4,_0x5b92a1){return client[_0x22f8('0xa')](_0x336aad,_0xdf18e6)[_0x22f8('0xb')](function(_0x469870){logger[_0x22f8('0xc')](_0x22f8('0xd'),_0x268449,_0x22f8('0xe'));logger['debug'](_0x22f8('0xf'),_0x268449,_0x22f8('0xe'),JSON[_0x22f8('0x10')](_0x469870));if(_0x469870[_0x22f8('0x11')]){if(_0x469870[_0x22f8('0x11')][_0x22f8('0x12')]===0x1f4){logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);return _0x5b92a1(_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);}logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x469870['error'][_0x22f8('0x13')]);return _0x399bd4(_0x469870[_0x22f8('0x11')][_0x22f8('0x13')]);}else{logger['info'](_0x22f8('0xd'),_0x268449,_0x22f8('0xe'));_0x399bd4(_0x469870[_0x22f8('0x14')][_0x22f8('0x13')]);}})[_0x22f8('0x15')](function(_0x146e6c){logger[_0x22f8('0x11')](_0x22f8('0xd'),_0x268449,_0x146e6c);_0x5b92a1(_0x146e6c);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 92fec7f..b327569 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 _0x024b=['create','/:id','update','destroy','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query','query','post'];(function(_0x33ea2d,_0x1a39f7){var _0x461e0c=function(_0x49f2ee){while(--_0x49f2ee){_0x33ea2d['push'](_0x33ea2d['shift']());}};_0x461e0c(++_0x1a39f7);}(_0x024b,0x10d));var _0xb024=function(_0x30fb50,_0x48e0f6){_0x30fb50=_0x30fb50-0x0;var _0x33a79f=_0x024b[_0x30fb50];return _0x33a79f;};'use strict';var multer=require(_0xb024('0x0'));var util=require(_0xb024('0x1'));var path=require(_0xb024('0x2'));var timeout=require(_0xb024('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb024('0x4'));var config=require(_0xb024('0x5'));var controller=require(_0xb024('0x6'));router[_0xb024('0x7')]('/',auth[_0xb024('0x8')](),controller[_0xb024('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb024('0xa')]);router[_0xb024('0x7')](_0xb024('0xb'),auth[_0xb024('0x8')](),controller['preview']);router[_0xb024('0x7')](_0xb024('0xc'),auth[_0xb024('0x8')](),controller[_0xb024('0xd')]);router[_0xb024('0x7')](_0xb024('0xe'),auth[_0xb024('0x8')](),controller[_0xb024('0xf')]);router[_0xb024('0x10')]('/',auth[_0xb024('0x8')](),controller[_0xb024('0x11')]);router['put'](_0xb024('0x12'),auth[_0xb024('0x8')](),controller[_0xb024('0x13')]);router['delete'](_0xb024('0x12'),auth['isAuthenticated'](),controller[_0xb024('0x14')]);module[_0xb024('0x15')]=router; \ No newline at end of file +var _0xa4cd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','run','query','post','create','put','/:id','update','delete','exports','multer','util','express'];(function(_0x47b5e0,_0x273723){var _0x128d60=function(_0x5dc543){while(--_0x5dc543){_0x47b5e0['push'](_0x47b5e0['shift']());}};_0x128d60(++_0x273723);}(_0xa4cd,0x1b2));var _0xda4c=function(_0x59c06d,_0x50f5bf){_0x59c06d=_0x59c06d-0x0;var _0x96bdc4=_0xa4cd[_0x59c06d];return _0x96bdc4;};'use strict';var multer=require(_0xda4c('0x0'));var util=require(_0xda4c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda4c('0x2'));var router=express['Router']();var fs_extra=require(_0xda4c('0x3'));var auth=require(_0xda4c('0x4'));var interaction=require(_0xda4c('0x5'));var config=require(_0xda4c('0x6'));var controller=require(_0xda4c('0x7'));router[_0xda4c('0x8')]('/',auth[_0xda4c('0x9')](),controller[_0xda4c('0xa')]);router[_0xda4c('0x8')]('/:id',auth[_0xda4c('0x9')](),controller[_0xda4c('0xb')]);router[_0xda4c('0x8')](_0xda4c('0xc'),auth[_0xda4c('0x9')](),controller[_0xda4c('0xd')]);router[_0xda4c('0x8')]('/:id/run',auth[_0xda4c('0x9')](),controller[_0xda4c('0xe')]);router[_0xda4c('0x8')]('/:id/query',auth[_0xda4c('0x9')](),controller[_0xda4c('0xf')]);router[_0xda4c('0x10')]('/',auth[_0xda4c('0x9')](),controller[_0xda4c('0x11')]);router[_0xda4c('0x12')](_0xda4c('0x13'),auth[_0xda4c('0x9')](),controller[_0xda4c('0x14')]);router[_0xda4c('0x15')](_0xda4c('0x13'),auth[_0xda4c('0x9')](),controller['destroy']);module[_0xda4c('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 2f9aa3a..9732304 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x29b851,_0x3591d3){_0x29b851=_0x29b851-0x0;var _0x2c8db6=_0xdc97[_0x29b851];return _0x2c8db6;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0xafc4=['sequelize','STRING','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xafc4,0x69));var _0x4afc=function(_0x1a11b9,_0x346d4d){_0x1a11b9=_0x1a11b9-0x0;var _0x21c4b3=_0xafc4[_0x1a11b9];return _0x21c4b3;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'name':{'type':Sequelize[_0x4afc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4afc('0x1')]},'table':{'type':Sequelize[_0x4afc('0x1')]},'conditions':{'type':Sequelize[_0x4afc('0x2')]},'joins':{'type':Sequelize[_0x4afc('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index e9e2b99..8174487 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 _0xdbf5=['includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','debug','Limited\x20Query:','toString','SELECT','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20EMPTY','ValidationErrorItem','metric','DESC','clone','output','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','startDate','endDate','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','sequelize','QueryTypes','run','Sequelize','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','end','status','json','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','catch','update','join','left_join','right_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x7ace97,_0x3b5780){_0x7ace97=_0x7ace97-0x0;var _0x22e0ac=_0xdbf5[_0x7ace97];return _0x22e0ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5dbf('0x16'))[_0x5dbf('0x17')];function respondWithStatusCode(_0x1453a9,_0x7cb848){_0x7cb848=_0x7cb848||0xcc;return function(_0x14493a){if(_0x14493a){return _0x1453a9['sendStatus'](_0x7cb848);}return _0x1453a9['status'](_0x7cb848)[_0x5dbf('0x18')]();};}function respondWithResult(_0x3480c8,_0x48e7fd){_0x48e7fd=_0x48e7fd||0xc8;return function(_0x19624e){if(_0x19624e){return _0x3480c8[_0x5dbf('0x19')](_0x48e7fd)[_0x5dbf('0x1a')](_0x19624e);}};}function respondWithFilteredResult(_0x2dfa44,_0x181816){return function(_0x472eb9){if(_0x472eb9){var _0x2d32cc=typeof _0x181816['offset']==='undefined'&&typeof _0x181816[_0x5dbf('0x1b')]===_0x5dbf('0x1c');var _0x39c7aa=_0x472eb9[_0x5dbf('0x1d')];var _0x20c2b0=_0x2d32cc?0x0:_0x181816['offset'];var _0x11cd00=_0x2d32cc?_0x472eb9['count']:_0x181816['offset']+_0x181816['limit'];var _0x23d1e7;if(_0x11cd00>=_0x39c7aa){_0x11cd00=_0x39c7aa;_0x23d1e7=0xc8;}else{_0x23d1e7=0xce;}_0x2dfa44[_0x5dbf('0x19')](_0x23d1e7);return _0x2dfa44[_0x5dbf('0x1e')](_0x5dbf('0x1f'),_0x20c2b0+'-'+_0x11cd00+'/'+_0x39c7aa)[_0x5dbf('0x1a')](_0x472eb9);}return null;};}function patchUpdates(_0x5b2518){return function(_0x2764ea){try{jsonpatch['apply'](_0x2764ea,_0x5b2518,!![]);}catch(_0xb68f92){return BPromise[_0x5dbf('0x20')](_0xb68f92);}return _0x2764ea[_0x5dbf('0x21')]();};}function saveUpdates(_0x43a612,_0x3b763c){return function(_0x2f154e){if(_0x2f154e){return _0x2f154e['update'](_0x43a612)[_0x5dbf('0x22')](function(_0x3e3a2d){return _0x3e3a2d;});}return null;};}function removeEntity(_0x2d3e1b,_0x2079fc){return function(_0x2763ec){if(_0x2763ec){return _0x2763ec[_0x5dbf('0x23')]()[_0x5dbf('0x22')](function(){var _0x20ab1b=_0x2763ec[_0x5dbf('0x24')]({'plain':!![]});var _0x15a790=_0x5dbf('0x25');return db[_0x5dbf('0x26')][_0x5dbf('0x23')]({'where':{'type':_0x15a790,'resourceId':_0x20ab1b['id']}})[_0x5dbf('0x22')](function(){return _0x2763ec;});})[_0x5dbf('0x22')](function(){_0x2d3e1b[_0x5dbf('0x19')](0xcc)[_0x5dbf('0x18')]();});}};}function handleEntityNotFound(_0x3f8341,_0x159e61){return function(_0x22ec42){if(!_0x22ec42){_0x3f8341[_0x5dbf('0x27')](0x194);}return _0x22ec42;};}function handleError(_0x471027,_0x21cd00){_0x21cd00=_0x21cd00||0x1f4;return function(_0x5768b7){logger[_0x5dbf('0x28')](_0x5768b7[_0x5dbf('0x29')]);if(_0x5768b7[_0x5dbf('0x2a')]){delete _0x5768b7[_0x5dbf('0x2a')];}_0x471027[_0x5dbf('0x19')](_0x21cd00)[_0x5dbf('0x2b')](_0x5768b7);};}exports[_0x5dbf('0x2c')]=function(_0x31d57a,_0x406ce6){var _0x273b63={},_0x294dd7={},_0x50a307={'count':0x0,'rows':[]};var _0x4c1587=_[_0x5dbf('0x2d')](db[_0x5dbf('0x2e')][_0x5dbf('0x2f')],function(_0x3b73ad){return{'name':_0x3b73ad[_0x5dbf('0x30')],'type':_0x3b73ad['type']['key']};});_0x294dd7[_0x5dbf('0x31')]=_[_0x5dbf('0x2d')](_0x4c1587,'name');_0x294dd7[_0x5dbf('0x32')]=_[_0x5dbf('0x33')](_0x31d57a[_0x5dbf('0x32')]);_0x294dd7[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x294dd7['model'],_0x294dd7[_0x5dbf('0x32')]);_0x273b63[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x294dd7[_0x5dbf('0x31')],qs[_0x5dbf('0x37')](_0x31d57a['query'][_0x5dbf('0x37')]));_0x273b63[_0x5dbf('0x36')]=_0x273b63[_0x5dbf('0x36')][_0x5dbf('0x38')]?_0x273b63['attributes']:_0x294dd7[_0x5dbf('0x31')];if(!_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x39')](_0x5dbf('0x3a'))){_0x273b63[_0x5dbf('0x1b')]=qs[_0x5dbf('0x1b')](_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x1b')]);_0x273b63[_0x5dbf('0x3b')]=qs[_0x5dbf('0x3b')](_0x31d57a[_0x5dbf('0x32')]['offset']);}_0x273b63[_0x5dbf('0x3c')]=qs[_0x5dbf('0x3d')](_0x31d57a[_0x5dbf('0x32')]['sort']);_0x273b63[_0x5dbf('0x3e')]=qs[_0x5dbf('0x34')](_[_0x5dbf('0x3f')](_0x31d57a['query'],_0x294dd7[_0x5dbf('0x34')]),_0x4c1587);if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x40')]){_0x273b63['where']=_[_0x5dbf('0x41')](_0x273b63[_0x5dbf('0x3e')],{'$or':_[_0x5dbf('0x2d')](_0x4c1587,function(_0x260c9f){if(_0x260c9f[_0x5dbf('0x42')]!==_0x5dbf('0x43')){var _0x321ae3={};_0x321ae3[_0x260c9f[_0x5dbf('0x2a')]]={'$like':'%'+_0x31d57a['query']['filter']+'%'};return _0x321ae3;}})});}_0x273b63=_['merge']({},_0x273b63,_0x31d57a['options']);var _0x28b28f={'where':_0x273b63[_0x5dbf('0x3e')]};return db['AnalyticDefaultReport'][_0x5dbf('0x1d')](_0x28b28f)[_0x5dbf('0x22')](function(_0x5a60e8){_0x50a307[_0x5dbf('0x1d')]=_0x5a60e8;if(_0x31d57a[_0x5dbf('0x32')][_0x5dbf('0x44')]){_0x273b63[_0x5dbf('0x45')]=[{'all':!![]}];}return db[_0x5dbf('0x2e')][_0x5dbf('0x46')](_0x273b63);})[_0x5dbf('0x22')](function(_0x1c020a){_0x50a307[_0x5dbf('0x47')]=_0x1c020a;return _0x50a307;})[_0x5dbf('0x22')](respondWithFilteredResult(_0x406ce6,_0x273b63))['catch'](handleError(_0x406ce6,null));};exports[_0x5dbf('0x48')]=function(_0x22f958,_0xec1d28){var _0x50880d={'raw':!![],'where':{'id':_0x22f958[_0x5dbf('0x49')]['id']}},_0x16b0ff={};_0x16b0ff[_0x5dbf('0x31')]=_[_0x5dbf('0x33')](db['AnalyticDefaultReport'][_0x5dbf('0x2f')]);_0x16b0ff['query']=_[_0x5dbf('0x33')](_0x22f958[_0x5dbf('0x32')]);_0x16b0ff[_0x5dbf('0x34')]=_[_0x5dbf('0x35')](_0x16b0ff['model'],_0x16b0ff['query']);_0x50880d[_0x5dbf('0x36')]=_[_0x5dbf('0x35')](_0x16b0ff[_0x5dbf('0x31')],qs['fields'](_0x22f958[_0x5dbf('0x32')]['fields']));_0x50880d['attributes']=_0x50880d['attributes']['length']?_0x50880d[_0x5dbf('0x36')]:_0x16b0ff[_0x5dbf('0x31')];if(_0x22f958['query'][_0x5dbf('0x44')]){_0x50880d[_0x5dbf('0x45')]=[{'all':!![]}];}_0x50880d=_['merge']({},_0x50880d,_0x22f958[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')]['find'](_0x50880d)[_0x5dbf('0x22')](handleEntityNotFound(_0xec1d28,null))['then'](respondWithResult(_0xec1d28,null))['catch'](handleError(_0xec1d28,null));};exports[_0x5dbf('0x4b')]=function(_0x2a3d30,_0x17a1c0){return db['AnalyticDefaultReport']['create'](_0x2a3d30[_0x5dbf('0x4c')],{})[_0x5dbf('0x22')](function(_0x21f477){var _0x307a00=_0x2a3d30[_0x5dbf('0x4d')][_0x5dbf('0x24')]({'plain':!![]});if(!_0x307a00)throw new Error(_0x5dbf('0x4e'));if(_0x307a00[_0x5dbf('0x4f')]==='user'){var _0x3f38a0=_0x21f477[_0x5dbf('0x24')]({'plain':!![]});var _0x2927a3=_0x5dbf('0x50');return db[_0x5dbf('0x51')][_0x5dbf('0x52')]({'where':{'name':_0x2927a3,'userProfileId':_0x307a00[_0x5dbf('0x53')]},'raw':!![]})['then'](function(_0x1b0b13){if(_0x1b0b13&&_0x1b0b13['autoAssociation']===0x0){return db[_0x5dbf('0x26')][_0x5dbf('0x4b')]({'name':_0x3f38a0[_0x5dbf('0x2a')],'resourceId':_0x3f38a0['id'],'type':_0x5dbf('0x25'),'sectionId':_0x1b0b13['id']},{})[_0x5dbf('0x22')](function(){return _0x21f477;});}else{return _0x21f477;}})[_0x5dbf('0x54')](function(_0x353d0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x353d0f);throw _0x353d0f;});}return _0x21f477;})['then'](respondWithResult(_0x17a1c0,0xc9))[_0x5dbf('0x54')](handleError(_0x17a1c0,null));};exports[_0x5dbf('0x55')]=function(_0x36a787,_0x56c8b2){if(_0x36a787['body']['id']){delete _0x36a787[_0x5dbf('0x4c')]['id'];}return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x36a787['params']['id']}})[_0x5dbf('0x22')](handleEntityNotFound(_0x56c8b2,null))['then'](saveUpdates(_0x36a787[_0x5dbf('0x4c')],null))[_0x5dbf('0x22')](respondWithResult(_0x56c8b2,null))[_0x5dbf('0x54')](handleError(_0x56c8b2,null));};exports['destroy']=function(_0x55fd51,_0x1b316d){return db[_0x5dbf('0x2e')][_0x5dbf('0x52')]({'where':{'id':_0x55fd51[_0x5dbf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b316d,null))[_0x5dbf('0x22')](removeEntity(_0x1b316d,null))[_0x5dbf('0x54')](handleError(_0x1b316d,null));};exports['preview']=function(_0x5485f3,_0x19ec03){var _0x14bdb1=0xa;var _0x197e8c=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),'cross_join'];var _0x4107f1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5dbf('0x59'),'MIN':'MIN(%s)','AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x461ffb={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x3a84c2=function(_0x2ca889){return!_[_0x5dbf('0x63')]([_0x5dbf('0x64'),_0x5dbf('0x65'),'IS\x20EMPTY',_0x5dbf('0x66')],_0x2ca889);};var _0x553be4=function(_0xb0a9bf){if(!_0xb0a9bf||!_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x110224='(',_0x5a975a=0x0;_0x5a975a<_0xb0a9bf[_0x5dbf('0x67')][_0x5dbf('0x38')];_0x5a975a+=0x1){_0x5a975a>0x0&&(_0x110224+='\x20'+_0xb0a9bf[_0x5dbf('0x68')]+'\x20');_0x110224+=_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x69')]?_0x553be4(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a]['group']):_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6a')]+'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')]+(_0x3a84c2(_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6b')])?'\x20'+_0xb0a9bf[_0x5dbf('0x67')][_0x5a975a][_0x5dbf('0x6c')]:'');}return _0x110224+')';};var _0x12d69b={'where':{'id':_0x5485f3[_0x5dbf('0x49')]['id']}},_0x3b53da,_0x13c8ab,_0x2997a8,_0x5d7a37,_0x52109d;_0x12d69b=_[_0x5dbf('0x41')]({},_0x12d69b,_0x5485f3[_0x5dbf('0x4a')]);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x12d69b)[_0x5dbf('0x22')](function(_0x1b42cf){if(_0x1b42cf){_0x3b53da=_0x1b42cf;return _0x1b42cf[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x57c568){if(_0x57c568){if(!_0x57c568['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x5dbf('0x6e'),0x193);}_0x13c8ab=_0x57c568;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x29c4d9){if(_0x29c4d9){_0x2997a8=_[_0x5dbf('0x70')](_0x29c4d9,'id');var _0x5331ff;var _0x5bb990=squel[_0x5dbf('0x71')]();_0x5bb990[_0x5dbf('0x72')](_0x3b53da['table']);for(var _0x1728b9=0x0;_0x1728b9<_0x13c8ab[_0x5dbf('0x38')];_0x1728b9+=0x1){_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]?_0x2997a8[_0x13c8ab[_0x1728b9][_0x5dbf('0x73')]]['metric']:_0x13c8ab[_0x1728b9][_0x5dbf('0x6a')];_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4107f1[_0x13c8ab[_0x1728b9][_0x5dbf('0x74')]],'%s',_0x5331ff):_0x5331ff;_0x5331ff=_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]?_['replace'](_0x461ffb[_0x13c8ab[_0x1728b9][_0x5dbf('0x76')]],'%s',_0x5331ff):_0x5331ff;if(_0x13c8ab[_0x1728b9][_0x5dbf('0x77')]){_0x5bb990[_0x5dbf('0x69')](_0x5331ff);}_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]&&_0x5bb990['order'](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x78')]==='DESC'?![]:!![]);_0x5bb990[_0x5dbf('0x6a')](_0x5331ff,_0x13c8ab[_0x1728b9][_0x5dbf('0x79')]||_0x5331ff);}if(_0x3b53da[_0x5dbf('0x7a')]){_0x3b53da['joins']=JSON[_0x5dbf('0x7b')](_0x3b53da[_0x5dbf('0x7a')]);for(var _0x4166ce=0x0;_0x4166ce<_0x3b53da[_0x5dbf('0x7a')]['length'];_0x4166ce+=0x1){if(_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x197e8c,_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')])&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce]['parentKey']&&_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')]&&_0x3b53da['joins'][_0x4166ce][_0x5dbf('0x7d')]){_0x5bb990[_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x42')]](_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')](_0x5dbf('0x7e'),_0x3b53da[_0x5dbf('0x7f')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x80')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7c')],_0x3b53da[_0x5dbf('0x7a')][_0x4166ce][_0x5dbf('0x7d')]));}}}if(_0x3b53da[_0x5dbf('0x81')]){_0x3b53da[_0x5dbf('0x81')]=JSON['parse'](_0x3b53da[_0x5dbf('0x81')]);_0x5bb990[_0x5dbf('0x3e')](_0x553be4(_0x3b53da[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x52109d=_0x5bb990['clone']();_0x5bb990[_0x5dbf('0x1b')](_0x14bdb1);_0x5bb990[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')](_0x5dbf('0x83'),_0x5bb990[_0x5dbf('0x84')]());return dbH['sequelize'][_0x5dbf('0x32')](_0x5bb990[_0x5dbf('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x5dbf('0x85')]});}})[_0x5dbf('0x22')](respondWithResult(_0x19ec03,null))[_0x5dbf('0x54')](handleError(_0x19ec03,null));};function runReport(_0x8ca7de,_0x14b21b,_0x23ec75){var _0x22339b=_0x14b21b['name'];var _0x310078=0xa;var _0x3b01c0=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x4cceb1={'SUM':_0x5dbf('0x87'),'COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5924d2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5dbf('0x5f'),'HOUR':_0x5dbf('0x60'),'ROUND':_0x5dbf('0x61'),'UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x4333db=function(_0x4cb92d){return!_['includes']([_0x5dbf('0x64'),'IS\x20NOT\x20NULL',_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x4cb92d);};var _0x541241=function(_0x3c7eaa){if(!_0x3c7eaa||!_0x3c7eaa['rules'][_0x5dbf('0x38')]){return'';}for(var _0x24d90a='(',_0xa3e94f=0x0;_0xa3e94f<_0x3c7eaa[_0x5dbf('0x67')][_0x5dbf('0x38')];_0xa3e94f+=0x1){_0xa3e94f>0x0&&(_0x24d90a+='\x20'+_0x3c7eaa['operator']+'\x20');_0x24d90a+=_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]?_0x541241(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x69')]):_0x3c7eaa['rules'][_0xa3e94f][_0x5dbf('0x6a')]+'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')]+(_0x4333db(_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6b')])?'\x20'+_0x3c7eaa[_0x5dbf('0x67')][_0xa3e94f][_0x5dbf('0x6c')]:'');}return _0x24d90a+')';};var _0x334f63={'where':{'id':_0x8ca7de['id']}},_0x5ac29f,_0x533fdd,_0x5bf068,_0x1bd06b,_0x274497;_0x334f63=_['merge']({},_0x334f63,_0x23ec75);return db['AnalyticDefaultReport']['find'](_0x334f63)[_0x5dbf('0x22')](function(_0x20bda9){if(_0x20bda9){_0x5ac29f=_0x20bda9;return _0x20bda9[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x12757d){if(_0x12757d){if(!_0x12757d[_0x5dbf('0x38')]){throw new db['Sequelize'][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x533fdd=_0x12757d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x5722b3){if(_0x5722b3){_0x5bf068=_['keyBy'](_0x5722b3,'id');var _0x3a27c4;var _0x3620d2=squel[_0x5dbf('0x71')]();_0x3620d2['from'](_0x5ac29f[_0x5dbf('0x7f')]);for(var _0x447259=0x0;_0x447259<_0x533fdd['length'];_0x447259+=0x1){_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x73')]?_0x5bf068[_0x533fdd[_0x447259][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x533fdd[_0x447259][_0x5dbf('0x6a')];_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x4cceb1[_0x533fdd[_0x447259][_0x5dbf('0x74')]],'%s',_0x3a27c4):_0x3a27c4;_0x3a27c4=_0x533fdd[_0x447259][_0x5dbf('0x76')]?_['replace'](_0x5924d2[_0x533fdd[_0x447259]['format']],'%s',_0x3a27c4):_0x3a27c4;if(_0x533fdd[_0x447259]['groupBy']){_0x3620d2[_0x5dbf('0x69')](_0x3a27c4);}_0x533fdd[_0x447259][_0x5dbf('0x78')]&&_0x3620d2[_0x5dbf('0x3c')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x78')]===_0x5dbf('0x8e')?![]:!![]);_0x3620d2[_0x5dbf('0x6a')](_0x3a27c4,_0x533fdd[_0x447259][_0x5dbf('0x79')]||_0x3a27c4);}if(_0x5ac29f[_0x5dbf('0x7a')]){_0x5ac29f[_0x5dbf('0x7a')]=JSON[_0x5dbf('0x7b')](_0x5ac29f['joins']);for(var _0x2ded2b=0x0;_0x2ded2b<_0x5ac29f[_0x5dbf('0x7a')][_0x5dbf('0x38')];_0x2ded2b+=0x1){if(_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x3b01c0,_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x42')])&&_0x5ac29f['joins'][_0x2ded2b]['parentKey']&&_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b]['foreignTable']&&_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7d')]){_0x3620d2[_0x5ac29f['joins'][_0x2ded2b]['type']](_0x5ac29f['joins'][_0x2ded2b]['foreignTable'],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x5ac29f[_0x5dbf('0x7f')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x80')],_0x5ac29f['joins'][_0x2ded2b][_0x5dbf('0x7c')],_0x5ac29f[_0x5dbf('0x7a')][_0x2ded2b][_0x5dbf('0x7d')]));}}}if(_0x5ac29f['conditions']){_0x5ac29f[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x5ac29f[_0x5dbf('0x81')]);_0x3620d2['where'](_0x541241(_0x5ac29f[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0x274497=_0x3620d2[_0x5dbf('0x8f')]();_0x3620d2['limit'](_0x310078);_0x3620d2[_0x5dbf('0x3b')](0x0);return;}})[_0x5dbf('0x22')](function(){if(_0x14b21b[_0x5dbf('0x90')]==='web'){return null;}var _0x48a8c5=_['merge'](_0x14b21b,{'name':_0x14b21b[_0x5dbf('0x91')]||_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f[_0x5dbf('0x2a')],'basename':_0x22339b,'savename':util[_0x5dbf('0x76')](_0x5dbf('0x92'),_0x14b21b[_0x5dbf('0x2a')]||_0x5ac29f['name'],require(_0x5dbf('0x93'))[_0x5dbf('0x94')](0x4),_0x14b21b[_0x5dbf('0x90')]||'csv'),'reportId':_0x5ac29f['id'],'reportType':_0x5dbf('0x95')});return db[_0x5dbf('0x96')][_0x5dbf('0x4b')](_0x48a8c5,{'raw':!![]});})[_0x5dbf('0x22')](function(_0x2afbd4){if(_0x5ac29f[_0x5dbf('0x7f')]===_0x5dbf('0x97')){_0x274497['where'](_0x5ac29f[_0x5dbf('0x7f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b[_0x5dbf('0x98')],_0x14b21b[_0x5dbf('0x99')]);}else{_0x274497[_0x5dbf('0x3e')](_0x5ac29f['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14b21b['startDate'],_0x14b21b[_0x5dbf('0x99')]);}if(_0x2afbd4){logger[_0x5dbf('0x9a')]('Run\x20Query:',_0x274497[_0x5dbf('0x84')]());require('child_process')[_0x5dbf('0x9b')](path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9c'),_0x2afbd4['output']),[_0x2afbd4['id'],_0x274497[_0x5dbf('0x84')](),path[_0x5dbf('0x56')](__dirname,_0x5dbf('0x9d'),_0x2afbd4[_0x5dbf('0x9e')]),_0x22339b]);return _0x2afbd4;}else{var _0x4bc5af=squel[_0x5dbf('0x71')]();_0x4bc5af[_0x5dbf('0x72')]('('+_0x274497['toString']()+')',_0x5dbf('0x9f'));_0x4bc5af['field'](_0x5dbf('0xa0'),_0x5dbf('0x1d'));_0x274497[_0x5dbf('0x1b')](_0x14b21b['limit']||_0x310078);_0x274497[_0x5dbf('0x3b')](_0x14b21b[_0x5dbf('0x3b')]||0x0);return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x4bc5af[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')]['QueryTypes'][_0x5dbf('0x85')]})['then'](function(_0x6cfb82){if(!_0x6cfb82[_0x5dbf('0x38')]){_0x1bd06b=0x0;}else{_0x1bd06b=_0x6cfb82[0x0][_0x5dbf('0x1d')]||0x0;}return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x274497[_0x5dbf('0x84')](),{'type':dbH['sequelize'][_0x5dbf('0xa2')][_0x5dbf('0x85')]});})[_0x5dbf('0x22')](function(_0x4d68f6){return{'rows':_0x4d68f6||[],'count':_0x1bd06b};});}});}exports[_0x5dbf('0xa3')]=function(_0x47ac95,_0x51b241){return runReport(_0x47ac95[_0x5dbf('0x49')],_0x47ac95[_0x5dbf('0x32')],_0x47ac95[_0x5dbf('0x4a')])[_0x5dbf('0x22')](respondWithResult(_0x51b241,null))[_0x5dbf('0x54')](handleError(_0x51b241,null));};exports['runReport']=runReport;exports['query']=function(_0x4f38a0,_0x144300){var _0x1da1e3=0xa;var _0x25e681=[_0x5dbf('0x56'),_0x5dbf('0x57'),_0x5dbf('0x58'),_0x5dbf('0x86')];var _0x236754={'SUM':'SUM(%s)','COUNT':_0x5dbf('0x88'),'COUNT DISTINCT':_0x5dbf('0x89'),'MAX':_0x5dbf('0x59'),'MIN':_0x5dbf('0x8a'),'AVG':_0x5dbf('0x5a'),'GROUP_CONCAT':_0x5dbf('0x5b'),'GROUP_CONCAT ASC':_0x5dbf('0x5c'),'GROUP_CONCAT DESC':_0x5dbf('0x5d')};var _0x191a16={'SEC_TO_TIME':_0x5dbf('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5dbf('0x62')};var _0x51b0df=function(_0x48ea8a){return!_['includes']([_0x5dbf('0x64'),_0x5dbf('0x65'),_0x5dbf('0x8b'),_0x5dbf('0x66')],_0x48ea8a);};var _0x3de263=function(_0x4f8dde){if(!_0x4f8dde||!_0x4f8dde[_0x5dbf('0x67')][_0x5dbf('0x38')]){return'';}for(var _0x19effa='(',_0x29177e=0x0;_0x29177e<_0x4f8dde[_0x5dbf('0x67')]['length'];_0x29177e+=0x1){_0x29177e>0x0&&(_0x19effa+='\x20'+_0x4f8dde[_0x5dbf('0x68')]+'\x20');_0x19effa+=_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x69')]?_0x3de263(_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['group']):_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6a')]+'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')]+(_0x51b0df(_0x4f8dde[_0x5dbf('0x67')][_0x29177e][_0x5dbf('0x6b')])?'\x20'+_0x4f8dde[_0x5dbf('0x67')][_0x29177e]['value']:'');}return _0x19effa+')';};var _0x4899ac={'where':{'id':_0x4f38a0['params']['id']}},_0x51864c,_0x4562a4,_0x240304,_0x5df275,_0xc588a2;_0x4899ac=_[_0x5dbf('0x41')]({},_0x4899ac,_0x4f38a0['options']);return db[_0x5dbf('0x2e')][_0x5dbf('0x52')](_0x4899ac)[_0x5dbf('0x22')](function(_0x2eafe0){if(_0x2eafe0){_0x51864c=_0x2eafe0;return _0x2eafe0[_0x5dbf('0x6d')]();}return null;})[_0x5dbf('0x22')](function(_0x414859){if(_0x414859){if(!_0x414859['length']){throw new db[(_0x5dbf('0xa4'))][(_0x5dbf('0x8c'))](_0x5dbf('0x6e'),0x193);}_0x4562a4=_0x414859;return db[_0x5dbf('0x6f')][_0x5dbf('0x46')]({'raw':!![]});}return null;})[_0x5dbf('0x22')](function(_0x153401){if(_0x153401){_0x240304=_[_0x5dbf('0x70')](_0x153401,'id');var _0xbe0ca0;var _0x521c72=squel[_0x5dbf('0x71')]();_0x521c72[_0x5dbf('0x72')](_0x51864c[_0x5dbf('0x7f')]);for(var _0x6b4262=0x0;_0x6b4262<_0x4562a4[_0x5dbf('0x38')];_0x6b4262+=0x1){_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x73')]?_0x240304[_0x4562a4[_0x6b4262][_0x5dbf('0x73')]][_0x5dbf('0x8d')]:_0x4562a4[_0x6b4262][_0x5dbf('0x6a')];_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x74')]?_[_0x5dbf('0x75')](_0x236754[_0x4562a4[_0x6b4262][_0x5dbf('0x74')]],'%s',_0xbe0ca0):_0xbe0ca0;_0xbe0ca0=_0x4562a4[_0x6b4262][_0x5dbf('0x76')]?_[_0x5dbf('0x75')](_0x191a16[_0x4562a4[_0x6b4262][_0x5dbf('0x76')]],'%s',_0xbe0ca0):_0xbe0ca0;if(_0x4562a4[_0x6b4262][_0x5dbf('0x77')]){_0x521c72[_0x5dbf('0x69')](_0xbe0ca0);}_0x4562a4[_0x6b4262][_0x5dbf('0x78')]&&_0x521c72[_0x5dbf('0x3c')](_0xbe0ca0,_0x4562a4[_0x6b4262]['orderBy']===_0x5dbf('0x8e')?![]:!![]);_0x521c72['field'](_0xbe0ca0,_0x4562a4[_0x6b4262][_0x5dbf('0x79')]||_0xbe0ca0);}if(_0x51864c['joins']){_0x51864c[_0x5dbf('0x7a')]=JSON['parse'](_0x51864c[_0x5dbf('0x7a')]);for(var _0x417869=0x0;_0x417869<_0x51864c[_0x5dbf('0x7a')]['length'];_0x417869+=0x1){if(_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')]&&_[_0x5dbf('0x63')](_0x25e681,_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x42')])&&_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x80')]&&_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')]&&_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignKey']){_0x521c72[_0x51864c[_0x5dbf('0x7a')][_0x417869]['type']](_0x51864c['joins'][_0x417869][_0x5dbf('0x7c')],null,util[_0x5dbf('0x76')]('%s.%s\x20=\x20%s.%s',_0x51864c[_0x5dbf('0x7f')],_0x51864c['joins'][_0x417869]['parentKey'],_0x51864c[_0x5dbf('0x7a')][_0x417869]['foreignTable'],_0x51864c[_0x5dbf('0x7a')][_0x417869][_0x5dbf('0x7d')]));}}}if(_0x51864c[_0x5dbf('0x81')]){_0x51864c[_0x5dbf('0x81')]=JSON[_0x5dbf('0x7b')](_0x51864c[_0x5dbf('0x81')]);_0x521c72[_0x5dbf('0x3e')](_0x3de263(_0x51864c[_0x5dbf('0x81')][_0x5dbf('0x69')]));}_0xc588a2=_0x521c72[_0x5dbf('0x8f')]();_0x521c72[_0x5dbf('0x1b')](_0x1da1e3);_0x521c72[_0x5dbf('0x3b')](0x0);logger[_0x5dbf('0x82')]('Limited\x20Query:',_0x521c72[_0x5dbf('0x84')]());return dbH[_0x5dbf('0xa1')][_0x5dbf('0x32')](_0x521c72[_0x5dbf('0x84')](),{'type':dbH[_0x5dbf('0xa1')][_0x5dbf('0xa2')]['SELECT']});}})[_0x5dbf('0x22')](function(){return{'sql':_0xc588a2[_0x5dbf('0x84')]()};})[_0x5dbf('0x22')](respondWithResult(_0x144300,null))[_0x5dbf('0x54')](handleError(_0x144300,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2ef3,0xba));var _0x32ef=function(_0x520580,_0x3b5fc4){_0x520580=_0x520580-0x0;var _0x4e0965=_0x2ef3[_0x520580];return _0x4e0965;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 367d402..a6967a3 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 _0x134a=['define','AnalyticDefaultReport','analytics_default_reports','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x134a,0x1f2));var _0xa134=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x134a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa134('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa134('0x1'));var moment=require(_0xa134('0x2'));var BPromise=require('bluebird');var rp=require(_0xa134('0x3'));var fs=require('fs');var path=require(_0xa134('0x4'));var rimraf=require('rimraf');var config=require(_0xa134('0x5'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x45c3a0,_0x3d7e1d){return _0x45c3a0[_0xa134('0x6')](_0xa134('0x7'),attributes,{'tableName':_0xa134('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0296=['define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0x0296,0x121));var _0x6029=function(_0x530c53,_0x546020){_0x530c53=_0x530c53-0x0;var _0x5408ca=_0x0296[_0x530c53];return _0x5408ca;};'use strict';var _=require(_0x6029('0x0'));var util=require(_0x6029('0x1'));var logger=require('../../config/logger')(_0x6029('0x2'));var moment=require(_0x6029('0x3'));var BPromise=require(_0x6029('0x4'));var rp=require(_0x6029('0x5'));var fs=require('fs');var path=require(_0x6029('0x6'));var rimraf=require(_0x6029('0x7'));var config=require('../../config/environment');var attributes=require(_0x6029('0x8'));module[_0x6029('0x9')]=function(_0x23b434,_0x4d03dc){return _0x23b434[_0x6029('0xa')](_0x6029('0xb'),attributes,{'tableName':_0x6029('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 db6138f..9ce93cf 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 _0x7a12=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','ioredis'];(function(_0x339e28,_0x341e2c){var _0x1605dd=function(_0x3c6006){while(--_0x3c6006){_0x339e28['push'](_0x339e28['shift']());}};_0x1605dd(++_0x341e2c);}(_0x7a12,0x12f));var _0x27a1=function(_0x2f81d6,_0x23325d){_0x2f81d6=_0x2f81d6-0x0;var _0x283317=_0x7a12[_0x2f81d6];return _0x283317;};'use strict';var _=require(_0x27a1('0x0'));var util=require('util');var moment=require(_0x27a1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27a1('0x2'));var db=require(_0x27a1('0x3'))['db'];var utils=require(_0x27a1('0x4'));var logger=require(_0x27a1('0x5'))(_0x27a1('0x6'));var config=require('../../config/environment');var jayson=require(_0x27a1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dfa9c,_0x112c32,_0x1d79bf){return new BPromise(function(_0xb4f175,_0x11ea72){return client['request'](_0x1dfa9c,_0x1d79bf)['then'](function(_0x2234ff){logger[_0x27a1('0x8')](_0x27a1('0x9'),_0x112c32,'request\x20sent');logger[_0x27a1('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x112c32,_0x27a1('0xb'),JSON[_0x27a1('0xc')](_0x2234ff));if(_0x2234ff['error']){if(_0x2234ff['error'][_0x27a1('0xd')]===0x1f4){logger[_0x27a1('0xe')](_0x27a1('0x9'),_0x112c32,_0x2234ff[_0x27a1('0xe')][_0x27a1('0xf')]);return _0x11ea72(_0x2234ff['error'][_0x27a1('0xf')]);}logger[_0x27a1('0xe')](_0x27a1('0x9'),_0x112c32,_0x2234ff[_0x27a1('0xe')]['message']);return _0xb4f175(_0x2234ff[_0x27a1('0xe')][_0x27a1('0xf')]);}else{logger[_0x27a1('0x8')](_0x27a1('0x9'),_0x112c32,_0x27a1('0xb'));_0xb4f175(_0x2234ff[_0x27a1('0x10')]['message']);}})[_0x27a1('0x11')](function(_0x1918b0){logger[_0x27a1('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x112c32,_0x1918b0);_0x11ea72(_0x1918b0);});});} \ No newline at end of file +var _0xefb0=['error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify'];(function(_0x4d5f65,_0x56e4c0){var _0x833d00=function(_0x1a426d){while(--_0x1a426d){_0x4d5f65['push'](_0x4d5f65['shift']());}};_0x833d00(++_0x56e4c0);}(_0xefb0,0x141));var _0x0efb=function(_0x88e4ae,_0x2dcc9d){_0x88e4ae=_0x88e4ae-0x0;var _0x4a9e6a=_0xefb0[_0x88e4ae];return _0x4a9e6a;};'use strict';var _=require(_0x0efb('0x0'));var util=require(_0x0efb('0x1'));var moment=require(_0x0efb('0x2'));var BPromise=require('bluebird');var rs=require(_0x0efb('0x3'));var fs=require('fs');var Redis=require(_0x0efb('0x4'));var db=require(_0x0efb('0x5'))['db'];var utils=require(_0x0efb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0efb('0x7'));var jayson=require(_0x0efb('0x8'));var client=jayson['client'][_0x0efb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2986d2,_0x402244,_0x1c7bac){return new BPromise(function(_0x4d02db,_0x1b1f7b){return client['request'](_0x2986d2,_0x1c7bac)[_0x0efb('0xa')](function(_0x110d2d){logger[_0x0efb('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x402244,_0x0efb('0xc'));logger[_0x0efb('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x402244,'request\x20sent',JSON[_0x0efb('0xe')](_0x110d2d));if(_0x110d2d[_0x0efb('0xf')]){if(_0x110d2d[_0x0efb('0xf')][_0x0efb('0x10')]===0x1f4){logger['error'](_0x0efb('0x11'),_0x402244,_0x110d2d['error'][_0x0efb('0x12')]);return _0x1b1f7b(_0x110d2d[_0x0efb('0xf')]['message']);}logger[_0x0efb('0xf')](_0x0efb('0x11'),_0x402244,_0x110d2d['error'][_0x0efb('0x12')]);return _0x4d02db(_0x110d2d[_0x0efb('0xf')][_0x0efb('0x12')]);}else{logger[_0x0efb('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x402244,'request\x20sent');_0x4d02db(_0x110d2d[_0x0efb('0x13')][_0x0efb('0x12')]);}})[_0x0efb('0x14')](function(_0x49a749){logger[_0x0efb('0xf')](_0x0efb('0x11'),_0x402244,_0x49a749);_0x1b1f7b(_0x49a749);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3850354..2f8fe97 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 _0xa9f8=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xa9f8,0xe0));var _0x8a9f=function(_0x186b12,_0x174b36){_0x186b12=_0x186b12-0x0;var _0x3177f4=_0xa9f8[_0x186b12];return _0x3177f4;};'use strict';var multer=require(_0x8a9f('0x0'));var util=require(_0x8a9f('0x1'));var path=require(_0x8a9f('0x2'));var timeout=require(_0x8a9f('0x3'));var express=require('express');var router=express[_0x8a9f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8a9f('0x5'));var interaction=require(_0x8a9f('0x6'));var config=require(_0x8a9f('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x8a9f('0x8')]('/',auth[_0x8a9f('0x9')](),controller[_0x8a9f('0xa')]);router[_0x8a9f('0x8')](_0x8a9f('0xb'),auth['isAuthenticated'](),controller[_0x8a9f('0xc')]);router[_0x8a9f('0x8')]('/:id/preview',auth['isAuthenticated'](),controller[_0x8a9f('0xd')]);router[_0x8a9f('0x8')](_0x8a9f('0xe'),auth[_0x8a9f('0x9')](),controller[_0x8a9f('0xf')]);router[_0x8a9f('0x8')](_0x8a9f('0x10'),auth[_0x8a9f('0x9')](),controller[_0x8a9f('0x11')]);router[_0x8a9f('0x12')]('/',auth[_0x8a9f('0x9')](),controller[_0x8a9f('0x13')]);router[_0x8a9f('0x14')](_0x8a9f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8a9f('0xb'),auth['isAuthenticated'](),controller[_0x8a9f('0x15')]);module[_0x8a9f('0x16')]=router; \ No newline at end of file +var _0x8212=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','query','put','update','destroy','exports','multer','util'];(function(_0x1ffa99,_0x2de160){var _0x58d2d8=function(_0x31c824){while(--_0x31c824){_0x1ffa99['push'](_0x1ffa99['shift']());}};_0x58d2d8(++_0x2de160);}(_0x8212,0xbb));var _0x2821=function(_0x5957f0,_0x530235){_0x5957f0=_0x5957f0-0x0;var _0x53cb51=_0x8212[_0x5957f0];return _0x53cb51;};'use strict';var multer=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var path=require(_0x2821('0x2'));var timeout=require(_0x2821('0x3'));var express=require('express');var router=express[_0x2821('0x4')]();var fs_extra=require(_0x2821('0x5'));var auth=require(_0x2821('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2821('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x2821('0x8')]('/',auth[_0x2821('0x9')](),controller[_0x2821('0xa')]);router[_0x2821('0x8')](_0x2821('0xb'),auth[_0x2821('0x9')](),controller[_0x2821('0xc')]);router[_0x2821('0x8')](_0x2821('0xd'),auth[_0x2821('0x9')](),controller['preview']);router[_0x2821('0x8')](_0x2821('0xe'),auth['isAuthenticated'](),controller[_0x2821('0xf')]);router['get']('/:id/query',auth[_0x2821('0x9')](),controller[_0x2821('0x10')]);router['post']('/',auth[_0x2821('0x9')](),controller['create']);router[_0x2821('0x11')](_0x2821('0xb'),auth['isAuthenticated'](),controller[_0x2821('0x12')]);router['delete']('/:id',auth[_0x2821('0x9')](),controller[_0x2821('0x13')]);module[_0x2821('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1856521..aad0411 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 _0x0077=['moment','exports','STRING','csv','pdf','xlsx','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x0077,0xbf));var _0x7007=function(_0x51255b,_0x3cfa7a){_0x51255b=_0x51255b-0x0;var _0x56d770=_0x0077[_0x51255b];return _0x56d770;};'use strict';var Sequelize=require(_0x7007('0x0'));var moment=require(_0x7007('0x1'));module[_0x7007('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x7007('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x7007('0x4'),_0x7007('0x5'),_0x7007('0x6')),'allowNull':![],'defaultValue':_0x7007('0x4')},'savename':{'type':Sequelize[_0x7007('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x7007('0x3')],'defaultValue':_0x7007('0x7')},'type':{'type':Sequelize[_0x7007('0x8')](_0x7007('0x9'),_0x7007('0xa')),'allowNull':![],'defaultValue':_0x7007('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x7007('0xb')]},'reportType':{'type':Sequelize[_0x7007('0x3')]}}; \ No newline at end of file +var _0x88b0=['DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','STRING','ENUM','csv','pdf','xlsx'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x88b0,0x170));var _0x088b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x88b0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x088b('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x088b('0x2')](_0x088b('0x3'),_0x088b('0x4'),_0x088b('0x5')),'allowNull':![],'defaultValue':_0x088b('0x3')},'savename':{'type':Sequelize[_0x088b('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x088b('0x6')]},'endDate':{'type':Sequelize[_0x088b('0x6')]},'status':{'type':Sequelize[_0x088b('0x1')],'defaultValue':_0x088b('0x7')},'type':{'type':Sequelize[_0x088b('0x2')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x088b('0x8')},'reportId':{'type':Sequelize[_0x088b('0x9')](0xb)[_0x088b('0xa')]},'reportType':{'type':Sequelize[_0x088b('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 16721e7..7c8a1fd 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 _0xcd67=['status','end','offset','limit','undefined','count','apply','save','update','destroy','then','ExtractedReports','UserProfileResource','error','name','index','AnalyticExtractedReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xcd67,0xa7));var _0x7cd6=function(_0x2bed47,_0x4fa9ae){_0x2bed47=_0x2bed47-0x0;var _0x11ca23=_0xcd67[_0x2bed47];return _0x11ca23;};'use strict';var emlformat=require(_0x7cd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cd6('0x1'));var jsonpatch=require(_0x7cd6('0x2'));var rp=require(_0x7cd6('0x3'));var moment=require(_0x7cd6('0x4'));var BPromise=require(_0x7cd6('0x5'));var Mustache=require(_0x7cd6('0x6'));var util=require('util');var path=require(_0x7cd6('0x7'));var sox=require(_0x7cd6('0x8'));var csv=require(_0x7cd6('0x9'));var ejs=require(_0x7cd6('0xa'));var fs=require('fs');var fs_extra=require(_0x7cd6('0xb'));var _=require(_0x7cd6('0xc'));var squel=require(_0x7cd6('0xd'));var crypto=require(_0x7cd6('0xe'));var jsforce=require(_0x7cd6('0xf'));var deskjs=require(_0x7cd6('0x10'));var toCsv=require(_0x7cd6('0x9'));var querystring=require(_0x7cd6('0x11'));var Papa=require(_0x7cd6('0x12'));var Redis=require(_0x7cd6('0x13'));var authService=require(_0x7cd6('0x14'));var qs=require(_0x7cd6('0x15'));var as=require(_0x7cd6('0x16'));var hardwareService=require(_0x7cd6('0x17'));var logger=require('../../config/logger')(_0x7cd6('0x18'));var utils=require(_0x7cd6('0x19'));var config=require(_0x7cd6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7cd6('0x1b'))['db'];function respondWithStatusCode(_0x5a28f7,_0x546fd3){_0x546fd3=_0x546fd3||0xcc;return function(_0x4506f1){if(_0x4506f1){return _0x5a28f7[_0x7cd6('0x1c')](_0x546fd3);}return _0x5a28f7[_0x7cd6('0x1d')](_0x546fd3)[_0x7cd6('0x1e')]();};}function respondWithResult(_0x20a20a,_0x10efb4){_0x10efb4=_0x10efb4||0xc8;return function(_0x433941){if(_0x433941){return _0x20a20a[_0x7cd6('0x1d')](_0x10efb4)['json'](_0x433941);}};}function respondWithFilteredResult(_0x562b8f,_0x573af3){return function(_0x3fe196){if(_0x3fe196){var _0x163a88=typeof _0x573af3[_0x7cd6('0x1f')]==='undefined'&&typeof _0x573af3[_0x7cd6('0x20')]===_0x7cd6('0x21');var _0x36cb3a=_0x3fe196['count'];var _0x3482bb=_0x163a88?0x0:_0x573af3[_0x7cd6('0x1f')];var _0x4ee093=_0x163a88?_0x3fe196[_0x7cd6('0x22')]:_0x573af3[_0x7cd6('0x1f')]+_0x573af3[_0x7cd6('0x20')];var _0x4971bf;if(_0x4ee093>=_0x36cb3a){_0x4ee093=_0x36cb3a;_0x4971bf=0xc8;}else{_0x4971bf=0xce;}_0x562b8f['status'](_0x4971bf);return _0x562b8f['set']('Content-Range',_0x3482bb+'-'+_0x4ee093+'/'+_0x36cb3a)['json'](_0x3fe196);}return null;};}function patchUpdates(_0x40fce6){return function(_0x5a9e62){try{jsonpatch[_0x7cd6('0x23')](_0x5a9e62,_0x40fce6,!![]);}catch(_0xf5a298){return BPromise['reject'](_0xf5a298);}return _0x5a9e62[_0x7cd6('0x24')]();};}function saveUpdates(_0x464029,_0x4f8c47){return function(_0x288b07){if(_0x288b07){return _0x288b07[_0x7cd6('0x25')](_0x464029)['then'](function(_0x3e1c8a){return _0x3e1c8a;});}return null;};}function removeEntity(_0x1f9732,_0x5a98e1){return function(_0x414ca7){if(_0x414ca7){return _0x414ca7[_0x7cd6('0x26')]()[_0x7cd6('0x27')](function(){var _0x10ff07=_0x414ca7['get']({'plain':!![]});var _0x53e89d=_0x7cd6('0x28');return db[_0x7cd6('0x29')][_0x7cd6('0x26')]({'where':{'type':_0x53e89d,'resourceId':_0x10ff07['id']}})['then'](function(){return _0x414ca7;});})[_0x7cd6('0x27')](function(){_0x1f9732[_0x7cd6('0x1d')](0xcc)[_0x7cd6('0x1e')]();});}};}function handleEntityNotFound(_0x293c51,_0x29e83a){return function(_0x32b39d){if(!_0x32b39d){_0x293c51[_0x7cd6('0x1c')](0x194);}return _0x32b39d;};}function handleError(_0x481cf0,_0x37ddd3){_0x37ddd3=_0x37ddd3||0x1f4;return function(_0x475f95){logger[_0x7cd6('0x2a')](_0x475f95['stack']);if(_0x475f95[_0x7cd6('0x2b')]){delete _0x475f95[_0x7cd6('0x2b')];}_0x481cf0['status'](_0x37ddd3)['send'](_0x475f95);};}exports[_0x7cd6('0x2c')]=function(_0x41fb88,_0xa76a5c){var _0x232e98={},_0x238bcc={},_0x21b24c={'count':0x0,'rows':[]};var _0x2954bb=_['map'](db[_0x7cd6('0x2d')][_0x7cd6('0x2e')],function(_0x1687d4){return{'name':_0x1687d4[_0x7cd6('0x2f')],'type':_0x1687d4['type'][_0x7cd6('0x30')]};});_0x238bcc[_0x7cd6('0x31')]=_[_0x7cd6('0x32')](_0x2954bb,_0x7cd6('0x2b'));_0x238bcc[_0x7cd6('0x33')]=_[_0x7cd6('0x34')](_0x41fb88[_0x7cd6('0x33')]);_0x238bcc[_0x7cd6('0x35')]=_['intersection'](_0x238bcc[_0x7cd6('0x31')],_0x238bcc['query']);_0x232e98[_0x7cd6('0x36')]=_[_0x7cd6('0x37')](_0x238bcc['model'],qs[_0x7cd6('0x38')](_0x41fb88[_0x7cd6('0x33')]['fields']));_0x232e98['attributes']=_0x232e98[_0x7cd6('0x36')]['length']?_0x232e98['attributes']:_0x238bcc[_0x7cd6('0x31')];if(!_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x39')](_0x7cd6('0x3a'))){_0x232e98[_0x7cd6('0x20')]=qs[_0x7cd6('0x20')](_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x20')]);_0x232e98[_0x7cd6('0x1f')]=qs[_0x7cd6('0x1f')](_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x1f')]);}_0x232e98[_0x7cd6('0x3b')]=qs[_0x7cd6('0x3c')](_0x41fb88['query']['sort']);_0x232e98[_0x7cd6('0x3d')]=qs[_0x7cd6('0x35')](_[_0x7cd6('0x3e')](_0x41fb88[_0x7cd6('0x33')],_0x238bcc[_0x7cd6('0x35')]),_0x2954bb);if(_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x3f')]){_0x232e98[_0x7cd6('0x3d')]=_[_0x7cd6('0x40')](_0x232e98[_0x7cd6('0x3d')],{'$or':_[_0x7cd6('0x32')](_0x2954bb,function(_0x503d00){if(_0x503d00['type']!==_0x7cd6('0x41')){var _0x42c593={};_0x42c593[_0x503d00['name']]={'$like':'%'+_0x41fb88[_0x7cd6('0x33')]['filter']+'%'};return _0x42c593;}})});}_0x232e98=_['merge']({},_0x232e98,_0x41fb88[_0x7cd6('0x42')]);var _0x16b04b={'where':_0x232e98[_0x7cd6('0x3d')]};return db['AnalyticExtractedReport'][_0x7cd6('0x22')](_0x16b04b)[_0x7cd6('0x27')](function(_0x5e6706){_0x21b24c[_0x7cd6('0x22')]=_0x5e6706;if(_0x41fb88[_0x7cd6('0x33')][_0x7cd6('0x43')]){_0x232e98[_0x7cd6('0x44')]=[{'all':!![]}];}return db[_0x7cd6('0x2d')]['findAll'](_0x232e98);})[_0x7cd6('0x27')](function(_0x25529d){_0x21b24c[_0x7cd6('0x45')]=_0x25529d;return _0x21b24c;})[_0x7cd6('0x27')](respondWithFilteredResult(_0xa76a5c,_0x232e98))[_0x7cd6('0x46')](handleError(_0xa76a5c,null));};exports[_0x7cd6('0x47')]=function(_0x40fae3,_0x39de4c){var _0x61ef2c={'raw':!![],'where':{'id':_0x40fae3['params']['id']}},_0x54e222={};_0x54e222[_0x7cd6('0x31')]=_[_0x7cd6('0x34')](db[_0x7cd6('0x2d')][_0x7cd6('0x2e')]);_0x54e222[_0x7cd6('0x33')]=_[_0x7cd6('0x34')](_0x40fae3[_0x7cd6('0x33')]);_0x54e222['filters']=_[_0x7cd6('0x37')](_0x54e222[_0x7cd6('0x31')],_0x54e222[_0x7cd6('0x33')]);_0x61ef2c[_0x7cd6('0x36')]=_['intersection'](_0x54e222[_0x7cd6('0x31')],qs[_0x7cd6('0x38')](_0x40fae3[_0x7cd6('0x33')]['fields']));_0x61ef2c[_0x7cd6('0x36')]=_0x61ef2c[_0x7cd6('0x36')][_0x7cd6('0x48')]?_0x61ef2c[_0x7cd6('0x36')]:_0x54e222[_0x7cd6('0x31')];if(_0x40fae3['query'][_0x7cd6('0x43')]){_0x61ef2c['include']=[{'all':!![]}];}_0x61ef2c=_['merge']({},_0x61ef2c,_0x40fae3['options']);return db[_0x7cd6('0x2d')][_0x7cd6('0x49')](_0x61ef2c)[_0x7cd6('0x27')](handleEntityNotFound(_0x39de4c,null))[_0x7cd6('0x27')](respondWithResult(_0x39de4c,null))[_0x7cd6('0x46')](handleError(_0x39de4c,null));};exports[_0x7cd6('0x4a')]=function(_0x458706,_0x27eceb){return db[_0x7cd6('0x2d')][_0x7cd6('0x4a')](_0x458706[_0x7cd6('0x4b')],{})[_0x7cd6('0x27')](function(_0x54acae){var _0x328373=_0x458706[_0x7cd6('0x4c')][_0x7cd6('0x4d')]({'plain':!![]});if(!_0x328373)throw new Error(_0x7cd6('0x4e'));if(_0x328373['role']===_0x7cd6('0x4c')){var _0x225401=_0x54acae[_0x7cd6('0x4d')]({'plain':!![]});var _0x1bb9e1=_0x7cd6('0x28');return db[_0x7cd6('0x4f')][_0x7cd6('0x49')]({'where':{'name':_0x1bb9e1,'userProfileId':_0x328373[_0x7cd6('0x50')]},'raw':!![]})['then'](function(_0xd231af){if(_0xd231af&&_0xd231af[_0x7cd6('0x51')]===0x0){return db[_0x7cd6('0x29')][_0x7cd6('0x4a')]({'name':_0x225401[_0x7cd6('0x2b')],'resourceId':_0x225401['id'],'type':_0xd231af['name'],'sectionId':_0xd231af['id']},{})['then'](function(){return _0x54acae;});}else{return _0x54acae;}})['catch'](function(_0x587eb0){logger[_0x7cd6('0x2a')](_0x7cd6('0x52'),_0x587eb0);throw _0x587eb0;});}return _0x54acae;})[_0x7cd6('0x27')](respondWithResult(_0x27eceb,0xc9))[_0x7cd6('0x46')](handleError(_0x27eceb,null));};exports['update']=function(_0x4879b1,_0x2eba42){if(_0x4879b1[_0x7cd6('0x4b')]['id']){delete _0x4879b1['body']['id'];}return db[_0x7cd6('0x2d')][_0x7cd6('0x49')]({'where':{'id':_0x4879b1[_0x7cd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x2eba42,null))['then'](saveUpdates(_0x4879b1[_0x7cd6('0x4b')],null))['then'](respondWithResult(_0x2eba42,null))[_0x7cd6('0x46')](handleError(_0x2eba42,null));};exports[_0x7cd6('0x26')]=function(_0xa98b44,_0x1400a4){return db[_0x7cd6('0x2d')]['find']({'where':{'id':_0xa98b44[_0x7cd6('0x53')]['id']}})[_0x7cd6('0x27')](handleEntityNotFound(_0x1400a4,null))['then'](removeEntity(_0x1400a4,null))[_0x7cd6('0x46')](handleError(_0x1400a4,null));};exports[_0x7cd6('0x54')]=function(_0x4b81a1,_0x565e8c,_0x396703){return db[_0x7cd6('0x2d')][_0x7cd6('0x49')]({'where':{'id':_0x4b81a1[_0x7cd6('0x53')]['id']},'attributes':[_0x7cd6('0x2b'),_0x7cd6('0x55'),'savename',_0x7cd6('0x56')],'raw':!![]})[_0x7cd6('0x27')](handleEntityNotFound(_0x565e8c,null))[_0x7cd6('0x27')](function(_0x504e73){if(_0x504e73){if(!fs[_0x7cd6('0x57')](path[_0x7cd6('0x58')](config[_0x7cd6('0x59')],_0x7cd6('0x5a'),_0x504e73[_0x7cd6('0x5b')]))){throw new db['Sequelize'][(_0x7cd6('0x5c'))](_0x7cd6('0x5d'));}if(_0x4b81a1[_0x7cd6('0x33')][_0x7cd6('0x5e')]){return _0x565e8c[_0x7cd6('0x1c')](0xc8);}return _0x565e8c[_0x7cd6('0x54')](path[_0x7cd6('0x58')](config[_0x7cd6('0x59')],'server/files/reports',_0x504e73['savename']),util[_0x7cd6('0x5f')](_0x7cd6('0x60'),_0x504e73[_0x7cd6('0x55')]||_0x504e73[_0x7cd6('0x2b')],_0x504e73[_0x7cd6('0x56')][_0x7cd6('0x61')]()));}})[_0x7cd6('0x46')](handleError(_0x565e8c,null));}; \ No newline at end of file +var _0xf675=['server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync'];(function(_0x1033d7,_0x2a0b11){var _0x491d46=function(_0xd8a62f){while(--_0xd8a62f){_0x1033d7['push'](_0x1033d7['shift']());}};_0x491d46(++_0x2a0b11);}(_0xf675,0xc4));var _0x5f67=function(_0x10a8d8,_0x28f292){_0x10a8d8=_0x10a8d8-0x0;var _0x3b2b79=_0xf675[_0x10a8d8];return _0x3b2b79;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f67('0x1'));var jsonpatch=require(_0x5f67('0x2'));var rp=require(_0x5f67('0x3'));var moment=require(_0x5f67('0x4'));var BPromise=require(_0x5f67('0x5'));var Mustache=require('mustache');var util=require(_0x5f67('0x6'));var path=require(_0x5f67('0x7'));var sox=require(_0x5f67('0x8'));var csv=require(_0x5f67('0x9'));var ejs=require(_0x5f67('0xa'));var fs=require('fs');var fs_extra=require(_0x5f67('0xb'));var _=require(_0x5f67('0xc'));var squel=require(_0x5f67('0xd'));var crypto=require('crypto');var jsforce=require(_0x5f67('0xe'));var deskjs=require(_0x5f67('0xf'));var toCsv=require(_0x5f67('0x9'));var querystring=require(_0x5f67('0x10'));var Papa=require(_0x5f67('0x11'));var Redis=require('ioredis');var authService=require(_0x5f67('0x12'));var qs=require(_0x5f67('0x13'));var as=require(_0x5f67('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f67('0x15'))(_0x5f67('0x16'));var utils=require(_0x5f67('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321e25,_0x4b83d0){_0x4b83d0=_0x4b83d0||0xcc;return function(_0x505c05){if(_0x505c05){return _0x321e25['sendStatus'](_0x4b83d0);}return _0x321e25['status'](_0x4b83d0)[_0x5f67('0x18')]();};}function respondWithResult(_0x3d35e7,_0x22da55){_0x22da55=_0x22da55||0xc8;return function(_0x1239c0){if(_0x1239c0){return _0x3d35e7[_0x5f67('0x19')](_0x22da55)[_0x5f67('0x1a')](_0x1239c0);}};}function respondWithFilteredResult(_0x1913f8,_0x3d7b1f){return function(_0x17c03b){if(_0x17c03b){var _0x24134f=typeof _0x3d7b1f['offset']===_0x5f67('0x1b')&&typeof _0x3d7b1f[_0x5f67('0x1c')]===_0x5f67('0x1b');var _0x18a531=_0x17c03b['count'];var _0x1c414e=_0x24134f?0x0:_0x3d7b1f[_0x5f67('0x1d')];var _0x47e7f3=_0x24134f?_0x17c03b[_0x5f67('0x1e')]:_0x3d7b1f['offset']+_0x3d7b1f[_0x5f67('0x1c')];var _0x2c318a;if(_0x47e7f3>=_0x18a531){_0x47e7f3=_0x18a531;_0x2c318a=0xc8;}else{_0x2c318a=0xce;}_0x1913f8[_0x5f67('0x19')](_0x2c318a);return _0x1913f8[_0x5f67('0x1f')](_0x5f67('0x20'),_0x1c414e+'-'+_0x47e7f3+'/'+_0x18a531)[_0x5f67('0x1a')](_0x17c03b);}return null;};}function patchUpdates(_0x1b1dac){return function(_0x4cc426){try{jsonpatch[_0x5f67('0x21')](_0x4cc426,_0x1b1dac,!![]);}catch(_0x3b87d6){return BPromise['reject'](_0x3b87d6);}return _0x4cc426['save']();};}function saveUpdates(_0x254cdd,_0x3a455d){return function(_0x3427f6){if(_0x3427f6){return _0x3427f6[_0x5f67('0x22')](_0x254cdd)[_0x5f67('0x23')](function(_0x2baf38){return _0x2baf38;});}return null;};}function removeEntity(_0x39ae42,_0xe42fb9){return function(_0x17d014){if(_0x17d014){return _0x17d014[_0x5f67('0x24')]()[_0x5f67('0x23')](function(){var _0x2dfc38=_0x17d014[_0x5f67('0x25')]({'plain':!![]});var _0x3602f0=_0x5f67('0x26');return db[_0x5f67('0x27')][_0x5f67('0x24')]({'where':{'type':_0x3602f0,'resourceId':_0x2dfc38['id']}})['then'](function(){return _0x17d014;});})[_0x5f67('0x23')](function(){_0x39ae42[_0x5f67('0x19')](0xcc)[_0x5f67('0x18')]();});}};}function handleEntityNotFound(_0x111c9f,_0x25b618){return function(_0x59bbde){if(!_0x59bbde){_0x111c9f[_0x5f67('0x28')](0x194);}return _0x59bbde;};}function handleError(_0x393b79,_0x3d0e90){_0x3d0e90=_0x3d0e90||0x1f4;return function(_0x57e331){logger[_0x5f67('0x29')](_0x57e331[_0x5f67('0x2a')]);if(_0x57e331[_0x5f67('0x2b')]){delete _0x57e331[_0x5f67('0x2b')];}_0x393b79[_0x5f67('0x19')](_0x3d0e90)[_0x5f67('0x2c')](_0x57e331);};}exports[_0x5f67('0x2d')]=function(_0x19cd6b,_0x116139){var _0x5afbb4={},_0xd3e34e={},_0x5f3a13={'count':0x0,'rows':[]};var _0x492494=_[_0x5f67('0x2e')](db[_0x5f67('0x2f')][_0x5f67('0x30')],function(_0x571a61){return{'name':_0x571a61[_0x5f67('0x31')],'type':_0x571a61[_0x5f67('0x32')][_0x5f67('0x33')]};});_0xd3e34e[_0x5f67('0x34')]=_[_0x5f67('0x2e')](_0x492494,_0x5f67('0x2b'));_0xd3e34e[_0x5f67('0x35')]=_[_0x5f67('0x36')](_0x19cd6b['query']);_0xd3e34e['filters']=_[_0x5f67('0x37')](_0xd3e34e[_0x5f67('0x34')],_0xd3e34e[_0x5f67('0x35')]);_0x5afbb4[_0x5f67('0x38')]=_[_0x5f67('0x37')](_0xd3e34e[_0x5f67('0x34')],qs[_0x5f67('0x39')](_0x19cd6b[_0x5f67('0x35')]['fields']));_0x5afbb4[_0x5f67('0x38')]=_0x5afbb4[_0x5f67('0x38')][_0x5f67('0x3a')]?_0x5afbb4[_0x5f67('0x38')]:_0xd3e34e[_0x5f67('0x34')];if(!_0x19cd6b[_0x5f67('0x35')]['hasOwnProperty'](_0x5f67('0x3b'))){_0x5afbb4[_0x5f67('0x1c')]=qs[_0x5f67('0x1c')](_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x1c')]);_0x5afbb4[_0x5f67('0x1d')]=qs['offset'](_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x1d')]);}_0x5afbb4[_0x5f67('0x3c')]=qs[_0x5f67('0x3d')](_0x19cd6b['query'][_0x5f67('0x3d')]);_0x5afbb4[_0x5f67('0x3e')]=qs['filters'](_[_0x5f67('0x3f')](_0x19cd6b[_0x5f67('0x35')],_0xd3e34e[_0x5f67('0x40')]),_0x492494);if(_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x41')]){_0x5afbb4[_0x5f67('0x3e')]=_['merge'](_0x5afbb4[_0x5f67('0x3e')],{'$or':_['map'](_0x492494,function(_0x37bfc0){if(_0x37bfc0[_0x5f67('0x32')]!==_0x5f67('0x42')){var _0x25f253={};_0x25f253[_0x37bfc0[_0x5f67('0x2b')]]={'$like':'%'+_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x41')]+'%'};return _0x25f253;}})});}_0x5afbb4=_['merge']({},_0x5afbb4,_0x19cd6b[_0x5f67('0x43')]);var _0x22cb54={'where':_0x5afbb4[_0x5f67('0x3e')]};return db['AnalyticExtractedReport'][_0x5f67('0x1e')](_0x22cb54)['then'](function(_0x16a3f6){_0x5f3a13['count']=_0x16a3f6;if(_0x19cd6b[_0x5f67('0x35')][_0x5f67('0x44')]){_0x5afbb4[_0x5f67('0x45')]=[{'all':!![]}];}return db[_0x5f67('0x2f')][_0x5f67('0x46')](_0x5afbb4);})[_0x5f67('0x23')](function(_0x343422){_0x5f3a13[_0x5f67('0x47')]=_0x343422;return _0x5f3a13;})[_0x5f67('0x23')](respondWithFilteredResult(_0x116139,_0x5afbb4))[_0x5f67('0x48')](handleError(_0x116139,null));};exports[_0x5f67('0x49')]=function(_0x487045,_0x19423c){var _0xd94e13={'raw':!![],'where':{'id':_0x487045[_0x5f67('0x4a')]['id']}},_0x201840={};_0x201840[_0x5f67('0x34')]=_[_0x5f67('0x36')](db[_0x5f67('0x2f')][_0x5f67('0x30')]);_0x201840[_0x5f67('0x35')]=_[_0x5f67('0x36')](_0x487045['query']);_0x201840['filters']=_['intersection'](_0x201840['model'],_0x201840[_0x5f67('0x35')]);_0xd94e13[_0x5f67('0x38')]=_[_0x5f67('0x37')](_0x201840['model'],qs['fields'](_0x487045[_0x5f67('0x35')][_0x5f67('0x39')]));_0xd94e13[_0x5f67('0x38')]=_0xd94e13[_0x5f67('0x38')][_0x5f67('0x3a')]?_0xd94e13[_0x5f67('0x38')]:_0x201840[_0x5f67('0x34')];if(_0x487045[_0x5f67('0x35')]['includeAll']){_0xd94e13[_0x5f67('0x45')]=[{'all':!![]}];}_0xd94e13=_[_0x5f67('0x4b')]({},_0xd94e13,_0x487045[_0x5f67('0x43')]);return db[_0x5f67('0x2f')][_0x5f67('0x4c')](_0xd94e13)[_0x5f67('0x23')](handleEntityNotFound(_0x19423c,null))[_0x5f67('0x23')](respondWithResult(_0x19423c,null))[_0x5f67('0x48')](handleError(_0x19423c,null));};exports[_0x5f67('0x4d')]=function(_0xd48572,_0x466ea1){return db[_0x5f67('0x2f')][_0x5f67('0x4d')](_0xd48572[_0x5f67('0x4e')],{})[_0x5f67('0x23')](function(_0x22094e){var _0x52a3af=_0xd48572[_0x5f67('0x4f')][_0x5f67('0x25')]({'plain':!![]});if(!_0x52a3af)throw new Error(_0x5f67('0x50'));if(_0x52a3af[_0x5f67('0x51')]===_0x5f67('0x4f')){var _0x5f3242=_0x22094e[_0x5f67('0x25')]({'plain':!![]});var _0x4f5721=_0x5f67('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x4f5721,'userProfileId':_0x52a3af[_0x5f67('0x52')]},'raw':!![]})[_0x5f67('0x23')](function(_0x204c10){if(_0x204c10&&_0x204c10[_0x5f67('0x53')]===0x0){return db[_0x5f67('0x27')][_0x5f67('0x4d')]({'name':_0x5f3242[_0x5f67('0x2b')],'resourceId':_0x5f3242['id'],'type':_0x204c10[_0x5f67('0x2b')],'sectionId':_0x204c10['id']},{})[_0x5f67('0x23')](function(){return _0x22094e;});}else{return _0x22094e;}})[_0x5f67('0x48')](function(_0x3517c9){logger[_0x5f67('0x29')](_0x5f67('0x54'),_0x3517c9);throw _0x3517c9;});}return _0x22094e;})[_0x5f67('0x23')](respondWithResult(_0x466ea1,0xc9))[_0x5f67('0x48')](handleError(_0x466ea1,null));};exports[_0x5f67('0x22')]=function(_0x4f26bb,_0x497890){if(_0x4f26bb['body']['id']){delete _0x4f26bb[_0x5f67('0x4e')]['id'];}return db[_0x5f67('0x2f')][_0x5f67('0x4c')]({'where':{'id':_0x4f26bb['params']['id']}})[_0x5f67('0x23')](handleEntityNotFound(_0x497890,null))[_0x5f67('0x23')](saveUpdates(_0x4f26bb['body'],null))[_0x5f67('0x23')](respondWithResult(_0x497890,null))[_0x5f67('0x48')](handleError(_0x497890,null));};exports[_0x5f67('0x24')]=function(_0x20bbf1,_0x4b0778){return db[_0x5f67('0x2f')]['find']({'where':{'id':_0x20bbf1['params']['id']}})['then'](handleEntityNotFound(_0x4b0778,null))[_0x5f67('0x23')](removeEntity(_0x4b0778,null))[_0x5f67('0x48')](handleError(_0x4b0778,null));};exports['download']=function(_0x16da2d,_0x2d2bf7,_0x4da449){return db[_0x5f67('0x2f')][_0x5f67('0x4c')]({'where':{'id':_0x16da2d[_0x5f67('0x4a')]['id']},'attributes':[_0x5f67('0x2b'),_0x5f67('0x55'),_0x5f67('0x56'),_0x5f67('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2d2bf7,null))['then'](function(_0x1ceccc){if(_0x1ceccc){if(!fs[_0x5f67('0x58')](path['join'](config['root'],_0x5f67('0x59'),_0x1ceccc[_0x5f67('0x56')]))){throw new db['Sequelize']['ValidationError'](_0x5f67('0x5a'));}if(_0x16da2d['query'][_0x5f67('0x5b')]){return _0x2d2bf7['sendStatus'](0xc8);}return _0x2d2bf7['download'](path[_0x5f67('0x5c')](config['root'],_0x5f67('0x59'),_0x1ceccc[_0x5f67('0x56')]),util[_0x5f67('0x5d')](_0x5f67('0x5e'),_0x1ceccc[_0x5f67('0x55')]||_0x1ceccc['name'],_0x1ceccc['output']['toLowerCase']()));}})[_0x5f67('0x48')](handleError(_0x2d2bf7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 97bf8ac..3929c44 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 _0x517c=['api','bluebird','path','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x3bae5c,_0x455be9){var _0xb3c166=function(_0x284d5a){while(--_0x284d5a){_0x3bae5c['push'](_0x3bae5c['shift']());}};_0xb3c166(++_0x455be9);}(_0x517c,0x9d));var _0xc517=function(_0x4cf8d4,_0x5aee73){_0x4cf8d4=_0x4cf8d4-0x0;var _0x2c1beb=_0x517c[_0x4cf8d4];return _0x2c1beb;};'use strict';var _=require(_0xc517('0x0'));var util=require(_0xc517('0x1'));var logger=require(_0xc517('0x2'))(_0xc517('0x3'));var moment=require('moment');var BPromise=require(_0xc517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc517('0x5'));var rimraf=require(_0xc517('0x6'));var config=require('../../config/environment');var attributes=require(_0xc517('0x7'));module['exports']=function(_0xa7ec30,_0x4cc58d){return _0xa7ec30['define'](_0xc517('0x8'),attributes,{'tableName':_0xc517('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2a4=['analytics_extracted_reports','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa2a4,0x1cf));var _0x4a2a=function(_0x53b6c9,_0xbf731){_0x53b6c9=_0x53b6c9-0x0;var _0x1d8e8c=_0xa2a4[_0x53b6c9];return _0x1d8e8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4a2a('0x0'))(_0x4a2a('0x1'));var moment=require('moment');var BPromise=require(_0x4a2a('0x2'));var rp=require(_0x4a2a('0x3'));var fs=require('fs');var path=require(_0x4a2a('0x4'));var rimraf=require(_0x4a2a('0x5'));var config=require('../../config/environment');var attributes=require(_0x4a2a('0x6'));module[_0x4a2a('0x7')]=function(_0x5cbe30,_0xff2c25){return _0x5cbe30[_0x4a2a('0x8')](_0x4a2a('0x9'),attributes,{'tableName':_0x4a2a('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 bc0b58a..882cff2 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 _0x0f03=['request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x21f7d4,_0x3fb9df){var _0x143fa7=function(_0x4ace03){while(--_0x4ace03){_0x21f7d4['push'](_0x21f7d4['shift']());}};_0x143fa7(++_0x3fb9df);}(_0x0f03,0x113));var _0x30f0=function(_0x44078f,_0x3616df){_0x44078f=_0x44078f-0x0;var _0x4d3d13=_0x0f03[_0x44078f];return _0x4d3d13;};'use strict';var _=require(_0x30f0('0x0'));var util=require('util');var moment=require(_0x30f0('0x1'));var BPromise=require(_0x30f0('0x2'));var rs=require(_0x30f0('0x3'));var fs=require('fs');var Redis=require(_0x30f0('0x4'));var db=require(_0x30f0('0x5'))['db'];var utils=require(_0x30f0('0x6'));var logger=require(_0x30f0('0x7'))('rpc');var config=require(_0x30f0('0x8'));var jayson=require(_0x30f0('0x9'));var client=jayson[_0x30f0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21ffcb,_0xf443d,_0x3cdd7b){return new BPromise(function(_0x1e6ee2,_0x366948){return client[_0x30f0('0xb')](_0x21ffcb,_0x3cdd7b)['then'](function(_0x4d6b9c){logger[_0x30f0('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf443d,_0x30f0('0xd'));logger[_0x30f0('0xe')](_0x30f0('0xf'),_0xf443d,_0x30f0('0xd'),JSON['stringify'](_0x4d6b9c));if(_0x4d6b9c[_0x30f0('0x10')]){if(_0x4d6b9c['error'][_0x30f0('0x11')]===0x1f4){logger['error'](_0x30f0('0x12'),_0xf443d,_0x4d6b9c['error'][_0x30f0('0x13')]);return _0x366948(_0x4d6b9c[_0x30f0('0x10')][_0x30f0('0x13')]);}logger[_0x30f0('0x10')](_0x30f0('0x12'),_0xf443d,_0x4d6b9c[_0x30f0('0x10')]['message']);return _0x1e6ee2(_0x4d6b9c[_0x30f0('0x10')][_0x30f0('0x13')]);}else{logger[_0x30f0('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xf443d,_0x30f0('0xd'));_0x1e6ee2(_0x4d6b9c[_0x30f0('0x14')][_0x30f0('0x13')]);}})[_0x30f0('0x15')](function(_0x58f674){logger[_0x30f0('0x10')](_0x30f0('0x12'),_0xf443d,_0x58f674);_0x366948(_0x58f674);});});} \ No newline at end of file +var _0x0b3a=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x58fe01,_0x42ccdf){var _0x758a11=function(_0xf6b2d){while(--_0xf6b2d){_0x58fe01['push'](_0x58fe01['shift']());}};_0x758a11(++_0x42ccdf);}(_0x0b3a,0x114));var _0xa0b3=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x0b3a[_0x3f4891];return _0x54f2d8;};'use strict';var _=require(_0xa0b3('0x0'));var util=require('util');var moment=require(_0xa0b3('0x1'));var BPromise=require(_0xa0b3('0x2'));var rs=require(_0xa0b3('0x3'));var fs=require('fs');var Redis=require(_0xa0b3('0x4'));var db=require(_0xa0b3('0x5'))['db'];var utils=require(_0xa0b3('0x6'));var logger=require(_0xa0b3('0x7'))(_0xa0b3('0x8'));var config=require(_0xa0b3('0x9'));var jayson=require(_0xa0b3('0xa'));var client=jayson['client'][_0xa0b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30c907,_0x5726db,_0x439b52){return new BPromise(function(_0x343701,_0x5b0ffc){return client[_0xa0b3('0xc')](_0x30c907,_0x439b52)[_0xa0b3('0xd')](function(_0xd2478b){logger[_0xa0b3('0xe')](_0xa0b3('0xf'),_0x5726db,_0xa0b3('0x10'));logger[_0xa0b3('0x11')](_0xa0b3('0x12'),_0x5726db,_0xa0b3('0x10'),JSON['stringify'](_0xd2478b));if(_0xd2478b[_0xa0b3('0x13')]){if(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x14')]===0x1f4){logger['error'](_0xa0b3('0xf'),_0x5726db,_0xd2478b['error'][_0xa0b3('0x15')]);return _0x5b0ffc(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x15')]);}logger[_0xa0b3('0x13')](_0xa0b3('0xf'),_0x5726db,_0xd2478b[_0xa0b3('0x13')]['message']);return _0x343701(_0xd2478b[_0xa0b3('0x13')][_0xa0b3('0x15')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5726db,_0xa0b3('0x10'));_0x343701(_0xd2478b[_0xa0b3('0x16')][_0xa0b3('0x15')]);}})[_0xa0b3('0x17')](function(_0x5d38ae){logger[_0xa0b3('0x13')](_0xa0b3('0xf'),_0x5726db,_0x5d38ae);_0x5b0ffc(_0x5d38ae);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 5680d8b..eebfb3a 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 _0xdea2=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','post','put','update','delete','destroy','exports','multer','util'];(function(_0x222866,_0x3d2de9){var _0x146b45=function(_0x5451a0){while(--_0x5451a0){_0x222866['push'](_0x222866['shift']());}};_0x146b45(++_0x3d2de9);}(_0xdea2,0x1ec));var _0x2dea=function(_0x52ea48,_0x14f622){_0x52ea48=_0x52ea48-0x0;var _0x1f8e44=_0xdea2[_0x52ea48];return _0x1f8e44;};'use strict';var multer=require(_0x2dea('0x0'));var util=require(_0x2dea('0x1'));var path=require('path');var timeout=require(_0x2dea('0x2'));var express=require(_0x2dea('0x3'));var router=express[_0x2dea('0x4')]();var fs_extra=require(_0x2dea('0x5'));var auth=require(_0x2dea('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2dea('0x7'));router[_0x2dea('0x8')]('/',auth[_0x2dea('0x9')](),controller[_0x2dea('0xa')]);router[_0x2dea('0x8')](_0x2dea('0xb'),auth[_0x2dea('0x9')](),controller['show']);router[_0x2dea('0x8')]('/:id/download',auth[_0x2dea('0x9')](),controller[_0x2dea('0xc')]);router[_0x2dea('0xd')]('/',auth[_0x2dea('0x9')](),controller['create']);router[_0x2dea('0xe')]('/:id',auth[_0x2dea('0x9')](),controller[_0x2dea('0xf')]);router[_0x2dea('0x10')](_0x2dea('0xb'),auth['isAuthenticated'](),controller[_0x2dea('0x11')]);module[_0x2dea('0x12')]=router; \ No newline at end of file +var _0x5ee2=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/download','post','create','update','delete','destroy'];(function(_0xcdc0af,_0x37976b){var _0x4b6511=function(_0x4cf4bf){while(--_0x4cf4bf){_0xcdc0af['push'](_0xcdc0af['shift']());}};_0x4b6511(++_0x37976b);}(_0x5ee2,0xd9));var _0x25ee=function(_0x482b17,_0x2d5741){_0x482b17=_0x482b17-0x0;var _0x1b8773=_0x5ee2[_0x482b17];return _0x1b8773;};'use strict';var multer=require('multer');var util=require(_0x25ee('0x0'));var path=require(_0x25ee('0x1'));var timeout=require(_0x25ee('0x2'));var express=require(_0x25ee('0x3'));var router=express[_0x25ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x25ee('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x25ee('0x6')](),controller[_0x25ee('0x7')]);router[_0x25ee('0x8')](_0x25ee('0x9'),auth[_0x25ee('0x6')](),controller[_0x25ee('0xa')]);router[_0x25ee('0x8')](_0x25ee('0xb'),auth[_0x25ee('0x6')](),controller['download']);router[_0x25ee('0xc')]('/',auth[_0x25ee('0x6')](),controller[_0x25ee('0xd')]);router['put'](_0x25ee('0x9'),auth[_0x25ee('0x6')](),controller[_0x25ee('0xe')]);router[_0x25ee('0xf')]('/:id',auth[_0x25ee('0x6')](),controller[_0x25ee('0x10')]);module[_0x25ee('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 663c597..446108d 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 _0xae49=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xae49,0x1ab));var _0x9ae4=function(_0x2351a2,_0x5bef28){_0x2351a2=_0x2351a2-0x0;var _0x1117e5=_0xae49[_0x2351a2];return _0x1117e5;};'use strict';var Sequelize=require(_0x9ae4('0x0'));module[_0x9ae4('0x1')]={'field':{'type':Sequelize[_0x9ae4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x9ae4('0x3')]},'format':{'type':Sequelize[_0x9ae4('0x3')]},'groupBy':{'type':Sequelize[_0x9ae4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9ae4('0x3')]},'custom':{'type':Sequelize[_0x9ae4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x91ad=['STRING','BOOLEAN','exports','TEXT'];(function(_0x55fc43,_0x1b3456){var _0x4dbc18=function(_0x4e1ab8){while(--_0x4e1ab8){_0x55fc43['push'](_0x55fc43['shift']());}};_0x4dbc18(++_0x1b3456);}(_0x91ad,0xd2));var _0xd91a=function(_0x1d1d34,_0x49c0ec){_0x1d1d34=_0x1d1d34-0x0;var _0x4d8023=_0x91ad[_0x1d1d34];return _0x4d8023;};'use strict';var Sequelize=require('sequelize');module[_0xd91a('0x0')]={'field':{'type':Sequelize[_0xd91a('0x1')]},'alias':{'type':Sequelize[_0xd91a('0x2')]},'function':{'type':Sequelize[_0xd91a('0x2')]},'format':{'type':Sequelize[_0xd91a('0x2')]},'groupBy':{'type':Sequelize[_0xd91a('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd91a('0x2')]},'custom':{'type':Sequelize[_0xd91a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 7f282a1..123253c 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 _0xbaee=['bulkDestroy','AnalyticCustomReport','findOne','transaction','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','AnalyticFieldReport','catch','params','keys','find','create','bulkCreate','body'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xbaee,0x9e));var _0xebae=function(_0xd1ea47,_0x3d489d){_0xd1ea47=_0xd1ea47-0x0;var _0x1a399d=_0xbaee[_0xd1ea47];return _0x1a399d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebae('0x0'));var zipdir=require(_0xebae('0x1'));var jsonpatch=require(_0xebae('0x2'));var rp=require(_0xebae('0x3'));var moment=require(_0xebae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xebae('0x5'));var path=require('path');var sox=require(_0xebae('0x6'));var csv=require(_0xebae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebae('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xebae('0x9'));var jsforce=require(_0xebae('0xa'));var deskjs=require(_0xebae('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xebae('0xc'));var Redis=require('ioredis');var authService=require(_0xebae('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xebae('0xe'));var hardwareService=require(_0xebae('0xf'));var logger=require(_0xebae('0x10'))(_0xebae('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xebae('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198562,_0x23885c){_0x23885c=_0x23885c||0xcc;return function(_0x570982){if(_0x570982){return _0x198562[_0xebae('0x13')](_0x23885c);}return _0x198562[_0xebae('0x14')](_0x23885c)[_0xebae('0x15')]();};}function respondWithResult(_0x30c097,_0x449970){_0x449970=_0x449970||0xc8;return function(_0x29fa11){if(_0x29fa11){return _0x30c097[_0xebae('0x14')](_0x449970)[_0xebae('0x16')](_0x29fa11);}};}function respondWithFilteredResult(_0x5c9a0e,_0x1e01b6){return function(_0x47d91f){if(_0x47d91f){var _0x133bcb=typeof _0x1e01b6[_0xebae('0x17')]===_0xebae('0x18')&&typeof _0x1e01b6[_0xebae('0x19')]===_0xebae('0x18');var _0x21de04=_0x47d91f[_0xebae('0x1a')];var _0x2e0817=_0x133bcb?0x0:_0x1e01b6[_0xebae('0x17')];var _0xb43a53=_0x133bcb?_0x47d91f[_0xebae('0x1a')]:_0x1e01b6[_0xebae('0x17')]+_0x1e01b6[_0xebae('0x19')];var _0x1856cd;if(_0xb43a53>=_0x21de04){_0xb43a53=_0x21de04;_0x1856cd=0xc8;}else{_0x1856cd=0xce;}_0x5c9a0e[_0xebae('0x14')](_0x1856cd);return _0x5c9a0e[_0xebae('0x1b')](_0xebae('0x1c'),_0x2e0817+'-'+_0xb43a53+'/'+_0x21de04)['json'](_0x47d91f);}return null;};}function patchUpdates(_0xc3c6ed){return function(_0xf3acaa){try{jsonpatch[_0xebae('0x1d')](_0xf3acaa,_0xc3c6ed,!![]);}catch(_0x5257fc){return BPromise[_0xebae('0x1e')](_0x5257fc);}return _0xf3acaa[_0xebae('0x1f')]();};}function saveUpdates(_0x296b7b,_0x48d902){return function(_0x234d61){if(_0x234d61){return _0x234d61[_0xebae('0x20')](_0x296b7b)[_0xebae('0x21')](function(_0x189788){return _0x189788;});}return null;};}function removeEntity(_0x2e1022,_0x46c1e8){return function(_0x41938a){if(_0x41938a){return _0x41938a[_0xebae('0x22')]()[_0xebae('0x21')](function(){_0x2e1022[_0xebae('0x14')](0xcc)[_0xebae('0x15')]();});}};}function handleEntityNotFound(_0x48c90f,_0x170999){return function(_0x509cf4){if(!_0x509cf4){_0x48c90f['sendStatus'](0x194);}return _0x509cf4;};}function handleError(_0x9f9df3,_0x51db89){_0x51db89=_0x51db89||0x1f4;return function(_0x236bc1){logger[_0xebae('0x23')](_0x236bc1[_0xebae('0x24')]);if(_0x236bc1[_0xebae('0x25')]){delete _0x236bc1[_0xebae('0x25')];}_0x9f9df3[_0xebae('0x14')](_0x51db89)[_0xebae('0x26')](_0x236bc1);};}exports[_0xebae('0x27')]=function(_0x47e8f5,_0x3f022a){var _0x28cdac={},_0x4574ba={},_0xbb8b14={'count':0x0,'rows':[]};var _0x315ae6=_[_0xebae('0x28')](db['AnalyticFieldReport'][_0xebae('0x29')],function(_0x2fa7cd){return{'name':_0x2fa7cd[_0xebae('0x2a')],'type':_0x2fa7cd[_0xebae('0x2b')]['key']};});_0x4574ba[_0xebae('0x2c')]=_[_0xebae('0x28')](_0x315ae6,_0xebae('0x25'));_0x4574ba['query']=_['keys'](_0x47e8f5[_0xebae('0x2d')]);_0x4574ba[_0xebae('0x2e')]=_[_0xebae('0x2f')](_0x4574ba[_0xebae('0x2c')],_0x4574ba['query']);_0x28cdac[_0xebae('0x30')]=_[_0xebae('0x2f')](_0x4574ba[_0xebae('0x2c')],qs[_0xebae('0x31')](_0x47e8f5[_0xebae('0x2d')][_0xebae('0x31')]));_0x28cdac[_0xebae('0x30')]=_0x28cdac[_0xebae('0x30')][_0xebae('0x32')]?_0x28cdac[_0xebae('0x30')]:_0x4574ba['model'];if(!_0x47e8f5['query'][_0xebae('0x33')](_0xebae('0x34'))){_0x28cdac['limit']=qs['limit'](_0x47e8f5[_0xebae('0x2d')]['limit']);_0x28cdac[_0xebae('0x17')]=qs[_0xebae('0x17')](_0x47e8f5['query'][_0xebae('0x17')]);}_0x28cdac[_0xebae('0x35')]=qs['sort'](_0x47e8f5[_0xebae('0x2d')][_0xebae('0x36')]);_0x28cdac[_0xebae('0x37')]=qs[_0xebae('0x2e')](_[_0xebae('0x38')](_0x47e8f5['query'],_0x4574ba[_0xebae('0x2e')]),_0x315ae6);if(_0x47e8f5[_0xebae('0x2d')][_0xebae('0x39')]){_0x28cdac[_0xebae('0x37')]=_[_0xebae('0x3a')](_0x28cdac[_0xebae('0x37')],{'$or':_[_0xebae('0x28')](_0x315ae6,function(_0x176b98){if(_0x176b98[_0xebae('0x2b')]!=='VIRTUAL'){var _0x3e0e16={};_0x3e0e16[_0x176b98['name']]={'$like':'%'+_0x47e8f5[_0xebae('0x2d')][_0xebae('0x39')]+'%'};return _0x3e0e16;}})});}_0x28cdac=_[_0xebae('0x3a')]({},_0x28cdac,_0x47e8f5[_0xebae('0x3b')]);var _0x18bf17={'where':_0x28cdac[_0xebae('0x37')]};return db['AnalyticFieldReport']['count'](_0x18bf17)[_0xebae('0x21')](function(_0x184579){_0xbb8b14[_0xebae('0x1a')]=_0x184579;if(_0x47e8f5['query'][_0xebae('0x3c')]){_0x28cdac[_0xebae('0x3d')]=[{'all':!![]}];}return db[_0xebae('0x3e')]['findAll'](_0x28cdac);})[_0xebae('0x21')](function(_0x2e905e){_0xbb8b14['rows']=_0x2e905e;return _0xbb8b14;})[_0xebae('0x21')](respondWithFilteredResult(_0x3f022a,_0x28cdac))[_0xebae('0x3f')](handleError(_0x3f022a,null));};exports['show']=function(_0xe8bd31,_0x2e3b3b){var _0x50f5bf={'raw':![],'where':{'id':_0xe8bd31[_0xebae('0x40')]['id']}},_0x4c6106={};_0x4c6106[_0xebae('0x2c')]=_[_0xebae('0x41')](db[_0xebae('0x3e')][_0xebae('0x29')]);_0x4c6106[_0xebae('0x2d')]=_[_0xebae('0x41')](_0xe8bd31['query']);_0x4c6106[_0xebae('0x2e')]=_[_0xebae('0x2f')](_0x4c6106[_0xebae('0x2c')],_0x4c6106[_0xebae('0x2d')]);_0x50f5bf[_0xebae('0x30')]=_[_0xebae('0x2f')](_0x4c6106['model'],qs[_0xebae('0x31')](_0xe8bd31[_0xebae('0x2d')][_0xebae('0x31')]));_0x50f5bf[_0xebae('0x30')]=_0x50f5bf[_0xebae('0x30')]['length']?_0x50f5bf[_0xebae('0x30')]:_0x4c6106[_0xebae('0x2c')];if(_0xe8bd31[_0xebae('0x2d')][_0xebae('0x3c')]){_0x50f5bf[_0xebae('0x3d')]=[{'all':!![]}];}_0x50f5bf=_[_0xebae('0x3a')]({},_0x50f5bf,_0xe8bd31['options']);return db[_0xebae('0x3e')][_0xebae('0x42')](_0x50f5bf)[_0xebae('0x21')](handleEntityNotFound(_0x2e3b3b,null))[_0xebae('0x21')](respondWithResult(_0x2e3b3b,null))[_0xebae('0x3f')](handleError(_0x2e3b3b,null));};exports[_0xebae('0x43')]=function(_0x5968cb,_0x61a2b5){return db[_0xebae('0x3e')][_0xebae('0x43')](_0x5968cb['body'],{})[_0xebae('0x21')](respondWithResult(_0x61a2b5,0xc9))[_0xebae('0x3f')](handleError(_0x61a2b5,null));};exports['bulkCreate']=function(_0x4936cb,_0x38f666){return db[_0xebae('0x3e')][_0xebae('0x44')](_0x4936cb[_0xebae('0x45')],{'raw':![],'individualHooks':!![]})[_0xebae('0x21')](respondWithResult(_0x38f666,0xc9))[_0xebae('0x3f')](handleError(_0x38f666,null));};exports['update']=function(_0x3be9f7,_0x3751bd){if(_0x3be9f7[_0xebae('0x45')]['id']){delete _0x3be9f7['body']['id'];}return db[_0xebae('0x3e')][_0xebae('0x42')]({'where':{'id':_0x3be9f7['params']['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x3751bd,null))[_0xebae('0x21')](saveUpdates(_0x3be9f7[_0xebae('0x45')],null))[_0xebae('0x21')](respondWithResult(_0x3751bd,null))[_0xebae('0x3f')](handleError(_0x3751bd,null));};exports['destroy']=function(_0x2889cd,_0x451723){return db[_0xebae('0x3e')][_0xebae('0x42')]({'where':{'id':_0x2889cd[_0xebae('0x40')]['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x451723,null))[_0xebae('0x21')](removeEntity(_0x451723,null))[_0xebae('0x3f')](handleError(_0x451723,null));};exports[_0xebae('0x46')]=function(_0x3bbe1e,_0x5507f7){return db[_0xebae('0x3e')][_0xebae('0x22')]({'where':{'id':_0x3bbe1e[_0xebae('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5507f7,0xcc))['catch'](handleError(_0x5507f7,null));};exports['addFields']=function(_0x41bc5d,_0x45730b,_0x188a62){return db[_0xebae('0x47')][_0xebae('0x48')]({'where':{'id':_0x41bc5d['params']['id']}})[_0xebae('0x21')](handleEntityNotFound(_0x45730b,null))['then'](function(_0x33f59c){if(_0x33f59c){return db['sequelize'][_0xebae('0x49')](function(_0x408420){return db[_0xebae('0x3e')][_0xebae('0x22')]({'where':{'CustomReportId':_0x41bc5d[_0xebae('0x40')]['id']},'transaction':_0x408420})[_0xebae('0x21')](function(_0x4e3af3){var _0x408a1b=_[_0xebae('0x28')](_0x41bc5d[_0xebae('0x45')],function(_0x16e999){delete _0x16e999['id'];_0x16e999[_0xebae('0x4a')]=_0x41bc5d[_0xebae('0x40')]['id'];return _0x16e999;});return db['AnalyticFieldReport'][_0xebae('0x44')](_0x408a1b,{'transaction':_0x408420});});})[_0xebae('0x21')](function(){return db[_0xebae('0x3e')][_0xebae('0x4b')]({'where':{'CustomReportId':_0x41bc5d['params']['id']}});});}})[_0xebae('0x21')](respondWithResult(_0x45730b,null))[_0xebae('0x3f')](handleError(_0x45730b,null));}; \ No newline at end of file +var _0xacc8=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','AnalyticFieldReport','findAll','rows','catch','show','params','rawAttributes','include','find','create','bulkCreate','body','update','bulkDestroy','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','index','map'];(function(_0x5d921e,_0x9565ff){var _0x901487=function(_0x16cd62){while(--_0x16cd62){_0x5d921e['push'](_0x5d921e['shift']());}};_0x901487(++_0x9565ff);}(_0xacc8,0x1ba));var _0x8acc=function(_0x20be7e,_0x56db99){_0x20be7e=_0x20be7e-0x0;var _0x43728c=_0xacc8[_0x20be7e];return _0x43728c;};'use strict';var emlformat=require(_0x8acc('0x0'));var rimraf=require(_0x8acc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8acc('0x2'));var rp=require(_0x8acc('0x3'));var moment=require(_0x8acc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8acc('0x5'));var util=require(_0x8acc('0x6'));var path=require(_0x8acc('0x7'));var sox=require('sox');var csv=require(_0x8acc('0x8'));var ejs=require(_0x8acc('0x9'));var fs=require('fs');var fs_extra=require(_0x8acc('0xa'));var _=require(_0x8acc('0xb'));var squel=require('squel');var crypto=require(_0x8acc('0xc'));var jsforce=require(_0x8acc('0xd'));var deskjs=require(_0x8acc('0xe'));var toCsv=require(_0x8acc('0x8'));var querystring=require(_0x8acc('0xf'));var Papa=require(_0x8acc('0x10'));var Redis=require(_0x8acc('0x11'));var authService=require(_0x8acc('0x12'));var qs=require(_0x8acc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8acc('0x14'));var logger=require(_0x8acc('0x15'))(_0x8acc('0x16'));var utils=require(_0x8acc('0x17'));var config=require(_0x8acc('0x18'));var licenseUtil=require(_0x8acc('0x19'));var db=require(_0x8acc('0x1a'))['db'];function respondWithStatusCode(_0x4b12ad,_0x59b697){_0x59b697=_0x59b697||0xcc;return function(_0x1feb8d){if(_0x1feb8d){return _0x4b12ad[_0x8acc('0x1b')](_0x59b697);}return _0x4b12ad['status'](_0x59b697)[_0x8acc('0x1c')]();};}function respondWithResult(_0x2f6d3f,_0x52cd4f){_0x52cd4f=_0x52cd4f||0xc8;return function(_0x50f84a){if(_0x50f84a){return _0x2f6d3f[_0x8acc('0x1d')](_0x52cd4f)['json'](_0x50f84a);}};}function respondWithFilteredResult(_0x2f0ceb,_0x1f1b54){return function(_0x24f348){if(_0x24f348){var _0x19556f=typeof _0x1f1b54[_0x8acc('0x1e')]===_0x8acc('0x1f')&&typeof _0x1f1b54['limit']===_0x8acc('0x1f');var _0x11685b=_0x24f348['count'];var _0xc77b57=_0x19556f?0x0:_0x1f1b54[_0x8acc('0x1e')];var _0x46b8a9=_0x19556f?_0x24f348[_0x8acc('0x20')]:_0x1f1b54[_0x8acc('0x1e')]+_0x1f1b54['limit'];var _0x33b457;if(_0x46b8a9>=_0x11685b){_0x46b8a9=_0x11685b;_0x33b457=0xc8;}else{_0x33b457=0xce;}_0x2f0ceb[_0x8acc('0x1d')](_0x33b457);return _0x2f0ceb[_0x8acc('0x21')](_0x8acc('0x22'),_0xc77b57+'-'+_0x46b8a9+'/'+_0x11685b)[_0x8acc('0x23')](_0x24f348);}return null;};}function patchUpdates(_0x42ae7a){return function(_0x5da64f){try{jsonpatch[_0x8acc('0x24')](_0x5da64f,_0x42ae7a,!![]);}catch(_0xc83a56){return BPromise['reject'](_0xc83a56);}return _0x5da64f[_0x8acc('0x25')]();};}function saveUpdates(_0x5ee85d,_0x1ca276){return function(_0x32f773){if(_0x32f773){return _0x32f773['update'](_0x5ee85d)[_0x8acc('0x26')](function(_0x1f3c8b){return _0x1f3c8b;});}return null;};}function removeEntity(_0x470e1a,_0x164650){return function(_0x35407f){if(_0x35407f){return _0x35407f[_0x8acc('0x27')]()[_0x8acc('0x26')](function(){_0x470e1a[_0x8acc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf374da,_0x30ac83){return function(_0x1b1443){if(!_0x1b1443){_0xf374da['sendStatus'](0x194);}return _0x1b1443;};}function handleError(_0x3b5bce,_0x2aa2ef){_0x2aa2ef=_0x2aa2ef||0x1f4;return function(_0x545d85){logger[_0x8acc('0x28')](_0x545d85['stack']);if(_0x545d85[_0x8acc('0x29')]){delete _0x545d85[_0x8acc('0x29')];}_0x3b5bce[_0x8acc('0x1d')](_0x2aa2ef)['send'](_0x545d85);};}exports[_0x8acc('0x2a')]=function(_0x4c5828,_0x40e2fb){var _0x1d4f7e={},_0x1b4307={},_0x13385d={'count':0x0,'rows':[]};var _0x17f7a0=_[_0x8acc('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0x3153bf){return{'name':_0x3153bf[_0x8acc('0x2c')],'type':_0x3153bf[_0x8acc('0x2d')][_0x8acc('0x2e')]};});_0x1b4307[_0x8acc('0x2f')]=_['map'](_0x17f7a0,_0x8acc('0x29'));_0x1b4307[_0x8acc('0x30')]=_[_0x8acc('0x31')](_0x4c5828[_0x8acc('0x30')]);_0x1b4307[_0x8acc('0x32')]=_[_0x8acc('0x33')](_0x1b4307['model'],_0x1b4307[_0x8acc('0x30')]);_0x1d4f7e[_0x8acc('0x34')]=_[_0x8acc('0x33')](_0x1b4307[_0x8acc('0x2f')],qs[_0x8acc('0x35')](_0x4c5828['query'][_0x8acc('0x35')]));_0x1d4f7e[_0x8acc('0x34')]=_0x1d4f7e[_0x8acc('0x34')]['length']?_0x1d4f7e[_0x8acc('0x34')]:_0x1b4307[_0x8acc('0x2f')];if(!_0x4c5828[_0x8acc('0x30')]['hasOwnProperty'](_0x8acc('0x36'))){_0x1d4f7e[_0x8acc('0x37')]=qs[_0x8acc('0x37')](_0x4c5828[_0x8acc('0x30')][_0x8acc('0x37')]);_0x1d4f7e[_0x8acc('0x1e')]=qs[_0x8acc('0x1e')](_0x4c5828[_0x8acc('0x30')]['offset']);}_0x1d4f7e['order']=qs[_0x8acc('0x38')](_0x4c5828['query'][_0x8acc('0x38')]);_0x1d4f7e[_0x8acc('0x39')]=qs[_0x8acc('0x32')](_[_0x8acc('0x3a')](_0x4c5828[_0x8acc('0x30')],_0x1b4307[_0x8acc('0x32')]),_0x17f7a0);if(_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3b')]){_0x1d4f7e[_0x8acc('0x39')]=_[_0x8acc('0x3c')](_0x1d4f7e['where'],{'$or':_['map'](_0x17f7a0,function(_0x1b1480){if(_0x1b1480['type']!=='VIRTUAL'){var _0x529b62={};_0x529b62[_0x1b1480[_0x8acc('0x29')]]={'$like':'%'+_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3b')]+'%'};return _0x529b62;}})});}_0x1d4f7e=_['merge']({},_0x1d4f7e,_0x4c5828[_0x8acc('0x3d')]);var _0x4805d9={'where':_0x1d4f7e['where']};return db['AnalyticFieldReport'][_0x8acc('0x20')](_0x4805d9)['then'](function(_0x4afbb6){_0x13385d['count']=_0x4afbb6;if(_0x4c5828[_0x8acc('0x30')][_0x8acc('0x3e')]){_0x1d4f7e['include']=[{'all':!![]}];}return db[_0x8acc('0x3f')][_0x8acc('0x40')](_0x1d4f7e);})['then'](function(_0x4e5f87){_0x13385d[_0x8acc('0x41')]=_0x4e5f87;return _0x13385d;})[_0x8acc('0x26')](respondWithFilteredResult(_0x40e2fb,_0x1d4f7e))[_0x8acc('0x42')](handleError(_0x40e2fb,null));};exports[_0x8acc('0x43')]=function(_0x1977ad,_0x47b405){var _0x33b853={'raw':![],'where':{'id':_0x1977ad[_0x8acc('0x44')]['id']}},_0x364b7e={};_0x364b7e['model']=_[_0x8acc('0x31')](db['AnalyticFieldReport'][_0x8acc('0x45')]);_0x364b7e['query']=_[_0x8acc('0x31')](_0x1977ad[_0x8acc('0x30')]);_0x364b7e[_0x8acc('0x32')]=_[_0x8acc('0x33')](_0x364b7e[_0x8acc('0x2f')],_0x364b7e['query']);_0x33b853[_0x8acc('0x34')]=_[_0x8acc('0x33')](_0x364b7e[_0x8acc('0x2f')],qs[_0x8acc('0x35')](_0x1977ad['query'][_0x8acc('0x35')]));_0x33b853[_0x8acc('0x34')]=_0x33b853[_0x8acc('0x34')]['length']?_0x33b853[_0x8acc('0x34')]:_0x364b7e['model'];if(_0x1977ad[_0x8acc('0x30')]['includeAll']){_0x33b853[_0x8acc('0x46')]=[{'all':!![]}];}_0x33b853=_[_0x8acc('0x3c')]({},_0x33b853,_0x1977ad[_0x8acc('0x3d')]);return db['AnalyticFieldReport'][_0x8acc('0x47')](_0x33b853)['then'](handleEntityNotFound(_0x47b405,null))[_0x8acc('0x26')](respondWithResult(_0x47b405,null))[_0x8acc('0x42')](handleError(_0x47b405,null));};exports['create']=function(_0x4c55d1,_0x1d6c5a){return db['AnalyticFieldReport'][_0x8acc('0x48')](_0x4c55d1['body'],{})['then'](respondWithResult(_0x1d6c5a,0xc9))['catch'](handleError(_0x1d6c5a,null));};exports[_0x8acc('0x49')]=function(_0x91104b,_0x15925d){return db[_0x8acc('0x3f')][_0x8acc('0x49')](_0x91104b[_0x8acc('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8acc('0x26')](respondWithResult(_0x15925d,0xc9))[_0x8acc('0x42')](handleError(_0x15925d,null));};exports[_0x8acc('0x4b')]=function(_0x9f543a,_0x2628be){if(_0x9f543a[_0x8acc('0x4a')]['id']){delete _0x9f543a[_0x8acc('0x4a')]['id'];}return db[_0x8acc('0x3f')][_0x8acc('0x47')]({'where':{'id':_0x9f543a['params']['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x2628be,null))['then'](saveUpdates(_0x9f543a[_0x8acc('0x4a')],null))[_0x8acc('0x26')](respondWithResult(_0x2628be,null))[_0x8acc('0x42')](handleError(_0x2628be,null));};exports[_0x8acc('0x27')]=function(_0x17a278,_0x1a9fc5){return db[_0x8acc('0x3f')][_0x8acc('0x47')]({'where':{'id':_0x17a278[_0x8acc('0x44')]['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x1a9fc5,null))[_0x8acc('0x26')](removeEntity(_0x1a9fc5,null))[_0x8acc('0x42')](handleError(_0x1a9fc5,null));};exports[_0x8acc('0x4c')]=function(_0x41f53c,_0x2d7bf8){return db[_0x8acc('0x3f')][_0x8acc('0x27')]({'where':{'id':_0x41f53c[_0x8acc('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2d7bf8,0xcc))[_0x8acc('0x42')](handleError(_0x2d7bf8,null));};exports['addFields']=function(_0x18e6f7,_0x2d147e,_0x513abd){return db[_0x8acc('0x4d')]['findOne']({'where':{'id':_0x18e6f7[_0x8acc('0x44')]['id']}})[_0x8acc('0x26')](handleEntityNotFound(_0x2d147e,null))[_0x8acc('0x26')](function(_0x437aad){if(_0x437aad){return db[_0x8acc('0x4e')][_0x8acc('0x4f')](function(_0x549ac3){return db[_0x8acc('0x3f')][_0x8acc('0x27')]({'where':{'CustomReportId':_0x18e6f7['params']['id']},'transaction':_0x549ac3})['then'](function(_0x12b2c3){var _0x37940=_[_0x8acc('0x2b')](_0x18e6f7[_0x8acc('0x4a')],function(_0x21c382){delete _0x21c382['id'];_0x21c382[_0x8acc('0x50')]=_0x18e6f7[_0x8acc('0x44')]['id'];return _0x21c382;});return db['AnalyticFieldReport'][_0x8acc('0x49')](_0x37940,{'transaction':_0x549ac3});});})[_0x8acc('0x26')](function(){return db[_0x8acc('0x3f')][_0x8acc('0x40')]({'where':{'CustomReportId':_0x18e6f7[_0x8acc('0x44')]['id']}});});}})['then'](respondWithResult(_0x2d147e,null))[_0x8acc('0x42')](handleError(_0x2d147e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c0ea8d4..4349808 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 _0xf58a=['exports','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xbe1068,_0x5ab0e6){var _0x2003fc=function(_0x42cd9){while(--_0x42cd9){_0xbe1068['push'](_0xbe1068['shift']());}};_0x2003fc(++_0x5ab0e6);}(_0xf58a,0x174));var _0xaf58=function(_0x25cb81,_0x1c3f72){_0x25cb81=_0x25cb81-0x0;var _0x377b87=_0xf58a[_0x25cb81];return _0x377b87;};'use strict';var _=require(_0xaf58('0x0'));var util=require(_0xaf58('0x1'));var logger=require(_0xaf58('0x2'))(_0xaf58('0x3'));var moment=require(_0xaf58('0x4'));var BPromise=require(_0xaf58('0x5'));var rp=require(_0xaf58('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf58('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0xaf58('0x8')]=function(_0x16d4f2,_0x32cd17){return _0x16d4f2['define'](_0xaf58('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c7d=['AnalyticFieldReport','analytics_report_fields','lodash','util','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8c7d,0x1df));var _0xd8c7=function(_0x4462b8,_0x600dc6){_0x4462b8=_0x4462b8-0x0;var _0x54873=_0x8c7d[_0x4462b8];return _0x54873;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd8c7('0x2'));var rp=require(_0xd8c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8c7('0x4'));var attributes=require('./analyticFieldReport.attributes');module[_0xd8c7('0x5')]=function(_0x2d44b0,_0x2e877b){return _0x2d44b0[_0xd8c7('0x6')](_0xd8c7('0x7'),attributes,{'tableName':_0xd8c7('0x8'),'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 f6b3f31..c636821 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 _0x937a=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x470950,_0x579a9){var _0x44ecf6=function(_0x44148d){while(--_0x44148d){_0x470950['push'](_0x470950['shift']());}};_0x44ecf6(++_0x579a9);}(_0x937a,0xbe));var _0xa937=function(_0x238b9a,_0x4fcbb8){_0x238b9a=_0x238b9a-0x0;var _0x59ebf3=_0x937a[_0x238b9a];return _0x59ebf3;};'use strict';var _=require(_0xa937('0x0'));var util=require('util');var moment=require(_0xa937('0x1'));var BPromise=require(_0xa937('0x2'));var rs=require(_0xa937('0x3'));var fs=require('fs');var Redis=require(_0xa937('0x4'));var db=require(_0xa937('0x5'))['db'];var utils=require(_0xa937('0x6'));var logger=require(_0xa937('0x7'))('rpc');var config=require(_0xa937('0x8'));var jayson=require(_0xa937('0x9'));var client=jayson[_0xa937('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c23d8,_0x4b059c,_0x46c8ad){return new BPromise(function(_0x224846,_0x69ce28){return client[_0xa937('0xb')](_0x5c23d8,_0x46c8ad)[_0xa937('0xc')](function(_0x2ebde8){logger['info'](_0xa937('0xd'),_0x4b059c,_0xa937('0xe'));logger[_0xa937('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4b059c,_0xa937('0xe'),JSON['stringify'](_0x2ebde8));if(_0x2ebde8[_0xa937('0x10')]){if(_0x2ebde8['error'][_0xa937('0x11')]===0x1f4){logger[_0xa937('0x10')](_0xa937('0xd'),_0x4b059c,_0x2ebde8[_0xa937('0x10')]['message']);return _0x69ce28(_0x2ebde8[_0xa937('0x10')]['message']);}logger[_0xa937('0x10')](_0xa937('0xd'),_0x4b059c,_0x2ebde8[_0xa937('0x10')]['message']);return _0x224846(_0x2ebde8[_0xa937('0x10')][_0xa937('0x12')]);}else{logger[_0xa937('0x13')](_0xa937('0xd'),_0x4b059c,_0xa937('0xe'));_0x224846(_0x2ebde8[_0xa937('0x14')][_0xa937('0x12')]);}})['catch'](function(_0x10e67d){logger[_0xa937('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4b059c,_0x10e67d);_0x69ce28(_0x10e67d);});});} \ No newline at end of file +var _0x40ad=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x40ad,0x1f0));var _0xd40a=function(_0x368682,_0x56698f){_0x368682=_0x368682-0x0;var _0x2bc428=_0x40ad[_0x368682];return _0x2bc428;};'use strict';var _=require(_0xd40a('0x0'));var util=require(_0xd40a('0x1'));var moment=require(_0xd40a('0x2'));var BPromise=require(_0xd40a('0x3'));var rs=require(_0xd40a('0x4'));var fs=require('fs');var Redis=require(_0xd40a('0x5'));var db=require(_0xd40a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd40a('0x7'))('rpc');var config=require(_0xd40a('0x8'));var jayson=require(_0xd40a('0x9'));var client=jayson[_0xd40a('0xa')][_0xd40a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x342b3f,_0x4a9820,_0x42ebde){return new BPromise(function(_0x28b7e0,_0x109613){return client[_0xd40a('0xc')](_0x342b3f,_0x42ebde)[_0xd40a('0xd')](function(_0x5d41f6){logger[_0xd40a('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4a9820,_0xd40a('0xf'));logger[_0xd40a('0x10')](_0xd40a('0x11'),_0x4a9820,_0xd40a('0xf'),JSON['stringify'](_0x5d41f6));if(_0x5d41f6[_0xd40a('0x12')]){if(_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x13')]===0x1f4){logger[_0xd40a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4a9820,_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x14')]);return _0x109613(_0x5d41f6['error'][_0xd40a('0x14')]);}logger['error'](_0xd40a('0x15'),_0x4a9820,_0x5d41f6[_0xd40a('0x12')][_0xd40a('0x14')]);return _0x28b7e0(_0x5d41f6['error'][_0xd40a('0x14')]);}else{logger[_0xd40a('0xe')](_0xd40a('0x15'),_0x4a9820,'request\x20sent');_0x28b7e0(_0x5d41f6[_0xd40a('0x16')]['message']);}})[_0xd40a('0x17')](function(_0x24aeb5){logger['error'](_0xd40a('0x15'),_0x4a9820,_0x24aeb5);_0x109613(_0x24aeb5);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 58ad183..a4a33b4 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x83d29f,_0x208c3d){var _0x2c64ff=function(_0x7ae1be){while(--_0x7ae1be){_0x83d29f['push'](_0x83d29f['shift']());}};_0x2c64ff(++_0x208c3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x3c1ff7,_0xc3be74){var _0x59830a=function(_0x31b96a){while(--_0x31b96a){_0x3c1ff7['push'](_0x3c1ff7['shift']());}};_0x59830a(++_0xc3be74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 5f24d4b..5cde57a 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 _0x8ec7=['STRING','sequelize','exports','name'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x8ec7,0x1f1));var _0x78ec=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x8ec7[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x78ec('0x0'));module[_0x78ec('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x78ec('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x78ec('0x3')]}}; \ No newline at end of file +var _0xd957=['exports','name','STRING','sequelize'];(function(_0x3aa05d,_0x42007f){var _0x2f53bc=function(_0x5e1651){while(--_0x5e1651){_0x3aa05d['push'](_0x3aa05d['shift']());}};_0x2f53bc(++_0x42007f);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 66c2f6c..eb68198 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 _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x2680af,_0x28626d){var _0x2f065c=function(_0x1e6f99){while(--_0x1e6f99){_0x2680af['push'](_0x2680af['shift']());}};_0x2f065c(++_0x28626d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));}; \ No newline at end of file +var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x494afb,_0x55e447){var _0x2cf98d=function(_0xa082b4){while(--_0xa082b4){_0x494afb['push'](_0x494afb['shift']());}};_0x2cf98d(++_0x55e447);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0xf2ca[_0x7f3667];return _0x2c4c24;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 519a1b8..7ec021c 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 _0xe6e9=['define','analytics_metrics','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x1359c9,_0x553c03){var _0x352cc3=function(_0x4cc25b){while(--_0x4cc25b){_0x1359c9['push'](_0x1359c9['shift']());}};_0x352cc3(++_0x553c03);}(_0xe6e9,0x182));var _0x9e6e=function(_0x3f5004,_0x21773a){_0x3f5004=_0x3f5004-0x0;var _0x2085ca=_0xe6e9[_0x3f5004];return _0x2085ca;};'use strict';var _=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var logger=require(_0x9e6e('0x2'))('api');var moment=require(_0x9e6e('0x3'));var BPromise=require(_0x9e6e('0x4'));var rp=require(_0x9e6e('0x5'));var fs=require('fs');var path=require(_0x9e6e('0x6'));var rimraf=require(_0x9e6e('0x7'));var config=require('../../config/environment');var attributes=require(_0x9e6e('0x8'));module[_0x9e6e('0x9')]=function(_0x206572,_0x1e8e5e){return _0x206572[_0x9e6e('0xa')]('AnalyticMetric',attributes,{'tableName':_0x9e6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05bc=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','request-promise','path','rimraf'];(function(_0x3f8bac,_0xaefd0a){var _0x3322ab=function(_0x21ae3c){while(--_0x21ae3c){_0x3f8bac['push'](_0x3f8bac['shift']());}};_0x3322ab(++_0xaefd0a);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc05b('0x0'));var logger=require('../../config/logger')(_0xc05b('0x1'));var moment=require(_0xc05b('0x2'));var BPromise=require('bluebird');var rp=require(_0xc05b('0x3'));var fs=require('fs');var path=require(_0xc05b('0x4'));var rimraf=require(_0xc05b('0x5'));var config=require(_0xc05b('0x6'));var attributes=require(_0xc05b('0x7'));module[_0xc05b('0x8')]=function(_0x2514a1,_0x22c8db){return _0x2514a1[_0xc05b('0x9')](_0xc05b('0xa'),attributes,{'tableName':_0xc05b('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 fbeb232..afc7ca2 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 _0x8e49=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring'];(function(_0x51543d,_0x204989){var _0x4a62cb=function(_0x369871){while(--_0x369871){_0x51543d['push'](_0x51543d['shift']());}};_0x4a62cb(++_0x204989);}(_0x8e49,0x1ac));var _0x98e4=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x8e49[_0x16de68];return _0x1c277e;};'use strict';var _=require(_0x98e4('0x0'));var util=require(_0x98e4('0x1'));var moment=require('moment');var BPromise=require(_0x98e4('0x2'));var rs=require(_0x98e4('0x3'));var fs=require('fs');var Redis=require(_0x98e4('0x4'));var db=require(_0x98e4('0x5'))['db'];var utils=require(_0x98e4('0x6'));var logger=require(_0x98e4('0x7'))('rpc');var config=require(_0x98e4('0x8'));var jayson=require(_0x98e4('0x9'));var client=jayson[_0x98e4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88112a,_0x27542e,_0x13f068){return new BPromise(function(_0x59f5a4,_0x2bec41){return client[_0x98e4('0xb')](_0x88112a,_0x13f068)[_0x98e4('0xc')](function(_0x572468){logger[_0x98e4('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x98e4('0xe'));logger[_0x98e4('0xf')](_0x98e4('0x10'),_0x27542e,'request\x20sent',JSON[_0x98e4('0x11')](_0x572468));if(_0x572468['error']){if(_0x572468[_0x98e4('0x12')][_0x98e4('0x13')]===0x1f4){logger[_0x98e4('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x572468[_0x98e4('0x12')][_0x98e4('0x14')]);return _0x2bec41(_0x572468[_0x98e4('0x12')][_0x98e4('0x14')]);}logger[_0x98e4('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x27542e,_0x572468['error'][_0x98e4('0x14')]);return _0x59f5a4(_0x572468['error'][_0x98e4('0x14')]);}else{logger[_0x98e4('0xd')](_0x98e4('0x15'),_0x27542e,'request\x20sent');_0x59f5a4(_0x572468[_0x98e4('0x16')]['message']);}})[_0x98e4('0x17')](function(_0x28ad3e){logger[_0x98e4('0x12')](_0x98e4('0x15'),_0x27542e,_0x28ad3e);_0x2bec41(_0x28ad3e);});});} \ No newline at end of file +var _0x3b4b=['then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','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'];(function(_0x1abec9,_0xc63957){var _0x3e46d6=function(_0x159f1b){while(--_0x159f1b){_0x1abec9['push'](_0x1abec9['shift']());}};_0x3e46d6(++_0xc63957);}(_0x3b4b,0x11a));var _0xb3b4=function(_0x416862,_0x5f29d3){_0x416862=_0x416862-0x0;var _0x42a554=_0x3b4b[_0x416862];return _0x42a554;};'use strict';var _=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var moment=require(_0xb3b4('0x2'));var BPromise=require(_0xb3b4('0x3'));var rs=require(_0xb3b4('0x4'));var fs=require('fs');var Redis=require(_0xb3b4('0x5'));var db=require(_0xb3b4('0x6'))['db'];var utils=require(_0xb3b4('0x7'));var logger=require(_0xb3b4('0x8'))(_0xb3b4('0x9'));var config=require(_0xb3b4('0xa'));var jayson=require(_0xb3b4('0xb'));var client=jayson[_0xb3b4('0xc')][_0xb3b4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xadd742,_0x46101c,_0x4c79e0){return new BPromise(function(_0x5b3efd,_0x4c15d2){return client[_0xb3b4('0xe')](_0xadd742,_0x4c79e0)[_0xb3b4('0xf')](function(_0x3eaa7e){logger[_0xb3b4('0x10')](_0xb3b4('0x11'),_0x46101c,'request\x20sent');logger[_0xb3b4('0x12')](_0xb3b4('0x13'),_0x46101c,_0xb3b4('0x14'),JSON[_0xb3b4('0x15')](_0x3eaa7e));if(_0x3eaa7e[_0xb3b4('0x16')]){if(_0x3eaa7e[_0xb3b4('0x16')][_0xb3b4('0x17')]===0x1f4){logger[_0xb3b4('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x46101c,_0x3eaa7e['error'][_0xb3b4('0x18')]);return _0x4c15d2(_0x3eaa7e[_0xb3b4('0x16')][_0xb3b4('0x18')]);}logger[_0xb3b4('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x46101c,_0x3eaa7e['error'][_0xb3b4('0x18')]);return _0x5b3efd(_0x3eaa7e['error'][_0xb3b4('0x18')]);}else{logger[_0xb3b4('0x10')](_0xb3b4('0x11'),_0x46101c,_0xb3b4('0x14'));_0x5b3efd(_0x3eaa7e[_0xb3b4('0x19')]['message']);}})[_0xb3b4('0x1a')](function(_0x2e7e21){logger[_0xb3b4('0x16')](_0xb3b4('0x11'),_0x46101c,_0x2e7e21);_0x4c15d2(_0x2e7e21);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 55fef6c..c1457b1 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 _0xe9e8=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x37aee9,_0x3a88c4){var _0x5ca958=function(_0x1e88ca){while(--_0x1e88ca){_0x37aee9['push'](_0x37aee9['shift']());}};_0x5ca958(++_0x3a88c4);}(_0xe9e8,0x179));var _0x8e9e=function(_0x421f01,_0x38db8b){_0x421f01=_0x421f01-0x0;var _0x490011=_0xe9e8[_0x421f01];return _0x490011;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0xd')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xe')]);router['put']('/:id',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x10')](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);module[_0x8e9e('0x12')]=router; \ No newline at end of file +var _0x8ef6=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','post','create','put','update','delete'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ad9a7,_0x40b99d){_0x2ad9a7=_0x2ad9a7-0x0;var _0x64083d=_0x8ef6[_0x2ad9a7];return _0x64083d;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['show']);router[_0x68ef('0xd')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0x11')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);module[_0x68ef('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9e64afb..3bcfc00 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x3fa7=['exports','TEXT','sequelize'];(function(_0x557173,_0x2604c3){var _0x4f0ed6=function(_0x53d953){while(--_0x53d953){_0x557173['push'](_0x557173['shift']());}};_0x4f0ed6(++_0x2604c3);}(_0x3fa7,0x10a));var _0x73fa=function(_0x309789,_0x3ae347){_0x309789=_0x309789-0x0;var _0x12b9b6=_0x3fa7[_0x309789];return _0x12b9b6;};'use strict';var Sequelize=require(_0x73fa('0x0'));module[_0x73fa('0x1')]={'tree':{'type':Sequelize[_0x73fa('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 2a2f11a..75747ea 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 _0x432b=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5cfb3a,_0x203aa8){var _0xad66a0=function(_0x56078e){while(--_0x56078e){_0x5cfb3a['push'](_0x5cfb3a['shift']());}};_0xad66a0(++_0x203aa8);}(_0x432b,0xd4));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb432('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb432('0x1'));var rp=require('request-promise');var moment=require(_0xb432('0x2'));var BPromise=require(_0xb432('0x3'));var Mustache=require(_0xb432('0x4'));var util=require(_0xb432('0x5'));var path=require(_0xb432('0x6'));var sox=require(_0xb432('0x7'));var csv=require(_0xb432('0x8'));var ejs=require(_0xb432('0x9'));var fs=require('fs');var fs_extra=require(_0xb432('0xa'));var _=require(_0xb432('0xb'));var squel=require(_0xb432('0xc'));var crypto=require('crypto');var jsforce=require(_0xb432('0xd'));var deskjs=require(_0xb432('0xe'));var toCsv=require(_0xb432('0x8'));var querystring=require(_0xb432('0xf'));var Papa=require(_0xb432('0x10'));var Redis=require(_0xb432('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb432('0x12'));var as=require(_0xb432('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb432('0x14'));var utils=require('../../config/utils');var config=require(_0xb432('0x15'));var licenseUtil=require(_0xb432('0x16'));var db=require(_0xb432('0x17'))['db'];function respondWithStatusCode(_0x500ea9,_0x3fe594){_0x3fe594=_0x3fe594||0xcc;return function(_0x2b7783){if(_0x2b7783){return _0x500ea9['sendStatus'](_0x3fe594);}return _0x500ea9[_0xb432('0x18')](_0x3fe594)[_0xb432('0x19')]();};}function respondWithResult(_0x3e35ec,_0x3ddf4c){_0x3ddf4c=_0x3ddf4c||0xc8;return function(_0x277d65){if(_0x277d65){return _0x3e35ec[_0xb432('0x18')](_0x3ddf4c)[_0xb432('0x1a')](_0x277d65);}};}function respondWithFilteredResult(_0x58fb38,_0x3134d0){return function(_0x292df6){if(_0x292df6){var _0x22a573=typeof _0x3134d0['offset']===_0xb432('0x1b')&&typeof _0x3134d0[_0xb432('0x1c')]===_0xb432('0x1b');var _0x134070=_0x292df6[_0xb432('0x1d')];var _0x47e8ff=_0x22a573?0x0:_0x3134d0[_0xb432('0x1e')];var _0x2a71cb=_0x22a573?_0x292df6[_0xb432('0x1d')]:_0x3134d0[_0xb432('0x1e')]+_0x3134d0[_0xb432('0x1c')];var _0x122441;if(_0x2a71cb>=_0x134070){_0x2a71cb=_0x134070;_0x122441=0xc8;}else{_0x122441=0xce;}_0x58fb38['status'](_0x122441);return _0x58fb38[_0xb432('0x1f')](_0xb432('0x20'),_0x47e8ff+'-'+_0x2a71cb+'/'+_0x134070)[_0xb432('0x1a')](_0x292df6);}return null;};}function patchUpdates(_0x4abfec){return function(_0x545b6a){try{jsonpatch[_0xb432('0x21')](_0x545b6a,_0x4abfec,!![]);}catch(_0x4d0594){return BPromise[_0xb432('0x22')](_0x4d0594);}return _0x545b6a[_0xb432('0x23')]();};}function saveUpdates(_0x61c577,_0x35a98b){return function(_0x4b2908){if(_0x4b2908){return _0x4b2908[_0xb432('0x24')](_0x61c577)[_0xb432('0x25')](function(_0x415e66){return _0x415e66;});}return null;};}function removeEntity(_0x5ae8de,_0x3e8d10){return function(_0x57c1c6){if(_0x57c1c6){return _0x57c1c6[_0xb432('0x26')]()['then'](function(){_0x5ae8de[_0xb432('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e55ca,_0x693e45){return function(_0x483f9){if(!_0x483f9){_0x3e55ca[_0xb432('0x27')](0x194);}return _0x483f9;};}function handleError(_0x37397d,_0x2665e0){_0x2665e0=_0x2665e0||0x1f4;return function(_0x8fc45){logger[_0xb432('0x28')](_0x8fc45[_0xb432('0x29')]);if(_0x8fc45[_0xb432('0x2a')]){delete _0x8fc45[_0xb432('0x2a')];}_0x37397d[_0xb432('0x18')](_0x2665e0)[_0xb432('0x2b')](_0x8fc45);};}exports[_0xb432('0x2c')]=function(_0x168dbf,_0x30a56e){var _0x2e5d6d={},_0x46701b={},_0x54c33e={'count':0x0,'rows':[]};var _0x4198b3=_[_0xb432('0x2d')](db[_0xb432('0x2e')][_0xb432('0x2f')],function(_0x262fbf){return{'name':_0x262fbf[_0xb432('0x30')],'type':_0x262fbf[_0xb432('0x31')][_0xb432('0x32')]};});_0x46701b[_0xb432('0x33')]=_[_0xb432('0x2d')](_0x4198b3,_0xb432('0x2a'));_0x46701b[_0xb432('0x34')]=_[_0xb432('0x35')](_0x168dbf['query']);_0x46701b[_0xb432('0x36')]=_[_0xb432('0x37')](_0x46701b[_0xb432('0x33')],_0x46701b['query']);_0x2e5d6d[_0xb432('0x38')]=_['intersection'](_0x46701b[_0xb432('0x33')],qs[_0xb432('0x39')](_0x168dbf['query'][_0xb432('0x39')]));_0x2e5d6d[_0xb432('0x38')]=_0x2e5d6d[_0xb432('0x38')]['length']?_0x2e5d6d[_0xb432('0x38')]:_0x46701b[_0xb432('0x33')];if(!_0x168dbf['query']['hasOwnProperty']('nolimit')){_0x2e5d6d[_0xb432('0x1c')]=qs[_0xb432('0x1c')](_0x168dbf[_0xb432('0x34')]['limit']);_0x2e5d6d['offset']=qs[_0xb432('0x1e')](_0x168dbf[_0xb432('0x34')][_0xb432('0x1e')]);}_0x2e5d6d['order']=qs[_0xb432('0x3a')](_0x168dbf['query'][_0xb432('0x3a')]);_0x2e5d6d[_0xb432('0x3b')]=qs[_0xb432('0x36')](_[_0xb432('0x3c')](_0x168dbf['query'],_0x46701b[_0xb432('0x36')]),_0x4198b3);if(_0x168dbf[_0xb432('0x34')]['filter']){_0x2e5d6d[_0xb432('0x3b')]=_[_0xb432('0x3d')](_0x2e5d6d['where'],{'$or':_[_0xb432('0x2d')](_0x4198b3,function(_0x4be860){if(_0x4be860['type']!=='VIRTUAL'){var _0x5794fb={};_0x5794fb[_0x4be860[_0xb432('0x2a')]]={'$like':'%'+_0x168dbf[_0xb432('0x34')]['filter']+'%'};return _0x5794fb;}})});}_0x2e5d6d=_['merge']({},_0x2e5d6d,_0x168dbf['options']);var _0x5c9349={'where':_0x2e5d6d[_0xb432('0x3b')]};return db[_0xb432('0x2e')][_0xb432('0x1d')](_0x5c9349)[_0xb432('0x25')](function(_0xaa17e1){_0x54c33e['count']=_0xaa17e1;if(_0x168dbf[_0xb432('0x34')][_0xb432('0x3e')]){_0x2e5d6d[_0xb432('0x3f')]=[{'all':!![]}];}return db[_0xb432('0x2e')][_0xb432('0x40')](_0x2e5d6d);})['then'](function(_0x286a04){_0x54c33e[_0xb432('0x41')]=_0x286a04;return _0x54c33e;})[_0xb432('0x25')](respondWithFilteredResult(_0x30a56e,_0x2e5d6d))[_0xb432('0x42')](handleError(_0x30a56e,null));};exports['show']=function(_0x5b67bd,_0x2dce0a){var _0x471bbc={'raw':!![],'where':{'id':_0x5b67bd[_0xb432('0x43')]['id']}},_0x3dc693={};_0x3dc693['model']=_[_0xb432('0x35')](db[_0xb432('0x2e')][_0xb432('0x2f')]);_0x3dc693[_0xb432('0x34')]=_[_0xb432('0x35')](_0x5b67bd[_0xb432('0x34')]);_0x3dc693[_0xb432('0x36')]=_[_0xb432('0x37')](_0x3dc693[_0xb432('0x33')],_0x3dc693[_0xb432('0x34')]);_0x471bbc[_0xb432('0x38')]=_[_0xb432('0x37')](_0x3dc693[_0xb432('0x33')],qs['fields'](_0x5b67bd[_0xb432('0x34')][_0xb432('0x39')]));_0x471bbc[_0xb432('0x38')]=_0x471bbc[_0xb432('0x38')][_0xb432('0x44')]?_0x471bbc[_0xb432('0x38')]:_0x3dc693[_0xb432('0x33')];if(_0x5b67bd[_0xb432('0x34')][_0xb432('0x3e')]){_0x471bbc[_0xb432('0x3f')]=[{'all':!![]}];}_0x471bbc=_['merge']({},_0x471bbc,_0x5b67bd[_0xb432('0x45')]);return db[_0xb432('0x2e')][_0xb432('0x46')](_0x471bbc)[_0xb432('0x25')](handleEntityNotFound(_0x2dce0a,null))['then'](respondWithResult(_0x2dce0a,null))[_0xb432('0x42')](handleError(_0x2dce0a,null));};exports['create']=function(_0x360e99,_0x1e09ba){return db['AnalyticTreeReport'][_0xb432('0x47')](_0x360e99['body'],{})['then'](respondWithResult(_0x1e09ba,0xc9))['catch'](handleError(_0x1e09ba,null));};exports[_0xb432('0x24')]=function(_0x123389,_0x314fb2){if(_0x123389[_0xb432('0x48')]['id']){delete _0x123389[_0xb432('0x48')]['id'];}return db[_0xb432('0x2e')][_0xb432('0x46')]({'where':{'id':_0x123389['params']['id']}})[_0xb432('0x25')](handleEntityNotFound(_0x314fb2,null))[_0xb432('0x25')](saveUpdates(_0x123389['body'],null))[_0xb432('0x25')](respondWithResult(_0x314fb2,null))[_0xb432('0x42')](handleError(_0x314fb2,null));};exports['destroy']=function(_0x4e32ed,_0xfa147c){return db[_0xb432('0x2e')][_0xb432('0x46')]({'where':{'id':_0x4e32ed[_0xb432('0x43')]['id']}})[_0xb432('0x25')](handleEntityNotFound(_0xfa147c,null))['then'](removeEntity(_0xfa147c,null))['catch'](handleError(_0xfa147c,null));}; \ No newline at end of file +var _0x257f=['offset','undefined','limit','count','status','apply','reject','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json'];(function(_0x362e4a,_0x26eaa5){var _0xad52fd=function(_0x10cda3){while(--_0x10cda3){_0x362e4a['push'](_0x362e4a['shift']());}};_0xad52fd(++_0x26eaa5);}(_0x257f,0x117));var _0xf257=function(_0x2b42a9,_0x3c7aed){_0x2b42a9=_0x2b42a9-0x0;var _0x215ec1=_0x257f[_0x2b42a9];return _0x215ec1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf257('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf257('0x1'));var rp=require(_0xf257('0x2'));var moment=require(_0xf257('0x3'));var BPromise=require(_0xf257('0x4'));var Mustache=require(_0xf257('0x5'));var util=require('util');var path=require(_0xf257('0x6'));var sox=require(_0xf257('0x7'));var csv=require(_0xf257('0x8'));var ejs=require(_0xf257('0x9'));var fs=require('fs');var fs_extra=require(_0xf257('0xa'));var _=require(_0xf257('0xb'));var squel=require(_0xf257('0xc'));var crypto=require(_0xf257('0xd'));var jsforce=require(_0xf257('0xe'));var deskjs=require(_0xf257('0xf'));var toCsv=require(_0xf257('0x8'));var querystring=require(_0xf257('0x10'));var Papa=require(_0xf257('0x11'));var Redis=require('ioredis');var authService=require(_0xf257('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf257('0x13'));var hardwareService=require(_0xf257('0x14'));var logger=require(_0xf257('0x15'))('api');var utils=require(_0xf257('0x16'));var config=require(_0xf257('0x17'));var licenseUtil=require(_0xf257('0x18'));var db=require(_0xf257('0x19'))['db'];function respondWithStatusCode(_0x19e683,_0x5dc46f){_0x5dc46f=_0x5dc46f||0xcc;return function(_0xf8a772){if(_0xf8a772){return _0x19e683[_0xf257('0x1a')](_0x5dc46f);}return _0x19e683['status'](_0x5dc46f)[_0xf257('0x1b')]();};}function respondWithResult(_0xc0ca27,_0x3f8d7a){_0x3f8d7a=_0x3f8d7a||0xc8;return function(_0x318f04){if(_0x318f04){return _0xc0ca27['status'](_0x3f8d7a)[_0xf257('0x1c')](_0x318f04);}};}function respondWithFilteredResult(_0x4a0e3f,_0x164d89){return function(_0x10ac04){if(_0x10ac04){var _0x5802cc=typeof _0x164d89[_0xf257('0x1d')]===_0xf257('0x1e')&&typeof _0x164d89[_0xf257('0x1f')]===_0xf257('0x1e');var _0x199e77=_0x10ac04[_0xf257('0x20')];var _0x37c62a=_0x5802cc?0x0:_0x164d89[_0xf257('0x1d')];var _0x295648=_0x5802cc?_0x10ac04[_0xf257('0x20')]:_0x164d89[_0xf257('0x1d')]+_0x164d89[_0xf257('0x1f')];var _0x10b72c;if(_0x295648>=_0x199e77){_0x295648=_0x199e77;_0x10b72c=0xc8;}else{_0x10b72c=0xce;}_0x4a0e3f[_0xf257('0x21')](_0x10b72c);return _0x4a0e3f['set']('Content-Range',_0x37c62a+'-'+_0x295648+'/'+_0x199e77)['json'](_0x10ac04);}return null;};}function patchUpdates(_0xb3ae0a){return function(_0x518099){try{jsonpatch[_0xf257('0x22')](_0x518099,_0xb3ae0a,!![]);}catch(_0x1bbb5c){return BPromise[_0xf257('0x23')](_0x1bbb5c);}return _0x518099[_0xf257('0x24')]();};}function saveUpdates(_0x56038d,_0x529429){return function(_0x54aa9e){if(_0x54aa9e){return _0x54aa9e['update'](_0x56038d)[_0xf257('0x25')](function(_0x3faca5){return _0x3faca5;});}return null;};}function removeEntity(_0x14b858,_0x472870){return function(_0x1afc03){if(_0x1afc03){return _0x1afc03[_0xf257('0x26')]()[_0xf257('0x25')](function(){_0x14b858[_0xf257('0x21')](0xcc)[_0xf257('0x1b')]();});}};}function handleEntityNotFound(_0x3c84c6,_0x797368){return function(_0x377201){if(!_0x377201){_0x3c84c6[_0xf257('0x1a')](0x194);}return _0x377201;};}function handleError(_0x1a5532,_0x5aaa93){_0x5aaa93=_0x5aaa93||0x1f4;return function(_0x1ad9d1){logger[_0xf257('0x27')](_0x1ad9d1[_0xf257('0x28')]);if(_0x1ad9d1[_0xf257('0x29')]){delete _0x1ad9d1[_0xf257('0x29')];}_0x1a5532[_0xf257('0x21')](_0x5aaa93)[_0xf257('0x2a')](_0x1ad9d1);};}exports[_0xf257('0x2b')]=function(_0x45a81a,_0x29e345){var _0x3c128d={},_0x3d6c20={},_0x86bd85={'count':0x0,'rows':[]};var _0x57e675=_['map'](db[_0xf257('0x2c')][_0xf257('0x2d')],function(_0x5139db){return{'name':_0x5139db[_0xf257('0x2e')],'type':_0x5139db[_0xf257('0x2f')]['key']};});_0x3d6c20[_0xf257('0x30')]=_[_0xf257('0x31')](_0x57e675,_0xf257('0x29'));_0x3d6c20[_0xf257('0x32')]=_[_0xf257('0x33')](_0x45a81a['query']);_0x3d6c20[_0xf257('0x34')]=_[_0xf257('0x35')](_0x3d6c20[_0xf257('0x30')],_0x3d6c20[_0xf257('0x32')]);_0x3c128d['attributes']=_[_0xf257('0x35')](_0x3d6c20['model'],qs[_0xf257('0x36')](_0x45a81a[_0xf257('0x32')][_0xf257('0x36')]));_0x3c128d[_0xf257('0x37')]=_0x3c128d['attributes'][_0xf257('0x38')]?_0x3c128d[_0xf257('0x37')]:_0x3d6c20[_0xf257('0x30')];if(!_0x45a81a[_0xf257('0x32')][_0xf257('0x39')]('nolimit')){_0x3c128d[_0xf257('0x1f')]=qs['limit'](_0x45a81a[_0xf257('0x32')][_0xf257('0x1f')]);_0x3c128d[_0xf257('0x1d')]=qs[_0xf257('0x1d')](_0x45a81a['query'][_0xf257('0x1d')]);}_0x3c128d[_0xf257('0x3a')]=qs[_0xf257('0x3b')](_0x45a81a[_0xf257('0x32')][_0xf257('0x3b')]);_0x3c128d[_0xf257('0x3c')]=qs[_0xf257('0x34')](_[_0xf257('0x3d')](_0x45a81a[_0xf257('0x32')],_0x3d6c20[_0xf257('0x34')]),_0x57e675);if(_0x45a81a[_0xf257('0x32')][_0xf257('0x3e')]){_0x3c128d[_0xf257('0x3c')]=_[_0xf257('0x3f')](_0x3c128d[_0xf257('0x3c')],{'$or':_[_0xf257('0x31')](_0x57e675,function(_0x394826){if(_0x394826[_0xf257('0x2f')]!==_0xf257('0x40')){var _0x43b17e={};_0x43b17e[_0x394826['name']]={'$like':'%'+_0x45a81a['query'][_0xf257('0x3e')]+'%'};return _0x43b17e;}})});}_0x3c128d=_[_0xf257('0x3f')]({},_0x3c128d,_0x45a81a[_0xf257('0x41')]);var _0x3714d7={'where':_0x3c128d['where']};return db[_0xf257('0x2c')][_0xf257('0x20')](_0x3714d7)['then'](function(_0xec0437){_0x86bd85['count']=_0xec0437;if(_0x45a81a[_0xf257('0x32')][_0xf257('0x42')]){_0x3c128d[_0xf257('0x43')]=[{'all':!![]}];}return db[_0xf257('0x2c')][_0xf257('0x44')](_0x3c128d);})[_0xf257('0x25')](function(_0x161d79){_0x86bd85[_0xf257('0x45')]=_0x161d79;return _0x86bd85;})['then'](respondWithFilteredResult(_0x29e345,_0x3c128d))[_0xf257('0x46')](handleError(_0x29e345,null));};exports[_0xf257('0x47')]=function(_0x408a73,_0x170b71){var _0x176357={'raw':!![],'where':{'id':_0x408a73[_0xf257('0x48')]['id']}},_0x2a9cc1={};_0x2a9cc1['model']=_[_0xf257('0x33')](db[_0xf257('0x2c')][_0xf257('0x2d')]);_0x2a9cc1[_0xf257('0x32')]=_[_0xf257('0x33')](_0x408a73['query']);_0x2a9cc1[_0xf257('0x34')]=_[_0xf257('0x35')](_0x2a9cc1[_0xf257('0x30')],_0x2a9cc1[_0xf257('0x32')]);_0x176357[_0xf257('0x37')]=_[_0xf257('0x35')](_0x2a9cc1[_0xf257('0x30')],qs[_0xf257('0x36')](_0x408a73[_0xf257('0x32')][_0xf257('0x36')]));_0x176357['attributes']=_0x176357[_0xf257('0x37')][_0xf257('0x38')]?_0x176357[_0xf257('0x37')]:_0x2a9cc1[_0xf257('0x30')];if(_0x408a73[_0xf257('0x32')][_0xf257('0x42')]){_0x176357['include']=[{'all':!![]}];}_0x176357=_[_0xf257('0x3f')]({},_0x176357,_0x408a73['options']);return db[_0xf257('0x2c')][_0xf257('0x49')](_0x176357)[_0xf257('0x25')](handleEntityNotFound(_0x170b71,null))[_0xf257('0x25')](respondWithResult(_0x170b71,null))[_0xf257('0x46')](handleError(_0x170b71,null));};exports[_0xf257('0x4a')]=function(_0x161d20,_0x384a1b){return db['AnalyticTreeReport'][_0xf257('0x4a')](_0x161d20[_0xf257('0x4b')],{})[_0xf257('0x25')](respondWithResult(_0x384a1b,0xc9))[_0xf257('0x46')](handleError(_0x384a1b,null));};exports[_0xf257('0x4c')]=function(_0x456ed0,_0x37b02b){if(_0x456ed0[_0xf257('0x4b')]['id']){delete _0x456ed0[_0xf257('0x4b')]['id'];}return db[_0xf257('0x2c')]['find']({'where':{'id':_0x456ed0[_0xf257('0x48')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x37b02b,null))['then'](saveUpdates(_0x456ed0[_0xf257('0x4b')],null))[_0xf257('0x25')](respondWithResult(_0x37b02b,null))[_0xf257('0x46')](handleError(_0x37b02b,null));};exports[_0xf257('0x26')]=function(_0x2ba585,_0x487de9){return db[_0xf257('0x2c')][_0xf257('0x49')]({'where':{'id':_0x2ba585[_0xf257('0x48')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x487de9,null))[_0xf257('0x25')](removeEntity(_0x487de9,null))[_0xf257('0x46')](handleError(_0x487de9,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fdb396a..814beac 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 _0x7fde=['api','moment','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0x7fde,0x1e9));var _0xe7fd=function(_0x5386a6,_0x373c00){_0x5386a6=_0x5386a6-0x0;var _0x105201=_0x7fde[_0x5386a6];return _0x105201;};'use strict';var _=require(_0xe7fd('0x0'));var util=require(_0xe7fd('0x1'));var logger=require(_0xe7fd('0x2'))(_0xe7fd('0x3'));var moment=require(_0xe7fd('0x4'));var BPromise=require('bluebird');var rp=require(_0xe7fd('0x5'));var fs=require('fs');var path=require(_0xe7fd('0x6'));var rimraf=require(_0xe7fd('0x7'));var config=require(_0xe7fd('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xe7fd('0x9')]=function(_0x3415c1,_0x3955dc){return _0x3415c1['define'](_0xe7fd('0xa'),attributes,{'tableName':_0xe7fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x505b=['../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x126eaf,_0x525848){var _0x58fc38=function(_0x247025){while(--_0x247025){_0x126eaf['push'](_0x126eaf['shift']());}};_0x58fc38(++_0x525848);}(_0x505b,0x139));var _0xb505=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x505b[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xb505('0x0'));var util=require('util');var logger=require(_0xb505('0x1'))(_0xb505('0x2'));var moment=require(_0xb505('0x3'));var BPromise=require(_0xb505('0x4'));var rp=require(_0xb505('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb505('0x6'));var attributes=require(_0xb505('0x7'));module[_0xb505('0x8')]=function(_0x55219b,_0x106a8a){return _0x55219b[_0xb505('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xb505('0xa'),'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 8d66223..c5c2fd2 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x365a13,_0x4c4410){var _0x56dc58=function(_0x49bc70){while(--_0x49bc70){_0x365a13['push'](_0x365a13['shift']());}};_0x56dc58(++_0x4c4410);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x483461,_0x3a7690){var _0x1c851f=function(_0x3683ca){while(--_0x3683ca){_0x483461['push'](_0x483461['shift']());}};_0x1c851f(++_0x3a7690);}(_0x2ef3,0xba));var _0x32ef=function(_0x27b22e,_0x2c7ba4){_0x27b22e=_0x27b22e-0x0;var _0x228375=_0x2ef3[_0x27b22e];return _0x228375;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4cda695..c18ed84 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 _0xf2dd=['show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated'];(function(_0x422994,_0x99047b){var _0x43ad8f=function(_0x5ae30d){while(--_0x5ae30d){_0x422994['push'](_0x422994['shift']());}};_0x43ad8f(++_0x99047b);}(_0xf2dd,0x1cf));var _0xdf2d=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0xf2dd[_0x24618a];return _0x2e3d64;};'use strict';var multer=require('multer');var util=require(_0xdf2d('0x0'));var path=require(_0xdf2d('0x1'));var timeout=require(_0xdf2d('0x2'));var express=require('express');var router=express[_0xdf2d('0x3')]();var fs_extra=require(_0xdf2d('0x4'));var auth=require(_0xdf2d('0x5'));var interaction=require(_0xdf2d('0x6'));var config=require('../../config/environment');var controller=require(_0xdf2d('0x7'));router[_0xdf2d('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf2d('0x9')]);router[_0xdf2d('0x8')](_0xdf2d('0xa'),auth[_0xdf2d('0xb')](),controller[_0xdf2d('0xc')]);router[_0xdf2d('0xd')]('/',auth['isAuthenticated'](),controller[_0xdf2d('0xe')]);router[_0xdf2d('0xf')](_0xdf2d('0xa'),auth[_0xdf2d('0xb')](),controller[_0xdf2d('0x10')]);router[_0xdf2d('0x11')]('/:id',auth[_0xdf2d('0xb')](),controller[_0xdf2d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4b79=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x188443,_0x2890df){var _0x44e29e=function(_0x3d3c85){while(--_0x3d3c85){_0x188443['push'](_0x188443['shift']());}};_0x44e29e(++_0x2890df);}(_0x4b79,0xa0));var _0x94b7=function(_0x20c82e,_0x4cdc3c){_0x20c82e=_0x20c82e-0x0;var _0x4fca3d=_0x4b79[_0x20c82e];return _0x4fca3d;};'use strict';var multer=require(_0x94b7('0x0'));var util=require(_0x94b7('0x1'));var path=require('path');var timeout=require(_0x94b7('0x2'));var express=require(_0x94b7('0x3'));var router=express[_0x94b7('0x4')]();var fs_extra=require(_0x94b7('0x5'));var auth=require(_0x94b7('0x6'));var interaction=require(_0x94b7('0x7'));var config=require(_0x94b7('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x94b7('0x9')]('/',auth[_0x94b7('0xa')](),controller[_0x94b7('0xb')]);router[_0x94b7('0x9')](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x94b7('0xe')]);router['put'](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0xf')]);router[_0x94b7('0x10')](_0x94b7('0xc'),auth[_0x94b7('0xa')](),controller[_0x94b7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index ac99c13..bf004fa 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 _0xce9b=['sequelize','exports','STRING'];(function(_0x42fd64,_0x2cd273){var _0x4365e5=function(_0x187657){while(--_0x187657){_0x42fd64['push'](_0x42fd64['shift']());}};_0x4365e5(++_0x2cd273);}(_0xce9b,0xc6));var _0xbce9=function(_0x49f71f,_0x2e05e5){_0x49f71f=_0x49f71f-0x0;var _0x44487f=_0xce9b[_0x49f71f];return _0x44487f;};'use strict';var Sequelize=require(_0xbce9('0x0'));module[_0xbce9('0x1')]={'name':{'type':Sequelize[_0xbce9('0x2')]},'basename':{'type':Sequelize[_0xbce9('0x2')]},'type':{'type':Sequelize[_0xbce9('0x2')]}}; \ No newline at end of file +var _0x4abf=['STRING','sequelize','exports'];(function(_0x46cb35,_0x2b92ab){var _0x847507=function(_0x29b091){while(--_0x29b091){_0x46cb35['push'](_0x46cb35['shift']());}};_0x847507(++_0x2b92ab);}(_0x4abf,0xac));var _0xf4ab=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x4abf[_0x2a8c21];return _0x5f3061;};'use strict';var Sequelize=require(_0xf4ab('0x0'));module[_0xf4ab('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xf4ab('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index a3143d9..b151314 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 _0xd441=['originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','error','name','send','index','map','Attachment','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','then','include','findAll','rows','catch','show','includeAll','clone','params','find','get','omit','createdAt','updatedAt','body','create','destroy','file'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xd441,0x6a));var _0x1d44=function(_0x21ff08,_0x238443){_0x21ff08=_0x21ff08-0x0;var _0x5450e9=_0xd441[_0x21ff08];return _0x5450e9;};'use strict';var emlformat=require(_0x1d44('0x0'));var rimraf=require(_0x1d44('0x1'));var zipdir=require(_0x1d44('0x2'));var jsonpatch=require(_0x1d44('0x3'));var rp=require(_0x1d44('0x4'));var moment=require(_0x1d44('0x5'));var BPromise=require(_0x1d44('0x6'));var Mustache=require(_0x1d44('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1d44('0x8'));var csv=require(_0x1d44('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d44('0xa'));var _=require(_0x1d44('0xb'));var squel=require('squel');var crypto=require(_0x1d44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d44('0xd'));var toCsv=require(_0x1d44('0x9'));var querystring=require(_0x1d44('0xe'));var Papa=require(_0x1d44('0xf'));var Redis=require(_0x1d44('0x10'));var authService=require(_0x1d44('0x11'));var qs=require(_0x1d44('0x12'));var as=require(_0x1d44('0x13'));var hardwareService=require(_0x1d44('0x14'));var logger=require(_0x1d44('0x15'))(_0x1d44('0x16'));var utils=require('../../config/utils');var config=require(_0x1d44('0x17'));var licenseUtil=require(_0x1d44('0x18'));var db=require(_0x1d44('0x19'))['db'];function respondWithStatusCode(_0x1c3f51,_0x4e8c1e){_0x4e8c1e=_0x4e8c1e||0xcc;return function(_0x87a294){if(_0x87a294){return _0x1c3f51[_0x1d44('0x1a')](_0x4e8c1e);}return _0x1c3f51[_0x1d44('0x1b')](_0x4e8c1e)[_0x1d44('0x1c')]();};}function respondWithResult(_0x3fcca2,_0x46029a){_0x46029a=_0x46029a||0xc8;return function(_0x683bbd){if(_0x683bbd){return _0x3fcca2[_0x1d44('0x1b')](_0x46029a)[_0x1d44('0x1d')](_0x683bbd);}};}function respondWithFilteredResult(_0x20dffb,_0xa3c2a0){return function(_0x8f6138){if(_0x8f6138){var _0x286dcc=typeof _0xa3c2a0[_0x1d44('0x1e')]===_0x1d44('0x1f')&&typeof _0xa3c2a0[_0x1d44('0x20')]==='undefined';var _0x7f804a=_0x8f6138[_0x1d44('0x21')];var _0x34ed33=_0x286dcc?0x0:_0xa3c2a0[_0x1d44('0x1e')];var _0x1b300a=_0x286dcc?_0x8f6138[_0x1d44('0x21')]:_0xa3c2a0[_0x1d44('0x1e')]+_0xa3c2a0[_0x1d44('0x20')];var _0x41fd60;if(_0x1b300a>=_0x7f804a){_0x1b300a=_0x7f804a;_0x41fd60=0xc8;}else{_0x41fd60=0xce;}_0x20dffb[_0x1d44('0x1b')](_0x41fd60);return _0x20dffb[_0x1d44('0x22')](_0x1d44('0x23'),_0x34ed33+'-'+_0x1b300a+'/'+_0x7f804a)[_0x1d44('0x1d')](_0x8f6138);}return null;};}function patchUpdates(_0x105be8){return function(_0x18b939){try{jsonpatch['apply'](_0x18b939,_0x105be8,!![]);}catch(_0x115c5c){return BPromise[_0x1d44('0x24')](_0x115c5c);}return _0x18b939[_0x1d44('0x25')]();};}function saveUpdates(_0x13c175,_0x318990){return function(_0x548088){if(_0x548088){return _0x548088[_0x1d44('0x26')](_0x13c175)['then'](function(_0x25dbd7){return _0x25dbd7;});}return null;};}function removeEntity(_0x124c6d,_0xff56eb){return function(_0x49b677){if(_0x49b677){return _0x49b677['destroy']()['then'](function(){_0x124c6d[_0x1d44('0x1b')](0xcc)[_0x1d44('0x1c')]();});}};}function handleEntityNotFound(_0x53dc43,_0x21d46a){return function(_0x26d1c5){if(!_0x26d1c5){_0x53dc43[_0x1d44('0x1a')](0x194);}return _0x26d1c5;};}function handleError(_0x24da95,_0x59ec7a){_0x59ec7a=_0x59ec7a||0x1f4;return function(_0x365678){logger[_0x1d44('0x27')](_0x365678['stack']);if(_0x365678['name']){delete _0x365678[_0x1d44('0x28')];}_0x24da95[_0x1d44('0x1b')](_0x59ec7a)[_0x1d44('0x29')](_0x365678);};}exports[_0x1d44('0x2a')]=function(_0x39502a,_0x454a2e){var _0x2fe0f6={},_0x5238a1={},_0x323c67={'count':0x0,'rows':[]};var _0x21d3f9=_[_0x1d44('0x2b')](db[_0x1d44('0x2c')][_0x1d44('0x2d')],function(_0x5edf2d){return{'name':_0x5edf2d[_0x1d44('0x2e')],'type':_0x5edf2d['type'][_0x1d44('0x2f')]};});_0x5238a1['model']=_[_0x1d44('0x2b')](_0x21d3f9,_0x1d44('0x28'));_0x5238a1[_0x1d44('0x30')]=_[_0x1d44('0x31')](_0x39502a[_0x1d44('0x30')]);_0x5238a1[_0x1d44('0x32')]=_[_0x1d44('0x33')](_0x5238a1[_0x1d44('0x34')],_0x5238a1['query']);_0x2fe0f6[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x5238a1[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x39502a['query']['fields']));_0x2fe0f6[_0x1d44('0x35')]=_0x2fe0f6['attributes'][_0x1d44('0x37')]?_0x2fe0f6[_0x1d44('0x35')]:_0x5238a1[_0x1d44('0x34')];if(!_0x39502a[_0x1d44('0x30')][_0x1d44('0x38')](_0x1d44('0x39'))){_0x2fe0f6['limit']=qs[_0x1d44('0x20')](_0x39502a[_0x1d44('0x30')]['limit']);_0x2fe0f6[_0x1d44('0x1e')]=qs[_0x1d44('0x1e')](_0x39502a[_0x1d44('0x30')][_0x1d44('0x1e')]);}_0x2fe0f6[_0x1d44('0x3a')]=qs[_0x1d44('0x3b')](_0x39502a[_0x1d44('0x30')][_0x1d44('0x3b')]);_0x2fe0f6[_0x1d44('0x3c')]=qs['filters'](_['pick'](_0x39502a['query'],_0x5238a1[_0x1d44('0x32')]),_0x21d3f9);if(_0x39502a['query']['filter']){_0x2fe0f6[_0x1d44('0x3c')]=_[_0x1d44('0x3d')](_0x2fe0f6['where'],{'$or':_[_0x1d44('0x2b')](_0x21d3f9,function(_0x2f56e5){if(_0x2f56e5[_0x1d44('0x3e')]!==_0x1d44('0x3f')){var _0x12439d={};_0x12439d[_0x2f56e5[_0x1d44('0x28')]]={'$like':'%'+_0x39502a[_0x1d44('0x30')][_0x1d44('0x40')]+'%'};return _0x12439d;}})});}_0x2fe0f6=_['merge']({},_0x2fe0f6,_0x39502a[_0x1d44('0x41')]);var _0x1d7683={'where':_0x2fe0f6['where']};return db[_0x1d44('0x2c')][_0x1d44('0x21')](_0x1d7683)[_0x1d44('0x42')](function(_0x5d31b9){_0x323c67[_0x1d44('0x21')]=_0x5d31b9;if(_0x39502a['query']['includeAll']){_0x2fe0f6[_0x1d44('0x43')]=[{'all':!![]}];}return db['Attachment'][_0x1d44('0x44')](_0x2fe0f6);})['then'](function(_0xaa1b39){_0x323c67[_0x1d44('0x45')]=_0xaa1b39;return _0x323c67;})[_0x1d44('0x42')](respondWithFilteredResult(_0x454a2e,_0x2fe0f6))[_0x1d44('0x46')](handleError(_0x454a2e,null));};exports[_0x1d44('0x47')]=function(_0x9cfc32,_0x4450bd){var _0x3a1303={'raw':!![],'where':{'id':_0x9cfc32['params']['id']}},_0x205cf9={};_0x205cf9['model']=_[_0x1d44('0x31')](db[_0x1d44('0x2c')][_0x1d44('0x2d')]);_0x205cf9[_0x1d44('0x30')]=_[_0x1d44('0x31')](_0x9cfc32[_0x1d44('0x30')]);_0x205cf9[_0x1d44('0x32')]=_[_0x1d44('0x33')](_0x205cf9[_0x1d44('0x34')],_0x205cf9['query']);_0x3a1303[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x205cf9[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x9cfc32[_0x1d44('0x30')]['fields']));_0x3a1303[_0x1d44('0x35')]=_0x3a1303[_0x1d44('0x35')][_0x1d44('0x37')]?_0x3a1303['attributes']:_0x205cf9[_0x1d44('0x34')];if(_0x9cfc32[_0x1d44('0x30')][_0x1d44('0x48')]){_0x3a1303[_0x1d44('0x43')]=[{'all':!![]}];}_0x3a1303=_[_0x1d44('0x3d')]({},_0x3a1303,_0x9cfc32[_0x1d44('0x41')]);return db[_0x1d44('0x2c')]['find'](_0x3a1303)['then'](handleEntityNotFound(_0x4450bd,null))[_0x1d44('0x42')](respondWithResult(_0x4450bd,null))[_0x1d44('0x46')](handleError(_0x4450bd,null));};exports[_0x1d44('0x49')]=function(_0x568f1f,_0x2c2972){var _0x185bd0={'where':{'id':_0x568f1f[_0x1d44('0x4a')]['id']}},_0x11ad6b={};_0x11ad6b['model']=_['keys'](db['Attachment'][_0x1d44('0x2d')]);_0x185bd0[_0x1d44('0x35')]=_[_0x1d44('0x33')](_0x11ad6b[_0x1d44('0x34')],qs[_0x1d44('0x36')](_0x568f1f[_0x1d44('0x30')][_0x1d44('0x36')]));_0x185bd0[_0x1d44('0x35')]=_0x185bd0[_0x1d44('0x35')][_0x1d44('0x37')]?_0x185bd0[_0x1d44('0x35')]:_0x11ad6b[_0x1d44('0x34')];if(_0x568f1f['query'][_0x1d44('0x48')]){_0x185bd0[_0x1d44('0x43')]=[{'all':!![]}];}_0x185bd0=_['merge']({},_0x185bd0,_0x568f1f[_0x1d44('0x41')]);return db[_0x1d44('0x2c')][_0x1d44('0x4b')](_0x185bd0)[_0x1d44('0x42')](handleEntityNotFound(_0x2c2972,null))['then'](function(_0x8b03a7){if(_0x8b03a7){var _0x2578b3=_0x8b03a7[_0x1d44('0x4c')]({'plain':!![]});_0x2578b3=qs[_0x1d44('0x4d')](_0x2578b3,['id',_0x1d44('0x4e'),_0x1d44('0x4f')]);_0x568f1f[_0x1d44('0x50')]=_[_0x1d44('0x4d')](_0x568f1f[_0x1d44('0x50')],['id',_0x1d44('0x4e'),_0x1d44('0x4f')]);return db[_0x1d44('0x2c')][_0x1d44('0x51')](_['merge'](_0x2578b3,_0x568f1f[_0x1d44('0x50')]),{'include':_0x568f1f['query'][_0x1d44('0x48')]?[{'all':!![]}]:undefined});}})[_0x1d44('0x42')](respondWithResult(_0x2c2972,0xc9))[_0x1d44('0x46')](handleError(_0x2c2972,null));};exports[_0x1d44('0x26')]=function(_0x437b8f,_0x3a6491){if(_0x437b8f[_0x1d44('0x50')]['id']){delete _0x437b8f['body']['id'];}return db[_0x1d44('0x2c')][_0x1d44('0x4b')]({'where':{'id':_0x437b8f['params']['id']}})['then'](handleEntityNotFound(_0x3a6491,null))['then'](saveUpdates(_0x437b8f[_0x1d44('0x50')],null))[_0x1d44('0x42')](respondWithResult(_0x3a6491,null))[_0x1d44('0x46')](handleError(_0x3a6491,null));};exports[_0x1d44('0x52')]=function(_0x46bb26,_0x205650){return db[_0x1d44('0x2c')][_0x1d44('0x4b')]({'where':{'id':_0x46bb26[_0x1d44('0x4a')]['id']}})[_0x1d44('0x42')](handleEntityNotFound(_0x205650,null))[_0x1d44('0x42')](removeEntity(_0x205650,null))[_0x1d44('0x46')](handleError(_0x205650,null));};exports[_0x1d44('0x51')]=function(_0x2c26d5,_0x3f2966,_0x4e893d){_0x2c26d5[_0x1d44('0x50')][_0x1d44('0x28')]=_0x2c26d5[_0x1d44('0x53')][_0x1d44('0x54')];_0x2c26d5['body'][_0x1d44('0x55')]=_0x2c26d5[_0x1d44('0x53')][_0x1d44('0x56')];_0x2c26d5[_0x1d44('0x50')][_0x1d44('0x3e')]=_0x2c26d5['file'][_0x1d44('0x57')];return db[_0x1d44('0x2c')][_0x1d44('0x51')](_0x2c26d5['body'])['then'](respondWithResult(_0x3f2966,0xc9))[_0x1d44('0x46')](handleError(_0x3f2966,null));};exports[_0x1d44('0x58')]=function(_0x2296aa,_0x4e0d1b,_0x303001){return db[_0x1d44('0x2c')][_0x1d44('0x59')]({'where':{'id':_0x2296aa['params']['id']},'raw':!![]})[_0x1d44('0x42')](handleEntityNotFound(_0x4e0d1b,null))['then'](function(_0x32bcaa){if(_0x32bcaa){var _0x304b0e=_0x32bcaa[_0x1d44('0x5a')]!==null;var _0x353aca=path[_0x1d44('0x5b')](config[_0x1d44('0x5c')],_0x1d44('0x5d'));if(_0x304b0e){_0x353aca=path['join'](_0x353aca,_0x1d44('0x5e'));}var _0x579b26=path[_0x1d44('0x5b')](_0x353aca,_0x32bcaa[_0x1d44('0x55')]);return _0x4e0d1b[_0x1d44('0x58')](_0x579b26);}})[_0x1d44('0x46')](handleError(_0x4e0d1b,null));}; \ No newline at end of file +var _0xd638=['model','attributes','fields','length','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','rows','catch','show','params','keys','intersection','find','get','updatedAt','omit','body','createdAt','create','update','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','filters'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0xd638,0x16d));var _0x8d63=function(_0x40e3e6,_0x141bc1){_0x40e3e6=_0x40e3e6-0x0;var _0x601283=_0xd638[_0x40e3e6];return _0x601283;};'use strict';var emlformat=require(_0x8d63('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8d63('0x1'));var rp=require(_0x8d63('0x2'));var moment=require(_0x8d63('0x3'));var BPromise=require(_0x8d63('0x4'));var Mustache=require(_0x8d63('0x5'));var util=require(_0x8d63('0x6'));var path=require('path');var sox=require(_0x8d63('0x7'));var csv=require(_0x8d63('0x8'));var ejs=require(_0x8d63('0x9'));var fs=require('fs');var fs_extra=require(_0x8d63('0xa'));var _=require(_0x8d63('0xb'));var squel=require(_0x8d63('0xc'));var crypto=require(_0x8d63('0xd'));var jsforce=require(_0x8d63('0xe'));var deskjs=require(_0x8d63('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8d63('0x10'));var Papa=require('papaparse');var Redis=require(_0x8d63('0x11'));var authService=require(_0x8d63('0x12'));var qs=require(_0x8d63('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d63('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d63('0x15'));var db=require(_0x8d63('0x16'))['db'];function respondWithStatusCode(_0x1cb026,_0x3c284f){_0x3c284f=_0x3c284f||0xcc;return function(_0x1e7a4c){if(_0x1e7a4c){return _0x1cb026[_0x8d63('0x17')](_0x3c284f);}return _0x1cb026[_0x8d63('0x18')](_0x3c284f)[_0x8d63('0x19')]();};}function respondWithResult(_0x4d50cc,_0xcd86dd){_0xcd86dd=_0xcd86dd||0xc8;return function(_0x5c75f9){if(_0x5c75f9){return _0x4d50cc[_0x8d63('0x18')](_0xcd86dd)[_0x8d63('0x1a')](_0x5c75f9);}};}function respondWithFilteredResult(_0x4e83ed,_0x5b5e8e){return function(_0x4d9eac){if(_0x4d9eac){var _0x47ccac=typeof _0x5b5e8e[_0x8d63('0x1b')]===_0x8d63('0x1c')&&typeof _0x5b5e8e[_0x8d63('0x1d')]===_0x8d63('0x1c');var _0x33687a=_0x4d9eac['count'];var _0x46fa15=_0x47ccac?0x0:_0x5b5e8e[_0x8d63('0x1b')];var _0x30957b=_0x47ccac?_0x4d9eac[_0x8d63('0x1e')]:_0x5b5e8e['offset']+_0x5b5e8e[_0x8d63('0x1d')];var _0x57ffab;if(_0x30957b>=_0x33687a){_0x30957b=_0x33687a;_0x57ffab=0xc8;}else{_0x57ffab=0xce;}_0x4e83ed[_0x8d63('0x18')](_0x57ffab);return _0x4e83ed[_0x8d63('0x1f')]('Content-Range',_0x46fa15+'-'+_0x30957b+'/'+_0x33687a)[_0x8d63('0x1a')](_0x4d9eac);}return null;};}function patchUpdates(_0x4edb5e){return function(_0x584577){try{jsonpatch[_0x8d63('0x20')](_0x584577,_0x4edb5e,!![]);}catch(_0xcb56d7){return BPromise['reject'](_0xcb56d7);}return _0x584577['save']();};}function saveUpdates(_0x22bf85,_0x1642d2){return function(_0x40a77a){if(_0x40a77a){return _0x40a77a['update'](_0x22bf85)[_0x8d63('0x21')](function(_0x26c76b){return _0x26c76b;});}return null;};}function removeEntity(_0x21b633,_0x50d7e1){return function(_0x5bede5){if(_0x5bede5){return _0x5bede5[_0x8d63('0x22')]()[_0x8d63('0x21')](function(){_0x21b633[_0x8d63('0x18')](0xcc)[_0x8d63('0x19')]();});}};}function handleEntityNotFound(_0x153f58,_0x53201f){return function(_0x413cf6){if(!_0x413cf6){_0x153f58[_0x8d63('0x17')](0x194);}return _0x413cf6;};}function handleError(_0x2239d9,_0x49643c){_0x49643c=_0x49643c||0x1f4;return function(_0x52b581){logger[_0x8d63('0x23')](_0x52b581['stack']);if(_0x52b581[_0x8d63('0x24')]){delete _0x52b581['name'];}_0x2239d9[_0x8d63('0x18')](_0x49643c)[_0x8d63('0x25')](_0x52b581);};}exports[_0x8d63('0x26')]=function(_0x2f7797,_0x259f69){var _0x3eeb96={},_0x339f3c={},_0x295a7a={'count':0x0,'rows':[]};var _0x4f82f0=_[_0x8d63('0x27')](db['Attachment'][_0x8d63('0x28')],function(_0x14644b){return{'name':_0x14644b[_0x8d63('0x29')],'type':_0x14644b[_0x8d63('0x2a')]['key']};});_0x339f3c['model']=_[_0x8d63('0x27')](_0x4f82f0,_0x8d63('0x24'));_0x339f3c['query']=_['keys'](_0x2f7797[_0x8d63('0x2b')]);_0x339f3c[_0x8d63('0x2c')]=_['intersection'](_0x339f3c[_0x8d63('0x2d')],_0x339f3c[_0x8d63('0x2b')]);_0x3eeb96[_0x8d63('0x2e')]=_['intersection'](_0x339f3c[_0x8d63('0x2d')],qs[_0x8d63('0x2f')](_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x2f')]));_0x3eeb96[_0x8d63('0x2e')]=_0x3eeb96[_0x8d63('0x2e')][_0x8d63('0x30')]?_0x3eeb96[_0x8d63('0x2e')]:_0x339f3c['model'];if(!_0x2f7797['query']['hasOwnProperty']('nolimit')){_0x3eeb96[_0x8d63('0x1d')]=qs[_0x8d63('0x1d')](_0x2f7797[_0x8d63('0x2b')]['limit']);_0x3eeb96['offset']=qs['offset'](_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x1b')]);}_0x3eeb96['order']=qs['sort'](_0x2f7797[_0x8d63('0x2b')]['sort']);_0x3eeb96[_0x8d63('0x31')]=qs[_0x8d63('0x2c')](_[_0x8d63('0x32')](_0x2f7797[_0x8d63('0x2b')],_0x339f3c['filters']),_0x4f82f0);if(_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x33')]){_0x3eeb96['where']=_[_0x8d63('0x34')](_0x3eeb96['where'],{'$or':_[_0x8d63('0x27')](_0x4f82f0,function(_0x2f6f5d){if(_0x2f6f5d[_0x8d63('0x2a')]!==_0x8d63('0x35')){var _0x3b4fb6={};_0x3b4fb6[_0x2f6f5d[_0x8d63('0x24')]]={'$like':'%'+_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x33')]+'%'};return _0x3b4fb6;}})});}_0x3eeb96=_[_0x8d63('0x34')]({},_0x3eeb96,_0x2f7797[_0x8d63('0x36')]);var _0x50aeba={'where':_0x3eeb96[_0x8d63('0x31')]};return db[_0x8d63('0x37')][_0x8d63('0x1e')](_0x50aeba)[_0x8d63('0x21')](function(_0x331695){_0x295a7a[_0x8d63('0x1e')]=_0x331695;if(_0x2f7797[_0x8d63('0x2b')][_0x8d63('0x38')]){_0x3eeb96[_0x8d63('0x39')]=[{'all':!![]}];}return db[_0x8d63('0x37')]['findAll'](_0x3eeb96);})['then'](function(_0x304f0a){_0x295a7a[_0x8d63('0x3a')]=_0x304f0a;return _0x295a7a;})['then'](respondWithFilteredResult(_0x259f69,_0x3eeb96))[_0x8d63('0x3b')](handleError(_0x259f69,null));};exports[_0x8d63('0x3c')]=function(_0x56e713,_0x4b7dc6){var _0xeff46d={'raw':!![],'where':{'id':_0x56e713[_0x8d63('0x3d')]['id']}},_0x3ee488={};_0x3ee488[_0x8d63('0x2d')]=_[_0x8d63('0x3e')](db[_0x8d63('0x37')][_0x8d63('0x28')]);_0x3ee488[_0x8d63('0x2b')]=_[_0x8d63('0x3e')](_0x56e713[_0x8d63('0x2b')]);_0x3ee488[_0x8d63('0x2c')]=_[_0x8d63('0x3f')](_0x3ee488['model'],_0x3ee488[_0x8d63('0x2b')]);_0xeff46d['attributes']=_[_0x8d63('0x3f')](_0x3ee488['model'],qs['fields'](_0x56e713['query']['fields']));_0xeff46d[_0x8d63('0x2e')]=_0xeff46d[_0x8d63('0x2e')]['length']?_0xeff46d['attributes']:_0x3ee488[_0x8d63('0x2d')];if(_0x56e713[_0x8d63('0x2b')][_0x8d63('0x38')]){_0xeff46d[_0x8d63('0x39')]=[{'all':!![]}];}_0xeff46d=_[_0x8d63('0x34')]({},_0xeff46d,_0x56e713[_0x8d63('0x36')]);return db[_0x8d63('0x37')][_0x8d63('0x40')](_0xeff46d)[_0x8d63('0x21')](handleEntityNotFound(_0x4b7dc6,null))[_0x8d63('0x21')](respondWithResult(_0x4b7dc6,null))[_0x8d63('0x3b')](handleError(_0x4b7dc6,null));};exports['clone']=function(_0x210d53,_0x382cfc){var _0x17ef29={'where':{'id':_0x210d53[_0x8d63('0x3d')]['id']}},_0x1f9c07={};_0x1f9c07[_0x8d63('0x2d')]=_['keys'](db[_0x8d63('0x37')][_0x8d63('0x28')]);_0x17ef29['attributes']=_[_0x8d63('0x3f')](_0x1f9c07[_0x8d63('0x2d')],qs[_0x8d63('0x2f')](_0x210d53[_0x8d63('0x2b')][_0x8d63('0x2f')]));_0x17ef29[_0x8d63('0x2e')]=_0x17ef29[_0x8d63('0x2e')][_0x8d63('0x30')]?_0x17ef29[_0x8d63('0x2e')]:_0x1f9c07[_0x8d63('0x2d')];if(_0x210d53[_0x8d63('0x2b')][_0x8d63('0x38')]){_0x17ef29[_0x8d63('0x39')]=[{'all':!![]}];}_0x17ef29=_[_0x8d63('0x34')]({},_0x17ef29,_0x210d53[_0x8d63('0x36')]);return db['Attachment']['find'](_0x17ef29)[_0x8d63('0x21')](handleEntityNotFound(_0x382cfc,null))[_0x8d63('0x21')](function(_0x5421b0){if(_0x5421b0){var _0x17711a=_0x5421b0[_0x8d63('0x41')]({'plain':!![]});_0x17711a=qs['omit'](_0x17711a,['id','createdAt',_0x8d63('0x42')]);_0x210d53['body']=_[_0x8d63('0x43')](_0x210d53[_0x8d63('0x44')],['id',_0x8d63('0x45'),_0x8d63('0x42')]);return db['Attachment'][_0x8d63('0x46')](_[_0x8d63('0x34')](_0x17711a,_0x210d53['body']),{'include':_0x210d53[_0x8d63('0x2b')][_0x8d63('0x38')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x382cfc,0xc9))[_0x8d63('0x3b')](handleError(_0x382cfc,null));};exports[_0x8d63('0x47')]=function(_0x12ef60,_0x4cce52){if(_0x12ef60['body']['id']){delete _0x12ef60[_0x8d63('0x44')]['id'];}return db['Attachment'][_0x8d63('0x40')]({'where':{'id':_0x12ef60[_0x8d63('0x3d')]['id']}})[_0x8d63('0x21')](handleEntityNotFound(_0x4cce52,null))[_0x8d63('0x21')](saveUpdates(_0x12ef60[_0x8d63('0x44')],null))[_0x8d63('0x21')](respondWithResult(_0x4cce52,null))[_0x8d63('0x3b')](handleError(_0x4cce52,null));};exports[_0x8d63('0x22')]=function(_0x260422,_0x149f80){return db[_0x8d63('0x37')][_0x8d63('0x40')]({'where':{'id':_0x260422[_0x8d63('0x3d')]['id']}})[_0x8d63('0x21')](handleEntityNotFound(_0x149f80,null))[_0x8d63('0x21')](removeEntity(_0x149f80,null))[_0x8d63('0x3b')](handleError(_0x149f80,null));};exports[_0x8d63('0x46')]=function(_0x38e4b1,_0x1792ea,_0x5bd4b1){_0x38e4b1[_0x8d63('0x44')]['name']=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x49')];_0x38e4b1[_0x8d63('0x44')][_0x8d63('0x4a')]=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x4b')];_0x38e4b1[_0x8d63('0x44')][_0x8d63('0x2a')]=_0x38e4b1[_0x8d63('0x48')][_0x8d63('0x4c')];return db['Attachment'][_0x8d63('0x46')](_0x38e4b1[_0x8d63('0x44')])['then'](respondWithResult(_0x1792ea,0xc9))[_0x8d63('0x3b')](handleError(_0x1792ea,null));};exports[_0x8d63('0x4d')]=function(_0x2e9101,_0xc4be29,_0x15afaf){return db[_0x8d63('0x37')]['findOne']({'where':{'id':_0x2e9101[_0x8d63('0x3d')]['id']},'raw':!![]})[_0x8d63('0x21')](handleEntityNotFound(_0xc4be29,null))[_0x8d63('0x21')](function(_0xe518b6){if(_0xe518b6){var _0x47dfcb=_0xe518b6[_0x8d63('0x4e')]!==null;var _0x325ea3=path[_0x8d63('0x4f')](config['root'],_0x8d63('0x50'));if(_0x47dfcb){_0x325ea3=path[_0x8d63('0x4f')](_0x325ea3,_0x8d63('0x51'));}var _0x28dc4a=path[_0x8d63('0x4f')](_0x325ea3,_0xe518b6[_0x8d63('0x4a')]);return _0xc4be29[_0x8d63('0x4d')](_0x28dc4a);}})[_0x8d63('0x3b')](handleError(_0xc4be29,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index e11d1d4..67edb7f 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 _0x876d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Attachment','attachments','util'];(function(_0x549d71,_0x3c9e68){var _0x2b2251=function(_0x302bf4){while(--_0x302bf4){_0x549d71['push'](_0x549d71['shift']());}};_0x2b2251(++_0x3c9e68);}(_0x876d,0x11d));var _0xd876=function(_0xac7a3f,_0x42f746){_0xac7a3f=_0xac7a3f-0x0;var _0x2d62a1=_0x876d[_0xac7a3f];return _0x2d62a1;};'use strict';var _=require('lodash');var util=require(_0xd876('0x0'));var logger=require('../../config/logger')(_0xd876('0x1'));var moment=require(_0xd876('0x2'));var BPromise=require(_0xd876('0x3'));var rp=require(_0xd876('0x4'));var fs=require('fs');var path=require(_0xd876('0x5'));var rimraf=require(_0xd876('0x6'));var config=require(_0xd876('0x7'));var attributes=require('./attachment.attributes');module[_0xd876('0x8')]=function(_0x1255c9,_0x3dc247){return _0x1255c9['define'](_0xd876('0x9'),attributes,{'tableName':_0xd876('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf48a=['./attachment.attributes','define','Attachment','attachments','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);}(_0xf48a,0x1d2));var _0xaf48=function(_0x5b1f65,_0x1b5cb4){_0x5b1f65=_0x5b1f65-0x0;var _0x290cc6=_0xf48a[_0x5b1f65];return _0x290cc6;};'use strict';var _=require(_0xaf48('0x0'));var util=require('util');var logger=require(_0xaf48('0x1'))('api');var moment=require(_0xaf48('0x2'));var BPromise=require(_0xaf48('0x3'));var rp=require(_0xaf48('0x4'));var fs=require('fs');var path=require(_0xaf48('0x5'));var rimraf=require('rimraf');var config=require(_0xaf48('0x6'));var attributes=require(_0xaf48('0x7'));module['exports']=function(_0x4b41df,_0x5c4139){return _0x4b41df[_0xaf48('0x8')](_0xaf48('0x9'),attributes,{'tableName':_0xaf48('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 ee49075..2e7e465 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 _0x34b2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x5b3ed2,_0x26a389){var _0x2601cb=function(_0xd26ef3){while(--_0xd26ef3){_0x5b3ed2['push'](_0x5b3ed2['shift']());}};_0x2601cb(++_0x26a389);}(_0x34b2,0x11c));var _0x234b=function(_0x1057cb,_0x7b8162){_0x1057cb=_0x1057cb-0x0;var _0x7fbf7e=_0x34b2[_0x1057cb];return _0x7fbf7e;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var moment=require(_0x234b('0x2'));var BPromise=require(_0x234b('0x3'));var rs=require(_0x234b('0x4'));var fs=require('fs');var Redis=require(_0x234b('0x5'));var db=require(_0x234b('0x6'))['db'];var utils=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var config=require(_0x234b('0xa'));var jayson=require(_0x234b('0xb'));var client=jayson[_0x234b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fac7,_0x5e71ac,_0x2eb07e){return new BPromise(function(_0x84f1f0,_0x153974){return client[_0x234b('0xd')](_0x52fac7,_0x2eb07e)['then'](function(_0x4f4899){logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));logger[_0x234b('0x11')](_0x234b('0x12'),_0x5e71ac,_0x234b('0x10'),JSON[_0x234b('0x13')](_0x4f4899));if(_0x4f4899[_0x234b('0x14')]){if(_0x4f4899[_0x234b('0x14')][_0x234b('0x15')]===0x1f4){logger[_0x234b('0x14')](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x153974(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}logger['error'](_0x234b('0xf'),_0x5e71ac,_0x4f4899[_0x234b('0x14')]['message']);return _0x84f1f0(_0x4f4899[_0x234b('0x14')][_0x234b('0x16')]);}else{logger[_0x234b('0xe')](_0x234b('0xf'),_0x5e71ac,_0x234b('0x10'));_0x84f1f0(_0x4f4899[_0x234b('0x17')][_0x234b('0x16')]);}})[_0x234b('0x18')](function(_0x1fb3d8){logger['error'](_0x234b('0xf'),_0x5e71ac,_0x1fb3d8);_0x153974(_0x1fb3d8);});});}exports[_0x234b('0x19')]=function(_0x18153a){var _0x22696d=this;return new Promise(function(_0x4424a1,_0x530e4a){return db[_0x234b('0x1a')][_0x234b('0x1b')](_0x18153a[_0x234b('0x1c')],{'raw':_0x18153a[_0x234b('0x1d')]?_0x18153a['options'][_0x234b('0x1e')]===undefined?!![]:![]:!![]})[_0x234b('0x1f')](function(_0x2a47e1){logger[_0x234b('0xe')](_0x234b('0x19'),_0x18153a);logger['debug'](_0x234b('0x19'),_0x18153a,JSON[_0x234b('0x13')](_0x2a47e1));_0x4424a1(_0x2a47e1);})['catch'](function(_0x184e98){logger[_0x234b('0x14')](_0x234b('0x19'),_0x184e98[_0x234b('0x16')],_0x18153a);_0x530e4a(_0x22696d[_0x234b('0x14')](0x1f4,_0x184e98[_0x234b('0x16')]));});});}; \ No newline at end of file +var _0x3eec=['../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x976c8a,_0x4a871d){_0x976c8a=_0x976c8a-0x0;var _0x31245f=_0x3eec[_0x976c8a];return _0x31245f;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('Attachment,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('Attachment,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}exports[_0xc3ee('0x18')]=function(_0x219db0){var _0x304889=this;return new Promise(function(_0x3acb0c,_0xd4b414){return db[_0xc3ee('0x19')][_0xc3ee('0x1a')](_0x219db0[_0xc3ee('0x1b')],{'raw':_0x219db0[_0xc3ee('0x1c')]?_0x219db0[_0xc3ee('0x1c')][_0xc3ee('0x1d')]===undefined?!![]:![]:!![]})[_0xc3ee('0xd')](function(_0x3e7224){logger[_0xc3ee('0x15')](_0xc3ee('0x18'),_0x219db0);logger[_0xc3ee('0xf')](_0xc3ee('0x18'),_0x219db0,JSON[_0xc3ee('0x1e')](_0x3e7224));_0x3acb0c(_0x3e7224);})[_0xc3ee('0x17')](function(_0x493fea){logger['error'](_0xc3ee('0x18'),_0x493fea[_0xc3ee('0x13')],_0x219db0);_0xd4b414(_0x304889[_0xc3ee('0x11')](0x1f4,_0x493fea[_0xc3ee('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index c112044..02ff724 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4d8d99,_0x19221a){var _0x4fef99=function(_0x3edef3){while(--_0x3edef3){_0x4d8d99['push'](_0x4d8d99['shift']());}};_0x4fef99(++_0x19221a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x24dbff,_0x2e1b9a){_0x24dbff=_0x24dbff-0x0;var _0x1ba25c=_0x5f2f[_0x24dbff];return _0x1ba25c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0xfd7c42,_0x185abf){var _0x3e8dc9=function(_0x11112a){while(--_0x11112a){_0xfd7c42['push'](_0xfd7c42['shift']());}};_0x3e8dc9(++_0x185abf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x898a1,_0x3b50f2){_0x898a1=_0x898a1-0x0;var _0x3564d2=_0x5f2f[_0x898a1];return _0x3564d2;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 6074bea..e07222d 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 _0x0460=['agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','profile','email','use','clientSecret','secret','findOne','then','find','map','emails','value','admin','user'];(function(_0x297569,_0x22e70c){var _0x2fd1ee=function(_0x5ec20d){while(--_0x5ec20d){_0x297569['push'](_0x297569['shift']());}};_0x2fd1ee(++_0x22e70c);}(_0x0460,0xd0));var _0x0046=function(_0x5b4e1b,_0x4fcde1){_0x5b4e1b=_0x5b4e1b-0x0;var _0x119e2=_0x0460[_0x5b4e1b];return _0x119e2;};'use strict';var _=require(_0x0046('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0x0046('0x1')];var moment=require(_0x0046('0x2'));var db=require(_0x0046('0x3'))['db'];var config=require(_0x0046('0x4'));var signToken=require('../../components/auth/service')[_0x0046('0x5')];var utils=require(_0x0046('0x6'));exports['login']=passport[_0x0046('0x7')](_0x0046('0x8'),{'failureRedirect':_0x0046('0x9'),'scope':[_0x0046('0xa'),_0x0046('0xb')],'session':![]});exports['callback']=passport['authenticate'](_0x0046('0x8'),{'failureRedirect':_0x0046('0x9'),'session':![]});passport[_0x0046('0xc')](new GoogleStrategy({'clientID':config[_0x0046('0x8')]?config['google']['clientID']:'id','clientSecret':config['google']?config[_0x0046('0x8')][_0x0046('0xd')]:_0x0046('0xe'),'callbackURL':config[_0x0046('0x8')]?config['google']['callbackURL']:''},function(_0x3ab42b,_0xa07686,_0x153d3e,_0x11b766){var _0x1e67f2,_0x45e97e;return db['Setting'][_0x0046('0xf')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x0046('0x10')](function(_0x4a3cdc){_0x1e67f2=_0x4a3cdc;return db['User'][_0x0046('0x11')]({'where':{'email':_[_0x0046('0x12')](_0x153d3e[_0x0046('0x13')],_0x0046('0x14')),'role':{'$or':[_0x0046('0x15'),_0x0046('0x16'),_0x0046('0x17')]}}});})[_0x0046('0x10')](function(_0xb55224){_0x45e97e=_0xb55224;if(_0x45e97e){if(_0x45e97e[_0x0046('0x18')]){return _0x11b766(_0x0046('0x19'));}else if(_0x1e67f2[_0x0046('0x1a')]>0x0){if(_0x45e97e[_0x0046('0x1b')]){if(moment(_0x45e97e['blockedAt'])[_0x0046('0x1c')](_0x1e67f2['blockDuration'],_0x0046('0x1d'))>moment()){return _0x11b766(_0x0046('0x19'));}else{return utils[_0x0046('0x1e')](_0x45e97e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x45e97e);})[_0x0046('0x10')](function(){return _0x11b766(null,_0x45e97e);});}}else{return utils[_0x0046('0x1f')](_0x45e97e)['then'](function(){return _0x11b766(null,_0x45e97e);});}}else{return utils[_0x0046('0x1f')](_0x45e97e)[_0x0046('0x10')](function(){return _0x11b766(null,_0x45e97e);});}}return _0x11b766(_0x0046('0x19'));})[_0x0046('0x20')](function(_0x2df8e5){_0x11b766(_0x2df8e5);});})); \ No newline at end of file +var _0x3b27=['blocked','blockedAt','add','minutes','getLicense','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','authenticate','google','/login','profile','use','clientID','clientSecret','secret','findOne','blockDuration','User','find','emails','value','admin','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x3b27,0x11c));var _0x73b2=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x3b27[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x73b2('0x0'))['Strategy'];var moment=require(_0x73b2('0x1'));var db=require(_0x73b2('0x2'))['db'];var config=require(_0x73b2('0x3'));var signToken=require(_0x73b2('0x4'))[_0x73b2('0x5')];var utils=require('../../config/utils');exports['login']=passport[_0x73b2('0x6')](_0x73b2('0x7'),{'failureRedirect':_0x73b2('0x8'),'scope':[_0x73b2('0x9'),'email'],'session':![]});exports['callback']=passport[_0x73b2('0x6')](_0x73b2('0x7'),{'failureRedirect':_0x73b2('0x8'),'session':![]});passport[_0x73b2('0xa')](new GoogleStrategy({'clientID':config[_0x73b2('0x7')]?config[_0x73b2('0x7')][_0x73b2('0xb')]:'id','clientSecret':config[_0x73b2('0x7')]?config[_0x73b2('0x7')][_0x73b2('0xc')]:_0x73b2('0xd'),'callbackURL':config[_0x73b2('0x7')]?config['google']['callbackURL']:''},function(_0x2d85ea,_0x54d3cc,_0xfe585f,_0x20984f){var _0x431aeb,_0x1292e2;return db['Setting'][_0x73b2('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x73b2('0xf')],'raw':!![]})['then'](function(_0xafa2b5){_0x431aeb=_0xafa2b5;return db[_0x73b2('0x10')][_0x73b2('0x11')]({'where':{'email':_['map'](_0xfe585f[_0x73b2('0x12')],_0x73b2('0x13')),'role':{'$or':[_0x73b2('0x14'),_0x73b2('0x15'),_0x73b2('0x16')]}}});})[_0x73b2('0x17')](function(_0x287d02){_0x1292e2=_0x287d02;if(_0x1292e2){if(_0x1292e2[_0x73b2('0x18')]){return _0x20984f(_0x73b2('0x19'));}else if(_0x431aeb[_0x73b2('0xf')]>0x0){if(_0x1292e2[_0x73b2('0x1a')]){if(moment(_0x1292e2[_0x73b2('0x1b')])[_0x73b2('0x1c')](_0x431aeb[_0x73b2('0xf')],_0x73b2('0x1d'))>moment()){return _0x20984f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x1292e2,0x0,![],null)[_0x73b2('0x17')](function(){return utils[_0x73b2('0x1e')](_0x1292e2);})[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}else{return utils[_0x73b2('0x1e')](_0x1292e2)[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}else{return utils[_0x73b2('0x1e')](_0x1292e2)[_0x73b2('0x17')](function(){return _0x20984f(null,_0x1292e2);});}}return _0x20984f(_0x73b2('0x19'));})['catch'](function(_0x23e25b){_0x20984f(_0x23e25b);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index faa7ab7..68dc311 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 _0x8511=['login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0x8511,0xf0));var _0x1851=function(_0x183915,_0x1f0e0e){_0x183915=_0x183915-0x0;var _0x1e0e33=_0x8511[_0x183915];return _0x1e0e33;};'use strict';var express=require(_0x1851('0x0'));var passport=require(_0x1851('0x1'));var router=express[_0x1851('0x2')]();var controller=require(_0x1851('0x3'));var userController=require(_0x1851('0x4'));var authService=require(_0x1851('0x5'));router[_0x1851('0x6')]('/',controller[_0x1851('0x7')]);router[_0x1851('0x6')](_0x1851('0x8'),controller[_0x1851('0x9')],authService[_0x1851('0xa')],userController[_0x1851('0x7')],authService[_0x1851('0xb')]);module[_0x1851('0xc')]=router; \ No newline at end of file +var _0x94a5=['callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','login','/callback'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x94a5,0x1b1));var _0x594a=function(_0x840e3e,_0x5a6fef){_0x840e3e=_0x840e3e-0x0;var _0x2b1a9e=_0x94a5[_0x840e3e];return _0x2b1a9e;};'use strict';var express=require(_0x594a('0x0'));var passport=require(_0x594a('0x1'));var router=express[_0x594a('0x2')]();var controller=require(_0x594a('0x3'));var userController=require(_0x594a('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller[_0x594a('0x5')]);router['get'](_0x594a('0x6'),controller[_0x594a('0x7')],authService[_0x594a('0x8')],userController[_0x594a('0x5')],authService[_0x594a('0x9')]);module[_0x594a('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 4e6a10a..a8403d9 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 _0x1395=['Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0x1395,0x105));var _0x5139=function(_0x2b7125,_0x58cd69){_0x2b7125=_0x2b7125-0x0;var _0x2fc154=_0x1395[_0x2b7125];return _0x2fc154;};'use strict';var util=require(_0x5139('0x0'));var passport=require(_0x5139('0x1'));var LocalStrategy=require(_0x5139('0x2'))[_0x5139('0x3')];var jayson=require(_0x5139('0x4'));var _=require(_0x5139('0x5'));var rs=require(_0x5139('0x6'));var moment=require(_0x5139('0x7'));var db=require('../../mysqldb')['db'];var authService=require(_0x5139('0x8'));var utils=require('../../config/utils');var client=jayson['client'][_0x5139('0x9')]({'port':0x232b});function localAuthenticate(_0x52051f,_0x463e4f,_0x182f62,_0x3608fb){var _0x5ed9f2,_0x350af6;return db[_0x5139('0xa')][_0x5139('0xb')]({'where':{'id':0x1},'attributes':[_0x5139('0xc'),_0x5139('0xd')],'raw':!![]})['then'](function(_0x1a1fcb){_0x5ed9f2=_0x1a1fcb;return _0x52051f['findOne']({'attributes':['id',_0x5139('0xe'),_0x5139('0xf'),_0x5139('0x10'),_0x5139('0x11'),_0x5139('0x12'),_0x5139('0x13'),'blockedAt',_0x5139('0x14')],'where':{'name':_0x463e4f,'role':{'$or':[_0x5139('0x15'),_0x5139('0x16'),_0x5139('0x17')]}}});})[_0x5139('0x18')](function(_0x51a341){if(!_0x51a341||_0x51a341&&_0x51a341[_0x5139('0xe')]!==_0x463e4f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x350af6=_0x51a341;return _0x350af6;}})[_0x5139('0x18')](function(){_0x350af6[_0x5139('0x19')](_0x182f62,function(_0x2a4a38,_0x22d5bc){var _0x431aed=_0x350af6['loginAttempts']+0x1;if(_0x2a4a38){return _0x3608fb(_0x2a4a38);}else if(!_0x22d5bc){if(_0x350af6[_0x5139('0x12')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else if(_0x5ed9f2[_0x5139('0xc')]>0x0){if(_0x350af6['blocked']){if(_0x5ed9f2['blockDuration']>0x0){if(moment(_0x350af6['blockedAt'])[_0x5139('0x1b')](_0x5ed9f2['blockDuration'],_0x5139('0x1c'))>moment()){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else{return utils['clearBlockUser'](_0x350af6,_0x431aed,![],null)[_0x5139('0x18')](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}}else{return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}}else{if(_0x431aed>=_0x5ed9f2[_0x5139('0xc')]){return utils[_0x5139('0x1d')](_0x350af6,0x0,!![],moment())[_0x5139('0x18')](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}else{return utils[_0x5139('0x1d')](_0x350af6,_0x431aed,![],null)['then'](function(){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});});}}}else{return _0x3608fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x350af6[_0x5139('0x12')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else if(_0x5ed9f2['allowedLoginAttempts']>0x0){if(_0x350af6[_0x5139('0x13')]){if(_0x5ed9f2[_0x5139('0xd')]>0x0){if(moment(_0x350af6[_0x5139('0x1e')])[_0x5139('0x1b')](_0x5ed9f2[_0x5139('0xd')],_0x5139('0x1c'))>moment()){return _0x3608fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x350af6,0x0,![],null)[_0x5139('0x18')](function(){return utils['getLicense'](_0x350af6);})['then'](function(){return _0x3608fb(null,_0x350af6);});}}else{return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}}else{return utils['clearBlockUser'](_0x350af6,0x0,![],null)[_0x5139('0x18')](function(){return utils[_0x5139('0x1f')](_0x350af6);})[_0x5139('0x18')](function(){return _0x3608fb(null,_0x350af6);})[_0x5139('0x20')](function(_0x52e772){return _0x3608fb(null,![],_0x52e772);});}}else{if(_0x350af6[_0x5139('0x13')]){return _0x3608fb(null,![],{'message':_0x5139('0x1a')});}else{return utils[_0x5139('0x1f')](_0x350af6)[_0x5139('0x18')](function(){return _0x3608fb(null,_0x350af6);});}}}});})[_0x5139('0x20')](function(_0x397002){return _0x3608fb(null,![],_0x397002);});}function sendServiceMail(_0x2e12db){return db[_0x5139('0x21')][_0x5139('0x22')]({'where':{'service':!![]},'attributes':['id',_0x5139('0xe'),_0x5139('0x23')],'include':[{'model':db[_0x5139('0x24')],'as':_0x5139('0x25')}]})[_0x5139('0x18')](function(_0x3b1bde){if(!_0x3b1bde){throw new Error(_0x5139('0x26'));}var _0x834ae5={'tls':{'rejectUnauthorized':![]}};if(_0x3b1bde[_0x5139('0x25')][_0x5139('0x27')]){_0x834ae5[_0x5139('0x27')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x27')];}else{_0x834ae5[_0x5139('0x28')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x28')];_0x834ae5[_0x5139('0x29')]=_0x3b1bde[_0x5139('0x25')]['port'];_0x834ae5[_0x5139('0x2a')]=_0x3b1bde[_0x5139('0x25')][_0x5139('0x2a')];}if(_0x3b1bde[_0x5139('0x25')]['authentication']){_0x834ae5['auth']={'user':_0x3b1bde[_0x5139('0x25')][_0x5139('0x16')],'pass':_0x3b1bde[_0x5139('0x25')][_0x5139('0x2b')]};}var _0x338a68={'account':_0x834ae5,'message':_[_0x5139('0x2c')]({'from':util[_0x5139('0x2d')](_0x5139('0x2e'),_0x3b1bde[_0x5139('0xe')],_0x3b1bde[_0x5139('0x23')]||_0x3b1bde[_0x5139('0x25')][_0x5139('0x16')])},_0x2e12db)};return client[_0x5139('0x2f')](_0x5139('0x30'),_0x338a68);})[_0x5139('0x18')](function(_0x585535){if(_0x585535[_0x5139('0x31')]){throw new Error(util[_0x5139('0x2d')](_0x5139('0x32'),_0x585535[_0x5139('0x31')][_0x5139('0x33')]||JSON[_0x5139('0x34')](_0x585535[_0x5139('0x31')])));}return!![];});}function handleError(_0x55535a,_0x296c2f,_0x421958){return _0x55535a[_0x5139('0x35')](_0x296c2f||0x1f4)[_0x5139('0x36')]({'message':_0x421958?_0x421958[_0x5139('0x33')]||_0x421958:''});}exports[_0x5139('0x37')]=function(_0x5ee2cb,_0x2dbaec,_0x333735){passport[_0x5139('0x19')](_0x5139('0x38'),function(_0x1896ae,_0x15746a,_0x18aa29){var _0x3a0598=_0x1896ae||_0x18aa29;if(_0x3a0598){return handleError(_0x2dbaec,0x191,_0x3a0598);}if(!_0x15746a){return handleError(_0x2dbaec,0x194,{'message':_0x5139('0x39')});}else{var _0x53380d={'payload':{'id':_0x15746a['id'],'role':_0x15746a['role']},'options':{'expiresIn':0x15180}};return authService[_0x5139('0x3a')](_0x53380d)[_0x5139('0x18')](function(_0xeda7c1){_0x2dbaec[_0x5139('0x3b')]({'id':_0x15746a['id'],'token':_0xeda7c1,'statusCall':'','isAlreadyLogged':_0x15746a[_0x5139('0x3c')]});});}})(_0x5ee2cb,_0x2dbaec,_0x333735);};exports[_0x5139('0x3d')]=function(_0x326f2a,_0x4144e2,_0x382641){if(!_0x326f2a[_0x5139('0x3e')]['email']){return handleError(_0x4144e2,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x22feb3=rs['generate']();_0x326f2a[_0x5139('0x3e')]['email']=_0x326f2a['body'][_0x5139('0x23')]['trim']()[_0x5139('0x3f')]();var _0x1b893c;return db['Setting'][_0x5139('0xb')]({'where':{'id':0x1},'attributes':[_0x5139('0xc'),_0x5139('0xd')],'raw':!![]})['then'](function(_0xac21d1){_0x1b893c=_0xac21d1;return db[_0x5139('0x40')][_0x5139('0x22')]({'where':{'email':_0x326f2a[_0x5139('0x3e')][_0x5139('0x23')]}});})[_0x5139('0x18')](function(_0x2525a6){if(!_0x2525a6){throw new Error(_0x5139('0x41'));}if(_0x2525a6[_0x5139('0x12')]){throw new Error(_0x5139('0x42'));}if(_0x2525a6[_0x5139('0x13')]){if(moment(_0x2525a6[_0x5139('0x1e')])['add'](_0x1b893c['blockDuration'],_0x5139('0x1c'))>moment()){throw new Error(_0x5139('0x43'));}else{_0x2525a6['blocked']=![];_0x2525a6[_0x5139('0x1e')]=null;}}_0x2525a6['resetPasswordToken']=_0x22feb3;_0x2525a6[_0x5139('0x44')]=Date[_0x5139('0x45')]()+0x36ee80;return _0x2525a6[_0x5139('0x46')]();})[_0x5139('0x18')](function(){return sendServiceMail({'to':_0x326f2a[_0x5139('0x3e')][_0x5139('0x23')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5139('0x47')+_0x5139('0x48')+_0x5139('0x49')+_0x326f2a[_0x5139('0x4a')][_0x5139('0x28')]+_0x5139('0x4b')+_0x22feb3+'\x0a\x0a'+_0x5139('0x4c')});})[_0x5139('0x18')](function(){_0x4144e2['status'](0xc8)[_0x5139('0x36')]({'message':'Reset\x20Email\x20sent!'});})[_0x5139('0x20')](function(_0x2d3a06){return handleError(_0x4144e2,0x1f4,_0x2d3a06);});};exports[_0x5139('0x4d')]=function(_0x6f311c,_0x545c8f,_0x5f3a0e){return db[_0x5139('0x40')][_0x5139('0x22')]({'where':{'resetPasswordToken':_0x6f311c['params'][_0x5139('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x5139('0x45')]()}}})[_0x5139('0x18')](function(_0x45e3a4){if(!_0x45e3a4){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x5139('0xb')]({'attributes':['id',_0x5139('0x4f'),_0x5139('0x50'),_0x5139('0x51')]})[_0x5139('0x18')](function(_0xfd48e7){if(_0xfd48e7[_0x5139('0x4f')])authService[_0x5139('0x52')](_0x6f311c['body'][_0x5139('0xf')]);if(!_0xfd48e7[_0x5139('0x50')]||!_0x45e3a4['previousPasswords'])return _0x45e3a4;authService[_0x5139('0x53')](_0x6f311c['body']['password'],_0x45e3a4[_0x5139('0x54')],_0xfd48e7['passwordHistoryLimit']);return _0x45e3a4;})[_0x5139('0x18')](function(){_0x45e3a4[_0x5139('0xf')]=_0x6f311c[_0x5139('0x3e')][_0x5139('0xf')];_0x45e3a4[_0x5139('0x55')]=null;_0x45e3a4[_0x5139('0x44')]=null;return _0x45e3a4[_0x5139('0x46')]();});})['then'](function(){_0x545c8f[_0x5139('0x35')](0xc8)['send']({'message':_0x5139('0x56')});})[_0x5139('0x20')](function(_0x3b3483){return handleError(_0x545c8f,0x1f4,_0x3b3483);});};passport[_0x5139('0x57')](new LocalStrategy({'usernameField':_0x5139('0xe'),'passwordField':_0x5139('0xf')},function(_0x1bec7c,_0x19ad3c,_0x338ff9){return localAuthenticate(db[_0x5139('0x40')],_0x1bec7c,_0x19ad3c,_0x338ff9);})); \ No newline at end of file +var _0x66cf=['add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','util','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts'];(function(_0x2e75ad,_0x35a76d){var _0x31fc3b=function(_0x1c8c6c){while(--_0x1c8c6c){_0x2e75ad['push'](_0x2e75ad['shift']());}};_0x31fc3b(++_0x35a76d);}(_0x66cf,0x1a2));var _0xf66c=function(_0x11ed3b,_0x3b2749){_0x11ed3b=_0x11ed3b-0x0;var _0x5066ea=_0x66cf[_0x11ed3b];return _0x5066ea;};'use strict';var util=require(_0xf66c('0x0'));var passport=require('passport');var LocalStrategy=require(_0xf66c('0x1'))[_0xf66c('0x2')];var jayson=require('jayson/promise');var _=require(_0xf66c('0x3'));var rs=require(_0xf66c('0x4'));var moment=require(_0xf66c('0x5'));var db=require(_0xf66c('0x6'))['db'];var authService=require(_0xf66c('0x7'));var utils=require(_0xf66c('0x8'));var client=jayson[_0xf66c('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x56dc7b,_0x470edc,_0x263b9e,_0x12e15e){var _0x4fe300,_0x4d3f77;return db[_0xf66c('0xa')][_0xf66c('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf66c('0xc')],'raw':!![]})[_0xf66c('0xd')](function(_0x22a2a7){_0x4fe300=_0x22a2a7;return _0x56dc7b['findOne']({'attributes':['id','name',_0xf66c('0xe'),_0xf66c('0xf'),'role',_0xf66c('0x10'),_0xf66c('0x11'),_0xf66c('0x12'),_0xf66c('0x13')],'where':{'name':_0x470edc,'role':{'$or':[_0xf66c('0x14'),_0xf66c('0x15'),_0xf66c('0x16')]}}});})[_0xf66c('0xd')](function(_0x10306d){if(!_0x10306d||_0x10306d&&_0x10306d[_0xf66c('0x17')]!==_0x470edc){throw new Error(_0xf66c('0x18'));}else{_0x4d3f77=_0x10306d;return _0x4d3f77;}})['then'](function(){_0x4d3f77[_0xf66c('0x19')](_0x263b9e,function(_0x3c3d90,_0x480ca2){var _0xec645e=_0x4d3f77[_0xf66c('0x13')]+0x1;if(_0x3c3d90){return _0x12e15e(_0x3c3d90);}else if(!_0x480ca2){if(_0x4d3f77[_0xf66c('0x10')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else if(_0x4fe300[_0xf66c('0x1a')]>0x0){if(_0x4d3f77[_0xf66c('0x11')]){if(_0x4fe300['blockDuration']>0x0){if(moment(_0x4d3f77[_0xf66c('0x12')])[_0xf66c('0x1b')](_0x4fe300[_0xf66c('0xc')],_0xf66c('0x1c'))>moment()){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,_0xec645e,![],null)[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{if(_0xec645e>=_0x4fe300[_0xf66c('0x1a')]){return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,!![],moment())[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,_0xec645e,![],null)[_0xf66c('0xd')](function(){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});});}}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{if(_0x4d3f77[_0xf66c('0x10')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else if(_0x4fe300[_0xf66c('0x1a')]>0x0){if(_0x4d3f77[_0xf66c('0x11')]){if(_0x4fe300[_0xf66c('0xc')]>0x0){if(moment(_0x4d3f77[_0xf66c('0x12')])['add'](_0x4fe300[_0xf66c('0xc')],_0xf66c('0x1c'))>moment()){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,![],null)[_0xf66c('0xd')](function(){return utils[_0xf66c('0x1e')](_0x4d3f77);})[_0xf66c('0xd')](function(){return _0x12e15e(null,_0x4d3f77);});}}else{return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}}else{return utils[_0xf66c('0x1d')](_0x4d3f77,0x0,![],null)[_0xf66c('0xd')](function(){return utils[_0xf66c('0x1e')](_0x4d3f77);})[_0xf66c('0xd')](function(){return _0x12e15e(null,_0x4d3f77);})['catch'](function(_0x32bf03){return _0x12e15e(null,![],_0x32bf03);});}}else{if(_0x4d3f77[_0xf66c('0x11')]){return _0x12e15e(null,![],{'message':_0xf66c('0x18')});}else{return utils[_0xf66c('0x1e')](_0x4d3f77)['then'](function(){return _0x12e15e(null,_0x4d3f77);});}}}});})[_0xf66c('0x1f')](function(_0x384602){return _0x12e15e(null,![],_0x384602);});}function sendServiceMail(_0x28ae2e){return db[_0xf66c('0x20')][_0xf66c('0x21')]({'where':{'service':!![]},'attributes':['id',_0xf66c('0x17'),_0xf66c('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xf66c('0x23')}]})[_0xf66c('0xd')](function(_0x27be9e){if(!_0x27be9e){throw new Error(_0xf66c('0x24'));}var _0x22f9fd={'tls':{'rejectUnauthorized':![]}};if(_0x27be9e[_0xf66c('0x23')][_0xf66c('0x25')]){_0x22f9fd[_0xf66c('0x25')]=_0x27be9e[_0xf66c('0x23')]['service'];}else{_0x22f9fd[_0xf66c('0x26')]=_0x27be9e[_0xf66c('0x23')][_0xf66c('0x26')];_0x22f9fd[_0xf66c('0x27')]=_0x27be9e[_0xf66c('0x23')]['port'];_0x22f9fd[_0xf66c('0x28')]=_0x27be9e[_0xf66c('0x23')][_0xf66c('0x28')];}if(_0x27be9e[_0xf66c('0x23')][_0xf66c('0x29')]){_0x22f9fd['auth']={'user':_0x27be9e[_0xf66c('0x23')][_0xf66c('0x15')],'pass':_0x27be9e[_0xf66c('0x23')][_0xf66c('0x2a')]};}var _0x1a4cc4={'account':_0x22f9fd,'message':_['merge']({'from':util[_0xf66c('0x2b')](_0xf66c('0x2c'),_0x27be9e[_0xf66c('0x17')],_0x27be9e[_0xf66c('0x22')]||_0x27be9e[_0xf66c('0x23')][_0xf66c('0x15')])},_0x28ae2e)};return client['request'](_0xf66c('0x2d'),_0x1a4cc4);})[_0xf66c('0xd')](function(_0x50afb3){if(_0x50afb3[_0xf66c('0x2e')]){throw new Error(util['format'](_0xf66c('0x2f'),_0x50afb3[_0xf66c('0x2e')][_0xf66c('0x30')]||JSON[_0xf66c('0x31')](_0x50afb3[_0xf66c('0x2e')])));}return!![];});}function handleError(_0x519650,_0x3637fa,_0x1b2249){return _0x519650[_0xf66c('0x32')](_0x3637fa||0x1f4)[_0xf66c('0x33')]({'message':_0x1b2249?_0x1b2249[_0xf66c('0x30')]||_0x1b2249:''});}exports[_0xf66c('0x34')]=function(_0x54064f,_0x1c0097,_0x20c7fd){passport[_0xf66c('0x19')](_0xf66c('0x35'),function(_0x47b467,_0xf1ee02,_0x41300e){var _0x41a078=_0x47b467||_0x41300e;if(_0x41a078){return handleError(_0x1c0097,0x191,_0x41a078);}if(!_0xf1ee02){return handleError(_0x1c0097,0x194,{'message':_0xf66c('0x36')});}else{var _0x232afe={'payload':{'id':_0xf1ee02['id'],'role':_0xf1ee02[_0xf66c('0x37')]},'options':{'expiresIn':0x15180}};return authService[_0xf66c('0x38')](_0x232afe)['then'](function(_0x4d36e1){_0x1c0097['json']({'id':_0xf1ee02['id'],'token':_0x4d36e1,'statusCall':'','isAlreadyLogged':_0xf1ee02[_0xf66c('0x39')]});});}})(_0x54064f,_0x1c0097,_0x20c7fd);};exports[_0xf66c('0x3a')]=function(_0xb61ad0,_0x55bb10,_0x41a664){if(!_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')]){return handleError(_0x55bb10,0x1f4,{'message':_0xf66c('0x3c')});}var _0x1006d3=rs[_0xf66c('0x3d')]();_0xb61ad0[_0xf66c('0x3b')]['email']=_0xb61ad0['body'][_0xf66c('0x22')][_0xf66c('0x3e')]()[_0xf66c('0x3f')]();var _0x1d54f5;return db[_0xf66c('0xa')][_0xf66c('0xb')]({'where':{'id':0x1},'attributes':[_0xf66c('0x1a'),_0xf66c('0xc')],'raw':!![]})['then'](function(_0x5f1786){_0x1d54f5=_0x5f1786;return db[_0xf66c('0x40')][_0xf66c('0x21')]({'where':{'email':_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')]}});})['then'](function(_0x151e39){if(!_0x151e39){throw new Error(_0xf66c('0x41'));}if(_0x151e39[_0xf66c('0x10')]){throw new Error(_0xf66c('0x42'));}if(_0x151e39['blocked']){if(moment(_0x151e39[_0xf66c('0x12')])[_0xf66c('0x1b')](_0x1d54f5[_0xf66c('0xc')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x151e39[_0xf66c('0x11')]=![];_0x151e39['blockedAt']=null;}}_0x151e39[_0xf66c('0x43')]=_0x1006d3;_0x151e39['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x151e39[_0xf66c('0x44')]();})[_0xf66c('0xd')](function(){return sendServiceMail({'to':_0xb61ad0[_0xf66c('0x3b')][_0xf66c('0x22')],'subject':_0xf66c('0x45'),'text':_0xf66c('0x46')+_0xf66c('0x47')+_0xf66c('0x48')+_0xb61ad0[_0xf66c('0x49')]['host']+'/reset/'+_0x1006d3+'\x0a\x0a'+_0xf66c('0x4a')});})[_0xf66c('0xd')](function(){_0x55bb10['status'](0xc8)[_0xf66c('0x33')]({'message':_0xf66c('0x4b')});})[_0xf66c('0x1f')](function(_0x330263){return handleError(_0x55bb10,0x1f4,_0x330263);});};exports[_0xf66c('0x4c')]=function(_0x3a181c,_0x52771e,_0x12363c){return db['User'][_0xf66c('0x21')]({'where':{'resetPasswordToken':_0x3a181c[_0xf66c('0x4d')][_0xf66c('0x4e')],'resetPasswordExpires':{'$gt':Date[_0xf66c('0x4f')]()}}})[_0xf66c('0xd')](function(_0x865bbf){if(!_0x865bbf){throw new Error(_0xf66c('0x50'));}return db[_0xf66c('0xa')][_0xf66c('0xb')]({'attributes':['id','securePassword',_0xf66c('0x51'),'passwordHistoryLimit']})[_0xf66c('0xd')](function(_0x154d48){if(_0x154d48[_0xf66c('0x52')])authService[_0xf66c('0x53')](_0x3a181c[_0xf66c('0x3b')]['password']);if(!_0x154d48[_0xf66c('0x51')]||!_0x865bbf[_0xf66c('0x54')])return _0x865bbf;authService[_0xf66c('0x55')](_0x3a181c[_0xf66c('0x3b')][_0xf66c('0xe')],_0x865bbf[_0xf66c('0x54')],_0x154d48[_0xf66c('0x56')]);return _0x865bbf;})[_0xf66c('0xd')](function(){_0x865bbf[_0xf66c('0xe')]=_0x3a181c[_0xf66c('0x3b')][_0xf66c('0xe')];_0x865bbf['resetPasswordToken']=null;_0x865bbf[_0xf66c('0x57')]=null;return _0x865bbf[_0xf66c('0x44')]();});})['then'](function(){_0x52771e[_0xf66c('0x32')](0xc8)[_0xf66c('0x33')]({'message':_0xf66c('0x58')});})[_0xf66c('0x1f')](function(_0x3b79f6){return handleError(_0x52771e,0x1f4,_0x3b79f6);});};passport['use'](new LocalStrategy({'usernameField':_0xf66c('0x17'),'passwordField':'password'},function(_0x50d0c2,_0x109853,_0x475dd6){return localAuthenticate(db[_0xf66c('0x40')],_0x50d0c2,_0x109853,_0x475dd6);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4b3c42d..a201cb5 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 _0x6ddc=['post','login','/forgot','forgot','reset','exports','Router','./authLocal.controller'];(function(_0x23d527,_0x1c4a71){var _0x9e46c1=function(_0x524937){while(--_0x524937){_0x23d527['push'](_0x23d527['shift']());}};_0x9e46c1(++_0x1c4a71);}(_0x6ddc,0x166));var _0xc6dd=function(_0x5865d0,_0x1c948d){_0x5865d0=_0x5865d0-0x0;var _0x5110ae=_0x6ddc[_0x5865d0];return _0x5110ae;};'use strict';var express=require('express');var router=express[_0xc6dd('0x0')]();var controller=require(_0xc6dd('0x1'));router[_0xc6dd('0x2')]('/',controller[_0xc6dd('0x3')]);router[_0xc6dd('0x2')](_0xc6dd('0x4'),controller[_0xc6dd('0x5')]);router[_0xc6dd('0x2')]('/reset/:token',controller[_0xc6dd('0x6')]);module[_0xc6dd('0x7')]=router; \ No newline at end of file +var _0xf41a=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x41a013,_0x2bcf00){var _0x320ae3=function(_0x7c7753){while(--_0x7c7753){_0x41a013['push'](_0x41a013['shift']());}};_0x320ae3(++_0x2bcf00);}(_0xf41a,0x11b));var _0xaf41=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0xf41a[_0x2af29a];return _0x5ef02f;};'use strict';var express=require(_0xaf41('0x0'));var router=express[_0xaf41('0x1')]();var controller=require(_0xaf41('0x2'));router[_0xaf41('0x3')]('/',controller[_0xaf41('0x4')]);router[_0xaf41('0x3')](_0xaf41('0x5'),controller[_0xaf41('0x6')]);router['post'](_0xaf41('0x7'),controller[_0xaf41('0x8')]);module[_0xaf41('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 9dd42ca..5e2fe69 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 _0x2768=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x2768,0x16f));var _0x8276=function(_0xff43bd,_0x10a518){_0xff43bd=_0xff43bd-0x0;var _0x264b25=_0x2768[_0xff43bd];return _0x264b25;};'use strict';var Sequelize=require(_0x8276('0x0'));module[_0x8276('0x1')]={'name':{'type':Sequelize[_0x8276('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8276('0x2')]},'description':{'type':Sequelize[_0x8276('0x2')]},'status':{'type':Sequelize[_0x8276('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8276('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xf12e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf12e,0x12b));var _0xef12=function(_0x4b3ec4,_0x3c573c){_0x4b3ec4=_0x4b3ec4-0x0;var _0x192836=_0xf12e[_0x4b3ec4];return _0x192836;};'use strict';var Sequelize=require(_0xef12('0x0'));module[_0xef12('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xef12('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xef12('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 43defaa..35c723f 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 _0xb3ef=['bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','end','error','name','send','map','Automation','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','find','create','update','body','params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x57036b,_0x1a64f2){var _0x4b2423=function(_0x1f21ff){while(--_0x1f21ff){_0x57036b['push'](_0x57036b['shift']());}};_0x4b2423(++_0x1a64f2);}(_0xb3ef,0x143));var _0xfb3e=function(_0x3a7007,_0x23ab68){_0x3a7007=_0x3a7007-0x0;var _0x520076=_0xb3ef[_0x3a7007];return _0x520076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb3e('0x0'));var zipdir=require(_0xfb3e('0x1'));var jsonpatch=require(_0xfb3e('0x2'));var rp=require(_0xfb3e('0x3'));var moment=require(_0xfb3e('0x4'));var BPromise=require(_0xfb3e('0x5'));var Mustache=require(_0xfb3e('0x6'));var util=require('util');var path=require(_0xfb3e('0x7'));var sox=require('sox');var csv=require(_0xfb3e('0x8'));var ejs=require(_0xfb3e('0x9'));var fs=require('fs');var fs_extra=require(_0xfb3e('0xa'));var _=require('lodash');var squel=require(_0xfb3e('0xb'));var crypto=require(_0xfb3e('0xc'));var jsforce=require(_0xfb3e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfb3e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb3e('0xe'));var authService=require(_0xfb3e('0xf'));var qs=require(_0xfb3e('0x10'));var as=require(_0xfb3e('0x11'));var hardwareService=require(_0xfb3e('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xfb3e('0x13'));var config=require(_0xfb3e('0x14'));var licenseUtil=require(_0xfb3e('0x15'));var db=require(_0xfb3e('0x16'))['db'];function respondWithStatusCode(_0x61eec9,_0x460961){_0x460961=_0x460961||0xcc;return function(_0x51cdb7){if(_0x51cdb7){return _0x61eec9[_0xfb3e('0x17')](_0x460961);}return _0x61eec9['status'](_0x460961)['end']();};}function respondWithResult(_0x1b2a02,_0x325468){_0x325468=_0x325468||0xc8;return function(_0x19bf23){if(_0x19bf23){return _0x1b2a02[_0xfb3e('0x18')](_0x325468)[_0xfb3e('0x19')](_0x19bf23);}};}function respondWithFilteredResult(_0x224c9f,_0x1c364b){return function(_0x12e98d){if(_0x12e98d){var _0x380991=typeof _0x1c364b[_0xfb3e('0x1a')]===_0xfb3e('0x1b')&&typeof _0x1c364b[_0xfb3e('0x1c')]===_0xfb3e('0x1b');var _0x5585ce=_0x12e98d['count'];var _0x34eb17=_0x380991?0x0:_0x1c364b['offset'];var _0x125b56=_0x380991?_0x12e98d['count']:_0x1c364b[_0xfb3e('0x1a')]+_0x1c364b['limit'];var _0x230a33;if(_0x125b56>=_0x5585ce){_0x125b56=_0x5585ce;_0x230a33=0xc8;}else{_0x230a33=0xce;}_0x224c9f[_0xfb3e('0x18')](_0x230a33);return _0x224c9f[_0xfb3e('0x1d')](_0xfb3e('0x1e'),_0x34eb17+'-'+_0x125b56+'/'+_0x5585ce)[_0xfb3e('0x19')](_0x12e98d);}return null;};}function patchUpdates(_0xcd5dc0){return function(_0x221e78){try{jsonpatch[_0xfb3e('0x1f')](_0x221e78,_0xcd5dc0,!![]);}catch(_0x23e64a){return BPromise[_0xfb3e('0x20')](_0x23e64a);}return _0x221e78[_0xfb3e('0x21')]();};}function saveUpdates(_0x4e5a4b,_0x3e43f4){return function(_0x354c4b){if(_0x354c4b){return _0x354c4b['update'](_0x4e5a4b)[_0xfb3e('0x22')](function(_0x14b692){return _0x14b692;});}return null;};}function removeEntity(_0x34464e,_0x4152cc){return function(_0x1abc4d){if(_0x1abc4d){return _0x1abc4d['destroy']()[_0xfb3e('0x22')](function(){_0x34464e[_0xfb3e('0x18')](0xcc)[_0xfb3e('0x23')]();});}};}function handleEntityNotFound(_0x35534f,_0x20e85b){return function(_0x544c3f){if(!_0x544c3f){_0x35534f['sendStatus'](0x194);}return _0x544c3f;};}function handleError(_0x1042cc,_0x1266ca){_0x1266ca=_0x1266ca||0x1f4;return function(_0x9c7b69){logger[_0xfb3e('0x24')](_0x9c7b69['stack']);if(_0x9c7b69[_0xfb3e('0x25')]){delete _0x9c7b69[_0xfb3e('0x25')];}_0x1042cc['status'](_0x1266ca)[_0xfb3e('0x26')](_0x9c7b69);};}exports['index']=function(_0x18c45c,_0x3587fd){var _0x4dc39d={},_0x178b76={},_0x3cb0af={'count':0x0,'rows':[]};var _0x5c5103=_[_0xfb3e('0x27')](db[_0xfb3e('0x28')]['rawAttributes'],function(_0x5214b5){return{'name':_0x5214b5['fieldName'],'type':_0x5214b5[_0xfb3e('0x29')]['key']};});_0x178b76[_0xfb3e('0x2a')]=_[_0xfb3e('0x27')](_0x5c5103,'name');_0x178b76['query']=_[_0xfb3e('0x2b')](_0x18c45c[_0xfb3e('0x2c')]);_0x178b76['filters']=_[_0xfb3e('0x2d')](_0x178b76['model'],_0x178b76[_0xfb3e('0x2c')]);_0x4dc39d['attributes']=_['intersection'](_0x178b76[_0xfb3e('0x2a')],qs[_0xfb3e('0x2e')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x2e')]));_0x4dc39d[_0xfb3e('0x2f')]=_0x4dc39d[_0xfb3e('0x2f')]['length']?_0x4dc39d[_0xfb3e('0x2f')]:_0x178b76[_0xfb3e('0x2a')];if(!_0x18c45c['query'][_0xfb3e('0x30')](_0xfb3e('0x31'))){_0x4dc39d[_0xfb3e('0x1c')]=qs[_0xfb3e('0x1c')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x4dc39d[_0xfb3e('0x1a')]=qs[_0xfb3e('0x1a')](_0x18c45c[_0xfb3e('0x2c')][_0xfb3e('0x1a')]);}_0x4dc39d[_0xfb3e('0x32')]=qs[_0xfb3e('0x33')](_0x18c45c[_0xfb3e('0x2c')]['sort']);_0x4dc39d[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_[_0xfb3e('0x36')](_0x18c45c[_0xfb3e('0x2c')],_0x178b76[_0xfb3e('0x35')]),_0x5c5103);if(_0x18c45c['query'][_0xfb3e('0x37')]){_0x4dc39d[_0xfb3e('0x34')]=_[_0xfb3e('0x38')](_0x4dc39d[_0xfb3e('0x34')],{'$or':_[_0xfb3e('0x27')](_0x5c5103,function(_0x72c54e){if(_0x72c54e[_0xfb3e('0x29')]!==_0xfb3e('0x39')){var _0x5d55ae={};_0x5d55ae[_0x72c54e[_0xfb3e('0x25')]]={'$like':'%'+_0x18c45c[_0xfb3e('0x2c')]['filter']+'%'};return _0x5d55ae;}})});}_0x4dc39d=_[_0xfb3e('0x38')]({},_0x4dc39d,_0x18c45c['options']);var _0x3e3bc1={'where':_0x4dc39d['where']};return db[_0xfb3e('0x28')][_0xfb3e('0x3a')](_0x3e3bc1)[_0xfb3e('0x22')](function(_0x518197){_0x3cb0af[_0xfb3e('0x3a')]=_0x518197;if(_0x18c45c['query'][_0xfb3e('0x3b')]){_0x4dc39d[_0xfb3e('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xfb3e('0x3d')](_0x4dc39d);})[_0xfb3e('0x22')](function(_0x59663e){_0x3cb0af[_0xfb3e('0x3e')]=_0x59663e;return _0x3cb0af;})[_0xfb3e('0x22')](respondWithFilteredResult(_0x3587fd,_0x4dc39d))[_0xfb3e('0x3f')](handleError(_0x3587fd,null));};exports[_0xfb3e('0x40')]=function(_0x41bb5d,_0x59ce91){var _0x157fd2={'raw':![],'where':{'id':_0x41bb5d['params']['id']}},_0x4f968b={};_0x4f968b[_0xfb3e('0x2a')]=_[_0xfb3e('0x2b')](db[_0xfb3e('0x28')][_0xfb3e('0x41')]);_0x4f968b[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x41bb5d[_0xfb3e('0x2c')]);_0x4f968b['filters']=_[_0xfb3e('0x2d')](_0x4f968b['model'],_0x4f968b['query']);_0x157fd2['attributes']=_[_0xfb3e('0x2d')](_0x4f968b[_0xfb3e('0x2a')],qs[_0xfb3e('0x2e')](_0x41bb5d[_0xfb3e('0x2c')][_0xfb3e('0x2e')]));_0x157fd2[_0xfb3e('0x2f')]=_0x157fd2[_0xfb3e('0x2f')][_0xfb3e('0x42')]?_0x157fd2[_0xfb3e('0x2f')]:_0x4f968b[_0xfb3e('0x2a')];if(_0x41bb5d[_0xfb3e('0x2c')][_0xfb3e('0x3b')]){_0x157fd2[_0xfb3e('0x3c')]=[{'all':!![]}];}_0x157fd2=_[_0xfb3e('0x38')]({},_0x157fd2,_0x41bb5d[_0xfb3e('0x43')]);return db[_0xfb3e('0x28')][_0xfb3e('0x44')](_0x157fd2)[_0xfb3e('0x22')](handleEntityNotFound(_0x59ce91,null))['then'](respondWithResult(_0x59ce91,null))[_0xfb3e('0x3f')](handleError(_0x59ce91,null));};exports[_0xfb3e('0x45')]=function(_0x4b7503,_0x14fc9f){return db[_0xfb3e('0x28')]['create'](_0x4b7503['body'],{})[_0xfb3e('0x22')](respondWithResult(_0x14fc9f,0xc9))[_0xfb3e('0x3f')](handleError(_0x14fc9f,null));};exports[_0xfb3e('0x46')]=function(_0x3ca425,_0x3323b1){if(_0x3ca425[_0xfb3e('0x47')]['id']){delete _0x3ca425[_0xfb3e('0x47')]['id'];}return db[_0xfb3e('0x28')][_0xfb3e('0x44')]({'where':{'id':_0x3ca425[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x3323b1,null))[_0xfb3e('0x22')](saveUpdates(_0x3ca425[_0xfb3e('0x47')],null))[_0xfb3e('0x22')](respondWithResult(_0x3323b1,null))[_0xfb3e('0x3f')](handleError(_0x3323b1,null));};exports[_0xfb3e('0x49')]=function(_0x3e0ada,_0x487ec1){return db[_0xfb3e('0x28')][_0xfb3e('0x44')]({'where':{'id':_0x3e0ada[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x487ec1,null))[_0xfb3e('0x22')](removeEntity(_0x487ec1,null))[_0xfb3e('0x3f')](handleError(_0x487ec1,null));};exports[_0xfb3e('0x4a')]=function(_0x395343,_0x1c928f,_0x281c8b){return db[_0xfb3e('0x4b')][_0xfb3e('0x44')]({'where':{'id':_0x395343[_0xfb3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c928f,null))['then'](function(_0xabb1e3){if(_0xabb1e3){return _0xabb1e3[_0xfb3e('0x4a')](_0x395343[_0xfb3e('0x47')][_0xfb3e('0x4c')],_[_0xfb3e('0x4d')](_0x395343['body'],['ids','id'])||{});}})[_0xfb3e('0x22')](respondWithResult(_0x1c928f,null))[_0xfb3e('0x3f')](handleError(_0x1c928f,null));};exports[_0xfb3e('0x4e')]=function(_0x4f6c62,_0x1d771b,_0x3dd332){var _0x272ce3={};var _0x48bb90={};var _0x11f60f;var _0x323d24;return db[_0xfb3e('0x28')][_0xfb3e('0x4f')]({'where':{'id':_0x4f6c62[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x1d771b,null))[_0xfb3e('0x22')](function(_0x493339){if(_0x493339){_0x11f60f=_0x493339;_0x48bb90[_0xfb3e('0x2a')]=_['keys'](db[_0xfb3e('0x4b')][_0xfb3e('0x41')]);_0x48bb90[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x4f6c62[_0xfb3e('0x2c')]);_0x48bb90[_0xfb3e('0x35')]=_[_0xfb3e('0x2d')](_0x48bb90[_0xfb3e('0x2a')],_0x48bb90[_0xfb3e('0x2c')]);_0x272ce3[_0xfb3e('0x2f')]=_[_0xfb3e('0x2d')](_0x48bb90['model'],qs[_0xfb3e('0x2e')](_0x4f6c62['query'][_0xfb3e('0x2e')]));_0x272ce3[_0xfb3e('0x2f')]=_0x272ce3[_0xfb3e('0x2f')]['length']?_0x272ce3[_0xfb3e('0x2f')]:_0x48bb90[_0xfb3e('0x2a')];_0x272ce3[_0xfb3e('0x32')]=qs[_0xfb3e('0x33')](_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x33')]);_0x272ce3[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_[_0xfb3e('0x36')](_0x4f6c62[_0xfb3e('0x2c')],_0x48bb90[_0xfb3e('0x35')]));if(_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x37')]){_0x272ce3['where']=_[_0xfb3e('0x38')](_0x272ce3['where'],{'$or':_[_0xfb3e('0x27')](_0x272ce3[_0xfb3e('0x2f')],function(_0x5d295c){var _0x1cdcad={};_0x1cdcad[_0x5d295c]={'$like':'%'+_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x37')]+'%'};return _0x1cdcad;})});}_0x272ce3=_[_0xfb3e('0x38')]({},_0x272ce3,_0x4f6c62['options']);return _0x11f60f[_0xfb3e('0x4e')](_0x272ce3);}})[_0xfb3e('0x22')](function(_0x461b5c){if(_0x461b5c){_0x323d24=_0x461b5c[_0xfb3e('0x42')];if(!_0x4f6c62['query'][_0xfb3e('0x30')](_0xfb3e('0x31'))){_0x272ce3[_0xfb3e('0x1c')]=qs[_0xfb3e('0x1c')](_0x4f6c62[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x272ce3[_0xfb3e('0x1a')]=qs['offset'](_0x4f6c62['query'][_0xfb3e('0x1a')]);}return _0x11f60f[_0xfb3e('0x4e')](_0x272ce3);}})[_0xfb3e('0x22')](function(_0x5d1efa){if(_0x5d1efa){return _0x5d1efa?{'count':_0x323d24,'rows':_0x5d1efa}:null;}})['then'](respondWithResult(_0x1d771b,null))[_0xfb3e('0x3f')](handleError(_0x1d771b,null));};exports[_0xfb3e('0x50')]=function(_0x297392,_0x50209a,_0x419d58){return db['Action'][_0xfb3e('0x44')]({'where':{'id':_0x297392[_0xfb3e('0x48')]['id']}})['then'](handleEntityNotFound(_0x50209a,null))[_0xfb3e('0x22')](function(_0x3fb891){if(_0x3fb891){return _0x3fb891[_0xfb3e('0x50')](_0x297392[_0xfb3e('0x47')]['ids'],_[_0xfb3e('0x4d')](_0x297392['body'],[_0xfb3e('0x4c'),'id'])||{});}})[_0xfb3e('0x22')](respondWithResult(_0x50209a,null))[_0xfb3e('0x3f')](handleError(_0x50209a,null));};exports[_0xfb3e('0x51')]=function(_0x4ff6df,_0x26b6da,_0x5e0daf){var _0x20e4de={};var _0x1db686={};var _0x3375ef;var _0x4c7f08;return db[_0xfb3e('0x28')][_0xfb3e('0x4f')]({'where':{'id':_0x4ff6df[_0xfb3e('0x48')]['id']}})[_0xfb3e('0x22')](handleEntityNotFound(_0x26b6da,null))[_0xfb3e('0x22')](function(_0x28ccbb){if(_0x28ccbb){_0x3375ef=_0x28ccbb;_0x1db686[_0xfb3e('0x2a')]=_[_0xfb3e('0x2b')](db['Action'][_0xfb3e('0x41')]);_0x1db686[_0xfb3e('0x2c')]=_[_0xfb3e('0x2b')](_0x4ff6df[_0xfb3e('0x2c')]);_0x1db686[_0xfb3e('0x35')]=_['intersection'](_0x1db686['model'],_0x1db686['query']);_0x20e4de[_0xfb3e('0x2f')]=_[_0xfb3e('0x2d')](_0x1db686['model'],qs['fields'](_0x4ff6df['query'][_0xfb3e('0x2e')]));_0x20e4de[_0xfb3e('0x2f')]=_0x20e4de[_0xfb3e('0x2f')][_0xfb3e('0x42')]?_0x20e4de[_0xfb3e('0x2f')]:_0x1db686['model'];_0x20e4de[_0xfb3e('0x32')]=qs['sort'](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x33')]);_0x20e4de[_0xfb3e('0x34')]=qs[_0xfb3e('0x35')](_['pick'](_0x4ff6df['query'],_0x1db686[_0xfb3e('0x35')]));if(_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x37')]){_0x20e4de[_0xfb3e('0x34')]=_[_0xfb3e('0x38')](_0x20e4de[_0xfb3e('0x34')],{'$or':_[_0xfb3e('0x27')](_0x20e4de[_0xfb3e('0x2f')],function(_0x521d93){var _0x28fc0e={};_0x28fc0e[_0x521d93]={'$like':'%'+_0x4ff6df[_0xfb3e('0x2c')]['filter']+'%'};return _0x28fc0e;})});}_0x20e4de=_['merge']({},_0x20e4de,_0x4ff6df[_0xfb3e('0x43')]);return _0x3375ef[_0xfb3e('0x51')](_0x20e4de);}})[_0xfb3e('0x22')](function(_0x1e4f31){if(_0x1e4f31){_0x4c7f08=_0x1e4f31['length'];if(!_0x4ff6df[_0xfb3e('0x2c')]['hasOwnProperty'](_0xfb3e('0x31'))){_0x20e4de['limit']=qs[_0xfb3e('0x1c')](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x1c')]);_0x20e4de['offset']=qs['offset'](_0x4ff6df[_0xfb3e('0x2c')][_0xfb3e('0x1a')]);}return _0x3375ef[_0xfb3e('0x51')](_0x20e4de);}})[_0xfb3e('0x22')](function(_0x685525){if(_0x685525){return _0x685525?{'count':_0x4c7f08,'rows':_0x685525}:null;}})[_0xfb3e('0x22')](respondWithResult(_0x26b6da,null))[_0xfb3e('0x3f')](handleError(_0x26b6da,null));}; \ No newline at end of file +var _0xf863=['attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','fields','find','create','body','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','name','index','map','Automation','rawAttributes','model','query','intersection'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xf863,0x6f));var _0x3f86=function(_0x5e5bb7,_0x53c8f1){_0x5e5bb7=_0x5e5bb7-0x0;var _0x3ec7c2=_0xf863[_0x5e5bb7];return _0x3ec7c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f86('0x0'));var zipdir=require(_0x3f86('0x1'));var jsonpatch=require(_0x3f86('0x2'));var rp=require(_0x3f86('0x3'));var moment=require('moment');var BPromise=require(_0x3f86('0x4'));var Mustache=require(_0x3f86('0x5'));var util=require(_0x3f86('0x6'));var path=require(_0x3f86('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3f86('0x8'));var _=require(_0x3f86('0x9'));var squel=require(_0x3f86('0xa'));var crypto=require('crypto');var jsforce=require(_0x3f86('0xb'));var deskjs=require(_0x3f86('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3f86('0xd'));var Papa=require('papaparse');var Redis=require(_0x3f86('0xe'));var authService=require(_0x3f86('0xf'));var qs=require(_0x3f86('0x10'));var as=require(_0x3f86('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f86('0x12'))(_0x3f86('0x13'));var utils=require(_0x3f86('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3f86('0x15'));var db=require(_0x3f86('0x16'))['db'];function respondWithStatusCode(_0x2305c3,_0x4ee597){_0x4ee597=_0x4ee597||0xcc;return function(_0xfc6c49){if(_0xfc6c49){return _0x2305c3['sendStatus'](_0x4ee597);}return _0x2305c3['status'](_0x4ee597)[_0x3f86('0x17')]();};}function respondWithResult(_0x3931e3,_0x44a93e){_0x44a93e=_0x44a93e||0xc8;return function(_0x4dbc63){if(_0x4dbc63){return _0x3931e3[_0x3f86('0x18')](_0x44a93e)[_0x3f86('0x19')](_0x4dbc63);}};}function respondWithFilteredResult(_0x234255,_0x11a177){return function(_0x4c5ac9){if(_0x4c5ac9){var _0x1d1b58=typeof _0x11a177[_0x3f86('0x1a')]===_0x3f86('0x1b')&&typeof _0x11a177[_0x3f86('0x1c')]===_0x3f86('0x1b');var _0x88dc14=_0x4c5ac9[_0x3f86('0x1d')];var _0x48ebd7=_0x1d1b58?0x0:_0x11a177['offset'];var _0x5edeed=_0x1d1b58?_0x4c5ac9['count']:_0x11a177[_0x3f86('0x1a')]+_0x11a177[_0x3f86('0x1c')];var _0x2f8b68;if(_0x5edeed>=_0x88dc14){_0x5edeed=_0x88dc14;_0x2f8b68=0xc8;}else{_0x2f8b68=0xce;}_0x234255[_0x3f86('0x18')](_0x2f8b68);return _0x234255['set'](_0x3f86('0x1e'),_0x48ebd7+'-'+_0x5edeed+'/'+_0x88dc14)[_0x3f86('0x19')](_0x4c5ac9);}return null;};}function patchUpdates(_0x50f627){return function(_0xf82623){try{jsonpatch[_0x3f86('0x1f')](_0xf82623,_0x50f627,!![]);}catch(_0x4b8689){return BPromise['reject'](_0x4b8689);}return _0xf82623[_0x3f86('0x20')]();};}function saveUpdates(_0x567164,_0xbf8d3e){return function(_0xf1093c){if(_0xf1093c){return _0xf1093c[_0x3f86('0x21')](_0x567164)['then'](function(_0x1813bc){return _0x1813bc;});}return null;};}function removeEntity(_0x179586,_0x40cfb8){return function(_0x105af9){if(_0x105af9){return _0x105af9[_0x3f86('0x22')]()[_0x3f86('0x23')](function(){_0x179586[_0x3f86('0x18')](0xcc)[_0x3f86('0x17')]();});}};}function handleEntityNotFound(_0x33f2f0,_0xecdc82){return function(_0x50a3ee){if(!_0x50a3ee){_0x33f2f0['sendStatus'](0x194);}return _0x50a3ee;};}function handleError(_0x310506,_0x56ebf5){_0x56ebf5=_0x56ebf5||0x1f4;return function(_0x144d4c){logger[_0x3f86('0x24')](_0x144d4c['stack']);if(_0x144d4c[_0x3f86('0x25')]){delete _0x144d4c[_0x3f86('0x25')];}_0x310506[_0x3f86('0x18')](_0x56ebf5)['send'](_0x144d4c);};}exports[_0x3f86('0x26')]=function(_0x5d667f,_0x3c31af){var _0x33376d={},_0x132963={},_0x387c06={'count':0x0,'rows':[]};var _0x39f2ad=_[_0x3f86('0x27')](db[_0x3f86('0x28')][_0x3f86('0x29')],function(_0x1af6b7){return{'name':_0x1af6b7['fieldName'],'type':_0x1af6b7['type']['key']};});_0x132963[_0x3f86('0x2a')]=_[_0x3f86('0x27')](_0x39f2ad,'name');_0x132963[_0x3f86('0x2b')]=_['keys'](_0x5d667f['query']);_0x132963['filters']=_[_0x3f86('0x2c')](_0x132963[_0x3f86('0x2a')],_0x132963['query']);_0x33376d[_0x3f86('0x2d')]=_[_0x3f86('0x2c')](_0x132963[_0x3f86('0x2a')],qs['fields'](_0x5d667f[_0x3f86('0x2b')]['fields']));_0x33376d['attributes']=_0x33376d['attributes'][_0x3f86('0x2e')]?_0x33376d[_0x3f86('0x2d')]:_0x132963[_0x3f86('0x2a')];if(!_0x5d667f['query'][_0x3f86('0x2f')](_0x3f86('0x30'))){_0x33376d[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x5d667f['query'][_0x3f86('0x1c')]);_0x33376d[_0x3f86('0x1a')]=qs['offset'](_0x5d667f['query'][_0x3f86('0x1a')]);}_0x33376d[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x5d667f['query']['sort']);_0x33376d[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x5d667f[_0x3f86('0x2b')],_0x132963[_0x3f86('0x34')]),_0x39f2ad);if(_0x5d667f[_0x3f86('0x2b')][_0x3f86('0x36')]){_0x33376d['where']=_['merge'](_0x33376d[_0x3f86('0x33')],{'$or':_[_0x3f86('0x27')](_0x39f2ad,function(_0x4c7d44){if(_0x4c7d44[_0x3f86('0x37')]!==_0x3f86('0x38')){var _0x4741ee={};_0x4741ee[_0x4c7d44['name']]={'$like':'%'+_0x5d667f[_0x3f86('0x2b')]['filter']+'%'};return _0x4741ee;}})});}_0x33376d=_[_0x3f86('0x39')]({},_0x33376d,_0x5d667f[_0x3f86('0x3a')]);var _0x35e922={'where':_0x33376d[_0x3f86('0x33')]};return db[_0x3f86('0x28')][_0x3f86('0x1d')](_0x35e922)[_0x3f86('0x23')](function(_0x10903f){_0x387c06[_0x3f86('0x1d')]=_0x10903f;if(_0x5d667f[_0x3f86('0x2b')][_0x3f86('0x3b')]){_0x33376d[_0x3f86('0x3c')]=[{'all':!![]}];}return db[_0x3f86('0x28')][_0x3f86('0x3d')](_0x33376d);})[_0x3f86('0x23')](function(_0x1b39fa){_0x387c06['rows']=_0x1b39fa;return _0x387c06;})[_0x3f86('0x23')](respondWithFilteredResult(_0x3c31af,_0x33376d))[_0x3f86('0x3e')](handleError(_0x3c31af,null));};exports['show']=function(_0x5e48a7,_0x1fabde){var _0x105bd4={'raw':![],'where':{'id':_0x5e48a7[_0x3f86('0x3f')]['id']}},_0x508e7d={};_0x508e7d['model']=_[_0x3f86('0x40')](db['Automation'][_0x3f86('0x29')]);_0x508e7d[_0x3f86('0x2b')]=_['keys'](_0x5e48a7['query']);_0x508e7d[_0x3f86('0x34')]=_['intersection'](_0x508e7d[_0x3f86('0x2a')],_0x508e7d[_0x3f86('0x2b')]);_0x105bd4['attributes']=_[_0x3f86('0x2c')](_0x508e7d[_0x3f86('0x2a')],qs[_0x3f86('0x41')](_0x5e48a7[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x105bd4['attributes']=_0x105bd4[_0x3f86('0x2d')]['length']?_0x105bd4[_0x3f86('0x2d')]:_0x508e7d['model'];if(_0x5e48a7[_0x3f86('0x2b')][_0x3f86('0x3b')]){_0x105bd4[_0x3f86('0x3c')]=[{'all':!![]}];}_0x105bd4=_['merge']({},_0x105bd4,_0x5e48a7['options']);return db[_0x3f86('0x28')][_0x3f86('0x42')](_0x105bd4)[_0x3f86('0x23')](handleEntityNotFound(_0x1fabde,null))[_0x3f86('0x23')](respondWithResult(_0x1fabde,null))[_0x3f86('0x3e')](handleError(_0x1fabde,null));};exports['create']=function(_0xc69856,_0x32693e){return db[_0x3f86('0x28')][_0x3f86('0x43')](_0xc69856[_0x3f86('0x44')],{})['then'](respondWithResult(_0x32693e,0xc9))[_0x3f86('0x3e')](handleError(_0x32693e,null));};exports[_0x3f86('0x21')]=function(_0x20ac90,_0x3c18de){if(_0x20ac90['body']['id']){delete _0x20ac90[_0x3f86('0x44')]['id'];}return db[_0x3f86('0x28')][_0x3f86('0x42')]({'where':{'id':_0x20ac90[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x3c18de,null))[_0x3f86('0x23')](saveUpdates(_0x20ac90['body'],null))['then'](respondWithResult(_0x3c18de,null))[_0x3f86('0x3e')](handleError(_0x3c18de,null));};exports['destroy']=function(_0x4a8225,_0x2783de){return db[_0x3f86('0x28')][_0x3f86('0x42')]({'where':{'id':_0x4a8225['params']['id']}})['then'](handleEntityNotFound(_0x2783de,null))[_0x3f86('0x23')](removeEntity(_0x2783de,null))['catch'](handleError(_0x2783de,null));};exports[_0x3f86('0x45')]=function(_0x107ab1,_0x25335e,_0x1db251){return db[_0x3f86('0x46')][_0x3f86('0x42')]({'where':{'id':_0x107ab1[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x25335e,null))[_0x3f86('0x23')](function(_0x564cae){if(_0x564cae){return _0x564cae['addConditions'](_0x107ab1[_0x3f86('0x44')]['ids'],_['omit'](_0x107ab1['body'],[_0x3f86('0x47'),'id'])||{});}})['then'](respondWithResult(_0x25335e,null))[_0x3f86('0x3e')](handleError(_0x25335e,null));};exports[_0x3f86('0x48')]=function(_0x475e5d,_0x1cad9d,_0x150661){var _0x7c3cc6={};var _0x1d9be1={};var _0x3475c3;var _0x2dc241;return db[_0x3f86('0x28')][_0x3f86('0x49')]({'where':{'id':_0x475e5d[_0x3f86('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1cad9d,null))[_0x3f86('0x23')](function(_0x490280){if(_0x490280){_0x3475c3=_0x490280;_0x1d9be1['model']=_[_0x3f86('0x40')](db[_0x3f86('0x46')]['rawAttributes']);_0x1d9be1['query']=_['keys'](_0x475e5d[_0x3f86('0x2b')]);_0x1d9be1[_0x3f86('0x34')]=_[_0x3f86('0x2c')](_0x1d9be1[_0x3f86('0x2a')],_0x1d9be1[_0x3f86('0x2b')]);_0x7c3cc6[_0x3f86('0x2d')]=_['intersection'](_0x1d9be1['model'],qs[_0x3f86('0x41')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x7c3cc6['attributes']=_0x7c3cc6[_0x3f86('0x2d')]['length']?_0x7c3cc6[_0x3f86('0x2d')]:_0x1d9be1[_0x3f86('0x2a')];_0x7c3cc6[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x32')]);_0x7c3cc6[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x475e5d['query'],_0x1d9be1['filters']));if(_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x36')]){_0x7c3cc6[_0x3f86('0x33')]=_['merge'](_0x7c3cc6[_0x3f86('0x33')],{'$or':_['map'](_0x7c3cc6[_0x3f86('0x2d')],function(_0x27fb06){var _0x147fe5={};_0x147fe5[_0x27fb06]={'$like':'%'+_0x475e5d['query']['filter']+'%'};return _0x147fe5;})});}_0x7c3cc6=_[_0x3f86('0x39')]({},_0x7c3cc6,_0x475e5d[_0x3f86('0x3a')]);return _0x3475c3[_0x3f86('0x48')](_0x7c3cc6);}})[_0x3f86('0x23')](function(_0x128426){if(_0x128426){_0x2dc241=_0x128426['length'];if(!_0x475e5d[_0x3f86('0x2b')]['hasOwnProperty'](_0x3f86('0x30'))){_0x7c3cc6[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x475e5d[_0x3f86('0x2b')]['limit']);_0x7c3cc6['offset']=qs[_0x3f86('0x1a')](_0x475e5d[_0x3f86('0x2b')][_0x3f86('0x1a')]);}return _0x3475c3[_0x3f86('0x48')](_0x7c3cc6);}})[_0x3f86('0x23')](function(_0xa34c1e){if(_0xa34c1e){return _0xa34c1e?{'count':_0x2dc241,'rows':_0xa34c1e}:null;}})[_0x3f86('0x23')](respondWithResult(_0x1cad9d,null))[_0x3f86('0x3e')](handleError(_0x1cad9d,null));};exports[_0x3f86('0x4a')]=function(_0x3e0b0f,_0x1d98a5,_0x1fb0e1){return db[_0x3f86('0x4b')]['find']({'where':{'id':_0x3e0b0f[_0x3f86('0x3f')]['id']}})[_0x3f86('0x23')](handleEntityNotFound(_0x1d98a5,null))[_0x3f86('0x23')](function(_0x46852c){if(_0x46852c){return _0x46852c['addActions'](_0x3e0b0f[_0x3f86('0x44')]['ids'],_[_0x3f86('0x4c')](_0x3e0b0f[_0x3f86('0x44')],['ids','id'])||{});}})[_0x3f86('0x23')](respondWithResult(_0x1d98a5,null))[_0x3f86('0x3e')](handleError(_0x1d98a5,null));};exports['getActions']=function(_0x422156,_0x41289c,_0x3d2571){var _0x20e3be={};var _0x36846b={};var _0x25e1ce;var _0x2de0b6;return db[_0x3f86('0x28')][_0x3f86('0x49')]({'where':{'id':_0x422156['params']['id']}})['then'](handleEntityNotFound(_0x41289c,null))['then'](function(_0x31c457){if(_0x31c457){_0x25e1ce=_0x31c457;_0x36846b[_0x3f86('0x2a')]=_[_0x3f86('0x40')](db['Action'][_0x3f86('0x29')]);_0x36846b[_0x3f86('0x2b')]=_[_0x3f86('0x40')](_0x422156[_0x3f86('0x2b')]);_0x36846b[_0x3f86('0x34')]=_[_0x3f86('0x2c')](_0x36846b['model'],_0x36846b[_0x3f86('0x2b')]);_0x20e3be['attributes']=_[_0x3f86('0x2c')](_0x36846b[_0x3f86('0x2a')],qs[_0x3f86('0x41')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x41')]));_0x20e3be[_0x3f86('0x2d')]=_0x20e3be[_0x3f86('0x2d')][_0x3f86('0x2e')]?_0x20e3be['attributes']:_0x36846b['model'];_0x20e3be[_0x3f86('0x31')]=qs[_0x3f86('0x32')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x32')]);_0x20e3be[_0x3f86('0x33')]=qs[_0x3f86('0x34')](_[_0x3f86('0x35')](_0x422156[_0x3f86('0x2b')],_0x36846b[_0x3f86('0x34')]));if(_0x422156[_0x3f86('0x2b')]['filter']){_0x20e3be[_0x3f86('0x33')]=_[_0x3f86('0x39')](_0x20e3be[_0x3f86('0x33')],{'$or':_[_0x3f86('0x27')](_0x20e3be[_0x3f86('0x2d')],function(_0x204c25){var _0x74c929={};_0x74c929[_0x204c25]={'$like':'%'+_0x422156[_0x3f86('0x2b')][_0x3f86('0x36')]+'%'};return _0x74c929;})});}_0x20e3be=_['merge']({},_0x20e3be,_0x422156[_0x3f86('0x3a')]);return _0x25e1ce[_0x3f86('0x4d')](_0x20e3be);}})[_0x3f86('0x23')](function(_0x2bc38c){if(_0x2bc38c){_0x2de0b6=_0x2bc38c[_0x3f86('0x2e')];if(!_0x422156[_0x3f86('0x2b')][_0x3f86('0x2f')]('nolimit')){_0x20e3be[_0x3f86('0x1c')]=qs[_0x3f86('0x1c')](_0x422156[_0x3f86('0x2b')]['limit']);_0x20e3be[_0x3f86('0x1a')]=qs[_0x3f86('0x1a')](_0x422156[_0x3f86('0x2b')][_0x3f86('0x1a')]);}return _0x25e1ce['getActions'](_0x20e3be);}})[_0x3f86('0x23')](function(_0x24bc4f){if(_0x24bc4f){return _0x24bc4f?{'count':_0x2de0b6,'rows':_0x24bc4f}:null;}})[_0x3f86('0x23')](respondWithResult(_0x41289c,null))[_0x3f86('0x3e')](handleError(_0x41289c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index f822ed5..badc48c 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 _0x1120=['api','moment','request-promise','path','rimraf','./automation.attributes','define','Automation','lodash','../../config/logger'];(function(_0x31eb3a,_0x35252b){var _0x6a1f37=function(_0x2465c0){while(--_0x2465c0){_0x31eb3a['push'](_0x31eb3a['shift']());}};_0x6a1f37(++_0x35252b);}(_0x1120,0x1e8));var _0x0112=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x1120[_0x26f1b2];return _0x1624a4;};'use strict';var _=require(_0x0112('0x0'));var util=require('util');var logger=require(_0x0112('0x1'))(_0x0112('0x2'));var moment=require(_0x0112('0x3'));var BPromise=require('bluebird');var rp=require(_0x0112('0x4'));var fs=require('fs');var path=require(_0x0112('0x5'));var rimraf=require(_0x0112('0x6'));var config=require('../../config/environment');var attributes=require(_0x0112('0x7'));module['exports']=function(_0x1b8253,_0x44cc3e){return _0x1b8253[_0x0112('0x8')](_0x0112('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42f2=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Automation','lodash','../../config/logger'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x42f2,0xb2));var _0x242f=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x42f2[_0x35d59c];return _0x18cd27;};'use strict';var _=require(_0x242f('0x0'));var util=require('util');var logger=require(_0x242f('0x1'))(_0x242f('0x2'));var moment=require(_0x242f('0x3'));var BPromise=require(_0x242f('0x4'));var rp=require(_0x242f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x242f('0x6'));var config=require(_0x242f('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x4f797d,_0x1bab25){return _0x4f797d[_0x242f('0x8')](_0x242f('0x9'),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 1d3c581..4244804 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 _0xd232=['then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request'];(function(_0x5c611d,_0x2c7cd1){var _0x33d959=function(_0x530c1e){while(--_0x530c1e){_0x5c611d['push'](_0x5c611d['shift']());}};_0x33d959(++_0x2c7cd1);}(_0xd232,0x74));var _0x2d23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd232[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d23('0x0'));var util=require('util');var moment=require(_0x2d23('0x1'));var BPromise=require(_0x2d23('0x2'));var rs=require(_0x2d23('0x3'));var fs=require('fs');var Redis=require(_0x2d23('0x4'));var db=require(_0x2d23('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2d23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d23('0x7')][_0x2d23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15c735,_0x53ac18,_0x18cac8){return new BPromise(function(_0x4cf7f4,_0x2c4667){return client[_0x2d23('0x9')](_0x15c735,_0x18cac8)[_0x2d23('0xa')](function(_0x7847cb){logger[_0x2d23('0xb')](_0x2d23('0xc'),_0x53ac18,_0x2d23('0xd'));logger['debug'](_0x2d23('0xe'),_0x53ac18,_0x2d23('0xd'),JSON[_0x2d23('0xf')](_0x7847cb));if(_0x7847cb[_0x2d23('0x10')]){if(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x11')]===0x1f4){logger[_0x2d23('0x10')](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x2c4667(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}logger['error'](_0x2d23('0xc'),_0x53ac18,_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);return _0x4cf7f4(_0x7847cb[_0x2d23('0x10')][_0x2d23('0x12')]);}else{logger['info'](_0x2d23('0xc'),_0x53ac18,'request\x20sent');_0x4cf7f4(_0x7847cb[_0x2d23('0x13')]['message']);}})[_0x2d23('0x14')](function(_0x30b578){logger['error']('Automation,\x20%s,\x20%s',_0x53ac18,_0x30b578);_0x2c4667(_0x30b578);});});} \ No newline at end of file +var _0x9512=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x30afe5,_0x509ed8){var _0x2a240d=function(_0x5b0f6f){while(--_0x5b0f6f){_0x30afe5['push'](_0x30afe5['shift']());}};_0x2a240d(++_0x509ed8);}(_0x9512,0x75));var _0x2951=function(_0x353f52,_0xe40124){_0x353f52=_0x353f52-0x0;var _0x44e3ec=_0x9512[_0x353f52];return _0x44e3ec;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b50d9,_0x59d947,_0x2c2c11){return new BPromise(function(_0x2c5ad6,_0x3e1a01){return client[_0x2951('0xd')](_0x1b50d9,_0x2c2c11)[_0x2951('0xe')](function(_0x113b97){logger['info'](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));logger[_0x2951('0x11')](_0x2951('0x12'),_0x59d947,'request\x20sent',JSON[_0x2951('0x13')](_0x113b97));if(_0x113b97[_0x2951('0x14')]){if(_0x113b97[_0x2951('0x14')][_0x2951('0x15')]===0x1f4){logger[_0x2951('0x14')]('Automation,\x20%s,\x20%s',_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x3e1a01(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x2c5ad6(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}else{logger[_0x2951('0x17')](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));_0x2c5ad6(_0x113b97['result'][_0x2951('0x16')]);}})[_0x2951('0x18')](function(_0x18e89d){logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x18e89d);_0x3e1a01(_0x18e89d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index f0647d3..bb1b338 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 _0x0eec=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x2b2aad,_0x8c10ec){var _0x5b3d53=function(_0x21d40b){while(--_0x21d40b){_0x2b2aad['push'](_0x2b2aad['shift']());}};_0x5b3d53(++_0x8c10ec);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc0ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc0ee('0x1'));var express=require(_0xc0ee('0x2'));var router=express[_0xc0ee('0x3')]();var fs_extra=require(_0xc0ee('0x4'));var auth=require(_0xc0ee('0x5'));var interaction=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var controller=require('./automation.controller');router[_0xc0ee('0x8')]('/',auth['isAuthenticated'](),controller[_0xc0ee('0x9')]);router[_0xc0ee('0x8')](_0xc0ee('0xa'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0xc')]);router[_0xc0ee('0x8')](_0xc0ee('0xd'),auth['isAuthenticated'](),controller[_0xc0ee('0xe')]);router[_0xc0ee('0x8')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x10')]);router[_0xc0ee('0x11')]('/',auth[_0xc0ee('0xb')](),controller['create']);router[_0xc0ee('0x11')](_0xc0ee('0xd'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x12')]);router[_0xc0ee('0x11')](_0xc0ee('0xf'),auth[_0xc0ee('0xb')](),controller[_0xc0ee('0x13')]);router[_0xc0ee('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc0ee('0x15')]);router[_0xc0ee('0x16')](_0xc0ee('0xa'),auth['isAuthenticated'](),controller[_0xc0ee('0x17')]);module[_0xc0ee('0x18')]=router; \ No newline at end of file +var _0xd4d1=['/:id/actions','addActions','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','getConditions','getActions','post','create','/:id/conditions','addConditions'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd4d1,0x123));var _0x1d4d=function(_0x51bb55,_0x336b3f){_0x51bb55=_0x51bb55-0x0;var _0x417ad5=_0xd4d1[_0x51bb55];return _0x417ad5;};'use strict';var multer=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var path=require(_0x1d4d('0x2'));var timeout=require(_0x1d4d('0x3'));var express=require(_0x1d4d('0x4'));var router=express['Router']();var fs_extra=require(_0x1d4d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1d4d('0x6'));var config=require('../../config/environment');var controller=require(_0x1d4d('0x7'));router['get']('/',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x9')]);router[_0x1d4d('0xa')]('/:id',auth[_0x1d4d('0x8')](),controller['show']);router[_0x1d4d('0xa')]('/:id/conditions',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0xb')]);router[_0x1d4d('0xa')]('/:id/actions',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0xc')]);router[_0x1d4d('0xd')]('/',auth['isAuthenticated'](),controller[_0x1d4d('0xe')]);router[_0x1d4d('0xd')](_0x1d4d('0xf'),auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x10')]);router[_0x1d4d('0xd')](_0x1d4d('0x11'),auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x12')]);router[_0x1d4d('0x13')]('/:id',auth[_0x1d4d('0x8')](),controller[_0x1d4d('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1d4d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3d5f548..6923b4c 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 _0xecac=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xecac,0x100));var _0xceca=function(_0x20503d,_0x330ec7){_0x20503d=_0x20503d-0x0;var _0x4ba008=_0xecac[_0x20503d];return _0x4ba008;};'use strict';var Sequelize=require(_0xceca('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xceca('0x1')](_0xceca('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xceca('0x3')]},'active':{'type':Sequelize[_0xceca('0x4')],'defaultValue':0x0,'comment':_0xceca('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceca('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceca('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceca('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xceca('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xceca('0x1')]('always',_0xceca('0x11'),'onlyIfOpen'),'defaultValue':_0xceca('0x12')},'dialAMDActive':{'type':Sequelize[_0xceca('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xceca('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceca('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceca('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceca('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xceca('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceca('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xceca('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceca('0x9')](0x9)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xceca('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceca('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceca('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xceca('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceca('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xceca('0x1b')),'defaultValue':_0xceca('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceca('0x1d')},'dialCutDigit':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceca('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceca('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xceca('0x9')](0x3)[_0xceca('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceca('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceca('0x9')](0x5)[_0xceca('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xad9f=['#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Greeting'];(function(_0x130421,_0x37aae2){var _0x39ea72=function(_0x5a663c){while(--_0x5a663c){_0x130421['push'](_0x130421['shift']());}};_0x39ea72(++_0x37aae2);}(_0xad9f,0x1be));var _0xfad9=function(_0x1053ba,_0xc98f10){_0x1053ba=_0x1053ba-0x0;var _0x233aae=_0xad9f[_0x1053ba];return _0x233aae;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'name':{'type':Sequelize[_0xfad9('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x4')),'allowNull':![],'defaultValue':_0xfad9('0x4')},'description':{'type':Sequelize[_0xfad9('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfad9('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xfad9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfad9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfad9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfad9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'comment':_0xfad9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfad9('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfad9('0x2')],'defaultValue':_0xfad9('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x11'),_0xfad9('0x12'),_0xfad9('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xfad9('0x14')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xfad9('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfad9('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfad9('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfad9('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfad9('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfad9('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfad9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfad9('0x8')](0x9)[_0xfad9('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfad9('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfad9('0x3')](_0xfad9('0x1c'),_0xfad9('0x1d')),'defaultValue':_0xfad9('0x1c')},'dialPrefix':{'type':Sequelize[_0xfad9('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfad9('0x1e')},'dialCutDigit':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfad9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfad9('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfad9('0x8')](0x3)[_0xfad9('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfad9('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfad9('0x8')](0x5)[_0xfad9('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 45ac236..3600db9 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 _0x74f6=['error','clone','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','nolimit','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','get','IvrCampaigns','stack','name','index','Campaign','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','merge','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x74f6,0x1c7));var _0x674f=function(_0xbc2171,_0x221a0e){_0xbc2171=_0xbc2171-0x0;var _0x136702=_0x74f6[_0xbc2171];return _0x136702;};'use strict';var emlformat=require(_0x674f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x674f('0x1'));var jsonpatch=require(_0x674f('0x2'));var rp=require(_0x674f('0x3'));var moment=require(_0x674f('0x4'));var BPromise=require(_0x674f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x674f('0x6'));var fs=require('fs');var fs_extra=require(_0x674f('0x7'));var _=require(_0x674f('0x8'));var squel=require(_0x674f('0x9'));var crypto=require(_0x674f('0xa'));var jsforce=require(_0x674f('0xb'));var deskjs=require(_0x674f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x674f('0xd'));var Papa=require(_0x674f('0xe'));var Redis=require(_0x674f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x674f('0x10'));var as=require(_0x674f('0x11'));var hardwareService=require(_0x674f('0x12'));var logger=require(_0x674f('0x13'))(_0x674f('0x14'));var utils=require(_0x674f('0x15'));var config=require(_0x674f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x674f('0x17'))['db'];function respondWithStatusCode(_0x40408c,_0x231e64){_0x231e64=_0x231e64||0xcc;return function(_0x1a0f20){if(_0x1a0f20){return _0x40408c[_0x674f('0x18')](_0x231e64);}return _0x40408c[_0x674f('0x19')](_0x231e64)[_0x674f('0x1a')]();};}function respondWithResult(_0x396fdb,_0x3eeac7){_0x3eeac7=_0x3eeac7||0xc8;return function(_0x3fe233){if(_0x3fe233){return _0x396fdb[_0x674f('0x19')](_0x3eeac7)[_0x674f('0x1b')](_0x3fe233);}};}function respondWithFilteredResult(_0x7da3b8,_0x5bd350){return function(_0x40d04d){if(_0x40d04d){var _0xfa05d6=typeof _0x5bd350[_0x674f('0x1c')]===_0x674f('0x1d')&&typeof _0x5bd350['limit']===_0x674f('0x1d');var _0x527741=_0x40d04d[_0x674f('0x1e')];var _0x233f2a=_0xfa05d6?0x0:_0x5bd350[_0x674f('0x1c')];var _0x1edf74=_0xfa05d6?_0x40d04d[_0x674f('0x1e')]:_0x5bd350['offset']+_0x5bd350[_0x674f('0x1f')];var _0x3abc0e;if(_0x1edf74>=_0x527741){_0x1edf74=_0x527741;_0x3abc0e=0xc8;}else{_0x3abc0e=0xce;}_0x7da3b8['status'](_0x3abc0e);return _0x7da3b8['set']('Content-Range',_0x233f2a+'-'+_0x1edf74+'/'+_0x527741)[_0x674f('0x1b')](_0x40d04d);}return null;};}function patchUpdates(_0x55550b){return function(_0x15e388){try{jsonpatch[_0x674f('0x20')](_0x15e388,_0x55550b,!![]);}catch(_0x309521){return BPromise[_0x674f('0x21')](_0x309521);}return _0x15e388['save']();};}function saveUpdates(_0x131c65,_0x386c79){return function(_0x5b26e3){if(_0x5b26e3){return _0x5b26e3[_0x674f('0x22')](_0x131c65)[_0x674f('0x23')](function(_0x704209){return _0x704209;});}return null;};}function removeEntity(_0x5907dd,_0x65be90){return function(_0x7bbdda){if(_0x7bbdda){return _0x7bbdda[_0x674f('0x24')]()['then'](function(){var _0x2356c5=_0x7bbdda[_0x674f('0x25')]({'plain':!![]});var _0x3e0428=_0x674f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e0428,'resourceId':_0x2356c5['id']}})[_0x674f('0x23')](function(){return _0x7bbdda;});})[_0x674f('0x23')](function(){_0x5907dd['status'](0xcc)[_0x674f('0x1a')]();});}};}function handleEntityNotFound(_0x2f8765,_0x2084d0){return function(_0x328c70){if(!_0x328c70){_0x2f8765['sendStatus'](0x194);}return _0x328c70;};}function handleError(_0x48426c,_0x16a0c8){_0x16a0c8=_0x16a0c8||0x1f4;return function(_0x5678b0){logger['error'](_0x5678b0[_0x674f('0x27')]);if(_0x5678b0[_0x674f('0x28')]){delete _0x5678b0[_0x674f('0x28')];}_0x48426c['status'](_0x16a0c8)['send'](_0x5678b0);};}exports[_0x674f('0x29')]=function(_0x577969,_0x3fe337){var _0x85244e={},_0x176eb3={},_0x3430e3={'count':0x0,'rows':[]};var _0x45ed4f=_['map'](db[_0x674f('0x2a')]['rawAttributes'],function(_0x193466){return{'name':_0x193466['fieldName'],'type':_0x193466[_0x674f('0x2b')][_0x674f('0x2c')]};});_0x176eb3[_0x674f('0x2d')]=_[_0x674f('0x2e')](_0x45ed4f,_0x674f('0x28'));_0x176eb3[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x577969['query']);_0x176eb3['filters']=_[_0x674f('0x31')](_0x176eb3[_0x674f('0x2d')],_0x176eb3[_0x674f('0x2f')]);_0x85244e[_0x674f('0x32')]=_[_0x674f('0x31')](_0x176eb3[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x577969[_0x674f('0x2f')][_0x674f('0x33')]));_0x85244e['attributes']=_0x85244e[_0x674f('0x32')][_0x674f('0x34')]?_0x85244e[_0x674f('0x32')]:_0x176eb3[_0x674f('0x2d')];if(!_0x577969[_0x674f('0x2f')][_0x674f('0x35')]('nolimit')){_0x85244e[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x577969[_0x674f('0x2f')][_0x674f('0x1f')]);_0x85244e[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x577969[_0x674f('0x2f')][_0x674f('0x1c')]);}_0x85244e[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x577969[_0x674f('0x2f')]['sort']);_0x85244e[_0x674f('0x38')]=qs['filters'](_['pick'](_0x577969[_0x674f('0x2f')],_0x176eb3[_0x674f('0x39')]),_0x45ed4f);if(_0x577969[_0x674f('0x2f')]['filter']){_0x85244e[_0x674f('0x38')]=_['merge'](_0x85244e['where'],{'$or':_[_0x674f('0x2e')](_0x45ed4f,function(_0xed584){if(_0xed584[_0x674f('0x2b')]!==_0x674f('0x3a')){var _0x5419c9={};_0x5419c9[_0xed584[_0x674f('0x28')]]={'$like':'%'+_0x577969[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x5419c9;}})});}_0x85244e=_['merge']({},_0x85244e,_0x577969[_0x674f('0x3c')]);var _0x38b7f2={'where':_0x85244e[_0x674f('0x38')]};return db[_0x674f('0x2a')][_0x674f('0x1e')](_0x38b7f2)[_0x674f('0x23')](function(_0x52c324){_0x3430e3[_0x674f('0x1e')]=_0x52c324;if(_0x577969[_0x674f('0x2f')][_0x674f('0x3d')]){_0x85244e[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x2a')][_0x674f('0x3f')](_0x85244e);})['then'](function(_0x5e8271){_0x3430e3[_0x674f('0x40')]=_0x5e8271;return _0x3430e3;})['then'](respondWithFilteredResult(_0x3fe337,_0x85244e))['catch'](handleError(_0x3fe337,null));};exports['show']=function(_0x45a242,_0x4f279e){var _0x2800da={'raw':![],'where':{'id':_0x45a242[_0x674f('0x41')]['id']}},_0x369da3={};_0x369da3[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x2a')][_0x674f('0x42')]);_0x369da3['query']=_[_0x674f('0x30')](_0x45a242['query']);_0x369da3['filters']=_[_0x674f('0x31')](_0x369da3[_0x674f('0x2d')],_0x369da3['query']);_0x2800da[_0x674f('0x32')]=_[_0x674f('0x31')](_0x369da3[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x45a242[_0x674f('0x2f')][_0x674f('0x33')]));_0x2800da[_0x674f('0x32')]=_0x2800da[_0x674f('0x32')][_0x674f('0x34')]?_0x2800da[_0x674f('0x32')]:_0x369da3[_0x674f('0x2d')];if(_0x45a242[_0x674f('0x2f')]['includeAll']){_0x2800da[_0x674f('0x3e')]=[{'all':!![]}];}_0x2800da=_[_0x674f('0x43')]({},_0x2800da,_0x45a242[_0x674f('0x3c')]);return db[_0x674f('0x2a')]['find'](_0x2800da)[_0x674f('0x23')](handleEntityNotFound(_0x4f279e,null))[_0x674f('0x23')](respondWithResult(_0x4f279e,null))[_0x674f('0x44')](handleError(_0x4f279e,null));};exports[_0x674f('0x45')]=function(_0x202fc1,_0x1faa27){return db[_0x674f('0x2a')][_0x674f('0x45')](_0x202fc1[_0x674f('0x46')],{})[_0x674f('0x23')](function(_0x2215ff){var _0x2ed990=_0x202fc1[_0x674f('0x47')][_0x674f('0x25')]({'plain':!![]});if(!_0x2ed990)throw new Error(_0x674f('0x48'));if(_0x2ed990[_0x674f('0x49')]==='user'){var _0x37c090=_0x2215ff[_0x674f('0x25')]({'plain':!![]});var _0x533121=_0x674f('0x26');return db[_0x674f('0x4a')][_0x674f('0x4b')]({'where':{'name':_0x533121,'userProfileId':_0x2ed990['userProfileId']},'raw':!![]})[_0x674f('0x23')](function(_0x6d3b81){if(_0x6d3b81&&_0x6d3b81[_0x674f('0x4c')]===0x0){return db['UserProfileResource'][_0x674f('0x45')]({'name':_0x37c090['name'],'resourceId':_0x37c090['id'],'type':_0x6d3b81[_0x674f('0x28')],'sectionId':_0x6d3b81['id']},{})['then'](function(){return _0x2215ff;});}else{return _0x2215ff;}})[_0x674f('0x44')](function(_0x29be8e){logger[_0x674f('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29be8e);throw _0x29be8e;});}return _0x2215ff;})[_0x674f('0x23')](respondWithResult(_0x1faa27,0xc9))[_0x674f('0x44')](handleError(_0x1faa27,null));};exports[_0x674f('0x4e')]=function(_0x187172,_0x61491a){var _0x22fc25={'where':{'id':_0x187172[_0x674f('0x41')]['id']}},_0xe65d92={};_0xe65d92['model']=_[_0x674f('0x30')](db['Campaign']['rawAttributes']);_0x22fc25[_0x674f('0x32')]=_[_0x674f('0x31')](_0xe65d92[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x187172[_0x674f('0x2f')][_0x674f('0x33')]));_0x22fc25['attributes']=_0x22fc25[_0x674f('0x32')][_0x674f('0x34')]?_0x22fc25[_0x674f('0x32')]:_0xe65d92[_0x674f('0x2d')];if(_0x187172[_0x674f('0x2f')]['includeAll']){_0x22fc25[_0x674f('0x3e')]=[{'all':!![]}];}_0x22fc25=_[_0x674f('0x43')]({},_0x22fc25,_0x187172['options']);return db[_0x674f('0x2a')][_0x674f('0x4b')](_0x22fc25)[_0x674f('0x23')](handleEntityNotFound(_0x61491a,null))[_0x674f('0x23')](function(_0x77f76d){if(_0x77f76d){var _0x3b9610=_0x77f76d[_0x674f('0x25')]({'plain':!![]});_0x3b9610=qs[_0x674f('0x4f')](_0x3b9610,['id',_0x674f('0x50'),_0x674f('0x51')]);_0x187172[_0x674f('0x46')]=_['omit'](_0x187172[_0x674f('0x46')],['id',_0x674f('0x50'),_0x674f('0x51')]);return db[_0x674f('0x2a')][_0x674f('0x45')](_[_0x674f('0x43')](_0x3b9610,_0x187172[_0x674f('0x46')]),{'include':_0x187172['query'][_0x674f('0x3d')]?[{'all':!![]}]:undefined})[_0x674f('0x23')](function(_0x4d0e41){var _0x336647=_0x187172['user'][_0x674f('0x25')]({'plain':!![]});if(!_0x336647)throw new Error(_0x674f('0x48'));if(_0x336647[_0x674f('0x49')]===_0x674f('0x47')){var _0x5085d4=_0x4d0e41[_0x674f('0x25')]({'plain':!![]});var _0x27195f=_0x674f('0x26');return db['UserProfileSection'][_0x674f('0x4b')]({'where':{'name':_0x27195f,'userProfileId':_0x336647[_0x674f('0x52')]},'raw':!![]})[_0x674f('0x23')](function(_0x246d88){if(_0x246d88&&_0x246d88[_0x674f('0x4c')]===0x0){return db['UserProfileResource'][_0x674f('0x45')]({'name':_0x5085d4[_0x674f('0x28')],'resourceId':_0x5085d4['id'],'type':_0x246d88[_0x674f('0x28')],'sectionId':_0x246d88['id']},{})[_0x674f('0x23')](function(){return _0x4d0e41;});}else{return _0x4d0e41;}})[_0x674f('0x44')](function(_0x433790){logger[_0x674f('0x4d')](_0x674f('0x53'),_0x433790);throw _0x433790;});}return _0x4d0e41;});}})['then'](respondWithResult(_0x61491a,0xc9))[_0x674f('0x44')](handleError(_0x61491a,null));};exports[_0x674f('0x22')]=function(_0xd8dd01,_0x521f2b){if(_0xd8dd01[_0x674f('0x46')]['id']){delete _0xd8dd01['body']['id'];}return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0xd8dd01['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x521f2b,null))[_0x674f('0x23')](saveUpdates(_0xd8dd01[_0x674f('0x46')],null))['then'](respondWithResult(_0x521f2b,null))[_0x674f('0x44')](handleError(_0x521f2b,null));};exports[_0x674f('0x24')]=function(_0x368699,_0x3bd855){return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0x368699[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3bd855,null))['then'](removeEntity(_0x3bd855,null))[_0x674f('0x44')](handleError(_0x3bd855,null));};exports['getHoppers']=function(_0x220f9f,_0x5e472e,_0x472c4c){var _0x65b646={'raw':!![],'where':{}};var _0x150510={};var _0x74276b={'count':0x0,'rows':[]};return db[_0x674f('0x2a')]['findOne']({'where':{'id':_0x220f9f[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e472e,null))[_0x674f('0x23')](function(_0x28bbfa){if(_0x28bbfa){_0x150510['model']=_[_0x674f('0x30')](db[_0x674f('0x54')][_0x674f('0x42')]);_0x150510[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x220f9f[_0x674f('0x2f')]);_0x150510[_0x674f('0x39')]=_['intersection'](_0x150510['model'],_0x150510[_0x674f('0x2f')]);_0x65b646['attributes']=_[_0x674f('0x31')](_0x150510[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x220f9f[_0x674f('0x2f')][_0x674f('0x33')]));_0x65b646[_0x674f('0x32')]=_0x65b646['attributes'][_0x674f('0x34')]?_0x65b646['attributes']:_0x150510[_0x674f('0x2d')];if(!_0x220f9f[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x65b646[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x220f9f[_0x674f('0x2f')][_0x674f('0x1f')]);_0x65b646['offset']=qs['offset'](_0x220f9f[_0x674f('0x2f')]['offset']);}_0x65b646[_0x674f('0x36')]=qs['sort'](_0x220f9f[_0x674f('0x2f')][_0x674f('0x37')]);_0x65b646[_0x674f('0x38')]=qs['filters'](_[_0x674f('0x56')](_0x220f9f[_0x674f('0x2f')],_0x150510[_0x674f('0x39')]));_0x65b646[_0x674f('0x38')][_0x674f('0x57')]=_0x28bbfa['id'];if(_0x220f9f[_0x674f('0x2f')][_0x674f('0x3b')]){_0x65b646[_0x674f('0x38')]=_[_0x674f('0x43')](_0x65b646[_0x674f('0x38')],{'$or':_['map'](_0x65b646['attributes'],function(_0x10ebfe){var _0x37001={};_0x37001[_0x10ebfe]={'$like':'%'+_0x220f9f[_0x674f('0x2f')]['filter']+'%'};return _0x37001;})});}_0x65b646=_[_0x674f('0x43')]({},_0x65b646,_0x220f9f[_0x674f('0x3c')]);return db[_0x674f('0x54')][_0x674f('0x1e')]({'where':_0x65b646[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x3c61d8){_0x74276b[_0x674f('0x1e')]=_0x3c61d8;if(_0x220f9f['query']['includeAll']){_0x65b646[_0x674f('0x3e')]=[{'all':!![]}];}return db['CmHopper'][_0x674f('0x3f')](_0x65b646);})['then'](function(_0x215b2f){_0x74276b['rows']=_0x215b2f;return _0x74276b;});}})['then'](respondWithFilteredResult(_0x5e472e,_0x65b646))['catch'](handleError(_0x5e472e,null));};exports[_0x674f('0x58')]=function(_0x428535,_0x3be4f9,_0x102f1d){var _0x208ee8={'raw':!![],'where':{}};var _0x31f117={};var _0x118dd5={'count':0x0,'rows':[]};return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x428535[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3be4f9,null))[_0x674f('0x23')](function(_0x29b8cc){if(_0x29b8cc){_0x31f117[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5a')][_0x674f('0x42')]);_0x31f117[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x428535[_0x674f('0x2f')]);_0x31f117[_0x674f('0x39')]=_[_0x674f('0x31')](_0x31f117['model'],_0x31f117['query']);_0x208ee8[_0x674f('0x32')]=_[_0x674f('0x31')](_0x31f117['model'],qs[_0x674f('0x33')](_0x428535[_0x674f('0x2f')][_0x674f('0x33')]));_0x208ee8[_0x674f('0x32')]=_0x208ee8[_0x674f('0x32')][_0x674f('0x34')]?_0x208ee8[_0x674f('0x32')]:_0x31f117['model'];if(!_0x428535[_0x674f('0x2f')]['hasOwnProperty']('nolimit')){_0x208ee8[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x428535[_0x674f('0x2f')][_0x674f('0x1f')]);_0x208ee8['offset']=qs[_0x674f('0x1c')](_0x428535[_0x674f('0x2f')][_0x674f('0x1c')]);}_0x208ee8['order']=qs['sort'](_0x428535[_0x674f('0x2f')]['sort']);_0x208ee8['where']=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x428535['query'],_0x31f117['filters']));_0x208ee8[_0x674f('0x38')]['CampaignId']=_0x29b8cc['id'];if(_0x428535[_0x674f('0x2f')][_0x674f('0x3b')]){_0x208ee8[_0x674f('0x38')]=_[_0x674f('0x43')](_0x208ee8[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x208ee8['attributes'],function(_0x4e636c){var _0x2aa5db={};_0x2aa5db[_0x4e636c]={'$like':'%'+_0x428535[_0x674f('0x2f')]['filter']+'%'};return _0x2aa5db;})});}_0x208ee8=_[_0x674f('0x43')]({},_0x208ee8,_0x428535[_0x674f('0x3c')]);return db['CmHopperHistory'][_0x674f('0x1e')]({'where':_0x208ee8[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x24611a){_0x118dd5[_0x674f('0x1e')]=_0x24611a;if(_0x428535[_0x674f('0x2f')][_0x674f('0x3d')]){_0x208ee8[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5a')][_0x674f('0x3f')](_0x208ee8);})[_0x674f('0x23')](function(_0x495b41){_0x118dd5[_0x674f('0x40')]=_0x495b41;return _0x118dd5;});}})['then'](respondWithFilteredResult(_0x3be4f9,_0x208ee8))[_0x674f('0x44')](handleError(_0x3be4f9,null));};exports[_0x674f('0x5b')]=function(_0x5f8457,_0x2e645b,_0x1c3e2b){var _0x528783={'raw':!![],'where':{}};var _0x5ec4fe={};var _0x1c47ad={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5f8457[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x2e645b,null))[_0x674f('0x23')](function(_0x1dce8e){if(_0x1dce8e){_0x5ec4fe[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5c')][_0x674f('0x42')]);_0x5ec4fe[_0x674f('0x2f')]=_['keys'](_0x5f8457['query']);_0x5ec4fe[_0x674f('0x39')]=_[_0x674f('0x31')](_0x5ec4fe['model'],_0x5ec4fe[_0x674f('0x2f')]);_0x528783[_0x674f('0x32')]=_['intersection'](_0x5ec4fe[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x5f8457['query'][_0x674f('0x33')]));_0x528783[_0x674f('0x32')]=_0x528783[_0x674f('0x32')]['length']?_0x528783[_0x674f('0x32')]:_0x5ec4fe['model'];if(!_0x5f8457[_0x674f('0x2f')]['hasOwnProperty'](_0x674f('0x55'))){_0x528783['limit']=qs[_0x674f('0x1f')](_0x5f8457[_0x674f('0x2f')][_0x674f('0x1f')]);_0x528783[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x5f8457['query'][_0x674f('0x1c')]);}_0x528783['order']=qs[_0x674f('0x37')](_0x5f8457['query']['sort']);_0x528783[_0x674f('0x38')]=qs['filters'](_[_0x674f('0x56')](_0x5f8457[_0x674f('0x2f')],_0x5ec4fe['filters']));_0x528783['where'][_0x674f('0x57')]=_0x1dce8e['id'];if(_0x5f8457['query'][_0x674f('0x3b')]){_0x528783[_0x674f('0x38')]=_[_0x674f('0x43')](_0x528783['where'],{'$or':_[_0x674f('0x2e')](_0x528783[_0x674f('0x32')],function(_0x362dcf){var _0x170de8={};_0x170de8[_0x362dcf]={'$like':'%'+_0x5f8457[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x170de8;})});}_0x528783=_[_0x674f('0x43')]({},_0x528783,_0x5f8457['options']);return db[_0x674f('0x5c')][_0x674f('0x1e')]({'where':_0x528783[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x566278){_0x1c47ad[_0x674f('0x1e')]=_0x566278;if(_0x5f8457[_0x674f('0x2f')][_0x674f('0x3d')]){_0x528783[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5c')][_0x674f('0x3f')](_0x528783);})[_0x674f('0x23')](function(_0x4916aa){_0x1c47ad[_0x674f('0x40')]=_0x4916aa;return _0x1c47ad;});}})[_0x674f('0x23')](respondWithFilteredResult(_0x2e645b,_0x528783))[_0x674f('0x44')](handleError(_0x2e645b,null));};exports['getHopperBlacks']=function(_0x57715f,_0x214676,_0xd527d3){var _0x271c41={'raw':!![],'where':{}};var _0x5397b4={};var _0x235aed={'count':0x0,'rows':[]};return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x57715f[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x214676,null))[_0x674f('0x23')](function(_0x1f5ff4){if(_0x1f5ff4){_0x5397b4['model']=_[_0x674f('0x30')](db[_0x674f('0x5d')][_0x674f('0x42')]);_0x5397b4[_0x674f('0x2f')]=_[_0x674f('0x30')](_0x57715f[_0x674f('0x2f')]);_0x5397b4[_0x674f('0x39')]=_['intersection'](_0x5397b4['model'],_0x5397b4['query']);_0x271c41['attributes']=_[_0x674f('0x31')](_0x5397b4[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x57715f[_0x674f('0x2f')][_0x674f('0x33')]));_0x271c41['attributes']=_0x271c41['attributes']['length']?_0x271c41[_0x674f('0x32')]:_0x5397b4[_0x674f('0x2d')];if(!_0x57715f[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x271c41[_0x674f('0x1f')]=qs['limit'](_0x57715f[_0x674f('0x2f')][_0x674f('0x1f')]);_0x271c41[_0x674f('0x1c')]=qs['offset'](_0x57715f[_0x674f('0x2f')]['offset']);}_0x271c41[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x57715f[_0x674f('0x2f')]['sort']);_0x271c41['where']=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x57715f[_0x674f('0x2f')],_0x5397b4['filters']));_0x271c41['where'][_0x674f('0x57')]=_0x1f5ff4['id'];if(_0x57715f[_0x674f('0x2f')][_0x674f('0x3b')]){_0x271c41[_0x674f('0x38')]=_[_0x674f('0x43')](_0x271c41[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x271c41[_0x674f('0x32')],function(_0x1a4946){var _0x3319f9={};_0x3319f9[_0x1a4946]={'$like':'%'+_0x57715f[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x3319f9;})});}_0x271c41=_['merge']({},_0x271c41,_0x57715f[_0x674f('0x3c')]);return db[_0x674f('0x5d')][_0x674f('0x1e')]({'where':_0x271c41[_0x674f('0x38')]})[_0x674f('0x23')](function(_0x1c9081){_0x235aed[_0x674f('0x1e')]=_0x1c9081;if(_0x57715f['query'][_0x674f('0x3d')]){_0x271c41[_0x674f('0x3e')]=[{'all':!![]}];}return db[_0x674f('0x5d')][_0x674f('0x3f')](_0x271c41);})[_0x674f('0x23')](function(_0x4b7cf6){_0x235aed['rows']=_0x4b7cf6;return _0x235aed;});}})[_0x674f('0x23')](respondWithFilteredResult(_0x214676,_0x271c41))[_0x674f('0x44')](handleError(_0x214676,null));};exports[_0x674f('0x5e')]=function(_0x366cfe,_0x46a9c2,_0x194297){var _0x546544={};var _0x13f10d={};var _0x1f775b;var _0xb8f06c;return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x366cfe['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x46a9c2,null))['then'](function(_0x51ffca){if(_0x51ffca){_0x1f775b=_0x51ffca;_0x13f10d[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5f')][_0x674f('0x42')]);_0x13f10d[_0x674f('0x2f')]=_['keys'](_0x366cfe[_0x674f('0x2f')]);_0x13f10d[_0x674f('0x39')]=_[_0x674f('0x31')](_0x13f10d[_0x674f('0x2d')],_0x13f10d['query']);_0x546544[_0x674f('0x32')]=_[_0x674f('0x31')](_0x13f10d[_0x674f('0x2d')],qs[_0x674f('0x33')](_0x366cfe[_0x674f('0x2f')][_0x674f('0x33')]));_0x546544['attributes']=_0x546544['attributes'][_0x674f('0x34')]?_0x546544[_0x674f('0x32')]:_0x13f10d[_0x674f('0x2d')];_0x546544[_0x674f('0x36')]=qs['sort'](_0x366cfe[_0x674f('0x2f')][_0x674f('0x37')]);_0x546544[_0x674f('0x38')]=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x366cfe['query'],_0x13f10d[_0x674f('0x39')]));if(_0x366cfe[_0x674f('0x2f')][_0x674f('0x3b')]){_0x546544[_0x674f('0x38')]=_[_0x674f('0x43')](_0x546544['where'],{'$or':_['map'](_0x546544[_0x674f('0x32')],function(_0x43df4a){var _0x5bf6dd={};_0x5bf6dd[_0x43df4a]={'$like':'%'+_0x366cfe['query']['filter']+'%'};return _0x5bf6dd;})});}_0x546544=_[_0x674f('0x43')]({},_0x546544,_0x366cfe[_0x674f('0x3c')]);return _0x1f775b[_0x674f('0x5e')](_0x546544);}})[_0x674f('0x23')](function(_0x38c16c){if(_0x38c16c){_0xb8f06c=_0x38c16c['length'];if(!_0x366cfe[_0x674f('0x2f')][_0x674f('0x35')](_0x674f('0x55'))){_0x546544['limit']=qs[_0x674f('0x1f')](_0x366cfe[_0x674f('0x2f')][_0x674f('0x1f')]);_0x546544[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x366cfe['query']['offset']);}return _0x1f775b[_0x674f('0x5e')](_0x546544);}})[_0x674f('0x23')](function(_0x261fa3){if(_0x261fa3){return _0x261fa3?{'count':_0xb8f06c,'rows':_0x261fa3}:null;}})['then'](respondWithResult(_0x46a9c2,null))['catch'](handleError(_0x46a9c2,null));};exports[_0x674f('0x60')]=function(_0xe48ab4,_0x3a47ba,_0xc5f4b0){var _0x1573e8,_0x3f499b;return db[_0x674f('0x2a')][_0x674f('0x4b')]({'where':{'id':_0xe48ab4[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3a47ba,null))[_0x674f('0x23')](function(_0x1d46e5){if(_0x1d46e5){_0x3f499b=_0x1d46e5;return _0x1d46e5[_0x674f('0x60')](_0xe48ab4['body'][_0x674f('0x61')],_[_0x674f('0x4f')](_0xe48ab4[_0x674f('0x46')],[_0x674f('0x61'),'id'])||{});}return null;})[_0x674f('0x62')](function(_0x31141e){var _0x15efe4;_0x1573e8=_0x31141e||[];var _0x41d094=[];if(_0x31141e){for(var _0x23613f=0x0;_0x23613f<_0x31141e[_0x674f('0x34')];_0x23613f+=0x1){var _0x3647b3=_0x31141e[_0x23613f]['get']({'plain':!![]});_0x3f499b[_0x674f('0x63')]=_0xe48ab4[_0x674f('0x46')][_0x674f('0x63')]?_0xe48ab4[_0x674f('0x46')][_0x674f('0x63')]:_0x3f499b[_0x674f('0x63')];switch(_0x3f499b['dialCheckDuplicateType']){case _0x674f('0x64'):_0x15efe4=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),'scheduledAt',_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),'createdAt',_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id',_0x674f('0x6a'))['field'](_0x3647b3['CmListId'][_0x674f('0x70')](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')](),_0x674f('0x57'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x50'))[_0x674f('0x6d')](_0x674f('0x6e'),'updatedAt')[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x3647b3[_0x674f('0x75')][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76'))[_0x674f('0x38')](_0x674f('0x77'),squel['select']()[_0x674f('0x6d')](_0x674f('0x78'))[_0x674f('0x71')](_0x674f('0x79'))['where'](_0x674f('0x7a'),_0xe48ab4['params']['id'][_0x674f('0x70')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x674f('0x6c')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x674f('0x67'))[_0x674f('0x38')]('CampaignId\x20=\x20?',_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')]())))[_0x674f('0x70')]();break;case _0x674f('0x7b'):_0x15efe4=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),_0x674f('0x6f'),_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),_0x674f('0x50'),_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')]('phone',_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id','ContactId')[_0x674f('0x6d')](_0x3647b3['CmListId']['toString'](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4['params']['id'][_0x674f('0x70')](),'CampaignId')['field']('NOW()',_0x674f('0x50'))['field'](_0x674f('0x6e'),_0x674f('0x51'))[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')]('ListId\x20=\x20?',_0x3647b3['CmListId'][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76'))[_0x674f('0x38')](_0x674f('0x77'),squel[_0x674f('0x6c')]()['field'](_0x674f('0x7c'))['from'](_0x674f('0x67'))[_0x674f('0x38')](_0x674f('0x7a'),_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')]())))['toString']();break;default:_0x15efe4=squel['insert']()[_0x674f('0x66')](_0x674f('0x67'))[_0x674f('0x68')]([_0x674f('0x69'),'scheduledAt','ContactId','ListId','CampaignId','createdAt',_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x6f'))[_0x674f('0x6d')]('id',_0x674f('0x6a'))[_0x674f('0x6d')](_0x3647b3[_0x674f('0x75')][_0x674f('0x70')](),_0x674f('0x6b'))[_0x674f('0x6d')](_0xe48ab4[_0x674f('0x41')]['id'][_0x674f('0x70')](),'CampaignId')[_0x674f('0x6d')](_0x674f('0x6e'),_0x674f('0x50'))[_0x674f('0x6d')]('NOW()',_0x674f('0x51'))[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x3647b3[_0x674f('0x75')][_0x674f('0x70')]())[_0x674f('0x38')](_0x674f('0x76')))[_0x674f('0x70')]();}_0x41d094['push'](db[_0x674f('0x7d')][_0x674f('0x2f')](_0x15efe4));}return BPromise[_0x674f('0x7e')](_0x41d094);}})['then'](function(){return _0x1573e8;})['then'](respondWithResult(_0x3a47ba,null))[_0x674f('0x44')](handleError(_0x3a47ba,null));};exports[_0x674f('0x7f')]=function(_0x44b3ed,_0x36c8f3,_0x5ebaa4){return db['Campaign'][_0x674f('0x4b')]({'where':{'id':_0x44b3ed['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x36c8f3,null))['then'](function(_0x6a14c1){if(_0x6a14c1){return _0x6a14c1[_0x674f('0x7f')](_0x44b3ed[_0x674f('0x2f')][_0x674f('0x61')]);}})[_0x674f('0x23')](function(_0x51ba3c){if(_0x51ba3c){return db[_0x674f('0x54')]['destroy']({'where':{'ListId':_0x44b3ed[_0x674f('0x2f')][_0x674f('0x61')],'CampaignId':_0x44b3ed[_0x674f('0x41')]['id']}})[_0x674f('0x23')](function(){return _0x51ba3c;});}})['then'](respondWithStatusCode(_0x36c8f3,null))[_0x674f('0x44')](handleError(_0x36c8f3,null));};exports['getBlackLists']=function(_0x3c0d67,_0x3adf6c,_0x6d1d56){var _0x43a935={};var _0x32ede7={};var _0x2654b7;var _0x23ffd6;return db[_0x674f('0x2a')][_0x674f('0x59')]({'where':{'id':_0x3c0d67[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x3adf6c,null))[_0x674f('0x23')](function(_0x4edcf2){if(_0x4edcf2){_0x2654b7=_0x4edcf2;_0x32ede7[_0x674f('0x2d')]=_[_0x674f('0x30')](db[_0x674f('0x5f')]['rawAttributes']);_0x32ede7['query']=_[_0x674f('0x30')](_0x3c0d67[_0x674f('0x2f')]);_0x32ede7['filters']=_[_0x674f('0x31')](_0x32ede7[_0x674f('0x2d')],_0x32ede7[_0x674f('0x2f')]);_0x43a935[_0x674f('0x32')]=_['intersection'](_0x32ede7[_0x674f('0x2d')],qs['fields'](_0x3c0d67[_0x674f('0x2f')]['fields']));_0x43a935[_0x674f('0x32')]=_0x43a935[_0x674f('0x32')][_0x674f('0x34')]?_0x43a935[_0x674f('0x32')]:_0x32ede7[_0x674f('0x2d')];_0x43a935[_0x674f('0x36')]=qs[_0x674f('0x37')](_0x3c0d67[_0x674f('0x2f')][_0x674f('0x37')]);_0x43a935[_0x674f('0x38')]=qs[_0x674f('0x39')](_[_0x674f('0x56')](_0x3c0d67[_0x674f('0x2f')],_0x32ede7[_0x674f('0x39')]));if(_0x3c0d67[_0x674f('0x2f')]['filter']){_0x43a935[_0x674f('0x38')]=_['merge'](_0x43a935[_0x674f('0x38')],{'$or':_[_0x674f('0x2e')](_0x43a935[_0x674f('0x32')],function(_0x54a6c1){var _0x3cc910={};_0x3cc910[_0x54a6c1]={'$like':'%'+_0x3c0d67[_0x674f('0x2f')][_0x674f('0x3b')]+'%'};return _0x3cc910;})});}_0x43a935=_['merge']({},_0x43a935,_0x3c0d67['options']);return _0x2654b7[_0x674f('0x80')](_0x43a935);}})[_0x674f('0x23')](function(_0x119970){if(_0x119970){_0x23ffd6=_0x119970[_0x674f('0x34')];if(!_0x3c0d67[_0x674f('0x2f')][_0x674f('0x35')]('nolimit')){_0x43a935[_0x674f('0x1f')]=qs[_0x674f('0x1f')](_0x3c0d67[_0x674f('0x2f')][_0x674f('0x1f')]);_0x43a935[_0x674f('0x1c')]=qs[_0x674f('0x1c')](_0x3c0d67['query'][_0x674f('0x1c')]);}return _0x2654b7['getBlackLists'](_0x43a935);}})[_0x674f('0x23')](function(_0x677c19){if(_0x677c19){return _0x677c19?{'count':_0x23ffd6,'rows':_0x677c19}:null;}})['then'](respondWithResult(_0x3adf6c,null))[_0x674f('0x44')](handleError(_0x3adf6c,null));};exports[_0x674f('0x81')]=function(_0x264544,_0xe7f6a2,_0x3b7f89){var _0x5aef65,_0x15f942;return db['Campaign'][_0x674f('0x4b')]({'where':{'id':_0x264544[_0x674f('0x41')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0xe7f6a2,null))['then'](function(_0x42deca){if(_0x42deca){_0x15f942=_0x42deca;return _0x42deca[_0x674f('0x81')](_0x264544[_0x674f('0x46')][_0x674f('0x61')],_[_0x674f('0x4f')](_0x264544[_0x674f('0x46')],[_0x674f('0x61'),'id'])||{});}return null;})[_0x674f('0x62')](function(_0x2bb03f){var _0x226808;_0x5aef65=_0x2bb03f||[];var _0x1ed27a=[];if(_0x2bb03f){for(var _0x5ef5f7=0x0;_0x5ef5f7<_0x2bb03f[_0x674f('0x34')];_0x5ef5f7+=0x1){var _0x5b7309=_0x2bb03f[_0x5ef5f7]['get']({'plain':!![]});_0x226808=squel[_0x674f('0x65')]()[_0x674f('0x66')](_0x674f('0x82'))['fromQuery']([_0x674f('0x69'),_0x674f('0x6a'),_0x674f('0x6b'),_0x674f('0x57'),_0x674f('0x50'),_0x674f('0x51')],squel[_0x674f('0x6c')]()[_0x674f('0x6d')](_0x674f('0x69'),_0x674f('0x69'))['field']('id',_0x674f('0x6a'))[_0x674f('0x6d')](_0x5b7309['CmListId']['toString'](),_0x674f('0x6b'))[_0x674f('0x6d')](_0x264544[_0x674f('0x41')]['id'][_0x674f('0x70')](),_0x674f('0x57'))[_0x674f('0x6d')](_0x674f('0x6e'),'createdAt')[_0x674f('0x6d')]('NOW()','updatedAt')[_0x674f('0x71')](_0x674f('0x72'))[_0x674f('0x38')](_0x674f('0x73'))[_0x674f('0x38')](_0x674f('0x74'),_0x5b7309[_0x674f('0x75')]['toString']())[_0x674f('0x38')](_0x674f('0x76')))['toString']();_0x1ed27a[_0x674f('0x83')](db[_0x674f('0x7d')][_0x674f('0x2f')](_0x226808));}return BPromise[_0x674f('0x7e')](_0x1ed27a);}})[_0x674f('0x23')](function(){return _0x5aef65;})['then'](respondWithResult(_0xe7f6a2,null))['catch'](handleError(_0xe7f6a2,null));};exports[_0x674f('0x84')]=function(_0xe9a280,_0x145b11,_0x2220a0){return db[_0x674f('0x2a')]['find']({'where':{'id':_0xe9a280[_0x674f('0x41')]['id']}})['then'](handleEntityNotFound(_0x145b11,null))[_0x674f('0x23')](function(_0x5e4071){if(_0x5e4071){return _0x5e4071[_0x674f('0x84')](_0xe9a280[_0x674f('0x2f')][_0x674f('0x61')]);}})['then'](function(_0x15243b){if(_0x15243b){return db[_0x674f('0x5d')]['destroy']({'where':{'ListId':_0xe9a280[_0x674f('0x2f')][_0x674f('0x61')],'CampaignId':_0xe9a280['params']['id']}})[_0x674f('0x23')](function(){return _0x15243b;});}})['then'](respondWithStatusCode(_0x145b11,null))[_0x674f('0x44')](handleError(_0x145b11,null));}; \ No newline at end of file +var _0x0b99=['end','json','undefined','limit','offset','count','apply','reject','save','update','then','get','IvrCampaigns','destroy','error','name','send','index','map','Campaign','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','order','sort','rows','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','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)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','cm_contacts','sequelize','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0b99,0x6c));var _0x90b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0b99[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x90b9('0x0'));var rimraf=require(_0x90b9('0x1'));var zipdir=require(_0x90b9('0x2'));var jsonpatch=require(_0x90b9('0x3'));var rp=require(_0x90b9('0x4'));var moment=require('moment');var BPromise=require(_0x90b9('0x5'));var Mustache=require(_0x90b9('0x6'));var util=require(_0x90b9('0x7'));var path=require(_0x90b9('0x8'));var sox=require(_0x90b9('0x9'));var csv=require(_0x90b9('0xa'));var ejs=require(_0x90b9('0xb'));var fs=require('fs');var fs_extra=require(_0x90b9('0xc'));var _=require('lodash');var squel=require(_0x90b9('0xd'));var crypto=require(_0x90b9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x90b9('0xf'));var toCsv=require(_0x90b9('0xa'));var querystring=require(_0x90b9('0x10'));var Papa=require('papaparse');var Redis=require(_0x90b9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x90b9('0x12'));var as=require(_0x90b9('0x13'));var hardwareService=require(_0x90b9('0x14'));var logger=require(_0x90b9('0x15'))(_0x90b9('0x16'));var utils=require('../../config/utils');var config=require(_0x90b9('0x17'));var licenseUtil=require(_0x90b9('0x18'));var db=require(_0x90b9('0x19'))['db'];function respondWithStatusCode(_0x605706,_0x32acc6){_0x32acc6=_0x32acc6||0xcc;return function(_0x5708bb){if(_0x5708bb){return _0x605706[_0x90b9('0x1a')](_0x32acc6);}return _0x605706[_0x90b9('0x1b')](_0x32acc6)[_0x90b9('0x1c')]();};}function respondWithResult(_0x4d99aa,_0x1a2fe9){_0x1a2fe9=_0x1a2fe9||0xc8;return function(_0x520abd){if(_0x520abd){return _0x4d99aa[_0x90b9('0x1b')](_0x1a2fe9)[_0x90b9('0x1d')](_0x520abd);}};}function respondWithFilteredResult(_0x357fb7,_0x41bc53){return function(_0x275f29){if(_0x275f29){var _0x26eb7f=typeof _0x41bc53['offset']===_0x90b9('0x1e')&&typeof _0x41bc53[_0x90b9('0x1f')]===_0x90b9('0x1e');var _0x3fa47b=_0x275f29['count'];var _0x20b499=_0x26eb7f?0x0:_0x41bc53[_0x90b9('0x20')];var _0x331cf0=_0x26eb7f?_0x275f29[_0x90b9('0x21')]:_0x41bc53[_0x90b9('0x20')]+_0x41bc53['limit'];var _0xc7cf8a;if(_0x331cf0>=_0x3fa47b){_0x331cf0=_0x3fa47b;_0xc7cf8a=0xc8;}else{_0xc7cf8a=0xce;}_0x357fb7[_0x90b9('0x1b')](_0xc7cf8a);return _0x357fb7['set']('Content-Range',_0x20b499+'-'+_0x331cf0+'/'+_0x3fa47b)[_0x90b9('0x1d')](_0x275f29);}return null;};}function patchUpdates(_0x3823a3){return function(_0x600ff1){try{jsonpatch[_0x90b9('0x22')](_0x600ff1,_0x3823a3,!![]);}catch(_0x57cf56){return BPromise[_0x90b9('0x23')](_0x57cf56);}return _0x600ff1[_0x90b9('0x24')]();};}function saveUpdates(_0xc1e793,_0x53f137){return function(_0x2a6f25){if(_0x2a6f25){return _0x2a6f25[_0x90b9('0x25')](_0xc1e793)[_0x90b9('0x26')](function(_0xca5d5f){return _0xca5d5f;});}return null;};}function removeEntity(_0x2e1dbc,_0x5676a2){return function(_0xdc0c3a){if(_0xdc0c3a){return _0xdc0c3a['destroy']()[_0x90b9('0x26')](function(){var _0x4f9f9a=_0xdc0c3a[_0x90b9('0x27')]({'plain':!![]});var _0x63f8bf=_0x90b9('0x28');return db['UserProfileResource'][_0x90b9('0x29')]({'where':{'type':_0x63f8bf,'resourceId':_0x4f9f9a['id']}})['then'](function(){return _0xdc0c3a;});})[_0x90b9('0x26')](function(){_0x2e1dbc[_0x90b9('0x1b')](0xcc)[_0x90b9('0x1c')]();});}};}function handleEntityNotFound(_0x5ebbb5,_0xe112b7){return function(_0xb4ce67){if(!_0xb4ce67){_0x5ebbb5[_0x90b9('0x1a')](0x194);}return _0xb4ce67;};}function handleError(_0x2aaeb4,_0x93044e){_0x93044e=_0x93044e||0x1f4;return function(_0xecbdb7){logger[_0x90b9('0x2a')](_0xecbdb7['stack']);if(_0xecbdb7[_0x90b9('0x2b')]){delete _0xecbdb7[_0x90b9('0x2b')];}_0x2aaeb4[_0x90b9('0x1b')](_0x93044e)[_0x90b9('0x2c')](_0xecbdb7);};}exports[_0x90b9('0x2d')]=function(_0x587c43,_0x4c5ec3){var _0x5aba6f={},_0x1ff9dd={},_0x295a52={'count':0x0,'rows':[]};var _0x176c98=_[_0x90b9('0x2e')](db[_0x90b9('0x2f')][_0x90b9('0x30')],function(_0x3a703d){return{'name':_0x3a703d['fieldName'],'type':_0x3a703d[_0x90b9('0x31')][_0x90b9('0x32')]};});_0x1ff9dd['model']=_[_0x90b9('0x2e')](_0x176c98,_0x90b9('0x2b'));_0x1ff9dd[_0x90b9('0x33')]=_['keys'](_0x587c43[_0x90b9('0x33')]);_0x1ff9dd[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x1ff9dd[_0x90b9('0x36')],_0x1ff9dd[_0x90b9('0x33')]);_0x5aba6f[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x1ff9dd[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x587c43[_0x90b9('0x33')][_0x90b9('0x38')]));_0x5aba6f[_0x90b9('0x37')]=_0x5aba6f[_0x90b9('0x37')][_0x90b9('0x39')]?_0x5aba6f[_0x90b9('0x37')]:_0x1ff9dd['model'];if(!_0x587c43[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x5aba6f[_0x90b9('0x1f')]=qs['limit'](_0x587c43[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x5aba6f[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x587c43[_0x90b9('0x33')][_0x90b9('0x20')]);}_0x5aba6f['order']=qs['sort'](_0x587c43[_0x90b9('0x33')]['sort']);_0x5aba6f['where']=qs['filters'](_[_0x90b9('0x3c')](_0x587c43[_0x90b9('0x33')],_0x1ff9dd[_0x90b9('0x34')]),_0x176c98);if(_0x587c43[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x5aba6f[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x5aba6f[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x176c98,function(_0x47a345){if(_0x47a345['type']!==_0x90b9('0x40')){var _0x37993c={};_0x37993c[_0x47a345[_0x90b9('0x2b')]]={'$like':'%'+_0x587c43[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x37993c;}})});}_0x5aba6f=_[_0x90b9('0x3f')]({},_0x5aba6f,_0x587c43[_0x90b9('0x41')]);var _0x2cdd84={'where':_0x5aba6f[_0x90b9('0x3e')]};return db[_0x90b9('0x2f')][_0x90b9('0x21')](_0x2cdd84)[_0x90b9('0x26')](function(_0x21f799){_0x295a52[_0x90b9('0x21')]=_0x21f799;if(_0x587c43['query'][_0x90b9('0x42')]){_0x5aba6f[_0x90b9('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x90b9('0x44')](_0x5aba6f);})['then'](function(_0x19805f){_0x295a52['rows']=_0x19805f;return _0x295a52;})['then'](respondWithFilteredResult(_0x4c5ec3,_0x5aba6f))[_0x90b9('0x45')](handleError(_0x4c5ec3,null));};exports[_0x90b9('0x46')]=function(_0x50204a,_0x443fa7){var _0x3f2233={'raw':![],'where':{'id':_0x50204a[_0x90b9('0x47')]['id']}},_0x410070={};_0x410070[_0x90b9('0x36')]=_[_0x90b9('0x48')](db[_0x90b9('0x2f')]['rawAttributes']);_0x410070['query']=_[_0x90b9('0x48')](_0x50204a[_0x90b9('0x33')]);_0x410070[_0x90b9('0x34')]=_['intersection'](_0x410070[_0x90b9('0x36')],_0x410070['query']);_0x3f2233[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x410070[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x50204a[_0x90b9('0x33')][_0x90b9('0x38')]));_0x3f2233[_0x90b9('0x37')]=_0x3f2233[_0x90b9('0x37')][_0x90b9('0x39')]?_0x3f2233[_0x90b9('0x37')]:_0x410070['model'];if(_0x50204a[_0x90b9('0x33')]['includeAll']){_0x3f2233[_0x90b9('0x43')]=[{'all':!![]}];}_0x3f2233=_[_0x90b9('0x3f')]({},_0x3f2233,_0x50204a[_0x90b9('0x41')]);return db[_0x90b9('0x2f')][_0x90b9('0x49')](_0x3f2233)['then'](handleEntityNotFound(_0x443fa7,null))['then'](respondWithResult(_0x443fa7,null))[_0x90b9('0x45')](handleError(_0x443fa7,null));};exports[_0x90b9('0x4a')]=function(_0x4629d6,_0x20d05c){return db[_0x90b9('0x2f')][_0x90b9('0x4a')](_0x4629d6[_0x90b9('0x4b')],{})[_0x90b9('0x26')](function(_0xfdcf28){var _0x26eaf6=_0x4629d6[_0x90b9('0x4c')][_0x90b9('0x27')]({'plain':!![]});if(!_0x26eaf6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26eaf6[_0x90b9('0x4d')]==='user'){var _0x47bd07=_0xfdcf28[_0x90b9('0x27')]({'plain':!![]});var _0x567e4a='IvrCampaigns';return db[_0x90b9('0x4e')]['find']({'where':{'name':_0x567e4a,'userProfileId':_0x26eaf6[_0x90b9('0x4f')]},'raw':!![]})[_0x90b9('0x26')](function(_0x31f362){if(_0x31f362&&_0x31f362[_0x90b9('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x47bd07[_0x90b9('0x2b')],'resourceId':_0x47bd07['id'],'type':_0x31f362[_0x90b9('0x2b')],'sectionId':_0x31f362['id']},{})['then'](function(){return _0xfdcf28;});}else{return _0xfdcf28;}})[_0x90b9('0x45')](function(_0x4910c5){logger[_0x90b9('0x2a')](_0x90b9('0x51'),_0x4910c5);throw _0x4910c5;});}return _0xfdcf28;})[_0x90b9('0x26')](respondWithResult(_0x20d05c,0xc9))['catch'](handleError(_0x20d05c,null));};exports['clone']=function(_0x1a5bf6,_0x375e2e){var _0x39d3f5={'where':{'id':_0x1a5bf6[_0x90b9('0x47')]['id']}},_0x343013={};_0x343013[_0x90b9('0x36')]=_['keys'](db[_0x90b9('0x2f')][_0x90b9('0x30')]);_0x39d3f5['attributes']=_[_0x90b9('0x35')](_0x343013[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0x1a5bf6['query']['fields']));_0x39d3f5[_0x90b9('0x37')]=_0x39d3f5[_0x90b9('0x37')][_0x90b9('0x39')]?_0x39d3f5[_0x90b9('0x37')]:_0x343013[_0x90b9('0x36')];if(_0x1a5bf6['query'][_0x90b9('0x42')]){_0x39d3f5[_0x90b9('0x43')]=[{'all':!![]}];}_0x39d3f5=_[_0x90b9('0x3f')]({},_0x39d3f5,_0x1a5bf6[_0x90b9('0x41')]);return db[_0x90b9('0x2f')][_0x90b9('0x49')](_0x39d3f5)[_0x90b9('0x26')](handleEntityNotFound(_0x375e2e,null))[_0x90b9('0x26')](function(_0x112ce9){if(_0x112ce9){var _0x2594dd=_0x112ce9[_0x90b9('0x27')]({'plain':!![]});_0x2594dd=qs[_0x90b9('0x52')](_0x2594dd,['id','createdAt',_0x90b9('0x53')]);_0x1a5bf6['body']=_[_0x90b9('0x52')](_0x1a5bf6[_0x90b9('0x4b')],['id',_0x90b9('0x54'),_0x90b9('0x53')]);return db['Campaign'][_0x90b9('0x4a')](_[_0x90b9('0x3f')](_0x2594dd,_0x1a5bf6[_0x90b9('0x4b')]),{'include':_0x1a5bf6[_0x90b9('0x33')][_0x90b9('0x42')]?[{'all':!![]}]:undefined})[_0x90b9('0x26')](function(_0x121308){var _0x11aef6=_0x1a5bf6[_0x90b9('0x4c')][_0x90b9('0x27')]({'plain':!![]});if(!_0x11aef6)throw new Error(_0x90b9('0x55'));if(_0x11aef6[_0x90b9('0x4d')]===_0x90b9('0x4c')){var _0x1d34a0=_0x121308[_0x90b9('0x27')]({'plain':!![]});var _0x47f693=_0x90b9('0x28');return db['UserProfileSection'][_0x90b9('0x49')]({'where':{'name':_0x47f693,'userProfileId':_0x11aef6[_0x90b9('0x4f')]},'raw':!![]})[_0x90b9('0x26')](function(_0x6863c7){if(_0x6863c7&&_0x6863c7[_0x90b9('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d34a0['name'],'resourceId':_0x1d34a0['id'],'type':_0x6863c7[_0x90b9('0x2b')],'sectionId':_0x6863c7['id']},{})[_0x90b9('0x26')](function(){return _0x121308;});}else{return _0x121308;}})[_0x90b9('0x45')](function(_0x35eac9){logger[_0x90b9('0x2a')](_0x90b9('0x51'),_0x35eac9);throw _0x35eac9;});}return _0x121308;});}})[_0x90b9('0x26')](respondWithResult(_0x375e2e,0xc9))[_0x90b9('0x45')](handleError(_0x375e2e,null));};exports[_0x90b9('0x25')]=function(_0x459b55,_0x493298){if(_0x459b55[_0x90b9('0x4b')]['id']){delete _0x459b55[_0x90b9('0x4b')]['id'];}return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x459b55[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x493298,null))[_0x90b9('0x26')](saveUpdates(_0x459b55[_0x90b9('0x4b')],null))['then'](respondWithResult(_0x493298,null))[_0x90b9('0x45')](handleError(_0x493298,null));};exports['destroy']=function(_0x574009,_0x2fdcdf){return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x574009[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fdcdf,null))[_0x90b9('0x26')](removeEntity(_0x2fdcdf,null))[_0x90b9('0x45')](handleError(_0x2fdcdf,null));};exports[_0x90b9('0x56')]=function(_0x2b2a0b,_0x12a967,_0x3f19da){var _0xec6d1c={'raw':!![],'where':{}};var _0x3c9098={};var _0x3bed87={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x2b2a0b[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x12a967,null))[_0x90b9('0x26')](function(_0x2a1acc){if(_0x2a1acc){_0x3c9098['model']=_[_0x90b9('0x48')](db[_0x90b9('0x57')]['rawAttributes']);_0x3c9098[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x2b2a0b[_0x90b9('0x33')]);_0x3c9098[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x3c9098[_0x90b9('0x36')],_0x3c9098[_0x90b9('0x33')]);_0xec6d1c[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x3c9098['model'],qs[_0x90b9('0x38')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x38')]));_0xec6d1c[_0x90b9('0x37')]=_0xec6d1c[_0x90b9('0x37')][_0x90b9('0x39')]?_0xec6d1c[_0x90b9('0x37')]:_0x3c9098[_0x90b9('0x36')];if(!_0x2b2a0b['query']['hasOwnProperty'](_0x90b9('0x3b'))){_0xec6d1c['limit']=qs[_0x90b9('0x1f')](_0x2b2a0b[_0x90b9('0x33')]['limit']);_0xec6d1c[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x20')]);}_0xec6d1c[_0x90b9('0x58')]=qs[_0x90b9('0x59')](_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x59')]);_0xec6d1c['where']=qs[_0x90b9('0x34')](_['pick'](_0x2b2a0b[_0x90b9('0x33')],_0x3c9098[_0x90b9('0x34')]));_0xec6d1c[_0x90b9('0x3e')]['CampaignId']=_0x2a1acc['id'];if(_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x3d')]){_0xec6d1c[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0xec6d1c[_0x90b9('0x3e')],{'$or':_['map'](_0xec6d1c[_0x90b9('0x37')],function(_0x1198b4){var _0x83f61f={};_0x83f61f[_0x1198b4]={'$like':'%'+_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x83f61f;})});}_0xec6d1c=_[_0x90b9('0x3f')]({},_0xec6d1c,_0x2b2a0b[_0x90b9('0x41')]);return db[_0x90b9('0x57')][_0x90b9('0x21')]({'where':_0xec6d1c[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x1a953a){_0x3bed87[_0x90b9('0x21')]=_0x1a953a;if(_0x2b2a0b[_0x90b9('0x33')][_0x90b9('0x42')]){_0xec6d1c[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x57')][_0x90b9('0x44')](_0xec6d1c);})[_0x90b9('0x26')](function(_0x21138b){_0x3bed87[_0x90b9('0x5a')]=_0x21138b;return _0x3bed87;});}})['then'](respondWithFilteredResult(_0x12a967,_0xec6d1c))['catch'](handleError(_0x12a967,null));};exports[_0x90b9('0x5b')]=function(_0x75305c,_0x411d8e,_0x1ed7b4){var _0xac41d={'raw':!![],'where':{}};var _0x16451f={};var _0x4cb514={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')][_0x90b9('0x5c')]({'where':{'id':_0x75305c[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x411d8e,null))[_0x90b9('0x26')](function(_0x44914b){if(_0x44914b){_0x16451f['model']=_[_0x90b9('0x48')](db[_0x90b9('0x5d')][_0x90b9('0x30')]);_0x16451f[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x75305c[_0x90b9('0x33')]);_0x16451f[_0x90b9('0x34')]=_['intersection'](_0x16451f[_0x90b9('0x36')],_0x16451f[_0x90b9('0x33')]);_0xac41d['attributes']=_['intersection'](_0x16451f[_0x90b9('0x36')],qs['fields'](_0x75305c[_0x90b9('0x33')]['fields']));_0xac41d[_0x90b9('0x37')]=_0xac41d[_0x90b9('0x37')][_0x90b9('0x39')]?_0xac41d[_0x90b9('0x37')]:_0x16451f['model'];if(!_0x75305c[_0x90b9('0x33')][_0x90b9('0x3a')]('nolimit')){_0xac41d[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x75305c[_0x90b9('0x33')][_0x90b9('0x1f')]);_0xac41d['offset']=qs['offset'](_0x75305c['query'][_0x90b9('0x20')]);}_0xac41d['order']=qs['sort'](_0x75305c[_0x90b9('0x33')][_0x90b9('0x59')]);_0xac41d[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_[_0x90b9('0x3c')](_0x75305c['query'],_0x16451f[_0x90b9('0x34')]));_0xac41d[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x44914b['id'];if(_0x75305c[_0x90b9('0x33')]['filter']){_0xac41d[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0xac41d[_0x90b9('0x3e')],{'$or':_['map'](_0xac41d[_0x90b9('0x37')],function(_0x5de29f){var _0x215e6a={};_0x215e6a[_0x5de29f]={'$like':'%'+_0x75305c[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x215e6a;})});}_0xac41d=_['merge']({},_0xac41d,_0x75305c[_0x90b9('0x41')]);return db[_0x90b9('0x5d')]['count']({'where':_0xac41d[_0x90b9('0x3e')]})['then'](function(_0x210b1d){_0x4cb514[_0x90b9('0x21')]=_0x210b1d;if(_0x75305c[_0x90b9('0x33')][_0x90b9('0x42')]){_0xac41d[_0x90b9('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x90b9('0x44')](_0xac41d);})['then'](function(_0x4db380){_0x4cb514[_0x90b9('0x5a')]=_0x4db380;return _0x4cb514;});}})[_0x90b9('0x26')](respondWithFilteredResult(_0x411d8e,_0xac41d))[_0x90b9('0x45')](handleError(_0x411d8e,null));};exports[_0x90b9('0x5f')]=function(_0x37b201,_0x5b5605,_0x212bdb){var _0x54c922={'raw':!![],'where':{}};var _0x10d484={};var _0x3f1c9f={'count':0x0,'rows':[]};return db[_0x90b9('0x2f')][_0x90b9('0x5c')]({'where':{'id':_0x37b201[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x5b5605,null))[_0x90b9('0x26')](function(_0x463a04){if(_0x463a04){_0x10d484[_0x90b9('0x36')]=_['keys'](db['CmHopperFinal'][_0x90b9('0x30')]);_0x10d484[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0x37b201[_0x90b9('0x33')]);_0x10d484[_0x90b9('0x34')]=_['intersection'](_0x10d484[_0x90b9('0x36')],_0x10d484[_0x90b9('0x33')]);_0x54c922[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x10d484[_0x90b9('0x36')],qs['fields'](_0x37b201[_0x90b9('0x33')][_0x90b9('0x38')]));_0x54c922[_0x90b9('0x37')]=_0x54c922[_0x90b9('0x37')][_0x90b9('0x39')]?_0x54c922[_0x90b9('0x37')]:_0x10d484[_0x90b9('0x36')];if(!_0x37b201[_0x90b9('0x33')][_0x90b9('0x3a')]('nolimit')){_0x54c922[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x37b201[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x54c922[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x37b201[_0x90b9('0x33')]['offset']);}_0x54c922[_0x90b9('0x58')]=qs['sort'](_0x37b201[_0x90b9('0x33')]['sort']);_0x54c922[_0x90b9('0x3e')]=qs['filters'](_[_0x90b9('0x3c')](_0x37b201['query'],_0x10d484['filters']));_0x54c922[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x463a04['id'];if(_0x37b201[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x54c922[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x54c922[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x54c922[_0x90b9('0x37')],function(_0x15fc95){var _0xeb714a={};_0xeb714a[_0x15fc95]={'$like':'%'+_0x37b201[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0xeb714a;})});}_0x54c922=_['merge']({},_0x54c922,_0x37b201[_0x90b9('0x41')]);return db[_0x90b9('0x60')][_0x90b9('0x21')]({'where':_0x54c922[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x9de99){_0x3f1c9f[_0x90b9('0x21')]=_0x9de99;if(_0x37b201[_0x90b9('0x33')][_0x90b9('0x42')]){_0x54c922[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x60')][_0x90b9('0x44')](_0x54c922);})['then'](function(_0x26f351){_0x3f1c9f[_0x90b9('0x5a')]=_0x26f351;return _0x3f1c9f;});}})['then'](respondWithFilteredResult(_0x5b5605,_0x54c922))[_0x90b9('0x45')](handleError(_0x5b5605,null));};exports[_0x90b9('0x61')]=function(_0xe601f4,_0x3bd441,_0x367472){var _0x270288={'raw':!![],'where':{}};var _0x2b1e2a={};var _0x50932d={'count':0x0,'rows':[]};return db['Campaign'][_0x90b9('0x5c')]({'where':{'id':_0xe601f4[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bd441,null))['then'](function(_0x59b8c3){if(_0x59b8c3){_0x2b1e2a['model']=_[_0x90b9('0x48')](db[_0x90b9('0x62')][_0x90b9('0x30')]);_0x2b1e2a[_0x90b9('0x33')]=_[_0x90b9('0x48')](_0xe601f4[_0x90b9('0x33')]);_0x2b1e2a[_0x90b9('0x34')]=_['intersection'](_0x2b1e2a[_0x90b9('0x36')],_0x2b1e2a[_0x90b9('0x33')]);_0x270288['attributes']=_['intersection'](_0x2b1e2a[_0x90b9('0x36')],qs[_0x90b9('0x38')](_0xe601f4[_0x90b9('0x33')][_0x90b9('0x38')]));_0x270288[_0x90b9('0x37')]=_0x270288[_0x90b9('0x37')]['length']?_0x270288['attributes']:_0x2b1e2a['model'];if(!_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x270288[_0x90b9('0x1f')]=qs['limit'](_0xe601f4['query'][_0x90b9('0x1f')]);_0x270288['offset']=qs['offset'](_0xe601f4['query'][_0x90b9('0x20')]);}_0x270288[_0x90b9('0x58')]=qs['sort'](_0xe601f4[_0x90b9('0x33')][_0x90b9('0x59')]);_0x270288[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_[_0x90b9('0x3c')](_0xe601f4[_0x90b9('0x33')],_0x2b1e2a[_0x90b9('0x34')]));_0x270288[_0x90b9('0x3e')][_0x90b9('0x5e')]=_0x59b8c3['id'];if(_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x270288['where']=_[_0x90b9('0x3f')](_0x270288['where'],{'$or':_['map'](_0x270288[_0x90b9('0x37')],function(_0x5ed635){var _0xa8e4b5={};_0xa8e4b5[_0x5ed635]={'$like':'%'+_0xe601f4[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0xa8e4b5;})});}_0x270288=_['merge']({},_0x270288,_0xe601f4['options']);return db['CmHopperBlack']['count']({'where':_0x270288[_0x90b9('0x3e')]})[_0x90b9('0x26')](function(_0x466fb7){_0x50932d[_0x90b9('0x21')]=_0x466fb7;if(_0xe601f4[_0x90b9('0x33')]['includeAll']){_0x270288[_0x90b9('0x43')]=[{'all':!![]}];}return db[_0x90b9('0x62')]['findAll'](_0x270288);})[_0x90b9('0x26')](function(_0x4fad60){_0x50932d[_0x90b9('0x5a')]=_0x4fad60;return _0x50932d;});}})[_0x90b9('0x26')](respondWithFilteredResult(_0x3bd441,_0x270288))[_0x90b9('0x45')](handleError(_0x3bd441,null));};exports[_0x90b9('0x63')]=function(_0x40d0e4,_0x169b87,_0x63b034){var _0x272f0f={};var _0x1e8310={};var _0x22466e;var _0x5171c5;return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x40d0e4['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x169b87,null))[_0x90b9('0x26')](function(_0x483e2){if(_0x483e2){_0x22466e=_0x483e2;_0x1e8310[_0x90b9('0x36')]=_[_0x90b9('0x48')](db[_0x90b9('0x64')][_0x90b9('0x30')]);_0x1e8310[_0x90b9('0x33')]=_['keys'](_0x40d0e4[_0x90b9('0x33')]);_0x1e8310[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x1e8310[_0x90b9('0x36')],_0x1e8310[_0x90b9('0x33')]);_0x272f0f[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x1e8310[_0x90b9('0x36')],qs['fields'](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x38')]));_0x272f0f[_0x90b9('0x37')]=_0x272f0f[_0x90b9('0x37')]['length']?_0x272f0f[_0x90b9('0x37')]:_0x1e8310[_0x90b9('0x36')];_0x272f0f['order']=qs[_0x90b9('0x59')](_0x40d0e4['query']['sort']);_0x272f0f[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_['pick'](_0x40d0e4['query'],_0x1e8310[_0x90b9('0x34')]));if(_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3d')]){_0x272f0f[_0x90b9('0x3e')]=_[_0x90b9('0x3f')](_0x272f0f[_0x90b9('0x3e')],{'$or':_['map'](_0x272f0f['attributes'],function(_0x52c6bd){var _0x360c4a={};_0x360c4a[_0x52c6bd]={'$like':'%'+_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x360c4a;})});}_0x272f0f=_[_0x90b9('0x3f')]({},_0x272f0f,_0x40d0e4[_0x90b9('0x41')]);return _0x22466e['getLists'](_0x272f0f);}})[_0x90b9('0x26')](function(_0x5d6f49){if(_0x5d6f49){_0x5171c5=_0x5d6f49['length'];if(!_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x3a')](_0x90b9('0x3b'))){_0x272f0f[_0x90b9('0x1f')]=qs[_0x90b9('0x1f')](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x1f')]);_0x272f0f[_0x90b9('0x20')]=qs[_0x90b9('0x20')](_0x40d0e4[_0x90b9('0x33')][_0x90b9('0x20')]);}return _0x22466e[_0x90b9('0x63')](_0x272f0f);}})[_0x90b9('0x26')](function(_0x99766f){if(_0x99766f){return _0x99766f?{'count':_0x5171c5,'rows':_0x99766f}:null;}})[_0x90b9('0x26')](respondWithResult(_0x169b87,null))[_0x90b9('0x45')](handleError(_0x169b87,null));};exports[_0x90b9('0x65')]=function(_0x52bd13,_0x5653eb,_0x405d87){var _0x3ce141,_0x3e116b;return db[_0x90b9('0x2f')]['find']({'where':{'id':_0x52bd13[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x5653eb,null))[_0x90b9('0x26')](function(_0x82e25){if(_0x82e25){_0x3e116b=_0x82e25;return _0x82e25[_0x90b9('0x65')](_0x52bd13['body']['ids'],_[_0x90b9('0x52')](_0x52bd13[_0x90b9('0x4b')],[_0x90b9('0x66'),'id'])||{});}return null;})[_0x90b9('0x67')](function(_0x193699){var _0x3934c3;_0x3ce141=_0x193699||[];var _0x4d503b=[];if(_0x193699){for(var _0x1e27c7=0x0;_0x1e27c7<_0x193699[_0x90b9('0x39')];_0x1e27c7+=0x1){var _0x38f686=_0x193699[_0x1e27c7][_0x90b9('0x27')]({'plain':!![]});_0x3e116b['dialCheckDuplicateType']=_0x52bd13[_0x90b9('0x4b')][_0x90b9('0x68')]?_0x52bd13[_0x90b9('0x4b')][_0x90b9('0x68')]:_0x3e116b[_0x90b9('0x68')];switch(_0x3e116b['dialCheckDuplicateType']){case'always':_0x3934c3=squel['insert']()[_0x90b9('0x69')](_0x90b9('0x6a'))['fromQuery']([_0x90b9('0x6b'),_0x90b9('0x6c'),_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel[_0x90b9('0x6f')]()[_0x90b9('0x70')]('phone',_0x90b9('0x6b'))[_0x90b9('0x70')]('NOW()',_0x90b9('0x6c'))[_0x90b9('0x70')]('id',_0x90b9('0x6d'))['field'](_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')](),'CampaignId')[_0x90b9('0x70')](_0x90b9('0x73'),'createdAt')[_0x90b9('0x70')](_0x90b9('0x73'),'updatedAt')[_0x90b9('0x74')]('cm_contacts')[_0x90b9('0x3e')](_0x90b9('0x75'))['where'](_0x90b9('0x76'),_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')](_0x90b9('0x77'))[_0x90b9('0x3e')](_0x90b9('0x78'),squel['select']()['field'](_0x90b9('0x79'))[_0x90b9('0x74')](_0x90b9('0x7a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')]()))[_0x90b9('0x3e')](_0x90b9('0x78'),squel[_0x90b9('0x6f')]()[_0x90b9('0x70')](_0x90b9('0x7c'))[_0x90b9('0x74')](_0x90b9('0x6a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13['params']['id'][_0x90b9('0x72')]())))[_0x90b9('0x72')]();break;case'onlyIfOpen':_0x3934c3=squel[_0x90b9('0x7d')]()[_0x90b9('0x69')](_0x90b9('0x6a'))['fromQuery'](['phone','scheduledAt',_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel['select']()['field']('phone',_0x90b9('0x6b'))['field'](_0x90b9('0x73'),_0x90b9('0x6c'))[_0x90b9('0x70')]('id','ContactId')['field'](_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')](),'ListId')[_0x90b9('0x70')](_0x52bd13['params']['id'][_0x90b9('0x72')](),_0x90b9('0x5e'))[_0x90b9('0x70')](_0x90b9('0x73'),_0x90b9('0x54'))['field']('NOW()',_0x90b9('0x53'))['from']('cm_contacts')[_0x90b9('0x3e')](_0x90b9('0x75'))[_0x90b9('0x3e')](_0x90b9('0x76'),_0x38f686[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x90b9('0x3e')](_0x90b9('0x78'),squel['select']()[_0x90b9('0x70')](_0x90b9('0x7c'))[_0x90b9('0x74')](_0x90b9('0x6a'))[_0x90b9('0x3e')](_0x90b9('0x7b'),_0x52bd13['params']['id'][_0x90b9('0x72')]())))[_0x90b9('0x72')]();break;default:_0x3934c3=squel[_0x90b9('0x7d')]()[_0x90b9('0x69')](_0x90b9('0x6a'))[_0x90b9('0x7e')]([_0x90b9('0x6b'),_0x90b9('0x6c'),_0x90b9('0x6d'),_0x90b9('0x6e'),_0x90b9('0x5e'),_0x90b9('0x54'),_0x90b9('0x53')],squel[_0x90b9('0x6f')]()['field'](_0x90b9('0x6b'),'phone')['field']('NOW()',_0x90b9('0x6c'))['field']('id',_0x90b9('0x6d'))['field'](_0x38f686['CmListId'][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x52bd13[_0x90b9('0x47')]['id'][_0x90b9('0x72')](),'CampaignId')[_0x90b9('0x70')]('NOW()',_0x90b9('0x54'))[_0x90b9('0x70')](_0x90b9('0x73'),_0x90b9('0x53'))[_0x90b9('0x74')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x90b9('0x3e')]('ListId\x20=\x20?',_0x38f686['CmListId']['toString']())[_0x90b9('0x3e')](_0x90b9('0x77')))['toString']();}_0x4d503b[_0x90b9('0x7f')](db['sequelize']['query'](_0x3934c3));}return BPromise['all'](_0x4d503b);}})[_0x90b9('0x26')](function(){return _0x3ce141;})['then'](respondWithResult(_0x5653eb,null))[_0x90b9('0x45')](handleError(_0x5653eb,null));};exports[_0x90b9('0x80')]=function(_0x524b3d,_0xba7f70,_0x5630db){return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x524b3d['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0xba7f70,null))['then'](function(_0x38e6c2){if(_0x38e6c2){return _0x38e6c2[_0x90b9('0x80')](_0x524b3d['query'][_0x90b9('0x66')]);}})['then'](function(_0xbb8dd9){if(_0xbb8dd9){return db[_0x90b9('0x57')][_0x90b9('0x29')]({'where':{'ListId':_0x524b3d[_0x90b9('0x33')]['ids'],'CampaignId':_0x524b3d['params']['id']}})[_0x90b9('0x26')](function(){return _0xbb8dd9;});}})[_0x90b9('0x26')](respondWithStatusCode(_0xba7f70,null))[_0x90b9('0x45')](handleError(_0xba7f70,null));};exports[_0x90b9('0x81')]=function(_0x1c078d,_0x425fbf,_0x356ae4){var _0x4ac85d={};var _0x2b0ee3={};var _0x456a32;var _0x265b03;return db[_0x90b9('0x2f')]['findOne']({'where':{'id':_0x1c078d[_0x90b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x425fbf,null))['then'](function(_0x3b3331){if(_0x3b3331){_0x456a32=_0x3b3331;_0x2b0ee3[_0x90b9('0x36')]=_['keys'](db[_0x90b9('0x64')][_0x90b9('0x30')]);_0x2b0ee3['query']=_[_0x90b9('0x48')](_0x1c078d[_0x90b9('0x33')]);_0x2b0ee3[_0x90b9('0x34')]=_[_0x90b9('0x35')](_0x2b0ee3[_0x90b9('0x36')],_0x2b0ee3[_0x90b9('0x33')]);_0x4ac85d[_0x90b9('0x37')]=_[_0x90b9('0x35')](_0x2b0ee3[_0x90b9('0x36')],qs['fields'](_0x1c078d['query'][_0x90b9('0x38')]));_0x4ac85d['attributes']=_0x4ac85d[_0x90b9('0x37')][_0x90b9('0x39')]?_0x4ac85d['attributes']:_0x2b0ee3[_0x90b9('0x36')];_0x4ac85d[_0x90b9('0x58')]=qs['sort'](_0x1c078d['query'][_0x90b9('0x59')]);_0x4ac85d[_0x90b9('0x3e')]=qs[_0x90b9('0x34')](_['pick'](_0x1c078d[_0x90b9('0x33')],_0x2b0ee3[_0x90b9('0x34')]));if(_0x1c078d['query'][_0x90b9('0x3d')]){_0x4ac85d['where']=_[_0x90b9('0x3f')](_0x4ac85d[_0x90b9('0x3e')],{'$or':_[_0x90b9('0x2e')](_0x4ac85d[_0x90b9('0x37')],function(_0x467204){var _0x1bbec7={};_0x1bbec7[_0x467204]={'$like':'%'+_0x1c078d[_0x90b9('0x33')][_0x90b9('0x3d')]+'%'};return _0x1bbec7;})});}_0x4ac85d=_[_0x90b9('0x3f')]({},_0x4ac85d,_0x1c078d[_0x90b9('0x41')]);return _0x456a32[_0x90b9('0x81')](_0x4ac85d);}})[_0x90b9('0x26')](function(_0x26241a){if(_0x26241a){_0x265b03=_0x26241a['length'];if(!_0x1c078d['query']['hasOwnProperty'](_0x90b9('0x3b'))){_0x4ac85d['limit']=qs['limit'](_0x1c078d[_0x90b9('0x33')]['limit']);_0x4ac85d[_0x90b9('0x20')]=qs['offset'](_0x1c078d['query'][_0x90b9('0x20')]);}return _0x456a32[_0x90b9('0x81')](_0x4ac85d);}})[_0x90b9('0x26')](function(_0x35ab2e){if(_0x35ab2e){return _0x35ab2e?{'count':_0x265b03,'rows':_0x35ab2e}:null;}})[_0x90b9('0x26')](respondWithResult(_0x425fbf,null))[_0x90b9('0x45')](handleError(_0x425fbf,null));};exports[_0x90b9('0x82')]=function(_0x3131a6,_0x3c4a45,_0x326a4a){var _0x3b5cde,_0x2a5cce;return db[_0x90b9('0x2f')][_0x90b9('0x49')]({'where':{'id':_0x3131a6['params']['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x3c4a45,null))[_0x90b9('0x26')](function(_0x2fa5aa){if(_0x2fa5aa){_0x2a5cce=_0x2fa5aa;return _0x2fa5aa[_0x90b9('0x82')](_0x3131a6[_0x90b9('0x4b')][_0x90b9('0x66')],_['omit'](_0x3131a6[_0x90b9('0x4b')],[_0x90b9('0x66'),'id'])||{});}return null;})[_0x90b9('0x67')](function(_0x1d4a88){var _0x513b05;_0x3b5cde=_0x1d4a88||[];var _0xea8e37=[];if(_0x1d4a88){for(var _0x5e8e20=0x0;_0x5e8e20<_0x1d4a88[_0x90b9('0x39')];_0x5e8e20+=0x1){var _0x264d82=_0x1d4a88[_0x5e8e20][_0x90b9('0x27')]({'plain':!![]});_0x513b05=squel[_0x90b9('0x7d')]()['into'](_0x90b9('0x83'))[_0x90b9('0x7e')]([_0x90b9('0x6b'),'ContactId',_0x90b9('0x6e'),_0x90b9('0x5e'),'createdAt',_0x90b9('0x53')],squel[_0x90b9('0x6f')]()[_0x90b9('0x70')](_0x90b9('0x6b'),_0x90b9('0x6b'))['field']('id',_0x90b9('0x6d'))[_0x90b9('0x70')](_0x264d82['CmListId'][_0x90b9('0x72')](),_0x90b9('0x6e'))[_0x90b9('0x70')](_0x3131a6['params']['id'][_0x90b9('0x72')](),_0x90b9('0x5e'))[_0x90b9('0x70')]('NOW()','createdAt')[_0x90b9('0x70')]('NOW()','updatedAt')['from'](_0x90b9('0x84'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x90b9('0x76'),_0x264d82[_0x90b9('0x71')][_0x90b9('0x72')]())[_0x90b9('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x90b9('0x72')]();_0xea8e37[_0x90b9('0x7f')](db[_0x90b9('0x85')][_0x90b9('0x33')](_0x513b05));}return BPromise[_0x90b9('0x86')](_0xea8e37);}})['then'](function(){return _0x3b5cde;})[_0x90b9('0x26')](respondWithResult(_0x3c4a45,null))[_0x90b9('0x45')](handleError(_0x3c4a45,null));};exports[_0x90b9('0x87')]=function(_0x47f6f8,_0x3880f9,_0x45fc4f){return db['Campaign'][_0x90b9('0x49')]({'where':{'id':_0x47f6f8[_0x90b9('0x47')]['id']}})[_0x90b9('0x26')](handleEntityNotFound(_0x3880f9,null))[_0x90b9('0x26')](function(_0x2303fc){if(_0x2303fc){return _0x2303fc['removeBlackLists'](_0x47f6f8[_0x90b9('0x33')][_0x90b9('0x66')]);}})['then'](function(_0x43908c){if(_0x43908c){return db[_0x90b9('0x62')][_0x90b9('0x29')]({'where':{'ListId':_0x47f6f8[_0x90b9('0x33')][_0x90b9('0x66')],'CampaignId':_0x47f6f8['params']['id']}})[_0x90b9('0x26')](function(){return _0x43908c;});}})[_0x90b9('0x26')](respondWithStatusCode(_0x3880f9,null))[_0x90b9('0x45')](handleError(_0x3880f9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5f22172..80560d2 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xc2869e,_0x105457){var _0x243be2=function(_0x4876b6){while(--_0x4876b6){_0xc2869e['push'](_0xc2869e['shift']());}};_0x243be2(++_0x105457);}(_0x7a54,0x106));var _0x47a5=function(_0x3e9be4,_0x59bfd6){_0x3e9be4=_0x3e9be4-0x0;var _0x2c338f=_0x7a54[_0x3e9be4];return _0x2c338f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x35d291,_0x1a131b){var _0x370b86=function(_0x52fa2a){while(--_0x52fa2a){_0x35d291['push'](_0x35d291['shift']());}};_0x370b86(++_0x1a131b);}(_0x7a54,0x106));var _0x47a5=function(_0x132428,_0x56dbcc){_0x132428=_0x132428-0x0;var _0x2ed205=_0x7a54[_0x132428];return _0x2ed205;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 7fe760b..7ae6e93 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 _0x82b0=['http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','model','attributes','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xccb70a,_0x1b6151){var _0x37f620=function(_0x498050){while(--_0x498050){_0xccb70a['push'](_0xccb70a['shift']());}};_0x37f620(++_0x1b6151);}(_0x82b0,0x81));var _0x082b=function(_0x59591b,_0x354045){_0x59591b=_0x59591b-0x0;var _0x576642=_0x82b0[_0x59591b];return _0x576642;};'use strict';var _=require(_0x082b('0x0'));var util=require(_0x082b('0x1'));var moment=require(_0x082b('0x2'));var BPromise=require('bluebird');var rs=require(_0x082b('0x3'));var fs=require('fs');var Redis=require(_0x082b('0x4'));var db=require(_0x082b('0x5'))['db'];var utils=require(_0x082b('0x6'));var logger=require('../../config/logger')(_0x082b('0x7'));var config=require(_0x082b('0x8'));var jayson=require(_0x082b('0x9'));var client=jayson[_0x082b('0xa')][_0x082b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e8485,_0x16b989,_0x3b9c2a){return new BPromise(function(_0x339585,_0x3ff037){return client[_0x082b('0xc')](_0x5e8485,_0x3b9c2a)[_0x082b('0xd')](function(_0xa65fdf){logger[_0x082b('0xe')](_0x082b('0xf'),_0x16b989,_0x082b('0x10'));logger[_0x082b('0x11')](_0x082b('0x12'),_0x16b989,_0x082b('0x10'),JSON[_0x082b('0x13')](_0xa65fdf));if(_0xa65fdf['error']){if(_0xa65fdf['error'][_0x082b('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x16b989,_0xa65fdf[_0x082b('0x15')][_0x082b('0x16')]);return _0x3ff037(_0xa65fdf['error'][_0x082b('0x16')]);}logger[_0x082b('0x15')](_0x082b('0xf'),_0x16b989,_0xa65fdf[_0x082b('0x15')][_0x082b('0x16')]);return _0x339585(_0xa65fdf['error'][_0x082b('0x16')]);}else{logger[_0x082b('0xe')]('Campaign,\x20%s,\x20%s',_0x16b989,_0x082b('0x10'));_0x339585(_0xa65fdf['result'][_0x082b('0x16')]);}})[_0x082b('0x17')](function(_0x4e5791){logger[_0x082b('0x15')](_0x082b('0xf'),_0x16b989,_0x4e5791);_0x3ff037(_0x4e5791);});});}exports[_0x082b('0x18')]=function(_0x3aa0ed){var _0x4adfc6=this;return new Promise(function(_0x2772e9,_0x2d5cbc){return db[_0x082b('0x19')][_0x082b('0x1a')]({'raw':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')][_0x082b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed['options'][_0x082b('0x1d')]||null:null,'attributes':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')]['attributes']||null:null,'limit':_0x3aa0ed[_0x082b('0x1b')]?_0x3aa0ed[_0x082b('0x1b')][_0x082b('0x1e')]||null:null,'include':_0x3aa0ed['options']?_0x3aa0ed['options'][_0x082b('0x1f')]?_['map'](_0x3aa0ed['options'][_0x082b('0x1f')],function(_0xaa7eb){return{'model':db[_0xaa7eb[_0x082b('0x20')]],'as':_0xaa7eb['as'],'attributes':_0xaa7eb[_0x082b('0x21')],'include':_0xaa7eb[_0x082b('0x1f')]?_['map'](_0xaa7eb[_0x082b('0x1f')],function(_0x1254fd){return{'model':db[_0x1254fd[_0x082b('0x20')]],'as':_0x1254fd['as'],'attributes':_0x1254fd[_0x082b('0x21')],'include':_0x1254fd[_0x082b('0x1f')]?_[_0x082b('0x22')](_0x1254fd[_0x082b('0x1f')],function(_0x4e30e8){return{'model':db[_0x4e30e8[_0x082b('0x20')]],'as':_0x4e30e8['as'],'attributes':_0x4e30e8['attributes']};}):[]};}):[]};}):[]:[]})[_0x082b('0xd')](function(_0x4d102b){logger[_0x082b('0xe')](_0x082b('0x18'),_0x3aa0ed);logger['debug'](_0x082b('0x18'),_0x3aa0ed,JSON['stringify'](_0x4d102b));_0x2772e9(_0x4d102b);})[_0x082b('0x17')](function(_0x55d059){logger[_0x082b('0x15')](_0x082b('0x18'),_0x55d059[_0x082b('0x16')],_0x3aa0ed);_0x2d5cbc(_0x4adfc6[_0x082b('0x15')](0x1f4,_0x55d059[_0x082b('0x16')]));});});}; \ No newline at end of file +var _0xafe6=['client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','GetCampaign','options','raw','where','attributes','limit','include','map','model','debug','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2293ed,_0xa62e95){var _0xe780be=function(_0x599d44){while(--_0x599d44){_0x2293ed['push'](_0x2293ed['shift']());}};_0xe780be(++_0xa62e95);}(_0xafe6,0xac));var _0x6afe=function(_0x3d6bab,_0x3242db){_0x3d6bab=_0x3d6bab-0x0;var _0x348415=_0xafe6[_0x3d6bab];return _0x348415;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6afe('0x2'));var fs=require('fs');var Redis=require(_0x6afe('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6afe('0x4'))(_0x6afe('0x5'));var config=require(_0x6afe('0x6'));var jayson=require(_0x6afe('0x7'));var client=jayson[_0x6afe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302747,_0x2fb2c9,_0x59badb){return new BPromise(function(_0x1d3c11,_0x4c4c6f){return client[_0x6afe('0x9')](_0x302747,_0x59badb)[_0x6afe('0xa')](function(_0xd7ebad){logger[_0x6afe('0xb')](_0x6afe('0xc'),_0x2fb2c9,_0x6afe('0xd'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x2fb2c9,_0x6afe('0xd'),JSON[_0x6afe('0xe')](_0xd7ebad));if(_0xd7ebad['error']){if(_0xd7ebad['error'][_0x6afe('0xf')]===0x1f4){logger[_0x6afe('0x10')](_0x6afe('0xc'),_0x2fb2c9,_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);return _0x4c4c6f(_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);}logger['error'](_0x6afe('0xc'),_0x2fb2c9,_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);return _0x1d3c11(_0xd7ebad[_0x6afe('0x10')][_0x6afe('0x11')]);}else{logger[_0x6afe('0xb')](_0x6afe('0xc'),_0x2fb2c9,'request\x20sent');_0x1d3c11(_0xd7ebad[_0x6afe('0x12')]['message']);}})['catch'](function(_0x4296c7){logger[_0x6afe('0x10')](_0x6afe('0xc'),_0x2fb2c9,_0x4296c7);_0x4c4c6f(_0x4296c7);});});}exports[_0x6afe('0x13')]=function(_0x1bc331){var _0x2197c4=this;return new Promise(function(_0x3699e8,_0x1fd5e3){return db['Campaign']['findAll']({'raw':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x15')]===undefined?!![]:![]:!![],'where':_0x1bc331['options']?_0x1bc331['options'][_0x6afe('0x16')]||null:null,'attributes':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x17')]||null:null,'limit':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x18')]||null:null,'include':_0x1bc331[_0x6afe('0x14')]?_0x1bc331[_0x6afe('0x14')][_0x6afe('0x19')]?_[_0x6afe('0x1a')](_0x1bc331[_0x6afe('0x14')][_0x6afe('0x19')],function(_0x23fc00){return{'model':db[_0x23fc00[_0x6afe('0x1b')]],'as':_0x23fc00['as'],'attributes':_0x23fc00['attributes'],'include':_0x23fc00['include']?_[_0x6afe('0x1a')](_0x23fc00['include'],function(_0x4b0399){return{'model':db[_0x4b0399[_0x6afe('0x1b')]],'as':_0x4b0399['as'],'attributes':_0x4b0399[_0x6afe('0x17')],'include':_0x4b0399[_0x6afe('0x19')]?_[_0x6afe('0x1a')](_0x4b0399[_0x6afe('0x19')],function(_0x3bb392){return{'model':db[_0x3bb392[_0x6afe('0x1b')]],'as':_0x3bb392['as'],'attributes':_0x3bb392[_0x6afe('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6afe('0xa')](function(_0x2c6ac3){logger[_0x6afe('0xb')](_0x6afe('0x13'),_0x1bc331);logger[_0x6afe('0x1c')]('GetCampaign',_0x1bc331,JSON[_0x6afe('0xe')](_0x2c6ac3));_0x3699e8(_0x2c6ac3);})[_0x6afe('0x1d')](function(_0x17e5d5){logger['error'](_0x6afe('0x13'),_0x17e5d5['message'],_0x1bc331);_0x1fd5e3(_0x2197c4[_0x6afe('0x10')](0x1f4,_0x17e5d5[_0x6afe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 6fc16e9..7b5e7c0 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 _0x0c74=['post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','update','destroy','delete','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_black','/:id/lists','getBlackLists'];(function(_0x1c7daf,_0x39ce94){var _0x44dc88=function(_0x37f698){while(--_0x37f698){_0x1c7daf['push'](_0x1c7daf['shift']());}};_0x44dc88(++_0x39ce94);}(_0x0c74,0x1cd));var _0x40c7=function(_0xf1f2e0,_0x37c415){_0xf1f2e0=_0xf1f2e0-0x0;var _0x991373=_0x0c74[_0xf1f2e0];return _0x991373;};'use strict';var multer=require('multer');var util=require(_0x40c7('0x0'));var path=require(_0x40c7('0x1'));var timeout=require(_0x40c7('0x2'));var express=require(_0x40c7('0x3'));var router=express[_0x40c7('0x4')]();var fs_extra=require(_0x40c7('0x5'));var auth=require(_0x40c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40c7('0x7'));var controller=require(_0x40c7('0x8'));router[_0x40c7('0x9')]('/',auth[_0x40c7('0xa')](),controller['index']);router[_0x40c7('0x9')](_0x40c7('0xb'),auth[_0x40c7('0xa')](),controller[_0x40c7('0xc')]);router[_0x40c7('0x9')](_0x40c7('0xd'),auth[_0x40c7('0xa')](),controller[_0x40c7('0xe')]);router[_0x40c7('0x9')](_0x40c7('0xf'),auth[_0x40c7('0xa')](),controller['getHopperHistories']);router[_0x40c7('0x9')]('/:id/hopper_finals',auth[_0x40c7('0xa')](),controller['getHopperFinals']);router[_0x40c7('0x9')](_0x40c7('0x10'),auth[_0x40c7('0xa')](),controller['getHopperBlacks']);router[_0x40c7('0x9')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller['getLists']);router[_0x40c7('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x40c7('0x12')]);router[_0x40c7('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x40c7('0x14'),auth['isAuthenticated'](),controller['clone']);router[_0x40c7('0x13')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x15')]);router['post'](_0x40c7('0x16'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x17')]);router[_0x40c7('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x40c7('0x19')]);router['delete'](_0x40c7('0xb'),auth['isAuthenticated'](),controller[_0x40c7('0x1a')]);router[_0x40c7('0x1b')](_0x40c7('0x11'),auth[_0x40c7('0xa')](),controller[_0x40c7('0x1c')]);router[_0x40c7('0x1b')](_0x40c7('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x40c7('0x1d')]=router; \ No newline at end of file +var _0xe64a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var path=require(_0xae64('0x2'));var timeout=require(_0xae64('0x3'));var express=require(_0xae64('0x4'));var router=express[_0xae64('0x5')]();var fs_extra=require(_0xae64('0x6'));var auth=require(_0xae64('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0xae64('0x8')](),controller[_0xae64('0x9')]);router[_0xae64('0xa')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0xc')]);router[_0xae64('0xa')](_0xae64('0xd'),auth[_0xae64('0x8')](),controller[_0xae64('0xe')]);router[_0xae64('0xa')]('/:id/hopper_histories',auth[_0xae64('0x8')](),controller['getHopperHistories']);router['get'](_0xae64('0xf'),auth[_0xae64('0x8')](),controller[_0xae64('0x10')]);router[_0xae64('0xa')]('/:id/hopper_black',auth[_0xae64('0x8')](),controller['getHopperBlacks']);router['get'](_0xae64('0x11'),auth[_0xae64('0x8')](),controller[_0xae64('0x12')]);router['get'](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x14')]);router[_0xae64('0x15')]('/',auth[_0xae64('0x8')](),controller['create']);router[_0xae64('0x15')](_0xae64('0x16'),auth[_0xae64('0x8')](),controller[_0xae64('0x17')]);router[_0xae64('0x15')]('/:id/lists',auth[_0xae64('0x8')](),controller[_0xae64('0x18')]);router[_0xae64('0x15')](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x19')]);router[_0xae64('0x1a')](_0xae64('0xb'),auth['isAuthenticated'](),controller[_0xae64('0x1b')]);router[_0xae64('0x1c')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0x1d')]);router[_0xae64('0x1c')]('/:id/lists',auth[_0xae64('0x8')](),controller['removeLists']);router[_0xae64('0x1c')](_0xae64('0x13'),auth[_0xae64('0x8')](),controller[_0xae64('0x1e')]);module[_0xae64('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index eab99e0..ee71a09 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 _0x50eb=['key','exports','getDataValue'];(function(_0x3a9808,_0x571f06){var _0x442b34=function(_0x289a15){while(--_0x289a15){_0x3a9808['push'](_0x3a9808['shift']());}};_0x442b34(++_0x571f06);}(_0x50eb,0xeb));var _0xb50e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x50eb[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0xb50e('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb50e('0x1')](_0xb50e('0x2'));}}}; \ No newline at end of file +var _0x1597=['key','exports','STRING','VIRTUAL'];(function(_0x127003,_0xda7436){var _0x3eb4af=function(_0x2cd918){while(--_0x2cd918){_0x127003['push'](_0x127003['shift']());}};_0x3eb4af(++_0xda7436);}(_0x1597,0xf9));var _0x7159=function(_0x427502,_0x4e6214){_0x427502=_0x427502-0x0;var _0x1baeff=_0x1597[_0x427502];return _0x1baeff;};'use strict';var Sequelize=require('sequelize');module[_0x7159('0x0')]={'key':{'type':Sequelize[_0x7159('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x7159('0x1')]},'name':{'type':Sequelize[_0x7159('0x2')],'get':function(){return this['getDataValue'](_0x7159('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 1b6d862..a1fad30 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 _0xb039=['merge','where','options','include','findAll','rows','catch','show','params','rawAttributes','filters','includeAll','find','body','create','key','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','map','CannedAnswer','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x45c31f,_0xe6cd86){var _0x539e71=function(_0xf58cd5){while(--_0xf58cd5){_0x45c31f['push'](_0x45c31f['shift']());}};_0x539e71(++_0xe6cd86);}(_0xb039,0x120));var _0x9b03=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0xb039[_0x25b24a];return _0x224e68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b03('0x0'));var zipdir=require(_0x9b03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9b03('0x3'));var util=require('util');var path=require(_0x9b03('0x4'));var sox=require(_0x9b03('0x5'));var csv=require(_0x9b03('0x6'));var ejs=require(_0x9b03('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9b03('0x8'));var squel=require(_0x9b03('0x9'));var crypto=require(_0x9b03('0xa'));var jsforce=require(_0x9b03('0xb'));var deskjs=require(_0x9b03('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9b03('0xd'));var Papa=require(_0x9b03('0xe'));var Redis=require(_0x9b03('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9b03('0x10'));var as=require(_0x9b03('0x11'));var hardwareService=require(_0x9b03('0x12'));var logger=require(_0x9b03('0x13'))('api');var utils=require(_0x9b03('0x14'));var config=require(_0x9b03('0x15'));var licenseUtil=require(_0x9b03('0x16'));var db=require(_0x9b03('0x17'))['db'];function respondWithStatusCode(_0x450b95,_0x60a204){_0x60a204=_0x60a204||0xcc;return function(_0x53bf54){if(_0x53bf54){return _0x450b95[_0x9b03('0x18')](_0x60a204);}return _0x450b95[_0x9b03('0x19')](_0x60a204)[_0x9b03('0x1a')]();};}function respondWithResult(_0x4d1a6f,_0x406309){_0x406309=_0x406309||0xc8;return function(_0x377648){if(_0x377648){return _0x4d1a6f[_0x9b03('0x19')](_0x406309)[_0x9b03('0x1b')](_0x377648);}};}function respondWithFilteredResult(_0x570485,_0x26e80e){return function(_0xf5f912){if(_0xf5f912){var _0x598e12=typeof _0x26e80e[_0x9b03('0x1c')]===_0x9b03('0x1d')&&typeof _0x26e80e['limit']===_0x9b03('0x1d');var _0x12b181=_0xf5f912[_0x9b03('0x1e')];var _0x5cf16d=_0x598e12?0x0:_0x26e80e[_0x9b03('0x1c')];var _0x222dad=_0x598e12?_0xf5f912[_0x9b03('0x1e')]:_0x26e80e[_0x9b03('0x1c')]+_0x26e80e[_0x9b03('0x1f')];var _0x5b6e18;if(_0x222dad>=_0x12b181){_0x222dad=_0x12b181;_0x5b6e18=0xc8;}else{_0x5b6e18=0xce;}_0x570485[_0x9b03('0x19')](_0x5b6e18);return _0x570485['set'](_0x9b03('0x20'),_0x5cf16d+'-'+_0x222dad+'/'+_0x12b181)[_0x9b03('0x1b')](_0xf5f912);}return null;};}function patchUpdates(_0x12a4e4){return function(_0xad325c){try{jsonpatch[_0x9b03('0x21')](_0xad325c,_0x12a4e4,!![]);}catch(_0x54dede){return BPromise[_0x9b03('0x22')](_0x54dede);}return _0xad325c[_0x9b03('0x23')]();};}function saveUpdates(_0x1d0f86,_0x19dee){return function(_0x49f4ef){if(_0x49f4ef){return _0x49f4ef[_0x9b03('0x24')](_0x1d0f86)[_0x9b03('0x25')](function(_0xb625f7){return _0xb625f7;});}return null;};}function removeEntity(_0x3885c2,_0x322355){return function(_0x2faa28){if(_0x2faa28){return _0x2faa28['destroy']()['then'](function(){var _0x3fffd9=_0x2faa28['get']({'plain':!![]});var _0x263a3e=_0x9b03('0x26');return db[_0x9b03('0x27')][_0x9b03('0x28')]({'where':{'type':_0x263a3e,'resourceId':_0x3fffd9['id']}})[_0x9b03('0x25')](function(){return _0x2faa28;});})[_0x9b03('0x25')](function(){_0x3885c2[_0x9b03('0x19')](0xcc)[_0x9b03('0x1a')]();});}};}function handleEntityNotFound(_0x49ab37,_0x3ac065){return function(_0x42e75b){if(!_0x42e75b){_0x49ab37[_0x9b03('0x18')](0x194);}return _0x42e75b;};}function handleError(_0x2dfd34,_0x1c79fd){_0x1c79fd=_0x1c79fd||0x1f4;return function(_0x4ff64c){logger[_0x9b03('0x29')](_0x4ff64c[_0x9b03('0x2a')]);if(_0x4ff64c[_0x9b03('0x2b')]){delete _0x4ff64c[_0x9b03('0x2b')];}_0x2dfd34[_0x9b03('0x19')](_0x1c79fd)[_0x9b03('0x2c')](_0x4ff64c);};}exports['index']=function(_0x30e0ad,_0x5b2937){var _0x137026={},_0x452781={},_0x2eeb26={'count':0x0,'rows':[]};var _0x1be626=_[_0x9b03('0x2d')](db[_0x9b03('0x2e')]['rawAttributes'],function(_0x4b3a30){return{'name':_0x4b3a30[_0x9b03('0x2f')],'type':_0x4b3a30[_0x9b03('0x30')]['key']};});_0x452781[_0x9b03('0x31')]=_[_0x9b03('0x2d')](_0x1be626,'name');_0x452781[_0x9b03('0x32')]=_[_0x9b03('0x33')](_0x30e0ad['query']);_0x452781['filters']=_[_0x9b03('0x34')](_0x452781[_0x9b03('0x31')],_0x452781[_0x9b03('0x32')]);_0x137026[_0x9b03('0x35')]=_[_0x9b03('0x34')](_0x452781['model'],qs[_0x9b03('0x36')](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x36')]));_0x137026[_0x9b03('0x35')]=_0x137026[_0x9b03('0x35')]['length']?_0x137026['attributes']:_0x452781[_0x9b03('0x31')];if(!_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x37')](_0x9b03('0x38'))){_0x137026[_0x9b03('0x1f')]=qs['limit'](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x1f')]);_0x137026['offset']=qs['offset'](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x1c')]);}_0x137026[_0x9b03('0x39')]=qs[_0x9b03('0x3a')](_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3a')]);_0x137026['where']=qs['filters'](_['pick'](_0x30e0ad[_0x9b03('0x32')],_0x452781['filters']),_0x1be626);if(_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3b')]){_0x137026['where']=_[_0x9b03('0x3c')](_0x137026[_0x9b03('0x3d')],{'$or':[{'key':{'$like':'%'+_0x30e0ad[_0x9b03('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x30e0ad[_0x9b03('0x32')][_0x9b03('0x3b')]+'%'}}]});}_0x137026=_[_0x9b03('0x3c')]({},_0x137026,_0x30e0ad[_0x9b03('0x3e')]);var _0x37b650={'where':_0x137026[_0x9b03('0x3d')]};return db[_0x9b03('0x2e')][_0x9b03('0x1e')](_0x37b650)[_0x9b03('0x25')](function(_0x483bef){_0x2eeb26['count']=_0x483bef;if(_0x30e0ad[_0x9b03('0x32')]['includeAll']){_0x137026[_0x9b03('0x3f')]=[{'all':!![]}];}return db[_0x9b03('0x2e')][_0x9b03('0x40')](_0x137026);})['then'](function(_0x5e7cef){_0x2eeb26[_0x9b03('0x41')]=_0x5e7cef;return _0x2eeb26;})['then'](respondWithFilteredResult(_0x5b2937,_0x137026))[_0x9b03('0x42')](handleError(_0x5b2937,null));};exports[_0x9b03('0x43')]=function(_0x15b7d5,_0x224922){var _0x1b6b20={'raw':!![],'where':{'id':_0x15b7d5[_0x9b03('0x44')]['id']}},_0x4abdff={};_0x4abdff[_0x9b03('0x31')]=_[_0x9b03('0x33')](db[_0x9b03('0x2e')][_0x9b03('0x45')]);_0x4abdff[_0x9b03('0x32')]=_[_0x9b03('0x33')](_0x15b7d5['query']);_0x4abdff[_0x9b03('0x46')]=_[_0x9b03('0x34')](_0x4abdff[_0x9b03('0x31')],_0x4abdff[_0x9b03('0x32')]);_0x1b6b20[_0x9b03('0x35')]=_[_0x9b03('0x34')](_0x4abdff['model'],qs['fields'](_0x15b7d5[_0x9b03('0x32')][_0x9b03('0x36')]));_0x1b6b20[_0x9b03('0x35')]=_0x1b6b20[_0x9b03('0x35')]['length']?_0x1b6b20[_0x9b03('0x35')]:_0x4abdff[_0x9b03('0x31')];if(_0x15b7d5['query'][_0x9b03('0x47')]){_0x1b6b20[_0x9b03('0x3f')]=[{'all':!![]}];}_0x1b6b20=_['merge']({},_0x1b6b20,_0x15b7d5[_0x9b03('0x3e')]);return db[_0x9b03('0x2e')][_0x9b03('0x48')](_0x1b6b20)[_0x9b03('0x25')](handleEntityNotFound(_0x224922,null))['then'](respondWithResult(_0x224922,null))[_0x9b03('0x42')](handleError(_0x224922,null));};exports[_0x9b03('0x24')]=function(_0x367aa5,_0x3b58e5){if(_0x367aa5[_0x9b03('0x49')]['id']){delete _0x367aa5[_0x9b03('0x49')]['id'];}return db['CannedAnswer'][_0x9b03('0x48')]({'where':{'id':_0x367aa5[_0x9b03('0x44')]['id']}})[_0x9b03('0x25')](handleEntityNotFound(_0x3b58e5,null))['then'](saveUpdates(_0x367aa5[_0x9b03('0x49')],null))[_0x9b03('0x25')](respondWithResult(_0x3b58e5,null))['catch'](handleError(_0x3b58e5,null));};exports[_0x9b03('0x28')]=function(_0x3fb8a9,_0x171923){return db[_0x9b03('0x2e')][_0x9b03('0x48')]({'where':{'id':_0x3fb8a9[_0x9b03('0x44')]['id']}})[_0x9b03('0x25')](handleEntityNotFound(_0x171923,null))[_0x9b03('0x25')](removeEntity(_0x171923,null))[_0x9b03('0x42')](handleError(_0x171923,null));};exports[_0x9b03('0x4a')]=function(_0x1d8996,_0x334c4b){var _0xba7697={'key':_0x1d8996[_0x9b03('0x49')][_0x9b03('0x4b')]};if(_0x1d8996[_0x9b03('0x49')]['MailAccountId']){_0xba7697[_0x9b03('0x4c')]=_0x1d8996[_0x9b03('0x49')]['MailAccountId'];}else if(_0x1d8996['body'][_0x9b03('0x4d')]){_0xba7697[_0x9b03('0x4d')]=_0x1d8996[_0x9b03('0x49')][_0x9b03('0x4d')];}else if(_0x1d8996['body']['OpenchannelAccountId']){_0xba7697['OpenchannelAccountId']=_0x1d8996[_0x9b03('0x49')]['OpenchannelAccountId'];}else if(_0x1d8996[_0x9b03('0x49')]['ChatWebsiteId']){_0xba7697[_0x9b03('0x4e')]=_0x1d8996['body'][_0x9b03('0x4e')];}return db['CannedAnswer'][_0x9b03('0x48')]({'where':_0xba7697})[_0x9b03('0x25')](function(_0x35e412){if(_0x35e412){throw new db[(_0x9b03('0x4f'))][(_0x9b03('0x50'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x9b03('0x2e')][_0x9b03('0x4a')](_0x1d8996[_0x9b03('0x49')]);})[_0x9b03('0x25')](function(_0x2eb637){var _0x44db8b=_0x1d8996[_0x9b03('0x51')]['get']({'plain':!![]});if(!_0x44db8b)throw new Error(_0x9b03('0x52'));if(_0x44db8b[_0x9b03('0x53')]===_0x9b03('0x51')){var _0x461ecc=_0x2eb637['get']({'plain':!![]});return db[_0x9b03('0x54')][_0x9b03('0x48')]({'where':{'name':_0x9b03('0x26'),'userProfileId':_0x44db8b[_0x9b03('0x55')]},'raw':!![]})[_0x9b03('0x25')](function(_0xf8c9a4){if(_0xf8c9a4&&_0xf8c9a4['autoAssociation']===0x0){return db[_0x9b03('0x27')]['create']({'name':_0x461ecc[_0x9b03('0x2b')],'resourceId':_0x461ecc['id'],'type':_0xf8c9a4[_0x9b03('0x2b')],'sectionId':_0xf8c9a4['id']},{})[_0x9b03('0x25')](function(){return _0x2eb637;});}else{return _0x2eb637;}})[_0x9b03('0x42')](function(_0x5f1820){logger[_0x9b03('0x29')](_0x9b03('0x56'),_0x5f1820);throw _0x5f1820;});}return _0x2eb637;})[_0x9b03('0x25')](respondWithResult(_0x334c4b,0xc9))[_0x9b03('0x42')](handleError(_0x334c4b,null));}; \ No newline at end of file +var _0xf250=['create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','find','body'];(function(_0xe19c81,_0x2e661a){var _0x16596d=function(_0x3c4382){while(--_0x3c4382){_0xe19c81['push'](_0xe19c81['shift']());}};_0x16596d(++_0x2e661a);}(_0xf250,0x11a));var _0x0f25=function(_0x966478,_0x5b7b09){_0x966478=_0x966478-0x0;var _0x5ec091=_0xf250[_0x966478];return _0x5ec091;};'use strict';var emlformat=require(_0x0f25('0x0'));var rimraf=require(_0x0f25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f25('0x2'));var rp=require(_0x0f25('0x3'));var moment=require(_0x0f25('0x4'));var BPromise=require(_0x0f25('0x5'));var Mustache=require('mustache');var util=require(_0x0f25('0x6'));var path=require(_0x0f25('0x7'));var sox=require(_0x0f25('0x8'));var csv=require(_0x0f25('0x9'));var ejs=require(_0x0f25('0xa'));var fs=require('fs');var fs_extra=require(_0x0f25('0xb'));var _=require(_0x0f25('0xc'));var squel=require(_0x0f25('0xd'));var crypto=require(_0x0f25('0xe'));var jsforce=require(_0x0f25('0xf'));var deskjs=require(_0x0f25('0x10'));var toCsv=require(_0x0f25('0x9'));var querystring=require(_0x0f25('0x11'));var Papa=require(_0x0f25('0x12'));var Redis=require(_0x0f25('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0f25('0x14'));var as=require(_0x0f25('0x15'));var hardwareService=require(_0x0f25('0x16'));var logger=require(_0x0f25('0x17'))(_0x0f25('0x18'));var utils=require(_0x0f25('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x0f25('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323bd9,_0xdbb708){_0xdbb708=_0xdbb708||0xcc;return function(_0x19cf4d){if(_0x19cf4d){return _0x323bd9[_0x0f25('0x1b')](_0xdbb708);}return _0x323bd9['status'](_0xdbb708)[_0x0f25('0x1c')]();};}function respondWithResult(_0x1041c5,_0x4d4292){_0x4d4292=_0x4d4292||0xc8;return function(_0x214245){if(_0x214245){return _0x1041c5[_0x0f25('0x1d')](_0x4d4292)['json'](_0x214245);}};}function respondWithFilteredResult(_0x4a1ec2,_0x120582){return function(_0x3885ca){if(_0x3885ca){var _0xe8aa70=typeof _0x120582[_0x0f25('0x1e')]===_0x0f25('0x1f')&&typeof _0x120582['limit']===_0x0f25('0x1f');var _0x4b1ebb=_0x3885ca[_0x0f25('0x20')];var _0x9c65e=_0xe8aa70?0x0:_0x120582[_0x0f25('0x1e')];var _0x3cbdc4=_0xe8aa70?_0x3885ca[_0x0f25('0x20')]:_0x120582[_0x0f25('0x1e')]+_0x120582[_0x0f25('0x21')];var _0x5305d4;if(_0x3cbdc4>=_0x4b1ebb){_0x3cbdc4=_0x4b1ebb;_0x5305d4=0xc8;}else{_0x5305d4=0xce;}_0x4a1ec2[_0x0f25('0x1d')](_0x5305d4);return _0x4a1ec2['set'](_0x0f25('0x22'),_0x9c65e+'-'+_0x3cbdc4+'/'+_0x4b1ebb)[_0x0f25('0x23')](_0x3885ca);}return null;};}function patchUpdates(_0x569d1c){return function(_0x3c2dbb){try{jsonpatch['apply'](_0x3c2dbb,_0x569d1c,!![]);}catch(_0x3da232){return BPromise['reject'](_0x3da232);}return _0x3c2dbb['save']();};}function saveUpdates(_0x9d4b58,_0x480d48){return function(_0x2ed96d){if(_0x2ed96d){return _0x2ed96d[_0x0f25('0x24')](_0x9d4b58)[_0x0f25('0x25')](function(_0x4c9339){return _0x4c9339;});}return null;};}function removeEntity(_0x536091,_0x4269cc){return function(_0x46529d){if(_0x46529d){return _0x46529d[_0x0f25('0x26')]()['then'](function(){var _0x31589c=_0x46529d[_0x0f25('0x27')]({'plain':!![]});var _0x515ddd='CannedAnswers';return db[_0x0f25('0x28')][_0x0f25('0x26')]({'where':{'type':_0x515ddd,'resourceId':_0x31589c['id']}})[_0x0f25('0x25')](function(){return _0x46529d;});})[_0x0f25('0x25')](function(){_0x536091[_0x0f25('0x1d')](0xcc)[_0x0f25('0x1c')]();});}};}function handleEntityNotFound(_0x473f76,_0x44a68f){return function(_0x175a1){if(!_0x175a1){_0x473f76[_0x0f25('0x1b')](0x194);}return _0x175a1;};}function handleError(_0x3200c0,_0x363c35){_0x363c35=_0x363c35||0x1f4;return function(_0x1d8240){logger[_0x0f25('0x29')](_0x1d8240[_0x0f25('0x2a')]);if(_0x1d8240[_0x0f25('0x2b')]){delete _0x1d8240[_0x0f25('0x2b')];}_0x3200c0[_0x0f25('0x1d')](_0x363c35)[_0x0f25('0x2c')](_0x1d8240);};}exports[_0x0f25('0x2d')]=function(_0x57f72b,_0x15fb0e){var _0x3aa2d4={},_0x242cf4={},_0x58d2d8={'count':0x0,'rows':[]};var _0x2f6974=_['map'](db[_0x0f25('0x2e')][_0x0f25('0x2f')],function(_0x2419c5){return{'name':_0x2419c5[_0x0f25('0x30')],'type':_0x2419c5[_0x0f25('0x31')]['key']};});_0x242cf4[_0x0f25('0x32')]=_[_0x0f25('0x33')](_0x2f6974,_0x0f25('0x2b'));_0x242cf4[_0x0f25('0x34')]=_[_0x0f25('0x35')](_0x57f72b[_0x0f25('0x34')]);_0x242cf4[_0x0f25('0x36')]=_[_0x0f25('0x37')](_0x242cf4['model'],_0x242cf4[_0x0f25('0x34')]);_0x3aa2d4[_0x0f25('0x38')]=_[_0x0f25('0x37')](_0x242cf4[_0x0f25('0x32')],qs[_0x0f25('0x39')](_0x57f72b[_0x0f25('0x34')]['fields']));_0x3aa2d4[_0x0f25('0x38')]=_0x3aa2d4[_0x0f25('0x38')][_0x0f25('0x3a')]?_0x3aa2d4[_0x0f25('0x38')]:_0x242cf4['model'];if(!_0x57f72b[_0x0f25('0x34')][_0x0f25('0x3b')]('nolimit')){_0x3aa2d4[_0x0f25('0x21')]=qs[_0x0f25('0x21')](_0x57f72b[_0x0f25('0x34')]['limit']);_0x3aa2d4[_0x0f25('0x1e')]=qs[_0x0f25('0x1e')](_0x57f72b[_0x0f25('0x34')]['offset']);}_0x3aa2d4['order']=qs[_0x0f25('0x3c')](_0x57f72b['query'][_0x0f25('0x3c')]);_0x3aa2d4[_0x0f25('0x3d')]=qs['filters'](_[_0x0f25('0x3e')](_0x57f72b[_0x0f25('0x34')],_0x242cf4['filters']),_0x2f6974);if(_0x57f72b[_0x0f25('0x34')]['filter']){_0x3aa2d4['where']=_[_0x0f25('0x3f')](_0x3aa2d4[_0x0f25('0x3d')],{'$or':[{'key':{'$like':'%'+_0x57f72b[_0x0f25('0x34')][_0x0f25('0x40')]+'%'}},{'value':{'$like':'%'+_0x57f72b[_0x0f25('0x34')][_0x0f25('0x40')]+'%'}}]});}_0x3aa2d4=_[_0x0f25('0x3f')]({},_0x3aa2d4,_0x57f72b[_0x0f25('0x41')]);var _0x4f95a4={'where':_0x3aa2d4[_0x0f25('0x3d')]};return db[_0x0f25('0x2e')][_0x0f25('0x20')](_0x4f95a4)['then'](function(_0x4aa6a9){_0x58d2d8[_0x0f25('0x20')]=_0x4aa6a9;if(_0x57f72b[_0x0f25('0x34')][_0x0f25('0x42')]){_0x3aa2d4[_0x0f25('0x43')]=[{'all':!![]}];}return db[_0x0f25('0x2e')][_0x0f25('0x44')](_0x3aa2d4);})['then'](function(_0x1c804f){_0x58d2d8['rows']=_0x1c804f;return _0x58d2d8;})['then'](respondWithFilteredResult(_0x15fb0e,_0x3aa2d4))[_0x0f25('0x45')](handleError(_0x15fb0e,null));};exports[_0x0f25('0x46')]=function(_0x30af08,_0x2f2375){var _0x29d465={'raw':!![],'where':{'id':_0x30af08[_0x0f25('0x47')]['id']}},_0x3f422f={};_0x3f422f[_0x0f25('0x32')]=_[_0x0f25('0x35')](db[_0x0f25('0x2e')][_0x0f25('0x2f')]);_0x3f422f['query']=_[_0x0f25('0x35')](_0x30af08[_0x0f25('0x34')]);_0x3f422f[_0x0f25('0x36')]=_[_0x0f25('0x37')](_0x3f422f[_0x0f25('0x32')],_0x3f422f[_0x0f25('0x34')]);_0x29d465[_0x0f25('0x38')]=_['intersection'](_0x3f422f[_0x0f25('0x32')],qs[_0x0f25('0x39')](_0x30af08[_0x0f25('0x34')][_0x0f25('0x39')]));_0x29d465['attributes']=_0x29d465['attributes'][_0x0f25('0x3a')]?_0x29d465['attributes']:_0x3f422f[_0x0f25('0x32')];if(_0x30af08[_0x0f25('0x34')]['includeAll']){_0x29d465[_0x0f25('0x43')]=[{'all':!![]}];}_0x29d465=_[_0x0f25('0x3f')]({},_0x29d465,_0x30af08[_0x0f25('0x41')]);return db[_0x0f25('0x2e')][_0x0f25('0x48')](_0x29d465)[_0x0f25('0x25')](handleEntityNotFound(_0x2f2375,null))[_0x0f25('0x25')](respondWithResult(_0x2f2375,null))[_0x0f25('0x45')](handleError(_0x2f2375,null));};exports[_0x0f25('0x24')]=function(_0x4eff3e,_0x35c876){if(_0x4eff3e[_0x0f25('0x49')]['id']){delete _0x4eff3e['body']['id'];}return db[_0x0f25('0x2e')][_0x0f25('0x48')]({'where':{'id':_0x4eff3e[_0x0f25('0x47')]['id']}})[_0x0f25('0x25')](handleEntityNotFound(_0x35c876,null))[_0x0f25('0x25')](saveUpdates(_0x4eff3e[_0x0f25('0x49')],null))[_0x0f25('0x25')](respondWithResult(_0x35c876,null))[_0x0f25('0x45')](handleError(_0x35c876,null));};exports['destroy']=function(_0x1533d5,_0x29999c){return db['CannedAnswer'][_0x0f25('0x48')]({'where':{'id':_0x1533d5[_0x0f25('0x47')]['id']}})[_0x0f25('0x25')](handleEntityNotFound(_0x29999c,null))[_0x0f25('0x25')](removeEntity(_0x29999c,null))['catch'](handleError(_0x29999c,null));};exports[_0x0f25('0x4a')]=function(_0x1f7047,_0x5b1a38){var _0x5a09a1={'key':_0x1f7047['body'][_0x0f25('0x4b')]};if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4c')]){_0x5a09a1[_0x0f25('0x4c')]=_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4c')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4d')]){_0x5a09a1[_0x0f25('0x4d')]=_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4d')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4e')]){_0x5a09a1[_0x0f25('0x4e')]=_0x1f7047['body'][_0x0f25('0x4e')];}else if(_0x1f7047[_0x0f25('0x49')][_0x0f25('0x4f')]){_0x5a09a1['ChatWebsiteId']=_0x1f7047['body'][_0x0f25('0x4f')];}return db[_0x0f25('0x2e')][_0x0f25('0x48')]({'where':_0x5a09a1})['then'](function(_0x24aff1){if(_0x24aff1){throw new db['Sequelize'][(_0x0f25('0x50'))](_0x0f25('0x51'));}return db[_0x0f25('0x2e')][_0x0f25('0x4a')](_0x1f7047[_0x0f25('0x49')]);})[_0x0f25('0x25')](function(_0x4a14ea){var _0xf0354d=_0x1f7047[_0x0f25('0x52')]['get']({'plain':!![]});if(!_0xf0354d)throw new Error(_0x0f25('0x53'));if(_0xf0354d['role']==='user'){var _0x1de210=_0x4a14ea[_0x0f25('0x27')]({'plain':!![]});return db[_0x0f25('0x54')]['find']({'where':{'name':_0x0f25('0x55'),'userProfileId':_0xf0354d[_0x0f25('0x56')]},'raw':!![]})['then'](function(_0x266532){if(_0x266532&&_0x266532[_0x0f25('0x57')]===0x0){return db[_0x0f25('0x28')][_0x0f25('0x4a')]({'name':_0x1de210['name'],'resourceId':_0x1de210['id'],'type':_0x266532[_0x0f25('0x2b')],'sectionId':_0x266532['id']},{})[_0x0f25('0x25')](function(){return _0x4a14ea;});}else{return _0x4a14ea;}})[_0x0f25('0x45')](function(_0x2d6740){logger[_0x0f25('0x29')](_0x0f25('0x58'),_0x2d6740);throw _0x2d6740;});}return _0x4a14ea;})[_0x0f25('0x25')](respondWithResult(_0x5b1a38,0xc9))[_0x0f25('0x45')](handleError(_0x5b1a38,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 2969d37..8c444a4 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 _0x5a6d=['../../config/environment','./cannedAnswer.attributes','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x5a6d,0x194));var _0xd5a6=function(_0x1c5a73,_0x5b10ac){_0x1c5a73=_0x1c5a73-0x0;var _0x2457a1=_0x5a6d[_0x1c5a73];return _0x2457a1;};'use strict';var _=require(_0xd5a6('0x0'));var util=require('util');var logger=require(_0xd5a6('0x1'))(_0xd5a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd5a6('0x3'));var fs=require('fs');var path=require(_0xd5a6('0x4'));var rimraf=require(_0xd5a6('0x5'));var config=require(_0xd5a6('0x6'));var attributes=require(_0xd5a6('0x7'));module['exports']=function(_0x4150a7,_0x47891e){return _0x4150a7['define']('CannedAnswer',attributes,{'tableName':_0xd5a6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5a6('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb870=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xb870,0x7a));var _0x0b87=function(_0x3c22f7,_0x1fb12a){_0x3c22f7=_0x3c22f7-0x0;var _0x537f59=_0xb870[_0x3c22f7];return _0x537f59;};'use strict';var _=require(_0x0b87('0x0'));var util=require('util');var logger=require(_0x0b87('0x1'))(_0x0b87('0x2'));var moment=require(_0x0b87('0x3'));var BPromise=require(_0x0b87('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b87('0x5'));var rimraf=require(_0x0b87('0x6'));var config=require(_0x0b87('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x0b87('0x8')]=function(_0x475c54,_0x1316c6){return _0x475c54[_0x0b87('0x9')](_0x0b87('0xa'),attributes,{'tableName':_0x0b87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0b87('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a7ce556..95efbd8 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a227b,_0x59971c){var _0x2ab46e=function(_0x32d82e){while(--_0x32d82e){_0x1a227b['push'](_0x1a227b['shift']());}};_0x2ab46e(++_0x59971c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2cbb57,_0x369292){var _0x1e9592=function(_0x4ae940){while(--_0x4ae940){_0x2cbb57['push'](_0x2cbb57['shift']());}};_0x1e9592(++_0x369292);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index b072484..516ca24 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 _0xbb44=['destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','post','create','update','delete'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0xbb44,0x11e));var _0x4bb4=function(_0x338a96,_0x11c85a){_0x338a96=_0x338a96-0x0;var _0x5611a0=_0xbb44[_0x338a96];return _0x5611a0;};'use strict';var multer=require('multer');var util=require(_0x4bb4('0x0'));var path=require(_0x4bb4('0x1'));var timeout=require(_0x4bb4('0x2'));var express=require('express');var router=express[_0x4bb4('0x3')]();var fs_extra=require(_0x4bb4('0x4'));var auth=require(_0x4bb4('0x5'));var interaction=require(_0x4bb4('0x6'));var config=require(_0x4bb4('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4bb4('0x8'),auth[_0x4bb4('0x9')](),controller['show']);router[_0x4bb4('0xa')]('/',auth[_0x4bb4('0x9')](),controller[_0x4bb4('0xb')]);router['put'](_0x4bb4('0x8'),auth[_0x4bb4('0x9')](),controller[_0x4bb4('0xc')]);router[_0x4bb4('0xd')](_0x4bb4('0x8'),auth['isAuthenticated'](),controller[_0x4bb4('0xe')]);module['exports']=router; \ No newline at end of file +var _0x4c0d=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x28b0aa,_0x18e34d){var _0xedceb9=function(_0x484e59){while(--_0x484e59){_0x28b0aa['push'](_0x28b0aa['shift']());}};_0xedceb9(++_0x18e34d);}(_0x4c0d,0x181));var _0xd4c0=function(_0x2749fd,_0x2a9f50){_0x2749fd=_0x2749fd-0x0;var _0x2b0305=_0x4c0d[_0x2749fd];return _0x2b0305;};'use strict';var multer=require(_0xd4c0('0x0'));var util=require('util');var path=require(_0xd4c0('0x1'));var timeout=require(_0xd4c0('0x2'));var express=require(_0xd4c0('0x3'));var router=express['Router']();var fs_extra=require(_0xd4c0('0x4'));var auth=require(_0xd4c0('0x5'));var interaction=require(_0xd4c0('0x6'));var config=require(_0xd4c0('0x7'));var controller=require('./cannedAnswer.controller');router[_0xd4c0('0x8')]('/',auth[_0xd4c0('0x9')](),controller['index']);router['get'](_0xd4c0('0xa'),auth[_0xd4c0('0x9')](),controller[_0xd4c0('0xb')]);router[_0xd4c0('0xc')]('/',auth['isAuthenticated'](),controller[_0xd4c0('0xd')]);router[_0xd4c0('0xe')](_0xd4c0('0xa'),auth[_0xd4c0('0x9')](),controller[_0xd4c0('0xf')]);router[_0xd4c0('0x10')](_0xd4c0('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 9f9e2e1..4d4f09b 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 _0xc3b0=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x19bfbe,_0x3c8193){var _0xd5f62d=function(_0x3f18fa){while(--_0x3f18fa){_0x19bfbe['push'](_0x19bfbe['shift']());}};_0xd5f62d(++_0x3c8193);}(_0xc3b0,0x166));var _0x0c3b=function(_0x3c4928,_0x4e710a){_0x3c4928=_0x3c4928-0x0;var _0xfa275b=_0xc3b0[_0x3c4928];return _0xfa275b;};'use strict';var Sequelize=require(_0x0c3b('0x0'));module[_0x0c3b('0x1')]={'calldate':{'type':Sequelize[_0x0c3b('0x2')],'allowNull':![],'defaultValue':_0x0c3b('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x0c3b('0x4')]},'dcontext':{'type':Sequelize[_0x0c3b('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0c3b('0x4')]},'lastapp':{'type':Sequelize[_0x0c3b('0x4')]},'lastdata':{'type':Sequelize[_0x0c3b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c3b('0x4')]},'amaflags':{'type':Sequelize[_0x0c3b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0c3b('0x4')]},'sequence':{'type':Sequelize[_0x0c3b('0x4')]},'peeraccount':{'type':Sequelize[_0x0c3b('0x4')]},'type':{'type':Sequelize[_0x0c3b('0x4')]},'tag':{'type':Sequelize[_0x0c3b('0x4')]}}; \ No newline at end of file +var _0x6988=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1a0411,_0x19ed45){var _0x2abfd4=function(_0x493e67){while(--_0x493e67){_0x1a0411['push'](_0x1a0411['shift']());}};_0x2abfd4(++_0x19ed45);}(_0x6988,0x81));var _0x8698=function(_0xb9fe51,_0x38f460){_0xb9fe51=_0xb9fe51-0x0;var _0x40257c=_0x6988[_0xb9fe51];return _0x40257c;};'use strict';var Sequelize=require(_0x8698('0x0'));module[_0x8698('0x1')]={'calldate':{'type':Sequelize[_0x8698('0x2')],'allowNull':![],'defaultValue':_0x8698('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8698('0x4')]},'dcontext':{'type':Sequelize[_0x8698('0x4')]},'channel':{'type':Sequelize[_0x8698('0x4')]},'dstchannel':{'type':Sequelize[_0x8698('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x8698('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8698('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8698('0x4')]},'amaflags':{'type':Sequelize[_0x8698('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8698('0x4')]},'userfield':{'type':Sequelize[_0x8698('0x4')]},'uniqueid':{'type':Sequelize[_0x8698('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8698('0x4')]},'peeraccount':{'type':Sequelize[_0x8698('0x4')]},'type':{'type':Sequelize[_0x8698('0x4')]},'tag':{'type':Sequelize[_0x8698('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index b0347c0..e61e5ad 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 _0xbd51=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x49cf9a,_0x2d6a3f){_0x49cf9a=_0x49cf9a-0x0;var _0x4eeeec=_0xbd51[_0x49cf9a];return _0x4eeeec;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')](_0x1a29f3[_0x1bd5('0x4a')],{})[_0x1bd5('0x40')](respondWithResult(_0xe71454,0xc9))['catch'](handleError(_0xe71454,null));};exports[_0x1bd5('0x23')]=function(_0x227a68,_0x2a1ece){if(_0x227a68[_0x1bd5('0x4a')]['id']){delete _0x227a68[_0x1bd5('0x4a')]['id'];}return db[_0x1bd5('0x2a')]['find']({'where':{'id':_0x227a68[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x2a1ece,null))[_0x1bd5('0x40')](saveUpdates(_0x227a68[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x2a1ece,null))[_0x1bd5('0x48')](handleError(_0x2a1ece,null));};exports[_0x1bd5('0x24')]=function(_0x539d0e,_0x587c46){return db[_0x1bd5('0x2a')][_0x1bd5('0x4b')]({'where':{'id':_0x539d0e[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x587c46,null))[_0x1bd5('0x40')](removeEntity(_0x587c46,null))[_0x1bd5('0x48')](handleError(_0x587c46,null));};exports[_0x1bd5('0x4c')]=function(_0x1f2d7e,_0x11813d){return db[_0x1bd5('0x2a')][_0x1bd5('0x4c')]()['then'](respondWithResult(_0x11813d,null))[_0x1bd5('0x48')](handleError(_0x11813d,null));}; \ No newline at end of file +var _0xac9d=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac9d,0x14d));var _0xdac9=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xac9d[_0x547add];return _0x2ed1f3;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b'));_0x3eed7a[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x170afd[_0xdac9('0x34')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a[_0xdac9('0x34')]);_0x4c4e21[_0xdac9('0x38')]=_['intersection'](_0x3eed7a['model'],qs[_0xdac9('0x39')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x39')]));_0x4c4e21[_0xdac9('0x38')]=_0x4c4e21[_0xdac9('0x38')]['length']?_0x4c4e21[_0xdac9('0x38')]:_0x3eed7a['model'];if(!_0x170afd[_0xdac9('0x34')][_0xdac9('0x3a')]('nolimit')){_0x4c4e21[_0xdac9('0x20')]=qs['limit'](_0x170afd['query'][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x1e')]);}_0x4c4e21[_0xdac9('0x3b')]=qs['sort'](_0x170afd[_0xdac9('0x34')][_0xdac9('0x3c')]);_0x4c4e21['where']=qs[_0xdac9('0x36')](_[_0xdac9('0x3d')](_0x170afd[_0xdac9('0x34')],_0x3eed7a[_0xdac9('0x36')]),_0x13efba);if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x3e')]){_0x4c4e21[_0xdac9('0x3f')]=_['merge'](_0x4c4e21[_0xdac9('0x3f')],{'$or':_[_0xdac9('0x2d')](_0x13efba,function(_0x238769){if(_0x238769['type']!==_0xdac9('0x40')){var _0x338e4a={};_0x338e4a[_0x238769[_0xdac9('0x2b')]]={'$like':'%'+_0x170afd[_0xdac9('0x34')]['filter']+'%'};return _0x338e4a;}})});}_0x4c4e21=_['merge']({},_0x4c4e21,_0x170afd[_0xdac9('0x41')]);var _0xe47a3c={'where':_0x4c4e21[_0xdac9('0x3f')]};return db[_0xdac9('0x2e')][_0xdac9('0x21')](_0xe47a3c)['then'](function(_0x8435e8){_0x3505c5['count']=_0x8435e8;if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x42')]){_0x4c4e21[_0xdac9('0x43')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x44')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x413fb1){_0x3505c5[_0xdac9('0x45')]=_0x413fb1;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x46')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x47')]=function(_0x24b570,_0x278826){var _0x441676={'raw':!![],'where':{'id':_0x24b570[_0xdac9('0x48')]['id']}},_0x5335ae={};_0x5335ae[_0xdac9('0x33')]=_['keys'](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x5335ae[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x24b570[_0xdac9('0x34')]);_0x5335ae[_0xdac9('0x36')]=_['intersection'](_0x5335ae[_0xdac9('0x33')],_0x5335ae['query']);_0x441676[_0xdac9('0x38')]=_[_0xdac9('0x37')](_0x5335ae[_0xdac9('0x33')],qs[_0xdac9('0x39')](_0x24b570['query']['fields']));_0x441676['attributes']=_0x441676[_0xdac9('0x38')]['length']?_0x441676['attributes']:_0x5335ae[_0xdac9('0x33')];if(_0x24b570[_0xdac9('0x34')]['includeAll']){_0x441676['include']=[{'all':!![]}];}_0x441676=_[_0xdac9('0x49')]({},_0x441676,_0x24b570[_0xdac9('0x41')]);return db[_0xdac9('0x2e')][_0xdac9('0x4a')](_0x441676)[_0xdac9('0x26')](handleEntityNotFound(_0x278826,null))[_0xdac9('0x26')](respondWithResult(_0x278826,null))[_0xdac9('0x46')](handleError(_0x278826,null));};exports[_0xdac9('0x4b')]=function(_0x5c008b,_0x621cf){return db[_0xdac9('0x2e')][_0xdac9('0x4b')](_0x5c008b[_0xdac9('0x4c')],{})[_0xdac9('0x26')](respondWithResult(_0x621cf,0xc9))[_0xdac9('0x46')](handleError(_0x621cf,null));};exports[_0xdac9('0x25')]=function(_0x37b498,_0x140dc5){if(_0x37b498[_0xdac9('0x4c')]['id']){delete _0x37b498[_0xdac9('0x4c')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4a')]({'where':{'id':_0x37b498[_0xdac9('0x48')]['id']}})['then'](handleEntityNotFound(_0x140dc5,null))['then'](saveUpdates(_0x37b498['body'],null))[_0xdac9('0x26')](respondWithResult(_0x140dc5,null))[_0xdac9('0x46')](handleError(_0x140dc5,null));};exports['destroy']=function(_0x2a60bd,_0x2843f2){return db[_0xdac9('0x2e')]['find']({'where':{'id':_0x2a60bd[_0xdac9('0x48')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x2843f2,null))['then'](removeEntity(_0x2843f2,null))['catch'](handleError(_0x2843f2,null));};exports[_0xdac9('0x4d')]=function(_0x4469d8,_0x222de9){return db[_0xdac9('0x2e')][_0xdac9('0x4d')]()[_0xdac9('0x26')](respondWithResult(_0x222de9,null))[_0xdac9('0x46')](handleError(_0x222de9,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 208840a..2249e2d 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x168736,_0x405c75){var _0x485b6c=function(_0x56ce95){while(--_0x56ce95){_0x168736['push'](_0x168736['shift']());}};_0x485b6c(++_0x405c75);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x399754,_0x33a1cd){var _0xf3242f=function(_0x3bc264){while(--_0x3bc264){_0x399754['push'](_0x399754['shift']());}};_0xf3242f(++_0x33a1cd);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index c064d19..7c68eef 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 _0x5735=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x1e1e63,_0x5801bb){var _0x169956=function(_0x53dc95){while(--_0x53dc95){_0x1e1e63['push'](_0x1e1e63['shift']());}};_0x169956(++_0x5801bb);}(_0x5735,0x147));var _0x5573=function(_0x47e3ef,_0x551b2c){_0x47e3ef=_0x47e3ef-0x0;var _0x502417=_0x5735[_0x47e3ef];return _0x502417;};'use strict';var _=require(_0x5573('0x0'));var util=require(_0x5573('0x1'));var moment=require('moment');var BPromise=require(_0x5573('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5573('0x3'));var db=require(_0x5573('0x4'))['db'];var utils=require(_0x5573('0x5'));var logger=require(_0x5573('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5573('0x7'));var client=jayson[_0x5573('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa4995d,_0x7ae3a8,_0x592336){return new BPromise(function(_0x37e47c,_0x20b117){return client[_0x5573('0x9')](_0xa4995d,_0x592336)[_0x5573('0xa')](function(_0x394c1c){logger[_0x5573('0xb')](_0x5573('0xc'),_0x7ae3a8,_0x5573('0xd'));logger[_0x5573('0xe')](_0x5573('0xf'),_0x7ae3a8,'request\x20sent',JSON[_0x5573('0x10')](_0x394c1c));if(_0x394c1c[_0x5573('0x11')]){if(_0x394c1c[_0x5573('0x11')][_0x5573('0x12')]===0x1f4){logger[_0x5573('0x11')](_0x5573('0xc'),_0x7ae3a8,_0x394c1c['error']['message']);return _0x20b117(_0x394c1c[_0x5573('0x11')]['message']);}logger['error'](_0x5573('0xc'),_0x7ae3a8,_0x394c1c['error']['message']);return _0x37e47c(_0x394c1c['error'][_0x5573('0x13')]);}else{logger[_0x5573('0xb')](_0x5573('0xc'),_0x7ae3a8,'request\x20sent');_0x37e47c(_0x394c1c[_0x5573('0x14')][_0x5573('0x13')]);}})['catch'](function(_0x36fc5d){logger[_0x5573('0x11')]('Cdr,\x20%s,\x20%s',_0x7ae3a8,_0x36fc5d);_0x20b117(_0x36fc5d);});});} \ No newline at end of file +var _0x9f54=['http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x345083,_0x3c2710){var _0x9a76ee=function(_0x594a89){while(--_0x594a89){_0x345083['push'](_0x345083['shift']());}};_0x9a76ee(++_0x3c2710);}(_0x9f54,0x103));var _0x49f5=function(_0xa5f1c4,_0x5ca610){_0xa5f1c4=_0xa5f1c4-0x0;var _0x233570=_0x9f54[_0xa5f1c4];return _0x233570;};'use strict';var _=require(_0x49f5('0x0'));var util=require(_0x49f5('0x1'));var moment=require('moment');var BPromise=require(_0x49f5('0x2'));var rs=require(_0x49f5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x49f5('0x4'));var logger=require(_0x49f5('0x5'))('rpc');var config=require(_0x49f5('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49f5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1163df,_0x422939,_0x3f0750){return new BPromise(function(_0x4431c3,_0x15d9ca){return client[_0x49f5('0x8')](_0x1163df,_0x3f0750)[_0x49f5('0x9')](function(_0x178f46){logger[_0x49f5('0xa')](_0x49f5('0xb'),_0x422939,_0x49f5('0xc'));logger['debug'](_0x49f5('0xd'),_0x422939,'request\x20sent',JSON[_0x49f5('0xe')](_0x178f46));if(_0x178f46[_0x49f5('0xf')]){if(_0x178f46[_0x49f5('0xf')][_0x49f5('0x10')]===0x1f4){logger['error'](_0x49f5('0xb'),_0x422939,_0x178f46[_0x49f5('0xf')]['message']);return _0x15d9ca(_0x178f46[_0x49f5('0xf')][_0x49f5('0x11')]);}logger[_0x49f5('0xf')](_0x49f5('0xb'),_0x422939,_0x178f46['error'][_0x49f5('0x11')]);return _0x4431c3(_0x178f46['error'][_0x49f5('0x11')]);}else{logger['info'](_0x49f5('0xb'),_0x422939,_0x49f5('0xc'));_0x4431c3(_0x178f46['result']['message']);}})[_0x49f5('0x12')](function(_0x2829e0){logger['error'](_0x49f5('0xb'),_0x422939,_0x2829e0);_0x15d9ca(_0x2829e0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 54444d0..891c51c 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2d1cf4,_0x2ea9ee){var _0x554a7c=function(_0x55cc39){while(--_0x55cc39){_0x2d1cf4['push'](_0x2d1cf4['shift']());}};_0x554a7c(++_0x2ea9ee);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1ad33a,_0x348ad6){var _0xf0d6d2=function(_0xd099b4){while(--_0xd099b4){_0x1ad33a['push'](_0x1ad33a['shift']());}};_0xf0d6d2(++_0x348ad6);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d9d1e,_0x5d284a){_0x3d9d1e=_0x3d9d1e-0x0;var _0x58a4e2=_0xb10b[_0x3d9d1e];return _0x58a4e2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index f90a3de..bc34ab9 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 _0x5b25=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0xba856b,_0x14ac21){var _0x5dbfa8=function(_0x1a0177){while(--_0x1a0177){_0xba856b['push'](_0xba856b['shift']());}};_0x5dbfa8(++_0x14ac21);}(_0x5b25,0x1d8));var _0x55b2=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x5b25[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x55b2('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x55b2('0x1')],'allowNull':![],'defaultValue':_0x55b2('0x2')},'appdata':{'type':Sequelize[_0x55b2('0x3')]()},'description':{'type':Sequelize[_0x55b2('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x55b2('0x4')}}; \ No newline at end of file +var _0x99b6=['STRING','TEXT','sequelize','exports'];(function(_0x19776e,_0x3690de){var _0xce4b5f=function(_0x6e04fd){while(--_0x6e04fd){_0x19776e['push'](_0x19776e['shift']());}};_0xce4b5f(++_0x3690de);}(_0x99b6,0x1be));var _0x699b=function(_0x20e229,_0x465679){_0x20e229=_0x20e229-0x0;var _0x186559=_0x99b6[_0x20e229];return _0x186559;};'use strict';var Sequelize=require(_0x699b('0x0'));module[_0x699b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x699b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x699b('0x3')]()},'description':{'type':Sequelize[_0x699b('0x2')]},'interval':{'type':Sequelize[_0x699b('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e44bed1..b5b5362 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 _0x6ae2=['error','name','show','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy'];(function(_0x29d9ae,_0x2153a5){var _0x125218=function(_0xc15156){while(--_0xc15156){_0x29d9ae['push'](_0x29d9ae['shift']());}};_0x125218(++_0x2153a5);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x76bb5c,_0x218675){_0x76bb5c=_0x76bb5c-0x0;var _0x50e166=_0x6ae2[_0x76bb5c];return _0x50e166;};'use strict';var emlformat=require(_0x26ae('0x0'));var rimraf=require(_0x26ae('0x1'));var zipdir=require(_0x26ae('0x2'));var jsonpatch=require(_0x26ae('0x3'));var rp=require(_0x26ae('0x4'));var moment=require(_0x26ae('0x5'));var BPromise=require(_0x26ae('0x6'));var Mustache=require(_0x26ae('0x7'));var util=require(_0x26ae('0x8'));var path=require('path');var sox=require(_0x26ae('0x9'));var csv=require(_0x26ae('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ae('0xb'));var squel=require(_0x26ae('0xc'));var crypto=require(_0x26ae('0xd'));var jsforce=require(_0x26ae('0xe'));var deskjs=require(_0x26ae('0xf'));var toCsv=require(_0x26ae('0xa'));var querystring=require(_0x26ae('0x10'));var Papa=require(_0x26ae('0x11'));var Redis=require(_0x26ae('0x12'));var authService=require(_0x26ae('0x13'));var qs=require(_0x26ae('0x14'));var as=require(_0x26ae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26ae('0x16'))('api');var utils=require(_0x26ae('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ae('0x18'))['db'];function respondWithStatusCode(_0x46bc2,_0x21811d){_0x21811d=_0x21811d||0xcc;return function(_0x17f9a6){if(_0x17f9a6){return _0x46bc2[_0x26ae('0x19')](_0x21811d);}return _0x46bc2[_0x26ae('0x1a')](_0x21811d)[_0x26ae('0x1b')]();};}function respondWithResult(_0x1c66b8,_0x2390a7){_0x2390a7=_0x2390a7||0xc8;return function(_0x52d611){if(_0x52d611){return _0x1c66b8[_0x26ae('0x1a')](_0x2390a7)[_0x26ae('0x1c')](_0x52d611);}};}function respondWithFilteredResult(_0x4e5c4e,_0x15d055){return function(_0x32cd9e){if(_0x32cd9e){var _0x497974=typeof _0x15d055[_0x26ae('0x1d')]===_0x26ae('0x1e')&&typeof _0x15d055[_0x26ae('0x1f')]===_0x26ae('0x1e');var _0x13ad43=_0x32cd9e[_0x26ae('0x20')];var _0x250dc0=_0x497974?0x0:_0x15d055[_0x26ae('0x1d')];var _0x28584c=_0x497974?_0x32cd9e[_0x26ae('0x20')]:_0x15d055[_0x26ae('0x1d')]+_0x15d055[_0x26ae('0x1f')];var _0x38102c;if(_0x28584c>=_0x13ad43){_0x28584c=_0x13ad43;_0x38102c=0xc8;}else{_0x38102c=0xce;}_0x4e5c4e[_0x26ae('0x1a')](_0x38102c);return _0x4e5c4e[_0x26ae('0x21')](_0x26ae('0x22'),_0x250dc0+'-'+_0x28584c+'/'+_0x13ad43)[_0x26ae('0x1c')](_0x32cd9e);}return null;};}function patchUpdates(_0xdfcd69){return function(_0x22d535){try{jsonpatch[_0x26ae('0x23')](_0x22d535,_0xdfcd69,!![]);}catch(_0x334153){return BPromise['reject'](_0x334153);}return _0x22d535['save']();};}function saveUpdates(_0x2a2ba5,_0x5d72dc){return function(_0x22c47b){if(_0x22c47b){return _0x22c47b['update'](_0x2a2ba5)[_0x26ae('0x24')](function(_0x2e34d1){return _0x2e34d1;});}return null;};}function removeEntity(_0x19f641,_0x57062e){return function(_0x4ab3f1){if(_0x4ab3f1){return _0x4ab3f1[_0x26ae('0x25')]()[_0x26ae('0x24')](function(){_0x19f641[_0x26ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caf20,_0x295cc2){return function(_0x53e0da){if(!_0x53e0da){_0x2caf20[_0x26ae('0x19')](0x194);}return _0x53e0da;};}function handleError(_0x2658ed,_0x19eacc){_0x19eacc=_0x19eacc||0x1f4;return function(_0x4a0045){logger[_0x26ae('0x26')](_0x4a0045['stack']);if(_0x4a0045[_0x26ae('0x27')]){delete _0x4a0045[_0x26ae('0x27')];}_0x2658ed[_0x26ae('0x1a')](_0x19eacc)['send'](_0x4a0045);};}exports[_0x26ae('0x28')]=function(_0x5a8301,_0x4cddc4){var _0x2f2e9d={'raw':!![],'where':{'id':_0x5a8301['params']['id']}},_0x2fcc89={};_0x2fcc89[_0x26ae('0x29')]=_[_0x26ae('0x2a')](db[_0x26ae('0x2b')][_0x26ae('0x2c')]);_0x2fcc89[_0x26ae('0x2d')]=_['keys'](_0x5a8301[_0x26ae('0x2d')]);_0x2fcc89[_0x26ae('0x2e')]=_[_0x26ae('0x2f')](_0x2fcc89[_0x26ae('0x29')],_0x2fcc89[_0x26ae('0x2d')]);_0x2f2e9d['attributes']=_[_0x26ae('0x2f')](_0x2fcc89[_0x26ae('0x29')],qs[_0x26ae('0x30')](_0x5a8301[_0x26ae('0x2d')][_0x26ae('0x30')]));_0x2f2e9d[_0x26ae('0x31')]=_0x2f2e9d[_0x26ae('0x31')][_0x26ae('0x32')]?_0x2f2e9d['attributes']:_0x2fcc89[_0x26ae('0x29')];if(_0x5a8301['query']['includeAll']){_0x2f2e9d[_0x26ae('0x33')]=[{'all':!![]}];}_0x2f2e9d=_[_0x26ae('0x34')]({},_0x2f2e9d,_0x5a8301[_0x26ae('0x35')]);return db['ChatApplication'][_0x26ae('0x36')](_0x2f2e9d)[_0x26ae('0x24')](handleEntityNotFound(_0x4cddc4,null))[_0x26ae('0x24')](respondWithResult(_0x4cddc4,null))[_0x26ae('0x37')](handleError(_0x4cddc4,null));};exports[_0x26ae('0x38')]=function(_0x20aa74,_0x9ed674){if(_0x20aa74[_0x26ae('0x39')]['id']){delete _0x20aa74[_0x26ae('0x39')]['id'];}return db[_0x26ae('0x2b')][_0x26ae('0x36')]({'where':{'id':_0x20aa74[_0x26ae('0x3a')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x9ed674,null))[_0x26ae('0x24')](saveUpdates(_0x20aa74['body'],null))[_0x26ae('0x24')](respondWithResult(_0x9ed674,null))[_0x26ae('0x37')](handleError(_0x9ed674,null));};exports[_0x26ae('0x25')]=function(_0x484dec,_0x20c60a){return db[_0x26ae('0x2b')][_0x26ae('0x36')]({'where':{'id':_0x484dec[_0x26ae('0x3a')]['id']}})[_0x26ae('0x24')](handleEntityNotFound(_0x20c60a,null))['then'](removeEntity(_0x20c60a,null))[_0x26ae('0x37')](handleError(_0x20c60a,null));}; \ No newline at end of file +var _0x66d3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','show','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','include','merge','find','then','catch','body','params','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x66d3,0x10f));var _0x366d=function(_0x214527,_0x4660b2){_0x214527=_0x214527-0x0;var _0x38d24b=_0x66d3[_0x214527];return _0x38d24b;};'use strict';var emlformat=require(_0x366d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x366d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366d('0x2'));var moment=require(_0x366d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x366d('0x4'));var util=require('util');var path=require(_0x366d('0x5'));var sox=require('sox');var csv=require(_0x366d('0x6'));var ejs=require(_0x366d('0x7'));var fs=require('fs');var fs_extra=require(_0x366d('0x8'));var _=require(_0x366d('0x9'));var squel=require(_0x366d('0xa'));var crypto=require(_0x366d('0xb'));var jsforce=require(_0x366d('0xc'));var deskjs=require(_0x366d('0xd'));var toCsv=require(_0x366d('0x6'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require('ioredis');var authService=require(_0x366d('0x10'));var qs=require(_0x366d('0x11'));var as=require(_0x366d('0x12'));var hardwareService=require(_0x366d('0x13'));var logger=require(_0x366d('0x14'))(_0x366d('0x15'));var utils=require(_0x366d('0x16'));var config=require(_0x366d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x210ed0,_0x797ee){_0x797ee=_0x797ee||0xcc;return function(_0x3dd776){if(_0x3dd776){return _0x210ed0[_0x366d('0x18')](_0x797ee);}return _0x210ed0[_0x366d('0x19')](_0x797ee)[_0x366d('0x1a')]();};}function respondWithResult(_0x4fa003,_0x265292){_0x265292=_0x265292||0xc8;return function(_0x2a3fdb){if(_0x2a3fdb){return _0x4fa003['status'](_0x265292)[_0x366d('0x1b')](_0x2a3fdb);}};}function respondWithFilteredResult(_0x287d17,_0x54a1bb){return function(_0x3da66f){if(_0x3da66f){var _0x309dc6=typeof _0x54a1bb[_0x366d('0x1c')]==='undefined'&&typeof _0x54a1bb[_0x366d('0x1d')]==='undefined';var _0xbc2286=_0x3da66f[_0x366d('0x1e')];var _0x5a1c0a=_0x309dc6?0x0:_0x54a1bb[_0x366d('0x1c')];var _0x235ff2=_0x309dc6?_0x3da66f[_0x366d('0x1e')]:_0x54a1bb[_0x366d('0x1c')]+_0x54a1bb[_0x366d('0x1d')];var _0x4ce0c6;if(_0x235ff2>=_0xbc2286){_0x235ff2=_0xbc2286;_0x4ce0c6=0xc8;}else{_0x4ce0c6=0xce;}_0x287d17[_0x366d('0x19')](_0x4ce0c6);return _0x287d17['set'](_0x366d('0x1f'),_0x5a1c0a+'-'+_0x235ff2+'/'+_0xbc2286)['json'](_0x3da66f);}return null;};}function patchUpdates(_0x5cbe3b){return function(_0x219106){try{jsonpatch[_0x366d('0x20')](_0x219106,_0x5cbe3b,!![]);}catch(_0x5a4a75){return BPromise[_0x366d('0x21')](_0x5a4a75);}return _0x219106[_0x366d('0x22')]();};}function saveUpdates(_0x1ed99c,_0x58d16f){return function(_0x3b5c89){if(_0x3b5c89){return _0x3b5c89[_0x366d('0x23')](_0x1ed99c)['then'](function(_0x3d4941){return _0x3d4941;});}return null;};}function removeEntity(_0x47ebf4,_0x1c9ee9){return function(_0x1326c9){if(_0x1326c9){return _0x1326c9[_0x366d('0x24')]()['then'](function(){_0x47ebf4[_0x366d('0x19')](0xcc)[_0x366d('0x1a')]();});}};}function handleEntityNotFound(_0x2a1d96,_0x5254e6){return function(_0x53002e){if(!_0x53002e){_0x2a1d96['sendStatus'](0x194);}return _0x53002e;};}function handleError(_0x199e3b,_0x40f3df){_0x40f3df=_0x40f3df||0x1f4;return function(_0x5d2b67){logger['error'](_0x5d2b67[_0x366d('0x25')]);if(_0x5d2b67[_0x366d('0x26')]){delete _0x5d2b67[_0x366d('0x26')];}_0x199e3b[_0x366d('0x19')](_0x40f3df)['send'](_0x5d2b67);};}exports[_0x366d('0x27')]=function(_0x5dc954,_0x47cc0c){var _0x13a6b2={'raw':!![],'where':{'id':_0x5dc954['params']['id']}},_0x594d42={};_0x594d42[_0x366d('0x28')]=_[_0x366d('0x29')](db[_0x366d('0x2a')]['rawAttributes']);_0x594d42[_0x366d('0x2b')]=_[_0x366d('0x29')](_0x5dc954[_0x366d('0x2b')]);_0x594d42[_0x366d('0x2c')]=_[_0x366d('0x2d')](_0x594d42[_0x366d('0x28')],_0x594d42['query']);_0x13a6b2[_0x366d('0x2e')]=_['intersection'](_0x594d42[_0x366d('0x28')],qs['fields'](_0x5dc954[_0x366d('0x2b')][_0x366d('0x2f')]));_0x13a6b2[_0x366d('0x2e')]=_0x13a6b2[_0x366d('0x2e')]['length']?_0x13a6b2[_0x366d('0x2e')]:_0x594d42[_0x366d('0x28')];if(_0x5dc954[_0x366d('0x2b')][_0x366d('0x30')]){_0x13a6b2[_0x366d('0x31')]=[{'all':!![]}];}_0x13a6b2=_[_0x366d('0x32')]({},_0x13a6b2,_0x5dc954['options']);return db['ChatApplication'][_0x366d('0x33')](_0x13a6b2)[_0x366d('0x34')](handleEntityNotFound(_0x47cc0c,null))[_0x366d('0x34')](respondWithResult(_0x47cc0c,null))[_0x366d('0x35')](handleError(_0x47cc0c,null));};exports['update']=function(_0x2d95eb,_0x3517bc){if(_0x2d95eb[_0x366d('0x36')]['id']){delete _0x2d95eb[_0x366d('0x36')]['id'];}return db[_0x366d('0x2a')][_0x366d('0x33')]({'where':{'id':_0x2d95eb[_0x366d('0x37')]['id']}})[_0x366d('0x34')](handleEntityNotFound(_0x3517bc,null))[_0x366d('0x34')](saveUpdates(_0x2d95eb['body'],null))[_0x366d('0x34')](respondWithResult(_0x3517bc,null))[_0x366d('0x35')](handleError(_0x3517bc,null));};exports[_0x366d('0x24')]=function(_0x5a93f3,_0x7e7460){return db[_0x366d('0x2a')][_0x366d('0x33')]({'where':{'id':_0x5a93f3[_0x366d('0x37')]['id']}})[_0x366d('0x34')](handleEntityNotFound(_0x7e7460,null))[_0x366d('0x34')](removeEntity(_0x7e7460,null))['catch'](handleError(_0x7e7460,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 25a669d..9a88ee4 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 _0x0a4b=['../../config/logger','api','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x34f7c2,_0x264892){var _0x206ea2=function(_0x1c9f7a){while(--_0x1c9f7a){_0x34f7c2['push'](_0x34f7c2['shift']());}};_0x206ea2(++_0x264892);}(_0x0a4b,0x6d));var _0xb0a4=function(_0x5c3f8a,_0x5410d1){_0x5c3f8a=_0x5c3f8a-0x0;var _0x180dfb=_0x0a4b[_0x5c3f8a];return _0x180dfb;};'use strict';var _=require(_0xb0a4('0x0'));var util=require('util');var logger=require(_0xb0a4('0x1'))(_0xb0a4('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(_0xb0a4('0x3'));var config=require(_0xb0a4('0x4'));var attributes=require(_0xb0a4('0x5'));module[_0xb0a4('0x6')]=function(_0x53091a,_0x44e301){return _0x53091a[_0xb0a4('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb0a4('0x8'),'collate':_0xb0a4('0x9')});}; \ No newline at end of file +var _0xdc82=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5761a8,_0x48d34b){var _0x25020c=function(_0x4fe272){while(--_0x4fe272){_0x5761a8['push'](_0x5761a8['shift']());}};_0x25020c(++_0x48d34b);}(_0xdc82,0x104));var _0x2dc8=function(_0x304420,_0x596f86){_0x304420=_0x304420-0x0;var _0x47e829=_0xdc82[_0x304420];return _0x47e829;};'use strict';var _=require(_0x2dc8('0x0'));var util=require(_0x2dc8('0x1'));var logger=require(_0x2dc8('0x2'))('api');var moment=require(_0x2dc8('0x3'));var BPromise=require(_0x2dc8('0x4'));var rp=require(_0x2dc8('0x5'));var fs=require('fs');var path=require(_0x2dc8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dc8('0x7'));module[_0x2dc8('0x8')]=function(_0x3249e5,_0x39cc09){return _0x3249e5[_0x2dc8('0x9')](_0x2dc8('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dc8('0xb'),'collate':_0x2dc8('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 183312f..eaab4ef 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 _0x8a38=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x5be58a,_0x5e39d4){var _0xadcedb=function(_0x9ba6bb){while(--_0x9ba6bb){_0x5be58a['push'](_0x5be58a['shift']());}};_0xadcedb(++_0x5e39d4);}(_0x8a38,0x11f));var _0x88a3=function(_0x257280,_0x2921df){_0x257280=_0x257280-0x0;var _0xc4550e=_0x8a38[_0x257280];return _0xc4550e;};'use strict';var _=require(_0x88a3('0x0'));var util=require(_0x88a3('0x1'));var moment=require(_0x88a3('0x2'));var BPromise=require(_0x88a3('0x3'));var rs=require(_0x88a3('0x4'));var fs=require('fs');var Redis=require(_0x88a3('0x5'));var db=require(_0x88a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x88a3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88a3('0x8'));var client=jayson[_0x88a3('0x9')][_0x88a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18aeac,_0x555dec,_0x81115e){return new BPromise(function(_0x1c326b,_0x1d4c73){return client[_0x88a3('0xb')](_0x18aeac,_0x81115e)[_0x88a3('0xc')](function(_0xf8aa29){logger[_0x88a3('0xd')](_0x88a3('0xe'),_0x555dec,_0x88a3('0xf'));logger[_0x88a3('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x555dec,_0x88a3('0xf'),JSON['stringify'](_0xf8aa29));if(_0xf8aa29['error']){if(_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x12')]===0x1f4){logger[_0x88a3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x555dec,_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);return _0x1d4c73(_0xf8aa29['error'][_0x88a3('0x13')]);}logger['error'](_0x88a3('0xe'),_0x555dec,_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);return _0x1c326b(_0xf8aa29[_0x88a3('0x11')][_0x88a3('0x13')]);}else{logger['info'](_0x88a3('0xe'),_0x555dec,_0x88a3('0xf'));_0x1c326b(_0xf8aa29[_0x88a3('0x14')][_0x88a3('0x13')]);}})[_0x88a3('0x15')](function(_0x311052){logger[_0x88a3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x555dec,_0x311052);_0x1d4c73(_0x311052);});});} \ No newline at end of file +var _0x0a67=['../../config/logger','jayson/promise','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3c373f,_0x41801d){var _0x3a6b1f=function(_0x33c487){while(--_0x33c487){_0x3c373f['push'](_0x3c373f['shift']());}};_0x3a6b1f(++_0x41801d);}(_0x0a67,0x19d));var _0x70a6=function(_0x47ed6c,_0x2386ab){_0x47ed6c=_0x47ed6c-0x0;var _0x491bdf=_0x0a67[_0x47ed6c];return _0x491bdf;};'use strict';var _=require(_0x70a6('0x0'));var util=require(_0x70a6('0x1'));var moment=require('moment');var BPromise=require(_0x70a6('0x2'));var rs=require(_0x70a6('0x3'));var fs=require('fs');var Redis=require(_0x70a6('0x4'));var db=require(_0x70a6('0x5'))['db'];var utils=require(_0x70a6('0x6'));var logger=require(_0x70a6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70a6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8a3f,_0x577505,_0x316864){return new BPromise(function(_0x43abc1,_0x444149){return client[_0x70a6('0x9')](_0x1f8a3f,_0x316864)[_0x70a6('0xa')](function(_0xd65d3b){logger[_0x70a6('0xb')]('ChatApplication,\x20%s,\x20%s',_0x577505,_0x70a6('0xc'));logger[_0x70a6('0xd')](_0x70a6('0xe'),_0x577505,_0x70a6('0xc'),JSON[_0x70a6('0xf')](_0xd65d3b));if(_0xd65d3b[_0x70a6('0x10')]){if(_0xd65d3b[_0x70a6('0x10')]['code']===0x1f4){logger[_0x70a6('0x10')](_0x70a6('0x11'),_0x577505,_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);return _0x444149(_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);}logger['error'](_0x70a6('0x11'),_0x577505,_0xd65d3b[_0x70a6('0x10')][_0x70a6('0x12')]);return _0x43abc1(_0xd65d3b['error'][_0x70a6('0x12')]);}else{logger[_0x70a6('0xb')](_0x70a6('0x11'),_0x577505,_0x70a6('0xc'));_0x43abc1(_0xd65d3b[_0x70a6('0x13')]['message']);}})[_0x70a6('0x14')](function(_0x1bd023){logger['error'](_0x70a6('0x11'),_0x577505,_0x1bd023);_0x444149(_0x1bd023);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c96a4b1..6f72957 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 _0x5805=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x5805,0x152));var _0x5580=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5805[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x5580('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5580('0x1'));var express=require(_0x5580('0x2'));var router=express[_0x5580('0x3')]();var fs_extra=require(_0x5580('0x4'));var auth=require(_0x5580('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5580('0x6'));var controller=require('./chatApplication.controller');router['get'](_0x5580('0x7'),auth[_0x5580('0x8')](),controller[_0x5580('0x9')]);router[_0x5580('0xa')]('/:id',auth[_0x5580('0x8')](),controller['update']);router[_0x5580('0xb')](_0x5580('0x7'),auth[_0x5580('0x8')](),controller[_0x5580('0xc')]);module['exports']=router; \ No newline at end of file +var _0x4c78=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3db750,_0x5d66c2){var _0x5427a=function(_0x41fdb8){while(--_0x41fdb8){_0x3db750['push'](_0x3db750['shift']());}};_0x5427a(++_0x5d66c2);}(_0x4c78,0x14d));var _0x84c7=function(_0x34a378,_0x1509b8){_0x34a378=_0x34a378-0x0;var _0x296df0=_0x4c78[_0x34a378];return _0x296df0;};'use strict';var multer=require(_0x84c7('0x0'));var util=require(_0x84c7('0x1'));var path=require(_0x84c7('0x2'));var timeout=require(_0x84c7('0x3'));var express=require(_0x84c7('0x4'));var router=express[_0x84c7('0x5')]();var fs_extra=require(_0x84c7('0x6'));var auth=require(_0x84c7('0x7'));var interaction=require(_0x84c7('0x8'));var config=require(_0x84c7('0x9'));var controller=require(_0x84c7('0xa'));router[_0x84c7('0xb')](_0x84c7('0xc'),auth[_0x84c7('0xd')](),controller[_0x84c7('0xe')]);router[_0x84c7('0xf')](_0x84c7('0xc'),auth[_0x84c7('0xd')](),controller['update']);router[_0x84c7('0x10')]('/:id',auth[_0x84c7('0xd')](),controller['destroy']);module[_0x84c7('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e95d9db..c0b277f 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 _0xf068=['STRING'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0xf068,0x8b));var _0x8f06=function(_0xc99c1d,_0x4ae3ea){_0xc99c1d=_0xc99c1d-0x0;var _0x1adbc6=_0xf068[_0xc99c1d];return _0x1adbc6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8f06('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8f06('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2237=['sequelize','exports','STRING','BOOLEAN'];(function(_0xe5ee4f,_0x4a6510){var _0x60662b=function(_0x35d981){while(--_0x35d981){_0xe5ee4f['push'](_0xe5ee4f['shift']());}};_0x60662b(++_0x4a6510);}(_0x2237,0x124));var _0x7223=function(_0x4c1b3b,_0x1f8401){_0x4c1b3b=_0x4c1b3b-0x0;var _0x38b5bd=_0x2237[_0x4c1b3b];return _0x38b5bd;};'use strict';var Sequelize=require(_0x7223('0x0'));module[_0x7223('0x1')]={'name':{'type':Sequelize[_0x7223('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7223('0x2')]},'write':{'type':Sequelize[_0x7223('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 0c996f3..8d6d1ed 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 _0x7daa=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./chatGroup.socket','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','show','params','keys','length','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x221465,_0x4aed6c){var _0x550c92=function(_0x2373d4){while(--_0x2373d4){_0x221465['push'](_0x221465['shift']());}};_0x550c92(++_0x4aed6c);}(_0x7daa,0xb1));var _0xa7da=function(_0x6a5860,_0x14d03e){_0x6a5860=_0x6a5860-0x0;var _0x4c6ad9=_0x7daa[_0x6a5860];return _0x4c6ad9;};'use strict';var emlformat=require(_0xa7da('0x0'));var rimraf=require(_0xa7da('0x1'));var zipdir=require(_0xa7da('0x2'));var jsonpatch=require(_0xa7da('0x3'));var rp=require(_0xa7da('0x4'));var moment=require(_0xa7da('0x5'));var BPromise=require(_0xa7da('0x6'));var Mustache=require(_0xa7da('0x7'));var util=require(_0xa7da('0x8'));var path=require(_0xa7da('0x9'));var sox=require('sox');var csv=require(_0xa7da('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7da('0xb'));var squel=require('squel');var crypto=require(_0xa7da('0xc'));var jsforce=require(_0xa7da('0xd'));var deskjs=require(_0xa7da('0xe'));var toCsv=require(_0xa7da('0xa'));var querystring=require(_0xa7da('0xf'));var Papa=require(_0xa7da('0x10'));var Redis=require(_0xa7da('0x11'));var authService=require(_0xa7da('0x12'));var qs=require(_0xa7da('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7da('0x14'));var logger=require(_0xa7da('0x15'))(_0xa7da('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa7da('0x17'));var db=require(_0xa7da('0x18'))['db'];config['redis']=_['defaults'](config[_0xa7da('0x19')],{'host':_0xa7da('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa7da('0x1b'))[_0xa7da('0x1c')](socket);function respondWithStatusCode(_0xc83064,_0x2ad29d){_0x2ad29d=_0x2ad29d||0xcc;return function(_0xd6493b){if(_0xd6493b){return _0xc83064[_0xa7da('0x1d')](_0x2ad29d);}return _0xc83064['status'](_0x2ad29d)['end']();};}function respondWithResult(_0x4f11a1,_0x44b286){_0x44b286=_0x44b286||0xc8;return function(_0x55b4aa){if(_0x55b4aa){return _0x4f11a1[_0xa7da('0x1e')](_0x44b286)['json'](_0x55b4aa);}};}function respondWithFilteredResult(_0x314a1b,_0x59cdb3){return function(_0x5ba0ce){if(_0x5ba0ce){var _0x281ec6=typeof _0x59cdb3[_0xa7da('0x1f')]===_0xa7da('0x20')&&typeof _0x59cdb3['limit']==='undefined';var _0x2e31e4=_0x5ba0ce[_0xa7da('0x21')];var _0x5bf6a6=_0x281ec6?0x0:_0x59cdb3[_0xa7da('0x1f')];var _0x2a55b9=_0x281ec6?_0x5ba0ce['count']:_0x59cdb3[_0xa7da('0x1f')]+_0x59cdb3[_0xa7da('0x22')];var _0x447948;if(_0x2a55b9>=_0x2e31e4){_0x2a55b9=_0x2e31e4;_0x447948=0xc8;}else{_0x447948=0xce;}_0x314a1b[_0xa7da('0x1e')](_0x447948);return _0x314a1b[_0xa7da('0x23')](_0xa7da('0x24'),_0x5bf6a6+'-'+_0x2a55b9+'/'+_0x2e31e4)[_0xa7da('0x25')](_0x5ba0ce);}return null;};}function patchUpdates(_0x423410){return function(_0x2343a9){try{jsonpatch[_0xa7da('0x26')](_0x2343a9,_0x423410,!![]);}catch(_0x3174ab){return BPromise[_0xa7da('0x27')](_0x3174ab);}return _0x2343a9[_0xa7da('0x28')]();};}function saveUpdates(_0x21456d,_0x272404){return function(_0x117f1e){if(_0x117f1e){return _0x117f1e[_0xa7da('0x29')](_0x21456d)['then'](function(_0x21a926){return _0x21a926;});}return null;};}function removeEntity(_0x4a0bd1,_0x48d04e){return function(_0xa1ab53){if(_0xa1ab53){return _0xa1ab53[_0xa7da('0x2a')]()[_0xa7da('0x2b')](function(){_0x4a0bd1['status'](0xcc)[_0xa7da('0x2c')]();});}};}function handleEntityNotFound(_0x324b30,_0x123917){return function(_0xb55cc4){if(!_0xb55cc4){_0x324b30[_0xa7da('0x1d')](0x194);}return _0xb55cc4;};}function handleError(_0x2f477d,_0x2ab1b1){_0x2ab1b1=_0x2ab1b1||0x1f4;return function(_0x5e183e){logger[_0xa7da('0x2d')](_0x5e183e['stack']);if(_0x5e183e[_0xa7da('0x2e')]){delete _0x5e183e[_0xa7da('0x2e')];}_0x2f477d[_0xa7da('0x1e')](_0x2ab1b1)[_0xa7da('0x2f')](_0x5e183e);};}exports[_0xa7da('0x30')]=function(_0x2a844b,_0x429874){var _0xc80c16={},_0x41d758={},_0x3f3554={'count':0x0,'rows':[]};var _0x1f8f02=_[_0xa7da('0x31')](db[_0xa7da('0x32')][_0xa7da('0x33')],function(_0x393eb8){return{'name':_0x393eb8[_0xa7da('0x34')],'type':_0x393eb8['type'][_0xa7da('0x35')]};});_0x41d758[_0xa7da('0x36')]=_[_0xa7da('0x31')](_0x1f8f02,_0xa7da('0x2e'));_0x41d758[_0xa7da('0x37')]=_['keys'](_0x2a844b['query']);_0x41d758[_0xa7da('0x38')]=_[_0xa7da('0x39')](_0x41d758[_0xa7da('0x36')],_0x41d758[_0xa7da('0x37')]);_0xc80c16[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x41d758[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x2a844b[_0xa7da('0x37')]['fields']));_0xc80c16[_0xa7da('0x3a')]=_0xc80c16[_0xa7da('0x3a')]['length']?_0xc80c16[_0xa7da('0x3a')]:_0x41d758[_0xa7da('0x36')];if(!_0x2a844b['query'][_0xa7da('0x3c')]('nolimit')){_0xc80c16[_0xa7da('0x22')]=qs[_0xa7da('0x22')](_0x2a844b[_0xa7da('0x37')]['limit']);_0xc80c16[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x2a844b[_0xa7da('0x37')][_0xa7da('0x1f')]);}_0xc80c16[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x2a844b[_0xa7da('0x37')][_0xa7da('0x3e')]);_0xc80c16[_0xa7da('0x3f')]=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x2a844b[_0xa7da('0x37')],_0x41d758[_0xa7da('0x38')]),_0x1f8f02);if(_0x2a844b[_0xa7da('0x37')][_0xa7da('0x41')]){_0xc80c16[_0xa7da('0x3f')]=_[_0xa7da('0x42')](_0xc80c16[_0xa7da('0x3f')],{'$or':_[_0xa7da('0x31')](_0x1f8f02,function(_0x13dde5){if(_0x13dde5[_0xa7da('0x43')]!==_0xa7da('0x44')){var _0x38191f={};_0x38191f[_0x13dde5['name']]={'$like':'%'+_0x2a844b[_0xa7da('0x37')][_0xa7da('0x41')]+'%'};return _0x38191f;}})});}_0xc80c16=_[_0xa7da('0x42')]({},_0xc80c16,_0x2a844b['options']);var _0x8bdecd={'where':_0xc80c16[_0xa7da('0x3f')]};return db['ChatGroup'][_0xa7da('0x21')](_0x8bdecd)[_0xa7da('0x2b')](function(_0x3a7171){_0x3f3554[_0xa7da('0x21')]=_0x3a7171;if(_0x2a844b[_0xa7da('0x37')][_0xa7da('0x45')]){_0xc80c16[_0xa7da('0x46')]=[{'all':!![]}];}return db[_0xa7da('0x32')]['findAll'](_0xc80c16);})[_0xa7da('0x2b')](function(_0x3024fa){_0x3f3554['rows']=_0x3024fa;return _0x3f3554;})[_0xa7da('0x2b')](respondWithFilteredResult(_0x429874,_0xc80c16))[_0xa7da('0x47')](handleError(_0x429874,null));};exports[_0xa7da('0x48')]=function(_0x3b1928,_0x50aa5d){var _0x29f8e7={'raw':!![],'where':{'id':_0x3b1928[_0xa7da('0x49')]['id']}},_0x4650cf={};_0x4650cf[_0xa7da('0x36')]=_[_0xa7da('0x4a')](db[_0xa7da('0x32')][_0xa7da('0x33')]);_0x4650cf[_0xa7da('0x37')]=_['keys'](_0x3b1928[_0xa7da('0x37')]);_0x4650cf[_0xa7da('0x38')]=_['intersection'](_0x4650cf['model'],_0x4650cf[_0xa7da('0x37')]);_0x29f8e7[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x4650cf[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x3b1928[_0xa7da('0x37')]['fields']));_0x29f8e7[_0xa7da('0x3a')]=_0x29f8e7[_0xa7da('0x3a')][_0xa7da('0x4b')]?_0x29f8e7['attributes']:_0x4650cf[_0xa7da('0x36')];if(_0x3b1928[_0xa7da('0x37')][_0xa7da('0x45')]){_0x29f8e7['include']=[{'all':!![]}];}_0x29f8e7=_[_0xa7da('0x42')]({},_0x29f8e7,_0x3b1928[_0xa7da('0x4c')]);return db[_0xa7da('0x32')][_0xa7da('0x4d')](_0x29f8e7)['then'](handleEntityNotFound(_0x50aa5d,null))[_0xa7da('0x2b')](respondWithResult(_0x50aa5d,null))['catch'](handleError(_0x50aa5d,null));};exports[_0xa7da('0x4e')]=function(_0x1a9bdf,_0x8e81b9){return db[_0xa7da('0x32')][_0xa7da('0x4e')](_0x1a9bdf[_0xa7da('0x4f')],{})[_0xa7da('0x2b')](respondWithResult(_0x8e81b9,0xc9))[_0xa7da('0x47')](handleError(_0x8e81b9,null));};exports[_0xa7da('0x29')]=function(_0x565a90,_0x362fce){if(_0x565a90[_0xa7da('0x4f')]['id']){delete _0x565a90[_0xa7da('0x4f')]['id'];}return db['ChatGroup'][_0xa7da('0x4d')]({'where':{'id':_0x565a90[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x362fce,null))[_0xa7da('0x2b')](saveUpdates(_0x565a90[_0xa7da('0x4f')],null))['then'](respondWithResult(_0x362fce,null))[_0xa7da('0x47')](handleError(_0x362fce,null));};exports['destroy']=function(_0x47f713,_0x368ab9){return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x47f713[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x368ab9,null))[_0xa7da('0x2b')](removeEntity(_0x368ab9,null))[_0xa7da('0x47')](handleError(_0x368ab9,null));};exports[_0xa7da('0x50')]=function(_0x123e90,_0x6096fd){return db[_0xa7da('0x32')][_0xa7da('0x50')]()[_0xa7da('0x2b')](respondWithResult(_0x6096fd,null))[_0xa7da('0x47')](handleError(_0x6096fd,null));};exports[_0xa7da('0x51')]=function(_0xd84b48,_0x415d9a,_0x342900){return db[_0xa7da('0x52')][_0xa7da('0x21')]({'where':{'ChatGroupId':_0xd84b48[_0xa7da('0x49')]['id'],'ToId':_0xd84b48[_0xa7da('0x53')]['id'],'read':![]}})[_0xa7da('0x2b')](function(_0x524c0c){return{'id':_[_0xa7da('0x54')](_0xd84b48[_0xa7da('0x49')]['id']),'count':_0x524c0c};})[_0xa7da('0x2b')](respondWithResult(_0x415d9a,null))[_0xa7da('0x47')](handleError(_0x415d9a,null));};exports[_0xa7da('0x55')]=function(_0x36d6cb,_0x40d044,_0xa0bbb5){return db['ChatGroup'][_0xa7da('0x4d')]({'where':{'id':_0x36d6cb[_0xa7da('0x49')]['id']}})['then'](handleEntityNotFound(_0x40d044,null))[_0xa7da('0x2b')](function(_0x57cdb1){if(_0x57cdb1){return _0x57cdb1[_0xa7da('0x55')](_0x36d6cb[_0xa7da('0x4f')][_0xa7da('0x56')],_['omit'](_0x36d6cb[_0xa7da('0x4f')],[_0xa7da('0x56'),'id'])||{});}})[_0xa7da('0x2b')](respondWithResult(_0x40d044,null))[_0xa7da('0x47')](handleError(_0x40d044,null));};exports[_0xa7da('0x57')]=function(_0x544ed6,_0x78a524,_0x99807b){var _0x3e5f8e={};var _0x4f1bbe={};var _0x175f17;var _0x321335;return db[_0xa7da('0x32')][_0xa7da('0x58')]({'where':{'id':_0x544ed6[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x78a524,null))[_0xa7da('0x2b')](function(_0x301ba2){if(_0x301ba2){_0x175f17=_0x301ba2;_0x4f1bbe['model']=_['keys'](db['User'][_0xa7da('0x33')]);_0x4f1bbe[_0xa7da('0x37')]=_['keys'](_0x544ed6[_0xa7da('0x37')]);_0x4f1bbe[_0xa7da('0x38')]=_[_0xa7da('0x39')](_0x4f1bbe['model'],_0x4f1bbe[_0xa7da('0x37')]);_0x3e5f8e[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x4f1bbe['model'],qs[_0xa7da('0x3b')](_0x544ed6[_0xa7da('0x37')][_0xa7da('0x3b')]));_0x3e5f8e[_0xa7da('0x3a')]=_0x3e5f8e['attributes'][_0xa7da('0x4b')]?_0x3e5f8e[_0xa7da('0x3a')]:_0x4f1bbe[_0xa7da('0x36')];_0x3e5f8e[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x544ed6[_0xa7da('0x37')]['sort']);_0x3e5f8e[_0xa7da('0x3f')]=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x544ed6[_0xa7da('0x37')],_0x4f1bbe[_0xa7da('0x38')]));if(_0x544ed6['query'][_0xa7da('0x41')]){_0x3e5f8e['where']=_[_0xa7da('0x42')](_0x3e5f8e['where'],{'$or':_['map'](_0x3e5f8e[_0xa7da('0x3a')],function(_0x8dcd7f){var _0x514be9={};_0x514be9[_0x8dcd7f]={'$like':'%'+_0x544ed6[_0xa7da('0x37')]['filter']+'%'};return _0x514be9;})});}_0x3e5f8e=_[_0xa7da('0x42')]({},_0x3e5f8e,_0x544ed6[_0xa7da('0x4c')]);return _0x175f17[_0xa7da('0x57')](_0x3e5f8e);}})[_0xa7da('0x2b')](function(_0x437dd6){if(_0x437dd6){_0x321335=_0x437dd6['length'];if(!_0x544ed6[_0xa7da('0x37')][_0xa7da('0x3c')]('nolimit')){_0x3e5f8e['limit']=qs['limit'](_0x544ed6['query'][_0xa7da('0x22')]);_0x3e5f8e[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x544ed6[_0xa7da('0x37')][_0xa7da('0x1f')]);}return _0x175f17[_0xa7da('0x57')](_0x3e5f8e);}})['then'](function(_0x4b2822){if(_0x4b2822){return _0x4b2822?{'count':_0x321335,'rows':_0x4b2822}:null;}})['then'](respondWithResult(_0x78a524,null))[_0xa7da('0x47')](handleError(_0x78a524,null));};exports[_0xa7da('0x59')]=function(_0x1f8d89,_0x3aa69a,_0x294243){return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x1f8d89['params']['id']}})['then'](handleEntityNotFound(_0x3aa69a,null))[_0xa7da('0x2b')](function(_0x61b8d){if(_0x61b8d){return _0x61b8d[_0xa7da('0x59')](_0x1f8d89[_0xa7da('0x37')][_0xa7da('0x56')]);}})[_0xa7da('0x2b')](respondWithStatusCode(_0x3aa69a,null))[_0xa7da('0x47')](handleError(_0x3aa69a,null));};exports[_0xa7da('0x5a')]=function(_0x16926a,_0x511788,_0x5dbf79){if(_0x16926a['body']['id']){delete _0x16926a[_0xa7da('0x4f')]['id'];}return db[_0xa7da('0x32')][_0xa7da('0x4d')]({'where':{'id':_0x16926a[_0xa7da('0x49')]['id']}})['then'](handleEntityNotFound(_0x511788,null))[_0xa7da('0x2b')](function(_0x8bdef0){if(_0x8bdef0){_0x16926a['body']['ChatGroupId']=_0x8bdef0['id'];return db['ChatInternalMessage'][_0xa7da('0x4e')](_0x16926a[_0xa7da('0x4f')]);}})[_0xa7da('0x2b')](respondWithResult(_0x511788,null))['catch'](handleError(_0x511788,null));};exports[_0xa7da('0x5b')]=function(_0x13a726,_0x1922dc,_0x363c4b){var _0x442947={};var _0x3a32f8={};var _0x462e17;var _0x1f30e8;return db[_0xa7da('0x32')][_0xa7da('0x58')]({'where':{'id':_0x13a726[_0xa7da('0x49')]['id']}})[_0xa7da('0x2b')](handleEntityNotFound(_0x1922dc,null))[_0xa7da('0x2b')](function(_0x29240c){if(_0x29240c){_0x462e17=_0x29240c;_0x3a32f8[_0xa7da('0x36')]=_[_0xa7da('0x4a')](db[_0xa7da('0x52')]['rawAttributes']);_0x3a32f8[_0xa7da('0x37')]=_['keys'](_0x13a726[_0xa7da('0x37')]);_0x3a32f8[_0xa7da('0x38')]=_['intersection'](_0x3a32f8[_0xa7da('0x36')],_0x3a32f8[_0xa7da('0x37')]);_0x442947[_0xa7da('0x3a')]=_[_0xa7da('0x39')](_0x3a32f8[_0xa7da('0x36')],qs[_0xa7da('0x3b')](_0x13a726[_0xa7da('0x37')][_0xa7da('0x3b')]));_0x442947[_0xa7da('0x3a')]=_0x442947[_0xa7da('0x3a')]['length']?_0x442947['attributes']:_0x3a32f8['model'];_0x442947[_0xa7da('0x3d')]=qs[_0xa7da('0x3e')](_0x13a726['query']['sort']);_0x442947['where']=qs[_0xa7da('0x38')](_[_0xa7da('0x40')](_0x13a726[_0xa7da('0x37')],_0x3a32f8[_0xa7da('0x38')]));if(_0x13a726['query'][_0xa7da('0x41')]){_0x442947[_0xa7da('0x3f')]=_[_0xa7da('0x42')](_0x442947[_0xa7da('0x3f')],{'$or':_['map'](_0x442947[_0xa7da('0x3a')],function(_0x24d690){var _0x4c9c98={};_0x4c9c98[_0x24d690]={'$like':'%'+_0x13a726[_0xa7da('0x37')][_0xa7da('0x41')]+'%'};return _0x4c9c98;})});}if(_0x13a726['query'][_0xa7da('0x5c')]){var _0x58b43b=_0x13a726[_0xa7da('0x37')][_0xa7da('0x5c')][_0xa7da('0x5d')](',');var _0x42eb81={};_0x42eb81[_0x58b43b[0x0]]={'$gte':moment(_0x58b43b[0x1])[_0xa7da('0x5e')](_0xa7da('0x5f'))};_0x442947['where']=_[_0xa7da('0x42')](_0x442947['where'],_0x42eb81);}_0x442947=_[_0xa7da('0x42')]({},_0x442947,_0x13a726['options']);return _0x462e17[_0xa7da('0x5b')](_0x442947);}})[_0xa7da('0x2b')](function(_0x380091){if(_0x380091){_0x1f30e8=_0x380091[_0xa7da('0x4b')];if(!_0x13a726[_0xa7da('0x37')][_0xa7da('0x3c')](_0xa7da('0x60'))){_0x442947[_0xa7da('0x22')]=qs[_0xa7da('0x22')](_0x13a726['query'][_0xa7da('0x22')]);_0x442947[_0xa7da('0x1f')]=qs[_0xa7da('0x1f')](_0x13a726[_0xa7da('0x37')][_0xa7da('0x1f')]);}return _0x462e17[_0xa7da('0x5b')](_0x442947);}})['then'](function(_0x262b93){if(_0x262b93){return _0x262b93?{'count':_0x1f30e8,'rows':_0x262b93}:null;}})[_0xa7da('0x2b')](respondWithResult(_0x1922dc,null))[_0xa7da('0x47')](handleError(_0x1922dc,null));}; \ No newline at end of file +var _0x64fb=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','then','error','stack','name','send','map','ChatGroup','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2c944e,_0x26f659){var _0x2cc529=function(_0x3fbc4b){while(--_0x3fbc4b){_0x2c944e['push'](_0x2c944e['shift']());}};_0x2cc529(++_0x26f659);}(_0x64fb,0x16d));var _0xb64f=function(_0x55b884,_0x2ce62f){_0x55b884=_0x55b884-0x0;var _0x1cc64b=_0x64fb[_0x55b884];return _0x1cc64b;};'use strict';var emlformat=require(_0xb64f('0x0'));var rimraf=require(_0xb64f('0x1'));var zipdir=require(_0xb64f('0x2'));var jsonpatch=require(_0xb64f('0x3'));var rp=require(_0xb64f('0x4'));var moment=require(_0xb64f('0x5'));var BPromise=require(_0xb64f('0x6'));var Mustache=require(_0xb64f('0x7'));var util=require(_0xb64f('0x8'));var path=require('path');var sox=require(_0xb64f('0x9'));var csv=require(_0xb64f('0xa'));var ejs=require(_0xb64f('0xb'));var fs=require('fs');var fs_extra=require(_0xb64f('0xc'));var _=require(_0xb64f('0xd'));var squel=require(_0xb64f('0xe'));var crypto=require(_0xb64f('0xf'));var jsforce=require(_0xb64f('0x10'));var deskjs=require(_0xb64f('0x11'));var toCsv=require(_0xb64f('0xa'));var querystring=require(_0xb64f('0x12'));var Papa=require(_0xb64f('0x13'));var Redis=require(_0xb64f('0x14'));var authService=require(_0xb64f('0x15'));var qs=require(_0xb64f('0x16'));var as=require(_0xb64f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb64f('0x18'))(_0xb64f('0x19'));var utils=require('../../config/utils');var config=require(_0xb64f('0x1a'));var licenseUtil=require(_0xb64f('0x1b'));var db=require(_0xb64f('0x1c'))['db'];config['redis']=_[_0xb64f('0x1d')](config[_0xb64f('0x1e')],{'host':_0xb64f('0x1f'),'port':0x18eb});var socket=require(_0xb64f('0x20'))(new Redis(config[_0xb64f('0x1e')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5cf788,_0x307583){_0x307583=_0x307583||0xcc;return function(_0x2ee7ac){if(_0x2ee7ac){return _0x5cf788[_0xb64f('0x21')](_0x307583);}return _0x5cf788['status'](_0x307583)[_0xb64f('0x22')]();};}function respondWithResult(_0x2c86fc,_0x4ba778){_0x4ba778=_0x4ba778||0xc8;return function(_0x479eeb){if(_0x479eeb){return _0x2c86fc[_0xb64f('0x23')](_0x4ba778)['json'](_0x479eeb);}};}function respondWithFilteredResult(_0x23a979,_0x116294){return function(_0x52fcb3){if(_0x52fcb3){var _0x359d99=typeof _0x116294[_0xb64f('0x24')]===_0xb64f('0x25')&&typeof _0x116294[_0xb64f('0x26')]==='undefined';var _0xc33cc9=_0x52fcb3[_0xb64f('0x27')];var _0x5e9a4d=_0x359d99?0x0:_0x116294[_0xb64f('0x24')];var _0x382a89=_0x359d99?_0x52fcb3[_0xb64f('0x27')]:_0x116294[_0xb64f('0x24')]+_0x116294[_0xb64f('0x26')];var _0x35c8b2;if(_0x382a89>=_0xc33cc9){_0x382a89=_0xc33cc9;_0x35c8b2=0xc8;}else{_0x35c8b2=0xce;}_0x23a979[_0xb64f('0x23')](_0x35c8b2);return _0x23a979['set'](_0xb64f('0x28'),_0x5e9a4d+'-'+_0x382a89+'/'+_0xc33cc9)[_0xb64f('0x29')](_0x52fcb3);}return null;};}function patchUpdates(_0x5c7534){return function(_0x88bc24){try{jsonpatch[_0xb64f('0x2a')](_0x88bc24,_0x5c7534,!![]);}catch(_0x5082ee){return BPromise['reject'](_0x5082ee);}return _0x88bc24[_0xb64f('0x2b')]();};}function saveUpdates(_0x4a4ef8,_0x3bdcf3){return function(_0x28d17a){if(_0x28d17a){return _0x28d17a['update'](_0x4a4ef8)['then'](function(_0x31e94c){return _0x31e94c;});}return null;};}function removeEntity(_0x5c5b03,_0x1c97da){return function(_0x5592e3){if(_0x5592e3){return _0x5592e3[_0xb64f('0x2c')]()[_0xb64f('0x2d')](function(){_0x5c5b03[_0xb64f('0x23')](0xcc)[_0xb64f('0x22')]();});}};}function handleEntityNotFound(_0x23c457,_0x1d08c4){return function(_0x47e2e){if(!_0x47e2e){_0x23c457[_0xb64f('0x21')](0x194);}return _0x47e2e;};}function handleError(_0x529d33,_0x2f20a7){_0x2f20a7=_0x2f20a7||0x1f4;return function(_0x4e4ceb){logger[_0xb64f('0x2e')](_0x4e4ceb[_0xb64f('0x2f')]);if(_0x4e4ceb['name']){delete _0x4e4ceb[_0xb64f('0x30')];}_0x529d33['status'](_0x2f20a7)[_0xb64f('0x31')](_0x4e4ceb);};}exports['index']=function(_0x2a2d05,_0xf01027){var _0x539494={},_0x300265={},_0x34b894={'count':0x0,'rows':[]};var _0x41f010=_[_0xb64f('0x32')](db[_0xb64f('0x33')][_0xb64f('0x34')],function(_0x577762){return{'name':_0x577762['fieldName'],'type':_0x577762['type'][_0xb64f('0x35')]};});_0x300265[_0xb64f('0x36')]=_['map'](_0x41f010,_0xb64f('0x30'));_0x300265[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x2a2d05[_0xb64f('0x37')]);_0x300265['filters']=_['intersection'](_0x300265[_0xb64f('0x36')],_0x300265[_0xb64f('0x37')]);_0x539494[_0xb64f('0x39')]=_[_0xb64f('0x3a')](_0x300265['model'],qs['fields'](_0x2a2d05['query'][_0xb64f('0x3b')]));_0x539494[_0xb64f('0x39')]=_0x539494['attributes'][_0xb64f('0x3c')]?_0x539494['attributes']:_0x300265[_0xb64f('0x36')];if(!_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x3d')](_0xb64f('0x3e'))){_0x539494[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x26')]);_0x539494[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x24')]);}_0x539494[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x40')]);_0x539494[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x2a2d05['query'],_0x300265[_0xb64f('0x42')]),_0x41f010);if(_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x44')]){_0x539494['where']=_['merge'](_0x539494[_0xb64f('0x41')],{'$or':_[_0xb64f('0x32')](_0x41f010,function(_0x5da287){if(_0x5da287[_0xb64f('0x45')]!=='VIRTUAL'){var _0x689437={};_0x689437[_0x5da287[_0xb64f('0x30')]]={'$like':'%'+_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x44')]+'%'};return _0x689437;}})});}_0x539494=_['merge']({},_0x539494,_0x2a2d05[_0xb64f('0x46')]);var _0x1e7101={'where':_0x539494[_0xb64f('0x41')]};return db[_0xb64f('0x33')][_0xb64f('0x27')](_0x1e7101)[_0xb64f('0x2d')](function(_0x2cb34a){_0x34b894[_0xb64f('0x27')]=_0x2cb34a;if(_0x2a2d05[_0xb64f('0x37')][_0xb64f('0x47')]){_0x539494[_0xb64f('0x48')]=[{'all':!![]}];}return db['ChatGroup'][_0xb64f('0x49')](_0x539494);})[_0xb64f('0x2d')](function(_0x2427b4){_0x34b894['rows']=_0x2427b4;return _0x34b894;})['then'](respondWithFilteredResult(_0xf01027,_0x539494))[_0xb64f('0x4a')](handleError(_0xf01027,null));};exports[_0xb64f('0x4b')]=function(_0x2d53e6,_0x127355){var _0x3e1a08={'raw':!![],'where':{'id':_0x2d53e6[_0xb64f('0x4c')]['id']}},_0x591410={};_0x591410[_0xb64f('0x36')]=_['keys'](db['ChatGroup'][_0xb64f('0x34')]);_0x591410[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x2d53e6['query']);_0x591410[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x591410[_0xb64f('0x36')],_0x591410[_0xb64f('0x37')]);_0x3e1a08[_0xb64f('0x39')]=_['intersection'](_0x591410[_0xb64f('0x36')],qs['fields'](_0x2d53e6[_0xb64f('0x37')][_0xb64f('0x3b')]));_0x3e1a08[_0xb64f('0x39')]=_0x3e1a08[_0xb64f('0x39')][_0xb64f('0x3c')]?_0x3e1a08['attributes']:_0x591410[_0xb64f('0x36')];if(_0x2d53e6[_0xb64f('0x37')][_0xb64f('0x47')]){_0x3e1a08['include']=[{'all':!![]}];}_0x3e1a08=_[_0xb64f('0x4d')]({},_0x3e1a08,_0x2d53e6['options']);return db[_0xb64f('0x33')][_0xb64f('0x4e')](_0x3e1a08)[_0xb64f('0x2d')](handleEntityNotFound(_0x127355,null))[_0xb64f('0x2d')](respondWithResult(_0x127355,null))['catch'](handleError(_0x127355,null));};exports[_0xb64f('0x4f')]=function(_0xee2f2b,_0x47cb05){return db[_0xb64f('0x33')]['create'](_0xee2f2b['body'],{})[_0xb64f('0x2d')](respondWithResult(_0x47cb05,0xc9))[_0xb64f('0x4a')](handleError(_0x47cb05,null));};exports['update']=function(_0x212624,_0x3e0015){if(_0x212624['body']['id']){delete _0x212624[_0xb64f('0x50')]['id'];}return db[_0xb64f('0x33')]['find']({'where':{'id':_0x212624['params']['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x3e0015,null))[_0xb64f('0x2d')](saveUpdates(_0x212624['body'],null))[_0xb64f('0x2d')](respondWithResult(_0x3e0015,null))[_0xb64f('0x4a')](handleError(_0x3e0015,null));};exports[_0xb64f('0x2c')]=function(_0x43918d,_0x417ccb){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0x43918d['params']['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x417ccb,null))[_0xb64f('0x2d')](removeEntity(_0x417ccb,null))[_0xb64f('0x4a')](handleError(_0x417ccb,null));};exports['describe']=function(_0x1c427f,_0x36de59){return db[_0xb64f('0x33')][_0xb64f('0x51')]()[_0xb64f('0x2d')](respondWithResult(_0x36de59,null))['catch'](handleError(_0x36de59,null));};exports[_0xb64f('0x52')]=function(_0x3334b1,_0x474b3c,_0x1c697a){return db[_0xb64f('0x53')]['count']({'where':{'ChatGroupId':_0x3334b1[_0xb64f('0x4c')]['id'],'ToId':_0x3334b1[_0xb64f('0x54')]['id'],'read':![]}})[_0xb64f('0x2d')](function(_0x5e7ccc){return{'id':_['toInteger'](_0x3334b1[_0xb64f('0x4c')]['id']),'count':_0x5e7ccc};})[_0xb64f('0x2d')](respondWithResult(_0x474b3c,null))['catch'](handleError(_0x474b3c,null));};exports[_0xb64f('0x55')]=function(_0x3dc141,_0x33d4e1,_0x149486){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0x3dc141[_0xb64f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33d4e1,null))['then'](function(_0x4ea7b2){if(_0x4ea7b2){return _0x4ea7b2[_0xb64f('0x55')](_0x3dc141['body'][_0xb64f('0x56')],_[_0xb64f('0x57')](_0x3dc141[_0xb64f('0x50')],[_0xb64f('0x56'),'id'])||{});}})[_0xb64f('0x2d')](respondWithResult(_0x33d4e1,null))[_0xb64f('0x4a')](handleError(_0x33d4e1,null));};exports[_0xb64f('0x58')]=function(_0x50b675,_0x2af5ab,_0x4f4deb){var _0x3d00f2={};var _0x28d58d={};var _0x1bf95a;var _0x595b9e;return db[_0xb64f('0x33')][_0xb64f('0x59')]({'where':{'id':_0x50b675[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x2af5ab,null))[_0xb64f('0x2d')](function(_0x37057c){if(_0x37057c){_0x1bf95a=_0x37057c;_0x28d58d[_0xb64f('0x36')]=_[_0xb64f('0x38')](db[_0xb64f('0x5a')][_0xb64f('0x34')]);_0x28d58d[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x50b675['query']);_0x28d58d[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x28d58d[_0xb64f('0x36')],_0x28d58d['query']);_0x3d00f2[_0xb64f('0x39')]=_[_0xb64f('0x3a')](_0x28d58d['model'],qs[_0xb64f('0x3b')](_0x50b675[_0xb64f('0x37')]['fields']));_0x3d00f2[_0xb64f('0x39')]=_0x3d00f2[_0xb64f('0x39')]['length']?_0x3d00f2['attributes']:_0x28d58d[_0xb64f('0x36')];_0x3d00f2[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x50b675[_0xb64f('0x37')][_0xb64f('0x40')]);_0x3d00f2[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x50b675[_0xb64f('0x37')],_0x28d58d[_0xb64f('0x42')]));if(_0x50b675[_0xb64f('0x37')][_0xb64f('0x44')]){_0x3d00f2['where']=_[_0xb64f('0x4d')](_0x3d00f2[_0xb64f('0x41')],{'$or':_['map'](_0x3d00f2[_0xb64f('0x39')],function(_0x32a59b){var _0x2c204d={};_0x2c204d[_0x32a59b]={'$like':'%'+_0x50b675[_0xb64f('0x37')]['filter']+'%'};return _0x2c204d;})});}_0x3d00f2=_[_0xb64f('0x4d')]({},_0x3d00f2,_0x50b675[_0xb64f('0x46')]);return _0x1bf95a['getMembers'](_0x3d00f2);}})[_0xb64f('0x2d')](function(_0x518266){if(_0x518266){_0x595b9e=_0x518266[_0xb64f('0x3c')];if(!_0x50b675[_0xb64f('0x37')][_0xb64f('0x3d')](_0xb64f('0x3e'))){_0x3d00f2[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x50b675['query'][_0xb64f('0x26')]);_0x3d00f2[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x50b675['query'][_0xb64f('0x24')]);}return _0x1bf95a[_0xb64f('0x58')](_0x3d00f2);}})[_0xb64f('0x2d')](function(_0x926615){if(_0x926615){return _0x926615?{'count':_0x595b9e,'rows':_0x926615}:null;}})[_0xb64f('0x2d')](respondWithResult(_0x2af5ab,null))[_0xb64f('0x4a')](handleError(_0x2af5ab,null));};exports[_0xb64f('0x5b')]=function(_0xa56ff6,_0x331ea4,_0x3f9338){return db[_0xb64f('0x33')][_0xb64f('0x4e')]({'where':{'id':_0xa56ff6[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x331ea4,null))[_0xb64f('0x2d')](function(_0x30982f){if(_0x30982f){return _0x30982f[_0xb64f('0x5b')](_0xa56ff6[_0xb64f('0x37')][_0xb64f('0x56')]);}})['then'](respondWithStatusCode(_0x331ea4,null))['catch'](handleError(_0x331ea4,null));};exports[_0xb64f('0x5c')]=function(_0x5d0f67,_0x3acab9,_0x4c44eb){if(_0x5d0f67[_0xb64f('0x50')]['id']){delete _0x5d0f67['body']['id'];}return db[_0xb64f('0x33')]['find']({'where':{'id':_0x5d0f67[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x3acab9,null))[_0xb64f('0x2d')](function(_0x47cb2a){if(_0x47cb2a){_0x5d0f67['body'][_0xb64f('0x5d')]=_0x47cb2a['id'];return db[_0xb64f('0x53')][_0xb64f('0x4f')](_0x5d0f67[_0xb64f('0x50')]);}})[_0xb64f('0x2d')](respondWithResult(_0x3acab9,null))['catch'](handleError(_0x3acab9,null));};exports[_0xb64f('0x5e')]=function(_0x165682,_0x2099b8,_0x40741c){var _0x2a5455={};var _0x331f0c={};var _0x5a7137;var _0xa890d9;return db[_0xb64f('0x33')][_0xb64f('0x59')]({'where':{'id':_0x165682[_0xb64f('0x4c')]['id']}})[_0xb64f('0x2d')](handleEntityNotFound(_0x2099b8,null))[_0xb64f('0x2d')](function(_0x3430ad){if(_0x3430ad){_0x5a7137=_0x3430ad;_0x331f0c[_0xb64f('0x36')]=_[_0xb64f('0x38')](db[_0xb64f('0x53')][_0xb64f('0x34')]);_0x331f0c[_0xb64f('0x37')]=_[_0xb64f('0x38')](_0x165682[_0xb64f('0x37')]);_0x331f0c[_0xb64f('0x42')]=_[_0xb64f('0x3a')](_0x331f0c[_0xb64f('0x36')],_0x331f0c['query']);_0x2a5455[_0xb64f('0x39')]=_['intersection'](_0x331f0c[_0xb64f('0x36')],qs[_0xb64f('0x3b')](_0x165682[_0xb64f('0x37')][_0xb64f('0x3b')]));_0x2a5455[_0xb64f('0x39')]=_0x2a5455['attributes'][_0xb64f('0x3c')]?_0x2a5455['attributes']:_0x331f0c['model'];_0x2a5455[_0xb64f('0x3f')]=qs[_0xb64f('0x40')](_0x165682[_0xb64f('0x37')][_0xb64f('0x40')]);_0x2a5455[_0xb64f('0x41')]=qs[_0xb64f('0x42')](_[_0xb64f('0x43')](_0x165682[_0xb64f('0x37')],_0x331f0c[_0xb64f('0x42')]));if(_0x165682[_0xb64f('0x37')][_0xb64f('0x44')]){_0x2a5455[_0xb64f('0x41')]=_['merge'](_0x2a5455[_0xb64f('0x41')],{'$or':_['map'](_0x2a5455[_0xb64f('0x39')],function(_0x3a5bbd){var _0x4b9dd4={};_0x4b9dd4[_0x3a5bbd]={'$like':'%'+_0x165682['query']['filter']+'%'};return _0x4b9dd4;})});}if(_0x165682[_0xb64f('0x37')]['$gte']){var _0x41eeb3=_0x165682[_0xb64f('0x37')][_0xb64f('0x5f')][_0xb64f('0x60')](',');var _0x284765={};_0x284765[_0x41eeb3[0x0]]={'$gte':moment(_0x41eeb3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2a5455[_0xb64f('0x41')]=_[_0xb64f('0x4d')](_0x2a5455[_0xb64f('0x41')],_0x284765);}_0x2a5455=_[_0xb64f('0x4d')]({},_0x2a5455,_0x165682[_0xb64f('0x46')]);return _0x5a7137[_0xb64f('0x5e')](_0x2a5455);}})[_0xb64f('0x2d')](function(_0x2fc65f){if(_0x2fc65f){_0xa890d9=_0x2fc65f['length'];if(!_0x165682['query']['hasOwnProperty'](_0xb64f('0x3e'))){_0x2a5455[_0xb64f('0x26')]=qs[_0xb64f('0x26')](_0x165682[_0xb64f('0x37')][_0xb64f('0x26')]);_0x2a5455[_0xb64f('0x24')]=qs[_0xb64f('0x24')](_0x165682['query'][_0xb64f('0x24')]);}return _0x5a7137[_0xb64f('0x5e')](_0x2a5455);}})[_0xb64f('0x2d')](function(_0xd4f75b){if(_0xd4f75b){return _0xd4f75b?{'count':_0xa890d9,'rows':_0xd4f75b}:null;}})[_0xb64f('0x2d')](respondWithResult(_0x2099b8,null))[_0xb64f('0x4a')](handleError(_0x2099b8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index b8e8ee8..8cf12da 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 _0xbd50=['remove','exports','ChatGroup','save','update'];(function(_0x46016f,_0x2d438d){var _0x586d22=function(_0x3c5de0){while(--_0x3c5de0){_0x46016f['push'](_0x46016f['shift']());}};_0x586d22(++_0x2d438d);}(_0xbd50,0x151));var _0x0bd5=function(_0x59c7c2,_0x3c91cb){_0x59c7c2=_0x59c7c2-0x0;var _0x425718=_0xbd50[_0x59c7c2];return _0x425718;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x0bd5('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bd5('0x1'),'afterUpdate':_0x0bd5('0x2'),'afterDestroy':_0x0bd5('0x3')};function emitEvent(_0x5b5b87){return function(_0x51300f,_0x294c08,_0xd44f35){ChatGroupEvents['emit'](_0x5b5b87+':'+_0x51300f['id'],_0x51300f);ChatGroupEvents['emit'](_0x5b5b87,_0x51300f);_0xd44f35(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x0bd5('0x4')]=ChatGroupEvents; \ No newline at end of file +var _0xf230=['save','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x511dfe,_0x2805d4){var _0x419acd=function(_0x16e24b){while(--_0x16e24b){_0x511dfe['push'](_0x511dfe['shift']());}};_0x419acd(++_0x2805d4);}(_0xf230,0xea));var _0x0f23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf230[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0f23('0x0'));var ChatGroup=require(_0x0f23('0x1'))['db'][_0x0f23('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0f23('0x3')](0x0);var events={'afterCreate':_0x0f23('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x16b060){return function(_0x303b10,_0x255aef,_0x59b753){ChatGroupEvents[_0x0f23('0x5')](_0x16b060+':'+_0x303b10['id'],_0x303b10);ChatGroupEvents[_0x0f23('0x5')](_0x16b060,_0x303b10);_0x59b753(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0f23('0x6')](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 b3cc986..27f1143 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 _0x0eab=['chat_groups','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','define'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x0eab,0x140));var _0xb0ea=function(_0x51a8b9,_0x57504b){_0x51a8b9=_0x51a8b9-0x0;var _0x340f53=_0x0eab[_0x51a8b9];return _0x340f53;};'use strict';var _=require(_0xb0ea('0x0'));var util=require('util');var logger=require(_0xb0ea('0x1'))(_0xb0ea('0x2'));var moment=require(_0xb0ea('0x3'));var BPromise=require(_0xb0ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0ea('0x5'));var rimraf=require(_0xb0ea('0x6'));var config=require(_0xb0ea('0x7'));var attributes=require(_0xb0ea('0x8'));module['exports']=function(_0x3a441f,_0x4e1220){return _0x3a441f[_0xb0ea('0x9')]('ChatGroup',attributes,{'tableName':_0xb0ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8843=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','chat_groups','lodash','../../config/logger'];(function(_0x79ba92,_0x564ade){var _0x5a93bf=function(_0x3aa8fc){while(--_0x3aa8fc){_0x79ba92['push'](_0x79ba92['shift']());}};_0x5a93bf(++_0x564ade);}(_0x8843,0x77));var _0x3884=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8843[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x3884('0x0'));var util=require('util');var logger=require(_0x3884('0x1'))(_0x3884('0x2'));var moment=require(_0x3884('0x3'));var BPromise=require(_0x3884('0x4'));var rp=require(_0x3884('0x5'));var fs=require('fs');var path=require(_0x3884('0x6'));var rimraf=require(_0x3884('0x7'));var config=require(_0x3884('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x47403c,_0x3d527f){return _0x47403c[_0x3884('0x9')]('ChatGroup',attributes,{'tableName':_0x3884('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 99d8bc2..2fd3491 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 _0x2d17=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s'];(function(_0x18c1b1,_0x339237){var _0x4faaea=function(_0x2ccac6){while(--_0x2ccac6){_0x18c1b1['push'](_0x18c1b1['shift']());}};_0x4faaea(++_0x339237);}(_0x2d17,0x17e));var _0x72d1=function(_0x2c4f29,_0x55b27a){_0x2c4f29=_0x2c4f29-0x0;var _0x10a6bf=_0x2d17[_0x2c4f29];return _0x10a6bf;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('ChatGroup,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});} \ No newline at end of file +var _0x98d3=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0x38e2fd,_0x80c944){var _0x332db0=function(_0x17a8a1){while(--_0x17a8a1){_0x38e2fd['push'](_0x38e2fd['shift']());}};_0x332db0(++_0x80c944);}(_0x98d3,0x173));var _0x398d=function(_0x7209f9,_0x5ca873){_0x7209f9=_0x7209f9-0x0;var _0x4e829d=_0x98d3[_0x7209f9];return _0x4e829d;};'use strict';var _=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var moment=require('moment');var BPromise=require(_0x398d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x398d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x398d('0x4'));var logger=require(_0x398d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x398d('0x6'));var client=jayson[_0x398d('0x7')][_0x398d('0x8')]({'port':0x232a});config['redis']=_[_0x398d('0x9')](config[_0x398d('0xa')],{'host':_0x398d('0xb'),'port':0x18eb});var socket=require(_0x398d('0xc'))(new Redis(config[_0x398d('0xa')]));require('./chatGroup.socket')[_0x398d('0xd')](socket);function respondWithRpcPromise(_0x147aec,_0x45d5e3,_0x3841e6){return new BPromise(function(_0x3a8f51,_0x1b144a){return client[_0x398d('0xe')](_0x147aec,_0x3841e6)[_0x398d('0xf')](function(_0x585400){logger[_0x398d('0x10')](_0x398d('0x11'),_0x45d5e3,_0x398d('0x12'));logger[_0x398d('0x13')](_0x398d('0x14'),_0x45d5e3,_0x398d('0x12'),JSON[_0x398d('0x15')](_0x585400));if(_0x585400[_0x398d('0x16')]){if(_0x585400[_0x398d('0x16')][_0x398d('0x17')]===0x1f4){logger[_0x398d('0x16')]('ChatGroup,\x20%s,\x20%s',_0x45d5e3,_0x585400['error'][_0x398d('0x18')]);return _0x1b144a(_0x585400[_0x398d('0x16')][_0x398d('0x18')]);}logger[_0x398d('0x16')](_0x398d('0x11'),_0x45d5e3,_0x585400[_0x398d('0x16')][_0x398d('0x18')]);return _0x3a8f51(_0x585400[_0x398d('0x16')]['message']);}else{logger[_0x398d('0x10')]('ChatGroup,\x20%s,\x20%s',_0x45d5e3,_0x398d('0x12'));_0x3a8f51(_0x585400[_0x398d('0x19')][_0x398d('0x18')]);}})['catch'](function(_0x4c5c9d){logger['error'](_0x398d('0x11'),_0x45d5e3,_0x4c5c9d);_0x1b144a(_0x4c5c9d);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index c1cf54c..1268e89 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 _0x1a96=['remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x5160bf,_0x511947){var _0x1d33a9=function(_0x3b630c){while(--_0x3b630c){_0x5160bf['push'](_0x5160bf['shift']());}};_0x1d33a9(++_0x511947);}(_0x1a96,0x10a));var _0x61a9=function(_0x444be3,_0x49c6ba){_0x444be3=_0x444be3-0x0;var _0xf093f8=_0x1a96[_0x444be3];return _0xf093f8;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x61a9('0x0'),_0x61a9('0x1')];function createListener(_0x3cf8b1,_0x456bf8){return function(_0x196df1){_0x456bf8[_0x61a9('0x2')](_0x3cf8b1,_0x196df1);};}function removeListener(_0x2d1741,_0x51a717){return function(){ChatGroupEvents[_0x61a9('0x3')](_0x2d1741,_0x51a717);};}exports[_0x61a9('0x4')]=function(_0x3c0248){for(var _0x32fe00=0x0,_0x26777a=events[_0x61a9('0x5')];_0x32fe00<_0x26777a;_0x32fe00++){var _0x1c1741=events[_0x32fe00];var _0x5217b1=createListener(_0x61a9('0x6')+_0x1c1741,_0x3c0248);ChatGroupEvents['on'](_0x1c1741,_0x5217b1);}}; \ No newline at end of file +var _0xc6ee=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','length'];(function(_0x146e79,_0x2c93aa){var _0x2c009f=function(_0x945b8a){while(--_0x945b8a){_0x146e79['push'](_0x146e79['shift']());}};_0x2c009f(++_0x2c93aa);}(_0xc6ee,0x14a));var _0xec6e=function(_0x240d8c,_0x979f5){_0x240d8c=_0x240d8c-0x0;var _0x4e0720=_0xc6ee[_0x240d8c];return _0x4e0720;};'use strict';var ChatGroupEvents=require(_0xec6e('0x0'));var events=[_0xec6e('0x1'),_0xec6e('0x2'),'update'];function createListener(_0x2aa754,_0xdb4b26){return function(_0x596c6e){_0xdb4b26[_0xec6e('0x3')](_0x2aa754,_0x596c6e);};}function removeListener(_0x31fbbd,_0x915b80){return function(){ChatGroupEvents[_0xec6e('0x4')](_0x31fbbd,_0x915b80);};}exports['register']=function(_0x325889){for(var _0x20998a=0x0,_0x139606=events[_0xec6e('0x5')];_0x20998a<_0x139606;_0x20998a++){var _0x4683a8=events[_0x20998a];var _0x125826=createListener(_0xec6e('0x6')+_0x4683a8,_0x325889);ChatGroupEvents['on'](_0x4683a8,_0x125826);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5424f89..bff07b2 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 _0x43c3=['update','delete','destroy','removeMembers','exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','/:id/unread','getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x43c3,0x118));var _0x343c=function(_0x364731,_0x5aa34c){_0x364731=_0x364731-0x0;var _0x3260d1=_0x43c3[_0x364731];return _0x3260d1;};'use strict';var multer=require(_0x343c('0x0'));var util=require(_0x343c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x343c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x343c('0x3'));var config=require(_0x343c('0x4'));var controller=require('./chatGroup.controller');router[_0x343c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x343c('0x5')](_0x343c('0x6'),auth['isAuthenticated'](),controller[_0x343c('0x7')]);router['get'](_0x343c('0x8'),auth[_0x343c('0x9')](),controller['show']);router[_0x343c('0x5')](_0x343c('0xa'),auth[_0x343c('0x9')](),controller[_0x343c('0xb')]);router[_0x343c('0x5')]('/:id/members',auth['isAuthenticated'](),controller[_0x343c('0xc')]);router['get']('/:id/messages',auth[_0x343c('0x9')](),controller[_0x343c('0xd')]);router[_0x343c('0xe')]('/',auth[_0x343c('0x9')](),controller[_0x343c('0xf')]);router[_0x343c('0xe')](_0x343c('0x10'),auth['isAuthenticated'](),controller[_0x343c('0x11')]);router[_0x343c('0xe')](_0x343c('0x12'),auth[_0x343c('0x9')](),controller[_0x343c('0x13')]);router['put'](_0x343c('0x8'),auth[_0x343c('0x9')](),controller[_0x343c('0x14')]);router[_0x343c('0x15')](_0x343c('0x8'),auth[_0x343c('0x9')](),controller[_0x343c('0x16')]);router[_0x343c('0x15')](_0x343c('0x10'),auth[_0x343c('0x9')](),controller[_0x343c('0x17')]);module[_0x343c('0x18')]=router; \ No newline at end of file +var _0x843d=['/describe','get','/:id','show','/:id/unread','getUnread','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x843d,0x1b5));var _0xd843=function(_0x5d8e76,_0x295bc4){_0x5d8e76=_0x5d8e76-0x0;var _0x4b94f3=_0x843d[_0x5d8e76];return _0x4b94f3;};'use strict';var multer=require(_0xd843('0x0'));var util=require('util');var path=require(_0xd843('0x1'));var timeout=require(_0xd843('0x2'));var express=require(_0xd843('0x3'));var router=express[_0xd843('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd843('0x5'));var interaction=require(_0xd843('0x6'));var config=require(_0xd843('0x7'));var controller=require(_0xd843('0x8'));router['get']('/',auth[_0xd843('0x9')](),controller[_0xd843('0xa')]);router['get'](_0xd843('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd843('0xc')](_0xd843('0xd'),auth[_0xd843('0x9')](),controller[_0xd843('0xe')]);router[_0xd843('0xc')](_0xd843('0xf'),auth['isAuthenticated'](),controller[_0xd843('0x10')]);router['get']('/:id/members',auth[_0xd843('0x9')](),controller['getMembers']);router[_0xd843('0xc')](_0xd843('0x11'),auth['isAuthenticated'](),controller[_0xd843('0x12')]);router[_0xd843('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd843('0x13')](_0xd843('0x14'),auth[_0xd843('0x9')](),controller[_0xd843('0x15')]);router[_0xd843('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd843('0x16')]);router[_0xd843('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd843('0xd'),auth[_0xd843('0x9')](),controller[_0xd843('0x18')]);router[_0xd843('0x19')](_0xd843('0x14'),auth['isAuthenticated'](),controller[_0xd843('0x1a')]);module[_0xd843('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 69bcd15..9efb14d 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 _0x8a5c=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x305d99,_0x3eb3b2){var _0x36f25a=function(_0x56d383){while(--_0x56d383){_0x305d99['push'](_0x305d99['shift']());}};_0x36f25a(++_0x3eb3b2);}(_0x8a5c,0x136));var _0xc8a5=function(_0x59f512,_0x276914){_0x59f512=_0x59f512-0x0;var _0xfd01d8=_0x8a5c[_0x59f512];return _0xfd01d8;};'use strict';var Sequelize=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'closed':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc8a5('0x3')]},'ratingType':{'type':Sequelize[_0xc8a5('0x4')](_0xc8a5('0x5'),_0xc8a5('0x6')),'defaultValue':_0xc8a5('0x5')},'ratingMessage':{'type':Sequelize[_0xc8a5('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xc8a5('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc8a5('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'thirdDisposition':{'type':Sequelize[_0xc8a5('0x8')]},'note':{'type':Sequelize[_0xc8a5('0x8')]},'browserName':{'type':Sequelize[_0xc8a5('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc8a5('0x8')]},'osVersion':{'type':Sequelize[_0xc8a5('0x8')]},'deviceModel':{'type':Sequelize[_0xc8a5('0x8')]},'deviceVendor':{'type':Sequelize[_0xc8a5('0x8')]},'deviceType':{'type':Sequelize[_0xc8a5('0x8')]},'referer':{'type':Sequelize[_0xc8a5('0x7')]},'customerIp':{'type':Sequelize[_0xc8a5('0x8')]},'formData':{'type':Sequelize[_0xc8a5('0x7')](_0xc8a5('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc8a5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc8a5('0x8')]},'customerPort':{'type':Sequelize[_0xc8a5('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xc8a5('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xc8a5('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5423=['thumb','star','TEXT','DATE','STRING','out','BOOLEAN','sequelize','exports','INTEGER','ENUM'];(function(_0x879688,_0x5bec06){var _0x31aca8=function(_0x17c876){while(--_0x17c876){_0x879688['push'](_0x879688['shift']());}};_0x31aca8(++_0x5bec06);}(_0x5423,0xe3));var _0x3542=function(_0x1ce7d5,_0x5198eb){_0x1ce7d5=_0x1ce7d5-0x0;var _0x586b82=_0x5423[_0x1ce7d5];return _0x586b82;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3542('0x2')]},'ratingType':{'type':Sequelize[_0x3542('0x3')]('star',_0x3542('0x4')),'defaultValue':_0x3542('0x5')},'ratingMessage':{'type':Sequelize[_0x3542('0x6')]},'pathTranscript':{'type':Sequelize[_0x3542('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3542('0x7')]},'disposition':{'type':Sequelize[_0x3542('0x8')]},'secondDisposition':{'type':Sequelize[_0x3542('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3542('0x8')]},'note':{'type':Sequelize[_0x3542('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x3542('0x8')]},'osVersion':{'type':Sequelize[_0x3542('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3542('0x8')]},'deviceType':{'type':Sequelize[_0x3542('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3542('0x8')]},'formData':{'type':Sequelize[_0x3542('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x3542('0x7')]},'lastMsgAt':{'type':Sequelize[_0x3542('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3542('0x3')]('in',_0x3542('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3542('0x8')]},'customerPort':{'type':Sequelize[_0x3542('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3542('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3542('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7c7cba7..f7509b0 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 _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x45c396,_0x17a73f){_0x45c396=_0x45c396-0x0;var _0x33cd3f=_0x9ffd[_0x45c396];return _0x33cd3f;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));}; \ No newline at end of file +var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x469273,_0x337533){var _0x45105a=function(_0x2f9ba6){while(--_0x2f9ba6){_0x469273['push'](_0x469273['shift']());}};_0x45105a(++_0x337533);}(_0x66fa,0x117));var _0xa66f=function(_0x1fcbca,_0x57e993){_0x1fcbca=_0x1fcbca-0x0;var _0xc4db48=_0x66fa[_0x1fcbca];return _0xc4db48;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6c209c5..fbffa52 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 _0xf946=['../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','ChatInteraction'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xf946,0x1d2));var _0x6f94=function(_0x14a84e,_0xffb06){_0x14a84e=_0x14a84e-0x0;var _0x2aca47=_0xf946[_0x14a84e];return _0x2aca47;};'use strict';var EventEmitter=require(_0x6f94('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x6f94('0x1')];var ChatMessage=require(_0x6f94('0x2'))['db'][_0x6f94('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6f94('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6f94('0x5')};function emitEvent(_0xb3efe6){return function(_0x25ac3e,_0x2708a8,_0x467db0){_0x25ac3e[_0x6f94('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2dedfd){_0x25ac3e[_0x6f94('0x7')](_0x6f94('0x8'),_0x2dedfd[_0x6f94('0x9')](function(_0x481261){return{'id':_0x481261['id']};}));return ChatMessage[_0x6f94('0xa')]({'where':{'ChatInteractionId':_0x25ac3e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6f94('0xb')](function(_0xc10abf){_0x25ac3e[_0x6f94('0x7')](_0x6f94('0xc'),_0xc10abf[_0x6f94('0xd')]);ChatInteractionEvents[_0x6f94('0xe')](_0xb3efe6+':'+_0x25ac3e['id'],_0x25ac3e);ChatInteractionEvents[_0x6f94('0xe')](_0xb3efe6,_0x25ac3e);_0x467db0(null);})[_0x6f94('0xf')](_0x467db0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x6f94('0x10')](e,emitEvent(event));}}module[_0x6f94('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xc202=['remove','then','setDataValue','map','findAll','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update'];(function(_0x1ea9da,_0x565f5c){var _0x7a4c3a=function(_0x43a3c4){while(--_0x43a3c4){_0x1ea9da['push'](_0x1ea9da['shift']());}};_0x7a4c3a(++_0x565f5c);}(_0xc202,0x81));var _0x2c20=function(_0x446216,_0x441943){_0x446216=_0x446216-0x0;var _0x24ecd3=_0xc202[_0x446216];return _0x24ecd3;};'use strict';var EventEmitter=require(_0x2c20('0x0'));var ChatInteraction=require(_0x2c20('0x1'))['db'][_0x2c20('0x2')];var ChatMessage=require(_0x2c20('0x1'))['db'][_0x2c20('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2c20('0x4')](0x0);var events={'afterCreate':_0x2c20('0x5'),'afterUpdate':_0x2c20('0x6'),'afterDestroy':_0x2c20('0x7')};function emitEvent(_0x36163f){return function(_0xc1e0a2,_0x4da95d,_0x2a04cc){_0xc1e0a2['getUsers']({'attributes':['id'],'raw':!![]})[_0x2c20('0x8')](function(_0x580452){_0xc1e0a2[_0x2c20('0x9')]('Users',_0x580452[_0x2c20('0xa')](function(_0x50d3fd){return{'id':_0x50d3fd['id']};}));return ChatMessage[_0x2c20('0xb')]({'where':{'ChatInteractionId':_0xc1e0a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2c20('0x8')](function(_0x13377c){_0xc1e0a2['setDataValue'](_0x2c20('0xc'),_0x13377c[_0x2c20('0xd')]);ChatInteractionEvents['emit'](_0x36163f+':'+_0xc1e0a2['id'],_0xc1e0a2);ChatInteractionEvents['emit'](_0x36163f,_0xc1e0a2);_0x2a04cc(null);})['catch'](_0x2a04cc(null));};}for(var e in events){if(events[_0x2c20('0xe')](e)){var event=events[e];ChatInteraction[_0x2c20('0xf')](e,emitEvent(event));}}module[_0x2c20('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 02cc261..273cc6e 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 _0x3d50=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x40de9e,_0x5051cd){var _0x3a4e48=function(_0x476ad7){while(--_0x476ad7){_0x40de9e['push'](_0x40de9e['shift']());}};_0x3a4e48(++_0x5051cd);}(_0x3d50,0xbf));var _0x03d5=function(_0x5017b2,_0x2f1d99){_0x5017b2=_0x5017b2-0x0;var _0x1bfbc1=_0x3d50[_0x5017b2];return _0x1bfbc1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03d5('0x0'))(_0x03d5('0x1'));var moment=require(_0x03d5('0x2'));var BPromise=require(_0x03d5('0x3'));var rp=require(_0x03d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03d5('0x5'));var config=require(_0x03d5('0x6'));var attributes=require(_0x03d5('0x7'));module[_0x03d5('0x8')]=function(_0x2164ff,_0x17a9ea){return _0x2164ff[_0x03d5('0x9')](_0x03d5('0xa'),attributes,{'tableName':_0x03d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa589cc,_0x4e1c2a,_0x123514){if(_0xa589cc[_0x03d5('0xc')](_0x03d5('0xd'))){_0xa589cc[_0x03d5('0xe')]=moment()[_0x03d5('0xf')](_0x03d5('0x10'));}_0x123514(null,_0xa589cc);}},'charset':_0x03d5('0x11'),'collate':_0x03d5('0x12')});}; \ No newline at end of file +var _0x2b04=['format','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x2b04,0x1d5));var _0x42b0=function(_0x1df561,_0x31fa71){_0x1df561=_0x1df561-0x0;var _0x445716=_0x2b04[_0x1df561];return _0x445716;};'use strict';var _=require(_0x42b0('0x0'));var util=require(_0x42b0('0x1'));var logger=require(_0x42b0('0x2'))(_0x42b0('0x3'));var moment=require('moment');var BPromise=require(_0x42b0('0x4'));var rp=require(_0x42b0('0x5'));var fs=require('fs');var path=require(_0x42b0('0x6'));var rimraf=require(_0x42b0('0x7'));var config=require(_0x42b0('0x8'));var attributes=require(_0x42b0('0x9'));module[_0x42b0('0xa')]=function(_0x4ae8a2,_0x16989d){return _0x4ae8a2[_0x42b0('0xb')](_0x42b0('0xc'),attributes,{'tableName':_0x42b0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eebe0,_0x1e21c4,_0x25c741){if(_0x3eebe0[_0x42b0('0xe')](_0x42b0('0xf'))){_0x3eebe0[_0x42b0('0x10')]=moment()[_0x42b0('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25c741(null,_0x3eebe0);}},'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 07aa999..07548a2 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 _0xe4ff=['options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','find','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','update','body'];(function(_0x589914,_0x202fff){var _0x17ef31=function(_0x31ba6b){while(--_0x31ba6b){_0x589914['push'](_0x589914['shift']());}};_0x17ef31(++_0x202fff);}(_0xe4ff,0x1a4));var _0xfe4f=function(_0x517724,_0x51e5c0){_0x517724=_0x517724-0x0;var _0x4c73a5=_0xe4ff[_0x517724];return _0x4c73a5;};'use strict';var _=require(_0xfe4f('0x0'));var util=require(_0xfe4f('0x1'));var moment=require(_0xfe4f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe4f('0x3'));var fs=require('fs');var Redis=require(_0xfe4f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe4f('0x5'));var logger=require(_0xfe4f('0x6'))(_0xfe4f('0x7'));var config=require(_0xfe4f('0x8'));var jayson=require(_0xfe4f('0x9'));var client=jayson[_0xfe4f('0xa')][_0xfe4f('0xb')]({'port':0x232a});config[_0xfe4f('0xc')]=_[_0xfe4f('0xd')](config[_0xfe4f('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfe4f('0xe'))['register'](socket);function respondWithRpcPromise(_0xb0f9e,_0x466eff,_0x217953){return new BPromise(function(_0x46d79d,_0x500256){return client[_0xfe4f('0xf')](_0xb0f9e,_0x217953)[_0xfe4f('0x10')](function(_0x1006c3){logger[_0xfe4f('0x11')](_0xfe4f('0x12'),_0x466eff,_0xfe4f('0x13'));logger[_0xfe4f('0x14')](_0xfe4f('0x15'),_0x466eff,'request\x20sent',JSON[_0xfe4f('0x16')](_0x1006c3));if(_0x1006c3['error']){if(_0x1006c3[_0xfe4f('0x17')][_0xfe4f('0x18')]===0x1f4){logger['error'](_0xfe4f('0x12'),_0x466eff,_0x1006c3[_0xfe4f('0x17')]['message']);return _0x500256(_0x1006c3[_0xfe4f('0x17')][_0xfe4f('0x19')]);}logger[_0xfe4f('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x466eff,_0x1006c3[_0xfe4f('0x17')]['message']);return _0x46d79d(_0x1006c3['error'][_0xfe4f('0x19')]);}else{logger[_0xfe4f('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x466eff,_0xfe4f('0x13'));_0x46d79d(_0x1006c3[_0xfe4f('0x1a')][_0xfe4f('0x19')]);}})[_0xfe4f('0x1b')](function(_0xfe585f){logger[_0xfe4f('0x17')](_0xfe4f('0x12'),_0x466eff,_0xfe585f);_0x500256(_0xfe585f);});});}exports[_0xfe4f('0x1c')]=function(_0xdfe6d4){var _0x3a268f=this;return new Promise(function(_0x5617be,_0x1a55e3){return db['ChatInteraction'][_0xfe4f('0x1d')](_0xdfe6d4[_0xfe4f('0x1e')],{'raw':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')][_0xfe4f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4['options'][_0xfe4f('0x21')]||null:null,'attributes':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')]['attributes']||null:null,'limit':_0xdfe6d4[_0xfe4f('0x1f')]?_0xdfe6d4[_0xfe4f('0x1f')][_0xfe4f('0x22')]||null:null})[_0xfe4f('0x10')](function(_0x1d6120){logger[_0xfe4f('0x11')](_0xfe4f('0x1c'),_0xdfe6d4);logger[_0xfe4f('0x14')](_0xfe4f('0x1c'),_0xdfe6d4,JSON['stringify'](_0x1d6120));_0x5617be(_0x1d6120);})['catch'](function(_0x4d09ad){logger[_0xfe4f('0x17')](_0xfe4f('0x1c'),_0x4d09ad[_0xfe4f('0x19')],_0xdfe6d4);_0x1a55e3(_0x3a268f[_0xfe4f('0x17')](0x1f4,_0x4d09ad['message']));});});};exports[_0xfe4f('0x23')]=function(_0x5ee8f9){return new Promise(function(_0x1030d7,_0x365003){return db[_0xfe4f('0x24')][_0xfe4f('0x25')]({'where':_0x5ee8f9[_0xfe4f('0x1f')]?_0x5ee8f9[_0xfe4f('0x1f')][_0xfe4f('0x21')]||null:null})[_0xfe4f('0x10')](function(_0x368b32){if(_0x368b32){return _0x368b32['addTags'](_0x5ee8f9[_0xfe4f('0x1e')][_0xfe4f('0x26')],_['omit'](_0x5ee8f9[_0xfe4f('0x1e')],[_0xfe4f('0x26'),'id'])||{});}})[_0xfe4f('0x27')](function(_0x2f7c93){logger[_0xfe4f('0x11')]('AddTags',_0x5ee8f9);logger[_0xfe4f('0x14')]('AddTags',_0x5ee8f9,JSON[_0xfe4f('0x16')](_0x2f7c93));_0x1030d7(_0x2f7c93);})[_0xfe4f('0x1b')](function(_0x7f30c4){logger[_0xfe4f('0x17')](_0xfe4f('0x28'),_0x7f30c4[_0xfe4f('0x19')],_0x5ee8f9);_0x365003(_this[_0xfe4f('0x17')](0x1f4,_0x7f30c4['message']));});});}; \ No newline at end of file +var _0xf892=['attributes','limit','debug','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','localhost','./chatInteraction.socket','request','then','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf892,0x80));var _0x2f89=function(_0x485c9f,_0x399a20){_0x485c9f=_0x485c9f-0x0;var _0x2ba76e=_0xf892[_0x485c9f];return _0x2ba76e;};'use strict';var _=require(_0x2f89('0x0'));var util=require(_0x2f89('0x1'));var moment=require(_0x2f89('0x2'));var BPromise=require(_0x2f89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f89('0x4'));var db=require(_0x2f89('0x5'))['db'];var utils=require(_0x2f89('0x6'));var logger=require('../../config/logger')(_0x2f89('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f89('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x2f89('0x9')]=_['defaults'](config[_0x2f89('0x9')],{'host':_0x2f89('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f89('0x9')]));require(_0x2f89('0xb'))['register'](socket);function respondWithRpcPromise(_0x4fbc88,_0x136cc5,_0xb2014d){return new BPromise(function(_0x2ff3ea,_0x4b3e54){return client[_0x2f89('0xc')](_0x4fbc88,_0xb2014d)[_0x2f89('0xd')](function(_0x4cf405){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x136cc5,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x136cc5,_0x2f89('0xe'),JSON[_0x2f89('0xf')](_0x4cf405));if(_0x4cf405[_0x2f89('0x10')]){if(_0x4cf405[_0x2f89('0x10')][_0x2f89('0x11')]===0x1f4){logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x4cf405[_0x2f89('0x10')][_0x2f89('0x13')]);return _0x4b3e54(_0x4cf405['error']['message']);}logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x4cf405[_0x2f89('0x10')]['message']);return _0x2ff3ea(_0x4cf405[_0x2f89('0x10')][_0x2f89('0x13')]);}else{logger[_0x2f89('0x14')](_0x2f89('0x12'),_0x136cc5,'request\x20sent');_0x2ff3ea(_0x4cf405['result']['message']);}})[_0x2f89('0x15')](function(_0x3e84f1){logger[_0x2f89('0x10')](_0x2f89('0x12'),_0x136cc5,_0x3e84f1);_0x4b3e54(_0x3e84f1);});});}exports[_0x2f89('0x16')]=function(_0x274b76){var _0x32c55b=this;return new Promise(function(_0x24a5b9,_0x56abbc){return db[_0x2f89('0x17')][_0x2f89('0x18')](_0x274b76['body'],{'raw':_0x274b76[_0x2f89('0x19')]?_0x274b76[_0x2f89('0x19')][_0x2f89('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274b76[_0x2f89('0x19')]?_0x274b76['options'][_0x2f89('0x1b')]||null:null,'attributes':_0x274b76[_0x2f89('0x19')]?_0x274b76['options'][_0x2f89('0x1c')]||null:null,'limit':_0x274b76[_0x2f89('0x19')]?_0x274b76[_0x2f89('0x19')][_0x2f89('0x1d')]||null:null})[_0x2f89('0xd')](function(_0x1f791b){logger[_0x2f89('0x14')](_0x2f89('0x16'),_0x274b76);logger[_0x2f89('0x1e')]('UpdateChatInteraction',_0x274b76,JSON['stringify'](_0x1f791b));_0x24a5b9(_0x1f791b);})[_0x2f89('0x15')](function(_0x41e848){logger[_0x2f89('0x10')](_0x2f89('0x16'),_0x41e848[_0x2f89('0x13')],_0x274b76);_0x56abbc(_0x32c55b[_0x2f89('0x10')](0x1f4,_0x41e848['message']));});});};exports[_0x2f89('0x1f')]=function(_0x3361ec){return new Promise(function(_0x3e0d12,_0x3a6880){return db[_0x2f89('0x17')][_0x2f89('0x20')]({'where':_0x3361ec[_0x2f89('0x19')]?_0x3361ec[_0x2f89('0x19')][_0x2f89('0x1b')]||null:null})[_0x2f89('0xd')](function(_0x2f2d88){if(_0x2f2d88){return _0x2f2d88[_0x2f89('0x21')](_0x3361ec[_0x2f89('0x22')][_0x2f89('0x23')],_[_0x2f89('0x24')](_0x3361ec[_0x2f89('0x22')],[_0x2f89('0x23'),'id'])||{});}})[_0x2f89('0x25')](function(_0x132aa6){logger[_0x2f89('0x14')](_0x2f89('0x26'),_0x3361ec);logger['debug']('AddTags',_0x3361ec,JSON[_0x2f89('0xf')](_0x132aa6));_0x3e0d12(_0x132aa6);})[_0x2f89('0x15')](function(_0x4c2fa1){logger[_0x2f89('0x10')](_0x2f89('0x26'),_0x4c2fa1[_0x2f89('0x13')],_0x3361ec);_0x3a6880(_this[_0x2f89('0x10')](0x1f4,_0x4c2fa1[_0x2f89('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 861a4cc..dd3af44 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 _0xccc7=['update','emit','removeListener','register','./chatInteraction.events','save','remove'];(function(_0x2cd160,_0x1824a8){var _0x3174c6=function(_0x19b896){while(--_0x19b896){_0x2cd160['push'](_0x2cd160['shift']());}};_0x3174c6(++_0x1824a8);}(_0xccc7,0x17e));var _0x7ccc=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xccc7[_0x25e7cb];return _0x375d92;};'use strict';var ChatInteractionEvents=require(_0x7ccc('0x0'));var events=[_0x7ccc('0x1'),_0x7ccc('0x2'),_0x7ccc('0x3')];function createListener(_0x56010b,_0x33fa85){return function(_0x531ee4){_0x33fa85[_0x7ccc('0x4')](_0x56010b,_0x531ee4);};}function removeListener(_0xf210d0,_0x190d90){return function(){ChatInteractionEvents[_0x7ccc('0x5')](_0xf210d0,_0x190d90);};}exports[_0x7ccc('0x6')]=function(_0x1b8380){for(var _0x46be05=0x0,_0x3e11b2=events['length'];_0x46be05<_0x3e11b2;_0x46be05++){var _0x34e009=events[_0x46be05];var _0x2eb9d8=createListener('chatInteraction:'+_0x34e009,_0x1b8380);ChatInteractionEvents['on'](_0x34e009,_0x2eb9d8);}}; \ No newline at end of file +var _0x967c=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x547d66,_0x59652a){var _0x39f84e=function(_0x121c1d){while(--_0x121c1d){_0x547d66['push'](_0x547d66['shift']());}};_0x39f84e(++_0x59652a);}(_0x967c,0xfd));var _0xc967=function(_0x28afb6,_0x3b9984){_0x28afb6=_0x28afb6-0x0;var _0x2710b3=_0x967c[_0x28afb6];return _0x2710b3;};'use strict';var ChatInteractionEvents=require(_0xc967('0x0'));var events=[_0xc967('0x1'),_0xc967('0x2'),'update'];function createListener(_0x250474,_0x38da99){return function(_0x551fa4){_0x38da99[_0xc967('0x3')](_0x250474,_0x551fa4);};}function removeListener(_0x53533a,_0x59e07c){return function(){ChatInteractionEvents[_0xc967('0x4')](_0x53533a,_0x59e07c);};}exports[_0xc967('0x5')]=function(_0x154162){for(var _0x408a54=0x0,_0x45edaf=events[_0xc967('0x6')];_0x408a54<_0x45edaf;_0x408a54++){var _0x57d5cd=events[_0x408a54];var _0x359485=createListener(_0xc967('0x7')+_0x57d5cd,_0x154162);ChatInteractionEvents['on'](_0x57d5cd,_0x359485);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index dbf56eb..37994ce 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 _0x81ea=['attachmentUpload','addMessage','tracked','chat','addTags','chatinteraction:update','update','customUpdate','put','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','format','%s-%s','now','originalname','replace','single'];(function(_0x16d999,_0x1bdfac){var _0x56afe7=function(_0x392493){while(--_0x392493){_0x16d999['push'](_0x16d999['shift']());}};_0x56afe7(++_0x1bdfac);}(_0x81ea,0xe5));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xa81e('0x0'));var util=require(_0xa81e('0x1'));var path=require(_0xa81e('0x2'));var timeout=require(_0xa81e('0x3'));var express=require(_0xa81e('0x4'));var router=express[_0xa81e('0x5')]();var fs_extra=require(_0xa81e('0x6'));var auth=require(_0xa81e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa81e('0x8'));var controller=require(_0xa81e('0x9'));router[_0xa81e('0xa')]('/',auth[_0xa81e('0xb')](),controller[_0xa81e('0xc')]);router['get'](_0xa81e('0xd'),auth[_0xa81e('0xb')](),controller['describe']);router[_0xa81e('0xa')](_0xa81e('0xe'),auth[_0xa81e('0xf')](),controller[_0xa81e('0x10')]);router[_0xa81e('0xa')](_0xa81e('0x11'),auth[_0xa81e('0xf')](),controller[_0xa81e('0x12')]);router[_0xa81e('0xa')](_0xa81e('0x13'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x14')]);router[_0xa81e('0xa')](_0xa81e('0x15'),auth['isChatInteractionAuthorized'](),controller[_0xa81e('0x16')]);router[_0xa81e('0xa')](_0xa81e('0x17'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x18')]);router[_0xa81e('0x19')]('/',auth['isAuthenticated'](),controller[_0xa81e('0x1a')]);router[_0xa81e('0x19')]('/:id/vidaoo',auth[_0xa81e('0xb')](),controller[_0xa81e('0x1b')]);var upload=multer({'storage':multer[_0xa81e('0x1c')]({'destination':function(_0x561a03,_0xcfab18,_0x488cae){_0x488cae(null,path[_0xa81e('0x1d')](config['root'],'server/files/attachments/'));},'filename':function(_0x2a75d7,_0x41221f,_0x138b3f){_0x138b3f(null,util[_0xa81e('0x1e')](_0xa81e('0x1f'),Date[_0xa81e('0x20')](),_0x41221f[_0xa81e('0x21')][_0xa81e('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa81e('0x19')]('/:id/attachment_upload',upload[_0xa81e('0x23')]('file'),controller[_0xa81e('0x24')]);router[_0xa81e('0x19')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xa81e('0x25')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xa81e('0x26')](_0xa81e('0x27'),'chatinteraction:addtags'),controller[_0xa81e('0x28')]);router['put'](_0xa81e('0xe'),auth[_0xa81e('0xb')](),interaction[_0xa81e('0x26')]('chat',_0xa81e('0x29')),controller[_0xa81e('0x2a')]);router['put']('/:id/custom_update',controller[_0xa81e('0x2b')]);router[_0xa81e('0x2c')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xa81e('0x2c')](_0xa81e('0x2d'),controller[_0xa81e('0x2e')]);router[_0xa81e('0x2f')](_0xa81e('0xe'),auth[_0xa81e('0xb')](),interaction[_0xa81e('0x26')](_0xa81e('0x27'),_0xa81e('0x30')),controller[_0xa81e('0x31')]);router[_0xa81e('0x2f')](_0xa81e('0x32'),auth[_0xa81e('0xb')](),controller[_0xa81e('0x33')]);module[_0xa81e('0x34')]=router; \ No newline at end of file +var _0xcab2=['./chatInteraction.controller','get','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','originalname','replace','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','close','tracked','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xed2250,_0x4a7602){var _0x24cdd3=function(_0x1a7b13){while(--_0x1a7b13){_0xed2250['push'](_0xed2250['shift']());}};_0x24cdd3(++_0x4a7602);}(_0xcab2,0x171));var _0x2cab=function(_0x401127,_0x23ae22){_0x401127=_0x401127-0x0;var _0x39c2f1=_0xcab2[_0x401127];return _0x39c2f1;};'use strict';var multer=require(_0x2cab('0x0'));var util=require(_0x2cab('0x1'));var path=require('path');var timeout=require(_0x2cab('0x2'));var express=require(_0x2cab('0x3'));var router=express[_0x2cab('0x4')]();var fs_extra=require(_0x2cab('0x5'));var auth=require(_0x2cab('0x6'));var interaction=require(_0x2cab('0x7'));var config=require(_0x2cab('0x8'));var controller=require(_0x2cab('0x9'));router[_0x2cab('0xa')]('/',auth['isAuthenticated'](),controller[_0x2cab('0xb')]);router[_0x2cab('0xa')](_0x2cab('0xc'),auth['isAuthenticated'](),controller[_0x2cab('0xd')]);router[_0x2cab('0xa')]('/:id',auth[_0x2cab('0xe')](),controller[_0x2cab('0xf')]);router[_0x2cab('0xa')](_0x2cab('0x10'),auth[_0x2cab('0xe')](),controller[_0x2cab('0x11')]);router[_0x2cab('0xa')](_0x2cab('0x12'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x14')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x2cab('0x15')]);router[_0x2cab('0xa')](_0x2cab('0x16'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x17')]);router[_0x2cab('0x18')]('/',auth[_0x2cab('0x13')](),controller[_0x2cab('0x19')]);router[_0x2cab('0x18')](_0x2cab('0x1a'),auth[_0x2cab('0x13')](),controller[_0x2cab('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x375113,_0x54e8d2,_0x485b80){_0x485b80(null,path[_0x2cab('0x1c')](config[_0x2cab('0x1d')],_0x2cab('0x1e')));},'filename':function(_0x549d08,_0x41856f,_0x366009){_0x366009(null,util[_0x2cab('0x1f')](_0x2cab('0x20'),Date['now'](),_0x41856f[_0x2cab('0x21')][_0x2cab('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2cab('0x18')]('/:id/attachment_upload',upload['single'](_0x2cab('0x23')),controller[_0x2cab('0x24')]);router[_0x2cab('0x18')](_0x2cab('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x2cab('0x25')]);router[_0x2cab('0x18')](_0x2cab('0x26'),auth['isAuthenticated'](),interaction['tracked'](_0x2cab('0x27'),'chatinteraction:addtags'),controller[_0x2cab('0x28')]);router[_0x2cab('0x29')](_0x2cab('0x2a'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x2cab('0x2b')),controller[_0x2cab('0x2c')]);router['put'](_0x2cab('0x2d'),controller['customUpdate']);router[_0x2cab('0x29')](_0x2cab('0x2e'),auth[_0x2cab('0xe')](),controller['abandon']);router['put']('/:id/close',controller[_0x2cab('0x2f')]);router['delete'](_0x2cab('0x2a'),auth[_0x2cab('0x13')](),interaction[_0x2cab('0x30')](_0x2cab('0x27'),_0x2cab('0x31')),controller[_0x2cab('0x32')]);router[_0x2cab('0x33')](_0x2cab('0x26'),auth['isAuthenticated'](),controller[_0x2cab('0x34')]);module[_0x2cab('0x35')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 2e6e8e2..e4234fd 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 _0x77dd=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x9dff63,_0x1aa9d8){var _0x19778d=function(_0x246bda){while(--_0x246bda){_0x9dff63['push'](_0x9dff63['shift']());}};_0x19778d(++_0x1aa9d8);}(_0x77dd,0x1da));var _0xd77d=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x77dd[_0x385eb1];return _0x5d40eb;};'use strict';var Sequelize=require(_0xd77d('0x0'));module[_0xd77d('0x1')]={'body':{'type':Sequelize[_0xd77d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd77d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4c17=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x4c17,0x18c));var _0x74c1=function(_0x4d7b32,_0x15bf75){_0x4d7b32=_0x4d7b32-0x0;var _0x43a7c8=_0x4c17[_0x4d7b32];return _0x43a7c8;};'use strict';var Sequelize=require(_0x74c1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74c1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74c1('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x74c1('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index fc2de05..e44cc09 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 _0xfad2=['reject','save','update','then','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','map','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','admin','user','fullname','userpic','internal','showWebBar','-online','VoiceQueues','type','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x291604,_0x16366c){var _0x2361d3=function(_0x35da2a){while(--_0x35da2a){_0x291604['push'](_0x291604['shift']());}};_0x2361d3(++_0x16366c);}(_0xfad2,0x126));var _0x2fad=function(_0x965750,_0x5f1f24){_0x965750=_0x965750-0x0;var _0x1429f5=_0xfad2[_0x965750];return _0x1429f5;};'use strict';var emlformat=require(_0x2fad('0x0'));var rimraf=require(_0x2fad('0x1'));var zipdir=require(_0x2fad('0x2'));var jsonpatch=require(_0x2fad('0x3'));var rp=require(_0x2fad('0x4'));var moment=require(_0x2fad('0x5'));var BPromise=require(_0x2fad('0x6'));var Mustache=require(_0x2fad('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2fad('0x8'));var csv=require('to-csv');var ejs=require(_0x2fad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fad('0xa'));var squel=require(_0x2fad('0xb'));var crypto=require(_0x2fad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2fad('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fad('0xe'));var authService=require(_0x2fad('0xf'));var qs=require(_0x2fad('0x10'));var as=require(_0x2fad('0x11'));var hardwareService=require(_0x2fad('0x12'));var logger=require(_0x2fad('0x13'))(_0x2fad('0x14'));var utils=require('../../config/utils');var config=require(_0x2fad('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2fad('0x16'))['db'];config['redis']=_[_0x2fad('0x17')](config['redis'],{'host':_0x2fad('0x18'),'port':0x18eb});var socket=require(_0x2fad('0x19'))(new Redis(config['redis']));require(_0x2fad('0x1a'))['register'](socket);function respondWithStatusCode(_0x5aec00,_0x23fa06){_0x23fa06=_0x23fa06||0xcc;return function(_0x47fe6b){if(_0x47fe6b){return _0x5aec00[_0x2fad('0x1b')](_0x23fa06);}return _0x5aec00['status'](_0x23fa06)['end']();};}function respondWithResult(_0x313280,_0x181e84){_0x181e84=_0x181e84||0xc8;return function(_0x4569e6){if(_0x4569e6){return _0x313280[_0x2fad('0x1c')](_0x181e84)[_0x2fad('0x1d')](_0x4569e6);}};}function respondWithFilteredResult(_0x17e9d9,_0x35181d){return function(_0x151a16){if(_0x151a16){var _0xa85757=typeof _0x35181d[_0x2fad('0x1e')]===_0x2fad('0x1f')&&typeof _0x35181d[_0x2fad('0x20')]===_0x2fad('0x1f');var _0x24ceb1=_0x151a16[_0x2fad('0x21')];var _0x1e4afd=_0xa85757?0x0:_0x35181d[_0x2fad('0x1e')];var _0x599dcb=_0xa85757?_0x151a16[_0x2fad('0x21')]:_0x35181d[_0x2fad('0x1e')]+_0x35181d[_0x2fad('0x20')];var _0x61c6a1;if(_0x599dcb>=_0x24ceb1){_0x599dcb=_0x24ceb1;_0x61c6a1=0xc8;}else{_0x61c6a1=0xce;}_0x17e9d9[_0x2fad('0x1c')](_0x61c6a1);return _0x17e9d9[_0x2fad('0x22')](_0x2fad('0x23'),_0x1e4afd+'-'+_0x599dcb+'/'+_0x24ceb1)[_0x2fad('0x1d')](_0x151a16);}return null;};}function patchUpdates(_0x121a11){return function(_0x22e572){try{jsonpatch['apply'](_0x22e572,_0x121a11,!![]);}catch(_0xf96bcb){return BPromise[_0x2fad('0x24')](_0xf96bcb);}return _0x22e572[_0x2fad('0x25')]();};}function saveUpdates(_0x504b45,_0x46f44f){return function(_0x4948fe){if(_0x4948fe){return _0x4948fe[_0x2fad('0x26')](_0x504b45)[_0x2fad('0x27')](function(_0x376bf1){return _0x376bf1;});}return null;};}function removeEntity(_0x527e25,_0x1a327f){return function(_0xde4d12){if(_0xde4d12){return _0xde4d12['destroy']()[_0x2fad('0x27')](function(){_0x527e25[_0x2fad('0x1c')](0xcc)[_0x2fad('0x28')]();});}};}function handleEntityNotFound(_0x5e0390,_0x49e66d){return function(_0x162316){if(!_0x162316){_0x5e0390[_0x2fad('0x1b')](0x194);}return _0x162316;};}function handleError(_0x3bf2a1,_0x243fd4){_0x243fd4=_0x243fd4||0x1f4;return function(_0x2c7af6){logger[_0x2fad('0x29')](_0x2c7af6[_0x2fad('0x2a')]);if(_0x2c7af6['name']){delete _0x2c7af6[_0x2fad('0x2b')];}_0x3bf2a1[_0x2fad('0x1c')](_0x243fd4)[_0x2fad('0x2c')](_0x2c7af6);};}exports[_0x2fad('0x2d')]=function(_0x545ab1,_0x48f7d9){var _0x161750={},_0x314963={},_0x3f374c={'count':0x0,'rows':[]};var _0x5d0599=_['map'](db[_0x2fad('0x2e')][_0x2fad('0x2f')],function(_0x85600d){return{'name':_0x85600d[_0x2fad('0x30')],'type':_0x85600d['type'][_0x2fad('0x31')]};});_0x314963['model']=_[_0x2fad('0x32')](_0x5d0599,_0x2fad('0x2b'));_0x314963['query']=_[_0x2fad('0x33')](_0x545ab1[_0x2fad('0x34')]);_0x314963[_0x2fad('0x35')]=_['intersection'](_0x314963[_0x2fad('0x36')],_0x314963[_0x2fad('0x34')]);_0x161750[_0x2fad('0x37')]=_['intersection'](_0x314963[_0x2fad('0x36')],qs[_0x2fad('0x38')](_0x545ab1['query'][_0x2fad('0x38')]));_0x161750['attributes']=_0x161750['attributes'][_0x2fad('0x39')]?_0x161750[_0x2fad('0x37')]:_0x314963[_0x2fad('0x36')];if(!_0x545ab1[_0x2fad('0x34')][_0x2fad('0x3a')]('nolimit')){_0x161750[_0x2fad('0x20')]=qs[_0x2fad('0x20')](_0x545ab1[_0x2fad('0x34')]['limit']);_0x161750[_0x2fad('0x1e')]=qs['offset'](_0x545ab1[_0x2fad('0x34')][_0x2fad('0x1e')]);}_0x161750[_0x2fad('0x3b')]=qs['sort'](_0x545ab1[_0x2fad('0x34')][_0x2fad('0x3c')]);_0x161750[_0x2fad('0x3d')]=qs[_0x2fad('0x35')](_['pick'](_0x545ab1[_0x2fad('0x34')],_0x314963[_0x2fad('0x35')]),_0x5d0599);if(_0x545ab1['query']['filter']){_0x161750[_0x2fad('0x3d')]=_[_0x2fad('0x3e')](_0x161750[_0x2fad('0x3d')],{'$or':_['map'](_0x5d0599,function(_0xad6c1b){if(_0xad6c1b['type']!==_0x2fad('0x3f')){var _0x1d4faa={};_0x1d4faa[_0xad6c1b[_0x2fad('0x2b')]]={'$like':'%'+_0x545ab1[_0x2fad('0x34')][_0x2fad('0x40')]+'%'};return _0x1d4faa;}})});}_0x161750=_['merge']({},_0x161750,_0x545ab1[_0x2fad('0x41')]);var _0x59fe61={'where':_0x161750[_0x2fad('0x3d')]};return db[_0x2fad('0x2e')][_0x2fad('0x21')](_0x59fe61)[_0x2fad('0x27')](function(_0x512d74){_0x3f374c[_0x2fad('0x21')]=_0x512d74;if(_0x545ab1[_0x2fad('0x34')][_0x2fad('0x42')]){_0x161750[_0x2fad('0x43')]=[{'all':!![]}];}return db[_0x2fad('0x2e')][_0x2fad('0x44')](_0x161750);})[_0x2fad('0x27')](function(_0x13090f){_0x3f374c[_0x2fad('0x45')]=_0x13090f;return _0x3f374c;})[_0x2fad('0x27')](respondWithFilteredResult(_0x48f7d9,_0x161750))[_0x2fad('0x46')](handleError(_0x48f7d9,null));};exports[_0x2fad('0x47')]=function(_0x53c786,_0x27707d){var _0x26bb87={'raw':!![],'where':{'id':_0x53c786[_0x2fad('0x48')]['id']}},_0x47f9b2={};_0x47f9b2[_0x2fad('0x36')]=_[_0x2fad('0x33')](db[_0x2fad('0x2e')][_0x2fad('0x2f')]);_0x47f9b2['query']=_[_0x2fad('0x33')](_0x53c786[_0x2fad('0x34')]);_0x47f9b2[_0x2fad('0x35')]=_['intersection'](_0x47f9b2[_0x2fad('0x36')],_0x47f9b2[_0x2fad('0x34')]);_0x26bb87[_0x2fad('0x37')]=_[_0x2fad('0x49')](_0x47f9b2[_0x2fad('0x36')],qs[_0x2fad('0x38')](_0x53c786[_0x2fad('0x34')][_0x2fad('0x38')]));_0x26bb87['attributes']=_0x26bb87['attributes']['length']?_0x26bb87[_0x2fad('0x37')]:_0x47f9b2[_0x2fad('0x36')];if(_0x53c786[_0x2fad('0x34')][_0x2fad('0x42')]){_0x26bb87[_0x2fad('0x43')]=[{'all':!![]}];}_0x26bb87=_['merge']({},_0x26bb87,_0x53c786[_0x2fad('0x41')]);return db['ChatInternalMessage'][_0x2fad('0x4a')](_0x26bb87)['then'](handleEntityNotFound(_0x27707d,null))[_0x2fad('0x27')](respondWithResult(_0x27707d,null))[_0x2fad('0x46')](handleError(_0x27707d,null));};exports[_0x2fad('0x4b')]=function(_0x334d8a,_0x16d609){return db[_0x2fad('0x2e')][_0x2fad('0x4b')](_0x334d8a[_0x2fad('0x4c')],{})[_0x2fad('0x27')](respondWithResult(_0x16d609,0xc9))['catch'](handleError(_0x16d609,null));};exports[_0x2fad('0x26')]=function(_0x38bc6f,_0x23fcef){if(_0x38bc6f[_0x2fad('0x4c')]['id']){delete _0x38bc6f['body']['id'];}return db[_0x2fad('0x2e')][_0x2fad('0x4a')]({'where':{'id':_0x38bc6f[_0x2fad('0x48')]['id']}})[_0x2fad('0x27')](handleEntityNotFound(_0x23fcef,null))['then'](saveUpdates(_0x38bc6f[_0x2fad('0x4c')],null))[_0x2fad('0x27')](respondWithResult(_0x23fcef,null))[_0x2fad('0x46')](handleError(_0x23fcef,null));};exports[_0x2fad('0x4d')]=function(_0x222851,_0x4a3986){return db['ChatInternalMessage']['find']({'where':{'id':_0x222851['params']['id']}})[_0x2fad('0x27')](handleEntityNotFound(_0x4a3986,null))[_0x2fad('0x27')](removeEntity(_0x4a3986,null))[_0x2fad('0x46')](handleError(_0x4a3986,null));};exports['describe']=function(_0x5ee262,_0x3e8365){return db[_0x2fad('0x2e')][_0x2fad('0x4e')]()[_0x2fad('0x27')](respondWithResult(_0x3e8365,null))[_0x2fad('0x46')](handleError(_0x3e8365,null));};function wrapUser(_0x37c0a7){return function(_0x1bad53){var _0x1c8450=_0x37c0a7[_0x2fad('0x4f')]({'plain':!![]});_0x1c8450[_0x2fad('0x50')]=[];if(_0x1bad53){_0x1c8450[_0x2fad('0x51')]=_0x1bad53[_0x2fad('0x52')];_0x1c8450[_0x2fad('0x53')]=_0x1bad53;}else{_0x1c8450[_0x2fad('0x51')]=moment(0x0)[_0x2fad('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c8450[_0x2fad('0x53')]={};}return _0x1c8450;};}exports[_0x2fad('0x55')]=function(_0x4d5997,_0x40bcb8,_0x1cec35){var _0x3fd766=[];return db[_0x2fad('0x56')][_0x2fad('0x44')]({'where':{'role':['agent',_0x2fad('0x57'),_0x2fad('0x58')]},'attributes':['id',_0x2fad('0x59'),_0x2fad('0x2b'),'role',_0x2fad('0x5a'),_0x2fad('0x5b'),'online','lastLoginAt','allowmessenger',_0x2fad('0x5c')],'order':qs['sort'](_0x2fad('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x2fad('0x5e'),'attributes':['id','name',_0x2fad('0x5f')],'through':{'attributes':[]}}]})[_0x2fad('0x27')](function(_0x5d06a1){if(_0x5d06a1){var _0x895f0=_0x4d5997[_0x2fad('0x58')][_0x2fad('0x4f')]({'plain':!![]});if(!_0x895f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x895f0[_0x2fad('0x60')]==='user'){return db[_0x2fad('0x61')][_0x2fad('0x4a')]({'where':{'name':'Agents','userProfileId':_0x895f0[_0x2fad('0x62')]},'raw':!![]})[_0x2fad('0x27')](function(_0x4611ad){if(_0x4611ad){if(_0x4611ad[_0x2fad('0x63')]===0x0){return db[_0x2fad('0x64')][_0x2fad('0x44')]({'where':{'sectionId':_0x4611ad['id']},'raw':!![]})[_0x2fad('0x27')](function(_0x5ea110){var _0x563f22=[];if(_[_0x2fad('0x65')](_0x5ea110)){_0x563f22=_[_0x2fad('0x40')](_0x5d06a1,function(_0x165c3a){if(_0x165c3a[_0x2fad('0x60')]!=='agent'){return _0x165c3a;}});return _0x563f22;}else{for(var _0x31a523=0x0;_0x31a523<_0x5d06a1[_0x2fad('0x39')];_0x31a523++){var _0x1e4ce8=_0x5d06a1[_0x31a523];if(_0x1e4ce8['role']===_0x2fad('0x66')){var _0x16364f=_['find'](_0x5ea110,function(_0x2b7b92){return _0x2b7b92[_0x2fad('0x67')]===_0x1e4ce8['id'];});if(_0x16364f)_0x563f22[_0x2fad('0x68')](_0x1e4ce8);}else{_0x563f22[_0x2fad('0x68')](_0x1e4ce8);}}return _0x563f22;}});}else{return _0x5d06a1;}}else{var _0x301234=_[_0x2fad('0x40')](_0x5d06a1,function(_0x10948d){if(_0x10948d['role']!=='agent'){return _0x10948d;}});return _0x301234;}});}else{return _0x5d06a1;}}})[_0x2fad('0x27')](function(_0x5c9eeb){var _0x18d95f=[];if(_0x5c9eeb){_0x3fd766=_0x5c9eeb;for(var _0x1b4751=0x0;_0x1b4751<_0x5c9eeb[_0x2fad('0x39')];_0x1b4751+=0x1){_0x3fd766[_0x1b4751][_0x2fad('0x50')]=[];_0x18d95f[_0x2fad('0x68')](db[_0x2fad('0x2e')]['find']({'where':{'FromId':[_0x4d5997[_0x2fad('0x58')]['id'],_0x5c9eeb[_0x1b4751]['id']],'ToId':[_0x4d5997[_0x2fad('0x58')]['id'],_0x5c9eeb[_0x1b4751]['id']],'ChatGroupId':null},'attributes':['id',_0x2fad('0x52'),_0x2fad('0x69'),_0x2fad('0x6a'),_0x2fad('0x6b'),_0x2fad('0x4c')],'order':qs[_0x2fad('0x3c')](_0x2fad('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5c9eeb[_0x1b4751])));}return BPromise[_0x2fad('0x6d')](_0x18d95f);}return[];})[_0x2fad('0x27')](function(_0x39ea21){return{'rows':_0x39ea21,'count':_0x39ea21[_0x2fad('0x39')]};})[_0x2fad('0x27')](respondWithResult(_0x40bcb8,null))['catch'](handleError(_0x40bcb8,null));}; \ No newline at end of file +var _0xd70b=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','then','includeAll','findAll','rows','catch','show','params','intersection','include','options','create','body','find','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','ToId','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x3bc5af,_0x7aa75a){var _0x4fe7ce=function(_0x29245d){while(--_0x29245d){_0x3bc5af['push'](_0x3bc5af['shift']());}};_0x4fe7ce(++_0x7aa75a);}(_0xd70b,0x142));var _0xbd70=function(_0x1ad9b4,_0x5df9ed){_0x1ad9b4=_0x1ad9b4-0x0;var _0xbbee74=_0xd70b[_0x1ad9b4];return _0xbbee74;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd70('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd70('0x1'));var rp=require(_0xbd70('0x2'));var moment=require(_0xbd70('0x3'));var BPromise=require(_0xbd70('0x4'));var Mustache=require(_0xbd70('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbd70('0x6'));var csv=require(_0xbd70('0x7'));var ejs=require(_0xbd70('0x8'));var fs=require('fs');var fs_extra=require(_0xbd70('0x9'));var _=require(_0xbd70('0xa'));var squel=require(_0xbd70('0xb'));var crypto=require(_0xbd70('0xc'));var jsforce=require(_0xbd70('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbd70('0xe'));var Papa=require(_0xbd70('0xf'));var Redis=require(_0xbd70('0x10'));var authService=require(_0xbd70('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd70('0x12'));var hardwareService=require(_0xbd70('0x13'));var logger=require(_0xbd70('0x14'))('api');var utils=require(_0xbd70('0x15'));var config=require(_0xbd70('0x16'));var licenseUtil=require(_0xbd70('0x17'));var db=require(_0xbd70('0x18'))['db'];config[_0xbd70('0x19')]=_[_0xbd70('0x1a')](config[_0xbd70('0x19')],{'host':_0xbd70('0x1b'),'port':0x18eb});var socket=require(_0xbd70('0x1c'))(new Redis(config[_0xbd70('0x19')]));require(_0xbd70('0x1d'))[_0xbd70('0x1e')](socket);function respondWithStatusCode(_0x22fb80,_0x547d4e){_0x547d4e=_0x547d4e||0xcc;return function(_0x4de051){if(_0x4de051){return _0x22fb80[_0xbd70('0x1f')](_0x547d4e);}return _0x22fb80[_0xbd70('0x20')](_0x547d4e)[_0xbd70('0x21')]();};}function respondWithResult(_0x29359c,_0x25d798){_0x25d798=_0x25d798||0xc8;return function(_0x161ff7){if(_0x161ff7){return _0x29359c['status'](_0x25d798)['json'](_0x161ff7);}};}function respondWithFilteredResult(_0x9e3da0,_0x41381c){return function(_0x303ade){if(_0x303ade){var _0x575e6f=typeof _0x41381c[_0xbd70('0x22')]===_0xbd70('0x23')&&typeof _0x41381c[_0xbd70('0x24')]==='undefined';var _0x3a5cef=_0x303ade['count'];var _0x5d7684=_0x575e6f?0x0:_0x41381c[_0xbd70('0x22')];var _0x5d965c=_0x575e6f?_0x303ade[_0xbd70('0x25')]:_0x41381c[_0xbd70('0x22')]+_0x41381c[_0xbd70('0x24')];var _0x356be4;if(_0x5d965c>=_0x3a5cef){_0x5d965c=_0x3a5cef;_0x356be4=0xc8;}else{_0x356be4=0xce;}_0x9e3da0[_0xbd70('0x20')](_0x356be4);return _0x9e3da0[_0xbd70('0x26')](_0xbd70('0x27'),_0x5d7684+'-'+_0x5d965c+'/'+_0x3a5cef)[_0xbd70('0x28')](_0x303ade);}return null;};}function patchUpdates(_0x2f4ed0){return function(_0x29c1e4){try{jsonpatch[_0xbd70('0x29')](_0x29c1e4,_0x2f4ed0,!![]);}catch(_0x353731){return BPromise[_0xbd70('0x2a')](_0x353731);}return _0x29c1e4[_0xbd70('0x2b')]();};}function saveUpdates(_0x3102e6,_0x4b6f6b){return function(_0x2e1bf0){if(_0x2e1bf0){return _0x2e1bf0[_0xbd70('0x2c')](_0x3102e6)['then'](function(_0x3d6d19){return _0x3d6d19;});}return null;};}function removeEntity(_0x4a5472,_0x55a9ad){return function(_0x59b7a5){if(_0x59b7a5){return _0x59b7a5[_0xbd70('0x2d')]()['then'](function(){_0x4a5472[_0xbd70('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e79d,_0x190737){return function(_0x506204){if(!_0x506204){_0x55e79d[_0xbd70('0x1f')](0x194);}return _0x506204;};}function handleError(_0x2b9412,_0x4814b0){_0x4814b0=_0x4814b0||0x1f4;return function(_0x5ed002){logger[_0xbd70('0x2e')](_0x5ed002[_0xbd70('0x2f')]);if(_0x5ed002[_0xbd70('0x30')]){delete _0x5ed002['name'];}_0x2b9412['status'](_0x4814b0)[_0xbd70('0x31')](_0x5ed002);};}exports[_0xbd70('0x32')]=function(_0x2e45fc,_0x5d185b){var _0x50b66c={},_0x4c23f1={},_0x43cba7={'count':0x0,'rows':[]};var _0x1a334a=_[_0xbd70('0x33')](db[_0xbd70('0x34')][_0xbd70('0x35')],function(_0x25d4ff){return{'name':_0x25d4ff['fieldName'],'type':_0x25d4ff[_0xbd70('0x36')][_0xbd70('0x37')]};});_0x4c23f1[_0xbd70('0x38')]=_[_0xbd70('0x33')](_0x1a334a,_0xbd70('0x30'));_0x4c23f1[_0xbd70('0x39')]=_[_0xbd70('0x3a')](_0x2e45fc[_0xbd70('0x39')]);_0x4c23f1[_0xbd70('0x3b')]=_['intersection'](_0x4c23f1[_0xbd70('0x38')],_0x4c23f1['query']);_0x50b66c[_0xbd70('0x3c')]=_['intersection'](_0x4c23f1[_0xbd70('0x38')],qs[_0xbd70('0x3d')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x3d')]));_0x50b66c[_0xbd70('0x3c')]=_0x50b66c[_0xbd70('0x3c')][_0xbd70('0x3e')]?_0x50b66c[_0xbd70('0x3c')]:_0x4c23f1['model'];if(!_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x3f')]('nolimit')){_0x50b66c[_0xbd70('0x24')]=qs[_0xbd70('0x24')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x24')]);_0x50b66c[_0xbd70('0x22')]=qs[_0xbd70('0x22')](_0x2e45fc['query'][_0xbd70('0x22')]);}_0x50b66c[_0xbd70('0x40')]=qs[_0xbd70('0x41')](_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x41')]);_0x50b66c[_0xbd70('0x42')]=qs[_0xbd70('0x3b')](_[_0xbd70('0x43')](_0x2e45fc[_0xbd70('0x39')],_0x4c23f1[_0xbd70('0x3b')]),_0x1a334a);if(_0x2e45fc[_0xbd70('0x39')]['filter']){_0x50b66c[_0xbd70('0x42')]=_[_0xbd70('0x44')](_0x50b66c['where'],{'$or':_[_0xbd70('0x33')](_0x1a334a,function(_0x2320f5){if(_0x2320f5['type']!==_0xbd70('0x45')){var _0x5ce1c5={};_0x5ce1c5[_0x2320f5[_0xbd70('0x30')]]={'$like':'%'+_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x46')]+'%'};return _0x5ce1c5;}})});}_0x50b66c=_[_0xbd70('0x44')]({},_0x50b66c,_0x2e45fc['options']);var _0x4da749={'where':_0x50b66c[_0xbd70('0x42')]};return db['ChatInternalMessage'][_0xbd70('0x25')](_0x4da749)[_0xbd70('0x47')](function(_0x389c0f){_0x43cba7['count']=_0x389c0f;if(_0x2e45fc[_0xbd70('0x39')][_0xbd70('0x48')]){_0x50b66c['include']=[{'all':!![]}];}return db[_0xbd70('0x34')][_0xbd70('0x49')](_0x50b66c);})[_0xbd70('0x47')](function(_0x3829dc){_0x43cba7[_0xbd70('0x4a')]=_0x3829dc;return _0x43cba7;})[_0xbd70('0x47')](respondWithFilteredResult(_0x5d185b,_0x50b66c))[_0xbd70('0x4b')](handleError(_0x5d185b,null));};exports[_0xbd70('0x4c')]=function(_0x42a951,_0x6f7f2e){var _0x59cc10={'raw':!![],'where':{'id':_0x42a951[_0xbd70('0x4d')]['id']}},_0x2c2c93={};_0x2c2c93[_0xbd70('0x38')]=_['keys'](db[_0xbd70('0x34')][_0xbd70('0x35')]);_0x2c2c93['query']=_[_0xbd70('0x3a')](_0x42a951['query']);_0x2c2c93[_0xbd70('0x3b')]=_[_0xbd70('0x4e')](_0x2c2c93[_0xbd70('0x38')],_0x2c2c93[_0xbd70('0x39')]);_0x59cc10[_0xbd70('0x3c')]=_[_0xbd70('0x4e')](_0x2c2c93['model'],qs[_0xbd70('0x3d')](_0x42a951[_0xbd70('0x39')][_0xbd70('0x3d')]));_0x59cc10[_0xbd70('0x3c')]=_0x59cc10[_0xbd70('0x3c')][_0xbd70('0x3e')]?_0x59cc10['attributes']:_0x2c2c93[_0xbd70('0x38')];if(_0x42a951[_0xbd70('0x39')][_0xbd70('0x48')]){_0x59cc10[_0xbd70('0x4f')]=[{'all':!![]}];}_0x59cc10=_[_0xbd70('0x44')]({},_0x59cc10,_0x42a951[_0xbd70('0x50')]);return db['ChatInternalMessage']['find'](_0x59cc10)[_0xbd70('0x47')](handleEntityNotFound(_0x6f7f2e,null))[_0xbd70('0x47')](respondWithResult(_0x6f7f2e,null))[_0xbd70('0x4b')](handleError(_0x6f7f2e,null));};exports[_0xbd70('0x51')]=function(_0x1bf660,_0x3121f5){return db[_0xbd70('0x34')][_0xbd70('0x51')](_0x1bf660[_0xbd70('0x52')],{})[_0xbd70('0x47')](respondWithResult(_0x3121f5,0xc9))[_0xbd70('0x4b')](handleError(_0x3121f5,null));};exports[_0xbd70('0x2c')]=function(_0x29ec58,_0x5eaad6){if(_0x29ec58['body']['id']){delete _0x29ec58[_0xbd70('0x52')]['id'];}return db[_0xbd70('0x34')][_0xbd70('0x53')]({'where':{'id':_0x29ec58[_0xbd70('0x4d')]['id']}})[_0xbd70('0x47')](handleEntityNotFound(_0x5eaad6,null))[_0xbd70('0x47')](saveUpdates(_0x29ec58[_0xbd70('0x52')],null))['then'](respondWithResult(_0x5eaad6,null))[_0xbd70('0x4b')](handleError(_0x5eaad6,null));};exports[_0xbd70('0x2d')]=function(_0x3c3e2a,_0x1b2689){return db[_0xbd70('0x34')]['find']({'where':{'id':_0x3c3e2a[_0xbd70('0x4d')]['id']}})[_0xbd70('0x47')](handleEntityNotFound(_0x1b2689,null))[_0xbd70('0x47')](removeEntity(_0x1b2689,null))[_0xbd70('0x4b')](handleError(_0x1b2689,null));};exports[_0xbd70('0x54')]=function(_0x511d20,_0x543e4a){return db[_0xbd70('0x34')][_0xbd70('0x54')]()[_0xbd70('0x47')](respondWithResult(_0x543e4a,null))[_0xbd70('0x4b')](handleError(_0x543e4a,null));};function wrapUser(_0x4e93c4){return function(_0x45079d){var _0x2183b9=_0x4e93c4[_0xbd70('0x55')]({'plain':!![]});_0x2183b9[_0xbd70('0x56')]=[];if(_0x45079d){_0x2183b9[_0xbd70('0x57')]=_0x45079d[_0xbd70('0x58')];_0x2183b9['lastMessage']=_0x45079d;}else{_0x2183b9[_0xbd70('0x57')]=moment(0x0)[_0xbd70('0x59')](_0xbd70('0x5a'));_0x2183b9[_0xbd70('0x5b')]={};}return _0x2183b9;};}exports[_0xbd70('0x5c')]=function(_0x58fe9f,_0x19d4af,_0x30134b){var _0x40c254=[];return db[_0xbd70('0x5d')][_0xbd70('0x49')]({'where':{'role':[_0xbd70('0x5e'),_0xbd70('0x5f'),_0xbd70('0x60')]},'attributes':['id','fullname',_0xbd70('0x30'),_0xbd70('0x61'),_0xbd70('0x62'),_0xbd70('0x63'),_0xbd70('0x64'),'lastLoginAt','allowmessenger',_0xbd70('0x65')],'order':qs[_0xbd70('0x41')](_0xbd70('0x66')),'include':[{'model':db[_0xbd70('0x67')],'as':_0xbd70('0x68'),'attributes':['id','name',_0xbd70('0x36')],'through':{'attributes':[]}}]})[_0xbd70('0x47')](function(_0x70fcc3){if(_0x70fcc3){var _0x578841=_0x58fe9f['user'][_0xbd70('0x55')]({'plain':!![]});if(!_0x578841)throw new Error(_0xbd70('0x69'));if(_0x578841['role']===_0xbd70('0x60')){return db['UserProfileSection'][_0xbd70('0x53')]({'where':{'name':_0xbd70('0x6a'),'userProfileId':_0x578841[_0xbd70('0x6b')]},'raw':!![]})[_0xbd70('0x47')](function(_0x4a724d){if(_0x4a724d){if(_0x4a724d[_0xbd70('0x6c')]===0x0){return db[_0xbd70('0x6d')]['findAll']({'where':{'sectionId':_0x4a724d['id']},'raw':!![]})[_0xbd70('0x47')](function(_0x5d9026){var _0xab5059=[];if(_[_0xbd70('0x6e')](_0x5d9026)){_0xab5059=_[_0xbd70('0x46')](_0x70fcc3,function(_0x399519){if(_0x399519[_0xbd70('0x61')]!==_0xbd70('0x5e')){return _0x399519;}});return _0xab5059;}else{for(var _0x201df5=0x0;_0x201df5<_0x70fcc3[_0xbd70('0x3e')];_0x201df5++){var _0x4a64c8=_0x70fcc3[_0x201df5];if(_0x4a64c8[_0xbd70('0x61')]===_0xbd70('0x5e')){var _0x5cd06d=_['find'](_0x5d9026,function(_0x52a061){return _0x52a061['resourceId']===_0x4a64c8['id'];});if(_0x5cd06d)_0xab5059[_0xbd70('0x6f')](_0x4a64c8);}else{_0xab5059[_0xbd70('0x6f')](_0x4a64c8);}}return _0xab5059;}});}else{return _0x70fcc3;}}else{var _0x3e45d4=_['filter'](_0x70fcc3,function(_0x4ede6f){if(_0x4ede6f[_0xbd70('0x61')]!==_0xbd70('0x5e')){return _0x4ede6f;}});return _0x3e45d4;}});}else{return _0x70fcc3;}}})[_0xbd70('0x47')](function(_0x3ecde4){var _0x5ca682=[];if(_0x3ecde4){_0x40c254=_0x3ecde4;for(var _0x570941=0x0;_0x570941<_0x3ecde4['length'];_0x570941+=0x1){_0x40c254[_0x570941][_0xbd70('0x56')]=[];_0x5ca682[_0xbd70('0x6f')](db[_0xbd70('0x34')][_0xbd70('0x53')]({'where':{'FromId':[_0x58fe9f[_0xbd70('0x60')]['id'],_0x3ecde4[_0x570941]['id']],'ToId':[_0x58fe9f[_0xbd70('0x60')]['id'],_0x3ecde4[_0x570941]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xbd70('0x70'),_0xbd70('0x71'),'read',_0xbd70('0x52')],'order':qs[_0xbd70('0x41')](_0xbd70('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbd70('0x47')](wrapUser(_0x3ecde4[_0x570941])));}return BPromise[_0xbd70('0x73')](_0x5ca682);}return[];})[_0xbd70('0x47')](function(_0x4c0e0f){return{'rows':_0x4c0e0f,'count':_0x4c0e0f[_0xbd70('0x3e')]};})['then'](respondWithResult(_0x19d4af,null))[_0xbd70('0x4b')](handleError(_0x19d4af,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d7dc8fb..f7157ae 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 _0x3d30=['ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x3d30,0xf1));var _0x03d3=function(_0x30a62a,_0x31c430){_0x30a62a=_0x30a62a-0x0;var _0x18db09=_0x3d30[_0x30a62a];return _0x18db09;};'use strict';var EventEmitter=require(_0x03d3('0x0'));var ChatInternalMessage=require(_0x03d3('0x1'))['db'][_0x03d3('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03d3('0x3')](0x0);var events={'afterCreate':_0x03d3('0x4'),'afterUpdate':'update','afterDestroy':_0x03d3('0x5')};function emitEvent(_0x1b198c){return function(_0xd03d5e,_0x55c135,_0x437df){ChatInternalMessageEvents[_0x03d3('0x6')](_0x1b198c+':'+_0xd03d5e['id'],_0xd03d5e);ChatInternalMessageEvents[_0x03d3('0x6')](_0x1b198c,_0xd03d5e);_0x437df(null);};}for(var e in events){if(events[_0x03d3('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x03d3('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x9cf9=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x9cf9,0x6d));var _0x99cf=function(_0x4520b0,_0x212a36){_0x4520b0=_0x4520b0-0x0;var _0x53dc0f=_0x9cf9[_0x4520b0];return _0x53dc0f;};'use strict';var EventEmitter=require(_0x99cf('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x99cf('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x99cf('0x2')](0x0);var events={'afterCreate':_0x99cf('0x3'),'afterUpdate':_0x99cf('0x4'),'afterDestroy':_0x99cf('0x5')};function emitEvent(_0x445488){return function(_0x1683f8,_0x170c8d,_0x4192d9){ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488+':'+_0x1683f8['id'],_0x1683f8);ChatInternalMessageEvents[_0x99cf('0x6')](_0x445488,_0x1683f8);_0x4192d9(null);};}for(var e in events){if(events[_0x99cf('0x7')](e)){var event=events[e];ChatInternalMessage[_0x99cf('0x8')](e,emitEvent(event));}}module[_0x99cf('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 1cd9e8d..f83b5b0 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 _0xcbc5=['bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','api','moment'];(function(_0x2cee1c,_0x676f2b){var _0x1b206b=function(_0x7c2895){while(--_0x7c2895){_0x2cee1c['push'](_0x2cee1c['shift']());}};_0x1b206b(++_0x676f2b);}(_0xcbc5,0x184));var _0x5cbc=function(_0x1bce4a,_0x4e33a9){_0x1bce4a=_0x1bce4a-0x0;var _0x5d414d=_0xcbc5[_0x1bce4a];return _0x5d414d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5cbc('0x0'));var moment=require(_0x5cbc('0x1'));var BPromise=require(_0x5cbc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cbc('0x3'));var rimraf=require(_0x5cbc('0x4'));var config=require(_0x5cbc('0x5'));var attributes=require(_0x5cbc('0x6'));module['exports']=function(_0x210471,_0x54fae7){return _0x210471['define'](_0x5cbc('0x7'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cbc('0x8'),'collate':_0x5cbc('0x9')});}; \ No newline at end of file +var _0x2c57=['path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x477b31,_0x5a343){var _0x2317fe=function(_0x2545c1){while(--_0x2545c1){_0x477b31['push'](_0x477b31['shift']());}};_0x2317fe(++_0x5a343);}(_0x2c57,0x173));var _0x72c5=function(_0x497ee4,_0x2f20fe){_0x497ee4=_0x497ee4-0x0;var _0x113273=_0x2c57[_0x497ee4];return _0x113273;};'use strict';var _=require(_0x72c5('0x0'));var util=require(_0x72c5('0x1'));var logger=require(_0x72c5('0x2'))(_0x72c5('0x3'));var moment=require(_0x72c5('0x4'));var BPromise=require(_0x72c5('0x5'));var rp=require(_0x72c5('0x6'));var fs=require('fs');var path=require(_0x72c5('0x7'));var rimraf=require(_0x72c5('0x8'));var config=require(_0x72c5('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x72c5('0xa')]=function(_0x2edcb8,_0x679d01){return _0x2edcb8[_0x72c5('0xb')](_0x72c5('0xc'),attributes,{'tableName':_0x72c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 8f15387..d480500 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 _0x8873=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4c64f0,_0x32b12a){var _0x30ca61=function(_0x19d2f5){while(--_0x19d2f5){_0x4c64f0['push'](_0x4c64f0['shift']());}};_0x30ca61(++_0x32b12a);}(_0x8873,0xad));var _0x3887=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0x8873[_0x3789b9];return _0x4d020d;};'use strict';var _=require(_0x3887('0x0'));var util=require(_0x3887('0x1'));var moment=require(_0x3887('0x2'));var BPromise=require('bluebird');var rs=require(_0x3887('0x3'));var fs=require('fs');var Redis=require(_0x3887('0x4'));var db=require(_0x3887('0x5'))['db'];var utils=require(_0x3887('0x6'));var logger=require('../../config/logger')(_0x3887('0x7'));var config=require(_0x3887('0x8'));var jayson=require(_0x3887('0x9'));var client=jayson[_0x3887('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3887('0xb')](config['redis'],{'host':_0x3887('0xc'),'port':0x18eb});var socket=require(_0x3887('0xd'))(new Redis(config[_0x3887('0xe')]));require(_0x3887('0xf'))[_0x3887('0x10')](socket);function respondWithRpcPromise(_0x508188,_0x2c2d42,_0x3aa6fd){return new BPromise(function(_0x281a40,_0x1d251d){return client[_0x3887('0x11')](_0x508188,_0x3aa6fd)[_0x3887('0x12')](function(_0x5432e4){logger['info'](_0x3887('0x13'),_0x2c2d42,_0x3887('0x14'));logger[_0x3887('0x15')](_0x3887('0x16'),_0x2c2d42,_0x3887('0x14'),JSON[_0x3887('0x17')](_0x5432e4));if(_0x5432e4[_0x3887('0x18')]){if(_0x5432e4['error'][_0x3887('0x19')]===0x1f4){logger['error'](_0x3887('0x13'),_0x2c2d42,_0x5432e4[_0x3887('0x18')][_0x3887('0x1a')]);return _0x1d251d(_0x5432e4['error'][_0x3887('0x1a')]);}logger['error'](_0x3887('0x13'),_0x2c2d42,_0x5432e4[_0x3887('0x18')][_0x3887('0x1a')]);return _0x281a40(_0x5432e4[_0x3887('0x18')]['message']);}else{logger['info'](_0x3887('0x13'),_0x2c2d42,_0x3887('0x14'));_0x281a40(_0x5432e4[_0x3887('0x1b')][_0x3887('0x1a')]);}})[_0x3887('0x1c')](function(_0x1e2093){logger[_0x3887('0x18')](_0x3887('0x13'),_0x2c2d42,_0x1e2093);_0x1d251d(_0x1e2093);});});} \ No newline at end of file +var _0x625b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x13125b,_0x169043){var _0x1c3310=function(_0x5ddad2){while(--_0x5ddad2){_0x13125b['push'](_0x13125b['shift']());}};_0x1c3310(++_0x169043);}(_0x625b,0x121));var _0xb625=function(_0x561da8,_0x4c4ab6){_0x561da8=_0x561da8-0x0;var _0x2079d0=_0x625b[_0x561da8];return _0x2079d0;};'use strict';var _=require(_0xb625('0x0'));var util=require(_0xb625('0x1'));var moment=require(_0xb625('0x2'));var BPromise=require(_0xb625('0x3'));var rs=require(_0xb625('0x4'));var fs=require('fs');var Redis=require(_0xb625('0x5'));var db=require(_0xb625('0x6'))['db'];var utils=require(_0xb625('0x7'));var logger=require(_0xb625('0x8'))(_0xb625('0x9'));var config=require(_0xb625('0xa'));var jayson=require(_0xb625('0xb'));var client=jayson[_0xb625('0xc')][_0xb625('0xd')]({'port':0x232a});config[_0xb625('0xe')]=_[_0xb625('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb625('0xe')]));require(_0xb625('0x10'))[_0xb625('0x11')](socket);function respondWithRpcPromise(_0x29bb83,_0x5dcda3,_0x5aff53){return new BPromise(function(_0x426963,_0x61719){return client[_0xb625('0x12')](_0x29bb83,_0x5aff53)[_0xb625('0x13')](function(_0x394830){logger[_0xb625('0x14')](_0xb625('0x15'),_0x5dcda3,'request\x20sent');logger['debug'](_0xb625('0x16'),_0x5dcda3,_0xb625('0x17'),JSON[_0xb625('0x18')](_0x394830));if(_0x394830[_0xb625('0x19')]){if(_0x394830['error']['code']===0x1f4){logger[_0xb625('0x19')](_0xb625('0x15'),_0x5dcda3,_0x394830['error'][_0xb625('0x1a')]);return _0x61719(_0x394830['error']['message']);}logger['error'](_0xb625('0x15'),_0x5dcda3,_0x394830[_0xb625('0x19')][_0xb625('0x1a')]);return _0x426963(_0x394830[_0xb625('0x19')][_0xb625('0x1a')]);}else{logger['info'](_0xb625('0x15'),_0x5dcda3,'request\x20sent');_0x426963(_0x394830['result'][_0xb625('0x1a')]);}})['catch'](function(_0x5b2b84){logger[_0xb625('0x19')](_0xb625('0x15'),_0x5dcda3,_0x5b2b84);_0x61719(_0x5b2b84);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 69302f4..24dcbc0 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 _0x28c9=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','removeListener','length'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x28c9,0xa9));var _0x928c=function(_0x47d4df,_0x437fa4){_0x47d4df=_0x47d4df-0x0;var _0x5e0ec7=_0x28c9[_0x47d4df];return _0x5e0ec7;};'use strict';var ChatInternalMessageEvents=require(_0x928c('0x0'));var events=[_0x928c('0x1'),_0x928c('0x2'),_0x928c('0x3')];function createListener(_0x8f3fc0,_0x3f62cc){return function(_0x3e0fd4){_0x3f62cc['emit'](_0x8f3fc0,_0x3e0fd4);};}function removeListener(_0x599e5a,_0xf2c0ba){return function(){ChatInternalMessageEvents[_0x928c('0x4')](_0x599e5a,_0xf2c0ba);};}exports['register']=function(_0x3fdedd){for(var _0x5ca0b9=0x0,_0xb58678=events[_0x928c('0x5')];_0x5ca0b9<_0xb58678;_0x5ca0b9++){var _0x2dc0d9=events[_0x5ca0b9];var _0x4b6350=createListener(_0x928c('0x6')+_0x2dc0d9,_0x3fdedd);ChatInternalMessageEvents['on'](_0x2dc0d9,_0x4b6350);}}; \ No newline at end of file +var _0x417c=['update','emit','register','chatInternalMessage:','remove'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x417c,0x199));var _0xc417=function(_0x37b1dd,_0x7bd2cd){_0x37b1dd=_0x37b1dd-0x0;var _0x9641c=_0x417c[_0x37b1dd];return _0x9641c;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0xc417('0x0'),_0xc417('0x1')];function createListener(_0xcd9d60,_0x336e57){return function(_0x545e05){_0x336e57[_0xc417('0x2')](_0xcd9d60,_0x545e05);};}function removeListener(_0x17de54,_0x40b070){return function(){ChatInternalMessageEvents['removeListener'](_0x17de54,_0x40b070);};}exports[_0xc417('0x3')]=function(_0x1f1e78){for(var _0x313bac=0x0,_0x59d4f=events['length'];_0x313bac<_0x59d4f;_0x313bac++){var _0x2d0d70=events[_0x313bac];var _0xa9fc35=createListener(_0xc417('0x4')+_0x2d0d70,_0x1f1e78);ChatInternalMessageEvents['on'](_0x2d0d70,_0xa9fc35);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e450ebc..b2651e4 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 _0xaebf=['describe','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x549b29,_0x2e2b00){var _0x2b813f=function(_0x43234f){while(--_0x43234f){_0x549b29['push'](_0x549b29['shift']());}};_0x2b813f(++_0x2e2b00);}(_0xaebf,0x1bf));var _0xfaeb=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xaebf[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0xfaeb('0x0'));var util=require(_0xfaeb('0x1'));var path=require(_0xfaeb('0x2'));var timeout=require(_0xfaeb('0x3'));var express=require(_0xfaeb('0x4'));var router=express[_0xfaeb('0x5')]();var fs_extra=require(_0xfaeb('0x6'));var auth=require(_0xfaeb('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfaeb('0x8'));var controller=require('./chatInternalMessage.controller');router[_0xfaeb('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaeb('0xa')]);router['get'](_0xfaeb('0xb'),auth[_0xfaeb('0xc')](),controller[_0xfaeb('0xd')]);router[_0xfaeb('0x9')]('/users',auth[_0xfaeb('0xc')](),controller[_0xfaeb('0xe')]);router[_0xfaeb('0x9')](_0xfaeb('0xf'),auth['isAuthenticated'](),controller[_0xfaeb('0x10')]);router['post']('/',auth[_0xfaeb('0xc')](),controller[_0xfaeb('0x11')]);router[_0xfaeb('0x12')](_0xfaeb('0xf'),controller[_0xfaeb('0x13')]);router[_0xfaeb('0x14')](_0xfaeb('0xf'),auth[_0xfaeb('0xc')](),controller[_0xfaeb('0x15')]);module[_0xfaeb('0x16')]=router; \ No newline at end of file +var _0x1b0b=['express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','show','post','create','update','delete','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x49b991,_0x1eeaf0){var _0x6286c3=function(_0x1dc182){while(--_0x1dc182){_0x49b991['push'](_0x49b991['shift']());}};_0x6286c3(++_0x1eeaf0);}(_0x1b0b,0x16d));var _0xb1b0=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x1b0b[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xb1b0('0x0'));var util=require('util');var path=require(_0xb1b0('0x1'));var timeout=require(_0xb1b0('0x2'));var express=require(_0xb1b0('0x3'));var router=express['Router']();var fs_extra=require(_0xb1b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb1b0('0x5'));var config=require(_0xb1b0('0x6'));var controller=require(_0xb1b0('0x7'));router['get']('/',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x9')]);router[_0xb1b0('0xa')](_0xb1b0('0xb'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xc')]);router[_0xb1b0('0xa')](_0xb1b0('0xd'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xe')]);router['get']('/:id',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0xf')]);router[_0xb1b0('0x10')]('/',auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x11')]);router['put']('/:id',controller[_0xb1b0('0x12')]);router[_0xb1b0('0x13')](_0xb1b0('0x14'),auth[_0xb1b0('0x8')](),controller[_0xb1b0('0x15')]);module[_0xb1b0('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 63610dd..9dbfbb8 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 _0x14b7=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x45d681,_0xe24e62){var _0x34c839=function(_0x8a97f2){while(--_0x8a97f2){_0x45d681['push'](_0x45d681['shift']());}};_0x34c839(++_0xe24e62);}(_0x14b7,0x144));var _0x714b=function(_0x5df3ab,_0x4a0a7e){_0x5df3ab=_0x5df3ab-0x0;var _0x42cce5=_0x14b7[_0x5df3ab];return _0x42cce5;};'use strict';var Sequelize=require(_0x714b('0x0'));module[_0x714b('0x1')]={'body':{'type':Sequelize[_0x714b('0x2')](_0x714b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x714b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x714b('0x5')]('in',_0x714b('0x6')),'defaultValue':_0x714b('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x714b('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3870=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1f79f8,_0x4b68e7){var _0x21baa6=function(_0x4ffa5b){while(--_0x4ffa5b){_0x1f79f8['push'](_0x1f79f8['shift']());}};_0x21baa6(++_0x4b68e7);}(_0x3870,0x146));var _0x0387=function(_0x30a5ef,_0x4c57e7){_0x30a5ef=_0x30a5ef-0x0;var _0xecf35d=_0x3870[_0x30a5ef];return _0xecf35d;};'use strict';var Sequelize=require(_0x0387('0x0'));module[_0x0387('0x1')]={'body':{'type':Sequelize[_0x0387('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0387('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0387('0x4')]('in',_0x0387('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0387('0x6')]},'providerName':{'type':Sequelize[_0x0387('0x7')]},'providerResponse':{'type':Sequelize[_0x0387('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1b4500b..6161458 100644 --- a/server/api/chatMessage/chatMessage.controller.js +++ b/server/api/chatMessage/chatMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x28d5d3,_0x4ea64a){var _0x833539=function(_0x3f4929){while(--_0x3f4929){_0x28d5d3['push'](_0x28d5d3['shift']());}};_0x833539(++_0x4ea64a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file +var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x116b01,_0x2a7947){var _0x4fd916=function(_0x1187ab){while(--_0x1187ab){_0x116b01['push'](_0x116b01['shift']());}};_0x4fd916(++_0x2a7947);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index d80ff4f..00db49e 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 _0x175f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x178cc5,_0x4169af){var _0x1a8380=function(_0x5651ea){while(--_0x5651ea){_0x178cc5['push'](_0x178cc5['shift']());}};_0x1a8380(++_0x4169af);}(_0x175f,0x151));var _0xf175=function(_0x3dda2e,_0x1282d1){_0x3dda2e=_0x3dda2e-0x0;var _0x476246=_0x175f[_0x3dda2e];return _0x476246;};'use strict';var EventEmitter=require(_0xf175('0x0'));var ChatMessage=require(_0xf175('0x1'))['db'][_0xf175('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf175('0x3')](0x0);var events={'afterCreate':_0xf175('0x4'),'afterUpdate':_0xf175('0x5'),'afterDestroy':_0xf175('0x6')};function emitEvent(_0x4d2884){return function(_0x45d0a2,_0x92f396,_0x2b0182){ChatMessageEvents['emit'](_0x4d2884+':'+_0x45d0a2['id'],_0x45d0a2);ChatMessageEvents[_0xf175('0x7')](_0x4d2884,_0x45d0a2);_0x2b0182(null);};}for(var e in events){if(events[_0xf175('0x8')](e)){var event=events[e];ChatMessage[_0xf175('0x9')](e,emitEvent(event));}}module[_0xf175('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x8525=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x456cc2,_0x38cdd8){var _0x5ae9f6=function(_0x3dce11){while(--_0x3dce11){_0x456cc2['push'](_0x456cc2['shift']());}};_0x5ae9f6(++_0x38cdd8);}(_0x8525,0x19b));var _0x5852=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8525[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0x5852('0x0'));var ChatMessage=require(_0x5852('0x1'))['db'][_0x5852('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x5852('0x3')](0x0);var events={'afterCreate':_0x5852('0x4'),'afterUpdate':'update','afterDestroy':_0x5852('0x5')};function emitEvent(_0x25280a){return function(_0x1135df,_0x57358f,_0x4d1a58){ChatMessageEvents['emit'](_0x25280a+':'+_0x1135df['id'],_0x1135df);ChatMessageEvents[_0x5852('0x6')](_0x25280a,_0x1135df);_0x4d1a58(null);};}for(var e in events){if(events[_0x5852('0x7')](e)){var event=events[e];ChatMessage[_0x5852('0x8')](e,emitEvent(event));}}module[_0x5852('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index b97c93e..986d72e 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 _0x79f1=['path','rimraf','./chatMessage.attributes','define','chat_messages','body','get','direction','toLowerCase','out','ChatInteraction','findOne','update','createdAt','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79f1,0x73));var _0x179f=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x79f1[_0x22cd0c];return _0x439eba;};'use strict';var _=require('lodash');var util=require(_0x179f('0x0'));var logger=require(_0x179f('0x1'))(_0x179f('0x2'));var moment=require(_0x179f('0x3'));var BPromise=require('bluebird');var rp=require(_0x179f('0x4'));var fs=require('fs');var path=require(_0x179f('0x5'));var rimraf=require(_0x179f('0x6'));var config=require('../../config/environment');var attributes=require(_0x179f('0x7'));module['exports']=function(_0x48f90e,_0x4dc38f){return _0x48f90e[_0x179f('0x8')]('ChatMessage',attributes,{'tableName':_0x179f('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x179f('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x375538,_0xbe4344,_0x4829bb){var _0x11c0e7=_0x48f90e['models'];var _0x488fd0=_0x375538[_0x179f('0xb')]({'plain':!![]});if(_0x488fd0['direction']['toLowerCase']()==='in'||_0x488fd0[_0x179f('0xc')][_0x179f('0xd')]()===_0x179f('0xe')&&!_0x488fd0['secret']&&!_['isNil'](_0x488fd0['UserId'])){_0x11c0e7[_0x179f('0xf')][_0x179f('0x10')]({'where':{'id':_0x488fd0['ChatInteractionId']}})['then'](function(_0x5d198e){if(_0x5d198e){_0x5d198e[_0x179f('0x11')]({'lastMsgAt':_0x488fd0[_0x179f('0x12')],'lastMsgDirection':_0x488fd0[_0x179f('0xc')][_0x179f('0xd')]()});}})['catch'](function(_0x240ae2){console['error'](_0x240ae2);});}_0x4829bb();}},'charset':'utf8mb4','collate':_0x179f('0x13')});}; \ No newline at end of file +var _0x4ab0=['body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4ab0,0xd5));var _0x04ab=function(_0x435cf4,_0x420327){_0x435cf4=_0x435cf4-0x0;var _0x91f65f=_0x4ab0[_0x435cf4];return _0x91f65f;};'use strict';var _=require('lodash');var util=require(_0x04ab('0x0'));var logger=require(_0x04ab('0x1'))(_0x04ab('0x2'));var moment=require(_0x04ab('0x3'));var BPromise=require(_0x04ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x04ab('0x5'));var config=require(_0x04ab('0x6'));var attributes=require('./chatMessage.attributes');module[_0x04ab('0x7')]=function(_0x2c5730,_0x4edd2e){return _0x2c5730[_0x04ab('0x8')](_0x04ab('0x9'),attributes,{'tableName':_0x04ab('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x04ab('0xb')],'type':_0x04ab('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13fde9,_0x41ce1e,_0x4dc264){var _0x252d00=_0x2c5730[_0x04ab('0xd')];var _0x3d003a=_0x13fde9[_0x04ab('0xe')]({'plain':!![]});if(_0x3d003a['direction'][_0x04ab('0xf')]()==='in'||_0x3d003a[_0x04ab('0x10')][_0x04ab('0xf')]()===_0x04ab('0x11')&&!_0x3d003a[_0x04ab('0x12')]&&!_[_0x04ab('0x13')](_0x3d003a['UserId'])){_0x252d00[_0x04ab('0x14')]['findOne']({'where':{'id':_0x3d003a[_0x04ab('0x15')]}})[_0x04ab('0x16')](function(_0x2abdf8){if(_0x2abdf8){_0x2abdf8[_0x04ab('0x17')]({'lastMsgAt':_0x3d003a['createdAt'],'lastMsgDirection':_0x3d003a['direction']['toLowerCase']()});}})[_0x04ab('0x18')](function(_0x3cee44){console[_0x04ab('0x19')](_0x3cee44);});}_0x4dc264();}},'charset':_0x04ab('0x1a'),'collate':_0x04ab('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 87a617d..f5a485d 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 _0x87f9=['then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request'];(function(_0x3847be,_0x39d941){var _0x49b939=function(_0x3e592b){while(--_0x3e592b){_0x3847be['push'](_0x3847be['shift']());}};_0x49b939(++_0x39d941);}(_0x87f9,0xa6));var _0x987f=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x87f9[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x987f('0x0'));var util=require(_0x987f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x987f('0x2'));var fs=require('fs');var Redis=require(_0x987f('0x3'));var db=require(_0x987f('0x4'))['db'];var utils=require(_0x987f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x987f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x987f('0x7')][_0x987f('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x987f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x987f('0xa'))(new Redis(config['redis']));require(_0x987f('0xb'))[_0x987f('0xc')](socket);function respondWithRpcPromise(_0x18e084,_0x33647e,_0x3e69ea){return new BPromise(function(_0x5e1ff9,_0x510210){return client[_0x987f('0xd')](_0x18e084,_0x3e69ea)[_0x987f('0xe')](function(_0x1347d6){logger['info'](_0x987f('0xf'),_0x33647e,_0x987f('0x10'));logger[_0x987f('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x33647e,_0x987f('0x10'),JSON[_0x987f('0x12')](_0x1347d6));if(_0x1347d6[_0x987f('0x13')]){if(_0x1347d6[_0x987f('0x13')][_0x987f('0x14')]===0x1f4){logger[_0x987f('0x13')](_0x987f('0xf'),_0x33647e,_0x1347d6[_0x987f('0x13')][_0x987f('0x15')]);return _0x510210(_0x1347d6[_0x987f('0x13')]['message']);}logger['error'](_0x987f('0xf'),_0x33647e,_0x1347d6['error'][_0x987f('0x15')]);return _0x5e1ff9(_0x1347d6[_0x987f('0x13')][_0x987f('0x15')]);}else{logger[_0x987f('0x16')](_0x987f('0xf'),_0x33647e,_0x987f('0x10'));_0x5e1ff9(_0x1347d6[_0x987f('0x17')][_0x987f('0x15')]);}})['catch'](function(_0x4c78b){logger[_0x987f('0x13')](_0x987f('0xf'),_0x33647e,_0x4c78b);_0x510210(_0x4c78b);});});}exports[_0x987f('0x18')]=function(_0x52b4b4){var _0xc75482=this;return new Promise(function(_0x1466f4,_0x588187){return db[_0x987f('0x19')]['create'](_0x52b4b4[_0x987f('0x1a')],{'raw':_0x52b4b4[_0x987f('0x1b')]?_0x52b4b4[_0x987f('0x1b')][_0x987f('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1b74da){logger[_0x987f('0x16')]('CreateChatMessage',_0x52b4b4);logger[_0x987f('0x11')](_0x987f('0x18'),_0x52b4b4,JSON[_0x987f('0x12')](_0x1b74da));_0x1466f4(_0x1b74da);})[_0x987f('0x1d')](function(_0x39d438){logger[_0x987f('0x13')](_0x987f('0x18'),_0x39d438['message'],_0x52b4b4);_0x588187(_0xc75482[_0x987f('0x13')](0x1f4,_0x39d438['message']));});});}; \ No newline at end of file +var _0x7bc3=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','./chatMessage.socket','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','body','options','raw','CreateChatMessage','lodash'];(function(_0xd87d6c,_0x31c6ab){var _0x7ca857=function(_0x26f469){while(--_0x26f469){_0xd87d6c['push'](_0xd87d6c['shift']());}};_0x7ca857(++_0x31c6ab);}(_0x7bc3,0xbc));var _0x37bc=function(_0x2cace5,_0x515aa7){_0x2cace5=_0x2cace5-0x0;var _0x4083b6=_0x7bc3[_0x2cace5];return _0x4083b6;};'use strict';var _=require(_0x37bc('0x0'));var util=require(_0x37bc('0x1'));var moment=require(_0x37bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x37bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37bc('0x4'))['db'];var utils=require(_0x37bc('0x5'));var logger=require(_0x37bc('0x6'))(_0x37bc('0x7'));var config=require(_0x37bc('0x8'));var jayson=require(_0x37bc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x37bc('0xa')]=_['defaults'](config[_0x37bc('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37bc('0xa')]));require(_0x37bc('0xb'))['register'](socket);function respondWithRpcPromise(_0x3c16e5,_0x54ef62,_0x4c7900){return new BPromise(function(_0x59f552,_0x276013){return client['request'](_0x3c16e5,_0x4c7900)[_0x37bc('0xc')](function(_0x250095){logger[_0x37bc('0xd')]('ChatMessage,\x20%s,\x20%s',_0x54ef62,_0x37bc('0xe'));logger[_0x37bc('0xf')](_0x37bc('0x10'),_0x54ef62,_0x37bc('0xe'),JSON[_0x37bc('0x11')](_0x250095));if(_0x250095[_0x37bc('0x12')]){if(_0x250095[_0x37bc('0x12')][_0x37bc('0x13')]===0x1f4){logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0x250095['error'][_0x37bc('0x15')]);return _0x276013(_0x250095[_0x37bc('0x12')][_0x37bc('0x15')]);}logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0x250095[_0x37bc('0x12')]['message']);return _0x59f552(_0x250095[_0x37bc('0x12')][_0x37bc('0x15')]);}else{logger[_0x37bc('0xd')](_0x37bc('0x14'),_0x54ef62,_0x37bc('0xe'));_0x59f552(_0x250095[_0x37bc('0x16')]['message']);}})['catch'](function(_0xb75ad3){logger[_0x37bc('0x12')](_0x37bc('0x14'),_0x54ef62,_0xb75ad3);_0x276013(_0xb75ad3);});});}exports['CreateChatMessage']=function(_0x12a8c6){var _0x5dfd71=this;return new Promise(function(_0x1a5287,_0x4db419){return db['ChatMessage']['create'](_0x12a8c6[_0x37bc('0x17')],{'raw':_0x12a8c6['options']?_0x12a8c6[_0x37bc('0x18')][_0x37bc('0x19')]===undefined?!![]:![]:!![]})[_0x37bc('0xc')](function(_0x507936){logger['info'](_0x37bc('0x1a'),_0x12a8c6);logger[_0x37bc('0xf')](_0x37bc('0x1a'),_0x12a8c6,JSON[_0x37bc('0x11')](_0x507936));_0x1a5287(_0x507936);})['catch'](function(_0xd749c6){logger['error'](_0x37bc('0x1a'),_0xd749c6[_0x37bc('0x15')],_0x12a8c6);_0x4db419(_0x5dfd71[_0x37bc('0x12')](0x1f4,_0xd749c6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 7f11952..1759919 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 _0x3645=['emit','removeListener','register','length','save','remove','update'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x3645,0x154));var _0x5364=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x3645[_0x1e393b];return _0x3d0bfe;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5364('0x0'),_0x5364('0x1'),_0x5364('0x2')];function createListener(_0x28eafb,_0x2d71d7){return function(_0x2f629b){_0x2d71d7[_0x5364('0x3')](_0x28eafb,_0x2f629b);};}function removeListener(_0x5a63bf,_0x334a16){return function(){ChatMessageEvents[_0x5364('0x4')](_0x5a63bf,_0x334a16);};}exports[_0x5364('0x5')]=function(_0x1f9c6b){for(var _0x417c44=0x0,_0x7933a5=events[_0x5364('0x6')];_0x417c44<_0x7933a5;_0x417c44++){var _0x43fb3f=events[_0x417c44];var _0x3c1b21=createListener('chatMessage:'+_0x43fb3f,_0x1f9c6b);ChatMessageEvents['on'](_0x43fb3f,_0x3c1b21);}}; \ No newline at end of file +var _0xc7a3=['remove','update','register','length','save'];(function(_0x57961a,_0x58a928){var _0x299fad=function(_0x28b99f){while(--_0x28b99f){_0x57961a['push'](_0x57961a['shift']());}};_0x299fad(++_0x58a928);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x15aa87,_0x366760){_0x15aa87=_0x15aa87-0x0;var _0x23dceb=_0xc7a3[_0x15aa87];return _0x23dceb;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x3c7a('0x0'),_0x3c7a('0x1'),_0x3c7a('0x2')];function createListener(_0x12f959,_0x283aed){return function(_0x2d6d97){_0x283aed['emit'](_0x12f959,_0x2d6d97);};}function removeListener(_0x44fd47,_0x3e1c47){return function(){ChatMessageEvents['removeListener'](_0x44fd47,_0x3e1c47);};}exports[_0x3c7a('0x3')]=function(_0x2051ce){for(var _0x2736c1=0x0,_0x48e820=events[_0x3c7a('0x4')];_0x2736c1<_0x48e820;_0x2736c1++){var _0x4f0608=events[_0x2736c1];var _0x20d36c=createListener('chatMessage:'+_0x4f0608,_0x2051ce);ChatMessageEvents['on'](_0x4f0608,_0x20d36c);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c05f086..f38b64c 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 _0x6cde=['isAuthenticated','index','/describe','describe','/:id','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x559e0f,_0x5cde8f){var _0x485792=function(_0x30a136){while(--_0x30a136){_0x559e0f['push'](_0x559e0f['shift']());}};_0x485792(++_0x5cde8f);}(_0x6cde,0xfa));var _0xe6cd=function(_0x473b3a,_0x4889de){_0x473b3a=_0x473b3a-0x0;var _0x557b97=_0x6cde[_0x473b3a];return _0x557b97;};'use strict';var multer=require(_0xe6cd('0x0'));var util=require(_0xe6cd('0x1'));var path=require(_0xe6cd('0x2'));var timeout=require(_0xe6cd('0x3'));var express=require(_0xe6cd('0x4'));var router=express[_0xe6cd('0x5')]();var fs_extra=require(_0xe6cd('0x6'));var auth=require(_0xe6cd('0x7'));var interaction=require(_0xe6cd('0x8'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0xe6cd('0x9')]('/',auth[_0xe6cd('0xa')](),controller[_0xe6cd('0xb')]);router[_0xe6cd('0x9')](_0xe6cd('0xc'),auth['isAuthenticated'](),controller[_0xe6cd('0xd')]);router[_0xe6cd('0x9')](_0xe6cd('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe6cd('0xa')](),interaction[_0xe6cd('0xf')](_0xe6cd('0x10'),_0xe6cd('0x11')),controller[_0xe6cd('0x12')]);router[_0xe6cd('0x13')]('/:id',controller[_0xe6cd('0x14')]);router['put'](_0xe6cd('0x15'),auth[_0xe6cd('0xa')](),controller['accept']);router['put'](_0xe6cd('0x16'),auth[_0xe6cd('0xa')](),controller['reject']);router[_0xe6cd('0x17')](_0xe6cd('0xe'),auth[_0xe6cd('0xa')](),controller[_0xe6cd('0x18')]);module[_0xe6cd('0x19')]=router; \ No newline at end of file +var _0x5216=['show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5216,0x1a5));var _0x6521=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5216[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x6521('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6521('0x1'));var router=express[_0x6521('0x2')]();var fs_extra=require(_0x6521('0x3'));var auth=require(_0x6521('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6521('0x5'));router[_0x6521('0x6')]('/',auth['isAuthenticated'](),controller[_0x6521('0x7')]);router[_0x6521('0x6')](_0x6521('0x8'),auth[_0x6521('0x9')](),controller['describe']);router[_0x6521('0x6')](_0x6521('0xa'),auth[_0x6521('0x9')](),controller[_0x6521('0xb')]);router[_0x6521('0xc')]('/',auth[_0x6521('0x9')](),interaction[_0x6521('0xd')](_0x6521('0xe'),_0x6521('0xf')),controller[_0x6521('0x10')]);router[_0x6521('0x11')](_0x6521('0xa'),controller[_0x6521('0x12')]);router[_0x6521('0x11')]('/:id/accept',auth[_0x6521('0x9')](),controller[_0x6521('0x13')]);router[_0x6521('0x11')](_0x6521('0x14'),auth['isAuthenticated'](),controller[_0x6521('0x15')]);router[_0x6521('0x16')](_0x6521('0xa'),auth[_0x6521('0x9')](),controller[_0x6521('0x17')]);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 5f2f92a..7722dfa 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 _0xe80a=['sequelize','exports','TEXT','medium'];(function(_0x42bd65,_0x588b44){var _0x46da0d=function(_0x49e9f9){while(--_0x49e9f9){_0x42bd65['push'](_0x42bd65['shift']());}};_0x46da0d(++_0x588b44);}(_0xe80a,0x8c));var _0xae80=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xe80a[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0xae80('0x0'));module[_0xae80('0x1')]={'body':{'type':Sequelize[_0xae80('0x2')](_0xae80('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xff71=['sequelize','exports','TEXT','medium'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xff71,0x1b0));var _0x1ff7=function(_0x35faf2,_0x56a899){_0x35faf2=_0x35faf2-0x0;var _0x113601=_0xff71[_0x35faf2];return _0x113601;};'use strict';var Sequelize=require(_0x1ff7('0x0'));module[_0x1ff7('0x1')]={'body':{'type':Sequelize[_0x1ff7('0x2')](_0x1ff7('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 fb16323..8a41e03 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x29a487,_0x2ef985){var _0x53d47d=function(_0x54f5c9){while(--_0x54f5c9){_0x29a487['push'](_0x29a487['shift']());}};_0x53d47d(++_0x2ef985);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x53edf4,_0x294c57){var _0x1ed494=function(_0x487685){while(--_0x487685){_0x53edf4['push'](_0x53edf4['shift']());}};_0x1ed494(++_0x294c57);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 29cd06a..5a60d8d 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 _0xf44a=['rimraf','../../config/environment','./chatOfflineMessage.attributes','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf44a,0x1bc));var _0xaf44=function(_0x53fe90,_0x443585){_0x53fe90=_0x53fe90-0x0;var _0x15ab23=_0xf44a[_0x53fe90];return _0x15ab23;};'use strict';var _=require(_0xaf44('0x0'));var util=require('util');var logger=require(_0xaf44('0x1'))(_0xaf44('0x2'));var moment=require(_0xaf44('0x3'));var BPromise=require(_0xaf44('0x4'));var rp=require(_0xaf44('0x5'));var fs=require('fs');var path=require(_0xaf44('0x6'));var rimraf=require(_0xaf44('0x7'));var config=require(_0xaf44('0x8'));var attributes=require(_0xaf44('0x9'));module['exports']=function(_0x3d81e3,_0x2b0485){return _0x3d81e3['define']('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xaf44('0xa')});}; \ No newline at end of file +var _0x4a10=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4a4328,_0xa97f3){var _0x36ec8e=function(_0x6e94ee){while(--_0x6e94ee){_0x4a4328['push'](_0x4a4328['shift']());}};_0x36ec8e(++_0xa97f3);}(_0x4a10,0xb7));var _0x04a1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a10[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x04a1('0x0'));var util=require('util');var logger=require(_0x04a1('0x1'))(_0x04a1('0x2'));var moment=require('moment');var BPromise=require(_0x04a1('0x3'));var rp=require(_0x04a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x04a1('0x5'));var config=require('../../config/environment');var attributes=require(_0x04a1('0x6'));module[_0x04a1('0x7')]=function(_0x4c1bb9,_0x39cc7c){return _0x4c1bb9[_0x04a1('0x8')](_0x04a1('0x9'),attributes,{'tableName':_0x04a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x04a1('0xb'),'collate':_0x04a1('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 60af5ab..3a51f9e 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 _0x08e0=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x08e0,0x19d));var _0x008e=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x08e0[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var moment=require(_0x008e('0x2'));var BPromise=require(_0x008e('0x3'));var rs=require(_0x008e('0x4'));var fs=require('fs');var Redis=require(_0x008e('0x5'));var db=require(_0x008e('0x6'))['db'];var utils=require(_0x008e('0x7'));var logger=require(_0x008e('0x8'))('rpc');var config=require(_0x008e('0x9'));var jayson=require(_0x008e('0xa'));var client=jayson[_0x008e('0xb')][_0x008e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f6089,_0x11fa73,_0x55ded4){return new BPromise(function(_0x5e0f1b,_0x22a444){return client[_0x008e('0xd')](_0x2f6089,_0x55ded4)['then'](function(_0x4117af){logger[_0x008e('0xe')](_0x008e('0xf'),_0x11fa73,_0x008e('0x10'));logger[_0x008e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11fa73,_0x008e('0x10'),JSON[_0x008e('0x12')](_0x4117af));if(_0x4117af[_0x008e('0x13')]){if(_0x4117af['error'][_0x008e('0x14')]===0x1f4){logger[_0x008e('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x11fa73,_0x4117af[_0x008e('0x13')][_0x008e('0x15')]);return _0x22a444(_0x4117af[_0x008e('0x13')]['message']);}logger[_0x008e('0x13')](_0x008e('0xf'),_0x11fa73,_0x4117af[_0x008e('0x13')][_0x008e('0x15')]);return _0x5e0f1b(_0x4117af['error'][_0x008e('0x15')]);}else{logger[_0x008e('0xe')](_0x008e('0xf'),_0x11fa73,'request\x20sent');_0x5e0f1b(_0x4117af[_0x008e('0x16')]['message']);}})[_0x008e('0x17')](function(_0x39d043){logger[_0x008e('0x13')](_0x008e('0xf'),_0x11fa73,_0x39d043);_0x22a444(_0x39d043);});});} \ No newline at end of file +var _0x46fc=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x46fc,0x103));var _0xc46f=function(_0x3aa1f0,_0x3ee7c9){_0x3aa1f0=_0x3aa1f0-0x0;var _0x520581=_0x46fc[_0x3aa1f0];return _0x520581;};'use strict';var _=require(_0xc46f('0x0'));var util=require(_0xc46f('0x1'));var moment=require(_0xc46f('0x2'));var BPromise=require(_0xc46f('0x3'));var rs=require(_0xc46f('0x4'));var fs=require('fs');var Redis=require(_0xc46f('0x5'));var db=require(_0xc46f('0x6'))['db'];var utils=require(_0xc46f('0x7'));var logger=require(_0xc46f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc46f('0x9'));var client=jayson[_0xc46f('0xa')][_0xc46f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15904c,_0x1f5ac8,_0x312101){return new BPromise(function(_0x155a10,_0x327019){return client[_0xc46f('0xc')](_0x15904c,_0x312101)[_0xc46f('0xd')](function(_0x1bd18f){logger[_0xc46f('0xe')](_0xc46f('0xf'),_0x1f5ac8,_0xc46f('0x10'));logger['debug'](_0xc46f('0x11'),_0x1f5ac8,_0xc46f('0x10'),JSON[_0xc46f('0x12')](_0x1bd18f));if(_0x1bd18f[_0xc46f('0x13')]){if(_0x1bd18f['error']['code']===0x1f4){logger['error'](_0xc46f('0xf'),_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')]['message']);return _0x327019(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1f5ac8,_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);return _0x155a10(_0x1bd18f[_0xc46f('0x13')][_0xc46f('0x14')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x1f5ac8,'request\x20sent');_0x155a10(_0x1bd18f[_0xc46f('0x15')][_0xc46f('0x14')]);}})[_0xc46f('0x16')](function(_0x516238){logger[_0xc46f('0x13')](_0xc46f('0xf'),_0x1f5ac8,_0x516238);_0x327019(_0x516238);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index f52ed81..a162f92 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 _0x6f9e=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x114087,_0x815eb5){var _0x1f9db6=function(_0x2fce94){while(--_0x2fce94){_0x114087['push'](_0x114087['shift']());}};_0x1f9db6(++_0x815eb5);}(_0x6f9e,0x199));var _0xe6f9=function(_0x325f51,_0x4cbcdb){_0x325f51=_0x325f51-0x0;var _0x294922=_0x6f9e[_0x325f51];return _0x294922;};'use strict';var multer=require('multer');var util=require(_0xe6f9('0x0'));var path=require(_0xe6f9('0x1'));var timeout=require(_0xe6f9('0x2'));var express=require('express');var router=express[_0xe6f9('0x3')]();var fs_extra=require(_0xe6f9('0x4'));var auth=require(_0xe6f9('0x5'));var interaction=require(_0xe6f9('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xe6f9('0x7')]('/',auth[_0xe6f9('0x8')](),controller[_0xe6f9('0x9')]);router[_0xe6f9('0x7')](_0xe6f9('0xa'),auth[_0xe6f9('0x8')](),controller['describe']);router[_0xe6f9('0x7')](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xc')]);router[_0xe6f9('0xd')]('/',auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xe')]);router['put'](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller[_0xe6f9('0xf')]);router[_0xe6f9('0x10')](_0xe6f9('0xb'),auth[_0xe6f9('0x8')](),controller['destroy']);module[_0xe6f9('0x11')]=router; \ No newline at end of file +var _0xc1e2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x1b3d16,_0x298459){var _0x4ab7c5=function(_0x39e9a1){while(--_0x39e9a1){_0x1b3d16['push'](_0x1b3d16['shift']());}};_0x4ab7c5(++_0x298459);}(_0xc1e2,0x14b));var _0x2c1e=function(_0x595929,_0x41cd4c){_0x595929=_0x595929-0x0;var _0x99f274=_0xc1e2[_0x595929];return _0x99f274;};'use strict';var multer=require(_0x2c1e('0x0'));var util=require(_0x2c1e('0x1'));var path=require(_0x2c1e('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c1e('0x3'));var router=express[_0x2c1e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2c1e('0x5'));var interaction=require(_0x2c1e('0x6'));var config=require(_0x2c1e('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x2c1e('0x8')]('/',auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xa')]);router[_0x2c1e('0x8')](_0x2c1e('0xb'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xc')]);router[_0x2c1e('0x8')](_0x2c1e('0xd'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0xe')]);router[_0x2c1e('0xf')]('/',auth['isAuthenticated'](),controller[_0x2c1e('0x10')]);router[_0x2c1e('0x11')](_0x2c1e('0xd'),auth[_0x2c1e('0x9')](),controller[_0x2c1e('0x12')]);router[_0x2c1e('0x13')]('/:id',auth[_0x2c1e('0x9')](),controller['destroy']);module[_0x2c1e('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1236709..394cf4c 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 _0x1a33=['mouseOver','sequelize','exports','STRING','ENUM'];(function(_0x2f2fb7,_0x25e15d){var _0x2a8295=function(_0x483fd3){while(--_0x483fd3){_0x2f2fb7['push'](_0x2f2fb7['shift']());}};_0x2a8295(++_0x25e15d);}(_0x1a33,0x83));var _0x31a3=function(_0x47e02d,_0x4e667a){_0x47e02d=_0x47e02d-0x0;var _0x95923c=_0x1a33[_0x47e02d];return _0x95923c;};'use strict';var Sequelize=require(_0x31a3('0x0'));module[_0x31a3('0x1')]={'name':{'type':Sequelize[_0x31a3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x31a3('0x3')](_0x31a3('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x31a3('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb6b4=['sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x445a8a,_0x924d3f){var _0x49ac3f=function(_0x47cf35){while(--_0x47cf35){_0x445a8a['push'](_0x445a8a['shift']());}};_0x49ac3f(++_0x924d3f);}(_0xb6b4,0xf6));var _0x4b6b=function(_0x294098,_0x39327e){_0x294098=_0x294098-0x0;var _0x1221b3=_0xb6b4[_0x294098];return _0x1221b3;};'use strict';var Sequelize=require(_0x4b6b('0x0'));module[_0x4b6b('0x1')]={'name':{'type':Sequelize[_0x4b6b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4b6b('0x3')]('mouseOver',_0x4b6b('0x4')),'defaultValue':_0x4b6b('0x5')},'selector':{'type':Sequelize['STRING']},'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 7105f69..04ba06c 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 _0x24ca=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','show','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24ca,0x1bc));var _0xa24c=function(_0x58999b,_0xea4695){_0x58999b=_0x58999b-0x0;var _0x5efc3a=_0x24ca[_0x58999b];return _0x5efc3a;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={'raw':!![],'where':{'id':_0x28675f[_0xa24c('0x2e')]['id']}},_0x5e491e={};_0x5e491e[_0xa24c('0x2f')]=_[_0xa24c('0x30')](db['ChatProactiveAction'][_0xa24c('0x31')]);_0x5e491e[_0xa24c('0x32')]=_[_0xa24c('0x30')](_0x28675f['query']);_0x5e491e[_0xa24c('0x33')]=_['intersection'](_0x5e491e[_0xa24c('0x2f')],_0x5e491e[_0xa24c('0x32')]);_0x12dbdc[_0xa24c('0x34')]=_['intersection'](_0x5e491e[_0xa24c('0x2f')],qs[_0xa24c('0x35')](_0x28675f[_0xa24c('0x32')]['fields']));_0x12dbdc[_0xa24c('0x34')]=_0x12dbdc['attributes'][_0xa24c('0x36')]?_0x12dbdc[_0xa24c('0x34')]:_0x5e491e['model'];if(_0x28675f['query'][_0xa24c('0x37')]){_0x12dbdc[_0xa24c('0x38')]=[{'all':!![]}];}_0x12dbdc=_[_0xa24c('0x39')]({},_0x12dbdc,_0x28675f[_0xa24c('0x3a')]);return db[_0xa24c('0x3b')][_0xa24c('0x3c')](_0x12dbdc)[_0xa24c('0x27')](handleEntityNotFound(_0x152120,null))['then'](respondWithResult(_0x152120,null))[_0xa24c('0x3d')](handleError(_0x152120,null));};exports[_0xa24c('0x3e')]=function(_0x12825d,_0xbd24c0){return db[_0xa24c('0x3b')][_0xa24c('0x3e')](_0x12825d[_0xa24c('0x3f')],{})[_0xa24c('0x27')](respondWithResult(_0xbd24c0,0xc9))[_0xa24c('0x3d')](handleError(_0xbd24c0,null));};exports[_0xa24c('0x26')]=function(_0x4c7a30,_0x70a957){if(_0x4c7a30[_0xa24c('0x3f')]['id']){delete _0x4c7a30[_0xa24c('0x3f')]['id'];}return db[_0xa24c('0x3b')]['find']({'where':{'id':_0x4c7a30['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x70a957,null))['then'](saveUpdates(_0x4c7a30[_0xa24c('0x3f')],null))[_0xa24c('0x27')](respondWithResult(_0x70a957,null))[_0xa24c('0x3d')](handleError(_0x70a957,null));};exports[_0xa24c('0x28')]=function(_0x29ca48,_0x4c0fb9){return db['ChatProactiveAction'][_0xa24c('0x3c')]({'where':{'id':_0x29ca48[_0xa24c('0x2e')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x4c0fb9,null))[_0xa24c('0x27')](removeEntity(_0x4c0fb9,null))[_0xa24c('0x3d')](handleError(_0x4c0fb9,null));}; \ No newline at end of file +var _0xdb4b=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4f47d0,_0x1aede4){var _0x32c279=function(_0x4be892){while(--_0x4be892){_0x4f47d0['push'](_0x4f47d0['shift']());}};_0x32c279(++_0x1aede4);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x26793a,_0x49cf51){_0x26793a=_0x26793a-0x0;var _0x575efb=_0xdb4b[_0x26793a];return _0x575efb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdb4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdb4('0x1'));var rp=require(_0xbdb4('0x2'));var moment=require(_0xbdb4('0x3'));var BPromise=require(_0xbdb4('0x4'));var Mustache=require('mustache');var util=require(_0xbdb4('0x5'));var path=require(_0xbdb4('0x6'));var sox=require(_0xbdb4('0x7'));var csv=require(_0xbdb4('0x8'));var ejs=require(_0xbdb4('0x9'));var fs=require('fs');var fs_extra=require(_0xbdb4('0xa'));var _=require(_0xbdb4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbdb4('0xc'));var deskjs=require(_0xbdb4('0xd'));var toCsv=require(_0xbdb4('0x8'));var querystring=require(_0xbdb4('0xe'));var Papa=require('papaparse');var Redis=require(_0xbdb4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbdb4('0x10'));var as=require(_0xbdb4('0x11'));var hardwareService=require(_0xbdb4('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbdb4('0x13'));var config=require(_0xbdb4('0x14'));var licenseUtil=require(_0xbdb4('0x15'));var db=require(_0xbdb4('0x16'))['db'];function respondWithStatusCode(_0x5f1825,_0x4fadb2){_0x4fadb2=_0x4fadb2||0xcc;return function(_0xd2eaa5){if(_0xd2eaa5){return _0x5f1825[_0xbdb4('0x17')](_0x4fadb2);}return _0x5f1825[_0xbdb4('0x18')](_0x4fadb2)[_0xbdb4('0x19')]();};}function respondWithResult(_0x3e0801,_0x310780){_0x310780=_0x310780||0xc8;return function(_0x4a2ae3){if(_0x4a2ae3){return _0x3e0801['status'](_0x310780)[_0xbdb4('0x1a')](_0x4a2ae3);}};}function respondWithFilteredResult(_0x4386e1,_0x5d84f6){return function(_0x446124){if(_0x446124){var _0x19a69b=typeof _0x5d84f6['offset']==='undefined'&&typeof _0x5d84f6[_0xbdb4('0x1b')]===_0xbdb4('0x1c');var _0x52c7ca=_0x446124[_0xbdb4('0x1d')];var _0x113471=_0x19a69b?0x0:_0x5d84f6['offset'];var _0x2ca1d5=_0x19a69b?_0x446124[_0xbdb4('0x1d')]:_0x5d84f6[_0xbdb4('0x1e')]+_0x5d84f6['limit'];var _0x50d0af;if(_0x2ca1d5>=_0x52c7ca){_0x2ca1d5=_0x52c7ca;_0x50d0af=0xc8;}else{_0x50d0af=0xce;}_0x4386e1[_0xbdb4('0x18')](_0x50d0af);return _0x4386e1[_0xbdb4('0x1f')]('Content-Range',_0x113471+'-'+_0x2ca1d5+'/'+_0x52c7ca)[_0xbdb4('0x1a')](_0x446124);}return null;};}function patchUpdates(_0x2d72d9){return function(_0x21b32d){try{jsonpatch['apply'](_0x21b32d,_0x2d72d9,!![]);}catch(_0x1bbabc){return BPromise['reject'](_0x1bbabc);}return _0x21b32d[_0xbdb4('0x20')]();};}function saveUpdates(_0x182758,_0x40efbe){return function(_0x2320e9){if(_0x2320e9){return _0x2320e9[_0xbdb4('0x21')](_0x182758)[_0xbdb4('0x22')](function(_0x5780ba){return _0x5780ba;});}return null;};}function removeEntity(_0x3db8aa,_0x18b284){return function(_0x2ea4f4){if(_0x2ea4f4){return _0x2ea4f4[_0xbdb4('0x23')]()[_0xbdb4('0x22')](function(){_0x3db8aa['status'](0xcc)[_0xbdb4('0x19')]();});}};}function handleEntityNotFound(_0x18a6f6,_0x3d440a){return function(_0x5b46a1){if(!_0x5b46a1){_0x18a6f6['sendStatus'](0x194);}return _0x5b46a1;};}function handleError(_0x1ab9b1,_0x22ba6c){_0x22ba6c=_0x22ba6c||0x1f4;return function(_0x3b3e0b){logger[_0xbdb4('0x24')](_0x3b3e0b[_0xbdb4('0x25')]);if(_0x3b3e0b[_0xbdb4('0x26')]){delete _0x3b3e0b[_0xbdb4('0x26')];}_0x1ab9b1[_0xbdb4('0x18')](_0x22ba6c)[_0xbdb4('0x27')](_0x3b3e0b);};}exports[_0xbdb4('0x28')]=function(_0x52ebf5,_0x81ec7d){var _0x11a783={'raw':!![],'where':{'id':_0x52ebf5[_0xbdb4('0x29')]['id']}},_0x1246a7={};_0x1246a7[_0xbdb4('0x2a')]=_['keys'](db[_0xbdb4('0x2b')][_0xbdb4('0x2c')]);_0x1246a7[_0xbdb4('0x2d')]=_[_0xbdb4('0x2e')](_0x52ebf5[_0xbdb4('0x2d')]);_0x1246a7[_0xbdb4('0x2f')]=_[_0xbdb4('0x30')](_0x1246a7[_0xbdb4('0x2a')],_0x1246a7['query']);_0x11a783[_0xbdb4('0x31')]=_[_0xbdb4('0x30')](_0x1246a7['model'],qs['fields'](_0x52ebf5[_0xbdb4('0x2d')]['fields']));_0x11a783[_0xbdb4('0x31')]=_0x11a783[_0xbdb4('0x31')][_0xbdb4('0x32')]?_0x11a783[_0xbdb4('0x31')]:_0x1246a7['model'];if(_0x52ebf5[_0xbdb4('0x2d')][_0xbdb4('0x33')]){_0x11a783[_0xbdb4('0x34')]=[{'all':!![]}];}_0x11a783=_[_0xbdb4('0x35')]({},_0x11a783,_0x52ebf5[_0xbdb4('0x36')]);return db[_0xbdb4('0x2b')][_0xbdb4('0x37')](_0x11a783)[_0xbdb4('0x22')](handleEntityNotFound(_0x81ec7d,null))[_0xbdb4('0x22')](respondWithResult(_0x81ec7d,null))[_0xbdb4('0x38')](handleError(_0x81ec7d,null));};exports[_0xbdb4('0x39')]=function(_0x134401,_0x4e15e1){return db[_0xbdb4('0x2b')][_0xbdb4('0x39')](_0x134401[_0xbdb4('0x3a')],{})[_0xbdb4('0x22')](respondWithResult(_0x4e15e1,0xc9))['catch'](handleError(_0x4e15e1,null));};exports[_0xbdb4('0x21')]=function(_0xe25e14,_0x410f96){if(_0xe25e14[_0xbdb4('0x3a')]['id']){delete _0xe25e14[_0xbdb4('0x3a')]['id'];}return db[_0xbdb4('0x2b')][_0xbdb4('0x37')]({'where':{'id':_0xe25e14[_0xbdb4('0x29')]['id']}})[_0xbdb4('0x22')](handleEntityNotFound(_0x410f96,null))[_0xbdb4('0x22')](saveUpdates(_0xe25e14['body'],null))[_0xbdb4('0x22')](respondWithResult(_0x410f96,null))[_0xbdb4('0x38')](handleError(_0x410f96,null));};exports[_0xbdb4('0x23')]=function(_0x49c5db,_0x45952f){return db[_0xbdb4('0x2b')][_0xbdb4('0x37')]({'where':{'id':_0x49c5db[_0xbdb4('0x29')]['id']}})['then'](handleEntityNotFound(_0x45952f,null))[_0xbdb4('0x22')](removeEntity(_0x45952f,null))['catch'](handleError(_0x45952f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0df24d2..b4857c1 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 _0x71dd=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','util'];(function(_0x3b3cb7,_0x49c02d){var _0x3cbdaf=function(_0x4ecba9){while(--_0x4ecba9){_0x3b3cb7['push'](_0x3b3cb7['shift']());}};_0x3cbdaf(++_0x49c02d);}(_0x71dd,0xef));var _0xd71d=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0x71dd[_0x5eca50];return _0x41fb84;};'use strict';var _=require('lodash');var util=require(_0xd71d('0x0'));var logger=require(_0xd71d('0x1'))(_0xd71d('0x2'));var moment=require('moment');var BPromise=require(_0xd71d('0x3'));var rp=require(_0xd71d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd71d('0x5'));var config=require(_0xd71d('0x6'));var attributes=require(_0xd71d('0x7'));module['exports']=function(_0x86a7fc,_0x68f5fa){return _0x86a7fc[_0xd71d('0x8')](_0xd71d('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ac1=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x5ac1,0x1ed));var _0x15ac=function(_0x3efd79,_0x1113de){_0x3efd79=_0x3efd79-0x0;var _0x1e024b=_0x5ac1[_0x3efd79];return _0x1e024b;};'use strict';var _=require(_0x15ac('0x0'));var util=require(_0x15ac('0x1'));var logger=require(_0x15ac('0x2'))(_0x15ac('0x3'));var moment=require(_0x15ac('0x4'));var BPromise=require(_0x15ac('0x5'));var rp=require(_0x15ac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15ac('0x7'));var config=require('../../config/environment');var attributes=require(_0x15ac('0x8'));module['exports']=function(_0x4ebe41,_0x2618cc){return _0x4ebe41[_0x15ac('0x9')](_0x15ac('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 24d129a..044b313 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 _0x2575=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5982f1,_0x3f5689){var _0x3a1836=function(_0x5a4f85){while(--_0x5a4f85){_0x5982f1['push'](_0x5982f1['shift']());}};_0x3a1836(++_0x3f5689);}(_0x2575,0x1b2));var _0x5257=function(_0xcb5358,_0x46e4ee){_0xcb5358=_0xcb5358-0x0;var _0x2d70f5=_0x2575[_0xcb5358];return _0x2d70f5;};'use strict';var _=require('lodash');var util=require(_0x5257('0x0'));var moment=require(_0x5257('0x1'));var BPromise=require(_0x5257('0x2'));var rs=require(_0x5257('0x3'));var fs=require('fs');var Redis=require(_0x5257('0x4'));var db=require(_0x5257('0x5'))['db'];var utils=require(_0x5257('0x6'));var logger=require(_0x5257('0x7'))('rpc');var config=require(_0x5257('0x8'));var jayson=require(_0x5257('0x9'));var client=jayson['client'][_0x5257('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4001e6,_0x57da79,_0x450a32){return new BPromise(function(_0x408e05,_0x29713d){return client[_0x5257('0xb')](_0x4001e6,_0x450a32)[_0x5257('0xc')](function(_0x724f1b){logger[_0x5257('0xd')](_0x5257('0xe'),_0x57da79,'request\x20sent');logger[_0x5257('0xf')](_0x5257('0x10'),_0x57da79,_0x5257('0x11'),JSON['stringify'](_0x724f1b));if(_0x724f1b[_0x5257('0x12')]){if(_0x724f1b[_0x5257('0x12')]['code']===0x1f4){logger['error'](_0x5257('0xe'),_0x57da79,_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);return _0x29713d(_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);}logger['error'](_0x5257('0xe'),_0x57da79,_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);return _0x408e05(_0x724f1b[_0x5257('0x12')][_0x5257('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x57da79,_0x5257('0x11'));_0x408e05(_0x724f1b['result']['message']);}})[_0x5257('0x14')](function(_0x5b3cf7){logger[_0x5257('0x12')](_0x5257('0xe'),_0x57da79,_0x5b3cf7);_0x29713d(_0x5b3cf7);});});} \ No newline at end of file +var _0xb103=['client','http','request','info','request\x20sent','debug','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37578d,_0x5dc0ee){var _0x481453=function(_0x1c34ab){while(--_0x1c34ab){_0x37578d['push'](_0x37578d['shift']());}};_0x481453(++_0x5dc0ee);}(_0xb103,0xa6));var _0x3b10=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xb103[_0x255ac0];return _0x437bf1;};'use strict';var _=require(_0x3b10('0x0'));var util=require(_0x3b10('0x1'));var moment=require(_0x3b10('0x2'));var BPromise=require(_0x3b10('0x3'));var rs=require(_0x3b10('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b10('0x5'))['db'];var utils=require(_0x3b10('0x6'));var logger=require(_0x3b10('0x7'))(_0x3b10('0x8'));var config=require(_0x3b10('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b10('0xa')][_0x3b10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294c33,_0x29fe7d,_0x2bcd76){return new BPromise(function(_0x5b2ebe,_0x2aff0a){return client[_0x3b10('0xc')](_0x294c33,_0x2bcd76)['then'](function(_0x2445bc){logger[_0x3b10('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x3b10('0xe'));logger[_0x3b10('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x29fe7d,_0x3b10('0xe'),JSON[_0x3b10('0x10')](_0x2445bc));if(_0x2445bc[_0x3b10('0x11')]){if(_0x2445bc[_0x3b10('0x11')]['code']===0x1f4){logger[_0x3b10('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x2445bc[_0x3b10('0x11')]['message']);return _0x2aff0a(_0x2445bc[_0x3b10('0x11')][_0x3b10('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x29fe7d,_0x2445bc['error'][_0x3b10('0x12')]);return _0x5b2ebe(_0x2445bc['error'][_0x3b10('0x12')]);}else{logger[_0x3b10('0xd')](_0x3b10('0x13'),_0x29fe7d,_0x3b10('0xe'));_0x5b2ebe(_0x2445bc[_0x3b10('0x14')]['message']);}})[_0x3b10('0x15')](function(_0x4e0640){logger[_0x3b10('0x11')](_0x3b10('0x13'),_0x29fe7d,_0x4e0640);_0x2aff0a(_0x4e0640);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 33abd10..7d54896 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 _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4b016b,_0x51dc70){_0x4b016b=_0x4b016b-0x0;var _0x954c64=_0xb4c7[_0x4b016b];return _0x954c64;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router; \ No newline at end of file +var _0x2eb2=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2eb2,0x19f));var _0x22eb=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x2eb2[_0x34021d];return _0x16597b;};'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 fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./chatProactiveAction.controller');router[_0x22eb('0x7')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xa')]);router[_0x22eb('0xb')]('/',auth[_0x22eb('0x9')](),controller[_0x22eb('0xc')]);router[_0x22eb('0xd')](_0x22eb('0x8'),auth[_0x22eb('0x9')](),controller[_0x22eb('0xe')]);router[_0x22eb('0xf')]('/:id',auth[_0x22eb('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f8aaf7c..5d3d457 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 _0xa86e=['sequelize','exports','STRING','ENUM','beepall','roundrobin'];(function(_0x13bb67,_0x6b0251){var _0xda7c4e=function(_0x3bc1b5){while(--_0x3bc1b5){_0x13bb67['push'](_0x13bb67['shift']());}};_0xda7c4e(++_0x6b0251);}(_0xa86e,0xd8));var _0xea86=function(_0x22e176,_0x55b58b){_0x22e176=_0x22e176-0x0;var _0x3f1695=_0xa86e[_0x22e176];return _0x3f1695;};'use strict';var Sequelize=require(_0xea86('0x0'));module[_0xea86('0x1')]={'name':{'type':Sequelize[_0xea86('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea86('0x3')]('rrmemory',_0xea86('0x4'),_0xea86('0x5'))}}; \ No newline at end of file +var _0xfc47=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc47,0x136));var _0x7fc4=function(_0x4e0ab8,_0x401afb){_0x4e0ab8=_0x4e0ab8-0x0;var _0x4c1f40=_0xfc47[_0x4e0ab8];return _0x4c1f40;};'use strict';var Sequelize=require(_0x7fc4('0x0'));module[_0x7fc4('0x1')]={'name':{'type':Sequelize[_0x7fc4('0x2')],'unique':_0x7fc4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7fc4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fc4('0x5')](_0x7fc4('0x6'),_0x7fc4('0x7'),_0x7fc4('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index ab7b68e..1d2b90c 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 _0xd3d2=['result','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','hasOwnProperty','order','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','getTeams','Team','ids','Agents','online','voicePause','interface','sequelize','addTeams','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','includes','value','transaction','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x28ef58,_0x453a5d){var _0x496d4c=function(_0xf0e0e9){while(--_0xf0e0e9){_0x28ef58['push'](_0x28ef58['shift']());}};_0x496d4c(++_0x453a5d);}(_0xd3d2,0x102));var _0x2d3d=function(_0x460188,_0x1c9626){_0x460188=_0x460188-0x0;var _0x557573=_0xd3d2[_0x460188];return _0x557573;};'use strict';var emlformat=require(_0x2d3d('0x0'));var rimraf=require(_0x2d3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d3d('0x2'));var rp=require(_0x2d3d('0x3'));var moment=require(_0x2d3d('0x4'));var BPromise=require(_0x2d3d('0x5'));var Mustache=require(_0x2d3d('0x6'));var util=require(_0x2d3d('0x7'));var path=require(_0x2d3d('0x8'));var sox=require(_0x2d3d('0x9'));var csv=require(_0x2d3d('0xa'));var ejs=require(_0x2d3d('0xb'));var fs=require('fs');var fs_extra=require(_0x2d3d('0xc'));var _=require(_0x2d3d('0xd'));var squel=require(_0x2d3d('0xe'));var crypto=require(_0x2d3d('0xf'));var jsforce=require(_0x2d3d('0x10'));var deskjs=require(_0x2d3d('0x11'));var toCsv=require(_0x2d3d('0xa'));var querystring=require(_0x2d3d('0x12'));var Papa=require(_0x2d3d('0x13'));var Redis=require(_0x2d3d('0x14'));var authService=require(_0x2d3d('0x15'));var qs=require(_0x2d3d('0x16'));var as=require(_0x2d3d('0x17'));var hardwareService=require(_0x2d3d('0x18'));var logger=require('../../config/logger')(_0x2d3d('0x19'));var utils=require(_0x2d3d('0x1a'));var config=require(_0x2d3d('0x1b'));var licenseUtil=require(_0x2d3d('0x1c'));var db=require(_0x2d3d('0x1d'))['db'];config['redis']=_['defaults'](config[_0x2d3d('0x1e')],{'host':_0x2d3d('0x1f'),'port':0x18eb});var socket=require(_0x2d3d('0x20'))(new Redis(config[_0x2d3d('0x1e')]));require(_0x2d3d('0x21'))[_0x2d3d('0x22')](socket);var jayson=require(_0x2d3d('0x23'));var client=jayson['client'][_0x2d3d('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x35150d,_0x2bda9e,_0x134167,_0x3cec33){return new BPromise(function(_0x23fe50,_0xb0bdfb){var _0x3183ec=_0x3cec33||client;return _0x3183ec[_0x2d3d('0x25')](_0x35150d,_0x134167)[_0x2d3d('0x26')](function(_0x5a4412){logger[_0x2d3d('0x27')](_0x2d3d('0x28'),_0x2bda9e,_0x2d3d('0x29'));logger[_0x2d3d('0x2a')](_0x2d3d('0x2b'),_0x2bda9e,_0x2d3d('0x29'),JSON[_0x2d3d('0x2c')](_0x5a4412));if(_0x5a4412[_0x2d3d('0x2d')]){if(_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2e')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x2bda9e,_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2f')]);return _0xb0bdfb(_0x5a4412['error']['message']);}logger[_0x2d3d('0x2d')](_0x2d3d('0x28'),_0x2bda9e,_0x5a4412[_0x2d3d('0x2d')][_0x2d3d('0x2f')]);return _0x23fe50(_0x5a4412[_0x2d3d('0x2d')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2bda9e,_0x2d3d('0x29'));_0x23fe50(_0x5a4412[_0x2d3d('0x30')][_0x2d3d('0x2f')]);}})['catch'](function(_0x45672d){logger[_0x2d3d('0x2d')](_0x2d3d('0x28'),_0x2bda9e,_0x45672d);_0xb0bdfb(_0x45672d);});});}function respondWithStatusCode(_0x4b69bb,_0x435971){_0x435971=_0x435971||0xcc;return function(_0x2033e5){if(_0x2033e5){return _0x4b69bb[_0x2d3d('0x31')](_0x435971);}return _0x4b69bb[_0x2d3d('0x32')](_0x435971)['end']();};}function respondWithResult(_0x5993e3,_0x51ff1b){_0x51ff1b=_0x51ff1b||0xc8;return function(_0x56568d){if(_0x56568d){return _0x5993e3[_0x2d3d('0x32')](_0x51ff1b)['json'](_0x56568d);}};}function respondWithFilteredResult(_0x528259,_0x14dd29){return function(_0x3a9803){if(_0x3a9803){var _0x1000f1=typeof _0x14dd29[_0x2d3d('0x33')]==='undefined'&&typeof _0x14dd29[_0x2d3d('0x34')]===_0x2d3d('0x35');var _0x432673=_0x3a9803['count'];var _0x534089=_0x1000f1?0x0:_0x14dd29[_0x2d3d('0x33')];var _0x2ac503=_0x1000f1?_0x3a9803[_0x2d3d('0x36')]:_0x14dd29[_0x2d3d('0x33')]+_0x14dd29[_0x2d3d('0x34')];var _0x11c255;if(_0x2ac503>=_0x432673){_0x2ac503=_0x432673;_0x11c255=0xc8;}else{_0x11c255=0xce;}_0x528259['status'](_0x11c255);return _0x528259[_0x2d3d('0x37')](_0x2d3d('0x38'),_0x534089+'-'+_0x2ac503+'/'+_0x432673)['json'](_0x3a9803);}return null;};}function patchUpdates(_0x3cd5a7){return function(_0x2e8ff5){try{jsonpatch[_0x2d3d('0x39')](_0x2e8ff5,_0x3cd5a7,!![]);}catch(_0x725734){return BPromise['reject'](_0x725734);}return _0x2e8ff5[_0x2d3d('0x3a')]();};}function saveUpdates(_0x5436ce,_0x51c5ce){return function(_0x241a23){if(_0x241a23){return _0x241a23[_0x2d3d('0x3b')](_0x5436ce)[_0x2d3d('0x26')](function(_0x5b0373){return _0x5b0373;});}return null;};}function removeEntity(_0x3a8aef,_0x1dfe86){return function(_0x25e58a){if(_0x25e58a){return _0x25e58a[_0x2d3d('0x3c')]()[_0x2d3d('0x26')](function(){var _0xd7880a=_0x25e58a[_0x2d3d('0x3d')]({'plain':!![]});var _0x34751b=_0x2d3d('0x3e');return db[_0x2d3d('0x3f')][_0x2d3d('0x3c')]({'where':{'type':_0x34751b,'resourceId':_0xd7880a['id']}})[_0x2d3d('0x26')](function(){return _0x25e58a;});})['then'](function(){_0x3a8aef['status'](0xcc)[_0x2d3d('0x40')]();});}};}function handleEntityNotFound(_0xd93877,_0x22e054){return function(_0x5bd0c2){if(!_0x5bd0c2){_0xd93877[_0x2d3d('0x31')](0x194);}return _0x5bd0c2;};}function handleError(_0x2ceb07,_0xf36b20){_0xf36b20=_0xf36b20||0x1f4;return function(_0x271fbf){logger[_0x2d3d('0x2d')](_0x271fbf[_0x2d3d('0x41')]);if(_0x271fbf[_0x2d3d('0x42')]){delete _0x271fbf[_0x2d3d('0x42')];}_0x2ceb07[_0x2d3d('0x32')](_0xf36b20)[_0x2d3d('0x43')](_0x271fbf);};}exports[_0x2d3d('0x44')]=function(_0x3b4212,_0x33ab84){var _0x1bc897={},_0x53d4bd={},_0xd258e2={'count':0x0,'rows':[]};var _0xbe3d75=_[_0x2d3d('0x45')](db[_0x2d3d('0x46')][_0x2d3d('0x47')],function(_0x4d367f){return{'name':_0x4d367f[_0x2d3d('0x48')],'type':_0x4d367f[_0x2d3d('0x49')]['key']};});_0x53d4bd[_0x2d3d('0x4a')]=_['map'](_0xbe3d75,_0x2d3d('0x42'));_0x53d4bd['query']=_[_0x2d3d('0x4b')](_0x3b4212[_0x2d3d('0x4c')]);_0x53d4bd[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x53d4bd[_0x2d3d('0x4a')],_0x53d4bd[_0x2d3d('0x4c')]);_0x1bc897[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x53d4bd['model'],qs[_0x2d3d('0x50')](_0x3b4212[_0x2d3d('0x4c')]['fields']));_0x1bc897[_0x2d3d('0x4f')]=_0x1bc897[_0x2d3d('0x4f')]['length']?_0x1bc897[_0x2d3d('0x4f')]:_0x53d4bd[_0x2d3d('0x4a')];if(!_0x3b4212['query']['hasOwnProperty'](_0x2d3d('0x51'))){_0x1bc897[_0x2d3d('0x34')]=qs[_0x2d3d('0x34')](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x34')]);_0x1bc897['offset']=qs['offset'](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}_0x1bc897['order']=qs[_0x2d3d('0x52')](_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x1bc897[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x3b4212[_0x2d3d('0x4c')],_0x53d4bd[_0x2d3d('0x4d')]),_0xbe3d75);if(_0x3b4212[_0x2d3d('0x4c')]['filter']){_0x1bc897[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0x1bc897[_0x2d3d('0x53')],{'$or':_[_0x2d3d('0x45')](_0xbe3d75,function(_0x5edc17){if(_0x5edc17[_0x2d3d('0x49')]!==_0x2d3d('0x56')){var _0x401587={};_0x401587[_0x5edc17[_0x2d3d('0x42')]]={'$like':'%'+_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x401587;}})});}_0x1bc897=_[_0x2d3d('0x55')]({},_0x1bc897,_0x3b4212['options']);var _0x446573={'where':_0x1bc897[_0x2d3d('0x53')]};return db[_0x2d3d('0x46')][_0x2d3d('0x36')](_0x446573)[_0x2d3d('0x26')](function(_0x5d6082){_0xd258e2[_0x2d3d('0x36')]=_0x5d6082;if(_0x3b4212[_0x2d3d('0x4c')][_0x2d3d('0x58')]){_0x1bc897['include']=[{'all':!![]}];}return db[_0x2d3d('0x46')][_0x2d3d('0x59')](_0x1bc897);})[_0x2d3d('0x26')](function(_0x1a6841){_0xd258e2[_0x2d3d('0x5a')]=_0x1a6841;return _0xd258e2;})[_0x2d3d('0x26')](respondWithFilteredResult(_0x33ab84,_0x1bc897))[_0x2d3d('0x5b')](handleError(_0x33ab84,null));};exports[_0x2d3d('0x5c')]=function(_0x164152,_0x250244){var _0x5d689d={'raw':!![],'where':{'id':_0x164152[_0x2d3d('0x5d')]['id']}},_0x7329bf={};_0x7329bf[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x46')][_0x2d3d('0x47')]);_0x7329bf['query']=_[_0x2d3d('0x4b')](_0x164152['query']);_0x7329bf[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x7329bf[_0x2d3d('0x4a')],_0x7329bf['query']);_0x5d689d['attributes']=_[_0x2d3d('0x4e')](_0x7329bf[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0x164152[_0x2d3d('0x4c')]['fields']));_0x5d689d[_0x2d3d('0x4f')]=_0x5d689d[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x5d689d[_0x2d3d('0x4f')]:_0x7329bf[_0x2d3d('0x4a')];if(_0x164152[_0x2d3d('0x4c')][_0x2d3d('0x58')]){_0x5d689d[_0x2d3d('0x5f')]=[{'all':!![]}];}_0x5d689d=_[_0x2d3d('0x55')]({},_0x5d689d,_0x164152[_0x2d3d('0x60')]);return db[_0x2d3d('0x46')][_0x2d3d('0x61')](_0x5d689d)[_0x2d3d('0x26')](handleEntityNotFound(_0x250244,null))[_0x2d3d('0x26')](respondWithResult(_0x250244,null))[_0x2d3d('0x5b')](handleError(_0x250244,null));};exports[_0x2d3d('0x62')]=function(_0x133fbd,_0x3be331){return db['ChatQueue']['create'](_0x133fbd[_0x2d3d('0x63')],{})['then'](function(_0x559f7c){var _0x5a85f2=_0x133fbd[_0x2d3d('0x64')][_0x2d3d('0x3d')]({'plain':!![]});if(!_0x5a85f2)throw new Error(_0x2d3d('0x65'));if(_0x5a85f2[_0x2d3d('0x66')]===_0x2d3d('0x64')){var _0x5d3ab2=_0x559f7c[_0x2d3d('0x3d')]({'plain':!![]});var _0x36fe03=_0x2d3d('0x3e');return db['UserProfileSection'][_0x2d3d('0x61')]({'where':{'name':_0x36fe03,'userProfileId':_0x5a85f2[_0x2d3d('0x67')]},'raw':!![]})[_0x2d3d('0x26')](function(_0x505713){if(_0x505713&&_0x505713[_0x2d3d('0x68')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d3ab2['name'],'resourceId':_0x5d3ab2['id'],'type':_0x505713[_0x2d3d('0x42')],'sectionId':_0x505713['id']},{})[_0x2d3d('0x26')](function(){return _0x559f7c;});}else{return _0x559f7c;}})[_0x2d3d('0x5b')](function(_0x452b7f){logger[_0x2d3d('0x2d')](_0x2d3d('0x69'),_0x452b7f);throw _0x452b7f;});}return _0x559f7c;})[_0x2d3d('0x26')](respondWithResult(_0x3be331,0xc9))[_0x2d3d('0x5b')](handleError(_0x3be331,null));};exports['update']=function(_0x52c294,_0x2bc6e4){if(_0x52c294[_0x2d3d('0x63')]['id']){delete _0x52c294[_0x2d3d('0x63')]['id'];}return db['ChatQueue'][_0x2d3d('0x61')]({'where':{'id':_0x52c294['params']['id']}})['then'](handleEntityNotFound(_0x2bc6e4,null))[_0x2d3d('0x26')](saveUpdates(_0x52c294[_0x2d3d('0x63')],null))[_0x2d3d('0x26')](respondWithResult(_0x2bc6e4,null))['catch'](handleError(_0x2bc6e4,null));};exports[_0x2d3d('0x3c')]=function(_0x58ed93,_0x578ee4){return db[_0x2d3d('0x46')][_0x2d3d('0x61')]({'where':{'id':_0x58ed93[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x578ee4,null))['then'](removeEntity(_0x578ee4,null))[_0x2d3d('0x5b')](handleError(_0x578ee4,null));};exports[_0x2d3d('0x6a')]=function(_0x1f9834,_0x5b7dab){return db[_0x2d3d('0x46')][_0x2d3d('0x6a')]()[_0x2d3d('0x26')](respondWithResult(_0x5b7dab,null))[_0x2d3d('0x5b')](handleError(_0x5b7dab,null));};exports[_0x2d3d('0x6b')]=function(_0x21c87a,_0x48e3a5,_0x1fd45d){var _0x33010e={'raw':!![],'where':{}},_0x454c49={},_0x8202cf;return db['ChatQueue']['findOne']({'where':{'id':_0x21c87a[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x48e3a5,null))[_0x2d3d('0x26')](function(_0x31cc61){if(_0x31cc61){_0x8202cf=_0x31cc61[_0x2d3d('0x3d')]({'plain':!![]});_0x454c49['model']=_[_0x2d3d('0x4b')](db[_0x2d3d('0x6c')][_0x2d3d('0x47')]);_0x454c49[_0x2d3d('0x4c')]=_[_0x2d3d('0x4b')](_0x21c87a['query']);_0x454c49['filters']=_[_0x2d3d('0x4e')](_0x454c49[_0x2d3d('0x4a')],_0x454c49[_0x2d3d('0x4c')]);_0x33010e[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x454c49['model'],qs[_0x2d3d('0x50')](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x50')]));_0x33010e[_0x2d3d('0x4f')]=_0x33010e[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x33010e['attributes']:_0x454c49[_0x2d3d('0x4a')];if(!_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x6d')](_0x2d3d('0x51'))){_0x33010e[_0x2d3d('0x34')]=qs['limit'](_0x21c87a[_0x2d3d('0x4c')]['limit']);_0x33010e[_0x2d3d('0x33')]=qs['offset'](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}_0x33010e[_0x2d3d('0x6e')]=qs['sort'](_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x33010e[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x21c87a[_0x2d3d('0x4c')],_0x454c49[_0x2d3d('0x4d')]));_0x33010e[_0x2d3d('0x53')][_0x2d3d('0x6f')]=_0x31cc61['id'];if(_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x57')]){_0x33010e['where']=_['merge'](_0x33010e['where'],{'$or':_['map'](_0x33010e[_0x2d3d('0x4f')],function(_0x22a339){var _0x2f0040={};_0x2f0040[_0x22a339]={'$like':'%'+_0x21c87a[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x2f0040;})});}_0x33010e=_['merge']({},_0x33010e,_0x21c87a[_0x2d3d('0x60')]);return db[_0x2d3d('0x6c')][_0x2d3d('0x59')](_0x33010e);}})[_0x2d3d('0x26')](function(_0x2c5fda){if(_0x2c5fda){return db[_0x2d3d('0x70')][_0x2d3d('0x71')]({'where':{'id':_['map'](_0x2c5fda,_0x2d3d('0x72')),'role':'agent'},'attributes':['id',_0x2d3d('0x42'),_0x2d3d('0x73'),_0x2d3d('0x74'),_0x2d3d('0x75')]});}})[_0x2d3d('0x26')](function(_0x22f1cc){if(_0x22f1cc){return{'count':_0x22f1cc[_0x2d3d('0x36')],'rows':_[_0x2d3d('0x45')](_0x22f1cc[_0x2d3d('0x5a')],function(_0x2a8e83){return{'membername':_0x2a8e83[_0x2d3d('0x42')],'UserId':_0x2a8e83['id'],'queue_name':_0x8202cf[_0x2d3d('0x42')],'ChatQueueId':_0x8202cf['id'],'interface':util['format']('%s/%s','SIP',_0x2a8e83['name']),'penalty':0x0,'paused':_0x2a8e83['chatPause'],'createdAt':_0x2a8e83[_0x2d3d('0x75')],'updatedAt':_0x2a8e83['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d3d('0x26')](respondWithFilteredResult(_0x48e3a5,_0x33010e))[_0x2d3d('0x5b')](handleError(_0x48e3a5,null));};exports[_0x2d3d('0x76')]=function(_0x19c93b,_0x28a085,_0x28f68a){var _0x55083c={};var _0x2b77bd={};var _0x1aefe5;var _0x397634;return db[_0x2d3d('0x46')]['findOne']({'where':{'id':_0x19c93b[_0x2d3d('0x5d')]['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x28a085,null))[_0x2d3d('0x26')](function(_0x2271f3){if(_0x2271f3){_0x1aefe5=_0x2271f3;_0x2b77bd[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x77')][_0x2d3d('0x47')]);_0x2b77bd[_0x2d3d('0x4c')]=_['keys'](_0x19c93b['query']);_0x2b77bd[_0x2d3d('0x4d')]=_[_0x2d3d('0x4e')](_0x2b77bd[_0x2d3d('0x4a')],_0x2b77bd[_0x2d3d('0x4c')]);_0x55083c[_0x2d3d('0x4f')]=_['intersection'](_0x2b77bd[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0x19c93b['query'][_0x2d3d('0x50')]));_0x55083c['attributes']=_0x55083c[_0x2d3d('0x4f')][_0x2d3d('0x5e')]?_0x55083c[_0x2d3d('0x4f')]:_0x2b77bd[_0x2d3d('0x4a')];_0x55083c[_0x2d3d('0x6e')]=qs[_0x2d3d('0x52')](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0x55083c[_0x2d3d('0x53')]=qs[_0x2d3d('0x4d')](_[_0x2d3d('0x54')](_0x19c93b[_0x2d3d('0x4c')],_0x2b77bd[_0x2d3d('0x4d')]));if(_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x57')]){_0x55083c[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0x55083c['where'],{'$or':_['map'](_0x55083c['attributes'],function(_0x3ec72d){var _0x183701={};_0x183701[_0x3ec72d]={'$like':'%'+_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x183701;})});}_0x55083c=_[_0x2d3d('0x55')]({},_0x55083c,_0x19c93b[_0x2d3d('0x60')]);return _0x1aefe5[_0x2d3d('0x76')](_0x55083c);}})[_0x2d3d('0x26')](function(_0x418e85){if(_0x418e85){_0x397634=_0x418e85[_0x2d3d('0x5e')];if(!_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x6d')]('nolimit')){_0x55083c[_0x2d3d('0x34')]=qs['limit'](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x34')]);_0x55083c[_0x2d3d('0x33')]=qs[_0x2d3d('0x33')](_0x19c93b[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}return _0x1aefe5[_0x2d3d('0x76')](_0x55083c);}})[_0x2d3d('0x26')](function(_0x935a77){if(_0x935a77){return _0x935a77?{'count':_0x397634,'rows':_0x935a77}:null;}})[_0x2d3d('0x26')](respondWithResult(_0x28a085,null))[_0x2d3d('0x5b')](handleError(_0x28a085,null));};exports['addTeams']=function(_0x1a4455,_0x37b2f6,_0x158089){var _0x3aced3=_0x1a4455[_0x2d3d('0x63')][_0x2d3d('0x78')];return db[_0x2d3d('0x77')][_0x2d3d('0x59')]({'where':{'id':_0x3aced3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2d3d('0x79'),'attributes':['id',_0x2d3d('0x42'),_0x2d3d('0x7a'),_0x2d3d('0x7b'),_0x2d3d('0x7c')],'raw':!![]}]})[_0x2d3d('0x26')](function(_0x11d40e){if(_0x11d40e){var _0x4963b3=_['flatMap'](_0x11d40e,function(_0x1144c7){var _0x5a1e40=_0x1144c7['get']({'plain':!![]});return _0x5a1e40[_0x2d3d('0x79')];});return db[_0x2d3d('0x46')][_0x2d3d('0x61')]({'where':{'id':_0x1a4455[_0x2d3d('0x5d')]['id']}})['then'](function(_0x10b05b){return db[_0x2d3d('0x7d')]['transaction'](function(_0x1cf17c){return _0x10b05b[_0x2d3d('0x7e')](_0x3aced3,{'transaction':_0x1cf17c})[_0x2d3d('0x26')](function(){return BPromise['each'](_0x4963b3,function(_0x147c55){return db[_0x2d3d('0x6c')][_0x2d3d('0x7f')]({'where':{'UserId':_0x147c55['id'],'ChatQueueId':_0x1a4455['params']['id']},'transaction':_0x1cf17c});});})['then'](function(){_0x4963b3[_0x2d3d('0x80')](function(_0x487669){socket[_0x2d3d('0x81')]('userChatQueue:save',{'UserId':_0x487669['id'],'ChatQueueId':_0x10b05b['id']});});});});});}})[_0x2d3d('0x26')](respondWithStatusCode(_0x37b2f6,null))[_0x2d3d('0x5b')](handleError(_0x37b2f6,null));};exports[_0x2d3d('0x82')]=function(_0x3b151b,_0x373b60,_0x3544b2){return db[_0x2d3d('0x77')]['findAll']({'where':{'id':_0x3b151b[_0x2d3d('0x4c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2d3d('0x70')],'as':_0x2d3d('0x79'),'attributes':['id'],'raw':!![]}]})[_0x2d3d('0x26')](handleEntityNotFound(_0x373b60,null))['then'](function(_0x1ba51e){var _0x2d9588=_['map'](_0x1ba51e,'id');var _0x4bd3f0=[];var _0x844762=[];var _0x508bdf=squel['select']();_0x508bdf[_0x2d3d('0x83')](_0x2d3d('0x84'))['from'](_0x2d3d('0x85'),'tq')['join']('user_has_teams','ut',_0x2d3d('0x86'))[_0x2d3d('0x53')](_0x2d3d('0x87'),_0x3b151b[_0x2d3d('0x5d')]['id']);for(var _0x213e8c=0x0;_0x213e8c<_0x1ba51e[_0x2d3d('0x5e')];_0x213e8c+=0x1){let _0x167ba5=_0x1ba51e[_0x213e8c];for(var _0x554c3d=0x0;_0x554c3d<_0x167ba5[_0x2d3d('0x79')]['length'];_0x554c3d+=0x1){let _0x28af41=_0x167ba5[_0x2d3d('0x79')][_0x554c3d];var _0x3f22eb=_0x508bdf[_0x2d3d('0x88')]();_0x3f22eb[_0x2d3d('0x53')](_0x2d3d('0x89'),_0x28af41['id']);_0x844762[_0x2d3d('0x8a')](db[_0x2d3d('0x7d')]['query'](_0x3f22eb[_0x2d3d('0x8b')](),{'type':db[_0x2d3d('0x7d')]['QueryTypes'][_0x2d3d('0x8c')]})[_0x2d3d('0x26')](function(_0x2c3896){if(_0x2c3896[_0x2d3d('0x5e')]===0x1){return _0x28af41['id'];}else{var _0x4d0778=_[_0x2d3d('0x8d')](_[_0x2d3d('0x45')](_0x2c3896,'TeamId'),function(_0x1bfb4f){return _[_0x2d3d('0x8e')](_0x2d9588,_0x1bfb4f);});if(_0x4d0778){return _0x28af41['id'];}}}));}}return BPromise['all'](_0x844762)[_0x2d3d('0x26')](function(_0x1a3747){_0x4bd3f0=_(_0x4bd3f0)['union'](_0x1a3747)['compact']()[_0x2d3d('0x8f')]();return db[_0x2d3d('0x46')]['find']({'where':{'id':_0x3b151b[_0x2d3d('0x5d')]['id']}})['then'](function(_0x4353f3){return db[_0x2d3d('0x7d')][_0x2d3d('0x90')](function(_0x952ade){return _0x4353f3[_0x2d3d('0x82')](_0x3b151b['query'][_0x2d3d('0x78')],{'transaction':_0x952ade})[_0x2d3d('0x26')](function(){if(!_['isEmpty'](_0x4bd3f0)){return _0x4353f3['removeAgents'](_0x4bd3f0,{'transaction':_0x952ade});}})[_0x2d3d('0x26')](function(){_0x4bd3f0[_0x2d3d('0x80')](function(_0x57fe34){socket[_0x2d3d('0x81')](_0x2d3d('0x91'),{'UserId':_0x57fe34,'ChatQueueId':_0x4353f3['id']});});});});});});})['then'](respondWithStatusCode(_0x373b60,null))[_0x2d3d('0x5b')](handleError(_0x373b60,null));};exports[_0x2d3d('0x92')]=function(_0x1debd0,_0x12ada7,_0xcb9a4c){return db['ChatQueue'][_0x2d3d('0x61')]({'where':{'id':_0x1debd0[_0x2d3d('0x5d')]['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x12ada7,null))['then'](function(_0x55d50d){if(_0x55d50d){return _0x55d50d[_0x2d3d('0x92')](_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')],_[_0x2d3d('0x93')](_0x1debd0['body'],[_0x2d3d('0x78'),'id'])||{})[_0x2d3d('0x94')](function(_0x358a47){for(var _0x397570=0x0;_0x397570<_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')][_0x2d3d('0x5e')];_0x397570+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x1debd0[_0x2d3d('0x63')][_0x2d3d('0x78')][_0x397570]),'ChatQueueId':Number(_0x1debd0[_0x2d3d('0x5d')]['id'])});}return _0x358a47;});}})[_0x2d3d('0x26')](respondWithResult(_0x12ada7,null))[_0x2d3d('0x5b')](handleError(_0x12ada7,null));};exports[_0x2d3d('0x95')]=function(_0x407a92,_0x113e3b,_0x15d505){return db[_0x2d3d('0x46')]['find']({'where':{'id':_0x407a92['params']['id']}})[_0x2d3d('0x26')](handleEntityNotFound(_0x113e3b,null))[_0x2d3d('0x26')](function(_0x2a1d7c){if(_0x2a1d7c){return _0x2a1d7c[_0x2d3d('0x95')](_0x407a92[_0x2d3d('0x4c')][_0x2d3d('0x78')])[_0x2d3d('0x26')](function(){if(_[_0x2d3d('0x96')](_0x407a92[_0x2d3d('0x4c')]['ids'])){for(var _0x5e2c6d=0x0;_0x5e2c6d<_0x407a92['query'][_0x2d3d('0x78')][_0x2d3d('0x5e')];_0x5e2c6d+=0x1){socket[_0x2d3d('0x81')](_0x2d3d('0x91'),{'UserId':Number(_0x407a92[_0x2d3d('0x4c')]['ids'][_0x5e2c6d]),'ChatQueueId':Number(_0x407a92[_0x2d3d('0x5d')]['id'])});}}else{socket['emit'](_0x2d3d('0x91'),{'UserId':Number(_0x407a92['query'][_0x2d3d('0x78')]),'ChatQueueId':Number(_0x407a92[_0x2d3d('0x5d')]['id'])});}});}})[_0x2d3d('0x26')](respondWithStatusCode(_0x113e3b,null))[_0x2d3d('0x5b')](handleError(_0x113e3b,null));};exports[_0x2d3d('0x97')]=function(_0xaebefc,_0x1900ea,_0x140f2){var _0xdfaa86={};var _0x2da6cf={};var _0x33e305;var _0x214ad4;return db[_0x2d3d('0x46')][_0x2d3d('0x98')]({'where':{'id':_0xaebefc[_0x2d3d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1900ea,null))[_0x2d3d('0x26')](function(_0x24430c){if(_0x24430c){_0x33e305=_0x24430c;_0x2da6cf[_0x2d3d('0x4a')]=_[_0x2d3d('0x4b')](db[_0x2d3d('0x70')][_0x2d3d('0x47')]);_0x2da6cf['query']=_[_0x2d3d('0x4b')](_0xaebefc[_0x2d3d('0x4c')]);_0x2da6cf['filters']=_[_0x2d3d('0x4e')](_0x2da6cf[_0x2d3d('0x4a')],_0x2da6cf[_0x2d3d('0x4c')]);_0xdfaa86[_0x2d3d('0x4f')]=_[_0x2d3d('0x4e')](_0x2da6cf[_0x2d3d('0x4a')],qs[_0x2d3d('0x50')](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x50')]));_0xdfaa86[_0x2d3d('0x4f')]=_0xdfaa86['attributes'][_0x2d3d('0x5e')]?_0xdfaa86[_0x2d3d('0x4f')]:_0x2da6cf[_0x2d3d('0x4a')];_0xdfaa86[_0x2d3d('0x6e')]=qs[_0x2d3d('0x52')](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x52')]);_0xdfaa86[_0x2d3d('0x53')]=qs['filters'](_['pick'](_0xaebefc['query'],_0x2da6cf['filters']));if(_0xaebefc['query'][_0x2d3d('0x57')]){_0xdfaa86[_0x2d3d('0x53')]=_[_0x2d3d('0x55')](_0xdfaa86[_0x2d3d('0x53')],{'$or':_[_0x2d3d('0x45')](_0xdfaa86[_0x2d3d('0x4f')],function(_0x8497db){var _0x54ab81={};_0x54ab81[_0x8497db]={'$like':'%'+_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x57')]+'%'};return _0x54ab81;})});}_0xdfaa86=_[_0x2d3d('0x55')]({},_0xdfaa86,_0xaebefc[_0x2d3d('0x60')]);return _0x33e305[_0x2d3d('0x97')](_0xdfaa86);}})[_0x2d3d('0x26')](function(_0x410318){if(_0x410318){_0x214ad4=_0x410318[_0x2d3d('0x5e')];if(!_0xaebefc['query']['hasOwnProperty'](_0x2d3d('0x51'))){_0xdfaa86['limit']=qs[_0x2d3d('0x34')](_0xaebefc['query']['limit']);_0xdfaa86[_0x2d3d('0x33')]=qs['offset'](_0xaebefc[_0x2d3d('0x4c')][_0x2d3d('0x33')]);}return _0x33e305[_0x2d3d('0x97')](_0xdfaa86);}})[_0x2d3d('0x26')](function(_0x5d42af){if(_0x5d42af){return _0x5d42af?{'count':_0x214ad4,'rows':_0x5d42af}:null;}})[_0x2d3d('0x26')](respondWithResult(_0x1900ea,null))[_0x2d3d('0x5b')](handleError(_0x1900ea,null));}; \ No newline at end of file +var _0x4311=['end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','body','describe','getMembers','hasOwnProperty','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','Team','nolimit','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x44ee86,_0x32634e){var _0x5b79dc=function(_0x2d36c1){while(--_0x2d36c1){_0x44ee86['push'](_0x44ee86['shift']());}};_0x5b79dc(++_0x32634e);}(_0x4311,0x109));var _0x1431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4311[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x1431('0x0'));var rimraf=require(_0x1431('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1431('0x2'));var moment=require(_0x1431('0x3'));var BPromise=require(_0x1431('0x4'));var Mustache=require('mustache');var util=require(_0x1431('0x5'));var path=require(_0x1431('0x6'));var sox=require(_0x1431('0x7'));var csv=require(_0x1431('0x8'));var ejs=require(_0x1431('0x9'));var fs=require('fs');var fs_extra=require(_0x1431('0xa'));var _=require(_0x1431('0xb'));var squel=require(_0x1431('0xc'));var crypto=require(_0x1431('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1431('0xe'));var toCsv=require(_0x1431('0x8'));var querystring=require(_0x1431('0xf'));var Papa=require(_0x1431('0x10'));var Redis=require('ioredis');var authService=require(_0x1431('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1431('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1431('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1431('0x14'));var db=require(_0x1431('0x15'))['db'];config[_0x1431('0x16')]=_[_0x1431('0x17')](config[_0x1431('0x16')],{'host':_0x1431('0x18'),'port':0x18eb});var socket=require(_0x1431('0x19'))(new Redis(config[_0x1431('0x16')]));require('./chatQueue.socket')[_0x1431('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5055f1,_0x175f3f,_0x2c1fce,_0x356f9a){return new BPromise(function(_0x256c77,_0x4aece4){var _0x20fd78=_0x356f9a||client;return _0x20fd78[_0x1431('0x1b')](_0x5055f1,_0x2c1fce)[_0x1431('0x1c')](function(_0x5bd43d){logger[_0x1431('0x1d')](_0x1431('0x1e'),_0x175f3f,_0x1431('0x1f'));logger['debug'](_0x1431('0x20'),_0x175f3f,_0x1431('0x1f'),JSON[_0x1431('0x21')](_0x5bd43d));if(_0x5bd43d[_0x1431('0x22')]){if(_0x5bd43d['error'][_0x1431('0x23')]===0x1f4){logger[_0x1431('0x22')](_0x1431('0x1e'),_0x175f3f,_0x5bd43d[_0x1431('0x22')][_0x1431('0x24')]);return _0x4aece4(_0x5bd43d['error'][_0x1431('0x24')]);}logger['error'](_0x1431('0x1e'),_0x175f3f,_0x5bd43d[_0x1431('0x22')][_0x1431('0x24')]);return _0x256c77(_0x5bd43d['error'][_0x1431('0x24')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x175f3f,_0x1431('0x1f'));_0x256c77(_0x5bd43d[_0x1431('0x25')][_0x1431('0x24')]);}})[_0x1431('0x26')](function(_0x2db013){logger[_0x1431('0x22')](_0x1431('0x1e'),_0x175f3f,_0x2db013);_0x4aece4(_0x2db013);});});}function respondWithStatusCode(_0x22ae0c,_0xeb4154){_0xeb4154=_0xeb4154||0xcc;return function(_0x44aa54){if(_0x44aa54){return _0x22ae0c[_0x1431('0x27')](_0xeb4154);}return _0x22ae0c[_0x1431('0x28')](_0xeb4154)[_0x1431('0x29')]();};}function respondWithResult(_0x373161,_0x5a3c46){_0x5a3c46=_0x5a3c46||0xc8;return function(_0x43de92){if(_0x43de92){return _0x373161['status'](_0x5a3c46)[_0x1431('0x2a')](_0x43de92);}};}function respondWithFilteredResult(_0x2e4dad,_0x1ae139){return function(_0x17d911){if(_0x17d911){var _0xa2d27a=typeof _0x1ae139[_0x1431('0x2b')]==='undefined'&&typeof _0x1ae139[_0x1431('0x2c')]===_0x1431('0x2d');var _0x3ff196=_0x17d911['count'];var _0x235664=_0xa2d27a?0x0:_0x1ae139[_0x1431('0x2b')];var _0x4fb299=_0xa2d27a?_0x17d911[_0x1431('0x2e')]:_0x1ae139['offset']+_0x1ae139[_0x1431('0x2c')];var _0x260c28;if(_0x4fb299>=_0x3ff196){_0x4fb299=_0x3ff196;_0x260c28=0xc8;}else{_0x260c28=0xce;}_0x2e4dad[_0x1431('0x28')](_0x260c28);return _0x2e4dad[_0x1431('0x2f')](_0x1431('0x30'),_0x235664+'-'+_0x4fb299+'/'+_0x3ff196)['json'](_0x17d911);}return null;};}function patchUpdates(_0x3d2555){return function(_0x2fea10){try{jsonpatch[_0x1431('0x31')](_0x2fea10,_0x3d2555,!![]);}catch(_0x289b0c){return BPromise['reject'](_0x289b0c);}return _0x2fea10[_0x1431('0x32')]();};}function saveUpdates(_0x2a953b,_0x435f3c){return function(_0x41ad59){if(_0x41ad59){return _0x41ad59[_0x1431('0x33')](_0x2a953b)['then'](function(_0x2901c9){return _0x2901c9;});}return null;};}function removeEntity(_0x18bece,_0x293aae){return function(_0x381701){if(_0x381701){return _0x381701[_0x1431('0x34')]()[_0x1431('0x1c')](function(){var _0x37d177=_0x381701['get']({'plain':!![]});var _0x3cee67=_0x1431('0x35');return db[_0x1431('0x36')][_0x1431('0x34')]({'where':{'type':_0x3cee67,'resourceId':_0x37d177['id']}})[_0x1431('0x1c')](function(){return _0x381701;});})[_0x1431('0x1c')](function(){_0x18bece['status'](0xcc)[_0x1431('0x29')]();});}};}function handleEntityNotFound(_0x2d7fd0,_0x401c0a){return function(_0xe3a545){if(!_0xe3a545){_0x2d7fd0[_0x1431('0x27')](0x194);}return _0xe3a545;};}function handleError(_0x3614d9,_0x2d4a47){_0x2d4a47=_0x2d4a47||0x1f4;return function(_0x4ce7d9){logger[_0x1431('0x22')](_0x4ce7d9[_0x1431('0x37')]);if(_0x4ce7d9[_0x1431('0x38')]){delete _0x4ce7d9[_0x1431('0x38')];}_0x3614d9[_0x1431('0x28')](_0x2d4a47)[_0x1431('0x39')](_0x4ce7d9);};}exports[_0x1431('0x3a')]=function(_0x389501,_0x10208d){var _0x3428d4={},_0x5f58fd={},_0x1bd6cc={'count':0x0,'rows':[]};var _0x396cc2=_['map'](db[_0x1431('0x3b')][_0x1431('0x3c')],function(_0x58b755){return{'name':_0x58b755[_0x1431('0x3d')],'type':_0x58b755[_0x1431('0x3e')][_0x1431('0x3f')]};});_0x5f58fd[_0x1431('0x40')]=_[_0x1431('0x41')](_0x396cc2,_0x1431('0x38'));_0x5f58fd[_0x1431('0x42')]=_[_0x1431('0x43')](_0x389501['query']);_0x5f58fd[_0x1431('0x44')]=_['intersection'](_0x5f58fd[_0x1431('0x40')],_0x5f58fd[_0x1431('0x42')]);_0x3428d4['attributes']=_[_0x1431('0x45')](_0x5f58fd[_0x1431('0x40')],qs[_0x1431('0x46')](_0x389501['query'][_0x1431('0x46')]));_0x3428d4[_0x1431('0x47')]=_0x3428d4[_0x1431('0x47')][_0x1431('0x48')]?_0x3428d4[_0x1431('0x47')]:_0x5f58fd['model'];if(!_0x389501[_0x1431('0x42')]['hasOwnProperty']('nolimit')){_0x3428d4[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x389501['query']['limit']);_0x3428d4['offset']=qs[_0x1431('0x2b')](_0x389501[_0x1431('0x42')]['offset']);}_0x3428d4[_0x1431('0x49')]=qs[_0x1431('0x4a')](_0x389501[_0x1431('0x42')]['sort']);_0x3428d4[_0x1431('0x4b')]=qs['filters'](_[_0x1431('0x4c')](_0x389501[_0x1431('0x42')],_0x5f58fd[_0x1431('0x44')]),_0x396cc2);if(_0x389501[_0x1431('0x42')][_0x1431('0x4d')]){_0x3428d4[_0x1431('0x4b')]=_['merge'](_0x3428d4[_0x1431('0x4b')],{'$or':_['map'](_0x396cc2,function(_0x2f03d5){if(_0x2f03d5['type']!==_0x1431('0x4e')){var _0x37ac62={};_0x37ac62[_0x2f03d5[_0x1431('0x38')]]={'$like':'%'+_0x389501[_0x1431('0x42')][_0x1431('0x4d')]+'%'};return _0x37ac62;}})});}_0x3428d4=_[_0x1431('0x4f')]({},_0x3428d4,_0x389501['options']);var _0x49bd0e={'where':_0x3428d4[_0x1431('0x4b')]};return db[_0x1431('0x3b')][_0x1431('0x2e')](_0x49bd0e)[_0x1431('0x1c')](function(_0x42434b){_0x1bd6cc[_0x1431('0x2e')]=_0x42434b;if(_0x389501[_0x1431('0x42')][_0x1431('0x50')]){_0x3428d4[_0x1431('0x51')]=[{'all':!![]}];}return db[_0x1431('0x3b')][_0x1431('0x52')](_0x3428d4);})[_0x1431('0x1c')](function(_0x4ee040){_0x1bd6cc['rows']=_0x4ee040;return _0x1bd6cc;})[_0x1431('0x1c')](respondWithFilteredResult(_0x10208d,_0x3428d4))['catch'](handleError(_0x10208d,null));};exports[_0x1431('0x53')]=function(_0x5ce04c,_0x4eb727){var _0x4dad5f={'raw':!![],'where':{'id':_0x5ce04c[_0x1431('0x54')]['id']}},_0x5624da={};_0x5624da['model']=_[_0x1431('0x43')](db[_0x1431('0x3b')][_0x1431('0x3c')]);_0x5624da[_0x1431('0x42')]=_[_0x1431('0x43')](_0x5ce04c[_0x1431('0x42')]);_0x5624da[_0x1431('0x44')]=_['intersection'](_0x5624da[_0x1431('0x40')],_0x5624da['query']);_0x4dad5f['attributes']=_[_0x1431('0x45')](_0x5624da[_0x1431('0x40')],qs['fields'](_0x5ce04c['query']['fields']));_0x4dad5f['attributes']=_0x4dad5f[_0x1431('0x47')]['length']?_0x4dad5f[_0x1431('0x47')]:_0x5624da[_0x1431('0x40')];if(_0x5ce04c['query'][_0x1431('0x50')]){_0x4dad5f[_0x1431('0x51')]=[{'all':!![]}];}_0x4dad5f=_[_0x1431('0x4f')]({},_0x4dad5f,_0x5ce04c[_0x1431('0x55')]);return db[_0x1431('0x3b')][_0x1431('0x56')](_0x4dad5f)[_0x1431('0x1c')](handleEntityNotFound(_0x4eb727,null))['then'](respondWithResult(_0x4eb727,null))[_0x1431('0x26')](handleError(_0x4eb727,null));};exports[_0x1431('0x57')]=function(_0x56c2f4,_0x53ae0a){return db[_0x1431('0x3b')][_0x1431('0x57')](_0x56c2f4['body'],{})[_0x1431('0x1c')](function(_0x5c7857){var _0x5b3445=_0x56c2f4['user'][_0x1431('0x58')]({'plain':!![]});if(!_0x5b3445)throw new Error(_0x1431('0x59'));if(_0x5b3445[_0x1431('0x5a')]===_0x1431('0x5b')){var _0x2dedae=_0x5c7857[_0x1431('0x58')]({'plain':!![]});var _0x5e4f34=_0x1431('0x35');return db[_0x1431('0x5c')]['find']({'where':{'name':_0x5e4f34,'userProfileId':_0x5b3445['userProfileId']},'raw':!![]})[_0x1431('0x1c')](function(_0x37ba09){if(_0x37ba09&&_0x37ba09[_0x1431('0x5d')]===0x0){return db['UserProfileResource'][_0x1431('0x57')]({'name':_0x2dedae[_0x1431('0x38')],'resourceId':_0x2dedae['id'],'type':_0x37ba09[_0x1431('0x38')],'sectionId':_0x37ba09['id']},{})[_0x1431('0x1c')](function(){return _0x5c7857;});}else{return _0x5c7857;}})[_0x1431('0x26')](function(_0x161941){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x161941);throw _0x161941;});}return _0x5c7857;})[_0x1431('0x1c')](respondWithResult(_0x53ae0a,0xc9))[_0x1431('0x26')](handleError(_0x53ae0a,null));};exports['update']=function(_0x101ec4,_0x2192a7){if(_0x101ec4['body']['id']){delete _0x101ec4[_0x1431('0x5e')]['id'];}return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x101ec4[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x2192a7,null))['then'](saveUpdates(_0x101ec4[_0x1431('0x5e')],null))['then'](respondWithResult(_0x2192a7,null))[_0x1431('0x26')](handleError(_0x2192a7,null));};exports['destroy']=function(_0x59b521,_0x13b3cb){return db[_0x1431('0x3b')]['find']({'where':{'id':_0x59b521[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x13b3cb,null))[_0x1431('0x1c')](removeEntity(_0x13b3cb,null))[_0x1431('0x26')](handleError(_0x13b3cb,null));};exports[_0x1431('0x5f')]=function(_0x3d1d74,_0x315372){return db[_0x1431('0x3b')][_0x1431('0x5f')]()[_0x1431('0x1c')](respondWithResult(_0x315372,null))['catch'](handleError(_0x315372,null));};exports[_0x1431('0x60')]=function(_0x220cee,_0x279fa1,_0x42ea8c){var _0x4d1048={'raw':!![],'where':{}},_0x1f9614={},_0x4d97db;return db[_0x1431('0x3b')]['findOne']({'where':{'id':_0x220cee['params']['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x279fa1,null))[_0x1431('0x1c')](function(_0xbb61b4){if(_0xbb61b4){_0x4d97db=_0xbb61b4[_0x1431('0x58')]({'plain':!![]});_0x1f9614['model']=_[_0x1431('0x43')](db['UserChatQueue'][_0x1431('0x3c')]);_0x1f9614[_0x1431('0x42')]=_['keys'](_0x220cee['query']);_0x1f9614[_0x1431('0x44')]=_[_0x1431('0x45')](_0x1f9614[_0x1431('0x40')],_0x1f9614[_0x1431('0x42')]);_0x4d1048[_0x1431('0x47')]=_[_0x1431('0x45')](_0x1f9614[_0x1431('0x40')],qs[_0x1431('0x46')](_0x220cee['query'][_0x1431('0x46')]));_0x4d1048['attributes']=_0x4d1048[_0x1431('0x47')][_0x1431('0x48')]?_0x4d1048[_0x1431('0x47')]:_0x1f9614[_0x1431('0x40')];if(!_0x220cee['query'][_0x1431('0x61')]('nolimit')){_0x4d1048[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x220cee[_0x1431('0x42')][_0x1431('0x2c')]);_0x4d1048[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x220cee['query'][_0x1431('0x2b')]);}_0x4d1048['order']=qs['sort'](_0x220cee['query']['sort']);_0x4d1048[_0x1431('0x4b')]=qs[_0x1431('0x44')](_[_0x1431('0x4c')](_0x220cee[_0x1431('0x42')],_0x1f9614['filters']));_0x4d1048[_0x1431('0x4b')][_0x1431('0x62')]=_0xbb61b4['id'];if(_0x220cee[_0x1431('0x42')][_0x1431('0x4d')]){_0x4d1048[_0x1431('0x4b')]=_[_0x1431('0x4f')](_0x4d1048['where'],{'$or':_[_0x1431('0x41')](_0x4d1048[_0x1431('0x47')],function(_0x59e8d5){var _0x5b864e={};_0x5b864e[_0x59e8d5]={'$like':'%'+_0x220cee[_0x1431('0x42')]['filter']+'%'};return _0x5b864e;})});}_0x4d1048=_['merge']({},_0x4d1048,_0x220cee[_0x1431('0x55')]);return db[_0x1431('0x63')][_0x1431('0x52')](_0x4d1048);}})[_0x1431('0x1c')](function(_0xb95a3c){if(_0xb95a3c){return db[_0x1431('0x64')][_0x1431('0x65')]({'where':{'id':_['map'](_0xb95a3c,_0x1431('0x66')),'role':_0x1431('0x67')},'attributes':['id',_0x1431('0x38'),_0x1431('0x68'),_0x1431('0x69'),_0x1431('0x6a')]});}})[_0x1431('0x1c')](function(_0x3ee39d){if(_0x3ee39d){return{'count':_0x3ee39d[_0x1431('0x2e')],'rows':_[_0x1431('0x41')](_0x3ee39d[_0x1431('0x6b')],function(_0x2804d9){return{'membername':_0x2804d9[_0x1431('0x38')],'UserId':_0x2804d9['id'],'queue_name':_0x4d97db['name'],'ChatQueueId':_0x4d97db['id'],'interface':util['format'](_0x1431('0x6c'),_0x1431('0x6d'),_0x2804d9[_0x1431('0x38')]),'penalty':0x0,'paused':_0x2804d9[_0x1431('0x68')],'createdAt':_0x2804d9[_0x1431('0x6a')],'updatedAt':_0x2804d9[_0x1431('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1431('0x1c')](respondWithFilteredResult(_0x279fa1,_0x4d1048))['catch'](handleError(_0x279fa1,null));};exports[_0x1431('0x6e')]=function(_0x3a6366,_0x5481c2,_0x86c36c){var _0x33de63={};var _0x3a29ec={};var _0x40f7d0;var _0x529670;return db['ChatQueue']['findOne']({'where':{'id':_0x3a6366['params']['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x5481c2,null))[_0x1431('0x1c')](function(_0x32b5f4){if(_0x32b5f4){_0x40f7d0=_0x32b5f4;_0x3a29ec[_0x1431('0x40')]=_['keys'](db[_0x1431('0x6f')]['rawAttributes']);_0x3a29ec[_0x1431('0x42')]=_[_0x1431('0x43')](_0x3a6366[_0x1431('0x42')]);_0x3a29ec[_0x1431('0x44')]=_[_0x1431('0x45')](_0x3a29ec[_0x1431('0x40')],_0x3a29ec['query']);_0x33de63[_0x1431('0x47')]=_[_0x1431('0x45')](_0x3a29ec[_0x1431('0x40')],qs[_0x1431('0x46')](_0x3a6366[_0x1431('0x42')][_0x1431('0x46')]));_0x33de63[_0x1431('0x47')]=_0x33de63[_0x1431('0x47')][_0x1431('0x48')]?_0x33de63[_0x1431('0x47')]:_0x3a29ec['model'];_0x33de63[_0x1431('0x49')]=qs[_0x1431('0x4a')](_0x3a6366['query'][_0x1431('0x4a')]);_0x33de63[_0x1431('0x4b')]=qs[_0x1431('0x44')](_[_0x1431('0x4c')](_0x3a6366[_0x1431('0x42')],_0x3a29ec['filters']));if(_0x3a6366['query'][_0x1431('0x4d')]){_0x33de63[_0x1431('0x4b')]=_[_0x1431('0x4f')](_0x33de63[_0x1431('0x4b')],{'$or':_['map'](_0x33de63[_0x1431('0x47')],function(_0x43c11c){var _0x28ed82={};_0x28ed82[_0x43c11c]={'$like':'%'+_0x3a6366[_0x1431('0x42')]['filter']+'%'};return _0x28ed82;})});}_0x33de63=_[_0x1431('0x4f')]({},_0x33de63,_0x3a6366['options']);return _0x40f7d0[_0x1431('0x6e')](_0x33de63);}})[_0x1431('0x1c')](function(_0x1351ee){if(_0x1351ee){_0x529670=_0x1351ee[_0x1431('0x48')];if(!_0x3a6366['query']['hasOwnProperty'](_0x1431('0x70'))){_0x33de63[_0x1431('0x2c')]=qs[_0x1431('0x2c')](_0x3a6366[_0x1431('0x42')][_0x1431('0x2c')]);_0x33de63[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x3a6366['query'][_0x1431('0x2b')]);}return _0x40f7d0[_0x1431('0x6e')](_0x33de63);}})[_0x1431('0x1c')](function(_0x5e14c3){if(_0x5e14c3){return _0x5e14c3?{'count':_0x529670,'rows':_0x5e14c3}:null;}})[_0x1431('0x1c')](respondWithResult(_0x5481c2,null))['catch'](handleError(_0x5481c2,null));};exports[_0x1431('0x71')]=function(_0x504907,_0x3db37a,_0x542ba7){var _0x651d71=_0x504907[_0x1431('0x5e')][_0x1431('0x72')];return db['Team'][_0x1431('0x52')]({'where':{'id':_0x651d71},'attributes':['id'],'include':[{'model':db[_0x1431('0x64')],'as':_0x1431('0x73'),'attributes':['id','name','online',_0x1431('0x74'),_0x1431('0x75')],'raw':!![]}]})['then'](function(_0x27e6cc){if(_0x27e6cc){var _0x5c8d0b=_[_0x1431('0x76')](_0x27e6cc,function(_0x4eda78){var _0x32e1c6=_0x4eda78[_0x1431('0x58')]({'plain':!![]});return _0x32e1c6[_0x1431('0x73')];});return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x504907[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](function(_0x111cba){return db[_0x1431('0x77')]['transaction'](function(_0xdfcf64){return _0x111cba['addTeams'](_0x651d71,{'transaction':_0xdfcf64})[_0x1431('0x1c')](function(){return BPromise['each'](_0x5c8d0b,function(_0x549f2d){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x549f2d['id'],'ChatQueueId':_0x504907[_0x1431('0x54')]['id']},'transaction':_0xdfcf64});});})[_0x1431('0x1c')](function(){_0x5c8d0b[_0x1431('0x78')](function(_0xa49cd){socket[_0x1431('0x79')](_0x1431('0x7a'),{'UserId':_0xa49cd['id'],'ChatQueueId':_0x111cba['id']});});});});});}})[_0x1431('0x1c')](respondWithStatusCode(_0x3db37a,null))[_0x1431('0x26')](handleError(_0x3db37a,null));};exports[_0x1431('0x7b')]=function(_0x19a32b,_0x21f4b6,_0x28c323){return db[_0x1431('0x6f')][_0x1431('0x52')]({'where':{'id':_0x19a32b[_0x1431('0x42')][_0x1431('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1431('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21f4b6,null))[_0x1431('0x1c')](function(_0x303e1a){var _0x196cf2=_[_0x1431('0x41')](_0x303e1a,'id');var _0x2d074b=[];var _0x15cfd0=[];var _0x134bd5=squel[_0x1431('0x7c')]();_0x134bd5[_0x1431('0x7d')](_0x1431('0x7e'))[_0x1431('0x7f')](_0x1431('0x80'),'tq')[_0x1431('0x81')]('user_has_teams','ut',_0x1431('0x82'))[_0x1431('0x4b')](_0x1431('0x83'),_0x19a32b['params']['id']);for(var _0x44d150=0x0;_0x44d150<_0x303e1a[_0x1431('0x48')];_0x44d150+=0x1){let _0xfcac92=_0x303e1a[_0x44d150];for(var _0x55edd7=0x0;_0x55edd7<_0xfcac92[_0x1431('0x73')][_0x1431('0x48')];_0x55edd7+=0x1){let _0x159bf3=_0xfcac92[_0x1431('0x73')][_0x55edd7];var _0x56d289=_0x134bd5[_0x1431('0x84')]();_0x56d289[_0x1431('0x4b')](_0x1431('0x85'),_0x159bf3['id']);_0x15cfd0[_0x1431('0x86')](db[_0x1431('0x77')][_0x1431('0x42')](_0x56d289[_0x1431('0x87')](),{'type':db['sequelize'][_0x1431('0x88')][_0x1431('0x89')]})[_0x1431('0x1c')](function(_0x59248c){if(_0x59248c['length']===0x1){return _0x159bf3['id'];}else{var _0x1bec4c=_[_0x1431('0x8a')](_[_0x1431('0x41')](_0x59248c,_0x1431('0x8b')),function(_0x339ab6){return _[_0x1431('0x8c')](_0x196cf2,_0x339ab6);});if(_0x1bec4c){return _0x159bf3['id'];}}}));}}return BPromise['all'](_0x15cfd0)[_0x1431('0x1c')](function(_0x4cc90e){_0x2d074b=_(_0x2d074b)[_0x1431('0x8d')](_0x4cc90e)[_0x1431('0x8e')]()[_0x1431('0x8f')]();return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x19a32b['params']['id']}})[_0x1431('0x1c')](function(_0x40199e){return db['sequelize']['transaction'](function(_0x5e633a){return _0x40199e[_0x1431('0x7b')](_0x19a32b['query'][_0x1431('0x72')],{'transaction':_0x5e633a})[_0x1431('0x1c')](function(){if(!_[_0x1431('0x90')](_0x2d074b)){return _0x40199e[_0x1431('0x91')](_0x2d074b,{'transaction':_0x5e633a});}})[_0x1431('0x1c')](function(){_0x2d074b[_0x1431('0x78')](function(_0x75af56){socket['emit'](_0x1431('0x92'),{'UserId':_0x75af56,'ChatQueueId':_0x40199e['id']});});});});});});})[_0x1431('0x1c')](respondWithStatusCode(_0x21f4b6,null))['catch'](handleError(_0x21f4b6,null));};exports[_0x1431('0x93')]=function(_0x9da62f,_0x355964,_0x57edb6){return db['ChatQueue'][_0x1431('0x56')]({'where':{'id':_0x9da62f[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x355964,null))['then'](function(_0x3e85a0){if(_0x3e85a0){return _0x3e85a0[_0x1431('0x93')](_0x9da62f[_0x1431('0x5e')][_0x1431('0x72')],_[_0x1431('0x94')](_0x9da62f[_0x1431('0x5e')],[_0x1431('0x72'),'id'])||{})[_0x1431('0x95')](function(_0xffbee4){for(var _0x21688f=0x0;_0x21688f<_0x9da62f[_0x1431('0x5e')]['ids'][_0x1431('0x48')];_0x21688f+=0x1){socket['emit'](_0x1431('0x7a'),{'UserId':Number(_0x9da62f[_0x1431('0x5e')][_0x1431('0x72')][_0x21688f]),'ChatQueueId':Number(_0x9da62f[_0x1431('0x54')]['id'])});}return _0xffbee4;});}})[_0x1431('0x1c')](respondWithResult(_0x355964,null))[_0x1431('0x26')](handleError(_0x355964,null));};exports['removeAgents']=function(_0x12a55c,_0x2deb3b,_0x5a4952){return db[_0x1431('0x3b')][_0x1431('0x56')]({'where':{'id':_0x12a55c[_0x1431('0x54')]['id']}})[_0x1431('0x1c')](handleEntityNotFound(_0x2deb3b,null))[_0x1431('0x1c')](function(_0x5d5077){if(_0x5d5077){return _0x5d5077[_0x1431('0x91')](_0x12a55c['query']['ids'])['then'](function(){if(_[_0x1431('0x96')](_0x12a55c[_0x1431('0x42')][_0x1431('0x72')])){for(var _0x542e9f=0x0;_0x542e9f<_0x12a55c['query'][_0x1431('0x72')][_0x1431('0x48')];_0x542e9f+=0x1){socket[_0x1431('0x79')](_0x1431('0x92'),{'UserId':Number(_0x12a55c['query'][_0x1431('0x72')][_0x542e9f]),'ChatQueueId':Number(_0x12a55c[_0x1431('0x54')]['id'])});}}else{socket[_0x1431('0x79')]('userChatQueue:remove',{'UserId':Number(_0x12a55c[_0x1431('0x42')][_0x1431('0x72')]),'ChatQueueId':Number(_0x12a55c[_0x1431('0x54')]['id'])});}});}})[_0x1431('0x1c')](respondWithStatusCode(_0x2deb3b,null))[_0x1431('0x26')](handleError(_0x2deb3b,null));};exports[_0x1431('0x97')]=function(_0x4dffaa,_0x3f068a,_0xea0550){var _0x7d834d={};var _0x5c9df4={};var _0x325cd8;var _0x28a607;return db[_0x1431('0x3b')][_0x1431('0x98')]({'where':{'id':_0x4dffaa[_0x1431('0x54')]['id']}})['then'](handleEntityNotFound(_0x3f068a,null))['then'](function(_0x13ffe7){if(_0x13ffe7){_0x325cd8=_0x13ffe7;_0x5c9df4['model']=_[_0x1431('0x43')](db[_0x1431('0x64')][_0x1431('0x3c')]);_0x5c9df4[_0x1431('0x42')]=_[_0x1431('0x43')](_0x4dffaa[_0x1431('0x42')]);_0x5c9df4[_0x1431('0x44')]=_[_0x1431('0x45')](_0x5c9df4['model'],_0x5c9df4[_0x1431('0x42')]);_0x7d834d[_0x1431('0x47')]=_[_0x1431('0x45')](_0x5c9df4[_0x1431('0x40')],qs[_0x1431('0x46')](_0x4dffaa[_0x1431('0x42')][_0x1431('0x46')]));_0x7d834d['attributes']=_0x7d834d[_0x1431('0x47')][_0x1431('0x48')]?_0x7d834d[_0x1431('0x47')]:_0x5c9df4[_0x1431('0x40')];_0x7d834d['order']=qs['sort'](_0x4dffaa[_0x1431('0x42')]['sort']);_0x7d834d[_0x1431('0x4b')]=qs['filters'](_[_0x1431('0x4c')](_0x4dffaa[_0x1431('0x42')],_0x5c9df4[_0x1431('0x44')]));if(_0x4dffaa[_0x1431('0x42')][_0x1431('0x4d')]){_0x7d834d['where']=_[_0x1431('0x4f')](_0x7d834d[_0x1431('0x4b')],{'$or':_[_0x1431('0x41')](_0x7d834d[_0x1431('0x47')],function(_0x319a1c){var _0x28c279={};_0x28c279[_0x319a1c]={'$like':'%'+_0x4dffaa[_0x1431('0x42')][_0x1431('0x4d')]+'%'};return _0x28c279;})});}_0x7d834d=_[_0x1431('0x4f')]({},_0x7d834d,_0x4dffaa[_0x1431('0x55')]);return _0x325cd8[_0x1431('0x97')](_0x7d834d);}})[_0x1431('0x1c')](function(_0x11652e){if(_0x11652e){_0x28a607=_0x11652e['length'];if(!_0x4dffaa[_0x1431('0x42')][_0x1431('0x61')](_0x1431('0x70'))){_0x7d834d[_0x1431('0x2c')]=qs['limit'](_0x4dffaa[_0x1431('0x42')]['limit']);_0x7d834d[_0x1431('0x2b')]=qs[_0x1431('0x2b')](_0x4dffaa[_0x1431('0x42')]['offset']);}return _0x325cd8['getAgents'](_0x7d834d);}})[_0x1431('0x1c')](function(_0x5a6967){if(_0x5a6967){return _0x5a6967?{'count':_0x28a607,'rows':_0x5a6967}:null;}})[_0x1431('0x1c')](respondWithResult(_0x3f068a,null))[_0x1431('0x26')](handleError(_0x3f068a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 28139b8..5bc292c 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 _0x08bb=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5baae8,_0x55fd88){var _0x57da04=function(_0xcd399){while(--_0xcd399){_0x5baae8['push'](_0x5baae8['shift']());}};_0x57da04(++_0x55fd88);}(_0x08bb,0x177));var _0xb08b=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x08bb[_0x1969a7];return _0x3d665f;};'use strict';var EventEmitter=require(_0xb08b('0x0'));var ChatQueue=require(_0xb08b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb08b('0x2')](0x0);var events={'afterCreate':_0xb08b('0x3'),'afterUpdate':_0xb08b('0x4'),'afterDestroy':_0xb08b('0x5')};function emitEvent(_0x53b818){return function(_0x35b9ed,_0x3efad3,_0x39dfb3){ChatQueueEvents[_0xb08b('0x6')](_0x53b818+':'+_0x35b9ed['id'],_0x35b9ed);ChatQueueEvents[_0xb08b('0x6')](_0x53b818,_0x35b9ed);_0x39dfb3(null);};}for(var e in events){if(events[_0xb08b('0x7')](e)){var event=events[e];ChatQueue[_0xb08b('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xbb6e=['update','remove','hasOwnProperty','hook','exports','events','ChatQueue','save'];(function(_0x2f2019,_0x57d487){var _0x1a78bf=function(_0x14d40c){while(--_0x14d40c){_0x2f2019['push'](_0x2f2019['shift']());}};_0x1a78bf(++_0x57d487);}(_0xbb6e,0x115));var _0xebb6=function(_0x5099fd,_0xa0192a){_0x5099fd=_0x5099fd-0x0;var _0x38ae34=_0xbb6e[_0x5099fd];return _0x38ae34;};'use strict';var EventEmitter=require(_0xebb6('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xebb6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebb6('0x2'),'afterUpdate':_0xebb6('0x3'),'afterDestroy':_0xebb6('0x4')};function emitEvent(_0xfb59e3){return function(_0x3529f9,_0x3a3bc7,_0x4a5186){ChatQueueEvents['emit'](_0xfb59e3+':'+_0x3529f9['id'],_0x3529f9);ChatQueueEvents['emit'](_0xfb59e3,_0x3529f9);_0x4a5186(null);};}for(var e in events){if(events[_0xebb6('0x5')](e)){var event=events[e];ChatQueue[_0xebb6('0x6')](e,emitEvent(event));}}module[_0xebb6('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 12fa5ec..8c3357c 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 _0xe5aa=['define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xe5aa,0x91));var _0xae5a=function(_0x19b6fc,_0x463e57){_0x19b6fc=_0x19b6fc-0x0;var _0x4c5006=_0xe5aa[_0x19b6fc];return _0x4c5006;};'use strict';var _=require(_0xae5a('0x0'));var util=require(_0xae5a('0x1'));var logger=require(_0xae5a('0x2'))(_0xae5a('0x3'));var moment=require(_0xae5a('0x4'));var BPromise=require(_0xae5a('0x5'));var rp=require(_0xae5a('0x6'));var fs=require('fs');var path=require(_0xae5a('0x7'));var rimraf=require(_0xae5a('0x8'));var config=require('../../config/environment');var attributes=require(_0xae5a('0x9'));module[_0xae5a('0xa')]=function(_0x251b63,_0x5866ca){return _0x251b63[_0xae5a('0xb')](_0xae5a('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x244b=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','../../config/logger','api','moment','bluebird'];(function(_0x31afef,_0x5ae2e0){var _0x70a589=function(_0x353715){while(--_0x353715){_0x31afef['push'](_0x31afef['shift']());}};_0x70a589(++_0x5ae2e0);}(_0x244b,0x158));var _0xb244=function(_0x4ad323,_0x40e25e){_0x4ad323=_0x4ad323-0x0;var _0xe4b67d=_0x244b[_0x4ad323];return _0xe4b67d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb244('0x0'))(_0xb244('0x1'));var moment=require(_0xb244('0x2'));var BPromise=require(_0xb244('0x3'));var rp=require(_0xb244('0x4'));var fs=require('fs');var path=require(_0xb244('0x5'));var rimraf=require('rimraf');var config=require(_0xb244('0x6'));var attributes=require(_0xb244('0x7'));module[_0xb244('0x8')]=function(_0x35cf93,_0x421b16){return _0x35cf93[_0xb244('0x9')](_0xb244('0xa'),attributes,{'tableName':_0xb244('0xb'),'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 aaa262d..7e9943f 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 _0x5388=['code','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','defaults','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','stringify','error'];(function(_0x3146c3,_0x5857ad){var _0x3c1b87=function(_0x503dae){while(--_0x503dae){_0x3146c3['push'](_0x3146c3['shift']());}};_0x3c1b87(++_0x5857ad);}(_0x5388,0xee));var _0x8538=function(_0x4e16fd,_0x28e642){_0x4e16fd=_0x4e16fd-0x0;var _0x258205=_0x5388[_0x4e16fd];return _0x258205;};'use strict';var _=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var moment=require(_0x8538('0x2'));var BPromise=require(_0x8538('0x3'));var rs=require(_0x8538('0x4'));var fs=require('fs');var Redis=require(_0x8538('0x5'));var db=require(_0x8538('0x6'))['db'];var utils=require(_0x8538('0x7'));var logger=require(_0x8538('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8538('0x9')]['http']({'port':0x232a});config['redis']=_[_0x8538('0xa')](config[_0x8538('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8538('0xc'))(new Redis(config[_0x8538('0xb')]));require('./chatQueue.socket')[_0x8538('0xd')](socket);function respondWithRpcPromise(_0x267c7d,_0x244e9e,_0x8dfc8b){return new BPromise(function(_0x14c272,_0x10f679){return client[_0x8538('0xe')](_0x267c7d,_0x8dfc8b)[_0x8538('0xf')](function(_0x17d607){logger[_0x8538('0x10')](_0x8538('0x11'),_0x244e9e,'request\x20sent');logger[_0x8538('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x244e9e,'request\x20sent',JSON[_0x8538('0x13')](_0x17d607));if(_0x17d607[_0x8538('0x14')]){if(_0x17d607[_0x8538('0x14')][_0x8538('0x15')]===0x1f4){logger[_0x8538('0x14')]('ChatQueue,\x20%s,\x20%s',_0x244e9e,_0x17d607[_0x8538('0x14')][_0x8538('0x16')]);return _0x10f679(_0x17d607[_0x8538('0x14')]['message']);}logger[_0x8538('0x14')](_0x8538('0x11'),_0x244e9e,_0x17d607['error'][_0x8538('0x16')]);return _0x14c272(_0x17d607[_0x8538('0x14')]['message']);}else{logger[_0x8538('0x10')]('ChatQueue,\x20%s,\x20%s',_0x244e9e,'request\x20sent');_0x14c272(_0x17d607[_0x8538('0x17')][_0x8538('0x16')]);}})[_0x8538('0x18')](function(_0x13551){logger[_0x8538('0x14')](_0x8538('0x11'),_0x244e9e,_0x13551);_0x10f679(_0x13551);});});}exports[_0x8538('0x19')]=function(_0x63d759){var _0x553581=this;return new Promise(function(_0x5f02ef,_0x3042eb){return db[_0x8538('0x1a')]['findAll']({'raw':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')][_0x8538('0x1c')]===undefined?!![]:![]:!![],'where':_0x63d759[_0x8538('0x1b')]?_0x63d759['options'][_0x8538('0x1d')]||null:null,'attributes':_0x63d759['options']?_0x63d759[_0x8538('0x1b')][_0x8538('0x1e')]||null:null,'limit':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')][_0x8538('0x1f')]||null:null,'include':_0x63d759[_0x8538('0x1b')]?_0x63d759[_0x8538('0x1b')]['include']?_['map'](_0x63d759[_0x8538('0x1b')][_0x8538('0x20')],function(_0x40bfef){return{'model':db[_0x40bfef[_0x8538('0x21')]],'as':_0x40bfef['as'],'attributes':_0x40bfef[_0x8538('0x1e')],'include':_0x40bfef[_0x8538('0x20')]?_[_0x8538('0x22')](_0x40bfef[_0x8538('0x20')],function(_0x5ae13f){return{'model':db[_0x5ae13f[_0x8538('0x21')]],'as':_0x5ae13f['as'],'attributes':_0x5ae13f['attributes'],'include':_0x5ae13f[_0x8538('0x20')]?_[_0x8538('0x22')](_0x5ae13f[_0x8538('0x20')],function(_0x131eb2){return{'model':db[_0x131eb2['model']],'as':_0x131eb2['as'],'attributes':_0x131eb2[_0x8538('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ab91){logger[_0x8538('0x10')]('GetChatQueue',_0x63d759);logger[_0x8538('0x12')](_0x8538('0x19'),_0x63d759,JSON[_0x8538('0x13')](_0x40ab91));_0x5f02ef(_0x40ab91);})['catch'](function(_0x47b7ff){logger['error'](_0x8538('0x19'),_0x47b7ff[_0x8538('0x16')],_0x63d759);_0x3042eb(_0x553581['error'](0x1f4,_0x47b7ff[_0x8538('0x16')]));});});};exports[_0x8538('0x23')]=function(_0x115763){var _0x1c1ea2=this;return new Promise(function(_0x1b69ac,_0x324ebb){return db[_0x8538('0x1a')][_0x8538('0x24')]({'raw':_0x115763['options']?_0x115763[_0x8538('0x1b')][_0x8538('0x1c')]===undefined?!![]:![]:!![],'where':_0x115763[_0x8538('0x1b')]?_0x115763['options'][_0x8538('0x1d')]||null:null,'attributes':_0x115763[_0x8538('0x1b')]?_0x115763[_0x8538('0x1b')]['attributes']||null:null,'include':_0x115763[_0x8538('0x1b')]?_0x115763[_0x8538('0x1b')]['include']?_[_0x8538('0x22')](_0x115763[_0x8538('0x1b')][_0x8538('0x20')],function(_0x16a7f2){return{'model':db[_0x16a7f2[_0x8538('0x21')]],'as':_0x16a7f2['as'],'attributes':_0x16a7f2[_0x8538('0x1e')],'include':_0x16a7f2[_0x8538('0x20')]?_[_0x8538('0x22')](_0x16a7f2[_0x8538('0x20')],function(_0x551018){return{'model':db[_0x551018[_0x8538('0x21')]],'as':_0x551018['as'],'attributes':_0x551018[_0x8538('0x1e')],'include':_0x551018[_0x8538('0x20')]?_['map'](_0x551018[_0x8538('0x20')],function(_0x46b048){return{'model':db[_0x46b048[_0x8538('0x21')]],'as':_0x46b048['as'],'attributes':_0x46b048['attributes']};}):[]};}):[]};}):[]:[]})[_0x8538('0xf')](function(_0x5c7173){logger[_0x8538('0x10')](_0x8538('0x23'),_0x115763);logger['debug'](_0x8538('0x23'),_0x115763,JSON['stringify'](_0x5c7173));_0x1b69ac(_0x5c7173);})[_0x8538('0x18')](function(_0x34c256){logger[_0x8538('0x14')](_0x8538('0x23'),_0x34c256[_0x8538('0x16')],_0x115763);_0x324ebb(_0x1c1ea2['error'](0x1f4,_0x34c256[_0x8538('0x16')]));});});}; \ No newline at end of file +var _0xfb9c=['request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetChatQueue','debug','ShowChatQueue','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s'];(function(_0x157c7b,_0x199a92){var _0x37b43e=function(_0x352a1d){while(--_0x352a1d){_0x157c7b['push'](_0x157c7b['shift']());}};_0x37b43e(++_0x199a92);}(_0xfb9c,0xb2));var _0xcfb9=function(_0x391bce,_0x4dcec1){_0x391bce=_0x391bce-0x0;var _0x14075b=_0xfb9c[_0x391bce];return _0x14075b;};'use strict';var _=require('lodash');var util=require(_0xcfb9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfb9('0x1'));var fs=require('fs');var Redis=require(_0xcfb9('0x2'));var db=require(_0xcfb9('0x3'))['db'];var utils=require(_0xcfb9('0x4'));var logger=require(_0xcfb9('0x5'))(_0xcfb9('0x6'));var config=require(_0xcfb9('0x7'));var jayson=require(_0xcfb9('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xcfb9('0x9')]=_[_0xcfb9('0xa')](config[_0xcfb9('0x9')],{'host':_0xcfb9('0xb'),'port':0x18eb});var socket=require(_0xcfb9('0xc'))(new Redis(config[_0xcfb9('0x9')]));require('./chatQueue.socket')[_0xcfb9('0xd')](socket);function respondWithRpcPromise(_0x16621a,_0x39fed6,_0x57b0c5){return new BPromise(function(_0xe54889,_0x4857e5){return client[_0xcfb9('0xe')](_0x16621a,_0x57b0c5)['then'](function(_0x208fe2){logger[_0xcfb9('0xf')](_0xcfb9('0x10'),_0x39fed6,_0xcfb9('0x11'));logger['debug'](_0xcfb9('0x12'),_0x39fed6,'request\x20sent',JSON[_0xcfb9('0x13')](_0x208fe2));if(_0x208fe2[_0xcfb9('0x14')]){if(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x15')]===0x1f4){logger[_0xcfb9('0x14')](_0xcfb9('0x10'),_0x39fed6,_0x208fe2['error'][_0xcfb9('0x16')]);return _0x4857e5(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x16')]);}logger[_0xcfb9('0x14')]('ChatQueue,\x20%s,\x20%s',_0x39fed6,_0x208fe2['error'][_0xcfb9('0x16')]);return _0xe54889(_0x208fe2[_0xcfb9('0x14')][_0xcfb9('0x16')]);}else{logger[_0xcfb9('0xf')](_0xcfb9('0x10'),_0x39fed6,_0xcfb9('0x11'));_0xe54889(_0x208fe2[_0xcfb9('0x17')][_0xcfb9('0x16')]);}})[_0xcfb9('0x18')](function(_0x18cd13){logger['error'](_0xcfb9('0x10'),_0x39fed6,_0x18cd13);_0x4857e5(_0x18cd13);});});}exports['GetChatQueue']=function(_0x1a173c){var _0x1102d2=this;return new Promise(function(_0x493891,_0x4d591e){return db[_0xcfb9('0x19')][_0xcfb9('0x1a')]({'raw':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a173c['options']?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1d')]||null:null,'attributes':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c['options'][_0xcfb9('0x1e')]||null:null,'limit':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x1f')]||null:null,'include':_0x1a173c[_0xcfb9('0x1b')]?_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1a173c[_0xcfb9('0x1b')][_0xcfb9('0x20')],function(_0x55ad1f){return{'model':db[_0x55ad1f[_0xcfb9('0x22')]],'as':_0x55ad1f['as'],'attributes':_0x55ad1f[_0xcfb9('0x1e')],'include':_0x55ad1f[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x55ad1f[_0xcfb9('0x20')],function(_0x1b42e0){return{'model':db[_0x1b42e0['model']],'as':_0x1b42e0['as'],'attributes':_0x1b42e0[_0xcfb9('0x1e')],'include':_0x1b42e0[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1b42e0[_0xcfb9('0x20')],function(_0xabf0ab){return{'model':db[_0xabf0ab[_0xcfb9('0x22')]],'as':_0xabf0ab['as'],'attributes':_0xabf0ab[_0xcfb9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcfb9('0x23')](function(_0x24295f){logger['info'](_0xcfb9('0x24'),_0x1a173c);logger[_0xcfb9('0x25')]('GetChatQueue',_0x1a173c,JSON[_0xcfb9('0x13')](_0x24295f));_0x493891(_0x24295f);})['catch'](function(_0x57a0d2){logger['error'](_0xcfb9('0x24'),_0x57a0d2[_0xcfb9('0x16')],_0x1a173c);_0x4d591e(_0x1102d2['error'](0x1f4,_0x57a0d2[_0xcfb9('0x16')]));});});};exports[_0xcfb9('0x26')]=function(_0x1d15c9){var _0x33a3fe=this;return new Promise(function(_0x1a58ba,_0x22e34e){return db['ChatQueue']['find']({'raw':_0x1d15c9['options']?_0x1d15c9[_0xcfb9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9['options'][_0xcfb9('0x1d')]||null:null,'attributes':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9[_0xcfb9('0x1b')][_0xcfb9('0x1e')]||null:null,'include':_0x1d15c9[_0xcfb9('0x1b')]?_0x1d15c9['options'][_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1d15c9['options']['include'],function(_0x3873f4){return{'model':db[_0x3873f4[_0xcfb9('0x22')]],'as':_0x3873f4['as'],'attributes':_0x3873f4[_0xcfb9('0x1e')],'include':_0x3873f4[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x3873f4[_0xcfb9('0x20')],function(_0x1b52a7){return{'model':db[_0x1b52a7['model']],'as':_0x1b52a7['as'],'attributes':_0x1b52a7[_0xcfb9('0x1e')],'include':_0x1b52a7[_0xcfb9('0x20')]?_[_0xcfb9('0x21')](_0x1b52a7[_0xcfb9('0x20')],function(_0x110cd0){return{'model':db[_0x110cd0[_0xcfb9('0x22')]],'as':_0x110cd0['as'],'attributes':_0x110cd0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x337af3){logger['info']('ShowChatQueue',_0x1d15c9);logger[_0xcfb9('0x25')](_0xcfb9('0x26'),_0x1d15c9,JSON[_0xcfb9('0x13')](_0x337af3));_0x1a58ba(_0x337af3);})[_0xcfb9('0x18')](function(_0x89d53b){logger['error'](_0xcfb9('0x26'),_0x89d53b[_0xcfb9('0x16')],_0x1d15c9);_0x22e34e(_0x33a3fe['error'](0x1f4,_0x89d53b[_0xcfb9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6e7dd98..63c5891 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 _0x4fdb=['removeListener','length','./chatQueue.events','save','remove','update','emit'];(function(_0x478a19,_0x2ff359){var _0x7fd2fa=function(_0x2aeb50){while(--_0x2aeb50){_0x478a19['push'](_0x478a19['shift']());}};_0x7fd2fa(++_0x2ff359);}(_0x4fdb,0x9c));var _0xb4fd=function(_0xd80198,_0xab6a0){_0xd80198=_0xd80198-0x0;var _0x54853a=_0x4fdb[_0xd80198];return _0x54853a;};'use strict';var ChatQueueEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatQueueEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatQueue:'+_0x3af8e3,_0x14052b);ChatQueueEvents['on'](_0x3af8e3,_0x1151b5);}}; \ No newline at end of file +var _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x540d50,_0x439d8e){var _0x1005ae=function(_0x4c3a22){while(--_0x4c3a22){_0x540d50['push'](_0x540d50['shift']());}};_0x1005ae(++_0x439d8e);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x4b84[_0x3f4dd9];return _0x31c54a;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6d2a47c..efea824 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x401b06,_0x4a7a8e){_0x401b06=_0x401b06-0x0;var _0x253e64=_0x3e74[_0x401b06];return _0x253e64;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x25646a,_0x21bea7){var _0x562d04=function(_0x86ce9a){while(--_0x86ce9a){_0x25646a['push'](_0x25646a['shift']());}};_0x562d04(++_0x21bea7);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 7585ff7..c63fd96 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 _0xb695=['moment','sequelize','exports','STRING','DATE'];(function(_0x289794,_0xa39495){var _0x4c9b2b=function(_0x477bac){while(--_0x477bac){_0x289794['push'](_0x289794['shift']());}};_0x4c9b2b(++_0xa39495);}(_0xb695,0x1d6));var _0x5b69=function(_0xe46fe1,_0x3f8dad){_0xe46fe1=_0xe46fe1-0x0;var _0x16c891=_0xb695[_0xe46fe1];return _0x16c891;};'use strict';var moment=require(_0x5b69('0x0'));var Sequelize=require(_0x5b69('0x1'));module[_0x5b69('0x2')]={'uniqueid':{'type':Sequelize[_0x5b69('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5b69('0x3')]},'joinAt':{'type':Sequelize[_0x5b69('0x4')]},'leaveAt':{'type':Sequelize[_0x5b69('0x4')]},'acceptAt':{'type':Sequelize[_0x5b69('0x4')]},'exitAt':{'type':Sequelize[_0x5b69('0x4')]},'reason':{'type':Sequelize[_0x5b69('0x3')]}}; \ No newline at end of file +var _0xc01b=['DATE','moment','sequelize','exports','STRING'];(function(_0x561bd8,_0x2458de){var _0x355db5=function(_0x2d221b){while(--_0x2d221b){_0x561bd8['push'](_0x561bd8['shift']());}};_0x355db5(++_0x2458de);}(_0xc01b,0x74));var _0xbc01=function(_0x739cba,_0x2681a7){_0x739cba=_0x739cba-0x0;var _0x2d07d5=_0xc01b[_0x739cba];return _0x2d07d5;};'use strict';var moment=require(_0xbc01('0x0'));var Sequelize=require(_0xbc01('0x1'));module[_0xbc01('0x2')]={'uniqueid':{'type':Sequelize[_0xbc01('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbc01('0x3')]},'joinAt':{'type':Sequelize[_0xbc01('0x4')]},'leaveAt':{'type':Sequelize[_0xbc01('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbc01('0x4')]},'reason':{'type':Sequelize[_0xbc01('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index bc2b45f..f496d88 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 _0xb7f0=['fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x56eb89,_0xa70f63){_0x56eb89=_0x56eb89-0x0;var _0x237f9d=_0xb7f0[_0x56eb89];return _0x237f9d;};'use strict';var emlformat=require(_0x0b7f('0x0'));var rimraf=require(_0x0b7f('0x1'));var zipdir=require(_0x0b7f('0x2'));var jsonpatch=require(_0x0b7f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b7f('0x4'));var Mustache=require(_0x0b7f('0x5'));var util=require(_0x0b7f('0x6'));var path=require(_0x0b7f('0x7'));var sox=require(_0x0b7f('0x8'));var csv=require(_0x0b7f('0x9'));var ejs=require(_0x0b7f('0xa'));var fs=require('fs');var fs_extra=require(_0x0b7f('0xb'));var _=require(_0x0b7f('0xc'));var squel=require(_0x0b7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x0b7f('0xe'));var deskjs=require(_0x0b7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b7f('0x10'));var Papa=require(_0x0b7f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b7f('0x12'));var hardwareService=require(_0x0b7f('0x13'));var logger=require(_0x0b7f('0x14'))(_0x0b7f('0x15'));var utils=require(_0x0b7f('0x16'));var config=require(_0x0b7f('0x17'));var licenseUtil=require(_0x0b7f('0x18'));var db=require(_0x0b7f('0x19'))['db'];function respondWithStatusCode(_0x1af907,_0x34121a){_0x34121a=_0x34121a||0xcc;return function(_0x930432){if(_0x930432){return _0x1af907['sendStatus'](_0x34121a);}return _0x1af907[_0x0b7f('0x1a')](_0x34121a)[_0x0b7f('0x1b')]();};}function respondWithResult(_0x1e3f86,_0x19ddf2){_0x19ddf2=_0x19ddf2||0xc8;return function(_0x294db5){if(_0x294db5){return _0x1e3f86[_0x0b7f('0x1a')](_0x19ddf2)[_0x0b7f('0x1c')](_0x294db5);}};}function respondWithFilteredResult(_0x18069a,_0x5a2b0b){return function(_0x20e15d){if(_0x20e15d){var _0x1d223f=typeof _0x5a2b0b[_0x0b7f('0x1d')]===_0x0b7f('0x1e')&&typeof _0x5a2b0b['limit']===_0x0b7f('0x1e');var _0x3f6463=_0x20e15d[_0x0b7f('0x1f')];var _0x168e7e=_0x1d223f?0x0:_0x5a2b0b[_0x0b7f('0x1d')];var _0x50cee2=_0x1d223f?_0x20e15d[_0x0b7f('0x1f')]:_0x5a2b0b['offset']+_0x5a2b0b['limit'];var _0x36a619;if(_0x50cee2>=_0x3f6463){_0x50cee2=_0x3f6463;_0x36a619=0xc8;}else{_0x36a619=0xce;}_0x18069a[_0x0b7f('0x1a')](_0x36a619);return _0x18069a[_0x0b7f('0x20')](_0x0b7f('0x21'),_0x168e7e+'-'+_0x50cee2+'/'+_0x3f6463)[_0x0b7f('0x1c')](_0x20e15d);}return null;};}function patchUpdates(_0x52abc6){return function(_0x55362c){try{jsonpatch[_0x0b7f('0x22')](_0x55362c,_0x52abc6,!![]);}catch(_0x3ca024){return BPromise[_0x0b7f('0x23')](_0x3ca024);}return _0x55362c['save']();};}function saveUpdates(_0xb130f0,_0x1ec1d3){return function(_0x26f974){if(_0x26f974){return _0x26f974[_0x0b7f('0x24')](_0xb130f0)[_0x0b7f('0x25')](function(_0x44a0ae){return _0x44a0ae;});}return null;};}function removeEntity(_0x459389,_0x45ab0e){return function(_0xc74a5d){if(_0xc74a5d){return _0xc74a5d['destroy']()[_0x0b7f('0x25')](function(){_0x459389[_0x0b7f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50776a,_0x4a2841){return function(_0x37a5e5){if(!_0x37a5e5){_0x50776a[_0x0b7f('0x26')](0x194);}return _0x37a5e5;};}function handleError(_0x4e61be,_0xd3cb99){_0xd3cb99=_0xd3cb99||0x1f4;return function(_0x3cda59){logger[_0x0b7f('0x27')](_0x3cda59[_0x0b7f('0x28')]);if(_0x3cda59[_0x0b7f('0x29')]){delete _0x3cda59[_0x0b7f('0x29')];}_0x4e61be[_0x0b7f('0x1a')](_0xd3cb99)[_0x0b7f('0x2a')](_0x3cda59);};}exports[_0x0b7f('0x2b')]=function(_0x4ae467,_0x599bae){var _0x4ada58={},_0x3ea675={},_0x4f7e74={'count':0x0,'rows':[]};var _0x34b54c=_[_0x0b7f('0x2c')](db[_0x0b7f('0x2d')][_0x0b7f('0x2e')],function(_0x2d4727){return{'name':_0x2d4727[_0x0b7f('0x2f')],'type':_0x2d4727[_0x0b7f('0x30')]['key']};});_0x3ea675['model']=_[_0x0b7f('0x2c')](_0x34b54c,'name');_0x3ea675[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x4ae467[_0x0b7f('0x31')]);_0x3ea675[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x3ea675[_0x0b7f('0x35')],_0x3ea675[_0x0b7f('0x31')]);_0x4ada58[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x3ea675['model'],qs['fields'](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x4ada58[_0x0b7f('0x36')]=_0x4ada58[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x4ada58[_0x0b7f('0x36')]:_0x3ea675[_0x0b7f('0x35')];if(!_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x39')]('nolimit')){_0x4ada58['limit']=qs[_0x0b7f('0x3a')](_0x4ae467['query'][_0x0b7f('0x3a')]);_0x4ada58['offset']=qs[_0x0b7f('0x1d')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x1d')]);}_0x4ada58[_0x0b7f('0x3b')]=qs[_0x0b7f('0x3c')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x3c')]);_0x4ada58[_0x0b7f('0x3d')]=qs[_0x0b7f('0x33')](_['pick'](_0x4ae467['query'],_0x3ea675['filters']),_0x34b54c);if(_0x4ae467[_0x0b7f('0x31')]['filter']){_0x4ada58[_0x0b7f('0x3d')]=_[_0x0b7f('0x3e')](_0x4ada58[_0x0b7f('0x3d')],{'$or':_[_0x0b7f('0x2c')](_0x34b54c,function(_0x1e2f6c){if(_0x1e2f6c['type']!==_0x0b7f('0x3f')){var _0x2eafb6={};_0x2eafb6[_0x1e2f6c[_0x0b7f('0x29')]]={'$like':'%'+_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x40')]+'%'};return _0x2eafb6;}})});}_0x4ada58=_['merge']({},_0x4ada58,_0x4ae467[_0x0b7f('0x41')]);var _0x2f5351={'where':_0x4ada58[_0x0b7f('0x3d')]};return db[_0x0b7f('0x2d')][_0x0b7f('0x1f')](_0x2f5351)[_0x0b7f('0x25')](function(_0x40b1c5){_0x4f7e74[_0x0b7f('0x1f')]=_0x40b1c5;if(_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x4ada58[_0x0b7f('0x43')]=[{'all':!![]}];}return db[_0x0b7f('0x2d')][_0x0b7f('0x44')](_0x4ada58);})['then'](function(_0x4aaf15){_0x4f7e74[_0x0b7f('0x45')]=_0x4aaf15;return _0x4f7e74;})[_0x0b7f('0x25')](respondWithFilteredResult(_0x599bae,_0x4ada58))[_0x0b7f('0x46')](handleError(_0x599bae,null));};exports[_0x0b7f('0x47')]=function(_0x2c25fc,_0x230c6b){var _0x57c147={'raw':!![],'where':{'id':_0x2c25fc[_0x0b7f('0x48')]['id']}},_0x2176c6={};_0x2176c6[_0x0b7f('0x35')]=_[_0x0b7f('0x32')](db['ChatQueueReport'][_0x0b7f('0x2e')]);_0x2176c6['query']=_[_0x0b7f('0x32')](_0x2c25fc[_0x0b7f('0x31')]);_0x2176c6[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],_0x2176c6['query']);_0x57c147[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],qs[_0x0b7f('0x37')](_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x57c147[_0x0b7f('0x36')]=_0x57c147[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x57c147[_0x0b7f('0x36')]:_0x2176c6[_0x0b7f('0x35')];if(_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x57c147['include']=[{'all':!![]}];}_0x57c147=_[_0x0b7f('0x3e')]({},_0x57c147,_0x2c25fc[_0x0b7f('0x41')]);return db[_0x0b7f('0x2d')][_0x0b7f('0x49')](_0x57c147)[_0x0b7f('0x25')](handleEntityNotFound(_0x230c6b,null))[_0x0b7f('0x25')](respondWithResult(_0x230c6b,null))[_0x0b7f('0x46')](handleError(_0x230c6b,null));};exports['create']=function(_0x4d432b,_0x562843){return db[_0x0b7f('0x2d')][_0x0b7f('0x4a')](_0x4d432b['body'],{})[_0x0b7f('0x25')](respondWithResult(_0x562843,0xc9))[_0x0b7f('0x46')](handleError(_0x562843,null));};exports['update']=function(_0x2469e2,_0x4a825c){if(_0x2469e2[_0x0b7f('0x4b')]['id']){delete _0x2469e2['body']['id'];}return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x2469e2[_0x0b7f('0x48')]['id']}})[_0x0b7f('0x25')](handleEntityNotFound(_0x4a825c,null))[_0x0b7f('0x25')](saveUpdates(_0x2469e2[_0x0b7f('0x4b')],null))[_0x0b7f('0x25')](respondWithResult(_0x4a825c,null))[_0x0b7f('0x46')](handleError(_0x4a825c,null));};exports[_0x0b7f('0x4c')]=function(_0x3cfa81,_0x23e3ef){return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x3cfa81[_0x0b7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e3ef,null))[_0x0b7f('0x25')](removeEntity(_0x23e3ef,null))[_0x0b7f('0x46')](handleError(_0x23e3ef,null));};exports[_0x0b7f('0x4d')]=function(_0xe820e0,_0xbad1cd){return db[_0x0b7f('0x2d')]['describe']()[_0x0b7f('0x25')](respondWithResult(_0xbad1cd,null))['catch'](handleError(_0xbad1cd,null));}; \ No newline at end of file +var _0x18af=['sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','show','length','options','find','catch','create','body','describe','eml-format','zip-dir','request-promise','util','path'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x18af,0x8b));var _0xf18a=function(_0x5329cd,_0x40c336){_0x5329cd=_0x5329cd-0x0;var _0x5d4285=_0x18af[_0x5329cd];return _0x5d4285;};'use strict';var emlformat=require(_0xf18a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf18a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf18a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf18a('0x3'));var path=require(_0xf18a('0x4'));var sox=require(_0xf18a('0x5'));var csv=require(_0xf18a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf18a('0x7'));var _=require(_0xf18a('0x8'));var squel=require(_0xf18a('0x9'));var crypto=require('crypto');var jsforce=require(_0xf18a('0xa'));var deskjs=require(_0xf18a('0xb'));var toCsv=require(_0xf18a('0x6'));var querystring=require(_0xf18a('0xc'));var Papa=require(_0xf18a('0xd'));var Redis=require(_0xf18a('0xe'));var authService=require(_0xf18a('0xf'));var qs=require(_0xf18a('0x10'));var as=require(_0xf18a('0x11'));var hardwareService=require(_0xf18a('0x12'));var logger=require(_0xf18a('0x13'))(_0xf18a('0x14'));var utils=require(_0xf18a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf18a('0x16'));var db=require(_0xf18a('0x17'))['db'];function respondWithStatusCode(_0x252333,_0x12c907){_0x12c907=_0x12c907||0xcc;return function(_0x18901a){if(_0x18901a){return _0x252333['sendStatus'](_0x12c907);}return _0x252333[_0xf18a('0x18')](_0x12c907)[_0xf18a('0x19')]();};}function respondWithResult(_0x4bfc63,_0x13b3cd){_0x13b3cd=_0x13b3cd||0xc8;return function(_0x5a06b5){if(_0x5a06b5){return _0x4bfc63[_0xf18a('0x18')](_0x13b3cd)[_0xf18a('0x1a')](_0x5a06b5);}};}function respondWithFilteredResult(_0x52dc2c,_0x1f35a4){return function(_0x5f2973){if(_0x5f2973){var _0x39fe13=typeof _0x1f35a4[_0xf18a('0x1b')]==='undefined'&&typeof _0x1f35a4['limit']===_0xf18a('0x1c');var _0x23c8f1=_0x5f2973['count'];var _0x5e3da3=_0x39fe13?0x0:_0x1f35a4[_0xf18a('0x1b')];var _0x1aff7c=_0x39fe13?_0x5f2973[_0xf18a('0x1d')]:_0x1f35a4['offset']+_0x1f35a4[_0xf18a('0x1e')];var _0x4a348e;if(_0x1aff7c>=_0x23c8f1){_0x1aff7c=_0x23c8f1;_0x4a348e=0xc8;}else{_0x4a348e=0xce;}_0x52dc2c[_0xf18a('0x18')](_0x4a348e);return _0x52dc2c[_0xf18a('0x1f')]('Content-Range',_0x5e3da3+'-'+_0x1aff7c+'/'+_0x23c8f1)[_0xf18a('0x1a')](_0x5f2973);}return null;};}function patchUpdates(_0x340d94){return function(_0x533acb){try{jsonpatch[_0xf18a('0x20')](_0x533acb,_0x340d94,!![]);}catch(_0x42854d){return BPromise[_0xf18a('0x21')](_0x42854d);}return _0x533acb['save']();};}function saveUpdates(_0x516e7f,_0x43a50a){return function(_0x4438ed){if(_0x4438ed){return _0x4438ed[_0xf18a('0x22')](_0x516e7f)[_0xf18a('0x23')](function(_0x1ad933){return _0x1ad933;});}return null;};}function removeEntity(_0x23d2a7,_0x112466){return function(_0x304bd4){if(_0x304bd4){return _0x304bd4[_0xf18a('0x24')]()['then'](function(){_0x23d2a7[_0xf18a('0x18')](0xcc)[_0xf18a('0x19')]();});}};}function handleEntityNotFound(_0x179b4e,_0x30609e){return function(_0x5dd917){if(!_0x5dd917){_0x179b4e[_0xf18a('0x25')](0x194);}return _0x5dd917;};}function handleError(_0x277677,_0x32c040){_0x32c040=_0x32c040||0x1f4;return function(_0x4f540d){logger[_0xf18a('0x26')](_0x4f540d[_0xf18a('0x27')]);if(_0x4f540d[_0xf18a('0x28')]){delete _0x4f540d[_0xf18a('0x28')];}_0x277677['status'](_0x32c040)[_0xf18a('0x29')](_0x4f540d);};}exports[_0xf18a('0x2a')]=function(_0x53ba5b,_0x49efea){var _0xa8e81c={},_0x14183c={},_0x7e668c={'count':0x0,'rows':[]};var _0xdc0fe9=_['map'](db[_0xf18a('0x2b')][_0xf18a('0x2c')],function(_0x3a70a2){return{'name':_0x3a70a2[_0xf18a('0x2d')],'type':_0x3a70a2[_0xf18a('0x2e')][_0xf18a('0x2f')]};});_0x14183c['model']=_['map'](_0xdc0fe9,_0xf18a('0x28'));_0x14183c[_0xf18a('0x30')]=_[_0xf18a('0x31')](_0x53ba5b['query']);_0x14183c['filters']=_[_0xf18a('0x32')](_0x14183c[_0xf18a('0x33')],_0x14183c[_0xf18a('0x30')]);_0xa8e81c[_0xf18a('0x34')]=_[_0xf18a('0x32')](_0x14183c[_0xf18a('0x33')],qs['fields'](_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x35')]));_0xa8e81c['attributes']=_0xa8e81c[_0xf18a('0x34')]['length']?_0xa8e81c[_0xf18a('0x34')]:_0x14183c[_0xf18a('0x33')];if(!_0x53ba5b['query']['hasOwnProperty'](_0xf18a('0x36'))){_0xa8e81c[_0xf18a('0x1e')]=qs[_0xf18a('0x1e')](_0x53ba5b[_0xf18a('0x30')]['limit']);_0xa8e81c[_0xf18a('0x1b')]=qs[_0xf18a('0x1b')](_0x53ba5b['query'][_0xf18a('0x1b')]);}_0xa8e81c[_0xf18a('0x37')]=qs[_0xf18a('0x38')](_0x53ba5b['query']['sort']);_0xa8e81c[_0xf18a('0x39')]=qs[_0xf18a('0x3a')](_[_0xf18a('0x3b')](_0x53ba5b[_0xf18a('0x30')],_0x14183c[_0xf18a('0x3a')]),_0xdc0fe9);if(_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x3c')]){_0xa8e81c[_0xf18a('0x39')]=_[_0xf18a('0x3d')](_0xa8e81c[_0xf18a('0x39')],{'$or':_['map'](_0xdc0fe9,function(_0x409c31){if(_0x409c31[_0xf18a('0x2e')]!=='VIRTUAL'){var _0x34dd7a={};_0x34dd7a[_0x409c31['name']]={'$like':'%'+_0x53ba5b[_0xf18a('0x30')][_0xf18a('0x3c')]+'%'};return _0x34dd7a;}})});}_0xa8e81c=_[_0xf18a('0x3d')]({},_0xa8e81c,_0x53ba5b['options']);var _0x366399={'where':_0xa8e81c[_0xf18a('0x39')]};return db['ChatQueueReport'][_0xf18a('0x1d')](_0x366399)[_0xf18a('0x23')](function(_0x278b77){_0x7e668c['count']=_0x278b77;if(_0x53ba5b['query'][_0xf18a('0x3e')]){_0xa8e81c[_0xf18a('0x3f')]=[{'all':!![]}];}return db[_0xf18a('0x2b')]['findAll'](_0xa8e81c);})[_0xf18a('0x23')](function(_0x1ddbeb){_0x7e668c['rows']=_0x1ddbeb;return _0x7e668c;})[_0xf18a('0x23')](respondWithFilteredResult(_0x49efea,_0xa8e81c))['catch'](handleError(_0x49efea,null));};exports[_0xf18a('0x40')]=function(_0x2d77d2,_0x356646){var _0x19d080={'raw':!![],'where':{'id':_0x2d77d2['params']['id']}},_0x8564e4={};_0x8564e4[_0xf18a('0x33')]=_[_0xf18a('0x31')](db[_0xf18a('0x2b')][_0xf18a('0x2c')]);_0x8564e4[_0xf18a('0x30')]=_[_0xf18a('0x31')](_0x2d77d2[_0xf18a('0x30')]);_0x8564e4['filters']=_[_0xf18a('0x32')](_0x8564e4[_0xf18a('0x33')],_0x8564e4[_0xf18a('0x30')]);_0x19d080[_0xf18a('0x34')]=_[_0xf18a('0x32')](_0x8564e4['model'],qs[_0xf18a('0x35')](_0x2d77d2[_0xf18a('0x30')]['fields']));_0x19d080[_0xf18a('0x34')]=_0x19d080[_0xf18a('0x34')][_0xf18a('0x41')]?_0x19d080[_0xf18a('0x34')]:_0x8564e4[_0xf18a('0x33')];if(_0x2d77d2['query']['includeAll']){_0x19d080['include']=[{'all':!![]}];}_0x19d080=_['merge']({},_0x19d080,_0x2d77d2[_0xf18a('0x42')]);return db[_0xf18a('0x2b')][_0xf18a('0x43')](_0x19d080)[_0xf18a('0x23')](handleEntityNotFound(_0x356646,null))[_0xf18a('0x23')](respondWithResult(_0x356646,null))[_0xf18a('0x44')](handleError(_0x356646,null));};exports[_0xf18a('0x45')]=function(_0x50e1c0,_0x2410b5){return db[_0xf18a('0x2b')]['create'](_0x50e1c0[_0xf18a('0x46')],{})[_0xf18a('0x23')](respondWithResult(_0x2410b5,0xc9))[_0xf18a('0x44')](handleError(_0x2410b5,null));};exports[_0xf18a('0x22')]=function(_0xad78b2,_0x3688e0){if(_0xad78b2[_0xf18a('0x46')]['id']){delete _0xad78b2['body']['id'];}return db[_0xf18a('0x2b')][_0xf18a('0x43')]({'where':{'id':_0xad78b2['params']['id']}})[_0xf18a('0x23')](handleEntityNotFound(_0x3688e0,null))[_0xf18a('0x23')](saveUpdates(_0xad78b2[_0xf18a('0x46')],null))[_0xf18a('0x23')](respondWithResult(_0x3688e0,null))['catch'](handleError(_0x3688e0,null));};exports[_0xf18a('0x24')]=function(_0x183448,_0xccde4){return db[_0xf18a('0x2b')][_0xf18a('0x43')]({'where':{'id':_0x183448['params']['id']}})[_0xf18a('0x23')](handleEntityNotFound(_0xccde4,null))[_0xf18a('0x23')](removeEntity(_0xccde4,null))[_0xf18a('0x44')](handleError(_0xccde4,null));};exports[_0xf18a('0x47')]=function(_0x3645c2,_0x2b2a4d){return db[_0xf18a('0x2b')][_0xf18a('0x47')]()[_0xf18a('0x23')](respondWithResult(_0x2b2a4d,null))[_0xf18a('0x44')](handleError(_0x2b2a4d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9dec065..bde68a5 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_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':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55bfd6,_0xdfa6ce){var _0x5e9f68=function(_0x34c77c){while(--_0x34c77c){_0x55bfd6['push'](_0x55bfd6['shift']());}};_0x5e9f68(++_0xdfa6ce);}(_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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d694e56..afc4a81 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 _0x1101=['../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','body','catch','UpdateChatQueueReport','ChatQueueReport','update','options','raw','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x135720,_0x182012){var _0x89c4d2=function(_0x35c57d){while(--_0x35c57d){_0x135720['push'](_0x135720['shift']());}};_0x89c4d2(++_0x182012);}(_0x1101,0x99));var _0x1110=function(_0x4a25d7,_0x15be45){_0x4a25d7=_0x4a25d7-0x0;var _0x40d155=_0x1101[_0x4a25d7];return _0x40d155;};'use strict';var _=require(_0x1110('0x0'));var util=require('util');var moment=require(_0x1110('0x1'));var BPromise=require(_0x1110('0x2'));var rs=require(_0x1110('0x3'));var fs=require('fs');var Redis=require(_0x1110('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1110('0x5'));var logger=require(_0x1110('0x6'))('rpc');var config=require(_0x1110('0x7'));var jayson=require(_0x1110('0x8'));var client=jayson['client'][_0x1110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544fff,_0x76bdc0,_0x4372d4){return new BPromise(function(_0x509c14,_0x22c4db){return client[_0x1110('0xa')](_0x544fff,_0x4372d4)[_0x1110('0xb')](function(_0x476e9e){logger[_0x1110('0xc')](_0x1110('0xd'),_0x76bdc0,_0x1110('0xe'));logger[_0x1110('0xf')](_0x1110('0x10'),_0x76bdc0,_0x1110('0xe'),JSON[_0x1110('0x11')](_0x476e9e));if(_0x476e9e[_0x1110('0x12')]){if(_0x476e9e[_0x1110('0x12')][_0x1110('0x13')]===0x1f4){logger[_0x1110('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x76bdc0,_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);return _0x22c4db(_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);}logger[_0x1110('0x12')](_0x1110('0xd'),_0x76bdc0,_0x476e9e['error'][_0x1110('0x14')]);return _0x509c14(_0x476e9e[_0x1110('0x12')][_0x1110('0x14')]);}else{logger[_0x1110('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x76bdc0,_0x1110('0xe'));_0x509c14(_0x476e9e[_0x1110('0x15')][_0x1110('0x14')]);}})['catch'](function(_0x13621b){logger[_0x1110('0x12')](_0x1110('0xd'),_0x76bdc0,_0x13621b);_0x22c4db(_0x13621b);});});}exports[_0x1110('0x16')]=function(_0x102287){var _0x52a83e=this;return new Promise(function(_0x2345af,_0x1f7d82){return db['ChatQueueReport']['create'](_0x102287[_0x1110('0x17')],{'raw':_0x102287['options']?_0x102287['options']['raw']===undefined?!![]:![]:!![]})[_0x1110('0xb')](function(_0x577863){logger[_0x1110('0xc')](_0x1110('0x16'),_0x102287);logger[_0x1110('0xf')](_0x1110('0x16'),_0x102287,JSON[_0x1110('0x11')](_0x577863));_0x2345af(_0x577863);})[_0x1110('0x18')](function(_0x61a5b2){logger['error']('CreateChatQueueReport',_0x61a5b2[_0x1110('0x14')],_0x102287);_0x1f7d82(_0x52a83e[_0x1110('0x12')](0x1f4,_0x61a5b2[_0x1110('0x14')]));});});};exports[_0x1110('0x19')]=function(_0x341097){var _0x18d057=this;return new Promise(function(_0x47d3d5,_0xd185c9){return db[_0x1110('0x1a')][_0x1110('0x1b')](_0x341097['body'],{'raw':_0x341097[_0x1110('0x1c')]?_0x341097[_0x1110('0x1c')][_0x1110('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341097[_0x1110('0x1c')]?_0x341097['options'][_0x1110('0x1e')]||null:null,'attributes':_0x341097[_0x1110('0x1c')]?_0x341097[_0x1110('0x1c')]['attributes']||null:null,'limit':_0x341097[_0x1110('0x1c')]?_0x341097['options'][_0x1110('0x1f')]||null:null})['then'](function(_0x1814c3){logger[_0x1110('0xc')]('UpdateChatQueueReport',_0x341097);logger[_0x1110('0xf')]('UpdateChatQueueReport',_0x341097,JSON[_0x1110('0x11')](_0x1814c3));_0x47d3d5(_0x1814c3);})[_0x1110('0x18')](function(_0x3d10c0){logger[_0x1110('0x12')](_0x1110('0x19'),_0x3d10c0[_0x1110('0x14')],_0x341097);_0xd185c9(_0x18d057['error'](0x1f4,_0x3d10c0[_0x1110('0x14')]));});});}; \ No newline at end of file +var _0x69af=['where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','options','raw','debug','UpdateChatQueueReport','update'];(function(_0x1817e5,_0x5c6b3d){var _0x2dc10c=function(_0x11eff6){while(--_0x11eff6){_0x1817e5['push'](_0x1817e5['shift']());}};_0x2dc10c(++_0x5c6b3d);}(_0x69af,0x17b));var _0xf69a=function(_0x54cbe4,_0x1ecfe8){_0x54cbe4=_0x54cbe4-0x0;var _0x4eba52=_0x69af[_0x54cbe4];return _0x4eba52;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var moment=require(_0xf69a('0x1'));var BPromise=require(_0xf69a('0x2'));var rs=require(_0xf69a('0x3'));var fs=require('fs');var Redis=require(_0xf69a('0x4'));var db=require(_0xf69a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69a('0x6'))(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var jayson=require(_0xf69a('0x9'));var client=jayson[_0xf69a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c1b0,_0x3669ef,_0xb0233d){return new BPromise(function(_0x4ffe11,_0x4a3496){return client[_0xf69a('0xb')](_0x10c1b0,_0xb0233d)[_0xf69a('0xc')](function(_0x16a06e){logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3669ef,_0xf69a('0xf'),JSON[_0xf69a('0x10')](_0x16a06e));if(_0x16a06e[_0xf69a('0x11')]){if(_0x16a06e[_0xf69a('0x11')]['code']===0x1f4){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4a3496(_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);}logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4ffe11(_0x16a06e['error'][_0xf69a('0x12')]);}else{logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,_0xf69a('0xf'));_0x4ffe11(_0x16a06e['result'][_0xf69a('0x12')]);}})[_0xf69a('0x13')](function(_0x17660b){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x17660b);_0x4a3496(_0x17660b);});});}exports[_0xf69a('0x14')]=function(_0x272ad5){var _0x4b44b6=this;return new Promise(function(_0x495b1e,_0x567906){return db[_0xf69a('0x15')]['create'](_0x272ad5['body'],{'raw':_0x272ad5['options']?_0x272ad5[_0xf69a('0x16')][_0xf69a('0x17')]===undefined?!![]:![]:!![]})[_0xf69a('0xc')](function(_0x39c67a){logger['info']('CreateChatQueueReport',_0x272ad5);logger[_0xf69a('0x18')](_0xf69a('0x14'),_0x272ad5,JSON[_0xf69a('0x10')](_0x39c67a));_0x495b1e(_0x39c67a);})[_0xf69a('0x13')](function(_0xdb0def){logger[_0xf69a('0x11')](_0xf69a('0x14'),_0xdb0def[_0xf69a('0x12')],_0x272ad5);_0x567906(_0x4b44b6['error'](0x1f4,_0xdb0def[_0xf69a('0x12')]));});});};exports[_0xf69a('0x19')]=function(_0x223fea){var _0x39111e=this;return new Promise(function(_0x2033c6,_0x451c92){return db[_0xf69a('0x15')][_0xf69a('0x1a')](_0x223fea['body'],{'raw':_0x223fea[_0xf69a('0x16')]?_0x223fea['options'][_0xf69a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')][_0xf69a('0x1b')]||null:null,'attributes':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')][_0xf69a('0x1c')]||null:null,'limit':_0x223fea[_0xf69a('0x16')]?_0x223fea[_0xf69a('0x16')]['limit']||null:null})['then'](function(_0x179040){logger['info']('UpdateChatQueueReport',_0x223fea);logger[_0xf69a('0x18')]('UpdateChatQueueReport',_0x223fea,JSON['stringify'](_0x179040));_0x2033c6(_0x179040);})[_0xf69a('0x13')](function(_0x431284){logger[_0xf69a('0x11')](_0xf69a('0x19'),_0x431284[_0xf69a('0x12')],_0x223fea);_0x451c92(_0x39111e[_0xf69a('0x11')](0x1f4,_0x431284[_0xf69a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index c928de6..b4031f0 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 _0xbae7=['create','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x39064b,_0xda908a){var _0x42d2c1=function(_0xa5c9e6){while(--_0xa5c9e6){_0x39064b['push'](_0x39064b['shift']());}};_0x42d2c1(++_0xda908a);}(_0xbae7,0x1bd));var _0x7bae=function(_0x822c2c,_0x3c76b1){_0x822c2c=_0x822c2c-0x0;var _0x4d43a4=_0xbae7[_0x822c2c];return _0x4d43a4;};'use strict';var multer=require(_0x7bae('0x0'));var util=require(_0x7bae('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7bae('0x2'));var router=express[_0x7bae('0x3')]();var fs_extra=require(_0x7bae('0x4'));var auth=require(_0x7bae('0x5'));var interaction=require(_0x7bae('0x6'));var config=require(_0x7bae('0x7'));var controller=require(_0x7bae('0x8'));router[_0x7bae('0x9')]('/',auth['isAuthenticated'](),controller[_0x7bae('0xa')]);router[_0x7bae('0x9')](_0x7bae('0xb'),auth[_0x7bae('0xc')](),controller[_0x7bae('0xd')]);router[_0x7bae('0x9')]('/:id',auth[_0x7bae('0xc')](),controller[_0x7bae('0xe')]);router['post']('/',auth[_0x7bae('0xc')](),controller[_0x7bae('0xf')]);router['put'](_0x7bae('0x10'),auth['isAuthenticated'](),controller[_0x7bae('0x11')]);router['delete'](_0x7bae('0x10'),auth[_0x7bae('0xc')](),controller[_0x7bae('0x12')]);module[_0x7bae('0x13')]=router; \ No newline at end of file +var _0x4acb=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','/:id','destroy','multer','util'];(function(_0x246568,_0x57af04){var _0x19b302=function(_0x4ae034){while(--_0x4ae034){_0x246568['push'](_0x246568['shift']());}};_0x19b302(++_0x57af04);}(_0x4acb,0x67));var _0xb4ac=function(_0x448047,_0x1914c0){_0x448047=_0x448047-0x0;var _0x238b19=_0x4acb[_0x448047];return _0x238b19;};'use strict';var multer=require(_0xb4ac('0x0'));var util=require(_0xb4ac('0x1'));var path=require(_0xb4ac('0x2'));var timeout=require(_0xb4ac('0x3'));var express=require(_0xb4ac('0x4'));var router=express[_0xb4ac('0x5')]();var fs_extra=require(_0xb4ac('0x6'));var auth=require(_0xb4ac('0x7'));var interaction=require(_0xb4ac('0x8'));var config=require('../../config/environment');var controller=require(_0xb4ac('0x9'));router[_0xb4ac('0xa')]('/',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0xc')]);router[_0xb4ac('0xa')](_0xb4ac('0xd'),auth[_0xb4ac('0xb')](),controller['describe']);router[_0xb4ac('0xa')]('/:id',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0xe')]);router[_0xb4ac('0xf')]('/',auth['isAuthenticated'](),controller[_0xb4ac('0x10')]);router[_0xb4ac('0x11')]('/:id',auth[_0xb4ac('0xb')](),controller[_0xb4ac('0x12')]);router['delete'](_0xb4ac('0x13'),auth[_0xb4ac('0xb')](),controller[_0xb4ac('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index a8869d8..88ae05f 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xbbefe,_0x43c85e){var _0xc277d9=function(_0xd280c1){while(--_0xd280c1){_0xbbefe['push'](_0xbbefe['shift']());}};_0xc277d9(++_0x43c85e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x37ef22,_0x348c92){_0x37ef22=_0x37ef22-0x0;var _0x49eeb3=_0xf3cd[_0x37ef22];return _0x49eeb3;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2a24ed,_0x18b9ee){var _0xefb655=function(_0x2162fa){while(--_0x2162fa){_0x2a24ed['push'](_0x2a24ed['shift']());}};_0xefb655(++_0x18b9ee);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d5c13ee..f2e0e4c 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 _0xc720=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','params','keys','find','create','body','catch','destroy','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc720,0x6b));var _0x0c72=function(_0x39925f,_0x3277e7){_0x39925f=_0x39925f-0x0;var _0x3bedb0=_0xc720[_0x39925f];return _0x3bedb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c72('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c72('0x1'));var rp=require(_0x0c72('0x2'));var moment=require(_0x0c72('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0c72('0x4'));var util=require(_0x0c72('0x5'));var path=require('path');var sox=require(_0x0c72('0x6'));var csv=require(_0x0c72('0x7'));var ejs=require(_0x0c72('0x8'));var fs=require('fs');var fs_extra=require(_0x0c72('0x9'));var _=require(_0x0c72('0xa'));var squel=require(_0x0c72('0xb'));var crypto=require(_0x0c72('0xc'));var jsforce=require(_0x0c72('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c72('0x7'));var querystring=require(_0x0c72('0xe'));var Papa=require(_0x0c72('0xf'));var Redis=require(_0x0c72('0x10'));var authService=require(_0x0c72('0x11'));var qs=require(_0x0c72('0x12'));var as=require(_0x0c72('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c72('0x14'))(_0x0c72('0x15'));var utils=require(_0x0c72('0x16'));var config=require(_0x0c72('0x17'));var licenseUtil=require(_0x0c72('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x126863,_0x4fdbcf){_0x4fdbcf=_0x4fdbcf||0xcc;return function(_0x54125f){if(_0x54125f){return _0x126863[_0x0c72('0x19')](_0x4fdbcf);}return _0x126863[_0x0c72('0x1a')](_0x4fdbcf)[_0x0c72('0x1b')]();};}function respondWithResult(_0x18f26c,_0x50608c){_0x50608c=_0x50608c||0xc8;return function(_0x540175){if(_0x540175){return _0x18f26c['status'](_0x50608c)[_0x0c72('0x1c')](_0x540175);}};}function respondWithFilteredResult(_0xca7497,_0x4f6dc0){return function(_0x338c8d){if(_0x338c8d){var _0x1f8b74=typeof _0x4f6dc0[_0x0c72('0x1d')]==='undefined'&&typeof _0x4f6dc0[_0x0c72('0x1e')]===_0x0c72('0x1f');var _0x50861c=_0x338c8d[_0x0c72('0x20')];var _0x22a5e5=_0x1f8b74?0x0:_0x4f6dc0[_0x0c72('0x1d')];var _0x20aecd=_0x1f8b74?_0x338c8d['count']:_0x4f6dc0[_0x0c72('0x1d')]+_0x4f6dc0[_0x0c72('0x1e')];var _0x825719;if(_0x20aecd>=_0x50861c){_0x20aecd=_0x50861c;_0x825719=0xc8;}else{_0x825719=0xce;}_0xca7497[_0x0c72('0x1a')](_0x825719);return _0xca7497[_0x0c72('0x21')](_0x0c72('0x22'),_0x22a5e5+'-'+_0x20aecd+'/'+_0x50861c)['json'](_0x338c8d);}return null;};}function patchUpdates(_0x5b40f5){return function(_0x1c85e2){try{jsonpatch[_0x0c72('0x23')](_0x1c85e2,_0x5b40f5,!![]);}catch(_0x3904b6){return BPromise[_0x0c72('0x24')](_0x3904b6);}return _0x1c85e2[_0x0c72('0x25')]();};}function saveUpdates(_0x15745a,_0x5738d4){return function(_0x7db1c9){if(_0x7db1c9){return _0x7db1c9[_0x0c72('0x26')](_0x15745a)[_0x0c72('0x27')](function(_0x145020){return _0x145020;});}return null;};}function removeEntity(_0x153bec,_0x4781f9){return function(_0x5ec07b){if(_0x5ec07b){return _0x5ec07b['destroy']()[_0x0c72('0x27')](function(){_0x153bec[_0x0c72('0x1a')](0xcc)[_0x0c72('0x1b')]();});}};}function handleEntityNotFound(_0x1532d1,_0x3dc2f4){return function(_0x3349e1){if(!_0x3349e1){_0x1532d1[_0x0c72('0x19')](0x194);}return _0x3349e1;};}function handleError(_0x332697,_0x1aacf3){_0x1aacf3=_0x1aacf3||0x1f4;return function(_0x192998){logger['error'](_0x192998[_0x0c72('0x28')]);if(_0x192998[_0x0c72('0x29')]){delete _0x192998[_0x0c72('0x29')];}_0x332697[_0x0c72('0x1a')](_0x1aacf3)[_0x0c72('0x2a')](_0x192998);};}exports[_0x0c72('0x2b')]=function(_0xfd6934,_0x5c4d7b){var _0x1d338e={},_0xbe2baa={},_0x17278e={'count':0x0,'rows':[]};var _0x4e0d66=_[_0x0c72('0x2c')](db['ChatTransferReport'][_0x0c72('0x2d')],function(_0x3c4a5a){return{'name':_0x3c4a5a[_0x0c72('0x2e')],'type':_0x3c4a5a[_0x0c72('0x2f')]['key']};});_0xbe2baa[_0x0c72('0x30')]=_['map'](_0x4e0d66,_0x0c72('0x29'));_0xbe2baa[_0x0c72('0x31')]=_['keys'](_0xfd6934['query']);_0xbe2baa[_0x0c72('0x32')]=_[_0x0c72('0x33')](_0xbe2baa[_0x0c72('0x30')],_0xbe2baa['query']);_0x1d338e[_0x0c72('0x34')]=_[_0x0c72('0x33')](_0xbe2baa['model'],qs[_0x0c72('0x35')](_0xfd6934[_0x0c72('0x31')][_0x0c72('0x35')]));_0x1d338e['attributes']=_0x1d338e[_0x0c72('0x34')][_0x0c72('0x36')]?_0x1d338e['attributes']:_0xbe2baa[_0x0c72('0x30')];if(!_0xfd6934[_0x0c72('0x31')][_0x0c72('0x37')](_0x0c72('0x38'))){_0x1d338e['limit']=qs['limit'](_0xfd6934[_0x0c72('0x31')]['limit']);_0x1d338e[_0x0c72('0x1d')]=qs[_0x0c72('0x1d')](_0xfd6934['query'][_0x0c72('0x1d')]);}_0x1d338e[_0x0c72('0x39')]=qs[_0x0c72('0x3a')](_0xfd6934[_0x0c72('0x31')]['sort']);_0x1d338e[_0x0c72('0x3b')]=qs[_0x0c72('0x32')](_[_0x0c72('0x3c')](_0xfd6934[_0x0c72('0x31')],_0xbe2baa[_0x0c72('0x32')]),_0x4e0d66);if(_0xfd6934['query'][_0x0c72('0x3d')]){_0x1d338e[_0x0c72('0x3b')]=_[_0x0c72('0x3e')](_0x1d338e[_0x0c72('0x3b')],{'$or':_['map'](_0x4e0d66,function(_0x7ac297){if(_0x7ac297[_0x0c72('0x2f')]!==_0x0c72('0x3f')){var _0x2ea0f7={};_0x2ea0f7[_0x7ac297['name']]={'$like':'%'+_0xfd6934[_0x0c72('0x31')][_0x0c72('0x3d')]+'%'};return _0x2ea0f7;}})});}_0x1d338e=_[_0x0c72('0x3e')]({},_0x1d338e,_0xfd6934[_0x0c72('0x40')]);var _0x39cf89={'where':_0x1d338e['where']};return db[_0x0c72('0x41')][_0x0c72('0x20')](_0x39cf89)['then'](function(_0x34c729){_0x17278e['count']=_0x34c729;if(_0xfd6934['query'][_0x0c72('0x42')]){_0x1d338e[_0x0c72('0x43')]=[{'all':!![]}];}return db[_0x0c72('0x41')]['findAll'](_0x1d338e);})['then'](function(_0x3e8b05){_0x17278e['rows']=_0x3e8b05;return _0x17278e;})[_0x0c72('0x27')](respondWithFilteredResult(_0x5c4d7b,_0x1d338e))['catch'](handleError(_0x5c4d7b,null));};exports['show']=function(_0x186d32,_0x303708){var _0x338282={'raw':!![],'where':{'id':_0x186d32[_0x0c72('0x44')]['id']}},_0x3fc446={};_0x3fc446[_0x0c72('0x30')]=_[_0x0c72('0x45')](db[_0x0c72('0x41')][_0x0c72('0x2d')]);_0x3fc446[_0x0c72('0x31')]=_[_0x0c72('0x45')](_0x186d32['query']);_0x3fc446[_0x0c72('0x32')]=_[_0x0c72('0x33')](_0x3fc446[_0x0c72('0x30')],_0x3fc446[_0x0c72('0x31')]);_0x338282[_0x0c72('0x34')]=_['intersection'](_0x3fc446[_0x0c72('0x30')],qs[_0x0c72('0x35')](_0x186d32[_0x0c72('0x31')][_0x0c72('0x35')]));_0x338282['attributes']=_0x338282[_0x0c72('0x34')][_0x0c72('0x36')]?_0x338282[_0x0c72('0x34')]:_0x3fc446['model'];if(_0x186d32[_0x0c72('0x31')][_0x0c72('0x42')]){_0x338282[_0x0c72('0x43')]=[{'all':!![]}];}_0x338282=_[_0x0c72('0x3e')]({},_0x338282,_0x186d32[_0x0c72('0x40')]);return db['ChatTransferReport'][_0x0c72('0x46')](_0x338282)[_0x0c72('0x27')](handleEntityNotFound(_0x303708,null))[_0x0c72('0x27')](respondWithResult(_0x303708,null))['catch'](handleError(_0x303708,null));};exports[_0x0c72('0x47')]=function(_0x1da7b2,_0x5f0787){return db[_0x0c72('0x41')][_0x0c72('0x47')](_0x1da7b2[_0x0c72('0x48')],{})[_0x0c72('0x27')](respondWithResult(_0x5f0787,0xc9))[_0x0c72('0x49')](handleError(_0x5f0787,null));};exports['update']=function(_0x500d63,_0x448958){if(_0x500d63['body']['id']){delete _0x500d63[_0x0c72('0x48')]['id'];}return db['ChatTransferReport'][_0x0c72('0x46')]({'where':{'id':_0x500d63[_0x0c72('0x44')]['id']}})['then'](handleEntityNotFound(_0x448958,null))[_0x0c72('0x27')](saveUpdates(_0x500d63[_0x0c72('0x48')],null))[_0x0c72('0x27')](respondWithResult(_0x448958,null))['catch'](handleError(_0x448958,null));};exports[_0x0c72('0x4a')]=function(_0x6f549d,_0x566d38){return db[_0x0c72('0x41')][_0x0c72('0x46')]({'where':{'id':_0x6f549d[_0x0c72('0x44')]['id']}})[_0x0c72('0x27')](handleEntityNotFound(_0x566d38,null))[_0x0c72('0x27')](removeEntity(_0x566d38,null))['catch'](handleError(_0x566d38,null));};exports[_0x0c72('0x4b')]=function(_0x4755d8,_0x246dfe){return db['ChatTransferReport'][_0x0c72('0x4b')]()['then'](respondWithResult(_0x246dfe,null))[_0x0c72('0x49')](handleError(_0x246dfe,null));}; \ No newline at end of file +var _0x7a62=['update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','include','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x7a62,0xc3));var _0x27a6=function(_0x22b115,_0x27c1d3){_0x22b115=_0x22b115-0x0;var _0x53e73b=_0x7a62[_0x22b115];return _0x53e73b;};'use strict';var emlformat=require(_0x27a6('0x0'));var rimraf=require(_0x27a6('0x1'));var zipdir=require(_0x27a6('0x2'));var jsonpatch=require(_0x27a6('0x3'));var rp=require(_0x27a6('0x4'));var moment=require(_0x27a6('0x5'));var BPromise=require(_0x27a6('0x6'));var Mustache=require(_0x27a6('0x7'));var util=require(_0x27a6('0x8'));var path=require(_0x27a6('0x9'));var sox=require(_0x27a6('0xa'));var csv=require(_0x27a6('0xb'));var ejs=require(_0x27a6('0xc'));var fs=require('fs');var fs_extra=require(_0x27a6('0xd'));var _=require(_0x27a6('0xe'));var squel=require(_0x27a6('0xf'));var crypto=require(_0x27a6('0x10'));var jsforce=require(_0x27a6('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x27a6('0x12'));var Papa=require(_0x27a6('0x13'));var Redis=require(_0x27a6('0x14'));var authService=require(_0x27a6('0x15'));var qs=require(_0x27a6('0x16'));var as=require(_0x27a6('0x17'));var hardwareService=require(_0x27a6('0x18'));var logger=require(_0x27a6('0x19'))(_0x27a6('0x1a'));var utils=require(_0x27a6('0x1b'));var config=require(_0x27a6('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x27a6('0x1d'))['db'];function respondWithStatusCode(_0x1a9fc7,_0x3a0346){_0x3a0346=_0x3a0346||0xcc;return function(_0x252194){if(_0x252194){return _0x1a9fc7[_0x27a6('0x1e')](_0x3a0346);}return _0x1a9fc7[_0x27a6('0x1f')](_0x3a0346)[_0x27a6('0x20')]();};}function respondWithResult(_0x42bf16,_0x30aca8){_0x30aca8=_0x30aca8||0xc8;return function(_0x33afa5){if(_0x33afa5){return _0x42bf16['status'](_0x30aca8)[_0x27a6('0x21')](_0x33afa5);}};}function respondWithFilteredResult(_0x44b37f,_0x31257d){return function(_0x6e9efd){if(_0x6e9efd){var _0x1d572e=typeof _0x31257d[_0x27a6('0x22')]===_0x27a6('0x23')&&typeof _0x31257d[_0x27a6('0x24')]==='undefined';var _0x18a263=_0x6e9efd[_0x27a6('0x25')];var _0x532d42=_0x1d572e?0x0:_0x31257d[_0x27a6('0x22')];var _0x41b5c1=_0x1d572e?_0x6e9efd['count']:_0x31257d[_0x27a6('0x22')]+_0x31257d[_0x27a6('0x24')];var _0x18ad31;if(_0x41b5c1>=_0x18a263){_0x41b5c1=_0x18a263;_0x18ad31=0xc8;}else{_0x18ad31=0xce;}_0x44b37f[_0x27a6('0x1f')](_0x18ad31);return _0x44b37f[_0x27a6('0x26')]('Content-Range',_0x532d42+'-'+_0x41b5c1+'/'+_0x18a263)[_0x27a6('0x21')](_0x6e9efd);}return null;};}function patchUpdates(_0x2a83d2){return function(_0x5378cd){try{jsonpatch[_0x27a6('0x27')](_0x5378cd,_0x2a83d2,!![]);}catch(_0x599331){return BPromise[_0x27a6('0x28')](_0x599331);}return _0x5378cd[_0x27a6('0x29')]();};}function saveUpdates(_0x1e7baf,_0x564c0e){return function(_0x11dec5){if(_0x11dec5){return _0x11dec5[_0x27a6('0x2a')](_0x1e7baf)[_0x27a6('0x2b')](function(_0x405e42){return _0x405e42;});}return null;};}function removeEntity(_0x4f0727,_0x2528ad){return function(_0x2e6366){if(_0x2e6366){return _0x2e6366[_0x27a6('0x2c')]()[_0x27a6('0x2b')](function(){_0x4f0727[_0x27a6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x385d7d,_0x5d8f32){return function(_0x45f0c2){if(!_0x45f0c2){_0x385d7d[_0x27a6('0x1e')](0x194);}return _0x45f0c2;};}function handleError(_0x27e79e,_0x1b2b93){_0x1b2b93=_0x1b2b93||0x1f4;return function(_0x1cf41e){logger[_0x27a6('0x2d')](_0x1cf41e[_0x27a6('0x2e')]);if(_0x1cf41e[_0x27a6('0x2f')]){delete _0x1cf41e[_0x27a6('0x2f')];}_0x27e79e[_0x27a6('0x1f')](_0x1b2b93)['send'](_0x1cf41e);};}exports[_0x27a6('0x30')]=function(_0x51a70b,_0x1c9313){var _0x326693={},_0x22833e={},_0x3cf67a={'count':0x0,'rows':[]};var _0x4ad8c2=_[_0x27a6('0x31')](db[_0x27a6('0x32')][_0x27a6('0x33')],function(_0x27382a){return{'name':_0x27382a['fieldName'],'type':_0x27382a['type'][_0x27a6('0x34')]};});_0x22833e[_0x27a6('0x35')]=_[_0x27a6('0x31')](_0x4ad8c2,'name');_0x22833e[_0x27a6('0x36')]=_[_0x27a6('0x37')](_0x51a70b[_0x27a6('0x36')]);_0x22833e[_0x27a6('0x38')]=_[_0x27a6('0x39')](_0x22833e['model'],_0x22833e[_0x27a6('0x36')]);_0x326693[_0x27a6('0x3a')]=_['intersection'](_0x22833e[_0x27a6('0x35')],qs[_0x27a6('0x3b')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x3b')]));_0x326693[_0x27a6('0x3a')]=_0x326693[_0x27a6('0x3a')][_0x27a6('0x3c')]?_0x326693[_0x27a6('0x3a')]:_0x22833e['model'];if(!_0x51a70b[_0x27a6('0x36')][_0x27a6('0x3d')](_0x27a6('0x3e'))){_0x326693[_0x27a6('0x24')]=qs[_0x27a6('0x24')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x24')]);_0x326693[_0x27a6('0x22')]=qs[_0x27a6('0x22')](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x22')]);}_0x326693[_0x27a6('0x3f')]=qs['sort'](_0x51a70b[_0x27a6('0x36')][_0x27a6('0x40')]);_0x326693[_0x27a6('0x41')]=qs[_0x27a6('0x38')](_[_0x27a6('0x42')](_0x51a70b[_0x27a6('0x36')],_0x22833e['filters']),_0x4ad8c2);if(_0x51a70b[_0x27a6('0x36')][_0x27a6('0x43')]){_0x326693[_0x27a6('0x41')]=_['merge'](_0x326693['where'],{'$or':_[_0x27a6('0x31')](_0x4ad8c2,function(_0xa7503a){if(_0xa7503a[_0x27a6('0x44')]!=='VIRTUAL'){var _0x2be05c={};_0x2be05c[_0xa7503a['name']]={'$like':'%'+_0x51a70b[_0x27a6('0x36')][_0x27a6('0x43')]+'%'};return _0x2be05c;}})});}_0x326693=_['merge']({},_0x326693,_0x51a70b[_0x27a6('0x45')]);var _0x2fe926={'where':_0x326693['where']};return db['ChatTransferReport']['count'](_0x2fe926)[_0x27a6('0x2b')](function(_0x17a8ed){_0x3cf67a[_0x27a6('0x25')]=_0x17a8ed;if(_0x51a70b[_0x27a6('0x36')]['includeAll']){_0x326693[_0x27a6('0x46')]=[{'all':!![]}];}return db[_0x27a6('0x32')]['findAll'](_0x326693);})[_0x27a6('0x2b')](function(_0x1f71cb){_0x3cf67a['rows']=_0x1f71cb;return _0x3cf67a;})['then'](respondWithFilteredResult(_0x1c9313,_0x326693))[_0x27a6('0x47')](handleError(_0x1c9313,null));};exports[_0x27a6('0x48')]=function(_0x3acfdd,_0x145f21){var _0x2ebec0={'raw':!![],'where':{'id':_0x3acfdd[_0x27a6('0x49')]['id']}},_0x313d20={};_0x313d20[_0x27a6('0x35')]=_[_0x27a6('0x37')](db['ChatTransferReport'][_0x27a6('0x33')]);_0x313d20[_0x27a6('0x36')]=_[_0x27a6('0x37')](_0x3acfdd[_0x27a6('0x36')]);_0x313d20[_0x27a6('0x38')]=_['intersection'](_0x313d20[_0x27a6('0x35')],_0x313d20[_0x27a6('0x36')]);_0x2ebec0[_0x27a6('0x3a')]=_['intersection'](_0x313d20[_0x27a6('0x35')],qs[_0x27a6('0x3b')](_0x3acfdd[_0x27a6('0x36')][_0x27a6('0x3b')]));_0x2ebec0[_0x27a6('0x3a')]=_0x2ebec0['attributes'][_0x27a6('0x3c')]?_0x2ebec0[_0x27a6('0x3a')]:_0x313d20[_0x27a6('0x35')];if(_0x3acfdd[_0x27a6('0x36')]['includeAll']){_0x2ebec0[_0x27a6('0x46')]=[{'all':!![]}];}_0x2ebec0=_[_0x27a6('0x4a')]({},_0x2ebec0,_0x3acfdd[_0x27a6('0x45')]);return db[_0x27a6('0x32')][_0x27a6('0x4b')](_0x2ebec0)[_0x27a6('0x2b')](handleEntityNotFound(_0x145f21,null))[_0x27a6('0x2b')](respondWithResult(_0x145f21,null))[_0x27a6('0x47')](handleError(_0x145f21,null));};exports[_0x27a6('0x4c')]=function(_0x5edaa0,_0xc3af14){return db[_0x27a6('0x32')][_0x27a6('0x4c')](_0x5edaa0[_0x27a6('0x4d')],{})['then'](respondWithResult(_0xc3af14,0xc9))['catch'](handleError(_0xc3af14,null));};exports[_0x27a6('0x2a')]=function(_0x4aee8e,_0x396398){if(_0x4aee8e['body']['id']){delete _0x4aee8e[_0x27a6('0x4d')]['id'];}return db[_0x27a6('0x32')][_0x27a6('0x4b')]({'where':{'id':_0x4aee8e['params']['id']}})[_0x27a6('0x2b')](handleEntityNotFound(_0x396398,null))[_0x27a6('0x2b')](saveUpdates(_0x4aee8e[_0x27a6('0x4d')],null))[_0x27a6('0x2b')](respondWithResult(_0x396398,null))[_0x27a6('0x47')](handleError(_0x396398,null));};exports[_0x27a6('0x2c')]=function(_0x310eca,_0x4503ee){return db['ChatTransferReport']['find']({'where':{'id':_0x310eca[_0x27a6('0x49')]['id']}})[_0x27a6('0x2b')](handleEntityNotFound(_0x4503ee,null))[_0x27a6('0x2b')](removeEntity(_0x4503ee,null))['catch'](handleError(_0x4503ee,null));};exports[_0x27a6('0x4e')]=function(_0x1dcb48,_0x4d1f01){return db[_0x27a6('0x32')][_0x27a6('0x4e')]()['then'](respondWithResult(_0x4d1f01,null))['catch'](handleError(_0x4d1f01,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 6fcf307..34ac5bd 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 _0xf7b4=['util','../../config/logger','moment','path','rimraf','../../config/environment','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x50583c,_0x2d2dee){var _0x358ba5=function(_0x1aa091){while(--_0x1aa091){_0x50583c['push'](_0x50583c['shift']());}};_0x358ba5(++_0x2d2dee);}(_0xf7b4,0xd0));var _0x4f7b=function(_0x236aed,_0x3426bb){_0x236aed=_0x236aed-0x0;var _0x5e3d2e=_0xf7b4[_0x236aed];return _0x5e3d2e;};'use strict';var _=require(_0x4f7b('0x0'));var util=require(_0x4f7b('0x1'));var logger=require(_0x4f7b('0x2'))('api');var moment=require(_0x4f7b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x4'));var rimraf=require(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x4f7b('0x7')]=function(_0x569def,_0x1ea510){return _0x569def['define'](_0x4f7b('0x8'),attributes,{'tableName':_0x4f7b('0x9'),'paranoid':![],'indexes':[{'name':_0x4f7b('0xa'),'fields':[_0x4f7b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9541=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x466e3b,_0x4dd946){var _0x3f7d36=function(_0x3759d9){while(--_0x3759d9){_0x466e3b['push'](_0x466e3b['shift']());}};_0x3f7d36(++_0x4dd946);}(_0x9541,0x1cb));var _0x1954=function(_0xe7d810,_0x4e8efe){_0xe7d810=_0xe7d810-0x0;var _0x1e6cbf=_0x9541[_0xe7d810];return _0x1e6cbf;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var logger=require(_0x1954('0x2'))(_0x1954('0x3'));var moment=require(_0x1954('0x4'));var BPromise=require('bluebird');var rp=require(_0x1954('0x5'));var fs=require('fs');var path=require(_0x1954('0x6'));var rimraf=require(_0x1954('0x7'));var config=require(_0x1954('0x8'));var attributes=require(_0x1954('0x9'));module['exports']=function(_0xe35f4,_0x566504){return _0xe35f4[_0x1954('0xa')](_0x1954('0xb'),attributes,{'tableName':_0x1954('0xc'),'paranoid':![],'indexes':[{'name':_0x1954('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 18c4401..0ae3c1e 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 _0x4532=['ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code'];(function(_0x4b05f6,_0x57dd81){var _0xbb1a44=function(_0x1dd695){while(--_0x1dd695){_0x4b05f6['push'](_0x4b05f6['shift']());}};_0xbb1a44(++_0x57dd81);}(_0x4532,0x1b9));var _0x2453=function(_0x3fa27f,_0x307c42){_0x3fa27f=_0x3fa27f-0x0;var _0x46e2b3=_0x4532[_0x3fa27f];return _0x46e2b3;};'use strict';var _=require(_0x2453('0x0'));var util=require('util');var moment=require(_0x2453('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2453('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2453('0x3'))(_0x2453('0x4'));var config=require(_0x2453('0x5'));var jayson=require(_0x2453('0x6'));var client=jayson[_0x2453('0x7')][_0x2453('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x369827,_0x4c23de,_0x256ac5){return new BPromise(function(_0x3d892e,_0x3f2a6f){return client[_0x2453('0x9')](_0x369827,_0x256ac5)['then'](function(_0x43644c){logger[_0x2453('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x2453('0xb'));logger[_0x2453('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4c23de,'request\x20sent',JSON['stringify'](_0x43644c));if(_0x43644c[_0x2453('0xd')]){if(_0x43644c['error'][_0x2453('0xe')]===0x1f4){logger[_0x2453('0xd')](_0x2453('0xf'),_0x4c23de,_0x43644c['error'][_0x2453('0x10')]);return _0x3f2a6f(_0x43644c[_0x2453('0xd')][_0x2453('0x10')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x43644c['error'][_0x2453('0x10')]);return _0x3d892e(_0x43644c[_0x2453('0xd')]['message']);}else{logger[_0x2453('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x4c23de,_0x2453('0xb'));_0x3d892e(_0x43644c[_0x2453('0x11')][_0x2453('0x10')]);}})[_0x2453('0x12')](function(_0x463be8){logger[_0x2453('0xd')](_0x2453('0xf'),_0x4c23de,_0x463be8);_0x3f2a6f(_0x463be8);});});} \ No newline at end of file +var _0xe812=['jayson/promise','client','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../config/environment'];(function(_0x33d1ea,_0x1ca2ca){var _0x509718=function(_0x1a63dc){while(--_0x1a63dc){_0x33d1ea['push'](_0x33d1ea['shift']());}};_0x509718(++_0x1ca2ca);}(_0xe812,0x193));var _0x2e81=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe812[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2e81('0x0'));var util=require(_0x2e81('0x1'));var moment=require(_0x2e81('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2e81('0x4'));var jayson=require(_0x2e81('0x5'));var client=jayson[_0x2e81('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e03d6,_0x130c87,_0x48cd25){return new BPromise(function(_0x386b4e,_0x3edba8){return client[_0x2e81('0x7')](_0x3e03d6,_0x48cd25)['then'](function(_0x374c64){logger[_0x2e81('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x2e81('0x9'));logger[_0x2e81('0xa')](_0x2e81('0xb'),_0x130c87,_0x2e81('0x9'),JSON['stringify'](_0x374c64));if(_0x374c64[_0x2e81('0xc')]){if(_0x374c64['error']['code']===0x1f4){logger[_0x2e81('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x374c64['error']['message']);return _0x3edba8(_0x374c64['error'][_0x2e81('0xd')]);}logger['error'](_0x2e81('0xe'),_0x130c87,_0x374c64[_0x2e81('0xc')][_0x2e81('0xd')]);return _0x386b4e(_0x374c64[_0x2e81('0xc')][_0x2e81('0xd')]);}else{logger[_0x2e81('0x8')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x2e81('0x9'));_0x386b4e(_0x374c64[_0x2e81('0xf')][_0x2e81('0xd')]);}})[_0x2e81('0x10')](function(_0x16fa05){logger[_0x2e81('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x130c87,_0x16fa05);_0x3edba8(_0x16fa05);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index e4c9006..31c091f 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 _0x5bfa=['express','Router','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5bfa,0x155));var _0xa5bf=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x5bfa[_0x457b64];return _0x437111;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa5bf('0x0'));var timeout=require('connect-timeout');var express=require(_0xa5bf('0x1'));var router=express[_0xa5bf('0x2')]();var fs_extra=require(_0xa5bf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa5bf('0x4'));var config=require('../../config/environment');var controller=require(_0xa5bf('0x5'));router[_0xa5bf('0x6')]('/',auth['isAuthenticated'](),controller[_0xa5bf('0x7')]);router['get'](_0xa5bf('0x8'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0xa')]);router['get'](_0xa5bf('0xb'),auth['isAuthenticated'](),controller[_0xa5bf('0xc')]);router[_0xa5bf('0xd')]('/',auth[_0xa5bf('0x9')](),controller[_0xa5bf('0xe')]);router[_0xa5bf('0xf')](_0xa5bf('0xb'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0x10')]);router[_0xa5bf('0x11')](_0xa5bf('0xb'),auth[_0xa5bf('0x9')](),controller[_0xa5bf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x64be=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x478349,_0x4e11b2){var _0x564ad3=function(_0x505853){while(--_0x505853){_0x478349['push'](_0x478349['shift']());}};_0x564ad3(++_0x4e11b2);}(_0x64be,0x75));var _0xe64b=function(_0x4badc1,_0x288f4f){_0x4badc1=_0x4badc1-0x0;var _0x5719b1=_0x64be[_0x4badc1];return _0x5719b1;};'use strict';var multer=require(_0xe64b('0x0'));var util=require('util');var path=require(_0xe64b('0x1'));var timeout=require(_0xe64b('0x2'));var express=require('express');var router=express[_0xe64b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe64b('0x4'));var interaction=require(_0xe64b('0x5'));var config=require(_0xe64b('0x6'));var controller=require(_0xe64b('0x7'));router['get']('/',auth[_0xe64b('0x8')](),controller[_0xe64b('0x9')]);router[_0xe64b('0xa')](_0xe64b('0xb'),auth[_0xe64b('0x8')](),controller[_0xe64b('0xc')]);router[_0xe64b('0xa')](_0xe64b('0xd'),auth[_0xe64b('0x8')](),controller['show']);router[_0xe64b('0xe')]('/',auth['isAuthenticated'](),controller[_0xe64b('0xf')]);router[_0xe64b('0x10')]('/:id',auth[_0xe64b('0x8')](),controller[_0xe64b('0x11')]);router['delete']('/:id',auth[_0xe64b('0x8')](),controller[_0xe64b('0x12')]);module[_0xe64b('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 41abcb2..c2faf0b 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 _0x617b=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','textarea','Comments','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right'];(function(_0x3667f4,_0x352406){var _0x244317=function(_0x5aba01){while(--_0x5aba01){_0x3667f4['push'](_0x3667f4['shift']());}};_0x244317(++_0x352406);}(_0x617b,0x1e7));var _0xb617=function(_0x5dc57d,_0x2d9343){_0x5dc57d=_0x5dc57d-0x0;var _0x2a4499=_0x617b[_0x5dc57d];return _0x2a4499;};'use strict';var Sequelize=require(_0xb617('0x0'));var rs=require(_0xb617('0x1'));module['exports']={'name':{'type':Sequelize[_0xb617('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x3')},'mapKeyOffline':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x3')},'key':{'type':Sequelize[_0xb617('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb617('0x2')]},'animation':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb617('0x7'),_0xb617('0x8')),'defaultValue':_0xb617('0x7')},'header_online':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x9')},'start_chat_button':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0xb')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb617('0xd')]},'closingQuestion':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0xf')},'noteTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x10')},'placeholderMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0x11')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x12')},'ratingType':{'type':Sequelize[_0xb617('0x13')](_0xb617('0x14'),_0xb617('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb617('0xd')],'defaultValue':function(){return JSON[_0xb617('0x16')]({'items':[{'type':_0xb617('0x17'),'variable':null,'config':{'placeholder':_0xb617('0x18'),'type':_0xb617('0x19'),'required':!![]},'props':{'title':_0xb617('0x18'),'helpText':''}},{'type':_0xb617('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb617('0x3'),'type':_0xb617('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb617('0x1a')]('onlineForm')?JSON['parse'](this[_0xb617('0x1a')](_0xb617('0x1b'))):{};},'set':function(_0x78cb1b){return this['setDataValue'](_0xb617('0x1b'),JSON['stringify'](_0x78cb1b));}},'offlineForm':{'type':Sequelize[_0xb617('0xd')],'defaultValue':function(){return JSON[_0xb617('0x16')]({'items':[{'type':_0xb617('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xb617('0x3'),'type':_0xb617('0x3')},'variable':null},{'type':_0xb617('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xb617('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb617('0x1a')](_0xb617('0x1e'))?JSON[_0xb617('0x1f')](this[_0xb617('0x1a')](_0xb617('0x1e'))):{};},'set':function(_0xa49062){return this[_0xb617('0x20')](_0xb617('0x1e'),JSON['stringify'](_0xa49062));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb617('0x21')]();}},'autoclose':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb617('0x2')]},'waitingTitle':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x22')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb617('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xb617('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x25')},'skipUnmanaged':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x26')},'enableCustomerAttachment':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb617('0xd')]},'showAgentAvatar':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb617('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb617('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x28')},'verticalAlignment':{'type':Sequelize[_0xb617('0x5')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb617('0x2')],'defaultValue':_0xb617('0x29')},'defaultTitle':{'type':Sequelize[_0xb617('0x2')]},'customerAvatar':{'type':Sequelize[_0xb617('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':_0xb617('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb617('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb617('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb617('0xd')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb617('0x5')],'comment':_0xb617('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![],'comment':_0xb617('0x2c'),'set':function(_0x730d19){if(!_0x730d19)this[_0xb617('0x20')](_0xb617('0x2d'),null);this[_0xb617('0x20')](_0xb617('0x2e'),_0x730d19);}},'vidaooEscalation':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb617('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xb617('0x2')],'defaultValue':function(){return _0xb617('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xb617('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb617('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8691=['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','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','Chat','Send','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','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(_0x2ab630,_0x34d07a){var _0x3fe346=function(_0x1314ee){while(--_0x1314ee){_0x2ab630['push'](_0x2ab630['shift']());}};_0x3fe346(++_0x34d07a);}(_0x8691,0x1c5));var _0x1869=function(_0x1b5ad2,_0x476864){_0x1b5ad2=_0x1b5ad2-0x0;var _0x228d69=_0x8691[_0x1b5ad2];return _0x228d69;};'use strict';var Sequelize=require(_0x1869('0x0'));var rs=require(_0x1869('0x1'));module[_0x1869('0x2')]={'name':{'type':Sequelize[_0x1869('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1869('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x5')},'mapKeyOffline':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x5')},'key':{'type':Sequelize[_0x1869('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1869('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1869('0x3')]},'animation':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1869('0xa')](_0x1869('0xb'),_0x1869('0xc')),'defaultValue':_0x1869('0xb')},'header_online':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0xd')},'offline_chat_button':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'header_offline':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1869('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x12')},'noteTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x13')},'closingMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x14')},'ratingType':{'type':Sequelize[_0x1869('0xa')]('star','thumb'),'defaultValue':_0x1869('0x15')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1869('0x10')],'defaultValue':function(){return JSON[_0x1869('0x16')]({'items':[{'type':_0x1869('0x17'),'variable':null,'config':{'placeholder':_0x1869('0x18'),'type':_0x1869('0x19'),'required':!![]},'props':{'title':_0x1869('0x18'),'helpText':''}},{'type':_0x1869('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1869('0x5'),'type':_0x1869('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1869('0x1a'))?JSON[_0x1869('0x1b')](this[_0x1869('0x1c')](_0x1869('0x1a'))):{};},'set':function(_0x123128){return this[_0x1869('0x1d')]('onlineForm',JSON[_0x1869('0x16')](_0x123128));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1869('0x17'),'props':{'title':_0x1869('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x1869('0x1e'),'config':{'placeholder':_0x1869('0x1f')},'props':{'title':_0x1869('0x1f'),'helpText':_0x1869('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1869('0x1c')](_0x1869('0x21'))?JSON['parse'](this[_0x1869('0x1c')](_0x1869('0x21'))):{};},'set':function(_0x592097){return this[_0x1869('0x1d')](_0x1869('0x21'),JSON[_0x1869('0x16')](_0x592097));}},'token':{'type':Sequelize[_0x1869('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1869('0x3')]},'forwardOffline':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1869('0x3')]},'waitingTitle':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x22')},'waitingMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x23')},'offlineMessageSubject':{'type':Sequelize[_0x1869('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1869('0x26')},'sendUnmanaged':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1869('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1869('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1869('0x10')],'defaultValue':function(){return _0x1869('0x27');}},'notificationSound':{'type':Sequelize[_0x1869('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1869('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x29')},'verticalAlignment':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x1869('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1869('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1869('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1869('0x3')],'defaultValue':_0x1869('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1869('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![],'comment':_0x1869('0x2d'),'set':function(_0x476904){if(!_0x476904)this['setDataValue'](_0x1869('0x2e'),null);this[_0x1869('0x1d')]('mandatoryDisposition',_0x476904);}},'vidaooEscalation':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1869('0x3')],'allowNull':![],'defaultValue':_0x1869('0x2f')},'vidaooNote':{'type':Sequelize[_0x1869('0x3')],'defaultValue':function(){return _0x1869('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x1869('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1869('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1869('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 47f7c63..2bcdfc4 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 _0x514b=['Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ChatWebsites','name','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','existsSync','getSystemAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','offline','files','ListId','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','sendMail','\x22%s\x22\x20<%s>','MailAccountId','length','originalname','subjectOffline','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions'];(function(_0x1893b9,_0x580534){var _0x4316be=function(_0x2c3a93){while(--_0x2c3a93){_0x1893b9['push'](_0x1893b9['shift']());}};_0x4316be(++_0x580534);}(_0x514b,0x172));var _0xb514=function(_0x3f7e81,_0xc05e07){_0x3f7e81=_0x3f7e81-0x0;var _0x155e2f=_0x514b[_0x3f7e81];return _0x155e2f;};'use strict';var emlformat=require(_0xb514('0x0'));var rimraf=require(_0xb514('0x1'));var zipdir=require(_0xb514('0x2'));var jsonpatch=require(_0xb514('0x3'));var rp=require(_0xb514('0x4'));var moment=require(_0xb514('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb514('0x6'));var path=require(_0xb514('0x7'));var sox=require('sox');var csv=require(_0xb514('0x8'));var ejs=require(_0xb514('0x9'));var fs=require('fs');var fs_extra=require(_0xb514('0xa'));var _=require(_0xb514('0xb'));var squel=require(_0xb514('0xc'));var crypto=require(_0xb514('0xd'));var jsforce=require(_0xb514('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb514('0x8'));var querystring=require(_0xb514('0xf'));var Papa=require('papaparse');var Redis=require(_0xb514('0x10'));var authService=require(_0xb514('0x11'));var qs=require(_0xb514('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb514('0x13'));var logger=require(_0xb514('0x14'))(_0xb514('0x15'));var utils=require(_0xb514('0x16'));var config=require(_0xb514('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb514('0x18')]=_[_0xb514('0x19')](config[_0xb514('0x18')],{'host':_0xb514('0x1a'),'port':0x18eb});var socket=require(_0xb514('0x1b'))(new Redis(config[_0xb514('0x18')]));require(_0xb514('0x1c'))[_0xb514('0x1d')](socket);var jayson=require(_0xb514('0x1e'));var client=jayson['client'][_0xb514('0x1f')]({'port':0x232c});var client9002=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x232a});var client9003=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x232b});var client9001=jayson[_0xb514('0x20')][_0xb514('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x5d29e7,_0x555ca6,_0x593c21,_0x487aa4){return new BPromise(function(_0x3dc0c3,_0x2443d3){var _0x18ccd1=_0x487aa4||client;return _0x18ccd1[_0xb514('0x21')](_0x5d29e7,_0x593c21)['then'](function(_0x917580){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x555ca6,_0xb514('0x22'));logger[_0xb514('0x23')](_0xb514('0x24'),_0x555ca6,'request\x20sent',JSON[_0xb514('0x25')](_0x917580));if(_0x917580[_0xb514('0x26')]){if(_0x917580[_0xb514('0x26')]['code']===0x1f4){logger[_0xb514('0x26')](_0xb514('0x27'),_0x555ca6,_0x917580['error']['message']);return _0x2443d3(_0x917580[_0xb514('0x26')][_0xb514('0x28')]);}logger[_0xb514('0x26')](_0xb514('0x27'),_0x555ca6,_0x917580[_0xb514('0x26')][_0xb514('0x28')]);return _0x3dc0c3(_0x917580['error']['message']);}else{logger[_0xb514('0x29')](_0xb514('0x27'),_0x555ca6,_0xb514('0x22'));_0x3dc0c3(_0x917580[_0xb514('0x2a')][_0xb514('0x28')]);}})['catch'](function(_0x5e08b2){logger[_0xb514('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x555ca6,_0x5e08b2);_0x2443d3(_0x5e08b2);});});}function respondWithStatusCode(_0x15dcb6,_0x43e55b){_0x43e55b=_0x43e55b||0xcc;return function(_0x446eb7){if(_0x446eb7){return _0x15dcb6[_0xb514('0x2b')](_0x43e55b);}return _0x15dcb6[_0xb514('0x2c')](_0x43e55b)[_0xb514('0x2d')]();};}function respondWithResult(_0x34bd3c,_0x2ab1c1){_0x2ab1c1=_0x2ab1c1||0xc8;return function(_0x3652a3){if(_0x3652a3){return _0x34bd3c[_0xb514('0x2c')](_0x2ab1c1)[_0xb514('0x2e')](_0x3652a3);}};}function respondWithFilteredResult(_0x3eb725,_0xf61c86){return function(_0x296785){if(_0x296785){var _0x55ff75=typeof _0xf61c86[_0xb514('0x2f')]===_0xb514('0x30')&&typeof _0xf61c86[_0xb514('0x31')]==='undefined';var _0x15129c=_0x296785['count'];var _0x3a7fdf=_0x55ff75?0x0:_0xf61c86[_0xb514('0x2f')];var _0x4f4e81=_0x55ff75?_0x296785[_0xb514('0x32')]:_0xf61c86[_0xb514('0x2f')]+_0xf61c86['limit'];var _0xce437d;if(_0x4f4e81>=_0x15129c){_0x4f4e81=_0x15129c;_0xce437d=0xc8;}else{_0xce437d=0xce;}_0x3eb725[_0xb514('0x2c')](_0xce437d);return _0x3eb725['set'](_0xb514('0x33'),_0x3a7fdf+'-'+_0x4f4e81+'/'+_0x15129c)[_0xb514('0x2e')](_0x296785);}return null;};}function patchUpdates(_0x9e8e2e){return function(_0x2a86e5){try{jsonpatch[_0xb514('0x34')](_0x2a86e5,_0x9e8e2e,!![]);}catch(_0xb7f55){return BPromise[_0xb514('0x35')](_0xb7f55);}return _0x2a86e5[_0xb514('0x36')]();};}function saveUpdates(_0xfd2a26,_0x363ae1){return function(_0x9e21f2){if(_0x9e21f2){return _0x9e21f2[_0xb514('0x37')](_0xfd2a26)[_0xb514('0x38')](function(_0x461ccd){return _0x461ccd;});}return null;};}function removeEntity(_0x4a1739,_0x48e741){return function(_0x9e5fb3){if(_0x9e5fb3){return _0x9e5fb3[_0xb514('0x39')]()[_0xb514('0x38')](function(){var _0x2ccfa7=_0x9e5fb3['get']({'plain':!![]});var _0x33ee89=_0xb514('0x3a');return db['UserProfileResource'][_0xb514('0x39')]({'where':{'type':_0x33ee89,'resourceId':_0x2ccfa7['id']}})[_0xb514('0x38')](function(){return _0x9e5fb3;});})[_0xb514('0x38')](function(){_0x4a1739['status'](0xcc)[_0xb514('0x2d')]();});}};}function handleEntityNotFound(_0x4bef0d,_0x1ecf9d){return function(_0x3b6e6d){if(!_0x3b6e6d){_0x4bef0d[_0xb514('0x2b')](0x194);}return _0x3b6e6d;};}function handleError(_0x3163b0,_0x1f274b){_0x1f274b=_0x1f274b||0x1f4;return function(_0x2fbf7f){logger[_0xb514('0x26')](_0x2fbf7f['stack']);if(_0x2fbf7f[_0xb514('0x3b')]){delete _0x2fbf7f[_0xb514('0x3b')];}_0x3163b0['status'](_0x1f274b)['send'](_0x2fbf7f);};}exports['index']=function(_0x5957ce,_0x460764){var _0x104926={'include':[{'model':db['Pause'],'as':_0xb514('0x3c')}]},_0x34b925={},_0x13893c={'count':0x0,'rows':[]};var _0x10e491=_[_0xb514('0x3d')](db[_0xb514('0x3e')][_0xb514('0x3f')],function(_0x4060a7){return{'name':_0x4060a7[_0xb514('0x40')],'type':_0x4060a7[_0xb514('0x41')][_0xb514('0x42')]};});_0x34b925[_0xb514('0x43')]=_[_0xb514('0x3d')](_0x10e491,'name');_0x34b925[_0xb514('0x44')]=_[_0xb514('0x45')](_0x5957ce[_0xb514('0x44')]);_0x34b925[_0xb514('0x46')]=_[_0xb514('0x47')](_0x34b925['model'],_0x34b925[_0xb514('0x44')]);_0x104926[_0xb514('0x48')]=_[_0xb514('0x47')](_0x34b925[_0xb514('0x43')],qs[_0xb514('0x49')](_0x5957ce['query'][_0xb514('0x49')]));_0x104926[_0xb514('0x48')]=_0x104926[_0xb514('0x48')]['length']?_0x104926[_0xb514('0x48')]:_0x34b925[_0xb514('0x43')];if(!_0x5957ce[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x104926['limit']=qs['limit'](_0x5957ce['query']['limit']);_0x104926[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x5957ce['query'][_0xb514('0x2f')]);}_0x104926[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x5957ce[_0xb514('0x44')]['sort']);_0x104926[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x5957ce[_0xb514('0x44')],_0x34b925[_0xb514('0x46')]),_0x10e491);if(_0x5957ce[_0xb514('0x44')][_0xb514('0x50')]){_0x104926[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x104926[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x10e491,function(_0x6be647){if(_0x6be647[_0xb514('0x41')]!==_0xb514('0x52')){var _0x4c62b1={};_0x4c62b1[_0x6be647[_0xb514('0x3b')]]={'$like':'%'+_0x5957ce['query'][_0xb514('0x50')]+'%'};return _0x4c62b1;}})});}_0x104926=_[_0xb514('0x51')]({},_0x104926,_0x5957ce[_0xb514('0x53')]);var _0x4aa447={'where':_0x104926[_0xb514('0x4e')]};return db[_0xb514('0x3e')][_0xb514('0x32')](_0x4aa447)[_0xb514('0x38')](function(_0x4f84af){_0x13893c[_0xb514('0x32')]=_0x4f84af;if(_0x5957ce[_0xb514('0x44')][_0xb514('0x54')]){_0x104926[_0xb514('0x55')]=[{'all':!![]}];}return db[_0xb514('0x3e')][_0xb514('0x56')](_0x104926);})[_0xb514('0x38')](function(_0x25a935){_0x13893c[_0xb514('0x57')]=_0x25a935;return _0x13893c;})[_0xb514('0x38')](respondWithFilteredResult(_0x460764,_0x104926))['catch'](handleError(_0x460764,null));};exports[_0xb514('0x58')]=function(_0x1827ab,_0x44104e){var _0x594855={'raw':![],'where':{'id':_0x1827ab[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x5a')],'as':_0xb514('0x3c')}]},_0x51c766={};_0x51c766[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x3e')][_0xb514('0x3f')]);_0x51c766[_0xb514('0x44')]=_[_0xb514('0x45')](_0x1827ab['query']);_0x51c766[_0xb514('0x46')]=_[_0xb514('0x47')](_0x51c766[_0xb514('0x43')],_0x51c766[_0xb514('0x44')]);_0x594855[_0xb514('0x48')]=_[_0xb514('0x47')](_0x51c766[_0xb514('0x43')],qs[_0xb514('0x49')](_0x1827ab[_0xb514('0x44')][_0xb514('0x49')]));_0x594855['attributes']=_0x594855[_0xb514('0x48')]['length']?_0x594855['attributes']:_0x51c766[_0xb514('0x43')];if(_0x1827ab[_0xb514('0x44')][_0xb514('0x54')]){_0x594855[_0xb514('0x55')]=[{'all':!![]}];}_0x594855=_[_0xb514('0x51')]({},_0x594855,_0x1827ab[_0xb514('0x53')]);return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x594855)[_0xb514('0x38')](handleEntityNotFound(_0x44104e,null))['then'](respondWithResult(_0x44104e,null))[_0xb514('0x5c')](handleError(_0x44104e,null));};exports[_0xb514('0x5d')]=function(_0x34a906,_0x8c91d3){return db[_0xb514('0x3e')][_0xb514('0x5d')](_0x34a906[_0xb514('0x5e')],{})[_0xb514('0x38')](function(_0x108229){var _0x2923c6=_0x34a906[_0xb514('0x5f')]['get']({'plain':!![]});if(!_0x2923c6)throw new Error(_0xb514('0x60'));if(_0x2923c6['role']===_0xb514('0x5f')){var _0x31a4c5=_0x108229[_0xb514('0x61')]({'plain':!![]});var _0x1a0249=_0xb514('0x3a');return db[_0xb514('0x62')][_0xb514('0x5b')]({'where':{'name':_0x1a0249,'userProfileId':_0x2923c6[_0xb514('0x63')]},'raw':!![]})[_0xb514('0x38')](function(_0x42f039){if(_0x42f039&&_0x42f039[_0xb514('0x64')]===0x0){return db['UserProfileResource'][_0xb514('0x5d')]({'name':_0x31a4c5[_0xb514('0x3b')],'resourceId':_0x31a4c5['id'],'type':_0x42f039[_0xb514('0x3b')],'sectionId':_0x42f039['id']},{})[_0xb514('0x38')](function(){return _0x108229;});}else{return _0x108229;}})[_0xb514('0x5c')](function(_0x53928c){logger[_0xb514('0x26')](_0xb514('0x65'),_0x53928c);throw _0x53928c;});}return _0x108229;})[_0xb514('0x38')](respondWithResult(_0x8c91d3,0xc9))[_0xb514('0x5c')](handleError(_0x8c91d3,null));};exports[_0xb514('0x37')]=function(_0x32b566,_0x380179){if(_0x32b566[_0xb514('0x5e')]['id']){delete _0x32b566[_0xb514('0x5e')]['id'];}return db[_0xb514('0x3e')]['find']({'where':{'id':_0x32b566[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x5a')],'as':'mandatoryDispositionPause'}]})[_0xb514('0x38')](handleEntityNotFound(_0x380179,null))[_0xb514('0x38')](saveUpdates(_0x32b566['body'],null))[_0xb514('0x38')](respondWithResult(_0x380179,null))[_0xb514('0x5c')](handleError(_0x380179,null));};exports['destroy']=function(_0xb2946b,_0xb77f10){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0xb2946b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0xb77f10,null))[_0xb514('0x38')](removeEntity(_0xb77f10,null))['catch'](handleError(_0xb77f10,null));};exports[_0xb514('0x66')]=function(_0x385bcc,_0x4f3447){return db[_0xb514('0x3e')][_0xb514('0x66')]()[_0xb514('0x38')](respondWithResult(_0x4f3447,null))[_0xb514('0x5c')](handleError(_0x4f3447,null));};exports['addDisposition']=function(_0x311a02,_0x284ffa,_0x292c5c){if(_0x311a02[_0xb514('0x5e')]['id']){delete _0x311a02[_0xb514('0x5e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x311a02[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x284ffa,null))['then'](function(_0x3f5c99){if(_0x3f5c99){_0x311a02['body'][_0xb514('0x67')]=_0x3f5c99['id'];return db[_0xb514('0x68')][_0xb514('0x5d')](_0x311a02['body']);}})[_0xb514('0x38')](respondWithResult(_0x284ffa,null))['catch'](handleError(_0x284ffa,null));};exports[_0xb514('0x69')]=function(_0x320112,_0x5b0f9a,_0x2c3567){var _0x3816e9={'raw':![],'where':{}};var _0x97fde={};var _0x9007c8={'count':0x0,'rows':[]};return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x320112[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5b0f9a,null))[_0xb514('0x38')](function(_0x26a935){if(_0x26a935){_0x97fde[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x68')][_0xb514('0x3f')]);_0x97fde[_0xb514('0x44')]=_[_0xb514('0x45')](_0x320112[_0xb514('0x44')]);_0x97fde[_0xb514('0x46')]=_['intersection'](_0x97fde[_0xb514('0x43')],_0x97fde[_0xb514('0x44')]);_0x3816e9[_0xb514('0x48')]=_[_0xb514('0x47')](_0x97fde[_0xb514('0x43')],qs['fields'](_0x320112[_0xb514('0x44')][_0xb514('0x49')]));_0x3816e9[_0xb514('0x48')]=_0x3816e9[_0xb514('0x48')]['length']?_0x3816e9[_0xb514('0x48')]:_0x97fde[_0xb514('0x43')];if(!_0x320112[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x3816e9[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x320112[_0xb514('0x44')]['limit']);_0x3816e9[_0xb514('0x2f')]=qs['offset'](_0x320112['query']['offset']);}_0x3816e9[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x320112[_0xb514('0x44')]['sort']);_0x3816e9[_0xb514('0x4e')]=qs[_0xb514('0x46')](_['pick'](_0x320112['query'],_0x97fde[_0xb514('0x46')]));_0x3816e9[_0xb514('0x4e')][_0xb514('0x67')]=_0x26a935['id'];if(_0x320112[_0xb514('0x44')][_0xb514('0x50')]){_0x3816e9[_0xb514('0x4e')]=_['merge'](_0x3816e9[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x3816e9['attributes'],function(_0x567b08){var _0x1b7bd9={};_0x1b7bd9[_0x567b08]={'$like':'%'+_0x320112[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x1b7bd9;})});}_0x3816e9=_[_0xb514('0x51')]({},_0x3816e9,_0x320112[_0xb514('0x53')]);return db['Disposition']['count']({'where':_0x3816e9[_0xb514('0x4e')]})[_0xb514('0x38')](function(_0x6ce25b){_0x9007c8[_0xb514('0x32')]=_0x6ce25b;if(_0x320112[_0xb514('0x44')]['includeAll']){_0x3816e9[_0xb514('0x55')]=[{'all':!![]}];}return db[_0xb514('0x68')]['findAll'](_0x3816e9);})[_0xb514('0x38')](function(_0x37f1e9){_0x9007c8[_0xb514('0x57')]=_0x37f1e9;return _0x9007c8;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x5b0f9a,_0x3816e9))['catch'](handleError(_0x5b0f9a,null));};exports['removeDispositions']=function(_0x51bdab,_0x369699,_0x344488){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x51bdab[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x369699,null))[_0xb514('0x38')](function(_0xc42cf7){if(_0xc42cf7){return _0xc42cf7[_0xb514('0x6b')](_0x51bdab[_0xb514('0x44')][_0xb514('0x6c')]);}})['then'](respondWithStatusCode(_0x369699,null))['catch'](handleError(_0x369699,null));};exports[_0xb514('0x6d')]=function(_0x2d9c9b,_0x2d6db0,_0x206892){if(_0x2d9c9b[_0xb514('0x5e')]['id']){delete _0x2d9c9b[_0xb514('0x5e')]['id'];}return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x2d9c9b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x2d6db0,null))[_0xb514('0x38')](function(_0x40bbeb){if(_0x40bbeb){_0x2d9c9b['body'][_0xb514('0x67')]=_0x40bbeb['id'];return db['CannedAnswer'][_0xb514('0x5d')](_0x2d9c9b[_0xb514('0x5e')]);}})[_0xb514('0x38')](respondWithResult(_0x2d6db0,null))[_0xb514('0x5c')](handleError(_0x2d6db0,null));};exports[_0xb514('0x6e')]=function(_0x8fc975,_0x333004,_0x2d3137){var _0x2ec448={'raw':![],'where':{}};var _0xcdc64f={};var _0x5654cf={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x8fc975[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x333004,null))[_0xb514('0x38')](function(_0x17d1c6){if(_0x17d1c6){_0xcdc64f[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0x6f')][_0xb514('0x3f')]);_0xcdc64f['query']=_[_0xb514('0x45')](_0x8fc975['query']);_0xcdc64f[_0xb514('0x46')]=_['intersection'](_0xcdc64f['model'],_0xcdc64f[_0xb514('0x44')]);_0x2ec448['attributes']=_[_0xb514('0x47')](_0xcdc64f[_0xb514('0x43')],qs[_0xb514('0x49')](_0x8fc975[_0xb514('0x44')]['fields']));_0x2ec448['attributes']=_0x2ec448['attributes']['length']?_0x2ec448['attributes']:_0xcdc64f['model'];if(!_0x8fc975[_0xb514('0x44')]['hasOwnProperty'](_0xb514('0x4b'))){_0x2ec448[_0xb514('0x31')]=qs['limit'](_0x8fc975[_0xb514('0x44')][_0xb514('0x31')]);_0x2ec448[_0xb514('0x2f')]=qs['offset'](_0x8fc975['query'][_0xb514('0x2f')]);}_0x2ec448[_0xb514('0x4c')]=qs['sort'](_0x8fc975[_0xb514('0x44')][_0xb514('0x4d')]);_0x2ec448[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x8fc975[_0xb514('0x44')],_0xcdc64f[_0xb514('0x46')]));_0x2ec448[_0xb514('0x4e')]['ChatWebsiteId']=_0x17d1c6['id'];if(_0x8fc975['query']['filter']){_0x2ec448[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x2ec448[_0xb514('0x4e')],{'$or':_['map'](_0x2ec448[_0xb514('0x48')],function(_0x578288){var _0x53388e={};_0x53388e[_0x578288]={'$like':'%'+_0x8fc975[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x53388e;})});}_0x2ec448=_['merge']({},_0x2ec448,_0x8fc975[_0xb514('0x53')]);return db[_0xb514('0x6f')][_0xb514('0x32')]({'where':_0x2ec448[_0xb514('0x4e')]})['then'](function(_0x4394f6){_0x5654cf[_0xb514('0x32')]=_0x4394f6;if(_0x8fc975[_0xb514('0x44')][_0xb514('0x54')]){_0x2ec448[_0xb514('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xb514('0x56')](_0x2ec448);})[_0xb514('0x38')](function(_0x33cdca){_0x5654cf[_0xb514('0x57')]=_0x33cdca;return _0x5654cf;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x333004,_0x2ec448))[_0xb514('0x5c')](handleError(_0x333004,null));};exports[_0xb514('0x70')]=function(_0x19a2ac,_0x5844b3,_0x3b63a8){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x19a2ac['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5844b3,null))[_0xb514('0x38')](function(_0x5a3c99){if(_0x5a3c99){return _0x5a3c99['removeAnswers'](_0x19a2ac[_0xb514('0x44')][_0xb514('0x6c')]);}})[_0xb514('0x38')](respondWithStatusCode(_0x5844b3,null))['catch'](handleError(_0x5844b3,null));};exports[_0xb514('0x71')]=function(_0xb9555c,_0xfd497d,_0x2e0448){_0xb9555c[_0xb514('0x5e')]['sitepic']=_0xb9555c[_0xb514('0x72')][_0xb514('0x73')];return db[_0xb514('0x3e')]['find']({'where':{'id':_0xb9555c[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0xfd497d,null))[_0xb514('0x38')](saveUpdates(_0xb9555c[_0xb514('0x5e')],null))[_0xb514('0x38')](respondWithResult(_0xfd497d,null))[_0xb514('0x5c')](handleError(_0xfd497d,null));};exports[_0xb514('0x74')]=function(_0x4e7c84,_0x40fb64,_0x22295b){_0x4e7c84[_0xb514('0x5e')]['agentAvatar']=_0x4e7c84[_0xb514('0x72')][_0xb514('0x73')];return db[_0xb514('0x3e')]['find']({'where':{'id':_0x4e7c84[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x40fb64,null))['then'](saveUpdates(_0x4e7c84[_0xb514('0x5e')],null))['then'](respondWithResult(_0x40fb64,null))['catch'](handleError(_0x40fb64,null));};exports[_0xb514('0x75')]=function(_0x4512da,_0x5819dd,_0x43511b){_0x4512da[_0xb514('0x5e')]['customerAvatar']=_0x4512da[_0xb514('0x72')]['filename'];return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x4512da[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5819dd,null))[_0xb514('0x38')](saveUpdates(_0x4512da[_0xb514('0x5e')],null))['then'](respondWithResult(_0x5819dd,null))['catch'](handleError(_0x5819dd,null));};exports['addSystemAvatar']=function(_0x401753,_0x55b9e8,_0x164e51){_0x401753['body']['systemAvatar']=_0x401753[_0xb514('0x72')]['filename'];return db['ChatWebsite'][_0xb514('0x5b')]({'where':{'id':_0x401753[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x55b9e8,null))[_0xb514('0x38')](saveUpdates(_0x401753[_0xb514('0x5e')],null))['then'](respondWithResult(_0x55b9e8,null))[_0xb514('0x5c')](handleError(_0x55b9e8,null));};exports[_0xb514('0x76')]=function(_0x268c3e,_0xa01d52,_0x5721b5){var _0x20ca6e=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x79'));var _0x403ee1={'where':{'id':_0x268c3e[_0xb514('0x59')]['id']},'attributes':['id',_0xb514('0x7a')],'raw':!![]};var _0x29c604=![];return require(_0xb514('0x7b'))[_0xb514('0x7c')]()[_0xb514('0x38')](function(_0x2e42c0){if(_0x2e42c0){_0x29c604=_0x2e42c0[_0xb514('0x7d')];}})[_0xb514('0x38')](function(){return db[_0xb514('0x3e')]['find'](_0x403ee1);})['then'](handleEntityNotFound(_0xa01d52,null))[_0xb514('0x38')](function(_0x109628){if(_0x109628){if(!_[_0xb514('0x7e')](_0x109628[_0xb514('0x7a')])){if(fs['existsSync'](path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/logos/',_0x109628['sitepic']))&&_0x29c604){_0x20ca6e=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x7f'),_0x109628[_0xb514('0x7a')]);}}return _0xa01d52[_0xb514('0x80')](_0x20ca6e);}})[_0xb514('0x5c')](handleError(_0xa01d52,null));};exports[_0xb514('0x81')]=function(_0x31bb9e,_0x484cf8,_0x51436b){var _0x537207=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x82'));var _0x3e7440={'where':{'id':_0x31bb9e[_0xb514('0x59')]['id']},'attributes':['id',_0xb514('0x83')],'raw':!![]};return db['ChatWebsite'][_0xb514('0x5b')](_0x3e7440)[_0xb514('0x38')](handleEntityNotFound(_0x484cf8,null))[_0xb514('0x38')](function(_0x4cee49){if(_0x4cee49){if(!_['isNil'](_0x4cee49[_0xb514('0x83')])){if(fs['existsSync'](path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/avatars/',_0x4cee49[_0xb514('0x83')]))){_0x537207=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x84'),_0x4cee49[_0xb514('0x83')]);}}return _0x484cf8[_0xb514('0x80')](_0x537207);}})[_0xb514('0x5c')](handleError(_0x484cf8,null));};exports[_0xb514('0x85')]=function(_0x238e91,_0x14de0c,_0xab0f9b){var _0x483032=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x86'));var _0x44d8f5={'where':{'id':_0x238e91[_0xb514('0x59')]['id']},'attributes':['id','customerAvatar',_0xb514('0x87')],'raw':!![]};return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x44d8f5)[_0xb514('0x38')](handleEntityNotFound(_0x14de0c,null))[_0xb514('0x38')](function(_0x1cf1c9){if(_0x1cf1c9){if(!_['isNil'](_0x1cf1c9[_0xb514('0x88')])){if(fs[_0xb514('0x89')](path['join'](config[_0xb514('0x78')],_0xb514('0x84'),_0x1cf1c9[_0xb514('0x88')]))&&_0x1cf1c9[_0xb514('0x87')]){_0x483032=path[_0xb514('0x77')](config[_0xb514('0x78')],'server/files/images/avatars/',_0x1cf1c9[_0xb514('0x88')]);}}return _0x14de0c[_0xb514('0x80')](_0x483032);}})[_0xb514('0x5c')](handleError(_0x14de0c,null));};exports[_0xb514('0x8a')]=function(_0x43ea62,_0x1f81ec,_0x5a18e5){var _0x162284=path[_0xb514('0x77')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x2f22b8={'where':{'id':_0x43ea62[_0xb514('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb514('0x3e')][_0xb514('0x5b')](_0x2f22b8)[_0xb514('0x38')](handleEntityNotFound(_0x1f81ec,null))[_0xb514('0x38')](function(_0x18fdae){if(_0x18fdae){if(!_[_0xb514('0x7e')](_0x18fdae[_0xb514('0x8b')])){if(fs[_0xb514('0x89')](path['join'](config[_0xb514('0x78')],_0xb514('0x84'),_0x18fdae[_0xb514('0x8b')]))){_0x162284=path[_0xb514('0x77')](config[_0xb514('0x78')],_0xb514('0x84'),_0x18fdae['systemAvatar']);}}return _0x1f81ec['download'](_0x162284);}})[_0xb514('0x5c')](handleError(_0x1f81ec,null));};exports['notify']=function(_0x596c20,_0x797e3c,_0x387aab){var _0x16a674=require(_0xb514('0x8c'));var _0xcd9b6d=new _0x16a674();var _0x214701=_0xcd9b6d[_0xb514('0x8d')](_0x596c20[_0xb514('0x8e')][_0xb514('0x8f')])['getResult']();var _0x295cd5={'body':_0x596c20[_0xb514('0x5e')],'channel':'chat'};var _0x34e98c=[];var _0x53caea=[];var _0x56d021={};var _0x10d6ed=![];return db[_0xb514('0x90')][_0xb514('0x66')]()['then'](function(_0x4e2015){if(!_0x4e2015){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x93'));}_0x34e98c=_['difference'](_[_0xb514('0x45')](_0x4e2015),[_0xb514('0x94'),_0xb514('0x95')]);_0x53caea=_[_0xb514('0x96')](_[_0xb514('0x45')](_0x4e2015),[_0xb514('0x94'),'updatedAt',_0xb514('0x97'),'ListId']);if(_0x596c20['body']['id']){delete _0x596c20[_0xb514('0x5e')]['id'];}if(_[_0xb514('0x7e')](_0x596c20[_0xb514('0x5e')][_0xb514('0x98')])){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x99'));}if(_['isNil'](_0x596c20['body']['body'])||_0x596c20['body'][_0xb514('0x5e')]===''){throw new db[(_0xb514('0x91'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb514('0x7e')](_0x596c20[_0xb514('0x5e')]['mapKey'])){throw new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x9a')+_0x53caea);}if(!_[_0xb514('0x9b')](_0x53caea,_0x596c20[_0xb514('0x5e')][_0xb514('0x9c')])){throw new db['Sequelize']['ValidationError'](_0xb514('0x9d')+_0x53caea);}_0x56d021[_0x596c20[_0xb514('0x5e')][_0xb514('0x9c')]]=_0x596c20[_0xb514('0x5e')][_0xb514('0x98')];})['then'](function(){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x596c20[_0xb514('0x59')]['id']},'include':[{'model':db[_0xb514('0x9e')],'as':_0xb514('0x9f'),'include':[{'model':db[_0xb514('0x90')],'as':_0xb514('0xa0'),'where':_0x56d021,'limit':0x1,'order':[[_0xb514('0x95'),_0xb514('0xa1')]]}]},{'model':db[_0xb514('0xa2')],'as':_0xb514('0xa3')}]});})[_0xb514('0x38')](handleEntityNotFound(_0x797e3c,null))[_0xb514('0x38')](function(_0xf442f5){if(_0xf442f5&&_0xf442f5[_0xb514('0x9f')]){_0x295cd5[_0xb514('0xa4')]=_0xf442f5;_0x295cd5[_0xb514('0xa5')]=_0xf442f5[_0xb514('0xa3')];_0x295cd5[_0xb514('0xa6')]=_0xf442f5[_0xb514('0x9f')];_0x295cd5[_0xb514('0xa5')]=_['orderBy'](_0x295cd5[_0xb514('0xa5')],[_0xb514('0xa7')],[_0xb514('0xa8')]);if(_0x295cd5[_0xb514('0xa4')][_0xb514('0xa3')]){delete _0x295cd5[_0xb514('0xa4')][_0xb514('0xa3')];}if(_0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')]&&_0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')][_0xb514('0xa0')]['length']){return _0x295cd5[_0xb514('0xa4')][_0xb514('0x9f')][_0xb514('0xa0')][0x0];}var _0x18f736=_['defaults'](_0x596c20[_0xb514('0x5e')],{'firstName':_0x596c20[_0xb514('0x5e')][_0xb514('0x98')],'ListId':_0xf442f5['ListId']});_0x18f736[_0x596c20['body'][_0xb514('0x9c')]]=_0x596c20[_0xb514('0x5e')][_0xb514('0x98')];return db[_0xb514('0x90')][_0xb514('0x5d')](_0x18f736,{'fields':_0x34e98c,'raw':!![]});}})[_0xb514('0x38')](handleEntityNotFound(_0x797e3c,null))['then'](function(_0x1302bb){_0x295cd5[_0xb514('0xa9')]=_0x1302bb;var _0x226a34=_0x596c20[_0xb514('0x5e')][_0xb514('0xaa')];if(_0x596c20[_0xb514('0x8e')][_0xb514('0xab')]){_0x226a34=_0x596c20[_0xb514('0x8e')][_0xb514('0xab')];}else if(_0x596c20[_0xb514('0x8e')]['x-forwarded-for']){_0x226a34=_[_0xb514('0xac')](_0x596c20[_0xb514('0x8e')][_0xb514('0xad')][_0xb514('0xae')](','));}if(_0x1302bb){var _0x312df5={'ContactId':_0x1302bb['id'],'ChatWebsiteId':_0x596c20['params']['id'],'from':(_0x1302bb[_0xb514('0xaf')]||'')+'\x20'+(_0x1302bb[_0xb514('0xb0')]||''),'customerIp':_0x226a34,'customerPort':_0x596c20[_0xb514('0x8e')][_0xb514('0xb1')]?_0x596c20['headers'][_0xb514('0xb1')]:null,'referer':_0x596c20[_0xb514('0x5e')][_0xb514('0xb2')],'browserName':_0x214701[_0xb514('0xb3')][_0xb514('0x3b')]&&_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]?util[_0xb514('0xb5')](_0xb514('0xb6'),_0x214701[_0xb514('0xb3')][_0xb514('0x3b')],_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]):_0xb514('0xb7'),'browserVersion':_0x214701[_0xb514('0xb3')][_0xb514('0xb4')]||_0xb514('0xb7'),'osName':util['format'](_0xb514('0xb6'),_0x214701['os'][_0xb514('0x3b')],_0x214701['os'][_0xb514('0xb4')]),'osVersion':_0x214701['os'][_0xb514('0xb4')],'deviceModel':_0x214701[_0xb514('0xb8')]['model']&&_0x214701[_0xb514('0xb8')][_0xb514('0xb9')]?util[_0xb514('0xb5')]('%s\x20%s\x20%s',_0x214701[_0xb514('0xb8')][_0xb514('0x43')],_0x214701[_0xb514('0xb8')][_0xb514('0xb9')],_0x214701[_0xb514('0xb8')][_0xb514('0x41')]):null,'deviceVendor':_0x214701[_0xb514('0xb8')][_0xb514('0xb9')],'deviceType':_0x214701['device']['type'],'formData':JSON['stringify'](_0x596c20['body'])};var _0x2134c0={'ChatWebsiteId':_0x596c20['params']['id'],'closed':![]};if(_0x596c20[_0xb514('0x5e')][_0xb514('0xba')]){_0x2134c0[_0xb514('0xba')]=_0x596c20['body'][_0xb514('0xba')];return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':_0x2134c0})[_0xb514('0x38')](function(_0x1240b9){if(_0x1240b9){return[_0x1240b9,![]];}_0x312df5[_0xb514('0xba')]=_0x596c20['body'][_0xb514('0xba')];_0x312df5[_0xb514('0xbc')]=_0x596c20['body'][_0xb514('0xbc')];return db[_0xb514('0xbb')][_0xb514('0x5d')](_0x312df5)[_0xb514('0x38')](function(_0xfc2de2){return[_0xfc2de2,!![]];});});}_0x2134c0[_0xb514('0xbd')]=_0x1302bb['id'];if(_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]&&_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]['id']){_0x2134c0['id']=_0x596c20[_0xb514('0x5e')][_0xb514('0xbe')]['id'];return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':_0x2134c0})['then'](function(_0x4c4d95){if(_0x4c4d95){return[_0x4c4d95,![]];}return db[_0xb514('0xbb')]['create'](_0x312df5)['then'](function(_0x21cdf4){return[_0x21cdf4,!![]];});});}return db['ChatInteraction'][_0xb514('0x5d')](_0x312df5)[_0xb514('0x38')](function(_0x5edbea){return[_0x5edbea,!![]];});}})[_0xb514('0xbf')](function(_0x4d14e4,_0x31892d){if(_0x4d14e4){_0x10d6ed=_0x31892d;if(!_0x31892d){var _0x41c55d={'from':(_0x295cd5['contact'][_0xb514('0xaf')]||'')+'\x20'+(_0x295cd5['contact'][_0xb514('0xb0')]||'')};if(_0x596c20[_0xb514('0x5e')]['threadId']&&_0x596c20[_0xb514('0x5e')]['messageId']&&_0x596c20[_0xb514('0x5e')][_0xb514('0xba')]!=_0x596c20[_0xb514('0x5e')][_0xb514('0xc0')]){_0x41c55d['threadId']=_0x596c20[_0xb514('0x5e')]['messageId'];}return _0x4d14e4['update'](_0x41c55d);}else{return _0x4d14e4;}}})[_0xb514('0x38')](function(_0x1a82e5){_0x295cd5['interaction']=_0x1a82e5[_0xb514('0x61')]({'plain':!![]});_0x295cd5[_0xb514('0xbe')][_0xb514('0xc1')]=_0x10d6ed;if(_0x295cd5[_0xb514('0xbe')][_0xb514('0xc1')]){if(_0x295cd5['account'][_0xb514('0xc2')]){_0x295cd5[_0xb514('0xa5')][_0xb514('0xc3')]({'id':0x0,'priority':_0x295cd5[_0xb514('0xa5')]['length']+0x1,'app':_0xb514('0xc4'),'appdata':_0xb514('0xc5'),'interval':'*,*,*,*'});}}return db[_0xb514('0xc6')]['create']({'body':_0x596c20['body'][_0xb514('0x5e')],'ChatWebsiteId':_0x596c20['params']['id'],'ChatInteractionId':_0x1a82e5['id'],'direction':'in','ContactId':_0x295cd5[_0xb514('0xa9')]['id'],'AttachmentId':_0x596c20['body']['AttachmentId']});})[_0xb514('0x38')](function(_0x1f6819){_0x295cd5[_0xb514('0x28')]=_0x1f6819;if(_0x295cd5[_0xb514('0xbe')][_0xb514('0xc7')]){return db[_0xb514('0xc8')][_0xb514('0x5b')]({'attributes':['id','name'],'where':{'id':_0x295cd5[_0xb514('0xbe')][_0xb514('0xc7')]}})[_0xb514('0x38')](function(_0x22f8aa){if(_0x22f8aa){_0x295cd5[_0xb514('0xa5')][_0xb514('0xc9')]({'id':0x0,'priority':0x0,'app':_0xb514('0xca'),'appdata':_0x22f8aa['name']+','+(_0x295cd5[_0xb514('0xa4')][_0xb514('0xcb')]||0xa),'interval':_0xb514('0xcc')});_0x295cd5[_0xb514('0xcd')]=!![];}return respondWithRpcPromise(_0xb514('0xce'),_0xb514('0xcf'),_0x295cd5);});}return respondWithRpcPromise(_0xb514('0xce'),'startRouting',_0x295cd5);})[_0xb514('0x38')](function(_0x25bef0){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x25bef0},client9002);return _0x25bef0;})[_0xb514('0x38')](respondWithResult(_0x797e3c,null))[_0xb514('0x5c')](handleError(_0x797e3c,null));};exports[_0xb514('0xd0')]=function(_0x981d6c,_0x3f77a5,_0x55d140){var _0x1dec1c,_0x15834a,_0x4027b0;var _0x4170b6=[];var _0x20ee69=[];var _0x14ff73={};var _0x1dbdbc=_0x981d6c[_0xb514('0xd1')]||[];var _0x2255e0=[];var _0x1b678a;return db[_0xb514('0x90')][_0xb514('0x66')]()[_0xb514('0x38')](function(_0x179dbe){if(!_0x179dbe){throw new db['Sequelize'][(_0xb514('0x92'))](_0xb514('0x93'));}_0x20ee69=_[_0xb514('0x96')](_[_0xb514('0x45')](_0x179dbe),[_0xb514('0x94'),_0xb514('0x95')]);_0x4170b6=_['difference'](_['keys'](_0x179dbe),[_0xb514('0x94'),'updatedAt','CompanyId',_0xb514('0xd2')]);if(_0x981d6c[_0xb514('0x5e')]['id']){delete _0x981d6c[_0xb514('0x5e')]['id'];}if(_[_0xb514('0x7e')](_0x981d6c['body'][_0xb514('0x98')])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0x99')));}if(_[_0xb514('0x7e')](_0x981d6c[_0xb514('0x5e')]['body'])||_0x981d6c[_0xb514('0x5e')][_0xb514('0x5e')]===''){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd4')));}if(_[_0xb514('0x7e')](_0x981d6c[_0xb514('0x5e')]['mapKeyOffline'])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)[_0xb514('0xd3')](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd5')+_0x4170b6));}if(!_[_0xb514('0x9b')](_0x4170b6,_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')])){throw _0x3f77a5[_0xb514('0x2c')](0x1f4)['send'](new db[(_0xb514('0x91'))][(_0xb514('0x92'))](_0xb514('0xd7')+_0x4170b6));}_0x14ff73[_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')]]=_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')];})[_0xb514('0x38')](function(){return db[_0xb514('0x3e')]['find']({'where':{'id':_0x981d6c['params']['id']},'include':[{'model':db[_0xb514('0x9e')],'as':_0xb514('0x9f')},{'model':db[_0xb514('0xd8')],'as':'MailAccount'}]});})[_0xb514('0x38')](handleEntityNotFound(_0x3f77a5,null))[_0xb514('0x38')](function(_0x23ee2d){if(_0x23ee2d&&_0x23ee2d['List']){_0x15834a=_0x23ee2d;var _0x2b8645=_[_0xb514('0x19')](_0x981d6c['body'],{'firstName':_0x981d6c['body'][_0xb514('0x98')],'phone':_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')],'ListId':_0x23ee2d[_0xb514('0xd2')]});_0x2b8645[_0x981d6c[_0xb514('0x5e')][_0xb514('0xd6')]]=_0x981d6c[_0xb514('0x5e')][_0xb514('0x98')];return db[_0xb514('0x90')][_0xb514('0xd9')]({'where':_0x14ff73,'defaults':_0x2b8645});}})[_0xb514('0xbf')](function(_0x5a5031){if(_0x5a5031){_0x4027b0=_0x5a5031;var _0x233e04=fs[_0xb514('0xda')](path[_0xb514('0x77')](config['root'],_0xb514('0xdb')),_0xb514('0xdc'));var _0x24e582=ejs[_0xb514('0xdd')](_0x233e04,{'body':_[_0xb514('0xde')](_0x981d6c[_0xb514('0x5e')][_0xb514('0x5e')]),'bodyTitle':_0x15834a[_0xb514('0xdf')]});return db[_0xb514('0xe0')][_0xb514('0x5d')]({'body':_0x24e582,'ContactId':_0x5a5031['id'],'ChatWebsiteId':_0x15834a['id']});}})['then'](function(_0x59942b){_0x1b678a=_0x59942b;if(_0x1dbdbc['length']){var _0xb89ada=_0x1dbdbc['map'](function(_0x5e5299){return{'name':_0x5e5299['originalname'],'basename':_0x5e5299[_0xb514('0x73')],'type':_0x5e5299[_0xb514('0xe1')],'ChatOfflineMessageId':_0x59942b['id']};});_0x2255e0=_0xb89ada[_0xb514('0x3d')](_0x1b7e5f=>{var _0x5cf898={'filename':_0x1b7e5f[_0xb514('0x3b')],'path':path['join'](config[_0xb514('0x78')],_0xb514('0xe2'),_0xb514('0xd1'),_0xb514('0xe3'),_0xb514('0xe4'),_0x1b7e5f[_0xb514('0xe5')])};return _0x5cf898;});if(!_0x15834a[_0xb514('0xe6')]){return db[_0xb514('0xe7')]['transaction'](function(_0xd777d6){return db[_0xb514('0xe8')][_0xb514('0xe9')](_0xb89ada,{'transaction':_0xd777d6});});}}})[_0xb514('0x38')](function(){if(_0x1b678a){_0x1dec1c=_0x1b678a;return db['MailAccount'][_0xb514('0x6a')]({'where':{'active':!![]},'include':[{'model':db[_0xb514('0xea')],'as':_0xb514('0xeb'),'raw':!![]}]});}})[_0xb514('0x38')](function(_0x179c04){if(_0x179c04&&_0x179c04[_0xb514('0xeb')]&&_0x15834a[_0xb514('0xec')]&&_0x15834a[_0xb514('0xed')]){var _0x429da8={'tls':{'rejectUnauthorized':![]}};if(_0x179c04[_0xb514('0xeb')][_0xb514('0xee')]){_0x429da8[_0xb514('0xee')]=_0x179c04[_0xb514('0xeb')]['service'];}else{_0x429da8[_0xb514('0xef')]=_0x179c04['Smtp']['host'];_0x429da8[_0xb514('0xf0')]=_0x179c04[_0xb514('0xeb')][_0xb514('0xf0')];_0x429da8[_0xb514('0xf1')]=_0x179c04[_0xb514('0xeb')][_0xb514('0xf1')];}if(_0x179c04[_0xb514('0xeb')][_0xb514('0xf2')]){_0x429da8[_0xb514('0xf3')]={'user':_0x179c04[_0xb514('0xeb')][_0xb514('0x5f')],'pass':_0x179c04[_0xb514('0xeb')]['pass']};}return respondWithRpcPromise('SendMail',_0xb514('0xf4'),{'account':_0x429da8,'message':{'from':util['format'](_0xb514('0xf5'),_0x179c04['name'],_0x179c04['email']||_0x179c04[_0xb514('0xeb')][_0xb514('0x5f')]),'to':_0x15834a['forwardOfflineAddress'],'subject':_0x15834a['offlineMessageSubject'],'html':_0x1dec1c[_0xb514('0x5e')],'attachments':_0x2255e0}},client9003)[_0xb514('0x38')](function(){return _0x1dec1c;})[_0xb514('0x5c')](function(_0x1aba5c){console[_0xb514('0x26')](_0x1aba5c);});}})['then'](function(){if(_0x15834a&&_0x15834a['openNewInteraction']&&_0x15834a[_0xb514('0xf6')]){var _0xe65525=[];if(_0x1dbdbc[_0xb514('0xf7')]){_0xe65525=_0x1dbdbc[_0xb514('0x3d')](function(_0x15584d){return{'name':_0x15584d[_0xb514('0xf8')],'basename':_0x15584d[_0xb514('0x73')],'type':_0x15584d[_0xb514('0xe1')],'ChatOfflineMessageId':_0x1b678a['id']};});}var _0x53208e;if(!_[_0xb514('0x7e')](_0x15834a[_0xb514('0xf9')])){var _0x2389d5=_[_0xb514('0x3d')](_0x981d6c['body'],function(_0x4786e6){return _0x4786e6;});var _0x14558a=_['toPairsIn'](_0x2389d5)[0x0];var _0x543ffe=_['mapValues'](_0x14558a,function(_0x361b7b){return _0x361b7b;});_0x53208e=_0x543ffe[0x1][_0x15834a[_0xb514('0xf9')]];}var _0x1b3591={'from':_0x4027b0[_0xb514('0xfa')],'firstName':_0x4027b0['firstName'],'lastName':_0x4027b0['lastName'],'mapKey':_0xb514('0xfa'),'message':{'from':_0x4027b0[_0xb514('0xfa')],'to':_0x15834a['MailAccount'][_0xb514('0xfa')],'cc':'','subject':_[_0xb514('0x7e')](_0x53208e)?_0x15834a[_0xb514('0xfb')]:_0x53208e,'messageId':'','sentAt':new Date(),'attach':_0xe65525['length'],'attachments':_0xe65525,'originChannel':_0xb514('0xfc'),'ChatWebsiteId':_0x15834a['id'],'ChatOfflineMessageId':_0x1dec1c['id'],'originTo':_0x15834a['MailAccount']['email']},'body':_0x1dec1c[_0xb514('0x5e')]};var _0x715c1f={'account':{'id':_0x15834a[_0xb514('0xf6')]},'body':_0x1b3591,'log':_0xb514('0xfd')};return respondWithRpcPromise(_0xb514('0xfd'),_0xb514('0xfe'),_0x715c1f,client9001)[_0xb514('0x38')](function(){return _0x1dec1c;})[_0xb514('0x5c')](function(_0x375541){console[_0xb514('0x26')](_0x375541);});}return;})[_0xb514('0x38')](function(){if(_0x1dec1c){return _0x1dec1c;}})[_0xb514('0x38')](respondWithResult(_0x3f77a5,null))[_0xb514('0x5c')](function(_0xcad9ec){console[_0xb514('0x26')](_0xb514('0x5c'),_0xcad9ec);for(var _0x4374da of _0x1dbdbc){var _0x12e8d5=path[_0xb514('0x77')](config['root'],_0xb514('0xe2'),'files',_0xb514('0xe3'),_0xb514('0xe4'),_0x4374da[_0xb514('0x73')]);fs_extra[_0xb514('0xff')](_0x12e8d5)[_0xb514('0x5c')](function(_0x4c9a1f){console[_0xb514('0x26')](_0xb514('0x100'),_0x12e8d5,_0x4c9a1f);});}});};exports[_0xb514('0x101')]=function(_0x1f197e,_0x210553,_0x3fabbc){return db[_0xb514('0xbb')][_0xb514('0x5b')]({'where':{'id':_0x1f197e[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x210553,null))[_0xb514('0x38')](function(_0x427fb1){if(_0x427fb1){return _0x427fb1[_0xb514('0x101')](_0x1f197e[_0xb514('0x5e')]['ids'],_[_0xb514('0x102')](_0x1f197e['body'],[_0xb514('0x6c'),'id'])||{});}})[_0xb514('0x38')](respondWithResult(_0x210553,null))[_0xb514('0x5c')](handleError(_0x210553,null));};exports[_0xb514('0x103')]=function(_0x49edab,_0x59be2d,_0x55f105){var _0x50aa0c={'raw':![],'where':{}};var _0x1c81a3={};var _0x50d8db={'count':0x0,'rows':[]};return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x49edab['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x59be2d,null))[_0xb514('0x38')](function(_0x1c1439){if(_0x1c1439){_0x1c81a3[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0xbb')][_0xb514('0x3f')]);_0x1c81a3[_0xb514('0x44')]=_[_0xb514('0x45')](_0x49edab[_0xb514('0x44')]);_0x1c81a3['filters']=_['intersection'](_0x1c81a3[_0xb514('0x43')],_0x1c81a3[_0xb514('0x44')]);_0x50aa0c[_0xb514('0x48')]=_['intersection'](_0x1c81a3['model'],qs[_0xb514('0x49')](_0x49edab[_0xb514('0x44')][_0xb514('0x49')]));_0x50aa0c[_0xb514('0x48')]=_0x50aa0c[_0xb514('0x48')][_0xb514('0xf7')]?_0x50aa0c[_0xb514('0x48')]:_0x1c81a3[_0xb514('0x43')];if(!_0x49edab[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x50aa0c['limit']=qs['limit'](_0x49edab[_0xb514('0x44')][_0xb514('0x31')]);_0x50aa0c[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x49edab[_0xb514('0x44')][_0xb514('0x2f')]);}_0x50aa0c[_0xb514('0x4c')]=qs['sort'](_0x49edab[_0xb514('0x44')][_0xb514('0x4d')]);_0x50aa0c[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x49edab[_0xb514('0x44')],_0x1c81a3[_0xb514('0x46')]));_0x50aa0c[_0xb514('0x4e')][_0xb514('0x67')]=_0x1c1439['id'];if(_0x49edab[_0xb514('0x44')][_0xb514('0x50')]){_0x50aa0c[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x50aa0c[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x50aa0c[_0xb514('0x48')],function(_0x354cbf){var _0x389879={};_0x389879[_0x354cbf]={'$like':'%'+_0x49edab[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x389879;})});}_0x50aa0c=_[_0xb514('0x51')]({},_0x50aa0c,_0x49edab[_0xb514('0x53')]);return db['ChatInteraction'][_0xb514('0x32')]({'where':_0x50aa0c[_0xb514('0x4e')]})['then'](function(_0x1f6e8a){_0x50d8db['count']=_0x1f6e8a;if(_0x49edab[_0xb514('0x44')][_0xb514('0x54')]){_0x50aa0c['include']=[{'model':db[_0xb514('0x90')],'as':_0xb514('0x104'),'required':![]},{'model':db['User'],'as':_0xb514('0x105'),'attributes':['name',_0xb514('0x106'),_0xb514('0x107')],'required':![]},{'model':db[_0xb514('0x108')],'as':'Tags','attributes':['id',_0xb514('0x3b'),_0xb514('0x109')],'where':_0x49edab[_0xb514('0x44')][_0xb514('0x10a')]?{'id':_0x49edab[_0xb514('0x44')][_0xb514('0x10a')]}:undefined,'required':_0x49edab['query'][_0xb514('0x10a')]?!![]:![]}];}return db['ChatInteraction'][_0xb514('0x56')](_0x50aa0c);})[_0xb514('0x38')](function(_0x37c145){_0x50d8db['rows']=_0x37c145;return _0x50d8db;});}})['then'](respondWithFilteredResult(_0x59be2d,_0x50aa0c))[_0xb514('0x5c')](handleError(_0x59be2d,null));};function iftimePromise(_0x788d73,_0x492c26){return respondWithRpcPromise(_0xb514('0x10b'),_0xb514('0x10c'),{'command':_0x492c26[_0xb514('0x10d')]?util[_0xb514('0xb5')](_0xb514('0x10e'),_0x788d73['interval'],_0x492c26[_0xb514('0x10d')]):util[_0xb514('0xb5')]('iftime\x20%s',_0x788d73[_0xb514('0x10f')])},client9002)['then'](function(_0x1fd1bd){var _0x334586=_0x1fd1bd&&_0x1fd1bd['indexOf'](_0xb514('0x110'))>=0x0?!![]:![];logger[_0xb514('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x492c26['id'],_0x788d73['id'],_0x788d73[_0xb514('0x10f')],_0x334586?_0xb514('0x111'):'OFFLINE',_0x492c26[_0xb514('0x10d')]?_0x492c26[_0xb514('0x10d')]:_0xb514('0x112'));return _0x334586;})[_0xb514('0x5c')](function(_0x574543){logger['error'](_0xb514('0x113'),_0x492c26['id'],_0x788d73['id'],_0x788d73[_0xb514('0x10f')],util[_0xb514('0x114')](_0x574543,{'showHidden':![],'depth':null}),_0x492c26[_0xb514('0x10d')]?_0x492c26[_0xb514('0x10d')]:'No\x20timezone');return![];});}exports[_0xb514('0x10c')]=function(_0x3b0387,_0x4eba3e,_0x3ebe67){var _0x250eb9=0x0;var _0x1a24a9=0x0;var _0x310a55=![];var _0x5d4bfc;var _0x5568e4;return db[_0xb514('0x3e')]['find']({'where':{'id':_0x3b0387[_0xb514('0x59')]['id']},'include':[{'model':db['Interval'],'as':_0xb514('0x115'),'include':[{'model':db[_0xb514('0x115')],'as':_0xb514('0x116'),'attributes':['id',_0xb514('0x10f')],'raw':!![]}]}]})[_0xb514('0x38')](handleEntityNotFound(_0x4eba3e,null))['then'](function(_0x294641){if(_0x294641){_0x5d4bfc=_0x294641;return _0x294641[_0xb514('0x117')]({'raw':!![]});}})['then'](function(_0x471ecd){if(_0x5d4bfc){if(_0x471ecd){_0x5568e4=_0x471ecd;}}return require(_0xb514('0x7b'))[_0xb514('0x7c')]();})[_0xb514('0x38')](function(_0x1ff43b){if(_0x1ff43b){_0x1a24a9=_0x1ff43b[_0xb514('0x118')];_0x310a55=_0x1ff43b[_0xb514('0x7d')];}})[_0xb514('0x38')](function(){return db[_0xb514('0xbb')][_0xb514('0x32')]({'where':{'closed':![]}});})[_0xb514('0x38')](function(_0x331055){_0x250eb9=_0x331055;if(_0x1a24a9&&_0x331055>_0x1a24a9){return db[_0xb514('0x119')][_0xb514('0x6a')]({'where':{'id':0x1}})[_0xb514('0x38')](function(_0x515e4f){if(_0x515e4f){_0x515e4f[_0xb514('0x11a')]('chatLicenseExceeded');}});}})[_0xb514('0x38')](function(){if(_0x5d4bfc[_0xb514('0x115')]&&_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')]){var _0x40997d=[];for(var _0x52db77=0x0;_0x52db77<_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')]['length'];_0x52db77++){var _0x449e1f=_0x5d4bfc[_0xb514('0x115')][_0xb514('0x116')][_0x52db77][_0xb514('0x61')]({'plain':!![]});_0x40997d[_0xb514('0xc3')](iftimePromise(_0x449e1f,_0x5d4bfc));}return BPromise[_0xb514('0x11b')](_0x40997d)[_0xb514('0x38')](function(_0xcf3572){return _[_0xb514('0x11c')](_0xcf3572);});}else{return!![];}})[_0xb514('0x38')](function(_0x322d87){var _0x35176c=fs[_0xb514('0xda')](path['join'](config[_0xb514('0x78')],_0xb514('0x11d')),_0xb514('0xdc'));var _0x2e3b78={'remote':_0x5d4bfc[_0xb514('0x11e')],'query':querystring[_0xb514('0x25')](_['merge'](_0x5d4bfc[_0xb514('0x61')]({'plain':!![]}),{'customerIp':_0x3b0387[_0xb514('0x8e')][_0xb514('0xad')]||_0x3b0387['headers'][_0xb514('0x11f')]||_0x3b0387[_0xb514('0x120')]['remoteAddress']||_0x3b0387['ip'],'referer':_0x3b0387['headers'][_0xb514('0xb2')],'openedInteractions':_0x250eb9,'maxInteractions':_0x1a24a9,'virtual':_0x310a55[_0xb514('0x118')],'online':_0x322d87,'custom':_0x310a55}))[_0xb514('0x121')](/'/g,'\x5c\x27')};_0x4eba3e['send'](ejs['render'](Mustache[_0xb514('0xdd')](_0x35176c,_0x2e3b78),{'proactiveActions':_0x5568e4,'alignment':_0x5d4bfc[_0xb514('0x122')],'verticalAlignment':_0x5d4bfc[_0xb514('0x123')],'div_color':_0x5d4bfc[_0xb514('0x109')],'text_color':_0x5d4bfc['textColor'],'button_color':_0x5d4bfc[_0xb514('0x124')],'background_color':_0x5d4bfc[_0xb514('0x125')]}));})[_0xb514('0x5c')](handleError(_0x4eba3e,null));};exports[_0xb514('0x126')]=function(_0xf67543,_0x587b4b,_0x587d79){return db['ChatWebsite']['findOne']({'where':{'id':_0xf67543['params']['id']}})['then'](handleEntityNotFound(_0x587b4b,null))[_0xb514('0x38')](function(_0x3796fd){if(_0x3796fd){return db[_0xb514('0xe7')][_0xb514('0x127')](function(_0x57989d){return db[_0xb514('0xa2')][_0xb514('0x39')]({'where':{'ChatWebsiteId':_0xf67543[_0xb514('0x59')]['id']},'transaction':_0x57989d})[_0xb514('0x38')](function(_0x255dbf){var _0xc29c32=_[_0xb514('0x3d')](_0xf67543[_0xb514('0x5e')],function(_0x11db5d){_0x11db5d[_0xb514('0x67')]=_0xf67543[_0xb514('0x59')]['id'];return _0x11db5d;});return db[_0xb514('0xa2')]['bulkCreate'](_0xc29c32,{'transaction':_0x57989d});});})[_0xb514('0x38')](function(){return db[_0xb514('0xa2')][_0xb514('0x128')]({'where':{'ChatWebsiteId':_0xf67543[_0xb514('0x59')]['id']},'order':_0xb514('0xa7')});});}})[_0xb514('0x38')](respondWithResult(_0x587b4b,null))[_0xb514('0x5c')](handleError(_0x587b4b,null));};exports['getApplications']=function(_0x4cf11c,_0x340657,_0x16ae37){var _0x16a91f={};var _0x5c9a92={};var _0x4fd69a;var _0x4ce215;return db['ChatWebsite'][_0xb514('0x6a')]({'where':{'id':_0x4cf11c[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x340657,null))['then'](function(_0xd83305){if(_0xd83305){_0x4fd69a=_0xd83305;_0x5c9a92[_0xb514('0x43')]=_[_0xb514('0x45')](db[_0xb514('0xa2')][_0xb514('0x3f')]);_0x5c9a92[_0xb514('0x44')]=_[_0xb514('0x45')](_0x4cf11c[_0xb514('0x44')]);_0x5c9a92[_0xb514('0x46')]=_[_0xb514('0x47')](_0x5c9a92[_0xb514('0x43')],_0x5c9a92[_0xb514('0x44')]);_0x16a91f[_0xb514('0x48')]=_[_0xb514('0x47')](_0x5c9a92['model'],qs['fields'](_0x4cf11c['query'][_0xb514('0x49')]));_0x16a91f[_0xb514('0x48')]=_0x16a91f[_0xb514('0x48')][_0xb514('0xf7')]?_0x16a91f[_0xb514('0x48')]:_0x5c9a92[_0xb514('0x43')];_0x16a91f[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x4cf11c[_0xb514('0x44')]['sort']);_0x16a91f[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x4cf11c[_0xb514('0x44')],_0x5c9a92[_0xb514('0x46')]));if(_0x4cf11c[_0xb514('0x44')]['filter']){_0x16a91f[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x16a91f['where'],{'$or':_[_0xb514('0x3d')](_0x16a91f['attributes'],function(_0x4b3374){var _0x745a57={};_0x745a57[_0x4b3374]={'$like':'%'+_0x4cf11c[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x745a57;})});}_0x16a91f=_[_0xb514('0x51')]({},_0x16a91f,_0x4cf11c[_0xb514('0x53')]);return _0x4fd69a[_0xb514('0x129')](_0x16a91f);}})[_0xb514('0x38')](function(_0x4e1920){if(_0x4e1920){_0x4ce215=_0x4e1920[_0xb514('0xf7')];if(!_0x4cf11c[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x16a91f[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x4cf11c['query'][_0xb514('0x31')]);_0x16a91f['offset']=qs[_0xb514('0x2f')](_0x4cf11c['query'][_0xb514('0x2f')]);}return _0x4fd69a[_0xb514('0x129')](_0x16a91f);}})[_0xb514('0x38')](function(_0x430ffd){if(_0x430ffd){return _0x430ffd?{'count':_0x4ce215,'rows':_0x430ffd}:null;}})[_0xb514('0x38')](respondWithResult(_0x340657,null))['catch'](handleError(_0x340657,null));};exports[_0xb514('0x12a')]=function(_0x5582e5,_0x4728cb,_0x356cf8){return db[_0xb514('0x12b')][_0xb514('0x5b')]({'where':{'id':_0x5582e5[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x4728cb,null))[_0xb514('0x38')](function(_0xb8397f){if(_0xb8397f){return _0xb8397f[_0xb514('0x12a')](_0x5582e5[_0xb514('0x5e')][_0xb514('0x6c')],_[_0xb514('0x102')](_0x5582e5[_0xb514('0x5e')],[_0xb514('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x4728cb,null))['catch'](handleError(_0x4728cb,null));};exports['getProactiveActions']=function(_0x13d8be,_0x484428,_0x275eff){var _0x5e8008={};var _0x3a6d97={};var _0x561a7e;var _0x187d16;return db[_0xb514('0x3e')]['findOne']({'where':{'id':_0x13d8be[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x484428,null))[_0xb514('0x38')](function(_0x393e7e){if(_0x393e7e){_0x561a7e=_0x393e7e;_0x3a6d97[_0xb514('0x43')]=_[_0xb514('0x45')](db['ChatProactiveAction']['rawAttributes']);_0x3a6d97[_0xb514('0x44')]=_[_0xb514('0x45')](_0x13d8be[_0xb514('0x44')]);_0x3a6d97[_0xb514('0x46')]=_[_0xb514('0x47')](_0x3a6d97[_0xb514('0x43')],_0x3a6d97[_0xb514('0x44')]);_0x5e8008[_0xb514('0x48')]=_['intersection'](_0x3a6d97[_0xb514('0x43')],qs[_0xb514('0x49')](_0x13d8be[_0xb514('0x44')][_0xb514('0x49')]));_0x5e8008[_0xb514('0x48')]=_0x5e8008[_0xb514('0x48')][_0xb514('0xf7')]?_0x5e8008['attributes']:_0x3a6d97[_0xb514('0x43')];_0x5e8008[_0xb514('0x4c')]=qs[_0xb514('0x4d')](_0x13d8be['query'][_0xb514('0x4d')]);_0x5e8008['where']=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0x13d8be[_0xb514('0x44')],_0x3a6d97[_0xb514('0x46')]));if(_0x13d8be[_0xb514('0x44')][_0xb514('0x50')]){_0x5e8008['where']=_[_0xb514('0x51')](_0x5e8008[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x5e8008[_0xb514('0x48')],function(_0x877ec1){var _0x5e730a={};_0x5e730a[_0x877ec1]={'$like':'%'+_0x13d8be[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x5e730a;})});}_0x5e8008=_['merge']({},_0x5e8008,_0x13d8be[_0xb514('0x53')]);return _0x561a7e[_0xb514('0x117')](_0x5e8008);}})[_0xb514('0x38')](function(_0x3c4ac5){if(_0x3c4ac5){_0x187d16=_0x3c4ac5[_0xb514('0xf7')];if(!_0x13d8be[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x5e8008[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x13d8be[_0xb514('0x44')]['limit']);_0x5e8008[_0xb514('0x2f')]=qs[_0xb514('0x2f')](_0x13d8be[_0xb514('0x44')]['offset']);}return _0x561a7e[_0xb514('0x117')](_0x5e8008);}})['then'](function(_0x599b91){if(_0x599b91){return _0x599b91?{'count':_0x187d16,'rows':_0x599b91}:null;}})[_0xb514('0x38')](respondWithResult(_0x484428,null))[_0xb514('0x5c')](handleError(_0x484428,null));};exports[_0xb514('0x12c')]=function(_0x66f20b,_0x55c0df,_0x3a1e50){var _0x4c30d4=_0x66f20b['query'][_0xb514('0x12d')]===_0xb514('0x12e')?_0xb514('0x12f'):_0xb514('0x130');return db[_0xb514('0x3e')]['find']({'attributes':['id',_0x4c30d4],'where':{'id':_0x66f20b[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x55c0df,null))[_0xb514('0x38')](function(_0x253778){if(_0x253778){var _0xf81c39=_0x253778[_0x4c30d4];var _0x52a5c7=_0xf81c39&&_0xf81c39[_0xb514('0x131')]?_0xf81c39[_0xb514('0x131')]:[];_0x55c0df[_0xb514('0xd3')]({'fromKey':_[_0xb514('0x7e')](_0xf81c39['fromKey'])?undefined:_0xf81c39['fromKey'],'count':_0x52a5c7[_0xb514('0xf7')],'rows':_0x52a5c7});}})[_0xb514('0x5c')](handleError(_0x55c0df,null));};exports[_0xb514('0x132')]=function(_0xaeb015,_0x1cb8e1,_0x3c70c9){var _0x35d28f={'raw':![],'where':{}};var _0x10e5ac={};var _0x34fec6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0xaeb015[_0xb514('0x59')]['id']}})['then'](handleEntityNotFound(_0x1cb8e1,null))[_0xb514('0x38')](function(_0x17d4b1){if(_0x17d4b1){_0x10e5ac[_0xb514('0x43')]=_[_0xb514('0x45')](db['ChatOfflineMessage']['rawAttributes']);_0x10e5ac[_0xb514('0x44')]=_[_0xb514('0x45')](_0xaeb015[_0xb514('0x44')]);_0x10e5ac[_0xb514('0x46')]=_[_0xb514('0x47')](_0x10e5ac[_0xb514('0x43')],_0x10e5ac[_0xb514('0x44')]);_0x35d28f[_0xb514('0x48')]=_['intersection'](_0x10e5ac[_0xb514('0x43')],qs[_0xb514('0x49')](_0xaeb015[_0xb514('0x44')]['fields']));_0x35d28f[_0xb514('0x48')]=_0x35d28f['attributes'][_0xb514('0xf7')]?_0x35d28f[_0xb514('0x48')]:_0x10e5ac[_0xb514('0x43')];if(!_0xaeb015[_0xb514('0x44')][_0xb514('0x4a')](_0xb514('0x4b'))){_0x35d28f['limit']=qs[_0xb514('0x31')](_0xaeb015[_0xb514('0x44')][_0xb514('0x31')]);_0x35d28f['offset']=qs['offset'](_0xaeb015[_0xb514('0x44')][_0xb514('0x2f')]);}_0x35d28f['order']=qs[_0xb514('0x4d')](_0xaeb015['query'][_0xb514('0x4d')]);_0x35d28f[_0xb514('0x4e')]=qs[_0xb514('0x46')](_[_0xb514('0x4f')](_0xaeb015[_0xb514('0x44')],_0x10e5ac[_0xb514('0x46')]));_0x35d28f[_0xb514('0x4e')][_0xb514('0x67')]=_0x17d4b1['id'];if(_0xaeb015[_0xb514('0x44')][_0xb514('0x50')]){_0x35d28f['where']=_['merge'](_0x35d28f[_0xb514('0x4e')],{'$or':_[_0xb514('0x3d')](_0x35d28f[_0xb514('0x48')],function(_0x4a9717){var _0x1c8896={};_0x1c8896[_0x4a9717]={'$like':'%'+_0xaeb015[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x1c8896;})});}_0x35d28f=_[_0xb514('0x51')]({},_0x35d28f,_0xaeb015[_0xb514('0x53')]);return db[_0xb514('0xe0')][_0xb514('0x32')]({'where':_0x35d28f[_0xb514('0x4e')]})['then'](function(_0x12db75){_0x34fec6[_0xb514('0x32')]=_0x12db75;if(_0xaeb015[_0xb514('0x44')][_0xb514('0x54')]){_0x35d28f[_0xb514('0x55')]=[{'all':!![]}];}else{_0x35d28f['include']=[{'model':db[_0xb514('0x90')],'as':_0xb514('0x104'),'required':![]},{'model':db[_0xb514('0xe8')],'as':_0xb514('0x133'),'required':![]}];}return db['ChatOfflineMessage'][_0xb514('0x56')](_0x35d28f);})['then'](function(_0x518804){_0x34fec6['rows']=_0x518804;return _0x34fec6;});}})[_0xb514('0x38')](respondWithFilteredResult(_0x1cb8e1,_0x35d28f))['catch'](handleError(_0x1cb8e1,null));};exports[_0xb514('0x134')]=function(_0x4775f2,_0x166a59,_0x490dad){return db[_0xb514('0x3e')][_0xb514('0x5b')]({'where':{'id':_0x4775f2['params']['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x166a59,null))[_0xb514('0x38')](function(_0x3ee0a6){if(_0x3ee0a6){return _0x3ee0a6[_0xb514('0x134')](_0x4775f2[_0xb514('0x5e')][_0xb514('0x6c')],_['omit'](_0x4775f2[_0xb514('0x5e')],['ids','id'])||{})['spread'](function(_0x371f23){for(var _0x256668=0x0;_0x256668<_0x4775f2['body'][_0xb514('0x6c')][_0xb514('0xf7')];_0x256668+=0x1){socket[_0xb514('0x135')](_0xb514('0x136'),{'UserId':Number(_0x4775f2['body'][_0xb514('0x6c')][_0x256668]),'ChatWebsiteId':Number(_0x4775f2[_0xb514('0x59')]['id'])});}return _0x371f23;});}})['then'](respondWithResult(_0x166a59,null))['catch'](handleError(_0x166a59,null));};exports[_0xb514('0x137')]=function(_0xf01c4f,_0x34ef9c,_0x98ea1){return db['ChatWebsite'][_0xb514('0x5b')]({'where':{'id':_0xf01c4f[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x34ef9c,null))[_0xb514('0x38')](function(_0x3835e2){if(_0x3835e2){return _0x3835e2[_0xb514('0x137')](_0xf01c4f[_0xb514('0x44')][_0xb514('0x6c')])[_0xb514('0x38')](function(){if(_[_0xb514('0x138')](_0xf01c4f['query'][_0xb514('0x6c')])){for(var _0x17705f=0x0;_0x17705f<_0xf01c4f[_0xb514('0x44')]['ids'][_0xb514('0xf7')];_0x17705f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xf01c4f['query'][_0xb514('0x6c')][_0x17705f]),'ChatWebsiteId':Number(_0xf01c4f[_0xb514('0x59')]['id'])});}}else{socket[_0xb514('0x135')](_0xb514('0x139'),{'UserId':Number(_0xf01c4f['query'][_0xb514('0x6c')]),'ChatWebsiteId':Number(_0xf01c4f[_0xb514('0x59')]['id'])});}});}})[_0xb514('0x38')](respondWithStatusCode(_0x34ef9c,null))[_0xb514('0x5c')](handleError(_0x34ef9c,null));};exports[_0xb514('0x13a')]=function(_0x39a9ab,_0x5df804,_0x59bf33){var _0x33a405={};var _0x24b57c={};var _0x21d7de;var _0x128283;return db[_0xb514('0x3e')][_0xb514('0x6a')]({'where':{'id':_0x39a9ab[_0xb514('0x59')]['id']}})[_0xb514('0x38')](handleEntityNotFound(_0x5df804,null))['then'](function(_0x57511d){if(_0x57511d){_0x21d7de=_0x57511d;_0x24b57c[_0xb514('0x43')]=_[_0xb514('0x45')](db['User']['rawAttributes']);_0x24b57c[_0xb514('0x44')]=_[_0xb514('0x45')](_0x39a9ab[_0xb514('0x44')]);_0x24b57c['filters']=_[_0xb514('0x47')](_0x24b57c[_0xb514('0x43')],_0x24b57c[_0xb514('0x44')]);_0x33a405['attributes']=_[_0xb514('0x47')](_0x24b57c[_0xb514('0x43')],qs[_0xb514('0x49')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x49')]));_0x33a405[_0xb514('0x48')]=_0x33a405[_0xb514('0x48')][_0xb514('0xf7')]?_0x33a405[_0xb514('0x48')]:_0x24b57c['model'];_0x33a405['order']=qs['sort'](_0x39a9ab[_0xb514('0x44')][_0xb514('0x4d')]);_0x33a405[_0xb514('0x4e')]=qs['filters'](_[_0xb514('0x4f')](_0x39a9ab[_0xb514('0x44')],_0x24b57c[_0xb514('0x46')]));if(_0x39a9ab[_0xb514('0x44')][_0xb514('0x50')]){_0x33a405[_0xb514('0x4e')]=_[_0xb514('0x51')](_0x33a405['where'],{'$or':_['map'](_0x33a405[_0xb514('0x48')],function(_0x564538){var _0x5d362f={};_0x5d362f[_0x564538]={'$like':'%'+_0x39a9ab[_0xb514('0x44')][_0xb514('0x50')]+'%'};return _0x5d362f;})});}_0x33a405=_['merge']({},_0x33a405,_0x39a9ab['options']);return _0x21d7de[_0xb514('0x13a')](_0x33a405);}})[_0xb514('0x38')](function(_0x9f5cc9){if(_0x9f5cc9){_0x128283=_0x9f5cc9[_0xb514('0xf7')];if(!_0x39a9ab[_0xb514('0x44')]['hasOwnProperty'](_0xb514('0x4b'))){_0x33a405[_0xb514('0x31')]=qs[_0xb514('0x31')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x31')]);_0x33a405['offset']=qs[_0xb514('0x2f')](_0x39a9ab[_0xb514('0x44')][_0xb514('0x2f')]);}return _0x21d7de[_0xb514('0x13a')](_0x33a405);}})[_0xb514('0x38')](function(_0x285749){if(_0x285749){return _0x285749?{'count':_0x128283,'rows':_0x285749}:null;}})['then'](respondWithResult(_0x5df804,null))[_0xb514('0x5c')](handleError(_0x5df804,null));}; \ No newline at end of file +var _0xed85=['interval','iftime\x20%s','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color','textColor','color_button','addApplications','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','get','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','options','includeAll','findAll','rows','show','params','fields','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','find','describe','addDisposition','Disposition','findOne','pick','ChatWebsiteId','include','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','offline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','basename','sequelize','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','tag','Command','getSnippet','timezone'];(function(_0x28f412,_0x58a85c){var _0xe2c715=function(_0xeacc0d){while(--_0xeacc0d){_0x28f412['push'](_0x28f412['shift']());}};_0xe2c715(++_0x58a85c);}(_0xed85,0x160));var _0x5ed8=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0xed85[_0x5b64a1];return _0x4b6f55;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ed8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ed8('0x1'));var moment=require(_0x5ed8('0x2'));var BPromise=require(_0x5ed8('0x3'));var Mustache=require('mustache');var util=require(_0x5ed8('0x4'));var path=require('path');var sox=require(_0x5ed8('0x5'));var csv=require(_0x5ed8('0x6'));var ejs=require(_0x5ed8('0x7'));var fs=require('fs');var fs_extra=require(_0x5ed8('0x8'));var _=require(_0x5ed8('0x9'));var squel=require(_0x5ed8('0xa'));var crypto=require(_0x5ed8('0xb'));var jsforce=require(_0x5ed8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5ed8('0x6'));var querystring=require(_0x5ed8('0xd'));var Papa=require(_0x5ed8('0xe'));var Redis=require(_0x5ed8('0xf'));var authService=require(_0x5ed8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5ed8('0x11'));var hardwareService=require(_0x5ed8('0x12'));var logger=require(_0x5ed8('0x13'))(_0x5ed8('0x14'));var utils=require(_0x5ed8('0x15'));var config=require(_0x5ed8('0x16'));var licenseUtil=require(_0x5ed8('0x17'));var db=require('../../mysqldb')['db'];config[_0x5ed8('0x18')]=_[_0x5ed8('0x19')](config['redis'],{'host':_0x5ed8('0x1a'),'port':0x18eb});var socket=require(_0x5ed8('0x1b'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232c});var client9002=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232a});var client9003=jayson[_0x5ed8('0x1c')][_0x5ed8('0x1d')]({'port':0x232b});var client9001=jayson['client'][_0x5ed8('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x2ccef9,_0x4e6f59,_0x242939,_0x4ab0bc){return new BPromise(function(_0x466ec5,_0x4f7907){var _0x2fa707=_0x4ab0bc||client;return _0x2fa707[_0x5ed8('0x1e')](_0x2ccef9,_0x242939)[_0x5ed8('0x1f')](function(_0x131c44){logger['info'](_0x5ed8('0x20'),_0x4e6f59,_0x5ed8('0x21'));logger['debug'](_0x5ed8('0x22'),_0x4e6f59,_0x5ed8('0x21'),JSON[_0x5ed8('0x23')](_0x131c44));if(_0x131c44[_0x5ed8('0x24')]){if(_0x131c44['error']['code']===0x1f4){logger['error'](_0x5ed8('0x20'),_0x4e6f59,_0x131c44['error'][_0x5ed8('0x25')]);return _0x4f7907(_0x131c44[_0x5ed8('0x24')][_0x5ed8('0x25')]);}logger[_0x5ed8('0x24')](_0x5ed8('0x20'),_0x4e6f59,_0x131c44[_0x5ed8('0x24')]['message']);return _0x466ec5(_0x131c44[_0x5ed8('0x24')]['message']);}else{logger['info'](_0x5ed8('0x20'),_0x4e6f59,_0x5ed8('0x21'));_0x466ec5(_0x131c44[_0x5ed8('0x26')][_0x5ed8('0x25')]);}})[_0x5ed8('0x27')](function(_0x3501ca){logger['error'](_0x5ed8('0x20'),_0x4e6f59,_0x3501ca);_0x4f7907(_0x3501ca);});});}function respondWithStatusCode(_0x21ee86,_0x218913){_0x218913=_0x218913||0xcc;return function(_0x4a433f){if(_0x4a433f){return _0x21ee86['sendStatus'](_0x218913);}return _0x21ee86[_0x5ed8('0x28')](_0x218913)[_0x5ed8('0x29')]();};}function respondWithResult(_0x27eb8a,_0x2978a8){_0x2978a8=_0x2978a8||0xc8;return function(_0x3c0b11){if(_0x3c0b11){return _0x27eb8a[_0x5ed8('0x28')](_0x2978a8)['json'](_0x3c0b11);}};}function respondWithFilteredResult(_0x338da6,_0x26f36d){return function(_0x264abf){if(_0x264abf){var _0x31ec4b=typeof _0x26f36d[_0x5ed8('0x2a')]==='undefined'&&typeof _0x26f36d['limit']===_0x5ed8('0x2b');var _0x39c2bb=_0x264abf[_0x5ed8('0x2c')];var _0xabd56a=_0x31ec4b?0x0:_0x26f36d['offset'];var _0x27904e=_0x31ec4b?_0x264abf[_0x5ed8('0x2c')]:_0x26f36d[_0x5ed8('0x2a')]+_0x26f36d['limit'];var _0x6cf53f;if(_0x27904e>=_0x39c2bb){_0x27904e=_0x39c2bb;_0x6cf53f=0xc8;}else{_0x6cf53f=0xce;}_0x338da6[_0x5ed8('0x28')](_0x6cf53f);return _0x338da6[_0x5ed8('0x2d')](_0x5ed8('0x2e'),_0xabd56a+'-'+_0x27904e+'/'+_0x39c2bb)['json'](_0x264abf);}return null;};}function patchUpdates(_0x4223d9){return function(_0x5142c2){try{jsonpatch[_0x5ed8('0x2f')](_0x5142c2,_0x4223d9,!![]);}catch(_0x492729){return BPromise[_0x5ed8('0x30')](_0x492729);}return _0x5142c2['save']();};}function saveUpdates(_0x2b2dff,_0x30171f){return function(_0x23afb2){if(_0x23afb2){return _0x23afb2[_0x5ed8('0x31')](_0x2b2dff)[_0x5ed8('0x1f')](function(_0x45ae3e){return _0x45ae3e;});}return null;};}function removeEntity(_0x4eca8c,_0x166ecb){return function(_0x1d3845){if(_0x1d3845){return _0x1d3845[_0x5ed8('0x32')]()['then'](function(){var _0x560483=_0x1d3845[_0x5ed8('0x33')]({'plain':!![]});var _0x23e786='ChatWebsites';return db['UserProfileResource'][_0x5ed8('0x32')]({'where':{'type':_0x23e786,'resourceId':_0x560483['id']}})[_0x5ed8('0x1f')](function(){return _0x1d3845;});})[_0x5ed8('0x1f')](function(){_0x4eca8c[_0x5ed8('0x28')](0xcc)[_0x5ed8('0x29')]();});}};}function handleEntityNotFound(_0x283e1e,_0x4b3350){return function(_0x3c647a){if(!_0x3c647a){_0x283e1e[_0x5ed8('0x34')](0x194);}return _0x3c647a;};}function handleError(_0xb1eaff,_0x557349){_0x557349=_0x557349||0x1f4;return function(_0x324d06){logger[_0x5ed8('0x24')](_0x324d06[_0x5ed8('0x35')]);if(_0x324d06[_0x5ed8('0x36')]){delete _0x324d06['name'];}_0xb1eaff[_0x5ed8('0x28')](_0x557349)['send'](_0x324d06);};}exports[_0x5ed8('0x37')]=function(_0x57beb9,_0xb94f4b){var _0x1b7b87={'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]},_0x35b93d={},_0xaf2717={'count':0x0,'rows':[]};var _0xb610ac=_[_0x5ed8('0x3a')](db[_0x5ed8('0x3b')][_0x5ed8('0x3c')],function(_0x5cab08){return{'name':_0x5cab08[_0x5ed8('0x3d')],'type':_0x5cab08[_0x5ed8('0x3e')][_0x5ed8('0x3f')]};});_0x35b93d['model']=_[_0x5ed8('0x3a')](_0xb610ac,_0x5ed8('0x36'));_0x35b93d[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x57beb9[_0x5ed8('0x40')]);_0x35b93d[_0x5ed8('0x42')]=_[_0x5ed8('0x43')](_0x35b93d['model'],_0x35b93d['query']);_0x1b7b87[_0x5ed8('0x44')]=_['intersection'](_0x35b93d[_0x5ed8('0x45')],qs['fields'](_0x57beb9[_0x5ed8('0x40')]['fields']));_0x1b7b87[_0x5ed8('0x44')]=_0x1b7b87[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x1b7b87['attributes']:_0x35b93d[_0x5ed8('0x45')];if(!_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x47')](_0x5ed8('0x48'))){_0x1b7b87['limit']=qs[_0x5ed8('0x49')](_0x57beb9[_0x5ed8('0x40')]['limit']);_0x1b7b87[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x1b7b87[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x57beb9['query']['sort']);_0x1b7b87[_0x5ed8('0x4c')]=qs['filters'](_['pick'](_0x57beb9[_0x5ed8('0x40')],_0x35b93d[_0x5ed8('0x42')]),_0xb610ac);if(_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x1b7b87[_0x5ed8('0x4c')]=_['merge'](_0x1b7b87['where'],{'$or':_[_0x5ed8('0x3a')](_0xb610ac,function(_0x3ff9a4){if(_0x3ff9a4[_0x5ed8('0x3e')]!=='VIRTUAL'){var _0x41c805={};_0x41c805[_0x3ff9a4['name']]={'$like':'%'+_0x57beb9[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x41c805;}})});}_0x1b7b87=_['merge']({},_0x1b7b87,_0x57beb9[_0x5ed8('0x4e')]);var _0x3244d0={'where':_0x1b7b87[_0x5ed8('0x4c')]};return db['ChatWebsite'][_0x5ed8('0x2c')](_0x3244d0)[_0x5ed8('0x1f')](function(_0x53e6f6){_0xaf2717[_0x5ed8('0x2c')]=_0x53e6f6;if(_0x57beb9['query'][_0x5ed8('0x4f')]){_0x1b7b87['include']=[{'all':!![]}];}return db[_0x5ed8('0x3b')][_0x5ed8('0x50')](_0x1b7b87);})[_0x5ed8('0x1f')](function(_0x4d5ccc){_0xaf2717[_0x5ed8('0x51')]=_0x4d5ccc;return _0xaf2717;})[_0x5ed8('0x1f')](respondWithFilteredResult(_0xb94f4b,_0x1b7b87))[_0x5ed8('0x27')](handleError(_0xb94f4b,null));};exports[_0x5ed8('0x52')]=function(_0x24c587,_0x227fa1){var _0x15ef16={'raw':![],'where':{'id':_0x24c587[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]},_0x30d13a={};_0x30d13a['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x3b')]['rawAttributes']);_0x30d13a[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x24c587[_0x5ed8('0x40')]);_0x30d13a[_0x5ed8('0x42')]=_['intersection'](_0x30d13a[_0x5ed8('0x45')],_0x30d13a[_0x5ed8('0x40')]);_0x15ef16[_0x5ed8('0x44')]=_['intersection'](_0x30d13a[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x24c587[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0x15ef16[_0x5ed8('0x44')]=_0x15ef16[_0x5ed8('0x44')]['length']?_0x15ef16[_0x5ed8('0x44')]:_0x30d13a[_0x5ed8('0x45')];if(_0x24c587[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x15ef16['include']=[{'all':!![]}];}_0x15ef16=_[_0x5ed8('0x55')]({},_0x15ef16,_0x24c587[_0x5ed8('0x4e')]);return db[_0x5ed8('0x3b')]['find'](_0x15ef16)[_0x5ed8('0x1f')](handleEntityNotFound(_0x227fa1,null))[_0x5ed8('0x1f')](respondWithResult(_0x227fa1,null))['catch'](handleError(_0x227fa1,null));};exports[_0x5ed8('0x56')]=function(_0x153715,_0x85011){return db['ChatWebsite'][_0x5ed8('0x56')](_0x153715['body'],{})[_0x5ed8('0x1f')](function(_0x83cafe){var _0x23cc5a=_0x153715[_0x5ed8('0x57')]['get']({'plain':!![]});if(!_0x23cc5a)throw new Error(_0x5ed8('0x58'));if(_0x23cc5a[_0x5ed8('0x59')]===_0x5ed8('0x57')){var _0x360253=_0x83cafe[_0x5ed8('0x33')]({'plain':!![]});var _0x236de3='ChatWebsites';return db[_0x5ed8('0x5a')]['find']({'where':{'name':_0x236de3,'userProfileId':_0x23cc5a[_0x5ed8('0x5b')]},'raw':!![]})[_0x5ed8('0x1f')](function(_0x172630){if(_0x172630&&_0x172630[_0x5ed8('0x5c')]===0x0){return db[_0x5ed8('0x5d')][_0x5ed8('0x56')]({'name':_0x360253[_0x5ed8('0x36')],'resourceId':_0x360253['id'],'type':_0x172630[_0x5ed8('0x36')],'sectionId':_0x172630['id']},{})[_0x5ed8('0x1f')](function(){return _0x83cafe;});}else{return _0x83cafe;}})[_0x5ed8('0x27')](function(_0xa7178c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa7178c);throw _0xa7178c;});}return _0x83cafe;})[_0x5ed8('0x1f')](respondWithResult(_0x85011,0xc9))[_0x5ed8('0x27')](handleError(_0x85011,null));};exports[_0x5ed8('0x31')]=function(_0x12ede7,_0x599b17){if(_0x12ede7[_0x5ed8('0x5e')]['id']){delete _0x12ede7['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x12ede7[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x38')],'as':_0x5ed8('0x39')}]})[_0x5ed8('0x1f')](handleEntityNotFound(_0x599b17,null))['then'](saveUpdates(_0x12ede7[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x599b17,null))[_0x5ed8('0x27')](handleError(_0x599b17,null));};exports[_0x5ed8('0x32')]=function(_0xa2eb62,_0x84d5ca){return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0xa2eb62[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x84d5ca,null))[_0x5ed8('0x1f')](removeEntity(_0x84d5ca,null))[_0x5ed8('0x27')](handleError(_0x84d5ca,null));};exports['describe']=function(_0x443db5,_0xfa87c3){return db[_0x5ed8('0x3b')][_0x5ed8('0x60')]()[_0x5ed8('0x1f')](respondWithResult(_0xfa87c3,null))[_0x5ed8('0x27')](handleError(_0xfa87c3,null));};exports[_0x5ed8('0x61')]=function(_0xb9778d,_0x3babca,_0x87c099){if(_0xb9778d[_0x5ed8('0x5e')]['id']){delete _0xb9778d['body']['id'];}return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0xb9778d[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x3babca,null))[_0x5ed8('0x1f')](function(_0x255ddd){if(_0x255ddd){_0xb9778d[_0x5ed8('0x5e')]['ChatWebsiteId']=_0x255ddd['id'];return db[_0x5ed8('0x62')][_0x5ed8('0x56')](_0xb9778d[_0x5ed8('0x5e')]);}})[_0x5ed8('0x1f')](respondWithResult(_0x3babca,null))[_0x5ed8('0x27')](handleError(_0x3babca,null));};exports['getDispositions']=function(_0xb279ff,_0x484080,_0x5dd429){var _0xd42e5d={'raw':![],'where':{}};var _0x1890d2={};var _0x2b6e22={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0xb279ff[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x484080,null))[_0x5ed8('0x1f')](function(_0xe80264){if(_0xe80264){_0x1890d2['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x62')][_0x5ed8('0x3c')]);_0x1890d2[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0xb279ff['query']);_0x1890d2[_0x5ed8('0x42')]=_['intersection'](_0x1890d2['model'],_0x1890d2[_0x5ed8('0x40')]);_0xd42e5d['attributes']=_[_0x5ed8('0x43')](_0x1890d2[_0x5ed8('0x45')],qs['fields'](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0xd42e5d[_0x5ed8('0x44')]=_0xd42e5d[_0x5ed8('0x44')]['length']?_0xd42e5d[_0x5ed8('0x44')]:_0x1890d2[_0x5ed8('0x45')];if(!_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x47')]('nolimit')){_0xd42e5d[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0xd42e5d[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0xd42e5d[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0xd42e5d[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0xb279ff[_0x5ed8('0x40')],_0x1890d2[_0x5ed8('0x42')]));_0xd42e5d[_0x5ed8('0x4c')][_0x5ed8('0x65')]=_0xe80264['id'];if(_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0xd42e5d[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0xd42e5d[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0xd42e5d['attributes'],function(_0x368096){var _0x5b61ea={};_0x5b61ea[_0x368096]={'$like':'%'+_0xb279ff[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x5b61ea;})});}_0xd42e5d=_['merge']({},_0xd42e5d,_0xb279ff[_0x5ed8('0x4e')]);return db[_0x5ed8('0x62')][_0x5ed8('0x2c')]({'where':_0xd42e5d['where']})[_0x5ed8('0x1f')](function(_0x2944a3){_0x2b6e22[_0x5ed8('0x2c')]=_0x2944a3;if(_0xb279ff['query'][_0x5ed8('0x4f')]){_0xd42e5d[_0x5ed8('0x66')]=[{'all':!![]}];}return db[_0x5ed8('0x62')][_0x5ed8('0x50')](_0xd42e5d);})[_0x5ed8('0x1f')](function(_0x409b88){_0x2b6e22[_0x5ed8('0x51')]=_0x409b88;return _0x2b6e22;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x484080,_0xd42e5d))[_0x5ed8('0x27')](handleError(_0x484080,null));};exports[_0x5ed8('0x67')]=function(_0x88137e,_0x2f536f,_0x3b2877){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x88137e[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f536f,null))[_0x5ed8('0x1f')](function(_0x16b319){if(_0x16b319){return _0x16b319[_0x5ed8('0x67')](_0x88137e[_0x5ed8('0x40')]['ids']);}})[_0x5ed8('0x1f')](respondWithStatusCode(_0x2f536f,null))[_0x5ed8('0x27')](handleError(_0x2f536f,null));};exports['addAnswer']=function(_0x3aa423,_0x2750f6,_0x5406da){if(_0x3aa423[_0x5ed8('0x5e')]['id']){delete _0x3aa423[_0x5ed8('0x5e')]['id'];}return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x3aa423[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2750f6,null))[_0x5ed8('0x1f')](function(_0xb39067){if(_0xb39067){_0x3aa423[_0x5ed8('0x5e')][_0x5ed8('0x65')]=_0xb39067['id'];return db[_0x5ed8('0x68')][_0x5ed8('0x56')](_0x3aa423['body']);}})[_0x5ed8('0x1f')](respondWithResult(_0x2750f6,null))[_0x5ed8('0x27')](handleError(_0x2750f6,null));};exports[_0x5ed8('0x69')]=function(_0x3a2437,_0x2bef85,_0x4961de){var _0x362854={'raw':![],'where':{}};var _0x298b3e={};var _0xdf0376={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3a2437['params']['id']}})['then'](handleEntityNotFound(_0x2bef85,null))[_0x5ed8('0x1f')](function(_0x514387){if(_0x514387){_0x298b3e[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db['CannedAnswer'][_0x5ed8('0x3c')]);_0x298b3e['query']=_[_0x5ed8('0x41')](_0x3a2437[_0x5ed8('0x40')]);_0x298b3e[_0x5ed8('0x42')]=_['intersection'](_0x298b3e[_0x5ed8('0x45')],_0x298b3e[_0x5ed8('0x40')]);_0x362854[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x298b3e[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x3a2437[_0x5ed8('0x40')]['fields']));_0x362854[_0x5ed8('0x44')]=_0x362854[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x362854[_0x5ed8('0x44')]:_0x298b3e[_0x5ed8('0x45')];if(!_0x3a2437['query'][_0x5ed8('0x47')]('nolimit')){_0x362854['limit']=qs[_0x5ed8('0x49')](_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x362854[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x362854['order']=qs[_0x5ed8('0x4b')](_0x3a2437['query'][_0x5ed8('0x4b')]);_0x362854[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_['pick'](_0x3a2437['query'],_0x298b3e['filters']));_0x362854[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x514387['id'];if(_0x3a2437[_0x5ed8('0x40')]['filter']){_0x362854[_0x5ed8('0x4c')]=_['merge'](_0x362854[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x362854[_0x5ed8('0x44')],function(_0x325c8e){var _0x31c8cd={};_0x31c8cd[_0x325c8e]={'$like':'%'+_0x3a2437[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x31c8cd;})});}_0x362854=_[_0x5ed8('0x55')]({},_0x362854,_0x3a2437['options']);return db['CannedAnswer'][_0x5ed8('0x2c')]({'where':_0x362854[_0x5ed8('0x4c')]})['then'](function(_0x1a3e5c){_0xdf0376[_0x5ed8('0x2c')]=_0x1a3e5c;if(_0x3a2437[_0x5ed8('0x40')]['includeAll']){_0x362854['include']=[{'all':!![]}];}return db[_0x5ed8('0x68')][_0x5ed8('0x50')](_0x362854);})['then'](function(_0x1fb3dc){_0xdf0376[_0x5ed8('0x51')]=_0x1fb3dc;return _0xdf0376;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x2bef85,_0x362854))[_0x5ed8('0x27')](handleError(_0x2bef85,null));};exports[_0x5ed8('0x6a')]=function(_0x14c63e,_0x4badb6,_0x5854c9){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x14c63e[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x4badb6,null))['then'](function(_0x2656ab){if(_0x2656ab){return _0x2656ab[_0x5ed8('0x6a')](_0x14c63e[_0x5ed8('0x40')][_0x5ed8('0x6b')]);}})['then'](respondWithStatusCode(_0x4badb6,null))['catch'](handleError(_0x4badb6,null));};exports['addLogo']=function(_0x165b32,_0x4c5b8a,_0x4a6f55){_0x165b32[_0x5ed8('0x5e')][_0x5ed8('0x6c')]=_0x165b32[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x165b32[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c5b8a,null))[_0x5ed8('0x1f')](saveUpdates(_0x165b32[_0x5ed8('0x5e')],null))['then'](respondWithResult(_0x4c5b8a,null))[_0x5ed8('0x27')](handleError(_0x4c5b8a,null));};exports[_0x5ed8('0x6f')]=function(_0x92c724,_0x33954a,_0x54d24e){_0x92c724[_0x5ed8('0x5e')][_0x5ed8('0x70')]=_0x92c724[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x92c724['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x33954a,null))[_0x5ed8('0x1f')](saveUpdates(_0x92c724[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x33954a,null))['catch'](handleError(_0x33954a,null));};exports['addCustomerAvatar']=function(_0x2ca895,_0x2ea4fb,_0x3a3c95){_0x2ca895[_0x5ed8('0x5e')][_0x5ed8('0x71')]=_0x2ca895[_0x5ed8('0x6d')]['filename'];return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x2ca895[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2ea4fb,null))[_0x5ed8('0x1f')](saveUpdates(_0x2ca895[_0x5ed8('0x5e')],null))[_0x5ed8('0x1f')](respondWithResult(_0x2ea4fb,null))[_0x5ed8('0x27')](handleError(_0x2ea4fb,null));};exports['addSystemAvatar']=function(_0xe4761f,_0x369159,_0x14f122){_0xe4761f[_0x5ed8('0x5e')][_0x5ed8('0x72')]=_0xe4761f[_0x5ed8('0x6d')][_0x5ed8('0x6e')];return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0xe4761f[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x369159,null))[_0x5ed8('0x1f')](saveUpdates(_0xe4761f[_0x5ed8('0x5e')],null))['then'](respondWithResult(_0x369159,null))[_0x5ed8('0x27')](handleError(_0x369159,null));};exports[_0x5ed8('0x73')]=function(_0x246597,_0x594963,_0x4fb509){var _0x26d3b9=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x76'));var _0x513c38={'where':{'id':_0x246597[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x6c')],'raw':!![]};var _0x3d45b2=![];return require(_0x5ed8('0x17'))['getLicense']()['then'](function(_0xe8bea9){if(_0xe8bea9){_0x3d45b2=_0xe8bea9[_0x5ed8('0x77')];}})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')](_0x513c38);})[_0x5ed8('0x1f')](handleEntityNotFound(_0x594963,null))['then'](function(_0x502310){if(_0x502310){if(!_[_0x5ed8('0x78')](_0x502310[_0x5ed8('0x6c')])){if(fs[_0x5ed8('0x79')](path['join'](config[_0x5ed8('0x75')],_0x5ed8('0x7a'),_0x502310[_0x5ed8('0x6c')]))&&_0x3d45b2){_0x26d3b9=path[_0x5ed8('0x74')](config['root'],_0x5ed8('0x7a'),_0x502310[_0x5ed8('0x6c')]);}}return _0x594963[_0x5ed8('0x7b')](_0x26d3b9);}})[_0x5ed8('0x27')](handleError(_0x594963,null));};exports[_0x5ed8('0x7c')]=function(_0x402cc4,_0x2b1fb5,_0x594288){var _0x2d59e8=path[_0x5ed8('0x74')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x544b7a={'where':{'id':_0x402cc4[_0x5ed8('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x5ed8('0x3b')]['find'](_0x544b7a)['then'](handleEntityNotFound(_0x2b1fb5,null))[_0x5ed8('0x1f')](function(_0x399466){if(_0x399466){if(!_[_0x5ed8('0x78')](_0x399466[_0x5ed8('0x70')])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x399466['agentAvatar']))){_0x2d59e8=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x399466[_0x5ed8('0x70')]);}}return _0x2b1fb5[_0x5ed8('0x7b')](_0x2d59e8);}})[_0x5ed8('0x27')](handleError(_0x2b1fb5,null));};exports[_0x5ed8('0x7e')]=function(_0x2ac356,_0x1cfed5,_0x371072){var _0x54d386=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7f'));var _0x92482e={'where':{'id':_0x2ac356[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x71'),_0x5ed8('0x80')],'raw':!![]};return db['ChatWebsite'][_0x5ed8('0x5f')](_0x92482e)['then'](handleEntityNotFound(_0x1cfed5,null))[_0x5ed8('0x1f')](function(_0x550f8c){if(_0x550f8c){if(!_[_0x5ed8('0x78')](_0x550f8c['customerAvatar'])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x7d'),_0x550f8c['customerAvatar']))&&_0x550f8c[_0x5ed8('0x80')]){_0x54d386=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x550f8c[_0x5ed8('0x71')]);}}return _0x1cfed5[_0x5ed8('0x7b')](_0x54d386);}})[_0x5ed8('0x27')](handleError(_0x1cfed5,null));};exports[_0x5ed8('0x81')]=function(_0x406416,_0x470131,_0x41eded){var _0x2394ff=path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x82'));var _0x26fa27={'where':{'id':_0x406416[_0x5ed8('0x53')]['id']},'attributes':['id',_0x5ed8('0x72')],'raw':!![]};return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')](_0x26fa27)['then'](handleEntityNotFound(_0x470131,null))[_0x5ed8('0x1f')](function(_0x27e004){if(_0x27e004){if(!_['isNil'](_0x27e004['systemAvatar'])){if(fs[_0x5ed8('0x79')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x27e004['systemAvatar']))){_0x2394ff=path['join'](config[_0x5ed8('0x75')],'server/files/images/avatars/',_0x27e004[_0x5ed8('0x72')]);}}return _0x470131[_0x5ed8('0x7b')](_0x2394ff);}})[_0x5ed8('0x27')](handleError(_0x470131,null));};exports[_0x5ed8('0x83')]=function(_0x2c0a54,_0x471f53,_0x221967){var _0x560a7d=require('user-agent-parser');var _0xe02f32=new _0x560a7d();var _0x41929f=_0xe02f32['setUA'](_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0x85')])[_0x5ed8('0x86')]();var _0xbaf6e9={'body':_0x2c0a54['body'],'channel':_0x5ed8('0x87')};var _0x4cea2e=[];var _0x4a76eb=[];var _0x2e2f2a={};var _0x53da9e=![];return db[_0x5ed8('0x88')][_0x5ed8('0x60')]()[_0x5ed8('0x1f')](function(_0x3bcbb9){if(!_0x3bcbb9){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x8b'));}_0x4cea2e=_[_0x5ed8('0x8c')](_[_0x5ed8('0x41')](_0x3bcbb9),[_0x5ed8('0x8d'),_0x5ed8('0x8e')]);_0x4a76eb=_['difference'](_['keys'](_0x3bcbb9),['createdAt',_0x5ed8('0x8e'),_0x5ed8('0x8f'),'ListId']);if(_0x2c0a54[_0x5ed8('0x5e')]['id']){delete _0x2c0a54['body']['id'];}if(_[_0x5ed8('0x78')](_0x2c0a54['body']['from'])){throw new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0x90'));}if(_[_0x5ed8('0x78')](_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x5e')])||_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x5e')]===''){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x91'));}if(_[_0x5ed8('0x78')](_0x2c0a54['body'][_0x5ed8('0x92')])){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x93')+_0x4a76eb);}if(!_[_0x5ed8('0x94')](_0x4a76eb,_0x2c0a54['body'][_0x5ed8('0x92')])){throw new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0x95')+_0x4a76eb);}_0x2e2f2a[_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x92')]]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0x96')];})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x3b')]['find']({'where':{'id':_0x2c0a54[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x97')],'as':_0x5ed8('0x98'),'include':[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0x99'),'where':_0x2e2f2a,'limit':0x1,'order':[[_0x5ed8('0x8e'),_0x5ed8('0x9a')]]}]},{'model':db['ChatApplication'],'as':_0x5ed8('0x9b')}]});})[_0x5ed8('0x1f')](handleEntityNotFound(_0x471f53,null))[_0x5ed8('0x1f')](function(_0x4d0d13){if(_0x4d0d13&&_0x4d0d13[_0x5ed8('0x98')]){_0xbaf6e9[_0x5ed8('0x9c')]=_0x4d0d13;_0xbaf6e9[_0x5ed8('0x9d')]=_0x4d0d13['Applications'];_0xbaf6e9[_0x5ed8('0x9e')]=_0x4d0d13[_0x5ed8('0x98')];_0xbaf6e9[_0x5ed8('0x9d')]=_[_0x5ed8('0x9f')](_0xbaf6e9[_0x5ed8('0x9d')],[_0x5ed8('0xa0')],[_0x5ed8('0xa1')]);if(_0xbaf6e9[_0x5ed8('0x9c')]['Applications']){delete _0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0x9b')];}if(_0xbaf6e9[_0x5ed8('0x9c')]['List']&&_0xbaf6e9['account']['List']['Contacts']['length']){return _0xbaf6e9['account'][_0x5ed8('0x98')][_0x5ed8('0x99')][0x0];}var _0x548370=_[_0x5ed8('0x19')](_0x2c0a54[_0x5ed8('0x5e')],{'firstName':_0x2c0a54[_0x5ed8('0x5e')]['from'],'ListId':_0x4d0d13[_0x5ed8('0xa2')]});_0x548370[_0x2c0a54['body']['mapKey']]=_0x2c0a54['body'][_0x5ed8('0x96')];return db['CmContact'][_0x5ed8('0x56')](_0x548370,{'fields':_0x4cea2e,'raw':!![]});}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x471f53,null))['then'](function(_0x55831f){_0xbaf6e9['contact']=_0x55831f;var _0x392496=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xa3')];if(_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa4')]){_0x392496=_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa4')];}else if(_0x2c0a54[_0x5ed8('0x84')][_0x5ed8('0xa5')]){_0x392496=_[_0x5ed8('0xa6')](_0x2c0a54['headers'][_0x5ed8('0xa5')][_0x5ed8('0xa7')](','));}if(_0x55831f){var _0x11b6f5={'ContactId':_0x55831f['id'],'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'from':(_0x55831f[_0x5ed8('0xa8')]||'')+'\x20'+(_0x55831f[_0x5ed8('0xa9')]||''),'customerIp':_0x392496,'customerPort':_0x2c0a54[_0x5ed8('0x84')]['x-real-port']?_0x2c0a54['headers'][_0x5ed8('0xaa')]:null,'referer':_0x2c0a54[_0x5ed8('0x5e')]['referer'],'browserName':_0x41929f[_0x5ed8('0xab')][_0x5ed8('0x36')]&&_0x41929f[_0x5ed8('0xab')][_0x5ed8('0xac')]?util[_0x5ed8('0xad')]('%s\x20%s',_0x41929f[_0x5ed8('0xab')][_0x5ed8('0x36')],_0x41929f['browser']['version']):_0x5ed8('0xae'),'browserVersion':_0x41929f[_0x5ed8('0xab')][_0x5ed8('0xac')]||_0x5ed8('0xae'),'osName':util['format'](_0x5ed8('0xaf'),_0x41929f['os'][_0x5ed8('0x36')],_0x41929f['os'][_0x5ed8('0xac')]),'osVersion':_0x41929f['os']['version'],'deviceModel':_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x45')]&&_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0xb1')]?util[_0x5ed8('0xad')](_0x5ed8('0xb2'),_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x45')],_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0xb1')],_0x41929f[_0x5ed8('0xb0')][_0x5ed8('0x3e')]):null,'deviceVendor':_0x41929f['device'][_0x5ed8('0xb1')],'deviceType':_0x41929f['device']['type'],'formData':JSON[_0x5ed8('0x23')](_0x2c0a54[_0x5ed8('0x5e')])};var _0x110cb9={'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'closed':![]};if(_0x2c0a54[_0x5ed8('0x5e')]['threadId']){_0x110cb9['threadId']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')];return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':_0x110cb9})[_0x5ed8('0x1f')](function(_0x293c2a){if(_0x293c2a){return[_0x293c2a,![]];}_0x11b6f5[_0x5ed8('0xb3')]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')];_0x11b6f5[_0x5ed8('0xb4')]=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb4')];return db[_0x5ed8('0xb5')][_0x5ed8('0x56')](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x4006c2){return[_0x4006c2,!![]];});});}_0x110cb9[_0x5ed8('0xb6')]=_0x55831f['id'];if(_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb7')]&&_0x2c0a54[_0x5ed8('0x5e')]['interaction']['id']){_0x110cb9['id']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb7')]['id'];return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':_0x110cb9})['then'](function(_0x482f1b){if(_0x482f1b){return[_0x482f1b,![]];}return db['ChatInteraction']['create'](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x1acb37){return[_0x1acb37,!![]];});});}return db[_0x5ed8('0xb5')][_0x5ed8('0x56')](_0x11b6f5)[_0x5ed8('0x1f')](function(_0x3f03f7){return[_0x3f03f7,!![]];});}})[_0x5ed8('0xb8')](function(_0x24644c,_0x4485db){if(_0x24644c){_0x53da9e=_0x4485db;if(!_0x4485db){var _0x5dfdf7={'from':(_0xbaf6e9['contact'][_0x5ed8('0xa8')]||'')+'\x20'+(_0xbaf6e9[_0x5ed8('0xb9')][_0x5ed8('0xa9')]||'')};if(_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')]&&_0x2c0a54[_0x5ed8('0x5e')]['messageId']&&_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xb3')]!=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xba')]){_0x5dfdf7['threadId']=_0x2c0a54[_0x5ed8('0x5e')][_0x5ed8('0xba')];}return _0x24644c[_0x5ed8('0x31')](_0x5dfdf7);}else{return _0x24644c;}}})[_0x5ed8('0x1f')](function(_0x53f064){_0xbaf6e9[_0x5ed8('0xb7')]=_0x53f064[_0x5ed8('0x33')]({'plain':!![]});_0xbaf6e9[_0x5ed8('0xb7')]['created']=_0x53da9e;if(_0xbaf6e9[_0x5ed8('0xb7')]['created']){if(_0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0xbb')]){_0xbaf6e9['applications'][_0x5ed8('0xbc')]({'id':0x0,'priority':_0xbaf6e9[_0x5ed8('0x9d')][_0x5ed8('0x46')]+0x1,'app':_0x5ed8('0xbd'),'appdata':_0x5ed8('0xbe'),'interval':_0x5ed8('0xbf')});}}return db[_0x5ed8('0xc0')][_0x5ed8('0x56')]({'body':_0x2c0a54[_0x5ed8('0x5e')]['body'],'ChatWebsiteId':_0x2c0a54[_0x5ed8('0x53')]['id'],'ChatInteractionId':_0x53f064['id'],'direction':'in','ContactId':_0xbaf6e9['contact']['id'],'AttachmentId':_0x2c0a54[_0x5ed8('0x5e')]['AttachmentId']});})[_0x5ed8('0x1f')](function(_0x4ef6f9){_0xbaf6e9[_0x5ed8('0x25')]=_0x4ef6f9;if(_0xbaf6e9[_0x5ed8('0xb7')][_0x5ed8('0xc1')]){return db[_0x5ed8('0xc2')][_0x5ed8('0x5f')]({'attributes':['id',_0x5ed8('0x36')],'where':{'id':_0xbaf6e9[_0x5ed8('0xb7')]['UserId']}})['then'](function(_0x1343c0){if(_0x1343c0){_0xbaf6e9[_0x5ed8('0x9d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5ed8('0xc3'),'appdata':_0x1343c0[_0x5ed8('0x36')]+','+(_0xbaf6e9[_0x5ed8('0x9c')][_0x5ed8('0xc4')]||0xa),'interval':_0x5ed8('0xbf')});_0xbaf6e9[_0x5ed8('0xc5')]=!![];}return respondWithRpcPromise(_0x5ed8('0xc6'),'startRouting',_0xbaf6e9);});}return respondWithRpcPromise('Start','startRouting',_0xbaf6e9);})[_0x5ed8('0x1f')](function(_0x454882){respondWithRpcPromise(_0x5ed8('0xc7'),_0x5ed8('0xc7'),{'event':_0x5ed8('0x83'),'message':_0x454882},client9002);return _0x454882;})[_0x5ed8('0x1f')](respondWithResult(_0x471f53,null))[_0x5ed8('0x27')](handleError(_0x471f53,null));};exports[_0x5ed8('0xc8')]=function(_0x208708,_0x525b84,_0x3a3c90){var _0xe527ac,_0x85428,_0x12b5dc;var _0x5624c7=[];var _0x17fa01=[];var _0xd9d8a2={};var _0x48761f=_0x208708['files']||[];var _0x34ac1e=[];var _0x5db2b2;return db['CmContact'][_0x5ed8('0x60')]()['then'](function(_0x484017){if(!_0x484017){throw new db[(_0x5ed8('0x89'))][(_0x5ed8('0x8a'))](_0x5ed8('0x8b'));}_0x17fa01=_['difference'](_[_0x5ed8('0x41')](_0x484017),['createdAt','updatedAt']);_0x5624c7=_[_0x5ed8('0x8c')](_[_0x5ed8('0x41')](_0x484017),['createdAt',_0x5ed8('0x8e'),_0x5ed8('0x8f'),_0x5ed8('0xa2')]);if(_0x208708[_0x5ed8('0x5e')]['id']){delete _0x208708[_0x5ed8('0x5e')]['id'];}if(_[_0x5ed8('0x78')](_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')])){throw _0x525b84[_0x5ed8('0x28')](0x1f4)[_0x5ed8('0xc9')](new db[(_0x5ed8('0x89'))]['ValidationError'](_0x5ed8('0x90')));}if(_[_0x5ed8('0x78')](_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x5e')])||_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x5e')]===''){throw _0x525b84[_0x5ed8('0x28')](0x1f4)['send'](new db[(_0x5ed8('0x89'))]['ValidationError'](_0x5ed8('0x91')));}if(_['isNil'](_0x208708[_0x5ed8('0x5e')]['mapKeyOffline'])){throw _0x525b84['status'](0x1f4)[_0x5ed8('0xc9')](new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0xca')+_0x5624c7));}if(!_[_0x5ed8('0x94')](_0x5624c7,_0x208708[_0x5ed8('0x5e')][_0x5ed8('0xcb')])){throw _0x525b84[_0x5ed8('0x28')](0x1f4)[_0x5ed8('0xc9')](new db['Sequelize'][(_0x5ed8('0x8a'))](_0x5ed8('0xcc')+_0x5624c7));}_0xd9d8a2[_0x208708[_0x5ed8('0x5e')]['mapKeyOffline']]=_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')];})[_0x5ed8('0x1f')](function(){return db['ChatWebsite'][_0x5ed8('0x5f')]({'where':{'id':_0x208708['params']['id']},'include':[{'model':db[_0x5ed8('0x97')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x525b84,null))[_0x5ed8('0x1f')](function(_0x15fae0){if(_0x15fae0&&_0x15fae0[_0x5ed8('0x98')]){_0x85428=_0x15fae0;var _0x8088e3=_[_0x5ed8('0x19')](_0x208708[_0x5ed8('0x5e')],{'firstName':_0x208708[_0x5ed8('0x5e')][_0x5ed8('0x96')],'phone':_0x208708['body']['from'],'ListId':_0x15fae0[_0x5ed8('0xa2')]});_0x8088e3[_0x208708[_0x5ed8('0x5e')][_0x5ed8('0xcb')]]=_0x208708['body'][_0x5ed8('0x96')];return db['CmContact']['findOrCreate']({'where':_0xd9d8a2,'defaults':_0x8088e3});}})['spread'](function(_0x72552d){if(_0x72552d){_0x12b5dc=_0x72552d;var _0x368cc6=fs[_0x5ed8('0xcd')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0xce')),_0x5ed8('0xcf'));var _0x13fd1f=ejs[_0x5ed8('0xd0')](_0x368cc6,{'body':_[_0x5ed8('0xd1')](_0x208708['body'][_0x5ed8('0x5e')]),'bodyTitle':_0x85428[_0x5ed8('0xd2')]});return db[_0x5ed8('0xd3')][_0x5ed8('0x56')]({'body':_0x13fd1f,'ContactId':_0x72552d['id'],'ChatWebsiteId':_0x85428['id']});}})[_0x5ed8('0x1f')](function(_0xfc60b){_0x5db2b2=_0xfc60b;if(_0x48761f[_0x5ed8('0x46')]){var _0xcc6f3c=_0x48761f[_0x5ed8('0x3a')](function(_0x5e601f){return{'name':_0x5e601f[_0x5ed8('0xd4')],'basename':_0x5e601f[_0x5ed8('0x6e')],'type':_0x5e601f[_0x5ed8('0xd5')],'ChatOfflineMessageId':_0xfc60b['id']};});_0x34ac1e=_0xcc6f3c[_0x5ed8('0x3a')](_0x5a5e64=>{var _0x309c49={'filename':_0x5a5e64[_0x5ed8('0x36')],'path':path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0xd6'),_0x5ed8('0xd7'),'attachments','offline-chat',_0x5a5e64[_0x5ed8('0xd8')])};return _0x309c49;});if(!_0x85428['openNewInteraction']){return db[_0x5ed8('0xd9')][_0x5ed8('0xda')](function(_0x419339){return db[_0x5ed8('0xdb')][_0x5ed8('0xdc')](_0xcc6f3c,{'transaction':_0x419339});});}}})[_0x5ed8('0x1f')](function(){if(_0x5db2b2){_0xe527ac=_0x5db2b2;return db[_0x5ed8('0xdd')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x5ed8('0xde')],'as':_0x5ed8('0xdf'),'raw':!![]}]});}})[_0x5ed8('0x1f')](function(_0x26347e){if(_0x26347e&&_0x26347e[_0x5ed8('0xdf')]&&_0x85428[_0x5ed8('0xe0')]&&_0x85428[_0x5ed8('0xe1')]){var _0x8a5462={'tls':{'rejectUnauthorized':![]}};if(_0x26347e[_0x5ed8('0xdf')]['service']){_0x8a5462[_0x5ed8('0xe2')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe2')];}else{_0x8a5462[_0x5ed8('0xe3')]=_0x26347e['Smtp'][_0x5ed8('0xe3')];_0x8a5462[_0x5ed8('0xe4')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe4')];_0x8a5462[_0x5ed8('0xe5')]=_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe5')];}if(_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0xe6')]){_0x8a5462[_0x5ed8('0xe7')]={'user':_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0x57')],'pass':_0x26347e['Smtp'][_0x5ed8('0xe8')]};}return respondWithRpcPromise('SendMail',_0x5ed8('0xe9'),{'account':_0x8a5462,'message':{'from':util[_0x5ed8('0xad')](_0x5ed8('0xea'),_0x26347e['name'],_0x26347e[_0x5ed8('0xeb')]||_0x26347e[_0x5ed8('0xdf')][_0x5ed8('0x57')]),'to':_0x85428['forwardOfflineAddress'],'subject':_0x85428['offlineMessageSubject'],'html':_0xe527ac['body'],'attachments':_0x34ac1e}},client9003)[_0x5ed8('0x1f')](function(){return _0xe527ac;})[_0x5ed8('0x27')](function(_0x1c7b72){console[_0x5ed8('0x24')](_0x1c7b72);});}})[_0x5ed8('0x1f')](function(){if(_0x85428&&_0x85428['openNewInteraction']&&_0x85428[_0x5ed8('0xec')]){var _0x4f2373=[];if(_0x48761f['length']){_0x4f2373=_0x48761f[_0x5ed8('0x3a')](function(_0x17e605){return{'name':_0x17e605[_0x5ed8('0xd4')],'basename':_0x17e605['filename'],'type':_0x17e605[_0x5ed8('0xd5')],'ChatOfflineMessageId':_0x5db2b2['id']};});}var _0x534170;if(!_['isNil'](_0x85428[_0x5ed8('0xed')])){var _0x465332=_[_0x5ed8('0x3a')](_0x208708[_0x5ed8('0x5e')],function(_0x126c12){return _0x126c12;});var _0x163ffc=_[_0x5ed8('0xee')](_0x465332)[0x0];var _0x3bf1e6=_[_0x5ed8('0xef')](_0x163ffc,function(_0x46a522){return _0x46a522;});_0x534170=_0x3bf1e6[0x1][_0x85428[_0x5ed8('0xed')]];}var _0x12c674={'from':_0x12b5dc[_0x5ed8('0xeb')],'firstName':_0x12b5dc[_0x5ed8('0xa8')],'lastName':_0x12b5dc['lastName'],'mapKey':_0x5ed8('0xeb'),'message':{'from':_0x12b5dc[_0x5ed8('0xeb')],'to':_0x85428['MailAccount']['email'],'cc':'','subject':_['isNil'](_0x534170)?_0x85428[_0x5ed8('0xf0')]:_0x534170,'messageId':'','sentAt':new Date(),'attach':_0x4f2373[_0x5ed8('0x46')],'attachments':_0x4f2373,'originChannel':_0x5ed8('0xf1'),'ChatWebsiteId':_0x85428['id'],'ChatOfflineMessageId':_0xe527ac['id'],'originTo':_0x85428[_0x5ed8('0xdd')]['email']},'body':_0xe527ac['body']};var _0x3bb578={'account':{'id':_0x85428[_0x5ed8('0xec')]},'body':_0x12c674,'log':_0x5ed8('0xf2')};return respondWithRpcPromise(_0x5ed8('0xf2'),_0x5ed8('0xf3'),_0x3bb578,client9001)[_0x5ed8('0x1f')](function(){return _0xe527ac;})[_0x5ed8('0x27')](function(_0x49fc7d){console[_0x5ed8('0x24')](_0x49fc7d);});}return;})[_0x5ed8('0x1f')](function(){if(_0xe527ac){return _0xe527ac;}})[_0x5ed8('0x1f')](respondWithResult(_0x525b84,null))[_0x5ed8('0x27')](function(_0x540db1){console[_0x5ed8('0x24')](_0x5ed8('0x27'),_0x540db1);for(var _0x391335 of _0x48761f){var _0x18abb5=path[_0x5ed8('0x74')](config['root'],_0x5ed8('0xd6'),_0x5ed8('0xd7'),_0x5ed8('0xf4'),'offline-chat',_0x391335['filename']);fs_extra[_0x5ed8('0xf5')](_0x18abb5)[_0x5ed8('0x27')](function(_0x39e6fe){console[_0x5ed8('0x24')](_0x5ed8('0xf6'),_0x18abb5,_0x39e6fe);});}});};exports[_0x5ed8('0xf7')]=function(_0x30ec05,_0x49e325,_0x4107c3){return db['ChatInteraction'][_0x5ed8('0x5f')]({'where':{'id':_0x30ec05[_0x5ed8('0x53')]['id']}})['then'](handleEntityNotFound(_0x49e325,null))[_0x5ed8('0x1f')](function(_0x2afc44){if(_0x2afc44){return _0x2afc44['addInteraction'](_0x30ec05[_0x5ed8('0x5e')][_0x5ed8('0x6b')],_[_0x5ed8('0xf8')](_0x30ec05['body'],[_0x5ed8('0x6b'),'id'])||{});}})[_0x5ed8('0x1f')](respondWithResult(_0x49e325,null))['catch'](handleError(_0x49e325,null));};exports[_0x5ed8('0xf9')]=function(_0x298493,_0x2edd7b,_0x495ff7){var _0x271ce0={'raw':![],'where':{}};var _0x540604={};var _0x10232c={'count':0x0,'rows':[]};return db[_0x5ed8('0x3b')]['findOne']({'where':{'id':_0x298493['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x2edd7b,null))[_0x5ed8('0x1f')](function(_0x2dc053){if(_0x2dc053){_0x540604[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0xb5')][_0x5ed8('0x3c')]);_0x540604[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x298493['query']);_0x540604['filters']=_[_0x5ed8('0x43')](_0x540604[_0x5ed8('0x45')],_0x540604[_0x5ed8('0x40')]);_0x271ce0[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x540604[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x298493[_0x5ed8('0x40')]['fields']));_0x271ce0['attributes']=_0x271ce0[_0x5ed8('0x44')]['length']?_0x271ce0[_0x5ed8('0x44')]:_0x540604[_0x5ed8('0x45')];if(!_0x298493[_0x5ed8('0x40')][_0x5ed8('0x47')](_0x5ed8('0x48'))){_0x271ce0[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x298493[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x271ce0['offset']=qs[_0x5ed8('0x2a')](_0x298493[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x271ce0['order']=qs[_0x5ed8('0x4b')](_0x298493['query'][_0x5ed8('0x4b')]);_0x271ce0[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_['pick'](_0x298493[_0x5ed8('0x40')],_0x540604[_0x5ed8('0x42')]));_0x271ce0[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x2dc053['id'];if(_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x271ce0[_0x5ed8('0x4c')]=_['merge'](_0x271ce0[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x271ce0['attributes'],function(_0x3ef873){var _0x12ae5d={};_0x12ae5d[_0x3ef873]={'$like':'%'+_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x12ae5d;})});}_0x271ce0=_[_0x5ed8('0x55')]({},_0x271ce0,_0x298493[_0x5ed8('0x4e')]);return db['ChatInteraction'][_0x5ed8('0x2c')]({'where':_0x271ce0[_0x5ed8('0x4c')]})[_0x5ed8('0x1f')](function(_0x127173){_0x10232c[_0x5ed8('0x2c')]=_0x127173;if(_0x298493[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x271ce0[_0x5ed8('0x66')]=[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0xfa'),'required':![]},{'model':db[_0x5ed8('0xc2')],'as':_0x5ed8('0xfb'),'attributes':[_0x5ed8('0x36'),_0x5ed8('0xfc'),_0x5ed8('0xfd')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x5ed8('0x36'),'color'],'where':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]?{'id':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]}:undefined,'required':_0x298493[_0x5ed8('0x40')][_0x5ed8('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0x5ed8('0x50')](_0x271ce0);})[_0x5ed8('0x1f')](function(_0x13809e){_0x10232c[_0x5ed8('0x51')]=_0x13809e;return _0x10232c;});}})[_0x5ed8('0x1f')](respondWithFilteredResult(_0x2edd7b,_0x271ce0))[_0x5ed8('0x27')](handleError(_0x2edd7b,null));};function iftimePromise(_0xf2cd35,_0x12df1f){return respondWithRpcPromise(_0x5ed8('0xff'),_0x5ed8('0x100'),{'command':_0x12df1f[_0x5ed8('0x101')]?util[_0x5ed8('0xad')]('iftime\x20%s,%s',_0xf2cd35[_0x5ed8('0x102')],_0x12df1f[_0x5ed8('0x101')]):util['format'](_0x5ed8('0x103'),_0xf2cd35[_0x5ed8('0x102')])},client9002)['then'](function(_0x2b6f26){var _0x31def7=_0x2b6f26&&_0x2b6f26[_0x5ed8('0x104')](_0x5ed8('0x105'))>=0x0?!![]:![];logger[_0x5ed8('0x106')](_0x5ed8('0x107'),_0x12df1f['id'],_0xf2cd35['id'],_0xf2cd35[_0x5ed8('0x102')],_0x31def7?_0x5ed8('0x108'):'OFFLINE',_0x12df1f['timezone']?_0x12df1f[_0x5ed8('0x101')]:_0x5ed8('0x109'));return _0x31def7;})[_0x5ed8('0x27')](function(_0x4f4860){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x12df1f['id'],_0xf2cd35['id'],_0xf2cd35['interval'],util[_0x5ed8('0x10a')](_0x4f4860,{'showHidden':![],'depth':null}),_0x12df1f['timezone']?_0x12df1f[_0x5ed8('0x101')]:_0x5ed8('0x109'));return![];});}exports[_0x5ed8('0x100')]=function(_0x2da280,_0x358d5a,_0x40c5e6){var _0x5eb16d=0x0;var _0x329c15=0x0;var _0x4471b2=![];var _0x25b54f;var _0x51a2a5;return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x2da280[_0x5ed8('0x53')]['id']},'include':[{'model':db[_0x5ed8('0x10b')],'as':_0x5ed8('0x10b'),'include':[{'model':db[_0x5ed8('0x10b')],'as':_0x5ed8('0x10c'),'attributes':['id',_0x5ed8('0x102')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x358d5a,null))[_0x5ed8('0x1f')](function(_0x264175){if(_0x264175){_0x25b54f=_0x264175;return _0x264175[_0x5ed8('0x10d')]({'raw':!![]});}})[_0x5ed8('0x1f')](function(_0x589483){if(_0x25b54f){if(_0x589483){_0x51a2a5=_0x589483;}}return require(_0x5ed8('0x17'))[_0x5ed8('0x10e')]();})['then'](function(_0x2c2030){if(_0x2c2030){_0x329c15=_0x2c2030[_0x5ed8('0x10f')];_0x4471b2=_0x2c2030[_0x5ed8('0x77')];}})['then'](function(){return db[_0x5ed8('0xb5')]['count']({'where':{'closed':![]}});})['then'](function(_0x19fe48){_0x5eb16d=_0x19fe48;if(_0x329c15&&_0x19fe48>_0x329c15){return db[_0x5ed8('0x110')][_0x5ed8('0x63')]({'where':{'id':0x1}})[_0x5ed8('0x1f')](function(_0x34e73a){if(_0x34e73a){_0x34e73a[_0x5ed8('0x111')](_0x5ed8('0x112'));}});}})[_0x5ed8('0x1f')](function(){if(_0x25b54f[_0x5ed8('0x10b')]&&_0x25b54f[_0x5ed8('0x10b')][_0x5ed8('0x10c')]){var _0x954885=[];for(var _0xc5606e=0x0;_0xc5606e<_0x25b54f[_0x5ed8('0x10b')][_0x5ed8('0x10c')][_0x5ed8('0x46')];_0xc5606e++){var _0x50218c=_0x25b54f[_0x5ed8('0x10b')]['Intervals'][_0xc5606e]['get']({'plain':!![]});_0x954885[_0x5ed8('0xbc')](iftimePromise(_0x50218c,_0x25b54f));}return BPromise[_0x5ed8('0x113')](_0x954885)['then'](function(_0x2bf98d){return _[_0x5ed8('0x114')](_0x2bf98d);});}else{return!![];}})['then'](function(_0x2001cf){var _0x395ec9=fs[_0x5ed8('0xcd')](path[_0x5ed8('0x74')](config[_0x5ed8('0x75')],_0x5ed8('0x115')),_0x5ed8('0xcf'));var _0x18d0ae={'remote':_0x25b54f[_0x5ed8('0x116')],'query':querystring[_0x5ed8('0x23')](_[_0x5ed8('0x55')](_0x25b54f['get']({'plain':!![]}),{'customerIp':_0x2da280['headers']['x-forwarded-for']||_0x2da280[_0x5ed8('0x84')][_0x5ed8('0x117')]||_0x2da280[_0x5ed8('0x118')]['remoteAddress']||_0x2da280['ip'],'referer':_0x2da280[_0x5ed8('0x84')]['referer'],'openedInteractions':_0x5eb16d,'maxInteractions':_0x329c15,'virtual':_0x4471b2['virtual'],'online':_0x2001cf,'custom':_0x4471b2}))[_0x5ed8('0x119')](/'/g,'\x5c\x27')};_0x358d5a['send'](ejs[_0x5ed8('0xd0')](Mustache[_0x5ed8('0xd0')](_0x395ec9,_0x18d0ae),{'proactiveActions':_0x51a2a5,'alignment':_0x25b54f[_0x5ed8('0x11a')],'verticalAlignment':_0x25b54f[_0x5ed8('0x11b')],'div_color':_0x25b54f[_0x5ed8('0x11c')],'text_color':_0x25b54f[_0x5ed8('0x11d')],'button_color':_0x25b54f[_0x5ed8('0x11e')],'background_color':_0x25b54f['backgroundColor']}));})[_0x5ed8('0x27')](handleError(_0x358d5a,null));};exports[_0x5ed8('0x11f')]=function(_0x40de50,_0x38e266,_0x2347ae){return db[_0x5ed8('0x3b')][_0x5ed8('0x63')]({'where':{'id':_0x40de50[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x38e266,null))[_0x5ed8('0x1f')](function(_0x3911e9){if(_0x3911e9){return db[_0x5ed8('0xd9')][_0x5ed8('0xda')](function(_0x50f307){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x40de50[_0x5ed8('0x53')]['id']},'transaction':_0x50f307})[_0x5ed8('0x1f')](function(_0x303967){var _0x412db6=_[_0x5ed8('0x3a')](_0x40de50[_0x5ed8('0x5e')],function(_0x3a85f0){_0x3a85f0[_0x5ed8('0x65')]=_0x40de50[_0x5ed8('0x53')]['id'];return _0x3a85f0;});return db['ChatApplication'][_0x5ed8('0xdc')](_0x412db6,{'transaction':_0x50f307});});})[_0x5ed8('0x1f')](function(){return db[_0x5ed8('0x120')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x40de50[_0x5ed8('0x53')]['id']},'order':_0x5ed8('0xa0')});});}})[_0x5ed8('0x1f')](respondWithResult(_0x38e266,null))['catch'](handleError(_0x38e266,null));};exports[_0x5ed8('0x121')]=function(_0x3707b6,_0x480626,_0x160c3c){var _0x138d06={};var _0x424031={};var _0x3469b0;var _0x12ac9b;return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0x3707b6['params']['id']}})['then'](handleEntityNotFound(_0x480626,null))[_0x5ed8('0x1f')](function(_0x2aa028){if(_0x2aa028){_0x3469b0=_0x2aa028;_0x424031[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0x120')][_0x5ed8('0x3c')]);_0x424031[_0x5ed8('0x40')]=_['keys'](_0x3707b6[_0x5ed8('0x40')]);_0x424031['filters']=_[_0x5ed8('0x43')](_0x424031['model'],_0x424031[_0x5ed8('0x40')]);_0x138d06[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x424031[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x54')]));_0x138d06[_0x5ed8('0x44')]=_0x138d06[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x138d06[_0x5ed8('0x44')]:_0x424031[_0x5ed8('0x45')];_0x138d06[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0x138d06['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x3707b6['query'],_0x424031['filters']));if(_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x138d06['where']=_['merge'](_0x138d06['where'],{'$or':_[_0x5ed8('0x3a')](_0x138d06[_0x5ed8('0x44')],function(_0x4c578b){var _0x247caf={};_0x247caf[_0x4c578b]={'$like':'%'+_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x247caf;})});}_0x138d06=_[_0x5ed8('0x55')]({},_0x138d06,_0x3707b6[_0x5ed8('0x4e')]);return _0x3469b0[_0x5ed8('0x121')](_0x138d06);}})[_0x5ed8('0x1f')](function(_0x11e194){if(_0x11e194){_0x12ac9b=_0x11e194[_0x5ed8('0x46')];if(!_0x3707b6['query']['hasOwnProperty']('nolimit')){_0x138d06[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x138d06[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x3707b6[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}return _0x3469b0[_0x5ed8('0x121')](_0x138d06);}})[_0x5ed8('0x1f')](function(_0x5a3e67){if(_0x5a3e67){return _0x5a3e67?{'count':_0x12ac9b,'rows':_0x5a3e67}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x480626,null))[_0x5ed8('0x27')](handleError(_0x480626,null));};exports[_0x5ed8('0x122')]=function(_0x364dc3,_0x40a8de,_0x32c917){return db[_0x5ed8('0x123')][_0x5ed8('0x5f')]({'where':{'id':_0x364dc3['params']['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x40a8de,null))[_0x5ed8('0x1f')](function(_0x2bfbaa){if(_0x2bfbaa){return _0x2bfbaa['addProactiveActions'](_0x364dc3[_0x5ed8('0x5e')][_0x5ed8('0x6b')],_[_0x5ed8('0xf8')](_0x364dc3[_0x5ed8('0x5e')],[_0x5ed8('0x6b'),'id'])||{});}})[_0x5ed8('0x1f')](respondWithResult(_0x40a8de,null))[_0x5ed8('0x27')](handleError(_0x40a8de,null));};exports[_0x5ed8('0x10d')]=function(_0x579a16,_0x3e5df8,_0x24362e){var _0x22ca7f={};var _0x187a88={};var _0x336afa;var _0x5b629a;return db['ChatWebsite']['findOne']({'where':{'id':_0x579a16[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x3e5df8,null))[_0x5ed8('0x1f')](function(_0x337b6c){if(_0x337b6c){_0x336afa=_0x337b6c;_0x187a88['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0x124')]['rawAttributes']);_0x187a88[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x579a16[_0x5ed8('0x40')]);_0x187a88[_0x5ed8('0x42')]=_[_0x5ed8('0x43')](_0x187a88[_0x5ed8('0x45')],_0x187a88['query']);_0x22ca7f[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0x187a88[_0x5ed8('0x45')],qs['fields'](_0x579a16['query'][_0x5ed8('0x54')]));_0x22ca7f['attributes']=_0x22ca7f[_0x5ed8('0x44')]['length']?_0x22ca7f[_0x5ed8('0x44')]:_0x187a88[_0x5ed8('0x45')];_0x22ca7f[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0x579a16['query'][_0x5ed8('0x4b')]);_0x22ca7f[_0x5ed8('0x4c')]=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x579a16[_0x5ed8('0x40')],_0x187a88[_0x5ed8('0x42')]));if(_0x579a16[_0x5ed8('0x40')]['filter']){_0x22ca7f['where']=_['merge'](_0x22ca7f[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x22ca7f[_0x5ed8('0x44')],function(_0x624a0e){var _0x93d0cd={};_0x93d0cd[_0x624a0e]={'$like':'%'+_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x93d0cd;})});}_0x22ca7f=_[_0x5ed8('0x55')]({},_0x22ca7f,_0x579a16[_0x5ed8('0x4e')]);return _0x336afa[_0x5ed8('0x10d')](_0x22ca7f);}})['then'](function(_0x19e526){if(_0x19e526){_0x5b629a=_0x19e526[_0x5ed8('0x46')];if(!_0x579a16['query']['hasOwnProperty'](_0x5ed8('0x48'))){_0x22ca7f['limit']=qs[_0x5ed8('0x49')](_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x22ca7f[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x579a16[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}return _0x336afa[_0x5ed8('0x10d')](_0x22ca7f);}})[_0x5ed8('0x1f')](function(_0xc83fe1){if(_0xc83fe1){return _0xc83fe1?{'count':_0x5b629a,'rows':_0xc83fe1}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x3e5df8,null))[_0x5ed8('0x27')](handleError(_0x3e5df8,null));};exports[_0x5ed8('0x125')]=function(_0x4a2994,_0x4d42b0,_0x5b83d1){var _0x39b9a1=_0x4a2994[_0x5ed8('0x40')][_0x5ed8('0x126')]==='false'?'offlineForm':_0x5ed8('0x127');return db[_0x5ed8('0x3b')]['find']({'attributes':['id',_0x39b9a1],'where':{'id':_0x4a2994[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x4d42b0,null))[_0x5ed8('0x1f')](function(_0xe41408){if(_0xe41408){var _0x5e86ff=_0xe41408[_0x39b9a1];var _0x10873f=_0x5e86ff&&_0x5e86ff[_0x5ed8('0x128')]?_0x5e86ff[_0x5ed8('0x128')]:[];_0x4d42b0[_0x5ed8('0xc9')]({'fromKey':_[_0x5ed8('0x78')](_0x5e86ff['fromKey'])?undefined:_0x5e86ff[_0x5ed8('0x129')],'count':_0x10873f[_0x5ed8('0x46')],'rows':_0x10873f});}})[_0x5ed8('0x27')](handleError(_0x4d42b0,null));};exports['getOfflineMessages']=function(_0x442acc,_0x54e67f,_0x118c45){var _0x159fc8={'raw':![],'where':{}};var _0x3f0c87={};var _0x460c32={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5ed8('0x63')]({'where':{'id':_0x442acc[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x54e67f,null))[_0x5ed8('0x1f')](function(_0x35188b){if(_0x35188b){_0x3f0c87['model']=_[_0x5ed8('0x41')](db[_0x5ed8('0xd3')][_0x5ed8('0x3c')]);_0x3f0c87[_0x5ed8('0x40')]=_[_0x5ed8('0x41')](_0x442acc[_0x5ed8('0x40')]);_0x3f0c87['filters']=_[_0x5ed8('0x43')](_0x3f0c87[_0x5ed8('0x45')],_0x3f0c87[_0x5ed8('0x40')]);_0x159fc8['attributes']=_['intersection'](_0x3f0c87[_0x5ed8('0x45')],qs['fields'](_0x442acc[_0x5ed8('0x40')]['fields']));_0x159fc8['attributes']=_0x159fc8[_0x5ed8('0x44')]['length']?_0x159fc8[_0x5ed8('0x44')]:_0x3f0c87[_0x5ed8('0x45')];if(!_0x442acc[_0x5ed8('0x40')]['hasOwnProperty'](_0x5ed8('0x48'))){_0x159fc8[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0x442acc['query']['limit']);_0x159fc8[_0x5ed8('0x2a')]=qs[_0x5ed8('0x2a')](_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x2a')]);}_0x159fc8['order']=qs[_0x5ed8('0x4b')](_0x442acc['query'][_0x5ed8('0x4b')]);_0x159fc8['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0x442acc[_0x5ed8('0x40')],_0x3f0c87['filters']));_0x159fc8[_0x5ed8('0x4c')]['ChatWebsiteId']=_0x35188b['id'];if(_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x159fc8[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0x159fc8[_0x5ed8('0x4c')],{'$or':_[_0x5ed8('0x3a')](_0x159fc8[_0x5ed8('0x44')],function(_0x2a0b3){var _0x2fa437={};_0x2fa437[_0x2a0b3]={'$like':'%'+_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x2fa437;})});}_0x159fc8=_[_0x5ed8('0x55')]({},_0x159fc8,_0x442acc[_0x5ed8('0x4e')]);return db['ChatOfflineMessage']['count']({'where':_0x159fc8[_0x5ed8('0x4c')]})['then'](function(_0x91a00d){_0x460c32[_0x5ed8('0x2c')]=_0x91a00d;if(_0x442acc[_0x5ed8('0x40')][_0x5ed8('0x4f')]){_0x159fc8[_0x5ed8('0x66')]=[{'all':!![]}];}else{_0x159fc8['include']=[{'model':db[_0x5ed8('0x88')],'as':_0x5ed8('0xfa'),'required':![]},{'model':db[_0x5ed8('0xdb')],'as':_0x5ed8('0x12a'),'required':![]}];}return db['ChatOfflineMessage'][_0x5ed8('0x50')](_0x159fc8);})[_0x5ed8('0x1f')](function(_0x5eb1af){_0x460c32['rows']=_0x5eb1af;return _0x460c32;});}})['then'](respondWithFilteredResult(_0x54e67f,_0x159fc8))[_0x5ed8('0x27')](handleError(_0x54e67f,null));};exports[_0x5ed8('0x12b')]=function(_0x4973a8,_0xcd8553,_0x17f0eb){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x4973a8[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0xcd8553,null))[_0x5ed8('0x1f')](function(_0x126c81){if(_0x126c81){return _0x126c81[_0x5ed8('0x12b')](_0x4973a8[_0x5ed8('0x5e')]['ids'],_[_0x5ed8('0xf8')](_0x4973a8[_0x5ed8('0x5e')],[_0x5ed8('0x6b'),'id'])||{})['spread'](function(_0x95889c){for(var _0x5a7d2b=0x0;_0x5a7d2b<_0x4973a8[_0x5ed8('0x5e')][_0x5ed8('0x6b')][_0x5ed8('0x46')];_0x5a7d2b+=0x1){socket[_0x5ed8('0x12c')](_0x5ed8('0x12d'),{'UserId':Number(_0x4973a8['body'][_0x5ed8('0x6b')][_0x5a7d2b]),'ChatWebsiteId':Number(_0x4973a8['params']['id'])});}return _0x95889c;});}})['then'](respondWithResult(_0xcd8553,null))['catch'](handleError(_0xcd8553,null));};exports[_0x5ed8('0x12e')]=function(_0x303cf8,_0x15c5de,_0x29d66d){return db[_0x5ed8('0x3b')][_0x5ed8('0x5f')]({'where':{'id':_0x303cf8[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x15c5de,null))[_0x5ed8('0x1f')](function(_0x42988b){if(_0x42988b){return _0x42988b[_0x5ed8('0x12e')](_0x303cf8[_0x5ed8('0x40')]['ids'])[_0x5ed8('0x1f')](function(){if(_['isArray'](_0x303cf8[_0x5ed8('0x40')]['ids'])){for(var _0x3a94fe=0x0;_0x3a94fe<_0x303cf8['query'][_0x5ed8('0x6b')][_0x5ed8('0x46')];_0x3a94fe+=0x1){socket[_0x5ed8('0x12c')](_0x5ed8('0x12f'),{'UserId':Number(_0x303cf8['query'][_0x5ed8('0x6b')][_0x3a94fe]),'ChatWebsiteId':Number(_0x303cf8[_0x5ed8('0x53')]['id'])});}}else{socket[_0x5ed8('0x12c')](_0x5ed8('0x12f'),{'UserId':Number(_0x303cf8['query'][_0x5ed8('0x6b')]),'ChatWebsiteId':Number(_0x303cf8['params']['id'])});}});}})[_0x5ed8('0x1f')](respondWithStatusCode(_0x15c5de,null))[_0x5ed8('0x27')](handleError(_0x15c5de,null));};exports[_0x5ed8('0x130')]=function(_0xdac0d3,_0x5c960a,_0x161156){var _0x259911={};var _0xa031a2={};var _0x4dc997;var _0x44d051;return db[_0x5ed8('0x3b')]['findOne']({'where':{'id':_0xdac0d3[_0x5ed8('0x53')]['id']}})[_0x5ed8('0x1f')](handleEntityNotFound(_0x5c960a,null))[_0x5ed8('0x1f')](function(_0x43445d){if(_0x43445d){_0x4dc997=_0x43445d;_0xa031a2[_0x5ed8('0x45')]=_[_0x5ed8('0x41')](db[_0x5ed8('0xc2')][_0x5ed8('0x3c')]);_0xa031a2['query']=_[_0x5ed8('0x41')](_0xdac0d3[_0x5ed8('0x40')]);_0xa031a2['filters']=_['intersection'](_0xa031a2['model'],_0xa031a2[_0x5ed8('0x40')]);_0x259911[_0x5ed8('0x44')]=_[_0x5ed8('0x43')](_0xa031a2[_0x5ed8('0x45')],qs[_0x5ed8('0x54')](_0xdac0d3['query']['fields']));_0x259911['attributes']=_0x259911[_0x5ed8('0x44')][_0x5ed8('0x46')]?_0x259911[_0x5ed8('0x44')]:_0xa031a2[_0x5ed8('0x45')];_0x259911[_0x5ed8('0x4a')]=qs[_0x5ed8('0x4b')](_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4b')]);_0x259911['where']=qs[_0x5ed8('0x42')](_[_0x5ed8('0x64')](_0xdac0d3[_0x5ed8('0x40')],_0xa031a2[_0x5ed8('0x42')]));if(_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4d')]){_0x259911[_0x5ed8('0x4c')]=_[_0x5ed8('0x55')](_0x259911[_0x5ed8('0x4c')],{'$or':_['map'](_0x259911['attributes'],function(_0x2797e1){var _0x9a94d2={};_0x9a94d2[_0x2797e1]={'$like':'%'+_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x4d')]+'%'};return _0x9a94d2;})});}_0x259911=_[_0x5ed8('0x55')]({},_0x259911,_0xdac0d3[_0x5ed8('0x4e')]);return _0x4dc997[_0x5ed8('0x130')](_0x259911);}})[_0x5ed8('0x1f')](function(_0x3585a3){if(_0x3585a3){_0x44d051=_0x3585a3['length'];if(!_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x47')]('nolimit')){_0x259911[_0x5ed8('0x49')]=qs[_0x5ed8('0x49')](_0xdac0d3[_0x5ed8('0x40')][_0x5ed8('0x49')]);_0x259911['offset']=qs['offset'](_0xdac0d3['query']['offset']);}return _0x4dc997['getAgents'](_0x259911);}})[_0x5ed8('0x1f')](function(_0x60111b){if(_0x60111b){return _0x60111b?{'count':_0x44d051,'rows':_0x60111b}:null;}})[_0x5ed8('0x1f')](respondWithResult(_0x5c960a,null))['catch'](handleError(_0x5c960a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 8948b27..ca38f6d 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 _0x4ab0=['save','update','emit','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x4ab0,0xd5));var _0x04ab=function(_0x309cca,_0x4dd271){_0x309cca=_0x309cca-0x0;var _0x3a5edd=_0x4ab0[_0x309cca];return _0x3a5edd;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x04ab('0x0'))['db'][_0x04ab('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x04ab('0x2')](0x0);var events={'afterCreate':_0x04ab('0x3'),'afterUpdate':_0x04ab('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c3a53){return function(_0x45dfee,_0xb1bf2d,_0x491958){ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53+':'+_0x45dfee['id'],_0x45dfee);ChatWebsiteEvents[_0x04ab('0x5')](_0x4c3a53,_0x45dfee);_0x491958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x04ab('0x6')](e,emitEvent(event));}}module[_0x04ab('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xbfda=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','save'];(function(_0x188aea,_0x304964){var _0x30509b=function(_0x34b956){while(--_0x34b956){_0x188aea['push'](_0x188aea['shift']());}};_0x30509b(++_0x304964);}(_0xbfda,0x1dc));var _0xabfd=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xbfda[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0xabfd('0x0'));var ChatWebsite=require(_0xabfd('0x1'))['db'][_0xabfd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabfd('0x3'),'afterUpdate':'update','afterDestroy':_0xabfd('0x4')};function emitEvent(_0x138c67){return function(_0x384d8e,_0x3818ef,_0x48aff0){ChatWebsiteEvents[_0xabfd('0x5')](_0x138c67+':'+_0x384d8e['id'],_0x384d8e);ChatWebsiteEvents['emit'](_0x138c67,_0x384d8e);_0x48aff0(null);};}for(var e in events){if(events[_0xabfd('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xabfd('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0092699..c00156f 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 _0xa8a3=['bluebird','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x408860,_0x132291){var _0xd467bc=function(_0x2e1329){while(--_0x2e1329){_0x408860['push'](_0x408860['shift']());}};_0xd467bc(++_0x132291);}(_0xa8a3,0x167));var _0x3a8a=function(_0x15c97c,_0x47772c){_0x15c97c=_0x15c97c-0x0;var _0x2db36e=_0xa8a3[_0x15c97c];return _0x2db36e;};'use strict';var _=require(_0x3a8a('0x0'));var util=require(_0x3a8a('0x1'));var logger=require(_0x3a8a('0x2'))(_0x3a8a('0x3'));var moment=require(_0x3a8a('0x4'));var BPromise=require(_0x3a8a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a8a('0x6'));var rimraf=require(_0x3a8a('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a8a('0x8'));module[_0x3a8a('0x9')]=function(_0x44f2f0,_0x3f835b){return _0x44f2f0[_0x3a8a('0xa')](_0x3a8a('0xb'),attributes,{'tableName':_0x3a8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf787=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','util'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xf787,0xdc));var _0x7f78=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0xf787[_0x590381];return _0xe300df;};'use strict';var _=require('lodash');var util=require(_0x7f78('0x0'));var logger=require(_0x7f78('0x1'))(_0x7f78('0x2'));var moment=require(_0x7f78('0x3'));var BPromise=require(_0x7f78('0x4'));var rp=require(_0x7f78('0x5'));var fs=require('fs');var path=require(_0x7f78('0x6'));var rimraf=require(_0x7f78('0x7'));var config=require(_0x7f78('0x8'));var attributes=require(_0x7f78('0x9'));module[_0x7f78('0xa')]=function(_0x2e4434,_0x2d47d9){return _0x2e4434[_0x7f78('0xb')](_0x7f78('0xc'),attributes,{'tableName':'chat_websites','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 5651661..990f10a 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 _0xc956=['socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x1a5751,_0x1e8ea2){var _0x42a70b=function(_0x34727d){while(--_0x34727d){_0x1a5751['push'](_0x1a5751['shift']());}};_0x42a70b(++_0x1e8ea2);}(_0xc956,0x195));var _0x6c95=function(_0x79407b,_0x44ada3){_0x79407b=_0x79407b-0x0;var _0xdd3fb2=_0xc956[_0x79407b];return _0xdd3fb2;};'use strict';var _=require(_0x6c95('0x0'));var util=require(_0x6c95('0x1'));var moment=require(_0x6c95('0x2'));var BPromise=require(_0x6c95('0x3'));var rs=require(_0x6c95('0x4'));var fs=require('fs');var Redis=require(_0x6c95('0x5'));var db=require(_0x6c95('0x6'))['db'];var utils=require(_0x6c95('0x7'));var logger=require(_0x6c95('0x8'))('rpc');var config=require(_0x6c95('0x9'));var jayson=require(_0x6c95('0xa'));var client=jayson[_0x6c95('0xb')]['http']({'port':0x232a});config[_0x6c95('0xc')]=_[_0x6c95('0xd')](config[_0x6c95('0xc')],{'host':_0x6c95('0xe'),'port':0x18eb});var socket=require(_0x6c95('0xf'))(new Redis(config[_0x6c95('0xc')]));require(_0x6c95('0x10'))[_0x6c95('0x11')](socket);function respondWithRpcPromise(_0x5bf0bc,_0x217eb6,_0x5e7932){return new BPromise(function(_0x562c74,_0x35e864){return client['request'](_0x5bf0bc,_0x5e7932)[_0x6c95('0x12')](function(_0x1269c6){logger[_0x6c95('0x13')](_0x6c95('0x14'),_0x217eb6,'request\x20sent');logger['debug'](_0x6c95('0x15'),_0x217eb6,_0x6c95('0x16'),JSON[_0x6c95('0x17')](_0x1269c6));if(_0x1269c6[_0x6c95('0x18')]){if(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x19')]===0x1f4){logger['error'](_0x6c95('0x14'),_0x217eb6,_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);return _0x35e864(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);}logger['error'](_0x6c95('0x14'),_0x217eb6,_0x1269c6[_0x6c95('0x18')]['message']);return _0x562c74(_0x1269c6[_0x6c95('0x18')][_0x6c95('0x1a')]);}else{logger[_0x6c95('0x13')](_0x6c95('0x14'),_0x217eb6,_0x6c95('0x16'));_0x562c74(_0x1269c6['result'][_0x6c95('0x1a')]);}})[_0x6c95('0x1b')](function(_0x279a41){logger[_0x6c95('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x217eb6,_0x279a41);_0x35e864(_0x279a41);});});} \ No newline at end of file +var _0x1d8a=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1d8a,0x1f4));var _0xa1d8=function(_0xe84a74,_0xa8cfda){_0xe84a74=_0xe84a74-0x0;var _0x166fd8=_0x1d8a[_0xe84a74];return _0x166fd8;};'use strict';var _=require(_0xa1d8('0x0'));var util=require(_0xa1d8('0x1'));var moment=require(_0xa1d8('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1d8('0x5'))(_0xa1d8('0x6'));var config=require(_0xa1d8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa1d8('0x8')]({'port':0x232a});config[_0xa1d8('0x9')]=_[_0xa1d8('0xa')](config[_0xa1d8('0x9')],{'host':_0xa1d8('0xb'),'port':0x18eb});var socket=require(_0xa1d8('0xc'))(new Redis(config[_0xa1d8('0x9')]));require('./chatWebsite.socket')[_0xa1d8('0xd')](socket);function respondWithRpcPromise(_0x54fd32,_0x38f09b,_0x54ee20){return new BPromise(function(_0x43f2d6,_0x329c9e){return client['request'](_0x54fd32,_0x54ee20)[_0xa1d8('0xe')](function(_0x831683){logger[_0xa1d8('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x38f09b,_0xa1d8('0x10'));logger[_0xa1d8('0x11')](_0xa1d8('0x12'),_0x38f09b,_0xa1d8('0x10'),JSON['stringify'](_0x831683));if(_0x831683[_0xa1d8('0x13')]){if(_0x831683[_0xa1d8('0x13')][_0xa1d8('0x14')]===0x1f4){logger['error'](_0xa1d8('0x15'),_0x38f09b,_0x831683['error'][_0xa1d8('0x16')]);return _0x329c9e(_0x831683[_0xa1d8('0x13')]['message']);}logger['error'](_0xa1d8('0x15'),_0x38f09b,_0x831683['error'][_0xa1d8('0x16')]);return _0x43f2d6(_0x831683[_0xa1d8('0x13')][_0xa1d8('0x16')]);}else{logger[_0xa1d8('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x38f09b,_0xa1d8('0x10'));_0x43f2d6(_0x831683[_0xa1d8('0x17')][_0xa1d8('0x16')]);}})['catch'](function(_0x8e4b05){logger[_0xa1d8('0x13')](_0xa1d8('0x15'),_0x38f09b,_0x8e4b05);_0x329c9e(_0x8e4b05);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ef4d02f..bf151cc 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 _0xbd32=['remove','update','emit','register','length','./chatWebsite.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd32,0x83));var _0x2bd3=function(_0x2bdf04,_0x5e608e){_0x2bdf04=_0x2bdf04-0x0;var _0x33ce04=_0xbd32[_0x2bdf04];return _0x33ce04;};'use strict';var ChatWebsiteEvents=require(_0x2bd3('0x0'));var events=[_0x2bd3('0x1'),_0x2bd3('0x2'),_0x2bd3('0x3')];function createListener(_0x23059d,_0x8dcafa){return function(_0x348fba){_0x8dcafa[_0x2bd3('0x4')](_0x23059d,_0x348fba);};}function removeListener(_0x550c61,_0x40298b){return function(){ChatWebsiteEvents['removeListener'](_0x550c61,_0x40298b);};}exports[_0x2bd3('0x5')]=function(_0x4649a1){for(var _0x125475=0x0,_0x552f9c=events[_0x2bd3('0x6')];_0x125475<_0x552f9c;_0x125475++){var _0x20ed3e=events[_0x125475];var _0x41621c=createListener('chatWebsite:'+_0x20ed3e,_0x4649a1);ChatWebsiteEvents['on'](_0x20ed3e,_0x41621c);}}; \ No newline at end of file +var _0x950e=['chatWebsite:','./chatWebsite.events','save','emit','register','length'];(function(_0x5fe5ca,_0x4e92d3){var _0x42f45f=function(_0x2511eb){while(--_0x2511eb){_0x5fe5ca['push'](_0x5fe5ca['shift']());}};_0x42f45f(++_0x4e92d3);}(_0x950e,0x85));var _0xe950=function(_0x56f187,_0x2eec20){_0x56f187=_0x56f187-0x0;var _0x1b8b67=_0x950e[_0x56f187];return _0x1b8b67;};'use strict';var ChatWebsiteEvents=require(_0xe950('0x0'));var events=[_0xe950('0x1'),'remove','update'];function createListener(_0x5c403c,_0x46ccf5){return function(_0x4df08c){_0x46ccf5[_0xe950('0x2')](_0x5c403c,_0x4df08c);};}function removeListener(_0x363422,_0x477f88){return function(){ChatWebsiteEvents['removeListener'](_0x363422,_0x477f88);};}exports[_0xe950('0x3')]=function(_0x36655){for(var _0x515c94=0x0,_0x290204=events[_0xe950('0x4')];_0x515c94<_0x290204;_0x515c94++){var _0x3f3081=events[_0x515c94];var _0x508f75=createListener(_0xe950('0x5')+_0x3f3081,_0x36655);ChatWebsiteEvents['on'](_0x3f3081,_0x508f75);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index abf3ada..b668e9a 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 _0x24e9=['delete','destroy','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','file','server/files/images/avatars/','format','single','addAvatar','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','replace','any','/:id/interactions','addApplications','addProactiveActions','addAgents','update'];(function(_0x28098d,_0xdaed8e){var _0xc6a35f=function(_0x57ebff){while(--_0x57ebff){_0x28098d['push'](_0x28098d['shift']());}};_0xc6a35f(++_0xdaed8e);}(_0x24e9,0x159));var _0x924e=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x24e9[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0x924e('0x0'));var util=require('util');var path=require(_0x924e('0x1'));var timeout=require(_0x924e('0x2'));var express=require(_0x924e('0x3'));var router=express[_0x924e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x924e('0x5'));var interaction=require(_0x924e('0x6'));var config=require(_0x924e('0x7'));var controller=require('./chatWebsite.controller');router[_0x924e('0x8')]('/',auth[_0x924e('0x9')](),controller[_0x924e('0xa')]);router[_0x924e('0x8')](_0x924e('0xb'),auth[_0x924e('0x9')](),controller['describe']);router[_0x924e('0x8')](_0x924e('0xc'),auth['isAuthenticated'](),controller[_0x924e('0xd')]);router[_0x924e('0x8')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller['getDispositions']);router['get'](_0x924e('0xf'),auth['isAuthenticated'](),controller[_0x924e('0x10')]);router[_0x924e('0x8')](_0x924e('0x11'),controller[_0x924e('0x12')]);router['get'](_0x924e('0x13'),controller[_0x924e('0x14')]);router[_0x924e('0x8')](_0x924e('0x15'),controller[_0x924e('0x16')]);router[_0x924e('0x8')](_0x924e('0x17'),controller[_0x924e('0x18')]);router[_0x924e('0x8')]('/:id/interactions',auth[_0x924e('0x9')](),controller['getInteractions']);router[_0x924e('0x8')](_0x924e('0x19'),controller['getSnippet']);router['get'](_0x924e('0x1a'),auth['isAuthenticated'](),controller[_0x924e('0x1b')]);router[_0x924e('0x8')](_0x924e('0x1c'),auth[_0x924e('0x9')](),controller[_0x924e('0x1d')]);router['get'](_0x924e('0x1e'),controller[_0x924e('0x1f')]);router['get']('/:id/offline_messages',auth[_0x924e('0x9')](),controller[_0x924e('0x20')]);router[_0x924e('0x8')](_0x924e('0x21'),auth['isAuthenticated'](),controller[_0x924e('0x22')]);router[_0x924e('0x23')]('/',auth[_0x924e('0x9')](),controller[_0x924e('0x24')]);router[_0x924e('0x23')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller[_0x924e('0x25')]);router['post'](_0x924e('0xf'),auth[_0x924e('0x9')](),controller[_0x924e('0x26')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x3b8096,_0x235ab3,_0xffcfee){_0xffcfee(null,path[_0x924e('0x28')](config[_0x924e('0x29')],_0x924e('0x2a')));},'filename':function(_0x3468c0,_0x587c9b,_0x29f80e){_0x29f80e(null,util['format'](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x587c9b['originalname']));}})});router[_0x924e('0x23')](_0x924e('0x11'),upload['single'](_0x924e('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x3e680d,_0x3e019c,_0x2fb6f3){_0x2fb6f3(null,path['join'](config['root'],_0x924e('0x2e')));},'filename':function(_0xad49c0,_0xe8f3a4,_0x17077b){_0x17077b(null,util[_0x924e('0x2f')]('%s-%s',Date[_0x924e('0x2c')](),_0xe8f3a4['originalname']));}})});router[_0x924e('0x23')]('/:id/avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x31')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x37695f,_0x19dc33,_0x343e17){_0x343e17(null,path[_0x924e('0x28')](config[_0x924e('0x29')],_0x924e('0x2e')));},'filename':function(_0x3065a7,_0x41ca26,_0x49a74f){_0x49a74f(null,util[_0x924e('0x2f')](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x41ca26[_0x924e('0x32')]));}})});router[_0x924e('0x23')]('/:id/customer_avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x33')]);var upload=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x2baf9e,_0x45be55,_0x54a6dc){_0x54a6dc(null,path['join'](config[_0x924e('0x29')],_0x924e('0x2e')));},'filename':function(_0x49706b,_0x5da8d6,_0xcaf44f){_0xcaf44f(null,util['format'](_0x924e('0x2b'),Date[_0x924e('0x2c')](),_0x5da8d6[_0x924e('0x32')]));}})});router[_0x924e('0x23')]('/:id/system_avatar',upload[_0x924e('0x30')](_0x924e('0x2d')),controller[_0x924e('0x34')]);router[_0x924e('0x23')](_0x924e('0x35'),controller[_0x924e('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x924e('0x27')]({'destination':function(_0x48b147,_0x4e1277,_0x3b1f5e){const _0x592d90=path[_0x924e('0x28')](config[_0x924e('0x29')],'server/files','attachments',_0x924e('0x37'));fs_extra['ensureDir'](_0x592d90,function(){_0x3b1f5e(null,_0x592d90);});},'filename':function(_0x3b05b7,_0x5a18ca,_0x10e9fd){const _0x471275=_0x5a18ca[_0x924e('0x32')][_0x924e('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3eeb55=path['extname'](_0x471275);const _0x4b04a5=Date[_0x924e('0x2c')]()+'-'+_0x471275[_0x924e('0x38')](_0x3eeb55,'')+_0x3eeb55;_0x10e9fd(null,_0x4b04a5);}})});router['post']('/:id/offline',offlineUploadMulter[_0x924e('0x39')](),controller['offline']);router['post'](_0x924e('0x3a'),auth[_0x924e('0x9')](),controller['addInteraction']);router[_0x924e('0x23')](_0x924e('0x1a'),auth[_0x924e('0x9')](),controller[_0x924e('0x3b')]);router[_0x924e('0x23')](_0x924e('0x1c'),auth['isAuthenticated'](),controller[_0x924e('0x3c')]);router[_0x924e('0x23')](_0x924e('0x21'),auth[_0x924e('0x9')](),controller[_0x924e('0x3d')]);router['put']('/:id',auth[_0x924e('0x9')](),controller[_0x924e('0x3e')]);router[_0x924e('0x3f')](_0x924e('0xc'),auth[_0x924e('0x9')](),controller[_0x924e('0x40')]);router[_0x924e('0x3f')](_0x924e('0xe'),auth[_0x924e('0x9')](),controller[_0x924e('0x41')]);router['delete'](_0x924e('0xf'),auth['isAuthenticated'](),controller[_0x924e('0x42')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x924e('0x43')]=router; \ No newline at end of file +var _0x1f82=['post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','create'];(function(_0x71e7b1,_0x5509c1){var _0x42a61a=function(_0x3e650f){while(--_0x3e650f){_0x71e7b1['push'](_0x71e7b1['shift']());}};_0x42a61a(++_0x5509c1);}(_0x1f82,0x72));var _0x21f8=function(_0x3a3f0c,_0x174f79){_0x3a3f0c=_0x3a3f0c-0x0;var _0x184722=_0x1f82[_0x3a3f0c];return _0x184722;};'use strict';var multer=require(_0x21f8('0x0'));var util=require(_0x21f8('0x1'));var path=require(_0x21f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x21f8('0x3'));var router=express[_0x21f8('0x4')]();var fs_extra=require(_0x21f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x21f8('0x6'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x21f8('0x7')]);router[_0x21f8('0x8')](_0x21f8('0x9'),auth['isAuthenticated'](),controller[_0x21f8('0xa')]);router[_0x21f8('0x8')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0xd')]);router[_0x21f8('0x8')](_0x21f8('0xe'),auth[_0x21f8('0xc')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x21f8('0x8')]('/:id/logo',controller['getLogo']);router[_0x21f8('0x8')]('/:id/avatar',controller[_0x21f8('0xf')]);router[_0x21f8('0x8')](_0x21f8('0x10'),controller['getCustomerAvatar']);router[_0x21f8('0x8')](_0x21f8('0x11'),controller[_0x21f8('0x12')]);router[_0x21f8('0x8')](_0x21f8('0x13'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x14')]);router[_0x21f8('0x8')](_0x21f8('0x15'),controller['getSnippet']);router[_0x21f8('0x8')](_0x21f8('0x16'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x17')]);router[_0x21f8('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x21f8('0x18'),controller[_0x21f8('0x19')]);router['get'](_0x21f8('0x1a'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x1b')]);router[_0x21f8('0x8')](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x21f8('0x1d')]);router[_0x21f8('0x1e')](_0x21f8('0xe'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x1f')]);router['post']('/:id/canned_answers',auth[_0x21f8('0xc')](),controller[_0x21f8('0x20')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x4c5184,_0x19b61e,_0x14dbdc){_0x14dbdc(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x24')));},'filename':function(_0xf41814,_0x530fa1,_0x447e19){_0x447e19(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x530fa1[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x29'),upload[_0x21f8('0x2a')](_0x21f8('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x57eb44,_0x1d2579,_0x1194b8){_0x1194b8(null,path[_0x21f8('0x22')](config['root'],_0x21f8('0x2c')));},'filename':function(_0x13554f,_0x29a449,_0x47d4bf){_0x47d4bf(null,util['format'](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x29a449[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x2d'),upload[_0x21f8('0x2a')](_0x21f8('0x2b')),controller[_0x21f8('0x2e')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x542472,_0x289b6b,_0x362a76){_0x362a76(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x2c')));},'filename':function(_0x3e090d,_0x369feb,_0x55ca35){_0x55ca35(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date['now'](),_0x369feb[_0x21f8('0x28')]));}})});router['post'](_0x21f8('0x10'),upload[_0x21f8('0x2a')]('file'),controller[_0x21f8('0x2f')]);var upload=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x37a806,_0x4494d5,_0x5cbe81){_0x5cbe81(null,path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x2c')));},'filename':function(_0x525f6d,_0x1d3228,_0xa1830b){_0xa1830b(null,util[_0x21f8('0x25')](_0x21f8('0x26'),Date[_0x21f8('0x27')](),_0x1d3228[_0x21f8('0x28')]));}})});router[_0x21f8('0x1e')](_0x21f8('0x11'),upload[_0x21f8('0x2a')]('file'),controller[_0x21f8('0x30')]);router[_0x21f8('0x1e')](_0x21f8('0x31'),controller[_0x21f8('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x21f8('0x21')]({'destination':function(_0x1b05b2,_0x5dc762,_0x1a53c6){const _0x1c731a=path[_0x21f8('0x22')](config[_0x21f8('0x23')],_0x21f8('0x33'),'attachments',_0x21f8('0x34'));fs_extra[_0x21f8('0x35')](_0x1c731a,function(){_0x1a53c6(null,_0x1c731a);});},'filename':function(_0x289e86,_0x555952,_0x5529d3){const _0x3894bd=_0x555952[_0x21f8('0x28')][_0x21f8('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xf69e2f=path[_0x21f8('0x37')](_0x3894bd);const _0x26231a=Date['now']()+'-'+_0x3894bd[_0x21f8('0x36')](_0xf69e2f,'')+_0xf69e2f;_0x5529d3(null,_0x26231a);}})});router[_0x21f8('0x1e')](_0x21f8('0x38'),offlineUploadMulter[_0x21f8('0x39')](),controller[_0x21f8('0x3a')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x21f8('0x3b')]);router[_0x21f8('0x1e')]('/:id/applications',auth[_0x21f8('0xc')](),controller[_0x21f8('0x3c')]);router[_0x21f8('0x1e')]('/:id/proactive_actions',auth[_0x21f8('0xc')](),controller[_0x21f8('0x3d')]);router[_0x21f8('0x1e')](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x3e')]);router[_0x21f8('0x3f')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x40')]);router[_0x21f8('0x41')](_0x21f8('0xb'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x42')]);router['delete']('/:id/dispositions',auth[_0x21f8('0xc')](),controller[_0x21f8('0x43')]);router[_0x21f8('0x41')](_0x21f8('0x44'),auth['isAuthenticated'](),controller[_0x21f8('0x45')]);router['delete'](_0x21f8('0x1c'),auth[_0x21f8('0xc')](),controller[_0x21f8('0x46')]);module[_0x21f8('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index eedbe7f..3f7b29c 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96fd=['STRING','exports','ENUM','AmazonAWS'];(function(_0x3c330c,_0xa423b4){var _0x49031b=function(_0x29e852){while(--_0x29e852){_0x3c330c['push'](_0x3c330c['shift']());}};_0x49031b(++_0xa423b4);}(_0x96fd,0x1e9));var _0xd96f=function(_0x54f8c3,_0x15e392){_0x54f8c3=_0x54f8c3-0x0;var _0x2cd1cc=_0x96fd[_0x54f8c3];return _0x2cd1cc;};'use strict';var Sequelize=require('sequelize');module[_0xd96f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd96f('0x1')](_0xd96f('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xd96f('0x3')]},'data2':{'type':Sequelize[_0xd96f('0x3')]}}; \ No newline at end of file +var _0xe953=['exports','STRING','AmazonAWS','Google','sequelize'];(function(_0xf9bd0a,_0x123ba0){var _0x1da48e=function(_0x27c74c){while(--_0x27c74c){_0xf9bd0a['push'](_0xf9bd0a['shift']());}};_0x1da48e(++_0x123ba0);}(_0xe953,0xf9));var _0x3e95=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0xe953[_0x54edc9];return _0x2ae7a9;};'use strict';var Sequelize=require(_0x3e95('0x0'));module[_0x3e95('0x1')]={'name':{'type':Sequelize[_0x3e95('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x3e95('0x3'),_0x3e95('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3e95('0x2')]},'data2':{'type':Sequelize[_0x3e95('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 0ace70a..0ea2197 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4635dc,_0xe243a8){_0x4635dc=_0x4635dc-0x0;var _0x43a990=_0x5f2f[_0x4635dc];return _0x43a990;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xadb5,0xad));var _0x5adb=function(_0x245129,_0x5f434c){_0x245129=_0x245129-0x0;var _0x29a2e4=_0xadb5[_0x245129];return _0x29a2e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 1346fd7..8ab86ab 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a63=['request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','../../config/logger','api'];(function(_0x122979,_0x2a0f9a){var _0x173e85=function(_0x1d4f69){while(--_0x1d4f69){_0x122979['push'](_0x122979['shift']());}};_0x173e85(++_0x2a0f9a);}(_0x5a63,0xd9));var _0x35a6=function(_0x110910,_0x4ffd63){_0x110910=_0x110910-0x0;var _0x221c41=_0x5a63[_0x110910];return _0x221c41;};'use strict';var _=require(_0x35a6('0x0'));var util=require('util');var logger=require(_0x35a6('0x1'))(_0x35a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x35a6('0x3'));var fs=require('fs');var path=require(_0x35a6('0x4'));var rimraf=require(_0x35a6('0x5'));var config=require(_0x35a6('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x35a6('0x7')]=function(_0x27a8ad,_0x1be323){return _0x27a8ad[_0x35a6('0x8')](_0x35a6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf30c=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2242c9,_0x5a485b){var _0x5ca46a=function(_0x169423){while(--_0x169423){_0x2242c9['push'](_0x2242c9['shift']());}};_0x5ca46a(++_0x5a485b);}(_0xf30c,0x69));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf30('0x0'));var util=require(_0xcf30('0x1'));var logger=require(_0xcf30('0x2'))(_0xcf30('0x3'));var moment=require('moment');var BPromise=require(_0xcf30('0x4'));var rp=require(_0xcf30('0x5'));var fs=require('fs');var path=require(_0xcf30('0x6'));var rimraf=require(_0xcf30('0x7'));var config=require(_0xcf30('0x8'));var attributes=require(_0xcf30('0x9'));module[_0xcf30('0xa')]=function(_0x25e894,_0x127ff8){return _0x25e894[_0xcf30('0xb')](_0xcf30('0xc'),attributes,{'tableName':_0xcf30('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 1b5c710..4d80f5d 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x73a1=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x12c5b3,_0xa19b5e){var _0x26ea1d=function(_0x4b63f6){while(--_0x4b63f6){_0x12c5b3['push'](_0x12c5b3['shift']());}};_0x26ea1d(++_0xa19b5e);}(_0x73a1,0x161));var _0x173a=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x73a1[_0x25c326];return _0x762452;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x173a('0x0'));var BPromise=require(_0x173a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x173a('0x2'));var db=require(_0x173a('0x3'))['db'];var utils=require(_0x173a('0x4'));var logger=require(_0x173a('0x5'))(_0x173a('0x6'));var config=require('../../config/environment');var jayson=require(_0x173a('0x7'));var client=jayson[_0x173a('0x8')][_0x173a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd8757,_0x12bb11,_0x550e2b){return new BPromise(function(_0x2b545e,_0x2c7090){return client[_0x173a('0xa')](_0xbd8757,_0x550e2b)[_0x173a('0xb')](function(_0x30ffef){logger[_0x173a('0xc')]('CloudProvider,\x20%s,\x20%s',_0x12bb11,_0x173a('0xd'));logger['debug'](_0x173a('0xe'),_0x12bb11,_0x173a('0xd'),JSON[_0x173a('0xf')](_0x30ffef));if(_0x30ffef[_0x173a('0x10')]){if(_0x30ffef['error'][_0x173a('0x11')]===0x1f4){logger['error'](_0x173a('0x12'),_0x12bb11,_0x30ffef['error'][_0x173a('0x13')]);return _0x2c7090(_0x30ffef[_0x173a('0x10')]['message']);}logger[_0x173a('0x10')](_0x173a('0x12'),_0x12bb11,_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);return _0x2b545e(_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);}else{logger[_0x173a('0xc')](_0x173a('0x12'),_0x12bb11,'request\x20sent');_0x2b545e(_0x30ffef[_0x173a('0x14')][_0x173a('0x13')]);}})[_0x173a('0x15')](function(_0x4b323c){logger['error']('CloudProvider,\x20%s,\x20%s',_0x12bb11,_0x4b323c);_0x2c7090(_0x4b323c);});});} \ No newline at end of file +var _0xf8f2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x3418e2,_0x36323d){_0x3418e2=_0x3418e2-0x0;var _0x4ba2e5=_0xf8f2[_0x3418e2];return _0x4ba2e5;};'use strict';var _=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var moment=require(_0x2f8f('0x2'));var BPromise=require(_0x2f8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f8f('0x4'));var db=require(_0x2f8f('0x5'))['db'];var utils=require(_0x2f8f('0x6'));var logger=require(_0x2f8f('0x7'))(_0x2f8f('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f8f('0x9'));var client=jayson[_0x2f8f('0xa')][_0x2f8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107748,_0x590ff4,_0xb4473){return new BPromise(function(_0x10d128,_0x1237d5){return client['request'](_0x107748,_0xb4473)[_0x2f8f('0xc')](function(_0x1ce821){logger[_0x2f8f('0xd')](_0x2f8f('0xe'),_0x590ff4,'request\x20sent');logger[_0x2f8f('0xf')](_0x2f8f('0x10'),_0x590ff4,'request\x20sent',JSON[_0x2f8f('0x11')](_0x1ce821));if(_0x1ce821[_0x2f8f('0x12')]){if(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x13')]===0x1f4){logger['error'](_0x2f8f('0xe'),_0x590ff4,_0x1ce821[_0x2f8f('0x12')]['message']);return _0x1237d5(_0x1ce821['error'][_0x2f8f('0x14')]);}logger[_0x2f8f('0x12')]('CloudProvider,\x20%s,\x20%s',_0x590ff4,_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);return _0x10d128(_0x1ce821[_0x2f8f('0x12')][_0x2f8f('0x14')]);}else{logger[_0x2f8f('0xd')]('CloudProvider,\x20%s,\x20%s',_0x590ff4,'request\x20sent');_0x10d128(_0x1ce821['result']['message']);}})[_0x2f8f('0x15')](function(_0xee85bb){logger[_0x2f8f('0x12')](_0x2f8f('0xe'),_0x590ff4,_0xee85bb);_0x1237d5(_0xee85bb);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index abe1c37..3059894 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bcd=['post','put','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show'];(function(_0x23d022,_0x406eb6){var _0x137cb4=function(_0x4e2614){while(--_0x4e2614){_0x23d022['push'](_0x23d022['shift']());}};_0x137cb4(++_0x406eb6);}(_0x8bcd,0x174));var _0xd8bc=function(_0x37dbe8,_0x4f5f37){_0x37dbe8=_0x37dbe8-0x0;var _0x39c204=_0x8bcd[_0x37dbe8];return _0x39c204;};'use strict';var multer=require(_0xd8bc('0x0'));var util=require('util');var path=require(_0xd8bc('0x1'));var timeout=require(_0xd8bc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd8bc('0x3'));var interaction=require(_0xd8bc('0x4'));var config=require(_0xd8bc('0x5'));var controller=require(_0xd8bc('0x6'));router[_0xd8bc('0x7')]('/',auth[_0xd8bc('0x8')](),controller[_0xd8bc('0x9')]);router[_0xd8bc('0x7')](_0xd8bc('0xa'),auth['isAuthenticated'](),controller[_0xd8bc('0xb')]);router[_0xd8bc('0xc')]('/',auth[_0xd8bc('0x8')](),controller['create']);router[_0xd8bc('0xd')](_0xd8bc('0xa'),auth[_0xd8bc('0x8')](),controller['update']);router[_0xd8bc('0xe')](_0xd8bc('0xa'),auth[_0xd8bc('0x8')](),controller['destroy']);module[_0xd8bc('0xf')]=router; \ No newline at end of file +var _0xbfd1=['isAuthenticated','/:id','show','post','create','put','update','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x5ace35,_0xe9d5c9){var _0x5920c1=function(_0x3072f9){while(--_0x3072f9){_0x5ace35['push'](_0x5ace35['shift']());}};_0x5920c1(++_0xe9d5c9);}(_0xbfd1,0x134));var _0x1bfd=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xbfd1[_0x45e98e];return _0x374dba;};'use strict';var multer=require('multer');var util=require(_0x1bfd('0x0'));var path=require('path');var timeout=require(_0x1bfd('0x1'));var express=require('express');var router=express[_0x1bfd('0x2')]();var fs_extra=require(_0x1bfd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1bfd('0x4'));var config=require(_0x1bfd('0x5'));var controller=require('./cloudProvider.controller');router[_0x1bfd('0x6')]('/',auth[_0x1bfd('0x7')](),controller['index']);router[_0x1bfd('0x6')](_0x1bfd('0x8'),auth[_0x1bfd('0x7')](),controller[_0x1bfd('0x9')]);router[_0x1bfd('0xa')]('/',auth[_0x1bfd('0x7')](),controller[_0x1bfd('0xb')]);router[_0x1bfd('0xc')](_0x1bfd('0x8'),auth[_0x1bfd('0x7')](),controller[_0x1bfd('0xd')]);router['delete']('/:id',auth[_0x1bfd('0x7')](),controller['destroy']);module[_0x1bfd('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9e1ea0d..d7d041e 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 _0x4b1d=['exports','STRING','name','sequelize'];(function(_0x4563b6,_0x2611c5){var _0xa7e08c=function(_0x1f3604){while(--_0x1f3604){_0x4563b6['push'](_0x4563b6['shift']());}};_0xa7e08c(++_0x2611c5);}(_0x4b1d,0x16b));var _0xd4b1=function(_0x488c24,_0x325c82){_0x488c24=_0x488c24-0x0;var _0x3843e5=_0x4b1d[_0x488c24];return _0x3843e5;};'use strict';var Sequelize=require(_0xd4b1('0x0'));module[_0xd4b1('0x1')]={'name':{'type':Sequelize[_0xd4b1('0x2')],'unique':_0xd4b1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd4b1('0x2')]},'companyId':{'type':Sequelize[_0xd4b1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd4b1('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd4b1('0x2')]},'street':{'type':Sequelize[_0xd4b1('0x2')]},'postalCode':{'type':Sequelize[_0xd4b1('0x2')]},'city':{'type':Sequelize[_0xd4b1('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd4b1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd4b1('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xd4b1('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xd4b1('0x2')]},'description':{'type':Sequelize[_0xd4b1('0x2')]}}; \ No newline at end of file +var _0xc0d2=['STRING','name','exports'];(function(_0x10fc2b,_0x402f7f){var _0x39c8fb=function(_0x44c5ba){while(--_0x44c5ba){_0x10fc2b['push'](_0x10fc2b['shift']());}};_0x39c8fb(++_0x402f7f);}(_0xc0d2,0x98));var _0x2c0d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc0d2[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x2c0d('0x0')]={'name':{'type':Sequelize[_0x2c0d('0x1')],'unique':_0x2c0d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x2c0d('0x1')]},'phone':{'type':Sequelize[_0x2c0d('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2c0d('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2c0d('0x1')]},'city':{'type':Sequelize[_0x2c0d('0x1')]},'country':{'type':Sequelize[_0x2c0d('0x1')]},'email':{'type':Sequelize[_0x2c0d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2c0d('0x1')]},'sStreet':{'type':Sequelize[_0x2c0d('0x1')]},'sPostalCode':{'type':Sequelize[_0x2c0d('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x2c0d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 2f6f265..924224d 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 _0x49d4=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','body','describe','addContacts','CmContact','ids','omit','getContacts','findOne','sort','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','offset','undefined','count','limit','set','reject','update','destroy','then','get','Companies','end','sendStatus','error','stack','name','send','index'];(function(_0x227d6f,_0x337bc8){var _0x5f1c5c=function(_0x5ebe5c){while(--_0x5ebe5c){_0x227d6f['push'](_0x227d6f['shift']());}};_0x5f1c5c(++_0x337bc8);}(_0x49d4,0xd4));var _0x449d=function(_0x5ac4c5,_0x59663f){_0x5ac4c5=_0x5ac4c5-0x0;var _0x35d193=_0x49d4[_0x5ac4c5];return _0x35d193;};'use strict';var emlformat=require(_0x449d('0x0'));var rimraf=require(_0x449d('0x1'));var zipdir=require(_0x449d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x449d('0x3'));var moment=require(_0x449d('0x4'));var BPromise=require(_0x449d('0x5'));var Mustache=require('mustache');var util=require(_0x449d('0x6'));var path=require(_0x449d('0x7'));var sox=require(_0x449d('0x8'));var csv=require(_0x449d('0x9'));var ejs=require(_0x449d('0xa'));var fs=require('fs');var fs_extra=require(_0x449d('0xb'));var _=require(_0x449d('0xc'));var squel=require(_0x449d('0xd'));var crypto=require(_0x449d('0xe'));var jsforce=require(_0x449d('0xf'));var deskjs=require(_0x449d('0x10'));var toCsv=require(_0x449d('0x9'));var querystring=require(_0x449d('0x11'));var Papa=require(_0x449d('0x12'));var Redis=require('ioredis');var authService=require(_0x449d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x449d('0x14'))(_0x449d('0x15'));var utils=require(_0x449d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x449d('0x17'));var db=require(_0x449d('0x18'))['db'];function respondWithStatusCode(_0xf774ee,_0x5b9b4a){_0x5b9b4a=_0x5b9b4a||0xcc;return function(_0x12f647){if(_0x12f647){return _0xf774ee['sendStatus'](_0x5b9b4a);}return _0xf774ee['status'](_0x5b9b4a)['end']();};}function respondWithResult(_0x35991f,_0x41a60f){_0x41a60f=_0x41a60f||0xc8;return function(_0x244898){if(_0x244898){return _0x35991f['status'](_0x41a60f)['json'](_0x244898);}};}function respondWithFilteredResult(_0x32f8c8,_0x1b24c6){return function(_0xd8b2be){if(_0xd8b2be){var _0x66114b=typeof _0x1b24c6[_0x449d('0x19')]==='undefined'&&typeof _0x1b24c6['limit']===_0x449d('0x1a');var _0x3b31b0=_0xd8b2be[_0x449d('0x1b')];var _0x3b0019=_0x66114b?0x0:_0x1b24c6[_0x449d('0x19')];var _0x15a6bc=_0x66114b?_0xd8b2be[_0x449d('0x1b')]:_0x1b24c6[_0x449d('0x19')]+_0x1b24c6[_0x449d('0x1c')];var _0x437862;if(_0x15a6bc>=_0x3b31b0){_0x15a6bc=_0x3b31b0;_0x437862=0xc8;}else{_0x437862=0xce;}_0x32f8c8['status'](_0x437862);return _0x32f8c8[_0x449d('0x1d')]('Content-Range',_0x3b0019+'-'+_0x15a6bc+'/'+_0x3b31b0)['json'](_0xd8b2be);}return null;};}function patchUpdates(_0x50aa8b){return function(_0x16938d){try{jsonpatch['apply'](_0x16938d,_0x50aa8b,!![]);}catch(_0x2843da){return BPromise[_0x449d('0x1e')](_0x2843da);}return _0x16938d['save']();};}function saveUpdates(_0x28f3ff,_0xb7aa84){return function(_0x2f83ea){if(_0x2f83ea){return _0x2f83ea[_0x449d('0x1f')](_0x28f3ff)['then'](function(_0x93a30a){return _0x93a30a;});}return null;};}function removeEntity(_0x26dfe6,_0x2ea83b){return function(_0x55fda9){if(_0x55fda9){return _0x55fda9[_0x449d('0x20')]()[_0x449d('0x21')](function(){var _0x44cb2c=_0x55fda9[_0x449d('0x22')]({'plain':!![]});var _0x5acc1b=_0x449d('0x23');return db['UserProfileResource'][_0x449d('0x20')]({'where':{'type':_0x5acc1b,'resourceId':_0x44cb2c['id']}})[_0x449d('0x21')](function(){return _0x55fda9;});})[_0x449d('0x21')](function(){_0x26dfe6['status'](0xcc)[_0x449d('0x24')]();});}};}function handleEntityNotFound(_0xe86856,_0x45d163){return function(_0x4d58b0){if(!_0x4d58b0){_0xe86856[_0x449d('0x25')](0x194);}return _0x4d58b0;};}function handleError(_0x573263,_0x31c523){_0x31c523=_0x31c523||0x1f4;return function(_0x331476){logger[_0x449d('0x26')](_0x331476[_0x449d('0x27')]);if(_0x331476[_0x449d('0x28')]){delete _0x331476['name'];}_0x573263['status'](_0x31c523)[_0x449d('0x29')](_0x331476);};}exports[_0x449d('0x2a')]=function(_0x114bd5,_0x46c7b0){var _0x2bc420={},_0x5c047d={},_0x49727e={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x449d('0x21')](function(_0x552e52){_0x5c047d[_0x449d('0x2b')]=_[_0x449d('0x2c')](_0x552e52);_0x5c047d[_0x449d('0x2d')]=_[_0x449d('0x2c')](_0x114bd5[_0x449d('0x2d')]);_0x5c047d['filters']=_[_0x449d('0x2e')](_0x5c047d[_0x449d('0x2b')],_0x5c047d[_0x449d('0x2d')]);_0x2bc420['attributes']=_[_0x449d('0x2e')](_0x5c047d['model'],qs['fields'](_0x114bd5[_0x449d('0x2d')][_0x449d('0x2f')]));_0x2bc420[_0x449d('0x30')]=_0x2bc420[_0x449d('0x30')][_0x449d('0x31')]?_0x2bc420['attributes']:_0x5c047d[_0x449d('0x2b')];if(!_0x114bd5['query'][_0x449d('0x32')]('nolimit')){_0x2bc420[_0x449d('0x1c')]=qs[_0x449d('0x1c')](_0x114bd5[_0x449d('0x2d')][_0x449d('0x1c')]);_0x2bc420[_0x449d('0x19')]=qs[_0x449d('0x19')](_0x114bd5[_0x449d('0x2d')][_0x449d('0x19')]);}_0x2bc420[_0x449d('0x33')]=qs['sort'](_0x114bd5[_0x449d('0x2d')]['sort']);_0x2bc420[_0x449d('0x34')]=qs['filters'](_[_0x449d('0x35')](_0x114bd5[_0x449d('0x2d')],_0x5c047d['filters']),_0x552e52);if(_0x114bd5[_0x449d('0x2d')][_0x449d('0x36')]){_0x2bc420[_0x449d('0x34')]=_[_0x449d('0x37')](_0x2bc420[_0x449d('0x34')],{'$or':_[_0x449d('0x38')](_0x2bc420['attributes'],function(_0x5aebf3){var _0x4ada7c={};_0x4ada7c[_0x5aebf3]={'$like':'%'+_0x114bd5[_0x449d('0x2d')][_0x449d('0x36')]+'%'};return _0x4ada7c;})});}_0x2bc420=_[_0x449d('0x37')]({},_0x2bc420,_0x114bd5[_0x449d('0x39')]);var _0x18b97b={'where':_0x2bc420[_0x449d('0x34')]};return db[_0x449d('0x3a')][_0x449d('0x1b')](_0x18b97b)[_0x449d('0x21')](function(_0x31da8d){_0x49727e[_0x449d('0x1b')]=_0x31da8d;if(_0x114bd5[_0x449d('0x2d')][_0x449d('0x3b')]){_0x2bc420['include']=[{'all':!![]}];}return db['CmCompany'][_0x449d('0x3c')](_0x2bc420);})['then'](function(_0x3cbe94){_0x49727e[_0x449d('0x3d')]=_0x3cbe94;return _0x49727e;})[_0x449d('0x21')](respondWithFilteredResult(_0x46c7b0,_0x2bc420))['catch'](handleError(_0x46c7b0,null));})[_0x449d('0x3e')](handleError(_0x46c7b0,null));};exports[_0x449d('0x3f')]=function(_0x2d859d,_0x383377){var _0x4d0326={'raw':![],'where':{'id':_0x2d859d[_0x449d('0x40')]['id']}},_0x329634={};_0x329634['model']=_[_0x449d('0x2c')](db[_0x449d('0x3a')][_0x449d('0x41')]);_0x329634[_0x449d('0x2d')]=_[_0x449d('0x2c')](_0x2d859d[_0x449d('0x2d')]);_0x329634[_0x449d('0x42')]=_[_0x449d('0x2e')](_0x329634[_0x449d('0x2b')],_0x329634[_0x449d('0x2d')]);_0x4d0326[_0x449d('0x30')]=_[_0x449d('0x2e')](_0x329634[_0x449d('0x2b')],qs[_0x449d('0x2f')](_0x2d859d[_0x449d('0x2d')][_0x449d('0x2f')]));_0x4d0326[_0x449d('0x30')]=_0x4d0326[_0x449d('0x30')][_0x449d('0x31')]?_0x4d0326['attributes']:_0x329634['model'];if(_0x2d859d['query'][_0x449d('0x3b')]){_0x4d0326['include']=[{'all':!![]}];}_0x4d0326=_[_0x449d('0x37')]({},_0x4d0326,_0x2d859d[_0x449d('0x39')]);return db['CmCompany'][_0x449d('0x43')](_0x4d0326)['then'](handleEntityNotFound(_0x383377,null))[_0x449d('0x21')](respondWithResult(_0x383377,null))[_0x449d('0x3e')](handleError(_0x383377,null));};exports[_0x449d('0x44')]=function(_0x1cfe25,_0x4e3d19){return db[_0x449d('0x3a')]['create'](_0x1cfe25['body'],{})['then'](function(_0x351f0f){var _0xd32ba2=_0x1cfe25[_0x449d('0x45')]['get']({'plain':!![]});if(!_0xd32ba2)throw new Error(_0x449d('0x46'));if(_0xd32ba2[_0x449d('0x47')]==='user'){var _0x395a45=_0x351f0f[_0x449d('0x22')]({'plain':!![]});var _0x1ff479=_0x449d('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1ff479,'userProfileId':_0xd32ba2[_0x449d('0x48')]},'raw':!![]})['then'](function(_0x13b7d3){if(_0x13b7d3&&_0x13b7d3[_0x449d('0x49')]===0x0){return db[_0x449d('0x4a')]['create']({'name':_0x395a45[_0x449d('0x28')],'resourceId':_0x395a45['id'],'type':_0x13b7d3[_0x449d('0x28')],'sectionId':_0x13b7d3['id']},{})[_0x449d('0x21')](function(){return _0x351f0f;});}else{return _0x351f0f;}})[_0x449d('0x3e')](function(_0x53df7b){logger[_0x449d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53df7b);throw _0x53df7b;});}return _0x351f0f;})[_0x449d('0x21')](respondWithResult(_0x4e3d19,0xc9))['catch'](handleError(_0x4e3d19,null));};exports[_0x449d('0x1f')]=function(_0x3487b3,_0x7ac6c5){if(_0x3487b3['body']['id']){delete _0x3487b3[_0x449d('0x4b')]['id'];}return db[_0x449d('0x3a')][_0x449d('0x43')]({'where':{'id':_0x3487b3['params']['id']}})['then'](handleEntityNotFound(_0x7ac6c5,null))[_0x449d('0x21')](saveUpdates(_0x3487b3[_0x449d('0x4b')],null))[_0x449d('0x21')](respondWithResult(_0x7ac6c5,null))[_0x449d('0x3e')](handleError(_0x7ac6c5,null));};exports['destroy']=function(_0x42bf96,_0x243174){return db[_0x449d('0x3a')][_0x449d('0x43')]({'where':{'id':_0x42bf96[_0x449d('0x40')]['id']}})['then'](handleEntityNotFound(_0x243174,null))[_0x449d('0x21')](removeEntity(_0x243174,null))[_0x449d('0x3e')](handleError(_0x243174,null));};exports[_0x449d('0x4c')]=function(_0x30843f,_0x20c332){return db[_0x449d('0x3a')][_0x449d('0x4c')]()[_0x449d('0x21')](respondWithResult(_0x20c332,null))['catch'](handleError(_0x20c332,null));};exports[_0x449d('0x4d')]=function(_0x3da31b,_0x56a585,_0x5096ad){return db[_0x449d('0x4e')]['find']({'where':{'id':_0x3da31b[_0x449d('0x40')]['id']}})[_0x449d('0x21')](handleEntityNotFound(_0x56a585,null))['then'](function(_0x5f066d){if(_0x5f066d){return _0x5f066d[_0x449d('0x4d')](_0x3da31b[_0x449d('0x4b')][_0x449d('0x4f')],_[_0x449d('0x50')](_0x3da31b[_0x449d('0x4b')],[_0x449d('0x4f'),'id'])||{});}})[_0x449d('0x21')](respondWithResult(_0x56a585,null))[_0x449d('0x3e')](handleError(_0x56a585,null));};exports[_0x449d('0x51')]=function(_0x39a790,_0x45352f,_0x1e62cd){var _0x5f2a59={};var _0x3ee42b={};var _0x325b67;var _0x548165;return db['CmCompany'][_0x449d('0x52')]({'where':{'id':_0x39a790[_0x449d('0x40')]['id']}})[_0x449d('0x21')](handleEntityNotFound(_0x45352f,null))[_0x449d('0x21')](function(_0x527fcf){if(_0x527fcf){_0x325b67=_0x527fcf;_0x3ee42b[_0x449d('0x2b')]=_[_0x449d('0x2c')](db[_0x449d('0x4e')][_0x449d('0x41')]);_0x3ee42b[_0x449d('0x2d')]=_['keys'](_0x39a790[_0x449d('0x2d')]);_0x3ee42b[_0x449d('0x42')]=_['intersection'](_0x3ee42b[_0x449d('0x2b')],_0x3ee42b[_0x449d('0x2d')]);_0x5f2a59[_0x449d('0x30')]=_['intersection'](_0x3ee42b['model'],qs['fields'](_0x39a790[_0x449d('0x2d')][_0x449d('0x2f')]));_0x5f2a59[_0x449d('0x30')]=_0x5f2a59[_0x449d('0x30')][_0x449d('0x31')]?_0x5f2a59[_0x449d('0x30')]:_0x3ee42b[_0x449d('0x2b')];_0x5f2a59[_0x449d('0x33')]=qs[_0x449d('0x53')](_0x39a790['query'][_0x449d('0x53')]);_0x5f2a59[_0x449d('0x34')]=qs[_0x449d('0x42')](_['pick'](_0x39a790[_0x449d('0x2d')],_0x3ee42b[_0x449d('0x42')]));if(_0x39a790[_0x449d('0x2d')][_0x449d('0x36')]){_0x5f2a59['where']=_[_0x449d('0x37')](_0x5f2a59[_0x449d('0x34')],{'$or':_[_0x449d('0x38')](_0x5f2a59[_0x449d('0x30')],function(_0x1e8938){var _0x4e7dd1={};_0x4e7dd1[_0x1e8938]={'$like':'%'+_0x39a790[_0x449d('0x2d')]['filter']+'%'};return _0x4e7dd1;})});}_0x5f2a59=_[_0x449d('0x37')]({},_0x5f2a59,_0x39a790[_0x449d('0x39')]);return _0x325b67[_0x449d('0x51')](_0x5f2a59);}})[_0x449d('0x21')](function(_0x2e20df){if(_0x2e20df){_0x548165=_0x2e20df[_0x449d('0x31')];if(!_0x39a790[_0x449d('0x2d')][_0x449d('0x32')](_0x449d('0x54'))){_0x5f2a59[_0x449d('0x1c')]=qs[_0x449d('0x1c')](_0x39a790[_0x449d('0x2d')][_0x449d('0x1c')]);_0x5f2a59[_0x449d('0x19')]=qs[_0x449d('0x19')](_0x39a790['query'][_0x449d('0x19')]);}return _0x325b67[_0x449d('0x51')](_0x5f2a59);}})[_0x449d('0x21')](function(_0x2c0e4c){if(_0x2c0e4c){return _0x2c0e4c?{'count':_0x548165,'rows':_0x2c0e4c}:null;}})[_0x449d('0x21')](respondWithResult(_0x45352f,null))[_0x449d('0x3e')](handleError(_0x45352f,null));}; \ No newline at end of file +var _0xd30f=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','ids','omit','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd30f,0x65));var _0xfd30=function(_0x4fa728,_0x20209b){_0x4fa728=_0x4fa728-0x0;var _0x2b3a76=_0xd30f[_0x4fa728];return _0x2b3a76;};'use strict';var emlformat=require(_0xfd30('0x0'));var rimraf=require(_0xfd30('0x1'));var zipdir=require(_0xfd30('0x2'));var jsonpatch=require(_0xfd30('0x3'));var rp=require('request-promise');var moment=require(_0xfd30('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd30('0x5'));var path=require('path');var sox=require(_0xfd30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd30('0x7'));var _=require(_0xfd30('0x8'));var squel=require(_0xfd30('0x9'));var crypto=require('crypto');var jsforce=require(_0xfd30('0xa'));var deskjs=require(_0xfd30('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfd30('0xc'));var Papa=require('papaparse');var Redis=require(_0xfd30('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xfd30('0xe'));var as=require(_0xfd30('0xf'));var hardwareService=require(_0xfd30('0x10'));var logger=require(_0xfd30('0x11'))(_0xfd30('0x12'));var utils=require(_0xfd30('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfd30('0x14'));var db=require(_0xfd30('0x15'))['db'];function respondWithStatusCode(_0x48f35c,_0x3760ad){_0x3760ad=_0x3760ad||0xcc;return function(_0x2f3210){if(_0x2f3210){return _0x48f35c[_0xfd30('0x16')](_0x3760ad);}return _0x48f35c[_0xfd30('0x17')](_0x3760ad)[_0xfd30('0x18')]();};}function respondWithResult(_0x3444f9,_0x14f4c1){_0x14f4c1=_0x14f4c1||0xc8;return function(_0x4dd0a6){if(_0x4dd0a6){return _0x3444f9['status'](_0x14f4c1)[_0xfd30('0x19')](_0x4dd0a6);}};}function respondWithFilteredResult(_0x187da3,_0x5d846b){return function(_0x17a9b3){if(_0x17a9b3){var _0x472e8f=typeof _0x5d846b[_0xfd30('0x1a')]==='undefined'&&typeof _0x5d846b[_0xfd30('0x1b')]==='undefined';var _0xf4bef1=_0x17a9b3['count'];var _0x32013b=_0x472e8f?0x0:_0x5d846b[_0xfd30('0x1a')];var _0x218914=_0x472e8f?_0x17a9b3[_0xfd30('0x1c')]:_0x5d846b[_0xfd30('0x1a')]+_0x5d846b['limit'];var _0x69b95a;if(_0x218914>=_0xf4bef1){_0x218914=_0xf4bef1;_0x69b95a=0xc8;}else{_0x69b95a=0xce;}_0x187da3['status'](_0x69b95a);return _0x187da3['set'](_0xfd30('0x1d'),_0x32013b+'-'+_0x218914+'/'+_0xf4bef1)[_0xfd30('0x19')](_0x17a9b3);}return null;};}function patchUpdates(_0x596a27){return function(_0x3d3422){try{jsonpatch['apply'](_0x3d3422,_0x596a27,!![]);}catch(_0x979fc9){return BPromise[_0xfd30('0x1e')](_0x979fc9);}return _0x3d3422[_0xfd30('0x1f')]();};}function saveUpdates(_0x1f3896,_0x249990){return function(_0x5acf23){if(_0x5acf23){return _0x5acf23[_0xfd30('0x20')](_0x1f3896)[_0xfd30('0x21')](function(_0x548e56){return _0x548e56;});}return null;};}function removeEntity(_0x21e516,_0x43b289){return function(_0x5238a5){if(_0x5238a5){return _0x5238a5['destroy']()[_0xfd30('0x21')](function(){var _0x5d125e=_0x5238a5[_0xfd30('0x22')]({'plain':!![]});var _0x230d38='Companies';return db[_0xfd30('0x23')]['destroy']({'where':{'type':_0x230d38,'resourceId':_0x5d125e['id']}})[_0xfd30('0x21')](function(){return _0x5238a5;});})[_0xfd30('0x21')](function(){_0x21e516[_0xfd30('0x17')](0xcc)[_0xfd30('0x18')]();});}};}function handleEntityNotFound(_0x56988e,_0x4885d2){return function(_0x23f3e2){if(!_0x23f3e2){_0x56988e[_0xfd30('0x16')](0x194);}return _0x23f3e2;};}function handleError(_0x8007a3,_0x5c360e){_0x5c360e=_0x5c360e||0x1f4;return function(_0xdbf5a0){logger['error'](_0xdbf5a0[_0xfd30('0x24')]);if(_0xdbf5a0[_0xfd30('0x25')]){delete _0xdbf5a0[_0xfd30('0x25')];}_0x8007a3[_0xfd30('0x17')](_0x5c360e)[_0xfd30('0x26')](_0xdbf5a0);};}exports['index']=function(_0x1b5a2c,_0x5f1871){var _0x4ff295={},_0x4660e7={},_0x335447={'count':0x0,'rows':[]};return db[_0xfd30('0x27')][_0xfd30('0x28')]()[_0xfd30('0x21')](function(_0xc6ca7){_0x4660e7['model']=_[_0xfd30('0x29')](_0xc6ca7);_0x4660e7[_0xfd30('0x2a')]=_[_0xfd30('0x29')](_0x1b5a2c['query']);_0x4660e7[_0xfd30('0x2b')]=_[_0xfd30('0x2c')](_0x4660e7[_0xfd30('0x2d')],_0x4660e7[_0xfd30('0x2a')]);_0x4ff295[_0xfd30('0x2e')]=_[_0xfd30('0x2c')](_0x4660e7[_0xfd30('0x2d')],qs['fields'](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x2f')]));_0x4ff295[_0xfd30('0x2e')]=_0x4ff295[_0xfd30('0x2e')][_0xfd30('0x30')]?_0x4ff295['attributes']:_0x4660e7[_0xfd30('0x2d')];if(!_0x1b5a2c['query'][_0xfd30('0x31')](_0xfd30('0x32'))){_0x4ff295[_0xfd30('0x1b')]=qs[_0xfd30('0x1b')](_0x1b5a2c[_0xfd30('0x2a')]['limit']);_0x4ff295[_0xfd30('0x1a')]=qs[_0xfd30('0x1a')](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x1a')]);}_0x4ff295[_0xfd30('0x33')]=qs[_0xfd30('0x34')](_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x34')]);_0x4ff295[_0xfd30('0x35')]=qs[_0xfd30('0x2b')](_[_0xfd30('0x36')](_0x1b5a2c['query'],_0x4660e7['filters']),_0xc6ca7);if(_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x37')]){_0x4ff295[_0xfd30('0x35')]=_[_0xfd30('0x38')](_0x4ff295[_0xfd30('0x35')],{'$or':_[_0xfd30('0x39')](_0x4ff295[_0xfd30('0x2e')],function(_0x2cb3a8){var _0x2194d6={};_0x2194d6[_0x2cb3a8]={'$like':'%'+_0x1b5a2c[_0xfd30('0x2a')][_0xfd30('0x37')]+'%'};return _0x2194d6;})});}_0x4ff295=_['merge']({},_0x4ff295,_0x1b5a2c[_0xfd30('0x3a')]);var _0x4518fc={'where':_0x4ff295[_0xfd30('0x35')]};return db[_0xfd30('0x27')][_0xfd30('0x1c')](_0x4518fc)[_0xfd30('0x21')](function(_0x57b9d7){_0x335447['count']=_0x57b9d7;if(_0x1b5a2c['query'][_0xfd30('0x3b')]){_0x4ff295[_0xfd30('0x3c')]=[{'all':!![]}];}return db[_0xfd30('0x27')][_0xfd30('0x3d')](_0x4ff295);})[_0xfd30('0x21')](function(_0x18a760){_0x335447[_0xfd30('0x3e')]=_0x18a760;return _0x335447;})[_0xfd30('0x21')](respondWithFilteredResult(_0x5f1871,_0x4ff295))[_0xfd30('0x3f')](handleError(_0x5f1871,null));})[_0xfd30('0x3f')](handleError(_0x5f1871,null));};exports[_0xfd30('0x40')]=function(_0x38e03a,_0x27667d){var _0x4d4332={'raw':![],'where':{'id':_0x38e03a[_0xfd30('0x41')]['id']}},_0x3db80e={};_0x3db80e[_0xfd30('0x2d')]=_['keys'](db['CmCompany'][_0xfd30('0x42')]);_0x3db80e['query']=_['keys'](_0x38e03a[_0xfd30('0x2a')]);_0x3db80e[_0xfd30('0x2b')]=_['intersection'](_0x3db80e[_0xfd30('0x2d')],_0x3db80e[_0xfd30('0x2a')]);_0x4d4332[_0xfd30('0x2e')]=_['intersection'](_0x3db80e['model'],qs['fields'](_0x38e03a[_0xfd30('0x2a')]['fields']));_0x4d4332['attributes']=_0x4d4332['attributes'][_0xfd30('0x30')]?_0x4d4332['attributes']:_0x3db80e[_0xfd30('0x2d')];if(_0x38e03a['query'][_0xfd30('0x3b')]){_0x4d4332[_0xfd30('0x3c')]=[{'all':!![]}];}_0x4d4332=_[_0xfd30('0x38')]({},_0x4d4332,_0x38e03a['options']);return db[_0xfd30('0x27')]['find'](_0x4d4332)[_0xfd30('0x21')](handleEntityNotFound(_0x27667d,null))[_0xfd30('0x21')](respondWithResult(_0x27667d,null))[_0xfd30('0x3f')](handleError(_0x27667d,null));};exports[_0xfd30('0x43')]=function(_0x4a739a,_0x7dc377){return db[_0xfd30('0x27')]['create'](_0x4a739a[_0xfd30('0x44')],{})[_0xfd30('0x21')](function(_0x4a50d8){var _0x2f6958=_0x4a739a[_0xfd30('0x45')][_0xfd30('0x22')]({'plain':!![]});if(!_0x2f6958)throw new Error(_0xfd30('0x46'));if(_0x2f6958[_0xfd30('0x47')]===_0xfd30('0x45')){var _0x27c33e=_0x4a50d8[_0xfd30('0x22')]({'plain':!![]});var _0x3a1522='Companies';return db[_0xfd30('0x48')][_0xfd30('0x49')]({'where':{'name':_0x3a1522,'userProfileId':_0x2f6958[_0xfd30('0x4a')]},'raw':!![]})[_0xfd30('0x21')](function(_0x3956ac){if(_0x3956ac&&_0x3956ac[_0xfd30('0x4b')]===0x0){return db[_0xfd30('0x23')][_0xfd30('0x43')]({'name':_0x27c33e[_0xfd30('0x25')],'resourceId':_0x27c33e['id'],'type':_0x3956ac['name'],'sectionId':_0x3956ac['id']},{})[_0xfd30('0x21')](function(){return _0x4a50d8;});}else{return _0x4a50d8;}})[_0xfd30('0x3f')](function(_0x2f9727){logger[_0xfd30('0x4c')](_0xfd30('0x4d'),_0x2f9727);throw _0x2f9727;});}return _0x4a50d8;})['then'](respondWithResult(_0x7dc377,0xc9))[_0xfd30('0x3f')](handleError(_0x7dc377,null));};exports[_0xfd30('0x20')]=function(_0xbed1,_0x2bc154){if(_0xbed1[_0xfd30('0x44')]['id']){delete _0xbed1[_0xfd30('0x44')]['id'];}return db[_0xfd30('0x27')][_0xfd30('0x49')]({'where':{'id':_0xbed1[_0xfd30('0x41')]['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x2bc154,null))[_0xfd30('0x21')](saveUpdates(_0xbed1[_0xfd30('0x44')],null))[_0xfd30('0x21')](respondWithResult(_0x2bc154,null))[_0xfd30('0x3f')](handleError(_0x2bc154,null));};exports[_0xfd30('0x4e')]=function(_0xcef918,_0x5eb256){return db[_0xfd30('0x27')][_0xfd30('0x49')]({'where':{'id':_0xcef918[_0xfd30('0x41')]['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x5eb256,null))['then'](removeEntity(_0x5eb256,null))['catch'](handleError(_0x5eb256,null));};exports[_0xfd30('0x28')]=function(_0x7c48ea,_0x3bd4a1){return db[_0xfd30('0x27')][_0xfd30('0x28')]()['then'](respondWithResult(_0x3bd4a1,null))[_0xfd30('0x3f')](handleError(_0x3bd4a1,null));};exports[_0xfd30('0x4f')]=function(_0x536a81,_0x58d7bc,_0x598c91){return db['CmContact'][_0xfd30('0x49')]({'where':{'id':_0x536a81['params']['id']}})[_0xfd30('0x21')](handleEntityNotFound(_0x58d7bc,null))[_0xfd30('0x21')](function(_0x83a83b){if(_0x83a83b){return _0x83a83b[_0xfd30('0x4f')](_0x536a81[_0xfd30('0x44')][_0xfd30('0x50')],_[_0xfd30('0x51')](_0x536a81[_0xfd30('0x44')],['ids','id'])||{});}})[_0xfd30('0x21')](respondWithResult(_0x58d7bc,null))[_0xfd30('0x3f')](handleError(_0x58d7bc,null));};exports[_0xfd30('0x52')]=function(_0x1ddfc1,_0x420782,_0x352f5d){var _0x35372d={};var _0x1843a1={};var _0x4c218b;var _0x55de50;return db[_0xfd30('0x27')][_0xfd30('0x53')]({'where':{'id':_0x1ddfc1['params']['id']}})['then'](handleEntityNotFound(_0x420782,null))[_0xfd30('0x21')](function(_0x20831b){if(_0x20831b){_0x4c218b=_0x20831b;_0x1843a1[_0xfd30('0x2d')]=_['keys'](db[_0xfd30('0x54')][_0xfd30('0x42')]);_0x1843a1[_0xfd30('0x2a')]=_[_0xfd30('0x29')](_0x1ddfc1[_0xfd30('0x2a')]);_0x1843a1[_0xfd30('0x2b')]=_['intersection'](_0x1843a1[_0xfd30('0x2d')],_0x1843a1[_0xfd30('0x2a')]);_0x35372d['attributes']=_['intersection'](_0x1843a1[_0xfd30('0x2d')],qs[_0xfd30('0x2f')](_0x1ddfc1['query'][_0xfd30('0x2f')]));_0x35372d[_0xfd30('0x2e')]=_0x35372d[_0xfd30('0x2e')]['length']?_0x35372d[_0xfd30('0x2e')]:_0x1843a1[_0xfd30('0x2d')];_0x35372d['order']=qs[_0xfd30('0x34')](_0x1ddfc1[_0xfd30('0x2a')][_0xfd30('0x34')]);_0x35372d[_0xfd30('0x35')]=qs[_0xfd30('0x2b')](_[_0xfd30('0x36')](_0x1ddfc1[_0xfd30('0x2a')],_0x1843a1['filters']));if(_0x1ddfc1[_0xfd30('0x2a')]['filter']){_0x35372d[_0xfd30('0x35')]=_[_0xfd30('0x38')](_0x35372d['where'],{'$or':_[_0xfd30('0x39')](_0x35372d['attributes'],function(_0x240ce1){var _0x4896e8={};_0x4896e8[_0x240ce1]={'$like':'%'+_0x1ddfc1['query'][_0xfd30('0x37')]+'%'};return _0x4896e8;})});}_0x35372d=_[_0xfd30('0x38')]({},_0x35372d,_0x1ddfc1[_0xfd30('0x3a')]);return _0x4c218b[_0xfd30('0x52')](_0x35372d);}})[_0xfd30('0x21')](function(_0x363c3f){if(_0x363c3f){_0x55de50=_0x363c3f[_0xfd30('0x30')];if(!_0x1ddfc1[_0xfd30('0x2a')]['hasOwnProperty'](_0xfd30('0x32'))){_0x35372d[_0xfd30('0x1b')]=qs['limit'](_0x1ddfc1[_0xfd30('0x2a')][_0xfd30('0x1b')]);_0x35372d[_0xfd30('0x1a')]=qs['offset'](_0x1ddfc1[_0xfd30('0x2a')]['offset']);}return _0x4c218b[_0xfd30('0x52')](_0x35372d);}})['then'](function(_0x5b33d4){if(_0x5b33d4){return _0x5b33d4?{'count':_0x55de50,'rows':_0x5b33d4}:null;}})[_0xfd30('0x21')](respondWithResult(_0x420782,null))['catch'](handleError(_0x420782,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index c688322..c7bc926 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 _0xc172=['request-promise','../../config/environment','./cmCompany.attributes','exports','define','../../config/logger','moment'];(function(_0x566c3a,_0x52ca48){var _0x39b298=function(_0x319185){while(--_0x319185){_0x566c3a['push'](_0x566c3a['shift']());}};_0x39b298(++_0x52ca48);}(_0xc172,0xe5));var _0x2c17=function(_0x5e0bd4,_0x2a97c0){_0x5e0bd4=_0x5e0bd4-0x0;var _0x515113=_0xc172[_0x5e0bd4];return _0x515113;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c17('0x0'))('api');var moment=require(_0x2c17('0x1'));var BPromise=require('bluebird');var rp=require(_0x2c17('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c17('0x3'));var attributes=require(_0x2c17('0x4'));module[_0x2c17('0x5')]=function(_0xd15b3e,_0x496312){return _0xd15b3e[_0x2c17('0x6')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e3f=['bluebird','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','moment'];(function(_0x25ab76,_0x596eae){var _0x235145=function(_0xfe005b){while(--_0xfe005b){_0x25ab76['push'](_0x25ab76['shift']());}};_0x235145(++_0x596eae);}(_0x5e3f,0x16f));var _0xf5e3=function(_0x309251,_0x5a6279){_0x309251=_0x309251-0x0;var _0x21426a=_0x5e3f[_0x309251];return _0x21426a;};'use strict';var _=require(_0xf5e3('0x0'));var util=require(_0xf5e3('0x1'));var logger=require(_0xf5e3('0x2'))(_0xf5e3('0x3'));var moment=require(_0xf5e3('0x4'));var BPromise=require(_0xf5e3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5e3('0x6'));var rimraf=require('rimraf');var config=require(_0xf5e3('0x7'));var attributes=require(_0xf5e3('0x8'));module[_0xf5e3('0x9')]=function(_0x202d67,_0x3186a6){return _0x202d67[_0xf5e3('0xa')](_0xf5e3('0xb'),attributes,{'tableName':'cm_companies','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 ae822c4..dd95ea5 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 _0xba9f=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x22df4d,_0xa4790a){var _0x6a2020=function(_0x215c88){while(--_0x215c88){_0x22df4d['push'](_0x22df4d['shift']());}};_0x6a2020(++_0xa4790a);}(_0xba9f,0x1ca));var _0xfba9=function(_0x50b2f1,_0x51d38e){_0x50b2f1=_0x50b2f1-0x0;var _0x1fca47=_0xba9f[_0x50b2f1];return _0x1fca47;};'use strict';var _=require(_0xfba9('0x0'));var util=require(_0xfba9('0x1'));var moment=require(_0xfba9('0x2'));var BPromise=require(_0xfba9('0x3'));var rs=require(_0xfba9('0x4'));var fs=require('fs');var Redis=require(_0xfba9('0x5'));var db=require(_0xfba9('0x6'))['db'];var utils=require(_0xfba9('0x7'));var logger=require(_0xfba9('0x8'))(_0xfba9('0x9'));var config=require(_0xfba9('0xa'));var jayson=require(_0xfba9('0xb'));var client=jayson[_0xfba9('0xc')][_0xfba9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2c9fef,_0x4b57a3,_0x465a06){return new BPromise(function(_0x5b380e,_0x220a79){return client[_0xfba9('0xe')](_0x2c9fef,_0x465a06)[_0xfba9('0xf')](function(_0x460316){logger[_0xfba9('0x10')](_0xfba9('0x11'),_0x4b57a3,_0xfba9('0x12'));logger[_0xfba9('0x13')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4b57a3,_0xfba9('0x12'),JSON[_0xfba9('0x14')](_0x460316));if(_0x460316[_0xfba9('0x15')]){if(_0x460316[_0xfba9('0x15')][_0xfba9('0x16')]===0x1f4){logger[_0xfba9('0x15')](_0xfba9('0x11'),_0x4b57a3,_0x460316[_0xfba9('0x15')][_0xfba9('0x17')]);return _0x220a79(_0x460316[_0xfba9('0x15')]['message']);}logger['error'](_0xfba9('0x11'),_0x4b57a3,_0x460316[_0xfba9('0x15')]['message']);return _0x5b380e(_0x460316['error'][_0xfba9('0x17')]);}else{logger[_0xfba9('0x10')](_0xfba9('0x11'),_0x4b57a3,'request\x20sent');_0x5b380e(_0x460316[_0xfba9('0x18')][_0xfba9('0x17')]);}})['catch'](function(_0x1516b0){logger[_0xfba9('0x15')]('CmCompany,\x20%s,\x20%s',_0x4b57a3,_0x1516b0);_0x220a79(_0x1516b0);});});} \ No newline at end of file +var _0xd963=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd963,0x1e7));var _0x3d96=function(_0x6f2ce5,_0x4231eb){_0x6f2ce5=_0x6f2ce5-0x0;var _0x28a54a=_0xd963[_0x6f2ce5];return _0x28a54a;};'use strict';var _=require('lodash');var util=require(_0x3d96('0x0'));var moment=require(_0x3d96('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d96('0x2'));var fs=require('fs');var Redis=require(_0x3d96('0x3'));var db=require(_0x3d96('0x4'))['db'];var utils=require(_0x3d96('0x5'));var logger=require('../../config/logger')(_0x3d96('0x6'));var config=require(_0x3d96('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3d96('0x8')][_0x3d96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a440f,_0x421a2e,_0x23a682){return new BPromise(function(_0x2446b6,_0x5b3004){return client[_0x3d96('0xa')](_0x5a440f,_0x23a682)[_0x3d96('0xb')](function(_0x221871){logger[_0x3d96('0xc')](_0x3d96('0xd'),_0x421a2e,'request\x20sent');logger[_0x3d96('0xe')](_0x3d96('0xf'),_0x421a2e,'request\x20sent',JSON[_0x3d96('0x10')](_0x221871));if(_0x221871['error']){if(_0x221871[_0x3d96('0x11')][_0x3d96('0x12')]===0x1f4){logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x221871[_0x3d96('0x11')]['message']);return _0x5b3004(_0x221871['error']['message']);}logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x221871[_0x3d96('0x11')][_0x3d96('0x13')]);return _0x2446b6(_0x221871[_0x3d96('0x11')][_0x3d96('0x13')]);}else{logger['info'](_0x3d96('0xd'),_0x421a2e,'request\x20sent');_0x2446b6(_0x221871[_0x3d96('0x14')][_0x3d96('0x13')]);}})[_0x3d96('0x15')](function(_0x3e4649){logger[_0x3d96('0x11')](_0x3d96('0xd'),_0x421a2e,_0x3e4649);_0x5b3004(_0x3e4649);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 5711eb9..2a05de0 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 _0xb037=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','create','post','update','delete','destroy','exports','connect-timeout'];(function(_0x4ee837,_0x4a454d){var _0xae1883=function(_0x57da8a){while(--_0x57da8a){_0x4ee837['push'](_0x4ee837['shift']());}};_0xae1883(++_0x4a454d);}(_0xb037,0x1da));var _0x7b03=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb037[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7b03('0x0'));var express=require(_0x7b03('0x1'));var router=express['Router']();var fs_extra=require(_0x7b03('0x2'));var auth=require(_0x7b03('0x3'));var interaction=require(_0x7b03('0x4'));var config=require(_0x7b03('0x5'));var controller=require('./cmCompany.controller');router[_0x7b03('0x6')]('/',auth[_0x7b03('0x7')](),controller[_0x7b03('0x8')]);router[_0x7b03('0x6')]('/describe',auth[_0x7b03('0x7')](),controller['describe']);router[_0x7b03('0x6')](_0x7b03('0x9'),auth[_0x7b03('0x7')](),controller[_0x7b03('0xa')]);router['get'](_0x7b03('0xb'),auth['isAuthenticated'](),controller[_0x7b03('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b03('0xd')]);router[_0x7b03('0xe')](_0x7b03('0xb'),auth[_0x7b03('0x7')](),controller['addContacts']);router['put'](_0x7b03('0x9'),auth['isAuthenticated'](),controller[_0x7b03('0xf')]);router[_0x7b03('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7b03('0x11')]);module[_0x7b03('0x12')]=router; \ No newline at end of file +var _0x4fcf=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','/describe','/:id','isAuthenticated','show','create','post','/:id/contacts','addContacts','put','update','exports','multer'];(function(_0x528dd1,_0xf7301c){var _0x553215=function(_0x5845b3){while(--_0x5845b3){_0x528dd1['push'](_0x528dd1['shift']());}};_0x553215(++_0xf7301c);}(_0x4fcf,0x83));var _0xf4fc=function(_0x49536b,_0x2abe5d){_0x49536b=_0x49536b-0x0;var _0x30de59=_0x4fcf[_0x49536b];return _0x30de59;};'use strict';var multer=require(_0xf4fc('0x0'));var util=require(_0xf4fc('0x1'));var path=require(_0xf4fc('0x2'));var timeout=require(_0xf4fc('0x3'));var express=require(_0xf4fc('0x4'));var router=express['Router']();var fs_extra=require(_0xf4fc('0x5'));var auth=require(_0xf4fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf4fc('0x7'));var controller=require(_0xf4fc('0x8'));router[_0xf4fc('0x9')]('/',auth['isAuthenticated'](),controller[_0xf4fc('0xa')]);router[_0xf4fc('0x9')](_0xf4fc('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf4fc('0x9')](_0xf4fc('0xc'),auth[_0xf4fc('0xd')](),controller[_0xf4fc('0xe')]);router[_0xf4fc('0x9')]('/:id/contacts',auth[_0xf4fc('0xd')](),controller['getContacts']);router['post']('/',auth[_0xf4fc('0xd')](),controller[_0xf4fc('0xf')]);router[_0xf4fc('0x10')](_0xf4fc('0x11'),auth[_0xf4fc('0xd')](),controller[_0xf4fc('0x12')]);router[_0xf4fc('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xf4fc('0x14')]);router['delete']('/:id',auth[_0xf4fc('0xd')](),controller['destroy']);module[_0xf4fc('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 31d5da0..3850007 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 _0x9ee5=['DATE','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x9ee5,0xef));var _0x59ee=function(_0x56b891,_0x1c87cd){_0x56b891=_0x56b891-0x0;var _0x4b5e31=_0x9ee5[_0x56b891];return _0x4b5e31;};'use strict';var _=require('lodash');var Sequelize=require(_0x59ee('0x0'));module[_0x59ee('0x1')]={'firstName':{'type':Sequelize[_0x59ee('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x59ee('0x2')]},'postalCode':{'type':Sequelize[_0x59ee('0x2')]},'city':{'type':Sequelize[_0x59ee('0x2')]},'country':{'type':Sequelize[_0x59ee('0x2')]},'dateOfBirth':{'type':Sequelize[_0x59ee('0x2')]},'description':{'type':Sequelize[_0x59ee('0x3')]},'phone':{'type':Sequelize[_0x59ee('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x59ee('0x2')]},'email':{'type':Sequelize[_0x59ee('0x2')]},'url':{'type':Sequelize[_0x59ee('0x2')]},'facebook':{'type':Sequelize[_0x59ee('0x2')]},'fb_data':{'type':Sequelize[_0x59ee('0x2')]},'twitter':{'type':Sequelize[_0x59ee('0x2')]},'skype':{'type':Sequelize[_0x59ee('0x2')]},'teams':{'type':Sequelize[_0x59ee('0x2')]},'viber':{'type':Sequelize[_0x59ee('0x2')]},'line':{'type':Sequelize[_0x59ee('0x2')]},'wechat':{'type':Sequelize[_0x59ee('0x2')]},'telegram':{'type':Sequelize[_0x59ee('0x2')]},'UserId':{'type':Sequelize[_0x59ee('0x4')]},'priority':{'type':Sequelize[_0x59ee('0x4')](0x2)[_0x59ee('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x59ee('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb328=['TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING'];(function(_0x5798ac,_0x8edc6c){var _0x25d0e2=function(_0x3d8149){while(--_0x3d8149){_0x5798ac['push'](_0x5798ac['shift']());}};_0x25d0e2(++_0x8edc6c);}(_0xb328,0x16c));var _0x8b32=function(_0xe3f2b3,_0x26f253){_0xe3f2b3=_0xe3f2b3-0x0;var _0x19fbfa=_0xb328[_0xe3f2b3];return _0x19fbfa;};'use strict';var _=require(_0x8b32('0x0'));var Sequelize=require(_0x8b32('0x1'));module[_0x8b32('0x2')]={'firstName':{'type':Sequelize[_0x8b32('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8b32('0x3')]},'street':{'type':Sequelize[_0x8b32('0x3')]},'postalCode':{'type':Sequelize[_0x8b32('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8b32('0x3')]},'description':{'type':Sequelize[_0x8b32('0x4')]},'phone':{'type':Sequelize[_0x8b32('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8b32('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x8b32('0x3')]},'fb_data':{'type':Sequelize[_0x8b32('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8b32('0x3')]},'teams':{'type':Sequelize[_0x8b32('0x3')]},'viber':{'type':Sequelize[_0x8b32('0x3')]},'line':{'type':Sequelize[_0x8b32('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x8b32('0x3')]},'UserId':{'type':Sequelize[_0x8b32('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8b32('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8b32('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index af499d8..12eb798 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 _0xdae0=['child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','file','parse','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','chat','openchannel','fax','whatsapp','-createdAt','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','startCase','Website','Account','closed','disposition','secondDisposition','key','Owner','push','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','mail','subject','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','trimStart','all','length','fieldType','type','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','where','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','search','parseSearch','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','datetime','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','destroy','catch','tags','columnName','displayName','findAll','alias','custom','values','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','error','show','$and','omit','format','cf_%d','table','setFields','id\x20=\x20?','phone','findOne','params','rawAttributes','sort','pick','getTags','setTags','ids','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','0777'];(function(_0x3012dd,_0x279e35){var _0x10db1f=function(_0x5bc69f){while(--_0x5bc69f){_0x3012dd['push'](_0x3012dd['shift']());}};_0x10db1f(++_0x279e35);}(_0xdae0,0x173));var _0x0dae=function(_0x8e3e81,_0x243ca2){_0x8e3e81=_0x8e3e81-0x0;var _0x4438d7=_0xdae0[_0x8e3e81];return _0x4438d7;};'use strict';var emlformat=require(_0x0dae('0x0'));var rimraf=require(_0x0dae('0x1'));var zipdir=require(_0x0dae('0x2'));var jsonpatch=require(_0x0dae('0x3'));var rp=require(_0x0dae('0x4'));var moment=require(_0x0dae('0x5'));var BPromise=require(_0x0dae('0x6'));var Mustache=require(_0x0dae('0x7'));var util=require(_0x0dae('0x8'));var path=require(_0x0dae('0x9'));var sox=require(_0x0dae('0xa'));var csv=require(_0x0dae('0xb'));var ejs=require(_0x0dae('0xc'));var fs=require('fs');var fs_extra=require(_0x0dae('0xd'));var _=require(_0x0dae('0xe'));var squel=require(_0x0dae('0xf'));var crypto=require(_0x0dae('0x10'));var jsforce=require(_0x0dae('0x11'));var deskjs=require(_0x0dae('0x12'));var toCsv=require(_0x0dae('0xb'));var querystring=require(_0x0dae('0x13'));var Papa=require(_0x0dae('0x14'));var Redis=require(_0x0dae('0x15'));var authService=require(_0x0dae('0x16'));var qs=require(_0x0dae('0x17'));var as=require(_0x0dae('0x18'));var hardwareService=require(_0x0dae('0x19'));var logger=require('../../config/logger')(_0x0dae('0x1a'));var utils=require(_0x0dae('0x1b'));var config=require(_0x0dae('0x1c'));var licenseUtil=require(_0x0dae('0x1d'));var db=require('../../mysqldb')['db'];config[_0x0dae('0x1e')]=_[_0x0dae('0x1f')](config['redis'],{'host':_0x0dae('0x20'),'port':0x18eb});var socket=require(_0x0dae('0x21'))(new Redis(config[_0x0dae('0x1e')]));require(_0x0dae('0x22'))[_0x0dae('0x23')](socket);function respondWithStatusCode(_0x5da630,_0x2eb866){_0x2eb866=_0x2eb866||0xcc;return function(_0x4d4932){if(_0x4d4932){return _0x5da630[_0x0dae('0x24')](_0x2eb866);}return _0x5da630[_0x0dae('0x25')](_0x2eb866)[_0x0dae('0x26')]();};}function respondWithResult(_0x1ac724,_0x256ea8){_0x256ea8=_0x256ea8||0xc8;return function(_0x373606){if(_0x373606){return _0x1ac724[_0x0dae('0x25')](_0x256ea8)[_0x0dae('0x27')](_0x373606);}};}function respondWithFilteredResult(_0x2bd51f,_0x2a5a9b){return function(_0x276f9f){if(_0x276f9f){var _0xb1965=typeof _0x2a5a9b['offset']===_0x0dae('0x28')&&typeof _0x2a5a9b['limit']===_0x0dae('0x28');var _0x33f4a7=_0x276f9f[_0x0dae('0x29')];var _0x45f6ec=_0xb1965?0x0:_0x2a5a9b[_0x0dae('0x2a')];var _0x458d90=_0xb1965?_0x276f9f['count']:_0x2a5a9b[_0x0dae('0x2a')]+_0x2a5a9b[_0x0dae('0x2b')];var _0x336671;if(_0x458d90>=_0x33f4a7){_0x458d90=_0x33f4a7;_0x336671=0xc8;}else{_0x336671=0xce;}_0x2bd51f[_0x0dae('0x25')](_0x336671);return _0x2bd51f[_0x0dae('0x2c')](_0x0dae('0x2d'),_0x45f6ec+'-'+_0x458d90+'/'+_0x33f4a7)[_0x0dae('0x27')](_0x276f9f);}return null;};}function patchUpdates(_0x553463){return function(_0x3f20d3){try{jsonpatch[_0x0dae('0x2e')](_0x3f20d3,_0x553463,!![]);}catch(_0x3651c1){return BPromise[_0x0dae('0x2f')](_0x3651c1);}return _0x3f20d3[_0x0dae('0x30')]();};}function saveUpdates(_0x1c9bbd,_0x459fe1){return function(_0x3a482d){if(_0x3a482d){return _0x3a482d[_0x0dae('0x31')](_0x1c9bbd)[_0x0dae('0x32')](function(_0x26e160){return _0x26e160;});}return null;};}function removeEntity(_0x5a2dc3,_0x9e31b3){return function(_0xcf0075){if(_0xcf0075){return _0xcf0075['destroy']()['then'](function(){_0x5a2dc3[_0x0dae('0x25')](0xcc)[_0x0dae('0x26')]();});}};}function handleEntityNotFound(_0x407cd9,_0x3a62f8){return function(_0x443527){if(!_0x443527){_0x407cd9[_0x0dae('0x24')](0x194);}return _0x443527;};}function handleError(_0x2c7a3f,_0x3e019e){_0x3e019e=_0x3e019e||0x1f4;return function(_0x253d8f){logger['error'](_0x253d8f[_0x0dae('0x33')]);if(_0x253d8f[_0x0dae('0x34')]){delete _0x253d8f[_0x0dae('0x34')];}_0x2c7a3f[_0x0dae('0x25')](_0x3e019e)[_0x0dae('0x35')](_0x253d8f);};}exports[_0x0dae('0x36')]=function(_0x73b4df,_0x2c9173){var _0x1424e0={},_0xa2b041={},_0x535474={'count':0x0,'rows':[]};return db[_0x0dae('0x37')][_0x0dae('0x38')]()[_0x0dae('0x32')](function(_0x57e3eb){var _0x1bc081=[];for(var _0x3bbddc=0x0;_0x3bbddc0x1){_0x7bb351['or'](_0x0dae('0x77'),qs[_0x0dae('0x78')](_0x1e1f2b),null);}else{if(qs['isNumeric'](_0x1e1f2b)){_0x7bb351['or'](_0x0dae('0x79'),_0x1e1f2b+'%');_0x7bb351['or'](_0x0dae('0x7a'),_0x1e1f2b+'%');_0x7bb351['or'](_0x0dae('0x7b'),_0x1e1f2b+'%');_0x7bb351['or'](_0x0dae('0x7c'),_0x1e1f2b+'%');}else if(qs[_0x0dae('0x7d')](_0x1e1f2b)){_0x7bb351['or']('c.email\x20LIKE\x20?',_0x1e1f2b+'%');}else{_0x7bb351['or'](_0x0dae('0x7e'),'%'+_0x1e1f2b+'%');_0x7bb351['or']('c.lastName\x20LIKE\x20?','%'+_0x1e1f2b+'%');_0x7bb351['or'](_0x0dae('0x7f'),'%'+_0x1e1f2b+'%');}}}}_0x62b7da['where'](_0x7bb351);_0x62b7da[_0x0dae('0x80')](_0x0dae('0x81'));var _0x30f0ea={'type':db[_0x0dae('0x82')][_0x0dae('0x83')][_0x0dae('0x84')],'raw':!![]};var _0x48188c=_0x62b7da['clone']()[_0x0dae('0x4d')](_0x0dae('0x81'));if(_0x1424e0[_0x0dae('0x4a')]){_0x1424e0[_0x0dae('0x4a')]['forEach'](function(_0x517c07){_0x62b7da[_0x0dae('0x4a')]('c.'+_0x517c07[0x0],_0x517c07[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0dae('0x6f')](_0x1dc966)){_0x62b7da[_0x0dae('0x85')](_0x17666b);_0x48188c[_0x0dae('0x4b')](_0x0dae('0x86'),_0x1dc966);}BPromise[_0x0dae('0x87')]()['then'](function(){if(!_0x4007ab)return;if(_0x73b4df[_0x0dae('0x88')][_0x0dae('0x89')]!==_0x0dae('0x8a'))return;if(!_[_0x0dae('0x8b')](_0x4007ab['conditions'],[_0x0dae('0x4d'),_0x0dae('0x64')])){return _0x73b4df[_0x0dae('0x88')][_0x0dae('0x8c')]({'attributes':['id'],'raw':!![]})[_0x0dae('0x32')](function(_0x15887a){if(_['isEmpty'](_0x15887a)){_0x48188c['where'](_0x0dae('0x8d'));_0x62b7da['where'](_0x0dae('0x8d'));}else{_0x48188c['where']('c.ListId\x20IN\x20?',_[_0x0dae('0x60')](_0x15887a,'id'));_0x62b7da[_0x0dae('0x4b')]('c.ListId\x20IN\x20?',_[_0x0dae('0x60')](_0x15887a,'id'));}});}})[_0x0dae('0x32')](function(){if(_0x73b4df[_0x0dae('0x88')][_0x0dae('0x89')]===_0x0dae('0x8a')&&!_0x4007ab&&!_0x73b4df[_0x0dae('0x42')][_0x0dae('0x8e')])return[];return db[_0x0dae('0x8f')][_0x0dae('0x42')](_0x48188c[_0x0dae('0x90')](),_0x30f0ea);})[_0x0dae('0x32')](function(_0x425765){_0x535474[_0x0dae('0x29')]=_0x425765[_0x0dae('0x3f')];if(_0x535474['count']===0x0)return[];return db['sequelize'][_0x0dae('0x42')](_0x4b6471[_0x0dae('0x90')](),_0x30f0ea)[_0x0dae('0x32')](function(_0x411660){_0x44754e=_[_0x0dae('0x91')](_0x411660,'id');_0x30f0ea=_[_0x0dae('0x92')](_0x30f0ea,{'model':db[_0x0dae('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x73b4df[_0x0dae('0x42')][_0x0dae('0x45')]){_0x1424e0['attributes'][_0x0dae('0x61')](function(_0x20bc80){_0x62b7da[_0x0dae('0x4d')]('c.'+_0x20bc80);});}else{_0x62b7da[_0x0dae('0x4d')]('c.id');_0x62b7da[_0x0dae('0x4d')]('c.firstName');_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x93'));_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x94'));_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x95'));_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x96'));_0x62b7da[_0x0dae('0x4d')]('c.email');_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x97'));_0x62b7da['field'](_0x0dae('0x98'));_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x99'));_0x62b7da[_0x0dae('0x4d')](_0x0dae('0x9a'));_0x62b7da[_0x0dae('0x4d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x0dae('0x9b'));}if(_0x1424e0[_0x0dae('0x2b')])_0x62b7da[_0x0dae('0x2b')](_0x1424e0[_0x0dae('0x2b')]);if(_0x1424e0['offset'])_0x62b7da[_0x0dae('0x2a')](_0x1424e0[_0x0dae('0x2a')]);return db[_0x0dae('0x8f')][_0x0dae('0x42')](_0x62b7da[_0x0dae('0x90')](),_0x30f0ea);});})['then'](function(_0x30d6c6){_0x30d6c6[_0x0dae('0x61')](function(_0x3962d9){if(_0x3962d9[_0x0dae('0x9b')]){_0x3962d9[_0x0dae('0x9c')]=[];_0x3962d9['TagIds'][_0x0dae('0x5f')](',')[_0x0dae('0x61')](function(_0x4dc631){_0x3962d9[_0x0dae('0x9c')]['push'](_0x44754e[_0x4dc631]);});}delete _0x3962d9[_0x0dae('0x9b')];});_0x535474[_0x0dae('0x9d')]=_0x30d6c6;return _0x535474;})[_0x0dae('0x32')](respondWithFilteredResult(_0x2c9173,_0x1424e0));})['catch'](handleError(_0x2c9173,null));};exports[_0x0dae('0x9e')]=function(_0x4b3be9,_0x126f40){return db[_0x0dae('0x37')][_0x0dae('0x5c')]({'where':{'id':_0x4b3be9['params']['id']}})[_0x0dae('0x32')](handleEntityNotFound(_0x126f40,null))[_0x0dae('0x32')](removeEntity(_0x126f40,null))[_0x0dae('0x9f')](handleError(_0x126f40,null));};exports[_0x0dae('0x38')]=function(_0x3deeb1,_0x447cec){return db[_0x0dae('0x37')][_0x0dae('0x38')]()[_0x0dae('0x32')](function(_0x53ca63){delete _0x53ca63[_0x0dae('0xa0')];for(var _0x15d4c5=0x0;_0x15d4c5=_0x2f8375){_0xe6cf06=_0x2f8375;_0x2c14b6=0xc8;}else{_0x2c14b6=0xce;}_0x46b6a7[_0x9614('0x20')](_0x2c14b6);return _0x46b6a7[_0x9614('0x26')](_0x9614('0x27'),_0x295e2c+'-'+_0xe6cf06+'/'+_0x2f8375)[_0x9614('0x21')](_0x462eaf);}return null;};}function patchUpdates(_0x551ebb){return function(_0x5d76cf){try{jsonpatch['apply'](_0x5d76cf,_0x551ebb,!![]);}catch(_0x5e78dc){return BPromise[_0x9614('0x28')](_0x5e78dc);}return _0x5d76cf[_0x9614('0x29')]();};}function saveUpdates(_0x86670,_0x356368){return function(_0x35933b){if(_0x35933b){return _0x35933b[_0x9614('0x2a')](_0x86670)['then'](function(_0x5cbcf3){return _0x5cbcf3;});}return null;};}function removeEntity(_0x5a4c24,_0x3bf573){return function(_0x245e0c){if(_0x245e0c){return _0x245e0c[_0x9614('0x2b')]()['then'](function(){_0x5a4c24[_0x9614('0x20')](0xcc)[_0x9614('0x1f')]();});}};}function handleEntityNotFound(_0x3747c8,_0x48a7a3){return function(_0x2586ab){if(!_0x2586ab){_0x3747c8['sendStatus'](0x194);}return _0x2586ab;};}function handleError(_0x1fe1bb,_0x1c960a){_0x1c960a=_0x1c960a||0x1f4;return function(_0x1b673a){logger['error'](_0x1b673a[_0x9614('0x2c')]);if(_0x1b673a[_0x9614('0x2d')]){delete _0x1b673a[_0x9614('0x2d')];}_0x1fe1bb[_0x9614('0x20')](_0x1c960a)[_0x9614('0x2e')](_0x1b673a);};}exports['index']=function(_0x16d201,_0x1aced4){var _0x54b1fb={},_0x956a7a={},_0xd624a8={'count':0x0,'rows':[]};return db[_0x9614('0x2f')][_0x9614('0x30')]()[_0x9614('0x31')](function(_0x3688fa){var _0x209d2f=[];for(var _0x4f9d17=0x0;_0x4f9d170x1){_0x4802ee['or'](_0x9614('0x60'),qs[_0x9614('0x61')](_0x1a3e9d),null);}else{if(qs['isNumeric'](_0x1a3e9d)){_0x4802ee['or'](_0x9614('0x62'),_0x1a3e9d+'%');_0x4802ee['or'](_0x9614('0x63'),_0x1a3e9d+'%');_0x4802ee['or'](_0x9614('0x64'),_0x1a3e9d+'%');_0x4802ee['or'](_0x9614('0x65'),_0x1a3e9d+'%');}else if(qs['isEmail'](_0x1a3e9d)){_0x4802ee['or'](_0x9614('0x66'),_0x1a3e9d+'%');}else{_0x4802ee['or'](_0x9614('0x67'),'%'+_0x1a3e9d+'%');_0x4802ee['or'](_0x9614('0x68'),'%'+_0x1a3e9d+'%');_0x4802ee['or'](_0x9614('0x66'),'%'+_0x1a3e9d+'%');}}}}_0x2ceb09[_0x9614('0x3c')](_0x4802ee);_0x2ceb09['group'](_0x9614('0x69'));var _0x36dd4b={'type':db[_0x9614('0x6a')][_0x9614('0x6b')]['SELECT'],'raw':!![]};var _0x541e01=_0x2ceb09[_0x9614('0x6c')]()[_0x9614('0x3f')]('c.id');if(_0x54b1fb['order']){_0x54b1fb['order'][_0x9614('0x4e')](function(_0x7cffa0){_0x2ceb09[_0x9614('0x6d')]('c.'+_0x7cffa0[0x0],_0x7cffa0[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9614('0x6e')](_0x5ab0af)){_0x2ceb09[_0x9614('0x6f')](_0x57fb91);_0x541e01[_0x9614('0x3c')](_0x9614('0x70'),_0x5ab0af);}BPromise[_0x9614('0x71')]()[_0x9614('0x31')](function(){if(!_0x39495d)return;if(_0x16d201[_0x9614('0x72')][_0x9614('0x73')]!=='agent')return;if(!_[_0x9614('0x74')](_0x39495d[_0x9614('0x49')],[_0x9614('0x3f'),_0x9614('0x75')])){return _0x16d201[_0x9614('0x72')][_0x9614('0x76')]({'attributes':['id'],'raw':!![]})[_0x9614('0x31')](function(_0x29e192){if(_[_0x9614('0x6e')](_0x29e192)){_0x541e01[_0x9614('0x3c')](_0x9614('0x77'));_0x2ceb09[_0x9614('0x3c')](_0x9614('0x77'));}else{_0x541e01[_0x9614('0x3c')](_0x9614('0x5b'),_[_0x9614('0x4d')](_0x29e192,'id'));_0x2ceb09['where'](_0x9614('0x5b'),_[_0x9614('0x4d')](_0x29e192,'id'));}});}})[_0x9614('0x31')](function(){if(_0x16d201[_0x9614('0x72')][_0x9614('0x73')]===_0x9614('0x78')&&!_0x39495d&&!_0x16d201[_0x9614('0x38')][_0x9614('0x79')])return[];return db['sequelize'][_0x9614('0x38')](_0x541e01[_0x9614('0x7a')](),_0x36dd4b);})[_0x9614('0x31')](function(_0x5af7ea){_0xd624a8[_0x9614('0x24')]=_0x5af7ea[_0x9614('0x33')];if(_0xd624a8[_0x9614('0x24')]===0x0)return[];return db[_0x9614('0x7b')]['query'](_0x6c2185[_0x9614('0x7a')](),_0x36dd4b)[_0x9614('0x31')](function(_0x5ad981){_0x43c1f9=_[_0x9614('0x7c')](_0x5ad981,'id');_0x36dd4b=_[_0x9614('0x7d')](_0x36dd4b,{'model':db[_0x9614('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16d201[_0x9614('0x38')][_0x9614('0x3a')]){_0x54b1fb[_0x9614('0x39')][_0x9614('0x4e')](function(_0x1386f1){_0x2ceb09[_0x9614('0x3f')]('c.'+_0x1386f1);});}else{_0x2ceb09['field'](_0x9614('0x69'));_0x2ceb09['field'](_0x9614('0x7e'));_0x2ceb09[_0x9614('0x3f')](_0x9614('0x7f'));_0x2ceb09[_0x9614('0x3f')](_0x9614('0x80'));_0x2ceb09[_0x9614('0x3f')](_0x9614('0x81'));_0x2ceb09['field'](_0x9614('0x82'));_0x2ceb09[_0x9614('0x3f')]('c.email');_0x2ceb09[_0x9614('0x3f')](_0x9614('0x83'));_0x2ceb09[_0x9614('0x3f')](_0x9614('0x84'));_0x2ceb09[_0x9614('0x3f')]('c.deletedAt');_0x2ceb09['field'](_0x9614('0x85'));_0x2ceb09[_0x9614('0x3f')](_0x9614('0x86'),'TagIds');}if(_0x54b1fb['limit'])_0x2ceb09['limit'](_0x54b1fb[_0x9614('0x23')]);if(_0x54b1fb[_0x9614('0x25')])_0x2ceb09[_0x9614('0x25')](_0x54b1fb[_0x9614('0x25')]);return db['sequelize'][_0x9614('0x38')](_0x2ceb09['toString'](),_0x36dd4b);});})[_0x9614('0x31')](function(_0x301fcd){_0x301fcd[_0x9614('0x4e')](function(_0x24632c){if(_0x24632c[_0x9614('0x87')]){_0x24632c[_0x9614('0x88')]=[];_0x24632c[_0x9614('0x87')]['split'](',')[_0x9614('0x4e')](function(_0x5c34b0){_0x24632c[_0x9614('0x88')][_0x9614('0x35')](_0x43c1f9[_0x5c34b0]);});}delete _0x24632c['TagIds'];});_0xd624a8[_0x9614('0x89')]=_0x301fcd;return _0xd624a8;})['then'](respondWithFilteredResult(_0x1aced4,_0x54b1fb));})[_0x9614('0x8a')](handleError(_0x1aced4,null));};exports['destroy']=function(_0x4c40b0,_0x5d642c){return db[_0x9614('0x2f')][_0x9614('0x8b')]({'where':{'id':_0x4c40b0[_0x9614('0x8c')]['id']}})['then'](handleEntityNotFound(_0x5d642c,null))[_0x9614('0x31')](removeEntity(_0x5d642c,null))['catch'](handleError(_0x5d642c,null));};exports[_0x9614('0x30')]=function(_0x31e873,_0x20cd88){return db[_0x9614('0x2f')][_0x9614('0x30')]()[_0x9614('0x31')](function(_0x5d3086){delete _0x5d3086[_0x9614('0x8d')];for(var _0xb75c27=0x0;_0xb75c27{}\s\\|]/g,'-');_0x4b9603(null,util[_0x15d5('0x20')](_0x15d5('0x21'),path['basename'](_0x3059cb['originalname'],path[_0x15d5('0x22')](_0x3059cb['originalname'])),Date[_0x15d5('0x23')](),path[_0x15d5('0x22')](_0x3059cb[_0x15d5('0x1e')])));}})});router['post'](_0x15d5('0x24'),upload[_0x15d5('0x25')]('file'),controller[_0x15d5('0x26')]);var upload=multer({'storage':multer[_0x15d5('0x1a')]({'destination':function(_0x55e07d,_0x30e447,_0x4aba9e){_0x4aba9e(null,path[_0x15d5('0x1b')](config[_0x15d5('0x1c')],_0x15d5('0x1d')));},'filename':function(_0x31404a,_0x3427e1,_0x5bd67d){_0x3427e1['originalname']=_0x3427e1['originalname'][_0x15d5('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5bd67d(null,util[_0x15d5('0x20')](_0x15d5('0x21'),path[_0x15d5('0x27')](_0x3427e1[_0x15d5('0x1e')],path['extname'](_0x3427e1['originalname'])),Date[_0x15d5('0x23')](),path['extname'](_0x3427e1['originalname'])));}})});router['post']('/upload',upload[_0x15d5('0x25')](_0x15d5('0x28')),controller[_0x15d5('0x29')]);router[_0x15d5('0x14')](_0x15d5('0x2a'),auth['isAuthenticated'](),controller['import']);router[_0x15d5('0x2b')](_0x15d5('0xc'),auth[_0x15d5('0x9')](),controller['update']);router['delete'](_0x15d5('0xc'),auth[_0x15d5('0x9')](),controller[_0x15d5('0x2c')]);module[_0x15d5('0x2d')]=router; \ No newline at end of file +var _0x2a2f=['/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','upload','import','put','/:id','update','exports','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmContact.controller','get','/describe','isAuthenticated','describe','show','/:id/tags','getTags','/:id/hoppers','getHoppers'];(function(_0x492535,_0x46524a){var _0x256620=function(_0x3015f8){while(--_0x3015f8){_0x492535['push'](_0x492535['shift']());}};_0x256620(++_0x46524a);}(_0x2a2f,0xb0));var _0xf2a2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2a2f[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xf2a2('0x0'));var util=require(_0xf2a2('0x1'));var path=require(_0xf2a2('0x2'));var timeout=require(_0xf2a2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf2a2('0x4'));var config=require(_0xf2a2('0x5'));var controller=require(_0xf2a2('0x6'));router[_0xf2a2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf2a2('0x7')](_0xf2a2('0x8'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0xa')]);router[_0xf2a2('0x7')]('/:id',auth[_0xf2a2('0x9')](),controller[_0xf2a2('0xb')]);router['get'](_0xf2a2('0xc'),auth['isAuthenticated'](),controller[_0xf2a2('0xd')]);router[_0xf2a2('0x7')](_0xf2a2('0xe'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0xf')]);router[_0xf2a2('0x7')](_0xf2a2('0x10'),auth['isAuthenticated'](),controller[_0xf2a2('0x11')]);router[_0xf2a2('0x7')](_0xf2a2('0x12'),auth[_0xf2a2('0x9')](),controller['getHopperFinals']);router[_0xf2a2('0x7')]('/:id/jscripty_sessions',auth[_0xf2a2('0x9')](),controller['getJscriptySessions']);router[_0xf2a2('0x7')](_0xf2a2('0x13'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x14')]);router[_0xf2a2('0x15')](_0xf2a2('0x16'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x17')]);router[_0xf2a2('0x15')]('/',auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x18')]);router[_0xf2a2('0x15')](_0xf2a2('0x19'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x1a')]);router[_0xf2a2('0x15')](_0xf2a2('0xc'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x1b')]);var upload=multer({'storage':multer[_0xf2a2('0x1c')]({'destination':function(_0x2fcf1a,_0x187e84,_0x52117d){_0x52117d(null,path[_0xf2a2('0x1d')](config[_0xf2a2('0x1e')],_0xf2a2('0x1f')));},'filename':function(_0x6ea634,_0x198c0d,_0x2e0154){_0x198c0d['originalname']=_0x198c0d[_0xf2a2('0x20')][_0xf2a2('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2e0154(null,util[_0xf2a2('0x22')](_0xf2a2('0x23'),path[_0xf2a2('0x24')](_0x198c0d[_0xf2a2('0x20')],path[_0xf2a2('0x25')](_0x198c0d[_0xf2a2('0x20')])),Date[_0xf2a2('0x26')](),path[_0xf2a2('0x25')](_0x198c0d['originalname'])));}})});router[_0xf2a2('0x15')](_0xf2a2('0x27'),upload[_0xf2a2('0x28')](_0xf2a2('0x29')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xf2a2('0x1c')]({'destination':function(_0x11fc50,_0x6fb296,_0x14a9c8){_0x14a9c8(null,path[_0xf2a2('0x1d')](config['root'],_0xf2a2('0x1f')));},'filename':function(_0x1d3ec7,_0x4afdc4,_0xb192ca){_0x4afdc4[_0xf2a2('0x20')]=_0x4afdc4[_0xf2a2('0x20')][_0xf2a2('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb192ca(null,util[_0xf2a2('0x22')](_0xf2a2('0x23'),path[_0xf2a2('0x24')](_0x4afdc4[_0xf2a2('0x20')],path[_0xf2a2('0x25')](_0x4afdc4[_0xf2a2('0x20')])),Date[_0xf2a2('0x26')](),path[_0xf2a2('0x25')](_0x4afdc4['originalname'])));}})});router['post']('/upload',upload[_0xf2a2('0x28')](_0xf2a2('0x29')),controller[_0xf2a2('0x2a')]);router[_0xf2a2('0x15')]('/upload/:id',auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x2b')]);router[_0xf2a2('0x2c')](_0xf2a2('0x2d'),auth[_0xf2a2('0x9')](),controller[_0xf2a2('0x2e')]);router['delete'](_0xf2a2('0x2d'),auth[_0xf2a2('0x9')](),controller['destroy']);module[_0xf2a2('0x2f')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 823570f..a5b7685 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 _0xaaaa=['getDataValue','name','TEXT','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','alias','STRING','setDataValue'];(function(_0x21efc0,_0x834ae1){var _0x336c4f=function(_0xa40b4b){while(--_0xa40b4b){_0x21efc0['push'](_0x21efc0['shift']());}};_0x336c4f(++_0x834ae1);}(_0xaaaa,0x198));var _0xaaaa=function(_0x5a9a51,_0x107a3a){_0x5a9a51=_0x5a9a51-0x0;var _0x404bed=_0xaaaa[_0x5a9a51];return _0x404bed;};'use strict';var Sequelize=require(_0xaaaa('0x0'));var _=require('lodash');module[_0xaaaa('0x1')]={'name':{'type':Sequelize[_0xaaaa('0x2')],'get':function(_0x16d56c){return this['getDataValue'](_0xaaaa('0x3'));}},'alias':{'type':Sequelize[_0xaaaa('0x4')],'allowNull':![],'set':function(_0x3721f6){this[_0xaaaa('0x5')]('alias',_0x3721f6?_0x3721f6:this[_0xaaaa('0x6')](_0xaaaa('0x7')));}},'type':{'type':Sequelize[_0xaaaa('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xaaaa('0x8')]('long'),'get':function(){if(this[_0xaaaa('0x6')](_0xaaaa('0x9'))===_0xaaaa('0xa')){return JSON[_0xaaaa('0xb')](this[_0xaaaa('0x6')]('values'));}else{return this[_0xaaaa('0x6')](_0xaaaa('0xc'));}},'set':function(_0x59b4df){if(Array[_0xaaaa('0xd')](_0x59b4df)){this['setDataValue']('values',JSON[_0xaaaa('0xe')](_0x59b4df));}else{this[_0xaaaa('0x5')](_0xaaaa('0xc'),_0x59b4df);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xaaaa('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xaaaa('0x10')](_0xaaaa('0x11'))}}; \ No newline at end of file +var _0x0350=['ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','long','select','values','isArray','stringify','BOOLEAN'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x0350,0x1a2));var _0x0035=function(_0x536b87,_0x2a3324){_0x536b87=_0x536b87-0x0;var _0x2a75a=_0x0350[_0x536b87];return _0x2a75a;};'use strict';var Sequelize=require(_0x0035('0x0'));var _=require(_0x0035('0x1'));module[_0x0035('0x2')]={'name':{'type':Sequelize[_0x0035('0x3')],'get':function(_0x37f1f0){return this[_0x0035('0x4')](_0x0035('0x5'));}},'alias':{'type':Sequelize[_0x0035('0x6')],'allowNull':![],'set':function(_0x3651c3){this[_0x0035('0x7')](_0x0035('0x5'),_0x3651c3?_0x3651c3:this[_0x0035('0x4')]('name'));}},'type':{'type':Sequelize[_0x0035('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x0035('0x8')),'get':function(){if(this['getDataValue']('type')===_0x0035('0x9')){return JSON['parse'](this['getDataValue'](_0x0035('0xa')));}else{return this['getDataValue'](_0x0035('0xa'));}},'set':function(_0x5b8a40){if(Array[_0x0035('0xb')](_0x5b8a40)){this['setDataValue'](_0x0035('0xa'),JSON[_0x0035('0xc')](_0x5b8a40));}else{this[_0x0035('0x7')](_0x0035('0xa'),_0x5b8a40);}}},'required':{'type':Sequelize[_0x0035('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0035('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0035('0xe')](_0x0035('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 1f64584..0be8de9 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 _0xf1f5=['nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','CmCustomField','includeAll','include','findAll','rows','catch','show','keys','find','body','params','create','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x319226,_0x426251){var _0x580b42=function(_0x2d4ff9){while(--_0x2d4ff9){_0x319226['push'](_0x319226['shift']());}};_0x580b42(++_0x426251);}(_0xf1f5,0x1e1));var _0x5f1f=function(_0x3c0fda,_0x3f0af4){_0x3c0fda=_0x3c0fda-0x0;var _0x49a582=_0xf1f5[_0x3c0fda];return _0x49a582;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5f1f('0x0'));var zipdir=require(_0x5f1f('0x1'));var jsonpatch=require(_0x5f1f('0x2'));var rp=require('request-promise');var moment=require(_0x5f1f('0x3'));var BPromise=require(_0x5f1f('0x4'));var Mustache=require('mustache');var util=require(_0x5f1f('0x5'));var path=require(_0x5f1f('0x6'));var sox=require('sox');var csv=require(_0x5f1f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f1f('0x8'));var _=require(_0x5f1f('0x9'));var squel=require(_0x5f1f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f1f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5f1f('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f1f('0xd'));var qs=require(_0x5f1f('0xe'));var as=require(_0x5f1f('0xf'));var hardwareService=require(_0x5f1f('0x10'));var logger=require(_0x5f1f('0x11'))(_0x5f1f('0x12'));var utils=require('../../config/utils');var config=require(_0x5f1f('0x13'));var licenseUtil=require(_0x5f1f('0x14'));var db=require(_0x5f1f('0x15'))['db'];function respondWithStatusCode(_0x5b4d2e,_0x4b6fdc){_0x4b6fdc=_0x4b6fdc||0xcc;return function(_0x5c6e87){if(_0x5c6e87){return _0x5b4d2e[_0x5f1f('0x16')](_0x4b6fdc);}return _0x5b4d2e['status'](_0x4b6fdc)[_0x5f1f('0x17')]();};}function respondWithResult(_0x1ce4f1,_0x1ebcc9){_0x1ebcc9=_0x1ebcc9||0xc8;return function(_0x2252b6){if(_0x2252b6){return _0x1ce4f1[_0x5f1f('0x18')](_0x1ebcc9)['json'](_0x2252b6);}};}function respondWithFilteredResult(_0x2c49e5,_0x40c9ef){return function(_0xcf0293){if(_0xcf0293){var _0x49440c=typeof _0x40c9ef[_0x5f1f('0x19')]===_0x5f1f('0x1a')&&typeof _0x40c9ef[_0x5f1f('0x1b')]===_0x5f1f('0x1a');var _0x1c9b6c=_0xcf0293[_0x5f1f('0x1c')];var _0x2247e7=_0x49440c?0x0:_0x40c9ef['offset'];var _0x3a6007=_0x49440c?_0xcf0293[_0x5f1f('0x1c')]:_0x40c9ef[_0x5f1f('0x19')]+_0x40c9ef[_0x5f1f('0x1b')];var _0x3b5e88;if(_0x3a6007>=_0x1c9b6c){_0x3a6007=_0x1c9b6c;_0x3b5e88=0xc8;}else{_0x3b5e88=0xce;}_0x2c49e5[_0x5f1f('0x18')](_0x3b5e88);return _0x2c49e5[_0x5f1f('0x1d')](_0x5f1f('0x1e'),_0x2247e7+'-'+_0x3a6007+'/'+_0x1c9b6c)[_0x5f1f('0x1f')](_0xcf0293);}return null;};}function patchUpdates(_0x4d375c){return function(_0x386e16){try{jsonpatch[_0x5f1f('0x20')](_0x386e16,_0x4d375c,!![]);}catch(_0x598a3d){return BPromise[_0x5f1f('0x21')](_0x598a3d);}return _0x386e16[_0x5f1f('0x22')]();};}function saveUpdates(_0x3ca6af,_0x3f9f0c){return function(_0x1da9c1){if(_0x1da9c1){return _0x1da9c1[_0x5f1f('0x23')](_0x3ca6af)[_0x5f1f('0x24')](function(_0x4adf88){return _0x4adf88;});}return null;};}function removeEntity(_0x1d72f7,_0x5c6763){return function(_0x5a764c){if(_0x5a764c){return _0x5a764c['destroy']()[_0x5f1f('0x24')](function(){_0x1d72f7[_0x5f1f('0x18')](0xcc)[_0x5f1f('0x17')]();});}};}function handleEntityNotFound(_0xdf404e,_0x5adf0a){return function(_0x4ba3ce){if(!_0x4ba3ce){_0xdf404e[_0x5f1f('0x16')](0x194);}return _0x4ba3ce;};}function handleError(_0x43e87b,_0x582ece){_0x582ece=_0x582ece||0x1f4;return function(_0x198679){logger[_0x5f1f('0x25')](_0x198679[_0x5f1f('0x26')]);if(_0x198679[_0x5f1f('0x27')]){delete _0x198679[_0x5f1f('0x27')];}_0x43e87b[_0x5f1f('0x18')](_0x582ece)['send'](_0x198679);};}exports[_0x5f1f('0x28')]=function(_0x2de895,_0x1eed8f){var _0x43f7bf={},_0x24741d={},_0x11e505={'count':0x0,'rows':[]};var _0x4ae8fd=_['map'](db['CmCustomField'][_0x5f1f('0x29')],function(_0x27af58){return{'name':_0x27af58[_0x5f1f('0x2a')],'type':_0x27af58[_0x5f1f('0x2b')][_0x5f1f('0x2c')]};});_0x24741d[_0x5f1f('0x2d')]=_['differenceBy'](_['map'](_0x4ae8fd,_0x5f1f('0x27')),[_0x5f1f('0x27')]);_0x24741d[_0x5f1f('0x2e')]=_['keys'](_0x2de895[_0x5f1f('0x2e')]);_0x24741d[_0x5f1f('0x2f')]=_[_0x5f1f('0x30')](_0x24741d[_0x5f1f('0x2d')],_0x24741d[_0x5f1f('0x2e')]);_0x43f7bf[_0x5f1f('0x31')]=_[_0x5f1f('0x30')](_0x24741d[_0x5f1f('0x2d')],qs[_0x5f1f('0x32')](_0x2de895[_0x5f1f('0x2e')]['fields']));_0x43f7bf['attributes']=_0x43f7bf[_0x5f1f('0x31')][_0x5f1f('0x33')]?_0x43f7bf['attributes']:_0x24741d[_0x5f1f('0x2d')];if(!_0x2de895[_0x5f1f('0x2e')][_0x5f1f('0x34')](_0x5f1f('0x35'))){_0x43f7bf[_0x5f1f('0x1b')]=qs[_0x5f1f('0x1b')](_0x2de895['query'][_0x5f1f('0x1b')]);_0x43f7bf['offset']=qs[_0x5f1f('0x19')](_0x2de895[_0x5f1f('0x2e')][_0x5f1f('0x19')]);}_0x43f7bf[_0x5f1f('0x36')]=qs[_0x5f1f('0x37')](_0x2de895[_0x5f1f('0x2e')]['sort']);_0x43f7bf[_0x5f1f('0x38')]=qs[_0x5f1f('0x2f')](_[_0x5f1f('0x39')](_0x2de895[_0x5f1f('0x2e')],_0x24741d[_0x5f1f('0x2f')]),_0x4ae8fd);if(_0x2de895[_0x5f1f('0x2e')][_0x5f1f('0x3a')]){_0x43f7bf[_0x5f1f('0x38')]=_['merge'](_0x43f7bf[_0x5f1f('0x38')],{'$or':_[_0x5f1f('0x3b')](_0x4ae8fd,function(_0x210ea4){if(_0x210ea4[_0x5f1f('0x2b')]!==_0x5f1f('0x3c')){var _0x626e04={};_0x626e04[_0x210ea4[_0x5f1f('0x27')]]={'$like':'%'+_0x2de895[_0x5f1f('0x2e')][_0x5f1f('0x3a')]+'%'};return _0x626e04;}})});}_0x43f7bf=_[_0x5f1f('0x3d')]({},_0x43f7bf,_0x2de895[_0x5f1f('0x3e')]);var _0x5aa55d={'where':_0x43f7bf[_0x5f1f('0x38')]};return db[_0x5f1f('0x3f')][_0x5f1f('0x1c')](_0x5aa55d)[_0x5f1f('0x24')](function(_0x52ceac){_0x11e505[_0x5f1f('0x1c')]=_0x52ceac;if(_0x2de895[_0x5f1f('0x2e')][_0x5f1f('0x40')]){_0x43f7bf[_0x5f1f('0x41')]=[{'all':!![]}];}return db[_0x5f1f('0x3f')][_0x5f1f('0x42')](_0x43f7bf);})['then'](function(_0x5179a2){_0x11e505[_0x5f1f('0x43')]=_0x5179a2;return _0x11e505;})['then'](respondWithFilteredResult(_0x1eed8f,_0x43f7bf))[_0x5f1f('0x44')](handleError(_0x1eed8f,null));};exports[_0x5f1f('0x45')]=function(_0x195cba,_0x5c5e11){var _0x5414d2={'raw':!![],'where':{'id':_0x195cba['params']['id']}},_0x47c418={};_0x47c418[_0x5f1f('0x2d')]=_[_0x5f1f('0x46')](db[_0x5f1f('0x3f')]['rawAttributes']);_0x47c418['query']=_['keys'](_0x195cba[_0x5f1f('0x2e')]);_0x47c418[_0x5f1f('0x2f')]=_[_0x5f1f('0x30')](_0x47c418[_0x5f1f('0x2d')],_0x47c418['query']);_0x5414d2[_0x5f1f('0x31')]=_[_0x5f1f('0x30')](_0x47c418[_0x5f1f('0x2d')],qs[_0x5f1f('0x32')](_0x195cba[_0x5f1f('0x2e')][_0x5f1f('0x32')]));_0x5414d2[_0x5f1f('0x31')]=_0x5414d2[_0x5f1f('0x31')][_0x5f1f('0x33')]?_0x5414d2['attributes']:_0x47c418[_0x5f1f('0x2d')];if(_0x195cba['query'][_0x5f1f('0x40')]){_0x5414d2[_0x5f1f('0x41')]=[{'all':!![]}];}_0x5414d2=_['merge']({},_0x5414d2,_0x195cba[_0x5f1f('0x3e')]);return db[_0x5f1f('0x3f')][_0x5f1f('0x47')](_0x5414d2)[_0x5f1f('0x24')](handleEntityNotFound(_0x5c5e11,null))['then'](respondWithResult(_0x5c5e11,null))['catch'](handleError(_0x5c5e11,null));};exports['update']=function(_0x252eec,_0x226e18){if(_0x252eec[_0x5f1f('0x48')]['id']){delete _0x252eec[_0x5f1f('0x48')]['id'];}return db[_0x5f1f('0x3f')][_0x5f1f('0x47')]({'where':{'id':_0x252eec[_0x5f1f('0x49')]['id']}})[_0x5f1f('0x24')](handleEntityNotFound(_0x226e18,null))['then'](saveUpdates(_0x252eec['body'],null))['then'](respondWithResult(_0x226e18,null))[_0x5f1f('0x44')](handleError(_0x226e18,null));};exports['destroy']=function(_0x3b30af,_0x2ec539){return db[_0x5f1f('0x3f')][_0x5f1f('0x47')]({'where':{'id':_0x3b30af[_0x5f1f('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ec539,null))['then'](removeEntity(_0x2ec539,null))[_0x5f1f('0x44')](handleError(_0x2ec539,null));};exports[_0x5f1f('0x4a')]=function(_0x390f57,_0x5706ec){var _0x22e2e1;return db['sequelize'][_0x5f1f('0x4b')](function(_0x2647b2){return db[_0x5f1f('0x3f')][_0x5f1f('0x4a')](_0x390f57[_0x5f1f('0x48')],{'transaction':_0x2647b2})['then'](function(_0x188571){_0x22e2e1=_0x188571;var _0x25beb2={'type':db[_0x5f1f('0x4c')][_0x5f1f('0x4d')],'transaction':_0x2647b2};switch(_0x390f57[_0x5f1f('0x48')][_0x5f1f('0x2b')]){case _0x5f1f('0x4e'):_0x25beb2[_0x5f1f('0x2b')]=db['Sequelize'][_0x5f1f('0x4d')];break;case _0x5f1f('0x4f'):_0x25beb2[_0x5f1f('0x2b')]=db[_0x5f1f('0x4c')][_0x5f1f('0x50')];break;case _0x5f1f('0x51'):_0x25beb2[_0x5f1f('0x2b')]=db[_0x5f1f('0x4c')][_0x5f1f('0x52')];_0x25beb2[_0x5f1f('0x53')]=![];break;default:}return db[_0x5f1f('0x54')][_0x5f1f('0x55')]['addColumn'](_0x5f1f('0x56'),util[_0x5f1f('0x57')](_0x5f1f('0x58'),_0x22e2e1['id']),_0x25beb2);})[_0x5f1f('0x24')](function(){return _0x22e2e1;});})[_0x5f1f('0x24')](respondWithResult(_0x5706ec,0xc9))[_0x5f1f('0x44')](handleError(_0x5706ec,null));}; \ No newline at end of file +var _0x7980=['update','body','create','sequelize','transaction','Sequelize','TEXT','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find'];(function(_0x10403c,_0x391bc7){var _0x15423b=function(_0x5bd404){while(--_0x5bd404){_0x10403c['push'](_0x10403c['shift']());}};_0x15423b(++_0x391bc7);}(_0x7980,0x123));var _0x0798=function(_0x2ffab4,_0x4cb3bf){_0x2ffab4=_0x2ffab4-0x0;var _0x5abffe=_0x7980[_0x2ffab4];return _0x5abffe;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0798('0x2'));var rp=require(_0x0798('0x3'));var moment=require(_0x0798('0x4'));var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require(_0x0798('0xb'));var _=require(_0x0798('0xc'));var squel=require(_0x0798('0xd'));var crypto=require(_0x0798('0xe'));var jsforce=require(_0x0798('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0798('0x10'));var querystring=require(_0x0798('0x11'));var Papa=require(_0x0798('0x12'));var Redis=require(_0x0798('0x13'));var authService=require(_0x0798('0x14'));var qs=require(_0x0798('0x15'));var as=require(_0x0798('0x16'));var hardwareService=require(_0x0798('0x17'));var logger=require(_0x0798('0x18'))(_0x0798('0x19'));var utils=require(_0x0798('0x1a'));var config=require(_0x0798('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x0798('0x1c'))['db'];function respondWithStatusCode(_0x549e25,_0x24bbcf){_0x24bbcf=_0x24bbcf||0xcc;return function(_0x5c2bc7){if(_0x5c2bc7){return _0x549e25[_0x0798('0x1d')](_0x24bbcf);}return _0x549e25['status'](_0x24bbcf)[_0x0798('0x1e')]();};}function respondWithResult(_0x1c34f8,_0xe39220){_0xe39220=_0xe39220||0xc8;return function(_0x163de4){if(_0x163de4){return _0x1c34f8[_0x0798('0x1f')](_0xe39220)[_0x0798('0x20')](_0x163de4);}};}function respondWithFilteredResult(_0x12e352,_0x129328){return function(_0x69bc9b){if(_0x69bc9b){var _0xe435f7=typeof _0x129328[_0x0798('0x21')]===_0x0798('0x22')&&typeof _0x129328[_0x0798('0x23')]===_0x0798('0x22');var _0x3d98bd=_0x69bc9b[_0x0798('0x24')];var _0xe72507=_0xe435f7?0x0:_0x129328[_0x0798('0x21')];var _0x5cb23c=_0xe435f7?_0x69bc9b[_0x0798('0x24')]:_0x129328[_0x0798('0x21')]+_0x129328[_0x0798('0x23')];var _0xef8eb9;if(_0x5cb23c>=_0x3d98bd){_0x5cb23c=_0x3d98bd;_0xef8eb9=0xc8;}else{_0xef8eb9=0xce;}_0x12e352[_0x0798('0x1f')](_0xef8eb9);return _0x12e352[_0x0798('0x25')]('Content-Range',_0xe72507+'-'+_0x5cb23c+'/'+_0x3d98bd)[_0x0798('0x20')](_0x69bc9b);}return null;};}function patchUpdates(_0x58e55c){return function(_0x136a4c){try{jsonpatch['apply'](_0x136a4c,_0x58e55c,!![]);}catch(_0x48c8b8){return BPromise[_0x0798('0x26')](_0x48c8b8);}return _0x136a4c[_0x0798('0x27')]();};}function saveUpdates(_0x12e5e6,_0xbefc4e){return function(_0x13521b){if(_0x13521b){return _0x13521b['update'](_0x12e5e6)[_0x0798('0x28')](function(_0x50b517){return _0x50b517;});}return null;};}function removeEntity(_0x23f09b,_0x522893){return function(_0x28ebe7){if(_0x28ebe7){return _0x28ebe7[_0x0798('0x29')]()[_0x0798('0x28')](function(){_0x23f09b['status'](0xcc)[_0x0798('0x1e')]();});}};}function handleEntityNotFound(_0x5ace1a,_0x4697d9){return function(_0x1ced2f){if(!_0x1ced2f){_0x5ace1a[_0x0798('0x1d')](0x194);}return _0x1ced2f;};}function handleError(_0x37cae1,_0x589a07){_0x589a07=_0x589a07||0x1f4;return function(_0x1a187e){logger['error'](_0x1a187e[_0x0798('0x2a')]);if(_0x1a187e[_0x0798('0x2b')]){delete _0x1a187e[_0x0798('0x2b')];}_0x37cae1['status'](_0x589a07)[_0x0798('0x2c')](_0x1a187e);};}exports['index']=function(_0x12c9b0,_0x41f784){var _0x3d0ed0={},_0x5e6777={},_0x50446d={'count':0x0,'rows':[]};var _0x367dbd=_[_0x0798('0x2d')](db[_0x0798('0x2e')][_0x0798('0x2f')],function(_0x4f827c){return{'name':_0x4f827c[_0x0798('0x30')],'type':_0x4f827c[_0x0798('0x31')][_0x0798('0x32')]};});_0x5e6777[_0x0798('0x33')]=_[_0x0798('0x34')](_[_0x0798('0x2d')](_0x367dbd,_0x0798('0x2b')),[_0x0798('0x2b')]);_0x5e6777[_0x0798('0x35')]=_[_0x0798('0x36')](_0x12c9b0['query']);_0x5e6777[_0x0798('0x37')]=_[_0x0798('0x38')](_0x5e6777[_0x0798('0x33')],_0x5e6777['query']);_0x3d0ed0[_0x0798('0x39')]=_[_0x0798('0x38')](_0x5e6777['model'],qs[_0x0798('0x3a')](_0x12c9b0[_0x0798('0x35')][_0x0798('0x3a')]));_0x3d0ed0[_0x0798('0x39')]=_0x3d0ed0[_0x0798('0x39')][_0x0798('0x3b')]?_0x3d0ed0[_0x0798('0x39')]:_0x5e6777[_0x0798('0x33')];if(!_0x12c9b0[_0x0798('0x35')][_0x0798('0x3c')]('nolimit')){_0x3d0ed0[_0x0798('0x23')]=qs['limit'](_0x12c9b0[_0x0798('0x35')]['limit']);_0x3d0ed0['offset']=qs[_0x0798('0x21')](_0x12c9b0[_0x0798('0x35')][_0x0798('0x21')]);}_0x3d0ed0[_0x0798('0x3d')]=qs[_0x0798('0x3e')](_0x12c9b0[_0x0798('0x35')]['sort']);_0x3d0ed0[_0x0798('0x3f')]=qs['filters'](_[_0x0798('0x40')](_0x12c9b0[_0x0798('0x35')],_0x5e6777['filters']),_0x367dbd);if(_0x12c9b0[_0x0798('0x35')][_0x0798('0x41')]){_0x3d0ed0[_0x0798('0x3f')]=_[_0x0798('0x42')](_0x3d0ed0['where'],{'$or':_['map'](_0x367dbd,function(_0x5a877e){if(_0x5a877e[_0x0798('0x31')]!==_0x0798('0x43')){var _0x13b657={};_0x13b657[_0x5a877e[_0x0798('0x2b')]]={'$like':'%'+_0x12c9b0[_0x0798('0x35')][_0x0798('0x41')]+'%'};return _0x13b657;}})});}_0x3d0ed0=_[_0x0798('0x42')]({},_0x3d0ed0,_0x12c9b0['options']);var _0x13fad0={'where':_0x3d0ed0[_0x0798('0x3f')]};return db['CmCustomField'][_0x0798('0x24')](_0x13fad0)[_0x0798('0x28')](function(_0x542482){_0x50446d[_0x0798('0x24')]=_0x542482;if(_0x12c9b0[_0x0798('0x35')][_0x0798('0x44')]){_0x3d0ed0[_0x0798('0x45')]=[{'all':!![]}];}return db['CmCustomField'][_0x0798('0x46')](_0x3d0ed0);})[_0x0798('0x28')](function(_0x57fcd5){_0x50446d[_0x0798('0x47')]=_0x57fcd5;return _0x50446d;})['then'](respondWithFilteredResult(_0x41f784,_0x3d0ed0))[_0x0798('0x48')](handleError(_0x41f784,null));};exports[_0x0798('0x49')]=function(_0x2b20b8,_0x3c329c){var _0x20b0c6={'raw':!![],'where':{'id':_0x2b20b8[_0x0798('0x4a')]['id']}},_0x4a2b05={};_0x4a2b05[_0x0798('0x33')]=_[_0x0798('0x36')](db[_0x0798('0x2e')][_0x0798('0x2f')]);_0x4a2b05[_0x0798('0x35')]=_[_0x0798('0x36')](_0x2b20b8['query']);_0x4a2b05['filters']=_[_0x0798('0x38')](_0x4a2b05[_0x0798('0x33')],_0x4a2b05[_0x0798('0x35')]);_0x20b0c6[_0x0798('0x39')]=_[_0x0798('0x38')](_0x4a2b05[_0x0798('0x33')],qs[_0x0798('0x3a')](_0x2b20b8[_0x0798('0x35')][_0x0798('0x3a')]));_0x20b0c6[_0x0798('0x39')]=_0x20b0c6[_0x0798('0x39')][_0x0798('0x3b')]?_0x20b0c6['attributes']:_0x4a2b05[_0x0798('0x33')];if(_0x2b20b8[_0x0798('0x35')][_0x0798('0x44')]){_0x20b0c6[_0x0798('0x45')]=[{'all':!![]}];}_0x20b0c6=_[_0x0798('0x42')]({},_0x20b0c6,_0x2b20b8[_0x0798('0x4b')]);return db['CmCustomField'][_0x0798('0x4c')](_0x20b0c6)[_0x0798('0x28')](handleEntityNotFound(_0x3c329c,null))[_0x0798('0x28')](respondWithResult(_0x3c329c,null))[_0x0798('0x48')](handleError(_0x3c329c,null));};exports[_0x0798('0x4d')]=function(_0x56930c,_0xd0dee4){if(_0x56930c[_0x0798('0x4e')]['id']){delete _0x56930c[_0x0798('0x4e')]['id'];}return db['CmCustomField'][_0x0798('0x4c')]({'where':{'id':_0x56930c[_0x0798('0x4a')]['id']}})['then'](handleEntityNotFound(_0xd0dee4,null))[_0x0798('0x28')](saveUpdates(_0x56930c[_0x0798('0x4e')],null))[_0x0798('0x28')](respondWithResult(_0xd0dee4,null))[_0x0798('0x48')](handleError(_0xd0dee4,null));};exports['destroy']=function(_0x1c8b3b,_0x5d440e){return db['CmCustomField'][_0x0798('0x4c')]({'where':{'id':_0x1c8b3b[_0x0798('0x4a')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x5d440e,null))[_0x0798('0x28')](removeEntity(_0x5d440e,null))['catch'](handleError(_0x5d440e,null));};exports[_0x0798('0x4f')]=function(_0x23d5ac,_0x4be4bd){var _0x47905c;return db[_0x0798('0x50')][_0x0798('0x51')](function(_0x57d8a3){return db['CmCustomField'][_0x0798('0x4f')](_0x23d5ac[_0x0798('0x4e')],{'transaction':_0x57d8a3})['then'](function(_0x433b5b){_0x47905c=_0x433b5b;var _0xa124e3={'type':db[_0x0798('0x52')][_0x0798('0x53')],'transaction':_0x57d8a3};switch(_0x23d5ac[_0x0798('0x4e')]['type']){case'text':_0xa124e3[_0x0798('0x31')]=db[_0x0798('0x52')][_0x0798('0x53')];break;case'number':_0xa124e3[_0x0798('0x31')]=db[_0x0798('0x52')]['INTEGER'];break;case _0x0798('0x54'):_0xa124e3['type']=db[_0x0798('0x52')][_0x0798('0x55')];_0xa124e3[_0x0798('0x56')]=![];break;default:}return db[_0x0798('0x50')][_0x0798('0x57')][_0x0798('0x58')](_0x0798('0x59'),util[_0x0798('0x5a')](_0x0798('0x5b'),_0x47905c['id']),_0xa124e3);})['then'](function(){return _0x47905c;});})[_0x0798('0x28')](respondWithResult(_0x4be4bd,0xc9))[_0x0798('0x48')](handleError(_0x4be4bd,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 8638547..7392e70 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 _0xe964=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','lodash'];(function(_0x5d62b4,_0x4cebf2){var _0x422b39=function(_0x1ca6b1){while(--_0x1ca6b1){_0x5d62b4['push'](_0x5d62b4['shift']());}};_0x422b39(++_0x4cebf2);}(_0xe964,0x171));var _0x4e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe964[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e96('0x0'));var util=require(_0x4e96('0x1'));var logger=require(_0x4e96('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e96('0x4'));var rimraf=require(_0x4e96('0x5'));var config=require(_0x4e96('0x6'));var attributes=require(_0x4e96('0x7'));module['exports']=function(_0x318475,_0x2bf961){return _0x318475[_0x4e96('0x8')](_0x4e96('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bbf=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','CmCustomField','lodash'];(function(_0x1c98e9,_0x2b2d9f){var _0x538c36=function(_0x3b48a7){while(--_0x3b48a7){_0x1c98e9['push'](_0x1c98e9['shift']());}};_0x538c36(++_0x2b2d9f);}(_0x0bbf,0x133));var _0xf0bb=function(_0x55c965,_0x566c86){_0x55c965=_0x55c965-0x0;var _0x49f655=_0x0bbf[_0x55c965];return _0x49f655;};'use strict';var _=require(_0xf0bb('0x0'));var util=require(_0xf0bb('0x1'));var logger=require(_0xf0bb('0x2'))(_0xf0bb('0x3'));var moment=require(_0xf0bb('0x4'));var BPromise=require('bluebird');var rp=require(_0xf0bb('0x5'));var fs=require('fs');var path=require(_0xf0bb('0x6'));var rimraf=require(_0xf0bb('0x7'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xf0bb('0x8')]=function(_0x4bbd78,_0x110a50){return _0x4bbd78[_0xf0bb('0x9')](_0xf0bb('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 330c437..d7fbc5e 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 _0xcd40=['request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4c1bea,_0x12d194){var _0x5b771e=function(_0x70eaca){while(--_0x70eaca){_0x4c1bea['push'](_0x4c1bea['shift']());}};_0x5b771e(++_0x12d194);}(_0xcd40,0x198));var _0x0cd4=function(_0x4e7490,_0x4b26ae){_0x4e7490=_0x4e7490-0x0;var _0x3622d0=_0xcd40[_0x4e7490];return _0x3622d0;};'use strict';var _=require(_0x0cd4('0x0'));var util=require(_0x0cd4('0x1'));var moment=require(_0x0cd4('0x2'));var BPromise=require('bluebird');var rs=require(_0x0cd4('0x3'));var fs=require('fs');var Redis=require(_0x0cd4('0x4'));var db=require(_0x0cd4('0x5'))['db'];var utils=require(_0x0cd4('0x6'));var logger=require(_0x0cd4('0x7'))(_0x0cd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x0cd4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cc749,_0x36d6b6,_0x5234dc){return new BPromise(function(_0x299109,_0x5d8e89){return client[_0x0cd4('0xa')](_0x2cc749,_0x5234dc)[_0x0cd4('0xb')](function(_0x10c2ae){logger[_0x0cd4('0xc')]('CmCustomField,\x20%s,\x20%s',_0x36d6b6,_0x0cd4('0xd'));logger[_0x0cd4('0xe')](_0x0cd4('0xf'),_0x36d6b6,'request\x20sent',JSON[_0x0cd4('0x10')](_0x10c2ae));if(_0x10c2ae[_0x0cd4('0x11')]){if(_0x10c2ae[_0x0cd4('0x11')][_0x0cd4('0x12')]===0x1f4){logger[_0x0cd4('0x11')](_0x0cd4('0x13'),_0x36d6b6,_0x10c2ae['error'][_0x0cd4('0x14')]);return _0x5d8e89(_0x10c2ae[_0x0cd4('0x11')]['message']);}logger[_0x0cd4('0x11')]('CmCustomField,\x20%s,\x20%s',_0x36d6b6,_0x10c2ae[_0x0cd4('0x11')][_0x0cd4('0x14')]);return _0x299109(_0x10c2ae[_0x0cd4('0x11')]['message']);}else{logger[_0x0cd4('0xc')]('CmCustomField,\x20%s,\x20%s',_0x36d6b6,'request\x20sent');_0x299109(_0x10c2ae['result'][_0x0cd4('0x14')]);}})[_0x0cd4('0x15')](function(_0x40aa4d){logger[_0x0cd4('0x11')](_0x0cd4('0x13'),_0x36d6b6,_0x40aa4d);_0x5d8e89(_0x40aa4d);});});} \ No newline at end of file +var _0x4654=['stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x3bf704,_0x2bd54b){var _0x3fa44a=function(_0x510bc7){while(--_0x510bc7){_0x3bf704['push'](_0x3bf704['shift']());}};_0x3fa44a(++_0x2bd54b);}(_0x4654,0xd6));var _0x4465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4654[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4465('0x0'));var util=require(_0x4465('0x1'));var moment=require(_0x4465('0x2'));var BPromise=require('bluebird');var rs=require(_0x4465('0x3'));var fs=require('fs');var Redis=require(_0x4465('0x4'));var db=require(_0x4465('0x5'))['db'];var utils=require(_0x4465('0x6'));var logger=require(_0x4465('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4465('0x8'));var client=jayson['client'][_0x4465('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ef5c3,_0x3d2a8b,_0x3dcda6){return new BPromise(function(_0x20127a,_0xd5a1){return client[_0x4465('0xa')](_0x3ef5c3,_0x3dcda6)[_0x4465('0xb')](function(_0x3fe7f9){logger[_0x4465('0xc')]('CmCustomField,\x20%s,\x20%s',_0x3d2a8b,_0x4465('0xd'));logger[_0x4465('0xe')](_0x4465('0xf'),_0x3d2a8b,_0x4465('0xd'),JSON[_0x4465('0x10')](_0x3fe7f9));if(_0x3fe7f9[_0x4465('0x11')]){if(_0x3fe7f9[_0x4465('0x11')][_0x4465('0x12')]===0x1f4){logger[_0x4465('0x11')]('CmCustomField,\x20%s,\x20%s',_0x3d2a8b,_0x3fe7f9[_0x4465('0x11')]['message']);return _0xd5a1(_0x3fe7f9[_0x4465('0x11')]['message']);}logger['error'](_0x4465('0x13'),_0x3d2a8b,_0x3fe7f9['error']['message']);return _0x20127a(_0x3fe7f9[_0x4465('0x11')][_0x4465('0x14')]);}else{logger[_0x4465('0xc')]('CmCustomField,\x20%s,\x20%s',_0x3d2a8b,_0x4465('0xd'));_0x20127a(_0x3fe7f9[_0x4465('0x15')]['message']);}})[_0x4465('0x16')](function(_0x1ac353){logger[_0x4465('0x11')]('CmCustomField,\x20%s,\x20%s',_0x3d2a8b,_0x1ac353);_0xd5a1(_0x1ac353);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 9dff534..374a185 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 _0xd0e7=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','index'];(function(_0x1b2534,_0xde4d1b){var _0x7e677d=function(_0x5cf75a){while(--_0x5cf75a){_0x1b2534['push'](_0x1b2534['shift']());}};_0x7e677d(++_0xde4d1b);}(_0xd0e7,0x10d));var _0x7d0e=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xd0e7[_0x3b5049];return _0x12454e;};'use strict';var multer=require(_0x7d0e('0x0'));var util=require(_0x7d0e('0x1'));var path=require(_0x7d0e('0x2'));var timeout=require(_0x7d0e('0x3'));var express=require('express');var router=express[_0x7d0e('0x4')]();var fs_extra=require(_0x7d0e('0x5'));var auth=require(_0x7d0e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d0e('0x7'));router[_0x7d0e('0x8')]('/',auth[_0x7d0e('0x9')](),controller[_0x7d0e('0xa')]);router[_0x7d0e('0x8')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0xc')]);router[_0x7d0e('0xd')]('/',auth[_0x7d0e('0x9')](),controller[_0x7d0e('0xe')]);router[_0x7d0e('0xf')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0x10')]);router[_0x7d0e('0x11')](_0x7d0e('0xb'),auth['isAuthenticated'](),controller[_0x7d0e('0x12')]);module[_0x7d0e('0x13')]=router; \ No newline at end of file +var _0x23ea=['/:id','show','create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x23ea,0xc3));var _0xa23e=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0x23ea[_0x5b4615];return _0x44eb78;};'use strict';var multer=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var path=require(_0xa23e('0x2'));var timeout=require(_0xa23e('0x3'));var express=require(_0xa23e('0x4'));var router=express[_0xa23e('0x5')]();var fs_extra=require(_0xa23e('0x6'));var auth=require(_0xa23e('0x7'));var interaction=require(_0xa23e('0x8'));var config=require(_0xa23e('0x9'));var controller=require(_0xa23e('0xa'));router['get']('/',auth[_0xa23e('0xb')](),controller[_0xa23e('0xc')]);router[_0xa23e('0xd')](_0xa23e('0xe'),auth[_0xa23e('0xb')](),controller[_0xa23e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa23e('0x10')]);router[_0xa23e('0x11')](_0xa23e('0xe'),auth[_0xa23e('0xb')](),controller['update']);router['delete'](_0xa23e('0xe'),auth[_0xa23e('0xb')](),controller['destroy']);module[_0xa23e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 57f050e..ada6eb0 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 _0xc8ee=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0xc8ee,0x189));var _0xec8e=function(_0x430cc5,_0x3b598d){_0x430cc5=_0x430cc5-0x0;var _0x3868f2=_0xc8ee[_0x430cc5];return _0x3868f2;};'use strict';var moment=require(_0xec8e('0x0'));var Sequelize=require(_0xec8e('0x1'));module[_0xec8e('0x2')]={'phone':{'type':Sequelize[_0xec8e('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xec8e('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xec8e('0x5')],'defaultValue':moment()[_0xec8e('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xec8e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xec8e('0x5')]},'priority':{'type':Sequelize[_0xec8e('0x7')](0x2)[_0xec8e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xec8e('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xec8e('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xec8e('0x7')],'unique':_0xec8e('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xec8e('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xec8e('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xec8e('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xec8e('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xec8e('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xec8e('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd1f2=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','contactListQueue','moment','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd1f2,0x130));var _0x2d1f=function(_0x516faa,_0x8e21b7){_0x516faa=_0x516faa-0x0;var _0x108ad3=_0xd1f2[_0x516faa];return _0x108ad3;};'use strict';var moment=require(_0x2d1f('0x0'));var Sequelize=require(_0x2d1f('0x1'));module[_0x2d1f('0x2')]={'phone':{'type':Sequelize[_0x2d1f('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2d1f('0x4')],'defaultValue':moment()['format'](_0x2d1f('0x5'))},'countbusyretry':{'type':Sequelize[_0x2d1f('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2d1f('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2d1f('0x4')]},'priority':{'type':Sequelize[_0x2d1f('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2d1f('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x2d1f('0x6')],'unique':_0x2d1f('0x8')},'UserId':{'type':Sequelize[_0x2d1f('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x2d1f('0x6')],'unique':_0x2d1f('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2d1f('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2d1f('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2d1f('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 935f275..f1c8240 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 _0x798f=['save','then','destroy','error','name','send','index','map','CmHopper','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$or','$gt','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','VoiceQueueId','Campaign','CampaignId','omit','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','describe','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','update','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject'];(function(_0x391a63,_0xadaf18){var _0x1ea8f6=function(_0x283a7d){while(--_0x283a7d){_0x391a63['push'](_0x391a63['shift']());}};_0x1ea8f6(++_0xadaf18);}(_0x798f,0x1a2));var _0xf798=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x798f[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xf798('0x0'));var rimraf=require(_0xf798('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf798('0x2'));var rp=require(_0xf798('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf798('0x4'));var util=require(_0xf798('0x5'));var path=require(_0xf798('0x6'));var sox=require(_0xf798('0x7'));var csv=require('to-csv');var ejs=require(_0xf798('0x8'));var fs=require('fs');var fs_extra=require(_0xf798('0x9'));var _=require(_0xf798('0xa'));var squel=require(_0xf798('0xb'));var crypto=require('crypto');var jsforce=require(_0xf798('0xc'));var deskjs=require(_0xf798('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf798('0xe'));var Papa=require(_0xf798('0xf'));var Redis=require(_0xf798('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf798('0x11'));var as=require(_0xf798('0x12'));var hardwareService=require(_0xf798('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf798('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34742d,_0x131595){_0x131595=_0x131595||0xcc;return function(_0x498969){if(_0x498969){return _0x34742d[_0xf798('0x15')](_0x131595);}return _0x34742d[_0xf798('0x16')](_0x131595)[_0xf798('0x17')]();};}function respondWithResult(_0x10b581,_0x4a7e59){_0x4a7e59=_0x4a7e59||0xc8;return function(_0x5a3f1b){if(_0x5a3f1b){return _0x10b581[_0xf798('0x16')](_0x4a7e59)[_0xf798('0x18')](_0x5a3f1b);}};}function respondWithFilteredResult(_0x4577e1,_0x332b01){return function(_0x17668e){if(_0x17668e){var _0x4264ef=typeof _0x332b01[_0xf798('0x19')]==='undefined'&&typeof _0x332b01['limit']===_0xf798('0x1a');var _0x24a3b5=_0x17668e[_0xf798('0x1b')];var _0x3b4c7c=_0x4264ef?0x0:_0x332b01[_0xf798('0x19')];var _0x18450a=_0x4264ef?_0x17668e[_0xf798('0x1b')]:_0x332b01[_0xf798('0x19')]+_0x332b01[_0xf798('0x1c')];var _0x468502;if(_0x18450a>=_0x24a3b5){_0x18450a=_0x24a3b5;_0x468502=0xc8;}else{_0x468502=0xce;}_0x4577e1[_0xf798('0x16')](_0x468502);return _0x4577e1[_0xf798('0x1d')](_0xf798('0x1e'),_0x3b4c7c+'-'+_0x18450a+'/'+_0x24a3b5)[_0xf798('0x18')](_0x17668e);}return null;};}function patchUpdates(_0x333bad){return function(_0x3db60d){try{jsonpatch['apply'](_0x3db60d,_0x333bad,!![]);}catch(_0x510a9f){return BPromise[_0xf798('0x1f')](_0x510a9f);}return _0x3db60d[_0xf798('0x20')]();};}function saveUpdates(_0x12e781,_0x46f302){return function(_0x31e257){if(_0x31e257){return _0x31e257['update'](_0x12e781)[_0xf798('0x21')](function(_0x56ad82){return _0x56ad82;});}return null;};}function removeEntity(_0x4d9f0e,_0x3336df){return function(_0x568f93){if(_0x568f93){return _0x568f93[_0xf798('0x22')]()['then'](function(){_0x4d9f0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8ae7bf,_0x2d2619){return function(_0x2bfd80){if(!_0x2bfd80){_0x8ae7bf[_0xf798('0x15')](0x194);}return _0x2bfd80;};}function handleError(_0x37cc57,_0x4e903c){_0x4e903c=_0x4e903c||0x1f4;return function(_0x4d7331){logger[_0xf798('0x23')](_0x4d7331['stack']);if(_0x4d7331[_0xf798('0x24')]){delete _0x4d7331[_0xf798('0x24')];}_0x37cc57['status'](_0x4e903c)[_0xf798('0x25')](_0x4d7331);};}exports[_0xf798('0x26')]=function(_0x44a493,_0x2ebd32){var _0x377b17={},_0x14ab30={},_0x5c6929={'count':0x0,'rows':[]};var _0x1134ea=_[_0xf798('0x27')](db[_0xf798('0x28')]['rawAttributes'],function(_0x26993b){return{'name':_0x26993b[_0xf798('0x29')],'type':_0x26993b[_0xf798('0x2a')][_0xf798('0x2b')]};});_0x14ab30[_0xf798('0x2c')]=_[_0xf798('0x27')](_0x1134ea,'name');_0x14ab30['query']=_[_0xf798('0x2d')](_0x44a493[_0xf798('0x2e')]);_0x14ab30[_0xf798('0x2f')]=_[_0xf798('0x30')](_0x14ab30['model'],_0x14ab30[_0xf798('0x2e')]);_0x14ab30['filters']=_[_0xf798('0x31')](_0x14ab30['filters'],[_0xf798('0x32'),_0xf798('0x33'),_0xf798('0x34'),'$gte',_0xf798('0x35'),'$lte','$ne',_0xf798('0x36'),_0xf798('0x37'),_0xf798('0x38'),_0xf798('0x39'),_0xf798('0x3a'),_0xf798('0x3b'),_0xf798('0x3c'),_0xf798('0x3d'),_0xf798('0x3e'),_0xf798('0x3f'),_0xf798('0x3c'),_0xf798('0x40'),_0xf798('0x41'),_0xf798('0x42'),_0xf798('0x43')]);_0x377b17[_0xf798('0x44')]=_[_0xf798('0x30')](_0x14ab30[_0xf798('0x2c')],qs[_0xf798('0x45')](_0x44a493['query'][_0xf798('0x45')]));_0x377b17[_0xf798('0x44')]=_0x377b17['attributes']['length']?_0x377b17[_0xf798('0x44')]:_0x14ab30[_0xf798('0x2c')];if(!_0x44a493[_0xf798('0x2e')][_0xf798('0x46')](_0xf798('0x47'))){_0x377b17[_0xf798('0x1c')]=qs['limit'](_0x44a493['query']['limit']);_0x377b17[_0xf798('0x19')]=qs[_0xf798('0x19')](_0x44a493['query']['offset']);}_0x377b17[_0xf798('0x48')]=qs[_0xf798('0x49')](_0x44a493[_0xf798('0x2e')][_0xf798('0x49')]);_0x377b17['where']=qs[_0xf798('0x2f')](_[_0xf798('0x4a')](_0x44a493[_0xf798('0x2e')],_0x14ab30['filters']),_0x1134ea);if(_0x44a493[_0xf798('0x2e')][_0xf798('0x4b')]){_0x377b17[_0xf798('0x4c')]=_[_0xf798('0x4d')](_0x377b17[_0xf798('0x4c')],{'$or':_['map'](_0x1134ea,function(_0x43ef01){if(_0x43ef01[_0xf798('0x2a')]!==_0xf798('0x4e')){var _0x48f905={};_0x48f905[_0x43ef01[_0xf798('0x24')]]={'$like':'%'+_0x44a493['query'][_0xf798('0x4b')]+'%'};return _0x48f905;}})});}_0x377b17=_[_0xf798('0x4d')]({},_0x377b17,_0x44a493[_0xf798('0x4f')]);var _0x2155ef={'where':_0x377b17[_0xf798('0x4c')]};return db[_0xf798('0x28')][_0xf798('0x1b')](_0x2155ef)[_0xf798('0x21')](function(_0x13a7b5){_0x5c6929[_0xf798('0x1b')]=_0x13a7b5;if(_0x44a493['query'][_0xf798('0x50')]){_0x377b17[_0xf798('0x51')]=[{'all':!![]}];}return db['CmHopper'][_0xf798('0x52')](_0x377b17);})[_0xf798('0x21')](function(_0x487d30){_0x5c6929[_0xf798('0x53')]=_0x487d30;return _0x5c6929;})[_0xf798('0x21')](respondWithFilteredResult(_0x2ebd32,_0x377b17))[_0xf798('0x54')](handleError(_0x2ebd32,null));};exports[_0xf798('0x55')]=function(_0x270fa7,_0x101e45){var _0x57fba9={'raw':!![],'where':{'id':_0x270fa7['params']['id']}},_0x5427f8={};_0x5427f8[_0xf798('0x2c')]=_['keys'](db['CmHopper'][_0xf798('0x56')]);_0x5427f8[_0xf798('0x2e')]=_['keys'](_0x270fa7['query']);_0x5427f8[_0xf798('0x2f')]=_[_0xf798('0x30')](_0x5427f8[_0xf798('0x2c')],_0x5427f8[_0xf798('0x2e')]);_0x57fba9[_0xf798('0x44')]=_['intersection'](_0x5427f8[_0xf798('0x2c')],qs[_0xf798('0x45')](_0x270fa7[_0xf798('0x2e')][_0xf798('0x45')]));_0x57fba9[_0xf798('0x44')]=_0x57fba9['attributes'][_0xf798('0x57')]?_0x57fba9['attributes']:_0x5427f8[_0xf798('0x2c')];if(_0x270fa7[_0xf798('0x2e')][_0xf798('0x50')]){_0x57fba9[_0xf798('0x51')]=[{'all':!![]}];}_0x57fba9=_[_0xf798('0x4d')]({},_0x57fba9,_0x270fa7['options']);return db[_0xf798('0x28')][_0xf798('0x58')](_0x57fba9)[_0xf798('0x21')](handleEntityNotFound(_0x101e45,null))[_0xf798('0x21')](respondWithResult(_0x101e45,null))[_0xf798('0x54')](handleError(_0x101e45,null));};exports[_0xf798('0x59')]=function(_0xb02ce,_0x1934d2){return db['CmHopper']['create'](_0xb02ce[_0xf798('0x5a')],{})[_0xf798('0x21')](respondWithResult(_0x1934d2,0xc9))[_0xf798('0x54')](handleError(_0x1934d2,null));};exports['update']=function(_0x1b7987,_0x594b06){if(_0x1b7987[_0xf798('0x5a')]['id']){delete _0x1b7987[_0xf798('0x5a')]['id'];}return db['CmHopper'][_0xf798('0x58')]({'where':{'id':_0x1b7987[_0xf798('0x5b')]['id']}})[_0xf798('0x21')](handleEntityNotFound(_0x594b06,null))[_0xf798('0x21')](saveUpdates(_0x1b7987['body'],null))[_0xf798('0x21')](respondWithResult(_0x594b06,null))[_0xf798('0x54')](handleError(_0x594b06,null));};exports['describe']=function(_0x364623,_0xdc2e30){return db[_0xf798('0x28')]['describe']()[_0xf798('0x21')](respondWithResult(_0xdc2e30,null))[_0xf798('0x54')](handleError(_0xdc2e30,null));};exports[_0xf798('0x22')]=function(_0x34c8de,_0x38af31){var _0x27b2ed;return db['CmHopper']['find']({'where':{'id':_0x34c8de[_0xf798('0x5b')]['id']}})[_0xf798('0x21')](handleEntityNotFound(_0x38af31,null))[_0xf798('0x21')](function(_0x3559ac){if(_0x3559ac){return _0x3559ac[_0xf798('0x22')]()['then'](function(_0x59e7d3){return _0x59e7d3;});}})[_0xf798('0x21')](function(_0x3c0e2e){_0x27b2ed=_0x3c0e2e;if(_0x3c0e2e){if(_0x3c0e2e[_0xf798('0x5c')]||_0x3c0e2e['CampaignId']){return db[_0x3c0e2e[_0xf798('0x5c')]?'VoiceQueue':_0xf798('0x5d')][_0xf798('0x58')]({'where':{'id':_0x3c0e2e[_0xf798('0x5c')]?_0x3c0e2e[_0xf798('0x5c')]:_0x3c0e2e[_0xf798('0x5e')]},'attributes':['id',_0xf798('0x24')],'raw':!![]});}}})[_0xf798('0x21')](function(_0x104080){var _0x3721be={};if(_0x104080){_[_0xf798('0x4d')](_0x3721be,_[_0xf798('0x5f')](_0x27b2ed['dataValues'],['createdAt',_0xf798('0x60'),'id']));_0x3721be['state']=0x15;_0x3721be[_0xf798('0x61')]=_0xf798('0x62');_0x3721be[_0xf798('0x63')]=_0x104080[_0xf798('0x24')];_0x3721be[_0xf798('0x64')]=_0x34c8de[_0xf798('0x65')][_0xf798('0x24')];_0x3721be[_0xf798('0x66')]=_0x34c8de[_0xf798('0x65')]['id'];_0x3721be['deleted']=!![];_0x3721be[_0xf798('0x67')]=moment()[_0xf798('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x3721be[_0xf798('0x69')]=_0x27b2ed[_0xf798('0x6a')];_0x3721be['campaigntype']=_0x27b2ed[_0xf798('0x5c')]?'queue':_0xf798('0x6b');return db[_0xf798('0x6c')][_0xf798('0x58')]({'where':{'id':_0x3721be[_0xf798('0x6d')]},'attributes':[_0xf798('0x6e'),_0xf798('0x6f')]})[_0xf798('0x21')](function(_0x4f7399){if(!_[_0xf798('0x70')](_0x38af31)&&!_[_0xf798('0x70')](_0x4f7399[_0xf798('0x6e')])){_0x3721be[_0xf798('0x71')]=_0x4f7399[_0xf798('0x6e')];if(!_[_0xf798('0x70')](_0x4f7399[_0xf798('0x6f')])){_0x3721be[_0xf798('0x71')]+='\x20'+_0x4f7399[_0xf798('0x6f')];}}})[_0xf798('0x72')](function(){return db['CmHopperFinal'][_0xf798('0x59')](_0x3721be);});}})[_0xf798('0x21')](function(){return _0x38af31[_0xf798('0x16')](0xcc)[_0xf798('0x17')]();})[_0xf798('0x54')](handleError(_0x38af31,null));};exports[_0xf798('0x73')]=function(_0x30a8ba,_0x15eeab,_0x342215){var _0x49645c=[];return db[_0xf798('0x6c')][_0xf798('0x74')]()[_0xf798('0x21')](function(_0x826d9b){_0x49645c=_[_0xf798('0x2d')](_0x826d9b);return _0x30a8ba[_0xf798('0x65')][_0xf798('0x75')]({'where':{'type':_0xf798('0x76'),'dialActive':!![],'dialMethod':_0xf798('0x77')},'attributes':['id',_0xf798('0x78')],'raw':!![]});})[_0xf798('0x21')](function(_0x631177){if(_0x631177&&_0x631177[_0xf798('0x57')]){return db[_0xf798('0x79')][_0xf798('0x7a')](function(_0x3b7d63){var _0x1b07f1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf798('0x68')](_0xf798('0x7b'))},'VoiceQueueId':{'$in':_['map'](_0x631177,'id')},'$or':[{'UserId':null},{'UserId':_0x30a8ba['user']['id']}]};var _0x3857db=[];if(_0x30a8ba[_0xf798('0x5a')][_0xf798('0x7c')]&&_0x30a8ba[_0xf798('0x5a')][_0xf798('0x7c')]==='prev'){if(!_['isEmpty'](_0x30a8ba[_0xf798('0x5a')][_0xf798('0x7d')])){_0x1b07f1['id']={'$in':_0x30a8ba[_0xf798('0x5a')][_0xf798('0x7d')]};}_0x3857db=[[_0xf798('0x7e'),_0xf798('0x7f')],[_0xf798('0x80'),_0x631177[0x0]['dialOrderByScheduledAt']===_0xf798('0x7f')?'DESC':_0xf798('0x7f')],db[_0xf798('0x79')][_0xf798('0x81')](_0xf798('0x82')),['id',_0xf798('0x83')]];}else{if(!_[_0xf798('0x84')](_0x30a8ba[_0xf798('0x5a')][_0xf798('0x7d')])){_0x1b07f1['id']={'$notIn':_0x30a8ba['body'][_0xf798('0x7d')]};}_0x3857db=[[_0xf798('0x7e'),_0xf798('0x83')],[_0xf798('0x80'),_0x631177[0x0][_0xf798('0x78')]],db[_0xf798('0x79')][_0xf798('0x81')](_0xf798('0x85')),['id',_0xf798('0x7f')]];}return db['CmHopper'][_0xf798('0x86')]({'attributes':['id',_0xf798('0x87')],'where':_0x1b07f1,'order':_0x3857db,'transaction':_0x3b7d63,'lock':_0x3b7d63[_0xf798('0x88')][_0xf798('0x89')],'include':[{'model':db[_0xf798('0x6c')],'as':_0xf798('0x8a'),'attributes':_0x49645c,'include':[{'model':db[_0xf798('0x8b')],'as':_0xf798('0x8c'),'attributes':['id',_0xf798('0x24')]}]},{'model':db[_0xf798('0x8d')],'as':_0xf798('0x8e'),'attributes':['id',_0xf798('0x24')]},{'model':db[_0xf798('0x8f')],'as':_0xf798('0x90'),'attributes':['id',_0xf798('0x24'),_0xf798('0x91')]}]})[_0xf798('0x21')](function(_0x216d00){if(_0x216d00){return _0x216d00[_0xf798('0x92')]({'UserId':_0x30a8ba['user']['id']},{'transaction':_0x3b7d63});}});});}})[_0xf798('0x21')](handleEntityNotFound(_0x15eeab,null))[_0xf798('0x21')](respondWithResult(_0x15eeab,null))[_0xf798('0x54')](handleError(_0x15eeab,null));};exports['getOpenContacts']=function(_0xa3a8fc,_0x4df37c,_0x10a304){return _0xa3a8fc[_0xf798('0x65')][_0xf798('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf798('0x77')},'attributes':['id'],'raw':!![]})['then'](function(_0x5275d4){if(_0x5275d4&&_0x5275d4['length']){return db[_0xf798('0x28')][_0xf798('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf798('0x68')](_0xf798('0x7b'))},'VoiceQueueId':{'$in':_[_0xf798('0x27')](_0x5275d4,'id')},'$or':[{'UserId':null},{'UserId':_0xa3a8fc[_0xf798('0x65')]['id']}]}});}return 0x0;})[_0xf798('0x21')](function(_0x4faf2e){if(!_[_0xf798('0x70')](_0x4faf2e)&&_[_0xf798('0x93')](_0x4faf2e)){return _0x4df37c[_0xf798('0x16')](0xc8)[_0xf798('0x18')]({'contacts':_0x4faf2e});}else{logger[_0xf798('0x23')](_0xf798('0x94'),_0xf798('0x95'),0x194,'entity\x20not\x20found');_0x4df37c[_0xf798('0x15')](0x194);}})['catch'](handleError(_0x4df37c,null));}; \ No newline at end of file +var _0x5763=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','CmHopper','fieldName','type','model','map','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$any','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','campaign','membername','user','UserId','deleted','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','sequelize','transaction','direction','prev','hopperIds','priority','dialOrderByScheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','moment'];(function(_0x235cf5,_0x4f9883){var _0x94aa28=function(_0x46558e){while(--_0x46558e){_0x235cf5['push'](_0x235cf5['shift']());}};_0x94aa28(++_0x4f9883);}(_0x5763,0x1a9));var _0x3576=function(_0x763102,_0x1854a8){_0x763102=_0x763102-0x0;var _0x1f0e54=_0x5763[_0x763102];return _0x1f0e54;};'use strict';var emlformat=require(_0x3576('0x0'));var rimraf=require(_0x3576('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3576('0x2'));var rp=require('request-promise');var moment=require(_0x3576('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3576('0x4'));var util=require(_0x3576('0x5'));var path=require(_0x3576('0x6'));var sox=require(_0x3576('0x7'));var csv=require(_0x3576('0x8'));var ejs=require(_0x3576('0x9'));var fs=require('fs');var fs_extra=require(_0x3576('0xa'));var _=require('lodash');var squel=require(_0x3576('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3576('0xc'));var toCsv=require(_0x3576('0x8'));var querystring=require(_0x3576('0xd'));var Papa=require('papaparse');var Redis=require(_0x3576('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3576('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3576('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3576('0x11'))['db'];function respondWithStatusCode(_0x1fe151,_0x5b3dbf){_0x5b3dbf=_0x5b3dbf||0xcc;return function(_0x42cf79){if(_0x42cf79){return _0x1fe151[_0x3576('0x12')](_0x5b3dbf);}return _0x1fe151[_0x3576('0x13')](_0x5b3dbf)[_0x3576('0x14')]();};}function respondWithResult(_0xe08ebb,_0x81e907){_0x81e907=_0x81e907||0xc8;return function(_0x450ac5){if(_0x450ac5){return _0xe08ebb[_0x3576('0x13')](_0x81e907)[_0x3576('0x15')](_0x450ac5);}};}function respondWithFilteredResult(_0x26296d,_0x182a07){return function(_0x5ad802){if(_0x5ad802){var _0x53ee08=typeof _0x182a07[_0x3576('0x16')]==='undefined'&&typeof _0x182a07[_0x3576('0x17')]===_0x3576('0x18');var _0x457081=_0x5ad802['count'];var _0x176752=_0x53ee08?0x0:_0x182a07[_0x3576('0x16')];var _0x4cc43a=_0x53ee08?_0x5ad802['count']:_0x182a07[_0x3576('0x16')]+_0x182a07[_0x3576('0x17')];var _0x14e480;if(_0x4cc43a>=_0x457081){_0x4cc43a=_0x457081;_0x14e480=0xc8;}else{_0x14e480=0xce;}_0x26296d[_0x3576('0x13')](_0x14e480);return _0x26296d[_0x3576('0x19')](_0x3576('0x1a'),_0x176752+'-'+_0x4cc43a+'/'+_0x457081)['json'](_0x5ad802);}return null;};}function patchUpdates(_0x23a9cf){return function(_0x46295f){try{jsonpatch[_0x3576('0x1b')](_0x46295f,_0x23a9cf,!![]);}catch(_0x3d3dee){return BPromise[_0x3576('0x1c')](_0x3d3dee);}return _0x46295f[_0x3576('0x1d')]();};}function saveUpdates(_0x124ba8,_0x46ee15){return function(_0x1d00ff){if(_0x1d00ff){return _0x1d00ff[_0x3576('0x1e')](_0x124ba8)['then'](function(_0x4024b5){return _0x4024b5;});}return null;};}function removeEntity(_0x15c52b,_0xae085){return function(_0x392d5b){if(_0x392d5b){return _0x392d5b[_0x3576('0x1f')]()[_0x3576('0x20')](function(){_0x15c52b[_0x3576('0x13')](0xcc)[_0x3576('0x14')]();});}};}function handleEntityNotFound(_0x36242b,_0x5f071a){return function(_0x3c399a){if(!_0x3c399a){_0x36242b[_0x3576('0x12')](0x194);}return _0x3c399a;};}function handleError(_0x2af0be,_0x1f0347){_0x1f0347=_0x1f0347||0x1f4;return function(_0x446b5b){logger[_0x3576('0x21')](_0x446b5b[_0x3576('0x22')]);if(_0x446b5b[_0x3576('0x23')]){delete _0x446b5b[_0x3576('0x23')];}_0x2af0be[_0x3576('0x13')](_0x1f0347)[_0x3576('0x24')](_0x446b5b);};}exports['index']=function(_0x208dbc,_0x5d4f94){var _0x1272ef={},_0x251df1={},_0x3951fd={'count':0x0,'rows':[]};var _0x5977f7=_['map'](db[_0x3576('0x25')]['rawAttributes'],function(_0xf6afae){return{'name':_0xf6afae[_0x3576('0x26')],'type':_0xf6afae[_0x3576('0x27')]['key']};});_0x251df1[_0x3576('0x28')]=_[_0x3576('0x29')](_0x5977f7,_0x3576('0x23'));_0x251df1[_0x3576('0x2a')]=_[_0x3576('0x2b')](_0x208dbc['query']);_0x251df1[_0x3576('0x2c')]=_[_0x3576('0x2d')](_0x251df1['model'],_0x251df1['query']);_0x251df1[_0x3576('0x2c')]=_[_0x3576('0x2e')](_0x251df1[_0x3576('0x2c')],[_0x3576('0x2f'),_0x3576('0x30'),_0x3576('0x31'),_0x3576('0x32'),_0x3576('0x33'),'$lte',_0x3576('0x34'),_0x3576('0x35'),_0x3576('0x36'),'$between',_0x3576('0x37'),_0x3576('0x38'),_0x3576('0x39'),'$like',_0x3576('0x3a'),'$iLike',_0x3576('0x3b'),_0x3576('0x3c'),_0x3576('0x3d'),_0x3576('0x3e'),'$contained',_0x3576('0x3f')]);_0x1272ef['attributes']=_[_0x3576('0x2d')](_0x251df1[_0x3576('0x28')],qs[_0x3576('0x40')](_0x208dbc[_0x3576('0x2a')][_0x3576('0x40')]));_0x1272ef[_0x3576('0x41')]=_0x1272ef['attributes']['length']?_0x1272ef[_0x3576('0x41')]:_0x251df1[_0x3576('0x28')];if(!_0x208dbc['query'][_0x3576('0x42')](_0x3576('0x43'))){_0x1272ef['limit']=qs[_0x3576('0x17')](_0x208dbc['query'][_0x3576('0x17')]);_0x1272ef['offset']=qs['offset'](_0x208dbc['query']['offset']);}_0x1272ef['order']=qs[_0x3576('0x44')](_0x208dbc[_0x3576('0x2a')][_0x3576('0x44')]);_0x1272ef[_0x3576('0x45')]=qs[_0x3576('0x2c')](_['pick'](_0x208dbc[_0x3576('0x2a')],_0x251df1[_0x3576('0x2c')]),_0x5977f7);if(_0x208dbc['query'][_0x3576('0x46')]){_0x1272ef[_0x3576('0x45')]=_['merge'](_0x1272ef[_0x3576('0x45')],{'$or':_[_0x3576('0x29')](_0x5977f7,function(_0x115d37){if(_0x115d37[_0x3576('0x27')]!==_0x3576('0x47')){var _0x5acef1={};_0x5acef1[_0x115d37[_0x3576('0x23')]]={'$like':'%'+_0x208dbc['query']['filter']+'%'};return _0x5acef1;}})});}_0x1272ef=_[_0x3576('0x48')]({},_0x1272ef,_0x208dbc['options']);var _0x371df1={'where':_0x1272ef['where']};return db[_0x3576('0x25')][_0x3576('0x49')](_0x371df1)[_0x3576('0x20')](function(_0x5b38a3){_0x3951fd[_0x3576('0x49')]=_0x5b38a3;if(_0x208dbc['query'][_0x3576('0x4a')]){_0x1272ef[_0x3576('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0x3576('0x4c')](_0x1272ef);})[_0x3576('0x20')](function(_0x3688c1){_0x3951fd['rows']=_0x3688c1;return _0x3951fd;})[_0x3576('0x20')](respondWithFilteredResult(_0x5d4f94,_0x1272ef))[_0x3576('0x4d')](handleError(_0x5d4f94,null));};exports[_0x3576('0x4e')]=function(_0x26b5fb,_0x23eb76){var _0x10a560={'raw':!![],'where':{'id':_0x26b5fb[_0x3576('0x4f')]['id']}},_0xdeb62e={};_0xdeb62e[_0x3576('0x28')]=_['keys'](db[_0x3576('0x25')][_0x3576('0x50')]);_0xdeb62e[_0x3576('0x2a')]=_[_0x3576('0x2b')](_0x26b5fb['query']);_0xdeb62e[_0x3576('0x2c')]=_['intersection'](_0xdeb62e[_0x3576('0x28')],_0xdeb62e['query']);_0x10a560[_0x3576('0x41')]=_[_0x3576('0x2d')](_0xdeb62e[_0x3576('0x28')],qs[_0x3576('0x40')](_0x26b5fb[_0x3576('0x2a')][_0x3576('0x40')]));_0x10a560['attributes']=_0x10a560['attributes'][_0x3576('0x51')]?_0x10a560['attributes']:_0xdeb62e[_0x3576('0x28')];if(_0x26b5fb[_0x3576('0x2a')][_0x3576('0x4a')]){_0x10a560['include']=[{'all':!![]}];}_0x10a560=_[_0x3576('0x48')]({},_0x10a560,_0x26b5fb['options']);return db[_0x3576('0x25')][_0x3576('0x52')](_0x10a560)[_0x3576('0x20')](handleEntityNotFound(_0x23eb76,null))['then'](respondWithResult(_0x23eb76,null))['catch'](handleError(_0x23eb76,null));};exports['create']=function(_0x30fa1f,_0x1c8e9f){return db[_0x3576('0x25')][_0x3576('0x53')](_0x30fa1f[_0x3576('0x54')],{})[_0x3576('0x20')](respondWithResult(_0x1c8e9f,0xc9))[_0x3576('0x4d')](handleError(_0x1c8e9f,null));};exports['update']=function(_0xa80be6,_0x33e8d9){if(_0xa80be6[_0x3576('0x54')]['id']){delete _0xa80be6[_0x3576('0x54')]['id'];}return db[_0x3576('0x25')][_0x3576('0x52')]({'where':{'id':_0xa80be6[_0x3576('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33e8d9,null))[_0x3576('0x20')](saveUpdates(_0xa80be6['body'],null))['then'](respondWithResult(_0x33e8d9,null))[_0x3576('0x4d')](handleError(_0x33e8d9,null));};exports['describe']=function(_0x284ccc,_0x566cd8){return db['CmHopper'][_0x3576('0x55')]()[_0x3576('0x20')](respondWithResult(_0x566cd8,null))[_0x3576('0x4d')](handleError(_0x566cd8,null));};exports['destroy']=function(_0x5155a3,_0x58f984){var _0x319f9e;return db[_0x3576('0x25')][_0x3576('0x52')]({'where':{'id':_0x5155a3['params']['id']}})['then'](handleEntityNotFound(_0x58f984,null))['then'](function(_0x52408b){if(_0x52408b){return _0x52408b['destroy']()[_0x3576('0x20')](function(_0x32b2e3){return _0x32b2e3;});}})['then'](function(_0x58adeb){_0x319f9e=_0x58adeb;if(_0x58adeb){if(_0x58adeb['VoiceQueueId']||_0x58adeb[_0x3576('0x56')]){return db[_0x58adeb[_0x3576('0x57')]?'VoiceQueue':_0x3576('0x58')][_0x3576('0x52')]({'where':{'id':_0x58adeb[_0x3576('0x57')]?_0x58adeb[_0x3576('0x57')]:_0x58adeb[_0x3576('0x56')]},'attributes':['id',_0x3576('0x23')],'raw':!![]});}}})[_0x3576('0x20')](function(_0xa282e2){var _0x3691dc={};if(_0xa282e2){_[_0x3576('0x48')](_0x3691dc,_[_0x3576('0x59')](_0x319f9e[_0x3576('0x5a')],[_0x3576('0x5b'),_0x3576('0x5c'),'id']));_0x3691dc[_0x3576('0x5d')]=0x15;_0x3691dc['statedesc']='deleted';_0x3691dc[_0x3576('0x5e')]=_0xa282e2[_0x3576('0x23')];_0x3691dc[_0x3576('0x5f')]=_0x5155a3[_0x3576('0x60')][_0x3576('0x23')];_0x3691dc[_0x3576('0x61')]=_0x5155a3[_0x3576('0x60')]['id'];_0x3691dc[_0x3576('0x62')]=!![];_0x3691dc['deletedat']=moment()[_0x3576('0x63')](_0x3576('0x64'));_0x3691dc[_0x3576('0x65')]=_0x319f9e[_0x3576('0x66')];_0x3691dc[_0x3576('0x67')]=_0x319f9e[_0x3576('0x57')]?_0x3576('0x68'):_0x3576('0x69');return db['CmContact'][_0x3576('0x52')]({'where':{'id':_0x3691dc[_0x3576('0x6a')]},'attributes':[_0x3576('0x6b'),_0x3576('0x6c')]})[_0x3576('0x20')](function(_0x438ec5){if(!_[_0x3576('0x6d')](_0x58f984)&&!_[_0x3576('0x6d')](_0x438ec5[_0x3576('0x6b')])){_0x3691dc[_0x3576('0x6e')]=_0x438ec5['firstName'];if(!_['isNil'](_0x438ec5[_0x3576('0x6c')])){_0x3691dc[_0x3576('0x6e')]+='\x20'+_0x438ec5['lastName'];}}})[_0x3576('0x6f')](function(){return db[_0x3576('0x70')]['create'](_0x3691dc);});}})['then'](function(){return _0x58f984[_0x3576('0x13')](0xcc)[_0x3576('0x14')]();})[_0x3576('0x4d')](handleError(_0x58f984,null));};exports[_0x3576('0x71')]=function(_0x219e76,_0x4971be,_0x20fb94){var _0x5ae04b=[];return db['CmContact'][_0x3576('0x55')]()[_0x3576('0x20')](function(_0x345b8c){_0x5ae04b=_[_0x3576('0x2b')](_0x345b8c);return _0x219e76[_0x3576('0x60')][_0x3576('0x72')]({'where':{'type':_0x3576('0x73'),'dialActive':!![],'dialMethod':_0x3576('0x74')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x1ab05d){if(_0x1ab05d&&_0x1ab05d[_0x3576('0x51')]){return db[_0x3576('0x75')][_0x3576('0x76')](function(_0x5bad31){var _0x20ed27={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3576('0x63')](_0x3576('0x64'))},'VoiceQueueId':{'$in':_[_0x3576('0x29')](_0x1ab05d,'id')},'$or':[{'UserId':null},{'UserId':_0x219e76[_0x3576('0x60')]['id']}]};var _0x24f98d=[];if(_0x219e76[_0x3576('0x54')][_0x3576('0x77')]&&_0x219e76[_0x3576('0x54')][_0x3576('0x77')]===_0x3576('0x78')){if(!_['isEmpty'](_0x219e76[_0x3576('0x54')]['hopperIds'])){_0x20ed27['id']={'$in':_0x219e76[_0x3576('0x54')][_0x3576('0x79')]};}_0x24f98d=[[_0x3576('0x7a'),'ASC'],['scheduledAt',_0x1ab05d[0x0][_0x3576('0x7b')]===_0x3576('0x7c')?'DESC':'ASC'],db['sequelize'][_0x3576('0x7d')](_0x3576('0x7e')),['id','DESC']];}else{if(!_[_0x3576('0x7f')](_0x219e76[_0x3576('0x54')]['hopperIds'])){_0x20ed27['id']={'$notIn':_0x219e76[_0x3576('0x54')][_0x3576('0x79')]};}_0x24f98d=[[_0x3576('0x7a'),'DESC'],[_0x3576('0x80'),_0x1ab05d[0x0][_0x3576('0x7b')]],db[_0x3576('0x75')][_0x3576('0x7d')](_0x3576('0x81')),['id','ASC']];}return db[_0x3576('0x25')][_0x3576('0x82')]({'attributes':['id',_0x3576('0x83')],'where':_0x20ed27,'order':_0x24f98d,'transaction':_0x5bad31,'lock':_0x5bad31[_0x3576('0x84')][_0x3576('0x85')],'include':[{'model':db['CmContact'],'as':_0x3576('0x86'),'attributes':_0x5ae04b,'include':[{'model':db[_0x3576('0x87')],'as':_0x3576('0x88'),'attributes':['id',_0x3576('0x23')]}]},{'model':db[_0x3576('0x89')],'as':_0x3576('0x8a'),'attributes':['id',_0x3576('0x23')]},{'model':db[_0x3576('0x8b')],'as':_0x3576('0x8c'),'attributes':['id',_0x3576('0x23'),'dialActive']}]})[_0x3576('0x20')](function(_0x3bf95b){if(_0x3bf95b){return _0x3bf95b[_0x3576('0x1e')]({'UserId':_0x219e76[_0x3576('0x60')]['id']},{'transaction':_0x5bad31});}});});}})[_0x3576('0x20')](handleEntityNotFound(_0x4971be,null))[_0x3576('0x20')](respondWithResult(_0x4971be,null))[_0x3576('0x4d')](handleError(_0x4971be,null));};exports[_0x3576('0x8d')]=function(_0x43c03d,_0x93ebf0,_0x4e6a17){return _0x43c03d[_0x3576('0x60')][_0x3576('0x72')]({'where':{'type':_0x3576('0x73'),'dialActive':!![],'dialMethod':_0x3576('0x74')},'attributes':['id'],'raw':!![]})[_0x3576('0x20')](function(_0x1decab){if(_0x1decab&&_0x1decab[_0x3576('0x51')]){return db[_0x3576('0x25')][_0x3576('0x49')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x1decab,'id')},'$or':[{'UserId':null},{'UserId':_0x43c03d[_0x3576('0x60')]['id']}]}});}return 0x0;})[_0x3576('0x20')](function(_0x402ccb){if(!_[_0x3576('0x6d')](_0x402ccb)&&_['isNumber'](_0x402ccb)){return _0x93ebf0[_0x3576('0x13')](0xc8)[_0x3576('0x15')]({'contacts':_0x402ccb});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x3576('0x8d'),0x194,_0x3576('0x8e'));_0x93ebf0[_0x3576('0x12')](0x194);}})[_0x3576('0x4d')](handleError(_0x93ebf0,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index c3b75b4..f852783 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 _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x25792b,_0x4d4d30){var _0x4a6b65=function(_0x2199d3){while(--_0x2199d3){_0x25792b['push'](_0x25792b['shift']());}};_0x4a6b65(++_0x4d4d30);}(_0x1883,0xab));var _0x3188=function(_0x548ec6,_0x38c2e7){_0x548ec6=_0x548ec6-0x0;var _0x5de15e=_0x1883[_0x548ec6];return _0x5de15e;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['scheduledat','phone','priority','lodash','api','moment','bluebird','request-promise','path','./cmHopper.attributes','CmHopper','cm_hopper'];(function(_0x5de9db,_0x3cded0){var _0x3e8918=function(_0x441250){while(--_0x441250){_0x5de9db['push'](_0x5de9db['shift']());}};_0x3e8918(++_0x3cded0);}(_0x1623,0xab));var _0x3162=function(_0x29085c,_0x2fde79){_0x29085c=_0x29085c-0x0;var _0xe3f406=_0x1623[_0x29085c];return _0xe3f406;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0x9')]},{'name':_0x3162('0xa'),'fields':[_0x3162('0xa')]},{'name':_0x3162('0xb'),'fields':[_0x3162('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index af04a10..13912e5 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 _0x3b6c=['ShowCmHopper','CmHopper','find','CreateCmHopper','create','body','update','limit','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','transaction','findAll','order','UPDATE','keys','User','Agent','name','length','UserId','includes','push','CmHopperFinal','MoveContactManagedDialer','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','describe','LOCK','all','GetContactRecallMe','GetCmHopperPreview','Contact','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','options','raw','where','attributes','include','model','map','GetCmHopper'];(function(_0x2d798d,_0x2115b0){var _0x16dda5=function(_0x8ee0fb){while(--_0x8ee0fb){_0x2d798d['push'](_0x2d798d['shift']());}};_0x16dda5(++_0x2115b0);}(_0x3b6c,0x70));var _0xc3b6=function(_0x55af04,_0x5c92c3){_0x55af04=_0x55af04-0x0;var _0x2fce71=_0x3b6c[_0x55af04];return _0x2fce71;};'use strict';var _=require(_0xc3b6('0x0'));var util=require(_0xc3b6('0x1'));var moment=require('moment');var BPromise=require(_0xc3b6('0x2'));var rs=require(_0xc3b6('0x3'));var fs=require('fs');var Redis=require(_0xc3b6('0x4'));var db=require(_0xc3b6('0x5'))['db'];var utils=require(_0xc3b6('0x6'));var logger=require(_0xc3b6('0x7'))(_0xc3b6('0x8'));var config=require(_0xc3b6('0x9'));var jayson=require(_0xc3b6('0xa'));var client=jayson[_0xc3b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x546d9e,_0x129780,_0x37e788){return new BPromise(function(_0x4a13cb,_0x34cae5){return client['request'](_0x546d9e,_0x37e788)[_0xc3b6('0xc')](function(_0x529da0){logger[_0xc3b6('0xd')](_0xc3b6('0xe'),_0x129780,'request\x20sent');logger[_0xc3b6('0xf')](_0xc3b6('0x10'),_0x129780,_0xc3b6('0x11'),JSON[_0xc3b6('0x12')](_0x529da0));if(_0x529da0['error']){if(_0x529da0['error'][_0xc3b6('0x13')]===0x1f4){logger[_0xc3b6('0x14')](_0xc3b6('0xe'),_0x129780,_0x529da0[_0xc3b6('0x14')][_0xc3b6('0x15')]);return _0x34cae5(_0x529da0[_0xc3b6('0x14')][_0xc3b6('0x15')]);}logger['error'](_0xc3b6('0xe'),_0x129780,_0x529da0[_0xc3b6('0x14')][_0xc3b6('0x15')]);return _0x4a13cb(_0x529da0[_0xc3b6('0x14')][_0xc3b6('0x15')]);}else{logger[_0xc3b6('0xd')](_0xc3b6('0xe'),_0x129780,_0xc3b6('0x11'));_0x4a13cb(_0x529da0[_0xc3b6('0x16')][_0xc3b6('0x15')]);}})[_0xc3b6('0x17')](function(_0x47c058){logger[_0xc3b6('0x14')]('CmHopper,\x20%s,\x20%s',_0x129780,_0x47c058);_0x34cae5(_0x47c058);});});}exports['GetCmHopper']=function(_0x94c5ef){var _0x4bb822=this;return new Promise(function(_0x1a2bcd,_0xf1e3fe){return db['CmHopper']['findAll']({'raw':_0x94c5ef['options']?_0x94c5ef[_0xc3b6('0x18')][_0xc3b6('0x19')]===undefined?!![]:![]:!![],'where':_0x94c5ef[_0xc3b6('0x18')]?_0x94c5ef[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':_0x94c5ef[_0xc3b6('0x18')]?_0x94c5ef[_0xc3b6('0x18')][_0xc3b6('0x1b')]||null:null,'limit':_0x94c5ef[_0xc3b6('0x18')]?_0x94c5ef[_0xc3b6('0x18')]['limit']||null:null,'include':_0x94c5ef['options']?_0x94c5ef[_0xc3b6('0x18')][_0xc3b6('0x1c')]?_['map'](_0x94c5ef[_0xc3b6('0x18')][_0xc3b6('0x1c')],function(_0x4e06b0){return{'model':db[_0x4e06b0[_0xc3b6('0x1d')]],'as':_0x4e06b0['as'],'attributes':_0x4e06b0[_0xc3b6('0x1b')],'include':_0x4e06b0[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x4e06b0['include'],function(_0x5374c2){return{'model':db[_0x5374c2[_0xc3b6('0x1d')]],'as':_0x5374c2['as'],'attributes':_0x5374c2[_0xc3b6('0x1b')],'include':_0x5374c2[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x5374c2[_0xc3b6('0x1c')],function(_0xda5fbd){return{'model':db[_0xda5fbd[_0xc3b6('0x1d')]],'as':_0xda5fbd['as'],'attributes':_0xda5fbd[_0xc3b6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc3b6('0xc')](function(_0x52d8a9){logger[_0xc3b6('0xd')](_0xc3b6('0x1f'),_0x94c5ef);logger['debug'](_0xc3b6('0x1f'),_0x94c5ef,JSON['stringify'](_0x52d8a9));_0x1a2bcd(_0x52d8a9);})[_0xc3b6('0x17')](function(_0x362d84){logger['error'](_0xc3b6('0x1f'),_0x362d84[_0xc3b6('0x15')],_0x94c5ef);_0xf1e3fe(_0x4bb822[_0xc3b6('0x14')](0x1f4,_0x362d84[_0xc3b6('0x15')]));});});};exports[_0xc3b6('0x20')]=function(_0x101954){var _0x7e414d=this;return new Promise(function(_0x547609,_0x5901da){return db[_0xc3b6('0x21')][_0xc3b6('0x22')]({'raw':_0x101954[_0xc3b6('0x18')]?_0x101954[_0xc3b6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x101954[_0xc3b6('0x18')]?_0x101954[_0xc3b6('0x18')]['where']||null:null,'attributes':_0x101954[_0xc3b6('0x18')]?_0x101954[_0xc3b6('0x18')]['attributes']||null:null,'include':_0x101954[_0xc3b6('0x18')]?_0x101954[_0xc3b6('0x18')][_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x101954[_0xc3b6('0x18')][_0xc3b6('0x1c')],function(_0xa566eb){return{'model':db[_0xa566eb[_0xc3b6('0x1d')]],'as':_0xa566eb['as'],'attributes':_0xa566eb[_0xc3b6('0x1b')],'include':_0xa566eb[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0xa566eb[_0xc3b6('0x1c')],function(_0x58c245){return{'model':db[_0x58c245[_0xc3b6('0x1d')]],'as':_0x58c245['as'],'attributes':_0x58c245[_0xc3b6('0x1b')],'include':_0x58c245[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x58c245[_0xc3b6('0x1c')],function(_0x20ee0a){return{'model':db[_0x20ee0a[_0xc3b6('0x1d')]],'as':_0x20ee0a['as'],'attributes':_0x20ee0a[_0xc3b6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2813cc){logger['info'](_0xc3b6('0x20'),_0x101954);logger[_0xc3b6('0xf')](_0xc3b6('0x20'),_0x101954,JSON['stringify'](_0x2813cc));_0x547609(_0x2813cc);})[_0xc3b6('0x17')](function(_0x2ad543){logger[_0xc3b6('0x14')](_0xc3b6('0x20'),_0x2ad543[_0xc3b6('0x15')],_0x101954);_0x5901da(_0x7e414d[_0xc3b6('0x14')](0x1f4,_0x2ad543[_0xc3b6('0x15')]));});});};exports[_0xc3b6('0x23')]=function(_0x13454f){var _0x328434=this;return new Promise(function(_0x181339,_0x17336f){return db['CmHopper'][_0xc3b6('0x24')](_0x13454f[_0xc3b6('0x25')],{'raw':_0x13454f[_0xc3b6('0x18')]?_0x13454f['options'][_0xc3b6('0x19')]===undefined?!![]:![]:!![]})[_0xc3b6('0xc')](function(_0xd7bba6){logger[_0xc3b6('0xd')](_0xc3b6('0x23'),_0x13454f);logger[_0xc3b6('0xf')](_0xc3b6('0x23'),_0x13454f,JSON[_0xc3b6('0x12')](_0xd7bba6));_0x181339(_0xd7bba6);})[_0xc3b6('0x17')](function(_0x12547b){logger[_0xc3b6('0x14')](_0xc3b6('0x23'),_0x12547b['message'],_0x13454f);_0x17336f(_0x328434[_0xc3b6('0x14')](0x1f4,_0x12547b[_0xc3b6('0x15')]));});});};exports['UpdateCmHopper']=function(_0x377aca){var _0x251578=this;return new Promise(function(_0x29f1c1,_0x125407){return db[_0xc3b6('0x21')][_0xc3b6('0x26')](_0x377aca[_0xc3b6('0x25')],{'raw':_0x377aca[_0xc3b6('0x18')]?_0x377aca[_0xc3b6('0x18')][_0xc3b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x377aca['options']?_0x377aca[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':_0x377aca[_0xc3b6('0x18')]?_0x377aca[_0xc3b6('0x18')][_0xc3b6('0x1b')]||null:null,'limit':_0x377aca[_0xc3b6('0x18')]?_0x377aca[_0xc3b6('0x18')][_0xc3b6('0x27')]||null:null})[_0xc3b6('0xc')](function(_0x5229c9){logger[_0xc3b6('0xd')](_0xc3b6('0x28'),_0x377aca);logger[_0xc3b6('0xf')](_0xc3b6('0x28'),_0x377aca,JSON['stringify'](_0x5229c9));_0x29f1c1(_0x5229c9);})[_0xc3b6('0x17')](function(_0x364021){logger[_0xc3b6('0x14')](_0xc3b6('0x28'),_0x364021[_0xc3b6('0x15')],_0x377aca);_0x125407(_0x251578[_0xc3b6('0x14')](0x1f4,_0x364021[_0xc3b6('0x15')]));});});};exports[_0xc3b6('0x29')]=function(_0x232ce2){var _0x5d6f3f=this;return new Promise(function(_0x3a75cf,_0x296141){return db[_0xc3b6('0x21')][_0xc3b6('0x2a')]({'where':_0x232ce2[_0xc3b6('0x18')]?_0x232ce2[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null})['then'](function(_0x326835){logger['info'](_0xc3b6('0x29'),_0x232ce2);logger[_0xc3b6('0xf')](_0xc3b6('0x29'),_0x232ce2,JSON[_0xc3b6('0x12')](_0x326835));_0x3a75cf(_0x326835);})[_0xc3b6('0x17')](function(_0x4b6886){logger[_0xc3b6('0x14')](_0xc3b6('0x29'),_0x4b6886[_0xc3b6('0x15')],_0x232ce2);_0x296141(_0x5d6f3f[_0xc3b6('0x14')](0x1f4,_0x4b6886[_0xc3b6('0x15')]));});});};exports[_0xc3b6('0x2b')]=function(_0x3f9c09){var _0x4297f9=this;return new Promise(function(_0x382a60,_0x54db8a){return db[_0xc3b6('0x2c')]['describe']()[_0xc3b6('0xc')](function(_0x4967a6){return db['sequelize'][_0xc3b6('0x2d')](function(_0x4d4bf1){return db['CmHopper'][_0xc3b6('0x2e')]({'where':_0x3f9c09[_0xc3b6('0x18')]?_0x3f9c09[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':_0x3f9c09[_0xc3b6('0x18')]?_0x3f9c09[_0xc3b6('0x18')]['attributes']||null:null,'limit':_0x3f9c09[_0xc3b6('0x18')]?_0x3f9c09[_0xc3b6('0x18')]['limit']||null:null,'order':_0x3f9c09[_0xc3b6('0x18')]?_0x3f9c09[_0xc3b6('0x18')][_0xc3b6('0x2f')]||null:null,'transaction':_0x4d4bf1,'lock':_0x4d4bf1['LOCK'][_0xc3b6('0x30')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0xc3b6('0x31')](_0x4967a6)},{'model':db[_0xc3b6('0x32')],'as':_0xc3b6('0x33'),'attributes':['id',_0xc3b6('0x34'),'voicePause']}]})[_0xc3b6('0xc')](function(_0x215a05){var _0x51679d=[];var _0xc2f45a=[];for(var _0x9b68eb=0x0;_0x9b68eb<_0x215a05[_0xc3b6('0x35')];_0x9b68eb+=0x1){var _0x598a80=_0x215a05[_0x9b68eb][_0xc3b6('0x36')];if(_0x598a80===null){_0x51679d['push'](_0x215a05[_0x9b68eb][_0xc3b6('0x26')](_0x3f9c09[_0xc3b6('0x25')],{'transaction':_0x4d4bf1}));}else if(!_0xc2f45a[_0xc3b6('0x37')](_0x598a80)){_0xc2f45a[_0xc3b6('0x38')](_0x598a80);_0x51679d[_0xc3b6('0x38')](_0x215a05[_0x9b68eb][_0xc3b6('0x26')](_0x3f9c09[_0xc3b6('0x25')],{'transaction':_0x4d4bf1}));}}return BPromise['all'](_0x51679d);});})['then'](function(_0x4017fa){logger[_0xc3b6('0xd')](_0xc3b6('0x2b'),_0x3f9c09);logger['debug'](_0xc3b6('0x2b'),_0x3f9c09,JSON[_0xc3b6('0x12')](_0x4017fa));_0x382a60(_0x4017fa);})[_0xc3b6('0x17')](function(_0x34687e){logger[_0xc3b6('0x14')](_0xc3b6('0x2b'),_0x34687e[_0xc3b6('0x15')],_0x3f9c09);_0x54db8a(_0x4297f9['error'](0x1f4,_0x34687e[_0xc3b6('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x45125c){var _0x54aed5=this;return new Promise(function(_0x61cc36,_0x43e3a0){return db['sequelize']['transaction'](function(_0x5d8d97){return db[_0xc3b6('0x39')][_0xc3b6('0x24')](_0x45125c[_0xc3b6('0x25')],{'raw':_0x45125c[_0xc3b6('0x18')]?_0x45125c[_0xc3b6('0x18')][_0xc3b6('0x19')]===undefined?!![]:![]:!![],'transaction':_0x5d8d97})['then'](function(){return db['CmHopper']['destroy']({'where':_0x45125c[_0xc3b6('0x18')]?_0x45125c[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'transaction':_0x5d8d97});});})[_0xc3b6('0xc')](function(_0x312cec){logger['info'](_0xc3b6('0x3a'),_0x45125c);logger[_0xc3b6('0xf')](_0xc3b6('0x3a'),_0x45125c,JSON[_0xc3b6('0x12')](_0x312cec));_0x61cc36(_0x312cec);})[_0xc3b6('0x17')](function(_0x41a0b9){logger[_0xc3b6('0x14')]('MoveContactManagedDialer',_0x41a0b9[_0xc3b6('0x15')],_0x45125c);_0x43e3a0(_0x54aed5[_0xc3b6('0x14')](0x1f4,_0x41a0b9[_0xc3b6('0x15')]));});});};exports['CountReScheduled']=function(_0x4c4300){var _0x1e59dd=this;return new Promise(function(_0x240393,_0x54dbde){return db[_0xc3b6('0x21')][_0xc3b6('0x2e')]({'raw':_0x4c4300[_0xc3b6('0x18')]?_0x4c4300[_0xc3b6('0x18')][_0xc3b6('0x19')]===undefined?!![]:![]:!![],'where':_0x4c4300[_0xc3b6('0x18')]?_0x4c4300[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':[[db[_0xc3b6('0x3b')]['fn']('COUNT',db[_0xc3b6('0x3b')]['fn']('IF',db[_0xc3b6('0x3b')][_0xc3b6('0x3c')](_0xc3b6('0x3d')+util[_0xc3b6('0x3e')](_0xc3b6('0x3f'),moment()[_0xc3b6('0x3e')](_0xc3b6('0x40')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xc3b6('0xc')](function(_0x441b37){logger[_0xc3b6('0xd')](_0xc3b6('0x41'),_0x4c4300);logger[_0xc3b6('0xf')](_0xc3b6('0x41'),_0x4c4300,JSON[_0xc3b6('0x12')](_0x441b37));_0x240393(_0x441b37);})[_0xc3b6('0x17')](function(_0x2daef5){logger[_0xc3b6('0x14')](_0xc3b6('0x41'),_0x2daef5['message'],_0x4c4300);_0x54dbde(_0x1e59dd[_0xc3b6('0x14')](0x1f4,_0x2daef5[_0xc3b6('0x15')]));});});};exports['GetContactRecallMe']=function(_0x5c1269){var _0x315b8d=this;return new Promise(function(_0x183221,_0x141076){return db[_0xc3b6('0x2c')][_0xc3b6('0x42')]()['then'](function(_0x1ff107){return db[_0xc3b6('0x3b')][_0xc3b6('0x2d')](function(_0x25d333){return db[_0xc3b6('0x21')]['findAll']({'where':_0x5c1269[_0xc3b6('0x18')]?_0x5c1269[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':_0x5c1269[_0xc3b6('0x18')]?_0x5c1269[_0xc3b6('0x18')][_0xc3b6('0x1b')]||null:null,'limit':0x1,'order':_0x5c1269['options']?_0x5c1269['options'][_0xc3b6('0x2f')]||null:null,'group':db[_0xc3b6('0x21')][_0xc3b6('0x36')],'transaction':_0x25d333,'lock':_0x25d333[_0xc3b6('0x43')]['UPDATE'],'include':_0x5c1269[_0xc3b6('0x18')]?_0x5c1269[_0xc3b6('0x18')][_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x5c1269['options'][_0xc3b6('0x1c')],function(_0x96c701){return{'model':db[_0x96c701['model']],'as':_0x96c701['as'],'attributes':_0x96c701[_0xc3b6('0x1b')],'include':_0x96c701[_0xc3b6('0x1c')]?_['map'](_0x96c701[_0xc3b6('0x1c')],function(_0x264a73){return{'model':db[_0x264a73['model']],'as':_0x264a73['as'],'attributes':_0x264a73[_0xc3b6('0x1b')],'include':_0x264a73['include']?_[_0xc3b6('0x1e')](_0x264a73[_0xc3b6('0x1c')],function(_0x51bc9c){return{'model':db[_0x51bc9c[_0xc3b6('0x1d')]],'as':_0x51bc9c['as'],'attributes':_0x51bc9c[_0xc3b6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc3b6('0xc')](function(_0x317197){var _0x3634de=[];for(var _0x5c3aac=0x0;_0x5c3aac<_0x317197[_0xc3b6('0x35')];_0x5c3aac+=0x1){_0x3634de[_0xc3b6('0x38')](_0x317197[_0x5c3aac]['update'](_0x5c1269[_0xc3b6('0x25')],{'transaction':_0x25d333}));}return BPromise[_0xc3b6('0x44')](_0x3634de);});})[_0xc3b6('0xc')](function(_0x42f4d3){logger['info'](_0xc3b6('0x45'),_0x5c1269);logger[_0xc3b6('0xf')]('GetContactRecallMe',_0x5c1269,JSON[_0xc3b6('0x12')](_0x42f4d3));_0x183221(_0x42f4d3);})['catch'](function(_0x5d2c0b){logger[_0xc3b6('0x14')]('GetContactRecallMe',_0x5d2c0b[_0xc3b6('0x15')],_0x5c1269);_0x141076(_0x315b8d[_0xc3b6('0x14')](0x1f4,_0x5d2c0b[_0xc3b6('0x15')]));});});});};exports[_0xc3b6('0x46')]=function(_0x2c068d){var _0x4e6c00=this;return new Promise(function(_0x2c9044,_0x378b4b){db['CmContact']['describe']()[_0xc3b6('0xc')](function(_0x4bc5ae){return db[_0xc3b6('0x21')][_0xc3b6('0x2e')]({'raw':_0x2c068d[_0xc3b6('0x18')]?_0x2c068d[_0xc3b6('0x18')][_0xc3b6('0x19')]===undefined?!![]:![]:!![],'where':_0x2c068d['options']?_0x2c068d[_0xc3b6('0x18')][_0xc3b6('0x1a')]||null:null,'attributes':_0x2c068d[_0xc3b6('0x18')]?_0x2c068d[_0xc3b6('0x18')][_0xc3b6('0x1b')]||null:null,'limit':_0x2c068d['options']?_0x2c068d['options'][_0xc3b6('0x27')]||null:null,'include':_0x2c068d[_0xc3b6('0x18')]?_0x2c068d[_0xc3b6('0x18')]['include']?_[_0xc3b6('0x1e')](_0x2c068d[_0xc3b6('0x18')]['include'],function(_0xb812f1){return{'model':db[_0xb812f1['model']],'as':_0xb812f1['as'],'attributes':_0xb812f1['as']===_0xc3b6('0x47')?_[_0xc3b6('0x31')](_0x4bc5ae):_0xb812f1[_0xc3b6('0x1b')],'include':_0xb812f1[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0xb812f1['include'],function(_0x4c8b12){return{'model':db[_0x4c8b12[_0xc3b6('0x1d')]],'as':_0x4c8b12['as'],'attributes':_0x4c8b12[_0xc3b6('0x1b')],'include':_0x4c8b12[_0xc3b6('0x1c')]?_[_0xc3b6('0x1e')](_0x4c8b12[_0xc3b6('0x1c')],function(_0x56d754){return{'model':db[_0x56d754['model']],'as':_0x56d754['as'],'attributes':_0x56d754[_0xc3b6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc3b6('0xc')](function(_0x2a2f0b){logger[_0xc3b6('0xd')](_0xc3b6('0x1f'),_0x2c068d);logger[_0xc3b6('0xf')](_0xc3b6('0x1f'),_0x2c068d,JSON['stringify'](_0x2a2f0b));_0x2c9044(_0x2a2f0b);})['catch'](function(_0x23171c){logger[_0xc3b6('0x14')]('GetCmHopper',_0x23171c['message'],_0x2c068d);_0x378b4b(_0x4e6c00[_0xc3b6('0x14')](0x1f4,_0x23171c['message']));});});});}; \ No newline at end of file +var _0x1b63=['CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','map','include','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','Contact','keys','User','name','voicePause','length','push','includes','all','debug','transaction','CmHopperFinal','destroy','MoveContactManagedDialer','literal','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent'];(function(_0x5698a9,_0x4ae7c7){var _0x3be696=function(_0x396896){while(--_0x396896){_0x5698a9['push'](_0x5698a9['shift']());}};_0x3be696(++_0x4ae7c7);}(_0x1b63,0x104));var _0x31b6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x1b63[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0x31b6('0x0'));var moment=require(_0x31b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x31b6('0x2'));var fs=require('fs');var Redis=require(_0x31b6('0x3'));var db=require(_0x31b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x31b6('0x5'));var jayson=require(_0x31b6('0x6'));var client=jayson[_0x31b6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ae3e6,_0x4c6743,_0x37de12){return new BPromise(function(_0x5e5e7a,_0x2462e2){return client['request'](_0x1ae3e6,_0x37de12)[_0x31b6('0x8')](function(_0x1a7236){logger[_0x31b6('0x9')](_0x31b6('0xa'),_0x4c6743,_0x31b6('0xb'));logger['debug'](_0x31b6('0xc'),_0x4c6743,'request\x20sent',JSON[_0x31b6('0xd')](_0x1a7236));if(_0x1a7236[_0x31b6('0xe')]){if(_0x1a7236[_0x31b6('0xe')][_0x31b6('0xf')]===0x1f4){logger['error'](_0x31b6('0xa'),_0x4c6743,_0x1a7236[_0x31b6('0xe')]['message']);return _0x2462e2(_0x1a7236[_0x31b6('0xe')][_0x31b6('0x10')]);}logger[_0x31b6('0xe')](_0x31b6('0xa'),_0x4c6743,_0x1a7236[_0x31b6('0xe')][_0x31b6('0x10')]);return _0x5e5e7a(_0x1a7236[_0x31b6('0xe')][_0x31b6('0x10')]);}else{logger[_0x31b6('0x9')](_0x31b6('0xa'),_0x4c6743,_0x31b6('0xb'));_0x5e5e7a(_0x1a7236[_0x31b6('0x11')]['message']);}})[_0x31b6('0x12')](function(_0x2abda2){logger[_0x31b6('0xe')]('CmHopper,\x20%s,\x20%s',_0x4c6743,_0x2abda2);_0x2462e2(_0x2abda2);});});}exports[_0x31b6('0x13')]=function(_0x43d099){var _0x5c2100=this;return new Promise(function(_0x1ff61a,_0x227599){return db[_0x31b6('0x14')][_0x31b6('0x15')]({'raw':_0x43d099['options']?_0x43d099[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![],'where':_0x43d099['options']?_0x43d099[_0x31b6('0x16')][_0x31b6('0x18')]||null:null,'attributes':_0x43d099[_0x31b6('0x16')]?_0x43d099[_0x31b6('0x16')][_0x31b6('0x19')]||null:null,'limit':_0x43d099[_0x31b6('0x16')]?_0x43d099[_0x31b6('0x16')]['limit']||null:null,'include':_0x43d099['options']?_0x43d099[_0x31b6('0x16')]['include']?_[_0x31b6('0x1a')](_0x43d099['options'][_0x31b6('0x1b')],function(_0xd05305){return{'model':db[_0xd05305['model']],'as':_0xd05305['as'],'attributes':_0xd05305[_0x31b6('0x19')],'include':_0xd05305[_0x31b6('0x1b')]?_['map'](_0xd05305[_0x31b6('0x1b')],function(_0xa72b08){return{'model':db[_0xa72b08[_0x31b6('0x1c')]],'as':_0xa72b08['as'],'attributes':_0xa72b08[_0x31b6('0x19')],'include':_0xa72b08['include']?_[_0x31b6('0x1a')](_0xa72b08[_0x31b6('0x1b')],function(_0x3d49b3){return{'model':db[_0x3d49b3[_0x31b6('0x1c')]],'as':_0x3d49b3['as'],'attributes':_0x3d49b3[_0x31b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x31b6('0x8')](function(_0x20c362){logger[_0x31b6('0x9')]('GetCmHopper',_0x43d099);logger['debug'](_0x31b6('0x13'),_0x43d099,JSON[_0x31b6('0xd')](_0x20c362));_0x1ff61a(_0x20c362);})[_0x31b6('0x12')](function(_0x1a1ad4){logger[_0x31b6('0xe')](_0x31b6('0x13'),_0x1a1ad4['message'],_0x43d099);_0x227599(_0x5c2100[_0x31b6('0xe')](0x1f4,_0x1a1ad4[_0x31b6('0x10')]));});});};exports[_0x31b6('0x1d')]=function(_0x3c7e0e){var _0x420220=this;return new Promise(function(_0x164c1a,_0x34dea6){return db[_0x31b6('0x14')][_0x31b6('0x1e')]({'raw':_0x3c7e0e[_0x31b6('0x16')]?_0x3c7e0e['options'][_0x31b6('0x17')]===undefined?!![]:![]:!![],'where':_0x3c7e0e[_0x31b6('0x16')]?_0x3c7e0e['options'][_0x31b6('0x18')]||null:null,'attributes':_0x3c7e0e[_0x31b6('0x16')]?_0x3c7e0e[_0x31b6('0x16')][_0x31b6('0x19')]||null:null,'include':_0x3c7e0e[_0x31b6('0x16')]?_0x3c7e0e[_0x31b6('0x16')][_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x3c7e0e[_0x31b6('0x16')][_0x31b6('0x1b')],function(_0x101796){return{'model':db[_0x101796[_0x31b6('0x1c')]],'as':_0x101796['as'],'attributes':_0x101796['attributes'],'include':_0x101796['include']?_[_0x31b6('0x1a')](_0x101796[_0x31b6('0x1b')],function(_0x3a003e){return{'model':db[_0x3a003e[_0x31b6('0x1c')]],'as':_0x3a003e['as'],'attributes':_0x3a003e[_0x31b6('0x19')],'include':_0x3a003e[_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x3a003e[_0x31b6('0x1b')],function(_0x3f2cd1){return{'model':db[_0x3f2cd1['model']],'as':_0x3f2cd1['as'],'attributes':_0x3f2cd1['attributes']};}):[]};}):[]};}):[]:[]})[_0x31b6('0x8')](function(_0x4ac65f){logger['info'](_0x31b6('0x1d'),_0x3c7e0e);logger['debug'](_0x31b6('0x1d'),_0x3c7e0e,JSON[_0x31b6('0xd')](_0x4ac65f));_0x164c1a(_0x4ac65f);})['catch'](function(_0x883e65){logger[_0x31b6('0xe')]('ShowCmHopper',_0x883e65[_0x31b6('0x10')],_0x3c7e0e);_0x34dea6(_0x420220[_0x31b6('0xe')](0x1f4,_0x883e65[_0x31b6('0x10')]));});});};exports[_0x31b6('0x1f')]=function(_0x8ca746){var _0x3505b6=this;return new Promise(function(_0x45582c,_0x37d8b0){return db['CmHopper'][_0x31b6('0x20')](_0x8ca746[_0x31b6('0x21')],{'raw':_0x8ca746['options']?_0x8ca746[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x1cb0db){logger[_0x31b6('0x9')]('CreateCmHopper',_0x8ca746);logger['debug'](_0x31b6('0x1f'),_0x8ca746,JSON[_0x31b6('0xd')](_0x1cb0db));_0x45582c(_0x1cb0db);})[_0x31b6('0x12')](function(_0x3e6af1){logger[_0x31b6('0xe')](_0x31b6('0x1f'),_0x3e6af1[_0x31b6('0x10')],_0x8ca746);_0x37d8b0(_0x3505b6[_0x31b6('0xe')](0x1f4,_0x3e6af1['message']));});});};exports[_0x31b6('0x22')]=function(_0x1b5f9a){var _0x5954ad=this;return new Promise(function(_0x510a55,_0x1fbfd9){return db['CmHopper'][_0x31b6('0x23')](_0x1b5f9a[_0x31b6('0x21')],{'raw':_0x1b5f9a['options']?_0x1b5f9a[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5f9a['options']?_0x1b5f9a[_0x31b6('0x16')]['where']||null:null,'attributes':_0x1b5f9a[_0x31b6('0x16')]?_0x1b5f9a[_0x31b6('0x16')][_0x31b6('0x19')]||null:null,'limit':_0x1b5f9a[_0x31b6('0x16')]?_0x1b5f9a[_0x31b6('0x16')]['limit']||null:null})['then'](function(_0x5f0ad1){logger['info'](_0x31b6('0x22'),_0x1b5f9a);logger['debug'](_0x31b6('0x22'),_0x1b5f9a,JSON['stringify'](_0x5f0ad1));_0x510a55(_0x5f0ad1);})[_0x31b6('0x12')](function(_0x589842){logger[_0x31b6('0xe')](_0x31b6('0x22'),_0x589842['message'],_0x1b5f9a);_0x1fbfd9(_0x5954ad[_0x31b6('0xe')](0x1f4,_0x589842[_0x31b6('0x10')]));});});};exports[_0x31b6('0x24')]=function(_0x48d941){var _0x369469=this;return new Promise(function(_0x1c459d,_0x1a9ae0){return db[_0x31b6('0x14')]['destroy']({'where':_0x48d941[_0x31b6('0x16')]?_0x48d941[_0x31b6('0x16')][_0x31b6('0x18')]||null:null})[_0x31b6('0x8')](function(_0x1cdeea){logger[_0x31b6('0x9')](_0x31b6('0x24'),_0x48d941);logger['debug'](_0x31b6('0x24'),_0x48d941,JSON[_0x31b6('0xd')](_0x1cdeea));_0x1c459d(_0x1cdeea);})[_0x31b6('0x12')](function(_0x463373){logger[_0x31b6('0xe')](_0x31b6('0x24'),_0x463373[_0x31b6('0x10')],_0x48d941);_0x1a9ae0(_0x369469[_0x31b6('0xe')](0x1f4,_0x463373[_0x31b6('0x10')]));});});};exports[_0x31b6('0x25')]=function(_0x292cad){var _0x23c6b6=this;return new Promise(function(_0x98ac63,_0x40af67){return db[_0x31b6('0x26')][_0x31b6('0x27')]()[_0x31b6('0x8')](function(_0x4b3e1b){return db[_0x31b6('0x28')]['transaction'](function(_0x473059){return db[_0x31b6('0x14')][_0x31b6('0x15')]({'where':_0x292cad[_0x31b6('0x16')]?_0x292cad[_0x31b6('0x16')][_0x31b6('0x18')]||null:null,'attributes':_0x292cad[_0x31b6('0x16')]?_0x292cad[_0x31b6('0x16')][_0x31b6('0x19')]||null:null,'limit':_0x292cad[_0x31b6('0x16')]?_0x292cad[_0x31b6('0x16')][_0x31b6('0x29')]||null:null,'order':_0x292cad[_0x31b6('0x16')]?_0x292cad[_0x31b6('0x16')][_0x31b6('0x2a')]||null:null,'transaction':_0x473059,'lock':_0x473059[_0x31b6('0x2b')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x31b6('0x2c'),'attributes':_[_0x31b6('0x2d')](_0x4b3e1b)},{'model':db[_0x31b6('0x2e')],'as':'Agent','attributes':['id',_0x31b6('0x2f'),_0x31b6('0x30')]}]})[_0x31b6('0x8')](function(_0x133683){var _0x3f1669=[];var _0x5e091f=[];for(var _0x518035=0x0;_0x518035<_0x133683[_0x31b6('0x31')];_0x518035+=0x1){var _0x2e806c=_0x133683[_0x518035]['UserId'];if(_0x2e806c===null){_0x3f1669[_0x31b6('0x32')](_0x133683[_0x518035][_0x31b6('0x23')](_0x292cad[_0x31b6('0x21')],{'transaction':_0x473059}));}else if(!_0x5e091f[_0x31b6('0x33')](_0x2e806c)){_0x5e091f[_0x31b6('0x32')](_0x2e806c);_0x3f1669['push'](_0x133683[_0x518035][_0x31b6('0x23')](_0x292cad['body'],{'transaction':_0x473059}));}}return BPromise[_0x31b6('0x34')](_0x3f1669);});})['then'](function(_0x2f06f1){logger[_0x31b6('0x9')](_0x31b6('0x25'),_0x292cad);logger[_0x31b6('0x35')](_0x31b6('0x25'),_0x292cad,JSON[_0x31b6('0xd')](_0x2f06f1));_0x98ac63(_0x2f06f1);})[_0x31b6('0x12')](function(_0x46e158){logger[_0x31b6('0xe')](_0x31b6('0x25'),_0x46e158[_0x31b6('0x10')],_0x292cad);_0x40af67(_0x23c6b6[_0x31b6('0xe')](0x1f4,_0x46e158['message']));});});});};exports['MoveContactManagedDialer']=function(_0x57c87e){var _0x594bad=this;return new Promise(function(_0x57f23a,_0x537075){return db[_0x31b6('0x28')][_0x31b6('0x36')](function(_0x3b600b){return db[_0x31b6('0x37')]['create'](_0x57c87e[_0x31b6('0x21')],{'raw':_0x57c87e[_0x31b6('0x16')]?_0x57c87e[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![],'transaction':_0x3b600b})[_0x31b6('0x8')](function(){return db[_0x31b6('0x14')][_0x31b6('0x38')]({'where':_0x57c87e[_0x31b6('0x16')]?_0x57c87e[_0x31b6('0x16')]['where']||null:null,'transaction':_0x3b600b});});})['then'](function(_0x316b7b){logger['info'](_0x31b6('0x39'),_0x57c87e);logger[_0x31b6('0x35')]('MoveContactManagedDialer',_0x57c87e,JSON[_0x31b6('0xd')](_0x316b7b));_0x57f23a(_0x316b7b);})['catch'](function(_0x3a8414){logger[_0x31b6('0xe')](_0x31b6('0x39'),_0x3a8414[_0x31b6('0x10')],_0x57c87e);_0x537075(_0x594bad[_0x31b6('0xe')](0x1f4,_0x3a8414[_0x31b6('0x10')]));});});};exports['CountReScheduled']=function(_0x2b4084){var _0xbe8178=this;return new Promise(function(_0x58f35d,_0x3b9258){return db['CmHopper'][_0x31b6('0x15')]({'raw':_0x2b4084[_0x31b6('0x16')]?_0x2b4084[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![],'where':_0x2b4084[_0x31b6('0x16')]?_0x2b4084[_0x31b6('0x16')][_0x31b6('0x18')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x31b6('0x28')]['fn']('IF',db[_0x31b6('0x28')][_0x31b6('0x3a')]('`scheduledat`\x20>=\x20'+util['format'](_0x31b6('0x3b'),moment()['format'](_0x31b6('0x3c')))+_0x31b6('0x3d')))),_0x31b6('0x3e')]]})[_0x31b6('0x8')](function(_0x673b64){logger[_0x31b6('0x9')](_0x31b6('0x3f'),_0x2b4084);logger[_0x31b6('0x35')](_0x31b6('0x3f'),_0x2b4084,JSON[_0x31b6('0xd')](_0x673b64));_0x58f35d(_0x673b64);})[_0x31b6('0x12')](function(_0x4543db){logger[_0x31b6('0xe')](_0x31b6('0x3f'),_0x4543db[_0x31b6('0x10')],_0x2b4084);_0x3b9258(_0xbe8178[_0x31b6('0xe')](0x1f4,_0x4543db['message']));});});};exports[_0x31b6('0x40')]=function(_0x218a40){var _0x44fde7=this;return new Promise(function(_0x57578d,_0x5e49dc){return db[_0x31b6('0x26')][_0x31b6('0x27')]()[_0x31b6('0x8')](function(_0x4809b3){return db[_0x31b6('0x28')][_0x31b6('0x36')](function(_0x1db4a5){return db[_0x31b6('0x14')]['findAll']({'where':_0x218a40[_0x31b6('0x16')]?_0x218a40[_0x31b6('0x16')][_0x31b6('0x18')]||null:null,'attributes':_0x218a40[_0x31b6('0x16')]?_0x218a40['options']['attributes']||null:null,'limit':0x1,'order':_0x218a40[_0x31b6('0x16')]?_0x218a40[_0x31b6('0x16')][_0x31b6('0x2a')]||null:null,'group':db[_0x31b6('0x14')][_0x31b6('0x41')],'transaction':_0x1db4a5,'lock':_0x1db4a5[_0x31b6('0x2b')][_0x31b6('0x42')],'include':_0x218a40['options']?_0x218a40[_0x31b6('0x16')][_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x218a40[_0x31b6('0x16')][_0x31b6('0x1b')],function(_0x23e617){return{'model':db[_0x23e617[_0x31b6('0x1c')]],'as':_0x23e617['as'],'attributes':_0x23e617[_0x31b6('0x19')],'include':_0x23e617[_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x23e617['include'],function(_0x25f17e){return{'model':db[_0x25f17e['model']],'as':_0x25f17e['as'],'attributes':_0x25f17e[_0x31b6('0x19')],'include':_0x25f17e[_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x25f17e[_0x31b6('0x1b')],function(_0x51959f){return{'model':db[_0x51959f['model']],'as':_0x51959f['as'],'attributes':_0x51959f[_0x31b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x31b6('0x8')](function(_0x3f4924){var _0x41ec38=[];for(var _0x44931a=0x0;_0x44931a<_0x3f4924[_0x31b6('0x31')];_0x44931a+=0x1){_0x41ec38[_0x31b6('0x32')](_0x3f4924[_0x44931a][_0x31b6('0x23')](_0x218a40[_0x31b6('0x21')],{'transaction':_0x1db4a5}));}return BPromise['all'](_0x41ec38);});})[_0x31b6('0x8')](function(_0x44be13){logger['info'](_0x31b6('0x40'),_0x218a40);logger['debug'](_0x31b6('0x40'),_0x218a40,JSON[_0x31b6('0xd')](_0x44be13));_0x57578d(_0x44be13);})[_0x31b6('0x12')](function(_0x3d0bdb){logger['error'](_0x31b6('0x40'),_0x3d0bdb[_0x31b6('0x10')],_0x218a40);_0x5e49dc(_0x44fde7[_0x31b6('0xe')](0x1f4,_0x3d0bdb['message']));});});});};exports[_0x31b6('0x43')]=function(_0x37f9d8){var _0x566294=this;return new Promise(function(_0x428ab2,_0x2eaac7){db[_0x31b6('0x26')][_0x31b6('0x27')]()[_0x31b6('0x8')](function(_0x59f725){return db[_0x31b6('0x14')]['findAll']({'raw':_0x37f9d8[_0x31b6('0x16')]?_0x37f9d8[_0x31b6('0x16')][_0x31b6('0x17')]===undefined?!![]:![]:!![],'where':_0x37f9d8[_0x31b6('0x16')]?_0x37f9d8[_0x31b6('0x16')][_0x31b6('0x18')]||null:null,'attributes':_0x37f9d8[_0x31b6('0x16')]?_0x37f9d8[_0x31b6('0x16')][_0x31b6('0x19')]||null:null,'limit':_0x37f9d8[_0x31b6('0x16')]?_0x37f9d8['options'][_0x31b6('0x29')]||null:null,'include':_0x37f9d8['options']?_0x37f9d8['options']['include']?_[_0x31b6('0x1a')](_0x37f9d8['options'][_0x31b6('0x1b')],function(_0x14f048){return{'model':db[_0x14f048[_0x31b6('0x1c')]],'as':_0x14f048['as'],'attributes':_0x14f048['as']===_0x31b6('0x2c')?_[_0x31b6('0x2d')](_0x59f725):_0x14f048[_0x31b6('0x19')],'include':_0x14f048[_0x31b6('0x1b')]?_[_0x31b6('0x1a')](_0x14f048[_0x31b6('0x1b')],function(_0x1921a8){return{'model':db[_0x1921a8[_0x31b6('0x1c')]],'as':_0x1921a8['as'],'attributes':_0x1921a8[_0x31b6('0x19')],'include':_0x1921a8['include']?_[_0x31b6('0x1a')](_0x1921a8['include'],function(_0x39e609){return{'model':db[_0x39e609[_0x31b6('0x1c')]],'as':_0x39e609['as'],'attributes':_0x39e609[_0x31b6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x31b6('0x8')](function(_0x522b43){logger[_0x31b6('0x9')](_0x31b6('0x13'),_0x37f9d8);logger[_0x31b6('0x35')](_0x31b6('0x13'),_0x37f9d8,JSON[_0x31b6('0xd')](_0x522b43));_0x428ab2(_0x522b43);})[_0x31b6('0x12')](function(_0x4ed059){logger[_0x31b6('0xe')]('GetCmHopper',_0x4ed059[_0x31b6('0x10')],_0x37f9d8);_0x2eaac7(_0x566294[_0x31b6('0xe')](0x1f4,_0x4ed059[_0x31b6('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 91837e1..28a881b 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 _0x16dc=['isAuthenticated','/opencontacts','getOpenContacts','/:id','create','post','/preview','getPreview','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmHopper.controller','index','get','/describe'];(function(_0x417b8d,_0x5076d3){var _0x105f91=function(_0xff1b78){while(--_0xff1b78){_0x417b8d['push'](_0x417b8d['shift']());}};_0x105f91(++_0x5076d3);}(_0x16dc,0x113));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc16d('0x0'));var util=require(_0xc16d('0x1'));var path=require(_0xc16d('0x2'));var timeout=require(_0xc16d('0x3'));var express=require(_0xc16d('0x4'));var router=express[_0xc16d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc16d('0x6'));var config=require('../../config/environment');var controller=require(_0xc16d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc16d('0x8')]);router[_0xc16d('0x9')](_0xc16d('0xa'),auth[_0xc16d('0xb')](),controller['describe']);router[_0xc16d('0x9')](_0xc16d('0xc'),auth[_0xc16d('0xb')](),controller[_0xc16d('0xd')]);router[_0xc16d('0x9')](_0xc16d('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xc16d('0xf')]);router[_0xc16d('0x10')](_0xc16d('0x11'),auth['isAuthenticated'](),controller[_0xc16d('0x12')]);router[_0xc16d('0x13')]('/:id',auth[_0xc16d('0xb')](),controller[_0xc16d('0x14')]);router['delete'](_0xc16d('0xe'),auth[_0xc16d('0xb')](),controller['destroy']);module[_0xc16d('0x15')]=router; \ No newline at end of file +var _0xabe8=['./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../config/environment'];(function(_0x27bbe1,_0x18d832){var _0x34c942=function(_0xf6114){while(--_0xf6114){_0x27bbe1['push'](_0x27bbe1['shift']());}};_0x34c942(++_0x18d832);}(_0xabe8,0x135));var _0x8abe=function(_0x25c968,_0x176e63){_0x25c968=_0x25c968-0x0;var _0x50a6d4=_0xabe8[_0x25c968];return _0x50a6d4;};'use strict';var multer=require(_0x8abe('0x0'));var util=require('util');var path=require(_0x8abe('0x1'));var timeout=require('connect-timeout');var express=require(_0x8abe('0x2'));var router=express[_0x8abe('0x3')]();var fs_extra=require(_0x8abe('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8abe('0x5'));var controller=require(_0x8abe('0x6'));router['get']('/',auth[_0x8abe('0x7')](),controller[_0x8abe('0x8')]);router[_0x8abe('0x9')](_0x8abe('0xa'),auth[_0x8abe('0x7')](),controller[_0x8abe('0xb')]);router[_0x8abe('0x9')](_0x8abe('0xc'),auth['isAuthenticated'](),controller[_0x8abe('0xd')]);router[_0x8abe('0x9')](_0x8abe('0xe'),auth['isAuthenticated'](),controller[_0x8abe('0xf')]);router[_0x8abe('0x10')]('/',auth[_0x8abe('0x7')](),controller[_0x8abe('0x11')]);router[_0x8abe('0x10')]('/preview',auth[_0x8abe('0x7')](),controller['getPreview']);router[_0x8abe('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8abe('0x13')]);router['delete'](_0x8abe('0xe'),auth[_0x8abe('0x7')](),controller['destroy']);module[_0x8abe('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index e139ddd..48c2cb2 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 _0xb1a3=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xb1a3[_0x5e6cb8];return _0x3faeb3;};'use strict';var moment=require(_0x3b1a('0x0'));var Sequelize=require(_0x3b1a('0x1'));module[_0x3b1a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x3b1a('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x3b1a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x3b1a('0x3')],'unique':_0x3b1a('0x4')}}; \ No newline at end of file +var _0x38ec=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x495e08,_0xbb8d71){var _0x5227e0=function(_0x570b84){while(--_0x570b84){_0x495e08['push'](_0x495e08['shift']());}};_0x5227e0(++_0xbb8d71);}(_0x38ec,0xfa));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xc38e('0x0'));var Sequelize=require(_0xc38e('0x1'));module[_0xc38e('0x2')]={'phone':{'type':Sequelize[_0xc38e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'ListId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'VoiceQueueId':{'type':Sequelize[_0xc38e('0x4')],'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 17c2052..46ae528 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 _0x48a5=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','set','Content-Range','save','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','intersection','length','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1cfba5,_0x1306fe){var _0x1999f9=function(_0x1a17f9){while(--_0x1a17f9){_0x1cfba5['push'](_0x1cfba5['shift']());}};_0x1999f9(++_0x1306fe);}(_0x48a5,0xcb));var _0x548a=function(_0x435499,_0x5b4c84){_0x435499=_0x435499-0x0;var _0x69202d=_0x48a5[_0x435499];return _0x69202d;};'use strict';var emlformat=require(_0x548a('0x0'));var rimraf=require(_0x548a('0x1'));var zipdir=require(_0x548a('0x2'));var jsonpatch=require(_0x548a('0x3'));var rp=require(_0x548a('0x4'));var moment=require(_0x548a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x548a('0x6'));var path=require(_0x548a('0x7'));var sox=require(_0x548a('0x8'));var csv=require('to-csv');var ejs=require(_0x548a('0x9'));var fs=require('fs');var fs_extra=require(_0x548a('0xa'));var _=require(_0x548a('0xb'));var squel=require(_0x548a('0xc'));var crypto=require(_0x548a('0xd'));var jsforce=require(_0x548a('0xe'));var deskjs=require(_0x548a('0xf'));var toCsv=require(_0x548a('0x10'));var querystring=require(_0x548a('0x11'));var Papa=require(_0x548a('0x12'));var Redis=require(_0x548a('0x13'));var authService=require(_0x548a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x548a('0x15'));var hardwareService=require(_0x548a('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x548a('0x17'));var licenseUtil=require(_0x548a('0x18'));var db=require(_0x548a('0x19'))['db'];function respondWithStatusCode(_0x53afe8,_0x1df885){_0x1df885=_0x1df885||0xcc;return function(_0x1a4e2d){if(_0x1a4e2d){return _0x53afe8['sendStatus'](_0x1df885);}return _0x53afe8[_0x548a('0x1a')](_0x1df885)[_0x548a('0x1b')]();};}function respondWithResult(_0x2f881f,_0xc9dda4){_0xc9dda4=_0xc9dda4||0xc8;return function(_0x3be8cb){if(_0x3be8cb){return _0x2f881f[_0x548a('0x1a')](_0xc9dda4)[_0x548a('0x1c')](_0x3be8cb);}};}function respondWithFilteredResult(_0x84c53e,_0x3e6ee9){return function(_0x502bfe){if(_0x502bfe){var _0xd2da34=typeof _0x3e6ee9['offset']==='undefined'&&typeof _0x3e6ee9[_0x548a('0x1d')]==='undefined';var _0x400907=_0x502bfe['count'];var _0x315bde=_0xd2da34?0x0:_0x3e6ee9['offset'];var _0x2df2b6=_0xd2da34?_0x502bfe[_0x548a('0x1e')]:_0x3e6ee9[_0x548a('0x1f')]+_0x3e6ee9[_0x548a('0x1d')];var _0x57bf71;if(_0x2df2b6>=_0x400907){_0x2df2b6=_0x400907;_0x57bf71=0xc8;}else{_0x57bf71=0xce;}_0x84c53e[_0x548a('0x1a')](_0x57bf71);return _0x84c53e[_0x548a('0x20')](_0x548a('0x21'),_0x315bde+'-'+_0x2df2b6+'/'+_0x400907)['json'](_0x502bfe);}return null;};}function patchUpdates(_0x577359){return function(_0x27ca07){try{jsonpatch['apply'](_0x27ca07,_0x577359,!![]);}catch(_0x35dfd5){return BPromise['reject'](_0x35dfd5);}return _0x27ca07[_0x548a('0x22')]();};}function saveUpdates(_0x5ab4a8,_0x95273b){return function(_0x31ba96){if(_0x31ba96){return _0x31ba96['update'](_0x5ab4a8)[_0x548a('0x23')](function(_0x5093a1){return _0x5093a1;});}return null;};}function removeEntity(_0x4061e7,_0x258a75){return function(_0x3fe1f1){if(_0x3fe1f1){return _0x3fe1f1['destroy']()[_0x548a('0x23')](function(){_0x4061e7[_0x548a('0x1a')](0xcc)[_0x548a('0x1b')]();});}};}function handleEntityNotFound(_0x4c38eb,_0x4de9fc){return function(_0x240390){if(!_0x240390){_0x4c38eb['sendStatus'](0x194);}return _0x240390;};}function handleError(_0x39a2a8,_0x5b8796){_0x5b8796=_0x5b8796||0x1f4;return function(_0x450ce3){logger[_0x548a('0x24')](_0x450ce3[_0x548a('0x25')]);if(_0x450ce3[_0x548a('0x26')]){delete _0x450ce3[_0x548a('0x26')];}_0x39a2a8[_0x548a('0x1a')](_0x5b8796)[_0x548a('0x27')](_0x450ce3);};}exports[_0x548a('0x28')]=function(_0x2834d1,_0xefe850){var _0x333fef={},_0x523dd2={},_0x5e1ee8={'count':0x0,'rows':[]};var _0x4b0fe5=_[_0x548a('0x29')](db[_0x548a('0x2a')][_0x548a('0x2b')],function(_0xdb8cb3){return{'name':_0xdb8cb3[_0x548a('0x2c')],'type':_0xdb8cb3[_0x548a('0x2d')][_0x548a('0x2e')]};});_0x523dd2[_0x548a('0x2f')]=_[_0x548a('0x29')](_0x4b0fe5,_0x548a('0x26'));_0x523dd2[_0x548a('0x30')]=_[_0x548a('0x31')](_0x2834d1[_0x548a('0x30')]);_0x523dd2[_0x548a('0x32')]=_['intersection'](_0x523dd2['model'],_0x523dd2[_0x548a('0x30')]);_0x333fef[_0x548a('0x33')]=_['intersection'](_0x523dd2[_0x548a('0x2f')],qs[_0x548a('0x34')](_0x2834d1[_0x548a('0x30')]['fields']));_0x333fef[_0x548a('0x33')]=_0x333fef[_0x548a('0x33')]['length']?_0x333fef[_0x548a('0x33')]:_0x523dd2['model'];if(!_0x2834d1[_0x548a('0x30')][_0x548a('0x35')](_0x548a('0x36'))){_0x333fef['limit']=qs[_0x548a('0x1d')](_0x2834d1[_0x548a('0x30')]['limit']);_0x333fef['offset']=qs['offset'](_0x2834d1[_0x548a('0x30')][_0x548a('0x1f')]);}_0x333fef[_0x548a('0x37')]=qs[_0x548a('0x38')](_0x2834d1[_0x548a('0x30')][_0x548a('0x38')]);_0x333fef[_0x548a('0x39')]=qs[_0x548a('0x32')](_['pick'](_0x2834d1[_0x548a('0x30')],_0x523dd2[_0x548a('0x32')]),_0x4b0fe5);if(_0x2834d1[_0x548a('0x30')][_0x548a('0x3a')]){_0x333fef[_0x548a('0x39')]=_[_0x548a('0x3b')](_0x333fef[_0x548a('0x39')],{'$or':_[_0x548a('0x29')](_0x4b0fe5,function(_0x127453){if(_0x127453['type']!==_0x548a('0x3c')){var _0x321bb1={};_0x321bb1[_0x127453[_0x548a('0x26')]]={'$like':'%'+_0x2834d1['query'][_0x548a('0x3a')]+'%'};return _0x321bb1;}})});}_0x333fef=_[_0x548a('0x3b')]({},_0x333fef,_0x2834d1[_0x548a('0x3d')]);var _0x42fda5={'where':_0x333fef[_0x548a('0x39')]};return db['CmHopperBlack'][_0x548a('0x1e')](_0x42fda5)[_0x548a('0x23')](function(_0xd2e98f){_0x5e1ee8['count']=_0xd2e98f;if(_0x2834d1[_0x548a('0x30')][_0x548a('0x3e')]){_0x333fef[_0x548a('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x333fef);})[_0x548a('0x23')](function(_0x29a046){_0x5e1ee8[_0x548a('0x40')]=_0x29a046;return _0x5e1ee8;})[_0x548a('0x23')](respondWithFilteredResult(_0xefe850,_0x333fef))[_0x548a('0x41')](handleError(_0xefe850,null));};exports['show']=function(_0x5c29e9,_0x1c6404){var _0x38c243={'raw':!![],'where':{'id':_0x5c29e9[_0x548a('0x42')]['id']}},_0x58b260={};_0x58b260['model']=_[_0x548a('0x31')](db[_0x548a('0x2a')][_0x548a('0x2b')]);_0x58b260['query']=_[_0x548a('0x31')](_0x5c29e9['query']);_0x58b260[_0x548a('0x32')]=_[_0x548a('0x43')](_0x58b260[_0x548a('0x2f')],_0x58b260[_0x548a('0x30')]);_0x38c243[_0x548a('0x33')]=_[_0x548a('0x43')](_0x58b260[_0x548a('0x2f')],qs['fields'](_0x5c29e9[_0x548a('0x30')][_0x548a('0x34')]));_0x38c243['attributes']=_0x38c243[_0x548a('0x33')][_0x548a('0x44')]?_0x38c243[_0x548a('0x33')]:_0x58b260[_0x548a('0x2f')];if(_0x5c29e9['query']['includeAll']){_0x38c243['include']=[{'all':!![]}];}_0x38c243=_[_0x548a('0x3b')]({},_0x38c243,_0x5c29e9[_0x548a('0x3d')]);return db[_0x548a('0x2a')]['find'](_0x38c243)[_0x548a('0x23')](handleEntityNotFound(_0x1c6404,null))[_0x548a('0x23')](respondWithResult(_0x1c6404,null))[_0x548a('0x41')](handleError(_0x1c6404,null));};exports['update']=function(_0x179aa2,_0x39baf){if(_0x179aa2[_0x548a('0x45')]['id']){delete _0x179aa2[_0x548a('0x45')]['id'];}return db[_0x548a('0x2a')][_0x548a('0x46')]({'where':{'id':_0x179aa2[_0x548a('0x42')]['id']}})[_0x548a('0x23')](handleEntityNotFound(_0x39baf,null))[_0x548a('0x23')](saveUpdates(_0x179aa2[_0x548a('0x45')],null))[_0x548a('0x23')](respondWithResult(_0x39baf,null))[_0x548a('0x41')](handleError(_0x39baf,null));};exports[_0x548a('0x47')]=function(_0x435e53,_0x5572b3){return db[_0x548a('0x2a')]['find']({'where':{'id':_0x435e53[_0x548a('0x42')]['id']}})[_0x548a('0x23')](handleEntityNotFound(_0x5572b3,null))[_0x548a('0x23')](removeEntity(_0x5572b3,null))[_0x548a('0x41')](handleError(_0x5572b3,null));};exports[_0x548a('0x48')]=function(_0x333115,_0x5862a6){return db[_0x548a('0x2a')][_0x548a('0x48')]()[_0x548a('0x23')](respondWithResult(_0x5862a6,null))['catch'](handleError(_0x5862a6,null));}; \ No newline at end of file +var _0x4c58=['count','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','rows','show','includeAll','include','find','body','catch','destroy','params','describe','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','../../config/logger','../../config/license/util','sendStatus','end','status','json','offset','undefined'];(function(_0x4d4bc9,_0x51daa7){var _0x46c2f8=function(_0x5e6ccf){while(--_0x5e6ccf){_0x4d4bc9['push'](_0x4d4bc9['shift']());}};_0x46c2f8(++_0x51daa7);}(_0x4c58,0x18f));var _0x84c5=function(_0x257358,_0x4e1c0f){_0x257358=_0x257358-0x0;var _0x5ebd26=_0x4c58[_0x257358];return _0x5ebd26;};'use strict';var emlformat=require(_0x84c5('0x0'));var rimraf=require(_0x84c5('0x1'));var zipdir=require(_0x84c5('0x2'));var jsonpatch=require(_0x84c5('0x3'));var rp=require('request-promise');var moment=require(_0x84c5('0x4'));var BPromise=require(_0x84c5('0x5'));var Mustache=require(_0x84c5('0x6'));var util=require(_0x84c5('0x7'));var path=require(_0x84c5('0x8'));var sox=require(_0x84c5('0x9'));var csv=require(_0x84c5('0xa'));var ejs=require(_0x84c5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x84c5('0xc'));var crypto=require(_0x84c5('0xd'));var jsforce=require(_0x84c5('0xe'));var deskjs=require(_0x84c5('0xf'));var toCsv=require(_0x84c5('0xa'));var querystring=require(_0x84c5('0x10'));var Papa=require('papaparse');var Redis=require(_0x84c5('0x11'));var authService=require(_0x84c5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x84c5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84c5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35e1d5,_0x5173df){_0x5173df=_0x5173df||0xcc;return function(_0x2ef936){if(_0x2ef936){return _0x35e1d5[_0x84c5('0x15')](_0x5173df);}return _0x35e1d5['status'](_0x5173df)[_0x84c5('0x16')]();};}function respondWithResult(_0x4d3b9d,_0x13bc92){_0x13bc92=_0x13bc92||0xc8;return function(_0x3852a9){if(_0x3852a9){return _0x4d3b9d[_0x84c5('0x17')](_0x13bc92)[_0x84c5('0x18')](_0x3852a9);}};}function respondWithFilteredResult(_0x38bd92,_0x5c01a3){return function(_0x45e0ff){if(_0x45e0ff){var _0x413696=typeof _0x5c01a3[_0x84c5('0x19')]==='undefined'&&typeof _0x5c01a3['limit']===_0x84c5('0x1a');var _0x5add5=_0x45e0ff[_0x84c5('0x1b')];var _0x21480a=_0x413696?0x0:_0x5c01a3[_0x84c5('0x19')];var _0x41c5e9=_0x413696?_0x45e0ff['count']:_0x5c01a3[_0x84c5('0x19')]+_0x5c01a3[_0x84c5('0x1c')];var _0x150bc1;if(_0x41c5e9>=_0x5add5){_0x41c5e9=_0x5add5;_0x150bc1=0xc8;}else{_0x150bc1=0xce;}_0x38bd92[_0x84c5('0x17')](_0x150bc1);return _0x38bd92[_0x84c5('0x1d')]('Content-Range',_0x21480a+'-'+_0x41c5e9+'/'+_0x5add5)[_0x84c5('0x18')](_0x45e0ff);}return null;};}function patchUpdates(_0x1492a4){return function(_0x2632b5){try{jsonpatch[_0x84c5('0x1e')](_0x2632b5,_0x1492a4,!![]);}catch(_0x38d5c9){return BPromise[_0x84c5('0x1f')](_0x38d5c9);}return _0x2632b5[_0x84c5('0x20')]();};}function saveUpdates(_0x17770b,_0x55320a){return function(_0x51b8e2){if(_0x51b8e2){return _0x51b8e2[_0x84c5('0x21')](_0x17770b)[_0x84c5('0x22')](function(_0x24d753){return _0x24d753;});}return null;};}function removeEntity(_0x43803c,_0x31c2e2){return function(_0x4cc7ef){if(_0x4cc7ef){return _0x4cc7ef['destroy']()['then'](function(){_0x43803c[_0x84c5('0x17')](0xcc)[_0x84c5('0x16')]();});}};}function handleEntityNotFound(_0x37f1f6,_0x5172bb){return function(_0x4ad894){if(!_0x4ad894){_0x37f1f6['sendStatus'](0x194);}return _0x4ad894;};}function handleError(_0xeab366,_0x2fefac){_0x2fefac=_0x2fefac||0x1f4;return function(_0x556d37){logger[_0x84c5('0x23')](_0x556d37[_0x84c5('0x24')]);if(_0x556d37[_0x84c5('0x25')]){delete _0x556d37[_0x84c5('0x25')];}_0xeab366[_0x84c5('0x17')](_0x2fefac)[_0x84c5('0x26')](_0x556d37);};}exports[_0x84c5('0x27')]=function(_0x414239,_0x256034){var _0x453647={},_0x4a206e={},_0x140c33={'count':0x0,'rows':[]};var _0x2582be=_[_0x84c5('0x28')](db[_0x84c5('0x29')][_0x84c5('0x2a')],function(_0x5d6f3e){return{'name':_0x5d6f3e[_0x84c5('0x2b')],'type':_0x5d6f3e[_0x84c5('0x2c')][_0x84c5('0x2d')]};});_0x4a206e[_0x84c5('0x2e')]=_[_0x84c5('0x28')](_0x2582be,_0x84c5('0x25'));_0x4a206e['query']=_[_0x84c5('0x2f')](_0x414239[_0x84c5('0x30')]);_0x4a206e['filters']=_[_0x84c5('0x31')](_0x4a206e['model'],_0x4a206e[_0x84c5('0x30')]);_0x453647[_0x84c5('0x32')]=_[_0x84c5('0x31')](_0x4a206e[_0x84c5('0x2e')],qs[_0x84c5('0x33')](_0x414239[_0x84c5('0x30')]['fields']));_0x453647[_0x84c5('0x32')]=_0x453647[_0x84c5('0x32')][_0x84c5('0x34')]?_0x453647[_0x84c5('0x32')]:_0x4a206e[_0x84c5('0x2e')];if(!_0x414239['query'][_0x84c5('0x35')](_0x84c5('0x36'))){_0x453647['limit']=qs[_0x84c5('0x1c')](_0x414239[_0x84c5('0x30')][_0x84c5('0x1c')]);_0x453647[_0x84c5('0x19')]=qs[_0x84c5('0x19')](_0x414239[_0x84c5('0x30')][_0x84c5('0x19')]);}_0x453647[_0x84c5('0x37')]=qs['sort'](_0x414239[_0x84c5('0x30')][_0x84c5('0x38')]);_0x453647[_0x84c5('0x39')]=qs[_0x84c5('0x3a')](_['pick'](_0x414239[_0x84c5('0x30')],_0x4a206e[_0x84c5('0x3a')]),_0x2582be);if(_0x414239[_0x84c5('0x30')]['filter']){_0x453647[_0x84c5('0x39')]=_[_0x84c5('0x3b')](_0x453647['where'],{'$or':_[_0x84c5('0x28')](_0x2582be,function(_0x35bc72){if(_0x35bc72[_0x84c5('0x2c')]!=='VIRTUAL'){var _0xc14e25={};_0xc14e25[_0x35bc72[_0x84c5('0x25')]]={'$like':'%'+_0x414239['query']['filter']+'%'};return _0xc14e25;}})});}_0x453647=_[_0x84c5('0x3b')]({},_0x453647,_0x414239[_0x84c5('0x3c')]);var _0x2bdfc6={'where':_0x453647[_0x84c5('0x39')]};return db['CmHopperBlack'][_0x84c5('0x1b')](_0x2bdfc6)[_0x84c5('0x22')](function(_0x3f897f){_0x140c33[_0x84c5('0x1b')]=_0x3f897f;if(_0x414239[_0x84c5('0x30')]['includeAll']){_0x453647['include']=[{'all':!![]}];}return db[_0x84c5('0x29')]['findAll'](_0x453647);})[_0x84c5('0x22')](function(_0x1cda3e){_0x140c33[_0x84c5('0x3d')]=_0x1cda3e;return _0x140c33;})['then'](respondWithFilteredResult(_0x256034,_0x453647))['catch'](handleError(_0x256034,null));};exports[_0x84c5('0x3e')]=function(_0x20470c,_0x509761){var _0x5ef696={'raw':!![],'where':{'id':_0x20470c['params']['id']}},_0x636473={};_0x636473[_0x84c5('0x2e')]=_['keys'](db[_0x84c5('0x29')][_0x84c5('0x2a')]);_0x636473[_0x84c5('0x30')]=_[_0x84c5('0x2f')](_0x20470c[_0x84c5('0x30')]);_0x636473['filters']=_['intersection'](_0x636473[_0x84c5('0x2e')],_0x636473['query']);_0x5ef696[_0x84c5('0x32')]=_[_0x84c5('0x31')](_0x636473['model'],qs[_0x84c5('0x33')](_0x20470c['query'][_0x84c5('0x33')]));_0x5ef696[_0x84c5('0x32')]=_0x5ef696[_0x84c5('0x32')][_0x84c5('0x34')]?_0x5ef696[_0x84c5('0x32')]:_0x636473['model'];if(_0x20470c['query'][_0x84c5('0x3f')]){_0x5ef696[_0x84c5('0x40')]=[{'all':!![]}];}_0x5ef696=_['merge']({},_0x5ef696,_0x20470c[_0x84c5('0x3c')]);return db[_0x84c5('0x29')][_0x84c5('0x41')](_0x5ef696)[_0x84c5('0x22')](handleEntityNotFound(_0x509761,null))[_0x84c5('0x22')](respondWithResult(_0x509761,null))['catch'](handleError(_0x509761,null));};exports[_0x84c5('0x21')]=function(_0x4f6c48,_0x6815b3){if(_0x4f6c48[_0x84c5('0x42')]['id']){delete _0x4f6c48[_0x84c5('0x42')]['id'];}return db['CmHopperBlack'][_0x84c5('0x41')]({'where':{'id':_0x4f6c48['params']['id']}})[_0x84c5('0x22')](handleEntityNotFound(_0x6815b3,null))[_0x84c5('0x22')](saveUpdates(_0x4f6c48[_0x84c5('0x42')],null))[_0x84c5('0x22')](respondWithResult(_0x6815b3,null))[_0x84c5('0x43')](handleError(_0x6815b3,null));};exports[_0x84c5('0x44')]=function(_0x41e9fd,_0x2fc2d1){return db['CmHopperBlack'][_0x84c5('0x41')]({'where':{'id':_0x41e9fd[_0x84c5('0x45')]['id']}})[_0x84c5('0x22')](handleEntityNotFound(_0x2fc2d1,null))[_0x84c5('0x22')](removeEntity(_0x2fc2d1,null))[_0x84c5('0x43')](handleError(_0x2fc2d1,null));};exports['describe']=function(_0x32af4e,_0x272686){return db[_0x84c5('0x29')][_0x84c5('0x46')]()[_0x84c5('0x22')](respondWithResult(_0x272686,null))[_0x84c5('0x43')](handleError(_0x272686,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 48031d5..9786b20 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 _0xf129=['cm_hopper_black','../../config/logger','moment','bluebird','path','rimraf','exports','define','CmHopperBlack'];(function(_0x25a0f1,_0x5061fd){var _0xe516e0=function(_0x29fd5d){while(--_0x29fd5d){_0x25a0f1['push'](_0x25a0f1['shift']());}};_0xe516e0(++_0x5061fd);}(_0xf129,0x157));var _0x9f12=function(_0x333132,_0x253370){_0x333132=_0x333132-0x0;var _0x28d341=_0xf129[_0x333132];return _0x28d341;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f12('0x0'))('api');var moment=require(_0x9f12('0x1'));var BPromise=require(_0x9f12('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f12('0x3'));var rimraf=require(_0x9f12('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x9f12('0x5')]=function(_0x10fedc,_0x4326a5){return _0x10fedc[_0x9f12('0x6')](_0x9f12('0x7'),attributes,{'tableName':_0x9f12('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a77=['util','api','moment','request-promise','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x56a77e,_0x316f40){var _0x4d8066=function(_0xce04a3){while(--_0xce04a3){_0x56a77e['push'](_0x56a77e['shift']());}};_0x4d8066(++_0x316f40);}(_0x4a77,0xb3));var _0x74a7=function(_0x2dfcc2,_0x31176c){_0x2dfcc2=_0x2dfcc2-0x0;var _0x4fafac=_0x4a77[_0x2dfcc2];return _0x4fafac;};'use strict';var _=require(_0x74a7('0x0'));var util=require(_0x74a7('0x1'));var logger=require('../../config/logger')(_0x74a7('0x2'));var moment=require(_0x74a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x74a7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74a7('0x5'));var config=require(_0x74a7('0x6'));var attributes=require('./cmHopperBlack.attributes');module[_0x74a7('0x7')]=function(_0x44ea71,_0x5b6cae){return _0x44ea71['define'](_0x74a7('0x8'),attributes,{'tableName':_0x74a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 353c609..5de6513 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 _0x959a=['model','debug','UpdateCmHopperBlack','CmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','options','raw','where','attributes','limit','include','map'];(function(_0x4434e6,_0x4eec32){var _0x9408a4=function(_0x17045c){while(--_0x17045c){_0x4434e6['push'](_0x4434e6['shift']());}};_0x9408a4(++_0x4eec32);}(_0x959a,0x111));var _0xa959=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x959a[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xa959('0x0'));var util=require('util');var moment=require(_0xa959('0x1'));var BPromise=require(_0xa959('0x2'));var rs=require(_0xa959('0x3'));var fs=require('fs');var Redis=require(_0xa959('0x4'));var db=require(_0xa959('0x5'))['db'];var utils=require(_0xa959('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa959('0x7'));var jayson=require(_0xa959('0x8'));var client=jayson[_0xa959('0x9')][_0xa959('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x213701,_0x16e3cb,_0x29a3d5){return new BPromise(function(_0x36b040,_0x5feabc){return client[_0xa959('0xb')](_0x213701,_0x29a3d5)[_0xa959('0xc')](function(_0x12388d){logger[_0xa959('0xd')](_0xa959('0xe'),_0x16e3cb,_0xa959('0xf'));logger['debug'](_0xa959('0x10'),_0x16e3cb,'request\x20sent',JSON[_0xa959('0x11')](_0x12388d));if(_0x12388d['error']){if(_0x12388d[_0xa959('0x12')][_0xa959('0x13')]===0x1f4){logger[_0xa959('0x12')](_0xa959('0xe'),_0x16e3cb,_0x12388d['error'][_0xa959('0x14')]);return _0x5feabc(_0x12388d['error'][_0xa959('0x14')]);}logger[_0xa959('0x12')](_0xa959('0xe'),_0x16e3cb,_0x12388d[_0xa959('0x12')]['message']);return _0x36b040(_0x12388d['error']['message']);}else{logger[_0xa959('0xd')](_0xa959('0xe'),_0x16e3cb,_0xa959('0xf'));_0x36b040(_0x12388d[_0xa959('0x15')][_0xa959('0x14')]);}})[_0xa959('0x16')](function(_0x3c0657){logger[_0xa959('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x16e3cb,_0x3c0657);_0x5feabc(_0x3c0657);});});}exports[_0xa959('0x17')]=function(_0x45327e){var _0x1f175e=this;return new Promise(function(_0x39e52b,_0x2df1c0){return db['CmHopperBlack']['findAll']({'raw':_0x45327e[_0xa959('0x18')]?_0x45327e[_0xa959('0x18')][_0xa959('0x19')]===undefined?!![]:![]:!![],'where':_0x45327e[_0xa959('0x18')]?_0x45327e[_0xa959('0x18')][_0xa959('0x1a')]||null:null,'attributes':_0x45327e[_0xa959('0x18')]?_0x45327e[_0xa959('0x18')][_0xa959('0x1b')]||null:null,'limit':_0x45327e[_0xa959('0x18')]?_0x45327e[_0xa959('0x18')][_0xa959('0x1c')]||null:null,'include':_0x45327e['options']?_0x45327e[_0xa959('0x18')][_0xa959('0x1d')]?_[_0xa959('0x1e')](_0x45327e[_0xa959('0x18')][_0xa959('0x1d')],function(_0x4ca4e2){return{'model':db[_0x4ca4e2[_0xa959('0x1f')]],'as':_0x4ca4e2['as'],'attributes':_0x4ca4e2['attributes'],'include':_0x4ca4e2['include']?_[_0xa959('0x1e')](_0x4ca4e2[_0xa959('0x1d')],function(_0x21f904){return{'model':db[_0x21f904[_0xa959('0x1f')]],'as':_0x21f904['as'],'attributes':_0x21f904[_0xa959('0x1b')],'include':_0x21f904[_0xa959('0x1d')]?_[_0xa959('0x1e')](_0x21f904[_0xa959('0x1d')],function(_0x37f57f){return{'model':db[_0x37f57f[_0xa959('0x1f')]],'as':_0x37f57f['as'],'attributes':_0x37f57f[_0xa959('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa959('0xc')](function(_0x476679){logger[_0xa959('0xd')](_0xa959('0x17'),_0x45327e);logger[_0xa959('0x20')]('GetCmHopperBlack',_0x45327e,JSON['stringify'](_0x476679));_0x39e52b(_0x476679);})['catch'](function(_0x3e9e6a){logger[_0xa959('0x12')](_0xa959('0x17'),_0x3e9e6a[_0xa959('0x14')],_0x45327e);_0x2df1c0(_0x1f175e[_0xa959('0x12')](0x1f4,_0x3e9e6a['message']));});});};exports[_0xa959('0x21')]=function(_0x48c752){var _0x1451f5=this;return new Promise(function(_0x56b703,_0x13ea4d){return db[_0xa959('0x22')]['update'](_0x48c752[_0xa959('0x23')],{'raw':_0x48c752[_0xa959('0x18')]?_0x48c752[_0xa959('0x18')][_0xa959('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48c752[_0xa959('0x18')]?_0x48c752[_0xa959('0x18')][_0xa959('0x1a')]||null:null,'attributes':_0x48c752['options']?_0x48c752[_0xa959('0x18')][_0xa959('0x1b')]||null:null,'limit':_0x48c752[_0xa959('0x18')]?_0x48c752[_0xa959('0x18')][_0xa959('0x1c')]||null:null})[_0xa959('0xc')](function(_0x2ec6b1){logger[_0xa959('0xd')](_0xa959('0x21'),_0x48c752);logger[_0xa959('0x20')](_0xa959('0x21'),_0x48c752,JSON['stringify'](_0x2ec6b1));_0x56b703(_0x2ec6b1);})['catch'](function(_0x7d8ebc){logger[_0xa959('0x12')](_0xa959('0x21'),_0x7d8ebc[_0xa959('0x14')],_0x48c752);_0x13ea4d(_0x1451f5[_0xa959('0x12')](0x1f4,_0x7d8ebc[_0xa959('0x14')]));});});};exports[_0xa959('0x24')]=function(_0x3ceca9){var _0x34828f=this;return new Promise(function(_0x1fc605,_0x409c7b){return db[_0xa959('0x22')][_0xa959('0x25')]({'where':_0x3ceca9[_0xa959('0x18')]?_0x3ceca9['options'][_0xa959('0x1a')]||null:null})[_0xa959('0xc')](function(_0x3722a3){logger[_0xa959('0xd')]('DestroyCmHopperBlack',_0x3ceca9);logger[_0xa959('0x20')](_0xa959('0x24'),_0x3ceca9,JSON['stringify'](_0x3722a3));_0x1fc605(_0x3722a3);})[_0xa959('0x16')](function(_0x4420c7){logger[_0xa959('0x12')](_0xa959('0x24'),_0x4420c7[_0xa959('0x14')],_0x3ceca9);_0x409c7b(_0x34828f[_0xa959('0x12')](0x1f4,_0x4420c7['message']));});});}; \ No newline at end of file +var _0x475d=['findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CmHopperBlack'];(function(_0x2f7bec,_0x27b9f6){var _0x5d1c2e=function(_0x442b0a){while(--_0x442b0a){_0x2f7bec['push'](_0x2f7bec['shift']());}};_0x5d1c2e(++_0x27b9f6);}(_0x475d,0x1b2));var _0xd475=function(_0x2a9bb2,_0xccdbcb){_0x2a9bb2=_0x2a9bb2-0x0;var _0x58c695=_0x475d[_0x2a9bb2];return _0x58c695;};'use strict';var _=require(_0xd475('0x0'));var util=require('util');var moment=require(_0xd475('0x1'));var BPromise=require(_0xd475('0x2'));var rs=require(_0xd475('0x3'));var fs=require('fs');var Redis=require(_0xd475('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd475('0x5'))(_0xd475('0x6'));var config=require(_0xd475('0x7'));var jayson=require(_0xd475('0x8'));var client=jayson['client'][_0xd475('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32768e,_0x1094f0,_0x4102c6){return new BPromise(function(_0x1be31f,_0x1db5f1){return client['request'](_0x32768e,_0x4102c6)[_0xd475('0xa')](function(_0x4ebf56){logger[_0xd475('0xb')](_0xd475('0xc'),_0x1094f0,_0xd475('0xd'));logger[_0xd475('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1094f0,'request\x20sent',JSON[_0xd475('0xf')](_0x4ebf56));if(_0x4ebf56['error']){if(_0x4ebf56[_0xd475('0x10')][_0xd475('0x11')]===0x1f4){logger[_0xd475('0x10')](_0xd475('0xc'),_0x1094f0,_0x4ebf56[_0xd475('0x10')]['message']);return _0x1db5f1(_0x4ebf56[_0xd475('0x10')][_0xd475('0x12')]);}logger[_0xd475('0x10')](_0xd475('0xc'),_0x1094f0,_0x4ebf56[_0xd475('0x10')]['message']);return _0x1be31f(_0x4ebf56['error'][_0xd475('0x12')]);}else{logger['info'](_0xd475('0xc'),_0x1094f0,_0xd475('0xd'));_0x1be31f(_0x4ebf56['result'][_0xd475('0x12')]);}})[_0xd475('0x13')](function(_0x200b71){logger[_0xd475('0x10')](_0xd475('0xc'),_0x1094f0,_0x200b71);_0x1db5f1(_0x200b71);});});}exports['GetCmHopperBlack']=function(_0x113974){var _0x24ee64=this;return new Promise(function(_0x1fe082,_0x576f50){return db[_0xd475('0x14')][_0xd475('0x15')]({'raw':_0x113974[_0xd475('0x16')]?_0x113974[_0xd475('0x16')][_0xd475('0x17')]===undefined?!![]:![]:!![],'where':_0x113974[_0xd475('0x16')]?_0x113974[_0xd475('0x16')][_0xd475('0x18')]||null:null,'attributes':_0x113974[_0xd475('0x16')]?_0x113974[_0xd475('0x16')][_0xd475('0x19')]||null:null,'limit':_0x113974[_0xd475('0x16')]?_0x113974[_0xd475('0x16')][_0xd475('0x1a')]||null:null,'include':_0x113974['options']?_0x113974[_0xd475('0x16')][_0xd475('0x1b')]?_[_0xd475('0x1c')](_0x113974['options'][_0xd475('0x1b')],function(_0x388584){return{'model':db[_0x388584[_0xd475('0x1d')]],'as':_0x388584['as'],'attributes':_0x388584[_0xd475('0x19')],'include':_0x388584[_0xd475('0x1b')]?_[_0xd475('0x1c')](_0x388584[_0xd475('0x1b')],function(_0x4b550c){return{'model':db[_0x4b550c['model']],'as':_0x4b550c['as'],'attributes':_0x4b550c[_0xd475('0x19')],'include':_0x4b550c[_0xd475('0x1b')]?_[_0xd475('0x1c')](_0x4b550c[_0xd475('0x1b')],function(_0x245c3a){return{'model':db[_0x245c3a[_0xd475('0x1d')]],'as':_0x245c3a['as'],'attributes':_0x245c3a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd475('0xa')](function(_0x3cdd8d){logger[_0xd475('0xb')]('GetCmHopperBlack',_0x113974);logger[_0xd475('0xe')](_0xd475('0x1e'),_0x113974,JSON[_0xd475('0xf')](_0x3cdd8d));_0x1fe082(_0x3cdd8d);})[_0xd475('0x13')](function(_0xae338e){logger[_0xd475('0x10')](_0xd475('0x1e'),_0xae338e[_0xd475('0x12')],_0x113974);_0x576f50(_0x24ee64[_0xd475('0x10')](0x1f4,_0xae338e[_0xd475('0x12')]));});});};exports[_0xd475('0x1f')]=function(_0x375e61){var _0x285be0=this;return new Promise(function(_0xbc0a80,_0xf8587b){return db[_0xd475('0x14')][_0xd475('0x20')](_0x375e61[_0xd475('0x21')],{'raw':_0x375e61['options']?_0x375e61['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x375e61[_0xd475('0x16')]?_0x375e61[_0xd475('0x16')][_0xd475('0x18')]||null:null,'attributes':_0x375e61[_0xd475('0x16')]?_0x375e61[_0xd475('0x16')]['attributes']||null:null,'limit':_0x375e61['options']?_0x375e61[_0xd475('0x16')]['limit']||null:null})[_0xd475('0xa')](function(_0x307245){logger['info']('UpdateCmHopperBlack',_0x375e61);logger[_0xd475('0xe')](_0xd475('0x1f'),_0x375e61,JSON[_0xd475('0xf')](_0x307245));_0xbc0a80(_0x307245);})[_0xd475('0x13')](function(_0x2e2ec6){logger[_0xd475('0x10')](_0xd475('0x1f'),_0x2e2ec6['message'],_0x375e61);_0xf8587b(_0x285be0[_0xd475('0x10')](0x1f4,_0x2e2ec6['message']));});});};exports[_0xd475('0x22')]=function(_0x265a06){var _0x5736ca=this;return new Promise(function(_0x443b17,_0x3c947e){return db[_0xd475('0x14')]['destroy']({'where':_0x265a06['options']?_0x265a06[_0xd475('0x16')][_0xd475('0x18')]||null:null})[_0xd475('0xa')](function(_0x2101f8){logger[_0xd475('0xb')](_0xd475('0x22'),_0x265a06);logger[_0xd475('0xe')](_0xd475('0x22'),_0x265a06,JSON['stringify'](_0x2101f8));_0x443b17(_0x2101f8);})[_0xd475('0x13')](function(_0x550709){logger[_0xd475('0x10')]('DestroyCmHopperBlack',_0x550709[_0xd475('0x12')],_0x265a06);_0x3c947e(_0x5736ca[_0xd475('0x10')](0x1f4,_0x550709[_0xd475('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 0e21b8a..2ce8ace 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 _0x57ca=['../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x55cfb5,_0x164a36){var _0x2de8ee=function(_0x1ff55d){while(--_0x1ff55d){_0x55cfb5['push'](_0x55cfb5['shift']());}};_0x2de8ee(++_0x164a36);}(_0x57ca,0x108));var _0xa57c=function(_0x5980a8,_0x271f1d){_0x5980a8=_0x5980a8-0x0;var _0x3e192c=_0x57ca[_0x5980a8];return _0x3e192c;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/:id',auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x10')](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2eb2=['/describe','describe','/:id','show','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4dc9b9,_0x34d4d0){var _0x26c484=function(_0x47e6ee){while(--_0x47e6ee){_0x4dc9b9['push'](_0x4dc9b9['shift']());}};_0x26c484(++_0x34d4d0);}(_0x2eb2,0x19f));var _0x22eb=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x2eb2[_0x257642];return _0x3d813b;};'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 fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/:id',auth[_0x22eb('0x8')](),controller['update']);router['delete'](_0x22eb('0xc'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);module[_0x22eb('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 474ed57..ca282bd 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 _0xd077=['dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','endtime','followuptime','diff','setDataValue'];(function(_0x47bea4,_0x33e820){var _0x12bb68=function(_0x32cbf5){while(--_0x32cbf5){_0x47bea4['push'](_0x47bea4['shift']());}};_0x12bb68(++_0x33e820);}(_0xd077,0x116));var _0x7d07=function(_0x388e52,_0x606e56){_0x388e52=_0x388e52-0x0;var _0x59521d=_0xd077[_0x388e52];return _0x59521d;};'use strict';var Sequelize=require(_0x7d07('0x0'));var moment=require(_0x7d07('0x1'));module[_0x7d07('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7d07('0x3')]},'scheduledat':{'type':Sequelize[_0x7d07('0x4')]},'countbusyretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7d07('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x7d07('0x3')]},'originatecalleridname':{'type':Sequelize[_0x7d07('0x3')]},'calleridnum':{'type':Sequelize[_0x7d07('0x3')]},'calleridname':{'type':Sequelize[_0x7d07('0x3')]},'starttime':{'type':Sequelize[_0x7d07('0x4')]},'responsetime':{'type':Sequelize[_0x7d07('0x4')]},'answertime':{'type':Sequelize[_0x7d07('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7d07('0x4')]},'ringtime':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7d07('0x3')]},'campaign':{'type':Sequelize[_0x7d07('0x3')]},'campaigntype':{'type':Sequelize[_0x7d07('0x3')]},'membername':{'type':Sequelize[_0x7d07('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x7d07('0x3')]},'secondDisposition':{'type':Sequelize[_0x7d07('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7d07('0x3')]},'dispositionat':{'type':Sequelize[_0x7d07('0x4')],'set':function(_0x12af19){var _0x570229=this['getDataValue'](_0x7d07('0x6'));if(_0x570229&&_0x12af19){this['setDataValue'](_0x7d07('0x7'),moment(_0x12af19)[_0x7d07('0x8')](moment(_0x570229),'seconds'));}return this[_0x7d07('0x9')](_0x7d07('0xa'),_0x12af19);}},'amd':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7d07('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x7d07('0x4')]},'recallme':{'type':Sequelize[_0x7d07('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7d07('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc8c=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','seconds','dispositionat'];(function(_0x38e8ac,_0x3222c3){var _0x3730ed=function(_0x28c4f9){while(--_0x28c4f9){_0x38e8ac['push'](_0x38e8ac['shift']());}};_0x3730ed(++_0x3222c3);}(_0xcc8c,0x151));var _0xccc8=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xcc8c[_0x176329];return _0x31997c;};'use strict';var Sequelize=require(_0xccc8('0x0'));var moment=require(_0xccc8('0x1'));module[_0xccc8('0x2')]={'state':{'type':Sequelize[_0xccc8('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xccc8('0x4')]},'scheduledat':{'type':Sequelize[_0xccc8('0x5')]},'countbusyretry':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xccc8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xccc8('0x4')]},'originatecalleridname':{'type':Sequelize[_0xccc8('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xccc8('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xccc8('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xccc8('0x5')]},'ringtime':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xccc8('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xccc8('0x4')]},'membername':{'type':Sequelize[_0xccc8('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xccc8('0x4')]},'secondDisposition':{'type':Sequelize[_0xccc8('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xccc8('0x5')],'set':function(_0x2bfbc7){var _0x3bc2f1=this[_0xccc8('0x6')](_0xccc8('0x7'));if(_0x3bc2f1&&_0x2bfbc7){this[_0xccc8('0x8')]('followuptime',moment(_0x2bfbc7)['diff'](moment(_0x3bc2f1),_0xccc8('0x9')));}return this[_0xccc8('0x8')](_0xccc8('0xa'),_0x2bfbc7);}},'amd':{'type':Sequelize[_0xccc8('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xccc8('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xccc8('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xccc8('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xccc8('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xccc8('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xccc8('0x5')]},'recallme':{'type':Sequelize[_0xccc8('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xccc8('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xccc8('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 201043e..ef00af7 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 _0xc6ac=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','CmHopperFinal','rawAttributes','fieldName','type'];(function(_0x37dd12,_0x24ce18){var _0x242477=function(_0x336a88){while(--_0x336a88){_0x37dd12['push'](_0x37dd12['shift']());}};_0x242477(++_0x24ce18);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4a2ddd,_0x5b4c18){_0x4a2ddd=_0x4a2ddd-0x0;var _0x99f902=_0xc6ac[_0x4a2ddd];return _0x99f902;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['describe']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')]()[_0xcc6a('0x27')](respondWithResult(_0x47c999,null))[_0xcc6a('0x4b')](handleError(_0x47c999,null));};exports['update']=function(_0x1c3bb8,_0x5e7bab){if(_0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')]){delete _0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'uniqueid':_0x1c3bb8['params']['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5e7bab,null))[_0xcc6a('0x27')](saveUpdates(_0x1c3bb8[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x5e7bab,null))[_0xcc6a('0x4b')](handleError(_0x5e7bab,null));};exports[_0xcc6a('0x4f')]=function(_0x431684,_0x392805,_0x31987f){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x431684[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db['sequelize']['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal'](_0xcc6a('0x59')))),'abandonedContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})[_0xcc6a('0x27')](handleEntityNotFound(_0x392805,null))[_0xcc6a('0x27')](respondWithResult(_0x392805,null))[_0xcc6a('0x4b')](handleError(_0x392805,null));};exports[_0xcc6a('0x5d')]=function(_0x3e76d7,_0x42bbc7,_0x2ad9a6){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x3e76d7[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x5e')))),_0xcc6a('0x5f')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x59')))),_0xcc6a('0x60')],[db[_0xcc6a('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x61')))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})['then'](handleEntityNotFound(_0x42bbc7,null))[_0xcc6a('0x27')](respondWithResult(_0x42bbc7,null))[_0xcc6a('0x4b')](handleError(_0x42bbc7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x72e53a,_0x5b61df,_0x3b4ce0){return db['VoiceQueue'][_0xcc6a('0x4a')]({'where':{'id':_0x72e53a[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5b61df,null))['then'](function(_0x3ce1eb){var _0x51390a;if(_0x3ce1eb){_0x51390a=squel[_0xcc6a('0x62')]()['into'](_0xcc6a('0x63'))[_0xcc6a('0x64')]([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'VoiceQueueId',_0xcc6a('0x69'),_0xcc6a('0x6a')],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),'phone')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'scheduledAt')['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(VoiceQueueId)',_0xcc6a('0x71'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x69'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'updatedAt')['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x72e53a['body'][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x65'))[_0xcc6a('0x79')]('cm_hopper')[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())['where'](_0xcc6a('0x7b')))[_0xcc6a('0x7c')](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0x51390a);}return[];})['then'](respondWithResult(_0x5b61df,null))['catch'](handleError(_0x5b61df,null));};exports[_0xcc6a('0x7d')]=function(_0x5be65b,_0xb42e9,_0x35a798){return db[_0xcc6a('0x7e')][_0xcc6a('0x4a')]({'where':{'id':_0x5be65b[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0xb42e9,null))[_0xcc6a('0x27')](function(_0x1746d8){var _0xc0d194;if(_0x1746d8){_0xc0d194=squel[_0xcc6a('0x62')]()[_0xcc6a('0x7f')](_0xcc6a('0x63'))['fromQuery']([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'CampaignId',_0xcc6a('0x69'),'updatedAt'],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),_0xcc6a('0x65'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x66'))['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(CampaignId)',_0xcc6a('0x80'))[_0xcc6a('0x6c')]('NOW()','createdAt')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x6a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))['where'](_0xcc6a('0x81'),_0x5be65b['params']['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x5be65b[_0xcc6a('0x4d')][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))['where'](_0xcc6a('0x78'),squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')]('phone')[_0xcc6a('0x79')](_0xcc6a('0x63'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id']['toString']())['where'](_0xcc6a('0x7b')))['group'](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0xc0d194);}return[];})[_0xcc6a('0x27')](respondWithResult(_0xb42e9,null))[_0xcc6a('0x4b')](handleError(_0xb42e9,null));};exports[_0xcc6a('0x82')]=function(_0x48b6e3,_0x10d731,_0x537e2b){return db['CmHopper'][_0xcc6a('0x83')]({'where':{'VoiceQueueId':_0x48b6e3['body'][_0xcc6a('0x71')],'CampaignId':_0x48b6e3[_0xcc6a('0x4d')]['CampaignId'],'ContactId':_0x48b6e3['body'][_0xcc6a('0x67')]}})['then'](handleEntityNotFound(_0x10d731,null))[_0xcc6a('0x27')](function(_0x3df510){if(_0x3df510){return _0x3df510;}return null;})[_0xcc6a('0x27')](respondWithResult(_0x10d731,null))[_0xcc6a('0x4b')](handleError(_0x10d731,null));}; \ No newline at end of file +var _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3d3583,_0x37313f){var _0x2ea96b=function(_0x200d00){while(--_0x200d00){_0x3d3583['push'](_0x3d3583['shift']());}};_0x2ea96b(++_0x37313f);}(_0x2a07,0x74));var _0x72a0=function(_0x4b719b,_0x440b42){_0x4b719b=_0x4b719b-0x0;var _0x90fbee=_0x2a07[_0x4b719b];return _0x90fbee;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index d963d5b..2a7555b 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 _0xd7d2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xd7d2,0x1c0));var _0x2d7d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd7d2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2d7d('0x0'));var util=require(_0x2d7d('0x1'));var logger=require(_0x2d7d('0x2'))(_0x2d7d('0x3'));var moment=require(_0x2d7d('0x4'));var BPromise=require(_0x2d7d('0x5'));var rp=require(_0x2d7d('0x6'));var fs=require('fs');var path=require(_0x2d7d('0x7'));var rimraf=require(_0x2d7d('0x8'));var config=require(_0x2d7d('0x9'));var attributes=require(_0x2d7d('0xa'));module[_0x2d7d('0xb')]=function(_0x67eb6d,_0x3f7b18){return _0x67eb6d['define'](_0x2d7d('0xc'),attributes,{'tableName':_0x2d7d('0xd'),'paranoid':![],'indexes':[{'name':_0x2d7d('0xe'),'fields':[_0x2d7d('0xe')]},{'name':'uniqueid','fields':[_0x2d7d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d5f=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6d5f,0xc0));var _0xf6d5=function(_0x41a1f0,_0x38013a){_0x41a1f0=_0x41a1f0-0x0;var _0x146553=_0x6d5f[_0x41a1f0];return _0x146553;};'use strict';var _=require(_0xf6d5('0x0'));var util=require('util');var logger=require(_0xf6d5('0x1'))(_0xf6d5('0x2'));var moment=require(_0xf6d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6d5('0x4'));var fs=require('fs');var path=require(_0xf6d5('0x5'));var rimraf=require('rimraf');var config=require(_0xf6d5('0x6'));var attributes=require(_0xf6d5('0x7'));module['exports']=function(_0x3b6de1,_0x26e89f){return _0x3b6de1[_0xf6d5('0x8')](_0xf6d5('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xf6d5('0xa'),'fields':[_0xf6d5('0xa')]},{'name':_0xf6d5('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 f284b0b..7a1f48c 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4188b1,_0x8003f8){var _0xe654d1=function(_0x556e7e){while(--_0x556e7e){_0x4188b1['push'](_0x4188b1['shift']());}};_0xe654d1(++_0x8003f8);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c0529,_0x5ec1ca){_0x2c0529=_0x2c0529-0x0;var _0x3d990f=_0xb10b[_0x2c0529];return _0x3d990f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x487044,_0x4ea0f3){var _0x1abdba=function(_0x1c4ee3){while(--_0x1c4ee3){_0x487044['push'](_0x487044['shift']());}};_0x1abdba(++_0x4ea0f3);}(_0xb10b,0x12a));var _0xbb10=function(_0x59e174,_0x43a286){_0x59e174=_0x59e174-0x0;var _0x2d581f=_0xb10b[_0x59e174];return _0x2d581f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6bf8b9e..74d12fa 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 _0x820d=['get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x820d,0x13e));var _0xd820=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x820d[_0x2df507];return _0x1f7167;};'use strict';var multer=require(_0xd820('0x0'));var util=require('util');var path=require(_0xd820('0x1'));var timeout=require(_0xd820('0x2'));var express=require('express');var router=express[_0xd820('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd820('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd820('0x5'));var controller=require(_0xd820('0x6'));router[_0xd820('0x7')]('/',auth[_0xd820('0x8')](),controller[_0xd820('0x9')]);router[_0xd820('0x7')](_0xd820('0xa'),auth[_0xd820('0x8')](),controller[_0xd820('0xb')]);router[_0xd820('0x7')]('/:id',auth[_0xd820('0x8')](),controller[_0xd820('0xc')]);router[_0xd820('0x7')](_0xd820('0xd'),auth[_0xd820('0x8')](),controller[_0xd820('0xe')]);router[_0xd820('0x7')](_0xd820('0xf'),auth[_0xd820('0x8')](),controller[_0xd820('0x10')]);router[_0xd820('0x11')](_0xd820('0x12'),auth[_0xd820('0x8')](),controller[_0xd820('0x13')]);router[_0xd820('0x11')](_0xd820('0x14'),auth[_0xd820('0x8')](),controller[_0xd820('0x15')]);router[_0xd820('0x11')]('/checkContactHopper',auth[_0xd820('0x8')](),controller[_0xd820('0x16')]);router[_0xd820('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0xd820('0x18')]=router; \ No newline at end of file +var _0x02bd=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update','exports'];(function(_0x104354,_0x1d5cdc){var _0x5ce198=function(_0x12a899){while(--_0x12a899){_0x104354['push'](_0x104354['shift']());}};_0x5ce198(++_0x1d5cdc);}(_0x02bd,0x6c));var _0xd02b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x02bd[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xd02b('0x0'));var util=require(_0xd02b('0x1'));var path=require('path');var timeout=require(_0xd02b('0x2'));var express=require('express');var router=express[_0xd02b('0x3')]();var fs_extra=require(_0xd02b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd02b('0x5'));var config=require(_0xd02b('0x6'));var controller=require(_0xd02b('0x7'));router['get']('/',auth[_0xd02b('0x8')](),controller[_0xd02b('0x9')]);router[_0xd02b('0xa')](_0xd02b('0xb'),auth[_0xd02b('0x8')](),controller[_0xd02b('0xc')]);router[_0xd02b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd02b('0xd')]);router['get']('/voice/queue/countAttributes/:id',auth[_0xd02b('0x8')](),controller[_0xd02b('0xe')]);router[_0xd02b('0xa')](_0xd02b('0xf'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xd02b('0x10')](_0xd02b('0x11'),auth[_0xd02b('0x8')](),controller[_0xd02b('0x12')]);router[_0xd02b('0x10')](_0xd02b('0x13'),auth['isAuthenticated'](),controller[_0xd02b('0x14')]);router['post'](_0xd02b('0x15'),auth['isAuthenticated'](),controller[_0xd02b('0x16')]);router[_0xd02b('0x17')](_0xd02b('0x18'),auth['isAuthenticated'](),controller[_0xd02b('0x19')]);module[_0xd02b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ec0bab0..5ca362e 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 _0xfc7e=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x53aff5,_0x588927){var _0x5a6f22=function(_0x1111f8){while(--_0x1111f8){_0x53aff5['push'](_0x53aff5['shift']());}};_0x5a6f22(++_0x588927);}(_0xfc7e,0x88));var _0xefc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc7e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xefc7('0x0'));module['exports']={'state':{'type':Sequelize[_0xefc7('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xefc7('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xefc7('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xefc7('0x2')]},'originatecalleridname':{'type':Sequelize[_0xefc7('0x2')]},'calleridnum':{'type':Sequelize[_0xefc7('0x2')]},'calleridname':{'type':Sequelize[_0xefc7('0x2')]},'starttime':{'type':Sequelize[_0xefc7('0x3')]},'responsetime':{'type':Sequelize[_0xefc7('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xefc7('0x3')]},'endtime':{'type':Sequelize[_0xefc7('0x3')]},'ringtime':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xefc7('0x2')]},'campaign':{'type':Sequelize[_0xefc7('0x2')]},'campaigntype':{'type':Sequelize[_0xefc7('0x2')]},'membername':{'type':Sequelize[_0xefc7('0x2')]},'reason':{'type':Sequelize[_0xefc7('0x2')]},'amd':{'type':Sequelize[_0xefc7('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xefc7('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xefc7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xefc7('0x3')]},'recallme':{'type':Sequelize[_0xefc7('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xefc7('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xefc7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c02=['BOOLEAN','sequelize','INTEGER','DATE','STRING'];(function(_0x17e58b,_0x2dce78){var _0x240457=function(_0x40db55){while(--_0x40db55){_0x17e58b['push'](_0x17e58b['shift']());}};_0x240457(++_0x2dce78);}(_0x4c02,0x1d2));var _0x24c0=function(_0x5b080b,_0xe34631){_0x5b080b=_0x5b080b-0x0;var _0x3d724c=_0x4c02[_0x5b080b];return _0x3d724c;};'use strict';var Sequelize=require(_0x24c0('0x0'));module['exports']={'state':{'type':Sequelize[_0x24c0('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x24c0('0x2')]},'countbusyretry':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x24c0('0x3')]},'originatecalleridname':{'type':Sequelize[_0x24c0('0x3')]},'calleridnum':{'type':Sequelize[_0x24c0('0x3')]},'calleridname':{'type':Sequelize[_0x24c0('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x24c0('0x2')]},'answertime':{'type':Sequelize[_0x24c0('0x2')]},'droptime':{'type':Sequelize[_0x24c0('0x2')]},'endtime':{'type':Sequelize[_0x24c0('0x2')]},'ringtime':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x24c0('0x3')]},'campaign':{'type':Sequelize[_0x24c0('0x3')]},'campaigntype':{'type':Sequelize[_0x24c0('0x3')]},'membername':{'type':Sequelize[_0x24c0('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x24c0('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x24c0('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x24c0('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x24c0('0x2')]},'edited':{'type':Sequelize[_0x24c0('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x24c0('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 431e4e1..cf5c51b 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 _0xe4c7=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','type','key','model','query','keys','intersection','fields','attributes','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xe4c7,0x153));var _0x7e4c=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0xe4c7[_0x53b6ae];return _0x34f4b2;};'use strict';var emlformat=require(_0x7e4c('0x0'));var rimraf=require(_0x7e4c('0x1'));var zipdir=require(_0x7e4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7e4c('0x3'));var moment=require('moment');var BPromise=require(_0x7e4c('0x4'));var Mustache=require(_0x7e4c('0x5'));var util=require(_0x7e4c('0x6'));var path=require(_0x7e4c('0x7'));var sox=require(_0x7e4c('0x8'));var csv=require(_0x7e4c('0x9'));var ejs=require(_0x7e4c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7e4c('0xb'));var jsforce=require(_0x7e4c('0xc'));var deskjs=require(_0x7e4c('0xd'));var toCsv=require(_0x7e4c('0x9'));var querystring=require(_0x7e4c('0xe'));var Papa=require(_0x7e4c('0xf'));var Redis=require('ioredis');var authService=require(_0x7e4c('0x10'));var qs=require(_0x7e4c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e4c('0x12'))(_0x7e4c('0x13'));var utils=require('../../config/utils');var config=require(_0x7e4c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e4c('0x15'))['db'];function respondWithStatusCode(_0x9839e3,_0x1303f3){_0x1303f3=_0x1303f3||0xcc;return function(_0x3b63fc){if(_0x3b63fc){return _0x9839e3['sendStatus'](_0x1303f3);}return _0x9839e3['status'](_0x1303f3)[_0x7e4c('0x16')]();};}function respondWithResult(_0x23dc0d,_0x44fbf8){_0x44fbf8=_0x44fbf8||0xc8;return function(_0x341d71){if(_0x341d71){return _0x23dc0d[_0x7e4c('0x17')](_0x44fbf8)[_0x7e4c('0x18')](_0x341d71);}};}function respondWithFilteredResult(_0x3ae8f5,_0x3bda41){return function(_0x34d8fe){if(_0x34d8fe){var _0x228c36=typeof _0x3bda41[_0x7e4c('0x19')]===_0x7e4c('0x1a')&&typeof _0x3bda41[_0x7e4c('0x1b')]===_0x7e4c('0x1a');var _0x116cf3=_0x34d8fe[_0x7e4c('0x1c')];var _0x5d5bdb=_0x228c36?0x0:_0x3bda41[_0x7e4c('0x19')];var _0x333d80=_0x228c36?_0x34d8fe[_0x7e4c('0x1c')]:_0x3bda41['offset']+_0x3bda41[_0x7e4c('0x1b')];var _0x1b4482;if(_0x333d80>=_0x116cf3){_0x333d80=_0x116cf3;_0x1b4482=0xc8;}else{_0x1b4482=0xce;}_0x3ae8f5['status'](_0x1b4482);return _0x3ae8f5[_0x7e4c('0x1d')]('Content-Range',_0x5d5bdb+'-'+_0x333d80+'/'+_0x116cf3)[_0x7e4c('0x18')](_0x34d8fe);}return null;};}function patchUpdates(_0x2daf0b){return function(_0x590796){try{jsonpatch[_0x7e4c('0x1e')](_0x590796,_0x2daf0b,!![]);}catch(_0x1565a5){return BPromise[_0x7e4c('0x1f')](_0x1565a5);}return _0x590796[_0x7e4c('0x20')]();};}function saveUpdates(_0x5f3bfb,_0x23eea8){return function(_0x7175ba){if(_0x7175ba){return _0x7175ba[_0x7e4c('0x21')](_0x5f3bfb)[_0x7e4c('0x22')](function(_0x1efd31){return _0x1efd31;});}return null;};}function removeEntity(_0x40c472,_0x4896bb){return function(_0x47ac52){if(_0x47ac52){return _0x47ac52[_0x7e4c('0x23')]()[_0x7e4c('0x22')](function(){_0x40c472['status'](0xcc)[_0x7e4c('0x16')]();});}};}function handleEntityNotFound(_0x1d36c6,_0x908353){return function(_0x102afb){if(!_0x102afb){_0x1d36c6[_0x7e4c('0x24')](0x194);}return _0x102afb;};}function handleError(_0x2237e8,_0x3fe3e2){_0x3fe3e2=_0x3fe3e2||0x1f4;return function(_0x4261bc){logger[_0x7e4c('0x25')](_0x4261bc[_0x7e4c('0x26')]);if(_0x4261bc['name']){delete _0x4261bc[_0x7e4c('0x27')];}_0x2237e8[_0x7e4c('0x17')](_0x3fe3e2)[_0x7e4c('0x28')](_0x4261bc);};}exports[_0x7e4c('0x29')]=function(_0xff5184,_0x3e8e2f){var _0x3e2579={},_0x27288f={},_0xe98a7b={'count':0x0,'rows':[]};var _0x4226f6=_[_0x7e4c('0x2a')](db[_0x7e4c('0x2b')]['rawAttributes'],function(_0x2b65de){return{'name':_0x2b65de['fieldName'],'type':_0x2b65de[_0x7e4c('0x2c')][_0x7e4c('0x2d')]};});_0x27288f[_0x7e4c('0x2e')]=_[_0x7e4c('0x2a')](_0x4226f6,_0x7e4c('0x27'));_0x27288f[_0x7e4c('0x2f')]=_[_0x7e4c('0x30')](_0xff5184['query']);_0x27288f['filters']=_[_0x7e4c('0x31')](_0x27288f[_0x7e4c('0x2e')],_0x27288f[_0x7e4c('0x2f')]);_0x3e2579['attributes']=_[_0x7e4c('0x31')](_0x27288f['model'],qs[_0x7e4c('0x32')](_0xff5184[_0x7e4c('0x2f')][_0x7e4c('0x32')]));_0x3e2579[_0x7e4c('0x33')]=_0x3e2579['attributes']['length']?_0x3e2579['attributes']:_0x27288f[_0x7e4c('0x2e')];if(!_0xff5184[_0x7e4c('0x2f')]['hasOwnProperty']('nolimit')){_0x3e2579[_0x7e4c('0x1b')]=qs[_0x7e4c('0x1b')](_0xff5184[_0x7e4c('0x2f')][_0x7e4c('0x1b')]);_0x3e2579[_0x7e4c('0x19')]=qs[_0x7e4c('0x19')](_0xff5184['query']['offset']);}_0x3e2579['order']=qs[_0x7e4c('0x34')](_0xff5184[_0x7e4c('0x2f')]['sort']);_0x3e2579[_0x7e4c('0x35')]=qs[_0x7e4c('0x36')](_[_0x7e4c('0x37')](_0xff5184['query'],_0x27288f[_0x7e4c('0x36')]),_0x4226f6);if(_0xff5184[_0x7e4c('0x2f')]['filter']){_0x3e2579[_0x7e4c('0x35')]=_[_0x7e4c('0x38')](_0x3e2579[_0x7e4c('0x35')],{'$or':_[_0x7e4c('0x2a')](_0x4226f6,function(_0x4e8499){if(_0x4e8499[_0x7e4c('0x2c')]!==_0x7e4c('0x39')){var _0x352385={};_0x352385[_0x4e8499[_0x7e4c('0x27')]]={'$like':'%'+_0xff5184['query']['filter']+'%'};return _0x352385;}})});}_0x3e2579=_['merge']({},_0x3e2579,_0xff5184[_0x7e4c('0x3a')]);var _0x16bc86={'where':_0x3e2579[_0x7e4c('0x35')]};return db[_0x7e4c('0x2b')]['count'](_0x16bc86)[_0x7e4c('0x22')](function(_0x2d1800){_0xe98a7b[_0x7e4c('0x1c')]=_0x2d1800;if(_0xff5184[_0x7e4c('0x2f')][_0x7e4c('0x3b')]){_0x3e2579[_0x7e4c('0x3c')]=[{'all':!![]}];}return db[_0x7e4c('0x2b')][_0x7e4c('0x3d')](_0x3e2579);})['then'](function(_0x50cecc){_0xe98a7b[_0x7e4c('0x3e')]=_0x50cecc;return _0xe98a7b;})[_0x7e4c('0x22')](respondWithFilteredResult(_0x3e8e2f,_0x3e2579))[_0x7e4c('0x3f')](handleError(_0x3e8e2f,null));};exports['show']=function(_0x4859d8,_0x3b21bd){var _0x2c5785={'raw':!![],'where':{'id':_0x4859d8[_0x7e4c('0x40')]['id']}},_0x1e0643={};_0x1e0643['model']=_[_0x7e4c('0x30')](db[_0x7e4c('0x2b')][_0x7e4c('0x41')]);_0x1e0643[_0x7e4c('0x2f')]=_[_0x7e4c('0x30')](_0x4859d8[_0x7e4c('0x2f')]);_0x1e0643[_0x7e4c('0x36')]=_[_0x7e4c('0x31')](_0x1e0643[_0x7e4c('0x2e')],_0x1e0643[_0x7e4c('0x2f')]);_0x2c5785['attributes']=_[_0x7e4c('0x31')](_0x1e0643[_0x7e4c('0x2e')],qs[_0x7e4c('0x32')](_0x4859d8[_0x7e4c('0x2f')][_0x7e4c('0x32')]));_0x2c5785[_0x7e4c('0x33')]=_0x2c5785[_0x7e4c('0x33')][_0x7e4c('0x42')]?_0x2c5785[_0x7e4c('0x33')]:_0x1e0643[_0x7e4c('0x2e')];if(_0x4859d8[_0x7e4c('0x2f')][_0x7e4c('0x3b')]){_0x2c5785[_0x7e4c('0x3c')]=[{'all':!![]}];}_0x2c5785=_[_0x7e4c('0x38')]({},_0x2c5785,_0x4859d8[_0x7e4c('0x3a')]);return db[_0x7e4c('0x2b')][_0x7e4c('0x43')](_0x2c5785)['then'](handleEntityNotFound(_0x3b21bd,null))['then'](respondWithResult(_0x3b21bd,null))['catch'](handleError(_0x3b21bd,null));};exports[_0x7e4c('0x44')]=function(_0x224a56,_0x3cdc66){return db[_0x7e4c('0x2b')]['create'](_0x224a56[_0x7e4c('0x45')],{})[_0x7e4c('0x22')](respondWithResult(_0x3cdc66,0xc9))['catch'](handleError(_0x3cdc66,null));};exports[_0x7e4c('0x46')]=function(_0x5e3566,_0x54ef53){return db[_0x7e4c('0x2b')][_0x7e4c('0x46')]()[_0x7e4c('0x22')](respondWithResult(_0x54ef53,null))[_0x7e4c('0x3f')](handleError(_0x54ef53,null));};exports[_0x7e4c('0x21')]=function(_0x201eb7,_0x2aed72){if(_0x201eb7[_0x7e4c('0x45')][_0x7e4c('0x47')]){delete _0x201eb7['body']['uniqueid'];}return db[_0x7e4c('0x2b')][_0x7e4c('0x43')]({'where':{'uniqueid':_0x201eb7['params']['id']}})[_0x7e4c('0x22')](handleEntityNotFound(_0x2aed72,null))[_0x7e4c('0x22')](saveUpdates(_0x201eb7[_0x7e4c('0x45')],null))[_0x7e4c('0x22')](respondWithResult(_0x2aed72,null))[_0x7e4c('0x3f')](handleError(_0x2aed72,null));}; \ No newline at end of file +var _0xd559=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','catch','describe','uniqueid','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','CmHopperHistory','fieldName','type','key','model','map','query','keys','filters','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd559,0x1ec));var _0x9d55=function(_0x160476,_0x5bdd7c){_0x160476=_0x160476-0x0;var _0x5dc472=_0xd559[_0x160476];return _0x5dc472;};'use strict';var emlformat=require(_0x9d55('0x0'));var rimraf=require(_0x9d55('0x1'));var zipdir=require(_0x9d55('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d55('0x3'));var moment=require(_0x9d55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d55('0x5'));var util=require(_0x9d55('0x6'));var path=require(_0x9d55('0x7'));var sox=require(_0x9d55('0x8'));var csv=require(_0x9d55('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d55('0xa'));var _=require(_0x9d55('0xb'));var squel=require(_0x9d55('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9d55('0xd'));var Papa=require(_0x9d55('0xe'));var Redis=require(_0x9d55('0xf'));var authService=require(_0x9d55('0x10'));var qs=require(_0x9d55('0x11'));var as=require(_0x9d55('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d55('0x13'))(_0x9d55('0x14'));var utils=require(_0x9d55('0x15'));var config=require(_0x9d55('0x16'));var licenseUtil=require(_0x9d55('0x17'));var db=require(_0x9d55('0x18'))['db'];function respondWithStatusCode(_0x4e6d61,_0x425b08){_0x425b08=_0x425b08||0xcc;return function(_0xdfc783){if(_0xdfc783){return _0x4e6d61['sendStatus'](_0x425b08);}return _0x4e6d61[_0x9d55('0x19')](_0x425b08)['end']();};}function respondWithResult(_0x1493fe,_0x1f8fdb){_0x1f8fdb=_0x1f8fdb||0xc8;return function(_0x168170){if(_0x168170){return _0x1493fe[_0x9d55('0x19')](_0x1f8fdb)[_0x9d55('0x1a')](_0x168170);}};}function respondWithFilteredResult(_0x165894,_0xf965ad){return function(_0x50561a){if(_0x50561a){var _0x5ec0d8=typeof _0xf965ad[_0x9d55('0x1b')]===_0x9d55('0x1c')&&typeof _0xf965ad[_0x9d55('0x1d')]===_0x9d55('0x1c');var _0x210934=_0x50561a[_0x9d55('0x1e')];var _0x8176=_0x5ec0d8?0x0:_0xf965ad['offset'];var _0xc70551=_0x5ec0d8?_0x50561a[_0x9d55('0x1e')]:_0xf965ad[_0x9d55('0x1b')]+_0xf965ad['limit'];var _0x2296b0;if(_0xc70551>=_0x210934){_0xc70551=_0x210934;_0x2296b0=0xc8;}else{_0x2296b0=0xce;}_0x165894[_0x9d55('0x19')](_0x2296b0);return _0x165894[_0x9d55('0x1f')](_0x9d55('0x20'),_0x8176+'-'+_0xc70551+'/'+_0x210934)[_0x9d55('0x1a')](_0x50561a);}return null;};}function patchUpdates(_0x4865c0){return function(_0x30eae9){try{jsonpatch[_0x9d55('0x21')](_0x30eae9,_0x4865c0,!![]);}catch(_0x42b0e5){return BPromise[_0x9d55('0x22')](_0x42b0e5);}return _0x30eae9['save']();};}function saveUpdates(_0x33e7f0,_0x1cc6c0){return function(_0x1172b7){if(_0x1172b7){return _0x1172b7[_0x9d55('0x23')](_0x33e7f0)[_0x9d55('0x24')](function(_0xf30d4b){return _0xf30d4b;});}return null;};}function removeEntity(_0x15c5da,_0x2a1fc9){return function(_0xad0896){if(_0xad0896){return _0xad0896[_0x9d55('0x25')]()[_0x9d55('0x24')](function(){_0x15c5da['status'](0xcc)[_0x9d55('0x26')]();});}};}function handleEntityNotFound(_0x5d846a,_0x1fd8d2){return function(_0x467352){if(!_0x467352){_0x5d846a[_0x9d55('0x27')](0x194);}return _0x467352;};}function handleError(_0x490479,_0x3a6719){_0x3a6719=_0x3a6719||0x1f4;return function(_0x3c9812){logger[_0x9d55('0x28')](_0x3c9812[_0x9d55('0x29')]);if(_0x3c9812[_0x9d55('0x2a')]){delete _0x3c9812[_0x9d55('0x2a')];}_0x490479['status'](_0x3a6719)[_0x9d55('0x2b')](_0x3c9812);};}exports['index']=function(_0x47970b,_0x37a17e){var _0x5ec332={},_0x15dd36={},_0x17469d={'count':0x0,'rows':[]};var _0x19de7a=_['map'](db[_0x9d55('0x2c')]['rawAttributes'],function(_0x456d26){return{'name':_0x456d26[_0x9d55('0x2d')],'type':_0x456d26[_0x9d55('0x2e')][_0x9d55('0x2f')]};});_0x15dd36[_0x9d55('0x30')]=_[_0x9d55('0x31')](_0x19de7a,_0x9d55('0x2a'));_0x15dd36[_0x9d55('0x32')]=_[_0x9d55('0x33')](_0x47970b[_0x9d55('0x32')]);_0x15dd36[_0x9d55('0x34')]=_['intersection'](_0x15dd36[_0x9d55('0x30')],_0x15dd36['query']);_0x5ec332[_0x9d55('0x35')]=_[_0x9d55('0x36')](_0x15dd36[_0x9d55('0x30')],qs[_0x9d55('0x37')](_0x47970b['query'][_0x9d55('0x37')]));_0x5ec332[_0x9d55('0x35')]=_0x5ec332['attributes'][_0x9d55('0x38')]?_0x5ec332[_0x9d55('0x35')]:_0x15dd36['model'];if(!_0x47970b['query'][_0x9d55('0x39')](_0x9d55('0x3a'))){_0x5ec332['limit']=qs[_0x9d55('0x1d')](_0x47970b[_0x9d55('0x32')][_0x9d55('0x1d')]);_0x5ec332[_0x9d55('0x1b')]=qs[_0x9d55('0x1b')](_0x47970b[_0x9d55('0x32')][_0x9d55('0x1b')]);}_0x5ec332[_0x9d55('0x3b')]=qs[_0x9d55('0x3c')](_0x47970b[_0x9d55('0x32')]['sort']);_0x5ec332[_0x9d55('0x3d')]=qs[_0x9d55('0x34')](_[_0x9d55('0x3e')](_0x47970b[_0x9d55('0x32')],_0x15dd36[_0x9d55('0x34')]),_0x19de7a);if(_0x47970b['query'][_0x9d55('0x3f')]){_0x5ec332[_0x9d55('0x3d')]=_[_0x9d55('0x40')](_0x5ec332[_0x9d55('0x3d')],{'$or':_[_0x9d55('0x31')](_0x19de7a,function(_0x9f958){if(_0x9f958['type']!==_0x9d55('0x41')){var _0x5dd697={};_0x5dd697[_0x9f958[_0x9d55('0x2a')]]={'$like':'%'+_0x47970b[_0x9d55('0x32')][_0x9d55('0x3f')]+'%'};return _0x5dd697;}})});}_0x5ec332=_[_0x9d55('0x40')]({},_0x5ec332,_0x47970b[_0x9d55('0x42')]);var _0x5ba8b7={'where':_0x5ec332[_0x9d55('0x3d')]};return db[_0x9d55('0x2c')][_0x9d55('0x1e')](_0x5ba8b7)['then'](function(_0x1c780b){_0x17469d['count']=_0x1c780b;if(_0x47970b[_0x9d55('0x32')][_0x9d55('0x43')]){_0x5ec332['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x9d55('0x44')](_0x5ec332);})[_0x9d55('0x24')](function(_0x3b53de){_0x17469d['rows']=_0x3b53de;return _0x17469d;})[_0x9d55('0x24')](respondWithFilteredResult(_0x37a17e,_0x5ec332))['catch'](handleError(_0x37a17e,null));};exports[_0x9d55('0x45')]=function(_0x385caf,_0x4618c8){var _0x24afe3={'raw':!![],'where':{'id':_0x385caf[_0x9d55('0x46')]['id']}},_0x1deb4b={};_0x1deb4b[_0x9d55('0x30')]=_['keys'](db[_0x9d55('0x2c')]['rawAttributes']);_0x1deb4b[_0x9d55('0x32')]=_[_0x9d55('0x33')](_0x385caf['query']);_0x1deb4b[_0x9d55('0x34')]=_['intersection'](_0x1deb4b[_0x9d55('0x30')],_0x1deb4b[_0x9d55('0x32')]);_0x24afe3[_0x9d55('0x35')]=_[_0x9d55('0x36')](_0x1deb4b[_0x9d55('0x30')],qs[_0x9d55('0x37')](_0x385caf[_0x9d55('0x32')][_0x9d55('0x37')]));_0x24afe3[_0x9d55('0x35')]=_0x24afe3['attributes'][_0x9d55('0x38')]?_0x24afe3[_0x9d55('0x35')]:_0x1deb4b[_0x9d55('0x30')];if(_0x385caf['query']['includeAll']){_0x24afe3[_0x9d55('0x47')]=[{'all':!![]}];}_0x24afe3=_[_0x9d55('0x40')]({},_0x24afe3,_0x385caf[_0x9d55('0x42')]);return db[_0x9d55('0x2c')][_0x9d55('0x48')](_0x24afe3)[_0x9d55('0x24')](handleEntityNotFound(_0x4618c8,null))[_0x9d55('0x24')](respondWithResult(_0x4618c8,null))['catch'](handleError(_0x4618c8,null));};exports[_0x9d55('0x49')]=function(_0x13da79,_0x33a5da){return db[_0x9d55('0x2c')][_0x9d55('0x49')](_0x13da79['body'],{})[_0x9d55('0x24')](respondWithResult(_0x33a5da,0xc9))[_0x9d55('0x4a')](handleError(_0x33a5da,null));};exports['describe']=function(_0x312c3f,_0x591334){return db[_0x9d55('0x2c')][_0x9d55('0x4b')]()[_0x9d55('0x24')](respondWithResult(_0x591334,null))[_0x9d55('0x4a')](handleError(_0x591334,null));};exports[_0x9d55('0x23')]=function(_0x54b02b,_0x10adfa){if(_0x54b02b['body'][_0x9d55('0x4c')]){delete _0x54b02b[_0x9d55('0x4d')][_0x9d55('0x4c')];}return db[_0x9d55('0x2c')][_0x9d55('0x48')]({'where':{'uniqueid':_0x54b02b[_0x9d55('0x46')]['id']}})[_0x9d55('0x24')](handleEntityNotFound(_0x10adfa,null))[_0x9d55('0x24')](saveUpdates(_0x54b02b[_0x9d55('0x4d')],null))[_0x9d55('0x24')](respondWithResult(_0x10adfa,null))[_0x9d55('0x4a')](handleError(_0x10adfa,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 91df627..198ffc5 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 _0xa880=['rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16bc47,_0x24037e){var _0x52a9c2=function(_0x121925){while(--_0x121925){_0x16bc47['push'](_0x16bc47['shift']());}};_0x52a9c2(++_0x24037e);}(_0xa880,0x106));var _0x0a88=function(_0x5a461e,_0xe83e49){_0x5a461e=_0x5a461e-0x0;var _0x1fac23=_0xa880[_0x5a461e];return _0x1fac23;};'use strict';var _=require(_0x0a88('0x0'));var util=require(_0x0a88('0x1'));var logger=require(_0x0a88('0x2'))(_0x0a88('0x3'));var moment=require(_0x0a88('0x4'));var BPromise=require(_0x0a88('0x5'));var rp=require(_0x0a88('0x6'));var fs=require('fs');var path=require(_0x0a88('0x7'));var rimraf=require(_0x0a88('0x8'));var config=require(_0x0a88('0x9'));var attributes=require(_0x0a88('0xa'));module['exports']=function(_0x35c530,_0x2aac39){return _0x35c530[_0x0a88('0xb')](_0x0a88('0xc'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x0a88('0xd'),'fields':[_0x0a88('0xd')]},{'name':_0x0a88('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4123=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x22c403,_0x37eb9c){var _0x236008=function(_0x45a0ed){while(--_0x45a0ed){_0x22c403['push'](_0x22c403['shift']());}};_0x236008(++_0x37eb9c);}(_0x4123,0x87));var _0x3412=function(_0x2d3146,_0x115b0e){_0x2d3146=_0x2d3146-0x0;var _0x4524ee=_0x4123[_0x2d3146];return _0x4524ee;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[{'name':_0x3412('0xd'),'fields':[_0x3412('0xd')]},{'name':'uniqueid','fields':[_0x3412('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 53cf85a..0968f79 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 _0x2e35=['outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','predictiveIntervalAvgTalktime','AvgHandleTime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2e35,0x1d0));var _0x52e3=function(_0x57c791,_0x34f4c1){_0x57c791=_0x57c791-0x0;var _0x64a54c=_0x2e35[_0x57c791];return _0x64a54c;};'use strict';var _=require(_0x52e3('0x0'));var util=require(_0x52e3('0x1'));var moment=require(_0x52e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x52e3('0x3'));var fs=require('fs');var Redis=require(_0x52e3('0x4'));var db=require(_0x52e3('0x5'))['db'];var utils=require(_0x52e3('0x6'));var logger=require('../../config/logger')(_0x52e3('0x7'));var config=require(_0x52e3('0x8'));var jayson=require(_0x52e3('0x9'));var client=jayson[_0x52e3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x483b93,_0x507a6c,_0x21ae13){return new BPromise(function(_0x4d77a0,_0x4b2662){return client[_0x52e3('0xb')](_0x483b93,_0x21ae13)[_0x52e3('0xc')](function(_0x551848){logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,'request\x20sent');logger[_0x52e3('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x507a6c,_0x52e3('0x10'),JSON[_0x52e3('0x11')](_0x551848));if(_0x551848[_0x52e3('0x12')]){if(_0x551848['error'][_0x52e3('0x13')]===0x1f4){logger[_0x52e3('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')]['message']);return _0x4b2662(_0x551848['error']['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x507a6c,_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);return _0x4d77a0(_0x551848[_0x52e3('0x12')][_0x52e3('0x14')]);}else{logger[_0x52e3('0xd')](_0x52e3('0xe'),_0x507a6c,_0x52e3('0x10'));_0x4d77a0(_0x551848[_0x52e3('0x15')][_0x52e3('0x14')]);}})[_0x52e3('0x16')](function(_0x3355e7){logger['error'](_0x52e3('0xe'),_0x507a6c,_0x3355e7);_0x4b2662(_0x3355e7);});});}exports[_0x52e3('0x17')]=function(_0x5d55e7){var _0x3088a2=this;return new Promise(function(_0x2e82e2,_0x1ed787){return db[_0x52e3('0x18')][_0x52e3('0x19')](_0x5d55e7[_0x52e3('0x1a')],{'raw':_0x5d55e7[_0x52e3('0x1b')]?_0x5d55e7[_0x52e3('0x1b')][_0x52e3('0x1c')]===undefined?!![]:![]:!![]})[_0x52e3('0xc')](function(_0x42593f){logger[_0x52e3('0xd')](_0x52e3('0x17'),_0x5d55e7);logger[_0x52e3('0xf')](_0x52e3('0x17'),_0x5d55e7,JSON['stringify'](_0x42593f));_0x2e82e2(_0x42593f);})['catch'](function(_0x588b92){logger[_0x52e3('0x12')]('CreateCmHopperHistory',_0x588b92['message'],_0x5d55e7);_0x1ed787(_0x3088a2['error'](0x1f4,_0x588b92[_0x52e3('0x14')]));});});};exports['AvgHandleTime']=function(_0x3010f9){var _0x4ae9d1=this;return new Promise(function(_0x2b6a40,_0x55babb){return db['CmHopperHistory'][_0x52e3('0x1d')]({'raw':_0x3010f9[_0x52e3('0x1b')]?_0x3010f9[_0x52e3('0x1b')][_0x52e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x3010f9['options']?_0x3010f9['options']['where']||null:null,'attributes':[[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')][_0x52e3('0x20')]('id')),_0x52e3('0x21')],[db['sequelize']['fn'](_0x52e3('0x1f'),db['sequelize']['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x23')))),_0x52e3('0x24')],[db['sequelize']['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x52e3('0x25')))),_0x52e3('0x26')],[db[_0x52e3('0x1e')]['fn']('COUNT',db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x27')))),_0x52e3('0x28')],[db[_0x52e3('0x1e')]['fn']('AVG',db[_0x52e3('0x1e')]['fn']('IF',db['sequelize'][_0x52e3('0x22')](_0x52e3('0x29')))),_0x52e3('0x2a')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x2b'),db['sequelize']['fn']('IF',db[_0x52e3('0x1e')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x52e3('0x2c')]]})[_0x52e3('0xc')](function(_0x1a1c67){logger[_0x52e3('0xd')](_0x52e3('0x2d'),_0x3010f9);logger['debug'](_0x52e3('0x2d'),_0x3010f9,JSON[_0x52e3('0x11')](_0x1a1c67));_0x2b6a40(_0x1a1c67);})[_0x52e3('0x16')](function(_0x18970b){logger['error']('AvgHandleTime',_0x18970b[_0x52e3('0x14')],_0x3010f9);_0x55babb(_0x4ae9d1[_0x52e3('0x12')](0x1f4,_0x18970b['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x5cd417){var _0x39ac64=this;return new Promise(function(_0x16faf9,_0x59dda1){return db[_0x52e3('0x18')]['findAll']({'raw':_0x5cd417[_0x52e3('0x1b')]?_0x5cd417[_0x52e3('0x1b')][_0x52e3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cd417[_0x52e3('0x1b')]?_0x5cd417[_0x52e3('0x1b')][_0x52e3('0x2e')]||null:null,'attributes':[[_0x52e3('0x2f'),_0x52e3('0x30')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x31')))),_0x52e3('0x32')],[db['sequelize']['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x52e3('0x33')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x23')))),_0x52e3('0x34')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')]['literal'](_0x52e3('0x35')))),_0x52e3('0x36')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x37')))),_0x52e3('0x38')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x39')))),_0x52e3('0x3a')],[db[_0x52e3('0x1e')]['fn']('COUNT',db[_0x52e3('0x1e')]['fn']('IF',db['sequelize'][_0x52e3('0x22')](_0x52e3('0x3b')))),'outboundDropCallsDayCallersExit'],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db['sequelize']['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x3c')))),_0x52e3('0x3d')],[db[_0x52e3('0x1e')]['fn']('COUNT',db[_0x52e3('0x1e')]['fn']('IF',db['sequelize'][_0x52e3('0x22')](_0x52e3('0x3e')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x52e3('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x52e3('0x22')](_0x52e3('0x3f')))),_0x52e3('0x40')],[db['sequelize']['fn'](_0x52e3('0x1f'),db['sequelize']['fn']('IF',db[_0x52e3('0x1e')]['literal'](_0x52e3('0x41')))),_0x52e3('0x42')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')]['literal'](_0x52e3('0x43')))),_0x52e3('0x44')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x45')))),_0x52e3('0x42')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')]['fn']('IF',db[_0x52e3('0x1e')][_0x52e3('0x22')](_0x52e3('0x46')))),'outboundReCallsDay']],'group':['campaign']})[_0x52e3('0xc')](function(_0x16ad75){logger[_0x52e3('0xd')]('GetVoiceQueueHopperHistory',_0x5cd417);logger[_0x52e3('0xf')](_0x52e3('0x47'),_0x5cd417,JSON[_0x52e3('0x11')](_0x16ad75));_0x16faf9(_0x16ad75);})[_0x52e3('0x16')](function(_0x31611b){logger['error'](_0x52e3('0x47'),_0x31611b[_0x52e3('0x14')],_0x5cd417);_0x59dda1(_0x39ac64[_0x52e3('0x12')](0x1f4,_0x31611b[_0x52e3('0x14')]));});});};exports[_0x52e3('0x48')]=function(_0x1ef2f2){var _0x2c3a6e=this;return new Promise(function(_0x22b34c,_0x11e318){return db[_0x52e3('0x18')][_0x52e3('0x1d')]({'raw':_0x1ef2f2[_0x52e3('0x1b')]?_0x1ef2f2[_0x52e3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ef2f2[_0x52e3('0x1b')]?_0x1ef2f2[_0x52e3('0x1b')]['where']||null:null,'attributes':[[_0x52e3('0x2f'),_0x52e3('0x30')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db[_0x52e3('0x1e')][_0x52e3('0x20')]('id')),_0x52e3('0x49')],[db[_0x52e3('0x1e')]['fn'](_0x52e3('0x1f'),db['sequelize']['fn']('IF',db[_0x52e3('0x1e')]['literal'](_0x52e3('0x23')))),_0x52e3('0x4a')]],'group':[_0x52e3('0x2f')]})[_0x52e3('0xc')](function(_0x5583a1){logger[_0x52e3('0xd')](_0x52e3('0x48'),_0x1ef2f2);logger[_0x52e3('0xf')](_0x52e3('0x48'),_0x1ef2f2,JSON[_0x52e3('0x11')](_0x5583a1));_0x22b34c(_0x5583a1);})[_0x52e3('0x16')](function(_0x4be409){logger['error'](_0x52e3('0x48'),_0x4be409['message'],_0x1ef2f2);_0x11e318(_0x2c3a6e[_0x52e3('0x12')](0x1f4,_0x4be409[_0x52e3('0x14')]));});});}; \ No newline at end of file +var _0x8a62=['`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','stringify','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay'];(function(_0x1f365b,_0x40f17a){var _0x1013ac=function(_0x4674c5){while(--_0x4674c5){_0x1f365b['push'](_0x1f365b['shift']());}};_0x1013ac(++_0x40f17a);}(_0x8a62,0x98));var _0x28a6=function(_0x53a0b9,_0x2b0a52){_0x53a0b9=_0x53a0b9-0x0;var _0x46231c=_0x8a62[_0x53a0b9];return _0x46231c;};'use strict';var _=require('lodash');var util=require(_0x28a6('0x0'));var moment=require(_0x28a6('0x1'));var BPromise=require(_0x28a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x28a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x28a6('0x4'));var logger=require(_0x28a6('0x5'))(_0x28a6('0x6'));var config=require(_0x28a6('0x7'));var jayson=require(_0x28a6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ebf91,_0x267ae0,_0x191a30){return new BPromise(function(_0x3dbb1b,_0x548664){return client[_0x28a6('0x9')](_0x3ebf91,_0x191a30)[_0x28a6('0xa')](function(_0x34c108){logger[_0x28a6('0xb')](_0x28a6('0xc'),_0x267ae0,_0x28a6('0xd'));logger[_0x28a6('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x267ae0,_0x28a6('0xd'),JSON['stringify'](_0x34c108));if(_0x34c108[_0x28a6('0xf')]){if(_0x34c108[_0x28a6('0xf')][_0x28a6('0x10')]===0x1f4){logger[_0x28a6('0xf')](_0x28a6('0xc'),_0x267ae0,_0x34c108[_0x28a6('0xf')][_0x28a6('0x11')]);return _0x548664(_0x34c108['error']['message']);}logger['error'](_0x28a6('0xc'),_0x267ae0,_0x34c108['error'][_0x28a6('0x11')]);return _0x3dbb1b(_0x34c108['error'][_0x28a6('0x11')]);}else{logger['info'](_0x28a6('0xc'),_0x267ae0,'request\x20sent');_0x3dbb1b(_0x34c108[_0x28a6('0x12')][_0x28a6('0x11')]);}})[_0x28a6('0x13')](function(_0x2ea307){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x267ae0,_0x2ea307);_0x548664(_0x2ea307);});});}exports[_0x28a6('0x14')]=function(_0x4bd728){var _0xd28a40=this;return new Promise(function(_0x189e50,_0x102d70){return db[_0x28a6('0x15')][_0x28a6('0x16')](_0x4bd728['body'],{'raw':_0x4bd728[_0x28a6('0x17')]?_0x4bd728[_0x28a6('0x17')][_0x28a6('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3545cb){logger[_0x28a6('0xb')](_0x28a6('0x14'),_0x4bd728);logger[_0x28a6('0xe')](_0x28a6('0x14'),_0x4bd728,JSON['stringify'](_0x3545cb));_0x189e50(_0x3545cb);})[_0x28a6('0x13')](function(_0x18659f){logger['error']('CreateCmHopperHistory',_0x18659f['message'],_0x4bd728);_0x102d70(_0xd28a40[_0x28a6('0xf')](0x1f4,_0x18659f[_0x28a6('0x11')]));});});};exports[_0x28a6('0x19')]=function(_0x56df62){var _0x370d8c=this;return new Promise(function(_0xe62522,_0x2c52a2){return db['CmHopperHistory'][_0x28a6('0x1a')]({'raw':_0x56df62[_0x28a6('0x17')]?_0x56df62[_0x28a6('0x17')][_0x28a6('0x18')]===undefined?!![]:![]:!![],'where':_0x56df62['options']?_0x56df62[_0x28a6('0x17')][_0x28a6('0x1b')]||null:null,'attributes':[[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db['sequelize'][_0x28a6('0x1e')]('id')),_0x28a6('0x1f')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x21')))),_0x28a6('0x22')],[db[_0x28a6('0x1c')]['fn']('COUNT',db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x23')))),_0x28a6('0x24')],[db[_0x28a6('0x1c')]['fn']('COUNT',db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x25')))),_0x28a6('0x26')],[db['sequelize']['fn']('AVG',db[_0x28a6('0x1c')]['fn']('IF',db['sequelize'][_0x28a6('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x28a6('0x27')],[db[_0x28a6('0x1c')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x28a6('0xa')](function(_0xb4b6e8){logger['info'](_0x28a6('0x19'),_0x56df62);logger['debug'](_0x28a6('0x19'),_0x56df62,JSON[_0x28a6('0x29')](_0xb4b6e8));_0xe62522(_0xb4b6e8);})[_0x28a6('0x13')](function(_0x153f7a){logger[_0x28a6('0xf')](_0x28a6('0x19'),_0x153f7a[_0x28a6('0x11')],_0x56df62);_0x2c52a2(_0x370d8c['error'](0x1f4,_0x153f7a[_0x28a6('0x11')]));});});};exports[_0x28a6('0x2a')]=function(_0x2f4a34){var _0x1342ad=this;return new Promise(function(_0x2a2845,_0x56fc8a){return db[_0x28a6('0x15')]['findAll']({'raw':_0x2f4a34[_0x28a6('0x17')]?_0x2f4a34['options'][_0x28a6('0x18')]===undefined?!![]:![]:!![],'where':_0x2f4a34['options']?_0x2f4a34[_0x28a6('0x17')][_0x28a6('0x1b')]||null:null,'attributes':[[_0x28a6('0x2b'),_0x28a6('0x2c')],[db['sequelize']['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')]['literal'](_0x28a6('0x2d')))),_0x28a6('0x2e')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x2f')))),_0x28a6('0x30')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x21')))),_0x28a6('0x31')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x32')))),_0x28a6('0x33')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')]['literal'](_0x28a6('0x34')))),_0x28a6('0x35')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db['sequelize']['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x36')))),_0x28a6('0x37')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x38')))),_0x28a6('0x39')],[db['sequelize']['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db['sequelize'][_0x28a6('0x20')]('`state`\x20=\x2013,\x201,\x20null'))),_0x28a6('0x3a')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x3b')))),_0x28a6('0x3c')],[db['sequelize']['fn'](_0x28a6('0x1d'),db['sequelize']['fn']('IF',db[_0x28a6('0x1c')]['literal'](_0x28a6('0x3d')))),_0x28a6('0x3e')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x3f')))),_0x28a6('0x40')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x41')))),_0x28a6('0x3e')],[db[_0x28a6('0x1c')]['fn'](_0x28a6('0x1d'),db[_0x28a6('0x1c')]['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x42')))),_0x28a6('0x43')]],'group':[_0x28a6('0x2b')]})['then'](function(_0x1531ea){logger[_0x28a6('0xb')](_0x28a6('0x2a'),_0x2f4a34);logger[_0x28a6('0xe')](_0x28a6('0x2a'),_0x2f4a34,JSON[_0x28a6('0x29')](_0x1531ea));_0x2a2845(_0x1531ea);})[_0x28a6('0x13')](function(_0x20b864){logger[_0x28a6('0xf')](_0x28a6('0x2a'),_0x20b864[_0x28a6('0x11')],_0x2f4a34);_0x56fc8a(_0x1342ad[_0x28a6('0xf')](0x1f4,_0x20b864['message']));});});};exports[_0x28a6('0x44')]=function(_0x16321c){var _0x143761=this;return new Promise(function(_0x2f56b9,_0xbb33ac){return db['CmHopperHistory'][_0x28a6('0x1a')]({'raw':_0x16321c[_0x28a6('0x17')]?_0x16321c[_0x28a6('0x17')][_0x28a6('0x18')]===undefined?!![]:![]:!![],'where':_0x16321c[_0x28a6('0x17')]?_0x16321c[_0x28a6('0x17')][_0x28a6('0x1b')]||null:null,'attributes':[[_0x28a6('0x2b'),_0x28a6('0x2c')],[db[_0x28a6('0x1c')]['fn']('COUNT',db[_0x28a6('0x1c')]['col']('id')),_0x28a6('0x45')],[db['sequelize']['fn'](_0x28a6('0x1d'),db['sequelize']['fn']('IF',db[_0x28a6('0x1c')][_0x28a6('0x20')](_0x28a6('0x21')))),_0x28a6('0x46')]],'group':[_0x28a6('0x2b')]})[_0x28a6('0xa')](function(_0x2dd255){logger['info'](_0x28a6('0x44'),_0x16321c);logger['debug'](_0x28a6('0x44'),_0x16321c,JSON[_0x28a6('0x29')](_0x2dd255));_0x2f56b9(_0x2dd255);})[_0x28a6('0x13')](function(_0x1adb0a){logger[_0x28a6('0xf')](_0x28a6('0x44'),_0x1adb0a['message'],_0x16321c);_0xbb33ac(_0x143761[_0x28a6('0xf')](0x1f4,_0x1adb0a[_0x28a6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index be17179..a19d9b2 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 _0x4699=['../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','/:id','post','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x57ec65,_0x3154f3){var _0x518085=function(_0x15500a){while(--_0x15500a){_0x57ec65['push'](_0x57ec65['shift']());}};_0x518085(++_0x3154f3);}(_0x4699,0xd6));var _0x9469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4699[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9469('0x0'));var util=require(_0x9469('0x1'));var path=require(_0x9469('0x2'));var timeout=require(_0x9469('0x3'));var express=require('express');var router=express[_0x9469('0x4')]();var fs_extra=require(_0x9469('0x5'));var auth=require(_0x9469('0x6'));var interaction=require(_0x9469('0x7'));var config=require(_0x9469('0x8'));var controller=require(_0x9469('0x9'));router['get']('/',auth[_0x9469('0xa')](),controller[_0x9469('0xb')]);router[_0x9469('0xc')](_0x9469('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x9469('0xc')](_0x9469('0xe'),auth[_0x9469('0xa')](),controller['show']);router[_0x9469('0xf')]('/',auth[_0x9469('0xa')](),controller['create']);router['put'](_0x9469('0xe'),auth[_0x9469('0xa')](),controller['update']);module[_0x9469('0x10')]=router; \ No newline at end of file +var _0xde83=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4be447,_0x156488){var _0xc58d=function(_0x18e09f){while(--_0x18e09f){_0x4be447['push'](_0x4be447['shift']());}};_0xc58d(++_0x156488);}(_0xde83,0x102));var _0x3de8=function(_0x559a80,_0x3d193d){_0x559a80=_0x559a80-0x0;var _0x42f555=_0xde83[_0x559a80];return _0x42f555;};'use strict';var multer=require('multer');var util=require(_0x3de8('0x0'));var path=require(_0x3de8('0x1'));var timeout=require(_0x3de8('0x2'));var express=require(_0x3de8('0x3'));var router=express[_0x3de8('0x4')]();var fs_extra=require(_0x3de8('0x5'));var auth=require(_0x3de8('0x6'));var interaction=require(_0x3de8('0x7'));var config=require(_0x3de8('0x8'));var controller=require(_0x3de8('0x9'));router[_0x3de8('0xa')]('/',auth[_0x3de8('0xb')](),controller[_0x3de8('0xc')]);router[_0x3de8('0xa')]('/describe',auth[_0x3de8('0xb')](),controller[_0x3de8('0xd')]);router[_0x3de8('0xa')]('/:id',auth[_0x3de8('0xb')](),controller[_0x3de8('0xe')]);router[_0x3de8('0xf')]('/',auth[_0x3de8('0xb')](),controller['create']);router[_0x3de8('0x10')]('/:id',auth[_0x3de8('0xb')](),controller[_0x3de8('0x11')]);module[_0x3de8('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c5d24cc..7fff7cf 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 _0xa74a=['STRING','name','sequelize','exports'];(function(_0x4c5179,_0x225f3d){var _0xc58202=function(_0x4aa179){while(--_0x4aa179){_0x4c5179['push'](_0x4c5179['shift']());}};_0xc58202(++_0x225f3d);}(_0xa74a,0x66));var _0xaa74=function(_0x105140,_0x5b2597){_0x105140=_0x105140-0x0;var _0x591d70=_0xa74a[_0x105140];return _0x591d70;};'use strict';var Sequelize=require(_0xaa74('0x0'));module[_0xaa74('0x1')]={'name':{'type':Sequelize[_0xaa74('0x2')],'unique':_0xaa74('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaa74('0x2')]},'dialPrefix':{'type':Sequelize[_0xaa74('0x2')]}}; \ No newline at end of file +var _0xb205=['sequelize','exports','STRING','name'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb205,0xf0));var _0x5b20=function(_0x2716a3,_0x3f7e6a){_0x2716a3=_0x2716a3-0x0;var _0x5db2d7=_0xb205[_0x2716a3];return _0x5db2d7;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'name':{'type':Sequelize[_0x5b20('0x2')],'unique':_0x5b20('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5b20('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a20560b..65c60c7 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 _0x4611=['../../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','./cmList.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Lists','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','CmList','includeAll','include','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','find','ListId','Disposition','getDispositions','findOne','nolimit','findAll','rows','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','pick','raw','getContactsCsv','now','writeFileSync','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','findAndCountAll','addAgents','ids','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1674b2,_0x569ad5){var _0x20e8b3=function(_0x2d7269){while(--_0x2d7269){_0x1674b2['push'](_0x1674b2['shift']());}};_0x20e8b3(++_0x569ad5);}(_0x4611,0x1ba));var _0x1461=function(_0xf4050f,_0xefc6bb){_0xf4050f=_0xf4050f-0x0;var _0x42baab=_0x4611[_0xf4050f];return _0x42baab;};'use strict';var emlformat=require(_0x1461('0x0'));var rimraf=require(_0x1461('0x1'));var zipdir=require(_0x1461('0x2'));var jsonpatch=require(_0x1461('0x3'));var rp=require(_0x1461('0x4'));var moment=require(_0x1461('0x5'));var BPromise=require(_0x1461('0x6'));var Mustache=require(_0x1461('0x7'));var util=require('util');var path=require(_0x1461('0x8'));var sox=require(_0x1461('0x9'));var csv=require(_0x1461('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1461('0xb'));var _=require(_0x1461('0xc'));var squel=require(_0x1461('0xd'));var crypto=require(_0x1461('0xe'));var jsforce=require(_0x1461('0xf'));var deskjs=require(_0x1461('0x10'));var toCsv=require(_0x1461('0xa'));var querystring=require(_0x1461('0x11'));var Papa=require(_0x1461('0x12'));var Redis=require(_0x1461('0x13'));var authService=require(_0x1461('0x14'));var qs=require(_0x1461('0x15'));var as=require(_0x1461('0x16'));var hardwareService=require(_0x1461('0x17'));var logger=require(_0x1461('0x18'))(_0x1461('0x19'));var utils=require(_0x1461('0x1a'));var config=require(_0x1461('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1461('0x1c'))['db'];config[_0x1461('0x1d')]=_[_0x1461('0x1e')](config[_0x1461('0x1d')],{'host':_0x1461('0x1f'),'port':0x18eb});var socket=require(_0x1461('0x20'))(new Redis(config[_0x1461('0x1d')]));require(_0x1461('0x21'))[_0x1461('0x22')](socket);function respondWithStatusCode(_0x48f12f,_0x1fb718){_0x1fb718=_0x1fb718||0xcc;return function(_0x23940e){if(_0x23940e){return _0x48f12f[_0x1461('0x23')](_0x1fb718);}return _0x48f12f['status'](_0x1fb718)[_0x1461('0x24')]();};}function respondWithResult(_0x3b280e,_0x22bebd){_0x22bebd=_0x22bebd||0xc8;return function(_0x278d56){if(_0x278d56){return _0x3b280e[_0x1461('0x25')](_0x22bebd)[_0x1461('0x26')](_0x278d56);}};}function respondWithFilteredResult(_0xa1997c,_0x1121ce){return function(_0x8424a8){if(_0x8424a8){var _0x39b00c=typeof _0x1121ce[_0x1461('0x27')]===_0x1461('0x28')&&typeof _0x1121ce[_0x1461('0x29')]==='undefined';var _0x5d5248=_0x8424a8[_0x1461('0x2a')];var _0x22b4eb=_0x39b00c?0x0:_0x1121ce[_0x1461('0x27')];var _0x1d6771=_0x39b00c?_0x8424a8[_0x1461('0x2a')]:_0x1121ce[_0x1461('0x27')]+_0x1121ce['limit'];var _0x28157c;if(_0x1d6771>=_0x5d5248){_0x1d6771=_0x5d5248;_0x28157c=0xc8;}else{_0x28157c=0xce;}_0xa1997c[_0x1461('0x25')](_0x28157c);return _0xa1997c[_0x1461('0x2b')](_0x1461('0x2c'),_0x22b4eb+'-'+_0x1d6771+'/'+_0x5d5248)['json'](_0x8424a8);}return null;};}function patchUpdates(_0x3ae87d){return function(_0x2085f5){try{jsonpatch[_0x1461('0x2d')](_0x2085f5,_0x3ae87d,!![]);}catch(_0x15cd54){return BPromise[_0x1461('0x2e')](_0x15cd54);}return _0x2085f5[_0x1461('0x2f')]();};}function saveUpdates(_0x26d471,_0x77c4e8){return function(_0xdd82c8){if(_0xdd82c8){return _0xdd82c8[_0x1461('0x30')](_0x26d471)['then'](function(_0x76642f){return _0x76642f;});}return null;};}function removeEntity(_0x3e4e43,_0x5d7b0d){return function(_0x5d733e){if(_0x5d733e){return _0x5d733e[_0x1461('0x31')]()[_0x1461('0x32')](function(){var _0x38d390=_0x5d733e[_0x1461('0x33')]({'plain':!![]});var _0x11cd9a=_0x1461('0x34');return db['UserProfileResource'][_0x1461('0x31')]({'where':{'type':_0x11cd9a,'resourceId':_0x38d390['id']}})[_0x1461('0x32')](function(){return _0x5d733e;});})[_0x1461('0x32')](function(){_0x3e4e43[_0x1461('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x266ce1,_0xa0d1b4){return function(_0xea47e4){if(!_0xea47e4){_0x266ce1[_0x1461('0x23')](0x194);}return _0xea47e4;};}function handleError(_0x9d2b01,_0x208838){_0x208838=_0x208838||0x1f4;return function(_0x3f21dd){logger[_0x1461('0x35')](_0x3f21dd[_0x1461('0x36')]);if(_0x3f21dd[_0x1461('0x37')]){delete _0x3f21dd[_0x1461('0x37')];}_0x9d2b01[_0x1461('0x25')](_0x208838)[_0x1461('0x38')](_0x3f21dd);};}exports['index']=function(_0x21cdf7,_0x4aab46){var _0x5b1af4={},_0x337428={},_0x3d8e48={'count':0x0,'rows':[]};var _0xbd751a=_[_0x1461('0x39')](db['CmList'][_0x1461('0x3a')],function(_0x2c5bd8){return{'name':_0x2c5bd8[_0x1461('0x3b')],'type':_0x2c5bd8[_0x1461('0x3c')][_0x1461('0x3d')]};});_0x337428[_0x1461('0x3e')]=_['map'](_0xbd751a,_0x1461('0x37'));_0x337428[_0x1461('0x3f')]=_[_0x1461('0x40')](_0x21cdf7[_0x1461('0x3f')]);_0x337428[_0x1461('0x41')]=_[_0x1461('0x42')](_0x337428[_0x1461('0x3e')],_0x337428['query']);_0x5b1af4[_0x1461('0x43')]=_[_0x1461('0x42')](_0x337428[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x21cdf7[_0x1461('0x3f')][_0x1461('0x44')]));_0x5b1af4[_0x1461('0x43')]=_0x5b1af4['attributes'][_0x1461('0x45')]?_0x5b1af4[_0x1461('0x43')]:_0x337428[_0x1461('0x3e')];if(!_0x21cdf7[_0x1461('0x3f')][_0x1461('0x46')]('nolimit')){_0x5b1af4['limit']=qs[_0x1461('0x29')](_0x21cdf7[_0x1461('0x3f')][_0x1461('0x29')]);_0x5b1af4[_0x1461('0x27')]=qs[_0x1461('0x27')](_0x21cdf7[_0x1461('0x3f')][_0x1461('0x27')]);}_0x5b1af4[_0x1461('0x47')]=qs[_0x1461('0x48')](_0x21cdf7['query'][_0x1461('0x48')]);_0x5b1af4[_0x1461('0x49')]=qs['filters'](_['pick'](_0x21cdf7['query'],_0x337428[_0x1461('0x41')]),_0xbd751a);if(_0x21cdf7[_0x1461('0x3f')][_0x1461('0x4a')]){_0x5b1af4[_0x1461('0x49')]=_[_0x1461('0x4b')](_0x5b1af4[_0x1461('0x49')],{'$or':_[_0x1461('0x39')](_0xbd751a,function(_0x2ab8dc){if(_0x2ab8dc[_0x1461('0x3c')]!==_0x1461('0x4c')){var _0x299e90={};_0x299e90[_0x2ab8dc[_0x1461('0x37')]]={'$like':'%'+_0x21cdf7[_0x1461('0x3f')][_0x1461('0x4a')]+'%'};return _0x299e90;}})});}_0x5b1af4=_[_0x1461('0x4b')]({},_0x5b1af4,_0x21cdf7[_0x1461('0x4d')]);var _0x3b9265={'where':_0x5b1af4[_0x1461('0x49')]};return db[_0x1461('0x4e')][_0x1461('0x2a')](_0x3b9265)[_0x1461('0x32')](function(_0x54fac8){_0x3d8e48[_0x1461('0x2a')]=_0x54fac8;if(_0x21cdf7[_0x1461('0x3f')][_0x1461('0x4f')]){_0x5b1af4[_0x1461('0x50')]=[{'all':!![]}];}return db[_0x1461('0x4e')]['findAll'](_0x5b1af4);})[_0x1461('0x32')](function(_0x18295f){_0x3d8e48['rows']=_0x18295f;return _0x3d8e48;})[_0x1461('0x32')](respondWithFilteredResult(_0x4aab46,_0x5b1af4))[_0x1461('0x51')](handleError(_0x4aab46,null));};exports[_0x1461('0x52')]=function(_0x20d62a,_0x49f338){var _0x2e81df={'raw':![],'where':{'id':_0x20d62a[_0x1461('0x53')]['id']}},_0x4ae8e2={};_0x4ae8e2[_0x1461('0x3e')]=_[_0x1461('0x40')](db[_0x1461('0x4e')][_0x1461('0x3a')]);_0x4ae8e2[_0x1461('0x3f')]=_[_0x1461('0x40')](_0x20d62a[_0x1461('0x3f')]);_0x4ae8e2[_0x1461('0x41')]=_[_0x1461('0x42')](_0x4ae8e2[_0x1461('0x3e')],_0x4ae8e2[_0x1461('0x3f')]);_0x2e81df[_0x1461('0x43')]=_[_0x1461('0x42')](_0x4ae8e2[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x20d62a[_0x1461('0x3f')][_0x1461('0x44')]));_0x2e81df[_0x1461('0x43')]=_0x2e81df['attributes'][_0x1461('0x45')]?_0x2e81df[_0x1461('0x43')]:_0x4ae8e2[_0x1461('0x3e')];if(_0x20d62a[_0x1461('0x3f')][_0x1461('0x4f')]){_0x2e81df[_0x1461('0x50')]=[{'all':!![]}];}_0x2e81df=_['merge']({},_0x2e81df,_0x20d62a[_0x1461('0x4d')]);return db[_0x1461('0x4e')]['find'](_0x2e81df)[_0x1461('0x32')](handleEntityNotFound(_0x49f338,null))[_0x1461('0x32')](respondWithResult(_0x49f338,null))[_0x1461('0x51')](handleError(_0x49f338,null));};exports[_0x1461('0x54')]=function(_0x348b16,_0x36df88){return db[_0x1461('0x4e')][_0x1461('0x54')](_0x348b16[_0x1461('0x55')],{})['then'](function(_0x45d017){var _0x43a6f3=_0x348b16['user'][_0x1461('0x33')]({'plain':!![]});if(!_0x43a6f3)throw new Error(_0x1461('0x56'));if(_0x43a6f3[_0x1461('0x57')]==='user'){var _0x5cf650=_0x45d017['get']({'plain':!![]});var _0x5a9a1b=_0x1461('0x34');return db[_0x1461('0x58')]['find']({'where':{'name':_0x5a9a1b,'userProfileId':_0x43a6f3[_0x1461('0x59')]},'raw':!![]})[_0x1461('0x32')](function(_0x2551e4){if(_0x2551e4&&_0x2551e4[_0x1461('0x5a')]===0x0){return db[_0x1461('0x5b')][_0x1461('0x54')]({'name':_0x5cf650['name'],'resourceId':_0x5cf650['id'],'type':_0x2551e4[_0x1461('0x37')],'sectionId':_0x2551e4['id']},{})[_0x1461('0x32')](function(){return _0x45d017;});}else{return _0x45d017;}})[_0x1461('0x51')](function(_0x57a6fb){logger[_0x1461('0x35')](_0x1461('0x5c'),_0x57a6fb);throw _0x57a6fb;});}return _0x45d017;})[_0x1461('0x32')](respondWithResult(_0x36df88,0xc9))[_0x1461('0x51')](handleError(_0x36df88,null));};exports[_0x1461('0x30')]=function(_0x1e27db,_0x54f4c7){if(_0x1e27db[_0x1461('0x55')]['id']){delete _0x1e27db[_0x1461('0x55')]['id'];}return db[_0x1461('0x4e')]['find']({'where':{'id':_0x1e27db['params']['id']}})[_0x1461('0x32')](handleEntityNotFound(_0x54f4c7,null))['then'](saveUpdates(_0x1e27db['body'],null))[_0x1461('0x32')](respondWithResult(_0x54f4c7,null))[_0x1461('0x51')](handleError(_0x54f4c7,null));};exports[_0x1461('0x31')]=function(_0x342a86,_0xb0e889){return db[_0x1461('0x4e')]['find']({'where':{'id':_0x342a86[_0x1461('0x53')]['id']}})[_0x1461('0x32')](handleEntityNotFound(_0xb0e889,null))['then'](removeEntity(_0xb0e889,null))[_0x1461('0x51')](handleError(_0xb0e889,null));};exports[_0x1461('0x5d')]=function(_0x5f3b4d,_0x227da1){return db[_0x1461('0x4e')]['describe']()[_0x1461('0x32')](respondWithResult(_0x227da1,null))[_0x1461('0x51')](handleError(_0x227da1,null));};exports['addDisposition']=function(_0x214fcf,_0x8264d7,_0x16bc72){if(_0x214fcf[_0x1461('0x55')]['id']){delete _0x214fcf[_0x1461('0x55')]['id'];}return db['CmList'][_0x1461('0x5e')]({'where':{'id':_0x214fcf[_0x1461('0x53')]['id']}})['then'](handleEntityNotFound(_0x8264d7,null))['then'](function(_0x11e4ef){if(_0x11e4ef){_0x214fcf['body'][_0x1461('0x5f')]=_0x11e4ef['id'];return db[_0x1461('0x60')][_0x1461('0x54')](_0x214fcf[_0x1461('0x55')]);}})[_0x1461('0x32')](respondWithResult(_0x8264d7,null))['catch'](handleError(_0x8264d7,null));};exports[_0x1461('0x61')]=function(_0x5bbfc0,_0x53d842,_0x422beb){var _0x36d7e9={'raw':![],'where':{}};var _0x25ab5f={};var _0x8e90dc={'count':0x0,'rows':[]};return db[_0x1461('0x4e')][_0x1461('0x62')]({'where':{'id':_0x5bbfc0[_0x1461('0x53')]['id']}})['then'](handleEntityNotFound(_0x53d842,null))[_0x1461('0x32')](function(_0x1d89fc){if(_0x1d89fc){_0x25ab5f[_0x1461('0x3e')]=_[_0x1461('0x40')](db[_0x1461('0x60')][_0x1461('0x3a')]);_0x25ab5f['query']=_[_0x1461('0x40')](_0x5bbfc0['query']);_0x25ab5f[_0x1461('0x41')]=_[_0x1461('0x42')](_0x25ab5f[_0x1461('0x3e')],_0x25ab5f[_0x1461('0x3f')]);_0x36d7e9[_0x1461('0x43')]=_[_0x1461('0x42')](_0x25ab5f[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x44')]));_0x36d7e9[_0x1461('0x43')]=_0x36d7e9[_0x1461('0x43')]['length']?_0x36d7e9[_0x1461('0x43')]:_0x25ab5f[_0x1461('0x3e')];if(!_0x5bbfc0['query'][_0x1461('0x46')](_0x1461('0x63'))){_0x36d7e9[_0x1461('0x29')]=qs[_0x1461('0x29')](_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x29')]);_0x36d7e9[_0x1461('0x27')]=qs[_0x1461('0x27')](_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x27')]);}_0x36d7e9[_0x1461('0x47')]=qs[_0x1461('0x48')](_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x48')]);_0x36d7e9['where']=qs[_0x1461('0x41')](_['pick'](_0x5bbfc0[_0x1461('0x3f')],_0x25ab5f['filters']));_0x36d7e9[_0x1461('0x49')]['ListId']=_0x1d89fc['id'];if(_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x4a')]){_0x36d7e9[_0x1461('0x49')]=_[_0x1461('0x4b')](_0x36d7e9[_0x1461('0x49')],{'$or':_['map'](_0x36d7e9[_0x1461('0x43')],function(_0x31f52b){var _0x6d867c={};_0x6d867c[_0x31f52b]={'$like':'%'+_0x5bbfc0['query'][_0x1461('0x4a')]+'%'};return _0x6d867c;})});}_0x36d7e9=_[_0x1461('0x4b')]({},_0x36d7e9,_0x5bbfc0['options']);return db['Disposition']['count']({'where':_0x36d7e9[_0x1461('0x49')]})[_0x1461('0x32')](function(_0x189299){_0x8e90dc[_0x1461('0x2a')]=_0x189299;if(_0x5bbfc0[_0x1461('0x3f')][_0x1461('0x4f')]){_0x36d7e9[_0x1461('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x1461('0x64')](_0x36d7e9);})[_0x1461('0x32')](function(_0x31fb2){_0x8e90dc[_0x1461('0x65')]=_0x31fb2;return _0x8e90dc;});}})['then'](respondWithFilteredResult(_0x53d842,_0x36d7e9))[_0x1461('0x51')](handleError(_0x53d842,null));};exports[_0x1461('0x66')]=function(_0x26b785,_0x3bed01,_0x26d0ec){return db[_0x1461('0x4e')][_0x1461('0x5e')]({'where':{'id':_0x26b785[_0x1461('0x53')]['id']}})[_0x1461('0x32')](handleEntityNotFound(_0x3bed01,null))[_0x1461('0x32')](function(_0x6426f5){if(_0x6426f5){return _0x6426f5[_0x1461('0x66')](_0x26b785['query']['ids']);}})[_0x1461('0x32')](respondWithStatusCode(_0x3bed01,null))[_0x1461('0x51')](handleError(_0x3bed01,null));};exports[_0x1461('0x67')]=function(_0x428825,_0x1b97ef,_0x20e191){return db[_0x1461('0x4e')][_0x1461('0x5e')]({'where':{'id':_0x428825[_0x1461('0x53')]['id']}})[_0x1461('0x32')](handleEntityNotFound(_0x1b97ef,null))['then'](function(_0x1f0848){if(_0x1f0848){var _0x37c673=[];var _0x50c354={'success':[],'errors':[]};return db[_0x1461('0x68')][_0x1461('0x5d')]()[_0x1461('0x32')](function(_0x1391cf){if(_0x428825[_0x1461('0x55')][_0x1461('0x69')]&&_[_0x1461('0x6a')](_0x428825[_0x1461('0x55')][_0x1461('0x69')])){if(_0x428825['body'][_0x1461('0x69')][_0x1461('0x45')]){_0x428825[_0x1461('0x55')]['tags']=_0x428825['body'][_0x1461('0x69')][_0x1461('0x6b')](';')+';';}else{_0x428825[_0x1461('0x55')]['tags']=null;}}else{_0x428825[_0x1461('0x55')]['tags']=null;}if(_0x428825[_0x1461('0x55')]&&_[_0x1461('0x6a')](_0x428825[_0x1461('0x55')])){for(var _0x60eba5=0x0;_0x60eba5<_0x428825['body'][_0x1461('0x45')];_0x60eba5+=0x1){_0x428825[_0x1461('0x55')][_0x60eba5][_0x1461('0x5f')]=_0x428825[_0x1461('0x53')]['id'];_0x37c673[_0x1461('0x6c')](_0x428825[_0x1461('0x55')][_0x60eba5]);}return BPromise[_0x1461('0x6d')](_0x37c673,function(_0x3e4d41){return db['CmContact']['create'](_['omit'](_0x3e4d41,['ids','id'])||{},{'fields':_[_0x1461('0x40')](_0x1391cf),'raw':!![]})[_0x1461('0x32')](function(_0x5efa2d){_0x50c354['success'][_0x1461('0x6c')](_0x5efa2d[_0x1461('0x6e')]);})['catch'](function(_0x1bde08){_0x50c354[_0x1461('0x6f')][_0x1461('0x6c')]({'data':_0x3e4d41,'error':_0x1bde08[_0x1461('0x70')]});});})[_0x1461('0x32')](function(_0x1e4190){return _0x50c354;})[_0x1461('0x51')](function(_0xa51f3a){return _0xa51f3a;});}else{_0x1b97ef[_0x1461('0x25')](0x190)['json']({'message':_0x1461('0x71')});}});}})['then'](respondWithResult(_0x1b97ef,null))[_0x1461('0x51')](handleError(_0x1b97ef,null));};exports[_0x1461('0x72')]=function(_0x42bd7c,_0x50529c,_0x188605){var _0x479635;return db[_0x1461('0x4e')][_0x1461('0x5e')]({'where':{'id':_0x42bd7c[_0x1461('0x53')]['id']},'include':[{'model':db[_0x1461('0x73')],'as':_0x1461('0x74')}]})[_0x1461('0x32')](handleEntityNotFound(_0x50529c,null))[_0x1461('0x32')](function(_0xfda030){if(_0xfda030){_0x479635=_0xfda030;return db['CmContact'][_0x1461('0x3a')];}})[_0x1461('0x32')](function(_0x5e1be8){if(_0x5e1be8){var _0x148c7b={};var _0x1cb914={};_0x1cb914[_0x1461('0x3e')]=_[_0x1461('0x75')](_[_0x1461('0x40')](_0x5e1be8),_[_0x1461('0x39')](_0x479635['CustomFields'],function(_0x453a87){return util[_0x1461('0x76')](_0x1461('0x77'),_0x453a87['id']);}));_0x1cb914[_0x1461('0x3f')]=_[_0x1461('0x40')](_0x42bd7c[_0x1461('0x3f')]);_0x1cb914[_0x1461('0x41')]=_['intersection'](_0x1cb914[_0x1461('0x3e')],_0x1cb914[_0x1461('0x3f')]);_0x148c7b[_0x1461('0x43')]=_[_0x1461('0x42')](_0x1cb914[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x42bd7c[_0x1461('0x3f')]['fields']));_0x148c7b['attributes']=_0x148c7b[_0x1461('0x43')][_0x1461('0x45')]?_0x148c7b[_0x1461('0x43')]:_0x1cb914[_0x1461('0x3e')];if(!_0x42bd7c[_0x1461('0x3f')][_0x1461('0x46')](_0x1461('0x63'))){_0x148c7b[_0x1461('0x29')]=qs[_0x1461('0x29')](_0x42bd7c['query']['limit']);_0x148c7b[_0x1461('0x27')]=qs['offset'](_0x42bd7c[_0x1461('0x3f')]['offset']);}_0x148c7b['order']=qs[_0x1461('0x48')](_0x42bd7c[_0x1461('0x3f')]['sort']);_0x148c7b['where']=qs[_0x1461('0x41')](_[_0x1461('0x78')](_0x42bd7c[_0x1461('0x3f')],_0x1cb914['filters']));_0x148c7b[_0x1461('0x79')]=!![];if(_0x42bd7c[_0x1461('0x3f')]['filter']){_0x148c7b['where']=_[_0x1461('0x4b')](_0x148c7b[_0x1461('0x49')],{'$or':_[_0x1461('0x39')](_0x148c7b[_0x1461('0x43')],function(_0x28fcc7){var _0x3715cc={};_0x3715cc[_0x28fcc7]={'$like':'%'+_0x42bd7c[_0x1461('0x3f')]['filter']+'%'};return _0x3715cc;})});}_0x148c7b=_[_0x1461('0x4b')]({},_0x148c7b,_0x42bd7c[_0x1461('0x4d')]);return _0x479635[_0x1461('0x72')](_0x148c7b);}})[_0x1461('0x32')](respondWithResult(_0x50529c,null))[_0x1461('0x51')](handleError(_0x50529c,null));};exports[_0x1461('0x7a')]=function(_0x50e8c9,_0x404828,_0x3263a5){var _0x195300;return db[_0x1461('0x4e')][_0x1461('0x5e')]({'where':{'id':_0x50e8c9[_0x1461('0x53')]['id']},'include':[{'model':db[_0x1461('0x73')],'as':_0x1461('0x74')}]})[_0x1461('0x32')](handleEntityNotFound(_0x404828,null))[_0x1461('0x32')](function(_0x37e8ad){if(_0x37e8ad){_0x195300=_0x37e8ad;return db['CmContact']['rawAttributes'];}})[_0x1461('0x32')](function(_0x2b4c29){if(_0x2b4c29){var _0x279a90={};var _0x5d9507={};_0x5d9507[_0x1461('0x3e')]=_[_0x1461('0x75')](_[_0x1461('0x40')](_0x2b4c29),_[_0x1461('0x39')](_0x195300[_0x1461('0x74')],function(_0x2cb70b){return util[_0x1461('0x76')](_0x1461('0x77'),_0x2cb70b['id']);}));_0x5d9507[_0x1461('0x3f')]=_[_0x1461('0x40')](_0x50e8c9[_0x1461('0x3f')]);_0x5d9507[_0x1461('0x41')]=_[_0x1461('0x42')](_0x5d9507[_0x1461('0x3e')],_0x5d9507[_0x1461('0x3f')]);_0x279a90['attributes']=_[_0x1461('0x42')](_0x5d9507[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x50e8c9[_0x1461('0x3f')]['fields']));_0x279a90['attributes']=_0x279a90[_0x1461('0x43')][_0x1461('0x45')]?_0x279a90[_0x1461('0x43')]:_0x5d9507[_0x1461('0x3e')];if(!_0x50e8c9[_0x1461('0x3f')][_0x1461('0x46')](_0x1461('0x63'))){_0x279a90[_0x1461('0x29')]=qs[_0x1461('0x29')](_0x50e8c9[_0x1461('0x3f')][_0x1461('0x29')]);_0x279a90[_0x1461('0x27')]=qs['offset'](_0x50e8c9[_0x1461('0x3f')]['offset']);}_0x279a90[_0x1461('0x47')]=qs[_0x1461('0x48')](_0x50e8c9[_0x1461('0x3f')]['sort']);_0x279a90['where']=qs['filters'](_[_0x1461('0x78')](_0x50e8c9[_0x1461('0x3f')],_0x5d9507['filters']));_0x279a90[_0x1461('0x79')]=!![];if(_0x50e8c9[_0x1461('0x3f')][_0x1461('0x4a')]){_0x279a90[_0x1461('0x49')]=_['merge'](_0x279a90[_0x1461('0x49')],{'$or':_[_0x1461('0x39')](_0x279a90[_0x1461('0x43')],function(_0x2f788b){var _0x3fed5f={};_0x3fed5f[_0x2f788b]={'$like':'%'+_0x50e8c9[_0x1461('0x3f')]['filter']+'%'};return _0x3fed5f;})});}_0x279a90=_['merge']({},_0x279a90,_0x50e8c9[_0x1461('0x4d')]);return _0x195300['getContacts'](_0x279a90);}})[_0x1461('0x32')](function(_0x5aa1e2){if(!_['isEmpty'](_0x5aa1e2)){var _0x23b498=toCsv(_0x5aa1e2);var _0x412596=Date[_0x1461('0x7b')]();fs[_0x1461('0x7c')](util[_0x1461('0x76')]('/tmp/list_%d_%s.csv',_0x195300['id'],_0x412596),_0x23b498);_0x404828[_0x1461('0x7d')]('Content-disposition','attachment;\x20filename='+util[_0x1461('0x76')](_0x1461('0x7e'),_0x195300['id'],_0x412596));_0x404828[_0x1461('0x7d')](_0x1461('0x7f'),_0x1461('0x80'));return _0x404828[_0x1461('0x81')](util['format']('/tmp/list_%d_%s.csv',_0x195300['id'],_0x412596));}else{return _0x404828['sendStatus'](0xcc);}})['catch'](handleError(_0x404828,null));};exports[_0x1461('0x82')]=function(_0x1d4410,_0xccd18c,_0x131d45){var _0x50e1fd;delete _0x1d4410[_0x1461('0x55')]['id'];return db['CmList'][_0x1461('0x62')]({'where':{'id':_0x1d4410[_0x1461('0x53')]['id']}})[_0x1461('0x32')](handleEntityNotFound(_0xccd18c,null))[_0x1461('0x32')](function(_0x2917ee){if(_0x2917ee){return db['sequelize'][_0x1461('0x83')](function(_0x2a571f){return db[_0x1461('0x73')][_0x1461('0x54')](_0x1d4410['body'],{'transaction':_0x2a571f})['then'](function(_0x833b2d){_0x50e1fd=_0x833b2d;return _0x2917ee[_0x1461('0x84')](_0x833b2d,{'transaction':_0x2a571f});})[_0x1461('0x32')](function(){var _0x4102b2={'type':db['Sequelize'][_0x1461('0x85')],'transaction':_0x2a571f};switch(_0x1d4410[_0x1461('0x55')][_0x1461('0x3c')]){case _0x1461('0x86'):_0x4102b2[_0x1461('0x3c')]=db['Sequelize'][_0x1461('0x85')];break;case'number':_0x4102b2[_0x1461('0x3c')]=db[_0x1461('0x87')][_0x1461('0x88')];break;case _0x1461('0x89'):_0x4102b2['type']=db[_0x1461('0x87')][_0x1461('0x8a')];_0x4102b2[_0x1461('0x8b')]=![];break;default:}return db[_0x1461('0x8c')][_0x1461('0x8d')][_0x1461('0x8e')](_0x1461('0x8f'),util[_0x1461('0x76')](_0x1461('0x90'),_0x50e1fd['id']),_0x4102b2);})[_0x1461('0x32')](function(){return _0x50e1fd;});});}})[_0x1461('0x32')](respondWithResult(_0xccd18c,null))[_0x1461('0x51')](handleError(_0xccd18c,null));};exports['getCustomFields']=function(_0x3b3cdc,_0x3397ca,_0x6f8dcf){var _0xfcc8ae={};var _0x542f19={};var _0x27b9be;var _0x1ceac3;return db['CmList'][_0x1461('0x62')]({'where':{'id':_0x3b3cdc['params']['id']}})[_0x1461('0x32')](handleEntityNotFound(_0x3397ca,null))['then'](function(_0x3c47c3){if(_0x3c47c3){_0x27b9be=_0x3c47c3;_0x542f19[_0x1461('0x3e')]=_[_0x1461('0x40')](db['CmCustomField'][_0x1461('0x3a')]);_0x542f19['query']=_['keys'](_0x3b3cdc[_0x1461('0x3f')]);_0x542f19[_0x1461('0x41')]=_[_0x1461('0x42')](_0x542f19[_0x1461('0x3e')],_0x542f19[_0x1461('0x3f')]);_0xfcc8ae[_0x1461('0x43')]=_[_0x1461('0x42')](_0x542f19[_0x1461('0x3e')],qs[_0x1461('0x44')](_0x3b3cdc[_0x1461('0x3f')][_0x1461('0x44')]));_0xfcc8ae[_0x1461('0x43')]=_0xfcc8ae['attributes'][_0x1461('0x45')]?_0xfcc8ae[_0x1461('0x43')]:_0x542f19['model'];_0xfcc8ae[_0x1461('0x47')]=qs[_0x1461('0x48')](_0x3b3cdc[_0x1461('0x3f')][_0x1461('0x48')]);_0xfcc8ae[_0x1461('0x49')]=qs['filters'](_[_0x1461('0x78')](_0x3b3cdc['query'],_0x542f19[_0x1461('0x41')]));_0xfcc8ae[_0x1461('0x49')]=_[_0x1461('0x4b')](_0xfcc8ae[_0x1461('0x49')],{'$or':[{'ListId':_0x3c47c3['id']},{'ListId':null}]});if(_0x3b3cdc[_0x1461('0x3f')][_0x1461('0x4a')]){_0xfcc8ae[_0x1461('0x49')]=_[_0x1461('0x4b')](_0xfcc8ae[_0x1461('0x49')],{'$or':_[_0x1461('0x39')](_0xfcc8ae[_0x1461('0x43')],function(_0x969a8f){var _0x9e515e={};_0x9e515e[_0x969a8f]={'$like':'%'+_0x3b3cdc['query'][_0x1461('0x4a')]+'%'};return _0x9e515e;})});}_0xfcc8ae=_['merge']({},_0xfcc8ae,_0x3b3cdc['options']);return db[_0x1461('0x73')][_0x1461('0x91')](_0xfcc8ae);}})[_0x1461('0x32')](respondWithResult(_0x3397ca,null))[_0x1461('0x51')](handleError(_0x3397ca,null));};exports[_0x1461('0x92')]=function(_0x4b3f77,_0xe8a590,_0xaadc66){return db['CmList'][_0x1461('0x5e')]({'where':{'id':_0x4b3f77['params']['id']}})[_0x1461('0x32')](handleEntityNotFound(_0xe8a590,null))[_0x1461('0x32')](function(_0x1042da){if(_0x1042da){return _0x1042da[_0x1461('0x92')](_0x4b3f77['body'][_0x1461('0x93')],_['omit'](_0x4b3f77['body'],['ids','id'])||{})[_0x1461('0x94')](function(_0x47ab56){for(var _0x5510f0=0x0;_0x5510f0<_0x4b3f77[_0x1461('0x55')]['ids'][_0x1461('0x45')];_0x5510f0+=0x1){socket[_0x1461('0x95')]('userCmList:save',{'UserId':Number(_0x4b3f77['body'][_0x1461('0x93')][_0x5510f0]),'CmListId':Number(_0x4b3f77[_0x1461('0x53')]['id'])});}return _0x47ab56;});}})[_0x1461('0x32')](respondWithResult(_0xe8a590,null))[_0x1461('0x51')](handleError(_0xe8a590,null));};exports[_0x1461('0x96')]=function(_0x9d009,_0x3808ef,_0x2ddc93){return db[_0x1461('0x4e')]['find']({'where':{'id':_0x9d009[_0x1461('0x53')]['id']}})['then'](handleEntityNotFound(_0x3808ef,null))[_0x1461('0x32')](function(_0x33ed3a){if(_0x33ed3a){return _0x33ed3a[_0x1461('0x96')](_0x9d009[_0x1461('0x3f')][_0x1461('0x93')])[_0x1461('0x32')](function(){if(_[_0x1461('0x6a')](_0x9d009[_0x1461('0x3f')]['ids'])){for(var _0x90fb2=0x0;_0x90fb2<_0x9d009[_0x1461('0x3f')][_0x1461('0x93')][_0x1461('0x45')];_0x90fb2+=0x1){socket[_0x1461('0x95')]('userCmList:remove',{'UserId':Number(_0x9d009[_0x1461('0x3f')][_0x1461('0x93')][_0x90fb2]),'CmListId':Number(_0x9d009[_0x1461('0x53')]['id'])});}}else{socket[_0x1461('0x95')](_0x1461('0x97'),{'UserId':Number(_0x9d009[_0x1461('0x3f')][_0x1461('0x93')]),'CmListId':Number(_0x9d009['params']['id'])});}});}})[_0x1461('0x32')](respondWithStatusCode(_0x3808ef,null))[_0x1461('0x51')](handleError(_0x3808ef,null));};exports[_0x1461('0x98')]=function(_0x4315a0,_0x33f4b2,_0x320c8b){var _0x2491d4={};var _0x41f3ab={};var _0x893afb;var _0x121a11;return db[_0x1461('0x4e')][_0x1461('0x62')]({'where':{'id':_0x4315a0[_0x1461('0x53')]['id']}})[_0x1461('0x32')](handleEntityNotFound(_0x33f4b2,null))['then'](function(_0x3d3c53){if(_0x3d3c53){_0x893afb=_0x3d3c53;_0x41f3ab['model']=_[_0x1461('0x40')](db[_0x1461('0x99')][_0x1461('0x3a')]);_0x41f3ab[_0x1461('0x3f')]=_[_0x1461('0x40')](_0x4315a0[_0x1461('0x3f')]);_0x41f3ab[_0x1461('0x41')]=_[_0x1461('0x42')](_0x41f3ab['model'],_0x41f3ab[_0x1461('0x3f')]);_0x2491d4[_0x1461('0x43')]=_[_0x1461('0x42')](_0x41f3ab[_0x1461('0x3e')],qs['fields'](_0x4315a0['query'][_0x1461('0x44')]));_0x2491d4[_0x1461('0x43')]=_0x2491d4[_0x1461('0x43')][_0x1461('0x45')]?_0x2491d4['attributes']:_0x41f3ab[_0x1461('0x3e')];_0x2491d4[_0x1461('0x47')]=qs[_0x1461('0x48')](_0x4315a0[_0x1461('0x3f')][_0x1461('0x48')]);_0x2491d4[_0x1461('0x49')]=qs[_0x1461('0x41')](_[_0x1461('0x78')](_0x4315a0[_0x1461('0x3f')],_0x41f3ab['filters']));if(_0x4315a0['query']['filter']){_0x2491d4[_0x1461('0x49')]=_[_0x1461('0x4b')](_0x2491d4['where'],{'$or':_[_0x1461('0x39')](_0x2491d4['attributes'],function(_0x56b387){var _0x3505e9={};_0x3505e9[_0x56b387]={'$like':'%'+_0x4315a0[_0x1461('0x3f')]['filter']+'%'};return _0x3505e9;})});}_0x2491d4=_[_0x1461('0x4b')]({},_0x2491d4,_0x4315a0[_0x1461('0x4d')]);return _0x893afb['getAgents'](_0x2491d4);}})[_0x1461('0x32')](function(_0x2b37e3){if(_0x2b37e3){_0x121a11=_0x2b37e3['length'];if(!_0x4315a0[_0x1461('0x3f')][_0x1461('0x46')]('nolimit')){_0x2491d4[_0x1461('0x29')]=qs[_0x1461('0x29')](_0x4315a0[_0x1461('0x3f')][_0x1461('0x29')]);_0x2491d4[_0x1461('0x27')]=qs['offset'](_0x4315a0[_0x1461('0x3f')]['offset']);}return _0x893afb[_0x1461('0x98')](_0x2491d4);}})[_0x1461('0x32')](function(_0xb20b2c){if(_0xb20b2c){return _0xb20b2c?{'count':_0x121a11,'rows':_0xb20b2c}:null;}})[_0x1461('0x32')](respondWithResult(_0x33f4b2,null))[_0x1461('0x51')](handleError(_0x33f4b2,null));}; \ No newline at end of file +var _0xd107=['fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','message','getContacts','CmCustomField','concat','format','order','CustomFields','cf_%d','now','writeFileSync','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','findOne','sequelize','addCustomFields','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','map','CmList','rawAttributes'];(function(_0x2f4f31,_0x4310dd){var _0x867b53=function(_0x4d2856){while(--_0x4d2856){_0x2f4f31['push'](_0x2f4f31['shift']());}};_0x867b53(++_0x4310dd);}(_0xd107,0xe0));var _0x7d10=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd107[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x7d10('0x0'));var rimraf=require(_0x7d10('0x1'));var zipdir=require(_0x7d10('0x2'));var jsonpatch=require(_0x7d10('0x3'));var rp=require(_0x7d10('0x4'));var moment=require('moment');var BPromise=require(_0x7d10('0x5'));var Mustache=require(_0x7d10('0x6'));var util=require(_0x7d10('0x7'));var path=require(_0x7d10('0x8'));var sox=require(_0x7d10('0x9'));var csv=require(_0x7d10('0xa'));var ejs=require(_0x7d10('0xb'));var fs=require('fs');var fs_extra=require(_0x7d10('0xc'));var _=require(_0x7d10('0xd'));var squel=require(_0x7d10('0xe'));var crypto=require(_0x7d10('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7d10('0x10'));var toCsv=require(_0x7d10('0xa'));var querystring=require(_0x7d10('0x11'));var Papa=require(_0x7d10('0x12'));var Redis=require(_0x7d10('0x13'));var authService=require(_0x7d10('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d10('0x15'));var utils=require(_0x7d10('0x16'));var config=require(_0x7d10('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d10('0x18'))['db'];config[_0x7d10('0x19')]=_[_0x7d10('0x1a')](config[_0x7d10('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d10('0x1b'))(new Redis(config[_0x7d10('0x19')]));require(_0x7d10('0x1c'))[_0x7d10('0x1d')](socket);function respondWithStatusCode(_0x5f311b,_0x3ea7b5){_0x3ea7b5=_0x3ea7b5||0xcc;return function(_0xd3d5a1){if(_0xd3d5a1){return _0x5f311b[_0x7d10('0x1e')](_0x3ea7b5);}return _0x5f311b[_0x7d10('0x1f')](_0x3ea7b5)[_0x7d10('0x20')]();};}function respondWithResult(_0x3920ee,_0x34d65a){_0x34d65a=_0x34d65a||0xc8;return function(_0x2b13c0){if(_0x2b13c0){return _0x3920ee[_0x7d10('0x1f')](_0x34d65a)['json'](_0x2b13c0);}};}function respondWithFilteredResult(_0xf0c9cf,_0x5e625f){return function(_0x16937a){if(_0x16937a){var _0x5247df=typeof _0x5e625f['offset']==='undefined'&&typeof _0x5e625f[_0x7d10('0x21')]===_0x7d10('0x22');var _0x2f20ab=_0x16937a[_0x7d10('0x23')];var _0x4ef78e=_0x5247df?0x0:_0x5e625f[_0x7d10('0x24')];var _0x4c7836=_0x5247df?_0x16937a[_0x7d10('0x23')]:_0x5e625f[_0x7d10('0x24')]+_0x5e625f[_0x7d10('0x21')];var _0x3adcee;if(_0x4c7836>=_0x2f20ab){_0x4c7836=_0x2f20ab;_0x3adcee=0xc8;}else{_0x3adcee=0xce;}_0xf0c9cf['status'](_0x3adcee);return _0xf0c9cf[_0x7d10('0x25')](_0x7d10('0x26'),_0x4ef78e+'-'+_0x4c7836+'/'+_0x2f20ab)[_0x7d10('0x27')](_0x16937a);}return null;};}function patchUpdates(_0x3a9274){return function(_0x49ebd4){try{jsonpatch[_0x7d10('0x28')](_0x49ebd4,_0x3a9274,!![]);}catch(_0x3efc9a){return BPromise[_0x7d10('0x29')](_0x3efc9a);}return _0x49ebd4[_0x7d10('0x2a')]();};}function saveUpdates(_0x381f12,_0x3cc66b){return function(_0x790a19){if(_0x790a19){return _0x790a19[_0x7d10('0x2b')](_0x381f12)[_0x7d10('0x2c')](function(_0x46e6c4){return _0x46e6c4;});}return null;};}function removeEntity(_0x27db90,_0xc83cf9){return function(_0x21f4f4){if(_0x21f4f4){return _0x21f4f4[_0x7d10('0x2d')]()[_0x7d10('0x2c')](function(){var _0x357121=_0x21f4f4[_0x7d10('0x2e')]({'plain':!![]});var _0x3fd5ae=_0x7d10('0x2f');return db[_0x7d10('0x30')][_0x7d10('0x2d')]({'where':{'type':_0x3fd5ae,'resourceId':_0x357121['id']}})[_0x7d10('0x2c')](function(){return _0x21f4f4;});})[_0x7d10('0x2c')](function(){_0x27db90[_0x7d10('0x1f')](0xcc)[_0x7d10('0x20')]();});}};}function handleEntityNotFound(_0x523aa1,_0x280c05){return function(_0x3c0b3f){if(!_0x3c0b3f){_0x523aa1[_0x7d10('0x1e')](0x194);}return _0x3c0b3f;};}function handleError(_0x313a43,_0x1a63f7){_0x1a63f7=_0x1a63f7||0x1f4;return function(_0x19e372){logger[_0x7d10('0x31')](_0x19e372[_0x7d10('0x32')]);if(_0x19e372[_0x7d10('0x33')]){delete _0x19e372[_0x7d10('0x33')];}_0x313a43['status'](_0x1a63f7)[_0x7d10('0x34')](_0x19e372);};}exports['index']=function(_0x460048,_0x2962ba){var _0x5a9361={},_0x488963={},_0x5bacaf={'count':0x0,'rows':[]};var _0x5b1dff=_[_0x7d10('0x35')](db[_0x7d10('0x36')][_0x7d10('0x37')],function(_0x2ebef8){return{'name':_0x2ebef8[_0x7d10('0x38')],'type':_0x2ebef8[_0x7d10('0x39')][_0x7d10('0x3a')]};});_0x488963['model']=_[_0x7d10('0x35')](_0x5b1dff,_0x7d10('0x33'));_0x488963[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x460048['query']);_0x488963['filters']=_['intersection'](_0x488963['model'],_0x488963[_0x7d10('0x3b')]);_0x5a9361[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0x488963[_0x7d10('0x3f')],qs[_0x7d10('0x40')](_0x460048[_0x7d10('0x3b')]['fields']));_0x5a9361[_0x7d10('0x3d')]=_0x5a9361[_0x7d10('0x3d')][_0x7d10('0x41')]?_0x5a9361['attributes']:_0x488963[_0x7d10('0x3f')];if(!_0x460048[_0x7d10('0x3b')][_0x7d10('0x42')](_0x7d10('0x43'))){_0x5a9361['limit']=qs['limit'](_0x460048[_0x7d10('0x3b')]['limit']);_0x5a9361[_0x7d10('0x24')]=qs[_0x7d10('0x24')](_0x460048[_0x7d10('0x3b')][_0x7d10('0x24')]);}_0x5a9361['order']=qs['sort'](_0x460048[_0x7d10('0x3b')][_0x7d10('0x44')]);_0x5a9361['where']=qs[_0x7d10('0x45')](_[_0x7d10('0x46')](_0x460048[_0x7d10('0x3b')],_0x488963[_0x7d10('0x45')]),_0x5b1dff);if(_0x460048[_0x7d10('0x3b')]['filter']){_0x5a9361[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0x5a9361[_0x7d10('0x47')],{'$or':_[_0x7d10('0x35')](_0x5b1dff,function(_0x42be2f){if(_0x42be2f['type']!==_0x7d10('0x49')){var _0x24d7a5={};_0x24d7a5[_0x42be2f[_0x7d10('0x33')]]={'$like':'%'+_0x460048['query'][_0x7d10('0x4a')]+'%'};return _0x24d7a5;}})});}_0x5a9361=_[_0x7d10('0x48')]({},_0x5a9361,_0x460048[_0x7d10('0x4b')]);var _0x34239c={'where':_0x5a9361[_0x7d10('0x47')]};return db['CmList'][_0x7d10('0x23')](_0x34239c)[_0x7d10('0x2c')](function(_0x3576df){_0x5bacaf['count']=_0x3576df;if(_0x460048['query']['includeAll']){_0x5a9361[_0x7d10('0x4c')]=[{'all':!![]}];}return db[_0x7d10('0x36')][_0x7d10('0x4d')](_0x5a9361);})[_0x7d10('0x2c')](function(_0x436fd4){_0x5bacaf[_0x7d10('0x4e')]=_0x436fd4;return _0x5bacaf;})[_0x7d10('0x2c')](respondWithFilteredResult(_0x2962ba,_0x5a9361))[_0x7d10('0x4f')](handleError(_0x2962ba,null));};exports[_0x7d10('0x50')]=function(_0x3fb929,_0x39c515){var _0x6f46e9={'raw':![],'where':{'id':_0x3fb929[_0x7d10('0x51')]['id']}},_0xd92766={};_0xd92766['model']=_[_0x7d10('0x3c')](db[_0x7d10('0x36')][_0x7d10('0x37')]);_0xd92766[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x3fb929[_0x7d10('0x3b')]);_0xd92766[_0x7d10('0x45')]=_[_0x7d10('0x3e')](_0xd92766['model'],_0xd92766['query']);_0x6f46e9[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0xd92766[_0x7d10('0x3f')],qs[_0x7d10('0x40')](_0x3fb929[_0x7d10('0x3b')]['fields']));_0x6f46e9[_0x7d10('0x3d')]=_0x6f46e9[_0x7d10('0x3d')][_0x7d10('0x41')]?_0x6f46e9[_0x7d10('0x3d')]:_0xd92766[_0x7d10('0x3f')];if(_0x3fb929[_0x7d10('0x3b')][_0x7d10('0x52')]){_0x6f46e9[_0x7d10('0x4c')]=[{'all':!![]}];}_0x6f46e9=_[_0x7d10('0x48')]({},_0x6f46e9,_0x3fb929[_0x7d10('0x4b')]);return db[_0x7d10('0x36')][_0x7d10('0x53')](_0x6f46e9)[_0x7d10('0x2c')](handleEntityNotFound(_0x39c515,null))['then'](respondWithResult(_0x39c515,null))['catch'](handleError(_0x39c515,null));};exports[_0x7d10('0x54')]=function(_0x4f2d1b,_0x5463ae){return db[_0x7d10('0x36')][_0x7d10('0x54')](_0x4f2d1b[_0x7d10('0x55')],{})['then'](function(_0x84f32a){var _0x594e8b=_0x4f2d1b[_0x7d10('0x56')][_0x7d10('0x2e')]({'plain':!![]});if(!_0x594e8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x594e8b['role']==='user'){var _0x282461=_0x84f32a[_0x7d10('0x2e')]({'plain':!![]});var _0x7e8f66=_0x7d10('0x2f');return db['UserProfileSection'][_0x7d10('0x53')]({'where':{'name':_0x7e8f66,'userProfileId':_0x594e8b['userProfileId']},'raw':!![]})['then'](function(_0x49a882){if(_0x49a882&&_0x49a882[_0x7d10('0x57')]===0x0){return db[_0x7d10('0x30')]['create']({'name':_0x282461['name'],'resourceId':_0x282461['id'],'type':_0x49a882[_0x7d10('0x33')],'sectionId':_0x49a882['id']},{})[_0x7d10('0x2c')](function(){return _0x84f32a;});}else{return _0x84f32a;}})[_0x7d10('0x4f')](function(_0x254449){logger[_0x7d10('0x31')](_0x7d10('0x58'),_0x254449);throw _0x254449;});}return _0x84f32a;})['then'](respondWithResult(_0x5463ae,0xc9))['catch'](handleError(_0x5463ae,null));};exports['update']=function(_0x1473b7,_0x1aeadc){if(_0x1473b7[_0x7d10('0x55')]['id']){delete _0x1473b7[_0x7d10('0x55')]['id'];}return db[_0x7d10('0x36')][_0x7d10('0x53')]({'where':{'id':_0x1473b7['params']['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x1aeadc,null))['then'](saveUpdates(_0x1473b7[_0x7d10('0x55')],null))[_0x7d10('0x2c')](respondWithResult(_0x1aeadc,null))[_0x7d10('0x4f')](handleError(_0x1aeadc,null));};exports[_0x7d10('0x2d')]=function(_0x3dc988,_0x4ef972){return db[_0x7d10('0x36')]['find']({'where':{'id':_0x3dc988['params']['id']}})['then'](handleEntityNotFound(_0x4ef972,null))[_0x7d10('0x2c')](removeEntity(_0x4ef972,null))[_0x7d10('0x4f')](handleError(_0x4ef972,null));};exports[_0x7d10('0x59')]=function(_0x1ed577,_0x54bea1){return db[_0x7d10('0x36')]['describe']()['then'](respondWithResult(_0x54bea1,null))[_0x7d10('0x4f')](handleError(_0x54bea1,null));};exports[_0x7d10('0x5a')]=function(_0x50a653,_0xb7fdb9,_0xc240bf){if(_0x50a653[_0x7d10('0x55')]['id']){delete _0x50a653[_0x7d10('0x55')]['id'];}return db['CmList'][_0x7d10('0x53')]({'where':{'id':_0x50a653[_0x7d10('0x51')]['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0xb7fdb9,null))[_0x7d10('0x2c')](function(_0x5b4b43){if(_0x5b4b43){_0x50a653[_0x7d10('0x55')][_0x7d10('0x5b')]=_0x5b4b43['id'];return db[_0x7d10('0x5c')]['create'](_0x50a653[_0x7d10('0x55')]);}})[_0x7d10('0x2c')](respondWithResult(_0xb7fdb9,null))['catch'](handleError(_0xb7fdb9,null));};exports[_0x7d10('0x5d')]=function(_0x25c29f,_0x34dbf4,_0x596f00){var _0x2749f0={'raw':![],'where':{}};var _0xb2e8fe={};var _0x376971={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x25c29f[_0x7d10('0x51')]['id']}})['then'](handleEntityNotFound(_0x34dbf4,null))[_0x7d10('0x2c')](function(_0xbb4d43){if(_0xbb4d43){_0xb2e8fe[_0x7d10('0x3f')]=_[_0x7d10('0x3c')](db['Disposition']['rawAttributes']);_0xb2e8fe[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x25c29f[_0x7d10('0x3b')]);_0xb2e8fe[_0x7d10('0x45')]=_[_0x7d10('0x3e')](_0xb2e8fe['model'],_0xb2e8fe[_0x7d10('0x3b')]);_0x2749f0[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0xb2e8fe['model'],qs[_0x7d10('0x40')](_0x25c29f['query'][_0x7d10('0x40')]));_0x2749f0[_0x7d10('0x3d')]=_0x2749f0[_0x7d10('0x3d')]['length']?_0x2749f0[_0x7d10('0x3d')]:_0xb2e8fe[_0x7d10('0x3f')];if(!_0x25c29f[_0x7d10('0x3b')][_0x7d10('0x42')](_0x7d10('0x43'))){_0x2749f0[_0x7d10('0x21')]=qs[_0x7d10('0x21')](_0x25c29f[_0x7d10('0x3b')]['limit']);_0x2749f0[_0x7d10('0x24')]=qs['offset'](_0x25c29f[_0x7d10('0x3b')][_0x7d10('0x24')]);}_0x2749f0['order']=qs[_0x7d10('0x44')](_0x25c29f['query'][_0x7d10('0x44')]);_0x2749f0[_0x7d10('0x47')]=qs['filters'](_['pick'](_0x25c29f[_0x7d10('0x3b')],_0xb2e8fe[_0x7d10('0x45')]));_0x2749f0[_0x7d10('0x47')][_0x7d10('0x5b')]=_0xbb4d43['id'];if(_0x25c29f[_0x7d10('0x3b')][_0x7d10('0x4a')]){_0x2749f0[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0x2749f0[_0x7d10('0x47')],{'$or':_['map'](_0x2749f0[_0x7d10('0x3d')],function(_0x3c7b6c){var _0x59ed0c={};_0x59ed0c[_0x3c7b6c]={'$like':'%'+_0x25c29f[_0x7d10('0x3b')][_0x7d10('0x4a')]+'%'};return _0x59ed0c;})});}_0x2749f0=_['merge']({},_0x2749f0,_0x25c29f['options']);return db['Disposition']['count']({'where':_0x2749f0[_0x7d10('0x47')]})[_0x7d10('0x2c')](function(_0x8b69db){_0x376971[_0x7d10('0x23')]=_0x8b69db;if(_0x25c29f[_0x7d10('0x3b')][_0x7d10('0x52')]){_0x2749f0['include']=[{'all':!![]}];}return db[_0x7d10('0x5c')]['findAll'](_0x2749f0);})[_0x7d10('0x2c')](function(_0x38ecbf){_0x376971['rows']=_0x38ecbf;return _0x376971;});}})[_0x7d10('0x2c')](respondWithFilteredResult(_0x34dbf4,_0x2749f0))[_0x7d10('0x4f')](handleError(_0x34dbf4,null));};exports[_0x7d10('0x5e')]=function(_0x33a779,_0x4b9221,_0x31eda8){return db[_0x7d10('0x36')][_0x7d10('0x53')]({'where':{'id':_0x33a779[_0x7d10('0x51')]['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x4b9221,null))[_0x7d10('0x2c')](function(_0x1f3e72){if(_0x1f3e72){return _0x1f3e72[_0x7d10('0x5e')](_0x33a779[_0x7d10('0x3b')][_0x7d10('0x5f')]);}})[_0x7d10('0x2c')](respondWithStatusCode(_0x4b9221,null))[_0x7d10('0x4f')](handleError(_0x4b9221,null));};exports[_0x7d10('0x60')]=function(_0x28b33b,_0xf86c57,_0x4efbd0){return db[_0x7d10('0x36')]['find']({'where':{'id':_0x28b33b['params']['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0xf86c57,null))[_0x7d10('0x2c')](function(_0x2ad582){if(_0x2ad582){var _0x4cbb6c=[];var _0x365514={'success':[],'errors':[]};return db[_0x7d10('0x61')][_0x7d10('0x59')]()[_0x7d10('0x2c')](function(_0x31b245){if(_0x28b33b[_0x7d10('0x55')][_0x7d10('0x62')]&&_[_0x7d10('0x63')](_0x28b33b[_0x7d10('0x55')]['tags'])){if(_0x28b33b['body'][_0x7d10('0x62')][_0x7d10('0x41')]){_0x28b33b['body']['tags']=_0x28b33b[_0x7d10('0x55')][_0x7d10('0x62')][_0x7d10('0x64')](';')+';';}else{_0x28b33b[_0x7d10('0x55')]['tags']=null;}}else{_0x28b33b[_0x7d10('0x55')]['tags']=null;}if(_0x28b33b['body']&&_[_0x7d10('0x63')](_0x28b33b[_0x7d10('0x55')])){for(var _0x5242b7=0x0;_0x5242b7<_0x28b33b['body'][_0x7d10('0x41')];_0x5242b7+=0x1){_0x28b33b[_0x7d10('0x55')][_0x5242b7][_0x7d10('0x5b')]=_0x28b33b[_0x7d10('0x51')]['id'];_0x4cbb6c[_0x7d10('0x65')](_0x28b33b[_0x7d10('0x55')][_0x5242b7]);}return BPromise['each'](_0x4cbb6c,function(_0x28087b){return db[_0x7d10('0x61')][_0x7d10('0x54')](_[_0x7d10('0x66')](_0x28087b,[_0x7d10('0x5f'),'id'])||{},{'fields':_['keys'](_0x31b245),'raw':!![]})[_0x7d10('0x2c')](function(_0x503e66){_0x365514[_0x7d10('0x67')]['push'](_0x503e66['dataValues']);})[_0x7d10('0x4f')](function(_0x1d4952){_0x365514['errors'][_0x7d10('0x65')]({'data':_0x28087b,'error':_0x1d4952[_0x7d10('0x68')]});});})[_0x7d10('0x2c')](function(_0x139a52){return _0x365514;})['catch'](function(_0x1436dd){return _0x1436dd;});}else{_0xf86c57['status'](0x190)[_0x7d10('0x27')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0xf86c57,null))['catch'](handleError(_0xf86c57,null));};exports[_0x7d10('0x69')]=function(_0x22206c,_0x5ae90a,_0x2accf7){var _0x5a123f;return db['CmList'][_0x7d10('0x53')]({'where':{'id':_0x22206c['params']['id']},'include':[{'model':db[_0x7d10('0x6a')],'as':'CustomFields'}]})[_0x7d10('0x2c')](handleEntityNotFound(_0x5ae90a,null))[_0x7d10('0x2c')](function(_0x257dea){if(_0x257dea){_0x5a123f=_0x257dea;return db[_0x7d10('0x61')][_0x7d10('0x37')];}})[_0x7d10('0x2c')](function(_0xaef47c){if(_0xaef47c){var _0xeae51f={};var _0x5af731={};_0x5af731[_0x7d10('0x3f')]=_[_0x7d10('0x6b')](_[_0x7d10('0x3c')](_0xaef47c),_['map'](_0x5a123f['CustomFields'],function(_0x26bba2){return util[_0x7d10('0x6c')]('cf_%d',_0x26bba2['id']);}));_0x5af731[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x22206c['query']);_0x5af731['filters']=_[_0x7d10('0x3e')](_0x5af731[_0x7d10('0x3f')],_0x5af731['query']);_0xeae51f[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0x5af731[_0x7d10('0x3f')],qs['fields'](_0x22206c['query']['fields']));_0xeae51f[_0x7d10('0x3d')]=_0xeae51f[_0x7d10('0x3d')][_0x7d10('0x41')]?_0xeae51f['attributes']:_0x5af731['model'];if(!_0x22206c[_0x7d10('0x3b')][_0x7d10('0x42')](_0x7d10('0x43'))){_0xeae51f[_0x7d10('0x21')]=qs[_0x7d10('0x21')](_0x22206c[_0x7d10('0x3b')][_0x7d10('0x21')]);_0xeae51f[_0x7d10('0x24')]=qs[_0x7d10('0x24')](_0x22206c[_0x7d10('0x3b')][_0x7d10('0x24')]);}_0xeae51f[_0x7d10('0x6d')]=qs[_0x7d10('0x44')](_0x22206c[_0x7d10('0x3b')][_0x7d10('0x44')]);_0xeae51f[_0x7d10('0x47')]=qs[_0x7d10('0x45')](_['pick'](_0x22206c[_0x7d10('0x3b')],_0x5af731[_0x7d10('0x45')]));_0xeae51f['raw']=!![];if(_0x22206c['query'][_0x7d10('0x4a')]){_0xeae51f[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0xeae51f['where'],{'$or':_[_0x7d10('0x35')](_0xeae51f[_0x7d10('0x3d')],function(_0x76af3e){var _0xd6d067={};_0xd6d067[_0x76af3e]={'$like':'%'+_0x22206c['query'][_0x7d10('0x4a')]+'%'};return _0xd6d067;})});}_0xeae51f=_['merge']({},_0xeae51f,_0x22206c[_0x7d10('0x4b')]);return _0x5a123f[_0x7d10('0x69')](_0xeae51f);}})[_0x7d10('0x2c')](respondWithResult(_0x5ae90a,null))[_0x7d10('0x4f')](handleError(_0x5ae90a,null));};exports['getContactsCsv']=function(_0x4ff845,_0x4dcd38,_0x5b0e2d){var _0x3b68bc;return db[_0x7d10('0x36')][_0x7d10('0x53')]({'where':{'id':_0x4ff845[_0x7d10('0x51')]['id']},'include':[{'model':db[_0x7d10('0x6a')],'as':'CustomFields'}]})[_0x7d10('0x2c')](handleEntityNotFound(_0x4dcd38,null))['then'](function(_0x807055){if(_0x807055){_0x3b68bc=_0x807055;return db[_0x7d10('0x61')][_0x7d10('0x37')];}})[_0x7d10('0x2c')](function(_0x2b886c){if(_0x2b886c){var _0x1c5e7e={};var _0x2e15bd={};_0x2e15bd[_0x7d10('0x3f')]=_[_0x7d10('0x6b')](_[_0x7d10('0x3c')](_0x2b886c),_[_0x7d10('0x35')](_0x3b68bc[_0x7d10('0x6e')],function(_0x3e74a7){return util[_0x7d10('0x6c')](_0x7d10('0x6f'),_0x3e74a7['id']);}));_0x2e15bd[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x4ff845[_0x7d10('0x3b')]);_0x2e15bd['filters']=_[_0x7d10('0x3e')](_0x2e15bd[_0x7d10('0x3f')],_0x2e15bd[_0x7d10('0x3b')]);_0x1c5e7e[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0x2e15bd['model'],qs['fields'](_0x4ff845['query']['fields']));_0x1c5e7e[_0x7d10('0x3d')]=_0x1c5e7e['attributes'][_0x7d10('0x41')]?_0x1c5e7e['attributes']:_0x2e15bd[_0x7d10('0x3f')];if(!_0x4ff845[_0x7d10('0x3b')][_0x7d10('0x42')](_0x7d10('0x43'))){_0x1c5e7e[_0x7d10('0x21')]=qs['limit'](_0x4ff845['query'][_0x7d10('0x21')]);_0x1c5e7e['offset']=qs[_0x7d10('0x24')](_0x4ff845[_0x7d10('0x3b')][_0x7d10('0x24')]);}_0x1c5e7e[_0x7d10('0x6d')]=qs['sort'](_0x4ff845[_0x7d10('0x3b')]['sort']);_0x1c5e7e[_0x7d10('0x47')]=qs[_0x7d10('0x45')](_[_0x7d10('0x46')](_0x4ff845['query'],_0x2e15bd[_0x7d10('0x45')]));_0x1c5e7e['raw']=!![];if(_0x4ff845[_0x7d10('0x3b')][_0x7d10('0x4a')]){_0x1c5e7e[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0x1c5e7e['where'],{'$or':_[_0x7d10('0x35')](_0x1c5e7e[_0x7d10('0x3d')],function(_0x44799b){var _0x5289ec={};_0x5289ec[_0x44799b]={'$like':'%'+_0x4ff845[_0x7d10('0x3b')][_0x7d10('0x4a')]+'%'};return _0x5289ec;})});}_0x1c5e7e=_[_0x7d10('0x48')]({},_0x1c5e7e,_0x4ff845['options']);return _0x3b68bc[_0x7d10('0x69')](_0x1c5e7e);}})[_0x7d10('0x2c')](function(_0x1f2807){if(!_['isEmpty'](_0x1f2807)){var _0x488733=toCsv(_0x1f2807);var _0xab262c=Date[_0x7d10('0x70')]();fs[_0x7d10('0x71')](util['format']('/tmp/list_%d_%s.csv',_0x3b68bc['id'],_0xab262c),_0x488733);_0x4dcd38['setHeader'](_0x7d10('0x72'),_0x7d10('0x73')+util[_0x7d10('0x6c')](_0x7d10('0x74'),_0x3b68bc['id'],_0xab262c));_0x4dcd38['setHeader'](_0x7d10('0x75'),'text/csv');return _0x4dcd38[_0x7d10('0x76')](util[_0x7d10('0x6c')](_0x7d10('0x77'),_0x3b68bc['id'],_0xab262c));}else{return _0x4dcd38['sendStatus'](0xcc);}})['catch'](handleError(_0x4dcd38,null));};exports['addCustomField']=function(_0x30a5bf,_0x58fa2d,_0x1db860){var _0x1f78f1;delete _0x30a5bf['body']['id'];return db[_0x7d10('0x36')][_0x7d10('0x78')]({'where':{'id':_0x30a5bf[_0x7d10('0x51')]['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x58fa2d,null))[_0x7d10('0x2c')](function(_0x58fbd6){if(_0x58fbd6){return db[_0x7d10('0x79')]['transaction'](function(_0xaedb38){return db['CmCustomField']['create'](_0x30a5bf['body'],{'transaction':_0xaedb38})[_0x7d10('0x2c')](function(_0x2bcd00){_0x1f78f1=_0x2bcd00;return _0x58fbd6[_0x7d10('0x7a')](_0x2bcd00,{'transaction':_0xaedb38});})[_0x7d10('0x2c')](function(){var _0x2b0bc7={'type':db['Sequelize'][_0x7d10('0x7b')],'transaction':_0xaedb38};switch(_0x30a5bf['body']['type']){case'text':_0x2b0bc7[_0x7d10('0x39')]=db[_0x7d10('0x7c')]['TEXT'];break;case _0x7d10('0x7d'):_0x2b0bc7[_0x7d10('0x39')]=db[_0x7d10('0x7c')][_0x7d10('0x7e')];break;case'switch':_0x2b0bc7['type']=db['Sequelize'][_0x7d10('0x7f')];_0x2b0bc7[_0x7d10('0x80')]=![];break;default:}return db[_0x7d10('0x79')]['queryInterface']['addColumn'](_0x7d10('0x81'),util[_0x7d10('0x6c')](_0x7d10('0x82'),_0x1f78f1['id']),_0x2b0bc7);})[_0x7d10('0x2c')](function(){return _0x1f78f1;});});}})[_0x7d10('0x2c')](respondWithResult(_0x58fa2d,null))[_0x7d10('0x4f')](handleError(_0x58fa2d,null));};exports[_0x7d10('0x83')]=function(_0x5f2bd0,_0x360039,_0x1793c4){var _0x24b185={};var _0x20738f={};var _0x62024;var _0x351e13;return db[_0x7d10('0x36')][_0x7d10('0x78')]({'where':{'id':_0x5f2bd0[_0x7d10('0x51')]['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x360039,null))[_0x7d10('0x2c')](function(_0x384f5c){if(_0x384f5c){_0x62024=_0x384f5c;_0x20738f[_0x7d10('0x3f')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x20738f[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x5f2bd0[_0x7d10('0x3b')]);_0x20738f[_0x7d10('0x45')]=_[_0x7d10('0x3e')](_0x20738f['model'],_0x20738f[_0x7d10('0x3b')]);_0x24b185[_0x7d10('0x3d')]=_['intersection'](_0x20738f[_0x7d10('0x3f')],qs[_0x7d10('0x40')](_0x5f2bd0[_0x7d10('0x3b')][_0x7d10('0x40')]));_0x24b185[_0x7d10('0x3d')]=_0x24b185[_0x7d10('0x3d')][_0x7d10('0x41')]?_0x24b185[_0x7d10('0x3d')]:_0x20738f[_0x7d10('0x3f')];_0x24b185[_0x7d10('0x6d')]=qs[_0x7d10('0x44')](_0x5f2bd0[_0x7d10('0x3b')]['sort']);_0x24b185['where']=qs['filters'](_['pick'](_0x5f2bd0[_0x7d10('0x3b')],_0x20738f[_0x7d10('0x45')]));_0x24b185['where']=_[_0x7d10('0x48')](_0x24b185[_0x7d10('0x47')],{'$or':[{'ListId':_0x384f5c['id']},{'ListId':null}]});if(_0x5f2bd0[_0x7d10('0x3b')][_0x7d10('0x4a')]){_0x24b185[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0x24b185[_0x7d10('0x47')],{'$or':_['map'](_0x24b185[_0x7d10('0x3d')],function(_0x24dc72){var _0x149e80={};_0x149e80[_0x24dc72]={'$like':'%'+_0x5f2bd0[_0x7d10('0x3b')][_0x7d10('0x4a')]+'%'};return _0x149e80;})});}_0x24b185=_[_0x7d10('0x48')]({},_0x24b185,_0x5f2bd0[_0x7d10('0x4b')]);return db[_0x7d10('0x6a')][_0x7d10('0x84')](_0x24b185);}})[_0x7d10('0x2c')](respondWithResult(_0x360039,null))[_0x7d10('0x4f')](handleError(_0x360039,null));};exports['addAgents']=function(_0x426ca9,_0x404004,_0x70c168){return db['CmList'][_0x7d10('0x53')]({'where':{'id':_0x426ca9['params']['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x404004,null))[_0x7d10('0x2c')](function(_0x1ece84){if(_0x1ece84){return _0x1ece84[_0x7d10('0x85')](_0x426ca9[_0x7d10('0x55')][_0x7d10('0x5f')],_[_0x7d10('0x66')](_0x426ca9[_0x7d10('0x55')],['ids','id'])||{})[_0x7d10('0x86')](function(_0x4c5c12){for(var _0x563d32=0x0;_0x563d32<_0x426ca9[_0x7d10('0x55')]['ids'][_0x7d10('0x41')];_0x563d32+=0x1){socket[_0x7d10('0x87')]('userCmList:save',{'UserId':Number(_0x426ca9[_0x7d10('0x55')][_0x7d10('0x5f')][_0x563d32]),'CmListId':Number(_0x426ca9[_0x7d10('0x51')]['id'])});}return _0x4c5c12;});}})[_0x7d10('0x2c')](respondWithResult(_0x404004,null))[_0x7d10('0x4f')](handleError(_0x404004,null));};exports['removeAgents']=function(_0x138d46,_0xe57701,_0xe70462){return db[_0x7d10('0x36')][_0x7d10('0x53')]({'where':{'id':_0x138d46['params']['id']}})['then'](handleEntityNotFound(_0xe57701,null))[_0x7d10('0x2c')](function(_0x226164){if(_0x226164){return _0x226164[_0x7d10('0x88')](_0x138d46[_0x7d10('0x3b')][_0x7d10('0x5f')])[_0x7d10('0x2c')](function(){if(_[_0x7d10('0x63')](_0x138d46[_0x7d10('0x3b')][_0x7d10('0x5f')])){for(var _0xad674a=0x0;_0xad674a<_0x138d46[_0x7d10('0x3b')]['ids']['length'];_0xad674a+=0x1){socket[_0x7d10('0x87')](_0x7d10('0x89'),{'UserId':Number(_0x138d46[_0x7d10('0x3b')][_0x7d10('0x5f')][_0xad674a]),'CmListId':Number(_0x138d46[_0x7d10('0x51')]['id'])});}}else{socket['emit'](_0x7d10('0x89'),{'UserId':Number(_0x138d46[_0x7d10('0x3b')][_0x7d10('0x5f')]),'CmListId':Number(_0x138d46[_0x7d10('0x51')]['id'])});}});}})['then'](respondWithStatusCode(_0xe57701,null))['catch'](handleError(_0xe57701,null));};exports[_0x7d10('0x8a')]=function(_0x360871,_0x2ef6a8,_0x56a583){var _0x536810={};var _0x18379c={};var _0x4bd30f;var _0x359646;return db['CmList'][_0x7d10('0x78')]({'where':{'id':_0x360871[_0x7d10('0x51')]['id']}})[_0x7d10('0x2c')](handleEntityNotFound(_0x2ef6a8,null))[_0x7d10('0x2c')](function(_0x33df15){if(_0x33df15){_0x4bd30f=_0x33df15;_0x18379c[_0x7d10('0x3f')]=_['keys'](db[_0x7d10('0x8b')][_0x7d10('0x37')]);_0x18379c[_0x7d10('0x3b')]=_[_0x7d10('0x3c')](_0x360871[_0x7d10('0x3b')]);_0x18379c[_0x7d10('0x45')]=_[_0x7d10('0x3e')](_0x18379c[_0x7d10('0x3f')],_0x18379c[_0x7d10('0x3b')]);_0x536810[_0x7d10('0x3d')]=_[_0x7d10('0x3e')](_0x18379c[_0x7d10('0x3f')],qs[_0x7d10('0x40')](_0x360871[_0x7d10('0x3b')][_0x7d10('0x40')]));_0x536810[_0x7d10('0x3d')]=_0x536810[_0x7d10('0x3d')][_0x7d10('0x41')]?_0x536810[_0x7d10('0x3d')]:_0x18379c['model'];_0x536810[_0x7d10('0x6d')]=qs[_0x7d10('0x44')](_0x360871['query']['sort']);_0x536810[_0x7d10('0x47')]=qs[_0x7d10('0x45')](_[_0x7d10('0x46')](_0x360871[_0x7d10('0x3b')],_0x18379c['filters']));if(_0x360871[_0x7d10('0x3b')][_0x7d10('0x4a')]){_0x536810[_0x7d10('0x47')]=_[_0x7d10('0x48')](_0x536810[_0x7d10('0x47')],{'$or':_['map'](_0x536810[_0x7d10('0x3d')],function(_0x42a715){var _0x7088b4={};_0x7088b4[_0x42a715]={'$like':'%'+_0x360871[_0x7d10('0x3b')][_0x7d10('0x4a')]+'%'};return _0x7088b4;})});}_0x536810=_[_0x7d10('0x48')]({},_0x536810,_0x360871['options']);return _0x4bd30f['getAgents'](_0x536810);}})[_0x7d10('0x2c')](function(_0x3d3131){if(_0x3d3131){_0x359646=_0x3d3131[_0x7d10('0x41')];if(!_0x360871[_0x7d10('0x3b')][_0x7d10('0x42')]('nolimit')){_0x536810[_0x7d10('0x21')]=qs[_0x7d10('0x21')](_0x360871[_0x7d10('0x3b')][_0x7d10('0x21')]);_0x536810['offset']=qs[_0x7d10('0x24')](_0x360871[_0x7d10('0x3b')][_0x7d10('0x24')]);}return _0x4bd30f['getAgents'](_0x536810);}})[_0x7d10('0x2c')](function(_0x1c96b2){if(_0x1c96b2){return _0x1c96b2?{'count':_0x359646,'rows':_0x1c96b2}:null;}})[_0x7d10('0x2c')](respondWithResult(_0x2ef6a8,null))[_0x7d10('0x4f')](handleError(_0x2ef6a8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e50f1c8..f317e07 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0x48250a,_0x59ab56){_0x48250a=_0x48250a-0x0;var _0x46ef5f=_0x3e74[_0x48250a];return _0x46ef5f;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x3e9842,_0x1d2547){_0x3e9842=_0x3e9842-0x0;var _0x15592c=_0xe14b[_0x3e9842];return _0x15592c;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 3825e18..932bb9e 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 _0x41bb=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','cm_lists','lodash','util','api'];(function(_0x51bc5a,_0x2cc80e){var _0x393ffd=function(_0x496a10){while(--_0x496a10){_0x51bc5a['push'](_0x51bc5a['shift']());}};_0x393ffd(++_0x2cc80e);}(_0x41bb,0xc5));var _0xb41b=function(_0x1d2195,_0x1eb6fe){_0x1d2195=_0x1d2195-0x0;var _0x39dd3f=_0x41bb[_0x1d2195];return _0x39dd3f;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var logger=require('../../config/logger')(_0xb41b('0x2'));var moment=require('moment');var BPromise=require(_0xb41b('0x3'));var rp=require(_0xb41b('0x4'));var fs=require('fs');var path=require(_0xb41b('0x5'));var rimraf=require(_0xb41b('0x6'));var config=require('../../config/environment');var attributes=require(_0xb41b('0x7'));module[_0xb41b('0x8')]=function(_0x2dbaa3,_0x50bc62){return _0x2dbaa3['define']('CmList',attributes,{'tableName':_0xb41b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','CmList','lodash','util'];(function(_0x537415,_0x57b80c){var _0x6f6575=function(_0x433275){while(--_0x433275){_0x537415['push'](_0x537415['shift']());}};_0x6f6575(++_0x57b80c);}(_0x54ef,0x112));var _0xf54e=function(_0x404770,_0x39f829){_0x404770=_0x404770-0x0;var _0x418842=_0x54ef[_0x404770];return _0x418842;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),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 a40504f..0decc8b 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 _0xb1bc=['http','localhost','socket.io-emitter','redis','./cmList.socket','register','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x20f4b0,_0x3b28ea){var _0x4bf5d9=function(_0x2886d7){while(--_0x2886d7){_0x20f4b0['push'](_0x20f4b0['shift']());}};_0x4bf5d9(++_0x3b28ea);}(_0xb1bc,0x195));var _0xcb1b=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0xb1bc[_0xe896bf];return _0x4c7a8a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcb1b('0x0'));var BPromise=require(_0xcb1b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb1b('0x2'));var db=require(_0xcb1b('0x3'))['db'];var utils=require(_0xcb1b('0x4'));var logger=require('../../config/logger')(_0xcb1b('0x5'));var config=require(_0xcb1b('0x6'));var jayson=require(_0xcb1b('0x7'));var client=jayson[_0xcb1b('0x8')][_0xcb1b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xcb1b('0xa'),'port':0x18eb});var socket=require(_0xcb1b('0xb'))(new Redis(config[_0xcb1b('0xc')]));require(_0xcb1b('0xd'))[_0xcb1b('0xe')](socket);function respondWithRpcPromise(_0x551d2e,_0x4e73b8,_0x5b9772){return new BPromise(function(_0x150ef3,_0x3d2102){return client['request'](_0x551d2e,_0x5b9772)['then'](function(_0x392738){logger[_0xcb1b('0xf')](_0xcb1b('0x10'),_0x4e73b8,_0xcb1b('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x4e73b8,_0xcb1b('0x11'),JSON[_0xcb1b('0x12')](_0x392738));if(_0x392738[_0xcb1b('0x13')]){if(_0x392738[_0xcb1b('0x13')][_0xcb1b('0x14')]===0x1f4){logger[_0xcb1b('0x13')](_0xcb1b('0x10'),_0x4e73b8,_0x392738[_0xcb1b('0x13')]['message']);return _0x3d2102(_0x392738[_0xcb1b('0x13')]['message']);}logger['error'](_0xcb1b('0x10'),_0x4e73b8,_0x392738[_0xcb1b('0x13')]['message']);return _0x150ef3(_0x392738[_0xcb1b('0x13')][_0xcb1b('0x15')]);}else{logger['info'](_0xcb1b('0x10'),_0x4e73b8,_0xcb1b('0x11'));_0x150ef3(_0x392738[_0xcb1b('0x16')][_0xcb1b('0x15')]);}})['catch'](function(_0x2fa00e){logger[_0xcb1b('0x13')](_0xcb1b('0x10'),_0x4e73b8,_0x2fa00e);_0x3d2102(_0x2fa00e);});});} \ No newline at end of file +var _0x901c=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','lodash','moment','ioredis','../../mysqldb'];(function(_0x2399ee,_0x1fd6eb){var _0x517039=function(_0x12883c){while(--_0x12883c){_0x2399ee['push'](_0x2399ee['shift']());}};_0x517039(++_0x1fd6eb);}(_0x901c,0xab));var _0xc901=function(_0x2dfd07,_0x2dd089){_0x2dfd07=_0x2dfd07-0x0;var _0x47995a=_0x901c[_0x2dfd07];return _0x47995a;};'use strict';var _=require(_0xc901('0x0'));var util=require('util');var moment=require(_0xc901('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc901('0x2'));var db=require(_0xc901('0x3'))['db'];var utils=require(_0xc901('0x4'));var logger=require('../../config/logger')(_0xc901('0x5'));var config=require(_0xc901('0x6'));var jayson=require(_0xc901('0x7'));var client=jayson[_0xc901('0x8')][_0xc901('0x9')]({'port':0x232a});config['redis']=_[_0xc901('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc901('0xb'))(new Redis(config[_0xc901('0xc')]));require('./cmList.socket')[_0xc901('0xd')](socket);function respondWithRpcPromise(_0x16e3ae,_0x19d585,_0x3d41f2){return new BPromise(function(_0x19830a,_0x4009bc){return client[_0xc901('0xe')](_0x16e3ae,_0x3d41f2)[_0xc901('0xf')](function(_0x438de2){logger[_0xc901('0x10')](_0xc901('0x11'),_0x19d585,'request\x20sent');logger[_0xc901('0x12')](_0xc901('0x13'),_0x19d585,_0xc901('0x14'),JSON['stringify'](_0x438de2));if(_0x438de2['error']){if(_0x438de2['error'][_0xc901('0x15')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x19d585,_0x438de2[_0xc901('0x16')][_0xc901('0x17')]);return _0x4009bc(_0x438de2[_0xc901('0x16')][_0xc901('0x17')]);}logger[_0xc901('0x16')](_0xc901('0x11'),_0x19d585,_0x438de2[_0xc901('0x16')][_0xc901('0x17')]);return _0x19830a(_0x438de2[_0xc901('0x16')][_0xc901('0x17')]);}else{logger[_0xc901('0x10')]('CmList,\x20%s,\x20%s',_0x19d585,_0xc901('0x14'));_0x19830a(_0x438de2[_0xc901('0x18')]['message']);}})['catch'](function(_0x3f4e45){logger['error'](_0xc901('0x11'),_0x19d585,_0x3f4e45);_0x4009bc(_0x3f4e45);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 17009b3..eccbda4 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 _0xc261=['emit','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xc261,0x135));var _0x1c26=function(_0x269309,_0xa35dd6){_0x269309=_0x269309-0x0;var _0x576dd5=_0xc261[_0x269309];return _0x576dd5;};'use strict';var CmListEvents=require(_0x1c26('0x0'));var events=[_0x1c26('0x1'),_0x1c26('0x2'),'update'];function createListener(_0x2caae3,_0x24eb1b){return function(_0xf0ef0c){_0x24eb1b[_0x1c26('0x3')](_0x2caae3,_0xf0ef0c);};}function removeListener(_0x3864ea,_0x117078){return function(){CmListEvents[_0x1c26('0x4')](_0x3864ea,_0x117078);};}exports[_0x1c26('0x5')]=function(_0x4e76a5){for(var _0x1bd41b=0x0,_0x4fad0e=events[_0x1c26('0x6')];_0x1bd41b<_0x4fad0e;_0x1bd41b++){var _0x1c6a3d=events[_0x1bd41b];var _0x5eaf33=createListener(_0x1c26('0x7')+_0x1c6a3d,_0x4e76a5);CmListEvents['on'](_0x1c6a3d,_0x5eaf33);}}; \ No newline at end of file +var _0x31d9=['register','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x39c803,_0x5c52ac){var _0x11ed55=function(_0x454627){while(--_0x454627){_0x39c803['push'](_0x39c803['shift']());}};_0x11ed55(++_0x5c52ac);}(_0x31d9,0xe9));var _0x931d=function(_0x2228d2,_0x2839d1){_0x2228d2=_0x2228d2-0x0;var _0x51ed0e=_0x31d9[_0x2228d2];return _0x51ed0e;};'use strict';var CmListEvents=require(_0x931d('0x0'));var events=[_0x931d('0x1'),_0x931d('0x2'),_0x931d('0x3')];function createListener(_0x2a03d7,_0x39134b){return function(_0x41eb77){_0x39134b[_0x931d('0x4')](_0x2a03d7,_0x41eb77);};}function removeListener(_0x1321a4,_0x305330){return function(){CmListEvents['removeListener'](_0x1321a4,_0x305330);};}exports[_0x931d('0x5')]=function(_0x5702a9){for(var _0x5d8509=0x0,_0xe7cb15=events['length'];_0x5d8509<_0xe7cb15;_0x5d8509++){var _0x3c1d77=events[_0x5d8509];var _0x1255c1=createListener(_0x931d('0x6')+_0x3c1d77,_0x5702a9);CmListEvents['on'](_0x3c1d77,_0x1255c1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 29fd028..803a2f6 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 _0xfe13=['addDisposition','post','addContacts','addCustomField','put','update','delete','destroy','removeDispositions','exports','multer','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfe13,0xea));var _0x3fe1=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xfe13[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0x3fe1('0x0'));var util=require('util');var path=require(_0x3fe1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3fe1('0x2'));var auth=require(_0x3fe1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3fe1('0x4'));var controller=require('./cmList.controller');router[_0x3fe1('0x5')]('/',auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x7')]);router[_0x3fe1('0x5')](_0x3fe1('0x8'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x9')]);router[_0x3fe1('0x5')](_0x3fe1('0xa'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0xb')]);router[_0x3fe1('0x5')](_0x3fe1('0xc'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0xd')]);router[_0x3fe1('0x5')](_0x3fe1('0xe'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0xf')]);router['get'](_0x3fe1('0x10'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x11')]);router[_0x3fe1('0x5')](_0x3fe1('0x12'),auth['isAuthenticated'](),controller['getCustomFields']);router['get'](_0x3fe1('0x13'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x14')]);router['post']('/',auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x15')]);router['post'](_0x3fe1('0xc'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x16')]);router[_0x3fe1('0x17')](_0x3fe1('0xe'),auth['isAuthenticated'](),controller[_0x3fe1('0x18')]);router['post'](_0x3fe1('0x12'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x19')]);router[_0x3fe1('0x17')](_0x3fe1('0x13'),auth[_0x3fe1('0x6')](),controller['addAgents']);router[_0x3fe1('0x1a')](_0x3fe1('0xa'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x1b')]);router[_0x3fe1('0x1c')]('/:id',auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x1d')]);router['delete'](_0x3fe1('0xc'),auth[_0x3fe1('0x6')](),controller[_0x3fe1('0x1e')]);router[_0x3fe1('0x1c')](_0x3fe1('0x13'),auth[_0x3fe1('0x6')](),controller['removeAgents']);module[_0x3fe1('0x1f')]=router; \ No newline at end of file +var _0x1214=['create','post','/:id/dispositions','addDisposition','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1214,0x6e));var _0x4121=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0x1214[_0x397f37];return _0x31cae6;};'use strict';var multer=require(_0x4121('0x0'));var util=require(_0x4121('0x1'));var path=require(_0x4121('0x2'));var timeout=require(_0x4121('0x3'));var express=require('express');var router=express[_0x4121('0x4')]();var fs_extra=require(_0x4121('0x5'));var auth=require(_0x4121('0x6'));var interaction=require(_0x4121('0x7'));var config=require(_0x4121('0x8'));var controller=require('./cmList.controller');router[_0x4121('0x9')]('/',auth[_0x4121('0xa')](),controller['index']);router[_0x4121('0x9')](_0x4121('0xb'),auth[_0x4121('0xa')](),controller[_0x4121('0xc')]);router[_0x4121('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4121('0xd')]);router[_0x4121('0x9')]('/:id/dispositions',auth[_0x4121('0xa')](),controller[_0x4121('0xe')]);router[_0x4121('0x9')](_0x4121('0xf'),auth['isAuthenticated'](),controller[_0x4121('0x10')]);router[_0x4121('0x9')]('/:id/contacts/csv',auth[_0x4121('0xa')](),controller[_0x4121('0x11')]);router[_0x4121('0x9')](_0x4121('0x12'),auth[_0x4121('0xa')](),controller[_0x4121('0x13')]);router['get'](_0x4121('0x14'),auth['isAuthenticated'](),controller[_0x4121('0x15')]);router['post']('/',auth[_0x4121('0xa')](),controller[_0x4121('0x16')]);router[_0x4121('0x17')](_0x4121('0x18'),auth[_0x4121('0xa')](),controller[_0x4121('0x19')]);router[_0x4121('0x17')](_0x4121('0xf'),auth[_0x4121('0xa')](),controller['addContacts']);router[_0x4121('0x17')](_0x4121('0x12'),auth[_0x4121('0xa')](),controller['addCustomField']);router[_0x4121('0x17')](_0x4121('0x14'),auth[_0x4121('0xa')](),controller['addAgents']);router[_0x4121('0x1a')](_0x4121('0x1b'),auth['isAuthenticated'](),controller[_0x4121('0x1c')]);router[_0x4121('0x1d')]('/:id',auth[_0x4121('0xa')](),controller[_0x4121('0x1e')]);router[_0x4121('0x1d')](_0x4121('0x18'),auth['isAuthenticated'](),controller[_0x4121('0x1f')]);router[_0x4121('0x1d')]('/:id/users',auth['isAuthenticated'](),controller[_0x4121('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 056181c..c14bec4 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 _0x9a4a=['STRING','sequelize','exports','VIRTUAL'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9a4a,0x19d));var _0xa9a4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9a4a[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xa9a4('0x0'));module[_0xa9a4('0x1')]={'name':{'type':Sequelize[_0xa9a4('0x2')],'get':function(_0x23cb47){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xa9a4('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xa9a4('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xa9a4('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x465d=['field','STRING','sequelize','exports','getDataValue'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x465d,0x1c9));var _0xd465=function(_0x405ac9,_0x2c795c){_0x405ac9=_0x405ac9-0x0;var _0x2d200f=_0x465d[_0x405ac9];return _0x2d200f;};'use strict';var Sequelize=require(_0xd465('0x0'));module[_0xd465('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x16d67e){return this[_0xd465('0x2')](_0xd465('0x3'));}},'field':{'type':Sequelize[_0xd465('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xd465('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xd465('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 57478a4..b405bb6 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 _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x405a43,_0x573a3e){var _0x53a747=function(_0x497e14){while(--_0x497e14){_0x405a43['push'](_0x405a43['shift']());}};_0x53a747(++_0x573a3e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4b006d,_0x5fe08b){var _0x18b486=function(_0xa28963){while(--_0xa28963){_0x4b006d['push'](_0x4b006d['shift']());}};_0x18b486(++_0x5fe08b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 948fa9f..ae96ceb 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 _0x6c99=['exports','define','Condition','tools_conditions','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./condition.attributes'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x6c99,0x160));var _0x96c9=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x6c99[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x96c9('0x0'));var util=require(_0x96c9('0x1'));var logger=require(_0x96c9('0x2'))('api');var moment=require(_0x96c9('0x3'));var BPromise=require('bluebird');var rp=require(_0x96c9('0x4'));var fs=require('fs');var path=require(_0x96c9('0x5'));var rimraf=require('rimraf');var config=require(_0x96c9('0x6'));var attributes=require(_0x96c9('0x7'));module[_0x96c9('0x8')]=function(_0x32b4ed,_0x69c68f){return _0x32b4ed[_0x96c9('0x9')](_0x96c9('0xa'),attributes,{'tableName':_0x96c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x545f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','lodash'];(function(_0x5bd4db,_0x15bf79){var _0x45dcd0=function(_0xda38b2){while(--_0xda38b2){_0x5bd4db['push'](_0x5bd4db['shift']());}};_0x45dcd0(++_0x15bf79);}(_0x545f,0xa7));var _0xf545=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0x545f[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0xf545('0x0'));var util=require(_0xf545('0x1'));var logger=require(_0xf545('0x2'))(_0xf545('0x3'));var moment=require(_0xf545('0x4'));var BPromise=require(_0xf545('0x5'));var rp=require(_0xf545('0x6'));var fs=require('fs');var path=require(_0xf545('0x7'));var rimraf=require(_0xf545('0x8'));var config=require(_0xf545('0x9'));var attributes=require(_0xf545('0xa'));module[_0xf545('0xb')]=function(_0x37ad66,_0xd4f624){return _0x37ad66['define']('Condition',attributes,{'tableName':'tools_conditions','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 b18cb05..1161ed8 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 _0x5c54=['../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4da47e,_0x28448d){var _0x566c22=function(_0x10a40c){while(--_0x10a40c){_0x4da47e['push'](_0x4da47e['shift']());}};_0x566c22(++_0x28448d);}(_0x5c54,0xe0));var _0x45c5=function(_0x29bcf4,_0x40c719){_0x29bcf4=_0x29bcf4-0x0;var _0x89d7c6=_0x5c54[_0x29bcf4];return _0x89d7c6;};'use strict';var _=require(_0x45c5('0x0'));var util=require(_0x45c5('0x1'));var moment=require(_0x45c5('0x2'));var BPromise=require(_0x45c5('0x3'));var rs=require(_0x45c5('0x4'));var fs=require('fs');var Redis=require(_0x45c5('0x5'));var db=require(_0x45c5('0x6'))['db'];var utils=require(_0x45c5('0x7'));var logger=require(_0x45c5('0x8'))(_0x45c5('0x9'));var config=require(_0x45c5('0xa'));var jayson=require(_0x45c5('0xb'));var client=jayson['client'][_0x45c5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c0276,_0x375ab2,_0x316cfe){return new BPromise(function(_0x1e0ae5,_0x5500a6){return client[_0x45c5('0xd')](_0x2c0276,_0x316cfe)[_0x45c5('0xe')](function(_0x3bbc2a){logger[_0x45c5('0xf')](_0x45c5('0x10'),_0x375ab2,_0x45c5('0x11'));logger[_0x45c5('0x12')](_0x45c5('0x13'),_0x375ab2,_0x45c5('0x11'),JSON[_0x45c5('0x14')](_0x3bbc2a));if(_0x3bbc2a[_0x45c5('0x15')]){if(_0x3bbc2a[_0x45c5('0x15')][_0x45c5('0x16')]===0x1f4){logger[_0x45c5('0x15')](_0x45c5('0x10'),_0x375ab2,_0x3bbc2a[_0x45c5('0x15')]['message']);return _0x5500a6(_0x3bbc2a[_0x45c5('0x15')]['message']);}logger[_0x45c5('0x15')]('Condition,\x20%s,\x20%s',_0x375ab2,_0x3bbc2a[_0x45c5('0x15')][_0x45c5('0x17')]);return _0x1e0ae5(_0x3bbc2a[_0x45c5('0x15')][_0x45c5('0x17')]);}else{logger[_0x45c5('0xf')](_0x45c5('0x10'),_0x375ab2,_0x45c5('0x11'));_0x1e0ae5(_0x3bbc2a[_0x45c5('0x18')][_0x45c5('0x17')]);}})[_0x45c5('0x19')](function(_0x4ea5e2){logger[_0x45c5('0x15')](_0x45c5('0x10'),_0x375ab2,_0x4ea5e2);_0x5500a6(_0x4ea5e2);});});} \ No newline at end of file +var _0x06f4=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','http','then','info','request\x20sent','debug'];(function(_0x4229f6,_0x29e613){var _0x861080=function(_0x441ece){while(--_0x441ece){_0x4229f6['push'](_0x4229f6['shift']());}};_0x861080(++_0x29e613);}(_0x06f4,0x15d));var _0x406f=function(_0x2f83a4,_0x2a63d5){_0x2f83a4=_0x2f83a4-0x0;var _0x5d29e1=_0x06f4[_0x2f83a4];return _0x5d29e1;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var moment=require('moment');var BPromise=require(_0x406f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x406f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x406f('0x4'));var logger=require(_0x406f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x406f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3f8302,_0x152b3b,_0x38d942){return new BPromise(function(_0x5a9267,_0xde3479){return client['request'](_0x3f8302,_0x38d942)[_0x406f('0x7')](function(_0x3a60dd){logger[_0x406f('0x8')]('Condition,\x20%s,\x20%s',_0x152b3b,_0x406f('0x9'));logger[_0x406f('0xa')](_0x406f('0xb'),_0x152b3b,_0x406f('0x9'),JSON[_0x406f('0xc')](_0x3a60dd));if(_0x3a60dd['error']){if(_0x3a60dd['error']['code']===0x1f4){logger[_0x406f('0xd')](_0x406f('0xe'),_0x152b3b,_0x3a60dd[_0x406f('0xd')][_0x406f('0xf')]);return _0xde3479(_0x3a60dd['error'][_0x406f('0xf')]);}logger[_0x406f('0xd')]('Condition,\x20%s,\x20%s',_0x152b3b,_0x3a60dd['error'][_0x406f('0xf')]);return _0x5a9267(_0x3a60dd['error'][_0x406f('0xf')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x152b3b,_0x406f('0x9'));_0x5a9267(_0x3a60dd[_0x406f('0x10')]['message']);}})[_0x406f('0x11')](function(_0xd676a0){logger[_0x406f('0xd')](_0x406f('0xe'),_0x152b3b,_0xd676a0);_0xde3479(_0xd676a0);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e989a78..b51bb24 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 _0x3992=['put','/:id','isAuthenticated','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0x30f7ef,_0x3ec7e0){var _0x595f63=function(_0x189027){while(--_0x189027){_0x30f7ef['push'](_0x30f7ef['shift']());}};_0x595f63(++_0x3ec7e0);}(_0x3992,0x15d));var _0x2399=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x3992[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x2399('0x0'));var util=require(_0x2399('0x1'));var path=require(_0x2399('0x2'));var timeout=require(_0x2399('0x3'));var express=require(_0x2399('0x4'));var router=express[_0x2399('0x5')]();var fs_extra=require(_0x2399('0x6'));var auth=require(_0x2399('0x7'));var interaction=require(_0x2399('0x8'));var config=require(_0x2399('0x9'));var controller=require(_0x2399('0xa'));router[_0x2399('0xb')](_0x2399('0xc'),auth[_0x2399('0xd')](),controller['update']);router['delete'](_0x2399('0xc'),auth[_0x2399('0xd')](),controller[_0x2399('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6eac=['./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x161f25,_0x42abe9){var _0x4e67da=function(_0x514e42){while(--_0x514e42){_0x161f25['push'](_0x161f25['shift']());}};_0x4e67da(++_0x42abe9);}(_0x6eac,0x197));var _0xc6ea=function(_0x6a8dd,_0x3f64a8){_0x6a8dd=_0x6a8dd-0x0;var _0x16ded7=_0x6eac[_0x6a8dd];return _0x16ded7;};'use strict';var multer=require(_0xc6ea('0x0'));var util=require(_0xc6ea('0x1'));var path=require(_0xc6ea('0x2'));var timeout=require(_0xc6ea('0x3'));var express=require(_0xc6ea('0x4'));var router=express['Router']();var fs_extra=require(_0xc6ea('0x5'));var auth=require(_0xc6ea('0x6'));var interaction=require(_0xc6ea('0x7'));var config=require(_0xc6ea('0x8'));var controller=require(_0xc6ea('0x9'));router[_0xc6ea('0xa')]('/:id',auth[_0xc6ea('0xb')](),controller[_0xc6ea('0xc')]);router[_0xc6ea('0xd')](_0xc6ea('0xe'),auth[_0xc6ea('0xb')](),controller[_0xc6ea('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index f0e91c0..d641abb 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 _0xb7e7=['STRING','sequelize'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb7e7[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x3ec1c2,_0x233cb7){var _0x36d421=function(_0x443d64){while(--_0x443d64){_0x3ec1c2['push'](_0x3ec1c2['shift']());}};_0x36d421(++_0x233cb7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index edf5431..80a1e8f 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 _0xf067=['sort','where','filter','merge','map','options','includeAll','findAll','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','role','update','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','pick','nolimit','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','json','undefined','count','status','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','limit','offset','order'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xf067,0x124));var _0x7f06=function(_0x3ee592,_0x3d8c4f){_0x3ee592=_0x3ee592-0x0;var _0x212cbb=_0xf067[_0x3ee592];return _0x212cbb;};'use strict';var emlformat=require(_0x7f06('0x0'));var rimraf=require(_0x7f06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f06('0x2'));var rp=require(_0x7f06('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f06('0x4'));var path=require(_0x7f06('0x5'));var sox=require(_0x7f06('0x6'));var csv=require(_0x7f06('0x7'));var ejs=require(_0x7f06('0x8'));var fs=require('fs');var fs_extra=require(_0x7f06('0x9'));var _=require(_0x7f06('0xa'));var squel=require(_0x7f06('0xb'));var crypto=require(_0x7f06('0xc'));var jsforce=require(_0x7f06('0xd'));var deskjs=require(_0x7f06('0xe'));var toCsv=require(_0x7f06('0x7'));var querystring=require(_0x7f06('0xf'));var Papa=require('papaparse');var Redis=require(_0x7f06('0x10'));var authService=require(_0x7f06('0x11'));var qs=require(_0x7f06('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f06('0x13'));var logger=require(_0x7f06('0x14'))('api');var utils=require(_0x7f06('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7f06('0x16'));var db=require('../../mysqldb')['db'];config[_0x7f06('0x17')]=_['defaults'](config[_0x7f06('0x17')],{'host':_0x7f06('0x18'),'port':0x18eb});var socket=require(_0x7f06('0x19'))(new Redis(config[_0x7f06('0x17')]));require(_0x7f06('0x1a'))[_0x7f06('0x1b')](socket);function respondWithStatusCode(_0x1c52c0,_0x551fed){_0x551fed=_0x551fed||0xcc;return function(_0x4f7465){if(_0x4f7465){return _0x1c52c0[_0x7f06('0x1c')](_0x551fed);}return _0x1c52c0['status'](_0x551fed)['end']();};}function respondWithResult(_0x2d8695,_0x26e561){_0x26e561=_0x26e561||0xc8;return function(_0x8d04c){if(_0x8d04c){return _0x2d8695['status'](_0x26e561)[_0x7f06('0x1d')](_0x8d04c);}};}function respondWithFilteredResult(_0x488298,_0x2fd36c){return function(_0x16c203){if(_0x16c203){var _0x400a90=typeof _0x2fd36c['offset']==='undefined'&&typeof _0x2fd36c['limit']===_0x7f06('0x1e');var _0xb7004a=_0x16c203[_0x7f06('0x1f')];var _0x3df6b1=_0x400a90?0x0:_0x2fd36c['offset'];var _0x37d9e3=_0x400a90?_0x16c203[_0x7f06('0x1f')]:_0x2fd36c['offset']+_0x2fd36c['limit'];var _0x25ce7b;if(_0x37d9e3>=_0xb7004a){_0x37d9e3=_0xb7004a;_0x25ce7b=0xc8;}else{_0x25ce7b=0xce;}_0x488298[_0x7f06('0x20')](_0x25ce7b);return _0x488298['set'](_0x7f06('0x21'),_0x3df6b1+'-'+_0x37d9e3+'/'+_0xb7004a)[_0x7f06('0x1d')](_0x16c203);}return null;};}function patchUpdates(_0x2147f5){return function(_0x32946f){try{jsonpatch[_0x7f06('0x22')](_0x32946f,_0x2147f5,!![]);}catch(_0x4a5263){return BPromise['reject'](_0x4a5263);}return _0x32946f[_0x7f06('0x23')]();};}function saveUpdates(_0x439dad,_0x57a6f8){return function(_0x2ab401){if(_0x2ab401){return _0x2ab401['update'](_0x439dad)[_0x7f06('0x24')](function(_0x3682e1){return _0x3682e1;});}return null;};}function removeEntity(_0x2bf737,_0x4933a9){return function(_0x5c4a0e){if(_0x5c4a0e){return _0x5c4a0e[_0x7f06('0x25')]()[_0x7f06('0x24')](function(){var _0x38cfa6=_0x5c4a0e[_0x7f06('0x26')]({'plain':!![]});var _0xb41c60=_0x7f06('0x27');return db[_0x7f06('0x28')][_0x7f06('0x25')]({'where':{'type':_0xb41c60,'resourceId':_0x38cfa6['id']}})[_0x7f06('0x24')](function(){return _0x5c4a0e;});})[_0x7f06('0x24')](function(){_0x2bf737[_0x7f06('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x332a44,_0x496f7f){return function(_0x4da9c8){if(!_0x4da9c8){_0x332a44[_0x7f06('0x1c')](0x194);}return _0x4da9c8;};}function handleError(_0x3b755a,_0x3a0f3d){_0x3a0f3d=_0x3a0f3d||0x1f4;return function(_0x5d2825){logger['error'](_0x5d2825[_0x7f06('0x29')]);if(_0x5d2825[_0x7f06('0x2a')]){delete _0x5d2825[_0x7f06('0x2a')];}_0x3b755a[_0x7f06('0x20')](_0x3a0f3d)[_0x7f06('0x2b')](_0x5d2825);};}exports[_0x7f06('0x2c')]=function(_0x595619,_0x59357a){var _0x33ae1b={},_0x353350={},_0xa89eb2={'count':0x0,'rows':[]};var _0x5996b2=_['map'](db[_0x7f06('0x2d')][_0x7f06('0x2e')],function(_0x58b26f){return{'name':_0x58b26f[_0x7f06('0x2f')],'type':_0x58b26f[_0x7f06('0x30')][_0x7f06('0x31')]};});_0x353350['model']=_['map'](_0x5996b2,_0x7f06('0x2a'));_0x353350[_0x7f06('0x32')]=_[_0x7f06('0x33')](_0x595619[_0x7f06('0x32')]);_0x353350[_0x7f06('0x34')]=_['intersection'](_0x353350[_0x7f06('0x35')],_0x353350[_0x7f06('0x32')]);_0x33ae1b['attributes']=_[_0x7f06('0x36')](_0x353350[_0x7f06('0x35')],qs[_0x7f06('0x37')](_0x595619[_0x7f06('0x32')]['fields']));_0x33ae1b['attributes']=_0x33ae1b[_0x7f06('0x38')][_0x7f06('0x39')]?_0x33ae1b['attributes']:_0x353350[_0x7f06('0x35')];if(!_0x595619[_0x7f06('0x32')][_0x7f06('0x3a')]('nolimit')){_0x33ae1b['limit']=qs[_0x7f06('0x3b')](_0x595619[_0x7f06('0x32')][_0x7f06('0x3b')]);_0x33ae1b[_0x7f06('0x3c')]=qs[_0x7f06('0x3c')](_0x595619[_0x7f06('0x32')][_0x7f06('0x3c')]);}_0x33ae1b[_0x7f06('0x3d')]=qs[_0x7f06('0x3e')](_0x595619[_0x7f06('0x32')][_0x7f06('0x3e')]);_0x33ae1b[_0x7f06('0x3f')]=qs[_0x7f06('0x34')](_['pick'](_0x595619['query'],_0x353350[_0x7f06('0x34')]),_0x5996b2);if(_0x595619[_0x7f06('0x32')][_0x7f06('0x40')]){_0x33ae1b[_0x7f06('0x3f')]=_[_0x7f06('0x41')](_0x33ae1b[_0x7f06('0x3f')],{'$or':_[_0x7f06('0x42')](_0x5996b2,function(_0x347cda){if(_0x347cda['type']!=='VIRTUAL'){var _0x49accd={};_0x49accd[_0x347cda[_0x7f06('0x2a')]]={'$like':'%'+_0x595619[_0x7f06('0x32')]['filter']+'%'};return _0x49accd;}})});}_0x33ae1b=_[_0x7f06('0x41')]({},_0x33ae1b,_0x595619[_0x7f06('0x43')]);var _0x56ab09={'where':_0x33ae1b['where']};return db[_0x7f06('0x2d')]['count'](_0x56ab09)[_0x7f06('0x24')](function(_0xfad532){_0xa89eb2[_0x7f06('0x1f')]=_0xfad532;if(_0x595619[_0x7f06('0x32')][_0x7f06('0x44')]){_0x33ae1b['include']=[{'all':!![]}];}return db[_0x7f06('0x2d')][_0x7f06('0x45')](_0x33ae1b);})['then'](function(_0x133c67){_0xa89eb2['rows']=_0x133c67;return _0xa89eb2;})['then'](respondWithFilteredResult(_0x59357a,_0x33ae1b))[_0x7f06('0x46')](handleError(_0x59357a,null));};exports['show']=function(_0x297603,_0x3878c5){var _0x13739a={'raw':![],'where':{'id':_0x297603[_0x7f06('0x47')]['id']}},_0x3ea4bf={};_0x3ea4bf[_0x7f06('0x35')]=_[_0x7f06('0x33')](db[_0x7f06('0x2d')][_0x7f06('0x2e')]);_0x3ea4bf[_0x7f06('0x32')]=_['keys'](_0x297603[_0x7f06('0x32')]);_0x3ea4bf[_0x7f06('0x34')]=_['intersection'](_0x3ea4bf[_0x7f06('0x35')],_0x3ea4bf[_0x7f06('0x32')]);_0x13739a[_0x7f06('0x38')]=_[_0x7f06('0x36')](_0x3ea4bf[_0x7f06('0x35')],qs[_0x7f06('0x37')](_0x297603[_0x7f06('0x32')][_0x7f06('0x37')]));_0x13739a[_0x7f06('0x38')]=_0x13739a[_0x7f06('0x38')][_0x7f06('0x39')]?_0x13739a[_0x7f06('0x38')]:_0x3ea4bf[_0x7f06('0x35')];if(_0x297603[_0x7f06('0x32')]['includeAll']){_0x13739a[_0x7f06('0x48')]=[{'all':!![]}];}_0x13739a=_[_0x7f06('0x41')]({},_0x13739a,_0x297603['options']);return db[_0x7f06('0x2d')][_0x7f06('0x49')](_0x13739a)['then'](handleEntityNotFound(_0x3878c5,null))[_0x7f06('0x24')](respondWithResult(_0x3878c5,null))[_0x7f06('0x46')](handleError(_0x3878c5,null));};exports[_0x7f06('0x4a')]=function(_0x58a52b,_0x48924b){return db[_0x7f06('0x2d')][_0x7f06('0x4a')](_0x58a52b[_0x7f06('0x4b')],{})[_0x7f06('0x24')](function(_0xbcd93e){var _0x55c097=_0x58a52b[_0x7f06('0x4c')][_0x7f06('0x26')]({'plain':!![]});if(!_0x55c097)throw new Error(_0x7f06('0x4d'));if(_0x55c097['role']==='user'){var _0x22374a=_0xbcd93e[_0x7f06('0x26')]({'plain':!![]});var _0x5aea50=_0x7f06('0x27');return db[_0x7f06('0x4e')][_0x7f06('0x49')]({'where':{'name':_0x5aea50,'userProfileId':_0x55c097[_0x7f06('0x4f')]},'raw':!![]})[_0x7f06('0x24')](function(_0x26e24c){if(_0x26e24c&&_0x26e24c[_0x7f06('0x50')]===0x0){return db[_0x7f06('0x28')][_0x7f06('0x4a')]({'name':_0x22374a['name'],'resourceId':_0x22374a['id'],'type':_0x26e24c['name'],'sectionId':_0x26e24c['id']},{})['then'](function(){return _0xbcd93e;});}else{return _0xbcd93e;}})[_0x7f06('0x46')](function(_0x2b0fda){logger[_0x7f06('0x51')](_0x7f06('0x52'),_0x2b0fda);throw _0x2b0fda;});}return _0xbcd93e;})[_0x7f06('0x24')](respondWithResult(_0x48924b,0xc9))['catch'](handleError(_0x48924b,null));};exports['clone']=function(_0x5527aa,_0x2b6fcb){var _0xb08fe5={'where':{'id':_0x5527aa[_0x7f06('0x47')]['id']}},_0x5baf83={};_0x5baf83['model']=_[_0x7f06('0x33')](db[_0x7f06('0x2d')]['rawAttributes']);_0xb08fe5[_0x7f06('0x38')]=_['intersection'](_0x5baf83[_0x7f06('0x35')],qs[_0x7f06('0x37')](_0x5527aa[_0x7f06('0x32')][_0x7f06('0x37')]));_0xb08fe5[_0x7f06('0x38')]=_0xb08fe5['attributes'][_0x7f06('0x39')]?_0xb08fe5[_0x7f06('0x38')]:_0x5baf83[_0x7f06('0x35')];if(_0x5527aa[_0x7f06('0x32')][_0x7f06('0x44')]){_0xb08fe5['include']=[{'all':!![]}];}_0xb08fe5=_['merge']({},_0xb08fe5,_0x5527aa[_0x7f06('0x43')]);return db['Dashboard'][_0x7f06('0x49')](_0xb08fe5)['then'](handleEntityNotFound(_0x2b6fcb,null))[_0x7f06('0x24')](function(_0x6017f0){if(_0x6017f0){var _0x4dd708=_0x6017f0[_0x7f06('0x26')]({'plain':!![]});_0x4dd708=qs[_0x7f06('0x53')](_0x4dd708,['id','createdAt',_0x7f06('0x54')]);_0x5527aa[_0x7f06('0x4b')]=_[_0x7f06('0x53')](_0x5527aa[_0x7f06('0x4b')],['id',_0x7f06('0x55'),'updatedAt']);return db[_0x7f06('0x2d')]['create'](_['merge'](_0x4dd708,_0x5527aa[_0x7f06('0x4b')]),{'include':_0x5527aa[_0x7f06('0x32')][_0x7f06('0x44')]?[{'all':!![]}]:undefined})[_0x7f06('0x24')](function(_0x173ff4){var _0x469cb0=_0x5527aa[_0x7f06('0x4c')][_0x7f06('0x26')]({'plain':!![]});if(!_0x469cb0)throw new Error(_0x7f06('0x4d'));if(_0x469cb0[_0x7f06('0x56')]===_0x7f06('0x4c')){var _0x3a2733=_0x173ff4[_0x7f06('0x26')]({'plain':!![]});var _0xaf8ef=_0x7f06('0x27');return db[_0x7f06('0x4e')][_0x7f06('0x49')]({'where':{'name':_0xaf8ef,'userProfileId':_0x469cb0[_0x7f06('0x4f')]},'raw':!![]})[_0x7f06('0x24')](function(_0x8f8e31){if(_0x8f8e31&&_0x8f8e31['autoAssociation']===0x0){return db[_0x7f06('0x28')][_0x7f06('0x4a')]({'name':_0x3a2733[_0x7f06('0x2a')],'resourceId':_0x3a2733['id'],'type':_0x8f8e31['name'],'sectionId':_0x8f8e31['id']},{})[_0x7f06('0x24')](function(){return _0x173ff4;});}else{return _0x173ff4;}})[_0x7f06('0x46')](function(_0x17b4d2){logger[_0x7f06('0x51')](_0x7f06('0x52'),_0x17b4d2);throw _0x17b4d2;});}return _0x173ff4;});}})[_0x7f06('0x24')](respondWithResult(_0x2b6fcb,0xc9))[_0x7f06('0x46')](handleError(_0x2b6fcb,null));};exports[_0x7f06('0x57')]=function(_0x251f93,_0x55c241){if(_0x251f93['body']['id']){delete _0x251f93[_0x7f06('0x4b')]['id'];}return db[_0x7f06('0x2d')][_0x7f06('0x49')]({'where':{'id':_0x251f93['params']['id']}})[_0x7f06('0x24')](handleEntityNotFound(_0x55c241,null))['then'](saveUpdates(_0x251f93[_0x7f06('0x4b')],null))[_0x7f06('0x24')](respondWithResult(_0x55c241,null))[_0x7f06('0x46')](handleError(_0x55c241,null));};exports[_0x7f06('0x25')]=function(_0x3ca636,_0xf5e79c){return db['Dashboard'][_0x7f06('0x49')]({'where':{'id':_0x3ca636[_0x7f06('0x47')]['id']}})[_0x7f06('0x24')](handleEntityNotFound(_0xf5e79c,null))[_0x7f06('0x24')](removeEntity(_0xf5e79c,null))[_0x7f06('0x46')](handleError(_0xf5e79c,null));};function widgetAttributes(_0x47845f){try{switch(_0x47845f[_0x7f06('0x30')]){case'iframe':return[{'name':'attrUrl','value':_0x47845f[_0x7f06('0x58')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x0]?_0x47845f['attrs'][0x0][_0x7f06('0x5a')]:undefined)||_0x7f06('0x5b')}];case _0x7f06('0x5c'):return[{'name':'attrPath','value':_0x47845f[_0x7f06('0x5d')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x0]?_0x47845f[_0x7f06('0x59')][0x0][_0x7f06('0x5a')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x47845f[_0x7f06('0x5e')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x0]?_0x47845f['attrs'][0x0][_0x7f06('0x5a')]:undefined)||_0x7f06('0x5f')},{'name':_0x7f06('0x60'),'value':_0x47845f['attrTimezone']||(_0x47845f['attrs']&&_0x47845f['attrs'][0x1]?_0x47845f['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x7f06('0x61'),'value':_0x47845f[_0x7f06('0x61')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x2]?_0x47845f['attrs'][0x2][_0x7f06('0x5a')]:undefined)||0xc}];case _0x7f06('0x62'):return[{'name':'attrMetric','value':_0x47845f[_0x7f06('0x63')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x0]?_0x47845f[_0x7f06('0x59')][0x0][_0x7f06('0x5a')]:undefined)||_0x7f06('0x64')},{'name':_0x7f06('0x65'),'value':_0x47845f['attrVoiceQueues']||(_0x47845f[_0x7f06('0x59')]&&_0x47845f['attrs'][0x1]?_0x47845f['attrs'][0x1][_0x7f06('0x5a')]:undefined)||[]},{'name':'attrFontSize','value':_0x47845f['attrFontSize']||(_0x47845f['attrs']&&_0x47845f[_0x7f06('0x59')][0x2]?_0x47845f[_0x7f06('0x59')][0x2][_0x7f06('0x5a')]:undefined)||0x14}];case _0x7f06('0x66'):case _0x7f06('0x67'):return[{'name':_0x7f06('0x68'),'value':_0x47845f['attrSerie1']||(_0x47845f[_0x7f06('0x59')]&&_0x47845f['attrs'][0x0]?_0x47845f[_0x7f06('0x59')][0x0][_0x7f06('0x5a')]:undefined)||_0x7f06('0x64')},{'name':_0x7f06('0x69'),'value':_0x47845f[_0x7f06('0x69')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x1]?_0x47845f[_0x7f06('0x59')][0x1][_0x7f06('0x5a')]:undefined)||null},{'name':_0x7f06('0x6a'),'value':_0x47845f[_0x7f06('0x6a')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x2]?_0x47845f[_0x7f06('0x59')][0x2]['value']:undefined)||null},{'name':_0x7f06('0x65'),'value':_0x47845f[_0x7f06('0x65')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f['attrs'][0x3]?_0x47845f[_0x7f06('0x59')][0x3][_0x7f06('0x5a')]:undefined)||[]}];case'web-report':return[{'name':_0x7f06('0x6b'),'type':_0x47845f[_0x7f06('0x6c')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f['attrs'][0x0]?_0x47845f['attrs'][0x0][_0x7f06('0x30')]:undefined)||null,'value':_0x47845f['attrReport']||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x0]?_0x47845f[_0x7f06('0x59')][0x0][_0x7f06('0x5a')]:undefined)||null},{'name':_0x7f06('0x6d'),'value':_0x47845f[_0x7f06('0x6d')]||(_0x47845f[_0x7f06('0x59')]&&_0x47845f[_0x7f06('0x59')][0x1]?_0x47845f[_0x7f06('0x59')][0x1][_0x7f06('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0xa30e11){logger['error'](_0x7f06('0x6e'),JSON['stringify'](_0xa30e11));return[];}}exports[_0x7f06('0x6f')]=function(_0x49d530,_0x5d374d,_0x1b7b4e){if(_0x49d530['body']['id']){delete _0x49d530['body']['id'];}return db[_0x7f06('0x2d')][_0x7f06('0x49')]({'where':{'id':_0x49d530['params']['id']}})['then'](handleEntityNotFound(_0x5d374d,null))[_0x7f06('0x24')](function(_0x226a3c){if(_0x226a3c){_0x49d530['body'][_0x7f06('0x70')]=_0x226a3c['id'];_0x49d530[_0x7f06('0x4b')][_0x7f06('0x59')]=widgetAttributes(_0x49d530[_0x7f06('0x4b')]);return db[_0x7f06('0x71')]['create'](_0x49d530[_0x7f06('0x4b')]);}})[_0x7f06('0x24')](respondWithResult(_0x5d374d,null))[_0x7f06('0x46')](handleError(_0x5d374d,null));};exports[_0x7f06('0x72')]=function(_0x58e8c2,_0x3a5c30,_0x246c20){var _0x567a28={};var _0x3995c3={};var _0x4d02f4;var _0x3629d0;return db[_0x7f06('0x2d')][_0x7f06('0x73')]({'where':{'id':_0x58e8c2[_0x7f06('0x47')]['id']}})[_0x7f06('0x24')](handleEntityNotFound(_0x3a5c30,null))[_0x7f06('0x24')](function(_0x191add){if(_0x191add){_0x4d02f4=_0x191add;_0x3995c3[_0x7f06('0x35')]=_[_0x7f06('0x33')](db['DashboardItem']['rawAttributes']);_0x3995c3[_0x7f06('0x32')]=_[_0x7f06('0x33')](_0x58e8c2[_0x7f06('0x32')]);_0x3995c3[_0x7f06('0x34')]=_['intersection'](_0x3995c3[_0x7f06('0x35')],_0x3995c3['query']);_0x567a28['attributes']=_[_0x7f06('0x36')](_0x3995c3[_0x7f06('0x35')],qs[_0x7f06('0x37')](_0x58e8c2[_0x7f06('0x32')]['fields']));_0x567a28[_0x7f06('0x38')]=_0x567a28[_0x7f06('0x38')][_0x7f06('0x39')]?_0x567a28[_0x7f06('0x38')]:_0x3995c3[_0x7f06('0x35')];_0x567a28['order']=qs[_0x7f06('0x3e')](_0x58e8c2[_0x7f06('0x32')]['sort']);_0x567a28[_0x7f06('0x3f')]=qs[_0x7f06('0x34')](_[_0x7f06('0x74')](_0x58e8c2[_0x7f06('0x32')],_0x3995c3['filters']));if(_0x58e8c2[_0x7f06('0x32')][_0x7f06('0x40')]){_0x567a28['where']=_[_0x7f06('0x41')](_0x567a28[_0x7f06('0x3f')],{'$or':_[_0x7f06('0x42')](_0x567a28[_0x7f06('0x38')],function(_0x5a0745){var _0x4b7d5a={};_0x4b7d5a[_0x5a0745]={'$like':'%'+_0x58e8c2[_0x7f06('0x32')][_0x7f06('0x40')]+'%'};return _0x4b7d5a;})});}_0x567a28=_['merge']({},_0x567a28,_0x58e8c2[_0x7f06('0x43')]);return _0x4d02f4[_0x7f06('0x72')](_0x567a28);}})[_0x7f06('0x24')](function(_0x81765a){if(_0x81765a){_0x3629d0=_0x81765a[_0x7f06('0x39')];if(!_0x58e8c2['query'][_0x7f06('0x3a')](_0x7f06('0x75'))){_0x567a28[_0x7f06('0x3b')]=qs[_0x7f06('0x3b')](_0x58e8c2[_0x7f06('0x32')][_0x7f06('0x3b')]);_0x567a28[_0x7f06('0x3c')]=qs[_0x7f06('0x3c')](_0x58e8c2[_0x7f06('0x32')][_0x7f06('0x3c')]);}return _0x4d02f4['getItems'](_0x567a28);}})[_0x7f06('0x24')](function(_0x2edf91){if(_0x2edf91){return _0x2edf91?{'count':_0x3629d0,'rows':_0x2edf91}:null;}})[_0x7f06('0x24')](respondWithResult(_0x3a5c30,null))[_0x7f06('0x46')](handleError(_0x3a5c30,null));}; \ No newline at end of file +var _0xd7b0=['bluebird','util','path','sox','fs-extra','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/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','eml-format','request-promise','moment'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0xd7b0,0x74));var _0x0d7b=function(_0x2b5517,_0x6730df){_0x2b5517=_0x2b5517-0x0;var _0x10c7c6=_0xd7b0[_0x2b5517];return _0x10c7c6;};'use strict';var emlformat=require(_0x0d7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d7b('0x1'));var moment=require(_0x0d7b('0x2'));var BPromise=require(_0x0d7b('0x3'));var Mustache=require('mustache');var util=require(_0x0d7b('0x4'));var path=require(_0x0d7b('0x5'));var sox=require(_0x0d7b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d7b('0x7'));var _=require(_0x0d7b('0x8'));var squel=require(_0x0d7b('0x9'));var crypto=require(_0x0d7b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0d7b('0xb'));var toCsv=require(_0x0d7b('0xc'));var querystring=require(_0x0d7b('0xd'));var Papa=require(_0x0d7b('0xe'));var Redis=require(_0x0d7b('0xf'));var authService=require(_0x0d7b('0x10'));var qs=require(_0x0d7b('0x11'));var as=require(_0x0d7b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d7b('0x13'))(_0x0d7b('0x14'));var utils=require(_0x0d7b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0d7b('0x16'));var db=require(_0x0d7b('0x17'))['db'];config[_0x0d7b('0x18')]=_[_0x0d7b('0x19')](config['redis'],{'host':_0x0d7b('0x1a'),'port':0x18eb});var socket=require(_0x0d7b('0x1b'))(new Redis(config[_0x0d7b('0x18')]));require('./dashboard.socket')[_0x0d7b('0x1c')](socket);function respondWithStatusCode(_0x43d1f3,_0x505b1a){_0x505b1a=_0x505b1a||0xcc;return function(_0x45e172){if(_0x45e172){return _0x43d1f3[_0x0d7b('0x1d')](_0x505b1a);}return _0x43d1f3[_0x0d7b('0x1e')](_0x505b1a)[_0x0d7b('0x1f')]();};}function respondWithResult(_0x432522,_0x5d7838){_0x5d7838=_0x5d7838||0xc8;return function(_0x2d3cd6){if(_0x2d3cd6){return _0x432522[_0x0d7b('0x1e')](_0x5d7838)[_0x0d7b('0x20')](_0x2d3cd6);}};}function respondWithFilteredResult(_0x57e05e,_0x15b31b){return function(_0x5de94c){if(_0x5de94c){var _0x12ef19=typeof _0x15b31b[_0x0d7b('0x21')]==='undefined'&&typeof _0x15b31b[_0x0d7b('0x22')]==='undefined';var _0x25063c=_0x5de94c['count'];var _0x4900b5=_0x12ef19?0x0:_0x15b31b[_0x0d7b('0x21')];var _0x2e1302=_0x12ef19?_0x5de94c[_0x0d7b('0x23')]:_0x15b31b['offset']+_0x15b31b[_0x0d7b('0x22')];var _0x240a72;if(_0x2e1302>=_0x25063c){_0x2e1302=_0x25063c;_0x240a72=0xc8;}else{_0x240a72=0xce;}_0x57e05e[_0x0d7b('0x1e')](_0x240a72);return _0x57e05e[_0x0d7b('0x24')](_0x0d7b('0x25'),_0x4900b5+'-'+_0x2e1302+'/'+_0x25063c)['json'](_0x5de94c);}return null;};}function patchUpdates(_0x2896f4){return function(_0x3b6510){try{jsonpatch['apply'](_0x3b6510,_0x2896f4,!![]);}catch(_0x582f5f){return BPromise[_0x0d7b('0x26')](_0x582f5f);}return _0x3b6510[_0x0d7b('0x27')]();};}function saveUpdates(_0x2a8de0,_0x5a50e1){return function(_0x8e8126){if(_0x8e8126){return _0x8e8126['update'](_0x2a8de0)[_0x0d7b('0x28')](function(_0x305098){return _0x305098;});}return null;};}function removeEntity(_0x2f2c90,_0x9c7707){return function(_0x251a9b){if(_0x251a9b){return _0x251a9b[_0x0d7b('0x29')]()[_0x0d7b('0x28')](function(){var _0x4938c2=_0x251a9b[_0x0d7b('0x2a')]({'plain':!![]});var _0x445ac0=_0x0d7b('0x2b');return db[_0x0d7b('0x2c')]['destroy']({'where':{'type':_0x445ac0,'resourceId':_0x4938c2['id']}})['then'](function(){return _0x251a9b;});})['then'](function(){_0x2f2c90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b358d,_0x11eaa4){return function(_0x4bde58){if(!_0x4bde58){_0x7b358d[_0x0d7b('0x1d')](0x194);}return _0x4bde58;};}function handleError(_0x32fc07,_0x3bdc13){_0x3bdc13=_0x3bdc13||0x1f4;return function(_0x3a2fa3){logger[_0x0d7b('0x2d')](_0x3a2fa3[_0x0d7b('0x2e')]);if(_0x3a2fa3[_0x0d7b('0x2f')]){delete _0x3a2fa3[_0x0d7b('0x2f')];}_0x32fc07[_0x0d7b('0x1e')](_0x3bdc13)[_0x0d7b('0x30')](_0x3a2fa3);};}exports[_0x0d7b('0x31')]=function(_0x3d5f8d,_0x47eed9){var _0x172063={},_0x522ae1={},_0xc2e215={'count':0x0,'rows':[]};var _0x48ea9c=_[_0x0d7b('0x32')](db[_0x0d7b('0x33')][_0x0d7b('0x34')],function(_0x3cebd9){return{'name':_0x3cebd9[_0x0d7b('0x35')],'type':_0x3cebd9[_0x0d7b('0x36')][_0x0d7b('0x37')]};});_0x522ae1[_0x0d7b('0x38')]=_[_0x0d7b('0x32')](_0x48ea9c,'name');_0x522ae1[_0x0d7b('0x39')]=_[_0x0d7b('0x3a')](_0x3d5f8d['query']);_0x522ae1['filters']=_[_0x0d7b('0x3b')](_0x522ae1[_0x0d7b('0x38')],_0x522ae1['query']);_0x172063[_0x0d7b('0x3c')]=_['intersection'](_0x522ae1[_0x0d7b('0x38')],qs[_0x0d7b('0x3d')](_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x3d')]));_0x172063['attributes']=_0x172063[_0x0d7b('0x3c')]['length']?_0x172063['attributes']:_0x522ae1[_0x0d7b('0x38')];if(!_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x3e')](_0x0d7b('0x3f'))){_0x172063[_0x0d7b('0x22')]=qs[_0x0d7b('0x22')](_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x22')]);_0x172063[_0x0d7b('0x21')]=qs[_0x0d7b('0x21')](_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x21')]);}_0x172063[_0x0d7b('0x40')]=qs[_0x0d7b('0x41')](_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x41')]);_0x172063[_0x0d7b('0x42')]=qs[_0x0d7b('0x43')](_[_0x0d7b('0x44')](_0x3d5f8d['query'],_0x522ae1[_0x0d7b('0x43')]),_0x48ea9c);if(_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x45')]){_0x172063[_0x0d7b('0x42')]=_[_0x0d7b('0x46')](_0x172063['where'],{'$or':_['map'](_0x48ea9c,function(_0x2de4d5){if(_0x2de4d5['type']!==_0x0d7b('0x47')){var _0xd0dd96={};_0xd0dd96[_0x2de4d5['name']]={'$like':'%'+_0x3d5f8d['query'][_0x0d7b('0x45')]+'%'};return _0xd0dd96;}})});}_0x172063=_[_0x0d7b('0x46')]({},_0x172063,_0x3d5f8d[_0x0d7b('0x48')]);var _0x474583={'where':_0x172063[_0x0d7b('0x42')]};return db[_0x0d7b('0x33')][_0x0d7b('0x23')](_0x474583)[_0x0d7b('0x28')](function(_0x5a3afa){_0xc2e215[_0x0d7b('0x23')]=_0x5a3afa;if(_0x3d5f8d[_0x0d7b('0x39')][_0x0d7b('0x49')]){_0x172063[_0x0d7b('0x4a')]=[{'all':!![]}];}return db[_0x0d7b('0x33')]['findAll'](_0x172063);})[_0x0d7b('0x28')](function(_0x3cda72){_0xc2e215[_0x0d7b('0x4b')]=_0x3cda72;return _0xc2e215;})[_0x0d7b('0x28')](respondWithFilteredResult(_0x47eed9,_0x172063))[_0x0d7b('0x4c')](handleError(_0x47eed9,null));};exports['show']=function(_0x3ef9b8,_0x3758b4){var _0x15c108={'raw':![],'where':{'id':_0x3ef9b8[_0x0d7b('0x4d')]['id']}},_0x45db4a={};_0x45db4a[_0x0d7b('0x38')]=_[_0x0d7b('0x3a')](db[_0x0d7b('0x33')]['rawAttributes']);_0x45db4a[_0x0d7b('0x39')]=_['keys'](_0x3ef9b8[_0x0d7b('0x39')]);_0x45db4a[_0x0d7b('0x43')]=_['intersection'](_0x45db4a[_0x0d7b('0x38')],_0x45db4a[_0x0d7b('0x39')]);_0x15c108[_0x0d7b('0x3c')]=_['intersection'](_0x45db4a[_0x0d7b('0x38')],qs['fields'](_0x3ef9b8[_0x0d7b('0x39')][_0x0d7b('0x3d')]));_0x15c108[_0x0d7b('0x3c')]=_0x15c108[_0x0d7b('0x3c')][_0x0d7b('0x4e')]?_0x15c108[_0x0d7b('0x3c')]:_0x45db4a[_0x0d7b('0x38')];if(_0x3ef9b8[_0x0d7b('0x39')]['includeAll']){_0x15c108[_0x0d7b('0x4a')]=[{'all':!![]}];}_0x15c108=_[_0x0d7b('0x46')]({},_0x15c108,_0x3ef9b8[_0x0d7b('0x48')]);return db[_0x0d7b('0x33')][_0x0d7b('0x4f')](_0x15c108)[_0x0d7b('0x28')](handleEntityNotFound(_0x3758b4,null))[_0x0d7b('0x28')](respondWithResult(_0x3758b4,null))[_0x0d7b('0x4c')](handleError(_0x3758b4,null));};exports[_0x0d7b('0x50')]=function(_0x301568,_0x15f99b){return db['Dashboard'][_0x0d7b('0x50')](_0x301568[_0x0d7b('0x51')],{})[_0x0d7b('0x28')](function(_0x591c72){var _0x595671=_0x301568[_0x0d7b('0x52')]['get']({'plain':!![]});if(!_0x595671)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x595671[_0x0d7b('0x53')]===_0x0d7b('0x52')){var _0x1e61a8=_0x591c72[_0x0d7b('0x2a')]({'plain':!![]});var _0x380082=_0x0d7b('0x2b');return db['UserProfileSection'][_0x0d7b('0x4f')]({'where':{'name':_0x380082,'userProfileId':_0x595671[_0x0d7b('0x54')]},'raw':!![]})[_0x0d7b('0x28')](function(_0x1bff8e){if(_0x1bff8e&&_0x1bff8e[_0x0d7b('0x55')]===0x0){return db[_0x0d7b('0x2c')][_0x0d7b('0x50')]({'name':_0x1e61a8[_0x0d7b('0x2f')],'resourceId':_0x1e61a8['id'],'type':_0x1bff8e[_0x0d7b('0x2f')],'sectionId':_0x1bff8e['id']},{})[_0x0d7b('0x28')](function(){return _0x591c72;});}else{return _0x591c72;}})[_0x0d7b('0x4c')](function(_0x24e18e){logger[_0x0d7b('0x2d')](_0x0d7b('0x56'),_0x24e18e);throw _0x24e18e;});}return _0x591c72;})[_0x0d7b('0x28')](respondWithResult(_0x15f99b,0xc9))[_0x0d7b('0x4c')](handleError(_0x15f99b,null));};exports[_0x0d7b('0x57')]=function(_0x15085f,_0x1a0a74){var _0x4d729b={'where':{'id':_0x15085f[_0x0d7b('0x4d')]['id']}},_0x4d1185={};_0x4d1185['model']=_[_0x0d7b('0x3a')](db[_0x0d7b('0x33')]['rawAttributes']);_0x4d729b[_0x0d7b('0x3c')]=_[_0x0d7b('0x3b')](_0x4d1185[_0x0d7b('0x38')],qs[_0x0d7b('0x3d')](_0x15085f[_0x0d7b('0x39')][_0x0d7b('0x3d')]));_0x4d729b[_0x0d7b('0x3c')]=_0x4d729b['attributes'][_0x0d7b('0x4e')]?_0x4d729b['attributes']:_0x4d1185[_0x0d7b('0x38')];if(_0x15085f[_0x0d7b('0x39')]['includeAll']){_0x4d729b[_0x0d7b('0x4a')]=[{'all':!![]}];}_0x4d729b=_['merge']({},_0x4d729b,_0x15085f[_0x0d7b('0x48')]);return db[_0x0d7b('0x33')][_0x0d7b('0x4f')](_0x4d729b)[_0x0d7b('0x28')](handleEntityNotFound(_0x1a0a74,null))[_0x0d7b('0x28')](function(_0x22bc97){if(_0x22bc97){var _0x2c767c=_0x22bc97[_0x0d7b('0x2a')]({'plain':!![]});_0x2c767c=qs[_0x0d7b('0x58')](_0x2c767c,['id',_0x0d7b('0x59'),_0x0d7b('0x5a')]);_0x15085f[_0x0d7b('0x51')]=_[_0x0d7b('0x58')](_0x15085f[_0x0d7b('0x51')],['id',_0x0d7b('0x59'),_0x0d7b('0x5a')]);return db[_0x0d7b('0x33')][_0x0d7b('0x50')](_[_0x0d7b('0x46')](_0x2c767c,_0x15085f[_0x0d7b('0x51')]),{'include':_0x15085f['query'][_0x0d7b('0x49')]?[{'all':!![]}]:undefined})[_0x0d7b('0x28')](function(_0x145535){var _0x2055d5=_0x15085f[_0x0d7b('0x52')][_0x0d7b('0x2a')]({'plain':!![]});if(!_0x2055d5)throw new Error(_0x0d7b('0x5b'));if(_0x2055d5[_0x0d7b('0x53')]==='user'){var _0x3e5623=_0x145535['get']({'plain':!![]});var _0x4e251d=_0x0d7b('0x2b');return db['UserProfileSection'][_0x0d7b('0x4f')]({'where':{'name':_0x4e251d,'userProfileId':_0x2055d5[_0x0d7b('0x54')]},'raw':!![]})[_0x0d7b('0x28')](function(_0x2067b0){if(_0x2067b0&&_0x2067b0[_0x0d7b('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x3e5623[_0x0d7b('0x2f')],'resourceId':_0x3e5623['id'],'type':_0x2067b0['name'],'sectionId':_0x2067b0['id']},{})[_0x0d7b('0x28')](function(){return _0x145535;});}else{return _0x145535;}})[_0x0d7b('0x4c')](function(_0x12ba16){logger[_0x0d7b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12ba16);throw _0x12ba16;});}return _0x145535;});}})[_0x0d7b('0x28')](respondWithResult(_0x1a0a74,0xc9))[_0x0d7b('0x4c')](handleError(_0x1a0a74,null));};exports['update']=function(_0x22553b,_0x816894){if(_0x22553b[_0x0d7b('0x51')]['id']){delete _0x22553b['body']['id'];}return db[_0x0d7b('0x33')][_0x0d7b('0x4f')]({'where':{'id':_0x22553b[_0x0d7b('0x4d')]['id']}})[_0x0d7b('0x28')](handleEntityNotFound(_0x816894,null))['then'](saveUpdates(_0x22553b['body'],null))[_0x0d7b('0x28')](respondWithResult(_0x816894,null))[_0x0d7b('0x4c')](handleError(_0x816894,null));};exports[_0x0d7b('0x29')]=function(_0x19c35d,_0x58b9dc){return db[_0x0d7b('0x33')]['find']({'where':{'id':_0x19c35d[_0x0d7b('0x4d')]['id']}})[_0x0d7b('0x28')](handleEntityNotFound(_0x58b9dc,null))['then'](removeEntity(_0x58b9dc,null))[_0x0d7b('0x4c')](handleError(_0x58b9dc,null));};function widgetAttributes(_0x14eb0d){try{switch(_0x14eb0d[_0x0d7b('0x36')]){case _0x0d7b('0x5c'):return[{'name':'attrUrl','value':_0x14eb0d[_0x0d7b('0x5d')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x0]?_0x14eb0d['attrs'][0x0][_0x0d7b('0x5f')]:undefined)||'https://'}];case _0x0d7b('0x60'):return[{'name':_0x0d7b('0x61'),'value':_0x14eb0d[_0x0d7b('0x61')]||(_0x14eb0d['attrs']&&_0x14eb0d[_0x0d7b('0x5e')][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0][_0x0d7b('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x0d7b('0x62'),'value':_0x14eb0d[_0x0d7b('0x62')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d['attrs'][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0][_0x0d7b('0x5f')]:undefined)||'HH:mm:ss'},{'name':_0x0d7b('0x63'),'value':_0x14eb0d[_0x0d7b('0x63')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x1]?_0x14eb0d['attrs'][0x1][_0x0d7b('0x5f')]:undefined)||_0x0d7b('0x64')},{'name':_0x0d7b('0x65'),'value':_0x14eb0d['attrFontSize']||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x2]?_0x14eb0d['attrs'][0x2][_0x0d7b('0x5f')]:undefined)||0xc}];case _0x0d7b('0x66'):return[{'name':_0x0d7b('0x67'),'value':_0x14eb0d[_0x0d7b('0x67')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0][_0x0d7b('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x14eb0d['attrVoiceQueues']||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x1]?_0x14eb0d['attrs'][0x1][_0x0d7b('0x5f')]:undefined)||[]},{'name':_0x0d7b('0x65'),'value':_0x14eb0d[_0x0d7b('0x65')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x2]?_0x14eb0d[_0x0d7b('0x5e')][0x2]['value']:undefined)||0x14}];case _0x0d7b('0x68'):case'pie-chart':return[{'name':_0x0d7b('0x69'),'value':_0x14eb0d[_0x0d7b('0x69')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0]['value']:undefined)||_0x0d7b('0x6a')},{'name':_0x0d7b('0x6b'),'value':_0x14eb0d[_0x0d7b('0x6b')]||(_0x14eb0d['attrs']&&_0x14eb0d[_0x0d7b('0x5e')][0x1]?_0x14eb0d['attrs'][0x1]['value']:undefined)||null},{'name':_0x0d7b('0x6c'),'value':_0x14eb0d[_0x0d7b('0x6c')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d[_0x0d7b('0x5e')][0x2]?_0x14eb0d['attrs'][0x2][_0x0d7b('0x5f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x14eb0d[_0x0d7b('0x6d')]||(_0x14eb0d['attrs']&&_0x14eb0d[_0x0d7b('0x5e')][0x3]?_0x14eb0d[_0x0d7b('0x5e')][0x3][_0x0d7b('0x5f')]:undefined)||[]}];case _0x0d7b('0x6e'):return[{'name':_0x0d7b('0x6f'),'type':_0x14eb0d[_0x0d7b('0x70')]||(_0x14eb0d[_0x0d7b('0x5e')]&&_0x14eb0d['attrs'][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0]['type']:undefined)||null,'value':_0x14eb0d[_0x0d7b('0x6f')]||(_0x14eb0d['attrs']&&_0x14eb0d['attrs'][0x0]?_0x14eb0d[_0x0d7b('0x5e')][0x0][_0x0d7b('0x5f')]:undefined)||null},{'name':_0x0d7b('0x71'),'value':_0x14eb0d[_0x0d7b('0x71')]||(_0x14eb0d['attrs']&&_0x14eb0d[_0x0d7b('0x5e')][0x1]?_0x14eb0d[_0x0d7b('0x5e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x187e57){logger[_0x0d7b('0x2d')](_0x0d7b('0x72'),JSON[_0x0d7b('0x73')](_0x187e57));return[];}}exports[_0x0d7b('0x74')]=function(_0xe4d4d3,_0x49264d,_0x1e09fa){if(_0xe4d4d3['body']['id']){delete _0xe4d4d3[_0x0d7b('0x51')]['id'];}return db[_0x0d7b('0x33')][_0x0d7b('0x4f')]({'where':{'id':_0xe4d4d3['params']['id']}})[_0x0d7b('0x28')](handleEntityNotFound(_0x49264d,null))[_0x0d7b('0x28')](function(_0x103f23){if(_0x103f23){_0xe4d4d3[_0x0d7b('0x51')]['DashboardId']=_0x103f23['id'];_0xe4d4d3[_0x0d7b('0x51')][_0x0d7b('0x5e')]=widgetAttributes(_0xe4d4d3[_0x0d7b('0x51')]);return db[_0x0d7b('0x75')][_0x0d7b('0x50')](_0xe4d4d3[_0x0d7b('0x51')]);}})[_0x0d7b('0x28')](respondWithResult(_0x49264d,null))[_0x0d7b('0x4c')](handleError(_0x49264d,null));};exports[_0x0d7b('0x76')]=function(_0xea47c0,_0x15041b,_0x5e5616){var _0x3a73e6={};var _0x1dd420={};var _0x12c6d7;var _0x5a07e9;return db[_0x0d7b('0x33')]['findOne']({'where':{'id':_0xea47c0['params']['id']}})[_0x0d7b('0x28')](handleEntityNotFound(_0x15041b,null))['then'](function(_0x3c61a3){if(_0x3c61a3){_0x12c6d7=_0x3c61a3;_0x1dd420[_0x0d7b('0x38')]=_[_0x0d7b('0x3a')](db[_0x0d7b('0x75')][_0x0d7b('0x34')]);_0x1dd420['query']=_[_0x0d7b('0x3a')](_0xea47c0[_0x0d7b('0x39')]);_0x1dd420[_0x0d7b('0x43')]=_[_0x0d7b('0x3b')](_0x1dd420[_0x0d7b('0x38')],_0x1dd420[_0x0d7b('0x39')]);_0x3a73e6['attributes']=_[_0x0d7b('0x3b')](_0x1dd420[_0x0d7b('0x38')],qs[_0x0d7b('0x3d')](_0xea47c0[_0x0d7b('0x39')][_0x0d7b('0x3d')]));_0x3a73e6['attributes']=_0x3a73e6['attributes'][_0x0d7b('0x4e')]?_0x3a73e6['attributes']:_0x1dd420[_0x0d7b('0x38')];_0x3a73e6[_0x0d7b('0x40')]=qs['sort'](_0xea47c0['query'][_0x0d7b('0x41')]);_0x3a73e6[_0x0d7b('0x42')]=qs[_0x0d7b('0x43')](_[_0x0d7b('0x44')](_0xea47c0[_0x0d7b('0x39')],_0x1dd420[_0x0d7b('0x43')]));if(_0xea47c0[_0x0d7b('0x39')][_0x0d7b('0x45')]){_0x3a73e6[_0x0d7b('0x42')]=_[_0x0d7b('0x46')](_0x3a73e6['where'],{'$or':_[_0x0d7b('0x32')](_0x3a73e6['attributes'],function(_0x2a76e4){var _0x3612b2={};_0x3612b2[_0x2a76e4]={'$like':'%'+_0xea47c0[_0x0d7b('0x39')][_0x0d7b('0x45')]+'%'};return _0x3612b2;})});}_0x3a73e6=_['merge']({},_0x3a73e6,_0xea47c0[_0x0d7b('0x48')]);return _0x12c6d7[_0x0d7b('0x76')](_0x3a73e6);}})['then'](function(_0x179f6a){if(_0x179f6a){_0x5a07e9=_0x179f6a[_0x0d7b('0x4e')];if(!_0xea47c0['query']['hasOwnProperty'](_0x0d7b('0x3f'))){_0x3a73e6[_0x0d7b('0x22')]=qs[_0x0d7b('0x22')](_0xea47c0[_0x0d7b('0x39')][_0x0d7b('0x22')]);_0x3a73e6['offset']=qs['offset'](_0xea47c0[_0x0d7b('0x39')][_0x0d7b('0x21')]);}return _0x12c6d7[_0x0d7b('0x76')](_0x3a73e6);}})[_0x0d7b('0x28')](function(_0x28ff38){if(_0x28ff38){return _0x28ff38?{'count':_0x5a07e9,'rows':_0x28ff38}:null;}})['then'](respondWithResult(_0x15041b,null))['catch'](handleError(_0x15041b,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 605f043..6d88801 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 _0xc17f=['../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x3ec751,_0x3009cd){var _0x252150=function(_0x5091e8){while(--_0x5091e8){_0x3ec751['push'](_0x3ec751['shift']());}};_0x252150(++_0x3009cd);}(_0xc17f,0x155));var _0xfc17=function(_0x2ccfc4,_0x521080){_0x2ccfc4=_0x2ccfc4-0x0;var _0x3e573a=_0xc17f[_0x2ccfc4];return _0x3e573a;};'use strict';var EventEmitter=require(_0xfc17('0x0'));var Dashboard=require(_0xfc17('0x1'))['db'][_0xfc17('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xfc17('0x3')](0x0);var events={'afterCreate':_0xfc17('0x4'),'afterUpdate':_0xfc17('0x5'),'afterDestroy':_0xfc17('0x6')};function emitEvent(_0xb7c91f){return function(_0x26f01b,_0x396295,_0x12e715){DashboardEvents[_0xfc17('0x7')](_0xb7c91f+':'+_0x26f01b['id'],_0x26f01b);DashboardEvents['emit'](_0xb7c91f,_0x26f01b);_0x12e715(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xfc17('0x8')]=DashboardEvents; \ No newline at end of file +var _0x4f67=['emit','exports','events','../../mysqldb'];(function(_0x341f5d,_0x52485e){var _0x468f53=function(_0x3e344f){while(--_0x3e344f){_0x341f5d['push'](_0x341f5d['shift']());}};_0x468f53(++_0x52485e);}(_0x4f67,0xba));var _0x74f6=function(_0x1d8a5d,_0x59a110){_0x1d8a5d=_0x1d8a5d-0x0;var _0x54d59f=_0x4f67[_0x1d8a5d];return _0x54d59f;};'use strict';var EventEmitter=require(_0x74f6('0x0'));var Dashboard=require(_0x74f6('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x351ba9){return function(_0x2c0657,_0x34e675,_0x1df91f){DashboardEvents[_0x74f6('0x2')](_0x351ba9+':'+_0x2c0657['id'],_0x2c0657);DashboardEvents[_0x74f6('0x2')](_0x351ba9,_0x2c0657);_0x1df91f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x74f6('0x3')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index e30b5ec..05a10e0 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 _0x54ad=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','dashboards','util','api','moment'];(function(_0x3b99ac,_0x20e9e3){var _0x466743=function(_0x33ccde){while(--_0x33ccde){_0x3b99ac['push'](_0x3b99ac['shift']());}};_0x466743(++_0x20e9e3);}(_0x54ad,0x165));var _0xd54a=function(_0x10edc5,_0x3a7acd){_0x10edc5=_0x10edc5-0x0;var _0x6fe7c1=_0x54ad[_0x10edc5];return _0x6fe7c1;};'use strict';var _=require('lodash');var util=require(_0xd54a('0x0'));var logger=require('../../config/logger')(_0xd54a('0x1'));var moment=require(_0xd54a('0x2'));var BPromise=require('bluebird');var rp=require(_0xd54a('0x3'));var fs=require('fs');var path=require(_0xd54a('0x4'));var rimraf=require('rimraf');var config=require(_0xd54a('0x5'));var attributes=require(_0xd54a('0x6'));module[_0xd54a('0x7')]=function(_0x207d7f,_0x25bfe7){return _0x207d7f[_0xd54a('0x8')]('Dashboard',attributes,{'tableName':_0xd54a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb55=['rimraf','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1fb5d9,_0x548653){var _0xf242b9=function(_0x44b6e3){while(--_0x44b6e3){_0x1fb5d9['push'](_0x1fb5d9['shift']());}};_0xf242b9(++_0x548653);}(_0xeb55,0x1e5));var _0x5eb5=function(_0x31fb5a,_0x454d79){_0x31fb5a=_0x31fb5a-0x0;var _0x19b51d=_0xeb55[_0x31fb5a];return _0x19b51d;};'use strict';var _=require(_0x5eb5('0x0'));var util=require(_0x5eb5('0x1'));var logger=require(_0x5eb5('0x2'))(_0x5eb5('0x3'));var moment=require(_0x5eb5('0x4'));var BPromise=require(_0x5eb5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eb5('0x6'));var rimraf=require(_0x5eb5('0x7'));var config=require('../../config/environment');var attributes=require(_0x5eb5('0x8'));module['exports']=function(_0xd2a1d3,_0x215d78){return _0xd2a1d3[_0x5eb5('0x9')](_0x5eb5('0xa'),attributes,{'tableName':_0x5eb5('0xb'),'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 8354cc2..49d80f3 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 _0x8ea8=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x565ac2,_0x27d146){var _0x4d3a89=function(_0x4fc35a){while(--_0x4fc35a){_0x565ac2['push'](_0x565ac2['shift']());}};_0x4d3a89(++_0x27d146);}(_0x8ea8,0xca));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x88ea('0x0'));var moment=require('moment');var BPromise=require(_0x88ea('0x1'));var rs=require(_0x88ea('0x2'));var fs=require('fs');var Redis=require(_0x88ea('0x3'));var db=require(_0x88ea('0x4'))['db'];var utils=require(_0x88ea('0x5'));var logger=require('../../config/logger')(_0x88ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88ea('0x7')][_0x88ea('0x8')]({'port':0x232a});config[_0x88ea('0x9')]=_[_0x88ea('0xa')](config['redis'],{'host':_0x88ea('0xb'),'port':0x18eb});var socket=require(_0x88ea('0xc'))(new Redis(config[_0x88ea('0x9')]));require(_0x88ea('0xd'))[_0x88ea('0xe')](socket);function respondWithRpcPromise(_0x494b33,_0x1cdab9,_0x515aa0){return new BPromise(function(_0x1a3865,_0x512459){return client[_0x88ea('0xf')](_0x494b33,_0x515aa0)[_0x88ea('0x10')](function(_0x13918e){logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));logger[_0x88ea('0x14')](_0x88ea('0x15'),_0x1cdab9,_0x88ea('0x13'),JSON[_0x88ea('0x16')](_0x13918e));if(_0x13918e[_0x88ea('0x17')]){if(_0x13918e[_0x88ea('0x17')][_0x88ea('0x18')]===0x1f4){logger['error'](_0x88ea('0x12'),_0x1cdab9,_0x13918e['error'][_0x88ea('0x19')]);return _0x512459(_0x13918e['error'][_0x88ea('0x19')]);}logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x13918e[_0x88ea('0x17')][_0x88ea('0x19')]);return _0x1a3865(_0x13918e['error'][_0x88ea('0x19')]);}else{logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));_0x1a3865(_0x13918e[_0x88ea('0x1a')][_0x88ea('0x19')]);}})['catch'](function(_0x39f3b7){logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x39f3b7);_0x512459(_0x39f3b7);});});} \ No newline at end of file +var _0x4ac6=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x111aac,_0x2ad702){var _0x428323=function(_0x3d864b){while(--_0x3d864b){_0x111aac['push'](_0x111aac['shift']());}};_0x428323(++_0x2ad702);}(_0x4ac6,0xe4));var _0x64ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ac6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x64ac('0x0'));var util=require(_0x64ac('0x1'));var moment=require(_0x64ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x64ac('0x3'));var fs=require('fs');var Redis=require(_0x64ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x64ac('0x5'));var logger=require(_0x64ac('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x64ac('0x7'));var client=jayson[_0x64ac('0x8')][_0x64ac('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x64ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x64ac('0xb'))[_0x64ac('0xc')](socket);function respondWithRpcPromise(_0x377bf9,_0x16221b,_0x4c4963){return new BPromise(function(_0xfab127,_0x5d8c3e){return client[_0x64ac('0xd')](_0x377bf9,_0x4c4963)['then'](function(_0x40cf6d){logger[_0x64ac('0xe')](_0x64ac('0xf'),_0x16221b,_0x64ac('0x10'));logger[_0x64ac('0x11')](_0x64ac('0x12'),_0x16221b,_0x64ac('0x10'),JSON[_0x64ac('0x13')](_0x40cf6d));if(_0x40cf6d[_0x64ac('0x14')]){if(_0x40cf6d['error'][_0x64ac('0x15')]===0x1f4){logger['error'](_0x64ac('0xf'),_0x16221b,_0x40cf6d['error'][_0x64ac('0x16')]);return _0x5d8c3e(_0x40cf6d[_0x64ac('0x14')][_0x64ac('0x16')]);}logger[_0x64ac('0x14')]('Dashboard,\x20%s,\x20%s',_0x16221b,_0x40cf6d[_0x64ac('0x14')][_0x64ac('0x16')]);return _0xfab127(_0x40cf6d[_0x64ac('0x14')][_0x64ac('0x16')]);}else{logger[_0x64ac('0xe')]('Dashboard,\x20%s,\x20%s',_0x16221b,'request\x20sent');_0xfab127(_0x40cf6d[_0x64ac('0x17')]['message']);}})[_0x64ac('0x18')](function(_0x317f53){logger[_0x64ac('0x14')]('Dashboard,\x20%s,\x20%s',_0x16221b,_0x317f53);_0x5d8c3e(_0x317f53);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5440520..201c3b1 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 _0x8220=['remove','update','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x8220,0xde));var _0x0822=function(_0x4d69a6,_0x44cbe8){_0x4d69a6=_0x4d69a6-0x0;var _0x56739a=_0x8220[_0x4d69a6];return _0x56739a;};'use strict';var DashboardEvents=require(_0x0822('0x0'));var events=[_0x0822('0x1'),_0x0822('0x2'),_0x0822('0x3')];function createListener(_0x27a576,_0x226603){return function(_0x370684){_0x226603['emit'](_0x27a576,_0x370684);};}function removeListener(_0x508608,_0x961c78){return function(){DashboardEvents[_0x0822('0x4')](_0x508608,_0x961c78);};}exports[_0x0822('0x5')]=function(_0xab763b){for(var _0x9a27fb=0x0,_0x3c0fa1=events[_0x0822('0x6')];_0x9a27fb<_0x3c0fa1;_0x9a27fb++){var _0x22c906=events[_0x9a27fb];var _0x5482e7=createListener(_0x0822('0x7')+_0x22c906,_0xab763b);DashboardEvents['on'](_0x22c906,_0x5482e7);}}; \ No newline at end of file +var _0xb3bb=['register','length','dashboard:','./dashboard.events','remove','update','emit','removeListener'];(function(_0x2706dc,_0x1d54d6){var _0x1de4cb=function(_0xed03a5){while(--_0xed03a5){_0x2706dc['push'](_0x2706dc['shift']());}};_0x1de4cb(++_0x1d54d6);}(_0xb3bb,0x1db));var _0xbb3b=function(_0x4dea15,_0x54f075){_0x4dea15=_0x4dea15-0x0;var _0x5ca05a=_0xb3bb[_0x4dea15];return _0x5ca05a;};'use strict';var DashboardEvents=require(_0xbb3b('0x0'));var events=['save',_0xbb3b('0x1'),_0xbb3b('0x2')];function createListener(_0x1ba095,_0xae82){return function(_0x9c457){_0xae82[_0xbb3b('0x3')](_0x1ba095,_0x9c457);};}function removeListener(_0x508dae,_0x1b14bf){return function(){DashboardEvents[_0xbb3b('0x4')](_0x508dae,_0x1b14bf);};}exports[_0xbb3b('0x5')]=function(_0x559d92){for(var _0x3ca1f1=0x0,_0x42cceb=events[_0xbb3b('0x6')];_0x3ca1f1<_0x42cceb;_0x3ca1f1++){var _0x469991=events[_0x3ca1f1];var _0x113b3c=createListener(_0xbb3b('0x7')+_0x469991,_0x559d92);DashboardEvents['on'](_0x469991,_0x113b3c);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 3d2d0a3..cd1f7ea 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 _0x3e09=['clone','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/items','getItems','/:id/clone'];(function(_0x543cbd,_0x1ea2ae){var _0x138d4e=function(_0x38dcac){while(--_0x38dcac){_0x543cbd['push'](_0x543cbd['shift']());}};_0x138d4e(++_0x1ea2ae);}(_0x3e09,0x70));var _0x93e0=function(_0x5d92d2,_0x399d73){_0x5d92d2=_0x5d92d2-0x0;var _0x5e6d11=_0x3e09[_0x5d92d2];return _0x5e6d11;};'use strict';var multer=require(_0x93e0('0x0'));var util=require(_0x93e0('0x1'));var path=require(_0x93e0('0x2'));var timeout=require(_0x93e0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x93e0('0x4'));var auth=require(_0x93e0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x93e0('0x6')]('/',auth[_0x93e0('0x7')](),controller[_0x93e0('0x8')]);router['get'](_0x93e0('0x9'),auth[_0x93e0('0x7')](),controller[_0x93e0('0xa')]);router[_0x93e0('0x6')](_0x93e0('0xb'),auth[_0x93e0('0x7')](),controller[_0x93e0('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x93e0('0xd'),auth[_0x93e0('0x7')](),controller[_0x93e0('0xe')]);router[_0x93e0('0xf')](_0x93e0('0xb'),auth[_0x93e0('0x7')](),controller['addItem']);router[_0x93e0('0x10')](_0x93e0('0x9'),auth[_0x93e0('0x7')](),controller[_0x93e0('0x11')]);router[_0x93e0('0x12')](_0x93e0('0x9'),auth[_0x93e0('0x7')](),controller[_0x93e0('0x13')]);module[_0x93e0('0x14')]=router; \ No newline at end of file +var _0xae3e=['put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','getItems','post','create','/:id/clone','clone','addItem'];(function(_0x354d4e,_0x33789c){var _0x77cc58=function(_0x5ccdfa){while(--_0x5ccdfa){_0x354d4e['push'](_0x354d4e['shift']());}};_0x77cc58(++_0x33789c);}(_0xae3e,0x10b));var _0xeae3=function(_0x30d4c3,_0x35136d){_0x30d4c3=_0x30d4c3-0x0;var _0x7c7dad=_0xae3e[_0x30d4c3];return _0x7c7dad;};'use strict';var multer=require('multer');var util=require(_0xeae3('0x0'));var path=require(_0xeae3('0x1'));var timeout=require(_0xeae3('0x2'));var express=require(_0xeae3('0x3'));var router=express[_0xeae3('0x4')]();var fs_extra=require(_0xeae3('0x5'));var auth=require(_0xeae3('0x6'));var interaction=require(_0xeae3('0x7'));var config=require(_0xeae3('0x8'));var controller=require(_0xeae3('0x9'));router[_0xeae3('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeae3('0xa')](_0xeae3('0xb'),auth[_0xeae3('0xc')](),controller['show']);router[_0xeae3('0xa')]('/:id/items',auth[_0xeae3('0xc')](),controller[_0xeae3('0xd')]);router[_0xeae3('0xe')]('/',auth[_0xeae3('0xc')](),controller[_0xeae3('0xf')]);router[_0xeae3('0xe')](_0xeae3('0x10'),auth[_0xeae3('0xc')](),controller[_0xeae3('0x11')]);router['post']('/:id/items',auth[_0xeae3('0xc')](),controller[_0xeae3('0x12')]);router[_0xeae3('0x13')](_0xeae3('0xb'),auth[_0xeae3('0xc')](),controller[_0xeae3('0x14')]);router['delete'](_0xeae3('0xb'),auth[_0xeae3('0xc')](),controller['destroy']);module[_0xeae3('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 a3ac983..e807b73 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 _0x33af=['attrs','setDataValue','stringify','INTEGER','#ffffff','squel','exports','STRING','TEXT','long','parse'];(function(_0x5b2e3d,_0x576986){var _0x58cb23=function(_0x302a8a){while(--_0x302a8a){_0x5b2e3d['push'](_0x5b2e3d['shift']());}};_0x58cb23(++_0x576986);}(_0x33af,0xec));var _0xf33a=function(_0x5d8afd,_0xd7f769){_0x5d8afd=_0x5d8afd-0x0;var _0x336c61=_0x33af[_0x5d8afd];return _0x336c61;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xf33a('0x0'));var _=require('lodash');module[_0xf33a('0x1')]={'title':{'type':Sequelize[_0xf33a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf33a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf33a('0x3')](_0xf33a('0x4')),'get':function(){try{return JSON[_0xf33a('0x5')](this['getDataValue'](_0xf33a('0x6')));}catch(_0x44cfa5){return[];}},'set':function(_0x583e54){try{this[_0xf33a('0x7')](_0xf33a('0x6'),JSON[_0xf33a('0x8')](_0x583e54));}catch(_0x2f3730){this[_0xf33a('0x7')](_0xf33a('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xf33a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf33a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf33a('0x9')]},'col':{'type':Sequelize[_0xf33a('0x9')]},'background':{'type':Sequelize[_0xf33a('0x2')],'allowNull':![],'defaultValue':_0xf33a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xf33a('0x2')]},'titleFontSize':{'type':Sequelize[_0xf33a('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xfdbd=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#ffffff'];(function(_0x57643b,_0x1706fe){var _0x53a35b=function(_0x2625e8){while(--_0x2625e8){_0x57643b['push'](_0x57643b['shift']());}};_0x53a35b(++_0x1706fe);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0xfdbd[_0x3c66e5];return _0x678a;};'use strict';var Sequelize=require(_0xdfdb('0x0'));var squel=require(_0xdfdb('0x1'));var _=require(_0xdfdb('0x2'));module[_0xdfdb('0x3')]={'title':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xdfdb('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xdfdb('0x5')](_0xdfdb('0x6')),'get':function(){try{return JSON[_0xdfdb('0x7')](this['getDataValue'](_0xdfdb('0x8')));}catch(_0x4a4a3f){return[];}},'set':function(_0x453ef6){try{this[_0xdfdb('0x9')]('attrs',JSON['stringify'](_0x453ef6));}catch(_0x590b5d){this[_0xdfdb('0x9')](_0xdfdb('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xdfdb('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xdfdb('0xa')]},'col':{'type':Sequelize[_0xdfdb('0xa')]},'background':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':_0xdfdb('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xdfdb('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xdfdb('0x4')]},'titleFontSize':{'type':Sequelize[_0xdfdb('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 540b3ee..1425099 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 _0xac12=['undefined','limit','count','set','reject','save','then','destroy','end','error','stack','name','show','params','model','keys','DashboardItem','query','filters','attributes','fields','includeAll','include','merge','options','find','catch','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0xac12,0x1e7));var _0x2ac1=function(_0x29f10d,_0x2688a9){_0x29f10d=_0x29f10d-0x0;var _0x1563aa=_0xac12[_0x29f10d];return _0x1563aa;};'use strict';var emlformat=require(_0x2ac1('0x0'));var rimraf=require(_0x2ac1('0x1'));var zipdir=require(_0x2ac1('0x2'));var jsonpatch=require(_0x2ac1('0x3'));var rp=require(_0x2ac1('0x4'));var moment=require(_0x2ac1('0x5'));var BPromise=require(_0x2ac1('0x6'));var Mustache=require(_0x2ac1('0x7'));var util=require(_0x2ac1('0x8'));var path=require(_0x2ac1('0x9'));var sox=require(_0x2ac1('0xa'));var csv=require(_0x2ac1('0xb'));var ejs=require(_0x2ac1('0xc'));var fs=require('fs');var fs_extra=require(_0x2ac1('0xd'));var _=require(_0x2ac1('0xe'));var squel=require(_0x2ac1('0xf'));var crypto=require(_0x2ac1('0x10'));var jsforce=require(_0x2ac1('0x11'));var deskjs=require(_0x2ac1('0x12'));var toCsv=require(_0x2ac1('0xb'));var querystring=require('querystring');var Papa=require(_0x2ac1('0x13'));var Redis=require(_0x2ac1('0x14'));var authService=require(_0x2ac1('0x15'));var qs=require(_0x2ac1('0x16'));var as=require(_0x2ac1('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ac1('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ac1('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2ac1('0x1a')],{'host':_0x2ac1('0x1b'),'port':0x18eb});var socket=require(_0x2ac1('0x1c'))(new Redis(config[_0x2ac1('0x1a')]));require(_0x2ac1('0x1d'))[_0x2ac1('0x1e')](socket);function respondWithStatusCode(_0x1b864f,_0xfd4b68){_0xfd4b68=_0xfd4b68||0xcc;return function(_0x170eef){if(_0x170eef){return _0x1b864f[_0x2ac1('0x1f')](_0xfd4b68);}return _0x1b864f[_0x2ac1('0x20')](_0xfd4b68)['end']();};}function respondWithResult(_0x1d6c25,_0x908fd6){_0x908fd6=_0x908fd6||0xc8;return function(_0x385690){if(_0x385690){return _0x1d6c25[_0x2ac1('0x20')](_0x908fd6)[_0x2ac1('0x21')](_0x385690);}};}function respondWithFilteredResult(_0x28e3da,_0x175b4d){return function(_0x2a4ea8){if(_0x2a4ea8){var _0x3db860=typeof _0x175b4d[_0x2ac1('0x22')]===_0x2ac1('0x23')&&typeof _0x175b4d[_0x2ac1('0x24')]==='undefined';var _0x32a27e=_0x2a4ea8[_0x2ac1('0x25')];var _0x453f8a=_0x3db860?0x0:_0x175b4d['offset'];var _0x1b7301=_0x3db860?_0x2a4ea8[_0x2ac1('0x25')]:_0x175b4d[_0x2ac1('0x22')]+_0x175b4d[_0x2ac1('0x24')];var _0x399ef6;if(_0x1b7301>=_0x32a27e){_0x1b7301=_0x32a27e;_0x399ef6=0xc8;}else{_0x399ef6=0xce;}_0x28e3da[_0x2ac1('0x20')](_0x399ef6);return _0x28e3da[_0x2ac1('0x26')]('Content-Range',_0x453f8a+'-'+_0x1b7301+'/'+_0x32a27e)['json'](_0x2a4ea8);}return null;};}function patchUpdates(_0x11fa47){return function(_0x1e39bd){try{jsonpatch['apply'](_0x1e39bd,_0x11fa47,!![]);}catch(_0x5db59a){return BPromise[_0x2ac1('0x27')](_0x5db59a);}return _0x1e39bd[_0x2ac1('0x28')]();};}function saveUpdates(_0xd6e41f,_0x5e43f8){return function(_0x4dde97){if(_0x4dde97){return _0x4dde97['update'](_0xd6e41f)[_0x2ac1('0x29')](function(_0x42ceb1){return _0x42ceb1;});}return null;};}function removeEntity(_0x1886fc,_0x176435){return function(_0x451e1d){if(_0x451e1d){return _0x451e1d[_0x2ac1('0x2a')]()[_0x2ac1('0x29')](function(){_0x1886fc[_0x2ac1('0x20')](0xcc)[_0x2ac1('0x2b')]();});}};}function handleEntityNotFound(_0x55e740,_0x3ffeb3){return function(_0x49f9f7){if(!_0x49f9f7){_0x55e740['sendStatus'](0x194);}return _0x49f9f7;};}function handleError(_0x5b58fd,_0x23119e){_0x23119e=_0x23119e||0x1f4;return function(_0xb6d4fe){logger[_0x2ac1('0x2c')](_0xb6d4fe[_0x2ac1('0x2d')]);if(_0xb6d4fe[_0x2ac1('0x2e')]){delete _0xb6d4fe['name'];}_0x5b58fd[_0x2ac1('0x20')](_0x23119e)['send'](_0xb6d4fe);};}exports[_0x2ac1('0x2f')]=function(_0x86a6b5,_0x204803){var _0x5bf90c={'raw':![],'where':{'id':_0x86a6b5[_0x2ac1('0x30')]['id']}},_0x4bf2b5={};_0x4bf2b5[_0x2ac1('0x31')]=_[_0x2ac1('0x32')](db[_0x2ac1('0x33')]['rawAttributes']);_0x4bf2b5[_0x2ac1('0x34')]=_['keys'](_0x86a6b5[_0x2ac1('0x34')]);_0x4bf2b5[_0x2ac1('0x35')]=_['intersection'](_0x4bf2b5['model'],_0x4bf2b5['query']);_0x5bf90c[_0x2ac1('0x36')]=_['intersection'](_0x4bf2b5[_0x2ac1('0x31')],qs[_0x2ac1('0x37')](_0x86a6b5['query'][_0x2ac1('0x37')]));_0x5bf90c[_0x2ac1('0x36')]=_0x5bf90c[_0x2ac1('0x36')]['length']?_0x5bf90c[_0x2ac1('0x36')]:_0x4bf2b5[_0x2ac1('0x31')];if(_0x86a6b5['query'][_0x2ac1('0x38')]){_0x5bf90c[_0x2ac1('0x39')]=[{'all':!![]}];}_0x5bf90c=_[_0x2ac1('0x3a')]({},_0x5bf90c,_0x86a6b5[_0x2ac1('0x3b')]);return db[_0x2ac1('0x33')][_0x2ac1('0x3c')](_0x5bf90c)['then'](handleEntityNotFound(_0x204803,null))[_0x2ac1('0x29')](respondWithResult(_0x204803,null))[_0x2ac1('0x3d')](handleError(_0x204803,null));};exports[_0x2ac1('0x2a')]=function(_0x23c819,_0x390ea9){return db[_0x2ac1('0x33')][_0x2ac1('0x3c')]({'where':{'id':_0x23c819[_0x2ac1('0x30')]['id']}})[_0x2ac1('0x29')](handleEntityNotFound(_0x390ea9,null))[_0x2ac1('0x29')](removeEntity(_0x390ea9,null))[_0x2ac1('0x3d')](handleError(_0x390ea9,null));};function widgetAttributes(_0x57b2fe){try{switch(_0x57b2fe['type']){case _0x2ac1('0x3e'):return[{'name':_0x2ac1('0x3f'),'value':_0x57b2fe['attrUrl']||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0][_0x2ac1('0x41')]:undefined)||'https://'}];case _0x2ac1('0x42'):return[{'name':'attrPath','value':_0x57b2fe[_0x2ac1('0x43')]||(_0x57b2fe['attrs']&&_0x57b2fe[_0x2ac1('0x40')][0x0]?_0x57b2fe['attrs'][0x0][_0x2ac1('0x41')]:undefined)||''}];case'clock':return[{'name':_0x2ac1('0x44'),'value':_0x57b2fe[_0x2ac1('0x44')]||(_0x57b2fe['attrs']&&_0x57b2fe[_0x2ac1('0x40')][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0][_0x2ac1('0x41')]:undefined)||_0x2ac1('0x45')},{'name':_0x2ac1('0x46'),'value':_0x57b2fe['attrTimezone']||(_0x57b2fe['attrs']&&_0x57b2fe[_0x2ac1('0x40')][0x1]?_0x57b2fe[_0x2ac1('0x40')][0x1][_0x2ac1('0x41')]:undefined)||_0x2ac1('0x47')},{'name':_0x2ac1('0x48'),'value':_0x57b2fe[_0x2ac1('0x48')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x2]?_0x57b2fe[_0x2ac1('0x40')][0x2][_0x2ac1('0x41')]:undefined)||0xc}];case _0x2ac1('0x49'):return[{'name':_0x2ac1('0x4a'),'value':_0x57b2fe[_0x2ac1('0x4a')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0][_0x2ac1('0x41')]:undefined)||_0x2ac1('0x4b')},{'name':_0x2ac1('0x4c'),'value':_0x57b2fe[_0x2ac1('0x4c')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x1]?_0x57b2fe['attrs'][0x1][_0x2ac1('0x41')]:undefined)||[]},{'name':_0x2ac1('0x48'),'value':_0x57b2fe[_0x2ac1('0x48')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe['attrs'][0x2]?_0x57b2fe[_0x2ac1('0x40')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x2ac1('0x4d'):return[{'name':_0x2ac1('0x4e'),'value':_0x57b2fe[_0x2ac1('0x4e')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0][_0x2ac1('0x41')]:undefined)||'total'},{'name':_0x2ac1('0x4f'),'value':_0x57b2fe[_0x2ac1('0x4f')]||(_0x57b2fe['attrs']&&_0x57b2fe['attrs'][0x1]?_0x57b2fe[_0x2ac1('0x40')][0x1][_0x2ac1('0x41')]:undefined)||null},{'name':_0x2ac1('0x50'),'value':_0x57b2fe['attrSerie3']||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x2]?_0x57b2fe[_0x2ac1('0x40')][0x2]['value']:undefined)||null},{'name':_0x2ac1('0x4c'),'value':_0x57b2fe['attrVoiceQueues']||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x3]?_0x57b2fe[_0x2ac1('0x40')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x2ac1('0x51'),'type':_0x57b2fe['reportType']||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe['attrs'][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0]['type']:undefined)||null,'value':_0x57b2fe[_0x2ac1('0x51')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe['attrs'][0x0]?_0x57b2fe[_0x2ac1('0x40')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x57b2fe[_0x2ac1('0x52')]||(_0x57b2fe[_0x2ac1('0x40')]&&_0x57b2fe[_0x2ac1('0x40')][0x1]?_0x57b2fe[_0x2ac1('0x40')][0x1][_0x2ac1('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x1ea9fe){logger[_0x2ac1('0x2c')](_0x2ac1('0x53'),JSON[_0x2ac1('0x54')](_0x1ea9fe));return[];}}exports[_0x2ac1('0x55')]=function(_0x1c096e,_0x233b6b){if(_0x1c096e[_0x2ac1('0x56')]){_0x1c096e[_0x2ac1('0x56')][_0x2ac1('0x40')]=widgetAttributes(_0x1c096e[_0x2ac1('0x56')]);}return db['DashboardItem'][_0x2ac1('0x55')](_0x1c096e['body'],{})[_0x2ac1('0x29')](respondWithResult(_0x233b6b,0xc9))['catch'](handleError(_0x233b6b,null));};exports['update']=function(_0x482f92,_0x14e81c){if(_0x482f92[_0x2ac1('0x56')]['id']){delete _0x482f92['body']['id'];}_0x482f92[_0x2ac1('0x56')][_0x2ac1('0x40')]=widgetAttributes(_0x482f92[_0x2ac1('0x56')]);return db[_0x2ac1('0x33')][_0x2ac1('0x3c')]({'where':{'id':_0x482f92[_0x2ac1('0x30')]['id']}})[_0x2ac1('0x29')](handleEntityNotFound(_0x14e81c,null))[_0x2ac1('0x29')](saveUpdates(_0x482f92[_0x2ac1('0x56')],null))['then'](respondWithResult(_0x14e81c,null))[_0x2ac1('0x3d')](handleError(_0x14e81c,null));}; \ No newline at end of file +var _0x5d51=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','show','params','model','DashboardItem','rawAttributes','query','keys','intersection','attributes','fields','includeAll','include','merge','catch','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5d51,0x146));var _0x15d5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5d51[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x15d5('0x0'));var rimraf=require(_0x15d5('0x1'));var zipdir=require(_0x15d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x15d5('0x3'));var BPromise=require(_0x15d5('0x4'));var Mustache=require(_0x15d5('0x5'));var util=require(_0x15d5('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x15d5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15d5('0x8'));var squel=require('squel');var crypto=require(_0x15d5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x15d5('0xa'));var toCsv=require(_0x15d5('0xb'));var querystring=require(_0x15d5('0xc'));var Papa=require(_0x15d5('0xd'));var Redis=require(_0x15d5('0xe'));var authService=require(_0x15d5('0xf'));var qs=require(_0x15d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x15d5('0x12'));var config=require(_0x15d5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x15d5('0x14'))['db'];config[_0x15d5('0x15')]=_[_0x15d5('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x15d5('0x17'))[_0x15d5('0x18')](socket);function respondWithStatusCode(_0x11c8c2,_0x4ec612){_0x4ec612=_0x4ec612||0xcc;return function(_0x3097c3){if(_0x3097c3){return _0x11c8c2[_0x15d5('0x19')](_0x4ec612);}return _0x11c8c2[_0x15d5('0x1a')](_0x4ec612)[_0x15d5('0x1b')]();};}function respondWithResult(_0x2df02f,_0x5278a9){_0x5278a9=_0x5278a9||0xc8;return function(_0x152ad5){if(_0x152ad5){return _0x2df02f[_0x15d5('0x1a')](_0x5278a9)[_0x15d5('0x1c')](_0x152ad5);}};}function respondWithFilteredResult(_0x2dd031,_0x5dfbd2){return function(_0x1b3053){if(_0x1b3053){var _0x45595d=typeof _0x5dfbd2[_0x15d5('0x1d')]===_0x15d5('0x1e')&&typeof _0x5dfbd2['limit']===_0x15d5('0x1e');var _0x364181=_0x1b3053[_0x15d5('0x1f')];var _0x5f48c1=_0x45595d?0x0:_0x5dfbd2['offset'];var _0x4ba66c=_0x45595d?_0x1b3053[_0x15d5('0x1f')]:_0x5dfbd2[_0x15d5('0x1d')]+_0x5dfbd2[_0x15d5('0x20')];var _0x3c41e9;if(_0x4ba66c>=_0x364181){_0x4ba66c=_0x364181;_0x3c41e9=0xc8;}else{_0x3c41e9=0xce;}_0x2dd031[_0x15d5('0x1a')](_0x3c41e9);return _0x2dd031[_0x15d5('0x21')](_0x15d5('0x22'),_0x5f48c1+'-'+_0x4ba66c+'/'+_0x364181)[_0x15d5('0x1c')](_0x1b3053);}return null;};}function patchUpdates(_0x1b4759){return function(_0x1c7c2e){try{jsonpatch[_0x15d5('0x23')](_0x1c7c2e,_0x1b4759,!![]);}catch(_0x13226){return BPromise[_0x15d5('0x24')](_0x13226);}return _0x1c7c2e[_0x15d5('0x25')]();};}function saveUpdates(_0x2c2e40,_0x2b2568){return function(_0x26781d){if(_0x26781d){return _0x26781d['update'](_0x2c2e40)['then'](function(_0x27999b){return _0x27999b;});}return null;};}function removeEntity(_0x45c76f,_0xea24a8){return function(_0x167441){if(_0x167441){return _0x167441[_0x15d5('0x26')]()[_0x15d5('0x27')](function(){_0x45c76f[_0x15d5('0x1a')](0xcc)[_0x15d5('0x1b')]();});}};}function handleEntityNotFound(_0x54068d,_0x36168d){return function(_0x53a67d){if(!_0x53a67d){_0x54068d[_0x15d5('0x19')](0x194);}return _0x53a67d;};}function handleError(_0x2aa888,_0x992a39){_0x992a39=_0x992a39||0x1f4;return function(_0x18a420){logger[_0x15d5('0x28')](_0x18a420[_0x15d5('0x29')]);if(_0x18a420[_0x15d5('0x2a')]){delete _0x18a420[_0x15d5('0x2a')];}_0x2aa888[_0x15d5('0x1a')](_0x992a39)['send'](_0x18a420);};}exports[_0x15d5('0x2b')]=function(_0x151ea2,_0x48b609){var _0x1aa23d={'raw':![],'where':{'id':_0x151ea2[_0x15d5('0x2c')]['id']}},_0x3ed1c0={};_0x3ed1c0[_0x15d5('0x2d')]=_['keys'](db[_0x15d5('0x2e')][_0x15d5('0x2f')]);_0x3ed1c0[_0x15d5('0x30')]=_[_0x15d5('0x31')](_0x151ea2['query']);_0x3ed1c0['filters']=_[_0x15d5('0x32')](_0x3ed1c0[_0x15d5('0x2d')],_0x3ed1c0[_0x15d5('0x30')]);_0x1aa23d[_0x15d5('0x33')]=_[_0x15d5('0x32')](_0x3ed1c0[_0x15d5('0x2d')],qs['fields'](_0x151ea2[_0x15d5('0x30')][_0x15d5('0x34')]));_0x1aa23d['attributes']=_0x1aa23d[_0x15d5('0x33')]['length']?_0x1aa23d[_0x15d5('0x33')]:_0x3ed1c0['model'];if(_0x151ea2[_0x15d5('0x30')][_0x15d5('0x35')]){_0x1aa23d[_0x15d5('0x36')]=[{'all':!![]}];}_0x1aa23d=_[_0x15d5('0x37')]({},_0x1aa23d,_0x151ea2['options']);return db['DashboardItem']['find'](_0x1aa23d)['then'](handleEntityNotFound(_0x48b609,null))[_0x15d5('0x27')](respondWithResult(_0x48b609,null))[_0x15d5('0x38')](handleError(_0x48b609,null));};exports['destroy']=function(_0xc0bb6,_0xd3860c){return db[_0x15d5('0x2e')][_0x15d5('0x39')]({'where':{'id':_0xc0bb6['params']['id']}})[_0x15d5('0x27')](handleEntityNotFound(_0xd3860c,null))[_0x15d5('0x27')](removeEntity(_0xd3860c,null))[_0x15d5('0x38')](handleError(_0xd3860c,null));};function widgetAttributes(_0x13b9e1){try{switch(_0x13b9e1[_0x15d5('0x3a')]){case _0x15d5('0x3b'):return[{'name':_0x15d5('0x3c'),'value':_0x13b9e1[_0x15d5('0x3c')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x0]?_0x13b9e1[_0x15d5('0x3d')][0x0][_0x15d5('0x3e')]:undefined)||_0x15d5('0x3f')}];case'custom':return[{'name':_0x15d5('0x40'),'value':_0x13b9e1[_0x15d5('0x40')]||(_0x13b9e1['attrs']&&_0x13b9e1[_0x15d5('0x3d')][0x0]?_0x13b9e1['attrs'][0x0]['value']:undefined)||''}];case _0x15d5('0x41'):return[{'name':'attrHourFormat','value':_0x13b9e1['attrHourFormat']||(_0x13b9e1['attrs']&&_0x13b9e1['attrs'][0x0]?_0x13b9e1['attrs'][0x0][_0x15d5('0x3e')]:undefined)||_0x15d5('0x42')},{'name':_0x15d5('0x43'),'value':_0x13b9e1[_0x15d5('0x43')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x1]?_0x13b9e1['attrs'][0x1]['value']:undefined)||_0x15d5('0x44')},{'name':_0x15d5('0x45'),'value':_0x13b9e1['attrFontSize']||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x2]?_0x13b9e1[_0x15d5('0x3d')][0x2][_0x15d5('0x3e')]:undefined)||0xc}];case _0x15d5('0x46'):return[{'name':'attrMetric','value':_0x13b9e1['attrMetric']||(_0x13b9e1['attrs']&&_0x13b9e1[_0x15d5('0x3d')][0x0]?_0x13b9e1[_0x15d5('0x3d')][0x0][_0x15d5('0x3e')]:undefined)||_0x15d5('0x47')},{'name':'attrVoiceQueues','value':_0x13b9e1['attrVoiceQueues']||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1['attrs'][0x1]?_0x13b9e1[_0x15d5('0x3d')][0x1][_0x15d5('0x3e')]:undefined)||[]},{'name':_0x15d5('0x45'),'value':_0x13b9e1[_0x15d5('0x45')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x2]?_0x13b9e1[_0x15d5('0x3d')][0x2][_0x15d5('0x3e')]:undefined)||0x14}];case _0x15d5('0x48'):case'pie-chart':return[{'name':_0x15d5('0x49'),'value':_0x13b9e1[_0x15d5('0x49')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x0]?_0x13b9e1['attrs'][0x0][_0x15d5('0x3e')]:undefined)||_0x15d5('0x47')},{'name':_0x15d5('0x4a'),'value':_0x13b9e1[_0x15d5('0x4a')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x1]?_0x13b9e1['attrs'][0x1][_0x15d5('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x13b9e1[_0x15d5('0x4b')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x2]?_0x13b9e1[_0x15d5('0x3d')][0x2]['value']:undefined)||null},{'name':_0x15d5('0x4c'),'value':_0x13b9e1[_0x15d5('0x4c')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1[_0x15d5('0x3d')][0x3]?_0x13b9e1[_0x15d5('0x3d')][0x3][_0x15d5('0x3e')]:undefined)||[]}];case'web-report':return[{'name':_0x15d5('0x4d'),'type':_0x13b9e1[_0x15d5('0x4e')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1['attrs'][0x0]?_0x13b9e1[_0x15d5('0x3d')][0x0][_0x15d5('0x3a')]:undefined)||null,'value':_0x13b9e1[_0x15d5('0x4d')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1['attrs'][0x0]?_0x13b9e1[_0x15d5('0x3d')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x13b9e1[_0x15d5('0x4f')]||(_0x13b9e1[_0x15d5('0x3d')]&&_0x13b9e1['attrs'][0x1]?_0x13b9e1[_0x15d5('0x3d')][0x1][_0x15d5('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x50ab7e){logger['error'](_0x15d5('0x50'),JSON[_0x15d5('0x51')](_0x50ab7e));return[];}}exports[_0x15d5('0x52')]=function(_0x2630aa,_0x2e92e3){if(_0x2630aa[_0x15d5('0x53')]){_0x2630aa['body']['attrs']=widgetAttributes(_0x2630aa[_0x15d5('0x53')]);}return db[_0x15d5('0x2e')][_0x15d5('0x52')](_0x2630aa[_0x15d5('0x53')],{})[_0x15d5('0x27')](respondWithResult(_0x2e92e3,0xc9))[_0x15d5('0x38')](handleError(_0x2e92e3,null));};exports[_0x15d5('0x54')]=function(_0x23809b,_0x4ed529){if(_0x23809b[_0x15d5('0x53')]['id']){delete _0x23809b['body']['id'];}_0x23809b[_0x15d5('0x53')][_0x15d5('0x3d')]=widgetAttributes(_0x23809b[_0x15d5('0x53')]);return db['DashboardItem'][_0x15d5('0x39')]({'where':{'id':_0x23809b[_0x15d5('0x2c')]['id']}})[_0x15d5('0x27')](handleEntityNotFound(_0x4ed529,null))['then'](saveUpdates(_0x23809b['body'],null))['then'](respondWithResult(_0x4ed529,null))[_0x15d5('0x38')](handleError(_0x4ed529,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 9868334..b3d39bb 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 _0x5e93=['update','remove','emit','hasOwnProperty','hook','events','DashboardItem','save'];(function(_0x5c1f38,_0x5cb36b){var _0x565d74=function(_0xf1b36){while(--_0xf1b36){_0x5c1f38['push'](_0x5c1f38['shift']());}};_0x565d74(++_0x5cb36b);}(_0x5e93,0x115));var _0x35e9=function(_0x323a79,_0x5645df){_0x323a79=_0x323a79-0x0;var _0x3262a0=_0x5e93[_0x323a79];return _0x3262a0;};'use strict';var EventEmitter=require(_0x35e9('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x35e9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35e9('0x2'),'afterUpdate':_0x35e9('0x3'),'afterDestroy':_0x35e9('0x4')};function emitEvent(_0x5691e3){return function(_0x338db9,_0x5a41be,_0x11b481){DashboardItemEvents[_0x35e9('0x5')](_0x5691e3+':'+_0x338db9['id'],_0x338db9);DashboardItemEvents[_0x35e9('0x5')](_0x5691e3,_0x338db9);_0x11b481(null);};}for(var e in events){if(events[_0x35e9('0x6')](e)){var event=events[e];DashboardItem[_0x35e9('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x15b8=['save','update','emit','hook','exports','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x15b8,0xcd));var _0x815b=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x15b8[_0x2e4aa2];return _0x5e6092;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x815b('0x0'))['db'][_0x815b('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x815b('0x2')](0x0);var events={'afterCreate':_0x815b('0x3'),'afterUpdate':_0x815b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x39d019){return function(_0x25985a,_0x3db027,_0x3aac7f){DashboardItemEvents[_0x815b('0x5')](_0x39d019+':'+_0x25985a['id'],_0x25985a);DashboardItemEvents[_0x815b('0x5')](_0x39d019,_0x25985a);_0x3aac7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x815b('0x6')](e,emitEvent(event));}}module[_0x815b('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 6a7a860..fc7888f 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 _0x17a0=['bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0x17a0,0x165));var _0x017a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x17a0[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x017a('0x0'));var logger=require(_0x017a('0x1'))(_0x017a('0x2'));var moment=require('moment');var BPromise=require(_0x017a('0x3'));var rp=require(_0x017a('0x4'));var fs=require('fs');var path=require(_0x017a('0x5'));var rimraf=require(_0x017a('0x6'));var config=require('../../config/environment');var attributes=require(_0x017a('0x7'));module[_0x017a('0x8')]=function(_0x3fccd9,_0x8d767f){return _0x3fccd9[_0x017a('0x9')](_0x017a('0xa'),attributes,{'tableName':_0x017a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x666b=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','dashboard_items'];(function(_0x32f3b6,_0x35c6b){var _0x1be3c0=function(_0x5b284e){while(--_0x5b284e){_0x32f3b6['push'](_0x32f3b6['shift']());}};_0x1be3c0(++_0x35c6b);}(_0x666b,0x129));var _0xb666=function(_0x3468d3,_0x5f0f55){_0x3468d3=_0x3468d3-0x0;var _0x549184=_0x666b[_0x3468d3];return _0x549184;};'use strict';var _=require(_0xb666('0x0'));var util=require(_0xb666('0x1'));var logger=require(_0xb666('0x2'))(_0xb666('0x3'));var moment=require(_0xb666('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb666('0x5'));var rimraf=require(_0xb666('0x6'));var config=require(_0xb666('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xb666('0x8')]=function(_0x2dc0d2,_0xd987a2){return _0x2dc0d2[_0xb666('0x9')]('DashboardItem',attributes,{'tableName':_0xb666('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 3785fc8..63d5909 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 _0xde49=['./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','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x443303,_0x1ff806){var _0x5b42a1=function(_0x34270e){while(--_0x34270e){_0x443303['push'](_0x443303['shift']());}};_0x5b42a1(++_0x1ff806);}(_0xde49,0x131));var _0x9de4=function(_0x3055fe,_0xee35a4){_0x3055fe=_0x3055fe-0x0;var _0x5d81e7=_0xde49[_0x3055fe];return _0x5d81e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9de4('0x0'));var BPromise=require('bluebird');var rs=require(_0x9de4('0x1'));var fs=require('fs');var Redis=require(_0x9de4('0x2'));var db=require(_0x9de4('0x3'))['db'];var utils=require(_0x9de4('0x4'));var logger=require(_0x9de4('0x5'))(_0x9de4('0x6'));var config=require(_0x9de4('0x7'));var jayson=require(_0x9de4('0x8'));var client=jayson[_0x9de4('0x9')][_0x9de4('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9de4('0xb')],{'host':_0x9de4('0xc'),'port':0x18eb});var socket=require(_0x9de4('0xd'))(new Redis(config[_0x9de4('0xb')]));require(_0x9de4('0xe'))[_0x9de4('0xf')](socket);function respondWithRpcPromise(_0x1825fb,_0x3c3d73,_0x16694c){return new BPromise(function(_0x541092,_0xf818a3){return client[_0x9de4('0x10')](_0x1825fb,_0x16694c)[_0x9de4('0x11')](function(_0x26cc2b){logger[_0x9de4('0x12')](_0x9de4('0x13'),_0x3c3d73,_0x9de4('0x14'));logger[_0x9de4('0x15')](_0x9de4('0x16'),_0x3c3d73,_0x9de4('0x14'),JSON[_0x9de4('0x17')](_0x26cc2b));if(_0x26cc2b['error']){if(_0x26cc2b[_0x9de4('0x18')][_0x9de4('0x19')]===0x1f4){logger[_0x9de4('0x18')](_0x9de4('0x13'),_0x3c3d73,_0x26cc2b[_0x9de4('0x18')][_0x9de4('0x1a')]);return _0xf818a3(_0x26cc2b[_0x9de4('0x18')][_0x9de4('0x1a')]);}logger[_0x9de4('0x18')](_0x9de4('0x13'),_0x3c3d73,_0x26cc2b['error'][_0x9de4('0x1a')]);return _0x541092(_0x26cc2b['error'][_0x9de4('0x1a')]);}else{logger[_0x9de4('0x12')](_0x9de4('0x13'),_0x3c3d73,'request\x20sent');_0x541092(_0x26cc2b[_0x9de4('0x1b')][_0x9de4('0x1a')]);}})[_0x9de4('0x1c')](function(_0x1f57a5){logger[_0x9de4('0x18')](_0x9de4('0x13'),_0x3c3d73,_0x1f57a5);_0xf818a3(_0x1f57a5);});});} \ No newline at end of file +var _0x3054=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','then','request\x20sent'];(function(_0x5af5d8,_0x3c3457){var _0x1a7417=function(_0x42bd0c){while(--_0x42bd0c){_0x5af5d8['push'](_0x5af5d8['shift']());}};_0x1a7417(++_0x3c3457);}(_0x3054,0xc6));var _0x4305=function(_0x47fcfa,_0x2011fe){_0x47fcfa=_0x47fcfa-0x0;var _0x5beb36=_0x3054[_0x47fcfa];return _0x5beb36;};'use strict';var _=require(_0x4305('0x0'));var util=require('util');var moment=require(_0x4305('0x1'));var BPromise=require('bluebird');var rs=require(_0x4305('0x2'));var fs=require('fs');var Redis=require(_0x4305('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4305('0x4'));var logger=require(_0x4305('0x5'))(_0x4305('0x6'));var config=require(_0x4305('0x7'));var jayson=require(_0x4305('0x8'));var client=jayson[_0x4305('0x9')][_0x4305('0xa')]({'port':0x232a});config[_0x4305('0xb')]=_[_0x4305('0xc')](config[_0x4305('0xb')],{'host':_0x4305('0xd'),'port':0x18eb});var socket=require(_0x4305('0xe'))(new Redis(config[_0x4305('0xb')]));require(_0x4305('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d530e,_0xefff06,_0x3a30c2){return new BPromise(function(_0x4cefff,_0x489222){return client['request'](_0x3d530e,_0x3a30c2)[_0x4305('0x10')](function(_0x306854){logger['info']('DashboardItem,\x20%s,\x20%s',_0xefff06,_0x4305('0x11'));logger[_0x4305('0x12')](_0x4305('0x13'),_0xefff06,_0x4305('0x11'),JSON['stringify'](_0x306854));if(_0x306854[_0x4305('0x14')]){if(_0x306854[_0x4305('0x14')][_0x4305('0x15')]===0x1f4){logger[_0x4305('0x14')](_0x4305('0x16'),_0xefff06,_0x306854[_0x4305('0x14')][_0x4305('0x17')]);return _0x489222(_0x306854[_0x4305('0x14')]['message']);}logger[_0x4305('0x14')](_0x4305('0x16'),_0xefff06,_0x306854[_0x4305('0x14')][_0x4305('0x17')]);return _0x4cefff(_0x306854[_0x4305('0x14')][_0x4305('0x17')]);}else{logger[_0x4305('0x18')](_0x4305('0x16'),_0xefff06,_0x4305('0x11'));_0x4cefff(_0x306854[_0x4305('0x19')]['message']);}})[_0x4305('0x1a')](function(_0x5d01e2){logger[_0x4305('0x14')]('DashboardItem,\x20%s,\x20%s',_0xefff06,_0x5d01e2);_0x489222(_0x5d01e2);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index f3e1e50..310c30f 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 _0xddf1=['register','length','dashboardItem:','save','remove','update','emit'];(function(_0x4b832e,_0x385473){var _0x1d22d9=function(_0x549467){while(--_0x549467){_0x4b832e['push'](_0x4b832e['shift']());}};_0x1d22d9(++_0x385473);}(_0xddf1,0x65));var _0x1ddf=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xddf1[_0xaa1b3e];return _0x454d7d;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x1ddf('0x0'),_0x1ddf('0x1'),_0x1ddf('0x2')];function createListener(_0x2989ad,_0x3c958f){return function(_0x4f9bb3){_0x3c958f[_0x1ddf('0x3')](_0x2989ad,_0x4f9bb3);};}function removeListener(_0x3faff2,_0x5e4531){return function(){DashboardItemEvents['removeListener'](_0x3faff2,_0x5e4531);};}exports[_0x1ddf('0x4')]=function(_0x5f5d9d){for(var _0x288d88=0x0,_0x1153b0=events[_0x1ddf('0x5')];_0x288d88<_0x1153b0;_0x288d88++){var _0x28dcda=events[_0x288d88];var _0x4278ce=createListener(_0x1ddf('0x6')+_0x28dcda,_0x5f5d9d);DashboardItemEvents['on'](_0x28dcda,_0x4278ce);}}; \ No newline at end of file +var _0xb7a2=['removeListener','register','dashboardItem:','./dashboardItem.events','save','remove','update','emit'];(function(_0x17c61f,_0x449aa8){var _0x464a00=function(_0x48b536){while(--_0x48b536){_0x17c61f['push'](_0x17c61f['shift']());}};_0x464a00(++_0x449aa8);}(_0xb7a2,0x143));var _0x2b7a=function(_0x16dab1,_0x265a95){_0x16dab1=_0x16dab1-0x0;var _0x1818e0=_0xb7a2[_0x16dab1];return _0x1818e0;};'use strict';var DashboardItemEvents=require(_0x2b7a('0x0'));var events=[_0x2b7a('0x1'),_0x2b7a('0x2'),_0x2b7a('0x3')];function createListener(_0x53c5f7,_0x38d678){return function(_0x2455ac){_0x38d678[_0x2b7a('0x4')](_0x53c5f7,_0x2455ac);};}function removeListener(_0x23825e,_0x384708){return function(){DashboardItemEvents[_0x2b7a('0x5')](_0x23825e,_0x384708);};}exports[_0x2b7a('0x6')]=function(_0x339976){for(var _0x23c3b0=0x0,_0x5ea7e2=events['length'];_0x23c3b0<_0x5ea7e2;_0x23c3b0++){var _0x2e912b=events[_0x23c3b0];var _0x57a96d=createListener(_0x2b7a('0x7')+_0x2e912b,_0x339976);DashboardItemEvents['on'](_0x2e912b,_0x57a96d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c3eb9d7..88cf50b 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 _0xf4cd=['post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4cd,0xd0));var _0xdf4c=function(_0x5f1fe6,_0x2b6bef){_0x5f1fe6=_0x5f1fe6-0x0;var _0x3c04de=_0xf4cd[_0x5f1fe6];return _0x3c04de;};'use strict';var multer=require(_0xdf4c('0x0'));var util=require(_0xdf4c('0x1'));var path=require(_0xdf4c('0x2'));var timeout=require(_0xdf4c('0x3'));var express=require(_0xdf4c('0x4'));var router=express[_0xdf4c('0x5')]();var fs_extra=require(_0xdf4c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xdf4c('0x7'));var config=require(_0xdf4c('0x8'));var controller=require(_0xdf4c('0x9'));router[_0xdf4c('0xa')](_0xdf4c('0xb'),auth[_0xdf4c('0xc')](),controller['show']);router[_0xdf4c('0xd')]('/',auth[_0xdf4c('0xc')](),controller[_0xdf4c('0xe')]);router[_0xdf4c('0xf')](_0xdf4c('0xb'),auth['isAuthenticated'](),controller[_0xdf4c('0x10')]);router['delete'](_0xdf4c('0xb'),auth[_0xdf4c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2d43=['../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','express','Router','../../components/auth/service'];(function(_0x234c83,_0x52751a){var _0x23cc19=function(_0x362f2f){while(--_0x362f2f){_0x234c83['push'](_0x234c83['shift']());}};_0x23cc19(++_0x52751a);}(_0x2d43,0x93));var _0x32d4=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x2d43[_0x57fa33];return _0x12e724;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x32d4('0x0'));var router=express[_0x32d4('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x32d4('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x32d4('0x3'));var controller=require(_0x32d4('0x4'));router[_0x32d4('0x5')](_0x32d4('0x6'),auth[_0x32d4('0x7')](),controller[_0x32d4('0x8')]);router[_0x32d4('0x9')]('/',auth[_0x32d4('0x7')](),controller[_0x32d4('0xa')]);router['put'](_0x32d4('0x6'),auth[_0x32d4('0x7')](),controller[_0x32d4('0xb')]);router[_0x32d4('0xc')](_0x32d4('0x6'),auth[_0x32d4('0x7')](),controller[_0x32d4('0xd')]);module[_0x32d4('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 17704d1..593d77d 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 _0xe8ef=['third','first','sequelize','exports','STRING','ENUM','second'];(function(_0x2e407c,_0x4b47d4){var _0x167ee0=function(_0x2feb2b){while(--_0x2feb2b){_0x2e407c['push'](_0x2e407c['shift']());}};_0x167ee0(++_0x4b47d4);}(_0xe8ef,0x152));var _0xfe8e=function(_0x56880d,_0x315eb5){_0x56880d=_0x56880d-0x0;var _0x3ebe18=_0xe8ef[_0x56880d];return _0x3ebe18;};'use strict';var Sequelize=require(_0xfe8e('0x0'));module[_0xfe8e('0x1')]={'name':{'type':Sequelize[_0xfe8e('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xfe8e('0x3')]('first',_0xfe8e('0x4'),_0xfe8e('0x5')),'allowNull':![],'defaultValue':_0xfe8e('0x6')},'description':{'type':Sequelize[_0xfe8e('0x2')]}}; \ No newline at end of file +var _0xaa24=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x22ddc4,_0x3eefdd){var _0x282c18=function(_0x4692bc){while(--_0x4692bc){_0x22ddc4['push'](_0x22ddc4['shift']());}};_0x282c18(++_0x3eefdd);}(_0xaa24,0xbe));var _0x4aa2=function(_0x1b31a6,_0x2ceea7){_0x1b31a6=_0x1b31a6-0x0;var _0x53283a=_0xaa24[_0x1b31a6];return _0x53283a;};'use strict';var Sequelize=require(_0x4aa2('0x0'));module[_0x4aa2('0x1')]={'name':{'type':Sequelize[_0x4aa2('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x4aa2('0x3')](_0x4aa2('0x4'),_0x4aa2('0x5'),_0x4aa2('0x6')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x4aa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index df5a3c9..e7840d9 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 _0x5f6f=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','rows','show','params','intersection','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x5353af,_0x2ed70c){var _0x1e3cd5=function(_0x17a3f4){while(--_0x17a3f4){_0x5353af['push'](_0x5353af['shift']());}};_0x1e3cd5(++_0x2ed70c);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x22852e,_0x2f3f5c){_0x22852e=_0x22852e-0x0;var _0x5e95e8=_0x5f6f[_0x22852e];return _0x5e95e8;};'use strict';var emlformat=require(_0xf5f6('0x0'));var rimraf=require(_0xf5f6('0x1'));var zipdir=require(_0xf5f6('0x2'));var jsonpatch=require(_0xf5f6('0x3'));var rp=require(_0xf5f6('0x4'));var moment=require('moment');var BPromise=require(_0xf5f6('0x5'));var Mustache=require(_0xf5f6('0x6'));var util=require(_0xf5f6('0x7'));var path=require('path');var sox=require(_0xf5f6('0x8'));var csv=require(_0xf5f6('0x9'));var ejs=require(_0xf5f6('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf5f6('0xc'));var jsforce=require(_0xf5f6('0xd'));var deskjs=require(_0xf5f6('0xe'));var toCsv=require(_0xf5f6('0x9'));var querystring=require(_0xf5f6('0xf'));var Papa=require(_0xf5f6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5f6('0x11'));var as=require(_0xf5f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f6('0x13'))(_0xf5f6('0x14'));var utils=require(_0xf5f6('0x15'));var config=require(_0xf5f6('0x16'));var licenseUtil=require(_0xf5f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b407d,_0x4cde56){_0x4cde56=_0x4cde56||0xcc;return function(_0x2a62c5){if(_0x2a62c5){return _0x3b407d[_0xf5f6('0x18')](_0x4cde56);}return _0x3b407d[_0xf5f6('0x19')](_0x4cde56)[_0xf5f6('0x1a')]();};}function respondWithResult(_0x52648d,_0x96661c){_0x96661c=_0x96661c||0xc8;return function(_0x33cc8a){if(_0x33cc8a){return _0x52648d[_0xf5f6('0x19')](_0x96661c)[_0xf5f6('0x1b')](_0x33cc8a);}};}function respondWithFilteredResult(_0x504cd9,_0x1e3037){return function(_0x3f9f49){if(_0x3f9f49){var _0x21ccf7=typeof _0x1e3037[_0xf5f6('0x1c')]==='undefined'&&typeof _0x1e3037['limit']===_0xf5f6('0x1d');var _0x59a37e=_0x3f9f49[_0xf5f6('0x1e')];var _0x4dd3ae=_0x21ccf7?0x0:_0x1e3037[_0xf5f6('0x1c')];var _0x294af2=_0x21ccf7?_0x3f9f49[_0xf5f6('0x1e')]:_0x1e3037[_0xf5f6('0x1c')]+_0x1e3037[_0xf5f6('0x1f')];var _0x3199f0;if(_0x294af2>=_0x59a37e){_0x294af2=_0x59a37e;_0x3199f0=0xc8;}else{_0x3199f0=0xce;}_0x504cd9['status'](_0x3199f0);return _0x504cd9[_0xf5f6('0x20')](_0xf5f6('0x21'),_0x4dd3ae+'-'+_0x294af2+'/'+_0x59a37e)[_0xf5f6('0x1b')](_0x3f9f49);}return null;};}function patchUpdates(_0x261015){return function(_0x46de8c){try{jsonpatch['apply'](_0x46de8c,_0x261015,!![]);}catch(_0x1049e8){return BPromise[_0xf5f6('0x22')](_0x1049e8);}return _0x46de8c[_0xf5f6('0x23')]();};}function saveUpdates(_0x579375,_0x253b42){return function(_0x32f27e){if(_0x32f27e){return _0x32f27e[_0xf5f6('0x24')](_0x579375)[_0xf5f6('0x25')](function(_0x49906c){return _0x49906c;});}return null;};}function removeEntity(_0x4adf54,_0x1503e0){return function(_0x198cbb){if(_0x198cbb){return _0x198cbb[_0xf5f6('0x26')]()['then'](function(){var _0x31d0fb=_0x198cbb[_0xf5f6('0x27')]({'plain':!![]});var _0x9500e5='Dispositions';return db['UserProfileResource'][_0xf5f6('0x26')]({'where':{'type':_0x9500e5,'resourceId':_0x31d0fb['id']}})[_0xf5f6('0x25')](function(){return _0x198cbb;});})[_0xf5f6('0x25')](function(){_0x4adf54[_0xf5f6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2fab7,_0x345242){return function(_0x52dfe3){if(!_0x52dfe3){_0xb2fab7[_0xf5f6('0x18')](0x194);}return _0x52dfe3;};}function handleError(_0x4c6cbf,_0x3fa834){_0x3fa834=_0x3fa834||0x1f4;return function(_0x8867ac){logger['error'](_0x8867ac[_0xf5f6('0x28')]);if(_0x8867ac[_0xf5f6('0x29')]){delete _0x8867ac[_0xf5f6('0x29')];}_0x4c6cbf[_0xf5f6('0x19')](_0x3fa834)['send'](_0x8867ac);};}exports[_0xf5f6('0x2a')]=function(_0x58f320,_0x254810){var _0x301a59={},_0x202565={},_0x1c4832={'count':0x0,'rows':[]};var _0x5bc8b1=_[_0xf5f6('0x2b')](db['Disposition'][_0xf5f6('0x2c')],function(_0x1dd7af){return{'name':_0x1dd7af['fieldName'],'type':_0x1dd7af[_0xf5f6('0x2d')][_0xf5f6('0x2e')]};});_0x202565[_0xf5f6('0x2f')]=_[_0xf5f6('0x2b')](_0x5bc8b1,_0xf5f6('0x29'));_0x202565[_0xf5f6('0x30')]=_[_0xf5f6('0x31')](_0x58f320['query']);_0x202565[_0xf5f6('0x32')]=_['intersection'](_0x202565[_0xf5f6('0x2f')],_0x202565[_0xf5f6('0x30')]);_0x301a59['attributes']=_['intersection'](_0x202565[_0xf5f6('0x2f')],qs[_0xf5f6('0x33')](_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x33')]));_0x301a59[_0xf5f6('0x34')]=_0x301a59[_0xf5f6('0x34')][_0xf5f6('0x35')]?_0x301a59[_0xf5f6('0x34')]:_0x202565['model'];if(!_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x36')](_0xf5f6('0x37'))){_0x301a59['limit']=qs['limit'](_0x58f320[_0xf5f6('0x30')]['limit']);_0x301a59['offset']=qs[_0xf5f6('0x1c')](_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x1c')]);}_0x301a59['order']=qs[_0xf5f6('0x38')](_0x58f320[_0xf5f6('0x30')]['sort']);_0x301a59[_0xf5f6('0x39')]=qs['filters'](_['pick'](_0x58f320[_0xf5f6('0x30')],_0x202565['filters']),_0x5bc8b1);if(_0x58f320['query'][_0xf5f6('0x3a')]){_0x301a59[_0xf5f6('0x39')]=_[_0xf5f6('0x3b')](_0x301a59['where'],{'$or':_['map'](_0x5bc8b1,function(_0x2e7742){if(_0x2e7742[_0xf5f6('0x2d')]!==_0xf5f6('0x3c')){var _0x47e5c3={};_0x47e5c3[_0x2e7742[_0xf5f6('0x29')]]={'$like':'%'+_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x3a')]+'%'};return _0x47e5c3;}})});}_0x301a59=_[_0xf5f6('0x3b')]({},_0x301a59,_0x58f320[_0xf5f6('0x3d')]);var _0x3798bd={'where':_0x301a59[_0xf5f6('0x39')]};return db[_0xf5f6('0x3e')][_0xf5f6('0x1e')](_0x3798bd)['then'](function(_0xc344b3){_0x1c4832[_0xf5f6('0x1e')]=_0xc344b3;if(_0x58f320[_0xf5f6('0x30')][_0xf5f6('0x3f')]){_0x301a59[_0xf5f6('0x40')]=[{'all':!![]}];}return db[_0xf5f6('0x3e')][_0xf5f6('0x41')](_0x301a59);})[_0xf5f6('0x25')](function(_0x37d9a2){_0x1c4832[_0xf5f6('0x42')]=_0x37d9a2;return _0x1c4832;})[_0xf5f6('0x25')](respondWithFilteredResult(_0x254810,_0x301a59))['catch'](handleError(_0x254810,null));};exports[_0xf5f6('0x43')]=function(_0x334ce0,_0x3c9fea){var _0x479824={'raw':!![],'where':{'id':_0x334ce0[_0xf5f6('0x44')]['id']}},_0x4548b0={};_0x4548b0['model']=_[_0xf5f6('0x31')](db['Disposition']['rawAttributes']);_0x4548b0[_0xf5f6('0x30')]=_[_0xf5f6('0x31')](_0x334ce0[_0xf5f6('0x30')]);_0x4548b0['filters']=_[_0xf5f6('0x45')](_0x4548b0[_0xf5f6('0x2f')],_0x4548b0[_0xf5f6('0x30')]);_0x479824['attributes']=_[_0xf5f6('0x45')](_0x4548b0['model'],qs[_0xf5f6('0x33')](_0x334ce0['query'][_0xf5f6('0x33')]));_0x479824[_0xf5f6('0x34')]=_0x479824[_0xf5f6('0x34')][_0xf5f6('0x35')]?_0x479824[_0xf5f6('0x34')]:_0x4548b0['model'];if(_0x334ce0['query'][_0xf5f6('0x3f')]){_0x479824['include']=[{'all':!![]}];}_0x479824=_[_0xf5f6('0x3b')]({},_0x479824,_0x334ce0[_0xf5f6('0x3d')]);return db[_0xf5f6('0x3e')]['find'](_0x479824)[_0xf5f6('0x25')](handleEntityNotFound(_0x3c9fea,null))[_0xf5f6('0x25')](respondWithResult(_0x3c9fea,null))[_0xf5f6('0x46')](handleError(_0x3c9fea,null));};exports[_0xf5f6('0x47')]=function(_0x44c264,_0x1fe5a5){return db['Disposition'][_0xf5f6('0x47')](_0x44c264[_0xf5f6('0x48')],{})['then'](function(_0xf092b6){var _0x8c09ff=_0x44c264[_0xf5f6('0x49')][_0xf5f6('0x27')]({'plain':!![]});if(!_0x8c09ff)throw new Error(_0xf5f6('0x4a'));if(_0x8c09ff[_0xf5f6('0x4b')]===_0xf5f6('0x49')){var _0x18c9cf=_0xf092b6['get']({'plain':!![]});var _0x3ac888='Dispositions';return db[_0xf5f6('0x4c')][_0xf5f6('0x4d')]({'where':{'name':_0x3ac888,'userProfileId':_0x8c09ff[_0xf5f6('0x4e')]},'raw':!![]})['then'](function(_0x28ef8c){if(_0x28ef8c&&_0x28ef8c[_0xf5f6('0x4f')]===0x0){return db[_0xf5f6('0x50')]['create']({'name':_0x18c9cf[_0xf5f6('0x29')],'resourceId':_0x18c9cf['id'],'type':_0x28ef8c[_0xf5f6('0x29')],'sectionId':_0x28ef8c['id']},{})[_0xf5f6('0x25')](function(){return _0xf092b6;});}else{return _0xf092b6;}})[_0xf5f6('0x46')](function(_0x24de8f){logger[_0xf5f6('0x51')](_0xf5f6('0x52'),_0x24de8f);throw _0x24de8f;});}return _0xf092b6;})['then'](respondWithResult(_0x1fe5a5,0xc9))[_0xf5f6('0x46')](handleError(_0x1fe5a5,null));};exports[_0xf5f6('0x24')]=function(_0x1f8ae7,_0x54aeac){if(_0x1f8ae7[_0xf5f6('0x48')]['id']){delete _0x1f8ae7['body']['id'];}return db[_0xf5f6('0x3e')][_0xf5f6('0x4d')]({'where':{'id':_0x1f8ae7[_0xf5f6('0x44')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x54aeac,null))[_0xf5f6('0x25')](saveUpdates(_0x1f8ae7[_0xf5f6('0x48')],null))[_0xf5f6('0x25')](respondWithResult(_0x54aeac,null))[_0xf5f6('0x46')](handleError(_0x54aeac,null));};exports[_0xf5f6('0x26')]=function(_0x26ab99,_0x438427){return db[_0xf5f6('0x3e')][_0xf5f6('0x4d')]({'where':{'id':_0x26ab99[_0xf5f6('0x44')]['id']}})[_0xf5f6('0x25')](handleEntityNotFound(_0x438427,null))[_0xf5f6('0x25')](removeEntity(_0x438427,null))[_0xf5f6('0x46')](handleError(_0x438427,null));}; \ No newline at end of file +var _0xf3ff=['UserProfileSection','userProfileId','autoAssociation','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','Dispositions','UserProfileResource','sendStatus','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','get','role'];(function(_0x1015f2,_0x12891f){var _0x43ed35=function(_0xcbc923){while(--_0xcbc923){_0x1015f2['push'](_0x1015f2['shift']());}};_0x43ed35(++_0x12891f);}(_0xf3ff,0xae));var _0xff3f=function(_0x507ddf,_0x1c655d){_0x507ddf=_0x507ddf-0x0;var _0x411a81=_0xf3ff[_0x507ddf];return _0x411a81;};'use strict';var emlformat=require(_0xff3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff3f('0x1'));var jsonpatch=require(_0xff3f('0x2'));var rp=require(_0xff3f('0x3'));var moment=require(_0xff3f('0x4'));var BPromise=require(_0xff3f('0x5'));var Mustache=require(_0xff3f('0x6'));var util=require('util');var path=require(_0xff3f('0x7'));var sox=require(_0xff3f('0x8'));var csv=require(_0xff3f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff3f('0xa'));var _=require(_0xff3f('0xb'));var squel=require('squel');var crypto=require(_0xff3f('0xc'));var jsforce=require(_0xff3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff3f('0xe'));var Redis=require('ioredis');var authService=require(_0xff3f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xff3f('0x10'));var hardwareService=require(_0xff3f('0x11'));var logger=require(_0xff3f('0x12'))(_0xff3f('0x13'));var utils=require(_0xff3f('0x14'));var config=require(_0xff3f('0x15'));var licenseUtil=require(_0xff3f('0x16'));var db=require(_0xff3f('0x17'))['db'];function respondWithStatusCode(_0x24a3c8,_0x2b5d15){_0x2b5d15=_0x2b5d15||0xcc;return function(_0x59fe19){if(_0x59fe19){return _0x24a3c8['sendStatus'](_0x2b5d15);}return _0x24a3c8[_0xff3f('0x18')](_0x2b5d15)[_0xff3f('0x19')]();};}function respondWithResult(_0x32f887,_0x4b3409){_0x4b3409=_0x4b3409||0xc8;return function(_0x54b52c){if(_0x54b52c){return _0x32f887[_0xff3f('0x18')](_0x4b3409)['json'](_0x54b52c);}};}function respondWithFilteredResult(_0x5ae3af,_0x2a7c79){return function(_0x95d895){if(_0x95d895){var _0x54e2a5=typeof _0x2a7c79[_0xff3f('0x1a')]==='undefined'&&typeof _0x2a7c79[_0xff3f('0x1b')]==='undefined';var _0x15c6bf=_0x95d895[_0xff3f('0x1c')];var _0xf21b3=_0x54e2a5?0x0:_0x2a7c79['offset'];var _0xc1698d=_0x54e2a5?_0x95d895[_0xff3f('0x1c')]:_0x2a7c79['offset']+_0x2a7c79[_0xff3f('0x1b')];var _0x3a220b;if(_0xc1698d>=_0x15c6bf){_0xc1698d=_0x15c6bf;_0x3a220b=0xc8;}else{_0x3a220b=0xce;}_0x5ae3af[_0xff3f('0x18')](_0x3a220b);return _0x5ae3af[_0xff3f('0x1d')](_0xff3f('0x1e'),_0xf21b3+'-'+_0xc1698d+'/'+_0x15c6bf)[_0xff3f('0x1f')](_0x95d895);}return null;};}function patchUpdates(_0x2ffd20){return function(_0xfd9c46){try{jsonpatch[_0xff3f('0x20')](_0xfd9c46,_0x2ffd20,!![]);}catch(_0x25bd19){return BPromise[_0xff3f('0x21')](_0x25bd19);}return _0xfd9c46[_0xff3f('0x22')]();};}function saveUpdates(_0x2daed4,_0x396044){return function(_0x52986f){if(_0x52986f){return _0x52986f['update'](_0x2daed4)[_0xff3f('0x23')](function(_0x53fbeb){return _0x53fbeb;});}return null;};}function removeEntity(_0x418316,_0x2bbbb2){return function(_0x4dd74a){if(_0x4dd74a){return _0x4dd74a[_0xff3f('0x24')]()['then'](function(){var _0x1b008b=_0x4dd74a['get']({'plain':!![]});var _0x20b234=_0xff3f('0x25');return db[_0xff3f('0x26')][_0xff3f('0x24')]({'where':{'type':_0x20b234,'resourceId':_0x1b008b['id']}})[_0xff3f('0x23')](function(){return _0x4dd74a;});})['then'](function(){_0x418316['status'](0xcc)[_0xff3f('0x19')]();});}};}function handleEntityNotFound(_0x4721f9,_0x400205){return function(_0x411534){if(!_0x411534){_0x4721f9[_0xff3f('0x27')](0x194);}return _0x411534;};}function handleError(_0x5e1d84,_0x329540){_0x329540=_0x329540||0x1f4;return function(_0x2dac57){logger['error'](_0x2dac57[_0xff3f('0x28')]);if(_0x2dac57[_0xff3f('0x29')]){delete _0x2dac57[_0xff3f('0x29')];}_0x5e1d84[_0xff3f('0x18')](_0x329540)[_0xff3f('0x2a')](_0x2dac57);};}exports[_0xff3f('0x2b')]=function(_0x33650f,_0x9454fc){var _0xaef900={},_0x183922={},_0x513871={'count':0x0,'rows':[]};var _0x64b19a=_['map'](db[_0xff3f('0x2c')][_0xff3f('0x2d')],function(_0x42f420){return{'name':_0x42f420[_0xff3f('0x2e')],'type':_0x42f420[_0xff3f('0x2f')][_0xff3f('0x30')]};});_0x183922[_0xff3f('0x31')]=_[_0xff3f('0x32')](_0x64b19a,'name');_0x183922['query']=_[_0xff3f('0x33')](_0x33650f[_0xff3f('0x34')]);_0x183922[_0xff3f('0x35')]=_[_0xff3f('0x36')](_0x183922['model'],_0x183922[_0xff3f('0x34')]);_0xaef900[_0xff3f('0x37')]=_[_0xff3f('0x36')](_0x183922['model'],qs[_0xff3f('0x38')](_0x33650f[_0xff3f('0x34')][_0xff3f('0x38')]));_0xaef900['attributes']=_0xaef900[_0xff3f('0x37')]['length']?_0xaef900[_0xff3f('0x37')]:_0x183922[_0xff3f('0x31')];if(!_0x33650f[_0xff3f('0x34')][_0xff3f('0x39')](_0xff3f('0x3a'))){_0xaef900['limit']=qs['limit'](_0x33650f[_0xff3f('0x34')]['limit']);_0xaef900[_0xff3f('0x1a')]=qs[_0xff3f('0x1a')](_0x33650f[_0xff3f('0x34')][_0xff3f('0x1a')]);}_0xaef900[_0xff3f('0x3b')]=qs[_0xff3f('0x3c')](_0x33650f[_0xff3f('0x34')][_0xff3f('0x3c')]);_0xaef900[_0xff3f('0x3d')]=qs[_0xff3f('0x35')](_[_0xff3f('0x3e')](_0x33650f[_0xff3f('0x34')],_0x183922['filters']),_0x64b19a);if(_0x33650f['query']['filter']){_0xaef900[_0xff3f('0x3d')]=_['merge'](_0xaef900['where'],{'$or':_[_0xff3f('0x32')](_0x64b19a,function(_0x4dee63){if(_0x4dee63[_0xff3f('0x2f')]!==_0xff3f('0x3f')){var _0x383c95={};_0x383c95[_0x4dee63[_0xff3f('0x29')]]={'$like':'%'+_0x33650f[_0xff3f('0x34')][_0xff3f('0x40')]+'%'};return _0x383c95;}})});}_0xaef900=_[_0xff3f('0x41')]({},_0xaef900,_0x33650f[_0xff3f('0x42')]);var _0xac8d2b={'where':_0xaef900[_0xff3f('0x3d')]};return db[_0xff3f('0x2c')][_0xff3f('0x1c')](_0xac8d2b)[_0xff3f('0x23')](function(_0x5a6dd7){_0x513871['count']=_0x5a6dd7;if(_0x33650f['query'][_0xff3f('0x43')]){_0xaef900[_0xff3f('0x44')]=[{'all':!![]}];}return db['Disposition'][_0xff3f('0x45')](_0xaef900);})[_0xff3f('0x23')](function(_0x1e57e8){_0x513871[_0xff3f('0x46')]=_0x1e57e8;return _0x513871;})['then'](respondWithFilteredResult(_0x9454fc,_0xaef900))[_0xff3f('0x47')](handleError(_0x9454fc,null));};exports[_0xff3f('0x48')]=function(_0x4433fb,_0xca19b3){var _0x199943={'raw':!![],'where':{'id':_0x4433fb[_0xff3f('0x49')]['id']}},_0x19086d={};_0x19086d[_0xff3f('0x31')]=_['keys'](db[_0xff3f('0x2c')]['rawAttributes']);_0x19086d[_0xff3f('0x34')]=_[_0xff3f('0x33')](_0x4433fb['query']);_0x19086d[_0xff3f('0x35')]=_['intersection'](_0x19086d[_0xff3f('0x31')],_0x19086d['query']);_0x199943[_0xff3f('0x37')]=_[_0xff3f('0x36')](_0x19086d[_0xff3f('0x31')],qs[_0xff3f('0x38')](_0x4433fb[_0xff3f('0x34')][_0xff3f('0x38')]));_0x199943['attributes']=_0x199943['attributes'][_0xff3f('0x4a')]?_0x199943[_0xff3f('0x37')]:_0x19086d['model'];if(_0x4433fb[_0xff3f('0x34')][_0xff3f('0x43')]){_0x199943['include']=[{'all':!![]}];}_0x199943=_[_0xff3f('0x41')]({},_0x199943,_0x4433fb['options']);return db['Disposition'][_0xff3f('0x4b')](_0x199943)[_0xff3f('0x23')](handleEntityNotFound(_0xca19b3,null))[_0xff3f('0x23')](respondWithResult(_0xca19b3,null))['catch'](handleError(_0xca19b3,null));};exports[_0xff3f('0x4c')]=function(_0x4af5a0,_0xec21bf){return db[_0xff3f('0x2c')][_0xff3f('0x4c')](_0x4af5a0[_0xff3f('0x4d')],{})[_0xff3f('0x23')](function(_0x3bf3aa){var _0x52df1b=_0x4af5a0[_0xff3f('0x4e')][_0xff3f('0x4f')]({'plain':!![]});if(!_0x52df1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52df1b[_0xff3f('0x50')]===_0xff3f('0x4e')){var _0x2db360=_0x3bf3aa[_0xff3f('0x4f')]({'plain':!![]});var _0x319435=_0xff3f('0x25');return db[_0xff3f('0x51')][_0xff3f('0x4b')]({'where':{'name':_0x319435,'userProfileId':_0x52df1b[_0xff3f('0x52')]},'raw':!![]})[_0xff3f('0x23')](function(_0x57015c){if(_0x57015c&&_0x57015c[_0xff3f('0x53')]===0x0){return db[_0xff3f('0x26')][_0xff3f('0x4c')]({'name':_0x2db360['name'],'resourceId':_0x2db360['id'],'type':_0x57015c[_0xff3f('0x29')],'sectionId':_0x57015c['id']},{})[_0xff3f('0x23')](function(){return _0x3bf3aa;});}else{return _0x3bf3aa;}})[_0xff3f('0x47')](function(_0xf09e40){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf09e40);throw _0xf09e40;});}return _0x3bf3aa;})[_0xff3f('0x23')](respondWithResult(_0xec21bf,0xc9))['catch'](handleError(_0xec21bf,null));};exports[_0xff3f('0x54')]=function(_0x4f5327,_0x4cf020){if(_0x4f5327['body']['id']){delete _0x4f5327[_0xff3f('0x4d')]['id'];}return db[_0xff3f('0x2c')][_0xff3f('0x4b')]({'where':{'id':_0x4f5327[_0xff3f('0x49')]['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x4cf020,null))[_0xff3f('0x23')](saveUpdates(_0x4f5327['body'],null))['then'](respondWithResult(_0x4cf020,null))[_0xff3f('0x47')](handleError(_0x4cf020,null));};exports['destroy']=function(_0x119cb5,_0x487f24){return db[_0xff3f('0x2c')][_0xff3f('0x4b')]({'where':{'id':_0x119cb5[_0xff3f('0x49')]['id']}})[_0xff3f('0x23')](handleEntityNotFound(_0x487f24,null))[_0xff3f('0x23')](removeEntity(_0x487f24,null))[_0xff3f('0x47')](handleError(_0x487f24,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 20fb488..72f4e09 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 _0xc070=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util'];(function(_0x246e75,_0x563d9e){var _0x533a56=function(_0x241434){while(--_0x241434){_0x246e75['push'](_0x246e75['shift']());}};_0x533a56(++_0x563d9e);}(_0xc070,0x16a));var _0x0c07=function(_0x5ed724,_0x17dc47){_0x5ed724=_0x5ed724-0x0;var _0x20e016=_0xc070[_0x5ed724];return _0x20e016;};'use strict';var _=require(_0x0c07('0x0'));var util=require(_0x0c07('0x1'));var logger=require(_0x0c07('0x2'))(_0x0c07('0x3'));var moment=require('moment');var BPromise=require(_0x0c07('0x4'));var rp=require(_0x0c07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c07('0x6'));var config=require(_0x0c07('0x7'));var attributes=require(_0x0c07('0x8'));module[_0x0c07('0x9')]=function(_0x4eac59,_0x380a1a){return _0x4eac59['define'](_0x0c07('0xa'),attributes,{'tableName':_0x0c07('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x0c07('0xc'),_0x0c07('0xd')]},{'unique':!![],'name':_0x0c07('0xe'),'fields':['name',_0x0c07('0xf')]},{'unique':!![],'name':_0x0c07('0x10'),'fields':[_0x0c07('0xc'),_0x0c07('0x11')]},{'unique':!![],'name':_0x0c07('0x12'),'fields':[_0x0c07('0xc'),_0x0c07('0x13')]},{'unique':!![],'name':_0x0c07('0x14'),'fields':['name',_0x0c07('0x15')]},{'unique':!![],'name':_0x0c07('0x16'),'fields':['name',_0x0c07('0x17')]},{'unique':!![],'name':_0x0c07('0x18'),'fields':[_0x0c07('0xc'),_0x0c07('0x19')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc257=['name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId'];(function(_0x8e8b7d,_0x35c789){var _0x32760f=function(_0x2ad143){while(--_0x2ad143){_0x8e8b7d['push'](_0x8e8b7d['shift']());}};_0x32760f(++_0x35c789);}(_0xc257,0x1cf));var _0x7c25=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc257[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7c25('0x0'));var util=require(_0x7c25('0x1'));var logger=require(_0x7c25('0x2'))(_0x7c25('0x3'));var moment=require(_0x7c25('0x4'));var BPromise=require(_0x7c25('0x5'));var rp=require(_0x7c25('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c25('0x7'));var config=require('../../config/environment');var attributes=require(_0x7c25('0x8'));module[_0x7c25('0x9')]=function(_0x385bdb,_0x220c82){return _0x385bdb[_0x7c25('0xa')](_0x7c25('0xb'),attributes,{'tableName':_0x7c25('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7c25('0xd'),'fields':[_0x7c25('0xe'),_0x7c25('0xf')]},{'unique':!![],'name':_0x7c25('0x10'),'fields':[_0x7c25('0xe'),_0x7c25('0x11')]},{'unique':!![],'name':_0x7c25('0x12'),'fields':[_0x7c25('0xe'),_0x7c25('0x13')]},{'unique':!![],'name':_0x7c25('0x14'),'fields':[_0x7c25('0xe'),'SmsAccountId']},{'unique':!![],'name':_0x7c25('0x15'),'fields':[_0x7c25('0xe'),_0x7c25('0x16')]},{'unique':!![],'name':_0x7c25('0x17'),'fields':['name',_0x7c25('0x18')]},{'unique':!![],'name':_0x7c25('0x19'),'fields':[_0x7c25('0xe'),_0x7c25('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 21518e4..e7ecc70 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34b085,_0x193b38){var _0xb6dcf1=function(_0x2e3ae5){while(--_0x2e3ae5){_0x34b085['push'](_0x34b085['shift']());}};_0xb6dcf1(++_0x193b38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ddf58,_0xcb612d){var _0x4f7be0=function(_0x4f7a16){while(--_0x4f7a16){_0x5ddf58['push'](_0x5ddf58['shift']());}};_0x4f7be0(++_0xcb612d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index d064be4..e5534b3 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 _0xc981=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','/:id','update','delete','destroy','exports','multer'];(function(_0x3a87f3,_0x5d3ea7){var _0x4d7c31=function(_0x5b8633){while(--_0x5b8633){_0x3a87f3['push'](_0x3a87f3['shift']());}};_0x4d7c31(++_0x5d3ea7);}(_0xc981,0xed));var _0x1c98=function(_0x52be35,_0x58f02e){_0x52be35=_0x52be35-0x0;var _0x2b2fac=_0xc981[_0x52be35];return _0x2b2fac;};'use strict';var multer=require(_0x1c98('0x0'));var util=require(_0x1c98('0x1'));var path=require(_0x1c98('0x2'));var timeout=require('connect-timeout');var express=require(_0x1c98('0x3'));var router=express['Router']();var fs_extra=require(_0x1c98('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1c98('0x5'));var config=require(_0x1c98('0x6'));var controller=require('./disposition.controller');router[_0x1c98('0x7')]('/',auth[_0x1c98('0x8')](),controller[_0x1c98('0x9')]);router[_0x1c98('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1c98('0xa')]);router[_0x1c98('0xb')]('/',auth[_0x1c98('0x8')](),controller['create']);router['put'](_0x1c98('0xc'),auth[_0x1c98('0x8')](),controller[_0x1c98('0xd')]);router[_0x1c98('0xe')]('/:id',auth[_0x1c98('0x8')](),controller[_0x1c98('0xf')]);module[_0x1c98('0x10')]=router; \ No newline at end of file +var _0x35db=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','show','post','create','put','delete','isAuthenticated','exports','path','connect-timeout'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x35db,0x70));var _0xb35d=function(_0x763221,_0x14a95d){_0x763221=_0x763221-0x0;var _0x31961a=_0x35db[_0x763221];return _0x31961a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb35d('0x0'));var timeout=require(_0xb35d('0x1'));var express=require(_0xb35d('0x2'));var router=express[_0xb35d('0x3')]();var fs_extra=require(_0xb35d('0x4'));var auth=require(_0xb35d('0x5'));var interaction=require(_0xb35d('0x6'));var config=require(_0xb35d('0x7'));var controller=require(_0xb35d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb35d('0x9')]);router[_0xb35d('0xa')](_0xb35d('0xb'),auth['isAuthenticated'](),controller[_0xb35d('0xc')]);router[_0xb35d('0xd')]('/',auth['isAuthenticated'](),controller[_0xb35d('0xe')]);router[_0xb35d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb35d('0x10')]('/:id',auth[_0xb35d('0x11')](),controller['destroy']);module[_0xb35d('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 918aa19..4a8c9c0 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 _0x21fc=['12000','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','9600'];(function(_0x29b997,_0x3f7266){var _0x18fe58=function(_0x11ba28){while(--_0x11ba28){_0x29b997['push'](_0x29b997['shift']());}};_0x18fe58(++_0x3f7266);}(_0x21fc,0x130));var _0xc21f=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x21fc[_0x2405bc];return _0x5272d4;};'use strict';var Sequelize=require(_0xc21f('0x0'));module['exports']={'name':{'type':Sequelize[_0xc21f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc21f('0x1')]},'ecm':{'type':Sequelize[_0xc21f('0x2')](_0xc21f('0x3'),'no'),'defaultValue':_0xc21f('0x3')},'headerinfo':{'type':Sequelize[_0xc21f('0x1')],'defaultValue':_0xc21f('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xc21f('0x2')](_0xc21f('0x5'),_0xc21f('0x6'),'7200',_0xc21f('0x7'),_0xc21f('0x8'),_0xc21f('0x9')),'defaultValue':_0xc21f('0x6')},'maxrate':{'type':Sequelize['ENUM'](_0xc21f('0x5'),'4800',_0xc21f('0xa'),_0xc21f('0x7'),'12000',_0xc21f('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xc21f('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xc21f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc21f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc21f('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc21f('0x2')](_0xc21f('0xc'),_0xc21f('0xd'),_0xc21f('0xe'),_0xc21f('0xf')),'defaultValue':_0xc21f('0xc')},'key':{'type':Sequelize[_0xc21f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc21f('0x10')],'defaultValue':function(){return _0xc21f('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc21f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc21f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc21f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc21f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc21f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc21f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc21f('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xc21f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xc21f('0x12')],'defaultValue':![],'comment':_0xc21f('0x14'),'set':function(_0x4adf17){if(!_0x4adf17)this[_0xc21f('0x15')](_0xc21f('0x16'),null);this[_0xc21f('0x15')](_0xc21f('0x17'),_0x4adf17);}}}; \ No newline at end of file +var _0xa5ed=['DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','12000','14400','2400','9600','INTEGER','SIP'];(function(_0x16121d,_0x463360){var _0x4c2739=function(_0x2f483d){while(--_0x2f483d){_0x16121d['push'](_0x16121d['shift']());}};_0x4c2739(++_0x463360);}(_0xa5ed,0x87));var _0xda5e=function(_0xf3346d,_0x379ad4){_0xf3346d=_0xf3346d-0x0;var _0x13bbc9=_0xa5ed[_0xf3346d];return _0x13bbc9;};'use strict';var Sequelize=require(_0xda5e('0x0'));module[_0xda5e('0x1')]={'name':{'type':Sequelize[_0xda5e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xda5e('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xda5e('0x3'),'no'),'defaultValue':_0xda5e('0x3')},'headerinfo':{'type':Sequelize[_0xda5e('0x2')],'defaultValue':_0xda5e('0x4')},'localstationid':{'type':Sequelize[_0xda5e('0x2')],'unique':_0xda5e('0x5')},'minrate':{'type':Sequelize[_0xda5e('0x6')]('2400',_0xda5e('0x7'),_0xda5e('0x8'),'9600',_0xda5e('0x9'),_0xda5e('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xda5e('0x6')](_0xda5e('0xb'),_0xda5e('0x7'),'7200',_0xda5e('0xc'),_0xda5e('0x9'),_0xda5e('0xa')),'defaultValue':_0xda5e('0xa')},'modem':{'type':Sequelize[_0xda5e('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xda5e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xda5e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xda5e('0x6')](_0xda5e('0xe'),'IAX',_0xda5e('0xf'),_0xda5e('0x10')),'defaultValue':_0xda5e('0xe')},'key':{'type':Sequelize[_0xda5e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xda5e('0x11')],'defaultValue':function(){return _0xda5e('0x12');}},'notificationSound':{'type':Sequelize[_0xda5e('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xda5e('0xd')],'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[_0xda5e('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xda5e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xda5e('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xda5e('0x13')],'defaultValue':![],'comment':_0xda5e('0x15'),'set':function(_0xa77c2){if(!_0xa77c2)this['setDataValue'](_0xda5e('0x16'),null);this[_0xda5e('0x17')](_0xda5e('0x18'),_0xa77c2);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3cf6ee9..819af35 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 _0x8ccf=['List','CmContact','updatedAt','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','\x22%s\x22\x20<%s>','fax','Contacts','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','count','Content-Range','apply','save','update','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','filter','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','getInteractions','Contact','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','type','description','Fax\x20Extension','priority','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Set','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList'];(function(_0x130cfa,_0x985245){var _0x36559b=function(_0x446bd6){while(--_0x446bd6){_0x130cfa['push'](_0x130cfa['shift']());}};_0x36559b(++_0x985245);}(_0x8ccf,0xe3));var _0xf8cc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8ccf[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xf8cc('0x0'));var rimraf=require(_0xf8cc('0x1'));var zipdir=require(_0xf8cc('0x2'));var jsonpatch=require(_0xf8cc('0x3'));var rp=require(_0xf8cc('0x4'));var moment=require(_0xf8cc('0x5'));var BPromise=require(_0xf8cc('0x6'));var Mustache=require('mustache');var util=require(_0xf8cc('0x7'));var path=require('path');var sox=require(_0xf8cc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8cc('0x9'));var squel=require(_0xf8cc('0xa'));var crypto=require('crypto');var jsforce=require(_0xf8cc('0xb'));var deskjs=require(_0xf8cc('0xc'));var toCsv=require(_0xf8cc('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8cc('0xe'));var authService=require(_0xf8cc('0xf'));var qs=require(_0xf8cc('0x10'));var as=require(_0xf8cc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf8cc('0x12'));var config=require(_0xf8cc('0x13'));var licenseUtil=require(_0xf8cc('0x14'));var db=require(_0xf8cc('0x15'))['db'];config[_0xf8cc('0x16')]=_[_0xf8cc('0x17')](config[_0xf8cc('0x16')],{'host':_0xf8cc('0x18'),'port':0x18eb});var socket=require(_0xf8cc('0x19'))(new Redis(config['redis']));require(_0xf8cc('0x1a'))[_0xf8cc('0x1b')](socket);var jayson=require(_0xf8cc('0x1c'));var client=jayson[_0xf8cc('0x1d')][_0xf8cc('0x1e')]({'port':0x232c});var client9002=jayson[_0xf8cc('0x1d')][_0xf8cc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x41cd96,_0x3cb9b1,_0x32f845,_0x6d99a1){return new BPromise(function(_0x52e3f1,_0x597bf9){var _0xed456=_0x6d99a1||client;return _0xed456[_0xf8cc('0x1f')](_0x41cd96,_0x32f845)[_0xf8cc('0x20')](function(_0x5ad68a){logger[_0xf8cc('0x21')](_0xf8cc('0x22'),_0x3cb9b1,_0xf8cc('0x23'));logger[_0xf8cc('0x24')](_0xf8cc('0x25'),_0x3cb9b1,_0xf8cc('0x23'),JSON[_0xf8cc('0x26')](_0x5ad68a));if(_0x5ad68a[_0xf8cc('0x27')]){if(_0x5ad68a[_0xf8cc('0x27')][_0xf8cc('0x28')]===0x1f4){logger['error'](_0xf8cc('0x22'),_0x3cb9b1,_0x5ad68a[_0xf8cc('0x27')][_0xf8cc('0x29')]);return _0x597bf9(_0x5ad68a[_0xf8cc('0x27')][_0xf8cc('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x3cb9b1,_0x5ad68a['error'][_0xf8cc('0x29')]);return _0x52e3f1(_0x5ad68a[_0xf8cc('0x27')][_0xf8cc('0x29')]);}else{logger[_0xf8cc('0x21')](_0xf8cc('0x22'),_0x3cb9b1,_0xf8cc('0x23'));_0x52e3f1(_0x5ad68a[_0xf8cc('0x2a')][_0xf8cc('0x29')]);}})[_0xf8cc('0x2b')](function(_0x151243){logger['error'](_0xf8cc('0x22'),_0x3cb9b1,_0x151243);_0x597bf9(_0x151243);});});}function respondWithStatusCode(_0x3a1e4d,_0x1230f3){_0x1230f3=_0x1230f3||0xcc;return function(_0x576fcf){if(_0x576fcf){return _0x3a1e4d[_0xf8cc('0x2c')](_0x1230f3);}return _0x3a1e4d[_0xf8cc('0x2d')](_0x1230f3)[_0xf8cc('0x2e')]();};}function respondWithResult(_0x15943e,_0x151f6e){_0x151f6e=_0x151f6e||0xc8;return function(_0x518d58){if(_0x518d58){return _0x15943e['status'](_0x151f6e)['json'](_0x518d58);}};}function respondWithFilteredResult(_0xf69710,_0x1f3c64){return function(_0x47484b){if(_0x47484b){var _0x4373dd=typeof _0x1f3c64[_0xf8cc('0x2f')]==='undefined'&&typeof _0x1f3c64[_0xf8cc('0x30')]==='undefined';var _0x3cd25b=_0x47484b[_0xf8cc('0x31')];var _0x2cbc86=_0x4373dd?0x0:_0x1f3c64[_0xf8cc('0x2f')];var _0xbbe3e9=_0x4373dd?_0x47484b[_0xf8cc('0x31')]:_0x1f3c64[_0xf8cc('0x2f')]+_0x1f3c64['limit'];var _0x8f9c4e;if(_0xbbe3e9>=_0x3cd25b){_0xbbe3e9=_0x3cd25b;_0x8f9c4e=0xc8;}else{_0x8f9c4e=0xce;}_0xf69710[_0xf8cc('0x2d')](_0x8f9c4e);return _0xf69710['set'](_0xf8cc('0x32'),_0x2cbc86+'-'+_0xbbe3e9+'/'+_0x3cd25b)['json'](_0x47484b);}return null;};}function patchUpdates(_0x25e59e){return function(_0x1214e2){try{jsonpatch[_0xf8cc('0x33')](_0x1214e2,_0x25e59e,!![]);}catch(_0xa30283){return BPromise['reject'](_0xa30283);}return _0x1214e2[_0xf8cc('0x34')]();};}function saveUpdates(_0x1e21fa,_0x3187a6){return function(_0x36cb53){if(_0x36cb53){return _0x36cb53[_0xf8cc('0x35')](_0x1e21fa)['then'](function(_0x21c288){return _0x21c288;});}return null;};}function removeEntity(_0x2a8ce1,_0x306581){return function(_0x1f40b6){if(_0x1f40b6){return _0x1f40b6['destroy']()[_0xf8cc('0x20')](function(){var _0x566c3f=_0x1f40b6[_0xf8cc('0x36')]({'plain':!![]});var _0x14391c='FaxAccounts';return db[_0xf8cc('0x37')][_0xf8cc('0x38')]({'where':{'type':_0x14391c,'resourceId':_0x566c3f['id']}})[_0xf8cc('0x20')](function(){return _0x1f40b6;});})[_0xf8cc('0x20')](function(){_0x2a8ce1[_0xf8cc('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276ac6,_0x49519e){return function(_0x3a7f79){if(!_0x3a7f79){_0x276ac6[_0xf8cc('0x2c')](0x194);}return _0x3a7f79;};}function handleError(_0x4c8441,_0x34d228){_0x34d228=_0x34d228||0x1f4;return function(_0xb623be){logger['error'](_0xb623be[_0xf8cc('0x39')]);if(_0xb623be[_0xf8cc('0x3a')]){delete _0xb623be[_0xf8cc('0x3a')];}_0x4c8441[_0xf8cc('0x2d')](_0x34d228)[_0xf8cc('0x3b')](_0xb623be);};}exports[_0xf8cc('0x3c')]=function(_0x3abc76,_0x30521c){var _0x59f9ce={'include':[{'model':db[_0xf8cc('0x3d')],'as':_0xf8cc('0x3e')}]},_0xbc8fb9={},_0x1c9fe8={'count':0x0,'rows':[]};var _0x56c278=_[_0xf8cc('0x3f')](db[_0xf8cc('0x40')][_0xf8cc('0x41')],function(_0x4affea){return{'name':_0x4affea[_0xf8cc('0x42')],'type':_0x4affea['type'][_0xf8cc('0x43')]};});_0xbc8fb9[_0xf8cc('0x44')]=_[_0xf8cc('0x3f')](_0x56c278,_0xf8cc('0x3a'));_0xbc8fb9['query']=_[_0xf8cc('0x45')](_0x3abc76[_0xf8cc('0x46')]);_0xbc8fb9[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0xbc8fb9[_0xf8cc('0x44')],_0xbc8fb9['query']);_0x59f9ce[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0xbc8fb9[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x3abc76[_0xf8cc('0x46')][_0xf8cc('0x4a')]));_0x59f9ce[_0xf8cc('0x49')]=_0x59f9ce[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x59f9ce[_0xf8cc('0x49')]:_0xbc8fb9['model'];if(!_0x3abc76[_0xf8cc('0x46')][_0xf8cc('0x4c')]('nolimit')){_0x59f9ce['limit']=qs[_0xf8cc('0x30')](_0x3abc76['query'][_0xf8cc('0x30')]);_0x59f9ce[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x3abc76[_0xf8cc('0x46')][_0xf8cc('0x2f')]);}_0x59f9ce[_0xf8cc('0x4d')]=qs['sort'](_0x3abc76['query'][_0xf8cc('0x4e')]);_0x59f9ce[_0xf8cc('0x4f')]=qs[_0xf8cc('0x47')](_[_0xf8cc('0x50')](_0x3abc76[_0xf8cc('0x46')],_0xbc8fb9[_0xf8cc('0x47')]),_0x56c278);if(_0x3abc76[_0xf8cc('0x46')]['filter']){_0x59f9ce['where']=_['merge'](_0x59f9ce['where'],{'$or':_[_0xf8cc('0x3f')](_0x56c278,function(_0x9dbca6){if(_0x9dbca6['type']!==_0xf8cc('0x51')){var _0x1a8442={};_0x1a8442[_0x9dbca6['name']]={'$like':'%'+_0x3abc76['query']['filter']+'%'};return _0x1a8442;}})});}_0x59f9ce=_[_0xf8cc('0x52')]({},_0x59f9ce,_0x3abc76[_0xf8cc('0x53')]);var _0x2b6848={'where':_0x59f9ce['where']};return db[_0xf8cc('0x40')]['count'](_0x2b6848)['then'](function(_0x473658){_0x1c9fe8[_0xf8cc('0x31')]=_0x473658;if(_0x3abc76[_0xf8cc('0x46')][_0xf8cc('0x54')]){_0x59f9ce['include']=[{'all':!![]}];}return db[_0xf8cc('0x40')][_0xf8cc('0x55')](_0x59f9ce);})[_0xf8cc('0x20')](function(_0x5e1e6d){_0x1c9fe8[_0xf8cc('0x56')]=_0x5e1e6d;return _0x1c9fe8;})[_0xf8cc('0x20')](respondWithFilteredResult(_0x30521c,_0x59f9ce))[_0xf8cc('0x2b')](handleError(_0x30521c,null));};exports[_0xf8cc('0x57')]=function(_0x4a599a,_0x2daf33){var _0x28efca={'raw':![],'where':{'id':_0x4a599a[_0xf8cc('0x58')]['id']},'include':[{'model':db[_0xf8cc('0x3d')],'as':_0xf8cc('0x3e')}]},_0x4712b6={};_0x4712b6[_0xf8cc('0x44')]=_[_0xf8cc('0x45')](db[_0xf8cc('0x40')]['rawAttributes']);_0x4712b6[_0xf8cc('0x46')]=_[_0xf8cc('0x45')](_0x4a599a[_0xf8cc('0x46')]);_0x4712b6[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0x4712b6[_0xf8cc('0x44')],_0x4712b6[_0xf8cc('0x46')]);_0x28efca[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x4712b6[_0xf8cc('0x44')],qs['fields'](_0x4a599a[_0xf8cc('0x46')]['fields']));_0x28efca['attributes']=_0x28efca[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x28efca[_0xf8cc('0x49')]:_0x4712b6[_0xf8cc('0x44')];if(_0x4a599a[_0xf8cc('0x46')][_0xf8cc('0x54')]){_0x28efca[_0xf8cc('0x59')]=[{'all':!![]}];}_0x28efca=_[_0xf8cc('0x52')]({},_0x28efca,_0x4a599a[_0xf8cc('0x53')]);return db[_0xf8cc('0x40')][_0xf8cc('0x5a')](_0x28efca)[_0xf8cc('0x20')](handleEntityNotFound(_0x2daf33,null))[_0xf8cc('0x20')](respondWithResult(_0x2daf33,null))['catch'](handleError(_0x2daf33,null));};exports[_0xf8cc('0x5b')]=function(_0x3a7ae8,_0x26f401){return db[_0xf8cc('0x40')][_0xf8cc('0x5b')](_0x3a7ae8[_0xf8cc('0x5c')],{})[_0xf8cc('0x20')](function(_0x216b22){var _0x17107e=_0x3a7ae8[_0xf8cc('0x5d')]['get']({'plain':!![]});if(!_0x17107e)throw new Error(_0xf8cc('0x5e'));if(_0x17107e[_0xf8cc('0x5f')]===_0xf8cc('0x5d')){var _0x36ab70=_0x216b22[_0xf8cc('0x36')]({'plain':!![]});var _0x5af649='FaxAccounts';return db[_0xf8cc('0x60')][_0xf8cc('0x5a')]({'where':{'name':_0x5af649,'userProfileId':_0x17107e['userProfileId']},'raw':!![]})[_0xf8cc('0x20')](function(_0x1481fa){if(_0x1481fa&&_0x1481fa[_0xf8cc('0x61')]===0x0){return db['UserProfileResource'][_0xf8cc('0x5b')]({'name':_0x36ab70[_0xf8cc('0x3a')],'resourceId':_0x36ab70['id'],'type':_0x1481fa[_0xf8cc('0x3a')],'sectionId':_0x1481fa['id']},{})['then'](function(){return _0x216b22;});}else{return _0x216b22;}})[_0xf8cc('0x2b')](function(_0x48b97d){logger[_0xf8cc('0x27')](_0xf8cc('0x62'),_0x48b97d);throw _0x48b97d;});}return _0x216b22;})['then'](respondWithResult(_0x26f401,0xc9))[_0xf8cc('0x2b')](handleError(_0x26f401,null));};exports[_0xf8cc('0x35')]=function(_0x81fef8,_0x47ebf0){if(_0x81fef8['body']['id']){delete _0x81fef8['body']['id'];}return db['FaxAccount'][_0xf8cc('0x5a')]({'where':{'id':_0x81fef8[_0xf8cc('0x58')]['id']},'include':[{'model':db[_0xf8cc('0x3d')],'as':_0xf8cc('0x3e')}]})[_0xf8cc('0x20')](handleEntityNotFound(_0x47ebf0,null))[_0xf8cc('0x20')](saveUpdates(_0x81fef8['body'],null))[_0xf8cc('0x20')](respondWithResult(_0x47ebf0,null))[_0xf8cc('0x2b')](handleError(_0x47ebf0,null));};exports[_0xf8cc('0x38')]=function(_0x5a2cc2,_0x5512f4){return db['FaxAccount'][_0xf8cc('0x5a')]({'where':{'id':_0x5a2cc2[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x5512f4,null))['then'](removeEntity(_0x5512f4,null))['catch'](handleError(_0x5512f4,null));};exports[_0xf8cc('0x63')]=function(_0x169627,_0x4da65f){return db['FaxAccount'][_0xf8cc('0x63')]()[_0xf8cc('0x20')](respondWithResult(_0x4da65f,null))[_0xf8cc('0x2b')](handleError(_0x4da65f,null));};exports[_0xf8cc('0x64')]=function(_0x1836be,_0x51d22a,_0x55497a){if(_0x1836be[_0xf8cc('0x5c')]['id']){delete _0x1836be[_0xf8cc('0x5c')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x1836be['params']['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x51d22a,null))[_0xf8cc('0x20')](function(_0x345d9d){if(_0x345d9d){_0x1836be['body'][_0xf8cc('0x65')]=_0x345d9d['id'];return db[_0xf8cc('0x66')]['create'](_0x1836be[_0xf8cc('0x5c')]);}})['then'](respondWithResult(_0x51d22a,null))['catch'](handleError(_0x51d22a,null));};exports[_0xf8cc('0x67')]=function(_0x35c5cd,_0x2c7abc,_0x1bfdaf){var _0x1c7b2c={'raw':![],'where':{}};var _0x500ae6={};var _0xcfeb67={'count':0x0,'rows':[]};return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x35c5cd[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x2c7abc,null))[_0xf8cc('0x20')](function(_0x591dff){if(_0x591dff){_0x500ae6['model']=_[_0xf8cc('0x45')](db['Disposition'][_0xf8cc('0x41')]);_0x500ae6[_0xf8cc('0x46')]=_[_0xf8cc('0x45')](_0x35c5cd[_0xf8cc('0x46')]);_0x500ae6[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0x500ae6[_0xf8cc('0x44')],_0x500ae6['query']);_0x1c7b2c[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x500ae6[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x4a')]));_0x1c7b2c[_0xf8cc('0x49')]=_0x1c7b2c[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x1c7b2c[_0xf8cc('0x49')]:_0x500ae6['model'];if(!_0x35c5cd[_0xf8cc('0x46')]['hasOwnProperty'](_0xf8cc('0x69'))){_0x1c7b2c[_0xf8cc('0x30')]=qs[_0xf8cc('0x30')](_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x30')]);_0x1c7b2c[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x2f')]);}_0x1c7b2c[_0xf8cc('0x4d')]=qs[_0xf8cc('0x4e')](_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x4e')]);_0x1c7b2c[_0xf8cc('0x4f')]=qs[_0xf8cc('0x47')](_[_0xf8cc('0x50')](_0x35c5cd['query'],_0x500ae6[_0xf8cc('0x47')]));_0x1c7b2c[_0xf8cc('0x4f')][_0xf8cc('0x65')]=_0x591dff['id'];if(_0x35c5cd[_0xf8cc('0x46')]['filter']){_0x1c7b2c[_0xf8cc('0x4f')]=_[_0xf8cc('0x52')](_0x1c7b2c['where'],{'$or':_[_0xf8cc('0x3f')](_0x1c7b2c['attributes'],function(_0x26faec){var _0x287547={};_0x287547[_0x26faec]={'$like':'%'+_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x6a')]+'%'};return _0x287547;})});}_0x1c7b2c=_['merge']({},_0x1c7b2c,_0x35c5cd[_0xf8cc('0x53')]);return db[_0xf8cc('0x66')]['count']({'where':_0x1c7b2c['where']})[_0xf8cc('0x20')](function(_0x5e2fd8){_0xcfeb67['count']=_0x5e2fd8;if(_0x35c5cd[_0xf8cc('0x46')][_0xf8cc('0x54')]){_0x1c7b2c[_0xf8cc('0x59')]=[{'all':!![]}];}return db[_0xf8cc('0x66')][_0xf8cc('0x55')](_0x1c7b2c);})[_0xf8cc('0x20')](function(_0x124ad9){_0xcfeb67[_0xf8cc('0x56')]=_0x124ad9;return _0xcfeb67;});}})['then'](respondWithFilteredResult(_0x2c7abc,_0x1c7b2c))['catch'](handleError(_0x2c7abc,null));};exports['removeDispositions']=function(_0x4e7d5d,_0x2472ac,_0x3069c5){return db[_0xf8cc('0x40')]['find']({'where':{'id':_0x4e7d5d[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x2472ac,null))['then'](function(_0xbe9b33){if(_0xbe9b33){return _0xbe9b33['removeDispositions'](_0x4e7d5d[_0xf8cc('0x46')][_0xf8cc('0x6b')]);}})[_0xf8cc('0x20')](respondWithStatusCode(_0x2472ac,null))['catch'](handleError(_0x2472ac,null));};exports[_0xf8cc('0x6c')]=function(_0x5d7dbd,_0x48e407,_0x9f2fbc){if(_0x5d7dbd[_0xf8cc('0x5c')]['id']){delete _0x5d7dbd[_0xf8cc('0x5c')]['id'];}return db[_0xf8cc('0x40')][_0xf8cc('0x5a')]({'where':{'id':_0x5d7dbd[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x48e407,null))[_0xf8cc('0x20')](function(_0x3d561f){if(_0x3d561f){_0x5d7dbd[_0xf8cc('0x5c')][_0xf8cc('0x65')]=_0x3d561f['id'];return db[_0xf8cc('0x6d')]['create'](_0x5d7dbd[_0xf8cc('0x5c')]);}})['then'](respondWithResult(_0x48e407,null))['catch'](handleError(_0x48e407,null));};exports[_0xf8cc('0x6e')]=function(_0x5ec080,_0x2b2973,_0x2c1f3c){var _0x590b79={'raw':![],'where':{}};var _0x2d6bc4={};var _0x3febf9={'count':0x0,'rows':[]};return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x5ec080['params']['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x2b2973,null))['then'](function(_0x2aefef){if(_0x2aefef){_0x2d6bc4['model']=_[_0xf8cc('0x45')](db[_0xf8cc('0x6d')][_0xf8cc('0x41')]);_0x2d6bc4[_0xf8cc('0x46')]=_['keys'](_0x5ec080[_0xf8cc('0x46')]);_0x2d6bc4[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0x2d6bc4['model'],_0x2d6bc4[_0xf8cc('0x46')]);_0x590b79[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x2d6bc4[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x5ec080['query'][_0xf8cc('0x4a')]));_0x590b79[_0xf8cc('0x49')]=_0x590b79[_0xf8cc('0x49')]['length']?_0x590b79[_0xf8cc('0x49')]:_0x2d6bc4[_0xf8cc('0x44')];if(!_0x5ec080[_0xf8cc('0x46')]['hasOwnProperty'](_0xf8cc('0x69'))){_0x590b79[_0xf8cc('0x30')]=qs['limit'](_0x5ec080[_0xf8cc('0x46')][_0xf8cc('0x30')]);_0x590b79[_0xf8cc('0x2f')]=qs['offset'](_0x5ec080[_0xf8cc('0x46')][_0xf8cc('0x2f')]);}_0x590b79['order']=qs[_0xf8cc('0x4e')](_0x5ec080['query'][_0xf8cc('0x4e')]);_0x590b79[_0xf8cc('0x4f')]=qs[_0xf8cc('0x47')](_[_0xf8cc('0x50')](_0x5ec080[_0xf8cc('0x46')],_0x2d6bc4[_0xf8cc('0x47')]));_0x590b79['where'][_0xf8cc('0x65')]=_0x2aefef['id'];if(_0x5ec080[_0xf8cc('0x46')][_0xf8cc('0x6a')]){_0x590b79[_0xf8cc('0x4f')]=_[_0xf8cc('0x52')](_0x590b79['where'],{'$or':_[_0xf8cc('0x3f')](_0x590b79['attributes'],function(_0x23c51f){var _0x2de779={};_0x2de779[_0x23c51f]={'$like':'%'+_0x5ec080['query'][_0xf8cc('0x6a')]+'%'};return _0x2de779;})});}_0x590b79=_[_0xf8cc('0x52')]({},_0x590b79,_0x5ec080[_0xf8cc('0x53')]);return db[_0xf8cc('0x6d')]['count']({'where':_0x590b79['where']})[_0xf8cc('0x20')](function(_0x3f6059){_0x3febf9['count']=_0x3f6059;if(_0x5ec080[_0xf8cc('0x46')]['includeAll']){_0x590b79['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf8cc('0x55')](_0x590b79);})[_0xf8cc('0x20')](function(_0x3a9faf){_0x3febf9['rows']=_0x3a9faf;return _0x3febf9;});}})[_0xf8cc('0x20')](respondWithFilteredResult(_0x2b2973,_0x590b79))[_0xf8cc('0x2b')](handleError(_0x2b2973,null));};exports[_0xf8cc('0x6f')]=function(_0xb15f94,_0x4a62da,_0x939251){return db[_0xf8cc('0x40')]['find']({'where':{'id':_0xb15f94[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x4a62da,null))[_0xf8cc('0x20')](function(_0x5995a1){if(_0x5995a1){return _0x5995a1['removeAnswers'](_0xb15f94['query'][_0xf8cc('0x6b')]);}})[_0xf8cc('0x20')](respondWithStatusCode(_0x4a62da,null))[_0xf8cc('0x2b')](handleError(_0x4a62da,null));};exports['addInteraction']=function(_0x435dcd,_0x3b4159,_0x7664d0){return db[_0xf8cc('0x70')]['find']({'where':{'id':_0x435dcd[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x3b4159,null))[_0xf8cc('0x20')](function(_0x84c66b){if(_0x84c66b){return _0x84c66b['addInteraction'](_0x435dcd['body'][_0xf8cc('0x6b')],_['omit'](_0x435dcd[_0xf8cc('0x5c')],[_0xf8cc('0x6b'),'id'])||{});}})[_0xf8cc('0x20')](respondWithResult(_0x3b4159,null))[_0xf8cc('0x2b')](handleError(_0x3b4159,null));};exports[_0xf8cc('0x71')]=function(_0x817260,_0x531242,_0x314b15){var _0x12893b={'raw':![],'where':{}};var _0x261923={};var _0x31cb1f={'count':0x0,'rows':[]};return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x817260['params']['id']}})['then'](handleEntityNotFound(_0x531242,null))[_0xf8cc('0x20')](function(_0x36625d){if(_0x36625d){_0x261923[_0xf8cc('0x44')]=_['keys'](db[_0xf8cc('0x70')][_0xf8cc('0x41')]);_0x261923[_0xf8cc('0x46')]=_[_0xf8cc('0x45')](_0x817260['query']);_0x261923[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0x261923[_0xf8cc('0x44')],_0x261923[_0xf8cc('0x46')]);_0x12893b['attributes']=_['intersection'](_0x261923['model'],qs['fields'](_0x817260[_0xf8cc('0x46')][_0xf8cc('0x4a')]));_0x12893b[_0xf8cc('0x49')]=_0x12893b[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x12893b[_0xf8cc('0x49')]:_0x261923[_0xf8cc('0x44')];if(!_0x817260[_0xf8cc('0x46')][_0xf8cc('0x4c')](_0xf8cc('0x69'))){_0x12893b[_0xf8cc('0x30')]=qs[_0xf8cc('0x30')](_0x817260['query'][_0xf8cc('0x30')]);_0x12893b[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x817260[_0xf8cc('0x46')]['offset']);}_0x12893b[_0xf8cc('0x4d')]=qs[_0xf8cc('0x4e')](_0x817260['query'][_0xf8cc('0x4e')]);_0x12893b[_0xf8cc('0x4f')]=qs['filters'](_['pick'](_0x817260['query'],_0x261923[_0xf8cc('0x47')]));_0x12893b['where']['FaxAccountId']=_0x36625d['id'];if(_0x817260[_0xf8cc('0x46')][_0xf8cc('0x6a')]){_0x12893b[_0xf8cc('0x4f')]=_['merge'](_0x12893b['where'],{'$or':_['map'](_0x12893b[_0xf8cc('0x49')],function(_0x38f0b7){var _0x2358de={};_0x2358de[_0x38f0b7]={'$like':'%'+_0x817260[_0xf8cc('0x46')][_0xf8cc('0x6a')]+'%'};return _0x2358de;})});}_0x12893b=_[_0xf8cc('0x52')]({},_0x12893b,_0x817260['options']);return db[_0xf8cc('0x70')][_0xf8cc('0x31')]({'where':_0x12893b[_0xf8cc('0x4f')]})[_0xf8cc('0x20')](function(_0x5cdc03){_0x31cb1f[_0xf8cc('0x31')]=_0x5cdc03;if(_0x817260['query'][_0xf8cc('0x54')]){_0x12893b[_0xf8cc('0x59')]=[{'model':db['CmContact'],'as':_0xf8cc('0x72'),'required':![]},{'model':db['User'],'as':_0xf8cc('0x73'),'attributes':[_0xf8cc('0x3a'),_0xf8cc('0x74'),'internal'],'required':![]},{'model':db[_0xf8cc('0x75')],'as':'Tags','attributes':['id',_0xf8cc('0x3a'),_0xf8cc('0x76')],'where':_0x817260[_0xf8cc('0x46')]['tag']?{'id':_0x817260[_0xf8cc('0x46')]['tag']}:undefined,'required':_0x817260[_0xf8cc('0x46')][_0xf8cc('0x77')]?!![]:![]}];}return db[_0xf8cc('0x70')][_0xf8cc('0x55')](_0x12893b);})[_0xf8cc('0x20')](function(_0xd8c2db){_0x31cb1f[_0xf8cc('0x56')]=_0xd8c2db;return _0x31cb1f;});}})['then'](respondWithFilteredResult(_0x531242,_0x12893b))[_0xf8cc('0x2b')](handleError(_0x531242,null));};exports[_0xf8cc('0x78')]=function(_0x42e4fe,_0x1c0f63,_0xd4b41c){return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x42e4fe[_0xf8cc('0x58')]['id']}})['then'](handleEntityNotFound(_0x1c0f63,null))['then'](function(_0x3d2d40){if(_0x3d2d40){return db[_0xf8cc('0x79')][_0xf8cc('0x7a')](function(_0xc46a9d){return db[_0xf8cc('0x7b')][_0xf8cc('0x38')]({'where':{'FaxAccountId':_0x42e4fe['params']['id']},'transaction':_0xc46a9d})['then'](function(_0x4d5ae8){var _0x13918d=_['map'](_0x42e4fe[_0xf8cc('0x5c')],function(_0x28da72){_0x28da72[_0xf8cc('0x65')]=_0x42e4fe[_0xf8cc('0x58')]['id'];return _0x28da72;});return db[_0xf8cc('0x7b')][_0xf8cc('0x7c')](_0x13918d,{'transaction':_0xc46a9d});});})[_0xf8cc('0x20')](function(){return db[_0xf8cc('0x7b')][_0xf8cc('0x7d')]({'where':{'FaxAccountId':_0x42e4fe[_0xf8cc('0x58')]['id']},'order':'priority'});});}})[_0xf8cc('0x20')](respondWithResult(_0x1c0f63,null))['catch'](handleError(_0x1c0f63,null));};exports[_0xf8cc('0x7e')]=function(_0x18f3bd,_0x50e890,_0xf1d6a1){var _0x3e89fe={};var _0x46a93e={};var _0xae5dfe;var _0x4ed591;return db[_0xf8cc('0x40')]['findOne']({'where':{'id':_0x18f3bd[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x50e890,null))[_0xf8cc('0x20')](function(_0x46dbc1){if(_0x46dbc1){_0xae5dfe=_0x46dbc1;_0x46a93e[_0xf8cc('0x44')]=_[_0xf8cc('0x45')](db['FaxApplication'][_0xf8cc('0x41')]);_0x46a93e[_0xf8cc('0x46')]=_['keys'](_0x18f3bd[_0xf8cc('0x46')]);_0x46a93e[_0xf8cc('0x47')]=_['intersection'](_0x46a93e[_0xf8cc('0x44')],_0x46a93e['query']);_0x3e89fe[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x46a93e[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x18f3bd[_0xf8cc('0x46')][_0xf8cc('0x4a')]));_0x3e89fe['attributes']=_0x3e89fe[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x3e89fe[_0xf8cc('0x49')]:_0x46a93e['model'];_0x3e89fe['order']=qs[_0xf8cc('0x4e')](_0x18f3bd['query'][_0xf8cc('0x4e')]);_0x3e89fe[_0xf8cc('0x4f')]=qs[_0xf8cc('0x47')](_[_0xf8cc('0x50')](_0x18f3bd['query'],_0x46a93e['filters']));if(_0x18f3bd['query'][_0xf8cc('0x6a')]){_0x3e89fe['where']=_[_0xf8cc('0x52')](_0x3e89fe['where'],{'$or':_['map'](_0x3e89fe[_0xf8cc('0x49')],function(_0x699e4c){var _0x1beaa9={};_0x1beaa9[_0x699e4c]={'$like':'%'+_0x18f3bd[_0xf8cc('0x46')][_0xf8cc('0x6a')]+'%'};return _0x1beaa9;})});}_0x3e89fe=_['merge']({},_0x3e89fe,_0x18f3bd[_0xf8cc('0x53')]);return _0xae5dfe[_0xf8cc('0x7e')](_0x3e89fe);}})[_0xf8cc('0x20')](function(_0x5d8b69){if(_0x5d8b69){_0x4ed591=_0x5d8b69[_0xf8cc('0x4b')];if(!_0x18f3bd[_0xf8cc('0x46')][_0xf8cc('0x4c')]('nolimit')){_0x3e89fe[_0xf8cc('0x30')]=qs[_0xf8cc('0x30')](_0x18f3bd[_0xf8cc('0x46')][_0xf8cc('0x30')]);_0x3e89fe[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x18f3bd[_0xf8cc('0x46')]['offset']);}return _0xae5dfe['getApplications'](_0x3e89fe);}})[_0xf8cc('0x20')](function(_0x4cc9bf){if(_0x4cc9bf){return _0x4cc9bf?{'count':_0x4ed591,'rows':_0x4cc9bf}:null;}})[_0xf8cc('0x20')](respondWithResult(_0x50e890,null))['catch'](handleError(_0x50e890,null));};function Extension(_0xe796e3,_0x47956e,_0x1a4a73,_0x108e82){this[_0xf8cc('0x7f')]=_0xf8cc('0x80');this[_0xf8cc('0x81')]=_0xe796e3[_0xf8cc('0x82')];this['app']=_0x108e82;this[_0xf8cc('0x83')]='system';this[_0xf8cc('0x84')]=_0xf8cc('0x85');this[_0xf8cc('0x65')]=_0xe796e3['id'];this[_0xf8cc('0x86')]=_0x47956e;this['appdata']=_0x1a4a73;}function createExtensionsReciveFax(_0x3e4d1e){var _0x4a7612=0x1;var _0x3b873b=[];_0x3b873b[_0xf8cc('0x87')](new Extension(_0x3e4d1e,_0x4a7612,'',_0xf8cc('0x88')));_0x4a7612+=0x1;_0x3b873b[_0xf8cc('0x87')](new Extension(_0x3e4d1e,_0x4a7612,_0xf8cc('0x89'),'Set'));_0x4a7612+=0x1;for(var _0x2edede in _0x3e4d1e){if(_0x3e4d1e['hasOwnProperty'](_0x2edede)&&(_0x2edede===_0xf8cc('0x8a')||_0x2edede===_0xf8cc('0x82')||_0x2edede===_0xf8cc('0x8b')||_0x2edede===_0xf8cc('0x8c')||_0x2edede===_0xf8cc('0x8d')||_0x2edede===_0xf8cc('0x8e')||_0x2edede===_0xf8cc('0x8f')||_0x2edede===_0xf8cc('0x90')||_0x2edede===_0xf8cc('0x91'))){_0x3b873b[_0xf8cc('0x87')](new Extension(_0x3e4d1e,_0x4a7612,'FAXOPT('+_0x2edede+')='+_0x3e4d1e[_0x2edede],_0xf8cc('0x92')));_0x4a7612+=0x1;}}_0x3b873b[_0xf8cc('0x87')](new Extension(_0x3e4d1e,_0x4a7612,'6','Wait'));_0x4a7612+=0x1;_0x3b873b[_0xf8cc('0x87')](new Extension(_0x3e4d1e,_0x4a7612,'/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',_0xf8cc('0x93')));_0x4a7612=0x0;return _0x3b873b;}exports[_0xf8cc('0x94')]=function(_0x4df027,_0x30a3ff,_0x41c683){var _0x157483;return db[_0xf8cc('0x79')][_0xf8cc('0x7a')](function(_0x33005c){return db[_0xf8cc('0x40')][_0xf8cc('0x5b')](_0x4df027[_0xf8cc('0x5c')],{'transaction':_0x33005c})[_0xf8cc('0x20')](function(_0x12721b){_0x157483=_0x12721b['get']({'plain':!![]});return db[_0xf8cc('0x95')][_0xf8cc('0x7c')](createExtensionsReciveFax(_0x157483),{'transaction':_0x33005c});});})[_0xf8cc('0x20')](function(){return _0x157483;})[_0xf8cc('0x20')](respondWithResult(_0x30a3ff,null))[_0xf8cc('0x2b')](handleError(_0x30a3ff,null));};exports[_0xf8cc('0x96')]=function(_0x4a084a,_0x10c3f5,_0x21b86d){var _0x5a0a15;return db['sequelize']['transaction'](function(_0xcdf795){return db[_0xf8cc('0x40')]['update'](_0x4a084a[_0xf8cc('0x5c')],{'where':{'id':_0x4a084a[_0xf8cc('0x5c')]['id']},'transaction':_0xcdf795})[_0xf8cc('0x20')](function(_0x55a429){return db[_0xf8cc('0x95')][_0xf8cc('0x38')]({'where':{'FaxAccountId':_0x4a084a[_0xf8cc('0x5c')]['id']},'transaction':_0xcdf795})['then'](function(_0x13cec1){return db[_0xf8cc('0x95')][_0xf8cc('0x7c')](createExtensionsReciveFax(_[_0xf8cc('0x97')](_0x4a084a['body'],[_0xf8cc('0x98'),_0xf8cc('0x43'),_0xf8cc('0x99'),'updatedAt',_0xf8cc('0x9a'),'ListId'])),{'transaction':_0xcdf795});});});})[_0xf8cc('0x20')](function(){return db[_0xf8cc('0x40')][_0xf8cc('0x9b')](_0x4a084a['body']['id']);})['then'](respondWithResult(_0x10c3f5,null))[_0xf8cc('0x2b')](handleError(_0x10c3f5,null));};exports[_0xf8cc('0x9c')]=function(_0x198c11,_0x2641ec,_0x88973f){var _0x536da5={'raw':!![],'where':{}};var _0x4248da={};var _0x276091={'count':0x0,'rows':[]};return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x198c11[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x2641ec,null))[_0xf8cc('0x20')](function(_0x5d47a4){if(_0x5d47a4){_0x4248da[_0xf8cc('0x44')]=_[_0xf8cc('0x45')](db[_0xf8cc('0x9d')][_0xf8cc('0x41')]);_0x4248da[_0xf8cc('0x46')]=_[_0xf8cc('0x45')](_0x198c11[_0xf8cc('0x46')]);_0x4248da[_0xf8cc('0x47')]=_[_0xf8cc('0x48')](_0x4248da['model'],_0x4248da['query']);_0x536da5[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x4248da[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x198c11[_0xf8cc('0x46')]['fields']));_0x536da5['attributes']=_0x536da5['attributes'][_0xf8cc('0x4b')]?_0x536da5['attributes']:_0x4248da[_0xf8cc('0x44')];if(!_0x198c11[_0xf8cc('0x46')][_0xf8cc('0x4c')](_0xf8cc('0x69'))){_0x536da5[_0xf8cc('0x30')]=qs[_0xf8cc('0x30')](_0x198c11[_0xf8cc('0x46')]['limit']);_0x536da5[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x198c11[_0xf8cc('0x46')]['offset']);}_0x536da5[_0xf8cc('0x4d')]=qs[_0xf8cc('0x4e')](_0x198c11['query'][_0xf8cc('0x4e')]);_0x536da5[_0xf8cc('0x4f')]=qs[_0xf8cc('0x47')](_['pick'](_0x198c11['query'],_0x4248da['filters']));_0x536da5['where']['FaxAccountId']=_0x5d47a4['id'];if(_0x198c11[_0xf8cc('0x46')]['filter']){_0x536da5[_0xf8cc('0x4f')]=_[_0xf8cc('0x52')](_0x536da5[_0xf8cc('0x4f')],{'$or':_[_0xf8cc('0x3f')](_0x536da5['attributes'],function(_0x334a86){var _0x4ded6a={};_0x4ded6a[_0x334a86]={'$like':'%'+_0x198c11[_0xf8cc('0x46')]['filter']+'%'};return _0x4ded6a;})});}if(_0x198c11[_0xf8cc('0x46')][_0xf8cc('0x9e')]){var _0x39bf12=_0x198c11[_0xf8cc('0x46')]['$gte'][_0xf8cc('0x9f')](',');var _0x176640={};_0x176640[_0x39bf12[0x0]]={'$gte':moment(_0x39bf12[0x1])[_0xf8cc('0xa0')](_0xf8cc('0xa1'))};_0x536da5[_0xf8cc('0x4f')]=_['merge'](_0x536da5[_0xf8cc('0x4f')],_0x176640);}_0x536da5=_[_0xf8cc('0x52')]({},_0x536da5,_0x198c11[_0xf8cc('0x53')]);return db[_0xf8cc('0x9d')][_0xf8cc('0x31')]({'where':_0x536da5[_0xf8cc('0x4f')]})['then'](function(_0x52172f){_0x276091[_0xf8cc('0x31')]=_0x52172f;if(_0x198c11[_0xf8cc('0x46')][_0xf8cc('0x54')]){_0x536da5['include']=[{'all':!![]}];}return db[_0xf8cc('0x9d')][_0xf8cc('0x55')](_0x536da5);})[_0xf8cc('0x20')](function(_0x3d54b6){_0x276091['rows']=_0x3d54b6;return _0x276091;});}})['then'](respondWithFilteredResult(_0x2641ec,_0x536da5))[_0xf8cc('0x2b')](handleError(_0x2641ec,null));};exports[_0xf8cc('0x3b')]=function(_0x4feff5,_0x3a2464,_0x16e303){var _0x45116e,_0x3f8afb={},_0x448edc;if(_0x4feff5[_0xf8cc('0x5c')]['to']){_0x448edc=_0x4feff5['body']['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x4feff5[_0xf8cc('0x58')]['id']},'include':[{'model':db[_0xf8cc('0xa2')],'as':_0xf8cc('0xa3'),'include':[{'model':db[_0xf8cc('0xa4')],'as':'Contacts','where':{'fax':_0x448edc},'limit':0x1,'order':[[_0xf8cc('0xa5'),_0xf8cc('0xa6')]]}]}]})[_0xf8cc('0x20')](handleEntityNotFound(_0x3a2464,null))[_0xf8cc('0x20')](function(_0x290266){_0x45116e=_0x290266;if(_0x4feff5[_0xf8cc('0x5c')][_0xf8cc('0xa7')]&&_0x4feff5[_0xf8cc('0x5c')][_0xf8cc('0xa7')][_0xf8cc('0x4b')]){for(var _0x198b76=0x0;_0x198b76<_0x4feff5[_0xf8cc('0x5c')][_0xf8cc('0xa7')][_0xf8cc('0x4b')];_0x198b76+=0x1){_0x4feff5['body'][_0xf8cc('0xa7')][_0x198b76]={'filename':_0x4feff5['body'][_0xf8cc('0xa7')][_0x198b76]['name'],'id':_0x4feff5['body']['attachments'][_0x198b76]['id'],'path':path[_0xf8cc('0xa8')](config['root'],_0xf8cc('0xa9'),_0x4feff5[_0xf8cc('0x5c')]['attachments'][_0x198b76][_0xf8cc('0xaa')])};}}return respondWithRpcPromise(_0xf8cc('0xab'),_0xf8cc('0xab'),{'FaxAccountId':_[_0xf8cc('0xac')](_0x4feff5[_0xf8cc('0x58')]['id'])?undefined:_0x4feff5[_0xf8cc('0x58')]['id'],'path':_[_0xf8cc('0xac')](_0x4feff5[_0xf8cc('0x5c')]['attachments'][0x0][_0xf8cc('0xad')])?undefined:_0x4feff5[_0xf8cc('0x5c')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x4feff5[_0xf8cc('0x5c')]['to'][0x0])?undefined:_0x4feff5[_0xf8cc('0x5c')]['to'][0x0]},client9002);})[_0xf8cc('0x20')](function(){if(_0x45116e){if(_[_0xf8cc('0xac')](_0x4feff5[_0xf8cc('0x5c')]['from'])){_0x4feff5[_0xf8cc('0x5c')]['from']=util[_0xf8cc('0xa0')](_0xf8cc('0xae'),_0x45116e[_0xf8cc('0x3a')],_0x45116e[_0xf8cc('0xaf')]);}if(_0x45116e[_0xf8cc('0xa3')]){if(_0x45116e[_0xf8cc('0xa3')][_0xf8cc('0xb0')][_0xf8cc('0x4b')]){return _0x45116e[_0xf8cc('0xa3')][_0xf8cc('0xb0')][0x0];}else{return db[_0xf8cc('0xa4')][_0xf8cc('0x5b')](_[_0xf8cc('0x17')](_0x4feff5[_0xf8cc('0x5c')],{'firstName':_0x4feff5[_0xf8cc('0x5c')]['to'][0x0],'phone':_0x4feff5[_0xf8cc('0x5c')]['to'][0x0],'fax':_0x4feff5[_0xf8cc('0x5c')]['to'][0x0],'ListId':_0x45116e[_0xf8cc('0xb1')]}));}}else{throw new Error(_0xf8cc('0xb2'));}}else{throw new Error(_0xf8cc('0xb3'));}})[_0xf8cc('0x20')](function(_0x4345d2){if(_0x4345d2){return db[_0xf8cc('0x70')][_0xf8cc('0x5a')]({'where':{'ContactId':_0x4345d2['id'],'closed':![],'FaxAccountId':_0x45116e['id']}})['then'](function(_0xd5cc3f){if(_0xd5cc3f){return[_0xd5cc3f,![]];}return db[_0xf8cc('0x70')][_0xf8cc('0x5b')]({'UserId':_0x4feff5[_0xf8cc('0x5d')]['id'],'ContactId':_0x4345d2['id'],'FaxAccountId':_0x45116e['id'],'fax':_0x4feff5[_0xf8cc('0x5c')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf8cc('0x52')](_0x4feff5[_0xf8cc('0x5c')],{'read':![],'body':_0x4feff5['body'][_0xf8cc('0xa7')][0x0][_0xf8cc('0xb4')],'FaxAccountId':_0x45116e['id'],'UserId':_0x4feff5[_0xf8cc('0x5d')]['id'],'ContactId':_0x4345d2['id'],'AttachmentId':_0x4feff5[_0xf8cc('0x5c')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xf8cc('0x9d')],'as':_0xf8cc('0xb5')}]})['then'](function(_0x3485ae){return[_0x3485ae,!![]];});});}else{throw new Error(_0xf8cc('0xb6'));}})[_0xf8cc('0xb7')](function(_0xcac776,_0x5d5397){if(_0x5d5397){return _0xcac776;}return db[_0xf8cc('0x9d')][_0xf8cc('0x5b')]({'direction':'out','read':![],'body':_0x4feff5['body'][_0xf8cc('0xa7')][0x0]['filename'],'FaxAccountId':_0x45116e['id'],'FaxInteractionId':_0xcac776['id'],'UserId':_0x4feff5[_0xf8cc('0x5d')]['id'],'ContactId':_0xcac776[_0xf8cc('0xb8')],'AttachmentId':_0x4feff5[_0xf8cc('0x5c')]['attachments'][0x0]['id']})[_0xf8cc('0x20')](function(_0x221ce9){_0xcac776[_0xf8cc('0xb9')][_0xf8cc('0xb5')]=[];_0xcac776[_0xf8cc('0xb9')]['Messages']['push'](_0x221ce9[_0xf8cc('0xb9')]);return _0xcac776;});})[_0xf8cc('0x20')](function(_0x474776){respondWithRpcPromise(_0xf8cc('0xba'),'SendFax',{'FaxAccountId':_['isNil'](_0x4feff5[_0xf8cc('0x58')]['id'])?undefined:_0x4feff5[_0xf8cc('0x58')]['id'],'path':_['isNil'](_0x4feff5[_0xf8cc('0x5c')]['attachments'][0x0][_0xf8cc('0xad')])?undefined:_0x4feff5['body'][_0xf8cc('0xa7')][0x0][_0xf8cc('0xad')],'fax':_[_0xf8cc('0xac')](_0x4feff5['body']['to'][0x0])?undefined:_0x4feff5[_0xf8cc('0x5c')]['to'][0x0],'AttachmentId':_0x4feff5['body']['attachments'][0x0]['id']},client9002)[_0xf8cc('0x20')](function(_0x1c963f){logger[_0xf8cc('0x21')](_0xf8cc('0xbb'),_0x1c963f);})[_0xf8cc('0x2b')](function(_0x4ed9b7){logger[_0xf8cc('0x21')](_0xf8cc('0xbb'),_0x4ed9b7);});return _0x474776;})[_0xf8cc('0x20')](respondWithResult(_0x3a2464,null))[_0xf8cc('0x2b')](handleError(_0x3a2464,null));};exports[_0xf8cc('0xbc')]=function(_0x281278,_0x174527,_0xe0fcc0){return db[_0xf8cc('0x40')][_0xf8cc('0x5a')]({'where':{'id':_0x281278[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x174527,null))[_0xf8cc('0x20')](function(_0xd3dcfe){if(_0xd3dcfe){return _0xd3dcfe['addAgents'](_0x281278[_0xf8cc('0x5c')]['ids'],_[_0xf8cc('0x97')](_0x281278[_0xf8cc('0x5c')],[_0xf8cc('0x6b'),'id'])||{})[_0xf8cc('0xb7')](function(_0x586793){for(var _0x5b327c=0x0;_0x5b327c<_0x281278['body'][_0xf8cc('0x6b')]['length'];_0x5b327c+=0x1){socket['emit'](_0xf8cc('0xbd'),{'UserId':Number(_0x281278[_0xf8cc('0x5c')][_0xf8cc('0x6b')][_0x5b327c]),'FaxAccountId':Number(_0x281278[_0xf8cc('0x58')]['id'])});}return _0x586793;});}})[_0xf8cc('0x20')](respondWithResult(_0x174527,null))['catch'](handleError(_0x174527,null));};exports[_0xf8cc('0xbe')]=function(_0x35024b,_0xc03bec,_0x5aaf87){return db['FaxAccount'][_0xf8cc('0x5a')]({'where':{'id':_0x35024b[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0xc03bec,null))[_0xf8cc('0x20')](function(_0x30eb3a){if(_0x30eb3a){return _0x30eb3a[_0xf8cc('0xbe')](_0x35024b[_0xf8cc('0x46')][_0xf8cc('0x6b')])[_0xf8cc('0x20')](function(){if(_[_0xf8cc('0xbf')](_0x35024b[_0xf8cc('0x46')][_0xf8cc('0x6b')])){for(var _0x4b41ce=0x0;_0x4b41ce<_0x35024b[_0xf8cc('0x46')][_0xf8cc('0x6b')][_0xf8cc('0x4b')];_0x4b41ce+=0x1){socket['emit'](_0xf8cc('0xc0'),{'UserId':Number(_0x35024b[_0xf8cc('0x46')][_0xf8cc('0x6b')][_0x4b41ce]),'FaxAccountId':Number(_0x35024b['params']['id'])});}}else{socket[_0xf8cc('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x35024b[_0xf8cc('0x46')]['ids']),'FaxAccountId':Number(_0x35024b[_0xf8cc('0x58')]['id'])});}});}})[_0xf8cc('0x20')](respondWithStatusCode(_0xc03bec,null))['catch'](handleError(_0xc03bec,null));};exports['getAgents']=function(_0x5dbaba,_0x5c878e,_0x18aa15){var _0x1c02d8={};var _0x221a40={};var _0x71ec3e;var _0x53a205;return db[_0xf8cc('0x40')][_0xf8cc('0x68')]({'where':{'id':_0x5dbaba[_0xf8cc('0x58')]['id']}})[_0xf8cc('0x20')](handleEntityNotFound(_0x5c878e,null))[_0xf8cc('0x20')](function(_0x58235c){if(_0x58235c){_0x71ec3e=_0x58235c;_0x221a40[_0xf8cc('0x44')]=_[_0xf8cc('0x45')](db['User'][_0xf8cc('0x41')]);_0x221a40[_0xf8cc('0x46')]=_[_0xf8cc('0x45')](_0x5dbaba['query']);_0x221a40['filters']=_[_0xf8cc('0x48')](_0x221a40[_0xf8cc('0x44')],_0x221a40[_0xf8cc('0x46')]);_0x1c02d8[_0xf8cc('0x49')]=_[_0xf8cc('0x48')](_0x221a40[_0xf8cc('0x44')],qs[_0xf8cc('0x4a')](_0x5dbaba[_0xf8cc('0x46')]['fields']));_0x1c02d8['attributes']=_0x1c02d8[_0xf8cc('0x49')][_0xf8cc('0x4b')]?_0x1c02d8[_0xf8cc('0x49')]:_0x221a40[_0xf8cc('0x44')];_0x1c02d8[_0xf8cc('0x4d')]=qs[_0xf8cc('0x4e')](_0x5dbaba[_0xf8cc('0x46')][_0xf8cc('0x4e')]);_0x1c02d8[_0xf8cc('0x4f')]=qs['filters'](_['pick'](_0x5dbaba[_0xf8cc('0x46')],_0x221a40[_0xf8cc('0x47')]));if(_0x5dbaba[_0xf8cc('0x46')][_0xf8cc('0x6a')]){_0x1c02d8['where']=_[_0xf8cc('0x52')](_0x1c02d8[_0xf8cc('0x4f')],{'$or':_[_0xf8cc('0x3f')](_0x1c02d8[_0xf8cc('0x49')],function(_0xbc2835){var _0x2489ea={};_0x2489ea[_0xbc2835]={'$like':'%'+_0x5dbaba[_0xf8cc('0x46')][_0xf8cc('0x6a')]+'%'};return _0x2489ea;})});}_0x1c02d8=_['merge']({},_0x1c02d8,_0x5dbaba[_0xf8cc('0x53')]);return _0x71ec3e[_0xf8cc('0xc2')](_0x1c02d8);}})[_0xf8cc('0x20')](function(_0x153e23){if(_0x153e23){_0x53a205=_0x153e23[_0xf8cc('0x4b')];if(!_0x5dbaba['query'][_0xf8cc('0x4c')]('nolimit')){_0x1c02d8[_0xf8cc('0x30')]=qs[_0xf8cc('0x30')](_0x5dbaba[_0xf8cc('0x46')]['limit']);_0x1c02d8[_0xf8cc('0x2f')]=qs[_0xf8cc('0x2f')](_0x5dbaba[_0xf8cc('0x46')][_0xf8cc('0x2f')]);}return _0x71ec3e[_0xf8cc('0xc2')](_0x1c02d8);}})['then'](function(_0x3b6498){if(_0x3b6498){return _0x3b6498?{'count':_0x53a205,'rows':_0x3b6498}:null;}})[_0xf8cc('0x20')](respondWithResult(_0x5c878e,null))[_0xf8cc('0x2b')](handleError(_0x5c878e,null));}; \ No newline at end of file +var _0xb3b4=['system','description','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','maxrate','minrate','modem','FAXOPT(','Wait','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','update','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','status','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','show','Pause','keys','rawAttributes','includeAll','include','find','create','body','user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','params','describe','addDisposition','Disposition','getDispositions','order','FaxAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','length','CmContact','User','Owner','fullname','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','exten','localstationid','app','type'];(function(_0x375e43,_0x5f3c3c){var _0x3db724=function(_0x4f9db5){while(--_0x4f9db5){_0x375e43['push'](_0x375e43['shift']());}};_0x3db724(++_0x5f3c3c);}(_0xb3b4,0xfd));var _0x4b3b=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xb3b4[_0x279d37];return _0x530173;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b3b('0x0'));var zipdir=require(_0x4b3b('0x1'));var jsonpatch=require(_0x4b3b('0x2'));var rp=require(_0x4b3b('0x3'));var moment=require(_0x4b3b('0x4'));var BPromise=require(_0x4b3b('0x5'));var Mustache=require(_0x4b3b('0x6'));var util=require(_0x4b3b('0x7'));var path=require(_0x4b3b('0x8'));var sox=require(_0x4b3b('0x9'));var csv=require('to-csv');var ejs=require(_0x4b3b('0xa'));var fs=require('fs');var fs_extra=require(_0x4b3b('0xb'));var _=require(_0x4b3b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b3b('0xd'));var deskjs=require(_0x4b3b('0xe'));var toCsv=require(_0x4b3b('0xf'));var querystring=require(_0x4b3b('0x10'));var Papa=require(_0x4b3b('0x11'));var Redis=require(_0x4b3b('0x12'));var authService=require(_0x4b3b('0x13'));var qs=require(_0x4b3b('0x14'));var as=require(_0x4b3b('0x15'));var hardwareService=require(_0x4b3b('0x16'));var logger=require(_0x4b3b('0x17'))(_0x4b3b('0x18'));var utils=require(_0x4b3b('0x19'));var config=require(_0x4b3b('0x1a'));var licenseUtil=require(_0x4b3b('0x1b'));var db=require('../../mysqldb')['db'];config[_0x4b3b('0x1c')]=_[_0x4b3b('0x1d')](config[_0x4b3b('0x1c')],{'host':_0x4b3b('0x1e'),'port':0x18eb});var socket=require(_0x4b3b('0x1f'))(new Redis(config[_0x4b3b('0x1c')]));require(_0x4b3b('0x20'))[_0x4b3b('0x21')](socket);var jayson=require(_0x4b3b('0x22'));var client=jayson[_0x4b3b('0x23')][_0x4b3b('0x24')]({'port':0x232c});var client9002=jayson[_0x4b3b('0x23')][_0x4b3b('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x4bfde3,_0x3e97b7,_0x5254bd,_0x1b891d){return new BPromise(function(_0x5d4b07,_0x399b50){var _0x1b047b=_0x1b891d||client;return _0x1b047b['request'](_0x4bfde3,_0x5254bd)[_0x4b3b('0x25')](function(_0x49fec2){logger[_0x4b3b('0x26')](_0x4b3b('0x27'),_0x3e97b7,_0x4b3b('0x28'));logger[_0x4b3b('0x29')](_0x4b3b('0x2a'),_0x3e97b7,'request\x20sent',JSON['stringify'](_0x49fec2));if(_0x49fec2[_0x4b3b('0x2b')]){if(_0x49fec2[_0x4b3b('0x2b')][_0x4b3b('0x2c')]===0x1f4){logger[_0x4b3b('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x3e97b7,_0x49fec2[_0x4b3b('0x2b')][_0x4b3b('0x2d')]);return _0x399b50(_0x49fec2['error'][_0x4b3b('0x2d')]);}logger[_0x4b3b('0x2b')](_0x4b3b('0x27'),_0x3e97b7,_0x49fec2[_0x4b3b('0x2b')][_0x4b3b('0x2d')]);return _0x5d4b07(_0x49fec2[_0x4b3b('0x2b')]['message']);}else{logger[_0x4b3b('0x26')]('FaxAccount,\x20%s,\x20%s',_0x3e97b7,'request\x20sent');_0x5d4b07(_0x49fec2[_0x4b3b('0x2e')][_0x4b3b('0x2d')]);}})['catch'](function(_0x46a75c){logger[_0x4b3b('0x2b')](_0x4b3b('0x27'),_0x3e97b7,_0x46a75c);_0x399b50(_0x46a75c);});});}function respondWithStatusCode(_0xe30ad5,_0x39980b){_0x39980b=_0x39980b||0xcc;return function(_0x23a38d){if(_0x23a38d){return _0xe30ad5['sendStatus'](_0x39980b);}return _0xe30ad5['status'](_0x39980b)['end']();};}function respondWithResult(_0x398b5e,_0x34c362){_0x34c362=_0x34c362||0xc8;return function(_0x5d5a92){if(_0x5d5a92){return _0x398b5e['status'](_0x34c362)['json'](_0x5d5a92);}};}function respondWithFilteredResult(_0x4610a3,_0x2e32b5){return function(_0x23b872){if(_0x23b872){var _0x4e93ec=typeof _0x2e32b5[_0x4b3b('0x2f')]===_0x4b3b('0x30')&&typeof _0x2e32b5[_0x4b3b('0x31')]===_0x4b3b('0x30');var _0xe4fc91=_0x23b872[_0x4b3b('0x32')];var _0x33a683=_0x4e93ec?0x0:_0x2e32b5[_0x4b3b('0x2f')];var _0x4eba35=_0x4e93ec?_0x23b872[_0x4b3b('0x32')]:_0x2e32b5[_0x4b3b('0x2f')]+_0x2e32b5[_0x4b3b('0x31')];var _0x1479ac;if(_0x4eba35>=_0xe4fc91){_0x4eba35=_0xe4fc91;_0x1479ac=0xc8;}else{_0x1479ac=0xce;}_0x4610a3['status'](_0x1479ac);return _0x4610a3['set'](_0x4b3b('0x33'),_0x33a683+'-'+_0x4eba35+'/'+_0xe4fc91)[_0x4b3b('0x34')](_0x23b872);}return null;};}function patchUpdates(_0x2084db){return function(_0x12314f){try{jsonpatch[_0x4b3b('0x35')](_0x12314f,_0x2084db,!![]);}catch(_0x349de0){return BPromise[_0x4b3b('0x36')](_0x349de0);}return _0x12314f[_0x4b3b('0x37')]();};}function saveUpdates(_0xe5ccf9,_0x3a91ea){return function(_0x1d9484){if(_0x1d9484){return _0x1d9484['update'](_0xe5ccf9)[_0x4b3b('0x25')](function(_0x203b7c){return _0x203b7c;});}return null;};}function removeEntity(_0x2c566f,_0x2a7168){return function(_0x267ccc){if(_0x267ccc){return _0x267ccc[_0x4b3b('0x38')]()[_0x4b3b('0x25')](function(){var _0x397677=_0x267ccc[_0x4b3b('0x39')]({'plain':!![]});var _0x315ec7='FaxAccounts';return db[_0x4b3b('0x3a')]['destroy']({'where':{'type':_0x315ec7,'resourceId':_0x397677['id']}})[_0x4b3b('0x25')](function(){return _0x267ccc;});})[_0x4b3b('0x25')](function(){_0x2c566f[_0x4b3b('0x3b')](0xcc)[_0x4b3b('0x3c')]();});}};}function handleEntityNotFound(_0x4330ef,_0x12d8d4){return function(_0x24b371){if(!_0x24b371){_0x4330ef[_0x4b3b('0x3d')](0x194);}return _0x24b371;};}function handleError(_0x490a4d,_0x174250){_0x174250=_0x174250||0x1f4;return function(_0x186af4){logger['error'](_0x186af4[_0x4b3b('0x3e')]);if(_0x186af4[_0x4b3b('0x3f')]){delete _0x186af4[_0x4b3b('0x3f')];}_0x490a4d[_0x4b3b('0x3b')](_0x174250)[_0x4b3b('0x40')](_0x186af4);};}exports[_0x4b3b('0x41')]=function(_0xc6bb09,_0x5f2008){var _0x92a261={'include':[{'model':db['Pause'],'as':_0x4b3b('0x42')}]},_0x3b45f3={},_0x5e014d={'count':0x0,'rows':[]};var _0x5a737d=_[_0x4b3b('0x43')](db[_0x4b3b('0x44')]['rawAttributes'],function(_0x20c410){return{'name':_0x20c410[_0x4b3b('0x45')],'type':_0x20c410['type'][_0x4b3b('0x46')]};});_0x3b45f3['model']=_[_0x4b3b('0x43')](_0x5a737d,_0x4b3b('0x3f'));_0x3b45f3[_0x4b3b('0x47')]=_['keys'](_0xc6bb09['query']);_0x3b45f3['filters']=_[_0x4b3b('0x48')](_0x3b45f3['model'],_0x3b45f3[_0x4b3b('0x47')]);_0x92a261[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x3b45f3[_0x4b3b('0x4a')],qs['fields'](_0xc6bb09[_0x4b3b('0x47')][_0x4b3b('0x4b')]));_0x92a261[_0x4b3b('0x49')]=_0x92a261[_0x4b3b('0x49')]['length']?_0x92a261[_0x4b3b('0x49')]:_0x3b45f3[_0x4b3b('0x4a')];if(!_0xc6bb09['query'][_0x4b3b('0x4c')](_0x4b3b('0x4d'))){_0x92a261[_0x4b3b('0x31')]=qs[_0x4b3b('0x31')](_0xc6bb09[_0x4b3b('0x47')][_0x4b3b('0x31')]);_0x92a261[_0x4b3b('0x2f')]=qs[_0x4b3b('0x2f')](_0xc6bb09['query']['offset']);}_0x92a261['order']=qs[_0x4b3b('0x4e')](_0xc6bb09[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x92a261[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_[_0x4b3b('0x51')](_0xc6bb09[_0x4b3b('0x47')],_0x3b45f3['filters']),_0x5a737d);if(_0xc6bb09[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x92a261['where']=_[_0x4b3b('0x53')](_0x92a261['where'],{'$or':_[_0x4b3b('0x43')](_0x5a737d,function(_0x126fe2){if(_0x126fe2['type']!==_0x4b3b('0x54')){var _0x3b448a={};_0x3b448a[_0x126fe2[_0x4b3b('0x3f')]]={'$like':'%'+_0xc6bb09[_0x4b3b('0x47')][_0x4b3b('0x52')]+'%'};return _0x3b448a;}})});}_0x92a261=_[_0x4b3b('0x53')]({},_0x92a261,_0xc6bb09[_0x4b3b('0x55')]);var _0x4b36f5={'where':_0x92a261['where']};return db['FaxAccount'][_0x4b3b('0x32')](_0x4b36f5)[_0x4b3b('0x25')](function(_0xbef5a5){_0x5e014d[_0x4b3b('0x32')]=_0xbef5a5;if(_0xc6bb09[_0x4b3b('0x47')]['includeAll']){_0x92a261['include']=[{'all':!![]}];}return db[_0x4b3b('0x44')][_0x4b3b('0x56')](_0x92a261);})[_0x4b3b('0x25')](function(_0x212f7a){_0x5e014d['rows']=_0x212f7a;return _0x5e014d;})['then'](respondWithFilteredResult(_0x5f2008,_0x92a261))[_0x4b3b('0x57')](handleError(_0x5f2008,null));};exports[_0x4b3b('0x58')]=function(_0x297c69,_0x206598){var _0x16a106={'raw':![],'where':{'id':_0x297c69['params']['id']},'include':[{'model':db[_0x4b3b('0x59')],'as':'mandatoryDispositionPause'}]},_0x73c48a={};_0x73c48a['model']=_[_0x4b3b('0x5a')](db[_0x4b3b('0x44')][_0x4b3b('0x5b')]);_0x73c48a[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x297c69['query']);_0x73c48a[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x73c48a[_0x4b3b('0x4a')],_0x73c48a[_0x4b3b('0x47')]);_0x16a106[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x73c48a[_0x4b3b('0x4a')],qs[_0x4b3b('0x4b')](_0x297c69['query'][_0x4b3b('0x4b')]));_0x16a106['attributes']=_0x16a106[_0x4b3b('0x49')]['length']?_0x16a106[_0x4b3b('0x49')]:_0x73c48a[_0x4b3b('0x4a')];if(_0x297c69['query'][_0x4b3b('0x5c')]){_0x16a106[_0x4b3b('0x5d')]=[{'all':!![]}];}_0x16a106=_[_0x4b3b('0x53')]({},_0x16a106,_0x297c69[_0x4b3b('0x55')]);return db[_0x4b3b('0x44')][_0x4b3b('0x5e')](_0x16a106)['then'](handleEntityNotFound(_0x206598,null))[_0x4b3b('0x25')](respondWithResult(_0x206598,null))[_0x4b3b('0x57')](handleError(_0x206598,null));};exports[_0x4b3b('0x5f')]=function(_0x1797d5,_0x27d8d0){return db['FaxAccount']['create'](_0x1797d5[_0x4b3b('0x60')],{})[_0x4b3b('0x25')](function(_0x551a24){var _0x19280d=_0x1797d5[_0x4b3b('0x61')][_0x4b3b('0x39')]({'plain':!![]});if(!_0x19280d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19280d[_0x4b3b('0x62')]===_0x4b3b('0x61')){var _0x4d0182=_0x551a24[_0x4b3b('0x39')]({'plain':!![]});var _0x4c6d59=_0x4b3b('0x63');return db[_0x4b3b('0x64')][_0x4b3b('0x5e')]({'where':{'name':_0x4c6d59,'userProfileId':_0x19280d[_0x4b3b('0x65')]},'raw':!![]})['then'](function(_0x1ec610){if(_0x1ec610&&_0x1ec610[_0x4b3b('0x66')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d0182[_0x4b3b('0x3f')],'resourceId':_0x4d0182['id'],'type':_0x1ec610['name'],'sectionId':_0x1ec610['id']},{})[_0x4b3b('0x25')](function(){return _0x551a24;});}else{return _0x551a24;}})[_0x4b3b('0x57')](function(_0x484c3e){logger[_0x4b3b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x484c3e);throw _0x484c3e;});}return _0x551a24;})[_0x4b3b('0x25')](respondWithResult(_0x27d8d0,0xc9))[_0x4b3b('0x57')](handleError(_0x27d8d0,null));};exports['update']=function(_0x48afe2,_0x195bda){if(_0x48afe2['body']['id']){delete _0x48afe2[_0x4b3b('0x60')]['id'];}return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x48afe2[_0x4b3b('0x67')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x4b3b('0x25')](handleEntityNotFound(_0x195bda,null))['then'](saveUpdates(_0x48afe2['body'],null))['then'](respondWithResult(_0x195bda,null))['catch'](handleError(_0x195bda,null));};exports[_0x4b3b('0x38')]=function(_0x2ab3b7,_0x3579bc){return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x2ab3b7['params']['id']}})['then'](handleEntityNotFound(_0x3579bc,null))[_0x4b3b('0x25')](removeEntity(_0x3579bc,null))[_0x4b3b('0x57')](handleError(_0x3579bc,null));};exports[_0x4b3b('0x68')]=function(_0x1cff8d,_0x2ae16a){return db[_0x4b3b('0x44')][_0x4b3b('0x68')]()[_0x4b3b('0x25')](respondWithResult(_0x2ae16a,null))[_0x4b3b('0x57')](handleError(_0x2ae16a,null));};exports[_0x4b3b('0x69')]=function(_0x45542c,_0x5194aa,_0x2e28d9){if(_0x45542c['body']['id']){delete _0x45542c[_0x4b3b('0x60')]['id'];}return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x45542c[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x5194aa,null))[_0x4b3b('0x25')](function(_0x5daaaf){if(_0x5daaaf){_0x45542c[_0x4b3b('0x60')]['FaxAccountId']=_0x5daaaf['id'];return db[_0x4b3b('0x6a')][_0x4b3b('0x5f')](_0x45542c[_0x4b3b('0x60')]);}})[_0x4b3b('0x25')](respondWithResult(_0x5194aa,null))['catch'](handleError(_0x5194aa,null));};exports[_0x4b3b('0x6b')]=function(_0x497e64,_0x90efba,_0x3d0d24){var _0x5bbe29={'raw':![],'where':{}};var _0x3fa907={};var _0x3ff3b3={'count':0x0,'rows':[]};return db[_0x4b3b('0x44')]['findOne']({'where':{'id':_0x497e64['params']['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x90efba,null))[_0x4b3b('0x25')](function(_0x480607){if(_0x480607){_0x3fa907['model']=_[_0x4b3b('0x5a')](db['Disposition'][_0x4b3b('0x5b')]);_0x3fa907[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x497e64['query']);_0x3fa907[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x3fa907[_0x4b3b('0x4a')],_0x3fa907[_0x4b3b('0x47')]);_0x5bbe29[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x3fa907[_0x4b3b('0x4a')],qs[_0x4b3b('0x4b')](_0x497e64['query'][_0x4b3b('0x4b')]));_0x5bbe29['attributes']=_0x5bbe29['attributes']['length']?_0x5bbe29['attributes']:_0x3fa907[_0x4b3b('0x4a')];if(!_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x4c')](_0x4b3b('0x4d'))){_0x5bbe29[_0x4b3b('0x31')]=qs[_0x4b3b('0x31')](_0x497e64['query']['limit']);_0x5bbe29[_0x4b3b('0x2f')]=qs[_0x4b3b('0x2f')](_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x2f')]);}_0x5bbe29[_0x4b3b('0x6c')]=qs[_0x4b3b('0x4e')](_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x5bbe29['where']=qs[_0x4b3b('0x50')](_[_0x4b3b('0x51')](_0x497e64[_0x4b3b('0x47')],_0x3fa907[_0x4b3b('0x50')]));_0x5bbe29[_0x4b3b('0x4f')][_0x4b3b('0x6d')]=_0x480607['id'];if(_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x5bbe29[_0x4b3b('0x4f')]=_[_0x4b3b('0x53')](_0x5bbe29['where'],{'$or':_[_0x4b3b('0x43')](_0x5bbe29[_0x4b3b('0x49')],function(_0x1c63fe){var _0xf4029b={};_0xf4029b[_0x1c63fe]={'$like':'%'+_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x52')]+'%'};return _0xf4029b;})});}_0x5bbe29=_['merge']({},_0x5bbe29,_0x497e64[_0x4b3b('0x55')]);return db[_0x4b3b('0x6a')][_0x4b3b('0x32')]({'where':_0x5bbe29[_0x4b3b('0x4f')]})[_0x4b3b('0x25')](function(_0x5cc578){_0x3ff3b3[_0x4b3b('0x32')]=_0x5cc578;if(_0x497e64[_0x4b3b('0x47')][_0x4b3b('0x5c')]){_0x5bbe29[_0x4b3b('0x5d')]=[{'all':!![]}];}return db[_0x4b3b('0x6a')][_0x4b3b('0x56')](_0x5bbe29);})['then'](function(_0x2a0cb6){_0x3ff3b3[_0x4b3b('0x6e')]=_0x2a0cb6;return _0x3ff3b3;});}})[_0x4b3b('0x25')](respondWithFilteredResult(_0x90efba,_0x5bbe29))[_0x4b3b('0x57')](handleError(_0x90efba,null));};exports[_0x4b3b('0x6f')]=function(_0x36413d,_0x161698,_0x59312f){return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x36413d[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x161698,null))[_0x4b3b('0x25')](function(_0x5b3265){if(_0x5b3265){return _0x5b3265[_0x4b3b('0x6f')](_0x36413d['query'][_0x4b3b('0x70')]);}})['then'](respondWithStatusCode(_0x161698,null))[_0x4b3b('0x57')](handleError(_0x161698,null));};exports[_0x4b3b('0x71')]=function(_0x1b0b4a,_0x3a8d65,_0x344ab5){if(_0x1b0b4a['body']['id']){delete _0x1b0b4a[_0x4b3b('0x60')]['id'];}return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x1b0b4a[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x3a8d65,null))[_0x4b3b('0x25')](function(_0x3c8905){if(_0x3c8905){_0x1b0b4a['body'][_0x4b3b('0x6d')]=_0x3c8905['id'];return db[_0x4b3b('0x72')][_0x4b3b('0x5f')](_0x1b0b4a[_0x4b3b('0x60')]);}})[_0x4b3b('0x25')](respondWithResult(_0x3a8d65,null))['catch'](handleError(_0x3a8d65,null));};exports['getAnswers']=function(_0x213143,_0x16eb07,_0xfed36b){var _0x2176c4={'raw':![],'where':{}};var _0x18f4bc={};var _0x372668={'count':0x0,'rows':[]};return db[_0x4b3b('0x44')][_0x4b3b('0x73')]({'where':{'id':_0x213143[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x16eb07,null))[_0x4b3b('0x25')](function(_0x25b628){if(_0x25b628){_0x18f4bc[_0x4b3b('0x4a')]=_[_0x4b3b('0x5a')](db['CannedAnswer'][_0x4b3b('0x5b')]);_0x18f4bc[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x213143['query']);_0x18f4bc[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x18f4bc[_0x4b3b('0x4a')],_0x18f4bc['query']);_0x2176c4[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x18f4bc[_0x4b3b('0x4a')],qs[_0x4b3b('0x4b')](_0x213143[_0x4b3b('0x47')][_0x4b3b('0x4b')]));_0x2176c4['attributes']=_0x2176c4[_0x4b3b('0x49')]['length']?_0x2176c4[_0x4b3b('0x49')]:_0x18f4bc['model'];if(!_0x213143[_0x4b3b('0x47')][_0x4b3b('0x4c')]('nolimit')){_0x2176c4[_0x4b3b('0x31')]=qs[_0x4b3b('0x31')](_0x213143['query']['limit']);_0x2176c4[_0x4b3b('0x2f')]=qs[_0x4b3b('0x2f')](_0x213143['query']['offset']);}_0x2176c4[_0x4b3b('0x6c')]=qs['sort'](_0x213143[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x2176c4[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_[_0x4b3b('0x51')](_0x213143[_0x4b3b('0x47')],_0x18f4bc[_0x4b3b('0x50')]));_0x2176c4[_0x4b3b('0x4f')][_0x4b3b('0x6d')]=_0x25b628['id'];if(_0x213143[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x2176c4['where']=_[_0x4b3b('0x53')](_0x2176c4['where'],{'$or':_[_0x4b3b('0x43')](_0x2176c4[_0x4b3b('0x49')],function(_0x4dc60e){var _0x2dc699={};_0x2dc699[_0x4dc60e]={'$like':'%'+_0x213143['query'][_0x4b3b('0x52')]+'%'};return _0x2dc699;})});}_0x2176c4=_[_0x4b3b('0x53')]({},_0x2176c4,_0x213143[_0x4b3b('0x55')]);return db[_0x4b3b('0x72')][_0x4b3b('0x32')]({'where':_0x2176c4[_0x4b3b('0x4f')]})[_0x4b3b('0x25')](function(_0x5d3de8){_0x372668[_0x4b3b('0x32')]=_0x5d3de8;if(_0x213143['query']['includeAll']){_0x2176c4[_0x4b3b('0x5d')]=[{'all':!![]}];}return db[_0x4b3b('0x72')][_0x4b3b('0x56')](_0x2176c4);})[_0x4b3b('0x25')](function(_0x528bf4){_0x372668[_0x4b3b('0x6e')]=_0x528bf4;return _0x372668;});}})[_0x4b3b('0x25')](respondWithFilteredResult(_0x16eb07,_0x2176c4))['catch'](handleError(_0x16eb07,null));};exports[_0x4b3b('0x74')]=function(_0x351f97,_0x1a261b,_0x1cf0f3){return db['FaxAccount']['find']({'where':{'id':_0x351f97[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x1a261b,null))[_0x4b3b('0x25')](function(_0x2498b4){if(_0x2498b4){return _0x2498b4[_0x4b3b('0x74')](_0x351f97[_0x4b3b('0x47')][_0x4b3b('0x70')]);}})[_0x4b3b('0x25')](respondWithStatusCode(_0x1a261b,null))[_0x4b3b('0x57')](handleError(_0x1a261b,null));};exports[_0x4b3b('0x75')]=function(_0x73d7b9,_0x46ff0c,_0x30e83a){return db['FaxInteraction'][_0x4b3b('0x5e')]({'where':{'id':_0x73d7b9[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x46ff0c,null))[_0x4b3b('0x25')](function(_0x19cf98){if(_0x19cf98){return _0x19cf98[_0x4b3b('0x75')](_0x73d7b9[_0x4b3b('0x60')][_0x4b3b('0x70')],_[_0x4b3b('0x76')](_0x73d7b9['body'],['ids','id'])||{});}})[_0x4b3b('0x25')](respondWithResult(_0x46ff0c,null))[_0x4b3b('0x57')](handleError(_0x46ff0c,null));};exports[_0x4b3b('0x77')]=function(_0x1fc73f,_0x40c7ed,_0x567934){var _0x3a7240={'raw':![],'where':{}};var _0x5e326f={};var _0x29efd3={'count':0x0,'rows':[]};return db[_0x4b3b('0x44')][_0x4b3b('0x73')]({'where':{'id':_0x1fc73f[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x40c7ed,null))['then'](function(_0x4a7604){if(_0x4a7604){_0x5e326f['model']=_[_0x4b3b('0x5a')](db[_0x4b3b('0x78')]['rawAttributes']);_0x5e326f[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x1fc73f[_0x4b3b('0x47')]);_0x5e326f[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x5e326f['model'],_0x5e326f[_0x4b3b('0x47')]);_0x3a7240[_0x4b3b('0x49')]=_['intersection'](_0x5e326f[_0x4b3b('0x4a')],qs[_0x4b3b('0x4b')](_0x1fc73f[_0x4b3b('0x47')]['fields']));_0x3a7240['attributes']=_0x3a7240['attributes'][_0x4b3b('0x79')]?_0x3a7240[_0x4b3b('0x49')]:_0x5e326f['model'];if(!_0x1fc73f['query'][_0x4b3b('0x4c')](_0x4b3b('0x4d'))){_0x3a7240[_0x4b3b('0x31')]=qs[_0x4b3b('0x31')](_0x1fc73f[_0x4b3b('0x47')]['limit']);_0x3a7240[_0x4b3b('0x2f')]=qs[_0x4b3b('0x2f')](_0x1fc73f[_0x4b3b('0x47')][_0x4b3b('0x2f')]);}_0x3a7240['order']=qs['sort'](_0x1fc73f[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x3a7240[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_[_0x4b3b('0x51')](_0x1fc73f['query'],_0x5e326f[_0x4b3b('0x50')]));_0x3a7240['where']['FaxAccountId']=_0x4a7604['id'];if(_0x1fc73f[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x3a7240[_0x4b3b('0x4f')]=_['merge'](_0x3a7240['where'],{'$or':_['map'](_0x3a7240[_0x4b3b('0x49')],function(_0x9ac474){var _0x900d1d={};_0x900d1d[_0x9ac474]={'$like':'%'+_0x1fc73f['query']['filter']+'%'};return _0x900d1d;})});}_0x3a7240=_[_0x4b3b('0x53')]({},_0x3a7240,_0x1fc73f[_0x4b3b('0x55')]);return db[_0x4b3b('0x78')][_0x4b3b('0x32')]({'where':_0x3a7240[_0x4b3b('0x4f')]})[_0x4b3b('0x25')](function(_0xcbd8e6){_0x29efd3[_0x4b3b('0x32')]=_0xcbd8e6;if(_0x1fc73f[_0x4b3b('0x47')][_0x4b3b('0x5c')]){_0x3a7240['include']=[{'model':db[_0x4b3b('0x7a')],'as':'Contact','required':![]},{'model':db[_0x4b3b('0x7b')],'as':_0x4b3b('0x7c'),'attributes':[_0x4b3b('0x3f'),_0x4b3b('0x7d'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x4b3b('0x7e'),'attributes':['id','name',_0x4b3b('0x7f')],'where':_0x1fc73f['query'][_0x4b3b('0x80')]?{'id':_0x1fc73f[_0x4b3b('0x47')][_0x4b3b('0x80')]}:undefined,'required':_0x1fc73f['query'][_0x4b3b('0x80')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x3a7240);})[_0x4b3b('0x25')](function(_0x31c08b){_0x29efd3[_0x4b3b('0x6e')]=_0x31c08b;return _0x29efd3;});}})['then'](respondWithFilteredResult(_0x40c7ed,_0x3a7240))['catch'](handleError(_0x40c7ed,null));};exports[_0x4b3b('0x81')]=function(_0x3e8f6f,_0x1191ad,_0x5cd136){return db['FaxAccount'][_0x4b3b('0x73')]({'where':{'id':_0x3e8f6f[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x1191ad,null))[_0x4b3b('0x25')](function(_0x29bc76){if(_0x29bc76){return db['sequelize'][_0x4b3b('0x82')](function(_0x3cb0cd){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x3e8f6f['params']['id']},'transaction':_0x3cb0cd})[_0x4b3b('0x25')](function(_0x3339ce){var _0xad76bb=_[_0x4b3b('0x43')](_0x3e8f6f[_0x4b3b('0x60')],function(_0x4dcfd5){_0x4dcfd5[_0x4b3b('0x6d')]=_0x3e8f6f[_0x4b3b('0x67')]['id'];return _0x4dcfd5;});return db[_0x4b3b('0x83')][_0x4b3b('0x84')](_0xad76bb,{'transaction':_0x3cb0cd});});})[_0x4b3b('0x25')](function(){return db['FaxApplication'][_0x4b3b('0x85')]({'where':{'FaxAccountId':_0x3e8f6f[_0x4b3b('0x67')]['id']},'order':_0x4b3b('0x86')});});}})['then'](respondWithResult(_0x1191ad,null))[_0x4b3b('0x57')](handleError(_0x1191ad,null));};exports['getApplications']=function(_0x2df688,_0x4fe2c7,_0x4af8bf){var _0x420004={};var _0x44f6e0={};var _0x9e060c;var _0x574319;return db['FaxAccount'][_0x4b3b('0x73')]({'where':{'id':_0x2df688[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x4fe2c7,null))[_0x4b3b('0x25')](function(_0x5bcdaa){if(_0x5bcdaa){_0x9e060c=_0x5bcdaa;_0x44f6e0[_0x4b3b('0x4a')]=_[_0x4b3b('0x5a')](db['FaxApplication'][_0x4b3b('0x5b')]);_0x44f6e0[_0x4b3b('0x47')]=_['keys'](_0x2df688[_0x4b3b('0x47')]);_0x44f6e0[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x44f6e0['model'],_0x44f6e0[_0x4b3b('0x47')]);_0x420004[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x44f6e0['model'],qs[_0x4b3b('0x4b')](_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x4b')]));_0x420004[_0x4b3b('0x49')]=_0x420004['attributes'][_0x4b3b('0x79')]?_0x420004[_0x4b3b('0x49')]:_0x44f6e0[_0x4b3b('0x4a')];_0x420004[_0x4b3b('0x6c')]=qs[_0x4b3b('0x4e')](_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x420004[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_['pick'](_0x2df688['query'],_0x44f6e0['filters']));if(_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x420004[_0x4b3b('0x4f')]=_[_0x4b3b('0x53')](_0x420004['where'],{'$or':_[_0x4b3b('0x43')](_0x420004[_0x4b3b('0x49')],function(_0x268c0e){var _0x365c37={};_0x365c37[_0x268c0e]={'$like':'%'+_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x52')]+'%'};return _0x365c37;})});}_0x420004=_[_0x4b3b('0x53')]({},_0x420004,_0x2df688[_0x4b3b('0x55')]);return _0x9e060c[_0x4b3b('0x87')](_0x420004);}})[_0x4b3b('0x25')](function(_0x55fdff){if(_0x55fdff){_0x574319=_0x55fdff[_0x4b3b('0x79')];if(!_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x4c')](_0x4b3b('0x4d'))){_0x420004[_0x4b3b('0x31')]=qs[_0x4b3b('0x31')](_0x2df688['query'][_0x4b3b('0x31')]);_0x420004['offset']=qs['offset'](_0x2df688[_0x4b3b('0x47')][_0x4b3b('0x2f')]);}return _0x9e060c[_0x4b3b('0x87')](_0x420004);}})['then'](function(_0x308ff7){if(_0x308ff7){return _0x308ff7?{'count':_0x574319,'rows':_0x308ff7}:null;}})['then'](respondWithResult(_0x4fe2c7,null))[_0x4b3b('0x57')](handleError(_0x4fe2c7,null));};function Extension(_0x192d9f,_0x368f85,_0x2b0910,_0x4d39b2){this[_0x4b3b('0x88')]='from-voip-provider';this[_0x4b3b('0x89')]=_0x192d9f[_0x4b3b('0x8a')];this[_0x4b3b('0x8b')]=_0x4d39b2;this[_0x4b3b('0x8c')]=_0x4b3b('0x8d');this[_0x4b3b('0x8e')]='Fax\x20Extension';this[_0x4b3b('0x6d')]=_0x192d9f['id'];this[_0x4b3b('0x86')]=_0x368f85;this['appdata']=_0x2b0910;}function createExtensionsReciveFax(_0x311aa8){var _0x4a0ec8=0x1;var _0x5c2eea=[];_0x5c2eea[_0x4b3b('0x8f')](new Extension(_0x311aa8,_0x4a0ec8,'','Answer'));_0x4a0ec8+=0x1;_0x5c2eea[_0x4b3b('0x8f')](new Extension(_0x311aa8,_0x4a0ec8,_0x4b3b('0x90'),_0x4b3b('0x91')));_0x4a0ec8+=0x1;for(var _0x251a25 in _0x311aa8){if(_0x311aa8[_0x4b3b('0x4c')](_0x251a25)&&(_0x251a25==='ecm'||_0x251a25===_0x4b3b('0x8a')||_0x251a25===_0x4b3b('0x92')||_0x251a25===_0x4b3b('0x93')||_0x251a25==='headerinfo'||_0x251a25===_0x4b3b('0x94')||_0x251a25===_0x4b3b('0x95')||_0x251a25===_0x4b3b('0x96')||_0x251a25==='t38timeout')){_0x5c2eea[_0x4b3b('0x8f')](new Extension(_0x311aa8,_0x4a0ec8,_0x4b3b('0x97')+_0x251a25+')='+_0x311aa8[_0x251a25],_0x4b3b('0x91')));_0x4a0ec8+=0x1;}}_0x5c2eea[_0x4b3b('0x8f')](new Extension(_0x311aa8,_0x4a0ec8,'6',_0x4b3b('0x98')));_0x4a0ec8+=0x1;_0x5c2eea['push'](new Extension(_0x311aa8,_0x4a0ec8,'/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'));_0x4a0ec8=0x0;return _0x5c2eea;}exports[_0x4b3b('0x99')]=function(_0x4971d9,_0xa2f2a4,_0xb73d37){var _0x2ad3fb;return db[_0x4b3b('0x9a')][_0x4b3b('0x82')](function(_0x4cab87){return db[_0x4b3b('0x44')]['create'](_0x4971d9[_0x4b3b('0x60')],{'transaction':_0x4cab87})[_0x4b3b('0x25')](function(_0x3e03a1){_0x2ad3fb=_0x3e03a1['get']({'plain':!![]});return db[_0x4b3b('0x9b')][_0x4b3b('0x84')](createExtensionsReciveFax(_0x2ad3fb),{'transaction':_0x4cab87});});})['then'](function(){return _0x2ad3fb;})['then'](respondWithResult(_0xa2f2a4,null))[_0x4b3b('0x57')](handleError(_0xa2f2a4,null));};exports[_0x4b3b('0x9c')]=function(_0x205d06,_0x1c84ab,_0x1f3d67){var _0x4b7ca1;return db[_0x4b3b('0x9a')][_0x4b3b('0x82')](function(_0x5bd7da){return db[_0x4b3b('0x44')][_0x4b3b('0x9d')](_0x205d06[_0x4b3b('0x60')],{'where':{'id':_0x205d06[_0x4b3b('0x60')]['id']},'transaction':_0x5bd7da})[_0x4b3b('0x25')](function(_0x2df1f3){return db[_0x4b3b('0x9b')][_0x4b3b('0x38')]({'where':{'FaxAccountId':_0x205d06[_0x4b3b('0x60')]['id']},'transaction':_0x5bd7da})[_0x4b3b('0x25')](function(_0x146608){return db[_0x4b3b('0x9b')][_0x4b3b('0x84')](createExtensionsReciveFax(_[_0x4b3b('0x76')](_0x205d06[_0x4b3b('0x60')],['tech',_0x4b3b('0x46'),_0x4b3b('0x9e'),_0x4b3b('0x9f'),_0x4b3b('0xa0'),_0x4b3b('0xa1')])),{'transaction':_0x5bd7da});});});})[_0x4b3b('0x25')](function(){return db[_0x4b3b('0x44')][_0x4b3b('0xa2')](_0x205d06[_0x4b3b('0x60')]['id']);})[_0x4b3b('0x25')](respondWithResult(_0x1c84ab,null))[_0x4b3b('0x57')](handleError(_0x1c84ab,null));};exports[_0x4b3b('0xa3')]=function(_0x46c186,_0x4163e9,_0x4d4f54){var _0x545f4a={'raw':!![],'where':{}};var _0x350a3f={};var _0x5994cc={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4b3b('0x73')]({'where':{'id':_0x46c186[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x4163e9,null))['then'](function(_0x1db369){if(_0x1db369){_0x350a3f[_0x4b3b('0x4a')]=_[_0x4b3b('0x5a')](db[_0x4b3b('0xa4')][_0x4b3b('0x5b')]);_0x350a3f[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x46c186[_0x4b3b('0x47')]);_0x350a3f[_0x4b3b('0x50')]=_[_0x4b3b('0x48')](_0x350a3f[_0x4b3b('0x4a')],_0x350a3f[_0x4b3b('0x47')]);_0x545f4a[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x350a3f['model'],qs[_0x4b3b('0x4b')](_0x46c186[_0x4b3b('0x47')][_0x4b3b('0x4b')]));_0x545f4a[_0x4b3b('0x49')]=_0x545f4a[_0x4b3b('0x49')][_0x4b3b('0x79')]?_0x545f4a[_0x4b3b('0x49')]:_0x350a3f[_0x4b3b('0x4a')];if(!_0x46c186['query']['hasOwnProperty'](_0x4b3b('0x4d'))){_0x545f4a[_0x4b3b('0x31')]=qs['limit'](_0x46c186[_0x4b3b('0x47')][_0x4b3b('0x31')]);_0x545f4a['offset']=qs[_0x4b3b('0x2f')](_0x46c186[_0x4b3b('0x47')]['offset']);}_0x545f4a[_0x4b3b('0x6c')]=qs[_0x4b3b('0x4e')](_0x46c186['query'][_0x4b3b('0x4e')]);_0x545f4a[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_['pick'](_0x46c186['query'],_0x350a3f[_0x4b3b('0x50')]));_0x545f4a[_0x4b3b('0x4f')][_0x4b3b('0x6d')]=_0x1db369['id'];if(_0x46c186[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x545f4a[_0x4b3b('0x4f')]=_['merge'](_0x545f4a[_0x4b3b('0x4f')],{'$or':_[_0x4b3b('0x43')](_0x545f4a[_0x4b3b('0x49')],function(_0x56b810){var _0x5295eb={};_0x5295eb[_0x56b810]={'$like':'%'+_0x46c186[_0x4b3b('0x47')][_0x4b3b('0x52')]+'%'};return _0x5295eb;})});}if(_0x46c186[_0x4b3b('0x47')][_0x4b3b('0xa5')]){var _0x108902=_0x46c186[_0x4b3b('0x47')]['$gte']['split'](',');var _0x2eb604={};_0x2eb604[_0x108902[0x0]]={'$gte':moment(_0x108902[0x1])[_0x4b3b('0xa6')](_0x4b3b('0xa7'))};_0x545f4a[_0x4b3b('0x4f')]=_[_0x4b3b('0x53')](_0x545f4a[_0x4b3b('0x4f')],_0x2eb604);}_0x545f4a=_['merge']({},_0x545f4a,_0x46c186[_0x4b3b('0x55')]);return db['FaxMessage'][_0x4b3b('0x32')]({'where':_0x545f4a[_0x4b3b('0x4f')]})[_0x4b3b('0x25')](function(_0x4fe799){_0x5994cc['count']=_0x4fe799;if(_0x46c186[_0x4b3b('0x47')][_0x4b3b('0x5c')]){_0x545f4a[_0x4b3b('0x5d')]=[{'all':!![]}];}return db[_0x4b3b('0xa4')][_0x4b3b('0x56')](_0x545f4a);})['then'](function(_0x4757d2){_0x5994cc[_0x4b3b('0x6e')]=_0x4757d2;return _0x5994cc;});}})[_0x4b3b('0x25')](respondWithFilteredResult(_0x4163e9,_0x545f4a))[_0x4b3b('0x57')](handleError(_0x4163e9,null));};exports[_0x4b3b('0x40')]=function(_0x1a7e27,_0x5ba7b2,_0xb037b6){var _0x5759c0,_0x5cc170={},_0x29ca13;if(_0x1a7e27[_0x4b3b('0x60')]['to']){_0x29ca13=_0x1a7e27['body']['to'][0x0];}return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x1a7e27[_0x4b3b('0x67')]['id']},'include':[{'model':db[_0x4b3b('0xa8')],'as':_0x4b3b('0xa9'),'include':[{'model':db[_0x4b3b('0x7a')],'as':'Contacts','where':{'fax':_0x29ca13},'limit':0x1,'order':[['updatedAt',_0x4b3b('0xaa')]]}]}]})[_0x4b3b('0x25')](handleEntityNotFound(_0x5ba7b2,null))[_0x4b3b('0x25')](function(_0x3044b1){_0x5759c0=_0x3044b1;if(_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xab')]&&_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xab')][_0x4b3b('0x79')]){for(var _0x415072=0x0;_0x415072<_0x1a7e27['body'][_0x4b3b('0xab')]['length'];_0x415072+=0x1){_0x1a7e27[_0x4b3b('0x60')]['attachments'][_0x415072]={'filename':_0x1a7e27['body'][_0x4b3b('0xab')][_0x415072][_0x4b3b('0x3f')],'id':_0x1a7e27[_0x4b3b('0x60')]['attachments'][_0x415072]['id'],'path':path[_0x4b3b('0xac')](config[_0x4b3b('0xad')],_0x4b3b('0xae'),_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xab')][_0x415072][_0x4b3b('0xaf')])};}}return respondWithRpcPromise(_0x4b3b('0xb0'),_0x4b3b('0xb0'),{'FaxAccountId':_['isNil'](_0x1a7e27[_0x4b3b('0x67')]['id'])?undefined:_0x1a7e27['params']['id'],'path':_[_0x4b3b('0xb1')](_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xab')][0x0][_0x4b3b('0x8')])?undefined:_0x1a7e27['body'][_0x4b3b('0xab')][0x0][_0x4b3b('0x8')],'fax':_['isNil'](_0x1a7e27['body']['to'][0x0])?undefined:_0x1a7e27['body']['to'][0x0]},client9002);})[_0x4b3b('0x25')](function(){if(_0x5759c0){if(_[_0x4b3b('0xb1')](_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xb2')])){_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xb2')]=util['format'](_0x4b3b('0xb3'),_0x5759c0[_0x4b3b('0x3f')],_0x5759c0[_0x4b3b('0xb4')]);}if(_0x5759c0[_0x4b3b('0xa9')]){if(_0x5759c0['List'][_0x4b3b('0xb5')]['length']){return _0x5759c0['List']['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x4b3b('0x1d')](_0x1a7e27[_0x4b3b('0x60')],{'firstName':_0x1a7e27[_0x4b3b('0x60')]['to'][0x0],'phone':_0x1a7e27[_0x4b3b('0x60')]['to'][0x0],'fax':_0x1a7e27[_0x4b3b('0x60')]['to'][0x0],'ListId':_0x5759c0[_0x4b3b('0xa1')]}));}}else{throw new Error(_0x4b3b('0xb6'));}}else{throw new Error(_0x4b3b('0xb7'));}})[_0x4b3b('0x25')](function(_0x447baf){if(_0x447baf){return db[_0x4b3b('0x78')][_0x4b3b('0x5e')]({'where':{'ContactId':_0x447baf['id'],'closed':![],'FaxAccountId':_0x5759c0['id']}})[_0x4b3b('0x25')](function(_0x7cd96c){if(_0x7cd96c){return[_0x7cd96c,![]];}return db['FaxInteraction'][_0x4b3b('0x5f')]({'UserId':_0x1a7e27['user']['id'],'ContactId':_0x447baf['id'],'FaxAccountId':_0x5759c0['id'],'fax':_0x1a7e27[_0x4b3b('0x60')]['to'][0x0],'firstMsgDirection':_0x4b3b('0xb8'),'Messages':[_['merge'](_0x1a7e27['body'],{'read':![],'body':_0x1a7e27[_0x4b3b('0x60')]['attachments'][0x0][_0x4b3b('0xb9')],'FaxAccountId':_0x5759c0['id'],'UserId':_0x1a7e27[_0x4b3b('0x61')]['id'],'ContactId':_0x447baf['id'],'AttachmentId':_0x1a7e27[_0x4b3b('0x60')][_0x4b3b('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x4b3b('0xa4')],'as':_0x4b3b('0xba')}]})[_0x4b3b('0x25')](function(_0x55ad20){return[_0x55ad20,!![]];});});}else{throw new Error(_0x4b3b('0xbb'));}})[_0x4b3b('0xbc')](function(_0x5d02e8,_0x43b47b){if(_0x43b47b){return _0x5d02e8;}return db['FaxMessage'][_0x4b3b('0x5f')]({'direction':_0x4b3b('0xb8'),'read':![],'body':_0x1a7e27[_0x4b3b('0x60')]['attachments'][0x0][_0x4b3b('0xb9')],'FaxAccountId':_0x5759c0['id'],'FaxInteractionId':_0x5d02e8['id'],'UserId':_0x1a7e27[_0x4b3b('0x61')]['id'],'ContactId':_0x5d02e8['ContactId'],'AttachmentId':_0x1a7e27['body'][_0x4b3b('0xab')][0x0]['id']})[_0x4b3b('0x25')](function(_0x287cb1){_0x5d02e8[_0x4b3b('0xbd')][_0x4b3b('0xba')]=[];_0x5d02e8['dataValues'][_0x4b3b('0xba')][_0x4b3b('0x8f')](_0x287cb1['dataValues']);return _0x5d02e8;});})[_0x4b3b('0x25')](function(_0x3a74ce){respondWithRpcPromise(_0x4b3b('0xbe'),_0x4b3b('0xbe'),{'FaxAccountId':_[_0x4b3b('0xb1')](_0x1a7e27[_0x4b3b('0x67')]['id'])?undefined:_0x1a7e27[_0x4b3b('0x67')]['id'],'path':_['isNil'](_0x1a7e27['body'][_0x4b3b('0xab')][0x0][_0x4b3b('0x8')])?undefined:_0x1a7e27['body'][_0x4b3b('0xab')][0x0]['path'],'fax':_['isNil'](_0x1a7e27[_0x4b3b('0x60')]['to'][0x0])?undefined:_0x1a7e27['body']['to'][0x0],'AttachmentId':_0x1a7e27['body'][_0x4b3b('0xab')][0x0]['id']},client9002)[_0x4b3b('0x25')](function(_0x144cc7){logger[_0x4b3b('0x26')](_0x4b3b('0xbf'),_0x144cc7);})[_0x4b3b('0x57')](function(_0x19b667){logger[_0x4b3b('0x26')](_0x4b3b('0xbf'),_0x19b667);});return _0x3a74ce;})[_0x4b3b('0x25')](respondWithResult(_0x5ba7b2,null))[_0x4b3b('0x57')](handleError(_0x5ba7b2,null));};exports[_0x4b3b('0xc0')]=function(_0x1b8b2d,_0x3702a3,_0x2e6f78){return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x1b8b2d[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x3702a3,null))[_0x4b3b('0x25')](function(_0x2eb90f){if(_0x2eb90f){return _0x2eb90f[_0x4b3b('0xc0')](_0x1b8b2d['body'][_0x4b3b('0x70')],_['omit'](_0x1b8b2d[_0x4b3b('0x60')],['ids','id'])||{})[_0x4b3b('0xbc')](function(_0xbc7224){for(var _0x5b046d=0x0;_0x5b046d<_0x1b8b2d[_0x4b3b('0x60')][_0x4b3b('0x70')][_0x4b3b('0x79')];_0x5b046d+=0x1){socket[_0x4b3b('0xc1')]('userFaxAccount:save',{'UserId':Number(_0x1b8b2d[_0x4b3b('0x60')][_0x4b3b('0x70')][_0x5b046d]),'FaxAccountId':Number(_0x1b8b2d['params']['id'])});}return _0xbc7224;});}})['then'](respondWithResult(_0x3702a3,null))[_0x4b3b('0x57')](handleError(_0x3702a3,null));};exports['removeAgents']=function(_0x18df8a,_0x3a64cf,_0x1f58d0){return db[_0x4b3b('0x44')][_0x4b3b('0x5e')]({'where':{'id':_0x18df8a[_0x4b3b('0x67')]['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x3a64cf,null))['then'](function(_0x4d66eb){if(_0x4d66eb){return _0x4d66eb['removeAgents'](_0x18df8a[_0x4b3b('0x47')][_0x4b3b('0x70')])['then'](function(){if(_[_0x4b3b('0xc2')](_0x18df8a[_0x4b3b('0x47')][_0x4b3b('0x70')])){for(var _0x565a99=0x0;_0x565a99<_0x18df8a[_0x4b3b('0x47')][_0x4b3b('0x70')][_0x4b3b('0x79')];_0x565a99+=0x1){socket['emit'](_0x4b3b('0xc3'),{'UserId':Number(_0x18df8a['query']['ids'][_0x565a99]),'FaxAccountId':Number(_0x18df8a[_0x4b3b('0x67')]['id'])});}}else{socket[_0x4b3b('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x18df8a[_0x4b3b('0x47')]['ids']),'FaxAccountId':Number(_0x18df8a[_0x4b3b('0x67')]['id'])});}});}})[_0x4b3b('0x25')](respondWithStatusCode(_0x3a64cf,null))[_0x4b3b('0x57')](handleError(_0x3a64cf,null));};exports[_0x4b3b('0xc4')]=function(_0x3b94f5,_0x5baf50,_0x24b677){var _0x4f9c50={};var _0x43732e={};var _0x12c10;var _0x408093;return db[_0x4b3b('0x44')][_0x4b3b('0x73')]({'where':{'id':_0x3b94f5['params']['id']}})[_0x4b3b('0x25')](handleEntityNotFound(_0x5baf50,null))[_0x4b3b('0x25')](function(_0x4c104e){if(_0x4c104e){_0x12c10=_0x4c104e;_0x43732e[_0x4b3b('0x4a')]=_[_0x4b3b('0x5a')](db[_0x4b3b('0x7b')][_0x4b3b('0x5b')]);_0x43732e[_0x4b3b('0x47')]=_[_0x4b3b('0x5a')](_0x3b94f5['query']);_0x43732e['filters']=_[_0x4b3b('0x48')](_0x43732e['model'],_0x43732e[_0x4b3b('0x47')]);_0x4f9c50[_0x4b3b('0x49')]=_[_0x4b3b('0x48')](_0x43732e[_0x4b3b('0x4a')],qs[_0x4b3b('0x4b')](_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x4b')]));_0x4f9c50['attributes']=_0x4f9c50['attributes'][_0x4b3b('0x79')]?_0x4f9c50['attributes']:_0x43732e[_0x4b3b('0x4a')];_0x4f9c50[_0x4b3b('0x6c')]=qs['sort'](_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x4e')]);_0x4f9c50[_0x4b3b('0x4f')]=qs[_0x4b3b('0x50')](_[_0x4b3b('0x51')](_0x3b94f5[_0x4b3b('0x47')],_0x43732e['filters']));if(_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x52')]){_0x4f9c50[_0x4b3b('0x4f')]=_[_0x4b3b('0x53')](_0x4f9c50['where'],{'$or':_[_0x4b3b('0x43')](_0x4f9c50[_0x4b3b('0x49')],function(_0x498170){var _0x47d52c={};_0x47d52c[_0x498170]={'$like':'%'+_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x52')]+'%'};return _0x47d52c;})});}_0x4f9c50=_[_0x4b3b('0x53')]({},_0x4f9c50,_0x3b94f5[_0x4b3b('0x55')]);return _0x12c10[_0x4b3b('0xc4')](_0x4f9c50);}})[_0x4b3b('0x25')](function(_0x4be39e){if(_0x4be39e){_0x408093=_0x4be39e[_0x4b3b('0x79')];if(!_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x4c')]('nolimit')){_0x4f9c50['limit']=qs[_0x4b3b('0x31')](_0x3b94f5[_0x4b3b('0x47')][_0x4b3b('0x31')]);_0x4f9c50[_0x4b3b('0x2f')]=qs[_0x4b3b('0x2f')](_0x3b94f5['query']['offset']);}return _0x12c10['getAgents'](_0x4f9c50);}})[_0x4b3b('0x25')](function(_0x35f836){if(_0x35f836){return _0x35f836?{'count':_0x408093,'rows':_0x35f836}:null;}})[_0x4b3b('0x25')](respondWithResult(_0x5baf50,null))['catch'](handleError(_0x5baf50,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7adcc73..cb669a7 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 _0x0fb8=['events','../../mysqldb','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x34e7e3,_0x3f5253){var _0x224ffc=function(_0x3c3584){while(--_0x3c3584){_0x34e7e3['push'](_0x34e7e3['shift']());}};_0x224ffc(++_0x3f5253);}(_0x0fb8,0x1a0));var _0x80fb=function(_0x54e15b,_0x234bf3){_0x54e15b=_0x54e15b-0x0;var _0xb9713f=_0x0fb8[_0x54e15b];return _0xb9713f;};'use strict';var EventEmitter=require(_0x80fb('0x0'));var FaxAccount=require(_0x80fb('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x80fb('0x2'),'afterUpdate':_0x80fb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ef7b9){return function(_0x43f201,_0x1d6a50,_0x5680b0){FaxAccountEvents[_0x80fb('0x4')](_0x5ef7b9+':'+_0x43f201['id'],_0x43f201);FaxAccountEvents[_0x80fb('0x4')](_0x5ef7b9,_0x43f201);_0x5680b0(null);};}for(var e in events){if(events[_0x80fb('0x5')](e)){var event=events[e];FaxAccount[_0x80fb('0x6')](e,emitEvent(event));}}module[_0x80fb('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x2125=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','hasOwnProperty','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2125,0x15e));var _0x5212=function(_0x148f83,_0x475d7c){_0x148f83=_0x148f83-0x0;var _0x160c11=_0x2125[_0x148f83];return _0x160c11;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x5212('0x0'))['db'][_0x5212('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5212('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5212('0x3'),'afterDestroy':_0x5212('0x4')};function emitEvent(_0x71f9a9){return function(_0x47c5be,_0x16204b,_0x2da950){FaxAccountEvents['emit'](_0x71f9a9+':'+_0x47c5be['id'],_0x47c5be);FaxAccountEvents['emit'](_0x71f9a9,_0x47c5be);_0x2da950(null);};}for(var e in events){if(events[_0x5212('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x5212('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ed79acb..5e8bf1f 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 _0xaeb2=['moment','bluebird','request-promise','rimraf','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x3c7d72,_0x352272){var _0x20abe8=function(_0x2afc3b){while(--_0x2afc3b){_0x3c7d72['push'](_0x3c7d72['shift']());}};_0x20abe8(++_0x352272);}(_0xaeb2,0x167));var _0x2aeb=function(_0x4a3744,_0xe9a5a0){_0x4a3744=_0x4a3744-0x0;var _0x4fbd57=_0xaeb2[_0x4a3744];return _0x4fbd57;};'use strict';var _=require(_0x2aeb('0x0'));var util=require(_0x2aeb('0x1'));var logger=require(_0x2aeb('0x2'))(_0x2aeb('0x3'));var moment=require(_0x2aeb('0x4'));var BPromise=require(_0x2aeb('0x5'));var rp=require(_0x2aeb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2aeb('0x7'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module['exports']=function(_0x473d73,_0x25d71e){return _0x473d73[_0x2aeb('0x8')](_0x2aeb('0x9'),attributes,{'tableName':_0x2aeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x707b=['bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','moment'];(function(_0x25e35c,_0x2f09b8){var _0x27dcc4=function(_0x47d47c){while(--_0x47d47c){_0x25e35c['push'](_0x25e35c['shift']());}};_0x27dcc4(++_0x2f09b8);}(_0x707b,0x101));var _0xb707=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x707b[_0x5e9d35];return _0x3beb2e;};'use strict';var _=require(_0xb707('0x0'));var util=require(_0xb707('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb707('0x2'));var BPromise=require(_0xb707('0x3'));var rp=require(_0xb707('0x4'));var fs=require('fs');var path=require(_0xb707('0x5'));var rimraf=require(_0xb707('0x6'));var config=require(_0xb707('0x7'));var attributes=require(_0xb707('0x8'));module[_0xb707('0x9')]=function(_0x14d94e,_0x360248){return _0x14d94e[_0xb707('0xa')](_0xb707('0xb'),attributes,{'tableName':_0xb707('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 796de23..e5bb558 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 _0x8deb=['orderBy','priority','asc','ListId','create','FaxInteraction','spread','autoclose','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','body','fax','difference','keys','updatedAt','createdAt','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','CmContact','Contacts','DESC','FaxApplication','Applications','List','get','account','applications'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x8deb,0x165));var _0xb8de=function(_0x1bc482,_0x3eb480){_0x1bc482=_0x1bc482-0x0;var _0x5c0870=_0x8deb[_0x1bc482];return _0x5c0870;};'use strict';var _=require(_0xb8de('0x0'));var util=require(_0xb8de('0x1'));var moment=require(_0xb8de('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8de('0x3'));var fs=require('fs');var Redis=require(_0xb8de('0x4'));var db=require(_0xb8de('0x5'))['db'];var utils=require(_0xb8de('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb8de('0x7'));var jayson=require(_0xb8de('0x8'));var client=jayson['client'][_0xb8de('0x9')]({'port':0x232c});config[_0xb8de('0xa')]=_[_0xb8de('0xb')](config[_0xb8de('0xa')],{'host':_0xb8de('0xc'),'port':0x18eb});var socket=require(_0xb8de('0xd'))(new Redis(config[_0xb8de('0xa')]));require(_0xb8de('0xe'))['register'](socket);function respondWithRpcPromise(_0x25de53,_0x16a3ec,_0x4cdab5){return new BPromise(function(_0x4dd183,_0x3680bf){return client[_0xb8de('0xf')](_0x25de53,_0x4cdab5)[_0xb8de('0x10')](function(_0x3868ac){logger[_0xb8de('0x11')]('FaxAccount,\x20%s,\x20%s',_0x16a3ec,_0xb8de('0x12'));logger[_0xb8de('0x13')](_0xb8de('0x14'),_0x16a3ec,'request\x20sent',JSON[_0xb8de('0x15')](_0x3868ac));if(_0x3868ac[_0xb8de('0x16')]){if(_0x3868ac[_0xb8de('0x16')][_0xb8de('0x17')]===0x1f4){logger[_0xb8de('0x16')](_0xb8de('0x18'),_0x16a3ec,_0x3868ac[_0xb8de('0x16')]['message']);return _0x3680bf(_0x3868ac[_0xb8de('0x16')][_0xb8de('0x19')]);}logger[_0xb8de('0x16')](_0xb8de('0x18'),_0x16a3ec,_0x3868ac[_0xb8de('0x16')][_0xb8de('0x19')]);return _0x4dd183(_0x3868ac[_0xb8de('0x16')]['message']);}else{logger[_0xb8de('0x11')]('FaxAccount,\x20%s,\x20%s',_0x16a3ec,_0xb8de('0x12'));_0x4dd183(_0x3868ac[_0xb8de('0x1a')][_0xb8de('0x19')]);}})[_0xb8de('0x1b')](function(_0x5a58bf){logger[_0xb8de('0x16')]('FaxAccount,\x20%s,\x20%s',_0x16a3ec,_0x5a58bf);_0x3680bf(_0x5a58bf);});});}exports[_0xb8de('0x1c')]=function(_0x476f3e){var _0x40ed3f=this;return new Promise(function(_0x1c162b,_0x2e95a0){return db[_0xb8de('0x1d')][_0xb8de('0x1e')]({'raw':_0x476f3e[_0xb8de('0x1f')]?_0x476f3e[_0xb8de('0x1f')][_0xb8de('0x20')]===undefined?!![]:![]:!![],'where':_0x476f3e[_0xb8de('0x1f')]?_0x476f3e['options'][_0xb8de('0x21')]||null:null,'attributes':_0x476f3e[_0xb8de('0x1f')]?_0x476f3e['options'][_0xb8de('0x22')]||null:null,'limit':_0x476f3e[_0xb8de('0x1f')]?_0x476f3e[_0xb8de('0x1f')]['limit']||null:null,'include':_0x476f3e['options']?_0x476f3e[_0xb8de('0x1f')][_0xb8de('0x23')]?_[_0xb8de('0x24')](_0x476f3e[_0xb8de('0x1f')][_0xb8de('0x23')],function(_0x3bd68c){return{'model':db[_0x3bd68c[_0xb8de('0x25')]],'as':_0x3bd68c['as'],'attributes':_0x3bd68c[_0xb8de('0x22')],'include':_0x3bd68c[_0xb8de('0x23')]?_[_0xb8de('0x24')](_0x3bd68c[_0xb8de('0x23')],function(_0xb9bf39){return{'model':db[_0xb9bf39[_0xb8de('0x25')]],'as':_0xb9bf39['as'],'attributes':_0xb9bf39['attributes'],'include':_0xb9bf39[_0xb8de('0x23')]?_[_0xb8de('0x24')](_0xb9bf39[_0xb8de('0x23')],function(_0x2811ae){return{'model':db[_0x2811ae[_0xb8de('0x25')]],'as':_0x2811ae['as'],'attributes':_0x2811ae[_0xb8de('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb8de('0x10')](function(_0x1785e4){logger[_0xb8de('0x11')](_0xb8de('0x1c'),_0x476f3e);logger[_0xb8de('0x13')]('GetFaxAccount',_0x476f3e,JSON[_0xb8de('0x15')](_0x1785e4));_0x1c162b(_0x1785e4);})[_0xb8de('0x1b')](function(_0x2f1892){logger[_0xb8de('0x16')](_0xb8de('0x1c'),_0x2f1892[_0xb8de('0x19')],_0x476f3e);_0x2e95a0(_0x40ed3f[_0xb8de('0x16')](0x1f4,_0x2f1892[_0xb8de('0x19')]));});});};exports[_0xb8de('0x26')]=function(_0x13e98e,_0x7024b,_0x18fd59){var _0x1eacfe=this;return new Promise(function(_0x5367d0,_0x5e794b){var _0x48021e={'body':_0x13e98e[_0xb8de('0x27')],'channel':_0xb8de('0x28')};var _0xe3539c=[];var _0x25d3de=[];var _0x58267e={};return db['CmContact']['describe']()[_0xb8de('0x10')](function(_0x32f59e){if(!_0x32f59e){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0xe3539c=_[_0xb8de('0x29')](_[_0xb8de('0x2a')](_0x32f59e),['createdAt',_0xb8de('0x2b')]);_0x25d3de=_[_0xb8de('0x29')](_[_0xb8de('0x2a')](_0x32f59e),[_0xb8de('0x2c'),_0xb8de('0x2b'),'CompanyId','ListId']);if(_0x13e98e['body']['id']){delete _0x13e98e[_0xb8de('0x27')]['id'];}if(_['isNil'](_0x13e98e[_0xb8de('0x27')][_0xb8de('0x2d')])){throw new db[(_0xb8de('0x2e'))][(_0xb8de('0x2f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x13e98e[_0xb8de('0x27')]['body'])||_0x13e98e[_0xb8de('0x27')][_0xb8de('0x27')]===''){throw new db['Sequelize'][(_0xb8de('0x2f'))](_0xb8de('0x30'));}if(_[_0xb8de('0x31')](_0x13e98e[_0xb8de('0x27')][_0xb8de('0x32')])){throw new db['Sequelize'][(_0xb8de('0x2f'))](_0xb8de('0x33')+_0x25d3de);}if(!_['includes'](_0x25d3de,_0x13e98e['body'][_0xb8de('0x32')])){throw new db[(_0xb8de('0x2e'))][(_0xb8de('0x2f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x25d3de);}_0x58267e[_0x13e98e[_0xb8de('0x27')]['mapKey']]=_0x13e98e['body'][_0xb8de('0x2d')];})['then'](function(){return db['FaxAccount'][_0xb8de('0x34')]({'where':{'id':_0x13e98e['account']['id']},'include':[{'model':db[_0xb8de('0x35')],'as':'List','include':[{'model':db[_0xb8de('0x36')],'as':_0xb8de('0x37'),'where':_0x58267e,'limit':0x1,'order':[['updatedAt',_0xb8de('0x38')]]}]},{'model':db[_0xb8de('0x39')],'as':_0xb8de('0x3a')}]});})[_0xb8de('0x10')](function(_0x46dcea){if(_0x46dcea&&_0x46dcea[_0xb8de('0x3b')]){var _0x4307a7=_0x46dcea[_0xb8de('0x3c')]({'plain':!![]});_0x48021e[_0xb8de('0x3d')]=_0x4307a7;_0x48021e['applications']=_0x4307a7[_0xb8de('0x3a')];_0x48021e['list']=_0x4307a7['List'];_0x48021e[_0xb8de('0x3e')]=_[_0xb8de('0x3f')](_0x48021e['applications'],[_0xb8de('0x40')],[_0xb8de('0x41')]);if(_0x48021e['account'][_0xb8de('0x3a')]){delete _0x48021e['account'][_0xb8de('0x3a')];}if(_0x48021e['account'][_0xb8de('0x3b')]&&_0x48021e[_0xb8de('0x3d')]['List'][_0xb8de('0x37')]['length']){return _0x48021e['account'][_0xb8de('0x3b')][_0xb8de('0x37')][0x0];}var _0x24500f=_[_0xb8de('0xb')](_0x13e98e[_0xb8de('0x27')],{'firstName':_0x13e98e[_0xb8de('0x27')][_0xb8de('0x2d')],'ListId':_0x4307a7[_0xb8de('0x42')]});_0x24500f[_0x13e98e[_0xb8de('0x27')][_0xb8de('0x32')]]=_0x13e98e[_0xb8de('0x27')][_0xb8de('0x2d')];return db['CmContact'][_0xb8de('0x43')](_0x24500f,{'fields':_0xe3539c,'raw':!![]});}})[_0xb8de('0x10')](function(_0x18fec6){_0x48021e['contact']=_0x18fec6;if(_0x18fec6){var _0x545ed5={'ContactId':_0x18fec6['id'],'FaxAccountId':_0x13e98e['account']['id'],'fax':_0x18fec6[_0xb8de('0x28')]};return db[_0xb8de('0x44')][_0xb8de('0x34')]({'where':{'ContactId':_0x18fec6['id'],'closed':![],'FaxAccountId':_0x13e98e[_0xb8de('0x3d')]['id']}})[_0xb8de('0x10')](function(_0x2be9a2){if(_0x2be9a2){return[_0x2be9a2,![]];}return db[_0xb8de('0x44')][_0xb8de('0x43')](_0x545ed5)[_0xb8de('0x10')](function(_0x314c09){return[_0x314c09,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb8de('0x45')](function(_0x53c812,_0x2597f1){var _0x8d207c=_0x53c812['get']({'plain':!![]});if(_0x2597f1){if(_0x48021e[_0xb8de('0x3d')][_0xb8de('0x46')]){_0x48021e[_0xb8de('0x3e')]['push']({'id':0x0,'priority':_0x48021e[_0xb8de('0x3e')]['length']+0x1,'app':_0xb8de('0x47'),'appdata':_0xb8de('0x48'),'interval':'*,*,*,*'});}_0x8d207c[_0xb8de('0x49')]=!![];}else{_0x8d207c['created']=![];}_0x48021e[_0xb8de('0x4a')]=_0x8d207c;return db[_0xb8de('0x4b')][_0xb8de('0x43')]({'body':_0x13e98e[_0xb8de('0x27')][_0xb8de('0x27')],'FaxAccountId':_0x13e98e['account']['id'],'FaxInteractionId':_0x53c812['id'],'direction':'in','ContactId':_0x53c812[_0xb8de('0x4c')],'AttachmentId':_0x13e98e[_0xb8de('0x27')][_0xb8de('0x4d')]});})[_0xb8de('0x10')](function(_0x39e440){_0x48021e[_0xb8de('0x19')]=_0x39e440;if(_0x48021e[_0xb8de('0x4a')]['UserId']){return db[_0xb8de('0x4e')]['find']({'attributes':['id','name'],'where':{'id':_0x48021e[_0xb8de('0x4a')]['UserId']}})[_0xb8de('0x10')](function(_0xf5134f){if(_0xf5134f){_0x48021e[_0xb8de('0x3e')][_0xb8de('0x4f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xf5134f[_0xb8de('0x50')]+','+(_0x48021e['account'][_0xb8de('0x51')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb8de('0x52'),_0xb8de('0x53'),_0x48021e);});}return respondWithRpcPromise(_0xb8de('0x52'),_0xb8de('0x53'),_0x48021e);})[_0xb8de('0x10')](function(_0x180ed3){_0x5367d0(_0x180ed3);})[_0xb8de('0x1b')](function(_0x1c5ec4){_0x5e794b(_0x1eacfe[_0xb8de('0x16')](0x1f4,_0x1c5ec4['message']));});});}; \ No newline at end of file +var _0x1dc5=['difference','keys','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','account','CmList','List','Contacts','DESC','get','applications','Applications','orderBy','asc','create','contact','fax','FaxInteraction','find','Contact\x20not\x20found','spread','push','length','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError'];(function(_0x5538d5,_0x190032){var _0x323b1a=function(_0x179caa){while(--_0x179caa){_0x5538d5['push'](_0x5538d5['shift']());}};_0x323b1a(++_0x190032);}(_0x1dc5,0x83));var _0x51dc=function(_0x24341f,_0x1ecaf5){_0x24341f=_0x24341f-0x0;var _0x1dc1d6=_0x1dc5[_0x24341f];return _0x1dc1d6;};'use strict';var _=require('lodash');var util=require(_0x51dc('0x0'));var moment=require(_0x51dc('0x1'));var BPromise=require(_0x51dc('0x2'));var rs=require(_0x51dc('0x3'));var fs=require('fs');var Redis=require(_0x51dc('0x4'));var db=require(_0x51dc('0x5'))['db'];var utils=require(_0x51dc('0x6'));var logger=require(_0x51dc('0x7'))(_0x51dc('0x8'));var config=require(_0x51dc('0x9'));var jayson=require(_0x51dc('0xa'));var client=jayson[_0x51dc('0xb')][_0x51dc('0xc')]({'port':0x232c});config[_0x51dc('0xd')]=_[_0x51dc('0xe')](config[_0x51dc('0xd')],{'host':_0x51dc('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51dc('0xd')]));require('./faxAccount.socket')[_0x51dc('0x10')](socket);function respondWithRpcPromise(_0x49302c,_0x4ddd76,_0x588845){return new BPromise(function(_0x42310b,_0x2b52d8){return client[_0x51dc('0x11')](_0x49302c,_0x588845)[_0x51dc('0x12')](function(_0x49dc56){logger[_0x51dc('0x13')](_0x51dc('0x14'),_0x4ddd76,_0x51dc('0x15'));logger[_0x51dc('0x16')](_0x51dc('0x17'),_0x4ddd76,_0x51dc('0x15'),JSON['stringify'](_0x49dc56));if(_0x49dc56[_0x51dc('0x18')]){if(_0x49dc56[_0x51dc('0x18')][_0x51dc('0x19')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4ddd76,_0x49dc56[_0x51dc('0x18')][_0x51dc('0x1a')]);return _0x2b52d8(_0x49dc56[_0x51dc('0x18')][_0x51dc('0x1a')]);}logger[_0x51dc('0x18')](_0x51dc('0x14'),_0x4ddd76,_0x49dc56[_0x51dc('0x18')]['message']);return _0x42310b(_0x49dc56['error'][_0x51dc('0x1a')]);}else{logger[_0x51dc('0x13')](_0x51dc('0x14'),_0x4ddd76,'request\x20sent');_0x42310b(_0x49dc56[_0x51dc('0x1b')][_0x51dc('0x1a')]);}})['catch'](function(_0x2ad8d1){logger[_0x51dc('0x18')](_0x51dc('0x14'),_0x4ddd76,_0x2ad8d1);_0x2b52d8(_0x2ad8d1);});});}exports[_0x51dc('0x1c')]=function(_0x58982a){var _0x45493b=this;return new Promise(function(_0x17bb19,_0x4a5921){return db[_0x51dc('0x1d')][_0x51dc('0x1e')]({'raw':_0x58982a[_0x51dc('0x1f')]?_0x58982a[_0x51dc('0x1f')][_0x51dc('0x20')]===undefined?!![]:![]:!![],'where':_0x58982a['options']?_0x58982a[_0x51dc('0x1f')]['where']||null:null,'attributes':_0x58982a['options']?_0x58982a[_0x51dc('0x1f')][_0x51dc('0x21')]||null:null,'limit':_0x58982a['options']?_0x58982a[_0x51dc('0x1f')][_0x51dc('0x22')]||null:null,'include':_0x58982a[_0x51dc('0x1f')]?_0x58982a[_0x51dc('0x1f')][_0x51dc('0x23')]?_[_0x51dc('0x24')](_0x58982a['options']['include'],function(_0x33ff62){return{'model':db[_0x33ff62[_0x51dc('0x25')]],'as':_0x33ff62['as'],'attributes':_0x33ff62[_0x51dc('0x21')],'include':_0x33ff62[_0x51dc('0x23')]?_['map'](_0x33ff62[_0x51dc('0x23')],function(_0x21997a){return{'model':db[_0x21997a[_0x51dc('0x25')]],'as':_0x21997a['as'],'attributes':_0x21997a[_0x51dc('0x21')],'include':_0x21997a[_0x51dc('0x23')]?_['map'](_0x21997a[_0x51dc('0x23')],function(_0x325e14){return{'model':db[_0x325e14['model']],'as':_0x325e14['as'],'attributes':_0x325e14[_0x51dc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x51dc('0x12')](function(_0x411c1b){logger[_0x51dc('0x13')](_0x51dc('0x1c'),_0x58982a);logger[_0x51dc('0x16')]('GetFaxAccount',_0x58982a,JSON[_0x51dc('0x26')](_0x411c1b));_0x17bb19(_0x411c1b);})[_0x51dc('0x27')](function(_0x46de5a){logger[_0x51dc('0x18')](_0x51dc('0x1c'),_0x46de5a[_0x51dc('0x1a')],_0x58982a);_0x4a5921(_0x45493b[_0x51dc('0x18')](0x1f4,_0x46de5a[_0x51dc('0x1a')]));});});};exports[_0x51dc('0x28')]=function(_0x125144,_0x4fd611,_0x111bd){var _0x10b037=this;return new Promise(function(_0x5e3527,_0x12c54f){var _0x438b8f={'body':_0x125144['body'],'channel':'fax'};var _0x30fc24=[];var _0x547cff=[];var _0x5b7e24={};return db[_0x51dc('0x29')][_0x51dc('0x2a')]()[_0x51dc('0x12')](function(_0xa5d39d){if(!_0xa5d39d){throw new db[(_0x51dc('0x2b'))][(_0x51dc('0x2c'))]('no\x20available\x20attributes');}_0x30fc24=_[_0x51dc('0x2d')](_[_0x51dc('0x2e')](_0xa5d39d),[_0x51dc('0x2f'),_0x51dc('0x30')]);_0x547cff=_['difference'](_[_0x51dc('0x2e')](_0xa5d39d),['createdAt',_0x51dc('0x30'),_0x51dc('0x31'),'ListId']);if(_0x125144['body']['id']){delete _0x125144[_0x51dc('0x32')]['id'];}if(_['isNil'](_0x125144[_0x51dc('0x32')][_0x51dc('0x33')])){throw new db[(_0x51dc('0x2b'))][(_0x51dc('0x2c'))](_0x51dc('0x34'));}if(_['isNil'](_0x125144[_0x51dc('0x32')]['body'])||_0x125144['body'][_0x51dc('0x32')]===''){throw new db[(_0x51dc('0x2b'))]['ValidationError'](_0x51dc('0x35'));}if(_['isNil'](_0x125144[_0x51dc('0x32')][_0x51dc('0x36')])){throw new db[(_0x51dc('0x2b'))][(_0x51dc('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x547cff);}if(!_['includes'](_0x547cff,_0x125144[_0x51dc('0x32')][_0x51dc('0x36')])){throw new db[(_0x51dc('0x2b'))][(_0x51dc('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x547cff);}_0x5b7e24[_0x125144[_0x51dc('0x32')][_0x51dc('0x36')]]=_0x125144['body'][_0x51dc('0x33')];})[_0x51dc('0x12')](function(){return db[_0x51dc('0x1d')]['find']({'where':{'id':_0x125144[_0x51dc('0x37')]['id']},'include':[{'model':db[_0x51dc('0x38')],'as':_0x51dc('0x39'),'include':[{'model':db['CmContact'],'as':_0x51dc('0x3a'),'where':_0x5b7e24,'limit':0x1,'order':[[_0x51dc('0x30'),_0x51dc('0x3b')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0x51dc('0x12')](function(_0x4bc610){if(_0x4bc610&&_0x4bc610[_0x51dc('0x39')]){var _0x4fd260=_0x4bc610[_0x51dc('0x3c')]({'plain':!![]});_0x438b8f[_0x51dc('0x37')]=_0x4fd260;_0x438b8f[_0x51dc('0x3d')]=_0x4fd260[_0x51dc('0x3e')];_0x438b8f['list']=_0x4fd260[_0x51dc('0x39')];_0x438b8f[_0x51dc('0x3d')]=_[_0x51dc('0x3f')](_0x438b8f[_0x51dc('0x3d')],['priority'],[_0x51dc('0x40')]);if(_0x438b8f[_0x51dc('0x37')]['Applications']){delete _0x438b8f[_0x51dc('0x37')][_0x51dc('0x3e')];}if(_0x438b8f[_0x51dc('0x37')][_0x51dc('0x39')]&&_0x438b8f[_0x51dc('0x37')][_0x51dc('0x39')][_0x51dc('0x3a')]['length']){return _0x438b8f['account'][_0x51dc('0x39')]['Contacts'][0x0];}var _0x14f075=_[_0x51dc('0xe')](_0x125144[_0x51dc('0x32')],{'firstName':_0x125144[_0x51dc('0x32')][_0x51dc('0x33')],'ListId':_0x4fd260['ListId']});_0x14f075[_0x125144[_0x51dc('0x32')][_0x51dc('0x36')]]=_0x125144[_0x51dc('0x32')][_0x51dc('0x33')];return db['CmContact'][_0x51dc('0x41')](_0x14f075,{'fields':_0x30fc24,'raw':!![]});}})[_0x51dc('0x12')](function(_0x5113e7){_0x438b8f[_0x51dc('0x42')]=_0x5113e7;if(_0x5113e7){var _0x422d3b={'ContactId':_0x5113e7['id'],'FaxAccountId':_0x125144['account']['id'],'fax':_0x5113e7[_0x51dc('0x43')]};return db[_0x51dc('0x44')][_0x51dc('0x45')]({'where':{'ContactId':_0x5113e7['id'],'closed':![],'FaxAccountId':_0x125144[_0x51dc('0x37')]['id']}})['then'](function(_0x407730){if(_0x407730){return[_0x407730,![]];}return db['FaxInteraction'][_0x51dc('0x41')](_0x422d3b)[_0x51dc('0x12')](function(_0x5225ee){return[_0x5225ee,!![]];});});}else{throw new Error(_0x51dc('0x46'));}})[_0x51dc('0x47')](function(_0x3fa91a,_0x205430){var _0xb52f82=_0x3fa91a['get']({'plain':!![]});if(_0x205430){if(_0x438b8f[_0x51dc('0x37')]['autoclose']){_0x438b8f[_0x51dc('0x3d')][_0x51dc('0x48')]({'id':0x0,'priority':_0x438b8f['applications'][_0x51dc('0x49')]+0x1,'app':'close','appdata':_0x51dc('0x4a'),'interval':_0x51dc('0x4b')});}_0xb52f82[_0x51dc('0x4c')]=!![];}else{_0xb52f82[_0x51dc('0x4c')]=![];}_0x438b8f[_0x51dc('0x4d')]=_0xb52f82;return db[_0x51dc('0x4e')][_0x51dc('0x41')]({'body':_0x125144[_0x51dc('0x32')][_0x51dc('0x32')],'FaxAccountId':_0x125144['account']['id'],'FaxInteractionId':_0x3fa91a['id'],'direction':'in','ContactId':_0x3fa91a[_0x51dc('0x4f')],'AttachmentId':_0x125144[_0x51dc('0x32')][_0x51dc('0x50')]});})[_0x51dc('0x12')](function(_0x42af6c){_0x438b8f[_0x51dc('0x1a')]=_0x42af6c;if(_0x438b8f['interaction'][_0x51dc('0x51')]){return db['User'][_0x51dc('0x45')]({'attributes':['id',_0x51dc('0x52')],'where':{'id':_0x438b8f['interaction'][_0x51dc('0x51')]}})['then'](function(_0x392124){if(_0x392124){_0x438b8f['applications'][_0x51dc('0x53')]({'id':0x0,'priority':0x0,'app':_0x51dc('0x54'),'appdata':_0x392124[_0x51dc('0x52')]+','+(_0x438b8f['account'][_0x51dc('0x55')]||0xa),'interval':_0x51dc('0x4b')});}return respondWithRpcPromise(_0x51dc('0x56'),_0x51dc('0x57'),_0x438b8f);});}return respondWithRpcPromise(_0x51dc('0x56'),'startRouting',_0x438b8f);})['then'](function(_0x288222){_0x5e3527(_0x288222);})[_0x51dc('0x27')](function(_0x4a5614){_0x12c54f(_0x10b037['error'](0x1f4,_0x4a5614[_0x51dc('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 8537bc0..15a4008 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 _0xf68c=['save','update','removeListener','register','length'];(function(_0xb29aa6,_0x456d70){var _0x46e7e2=function(_0x161521){while(--_0x161521){_0xb29aa6['push'](_0xb29aa6['shift']());}};_0x46e7e2(++_0x456d70);}(_0xf68c,0x177));var _0xcf68=function(_0x5aa1f7,_0x518a32){_0x5aa1f7=_0x5aa1f7-0x0;var _0x6df915=_0xf68c[_0x5aa1f7];return _0x6df915;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xcf68('0x0'),'remove',_0xcf68('0x1')];function createListener(_0x5ead0d,_0x5982e0){return function(_0x21a1d6){_0x5982e0['emit'](_0x5ead0d,_0x21a1d6);};}function removeListener(_0x1f835e,_0x5905ef){return function(){FaxAccountEvents[_0xcf68('0x2')](_0x1f835e,_0x5905ef);};}exports[_0xcf68('0x3')]=function(_0x2d38c0){for(var _0xba30d=0x0,_0x14471b=events[_0xcf68('0x4')];_0xba30d<_0x14471b;_0xba30d++){var _0xe12817=events[_0xba30d];var _0x2c77c5=createListener('faxAccount:'+_0xe12817,_0x2d38c0);FaxAccountEvents['on'](_0xe12817,_0x2c77c5);}}; \ No newline at end of file +var _0xa979=['faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa979,0x191));var _0x9a97=function(_0x5d4f70,_0x5e8506){_0x5d4f70=_0x5d4f70-0x0;var _0x39bc3b=_0xa979[_0x5d4f70];return _0x39bc3b;};'use strict';var FaxAccountEvents=require(_0x9a97('0x0'));var events=['save',_0x9a97('0x1'),_0x9a97('0x2')];function createListener(_0x20d5c8,_0x1d739b){return function(_0x28802e){_0x1d739b['emit'](_0x20d5c8,_0x28802e);};}function removeListener(_0x1dda9a,_0x59655c){return function(){FaxAccountEvents[_0x9a97('0x3')](_0x1dda9a,_0x59655c);};}exports['register']=function(_0x1f6961){for(var _0x9ce82e=0x0,_0x4d4b66=events['length'];_0x9ce82e<_0x4d4b66;_0x9ce82e++){var _0x486b06=events[_0x9ce82e];var _0xf50fbd=createListener(_0x9a97('0x4')+_0x486b06,_0x1f6961);FaxAccountEvents['on'](_0x486b06,_0xf50fbd);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f5157ae..43a5f5e 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x7d85ac,_0x313f00){var _0x4fba3d=function(_0x413565){while(--_0x413565){_0x7d85ac['push'](_0x7d85ac['shift']());}};_0x4fba3d(++_0x313f00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x538036,_0x55cdbd){var _0x3f757b=function(_0x3c966f){while(--_0x3c966f){_0x538036['push'](_0x538036['shift']());}};_0x3f757b(++_0x55cdbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index eca001e..1978c64 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 _0x9f84=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x542306,_0x571122){var _0x331910=function(_0x3f3adc){while(--_0x3f3adc){_0x542306['push'](_0x542306['shift']());}};_0x331910(++_0x571122);}(_0x9f84,0xbb));var _0x49f8=function(_0x39db49,_0x5a1bfd){_0x39db49=_0x39db49-0x0;var _0x345c13=_0x9f84[_0x39db49];return _0x345c13;};'use strict';var Sequelize=require('sequelize');module[_0x49f8('0x0')]={'priority':{'type':Sequelize[_0x49f8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x49f8('0x2')],'allowNull':![],'defaultValue':_0x49f8('0x3')},'appdata':{'type':Sequelize[_0x49f8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x49f8('0x5')}}; \ No newline at end of file +var _0xe124=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x1e2c3f,_0xeb849d){var _0x558ba1=function(_0x4dda16){while(--_0x4dda16){_0x1e2c3f['push'](_0x1e2c3f['shift']());}};_0x558ba1(++_0xeb849d);}(_0xe124,0x80));var _0x4e12=function(_0x2d4b1c,_0x1b6d3a){_0x2d4b1c=_0x2d4b1c-0x0;var _0x334db6=_0xe124[_0x2d4b1c];return _0x334db6;};'use strict';var Sequelize=require(_0x4e12('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4e12('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4e12('0x2')},'appdata':{'type':Sequelize[_0x4e12('0x3')]()},'description':{'type':Sequelize[_0x4e12('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4e12('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 967d0cd..3f42daa 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 _0x6a79=['json','offset','undefined','limit','count','set','apply','reject','save','then','error','stack','name','index','map','FaxApplication','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x2ad70c,_0x480687){var _0x1cbc65=function(_0x8b3e8b){while(--_0x8b3e8b){_0x2ad70c['push'](_0x2ad70c['shift']());}};_0x1cbc65(++_0x480687);}(_0x6a79,0x76));var _0x96a7=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x6a79[_0x59befa];return _0x1dd63d;};'use strict';var emlformat=require(_0x96a7('0x0'));var rimraf=require(_0x96a7('0x1'));var zipdir=require(_0x96a7('0x2'));var jsonpatch=require(_0x96a7('0x3'));var rp=require(_0x96a7('0x4'));var moment=require('moment');var BPromise=require(_0x96a7('0x5'));var Mustache=require(_0x96a7('0x6'));var util=require(_0x96a7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x96a7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96a7('0x9'));var squel=require(_0x96a7('0xa'));var crypto=require(_0x96a7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x96a7('0xc'));var toCsv=require(_0x96a7('0x8'));var querystring=require('querystring');var Papa=require(_0x96a7('0xd'));var Redis=require(_0x96a7('0xe'));var authService=require(_0x96a7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x96a7('0x10'));var hardwareService=require(_0x96a7('0x11'));var logger=require(_0x96a7('0x12'))(_0x96a7('0x13'));var utils=require('../../config/utils');var config=require(_0x96a7('0x14'));var licenseUtil=require(_0x96a7('0x15'));var db=require(_0x96a7('0x16'))['db'];function respondWithStatusCode(_0x44538c,_0x446edb){_0x446edb=_0x446edb||0xcc;return function(_0x58922d){if(_0x58922d){return _0x44538c[_0x96a7('0x17')](_0x446edb);}return _0x44538c[_0x96a7('0x18')](_0x446edb)[_0x96a7('0x19')]();};}function respondWithResult(_0x1d1107,_0x55a624){_0x55a624=_0x55a624||0xc8;return function(_0x3d4df5){if(_0x3d4df5){return _0x1d1107[_0x96a7('0x18')](_0x55a624)[_0x96a7('0x1a')](_0x3d4df5);}};}function respondWithFilteredResult(_0x56186f,_0x15165b){return function(_0x38a0a3){if(_0x38a0a3){var _0x427560=typeof _0x15165b[_0x96a7('0x1b')]===_0x96a7('0x1c')&&typeof _0x15165b[_0x96a7('0x1d')]===_0x96a7('0x1c');var _0x5f0870=_0x38a0a3[_0x96a7('0x1e')];var _0x4291cb=_0x427560?0x0:_0x15165b[_0x96a7('0x1b')];var _0x2c25d3=_0x427560?_0x38a0a3[_0x96a7('0x1e')]:_0x15165b['offset']+_0x15165b[_0x96a7('0x1d')];var _0x5eda91;if(_0x2c25d3>=_0x5f0870){_0x2c25d3=_0x5f0870;_0x5eda91=0xc8;}else{_0x5eda91=0xce;}_0x56186f[_0x96a7('0x18')](_0x5eda91);return _0x56186f[_0x96a7('0x1f')]('Content-Range',_0x4291cb+'-'+_0x2c25d3+'/'+_0x5f0870)[_0x96a7('0x1a')](_0x38a0a3);}return null;};}function patchUpdates(_0x518482){return function(_0x5ddfa0){try{jsonpatch[_0x96a7('0x20')](_0x5ddfa0,_0x518482,!![]);}catch(_0x10b6c1){return BPromise[_0x96a7('0x21')](_0x10b6c1);}return _0x5ddfa0[_0x96a7('0x22')]();};}function saveUpdates(_0x496146,_0x1d99e6){return function(_0x881f8b){if(_0x881f8b){return _0x881f8b['update'](_0x496146)[_0x96a7('0x23')](function(_0x2a70ca){return _0x2a70ca;});}return null;};}function removeEntity(_0x5c5a33,_0x1a8ee8){return function(_0x3915ea){if(_0x3915ea){return _0x3915ea['destroy']()['then'](function(){_0x5c5a33[_0x96a7('0x18')](0xcc)[_0x96a7('0x19')]();});}};}function handleEntityNotFound(_0xb68940,_0xebab1){return function(_0x5b3bba){if(!_0x5b3bba){_0xb68940[_0x96a7('0x17')](0x194);}return _0x5b3bba;};}function handleError(_0x36a137,_0x27a775){_0x27a775=_0x27a775||0x1f4;return function(_0x41f1e0){logger[_0x96a7('0x24')](_0x41f1e0[_0x96a7('0x25')]);if(_0x41f1e0[_0x96a7('0x26')]){delete _0x41f1e0['name'];}_0x36a137['status'](_0x27a775)['send'](_0x41f1e0);};}exports[_0x96a7('0x27')]=function(_0x10ed5f,_0x40a17d){var _0x739e7={},_0x3ced0d={},_0x31a15f={'count':0x0,'rows':[]};var _0x38edee=_[_0x96a7('0x28')](db[_0x96a7('0x29')][_0x96a7('0x2a')],function(_0x1b63a9){return{'name':_0x1b63a9[_0x96a7('0x2b')],'type':_0x1b63a9[_0x96a7('0x2c')]['key']};});_0x3ced0d['model']=_[_0x96a7('0x28')](_0x38edee,_0x96a7('0x26'));_0x3ced0d[_0x96a7('0x2d')]=_[_0x96a7('0x2e')](_0x10ed5f[_0x96a7('0x2d')]);_0x3ced0d[_0x96a7('0x2f')]=_[_0x96a7('0x30')](_0x3ced0d[_0x96a7('0x31')],_0x3ced0d['query']);_0x739e7['attributes']=_[_0x96a7('0x30')](_0x3ced0d['model'],qs[_0x96a7('0x32')](_0x10ed5f[_0x96a7('0x2d')][_0x96a7('0x32')]));_0x739e7[_0x96a7('0x33')]=_0x739e7[_0x96a7('0x33')][_0x96a7('0x34')]?_0x739e7[_0x96a7('0x33')]:_0x3ced0d['model'];if(!_0x10ed5f[_0x96a7('0x2d')][_0x96a7('0x35')](_0x96a7('0x36'))){_0x739e7['limit']=qs['limit'](_0x10ed5f[_0x96a7('0x2d')]['limit']);_0x739e7[_0x96a7('0x1b')]=qs[_0x96a7('0x1b')](_0x10ed5f['query'][_0x96a7('0x1b')]);}_0x739e7[_0x96a7('0x37')]=qs['sort'](_0x10ed5f['query'][_0x96a7('0x38')]);_0x739e7['where']=qs[_0x96a7('0x2f')](_['pick'](_0x10ed5f[_0x96a7('0x2d')],_0x3ced0d[_0x96a7('0x2f')]),_0x38edee);if(_0x10ed5f[_0x96a7('0x2d')][_0x96a7('0x39')]){_0x739e7[_0x96a7('0x3a')]=_[_0x96a7('0x3b')](_0x739e7[_0x96a7('0x3a')],{'$or':_['map'](_0x38edee,function(_0x325c5b){if(_0x325c5b[_0x96a7('0x2c')]!==_0x96a7('0x3c')){var _0x2bd123={};_0x2bd123[_0x325c5b[_0x96a7('0x26')]]={'$like':'%'+_0x10ed5f[_0x96a7('0x2d')][_0x96a7('0x39')]+'%'};return _0x2bd123;}})});}_0x739e7=_[_0x96a7('0x3b')]({},_0x739e7,_0x10ed5f[_0x96a7('0x3d')]);var _0x74daa0={'where':_0x739e7[_0x96a7('0x3a')]};return db[_0x96a7('0x29')]['count'](_0x74daa0)[_0x96a7('0x23')](function(_0x2ff721){_0x31a15f['count']=_0x2ff721;if(_0x10ed5f[_0x96a7('0x2d')][_0x96a7('0x3e')]){_0x739e7['include']=[{'all':!![]}];}return db[_0x96a7('0x29')]['findAll'](_0x739e7);})['then'](function(_0x2d8d5e){_0x31a15f[_0x96a7('0x3f')]=_0x2d8d5e;return _0x31a15f;})[_0x96a7('0x23')](respondWithFilteredResult(_0x40a17d,_0x739e7))[_0x96a7('0x40')](handleError(_0x40a17d,null));};exports['show']=function(_0x4cdc6c,_0x39afa0){var _0x10010e={'raw':!![],'where':{'id':_0x4cdc6c[_0x96a7('0x41')]['id']}},_0xf95eac={};_0xf95eac[_0x96a7('0x31')]=_[_0x96a7('0x2e')](db[_0x96a7('0x29')][_0x96a7('0x2a')]);_0xf95eac['query']=_[_0x96a7('0x2e')](_0x4cdc6c[_0x96a7('0x2d')]);_0xf95eac[_0x96a7('0x2f')]=_['intersection'](_0xf95eac[_0x96a7('0x31')],_0xf95eac[_0x96a7('0x2d')]);_0x10010e['attributes']=_[_0x96a7('0x30')](_0xf95eac['model'],qs[_0x96a7('0x32')](_0x4cdc6c[_0x96a7('0x2d')][_0x96a7('0x32')]));_0x10010e[_0x96a7('0x33')]=_0x10010e[_0x96a7('0x33')][_0x96a7('0x34')]?_0x10010e[_0x96a7('0x33')]:_0xf95eac[_0x96a7('0x31')];if(_0x4cdc6c[_0x96a7('0x2d')][_0x96a7('0x3e')]){_0x10010e[_0x96a7('0x42')]=[{'all':!![]}];}_0x10010e=_[_0x96a7('0x3b')]({},_0x10010e,_0x4cdc6c[_0x96a7('0x3d')]);return db[_0x96a7('0x29')][_0x96a7('0x43')](_0x10010e)['then'](handleEntityNotFound(_0x39afa0,null))[_0x96a7('0x23')](respondWithResult(_0x39afa0,null))[_0x96a7('0x40')](handleError(_0x39afa0,null));};exports[_0x96a7('0x44')]=function(_0x18afb4,_0x1057d4){return db[_0x96a7('0x29')][_0x96a7('0x44')](_0x18afb4['body'],{})[_0x96a7('0x23')](respondWithResult(_0x1057d4,0xc9))[_0x96a7('0x40')](handleError(_0x1057d4,null));};exports[_0x96a7('0x45')]=function(_0x1ea5b3,_0x5f3983){if(_0x1ea5b3[_0x96a7('0x46')]['id']){delete _0x1ea5b3[_0x96a7('0x46')]['id'];}return db['FaxApplication'][_0x96a7('0x43')]({'where':{'id':_0x1ea5b3[_0x96a7('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f3983,null))[_0x96a7('0x23')](saveUpdates(_0x1ea5b3[_0x96a7('0x46')],null))[_0x96a7('0x23')](respondWithResult(_0x5f3983,null))[_0x96a7('0x40')](handleError(_0x5f3983,null));};exports[_0x96a7('0x47')]=function(_0xed6043,_0x11873f){return db[_0x96a7('0x29')][_0x96a7('0x43')]({'where':{'id':_0xed6043[_0x96a7('0x41')]['id']}})[_0x96a7('0x23')](handleEntityNotFound(_0x11873f,null))[_0x96a7('0x23')](removeEntity(_0x11873f,null))[_0x96a7('0x40')](handleError(_0x11873f,null));}; \ No newline at end of file +var _0x3bc8=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','FaxApplication','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3bc8,0x11a));var _0x83bc=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x3bc8[_0x2df724];return _0x1b2504;};'use strict';var emlformat=require(_0x83bc('0x0'));var rimraf=require(_0x83bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83bc('0x2'));var rp=require(_0x83bc('0x3'));var moment=require('moment');var BPromise=require(_0x83bc('0x4'));var Mustache=require(_0x83bc('0x5'));var util=require(_0x83bc('0x6'));var path=require(_0x83bc('0x7'));var sox=require(_0x83bc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83bc('0x9'));var _=require('lodash');var squel=require(_0x83bc('0xa'));var crypto=require(_0x83bc('0xb'));var jsforce=require(_0x83bc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83bc('0xd'));var Redis=require(_0x83bc('0xe'));var authService=require(_0x83bc('0xf'));var qs=require(_0x83bc('0x10'));var as=require(_0x83bc('0x11'));var hardwareService=require(_0x83bc('0x12'));var logger=require('../../config/logger')(_0x83bc('0x13'));var utils=require('../../config/utils');var config=require(_0x83bc('0x14'));var licenseUtil=require(_0x83bc('0x15'));var db=require(_0x83bc('0x16'))['db'];function respondWithStatusCode(_0x4297c7,_0x55959e){_0x55959e=_0x55959e||0xcc;return function(_0x1256e9){if(_0x1256e9){return _0x4297c7['sendStatus'](_0x55959e);}return _0x4297c7[_0x83bc('0x17')](_0x55959e)[_0x83bc('0x18')]();};}function respondWithResult(_0x5ee883,_0x23683c){_0x23683c=_0x23683c||0xc8;return function(_0x2527b0){if(_0x2527b0){return _0x5ee883[_0x83bc('0x17')](_0x23683c)[_0x83bc('0x19')](_0x2527b0);}};}function respondWithFilteredResult(_0x3320f3,_0x2508be){return function(_0x36386a){if(_0x36386a){var _0x50b51e=typeof _0x2508be['offset']===_0x83bc('0x1a')&&typeof _0x2508be['limit']===_0x83bc('0x1a');var _0x5c3f95=_0x36386a[_0x83bc('0x1b')];var _0x199966=_0x50b51e?0x0:_0x2508be[_0x83bc('0x1c')];var _0xf12bf8=_0x50b51e?_0x36386a[_0x83bc('0x1b')]:_0x2508be['offset']+_0x2508be[_0x83bc('0x1d')];var _0x3ef9fb;if(_0xf12bf8>=_0x5c3f95){_0xf12bf8=_0x5c3f95;_0x3ef9fb=0xc8;}else{_0x3ef9fb=0xce;}_0x3320f3[_0x83bc('0x17')](_0x3ef9fb);return _0x3320f3[_0x83bc('0x1e')](_0x83bc('0x1f'),_0x199966+'-'+_0xf12bf8+'/'+_0x5c3f95)['json'](_0x36386a);}return null;};}function patchUpdates(_0x4a8abc){return function(_0x402c5e){try{jsonpatch[_0x83bc('0x20')](_0x402c5e,_0x4a8abc,!![]);}catch(_0x38d912){return BPromise[_0x83bc('0x21')](_0x38d912);}return _0x402c5e[_0x83bc('0x22')]();};}function saveUpdates(_0x428325,_0x3116b8){return function(_0xf2e5ad){if(_0xf2e5ad){return _0xf2e5ad[_0x83bc('0x23')](_0x428325)[_0x83bc('0x24')](function(_0x51e20a){return _0x51e20a;});}return null;};}function removeEntity(_0x45121a,_0x53bbd4){return function(_0x501cb6){if(_0x501cb6){return _0x501cb6[_0x83bc('0x25')]()[_0x83bc('0x24')](function(){_0x45121a[_0x83bc('0x17')](0xcc)[_0x83bc('0x18')]();});}};}function handleEntityNotFound(_0x35b737,_0x4c2e67){return function(_0x20e369){if(!_0x20e369){_0x35b737[_0x83bc('0x26')](0x194);}return _0x20e369;};}function handleError(_0x39e709,_0x4a736f){_0x4a736f=_0x4a736f||0x1f4;return function(_0x47e62f){logger[_0x83bc('0x27')](_0x47e62f[_0x83bc('0x28')]);if(_0x47e62f[_0x83bc('0x29')]){delete _0x47e62f['name'];}_0x39e709[_0x83bc('0x17')](_0x4a736f)[_0x83bc('0x2a')](_0x47e62f);};}exports['index']=function(_0x17b403,_0x3ffa4d){var _0x296a09={},_0x59f29c={},_0x2ea578={'count':0x0,'rows':[]};var _0x24f4e7=_['map'](db[_0x83bc('0x2b')][_0x83bc('0x2c')],function(_0x5474e5){return{'name':_0x5474e5['fieldName'],'type':_0x5474e5[_0x83bc('0x2d')]['key']};});_0x59f29c[_0x83bc('0x2e')]=_['map'](_0x24f4e7,'name');_0x59f29c[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x17b403[_0x83bc('0x2f')]);_0x59f29c[_0x83bc('0x31')]=_[_0x83bc('0x32')](_0x59f29c['model'],_0x59f29c[_0x83bc('0x2f')]);_0x296a09['attributes']=_[_0x83bc('0x32')](_0x59f29c['model'],qs[_0x83bc('0x33')](_0x17b403[_0x83bc('0x2f')]['fields']));_0x296a09[_0x83bc('0x34')]=_0x296a09['attributes'][_0x83bc('0x35')]?_0x296a09[_0x83bc('0x34')]:_0x59f29c[_0x83bc('0x2e')];if(!_0x17b403[_0x83bc('0x2f')]['hasOwnProperty'](_0x83bc('0x36'))){_0x296a09['limit']=qs['limit'](_0x17b403['query'][_0x83bc('0x1d')]);_0x296a09['offset']=qs[_0x83bc('0x1c')](_0x17b403[_0x83bc('0x2f')]['offset']);}_0x296a09[_0x83bc('0x37')]=qs[_0x83bc('0x38')](_0x17b403['query'][_0x83bc('0x38')]);_0x296a09[_0x83bc('0x39')]=qs[_0x83bc('0x31')](_[_0x83bc('0x3a')](_0x17b403[_0x83bc('0x2f')],_0x59f29c[_0x83bc('0x31')]),_0x24f4e7);if(_0x17b403['query'][_0x83bc('0x3b')]){_0x296a09[_0x83bc('0x39')]=_[_0x83bc('0x3c')](_0x296a09[_0x83bc('0x39')],{'$or':_['map'](_0x24f4e7,function(_0x23871f){if(_0x23871f[_0x83bc('0x2d')]!==_0x83bc('0x3d')){var _0xd1ccae={};_0xd1ccae[_0x23871f[_0x83bc('0x29')]]={'$like':'%'+_0x17b403[_0x83bc('0x2f')][_0x83bc('0x3b')]+'%'};return _0xd1ccae;}})});}_0x296a09=_[_0x83bc('0x3c')]({},_0x296a09,_0x17b403[_0x83bc('0x3e')]);var _0x46042d={'where':_0x296a09[_0x83bc('0x39')]};return db['FaxApplication'][_0x83bc('0x1b')](_0x46042d)[_0x83bc('0x24')](function(_0x125477){_0x2ea578[_0x83bc('0x1b')]=_0x125477;if(_0x17b403[_0x83bc('0x2f')][_0x83bc('0x3f')]){_0x296a09[_0x83bc('0x40')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x296a09);})[_0x83bc('0x24')](function(_0x12c99b){_0x2ea578['rows']=_0x12c99b;return _0x2ea578;})[_0x83bc('0x24')](respondWithFilteredResult(_0x3ffa4d,_0x296a09))[_0x83bc('0x41')](handleError(_0x3ffa4d,null));};exports[_0x83bc('0x42')]=function(_0x115753,_0x2bf7be){var _0x3ba365={'raw':!![],'where':{'id':_0x115753[_0x83bc('0x43')]['id']}},_0x1c2fb7={};_0x1c2fb7[_0x83bc('0x2e')]=_['keys'](db['FaxApplication'][_0x83bc('0x2c')]);_0x1c2fb7[_0x83bc('0x2f')]=_[_0x83bc('0x30')](_0x115753['query']);_0x1c2fb7[_0x83bc('0x31')]=_[_0x83bc('0x32')](_0x1c2fb7[_0x83bc('0x2e')],_0x1c2fb7[_0x83bc('0x2f')]);_0x3ba365['attributes']=_['intersection'](_0x1c2fb7[_0x83bc('0x2e')],qs[_0x83bc('0x33')](_0x115753[_0x83bc('0x2f')][_0x83bc('0x33')]));_0x3ba365['attributes']=_0x3ba365[_0x83bc('0x34')][_0x83bc('0x35')]?_0x3ba365['attributes']:_0x1c2fb7[_0x83bc('0x2e')];if(_0x115753[_0x83bc('0x2f')][_0x83bc('0x3f')]){_0x3ba365[_0x83bc('0x40')]=[{'all':!![]}];}_0x3ba365=_[_0x83bc('0x3c')]({},_0x3ba365,_0x115753[_0x83bc('0x3e')]);return db[_0x83bc('0x2b')][_0x83bc('0x44')](_0x3ba365)[_0x83bc('0x24')](handleEntityNotFound(_0x2bf7be,null))['then'](respondWithResult(_0x2bf7be,null))[_0x83bc('0x41')](handleError(_0x2bf7be,null));};exports[_0x83bc('0x45')]=function(_0x335ce0,_0xdb30e9){return db[_0x83bc('0x2b')]['create'](_0x335ce0[_0x83bc('0x46')],{})[_0x83bc('0x24')](respondWithResult(_0xdb30e9,0xc9))[_0x83bc('0x41')](handleError(_0xdb30e9,null));};exports[_0x83bc('0x23')]=function(_0x35f414,_0x57f227){if(_0x35f414[_0x83bc('0x46')]['id']){delete _0x35f414['body']['id'];}return db['FaxApplication']['find']({'where':{'id':_0x35f414[_0x83bc('0x43')]['id']}})[_0x83bc('0x24')](handleEntityNotFound(_0x57f227,null))[_0x83bc('0x24')](saveUpdates(_0x35f414[_0x83bc('0x46')],null))[_0x83bc('0x24')](respondWithResult(_0x57f227,null))[_0x83bc('0x41')](handleError(_0x57f227,null));};exports['destroy']=function(_0x121a6f,_0x229b4b){return db['FaxApplication']['find']({'where':{'id':_0x121a6f['params']['id']}})[_0x83bc('0x24')](handleEntityNotFound(_0x229b4b,null))[_0x83bc('0x24')](removeEntity(_0x229b4b,null))['catch'](handleError(_0x229b4b,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f80f470..4301208 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 _0xaf54=['FaxApplication','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','define'];(function(_0x14e1e8,_0x50d9bd){var _0x4b178f=function(_0x279594){while(--_0x279594){_0x14e1e8['push'](_0x14e1e8['shift']());}};_0x4b178f(++_0x50d9bd);}(_0xaf54,0x1e3));var _0x4af5=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0xaf54[_0x10f68e];return _0x4c8372;};'use strict';var _=require('lodash');var util=require(_0x4af5('0x0'));var logger=require(_0x4af5('0x1'))(_0x4af5('0x2'));var moment=require(_0x4af5('0x3'));var BPromise=require(_0x4af5('0x4'));var rp=require(_0x4af5('0x5'));var fs=require('fs');var path=require(_0x4af5('0x6'));var rimraf=require(_0x4af5('0x7'));var config=require(_0x4af5('0x8'));var attributes=require(_0x4af5('0x9'));module['exports']=function(_0xba27fd,_0x2a10fd){return _0xba27fd[_0x4af5('0xa')](_0x4af5('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4af5('0xc')});}; \ No newline at end of file +var _0xf9e6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2bf741,_0x3cbd62){var _0x15ff5b=function(_0x2c5318){while(--_0x2c5318){_0x2bf741['push'](_0x2bf741['shift']());}};_0x15ff5b(++_0x3cbd62);}(_0xf9e6,0xc3));var _0x6f9e=function(_0x3c5faf,_0x357018){_0x3c5faf=_0x3c5faf-0x0;var _0x12fdcb=_0xf9e6[_0x3c5faf];return _0x12fdcb;};'use strict';var _=require('lodash');var util=require(_0x6f9e('0x0'));var logger=require('../../config/logger')(_0x6f9e('0x1'));var moment=require(_0x6f9e('0x2'));var BPromise=require(_0x6f9e('0x3'));var rp=require(_0x6f9e('0x4'));var fs=require('fs');var path=require(_0x6f9e('0x5'));var rimraf=require(_0x6f9e('0x6'));var config=require(_0x6f9e('0x7'));var attributes=require(_0x6f9e('0x8'));module[_0x6f9e('0x9')]=function(_0x16f7a4,_0x15b8df){return _0x16f7a4['define']('FaxApplication',attributes,{'tableName':_0x6f9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f9e('0xb'),'collate':_0x6f9e('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c115d3c..016b6e8 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 _0x50a7=['catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit','then','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x50a7,0x82));var _0x750a=function(_0x3c3982,_0x163010){_0x3c3982=_0x3c3982-0x0;var _0x66448f=_0x50a7[_0x3c3982];return _0x66448f;};'use strict';var _=require(_0x750a('0x0'));var util=require(_0x750a('0x1'));var moment=require(_0x750a('0x2'));var BPromise=require(_0x750a('0x3'));var rs=require(_0x750a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x750a('0x5'));var logger=require(_0x750a('0x6'))(_0x750a('0x7'));var config=require(_0x750a('0x8'));var jayson=require(_0x750a('0x9'));var client=jayson['client'][_0x750a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1651da,_0x1afcb5,_0x423ddb){return new BPromise(function(_0x4c9f71,_0x1abb42){return client[_0x750a('0xb')](_0x1651da,_0x423ddb)['then'](function(_0x4069da){logger[_0x750a('0xc')](_0x750a('0xd'),_0x1afcb5,_0x750a('0xe'));logger['debug'](_0x750a('0xf'),_0x1afcb5,_0x750a('0xe'),JSON['stringify'](_0x4069da));if(_0x4069da[_0x750a('0x10')]){if(_0x4069da['error'][_0x750a('0x11')]===0x1f4){logger[_0x750a('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1afcb5,_0x4069da[_0x750a('0x10')][_0x750a('0x12')]);return _0x1abb42(_0x4069da['error'][_0x750a('0x12')]);}logger[_0x750a('0x10')](_0x750a('0xd'),_0x1afcb5,_0x4069da[_0x750a('0x10')][_0x750a('0x12')]);return _0x4c9f71(_0x4069da[_0x750a('0x10')]['message']);}else{logger[_0x750a('0xc')](_0x750a('0xd'),_0x1afcb5,'request\x20sent');_0x4c9f71(_0x4069da[_0x750a('0x13')][_0x750a('0x12')]);}})[_0x750a('0x14')](function(_0x5d128a){logger[_0x750a('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1afcb5,_0x5d128a);_0x1abb42(_0x5d128a);});});}exports[_0x750a('0x15')]=function(_0x3c0dab){var _0x4f32f3=this;return new Promise(function(_0x1e17c0,_0x4ec099){return db[_0x750a('0x16')][_0x750a('0x17')](_0x3c0dab[_0x750a('0x18')],{'raw':_0x3c0dab[_0x750a('0x19')]?_0x3c0dab['options'][_0x750a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c0dab[_0x750a('0x19')]?_0x3c0dab['options']['where']||null:null,'attributes':_0x3c0dab[_0x750a('0x19')]?_0x3c0dab[_0x750a('0x19')]['attributes']||null:null,'limit':_0x3c0dab[_0x750a('0x19')]?_0x3c0dab[_0x750a('0x19')][_0x750a('0x1b')]||null:null})[_0x750a('0x1c')](function(_0x4d3011){logger[_0x750a('0xc')](_0x750a('0x15'),_0x3c0dab);logger['debug']('UpdateFaxApplication',_0x3c0dab,JSON[_0x750a('0x1d')](_0x4d3011));_0x1e17c0(_0x4d3011);})['catch'](function(_0x2a9774){logger['error'](_0x750a('0x15'),_0x2a9774[_0x750a('0x12')],_0x3c0dab);_0x4ec099(_0x4f32f3[_0x750a('0x10')](0x1f4,_0x2a9774[_0x750a('0x12')]));});});}; \ No newline at end of file +var _0xa209=['../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','options','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x31ce66,_0x8a90f6){var _0x54e63a=function(_0xacb50a){while(--_0xacb50a){_0x31ce66['push'](_0x31ce66['shift']());}};_0x54e63a(++_0x8a90f6);}(_0xa209,0x1bb));var _0x9a20=function(_0x59ef74,_0x10b1ec){_0x59ef74=_0x59ef74-0x0;var _0x1d1c4c=_0xa209[_0x59ef74];return _0x1d1c4c;};'use strict';var _=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var moment=require(_0x9a20('0x2'));var BPromise=require(_0x9a20('0x3'));var rs=require(_0x9a20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a20('0x6'))('rpc');var config=require(_0x9a20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9a20('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b2e73,_0x3ecc30,_0x36ca81){return new BPromise(function(_0x2748a1,_0x5ecbc0){return client[_0x9a20('0x9')](_0x5b2e73,_0x36ca81)[_0x9a20('0xa')](function(_0x4a322d){logger[_0x9a20('0xb')](_0x9a20('0xc'),_0x3ecc30,_0x9a20('0xd'));logger[_0x9a20('0xe')](_0x9a20('0xf'),_0x3ecc30,_0x9a20('0xd'),JSON[_0x9a20('0x10')](_0x4a322d));if(_0x4a322d[_0x9a20('0x11')]){if(_0x4a322d[_0x9a20('0x11')][_0x9a20('0x12')]===0x1f4){logger[_0x9a20('0x11')](_0x9a20('0xc'),_0x3ecc30,_0x4a322d[_0x9a20('0x11')][_0x9a20('0x13')]);return _0x5ecbc0(_0x4a322d['error'][_0x9a20('0x13')]);}logger[_0x9a20('0x11')](_0x9a20('0xc'),_0x3ecc30,_0x4a322d[_0x9a20('0x11')][_0x9a20('0x13')]);return _0x2748a1(_0x4a322d[_0x9a20('0x11')][_0x9a20('0x13')]);}else{logger[_0x9a20('0xb')](_0x9a20('0xc'),_0x3ecc30,'request\x20sent');_0x2748a1(_0x4a322d[_0x9a20('0x14')][_0x9a20('0x13')]);}})['catch'](function(_0x339f55){logger[_0x9a20('0x11')](_0x9a20('0xc'),_0x3ecc30,_0x339f55);_0x5ecbc0(_0x339f55);});});}exports[_0x9a20('0x15')]=function(_0x32d392){var _0x5f8419=this;return new Promise(function(_0x3d5633,_0x4d4c3e){return db[_0x9a20('0x16')]['update'](_0x32d392['body'],{'raw':_0x32d392['options']?_0x32d392['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32d392[_0x9a20('0x17')]?_0x32d392[_0x9a20('0x17')][_0x9a20('0x18')]||null:null,'attributes':_0x32d392['options']?_0x32d392[_0x9a20('0x17')][_0x9a20('0x19')]||null:null,'limit':_0x32d392[_0x9a20('0x17')]?_0x32d392[_0x9a20('0x17')][_0x9a20('0x1a')]||null:null})[_0x9a20('0xa')](function(_0x522399){logger[_0x9a20('0xb')](_0x9a20('0x15'),_0x32d392);logger[_0x9a20('0xe')]('UpdateFaxApplication',_0x32d392,JSON['stringify'](_0x522399));_0x3d5633(_0x522399);})[_0x9a20('0x1b')](function(_0x33420b){logger['error'](_0x9a20('0x15'),_0x33420b[_0x9a20('0x13')],_0x32d392);_0x4d4c3e(_0x5f8419[_0x9a20('0x11')](0x1f4,_0x33420b[_0x9a20('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index a700bd3..18d53de 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 _0x1eba=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x1eba[_0x4e1a49];return _0x136aae;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0xf')]);router['put'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router['delete'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x11')]);module[_0xa1eb('0x12')]=router; \ No newline at end of file +var _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1770dc,_0x4aa2cf){_0x1770dc=_0x1770dc-0x0;var _0x166cba=_0xf7b4[_0x1770dc];return _0x166cba;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 0ef8647..dc667d0 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 _0x66aa=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x24e653,_0x4319ae){var _0x6be921=function(_0x2832e7){while(--_0x2832e7){_0x24e653['push'](_0x24e653['shift']());}};_0x6be921(++_0x4319ae);}(_0x66aa,0xb7));var _0xa66a=function(_0x4b8654,_0x530d52){_0x4b8654=_0x4b8654-0x0;var _0x14902c=_0x66aa[_0x4b8654];return _0x14902c;};'use strict';var Sequelize=require(_0xa66a('0x0'));module[_0xa66a('0x1')]={'closed':{'type':Sequelize[_0xa66a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa66a('0x3')]},'disposition':{'type':Sequelize[_0xa66a('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa66a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xa66a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa66a('0x5')]('in',_0xa66a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa66a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa66a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf0ca=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0xf0ca,0x152));var _0xaf0c=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xf0ca[_0x810025];return _0x4dbc81;};'use strict';var Sequelize=require(_0xaf0c('0x0'));module[_0xaf0c('0x1')]={'closed':{'type':Sequelize[_0xaf0c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaf0c('0x3')]},'disposition':{'type':Sequelize[_0xaf0c('0x4')]},'secondDisposition':{'type':Sequelize[_0xaf0c('0x4')]},'thirdDisposition':{'type':Sequelize[_0xaf0c('0x4')]},'note':{'type':Sequelize[_0xaf0c('0x4')]},'read1stAt':{'type':Sequelize[_0xaf0c('0x3')]},'fax':{'type':Sequelize[_0xaf0c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xaf0c('0x5')]('in',_0xaf0c('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index a28eaf4..c1ff25a 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 _0xe133=['basename','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','send','Users','fullname','TagIds','Tags','forEach','push','map','FaxInteraction','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','start','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','catch','includeAll','include','options','create','params','describe','addMessage','FaxMessage','ids','getMessages','findOne','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','download','join','root','server','tmp','attachments','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','createWriteStream'];(function(_0x228eed,_0x152e4b){var _0x2925d9=function(_0x26e731){while(--_0x26e731){_0x228eed['push'](_0x228eed['shift']());}};_0x2925d9(++_0x152e4b);}(_0xe133,0xd9));var _0x3e13=function(_0x5e6e87,_0x229402){_0x5e6e87=_0x5e6e87-0x0;var _0x5a4e68=_0xe133[_0x5e6e87];return _0x5a4e68;};'use strict';var emlformat=require(_0x3e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e13('0x1'));var jsonpatch=require(_0x3e13('0x2'));var rp=require('request-promise');var moment=require(_0x3e13('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e13('0x4'));var util=require(_0x3e13('0x5'));var path=require('path');var sox=require(_0x3e13('0x6'));var csv=require('to-csv');var ejs=require(_0x3e13('0x7'));var fs=require('fs');var fs_extra=require(_0x3e13('0x8'));var _=require(_0x3e13('0x9'));var squel=require(_0x3e13('0xa'));var crypto=require(_0x3e13('0xb'));var jsforce=require(_0x3e13('0xc'));var deskjs=require(_0x3e13('0xd'));var toCsv=require(_0x3e13('0xe'));var querystring=require('querystring');var Papa=require(_0x3e13('0xf'));var Redis=require(_0x3e13('0x10'));var authService=require(_0x3e13('0x11'));var qs=require(_0x3e13('0x12'));var as=require(_0x3e13('0x13'));var hardwareService=require(_0x3e13('0x14'));var logger=require('../../config/logger')(_0x3e13('0x15'));var utils=require(_0x3e13('0x16'));var config=require(_0x3e13('0x17'));var licenseUtil=require(_0x3e13('0x18'));var db=require(_0x3e13('0x19'))['db'];config[_0x3e13('0x1a')]=_[_0x3e13('0x1b')](config['redis'],{'host':_0x3e13('0x1c'),'port':0x18eb});var socket=require(_0x3e13('0x1d'))(new Redis(config['redis']));require(_0x3e13('0x1e'))[_0x3e13('0x1f')](socket);function respondWithStatusCode(_0x286443,_0x529828){_0x529828=_0x529828||0xcc;return function(_0xd3ee0e){if(_0xd3ee0e){return _0x286443['sendStatus'](_0x529828);}return _0x286443[_0x3e13('0x20')](_0x529828)[_0x3e13('0x21')]();};}function respondWithResult(_0x272b75,_0x594330){_0x594330=_0x594330||0xc8;return function(_0x2ba881){if(_0x2ba881){return _0x272b75[_0x3e13('0x20')](_0x594330)['json'](_0x2ba881);}};}function respondWithFilteredResult(_0x51e15d,_0x6d8bb2){return function(_0x2309be){if(_0x2309be){var _0x25e25a=typeof _0x6d8bb2['offset']==='undefined'&&typeof _0x6d8bb2[_0x3e13('0x22')]===_0x3e13('0x23');var _0x279102=_0x2309be[_0x3e13('0x24')];var _0x364be8=_0x25e25a?0x0:_0x6d8bb2[_0x3e13('0x25')];var _0x7fb5c3=_0x25e25a?_0x2309be[_0x3e13('0x24')]:_0x6d8bb2[_0x3e13('0x25')]+_0x6d8bb2[_0x3e13('0x22')];var _0x39e2b6;if(_0x7fb5c3>=_0x279102){_0x7fb5c3=_0x279102;_0x39e2b6=0xc8;}else{_0x39e2b6=0xce;}_0x51e15d['status'](_0x39e2b6);return _0x51e15d[_0x3e13('0x26')](_0x3e13('0x27'),_0x364be8+'-'+_0x7fb5c3+'/'+_0x279102)[_0x3e13('0x28')](_0x2309be);}return null;};}function patchUpdates(_0x20b3c9){return function(_0x5f066e){try{jsonpatch[_0x3e13('0x29')](_0x5f066e,_0x20b3c9,!![]);}catch(_0x441c10){return BPromise['reject'](_0x441c10);}return _0x5f066e[_0x3e13('0x2a')]();};}function saveUpdates(_0x4e9176,_0x237637){return function(_0x6d7bbb){if(_0x6d7bbb){return _0x6d7bbb[_0x3e13('0x2b')](_0x4e9176)[_0x3e13('0x2c')](function(_0x2009ac){return _0x2009ac;});}return null;};}function removeEntity(_0xd96353,_0x3316b7){return function(_0x5cf2d4){if(_0x5cf2d4){return _0x5cf2d4[_0x3e13('0x2d')]()[_0x3e13('0x2c')](function(){_0xd96353[_0x3e13('0x20')](0xcc)[_0x3e13('0x21')]();});}};}function handleEntityNotFound(_0xc593a6,_0x4ca1f3){return function(_0x562217){if(!_0x562217){_0xc593a6[_0x3e13('0x2e')](0x194);}return _0x562217;};}function handleError(_0xe00700,_0x2cf0a7){_0x2cf0a7=_0x2cf0a7||0x1f4;return function(_0x161b57){logger[_0x3e13('0x2f')](_0x161b57[_0x3e13('0x30')]);if(_0x161b57['name']){delete _0x161b57['name'];}_0xe00700[_0x3e13('0x20')](_0x2cf0a7)[_0x3e13('0x31')](_0x161b57);};}function getInteractionUsers(_0x491d37,_0x3d16de){return new BPromise(function(_0xfa802a,_0x4f9f54){try{if(_0x3d16de[_0x491d37['id']]){_0x491d37[_0x3e13('0x32')]=_['map'](_0x3d16de[_0x491d37['id']],function(_0x2ba32c){return{'id':_0x2ba32c['id'],'fullname':_0x2ba32c[_0x3e13('0x33')]};});}}catch(_0xca107f){_0x4f9f54(_0xca107f);}_0xfa802a(_0x491d37);});}function getInteractionTags(_0x3111a8,_0x580a9e){return new BPromise(function(_0x171598,_0x45dbcd){try{if(_0x3111a8[_0x3e13('0x34')]){_0x3111a8[_0x3e13('0x35')]=[];_0x3111a8['TagIds']['split'](',')[_0x3e13('0x36')](function(_0x35f28a){_0x3111a8['Tags'][_0x3e13('0x37')](_0x580a9e[_0x35f28a]);});}delete _0x3111a8[_0x3e13('0x34')];}catch(_0x5f50a7){_0x45dbcd(_0x5f50a7);}_0x171598(_0x3111a8);});}function updateFaxInteraction(_0x2fa824,_0x1a0973,_0xbb40b0){return new BPromise(function(_0x52fe44,_0x5aa29c){return getInteractionUsers(_0x2fa824,_0xbb40b0)[_0x3e13('0x2c')](function(_0x571721){return getInteractionTags(_0x571721,_0x1a0973);})[_0x3e13('0x2c')](function(_0x46c31f){_0x52fe44(_0x46c31f);})['catch'](function(_0x4f69cc){_0x5aa29c(_0x4f69cc);});});}exports['index']=function(_0x5b4431,_0x35da6b){var _0x2c5bd7={},_0x5a2fcb={},_0x146906={'count':0x0,'rows':[]};var _0x26197d=_[_0x3e13('0x38')](db[_0x3e13('0x39')][_0x3e13('0x3a')],function(_0x4528db){return{'name':_0x4528db[_0x3e13('0x3b')],'type':_0x4528db[_0x3e13('0x3c')][_0x3e13('0x3d')]};});_0x5a2fcb[_0x3e13('0x3e')]=_[_0x3e13('0x38')](_0x26197d,_0x3e13('0x3f'));_0x5a2fcb[_0x3e13('0x40')]=_[_0x3e13('0x41')](_0x5b4431['query']);_0x5a2fcb[_0x3e13('0x42')]=_[_0x3e13('0x43')](_0x5a2fcb['model'],_0x5a2fcb[_0x3e13('0x40')]);_0x2c5bd7[_0x3e13('0x44')]=_[_0x3e13('0x43')](_0x5a2fcb[_0x3e13('0x3e')],qs[_0x3e13('0x45')](_0x5b4431[_0x3e13('0x40')][_0x3e13('0x45')]));_0x2c5bd7[_0x3e13('0x44')]=_0x2c5bd7['attributes']['length']?_0x2c5bd7['attributes']:_0x5a2fcb[_0x3e13('0x3e')];if(!_0x5b4431[_0x3e13('0x40')][_0x3e13('0x46')](_0x3e13('0x47'))){_0x2c5bd7[_0x3e13('0x22')]=qs[_0x3e13('0x22')](_0x5b4431[_0x3e13('0x40')][_0x3e13('0x22')]);_0x2c5bd7[_0x3e13('0x25')]=qs[_0x3e13('0x25')](_0x5b4431[_0x3e13('0x40')][_0x3e13('0x25')]);}_0x2c5bd7[_0x3e13('0x48')]=qs['sort'](_0x5b4431[_0x3e13('0x40')][_0x3e13('0x49')]);_0x2c5bd7['where']=qs[_0x3e13('0x42')](_[_0x3e13('0x4a')](_0x5b4431[_0x3e13('0x40')],_0x5a2fcb[_0x3e13('0x42')]),_0x26197d);var _0x415111=[];var _0x4fe614=squel[_0x3e13('0x4b')]()[_0x3e13('0x4c')]('id')[_0x3e13('0x4c')](_0x3e13('0x3f'))[_0x3e13('0x4c')](_0x3e13('0x4d'))[_0x3e13('0x4e')](_0x3e13('0x4f'));var _0x1aea2c=squel[_0x3e13('0x4b')]()[_0x3e13('0x4c')](_0x3e13('0x50'))[_0x3e13('0x4c')](_0x3e13('0x51'))['field'](_0x3e13('0x52'))[_0x3e13('0x4e')](_0x3e13('0x53'),'ui')[_0x3e13('0x54')]('users','u','u.id\x20=\x20ui.UserId');var _0x4bf139=squel['select']()[_0x3e13('0x4e')](_0x3e13('0x55'),'i')['left_join']('cm_contacts','c',_0x3e13('0x56'))[_0x3e13('0x54')]('users','o',_0x3e13('0x57'))['left_join']('fax_accounts','a',_0x3e13('0x58'))[_0x3e13('0x54')]('fax_messages','me',_0x3e13('0x59'))[_0x3e13('0x54')](_0x3e13('0x5a'),'it',_0x3e13('0x5b'))['left_join'](_0x3e13('0x4f'),'t',_0x3e13('0x5c'));var _0x40c027=squel[_0x3e13('0x5d')]();var _0x525d7f=[];var _0x46c51e=squel[_0x3e13('0x5d')]();var _0x6a4984;if(_0x5b4431[_0x3e13('0x40')]['search']){_0x6a4984=as[_0x3e13('0x5e')](_0x5b4431['query'][_0x3e13('0x5f')]);var _0x3596f1=_0x6a4984[_0x3e13('0x60')];for(var _0x225f75=0x0;_0x225f75<_0x6a4984[_0x3e13('0x61')][_0x3e13('0x62')];_0x225f75++){var _0x1e702b=_0x6a4984['conditions'][_0x225f75];var _0x4dfc2e='i';var _0x5dc378=_[_0x3e13('0x63')](_0x26197d,[_0x3e13('0x3f'),_0x1e702b[_0x3e13('0x4c')]]);if(!_0x5dc378){switch(_0x1e702b[_0x3e13('0x4c')]){case _0x3e13('0x64'):if(_0x1e702b[_0x3e13('0x65')]==0x1){_0x4bf139[_0x3e13('0x66')]('`'+_0x1e702b[_0x3e13('0x4c')]+_0x3e13('0x67'));}else{_0x4bf139[_0x3e13('0x66')]('`'+_0x1e702b[_0x3e13('0x4c')]+_0x3e13('0x68'));}break;case _0x3e13('0x69'):if(_0x1e702b[_0x3e13('0x6a')]==='$substring'){if(_0x1e702b[_0x3e13('0x65')][_0x3e13('0x6b')]('\x20')[_0x3e13('0x62')]>0x1){_0x40c027[_0x3596f1](_0x3e13('0x6c'),qs[_0x3e13('0x6d')](_0x1e702b['value']),null);}else{var _0x18e3bc='%'+_0x1e702b[_0x3e13('0x65')]+'%';_0x40c027[_0x3596f1](_0x3e13('0x6e'),_0x18e3bc,_0x18e3bc,_0x18e3bc);}}else{_0x5dc378=_[_0x3e13('0x63')](_0x26197d,[_0x3e13('0x3f'),_0x3e13('0x6f')]);_0x1e702b[_0x3e13('0x4c')]=_0x3e13('0x6f');_0x501628=as[_0x3e13('0x70')](_0x4dfc2e,_0x5dc378[_0x3e13('0x3c')],_0x1e702b);_0x40c027[_0x3596f1](_0x501628[_0x3e13('0x71')],_0x501628['value']['start'],_0x501628[_0x3e13('0x65')][_0x3e13('0x21')]);}break;case _0x3e13('0x72'):var _0x295a68=_0x1e702b[_0x3e13('0x65')][_0x3e13('0x6b')](',')[_0x3e13('0x38')](function(_0x2f4ddf){return Number(_0x2f4ddf);});_0x295a68[_0x3e13('0x36')](function(_0x59d276){_0x46c51e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x59d276+',%');});_0x525d7f=_['union'](_0x525d7f,_0x295a68);break;case _0x3e13('0x73'):if(_0x1e702b[_0x3e13('0x6a')]===_0x3e13('0x74')){_0x40c027[_0x3596f1](_0x3e13('0x75'),'%'+_0x1e702b['value']+'%',null);}else{_0x5dc378=_[_0x3e13('0x63')](_0x26197d,[_0x3e13('0x3f'),_0x3e13('0x76')]);_0x1e702b[_0x3e13('0x4c')]=_0x3e13('0x76');_0x501628=as[_0x3e13('0x70')](_0x4dfc2e,_0x5dc378[_0x3e13('0x3c')],_0x1e702b);_0x40c027[_0x3596f1](_0x501628[_0x3e13('0x71')],_0x501628['value']['start'],_0x501628[_0x3e13('0x65')][_0x3e13('0x21')]);}break;case _0x3e13('0x77'):_0x501628=as[_0x3e13('0x70')]('me',null,_0x1e702b);_0x40c027[_0x3596f1](_0x501628[_0x3e13('0x71')],_0x501628[_0x3e13('0x65')][_0x3e13('0x78')],_0x501628[_0x3e13('0x65')][_0x3e13('0x21')]);break;}}else{var _0x501628=as[_0x3e13('0x70')](_0x4dfc2e,_0x5dc378['type'],_0x1e702b);_0x40c027[_0x3596f1](_0x501628[_0x3e13('0x71')],_0x501628[_0x3e13('0x65')][_0x3e13('0x78')],_0x501628[_0x3e13('0x65')][_0x3e13('0x21')]);}}}else{var _0x23ea23=_(_0x5b4431[_0x3e13('0x40')])[_0x3e13('0x41')]()[_0x3e13('0x38')](function(_0x59cac0){return _[_0x3e13('0x79')](_0x26197d,[_0x3e13('0x3f'),_0x59cac0])?_0x59cac0:undefined;})['compact']()[_0x3e13('0x65')]();if(!_[_0x3e13('0x7a')](_0x23ea23)){_0x23ea23[_0x3e13('0x36')](function(_0x14930a){if(_0x14930a===_0x3e13('0x7b')){_0x4bf139['where'](_0x3e13('0x7c'),[][_0x3e13('0x7d')](_0x5b4431[_0x3e13('0x40')][_0x14930a]));}else if(_0x14930a===_0x3e13('0x7e')){var _0x11d8cc=JSON[_0x3e13('0x7f')](_0x5b4431['query'][_0x14930a])[_0x3e13('0x80')];var _0x124ccd=JSON[_0x3e13('0x7f')](_0x5b4431['query'][_0x14930a])[_0x3e13('0x81')];_0x4bf139[_0x3e13('0x82')](_0x3e13('0x83'),_0x11d8cc,_0x124ccd);}else{if(_0x5b4431[_0x3e13('0x40')][_0x14930a]===_0x3e13('0x84')){_0x4bf139[_0x3e13('0x82')]('i.'+_0x14930a+_0x3e13('0x85'));}else{_0x4bf139[_0x3e13('0x82')]('i.'+_0x14930a+'\x20=\x20?',_0x5b4431[_0x3e13('0x40')][_0x14930a]);}}});}if(_0x5b4431['query'][_0x3e13('0x86')]){if(_0x5b4431[_0x3e13('0x40')][_0x3e13('0x86')]==0x1){_0x4bf139[_0x3e13('0x66')]('`unreadMessages`\x20=\x200');}else{_0x4bf139[_0x3e13('0x66')]('`unreadMessages`\x20>\x200');}}if(_0x5b4431[_0x3e13('0x40')]['tag']){_0x525d7f=_[_0x3e13('0x87')](_0x5b4431[_0x3e13('0x40')][_0x3e13('0x88')])?_0x5b4431[_0x3e13('0x40')][_0x3e13('0x88')]:new Array(_0x5b4431[_0x3e13('0x40')]['tag']);_0x525d7f[_0x3e13('0x36')](function(_0x16de7d){_0x46c51e['or'](_0x3e13('0x89'),'%,'+_0x16de7d+',%');});}if(_0x5b4431[_0x3e13('0x40')]['filter']){var _0x38fd3b=_0x5b4431[_0x3e13('0x40')]['filter'][_0x3e13('0x8a')]('\x5c','\x5c\x5c')[_0x3e13('0x8a')](/'/g,'\x27\x27');if(qs[_0x3e13('0x8b')](_0x38fd3b)){_0x40c027['or'](_0x3e13('0x8c'),_0x38fd3b+'%')['or'](_0x3e13('0x8d'),_0x38fd3b+'%');}_0x40c027['or'](_0x3e13('0x8e'),_0x38fd3b+'%');}}_0x4bf139[_0x3e13('0x82')](_0x40c027);_0x4bf139[_0x3e13('0x8f')](_0x3e13('0x90'));var _0xdce2fe={'type':db['Sequelize'][_0x3e13('0x91')][_0x3e13('0x92')],'raw':!![]};var _0x19f569=_0x4bf139['clone']();_0x19f569[_0x3e13('0x4c')](_0x3e13('0x90'));_0x19f569[_0x3e13('0x4c')](_0x3e13('0x93'),_0x3e13('0x64'));if(_0x2c5bd7[_0x3e13('0x48')]){_0x2c5bd7['order'][_0x3e13('0x36')](function(_0xda20da){var _0x5376bb=_0xda20da[0x0]===_0x3e13('0x94')?_0xda20da[0x0]:'i.'+_0xda20da[0x0];_0x4bf139[_0x3e13('0x48')](_0x5376bb,_0xda20da[0x1]===_0x3e13('0x95')?![]:!![]);});}if(!_[_0x3e13('0x7a')](_0x525d7f)){_0x4bf139[_0x3e13('0x66')](_0x46c51e);_0x19f569['where'](_0x3e13('0x96'),_0x525d7f);}BPromise[_0x3e13('0x97')]()['then'](function(){if(!_0x6a4984){if(_0x5b4431['query'][_0x3e13('0x7b')])return;_0x19f569[_0x3e13('0x82')](_0x3e13('0x98'));_0x4bf139[_0x3e13('0x82')](_0x3e13('0x98'));return;}if(_0x5b4431[_0x3e13('0x99')]['role']!==_0x3e13('0x9a'))return;return _0x5b4431[_0x3e13('0x99')][_0x3e13('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x14b58b){if(_[_0x3e13('0x7a')](_0x14b58b)){_0x19f569[_0x3e13('0x82')](_0x3e13('0x9c'));_0x4bf139[_0x3e13('0x82')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x19f569[_0x3e13('0x82')](_0x3e13('0x7c'),_[_0x3e13('0x38')](_0x14b58b,'id'));_0x4bf139[_0x3e13('0x82')](_0x3e13('0x7c'),_[_0x3e13('0x38')](_0x14b58b,'id'));}});})[_0x3e13('0x2c')](function(){if(_0x5b4431[_0x3e13('0x99')][_0x3e13('0x9d')]===_0x3e13('0x9a')&&!_0x6a4984&&!_0x5b4431[_0x3e13('0x40')]['FaxAccountId'])return[];return db['sequelize'][_0x3e13('0x40')](_0x19f569[_0x3e13('0x9e')](),_0xdce2fe);})[_0x3e13('0x2c')](function(_0x571613){_0x146906[_0x3e13('0x24')]=_0x571613['length'];if(_0x146906[_0x3e13('0x24')]===0x0)return[];return db[_0x3e13('0x9f')][_0x3e13('0x40')](_0x4fe614['toString'](),_0xdce2fe)['then'](function(_0x107342){_0x415111=_[_0x3e13('0xa0')](_0x107342,'id');_0xdce2fe=_[_0x3e13('0xa1')](_0xdce2fe,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b4431[_0x3e13('0x40')][_0x3e13('0x45')]){_0x2c5bd7[_0x3e13('0x44')][_0x3e13('0x36')](function(_0x57561b){_0x4bf139[_0x3e13('0x4c')]('i.'+_0x57561b);});}else{_0x4bf139[_0x3e13('0x4c')](_0x3e13('0x93'),_0x3e13('0x64'));_0x4bf139['field'](_0x3e13('0xa2'),_0x3e13('0xa3'));_0x4bf139['field'](_0x3e13('0xa4'),'Account.mandatoryDisposition');_0x4bf139[_0x3e13('0x4c')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x3e13('0x94'));_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xa5'));_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xa6'),'Contact.firstName');_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xa7'),_0x3e13('0xa8'));_0x4bf139[_0x3e13('0x4c')]('c.email',_0x3e13('0xa9'));_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xaa'),_0x3e13('0xab'));_0x4bf139[_0x3e13('0x4c')]('c.mobile','Contact.mobile');_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xac'),_0x3e13('0xad'));_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xae'),_0x3e13('0xaf'));_0x4bf139[_0x3e13('0x4c')](_0x3e13('0xb0'),'Owner.internal');_0x4bf139[_0x3e13('0x4c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3e13('0x34'));}if(_0x2c5bd7[_0x3e13('0x22')])_0x4bf139['limit'](_0x2c5bd7[_0x3e13('0x22')]);if(_0x2c5bd7[_0x3e13('0x25')])_0x4bf139[_0x3e13('0x25')](_0x2c5bd7['offset']);return db['sequelize'][_0x3e13('0x40')](_0x4bf139[_0x3e13('0x9e')](),_0xdce2fe);})[_0x3e13('0x2c')](function(_0x2f91a7){if(_0x2f91a7[_0x3e13('0x62')]>0x0)_0x1aea2c['where'](_0x3e13('0xb1'),_['map'](_0x2f91a7,'id'));return db[_0x3e13('0x9f')][_0x3e13('0x40')](_0x1aea2c[_0x3e13('0x9e')](),_0xdce2fe)[_0x3e13('0x2c')](function(_0x4ad3fc){var _0x4f532a=_[_0x3e13('0xb2')](_0x4ad3fc,_0x3e13('0xb3'));var _0x134e1f=[];_0x2f91a7[_0x3e13('0x36')](function(_0x392542){_0x134e1f['push'](updateFaxInteraction(_0x392542,_0x415111,_0x4f532a));});return BPromise['all'](_0x134e1f);});});})[_0x3e13('0x2c')](function(_0x1ab2d9){_0x146906[_0x3e13('0xb4')]=_0x1ab2d9;return _0x146906;})['then'](respondWithFilteredResult(_0x35da6b,_0x2c5bd7))[_0x3e13('0xb5')](handleError(_0x35da6b,null));};exports['show']=function(_0x2e1ab1,_0x3968fe){var _0x3f7745={'raw':![],'where':{'id':_0x2e1ab1['params']['id']}},_0x73680f={};_0x73680f[_0x3e13('0x3e')]=_[_0x3e13('0x41')](db['FaxInteraction']['rawAttributes']);_0x73680f[_0x3e13('0x40')]=_[_0x3e13('0x41')](_0x2e1ab1[_0x3e13('0x40')]);_0x73680f['filters']=_['intersection'](_0x73680f[_0x3e13('0x3e')],_0x73680f['query']);_0x3f7745[_0x3e13('0x44')]=_[_0x3e13('0x43')](_0x73680f[_0x3e13('0x3e')],qs[_0x3e13('0x45')](_0x2e1ab1['query']['fields']));_0x3f7745['attributes']=_0x3f7745[_0x3e13('0x44')]['length']?_0x3f7745['attributes']:_0x73680f[_0x3e13('0x3e')];if(_0x2e1ab1['query'][_0x3e13('0xb6')]){_0x3f7745[_0x3e13('0xb7')]=[{'all':!![]}];}_0x3f7745=_[_0x3e13('0xa1')]({},_0x3f7745,_0x2e1ab1[_0x3e13('0xb8')]);return db[_0x3e13('0x39')][_0x3e13('0x63')](_0x3f7745)[_0x3e13('0x2c')](handleEntityNotFound(_0x3968fe,null))['then'](respondWithResult(_0x3968fe,null))[_0x3e13('0xb5')](handleError(_0x3968fe,null));};exports[_0x3e13('0xb9')]=function(_0x17cb99,_0x3dd3fc){return db[_0x3e13('0x39')][_0x3e13('0xb9')](_0x17cb99['body'],{})['then'](respondWithResult(_0x3dd3fc,0xc9))[_0x3e13('0xb5')](handleError(_0x3dd3fc,null));};exports[_0x3e13('0x2b')]=function(_0x1f27c8,_0x330469){if(_0x1f27c8[_0x3e13('0x77')]['id']){delete _0x1f27c8[_0x3e13('0x77')]['id'];}return db[_0x3e13('0x39')][_0x3e13('0x63')]({'where':{'id':_0x1f27c8[_0x3e13('0xba')]['id']}})[_0x3e13('0x2c')](handleEntityNotFound(_0x330469,null))[_0x3e13('0x2c')](saveUpdates(_0x1f27c8[_0x3e13('0x77')],null))[_0x3e13('0x2c')](respondWithResult(_0x330469,null))[_0x3e13('0xb5')](handleError(_0x330469,null));};exports['destroy']=function(_0xe7ecd6,_0x182e4c){return db[_0x3e13('0x39')]['find']({'where':{'id':_0xe7ecd6[_0x3e13('0xba')]['id']}})['then'](handleEntityNotFound(_0x182e4c,null))[_0x3e13('0x2c')](removeEntity(_0x182e4c,null))[_0x3e13('0xb5')](handleError(_0x182e4c,null));};exports[_0x3e13('0xbb')]=function(_0x4e0c59,_0x5dc9fd){return db['FaxInteraction'][_0x3e13('0xbb')]()[_0x3e13('0x2c')](respondWithResult(_0x5dc9fd,null))[_0x3e13('0xb5')](handleError(_0x5dc9fd,null));};exports[_0x3e13('0xbc')]=function(_0x1df5ae,_0x166439,_0x47902f){return db[_0x3e13('0xbd')][_0x3e13('0x63')]({'where':{'id':_0x1df5ae['params']['id']}})[_0x3e13('0x2c')](handleEntityNotFound(_0x166439,null))[_0x3e13('0x2c')](function(_0x356a87){if(_0x356a87){return _0x356a87[_0x3e13('0xbc')](_0x1df5ae['body'][_0x3e13('0xbe')],_['omit'](_0x1df5ae[_0x3e13('0x77')],[_0x3e13('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x166439,null))['catch'](handleError(_0x166439,null));};exports[_0x3e13('0xbf')]=function(_0xe6b24e,_0x55ab3e,_0x278ffc){var _0x47fe31={'raw':![],'where':{}};var _0x114ac4={};var _0x332d03={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x3e13('0xc0')]({'where':{'id':_0xe6b24e[_0x3e13('0xba')]['id']}})['then'](handleEntityNotFound(_0x55ab3e,null))['then'](function(_0x490f8b){if(_0x490f8b){_0x114ac4[_0x3e13('0x3e')]=_[_0x3e13('0x41')](db['FaxMessage'][_0x3e13('0x3a')]);_0x114ac4[_0x3e13('0x40')]=_[_0x3e13('0x41')](_0xe6b24e[_0x3e13('0x40')]);_0x114ac4[_0x3e13('0x42')]=_[_0x3e13('0x43')](_0x114ac4['model'],_0x114ac4[_0x3e13('0x40')]);_0x47fe31[_0x3e13('0x44')]=_[_0x3e13('0x43')](_0x114ac4[_0x3e13('0x3e')],qs[_0x3e13('0x45')](_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x45')]));_0x47fe31[_0x3e13('0x44')]=_0x47fe31[_0x3e13('0x44')][_0x3e13('0x62')]?_0x47fe31[_0x3e13('0x44')]:_0x114ac4[_0x3e13('0x3e')];if(!_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x46')](_0x3e13('0x47'))){_0x47fe31[_0x3e13('0x22')]=qs['limit'](_0xe6b24e['query']['limit']);_0x47fe31[_0x3e13('0x25')]=qs[_0x3e13('0x25')](_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x25')]);}_0x47fe31[_0x3e13('0x48')]=qs[_0x3e13('0x49')](_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x49')]);_0x47fe31['where']=qs[_0x3e13('0x42')](_[_0x3e13('0x4a')](_0xe6b24e[_0x3e13('0x40')],_0x114ac4[_0x3e13('0x42')]));_0x47fe31[_0x3e13('0x82')][_0x3e13('0xb3')]=_0x490f8b['id'];if(_0xe6b24e['query']['filter']){_0x47fe31[_0x3e13('0x82')]=_[_0x3e13('0xa1')](_0x47fe31[_0x3e13('0x82')],{'$or':_['map'](_0x47fe31[_0x3e13('0x44')],function(_0x58cff8){var _0x145df9={};_0x145df9[_0x58cff8]={'$like':'%'+_0xe6b24e['query'][_0x3e13('0xc1')]+'%'};return _0x145df9;})});}if(_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x80')]){var _0x315931=_0xe6b24e[_0x3e13('0x40')][_0x3e13('0x80')][_0x3e13('0x6b')](',');var _0x249a5f={};_0x249a5f[_0x315931[0x0]]={'$gte':moment(_0x315931[0x1])[_0x3e13('0xc2')](_0x3e13('0xc3'))};_0x47fe31['where']=_[_0x3e13('0xa1')](_0x47fe31[_0x3e13('0x82')],_0x249a5f);}_0x47fe31=_[_0x3e13('0xa1')]({},_0x47fe31,_0xe6b24e[_0x3e13('0xb8')]);return db['FaxMessage']['count']({'where':_0x47fe31[_0x3e13('0x82')]})[_0x3e13('0x2c')](function(_0x37ca38){_0x332d03[_0x3e13('0x24')]=_0x37ca38;if(_0xe6b24e[_0x3e13('0x40')][_0x3e13('0xb6')]){_0x47fe31['include']=[{'all':!![]}];}return db[_0x3e13('0xbd')][_0x3e13('0xc4')](_0x47fe31);})[_0x3e13('0x2c')](function(_0xc13672){_0x332d03[_0x3e13('0xb4')]=_0xc13672;return _0x332d03;});}})['then'](respondWithFilteredResult(_0x55ab3e,_0x47fe31))['catch'](handleError(_0x55ab3e,null));};exports[_0x3e13('0xc5')]=function(_0x1524e6,_0x34fe37,_0x208223){return db['FaxInteraction'][_0x3e13('0x63')]({'where':{'id':_0x1524e6['params']['id']}})[_0x3e13('0x2c')](handleEntityNotFound(_0x34fe37,null))[_0x3e13('0x2c')](function(_0x183b06){if(_0x183b06){return _0x183b06['setTags'](_0x1524e6[_0x3e13('0x77')]['ids'],_['omit'](_0x1524e6[_0x3e13('0x77')],[_0x3e13('0xbe'),'id'])||{})[_0x3e13('0xc6')](function(){return db[_0x3e13('0x72')][_0x3e13('0xc4')]({'attributes':['id',_0x3e13('0x3f'),_0x3e13('0x4d')],'where':{'id':_0x1524e6['body']['ids']}});})[_0x3e13('0x2c')](function(_0x1e13d7){socket[_0x3e13('0xc7')]('faxInteractionTags:save',{'id':Number(_0x1524e6[_0x3e13('0xba')]['id']),'tags':_0x1e13d7||[]});return{'id':Number(_0x1524e6[_0x3e13('0xba')]['id']),'tags':_0x1e13d7||[]};});}})[_0x3e13('0x2c')](respondWithResult(_0x34fe37,null))['catch'](handleError(_0x34fe37,null));};exports['removeTags']=function(_0x4e4997,_0x14f9c8,_0x7a97c4){return db['FaxInteraction']['find']({'where':{'id':_0x4e4997[_0x3e13('0xba')]['id']}})[_0x3e13('0x2c')](handleEntityNotFound(_0x14f9c8,null))[_0x3e13('0x2c')](function(_0x1ae401){if(_0x1ae401){return _0x1ae401['removeTags'](_0x4e4997['query'][_0x3e13('0xbe')]);}})[_0x3e13('0x2c')](respondWithStatusCode(_0x14f9c8,null))[_0x3e13('0xb5')](handleError(_0x14f9c8,null));};exports[_0x3e13('0xc8')]=function(_0x5ac424,_0x2ec28c){var _0x5edd32=moment()['unix']()[_0x3e13('0x9e')]();var _0x33a46d=path[_0x3e13('0xc9')](config[_0x3e13('0xca')],_0x3e13('0xcb'),'files',_0x3e13('0xcc'));var _0x1bab34=path[_0x3e13('0xc9')](config['root'],_0x3e13('0xcb'),'files',_0x3e13('0xcd'));var _0x53fd29=path[_0x3e13('0xc9')](_0x33a46d,_0x5edd32);var _0x4df7cf=util[_0x3e13('0xc2')]('transcript-%d-%s.zip',_0x5ac424[_0x3e13('0xba')]['id'],_0x5edd32);var _0x41b06b=path[_0x3e13('0xc9')](_0x33a46d,_0x4df7cf);var _0x4ec99f=[];_0x4ec99f[_0x3e13('0x37')]({'model':db[_0x3e13('0xce')],'as':_0x3e13('0xce'),'raw':!![]});var _0x2d0562=[{'model':db[_0x3e13('0xbd')],'as':_0x3e13('0xcf'),'attributes':['id',_0x3e13('0x77'),'createdAt'],'include':_0x4ec99f}];return db['FaxInteraction'][_0x3e13('0x63')]({'where':{'id':_0x5ac424[_0x3e13('0xba')]['id']},'include':_0x2d0562})[_0x3e13('0x2c')](handleEntityNotFound(_0x2ec28c,null))[_0x3e13('0x2c')](function(_0x15258b){if(_0x15258b&&_0x15258b[_0x3e13('0xcf')]){var _0x5e38be=_0x15258b[_0x3e13('0xd0')]({'plain':!![]});fs[_0x3e13('0xd1')](_0x53fd29);for(var _0x221e08=0x0;_0x221e08<_0x5e38be[_0x3e13('0xcf')][_0x3e13('0x62')];_0x221e08++){var _0xab9fb9=_0x5e38be[_0x3e13('0xcf')][_0x221e08]['Attachment'];if(_0xab9fb9){var _0x40d152=path[_0x3e13('0xc9')](_0x1bab34,_0xab9fb9['basename']);if(fs[_0x3e13('0xd2')](_0x40d152)){fs[_0x3e13('0xd3')](_0x40d152)['pipe'](fs[_0x3e13('0xd4')](path[_0x3e13('0xc9')](_0x53fd29,_0xab9fb9[_0x3e13('0xd5')])));}}}return BPromise[_0x3e13('0x97')]()['then'](function(){return new BPromise(function(_0x41cb15,_0x104e2f){zipdir(_0x53fd29,{'saveTo':_0x41b06b},function(_0x5e658b,_0xfc7522){if(_0x5e658b)return _0x104e2f(_0x5e658b);return _0x41cb15(_0xfc7522);});})['then'](function(){return new BPromise(function(_0x1d838b,_0x5382c2){rimraf(_0x53fd29,function(_0x2a7496){if(_0x2a7496)_0x5382c2(_0x2a7496);return _0x1d838b();});});})['then'](function(){return _0x2ec28c['download'](_0x41b06b,_0x4df7cf,function(_0x464404){if(_0x464404){console['log']('err',_0x464404);}else{fs[_0x3e13('0xd6')](_0x41b06b);}});});});}else{return _0x2ec28c[_0x3e13('0x2e')](0xc8);}})[_0x3e13('0xb5')](handleError(_0x2ec28c,null));}; \ No newline at end of file +var _0xdd38=['Users','map','TagIds','split','forEach','index','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','fax_interactions','cm_contacts','users','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','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','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','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','i.id','Sequelize','clone','order','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','rows','catch','show','rawAttributes','options','FaxInteraction','create','describe','addMessage','params','ids','omit','pick','FaxInteractionId','format','includeAll','include','addTags','setTags','spread','Tag','findAll','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','Attachment','FaxMessage','Messages','get','mkdirSync','basename','existsSync','createReadStream','createWriteStream','log','unlinkSync','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send'];(function(_0x4af356,_0x298d74){var _0x40566=function(_0x3cd2b2){while(--_0x3cd2b2){_0x4af356['push'](_0x4af356['shift']());}};_0x40566(++_0x298d74);}(_0xdd38,0x17d));var _0x8dd3=function(_0x546f9f,_0xcce640){_0x546f9f=_0x546f9f-0x0;var _0x3513dd=_0xdd38[_0x546f9f];return _0x3513dd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8dd3('0x0'));var jsonpatch=require(_0x8dd3('0x1'));var rp=require(_0x8dd3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8dd3('0x3'));var util=require('util');var path=require('path');var sox=require(_0x8dd3('0x4'));var csv=require(_0x8dd3('0x5'));var ejs=require(_0x8dd3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8dd3('0x7'));var crypto=require(_0x8dd3('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8dd3('0x5'));var querystring=require(_0x8dd3('0x9'));var Papa=require(_0x8dd3('0xa'));var Redis=require('ioredis');var authService=require(_0x8dd3('0xb'));var qs=require(_0x8dd3('0xc'));var as=require(_0x8dd3('0xd'));var hardwareService=require(_0x8dd3('0xe'));var logger=require(_0x8dd3('0xf'))(_0x8dd3('0x10'));var utils=require(_0x8dd3('0x11'));var config=require(_0x8dd3('0x12'));var licenseUtil=require(_0x8dd3('0x13'));var db=require(_0x8dd3('0x14'))['db'];config[_0x8dd3('0x15')]=_[_0x8dd3('0x16')](config[_0x8dd3('0x15')],{'host':_0x8dd3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dd3('0x15')]));require(_0x8dd3('0x18'))['register'](socket);function respondWithStatusCode(_0x36c249,_0x7610a4){_0x7610a4=_0x7610a4||0xcc;return function(_0xed0671){if(_0xed0671){return _0x36c249[_0x8dd3('0x19')](_0x7610a4);}return _0x36c249[_0x8dd3('0x1a')](_0x7610a4)[_0x8dd3('0x1b')]();};}function respondWithResult(_0x536cbf,_0x317f88){_0x317f88=_0x317f88||0xc8;return function(_0x53f5da){if(_0x53f5da){return _0x536cbf[_0x8dd3('0x1a')](_0x317f88)['json'](_0x53f5da);}};}function respondWithFilteredResult(_0x824387,_0x4cdd2f){return function(_0x50d058){if(_0x50d058){var _0x2fc99f=typeof _0x4cdd2f[_0x8dd3('0x1c')]===_0x8dd3('0x1d')&&typeof _0x4cdd2f[_0x8dd3('0x1e')]==='undefined';var _0x2fc57b=_0x50d058[_0x8dd3('0x1f')];var _0x41de4c=_0x2fc99f?0x0:_0x4cdd2f['offset'];var _0x4caab7=_0x2fc99f?_0x50d058[_0x8dd3('0x1f')]:_0x4cdd2f[_0x8dd3('0x1c')]+_0x4cdd2f[_0x8dd3('0x1e')];var _0x65b889;if(_0x4caab7>=_0x2fc57b){_0x4caab7=_0x2fc57b;_0x65b889=0xc8;}else{_0x65b889=0xce;}_0x824387['status'](_0x65b889);return _0x824387[_0x8dd3('0x20')](_0x8dd3('0x21'),_0x41de4c+'-'+_0x4caab7+'/'+_0x2fc57b)[_0x8dd3('0x22')](_0x50d058);}return null;};}function patchUpdates(_0x539843){return function(_0x5b0998){try{jsonpatch[_0x8dd3('0x23')](_0x5b0998,_0x539843,!![]);}catch(_0x322cb3){return BPromise[_0x8dd3('0x24')](_0x322cb3);}return _0x5b0998[_0x8dd3('0x25')]();};}function saveUpdates(_0x358481,_0x301e12){return function(_0x1b3f5e){if(_0x1b3f5e){return _0x1b3f5e[_0x8dd3('0x26')](_0x358481)['then'](function(_0x398291){return _0x398291;});}return null;};}function removeEntity(_0x5f7b91,_0x95fad7){return function(_0x5a4496){if(_0x5a4496){return _0x5a4496[_0x8dd3('0x27')]()[_0x8dd3('0x28')](function(){_0x5f7b91[_0x8dd3('0x1a')](0xcc)[_0x8dd3('0x1b')]();});}};}function handleEntityNotFound(_0x36ea92,_0x3e6beb){return function(_0x4c90cc){if(!_0x4c90cc){_0x36ea92[_0x8dd3('0x19')](0x194);}return _0x4c90cc;};}function handleError(_0x2c0704,_0x5e23b4){_0x5e23b4=_0x5e23b4||0x1f4;return function(_0x21eb12){logger[_0x8dd3('0x29')](_0x21eb12[_0x8dd3('0x2a')]);if(_0x21eb12[_0x8dd3('0x2b')]){delete _0x21eb12[_0x8dd3('0x2b')];}_0x2c0704[_0x8dd3('0x1a')](_0x5e23b4)[_0x8dd3('0x2c')](_0x21eb12);};}function getInteractionUsers(_0x1d79a8,_0x13fb77){return new BPromise(function(_0xde02c3,_0x57e89e){try{if(_0x13fb77[_0x1d79a8['id']]){_0x1d79a8[_0x8dd3('0x2d')]=_[_0x8dd3('0x2e')](_0x13fb77[_0x1d79a8['id']],function(_0x219922){return{'id':_0x219922['id'],'fullname':_0x219922['fullname']};});}}catch(_0x1b2f19){_0x57e89e(_0x1b2f19);}_0xde02c3(_0x1d79a8);});}function getInteractionTags(_0x506352,_0x530dfb){return new BPromise(function(_0x3b203e,_0x438557){try{if(_0x506352[_0x8dd3('0x2f')]){_0x506352['Tags']=[];_0x506352[_0x8dd3('0x2f')][_0x8dd3('0x30')](',')[_0x8dd3('0x31')](function(_0x596f84){_0x506352['Tags']['push'](_0x530dfb[_0x596f84]);});}delete _0x506352[_0x8dd3('0x2f')];}catch(_0x518af5){_0x438557(_0x518af5);}_0x3b203e(_0x506352);});}function updateFaxInteraction(_0x15d55a,_0x487e7f,_0x2f265e){return new BPromise(function(_0x1e116b,_0x1396f9){return getInteractionUsers(_0x15d55a,_0x2f265e)[_0x8dd3('0x28')](function(_0x40f66a){return getInteractionTags(_0x40f66a,_0x487e7f);})['then'](function(_0x4fcbee){_0x1e116b(_0x4fcbee);})['catch'](function(_0x1d1a3b){_0x1396f9(_0x1d1a3b);});});}exports[_0x8dd3('0x32')]=function(_0xc0716d,_0xa9bda0){var _0x47c967={},_0x3f25f2={},_0x36946e={'count':0x0,'rows':[]};var _0x9ba0a9=_[_0x8dd3('0x2e')](db['FaxInteraction']['rawAttributes'],function(_0x4e0e23){return{'name':_0x4e0e23[_0x8dd3('0x33')],'type':_0x4e0e23[_0x8dd3('0x34')]['key']};});_0x3f25f2[_0x8dd3('0x35')]=_[_0x8dd3('0x2e')](_0x9ba0a9,_0x8dd3('0x2b'));_0x3f25f2[_0x8dd3('0x36')]=_[_0x8dd3('0x37')](_0xc0716d[_0x8dd3('0x36')]);_0x3f25f2[_0x8dd3('0x38')]=_[_0x8dd3('0x39')](_0x3f25f2['model'],_0x3f25f2[_0x8dd3('0x36')]);_0x47c967['attributes']=_[_0x8dd3('0x39')](_0x3f25f2['model'],qs[_0x8dd3('0x3a')](_0xc0716d['query'][_0x8dd3('0x3a')]));_0x47c967[_0x8dd3('0x3b')]=_0x47c967[_0x8dd3('0x3b')][_0x8dd3('0x3c')]?_0x47c967[_0x8dd3('0x3b')]:_0x3f25f2['model'];if(!_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x3d')](_0x8dd3('0x3e'))){_0x47c967[_0x8dd3('0x1e')]=qs['limit'](_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x1e')]);_0x47c967[_0x8dd3('0x1c')]=qs['offset'](_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x1c')]);}_0x47c967['order']=qs[_0x8dd3('0x3f')](_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x3f')]);_0x47c967['where']=qs['filters'](_['pick'](_0xc0716d[_0x8dd3('0x36')],_0x3f25f2[_0x8dd3('0x38')]),_0x9ba0a9);var _0x4905fb=[];var _0x4cd205=squel[_0x8dd3('0x40')]()[_0x8dd3('0x41')]('id')[_0x8dd3('0x41')](_0x8dd3('0x2b'))[_0x8dd3('0x41')]('color')[_0x8dd3('0x42')](_0x8dd3('0x43'));var _0x5d41d5=squel['select']()[_0x8dd3('0x41')](_0x8dd3('0x44'))['field'](_0x8dd3('0x45'))[_0x8dd3('0x41')](_0x8dd3('0x46'))['from'](_0x8dd3('0x47'),'ui')[_0x8dd3('0x48')]('users','u','u.id\x20=\x20ui.UserId');var _0x38c438=squel[_0x8dd3('0x40')]()[_0x8dd3('0x42')](_0x8dd3('0x49'),'i')[_0x8dd3('0x48')](_0x8dd3('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8dd3('0x48')](_0x8dd3('0x4b'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x8dd3('0x4c'),'a',_0x8dd3('0x4d'))[_0x8dd3('0x48')](_0x8dd3('0x4e'),'me',_0x8dd3('0x4f'))[_0x8dd3('0x48')](_0x8dd3('0x50'),'it',_0x8dd3('0x51'))['left_join'](_0x8dd3('0x43'),'t',_0x8dd3('0x52'));var _0x27b81f=squel[_0x8dd3('0x53')]();var _0xead961=[];var _0x3667db=squel[_0x8dd3('0x53')]();var _0x5dfd73;if(_0xc0716d['query'][_0x8dd3('0x54')]){_0x5dfd73=as[_0x8dd3('0x55')](_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x54')]);var _0x221ee6=_0x5dfd73[_0x8dd3('0x56')];for(var _0x3651ef=0x0;_0x3651ef<_0x5dfd73['conditions'][_0x8dd3('0x3c')];_0x3651ef++){var _0x4a8d5d=_0x5dfd73['conditions'][_0x3651ef];var _0x443855='i';var _0x1a219c=_[_0x8dd3('0x57')](_0x9ba0a9,[_0x8dd3('0x2b'),_0x4a8d5d['field']]);if(!_0x1a219c){switch(_0x4a8d5d[_0x8dd3('0x41')]){case _0x8dd3('0x58'):if(_0x4a8d5d[_0x8dd3('0x59')]==0x1){_0x38c438['having']('`'+_0x4a8d5d[_0x8dd3('0x41')]+_0x8dd3('0x5a'));}else{_0x38c438[_0x8dd3('0x5b')]('`'+_0x4a8d5d[_0x8dd3('0x41')]+_0x8dd3('0x5c'));}break;case _0x8dd3('0x5d'):if(_0x4a8d5d['operator']==='$substring'){if(_0x4a8d5d[_0x8dd3('0x59')][_0x8dd3('0x30')]('\x20')[_0x8dd3('0x3c')]>0x1){_0x27b81f[_0x221ee6](_0x8dd3('0x5e'),qs['getFullTextValue'](_0x4a8d5d[_0x8dd3('0x59')]),null);}else{var _0x4d9965='%'+_0x4a8d5d[_0x8dd3('0x59')]+'%';_0x27b81f[_0x221ee6](_0x8dd3('0x5f'),_0x4d9965,_0x4d9965,_0x4d9965);}}else{_0x1a219c=_[_0x8dd3('0x57')](_0x9ba0a9,[_0x8dd3('0x2b'),_0x8dd3('0x60')]);_0x4a8d5d[_0x8dd3('0x41')]=_0x8dd3('0x60');_0x608363=as[_0x8dd3('0x61')](_0x443855,_0x1a219c[_0x8dd3('0x34')],_0x4a8d5d);_0x27b81f[_0x221ee6](_0x608363[_0x8dd3('0x62')],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x63')],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x1b')]);}break;case'Tag':var _0x1d17f1=_0x4a8d5d[_0x8dd3('0x59')]['split'](',')[_0x8dd3('0x2e')](function(_0x44c6fc){return Number(_0x44c6fc);});_0x1d17f1[_0x8dd3('0x31')](function(_0x39d180){_0x3667db['or'](_0x8dd3('0x64'),'%,'+_0x39d180+',%');});_0xead961=_['union'](_0xead961,_0x1d17f1);break;case _0x8dd3('0x65'):if(_0x4a8d5d['operator']===_0x8dd3('0x66')){_0x27b81f[_0x221ee6](_0x8dd3('0x67'),'%'+_0x4a8d5d[_0x8dd3('0x59')]+'%',null);}else{_0x1a219c=_[_0x8dd3('0x57')](_0x9ba0a9,[_0x8dd3('0x2b'),_0x8dd3('0x68')]);_0x4a8d5d['field']=_0x8dd3('0x68');_0x608363=as['buildExpression'](_0x443855,_0x1a219c[_0x8dd3('0x34')],_0x4a8d5d);_0x27b81f[_0x221ee6](_0x608363[_0x8dd3('0x62')],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x63')],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x1b')]);}break;case _0x8dd3('0x69'):_0x608363=as[_0x8dd3('0x61')]('me',null,_0x4a8d5d);_0x27b81f[_0x221ee6](_0x608363[_0x8dd3('0x62')],_0x608363[_0x8dd3('0x59')]['start'],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x1b')]);break;}}else{var _0x608363=as[_0x8dd3('0x61')](_0x443855,_0x1a219c[_0x8dd3('0x34')],_0x4a8d5d);_0x27b81f[_0x221ee6](_0x608363['text'],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x63')],_0x608363[_0x8dd3('0x59')][_0x8dd3('0x1b')]);}}}else{var _0x6ab3=_(_0xc0716d['query'])[_0x8dd3('0x37')]()[_0x8dd3('0x2e')](function(_0x536df3){return _[_0x8dd3('0x6a')](_0x9ba0a9,[_0x8dd3('0x2b'),_0x536df3])?_0x536df3:undefined;})[_0x8dd3('0x6b')]()[_0x8dd3('0x59')]();if(!_[_0x8dd3('0x6c')](_0x6ab3)){_0x6ab3[_0x8dd3('0x31')](function(_0x55d960){if(_0x55d960===_0x8dd3('0x6d')){_0x38c438['where'](_0x8dd3('0x6e'),[][_0x8dd3('0x6f')](_0xc0716d['query'][_0x55d960]));}else if(_0x55d960===_0x8dd3('0x70')){var _0x2a82b0=JSON[_0x8dd3('0x71')](_0xc0716d['query'][_0x55d960])[_0x8dd3('0x72')];var _0x2a547f=JSON[_0x8dd3('0x71')](_0xc0716d[_0x8dd3('0x36')][_0x55d960])[_0x8dd3('0x73')];_0x38c438[_0x8dd3('0x74')](_0x8dd3('0x75'),_0x2a82b0,_0x2a547f);}else{if(_0xc0716d['query'][_0x55d960]===_0x8dd3('0x76')){_0x38c438[_0x8dd3('0x74')]('i.'+_0x55d960+_0x8dd3('0x77'));}else{_0x38c438[_0x8dd3('0x74')]('i.'+_0x55d960+_0x8dd3('0x78'),_0xc0716d[_0x8dd3('0x36')][_0x55d960]);}}});}if(_0xc0716d[_0x8dd3('0x36')]['read']){if(_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x79')]==0x1){_0x38c438[_0x8dd3('0x5b')](_0x8dd3('0x7a'));}else{_0x38c438[_0x8dd3('0x5b')](_0x8dd3('0x7b'));}}if(_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7c')]){_0xead961=_[_0x8dd3('0x7d')](_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7c')])?_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7c')]:new Array(_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7c')]);_0xead961[_0x8dd3('0x31')](function(_0x4f5be9){_0x3667db['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f5be9+',%');});}if(_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7e')]){var _0x137b1d=_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x7e')][_0x8dd3('0x7f')]('\x5c','\x5c\x5c')[_0x8dd3('0x7f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x137b1d)){_0x27b81f['or'](_0x8dd3('0x80'),_0x137b1d+'%')['or'](_0x8dd3('0x81'),_0x137b1d+'%');}_0x27b81f['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x137b1d+'%');}}_0x38c438[_0x8dd3('0x74')](_0x27b81f);_0x38c438['group'](_0x8dd3('0x82'));var _0x176fc9={'type':db[_0x8dd3('0x83')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5068b2=_0x38c438[_0x8dd3('0x84')]();_0x5068b2[_0x8dd3('0x41')](_0x8dd3('0x82'));_0x5068b2[_0x8dd3('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8dd3('0x58'));if(_0x47c967[_0x8dd3('0x85')]){_0x47c967['order']['forEach'](function(_0x2ac541){var _0x484e46=_0x2ac541[0x0]==='contactName'?_0x2ac541[0x0]:'i.'+_0x2ac541[0x0];_0x38c438[_0x8dd3('0x85')](_0x484e46,_0x2ac541[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0xead961)){_0x38c438[_0x8dd3('0x5b')](_0x3667db);_0x5068b2[_0x8dd3('0x74')](_0x8dd3('0x86'),_0xead961);}BPromise[_0x8dd3('0x87')]()[_0x8dd3('0x28')](function(){if(!_0x5dfd73){if(_0xc0716d[_0x8dd3('0x36')][_0x8dd3('0x6d')])return;_0x5068b2[_0x8dd3('0x74')](_0x8dd3('0x88'));_0x38c438[_0x8dd3('0x74')](_0x8dd3('0x88'));return;}if(_0xc0716d[_0x8dd3('0x89')][_0x8dd3('0x8a')]!=='agent')return;return _0xc0716d[_0x8dd3('0x89')][_0x8dd3('0x8b')]({'attributes':['id'],'raw':!![]})[_0x8dd3('0x28')](function(_0x1b1ee4){if(_[_0x8dd3('0x6c')](_0x1b1ee4)){_0x5068b2[_0x8dd3('0x74')]('i.FaxAccountId\x20IS\x20NULL');_0x38c438['where'](_0x8dd3('0x8c'));}else{_0x5068b2[_0x8dd3('0x74')](_0x8dd3('0x6e'),_['map'](_0x1b1ee4,'id'));_0x38c438[_0x8dd3('0x74')](_0x8dd3('0x6e'),_[_0x8dd3('0x2e')](_0x1b1ee4,'id'));}});})[_0x8dd3('0x28')](function(){if(_0xc0716d[_0x8dd3('0x89')][_0x8dd3('0x8a')]===_0x8dd3('0x8d')&&!_0x5dfd73&&!_0xc0716d[_0x8dd3('0x36')]['FaxAccountId'])return[];return db[_0x8dd3('0x8e')][_0x8dd3('0x36')](_0x5068b2['toString'](),_0x176fc9);})[_0x8dd3('0x28')](function(_0x2ef19b){_0x36946e[_0x8dd3('0x1f')]=_0x2ef19b[_0x8dd3('0x3c')];if(_0x36946e[_0x8dd3('0x1f')]===0x0)return[];return db[_0x8dd3('0x8e')][_0x8dd3('0x36')](_0x4cd205[_0x8dd3('0x8f')](),_0x176fc9)[_0x8dd3('0x28')](function(_0x39f72a){_0x4905fb=_[_0x8dd3('0x90')](_0x39f72a,'id');_0x176fc9=_[_0x8dd3('0x91')](_0x176fc9,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xc0716d['query'][_0x8dd3('0x3a')]){_0x47c967[_0x8dd3('0x3b')][_0x8dd3('0x31')](function(_0x50a1a4){_0x38c438[_0x8dd3('0x41')]('i.'+_0x50a1a4);});}else{_0x38c438[_0x8dd3('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8dd3('0x58'));_0x38c438[_0x8dd3('0x41')]('a.key',_0x8dd3('0x92'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x93'),'Account.mandatoryDisposition');_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x94'),_0x8dd3('0x95'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x96'));_0x38c438['field'](_0x8dd3('0x97'),_0x8dd3('0x98'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x99'),_0x8dd3('0x9a'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x9b'),_0x8dd3('0x9c'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0x9d'),_0x8dd3('0x9e'));_0x38c438['field'](_0x8dd3('0x9f'),'Contact.mobile');_0x38c438[_0x8dd3('0x41')](_0x8dd3('0xa0'),_0x8dd3('0xa1'));_0x38c438[_0x8dd3('0x41')]('o.fullname',_0x8dd3('0xa2'));_0x38c438['field'](_0x8dd3('0xa3'),_0x8dd3('0xa4'));_0x38c438[_0x8dd3('0x41')](_0x8dd3('0xa5'),_0x8dd3('0x2f'));}if(_0x47c967[_0x8dd3('0x1e')])_0x38c438['limit'](_0x47c967['limit']);if(_0x47c967[_0x8dd3('0x1c')])_0x38c438[_0x8dd3('0x1c')](_0x47c967['offset']);return db[_0x8dd3('0x8e')][_0x8dd3('0x36')](_0x38c438[_0x8dd3('0x8f')](),_0x176fc9);})[_0x8dd3('0x28')](function(_0x596752){if(_0x596752['length']>0x0)_0x5d41d5['where'](_0x8dd3('0xa6'),_[_0x8dd3('0x2e')](_0x596752,'id'));return db[_0x8dd3('0x8e')][_0x8dd3('0x36')](_0x5d41d5['toString'](),_0x176fc9)['then'](function(_0x4b2683){var _0x5702a8=_[_0x8dd3('0xa7')](_0x4b2683,'FaxInteractionId');var _0x5087c5=[];_0x596752[_0x8dd3('0x31')](function(_0x48ecd5){_0x5087c5[_0x8dd3('0xa8')](updateFaxInteraction(_0x48ecd5,_0x4905fb,_0x5702a8));});return BPromise['all'](_0x5087c5);});});})[_0x8dd3('0x28')](function(_0x3ee1a3){_0x36946e[_0x8dd3('0xa9')]=_0x3ee1a3;return _0x36946e;})[_0x8dd3('0x28')](respondWithFilteredResult(_0xa9bda0,_0x47c967))[_0x8dd3('0xaa')](handleError(_0xa9bda0,null));};exports[_0x8dd3('0xab')]=function(_0x118df1,_0x3b555a){var _0x48d1ad={'raw':![],'where':{'id':_0x118df1['params']['id']}},_0x2de0c1={};_0x2de0c1['model']=_[_0x8dd3('0x37')](db['FaxInteraction'][_0x8dd3('0xac')]);_0x2de0c1[_0x8dd3('0x36')]=_[_0x8dd3('0x37')](_0x118df1[_0x8dd3('0x36')]);_0x2de0c1[_0x8dd3('0x38')]=_[_0x8dd3('0x39')](_0x2de0c1[_0x8dd3('0x35')],_0x2de0c1[_0x8dd3('0x36')]);_0x48d1ad[_0x8dd3('0x3b')]=_[_0x8dd3('0x39')](_0x2de0c1['model'],qs[_0x8dd3('0x3a')](_0x118df1['query'][_0x8dd3('0x3a')]));_0x48d1ad[_0x8dd3('0x3b')]=_0x48d1ad['attributes'][_0x8dd3('0x3c')]?_0x48d1ad[_0x8dd3('0x3b')]:_0x2de0c1[_0x8dd3('0x35')];if(_0x118df1['query']['includeAll']){_0x48d1ad['include']=[{'all':!![]}];}_0x48d1ad=_[_0x8dd3('0x91')]({},_0x48d1ad,_0x118df1[_0x8dd3('0xad')]);return db[_0x8dd3('0xae')][_0x8dd3('0x57')](_0x48d1ad)[_0x8dd3('0x28')](handleEntityNotFound(_0x3b555a,null))['then'](respondWithResult(_0x3b555a,null))[_0x8dd3('0xaa')](handleError(_0x3b555a,null));};exports[_0x8dd3('0xaf')]=function(_0x2c9cce,_0x178054){return db[_0x8dd3('0xae')][_0x8dd3('0xaf')](_0x2c9cce[_0x8dd3('0x69')],{})['then'](respondWithResult(_0x178054,0xc9))[_0x8dd3('0xaa')](handleError(_0x178054,null));};exports[_0x8dd3('0x26')]=function(_0x5bc906,_0x40a5d0){if(_0x5bc906[_0x8dd3('0x69')]['id']){delete _0x5bc906[_0x8dd3('0x69')]['id'];}return db[_0x8dd3('0xae')]['find']({'where':{'id':_0x5bc906['params']['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x40a5d0,null))[_0x8dd3('0x28')](saveUpdates(_0x5bc906[_0x8dd3('0x69')],null))['then'](respondWithResult(_0x40a5d0,null))['catch'](handleError(_0x40a5d0,null));};exports['destroy']=function(_0x5a56b0,_0x3a8995){return db['FaxInteraction'][_0x8dd3('0x57')]({'where':{'id':_0x5a56b0['params']['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x3a8995,null))[_0x8dd3('0x28')](removeEntity(_0x3a8995,null))['catch'](handleError(_0x3a8995,null));};exports['describe']=function(_0x400c33,_0x21ace2){return db[_0x8dd3('0xae')][_0x8dd3('0xb0')]()[_0x8dd3('0x28')](respondWithResult(_0x21ace2,null))[_0x8dd3('0xaa')](handleError(_0x21ace2,null));};exports[_0x8dd3('0xb1')]=function(_0xfb2359,_0x17d122,_0x2091ad){return db['FaxMessage'][_0x8dd3('0x57')]({'where':{'id':_0xfb2359[_0x8dd3('0xb2')]['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x17d122,null))['then'](function(_0x5ae83b){if(_0x5ae83b){return _0x5ae83b[_0x8dd3('0xb1')](_0xfb2359[_0x8dd3('0x69')][_0x8dd3('0xb3')],_[_0x8dd3('0xb4')](_0xfb2359['body'],[_0x8dd3('0xb3'),'id'])||{});}})[_0x8dd3('0x28')](respondWithResult(_0x17d122,null))[_0x8dd3('0xaa')](handleError(_0x17d122,null));};exports['getMessages']=function(_0x4f8f8b,_0x5288fa,_0x1834f4){var _0x2edad5={'raw':![],'where':{}};var _0x56b330={};var _0x150fb0={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x4f8f8b[_0x8dd3('0xb2')]['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x5288fa,null))['then'](function(_0x3112df){if(_0x3112df){_0x56b330['model']=_[_0x8dd3('0x37')](db['FaxMessage']['rawAttributes']);_0x56b330[_0x8dd3('0x36')]=_['keys'](_0x4f8f8b[_0x8dd3('0x36')]);_0x56b330['filters']=_['intersection'](_0x56b330['model'],_0x56b330[_0x8dd3('0x36')]);_0x2edad5[_0x8dd3('0x3b')]=_['intersection'](_0x56b330['model'],qs['fields'](_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x3a')]));_0x2edad5[_0x8dd3('0x3b')]=_0x2edad5[_0x8dd3('0x3b')][_0x8dd3('0x3c')]?_0x2edad5[_0x8dd3('0x3b')]:_0x56b330[_0x8dd3('0x35')];if(!_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x3d')]('nolimit')){_0x2edad5[_0x8dd3('0x1e')]=qs[_0x8dd3('0x1e')](_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x1e')]);_0x2edad5[_0x8dd3('0x1c')]=qs[_0x8dd3('0x1c')](_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x1c')]);}_0x2edad5[_0x8dd3('0x85')]=qs[_0x8dd3('0x3f')](_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x3f')]);_0x2edad5[_0x8dd3('0x74')]=qs[_0x8dd3('0x38')](_[_0x8dd3('0xb5')](_0x4f8f8b[_0x8dd3('0x36')],_0x56b330[_0x8dd3('0x38')]));_0x2edad5[_0x8dd3('0x74')][_0x8dd3('0xb6')]=_0x3112df['id'];if(_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x7e')]){_0x2edad5[_0x8dd3('0x74')]=_['merge'](_0x2edad5['where'],{'$or':_[_0x8dd3('0x2e')](_0x2edad5[_0x8dd3('0x3b')],function(_0x252136){var _0x4cea62={};_0x4cea62[_0x252136]={'$like':'%'+_0x4f8f8b['query'][_0x8dd3('0x7e')]+'%'};return _0x4cea62;})});}if(_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x72')]){var _0x3bcadb=_0x4f8f8b[_0x8dd3('0x36')][_0x8dd3('0x72')]['split'](',');var _0x5108aa={};_0x5108aa[_0x3bcadb[0x0]]={'$gte':moment(_0x3bcadb[0x1])[_0x8dd3('0xb7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2edad5['where']=_[_0x8dd3('0x91')](_0x2edad5['where'],_0x5108aa);}_0x2edad5=_[_0x8dd3('0x91')]({},_0x2edad5,_0x4f8f8b[_0x8dd3('0xad')]);return db['FaxMessage'][_0x8dd3('0x1f')]({'where':_0x2edad5['where']})['then'](function(_0x314bc7){_0x150fb0[_0x8dd3('0x1f')]=_0x314bc7;if(_0x4f8f8b['query'][_0x8dd3('0xb8')]){_0x2edad5[_0x8dd3('0xb9')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x2edad5);})['then'](function(_0x3cddb2){_0x150fb0[_0x8dd3('0xa9')]=_0x3cddb2;return _0x150fb0;});}})['then'](respondWithFilteredResult(_0x5288fa,_0x2edad5))['catch'](handleError(_0x5288fa,null));};exports[_0x8dd3('0xba')]=function(_0x12646d,_0x4fdaa6,_0x1c36ab){return db[_0x8dd3('0xae')][_0x8dd3('0x57')]({'where':{'id':_0x12646d[_0x8dd3('0xb2')]['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x4fdaa6,null))['then'](function(_0x3ac330){if(_0x3ac330){return _0x3ac330[_0x8dd3('0xbb')](_0x12646d[_0x8dd3('0x69')][_0x8dd3('0xb3')],_[_0x8dd3('0xb4')](_0x12646d[_0x8dd3('0x69')],[_0x8dd3('0xb3'),'id'])||{})[_0x8dd3('0xbc')](function(){return db[_0x8dd3('0xbd')][_0x8dd3('0xbe')]({'attributes':['id',_0x8dd3('0x2b'),_0x8dd3('0xbf')],'where':{'id':_0x12646d[_0x8dd3('0x69')]['ids']}});})['then'](function(_0x5b5e92){socket[_0x8dd3('0xc0')](_0x8dd3('0xc1'),{'id':Number(_0x12646d[_0x8dd3('0xb2')]['id']),'tags':_0x5b5e92||[]});return{'id':Number(_0x12646d[_0x8dd3('0xb2')]['id']),'tags':_0x5b5e92||[]};});}})[_0x8dd3('0x28')](respondWithResult(_0x4fdaa6,null))[_0x8dd3('0xaa')](handleError(_0x4fdaa6,null));};exports[_0x8dd3('0xc2')]=function(_0x458963,_0x172074,_0x19b6b3){return db[_0x8dd3('0xae')]['find']({'where':{'id':_0x458963[_0x8dd3('0xb2')]['id']}})[_0x8dd3('0x28')](handleEntityNotFound(_0x172074,null))[_0x8dd3('0x28')](function(_0x5b8da5){if(_0x5b8da5){return _0x5b8da5['removeTags'](_0x458963[_0x8dd3('0x36')][_0x8dd3('0xb3')]);}})['then'](respondWithStatusCode(_0x172074,null))[_0x8dd3('0xaa')](handleError(_0x172074,null));};exports[_0x8dd3('0xc3')]=function(_0x55669b,_0x24a2ca){var _0x3f8d23=moment()[_0x8dd3('0xc4')]()['toString']();var _0x57a212=path[_0x8dd3('0xc5')](config[_0x8dd3('0xc6')],_0x8dd3('0xc7'),_0x8dd3('0xc8'),'tmp');var _0x596fe0=path['join'](config[_0x8dd3('0xc6')],_0x8dd3('0xc7'),_0x8dd3('0xc8'),'attachments');var _0x3acc09=path[_0x8dd3('0xc5')](_0x57a212,_0x3f8d23);var _0x32a0f5=util[_0x8dd3('0xb7')](_0x8dd3('0xc9'),_0x55669b[_0x8dd3('0xb2')]['id'],_0x3f8d23);var _0x1faa41=path[_0x8dd3('0xc5')](_0x57a212,_0x32a0f5);var _0x7d0f0a=[];_0x7d0f0a['push']({'model':db['Attachment'],'as':_0x8dd3('0xca'),'raw':!![]});var _0x4bb063=[{'model':db[_0x8dd3('0xcb')],'as':_0x8dd3('0xcc'),'attributes':['id','body','createdAt'],'include':_0x7d0f0a}];return db['FaxInteraction'][_0x8dd3('0x57')]({'where':{'id':_0x55669b[_0x8dd3('0xb2')]['id']},'include':_0x4bb063})[_0x8dd3('0x28')](handleEntityNotFound(_0x24a2ca,null))[_0x8dd3('0x28')](function(_0xe3ba44){if(_0xe3ba44&&_0xe3ba44[_0x8dd3('0xcc')]){var _0x6d8352=_0xe3ba44[_0x8dd3('0xcd')]({'plain':!![]});fs[_0x8dd3('0xce')](_0x3acc09);for(var _0xd98e89=0x0;_0xd98e89<_0x6d8352[_0x8dd3('0xcc')][_0x8dd3('0x3c')];_0xd98e89++){var _0x2bdfec=_0x6d8352[_0x8dd3('0xcc')][_0xd98e89][_0x8dd3('0xca')];if(_0x2bdfec){var _0x5a42e3=path['join'](_0x596fe0,_0x2bdfec[_0x8dd3('0xcf')]);if(fs[_0x8dd3('0xd0')](_0x5a42e3)){fs[_0x8dd3('0xd1')](_0x5a42e3)['pipe'](fs[_0x8dd3('0xd2')](path[_0x8dd3('0xc5')](_0x3acc09,_0x2bdfec[_0x8dd3('0xcf')])));}}}return BPromise[_0x8dd3('0x87')]()[_0x8dd3('0x28')](function(){return new BPromise(function(_0x378dea,_0x5ef33e){zipdir(_0x3acc09,{'saveTo':_0x1faa41},function(_0x3e6299,_0x28c2df){if(_0x3e6299)return _0x5ef33e(_0x3e6299);return _0x378dea(_0x28c2df);});})[_0x8dd3('0x28')](function(){return new BPromise(function(_0x2129f6,_0x48411c){rimraf(_0x3acc09,function(_0x46f7b4){if(_0x46f7b4)_0x48411c(_0x46f7b4);return _0x2129f6();});});})[_0x8dd3('0x28')](function(){return _0x24a2ca[_0x8dd3('0xc3')](_0x1faa41,_0x32a0f5,function(_0x38bc14){if(_0x38bc14){console[_0x8dd3('0xd3')]('err',_0x38bc14);}else{fs[_0x8dd3('0xd4')](_0x1faa41);}});});});}else{return _0x24a2ca[_0x8dd3('0x19')](0xc8);}})['catch'](handleError(_0x24a2ca,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index bbc08a1..f1b066b 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 _0xef4f=['hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','then','Users','findAll','setDataValue','length','emit','catch'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xef4f,0x196));var _0xfef4=function(_0x1e42f0,_0x9305bb){_0x1e42f0=_0x1e42f0-0x0;var _0x4e79d7=_0xef4f[_0x1e42f0];return _0x4e79d7;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xfef4('0x0'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xfef4('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xfef4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x18551f){return function(_0x5efb1d,_0x1dbb3c,_0x45a93d){_0x5efb1d['getUsers']({'attributes':['id'],'raw':!![]})[_0xfef4('0x3')](function(_0x3bcd0a){_0x5efb1d['setDataValue'](_0xfef4('0x4'),_0x3bcd0a['map'](function(_0x42e077){return{'id':_0x42e077['id']};}));return FaxMessage[_0xfef4('0x5')]({'where':{'FaxInteractionId':_0x5efb1d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x20c4ed){_0x5efb1d[_0xfef4('0x6')]('unreadMessages',_0x20c4ed[_0xfef4('0x7')]);FaxInteractionEvents[_0xfef4('0x8')](_0x18551f+':'+_0x5efb1d['id'],_0x5efb1d);FaxInteractionEvents[_0xfef4('0x8')](_0x18551f,_0x5efb1d);_0x45a93d(null);})[_0xfef4('0x9')](_0x45a93d(null));};}for(var e in events){if(events[_0xfef4('0xa')](e)){var event=events[e];FaxInteraction[_0xfef4('0xb')](e,emitEvent(event));}}module[_0xfef4('0xc')]=FaxInteractionEvents; \ No newline at end of file +var _0x3490=['Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3490,0x105));var _0x0349=function(_0x1367df,_0x57874f){_0x1367df=_0x1367df-0x0;var _0x3adcb8=_0x3490[_0x1367df];return _0x3adcb8;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x0349('0x0'))['db'][_0x0349('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x0349('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0349('0x3')](0x0);var events={'afterCreate':_0x0349('0x4'),'afterUpdate':_0x0349('0x5'),'afterDestroy':_0x0349('0x6')};function emitEvent(_0x35b2fe){return function(_0x50cba2,_0x5d3e97,_0x4a6a3d){_0x50cba2['getUsers']({'attributes':['id'],'raw':!![]})[_0x0349('0x7')](function(_0x4f06ba){_0x50cba2[_0x0349('0x8')](_0x0349('0x9'),_0x4f06ba[_0x0349('0xa')](function(_0x127a86){return{'id':_0x127a86['id']};}));return FaxMessage[_0x0349('0xb')]({'where':{'FaxInteractionId':_0x50cba2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x318a64){_0x50cba2[_0x0349('0x8')](_0x0349('0xc'),_0x318a64['length']);FaxInteractionEvents[_0x0349('0xd')](_0x35b2fe+':'+_0x50cba2['id'],_0x50cba2);FaxInteractionEvents[_0x0349('0xd')](_0x35b2fe,_0x50cba2);_0x4a6a3d(null);})[_0x0349('0xe')](_0x4a6a3d(null));};}for(var e in events){if(events[_0x0349('0xf')](e)){var event=events[e];FaxInteraction[_0x0349('0x10')](e,emitEvent(event));}}module[_0x0349('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d559220..2d94656 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 _0xc17b=['rimraf','./faxInteraction.attributes','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x18f616,_0x3d4d29){var _0x217247=function(_0x2210c0){while(--_0x2210c0){_0x18f616['push'](_0x18f616['shift']());}};_0x217247(++_0x3d4d29);}(_0xc17b,0xa2));var _0xbc17=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc17b[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xbc17('0x0'));var util=require(_0xbc17('0x1'));var logger=require(_0xbc17('0x2'))(_0xbc17('0x3'));var moment=require(_0xbc17('0x4'));var BPromise=require(_0xbc17('0x5'));var rp=require(_0xbc17('0x6'));var fs=require('fs');var path=require(_0xbc17('0x7'));var rimraf=require(_0xbc17('0x8'));var config=require('../../config/environment');var attributes=require(_0xbc17('0x9'));module[_0xbc17('0xa')]=function(_0x52529b,_0x4694a2){return _0x52529b[_0xbc17('0xb')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48b2c2,_0x3706e9,_0x5e50de){if(_0x48b2c2[_0xbc17('0xc')](_0xbc17('0xd'))){_0x48b2c2[_0xbc17('0xe')]=moment()[_0xbc17('0xf')](_0xbc17('0x10'));}_0x5e50de(null,_0x48b2c2);}}});}; \ No newline at end of file +var _0xc8a3=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','../../config/environment','exports','FaxInteraction','fax_interactions','changed','closed'];(function(_0x4c5944,_0x313ba8){var _0x14b4ce=function(_0x2fb582){while(--_0x2fb582){_0x4c5944['push'](_0x4c5944['shift']());}};_0x14b4ce(++_0x313ba8);}(_0xc8a3,0x137));var _0x3c8a=function(_0x523def,_0x40fa33){_0x523def=_0x523def-0x0;var _0x4555d3=_0xc8a3[_0x523def];return _0x4555d3;};'use strict';var _=require(_0x3c8a('0x0'));var util=require('util');var logger=require(_0x3c8a('0x1'))(_0x3c8a('0x2'));var moment=require(_0x3c8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c8a('0x5'));var attributes=require('./faxInteraction.attributes');module[_0x3c8a('0x6')]=function(_0x25651f,_0x5a8588){return _0x25651f['define'](_0x3c8a('0x7'),attributes,{'tableName':_0x3c8a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x459ebb,_0x2b9f2e,_0xd11c0d){if(_0x459ebb[_0x3c8a('0x9')](_0x3c8a('0xa'))){_0x459ebb[_0x3c8a('0xb')]=moment()[_0x3c8a('0xc')](_0x3c8a('0xd'));}_0xd11c0d(null,_0x459ebb);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 85c0455..51b2cb6 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 _0xd235=['result','catch','FaxInteraction','update','body','options','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xb07032,_0x5a8898){var _0x38b34e=function(_0x4e770f){while(--_0x4e770f){_0xb07032['push'](_0xb07032['shift']());}};_0x38b34e(++_0x5a8898);}(_0xd235,0x67));var _0x5d23=function(_0x1e059f,_0x29ba7d){_0x1e059f=_0x1e059f-0x0;var _0xd01254=_0xd235[_0x1e059f];return _0xd01254;};'use strict';var _=require(_0x5d23('0x0'));var util=require(_0x5d23('0x1'));var moment=require(_0x5d23('0x2'));var BPromise=require(_0x5d23('0x3'));var rs=require(_0x5d23('0x4'));var fs=require('fs');var Redis=require(_0x5d23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d23('0x6'));var logger=require(_0x5d23('0x7'))(_0x5d23('0x8'));var config=require(_0x5d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d23('0xa')][_0x5d23('0xb')]({'port':0x232a});config[_0x5d23('0xc')]=_['defaults'](config[_0x5d23('0xc')],{'host':_0x5d23('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d23('0xc')]));require(_0x5d23('0xe'))[_0x5d23('0xf')](socket);function respondWithRpcPromise(_0x29f430,_0xb69da9,_0x31ba8f){return new BPromise(function(_0x56a250,_0x142a86){return client[_0x5d23('0x10')](_0x29f430,_0x31ba8f)[_0x5d23('0x11')](function(_0x24c2ac){logger[_0x5d23('0x12')](_0x5d23('0x13'),_0xb69da9,_0x5d23('0x14'));logger[_0x5d23('0x15')](_0x5d23('0x16'),_0xb69da9,_0x5d23('0x14'),JSON[_0x5d23('0x17')](_0x24c2ac));if(_0x24c2ac[_0x5d23('0x18')]){if(_0x24c2ac['error']['code']===0x1f4){logger[_0x5d23('0x18')](_0x5d23('0x13'),_0xb69da9,_0x24c2ac[_0x5d23('0x18')][_0x5d23('0x19')]);return _0x142a86(_0x24c2ac[_0x5d23('0x18')]['message']);}logger['error'](_0x5d23('0x13'),_0xb69da9,_0x24c2ac['error'][_0x5d23('0x19')]);return _0x56a250(_0x24c2ac[_0x5d23('0x18')][_0x5d23('0x19')]);}else{logger[_0x5d23('0x12')](_0x5d23('0x13'),_0xb69da9,_0x5d23('0x14'));_0x56a250(_0x24c2ac[_0x5d23('0x1a')][_0x5d23('0x19')]);}})[_0x5d23('0x1b')](function(_0x53ee97){logger['error'](_0x5d23('0x13'),_0xb69da9,_0x53ee97);_0x142a86(_0x53ee97);});});}exports['UpdateFaxInteraction']=function(_0x4f6d32){var _0x4b3fce=this;return new Promise(function(_0x2aab7e,_0x36d040){return db[_0x5d23('0x1c')][_0x5d23('0x1d')](_0x4f6d32[_0x5d23('0x1e')],{'raw':_0x4f6d32[_0x5d23('0x1f')]?_0x4f6d32['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6d32['options']?_0x4f6d32[_0x5d23('0x1f')]['where']||null:null,'attributes':_0x4f6d32['options']?_0x4f6d32[_0x5d23('0x1f')][_0x5d23('0x20')]||null:null,'limit':_0x4f6d32[_0x5d23('0x1f')]?_0x4f6d32['options'][_0x5d23('0x21')]||null:null})['then'](function(_0x535a0d){logger[_0x5d23('0x12')](_0x5d23('0x22'),_0x4f6d32);logger[_0x5d23('0x15')]('UpdateFaxInteraction',_0x4f6d32,JSON[_0x5d23('0x17')](_0x535a0d));_0x2aab7e(_0x535a0d);})[_0x5d23('0x1b')](function(_0x44c872){logger[_0x5d23('0x18')]('UpdateFaxInteraction',_0x44c872['message'],_0x4f6d32);_0x36d040(_0x4b3fce['error'](0x1f4,_0x44c872[_0x5d23('0x19')]));});});};exports[_0x5d23('0x23')]=function(_0x41d3e3){return new Promise(function(_0x57106b,_0xce0f29){return db[_0x5d23('0x1c')][_0x5d23('0x24')]({'where':_0x41d3e3[_0x5d23('0x1f')]?_0x41d3e3[_0x5d23('0x1f')][_0x5d23('0x25')]||null:null})[_0x5d23('0x11')](function(_0x216967){if(_0x216967){return _0x216967[_0x5d23('0x26')](_0x41d3e3['body']['ids'],_[_0x5d23('0x27')](_0x41d3e3[_0x5d23('0x1e')],[_0x5d23('0x28'),'id'])||{});}})[_0x5d23('0x29')](function(_0x4a965f){logger[_0x5d23('0x12')](_0x5d23('0x2a'),_0x41d3e3);logger['debug'](_0x5d23('0x2a'),_0x41d3e3,JSON[_0x5d23('0x17')](_0x4a965f));_0x57106b(_0x4a965f);})['catch'](function(_0x441ffe){logger[_0x5d23('0x18')](_0x5d23('0x2a'),_0x441ffe[_0x5d23('0x19')],_0x41d3e3);_0xce0f29(_this[_0x5d23('0x18')](0x1f4,_0x441ffe[_0x5d23('0x19')]));});});}; \ No newline at end of file +var _0x5d7b=['FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','info','stringify','catch','find','where','addTags','ids','omit','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','request\x20sent','debug','error','code'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0x5d7b,0x169));var _0xb5d7=function(_0x301148,_0x25b884){_0x301148=_0x301148-0x0;var _0x42ce24=_0x5d7b[_0x301148];return _0x42ce24;};'use strict';var _=require(_0xb5d7('0x0'));var util=require(_0xb5d7('0x1'));var moment=require('moment');var BPromise=require(_0xb5d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5d7('0x3'));var db=require(_0xb5d7('0x4'))['db'];var utils=require(_0xb5d7('0x5'));var logger=require('../../config/logger')(_0xb5d7('0x6'));var config=require(_0xb5d7('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb5d7('0x8')]=_['defaults'](config['redis'],{'host':_0xb5d7('0x9'),'port':0x18eb});var socket=require(_0xb5d7('0xa'))(new Redis(config[_0xb5d7('0x8')]));require(_0xb5d7('0xb'))[_0xb5d7('0xc')](socket);function respondWithRpcPromise(_0x4095a0,_0x409a76,_0x54879f){return new BPromise(function(_0x41c88a,_0x554ac5){return client[_0xb5d7('0xd')](_0x4095a0,_0x54879f)[_0xb5d7('0xe')](function(_0x17b27c){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x409a76,_0xb5d7('0xf'));logger[_0xb5d7('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x409a76,_0xb5d7('0xf'),JSON['stringify'](_0x17b27c));if(_0x17b27c[_0xb5d7('0x11')]){if(_0x17b27c[_0xb5d7('0x11')][_0xb5d7('0x12')]===0x1f4){logger[_0xb5d7('0x11')](_0xb5d7('0x13'),_0x409a76,_0x17b27c[_0xb5d7('0x11')]['message']);return _0x554ac5(_0x17b27c[_0xb5d7('0x11')][_0xb5d7('0x14')]);}logger[_0xb5d7('0x11')](_0xb5d7('0x13'),_0x409a76,_0x17b27c[_0xb5d7('0x11')][_0xb5d7('0x14')]);return _0x41c88a(_0x17b27c[_0xb5d7('0x11')]['message']);}else{logger['info'](_0xb5d7('0x13'),_0x409a76,_0xb5d7('0xf'));_0x41c88a(_0x17b27c['result'][_0xb5d7('0x14')]);}})['catch'](function(_0x28e044){logger['error'](_0xb5d7('0x13'),_0x409a76,_0x28e044);_0x554ac5(_0x28e044);});});}exports[_0xb5d7('0x15')]=function(_0x2daa3c){var _0x491659=this;return new Promise(function(_0x2212ef,_0x16a162){return db[_0xb5d7('0x16')][_0xb5d7('0x17')](_0x2daa3c[_0xb5d7('0x18')],{'raw':_0x2daa3c['options']?_0x2daa3c[_0xb5d7('0x19')][_0xb5d7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2daa3c['options']?_0x2daa3c[_0xb5d7('0x19')]['where']||null:null,'attributes':_0x2daa3c[_0xb5d7('0x19')]?_0x2daa3c[_0xb5d7('0x19')][_0xb5d7('0x1b')]||null:null,'limit':_0x2daa3c[_0xb5d7('0x19')]?_0x2daa3c[_0xb5d7('0x19')][_0xb5d7('0x1c')]||null:null})[_0xb5d7('0xe')](function(_0x498c3c){logger[_0xb5d7('0x1d')](_0xb5d7('0x15'),_0x2daa3c);logger[_0xb5d7('0x10')](_0xb5d7('0x15'),_0x2daa3c,JSON[_0xb5d7('0x1e')](_0x498c3c));_0x2212ef(_0x498c3c);})[_0xb5d7('0x1f')](function(_0x1004a6){logger[_0xb5d7('0x11')](_0xb5d7('0x15'),_0x1004a6[_0xb5d7('0x14')],_0x2daa3c);_0x16a162(_0x491659[_0xb5d7('0x11')](0x1f4,_0x1004a6[_0xb5d7('0x14')]));});});};exports['AddTagsToFaxInteraction']=function(_0x58ddb2){return new Promise(function(_0x4ce19d,_0x438658){return db['FaxInteraction'][_0xb5d7('0x20')]({'where':_0x58ddb2[_0xb5d7('0x19')]?_0x58ddb2[_0xb5d7('0x19')][_0xb5d7('0x21')]||null:null})['then'](function(_0x427277){if(_0x427277){return _0x427277[_0xb5d7('0x22')](_0x58ddb2[_0xb5d7('0x18')][_0xb5d7('0x23')],_[_0xb5d7('0x24')](_0x58ddb2[_0xb5d7('0x18')],[_0xb5d7('0x23'),'id'])||{});}})['spread'](function(_0xcf93ec){logger['info'](_0xb5d7('0x25'),_0x58ddb2);logger[_0xb5d7('0x10')]('AddTags',_0x58ddb2,JSON[_0xb5d7('0x1e')](_0xcf93ec));_0x4ce19d(_0xcf93ec);})[_0xb5d7('0x1f')](function(_0x4daf96){logger['error'](_0xb5d7('0x25'),_0x4daf96[_0xb5d7('0x14')],_0x58ddb2);_0x438658(_this[_0xb5d7('0x11')](0x1f4,_0x4daf96[_0xb5d7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 596496b..f65f5e7 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 _0x300c=['./faxInteraction.events','removeListener','length','faxInteraction:'];(function(_0x5c2094,_0x4ebf93){var _0x56b342=function(_0xde6e55){while(--_0xde6e55){_0x5c2094['push'](_0x5c2094['shift']());}};_0x56b342(++_0x4ebf93);}(_0x300c,0x7c));var _0xc300=function(_0x23f350,_0x52ad4a){_0x23f350=_0x23f350-0x0;var _0x3c8055=_0x300c[_0x23f350];return _0x3c8055;};'use strict';var FaxInteractionEvents=require(_0xc300('0x0'));var events=['save','remove','update'];function createListener(_0x41de71,_0x5bd28f){return function(_0x1ad3cd){_0x5bd28f['emit'](_0x41de71,_0x1ad3cd);};}function removeListener(_0x154a9c,_0xb012f2){return function(){FaxInteractionEvents[_0xc300('0x1')](_0x154a9c,_0xb012f2);};}exports['register']=function(_0x4709ea){for(var _0x5abc8d=0x0,_0x369c35=events[_0xc300('0x2')];_0x5abc8d<_0x369c35;_0x5abc8d++){var _0x45dbf5=events[_0x5abc8d];var _0x4c025c=createListener(_0xc300('0x3')+_0x45dbf5,_0x4709ea);FaxInteractionEvents['on'](_0x45dbf5,_0x4c025c);}}; \ No newline at end of file +var _0xf023=['register','save','remove','update','emit','removeListener'];(function(_0x53a852,_0x504b68){var _0xf6573d=function(_0x4ed824){while(--_0x4ed824){_0x53a852['push'](_0x53a852['shift']());}};_0xf6573d(++_0x504b68);}(_0xf023,0x175));var _0x3f02=function(_0x2788ee,_0x28623e){_0x2788ee=_0x2788ee-0x0;var _0x5c5bd0=_0xf023[_0x2788ee];return _0x5c5bd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x3f02('0x0'),_0x3f02('0x1'),_0x3f02('0x2')];function createListener(_0x1f559c,_0x34f08f){return function(_0x3e4894){_0x34f08f[_0x3f02('0x3')](_0x1f559c,_0x3e4894);};}function removeListener(_0x1af76d,_0x3dd195){return function(){FaxInteractionEvents[_0x3f02('0x4')](_0x1af76d,_0x3dd195);};}exports[_0x3f02('0x5')]=function(_0x11ac03){for(var _0x441aa8=0x0,_0x272dac=events['length'];_0x441aa8<_0x272dac;_0x441aa8++){var _0x181d3d=events[_0x441aa8];var _0x153f4b=createListener('faxInteraction:'+_0x181d3d,_0x11ac03);FaxInteractionEvents['on'](_0x181d3d,_0x153f4b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d1d78c9..d2e82eb 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 _0x4a80=['post','addMessage','tracked','fax','put','faxinteraction:update','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a80,0xbe));var _0x04a8=function(_0x2d7484,_0x1b8083){_0x2d7484=_0x2d7484-0x0;var _0x8d13bc=_0x4a80[_0x2d7484];return _0x8d13bc;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xb')]);router[_0x04a8('0x9')]('/describe',auth[_0x04a8('0xa')](),controller[_0x04a8('0xc')]);router[_0x04a8('0x9')](_0x04a8('0xd'),auth[_0x04a8('0xa')](),controller[_0x04a8('0xe')]);router[_0x04a8('0x9')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x10')]);router['get'](_0x04a8('0x11'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x12')]);router['post']('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0x13')]);router[_0x04a8('0x14')](_0x04a8('0xf'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x15')]);router[_0x04a8('0x14')]('/:id/tags',auth[_0x04a8('0xa')](),interaction[_0x04a8('0x16')](_0x04a8('0x17'),'faxinteraction:addtags'),controller['addTags']);router[_0x04a8('0x18')](_0x04a8('0xd'),auth['isAuthenticated'](),interaction[_0x04a8('0x16')]('fax',_0x04a8('0x19')),controller['update']);router[_0x04a8('0x1a')](_0x04a8('0xd'),auth['isAuthenticated'](),interaction[_0x04a8('0x16')](_0x04a8('0x17'),'faxinteraction:destroy'),controller['destroy']);router['delete'](_0x04a8('0x1b'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x1c')]);module[_0x04a8('0x1d')]=router; \ No newline at end of file +var _0x704a=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','fax','faxinteraction:update','update','delete','removeTags','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get'];(function(_0x3e6693,_0x319153){var _0x17adc5=function(_0x3ba8bf){while(--_0x3ba8bf){_0x3e6693['push'](_0x3e6693['shift']());}};_0x17adc5(++_0x319153);}(_0x704a,0x1e6));var _0xa704=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0x704a[_0x10004e];return _0x5af990;};'use strict';var multer=require('multer');var util=require(_0xa704('0x0'));var path=require(_0xa704('0x1'));var timeout=require('connect-timeout');var express=require(_0xa704('0x2'));var router=express['Router']();var fs_extra=require(_0xa704('0x3'));var auth=require(_0xa704('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa704('0x5'));var controller=require(_0xa704('0x6'));router['get']('/',auth[_0xa704('0x7')](),controller[_0xa704('0x8')]);router[_0xa704('0x9')](_0xa704('0xa'),auth[_0xa704('0x7')](),controller[_0xa704('0xb')]);router[_0xa704('0x9')](_0xa704('0xc'),auth[_0xa704('0x7')](),controller[_0xa704('0xd')]);router[_0xa704('0x9')](_0xa704('0xe'),auth[_0xa704('0x7')](),controller[_0xa704('0xf')]);router[_0xa704('0x9')](_0xa704('0x10'),auth[_0xa704('0x7')](),controller[_0xa704('0x11')]);router[_0xa704('0x12')]('/',auth[_0xa704('0x7')](),controller[_0xa704('0x13')]);router[_0xa704('0x12')](_0xa704('0xe'),auth[_0xa704('0x7')](),controller[_0xa704('0x14')]);router['post'](_0xa704('0x15'),auth[_0xa704('0x7')](),interaction[_0xa704('0x16')]('fax','faxinteraction:addtags'),controller[_0xa704('0x17')]);router[_0xa704('0x18')](_0xa704('0xc'),auth[_0xa704('0x7')](),interaction[_0xa704('0x16')](_0xa704('0x19'),_0xa704('0x1a')),controller[_0xa704('0x1b')]);router[_0xa704('0x1c')](_0xa704('0xc'),auth['isAuthenticated'](),interaction[_0xa704('0x16')](_0xa704('0x19'),'faxinteraction:destroy'),controller['destroy']);router['delete'](_0xa704('0x15'),auth[_0xa704('0x7')](),controller[_0xa704('0x1d')]);module[_0xa704('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 3aa9ebe..dfda572 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 _0x6f0d=['medium','BOOLEAN','out','DATE','exports','TEXT'];(function(_0x1559a5,_0x41924e){var _0x17a783=function(_0x152c63){while(--_0x152c63){_0x1559a5['push'](_0x1559a5['shift']());}};_0x17a783(++_0x41924e);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4bffe0,_0x54a29b){_0x4bffe0=_0x4bffe0-0x0;var _0x4c2c90=_0x6f0d[_0x4bffe0];return _0x4c2c90;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'body':{'type':Sequelize[_0xd6f0('0x1')](_0xd6f0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd6f0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd6f0('0x4')),'defaultValue':_0xd6f0('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd6f0('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6f0('0x5')]}}; \ No newline at end of file +var _0x6953=['DATE','sequelize','exports','ENUM','out','TEXT'];(function(_0x475519,_0x2f7ee1){var _0x5fd039=function(_0x151c50){while(--_0x151c50){_0x475519['push'](_0x475519['shift']());}};_0x5fd039(++_0x2f7ee1);}(_0x6953,0x91));var _0x3695=function(_0x56ff45,_0x126cdb){_0x56ff45=_0x56ff45-0x0;var _0x9bb629=_0x6953[_0x56ff45];return _0x9bb629;};'use strict';var Sequelize=require(_0x3695('0x0'));module[_0x3695('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3695('0x2')]('in','out'),'defaultValue':_0x3695('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3695('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3695('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5ed691c..3fe629c 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 _0xb8cf=['event','EventManager','fax-interactions','RejectMessage','rejectMessage','sequelize','email','rejectmessage','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','params','include','find','body','destroy','describe','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel'];(function(_0x3f5514,_0x5901ee){var _0x24ae8a=function(_0x2d3edb){while(--_0x2d3edb){_0x3f5514['push'](_0x3f5514['shift']());}};_0x24ae8a(++_0x5901ee);}(_0xb8cf,0x1b2));var _0xfb8c=function(_0x43a55f,_0x5468f2){_0x43a55f=_0x43a55f-0x0;var _0xd9a837=_0xb8cf[_0x43a55f];return _0xd9a837;};'use strict';var emlformat=require(_0xfb8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfb8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb8c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb8c('0x3'));var util=require(_0xfb8c('0x4'));var path=require(_0xfb8c('0x5'));var sox=require(_0xfb8c('0x6'));var csv=require(_0xfb8c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb8c('0x8'));var _=require(_0xfb8c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfb8c('0xa'));var deskjs=require(_0xfb8c('0xb'));var toCsv=require(_0xfb8c('0x7'));var querystring=require(_0xfb8c('0xc'));var Papa=require(_0xfb8c('0xd'));var Redis=require(_0xfb8c('0xe'));var authService=require(_0xfb8c('0xf'));var qs=require(_0xfb8c('0x10'));var as=require(_0xfb8c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb8c('0x12'))('api');var utils=require(_0xfb8c('0x13'));var config=require(_0xfb8c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb8c('0x15'))['db'];config['redis']=_['defaults'](config[_0xfb8c('0x16')],{'host':_0xfb8c('0x17'),'port':0x18eb});var socket=require(_0xfb8c('0x18'))(new Redis(config[_0xfb8c('0x16')]));require(_0xfb8c('0x19'))['register'](socket);var jayson=require(_0xfb8c('0x1a'));var client=jayson[_0xfb8c('0x1b')][_0xfb8c('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48f517,_0x3d87b4,_0x100315,_0x24075f){return new BPromise(function(_0x2f9228,_0x490d6b){var _0x1816aa=_0x24075f||client;return _0x1816aa[_0xfb8c('0x1d')](_0x48f517,_0x100315)[_0xfb8c('0x1e')](function(_0xe6dba2){logger[_0xfb8c('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x3d87b4,_0xfb8c('0x20'));logger[_0xfb8c('0x21')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3d87b4,_0xfb8c('0x20'),JSON[_0xfb8c('0x22')](_0xe6dba2));if(_0xe6dba2[_0xfb8c('0x23')]){if(_0xe6dba2[_0xfb8c('0x23')][_0xfb8c('0x24')]===0x1f4){logger['error'](_0xfb8c('0x25'),_0x3d87b4,_0xe6dba2['error'][_0xfb8c('0x26')]);return _0x490d6b(_0xe6dba2[_0xfb8c('0x23')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x3d87b4,_0xe6dba2[_0xfb8c('0x23')][_0xfb8c('0x26')]);return _0x2f9228(_0xe6dba2['error']['message']);}else{logger[_0xfb8c('0x1f')](_0xfb8c('0x25'),_0x3d87b4,'request\x20sent');_0x2f9228(_0xe6dba2[_0xfb8c('0x27')][_0xfb8c('0x26')]);}})[_0xfb8c('0x28')](function(_0xabe21){logger[_0xfb8c('0x23')]('FaxMessage,\x20%s,\x20%s',_0x3d87b4,_0xabe21);_0x490d6b(_0xabe21);});});}function respondWithStatusCode(_0x4e95d0,_0x281fa9){_0x281fa9=_0x281fa9||0xcc;return function(_0x42601d){if(_0x42601d){return _0x4e95d0['sendStatus'](_0x281fa9);}return _0x4e95d0[_0xfb8c('0x29')](_0x281fa9)[_0xfb8c('0x2a')]();};}function respondWithResult(_0x151e21,_0x29743a){_0x29743a=_0x29743a||0xc8;return function(_0x5e027b){if(_0x5e027b){return _0x151e21[_0xfb8c('0x29')](_0x29743a)[_0xfb8c('0x2b')](_0x5e027b);}};}function respondWithFilteredResult(_0x9298a1,_0x1e1f37){return function(_0x745e2c){if(_0x745e2c){var _0x4e3873=typeof _0x1e1f37[_0xfb8c('0x2c')]===_0xfb8c('0x2d')&&typeof _0x1e1f37[_0xfb8c('0x2e')]==='undefined';var _0x439218=_0x745e2c['count'];var _0x352ebc=_0x4e3873?0x0:_0x1e1f37[_0xfb8c('0x2c')];var _0x466836=_0x4e3873?_0x745e2c[_0xfb8c('0x2f')]:_0x1e1f37['offset']+_0x1e1f37[_0xfb8c('0x2e')];var _0xa0caa0;if(_0x466836>=_0x439218){_0x466836=_0x439218;_0xa0caa0=0xc8;}else{_0xa0caa0=0xce;}_0x9298a1[_0xfb8c('0x29')](_0xa0caa0);return _0x9298a1[_0xfb8c('0x30')](_0xfb8c('0x31'),_0x352ebc+'-'+_0x466836+'/'+_0x439218)[_0xfb8c('0x2b')](_0x745e2c);}return null;};}function patchUpdates(_0x34a48e){return function(_0x3d0a76){try{jsonpatch[_0xfb8c('0x32')](_0x3d0a76,_0x34a48e,!![]);}catch(_0x4d2580){return BPromise[_0xfb8c('0x33')](_0x4d2580);}return _0x3d0a76['save']();};}function saveUpdates(_0x895f14,_0x521eee){return function(_0x268aab){if(_0x268aab){return _0x268aab[_0xfb8c('0x34')](_0x895f14)[_0xfb8c('0x1e')](function(_0x37d56b){return _0x37d56b;});}return null;};}function removeEntity(_0x418559,_0x44aadb){return function(_0x25d448){if(_0x25d448){return _0x25d448['destroy']()['then'](function(){_0x418559[_0xfb8c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef798,_0x1f24b2){return function(_0x31135e){if(!_0x31135e){_0x4ef798[_0xfb8c('0x35')](0x194);}return _0x31135e;};}function handleError(_0x393130,_0x51dc0f){_0x51dc0f=_0x51dc0f||0x1f4;return function(_0x344126){logger[_0xfb8c('0x23')](_0x344126[_0xfb8c('0x36')]);if(_0x344126['name']){delete _0x344126[_0xfb8c('0x37')];}_0x393130[_0xfb8c('0x29')](_0x51dc0f)[_0xfb8c('0x38')](_0x344126);};}exports['index']=function(_0x66213c,_0x5411e2){var _0x54fd43={},_0x356f5e={},_0x7594a4={'count':0x0,'rows':[]};var _0x87aa7e=_[_0xfb8c('0x39')](db[_0xfb8c('0x3a')][_0xfb8c('0x3b')],function(_0x48f0fa){return{'name':_0x48f0fa[_0xfb8c('0x3c')],'type':_0x48f0fa[_0xfb8c('0x3d')][_0xfb8c('0x3e')]};});_0x356f5e[_0xfb8c('0x3f')]=_[_0xfb8c('0x39')](_0x87aa7e,'name');_0x356f5e[_0xfb8c('0x40')]=_[_0xfb8c('0x41')](_0x66213c['query']);_0x356f5e[_0xfb8c('0x42')]=_[_0xfb8c('0x43')](_0x356f5e['model'],_0x356f5e[_0xfb8c('0x40')]);_0x54fd43[_0xfb8c('0x44')]=_['intersection'](_0x356f5e[_0xfb8c('0x3f')],qs[_0xfb8c('0x45')](_0x66213c['query'][_0xfb8c('0x45')]));_0x54fd43['attributes']=_0x54fd43[_0xfb8c('0x44')][_0xfb8c('0x46')]?_0x54fd43[_0xfb8c('0x44')]:_0x356f5e[_0xfb8c('0x3f')];if(!_0x66213c[_0xfb8c('0x40')][_0xfb8c('0x47')](_0xfb8c('0x48'))){_0x54fd43[_0xfb8c('0x2e')]=qs[_0xfb8c('0x2e')](_0x66213c[_0xfb8c('0x40')][_0xfb8c('0x2e')]);_0x54fd43['offset']=qs[_0xfb8c('0x2c')](_0x66213c['query']['offset']);}_0x54fd43['order']=qs[_0xfb8c('0x49')](_0x66213c[_0xfb8c('0x40')][_0xfb8c('0x49')]);_0x54fd43[_0xfb8c('0x4a')]=qs[_0xfb8c('0x42')](_['pick'](_0x66213c[_0xfb8c('0x40')],_0x356f5e[_0xfb8c('0x42')]),_0x87aa7e);if(_0x66213c['query'][_0xfb8c('0x4b')]){_0x54fd43[_0xfb8c('0x4a')]=_[_0xfb8c('0x4c')](_0x54fd43[_0xfb8c('0x4a')],{'$or':_['map'](_0x87aa7e,function(_0x10ab52){if(_0x10ab52[_0xfb8c('0x3d')]!=='VIRTUAL'){var _0x31c0b4={};_0x31c0b4[_0x10ab52[_0xfb8c('0x37')]]={'$like':'%'+_0x66213c[_0xfb8c('0x40')][_0xfb8c('0x4b')]+'%'};return _0x31c0b4;}})});}_0x54fd43=_[_0xfb8c('0x4c')]({},_0x54fd43,_0x66213c[_0xfb8c('0x4d')]);var _0x1422db={'where':_0x54fd43[_0xfb8c('0x4a')]};return db[_0xfb8c('0x3a')][_0xfb8c('0x2f')](_0x1422db)[_0xfb8c('0x1e')](function(_0x81daf6){_0x7594a4[_0xfb8c('0x2f')]=_0x81daf6;if(_0x66213c[_0xfb8c('0x40')][_0xfb8c('0x4e')]){_0x54fd43['include']=[{'all':!![]}];}return db['FaxMessage'][_0xfb8c('0x4f')](_0x54fd43);})[_0xfb8c('0x1e')](function(_0x2eed53){_0x7594a4[_0xfb8c('0x50')]=_0x2eed53;return _0x7594a4;})['then'](respondWithFilteredResult(_0x5411e2,_0x54fd43))[_0xfb8c('0x28')](handleError(_0x5411e2,null));};exports['show']=function(_0x30ae8a,_0x1f9be3){var _0x4b712a={'raw':!![],'where':{'id':_0x30ae8a[_0xfb8c('0x51')]['id']}},_0x2fb1d5={};_0x2fb1d5[_0xfb8c('0x3f')]=_[_0xfb8c('0x41')](db[_0xfb8c('0x3a')][_0xfb8c('0x3b')]);_0x2fb1d5['query']=_[_0xfb8c('0x41')](_0x30ae8a[_0xfb8c('0x40')]);_0x2fb1d5[_0xfb8c('0x42')]=_['intersection'](_0x2fb1d5[_0xfb8c('0x3f')],_0x2fb1d5['query']);_0x4b712a['attributes']=_[_0xfb8c('0x43')](_0x2fb1d5['model'],qs['fields'](_0x30ae8a['query'][_0xfb8c('0x45')]));_0x4b712a[_0xfb8c('0x44')]=_0x4b712a[_0xfb8c('0x44')][_0xfb8c('0x46')]?_0x4b712a['attributes']:_0x2fb1d5[_0xfb8c('0x3f')];if(_0x30ae8a[_0xfb8c('0x40')][_0xfb8c('0x4e')]){_0x4b712a[_0xfb8c('0x52')]=[{'all':!![]}];}_0x4b712a=_[_0xfb8c('0x4c')]({},_0x4b712a,_0x30ae8a['options']);return db[_0xfb8c('0x3a')][_0xfb8c('0x53')](_0x4b712a)['then'](handleEntityNotFound(_0x1f9be3,null))[_0xfb8c('0x1e')](respondWithResult(_0x1f9be3,null))[_0xfb8c('0x28')](handleError(_0x1f9be3,null));};exports[_0xfb8c('0x34')]=function(_0x53112f,_0xb4236c){if(_0x53112f['body']['id']){delete _0x53112f[_0xfb8c('0x54')]['id'];}return db['FaxMessage'][_0xfb8c('0x53')]({'where':{'id':_0x53112f['params']['id']}})['then'](handleEntityNotFound(_0xb4236c,null))['then'](saveUpdates(_0x53112f[_0xfb8c('0x54')],null))[_0xfb8c('0x1e')](respondWithResult(_0xb4236c,null))['catch'](handleError(_0xb4236c,null));};exports[_0xfb8c('0x55')]=function(_0x325177,_0x4131de){return db[_0xfb8c('0x3a')][_0xfb8c('0x53')]({'where':{'id':_0x325177[_0xfb8c('0x51')]['id']}})['then'](handleEntityNotFound(_0x4131de,null))['then'](removeEntity(_0x4131de,null))[_0xfb8c('0x28')](handleError(_0x4131de,null));};exports[_0xfb8c('0x56')]=function(_0x4ffec2,_0x2bb368){return db[_0xfb8c('0x3a')]['describe']()['then'](respondWithResult(_0x2bb368,null))[_0xfb8c('0x28')](handleError(_0x2bb368,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xfb8c('0x57')]=function(_0x46e123,_0x1add96,_0x176311){var _0x8adeaa={'agent':{},'channel':_0xfb8c('0x58')};if(_0x46e123[_0xfb8c('0x54')]['id']){delete _0x46e123[_0xfb8c('0x54')]['id'];}_0x46e123[_0xfb8c('0x54')]['read']=!![];_0x46e123['body'][_0xfb8c('0x59')]=moment()[_0xfb8c('0x5a')](_0xfb8c('0x5b'));_0x46e123[_0xfb8c('0x54')][_0xfb8c('0x5c')]=_0x46e123[_0xfb8c('0x54')][_0xfb8c('0x5c')]||_0x46e123[_0xfb8c('0x5d')]['id'];_0x8adeaa[_0xfb8c('0x5e')]['id']=_0x46e123[_0xfb8c('0x54')][_0xfb8c('0x5c')];return db[_0xfb8c('0x3a')][_0xfb8c('0x53')]({'where':{'id':_0x46e123['params']['id'],'UserId':null}})[_0xfb8c('0x1e')](handleEntityNotFound(_0x1add96,null))['then'](saveUpdates(_0x46e123[_0xfb8c('0x54')],null))[_0xfb8c('0x1e')](function(_0x4aa5bf){if(_0x4aa5bf){_0x8adeaa['message']=_0x4aa5bf[_0xfb8c('0x5f')]({'plain':!![]});return db[_0xfb8c('0x60')][_0xfb8c('0x53')]({'where':{'id':_0x4aa5bf[_0xfb8c('0x61')]}});}return null;})[_0xfb8c('0x1e')](handleEntityNotFound(_0x1add96,null))[_0xfb8c('0x1e')](function(_0x1e0c98){if(_0x1e0c98){return _0x1e0c98[_0xfb8c('0x34')]({'UserId':_0x46e123[_0xfb8c('0x54')]['UserId'],'read1stAt':_[_0xfb8c('0x62')](_0x1e0c98[_0xfb8c('0x63')])?moment()[_0xfb8c('0x5a')](_0xfb8c('0x5b')):undefined});}return null;})[_0xfb8c('0x1e')](function(_0x593712){if(_0x593712){_0x8adeaa[_0xfb8c('0x64')]=_0x593712[_0xfb8c('0x5f')]({'plain':!![]});interaction_log[_0xfb8c('0x1f')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46e123[_0xfb8c('0x5d')]['id'],_0x46e123['user']['name'],_0x46e123[_0xfb8c('0x5d')][_0xfb8c('0x65')],_0x8adeaa[_0xfb8c('0x64')]['id'],_0x46e123[_0xfb8c('0x54')]?JSON[_0xfb8c('0x22')](_0x46e123[_0xfb8c('0x54')]):_0xfb8c('0x66'));return respondWithRpcPromise(_0xfb8c('0x67'),_0xfb8c('0x68'),_0x8adeaa);}return null;})['then'](function(_0x5b13cd){var _0x68539c=_0xfb8c('0x69')+_0x5b13cd[_0xfb8c('0x26')][_0xfb8c('0x6a')];return db['sequelize'][_0xfb8c('0x40')](_0x68539c,{'type':db[_0xfb8c('0x6b')][_0xfb8c('0x6c')][_0xfb8c('0x6d')],'raw':!![]})['then'](function(_0x3f4c1d){return _0x3f4c1d;});})[_0xfb8c('0x1e')](function(_0x4f2cd1){if(_0x4f2cd1){_0x8adeaa[_0xfb8c('0x26')][_0xfb8c('0x6e')]=_0x4f2cd1[0x0];if(!_0x46e123[_0xfb8c('0x54')][_0xfb8c('0x5c')])return;return db[_0xfb8c('0x6f')][_0xfb8c('0x53')]({'where':{'id':_0x46e123['body']['UserId'],'role':_0xfb8c('0x5e')},'attributes':['id',_0xfb8c('0x37'),_0xfb8c('0x70'),'email',_0xfb8c('0x71')],'raw':!![]});}return null;})[_0xfb8c('0x1e')](function(_0x76c4e4){if(!_0x76c4e4)return null;_0x8adeaa['message'][_0xfb8c('0x5e')]=_0x76c4e4;return _0x8adeaa;})[_0xfb8c('0x1e')](function(_0x52c531){if(_0x52c531){if(_0x46e123[_0xfb8c('0x54')][_0xfb8c('0x72')]){_0x8adeaa['message'][_0xfb8c('0x73')]=util[_0xfb8c('0x5a')](_0xfb8c('0x74'),_0x46e123[_0xfb8c('0x5d')][_0xfb8c('0x37')]);_0x8adeaa['message']['channel']=_0x8adeaa[_0xfb8c('0x75')];_0x8adeaa[_0xfb8c('0x26')][_0xfb8c('0x76')]='accept';return respondWithRpcPromise(_0xfb8c('0x77'),_0xfb8c('0x77'),{'event':'acceptmessage','message':_0x8adeaa[_0xfb8c('0x26')]},client9002)[_0xfb8c('0x1e')](function(){return _0x8adeaa;});}return _0x8adeaa;}return null;})[_0xfb8c('0x1e')](respondWithResult(_0x1add96,null))['catch'](handleError(_0x1add96,null));};var interaction_log=require(_0xfb8c('0x12'))(_0xfb8c('0x78'));exports[_0xfb8c('0x33')]=function(_0x2296bf,_0x19190c,_0x288cff){var _0x266fd7={'agent':{},'channel':'fax'};if(_0x2296bf[_0xfb8c('0x54')]['id']){delete _0x2296bf[_0xfb8c('0x54')]['id'];}_0x2296bf[_0xfb8c('0x54')][_0xfb8c('0x5c')]=_0x2296bf[_0xfb8c('0x54')][_0xfb8c('0x5c')]||_0x2296bf[_0xfb8c('0x5d')]['id'];_0x266fd7[_0xfb8c('0x5e')]['id']=_0x2296bf['body'][_0xfb8c('0x5c')];return db[_0xfb8c('0x3a')][_0xfb8c('0x53')]({'where':{'id':_0x2296bf[_0xfb8c('0x51')]['id'],'UserId':null}})[_0xfb8c('0x1e')](handleEntityNotFound(_0x19190c,null))['then'](function(_0x22660c){if(_0x22660c){_0x266fd7[_0xfb8c('0x26')]=_0x22660c['get']({'plain':!![]});return db[_0xfb8c('0x60')][_0xfb8c('0x53')]({'where':{'id':_0x22660c[_0xfb8c('0x61')]}});}return null;})[_0xfb8c('0x1e')](handleEntityNotFound(_0x19190c,null))[_0xfb8c('0x1e')](function(_0x597c22){if(_0x597c22){_0x266fd7[_0xfb8c('0x64')]=_0x597c22[_0xfb8c('0x5f')]({'plain':!![]});interaction_log[_0xfb8c('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2296bf[_0xfb8c('0x5d')]['id'],_0x2296bf['user']['name'],_0x2296bf[_0xfb8c('0x5d')][_0xfb8c('0x65')],_0x266fd7[_0xfb8c('0x64')]['id'],_0x2296bf[_0xfb8c('0x54')]?JSON[_0xfb8c('0x22')](_0x2296bf[_0xfb8c('0x54')]):_0xfb8c('0x66'));return respondWithRpcPromise(_0xfb8c('0x79'),_0xfb8c('0x7a'),_0x266fd7);}return null;})[_0xfb8c('0x1e')](function(_0x1d9699){var _0x235b36=_0xfb8c('0x69')+_0x1d9699[_0xfb8c('0x26')][_0xfb8c('0x6a')];return db[_0xfb8c('0x7b')][_0xfb8c('0x40')](_0x235b36,{'type':db[_0xfb8c('0x6b')][_0xfb8c('0x6c')][_0xfb8c('0x6d')],'raw':!![]})[_0xfb8c('0x1e')](function(_0x48e5b1){return _0x48e5b1;});})[_0xfb8c('0x1e')](function(_0x5df507){if(_0x5df507){_0x266fd7[_0xfb8c('0x26')]['contact']=_0x5df507[0x0];if(!_0x2296bf[_0xfb8c('0x54')][_0xfb8c('0x5c')])return;return db[_0xfb8c('0x6f')][_0xfb8c('0x53')]({'where':{'id':_0x2296bf['body'][_0xfb8c('0x5c')],'role':_0xfb8c('0x5e')},'attributes':['id',_0xfb8c('0x37'),_0xfb8c('0x70'),_0xfb8c('0x7c'),_0xfb8c('0x71')],'raw':!![]});}return null;})[_0xfb8c('0x1e')](function(_0x12616e){if(!_0x12616e)return null;_0x266fd7[_0xfb8c('0x26')][_0xfb8c('0x5e')]=_0x12616e;return _0x266fd7;})[_0xfb8c('0x1e')](function(_0x31078a){if(_0x31078a){_0x31078a['message'][_0xfb8c('0x73')]=util[_0xfb8c('0x5a')](_0xfb8c('0x74'),_0x2296bf['user']['name']);_0x31078a[_0xfb8c('0x26')][_0xfb8c('0x75')]=_0x266fd7['channel'];_0x31078a[_0xfb8c('0x26')][_0xfb8c('0x76')]=_0xfb8c('0x33');respondWithRpcPromise('EventManager',_0xfb8c('0x77'),{'event':_0xfb8c('0x7d'),'message':_0x31078a[_0xfb8c('0x26')]},client9002);return _0x266fd7;}return null;})['then'](respondWithResult(_0x19190c,null))['catch'](handleError(_0x19190c,null));};exports['create']=function(_0x2d5624,_0x240adf){var _0x41df36;return db['FaxMessage']['create'](_0x2d5624['body'],{})[_0xfb8c('0x1e')](function(_0x269287){_0x41df36=_0x269287;return db['CmContact'][_0xfb8c('0x7e')]({'where':{'id':_0x41df36[_0xfb8c('0x6a')]}});})[_0xfb8c('0x1e')](function(_0x5521a1){if(_['isNil'](_0x5521a1)){return;}else{_0x41df36['fax']=_0x5521a1[_0xfb8c('0x58')];return db[_0xfb8c('0x7f')]['findOne']({'where':{'id':_0x41df36[_0xfb8c('0x80')]}});}})['then'](function(_0x48eca2){return respondWithRpcPromise(_0xfb8c('0x81'),_0xfb8c('0x81'),{'FaxAccountId':_[_0xfb8c('0x62')](_0x2d5624[_0xfb8c('0x54')])?undefined:_0x2d5624[_0xfb8c('0x54')]['FaxAccountId'],'path':_[_0xfb8c('0x62')](_0x48eca2)?undefined:util[_0xfb8c('0x5a')](_0xfb8c('0x82'),_0x48eca2['basename']),'fax':_[_0xfb8c('0x62')](_0x41df36['fax'])?undefined:_0x41df36[_0xfb8c('0x58')],'AttachmentId':_0x41df36[_0xfb8c('0x80')]},client9002);})[_0xfb8c('0x1e')](respondWithResult(_0x240adf,0xc9))['catch'](handleError(_0x240adf,null));};exports[_0xfb8c('0x83')]=function(_0x5bd412,_0x29a74d){var _0x509204=path[_0xfb8c('0x84')](config[_0xfb8c('0x85')],_0xfb8c('0x86'),_0xfb8c('0x87'),_0xfb8c('0x88'));return db[_0xfb8c('0x3a')][_0xfb8c('0x53')]({'where':{'id':_0x5bd412['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xfb8c('0x1e')](handleEntityNotFound(_0x29a74d,null))[_0xfb8c('0x1e')](function(_0x1902ea){if(_0x1902ea){return _0x29a74d[_0xfb8c('0x83')](path[_0xfb8c('0x84')](_0x509204,_0x1902ea[_0xfb8c('0x7f')][_0xfb8c('0x89')]));}})['catch'](handleError(_0x29a74d,null));}; \ No newline at end of file +var _0x5929=['channel','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','ContactId','contact','event','EventManager','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','request\x20sent','debug','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','map','FaxMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','body','describe','../../config/logger','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','acceptMessage','sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s'];(function(_0x195089,_0x50f446){var _0x340704=function(_0x1ab098){while(--_0x1ab098){_0x195089['push'](_0x195089['shift']());}};_0x340704(++_0x50f446);}(_0x5929,0xa3));var _0x9592=function(_0x453e3a,_0x47d9e2){_0x453e3a=_0x453e3a-0x0;var _0x592dd7=_0x5929[_0x453e3a];return _0x592dd7;};'use strict';var emlformat=require(_0x9592('0x0'));var rimraf=require(_0x9592('0x1'));var zipdir=require(_0x9592('0x2'));var jsonpatch=require(_0x9592('0x3'));var rp=require(_0x9592('0x4'));var moment=require(_0x9592('0x5'));var BPromise=require(_0x9592('0x6'));var Mustache=require('mustache');var util=require(_0x9592('0x7'));var path=require(_0x9592('0x8'));var sox=require('sox');var csv=require(_0x9592('0x9'));var ejs=require(_0x9592('0xa'));var fs=require('fs');var fs_extra=require(_0x9592('0xb'));var _=require(_0x9592('0xc'));var squel=require(_0x9592('0xd'));var crypto=require(_0x9592('0xe'));var jsforce=require(_0x9592('0xf'));var deskjs=require(_0x9592('0x10'));var toCsv=require(_0x9592('0x9'));var querystring=require(_0x9592('0x11'));var Papa=require(_0x9592('0x12'));var Redis=require(_0x9592('0x13'));var authService=require(_0x9592('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9592('0x15'));var hardwareService=require(_0x9592('0x16'));var logger=require('../../config/logger')(_0x9592('0x17'));var utils=require(_0x9592('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9592('0x19'));var db=require(_0x9592('0x1a'))['db'];config[_0x9592('0x1b')]=_[_0x9592('0x1c')](config[_0x9592('0x1b')],{'host':_0x9592('0x1d'),'port':0x18eb});var socket=require(_0x9592('0x1e'))(new Redis(config[_0x9592('0x1b')]));require('./faxMessage.socket')[_0x9592('0x1f')](socket);var jayson=require(_0x9592('0x20'));var client=jayson[_0x9592('0x21')][_0x9592('0x22')]({'port':0x232c});var client9002=jayson[_0x9592('0x21')][_0x9592('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xddb54,_0x5bafde,_0x265276,_0x56fad9){return new BPromise(function(_0xd3c9f2,_0x9c7bd1){var _0x13426f=_0x56fad9||client;return _0x13426f['request'](_0xddb54,_0x265276)[_0x9592('0x23')](function(_0x264ce3){logger['info']('FaxMessage,\x20%s,\x20%s',_0x5bafde,_0x9592('0x24'));logger[_0x9592('0x25')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5bafde,'request\x20sent',JSON['stringify'](_0x264ce3));if(_0x264ce3[_0x9592('0x26')]){if(_0x264ce3['error'][_0x9592('0x27')]===0x1f4){logger['error'](_0x9592('0x28'),_0x5bafde,_0x264ce3[_0x9592('0x26')]['message']);return _0x9c7bd1(_0x264ce3[_0x9592('0x26')][_0x9592('0x29')]);}logger['error'](_0x9592('0x28'),_0x5bafde,_0x264ce3[_0x9592('0x26')]['message']);return _0xd3c9f2(_0x264ce3['error'][_0x9592('0x29')]);}else{logger[_0x9592('0x2a')](_0x9592('0x28'),_0x5bafde,_0x9592('0x24'));_0xd3c9f2(_0x264ce3[_0x9592('0x2b')][_0x9592('0x29')]);}})[_0x9592('0x2c')](function(_0x1465ee){logger[_0x9592('0x26')](_0x9592('0x28'),_0x5bafde,_0x1465ee);_0x9c7bd1(_0x1465ee);});});}function respondWithStatusCode(_0x5984bc,_0x412ab7){_0x412ab7=_0x412ab7||0xcc;return function(_0x3f5b9f){if(_0x3f5b9f){return _0x5984bc[_0x9592('0x2d')](_0x412ab7);}return _0x5984bc[_0x9592('0x2e')](_0x412ab7)[_0x9592('0x2f')]();};}function respondWithResult(_0x3a36db,_0x1b0107){_0x1b0107=_0x1b0107||0xc8;return function(_0x21af78){if(_0x21af78){return _0x3a36db[_0x9592('0x2e')](_0x1b0107)[_0x9592('0x30')](_0x21af78);}};}function respondWithFilteredResult(_0x3bc478,_0x5724cd){return function(_0x367feb){if(_0x367feb){var _0x2e81bc=typeof _0x5724cd[_0x9592('0x31')]===_0x9592('0x32')&&typeof _0x5724cd[_0x9592('0x33')]==='undefined';var _0xe743a2=_0x367feb['count'];var _0x5ee408=_0x2e81bc?0x0:_0x5724cd[_0x9592('0x31')];var _0x143646=_0x2e81bc?_0x367feb['count']:_0x5724cd['offset']+_0x5724cd[_0x9592('0x33')];var _0x538849;if(_0x143646>=_0xe743a2){_0x143646=_0xe743a2;_0x538849=0xc8;}else{_0x538849=0xce;}_0x3bc478[_0x9592('0x2e')](_0x538849);return _0x3bc478[_0x9592('0x34')](_0x9592('0x35'),_0x5ee408+'-'+_0x143646+'/'+_0xe743a2)['json'](_0x367feb);}return null;};}function patchUpdates(_0x2eecb5){return function(_0x1592fc){try{jsonpatch['apply'](_0x1592fc,_0x2eecb5,!![]);}catch(_0x12cc18){return BPromise[_0x9592('0x36')](_0x12cc18);}return _0x1592fc[_0x9592('0x37')]();};}function saveUpdates(_0x31a9f1,_0x4c3f33){return function(_0x5b4ab6){if(_0x5b4ab6){return _0x5b4ab6[_0x9592('0x38')](_0x31a9f1)[_0x9592('0x23')](function(_0x218537){return _0x218537;});}return null;};}function removeEntity(_0x23ce9f,_0x1876dc){return function(_0x25cc79){if(_0x25cc79){return _0x25cc79[_0x9592('0x39')]()[_0x9592('0x23')](function(){_0x23ce9f['status'](0xcc)[_0x9592('0x2f')]();});}};}function handleEntityNotFound(_0x2fdabf,_0x558969){return function(_0x161c61){if(!_0x161c61){_0x2fdabf['sendStatus'](0x194);}return _0x161c61;};}function handleError(_0x5916a9,_0x29ee8a){_0x29ee8a=_0x29ee8a||0x1f4;return function(_0x871cfc){logger['error'](_0x871cfc[_0x9592('0x3a')]);if(_0x871cfc[_0x9592('0x3b')]){delete _0x871cfc['name'];}_0x5916a9[_0x9592('0x2e')](_0x29ee8a)['send'](_0x871cfc);};}exports[_0x9592('0x3c')]=function(_0x37acad,_0x3b3720){var _0x2b0210={},_0x559d89={},_0x2cf060={'count':0x0,'rows':[]};var _0x42934b=_[_0x9592('0x3d')](db[_0x9592('0x3e')][_0x9592('0x3f')],function(_0x29de35){return{'name':_0x29de35['fieldName'],'type':_0x29de35['type'][_0x9592('0x40')]};});_0x559d89[_0x9592('0x41')]=_['map'](_0x42934b,_0x9592('0x3b'));_0x559d89[_0x9592('0x42')]=_[_0x9592('0x43')](_0x37acad[_0x9592('0x42')]);_0x559d89[_0x9592('0x44')]=_[_0x9592('0x45')](_0x559d89[_0x9592('0x41')],_0x559d89[_0x9592('0x42')]);_0x2b0210[_0x9592('0x46')]=_[_0x9592('0x45')](_0x559d89['model'],qs[_0x9592('0x47')](_0x37acad['query']['fields']));_0x2b0210['attributes']=_0x2b0210[_0x9592('0x46')][_0x9592('0x48')]?_0x2b0210[_0x9592('0x46')]:_0x559d89[_0x9592('0x41')];if(!_0x37acad[_0x9592('0x42')][_0x9592('0x49')]('nolimit')){_0x2b0210['limit']=qs['limit'](_0x37acad[_0x9592('0x42')][_0x9592('0x33')]);_0x2b0210[_0x9592('0x31')]=qs[_0x9592('0x31')](_0x37acad[_0x9592('0x42')][_0x9592('0x31')]);}_0x2b0210[_0x9592('0x4a')]=qs['sort'](_0x37acad[_0x9592('0x42')][_0x9592('0x4b')]);_0x2b0210[_0x9592('0x4c')]=qs['filters'](_['pick'](_0x37acad[_0x9592('0x42')],_0x559d89['filters']),_0x42934b);if(_0x37acad[_0x9592('0x42')]['filter']){_0x2b0210[_0x9592('0x4c')]=_['merge'](_0x2b0210[_0x9592('0x4c')],{'$or':_[_0x9592('0x3d')](_0x42934b,function(_0x59f8d8){if(_0x59f8d8[_0x9592('0x4d')]!==_0x9592('0x4e')){var _0x440d0b={};_0x440d0b[_0x59f8d8[_0x9592('0x3b')]]={'$like':'%'+_0x37acad[_0x9592('0x42')][_0x9592('0x4f')]+'%'};return _0x440d0b;}})});}_0x2b0210=_[_0x9592('0x50')]({},_0x2b0210,_0x37acad[_0x9592('0x51')]);var _0x45037a={'where':_0x2b0210[_0x9592('0x4c')]};return db['FaxMessage']['count'](_0x45037a)[_0x9592('0x23')](function(_0x4e8fa3){_0x2cf060[_0x9592('0x52')]=_0x4e8fa3;if(_0x37acad[_0x9592('0x42')][_0x9592('0x53')]){_0x2b0210[_0x9592('0x54')]=[{'all':!![]}];}return db[_0x9592('0x3e')][_0x9592('0x55')](_0x2b0210);})[_0x9592('0x23')](function(_0x356c8e){_0x2cf060[_0x9592('0x56')]=_0x356c8e;return _0x2cf060;})[_0x9592('0x23')](respondWithFilteredResult(_0x3b3720,_0x2b0210))[_0x9592('0x2c')](handleError(_0x3b3720,null));};exports[_0x9592('0x57')]=function(_0x970efc,_0x339045){var _0x233cd7={'raw':!![],'where':{'id':_0x970efc[_0x9592('0x58')]['id']}},_0x12f029={};_0x12f029[_0x9592('0x41')]=_[_0x9592('0x43')](db['FaxMessage'][_0x9592('0x3f')]);_0x12f029[_0x9592('0x42')]=_[_0x9592('0x43')](_0x970efc['query']);_0x12f029['filters']=_[_0x9592('0x45')](_0x12f029[_0x9592('0x41')],_0x12f029[_0x9592('0x42')]);_0x233cd7[_0x9592('0x46')]=_[_0x9592('0x45')](_0x12f029[_0x9592('0x41')],qs['fields'](_0x970efc[_0x9592('0x42')][_0x9592('0x47')]));_0x233cd7[_0x9592('0x46')]=_0x233cd7[_0x9592('0x46')]['length']?_0x233cd7['attributes']:_0x12f029[_0x9592('0x41')];if(_0x970efc['query'][_0x9592('0x53')]){_0x233cd7['include']=[{'all':!![]}];}_0x233cd7=_[_0x9592('0x50')]({},_0x233cd7,_0x970efc[_0x9592('0x51')]);return db[_0x9592('0x3e')][_0x9592('0x59')](_0x233cd7)[_0x9592('0x23')](handleEntityNotFound(_0x339045,null))[_0x9592('0x23')](respondWithResult(_0x339045,null))[_0x9592('0x2c')](handleError(_0x339045,null));};exports[_0x9592('0x38')]=function(_0x4a48fb,_0x1200d7){if(_0x4a48fb[_0x9592('0x5a')]['id']){delete _0x4a48fb['body']['id'];}return db[_0x9592('0x3e')][_0x9592('0x59')]({'where':{'id':_0x4a48fb['params']['id']}})[_0x9592('0x23')](handleEntityNotFound(_0x1200d7,null))['then'](saveUpdates(_0x4a48fb['body'],null))['then'](respondWithResult(_0x1200d7,null))[_0x9592('0x2c')](handleError(_0x1200d7,null));};exports[_0x9592('0x39')]=function(_0x5a0561,_0x27ac47){return db[_0x9592('0x3e')][_0x9592('0x59')]({'where':{'id':_0x5a0561[_0x9592('0x58')]['id']}})['then'](handleEntityNotFound(_0x27ac47,null))[_0x9592('0x23')](removeEntity(_0x27ac47,null))[_0x9592('0x2c')](handleError(_0x27ac47,null));};exports[_0x9592('0x5b')]=function(_0x49aef1,_0x1e228){return db[_0x9592('0x3e')][_0x9592('0x5b')]()[_0x9592('0x23')](respondWithResult(_0x1e228,null))[_0x9592('0x2c')](handleError(_0x1e228,null));};var interaction_log=require(_0x9592('0x5c'))(_0x9592('0x5d'));exports[_0x9592('0x5e')]=function(_0x418337,_0xbde06,_0x3736f8){var _0x2cfeb9={'agent':{},'channel':'fax'};if(_0x418337[_0x9592('0x5a')]['id']){delete _0x418337['body']['id'];}_0x418337[_0x9592('0x5a')]['read']=!![];_0x418337[_0x9592('0x5a')][_0x9592('0x5f')]=moment()[_0x9592('0x60')](_0x9592('0x61'));_0x418337[_0x9592('0x5a')][_0x9592('0x62')]=_0x418337['body'][_0x9592('0x62')]||_0x418337[_0x9592('0x63')]['id'];_0x2cfeb9[_0x9592('0x64')]['id']=_0x418337[_0x9592('0x5a')]['UserId'];return db[_0x9592('0x3e')]['find']({'where':{'id':_0x418337[_0x9592('0x58')]['id'],'UserId':null}})[_0x9592('0x23')](handleEntityNotFound(_0xbde06,null))[_0x9592('0x23')](saveUpdates(_0x418337[_0x9592('0x5a')],null))['then'](function(_0x5b359e){if(_0x5b359e){_0x2cfeb9[_0x9592('0x29')]=_0x5b359e[_0x9592('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x9592('0x59')]({'where':{'id':_0x5b359e[_0x9592('0x66')]}});}return null;})[_0x9592('0x23')](handleEntityNotFound(_0xbde06,null))['then'](function(_0x31c36f){if(_0x31c36f){return _0x31c36f['update']({'UserId':_0x418337['body'][_0x9592('0x62')],'read1stAt':_[_0x9592('0x67')](_0x31c36f[_0x9592('0x68')])?moment()[_0x9592('0x60')](_0x9592('0x61')):undefined});}return null;})[_0x9592('0x23')](function(_0x542bdb){if(_0x542bdb){_0x2cfeb9[_0x9592('0x69')]=_0x542bdb[_0x9592('0x65')]({'plain':!![]});interaction_log[_0x9592('0x2a')](_0x9592('0x6a'),_0x418337[_0x9592('0x63')]['id'],_0x418337[_0x9592('0x63')][_0x9592('0x3b')],_0x418337[_0x9592('0x63')]['role'],_0x2cfeb9[_0x9592('0x69')]['id'],_0x418337['body']?JSON[_0x9592('0x6b')](_0x418337[_0x9592('0x5a')]):_0x9592('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x9592('0x6d'),_0x2cfeb9);}return null;})['then'](function(_0x1c0c50){var _0x328353='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c0c50['message']['ContactId'];return db[_0x9592('0x6e')][_0x9592('0x42')](_0x328353,{'type':db['Sequelize'][_0x9592('0x6f')][_0x9592('0x70')],'raw':!![]})['then'](function(_0x200c5e){return _0x200c5e;});})['then'](function(_0x214be5){if(_0x214be5){_0x2cfeb9[_0x9592('0x29')]['contact']=_0x214be5[0x0];if(!_0x418337['body'][_0x9592('0x62')])return;return db[_0x9592('0x71')]['find']({'where':{'id':_0x418337[_0x9592('0x5a')][_0x9592('0x62')],'role':_0x9592('0x64')},'attributes':['id',_0x9592('0x3b'),'fullname',_0x9592('0x72'),_0x9592('0x73')],'raw':!![]});}return null;})[_0x9592('0x23')](function(_0x56373c){if(!_0x56373c)return null;_0x2cfeb9['message'][_0x9592('0x64')]=_0x56373c;return _0x2cfeb9;})[_0x9592('0x23')](function(_0x55cbe8){if(_0x55cbe8){if(_0x418337['body'][_0x9592('0x74')]){_0x2cfeb9[_0x9592('0x29')][_0x9592('0x75')]=util[_0x9592('0x60')](_0x9592('0x76'),_0x418337[_0x9592('0x63')][_0x9592('0x3b')]);_0x2cfeb9[_0x9592('0x29')][_0x9592('0x77')]=_0x2cfeb9[_0x9592('0x77')];_0x2cfeb9['message']['event']=_0x9592('0x5e');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x9592('0x78'),'message':_0x2cfeb9[_0x9592('0x29')]},client9002)[_0x9592('0x23')](function(){return _0x2cfeb9;});}return _0x2cfeb9;}return null;})[_0x9592('0x23')](respondWithResult(_0xbde06,null))[_0x9592('0x2c')](handleError(_0xbde06,null));};var interaction_log=require('../../config/logger')(_0x9592('0x5d'));exports['reject']=function(_0x2679ef,_0x46e58c,_0x32e009){var _0x236fe3={'agent':{},'channel':_0x9592('0x79')};if(_0x2679ef[_0x9592('0x5a')]['id']){delete _0x2679ef[_0x9592('0x5a')]['id'];}_0x2679ef[_0x9592('0x5a')][_0x9592('0x62')]=_0x2679ef['body']['UserId']||_0x2679ef[_0x9592('0x63')]['id'];_0x236fe3[_0x9592('0x64')]['id']=_0x2679ef['body'][_0x9592('0x62')];return db[_0x9592('0x3e')][_0x9592('0x59')]({'where':{'id':_0x2679ef['params']['id'],'UserId':null}})[_0x9592('0x23')](handleEntityNotFound(_0x46e58c,null))[_0x9592('0x23')](function(_0x2557bf){if(_0x2557bf){_0x236fe3[_0x9592('0x29')]=_0x2557bf[_0x9592('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x9592('0x59')]({'where':{'id':_0x2557bf['FaxInteractionId']}});}return null;})[_0x9592('0x23')](handleEntityNotFound(_0x46e58c,null))['then'](function(_0x3c7ff6){if(_0x3c7ff6){_0x236fe3['interaction']=_0x3c7ff6[_0x9592('0x65')]({'plain':!![]});interaction_log[_0x9592('0x2a')](_0x9592('0x7a'),_0x2679ef[_0x9592('0x63')]['id'],_0x2679ef['user'][_0x9592('0x3b')],_0x2679ef[_0x9592('0x63')][_0x9592('0x7b')],_0x236fe3['interaction']['id'],_0x2679ef[_0x9592('0x5a')]?JSON[_0x9592('0x6b')](_0x2679ef[_0x9592('0x5a')]):'null');return respondWithRpcPromise(_0x9592('0x7c'),'rejectMessage',_0x236fe3);}return null;})[_0x9592('0x23')](function(_0x2144bb){var _0x5d0ccc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2144bb[_0x9592('0x29')][_0x9592('0x7d')];return db[_0x9592('0x6e')][_0x9592('0x42')](_0x5d0ccc,{'type':db['Sequelize'][_0x9592('0x6f')][_0x9592('0x70')],'raw':!![]})[_0x9592('0x23')](function(_0x4a7baf){return _0x4a7baf;});})[_0x9592('0x23')](function(_0x39de3e){if(_0x39de3e){_0x236fe3[_0x9592('0x29')][_0x9592('0x7e')]=_0x39de3e[0x0];if(!_0x2679ef[_0x9592('0x5a')][_0x9592('0x62')])return;return db['User'][_0x9592('0x59')]({'where':{'id':_0x2679ef['body']['UserId'],'role':_0x9592('0x64')},'attributes':['id',_0x9592('0x3b'),'fullname','email',_0x9592('0x73')],'raw':!![]});}return null;})[_0x9592('0x23')](function(_0x37dcd5){if(!_0x37dcd5)return null;_0x236fe3['message'][_0x9592('0x64')]=_0x37dcd5;return _0x236fe3;})['then'](function(_0x4c3ff9){if(_0x4c3ff9){_0x4c3ff9[_0x9592('0x29')][_0x9592('0x75')]=util['format'](_0x9592('0x76'),_0x2679ef[_0x9592('0x63')][_0x9592('0x3b')]);_0x4c3ff9['message'][_0x9592('0x77')]=_0x236fe3[_0x9592('0x77')];_0x4c3ff9['message'][_0x9592('0x7f')]='reject';respondWithRpcPromise(_0x9592('0x80'),'EventManager',{'event':_0x9592('0x81'),'message':_0x4c3ff9[_0x9592('0x29')]},client9002);return _0x236fe3;}return null;})[_0x9592('0x23')](respondWithResult(_0x46e58c,null))['catch'](handleError(_0x46e58c,null));};exports['create']=function(_0x18dc72,_0x57fdb3){var _0x169013;return db[_0x9592('0x3e')][_0x9592('0x82')](_0x18dc72[_0x9592('0x5a')],{})[_0x9592('0x23')](function(_0x58ad8d){_0x169013=_0x58ad8d;return db['CmContact'][_0x9592('0x83')]({'where':{'id':_0x169013['ContactId']}});})[_0x9592('0x23')](function(_0x24c060){if(_[_0x9592('0x67')](_0x24c060)){return;}else{_0x169013['fax']=_0x24c060[_0x9592('0x79')];return db[_0x9592('0x84')]['findOne']({'where':{'id':_0x169013[_0x9592('0x85')]}});}})[_0x9592('0x23')](function(_0x2630bc){return respondWithRpcPromise(_0x9592('0x86'),_0x9592('0x86'),{'FaxAccountId':_[_0x9592('0x67')](_0x18dc72['body'])?undefined:_0x18dc72[_0x9592('0x5a')]['FaxAccountId'],'path':_[_0x9592('0x67')](_0x2630bc)?undefined:util[_0x9592('0x60')](_0x9592('0x87'),_0x2630bc[_0x9592('0x88')]),'fax':_[_0x9592('0x67')](_0x169013[_0x9592('0x79')])?undefined:_0x169013[_0x9592('0x79')],'AttachmentId':_0x169013[_0x9592('0x85')]},client9002);})['then'](respondWithResult(_0x57fdb3,0xc9))['catch'](handleError(_0x57fdb3,null));};exports['download']=function(_0x52975a,_0x50bc14){var _0xe28740=path[_0x9592('0x89')](config['root'],_0x9592('0x8a'),_0x9592('0x8b'),_0x9592('0x8c'));return db['FaxMessage']['find']({'where':{'id':_0x52975a[_0x9592('0x58')]['id']},'include':[{'model':db[_0x9592('0x84')],'as':_0x9592('0x84')}]})['then'](handleEntityNotFound(_0x50bc14,null))[_0x9592('0x23')](function(_0x39df7f){if(_0x39df7f){return _0x50bc14['download'](path[_0x9592('0x89')](_0xe28740,_0x39df7f[_0x9592('0x84')][_0x9592('0x88')]));}})[_0x9592('0x2c')](handleError(_0x50bc14,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d3fea54..cb3b433 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 _0x720b=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update'];(function(_0x14e8d3,_0x67e3a){var _0x1f565b=function(_0x2be885){while(--_0x2be885){_0x14e8d3['push'](_0x14e8d3['shift']());}};_0x1f565b(++_0x67e3a);}(_0x720b,0x1d8));var _0xb720=function(_0x494dfb,_0x5f460d){_0x494dfb=_0x494dfb-0x0;var _0x355a67=_0x720b[_0x494dfb];return _0x355a67;};'use strict';var EventEmitter=require(_0xb720('0x0'));var FaxMessage=require(_0xb720('0x1'))['db'][_0xb720('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb720('0x3'),'afterUpdate':_0xb720('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f7ac1){return function(_0x3f8acb,_0x33f308,_0x4ddff9){FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1+':'+_0x3f8acb['id'],_0x3f8acb);FaxMessageEvents[_0xb720('0x5')](_0x2f7ac1,_0x3f8acb);_0x4ddff9(null);};}for(var e in events){if(events[_0xb720('0x6')](e)){var event=events[e];FaxMessage[_0xb720('0x7')](e,emitEvent(event));}}module[_0xb720('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xe5e0=['save','update','remove','emit','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0xfcae54,_0xf57071){var _0x285fb9=function(_0x510067){while(--_0x510067){_0xfcae54['push'](_0xfcae54['shift']());}};_0x285fb9(++_0xf57071);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x50b698,_0x5d81b2){_0x50b698=_0x50b698-0x0;var _0x36d3cd=_0xe5e0[_0x50b698];return _0x36d3cd;};'use strict';var EventEmitter=require(_0x0e5e('0x0'));var FaxMessage=require(_0x0e5e('0x1'))['db'][_0x0e5e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0e5e('0x3')](0x0);var events={'afterCreate':_0x0e5e('0x4'),'afterUpdate':_0x0e5e('0x5'),'afterDestroy':_0x0e5e('0x6')};function emitEvent(_0x20e1d0){return function(_0xe914ff,_0x57244d,_0x31d9e8){FaxMessageEvents[_0x0e5e('0x7')](_0x20e1d0+':'+_0xe914ff['id'],_0xe914ff);FaxMessageEvents[_0x0e5e('0x7')](_0x20e1d0,_0xe914ff);_0x31d9e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x0e5e('0x8')](e,emitEvent(event));}}module[_0x0e5e('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d10de5f..90ce458 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 _0x6d99=['./faxMessage.attributes','exports','define','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5f542e,_0x57b50d){var _0x56f8c1=function(_0x4883d5){while(--_0x4883d5){_0x5f542e['push'](_0x5f542e['shift']());}};_0x56f8c1(++_0x57b50d);}(_0x6d99,0xdf));var _0x96d9=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x6d99[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require(_0x96d9('0x0'));var util=require(_0x96d9('0x1'));var logger=require(_0x96d9('0x2'))(_0x96d9('0x3'));var moment=require(_0x96d9('0x4'));var BPromise=require(_0x96d9('0x5'));var rp=require(_0x96d9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96d9('0x7'));var config=require(_0x96d9('0x8'));var attributes=require(_0x96d9('0x9'));module[_0x96d9('0xa')]=function(_0x4d19a8,_0x1c1052){return _0x4d19a8[_0x96d9('0xb')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x96d9('0xc'),'fields':[_0x96d9('0xd')],'type':_0x96d9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf55a70,_0xcd2c58,_0x5a01fe){var _0x1a6243=_0x4d19a8['models'];var _0x2e6c83=_0xf55a70['get']({'plain':!![]});if(_0x2e6c83[_0x96d9('0xf')][_0x96d9('0x10')]()==='in'||_0x2e6c83[_0x96d9('0xf')][_0x96d9('0x10')]()===_0x96d9('0x11')&&!_0x2e6c83[_0x96d9('0x12')]&&!_[_0x96d9('0x13')](_0x2e6c83[_0x96d9('0x14')])){_0x1a6243[_0x96d9('0x15')]['findOne']({'where':{'id':_0x2e6c83[_0x96d9('0x16')]}})[_0x96d9('0x17')](function(_0x530c94){if(_0x530c94){_0x530c94['update']({'lastMsgAt':_0x2e6c83[_0x96d9('0x18')],'lastMsgDirection':_0x2e6c83[_0x96d9('0xf')][_0x96d9('0x10')]()});}})[_0x96d9('0x19')](function(_0x14f145){console[_0x96d9('0x1a')](_0x14f145);});}_0x5a01fe();}},'charset':_0x96d9('0x1b'),'collate':_0x96d9('0x1c')});}; \ No newline at end of file +var _0x007f=['api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x41f0e0,_0x3529af){var _0x4216de=function(_0x1643ce){while(--_0x1643ce){_0x41f0e0['push'](_0x41f0e0['shift']());}};_0x4216de(++_0x3529af);}(_0x007f,0x134));var _0xf007=function(_0x37b67e,_0x2c3ceb){_0x37b67e=_0x37b67e-0x0;var _0x2072bf=_0x007f[_0x37b67e];return _0x2072bf;};'use strict';var _=require('lodash');var util=require(_0xf007('0x0'));var logger=require(_0xf007('0x1'))(_0xf007('0x2'));var moment=require(_0xf007('0x3'));var BPromise=require(_0xf007('0x4'));var rp=require(_0xf007('0x5'));var fs=require('fs');var path=require(_0xf007('0x6'));var rimraf=require('rimraf');var config=require(_0xf007('0x7'));var attributes=require(_0xf007('0x8'));module[_0xf007('0x9')]=function(_0x131e2b,_0x247e75){return _0x131e2b[_0xf007('0xa')](_0xf007('0xb'),attributes,{'tableName':_0xf007('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xf007('0xd')],'type':_0xf007('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xeb62a1,_0x5398ac,_0x37add1){var _0x2cfd0f=_0x131e2b[_0xf007('0xf')];var _0x42765c=_0xeb62a1[_0xf007('0x10')]({'plain':!![]});if(_0x42765c[_0xf007('0x11')]['toLowerCase']()==='in'||_0x42765c['direction'][_0xf007('0x12')]()===_0xf007('0x13')&&!_0x42765c[_0xf007('0x14')]&&!_['isNil'](_0x42765c[_0xf007('0x15')])){_0x2cfd0f[_0xf007('0x16')][_0xf007('0x17')]({'where':{'id':_0x42765c[_0xf007('0x18')]}})[_0xf007('0x19')](function(_0x58c9e3){if(_0x58c9e3){_0x58c9e3[_0xf007('0x1a')]({'lastMsgAt':_0x42765c['createdAt'],'lastMsgDirection':_0x42765c[_0xf007('0x11')][_0xf007('0x12')]()});}})[_0xf007('0x1b')](function(_0x55368e){console[_0xf007('0x1c')](_0x55368e);});}_0x37add1();}},'charset':_0xf007('0x1d'),'collate':_0xf007('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 4eb73f8..b839a66 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 _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x560346,_0x166edb){var _0x498078=function(_0x3cd11f){while(--_0x3cd11f){_0x560346['push'](_0x560346['shift']());}};_0x498078(++_0x166edb);}(_0x9f62,0x154));var _0x29f6=function(_0x5bd8ef,_0x3846db){_0x5bd8ef=_0x5bd8ef-0x0;var _0x2d5f42=_0x9f62[_0x5bd8ef];return _0x2d5f42;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file +var _0x008c=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','options','raw','then','CreateFaxMessage','attributes','limit','UpdateFaxMessage','stringify','lodash','util','moment','bluebird'];(function(_0x17d581,_0x3b01b6){var _0x3c57d3=function(_0x90af96){while(--_0x90af96){_0x17d581['push'](_0x17d581['shift']());}};_0x3c57d3(++_0x3b01b6);}(_0x008c,0x188));var _0xc008=function(_0x1a450a,_0x4dcb72){_0x1a450a=_0x1a450a-0x0;var _0x4f8ef4=_0x008c[_0x1a450a];return _0x4f8ef4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./faxMessage.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('FaxMessage,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});}exports['CreateFaxMessage']=function(_0x543e5d){var _0x50261c=this;return new Promise(function(_0x5754a0,_0x4b9726){return db['FaxMessage']['create'](_0x543e5d['body'],{'raw':_0x543e5d['options']?_0x543e5d[_0xc008('0x19')][_0xc008('0x1a')]===undefined?!![]:![]:!![]})[_0xc008('0x1b')](function(_0x415af3){logger[_0xc008('0x11')](_0xc008('0x1c'),_0x543e5d);logger['debug'](_0xc008('0x1c'),_0x543e5d,JSON['stringify'](_0x415af3));_0x5754a0(_0x415af3);})['catch'](function(_0x218599){logger[_0xc008('0x16')](_0xc008('0x1c'),_0x218599[_0xc008('0x17')],_0x543e5d);_0x4b9726(_0x50261c['error'](0x1f4,_0x218599['message']));});});};exports['UpdateFaxMessage']=function(_0x3f7b07){var _0x15dade=this;return new Promise(function(_0x92c582,_0x2e31c2){return db['FaxMessage']['update'](_0x3f7b07['body'],{'raw':_0x3f7b07['options']?_0x3f7b07['options'][_0xc008('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')]['where']||null:null,'attributes':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07[_0xc008('0x19')][_0xc008('0x1d')]||null:null,'limit':_0x3f7b07[_0xc008('0x19')]?_0x3f7b07['options'][_0xc008('0x1e')]||null:null})[_0xc008('0x1b')](function(_0x53ed35){logger['info']('UpdateFaxMessage',_0x3f7b07);logger[_0xc008('0x14')](_0xc008('0x1f'),_0x3f7b07,JSON[_0xc008('0x20')](_0x53ed35));_0x92c582(_0x53ed35);})[_0xc008('0x18')](function(_0x1de04b){logger[_0xc008('0x16')](_0xc008('0x1f'),_0x1de04b[_0xc008('0x17')],_0x3f7b07);_0x2e31c2(_0x15dade[_0xc008('0x16')](0x1f4,_0x1de04b[_0xc008('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 0f809a2..a109a7e 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 _0x8acf=['length','faxMessage:','./faxMessage.events','remove','update','emit','removeListener','register'];(function(_0x140b2e,_0x5af011){var _0x4b7687=function(_0x3b7cfc){while(--_0x3b7cfc){_0x140b2e['push'](_0x140b2e['shift']());}};_0x4b7687(++_0x5af011);}(_0x8acf,0x18a));var _0xf8ac=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x8acf[_0x587dd0];return _0x56f153;};'use strict';var FaxMessageEvents=require(_0xf8ac('0x0'));var events=['save',_0xf8ac('0x1'),_0xf8ac('0x2')];function createListener(_0xd797d,_0x16c4df){return function(_0x3f13c1){_0x16c4df[_0xf8ac('0x3')](_0xd797d,_0x3f13c1);};}function removeListener(_0x5894cf,_0x402f46){return function(){FaxMessageEvents[_0xf8ac('0x4')](_0x5894cf,_0x402f46);};}exports[_0xf8ac('0x5')]=function(_0x3ba79d){for(var _0x171d29=0x0,_0x2f4a27=events[_0xf8ac('0x6')];_0x171d29<_0x2f4a27;_0x171d29++){var _0x1e0566=events[_0x171d29];var _0x29b1a2=createListener(_0xf8ac('0x7')+_0x1e0566,_0x3ba79d);FaxMessageEvents['on'](_0x1e0566,_0x29b1a2);}}; \ No newline at end of file +var _0x73ea=['save','remove','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x73ea,0x125));var _0xa73e=function(_0x16dce2,_0x56eddf){_0x16dce2=_0x16dce2-0x0;var _0x3c492f=_0x73ea[_0x16dce2];return _0x3c492f;};'use strict';var FaxMessageEvents=require(_0xa73e('0x0'));var events=[_0xa73e('0x1'),_0xa73e('0x2'),'update'];function createListener(_0x1cc216,_0x3932ab){return function(_0x3075e3){_0x3932ab[_0xa73e('0x3')](_0x1cc216,_0x3075e3);};}function removeListener(_0x2a3cc4,_0x4941e5){return function(){FaxMessageEvents[_0xa73e('0x4')](_0x2a3cc4,_0x4941e5);};}exports[_0xa73e('0x5')]=function(_0x3e43d8){for(var _0x3528f3=0x0,_0xc94bb3=events['length'];_0x3528f3<_0xc94bb3;_0x3528f3++){var _0x28eea8=events[_0x3528f3];var _0x4c5be0=createListener(_0xa73e('0x6')+_0x28eea8,_0x3e43d8);FaxMessageEvents['on'](_0x28eea8,_0x4c5be0);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 29f52af..cabc660 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 _0xdace=['/describe','describe','/:id','show','download','tracked','fax','create','update','put','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x34fe2c,_0x3c12cc){var _0x4fef94=function(_0x761711){while(--_0x761711){_0x34fe2c['push'](_0x34fe2c['shift']());}};_0x4fef94(++_0x3c12cc);}(_0xdace,0xc5));var _0xedac=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xdace[_0x2d9535];return _0xb4e710;};'use strict';var multer=require(_0xedac('0x0'));var util=require('util');var path=require(_0xedac('0x1'));var timeout=require(_0xedac('0x2'));var express=require(_0xedac('0x3'));var router=express['Router']();var fs_extra=require(_0xedac('0x4'));var auth=require(_0xedac('0x5'));var interaction=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var controller=require('./faxMessage.controller');router[_0xedac('0x8')]('/',auth[_0xedac('0x9')](),controller[_0xedac('0xa')]);router['get'](_0xedac('0xb'),auth[_0xedac('0x9')](),controller[_0xedac('0xc')]);router['get'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0xe')]);router['get']('/:id/download',auth[_0xedac('0x9')](),controller[_0xedac('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xedac('0x10')](_0xedac('0x11'),'faxmessage:create'),controller[_0xedac('0x12')]);router['put'](_0xedac('0xd'),auth[_0xedac('0x9')](),controller[_0xedac('0x13')]);router[_0xedac('0x14')](_0xedac('0x15'),auth[_0xedac('0x9')](),controller[_0xedac('0x16')]);router[_0xedac('0x14')]('/:id/reject',auth[_0xedac('0x9')](),controller[_0xedac('0x17')]);router[_0xedac('0x18')](_0xedac('0xd'),auth[_0xedac('0x9')](),controller['destroy']);module[_0xedac('0x19')]=router; \ No newline at end of file +var _0xde2c=['/describe','describe','show','/:id/download','download','post','fax','faxmessage:create','create','put','/:id','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x59a56c,_0x9dd0a9){var _0x38bab4=function(_0x48b7d2){while(--_0x48b7d2){_0x59a56c['push'](_0x59a56c['shift']());}};_0x38bab4(++_0x9dd0a9);}(_0xde2c,0x7f));var _0xcde2=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xde2c[_0x420b24];return _0x4da552;};'use strict';var multer=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var timeout=require(_0xcde2('0x3'));var express=require(_0xcde2('0x4'));var router=express[_0xcde2('0x5')]();var fs_extra=require(_0xcde2('0x6'));var auth=require(_0xcde2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcde2('0x8'));var controller=require(_0xcde2('0x9'));router[_0xcde2('0xa')]('/',auth[_0xcde2('0xb')](),controller[_0xcde2('0xc')]);router['get'](_0xcde2('0xd'),auth[_0xcde2('0xb')](),controller[_0xcde2('0xe')]);router['get']('/:id',auth[_0xcde2('0xb')](),controller[_0xcde2('0xf')]);router['get'](_0xcde2('0x10'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x11')]);router[_0xcde2('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xcde2('0x13'),_0xcde2('0x14')),controller[_0xcde2('0x15')]);router[_0xcde2('0x16')](_0xcde2('0x17'),auth[_0xcde2('0xb')](),controller['update']);router[_0xcde2('0x16')]('/:id/accept',auth[_0xcde2('0xb')](),controller['accept']);router['put'](_0xcde2('0x18'),auth[_0xcde2('0xb')](),controller[_0xcde2('0x19')]);router[_0xcde2('0x1a')](_0xcde2('0x17'),auth['isAuthenticated'](),controller[_0xcde2('0x1b')]);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 8eb2023..b4313d8 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 _0xc423=['beepall','roundrobin','sequelize','STRING','name','INTEGER','rrmemory'];(function(_0xd580f5,_0x12d8a8){var _0x3d8ca3=function(_0x165947){while(--_0x165947){_0xd580f5['push'](_0xd580f5['shift']());}};_0x3d8ca3(++_0x12d8a8);}(_0xc423,0xaa));var _0x3c42=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc423[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x3c42('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c42('0x1')],'unique':_0x3c42('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3c42('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3c42('0x4'),_0x3c42('0x5'),_0x3c42('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x195a=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x195a,0xf2));var _0xa195=function(_0x4a8574,_0x4fb66a){_0x4a8574=_0x4a8574-0x0;var _0x5cbf50=_0x195a[_0x4a8574];return _0x5cbf50;};'use strict';var Sequelize=require('sequelize');module[_0xa195('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa195('0x1')]},'timeout':{'type':Sequelize[_0xa195('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa195('0x3')](_0xa195('0x4'),_0xa195('0x5'),_0xa195('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa195('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4bb55b3..acb4a78 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 _0x089e=['includes','all','value','transaction','removeAgents','forEach','addAgents','omit','userFaxQueue:save','userFaxQueue:remove','getAgents','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','FaxQueue','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','role','autoAssociation','describe','UserFaxQueue','FaxQueueId','filter','User','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','updatedAt','getTeams','findOne','Team','ids','Agents','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','emit','removeTeams','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId'];(function(_0xac8b93,_0x5438c9){var _0x4c392d=function(_0x2e0859){while(--_0x2e0859){_0xac8b93['push'](_0xac8b93['shift']());}};_0x4c392d(++_0x5438c9);}(_0x089e,0x116));var _0xe089=function(_0x9df88c,_0x27669b){_0x9df88c=_0x9df88c-0x0;var _0x14add0=_0x089e[_0x9df88c];return _0x14add0;};'use strict';var emlformat=require(_0xe089('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe089('0x1'));var jsonpatch=require(_0xe089('0x2'));var rp=require(_0xe089('0x3'));var moment=require(_0xe089('0x4'));var BPromise=require(_0xe089('0x5'));var Mustache=require(_0xe089('0x6'));var util=require(_0xe089('0x7'));var path=require('path');var sox=require(_0xe089('0x8'));var csv=require(_0xe089('0x9'));var ejs=require(_0xe089('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe089('0xb'));var jsforce=require(_0xe089('0xc'));var deskjs=require(_0xe089('0xd'));var toCsv=require(_0xe089('0x9'));var querystring=require('querystring');var Papa=require(_0xe089('0xe'));var Redis=require(_0xe089('0xf'));var authService=require(_0xe089('0x10'));var qs=require(_0xe089('0x11'));var as=require(_0xe089('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe089('0x13'))('api');var utils=require(_0xe089('0x14'));var config=require(_0xe089('0x15'));var licenseUtil=require(_0xe089('0x16'));var db=require('../../mysqldb')['db'];config[_0xe089('0x17')]=_['defaults'](config[_0xe089('0x17')],{'host':_0xe089('0x18'),'port':0x18eb});var socket=require(_0xe089('0x19'))(new Redis(config[_0xe089('0x17')]));require(_0xe089('0x1a'))['register'](socket);function respondWithStatusCode(_0x38b7b1,_0x2ff5f2){_0x2ff5f2=_0x2ff5f2||0xcc;return function(_0x5c0bf1){if(_0x5c0bf1){return _0x38b7b1[_0xe089('0x1b')](_0x2ff5f2);}return _0x38b7b1['status'](_0x2ff5f2)[_0xe089('0x1c')]();};}function respondWithResult(_0x562861,_0x39c379){_0x39c379=_0x39c379||0xc8;return function(_0x1ef2ea){if(_0x1ef2ea){return _0x562861['status'](_0x39c379)[_0xe089('0x1d')](_0x1ef2ea);}};}function respondWithFilteredResult(_0xd6225c,_0x3a9e38){return function(_0xa40e1b){if(_0xa40e1b){var _0x38b07d=typeof _0x3a9e38[_0xe089('0x1e')]===_0xe089('0x1f')&&typeof _0x3a9e38[_0xe089('0x20')]===_0xe089('0x1f');var _0x29053a=_0xa40e1b['count'];var _0x550fa3=_0x38b07d?0x0:_0x3a9e38[_0xe089('0x1e')];var _0x87d266=_0x38b07d?_0xa40e1b[_0xe089('0x21')]:_0x3a9e38['offset']+_0x3a9e38[_0xe089('0x20')];var _0x13af41;if(_0x87d266>=_0x29053a){_0x87d266=_0x29053a;_0x13af41=0xc8;}else{_0x13af41=0xce;}_0xd6225c[_0xe089('0x22')](_0x13af41);return _0xd6225c[_0xe089('0x23')]('Content-Range',_0x550fa3+'-'+_0x87d266+'/'+_0x29053a)[_0xe089('0x1d')](_0xa40e1b);}return null;};}function patchUpdates(_0x56318d){return function(_0x265b38){try{jsonpatch['apply'](_0x265b38,_0x56318d,!![]);}catch(_0x322b36){return BPromise[_0xe089('0x24')](_0x322b36);}return _0x265b38['save']();};}function saveUpdates(_0x427f97,_0x41e0ce){return function(_0x1b6db9){if(_0x1b6db9){return _0x1b6db9[_0xe089('0x25')](_0x427f97)['then'](function(_0x486aa4){return _0x486aa4;});}return null;};}function removeEntity(_0x205f03,_0x46de0b){return function(_0x59028c){if(_0x59028c){return _0x59028c[_0xe089('0x26')]()[_0xe089('0x27')](function(){var _0x509905=_0x59028c[_0xe089('0x28')]({'plain':!![]});var _0x49d7a2=_0xe089('0x29');return db[_0xe089('0x2a')][_0xe089('0x26')]({'where':{'type':_0x49d7a2,'resourceId':_0x509905['id']}})[_0xe089('0x27')](function(){return _0x59028c;});})[_0xe089('0x27')](function(){_0x205f03[_0xe089('0x22')](0xcc)[_0xe089('0x1c')]();});}};}function handleEntityNotFound(_0x1b3d60,_0x111712){return function(_0x50bb66){if(!_0x50bb66){_0x1b3d60[_0xe089('0x1b')](0x194);}return _0x50bb66;};}function handleError(_0x870f07,_0x38f8ef){_0x38f8ef=_0x38f8ef||0x1f4;return function(_0x1f0d9a){logger[_0xe089('0x2b')](_0x1f0d9a[_0xe089('0x2c')]);if(_0x1f0d9a[_0xe089('0x2d')]){delete _0x1f0d9a['name'];}_0x870f07[_0xe089('0x22')](_0x38f8ef)[_0xe089('0x2e')](_0x1f0d9a);};}exports[_0xe089('0x2f')]=function(_0x333113,_0x4be886){var _0x436fa={},_0x12e80a={},_0x41cab6={'count':0x0,'rows':[]};var _0x2c988e=_[_0xe089('0x30')](db['FaxQueue'][_0xe089('0x31')],function(_0x53fa47){return{'name':_0x53fa47[_0xe089('0x32')],'type':_0x53fa47[_0xe089('0x33')][_0xe089('0x34')]};});_0x12e80a['model']=_[_0xe089('0x30')](_0x2c988e,_0xe089('0x2d'));_0x12e80a[_0xe089('0x35')]=_[_0xe089('0x36')](_0x333113['query']);_0x12e80a[_0xe089('0x37')]=_[_0xe089('0x38')](_0x12e80a['model'],_0x12e80a[_0xe089('0x35')]);_0x436fa[_0xe089('0x39')]=_[_0xe089('0x38')](_0x12e80a['model'],qs[_0xe089('0x3a')](_0x333113[_0xe089('0x35')][_0xe089('0x3a')]));_0x436fa[_0xe089('0x39')]=_0x436fa[_0xe089('0x39')]['length']?_0x436fa['attributes']:_0x12e80a[_0xe089('0x3b')];if(!_0x333113[_0xe089('0x35')][_0xe089('0x3c')]('nolimit')){_0x436fa[_0xe089('0x20')]=qs[_0xe089('0x20')](_0x333113[_0xe089('0x35')]['limit']);_0x436fa[_0xe089('0x1e')]=qs[_0xe089('0x1e')](_0x333113[_0xe089('0x35')][_0xe089('0x1e')]);}_0x436fa[_0xe089('0x3d')]=qs[_0xe089('0x3e')](_0x333113[_0xe089('0x35')][_0xe089('0x3e')]);_0x436fa[_0xe089('0x3f')]=qs[_0xe089('0x37')](_[_0xe089('0x40')](_0x333113['query'],_0x12e80a[_0xe089('0x37')]),_0x2c988e);if(_0x333113[_0xe089('0x35')]['filter']){_0x436fa[_0xe089('0x3f')]=_[_0xe089('0x41')](_0x436fa[_0xe089('0x3f')],{'$or':_[_0xe089('0x30')](_0x2c988e,function(_0x5291d1){if(_0x5291d1[_0xe089('0x33')]!==_0xe089('0x42')){var _0xe62ea1={};_0xe62ea1[_0x5291d1[_0xe089('0x2d')]]={'$like':'%'+_0x333113[_0xe089('0x35')]['filter']+'%'};return _0xe62ea1;}})});}_0x436fa=_[_0xe089('0x41')]({},_0x436fa,_0x333113[_0xe089('0x43')]);var _0x592f1c={'where':_0x436fa[_0xe089('0x3f')]};return db[_0xe089('0x44')][_0xe089('0x21')](_0x592f1c)[_0xe089('0x27')](function(_0xd96038){_0x41cab6['count']=_0xd96038;if(_0x333113[_0xe089('0x35')][_0xe089('0x45')]){_0x436fa['include']=[{'all':!![]}];}return db[_0xe089('0x44')][_0xe089('0x46')](_0x436fa);})[_0xe089('0x27')](function(_0x1d85ca){_0x41cab6[_0xe089('0x47')]=_0x1d85ca;return _0x41cab6;})['then'](respondWithFilteredResult(_0x4be886,_0x436fa))[_0xe089('0x48')](handleError(_0x4be886,null));};exports[_0xe089('0x49')]=function(_0xb89ddc,_0x444924){var _0xe89942={'raw':!![],'where':{'id':_0xb89ddc[_0xe089('0x4a')]['id']}},_0x46ec5a={};_0x46ec5a['model']=_[_0xe089('0x36')](db['FaxQueue'][_0xe089('0x31')]);_0x46ec5a['query']=_[_0xe089('0x36')](_0xb89ddc['query']);_0x46ec5a[_0xe089('0x37')]=_['intersection'](_0x46ec5a[_0xe089('0x3b')],_0x46ec5a[_0xe089('0x35')]);_0xe89942['attributes']=_[_0xe089('0x38')](_0x46ec5a[_0xe089('0x3b')],qs[_0xe089('0x3a')](_0xb89ddc[_0xe089('0x35')][_0xe089('0x3a')]));_0xe89942['attributes']=_0xe89942['attributes'][_0xe089('0x4b')]?_0xe89942[_0xe089('0x39')]:_0x46ec5a[_0xe089('0x3b')];if(_0xb89ddc['query'][_0xe089('0x45')]){_0xe89942[_0xe089('0x4c')]=[{'all':!![]}];}_0xe89942=_[_0xe089('0x41')]({},_0xe89942,_0xb89ddc[_0xe089('0x43')]);return db[_0xe089('0x44')][_0xe089('0x4d')](_0xe89942)[_0xe089('0x27')](handleEntityNotFound(_0x444924,null))[_0xe089('0x27')](respondWithResult(_0x444924,null))[_0xe089('0x48')](handleError(_0x444924,null));};exports['create']=function(_0x3a768a,_0x9a4e2d){return db[_0xe089('0x44')][_0xe089('0x4e')](_0x3a768a[_0xe089('0x4f')],{})['then'](function(_0x424262){var _0x57c5fd=_0x3a768a[_0xe089('0x50')][_0xe089('0x28')]({'plain':!![]});if(!_0x57c5fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57c5fd[_0xe089('0x51')]===_0xe089('0x50')){var _0x5a9863=_0x424262[_0xe089('0x28')]({'plain':!![]});var _0x8852ca=_0xe089('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x8852ca,'userProfileId':_0x57c5fd['userProfileId']},'raw':!![]})[_0xe089('0x27')](function(_0x42380b){if(_0x42380b&&_0x42380b[_0xe089('0x52')]===0x0){return db[_0xe089('0x2a')][_0xe089('0x4e')]({'name':_0x5a9863['name'],'resourceId':_0x5a9863['id'],'type':_0x42380b[_0xe089('0x2d')],'sectionId':_0x42380b['id']},{})[_0xe089('0x27')](function(){return _0x424262;});}else{return _0x424262;}})[_0xe089('0x48')](function(_0xbac995){logger[_0xe089('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbac995);throw _0xbac995;});}return _0x424262;})[_0xe089('0x27')](respondWithResult(_0x9a4e2d,0xc9))[_0xe089('0x48')](handleError(_0x9a4e2d,null));};exports[_0xe089('0x25')]=function(_0x37fd5a,_0x3d9468){if(_0x37fd5a[_0xe089('0x4f')]['id']){delete _0x37fd5a[_0xe089('0x4f')]['id'];}return db[_0xe089('0x44')][_0xe089('0x4d')]({'where':{'id':_0x37fd5a[_0xe089('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d9468,null))[_0xe089('0x27')](saveUpdates(_0x37fd5a['body'],null))[_0xe089('0x27')](respondWithResult(_0x3d9468,null))['catch'](handleError(_0x3d9468,null));};exports[_0xe089('0x26')]=function(_0x2c958d,_0x2556bd){return db['FaxQueue'][_0xe089('0x4d')]({'where':{'id':_0x2c958d['params']['id']}})[_0xe089('0x27')](handleEntityNotFound(_0x2556bd,null))['then'](removeEntity(_0x2556bd,null))[_0xe089('0x48')](handleError(_0x2556bd,null));};exports[_0xe089('0x53')]=function(_0x4d4f26,_0x2f2da2){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x2f2da2,null))[_0xe089('0x48')](handleError(_0x2f2da2,null));};exports['getMembers']=function(_0x2a0f62,_0x17bcb3,_0xd1be80){var _0x4a4deb={'raw':!![],'where':{}},_0x1d55bb={},_0x515f55;return db[_0xe089('0x44')]['findOne']({'where':{'id':_0x2a0f62[_0xe089('0x4a')]['id']}})[_0xe089('0x27')](handleEntityNotFound(_0x17bcb3,null))[_0xe089('0x27')](function(_0x2cdfa7){if(_0x2cdfa7){_0x515f55=_0x2cdfa7[_0xe089('0x28')]({'plain':!![]});_0x1d55bb['model']=_[_0xe089('0x36')](db[_0xe089('0x54')]['rawAttributes']);_0x1d55bb[_0xe089('0x35')]=_[_0xe089('0x36')](_0x2a0f62[_0xe089('0x35')]);_0x1d55bb[_0xe089('0x37')]=_[_0xe089('0x38')](_0x1d55bb[_0xe089('0x3b')],_0x1d55bb[_0xe089('0x35')]);_0x4a4deb[_0xe089('0x39')]=_[_0xe089('0x38')](_0x1d55bb[_0xe089('0x3b')],qs[_0xe089('0x3a')](_0x2a0f62[_0xe089('0x35')][_0xe089('0x3a')]));_0x4a4deb[_0xe089('0x39')]=_0x4a4deb[_0xe089('0x39')]['length']?_0x4a4deb[_0xe089('0x39')]:_0x1d55bb[_0xe089('0x3b')];if(!_0x2a0f62[_0xe089('0x35')][_0xe089('0x3c')]('nolimit')){_0x4a4deb['limit']=qs[_0xe089('0x20')](_0x2a0f62[_0xe089('0x35')][_0xe089('0x20')]);_0x4a4deb[_0xe089('0x1e')]=qs[_0xe089('0x1e')](_0x2a0f62[_0xe089('0x35')][_0xe089('0x1e')]);}_0x4a4deb[_0xe089('0x3d')]=qs['sort'](_0x2a0f62[_0xe089('0x35')][_0xe089('0x3e')]);_0x4a4deb[_0xe089('0x3f')]=qs['filters'](_[_0xe089('0x40')](_0x2a0f62[_0xe089('0x35')],_0x1d55bb[_0xe089('0x37')]));_0x4a4deb[_0xe089('0x3f')][_0xe089('0x55')]=_0x2cdfa7['id'];if(_0x2a0f62['query'][_0xe089('0x56')]){_0x4a4deb['where']=_[_0xe089('0x41')](_0x4a4deb[_0xe089('0x3f')],{'$or':_[_0xe089('0x30')](_0x4a4deb[_0xe089('0x39')],function(_0x2d65e7){var _0x2a50c6={};_0x2a50c6[_0x2d65e7]={'$like':'%'+_0x2a0f62[_0xe089('0x35')][_0xe089('0x56')]+'%'};return _0x2a50c6;})});}_0x4a4deb=_[_0xe089('0x41')]({},_0x4a4deb,_0x2a0f62['options']);return db['UserFaxQueue'][_0xe089('0x46')](_0x4a4deb);}})[_0xe089('0x27')](function(_0x1679aa){if(_0x1679aa){return db[_0xe089('0x57')][_0xe089('0x58')]({'where':{'id':_[_0xe089('0x30')](_0x1679aa,'UserId'),'role':_0xe089('0x59')},'attributes':['id',_0xe089('0x2d'),_0xe089('0x5a'),'updatedAt',_0xe089('0x5b')]});}})[_0xe089('0x27')](function(_0x1ccaeb){if(_0x1ccaeb){return{'count':_0x1ccaeb[_0xe089('0x21')],'rows':_[_0xe089('0x30')](_0x1ccaeb[_0xe089('0x47')],function(_0x44c921){return{'membername':_0x44c921[_0xe089('0x2d')],'UserId':_0x44c921['id'],'queue_name':_0x515f55[_0xe089('0x2d')],'FaxQueueId':_0x515f55['id'],'interface':util[_0xe089('0x5c')](_0xe089('0x5d'),'SIP',_0x44c921['name']),'penalty':0x0,'paused':_0x44c921['faxPause'],'createdAt':_0x44c921[_0xe089('0x5b')],'updatedAt':_0x44c921[_0xe089('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17bcb3,_0x4a4deb))[_0xe089('0x48')](handleError(_0x17bcb3,null));};exports[_0xe089('0x5f')]=function(_0x5b1ca6,_0x4cc9a4,_0x342fbc){var _0x4b2c74={};var _0x3a7481={};var _0x246add;var _0x28e6d3;return db[_0xe089('0x44')][_0xe089('0x60')]({'where':{'id':_0x5b1ca6['params']['id']}})[_0xe089('0x27')](handleEntityNotFound(_0x4cc9a4,null))[_0xe089('0x27')](function(_0x49703a){if(_0x49703a){_0x246add=_0x49703a;_0x3a7481['model']=_[_0xe089('0x36')](db[_0xe089('0x61')][_0xe089('0x31')]);_0x3a7481[_0xe089('0x35')]=_[_0xe089('0x36')](_0x5b1ca6[_0xe089('0x35')]);_0x3a7481[_0xe089('0x37')]=_[_0xe089('0x38')](_0x3a7481[_0xe089('0x3b')],_0x3a7481[_0xe089('0x35')]);_0x4b2c74[_0xe089('0x39')]=_[_0xe089('0x38')](_0x3a7481[_0xe089('0x3b')],qs['fields'](_0x5b1ca6[_0xe089('0x35')][_0xe089('0x3a')]));_0x4b2c74[_0xe089('0x39')]=_0x4b2c74['attributes'][_0xe089('0x4b')]?_0x4b2c74[_0xe089('0x39')]:_0x3a7481[_0xe089('0x3b')];_0x4b2c74[_0xe089('0x3d')]=qs[_0xe089('0x3e')](_0x5b1ca6['query']['sort']);_0x4b2c74[_0xe089('0x3f')]=qs[_0xe089('0x37')](_[_0xe089('0x40')](_0x5b1ca6[_0xe089('0x35')],_0x3a7481[_0xe089('0x37')]));if(_0x5b1ca6[_0xe089('0x35')][_0xe089('0x56')]){_0x4b2c74['where']=_[_0xe089('0x41')](_0x4b2c74[_0xe089('0x3f')],{'$or':_[_0xe089('0x30')](_0x4b2c74['attributes'],function(_0x597b88){var _0x5be2f4={};_0x5be2f4[_0x597b88]={'$like':'%'+_0x5b1ca6[_0xe089('0x35')][_0xe089('0x56')]+'%'};return _0x5be2f4;})});}_0x4b2c74=_[_0xe089('0x41')]({},_0x4b2c74,_0x5b1ca6[_0xe089('0x43')]);return _0x246add[_0xe089('0x5f')](_0x4b2c74);}})[_0xe089('0x27')](function(_0x59901c){if(_0x59901c){_0x28e6d3=_0x59901c['length'];if(!_0x5b1ca6[_0xe089('0x35')][_0xe089('0x3c')]('nolimit')){_0x4b2c74[_0xe089('0x20')]=qs[_0xe089('0x20')](_0x5b1ca6[_0xe089('0x35')][_0xe089('0x20')]);_0x4b2c74[_0xe089('0x1e')]=qs[_0xe089('0x1e')](_0x5b1ca6['query']['offset']);}return _0x246add[_0xe089('0x5f')](_0x4b2c74);}})[_0xe089('0x27')](function(_0x5896ec){if(_0x5896ec){return _0x5896ec?{'count':_0x28e6d3,'rows':_0x5896ec}:null;}})['then'](respondWithResult(_0x4cc9a4,null))[_0xe089('0x48')](handleError(_0x4cc9a4,null));};exports['addTeams']=function(_0x18fab5,_0x54c193,_0x88a6ae){var _0x10290d=_0x18fab5[_0xe089('0x4f')][_0xe089('0x62')];return db[_0xe089('0x61')][_0xe089('0x46')]({'where':{'id':_0x10290d},'attributes':['id'],'include':[{'model':db[_0xe089('0x57')],'as':_0xe089('0x63'),'attributes':['id',_0xe089('0x2d'),'online',_0xe089('0x64'),'interface'],'raw':!![]}]})[_0xe089('0x27')](function(_0x3be0b0){if(_0x3be0b0){var _0x1e055b=_[_0xe089('0x65')](_0x3be0b0,function(_0xab135b){var _0x4bc286=_0xab135b['get']({'plain':!![]});return _0x4bc286[_0xe089('0x63')];});return db['FaxQueue']['find']({'where':{'id':_0x18fab5[_0xe089('0x4a')]['id']}})[_0xe089('0x27')](function(_0x5d5809){return db[_0xe089('0x66')]['transaction'](function(_0x1054bb){return _0x5d5809[_0xe089('0x67')](_0x10290d,{'transaction':_0x1054bb})[_0xe089('0x27')](function(){return BPromise[_0xe089('0x68')](_0x1e055b,function(_0x357115){return db[_0xe089('0x54')][_0xe089('0x69')]({'where':{'UserId':_0x357115['id'],'FaxQueueId':_0x18fab5['params']['id']},'transaction':_0x1054bb});});})['then'](function(){_0x1e055b['forEach'](function(_0x4dcf3d){socket[_0xe089('0x6a')]('userFaxQueue:save',{'UserId':_0x4dcf3d['id'],'FaxQueueId':_0x5d5809['id']});});});});});}})['then'](respondWithStatusCode(_0x54c193,null))['catch'](handleError(_0x54c193,null));};exports[_0xe089('0x6b')]=function(_0x461df3,_0x2e931d,_0x1a9b48){return db[_0xe089('0x61')][_0xe089('0x46')]({'where':{'id':_0x461df3[_0xe089('0x35')][_0xe089('0x62')]},'attributes':['id'],'include':[{'model':db[_0xe089('0x57')],'as':_0xe089('0x63'),'attributes':['id'],'raw':!![]}]})[_0xe089('0x27')](handleEntityNotFound(_0x2e931d,null))[_0xe089('0x27')](function(_0x580de6){var _0x4b5335=_['map'](_0x580de6,'id');var _0xda87ee=[];var _0x5d1daf=[];var _0x1845ff=squel[_0xe089('0x6c')]();_0x1845ff['field'](_0xe089('0x6d'))['from'](_0xe089('0x6e'),'tq')[_0xe089('0x6f')](_0xe089('0x70'),'ut',_0xe089('0x71'))[_0xe089('0x3f')]('FaxQueueId\x20=\x20?',_0x461df3[_0xe089('0x4a')]['id']);for(var _0x12e841=0x0;_0x12e841<_0x580de6[_0xe089('0x4b')];_0x12e841+=0x1){let _0x4adcc0=_0x580de6[_0x12e841];for(var _0x4da2c3=0x0;_0x4da2c3<_0x4adcc0[_0xe089('0x63')][_0xe089('0x4b')];_0x4da2c3+=0x1){let _0x462fb0=_0x4adcc0['Agents'][_0x4da2c3];var _0x4c76c8=_0x1845ff[_0xe089('0x72')]();_0x4c76c8[_0xe089('0x3f')]('ut.UserId\x20=\x20?',_0x462fb0['id']);_0x5d1daf[_0xe089('0x73')](db[_0xe089('0x66')][_0xe089('0x35')](_0x4c76c8[_0xe089('0x74')](),{'type':db['sequelize'][_0xe089('0x75')][_0xe089('0x76')]})[_0xe089('0x27')](function(_0x15ee7a){if(_0x15ee7a[_0xe089('0x4b')]===0x1){return _0x462fb0['id'];}else{var _0xa9b8a8=_[_0xe089('0x77')](_[_0xe089('0x30')](_0x15ee7a,_0xe089('0x78')),function(_0x41895d){return _[_0xe089('0x79')](_0x4b5335,_0x41895d);});if(_0xa9b8a8){return _0x462fb0['id'];}}}));}}return BPromise[_0xe089('0x7a')](_0x5d1daf)[_0xe089('0x27')](function(_0x39a95f){_0xda87ee=_(_0xda87ee)['union'](_0x39a95f)['compact']()[_0xe089('0x7b')]();return db[_0xe089('0x44')][_0xe089('0x4d')]({'where':{'id':_0x461df3[_0xe089('0x4a')]['id']}})['then'](function(_0x3119d1){return db[_0xe089('0x66')][_0xe089('0x7c')](function(_0x1ff0b0){return _0x3119d1[_0xe089('0x6b')](_0x461df3[_0xe089('0x35')]['ids'],{'transaction':_0x1ff0b0})['then'](function(){if(!_['isEmpty'](_0xda87ee)){return _0x3119d1[_0xe089('0x7d')](_0xda87ee,{'transaction':_0x1ff0b0});}})[_0xe089('0x27')](function(){_0xda87ee[_0xe089('0x7e')](function(_0x342baf){socket[_0xe089('0x6a')]('userFaxQueue:remove',{'UserId':_0x342baf,'FaxQueueId':_0x3119d1['id']});});});});});});})[_0xe089('0x27')](respondWithStatusCode(_0x2e931d,null))[_0xe089('0x48')](handleError(_0x2e931d,null));};exports[_0xe089('0x7f')]=function(_0x173ed5,_0xab1420,_0x5bfb0e){return db['FaxQueue'][_0xe089('0x4d')]({'where':{'id':_0x173ed5['params']['id']}})[_0xe089('0x27')](handleEntityNotFound(_0xab1420,null))['then'](function(_0x4d65a3){if(_0x4d65a3){return _0x4d65a3['addAgents'](_0x173ed5[_0xe089('0x4f')][_0xe089('0x62')],_[_0xe089('0x80')](_0x173ed5[_0xe089('0x4f')],[_0xe089('0x62'),'id'])||{})['spread'](function(_0x499bc4){for(var _0x1e7d5c=0x0;_0x1e7d5c<_0x173ed5[_0xe089('0x4f')][_0xe089('0x62')][_0xe089('0x4b')];_0x1e7d5c+=0x1){socket[_0xe089('0x6a')](_0xe089('0x81'),{'UserId':Number(_0x173ed5['body'][_0xe089('0x62')][_0x1e7d5c]),'FaxQueueId':Number(_0x173ed5[_0xe089('0x4a')]['id'])});}return _0x499bc4;});}})[_0xe089('0x27')](respondWithResult(_0xab1420,null))[_0xe089('0x48')](handleError(_0xab1420,null));};exports[_0xe089('0x7d')]=function(_0x4b4ef4,_0x4f395d,_0x3a9996){return db[_0xe089('0x44')]['find']({'where':{'id':_0x4b4ef4['params']['id']}})[_0xe089('0x27')](handleEntityNotFound(_0x4f395d,null))['then'](function(_0x53d760){if(_0x53d760){return _0x53d760[_0xe089('0x7d')](_0x4b4ef4[_0xe089('0x35')]['ids'])['then'](function(){if(_['isArray'](_0x4b4ef4[_0xe089('0x35')][_0xe089('0x62')])){for(var _0x11c1c7=0x0;_0x11c1c7<_0x4b4ef4['query'][_0xe089('0x62')][_0xe089('0x4b')];_0x11c1c7+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x4b4ef4['query'][_0xe089('0x62')][_0x11c1c7]),'FaxQueueId':Number(_0x4b4ef4[_0xe089('0x4a')]['id'])});}}else{socket['emit'](_0xe089('0x82'),{'UserId':Number(_0x4b4ef4[_0xe089('0x35')][_0xe089('0x62')]),'FaxQueueId':Number(_0x4b4ef4[_0xe089('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f395d,null))[_0xe089('0x48')](handleError(_0x4f395d,null));};exports[_0xe089('0x83')]=function(_0x5e938b,_0x15ee7c,_0x4d230c){var _0xccdc97={};var _0x3a149d={};var _0x4999a3;var _0x12ce78;return db[_0xe089('0x44')]['findOne']({'where':{'id':_0x5e938b['params']['id']}})[_0xe089('0x27')](handleEntityNotFound(_0x15ee7c,null))['then'](function(_0x44a3a7){if(_0x44a3a7){_0x4999a3=_0x44a3a7;_0x3a149d[_0xe089('0x3b')]=_[_0xe089('0x36')](db['User'][_0xe089('0x31')]);_0x3a149d[_0xe089('0x35')]=_[_0xe089('0x36')](_0x5e938b[_0xe089('0x35')]);_0x3a149d[_0xe089('0x37')]=_[_0xe089('0x38')](_0x3a149d[_0xe089('0x3b')],_0x3a149d[_0xe089('0x35')]);_0xccdc97[_0xe089('0x39')]=_[_0xe089('0x38')](_0x3a149d[_0xe089('0x3b')],qs[_0xe089('0x3a')](_0x5e938b[_0xe089('0x35')][_0xe089('0x3a')]));_0xccdc97['attributes']=_0xccdc97[_0xe089('0x39')][_0xe089('0x4b')]?_0xccdc97[_0xe089('0x39')]:_0x3a149d[_0xe089('0x3b')];_0xccdc97[_0xe089('0x3d')]=qs[_0xe089('0x3e')](_0x5e938b[_0xe089('0x35')]['sort']);_0xccdc97['where']=qs[_0xe089('0x37')](_[_0xe089('0x40')](_0x5e938b[_0xe089('0x35')],_0x3a149d[_0xe089('0x37')]));if(_0x5e938b[_0xe089('0x35')][_0xe089('0x56')]){_0xccdc97[_0xe089('0x3f')]=_[_0xe089('0x41')](_0xccdc97[_0xe089('0x3f')],{'$or':_['map'](_0xccdc97['attributes'],function(_0x2bb80e){var _0x1a997c={};_0x1a997c[_0x2bb80e]={'$like':'%'+_0x5e938b[_0xe089('0x35')][_0xe089('0x56')]+'%'};return _0x1a997c;})});}_0xccdc97=_[_0xe089('0x41')]({},_0xccdc97,_0x5e938b[_0xe089('0x43')]);return _0x4999a3[_0xe089('0x83')](_0xccdc97);}})[_0xe089('0x27')](function(_0xcc65a8){if(_0xcc65a8){_0x12ce78=_0xcc65a8[_0xe089('0x4b')];if(!_0x5e938b[_0xe089('0x35')][_0xe089('0x3c')](_0xe089('0x84'))){_0xccdc97[_0xe089('0x20')]=qs[_0xe089('0x20')](_0x5e938b[_0xe089('0x35')]['limit']);_0xccdc97[_0xe089('0x1e')]=qs[_0xe089('0x1e')](_0x5e938b['query'][_0xe089('0x1e')]);}return _0x4999a3[_0xe089('0x83')](_0xccdc97);}})[_0xe089('0x27')](function(_0x533e01){if(_0x533e01){return _0x533e01?{'count':_0x12ce78,'rows':_0x533e01}:null;}})['then'](respondWithResult(_0x15ee7c,null))[_0xe089('0x48')](handleError(_0x15ee7c,null));}; \ No newline at end of file +var _0xf484=['isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','filter','merge','FaxQueue','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','hasOwnProperty','findAll','User','UserId','faxPause','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','UserFaxQueue','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','value','removeTeams','removeAgents','addAgents','omit'];(function(_0x1dbe31,_0x54c4ca){var _0x3ec4b1=function(_0x5c2aeb){while(--_0x5c2aeb){_0x1dbe31['push'](_0x1dbe31['shift']());}};_0x3ec4b1(++_0x54c4ca);}(_0xf484,0x8f));var _0x4f48=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf484[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x4f48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f48('0x1'));var jsonpatch=require(_0x4f48('0x2'));var rp=require(_0x4f48('0x3'));var moment=require(_0x4f48('0x4'));var BPromise=require(_0x4f48('0x5'));var Mustache=require('mustache');var util=require(_0x4f48('0x6'));var path=require(_0x4f48('0x7'));var sox=require(_0x4f48('0x8'));var csv=require(_0x4f48('0x9'));var ejs=require(_0x4f48('0xa'));var fs=require('fs');var fs_extra=require(_0x4f48('0xb'));var _=require(_0x4f48('0xc'));var squel=require(_0x4f48('0xd'));var crypto=require(_0x4f48('0xe'));var jsforce=require(_0x4f48('0xf'));var deskjs=require(_0x4f48('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4f48('0x11'));var Papa=require(_0x4f48('0x12'));var Redis=require(_0x4f48('0x13'));var authService=require(_0x4f48('0x14'));var qs=require(_0x4f48('0x15'));var as=require(_0x4f48('0x16'));var hardwareService=require(_0x4f48('0x17'));var logger=require(_0x4f48('0x18'))(_0x4f48('0x19'));var utils=require('../../config/utils');var config=require(_0x4f48('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f48('0x1b'))['db'];config[_0x4f48('0x1c')]=_[_0x4f48('0x1d')](config['redis'],{'host':_0x4f48('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f48('0x1c')]));require(_0x4f48('0x1f'))['register'](socket);function respondWithStatusCode(_0xe08a1a,_0x38d81b){_0x38d81b=_0x38d81b||0xcc;return function(_0xee7455){if(_0xee7455){return _0xe08a1a['sendStatus'](_0x38d81b);}return _0xe08a1a[_0x4f48('0x20')](_0x38d81b)['end']();};}function respondWithResult(_0x589e53,_0x2c7d5e){_0x2c7d5e=_0x2c7d5e||0xc8;return function(_0x399ff7){if(_0x399ff7){return _0x589e53['status'](_0x2c7d5e)[_0x4f48('0x21')](_0x399ff7);}};}function respondWithFilteredResult(_0x31cf6f,_0x28be3f){return function(_0x27052a){if(_0x27052a){var _0x5682a4=typeof _0x28be3f['offset']===_0x4f48('0x22')&&typeof _0x28be3f[_0x4f48('0x23')]===_0x4f48('0x22');var _0x294c81=_0x27052a[_0x4f48('0x24')];var _0x425113=_0x5682a4?0x0:_0x28be3f[_0x4f48('0x25')];var _0x5e0c30=_0x5682a4?_0x27052a['count']:_0x28be3f[_0x4f48('0x25')]+_0x28be3f['limit'];var _0x17eae4;if(_0x5e0c30>=_0x294c81){_0x5e0c30=_0x294c81;_0x17eae4=0xc8;}else{_0x17eae4=0xce;}_0x31cf6f[_0x4f48('0x20')](_0x17eae4);return _0x31cf6f[_0x4f48('0x26')](_0x4f48('0x27'),_0x425113+'-'+_0x5e0c30+'/'+_0x294c81)[_0x4f48('0x21')](_0x27052a);}return null;};}function patchUpdates(_0x554ac7){return function(_0x2a6270){try{jsonpatch[_0x4f48('0x28')](_0x2a6270,_0x554ac7,!![]);}catch(_0x523c8d){return BPromise[_0x4f48('0x29')](_0x523c8d);}return _0x2a6270[_0x4f48('0x2a')]();};}function saveUpdates(_0x29f541,_0x4f851a){return function(_0x136e84){if(_0x136e84){return _0x136e84[_0x4f48('0x2b')](_0x29f541)['then'](function(_0x334413){return _0x334413;});}return null;};}function removeEntity(_0x22f1a0,_0x3660f4){return function(_0x4d03ed){if(_0x4d03ed){return _0x4d03ed[_0x4f48('0x2c')]()['then'](function(){var _0x14f37e=_0x4d03ed[_0x4f48('0x2d')]({'plain':!![]});var _0x5af9d7='FaxQueues';return db[_0x4f48('0x2e')][_0x4f48('0x2c')]({'where':{'type':_0x5af9d7,'resourceId':_0x14f37e['id']}})[_0x4f48('0x2f')](function(){return _0x4d03ed;});})[_0x4f48('0x2f')](function(){_0x22f1a0[_0x4f48('0x20')](0xcc)[_0x4f48('0x30')]();});}};}function handleEntityNotFound(_0x1b7592,_0x24eebc){return function(_0x48144c){if(!_0x48144c){_0x1b7592['sendStatus'](0x194);}return _0x48144c;};}function handleError(_0x5aeb34,_0x21674c){_0x21674c=_0x21674c||0x1f4;return function(_0x431034){logger['error'](_0x431034[_0x4f48('0x31')]);if(_0x431034[_0x4f48('0x32')]){delete _0x431034[_0x4f48('0x32')];}_0x5aeb34['status'](_0x21674c)[_0x4f48('0x33')](_0x431034);};}exports[_0x4f48('0x34')]=function(_0x3a3162,_0x432e8a){var _0x3452dd={},_0x4a0ec1={},_0xbfab32={'count':0x0,'rows':[]};var _0x304664=_['map'](db['FaxQueue'][_0x4f48('0x35')],function(_0x6ea16d){return{'name':_0x6ea16d[_0x4f48('0x36')],'type':_0x6ea16d[_0x4f48('0x37')][_0x4f48('0x38')]};});_0x4a0ec1[_0x4f48('0x39')]=_[_0x4f48('0x3a')](_0x304664,_0x4f48('0x32'));_0x4a0ec1[_0x4f48('0x3b')]=_[_0x4f48('0x3c')](_0x3a3162[_0x4f48('0x3b')]);_0x4a0ec1['filters']=_[_0x4f48('0x3d')](_0x4a0ec1[_0x4f48('0x39')],_0x4a0ec1['query']);_0x3452dd['attributes']=_[_0x4f48('0x3d')](_0x4a0ec1['model'],qs['fields'](_0x3a3162[_0x4f48('0x3b')][_0x4f48('0x3e')]));_0x3452dd[_0x4f48('0x3f')]=_0x3452dd['attributes'][_0x4f48('0x40')]?_0x3452dd['attributes']:_0x4a0ec1['model'];if(!_0x3a3162[_0x4f48('0x3b')]['hasOwnProperty'](_0x4f48('0x41'))){_0x3452dd['limit']=qs[_0x4f48('0x23')](_0x3a3162[_0x4f48('0x3b')][_0x4f48('0x23')]);_0x3452dd[_0x4f48('0x25')]=qs[_0x4f48('0x25')](_0x3a3162[_0x4f48('0x3b')]['offset']);}_0x3452dd[_0x4f48('0x42')]=qs[_0x4f48('0x43')](_0x3a3162[_0x4f48('0x3b')][_0x4f48('0x43')]);_0x3452dd['where']=qs[_0x4f48('0x44')](_[_0x4f48('0x45')](_0x3a3162[_0x4f48('0x3b')],_0x4a0ec1[_0x4f48('0x44')]),_0x304664);if(_0x3a3162[_0x4f48('0x3b')]['filter']){_0x3452dd[_0x4f48('0x46')]=_['merge'](_0x3452dd['where'],{'$or':_[_0x4f48('0x3a')](_0x304664,function(_0x11f713){if(_0x11f713[_0x4f48('0x37')]!=='VIRTUAL'){var _0x2065a2={};_0x2065a2[_0x11f713[_0x4f48('0x32')]]={'$like':'%'+_0x3a3162[_0x4f48('0x3b')][_0x4f48('0x47')]+'%'};return _0x2065a2;}})});}_0x3452dd=_[_0x4f48('0x48')]({},_0x3452dd,_0x3a3162['options']);var _0x47445a={'where':_0x3452dd[_0x4f48('0x46')]};return db[_0x4f48('0x49')][_0x4f48('0x24')](_0x47445a)[_0x4f48('0x2f')](function(_0x1af773){_0xbfab32[_0x4f48('0x24')]=_0x1af773;if(_0x3a3162[_0x4f48('0x3b')][_0x4f48('0x4a')]){_0x3452dd[_0x4f48('0x4b')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x3452dd);})[_0x4f48('0x2f')](function(_0x245f28){_0xbfab32[_0x4f48('0x4c')]=_0x245f28;return _0xbfab32;})[_0x4f48('0x2f')](respondWithFilteredResult(_0x432e8a,_0x3452dd))[_0x4f48('0x4d')](handleError(_0x432e8a,null));};exports[_0x4f48('0x4e')]=function(_0x36a1f3,_0x314461){var _0x14c42c={'raw':!![],'where':{'id':_0x36a1f3[_0x4f48('0x4f')]['id']}},_0x30a48f={};_0x30a48f[_0x4f48('0x39')]=_[_0x4f48('0x3c')](db[_0x4f48('0x49')]['rawAttributes']);_0x30a48f['query']=_['keys'](_0x36a1f3[_0x4f48('0x3b')]);_0x30a48f[_0x4f48('0x44')]=_[_0x4f48('0x3d')](_0x30a48f['model'],_0x30a48f[_0x4f48('0x3b')]);_0x14c42c[_0x4f48('0x3f')]=_[_0x4f48('0x3d')](_0x30a48f[_0x4f48('0x39')],qs[_0x4f48('0x3e')](_0x36a1f3[_0x4f48('0x3b')][_0x4f48('0x3e')]));_0x14c42c[_0x4f48('0x3f')]=_0x14c42c[_0x4f48('0x3f')]['length']?_0x14c42c[_0x4f48('0x3f')]:_0x30a48f[_0x4f48('0x39')];if(_0x36a1f3[_0x4f48('0x3b')][_0x4f48('0x4a')]){_0x14c42c[_0x4f48('0x4b')]=[{'all':!![]}];}_0x14c42c=_[_0x4f48('0x48')]({},_0x14c42c,_0x36a1f3[_0x4f48('0x50')]);return db[_0x4f48('0x49')][_0x4f48('0x51')](_0x14c42c)['then'](handleEntityNotFound(_0x314461,null))[_0x4f48('0x2f')](respondWithResult(_0x314461,null))[_0x4f48('0x4d')](handleError(_0x314461,null));};exports[_0x4f48('0x52')]=function(_0x44d88b,_0x44fc3e){return db['FaxQueue'][_0x4f48('0x52')](_0x44d88b[_0x4f48('0x53')],{})[_0x4f48('0x2f')](function(_0x214605){var _0x4240bf=_0x44d88b[_0x4f48('0x54')][_0x4f48('0x2d')]({'plain':!![]});if(!_0x4240bf)throw new Error(_0x4f48('0x55'));if(_0x4240bf['role']===_0x4f48('0x54')){var _0xd64aab=_0x214605['get']({'plain':!![]});var _0x18d063=_0x4f48('0x56');return db['UserProfileSection'][_0x4f48('0x51')]({'where':{'name':_0x18d063,'userProfileId':_0x4240bf[_0x4f48('0x57')]},'raw':!![]})['then'](function(_0x446b23){if(_0x446b23&&_0x446b23[_0x4f48('0x58')]===0x0){return db[_0x4f48('0x2e')][_0x4f48('0x52')]({'name':_0xd64aab[_0x4f48('0x32')],'resourceId':_0xd64aab['id'],'type':_0x446b23[_0x4f48('0x32')],'sectionId':_0x446b23['id']},{})['then'](function(){return _0x214605;});}else{return _0x214605;}})['catch'](function(_0x532be9){logger[_0x4f48('0x59')](_0x4f48('0x5a'),_0x532be9);throw _0x532be9;});}return _0x214605;})[_0x4f48('0x2f')](respondWithResult(_0x44fc3e,0xc9))[_0x4f48('0x4d')](handleError(_0x44fc3e,null));};exports[_0x4f48('0x2b')]=function(_0x2f528c,_0xd80f01){if(_0x2f528c[_0x4f48('0x53')]['id']){delete _0x2f528c[_0x4f48('0x53')]['id'];}return db[_0x4f48('0x49')][_0x4f48('0x51')]({'where':{'id':_0x2f528c[_0x4f48('0x4f')]['id']}})[_0x4f48('0x2f')](handleEntityNotFound(_0xd80f01,null))[_0x4f48('0x2f')](saveUpdates(_0x2f528c[_0x4f48('0x53')],null))[_0x4f48('0x2f')](respondWithResult(_0xd80f01,null))[_0x4f48('0x4d')](handleError(_0xd80f01,null));};exports['destroy']=function(_0x549492,_0x38b38d){return db[_0x4f48('0x49')][_0x4f48('0x51')]({'where':{'id':_0x549492[_0x4f48('0x4f')]['id']}})['then'](handleEntityNotFound(_0x38b38d,null))['then'](removeEntity(_0x38b38d,null))['catch'](handleError(_0x38b38d,null));};exports[_0x4f48('0x5b')]=function(_0x2a7420,_0x1a3dec){return db[_0x4f48('0x49')][_0x4f48('0x5b')]()[_0x4f48('0x2f')](respondWithResult(_0x1a3dec,null))[_0x4f48('0x4d')](handleError(_0x1a3dec,null));};exports['getMembers']=function(_0x4326bb,_0xba3b33,_0x1058ba){var _0x28520f={'raw':!![],'where':{}},_0x1bffa3={},_0x521048;return db[_0x4f48('0x49')]['findOne']({'where':{'id':_0x4326bb[_0x4f48('0x4f')]['id']}})[_0x4f48('0x2f')](handleEntityNotFound(_0xba3b33,null))[_0x4f48('0x2f')](function(_0xdd77e1){if(_0xdd77e1){_0x521048=_0xdd77e1['get']({'plain':!![]});_0x1bffa3[_0x4f48('0x39')]=_['keys'](db['UserFaxQueue'][_0x4f48('0x35')]);_0x1bffa3[_0x4f48('0x3b')]=_['keys'](_0x4326bb[_0x4f48('0x3b')]);_0x1bffa3[_0x4f48('0x44')]=_[_0x4f48('0x3d')](_0x1bffa3[_0x4f48('0x39')],_0x1bffa3[_0x4f48('0x3b')]);_0x28520f[_0x4f48('0x3f')]=_[_0x4f48('0x3d')](_0x1bffa3[_0x4f48('0x39')],qs[_0x4f48('0x3e')](_0x4326bb[_0x4f48('0x3b')]['fields']));_0x28520f[_0x4f48('0x3f')]=_0x28520f['attributes'][_0x4f48('0x40')]?_0x28520f['attributes']:_0x1bffa3[_0x4f48('0x39')];if(!_0x4326bb[_0x4f48('0x3b')][_0x4f48('0x5c')](_0x4f48('0x41'))){_0x28520f[_0x4f48('0x23')]=qs[_0x4f48('0x23')](_0x4326bb[_0x4f48('0x3b')]['limit']);_0x28520f['offset']=qs[_0x4f48('0x25')](_0x4326bb[_0x4f48('0x3b')][_0x4f48('0x25')]);}_0x28520f[_0x4f48('0x42')]=qs['sort'](_0x4326bb[_0x4f48('0x3b')][_0x4f48('0x43')]);_0x28520f[_0x4f48('0x46')]=qs[_0x4f48('0x44')](_['pick'](_0x4326bb[_0x4f48('0x3b')],_0x1bffa3[_0x4f48('0x44')]));_0x28520f[_0x4f48('0x46')]['FaxQueueId']=_0xdd77e1['id'];if(_0x4326bb['query'][_0x4f48('0x47')]){_0x28520f[_0x4f48('0x46')]=_['merge'](_0x28520f[_0x4f48('0x46')],{'$or':_[_0x4f48('0x3a')](_0x28520f[_0x4f48('0x3f')],function(_0x4297ea){var _0x17b493={};_0x17b493[_0x4297ea]={'$like':'%'+_0x4326bb[_0x4f48('0x3b')][_0x4f48('0x47')]+'%'};return _0x17b493;})});}_0x28520f=_[_0x4f48('0x48')]({},_0x28520f,_0x4326bb[_0x4f48('0x50')]);return db['UserFaxQueue'][_0x4f48('0x5d')](_0x28520f);}})[_0x4f48('0x2f')](function(_0x6c1323){if(_0x6c1323){return db[_0x4f48('0x5e')]['findAndCountAll']({'where':{'id':_[_0x4f48('0x3a')](_0x6c1323,_0x4f48('0x5f')),'role':'agent'},'attributes':['id',_0x4f48('0x32'),_0x4f48('0x60'),'updatedAt','createdAt']});}})[_0x4f48('0x2f')](function(_0x3891ea){if(_0x3891ea){return{'count':_0x3891ea[_0x4f48('0x24')],'rows':_[_0x4f48('0x3a')](_0x3891ea['rows'],function(_0xd6a807){return{'membername':_0xd6a807[_0x4f48('0x32')],'UserId':_0xd6a807['id'],'queue_name':_0x521048['name'],'FaxQueueId':_0x521048['id'],'interface':util[_0x4f48('0x61')](_0x4f48('0x62'),_0x4f48('0x63'),_0xd6a807[_0x4f48('0x32')]),'penalty':0x0,'paused':_0xd6a807[_0x4f48('0x60')],'createdAt':_0xd6a807['createdAt'],'updatedAt':_0xd6a807[_0x4f48('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4f48('0x2f')](respondWithFilteredResult(_0xba3b33,_0x28520f))[_0x4f48('0x4d')](handleError(_0xba3b33,null));};exports[_0x4f48('0x65')]=function(_0x142935,_0x4d9852,_0x1347e6){var _0x4dc2d4={};var _0x2e3868={};var _0x1d9635;var _0x100261;return db[_0x4f48('0x49')][_0x4f48('0x66')]({'where':{'id':_0x142935[_0x4f48('0x4f')]['id']}})[_0x4f48('0x2f')](handleEntityNotFound(_0x4d9852,null))[_0x4f48('0x2f')](function(_0x569216){if(_0x569216){_0x1d9635=_0x569216;_0x2e3868[_0x4f48('0x39')]=_[_0x4f48('0x3c')](db[_0x4f48('0x67')][_0x4f48('0x35')]);_0x2e3868['query']=_[_0x4f48('0x3c')](_0x142935[_0x4f48('0x3b')]);_0x2e3868[_0x4f48('0x44')]=_[_0x4f48('0x3d')](_0x2e3868[_0x4f48('0x39')],_0x2e3868[_0x4f48('0x3b')]);_0x4dc2d4[_0x4f48('0x3f')]=_[_0x4f48('0x3d')](_0x2e3868[_0x4f48('0x39')],qs[_0x4f48('0x3e')](_0x142935[_0x4f48('0x3b')][_0x4f48('0x3e')]));_0x4dc2d4[_0x4f48('0x3f')]=_0x4dc2d4[_0x4f48('0x3f')]['length']?_0x4dc2d4[_0x4f48('0x3f')]:_0x2e3868[_0x4f48('0x39')];_0x4dc2d4[_0x4f48('0x42')]=qs['sort'](_0x142935[_0x4f48('0x3b')][_0x4f48('0x43')]);_0x4dc2d4['where']=qs['filters'](_[_0x4f48('0x45')](_0x142935[_0x4f48('0x3b')],_0x2e3868[_0x4f48('0x44')]));if(_0x142935['query'][_0x4f48('0x47')]){_0x4dc2d4[_0x4f48('0x46')]=_['merge'](_0x4dc2d4['where'],{'$or':_[_0x4f48('0x3a')](_0x4dc2d4[_0x4f48('0x3f')],function(_0x352ca6){var _0x50e20c={};_0x50e20c[_0x352ca6]={'$like':'%'+_0x142935[_0x4f48('0x3b')][_0x4f48('0x47')]+'%'};return _0x50e20c;})});}_0x4dc2d4=_[_0x4f48('0x48')]({},_0x4dc2d4,_0x142935[_0x4f48('0x50')]);return _0x1d9635[_0x4f48('0x65')](_0x4dc2d4);}})[_0x4f48('0x2f')](function(_0x19074d){if(_0x19074d){_0x100261=_0x19074d['length'];if(!_0x142935[_0x4f48('0x3b')][_0x4f48('0x5c')](_0x4f48('0x41'))){_0x4dc2d4['limit']=qs[_0x4f48('0x23')](_0x142935[_0x4f48('0x3b')][_0x4f48('0x23')]);_0x4dc2d4[_0x4f48('0x25')]=qs[_0x4f48('0x25')](_0x142935['query'][_0x4f48('0x25')]);}return _0x1d9635['getTeams'](_0x4dc2d4);}})[_0x4f48('0x2f')](function(_0x5440fd){if(_0x5440fd){return _0x5440fd?{'count':_0x100261,'rows':_0x5440fd}:null;}})[_0x4f48('0x2f')](respondWithResult(_0x4d9852,null))[_0x4f48('0x4d')](handleError(_0x4d9852,null));};exports['addTeams']=function(_0x4f2dfc,_0x3f7ae3,_0x58d776){var _0x82692e=_0x4f2dfc['body'][_0x4f48('0x68')];return db[_0x4f48('0x67')][_0x4f48('0x5d')]({'where':{'id':_0x82692e},'attributes':['id'],'include':[{'model':db[_0x4f48('0x5e')],'as':_0x4f48('0x69'),'attributes':['id',_0x4f48('0x32'),_0x4f48('0x6a'),_0x4f48('0x6b'),_0x4f48('0x6c')],'raw':!![]}]})['then'](function(_0x5121b7){if(_0x5121b7){var _0x23ae35=_[_0x4f48('0x6d')](_0x5121b7,function(_0x393218){var _0x6d1973=_0x393218[_0x4f48('0x2d')]({'plain':!![]});return _0x6d1973[_0x4f48('0x69')];});return db[_0x4f48('0x49')]['find']({'where':{'id':_0x4f2dfc[_0x4f48('0x4f')]['id']}})[_0x4f48('0x2f')](function(_0x58e0ea){return db[_0x4f48('0x6e')][_0x4f48('0x6f')](function(_0x2d9960){return _0x58e0ea[_0x4f48('0x70')](_0x82692e,{'transaction':_0x2d9960})[_0x4f48('0x2f')](function(){return BPromise[_0x4f48('0x71')](_0x23ae35,function(_0x12564d){return db[_0x4f48('0x72')][_0x4f48('0x73')]({'where':{'UserId':_0x12564d['id'],'FaxQueueId':_0x4f2dfc['params']['id']},'transaction':_0x2d9960});});})[_0x4f48('0x2f')](function(){_0x23ae35[_0x4f48('0x74')](function(_0x3f37cf){socket[_0x4f48('0x75')](_0x4f48('0x76'),{'UserId':_0x3f37cf['id'],'FaxQueueId':_0x58e0ea['id']});});});});});}})[_0x4f48('0x2f')](respondWithStatusCode(_0x3f7ae3,null))[_0x4f48('0x4d')](handleError(_0x3f7ae3,null));};exports['removeTeams']=function(_0x2950e4,_0x4fbe67,_0x1b867b){return db[_0x4f48('0x67')]['findAll']({'where':{'id':_0x2950e4['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4f48('0x5e')],'as':_0x4f48('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4f48('0x2f')](handleEntityNotFound(_0x4fbe67,null))[_0x4f48('0x2f')](function(_0x58320d){var _0x1896e1=_[_0x4f48('0x3a')](_0x58320d,'id');var _0x53f9fa=[];var _0x222e14=[];var _0x28f55e=squel[_0x4f48('0x77')]();_0x28f55e[_0x4f48('0x78')](_0x4f48('0x79'))['from']('team_has_fax_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4f48('0x7a'),_0x2950e4['params']['id']);for(var _0x5edacb=0x0;_0x5edacb<_0x58320d[_0x4f48('0x40')];_0x5edacb+=0x1){let _0xa94ef0=_0x58320d[_0x5edacb];for(var _0x1a7855=0x0;_0x1a7855<_0xa94ef0[_0x4f48('0x69')][_0x4f48('0x40')];_0x1a7855+=0x1){let _0x5bcffa=_0xa94ef0[_0x4f48('0x69')][_0x1a7855];var _0x30684c=_0x28f55e[_0x4f48('0x7b')]();_0x30684c[_0x4f48('0x46')](_0x4f48('0x7c'),_0x5bcffa['id']);_0x222e14['push'](db[_0x4f48('0x6e')][_0x4f48('0x3b')](_0x30684c[_0x4f48('0x7d')](),{'type':db[_0x4f48('0x6e')][_0x4f48('0x7e')][_0x4f48('0x7f')]})[_0x4f48('0x2f')](function(_0x5106f3){if(_0x5106f3[_0x4f48('0x40')]===0x1){return _0x5bcffa['id'];}else{var _0x3d3e50=_['every'](_[_0x4f48('0x3a')](_0x5106f3,'TeamId'),function(_0x3ab33b){return _[_0x4f48('0x80')](_0x1896e1,_0x3ab33b);});if(_0x3d3e50){return _0x5bcffa['id'];}}}));}}return BPromise[_0x4f48('0x81')](_0x222e14)['then'](function(_0x1dda6a){_0x53f9fa=_(_0x53f9fa)[_0x4f48('0x82')](_0x1dda6a)[_0x4f48('0x83')]()[_0x4f48('0x84')]();return db[_0x4f48('0x49')][_0x4f48('0x51')]({'where':{'id':_0x2950e4['params']['id']}})[_0x4f48('0x2f')](function(_0x1d6109){return db['sequelize'][_0x4f48('0x6f')](function(_0x388043){return _0x1d6109[_0x4f48('0x85')](_0x2950e4['query'][_0x4f48('0x68')],{'transaction':_0x388043})['then'](function(){if(!_['isEmpty'](_0x53f9fa)){return _0x1d6109[_0x4f48('0x86')](_0x53f9fa,{'transaction':_0x388043});}})[_0x4f48('0x2f')](function(){_0x53f9fa['forEach'](function(_0x14a447){socket[_0x4f48('0x75')]('userFaxQueue:remove',{'UserId':_0x14a447,'FaxQueueId':_0x1d6109['id']});});});});});});})[_0x4f48('0x2f')](respondWithStatusCode(_0x4fbe67,null))[_0x4f48('0x4d')](handleError(_0x4fbe67,null));};exports[_0x4f48('0x87')]=function(_0x2fdda3,_0x41ab18,_0x5a8bd7){return db[_0x4f48('0x49')][_0x4f48('0x51')]({'where':{'id':_0x2fdda3[_0x4f48('0x4f')]['id']}})['then'](handleEntityNotFound(_0x41ab18,null))[_0x4f48('0x2f')](function(_0x2db37f){if(_0x2db37f){return _0x2db37f[_0x4f48('0x87')](_0x2fdda3['body']['ids'],_[_0x4f48('0x88')](_0x2fdda3[_0x4f48('0x53')],['ids','id'])||{})['spread'](function(_0x2b42c1){for(var _0xddc7e8=0x0;_0xddc7e8<_0x2fdda3['body']['ids']['length'];_0xddc7e8+=0x1){socket[_0x4f48('0x75')](_0x4f48('0x76'),{'UserId':Number(_0x2fdda3[_0x4f48('0x53')][_0x4f48('0x68')][_0xddc7e8]),'FaxQueueId':Number(_0x2fdda3['params']['id'])});}return _0x2b42c1;});}})['then'](respondWithResult(_0x41ab18,null))[_0x4f48('0x4d')](handleError(_0x41ab18,null));};exports[_0x4f48('0x86')]=function(_0x180809,_0x1c5944,_0x2c31ea){return db[_0x4f48('0x49')][_0x4f48('0x51')]({'where':{'id':_0x180809[_0x4f48('0x4f')]['id']}})[_0x4f48('0x2f')](handleEntityNotFound(_0x1c5944,null))[_0x4f48('0x2f')](function(_0x1094d1){if(_0x1094d1){return _0x1094d1['removeAgents'](_0x180809['query'][_0x4f48('0x68')])['then'](function(){if(_[_0x4f48('0x89')](_0x180809[_0x4f48('0x3b')][_0x4f48('0x68')])){for(var _0x4e5978=0x0;_0x4e5978<_0x180809[_0x4f48('0x3b')][_0x4f48('0x68')][_0x4f48('0x40')];_0x4e5978+=0x1){socket['emit'](_0x4f48('0x8a'),{'UserId':Number(_0x180809['query']['ids'][_0x4e5978]),'FaxQueueId':Number(_0x180809[_0x4f48('0x4f')]['id'])});}}else{socket[_0x4f48('0x75')](_0x4f48('0x8a'),{'UserId':Number(_0x180809[_0x4f48('0x3b')][_0x4f48('0x68')]),'FaxQueueId':Number(_0x180809[_0x4f48('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c5944,null))[_0x4f48('0x4d')](handleError(_0x1c5944,null));};exports[_0x4f48('0x8b')]=function(_0xa44ee1,_0x352139,_0x4d2e47){var _0x4a710a={};var _0x576f53={};var _0xa65aae;var _0x35bbd5;return db[_0x4f48('0x49')]['findOne']({'where':{'id':_0xa44ee1[_0x4f48('0x4f')]['id']}})['then'](handleEntityNotFound(_0x352139,null))['then'](function(_0x2edfa5){if(_0x2edfa5){_0xa65aae=_0x2edfa5;_0x576f53['model']=_[_0x4f48('0x3c')](db['User'][_0x4f48('0x35')]);_0x576f53[_0x4f48('0x3b')]=_[_0x4f48('0x3c')](_0xa44ee1[_0x4f48('0x3b')]);_0x576f53[_0x4f48('0x44')]=_['intersection'](_0x576f53[_0x4f48('0x39')],_0x576f53[_0x4f48('0x3b')]);_0x4a710a[_0x4f48('0x3f')]=_['intersection'](_0x576f53[_0x4f48('0x39')],qs[_0x4f48('0x3e')](_0xa44ee1[_0x4f48('0x3b')][_0x4f48('0x3e')]));_0x4a710a[_0x4f48('0x3f')]=_0x4a710a['attributes'][_0x4f48('0x40')]?_0x4a710a[_0x4f48('0x3f')]:_0x576f53[_0x4f48('0x39')];_0x4a710a[_0x4f48('0x42')]=qs[_0x4f48('0x43')](_0xa44ee1[_0x4f48('0x3b')][_0x4f48('0x43')]);_0x4a710a['where']=qs['filters'](_['pick'](_0xa44ee1[_0x4f48('0x3b')],_0x576f53['filters']));if(_0xa44ee1[_0x4f48('0x3b')]['filter']){_0x4a710a[_0x4f48('0x46')]=_[_0x4f48('0x48')](_0x4a710a[_0x4f48('0x46')],{'$or':_[_0x4f48('0x3a')](_0x4a710a[_0x4f48('0x3f')],function(_0x447453){var _0x6e8993={};_0x6e8993[_0x447453]={'$like':'%'+_0xa44ee1['query']['filter']+'%'};return _0x6e8993;})});}_0x4a710a=_['merge']({},_0x4a710a,_0xa44ee1[_0x4f48('0x50')]);return _0xa65aae['getAgents'](_0x4a710a);}})[_0x4f48('0x2f')](function(_0x196652){if(_0x196652){_0x35bbd5=_0x196652[_0x4f48('0x40')];if(!_0xa44ee1['query'][_0x4f48('0x5c')](_0x4f48('0x41'))){_0x4a710a[_0x4f48('0x23')]=qs['limit'](_0xa44ee1['query'][_0x4f48('0x23')]);_0x4a710a[_0x4f48('0x25')]=qs[_0x4f48('0x25')](_0xa44ee1[_0x4f48('0x3b')]['offset']);}return _0xa65aae[_0x4f48('0x8b')](_0x4a710a);}})[_0x4f48('0x2f')](function(_0x5b5d98){if(_0x5b5d98){return _0x5b5d98?{'count':_0x35bbd5,'rows':_0x5b5d98}:null;}})[_0x4f48('0x2f')](respondWithResult(_0x352139,null))[_0x4f48('0x4d')](handleError(_0x352139,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 5fc70d7..0381b2d 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 _0x6918=['setMaxListeners','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x397199,_0x42ad19){var _0x261daa=function(_0xc70b6f){while(--_0xc70b6f){_0x397199['push'](_0x397199['shift']());}};_0x261daa(++_0x42ad19);}(_0x6918,0x8f));var _0x8691=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6918[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x8691('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8691('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8691('0x2'),'afterDestroy':_0x8691('0x3')};function emitEvent(_0x2870bd){return function(_0x47055f,_0x2fa752,_0x3abdee){FaxQueueEvents[_0x8691('0x4')](_0x2870bd+':'+_0x47055f['id'],_0x47055f);FaxQueueEvents[_0x8691('0x4')](_0x2870bd,_0x47055f);_0x3abdee(null);};}for(var e in events){if(events[_0x8691('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x08a8=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x08a8,0x130));var _0x808a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x808a('0x0'));var FaxQueue=require(_0x808a('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x808a('0x2')](0x0);var events={'afterCreate':_0x808a('0x3'),'afterUpdate':_0x808a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53d2cf){return function(_0x2ba202,_0x42cb71,_0x28cb0d){FaxQueueEvents[_0x808a('0x5')](_0x53d2cf+':'+_0x2ba202['id'],_0x2ba202);FaxQueueEvents[_0x808a('0x5')](_0x53d2cf,_0x2ba202);_0x28cb0d(null);};}for(var e in events){if(events[_0x808a('0x6')](e)){var event=events[e];FaxQueue[_0x808a('0x7')](e,emitEvent(event));}}module[_0x808a('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e1d59af..196f6ad 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 _0x62fe=['../../config/environment','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x4f5c62,_0xac8212){var _0x22af89=function(_0x1af467){while(--_0x1af467){_0x4f5c62['push'](_0x4f5c62['shift']());}};_0x22af89(++_0xac8212);}(_0x62fe,0xae));var _0xe62f=function(_0x5097d9,_0x3e1637){_0x5097d9=_0x5097d9-0x0;var _0xedbe5a=_0x62fe[_0x5097d9];return _0xedbe5a;};'use strict';var _=require(_0xe62f('0x0'));var util=require(_0xe62f('0x1'));var logger=require(_0xe62f('0x2'))('api');var moment=require(_0xe62f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe62f('0x4'));var rimraf=require(_0xe62f('0x5'));var config=require(_0xe62f('0x6'));var attributes=require(_0xe62f('0x7'));module['exports']=function(_0x13dd93,_0x30abb5){return _0x13dd93['define'](_0xe62f('0x8'),attributes,{'tableName':_0xe62f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea81=['fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueue'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xea81,0x69));var _0x1ea8=function(_0x385d5f,_0x43c178){_0x385d5f=_0x385d5f-0x0;var _0x17dcd8=_0xea81[_0x385d5f];return _0x17dcd8;};'use strict';var _=require(_0x1ea8('0x0'));var util=require(_0x1ea8('0x1'));var logger=require(_0x1ea8('0x2'))('api');var moment=require(_0x1ea8('0x3'));var BPromise=require(_0x1ea8('0x4'));var rp=require(_0x1ea8('0x5'));var fs=require('fs');var path=require(_0x1ea8('0x6'));var rimraf=require(_0x1ea8('0x7'));var config=require(_0x1ea8('0x8'));var attributes=require('./faxQueue.attributes');module[_0x1ea8('0x9')]=function(_0x2624d9,_0x415103){return _0x2624d9[_0x1ea8('0xa')](_0x1ea8('0xb'),attributes,{'tableName':_0x1ea8('0xc'),'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 73cfe94..8e29cdb 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 _0xd651=['info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','where','attributes','limit','map','include','model','raw','ShowFaxQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x1fee25,_0x1c7617){var _0x52b706=function(_0x10d7fe){while(--_0x10d7fe){_0x1fee25['push'](_0x1fee25['shift']());}};_0x52b706(++_0x1c7617);}(_0xd651,0x145));var _0x1d65=function(_0x1145fa,_0x4e00e9){_0x1145fa=_0x1145fa-0x0;var _0x4b8650=_0xd651[_0x1145fa];return _0x4b8650;};'use strict';var _=require(_0x1d65('0x0'));var util=require(_0x1d65('0x1'));var moment=require(_0x1d65('0x2'));var BPromise=require(_0x1d65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d65('0x4'));var db=require(_0x1d65('0x5'))['db'];var utils=require(_0x1d65('0x6'));var logger=require(_0x1d65('0x7'))(_0x1d65('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d65('0x9')][_0x1d65('0xa')]({'port':0x232a});config[_0x1d65('0xb')]=_[_0x1d65('0xc')](config[_0x1d65('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d65('0xd'))(new Redis(config[_0x1d65('0xb')]));require('./faxQueue.socket')[_0x1d65('0xe')](socket);function respondWithRpcPromise(_0x2752b6,_0x1c0413,_0xfa7f7c){return new BPromise(function(_0x85359c,_0x91811){return client[_0x1d65('0xf')](_0x2752b6,_0xfa7f7c)[_0x1d65('0x10')](function(_0x1dfbbc){logger[_0x1d65('0x11')](_0x1d65('0x12'),_0x1c0413,_0x1d65('0x13'));logger[_0x1d65('0x14')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1c0413,_0x1d65('0x13'),JSON[_0x1d65('0x15')](_0x1dfbbc));if(_0x1dfbbc[_0x1d65('0x16')]){if(_0x1dfbbc[_0x1d65('0x16')][_0x1d65('0x17')]===0x1f4){logger[_0x1d65('0x16')](_0x1d65('0x12'),_0x1c0413,_0x1dfbbc['error'][_0x1d65('0x18')]);return _0x91811(_0x1dfbbc[_0x1d65('0x16')][_0x1d65('0x18')]);}logger[_0x1d65('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1c0413,_0x1dfbbc['error']['message']);return _0x85359c(_0x1dfbbc[_0x1d65('0x16')]['message']);}else{logger[_0x1d65('0x11')](_0x1d65('0x12'),_0x1c0413,'request\x20sent');_0x85359c(_0x1dfbbc[_0x1d65('0x19')][_0x1d65('0x18')]);}})[_0x1d65('0x1a')](function(_0x4979e8){logger[_0x1d65('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1c0413,_0x4979e8);_0x91811(_0x4979e8);});});}exports[_0x1d65('0x1b')]=function(_0xb931ea){var _0x554a4c=this;return new Promise(function(_0x3f04f7,_0x15b42f){return db[_0x1d65('0x1c')]['findAll']({'raw':_0xb931ea[_0x1d65('0x1d')]?_0xb931ea[_0x1d65('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xb931ea[_0x1d65('0x1d')]?_0xb931ea[_0x1d65('0x1d')][_0x1d65('0x1e')]||null:null,'attributes':_0xb931ea[_0x1d65('0x1d')]?_0xb931ea[_0x1d65('0x1d')][_0x1d65('0x1f')]||null:null,'limit':_0xb931ea['options']?_0xb931ea[_0x1d65('0x1d')][_0x1d65('0x20')]||null:null,'include':_0xb931ea[_0x1d65('0x1d')]?_0xb931ea[_0x1d65('0x1d')]['include']?_[_0x1d65('0x21')](_0xb931ea[_0x1d65('0x1d')][_0x1d65('0x22')],function(_0x599492){return{'model':db[_0x599492[_0x1d65('0x23')]],'as':_0x599492['as'],'attributes':_0x599492[_0x1d65('0x1f')],'include':_0x599492[_0x1d65('0x22')]?_['map'](_0x599492[_0x1d65('0x22')],function(_0x33ade2){return{'model':db[_0x33ade2[_0x1d65('0x23')]],'as':_0x33ade2['as'],'attributes':_0x33ade2['attributes'],'include':_0x33ade2[_0x1d65('0x22')]?_[_0x1d65('0x21')](_0x33ade2['include'],function(_0x38b8f2){return{'model':db[_0x38b8f2[_0x1d65('0x23')]],'as':_0x38b8f2['as'],'attributes':_0x38b8f2['attributes']};}):[]};}):[]};}):[]:[]})[_0x1d65('0x10')](function(_0x4c4e0e){logger[_0x1d65('0x11')](_0x1d65('0x1b'),_0xb931ea);logger[_0x1d65('0x14')](_0x1d65('0x1b'),_0xb931ea,JSON[_0x1d65('0x15')](_0x4c4e0e));_0x3f04f7(_0x4c4e0e);})[_0x1d65('0x1a')](function(_0x587c27){logger[_0x1d65('0x16')](_0x1d65('0x1b'),_0x587c27[_0x1d65('0x18')],_0xb931ea);_0x15b42f(_0x554a4c[_0x1d65('0x16')](0x1f4,_0x587c27[_0x1d65('0x18')]));});});};exports['ShowFaxQueue']=function(_0x3467af){var _0x5883fe=this;return new Promise(function(_0x5e1fa9,_0x12cae7){return db[_0x1d65('0x1c')]['find']({'raw':_0x3467af[_0x1d65('0x1d')]?_0x3467af['options'][_0x1d65('0x24')]===undefined?!![]:![]:!![],'where':_0x3467af['options']?_0x3467af[_0x1d65('0x1d')][_0x1d65('0x1e')]||null:null,'attributes':_0x3467af[_0x1d65('0x1d')]?_0x3467af[_0x1d65('0x1d')]['attributes']||null:null,'include':_0x3467af[_0x1d65('0x1d')]?_0x3467af[_0x1d65('0x1d')][_0x1d65('0x22')]?_[_0x1d65('0x21')](_0x3467af['options'][_0x1d65('0x22')],function(_0x55e577){return{'model':db[_0x55e577[_0x1d65('0x23')]],'as':_0x55e577['as'],'attributes':_0x55e577['attributes'],'include':_0x55e577[_0x1d65('0x22')]?_[_0x1d65('0x21')](_0x55e577[_0x1d65('0x22')],function(_0x5bdd0c){return{'model':db[_0x5bdd0c[_0x1d65('0x23')]],'as':_0x5bdd0c['as'],'attributes':_0x5bdd0c[_0x1d65('0x1f')],'include':_0x5bdd0c['include']?_[_0x1d65('0x21')](_0x5bdd0c[_0x1d65('0x22')],function(_0x4410b8){return{'model':db[_0x4410b8[_0x1d65('0x23')]],'as':_0x4410b8['as'],'attributes':_0x4410b8[_0x1d65('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1d65('0x10')](function(_0x9f79d4){logger[_0x1d65('0x11')](_0x1d65('0x25'),_0x3467af);logger[_0x1d65('0x14')]('ShowFaxQueue',_0x3467af,JSON['stringify'](_0x9f79d4));_0x5e1fa9(_0x9f79d4);})[_0x1d65('0x1a')](function(_0x5284df){logger[_0x1d65('0x16')](_0x1d65('0x25'),_0x5284df['message'],_0x3467af);_0x12cae7(_0x5883fe['error'](0x1f4,_0x5284df[_0x1d65('0x18')]));});});}; \ No newline at end of file +var _0x5db8=['findAll','options','where','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','FaxQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x8c5eaf,_0x7daba3){var _0x52be1c=function(_0xfa5425){while(--_0xfa5425){_0x8c5eaf['push'](_0x8c5eaf['shift']());}};_0x52be1c(++_0x7daba3);}(_0x5db8,0x176));var _0x85db=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0x5db8[_0x25b24a];return _0x224e68;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require('moment');var BPromise=require(_0x85db('0x2'));var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x85db('0x4'))['db'];var utils=require(_0x85db('0x5'));var logger=require(_0x85db('0x6'))(_0x85db('0x7'));var config=require(_0x85db('0x8'));var jayson=require(_0x85db('0x9'));var client=jayson['client'][_0x85db('0xa')]({'port':0x232a});config[_0x85db('0xb')]=_[_0x85db('0xc')](config[_0x85db('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x85db('0xd'))(new Redis(config[_0x85db('0xb')]));require('./faxQueue.socket')[_0x85db('0xe')](socket);function respondWithRpcPromise(_0x1aecd1,_0x1af50f,_0x43e194){return new BPromise(function(_0x735569,_0xb79c10){return client[_0x85db('0xf')](_0x1aecd1,_0x43e194)[_0x85db('0x10')](function(_0x1ee598){logger[_0x85db('0x11')](_0x85db('0x12'),_0x1af50f,_0x85db('0x13'));logger['debug'](_0x85db('0x14'),_0x1af50f,_0x85db('0x13'),JSON[_0x85db('0x15')](_0x1ee598));if(_0x1ee598[_0x85db('0x16')]){if(_0x1ee598[_0x85db('0x16')]['code']===0x1f4){logger[_0x85db('0x16')](_0x85db('0x12'),_0x1af50f,_0x1ee598[_0x85db('0x16')][_0x85db('0x17')]);return _0xb79c10(_0x1ee598[_0x85db('0x16')][_0x85db('0x17')]);}logger['error'](_0x85db('0x12'),_0x1af50f,_0x1ee598[_0x85db('0x16')][_0x85db('0x17')]);return _0x735569(_0x1ee598[_0x85db('0x16')]['message']);}else{logger[_0x85db('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1af50f,_0x85db('0x13'));_0x735569(_0x1ee598[_0x85db('0x18')][_0x85db('0x17')]);}})[_0x85db('0x19')](function(_0x432100){logger[_0x85db('0x16')](_0x85db('0x12'),_0x1af50f,_0x432100);_0xb79c10(_0x432100);});});}exports['GetFaxQueue']=function(_0xf92c89){var _0x3e2b89=this;return new Promise(function(_0x4e371f,_0x16f02b){return db['FaxQueue'][_0x85db('0x1a')]({'raw':_0xf92c89[_0x85db('0x1b')]?_0xf92c89['options']['raw']===undefined?!![]:![]:!![],'where':_0xf92c89['options']?_0xf92c89['options'][_0x85db('0x1c')]||null:null,'attributes':_0xf92c89[_0x85db('0x1b')]?_0xf92c89[_0x85db('0x1b')][_0x85db('0x1d')]||null:null,'limit':_0xf92c89['options']?_0xf92c89[_0x85db('0x1b')][_0x85db('0x1e')]||null:null,'include':_0xf92c89['options']?_0xf92c89[_0x85db('0x1b')][_0x85db('0x1f')]?_[_0x85db('0x20')](_0xf92c89[_0x85db('0x1b')][_0x85db('0x1f')],function(_0x6a2853){return{'model':db[_0x6a2853[_0x85db('0x21')]],'as':_0x6a2853['as'],'attributes':_0x6a2853[_0x85db('0x1d')],'include':_0x6a2853['include']?_[_0x85db('0x20')](_0x6a2853[_0x85db('0x1f')],function(_0xf8594b){return{'model':db[_0xf8594b['model']],'as':_0xf8594b['as'],'attributes':_0xf8594b[_0x85db('0x1d')],'include':_0xf8594b[_0x85db('0x1f')]?_[_0x85db('0x20')](_0xf8594b[_0x85db('0x1f')],function(_0x5c75bf){return{'model':db[_0x5c75bf[_0x85db('0x21')]],'as':_0x5c75bf['as'],'attributes':_0x5c75bf[_0x85db('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204621){logger['info'](_0x85db('0x22'),_0xf92c89);logger[_0x85db('0x23')]('GetFaxQueue',_0xf92c89,JSON['stringify'](_0x204621));_0x4e371f(_0x204621);})[_0x85db('0x19')](function(_0x4a46eb){logger['error'](_0x85db('0x22'),_0x4a46eb['message'],_0xf92c89);_0x16f02b(_0x3e2b89[_0x85db('0x16')](0x1f4,_0x4a46eb[_0x85db('0x17')]));});});};exports[_0x85db('0x24')]=function(_0x3028f3){var _0x2daaf1=this;return new Promise(function(_0x29fb00,_0x49f25b){return db[_0x85db('0x25')][_0x85db('0x26')]({'raw':_0x3028f3[_0x85db('0x1b')]?_0x3028f3['options'][_0x85db('0x27')]===undefined?!![]:![]:!![],'where':_0x3028f3[_0x85db('0x1b')]?_0x3028f3['options'][_0x85db('0x1c')]||null:null,'attributes':_0x3028f3[_0x85db('0x1b')]?_0x3028f3['options'][_0x85db('0x1d')]||null:null,'include':_0x3028f3['options']?_0x3028f3['options'][_0x85db('0x1f')]?_[_0x85db('0x20')](_0x3028f3[_0x85db('0x1b')][_0x85db('0x1f')],function(_0x4e149e){return{'model':db[_0x4e149e[_0x85db('0x21')]],'as':_0x4e149e['as'],'attributes':_0x4e149e[_0x85db('0x1d')],'include':_0x4e149e[_0x85db('0x1f')]?_[_0x85db('0x20')](_0x4e149e['include'],function(_0x1be93f){return{'model':db[_0x1be93f['model']],'as':_0x1be93f['as'],'attributes':_0x1be93f['attributes'],'include':_0x1be93f[_0x85db('0x1f')]?_['map'](_0x1be93f[_0x85db('0x1f')],function(_0x4cfbd2){return{'model':db[_0x4cfbd2[_0x85db('0x21')]],'as':_0x4cfbd2['as'],'attributes':_0x4cfbd2[_0x85db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x85db('0x10')](function(_0x4184b7){logger[_0x85db('0x11')](_0x85db('0x24'),_0x3028f3);logger[_0x85db('0x23')]('ShowFaxQueue',_0x3028f3,JSON[_0x85db('0x15')](_0x4184b7));_0x29fb00(_0x4184b7);})['catch'](function(_0x154352){logger['error'](_0x85db('0x24'),_0x154352[_0x85db('0x17')],_0x3028f3);_0x49f25b(_0x2daaf1[_0x85db('0x16')](0x1f4,_0x154352[_0x85db('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 25e36cb..2638a63 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 _0x7573=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','register'];(function(_0x15bd4c,_0x163261){var _0x3463fb=function(_0x102800){while(--_0x102800){_0x15bd4c['push'](_0x15bd4c['shift']());}};_0x3463fb(++_0x163261);}(_0x7573,0x72));var _0x3757=function(_0x5dd064,_0x4860ec){_0x5dd064=_0x5dd064-0x0;var _0x91ab27=_0x7573[_0x5dd064];return _0x91ab27;};'use strict';var FaxQueueEvents=require(_0x3757('0x0'));var events=[_0x3757('0x1'),_0x3757('0x2'),_0x3757('0x3')];function createListener(_0xd61529,_0x21b5f1){return function(_0x97b507){_0x21b5f1[_0x3757('0x4')](_0xd61529,_0x97b507);};}function removeListener(_0x32d8e3,_0x4cbed1){return function(){FaxQueueEvents['removeListener'](_0x32d8e3,_0x4cbed1);};}exports[_0x3757('0x5')]=function(_0x55e1fd){for(var _0x162b4e=0x0,_0x5b1212=events[_0x3757('0x6')];_0x162b4e<_0x5b1212;_0x162b4e++){var _0x1d20a9=events[_0x162b4e];var _0xdd275a=createListener(_0x3757('0x7')+_0x1d20a9,_0x55e1fd);FaxQueueEvents['on'](_0x1d20a9,_0xdd275a);}}; \ No newline at end of file +var _0xc11a=['./faxQueue.events','save','remove','removeListener','register','length','faxQueue:'];(function(_0x7b3581,_0x2cd548){var _0x2e0cb2=function(_0x5e1fea){while(--_0x5e1fea){_0x7b3581['push'](_0x7b3581['shift']());}};_0x2e0cb2(++_0x2cd548);}(_0xc11a,0x1d5));var _0xac11=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xc11a[_0x341e0f];return _0x59555a;};'use strict';var FaxQueueEvents=require(_0xac11('0x0'));var events=[_0xac11('0x1'),_0xac11('0x2'),'update'];function createListener(_0x4a7d99,_0x1f310e){return function(_0x436a01){_0x1f310e['emit'](_0x4a7d99,_0x436a01);};}function removeListener(_0x2c631a,_0x3b93fb){return function(){FaxQueueEvents[_0xac11('0x3')](_0x2c631a,_0x3b93fb);};}exports[_0xac11('0x4')]=function(_0x15b150){for(var _0x38de20=0x0,_0x57b116=events[_0xac11('0x5')];_0x38de20<_0x57b116;_0x38de20++){var _0x46e01=events[_0x38de20];var _0x5a46e6=createListener(_0xac11('0x6')+_0x46e01,_0x15b150);FaxQueueEvents['on'](_0x46e01,_0x5a46e6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 40be947..ef6cd6d 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 _0x8b8e=['post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b8e,0x108));var _0xe8b8=function(_0x2bfcb7,_0x496840){_0x2bfcb7=_0x2bfcb7-0x0;var _0x20f32f=_0x8b8e[_0x2bfcb7];return _0x20f32f;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['describe']);router[_0xe8b8('0x7')]('/:id',auth[_0xe8b8('0x8')](),controller['show']);router['get'](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller['getMembers']);router['get'](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router[_0xe8b8('0x7')](_0xe8b8('0xe'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xf')]);router[_0xe8b8('0x10')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x11')]);router[_0xe8b8('0x10')](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x12')]);router['post'](_0xe8b8('0xe'),auth['isAuthenticated'](),controller[_0xe8b8('0x13')]);router[_0xe8b8('0x14')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x16')]);router[_0xe8b8('0x17')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x18')]);router[_0xe8b8('0x17')]('/:id/teams',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x19')]);router['delete'](_0xe8b8('0xe'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x1a')]);module[_0xe8b8('0x1b')]=router; \ No newline at end of file +var _0xc1c6=['put','/:id','update','delete','destroy','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents'];(function(_0x1f5997,_0x486977){var _0x555bf2=function(_0x19bbde){while(--_0x19bbde){_0x1f5997['push'](_0x1f5997['shift']());}};_0x555bf2(++_0x486977);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4fe2c7,_0x2417e7){_0x4fe2c7=_0x4fe2c7-0x0;var _0x19eed1=_0xc1c6[_0x4fe2c7];return _0x19eed1;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['get'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0x7')]('/:id/teams',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xf')]);router[_0x6c1c('0x7')]('/:id/users',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);router[_0x6c1c('0x11')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x12')]);router['post'](_0x6c1c('0x13'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x14')]);router[_0x6c1c('0x11')](_0x6c1c('0x15'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x16')]);router[_0x6c1c('0x17')](_0x6c1c('0x18'),auth['isAuthenticated'](),controller[_0x6c1c('0x19')]);router[_0x6c1c('0x1a')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x1b')]);router['delete'](_0x6c1c('0x13'),auth['isAuthenticated'](),controller[_0x6c1c('0x1c')]);router[_0x6c1c('0x1a')]('/:id/users',auth[_0x6c1c('0xa')](),controller['removeAgents']);module[_0x6c1c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 45772fa..c72dbdc 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 _0x6cfa=['STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cfa,0xa1));var _0xa6cf=function(_0x4134d6,_0x12a9cf){_0x4134d6=_0x4134d6-0x0;var _0x81e604=_0x6cfa[_0x4134d6];return _0x81e604;};'use strict';var moment=require(_0xa6cf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa6cf('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa6cf('0x2')]},'leaveAt':{'type':Sequelize[_0xa6cf('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd449=['moment','DATE','STRING'];(function(_0x401d08,_0x3afbb4){var _0x3a7297=function(_0x2f83a9){while(--_0x2f83a9){_0x401d08['push'](_0x401d08['shift']());}};_0x3a7297(++_0x3afbb4);}(_0xd449,0x153));var _0x9d44=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xd449[_0x2a5099];return _0x2802f1;};'use strict';var moment=require(_0x9d44('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9d44('0x1')]},'exitAt':{'type':Sequelize[_0x9d44('0x1')]},'reason':{'type':Sequelize[_0x9d44('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 2edb5bb..408d423 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 _0xafe6=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','catch','destroy','describe','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','send','index','FaxQueueReport','rawAttributes','type','key','model','map','query'];(function(_0x25aa68,_0x2de420){var _0x2a93c5=function(_0x296abc){while(--_0x296abc){_0x25aa68['push'](_0x25aa68['shift']());}};_0x2a93c5(++_0x2de420);}(_0xafe6,0xac));var _0x6afe=function(_0x53885a,_0x5c7560){_0x53885a=_0x53885a-0x0;var _0x171688=_0xafe6[_0x53885a];return _0x171688;};'use strict';var emlformat=require(_0x6afe('0x0'));var rimraf=require(_0x6afe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6afe('0x2'));var moment=require(_0x6afe('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6afe('0x4'));var path=require(_0x6afe('0x5'));var sox=require(_0x6afe('0x6'));var csv=require(_0x6afe('0x7'));var ejs=require(_0x6afe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6afe('0x9'));var squel=require(_0x6afe('0xa'));var crypto=require(_0x6afe('0xb'));var jsforce=require(_0x6afe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6afe('0x7'));var querystring=require(_0x6afe('0xd'));var Papa=require(_0x6afe('0xe'));var Redis=require(_0x6afe('0xf'));var authService=require(_0x6afe('0x10'));var qs=require(_0x6afe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6afe('0x12'))(_0x6afe('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6afe('0x14'));var db=require(_0x6afe('0x15'))['db'];function respondWithStatusCode(_0x3e75b5,_0x15ea76){_0x15ea76=_0x15ea76||0xcc;return function(_0x1abd61){if(_0x1abd61){return _0x3e75b5[_0x6afe('0x16')](_0x15ea76);}return _0x3e75b5[_0x6afe('0x17')](_0x15ea76)['end']();};}function respondWithResult(_0x31940b,_0x4061bd){_0x4061bd=_0x4061bd||0xc8;return function(_0x473fc9){if(_0x473fc9){return _0x31940b[_0x6afe('0x17')](_0x4061bd)[_0x6afe('0x18')](_0x473fc9);}};}function respondWithFilteredResult(_0x2d3e7d,_0x94ca1){return function(_0x4deb5b){if(_0x4deb5b){var _0x311b1e=typeof _0x94ca1['offset']==='undefined'&&typeof _0x94ca1[_0x6afe('0x19')]===_0x6afe('0x1a');var _0x393967=_0x4deb5b[_0x6afe('0x1b')];var _0x1bc331=_0x311b1e?0x0:_0x94ca1[_0x6afe('0x1c')];var _0x3699e8=_0x311b1e?_0x4deb5b[_0x6afe('0x1b')]:_0x94ca1['offset']+_0x94ca1['limit'];var _0x450069;if(_0x3699e8>=_0x393967){_0x3699e8=_0x393967;_0x450069=0xc8;}else{_0x450069=0xce;}_0x2d3e7d[_0x6afe('0x17')](_0x450069);return _0x2d3e7d[_0x6afe('0x1d')]('Content-Range',_0x1bc331+'-'+_0x3699e8+'/'+_0x393967)['json'](_0x4deb5b);}return null;};}function patchUpdates(_0x4227f0){return function(_0x18ee9f){try{jsonpatch[_0x6afe('0x1e')](_0x18ee9f,_0x4227f0,!![]);}catch(_0x2d1dd9){return BPromise[_0x6afe('0x1f')](_0x2d1dd9);}return _0x18ee9f[_0x6afe('0x20')]();};}function saveUpdates(_0x1f3436,_0x42e461){return function(_0x2ef577){if(_0x2ef577){return _0x2ef577[_0x6afe('0x21')](_0x1f3436)[_0x6afe('0x22')](function(_0x1af882){return _0x1af882;});}return null;};}function removeEntity(_0x397439,_0x23fc00){return function(_0x93d444){if(_0x93d444){return _0x93d444['destroy']()['then'](function(){_0x397439[_0x6afe('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0399,_0x1fbc77){return function(_0x1934c1){if(!_0x1934c1){_0x4b0399[_0x6afe('0x16')](0x194);}return _0x1934c1;};}function handleError(_0x10b640,_0x11ebea){_0x11ebea=_0x11ebea||0x1f4;return function(_0x3bb392){logger[_0x6afe('0x23')](_0x3bb392[_0x6afe('0x24')]);if(_0x3bb392[_0x6afe('0x25')]){delete _0x3bb392[_0x6afe('0x25')];}_0x10b640[_0x6afe('0x17')](_0x11ebea)[_0x6afe('0x26')](_0x3bb392);};}exports[_0x6afe('0x27')]=function(_0x56e480,_0x429587){var _0x2c0573={},_0x17e5d5={},_0x487a02={'count':0x0,'rows':[]};var _0x2fcb09=_['map'](db[_0x6afe('0x28')][_0x6afe('0x29')],function(_0x48138c){return{'name':_0x48138c['fieldName'],'type':_0x48138c[_0x6afe('0x2a')][_0x6afe('0x2b')]};});_0x17e5d5[_0x6afe('0x2c')]=_[_0x6afe('0x2d')](_0x2fcb09,_0x6afe('0x25'));_0x17e5d5[_0x6afe('0x2e')]=_[_0x6afe('0x2f')](_0x56e480[_0x6afe('0x2e')]);_0x17e5d5[_0x6afe('0x30')]=_[_0x6afe('0x31')](_0x17e5d5[_0x6afe('0x2c')],_0x17e5d5[_0x6afe('0x2e')]);_0x2c0573[_0x6afe('0x32')]=_[_0x6afe('0x31')](_0x17e5d5[_0x6afe('0x2c')],qs[_0x6afe('0x33')](_0x56e480[_0x6afe('0x2e')][_0x6afe('0x33')]));_0x2c0573[_0x6afe('0x32')]=_0x2c0573[_0x6afe('0x32')][_0x6afe('0x34')]?_0x2c0573['attributes']:_0x17e5d5['model'];if(!_0x56e480[_0x6afe('0x2e')][_0x6afe('0x35')](_0x6afe('0x36'))){_0x2c0573[_0x6afe('0x19')]=qs[_0x6afe('0x19')](_0x56e480['query'][_0x6afe('0x19')]);_0x2c0573['offset']=qs['offset'](_0x56e480[_0x6afe('0x2e')][_0x6afe('0x1c')]);}_0x2c0573[_0x6afe('0x37')]=qs[_0x6afe('0x38')](_0x56e480['query']['sort']);_0x2c0573[_0x6afe('0x39')]=qs[_0x6afe('0x30')](_[_0x6afe('0x3a')](_0x56e480['query'],_0x17e5d5[_0x6afe('0x30')]),_0x2fcb09);if(_0x56e480[_0x6afe('0x2e')][_0x6afe('0x3b')]){_0x2c0573[_0x6afe('0x39')]=_[_0x6afe('0x3c')](_0x2c0573[_0x6afe('0x39')],{'$or':_[_0x6afe('0x2d')](_0x2fcb09,function(_0x5d1aa7){if(_0x5d1aa7[_0x6afe('0x2a')]!==_0x6afe('0x3d')){var _0x4d82ab={};_0x4d82ab[_0x5d1aa7['name']]={'$like':'%'+_0x56e480[_0x6afe('0x2e')]['filter']+'%'};return _0x4d82ab;}})});}_0x2c0573=_[_0x6afe('0x3c')]({},_0x2c0573,_0x56e480[_0x6afe('0x3e')]);var _0x3c06de={'where':_0x2c0573[_0x6afe('0x39')]};return db[_0x6afe('0x28')][_0x6afe('0x1b')](_0x3c06de)[_0x6afe('0x22')](function(_0x5c3154){_0x487a02['count']=_0x5c3154;if(_0x56e480[_0x6afe('0x2e')][_0x6afe('0x3f')]){_0x2c0573[_0x6afe('0x40')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x2c0573);})[_0x6afe('0x22')](function(_0x59d18c){_0x487a02[_0x6afe('0x41')]=_0x59d18c;return _0x487a02;})['then'](respondWithFilteredResult(_0x429587,_0x2c0573))['catch'](handleError(_0x429587,null));};exports[_0x6afe('0x42')]=function(_0xa9995b,_0x57ba07){var _0x49d3b9={'raw':!![],'where':{'id':_0xa9995b['params']['id']}},_0x1b4a28={};_0x1b4a28['model']=_[_0x6afe('0x2f')](db[_0x6afe('0x28')][_0x6afe('0x29')]);_0x1b4a28[_0x6afe('0x2e')]=_[_0x6afe('0x2f')](_0xa9995b['query']);_0x1b4a28['filters']=_[_0x6afe('0x31')](_0x1b4a28['model'],_0x1b4a28['query']);_0x49d3b9['attributes']=_[_0x6afe('0x31')](_0x1b4a28[_0x6afe('0x2c')],qs[_0x6afe('0x33')](_0xa9995b[_0x6afe('0x2e')]['fields']));_0x49d3b9[_0x6afe('0x32')]=_0x49d3b9[_0x6afe('0x32')][_0x6afe('0x34')]?_0x49d3b9[_0x6afe('0x32')]:_0x1b4a28[_0x6afe('0x2c')];if(_0xa9995b[_0x6afe('0x2e')][_0x6afe('0x3f')]){_0x49d3b9[_0x6afe('0x40')]=[{'all':!![]}];}_0x49d3b9=_[_0x6afe('0x3c')]({},_0x49d3b9,_0xa9995b['options']);return db['FaxQueueReport'][_0x6afe('0x43')](_0x49d3b9)[_0x6afe('0x22')](handleEntityNotFound(_0x57ba07,null))[_0x6afe('0x22')](respondWithResult(_0x57ba07,null))['catch'](handleError(_0x57ba07,null));};exports['create']=function(_0x581d79,_0x2772ca){return db['FaxQueueReport'][_0x6afe('0x44')](_0x581d79[_0x6afe('0x45')],{})['then'](respondWithResult(_0x2772ca,0xc9))[_0x6afe('0x46')](handleError(_0x2772ca,null));};exports[_0x6afe('0x21')]=function(_0x2ba25a,_0x4ed252){if(_0x2ba25a['body']['id']){delete _0x2ba25a[_0x6afe('0x45')]['id'];}return db['FaxQueueReport'][_0x6afe('0x43')]({'where':{'id':_0x2ba25a['params']['id']}})[_0x6afe('0x22')](handleEntityNotFound(_0x4ed252,null))[_0x6afe('0x22')](saveUpdates(_0x2ba25a[_0x6afe('0x45')],null))[_0x6afe('0x22')](respondWithResult(_0x4ed252,null))[_0x6afe('0x46')](handleError(_0x4ed252,null));};exports[_0x6afe('0x47')]=function(_0x54c1e3,_0x217ee8){return db[_0x6afe('0x28')][_0x6afe('0x43')]({'where':{'id':_0x54c1e3['params']['id']}})['then'](handleEntityNotFound(_0x217ee8,null))['then'](removeEntity(_0x217ee8,null))[_0x6afe('0x46')](handleError(_0x217ee8,null));};exports[_0x6afe('0x48')]=function(_0x548bba,_0x32fd9d){return db[_0x6afe('0x28')]['describe']()['then'](respondWithResult(_0x32fd9d,null))[_0x6afe('0x46')](handleError(_0x32fd9d,null));}; \ No newline at end of file +var _0xd8cc=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','keys','intersection','include','create','body','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xd8cc[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0xcd8c('0x0'));var rimraf=require(_0xcd8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd8c('0x2'));var moment=require(_0xcd8c('0x3'));var BPromise=require(_0xcd8c('0x4'));var Mustache=require(_0xcd8c('0x5'));var util=require('util');var path=require(_0xcd8c('0x6'));var sox=require(_0xcd8c('0x7'));var csv=require('to-csv');var ejs=require(_0xcd8c('0x8'));var fs=require('fs');var fs_extra=require(_0xcd8c('0x9'));var _=require('lodash');var squel=require(_0xcd8c('0xa'));var crypto=require(_0xcd8c('0xb'));var jsforce=require(_0xcd8c('0xc'));var deskjs=require(_0xcd8c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcd8c('0xe'));var Papa=require(_0xcd8c('0xf'));var Redis=require(_0xcd8c('0x10'));var authService=require(_0xcd8c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcd8c('0x12'));var hardwareService=require(_0xcd8c('0x13'));var logger=require(_0xcd8c('0x14'))(_0xcd8c('0x15'));var utils=require(_0xcd8c('0x16'));var config=require(_0xcd8c('0x17'));var licenseUtil=require(_0xcd8c('0x18'));var db=require(_0xcd8c('0x19'))['db'];function respondWithStatusCode(_0x338bd6,_0x5a55f4){_0x5a55f4=_0x5a55f4||0xcc;return function(_0x1d695b){if(_0x1d695b){return _0x338bd6['sendStatus'](_0x5a55f4);}return _0x338bd6[_0xcd8c('0x1a')](_0x5a55f4)[_0xcd8c('0x1b')]();};}function respondWithResult(_0x3b90be,_0x5a41e0){_0x5a41e0=_0x5a41e0||0xc8;return function(_0xf0cb62){if(_0xf0cb62){return _0x3b90be[_0xcd8c('0x1a')](_0x5a41e0)[_0xcd8c('0x1c')](_0xf0cb62);}};}function respondWithFilteredResult(_0xffcb8d,_0x8e98d6){return function(_0x2df9d1){if(_0x2df9d1){var _0x13058b=typeof _0x8e98d6['offset']===_0xcd8c('0x1d')&&typeof _0x8e98d6[_0xcd8c('0x1e')]===_0xcd8c('0x1d');var _0x2f1180=_0x2df9d1[_0xcd8c('0x1f')];var _0x4a6652=_0x13058b?0x0:_0x8e98d6[_0xcd8c('0x20')];var _0x120d0d=_0x13058b?_0x2df9d1[_0xcd8c('0x1f')]:_0x8e98d6[_0xcd8c('0x20')]+_0x8e98d6[_0xcd8c('0x1e')];var _0x387ff2;if(_0x120d0d>=_0x2f1180){_0x120d0d=_0x2f1180;_0x387ff2=0xc8;}else{_0x387ff2=0xce;}_0xffcb8d[_0xcd8c('0x1a')](_0x387ff2);return _0xffcb8d['set'](_0xcd8c('0x21'),_0x4a6652+'-'+_0x120d0d+'/'+_0x2f1180)[_0xcd8c('0x1c')](_0x2df9d1);}return null;};}function patchUpdates(_0x5008d3){return function(_0x5330ea){try{jsonpatch['apply'](_0x5330ea,_0x5008d3,!![]);}catch(_0x506d64){return BPromise[_0xcd8c('0x22')](_0x506d64);}return _0x5330ea['save']();};}function saveUpdates(_0x534257,_0x59297d){return function(_0x4f12b8){if(_0x4f12b8){return _0x4f12b8['update'](_0x534257)[_0xcd8c('0x23')](function(_0x3c60ff){return _0x3c60ff;});}return null;};}function removeEntity(_0x2d7718,_0x5368df){return function(_0x2e5711){if(_0x2e5711){return _0x2e5711[_0xcd8c('0x24')]()[_0xcd8c('0x23')](function(){_0x2d7718[_0xcd8c('0x1a')](0xcc)[_0xcd8c('0x1b')]();});}};}function handleEntityNotFound(_0x77ca04,_0x5caaa0){return function(_0x56a54c){if(!_0x56a54c){_0x77ca04[_0xcd8c('0x25')](0x194);}return _0x56a54c;};}function handleError(_0x1e1e00,_0xfc6ca5){_0xfc6ca5=_0xfc6ca5||0x1f4;return function(_0x4c67c1){logger[_0xcd8c('0x26')](_0x4c67c1[_0xcd8c('0x27')]);if(_0x4c67c1['name']){delete _0x4c67c1[_0xcd8c('0x28')];}_0x1e1e00[_0xcd8c('0x1a')](_0xfc6ca5)[_0xcd8c('0x29')](_0x4c67c1);};}exports['index']=function(_0x5193a1,_0x36c342){var _0x5308ec={},_0x4c772a={},_0x57d59b={'count':0x0,'rows':[]};var _0x1f31ca=_[_0xcd8c('0x2a')](db[_0xcd8c('0x2b')][_0xcd8c('0x2c')],function(_0x36884e){return{'name':_0x36884e[_0xcd8c('0x2d')],'type':_0x36884e[_0xcd8c('0x2e')][_0xcd8c('0x2f')]};});_0x4c772a['model']=_[_0xcd8c('0x2a')](_0x1f31ca,_0xcd8c('0x28'));_0x4c772a[_0xcd8c('0x30')]=_['keys'](_0x5193a1[_0xcd8c('0x30')]);_0x4c772a[_0xcd8c('0x31')]=_['intersection'](_0x4c772a[_0xcd8c('0x32')],_0x4c772a['query']);_0x5308ec[_0xcd8c('0x33')]=_['intersection'](_0x4c772a['model'],qs[_0xcd8c('0x34')](_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x34')]));_0x5308ec[_0xcd8c('0x33')]=_0x5308ec['attributes'][_0xcd8c('0x35')]?_0x5308ec['attributes']:_0x4c772a[_0xcd8c('0x32')];if(!_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x36')](_0xcd8c('0x37'))){_0x5308ec['limit']=qs[_0xcd8c('0x1e')](_0x5193a1['query'][_0xcd8c('0x1e')]);_0x5308ec['offset']=qs['offset'](_0x5193a1['query'][_0xcd8c('0x20')]);}_0x5308ec['order']=qs['sort'](_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x38')]);_0x5308ec[_0xcd8c('0x39')]=qs['filters'](_[_0xcd8c('0x3a')](_0x5193a1[_0xcd8c('0x30')],_0x4c772a[_0xcd8c('0x31')]),_0x1f31ca);if(_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x3b')]){_0x5308ec[_0xcd8c('0x39')]=_[_0xcd8c('0x3c')](_0x5308ec[_0xcd8c('0x39')],{'$or':_[_0xcd8c('0x2a')](_0x1f31ca,function(_0x19a781){if(_0x19a781[_0xcd8c('0x2e')]!==_0xcd8c('0x3d')){var _0x1d3d54={};_0x1d3d54[_0x19a781[_0xcd8c('0x28')]]={'$like':'%'+_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x3b')]+'%'};return _0x1d3d54;}})});}_0x5308ec=_[_0xcd8c('0x3c')]({},_0x5308ec,_0x5193a1[_0xcd8c('0x3e')]);var _0x2bafaa={'where':_0x5308ec[_0xcd8c('0x39')]};return db[_0xcd8c('0x2b')]['count'](_0x2bafaa)[_0xcd8c('0x23')](function(_0x463449){_0x57d59b[_0xcd8c('0x1f')]=_0x463449;if(_0x5193a1[_0xcd8c('0x30')][_0xcd8c('0x3f')]){_0x5308ec['include']=[{'all':!![]}];}return db[_0xcd8c('0x2b')][_0xcd8c('0x40')](_0x5308ec);})[_0xcd8c('0x23')](function(_0x4133ee){_0x57d59b['rows']=_0x4133ee;return _0x57d59b;})[_0xcd8c('0x23')](respondWithFilteredResult(_0x36c342,_0x5308ec))[_0xcd8c('0x41')](handleError(_0x36c342,null));};exports['show']=function(_0x27cd8c,_0x5a82e9){var _0x3ff9c1={'raw':!![],'where':{'id':_0x27cd8c['params']['id']}},_0xdad105={};_0xdad105[_0xcd8c('0x32')]=_['keys'](db[_0xcd8c('0x2b')]['rawAttributes']);_0xdad105[_0xcd8c('0x30')]=_[_0xcd8c('0x42')](_0x27cd8c['query']);_0xdad105['filters']=_[_0xcd8c('0x43')](_0xdad105[_0xcd8c('0x32')],_0xdad105[_0xcd8c('0x30')]);_0x3ff9c1[_0xcd8c('0x33')]=_[_0xcd8c('0x43')](_0xdad105['model'],qs[_0xcd8c('0x34')](_0x27cd8c[_0xcd8c('0x30')][_0xcd8c('0x34')]));_0x3ff9c1[_0xcd8c('0x33')]=_0x3ff9c1['attributes'][_0xcd8c('0x35')]?_0x3ff9c1[_0xcd8c('0x33')]:_0xdad105[_0xcd8c('0x32')];if(_0x27cd8c[_0xcd8c('0x30')][_0xcd8c('0x3f')]){_0x3ff9c1[_0xcd8c('0x44')]=[{'all':!![]}];}_0x3ff9c1=_[_0xcd8c('0x3c')]({},_0x3ff9c1,_0x27cd8c[_0xcd8c('0x3e')]);return db[_0xcd8c('0x2b')]['find'](_0x3ff9c1)['then'](handleEntityNotFound(_0x5a82e9,null))[_0xcd8c('0x23')](respondWithResult(_0x5a82e9,null))['catch'](handleError(_0x5a82e9,null));};exports[_0xcd8c('0x45')]=function(_0x4172df,_0x26632d){return db[_0xcd8c('0x2b')][_0xcd8c('0x45')](_0x4172df[_0xcd8c('0x46')],{})[_0xcd8c('0x23')](respondWithResult(_0x26632d,0xc9))[_0xcd8c('0x41')](handleError(_0x26632d,null));};exports['update']=function(_0x4d0e00,_0x59bf3e){if(_0x4d0e00[_0xcd8c('0x46')]['id']){delete _0x4d0e00[_0xcd8c('0x46')]['id'];}return db[_0xcd8c('0x2b')]['find']({'where':{'id':_0x4d0e00[_0xcd8c('0x47')]['id']}})['then'](handleEntityNotFound(_0x59bf3e,null))[_0xcd8c('0x23')](saveUpdates(_0x4d0e00['body'],null))['then'](respondWithResult(_0x59bf3e,null))[_0xcd8c('0x41')](handleError(_0x59bf3e,null));};exports[_0xcd8c('0x24')]=function(_0x980915,_0x497472){return db[_0xcd8c('0x2b')]['find']({'where':{'id':_0x980915['params']['id']}})[_0xcd8c('0x23')](handleEntityNotFound(_0x497472,null))[_0xcd8c('0x23')](removeEntity(_0x497472,null))['catch'](handleError(_0x497472,null));};exports[_0xcd8c('0x48')]=function(_0x3cac73,_0x4eeb27){return db['FaxQueueReport'][_0xcd8c('0x48')]()['then'](respondWithResult(_0x4eeb27,null))[_0xcd8c('0x41')](handleError(_0x4eeb27,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b8a1bd8..ee467d4 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x814b,0x1a2));var _0xb814=function(_0x11de83,_0x49e1c1){_0x11de83=_0x11de83-0x0;var _0x45bdb0=_0x814b[_0x11de83];return _0x45bdb0;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x11ae20,_0x33e9d6){var _0x2f0cd0=function(_0x8589e4){while(--_0x8589e4){_0x11ae20['push'](_0x11ae20['shift']());}};_0x2f0cd0(++_0x33e9d6);}(_0x326f,0xd1));var _0xf326=function(_0x26efba,_0x1d38e5){_0x26efba=_0x26efba-0x0;var _0x25ee82=_0x326f[_0x26efba];return _0x25ee82;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7915e26..83f6986 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 _0x4605=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','catch','UpdateFaxQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x17b76b,_0x205f27){var _0x23994d=function(_0x2e74e6){while(--_0x2e74e6){_0x17b76b['push'](_0x17b76b['shift']());}};_0x23994d(++_0x205f27);}(_0x4605,0x15e));var _0x5460=function(_0x2716c6,_0x38dd17){_0x2716c6=_0x2716c6-0x0;var _0x518dc2=_0x4605[_0x2716c6];return _0x518dc2;};'use strict';var _=require(_0x5460('0x0'));var util=require('util');var moment=require(_0x5460('0x1'));var BPromise=require(_0x5460('0x2'));var rs=require(_0x5460('0x3'));var fs=require('fs');var Redis=require(_0x5460('0x4'));var db=require(_0x5460('0x5'))['db'];var utils=require(_0x5460('0x6'));var logger=require(_0x5460('0x7'))(_0x5460('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5460('0x9')][_0x5460('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x516811,_0x42e13a,_0x4a03d3){return new BPromise(function(_0x4810e0,_0x48dcbc){return client[_0x5460('0xb')](_0x516811,_0x4a03d3)[_0x5460('0xc')](function(_0x157baf){logger[_0x5460('0xd')](_0x5460('0xe'),_0x42e13a,_0x5460('0xf'));logger[_0x5460('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x42e13a,_0x5460('0xf'),JSON[_0x5460('0x11')](_0x157baf));if(_0x157baf[_0x5460('0x12')]){if(_0x157baf['error'][_0x5460('0x13')]===0x1f4){logger[_0x5460('0x12')](_0x5460('0xe'),_0x42e13a,_0x157baf['error'][_0x5460('0x14')]);return _0x48dcbc(_0x157baf['error'][_0x5460('0x14')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x42e13a,_0x157baf[_0x5460('0x12')][_0x5460('0x14')]);return _0x4810e0(_0x157baf[_0x5460('0x12')][_0x5460('0x14')]);}else{logger[_0x5460('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x42e13a,_0x5460('0xf'));_0x4810e0(_0x157baf[_0x5460('0x15')][_0x5460('0x14')]);}})['catch'](function(_0xbfd958){logger[_0x5460('0x12')](_0x5460('0xe'),_0x42e13a,_0xbfd958);_0x48dcbc(_0xbfd958);});});}exports[_0x5460('0x16')]=function(_0x43c861){var _0xbde11=this;return new Promise(function(_0x226ba6,_0x59db9d){return db[_0x5460('0x17')][_0x5460('0x18')](_0x43c861[_0x5460('0x19')],{'raw':_0x43c861[_0x5460('0x1a')]?_0x43c861[_0x5460('0x1a')][_0x5460('0x1b')]===undefined?!![]:![]:!![]})[_0x5460('0xc')](function(_0xc9c409){logger['info'](_0x5460('0x16'),_0x43c861);logger['debug'](_0x5460('0x16'),_0x43c861,JSON[_0x5460('0x11')](_0xc9c409));_0x226ba6(_0xc9c409);})[_0x5460('0x1c')](function(_0x581487){logger[_0x5460('0x12')](_0x5460('0x16'),_0x581487[_0x5460('0x14')],_0x43c861);_0x59db9d(_0xbde11[_0x5460('0x12')](0x1f4,_0x581487[_0x5460('0x14')]));});});};exports[_0x5460('0x1d')]=function(_0xad08b5){var _0x1b8625=this;return new Promise(function(_0x4bcc75,_0xef9fd7){return db[_0x5460('0x17')][_0x5460('0x1e')](_0xad08b5[_0x5460('0x19')],{'raw':_0xad08b5['options']?_0xad08b5[_0x5460('0x1a')][_0x5460('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xad08b5[_0x5460('0x1a')]?_0xad08b5['options'][_0x5460('0x1f')]||null:null,'attributes':_0xad08b5[_0x5460('0x1a')]?_0xad08b5[_0x5460('0x1a')][_0x5460('0x20')]||null:null,'limit':_0xad08b5['options']?_0xad08b5['options']['limit']||null:null})[_0x5460('0xc')](function(_0x456a0c){logger[_0x5460('0xd')](_0x5460('0x1d'),_0xad08b5);logger['debug'](_0x5460('0x1d'),_0xad08b5,JSON['stringify'](_0x456a0c));_0x4bcc75(_0x456a0c);})[_0x5460('0x1c')](function(_0x13d555){logger['error']('UpdateFaxQueueReport',_0x13d555[_0x5460('0x14')],_0xad08b5);_0xef9fd7(_0x1b8625[_0x5460('0x12')](0x1f4,_0x13d555[_0x5460('0x14')]));});});}; \ No newline at end of file +var _0xdbf9=['CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','attributes','limit','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x897a62,_0x47cafd){var _0x3f0173=function(_0x31fe2a){while(--_0x31fe2a){_0x897a62['push'](_0x897a62['shift']());}};_0x3f0173(++_0x47cafd);}(_0xdbf9,0x16b));var _0x9dbf=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xdbf9[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x9dbf('0x0'));var util=require('util');var moment=require(_0x9dbf('0x1'));var BPromise=require(_0x9dbf('0x2'));var rs=require(_0x9dbf('0x3'));var fs=require('fs');var Redis=require(_0x9dbf('0x4'));var db=require(_0x9dbf('0x5'))['db'];var utils=require(_0x9dbf('0x6'));var logger=require(_0x9dbf('0x7'))(_0x9dbf('0x8'));var config=require(_0x9dbf('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53e3a0,_0x56d57e,_0x82819f){return new BPromise(function(_0x56997a,_0x23e36b){return client['request'](_0x53e3a0,_0x82819f)[_0x9dbf('0xb')](function(_0x5b6dfc){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x56d57e,_0x9dbf('0xc'));logger[_0x9dbf('0xd')](_0x9dbf('0xe'),_0x56d57e,'request\x20sent',JSON[_0x9dbf('0xf')](_0x5b6dfc));if(_0x5b6dfc[_0x9dbf('0x10')]){if(_0x5b6dfc[_0x9dbf('0x10')]['code']===0x1f4){logger['error'](_0x9dbf('0x11'),_0x56d57e,_0x5b6dfc[_0x9dbf('0x10')][_0x9dbf('0x12')]);return _0x23e36b(_0x5b6dfc['error'][_0x9dbf('0x12')]);}logger[_0x9dbf('0x10')](_0x9dbf('0x11'),_0x56d57e,_0x5b6dfc['error']['message']);return _0x56997a(_0x5b6dfc[_0x9dbf('0x10')][_0x9dbf('0x12')]);}else{logger['info'](_0x9dbf('0x11'),_0x56d57e,_0x9dbf('0xc'));_0x56997a(_0x5b6dfc[_0x9dbf('0x13')][_0x9dbf('0x12')]);}})[_0x9dbf('0x14')](function(_0x4e82a3){logger[_0x9dbf('0x10')](_0x9dbf('0x11'),_0x56d57e,_0x4e82a3);_0x23e36b(_0x4e82a3);});});}exports[_0x9dbf('0x15')]=function(_0x5d80f0){var _0x196458=this;return new Promise(function(_0x48f869,_0xd4fbf7){return db['FaxQueueReport'][_0x9dbf('0x16')](_0x5d80f0[_0x9dbf('0x17')],{'raw':_0x5d80f0[_0x9dbf('0x18')]?_0x5d80f0['options'][_0x9dbf('0x19')]===undefined?!![]:![]:!![]})[_0x9dbf('0xb')](function(_0x5cd533){logger['info'](_0x9dbf('0x15'),_0x5d80f0);logger[_0x9dbf('0xd')]('CreateFaxQueueReport',_0x5d80f0,JSON[_0x9dbf('0xf')](_0x5cd533));_0x48f869(_0x5cd533);})['catch'](function(_0x15df1f){logger[_0x9dbf('0x10')](_0x9dbf('0x15'),_0x15df1f['message'],_0x5d80f0);_0xd4fbf7(_0x196458[_0x9dbf('0x10')](0x1f4,_0x15df1f[_0x9dbf('0x12')]));});});};exports[_0x9dbf('0x1a')]=function(_0x354979){var _0x4e693e=this;return new Promise(function(_0x5a996b,_0x3b4680){return db[_0x9dbf('0x1b')][_0x9dbf('0x1c')](_0x354979[_0x9dbf('0x17')],{'raw':_0x354979[_0x9dbf('0x18')]?_0x354979['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x354979[_0x9dbf('0x18')]?_0x354979[_0x9dbf('0x18')]['where']||null:null,'attributes':_0x354979[_0x9dbf('0x18')]?_0x354979[_0x9dbf('0x18')][_0x9dbf('0x1d')]||null:null,'limit':_0x354979[_0x9dbf('0x18')]?_0x354979['options'][_0x9dbf('0x1e')]||null:null})['then'](function(_0x4eb526){logger[_0x9dbf('0x1f')](_0x9dbf('0x1a'),_0x354979);logger[_0x9dbf('0xd')]('UpdateFaxQueueReport',_0x354979,JSON['stringify'](_0x4eb526));_0x5a996b(_0x4eb526);})[_0x9dbf('0x14')](function(_0x1ab6ef){logger['error'](_0x9dbf('0x1a'),_0x1ab6ef[_0x9dbf('0x12')],_0x354979);_0x3b4680(_0x4e693e['error'](0x1f4,_0x1ab6ef[_0x9dbf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 2f0ac05..da78a7a 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 _0xe9c8=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','multer','util'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0xe9c8,0x13e));var _0x8e9c=function(_0x2d304d,_0x462fb5){_0x2d304d=_0x2d304d-0x0;var _0x16be9a=_0xe9c8[_0x2d304d];return _0x16be9a;};'use strict';var multer=require(_0x8e9c('0x0'));var util=require(_0x8e9c('0x1'));var path=require(_0x8e9c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e9c('0x3')]();var fs_extra=require(_0x8e9c('0x4'));var auth=require(_0x8e9c('0x5'));var interaction=require(_0x8e9c('0x6'));var config=require(_0x8e9c('0x7'));var controller=require(_0x8e9c('0x8'));router[_0x8e9c('0x9')]('/',auth['isAuthenticated'](),controller[_0x8e9c('0xa')]);router[_0x8e9c('0x9')](_0x8e9c('0xb'),auth[_0x8e9c('0xc')](),controller[_0x8e9c('0xd')]);router[_0x8e9c('0x9')](_0x8e9c('0xe'),auth['isAuthenticated'](),controller[_0x8e9c('0xf')]);router[_0x8e9c('0x10')]('/',auth[_0x8e9c('0xc')](),controller[_0x8e9c('0x11')]);router[_0x8e9c('0x12')](_0x8e9c('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8e9c('0xe'),auth['isAuthenticated'](),controller[_0x8e9c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa002=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0xa83ac6,_0x5c46aa){var _0x32da9c=function(_0x230275){while(--_0x230275){_0xa83ac6['push'](_0xa83ac6['shift']());}};_0x32da9c(++_0x5c46aa);}(_0xa002,0x142));var _0x2a00=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa002[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0x2a00('0x0'));var path=require(_0x2a00('0x1'));var timeout=require(_0x2a00('0x2'));var express=require(_0x2a00('0x3'));var router=express[_0x2a00('0x4')]();var fs_extra=require(_0x2a00('0x5'));var auth=require(_0x2a00('0x6'));var interaction=require(_0x2a00('0x7'));var config=require(_0x2a00('0x8'));var controller=require(_0x2a00('0x9'));router[_0x2a00('0xa')]('/',auth['isAuthenticated'](),controller[_0x2a00('0xb')]);router[_0x2a00('0xa')](_0x2a00('0xc'),auth[_0x2a00('0xd')](),controller[_0x2a00('0xe')]);router[_0x2a00('0xa')](_0x2a00('0xf'),auth['isAuthenticated'](),controller[_0x2a00('0x10')]);router[_0x2a00('0x11')]('/',auth[_0x2a00('0xd')](),controller[_0x2a00('0x12')]);router[_0x2a00('0x13')](_0x2a00('0xf'),auth['isAuthenticated'](),controller[_0x2a00('0x14')]);router['delete']('/:id',auth[_0x2a00('0xd')](),controller[_0x2a00('0x15')]);module[_0x2a00('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d46116f..9221642 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x14f5c3,_0x1e3047){var _0x2ea070=function(_0x1c8cd4){while(--_0x1c8cd4){_0x14f5c3['push'](_0x14f5c3['shift']());}};_0x2ea070(++_0x1e3047);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_0x54ef,0x112));var _0xf54e=function(_0x43b8d6,_0x192f53){_0x43b8d6=_0x43b8d6-0x0;var _0x1eefac=_0x54ef[_0x43b8d6];return _0x1eefac;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 7719201..3c8beb3 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 _0xeee1=['rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','include','rows','catch','show','params','merge','options','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','FaxTransferReport'];(function(_0x14c091,_0x171463){var _0x487ad6=function(_0x58863a){while(--_0x58863a){_0x14c091['push'](_0x14c091['shift']());}};_0x487ad6(++_0x171463);}(_0xeee1,0x10d));var _0x1eee=function(_0x5c2fc6,_0x3388aa){_0x5c2fc6=_0x5c2fc6-0x0;var _0x1b2346=_0xeee1[_0x5c2fc6];return _0x1b2346;};'use strict';var emlformat=require(_0x1eee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1eee('0x1'));var jsonpatch=require(_0x1eee('0x2'));var rp=require(_0x1eee('0x3'));var moment=require(_0x1eee('0x4'));var BPromise=require(_0x1eee('0x5'));var Mustache=require(_0x1eee('0x6'));var util=require(_0x1eee('0x7'));var path=require(_0x1eee('0x8'));var sox=require(_0x1eee('0x9'));var csv=require(_0x1eee('0xa'));var ejs=require(_0x1eee('0xb'));var fs=require('fs');var fs_extra=require(_0x1eee('0xc'));var _=require(_0x1eee('0xd'));var squel=require(_0x1eee('0xe'));var crypto=require(_0x1eee('0xf'));var jsforce=require(_0x1eee('0x10'));var deskjs=require(_0x1eee('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1eee('0x12'));var Papa=require(_0x1eee('0x13'));var Redis=require(_0x1eee('0x14'));var authService=require(_0x1eee('0x15'));var qs=require(_0x1eee('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1eee('0x17'));var logger=require(_0x1eee('0x18'))(_0x1eee('0x19'));var utils=require(_0x1eee('0x1a'));var config=require(_0x1eee('0x1b'));var licenseUtil=require(_0x1eee('0x1c'));var db=require(_0x1eee('0x1d'))['db'];function respondWithStatusCode(_0x1f440c,_0x583d77){_0x583d77=_0x583d77||0xcc;return function(_0xdbdc90){if(_0xdbdc90){return _0x1f440c['sendStatus'](_0x583d77);}return _0x1f440c[_0x1eee('0x1e')](_0x583d77)[_0x1eee('0x1f')]();};}function respondWithResult(_0x27a056,_0x2ab810){_0x2ab810=_0x2ab810||0xc8;return function(_0x1f93e8){if(_0x1f93e8){return _0x27a056[_0x1eee('0x1e')](_0x2ab810)[_0x1eee('0x20')](_0x1f93e8);}};}function respondWithFilteredResult(_0x10bd2f,_0x50198a){return function(_0x501d16){if(_0x501d16){var _0xd01924=typeof _0x50198a[_0x1eee('0x21')]==='undefined'&&typeof _0x50198a[_0x1eee('0x22')]==='undefined';var _0x2692a8=_0x501d16['count'];var _0x41113b=_0xd01924?0x0:_0x50198a['offset'];var _0x1b105c=_0xd01924?_0x501d16[_0x1eee('0x23')]:_0x50198a['offset']+_0x50198a[_0x1eee('0x22')];var _0x209911;if(_0x1b105c>=_0x2692a8){_0x1b105c=_0x2692a8;_0x209911=0xc8;}else{_0x209911=0xce;}_0x10bd2f[_0x1eee('0x1e')](_0x209911);return _0x10bd2f[_0x1eee('0x24')](_0x1eee('0x25'),_0x41113b+'-'+_0x1b105c+'/'+_0x2692a8)[_0x1eee('0x20')](_0x501d16);}return null;};}function patchUpdates(_0x30bec3){return function(_0x1f5d60){try{jsonpatch[_0x1eee('0x26')](_0x1f5d60,_0x30bec3,!![]);}catch(_0x1ab807){return BPromise['reject'](_0x1ab807);}return _0x1f5d60[_0x1eee('0x27')]();};}function saveUpdates(_0x2a1042,_0x581865){return function(_0x3862b7){if(_0x3862b7){return _0x3862b7[_0x1eee('0x28')](_0x2a1042)[_0x1eee('0x29')](function(_0x3af25c){return _0x3af25c;});}return null;};}function removeEntity(_0x3d70da,_0x3d705c){return function(_0x20d937){if(_0x20d937){return _0x20d937['destroy']()[_0x1eee('0x29')](function(){_0x3d70da[_0x1eee('0x1e')](0xcc)[_0x1eee('0x1f')]();});}};}function handleEntityNotFound(_0x2aaec6,_0x4fd33f){return function(_0x23c84e){if(!_0x23c84e){_0x2aaec6[_0x1eee('0x2a')](0x194);}return _0x23c84e;};}function handleError(_0x432dfa,_0x398d4a){_0x398d4a=_0x398d4a||0x1f4;return function(_0x47e209){logger[_0x1eee('0x2b')](_0x47e209[_0x1eee('0x2c')]);if(_0x47e209[_0x1eee('0x2d')]){delete _0x47e209[_0x1eee('0x2d')];}_0x432dfa['status'](_0x398d4a)['send'](_0x47e209);};}exports['index']=function(_0x1db46f,_0x56a5a9){var _0x1e810a={},_0x4e38f2={},_0xbd1a58={'count':0x0,'rows':[]};var _0x485351=_['map'](db[_0x1eee('0x2e')][_0x1eee('0x2f')],function(_0x170bb3){return{'name':_0x170bb3[_0x1eee('0x30')],'type':_0x170bb3[_0x1eee('0x31')][_0x1eee('0x32')]};});_0x4e38f2['model']=_[_0x1eee('0x33')](_0x485351,_0x1eee('0x2d'));_0x4e38f2[_0x1eee('0x34')]=_[_0x1eee('0x35')](_0x1db46f[_0x1eee('0x34')]);_0x4e38f2['filters']=_[_0x1eee('0x36')](_0x4e38f2[_0x1eee('0x37')],_0x4e38f2[_0x1eee('0x34')]);_0x1e810a['attributes']=_['intersection'](_0x4e38f2[_0x1eee('0x37')],qs[_0x1eee('0x38')](_0x1db46f['query']['fields']));_0x1e810a[_0x1eee('0x39')]=_0x1e810a['attributes'][_0x1eee('0x3a')]?_0x1e810a[_0x1eee('0x39')]:_0x4e38f2['model'];if(!_0x1db46f[_0x1eee('0x34')]['hasOwnProperty'](_0x1eee('0x3b'))){_0x1e810a[_0x1eee('0x22')]=qs[_0x1eee('0x22')](_0x1db46f[_0x1eee('0x34')][_0x1eee('0x22')]);_0x1e810a['offset']=qs[_0x1eee('0x21')](_0x1db46f[_0x1eee('0x34')][_0x1eee('0x21')]);}_0x1e810a[_0x1eee('0x3c')]=qs[_0x1eee('0x3d')](_0x1db46f[_0x1eee('0x34')]['sort']);_0x1e810a[_0x1eee('0x3e')]=qs[_0x1eee('0x3f')](_[_0x1eee('0x40')](_0x1db46f[_0x1eee('0x34')],_0x4e38f2['filters']),_0x485351);if(_0x1db46f[_0x1eee('0x34')][_0x1eee('0x41')]){_0x1e810a[_0x1eee('0x3e')]=_['merge'](_0x1e810a['where'],{'$or':_[_0x1eee('0x33')](_0x485351,function(_0x2b22dc){if(_0x2b22dc[_0x1eee('0x31')]!==_0x1eee('0x42')){var _0x12a515={};_0x12a515[_0x2b22dc[_0x1eee('0x2d')]]={'$like':'%'+_0x1db46f[_0x1eee('0x34')][_0x1eee('0x41')]+'%'};return _0x12a515;}})});}_0x1e810a=_['merge']({},_0x1e810a,_0x1db46f['options']);var _0x4415f5={'where':_0x1e810a[_0x1eee('0x3e')]};return db[_0x1eee('0x2e')][_0x1eee('0x23')](_0x4415f5)['then'](function(_0x4782eb){_0xbd1a58[_0x1eee('0x23')]=_0x4782eb;if(_0x1db46f[_0x1eee('0x34')]['includeAll']){_0x1e810a[_0x1eee('0x43')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1e810a);})[_0x1eee('0x29')](function(_0x7c89b){_0xbd1a58[_0x1eee('0x44')]=_0x7c89b;return _0xbd1a58;})[_0x1eee('0x29')](respondWithFilteredResult(_0x56a5a9,_0x1e810a))[_0x1eee('0x45')](handleError(_0x56a5a9,null));};exports[_0x1eee('0x46')]=function(_0x5328b0,_0x45f511){var _0x7f3c82={'raw':!![],'where':{'id':_0x5328b0[_0x1eee('0x47')]['id']}},_0x2693cb={};_0x2693cb[_0x1eee('0x37')]=_[_0x1eee('0x35')](db[_0x1eee('0x2e')][_0x1eee('0x2f')]);_0x2693cb[_0x1eee('0x34')]=_[_0x1eee('0x35')](_0x5328b0[_0x1eee('0x34')]);_0x2693cb[_0x1eee('0x3f')]=_[_0x1eee('0x36')](_0x2693cb['model'],_0x2693cb[_0x1eee('0x34')]);_0x7f3c82[_0x1eee('0x39')]=_[_0x1eee('0x36')](_0x2693cb[_0x1eee('0x37')],qs[_0x1eee('0x38')](_0x5328b0[_0x1eee('0x34')]['fields']));_0x7f3c82['attributes']=_0x7f3c82[_0x1eee('0x39')][_0x1eee('0x3a')]?_0x7f3c82[_0x1eee('0x39')]:_0x2693cb[_0x1eee('0x37')];if(_0x5328b0[_0x1eee('0x34')]['includeAll']){_0x7f3c82[_0x1eee('0x43')]=[{'all':!![]}];}_0x7f3c82=_[_0x1eee('0x48')]({},_0x7f3c82,_0x5328b0[_0x1eee('0x49')]);return db[_0x1eee('0x2e')][_0x1eee('0x4a')](_0x7f3c82)[_0x1eee('0x29')](handleEntityNotFound(_0x45f511,null))[_0x1eee('0x29')](respondWithResult(_0x45f511,null))['catch'](handleError(_0x45f511,null));};exports[_0x1eee('0x4b')]=function(_0x19be29,_0x4ffdc0){return db['FaxTransferReport'][_0x1eee('0x4b')](_0x19be29[_0x1eee('0x4c')],{})[_0x1eee('0x29')](respondWithResult(_0x4ffdc0,0xc9))[_0x1eee('0x45')](handleError(_0x4ffdc0,null));};exports[_0x1eee('0x28')]=function(_0x568c2c,_0x71d6bf){if(_0x568c2c[_0x1eee('0x4c')]['id']){delete _0x568c2c['body']['id'];}return db[_0x1eee('0x2e')][_0x1eee('0x4a')]({'where':{'id':_0x568c2c['params']['id']}})[_0x1eee('0x29')](handleEntityNotFound(_0x71d6bf,null))[_0x1eee('0x29')](saveUpdates(_0x568c2c[_0x1eee('0x4c')],null))['then'](respondWithResult(_0x71d6bf,null))[_0x1eee('0x45')](handleError(_0x71d6bf,null));};exports[_0x1eee('0x4d')]=function(_0x4f5e35,_0x29099e){return db[_0x1eee('0x2e')][_0x1eee('0x4a')]({'where':{'id':_0x4f5e35[_0x1eee('0x47')]['id']}})['then'](handleEntityNotFound(_0x29099e,null))[_0x1eee('0x29')](removeEntity(_0x29099e,null))[_0x1eee('0x45')](handleError(_0x29099e,null));};exports[_0x1eee('0x4e')]=function(_0x43b4f9,_0x4caaf4){return db[_0x1eee('0x2e')][_0x1eee('0x4e')]()[_0x1eee('0x29')](respondWithResult(_0x4caaf4,null))[_0x1eee('0x45')](handleError(_0x4caaf4,null));}; \ No newline at end of file +var _0xc331=['body','update','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','error','stack','name','send','index','map','FaxTransferReport','fieldName','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','options','includeAll','include','findAll','then','rows','catch','params','keys','rawAttributes','merge','create'];(function(_0xf1e404,_0x113875){var _0x96b748=function(_0xf4827c){while(--_0xf4827c){_0xf1e404['push'](_0xf1e404['shift']());}};_0x96b748(++_0x113875);}(_0xc331,0xe6));var _0x1c33=function(_0xf0b2e3,_0x2da7e1){_0xf0b2e3=_0xf0b2e3-0x0;var _0x431c7d=_0xc331[_0xf0b2e3];return _0x431c7d;};'use strict';var emlformat=require(_0x1c33('0x0'));var rimraf=require(_0x1c33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c33('0x2'));var rp=require(_0x1c33('0x3'));var moment=require(_0x1c33('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c33('0x5'));var util=require(_0x1c33('0x6'));var path=require('path');var sox=require(_0x1c33('0x7'));var csv=require('to-csv');var ejs=require(_0x1c33('0x8'));var fs=require('fs');var fs_extra=require(_0x1c33('0x9'));var _=require(_0x1c33('0xa'));var squel=require(_0x1c33('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c33('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c33('0xd'));var querystring=require(_0x1c33('0xe'));var Papa=require(_0x1c33('0xf'));var Redis=require(_0x1c33('0x10'));var authService=require(_0x1c33('0x11'));var qs=require(_0x1c33('0x12'));var as=require(_0x1c33('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c33('0x14'))('api');var utils=require(_0x1c33('0x15'));var config=require(_0x1c33('0x16'));var licenseUtil=require(_0x1c33('0x17'));var db=require(_0x1c33('0x18'))['db'];function respondWithStatusCode(_0xa91168,_0x311246){_0x311246=_0x311246||0xcc;return function(_0x268adf){if(_0x268adf){return _0xa91168[_0x1c33('0x19')](_0x311246);}return _0xa91168[_0x1c33('0x1a')](_0x311246)[_0x1c33('0x1b')]();};}function respondWithResult(_0x45ffc3,_0x579323){_0x579323=_0x579323||0xc8;return function(_0x30692d){if(_0x30692d){return _0x45ffc3[_0x1c33('0x1a')](_0x579323)[_0x1c33('0x1c')](_0x30692d);}};}function respondWithFilteredResult(_0x1eadb0,_0x2b85d8){return function(_0xd3161d){if(_0xd3161d){var _0x3544d4=typeof _0x2b85d8[_0x1c33('0x1d')]===_0x1c33('0x1e')&&typeof _0x2b85d8[_0x1c33('0x1f')]===_0x1c33('0x1e');var _0x442ac0=_0xd3161d[_0x1c33('0x20')];var _0x55520f=_0x3544d4?0x0:_0x2b85d8[_0x1c33('0x1d')];var _0x5857ed=_0x3544d4?_0xd3161d[_0x1c33('0x20')]:_0x2b85d8[_0x1c33('0x1d')]+_0x2b85d8[_0x1c33('0x1f')];var _0x576122;if(_0x5857ed>=_0x442ac0){_0x5857ed=_0x442ac0;_0x576122=0xc8;}else{_0x576122=0xce;}_0x1eadb0['status'](_0x576122);return _0x1eadb0['set'](_0x1c33('0x21'),_0x55520f+'-'+_0x5857ed+'/'+_0x442ac0)[_0x1c33('0x1c')](_0xd3161d);}return null;};}function patchUpdates(_0x4531b2){return function(_0x50279d){try{jsonpatch[_0x1c33('0x22')](_0x50279d,_0x4531b2,!![]);}catch(_0x48906e){return BPromise['reject'](_0x48906e);}return _0x50279d[_0x1c33('0x23')]();};}function saveUpdates(_0x3b5795,_0x567ca3){return function(_0x590135){if(_0x590135){return _0x590135['update'](_0x3b5795)['then'](function(_0x1b434a){return _0x1b434a;});}return null;};}function removeEntity(_0x2d4f30,_0x4b4a90){return function(_0x5a1762){if(_0x5a1762){return _0x5a1762['destroy']()['then'](function(){_0x2d4f30[_0x1c33('0x1a')](0xcc)[_0x1c33('0x1b')]();});}};}function handleEntityNotFound(_0x350b46,_0x377180){return function(_0x5ceb1c){if(!_0x5ceb1c){_0x350b46[_0x1c33('0x19')](0x194);}return _0x5ceb1c;};}function handleError(_0x29023b,_0x26cebf){_0x26cebf=_0x26cebf||0x1f4;return function(_0x3018b5){logger[_0x1c33('0x24')](_0x3018b5[_0x1c33('0x25')]);if(_0x3018b5[_0x1c33('0x26')]){delete _0x3018b5[_0x1c33('0x26')];}_0x29023b['status'](_0x26cebf)[_0x1c33('0x27')](_0x3018b5);};}exports[_0x1c33('0x28')]=function(_0x8e2b30,_0x3c6486){var _0x128888={},_0x111e1b={},_0x36a0a6={'count':0x0,'rows':[]};var _0x12941e=_[_0x1c33('0x29')](db[_0x1c33('0x2a')]['rawAttributes'],function(_0x4b24ae){return{'name':_0x4b24ae[_0x1c33('0x2b')],'type':_0x4b24ae['type'][_0x1c33('0x2c')]};});_0x111e1b['model']=_[_0x1c33('0x29')](_0x12941e,_0x1c33('0x26'));_0x111e1b[_0x1c33('0x2d')]=_['keys'](_0x8e2b30[_0x1c33('0x2d')]);_0x111e1b[_0x1c33('0x2e')]=_[_0x1c33('0x2f')](_0x111e1b[_0x1c33('0x30')],_0x111e1b[_0x1c33('0x2d')]);_0x128888['attributes']=_[_0x1c33('0x2f')](_0x111e1b[_0x1c33('0x30')],qs[_0x1c33('0x31')](_0x8e2b30[_0x1c33('0x2d')][_0x1c33('0x31')]));_0x128888[_0x1c33('0x32')]=_0x128888[_0x1c33('0x32')][_0x1c33('0x33')]?_0x128888[_0x1c33('0x32')]:_0x111e1b['model'];if(!_0x8e2b30[_0x1c33('0x2d')][_0x1c33('0x34')](_0x1c33('0x35'))){_0x128888[_0x1c33('0x1f')]=qs[_0x1c33('0x1f')](_0x8e2b30[_0x1c33('0x2d')][_0x1c33('0x1f')]);_0x128888['offset']=qs['offset'](_0x8e2b30[_0x1c33('0x2d')][_0x1c33('0x1d')]);}_0x128888[_0x1c33('0x36')]=qs[_0x1c33('0x37')](_0x8e2b30['query'][_0x1c33('0x37')]);_0x128888[_0x1c33('0x38')]=qs[_0x1c33('0x2e')](_[_0x1c33('0x39')](_0x8e2b30[_0x1c33('0x2d')],_0x111e1b['filters']),_0x12941e);if(_0x8e2b30[_0x1c33('0x2d')]['filter']){_0x128888[_0x1c33('0x38')]=_['merge'](_0x128888[_0x1c33('0x38')],{'$or':_[_0x1c33('0x29')](_0x12941e,function(_0x4203cc){if(_0x4203cc['type']!=='VIRTUAL'){var _0x4006d9={};_0x4006d9[_0x4203cc[_0x1c33('0x26')]]={'$like':'%'+_0x8e2b30[_0x1c33('0x2d')]['filter']+'%'};return _0x4006d9;}})});}_0x128888=_['merge']({},_0x128888,_0x8e2b30[_0x1c33('0x3a')]);var _0x3e6830={'where':_0x128888[_0x1c33('0x38')]};return db[_0x1c33('0x2a')][_0x1c33('0x20')](_0x3e6830)['then'](function(_0x41fbd6){_0x36a0a6[_0x1c33('0x20')]=_0x41fbd6;if(_0x8e2b30[_0x1c33('0x2d')][_0x1c33('0x3b')]){_0x128888[_0x1c33('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x1c33('0x3d')](_0x128888);})[_0x1c33('0x3e')](function(_0x638dd8){_0x36a0a6[_0x1c33('0x3f')]=_0x638dd8;return _0x36a0a6;})['then'](respondWithFilteredResult(_0x3c6486,_0x128888))[_0x1c33('0x40')](handleError(_0x3c6486,null));};exports['show']=function(_0x5ac281,_0x58ef6c){var _0x1e8567={'raw':!![],'where':{'id':_0x5ac281[_0x1c33('0x41')]['id']}},_0x5b3c27={};_0x5b3c27['model']=_[_0x1c33('0x42')](db[_0x1c33('0x2a')][_0x1c33('0x43')]);_0x5b3c27['query']=_['keys'](_0x5ac281['query']);_0x5b3c27[_0x1c33('0x2e')]=_[_0x1c33('0x2f')](_0x5b3c27[_0x1c33('0x30')],_0x5b3c27['query']);_0x1e8567[_0x1c33('0x32')]=_[_0x1c33('0x2f')](_0x5b3c27['model'],qs['fields'](_0x5ac281['query'][_0x1c33('0x31')]));_0x1e8567[_0x1c33('0x32')]=_0x1e8567[_0x1c33('0x32')][_0x1c33('0x33')]?_0x1e8567[_0x1c33('0x32')]:_0x5b3c27[_0x1c33('0x30')];if(_0x5ac281[_0x1c33('0x2d')][_0x1c33('0x3b')]){_0x1e8567[_0x1c33('0x3c')]=[{'all':!![]}];}_0x1e8567=_[_0x1c33('0x44')]({},_0x1e8567,_0x5ac281[_0x1c33('0x3a')]);return db[_0x1c33('0x2a')]['find'](_0x1e8567)[_0x1c33('0x3e')](handleEntityNotFound(_0x58ef6c,null))[_0x1c33('0x3e')](respondWithResult(_0x58ef6c,null))[_0x1c33('0x40')](handleError(_0x58ef6c,null));};exports['create']=function(_0x4dc4e6,_0x1509b7){return db['FaxTransferReport'][_0x1c33('0x45')](_0x4dc4e6[_0x1c33('0x46')],{})['then'](respondWithResult(_0x1509b7,0xc9))[_0x1c33('0x40')](handleError(_0x1509b7,null));};exports[_0x1c33('0x47')]=function(_0x78669c,_0x378cbe){if(_0x78669c[_0x1c33('0x46')]['id']){delete _0x78669c['body']['id'];}return db[_0x1c33('0x2a')]['find']({'where':{'id':_0x78669c[_0x1c33('0x41')]['id']}})['then'](handleEntityNotFound(_0x378cbe,null))[_0x1c33('0x3e')](saveUpdates(_0x78669c[_0x1c33('0x46')],null))[_0x1c33('0x3e')](respondWithResult(_0x378cbe,null))['catch'](handleError(_0x378cbe,null));};exports[_0x1c33('0x48')]=function(_0x200c44,_0x5c0e16){return db['FaxTransferReport'][_0x1c33('0x49')]({'where':{'id':_0x200c44[_0x1c33('0x41')]['id']}})[_0x1c33('0x3e')](handleEntityNotFound(_0x5c0e16,null))['then'](removeEntity(_0x5c0e16,null))[_0x1c33('0x40')](handleError(_0x5c0e16,null));};exports[_0x1c33('0x4a')]=function(_0x2534a7,_0xcad1ca){return db[_0x1c33('0x2a')][_0x1c33('0x4a')]()['then'](respondWithResult(_0xcad1ca,null))[_0x1c33('0x40')](handleError(_0xcad1ca,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index bd2d109..179c216 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 _0xac80=['./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1a6fa0,_0x542237){var _0x246d52=function(_0x18fde3){while(--_0x18fde3){_0x1a6fa0['push'](_0x1a6fa0['shift']());}};_0x246d52(++_0x542237);}(_0xac80,0x163));var _0x0ac8=function(_0x402861,_0xd760fe){_0x402861=_0x402861-0x0;var _0x120aff=_0xac80[_0x402861];return _0x120aff;};'use strict';var _=require(_0x0ac8('0x0'));var util=require(_0x0ac8('0x1'));var logger=require(_0x0ac8('0x2'))(_0x0ac8('0x3'));var moment=require(_0x0ac8('0x4'));var BPromise=require(_0x0ac8('0x5'));var rp=require(_0x0ac8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ac8('0x7'));var config=require(_0x0ac8('0x8'));var attributes=require(_0x0ac8('0x9'));module[_0x0ac8('0xa')]=function(_0x2d7b5e,_0x3011a8){return _0x2d7b5e[_0x0ac8('0xb')](_0x0ac8('0xc'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0ac8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf326=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xf326,0xfd));var _0x6f32=function(_0x3d9b73,_0x332c82){_0x3d9b73=_0x3d9b73-0x0;var _0x1684b0=_0xf326[_0x3d9b73];return _0x1684b0;};'use strict';var _=require(_0x6f32('0x0'));var util=require('util');var logger=require(_0x6f32('0x1'))(_0x6f32('0x2'));var moment=require(_0x6f32('0x3'));var BPromise=require(_0x6f32('0x4'));var rp=require(_0x6f32('0x5'));var fs=require('fs');var path=require(_0x6f32('0x6'));var rimraf=require(_0x6f32('0x7'));var config=require(_0x6f32('0x8'));var attributes=require(_0x6f32('0x9'));module[_0x6f32('0xa')]=function(_0x48bbef,_0x4dfdb5){return _0x48bbef[_0x6f32('0xb')](_0x6f32('0xc'),attributes,{'tableName':_0x6f32('0xd'),'paranoid':![],'indexes':[{'name':_0x6f32('0xe'),'fields':[_0x6f32('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 51ea234..0a3fd28 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 _0xe176=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b1c49,_0x3083a2){var _0x582ac6=function(_0x4e51b5){while(--_0x4e51b5){_0x2b1c49['push'](_0x2b1c49['shift']());}};_0x582ac6(++_0x3083a2);}(_0xe176,0x146));var _0x6e17=function(_0x4cfa2e,_0x5752b5){_0x4cfa2e=_0x4cfa2e-0x0;var _0x279b50=_0xe176[_0x4cfa2e];return _0x279b50;};'use strict';var _=require(_0x6e17('0x0'));var util=require(_0x6e17('0x1'));var moment=require('moment');var BPromise=require(_0x6e17('0x2'));var rs=require(_0x6e17('0x3'));var fs=require('fs');var Redis=require(_0x6e17('0x4'));var db=require(_0x6e17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e17('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e17('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50fb3f,_0x521dc7,_0xd62603){return new BPromise(function(_0x505c19,_0x5531b2){return client[_0x6e17('0x8')](_0x50fb3f,_0xd62603)[_0x6e17('0x9')](function(_0x2ffff0){logger[_0x6e17('0xa')](_0x6e17('0xb'),_0x521dc7,_0x6e17('0xc'));logger[_0x6e17('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x521dc7,_0x6e17('0xc'),JSON[_0x6e17('0xe')](_0x2ffff0));if(_0x2ffff0[_0x6e17('0xf')]){if(_0x2ffff0[_0x6e17('0xf')][_0x6e17('0x10')]===0x1f4){logger[_0x6e17('0xf')](_0x6e17('0xb'),_0x521dc7,_0x2ffff0[_0x6e17('0xf')]['message']);return _0x5531b2(_0x2ffff0['error'][_0x6e17('0x11')]);}logger[_0x6e17('0xf')](_0x6e17('0xb'),_0x521dc7,_0x2ffff0[_0x6e17('0xf')][_0x6e17('0x11')]);return _0x505c19(_0x2ffff0[_0x6e17('0xf')][_0x6e17('0x11')]);}else{logger[_0x6e17('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x521dc7,'request\x20sent');_0x505c19(_0x2ffff0[_0x6e17('0x12')][_0x6e17('0x11')]);}})[_0x6e17('0x13')](function(_0x259608){logger[_0x6e17('0xf')](_0x6e17('0xb'),_0x521dc7,_0x259608);_0x5531b2(_0x259608);});});} \ No newline at end of file +var _0x5516=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5e5733,_0x18530d){var _0x46c69=function(_0x511600){while(--_0x511600){_0x5e5733['push'](_0x5e5733['shift']());}};_0x46c69(++_0x18530d);}(_0x5516,0x191));var _0x6551=function(_0x36ee10,_0x3e4e4b){_0x36ee10=_0x36ee10-0x0;var _0x1ae7e8=_0x5516[_0x36ee10];return _0x1ae7e8;};'use strict';var _=require(_0x6551('0x0'));var util=require(_0x6551('0x1'));var moment=require(_0x6551('0x2'));var BPromise=require(_0x6551('0x3'));var rs=require(_0x6551('0x4'));var fs=require('fs');var Redis=require(_0x6551('0x5'));var db=require(_0x6551('0x6'))['db'];var utils=require(_0x6551('0x7'));var logger=require('../../config/logger')(_0x6551('0x8'));var config=require(_0x6551('0x9'));var jayson=require(_0x6551('0xa'));var client=jayson[_0x6551('0xb')][_0x6551('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520095,_0x3e74f3,_0xd6d72d){return new BPromise(function(_0x261980,_0x6fe8cf){return client[_0x6551('0xd')](_0x520095,_0xd6d72d)['then'](function(_0x215ede){logger[_0x6551('0xe')](_0x6551('0xf'),_0x3e74f3,_0x6551('0x10'));logger[_0x6551('0x11')](_0x6551('0x12'),_0x3e74f3,_0x6551('0x10'),JSON[_0x6551('0x13')](_0x215ede));if(_0x215ede[_0x6551('0x14')]){if(_0x215ede[_0x6551('0x14')][_0x6551('0x15')]===0x1f4){logger[_0x6551('0x14')](_0x6551('0xf'),_0x3e74f3,_0x215ede[_0x6551('0x14')][_0x6551('0x16')]);return _0x6fe8cf(_0x215ede['error'][_0x6551('0x16')]);}logger[_0x6551('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x3e74f3,_0x215ede[_0x6551('0x14')][_0x6551('0x16')]);return _0x261980(_0x215ede['error']['message']);}else{logger[_0x6551('0xe')](_0x6551('0xf'),_0x3e74f3,_0x6551('0x10'));_0x261980(_0x215ede[_0x6551('0x17')][_0x6551('0x16')]);}})[_0x6551('0x18')](function(_0x1c7c99){logger[_0x6551('0x14')](_0x6551('0xf'),_0x3e74f3,_0x1c7c99);_0x6fe8cf(_0x1c7c99);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b30f69b..0b7daba 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 _0x64cc=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x2f366f,_0x52ad2e){var _0x49f9ab=function(_0x2fedd4){while(--_0x2fedd4){_0x2f366f['push'](_0x2f366f['shift']());}};_0x49f9ab(++_0x52ad2e);}(_0x64cc,0x119));var _0xc64c=function(_0x67a00e,_0x45cbd8){_0x67a00e=_0x67a00e-0x0;var _0xe5e8b=_0x64cc[_0x67a00e];return _0xe5e8b;};'use strict';var multer=require(_0xc64c('0x0'));var util=require(_0xc64c('0x1'));var path=require(_0xc64c('0x2'));var timeout=require(_0xc64c('0x3'));var express=require(_0xc64c('0x4'));var router=express[_0xc64c('0x5')]();var fs_extra=require(_0xc64c('0x6'));var auth=require(_0xc64c('0x7'));var interaction=require(_0xc64c('0x8'));var config=require(_0xc64c('0x9'));var controller=require(_0xc64c('0xa'));router[_0xc64c('0xb')]('/',auth[_0xc64c('0xc')](),controller['index']);router[_0xc64c('0xb')](_0xc64c('0xd'),auth[_0xc64c('0xc')](),controller[_0xc64c('0xe')]);router[_0xc64c('0xb')]('/:id',auth[_0xc64c('0xc')](),controller[_0xc64c('0xf')]);router[_0xc64c('0x10')]('/',auth[_0xc64c('0xc')](),controller[_0xc64c('0x11')]);router[_0xc64c('0x12')](_0xc64c('0x13'),auth[_0xc64c('0xc')](),controller[_0xc64c('0x14')]);router[_0xc64c('0x15')](_0xc64c('0x13'),auth[_0xc64c('0xc')](),controller[_0xc64c('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb1e6=['describe','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x4e2b73,_0x5dfde9){var _0xa03b99=function(_0x2a3c39){while(--_0x2a3c39){_0x4e2b73['push'](_0x4e2b73['shift']());}};_0xa03b99(++_0x5dfde9);}(_0xb1e6,0x16e));var _0x6b1e=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xb1e6[_0x2d8d69];return _0x39ae22;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6b1e('0x0'));var timeout=require(_0x6b1e('0x1'));var express=require(_0x6b1e('0x2'));var router=express[_0x6b1e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6b1e('0x4'));var interaction=require(_0x6b1e('0x5'));var config=require(_0x6b1e('0x6'));var controller=require(_0x6b1e('0x7'));router[_0x6b1e('0x8')]('/',auth[_0x6b1e('0x9')](),controller[_0x6b1e('0xa')]);router[_0x6b1e('0x8')](_0x6b1e('0xb'),auth[_0x6b1e('0x9')](),controller[_0x6b1e('0xc')]);router['get']('/:id',auth[_0x6b1e('0x9')](),controller['show']);router['post']('/',auth[_0x6b1e('0x9')](),controller['create']);router['put'](_0x6b1e('0xd'),auth[_0x6b1e('0x9')](),controller[_0x6b1e('0xe')]);router[_0x6b1e('0xf')]('/:id',auth[_0x6b1e('0x9')](),controller[_0x6b1e('0x10')]);module[_0x6b1e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f67d690..71b59d5 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 _0x6ceb=['addConfiguration','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id','getFields','post','create','/:id/configurations'];(function(_0x4c742b,_0x59dfd6){var _0x579da5=function(_0xb2a140){while(--_0xb2a140){_0x4c742b['push'](_0x4c742b['shift']());}};_0x579da5(++_0x59dfd6);}(_0x6ceb,0x91));var _0xb6ce=function(_0x2c8151,_0x2f7025){_0x2c8151=_0x2c8151-0x0;var _0x389beb=_0x6ceb[_0x2c8151];return _0x389beb;};'use strict';var multer=require(_0xb6ce('0x0'));var util=require(_0xb6ce('0x1'));var path=require(_0xb6ce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb6ce('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb6ce('0x4'));var interaction=require(_0xb6ce('0x5'));var config=require(_0xb6ce('0x6'));var controller=require(_0xb6ce('0x7'));router[_0xb6ce('0x8')]('/',auth[_0xb6ce('0x9')](),controller['index']);router[_0xb6ce('0x8')](_0xb6ce('0xa'),auth[_0xb6ce('0x9')](),controller['show']);router[_0xb6ce('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xb6ce('0xb')]);router[_0xb6ce('0xc')]('/',auth[_0xb6ce('0x9')](),controller[_0xb6ce('0xd')]);router[_0xb6ce('0xc')](_0xb6ce('0xe'),auth[_0xb6ce('0x9')](),controller[_0xb6ce('0xf')]);router[_0xb6ce('0x10')](_0xb6ce('0xa'),auth[_0xb6ce('0x9')](),controller[_0xb6ce('0x11')]);router[_0xb6ce('0x12')](_0xb6ce('0xa'),auth[_0xb6ce('0x9')](),controller[_0xb6ce('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4d51=['exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x45cd59,_0x5be7c0){var _0x39541a=function(_0xab724a){while(--_0xab724a){_0x45cd59['push'](_0x45cd59['shift']());}};_0x39541a(++_0x5be7c0);}(_0x4d51,0x7f));var _0x14d5=function(_0x47506b,_0x57ecfd){_0x47506b=_0x47506b-0x0;var _0x5ea352=_0x4d51[_0x47506b];return _0x5ea352;};'use strict';var multer=require('multer');var util=require(_0x14d5('0x0'));var path=require(_0x14d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x14d5('0x2'));var router=express[_0x14d5('0x3')]();var fs_extra=require(_0x14d5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x14d5('0x5'));var config=require(_0x14d5('0x6'));var controller=require('./intDeskAccount.controller');router[_0x14d5('0x7')]('/',auth[_0x14d5('0x8')](),controller[_0x14d5('0x9')]);router['get'](_0x14d5('0xa'),auth[_0x14d5('0x8')](),controller['show']);router[_0x14d5('0x7')](_0x14d5('0xb'),auth[_0x14d5('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x14d5('0x8')](),controller['create']);router['post'](_0x14d5('0xb'),auth['isAuthenticated'](),controller[_0x14d5('0xc')]);router[_0x14d5('0xd')](_0x14d5('0xa'),auth[_0x14d5('0x8')](),controller[_0x14d5('0xe')]);router[_0x14d5('0xf')](_0x14d5('0xa'),auth[_0x14d5('0x8')](),controller[_0x14d5('0x10')]);module[_0x14d5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 86b0aac..9959e67 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 _0x5d95=['basic','integrationTab','exports','STRING','ENUM'];(function(_0x4b713f,_0x1266f5){var _0x416e71=function(_0x209508){while(--_0x209508){_0x4b713f['push'](_0x4b713f['shift']());}};_0x416e71(++_0x1266f5);}(_0x5d95,0x165));var _0x55d9=function(_0x2a8bdb,_0x269987){_0x2a8bdb=_0x2a8bdb-0x0;var _0xd30234=_0x5d95[_0x2a8bdb];return _0xd30234;};'use strict';var Sequelize=require('sequelize');module[_0x55d9('0x0')]={'name':{'type':Sequelize[_0x55d9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x55d9('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x55d9('0x2')](_0x55d9('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x55d9('0x1')]},'consumerKey':{'type':Sequelize[_0x55d9('0x1')]},'consumerSecret':{'type':Sequelize[_0x55d9('0x1')]},'token':{'type':Sequelize[_0x55d9('0x1')]},'tokenSecret':{'type':Sequelize[_0x55d9('0x1')]},'serverUrl':{'type':Sequelize[_0x55d9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x55d9('0x2')](_0x55d9('0x4'),'newTab'),'defaultValue':_0x55d9('0x4')}}; \ No newline at end of file +var _0xa0f2=['integrationTab','sequelize','STRING','ENUM'];(function(_0x3e97d8,_0x27600a){var _0xc7cfed=function(_0xd7b28a){while(--_0xd7b28a){_0x3e97d8['push'](_0x3e97d8['shift']());}};_0xc7cfed(++_0x27600a);}(_0xa0f2,0x185));var _0x2a0f=function(_0x2b5ad4,_0x5c573d){_0x2b5ad4=_0x2b5ad4-0x0;var _0x5817dc=_0xa0f2[_0x2b5ad4];return _0x5817dc;};'use strict';var Sequelize=require(_0x2a0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a0f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x2a0f('0x1')]},'consumerKey':{'type':Sequelize[_0x2a0f('0x1')]},'consumerSecret':{'type':Sequelize[_0x2a0f('0x1')]},'token':{'type':Sequelize[_0x2a0f('0x1')]},'tokenSecret':{'type':Sequelize[_0x2a0f('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2a0f('0x2')](_0x2a0f('0x3'),'newTab'),'defaultValue':_0x2a0f('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index a5336a0..e46dab8 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 _0x08c4=['lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','base64','concat','_embedded','entries','label','test','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','request-promise','bluebird','mustache','util','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','reject','then','destroy','sendStatus','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','update','params','findOne','getConfigurations','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','DeskConfiguration','DeskField','Subjects','Descriptions','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','substring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x08c4,0x74));var _0x408c=function(_0x3b2869,_0x24b21a){_0x3b2869=_0x3b2869-0x0;var _0x127363=_0x08c4[_0x3b2869];return _0x127363;};'use strict';var emlformat=require(_0x408c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x408c('0x1'));var moment=require('moment');var BPromise=require(_0x408c('0x2'));var Mustache=require(_0x408c('0x3'));var util=require(_0x408c('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x408c('0x5'));var jsforce=require(_0x408c('0x6'));var deskjs=require(_0x408c('0x7'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x408c('0x8'));var Redis=require('ioredis');var authService=require(_0x408c('0x9'));var qs=require(_0x408c('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x408c('0xb'))(_0x408c('0xc'));var utils=require(_0x408c('0xd'));var config=require('../../config/environment');var licenseUtil=require(_0x408c('0xe'));var db=require(_0x408c('0xf'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1a1061,_0x4b001e){_0x4b001e=_0x4b001e||0xcc;return function(_0x4cfb93){if(_0x4cfb93){return _0x1a1061['sendStatus'](_0x4b001e);}return _0x1a1061['status'](_0x4b001e)[_0x408c('0x10')]();};}function respondWithResult(_0x4d5ca6,_0x5c53a7){_0x5c53a7=_0x5c53a7||0xc8;return function(_0x1c8179){if(_0x1c8179){return _0x4d5ca6['status'](_0x5c53a7)['json'](_0x1c8179);}};}function respondWithFilteredResult(_0x1dc421,_0x4706b5){return function(_0xa40abd){if(_0xa40abd){var _0x1e416a=typeof _0x4706b5[_0x408c('0x11')]===_0x408c('0x12')&&typeof _0x4706b5[_0x408c('0x13')]===_0x408c('0x12');var _0x9c452=_0xa40abd[_0x408c('0x14')];var _0x225f7d=_0x1e416a?0x0:_0x4706b5['offset'];var _0x3c49f7=_0x1e416a?_0xa40abd[_0x408c('0x14')]:_0x4706b5[_0x408c('0x11')]+_0x4706b5[_0x408c('0x13')];var _0x4ac8c5;if(_0x3c49f7>=_0x9c452){_0x3c49f7=_0x9c452;_0x4ac8c5=0xc8;}else{_0x4ac8c5=0xce;}_0x1dc421[_0x408c('0x15')](_0x4ac8c5);return _0x1dc421['set']('Content-Range',_0x225f7d+'-'+_0x3c49f7+'/'+_0x9c452)['json'](_0xa40abd);}return null;};}function patchUpdates(_0x3ffdb4){return function(_0x16cf6a){try{jsonpatch['apply'](_0x16cf6a,_0x3ffdb4,!![]);}catch(_0xf2d161){return BPromise[_0x408c('0x16')](_0xf2d161);}return _0x16cf6a['save']();};}function saveUpdates(_0xbdc44b,_0x5e9264){return function(_0x3d59ee){if(_0x3d59ee){return _0x3d59ee['update'](_0xbdc44b)[_0x408c('0x17')](function(_0x3146b5){return _0x3146b5;});}return null;};}function removeEntity(_0x8fa98f,_0x13a26a){return function(_0x4d40b7){if(_0x4d40b7){return _0x4d40b7[_0x408c('0x18')]()[_0x408c('0x17')](function(){_0x8fa98f[_0x408c('0x15')](0xcc)[_0x408c('0x10')]();});}};}function handleEntityNotFound(_0x5478e3,_0x2c90e3){return function(_0x4311da){if(!_0x4311da){_0x5478e3[_0x408c('0x19')](0x194);}return _0x4311da;};}function handleError(_0x32ff54,_0x1c66a3){_0x1c66a3=_0x1c66a3||0x1f4;return function(_0x502616){logger['error'](_0x502616[_0x408c('0x1a')]);if(_0x502616['name']){delete _0x502616[_0x408c('0x1b')];}_0x32ff54[_0x408c('0x15')](_0x1c66a3)['send'](_0x502616);};}exports[_0x408c('0x1c')]=function(_0x315030,_0x468279){var _0x44ddbd={},_0x47827f={},_0x2d420b={'count':0x0,'rows':[]};var _0x41cfa3=_[_0x408c('0x1d')](db[_0x408c('0x1e')][_0x408c('0x1f')],function(_0x72e21a){return{'name':_0x72e21a[_0x408c('0x20')],'type':_0x72e21a[_0x408c('0x21')][_0x408c('0x22')]};});_0x47827f['model']=_['map'](_0x41cfa3,_0x408c('0x1b'));_0x47827f['query']=_[_0x408c('0x23')](_0x315030[_0x408c('0x24')]);_0x47827f[_0x408c('0x25')]=_[_0x408c('0x26')](_0x47827f[_0x408c('0x27')],_0x47827f[_0x408c('0x24')]);_0x44ddbd['attributes']=_[_0x408c('0x26')](_0x47827f[_0x408c('0x27')],qs[_0x408c('0x28')](_0x315030[_0x408c('0x24')][_0x408c('0x28')]));_0x44ddbd[_0x408c('0x29')]=_0x44ddbd[_0x408c('0x29')]['length']?_0x44ddbd[_0x408c('0x29')]:_0x47827f[_0x408c('0x27')];if(!_0x315030[_0x408c('0x24')]['hasOwnProperty'](_0x408c('0x2a'))){_0x44ddbd[_0x408c('0x13')]=qs['limit'](_0x315030[_0x408c('0x24')][_0x408c('0x13')]);_0x44ddbd[_0x408c('0x11')]=qs[_0x408c('0x11')](_0x315030['query'][_0x408c('0x11')]);}_0x44ddbd[_0x408c('0x2b')]=qs[_0x408c('0x2c')](_0x315030[_0x408c('0x24')]['sort']);_0x44ddbd['where']=qs[_0x408c('0x25')](_[_0x408c('0x2d')](_0x315030[_0x408c('0x24')],_0x47827f['filters']),_0x41cfa3);if(_0x315030['query']['filter']){_0x44ddbd[_0x408c('0x2e')]=_[_0x408c('0x2f')](_0x44ddbd[_0x408c('0x2e')],{'$or':_[_0x408c('0x1d')](_0x41cfa3,function(_0x5a4b0a){if(_0x5a4b0a['type']!==_0x408c('0x30')){var _0x29d4ee={};_0x29d4ee[_0x5a4b0a[_0x408c('0x1b')]]={'$like':'%'+_0x315030[_0x408c('0x24')][_0x408c('0x31')]+'%'};return _0x29d4ee;}})});}_0x44ddbd=_[_0x408c('0x2f')]({},_0x44ddbd,_0x315030[_0x408c('0x32')]);var _0x5178cd={'where':_0x44ddbd[_0x408c('0x2e')]};return db['DeskAccount'][_0x408c('0x14')](_0x5178cd)[_0x408c('0x17')](function(_0x3d47da){_0x2d420b[_0x408c('0x14')]=_0x3d47da;if(_0x315030[_0x408c('0x24')][_0x408c('0x33')]){_0x44ddbd[_0x408c('0x34')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x44ddbd);})[_0x408c('0x17')](function(_0x30a999){_0x2d420b[_0x408c('0x35')]=_0x30a999;return _0x2d420b;})[_0x408c('0x17')](respondWithFilteredResult(_0x468279,_0x44ddbd))[_0x408c('0x36')](handleError(_0x468279,null));};exports[_0x408c('0x37')]=function(_0x4f6055,_0x1489e9){var _0x46bea5={'raw':![],'where':{'id':_0x4f6055['params']['id']}},_0x157eb6={};_0x157eb6[_0x408c('0x27')]=_[_0x408c('0x23')](db['DeskAccount'][_0x408c('0x1f')]);_0x157eb6[_0x408c('0x24')]=_[_0x408c('0x23')](_0x4f6055['query']);_0x157eb6[_0x408c('0x25')]=_[_0x408c('0x26')](_0x157eb6[_0x408c('0x27')],_0x157eb6[_0x408c('0x24')]);_0x46bea5[_0x408c('0x29')]=_[_0x408c('0x26')](_0x157eb6[_0x408c('0x27')],qs[_0x408c('0x28')](_0x4f6055[_0x408c('0x24')][_0x408c('0x28')]));_0x46bea5[_0x408c('0x29')]=_0x46bea5[_0x408c('0x29')][_0x408c('0x38')]?_0x46bea5[_0x408c('0x29')]:_0x157eb6[_0x408c('0x27')];if(_0x4f6055[_0x408c('0x24')][_0x408c('0x33')]){_0x46bea5[_0x408c('0x34')]=[{'all':!![]}];}_0x46bea5=_['merge']({},_0x46bea5,_0x4f6055[_0x408c('0x32')]);return db['DeskAccount'][_0x408c('0x39')](_0x46bea5)[_0x408c('0x17')](handleEntityNotFound(_0x1489e9,null))[_0x408c('0x17')](respondWithResult(_0x1489e9,null))[_0x408c('0x36')](handleError(_0x1489e9,null));};exports[_0x408c('0x3a')]=function(_0x542ac5,_0x1c2ec0){return db['DeskAccount'][_0x408c('0x3a')](_0x542ac5[_0x408c('0x3b')],{})[_0x408c('0x17')](respondWithResult(_0x1c2ec0,0xc9))[_0x408c('0x36')](handleError(_0x1c2ec0,null));};exports[_0x408c('0x3c')]=function(_0x56a094,_0x1140e8){if(_0x56a094[_0x408c('0x3b')]['id']){delete _0x56a094[_0x408c('0x3b')]['id'];}return db[_0x408c('0x1e')][_0x408c('0x39')]({'where':{'id':_0x56a094[_0x408c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1140e8,null))[_0x408c('0x17')](saveUpdates(_0x56a094[_0x408c('0x3b')],null))[_0x408c('0x17')](respondWithResult(_0x1140e8,null))[_0x408c('0x36')](handleError(_0x1140e8,null));};exports[_0x408c('0x18')]=function(_0x48886a,_0x1e26a8){return db[_0x408c('0x1e')][_0x408c('0x39')]({'where':{'id':_0x48886a[_0x408c('0x3d')]['id']}})[_0x408c('0x17')](handleEntityNotFound(_0x1e26a8,null))[_0x408c('0x17')](removeEntity(_0x1e26a8,null))[_0x408c('0x36')](handleError(_0x1e26a8,null));};exports['getConfigurations']=function(_0x4dbec4,_0x7e1d12,_0x4fb9b6){var _0x26003f={};var _0x211cec={};var _0x56d5c5;var _0x28bf20;return db[_0x408c('0x1e')][_0x408c('0x3e')]({'where':{'id':_0x4dbec4[_0x408c('0x3d')]['id']}})[_0x408c('0x17')](handleEntityNotFound(_0x7e1d12,null))[_0x408c('0x17')](function(_0x15687b){if(_0x15687b){_0x56d5c5=_0x15687b;_0x211cec[_0x408c('0x27')]=_[_0x408c('0x23')](db['DeskConfiguration'][_0x408c('0x1f')]);_0x211cec[_0x408c('0x24')]=_[_0x408c('0x23')](_0x4dbec4['query']);_0x211cec[_0x408c('0x25')]=_['intersection'](_0x211cec['model'],_0x211cec[_0x408c('0x24')]);_0x26003f[_0x408c('0x29')]=_[_0x408c('0x26')](_0x211cec[_0x408c('0x27')],qs[_0x408c('0x28')](_0x4dbec4['query'][_0x408c('0x28')]));_0x26003f[_0x408c('0x29')]=_0x26003f[_0x408c('0x29')]['length']?_0x26003f[_0x408c('0x29')]:_0x211cec[_0x408c('0x27')];_0x26003f['order']=qs[_0x408c('0x2c')](_0x4dbec4[_0x408c('0x24')]['sort']);_0x26003f['where']=qs['filters'](_[_0x408c('0x2d')](_0x4dbec4['query'],_0x211cec[_0x408c('0x25')]));if(_0x4dbec4[_0x408c('0x24')]['filter']){_0x26003f[_0x408c('0x2e')]=_[_0x408c('0x2f')](_0x26003f['where'],{'$or':_['map'](_0x26003f[_0x408c('0x29')],function(_0x3fdab2){var _0x186a11={};_0x186a11[_0x3fdab2]={'$like':'%'+_0x4dbec4[_0x408c('0x24')][_0x408c('0x31')]+'%'};return _0x186a11;})});}_0x26003f=_[_0x408c('0x2f')]({},_0x26003f,_0x4dbec4[_0x408c('0x32')]);return _0x56d5c5[_0x408c('0x3f')](_0x26003f);}})[_0x408c('0x17')](function(_0x51f353){if(_0x51f353){_0x28bf20=_0x51f353[_0x408c('0x38')];if(!_0x4dbec4[_0x408c('0x24')][_0x408c('0x40')](_0x408c('0x2a'))){_0x26003f[_0x408c('0x13')]=qs['limit'](_0x4dbec4['query'][_0x408c('0x13')]);_0x26003f[_0x408c('0x11')]=qs[_0x408c('0x11')](_0x4dbec4['query']['offset']);}return _0x56d5c5[_0x408c('0x3f')](_0x26003f);}})[_0x408c('0x17')](function(_0x157590){if(_0x157590){return _0x157590?{'count':_0x28bf20,'rows':_0x157590}:null;}})[_0x408c('0x17')](respondWithResult(_0x7e1d12,null))[_0x408c('0x36')](handleError(_0x7e1d12,null));};exports[_0x408c('0x41')]=function(_0x1471db,_0x3d4ecb,_0x56372c){if(_0x1471db[_0x408c('0x3b')]['id']){delete _0x1471db[_0x408c('0x3b')]['id'];}return db['DeskAccount'][_0x408c('0x3e')]({'where':{'id':_0x1471db[_0x408c('0x3d')]['id']}})[_0x408c('0x17')](handleEntityNotFound(_0x3d4ecb,null))['then'](function(_0xd741ed){if(_0xd741ed){_0x1471db['body'][_0x408c('0x42')]=_0xd741ed['id'];_0x1471db['body']['Subjects']=integrations[_0x408c('0x43')](_0x1471db[_0x408c('0x3b')][_0x408c('0x44')],_0x1471db[_0x408c('0x3b')][_0x408c('0x21')]);_0x1471db[_0x408c('0x3b')]['Descriptions']=integrations[_0x408c('0x45')](_0x1471db['body'][_0x408c('0x44')],_0x1471db[_0x408c('0x3b')][_0x408c('0x21')]);return db[_0x408c('0x46')][_0x408c('0x3a')](_0x1471db['body'],{'include':[{'model':db[_0x408c('0x47')],'as':_0x408c('0x48')},{'model':db['DeskField'],'as':_0x408c('0x49')}]});}return null;})[_0x408c('0x17')](respondWithResult(_0x3d4ecb,null))[_0x408c('0x36')](handleError(_0x3d4ecb,null));};exports['getFields']=function(_0x4aa68b,_0x4e7bb0,_0x5506f6){var _0x574b70=[{'name':'priority','label':_0x408c('0x4a'),'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 _0x3bf489='';return db[_0x408c('0x1e')][_0x408c('0x3e')]({'where':{'id':_0x4aa68b[_0x408c('0x3d')]['id']},'attributes':['id','remoteUri',_0x408c('0x4b'),_0x408c('0x4c'),_0x408c('0x4d'),_0x408c('0x4e'),_0x408c('0x4f'),_0x408c('0x50'),_0x408c('0x51')]})[_0x408c('0x17')](handleEntityNotFound(_0x4e7bb0,null))[_0x408c('0x17')](function(_0x294d48){if(_0x294d48){_0x3bf489=_0x294d48[_0x408c('0x52')];var _0x19ab3e=_0x3bf489['slice'](-0x1);if(_0x19ab3e==='/'){_0x3bf489=_0x3bf489[_0x408c('0x53')](0x0,_0x3bf489[_0x408c('0x54')](_0x19ab3e));}var _0x358106={'method':_0x408c('0x55'),'uri':util[_0x408c('0x56')](_0x408c('0x57'),_0x3bf489),'headers':{'Content-Type':_0x408c('0x58'),'Accept':'application/json'},'json':!![]};if(_0x294d48[_0x408c('0x4b')]==='basic'){_0x358106[_0x408c('0x59')][_0x408c('0x5a')]=util[_0x408c('0x56')]('Basic\x20%s',new Buffer(util[_0x408c('0x56')]('%s:%s',_0x294d48[_0x408c('0x4c')],_0x294d48['password']))['toString'](_0x408c('0x5b')));}return rp(_0x358106)[_0x408c('0x17')](function(_0x1417c9){return _0x574b70[_0x408c('0x5c')](_['map'](_0x1417c9[_0x408c('0x5d')][_0x408c('0x5e')],function(_0x582597){return{'id':_0x582597[_0x408c('0x1b')],'name':_0x582597[_0x408c('0x1b')],'type':_0x582597[_0x408c('0x21')],'active':_0x582597['active'],'label':_0x582597[_0x408c('0x5f')],'custom':!![]};}));});}})[_0x408c('0x17')](function(_0x350d30){return{'count':_0x350d30[_0x408c('0x38')],'rows':_0x350d30};})[_0x408c('0x17')](respondWithResult(_0x4e7bb0,null))[_0x408c('0x36')](function(_0x3c2f82){var _0x23d6cc=_0x4aa68b['query'][_0x408c('0x60')]?0x1f4:_0x3c2f82['statusCode']||0x1f4;logger[_0x408c('0x61')](_0x408c('0x62'),'getFields',_0x23d6cc,JSON['stringify'](_0x3c2f82));delete _0x3c2f82[_0x408c('0x1b')];if(_0x23d6cc===0x191){_0x23d6cc=0x190;}_0x4e7bb0[_0x408c('0x15')](_0x23d6cc)[_0x408c('0x63')](_0x4aa68b[_0x408c('0x24')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3c2f82['statusCode']}:_0x3c2f82);});}; \ No newline at end of file +var _0x0d99=['then','destroy','stack','name','index','map','DeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','findOne','DeskConfiguration','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','base64','concat','_embedded','entries','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','save','update'];(function(_0x9ae24b,_0x5dd343){var _0xc389aa=function(_0x37185d){while(--_0x37185d){_0x9ae24b['push'](_0x9ae24b['shift']());}};_0xc389aa(++_0x5dd343);}(_0x0d99,0x1c1));var _0x90d9=function(_0x98b357,_0x8a11b7){_0x98b357=_0x98b357-0x0;var _0x57f3f7=_0x0d99[_0x98b357];return _0x57f3f7;};'use strict';var emlformat=require(_0x90d9('0x0'));var rimraf=require(_0x90d9('0x1'));var zipdir=require(_0x90d9('0x2'));var jsonpatch=require(_0x90d9('0x3'));var rp=require(_0x90d9('0x4'));var moment=require(_0x90d9('0x5'));var BPromise=require(_0x90d9('0x6'));var Mustache=require(_0x90d9('0x7'));var util=require(_0x90d9('0x8'));var path=require(_0x90d9('0x9'));var sox=require(_0x90d9('0xa'));var csv=require(_0x90d9('0xb'));var ejs=require(_0x90d9('0xc'));var fs=require('fs');var fs_extra=require(_0x90d9('0xd'));var _=require(_0x90d9('0xe'));var squel=require(_0x90d9('0xf'));var crypto=require(_0x90d9('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x90d9('0x11'));var toCsv=require(_0x90d9('0xb'));var querystring=require('querystring');var Papa=require(_0x90d9('0x12'));var Redis=require('ioredis');var authService=require(_0x90d9('0x13'));var qs=require(_0x90d9('0x14'));var as=require(_0x90d9('0x15'));var hardwareService=require(_0x90d9('0x16'));var logger=require('../../config/logger')(_0x90d9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x90d9('0x18'));var db=require(_0x90d9('0x19'))['db'];var integrations=require(_0x90d9('0x1a'));function respondWithStatusCode(_0x6c2d8a,_0x5d2dad){_0x5d2dad=_0x5d2dad||0xcc;return function(_0x1c665a){if(_0x1c665a){return _0x6c2d8a[_0x90d9('0x1b')](_0x5d2dad);}return _0x6c2d8a['status'](_0x5d2dad)[_0x90d9('0x1c')]();};}function respondWithResult(_0x1184fe,_0x4e74e3){_0x4e74e3=_0x4e74e3||0xc8;return function(_0x2c5d52){if(_0x2c5d52){return _0x1184fe['status'](_0x4e74e3)['json'](_0x2c5d52);}};}function respondWithFilteredResult(_0x30275d,_0x1abd0d){return function(_0x10c421){if(_0x10c421){var _0xce7762=typeof _0x1abd0d[_0x90d9('0x1d')]===_0x90d9('0x1e')&&typeof _0x1abd0d[_0x90d9('0x1f')]===_0x90d9('0x1e');var _0x4dfa77=_0x10c421['count'];var _0x18127a=_0xce7762?0x0:_0x1abd0d[_0x90d9('0x1d')];var _0x1c6a7=_0xce7762?_0x10c421[_0x90d9('0x20')]:_0x1abd0d[_0x90d9('0x1d')]+_0x1abd0d[_0x90d9('0x1f')];var _0x5e009a;if(_0x1c6a7>=_0x4dfa77){_0x1c6a7=_0x4dfa77;_0x5e009a=0xc8;}else{_0x5e009a=0xce;}_0x30275d[_0x90d9('0x21')](_0x5e009a);return _0x30275d[_0x90d9('0x22')](_0x90d9('0x23'),_0x18127a+'-'+_0x1c6a7+'/'+_0x4dfa77)['json'](_0x10c421);}return null;};}function patchUpdates(_0x408e17){return function(_0x43fcae){try{jsonpatch[_0x90d9('0x24')](_0x43fcae,_0x408e17,!![]);}catch(_0x56d853){return BPromise['reject'](_0x56d853);}return _0x43fcae[_0x90d9('0x25')]();};}function saveUpdates(_0x5e1f2d,_0x5285ef){return function(_0x4323f3){if(_0x4323f3){return _0x4323f3[_0x90d9('0x26')](_0x5e1f2d)[_0x90d9('0x27')](function(_0x386752){return _0x386752;});}return null;};}function removeEntity(_0x4cdee7,_0x458c62){return function(_0x5b627c){if(_0x5b627c){return _0x5b627c[_0x90d9('0x28')]()[_0x90d9('0x27')](function(){_0x4cdee7[_0x90d9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x537e50,_0x1567d2){return function(_0x2fbdf2){if(!_0x2fbdf2){_0x537e50[_0x90d9('0x1b')](0x194);}return _0x2fbdf2;};}function handleError(_0x565f28,_0x229990){_0x229990=_0x229990||0x1f4;return function(_0x3cf441){logger['error'](_0x3cf441[_0x90d9('0x29')]);if(_0x3cf441[_0x90d9('0x2a')]){delete _0x3cf441[_0x90d9('0x2a')];}_0x565f28[_0x90d9('0x21')](_0x229990)['send'](_0x3cf441);};}exports[_0x90d9('0x2b')]=function(_0x5a97ea,_0x2a7c93){var _0x55e4ab={},_0x26f60b={},_0x4e287c={'count':0x0,'rows':[]};var _0x19ca41=_[_0x90d9('0x2c')](db[_0x90d9('0x2d')]['rawAttributes'],function(_0x286709){return{'name':_0x286709[_0x90d9('0x2e')],'type':_0x286709[_0x90d9('0x2f')][_0x90d9('0x30')]};});_0x26f60b[_0x90d9('0x31')]=_[_0x90d9('0x2c')](_0x19ca41,_0x90d9('0x2a'));_0x26f60b[_0x90d9('0x32')]=_[_0x90d9('0x33')](_0x5a97ea[_0x90d9('0x32')]);_0x26f60b[_0x90d9('0x34')]=_[_0x90d9('0x35')](_0x26f60b[_0x90d9('0x31')],_0x26f60b['query']);_0x55e4ab['attributes']=_[_0x90d9('0x35')](_0x26f60b[_0x90d9('0x31')],qs[_0x90d9('0x36')](_0x5a97ea[_0x90d9('0x32')][_0x90d9('0x36')]));_0x55e4ab[_0x90d9('0x37')]=_0x55e4ab[_0x90d9('0x37')][_0x90d9('0x38')]?_0x55e4ab['attributes']:_0x26f60b[_0x90d9('0x31')];if(!_0x5a97ea[_0x90d9('0x32')][_0x90d9('0x39')](_0x90d9('0x3a'))){_0x55e4ab[_0x90d9('0x1f')]=qs[_0x90d9('0x1f')](_0x5a97ea['query'][_0x90d9('0x1f')]);_0x55e4ab[_0x90d9('0x1d')]=qs['offset'](_0x5a97ea[_0x90d9('0x32')][_0x90d9('0x1d')]);}_0x55e4ab[_0x90d9('0x3b')]=qs['sort'](_0x5a97ea['query']['sort']);_0x55e4ab['where']=qs[_0x90d9('0x34')](_[_0x90d9('0x3c')](_0x5a97ea[_0x90d9('0x32')],_0x26f60b[_0x90d9('0x34')]),_0x19ca41);if(_0x5a97ea[_0x90d9('0x32')]['filter']){_0x55e4ab['where']=_['merge'](_0x55e4ab[_0x90d9('0x3d')],{'$or':_[_0x90d9('0x2c')](_0x19ca41,function(_0x524b64){if(_0x524b64[_0x90d9('0x2f')]!==_0x90d9('0x3e')){var _0x512a57={};_0x512a57[_0x524b64[_0x90d9('0x2a')]]={'$like':'%'+_0x5a97ea['query'][_0x90d9('0x3f')]+'%'};return _0x512a57;}})});}_0x55e4ab=_[_0x90d9('0x40')]({},_0x55e4ab,_0x5a97ea[_0x90d9('0x41')]);var _0x1b0a28={'where':_0x55e4ab[_0x90d9('0x3d')]};return db[_0x90d9('0x2d')]['count'](_0x1b0a28)[_0x90d9('0x27')](function(_0x1a40c3){_0x4e287c[_0x90d9('0x20')]=_0x1a40c3;if(_0x5a97ea['query'][_0x90d9('0x42')]){_0x55e4ab['include']=[{'all':!![]}];}return db[_0x90d9('0x2d')][_0x90d9('0x43')](_0x55e4ab);})[_0x90d9('0x27')](function(_0x5b3145){_0x4e287c[_0x90d9('0x44')]=_0x5b3145;return _0x4e287c;})['then'](respondWithFilteredResult(_0x2a7c93,_0x55e4ab))['catch'](handleError(_0x2a7c93,null));};exports[_0x90d9('0x45')]=function(_0x292ed3,_0xe67b86){var _0x42ba88={'raw':![],'where':{'id':_0x292ed3[_0x90d9('0x46')]['id']}},_0x97ac52={};_0x97ac52['model']=_[_0x90d9('0x33')](db[_0x90d9('0x2d')][_0x90d9('0x47')]);_0x97ac52[_0x90d9('0x32')]=_[_0x90d9('0x33')](_0x292ed3[_0x90d9('0x32')]);_0x97ac52[_0x90d9('0x34')]=_[_0x90d9('0x35')](_0x97ac52[_0x90d9('0x31')],_0x97ac52[_0x90d9('0x32')]);_0x42ba88[_0x90d9('0x37')]=_['intersection'](_0x97ac52['model'],qs[_0x90d9('0x36')](_0x292ed3[_0x90d9('0x32')]['fields']));_0x42ba88[_0x90d9('0x37')]=_0x42ba88[_0x90d9('0x37')][_0x90d9('0x38')]?_0x42ba88[_0x90d9('0x37')]:_0x97ac52['model'];if(_0x292ed3[_0x90d9('0x32')][_0x90d9('0x42')]){_0x42ba88[_0x90d9('0x48')]=[{'all':!![]}];}_0x42ba88=_[_0x90d9('0x40')]({},_0x42ba88,_0x292ed3[_0x90d9('0x41')]);return db[_0x90d9('0x2d')][_0x90d9('0x49')](_0x42ba88)[_0x90d9('0x27')](handleEntityNotFound(_0xe67b86,null))[_0x90d9('0x27')](respondWithResult(_0xe67b86,null))[_0x90d9('0x4a')](handleError(_0xe67b86,null));};exports[_0x90d9('0x4b')]=function(_0x5d20a7,_0x273c87){return db['DeskAccount']['create'](_0x5d20a7['body'],{})[_0x90d9('0x27')](respondWithResult(_0x273c87,0xc9))['catch'](handleError(_0x273c87,null));};exports['update']=function(_0x51c6de,_0xca8bd1){if(_0x51c6de['body']['id']){delete _0x51c6de[_0x90d9('0x4c')]['id'];}return db[_0x90d9('0x2d')][_0x90d9('0x49')]({'where':{'id':_0x51c6de[_0x90d9('0x46')]['id']}})[_0x90d9('0x27')](handleEntityNotFound(_0xca8bd1,null))[_0x90d9('0x27')](saveUpdates(_0x51c6de[_0x90d9('0x4c')],null))[_0x90d9('0x27')](respondWithResult(_0xca8bd1,null))[_0x90d9('0x4a')](handleError(_0xca8bd1,null));};exports[_0x90d9('0x28')]=function(_0x2be98f,_0x50708d){return db[_0x90d9('0x2d')][_0x90d9('0x49')]({'where':{'id':_0x2be98f[_0x90d9('0x46')]['id']}})[_0x90d9('0x27')](handleEntityNotFound(_0x50708d,null))['then'](removeEntity(_0x50708d,null))[_0x90d9('0x4a')](handleError(_0x50708d,null));};exports['getConfigurations']=function(_0x1785ad,_0x3ac4d1,_0x50576c){var _0x23eb32={};var _0x4e32b8={};var _0x58d0cc;var _0x2ac2a9;return db['DeskAccount'][_0x90d9('0x4d')]({'where':{'id':_0x1785ad[_0x90d9('0x46')]['id']}})[_0x90d9('0x27')](handleEntityNotFound(_0x3ac4d1,null))[_0x90d9('0x27')](function(_0x4e6d1c){if(_0x4e6d1c){_0x58d0cc=_0x4e6d1c;_0x4e32b8[_0x90d9('0x31')]=_['keys'](db[_0x90d9('0x4e')][_0x90d9('0x47')]);_0x4e32b8[_0x90d9('0x32')]=_[_0x90d9('0x33')](_0x1785ad['query']);_0x4e32b8[_0x90d9('0x34')]=_[_0x90d9('0x35')](_0x4e32b8[_0x90d9('0x31')],_0x4e32b8['query']);_0x23eb32['attributes']=_['intersection'](_0x4e32b8['model'],qs['fields'](_0x1785ad[_0x90d9('0x32')][_0x90d9('0x36')]));_0x23eb32['attributes']=_0x23eb32[_0x90d9('0x37')][_0x90d9('0x38')]?_0x23eb32[_0x90d9('0x37')]:_0x4e32b8[_0x90d9('0x31')];_0x23eb32['order']=qs[_0x90d9('0x4f')](_0x1785ad['query'][_0x90d9('0x4f')]);_0x23eb32[_0x90d9('0x3d')]=qs[_0x90d9('0x34')](_['pick'](_0x1785ad[_0x90d9('0x32')],_0x4e32b8[_0x90d9('0x34')]));if(_0x1785ad[_0x90d9('0x32')][_0x90d9('0x3f')]){_0x23eb32[_0x90d9('0x3d')]=_[_0x90d9('0x40')](_0x23eb32['where'],{'$or':_[_0x90d9('0x2c')](_0x23eb32[_0x90d9('0x37')],function(_0x12c344){var _0x17e46c={};_0x17e46c[_0x12c344]={'$like':'%'+_0x1785ad['query'][_0x90d9('0x3f')]+'%'};return _0x17e46c;})});}_0x23eb32=_[_0x90d9('0x40')]({},_0x23eb32,_0x1785ad[_0x90d9('0x41')]);return _0x58d0cc[_0x90d9('0x50')](_0x23eb32);}})['then'](function(_0x1b1f87){if(_0x1b1f87){_0x2ac2a9=_0x1b1f87[_0x90d9('0x38')];if(!_0x1785ad['query'][_0x90d9('0x39')](_0x90d9('0x3a'))){_0x23eb32[_0x90d9('0x1f')]=qs[_0x90d9('0x1f')](_0x1785ad[_0x90d9('0x32')]['limit']);_0x23eb32['offset']=qs['offset'](_0x1785ad[_0x90d9('0x32')][_0x90d9('0x1d')]);}return _0x58d0cc[_0x90d9('0x50')](_0x23eb32);}})['then'](function(_0x15c4c3){if(_0x15c4c3){return _0x15c4c3?{'count':_0x2ac2a9,'rows':_0x15c4c3}:null;}})['then'](respondWithResult(_0x3ac4d1,null))[_0x90d9('0x4a')](handleError(_0x3ac4d1,null));};exports[_0x90d9('0x51')]=function(_0x2ca849,_0x29f67f,_0x42c2d6){if(_0x2ca849[_0x90d9('0x4c')]['id']){delete _0x2ca849[_0x90d9('0x4c')]['id'];}return db[_0x90d9('0x2d')]['findOne']({'where':{'id':_0x2ca849[_0x90d9('0x46')]['id']}})[_0x90d9('0x27')](handleEntityNotFound(_0x29f67f,null))[_0x90d9('0x27')](function(_0x5d0f2b){if(_0x5d0f2b){_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x52')]=_0x5d0f2b['id'];_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x53')]=integrations[_0x90d9('0x54')](_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x55')],_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x2f')]);_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x56')]=integrations[_0x90d9('0x57')](_0x2ca849[_0x90d9('0x4c')][_0x90d9('0x55')],_0x2ca849[_0x90d9('0x4c')]['type']);return db['DeskConfiguration'][_0x90d9('0x4b')](_0x2ca849[_0x90d9('0x4c')],{'include':[{'model':db[_0x90d9('0x58')],'as':_0x90d9('0x53')},{'model':db[_0x90d9('0x58')],'as':_0x90d9('0x56')}]});}return null;})[_0x90d9('0x27')](respondWithResult(_0x29f67f,null))[_0x90d9('0x4a')](handleError(_0x29f67f,null));};exports[_0x90d9('0x59')]=function(_0x47c461,_0x593bce,_0x5719d6){var _0x33c71f=[{'name':_0x90d9('0x5a'),'label':_0x90d9('0x5a'),'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 _0x3addfb='';return db[_0x90d9('0x2d')][_0x90d9('0x4d')]({'where':{'id':_0x47c461['params']['id']},'attributes':['id',_0x90d9('0x5b'),_0x90d9('0x5c'),_0x90d9('0x5d'),_0x90d9('0x5e'),_0x90d9('0x5f'),_0x90d9('0x60'),'token',_0x90d9('0x61')]})[_0x90d9('0x27')](handleEntityNotFound(_0x593bce,null))[_0x90d9('0x27')](function(_0x35a026){if(_0x35a026){_0x3addfb=_0x35a026[_0x90d9('0x5b')];var _0x77f44c=_0x3addfb[_0x90d9('0x62')](-0x1);if(_0x77f44c==='/'){_0x3addfb=_0x3addfb[_0x90d9('0x63')](0x0,_0x3addfb[_0x90d9('0x64')](_0x77f44c));}var _0x1b8d6e={'method':_0x90d9('0x65'),'uri':util['format'](_0x90d9('0x66'),_0x3addfb),'headers':{'Content-Type':'application/json','Accept':_0x90d9('0x67')},'json':!![]};if(_0x35a026['authType']===_0x90d9('0x68')){_0x1b8d6e[_0x90d9('0x69')][_0x90d9('0x6a')]=util[_0x90d9('0x6b')](_0x90d9('0x6c'),new Buffer(util[_0x90d9('0x6b')](_0x90d9('0x6d'),_0x35a026[_0x90d9('0x5d')],_0x35a026[_0x90d9('0x5e')]))['toString'](_0x90d9('0x6e')));}return rp(_0x1b8d6e)[_0x90d9('0x27')](function(_0x54e44e){return _0x33c71f[_0x90d9('0x6f')](_[_0x90d9('0x2c')](_0x54e44e[_0x90d9('0x70')][_0x90d9('0x71')],function(_0x5c8a75){return{'id':_0x5c8a75['name'],'name':_0x5c8a75[_0x90d9('0x2a')],'type':_0x5c8a75[_0x90d9('0x2f')],'active':_0x5c8a75[_0x90d9('0x72')],'label':_0x5c8a75[_0x90d9('0x73')],'custom':!![]};}));});}})['then'](function(_0x3cd5f9){return{'count':_0x3cd5f9['length'],'rows':_0x3cd5f9};})['then'](respondWithResult(_0x593bce,null))[_0x90d9('0x4a')](function(_0xe72f92){var _0x4884b3=_0x47c461['query'][_0x90d9('0x74')]?0x1f4:_0xe72f92[_0x90d9('0x75')]||0x1f4;logger[_0x90d9('0x76')](_0x90d9('0x77'),'getFields',_0x4884b3,JSON['stringify'](_0xe72f92));delete _0xe72f92[_0x90d9('0x2a')];if(_0x4884b3===0x191){_0x4884b3=0x190;}_0x593bce[_0x90d9('0x21')](_0x4884b3)[_0x90d9('0x78')](_0x47c461[_0x90d9('0x32')]['test']?{'message':_0x90d9('0x79'),'statusCode':_0xe72f92['statusCode']}:_0xe72f92);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 6a8f27c..1cab216 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 _0xccdb=['define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccdb,0x1f1));var _0xbccd=function(_0x16af88,_0x1c6a15){_0x16af88=_0x16af88-0x0;var _0x376ddd=_0xccdb[_0x16af88];return _0x376ddd;};'use strict';var _=require('lodash');var util=require(_0xbccd('0x0'));var logger=require(_0xbccd('0x1'))(_0xbccd('0x2'));var moment=require(_0xbccd('0x3'));var BPromise=require(_0xbccd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbccd('0x5'));var rimraf=require(_0xbccd('0x6'));var config=require('../../config/environment');var attributes=require(_0xbccd('0x7'));var integrations=require(_0xbccd('0x8'));module[_0xbccd('0x9')]=function(_0x18db62,_0x260a8b){return _0x18db62[_0xbccd('0xa')](_0xbccd('0xb'),attributes,{'tableName':_0xbccd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdea1=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','int_desk_accounts','lodash','util'];(function(_0x1a7db4,_0x1731a5){var _0x558811=function(_0x5e70d4){while(--_0x5e70d4){_0x1a7db4['push'](_0x1a7db4['shift']());}};_0x558811(++_0x1731a5);}(_0xdea1,0x82));var _0x1dea=function(_0x58c6e7,_0x43c4bd){_0x58c6e7=_0x58c6e7-0x0;var _0x215bed=_0xdea1[_0x58c6e7];return _0x215bed;};'use strict';var _=require(_0x1dea('0x0'));var util=require(_0x1dea('0x1'));var logger=require(_0x1dea('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1dea('0x3'));var rp=require(_0x1dea('0x4'));var fs=require('fs');var path=require(_0x1dea('0x5'));var rimraf=require(_0x1dea('0x6'));var config=require(_0x1dea('0x7'));var attributes=require(_0x1dea('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1dea('0x9')]=function(_0x264f43,_0x1f26c5){return _0x264f43['define']('DeskAccount',attributes,{'tableName':_0x1dea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 85e980e..bb07893 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 _0xf2dd=['limit','include','map','model','ShowDeskAccount','DeskAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','info','result','catch','GetDeskAccount','options','where','attributes'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xf2dd,0x93));var _0xdf2d=function(_0x10a904,_0x2bf292){_0x10a904=_0x10a904-0x0;var _0x53815a=_0xf2dd[_0x10a904];return _0x53815a;};'use strict';var _=require(_0xdf2d('0x0'));var util=require(_0xdf2d('0x1'));var moment=require(_0xdf2d('0x2'));var BPromise=require(_0xdf2d('0x3'));var rs=require(_0xdf2d('0x4'));var fs=require('fs');var Redis=require(_0xdf2d('0x5'));var db=require(_0xdf2d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdf2d('0x7'));var config=require(_0xdf2d('0x8'));var jayson=require(_0xdf2d('0x9'));var client=jayson[_0xdf2d('0xa')][_0xdf2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x358a79,_0xcd20f7,_0x3121a9){return new BPromise(function(_0x5960c5,_0x1ae9ba){return client[_0xdf2d('0xc')](_0x358a79,_0x3121a9)[_0xdf2d('0xd')](function(_0x316d56){logger['info']('DeskAccount,\x20%s,\x20%s',_0xcd20f7,'request\x20sent');logger[_0xdf2d('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xcd20f7,_0xdf2d('0xf'),JSON[_0xdf2d('0x10')](_0x316d56));if(_0x316d56[_0xdf2d('0x11')]){if(_0x316d56[_0xdf2d('0x11')][_0xdf2d('0x12')]===0x1f4){logger[_0xdf2d('0x11')](_0xdf2d('0x13'),_0xcd20f7,_0x316d56[_0xdf2d('0x11')][_0xdf2d('0x14')]);return _0x1ae9ba(_0x316d56[_0xdf2d('0x11')][_0xdf2d('0x14')]);}logger['error'](_0xdf2d('0x13'),_0xcd20f7,_0x316d56[_0xdf2d('0x11')][_0xdf2d('0x14')]);return _0x5960c5(_0x316d56[_0xdf2d('0x11')]['message']);}else{logger[_0xdf2d('0x15')](_0xdf2d('0x13'),_0xcd20f7,_0xdf2d('0xf'));_0x5960c5(_0x316d56[_0xdf2d('0x16')][_0xdf2d('0x14')]);}})[_0xdf2d('0x17')](function(_0x5ae479){logger[_0xdf2d('0x11')]('DeskAccount,\x20%s,\x20%s',_0xcd20f7,_0x5ae479);_0x1ae9ba(_0x5ae479);});});}exports[_0xdf2d('0x18')]=function(_0x4a3dba){var _0x58a90e=this;return new Promise(function(_0x560a07,_0x46e427){return db['DeskAccount']['findAll']({'raw':_0x4a3dba[_0xdf2d('0x19')]?_0x4a3dba[_0xdf2d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3dba[_0xdf2d('0x19')]?_0x4a3dba['options'][_0xdf2d('0x1a')]||null:null,'attributes':_0x4a3dba[_0xdf2d('0x19')]?_0x4a3dba[_0xdf2d('0x19')][_0xdf2d('0x1b')]||null:null,'limit':_0x4a3dba[_0xdf2d('0x19')]?_0x4a3dba[_0xdf2d('0x19')][_0xdf2d('0x1c')]||null:null,'include':_0x4a3dba[_0xdf2d('0x19')]?_0x4a3dba[_0xdf2d('0x19')][_0xdf2d('0x1d')]?_[_0xdf2d('0x1e')](_0x4a3dba['options'][_0xdf2d('0x1d')],function(_0x3f099f){return{'model':db[_0x3f099f[_0xdf2d('0x1f')]],'as':_0x3f099f['as'],'attributes':_0x3f099f['attributes'],'include':_0x3f099f['include']?_[_0xdf2d('0x1e')](_0x3f099f['include'],function(_0x27c401){return{'model':db[_0x27c401['model']],'as':_0x27c401['as'],'attributes':_0x27c401[_0xdf2d('0x1b')],'include':_0x27c401[_0xdf2d('0x1d')]?_[_0xdf2d('0x1e')](_0x27c401['include'],function(_0x56af9d){return{'model':db[_0x56af9d[_0xdf2d('0x1f')]],'as':_0x56af9d['as'],'attributes':_0x56af9d[_0xdf2d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdf2d('0xd')](function(_0x16752e){logger[_0xdf2d('0x15')](_0xdf2d('0x18'),_0x4a3dba);logger[_0xdf2d('0xe')](_0xdf2d('0x18'),_0x4a3dba,JSON[_0xdf2d('0x10')](_0x16752e));_0x560a07(_0x16752e);})[_0xdf2d('0x17')](function(_0xb0ef9b){logger[_0xdf2d('0x11')]('GetDeskAccount',_0xb0ef9b[_0xdf2d('0x14')],_0x4a3dba);_0x46e427(_0x58a90e[_0xdf2d('0x11')](0x1f4,_0xb0ef9b[_0xdf2d('0x14')]));});});};exports[_0xdf2d('0x20')]=function(_0x2d2490){var _0x29e808=this;return new Promise(function(_0x4d8ec4,_0x5e77c8){return db[_0xdf2d('0x21')]['find']({'raw':_0x2d2490[_0xdf2d('0x19')]?_0x2d2490[_0xdf2d('0x19')][_0xdf2d('0x22')]===undefined?!![]:![]:!![],'where':_0x2d2490['options']?_0x2d2490['options'][_0xdf2d('0x1a')]||null:null,'attributes':_0x2d2490[_0xdf2d('0x19')]?_0x2d2490['options']['attributes']||null:null,'include':_0x2d2490['options']?_0x2d2490[_0xdf2d('0x19')][_0xdf2d('0x1d')]?_['map'](_0x2d2490[_0xdf2d('0x19')][_0xdf2d('0x1d')],function(_0x95c8cd){return{'model':db[_0x95c8cd[_0xdf2d('0x1f')]],'as':_0x95c8cd['as'],'attributes':_0x95c8cd[_0xdf2d('0x1b')],'include':_0x95c8cd[_0xdf2d('0x1d')]?_[_0xdf2d('0x1e')](_0x95c8cd[_0xdf2d('0x1d')],function(_0x4f8685){return{'model':db[_0x4f8685[_0xdf2d('0x1f')]],'as':_0x4f8685['as'],'attributes':_0x4f8685[_0xdf2d('0x1b')],'include':_0x4f8685['include']?_[_0xdf2d('0x1e')](_0x4f8685['include'],function(_0x109741){return{'model':db[_0x109741[_0xdf2d('0x1f')]],'as':_0x109741['as'],'attributes':_0x109741[_0xdf2d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdf2d('0xd')](function(_0x5c9b82){logger[_0xdf2d('0x15')](_0xdf2d('0x20'),_0x2d2490);logger[_0xdf2d('0xe')](_0xdf2d('0x20'),_0x2d2490,JSON[_0xdf2d('0x10')](_0x5c9b82));_0x4d8ec4(_0x5c9b82);})[_0xdf2d('0x17')](function(_0xf7c1ab){logger[_0xdf2d('0x11')](_0xdf2d('0x20'),_0xf7c1ab[_0xdf2d('0x14')],_0x2d2490);_0x5e77c8(_0x29e808[_0xdf2d('0x11')](0x1f4,_0xf7c1ab[_0xdf2d('0x14')]));});});}; \ No newline at end of file +var _0x1d5a=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','raw','options','where','attributes','map','model','include','debug','ShowDeskAccount','lodash','util','moment','bluebird'];(function(_0x53342c,_0x37cfb6){var _0x3aa61e=function(_0x3312f8){while(--_0x3312f8){_0x53342c['push'](_0x53342c['shift']());}};_0x3aa61e(++_0x37cfb6);}(_0x1d5a,0x167));var _0xa1d5=function(_0x1ed19e,_0x9f0303){_0x1ed19e=_0x1ed19e-0x0;var _0x44c919=_0x1d5a[_0x1ed19e];return _0x44c919;};'use strict';var _=require(_0xa1d5('0x0'));var util=require(_0xa1d5('0x1'));var moment=require(_0xa1d5('0x2'));var BPromise=require(_0xa1d5('0x3'));var rs=require(_0xa1d5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1d5('0x5'))['db'];var utils=require(_0xa1d5('0x6'));var logger=require('../../config/logger')(_0xa1d5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1d5('0x8'));var client=jayson[_0xa1d5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef0a4,_0xadd9bd,_0x5b410e){return new BPromise(function(_0x5bfb18,_0x3d1f6b){return client[_0xa1d5('0xa')](_0x4ef0a4,_0x5b410e)[_0xa1d5('0xb')](function(_0x599926){logger[_0xa1d5('0xc')](_0xa1d5('0xd'),_0xadd9bd,_0xa1d5('0xe'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0xadd9bd,'request\x20sent',JSON[_0xa1d5('0xf')](_0x599926));if(_0x599926[_0xa1d5('0x10')]){if(_0x599926[_0xa1d5('0x10')][_0xa1d5('0x11')]===0x1f4){logger['error'](_0xa1d5('0xd'),_0xadd9bd,_0x599926[_0xa1d5('0x10')][_0xa1d5('0x12')]);return _0x3d1f6b(_0x599926[_0xa1d5('0x10')][_0xa1d5('0x12')]);}logger[_0xa1d5('0x10')]('DeskAccount,\x20%s,\x20%s',_0xadd9bd,_0x599926['error'][_0xa1d5('0x12')]);return _0x5bfb18(_0x599926[_0xa1d5('0x10')][_0xa1d5('0x12')]);}else{logger[_0xa1d5('0xc')](_0xa1d5('0xd'),_0xadd9bd,_0xa1d5('0xe'));_0x5bfb18(_0x599926[_0xa1d5('0x13')]['message']);}})[_0xa1d5('0x14')](function(_0x3a8f01){logger[_0xa1d5('0x10')](_0xa1d5('0xd'),_0xadd9bd,_0x3a8f01);_0x3d1f6b(_0x3a8f01);});});}exports[_0xa1d5('0x15')]=function(_0x316e94){var _0x22e8d1=this;return new Promise(function(_0x59a605,_0x42f6ef){return db[_0xa1d5('0x16')][_0xa1d5('0x17')]({'raw':_0x316e94['options']?_0x316e94['options'][_0xa1d5('0x18')]===undefined?!![]:![]:!![],'where':_0x316e94[_0xa1d5('0x19')]?_0x316e94[_0xa1d5('0x19')][_0xa1d5('0x1a')]||null:null,'attributes':_0x316e94['options']?_0x316e94[_0xa1d5('0x19')][_0xa1d5('0x1b')]||null:null,'limit':_0x316e94[_0xa1d5('0x19')]?_0x316e94[_0xa1d5('0x19')]['limit']||null:null,'include':_0x316e94[_0xa1d5('0x19')]?_0x316e94[_0xa1d5('0x19')]['include']?_[_0xa1d5('0x1c')](_0x316e94[_0xa1d5('0x19')]['include'],function(_0x10f898){return{'model':db[_0x10f898[_0xa1d5('0x1d')]],'as':_0x10f898['as'],'attributes':_0x10f898[_0xa1d5('0x1b')],'include':_0x10f898[_0xa1d5('0x1e')]?_[_0xa1d5('0x1c')](_0x10f898[_0xa1d5('0x1e')],function(_0x4ba6c9){return{'model':db[_0x4ba6c9[_0xa1d5('0x1d')]],'as':_0x4ba6c9['as'],'attributes':_0x4ba6c9['attributes'],'include':_0x4ba6c9[_0xa1d5('0x1e')]?_[_0xa1d5('0x1c')](_0x4ba6c9['include'],function(_0xde2286){return{'model':db[_0xde2286[_0xa1d5('0x1d')]],'as':_0xde2286['as'],'attributes':_0xde2286[_0xa1d5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa1d5('0xb')](function(_0x1667f8){logger[_0xa1d5('0xc')](_0xa1d5('0x15'),_0x316e94);logger[_0xa1d5('0x1f')]('GetDeskAccount',_0x316e94,JSON['stringify'](_0x1667f8));_0x59a605(_0x1667f8);})['catch'](function(_0x4dccd3){logger['error'](_0xa1d5('0x15'),_0x4dccd3[_0xa1d5('0x12')],_0x316e94);_0x42f6ef(_0x22e8d1[_0xa1d5('0x10')](0x1f4,_0x4dccd3[_0xa1d5('0x12')]));});});};exports['ShowDeskAccount']=function(_0x505026){var _0x5a3880=this;return new Promise(function(_0x15b794,_0x5a9173){return db[_0xa1d5('0x16')]['find']({'raw':_0x505026['options']?_0x505026[_0xa1d5('0x19')][_0xa1d5('0x18')]===undefined?!![]:![]:!![],'where':_0x505026[_0xa1d5('0x19')]?_0x505026[_0xa1d5('0x19')][_0xa1d5('0x1a')]||null:null,'attributes':_0x505026[_0xa1d5('0x19')]?_0x505026[_0xa1d5('0x19')][_0xa1d5('0x1b')]||null:null,'include':_0x505026['options']?_0x505026['options'][_0xa1d5('0x1e')]?_[_0xa1d5('0x1c')](_0x505026[_0xa1d5('0x19')][_0xa1d5('0x1e')],function(_0x253026){return{'model':db[_0x253026['model']],'as':_0x253026['as'],'attributes':_0x253026[_0xa1d5('0x1b')],'include':_0x253026[_0xa1d5('0x1e')]?_[_0xa1d5('0x1c')](_0x253026[_0xa1d5('0x1e')],function(_0x410caf){return{'model':db[_0x410caf[_0xa1d5('0x1d')]],'as':_0x410caf['as'],'attributes':_0x410caf[_0xa1d5('0x1b')],'include':_0x410caf['include']?_['map'](_0x410caf[_0xa1d5('0x1e')],function(_0x274bba){return{'model':db[_0x274bba[_0xa1d5('0x1d')]],'as':_0x274bba['as'],'attributes':_0x274bba['attributes']};}):[]};}):[]};}):[]:[]})[_0xa1d5('0xb')](function(_0x277231){logger[_0xa1d5('0xc')]('ShowDeskAccount',_0x505026);logger[_0xa1d5('0x1f')](_0xa1d5('0x20'),_0x505026,JSON['stringify'](_0x277231));_0x15b794(_0x277231);})[_0xa1d5('0x14')](function(_0x113112){logger[_0xa1d5('0x10')](_0xa1d5('0x20'),_0x113112['message'],_0x505026);_0x5a9173(_0x5a3880[_0xa1d5('0x10')](0x1f4,_0x113112[_0xa1d5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 1d602b8..e1942ed 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x55ca,0x126));var _0xa55c=function(_0x41af7c,_0x1ffcfa){_0x41af7c=_0x41af7c-0x0;var _0x3ee1a2=_0x55ca[_0x41af7c];return _0x3ee1a2;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x3d7ecb,_0x3c1ba1){var _0x299128=function(_0x44e616){while(--_0x44e616){_0x3d7ecb['push'](_0x3d7ecb['shift']());}};_0x299128(++_0x3c1ba1);}(_0x3e74,0x175));var _0x43e7=function(_0x432519,_0x300cbc){_0x432519=_0x432519-0x0;var _0x5d2e28=_0x3e74[_0x432519];return _0x5d2e28;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index cf6e54f..6b8d027 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 _0x5360=['exports','STRING'];(function(_0x3d7fa1,_0x340c0e){var _0x4f5e46=function(_0x587608){while(--_0x587608){_0x3d7fa1['push'](_0x3d7fa1['shift']());}};_0x4f5e46(++_0x340c0e);}(_0x5360,0x146));var _0x0536=function(_0x1e39cd,_0x3fbd10){_0x1e39cd=_0x1e39cd-0x0;var _0x550cb8=_0x5360[_0x1e39cd];return _0x550cb8;};'use strict';var Sequelize=require('sequelize');module[_0x0536('0x0')]={'name':{'type':Sequelize[_0x0536('0x1')]},'description':{'type':Sequelize[_0x0536('0x1')]}}; \ No newline at end of file +var _0xad4f=['exports','STRING'];(function(_0x8c5cb5,_0x361d56){var _0x101ea5=function(_0x2aee4b){while(--_0x2aee4b){_0x8c5cb5['push'](_0x8c5cb5['shift']());}};_0x101ea5(++_0x361d56);}(_0xad4f,0x1ba));var _0xfad4=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xad4f[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require('sequelize');module[_0xfad4('0x0')]={'name':{'type':Sequelize[_0xfad4('0x1')]},'description':{'type':Sequelize[_0xfad4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2fa4720..b30916f 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 _0x99f2=['query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','then','include','findAll','show','params','rawAttributes','length','includeAll','find','catch','create','body','getFields','findOne','getSubjects','DeskField','getDescriptions','Tag','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','set','Content-Range','update','destroy','stack','name','send','index','map','DeskConfiguration','fieldName','model'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x99f2,0xc8));var _0x299f=function(_0x16f6fe,_0x12f5a6){_0x16f6fe=_0x16f6fe-0x0;var _0x516483=_0x99f2[_0x16f6fe];return _0x516483;};'use strict';var emlformat=require(_0x299f('0x0'));var rimraf=require(_0x299f('0x1'));var zipdir=require(_0x299f('0x2'));var jsonpatch=require(_0x299f('0x3'));var rp=require(_0x299f('0x4'));var moment=require(_0x299f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x299f('0x6'));var path=require(_0x299f('0x7'));var sox=require(_0x299f('0x8'));var csv=require(_0x299f('0x9'));var ejs=require(_0x299f('0xa'));var fs=require('fs');var fs_extra=require(_0x299f('0xb'));var _=require(_0x299f('0xc'));var squel=require(_0x299f('0xd'));var crypto=require('crypto');var jsforce=require(_0x299f('0xe'));var deskjs=require(_0x299f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x299f('0x10'));var Papa=require(_0x299f('0x11'));var Redis=require(_0x299f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x299f('0x13'));var hardwareService=require(_0x299f('0x14'));var logger=require(_0x299f('0x15'))(_0x299f('0x16'));var utils=require('../../config/utils');var config=require(_0x299f('0x17'));var licenseUtil=require(_0x299f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27b3ef,_0x41653b){_0x41653b=_0x41653b||0xcc;return function(_0x4d2d61){if(_0x4d2d61){return _0x27b3ef[_0x299f('0x19')](_0x41653b);}return _0x27b3ef[_0x299f('0x1a')](_0x41653b)[_0x299f('0x1b')]();};}function respondWithResult(_0x19bf54,_0x158dbd){_0x158dbd=_0x158dbd||0xc8;return function(_0x57f39f){if(_0x57f39f){return _0x19bf54[_0x299f('0x1a')](_0x158dbd)['json'](_0x57f39f);}};}function respondWithFilteredResult(_0x387478,_0x31b06d){return function(_0x520497){if(_0x520497){var _0x53e480=typeof _0x31b06d[_0x299f('0x1c')]===_0x299f('0x1d')&&typeof _0x31b06d[_0x299f('0x1e')]===_0x299f('0x1d');var _0x29f683=_0x520497['count'];var _0x43f5a2=_0x53e480?0x0:_0x31b06d[_0x299f('0x1c')];var _0x474e27=_0x53e480?_0x520497['count']:_0x31b06d[_0x299f('0x1c')]+_0x31b06d[_0x299f('0x1e')];var _0x2752fc;if(_0x474e27>=_0x29f683){_0x474e27=_0x29f683;_0x2752fc=0xc8;}else{_0x2752fc=0xce;}_0x387478[_0x299f('0x1a')](_0x2752fc);return _0x387478[_0x299f('0x1f')](_0x299f('0x20'),_0x43f5a2+'-'+_0x474e27+'/'+_0x29f683)['json'](_0x520497);}return null;};}function patchUpdates(_0x43a663){return function(_0x3383d9){try{jsonpatch['apply'](_0x3383d9,_0x43a663,!![]);}catch(_0x58496e){return BPromise['reject'](_0x58496e);}return _0x3383d9['save']();};}function saveUpdates(_0xdec2da,_0x577c0f){return function(_0x167659){if(_0x167659){return _0x167659[_0x299f('0x21')](_0xdec2da)['then'](function(_0x1b85c3){return _0x1b85c3;});}return null;};}function removeEntity(_0x47f8c9,_0x1d8b5f){return function(_0xa68ca0){if(_0xa68ca0){return _0xa68ca0[_0x299f('0x22')]()['then'](function(){_0x47f8c9[_0x299f('0x1a')](0xcc)[_0x299f('0x1b')]();});}};}function handleEntityNotFound(_0x1fcf68,_0x48a6d6){return function(_0x3816a8){if(!_0x3816a8){_0x1fcf68[_0x299f('0x19')](0x194);}return _0x3816a8;};}function handleError(_0x5add14,_0x4875e3){_0x4875e3=_0x4875e3||0x1f4;return function(_0x424fd5){logger['error'](_0x424fd5[_0x299f('0x23')]);if(_0x424fd5[_0x299f('0x24')]){delete _0x424fd5[_0x299f('0x24')];}_0x5add14[_0x299f('0x1a')](_0x4875e3)[_0x299f('0x25')](_0x424fd5);};}exports[_0x299f('0x26')]=function(_0x42b75d,_0x2d66b2){var _0x3b92cb={},_0x1d8901={},_0x2d6bdd={'count':0x0,'rows':[]};var _0xa1b3a4=_[_0x299f('0x27')](db[_0x299f('0x28')]['rawAttributes'],function(_0x172777){return{'name':_0x172777[_0x299f('0x29')],'type':_0x172777['type']['key']};});_0x1d8901[_0x299f('0x2a')]=_[_0x299f('0x27')](_0xa1b3a4,_0x299f('0x24'));_0x1d8901[_0x299f('0x2b')]=_[_0x299f('0x2c')](_0x42b75d[_0x299f('0x2b')]);_0x1d8901[_0x299f('0x2d')]=_[_0x299f('0x2e')](_0x1d8901[_0x299f('0x2a')],_0x1d8901[_0x299f('0x2b')]);_0x3b92cb[_0x299f('0x2f')]=_['intersection'](_0x1d8901[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x42b75d[_0x299f('0x2b')]['fields']));_0x3b92cb['attributes']=_0x3b92cb['attributes']['length']?_0x3b92cb[_0x299f('0x2f')]:_0x1d8901[_0x299f('0x2a')];if(!_0x42b75d[_0x299f('0x2b')][_0x299f('0x31')](_0x299f('0x32'))){_0x3b92cb[_0x299f('0x1e')]=qs[_0x299f('0x1e')](_0x42b75d[_0x299f('0x2b')][_0x299f('0x1e')]);_0x3b92cb['offset']=qs['offset'](_0x42b75d['query']['offset']);}_0x3b92cb[_0x299f('0x33')]=qs[_0x299f('0x34')](_0x42b75d[_0x299f('0x2b')][_0x299f('0x34')]);_0x3b92cb[_0x299f('0x35')]=qs[_0x299f('0x2d')](_[_0x299f('0x36')](_0x42b75d[_0x299f('0x2b')],_0x1d8901[_0x299f('0x2d')]),_0xa1b3a4);if(_0x42b75d[_0x299f('0x2b')][_0x299f('0x37')]){_0x3b92cb['where']=_[_0x299f('0x38')](_0x3b92cb[_0x299f('0x35')],{'$or':_[_0x299f('0x27')](_0xa1b3a4,function(_0x590f1a){if(_0x590f1a[_0x299f('0x39')]!==_0x299f('0x3a')){var _0x1c1bd7={};_0x1c1bd7[_0x590f1a['name']]={'$like':'%'+_0x42b75d[_0x299f('0x2b')][_0x299f('0x37')]+'%'};return _0x1c1bd7;}})});}_0x3b92cb=_['merge']({},_0x3b92cb,_0x42b75d[_0x299f('0x3b')]);var _0x2d048c={'where':_0x3b92cb[_0x299f('0x35')]};return db[_0x299f('0x28')][_0x299f('0x3c')](_0x2d048c)[_0x299f('0x3d')](function(_0x386487){_0x2d6bdd[_0x299f('0x3c')]=_0x386487;if(_0x42b75d['query']['includeAll']){_0x3b92cb[_0x299f('0x3e')]=[{'all':!![]}];}return db[_0x299f('0x28')][_0x299f('0x3f')](_0x3b92cb);})[_0x299f('0x3d')](function(_0x4e26d2){_0x2d6bdd['rows']=_0x4e26d2;return _0x2d6bdd;})['then'](respondWithFilteredResult(_0x2d66b2,_0x3b92cb))['catch'](handleError(_0x2d66b2,null));};exports[_0x299f('0x40')]=function(_0x3a8fcd,_0x53780e){var _0x7493c2={'raw':![],'where':{'id':_0x3a8fcd[_0x299f('0x41')]['id']}},_0x382b4b={};_0x382b4b['model']=_[_0x299f('0x2c')](db[_0x299f('0x28')][_0x299f('0x42')]);_0x382b4b[_0x299f('0x2b')]=_[_0x299f('0x2c')](_0x3a8fcd[_0x299f('0x2b')]);_0x382b4b['filters']=_[_0x299f('0x2e')](_0x382b4b['model'],_0x382b4b[_0x299f('0x2b')]);_0x7493c2[_0x299f('0x2f')]=_[_0x299f('0x2e')](_0x382b4b[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x3a8fcd[_0x299f('0x2b')][_0x299f('0x30')]));_0x7493c2['attributes']=_0x7493c2[_0x299f('0x2f')][_0x299f('0x43')]?_0x7493c2[_0x299f('0x2f')]:_0x382b4b[_0x299f('0x2a')];if(_0x3a8fcd[_0x299f('0x2b')][_0x299f('0x44')]){_0x7493c2[_0x299f('0x3e')]=[{'all':!![]}];}_0x7493c2=_[_0x299f('0x38')]({},_0x7493c2,_0x3a8fcd[_0x299f('0x3b')]);return db['DeskConfiguration'][_0x299f('0x45')](_0x7493c2)[_0x299f('0x3d')](handleEntityNotFound(_0x53780e,null))[_0x299f('0x3d')](respondWithResult(_0x53780e,null))[_0x299f('0x46')](handleError(_0x53780e,null));};exports[_0x299f('0x47')]=function(_0x42f654,_0x1de868){return db[_0x299f('0x28')][_0x299f('0x47')](_0x42f654[_0x299f('0x48')],{})[_0x299f('0x3d')](respondWithResult(_0x1de868,0xc9))[_0x299f('0x46')](handleError(_0x1de868,null));};exports[_0x299f('0x21')]=function(_0xe9790b,_0x5db0ce){if(_0xe9790b[_0x299f('0x48')]['id']){delete _0xe9790b[_0x299f('0x48')]['id'];}return db[_0x299f('0x28')]['find']({'where':{'id':_0xe9790b[_0x299f('0x41')]['id']}})[_0x299f('0x3d')](handleEntityNotFound(_0x5db0ce,null))[_0x299f('0x3d')](saveUpdates(_0xe9790b['body'],null))['then'](respondWithResult(_0x5db0ce,null))[_0x299f('0x46')](handleError(_0x5db0ce,null));};exports[_0x299f('0x22')]=function(_0x2767ec,_0x5ea14f){return db[_0x299f('0x28')][_0x299f('0x45')]({'where':{'id':_0x2767ec['params']['id']}})[_0x299f('0x3d')](handleEntityNotFound(_0x5ea14f,null))[_0x299f('0x3d')](removeEntity(_0x5ea14f,null))[_0x299f('0x46')](handleError(_0x5ea14f,null));};exports[_0x299f('0x49')]=function(_0x103109,_0x91c575,_0x10f9c3){var _0x3da6e7={};var _0x21bb92={};var _0x76b008;var _0x500171;return db['DeskConfiguration'][_0x299f('0x4a')]({'where':{'id':_0x103109[_0x299f('0x41')]['id']}})[_0x299f('0x3d')](handleEntityNotFound(_0x91c575,null))[_0x299f('0x3d')](function(_0x368740){if(_0x368740){_0x76b008=_0x368740;_0x21bb92[_0x299f('0x2a')]=_[_0x299f('0x2c')](db['DeskField'][_0x299f('0x42')]);_0x21bb92[_0x299f('0x2b')]=_['keys'](_0x103109[_0x299f('0x2b')]);_0x21bb92[_0x299f('0x2d')]=_[_0x299f('0x2e')](_0x21bb92[_0x299f('0x2a')],_0x21bb92[_0x299f('0x2b')]);_0x3da6e7[_0x299f('0x2f')]=_[_0x299f('0x2e')](_0x21bb92[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x103109[_0x299f('0x2b')][_0x299f('0x30')]));_0x3da6e7[_0x299f('0x2f')]=_0x3da6e7[_0x299f('0x2f')]['length']?_0x3da6e7[_0x299f('0x2f')]:_0x21bb92['model'];_0x3da6e7['order']=qs[_0x299f('0x34')](_0x103109[_0x299f('0x2b')][_0x299f('0x34')]);_0x3da6e7[_0x299f('0x35')]=qs[_0x299f('0x2d')](_[_0x299f('0x36')](_0x103109['query'],_0x21bb92['filters']));if(_0x103109[_0x299f('0x2b')][_0x299f('0x37')]){_0x3da6e7[_0x299f('0x35')]=_[_0x299f('0x38')](_0x3da6e7[_0x299f('0x35')],{'$or':_['map'](_0x3da6e7[_0x299f('0x2f')],function(_0x14d184){var _0x359b96={};_0x359b96[_0x14d184]={'$like':'%'+_0x103109[_0x299f('0x2b')]['filter']+'%'};return _0x359b96;})});}_0x3da6e7=_['merge']({},_0x3da6e7,_0x103109[_0x299f('0x3b')]);return _0x76b008[_0x299f('0x49')](_0x3da6e7);}})[_0x299f('0x3d')](function(_0x265779){if(_0x265779){_0x500171=_0x265779[_0x299f('0x43')];if(!_0x103109[_0x299f('0x2b')][_0x299f('0x31')](_0x299f('0x32'))){_0x3da6e7[_0x299f('0x1e')]=qs[_0x299f('0x1e')](_0x103109[_0x299f('0x2b')]['limit']);_0x3da6e7[_0x299f('0x1c')]=qs[_0x299f('0x1c')](_0x103109[_0x299f('0x2b')][_0x299f('0x1c')]);}return _0x76b008['getFields'](_0x3da6e7);}})[_0x299f('0x3d')](function(_0x949f40){if(_0x949f40){return _0x949f40?{'count':_0x500171,'rows':_0x949f40}:null;}})[_0x299f('0x3d')](respondWithResult(_0x91c575,null))[_0x299f('0x46')](handleError(_0x91c575,null));};exports[_0x299f('0x4b')]=function(_0x1a9270,_0x563649,_0x51e2ca){var _0x43e5f0={};var _0x3f6393={};var _0x3c1bc3;var _0x38a377;return db[_0x299f('0x28')][_0x299f('0x4a')]({'where':{'id':_0x1a9270[_0x299f('0x41')]['id']}})[_0x299f('0x3d')](handleEntityNotFound(_0x563649,null))[_0x299f('0x3d')](function(_0x420114){if(_0x420114){_0x3c1bc3=_0x420114;_0x3f6393['model']=_[_0x299f('0x2c')](db[_0x299f('0x4c')][_0x299f('0x42')]);_0x3f6393[_0x299f('0x2b')]=_['keys'](_0x1a9270[_0x299f('0x2b')]);_0x3f6393[_0x299f('0x2d')]=_[_0x299f('0x2e')](_0x3f6393[_0x299f('0x2a')],_0x3f6393[_0x299f('0x2b')]);_0x43e5f0[_0x299f('0x2f')]=_['intersection'](_0x3f6393[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x1a9270[_0x299f('0x2b')][_0x299f('0x30')]));_0x43e5f0['attributes']=_0x43e5f0[_0x299f('0x2f')][_0x299f('0x43')]?_0x43e5f0['attributes']:_0x3f6393['model'];_0x43e5f0['order']=qs['sort'](_0x1a9270[_0x299f('0x2b')][_0x299f('0x34')]);_0x43e5f0[_0x299f('0x35')]=qs[_0x299f('0x2d')](_[_0x299f('0x36')](_0x1a9270[_0x299f('0x2b')],_0x3f6393[_0x299f('0x2d')]));if(_0x1a9270[_0x299f('0x2b')][_0x299f('0x37')]){_0x43e5f0[_0x299f('0x35')]=_[_0x299f('0x38')](_0x43e5f0[_0x299f('0x35')],{'$or':_[_0x299f('0x27')](_0x43e5f0[_0x299f('0x2f')],function(_0x3a9957){var _0x3af776={};_0x3af776[_0x3a9957]={'$like':'%'+_0x1a9270[_0x299f('0x2b')][_0x299f('0x37')]+'%'};return _0x3af776;})});}_0x43e5f0=_[_0x299f('0x38')]({},_0x43e5f0,_0x1a9270[_0x299f('0x3b')]);return _0x3c1bc3[_0x299f('0x4b')](_0x43e5f0);}})[_0x299f('0x3d')](function(_0x1ceb62){if(_0x1ceb62){_0x38a377=_0x1ceb62['length'];if(!_0x1a9270[_0x299f('0x2b')][_0x299f('0x31')]('nolimit')){_0x43e5f0[_0x299f('0x1e')]=qs[_0x299f('0x1e')](_0x1a9270['query'][_0x299f('0x1e')]);_0x43e5f0[_0x299f('0x1c')]=qs[_0x299f('0x1c')](_0x1a9270[_0x299f('0x2b')]['offset']);}return _0x3c1bc3[_0x299f('0x4b')](_0x43e5f0);}})[_0x299f('0x3d')](function(_0x176039){if(_0x176039){return _0x176039?{'count':_0x38a377,'rows':_0x176039}:null;}})[_0x299f('0x3d')](respondWithResult(_0x563649,null))[_0x299f('0x46')](handleError(_0x563649,null));};exports['getDescriptions']=function(_0x256667,_0x204b1a,_0x47b258){var _0x3d16d2={};var _0x5891dc={};var _0x15470d;var _0x9a18a6;return db[_0x299f('0x28')][_0x299f('0x4a')]({'where':{'id':_0x256667[_0x299f('0x41')]['id']}})[_0x299f('0x3d')](handleEntityNotFound(_0x204b1a,null))['then'](function(_0xe52f59){if(_0xe52f59){_0x15470d=_0xe52f59;_0x5891dc[_0x299f('0x2a')]=_[_0x299f('0x2c')](db[_0x299f('0x4c')][_0x299f('0x42')]);_0x5891dc[_0x299f('0x2b')]=_['keys'](_0x256667['query']);_0x5891dc[_0x299f('0x2d')]=_[_0x299f('0x2e')](_0x5891dc[_0x299f('0x2a')],_0x5891dc['query']);_0x3d16d2['attributes']=_[_0x299f('0x2e')](_0x5891dc[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x256667[_0x299f('0x2b')][_0x299f('0x30')]));_0x3d16d2[_0x299f('0x2f')]=_0x3d16d2[_0x299f('0x2f')]['length']?_0x3d16d2[_0x299f('0x2f')]:_0x5891dc[_0x299f('0x2a')];_0x3d16d2[_0x299f('0x33')]=qs[_0x299f('0x34')](_0x256667[_0x299f('0x2b')]['sort']);_0x3d16d2[_0x299f('0x35')]=qs['filters'](_['pick'](_0x256667[_0x299f('0x2b')],_0x5891dc[_0x299f('0x2d')]));if(_0x256667[_0x299f('0x2b')][_0x299f('0x37')]){_0x3d16d2[_0x299f('0x35')]=_[_0x299f('0x38')](_0x3d16d2[_0x299f('0x35')],{'$or':_[_0x299f('0x27')](_0x3d16d2[_0x299f('0x2f')],function(_0x5d9bae){var _0x342185={};_0x342185[_0x5d9bae]={'$like':'%'+_0x256667[_0x299f('0x2b')][_0x299f('0x37')]+'%'};return _0x342185;})});}_0x3d16d2=_[_0x299f('0x38')]({},_0x3d16d2,_0x256667['options']);return _0x15470d['getDescriptions'](_0x3d16d2);}})[_0x299f('0x3d')](function(_0x8c8138){if(_0x8c8138){_0x9a18a6=_0x8c8138[_0x299f('0x43')];if(!_0x256667[_0x299f('0x2b')][_0x299f('0x31')](_0x299f('0x32'))){_0x3d16d2[_0x299f('0x1e')]=qs['limit'](_0x256667['query'][_0x299f('0x1e')]);_0x3d16d2[_0x299f('0x1c')]=qs[_0x299f('0x1c')](_0x256667['query'][_0x299f('0x1c')]);}return _0x15470d[_0x299f('0x4d')](_0x3d16d2);}})['then'](function(_0x232083){if(_0x232083){return _0x232083?{'count':_0x9a18a6,'rows':_0x232083}:null;}})['then'](respondWithResult(_0x204b1a,null))['catch'](handleError(_0x204b1a,null));};exports['getTags']=function(_0x3d01b9,_0x43755f,_0x5a7deb){var _0x177788={};var _0x589876={};var _0x5ea26c;var _0x3aa649;return db[_0x299f('0x28')]['findOne']({'where':{'id':_0x3d01b9['params']['id']}})['then'](handleEntityNotFound(_0x43755f,null))['then'](function(_0x24d6a7){if(_0x24d6a7){_0x5ea26c=_0x24d6a7;_0x589876['model']=_[_0x299f('0x2c')](db[_0x299f('0x4e')][_0x299f('0x42')]);_0x589876[_0x299f('0x2b')]=_[_0x299f('0x2c')](_0x3d01b9[_0x299f('0x2b')]);_0x589876[_0x299f('0x2d')]=_[_0x299f('0x2e')](_0x589876[_0x299f('0x2a')],_0x589876['query']);_0x177788[_0x299f('0x2f')]=_[_0x299f('0x2e')](_0x589876[_0x299f('0x2a')],qs[_0x299f('0x30')](_0x3d01b9[_0x299f('0x2b')][_0x299f('0x30')]));_0x177788['attributes']=_0x177788['attributes'][_0x299f('0x43')]?_0x177788[_0x299f('0x2f')]:_0x589876['model'];_0x177788['order']=qs['sort'](_0x3d01b9[_0x299f('0x2b')]['sort']);_0x177788[_0x299f('0x35')]=qs[_0x299f('0x2d')](_['pick'](_0x3d01b9[_0x299f('0x2b')],_0x589876[_0x299f('0x2d')]));if(_0x3d01b9[_0x299f('0x2b')][_0x299f('0x37')]){_0x177788[_0x299f('0x35')]=_[_0x299f('0x38')](_0x177788['where'],{'$or':_[_0x299f('0x27')](_0x177788[_0x299f('0x2f')],function(_0x596b09){var _0x1ae906={};_0x1ae906[_0x596b09]={'$like':'%'+_0x3d01b9[_0x299f('0x2b')][_0x299f('0x37')]+'%'};return _0x1ae906;})});}_0x177788=_[_0x299f('0x38')]({},_0x177788,_0x3d01b9[_0x299f('0x3b')]);return _0x5ea26c['getTags'](_0x177788);}})[_0x299f('0x3d')](function(_0x48f40d){if(_0x48f40d){_0x3aa649=_0x48f40d['length'];if(!_0x3d01b9[_0x299f('0x2b')][_0x299f('0x31')](_0x299f('0x32'))){_0x177788[_0x299f('0x1e')]=qs[_0x299f('0x1e')](_0x3d01b9[_0x299f('0x2b')]['limit']);_0x177788[_0x299f('0x1c')]=qs[_0x299f('0x1c')](_0x3d01b9[_0x299f('0x2b')]['offset']);}return _0x5ea26c[_0x299f('0x4f')](_0x177788);}})[_0x299f('0x3d')](function(_0x392684){if(_0x392684){return _0x392684?{'count':_0x3aa649,'rows':_0x392684}:null;}})[_0x299f('0x3d')](respondWithResult(_0x43755f,null))[_0x299f('0x46')](handleError(_0x43755f,null));};exports['setTags']=function(_0x55cb65,_0x26a676,_0x3a7a29){if(_0x55cb65['body']['id']){delete _0x55cb65['body']['id'];}return db[_0x299f('0x28')][_0x299f('0x4a')]({'where':{'id':_0x55cb65['params']['id']}})['then'](handleEntityNotFound(_0x26a676,null))[_0x299f('0x3d')](function(_0x2d3aa3){if(_0x2d3aa3){return _0x2d3aa3['setTags'](_0x55cb65[_0x299f('0x48')][_0x299f('0x50')]||[]);}return null;})[_0x299f('0x3d')](respondWithResult(_0x26a676,null))['catch'](handleError(_0x26a676,null));}; \ No newline at end of file +var _0x5d96=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','save','update','then','destroy','error','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','keys','rawAttributes','fields','find','create','body','getFields','findOne','DeskField','order','options','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x50a5a1,_0x3744fb){var _0x4efac0=function(_0x315a83){while(--_0x315a83){_0x50a5a1['push'](_0x50a5a1['shift']());}};_0x4efac0(++_0x3744fb);}(_0x5d96,0xee));var _0x65d9=function(_0x150ef5,_0x3a3644){_0x150ef5=_0x150ef5-0x0;var _0x3b9b88=_0x5d96[_0x150ef5];return _0x3b9b88;};'use strict';var emlformat=require(_0x65d9('0x0'));var rimraf=require(_0x65d9('0x1'));var zipdir=require(_0x65d9('0x2'));var jsonpatch=require(_0x65d9('0x3'));var rp=require('request-promise');var moment=require(_0x65d9('0x4'));var BPromise=require(_0x65d9('0x5'));var Mustache=require(_0x65d9('0x6'));var util=require(_0x65d9('0x7'));var path=require(_0x65d9('0x8'));var sox=require(_0x65d9('0x9'));var csv=require('to-csv');var ejs=require(_0x65d9('0xa'));var fs=require('fs');var fs_extra=require(_0x65d9('0xb'));var _=require(_0x65d9('0xc'));var squel=require(_0x65d9('0xd'));var crypto=require('crypto');var jsforce=require(_0x65d9('0xe'));var deskjs=require(_0x65d9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x65d9('0x10'));var Papa=require('papaparse');var Redis=require(_0x65d9('0x11'));var authService=require(_0x65d9('0x12'));var qs=require(_0x65d9('0x13'));var as=require(_0x65d9('0x14'));var hardwareService=require(_0x65d9('0x15'));var logger=require('../../config/logger')(_0x65d9('0x16'));var utils=require(_0x65d9('0x17'));var config=require(_0x65d9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x65d9('0x19'))['db'];function respondWithStatusCode(_0x1ae8b3,_0x5cda0f){_0x5cda0f=_0x5cda0f||0xcc;return function(_0x4704f2){if(_0x4704f2){return _0x1ae8b3[_0x65d9('0x1a')](_0x5cda0f);}return _0x1ae8b3[_0x65d9('0x1b')](_0x5cda0f)[_0x65d9('0x1c')]();};}function respondWithResult(_0x5d64d5,_0x56bb4e){_0x56bb4e=_0x56bb4e||0xc8;return function(_0x32d9f6){if(_0x32d9f6){return _0x5d64d5[_0x65d9('0x1b')](_0x56bb4e)[_0x65d9('0x1d')](_0x32d9f6);}};}function respondWithFilteredResult(_0x3c5382,_0x1ffe79){return function(_0x1cabeb){if(_0x1cabeb){var _0x41eec7=typeof _0x1ffe79['offset']==='undefined'&&typeof _0x1ffe79['limit']===_0x65d9('0x1e');var _0x1b07ea=_0x1cabeb['count'];var _0x280365=_0x41eec7?0x0:_0x1ffe79[_0x65d9('0x1f')];var _0x326bde=_0x41eec7?_0x1cabeb[_0x65d9('0x20')]:_0x1ffe79['offset']+_0x1ffe79[_0x65d9('0x21')];var _0x2292a2;if(_0x326bde>=_0x1b07ea){_0x326bde=_0x1b07ea;_0x2292a2=0xc8;}else{_0x2292a2=0xce;}_0x3c5382[_0x65d9('0x1b')](_0x2292a2);return _0x3c5382[_0x65d9('0x22')](_0x65d9('0x23'),_0x280365+'-'+_0x326bde+'/'+_0x1b07ea)[_0x65d9('0x1d')](_0x1cabeb);}return null;};}function patchUpdates(_0x34be8e){return function(_0x43c4a9){try{jsonpatch['apply'](_0x43c4a9,_0x34be8e,!![]);}catch(_0x143768){return BPromise['reject'](_0x143768);}return _0x43c4a9[_0x65d9('0x24')]();};}function saveUpdates(_0x4464ee,_0x107db5){return function(_0x32d897){if(_0x32d897){return _0x32d897[_0x65d9('0x25')](_0x4464ee)[_0x65d9('0x26')](function(_0x5cc81d){return _0x5cc81d;});}return null;};}function removeEntity(_0x254366,_0x2b76e8){return function(_0x3c1414){if(_0x3c1414){return _0x3c1414[_0x65d9('0x27')]()[_0x65d9('0x26')](function(){_0x254366[_0x65d9('0x1b')](0xcc)[_0x65d9('0x1c')]();});}};}function handleEntityNotFound(_0xbc815a,_0x3fda34){return function(_0x229275){if(!_0x229275){_0xbc815a[_0x65d9('0x1a')](0x194);}return _0x229275;};}function handleError(_0x23eb30,_0x242fd7){_0x242fd7=_0x242fd7||0x1f4;return function(_0x45299e){logger[_0x65d9('0x28')](_0x45299e['stack']);if(_0x45299e[_0x65d9('0x29')]){delete _0x45299e['name'];}_0x23eb30[_0x65d9('0x1b')](_0x242fd7)[_0x65d9('0x2a')](_0x45299e);};}exports[_0x65d9('0x2b')]=function(_0x2948c7,_0x5e819c){var _0x41b195={},_0x1900f1={},_0x24995d={'count':0x0,'rows':[]};var _0x294028=_[_0x65d9('0x2c')](db[_0x65d9('0x2d')]['rawAttributes'],function(_0x501e70){return{'name':_0x501e70[_0x65d9('0x2e')],'type':_0x501e70[_0x65d9('0x2f')][_0x65d9('0x30')]};});_0x1900f1[_0x65d9('0x31')]=_['map'](_0x294028,_0x65d9('0x29'));_0x1900f1[_0x65d9('0x32')]=_['keys'](_0x2948c7[_0x65d9('0x32')]);_0x1900f1['filters']=_[_0x65d9('0x33')](_0x1900f1[_0x65d9('0x31')],_0x1900f1[_0x65d9('0x32')]);_0x41b195['attributes']=_['intersection'](_0x1900f1[_0x65d9('0x31')],qs['fields'](_0x2948c7['query']['fields']));_0x41b195[_0x65d9('0x34')]=_0x41b195[_0x65d9('0x34')][_0x65d9('0x35')]?_0x41b195[_0x65d9('0x34')]:_0x1900f1[_0x65d9('0x31')];if(!_0x2948c7[_0x65d9('0x32')][_0x65d9('0x36')]('nolimit')){_0x41b195['limit']=qs['limit'](_0x2948c7[_0x65d9('0x32')][_0x65d9('0x21')]);_0x41b195[_0x65d9('0x1f')]=qs[_0x65d9('0x1f')](_0x2948c7[_0x65d9('0x32')][_0x65d9('0x1f')]);}_0x41b195['order']=qs[_0x65d9('0x37')](_0x2948c7['query'][_0x65d9('0x37')]);_0x41b195[_0x65d9('0x38')]=qs[_0x65d9('0x39')](_[_0x65d9('0x3a')](_0x2948c7[_0x65d9('0x32')],_0x1900f1[_0x65d9('0x39')]),_0x294028);if(_0x2948c7[_0x65d9('0x32')]['filter']){_0x41b195[_0x65d9('0x38')]=_[_0x65d9('0x3b')](_0x41b195[_0x65d9('0x38')],{'$or':_[_0x65d9('0x2c')](_0x294028,function(_0x5b9a02){if(_0x5b9a02['type']!==_0x65d9('0x3c')){var _0x28ae4f={};_0x28ae4f[_0x5b9a02[_0x65d9('0x29')]]={'$like':'%'+_0x2948c7[_0x65d9('0x32')][_0x65d9('0x3d')]+'%'};return _0x28ae4f;}})});}_0x41b195=_[_0x65d9('0x3b')]({},_0x41b195,_0x2948c7['options']);var _0x2f7515={'where':_0x41b195['where']};return db['DeskConfiguration'][_0x65d9('0x20')](_0x2f7515)[_0x65d9('0x26')](function(_0x37c547){_0x24995d[_0x65d9('0x20')]=_0x37c547;if(_0x2948c7['query'][_0x65d9('0x3e')]){_0x41b195[_0x65d9('0x3f')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x41b195);})['then'](function(_0x144fc4){_0x24995d[_0x65d9('0x40')]=_0x144fc4;return _0x24995d;})[_0x65d9('0x26')](respondWithFilteredResult(_0x5e819c,_0x41b195))[_0x65d9('0x41')](handleError(_0x5e819c,null));};exports['show']=function(_0x4d2182,_0x3de41c){var _0x55db76={'raw':![],'where':{'id':_0x4d2182[_0x65d9('0x42')]['id']}},_0x413f6b={};_0x413f6b['model']=_[_0x65d9('0x43')](db[_0x65d9('0x2d')][_0x65d9('0x44')]);_0x413f6b['query']=_[_0x65d9('0x43')](_0x4d2182[_0x65d9('0x32')]);_0x413f6b[_0x65d9('0x39')]=_[_0x65d9('0x33')](_0x413f6b[_0x65d9('0x31')],_0x413f6b[_0x65d9('0x32')]);_0x55db76['attributes']=_[_0x65d9('0x33')](_0x413f6b['model'],qs[_0x65d9('0x45')](_0x4d2182[_0x65d9('0x32')]['fields']));_0x55db76[_0x65d9('0x34')]=_0x55db76[_0x65d9('0x34')][_0x65d9('0x35')]?_0x55db76['attributes']:_0x413f6b[_0x65d9('0x31')];if(_0x4d2182[_0x65d9('0x32')]['includeAll']){_0x55db76[_0x65d9('0x3f')]=[{'all':!![]}];}_0x55db76=_[_0x65d9('0x3b')]({},_0x55db76,_0x4d2182['options']);return db['DeskConfiguration'][_0x65d9('0x46')](_0x55db76)[_0x65d9('0x26')](handleEntityNotFound(_0x3de41c,null))[_0x65d9('0x26')](respondWithResult(_0x3de41c,null))[_0x65d9('0x41')](handleError(_0x3de41c,null));};exports[_0x65d9('0x47')]=function(_0x1fb300,_0x5d5158){return db[_0x65d9('0x2d')][_0x65d9('0x47')](_0x1fb300[_0x65d9('0x48')],{})[_0x65d9('0x26')](respondWithResult(_0x5d5158,0xc9))[_0x65d9('0x41')](handleError(_0x5d5158,null));};exports[_0x65d9('0x25')]=function(_0x11b240,_0x24d70e){if(_0x11b240[_0x65d9('0x48')]['id']){delete _0x11b240['body']['id'];}return db[_0x65d9('0x2d')][_0x65d9('0x46')]({'where':{'id':_0x11b240[_0x65d9('0x42')]['id']}})['then'](handleEntityNotFound(_0x24d70e,null))[_0x65d9('0x26')](saveUpdates(_0x11b240[_0x65d9('0x48')],null))[_0x65d9('0x26')](respondWithResult(_0x24d70e,null))[_0x65d9('0x41')](handleError(_0x24d70e,null));};exports[_0x65d9('0x27')]=function(_0x6707e1,_0x42364a){return db[_0x65d9('0x2d')][_0x65d9('0x46')]({'where':{'id':_0x6707e1['params']['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x42364a,null))[_0x65d9('0x26')](removeEntity(_0x42364a,null))[_0x65d9('0x41')](handleError(_0x42364a,null));};exports[_0x65d9('0x49')]=function(_0x478784,_0x287c9c,_0x26b2c1){var _0x1c758e={};var _0x13a6a4={};var _0x2239f8;var _0xa6140c;return db['DeskConfiguration'][_0x65d9('0x4a')]({'where':{'id':_0x478784[_0x65d9('0x42')]['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x287c9c,null))['then'](function(_0x21fa42){if(_0x21fa42){_0x2239f8=_0x21fa42;_0x13a6a4[_0x65d9('0x31')]=_['keys'](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x13a6a4[_0x65d9('0x32')]=_[_0x65d9('0x43')](_0x478784[_0x65d9('0x32')]);_0x13a6a4[_0x65d9('0x39')]=_[_0x65d9('0x33')](_0x13a6a4['model'],_0x13a6a4[_0x65d9('0x32')]);_0x1c758e['attributes']=_[_0x65d9('0x33')](_0x13a6a4[_0x65d9('0x31')],qs[_0x65d9('0x45')](_0x478784[_0x65d9('0x32')][_0x65d9('0x45')]));_0x1c758e[_0x65d9('0x34')]=_0x1c758e[_0x65d9('0x34')][_0x65d9('0x35')]?_0x1c758e[_0x65d9('0x34')]:_0x13a6a4[_0x65d9('0x31')];_0x1c758e[_0x65d9('0x4c')]=qs[_0x65d9('0x37')](_0x478784[_0x65d9('0x32')][_0x65d9('0x37')]);_0x1c758e['where']=qs['filters'](_['pick'](_0x478784[_0x65d9('0x32')],_0x13a6a4['filters']));if(_0x478784[_0x65d9('0x32')][_0x65d9('0x3d')]){_0x1c758e[_0x65d9('0x38')]=_[_0x65d9('0x3b')](_0x1c758e[_0x65d9('0x38')],{'$or':_[_0x65d9('0x2c')](_0x1c758e[_0x65d9('0x34')],function(_0x453677){var _0x253d41={};_0x253d41[_0x453677]={'$like':'%'+_0x478784[_0x65d9('0x32')][_0x65d9('0x3d')]+'%'};return _0x253d41;})});}_0x1c758e=_[_0x65d9('0x3b')]({},_0x1c758e,_0x478784[_0x65d9('0x4d')]);return _0x2239f8[_0x65d9('0x49')](_0x1c758e);}})[_0x65d9('0x26')](function(_0x4cabbc){if(_0x4cabbc){_0xa6140c=_0x4cabbc[_0x65d9('0x35')];if(!_0x478784[_0x65d9('0x32')][_0x65d9('0x36')](_0x65d9('0x4e'))){_0x1c758e[_0x65d9('0x21')]=qs[_0x65d9('0x21')](_0x478784[_0x65d9('0x32')][_0x65d9('0x21')]);_0x1c758e[_0x65d9('0x1f')]=qs[_0x65d9('0x1f')](_0x478784[_0x65d9('0x32')][_0x65d9('0x1f')]);}return _0x2239f8[_0x65d9('0x49')](_0x1c758e);}})['then'](function(_0x3dbf7c){if(_0x3dbf7c){return _0x3dbf7c?{'count':_0xa6140c,'rows':_0x3dbf7c}:null;}})[_0x65d9('0x26')](respondWithResult(_0x287c9c,null))['catch'](handleError(_0x287c9c,null));};exports[_0x65d9('0x4f')]=function(_0x2808f9,_0x156690,_0x44bfcf){var _0x4813d5={};var _0x211dee={};var _0x74b412;var _0x42c2e0;return db['DeskConfiguration'][_0x65d9('0x4a')]({'where':{'id':_0x2808f9[_0x65d9('0x42')]['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x156690,null))['then'](function(_0x183858){if(_0x183858){_0x74b412=_0x183858;_0x211dee[_0x65d9('0x31')]=_[_0x65d9('0x43')](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x211dee[_0x65d9('0x32')]=_['keys'](_0x2808f9['query']);_0x211dee[_0x65d9('0x39')]=_[_0x65d9('0x33')](_0x211dee[_0x65d9('0x31')],_0x211dee[_0x65d9('0x32')]);_0x4813d5[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x211dee[_0x65d9('0x31')],qs[_0x65d9('0x45')](_0x2808f9['query'][_0x65d9('0x45')]));_0x4813d5[_0x65d9('0x34')]=_0x4813d5[_0x65d9('0x34')][_0x65d9('0x35')]?_0x4813d5[_0x65d9('0x34')]:_0x211dee[_0x65d9('0x31')];_0x4813d5['order']=qs[_0x65d9('0x37')](_0x2808f9[_0x65d9('0x32')][_0x65d9('0x37')]);_0x4813d5[_0x65d9('0x38')]=qs['filters'](_[_0x65d9('0x3a')](_0x2808f9[_0x65d9('0x32')],_0x211dee['filters']));if(_0x2808f9[_0x65d9('0x32')][_0x65d9('0x3d')]){_0x4813d5[_0x65d9('0x38')]=_[_0x65d9('0x3b')](_0x4813d5['where'],{'$or':_[_0x65d9('0x2c')](_0x4813d5[_0x65d9('0x34')],function(_0x566276){var _0x2f4b43={};_0x2f4b43[_0x566276]={'$like':'%'+_0x2808f9['query'][_0x65d9('0x3d')]+'%'};return _0x2f4b43;})});}_0x4813d5=_[_0x65d9('0x3b')]({},_0x4813d5,_0x2808f9[_0x65d9('0x4d')]);return _0x74b412['getSubjects'](_0x4813d5);}})[_0x65d9('0x26')](function(_0x44909f){if(_0x44909f){_0x42c2e0=_0x44909f['length'];if(!_0x2808f9['query']['hasOwnProperty'](_0x65d9('0x4e'))){_0x4813d5['limit']=qs['limit'](_0x2808f9[_0x65d9('0x32')][_0x65d9('0x21')]);_0x4813d5[_0x65d9('0x1f')]=qs['offset'](_0x2808f9[_0x65d9('0x32')][_0x65d9('0x1f')]);}return _0x74b412[_0x65d9('0x4f')](_0x4813d5);}})['then'](function(_0x5983c2){if(_0x5983c2){return _0x5983c2?{'count':_0x42c2e0,'rows':_0x5983c2}:null;}})[_0x65d9('0x26')](respondWithResult(_0x156690,null))[_0x65d9('0x41')](handleError(_0x156690,null));};exports[_0x65d9('0x50')]=function(_0x2f8f94,_0x93f9c1,_0x5389cd){var _0x49d88f={};var _0x19e23e={};var _0x3ea69b;var _0xa461e1;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2f8f94[_0x65d9('0x42')]['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x93f9c1,null))['then'](function(_0x1d7a54){if(_0x1d7a54){_0x3ea69b=_0x1d7a54;_0x19e23e[_0x65d9('0x31')]=_[_0x65d9('0x43')](db[_0x65d9('0x4b')][_0x65d9('0x44')]);_0x19e23e[_0x65d9('0x32')]=_[_0x65d9('0x43')](_0x2f8f94[_0x65d9('0x32')]);_0x19e23e['filters']=_[_0x65d9('0x33')](_0x19e23e['model'],_0x19e23e[_0x65d9('0x32')]);_0x49d88f[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x19e23e[_0x65d9('0x31')],qs[_0x65d9('0x45')](_0x2f8f94[_0x65d9('0x32')][_0x65d9('0x45')]));_0x49d88f[_0x65d9('0x34')]=_0x49d88f['attributes'][_0x65d9('0x35')]?_0x49d88f[_0x65d9('0x34')]:_0x19e23e['model'];_0x49d88f[_0x65d9('0x4c')]=qs[_0x65d9('0x37')](_0x2f8f94[_0x65d9('0x32')][_0x65d9('0x37')]);_0x49d88f[_0x65d9('0x38')]=qs['filters'](_[_0x65d9('0x3a')](_0x2f8f94[_0x65d9('0x32')],_0x19e23e[_0x65d9('0x39')]));if(_0x2f8f94[_0x65d9('0x32')][_0x65d9('0x3d')]){_0x49d88f[_0x65d9('0x38')]=_['merge'](_0x49d88f[_0x65d9('0x38')],{'$or':_[_0x65d9('0x2c')](_0x49d88f[_0x65d9('0x34')],function(_0x336f01){var _0x1ed88a={};_0x1ed88a[_0x336f01]={'$like':'%'+_0x2f8f94[_0x65d9('0x32')][_0x65d9('0x3d')]+'%'};return _0x1ed88a;})});}_0x49d88f=_[_0x65d9('0x3b')]({},_0x49d88f,_0x2f8f94['options']);return _0x3ea69b['getDescriptions'](_0x49d88f);}})[_0x65d9('0x26')](function(_0x3a1800){if(_0x3a1800){_0xa461e1=_0x3a1800['length'];if(!_0x2f8f94[_0x65d9('0x32')]['hasOwnProperty'](_0x65d9('0x4e'))){_0x49d88f[_0x65d9('0x21')]=qs[_0x65d9('0x21')](_0x2f8f94['query'][_0x65d9('0x21')]);_0x49d88f[_0x65d9('0x1f')]=qs[_0x65d9('0x1f')](_0x2f8f94[_0x65d9('0x32')]['offset']);}return _0x3ea69b[_0x65d9('0x50')](_0x49d88f);}})['then'](function(_0x4ee048){if(_0x4ee048){return _0x4ee048?{'count':_0xa461e1,'rows':_0x4ee048}:null;}})[_0x65d9('0x26')](respondWithResult(_0x93f9c1,null))[_0x65d9('0x41')](handleError(_0x93f9c1,null));};exports[_0x65d9('0x51')]=function(_0x7be54e,_0x12c599,_0x4abce1){var _0x4b689f={};var _0x2733a1={};var _0x5e231c;var _0x1a3a49;return db[_0x65d9('0x2d')][_0x65d9('0x4a')]({'where':{'id':_0x7be54e[_0x65d9('0x42')]['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x12c599,null))[_0x65d9('0x26')](function(_0x5421d7){if(_0x5421d7){_0x5e231c=_0x5421d7;_0x2733a1[_0x65d9('0x31')]=_['keys'](db[_0x65d9('0x52')][_0x65d9('0x44')]);_0x2733a1[_0x65d9('0x32')]=_[_0x65d9('0x43')](_0x7be54e[_0x65d9('0x32')]);_0x2733a1['filters']=_[_0x65d9('0x33')](_0x2733a1[_0x65d9('0x31')],_0x2733a1[_0x65d9('0x32')]);_0x4b689f[_0x65d9('0x34')]=_[_0x65d9('0x33')](_0x2733a1[_0x65d9('0x31')],qs['fields'](_0x7be54e['query'][_0x65d9('0x45')]));_0x4b689f[_0x65d9('0x34')]=_0x4b689f['attributes']['length']?_0x4b689f[_0x65d9('0x34')]:_0x2733a1['model'];_0x4b689f[_0x65d9('0x4c')]=qs['sort'](_0x7be54e[_0x65d9('0x32')][_0x65d9('0x37')]);_0x4b689f[_0x65d9('0x38')]=qs[_0x65d9('0x39')](_[_0x65d9('0x3a')](_0x7be54e[_0x65d9('0x32')],_0x2733a1[_0x65d9('0x39')]));if(_0x7be54e[_0x65d9('0x32')][_0x65d9('0x3d')]){_0x4b689f[_0x65d9('0x38')]=_[_0x65d9('0x3b')](_0x4b689f[_0x65d9('0x38')],{'$or':_[_0x65d9('0x2c')](_0x4b689f[_0x65d9('0x34')],function(_0x3293f5){var _0x1a485f={};_0x1a485f[_0x3293f5]={'$like':'%'+_0x7be54e[_0x65d9('0x32')][_0x65d9('0x3d')]+'%'};return _0x1a485f;})});}_0x4b689f=_[_0x65d9('0x3b')]({},_0x4b689f,_0x7be54e['options']);return _0x5e231c[_0x65d9('0x51')](_0x4b689f);}})[_0x65d9('0x26')](function(_0x1ef017){if(_0x1ef017){_0x1a3a49=_0x1ef017['length'];if(!_0x7be54e['query']['hasOwnProperty'](_0x65d9('0x4e'))){_0x4b689f[_0x65d9('0x21')]=qs[_0x65d9('0x21')](_0x7be54e[_0x65d9('0x32')][_0x65d9('0x21')]);_0x4b689f['offset']=qs[_0x65d9('0x1f')](_0x7be54e['query'][_0x65d9('0x1f')]);}return _0x5e231c['getTags'](_0x4b689f);}})[_0x65d9('0x26')](function(_0x1e61fc){if(_0x1e61fc){return _0x1e61fc?{'count':_0x1a3a49,'rows':_0x1e61fc}:null;}})[_0x65d9('0x26')](respondWithResult(_0x12c599,null))['catch'](handleError(_0x12c599,null));};exports[_0x65d9('0x53')]=function(_0xc410aa,_0x3762f6,_0x4da06f){if(_0xc410aa[_0x65d9('0x48')]['id']){delete _0xc410aa[_0x65d9('0x48')]['id'];}return db[_0x65d9('0x2d')][_0x65d9('0x4a')]({'where':{'id':_0xc410aa[_0x65d9('0x42')]['id']}})[_0x65d9('0x26')](handleEntityNotFound(_0x3762f6,null))[_0x65d9('0x26')](function(_0x56735d){if(_0x56735d){return _0x56735d[_0x65d9('0x53')](_0xc410aa['body'][_0x65d9('0x54')]||[]);}return null;})[_0x65d9('0x26')](respondWithResult(_0x3762f6,null))[_0x65d9('0x41')](handleError(_0x3762f6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 91886f1..4325356 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 _0xba61=['../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x2f8323,_0x3135a2){var _0x554ae9=function(_0x37d3a3){while(--_0x37d3a3){_0x2f8323['push'](_0x2f8323['shift']());}};_0x554ae9(++_0x3135a2);}(_0xba61,0x147));var _0x1ba6=function(_0x135c76,_0x2e40b8){_0x135c76=_0x135c76-0x0;var _0x4fefde=_0xba61[_0x135c76];return _0x4fefde;};'use strict';var _=require('lodash');var util=require(_0x1ba6('0x0'));var logger=require(_0x1ba6('0x1'))(_0x1ba6('0x2'));var moment=require('moment');var BPromise=require(_0x1ba6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ba6('0x4'));var rimraf=require(_0x1ba6('0x5'));var config=require(_0x1ba6('0x6'));var attributes=require(_0x1ba6('0x7'));module['exports']=function(_0x4dfe12,_0x371e8e){return _0x4dfe12['define'](_0x1ba6('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cdf=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x8cdf,0x10d));var _0xf8cd=function(_0x185f2e,_0x5be869){_0x185f2e=_0x185f2e-0x0;var _0x31f111=_0x8cdf[_0x185f2e];return _0x31f111;};'use strict';var _=require(_0xf8cd('0x0'));var util=require('util');var logger=require(_0xf8cd('0x1'))(_0xf8cd('0x2'));var moment=require(_0xf8cd('0x3'));var BPromise=require(_0xf8cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf8cd('0x5'));var config=require(_0xf8cd('0x6'));var attributes=require(_0xf8cd('0x7'));module[_0xf8cd('0x8')]=function(_0x1c4b3c,_0x20d499){return _0x1c4b3c[_0xf8cd('0x9')](_0xf8cd('0xa'),attributes,{'tableName':_0xf8cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 43cb956..0ae9af8 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 _0x2106=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x2106,0x133));var _0x6210=function(_0x4edbaa,_0x1f0579){_0x4edbaa=_0x4edbaa-0x0;var _0x49e3d5=_0x2106[_0x4edbaa];return _0x49e3d5;};'use strict';var _=require('lodash');var util=require(_0x6210('0x0'));var moment=require(_0x6210('0x1'));var BPromise=require(_0x6210('0x2'));var rs=require(_0x6210('0x3'));var fs=require('fs');var Redis=require(_0x6210('0x4'));var db=require(_0x6210('0x5'))['db'];var utils=require(_0x6210('0x6'));var logger=require('../../config/logger')(_0x6210('0x7'));var config=require(_0x6210('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6210('0x9')][_0x6210('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x123451,_0x12ca2d,_0x75450a){return new BPromise(function(_0x42da60,_0x27d7e8){return client[_0x6210('0xb')](_0x123451,_0x75450a)[_0x6210('0xc')](function(_0x4a5f14){logger['info'](_0x6210('0xd'),_0x12ca2d,_0x6210('0xe'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x12ca2d,_0x6210('0xe'),JSON[_0x6210('0xf')](_0x4a5f14));if(_0x4a5f14[_0x6210('0x10')]){if(_0x4a5f14['error'][_0x6210('0x11')]===0x1f4){logger[_0x6210('0x10')](_0x6210('0xd'),_0x12ca2d,_0x4a5f14[_0x6210('0x10')][_0x6210('0x12')]);return _0x27d7e8(_0x4a5f14[_0x6210('0x10')][_0x6210('0x12')]);}logger[_0x6210('0x10')](_0x6210('0xd'),_0x12ca2d,_0x4a5f14['error'][_0x6210('0x12')]);return _0x42da60(_0x4a5f14[_0x6210('0x10')][_0x6210('0x12')]);}else{logger[_0x6210('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x12ca2d,_0x6210('0xe'));_0x42da60(_0x4a5f14[_0x6210('0x14')][_0x6210('0x12')]);}})[_0x6210('0x15')](function(_0x153b2c){logger[_0x6210('0x10')](_0x6210('0xd'),_0x12ca2d,_0x153b2c);_0x27d7e8(_0x153b2c);});});} \ No newline at end of file +var _0xbac1=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x39f29e,_0x3505c5){var _0xa5fd6a=function(_0xff2f7a){while(--_0xff2f7a){_0x39f29e['push'](_0x39f29e['shift']());}};_0xa5fd6a(++_0x3505c5);}(_0xbac1,0x17f));var _0x1bac=function(_0x3a38af,_0x31725b){_0x3a38af=_0x3a38af-0x0;var _0x52e1d9=_0xbac1[_0x3a38af];return _0x52e1d9;};'use strict';var _=require('lodash');var util=require(_0x1bac('0x0'));var moment=require(_0x1bac('0x1'));var BPromise=require(_0x1bac('0x2'));var rs=require(_0x1bac('0x3'));var fs=require('fs');var Redis=require(_0x1bac('0x4'));var db=require(_0x1bac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bac('0x6'))(_0x1bac('0x7'));var config=require(_0x1bac('0x8'));var jayson=require(_0x1bac('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22630c,_0x1e4f0e,_0x5441f0){return new BPromise(function(_0x1e6480,_0x86c896){return client[_0x1bac('0xa')](_0x22630c,_0x5441f0)['then'](function(_0x1f2f10){logger[_0x1bac('0xb')](_0x1bac('0xc'),_0x1e4f0e,_0x1bac('0xd'));logger['debug'](_0x1bac('0xe'),_0x1e4f0e,_0x1bac('0xd'),JSON[_0x1bac('0xf')](_0x1f2f10));if(_0x1f2f10[_0x1bac('0x10')]){if(_0x1f2f10[_0x1bac('0x10')][_0x1bac('0x11')]===0x1f4){logger[_0x1bac('0x10')](_0x1bac('0xc'),_0x1e4f0e,_0x1f2f10['error'][_0x1bac('0x12')]);return _0x86c896(_0x1f2f10['error']['message']);}logger[_0x1bac('0x10')](_0x1bac('0xc'),_0x1e4f0e,_0x1f2f10[_0x1bac('0x10')][_0x1bac('0x12')]);return _0x1e6480(_0x1f2f10[_0x1bac('0x10')]['message']);}else{logger[_0x1bac('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x1e4f0e,_0x1bac('0xd'));_0x1e6480(_0x1f2f10['result']['message']);}})[_0x1bac('0x13')](function(_0x4cb757){logger['error'](_0x1bac('0xc'),_0x1e4f0e,_0x4cb757);_0x86c896(_0x4cb757);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index df5268c..19e463e 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 _0x72aa=['delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','/:id','isAuthenticated','show','post','put'];(function(_0x5f9ca6,_0x4b6dbc){var _0x8458d3=function(_0x150470){while(--_0x150470){_0x5f9ca6['push'](_0x5f9ca6['shift']());}};_0x8458d3(++_0x4b6dbc);}(_0x72aa,0x182));var _0xa72a=function(_0x58c27d,_0x2a7149){_0x58c27d=_0x58c27d-0x0;var _0x3ed911=_0x72aa[_0x58c27d];return _0x3ed911;};'use strict';var multer=require('multer');var util=require(_0xa72a('0x0'));var path=require(_0xa72a('0x1'));var timeout=require(_0xa72a('0x2'));var express=require('express');var router=express[_0xa72a('0x3')]();var fs_extra=require(_0xa72a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa72a('0x5'));var config=require(_0xa72a('0x6'));var controller=require(_0xa72a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa72a('0x8')]);router['get'](_0xa72a('0x9'),auth[_0xa72a('0xa')](),controller[_0xa72a('0xb')]);router[_0xa72a('0xc')]('/',auth[_0xa72a('0xa')](),controller['create']);router[_0xa72a('0xd')](_0xa72a('0x9'),auth[_0xa72a('0xa')](),controller['update']);router[_0xa72a('0xe')](_0xa72a('0x9'),auth[_0xa72a('0xa')](),controller['destroy']);module[_0xa72a('0xf')]=router; \ No newline at end of file +var _0xa83c=['index','get','/:id','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2f5a59,_0x209665){var _0x3c88d4=function(_0x5b9acd){while(--_0x5b9acd){_0x2f5a59['push'](_0x2f5a59['shift']());}};_0x3c88d4(++_0x209665);}(_0xa83c,0xa2));var _0xca83=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa83c[_0x1589dd];return _0x1bddd1;};'use strict';var multer=require(_0xca83('0x0'));var util=require(_0xca83('0x1'));var path=require(_0xca83('0x2'));var timeout=require('connect-timeout');var express=require(_0xca83('0x3'));var router=express[_0xca83('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xca83('0x5'));var config=require(_0xca83('0x6'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xca83('0x7')](),controller[_0xca83('0x8')]);router[_0xca83('0x9')](_0xca83('0xa'),auth[_0xca83('0x7')](),controller['show']);router['post']('/',auth[_0xca83('0x7')](),controller[_0xca83('0xb')]);router[_0xca83('0xc')](_0xca83('0xa'),auth[_0xca83('0x7')](),controller[_0xca83('0xd')]);router[_0xca83('0xe')](_0xca83('0xa'),auth[_0xca83('0x7')](),controller[_0xca83('0xf')]);module[_0xca83('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 3510939..6206784 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 _0xaaff=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x788c48,_0x5c0e5e){var _0x299c14=function(_0x6be4c){while(--_0x6be4c){_0x788c48['push'](_0x788c48['shift']());}};_0x299c14(++_0x5c0e5e);}(_0xaaff,0x1da));var _0xfaaf=function(_0x25d542,_0x462ad9){_0x25d542=_0x25d542-0x0;var _0x377a7e=_0xaaff[_0x25d542];return _0x377a7e;};'use strict';var Sequelize=require(_0xfaaf('0x0'));module['exports']={'type':{'type':Sequelize[_0xfaaf('0x1')](_0xfaaf('0x2'),_0xfaaf('0x3'),_0xfaaf('0x4'),_0xfaaf('0x5'),_0xfaaf('0x6')),'defaultValue':_0xfaaf('0x2')},'content':{'type':Sequelize[_0xfaaf('0x7')]},'key':{'type':Sequelize[_0xfaaf('0x7')]},'keyType':{'type':Sequelize[_0xfaaf('0x1')](_0xfaaf('0x2'),_0xfaaf('0x3'),_0xfaaf('0x4'))},'keyContent':{'type':Sequelize[_0xfaaf('0x7')]},'idField':{'type':Sequelize[_0xfaaf('0x7')]},'nameField':{'type':Sequelize[_0xfaaf('0x7')]},'customField':{'type':Sequelize[_0xfaaf('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfaaf('0x7')]}}; \ No newline at end of file +var _0x6d4d=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x5a9759,_0x15ee29){var _0x10152a=function(_0x6f8271){while(--_0x6f8271){_0x5a9759['push'](_0x5a9759['shift']());}};_0x10152a(++_0x15ee29);}(_0x6d4d,0x157));var _0xd6d4=function(_0x1b2214,_0x1000e6){_0x1b2214=_0x1b2214-0x0;var _0x273cf9=_0x6d4d[_0x1b2214];return _0x273cf9;};'use strict';var Sequelize=require(_0xd6d4('0x0'));module[_0xd6d4('0x1')]={'type':{'type':Sequelize[_0xd6d4('0x2')]('string',_0xd6d4('0x3'),_0xd6d4('0x4'),_0xd6d4('0x5'),_0xd6d4('0x6')),'defaultValue':_0xd6d4('0x7')},'content':{'type':Sequelize[_0xd6d4('0x8')]},'key':{'type':Sequelize[_0xd6d4('0x8')]},'keyType':{'type':Sequelize[_0xd6d4('0x2')]('string',_0xd6d4('0x3'),_0xd6d4('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd6d4('0x8')]},'nameField':{'type':Sequelize[_0xd6d4('0x8')]},'customField':{'type':Sequelize[_0xd6d4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd6d4('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 021031d..d5812f8 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 _0x65f9=['attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','DeskField','fieldName','type','model','query','keys','filters','intersection'];(function(_0x4888e0,_0x35f563){var _0x346fee=function(_0x4bc27b){while(--_0x4bc27b){_0x4888e0['push'](_0x4888e0['shift']());}};_0x346fee(++_0x35f563);}(_0x65f9,0x19d));var _0x965f=function(_0x3ed09a,_0x32233a){_0x3ed09a=_0x3ed09a-0x0;var _0x5599b2=_0x65f9[_0x3ed09a];return _0x5599b2;};'use strict';var emlformat=require(_0x965f('0x0'));var rimraf=require(_0x965f('0x1'));var zipdir=require(_0x965f('0x2'));var jsonpatch=require(_0x965f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x965f('0x4'));var Mustache=require(_0x965f('0x5'));var util=require(_0x965f('0x6'));var path=require(_0x965f('0x7'));var sox=require(_0x965f('0x8'));var csv=require(_0x965f('0x9'));var ejs=require(_0x965f('0xa'));var fs=require('fs');var fs_extra=require(_0x965f('0xb'));var _=require(_0x965f('0xc'));var squel=require(_0x965f('0xd'));var crypto=require(_0x965f('0xe'));var jsforce=require(_0x965f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x965f('0x9'));var querystring=require(_0x965f('0x10'));var Papa=require(_0x965f('0x11'));var Redis=require(_0x965f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x965f('0x13'));var as=require(_0x965f('0x14'));var hardwareService=require(_0x965f('0x15'));var logger=require(_0x965f('0x16'))(_0x965f('0x17'));var utils=require(_0x965f('0x18'));var config=require(_0x965f('0x19'));var licenseUtil=require(_0x965f('0x1a'));var db=require(_0x965f('0x1b'))['db'];function respondWithStatusCode(_0x12aa74,_0x436f86){_0x436f86=_0x436f86||0xcc;return function(_0x2b0cfd){if(_0x2b0cfd){return _0x12aa74['sendStatus'](_0x436f86);}return _0x12aa74[_0x965f('0x1c')](_0x436f86)['end']();};}function respondWithResult(_0x2c7127,_0x397d2a){_0x397d2a=_0x397d2a||0xc8;return function(_0xc6e6d2){if(_0xc6e6d2){return _0x2c7127[_0x965f('0x1c')](_0x397d2a)[_0x965f('0x1d')](_0xc6e6d2);}};}function respondWithFilteredResult(_0x202e29,_0x57a636){return function(_0x2bb17c){if(_0x2bb17c){var _0x3fbf4a=typeof _0x57a636[_0x965f('0x1e')]===_0x965f('0x1f')&&typeof _0x57a636['limit']===_0x965f('0x1f');var _0x4bc5f7=_0x2bb17c[_0x965f('0x20')];var _0x182932=_0x3fbf4a?0x0:_0x57a636[_0x965f('0x1e')];var _0x53a985=_0x3fbf4a?_0x2bb17c[_0x965f('0x20')]:_0x57a636[_0x965f('0x1e')]+_0x57a636[_0x965f('0x21')];var _0x5a08a8;if(_0x53a985>=_0x4bc5f7){_0x53a985=_0x4bc5f7;_0x5a08a8=0xc8;}else{_0x5a08a8=0xce;}_0x202e29['status'](_0x5a08a8);return _0x202e29[_0x965f('0x22')](_0x965f('0x23'),_0x182932+'-'+_0x53a985+'/'+_0x4bc5f7)[_0x965f('0x1d')](_0x2bb17c);}return null;};}function patchUpdates(_0x3ad10c){return function(_0x5e0d4b){try{jsonpatch[_0x965f('0x24')](_0x5e0d4b,_0x3ad10c,!![]);}catch(_0x42d622){return BPromise[_0x965f('0x25')](_0x42d622);}return _0x5e0d4b[_0x965f('0x26')]();};}function saveUpdates(_0x3662d4,_0x19f479){return function(_0x1b087a){if(_0x1b087a){return _0x1b087a['update'](_0x3662d4)[_0x965f('0x27')](function(_0x40089f){return _0x40089f;});}return null;};}function removeEntity(_0x557969,_0x5f5b3f){return function(_0x785a5a){if(_0x785a5a){return _0x785a5a[_0x965f('0x28')]()['then'](function(){_0x557969[_0x965f('0x1c')](0xcc)[_0x965f('0x29')]();});}};}function handleEntityNotFound(_0x463f05,_0x552a1c){return function(_0x5e9245){if(!_0x5e9245){_0x463f05['sendStatus'](0x194);}return _0x5e9245;};}function handleError(_0x5dc26a,_0x3967d0){_0x3967d0=_0x3967d0||0x1f4;return function(_0x41ad7c){logger[_0x965f('0x2a')](_0x41ad7c[_0x965f('0x2b')]);if(_0x41ad7c[_0x965f('0x2c')]){delete _0x41ad7c[_0x965f('0x2c')];}_0x5dc26a[_0x965f('0x1c')](_0x3967d0)['send'](_0x41ad7c);};}exports[_0x965f('0x2d')]=function(_0x29e1dc,_0x175385){var _0x36c4c3={},_0x5a71d6={},_0x5e978b={'count':0x0,'rows':[]};var _0x1c331c=_[_0x965f('0x2e')](db[_0x965f('0x2f')]['rawAttributes'],function(_0x5acdc2){return{'name':_0x5acdc2[_0x965f('0x30')],'type':_0x5acdc2[_0x965f('0x31')]['key']};});_0x5a71d6[_0x965f('0x32')]=_['map'](_0x1c331c,_0x965f('0x2c'));_0x5a71d6[_0x965f('0x33')]=_[_0x965f('0x34')](_0x29e1dc['query']);_0x5a71d6[_0x965f('0x35')]=_[_0x965f('0x36')](_0x5a71d6[_0x965f('0x32')],_0x5a71d6['query']);_0x36c4c3[_0x965f('0x37')]=_[_0x965f('0x36')](_0x5a71d6[_0x965f('0x32')],qs[_0x965f('0x38')](_0x29e1dc[_0x965f('0x33')][_0x965f('0x38')]));_0x36c4c3['attributes']=_0x36c4c3['attributes'][_0x965f('0x39')]?_0x36c4c3[_0x965f('0x37')]:_0x5a71d6[_0x965f('0x32')];if(!_0x29e1dc[_0x965f('0x33')]['hasOwnProperty'](_0x965f('0x3a'))){_0x36c4c3[_0x965f('0x21')]=qs[_0x965f('0x21')](_0x29e1dc[_0x965f('0x33')][_0x965f('0x21')]);_0x36c4c3[_0x965f('0x1e')]=qs[_0x965f('0x1e')](_0x29e1dc[_0x965f('0x33')][_0x965f('0x1e')]);}_0x36c4c3[_0x965f('0x3b')]=qs[_0x965f('0x3c')](_0x29e1dc[_0x965f('0x33')][_0x965f('0x3c')]);_0x36c4c3['where']=qs[_0x965f('0x35')](_['pick'](_0x29e1dc[_0x965f('0x33')],_0x5a71d6[_0x965f('0x35')]),_0x1c331c);if(_0x29e1dc['query'][_0x965f('0x3d')]){_0x36c4c3[_0x965f('0x3e')]=_['merge'](_0x36c4c3[_0x965f('0x3e')],{'$or':_[_0x965f('0x2e')](_0x1c331c,function(_0x25d1d9){if(_0x25d1d9[_0x965f('0x31')]!==_0x965f('0x3f')){var _0x176184={};_0x176184[_0x25d1d9[_0x965f('0x2c')]]={'$like':'%'+_0x29e1dc[_0x965f('0x33')][_0x965f('0x3d')]+'%'};return _0x176184;}})});}_0x36c4c3=_['merge']({},_0x36c4c3,_0x29e1dc[_0x965f('0x40')]);var _0x4a2ba5={'where':_0x36c4c3[_0x965f('0x3e')]};return db['DeskField'][_0x965f('0x20')](_0x4a2ba5)[_0x965f('0x27')](function(_0x5dc66f){_0x5e978b[_0x965f('0x20')]=_0x5dc66f;if(_0x29e1dc[_0x965f('0x33')][_0x965f('0x41')]){_0x36c4c3[_0x965f('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x965f('0x43')](_0x36c4c3);})[_0x965f('0x27')](function(_0x2aa98a){_0x5e978b[_0x965f('0x44')]=_0x2aa98a;return _0x5e978b;})[_0x965f('0x27')](respondWithFilteredResult(_0x175385,_0x36c4c3))[_0x965f('0x45')](handleError(_0x175385,null));};exports[_0x965f('0x46')]=function(_0x52f7e5,_0x4f9269){var _0x3263f1={'raw':!![],'where':{'id':_0x52f7e5[_0x965f('0x47')]['id']}},_0x29e3eb={};_0x29e3eb[_0x965f('0x32')]=_[_0x965f('0x34')](db['DeskField'][_0x965f('0x48')]);_0x29e3eb[_0x965f('0x33')]=_[_0x965f('0x34')](_0x52f7e5['query']);_0x29e3eb[_0x965f('0x35')]=_[_0x965f('0x36')](_0x29e3eb[_0x965f('0x32')],_0x29e3eb[_0x965f('0x33')]);_0x3263f1[_0x965f('0x37')]=_[_0x965f('0x36')](_0x29e3eb[_0x965f('0x32')],qs['fields'](_0x52f7e5[_0x965f('0x33')][_0x965f('0x38')]));_0x3263f1[_0x965f('0x37')]=_0x3263f1[_0x965f('0x37')]['length']?_0x3263f1[_0x965f('0x37')]:_0x29e3eb['model'];if(_0x52f7e5[_0x965f('0x33')][_0x965f('0x41')]){_0x3263f1[_0x965f('0x42')]=[{'all':!![]}];}_0x3263f1=_[_0x965f('0x49')]({},_0x3263f1,_0x52f7e5[_0x965f('0x40')]);return db[_0x965f('0x2f')][_0x965f('0x4a')](_0x3263f1)[_0x965f('0x27')](handleEntityNotFound(_0x4f9269,null))[_0x965f('0x27')](respondWithResult(_0x4f9269,null))[_0x965f('0x45')](handleError(_0x4f9269,null));};exports['create']=function(_0x2a110c,_0x3cc5c5){return db['DeskField'][_0x965f('0x4b')](_0x2a110c[_0x965f('0x4c')],{})[_0x965f('0x27')](respondWithResult(_0x3cc5c5,0xc9))[_0x965f('0x45')](handleError(_0x3cc5c5,null));};exports[_0x965f('0x4d')]=function(_0x20c10c,_0x2a61d9){if(_0x20c10c[_0x965f('0x4c')]['id']){delete _0x20c10c[_0x965f('0x4c')]['id'];}return db[_0x965f('0x2f')][_0x965f('0x4a')]({'where':{'id':_0x20c10c[_0x965f('0x47')]['id']}})[_0x965f('0x27')](handleEntityNotFound(_0x2a61d9,null))[_0x965f('0x27')](saveUpdates(_0x20c10c[_0x965f('0x4c')],null))[_0x965f('0x27')](respondWithResult(_0x2a61d9,null))[_0x965f('0x45')](handleError(_0x2a61d9,null));};exports[_0x965f('0x28')]=function(_0x30f8e3,_0x42626c){return db['DeskField'][_0x965f('0x4a')]({'where':{'id':_0x30f8e3[_0x965f('0x47')]['id']}})['then'](handleEntityNotFound(_0x42626c,null))[_0x965f('0x27')](removeEntity(_0x42626c,null))[_0x965f('0x45')](handleError(_0x42626c,null));}; \ No newline at end of file +var _0x4fda=['options','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','DeskField','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL'];(function(_0x45798e,_0x4cc510){var _0x41d672=function(_0x36a206){while(--_0x36a206){_0x45798e['push'](_0x45798e['shift']());}};_0x41d672(++_0x4cc510);}(_0x4fda,0x9a));var _0xa4fd=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x4fda[_0x52e0ee];return _0x32534c;};'use strict';var emlformat=require(_0xa4fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4fd('0x1'));var jsonpatch=require(_0xa4fd('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa4fd('0x3'));var Mustache=require(_0xa4fd('0x4'));var util=require(_0xa4fd('0x5'));var path=require(_0xa4fd('0x6'));var sox=require('sox');var csv=require(_0xa4fd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4fd('0x8'));var squel=require(_0xa4fd('0x9'));var crypto=require('crypto');var jsforce=require(_0xa4fd('0xa'));var deskjs=require(_0xa4fd('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa4fd('0xc'));var Redis=require(_0xa4fd('0xd'));var authService=require(_0xa4fd('0xe'));var qs=require(_0xa4fd('0xf'));var as=require(_0xa4fd('0x10'));var hardwareService=require(_0xa4fd('0x11'));var logger=require(_0xa4fd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa4fd('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4fd('0x14'))['db'];function respondWithStatusCode(_0x2bb57f,_0x2102a2){_0x2102a2=_0x2102a2||0xcc;return function(_0x26fc24){if(_0x26fc24){return _0x2bb57f['sendStatus'](_0x2102a2);}return _0x2bb57f['status'](_0x2102a2)[_0xa4fd('0x15')]();};}function respondWithResult(_0x5e5860,_0x1c5668){_0x1c5668=_0x1c5668||0xc8;return function(_0x22ad8c){if(_0x22ad8c){return _0x5e5860[_0xa4fd('0x16')](_0x1c5668)[_0xa4fd('0x17')](_0x22ad8c);}};}function respondWithFilteredResult(_0x5e520f,_0x442692){return function(_0x11476f){if(_0x11476f){var _0x286a7=typeof _0x442692[_0xa4fd('0x18')]===_0xa4fd('0x19')&&typeof _0x442692['limit']===_0xa4fd('0x19');var _0x265e3c=_0x11476f[_0xa4fd('0x1a')];var _0x13c2f8=_0x286a7?0x0:_0x442692[_0xa4fd('0x18')];var _0x2ff46c=_0x286a7?_0x11476f[_0xa4fd('0x1a')]:_0x442692[_0xa4fd('0x18')]+_0x442692[_0xa4fd('0x1b')];var _0x5dd3d3;if(_0x2ff46c>=_0x265e3c){_0x2ff46c=_0x265e3c;_0x5dd3d3=0xc8;}else{_0x5dd3d3=0xce;}_0x5e520f[_0xa4fd('0x16')](_0x5dd3d3);return _0x5e520f[_0xa4fd('0x1c')](_0xa4fd('0x1d'),_0x13c2f8+'-'+_0x2ff46c+'/'+_0x265e3c)[_0xa4fd('0x17')](_0x11476f);}return null;};}function patchUpdates(_0x224074){return function(_0x37fa68){try{jsonpatch['apply'](_0x37fa68,_0x224074,!![]);}catch(_0x282678){return BPromise[_0xa4fd('0x1e')](_0x282678);}return _0x37fa68[_0xa4fd('0x1f')]();};}function saveUpdates(_0xcdf8d9,_0x1eddd8){return function(_0x48b4f0){if(_0x48b4f0){return _0x48b4f0[_0xa4fd('0x20')](_0xcdf8d9)[_0xa4fd('0x21')](function(_0x38d7f4){return _0x38d7f4;});}return null;};}function removeEntity(_0x5debaf,_0x2de2f4){return function(_0x36bc0a){if(_0x36bc0a){return _0x36bc0a[_0xa4fd('0x22')]()[_0xa4fd('0x21')](function(){_0x5debaf[_0xa4fd('0x16')](0xcc)[_0xa4fd('0x15')]();});}};}function handleEntityNotFound(_0xe68f31,_0x4488a8){return function(_0xaf819e){if(!_0xaf819e){_0xe68f31[_0xa4fd('0x23')](0x194);}return _0xaf819e;};}function handleError(_0x4cb37d,_0x10b96a){_0x10b96a=_0x10b96a||0x1f4;return function(_0x4456d7){logger['error'](_0x4456d7[_0xa4fd('0x24')]);if(_0x4456d7['name']){delete _0x4456d7[_0xa4fd('0x25')];}_0x4cb37d[_0xa4fd('0x16')](_0x10b96a)[_0xa4fd('0x26')](_0x4456d7);};}exports['index']=function(_0x5b4e2f,_0x5be8c0){var _0xd405b5={},_0x266e32={},_0x2951ea={'count':0x0,'rows':[]};var _0x5bc75e=_['map'](db[_0xa4fd('0x27')][_0xa4fd('0x28')],function(_0x191f3c){return{'name':_0x191f3c[_0xa4fd('0x29')],'type':_0x191f3c['type'][_0xa4fd('0x2a')]};});_0x266e32['model']=_['map'](_0x5bc75e,_0xa4fd('0x25'));_0x266e32['query']=_[_0xa4fd('0x2b')](_0x5b4e2f[_0xa4fd('0x2c')]);_0x266e32[_0xa4fd('0x2d')]=_['intersection'](_0x266e32[_0xa4fd('0x2e')],_0x266e32[_0xa4fd('0x2c')]);_0xd405b5[_0xa4fd('0x2f')]=_[_0xa4fd('0x30')](_0x266e32['model'],qs[_0xa4fd('0x31')](_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x31')]));_0xd405b5[_0xa4fd('0x2f')]=_0xd405b5['attributes'][_0xa4fd('0x32')]?_0xd405b5[_0xa4fd('0x2f')]:_0x266e32[_0xa4fd('0x2e')];if(!_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x33')](_0xa4fd('0x34'))){_0xd405b5[_0xa4fd('0x1b')]=qs[_0xa4fd('0x1b')](_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x1b')]);_0xd405b5[_0xa4fd('0x18')]=qs[_0xa4fd('0x18')](_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x18')]);}_0xd405b5[_0xa4fd('0x35')]=qs['sort'](_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x36')]);_0xd405b5[_0xa4fd('0x37')]=qs[_0xa4fd('0x2d')](_[_0xa4fd('0x38')](_0x5b4e2f[_0xa4fd('0x2c')],_0x266e32[_0xa4fd('0x2d')]),_0x5bc75e);if(_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x39')]){_0xd405b5[_0xa4fd('0x37')]=_[_0xa4fd('0x3a')](_0xd405b5['where'],{'$or':_[_0xa4fd('0x3b')](_0x5bc75e,function(_0x13cf7c){if(_0x13cf7c[_0xa4fd('0x3c')]!==_0xa4fd('0x3d')){var _0x34b1ed={};_0x34b1ed[_0x13cf7c['name']]={'$like':'%'+_0x5b4e2f[_0xa4fd('0x2c')][_0xa4fd('0x39')]+'%'};return _0x34b1ed;}})});}_0xd405b5=_[_0xa4fd('0x3a')]({},_0xd405b5,_0x5b4e2f[_0xa4fd('0x3e')]);var _0x4fd733={'where':_0xd405b5[_0xa4fd('0x37')]};return db[_0xa4fd('0x27')][_0xa4fd('0x1a')](_0x4fd733)['then'](function(_0x3e5b79){_0x2951ea[_0xa4fd('0x1a')]=_0x3e5b79;if(_0x5b4e2f['query'][_0xa4fd('0x3f')]){_0xd405b5['include']=[{'all':!![]}];}return db[_0xa4fd('0x27')][_0xa4fd('0x40')](_0xd405b5);})[_0xa4fd('0x21')](function(_0x2545a7){_0x2951ea['rows']=_0x2545a7;return _0x2951ea;})[_0xa4fd('0x21')](respondWithFilteredResult(_0x5be8c0,_0xd405b5))[_0xa4fd('0x41')](handleError(_0x5be8c0,null));};exports[_0xa4fd('0x42')]=function(_0x25387f,_0xe5e90){var _0x4b5f97={'raw':!![],'where':{'id':_0x25387f[_0xa4fd('0x43')]['id']}},_0x44f8a2={};_0x44f8a2['model']=_[_0xa4fd('0x2b')](db['DeskField'][_0xa4fd('0x28')]);_0x44f8a2[_0xa4fd('0x2c')]=_[_0xa4fd('0x2b')](_0x25387f[_0xa4fd('0x2c')]);_0x44f8a2[_0xa4fd('0x2d')]=_[_0xa4fd('0x30')](_0x44f8a2[_0xa4fd('0x2e')],_0x44f8a2[_0xa4fd('0x2c')]);_0x4b5f97[_0xa4fd('0x2f')]=_[_0xa4fd('0x30')](_0x44f8a2[_0xa4fd('0x2e')],qs['fields'](_0x25387f['query'][_0xa4fd('0x31')]));_0x4b5f97[_0xa4fd('0x2f')]=_0x4b5f97[_0xa4fd('0x2f')][_0xa4fd('0x32')]?_0x4b5f97[_0xa4fd('0x2f')]:_0x44f8a2[_0xa4fd('0x2e')];if(_0x25387f[_0xa4fd('0x2c')][_0xa4fd('0x3f')]){_0x4b5f97[_0xa4fd('0x44')]=[{'all':!![]}];}_0x4b5f97=_[_0xa4fd('0x3a')]({},_0x4b5f97,_0x25387f[_0xa4fd('0x3e')]);return db[_0xa4fd('0x27')][_0xa4fd('0x45')](_0x4b5f97)['then'](handleEntityNotFound(_0xe5e90,null))[_0xa4fd('0x21')](respondWithResult(_0xe5e90,null))[_0xa4fd('0x41')](handleError(_0xe5e90,null));};exports[_0xa4fd('0x46')]=function(_0x2fd161,_0x298ca2){return db[_0xa4fd('0x27')][_0xa4fd('0x46')](_0x2fd161[_0xa4fd('0x47')],{})['then'](respondWithResult(_0x298ca2,0xc9))[_0xa4fd('0x41')](handleError(_0x298ca2,null));};exports['update']=function(_0x2d6d7c,_0x543cda){if(_0x2d6d7c['body']['id']){delete _0x2d6d7c[_0xa4fd('0x47')]['id'];}return db['DeskField']['find']({'where':{'id':_0x2d6d7c[_0xa4fd('0x43')]['id']}})['then'](handleEntityNotFound(_0x543cda,null))[_0xa4fd('0x21')](saveUpdates(_0x2d6d7c['body'],null))[_0xa4fd('0x21')](respondWithResult(_0x543cda,null))[_0xa4fd('0x41')](handleError(_0x543cda,null));};exports[_0xa4fd('0x22')]=function(_0x313636,_0x5840a5){return db[_0xa4fd('0x27')]['find']({'where':{'id':_0x313636[_0xa4fd('0x43')]['id']}})[_0xa4fd('0x21')](handleEntityNotFound(_0x5840a5,null))[_0xa4fd('0x21')](removeEntity(_0x5840a5,null))[_0xa4fd('0x41')](handleError(_0x5840a5,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 078ce36..e8323ab 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 _0x10e9=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_desk_fields','idField'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x10e9,0x16d));var _0x910e=function(_0x35009a,_0x4c647b){_0x35009a=_0x35009a-0x0;var _0x41ae8a=_0x10e9[_0x35009a];return _0x41ae8a;};'use strict';var _=require(_0x910e('0x0'));var util=require(_0x910e('0x1'));var logger=require('../../config/logger')(_0x910e('0x2'));var moment=require(_0x910e('0x3'));var BPromise=require(_0x910e('0x4'));var rp=require(_0x910e('0x5'));var fs=require('fs');var path=require(_0x910e('0x6'));var rimraf=require(_0x910e('0x7'));var config=require(_0x910e('0x8'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x577fbd,_0x3b104e){return _0x577fbd[_0x910e('0x9')]('DeskField',attributes,{'tableName':_0x910e('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x910e('0xb'),_0x910e('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x162d=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4ae86f,_0x30c1d7){var _0x4a674d=function(_0x55337a){while(--_0x55337a){_0x4ae86f['push'](_0x4ae86f['shift']());}};_0x4a674d(++_0x30c1d7);}(_0x162d,0x183));var _0xd162=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x162d[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xd162('0x0'));var util=require('util');var logger=require(_0xd162('0x1'))(_0xd162('0x2'));var moment=require(_0xd162('0x3'));var BPromise=require('bluebird');var rp=require(_0xd162('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd162('0x5'));var config=require(_0xd162('0x6'));var attributes=require(_0xd162('0x7'));module[_0xd162('0x8')]=function(_0xfa5519,_0x3659d3){return _0xfa5519[_0xd162('0x9')](_0xd162('0xa'),attributes,{'tableName':_0xd162('0xb'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xd162('0xc'),_0xd162('0xd')],'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 33e9235..70c6959 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 _0xf4d2=['debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','DeskField,\x20%s,\x20%s'];(function(_0x39135c,_0x23ae68){var _0x54f601=function(_0x5a43bb){while(--_0x5a43bb){_0x39135c['push'](_0x39135c['shift']());}};_0x54f601(++_0x23ae68);}(_0xf4d2,0x7f));var _0x2f4d=function(_0x427572,_0x1d89f2){_0x427572=_0x427572-0x0;var _0x585590=_0xf4d2[_0x427572];return _0x585590;};'use strict';var _=require('lodash');var util=require(_0x2f4d('0x0'));var moment=require('moment');var BPromise=require(_0x2f4d('0x1'));var rs=require(_0x2f4d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2f4d('0x3'));var logger=require('../../config/logger')(_0x2f4d('0x4'));var config=require('../../config/environment');var jayson=require(_0x2f4d('0x5'));var client=jayson[_0x2f4d('0x6')][_0x2f4d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x729868,_0x3b839a,_0x2e35cb){return new BPromise(function(_0x41e698,_0x432be9){return client['request'](_0x729868,_0x2e35cb)['then'](function(_0x3e7c24){logger['info'](_0x2f4d('0x8'),_0x3b839a,'request\x20sent');logger[_0x2f4d('0x9')](_0x2f4d('0xa'),_0x3b839a,_0x2f4d('0xb'),JSON[_0x2f4d('0xc')](_0x3e7c24));if(_0x3e7c24['error']){if(_0x3e7c24[_0x2f4d('0xd')]['code']===0x1f4){logger[_0x2f4d('0xd')](_0x2f4d('0x8'),_0x3b839a,_0x3e7c24[_0x2f4d('0xd')][_0x2f4d('0xe')]);return _0x432be9(_0x3e7c24[_0x2f4d('0xd')][_0x2f4d('0xe')]);}logger[_0x2f4d('0xd')](_0x2f4d('0x8'),_0x3b839a,_0x3e7c24[_0x2f4d('0xd')][_0x2f4d('0xe')]);return _0x41e698(_0x3e7c24[_0x2f4d('0xd')][_0x2f4d('0xe')]);}else{logger[_0x2f4d('0xf')](_0x2f4d('0x8'),_0x3b839a,_0x2f4d('0xb'));_0x41e698(_0x3e7c24[_0x2f4d('0x10')][_0x2f4d('0xe')]);}})['catch'](function(_0x281f41){logger[_0x2f4d('0xd')](_0x2f4d('0x8'),_0x3b839a,_0x281f41);_0x432be9(_0x281f41);});});} \ No newline at end of file +var _0x8acc=['client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x8acc,0x95));var _0xc8ac=function(_0x4e6701,_0x352e0c){_0x4e6701=_0x4e6701-0x0;var _0x2576c1=_0x8acc[_0x4e6701];return _0x2576c1;};'use strict';var _=require(_0xc8ac('0x0'));var util=require(_0xc8ac('0x1'));var moment=require('moment');var BPromise=require(_0xc8ac('0x2'));var rs=require(_0xc8ac('0x3'));var fs=require('fs');var Redis=require(_0xc8ac('0x4'));var db=require(_0xc8ac('0x5'))['db'];var utils=require(_0xc8ac('0x6'));var logger=require(_0xc8ac('0x7'))(_0xc8ac('0x8'));var config=require(_0xc8ac('0x9'));var jayson=require(_0xc8ac('0xa'));var client=jayson[_0xc8ac('0xb')][_0xc8ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58b0ac,_0x5be5c7,_0x5ee4e9){return new BPromise(function(_0x20ad1b,_0x1c474c){return client['request'](_0x58b0ac,_0x5ee4e9)[_0xc8ac('0xd')](function(_0xc1f603){logger[_0xc8ac('0xe')](_0xc8ac('0xf'),_0x5be5c7,_0xc8ac('0x10'));logger[_0xc8ac('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x5be5c7,_0xc8ac('0x10'),JSON['stringify'](_0xc1f603));if(_0xc1f603[_0xc8ac('0x12')]){if(_0xc1f603[_0xc8ac('0x12')]['code']===0x1f4){logger[_0xc8ac('0x12')]('DeskField,\x20%s,\x20%s',_0x5be5c7,_0xc1f603['error'][_0xc8ac('0x13')]);return _0x1c474c(_0xc1f603[_0xc8ac('0x12')][_0xc8ac('0x13')]);}logger['error'](_0xc8ac('0xf'),_0x5be5c7,_0xc1f603[_0xc8ac('0x12')]['message']);return _0x20ad1b(_0xc1f603[_0xc8ac('0x12')]['message']);}else{logger[_0xc8ac('0xe')]('DeskField,\x20%s,\x20%s',_0x5be5c7,_0xc8ac('0x10'));_0x20ad1b(_0xc1f603['result'][_0xc8ac('0x13')]);}})['catch'](function(_0x7f0dc6){logger['error']('DeskField,\x20%s,\x20%s',_0x5be5c7,_0x7f0dc6);_0x1c474c(_0x7f0dc6);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 5e75d39..499d919 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 _0xd541=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy'];(function(_0x4740b2,_0x396c34){var _0x56dcec=function(_0x42302e){while(--_0x42302e){_0x4740b2['push'](_0x4740b2['shift']());}};_0x56dcec(++_0x396c34);}(_0xd541,0x114));var _0x1d54=function(_0x310d56,_0x581328){_0x310d56=_0x310d56-0x0;var _0x8759c7=_0xd541[_0x310d56];return _0x8759c7;};'use strict';var multer=require(_0x1d54('0x0'));var util=require(_0x1d54('0x1'));var path=require(_0x1d54('0x2'));var timeout=require(_0x1d54('0x3'));var express=require(_0x1d54('0x4'));var router=express['Router']();var fs_extra=require(_0x1d54('0x5'));var auth=require(_0x1d54('0x6'));var interaction=require(_0x1d54('0x7'));var config=require('../../config/environment');var controller=require(_0x1d54('0x8'));router[_0x1d54('0x9')]('/',auth[_0x1d54('0xa')](),controller['index']);router['get']('/:id',auth[_0x1d54('0xa')](),controller['show']);router['get']('/:id/configurations',auth[_0x1d54('0xa')](),controller[_0x1d54('0xb')]);router[_0x1d54('0x9')](_0x1d54('0xc'),auth[_0x1d54('0xa')](),controller[_0x1d54('0xd')]);router[_0x1d54('0xe')]('/',auth[_0x1d54('0xa')](),controller[_0x1d54('0xf')]);router[_0x1d54('0xe')](_0x1d54('0x10'),auth[_0x1d54('0xa')](),controller[_0x1d54('0x11')]);router[_0x1d54('0x12')](_0x1d54('0x13'),auth['isAuthenticated'](),controller[_0x1d54('0x14')]);router[_0x1d54('0x15')](_0x1d54('0x13'),auth[_0x1d54('0xa')](),controller[_0x1d54('0x16')]);module['exports']=router; \ No newline at end of file +var _0xc85d=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','create','/:id/configurations','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0xc85d,0x1b5));var _0xdc85=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0xc85d[_0x3a2a3c];return _0x50ac9a;};'use strict';var multer=require('multer');var util=require(_0xdc85('0x0'));var path=require(_0xdc85('0x1'));var timeout=require(_0xdc85('0x2'));var express=require(_0xdc85('0x3'));var router=express[_0xdc85('0x4')]();var fs_extra=require(_0xdc85('0x5'));var auth=require(_0xdc85('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdc85('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xdc85('0x8')]('/',auth[_0xdc85('0x9')](),controller[_0xdc85('0xa')]);router[_0xdc85('0x8')](_0xdc85('0xb'),auth[_0xdc85('0x9')](),controller[_0xdc85('0xc')]);router[_0xdc85('0x8')]('/:id/configurations',auth[_0xdc85('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xdc85('0xd')]);router['post']('/',auth[_0xdc85('0x9')](),controller[_0xdc85('0xe')]);router['post'](_0xdc85('0xf'),auth[_0xdc85('0x9')](),controller['addConfiguration']);router[_0xdc85('0x10')](_0xdc85('0xb'),auth[_0xdc85('0x9')](),controller[_0xdc85('0x11')]);router[_0xdc85('0x12')](_0xdc85('0xb'),auth['isAuthenticated'](),controller[_0xdc85('0x13')]);module[_0xdc85('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 0617236..7bbe1d5 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 _0x1ec4=['STRING','exports'];(function(_0x14bf63,_0xdbd373){var _0x410d22=function(_0x2e5e3a){while(--_0x2e5e3a){_0x14bf63['push'](_0x14bf63['shift']());}};_0x410d22(++_0xdbd373);}(_0x1ec4,0xb9));var _0x41ec=function(_0x240233,_0x59dff7){_0x240233=_0x240233-0x0;var _0x302abe=_0x1ec4[_0x240233];return _0x302abe;};'use strict';var Sequelize=require('sequelize');module[_0x41ec('0x0')]={'name':{'type':Sequelize[_0x41ec('0x1')]},'username':{'type':Sequelize[_0x41ec('0x1')]},'password':{'type':Sequelize[_0x41ec('0x1')]},'remoteUri':{'type':Sequelize[_0x41ec('0x1')]},'tenantId':{'type':Sequelize[_0x41ec('0x1')]},'clientId':{'type':Sequelize[_0x41ec('0x1')]},'clientSecret':{'type':Sequelize[_0x41ec('0x1')]},'serverUrl':{'type':Sequelize[_0x41ec('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x41ec('0x1')]}}; \ No newline at end of file +var _0x2522=['sequelize','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2522,0x1e3));var _0x2252=function(_0x41b79f,_0x1c294f){_0x41b79f=_0x41b79f-0x0;var _0x579086=_0x2522[_0x41b79f];return _0x579086;};'use strict';var Sequelize=require(_0x2252('0x0'));module[_0x2252('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2252('0x2')]},'password':{'type':Sequelize[_0x2252('0x2')]},'remoteUri':{'type':Sequelize[_0x2252('0x2')]},'tenantId':{'type':Sequelize[_0x2252('0x2')]},'clientId':{'type':Sequelize[_0x2252('0x2')]},'clientSecret':{'type':Sequelize[_0x2252('0x2')]},'serverUrl':{'type':Sequelize[_0x2252('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2252('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index ae62af6..7e46e92 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 _0x05b0=['../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','then','rows','catch','params','intersection','find','create','body','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x4d9c0c,_0x12ab2f){var _0x228979=function(_0x14081e){while(--_0x14081e){_0x4d9c0c['push'](_0x4d9c0c['shift']());}};_0x228979(++_0x12ab2f);}(_0x05b0,0x188));var _0x005b=function(_0x415e21,_0x10c178){_0x415e21=_0x415e21-0x0;var _0x1475a9=_0x05b0[_0x415e21];return _0x1475a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x005b('0x0'));var jsonpatch=require(_0x005b('0x1'));var rp=require('request-promise');var moment=require(_0x005b('0x2'));var BPromise=require(_0x005b('0x3'));var Mustache=require('mustache');var util=require(_0x005b('0x4'));var path=require(_0x005b('0x5'));var sox=require('sox');var csv=require(_0x005b('0x6'));var ejs=require(_0x005b('0x7'));var fs=require('fs');var fs_extra=require(_0x005b('0x8'));var _=require(_0x005b('0x9'));var squel=require(_0x005b('0xa'));var crypto=require(_0x005b('0xb'));var jsforce=require(_0x005b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x005b('0x6'));var querystring=require(_0x005b('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x005b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x005b('0xf'))(_0x005b('0x10'));var utils=require('../../config/utils');var config=require(_0x005b('0x11'));var licenseUtil=require(_0x005b('0x12'));var db=require(_0x005b('0x13'))['db'];var integrations=require(_0x005b('0x14'));function respondWithStatusCode(_0xce7212,_0xe2674e){_0xe2674e=_0xe2674e||0xcc;return function(_0x170ebc){if(_0x170ebc){return _0xce7212['sendStatus'](_0xe2674e);}return _0xce7212['status'](_0xe2674e)['end']();};}function respondWithResult(_0x309c8f,_0x50b7ce){_0x50b7ce=_0x50b7ce||0xc8;return function(_0x3e2c82){if(_0x3e2c82){return _0x309c8f['status'](_0x50b7ce)[_0x005b('0x15')](_0x3e2c82);}};}function respondWithFilteredResult(_0x1f7743,_0x2ce01e){return function(_0x1991e8){if(_0x1991e8){var _0x337ca1=typeof _0x2ce01e['offset']===_0x005b('0x16')&&typeof _0x2ce01e[_0x005b('0x17')]===_0x005b('0x16');var _0x551be9=_0x1991e8[_0x005b('0x18')];var _0x5114ad=_0x337ca1?0x0:_0x2ce01e['offset'];var _0x2d62b6=_0x337ca1?_0x1991e8[_0x005b('0x18')]:_0x2ce01e[_0x005b('0x19')]+_0x2ce01e[_0x005b('0x17')];var _0xf51601;if(_0x2d62b6>=_0x551be9){_0x2d62b6=_0x551be9;_0xf51601=0xc8;}else{_0xf51601=0xce;}_0x1f7743['status'](_0xf51601);return _0x1f7743[_0x005b('0x1a')](_0x005b('0x1b'),_0x5114ad+'-'+_0x2d62b6+'/'+_0x551be9)['json'](_0x1991e8);}return null;};}function patchUpdates(_0x24637d){return function(_0x456c4a){try{jsonpatch[_0x005b('0x1c')](_0x456c4a,_0x24637d,!![]);}catch(_0x49ef93){return BPromise[_0x005b('0x1d')](_0x49ef93);}return _0x456c4a[_0x005b('0x1e')]();};}function saveUpdates(_0x319981,_0x3521c9){return function(_0x2f8a67){if(_0x2f8a67){return _0x2f8a67[_0x005b('0x1f')](_0x319981)['then'](function(_0x322229){return _0x322229;});}return null;};}function removeEntity(_0x169428,_0x1fef26){return function(_0x5ac4cc){if(_0x5ac4cc){return _0x5ac4cc[_0x005b('0x20')]()['then'](function(){_0x169428[_0x005b('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542fa2,_0x2dc341){return function(_0xfcd1ec){if(!_0xfcd1ec){_0x542fa2[_0x005b('0x22')](0x194);}return _0xfcd1ec;};}function handleError(_0x267f10,_0x6730d4){_0x6730d4=_0x6730d4||0x1f4;return function(_0x431832){logger[_0x005b('0x23')](_0x431832[_0x005b('0x24')]);if(_0x431832['name']){delete _0x431832[_0x005b('0x25')];}_0x267f10[_0x005b('0x21')](_0x6730d4)[_0x005b('0x26')](_0x431832);};}exports[_0x005b('0x27')]=function(_0x2e92d1,_0x1d8f93){var _0x4775a2={},_0x49561a={},_0xaf7c71={'count':0x0,'rows':[]};var _0x25da11=_[_0x005b('0x28')](db[_0x005b('0x29')]['rawAttributes'],function(_0x4ee224){return{'name':_0x4ee224[_0x005b('0x2a')],'type':_0x4ee224[_0x005b('0x2b')]['key']};});_0x49561a['model']=_[_0x005b('0x28')](_0x25da11,'name');_0x49561a[_0x005b('0x2c')]=_[_0x005b('0x2d')](_0x2e92d1[_0x005b('0x2c')]);_0x49561a['filters']=_['intersection'](_0x49561a[_0x005b('0x2e')],_0x49561a[_0x005b('0x2c')]);_0x4775a2[_0x005b('0x2f')]=_['intersection'](_0x49561a['model'],qs[_0x005b('0x30')](_0x2e92d1[_0x005b('0x2c')]['fields']));_0x4775a2[_0x005b('0x2f')]=_0x4775a2['attributes'][_0x005b('0x31')]?_0x4775a2['attributes']:_0x49561a['model'];if(!_0x2e92d1[_0x005b('0x2c')][_0x005b('0x32')](_0x005b('0x33'))){_0x4775a2[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x2e92d1['query']['limit']);_0x4775a2[_0x005b('0x19')]=qs[_0x005b('0x19')](_0x2e92d1[_0x005b('0x2c')][_0x005b('0x19')]);}_0x4775a2[_0x005b('0x34')]=qs[_0x005b('0x35')](_0x2e92d1['query'][_0x005b('0x35')]);_0x4775a2[_0x005b('0x36')]=qs[_0x005b('0x37')](_['pick'](_0x2e92d1[_0x005b('0x2c')],_0x49561a[_0x005b('0x37')]),_0x25da11);if(_0x2e92d1[_0x005b('0x2c')][_0x005b('0x38')]){_0x4775a2[_0x005b('0x36')]=_[_0x005b('0x39')](_0x4775a2[_0x005b('0x36')],{'$or':_[_0x005b('0x28')](_0x25da11,function(_0x2f7e5b){if(_0x2f7e5b[_0x005b('0x2b')]!=='VIRTUAL'){var _0x45262e={};_0x45262e[_0x2f7e5b[_0x005b('0x25')]]={'$like':'%'+_0x2e92d1['query'][_0x005b('0x38')]+'%'};return _0x45262e;}})});}_0x4775a2=_[_0x005b('0x39')]({},_0x4775a2,_0x2e92d1[_0x005b('0x3a')]);var _0x2a8a88={'where':_0x4775a2['where']};return db[_0x005b('0x29')][_0x005b('0x18')](_0x2a8a88)['then'](function(_0x2f7d89){_0xaf7c71[_0x005b('0x18')]=_0x2f7d89;if(_0x2e92d1[_0x005b('0x2c')][_0x005b('0x3b')]){_0x4775a2[_0x005b('0x3c')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x4775a2);})[_0x005b('0x3d')](function(_0x22edf6){_0xaf7c71[_0x005b('0x3e')]=_0x22edf6;return _0xaf7c71;})[_0x005b('0x3d')](respondWithFilteredResult(_0x1d8f93,_0x4775a2))[_0x005b('0x3f')](handleError(_0x1d8f93,null));};exports['show']=function(_0x182e3a,_0x14bd15){var _0x2bbb8a={'raw':![],'where':{'id':_0x182e3a[_0x005b('0x40')]['id']}},_0x35e469={};_0x35e469[_0x005b('0x2e')]=_['keys'](db[_0x005b('0x29')]['rawAttributes']);_0x35e469[_0x005b('0x2c')]=_[_0x005b('0x2d')](_0x182e3a['query']);_0x35e469[_0x005b('0x37')]=_[_0x005b('0x41')](_0x35e469[_0x005b('0x2e')],_0x35e469[_0x005b('0x2c')]);_0x2bbb8a['attributes']=_[_0x005b('0x41')](_0x35e469[_0x005b('0x2e')],qs[_0x005b('0x30')](_0x182e3a[_0x005b('0x2c')][_0x005b('0x30')]));_0x2bbb8a[_0x005b('0x2f')]=_0x2bbb8a[_0x005b('0x2f')][_0x005b('0x31')]?_0x2bbb8a[_0x005b('0x2f')]:_0x35e469['model'];if(_0x182e3a[_0x005b('0x2c')][_0x005b('0x3b')]){_0x2bbb8a[_0x005b('0x3c')]=[{'all':!![]}];}_0x2bbb8a=_[_0x005b('0x39')]({},_0x2bbb8a,_0x182e3a[_0x005b('0x3a')]);return db['Dynamics365Account'][_0x005b('0x42')](_0x2bbb8a)[_0x005b('0x3d')](handleEntityNotFound(_0x14bd15,null))[_0x005b('0x3d')](respondWithResult(_0x14bd15,null))['catch'](handleError(_0x14bd15,null));};exports[_0x005b('0x43')]=function(_0x50d178,_0x498cf1){return db['Dynamics365Account']['create'](_0x50d178[_0x005b('0x44')],{})[_0x005b('0x3d')](respondWithResult(_0x498cf1,0xc9))[_0x005b('0x3f')](handleError(_0x498cf1,null));};exports[_0x005b('0x1f')]=function(_0x4e19cd,_0x140aed){if(_0x4e19cd[_0x005b('0x44')]['id']){delete _0x4e19cd['body']['id'];}return db[_0x005b('0x29')][_0x005b('0x42')]({'where':{'id':_0x4e19cd[_0x005b('0x40')]['id']}})[_0x005b('0x3d')](handleEntityNotFound(_0x140aed,null))[_0x005b('0x3d')](saveUpdates(_0x4e19cd['body'],null))[_0x005b('0x3d')](respondWithResult(_0x140aed,null))[_0x005b('0x3f')](handleError(_0x140aed,null));};exports[_0x005b('0x20')]=function(_0x11dc21,_0x19ca85){return db[_0x005b('0x29')]['find']({'where':{'id':_0x11dc21[_0x005b('0x40')]['id']}})[_0x005b('0x3d')](handleEntityNotFound(_0x19ca85,null))[_0x005b('0x3d')](removeEntity(_0x19ca85,null))[_0x005b('0x3f')](handleError(_0x19ca85,null));};exports[_0x005b('0x45')]=function(_0x1be7c2,_0x4c6eb0,_0x2f5096){var _0x13a680={};var _0x5cea23={};var _0x5bbc78;var _0x22bf46;return db[_0x005b('0x29')][_0x005b('0x46')]({'where':{'id':_0x1be7c2[_0x005b('0x40')]['id']}})[_0x005b('0x3d')](handleEntityNotFound(_0x4c6eb0,null))[_0x005b('0x3d')](function(_0x91c265){if(_0x91c265){_0x5bbc78=_0x91c265;_0x5cea23['model']=_[_0x005b('0x2d')](db['Dynamics365Configuration']['rawAttributes']);_0x5cea23[_0x005b('0x2c')]=_[_0x005b('0x2d')](_0x1be7c2[_0x005b('0x2c')]);_0x5cea23['filters']=_[_0x005b('0x41')](_0x5cea23[_0x005b('0x2e')],_0x5cea23[_0x005b('0x2c')]);_0x13a680['attributes']=_[_0x005b('0x41')](_0x5cea23['model'],qs[_0x005b('0x30')](_0x1be7c2[_0x005b('0x2c')]['fields']));_0x13a680[_0x005b('0x2f')]=_0x13a680[_0x005b('0x2f')][_0x005b('0x31')]?_0x13a680[_0x005b('0x2f')]:_0x5cea23[_0x005b('0x2e')];_0x13a680[_0x005b('0x34')]=qs['sort'](_0x1be7c2[_0x005b('0x2c')][_0x005b('0x35')]);_0x13a680[_0x005b('0x36')]=qs[_0x005b('0x37')](_[_0x005b('0x47')](_0x1be7c2[_0x005b('0x2c')],_0x5cea23['filters']));if(_0x1be7c2[_0x005b('0x2c')]['filter']){_0x13a680[_0x005b('0x36')]=_[_0x005b('0x39')](_0x13a680[_0x005b('0x36')],{'$or':_[_0x005b('0x28')](_0x13a680[_0x005b('0x2f')],function(_0x2ee675){var _0x31355d={};_0x31355d[_0x2ee675]={'$like':'%'+_0x1be7c2[_0x005b('0x2c')][_0x005b('0x38')]+'%'};return _0x31355d;})});}_0x13a680=_[_0x005b('0x39')]({},_0x13a680,_0x1be7c2[_0x005b('0x3a')]);return _0x5bbc78[_0x005b('0x45')](_0x13a680);}})[_0x005b('0x3d')](function(_0x29ca18){if(_0x29ca18){_0x22bf46=_0x29ca18[_0x005b('0x31')];if(!_0x1be7c2['query'][_0x005b('0x32')](_0x005b('0x33'))){_0x13a680[_0x005b('0x17')]=qs[_0x005b('0x17')](_0x1be7c2[_0x005b('0x2c')][_0x005b('0x17')]);_0x13a680[_0x005b('0x19')]=qs['offset'](_0x1be7c2[_0x005b('0x2c')]['offset']);}return _0x5bbc78[_0x005b('0x45')](_0x13a680);}})['then'](function(_0x21d474){if(_0x21d474){return _0x21d474?{'count':_0x22bf46,'rows':_0x21d474}:null;}})[_0x005b('0x3d')](respondWithResult(_0x4c6eb0,null))['catch'](handleError(_0x4c6eb0,null));};exports[_0x005b('0x48')]=function(_0x275094,_0x10d9d2,_0x2b7f3e){if(_0x275094[_0x005b('0x44')]['id']){delete _0x275094[_0x005b('0x44')]['id'];}return db[_0x005b('0x29')][_0x005b('0x46')]({'where':{'id':_0x275094[_0x005b('0x40')]['id']}})[_0x005b('0x3d')](handleEntityNotFound(_0x10d9d2,null))['then'](function(_0x56209a){if(_0x56209a){_0x275094[_0x005b('0x44')][_0x005b('0x49')]=_0x56209a['id'];_0x275094[_0x005b('0x44')][_0x005b('0x4a')]=integrations[_0x005b('0x4b')](_0x275094[_0x005b('0x44')][_0x005b('0x4c')],_0x275094[_0x005b('0x44')][_0x005b('0x2b')]);_0x275094[_0x005b('0x44')][_0x005b('0x4d')]=integrations[_0x005b('0x4e')](_0x275094[_0x005b('0x44')]['channel'],_0x275094[_0x005b('0x44')][_0x005b('0x2b')]);return db['Dynamics365Configuration'][_0x005b('0x43')](_0x275094[_0x005b('0x44')],{'include':[{'model':db[_0x005b('0x4f')],'as':_0x005b('0x4a')},{'model':db[_0x005b('0x4f')],'as':_0x005b('0x4d')}]});}return null;})[_0x005b('0x3d')](respondWithResult(_0x10d9d2,null))[_0x005b('0x3f')](handleError(_0x10d9d2,null));};exports[_0x005b('0x50')]=function(_0x5a6146,_0x46cd37,_0x30e985){var _0x7a2336=_0x5a6146[_0x005b('0x2c')][_0x005b('0x51')];var _0x12f156=_0x7a2336===_0x005b('0x52')?_0x005b('0x53'):_0x005b('0x54');var _0x318932='';var _0x2d5385='';var _0x127918='';var _0x287924='';var _0x5f2ef1='';var _0x172963='';var _0x50f558='';var _0xcf64fb='';var _0x511691=[_0x005b('0x55'),_0x005b('0x56'),_0x005b('0x57'),_0x005b('0x58'),_0x005b('0x59'),_0x005b('0x5a'),_0x005b('0x5b'),'regardingobjectid','directioncode',_0x005b('0x5c')];var _0x3d47e6=['accountidname',_0x005b('0x5d'),_0x005b('0x5e'),'billedserviceunits',_0x005b('0x5f'),'contactidyominame',_0x005b('0x60'),'contractidname',_0x005b('0x61'),_0x005b('0x62'),'createdbyname',_0x005b('0x63'),_0x005b('0x64'),_0x005b('0x65'),_0x005b('0x66'),_0x005b('0x67'),_0x005b('0x68'),_0x005b('0x69'),'emailaddress',_0x005b('0x6a'),_0x005b('0x6b'),_0x005b('0x6c'),_0x005b('0x6d'),_0x005b('0x6e'),_0x005b('0x6f'),_0x005b('0x70'),_0x005b('0x71'),_0x005b('0x72'),_0x005b('0x73'),_0x005b('0x74'),_0x005b('0x75'),_0x005b('0x76'),_0x005b('0x77'),'modifiedbyname','modifiedbyyominame',_0x005b('0x78'),_0x005b('0x79'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x005b('0x7a'),_0x005b('0x7b'),_0x005b('0x7c'),_0x005b('0x7d'),_0x005b('0x7e'),_0x005b('0x7f'),_0x005b('0x80'),_0x005b('0x81'),_0x005b('0x82'),_0x005b('0x83'),'prioritycodename',_0x005b('0x84'),'productserialnumber',_0x005b('0x85'),_0x005b('0x86'),_0x005b('0x87'),'responsiblecontactidname',_0x005b('0x88'),_0x005b('0x89'),_0x005b('0x8a'),_0x005b('0x8b'),_0x005b('0x8c'),_0x005b('0x8d'),_0x005b('0x8e'),'subjectidname',_0x005b('0x8f'),'timezoneruleversionnumber',_0x005b('0x90'),_0x005b('0x91'),'utcconversiontimezonecode',_0x005b('0x92')];var _0x103ef4=_0x511691[_0x005b('0x93')](_0x3d47e6);return db[_0x005b('0x29')][_0x005b('0x46')]({'where':{'id':_0x5a6146[_0x005b('0x40')]['id']},'attributes':['id',_0x005b('0x94'),_0x005b('0x95'),_0x005b('0x96'),_0x005b('0x97'),_0x005b('0x98'),_0x005b('0x99')]})['then'](handleEntityNotFound(_0x46cd37,null))[_0x005b('0x3d')](function(_0x3ab540){if(_0x3ab540){_0xcf64fb=_0x3ab540[_0x005b('0x96')];var _0xf02ef6=_0xcf64fb[_0x005b('0x9a')](-0x1);if(_0xf02ef6==='/'){_0xcf64fb=_0xcf64fb[_0x005b('0x9b')](0x0,_0xcf64fb[_0x005b('0x9c')](_0xf02ef6));}_0x50f558=util[_0x005b('0x9d')](_0x005b('0x9e'),_0xcf64fb);var _0x28bed6={'method':_0x005b('0x9f'),'uri':_0x005b('0xa0')+_0x3ab540[_0x005b('0x97')]+_0x005b('0xa1'),'form':{'client_id':_0x3ab540['clientId'],'resource':_0xcf64fb,'username':_0x3ab540['username'],'password':_0x3ab540[_0x005b('0x95')],'grant_type':'password','client_secret':_0x3ab540[_0x005b('0x99')]},'json':!![]};return rp(_0x28bed6);}})[_0x005b('0x3d')](function(_0x19d9c7){_0x172963=_0x19d9c7[_0x005b('0xa2')];var _0x1ccc2c={'method':_0x005b('0xa3'),'uri':encodeURI(_0x50f558+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x12f156+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x172963,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1ccc2c);})[_0x005b('0x3d')](function(_0xab2fd6){var _0x58a422=_0xab2fd6['value'][0x0];var _0x244c4b=_0x58a422[_0x005b('0xa4')];var _0x109da0={'method':_0x005b('0xa3'),'uri':_0x50f558+_0x005b('0xa5')+_0x244c4b+_0x005b('0xa6'),'headers':{'Authorization':_0x005b('0xa7')+_0x172963,'If-None-Match':null,'OData-Version':_0x005b('0xa8')},'json':!![]};return rp(_0x109da0);})[_0x005b('0x3d')](function(_0x4f1fa1){_0x318932=_0x4f1fa1;_0x2d5385=_0x318932[_0x005b('0xa9')];_0x2d5385=_['remove'](_0x2d5385,function(_0x268711){return!_0x103ef4[_0x005b('0xaa')](_0x268711[_0x005b('0xab')]);});var _0x374e18=[];var _0x31c4be=[];_0x2d5385[_0x005b('0xac')](function(_0x182320){if(_0x182320[_0x005b('0xad')]){var _0x5b0700=_0x182320['@odata.type'][_0x005b('0x9b')](_0x182320[_0x005b('0xad')]['lastIndexOf']('.')+0x1);if(_0x5b0700===_0x005b('0xae')){_0x374e18['push'](getSelectList(_0x50f558,_0x7a2336,_0x31c4be,_0x318932[_0x005b('0xa4')],_0x182320['MetadataId'],_0x172963));}}});return Promise[_0x005b('0xaf')](_0x374e18);})[_0x005b('0x3d')](function(_0x5e6af1){_0x127918=_0x5e6af1[0x0];var _0x3a093f=[];var _0x16efb1=[];_0x2d5385['forEach'](function(_0xa0a519){if(!_[_0x005b('0xb0')](_0xa0a519['@odata.type'])){var _0x21ff50=_0xa0a519['@odata.type']['substring'](_0xa0a519[_0x005b('0xad')][_0x005b('0x9c')]('.')+0x1);if(_0x21ff50==='BooleanAttributeMetadata'){_0x3a093f[_0x005b('0xb1')](getBooleanList(_0x50f558,_0x7a2336,_0x16efb1,_0x318932[_0x005b('0xa4')],_0xa0a519[_0x005b('0xa4')],_0x172963));}}});return Promise['all'](_0x3a093f);})['then'](function(_0x3441b2){_0x287924=_0x3441b2[0x0];var _0x3cbdc4=[];var _0x2b3727=[];_0x2d5385['forEach'](function(_0x2b4696){if(_0x2b4696['@odata.type']){var _0x58f675=_0x2b4696[_0x005b('0xad')]['substring'](_0x2b4696[_0x005b('0xad')][_0x005b('0x9c')]('.')+0x1);if(_0x58f675===_0x005b('0xb2')||_0x58f675==='DoubleAttributeMetadata'||_0x58f675===_0x005b('0xb3')||_0x58f675===_0x005b('0xb4')||_0x58f675===_0x005b('0xb5')||_0x58f675==='DateTimeAttributeMetadata'||_0x58f675===_0x005b('0xb6')||_0x58f675===_0x005b('0xb7')||_0x58f675===_0x005b('0xb8')||_0x58f675==='DecimalAttributeMetadata'){_0x3cbdc4[_0x005b('0xb1')](getInputList(_0x50f558,_0x7a2336,_0x58f675,_0x2b3727,_0x318932[_0x005b('0xa4')],_0x2b4696[_0x005b('0xa4')],_0x172963));}}});return Promise['all'](_0x3cbdc4);})[_0x005b('0x3d')](function(_0x2956ed){_0x5f2ef1=_0x2956ed[0x0];var _0x237f85=_0x127918[_0x005b('0x93')](_0x287924)[_0x005b('0x93')](_0x5f2ef1);var _0x561499={'count':_0x237f85[_0x005b('0x31')],'rows':_0x237f85};return _0x561499;})['then'](respondWithResult(_0x46cd37,null))[_0x005b('0x3f')](function(_0x19af77){var _0x53a5dc=_0x5a6146[_0x005b('0x2c')][_0x005b('0xb9')]?0x1f4:_0x19af77[_0x005b('0xba')]||0x1f4;logger[_0x005b('0x23')](_0x19af77[_0x005b('0x24')]);delete _0x19af77[_0x005b('0x25')];if(_0x53a5dc===0x191){_0x53a5dc=0x190;}_0x46cd37[_0x005b('0x21')](_0x53a5dc)[_0x005b('0x26')](_0x5a6146[_0x005b('0x2c')]['test']?{'message':_0x005b('0xbb'),'statusCode':_0x19af77[_0x005b('0xba')]}:_0x19af77);});};function getSelectList(_0x529e5e,_0x3634a6,_0x361aba,_0x359810,_0x2cc7b2,_0x54616b){var _0x254db3={'method':_0x005b('0xa3'),'uri':_0x529e5e+_0x005b('0xa5')+_0x359810+_0x005b('0xbc')+_0x2cc7b2+_0x005b('0xbd')+_0x005b('0xbe'),'headers':{'Authorization':_0x005b('0xa7')+_0x54616b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x254db3)[_0x005b('0x3d')](function(_0x4a615d){var _0x497dd7=[];var _0x49d244=_0x4a615d[_0x005b('0xbf')][_0x005b('0xc0')];_0x49d244['forEach'](function(_0xe7bd5b){_0x497dd7[_0x005b('0xb1')]({'name':_0xe7bd5b[_0x005b('0xc1')][_0x005b('0xc2')][_0x005b('0xc1')],'value':String(_0xe7bd5b[_0x005b('0xc3')])});});var _0x27e697={'id':_0x3634a6+'_'+_0x4a615d[_0x005b('0xab')],'name':_0x4a615d[_0x005b('0xc4')][_0x005b('0xc2')][_0x005b('0xc1')],'custom':![],'options':_0x497dd7};_0x361aba['push'](_0x27e697);return _0x361aba;});}function getBooleanList(_0x1d63cb,_0x73d14,_0x3bcf9b,_0x412689,_0x30281d,_0x4206f9){var _0x3776b2={'method':_0x005b('0xa3'),'uri':_0x1d63cb+_0x005b('0xa5')+_0x412689+_0x005b('0xbc')+_0x30281d+_0x005b('0xc5'),'headers':{'Authorization':_0x005b('0xa7')+_0x4206f9,'If-None-Match':null,'OData-Version':_0x005b('0xa8')},'json':!![]};return rp(_0x3776b2)['then'](function(_0x2b629){var _0x24da0c=[];_0x24da0c[_0x005b('0xb1')]({'name':_0x2b629[_0x005b('0xbf')][_0x005b('0xc6')][_0x005b('0xc1')][_0x005b('0xc2')]['Label'],'value':_0x005b('0xc7')},{'name':_0x2b629['OptionSet'][_0x005b('0xc8')][_0x005b('0xc1')]['UserLocalizedLabel'][_0x005b('0xc1')],'value':_0x005b('0xc9')});var _0x50e67a={'id':_0x73d14+'_'+_0x2b629[_0x005b('0xab')],'name':_0x2b629['DisplayName'][_0x005b('0xc2')][_0x005b('0xc1')],'custom':![],'options':_0x24da0c};_0x3bcf9b[_0x005b('0xb1')](_0x50e67a);return _0x3bcf9b;});}function getInputList(_0x4c5b50,_0x57f90e,_0x4ee654,_0x486651,_0x2bb041,_0xf977bf,_0x16a9de){var _0x217d3b={'method':_0x005b('0xa3'),'uri':_0x4c5b50+_0x005b('0xa5')+_0x2bb041+')/Attributes('+_0xf977bf+')/Microsoft.Dynamics.CRM.'+_0x4ee654+_0x005b('0xca'),'headers':{'Authorization':_0x005b('0xa7')+_0x16a9de,'If-None-Match':null,'OData-Version':_0x005b('0xa8')},'json':!![]};return rp(_0x217d3b)['then'](function(_0x59ae33){var _0x2c7070={'id':_0x57f90e+'_'+_0x59ae33['LogicalName'],'name':_0x59ae33['DisplayName']['UserLocalizedLabel']?_0x59ae33[_0x005b('0xc4')][_0x005b('0xc2')]['Label']:_0x59ae33['LogicalName'],'custom':![],'options':[]};_0x486651[_0x005b('0xb1')](_0x2c7070);return _0x486651;});} \ No newline at end of file +var _0x66fa=['stack','name','Dynamics365Account','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','POST','https://login.microsoftonline.com/','username','access_token','GET','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','send','test',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','?$select=DisplayName,LogicalName','LogicalName','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','set','update','then','destroy','status','error'];(function(_0x239883,_0x5c88a4){var _0x2f5af3=function(_0x5ba1bf){while(--_0x5ba1bf){_0x239883['push'](_0x239883['shift']());}};_0x2f5af3(++_0x5c88a4);}(_0x66fa,0x168));var _0xa66f=function(_0x2ccd46,_0x1cba72){_0x2ccd46=_0x2ccd46-0x0;var _0x514f00=_0x66fa[_0x2ccd46];return _0x514f00;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require(_0xa66f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var Mustache=require(_0xa66f('0x5'));var util=require(_0xa66f('0x6'));var path=require(_0xa66f('0x7'));var sox=require(_0xa66f('0x8'));var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var fs_extra=require(_0xa66f('0xb'));var _=require(_0xa66f('0xc'));var squel=require(_0xa66f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa66f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa66f('0x9'));var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require(_0xa66f('0x11'));var qs=require(_0xa66f('0x12'));var as=require(_0xa66f('0x13'));var hardwareService=require(_0xa66f('0x14'));var logger=require(_0xa66f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa66f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x17'))['db'];var integrations=require(_0xa66f('0x18'));function respondWithStatusCode(_0x1162c0,_0x4b0dad){_0x4b0dad=_0x4b0dad||0xcc;return function(_0x26030b){if(_0x26030b){return _0x1162c0[_0xa66f('0x19')](_0x4b0dad);}return _0x1162c0['status'](_0x4b0dad)[_0xa66f('0x1a')]();};}function respondWithResult(_0x24423a,_0x263e64){_0x263e64=_0x263e64||0xc8;return function(_0x96a262){if(_0x96a262){return _0x24423a['status'](_0x263e64)[_0xa66f('0x1b')](_0x96a262);}};}function respondWithFilteredResult(_0x27f04e,_0x5685c4){return function(_0x2d9ec7){if(_0x2d9ec7){var _0x33270b=typeof _0x5685c4[_0xa66f('0x1c')]===_0xa66f('0x1d')&&typeof _0x5685c4[_0xa66f('0x1e')]===_0xa66f('0x1d');var _0x58f239=_0x2d9ec7['count'];var _0x162a28=_0x33270b?0x0:_0x5685c4[_0xa66f('0x1c')];var _0x1b4ab0=_0x33270b?_0x2d9ec7[_0xa66f('0x1f')]:_0x5685c4['offset']+_0x5685c4[_0xa66f('0x1e')];var _0x2ab333;if(_0x1b4ab0>=_0x58f239){_0x1b4ab0=_0x58f239;_0x2ab333=0xc8;}else{_0x2ab333=0xce;}_0x27f04e['status'](_0x2ab333);return _0x27f04e[_0xa66f('0x20')]('Content-Range',_0x162a28+'-'+_0x1b4ab0+'/'+_0x58f239)[_0xa66f('0x1b')](_0x2d9ec7);}return null;};}function patchUpdates(_0x32d0a9){return function(_0x4a92dd){try{jsonpatch['apply'](_0x4a92dd,_0x32d0a9,!![]);}catch(_0xc87a54){return BPromise['reject'](_0xc87a54);}return _0x4a92dd['save']();};}function saveUpdates(_0x59f7aa,_0x535359){return function(_0x40ec74){if(_0x40ec74){return _0x40ec74[_0xa66f('0x21')](_0x59f7aa)[_0xa66f('0x22')](function(_0x4cfec6){return _0x4cfec6;});}return null;};}function removeEntity(_0x20bf81,_0xe5e0f1){return function(_0x5e8c5b){if(_0x5e8c5b){return _0x5e8c5b[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x20bf81[_0xa66f('0x24')](0xcc)[_0xa66f('0x1a')]();});}};}function handleEntityNotFound(_0xa90ae0,_0x13aec8){return function(_0x56b603){if(!_0x56b603){_0xa90ae0['sendStatus'](0x194);}return _0x56b603;};}function handleError(_0x272f1e,_0x5a03f7){_0x5a03f7=_0x5a03f7||0x1f4;return function(_0x45dc65){logger[_0xa66f('0x25')](_0x45dc65[_0xa66f('0x26')]);if(_0x45dc65['name']){delete _0x45dc65[_0xa66f('0x27')];}_0x272f1e['status'](_0x5a03f7)['send'](_0x45dc65);};}exports['index']=function(_0x2cab2a,_0x502e6e){var _0xd9f17e={},_0x7d07a4={},_0x386c4d={'count':0x0,'rows':[]};var _0x5f253f=_['map'](db[_0xa66f('0x28')][_0xa66f('0x29')],function(_0xb7a0a3){return{'name':_0xb7a0a3['fieldName'],'type':_0xb7a0a3[_0xa66f('0x2a')]['key']};});_0x7d07a4[_0xa66f('0x2b')]=_[_0xa66f('0x2c')](_0x5f253f,_0xa66f('0x27'));_0x7d07a4[_0xa66f('0x2d')]=_[_0xa66f('0x2e')](_0x2cab2a[_0xa66f('0x2d')]);_0x7d07a4['filters']=_[_0xa66f('0x2f')](_0x7d07a4[_0xa66f('0x2b')],_0x7d07a4['query']);_0xd9f17e[_0xa66f('0x30')]=_[_0xa66f('0x2f')](_0x7d07a4['model'],qs['fields'](_0x2cab2a[_0xa66f('0x2d')][_0xa66f('0x31')]));_0xd9f17e[_0xa66f('0x30')]=_0xd9f17e[_0xa66f('0x30')][_0xa66f('0x32')]?_0xd9f17e[_0xa66f('0x30')]:_0x7d07a4['model'];if(!_0x2cab2a[_0xa66f('0x2d')][_0xa66f('0x33')](_0xa66f('0x34'))){_0xd9f17e[_0xa66f('0x1e')]=qs['limit'](_0x2cab2a['query'][_0xa66f('0x1e')]);_0xd9f17e['offset']=qs[_0xa66f('0x1c')](_0x2cab2a[_0xa66f('0x2d')][_0xa66f('0x1c')]);}_0xd9f17e[_0xa66f('0x35')]=qs[_0xa66f('0x36')](_0x2cab2a[_0xa66f('0x2d')][_0xa66f('0x36')]);_0xd9f17e[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_[_0xa66f('0x39')](_0x2cab2a[_0xa66f('0x2d')],_0x7d07a4[_0xa66f('0x38')]),_0x5f253f);if(_0x2cab2a['query'][_0xa66f('0x3a')]){_0xd9f17e[_0xa66f('0x37')]=_['merge'](_0xd9f17e[_0xa66f('0x37')],{'$or':_['map'](_0x5f253f,function(_0x3462f3){if(_0x3462f3[_0xa66f('0x2a')]!==_0xa66f('0x3b')){var _0x2c185b={};_0x2c185b[_0x3462f3['name']]={'$like':'%'+_0x2cab2a[_0xa66f('0x2d')][_0xa66f('0x3a')]+'%'};return _0x2c185b;}})});}_0xd9f17e=_[_0xa66f('0x3c')]({},_0xd9f17e,_0x2cab2a[_0xa66f('0x3d')]);var _0x5a778f={'where':_0xd9f17e[_0xa66f('0x37')]};return db['Dynamics365Account'][_0xa66f('0x1f')](_0x5a778f)[_0xa66f('0x22')](function(_0x1f598b){_0x386c4d[_0xa66f('0x1f')]=_0x1f598b;if(_0x2cab2a['query'][_0xa66f('0x3e')]){_0xd9f17e['include']=[{'all':!![]}];}return db[_0xa66f('0x28')][_0xa66f('0x3f')](_0xd9f17e);})[_0xa66f('0x22')](function(_0x3c5c91){_0x386c4d[_0xa66f('0x40')]=_0x3c5c91;return _0x386c4d;})[_0xa66f('0x22')](respondWithFilteredResult(_0x502e6e,_0xd9f17e))[_0xa66f('0x41')](handleError(_0x502e6e,null));};exports[_0xa66f('0x42')]=function(_0x3990b3,_0x3ed4a0){var _0x324818={'raw':![],'where':{'id':_0x3990b3[_0xa66f('0x43')]['id']}},_0x132afa={};_0x132afa[_0xa66f('0x2b')]=_[_0xa66f('0x2e')](db['Dynamics365Account'][_0xa66f('0x29')]);_0x132afa[_0xa66f('0x2d')]=_[_0xa66f('0x2e')](_0x3990b3['query']);_0x132afa[_0xa66f('0x38')]=_['intersection'](_0x132afa[_0xa66f('0x2b')],_0x132afa[_0xa66f('0x2d')]);_0x324818[_0xa66f('0x30')]=_['intersection'](_0x132afa['model'],qs[_0xa66f('0x31')](_0x3990b3[_0xa66f('0x2d')][_0xa66f('0x31')]));_0x324818[_0xa66f('0x30')]=_0x324818[_0xa66f('0x30')][_0xa66f('0x32')]?_0x324818['attributes']:_0x132afa[_0xa66f('0x2b')];if(_0x3990b3[_0xa66f('0x2d')]['includeAll']){_0x324818['include']=[{'all':!![]}];}_0x324818=_[_0xa66f('0x3c')]({},_0x324818,_0x3990b3[_0xa66f('0x3d')]);return db[_0xa66f('0x28')][_0xa66f('0x44')](_0x324818)[_0xa66f('0x22')](handleEntityNotFound(_0x3ed4a0,null))['then'](respondWithResult(_0x3ed4a0,null))[_0xa66f('0x41')](handleError(_0x3ed4a0,null));};exports[_0xa66f('0x45')]=function(_0x3aa272,_0x39b201){return db[_0xa66f('0x28')]['create'](_0x3aa272[_0xa66f('0x46')],{})[_0xa66f('0x22')](respondWithResult(_0x39b201,0xc9))[_0xa66f('0x41')](handleError(_0x39b201,null));};exports[_0xa66f('0x21')]=function(_0x35108c,_0x50cb3b){if(_0x35108c['body']['id']){delete _0x35108c[_0xa66f('0x46')]['id'];}return db[_0xa66f('0x28')][_0xa66f('0x44')]({'where':{'id':_0x35108c[_0xa66f('0x43')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x50cb3b,null))[_0xa66f('0x22')](saveUpdates(_0x35108c[_0xa66f('0x46')],null))[_0xa66f('0x22')](respondWithResult(_0x50cb3b,null))['catch'](handleError(_0x50cb3b,null));};exports[_0xa66f('0x23')]=function(_0x313075,_0xb0c56){return db[_0xa66f('0x28')][_0xa66f('0x44')]({'where':{'id':_0x313075['params']['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0xb0c56,null))[_0xa66f('0x22')](removeEntity(_0xb0c56,null))[_0xa66f('0x41')](handleError(_0xb0c56,null));};exports['getConfigurations']=function(_0x4fa4a9,_0x19018f,_0x24092d){var _0x55b211={};var _0x43efba={};var _0x6b6fdd;var _0x5b800e;return db[_0xa66f('0x28')]['findOne']({'where':{'id':_0x4fa4a9[_0xa66f('0x43')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19018f,null))[_0xa66f('0x22')](function(_0x4f3406){if(_0x4f3406){_0x6b6fdd=_0x4f3406;_0x43efba[_0xa66f('0x2b')]=_['keys'](db[_0xa66f('0x47')][_0xa66f('0x29')]);_0x43efba[_0xa66f('0x2d')]=_[_0xa66f('0x2e')](_0x4fa4a9[_0xa66f('0x2d')]);_0x43efba[_0xa66f('0x38')]=_[_0xa66f('0x2f')](_0x43efba['model'],_0x43efba['query']);_0x55b211['attributes']=_[_0xa66f('0x2f')](_0x43efba[_0xa66f('0x2b')],qs[_0xa66f('0x31')](_0x4fa4a9[_0xa66f('0x2d')][_0xa66f('0x31')]));_0x55b211[_0xa66f('0x30')]=_0x55b211[_0xa66f('0x30')]['length']?_0x55b211[_0xa66f('0x30')]:_0x43efba['model'];_0x55b211[_0xa66f('0x35')]=qs[_0xa66f('0x36')](_0x4fa4a9['query'][_0xa66f('0x36')]);_0x55b211[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_['pick'](_0x4fa4a9['query'],_0x43efba['filters']));if(_0x4fa4a9[_0xa66f('0x2d')]['filter']){_0x55b211[_0xa66f('0x37')]=_['merge'](_0x55b211[_0xa66f('0x37')],{'$or':_[_0xa66f('0x2c')](_0x55b211['attributes'],function(_0x4859d0){var _0x511fc0={};_0x511fc0[_0x4859d0]={'$like':'%'+_0x4fa4a9[_0xa66f('0x2d')][_0xa66f('0x3a')]+'%'};return _0x511fc0;})});}_0x55b211=_[_0xa66f('0x3c')]({},_0x55b211,_0x4fa4a9[_0xa66f('0x3d')]);return _0x6b6fdd[_0xa66f('0x48')](_0x55b211);}})['then'](function(_0xe7af9d){if(_0xe7af9d){_0x5b800e=_0xe7af9d[_0xa66f('0x32')];if(!_0x4fa4a9['query']['hasOwnProperty'](_0xa66f('0x34'))){_0x55b211[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x4fa4a9[_0xa66f('0x2d')][_0xa66f('0x1e')]);_0x55b211[_0xa66f('0x1c')]=qs[_0xa66f('0x1c')](_0x4fa4a9[_0xa66f('0x2d')][_0xa66f('0x1c')]);}return _0x6b6fdd[_0xa66f('0x48')](_0x55b211);}})[_0xa66f('0x22')](function(_0x42e42c){if(_0x42e42c){return _0x42e42c?{'count':_0x5b800e,'rows':_0x42e42c}:null;}})[_0xa66f('0x22')](respondWithResult(_0x19018f,null))['catch'](handleError(_0x19018f,null));};exports[_0xa66f('0x49')]=function(_0x55399a,_0x3819d9,_0xfd7020){if(_0x55399a[_0xa66f('0x46')]['id']){delete _0x55399a[_0xa66f('0x46')]['id'];}return db[_0xa66f('0x28')][_0xa66f('0x4a')]({'where':{'id':_0x55399a[_0xa66f('0x43')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x3819d9,null))[_0xa66f('0x22')](function(_0xd4767e){if(_0xd4767e){_0x55399a[_0xa66f('0x46')][_0xa66f('0x4b')]=_0xd4767e['id'];_0x55399a[_0xa66f('0x46')][_0xa66f('0x4c')]=integrations['getSubjects'](_0x55399a[_0xa66f('0x46')][_0xa66f('0x4d')],_0x55399a[_0xa66f('0x46')][_0xa66f('0x2a')]);_0x55399a['body'][_0xa66f('0x4e')]=integrations[_0xa66f('0x4f')](_0x55399a['body']['channel'],_0x55399a[_0xa66f('0x46')][_0xa66f('0x2a')]);return db[_0xa66f('0x47')][_0xa66f('0x45')](_0x55399a['body'],{'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x4c')},{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x4e')}]});}return null;})[_0xa66f('0x22')](respondWithResult(_0x3819d9,null))[_0xa66f('0x41')](handleError(_0x3819d9,null));};exports[_0xa66f('0x51')]=function(_0x3c1f45,_0x269d48,_0x326f56){var _0x443c19=_0x3c1f45['query'][_0xa66f('0x52')];var _0x4b0f2b=_0x443c19===_0xa66f('0x53')?_0xa66f('0x54'):_0xa66f('0x55');var _0x190cce='';var _0x278cd5='';var _0x360997='';var _0x204ea6='';var _0x5ce85d='';var _0x3de79a='';var _0xa203e='';var _0x5af414='';var _0x4b2b1d=[_0xa66f('0x56'),_0xa66f('0x57'),_0xa66f('0x58'),_0xa66f('0x59'),'caseorigincode',_0xa66f('0x5a'),_0xa66f('0x5b'),_0xa66f('0x5c'),_0xa66f('0x5d'),_0xa66f('0x5e')];var _0x197d4a=[_0xa66f('0x5f'),'accountidyominame',_0xa66f('0x60'),_0xa66f('0x61'),_0xa66f('0x62'),'contactidyominame',_0xa66f('0x63'),_0xa66f('0x64'),'createdbyexternalpartyname',_0xa66f('0x65'),_0xa66f('0x66'),'createdbyyominame',_0xa66f('0x67'),_0xa66f('0x68'),_0xa66f('0x69'),_0xa66f('0x6a'),_0xa66f('0x6b'),_0xa66f('0x6c'),'emailaddress','entitlementidname',_0xa66f('0x6d'),_0xa66f('0x6e'),_0xa66f('0x6f'),_0xa66f('0x70'),'firstresponsebykpiidname',_0xa66f('0x71'),_0xa66f('0x72'),'influencescore',_0xa66f('0x73'),_0xa66f('0x74'),_0xa66f('0x75'),'modifiedbyexternalpartyname',_0xa66f('0x76'),_0xa66f('0x77'),_0xa66f('0x78'),'modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xa66f('0x79'),_0xa66f('0x7a'),_0xa66f('0x7b'),'onholdtime','overriddencreatedon',_0xa66f('0x7c'),_0xa66f('0x7d'),_0xa66f('0x7e'),_0xa66f('0x7f'),_0xa66f('0x80'),_0xa66f('0x81'),'prioritycodename',_0xa66f('0x82'),'productserialnumber',_0xa66f('0x83'),_0xa66f('0x84'),_0xa66f('0x85'),_0xa66f('0x86'),_0xa66f('0x87'),_0xa66f('0x88'),_0xa66f('0x89'),'slaname',_0xa66f('0x8a'),'statecode',_0xa66f('0x8b'),_0xa66f('0x8c'),_0xa66f('0x8d'),_0xa66f('0x8e'),_0xa66f('0x8f'),_0xa66f('0x90'),_0xa66f('0x91'),_0xa66f('0x92')];var _0x5af4b2=_0x4b2b1d[_0xa66f('0x93')](_0x197d4a);return db[_0xa66f('0x28')][_0xa66f('0x4a')]({'where':{'id':_0x3c1f45[_0xa66f('0x43')]['id']},'attributes':['id','username',_0xa66f('0x94'),_0xa66f('0x95'),_0xa66f('0x96'),_0xa66f('0x97'),_0xa66f('0x98')]})[_0xa66f('0x22')](handleEntityNotFound(_0x269d48,null))[_0xa66f('0x22')](function(_0x5d62bb){if(_0x5d62bb){_0x5af414=_0x5d62bb[_0xa66f('0x95')];var _0x3c1faf=_0x5af414['slice'](-0x1);if(_0x3c1faf==='/'){_0x5af414=_0x5af414[_0xa66f('0x99')](0x0,_0x5af414[_0xa66f('0x9a')](_0x3c1faf));}_0xa203e=util['format']('%s/api/data/v9.0/',_0x5af414);var _0x1ce0fc={'method':_0xa66f('0x9b'),'uri':_0xa66f('0x9c')+_0x5d62bb['tenantId']+'/oauth2/token','form':{'client_id':_0x5d62bb[_0xa66f('0x97')],'resource':_0x5af414,'username':_0x5d62bb[_0xa66f('0x9d')],'password':_0x5d62bb[_0xa66f('0x94')],'grant_type':_0xa66f('0x94'),'client_secret':_0x5d62bb[_0xa66f('0x98')]},'json':!![]};return rp(_0x1ce0fc);}})['then'](function(_0xcafb54){_0x3de79a=_0xcafb54[_0xa66f('0x9e')];var _0x113f54={'method':_0xa66f('0x9f'),'uri':encodeURI(_0xa203e+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4b0f2b+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3de79a,'If-None-Match':null,'OData-Version':_0xa66f('0xa0')},'json':!![]};return rp(_0x113f54);})[_0xa66f('0x22')](function(_0x39a830){var _0x4f1e0d=_0x39a830['value'][0x0];var _0x42bbd4=_0x4f1e0d[_0xa66f('0xa1')];var _0x1159c6={'method':_0xa66f('0x9f'),'uri':_0xa203e+_0xa66f('0xa2')+_0x42bbd4+_0xa66f('0xa3'),'headers':{'Authorization':_0xa66f('0xa4')+_0x3de79a,'If-None-Match':null,'OData-Version':_0xa66f('0xa0')},'json':!![]};return rp(_0x1159c6);})[_0xa66f('0x22')](function(_0x46be69){_0x190cce=_0x46be69;_0x278cd5=_0x190cce[_0xa66f('0xa5')];_0x278cd5=_[_0xa66f('0xa6')](_0x278cd5,function(_0x2001d2){return!_0x5af4b2[_0xa66f('0xa7')](_0x2001d2['LogicalName']);});var _0x156320=[];var _0x52f70a=[];_0x278cd5[_0xa66f('0xa8')](function(_0x537824){if(_0x537824[_0xa66f('0xa9')]){var _0x1fd1fa=_0x537824['@odata.type']['substring'](_0x537824[_0xa66f('0xa9')][_0xa66f('0x9a')]('.')+0x1);if(_0x1fd1fa===_0xa66f('0xaa')){_0x156320[_0xa66f('0xab')](getSelectList(_0xa203e,_0x443c19,_0x52f70a,_0x190cce[_0xa66f('0xa1')],_0x537824['MetadataId'],_0x3de79a));}}});return Promise[_0xa66f('0xac')](_0x156320);})['then'](function(_0x45a8ff){_0x360997=_0x45a8ff[0x0];var _0x2fa488=[];var _0x29c8e4=[];_0x278cd5[_0xa66f('0xa8')](function(_0x2e1cb7){if(!_[_0xa66f('0xad')](_0x2e1cb7[_0xa66f('0xa9')])){var _0x4b2171=_0x2e1cb7[_0xa66f('0xa9')][_0xa66f('0x99')](_0x2e1cb7[_0xa66f('0xa9')][_0xa66f('0x9a')]('.')+0x1);if(_0x4b2171==='BooleanAttributeMetadata'){_0x2fa488[_0xa66f('0xab')](getBooleanList(_0xa203e,_0x443c19,_0x29c8e4,_0x190cce[_0xa66f('0xa1')],_0x2e1cb7['MetadataId'],_0x3de79a));}}});return Promise['all'](_0x2fa488);})[_0xa66f('0x22')](function(_0x3eafb4){_0x204ea6=_0x3eafb4[0x0];var _0x386c00=[];var _0x453b3f=[];_0x278cd5[_0xa66f('0xa8')](function(_0x4e1956){if(_0x4e1956['@odata.type']){var _0x4f4ede=_0x4e1956[_0xa66f('0xa9')][_0xa66f('0x99')](_0x4e1956[_0xa66f('0xa9')]['lastIndexOf']('.')+0x1);if(_0x4f4ede===_0xa66f('0xae')||_0x4f4ede==='DoubleAttributeMetadata'||_0x4f4ede==='BigIntAttributeMetadata'||_0x4f4ede===_0xa66f('0xaf')||_0x4f4ede===_0xa66f('0xb0')||_0x4f4ede===_0xa66f('0xb1')||_0x4f4ede===_0xa66f('0xb2')||_0x4f4ede===_0xa66f('0xb3')||_0x4f4ede===_0xa66f('0xb4')||_0x4f4ede===_0xa66f('0xb5')){_0x386c00[_0xa66f('0xab')](getInputList(_0xa203e,_0x443c19,_0x4f4ede,_0x453b3f,_0x190cce[_0xa66f('0xa1')],_0x4e1956[_0xa66f('0xa1')],_0x3de79a));}}});return Promise[_0xa66f('0xac')](_0x386c00);})[_0xa66f('0x22')](function(_0xcc5510){_0x5ce85d=_0xcc5510[0x0];var _0x3cd569=_0x360997[_0xa66f('0x93')](_0x204ea6)[_0xa66f('0x93')](_0x5ce85d);var _0x104976={'count':_0x3cd569[_0xa66f('0x32')],'rows':_0x3cd569};return _0x104976;})['then'](respondWithResult(_0x269d48,null))[_0xa66f('0x41')](function(_0x2986be){var _0x4ace46=_0x3c1f45[_0xa66f('0x2d')]['test']?0x1f4:_0x2986be[_0xa66f('0xb6')]||0x1f4;logger[_0xa66f('0x25')](_0x2986be[_0xa66f('0x26')]);delete _0x2986be[_0xa66f('0x27')];if(_0x4ace46===0x191){_0x4ace46=0x190;}_0x269d48[_0xa66f('0x24')](_0x4ace46)[_0xa66f('0xb7')](_0x3c1f45['query'][_0xa66f('0xb8')]?{'message':'Wrong\x20credentials','statusCode':_0x2986be[_0xa66f('0xb6')]}:_0x2986be);});};function getSelectList(_0x4a71f9,_0x3143ca,_0x366f80,_0x289e3e,_0x4df4f8,_0x3c3b57){var _0x3c8720={'method':'GET','uri':_0x4a71f9+'EntityDefinitions('+_0x289e3e+_0xa66f('0xb9')+_0x4df4f8+_0xa66f('0xba')+_0xa66f('0xbb'),'headers':{'Authorization':_0xa66f('0xa4')+_0x3c3b57,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c8720)[_0xa66f('0x22')](function(_0x1afb0e){var _0x413179=[];var _0x3e4b47=_0x1afb0e[_0xa66f('0xbc')][_0xa66f('0xbd')];_0x3e4b47[_0xa66f('0xa8')](function(_0x327856){_0x413179[_0xa66f('0xab')]({'name':_0x327856['Label']['UserLocalizedLabel'][_0xa66f('0xbe')],'value':String(_0x327856[_0xa66f('0xbf')])});});var _0x552e6c={'id':_0x3143ca+'_'+_0x1afb0e['LogicalName'],'name':_0x1afb0e[_0xa66f('0xc0')][_0xa66f('0xc1')][_0xa66f('0xbe')],'custom':![],'options':_0x413179};_0x366f80[_0xa66f('0xab')](_0x552e6c);return _0x366f80;});}function getBooleanList(_0x2a3ffc,_0x193042,_0x23eaad,_0x659583,_0x323388,_0x1c4436){var _0x54e8fd={'method':'GET','uri':_0x2a3ffc+_0xa66f('0xa2')+_0x659583+_0xa66f('0xb9')+_0x323388+_0xa66f('0xc2'),'headers':{'Authorization':_0xa66f('0xa4')+_0x1c4436,'If-None-Match':null,'OData-Version':_0xa66f('0xa0')},'json':!![]};return rp(_0x54e8fd)[_0xa66f('0x22')](function(_0x5afa36){var _0x23cfa7=[];_0x23cfa7[_0xa66f('0xab')]({'name':_0x5afa36[_0xa66f('0xbc')]['TrueOption']['Label'][_0xa66f('0xc1')][_0xa66f('0xbe')],'value':_0xa66f('0xc3')},{'name':_0x5afa36[_0xa66f('0xbc')][_0xa66f('0xc4')][_0xa66f('0xbe')][_0xa66f('0xc1')][_0xa66f('0xbe')],'value':'false'});var _0x5b8798={'id':_0x193042+'_'+_0x5afa36['LogicalName'],'name':_0x5afa36['DisplayName'][_0xa66f('0xc1')][_0xa66f('0xbe')],'custom':![],'options':_0x23cfa7};_0x23eaad[_0xa66f('0xab')](_0x5b8798);return _0x23eaad;});}function getInputList(_0x43142e,_0x100932,_0x443e42,_0x516d7f,_0x455ce1,_0x1325a3,_0x2c7caa){var _0x490e89={'method':'GET','uri':_0x43142e+_0xa66f('0xa2')+_0x455ce1+_0xa66f('0xb9')+_0x1325a3+')/Microsoft.Dynamics.CRM.'+_0x443e42+_0xa66f('0xc5'),'headers':{'Authorization':_0xa66f('0xa4')+_0x2c7caa,'If-None-Match':null,'OData-Version':_0xa66f('0xa0')},'json':!![]};return rp(_0x490e89)[_0xa66f('0x22')](function(_0x5dcb75){var _0x3844cd={'id':_0x100932+'_'+_0x5dcb75[_0xa66f('0xc6')],'name':_0x5dcb75[_0xa66f('0xc0')][_0xa66f('0xc1')]?_0x5dcb75[_0xa66f('0xc0')][_0xa66f('0xc1')][_0xa66f('0xbe')]:_0x5dcb75['LogicalName'],'custom':![],'options':[]};_0x516d7f[_0xa66f('0xab')](_0x3844cd);return _0x516d7f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index edcec0d..1254f9f 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x5d1caa,_0x2a5ec6){var _0x50557c=function(_0x307996){while(--_0x307996){_0x5d1caa['push'](_0x5d1caa['shift']());}};_0x50557c(++_0x2a5ec6);}(_0xe706,0xa3));var _0x6e70=function(_0x3330b8,_0x19b32a){_0x3330b8=_0x3330b8-0x0;var _0x191799=_0xe706[_0x3330b8];return _0x191799;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2c4b7d,_0x50217d){var _0x2034e8=function(_0x87d9a){while(--_0x87d9a){_0x2c4b7d['push'](_0x2c4b7d['shift']());}};_0x2034e8(++_0x50217d);}(_0x757a,0xde));var _0xa757=function(_0x4008dc,_0x58477f){_0x4008dc=_0x4008dc-0x0;var _0x38a126=_0x757a[_0x4008dc];return _0x38a126;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'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 7b5a575..6907d36 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 _0x07ef=['model','ShowDynamics365Account','find','lodash','moment','randomstring','../../mysqldb','rpc','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x7d42c9,_0x53721d){var _0x542f15=function(_0x1243d2){while(--_0x1243d2){_0x7d42c9['push'](_0x7d42c9['shift']());}};_0x542f15(++_0x53721d);}(_0x07ef,0x1e3));var _0xf07e=function(_0x209575,_0x417ae0){_0x209575=_0x209575-0x0;var _0x5b183d=_0x07ef[_0x209575];return _0x5b183d;};'use strict';var _=require(_0xf07e('0x0'));var util=require('util');var moment=require(_0xf07e('0x1'));var BPromise=require('bluebird');var rs=require(_0xf07e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf07e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf07e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf07e('0x5')][_0xf07e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x57d117,_0x352e73,_0x2c5d90){return new BPromise(function(_0x1cc250,_0x4a36e3){return client['request'](_0x57d117,_0x2c5d90)[_0xf07e('0x7')](function(_0x5f34b5){logger[_0xf07e('0x8')](_0xf07e('0x9'),_0x352e73,_0xf07e('0xa'));logger[_0xf07e('0xb')](_0xf07e('0xc'),_0x352e73,'request\x20sent',JSON[_0xf07e('0xd')](_0x5f34b5));if(_0x5f34b5['error']){if(_0x5f34b5[_0xf07e('0xe')][_0xf07e('0xf')]===0x1f4){logger[_0xf07e('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x352e73,_0x5f34b5[_0xf07e('0xe')][_0xf07e('0x10')]);return _0x4a36e3(_0x5f34b5[_0xf07e('0xe')][_0xf07e('0x10')]);}logger[_0xf07e('0xe')](_0xf07e('0x9'),_0x352e73,_0x5f34b5[_0xf07e('0xe')][_0xf07e('0x10')]);return _0x1cc250(_0x5f34b5['error']['message']);}else{logger['info'](_0xf07e('0x9'),_0x352e73,'request\x20sent');_0x1cc250(_0x5f34b5[_0xf07e('0x11')]['message']);}})[_0xf07e('0x12')](function(_0x3ed949){logger['error'](_0xf07e('0x9'),_0x352e73,_0x3ed949);_0x4a36e3(_0x3ed949);});});}exports[_0xf07e('0x13')]=function(_0x224e23){var _0x3ff48e=this;return new Promise(function(_0x8e6cb1,_0x1c7b44){return db[_0xf07e('0x14')][_0xf07e('0x15')]({'raw':_0x224e23[_0xf07e('0x16')]?_0x224e23['options'][_0xf07e('0x17')]===undefined?!![]:![]:!![],'where':_0x224e23[_0xf07e('0x16')]?_0x224e23['options'][_0xf07e('0x18')]||null:null,'attributes':_0x224e23[_0xf07e('0x16')]?_0x224e23[_0xf07e('0x16')][_0xf07e('0x19')]||null:null,'limit':_0x224e23[_0xf07e('0x16')]?_0x224e23[_0xf07e('0x16')][_0xf07e('0x1a')]||null:null,'include':_0x224e23[_0xf07e('0x16')]?_0x224e23['options'][_0xf07e('0x1b')]?_[_0xf07e('0x1c')](_0x224e23[_0xf07e('0x16')][_0xf07e('0x1b')],function(_0x2b245a){return{'model':db[_0x2b245a[_0xf07e('0x1d')]],'as':_0x2b245a['as'],'attributes':_0x2b245a[_0xf07e('0x19')],'include':_0x2b245a[_0xf07e('0x1b')]?_['map'](_0x2b245a[_0xf07e('0x1b')],function(_0x410f9b){return{'model':db[_0x410f9b[_0xf07e('0x1d')]],'as':_0x410f9b['as'],'attributes':_0x410f9b[_0xf07e('0x19')],'include':_0x410f9b[_0xf07e('0x1b')]?_[_0xf07e('0x1c')](_0x410f9b['include'],function(_0x9fa891){return{'model':db[_0x9fa891[_0xf07e('0x1d')]],'as':_0x9fa891['as'],'attributes':_0x9fa891['attributes']};}):[]};}):[]};}):[]:[]})[_0xf07e('0x7')](function(_0x4f21f1){logger[_0xf07e('0x8')](_0xf07e('0x13'),_0x224e23);logger[_0xf07e('0xb')](_0xf07e('0x13'),_0x224e23,JSON['stringify'](_0x4f21f1));_0x8e6cb1(_0x4f21f1);})[_0xf07e('0x12')](function(_0x31fc17){logger[_0xf07e('0xe')](_0xf07e('0x13'),_0x31fc17[_0xf07e('0x10')],_0x224e23);_0x1c7b44(_0x3ff48e[_0xf07e('0xe')](0x1f4,_0x31fc17[_0xf07e('0x10')]));});});};exports[_0xf07e('0x1e')]=function(_0xcdf669){var _0x346852=this;return new Promise(function(_0x34de32,_0x322c3b){return db['Dynamics365Account'][_0xf07e('0x1f')]({'raw':_0xcdf669[_0xf07e('0x16')]?_0xcdf669[_0xf07e('0x16')][_0xf07e('0x17')]===undefined?!![]:![]:!![],'where':_0xcdf669[_0xf07e('0x16')]?_0xcdf669[_0xf07e('0x16')]['where']||null:null,'attributes':_0xcdf669[_0xf07e('0x16')]?_0xcdf669[_0xf07e('0x16')][_0xf07e('0x19')]||null:null,'include':_0xcdf669[_0xf07e('0x16')]?_0xcdf669[_0xf07e('0x16')]['include']?_[_0xf07e('0x1c')](_0xcdf669[_0xf07e('0x16')][_0xf07e('0x1b')],function(_0x2f4b49){return{'model':db[_0x2f4b49[_0xf07e('0x1d')]],'as':_0x2f4b49['as'],'attributes':_0x2f4b49['attributes'],'include':_0x2f4b49['include']?_[_0xf07e('0x1c')](_0x2f4b49[_0xf07e('0x1b')],function(_0x220936){return{'model':db[_0x220936[_0xf07e('0x1d')]],'as':_0x220936['as'],'attributes':_0x220936[_0xf07e('0x19')],'include':_0x220936[_0xf07e('0x1b')]?_[_0xf07e('0x1c')](_0x220936[_0xf07e('0x1b')],function(_0x1d5fb5){return{'model':db[_0x1d5fb5[_0xf07e('0x1d')]],'as':_0x1d5fb5['as'],'attributes':_0x1d5fb5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27083b){logger[_0xf07e('0x8')](_0xf07e('0x1e'),_0xcdf669);logger[_0xf07e('0xb')]('ShowDynamics365Account',_0xcdf669,JSON[_0xf07e('0xd')](_0x27083b));_0x34de32(_0x27083b);})[_0xf07e('0x12')](function(_0x5f5c79){logger[_0xf07e('0xe')](_0xf07e('0x1e'),_0x5f5c79[_0xf07e('0x10')],_0xcdf669);_0x322c3b(_0x346852[_0xf07e('0xe')](0x1f4,_0x5f5c79[_0xf07e('0x10')]));});});}; \ No newline at end of file +var _0x8945=['GetDynamics365Account','ShowDynamics365Account','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','map','include','model'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8945,0xb2));var _0x5894=function(_0xd4cf83,_0x42785e){_0xd4cf83=_0xd4cf83-0x0;var _0x550a74=_0x8945[_0xd4cf83];return _0x550a74;};'use strict';var _=require(_0x5894('0x0'));var util=require(_0x5894('0x1'));var moment=require(_0x5894('0x2'));var BPromise=require('bluebird');var rs=require(_0x5894('0x3'));var fs=require('fs');var Redis=require(_0x5894('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5894('0x5'));var logger=require(_0x5894('0x6'))(_0x5894('0x7'));var config=require(_0x5894('0x8'));var jayson=require(_0x5894('0x9'));var client=jayson[_0x5894('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b9bb7,_0x20562b,_0x5302e8){return new BPromise(function(_0x4e0c3f,_0x4c6260){return client[_0x5894('0xb')](_0x2b9bb7,_0x5302e8)[_0x5894('0xc')](function(_0x1e8ebf){logger[_0x5894('0xd')](_0x5894('0xe'),_0x20562b,_0x5894('0xf'));logger[_0x5894('0x10')](_0x5894('0x11'),_0x20562b,_0x5894('0xf'),JSON[_0x5894('0x12')](_0x1e8ebf));if(_0x1e8ebf[_0x5894('0x13')]){if(_0x1e8ebf['error'][_0x5894('0x14')]===0x1f4){logger[_0x5894('0x13')](_0x5894('0xe'),_0x20562b,_0x1e8ebf['error']['message']);return _0x4c6260(_0x1e8ebf['error']['message']);}logger[_0x5894('0x13')](_0x5894('0xe'),_0x20562b,_0x1e8ebf['error'][_0x5894('0x15')]);return _0x4e0c3f(_0x1e8ebf[_0x5894('0x13')]['message']);}else{logger[_0x5894('0xd')](_0x5894('0xe'),_0x20562b,_0x5894('0xf'));_0x4e0c3f(_0x1e8ebf[_0x5894('0x16')][_0x5894('0x15')]);}})[_0x5894('0x17')](function(_0x3f5884){logger['error'](_0x5894('0xe'),_0x20562b,_0x3f5884);_0x4c6260(_0x3f5884);});});}exports['GetDynamics365Account']=function(_0x33b899){var _0x29a928=this;return new Promise(function(_0x1aa451,_0x5f4cda){return db['Dynamics365Account']['findAll']({'raw':_0x33b899['options']?_0x33b899[_0x5894('0x18')][_0x5894('0x19')]===undefined?!![]:![]:!![],'where':_0x33b899['options']?_0x33b899[_0x5894('0x18')][_0x5894('0x1a')]||null:null,'attributes':_0x33b899['options']?_0x33b899[_0x5894('0x18')][_0x5894('0x1b')]||null:null,'limit':_0x33b899[_0x5894('0x18')]?_0x33b899[_0x5894('0x18')][_0x5894('0x1c')]||null:null,'include':_0x33b899[_0x5894('0x18')]?_0x33b899['options']['include']?_[_0x5894('0x1d')](_0x33b899[_0x5894('0x18')][_0x5894('0x1e')],function(_0x2e7f75){return{'model':db[_0x2e7f75[_0x5894('0x1f')]],'as':_0x2e7f75['as'],'attributes':_0x2e7f75['attributes'],'include':_0x2e7f75[_0x5894('0x1e')]?_[_0x5894('0x1d')](_0x2e7f75['include'],function(_0x590326){return{'model':db[_0x590326[_0x5894('0x1f')]],'as':_0x590326['as'],'attributes':_0x590326[_0x5894('0x1b')],'include':_0x590326['include']?_['map'](_0x590326[_0x5894('0x1e')],function(_0x5b320b){return{'model':db[_0x5b320b[_0x5894('0x1f')]],'as':_0x5b320b['as'],'attributes':_0x5b320b[_0x5894('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5894('0xc')](function(_0xe196b4){logger[_0x5894('0xd')](_0x5894('0x20'),_0x33b899);logger['debug']('GetDynamics365Account',_0x33b899,JSON['stringify'](_0xe196b4));_0x1aa451(_0xe196b4);})[_0x5894('0x17')](function(_0x5207bc){logger[_0x5894('0x13')](_0x5894('0x20'),_0x5207bc[_0x5894('0x15')],_0x33b899);_0x5f4cda(_0x29a928[_0x5894('0x13')](0x1f4,_0x5207bc[_0x5894('0x15')]));});});};exports[_0x5894('0x21')]=function(_0x11ad63){var _0x4bcbea=this;return new Promise(function(_0x5ee647,_0x13aee3){return db['Dynamics365Account'][_0x5894('0x22')]({'raw':_0x11ad63[_0x5894('0x18')]?_0x11ad63['options'][_0x5894('0x19')]===undefined?!![]:![]:!![],'where':_0x11ad63[_0x5894('0x18')]?_0x11ad63['options'][_0x5894('0x1a')]||null:null,'attributes':_0x11ad63[_0x5894('0x18')]?_0x11ad63[_0x5894('0x18')][_0x5894('0x1b')]||null:null,'include':_0x11ad63[_0x5894('0x18')]?_0x11ad63['options']['include']?_[_0x5894('0x1d')](_0x11ad63[_0x5894('0x18')][_0x5894('0x1e')],function(_0xc5d81f){return{'model':db[_0xc5d81f[_0x5894('0x1f')]],'as':_0xc5d81f['as'],'attributes':_0xc5d81f[_0x5894('0x1b')],'include':_0xc5d81f['include']?_['map'](_0xc5d81f[_0x5894('0x1e')],function(_0x230b5c){return{'model':db[_0x230b5c[_0x5894('0x1f')]],'as':_0x230b5c['as'],'attributes':_0x230b5c[_0x5894('0x1b')],'include':_0x230b5c[_0x5894('0x1e')]?_['map'](_0x230b5c['include'],function(_0x4b4c15){return{'model':db[_0x4b4c15[_0x5894('0x1f')]],'as':_0x4b4c15['as'],'attributes':_0x4b4c15[_0x5894('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5894('0xc')](function(_0x9a21d3){logger[_0x5894('0xd')](_0x5894('0x21'),_0x11ad63);logger['debug'](_0x5894('0x21'),_0x11ad63,JSON[_0x5894('0x12')](_0x9a21d3));_0x5ee647(_0x9a21d3);})[_0x5894('0x17')](function(_0x214f78){logger['error'](_0x5894('0x21'),_0x214f78[_0x5894('0x15')],_0x11ad63);_0x13aee3(_0x4bcbea[_0x5894('0x13')](0x1f4,_0x214f78[_0x5894('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 841b915..640eedb 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 _0x0120=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var path=require(_0x0012('0x2'));var timeout=require(_0x0012('0x3'));var express=require(_0x0012('0x4'));var router=express[_0x0012('0x5')]();var fs_extra=require(_0x0012('0x6'));var auth=require(_0x0012('0x7'));var interaction=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var controller=require(_0x0012('0xa'));router[_0x0012('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0012('0xc'),auth[_0x0012('0xd')](),controller[_0x0012('0xe')]);router[_0x0012('0xb')](_0x0012('0xf'),auth['isAuthenticated'](),controller[_0x0012('0x10')]);router[_0x0012('0xb')](_0x0012('0x11'),auth[_0x0012('0xd')](),controller['getSubjects']);router[_0x0012('0xb')]('/:id/descriptions',auth[_0x0012('0xd')](),controller[_0x0012('0x12')]);router[_0x0012('0x13')]('/',auth[_0x0012('0xd')](),controller[_0x0012('0x14')]);router['put'](_0x0012('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0012('0xd')](),controller['destroy']);module[_0x0012('0x15')]=router; \ No newline at end of file +var _0x4034=['Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','delete','destroy','util','path','connect-timeout'];(function(_0xc47317,_0x28f3d1){var _0x410f57=function(_0x264b60){while(--_0x264b60){_0xc47317['push'](_0xc47317['shift']());}};_0x410f57(++_0x28f3d1);}(_0x4034,0x166));var _0x4403=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x4034[_0x4d0662];return _0x6eea6d;};'use strict';var multer=require('multer');var util=require(_0x4403('0x0'));var path=require(_0x4403('0x1'));var timeout=require(_0x4403('0x2'));var express=require('express');var router=express[_0x4403('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4403('0x4'));var interaction=require(_0x4403('0x5'));var config=require('../../config/environment');var controller=require(_0x4403('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4403('0x7')]('/:id',auth[_0x4403('0x8')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x4403('0x9')]);router[_0x4403('0x7')](_0x4403('0xa'),auth[_0x4403('0x8')](),controller[_0x4403('0xb')]);router['get'](_0x4403('0xc'),auth[_0x4403('0x8')](),controller[_0x4403('0xd')]);router['post']('/',auth[_0x4403('0x8')](),controller[_0x4403('0xe')]);router[_0x4403('0xf')](_0x4403('0x10'),auth[_0x4403('0x8')](),controller['update']);router[_0x4403('0x11')]('/:id',auth[_0x4403('0x8')](),controller[_0x4403('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 3549849..b3589f1 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 _0x20bc=['sequelize','STRING','ENUM'];(function(_0x1df44f,_0x32d213){var _0x337785=function(_0x3fa97c){while(--_0x3fa97c){_0x1df44f['push'](_0x1df44f['shift']());}};_0x337785(++_0x32d213);}(_0x20bc,0x111));var _0xc20b=function(_0x56f972,_0x49b459){_0x56f972=_0x56f972-0x0;var _0xf415ef=_0x20bc[_0x56f972];return _0xf415ef;};'use strict';var Sequelize=require(_0xc20b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc20b('0x1')]},'ticketType':{'type':Sequelize[_0xc20b('0x2')]('incident','phonecall'),'defaultValue':'incident'}}; \ No newline at end of file +var _0xb32c=['sequelize','exports','STRING','incident','phonecall'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0xb32c,0xa0));var _0xcb32=function(_0x35e94c,_0x4bbf0c){_0x35e94c=_0x35e94c-0x0;var _0x22dd86=_0xb32c[_0x35e94c];return _0x22dd86;};'use strict';var Sequelize=require(_0xcb32('0x0'));module[_0xcb32('0x1')]={'name':{'type':Sequelize[_0xcb32('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xcb32('0x3'),_0xcb32('0x4')),'defaultValue':_0xcb32('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index fd506f5..fa0dd55 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 _0x70db=['nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','Dynamics365Configuration','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x70db,0x152));var _0xb70d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x70db[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xb70d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb70d('0x1'));var jsonpatch=require(_0xb70d('0x2'));var rp=require(_0xb70d('0x3'));var moment=require(_0xb70d('0x4'));var BPromise=require(_0xb70d('0x5'));var Mustache=require(_0xb70d('0x6'));var util=require(_0xb70d('0x7'));var path=require('path');var sox=require(_0xb70d('0x8'));var csv=require(_0xb70d('0x9'));var ejs=require(_0xb70d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb70d('0xb'));var jsforce=require(_0xb70d('0xc'));var deskjs=require(_0xb70d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb70d('0xe'));var Papa=require(_0xb70d('0xf'));var Redis=require('ioredis');var authService=require(_0xb70d('0x10'));var qs=require(_0xb70d('0x11'));var as=require(_0xb70d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb70d('0x13'))('api');var utils=require(_0xb70d('0x14'));var config=require(_0xb70d('0x15'));var licenseUtil=require(_0xb70d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32d8c6,_0x477765){_0x477765=_0x477765||0xcc;return function(_0xf52832){if(_0xf52832){return _0x32d8c6[_0xb70d('0x17')](_0x477765);}return _0x32d8c6[_0xb70d('0x18')](_0x477765)[_0xb70d('0x19')]();};}function respondWithResult(_0x52b477,_0x1e6cf8){_0x1e6cf8=_0x1e6cf8||0xc8;return function(_0x1596e8){if(_0x1596e8){return _0x52b477['status'](_0x1e6cf8)[_0xb70d('0x1a')](_0x1596e8);}};}function respondWithFilteredResult(_0x5bb061,_0x33d669){return function(_0x237135){if(_0x237135){var _0x3be0fc=typeof _0x33d669[_0xb70d('0x1b')]===_0xb70d('0x1c')&&typeof _0x33d669[_0xb70d('0x1d')]===_0xb70d('0x1c');var _0x2a051e=_0x237135['count'];var _0x18abfb=_0x3be0fc?0x0:_0x33d669[_0xb70d('0x1b')];var _0x4d88ca=_0x3be0fc?_0x237135['count']:_0x33d669['offset']+_0x33d669[_0xb70d('0x1d')];var _0x590ab4;if(_0x4d88ca>=_0x2a051e){_0x4d88ca=_0x2a051e;_0x590ab4=0xc8;}else{_0x590ab4=0xce;}_0x5bb061[_0xb70d('0x18')](_0x590ab4);return _0x5bb061[_0xb70d('0x1e')](_0xb70d('0x1f'),_0x18abfb+'-'+_0x4d88ca+'/'+_0x2a051e)[_0xb70d('0x1a')](_0x237135);}return null;};}function patchUpdates(_0x34560b){return function(_0x5af5c7){try{jsonpatch[_0xb70d('0x20')](_0x5af5c7,_0x34560b,!![]);}catch(_0x2c70ca){return BPromise[_0xb70d('0x21')](_0x2c70ca);}return _0x5af5c7[_0xb70d('0x22')]();};}function saveUpdates(_0x4d11c0,_0x3f3541){return function(_0x394de1){if(_0x394de1){return _0x394de1[_0xb70d('0x23')](_0x4d11c0)['then'](function(_0xd172a4){return _0xd172a4;});}return null;};}function removeEntity(_0x2706dc,_0x58b828){return function(_0x5e22e7){if(_0x5e22e7){return _0x5e22e7['destroy']()[_0xb70d('0x24')](function(){_0x2706dc[_0xb70d('0x18')](0xcc)[_0xb70d('0x19')]();});}};}function handleEntityNotFound(_0x274b47,_0x5d9226){return function(_0x1efe4b){if(!_0x1efe4b){_0x274b47[_0xb70d('0x17')](0x194);}return _0x1efe4b;};}function handleError(_0x28256f,_0x11822a){_0x11822a=_0x11822a||0x1f4;return function(_0x4e4583){logger[_0xb70d('0x25')](_0x4e4583[_0xb70d('0x26')]);if(_0x4e4583['name']){delete _0x4e4583[_0xb70d('0x27')];}_0x28256f[_0xb70d('0x18')](_0x11822a)['send'](_0x4e4583);};}exports['index']=function(_0x58ca15,_0x1861ec){var _0x3ffdeb={},_0x2c6c2c={},_0x14c6c6={'count':0x0,'rows':[]};var _0x59d18e=_['map'](db[_0xb70d('0x28')][_0xb70d('0x29')],function(_0x266906){return{'name':_0x266906['fieldName'],'type':_0x266906[_0xb70d('0x2a')]['key']};});_0x2c6c2c[_0xb70d('0x2b')]=_[_0xb70d('0x2c')](_0x59d18e,_0xb70d('0x27'));_0x2c6c2c[_0xb70d('0x2d')]=_['keys'](_0x58ca15[_0xb70d('0x2d')]);_0x2c6c2c[_0xb70d('0x2e')]=_[_0xb70d('0x2f')](_0x2c6c2c[_0xb70d('0x2b')],_0x2c6c2c[_0xb70d('0x2d')]);_0x3ffdeb[_0xb70d('0x30')]=_[_0xb70d('0x2f')](_0x2c6c2c[_0xb70d('0x2b')],qs[_0xb70d('0x31')](_0x58ca15[_0xb70d('0x2d')][_0xb70d('0x31')]));_0x3ffdeb[_0xb70d('0x30')]=_0x3ffdeb['attributes'][_0xb70d('0x32')]?_0x3ffdeb[_0xb70d('0x30')]:_0x2c6c2c[_0xb70d('0x2b')];if(!_0x58ca15[_0xb70d('0x2d')][_0xb70d('0x33')](_0xb70d('0x34'))){_0x3ffdeb['limit']=qs[_0xb70d('0x1d')](_0x58ca15[_0xb70d('0x2d')][_0xb70d('0x1d')]);_0x3ffdeb['offset']=qs[_0xb70d('0x1b')](_0x58ca15['query'][_0xb70d('0x1b')]);}_0x3ffdeb[_0xb70d('0x35')]=qs[_0xb70d('0x36')](_0x58ca15[_0xb70d('0x2d')]['sort']);_0x3ffdeb[_0xb70d('0x37')]=qs[_0xb70d('0x2e')](_[_0xb70d('0x38')](_0x58ca15[_0xb70d('0x2d')],_0x2c6c2c[_0xb70d('0x2e')]),_0x59d18e);if(_0x58ca15[_0xb70d('0x2d')]['filter']){_0x3ffdeb[_0xb70d('0x37')]=_[_0xb70d('0x39')](_0x3ffdeb['where'],{'$or':_[_0xb70d('0x2c')](_0x59d18e,function(_0x43f8ce){if(_0x43f8ce[_0xb70d('0x2a')]!==_0xb70d('0x3a')){var _0xd4134d={};_0xd4134d[_0x43f8ce[_0xb70d('0x27')]]={'$like':'%'+_0x58ca15['query'][_0xb70d('0x3b')]+'%'};return _0xd4134d;}})});}_0x3ffdeb=_['merge']({},_0x3ffdeb,_0x58ca15['options']);var _0x344fc7={'where':_0x3ffdeb['where']};return db[_0xb70d('0x28')][_0xb70d('0x3c')](_0x344fc7)[_0xb70d('0x24')](function(_0x5ad10c){_0x14c6c6[_0xb70d('0x3c')]=_0x5ad10c;if(_0x58ca15[_0xb70d('0x2d')][_0xb70d('0x3d')]){_0x3ffdeb[_0xb70d('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb70d('0x3f')](_0x3ffdeb);})['then'](function(_0x15ce73){_0x14c6c6[_0xb70d('0x40')]=_0x15ce73;return _0x14c6c6;})['then'](respondWithFilteredResult(_0x1861ec,_0x3ffdeb))[_0xb70d('0x41')](handleError(_0x1861ec,null));};exports[_0xb70d('0x42')]=function(_0x40fbb5,_0x753a66){var _0x3c92d4={'raw':![],'where':{'id':_0x40fbb5[_0xb70d('0x43')]['id']}},_0x471277={};_0x471277['model']=_[_0xb70d('0x44')](db['Dynamics365Configuration'][_0xb70d('0x29')]);_0x471277[_0xb70d('0x2d')]=_['keys'](_0x40fbb5['query']);_0x471277['filters']=_[_0xb70d('0x2f')](_0x471277[_0xb70d('0x2b')],_0x471277[_0xb70d('0x2d')]);_0x3c92d4['attributes']=_[_0xb70d('0x2f')](_0x471277[_0xb70d('0x2b')],qs['fields'](_0x40fbb5['query'][_0xb70d('0x31')]));_0x3c92d4[_0xb70d('0x30')]=_0x3c92d4[_0xb70d('0x30')][_0xb70d('0x32')]?_0x3c92d4[_0xb70d('0x30')]:_0x471277['model'];if(_0x40fbb5[_0xb70d('0x2d')][_0xb70d('0x3d')]){_0x3c92d4[_0xb70d('0x3e')]=[{'all':!![]}];}_0x3c92d4=_['merge']({},_0x3c92d4,_0x40fbb5[_0xb70d('0x45')]);return db[_0xb70d('0x28')][_0xb70d('0x46')](_0x3c92d4)[_0xb70d('0x24')](handleEntityNotFound(_0x753a66,null))[_0xb70d('0x24')](respondWithResult(_0x753a66,null))[_0xb70d('0x41')](handleError(_0x753a66,null));};exports['create']=function(_0xc42b82,_0x3ab11a){return db['Dynamics365Configuration'][_0xb70d('0x47')](_0xc42b82[_0xb70d('0x48')],{})[_0xb70d('0x24')](respondWithResult(_0x3ab11a,0xc9))[_0xb70d('0x41')](handleError(_0x3ab11a,null));};exports['update']=function(_0xe13527,_0x110682){if(_0xe13527['body']['id']){delete _0xe13527['body']['id'];}return db[_0xb70d('0x28')][_0xb70d('0x46')]({'where':{'id':_0xe13527[_0xb70d('0x43')]['id']}})['then'](handleEntityNotFound(_0x110682,null))[_0xb70d('0x24')](saveUpdates(_0xe13527[_0xb70d('0x48')],null))['then'](respondWithResult(_0x110682,null))[_0xb70d('0x41')](handleError(_0x110682,null));};exports['destroy']=function(_0x3d51a3,_0x5f2543){return db['Dynamics365Configuration'][_0xb70d('0x46')]({'where':{'id':_0x3d51a3[_0xb70d('0x43')]['id']}})[_0xb70d('0x24')](handleEntityNotFound(_0x5f2543,null))[_0xb70d('0x24')](removeEntity(_0x5f2543,null))[_0xb70d('0x41')](handleError(_0x5f2543,null));};exports[_0xb70d('0x49')]=function(_0x26265c,_0x245954,_0x550dd1){var _0xe316d8={};var _0x55b4a6={};var _0x552b02;var _0x34009d;return db[_0xb70d('0x28')][_0xb70d('0x4a')]({'where':{'id':_0x26265c[_0xb70d('0x43')]['id']}})[_0xb70d('0x24')](handleEntityNotFound(_0x245954,null))[_0xb70d('0x24')](function(_0x4a9d70){if(_0x4a9d70){_0x552b02=_0x4a9d70;_0x55b4a6[_0xb70d('0x2b')]=_[_0xb70d('0x44')](db[_0xb70d('0x4b')][_0xb70d('0x29')]);_0x55b4a6[_0xb70d('0x2d')]=_['keys'](_0x26265c[_0xb70d('0x2d')]);_0x55b4a6[_0xb70d('0x2e')]=_[_0xb70d('0x2f')](_0x55b4a6[_0xb70d('0x2b')],_0x55b4a6[_0xb70d('0x2d')]);_0xe316d8[_0xb70d('0x30')]=_[_0xb70d('0x2f')](_0x55b4a6[_0xb70d('0x2b')],qs[_0xb70d('0x31')](_0x26265c[_0xb70d('0x2d')]['fields']));_0xe316d8[_0xb70d('0x30')]=_0xe316d8['attributes'][_0xb70d('0x32')]?_0xe316d8[_0xb70d('0x30')]:_0x55b4a6[_0xb70d('0x2b')];_0xe316d8[_0xb70d('0x35')]=qs[_0xb70d('0x36')](_0x26265c[_0xb70d('0x2d')][_0xb70d('0x36')]);_0xe316d8[_0xb70d('0x37')]=qs[_0xb70d('0x2e')](_[_0xb70d('0x38')](_0x26265c[_0xb70d('0x2d')],_0x55b4a6[_0xb70d('0x2e')]));if(_0x26265c[_0xb70d('0x2d')][_0xb70d('0x3b')]){_0xe316d8[_0xb70d('0x37')]=_[_0xb70d('0x39')](_0xe316d8[_0xb70d('0x37')],{'$or':_[_0xb70d('0x2c')](_0xe316d8[_0xb70d('0x30')],function(_0x267798){var _0x204a65={};_0x204a65[_0x267798]={'$like':'%'+_0x26265c[_0xb70d('0x2d')]['filter']+'%'};return _0x204a65;})});}_0xe316d8=_['merge']({},_0xe316d8,_0x26265c[_0xb70d('0x45')]);return _0x552b02[_0xb70d('0x49')](_0xe316d8);}})['then'](function(_0x5ce9cb){if(_0x5ce9cb){_0x34009d=_0x5ce9cb['length'];if(!_0x26265c['query']['hasOwnProperty'](_0xb70d('0x34'))){_0xe316d8[_0xb70d('0x1d')]=qs[_0xb70d('0x1d')](_0x26265c[_0xb70d('0x2d')]['limit']);_0xe316d8[_0xb70d('0x1b')]=qs['offset'](_0x26265c['query'][_0xb70d('0x1b')]);}return _0x552b02[_0xb70d('0x49')](_0xe316d8);}})[_0xb70d('0x24')](function(_0x3267ec){if(_0x3267ec){return _0x3267ec?{'count':_0x34009d,'rows':_0x3267ec}:null;}})[_0xb70d('0x24')](respondWithResult(_0x245954,null))[_0xb70d('0x41')](handleError(_0x245954,null));};exports[_0xb70d('0x4c')]=function(_0x4f9b16,_0x4fce41,_0x5dad59){var _0x583330={};var _0x439b1d={};var _0x363e85;var _0x3120a2;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4f9b16['params']['id']}})['then'](handleEntityNotFound(_0x4fce41,null))['then'](function(_0x273f73){if(_0x273f73){_0x363e85=_0x273f73;_0x439b1d[_0xb70d('0x2b')]=_[_0xb70d('0x44')](db[_0xb70d('0x4b')][_0xb70d('0x29')]);_0x439b1d[_0xb70d('0x2d')]=_[_0xb70d('0x44')](_0x4f9b16[_0xb70d('0x2d')]);_0x439b1d['filters']=_[_0xb70d('0x2f')](_0x439b1d[_0xb70d('0x2b')],_0x439b1d[_0xb70d('0x2d')]);_0x583330[_0xb70d('0x30')]=_[_0xb70d('0x2f')](_0x439b1d[_0xb70d('0x2b')],qs['fields'](_0x4f9b16[_0xb70d('0x2d')][_0xb70d('0x31')]));_0x583330[_0xb70d('0x30')]=_0x583330['attributes']['length']?_0x583330['attributes']:_0x439b1d[_0xb70d('0x2b')];_0x583330['order']=qs['sort'](_0x4f9b16['query'][_0xb70d('0x36')]);_0x583330[_0xb70d('0x37')]=qs[_0xb70d('0x2e')](_['pick'](_0x4f9b16[_0xb70d('0x2d')],_0x439b1d[_0xb70d('0x2e')]));if(_0x4f9b16[_0xb70d('0x2d')][_0xb70d('0x3b')]){_0x583330[_0xb70d('0x37')]=_['merge'](_0x583330[_0xb70d('0x37')],{'$or':_[_0xb70d('0x2c')](_0x583330[_0xb70d('0x30')],function(_0x3e5c34){var _0xc6a7c6={};_0xc6a7c6[_0x3e5c34]={'$like':'%'+_0x4f9b16['query'][_0xb70d('0x3b')]+'%'};return _0xc6a7c6;})});}_0x583330=_[_0xb70d('0x39')]({},_0x583330,_0x4f9b16[_0xb70d('0x45')]);return _0x363e85['getSubjects'](_0x583330);}})[_0xb70d('0x24')](function(_0x527776){if(_0x527776){_0x3120a2=_0x527776[_0xb70d('0x32')];if(!_0x4f9b16[_0xb70d('0x2d')][_0xb70d('0x33')](_0xb70d('0x34'))){_0x583330[_0xb70d('0x1d')]=qs[_0xb70d('0x1d')](_0x4f9b16[_0xb70d('0x2d')][_0xb70d('0x1d')]);_0x583330[_0xb70d('0x1b')]=qs[_0xb70d('0x1b')](_0x4f9b16[_0xb70d('0x2d')]['offset']);}return _0x363e85[_0xb70d('0x4c')](_0x583330);}})[_0xb70d('0x24')](function(_0x474fb0){if(_0x474fb0){return _0x474fb0?{'count':_0x3120a2,'rows':_0x474fb0}:null;}})[_0xb70d('0x24')](respondWithResult(_0x4fce41,null))[_0xb70d('0x41')](handleError(_0x4fce41,null));};exports[_0xb70d('0x4d')]=function(_0x4fd039,_0x17b850,_0x277725){var _0x24951b={};var _0x25b194={};var _0x30486a;var _0x275791;return db[_0xb70d('0x28')]['findOne']({'where':{'id':_0x4fd039[_0xb70d('0x43')]['id']}})[_0xb70d('0x24')](handleEntityNotFound(_0x17b850,null))['then'](function(_0x4bb51e){if(_0x4bb51e){_0x30486a=_0x4bb51e;_0x25b194[_0xb70d('0x2b')]=_['keys'](db[_0xb70d('0x4b')]['rawAttributes']);_0x25b194[_0xb70d('0x2d')]=_[_0xb70d('0x44')](_0x4fd039[_0xb70d('0x2d')]);_0x25b194[_0xb70d('0x2e')]=_[_0xb70d('0x2f')](_0x25b194[_0xb70d('0x2b')],_0x25b194['query']);_0x24951b[_0xb70d('0x30')]=_[_0xb70d('0x2f')](_0x25b194[_0xb70d('0x2b')],qs[_0xb70d('0x31')](_0x4fd039['query'][_0xb70d('0x31')]));_0x24951b[_0xb70d('0x30')]=_0x24951b[_0xb70d('0x30')][_0xb70d('0x32')]?_0x24951b[_0xb70d('0x30')]:_0x25b194['model'];_0x24951b[_0xb70d('0x35')]=qs[_0xb70d('0x36')](_0x4fd039[_0xb70d('0x2d')][_0xb70d('0x36')]);_0x24951b[_0xb70d('0x37')]=qs['filters'](_[_0xb70d('0x38')](_0x4fd039['query'],_0x25b194[_0xb70d('0x2e')]));if(_0x4fd039[_0xb70d('0x2d')][_0xb70d('0x3b')]){_0x24951b[_0xb70d('0x37')]=_[_0xb70d('0x39')](_0x24951b[_0xb70d('0x37')],{'$or':_[_0xb70d('0x2c')](_0x24951b['attributes'],function(_0x1cac69){var _0x56d0fc={};_0x56d0fc[_0x1cac69]={'$like':'%'+_0x4fd039[_0xb70d('0x2d')][_0xb70d('0x3b')]+'%'};return _0x56d0fc;})});}_0x24951b=_[_0xb70d('0x39')]({},_0x24951b,_0x4fd039[_0xb70d('0x45')]);return _0x30486a[_0xb70d('0x4d')](_0x24951b);}})[_0xb70d('0x24')](function(_0x317983){if(_0x317983){_0x275791=_0x317983[_0xb70d('0x32')];if(!_0x4fd039['query']['hasOwnProperty'](_0xb70d('0x34'))){_0x24951b[_0xb70d('0x1d')]=qs[_0xb70d('0x1d')](_0x4fd039['query'][_0xb70d('0x1d')]);_0x24951b[_0xb70d('0x1b')]=qs['offset'](_0x4fd039['query'][_0xb70d('0x1b')]);}return _0x30486a['getDescriptions'](_0x24951b);}})['then'](function(_0xf164d4){if(_0xf164d4){return _0xf164d4?{'count':_0x275791,'rows':_0xf164d4}:null;}})['then'](respondWithResult(_0x17b850,null))['catch'](handleError(_0x17b850,null));}; \ No newline at end of file +var _0x1831=['map','Dynamics365Configuration','rawAttributes','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','fields','options','catch','create','body','find','params','destroy','getFields','Dynamics365Field','nolimit','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1831,0x15d));var _0x1183=function(_0x12c610,_0x5d840d){_0x12c610=_0x12c610-0x0;var _0x3dc802=_0x1831[_0x12c610];return _0x3dc802;};'use strict';var emlformat=require(_0x1183('0x0'));var rimraf=require(_0x1183('0x1'));var zipdir=require(_0x1183('0x2'));var jsonpatch=require(_0x1183('0x3'));var rp=require('request-promise');var moment=require(_0x1183('0x4'));var BPromise=require(_0x1183('0x5'));var Mustache=require(_0x1183('0x6'));var util=require(_0x1183('0x7'));var path=require(_0x1183('0x8'));var sox=require(_0x1183('0x9'));var csv=require('to-csv');var ejs=require(_0x1183('0xa'));var fs=require('fs');var fs_extra=require(_0x1183('0xb'));var _=require('lodash');var squel=require(_0x1183('0xc'));var crypto=require('crypto');var jsforce=require(_0x1183('0xd'));var deskjs=require(_0x1183('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1183('0xf'));var Papa=require(_0x1183('0x10'));var Redis=require(_0x1183('0x11'));var authService=require(_0x1183('0x12'));var qs=require(_0x1183('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1183('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1183('0x15'));var licenseUtil=require(_0x1183('0x16'));var db=require(_0x1183('0x17'))['db'];function respondWithStatusCode(_0x13f241,_0x49fe9a){_0x49fe9a=_0x49fe9a||0xcc;return function(_0x1ba382){if(_0x1ba382){return _0x13f241[_0x1183('0x18')](_0x49fe9a);}return _0x13f241[_0x1183('0x19')](_0x49fe9a)[_0x1183('0x1a')]();};}function respondWithResult(_0x544e6d,_0x2cbcbe){_0x2cbcbe=_0x2cbcbe||0xc8;return function(_0x5cfd87){if(_0x5cfd87){return _0x544e6d['status'](_0x2cbcbe)[_0x1183('0x1b')](_0x5cfd87);}};}function respondWithFilteredResult(_0x2c83b5,_0x252eb4){return function(_0x377452){if(_0x377452){var _0x992e43=typeof _0x252eb4['offset']===_0x1183('0x1c')&&typeof _0x252eb4[_0x1183('0x1d')]===_0x1183('0x1c');var _0x7ee8fc=_0x377452[_0x1183('0x1e')];var _0x42ab68=_0x992e43?0x0:_0x252eb4[_0x1183('0x1f')];var _0x4e26e6=_0x992e43?_0x377452[_0x1183('0x1e')]:_0x252eb4['offset']+_0x252eb4[_0x1183('0x1d')];var _0x24f9d8;if(_0x4e26e6>=_0x7ee8fc){_0x4e26e6=_0x7ee8fc;_0x24f9d8=0xc8;}else{_0x24f9d8=0xce;}_0x2c83b5[_0x1183('0x19')](_0x24f9d8);return _0x2c83b5[_0x1183('0x20')](_0x1183('0x21'),_0x42ab68+'-'+_0x4e26e6+'/'+_0x7ee8fc)[_0x1183('0x1b')](_0x377452);}return null;};}function patchUpdates(_0x335fe2){return function(_0x39dd69){try{jsonpatch[_0x1183('0x22')](_0x39dd69,_0x335fe2,!![]);}catch(_0xdbeec6){return BPromise[_0x1183('0x23')](_0xdbeec6);}return _0x39dd69[_0x1183('0x24')]();};}function saveUpdates(_0x5ec8ac,_0x463587){return function(_0x11c5d4){if(_0x11c5d4){return _0x11c5d4[_0x1183('0x25')](_0x5ec8ac)[_0x1183('0x26')](function(_0x2706e1){return _0x2706e1;});}return null;};}function removeEntity(_0x30e462,_0x76149){return function(_0x4154c4){if(_0x4154c4){return _0x4154c4['destroy']()[_0x1183('0x26')](function(){_0x30e462[_0x1183('0x19')](0xcc)[_0x1183('0x1a')]();});}};}function handleEntityNotFound(_0x378538,_0x226129){return function(_0x23c11b){if(!_0x23c11b){_0x378538[_0x1183('0x18')](0x194);}return _0x23c11b;};}function handleError(_0x327b2b,_0x16cbe1){_0x16cbe1=_0x16cbe1||0x1f4;return function(_0x4ca624){logger['error'](_0x4ca624[_0x1183('0x27')]);if(_0x4ca624[_0x1183('0x28')]){delete _0x4ca624['name'];}_0x327b2b[_0x1183('0x19')](_0x16cbe1)['send'](_0x4ca624);};}exports['index']=function(_0x14f832,_0x1b254a){var _0x5908e7={},_0x1fca91={},_0x5a0fd7={'count':0x0,'rows':[]};var _0x4f4f57=_[_0x1183('0x29')](db[_0x1183('0x2a')][_0x1183('0x2b')],function(_0x4e1a7d){return{'name':_0x4e1a7d['fieldName'],'type':_0x4e1a7d[_0x1183('0x2c')]['key']};});_0x1fca91[_0x1183('0x2d')]=_[_0x1183('0x29')](_0x4f4f57,_0x1183('0x28'));_0x1fca91[_0x1183('0x2e')]=_[_0x1183('0x2f')](_0x14f832[_0x1183('0x2e')]);_0x1fca91[_0x1183('0x30')]=_['intersection'](_0x1fca91['model'],_0x1fca91[_0x1183('0x2e')]);_0x5908e7[_0x1183('0x31')]=_[_0x1183('0x32')](_0x1fca91[_0x1183('0x2d')],qs['fields'](_0x14f832[_0x1183('0x2e')]['fields']));_0x5908e7[_0x1183('0x31')]=_0x5908e7[_0x1183('0x31')][_0x1183('0x33')]?_0x5908e7['attributes']:_0x1fca91[_0x1183('0x2d')];if(!_0x14f832['query'][_0x1183('0x34')]('nolimit')){_0x5908e7[_0x1183('0x1d')]=qs[_0x1183('0x1d')](_0x14f832[_0x1183('0x2e')]['limit']);_0x5908e7[_0x1183('0x1f')]=qs[_0x1183('0x1f')](_0x14f832[_0x1183('0x2e')][_0x1183('0x1f')]);}_0x5908e7[_0x1183('0x35')]=qs['sort'](_0x14f832[_0x1183('0x2e')][_0x1183('0x36')]);_0x5908e7[_0x1183('0x37')]=qs[_0x1183('0x30')](_[_0x1183('0x38')](_0x14f832[_0x1183('0x2e')],_0x1fca91[_0x1183('0x30')]),_0x4f4f57);if(_0x14f832[_0x1183('0x2e')][_0x1183('0x39')]){_0x5908e7[_0x1183('0x37')]=_[_0x1183('0x3a')](_0x5908e7[_0x1183('0x37')],{'$or':_[_0x1183('0x29')](_0x4f4f57,function(_0x4ef2f2){if(_0x4ef2f2[_0x1183('0x2c')]!==_0x1183('0x3b')){var _0xecc101={};_0xecc101[_0x4ef2f2['name']]={'$like':'%'+_0x14f832['query'][_0x1183('0x39')]+'%'};return _0xecc101;}})});}_0x5908e7=_['merge']({},_0x5908e7,_0x14f832['options']);var _0x430095={'where':_0x5908e7[_0x1183('0x37')]};return db[_0x1183('0x2a')]['count'](_0x430095)[_0x1183('0x26')](function(_0x557edf){_0x5a0fd7[_0x1183('0x1e')]=_0x557edf;if(_0x14f832[_0x1183('0x2e')][_0x1183('0x3c')]){_0x5908e7[_0x1183('0x3d')]=[{'all':!![]}];}return db[_0x1183('0x2a')]['findAll'](_0x5908e7);})['then'](function(_0x148980){_0x5a0fd7[_0x1183('0x3e')]=_0x148980;return _0x5a0fd7;})[_0x1183('0x26')](respondWithFilteredResult(_0x1b254a,_0x5908e7))['catch'](handleError(_0x1b254a,null));};exports[_0x1183('0x3f')]=function(_0x445411,_0x21ac8c){var _0x57fd45={'raw':![],'where':{'id':_0x445411['params']['id']}},_0x3c95b5={};_0x3c95b5[_0x1183('0x2d')]=_[_0x1183('0x2f')](db[_0x1183('0x2a')][_0x1183('0x2b')]);_0x3c95b5[_0x1183('0x2e')]=_[_0x1183('0x2f')](_0x445411[_0x1183('0x2e')]);_0x3c95b5[_0x1183('0x30')]=_[_0x1183('0x32')](_0x3c95b5[_0x1183('0x2d')],_0x3c95b5['query']);_0x57fd45['attributes']=_[_0x1183('0x32')](_0x3c95b5[_0x1183('0x2d')],qs[_0x1183('0x40')](_0x445411['query']['fields']));_0x57fd45[_0x1183('0x31')]=_0x57fd45[_0x1183('0x31')][_0x1183('0x33')]?_0x57fd45[_0x1183('0x31')]:_0x3c95b5[_0x1183('0x2d')];if(_0x445411[_0x1183('0x2e')][_0x1183('0x3c')]){_0x57fd45[_0x1183('0x3d')]=[{'all':!![]}];}_0x57fd45=_['merge']({},_0x57fd45,_0x445411[_0x1183('0x41')]);return db[_0x1183('0x2a')]['find'](_0x57fd45)['then'](handleEntityNotFound(_0x21ac8c,null))[_0x1183('0x26')](respondWithResult(_0x21ac8c,null))[_0x1183('0x42')](handleError(_0x21ac8c,null));};exports['create']=function(_0x58e856,_0x234034){return db[_0x1183('0x2a')][_0x1183('0x43')](_0x58e856[_0x1183('0x44')],{})[_0x1183('0x26')](respondWithResult(_0x234034,0xc9))['catch'](handleError(_0x234034,null));};exports[_0x1183('0x25')]=function(_0x30f9c8,_0x55720c){if(_0x30f9c8['body']['id']){delete _0x30f9c8[_0x1183('0x44')]['id'];}return db[_0x1183('0x2a')][_0x1183('0x45')]({'where':{'id':_0x30f9c8[_0x1183('0x46')]['id']}})[_0x1183('0x26')](handleEntityNotFound(_0x55720c,null))[_0x1183('0x26')](saveUpdates(_0x30f9c8[_0x1183('0x44')],null))[_0x1183('0x26')](respondWithResult(_0x55720c,null))[_0x1183('0x42')](handleError(_0x55720c,null));};exports[_0x1183('0x47')]=function(_0x3da73b,_0x280c88){return db[_0x1183('0x2a')][_0x1183('0x45')]({'where':{'id':_0x3da73b[_0x1183('0x46')]['id']}})[_0x1183('0x26')](handleEntityNotFound(_0x280c88,null))[_0x1183('0x26')](removeEntity(_0x280c88,null))[_0x1183('0x42')](handleError(_0x280c88,null));};exports[_0x1183('0x48')]=function(_0x2699ae,_0xca25ed,_0x41d845){var _0x51a58b={};var _0xbdd728={};var _0x44a68f;var _0x22e2df;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2699ae[_0x1183('0x46')]['id']}})[_0x1183('0x26')](handleEntityNotFound(_0xca25ed,null))[_0x1183('0x26')](function(_0x4a7221){if(_0x4a7221){_0x44a68f=_0x4a7221;_0xbdd728[_0x1183('0x2d')]=_[_0x1183('0x2f')](db[_0x1183('0x49')][_0x1183('0x2b')]);_0xbdd728[_0x1183('0x2e')]=_[_0x1183('0x2f')](_0x2699ae['query']);_0xbdd728[_0x1183('0x30')]=_['intersection'](_0xbdd728[_0x1183('0x2d')],_0xbdd728['query']);_0x51a58b[_0x1183('0x31')]=_[_0x1183('0x32')](_0xbdd728[_0x1183('0x2d')],qs[_0x1183('0x40')](_0x2699ae['query']['fields']));_0x51a58b[_0x1183('0x31')]=_0x51a58b[_0x1183('0x31')][_0x1183('0x33')]?_0x51a58b['attributes']:_0xbdd728[_0x1183('0x2d')];_0x51a58b[_0x1183('0x35')]=qs[_0x1183('0x36')](_0x2699ae[_0x1183('0x2e')][_0x1183('0x36')]);_0x51a58b[_0x1183('0x37')]=qs[_0x1183('0x30')](_[_0x1183('0x38')](_0x2699ae[_0x1183('0x2e')],_0xbdd728[_0x1183('0x30')]));if(_0x2699ae[_0x1183('0x2e')][_0x1183('0x39')]){_0x51a58b[_0x1183('0x37')]=_[_0x1183('0x3a')](_0x51a58b[_0x1183('0x37')],{'$or':_[_0x1183('0x29')](_0x51a58b['attributes'],function(_0x31d3e1){var _0x48c19d={};_0x48c19d[_0x31d3e1]={'$like':'%'+_0x2699ae['query'][_0x1183('0x39')]+'%'};return _0x48c19d;})});}_0x51a58b=_['merge']({},_0x51a58b,_0x2699ae[_0x1183('0x41')]);return _0x44a68f['getFields'](_0x51a58b);}})[_0x1183('0x26')](function(_0x2d5829){if(_0x2d5829){_0x22e2df=_0x2d5829[_0x1183('0x33')];if(!_0x2699ae[_0x1183('0x2e')]['hasOwnProperty'](_0x1183('0x4a'))){_0x51a58b[_0x1183('0x1d')]=qs[_0x1183('0x1d')](_0x2699ae['query'][_0x1183('0x1d')]);_0x51a58b[_0x1183('0x1f')]=qs[_0x1183('0x1f')](_0x2699ae['query'][_0x1183('0x1f')]);}return _0x44a68f[_0x1183('0x48')](_0x51a58b);}})[_0x1183('0x26')](function(_0x597873){if(_0x597873){return _0x597873?{'count':_0x22e2df,'rows':_0x597873}:null;}})[_0x1183('0x26')](respondWithResult(_0xca25ed,null))[_0x1183('0x42')](handleError(_0xca25ed,null));};exports['getSubjects']=function(_0x402595,_0x4956cd,_0x275e34){var _0x421c41={};var _0x56fad1={};var _0xfa1856;var _0x393d66;return db['Dynamics365Configuration'][_0x1183('0x4b')]({'where':{'id':_0x402595[_0x1183('0x46')]['id']}})[_0x1183('0x26')](handleEntityNotFound(_0x4956cd,null))['then'](function(_0x253685){if(_0x253685){_0xfa1856=_0x253685;_0x56fad1[_0x1183('0x2d')]=_[_0x1183('0x2f')](db['Dynamics365Field'][_0x1183('0x2b')]);_0x56fad1[_0x1183('0x2e')]=_['keys'](_0x402595[_0x1183('0x2e')]);_0x56fad1[_0x1183('0x30')]=_['intersection'](_0x56fad1['model'],_0x56fad1['query']);_0x421c41[_0x1183('0x31')]=_['intersection'](_0x56fad1[_0x1183('0x2d')],qs[_0x1183('0x40')](_0x402595[_0x1183('0x2e')][_0x1183('0x40')]));_0x421c41['attributes']=_0x421c41[_0x1183('0x31')][_0x1183('0x33')]?_0x421c41[_0x1183('0x31')]:_0x56fad1[_0x1183('0x2d')];_0x421c41[_0x1183('0x35')]=qs['sort'](_0x402595[_0x1183('0x2e')][_0x1183('0x36')]);_0x421c41[_0x1183('0x37')]=qs['filters'](_[_0x1183('0x38')](_0x402595[_0x1183('0x2e')],_0x56fad1['filters']));if(_0x402595[_0x1183('0x2e')][_0x1183('0x39')]){_0x421c41[_0x1183('0x37')]=_['merge'](_0x421c41[_0x1183('0x37')],{'$or':_['map'](_0x421c41[_0x1183('0x31')],function(_0x432b55){var _0x1c05ec={};_0x1c05ec[_0x432b55]={'$like':'%'+_0x402595[_0x1183('0x2e')]['filter']+'%'};return _0x1c05ec;})});}_0x421c41=_[_0x1183('0x3a')]({},_0x421c41,_0x402595[_0x1183('0x41')]);return _0xfa1856[_0x1183('0x4c')](_0x421c41);}})[_0x1183('0x26')](function(_0x470bd1){if(_0x470bd1){_0x393d66=_0x470bd1['length'];if(!_0x402595[_0x1183('0x2e')][_0x1183('0x34')](_0x1183('0x4a'))){_0x421c41[_0x1183('0x1d')]=qs[_0x1183('0x1d')](_0x402595[_0x1183('0x2e')]['limit']);_0x421c41[_0x1183('0x1f')]=qs['offset'](_0x402595[_0x1183('0x2e')][_0x1183('0x1f')]);}return _0xfa1856[_0x1183('0x4c')](_0x421c41);}})[_0x1183('0x26')](function(_0x49993f){if(_0x49993f){return _0x49993f?{'count':_0x393d66,'rows':_0x49993f}:null;}})[_0x1183('0x26')](respondWithResult(_0x4956cd,null))[_0x1183('0x42')](handleError(_0x4956cd,null));};exports[_0x1183('0x4d')]=function(_0x2650f2,_0x4dfba2,_0xf2d798){var _0x36f25a={};var _0x2a2e25={};var _0x378e69;var _0x3fc75d;return db[_0x1183('0x2a')][_0x1183('0x4b')]({'where':{'id':_0x2650f2[_0x1183('0x46')]['id']}})[_0x1183('0x26')](handleEntityNotFound(_0x4dfba2,null))[_0x1183('0x26')](function(_0x27a919){if(_0x27a919){_0x378e69=_0x27a919;_0x2a2e25[_0x1183('0x2d')]=_[_0x1183('0x2f')](db[_0x1183('0x49')][_0x1183('0x2b')]);_0x2a2e25['query']=_[_0x1183('0x2f')](_0x2650f2[_0x1183('0x2e')]);_0x2a2e25[_0x1183('0x30')]=_[_0x1183('0x32')](_0x2a2e25[_0x1183('0x2d')],_0x2a2e25[_0x1183('0x2e')]);_0x36f25a[_0x1183('0x31')]=_[_0x1183('0x32')](_0x2a2e25[_0x1183('0x2d')],qs[_0x1183('0x40')](_0x2650f2['query'][_0x1183('0x40')]));_0x36f25a[_0x1183('0x31')]=_0x36f25a['attributes'][_0x1183('0x33')]?_0x36f25a[_0x1183('0x31')]:_0x2a2e25[_0x1183('0x2d')];_0x36f25a[_0x1183('0x35')]=qs[_0x1183('0x36')](_0x2650f2['query'][_0x1183('0x36')]);_0x36f25a[_0x1183('0x37')]=qs[_0x1183('0x30')](_['pick'](_0x2650f2[_0x1183('0x2e')],_0x2a2e25[_0x1183('0x30')]));if(_0x2650f2['query'][_0x1183('0x39')]){_0x36f25a[_0x1183('0x37')]=_['merge'](_0x36f25a[_0x1183('0x37')],{'$or':_[_0x1183('0x29')](_0x36f25a[_0x1183('0x31')],function(_0x38abc2){var _0x20a97a={};_0x20a97a[_0x38abc2]={'$like':'%'+_0x2650f2['query'][_0x1183('0x39')]+'%'};return _0x20a97a;})});}_0x36f25a=_[_0x1183('0x3a')]({},_0x36f25a,_0x2650f2[_0x1183('0x41')]);return _0x378e69['getDescriptions'](_0x36f25a);}})[_0x1183('0x26')](function(_0xea3de3){if(_0xea3de3){_0x3fc75d=_0xea3de3['length'];if(!_0x2650f2[_0x1183('0x2e')]['hasOwnProperty'](_0x1183('0x4a'))){_0x36f25a['limit']=qs[_0x1183('0x1d')](_0x2650f2[_0x1183('0x2e')][_0x1183('0x1d')]);_0x36f25a[_0x1183('0x1f')]=qs[_0x1183('0x1f')](_0x2650f2[_0x1183('0x2e')][_0x1183('0x1f')]);}return _0x378e69['getDescriptions'](_0x36f25a);}})[_0x1183('0x26')](function(_0x1c784e){if(_0x1c784e){return _0x1c784e?{'count':_0x3fc75d,'rows':_0x1c784e}:null;}})[_0x1183('0x26')](respondWithResult(_0x4dfba2,null))[_0x1183('0x42')](handleError(_0x4dfba2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 82af8b6..8d180e3 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x3196fb,_0x5dc03b){var _0x19c0b4=function(_0x44814a){while(--_0x44814a){_0x3196fb['push'](_0x3196fb['shift']());}};_0x19c0b4(++_0x5dc03b);}(_0xa41a,0x6b));var _0xaa41=function(_0x5a88b1,_0x501071){_0x5a88b1=_0x5a88b1-0x0;var _0x1f8615=_0xa41a[_0x5a88b1];return _0x1f8615;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration'];(function(_0x53bc5d,_0xc30092){var _0x179687=function(_0x1f9121){while(--_0x1f9121){_0x53bc5d['push'](_0x53bc5d['shift']());}};_0x179687(++_0xc30092);}(_0x34e8,0x12c));var _0x834e=function(_0x4f480c,_0x1407fc){_0x4f480c=_0x4f480c-0x0;var _0x322d50=_0x34e8[_0x4f480c];return _0x322d50;};'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/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index c18be64..86b2504 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 _0x2895=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x412342,_0x180734){var _0x3e62cb=function(_0x501fc6){while(--_0x501fc6){_0x412342['push'](_0x412342['shift']());}};_0x3e62cb(++_0x180734);}(_0x2895,0x16d));var _0x5289=function(_0x4b12a3,_0x2c842a){_0x4b12a3=_0x4b12a3-0x0;var _0xd1c2c4=_0x2895[_0x4b12a3];return _0xd1c2c4;};'use strict';var _=require(_0x5289('0x0'));var util=require(_0x5289('0x1'));var moment=require(_0x5289('0x2'));var BPromise=require(_0x5289('0x3'));var rs=require(_0x5289('0x4'));var fs=require('fs');var Redis=require(_0x5289('0x5'));var db=require(_0x5289('0x6'))['db'];var utils=require(_0x5289('0x7'));var logger=require(_0x5289('0x8'))(_0x5289('0x9'));var config=require('../../config/environment');var jayson=require(_0x5289('0xa'));var client=jayson[_0x5289('0xb')][_0x5289('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x209ded,_0x61b10d,_0x4452e4){return new BPromise(function(_0x2c5b9d,_0x1ec24e){return client[_0x5289('0xd')](_0x209ded,_0x4452e4)['then'](function(_0x1b0506){logger[_0x5289('0xe')](_0x5289('0xf'),_0x61b10d,_0x5289('0x10'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x61b10d,_0x5289('0x10'),JSON[_0x5289('0x11')](_0x1b0506));if(_0x1b0506[_0x5289('0x12')]){if(_0x1b0506[_0x5289('0x12')][_0x5289('0x13')]===0x1f4){logger[_0x5289('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x61b10d,_0x1b0506[_0x5289('0x12')][_0x5289('0x14')]);return _0x1ec24e(_0x1b0506['error'][_0x5289('0x14')]);}logger[_0x5289('0x12')](_0x5289('0xf'),_0x61b10d,_0x1b0506[_0x5289('0x12')][_0x5289('0x14')]);return _0x2c5b9d(_0x1b0506[_0x5289('0x12')][_0x5289('0x14')]);}else{logger[_0x5289('0xe')](_0x5289('0xf'),_0x61b10d,_0x5289('0x10'));_0x2c5b9d(_0x1b0506[_0x5289('0x15')][_0x5289('0x14')]);}})[_0x5289('0x16')](function(_0x162467){logger[_0x5289('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x61b10d,_0x162467);_0x1ec24e(_0x162467);});});} \ No newline at end of file +var _0xff9f=['request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xff9f,0x10f));var _0xfff9=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xff9f[_0x259d17];return _0x407535;};'use strict';var _=require('lodash');var util=require(_0xfff9('0x0'));var moment=require(_0xfff9('0x1'));var BPromise=require(_0xfff9('0x2'));var rs=require(_0xfff9('0x3'));var fs=require('fs');var Redis=require(_0xfff9('0x4'));var db=require(_0xfff9('0x5'))['db'];var utils=require(_0xfff9('0x6'));var logger=require(_0xfff9('0x7'))(_0xfff9('0x8'));var config=require('../../config/environment');var jayson=require(_0xfff9('0x9'));var client=jayson[_0xfff9('0xa')][_0xfff9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5365c1,_0x47fc5d,_0x5ab1c8){return new BPromise(function(_0x5c1db4,_0x255882){return client['request'](_0x5365c1,_0x5ab1c8)[_0xfff9('0xc')](function(_0x3c6210){logger[_0xfff9('0xd')](_0xfff9('0xe'),_0x47fc5d,_0xfff9('0xf'));logger['debug'](_0xfff9('0x10'),_0x47fc5d,_0xfff9('0xf'),JSON[_0xfff9('0x11')](_0x3c6210));if(_0x3c6210['error']){if(_0x3c6210[_0xfff9('0x12')]['code']===0x1f4){logger[_0xfff9('0x12')](_0xfff9('0xe'),_0x47fc5d,_0x3c6210[_0xfff9('0x12')]['message']);return _0x255882(_0x3c6210[_0xfff9('0x12')][_0xfff9('0x13')]);}logger[_0xfff9('0x12')](_0xfff9('0xe'),_0x47fc5d,_0x3c6210[_0xfff9('0x12')][_0xfff9('0x13')]);return _0x5c1db4(_0x3c6210[_0xfff9('0x12')]['message']);}else{logger[_0xfff9('0xd')](_0xfff9('0xe'),_0x47fc5d,_0xfff9('0xf'));_0x5c1db4(_0x3c6210[_0xfff9('0x14')][_0xfff9('0x13')]);}})[_0xfff9('0x15')](function(_0x4cceaa){logger[_0xfff9('0x12')](_0xfff9('0xe'),_0x47fc5d,_0x4cceaa);_0x255882(_0x4cceaa);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 96b3d37..2ec496f 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 _0x98e7=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','multer'];(function(_0x52ea1f,_0x1a37da){var _0x1bc5c7=function(_0x4ba7d3){while(--_0x4ba7d3){_0x52ea1f['push'](_0x52ea1f['shift']());}};_0x1bc5c7(++_0x1a37da);}(_0x98e7,0xd0));var _0x798e=function(_0x27c48a,_0x130c3e){_0x27c48a=_0x27c48a-0x0;var _0x146018=_0x98e7[_0x27c48a];return _0x146018;};'use strict';var multer=require(_0x798e('0x0'));var util=require(_0x798e('0x1'));var path=require(_0x798e('0x2'));var timeout=require('connect-timeout');var express=require(_0x798e('0x3'));var router=express[_0x798e('0x4')]();var fs_extra=require(_0x798e('0x5'));var auth=require(_0x798e('0x6'));var interaction=require(_0x798e('0x7'));var config=require(_0x798e('0x8'));var controller=require(_0x798e('0x9'));router[_0x798e('0xa')]('/',auth[_0x798e('0xb')](),controller[_0x798e('0xc')]);router[_0x798e('0xa')](_0x798e('0xd'),auth[_0x798e('0xb')](),controller[_0x798e('0xe')]);router[_0x798e('0xf')]('/',auth[_0x798e('0xb')](),controller[_0x798e('0x10')]);router['put']('/:id',auth[_0x798e('0xb')](),controller['update']);router[_0x798e('0x11')]('/:id',auth[_0x798e('0xb')](),controller[_0x798e('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd3b7=['fs-extra','../../config/environment','get','isAuthenticated','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','Router'];(function(_0x508d1,_0xc0c0e5){var _0x322d8d=function(_0x51b75f){while(--_0x51b75f){_0x508d1['push'](_0x508d1['shift']());}};_0x322d8d(++_0xc0c0e5);}(_0xd3b7,0xa0));var _0x7d3b=function(_0x420d36,_0x260b68){_0x420d36=_0x420d36-0x0;var _0x277bcf=_0xd3b7[_0x420d36];return _0x277bcf;};'use strict';var multer=require(_0x7d3b('0x0'));var util=require(_0x7d3b('0x1'));var path=require(_0x7d3b('0x2'));var timeout=require(_0x7d3b('0x3'));var express=require('express');var router=express[_0x7d3b('0x4')]();var fs_extra=require(_0x7d3b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7d3b('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x7d3b('0x7')]('/',auth[_0x7d3b('0x8')](),controller['index']);router[_0x7d3b('0x7')]('/:id',auth[_0x7d3b('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7d3b('0x9')]);router[_0x7d3b('0xa')]('/:id',auth[_0x7d3b('0x8')](),controller[_0x7d3b('0xb')]);router[_0x7d3b('0xc')](_0x7d3b('0xd'),auth[_0x7d3b('0x8')](),controller[_0x7d3b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index ad356b3..7a4ddb4 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 _0x3b69=['keyValue','picklist','STRING','exports','ENUM','string','variable','customVariable'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x3b69,0xe3));var _0x93b6=function(_0x4395dc,_0x3fa800){_0x4395dc=_0x4395dc-0x0;var _0x3053d6=_0x3b69[_0x4395dc];return _0x3053d6;};'use strict';var Sequelize=require('sequelize');module[_0x93b6('0x0')]={'type':{'type':Sequelize[_0x93b6('0x1')](_0x93b6('0x2'),_0x93b6('0x3'),_0x93b6('0x4'),_0x93b6('0x5'),_0x93b6('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x93b6('0x7')]},'keyType':{'type':Sequelize[_0x93b6('0x1')]('string',_0x93b6('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93b6('0x7')]}}; \ No newline at end of file +var _0x8424=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','picklist'];(function(_0x53056c,_0x1d56a9){var _0x5cec88=function(_0x2ad06b){while(--_0x2ad06b){_0x53056c['push'](_0x53056c['shift']());}};_0x5cec88(++_0x1d56a9);}(_0x8424,0xab));var _0x4842=function(_0x5a14bd,_0x1c9647){_0x5a14bd=_0x5a14bd-0x0;var _0x27a13c=_0x8424[_0x5a14bd];return _0x27a13c;};'use strict';var Sequelize=require('sequelize');module[_0x4842('0x0')]={'type':{'type':Sequelize[_0x4842('0x1')](_0x4842('0x2'),'variable',_0x4842('0x3'),'keyValue',_0x4842('0x4')),'defaultValue':_0x4842('0x2')},'content':{'type':Sequelize[_0x4842('0x5')]},'key':{'type':Sequelize[_0x4842('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4842('0x2'),_0x4842('0x6'),_0x4842('0x3'))},'keyContent':{'type':Sequelize[_0x4842('0x5')]},'idField':{'type':Sequelize[_0x4842('0x5')]},'nameField':{'type':Sequelize[_0x4842('0x5')]},'customField':{'type':Sequelize[_0x4842('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4842('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index a45272a..a55fceb 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 _0x7139=['stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x7139,0xac));var _0x9713=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7139[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9713('0x0'));var zipdir=require(_0x9713('0x1'));var jsonpatch=require(_0x9713('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9713('0x3'));var Mustache=require('mustache');var util=require(_0x9713('0x4'));var path=require(_0x9713('0x5'));var sox=require(_0x9713('0x6'));var csv=require(_0x9713('0x7'));var ejs=require(_0x9713('0x8'));var fs=require('fs');var fs_extra=require(_0x9713('0x9'));var _=require(_0x9713('0xa'));var squel=require('squel');var crypto=require(_0x9713('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9713('0x7'));var querystring=require(_0x9713('0xc'));var Papa=require(_0x9713('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9713('0xe'));var as=require(_0x9713('0xf'));var hardwareService=require(_0x9713('0x10'));var logger=require(_0x9713('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9713('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118538,_0x1f971d){_0x1f971d=_0x1f971d||0xcc;return function(_0x27a044){if(_0x27a044){return _0x118538[_0x9713('0x13')](_0x1f971d);}return _0x118538[_0x9713('0x14')](_0x1f971d)[_0x9713('0x15')]();};}function respondWithResult(_0x5a74f2,_0x321749){_0x321749=_0x321749||0xc8;return function(_0x3b133a){if(_0x3b133a){return _0x5a74f2[_0x9713('0x14')](_0x321749)[_0x9713('0x16')](_0x3b133a);}};}function respondWithFilteredResult(_0x53f84b,_0x50511d){return function(_0x278f11){if(_0x278f11){var _0x2ffce0=typeof _0x50511d[_0x9713('0x17')]==='undefined'&&typeof _0x50511d[_0x9713('0x18')]==='undefined';var _0x57c00f=_0x278f11[_0x9713('0x19')];var _0x4bf75f=_0x2ffce0?0x0:_0x50511d[_0x9713('0x17')];var _0x20b3b7=_0x2ffce0?_0x278f11['count']:_0x50511d[_0x9713('0x17')]+_0x50511d[_0x9713('0x18')];var _0x1868da;if(_0x20b3b7>=_0x57c00f){_0x20b3b7=_0x57c00f;_0x1868da=0xc8;}else{_0x1868da=0xce;}_0x53f84b[_0x9713('0x14')](_0x1868da);return _0x53f84b[_0x9713('0x1a')](_0x9713('0x1b'),_0x4bf75f+'-'+_0x20b3b7+'/'+_0x57c00f)[_0x9713('0x16')](_0x278f11);}return null;};}function patchUpdates(_0x20d04f){return function(_0x59afd2){try{jsonpatch[_0x9713('0x1c')](_0x59afd2,_0x20d04f,!![]);}catch(_0x49da5d){return BPromise[_0x9713('0x1d')](_0x49da5d);}return _0x59afd2[_0x9713('0x1e')]();};}function saveUpdates(_0x3ca768,_0x51a9ba){return function(_0xeb5503){if(_0xeb5503){return _0xeb5503[_0x9713('0x1f')](_0x3ca768)[_0x9713('0x20')](function(_0x308447){return _0x308447;});}return null;};}function removeEntity(_0x5b9d47,_0x2fa66b){return function(_0x28327f){if(_0x28327f){return _0x28327f[_0x9713('0x21')]()['then'](function(){_0x5b9d47[_0x9713('0x14')](0xcc)[_0x9713('0x15')]();});}};}function handleEntityNotFound(_0x1dcf41,_0x35c97c){return function(_0x317af0){if(!_0x317af0){_0x1dcf41[_0x9713('0x13')](0x194);}return _0x317af0;};}function handleError(_0x44fd7f,_0x4160cb){_0x4160cb=_0x4160cb||0x1f4;return function(_0x3961a9){logger[_0x9713('0x22')](_0x3961a9[_0x9713('0x23')]);if(_0x3961a9[_0x9713('0x24')]){delete _0x3961a9['name'];}_0x44fd7f[_0x9713('0x14')](_0x4160cb)[_0x9713('0x25')](_0x3961a9);};}exports[_0x9713('0x26')]=function(_0x2a7482,_0x502f03){var _0x4804af={},_0x2d821e={},_0x411587={'count':0x0,'rows':[]};var _0x9b2172=_[_0x9713('0x27')](db[_0x9713('0x28')][_0x9713('0x29')],function(_0x15bddf){return{'name':_0x15bddf[_0x9713('0x2a')],'type':_0x15bddf['type'][_0x9713('0x2b')]};});_0x2d821e[_0x9713('0x2c')]=_[_0x9713('0x27')](_0x9b2172,_0x9713('0x24'));_0x2d821e['query']=_[_0x9713('0x2d')](_0x2a7482[_0x9713('0x2e')]);_0x2d821e['filters']=_[_0x9713('0x2f')](_0x2d821e['model'],_0x2d821e[_0x9713('0x2e')]);_0x4804af[_0x9713('0x30')]=_[_0x9713('0x2f')](_0x2d821e[_0x9713('0x2c')],qs['fields'](_0x2a7482[_0x9713('0x2e')][_0x9713('0x31')]));_0x4804af[_0x9713('0x30')]=_0x4804af[_0x9713('0x30')][_0x9713('0x32')]?_0x4804af[_0x9713('0x30')]:_0x2d821e[_0x9713('0x2c')];if(!_0x2a7482[_0x9713('0x2e')][_0x9713('0x33')]('nolimit')){_0x4804af[_0x9713('0x18')]=qs['limit'](_0x2a7482[_0x9713('0x2e')][_0x9713('0x18')]);_0x4804af[_0x9713('0x17')]=qs['offset'](_0x2a7482[_0x9713('0x2e')][_0x9713('0x17')]);}_0x4804af[_0x9713('0x34')]=qs[_0x9713('0x35')](_0x2a7482[_0x9713('0x2e')][_0x9713('0x35')]);_0x4804af[_0x9713('0x36')]=qs['filters'](_['pick'](_0x2a7482[_0x9713('0x2e')],_0x2d821e[_0x9713('0x37')]),_0x9b2172);if(_0x2a7482['query'][_0x9713('0x38')]){_0x4804af['where']=_[_0x9713('0x39')](_0x4804af[_0x9713('0x36')],{'$or':_['map'](_0x9b2172,function(_0x4a38b9){if(_0x4a38b9['type']!==_0x9713('0x3a')){var _0x149c2a={};_0x149c2a[_0x4a38b9[_0x9713('0x24')]]={'$like':'%'+_0x2a7482['query'][_0x9713('0x38')]+'%'};return _0x149c2a;}})});}_0x4804af=_['merge']({},_0x4804af,_0x2a7482[_0x9713('0x3b')]);var _0x4c687f={'where':_0x4804af[_0x9713('0x36')]};return db[_0x9713('0x28')][_0x9713('0x19')](_0x4c687f)['then'](function(_0x1cc3c7){_0x411587['count']=_0x1cc3c7;if(_0x2a7482[_0x9713('0x2e')]['includeAll']){_0x4804af[_0x9713('0x3c')]=[{'all':!![]}];}return db[_0x9713('0x28')][_0x9713('0x3d')](_0x4804af);})[_0x9713('0x20')](function(_0x27901b){_0x411587[_0x9713('0x3e')]=_0x27901b;return _0x411587;})[_0x9713('0x20')](respondWithFilteredResult(_0x502f03,_0x4804af))[_0x9713('0x3f')](handleError(_0x502f03,null));};exports[_0x9713('0x40')]=function(_0x516609,_0x54f765){var _0x5307ca={'raw':!![],'where':{'id':_0x516609[_0x9713('0x41')]['id']}},_0xa21a50={};_0xa21a50[_0x9713('0x2c')]=_['keys'](db[_0x9713('0x28')]['rawAttributes']);_0xa21a50['query']=_[_0x9713('0x2d')](_0x516609[_0x9713('0x2e')]);_0xa21a50['filters']=_[_0x9713('0x2f')](_0xa21a50[_0x9713('0x2c')],_0xa21a50['query']);_0x5307ca['attributes']=_[_0x9713('0x2f')](_0xa21a50['model'],qs[_0x9713('0x31')](_0x516609[_0x9713('0x2e')][_0x9713('0x31')]));_0x5307ca[_0x9713('0x30')]=_0x5307ca[_0x9713('0x30')][_0x9713('0x32')]?_0x5307ca[_0x9713('0x30')]:_0xa21a50['model'];if(_0x516609['query']['includeAll']){_0x5307ca['include']=[{'all':!![]}];}_0x5307ca=_['merge']({},_0x5307ca,_0x516609['options']);return db['Dynamics365Field'][_0x9713('0x42')](_0x5307ca)[_0x9713('0x20')](handleEntityNotFound(_0x54f765,null))[_0x9713('0x20')](respondWithResult(_0x54f765,null))['catch'](handleError(_0x54f765,null));};exports[_0x9713('0x43')]=function(_0x308ab1,_0x46a0bf){return db[_0x9713('0x28')][_0x9713('0x43')](_0x308ab1['body'],{})[_0x9713('0x20')](respondWithResult(_0x46a0bf,0xc9))['catch'](handleError(_0x46a0bf,null));};exports[_0x9713('0x1f')]=function(_0x1b5841,_0x22f3ba){if(_0x1b5841[_0x9713('0x44')]['id']){delete _0x1b5841[_0x9713('0x44')]['id'];}return db[_0x9713('0x28')][_0x9713('0x42')]({'where':{'id':_0x1b5841['params']['id']}})[_0x9713('0x20')](handleEntityNotFound(_0x22f3ba,null))[_0x9713('0x20')](saveUpdates(_0x1b5841[_0x9713('0x44')],null))[_0x9713('0x20')](respondWithResult(_0x22f3ba,null))[_0x9713('0x3f')](handleError(_0x22f3ba,null));};exports[_0x9713('0x21')]=function(_0x148bee,_0x35eb03){return db['Dynamics365Field'][_0x9713('0x42')]({'where':{'id':_0x148bee[_0x9713('0x41')]['id']}})[_0x9713('0x20')](handleEntityNotFound(_0x35eb03,null))[_0x9713('0x20')](removeEntity(_0x35eb03,null))['catch'](handleError(_0x35eb03,null));}; \ No newline at end of file +var _0xa804=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','show','merge','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x106f08,_0x51a7d0){var _0x342583=function(_0x16d777){while(--_0x16d777){_0x106f08['push'](_0x106f08['shift']());}};_0x342583(++_0x51a7d0);}(_0xa804,0xd9));var _0x4a80=function(_0x293619,_0x578443){_0x293619=_0x293619-0x0;var _0x1bd724=_0xa804[_0x293619];return _0x1bd724;};'use strict';var emlformat=require(_0x4a80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a80('0x1'));var jsonpatch=require(_0x4a80('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a80('0x3'));var Mustache=require(_0x4a80('0x4'));var util=require(_0x4a80('0x5'));var path=require(_0x4a80('0x6'));var sox=require(_0x4a80('0x7'));var csv=require(_0x4a80('0x8'));var ejs=require(_0x4a80('0x9'));var fs=require('fs');var fs_extra=require(_0x4a80('0xa'));var _=require(_0x4a80('0xb'));var squel=require(_0x4a80('0xc'));var crypto=require(_0x4a80('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a80('0x8'));var querystring=require(_0x4a80('0xe'));var Papa=require(_0x4a80('0xf'));var Redis=require(_0x4a80('0x10'));var authService=require(_0x4a80('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4a80('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a80('0x13'));var utils=require(_0x4a80('0x14'));var config=require(_0x4a80('0x15'));var licenseUtil=require(_0x4a80('0x16'));var db=require(_0x4a80('0x17'))['db'];function respondWithStatusCode(_0x1120bc,_0x1fe4c0){_0x1fe4c0=_0x1fe4c0||0xcc;return function(_0x24d3d6){if(_0x24d3d6){return _0x1120bc[_0x4a80('0x18')](_0x1fe4c0);}return _0x1120bc[_0x4a80('0x19')](_0x1fe4c0)[_0x4a80('0x1a')]();};}function respondWithResult(_0x1bd234,_0xc21ec){_0xc21ec=_0xc21ec||0xc8;return function(_0x26f778){if(_0x26f778){return _0x1bd234[_0x4a80('0x19')](_0xc21ec)[_0x4a80('0x1b')](_0x26f778);}};}function respondWithFilteredResult(_0x558e3f,_0x212155){return function(_0x4c699b){if(_0x4c699b){var _0xc91f92=typeof _0x212155['offset']===_0x4a80('0x1c')&&typeof _0x212155[_0x4a80('0x1d')]===_0x4a80('0x1c');var _0x4ca1ab=_0x4c699b[_0x4a80('0x1e')];var _0xe84690=_0xc91f92?0x0:_0x212155[_0x4a80('0x1f')];var _0x1597a2=_0xc91f92?_0x4c699b[_0x4a80('0x1e')]:_0x212155['offset']+_0x212155[_0x4a80('0x1d')];var _0xaccf27;if(_0x1597a2>=_0x4ca1ab){_0x1597a2=_0x4ca1ab;_0xaccf27=0xc8;}else{_0xaccf27=0xce;}_0x558e3f[_0x4a80('0x19')](_0xaccf27);return _0x558e3f[_0x4a80('0x20')](_0x4a80('0x21'),_0xe84690+'-'+_0x1597a2+'/'+_0x4ca1ab)['json'](_0x4c699b);}return null;};}function patchUpdates(_0x52520d){return function(_0x1d1e83){try{jsonpatch[_0x4a80('0x22')](_0x1d1e83,_0x52520d,!![]);}catch(_0x4526ed){return BPromise[_0x4a80('0x23')](_0x4526ed);}return _0x1d1e83[_0x4a80('0x24')]();};}function saveUpdates(_0x5c2803,_0x363caa){return function(_0x27f035){if(_0x27f035){return _0x27f035[_0x4a80('0x25')](_0x5c2803)[_0x4a80('0x26')](function(_0xfe1db3){return _0xfe1db3;});}return null;};}function removeEntity(_0xdb4137,_0x1282dd){return function(_0x38e7a1){if(_0x38e7a1){return _0x38e7a1[_0x4a80('0x27')]()[_0x4a80('0x26')](function(){_0xdb4137[_0x4a80('0x19')](0xcc)[_0x4a80('0x1a')]();});}};}function handleEntityNotFound(_0x591f25,_0x42eb28){return function(_0x356e91){if(!_0x356e91){_0x591f25['sendStatus'](0x194);}return _0x356e91;};}function handleError(_0x491087,_0x26d602){_0x26d602=_0x26d602||0x1f4;return function(_0xc4bd56){logger[_0x4a80('0x28')](_0xc4bd56['stack']);if(_0xc4bd56[_0x4a80('0x29')]){delete _0xc4bd56[_0x4a80('0x29')];}_0x491087[_0x4a80('0x19')](_0x26d602)[_0x4a80('0x2a')](_0xc4bd56);};}exports[_0x4a80('0x2b')]=function(_0x4f9503,_0x5ef06a){var _0x1f69d5={},_0x4e0dee={},_0x2b9cf2={'count':0x0,'rows':[]};var _0x18e0dd=_['map'](db[_0x4a80('0x2c')][_0x4a80('0x2d')],function(_0x48a669){return{'name':_0x48a669[_0x4a80('0x2e')],'type':_0x48a669[_0x4a80('0x2f')][_0x4a80('0x30')]};});_0x4e0dee[_0x4a80('0x31')]=_[_0x4a80('0x32')](_0x18e0dd,_0x4a80('0x29'));_0x4e0dee[_0x4a80('0x33')]=_[_0x4a80('0x34')](_0x4f9503[_0x4a80('0x33')]);_0x4e0dee[_0x4a80('0x35')]=_[_0x4a80('0x36')](_0x4e0dee[_0x4a80('0x31')],_0x4e0dee['query']);_0x1f69d5['attributes']=_['intersection'](_0x4e0dee[_0x4a80('0x31')],qs['fields'](_0x4f9503[_0x4a80('0x33')][_0x4a80('0x37')]));_0x1f69d5[_0x4a80('0x38')]=_0x1f69d5[_0x4a80('0x38')][_0x4a80('0x39')]?_0x1f69d5['attributes']:_0x4e0dee['model'];if(!_0x4f9503[_0x4a80('0x33')][_0x4a80('0x3a')](_0x4a80('0x3b'))){_0x1f69d5[_0x4a80('0x1d')]=qs[_0x4a80('0x1d')](_0x4f9503[_0x4a80('0x33')]['limit']);_0x1f69d5[_0x4a80('0x1f')]=qs[_0x4a80('0x1f')](_0x4f9503[_0x4a80('0x33')][_0x4a80('0x1f')]);}_0x1f69d5[_0x4a80('0x3c')]=qs[_0x4a80('0x3d')](_0x4f9503[_0x4a80('0x33')][_0x4a80('0x3d')]);_0x1f69d5[_0x4a80('0x3e')]=qs['filters'](_['pick'](_0x4f9503[_0x4a80('0x33')],_0x4e0dee['filters']),_0x18e0dd);if(_0x4f9503[_0x4a80('0x33')][_0x4a80('0x3f')]){_0x1f69d5[_0x4a80('0x3e')]=_['merge'](_0x1f69d5[_0x4a80('0x3e')],{'$or':_[_0x4a80('0x32')](_0x18e0dd,function(_0x141246){if(_0x141246['type']!==_0x4a80('0x40')){var _0x5d3a00={};_0x5d3a00[_0x141246[_0x4a80('0x29')]]={'$like':'%'+_0x4f9503[_0x4a80('0x33')][_0x4a80('0x3f')]+'%'};return _0x5d3a00;}})});}_0x1f69d5=_['merge']({},_0x1f69d5,_0x4f9503[_0x4a80('0x41')]);var _0x302d2d={'where':_0x1f69d5[_0x4a80('0x3e')]};return db[_0x4a80('0x2c')][_0x4a80('0x1e')](_0x302d2d)[_0x4a80('0x26')](function(_0x4ee50e){_0x2b9cf2[_0x4a80('0x1e')]=_0x4ee50e;if(_0x4f9503[_0x4a80('0x33')][_0x4a80('0x42')]){_0x1f69d5[_0x4a80('0x43')]=[{'all':!![]}];}return db[_0x4a80('0x2c')]['findAll'](_0x1f69d5);})[_0x4a80('0x26')](function(_0x5146fd){_0x2b9cf2[_0x4a80('0x44')]=_0x5146fd;return _0x2b9cf2;})['then'](respondWithFilteredResult(_0x5ef06a,_0x1f69d5))['catch'](handleError(_0x5ef06a,null));};exports[_0x4a80('0x45')]=function(_0x2c1e68,_0x29f6b6){var _0x556623={'raw':!![],'where':{'id':_0x2c1e68['params']['id']}},_0x28d5da={};_0x28d5da[_0x4a80('0x31')]=_[_0x4a80('0x34')](db[_0x4a80('0x2c')][_0x4a80('0x2d')]);_0x28d5da[_0x4a80('0x33')]=_[_0x4a80('0x34')](_0x2c1e68['query']);_0x28d5da[_0x4a80('0x35')]=_[_0x4a80('0x36')](_0x28d5da[_0x4a80('0x31')],_0x28d5da['query']);_0x556623['attributes']=_['intersection'](_0x28d5da[_0x4a80('0x31')],qs['fields'](_0x2c1e68[_0x4a80('0x33')]['fields']));_0x556623['attributes']=_0x556623[_0x4a80('0x38')][_0x4a80('0x39')]?_0x556623['attributes']:_0x28d5da[_0x4a80('0x31')];if(_0x2c1e68[_0x4a80('0x33')][_0x4a80('0x42')]){_0x556623['include']=[{'all':!![]}];}_0x556623=_[_0x4a80('0x46')]({},_0x556623,_0x2c1e68[_0x4a80('0x41')]);return db[_0x4a80('0x2c')][_0x4a80('0x47')](_0x556623)['then'](handleEntityNotFound(_0x29f6b6,null))[_0x4a80('0x26')](respondWithResult(_0x29f6b6,null))[_0x4a80('0x48')](handleError(_0x29f6b6,null));};exports[_0x4a80('0x49')]=function(_0x4508de,_0x159cbd){return db['Dynamics365Field'][_0x4a80('0x49')](_0x4508de['body'],{})[_0x4a80('0x26')](respondWithResult(_0x159cbd,0xc9))[_0x4a80('0x48')](handleError(_0x159cbd,null));};exports[_0x4a80('0x25')]=function(_0x550669,_0x5465cb){if(_0x550669[_0x4a80('0x4a')]['id']){delete _0x550669[_0x4a80('0x4a')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x550669['params']['id']}})[_0x4a80('0x26')](handleEntityNotFound(_0x5465cb,null))[_0x4a80('0x26')](saveUpdates(_0x550669['body'],null))[_0x4a80('0x26')](respondWithResult(_0x5465cb,null))[_0x4a80('0x48')](handleError(_0x5465cb,null));};exports[_0x4a80('0x27')]=function(_0x1888a8,_0x592ed5){return db['Dynamics365Field']['find']({'where':{'id':_0x1888a8[_0x4a80('0x4b')]['id']}})[_0x4a80('0x26')](handleEntityNotFound(_0x592ed5,null))[_0x4a80('0x26')](removeEntity(_0x592ed5,null))[_0x4a80('0x48')](handleError(_0x592ed5,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 90bdb9d..8127174 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 _0x3f3e=['lodash','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId'];(function(_0x509de6,_0x3c11b1){var _0x37675b=function(_0x38ff9d){while(--_0x38ff9d){_0x509de6['push'](_0x509de6['shift']());}};_0x37675b(++_0x3c11b1);}(_0x3f3e,0x16c));var _0xe3f3=function(_0x385b5e,_0x359355){_0x385b5e=_0x385b5e-0x0;var _0x101b47=_0x3f3e[_0x385b5e];return _0x101b47;};'use strict';var _=require(_0xe3f3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe3f3('0x1'));var BPromise=require('bluebird');var rp=require(_0xe3f3('0x2'));var fs=require('fs');var path=require(_0xe3f3('0x3'));var rimraf=require('rimraf');var config=require(_0xe3f3('0x4'));var attributes=require(_0xe3f3('0x5'));module[_0xe3f3('0x6')]=function(_0x1b3952,_0x1555d0){return _0x1b3952[_0xe3f3('0x7')](_0xe3f3('0x8'),attributes,{'tableName':_0xe3f3('0x9'),'paranoid':![],'indexes':[{'name':_0xe3f3('0xa'),'fields':[_0xe3f3('0xb'),_0xe3f3('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f5b=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5dd181,_0x1eac8b){var _0x27cc98=function(_0x5814ce){while(--_0x5814ce){_0x5dd181['push'](_0x5dd181['shift']());}};_0x27cc98(++_0x1eac8b);}(_0x6f5b,0x139));var _0xb6f5=function(_0x4494cf,_0x403f40){_0x4494cf=_0x4494cf-0x0;var _0xe5e1dc=_0x6f5b[_0x4494cf];return _0xe5e1dc;};'use strict';var _=require(_0xb6f5('0x0'));var util=require(_0xb6f5('0x1'));var logger=require(_0xb6f5('0x2'))(_0xb6f5('0x3'));var moment=require(_0xb6f5('0x4'));var BPromise=require(_0xb6f5('0x5'));var rp=require(_0xb6f5('0x6'));var fs=require('fs');var path=require(_0xb6f5('0x7'));var rimraf=require(_0xb6f5('0x8'));var config=require(_0xb6f5('0x9'));var attributes=require(_0xb6f5('0xa'));module[_0xb6f5('0xb')]=function(_0x2ad08a,_0x235c18){return _0x2ad08a[_0xb6f5('0xc')](_0xb6f5('0xd'),attributes,{'tableName':_0xb6f5('0xe'),'paranoid':![],'indexes':[{'name':_0xb6f5('0xf'),'fields':['idField',_0xb6f5('0x10')],'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 2287432..de685aa 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 _0x7da3=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x417dd5,_0x44ab67){var _0x1f110c=function(_0x17f28d){while(--_0x17f28d){_0x417dd5['push'](_0x417dd5['shift']());}};_0x1f110c(++_0x44ab67);}(_0x7da3,0x18a));var _0x37da=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x7da3[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x37da('0x0'));var util=require('util');var moment=require(_0x37da('0x1'));var BPromise=require(_0x37da('0x2'));var rs=require(_0x37da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37da('0x4'))['db'];var utils=require(_0x37da('0x5'));var logger=require(_0x37da('0x6'))(_0x37da('0x7'));var config=require(_0x37da('0x8'));var jayson=require(_0x37da('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fb8c,_0x5f0787,_0x46168c){return new BPromise(function(_0x52315e,_0x464e30){return client[_0x37da('0xa')](_0x46fb8c,_0x46168c)['then'](function(_0x12920f){logger[_0x37da('0xb')](_0x37da('0xc'),_0x5f0787,'request\x20sent');logger[_0x37da('0xd')](_0x37da('0xe'),_0x5f0787,_0x37da('0xf'),JSON[_0x37da('0x10')](_0x12920f));if(_0x12920f[_0x37da('0x11')]){if(_0x12920f['error'][_0x37da('0x12')]===0x1f4){logger[_0x37da('0x11')](_0x37da('0xc'),_0x5f0787,_0x12920f[_0x37da('0x11')]['message']);return _0x464e30(_0x12920f[_0x37da('0x11')][_0x37da('0x13')]);}logger[_0x37da('0x11')](_0x37da('0xc'),_0x5f0787,_0x12920f['error']['message']);return _0x52315e(_0x12920f[_0x37da('0x11')][_0x37da('0x13')]);}else{logger[_0x37da('0xb')](_0x37da('0xc'),_0x5f0787,'request\x20sent');_0x52315e(_0x12920f['result'][_0x37da('0x13')]);}})[_0x37da('0x14')](function(_0x3ee9a5){logger[_0x37da('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x5f0787,_0x3ee9a5);_0x464e30(_0x3ee9a5);});});} \ No newline at end of file +var _0x7676=['message','request\x20sent','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7676,0xea));var _0x6767=function(_0x5fc224,_0x3590f3){_0x5fc224=_0x5fc224-0x0;var _0x280965=_0x7676[_0x5fc224];return _0x280965;};'use strict';var _=require(_0x6767('0x0'));var util=require(_0x6767('0x1'));var moment=require(_0x6767('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6767('0x3'))['db'];var utils=require(_0x6767('0x4'));var logger=require(_0x6767('0x5'))(_0x6767('0x6'));var config=require(_0x6767('0x7'));var jayson=require(_0x6767('0x8'));var client=jayson[_0x6767('0x9')][_0x6767('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36be99,_0x281d7e,_0x37312b){return new BPromise(function(_0x1f1c66,_0x5e1e7b){return client['request'](_0x36be99,_0x37312b)[_0x6767('0xb')](function(_0x1813b1){logger[_0x6767('0xc')](_0x6767('0xd'),_0x281d7e,'request\x20sent');logger['debug'](_0x6767('0xe'),_0x281d7e,'request\x20sent',JSON[_0x6767('0xf')](_0x1813b1));if(_0x1813b1[_0x6767('0x10')]){if(_0x1813b1['error'][_0x6767('0x11')]===0x1f4){logger['error'](_0x6767('0xd'),_0x281d7e,_0x1813b1[_0x6767('0x10')][_0x6767('0x12')]);return _0x5e1e7b(_0x1813b1[_0x6767('0x10')]['message']);}logger[_0x6767('0x10')](_0x6767('0xd'),_0x281d7e,_0x1813b1[_0x6767('0x10')][_0x6767('0x12')]);return _0x1f1c66(_0x1813b1['error']['message']);}else{logger[_0x6767('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x281d7e,_0x6767('0x13'));_0x1f1c66(_0x1813b1[_0x6767('0x14')]['message']);}})['catch'](function(_0x8793c6){logger[_0x6767('0x10')](_0x6767('0xd'),_0x281d7e,_0x8793c6);_0x5e1e7b(_0x8793c6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 0243ad3..c65f55a 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 _0x81b2=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x81b2,0x12f));var _0x281b=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x81b2[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0x281b('0x0'));var util=require(_0x281b('0x1'));var path=require(_0x281b('0x2'));var timeout=require(_0x281b('0x3'));var express=require(_0x281b('0x4'));var router=express['Router']();var fs_extra=require(_0x281b('0x5'));var auth=require(_0x281b('0x6'));var interaction=require(_0x281b('0x7'));var config=require(_0x281b('0x8'));var controller=require(_0x281b('0x9'));router[_0x281b('0xa')]('/',auth[_0x281b('0xb')](),controller[_0x281b('0xc')]);router[_0x281b('0xa')](_0x281b('0xd'),auth['isAuthenticated'](),controller[_0x281b('0xe')]);router[_0x281b('0xa')]('/:id/configurations',auth[_0x281b('0xb')](),controller[_0x281b('0xf')]);router[_0x281b('0xa')](_0x281b('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x281b('0x11')]('/',auth[_0x281b('0xb')](),controller[_0x281b('0x12')]);router[_0x281b('0x11')]('/:id/configurations',auth[_0x281b('0xb')](),controller[_0x281b('0x13')]);router[_0x281b('0x14')](_0x281b('0xd'),auth[_0x281b('0xb')](),controller[_0x281b('0x15')]);router[_0x281b('0x16')](_0x281b('0xd'),auth[_0x281b('0xb')](),controller[_0x281b('0x17')]);module[_0x281b('0x18')]=router; \ No newline at end of file +var _0xa6fd=['/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','show'];(function(_0x4fc4a2,_0x16dff5){var _0x4c9a55=function(_0x4f505f){while(--_0x4f505f){_0x4fc4a2['push'](_0x4fc4a2['shift']());}};_0x4c9a55(++_0x16dff5);}(_0xa6fd,0xb2));var _0xda6f=function(_0x4e7413,_0x5dffb1){_0x4e7413=_0x4e7413-0x0;var _0x11b6de=_0xa6fd[_0x4e7413];return _0x11b6de;};'use strict';var multer=require('multer');var util=require(_0xda6f('0x0'));var path=require(_0xda6f('0x1'));var timeout=require(_0xda6f('0x2'));var express=require(_0xda6f('0x3'));var router=express[_0xda6f('0x4')]();var fs_extra=require(_0xda6f('0x5'));var auth=require(_0xda6f('0x6'));var interaction=require(_0xda6f('0x7'));var config=require(_0xda6f('0x8'));var controller=require(_0xda6f('0x9'));router['get']('/',auth[_0xda6f('0xa')](),controller[_0xda6f('0xb')]);router[_0xda6f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xda6f('0xd')]);router[_0xda6f('0xc')](_0xda6f('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xda6f('0xf'),auth[_0xda6f('0xa')](),controller[_0xda6f('0x10')]);router['post']('/',auth[_0xda6f('0xa')](),controller[_0xda6f('0x11')]);router[_0xda6f('0x12')]('/:id/configurations',auth[_0xda6f('0xa')](),controller[_0xda6f('0x13')]);router[_0xda6f('0x14')]('/:id',auth[_0xda6f('0xa')](),controller[_0xda6f('0x15')]);router[_0xda6f('0x16')]('/:id',auth[_0xda6f('0xa')](),controller['destroy']);module[_0xda6f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c955d57..4954caa 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 _0x6343=['STRING','remoteUri'];(function(_0x384e23,_0xdd842d){var _0x511a27=function(_0x225c64){while(--_0x225c64){_0x384e23['push'](_0x384e23['shift']());}};_0x511a27(++_0xdd842d);}(_0x6343,0x168));var _0x3634=function(_0x38034f,_0x5949a5){_0x38034f=_0x38034f-0x0;var _0x4d583e=_0x6343[_0x38034f];return _0x4d583e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9536=['username','remoteUri','sequelize','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9536,0x179));var _0x6953=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x9536[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0x6953('0x0'));module[_0x6953('0x1')]={'name':{'type':Sequelize[_0x6953('0x2')]},'description':{'type':Sequelize[_0x6953('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6953('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6953('0x2')],'unique':_0x6953('0x4')},'serverUrl':{'type':Sequelize[_0x6953('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 78b4faf..650afcb 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 _0x3276=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','model','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','length','pick','hasOwnProperty','Subjects','Descriptions','channel','FreshdeskField','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','priority','source','ticket_type','company','includes','custom_dropdown','label','default','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x3276,0xc7));var _0x6327=function(_0x3275fe,_0x187cd6){_0x3275fe=_0x3275fe-0x0;var _0x5b312d=_0x3276[_0x3275fe];return _0x5b312d;};'use strict';var emlformat=require(_0x6327('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6327('0x1'));var rp=require(_0x6327('0x2'));var moment=require(_0x6327('0x3'));var BPromise=require(_0x6327('0x4'));var Mustache=require(_0x6327('0x5'));var util=require(_0x6327('0x6'));var path=require(_0x6327('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6327('0x8'));var fs=require('fs');var fs_extra=require(_0x6327('0x9'));var _=require(_0x6327('0xa'));var squel=require('squel');var crypto=require(_0x6327('0xb'));var jsforce=require(_0x6327('0xc'));var deskjs=require(_0x6327('0xd'));var toCsv=require(_0x6327('0xe'));var querystring=require('querystring');var Papa=require(_0x6327('0xf'));var Redis=require(_0x6327('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6327('0x11'));var as=require(_0x6327('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6327('0x13'))(_0x6327('0x14'));var utils=require(_0x6327('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6327('0x16'));var db=require(_0x6327('0x17'))['db'];var integrations=require(_0x6327('0x18'));function respondWithStatusCode(_0x32408c,_0x3ff61b){_0x3ff61b=_0x3ff61b||0xcc;return function(_0x144255){if(_0x144255){return _0x32408c[_0x6327('0x19')](_0x3ff61b);}return _0x32408c[_0x6327('0x1a')](_0x3ff61b)[_0x6327('0x1b')]();};}function respondWithResult(_0x306095,_0x48eb75){_0x48eb75=_0x48eb75||0xc8;return function(_0xcc0256){if(_0xcc0256){return _0x306095['status'](_0x48eb75)[_0x6327('0x1c')](_0xcc0256);}};}function respondWithFilteredResult(_0x1e850c,_0x43186f){return function(_0x4e9741){if(_0x4e9741){var _0x36f167=typeof _0x43186f[_0x6327('0x1d')]===_0x6327('0x1e')&&typeof _0x43186f[_0x6327('0x1f')]===_0x6327('0x1e');var _0x372624=_0x4e9741[_0x6327('0x20')];var _0x140bc8=_0x36f167?0x0:_0x43186f[_0x6327('0x1d')];var _0xd8e138=_0x36f167?_0x4e9741[_0x6327('0x20')]:_0x43186f[_0x6327('0x1d')]+_0x43186f['limit'];var _0x1de532;if(_0xd8e138>=_0x372624){_0xd8e138=_0x372624;_0x1de532=0xc8;}else{_0x1de532=0xce;}_0x1e850c[_0x6327('0x1a')](_0x1de532);return _0x1e850c[_0x6327('0x21')](_0x6327('0x22'),_0x140bc8+'-'+_0xd8e138+'/'+_0x372624)['json'](_0x4e9741);}return null;};}function patchUpdates(_0x56249b){return function(_0x3f338e){try{jsonpatch[_0x6327('0x23')](_0x3f338e,_0x56249b,!![]);}catch(_0x391a4e){return BPromise[_0x6327('0x24')](_0x391a4e);}return _0x3f338e[_0x6327('0x25')]();};}function saveUpdates(_0x76c718,_0x5754e1){return function(_0x32e7a0){if(_0x32e7a0){return _0x32e7a0[_0x6327('0x26')](_0x76c718)[_0x6327('0x27')](function(_0x1c3d7f){return _0x1c3d7f;});}return null;};}function removeEntity(_0x302b3f,_0x254c2f){return function(_0x44d2e7){if(_0x44d2e7){return _0x44d2e7[_0x6327('0x28')]()[_0x6327('0x27')](function(){_0x302b3f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc155b,_0x499321){return function(_0x144fcc){if(!_0x144fcc){_0xc155b['sendStatus'](0x194);}return _0x144fcc;};}function handleError(_0x3c3711,_0x559dbb){_0x559dbb=_0x559dbb||0x1f4;return function(_0x397ca5){logger[_0x6327('0x29')](_0x397ca5['stack']);if(_0x397ca5[_0x6327('0x2a')]){delete _0x397ca5[_0x6327('0x2a')];}_0x3c3711[_0x6327('0x1a')](_0x559dbb)[_0x6327('0x2b')](_0x397ca5);};}exports[_0x6327('0x2c')]=function(_0x29f43e,_0x42b225){var _0x2c4ca5={},_0x58b590={},_0x2ebc01={'count':0x0,'rows':[]};var _0x3a96a2=_['map'](db[_0x6327('0x2d')][_0x6327('0x2e')],function(_0x5e8ff5){return{'name':_0x5e8ff5[_0x6327('0x2f')],'type':_0x5e8ff5[_0x6327('0x30')][_0x6327('0x31')]};});_0x58b590['model']=_[_0x6327('0x32')](_0x3a96a2,_0x6327('0x2a'));_0x58b590[_0x6327('0x33')]=_[_0x6327('0x34')](_0x29f43e['query']);_0x58b590[_0x6327('0x35')]=_['intersection'](_0x58b590['model'],_0x58b590[_0x6327('0x33')]);_0x2c4ca5[_0x6327('0x36')]=_[_0x6327('0x37')](_0x58b590[_0x6327('0x38')],qs['fields'](_0x29f43e[_0x6327('0x33')][_0x6327('0x39')]));_0x2c4ca5[_0x6327('0x36')]=_0x2c4ca5[_0x6327('0x36')]['length']?_0x2c4ca5[_0x6327('0x36')]:_0x58b590[_0x6327('0x38')];if(!_0x29f43e[_0x6327('0x33')]['hasOwnProperty'](_0x6327('0x3a'))){_0x2c4ca5[_0x6327('0x1f')]=qs[_0x6327('0x1f')](_0x29f43e['query']['limit']);_0x2c4ca5[_0x6327('0x1d')]=qs['offset'](_0x29f43e[_0x6327('0x33')]['offset']);}_0x2c4ca5[_0x6327('0x3b')]=qs[_0x6327('0x3c')](_0x29f43e[_0x6327('0x33')][_0x6327('0x3c')]);_0x2c4ca5[_0x6327('0x3d')]=qs[_0x6327('0x35')](_['pick'](_0x29f43e[_0x6327('0x33')],_0x58b590[_0x6327('0x35')]),_0x3a96a2);if(_0x29f43e[_0x6327('0x33')][_0x6327('0x3e')]){_0x2c4ca5['where']=_['merge'](_0x2c4ca5[_0x6327('0x3d')],{'$or':_[_0x6327('0x32')](_0x3a96a2,function(_0x2366e2){if(_0x2366e2[_0x6327('0x30')]!==_0x6327('0x3f')){var _0x4e3c1f={};_0x4e3c1f[_0x2366e2[_0x6327('0x2a')]]={'$like':'%'+_0x29f43e[_0x6327('0x33')][_0x6327('0x3e')]+'%'};return _0x4e3c1f;}})});}_0x2c4ca5=_[_0x6327('0x40')]({},_0x2c4ca5,_0x29f43e[_0x6327('0x41')]);var _0x4db72b={'where':_0x2c4ca5[_0x6327('0x3d')]};return db[_0x6327('0x2d')]['count'](_0x4db72b)[_0x6327('0x27')](function(_0x360b46){_0x2ebc01[_0x6327('0x20')]=_0x360b46;if(_0x29f43e[_0x6327('0x33')]['includeAll']){_0x2c4ca5[_0x6327('0x42')]=[{'all':!![]}];}return db[_0x6327('0x2d')][_0x6327('0x43')](_0x2c4ca5);})['then'](function(_0xa3aa02){_0x2ebc01[_0x6327('0x44')]=_0xa3aa02;return _0x2ebc01;})['then'](respondWithFilteredResult(_0x42b225,_0x2c4ca5))[_0x6327('0x45')](handleError(_0x42b225,null));};exports[_0x6327('0x46')]=function(_0x1c23d7,_0x292456){var _0xab88fb={'raw':![],'where':{'id':_0x1c23d7[_0x6327('0x47')]['id']}},_0x415d24={};_0x415d24[_0x6327('0x38')]=_[_0x6327('0x34')](db[_0x6327('0x2d')][_0x6327('0x2e')]);_0x415d24[_0x6327('0x33')]=_[_0x6327('0x34')](_0x1c23d7[_0x6327('0x33')]);_0x415d24[_0x6327('0x35')]=_[_0x6327('0x37')](_0x415d24[_0x6327('0x38')],_0x415d24[_0x6327('0x33')]);_0xab88fb['attributes']=_[_0x6327('0x37')](_0x415d24[_0x6327('0x38')],qs['fields'](_0x1c23d7['query']['fields']));_0xab88fb[_0x6327('0x36')]=_0xab88fb[_0x6327('0x36')]['length']?_0xab88fb[_0x6327('0x36')]:_0x415d24[_0x6327('0x38')];if(_0x1c23d7[_0x6327('0x33')][_0x6327('0x48')]){_0xab88fb[_0x6327('0x42')]=[{'all':!![]}];}_0xab88fb=_[_0x6327('0x40')]({},_0xab88fb,_0x1c23d7[_0x6327('0x41')]);return db[_0x6327('0x2d')][_0x6327('0x49')](_0xab88fb)['then'](handleEntityNotFound(_0x292456,null))[_0x6327('0x27')](respondWithResult(_0x292456,null))[_0x6327('0x45')](handleError(_0x292456,null));};exports[_0x6327('0x4a')]=function(_0x4c645b,_0x403c19){return db[_0x6327('0x2d')][_0x6327('0x4a')](_0x4c645b[_0x6327('0x4b')],{})['then'](respondWithResult(_0x403c19,0xc9))[_0x6327('0x45')](handleError(_0x403c19,null));};exports[_0x6327('0x26')]=function(_0x3fc622,_0x248ef6){if(_0x3fc622[_0x6327('0x4b')]['id']){delete _0x3fc622[_0x6327('0x4b')]['id'];}return db[_0x6327('0x2d')][_0x6327('0x49')]({'where':{'id':_0x3fc622[_0x6327('0x47')]['id']}})[_0x6327('0x27')](handleEntityNotFound(_0x248ef6,null))[_0x6327('0x27')](saveUpdates(_0x3fc622[_0x6327('0x4b')],null))[_0x6327('0x27')](respondWithResult(_0x248ef6,null))[_0x6327('0x45')](handleError(_0x248ef6,null));};exports['destroy']=function(_0x550a28,_0x1f95b6){return db[_0x6327('0x2d')][_0x6327('0x49')]({'where':{'id':_0x550a28[_0x6327('0x47')]['id']}})[_0x6327('0x27')](handleEntityNotFound(_0x1f95b6,null))[_0x6327('0x27')](removeEntity(_0x1f95b6,null))[_0x6327('0x45')](handleError(_0x1f95b6,null));};exports[_0x6327('0x4c')]=function(_0xbb0fe1,_0x21ded8,_0xe9b026){var _0x15326e={};var _0x1471fd={};var _0x165cba;var _0x5daaed;return db[_0x6327('0x2d')][_0x6327('0x4d')]({'where':{'id':_0xbb0fe1[_0x6327('0x47')]['id']}})[_0x6327('0x27')](handleEntityNotFound(_0x21ded8,null))['then'](function(_0x3e2b4f){if(_0x3e2b4f){_0x165cba=_0x3e2b4f;_0x1471fd[_0x6327('0x38')]=_[_0x6327('0x34')](db[_0x6327('0x4e')][_0x6327('0x2e')]);_0x1471fd['query']=_[_0x6327('0x34')](_0xbb0fe1['query']);_0x1471fd[_0x6327('0x35')]=_[_0x6327('0x37')](_0x1471fd[_0x6327('0x38')],_0x1471fd[_0x6327('0x33')]);_0x15326e[_0x6327('0x36')]=_[_0x6327('0x37')](_0x1471fd['model'],qs[_0x6327('0x39')](_0xbb0fe1[_0x6327('0x33')]['fields']));_0x15326e[_0x6327('0x36')]=_0x15326e[_0x6327('0x36')][_0x6327('0x4f')]?_0x15326e[_0x6327('0x36')]:_0x1471fd[_0x6327('0x38')];_0x15326e[_0x6327('0x3b')]=qs[_0x6327('0x3c')](_0xbb0fe1[_0x6327('0x33')]['sort']);_0x15326e[_0x6327('0x3d')]=qs[_0x6327('0x35')](_[_0x6327('0x50')](_0xbb0fe1[_0x6327('0x33')],_0x1471fd[_0x6327('0x35')]));if(_0xbb0fe1[_0x6327('0x33')]['filter']){_0x15326e[_0x6327('0x3d')]=_['merge'](_0x15326e[_0x6327('0x3d')],{'$or':_[_0x6327('0x32')](_0x15326e[_0x6327('0x36')],function(_0x41df29){var _0x18c81e={};_0x18c81e[_0x41df29]={'$like':'%'+_0xbb0fe1[_0x6327('0x33')][_0x6327('0x3e')]+'%'};return _0x18c81e;})});}_0x15326e=_[_0x6327('0x40')]({},_0x15326e,_0xbb0fe1[_0x6327('0x41')]);return _0x165cba[_0x6327('0x4c')](_0x15326e);}})[_0x6327('0x27')](function(_0x36f28a){if(_0x36f28a){_0x5daaed=_0x36f28a[_0x6327('0x4f')];if(!_0xbb0fe1['query'][_0x6327('0x51')](_0x6327('0x3a'))){_0x15326e[_0x6327('0x1f')]=qs['limit'](_0xbb0fe1[_0x6327('0x33')][_0x6327('0x1f')]);_0x15326e['offset']=qs['offset'](_0xbb0fe1['query']['offset']);}return _0x165cba[_0x6327('0x4c')](_0x15326e);}})[_0x6327('0x27')](function(_0x36f8c2){if(_0x36f8c2){return _0x36f8c2?{'count':_0x5daaed,'rows':_0x36f8c2}:null;}})[_0x6327('0x27')](respondWithResult(_0x21ded8,null))[_0x6327('0x45')](handleError(_0x21ded8,null));};exports['addConfiguration']=function(_0x5dea35,_0x135361,_0x28e3e9){if(_0x5dea35['body']['id']){delete _0x5dea35[_0x6327('0x4b')]['id'];}return db[_0x6327('0x2d')][_0x6327('0x4d')]({'where':{'id':_0x5dea35[_0x6327('0x47')]['id']}})[_0x6327('0x27')](handleEntityNotFound(_0x135361,null))[_0x6327('0x27')](function(_0x4b4031){if(_0x4b4031){_0x5dea35['body']['AccountId']=_0x4b4031['id'];_0x5dea35[_0x6327('0x4b')][_0x6327('0x52')]=integrations['getSubjects'](_0x5dea35['body']['channel'],_0x5dea35[_0x6327('0x4b')][_0x6327('0x30')]);_0x5dea35[_0x6327('0x4b')][_0x6327('0x53')]=integrations['getDescriptions'](_0x5dea35[_0x6327('0x4b')][_0x6327('0x54')],_0x5dea35[_0x6327('0x4b')]['type']);return db['FreshdeskConfiguration']['create'](_0x5dea35[_0x6327('0x4b')],{'include':[{'model':db[_0x6327('0x55')],'as':_0x6327('0x52')},{'model':db[_0x6327('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x135361,null))[_0x6327('0x45')](handleError(_0x135361,null));};exports['getFields']=function(_0x1e2376,_0x5e92a8,_0x362873){var _0x81def1='';return db[_0x6327('0x2d')]['findOne']({'where':{'id':_0x1e2376[_0x6327('0x47')]['id']},'attributes':['id',_0x6327('0x56'),_0x6327('0x57')]})['then'](handleEntityNotFound(_0x5e92a8,null))[_0x6327('0x27')](function(_0x3f56ba){if(_0x3f56ba){_0x81def1=_0x3f56ba[_0x6327('0x56')];var _0x4eb23c=_0x81def1[_0x6327('0x58')](-0x1);if(_0x4eb23c==='/'){_0x81def1=_0x81def1['substring'](0x0,_0x81def1[_0x6327('0x59')](_0x4eb23c));}return rp({'method':_0x6327('0x5a'),'uri':util[_0x6327('0x5b')](_0x6327('0x5c'),_0x81def1,_0x6327('0x5d')),'headers':{'Authorization':util[_0x6327('0x5b')](_0x6327('0x5e'),new Buffer(util[_0x6327('0x5b')]('%s:X',_0x3f56ba[_0x6327('0x57')]))[_0x6327('0x5f')](_0x6327('0x60')))},'json':!![]});}})[_0x6327('0x27')](function(_0x58d40a){if(_0x58d40a){var _0x403367=[_0x6327('0x61'),_0x6327('0x62'),_0x6327('0x63'),'description',_0x6327('0x1a'),_0x6327('0x64'),'group',_0x6327('0x65'),_0x6327('0x66'),'group',_0x6327('0x67')];_['remove'](_0x58d40a,function(_0xef7bc9){return _0x403367[_0x6327('0x68')](_0xef7bc9[_0x6327('0x2a')])||!_0xef7bc9['default']&&_0xef7bc9[_0x6327('0x30')]!=='custom_text'&&_0xef7bc9['type']!==_0x6327('0x69');});return{'count':_0x58d40a['length'],'rows':_[_0x6327('0x32')](_0x58d40a,function(_0x38bd39){return{'id':_0x38bd39[_0x6327('0x2a')],'name':_0x38bd39[_0x6327('0x6a')],'custom':!_0x38bd39[_0x6327('0x6b')],'options':_0x38bd39[_0x6327('0x6c')]?_[_0x6327('0x32')](_0x38bd39[_0x6327('0x6c')],function(_0x3ef382){return{'name':_[_0x6327('0x6d')](_0x3ef382),'value':_0x3ef382};}):[]};})};}})['then'](respondWithResult(_0x5e92a8,null))[_0x6327('0x45')](function(_0x314a86){var _0x136834=_0x1e2376['query']['test']?0x1f4:_0x314a86['statusCode']||0x1f4;logger['error'](_0x6327('0x6e'),_0x6327('0x6f'),_0x136834,JSON[_0x6327('0x70')](_0x314a86));delete _0x314a86['name'];if(_0x136834===0x191){_0x136834=0x190;}_0x5e92a8['status'](_0x136834)[_0x6327('0x2b')](_0x1e2376[_0x6327('0x33')][_0x6327('0x71')]?{'message':_0x6327('0x72'),'statusCode':_0x314a86['statusCode']}:_0x314a86);});}; \ No newline at end of file +var _0x55ea=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshdeskAccount','fieldName','type','key','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','getConfigurations','FreshdeskConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','remoteUri','apiKey','substring','lastIndexOf','api/v2/ticket_fields','format','Basic\x20%s','%s:X','base64','subject','agent','description','priority','group','source','ticket_type','company','default','custom_text','custom_dropdown','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4781d6,_0x173582){var _0x7fc3b2=function(_0x39286d){while(--_0x39286d){_0x4781d6['push'](_0x4781d6['shift']());}};_0x7fc3b2(++_0x173582);}(_0x55ea,0xc9));var _0xa55e=function(_0x922aba,_0x50eec5){_0x922aba=_0x922aba-0x0;var _0x762c50=_0x55ea[_0x922aba];return _0x762c50;};'use strict';var emlformat=require(_0xa55e('0x0'));var rimraf=require(_0xa55e('0x1'));var zipdir=require(_0xa55e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa55e('0x3'));var moment=require(_0xa55e('0x4'));var BPromise=require(_0xa55e('0x5'));var Mustache=require(_0xa55e('0x6'));var util=require(_0xa55e('0x7'));var path=require('path');var sox=require(_0xa55e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa55e('0x9'));var crypto=require(_0xa55e('0xa'));var jsforce=require(_0xa55e('0xb'));var deskjs=require(_0xa55e('0xc'));var toCsv=require(_0xa55e('0xd'));var querystring=require(_0xa55e('0xe'));var Papa=require(_0xa55e('0xf'));var Redis=require(_0xa55e('0x10'));var authService=require(_0xa55e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa55e('0x12'));var logger=require(_0xa55e('0x13'))(_0xa55e('0x14'));var utils=require(_0xa55e('0x15'));var config=require(_0xa55e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa55e('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3f5178,_0x1d45c1){_0x1d45c1=_0x1d45c1||0xcc;return function(_0x153f71){if(_0x153f71){return _0x3f5178[_0xa55e('0x18')](_0x1d45c1);}return _0x3f5178[_0xa55e('0x19')](_0x1d45c1)[_0xa55e('0x1a')]();};}function respondWithResult(_0x15a283,_0x27746c){_0x27746c=_0x27746c||0xc8;return function(_0x3ba80b){if(_0x3ba80b){return _0x15a283['status'](_0x27746c)[_0xa55e('0x1b')](_0x3ba80b);}};}function respondWithFilteredResult(_0x30738d,_0x25fa30){return function(_0x12895e){if(_0x12895e){var _0x303698=typeof _0x25fa30[_0xa55e('0x1c')]==='undefined'&&typeof _0x25fa30[_0xa55e('0x1d')]==='undefined';var _0x517142=_0x12895e[_0xa55e('0x1e')];var _0x45935e=_0x303698?0x0:_0x25fa30[_0xa55e('0x1c')];var _0x1bdfa3=_0x303698?_0x12895e[_0xa55e('0x1e')]:_0x25fa30['offset']+_0x25fa30[_0xa55e('0x1d')];var _0x4a1ecb;if(_0x1bdfa3>=_0x517142){_0x1bdfa3=_0x517142;_0x4a1ecb=0xc8;}else{_0x4a1ecb=0xce;}_0x30738d['status'](_0x4a1ecb);return _0x30738d[_0xa55e('0x1f')](_0xa55e('0x20'),_0x45935e+'-'+_0x1bdfa3+'/'+_0x517142)[_0xa55e('0x1b')](_0x12895e);}return null;};}function patchUpdates(_0x1033c0){return function(_0x51304d){try{jsonpatch[_0xa55e('0x21')](_0x51304d,_0x1033c0,!![]);}catch(_0x475dde){return BPromise[_0xa55e('0x22')](_0x475dde);}return _0x51304d[_0xa55e('0x23')]();};}function saveUpdates(_0x5b0e74,_0x53a2f9){return function(_0x34331e){if(_0x34331e){return _0x34331e['update'](_0x5b0e74)[_0xa55e('0x24')](function(_0x31c4ac){return _0x31c4ac;});}return null;};}function removeEntity(_0x801fec,_0x2842a6){return function(_0x24bbfd){if(_0x24bbfd){return _0x24bbfd[_0xa55e('0x25')]()[_0xa55e('0x24')](function(){_0x801fec[_0xa55e('0x19')](0xcc)[_0xa55e('0x1a')]();});}};}function handleEntityNotFound(_0x3627e8,_0x3c519d){return function(_0x137aca){if(!_0x137aca){_0x3627e8[_0xa55e('0x18')](0x194);}return _0x137aca;};}function handleError(_0x25142c,_0xa57293){_0xa57293=_0xa57293||0x1f4;return function(_0x50738b){logger[_0xa55e('0x26')](_0x50738b[_0xa55e('0x27')]);if(_0x50738b[_0xa55e('0x28')]){delete _0x50738b['name'];}_0x25142c['status'](_0xa57293)[_0xa55e('0x29')](_0x50738b);};}exports['index']=function(_0x286f95,_0x58fc30){var _0x2fe4e9={},_0x4d9634={},_0x2758ca={'count':0x0,'rows':[]};var _0x532b13=_[_0xa55e('0x2a')](db[_0xa55e('0x2b')]['rawAttributes'],function(_0x2cdd6c){return{'name':_0x2cdd6c[_0xa55e('0x2c')],'type':_0x2cdd6c[_0xa55e('0x2d')][_0xa55e('0x2e')]};});_0x4d9634['model']=_[_0xa55e('0x2a')](_0x532b13,_0xa55e('0x28'));_0x4d9634['query']=_[_0xa55e('0x2f')](_0x286f95[_0xa55e('0x30')]);_0x4d9634[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x4d9634['model'],_0x4d9634[_0xa55e('0x30')]);_0x2fe4e9['attributes']=_[_0xa55e('0x32')](_0x4d9634['model'],qs[_0xa55e('0x33')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x33')]));_0x2fe4e9[_0xa55e('0x34')]=_0x2fe4e9['attributes'][_0xa55e('0x35')]?_0x2fe4e9['attributes']:_0x4d9634[_0xa55e('0x36')];if(!_0x286f95[_0xa55e('0x30')][_0xa55e('0x37')]('nolimit')){_0x2fe4e9[_0xa55e('0x1d')]=qs[_0xa55e('0x1d')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x1d')]);_0x2fe4e9[_0xa55e('0x1c')]=qs[_0xa55e('0x1c')](_0x286f95['query']['offset']);}_0x2fe4e9[_0xa55e('0x38')]=qs[_0xa55e('0x39')](_0x286f95[_0xa55e('0x30')][_0xa55e('0x39')]);_0x2fe4e9[_0xa55e('0x3a')]=qs[_0xa55e('0x31')](_[_0xa55e('0x3b')](_0x286f95['query'],_0x4d9634['filters']),_0x532b13);if(_0x286f95[_0xa55e('0x30')][_0xa55e('0x3c')]){_0x2fe4e9[_0xa55e('0x3a')]=_[_0xa55e('0x3d')](_0x2fe4e9[_0xa55e('0x3a')],{'$or':_[_0xa55e('0x2a')](_0x532b13,function(_0x4e17b){if(_0x4e17b[_0xa55e('0x2d')]!==_0xa55e('0x3e')){var _0x113ab5={};_0x113ab5[_0x4e17b[_0xa55e('0x28')]]={'$like':'%'+_0x286f95['query'][_0xa55e('0x3c')]+'%'};return _0x113ab5;}})});}_0x2fe4e9=_[_0xa55e('0x3d')]({},_0x2fe4e9,_0x286f95[_0xa55e('0x3f')]);var _0x5d955e={'where':_0x2fe4e9[_0xa55e('0x3a')]};return db['FreshdeskAccount'][_0xa55e('0x1e')](_0x5d955e)[_0xa55e('0x24')](function(_0x1f1129){_0x2758ca[_0xa55e('0x1e')]=_0x1f1129;if(_0x286f95[_0xa55e('0x30')][_0xa55e('0x40')]){_0x2fe4e9[_0xa55e('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x2fe4e9);})[_0xa55e('0x24')](function(_0x1bfc79){_0x2758ca[_0xa55e('0x42')]=_0x1bfc79;return _0x2758ca;})['then'](respondWithFilteredResult(_0x58fc30,_0x2fe4e9))[_0xa55e('0x43')](handleError(_0x58fc30,null));};exports[_0xa55e('0x44')]=function(_0x1c7d18,_0xb43d62){var _0x43c887={'raw':![],'where':{'id':_0x1c7d18[_0xa55e('0x45')]['id']}},_0x95163d={};_0x95163d[_0xa55e('0x36')]=_['keys'](db['FreshdeskAccount'][_0xa55e('0x46')]);_0x95163d[_0xa55e('0x30')]=_[_0xa55e('0x2f')](_0x1c7d18[_0xa55e('0x30')]);_0x95163d[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x95163d[_0xa55e('0x36')],_0x95163d[_0xa55e('0x30')]);_0x43c887['attributes']=_['intersection'](_0x95163d[_0xa55e('0x36')],qs['fields'](_0x1c7d18[_0xa55e('0x30')]['fields']));_0x43c887['attributes']=_0x43c887[_0xa55e('0x34')][_0xa55e('0x35')]?_0x43c887['attributes']:_0x95163d['model'];if(_0x1c7d18[_0xa55e('0x30')][_0xa55e('0x40')]){_0x43c887[_0xa55e('0x41')]=[{'all':!![]}];}_0x43c887=_[_0xa55e('0x3d')]({},_0x43c887,_0x1c7d18[_0xa55e('0x3f')]);return db[_0xa55e('0x2b')]['find'](_0x43c887)['then'](handleEntityNotFound(_0xb43d62,null))[_0xa55e('0x24')](respondWithResult(_0xb43d62,null))[_0xa55e('0x43')](handleError(_0xb43d62,null));};exports[_0xa55e('0x47')]=function(_0x259cb3,_0x10ba01){return db[_0xa55e('0x2b')]['create'](_0x259cb3[_0xa55e('0x48')],{})[_0xa55e('0x24')](respondWithResult(_0x10ba01,0xc9))[_0xa55e('0x43')](handleError(_0x10ba01,null));};exports[_0xa55e('0x49')]=function(_0x338018,_0x3e2ee){if(_0x338018['body']['id']){delete _0x338018['body']['id'];}return db[_0xa55e('0x2b')]['find']({'where':{'id':_0x338018[_0xa55e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e2ee,null))[_0xa55e('0x24')](saveUpdates(_0x338018[_0xa55e('0x48')],null))[_0xa55e('0x24')](respondWithResult(_0x3e2ee,null))[_0xa55e('0x43')](handleError(_0x3e2ee,null));};exports[_0xa55e('0x25')]=function(_0x63aa32,_0x1a1053){return db[_0xa55e('0x2b')]['find']({'where':{'id':_0x63aa32[_0xa55e('0x45')]['id']}})[_0xa55e('0x24')](handleEntityNotFound(_0x1a1053,null))[_0xa55e('0x24')](removeEntity(_0x1a1053,null))[_0xa55e('0x43')](handleError(_0x1a1053,null));};exports[_0xa55e('0x4a')]=function(_0x26d73c,_0x50bc5b,_0x1997d1){var _0x30e8cd={};var _0x42c00c={};var _0xb8d151;var _0x4559c8;return db[_0xa55e('0x2b')]['findOne']({'where':{'id':_0x26d73c[_0xa55e('0x45')]['id']}})['then'](handleEntityNotFound(_0x50bc5b,null))[_0xa55e('0x24')](function(_0x17b18b){if(_0x17b18b){_0xb8d151=_0x17b18b;_0x42c00c[_0xa55e('0x36')]=_[_0xa55e('0x2f')](db[_0xa55e('0x4b')][_0xa55e('0x46')]);_0x42c00c['query']=_[_0xa55e('0x2f')](_0x26d73c['query']);_0x42c00c[_0xa55e('0x31')]=_[_0xa55e('0x32')](_0x42c00c['model'],_0x42c00c[_0xa55e('0x30')]);_0x30e8cd[_0xa55e('0x34')]=_[_0xa55e('0x32')](_0x42c00c[_0xa55e('0x36')],qs[_0xa55e('0x33')](_0x26d73c[_0xa55e('0x30')][_0xa55e('0x33')]));_0x30e8cd['attributes']=_0x30e8cd[_0xa55e('0x34')][_0xa55e('0x35')]?_0x30e8cd[_0xa55e('0x34')]:_0x42c00c['model'];_0x30e8cd[_0xa55e('0x38')]=qs[_0xa55e('0x39')](_0x26d73c[_0xa55e('0x30')]['sort']);_0x30e8cd[_0xa55e('0x3a')]=qs[_0xa55e('0x31')](_[_0xa55e('0x3b')](_0x26d73c[_0xa55e('0x30')],_0x42c00c[_0xa55e('0x31')]));if(_0x26d73c[_0xa55e('0x30')][_0xa55e('0x3c')]){_0x30e8cd[_0xa55e('0x3a')]=_[_0xa55e('0x3d')](_0x30e8cd[_0xa55e('0x3a')],{'$or':_[_0xa55e('0x2a')](_0x30e8cd['attributes'],function(_0x36d5ec){var _0x50eb02={};_0x50eb02[_0x36d5ec]={'$like':'%'+_0x26d73c[_0xa55e('0x30')][_0xa55e('0x3c')]+'%'};return _0x50eb02;})});}_0x30e8cd=_[_0xa55e('0x3d')]({},_0x30e8cd,_0x26d73c[_0xa55e('0x3f')]);return _0xb8d151[_0xa55e('0x4a')](_0x30e8cd);}})[_0xa55e('0x24')](function(_0x16da89){if(_0x16da89){_0x4559c8=_0x16da89[_0xa55e('0x35')];if(!_0x26d73c[_0xa55e('0x30')][_0xa55e('0x37')](_0xa55e('0x4c'))){_0x30e8cd[_0xa55e('0x1d')]=qs[_0xa55e('0x1d')](_0x26d73c[_0xa55e('0x30')][_0xa55e('0x1d')]);_0x30e8cd[_0xa55e('0x1c')]=qs['offset'](_0x26d73c['query'][_0xa55e('0x1c')]);}return _0xb8d151[_0xa55e('0x4a')](_0x30e8cd);}})[_0xa55e('0x24')](function(_0x1b5088){if(_0x1b5088){return _0x1b5088?{'count':_0x4559c8,'rows':_0x1b5088}:null;}})['then'](respondWithResult(_0x50bc5b,null))['catch'](handleError(_0x50bc5b,null));};exports[_0xa55e('0x4d')]=function(_0x4bbe66,_0x4c0483,_0x599017){if(_0x4bbe66[_0xa55e('0x48')]['id']){delete _0x4bbe66[_0xa55e('0x48')]['id'];}return db[_0xa55e('0x2b')][_0xa55e('0x4e')]({'where':{'id':_0x4bbe66[_0xa55e('0x45')]['id']}})[_0xa55e('0x24')](handleEntityNotFound(_0x4c0483,null))[_0xa55e('0x24')](function(_0x406689){if(_0x406689){_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x4f')]=_0x406689['id'];_0x4bbe66['body'][_0xa55e('0x50')]=integrations[_0xa55e('0x51')](_0x4bbe66[_0xa55e('0x48')]['channel'],_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x2d')]);_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x52')]=integrations['getDescriptions'](_0x4bbe66[_0xa55e('0x48')][_0xa55e('0x53')],_0x4bbe66[_0xa55e('0x48')]['type']);return db['FreshdeskConfiguration'][_0xa55e('0x47')](_0x4bbe66['body'],{'include':[{'model':db[_0xa55e('0x54')],'as':'Subjects'},{'model':db[_0xa55e('0x54')],'as':_0xa55e('0x52')}]});}return null;})['then'](respondWithResult(_0x4c0483,null))[_0xa55e('0x43')](handleError(_0x4c0483,null));};exports['getFields']=function(_0x44545e,_0x3b5cf0,_0x515100){var _0x28456a='';return db[_0xa55e('0x2b')][_0xa55e('0x4e')]({'where':{'id':_0x44545e[_0xa55e('0x45')]['id']},'attributes':['id',_0xa55e('0x55'),_0xa55e('0x56')]})[_0xa55e('0x24')](handleEntityNotFound(_0x3b5cf0,null))[_0xa55e('0x24')](function(_0x4cfd5e){if(_0x4cfd5e){_0x28456a=_0x4cfd5e[_0xa55e('0x55')];var _0x223951=_0x28456a['slice'](-0x1);if(_0x223951==='/'){_0x28456a=_0x28456a[_0xa55e('0x57')](0x0,_0x28456a[_0xa55e('0x58')](_0x223951));}return rp({'method':'GET','uri':util['format']('%s/%s',_0x28456a,_0xa55e('0x59')),'headers':{'Authorization':util[_0xa55e('0x5a')](_0xa55e('0x5b'),new Buffer(util[_0xa55e('0x5a')](_0xa55e('0x5c'),_0x4cfd5e[_0xa55e('0x56')]))['toString'](_0xa55e('0x5d')))},'json':!![]});}})[_0xa55e('0x24')](function(_0x16dc94){if(_0x16dc94){var _0x13dbbc=['requester',_0xa55e('0x5e'),_0xa55e('0x5f'),_0xa55e('0x60'),_0xa55e('0x19'),_0xa55e('0x61'),_0xa55e('0x62'),_0xa55e('0x63'),_0xa55e('0x64'),_0xa55e('0x62'),_0xa55e('0x65')];_['remove'](_0x16dc94,function(_0xb2b3b1){return _0x13dbbc['includes'](_0xb2b3b1[_0xa55e('0x28')])||!_0xb2b3b1[_0xa55e('0x66')]&&_0xb2b3b1[_0xa55e('0x2d')]!==_0xa55e('0x67')&&_0xb2b3b1['type']!==_0xa55e('0x68');});return{'count':_0x16dc94[_0xa55e('0x35')],'rows':_[_0xa55e('0x2a')](_0x16dc94,function(_0x35fdc6){return{'id':_0x35fdc6['name'],'name':_0x35fdc6[_0xa55e('0x69')],'custom':!_0x35fdc6['default'],'options':_0x35fdc6[_0xa55e('0x6a')]?_[_0xa55e('0x2a')](_0x35fdc6['choices'],function(_0x758465){return{'name':_['capitalize'](_0x758465),'value':_0x758465};}):[]};})};}})[_0xa55e('0x24')](respondWithResult(_0x3b5cf0,null))[_0xa55e('0x43')](function(_0x4fcdae){var _0x581ec2=_0x44545e[_0xa55e('0x30')][_0xa55e('0x6b')]?0x1f4:_0x4fcdae[_0xa55e('0x6c')]||0x1f4;logger['error'](_0xa55e('0x6d'),_0xa55e('0x6e'),_0x581ec2,JSON['stringify'](_0x4fcdae));delete _0x4fcdae[_0xa55e('0x28')];if(_0x581ec2===0x191){_0x581ec2=0x190;}_0x3b5cf0[_0xa55e('0x19')](_0x581ec2)['send'](_0x44545e[_0xa55e('0x30')][_0xa55e('0x6b')]?{'message':_0xa55e('0x6f'),'statusCode':_0x4fcdae['statusCode']}:_0x4fcdae);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6d6a7ec..cc97b79 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 _0x3f77=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util'];(function(_0x4939e6,_0x467dec){var _0x4ef8c3=function(_0x2e8d32){while(--_0x2e8d32){_0x4939e6['push'](_0x4939e6['shift']());}};_0x4ef8c3(++_0x467dec);}(_0x3f77,0x1d2));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x73f7('0x0'));var util=require(_0x73f7('0x1'));var logger=require(_0x73f7('0x2'))(_0x73f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73f7('0x4'));var fs=require('fs');var path=require(_0x73f7('0x5'));var rimraf=require(_0x73f7('0x6'));var config=require(_0x73f7('0x7'));var attributes=require(_0x73f7('0x8'));var integrations=require(_0x73f7('0x9'));module[_0x73f7('0xa')]=function(_0x1cdf4d,_0x460137){return _0x1cdf4d[_0x73f7('0xb')](_0x73f7('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x517f=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x517f,0xa8));var _0xf517=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x517f[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0xf517('0x0'));var util=require(_0xf517('0x1'));var logger=require(_0xf517('0x2'))(_0xf517('0x3'));var moment=require(_0xf517('0x4'));var BPromise=require(_0xf517('0x5'));var rp=require(_0xf517('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf517('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xf517('0x8'));module[_0xf517('0x9')]=function(_0x15bc44,_0x299997){return _0x15bc44['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 3fc938e..e17e607 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 _0xb315=['where','limit','include','map','model','attributes','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshdeskAccount','options'];(function(_0x480a07,_0x2147f2){var _0xed5d11=function(_0x76863e){while(--_0x76863e){_0x480a07['push'](_0x480a07['shift']());}};_0xed5d11(++_0x2147f2);}(_0xb315,0x1a2));var _0x5b31=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xb315[_0x2136d5];return _0x3bee2e;};'use strict';var _=require(_0x5b31('0x0'));var util=require(_0x5b31('0x1'));var moment=require(_0x5b31('0x2'));var BPromise=require(_0x5b31('0x3'));var rs=require(_0x5b31('0x4'));var fs=require('fs');var Redis=require(_0x5b31('0x5'));var db=require(_0x5b31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b31('0x7'))(_0x5b31('0x8'));var config=require(_0x5b31('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5b31('0xa')][_0x5b31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2866c0,_0x13be2c,_0x4b8de1){return new BPromise(function(_0x142cd9,_0x30008d){return client['request'](_0x2866c0,_0x4b8de1)[_0x5b31('0xc')](function(_0x414efc){logger[_0x5b31('0xd')](_0x5b31('0xe'),_0x13be2c,_0x5b31('0xf'));logger[_0x5b31('0x10')](_0x5b31('0x11'),_0x13be2c,_0x5b31('0xf'),JSON['stringify'](_0x414efc));if(_0x414efc['error']){if(_0x414efc[_0x5b31('0x12')][_0x5b31('0x13')]===0x1f4){logger[_0x5b31('0x12')](_0x5b31('0xe'),_0x13be2c,_0x414efc['error']['message']);return _0x30008d(_0x414efc[_0x5b31('0x12')][_0x5b31('0x14')]);}logger['error'](_0x5b31('0xe'),_0x13be2c,_0x414efc[_0x5b31('0x12')][_0x5b31('0x14')]);return _0x142cd9(_0x414efc['error'][_0x5b31('0x14')]);}else{logger[_0x5b31('0xd')](_0x5b31('0xe'),_0x13be2c,_0x5b31('0xf'));_0x142cd9(_0x414efc['result'][_0x5b31('0x14')]);}})[_0x5b31('0x15')](function(_0x179753){logger[_0x5b31('0x12')](_0x5b31('0xe'),_0x13be2c,_0x179753);_0x30008d(_0x179753);});});}exports[_0x5b31('0x16')]=function(_0x15a665){var _0xecbdb=this;return new Promise(function(_0x50ec64,_0x152c2e){return db['FreshdeskAccount']['findAll']({'raw':_0x15a665['options']?_0x15a665[_0x5b31('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x15a665[_0x5b31('0x17')]?_0x15a665[_0x5b31('0x17')][_0x5b31('0x18')]||null:null,'attributes':_0x15a665[_0x5b31('0x17')]?_0x15a665[_0x5b31('0x17')]['attributes']||null:null,'limit':_0x15a665[_0x5b31('0x17')]?_0x15a665[_0x5b31('0x17')][_0x5b31('0x19')]||null:null,'include':_0x15a665[_0x5b31('0x17')]?_0x15a665['options'][_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x15a665[_0x5b31('0x17')][_0x5b31('0x1a')],function(_0x377ef8){return{'model':db[_0x377ef8[_0x5b31('0x1c')]],'as':_0x377ef8['as'],'attributes':_0x377ef8['attributes'],'include':_0x377ef8[_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x377ef8[_0x5b31('0x1a')],function(_0x5670ae){return{'model':db[_0x5670ae[_0x5b31('0x1c')]],'as':_0x5670ae['as'],'attributes':_0x5670ae[_0x5b31('0x1d')],'include':_0x5670ae[_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x5670ae[_0x5b31('0x1a')],function(_0x339915){return{'model':db[_0x339915[_0x5b31('0x1c')]],'as':_0x339915['as'],'attributes':_0x339915[_0x5b31('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b31('0xc')](function(_0x2a3cc9){logger[_0x5b31('0xd')]('GetFreshdeskAccount',_0x15a665);logger['debug'](_0x5b31('0x16'),_0x15a665,JSON[_0x5b31('0x1e')](_0x2a3cc9));_0x50ec64(_0x2a3cc9);})[_0x5b31('0x15')](function(_0x3caa38){logger[_0x5b31('0x12')]('GetFreshdeskAccount',_0x3caa38[_0x5b31('0x14')],_0x15a665);_0x152c2e(_0xecbdb[_0x5b31('0x12')](0x1f4,_0x3caa38[_0x5b31('0x14')]));});});};exports[_0x5b31('0x1f')]=function(_0x1461f8){var _0x2fd83b=this;return new Promise(function(_0x4e5b80,_0x3b8b22){return db[_0x5b31('0x20')][_0x5b31('0x21')]({'raw':_0x1461f8['options']?_0x1461f8[_0x5b31('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1461f8[_0x5b31('0x17')]?_0x1461f8[_0x5b31('0x17')][_0x5b31('0x18')]||null:null,'attributes':_0x1461f8[_0x5b31('0x17')]?_0x1461f8[_0x5b31('0x17')][_0x5b31('0x1d')]||null:null,'include':_0x1461f8[_0x5b31('0x17')]?_0x1461f8[_0x5b31('0x17')][_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x1461f8[_0x5b31('0x17')][_0x5b31('0x1a')],function(_0x2abdc1){return{'model':db[_0x2abdc1[_0x5b31('0x1c')]],'as':_0x2abdc1['as'],'attributes':_0x2abdc1[_0x5b31('0x1d')],'include':_0x2abdc1[_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x2abdc1[_0x5b31('0x1a')],function(_0x2f7e2e){return{'model':db[_0x2f7e2e[_0x5b31('0x1c')]],'as':_0x2f7e2e['as'],'attributes':_0x2f7e2e[_0x5b31('0x1d')],'include':_0x2f7e2e[_0x5b31('0x1a')]?_[_0x5b31('0x1b')](_0x2f7e2e['include'],function(_0x4bfae2){return{'model':db[_0x4bfae2[_0x5b31('0x1c')]],'as':_0x4bfae2['as'],'attributes':_0x4bfae2[_0x5b31('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40d28b){logger[_0x5b31('0xd')](_0x5b31('0x1f'),_0x1461f8);logger[_0x5b31('0x10')](_0x5b31('0x1f'),_0x1461f8,JSON[_0x5b31('0x1e')](_0x40d28b));_0x4e5b80(_0x40d28b);})[_0x5b31('0x15')](function(_0x3db41a){logger[_0x5b31('0x12')](_0x5b31('0x1f'),_0x3db41a[_0x5b31('0x14')],_0x1461f8);_0x3b8b22(_0x2fd83b[_0x5b31('0x12')](0x1f4,_0x3db41a['message']));});});}; \ No newline at end of file +var _0x7d74=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','include','map','model','ShowFreshdeskAccount','where','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x406053,_0x3366c7){var _0x2d1875=function(_0x1eb73f){while(--_0x1eb73f){_0x406053['push'](_0x406053['shift']());}};_0x2d1875(++_0x3366c7);}(_0x7d74,0x172));var _0x47d7=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x7d74[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x47d7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x47d7('0x1'));var fs=require('fs');var Redis=require(_0x47d7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x47d7('0x3'));var logger=require(_0x47d7('0x4'))(_0x47d7('0x5'));var config=require(_0x47d7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x47d7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x532edd,_0x2ae103,_0x43e2fd){return new BPromise(function(_0x15cf17,_0x291003){return client[_0x47d7('0x8')](_0x532edd,_0x43e2fd)[_0x47d7('0x9')](function(_0x5c2811){logger[_0x47d7('0xa')](_0x47d7('0xb'),_0x2ae103,_0x47d7('0xc'));logger[_0x47d7('0xd')](_0x47d7('0xe'),_0x2ae103,_0x47d7('0xc'),JSON[_0x47d7('0xf')](_0x5c2811));if(_0x5c2811[_0x47d7('0x10')]){if(_0x5c2811[_0x47d7('0x10')][_0x47d7('0x11')]===0x1f4){logger['error'](_0x47d7('0xb'),_0x2ae103,_0x5c2811[_0x47d7('0x10')][_0x47d7('0x12')]);return _0x291003(_0x5c2811[_0x47d7('0x10')][_0x47d7('0x12')]);}logger[_0x47d7('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x2ae103,_0x5c2811[_0x47d7('0x10')][_0x47d7('0x12')]);return _0x15cf17(_0x5c2811['error'][_0x47d7('0x12')]);}else{logger['info'](_0x47d7('0xb'),_0x2ae103,'request\x20sent');_0x15cf17(_0x5c2811[_0x47d7('0x13')][_0x47d7('0x12')]);}})[_0x47d7('0x14')](function(_0x482fb6){logger[_0x47d7('0x10')](_0x47d7('0xb'),_0x2ae103,_0x482fb6);_0x291003(_0x482fb6);});});}exports[_0x47d7('0x15')]=function(_0x161be3){var _0x545af2=this;return new Promise(function(_0x2b6312,_0x3abb01){return db[_0x47d7('0x16')][_0x47d7('0x17')]({'raw':_0x161be3[_0x47d7('0x18')]?_0x161be3[_0x47d7('0x18')][_0x47d7('0x19')]===undefined?!![]:![]:!![],'where':_0x161be3[_0x47d7('0x18')]?_0x161be3[_0x47d7('0x18')]['where']||null:null,'attributes':_0x161be3[_0x47d7('0x18')]?_0x161be3[_0x47d7('0x18')][_0x47d7('0x1a')]||null:null,'limit':_0x161be3['options']?_0x161be3[_0x47d7('0x18')]['limit']||null:null,'include':_0x161be3[_0x47d7('0x18')]?_0x161be3[_0x47d7('0x18')][_0x47d7('0x1b')]?_[_0x47d7('0x1c')](_0x161be3[_0x47d7('0x18')][_0x47d7('0x1b')],function(_0x37b5c){return{'model':db[_0x37b5c[_0x47d7('0x1d')]],'as':_0x37b5c['as'],'attributes':_0x37b5c['attributes'],'include':_0x37b5c[_0x47d7('0x1b')]?_[_0x47d7('0x1c')](_0x37b5c[_0x47d7('0x1b')],function(_0x464407){return{'model':db[_0x464407[_0x47d7('0x1d')]],'as':_0x464407['as'],'attributes':_0x464407[_0x47d7('0x1a')],'include':_0x464407[_0x47d7('0x1b')]?_[_0x47d7('0x1c')](_0x464407[_0x47d7('0x1b')],function(_0x41e555){return{'model':db[_0x41e555[_0x47d7('0x1d')]],'as':_0x41e555['as'],'attributes':_0x41e555[_0x47d7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47d7('0x9')](function(_0x3a46e1){logger['info']('GetFreshdeskAccount',_0x161be3);logger[_0x47d7('0xd')]('GetFreshdeskAccount',_0x161be3,JSON[_0x47d7('0xf')](_0x3a46e1));_0x2b6312(_0x3a46e1);})[_0x47d7('0x14')](function(_0x497e16){logger['error'](_0x47d7('0x15'),_0x497e16[_0x47d7('0x12')],_0x161be3);_0x3abb01(_0x545af2[_0x47d7('0x10')](0x1f4,_0x497e16['message']));});});};exports[_0x47d7('0x1e')]=function(_0x4a9394){var _0x2c9447=this;return new Promise(function(_0x5761b1,_0x376fbd){return db[_0x47d7('0x16')]['find']({'raw':_0x4a9394[_0x47d7('0x18')]?_0x4a9394[_0x47d7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a9394[_0x47d7('0x18')]?_0x4a9394[_0x47d7('0x18')][_0x47d7('0x1f')]||null:null,'attributes':_0x4a9394['options']?_0x4a9394[_0x47d7('0x18')]['attributes']||null:null,'include':_0x4a9394[_0x47d7('0x18')]?_0x4a9394[_0x47d7('0x18')][_0x47d7('0x1b')]?_['map'](_0x4a9394[_0x47d7('0x18')]['include'],function(_0x7f753){return{'model':db[_0x7f753[_0x47d7('0x1d')]],'as':_0x7f753['as'],'attributes':_0x7f753[_0x47d7('0x1a')],'include':_0x7f753[_0x47d7('0x1b')]?_[_0x47d7('0x1c')](_0x7f753[_0x47d7('0x1b')],function(_0x1d98f2){return{'model':db[_0x1d98f2['model']],'as':_0x1d98f2['as'],'attributes':_0x1d98f2[_0x47d7('0x1a')],'include':_0x1d98f2[_0x47d7('0x1b')]?_['map'](_0x1d98f2[_0x47d7('0x1b')],function(_0x3e0328){return{'model':db[_0x3e0328[_0x47d7('0x1d')]],'as':_0x3e0328['as'],'attributes':_0x3e0328[_0x47d7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbefa52){logger[_0x47d7('0xa')](_0x47d7('0x1e'),_0x4a9394);logger[_0x47d7('0xd')]('ShowFreshdeskAccount',_0x4a9394,JSON['stringify'](_0xbefa52));_0x5761b1(_0xbefa52);})['catch'](function(_0x9d0677){logger[_0x47d7('0x10')]('ShowFreshdeskAccount',_0x9d0677[_0x47d7('0x12')],_0x4a9394);_0x376fbd(_0x2c9447[_0x47d7('0x10')](0x1f4,_0x9d0677[_0x47d7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c623918..a598b3c 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 _0xc9a7=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x226aea,_0x78e3ed){var _0x229e93=function(_0x2166a9){while(--_0x2166a9){_0x226aea['push'](_0x226aea['shift']());}};_0x229e93(++_0x78e3ed);}(_0xc9a7,0x17a));var _0x7c9a=function(_0x217929,_0x478108){_0x217929=_0x217929-0x0;var _0x46fba3=_0xc9a7[_0x217929];return _0x46fba3;};'use strict';var multer=require(_0x7c9a('0x0'));var util=require(_0x7c9a('0x1'));var path=require(_0x7c9a('0x2'));var timeout=require(_0x7c9a('0x3'));var express=require('express');var router=express[_0x7c9a('0x4')]();var fs_extra=require(_0x7c9a('0x5'));var auth=require(_0x7c9a('0x6'));var interaction=require(_0x7c9a('0x7'));var config=require('../../config/environment');var controller=require(_0x7c9a('0x8'));router[_0x7c9a('0x9')]('/',auth[_0x7c9a('0xa')](),controller[_0x7c9a('0xb')]);router['get'](_0x7c9a('0xc'),auth[_0x7c9a('0xa')](),controller[_0x7c9a('0xd')]);router['get'](_0x7c9a('0xe'),auth[_0x7c9a('0xa')](),controller[_0x7c9a('0xf')]);router['get'](_0x7c9a('0x10'),auth[_0x7c9a('0xa')](),controller['getSubjects']);router[_0x7c9a('0x9')](_0x7c9a('0x11'),auth[_0x7c9a('0xa')](),controller[_0x7c9a('0x12')]);router['get']('/:id/tags',auth[_0x7c9a('0xa')](),controller[_0x7c9a('0x13')]);router[_0x7c9a('0x14')]('/',auth[_0x7c9a('0xa')](),controller[_0x7c9a('0x15')]);router[_0x7c9a('0x14')]('/:id/tags',auth[_0x7c9a('0xa')](),controller[_0x7c9a('0x16')]);router[_0x7c9a('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7c9a('0x18')]);router[_0x7c9a('0x19')](_0x7c9a('0xc'),auth['isAuthenticated'](),controller[_0x7c9a('0x1a')]);module[_0x7c9a('0x1b')]=router; \ No newline at end of file +var _0xff3e=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy'];(function(_0x39aa5d,_0x4da2a7){var _0x1382c1=function(_0x64b590){while(--_0x64b590){_0x39aa5d['push'](_0x39aa5d['shift']());}};_0x1382c1(++_0x4da2a7);}(_0xff3e,0x160));var _0xeff3=function(_0x25d533,_0x3770e2){_0x25d533=_0x25d533-0x0;var _0x4686c5=_0xff3e[_0x25d533];return _0x4686c5;};'use strict';var multer=require(_0xeff3('0x0'));var util=require(_0xeff3('0x1'));var path=require(_0xeff3('0x2'));var timeout=require(_0xeff3('0x3'));var express=require('express');var router=express[_0xeff3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeff3('0x5'));var config=require('../../config/environment');var controller=require(_0xeff3('0x6'));router[_0xeff3('0x7')]('/',auth[_0xeff3('0x8')](),controller[_0xeff3('0x9')]);router[_0xeff3('0x7')](_0xeff3('0xa'),auth[_0xeff3('0x8')](),controller[_0xeff3('0xb')]);router[_0xeff3('0x7')](_0xeff3('0xc'),auth[_0xeff3('0x8')](),controller[_0xeff3('0xd')]);router['get'](_0xeff3('0xe'),auth[_0xeff3('0x8')](),controller[_0xeff3('0xf')]);router[_0xeff3('0x7')]('/:id/descriptions',auth[_0xeff3('0x8')](),controller[_0xeff3('0x10')]);router['get']('/:id/tags',auth[_0xeff3('0x8')](),controller[_0xeff3('0x11')]);router[_0xeff3('0x12')]('/',auth[_0xeff3('0x8')](),controller[_0xeff3('0x13')]);router[_0xeff3('0x12')](_0xeff3('0x14'),auth[_0xeff3('0x8')](),controller[_0xeff3('0x15')]);router[_0xeff3('0x16')](_0xeff3('0xa'),auth['isAuthenticated'](),controller[_0xeff3('0x17')]);router[_0xeff3('0x18')](_0xeff3('0xa'),auth['isAuthenticated'](),controller[_0xeff3('0x19')]);module[_0xeff3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 873036b..636734d 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 _0x88bd=['sequelize','STRING'];(function(_0x45aa42,_0x9ea9ef){var _0x4bb335=function(_0x2130bc){while(--_0x2130bc){_0x45aa42['push'](_0x45aa42['shift']());}};_0x4bb335(++_0x9ea9ef);}(_0x88bd,0x1ca));var _0xd88b=function(_0x188d57,_0x848da0){_0x188d57=_0x188d57-0x0;var _0x137703=_0x88bd[_0x188d57];return _0x137703;};'use strict';var Sequelize=require(_0xd88b('0x0'));module['exports']={'name':{'type':Sequelize[_0xd88b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0a2e=['sequelize','STRING'];(function(_0x404a11,_0x268dc0){var _0x435823=function(_0x8bf3a){while(--_0x8bf3a){_0x404a11['push'](_0x404a11['shift']());}};_0x435823(++_0x268dc0);}(_0x0a2e,0x17e));var _0xe0a2=function(_0x187399,_0x40c56d){_0x187399=_0x187399-0x0;var _0x40fa92=_0x0a2e[_0x187399];return _0x40fa92;};'use strict';var Sequelize=require(_0xe0a2('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe0a2('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index be71aa4..1e0e9c7 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 _0xeb55=['include','findAll','rows','show','params','intersection','length','find','catch','body','update','getFields','findOne','FreshdeskField','options','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','then','destroy','error','name','FreshdeskConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeb55,0x151));var _0x5eb5=function(_0xb5a896,_0x50dcc1){_0xb5a896=_0xb5a896-0x0;var _0x58ac07=_0xeb55[_0xb5a896];return _0x58ac07;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eb5('0x0'));var zipdir=require(_0x5eb5('0x1'));var jsonpatch=require(_0x5eb5('0x2'));var rp=require(_0x5eb5('0x3'));var moment=require(_0x5eb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5eb5('0x5'));var ejs=require(_0x5eb5('0x6'));var fs=require('fs');var fs_extra=require(_0x5eb5('0x7'));var _=require(_0x5eb5('0x8'));var squel=require(_0x5eb5('0x9'));var crypto=require(_0x5eb5('0xa'));var jsforce=require(_0x5eb5('0xb'));var deskjs=require(_0x5eb5('0xc'));var toCsv=require(_0x5eb5('0x5'));var querystring=require(_0x5eb5('0xd'));var Papa=require('papaparse');var Redis=require(_0x5eb5('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5eb5('0xf'));var hardwareService=require(_0x5eb5('0x10'));var logger=require(_0x5eb5('0x11'))('api');var utils=require(_0x5eb5('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5eb5('0x13'));var db=require(_0x5eb5('0x14'))['db'];function respondWithStatusCode(_0x284731,_0x537f5a){_0x537f5a=_0x537f5a||0xcc;return function(_0x337e4f){if(_0x337e4f){return _0x284731[_0x5eb5('0x15')](_0x537f5a);}return _0x284731[_0x5eb5('0x16')](_0x537f5a)[_0x5eb5('0x17')]();};}function respondWithResult(_0x1f8800,_0x2af274){_0x2af274=_0x2af274||0xc8;return function(_0x2de3a1){if(_0x2de3a1){return _0x1f8800[_0x5eb5('0x16')](_0x2af274)['json'](_0x2de3a1);}};}function respondWithFilteredResult(_0x569a04,_0x393313){return function(_0x266e9b){if(_0x266e9b){var _0x48e34d=typeof _0x393313[_0x5eb5('0x18')]==='undefined'&&typeof _0x393313[_0x5eb5('0x19')]===_0x5eb5('0x1a');var _0x1923b2=_0x266e9b[_0x5eb5('0x1b')];var _0xad6808=_0x48e34d?0x0:_0x393313[_0x5eb5('0x18')];var _0x174283=_0x48e34d?_0x266e9b['count']:_0x393313[_0x5eb5('0x18')]+_0x393313[_0x5eb5('0x19')];var _0x1b85b9;if(_0x174283>=_0x1923b2){_0x174283=_0x1923b2;_0x1b85b9=0xc8;}else{_0x1b85b9=0xce;}_0x569a04[_0x5eb5('0x16')](_0x1b85b9);return _0x569a04[_0x5eb5('0x1c')](_0x5eb5('0x1d'),_0xad6808+'-'+_0x174283+'/'+_0x1923b2)[_0x5eb5('0x1e')](_0x266e9b);}return null;};}function patchUpdates(_0x46932b){return function(_0x4106ef){try{jsonpatch['apply'](_0x4106ef,_0x46932b,!![]);}catch(_0x2911d5){return BPromise[_0x5eb5('0x1f')](_0x2911d5);}return _0x4106ef['save']();};}function saveUpdates(_0x59d505,_0x3110e9){return function(_0x335fe8){if(_0x335fe8){return _0x335fe8['update'](_0x59d505)[_0x5eb5('0x20')](function(_0x3f40c4){return _0x3f40c4;});}return null;};}function removeEntity(_0x7aadc8,_0x511f97){return function(_0x4a8b33){if(_0x4a8b33){return _0x4a8b33[_0x5eb5('0x21')]()[_0x5eb5('0x20')](function(){_0x7aadc8[_0x5eb5('0x16')](0xcc)[_0x5eb5('0x17')]();});}};}function handleEntityNotFound(_0x38d409,_0x535bc6){return function(_0xb92f47){if(!_0xb92f47){_0x38d409[_0x5eb5('0x15')](0x194);}return _0xb92f47;};}function handleError(_0x3c96a6,_0xd540fc){_0xd540fc=_0xd540fc||0x1f4;return function(_0x2c79b6){logger[_0x5eb5('0x22')](_0x2c79b6['stack']);if(_0x2c79b6[_0x5eb5('0x23')]){delete _0x2c79b6[_0x5eb5('0x23')];}_0x3c96a6['status'](_0xd540fc)['send'](_0x2c79b6);};}exports['index']=function(_0x1e1324,_0x4dfcae){var _0x5d02a5={},_0x35e076={},_0x22b1b4={'count':0x0,'rows':[]};var _0x1d44c2=_['map'](db[_0x5eb5('0x24')][_0x5eb5('0x25')],function(_0x4e4937){return{'name':_0x4e4937[_0x5eb5('0x26')],'type':_0x4e4937[_0x5eb5('0x27')][_0x5eb5('0x28')]};});_0x35e076['model']=_[_0x5eb5('0x29')](_0x1d44c2,_0x5eb5('0x23'));_0x35e076[_0x5eb5('0x2a')]=_[_0x5eb5('0x2b')](_0x1e1324[_0x5eb5('0x2a')]);_0x35e076[_0x5eb5('0x2c')]=_['intersection'](_0x35e076[_0x5eb5('0x2d')],_0x35e076[_0x5eb5('0x2a')]);_0x5d02a5[_0x5eb5('0x2e')]=_['intersection'](_0x35e076['model'],qs[_0x5eb5('0x2f')](_0x1e1324[_0x5eb5('0x2a')]['fields']));_0x5d02a5[_0x5eb5('0x2e')]=_0x5d02a5[_0x5eb5('0x2e')]['length']?_0x5d02a5[_0x5eb5('0x2e')]:_0x35e076[_0x5eb5('0x2d')];if(!_0x1e1324['query'][_0x5eb5('0x30')](_0x5eb5('0x31'))){_0x5d02a5[_0x5eb5('0x19')]=qs[_0x5eb5('0x19')](_0x1e1324['query']['limit']);_0x5d02a5[_0x5eb5('0x18')]=qs[_0x5eb5('0x18')](_0x1e1324[_0x5eb5('0x2a')][_0x5eb5('0x18')]);}_0x5d02a5[_0x5eb5('0x32')]=qs[_0x5eb5('0x33')](_0x1e1324[_0x5eb5('0x2a')]['sort']);_0x5d02a5[_0x5eb5('0x34')]=qs['filters'](_[_0x5eb5('0x35')](_0x1e1324[_0x5eb5('0x2a')],_0x35e076[_0x5eb5('0x2c')]),_0x1d44c2);if(_0x1e1324[_0x5eb5('0x2a')][_0x5eb5('0x36')]){_0x5d02a5[_0x5eb5('0x34')]=_[_0x5eb5('0x37')](_0x5d02a5[_0x5eb5('0x34')],{'$or':_[_0x5eb5('0x29')](_0x1d44c2,function(_0x319982){if(_0x319982[_0x5eb5('0x27')]!==_0x5eb5('0x38')){var _0x6348b9={};_0x6348b9[_0x319982['name']]={'$like':'%'+_0x1e1324[_0x5eb5('0x2a')][_0x5eb5('0x36')]+'%'};return _0x6348b9;}})});}_0x5d02a5=_['merge']({},_0x5d02a5,_0x1e1324['options']);var _0x378a66={'where':_0x5d02a5['where']};return db[_0x5eb5('0x24')][_0x5eb5('0x1b')](_0x378a66)[_0x5eb5('0x20')](function(_0x55369d){_0x22b1b4[_0x5eb5('0x1b')]=_0x55369d;if(_0x1e1324[_0x5eb5('0x2a')][_0x5eb5('0x39')]){_0x5d02a5[_0x5eb5('0x3a')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x5eb5('0x3b')](_0x5d02a5);})[_0x5eb5('0x20')](function(_0x3b066f){_0x22b1b4[_0x5eb5('0x3c')]=_0x3b066f;return _0x22b1b4;})['then'](respondWithFilteredResult(_0x4dfcae,_0x5d02a5))['catch'](handleError(_0x4dfcae,null));};exports[_0x5eb5('0x3d')]=function(_0x4f0ab5,_0x3d39c6){var _0x5c827f={'raw':![],'where':{'id':_0x4f0ab5[_0x5eb5('0x3e')]['id']}},_0x4cba1d={};_0x4cba1d[_0x5eb5('0x2d')]=_['keys'](db[_0x5eb5('0x24')]['rawAttributes']);_0x4cba1d[_0x5eb5('0x2a')]=_['keys'](_0x4f0ab5['query']);_0x4cba1d[_0x5eb5('0x2c')]=_[_0x5eb5('0x3f')](_0x4cba1d[_0x5eb5('0x2d')],_0x4cba1d['query']);_0x5c827f[_0x5eb5('0x2e')]=_[_0x5eb5('0x3f')](_0x4cba1d[_0x5eb5('0x2d')],qs[_0x5eb5('0x2f')](_0x4f0ab5[_0x5eb5('0x2a')][_0x5eb5('0x2f')]));_0x5c827f[_0x5eb5('0x2e')]=_0x5c827f[_0x5eb5('0x2e')][_0x5eb5('0x40')]?_0x5c827f['attributes']:_0x4cba1d[_0x5eb5('0x2d')];if(_0x4f0ab5[_0x5eb5('0x2a')][_0x5eb5('0x39')]){_0x5c827f[_0x5eb5('0x3a')]=[{'all':!![]}];}_0x5c827f=_['merge']({},_0x5c827f,_0x4f0ab5['options']);return db[_0x5eb5('0x24')][_0x5eb5('0x41')](_0x5c827f)[_0x5eb5('0x20')](handleEntityNotFound(_0x3d39c6,null))['then'](respondWithResult(_0x3d39c6,null))[_0x5eb5('0x42')](handleError(_0x3d39c6,null));};exports['create']=function(_0x5abca4,_0x48912a){return db[_0x5eb5('0x24')]['create'](_0x5abca4[_0x5eb5('0x43')],{})[_0x5eb5('0x20')](respondWithResult(_0x48912a,0xc9))[_0x5eb5('0x42')](handleError(_0x48912a,null));};exports[_0x5eb5('0x44')]=function(_0x54b99e,_0x3f5b36){if(_0x54b99e[_0x5eb5('0x43')]['id']){delete _0x54b99e['body']['id'];}return db[_0x5eb5('0x24')][_0x5eb5('0x41')]({'where':{'id':_0x54b99e['params']['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x3f5b36,null))[_0x5eb5('0x20')](saveUpdates(_0x54b99e['body'],null))[_0x5eb5('0x20')](respondWithResult(_0x3f5b36,null))[_0x5eb5('0x42')](handleError(_0x3f5b36,null));};exports['destroy']=function(_0x5dbec0,_0x467441){return db[_0x5eb5('0x24')][_0x5eb5('0x41')]({'where':{'id':_0x5dbec0[_0x5eb5('0x3e')]['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x467441,null))[_0x5eb5('0x20')](removeEntity(_0x467441,null))[_0x5eb5('0x42')](handleError(_0x467441,null));};exports[_0x5eb5('0x45')]=function(_0x307285,_0x546fad,_0x109541){var _0x5555c9={};var _0x1c2af0={};var _0x755e19;var _0x284b07;return db['FreshdeskConfiguration'][_0x5eb5('0x46')]({'where':{'id':_0x307285[_0x5eb5('0x3e')]['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x546fad,null))[_0x5eb5('0x20')](function(_0x463131){if(_0x463131){_0x755e19=_0x463131;_0x1c2af0['model']=_[_0x5eb5('0x2b')](db['FreshdeskField'][_0x5eb5('0x25')]);_0x1c2af0['query']=_[_0x5eb5('0x2b')](_0x307285['query']);_0x1c2af0[_0x5eb5('0x2c')]=_[_0x5eb5('0x3f')](_0x1c2af0[_0x5eb5('0x2d')],_0x1c2af0[_0x5eb5('0x2a')]);_0x5555c9[_0x5eb5('0x2e')]=_['intersection'](_0x1c2af0[_0x5eb5('0x2d')],qs[_0x5eb5('0x2f')](_0x307285[_0x5eb5('0x2a')][_0x5eb5('0x2f')]));_0x5555c9[_0x5eb5('0x2e')]=_0x5555c9[_0x5eb5('0x2e')][_0x5eb5('0x40')]?_0x5555c9[_0x5eb5('0x2e')]:_0x1c2af0[_0x5eb5('0x2d')];_0x5555c9[_0x5eb5('0x32')]=qs[_0x5eb5('0x33')](_0x307285[_0x5eb5('0x2a')][_0x5eb5('0x33')]);_0x5555c9[_0x5eb5('0x34')]=qs['filters'](_[_0x5eb5('0x35')](_0x307285[_0x5eb5('0x2a')],_0x1c2af0[_0x5eb5('0x2c')]));if(_0x307285[_0x5eb5('0x2a')][_0x5eb5('0x36')]){_0x5555c9[_0x5eb5('0x34')]=_[_0x5eb5('0x37')](_0x5555c9[_0x5eb5('0x34')],{'$or':_[_0x5eb5('0x29')](_0x5555c9['attributes'],function(_0x58b07a){var _0x32d227={};_0x32d227[_0x58b07a]={'$like':'%'+_0x307285['query'][_0x5eb5('0x36')]+'%'};return _0x32d227;})});}_0x5555c9=_[_0x5eb5('0x37')]({},_0x5555c9,_0x307285['options']);return _0x755e19[_0x5eb5('0x45')](_0x5555c9);}})[_0x5eb5('0x20')](function(_0x3cbf6f){if(_0x3cbf6f){_0x284b07=_0x3cbf6f[_0x5eb5('0x40')];if(!_0x307285[_0x5eb5('0x2a')][_0x5eb5('0x30')](_0x5eb5('0x31'))){_0x5555c9[_0x5eb5('0x19')]=qs[_0x5eb5('0x19')](_0x307285['query']['limit']);_0x5555c9[_0x5eb5('0x18')]=qs[_0x5eb5('0x18')](_0x307285['query'][_0x5eb5('0x18')]);}return _0x755e19[_0x5eb5('0x45')](_0x5555c9);}})['then'](function(_0x1dff68){if(_0x1dff68){return _0x1dff68?{'count':_0x284b07,'rows':_0x1dff68}:null;}})[_0x5eb5('0x20')](respondWithResult(_0x546fad,null))[_0x5eb5('0x42')](handleError(_0x546fad,null));};exports['getSubjects']=function(_0x4dee37,_0x311cf3,_0x42accc){var _0xbe3173={};var _0x28d78a={};var _0x25d617;var _0x1daace;return db[_0x5eb5('0x24')][_0x5eb5('0x46')]({'where':{'id':_0x4dee37[_0x5eb5('0x3e')]['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x311cf3,null))['then'](function(_0x2fca6f){if(_0x2fca6f){_0x25d617=_0x2fca6f;_0x28d78a['model']=_[_0x5eb5('0x2b')](db[_0x5eb5('0x47')][_0x5eb5('0x25')]);_0x28d78a[_0x5eb5('0x2a')]=_[_0x5eb5('0x2b')](_0x4dee37['query']);_0x28d78a[_0x5eb5('0x2c')]=_[_0x5eb5('0x3f')](_0x28d78a[_0x5eb5('0x2d')],_0x28d78a[_0x5eb5('0x2a')]);_0xbe3173[_0x5eb5('0x2e')]=_[_0x5eb5('0x3f')](_0x28d78a[_0x5eb5('0x2d')],qs[_0x5eb5('0x2f')](_0x4dee37[_0x5eb5('0x2a')]['fields']));_0xbe3173[_0x5eb5('0x2e')]=_0xbe3173[_0x5eb5('0x2e')][_0x5eb5('0x40')]?_0xbe3173[_0x5eb5('0x2e')]:_0x28d78a[_0x5eb5('0x2d')];_0xbe3173['order']=qs['sort'](_0x4dee37[_0x5eb5('0x2a')][_0x5eb5('0x33')]);_0xbe3173[_0x5eb5('0x34')]=qs[_0x5eb5('0x2c')](_[_0x5eb5('0x35')](_0x4dee37[_0x5eb5('0x2a')],_0x28d78a[_0x5eb5('0x2c')]));if(_0x4dee37[_0x5eb5('0x2a')]['filter']){_0xbe3173[_0x5eb5('0x34')]=_[_0x5eb5('0x37')](_0xbe3173[_0x5eb5('0x34')],{'$or':_[_0x5eb5('0x29')](_0xbe3173[_0x5eb5('0x2e')],function(_0x45d52d){var _0x571d92={};_0x571d92[_0x45d52d]={'$like':'%'+_0x4dee37[_0x5eb5('0x2a')]['filter']+'%'};return _0x571d92;})});}_0xbe3173=_[_0x5eb5('0x37')]({},_0xbe3173,_0x4dee37[_0x5eb5('0x48')]);return _0x25d617[_0x5eb5('0x49')](_0xbe3173);}})[_0x5eb5('0x20')](function(_0x3749a0){if(_0x3749a0){_0x1daace=_0x3749a0['length'];if(!_0x4dee37[_0x5eb5('0x2a')][_0x5eb5('0x30')](_0x5eb5('0x31'))){_0xbe3173[_0x5eb5('0x19')]=qs['limit'](_0x4dee37['query'][_0x5eb5('0x19')]);_0xbe3173[_0x5eb5('0x18')]=qs['offset'](_0x4dee37[_0x5eb5('0x2a')][_0x5eb5('0x18')]);}return _0x25d617[_0x5eb5('0x49')](_0xbe3173);}})[_0x5eb5('0x20')](function(_0x2c7c44){if(_0x2c7c44){return _0x2c7c44?{'count':_0x1daace,'rows':_0x2c7c44}:null;}})[_0x5eb5('0x20')](respondWithResult(_0x311cf3,null))[_0x5eb5('0x42')](handleError(_0x311cf3,null));};exports[_0x5eb5('0x4a')]=function(_0x527c04,_0x24259e,_0x20ec33){var _0x327621={};var _0x3fad2e={};var _0x4adcf3;var _0x5391e0;return db[_0x5eb5('0x24')][_0x5eb5('0x46')]({'where':{'id':_0x527c04['params']['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x24259e,null))[_0x5eb5('0x20')](function(_0x1f3485){if(_0x1f3485){_0x4adcf3=_0x1f3485;_0x3fad2e['model']=_[_0x5eb5('0x2b')](db[_0x5eb5('0x47')][_0x5eb5('0x25')]);_0x3fad2e[_0x5eb5('0x2a')]=_['keys'](_0x527c04[_0x5eb5('0x2a')]);_0x3fad2e['filters']=_[_0x5eb5('0x3f')](_0x3fad2e[_0x5eb5('0x2d')],_0x3fad2e[_0x5eb5('0x2a')]);_0x327621[_0x5eb5('0x2e')]=_['intersection'](_0x3fad2e[_0x5eb5('0x2d')],qs[_0x5eb5('0x2f')](_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x2f')]));_0x327621[_0x5eb5('0x2e')]=_0x327621[_0x5eb5('0x2e')][_0x5eb5('0x40')]?_0x327621['attributes']:_0x3fad2e[_0x5eb5('0x2d')];_0x327621[_0x5eb5('0x32')]=qs[_0x5eb5('0x33')](_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x33')]);_0x327621['where']=qs[_0x5eb5('0x2c')](_[_0x5eb5('0x35')](_0x527c04[_0x5eb5('0x2a')],_0x3fad2e[_0x5eb5('0x2c')]));if(_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x36')]){_0x327621[_0x5eb5('0x34')]=_[_0x5eb5('0x37')](_0x327621[_0x5eb5('0x34')],{'$or':_[_0x5eb5('0x29')](_0x327621[_0x5eb5('0x2e')],function(_0x5897b4){var _0x937c65={};_0x937c65[_0x5897b4]={'$like':'%'+_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x36')]+'%'};return _0x937c65;})});}_0x327621=_[_0x5eb5('0x37')]({},_0x327621,_0x527c04['options']);return _0x4adcf3[_0x5eb5('0x4a')](_0x327621);}})[_0x5eb5('0x20')](function(_0x1a388e){if(_0x1a388e){_0x5391e0=_0x1a388e[_0x5eb5('0x40')];if(!_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x30')](_0x5eb5('0x31'))){_0x327621[_0x5eb5('0x19')]=qs[_0x5eb5('0x19')](_0x527c04[_0x5eb5('0x2a')][_0x5eb5('0x19')]);_0x327621[_0x5eb5('0x18')]=qs[_0x5eb5('0x18')](_0x527c04[_0x5eb5('0x2a')]['offset']);}return _0x4adcf3[_0x5eb5('0x4a')](_0x327621);}})[_0x5eb5('0x20')](function(_0x5362c6){if(_0x5362c6){return _0x5362c6?{'count':_0x5391e0,'rows':_0x5362c6}:null;}})['then'](respondWithResult(_0x24259e,null))[_0x5eb5('0x42')](handleError(_0x24259e,null));};exports[_0x5eb5('0x4b')]=function(_0x1aa1ae,_0x55cc1b,_0x234e7f){var _0x3c9ad7={};var _0x13b064={};var _0x24f49a;var _0x432f47;return db[_0x5eb5('0x24')][_0x5eb5('0x46')]({'where':{'id':_0x1aa1ae[_0x5eb5('0x3e')]['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x55cc1b,null))['then'](function(_0x35812c){if(_0x35812c){_0x24f49a=_0x35812c;_0x13b064['model']=_['keys'](db[_0x5eb5('0x4c')][_0x5eb5('0x25')]);_0x13b064['query']=_['keys'](_0x1aa1ae[_0x5eb5('0x2a')]);_0x13b064['filters']=_['intersection'](_0x13b064['model'],_0x13b064[_0x5eb5('0x2a')]);_0x3c9ad7[_0x5eb5('0x2e')]=_[_0x5eb5('0x3f')](_0x13b064[_0x5eb5('0x2d')],qs['fields'](_0x1aa1ae[_0x5eb5('0x2a')][_0x5eb5('0x2f')]));_0x3c9ad7['attributes']=_0x3c9ad7['attributes'][_0x5eb5('0x40')]?_0x3c9ad7[_0x5eb5('0x2e')]:_0x13b064[_0x5eb5('0x2d')];_0x3c9ad7[_0x5eb5('0x32')]=qs[_0x5eb5('0x33')](_0x1aa1ae[_0x5eb5('0x2a')][_0x5eb5('0x33')]);_0x3c9ad7[_0x5eb5('0x34')]=qs[_0x5eb5('0x2c')](_['pick'](_0x1aa1ae[_0x5eb5('0x2a')],_0x13b064[_0x5eb5('0x2c')]));if(_0x1aa1ae[_0x5eb5('0x2a')][_0x5eb5('0x36')]){_0x3c9ad7['where']=_[_0x5eb5('0x37')](_0x3c9ad7[_0x5eb5('0x34')],{'$or':_['map'](_0x3c9ad7[_0x5eb5('0x2e')],function(_0x499c28){var _0x21ad2a={};_0x21ad2a[_0x499c28]={'$like':'%'+_0x1aa1ae[_0x5eb5('0x2a')][_0x5eb5('0x36')]+'%'};return _0x21ad2a;})});}_0x3c9ad7=_[_0x5eb5('0x37')]({},_0x3c9ad7,_0x1aa1ae[_0x5eb5('0x48')]);return _0x24f49a['getTags'](_0x3c9ad7);}})['then'](function(_0x5ba3b1){if(_0x5ba3b1){_0x432f47=_0x5ba3b1['length'];if(!_0x1aa1ae[_0x5eb5('0x2a')]['hasOwnProperty'](_0x5eb5('0x31'))){_0x3c9ad7['limit']=qs[_0x5eb5('0x19')](_0x1aa1ae[_0x5eb5('0x2a')][_0x5eb5('0x19')]);_0x3c9ad7[_0x5eb5('0x18')]=qs[_0x5eb5('0x18')](_0x1aa1ae['query']['offset']);}return _0x24f49a[_0x5eb5('0x4b')](_0x3c9ad7);}})[_0x5eb5('0x20')](function(_0x4ec66f){if(_0x4ec66f){return _0x4ec66f?{'count':_0x432f47,'rows':_0x4ec66f}:null;}})[_0x5eb5('0x20')](respondWithResult(_0x55cc1b,null))[_0x5eb5('0x42')](handleError(_0x55cc1b,null));};exports[_0x5eb5('0x4d')]=function(_0x57d1e7,_0x5f0b52,_0x43eed5){if(_0x57d1e7['body']['id']){delete _0x57d1e7[_0x5eb5('0x43')]['id'];}return db[_0x5eb5('0x24')][_0x5eb5('0x46')]({'where':{'id':_0x57d1e7[_0x5eb5('0x3e')]['id']}})[_0x5eb5('0x20')](handleEntityNotFound(_0x5f0b52,null))['then'](function(_0x51eec3){if(_0x51eec3){return _0x51eec3[_0x5eb5('0x4d')](_0x57d1e7['body'][_0x5eb5('0x4e')]||[]);}return null;})[_0x5eb5('0x20')](respondWithResult(_0x5f0b52,null))['catch'](handleError(_0x5f0b52,null));}; \ No newline at end of file +var _0xa7a2=['includeAll','rows','params','keys','include','find','catch','create','body','getFields','findOne','FreshdeskField','order','map','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xa7a2,0x68));var _0x2a7a=function(_0xc329c4,_0x553e70){_0xc329c4=_0xc329c4-0x0;var _0x1cea65=_0xa7a2[_0xc329c4];return _0x1cea65;};'use strict';var emlformat=require(_0x2a7a('0x0'));var rimraf=require(_0x2a7a('0x1'));var zipdir=require(_0x2a7a('0x2'));var jsonpatch=require(_0x2a7a('0x3'));var rp=require(_0x2a7a('0x4'));var moment=require(_0x2a7a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a7a('0x6'));var path=require(_0x2a7a('0x7'));var sox=require(_0x2a7a('0x8'));var csv=require(_0x2a7a('0x9'));var ejs=require(_0x2a7a('0xa'));var fs=require('fs');var fs_extra=require(_0x2a7a('0xb'));var _=require('lodash');var squel=require(_0x2a7a('0xc'));var crypto=require(_0x2a7a('0xd'));var jsforce=require(_0x2a7a('0xe'));var deskjs=require(_0x2a7a('0xf'));var toCsv=require(_0x2a7a('0x9'));var querystring=require('querystring');var Papa=require(_0x2a7a('0x10'));var Redis=require(_0x2a7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2a7a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a7a('0x13'))('api');var utils=require(_0x2a7a('0x14'));var config=require(_0x2a7a('0x15'));var licenseUtil=require(_0x2a7a('0x16'));var db=require(_0x2a7a('0x17'))['db'];function respondWithStatusCode(_0x2c4f5e,_0x5cd319){_0x5cd319=_0x5cd319||0xcc;return function(_0x2dd0cb){if(_0x2dd0cb){return _0x2c4f5e[_0x2a7a('0x18')](_0x5cd319);}return _0x2c4f5e['status'](_0x5cd319)['end']();};}function respondWithResult(_0x5b7d72,_0x23ce05){_0x23ce05=_0x23ce05||0xc8;return function(_0x37e7cd){if(_0x37e7cd){return _0x5b7d72[_0x2a7a('0x19')](_0x23ce05)[_0x2a7a('0x1a')](_0x37e7cd);}};}function respondWithFilteredResult(_0x35a02c,_0x430368){return function(_0x4d7f2f){if(_0x4d7f2f){var _0x4d0eb2=typeof _0x430368['offset']===_0x2a7a('0x1b')&&typeof _0x430368['limit']===_0x2a7a('0x1b');var _0x47d0c3=_0x4d7f2f[_0x2a7a('0x1c')];var _0x4efc0c=_0x4d0eb2?0x0:_0x430368[_0x2a7a('0x1d')];var _0x2547b9=_0x4d0eb2?_0x4d7f2f[_0x2a7a('0x1c')]:_0x430368['offset']+_0x430368[_0x2a7a('0x1e')];var _0x5ad94b;if(_0x2547b9>=_0x47d0c3){_0x2547b9=_0x47d0c3;_0x5ad94b=0xc8;}else{_0x5ad94b=0xce;}_0x35a02c[_0x2a7a('0x19')](_0x5ad94b);return _0x35a02c[_0x2a7a('0x1f')](_0x2a7a('0x20'),_0x4efc0c+'-'+_0x2547b9+'/'+_0x47d0c3)[_0x2a7a('0x1a')](_0x4d7f2f);}return null;};}function patchUpdates(_0x25e8c2){return function(_0x35c9c8){try{jsonpatch[_0x2a7a('0x21')](_0x35c9c8,_0x25e8c2,!![]);}catch(_0x2e3c4d){return BPromise[_0x2a7a('0x22')](_0x2e3c4d);}return _0x35c9c8['save']();};}function saveUpdates(_0x2070ef,_0x183839){return function(_0x5a67f5){if(_0x5a67f5){return _0x5a67f5[_0x2a7a('0x23')](_0x2070ef)[_0x2a7a('0x24')](function(_0x71dd94){return _0x71dd94;});}return null;};}function removeEntity(_0x17ba88,_0xb43946){return function(_0x5a1c42){if(_0x5a1c42){return _0x5a1c42[_0x2a7a('0x25')]()[_0x2a7a('0x24')](function(){_0x17ba88[_0x2a7a('0x19')](0xcc)[_0x2a7a('0x26')]();});}};}function handleEntityNotFound(_0x3c3832,_0x48c706){return function(_0xe213b7){if(!_0xe213b7){_0x3c3832[_0x2a7a('0x18')](0x194);}return _0xe213b7;};}function handleError(_0x190892,_0x3989f9){_0x3989f9=_0x3989f9||0x1f4;return function(_0xcd8581){logger[_0x2a7a('0x27')](_0xcd8581[_0x2a7a('0x28')]);if(_0xcd8581[_0x2a7a('0x29')]){delete _0xcd8581[_0x2a7a('0x29')];}_0x190892[_0x2a7a('0x19')](_0x3989f9)[_0x2a7a('0x2a')](_0xcd8581);};}exports[_0x2a7a('0x2b')]=function(_0x2c00ec,_0x1462db){var _0x2f7d7a={},_0x190c37={},_0x5df9c0={'count':0x0,'rows':[]};var _0x3dee93=_['map'](db[_0x2a7a('0x2c')][_0x2a7a('0x2d')],function(_0x452801){return{'name':_0x452801[_0x2a7a('0x2e')],'type':_0x452801[_0x2a7a('0x2f')][_0x2a7a('0x30')]};});_0x190c37[_0x2a7a('0x31')]=_['map'](_0x3dee93,_0x2a7a('0x29'));_0x190c37[_0x2a7a('0x32')]=_['keys'](_0x2c00ec[_0x2a7a('0x32')]);_0x190c37[_0x2a7a('0x33')]=_[_0x2a7a('0x34')](_0x190c37[_0x2a7a('0x31')],_0x190c37[_0x2a7a('0x32')]);_0x2f7d7a[_0x2a7a('0x35')]=_[_0x2a7a('0x34')](_0x190c37['model'],qs[_0x2a7a('0x36')](_0x2c00ec['query'][_0x2a7a('0x36')]));_0x2f7d7a[_0x2a7a('0x35')]=_0x2f7d7a['attributes'][_0x2a7a('0x37')]?_0x2f7d7a[_0x2a7a('0x35')]:_0x190c37['model'];if(!_0x2c00ec['query']['hasOwnProperty'](_0x2a7a('0x38'))){_0x2f7d7a[_0x2a7a('0x1e')]=qs[_0x2a7a('0x1e')](_0x2c00ec['query'][_0x2a7a('0x1e')]);_0x2f7d7a[_0x2a7a('0x1d')]=qs[_0x2a7a('0x1d')](_0x2c00ec[_0x2a7a('0x32')][_0x2a7a('0x1d')]);}_0x2f7d7a['order']=qs[_0x2a7a('0x39')](_0x2c00ec[_0x2a7a('0x32')][_0x2a7a('0x39')]);_0x2f7d7a[_0x2a7a('0x3a')]=qs[_0x2a7a('0x33')](_[_0x2a7a('0x3b')](_0x2c00ec[_0x2a7a('0x32')],_0x190c37[_0x2a7a('0x33')]),_0x3dee93);if(_0x2c00ec[_0x2a7a('0x32')]['filter']){_0x2f7d7a[_0x2a7a('0x3a')]=_[_0x2a7a('0x3c')](_0x2f7d7a[_0x2a7a('0x3a')],{'$or':_['map'](_0x3dee93,function(_0xfad7dd){if(_0xfad7dd[_0x2a7a('0x2f')]!==_0x2a7a('0x3d')){var _0xe0508b={};_0xe0508b[_0xfad7dd['name']]={'$like':'%'+_0x2c00ec[_0x2a7a('0x32')][_0x2a7a('0x3e')]+'%'};return _0xe0508b;}})});}_0x2f7d7a=_[_0x2a7a('0x3c')]({},_0x2f7d7a,_0x2c00ec[_0x2a7a('0x3f')]);var _0x213f32={'where':_0x2f7d7a[_0x2a7a('0x3a')]};return db[_0x2a7a('0x2c')][_0x2a7a('0x1c')](_0x213f32)[_0x2a7a('0x24')](function(_0x2e97eb){_0x5df9c0[_0x2a7a('0x1c')]=_0x2e97eb;if(_0x2c00ec[_0x2a7a('0x32')][_0x2a7a('0x40')]){_0x2f7d7a['include']=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x2f7d7a);})['then'](function(_0x407d06){_0x5df9c0[_0x2a7a('0x41')]=_0x407d06;return _0x5df9c0;})[_0x2a7a('0x24')](respondWithFilteredResult(_0x1462db,_0x2f7d7a))['catch'](handleError(_0x1462db,null));};exports['show']=function(_0x50e131,_0x3e633d){var _0x45d39f={'raw':![],'where':{'id':_0x50e131[_0x2a7a('0x42')]['id']}},_0x197c67={};_0x197c67[_0x2a7a('0x31')]=_[_0x2a7a('0x43')](db['FreshdeskConfiguration'][_0x2a7a('0x2d')]);_0x197c67[_0x2a7a('0x32')]=_[_0x2a7a('0x43')](_0x50e131[_0x2a7a('0x32')]);_0x197c67[_0x2a7a('0x33')]=_[_0x2a7a('0x34')](_0x197c67['model'],_0x197c67[_0x2a7a('0x32')]);_0x45d39f[_0x2a7a('0x35')]=_['intersection'](_0x197c67[_0x2a7a('0x31')],qs['fields'](_0x50e131['query'][_0x2a7a('0x36')]));_0x45d39f[_0x2a7a('0x35')]=_0x45d39f[_0x2a7a('0x35')]['length']?_0x45d39f[_0x2a7a('0x35')]:_0x197c67[_0x2a7a('0x31')];if(_0x50e131['query'][_0x2a7a('0x40')]){_0x45d39f[_0x2a7a('0x44')]=[{'all':!![]}];}_0x45d39f=_[_0x2a7a('0x3c')]({},_0x45d39f,_0x50e131[_0x2a7a('0x3f')]);return db['FreshdeskConfiguration'][_0x2a7a('0x45')](_0x45d39f)[_0x2a7a('0x24')](handleEntityNotFound(_0x3e633d,null))[_0x2a7a('0x24')](respondWithResult(_0x3e633d,null))[_0x2a7a('0x46')](handleError(_0x3e633d,null));};exports[_0x2a7a('0x47')]=function(_0x5f2d8f,_0x214604){return db['FreshdeskConfiguration'][_0x2a7a('0x47')](_0x5f2d8f[_0x2a7a('0x48')],{})[_0x2a7a('0x24')](respondWithResult(_0x214604,0xc9))[_0x2a7a('0x46')](handleError(_0x214604,null));};exports[_0x2a7a('0x23')]=function(_0x20363e,_0x1e6507){if(_0x20363e[_0x2a7a('0x48')]['id']){delete _0x20363e['body']['id'];}return db[_0x2a7a('0x2c')][_0x2a7a('0x45')]({'where':{'id':_0x20363e['params']['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x1e6507,null))[_0x2a7a('0x24')](saveUpdates(_0x20363e['body'],null))[_0x2a7a('0x24')](respondWithResult(_0x1e6507,null))[_0x2a7a('0x46')](handleError(_0x1e6507,null));};exports['destroy']=function(_0x136ebd,_0x55016a){return db['FreshdeskConfiguration'][_0x2a7a('0x45')]({'where':{'id':_0x136ebd[_0x2a7a('0x42')]['id']}})['then'](handleEntityNotFound(_0x55016a,null))[_0x2a7a('0x24')](removeEntity(_0x55016a,null))['catch'](handleError(_0x55016a,null));};exports[_0x2a7a('0x49')]=function(_0x3cedb0,_0x174212,_0x3b3c87){var _0x50fa63={};var _0x4ffdf5={};var _0x370678;var _0x22dc36;return db[_0x2a7a('0x2c')][_0x2a7a('0x4a')]({'where':{'id':_0x3cedb0[_0x2a7a('0x42')]['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x174212,null))[_0x2a7a('0x24')](function(_0x2eb377){if(_0x2eb377){_0x370678=_0x2eb377;_0x4ffdf5[_0x2a7a('0x31')]=_[_0x2a7a('0x43')](db[_0x2a7a('0x4b')][_0x2a7a('0x2d')]);_0x4ffdf5[_0x2a7a('0x32')]=_[_0x2a7a('0x43')](_0x3cedb0[_0x2a7a('0x32')]);_0x4ffdf5[_0x2a7a('0x33')]=_[_0x2a7a('0x34')](_0x4ffdf5[_0x2a7a('0x31')],_0x4ffdf5[_0x2a7a('0x32')]);_0x50fa63[_0x2a7a('0x35')]=_[_0x2a7a('0x34')](_0x4ffdf5[_0x2a7a('0x31')],qs[_0x2a7a('0x36')](_0x3cedb0[_0x2a7a('0x32')][_0x2a7a('0x36')]));_0x50fa63[_0x2a7a('0x35')]=_0x50fa63['attributes']['length']?_0x50fa63[_0x2a7a('0x35')]:_0x4ffdf5['model'];_0x50fa63[_0x2a7a('0x4c')]=qs[_0x2a7a('0x39')](_0x3cedb0['query'][_0x2a7a('0x39')]);_0x50fa63['where']=qs['filters'](_['pick'](_0x3cedb0['query'],_0x4ffdf5[_0x2a7a('0x33')]));if(_0x3cedb0[_0x2a7a('0x32')][_0x2a7a('0x3e')]){_0x50fa63[_0x2a7a('0x3a')]=_[_0x2a7a('0x3c')](_0x50fa63[_0x2a7a('0x3a')],{'$or':_[_0x2a7a('0x4d')](_0x50fa63[_0x2a7a('0x35')],function(_0xc2c950){var _0x1adb49={};_0x1adb49[_0xc2c950]={'$like':'%'+_0x3cedb0[_0x2a7a('0x32')]['filter']+'%'};return _0x1adb49;})});}_0x50fa63=_[_0x2a7a('0x3c')]({},_0x50fa63,_0x3cedb0[_0x2a7a('0x3f')]);return _0x370678[_0x2a7a('0x49')](_0x50fa63);}})[_0x2a7a('0x24')](function(_0x244d0c){if(_0x244d0c){_0x22dc36=_0x244d0c[_0x2a7a('0x37')];if(!_0x3cedb0[_0x2a7a('0x32')][_0x2a7a('0x4e')](_0x2a7a('0x38'))){_0x50fa63['limit']=qs[_0x2a7a('0x1e')](_0x3cedb0['query'][_0x2a7a('0x1e')]);_0x50fa63[_0x2a7a('0x1d')]=qs[_0x2a7a('0x1d')](_0x3cedb0[_0x2a7a('0x32')][_0x2a7a('0x1d')]);}return _0x370678[_0x2a7a('0x49')](_0x50fa63);}})[_0x2a7a('0x24')](function(_0x5eae1e){if(_0x5eae1e){return _0x5eae1e?{'count':_0x22dc36,'rows':_0x5eae1e}:null;}})[_0x2a7a('0x24')](respondWithResult(_0x174212,null))[_0x2a7a('0x46')](handleError(_0x174212,null));};exports[_0x2a7a('0x4f')]=function(_0x18ee0f,_0x37b9fa,_0x52f7ad){var _0x4e559a={};var _0x15bab6={};var _0x104257;var _0x1ea439;return db[_0x2a7a('0x2c')][_0x2a7a('0x4a')]({'where':{'id':_0x18ee0f[_0x2a7a('0x42')]['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x37b9fa,null))[_0x2a7a('0x24')](function(_0x72880f){if(_0x72880f){_0x104257=_0x72880f;_0x15bab6[_0x2a7a('0x31')]=_[_0x2a7a('0x43')](db[_0x2a7a('0x4b')][_0x2a7a('0x2d')]);_0x15bab6['query']=_[_0x2a7a('0x43')](_0x18ee0f['query']);_0x15bab6[_0x2a7a('0x33')]=_[_0x2a7a('0x34')](_0x15bab6[_0x2a7a('0x31')],_0x15bab6['query']);_0x4e559a[_0x2a7a('0x35')]=_['intersection'](_0x15bab6['model'],qs[_0x2a7a('0x36')](_0x18ee0f[_0x2a7a('0x32')][_0x2a7a('0x36')]));_0x4e559a[_0x2a7a('0x35')]=_0x4e559a[_0x2a7a('0x35')][_0x2a7a('0x37')]?_0x4e559a[_0x2a7a('0x35')]:_0x15bab6['model'];_0x4e559a[_0x2a7a('0x4c')]=qs['sort'](_0x18ee0f['query']['sort']);_0x4e559a['where']=qs[_0x2a7a('0x33')](_[_0x2a7a('0x3b')](_0x18ee0f[_0x2a7a('0x32')],_0x15bab6[_0x2a7a('0x33')]));if(_0x18ee0f[_0x2a7a('0x32')]['filter']){_0x4e559a[_0x2a7a('0x3a')]=_[_0x2a7a('0x3c')](_0x4e559a[_0x2a7a('0x3a')],{'$or':_[_0x2a7a('0x4d')](_0x4e559a[_0x2a7a('0x35')],function(_0x2698ee){var _0x321a21={};_0x321a21[_0x2698ee]={'$like':'%'+_0x18ee0f['query']['filter']+'%'};return _0x321a21;})});}_0x4e559a=_[_0x2a7a('0x3c')]({},_0x4e559a,_0x18ee0f['options']);return _0x104257[_0x2a7a('0x4f')](_0x4e559a);}})[_0x2a7a('0x24')](function(_0x505256){if(_0x505256){_0x1ea439=_0x505256[_0x2a7a('0x37')];if(!_0x18ee0f['query'][_0x2a7a('0x4e')](_0x2a7a('0x38'))){_0x4e559a['limit']=qs[_0x2a7a('0x1e')](_0x18ee0f[_0x2a7a('0x32')][_0x2a7a('0x1e')]);_0x4e559a[_0x2a7a('0x1d')]=qs[_0x2a7a('0x1d')](_0x18ee0f['query'][_0x2a7a('0x1d')]);}return _0x104257[_0x2a7a('0x4f')](_0x4e559a);}})[_0x2a7a('0x24')](function(_0x120fa1){if(_0x120fa1){return _0x120fa1?{'count':_0x1ea439,'rows':_0x120fa1}:null;}})[_0x2a7a('0x24')](respondWithResult(_0x37b9fa,null))[_0x2a7a('0x46')](handleError(_0x37b9fa,null));};exports[_0x2a7a('0x50')]=function(_0x346e49,_0x41bb4e,_0x12bef8){var _0x53ca6a={};var _0xa35a7c={};var _0x679804;var _0x2798bd;return db[_0x2a7a('0x2c')][_0x2a7a('0x4a')]({'where':{'id':_0x346e49[_0x2a7a('0x42')]['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x41bb4e,null))[_0x2a7a('0x24')](function(_0x28ee83){if(_0x28ee83){_0x679804=_0x28ee83;_0xa35a7c[_0x2a7a('0x31')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0xa35a7c[_0x2a7a('0x32')]=_['keys'](_0x346e49[_0x2a7a('0x32')]);_0xa35a7c[_0x2a7a('0x33')]=_[_0x2a7a('0x34')](_0xa35a7c[_0x2a7a('0x31')],_0xa35a7c[_0x2a7a('0x32')]);_0x53ca6a['attributes']=_['intersection'](_0xa35a7c[_0x2a7a('0x31')],qs[_0x2a7a('0x36')](_0x346e49[_0x2a7a('0x32')]['fields']));_0x53ca6a['attributes']=_0x53ca6a[_0x2a7a('0x35')][_0x2a7a('0x37')]?_0x53ca6a[_0x2a7a('0x35')]:_0xa35a7c[_0x2a7a('0x31')];_0x53ca6a[_0x2a7a('0x4c')]=qs[_0x2a7a('0x39')](_0x346e49[_0x2a7a('0x32')][_0x2a7a('0x39')]);_0x53ca6a[_0x2a7a('0x3a')]=qs[_0x2a7a('0x33')](_[_0x2a7a('0x3b')](_0x346e49[_0x2a7a('0x32')],_0xa35a7c[_0x2a7a('0x33')]));if(_0x346e49['query'][_0x2a7a('0x3e')]){_0x53ca6a[_0x2a7a('0x3a')]=_['merge'](_0x53ca6a['where'],{'$or':_['map'](_0x53ca6a[_0x2a7a('0x35')],function(_0x490c80){var _0x1b9b6c={};_0x1b9b6c[_0x490c80]={'$like':'%'+_0x346e49[_0x2a7a('0x32')][_0x2a7a('0x3e')]+'%'};return _0x1b9b6c;})});}_0x53ca6a=_['merge']({},_0x53ca6a,_0x346e49[_0x2a7a('0x3f')]);return _0x679804['getDescriptions'](_0x53ca6a);}})[_0x2a7a('0x24')](function(_0x55949b){if(_0x55949b){_0x2798bd=_0x55949b[_0x2a7a('0x37')];if(!_0x346e49[_0x2a7a('0x32')]['hasOwnProperty'](_0x2a7a('0x38'))){_0x53ca6a[_0x2a7a('0x1e')]=qs['limit'](_0x346e49[_0x2a7a('0x32')]['limit']);_0x53ca6a['offset']=qs[_0x2a7a('0x1d')](_0x346e49[_0x2a7a('0x32')][_0x2a7a('0x1d')]);}return _0x679804[_0x2a7a('0x50')](_0x53ca6a);}})[_0x2a7a('0x24')](function(_0x2600ad){if(_0x2600ad){return _0x2600ad?{'count':_0x2798bd,'rows':_0x2600ad}:null;}})[_0x2a7a('0x24')](respondWithResult(_0x41bb4e,null))[_0x2a7a('0x46')](handleError(_0x41bb4e,null));};exports[_0x2a7a('0x51')]=function(_0xe0ddb6,_0x5b1227,_0x2782a9){var _0x38a449={};var _0x36293d={};var _0x381ce3;var _0x36f84d;return db['FreshdeskConfiguration'][_0x2a7a('0x4a')]({'where':{'id':_0xe0ddb6[_0x2a7a('0x42')]['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x5b1227,null))[_0x2a7a('0x24')](function(_0x57816c){if(_0x57816c){_0x381ce3=_0x57816c;_0x36293d[_0x2a7a('0x31')]=_[_0x2a7a('0x43')](db['Tag'][_0x2a7a('0x2d')]);_0x36293d[_0x2a7a('0x32')]=_[_0x2a7a('0x43')](_0xe0ddb6[_0x2a7a('0x32')]);_0x36293d['filters']=_[_0x2a7a('0x34')](_0x36293d[_0x2a7a('0x31')],_0x36293d['query']);_0x38a449['attributes']=_[_0x2a7a('0x34')](_0x36293d[_0x2a7a('0x31')],qs['fields'](_0xe0ddb6[_0x2a7a('0x32')][_0x2a7a('0x36')]));_0x38a449[_0x2a7a('0x35')]=_0x38a449[_0x2a7a('0x35')][_0x2a7a('0x37')]?_0x38a449[_0x2a7a('0x35')]:_0x36293d['model'];_0x38a449[_0x2a7a('0x4c')]=qs[_0x2a7a('0x39')](_0xe0ddb6['query'][_0x2a7a('0x39')]);_0x38a449['where']=qs[_0x2a7a('0x33')](_['pick'](_0xe0ddb6['query'],_0x36293d['filters']));if(_0xe0ddb6[_0x2a7a('0x32')]['filter']){_0x38a449['where']=_[_0x2a7a('0x3c')](_0x38a449[_0x2a7a('0x3a')],{'$or':_[_0x2a7a('0x4d')](_0x38a449[_0x2a7a('0x35')],function(_0x4aaa8b){var _0x5390fc={};_0x5390fc[_0x4aaa8b]={'$like':'%'+_0xe0ddb6[_0x2a7a('0x32')][_0x2a7a('0x3e')]+'%'};return _0x5390fc;})});}_0x38a449=_['merge']({},_0x38a449,_0xe0ddb6[_0x2a7a('0x3f')]);return _0x381ce3[_0x2a7a('0x51')](_0x38a449);}})[_0x2a7a('0x24')](function(_0x4bf9c1){if(_0x4bf9c1){_0x36f84d=_0x4bf9c1['length'];if(!_0xe0ddb6[_0x2a7a('0x32')][_0x2a7a('0x4e')](_0x2a7a('0x38'))){_0x38a449[_0x2a7a('0x1e')]=qs[_0x2a7a('0x1e')](_0xe0ddb6[_0x2a7a('0x32')][_0x2a7a('0x1e')]);_0x38a449[_0x2a7a('0x1d')]=qs[_0x2a7a('0x1d')](_0xe0ddb6[_0x2a7a('0x32')][_0x2a7a('0x1d')]);}return _0x381ce3['getTags'](_0x38a449);}})['then'](function(_0x132345){if(_0x132345){return _0x132345?{'count':_0x36f84d,'rows':_0x132345}:null;}})[_0x2a7a('0x24')](respondWithResult(_0x5b1227,null))[_0x2a7a('0x46')](handleError(_0x5b1227,null));};exports[_0x2a7a('0x52')]=function(_0x25b8f1,_0x569eb6,_0xeab3fa){if(_0x25b8f1[_0x2a7a('0x48')]['id']){delete _0x25b8f1[_0x2a7a('0x48')]['id'];}return db[_0x2a7a('0x2c')][_0x2a7a('0x4a')]({'where':{'id':_0x25b8f1[_0x2a7a('0x42')]['id']}})[_0x2a7a('0x24')](handleEntityNotFound(_0x569eb6,null))[_0x2a7a('0x24')](function(_0x1e440c){if(_0x1e440c){return _0x1e440c[_0x2a7a('0x52')](_0x25b8f1[_0x2a7a('0x48')][_0x2a7a('0x53')]||[]);}return null;})[_0x2a7a('0x24')](respondWithResult(_0x569eb6,null))[_0x2a7a('0x46')](handleError(_0x569eb6,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 187721f..50b1b94 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 _0x5ff7=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','moment','bluebird','path','../../config/environment','exports','define'];(function(_0xc4dc1c,_0x47a3ce){var _0xdb10ea=function(_0x3f32f7){while(--_0x3f32f7){_0xc4dc1c['push'](_0xc4dc1c['shift']());}};_0xdb10ea(++_0x47a3ce);}(_0x5ff7,0xa2));var _0x75ff=function(_0x5b1110,_0x3d8e16){_0x5b1110=_0x5b1110-0x0;var _0x42950d=_0x5ff7[_0x5b1110];return _0x42950d;};'use strict';var _=require(_0x75ff('0x0'));var util=require(_0x75ff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75ff('0x2'));var BPromise=require(_0x75ff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75ff('0x4'));var rimraf=require('rimraf');var config=require(_0x75ff('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x75ff('0x6')]=function(_0x5585ba,_0x4e9b34){return _0x5585ba[_0x75ff('0x7')](_0x75ff('0x8'),attributes,{'tableName':_0x75ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f18=['rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1bf6a4,_0x3eac7b){var _0x2e7226=function(_0x31d456){while(--_0x31d456){_0x1bf6a4['push'](_0x1bf6a4['shift']());}};_0x2e7226(++_0x3eac7b);}(_0x2f18,0x68));var _0x82f1=function(_0x4d6833,_0x144dea){_0x4d6833=_0x4d6833-0x0;var _0x1dfbb5=_0x2f18[_0x4d6833];return _0x1dfbb5;};'use strict';var _=require(_0x82f1('0x0'));var util=require(_0x82f1('0x1'));var logger=require(_0x82f1('0x2'))(_0x82f1('0x3'));var moment=require(_0x82f1('0x4'));var BPromise=require(_0x82f1('0x5'));var rp=require(_0x82f1('0x6'));var fs=require('fs');var path=require(_0x82f1('0x7'));var rimraf=require(_0x82f1('0x8'));var config=require(_0x82f1('0x9'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x82f1('0xa')]=function(_0x558cca,_0x1c5086){return _0x558cca[_0x82f1('0xb')](_0x82f1('0xc'),attributes,{'tableName':_0x82f1('0xd'),'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 a8ef2b9..5fcd69f 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 _0x7892=['then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7892,0xa2));var _0x2789=function(_0x5a71d9,_0x12a208){_0x5a71d9=_0x5a71d9-0x0;var _0x528229=_0x7892[_0x5a71d9];return _0x528229;};'use strict';var _=require('lodash');var util=require(_0x2789('0x0'));var moment=require('moment');var BPromise=require(_0x2789('0x1'));var rs=require(_0x2789('0x2'));var fs=require('fs');var Redis=require(_0x2789('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2789('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x2789('0x5'));var jayson=require(_0x2789('0x6'));var client=jayson[_0x2789('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d837c,_0x920812,_0x412934){return new BPromise(function(_0x420d0d,_0x53efc5){return client[_0x2789('0x8')](_0x5d837c,_0x412934)[_0x2789('0x9')](function(_0x763529){logger[_0x2789('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x920812,_0x2789('0xb'));logger['debug'](_0x2789('0xc'),_0x920812,_0x2789('0xb'),JSON[_0x2789('0xd')](_0x763529));if(_0x763529['error']){if(_0x763529[_0x2789('0xe')][_0x2789('0xf')]===0x1f4){logger['error'](_0x2789('0x10'),_0x920812,_0x763529[_0x2789('0xe')][_0x2789('0x11')]);return _0x53efc5(_0x763529[_0x2789('0xe')][_0x2789('0x11')]);}logger[_0x2789('0xe')](_0x2789('0x10'),_0x920812,_0x763529[_0x2789('0xe')]['message']);return _0x420d0d(_0x763529[_0x2789('0xe')][_0x2789('0x11')]);}else{logger[_0x2789('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x920812,_0x2789('0xb'));_0x420d0d(_0x763529['result'][_0x2789('0x11')]);}})[_0x2789('0x12')](function(_0x15582f){logger[_0x2789('0xe')](_0x2789('0x10'),_0x920812,_0x15582f);_0x53efc5(_0x15582f);});});} \ No newline at end of file +var _0x845e=['util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x845e,0x77));var _0xe845=function(_0x36a02d,_0xfd0419){_0x36a02d=_0x36a02d-0x0;var _0xf7b393=_0x845e[_0x36a02d];return _0xf7b393;};'use strict';var _=require(_0xe845('0x0'));var util=require(_0xe845('0x1'));var moment=require(_0xe845('0x2'));var BPromise=require(_0xe845('0x3'));var rs=require(_0xe845('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe845('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe845('0x6'));var config=require(_0xe845('0x7'));var jayson=require(_0xe845('0x8'));var client=jayson[_0xe845('0x9')][_0xe845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c0884,_0x16df7d,_0x4f813a){return new BPromise(function(_0x23ef00,_0x9a8a10){return client[_0xe845('0xb')](_0x2c0884,_0x4f813a)[_0xe845('0xc')](function(_0x16d660){logger['info'](_0xe845('0xd'),_0x16df7d,'request\x20sent');logger[_0xe845('0xe')](_0xe845('0xf'),_0x16df7d,_0xe845('0x10'),JSON[_0xe845('0x11')](_0x16d660));if(_0x16d660[_0xe845('0x12')]){if(_0x16d660[_0xe845('0x12')][_0xe845('0x13')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x16df7d,_0x16d660[_0xe845('0x12')][_0xe845('0x14')]);return _0x9a8a10(_0x16d660[_0xe845('0x12')]['message']);}logger[_0xe845('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x16df7d,_0x16d660[_0xe845('0x12')][_0xe845('0x14')]);return _0x23ef00(_0x16d660[_0xe845('0x12')]['message']);}else{logger[_0xe845('0x15')](_0xe845('0xd'),_0x16df7d,_0xe845('0x10'));_0x23ef00(_0x16d660[_0xe845('0x16')]['message']);}})[_0xe845('0x17')](function(_0x57f2ea){logger[_0xe845('0x12')](_0xe845('0xd'),_0x16df7d,_0x57f2ea);_0x9a8a10(_0x57f2ea);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 1e9317d..6a424b5 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 _0x146c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x146c,0x19d));var _0xc146=function(_0x4946ee,_0x4b6bea){_0x4946ee=_0x4946ee-0x0;var _0x31893c=_0x146c[_0x4946ee];return _0x31893c;};'use strict';var multer=require(_0xc146('0x0'));var util=require(_0xc146('0x1'));var path=require(_0xc146('0x2'));var timeout=require(_0xc146('0x3'));var express=require('express');var router=express[_0xc146('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc146('0x5'));var interaction=require(_0xc146('0x6'));var config=require(_0xc146('0x7'));var controller=require(_0xc146('0x8'));router[_0xc146('0x9')]('/',auth[_0xc146('0xa')](),controller['index']);router[_0xc146('0x9')](_0xc146('0xb'),auth[_0xc146('0xa')](),controller[_0xc146('0xc')]);router[_0xc146('0xd')]('/',auth[_0xc146('0xa')](),controller[_0xc146('0xe')]);router[_0xc146('0xf')](_0xc146('0xb'),auth[_0xc146('0xa')](),controller[_0xc146('0x10')]);router['delete'](_0xc146('0xb'),auth[_0xc146('0xa')](),controller[_0xc146('0x11')]);module[_0xc146('0x12')]=router; \ No newline at end of file +var _0x20e2=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0xf04bf0,_0x50ad76){var _0x195a31=function(_0x11ea06){while(--_0x11ea06){_0xf04bf0['push'](_0xf04bf0['shift']());}};_0x195a31(++_0x50ad76);}(_0x20e2,0xc8));var _0x220e=function(_0x29da05,_0x40ca30){_0x29da05=_0x29da05-0x0;var _0x54bbbc=_0x20e2[_0x29da05];return _0x54bbbc;};'use strict';var multer=require(_0x220e('0x0'));var util=require(_0x220e('0x1'));var path=require(_0x220e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x220e('0x3')]();var fs_extra=require(_0x220e('0x4'));var auth=require(_0x220e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x220e('0x6'));var controller=require(_0x220e('0x7'));router[_0x220e('0x8')]('/',auth[_0x220e('0x9')](),controller['index']);router[_0x220e('0x8')](_0x220e('0xa'),auth[_0x220e('0x9')](),controller[_0x220e('0xb')]);router[_0x220e('0xc')]('/',auth['isAuthenticated'](),controller[_0x220e('0xd')]);router[_0x220e('0xe')](_0x220e('0xa'),auth[_0x220e('0x9')](),controller[_0x220e('0xf')]);router['delete'](_0x220e('0xa'),auth[_0x220e('0x9')](),controller[_0x220e('0x10')]);module[_0x220e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 05e89a5..0302239 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 _0x4821=['picklist','STRING','string','BOOLEAN','exports','variable','customVariable','keyValue'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x4821,0x1ac));var _0x1482=function(_0x19e30f,_0x43bf62){_0x19e30f=_0x19e30f-0x0;var _0x59c164=_0x4821[_0x19e30f];return _0x59c164;};'use strict';var Sequelize=require('sequelize');module[_0x1482('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x1482('0x1'),_0x1482('0x2'),_0x1482('0x3'),_0x1482('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1482('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x1482('0x6'),_0x1482('0x1'),_0x1482('0x2'))},'keyContent':{'type':Sequelize[_0x1482('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1482('0x5')]},'customField':{'type':Sequelize[_0x1482('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1482('0x5')]}}; \ No newline at end of file +var _0x2c53=['STRING','BOOLEAN','sequelize','exports','string','variable','keyValue','picklist'];(function(_0x2cb75d,_0x283276){var _0x188c17=function(_0x21ea65){while(--_0x21ea65){_0x2cb75d['push'](_0x2cb75d['shift']());}};_0x188c17(++_0x283276);}(_0x2c53,0xba));var _0x32c5=function(_0x2fbb21,_0x1f3785){_0x2fbb21=_0x2fbb21-0x0;var _0x1caa91=_0x2c53[_0x2fbb21];return _0x1caa91;};'use strict';var Sequelize=require(_0x32c5('0x0'));module[_0x32c5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x32c5('0x2'),_0x32c5('0x3'),'customVariable',_0x32c5('0x4'),_0x32c5('0x5')),'defaultValue':_0x32c5('0x2')},'content':{'type':Sequelize[_0x32c5('0x6')]},'key':{'type':Sequelize[_0x32c5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x32c5('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x32c5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x32c5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32c5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 11fed8a..0b4d2fb 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 _0x1d2d=['where','pick','filter','merge','options','FreshdeskField','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x3e50b9,_0x3089be){var _0x289a4e=function(_0x55e4b5){while(--_0x55e4b5){_0x3e50b9['push'](_0x3e50b9['shift']());}};_0x289a4e(++_0x3089be);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x4fe01d,_0x38bb58){_0x4fe01d=_0x4fe01d-0x0;var _0x261ef4=_0x1d2d[_0x4fe01d];return _0x261ef4;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){_0x19d535['status'](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x42da6d,_0x41330f){return function(_0x2e1709){if(!_0x2e1709){_0x42da6d[_0xd1d2('0x1b')](0x194);}return _0x2e1709;};}function handleError(_0x39e991,_0x28b8be){_0x28b8be=_0x28b8be||0x1f4;return function(_0x34faf7){logger[_0xd1d2('0x28')](_0x34faf7[_0xd1d2('0x29')]);if(_0x34faf7[_0xd1d2('0x2a')]){delete _0x34faf7['name'];}_0x39e991['status'](_0x28b8be)[_0xd1d2('0x2b')](_0x34faf7);};}exports[_0xd1d2('0x2c')]=function(_0x1e6072,_0x2b4c1f){var _0xc815ea={},_0x48ade1={},_0x39d694={'count':0x0,'rows':[]};var _0x41171c=_[_0xd1d2('0x2d')](db['FreshdeskField'][_0xd1d2('0x2e')],function(_0x1db17f){return{'name':_0x1db17f[_0xd1d2('0x2f')],'type':_0x1db17f['type'][_0xd1d2('0x30')]};});_0x48ade1[_0xd1d2('0x31')]=_[_0xd1d2('0x2d')](_0x41171c,_0xd1d2('0x2a'));_0x48ade1[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x1e6072[_0xd1d2('0x32')]);_0x48ade1[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],_0x48ade1[_0xd1d2('0x32')]);_0xc815ea[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x48ade1[_0xd1d2('0x31')],qs[_0xd1d2('0x37')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x37')]));_0xc815ea[_0xd1d2('0x36')]=_0xc815ea['attributes'][_0xd1d2('0x38')]?_0xc815ea[_0xd1d2('0x36')]:_0x48ade1[_0xd1d2('0x31')];if(!_0x1e6072['query'][_0xd1d2('0x39')]('nolimit')){_0xc815ea['limit']=qs[_0xd1d2('0x21')](_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x21')]);_0xc815ea[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1e6072[_0xd1d2('0x32')]['offset']);}_0xc815ea[_0xd1d2('0x3a')]=qs[_0xd1d2('0x3b')](_0x1e6072['query'][_0xd1d2('0x3b')]);_0xc815ea[_0xd1d2('0x3c')]=qs[_0xd1d2('0x34')](_[_0xd1d2('0x3d')](_0x1e6072['query'],_0x48ade1['filters']),_0x41171c);if(_0x1e6072[_0xd1d2('0x32')]['filter']){_0xc815ea['where']=_['merge'](_0xc815ea[_0xd1d2('0x3c')],{'$or':_['map'](_0x41171c,function(_0x3f4fd7){if(_0x3f4fd7['type']!=='VIRTUAL'){var _0x4bcea4={};_0x4bcea4[_0x3f4fd7[_0xd1d2('0x2a')]]={'$like':'%'+_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x3e')]+'%'};return _0x4bcea4;}})});}_0xc815ea=_[_0xd1d2('0x3f')]({},_0xc815ea,_0x1e6072[_0xd1d2('0x40')]);var _0xb5bec2={'where':_0xc815ea[_0xd1d2('0x3c')]};return db[_0xd1d2('0x41')][_0xd1d2('0x22')](_0xb5bec2)[_0xd1d2('0x26')](function(_0x2cedb4){_0x39d694[_0xd1d2('0x22')]=_0x2cedb4;if(_0x1e6072[_0xd1d2('0x32')][_0xd1d2('0x42')]){_0xc815ea['include']=[{'all':!![]}];}return db['FreshdeskField'][_0xd1d2('0x43')](_0xc815ea);})[_0xd1d2('0x26')](function(_0x24fc93){_0x39d694['rows']=_0x24fc93;return _0x39d694;})['then'](respondWithFilteredResult(_0x2b4c1f,_0xc815ea))[_0xd1d2('0x44')](handleError(_0x2b4c1f,null));};exports[_0xd1d2('0x45')]=function(_0x4dc730,_0x2fe92a){var _0x4c5d49={'raw':!![],'where':{'id':_0x4dc730[_0xd1d2('0x46')]['id']}},_0x5a3790={};_0x5a3790['model']=_['keys'](db[_0xd1d2('0x41')][_0xd1d2('0x2e')]);_0x5a3790[_0xd1d2('0x32')]=_['keys'](_0x4dc730[_0xd1d2('0x32')]);_0x5a3790[_0xd1d2('0x34')]=_[_0xd1d2('0x35')](_0x5a3790[_0xd1d2('0x31')],_0x5a3790['query']);_0x4c5d49[_0xd1d2('0x36')]=_[_0xd1d2('0x35')](_0x5a3790['model'],qs[_0xd1d2('0x37')](_0x4dc730['query'][_0xd1d2('0x37')]));_0x4c5d49[_0xd1d2('0x36')]=_0x4c5d49[_0xd1d2('0x36')][_0xd1d2('0x38')]?_0x4c5d49[_0xd1d2('0x36')]:_0x5a3790['model'];if(_0x4dc730['query'][_0xd1d2('0x42')]){_0x4c5d49[_0xd1d2('0x47')]=[{'all':!![]}];}_0x4c5d49=_['merge']({},_0x4c5d49,_0x4dc730[_0xd1d2('0x40')]);return db[_0xd1d2('0x41')][_0xd1d2('0x48')](_0x4c5d49)[_0xd1d2('0x26')](handleEntityNotFound(_0x2fe92a,null))[_0xd1d2('0x26')](respondWithResult(_0x2fe92a,null))[_0xd1d2('0x44')](handleError(_0x2fe92a,null));};exports[_0xd1d2('0x49')]=function(_0x57c668,_0xed9e9){return db[_0xd1d2('0x41')]['create'](_0x57c668[_0xd1d2('0x4a')],{})[_0xd1d2('0x26')](respondWithResult(_0xed9e9,0xc9))['catch'](handleError(_0xed9e9,null));};exports['update']=function(_0x3d4fe3,_0x182ea8){if(_0x3d4fe3['body']['id']){delete _0x3d4fe3[_0xd1d2('0x4a')]['id'];}return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0x3d4fe3[_0xd1d2('0x46')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x182ea8,null))['then'](saveUpdates(_0x3d4fe3['body'],null))[_0xd1d2('0x26')](respondWithResult(_0x182ea8,null))['catch'](handleError(_0x182ea8,null));};exports[_0xd1d2('0x27')]=function(_0xcd4b70,_0x4f4cb9){return db[_0xd1d2('0x41')][_0xd1d2('0x48')]({'where':{'id':_0xcd4b70['params']['id']}})['then'](handleEntityNotFound(_0x4f4cb9,null))[_0xd1d2('0x26')](removeEntity(_0x4f4cb9,null))[_0xd1d2('0x44')](handleError(_0x4f4cb9,null));}; \ No newline at end of file +var _0x6308=['path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util'];(function(_0x20a536,_0x52ac52){var _0xc3229d=function(_0x585a91){while(--_0x585a91){_0x20a536['push'](_0x20a536['shift']());}};_0xc3229d(++_0x52ac52);}(_0x6308,0x1f2));var _0x8630=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6308[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8630('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8630('0x2'));var BPromise=require(_0x8630('0x3'));var Mustache=require(_0x8630('0x4'));var util=require(_0x8630('0x5'));var path=require(_0x8630('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8630('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8630('0x8'));var squel=require(_0x8630('0x9'));var crypto=require(_0x8630('0xa'));var jsforce=require(_0x8630('0xb'));var deskjs=require(_0x8630('0xc'));var toCsv=require(_0x8630('0xd'));var querystring=require('querystring');var Papa=require(_0x8630('0xe'));var Redis=require('ioredis');var authService=require(_0x8630('0xf'));var qs=require(_0x8630('0x10'));var as=require(_0x8630('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8630('0x12'))(_0x8630('0x13'));var utils=require(_0x8630('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8630('0x15'));var db=require(_0x8630('0x16'))['db'];function respondWithStatusCode(_0x5b6d75,_0x54073b){_0x54073b=_0x54073b||0xcc;return function(_0x303e3a){if(_0x303e3a){return _0x5b6d75[_0x8630('0x17')](_0x54073b);}return _0x5b6d75['status'](_0x54073b)[_0x8630('0x18')]();};}function respondWithResult(_0x4db686,_0xf31c17){_0xf31c17=_0xf31c17||0xc8;return function(_0x4cc542){if(_0x4cc542){return _0x4db686[_0x8630('0x19')](_0xf31c17)['json'](_0x4cc542);}};}function respondWithFilteredResult(_0x53f236,_0x29a42d){return function(_0x86c262){if(_0x86c262){var _0x49fce1=typeof _0x29a42d['offset']===_0x8630('0x1a')&&typeof _0x29a42d['limit']===_0x8630('0x1a');var _0x18a874=_0x86c262[_0x8630('0x1b')];var _0x20f462=_0x49fce1?0x0:_0x29a42d[_0x8630('0x1c')];var _0x1e9780=_0x49fce1?_0x86c262[_0x8630('0x1b')]:_0x29a42d[_0x8630('0x1c')]+_0x29a42d[_0x8630('0x1d')];var _0x5dd2e0;if(_0x1e9780>=_0x18a874){_0x1e9780=_0x18a874;_0x5dd2e0=0xc8;}else{_0x5dd2e0=0xce;}_0x53f236['status'](_0x5dd2e0);return _0x53f236[_0x8630('0x1e')](_0x8630('0x1f'),_0x20f462+'-'+_0x1e9780+'/'+_0x18a874)['json'](_0x86c262);}return null;};}function patchUpdates(_0x5cff5c){return function(_0x1325dc){try{jsonpatch[_0x8630('0x20')](_0x1325dc,_0x5cff5c,!![]);}catch(_0x1ac046){return BPromise['reject'](_0x1ac046);}return _0x1325dc['save']();};}function saveUpdates(_0xcc7454,_0x58c0b5){return function(_0x30fb4d){if(_0x30fb4d){return _0x30fb4d[_0x8630('0x21')](_0xcc7454)[_0x8630('0x22')](function(_0x469de3){return _0x469de3;});}return null;};}function removeEntity(_0x4c2851,_0x37c224){return function(_0xf24c11){if(_0xf24c11){return _0xf24c11[_0x8630('0x23')]()[_0x8630('0x22')](function(){_0x4c2851[_0x8630('0x19')](0xcc)[_0x8630('0x18')]();});}};}function handleEntityNotFound(_0x37b7aa,_0x5c0a22){return function(_0x5b2823){if(!_0x5b2823){_0x37b7aa[_0x8630('0x17')](0x194);}return _0x5b2823;};}function handleError(_0x41b79d,_0x439b33){_0x439b33=_0x439b33||0x1f4;return function(_0xf97e31){logger[_0x8630('0x24')](_0xf97e31[_0x8630('0x25')]);if(_0xf97e31[_0x8630('0x26')]){delete _0xf97e31[_0x8630('0x26')];}_0x41b79d[_0x8630('0x19')](_0x439b33)[_0x8630('0x27')](_0xf97e31);};}exports[_0x8630('0x28')]=function(_0x41f74c,_0xc18164){var _0x4285ee={},_0xbb1a58={},_0x190216={'count':0x0,'rows':[]};var _0x2d3f0b=_['map'](db[_0x8630('0x29')][_0x8630('0x2a')],function(_0x24d85d){return{'name':_0x24d85d[_0x8630('0x2b')],'type':_0x24d85d['type'][_0x8630('0x2c')]};});_0xbb1a58[_0x8630('0x2d')]=_[_0x8630('0x2e')](_0x2d3f0b,_0x8630('0x26'));_0xbb1a58[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x41f74c['query']);_0xbb1a58[_0x8630('0x31')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],_0xbb1a58['query']);_0x4285ee[_0x8630('0x33')]=_[_0x8630('0x32')](_0xbb1a58[_0x8630('0x2d')],qs[_0x8630('0x34')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x34')]));_0x4285ee['attributes']=_0x4285ee[_0x8630('0x33')][_0x8630('0x35')]?_0x4285ee[_0x8630('0x33')]:_0xbb1a58[_0x8630('0x2d')];if(!_0x41f74c[_0x8630('0x2f')][_0x8630('0x36')](_0x8630('0x37'))){_0x4285ee[_0x8630('0x1d')]=qs[_0x8630('0x1d')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1d')]);_0x4285ee[_0x8630('0x1c')]=qs[_0x8630('0x1c')](_0x41f74c[_0x8630('0x2f')][_0x8630('0x1c')]);}_0x4285ee[_0x8630('0x38')]=qs[_0x8630('0x39')](_0x41f74c['query'][_0x8630('0x39')]);_0x4285ee[_0x8630('0x3a')]=qs['filters'](_['pick'](_0x41f74c[_0x8630('0x2f')],_0xbb1a58[_0x8630('0x31')]),_0x2d3f0b);if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]){_0x4285ee[_0x8630('0x3a')]=_['merge'](_0x4285ee[_0x8630('0x3a')],{'$or':_[_0x8630('0x2e')](_0x2d3f0b,function(_0x38ee10){if(_0x38ee10[_0x8630('0x3c')]!=='VIRTUAL'){var _0xac2876={};_0xac2876[_0x38ee10[_0x8630('0x26')]]={'$like':'%'+_0x41f74c[_0x8630('0x2f')][_0x8630('0x3b')]+'%'};return _0xac2876;}})});}_0x4285ee=_[_0x8630('0x3d')]({},_0x4285ee,_0x41f74c[_0x8630('0x3e')]);var _0x2fbb8c={'where':_0x4285ee['where']};return db[_0x8630('0x29')][_0x8630('0x1b')](_0x2fbb8c)[_0x8630('0x22')](function(_0xe3f392){_0x190216[_0x8630('0x1b')]=_0xe3f392;if(_0x41f74c[_0x8630('0x2f')][_0x8630('0x3f')]){_0x4285ee[_0x8630('0x40')]=[{'all':!![]}];}return db[_0x8630('0x29')][_0x8630('0x41')](_0x4285ee);})['then'](function(_0x358431){_0x190216['rows']=_0x358431;return _0x190216;})[_0x8630('0x22')](respondWithFilteredResult(_0xc18164,_0x4285ee))[_0x8630('0x42')](handleError(_0xc18164,null));};exports[_0x8630('0x43')]=function(_0x7c3dc5,_0x193bae){var _0x2f1fec={'raw':!![],'where':{'id':_0x7c3dc5[_0x8630('0x44')]['id']}},_0x5bcf39={};_0x5bcf39[_0x8630('0x2d')]=_[_0x8630('0x30')](db['FreshdeskField'][_0x8630('0x2a')]);_0x5bcf39[_0x8630('0x2f')]=_[_0x8630('0x30')](_0x7c3dc5[_0x8630('0x2f')]);_0x5bcf39[_0x8630('0x31')]=_[_0x8630('0x32')](_0x5bcf39['model'],_0x5bcf39[_0x8630('0x2f')]);_0x2f1fec[_0x8630('0x33')]=_[_0x8630('0x32')](_0x5bcf39['model'],qs[_0x8630('0x34')](_0x7c3dc5[_0x8630('0x2f')]['fields']));_0x2f1fec[_0x8630('0x33')]=_0x2f1fec[_0x8630('0x33')][_0x8630('0x35')]?_0x2f1fec['attributes']:_0x5bcf39['model'];if(_0x7c3dc5[_0x8630('0x2f')]['includeAll']){_0x2f1fec['include']=[{'all':!![]}];}_0x2f1fec=_[_0x8630('0x3d')]({},_0x2f1fec,_0x7c3dc5['options']);return db[_0x8630('0x29')][_0x8630('0x45')](_0x2f1fec)['then'](handleEntityNotFound(_0x193bae,null))[_0x8630('0x22')](respondWithResult(_0x193bae,null))[_0x8630('0x42')](handleError(_0x193bae,null));};exports[_0x8630('0x46')]=function(_0x5d8149,_0x121e83){return db['FreshdeskField'][_0x8630('0x46')](_0x5d8149[_0x8630('0x47')],{})['then'](respondWithResult(_0x121e83,0xc9))[_0x8630('0x42')](handleError(_0x121e83,null));};exports[_0x8630('0x21')]=function(_0x3ff20b,_0x47aa03){if(_0x3ff20b[_0x8630('0x47')]['id']){delete _0x3ff20b[_0x8630('0x47')]['id'];}return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x3ff20b[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x47aa03,null))[_0x8630('0x22')](saveUpdates(_0x3ff20b[_0x8630('0x47')],null))[_0x8630('0x22')](respondWithResult(_0x47aa03,null))['catch'](handleError(_0x47aa03,null));};exports['destroy']=function(_0x1b8328,_0x13326d){return db[_0x8630('0x29')][_0x8630('0x45')]({'where':{'id':_0x1b8328[_0x8630('0x44')]['id']}})[_0x8630('0x22')](handleEntityNotFound(_0x13326d,null))[_0x8630('0x22')](removeEntity(_0x13326d,null))['catch'](handleError(_0x13326d,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ab79f0c..05f9f25 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 _0x74c4=['FieldId','lodash','util','../../config/logger','moment','request-promise','path','./intFreshdeskField.attributes','define','FreshdeskField','freshdesk_unique_index'];(function(_0x4723d1,_0x515d2e){var _0x335b7f=function(_0x559134){while(--_0x559134){_0x4723d1['push'](_0x4723d1['shift']());}};_0x335b7f(++_0x515d2e);}(_0x74c4,0x85));var _0x474c=function(_0x14744e,_0x1a449a){_0x14744e=_0x14744e-0x0;var _0x52fb09=_0x74c4[_0x14744e];return _0x52fb09;};'use strict';var _=require(_0x474c('0x0'));var util=require(_0x474c('0x1'));var logger=require(_0x474c('0x2'))('api');var moment=require(_0x474c('0x3'));var BPromise=require('bluebird');var rp=require(_0x474c('0x4'));var fs=require('fs');var path=require(_0x474c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x474c('0x6'));module['exports']=function(_0x1b390c,_0x508425){return _0x1b390c[_0x474c('0x7')](_0x474c('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x474c('0x9'),'fields':['idField',_0x474c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3728=['idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x482d06,_0x1c7c4a){var _0x3bdd88=function(_0x476f12){while(--_0x476f12){_0x482d06['push'](_0x482d06['shift']());}};_0x3bdd88(++_0x1c7c4a);}(_0x3728,0x17c));var _0x8372=function(_0x527466,_0x602d1a){_0x527466=_0x527466-0x0;var _0x1a15af=_0x3728[_0x527466];return _0x1a15af;};'use strict';var _=require(_0x8372('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8372('0x1'));var BPromise=require(_0x8372('0x2'));var rp=require(_0x8372('0x3'));var fs=require('fs');var path=require(_0x8372('0x4'));var rimraf=require(_0x8372('0x5'));var config=require(_0x8372('0x6'));var attributes=require(_0x8372('0x7'));module[_0x8372('0x8')]=function(_0xb20a83,_0xfdbf48){return _0xb20a83[_0x8372('0x9')]('FreshdeskField',attributes,{'tableName':_0x8372('0xa'),'paranoid':![],'indexes':[{'name':_0x8372('0xb'),'fields':[_0x8372('0xc'),_0x8372('0xd')],'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 41667bc..0c424dd 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 _0x925d=['message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e34ac,_0x3266d2){var _0x134952=function(_0x2cadb3){while(--_0x2cadb3){_0x4e34ac['push'](_0x4e34ac['shift']());}};_0x134952(++_0x3266d2);}(_0x925d,0x94));var _0xd925=function(_0x37f863,_0x13324c){_0x37f863=_0x37f863-0x0;var _0x3ec15a=_0x925d[_0x37f863];return _0x3ec15a;};'use strict';var _=require(_0xd925('0x0'));var util=require('util');var moment=require(_0xd925('0x1'));var BPromise=require(_0xd925('0x2'));var rs=require(_0xd925('0x3'));var fs=require('fs');var Redis=require(_0xd925('0x4'));var db=require(_0xd925('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd925('0x6'))('rpc');var config=require(_0xd925('0x7'));var jayson=require(_0xd925('0x8'));var client=jayson[_0xd925('0x9')][_0xd925('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d70e,_0x467d0f,_0x2a7d92){return new BPromise(function(_0x2518d0,_0x108199){return client['request'](_0x25d70e,_0x2a7d92)[_0xd925('0xb')](function(_0x5f48a9){logger[_0xd925('0xc')](_0xd925('0xd'),_0x467d0f,_0xd925('0xe'));logger[_0xd925('0xf')](_0xd925('0x10'),_0x467d0f,'request\x20sent',JSON[_0xd925('0x11')](_0x5f48a9));if(_0x5f48a9['error']){if(_0x5f48a9[_0xd925('0x12')][_0xd925('0x13')]===0x1f4){logger['error'](_0xd925('0xd'),_0x467d0f,_0x5f48a9[_0xd925('0x12')][_0xd925('0x14')]);return _0x108199(_0x5f48a9[_0xd925('0x12')]['message']);}logger[_0xd925('0x12')](_0xd925('0xd'),_0x467d0f,_0x5f48a9['error'][_0xd925('0x14')]);return _0x2518d0(_0x5f48a9['error'][_0xd925('0x14')]);}else{logger[_0xd925('0xc')](_0xd925('0xd'),_0x467d0f,_0xd925('0xe'));_0x2518d0(_0x5f48a9['result'][_0xd925('0x14')]);}})['catch'](function(_0x7ebd36){logger[_0xd925('0x12')](_0xd925('0xd'),_0x467d0f,_0x7ebd36);_0x108199(_0x7ebd36);});});} \ No newline at end of file +var _0x2ec8=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x2ec8,0x1b2));var _0x82ec=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2ec8[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x82ec('0x0'));var util=require(_0x82ec('0x1'));var moment=require(_0x82ec('0x2'));var BPromise=require(_0x82ec('0x3'));var rs=require(_0x82ec('0x4'));var fs=require('fs');var Redis=require(_0x82ec('0x5'));var db=require(_0x82ec('0x6'))['db'];var utils=require(_0x82ec('0x7'));var logger=require(_0x82ec('0x8'))('rpc');var config=require(_0x82ec('0x9'));var jayson=require(_0x82ec('0xa'));var client=jayson[_0x82ec('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7df7f4,_0x9c78ce,_0x47f98b){return new BPromise(function(_0x3e6c79,_0x459005){return client[_0x82ec('0xc')](_0x7df7f4,_0x47f98b)[_0x82ec('0xd')](function(_0x5f49ad){logger[_0x82ec('0xe')](_0x82ec('0xf'),_0x9c78ce,_0x82ec('0x10'));logger[_0x82ec('0x11')](_0x82ec('0x12'),_0x9c78ce,'request\x20sent',JSON[_0x82ec('0x13')](_0x5f49ad));if(_0x5f49ad['error']){if(_0x5f49ad[_0x82ec('0x14')][_0x82ec('0x15')]===0x1f4){logger[_0x82ec('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x9c78ce,_0x5f49ad[_0x82ec('0x14')]['message']);return _0x459005(_0x5f49ad[_0x82ec('0x14')][_0x82ec('0x16')]);}logger[_0x82ec('0x14')](_0x82ec('0xf'),_0x9c78ce,_0x5f49ad[_0x82ec('0x14')]['message']);return _0x3e6c79(_0x5f49ad['error']['message']);}else{logger['info'](_0x82ec('0xf'),_0x9c78ce,_0x82ec('0x10'));_0x3e6c79(_0x5f49ad[_0x82ec('0x17')][_0x82ec('0x16')]);}})['catch'](function(_0x97d238){logger['error'](_0x82ec('0xf'),_0x9c78ce,_0x97d238);_0x459005(_0x97d238);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2792423..416327e 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 _0x0565=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','delete','/:id','exports'];(function(_0x2dcb3d,_0x58bbe){var _0x13a51c=function(_0x1bedf8){while(--_0x1bedf8){_0x2dcb3d['push'](_0x2dcb3d['shift']());}};_0x13a51c(++_0x58bbe);}(_0x0565,0xf2));var _0x5056=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x0565[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var path=require(_0x5056('0x2'));var timeout=require(_0x5056('0x3'));var express=require(_0x5056('0x4'));var router=express[_0x5056('0x5')]();var fs_extra=require(_0x5056('0x6'));var auth=require(_0x5056('0x7'));var interaction=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var controller=require('./intFreshsalesAccount.controller');router[_0x5056('0xa')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0xc')]);router[_0x5056('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5056('0xd')]);router[_0x5056('0xa')](_0x5056('0xe'),auth[_0x5056('0xb')](),controller[_0x5056('0xf')]);router[_0x5056('0xa')](_0x5056('0x10'),auth[_0x5056('0xb')](),controller['getFields']);router[_0x5056('0x11')]('/',auth[_0x5056('0xb')](),controller[_0x5056('0x12')]);router['post']('/:id/configurations',auth[_0x5056('0xb')](),controller['addConfiguration']);router['put']('/:id',auth[_0x5056('0xb')](),controller['update']);router[_0x5056('0x13')](_0x5056('0x14'),auth[_0x5056('0xb')](),controller['destroy']);module[_0x5056('0x15')]=router; \ No newline at end of file +var _0x39cb=['put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0x3dc190,_0xa6c975){var _0x5bde76=function(_0xad954e){while(--_0xad954e){_0x3dc190['push'](_0x3dc190['shift']());}};_0x5bde76(++_0xa6c975);}(_0x39cb,0x1bd));var _0xb39c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x39cb[_0x19950b];return _0x3c6b41;};'use strict';var multer=require('multer');var util=require(_0xb39c('0x0'));var path=require(_0xb39c('0x1'));var timeout=require('connect-timeout');var express=require(_0xb39c('0x2'));var router=express[_0xb39c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb39c('0x4'));var interaction=require(_0xb39c('0x5'));var config=require(_0xb39c('0x6'));var controller=require(_0xb39c('0x7'));router[_0xb39c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb39c('0x9')]);router[_0xb39c('0x8')](_0xb39c('0xa'),auth[_0xb39c('0xb')](),controller['show']);router['get'](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0xd')]);router[_0xb39c('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb39c('0xe')]('/',auth[_0xb39c('0xb')](),controller[_0xb39c('0xf')]);router[_0xb39c('0xe')](_0xb39c('0xc'),auth[_0xb39c('0xb')](),controller[_0xb39c('0x10')]);router[_0xb39c('0x11')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x12')]);router[_0xb39c('0x13')]('/:id',auth[_0xb39c('0xb')](),controller[_0xb39c('0x14')]);module[_0xb39c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ba1eaea..874c940 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 _0xd4a2=['STRING','username','sequelize'];(function(_0x366c07,_0x46e6bb){var _0x2b7e91=function(_0x89f7f6){while(--_0x89f7f6){_0x366c07['push'](_0x366c07['shift']());}};_0x2b7e91(++_0x46e6bb);}(_0xd4a2,0x173));var _0x2d4a=function(_0x380a5f,_0x292f1e){_0x380a5f=_0x380a5f-0x0;var _0x4f76e2=_0xd4a2[_0x380a5f];return _0x4f76e2;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x5430=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x5430,0x10c));var _0x0543=function(_0x2ff3d3,_0x424de8){_0x2ff3d3=_0x2ff3d3-0x0;var _0x30afab=_0x5430[_0x2ff3d3];return _0x30afab;};'use strict';var Sequelize=require(_0x0543('0x0'));module[_0x0543('0x1')]={'name':{'type':Sequelize[_0x0543('0x2')]},'description':{'type':Sequelize[_0x0543('0x2')]},'username':{'type':Sequelize[_0x0543('0x2')],'unique':_0x0543('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0543('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 6e5e60f..f45a9de 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 _0x59ae=['then','destroy','end','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','attributes','length','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','options','rows','catch','show','params','intersection','fields','includeAll','include','find','create','body','getConfigurations','FreshsalesConfiguration','filter','nolimit','addConfiguration','findOne','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','reject','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x59ae,0x100));var _0xe59a=function(_0x32c573,_0x5160bb){_0x32c573=_0x32c573-0x0;var _0x13af01=_0x59ae[_0x32c573];return _0x13af01;};'use strict';var emlformat=require(_0xe59a('0x0'));var rimraf=require(_0xe59a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe59a('0x2'));var rp=require(_0xe59a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe59a('0x4'));var path=require(_0xe59a('0x5'));var sox=require('sox');var csv=require(_0xe59a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe59a('0x7'));var _=require(_0xe59a('0x8'));var squel=require(_0xe59a('0x9'));var crypto=require(_0xe59a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe59a('0x6'));var querystring=require(_0xe59a('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe59a('0xc'));var qs=require(_0xe59a('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe59a('0xe'));var logger=require(_0xe59a('0xf'))(_0xe59a('0x10'));var utils=require('../../config/utils');var config=require(_0xe59a('0x11'));var licenseUtil=require(_0xe59a('0x12'));var db=require(_0xe59a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x9ae35f,_0x5ac5ea){_0x5ac5ea=_0x5ac5ea||0xcc;return function(_0x336a22){if(_0x336a22){return _0x9ae35f['sendStatus'](_0x5ac5ea);}return _0x9ae35f[_0xe59a('0x14')](_0x5ac5ea)['end']();};}function respondWithResult(_0x26df17,_0x3661f1){_0x3661f1=_0x3661f1||0xc8;return function(_0xe0f8d){if(_0xe0f8d){return _0x26df17[_0xe59a('0x14')](_0x3661f1)[_0xe59a('0x15')](_0xe0f8d);}};}function respondWithFilteredResult(_0x5a98c6,_0x46b86a){return function(_0x4d420d){if(_0x4d420d){var _0x2d13fe=typeof _0x46b86a['offset']===_0xe59a('0x16')&&typeof _0x46b86a['limit']===_0xe59a('0x16');var _0x4e6213=_0x4d420d[_0xe59a('0x17')];var _0x4e9718=_0x2d13fe?0x0:_0x46b86a[_0xe59a('0x18')];var _0x6caf4d=_0x2d13fe?_0x4d420d[_0xe59a('0x17')]:_0x46b86a[_0xe59a('0x18')]+_0x46b86a[_0xe59a('0x19')];var _0x48fbcb;if(_0x6caf4d>=_0x4e6213){_0x6caf4d=_0x4e6213;_0x48fbcb=0xc8;}else{_0x48fbcb=0xce;}_0x5a98c6[_0xe59a('0x14')](_0x48fbcb);return _0x5a98c6[_0xe59a('0x1a')]('Content-Range',_0x4e9718+'-'+_0x6caf4d+'/'+_0x4e6213)[_0xe59a('0x15')](_0x4d420d);}return null;};}function patchUpdates(_0x473d55){return function(_0x5df15e){try{jsonpatch['apply'](_0x5df15e,_0x473d55,!![]);}catch(_0x2542e1){return BPromise[_0xe59a('0x1b')](_0x2542e1);}return _0x5df15e['save']();};}function saveUpdates(_0x160200,_0x24f4f0){return function(_0x38eadb){if(_0x38eadb){return _0x38eadb[_0xe59a('0x1c')](_0x160200)[_0xe59a('0x1d')](function(_0x2d26e9){return _0x2d26e9;});}return null;};}function removeEntity(_0x31a8dc,_0x2d5120){return function(_0x289dc3){if(_0x289dc3){return _0x289dc3[_0xe59a('0x1e')]()[_0xe59a('0x1d')](function(){_0x31a8dc[_0xe59a('0x14')](0xcc)[_0xe59a('0x1f')]();});}};}function handleEntityNotFound(_0x21c801,_0x3211e9){return function(_0x261e87){if(!_0x261e87){_0x21c801['sendStatus'](0x194);}return _0x261e87;};}function handleError(_0x11e42f,_0x1aabf3){_0x1aabf3=_0x1aabf3||0x1f4;return function(_0x1a5aab){logger['error'](_0x1a5aab[_0xe59a('0x20')]);if(_0x1a5aab[_0xe59a('0x21')]){delete _0x1a5aab[_0xe59a('0x21')];}_0x11e42f['status'](_0x1aabf3)['send'](_0x1a5aab);};}exports[_0xe59a('0x22')]=function(_0xbc6d4b,_0x2b814c){var _0x2e771e={},_0x58cad6={},_0x28eff0={'count':0x0,'rows':[]};var _0x93fc67=_[_0xe59a('0x23')](db[_0xe59a('0x24')][_0xe59a('0x25')],function(_0x3e37ad){return{'name':_0x3e37ad[_0xe59a('0x26')],'type':_0x3e37ad[_0xe59a('0x27')]['key']};});_0x58cad6[_0xe59a('0x28')]=_[_0xe59a('0x23')](_0x93fc67,_0xe59a('0x21'));_0x58cad6[_0xe59a('0x29')]=_[_0xe59a('0x2a')](_0xbc6d4b['query']);_0x58cad6['filters']=_['intersection'](_0x58cad6['model'],_0x58cad6['query']);_0x2e771e[_0xe59a('0x2b')]=_['intersection'](_0x58cad6[_0xe59a('0x28')],qs['fields'](_0xbc6d4b['query']['fields']));_0x2e771e[_0xe59a('0x2b')]=_0x2e771e[_0xe59a('0x2b')][_0xe59a('0x2c')]?_0x2e771e[_0xe59a('0x2b')]:_0x58cad6['model'];if(!_0xbc6d4b[_0xe59a('0x29')][_0xe59a('0x2d')]('nolimit')){_0x2e771e[_0xe59a('0x19')]=qs[_0xe59a('0x19')](_0xbc6d4b[_0xe59a('0x29')][_0xe59a('0x19')]);_0x2e771e[_0xe59a('0x18')]=qs[_0xe59a('0x18')](_0xbc6d4b['query']['offset']);}_0x2e771e[_0xe59a('0x2e')]=qs[_0xe59a('0x2f')](_0xbc6d4b[_0xe59a('0x29')][_0xe59a('0x2f')]);_0x2e771e['where']=qs[_0xe59a('0x30')](_[_0xe59a('0x31')](_0xbc6d4b[_0xe59a('0x29')],_0x58cad6[_0xe59a('0x30')]),_0x93fc67);if(_0xbc6d4b['query']['filter']){_0x2e771e['where']=_[_0xe59a('0x32')](_0x2e771e[_0xe59a('0x33')],{'$or':_['map'](_0x93fc67,function(_0x17ab68){if(_0x17ab68[_0xe59a('0x27')]!==_0xe59a('0x34')){var _0x99b84e={};_0x99b84e[_0x17ab68[_0xe59a('0x21')]]={'$like':'%'+_0xbc6d4b['query']['filter']+'%'};return _0x99b84e;}})});}_0x2e771e=_[_0xe59a('0x32')]({},_0x2e771e,_0xbc6d4b[_0xe59a('0x35')]);var _0x18e118={'where':_0x2e771e[_0xe59a('0x33')]};return db['FreshsalesAccount'][_0xe59a('0x17')](_0x18e118)[_0xe59a('0x1d')](function(_0xb0ce83){_0x28eff0['count']=_0xb0ce83;if(_0xbc6d4b[_0xe59a('0x29')]['includeAll']){_0x2e771e['include']=[{'all':!![]}];}return db[_0xe59a('0x24')]['findAll'](_0x2e771e);})[_0xe59a('0x1d')](function(_0x3039f2){_0x28eff0[_0xe59a('0x36')]=_0x3039f2;return _0x28eff0;})[_0xe59a('0x1d')](respondWithFilteredResult(_0x2b814c,_0x2e771e))[_0xe59a('0x37')](handleError(_0x2b814c,null));};exports[_0xe59a('0x38')]=function(_0x444827,_0x2f3b9c){var _0x268c46={'raw':![],'where':{'id':_0x444827[_0xe59a('0x39')]['id']}},_0x28ceec={};_0x28ceec['model']=_[_0xe59a('0x2a')](db['FreshsalesAccount']['rawAttributes']);_0x28ceec[_0xe59a('0x29')]=_[_0xe59a('0x2a')](_0x444827[_0xe59a('0x29')]);_0x28ceec[_0xe59a('0x30')]=_[_0xe59a('0x3a')](_0x28ceec[_0xe59a('0x28')],_0x28ceec[_0xe59a('0x29')]);_0x268c46[_0xe59a('0x2b')]=_[_0xe59a('0x3a')](_0x28ceec[_0xe59a('0x28')],qs[_0xe59a('0x3b')](_0x444827['query'][_0xe59a('0x3b')]));_0x268c46[_0xe59a('0x2b')]=_0x268c46[_0xe59a('0x2b')][_0xe59a('0x2c')]?_0x268c46[_0xe59a('0x2b')]:_0x28ceec[_0xe59a('0x28')];if(_0x444827['query'][_0xe59a('0x3c')]){_0x268c46[_0xe59a('0x3d')]=[{'all':!![]}];}_0x268c46=_['merge']({},_0x268c46,_0x444827[_0xe59a('0x35')]);return db[_0xe59a('0x24')][_0xe59a('0x3e')](_0x268c46)['then'](handleEntityNotFound(_0x2f3b9c,null))[_0xe59a('0x1d')](respondWithResult(_0x2f3b9c,null))[_0xe59a('0x37')](handleError(_0x2f3b9c,null));};exports[_0xe59a('0x3f')]=function(_0x5f4c16,_0x1e619a){return db[_0xe59a('0x24')]['create'](_0x5f4c16['body'],{})['then'](respondWithResult(_0x1e619a,0xc9))['catch'](handleError(_0x1e619a,null));};exports['update']=function(_0x179a40,_0x207c32){if(_0x179a40[_0xe59a('0x40')]['id']){delete _0x179a40[_0xe59a('0x40')]['id'];}return db[_0xe59a('0x24')][_0xe59a('0x3e')]({'where':{'id':_0x179a40[_0xe59a('0x39')]['id']}})[_0xe59a('0x1d')](handleEntityNotFound(_0x207c32,null))[_0xe59a('0x1d')](saveUpdates(_0x179a40[_0xe59a('0x40')],null))['then'](respondWithResult(_0x207c32,null))[_0xe59a('0x37')](handleError(_0x207c32,null));};exports[_0xe59a('0x1e')]=function(_0x25461a,_0x4a0502){return db[_0xe59a('0x24')]['find']({'where':{'id':_0x25461a[_0xe59a('0x39')]['id']}})['then'](handleEntityNotFound(_0x4a0502,null))[_0xe59a('0x1d')](removeEntity(_0x4a0502,null))['catch'](handleError(_0x4a0502,null));};exports[_0xe59a('0x41')]=function(_0x46f80c,_0x357572,_0x5d51a8){var _0x530f6e={};var _0x286172={};var _0x18c5a5;var _0x1c7dfc;return db[_0xe59a('0x24')]['findOne']({'where':{'id':_0x46f80c[_0xe59a('0x39')]['id']}})['then'](handleEntityNotFound(_0x357572,null))['then'](function(_0x3df288){if(_0x3df288){_0x18c5a5=_0x3df288;_0x286172[_0xe59a('0x28')]=_[_0xe59a('0x2a')](db[_0xe59a('0x42')][_0xe59a('0x25')]);_0x286172['query']=_['keys'](_0x46f80c[_0xe59a('0x29')]);_0x286172[_0xe59a('0x30')]=_[_0xe59a('0x3a')](_0x286172['model'],_0x286172[_0xe59a('0x29')]);_0x530f6e[_0xe59a('0x2b')]=_[_0xe59a('0x3a')](_0x286172[_0xe59a('0x28')],qs['fields'](_0x46f80c['query']['fields']));_0x530f6e['attributes']=_0x530f6e[_0xe59a('0x2b')][_0xe59a('0x2c')]?_0x530f6e[_0xe59a('0x2b')]:_0x286172['model'];_0x530f6e['order']=qs['sort'](_0x46f80c['query'][_0xe59a('0x2f')]);_0x530f6e['where']=qs[_0xe59a('0x30')](_['pick'](_0x46f80c[_0xe59a('0x29')],_0x286172[_0xe59a('0x30')]));if(_0x46f80c['query'][_0xe59a('0x43')]){_0x530f6e[_0xe59a('0x33')]=_[_0xe59a('0x32')](_0x530f6e[_0xe59a('0x33')],{'$or':_[_0xe59a('0x23')](_0x530f6e[_0xe59a('0x2b')],function(_0x3a1f1){var _0x543b7b={};_0x543b7b[_0x3a1f1]={'$like':'%'+_0x46f80c[_0xe59a('0x29')][_0xe59a('0x43')]+'%'};return _0x543b7b;})});}_0x530f6e=_[_0xe59a('0x32')]({},_0x530f6e,_0x46f80c[_0xe59a('0x35')]);return _0x18c5a5[_0xe59a('0x41')](_0x530f6e);}})[_0xe59a('0x1d')](function(_0x41b129){if(_0x41b129){_0x1c7dfc=_0x41b129['length'];if(!_0x46f80c['query'][_0xe59a('0x2d')](_0xe59a('0x44'))){_0x530f6e[_0xe59a('0x19')]=qs['limit'](_0x46f80c[_0xe59a('0x29')][_0xe59a('0x19')]);_0x530f6e[_0xe59a('0x18')]=qs[_0xe59a('0x18')](_0x46f80c['query'][_0xe59a('0x18')]);}return _0x18c5a5[_0xe59a('0x41')](_0x530f6e);}})[_0xe59a('0x1d')](function(_0x59edfb){if(_0x59edfb){return _0x59edfb?{'count':_0x1c7dfc,'rows':_0x59edfb}:null;}})[_0xe59a('0x1d')](respondWithResult(_0x357572,null))[_0xe59a('0x37')](handleError(_0x357572,null));};exports[_0xe59a('0x45')]=function(_0x317855,_0x369090,_0x342b8c){if(_0x317855['body']['id']){delete _0x317855[_0xe59a('0x40')]['id'];}return db[_0xe59a('0x24')][_0xe59a('0x46')]({'where':{'id':_0x317855[_0xe59a('0x39')]['id']}})['then'](handleEntityNotFound(_0x369090,null))[_0xe59a('0x1d')](function(_0x50c6ee){if(_0x50c6ee){_0x317855['body']['AccountId']=_0x50c6ee['id'];_0x317855[_0xe59a('0x40')]['Subjects']=integrations[_0xe59a('0x47')](_0x317855[_0xe59a('0x40')]['channel'],_0x317855[_0xe59a('0x40')]['type']);_0x317855[_0xe59a('0x40')][_0xe59a('0x48')]=integrations[_0xe59a('0x49')](_0x317855[_0xe59a('0x40')][_0xe59a('0x4a')],_0x317855[_0xe59a('0x40')][_0xe59a('0x27')]);return db[_0xe59a('0x42')]['create'](_0x317855[_0xe59a('0x40')],{'include':[{'model':db[_0xe59a('0x4b')],'as':_0xe59a('0x4c')},{'model':db[_0xe59a('0x4b')],'as':'Descriptions'}]});}return null;})[_0xe59a('0x1d')](respondWithResult(_0x369090,null))[_0xe59a('0x37')](handleError(_0x369090,null));};exports[_0xe59a('0x4d')]=function(_0x1fc79f,_0x4be737,_0x1f21f1){var _0x5d3e30='';var _0x3f75fd='';return db[_0xe59a('0x24')][_0xe59a('0x46')]({'where':{'id':_0x1fc79f['params']['id']},'attributes':['id','username',_0xe59a('0x4e'),_0xe59a('0x4f')]})[_0xe59a('0x1d')](handleEntityNotFound(_0x4be737,null))[_0xe59a('0x1d')](function(_0x1619c2){if(_0x1619c2){_0x3f75fd=_0x1619c2['username'];_0x5d3e30=_0x1619c2[_0xe59a('0x4e')];var _0x4805ac=_0x1619c2[_0xe59a('0x4e')][_0xe59a('0x50')](-0x1);if(_0x4805ac==='/'){_0x5d3e30=_0x5d3e30[_0xe59a('0x51')](0x0,_0x5d3e30[_0xe59a('0x52')](_0x4805ac));}return rp({'method':_0xe59a('0x53'),'uri':util['format'](_0xe59a('0x54'),_0x5d3e30,_0xe59a('0x55')),'headers':{'Authorization':_0xe59a('0x56')+_0x1619c2[_0xe59a('0x4f')]},'json':!![]});}})[_0xe59a('0x1d')](function(_0x27fedd){if(_0x27fedd){var _0x4ca3f3=_0x27fedd[_0xe59a('0x57')];var _0x130240=![];var _0x4a6f5a=null;for(_0x4a6f5a=0x0;_0x4a6f5a<_0x4ca3f3['length'];_0x4a6f5a++){if(_0x4ca3f3[_0x4a6f5a][_0xe59a('0x58')]===_0x3f75fd){_0x130240=!![];}}if(_0x130240){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xe59a('0x59')});}}})[_0xe59a('0x1d')](respondWithResult(_0x4be737,null))[_0xe59a('0x37')](function(_0x4fb8f7){var _0x1c2bca=_0x1fc79f[_0xe59a('0x29')][_0xe59a('0x5a')]?0x1f4:_0x4fb8f7[_0xe59a('0x5b')]||0x1f4;logger[_0xe59a('0x5c')](_0xe59a('0x5d'),_0xe59a('0x4d'),_0x1c2bca,JSON['stringify'](_0x4fb8f7));delete _0x4fb8f7[_0xe59a('0x21')];if(_0x1c2bca===0x191){_0x1c2bca=0x190;}_0x4be737[_0xe59a('0x14')](_0x1c2bca)['send'](_0x1fc79f['query']['test']?{'message':_0xe59a('0x5e'),'statusCode':_0x4fb8f7[_0xe59a('0x5b')]}:_0x4fb8f7);});}; \ No newline at end of file +var _0x8fdf=['name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','getConfigurations','findOne','nolimit','addConfiguration','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','slice','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','test','error','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','sendStatus','stack'];(function(_0xdb2b96,_0x261ff7){var _0x58bb9f=function(_0x5ad749){while(--_0x5ad749){_0xdb2b96['push'](_0xdb2b96['shift']());}};_0x58bb9f(++_0x261ff7);}(_0x8fdf,0x1be));var _0xf8fd=function(_0x193c9e,_0x4e48e2){_0x193c9e=_0x193c9e-0x0;var _0x472e25=_0x8fdf[_0x193c9e];return _0x472e25;};'use strict';var emlformat=require(_0xf8fd('0x0'));var rimraf=require(_0xf8fd('0x1'));var zipdir=require(_0xf8fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf8fd('0x4'));var util=require(_0xf8fd('0x5'));var path=require(_0xf8fd('0x6'));var sox=require(_0xf8fd('0x7'));var csv=require(_0xf8fd('0x8'));var ejs=require(_0xf8fd('0x9'));var fs=require('fs');var fs_extra=require(_0xf8fd('0xa'));var _=require('lodash');var squel=require(_0xf8fd('0xb'));var crypto=require(_0xf8fd('0xc'));var jsforce=require(_0xf8fd('0xd'));var deskjs=require(_0xf8fd('0xe'));var toCsv=require(_0xf8fd('0x8'));var querystring=require('querystring');var Papa=require(_0xf8fd('0xf'));var Redis=require(_0xf8fd('0x10'));var authService=require(_0xf8fd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf8fd('0x12'));var hardwareService=require(_0xf8fd('0x13'));var logger=require('../../config/logger')(_0xf8fd('0x14'));var utils=require(_0xf8fd('0x15'));var config=require(_0xf8fd('0x16'));var licenseUtil=require(_0xf8fd('0x17'));var db=require(_0xf8fd('0x18'))['db'];var integrations=require(_0xf8fd('0x19'));function respondWithStatusCode(_0x52d009,_0x5d54b4){_0x5d54b4=_0x5d54b4||0xcc;return function(_0x55fddd){if(_0x55fddd){return _0x52d009['sendStatus'](_0x5d54b4);}return _0x52d009['status'](_0x5d54b4)[_0xf8fd('0x1a')]();};}function respondWithResult(_0x15fa4a,_0x40414f){_0x40414f=_0x40414f||0xc8;return function(_0x482e88){if(_0x482e88){return _0x15fa4a['status'](_0x40414f)[_0xf8fd('0x1b')](_0x482e88);}};}function respondWithFilteredResult(_0x233c07,_0x6e498f){return function(_0x3d19ce){if(_0x3d19ce){var _0x1c6d44=typeof _0x6e498f[_0xf8fd('0x1c')]==='undefined'&&typeof _0x6e498f['limit']===_0xf8fd('0x1d');var _0x5ee91b=_0x3d19ce[_0xf8fd('0x1e')];var _0x12f7e1=_0x1c6d44?0x0:_0x6e498f[_0xf8fd('0x1c')];var _0x3673ad=_0x1c6d44?_0x3d19ce[_0xf8fd('0x1e')]:_0x6e498f[_0xf8fd('0x1c')]+_0x6e498f[_0xf8fd('0x1f')];var _0x39fb24;if(_0x3673ad>=_0x5ee91b){_0x3673ad=_0x5ee91b;_0x39fb24=0xc8;}else{_0x39fb24=0xce;}_0x233c07[_0xf8fd('0x20')](_0x39fb24);return _0x233c07[_0xf8fd('0x21')](_0xf8fd('0x22'),_0x12f7e1+'-'+_0x3673ad+'/'+_0x5ee91b)[_0xf8fd('0x1b')](_0x3d19ce);}return null;};}function patchUpdates(_0x351f64){return function(_0x52fa06){try{jsonpatch['apply'](_0x52fa06,_0x351f64,!![]);}catch(_0x5438c2){return BPromise['reject'](_0x5438c2);}return _0x52fa06['save']();};}function saveUpdates(_0x55bc10,_0x457ba3){return function(_0x14df65){if(_0x14df65){return _0x14df65['update'](_0x55bc10)[_0xf8fd('0x23')](function(_0x56a82e){return _0x56a82e;});}return null;};}function removeEntity(_0x2db362,_0x23455a){return function(_0x5930ed){if(_0x5930ed){return _0x5930ed[_0xf8fd('0x24')]()['then'](function(){_0x2db362[_0xf8fd('0x20')](0xcc)[_0xf8fd('0x1a')]();});}};}function handleEntityNotFound(_0x56e0fa,_0x1eba4d){return function(_0x1db83d){if(!_0x1db83d){_0x56e0fa[_0xf8fd('0x25')](0x194);}return _0x1db83d;};}function handleError(_0x2bfcf4,_0x51c9b8){_0x51c9b8=_0x51c9b8||0x1f4;return function(_0x5b46e1){logger['error'](_0x5b46e1[_0xf8fd('0x26')]);if(_0x5b46e1['name']){delete _0x5b46e1[_0xf8fd('0x27')];}_0x2bfcf4[_0xf8fd('0x20')](_0x51c9b8)[_0xf8fd('0x28')](_0x5b46e1);};}exports['index']=function(_0x18b21e,_0x1bfa8d){var _0x1f200e={},_0x5cb804={},_0x5f279c={'count':0x0,'rows':[]};var _0x56afca=_['map'](db['FreshsalesAccount'][_0xf8fd('0x29')],function(_0x3478f2){return{'name':_0x3478f2[_0xf8fd('0x2a')],'type':_0x3478f2[_0xf8fd('0x2b')][_0xf8fd('0x2c')]};});_0x5cb804[_0xf8fd('0x2d')]=_['map'](_0x56afca,_0xf8fd('0x27'));_0x5cb804[_0xf8fd('0x2e')]=_[_0xf8fd('0x2f')](_0x18b21e[_0xf8fd('0x2e')]);_0x5cb804[_0xf8fd('0x30')]=_[_0xf8fd('0x31')](_0x5cb804['model'],_0x5cb804[_0xf8fd('0x2e')]);_0x1f200e[_0xf8fd('0x32')]=_['intersection'](_0x5cb804[_0xf8fd('0x2d')],qs[_0xf8fd('0x33')](_0x18b21e['query'][_0xf8fd('0x33')]));_0x1f200e[_0xf8fd('0x32')]=_0x1f200e[_0xf8fd('0x32')][_0xf8fd('0x34')]?_0x1f200e[_0xf8fd('0x32')]:_0x5cb804[_0xf8fd('0x2d')];if(!_0x18b21e['query'][_0xf8fd('0x35')]('nolimit')){_0x1f200e[_0xf8fd('0x1f')]=qs[_0xf8fd('0x1f')](_0x18b21e[_0xf8fd('0x2e')][_0xf8fd('0x1f')]);_0x1f200e[_0xf8fd('0x1c')]=qs['offset'](_0x18b21e[_0xf8fd('0x2e')][_0xf8fd('0x1c')]);}_0x1f200e[_0xf8fd('0x36')]=qs[_0xf8fd('0x37')](_0x18b21e['query'][_0xf8fd('0x37')]);_0x1f200e[_0xf8fd('0x38')]=qs['filters'](_[_0xf8fd('0x39')](_0x18b21e['query'],_0x5cb804[_0xf8fd('0x30')]),_0x56afca);if(_0x18b21e[_0xf8fd('0x2e')][_0xf8fd('0x3a')]){_0x1f200e[_0xf8fd('0x38')]=_[_0xf8fd('0x3b')](_0x1f200e[_0xf8fd('0x38')],{'$or':_[_0xf8fd('0x3c')](_0x56afca,function(_0x4430d5){if(_0x4430d5[_0xf8fd('0x2b')]!==_0xf8fd('0x3d')){var _0x227399={};_0x227399[_0x4430d5[_0xf8fd('0x27')]]={'$like':'%'+_0x18b21e[_0xf8fd('0x2e')]['filter']+'%'};return _0x227399;}})});}_0x1f200e=_[_0xf8fd('0x3b')]({},_0x1f200e,_0x18b21e[_0xf8fd('0x3e')]);var _0x519790={'where':_0x1f200e[_0xf8fd('0x38')]};return db[_0xf8fd('0x3f')][_0xf8fd('0x1e')](_0x519790)['then'](function(_0x58d553){_0x5f279c[_0xf8fd('0x1e')]=_0x58d553;if(_0x18b21e['query'][_0xf8fd('0x40')]){_0x1f200e[_0xf8fd('0x41')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xf8fd('0x42')](_0x1f200e);})['then'](function(_0x22aa1f){_0x5f279c[_0xf8fd('0x43')]=_0x22aa1f;return _0x5f279c;})[_0xf8fd('0x23')](respondWithFilteredResult(_0x1bfa8d,_0x1f200e))[_0xf8fd('0x44')](handleError(_0x1bfa8d,null));};exports[_0xf8fd('0x45')]=function(_0x2a1f0f,_0x585c09){var _0x4fae42={'raw':![],'where':{'id':_0x2a1f0f[_0xf8fd('0x46')]['id']}},_0xee6450={};_0xee6450['model']=_[_0xf8fd('0x2f')](db[_0xf8fd('0x3f')][_0xf8fd('0x29')]);_0xee6450[_0xf8fd('0x2e')]=_['keys'](_0x2a1f0f[_0xf8fd('0x2e')]);_0xee6450[_0xf8fd('0x30')]=_[_0xf8fd('0x31')](_0xee6450[_0xf8fd('0x2d')],_0xee6450[_0xf8fd('0x2e')]);_0x4fae42['attributes']=_[_0xf8fd('0x31')](_0xee6450[_0xf8fd('0x2d')],qs[_0xf8fd('0x33')](_0x2a1f0f[_0xf8fd('0x2e')][_0xf8fd('0x33')]));_0x4fae42[_0xf8fd('0x32')]=_0x4fae42['attributes']['length']?_0x4fae42[_0xf8fd('0x32')]:_0xee6450[_0xf8fd('0x2d')];if(_0x2a1f0f[_0xf8fd('0x2e')][_0xf8fd('0x40')]){_0x4fae42['include']=[{'all':!![]}];}_0x4fae42=_[_0xf8fd('0x3b')]({},_0x4fae42,_0x2a1f0f['options']);return db[_0xf8fd('0x3f')][_0xf8fd('0x47')](_0x4fae42)['then'](handleEntityNotFound(_0x585c09,null))['then'](respondWithResult(_0x585c09,null))[_0xf8fd('0x44')](handleError(_0x585c09,null));};exports[_0xf8fd('0x48')]=function(_0x18ff4f,_0x34bb0b){return db[_0xf8fd('0x3f')][_0xf8fd('0x48')](_0x18ff4f['body'],{})[_0xf8fd('0x23')](respondWithResult(_0x34bb0b,0xc9))['catch'](handleError(_0x34bb0b,null));};exports[_0xf8fd('0x49')]=function(_0x1db5d0,_0x3b45f8){if(_0x1db5d0[_0xf8fd('0x4a')]['id']){delete _0x1db5d0[_0xf8fd('0x4a')]['id'];}return db['FreshsalesAccount'][_0xf8fd('0x47')]({'where':{'id':_0x1db5d0['params']['id']}})['then'](handleEntityNotFound(_0x3b45f8,null))[_0xf8fd('0x23')](saveUpdates(_0x1db5d0[_0xf8fd('0x4a')],null))[_0xf8fd('0x23')](respondWithResult(_0x3b45f8,null))[_0xf8fd('0x44')](handleError(_0x3b45f8,null));};exports['destroy']=function(_0x30fd61,_0x175926){return db[_0xf8fd('0x3f')][_0xf8fd('0x47')]({'where':{'id':_0x30fd61[_0xf8fd('0x46')]['id']}})[_0xf8fd('0x23')](handleEntityNotFound(_0x175926,null))[_0xf8fd('0x23')](removeEntity(_0x175926,null))[_0xf8fd('0x44')](handleError(_0x175926,null));};exports[_0xf8fd('0x4b')]=function(_0x32403a,_0x2e7b15,_0x2416ad){var _0x1d56dd={};var _0x31cb25={};var _0x50aa97;var _0x389ea9;return db[_0xf8fd('0x3f')][_0xf8fd('0x4c')]({'where':{'id':_0x32403a[_0xf8fd('0x46')]['id']}})[_0xf8fd('0x23')](handleEntityNotFound(_0x2e7b15,null))[_0xf8fd('0x23')](function(_0x3b01cf){if(_0x3b01cf){_0x50aa97=_0x3b01cf;_0x31cb25['model']=_[_0xf8fd('0x2f')](db['FreshsalesConfiguration'][_0xf8fd('0x29')]);_0x31cb25[_0xf8fd('0x2e')]=_[_0xf8fd('0x2f')](_0x32403a[_0xf8fd('0x2e')]);_0x31cb25[_0xf8fd('0x30')]=_[_0xf8fd('0x31')](_0x31cb25[_0xf8fd('0x2d')],_0x31cb25[_0xf8fd('0x2e')]);_0x1d56dd['attributes']=_[_0xf8fd('0x31')](_0x31cb25[_0xf8fd('0x2d')],qs['fields'](_0x32403a[_0xf8fd('0x2e')]['fields']));_0x1d56dd['attributes']=_0x1d56dd[_0xf8fd('0x32')][_0xf8fd('0x34')]?_0x1d56dd['attributes']:_0x31cb25[_0xf8fd('0x2d')];_0x1d56dd[_0xf8fd('0x36')]=qs[_0xf8fd('0x37')](_0x32403a[_0xf8fd('0x2e')][_0xf8fd('0x37')]);_0x1d56dd[_0xf8fd('0x38')]=qs[_0xf8fd('0x30')](_['pick'](_0x32403a['query'],_0x31cb25[_0xf8fd('0x30')]));if(_0x32403a['query'][_0xf8fd('0x3a')]){_0x1d56dd[_0xf8fd('0x38')]=_[_0xf8fd('0x3b')](_0x1d56dd['where'],{'$or':_['map'](_0x1d56dd[_0xf8fd('0x32')],function(_0x3e57e0){var _0x19facc={};_0x19facc[_0x3e57e0]={'$like':'%'+_0x32403a[_0xf8fd('0x2e')]['filter']+'%'};return _0x19facc;})});}_0x1d56dd=_['merge']({},_0x1d56dd,_0x32403a['options']);return _0x50aa97[_0xf8fd('0x4b')](_0x1d56dd);}})[_0xf8fd('0x23')](function(_0x16cc5d){if(_0x16cc5d){_0x389ea9=_0x16cc5d[_0xf8fd('0x34')];if(!_0x32403a[_0xf8fd('0x2e')][_0xf8fd('0x35')](_0xf8fd('0x4d'))){_0x1d56dd['limit']=qs['limit'](_0x32403a[_0xf8fd('0x2e')]['limit']);_0x1d56dd['offset']=qs['offset'](_0x32403a[_0xf8fd('0x2e')][_0xf8fd('0x1c')]);}return _0x50aa97['getConfigurations'](_0x1d56dd);}})['then'](function(_0x5d703c){if(_0x5d703c){return _0x5d703c?{'count':_0x389ea9,'rows':_0x5d703c}:null;}})['then'](respondWithResult(_0x2e7b15,null))[_0xf8fd('0x44')](handleError(_0x2e7b15,null));};exports[_0xf8fd('0x4e')]=function(_0x420a8c,_0x427ac5,_0x26d481){if(_0x420a8c['body']['id']){delete _0x420a8c[_0xf8fd('0x4a')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x420a8c[_0xf8fd('0x46')]['id']}})[_0xf8fd('0x23')](handleEntityNotFound(_0x427ac5,null))[_0xf8fd('0x23')](function(_0x4fba30){if(_0x4fba30){_0x420a8c['body']['AccountId']=_0x4fba30['id'];_0x420a8c[_0xf8fd('0x4a')][_0xf8fd('0x4f')]=integrations['getSubjects'](_0x420a8c[_0xf8fd('0x4a')][_0xf8fd('0x50')],_0x420a8c[_0xf8fd('0x4a')][_0xf8fd('0x2b')]);_0x420a8c[_0xf8fd('0x4a')]['Descriptions']=integrations[_0xf8fd('0x51')](_0x420a8c['body'][_0xf8fd('0x50')],_0x420a8c['body'][_0xf8fd('0x2b')]);return db['FreshsalesConfiguration'][_0xf8fd('0x48')](_0x420a8c['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xf8fd('0x4f')},{'model':db[_0xf8fd('0x52')],'as':_0xf8fd('0x53')}]});}return null;})[_0xf8fd('0x23')](respondWithResult(_0x427ac5,null))[_0xf8fd('0x44')](handleError(_0x427ac5,null));};exports[_0xf8fd('0x54')]=function(_0x16292a,_0xaf7f8d,_0x2abc93){var _0x8b23cd='';var _0x445a76='';return db[_0xf8fd('0x3f')][_0xf8fd('0x4c')]({'where':{'id':_0x16292a[_0xf8fd('0x46')]['id']},'attributes':['id',_0xf8fd('0x55'),'remoteUri',_0xf8fd('0x56')]})[_0xf8fd('0x23')](handleEntityNotFound(_0xaf7f8d,null))[_0xf8fd('0x23')](function(_0xafa46d){if(_0xafa46d){_0x445a76=_0xafa46d[_0xf8fd('0x55')];_0x8b23cd=_0xafa46d[_0xf8fd('0x57')];var _0x51965b=_0xafa46d[_0xf8fd('0x57')][_0xf8fd('0x58')](-0x1);if(_0x51965b==='/'){_0x8b23cd=_0x8b23cd['substring'](0x0,_0x8b23cd[_0xf8fd('0x59')](_0x51965b));}return rp({'method':'GET','uri':util['format'](_0xf8fd('0x5a'),_0x8b23cd,_0xf8fd('0x5b')),'headers':{'Authorization':_0xf8fd('0x5c')+_0xafa46d[_0xf8fd('0x56')]},'json':!![]});}})[_0xf8fd('0x23')](function(_0x228b2c){if(_0x228b2c){var _0x1e5d12=_0x228b2c['users'];var _0x47a731=![];var _0x2db820=null;for(_0x2db820=0x0;_0x2db820<_0x1e5d12[_0xf8fd('0x34')];_0x2db820++){if(_0x1e5d12[_0x2db820]['email']===_0x445a76){_0x47a731=!![];}}if(_0x47a731){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xf8fd('0x23')](respondWithResult(_0xaf7f8d,null))[_0xf8fd('0x44')](function(_0x49a184){var _0x250939=_0x16292a['query'][_0xf8fd('0x5d')]?0x1f4:_0x49a184['statusCode']||0x1f4;logger[_0xf8fd('0x5e')](_0xf8fd('0x5f'),'getFields',_0x250939,JSON['stringify'](_0x49a184));delete _0x49a184[_0xf8fd('0x27')];if(_0x250939===0x191){_0x250939=0x190;}_0xaf7f8d['status'](_0x250939)['send'](_0x16292a[_0xf8fd('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x49a184[_0xf8fd('0x60')]}:_0x49a184);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 52ede2a..9654741 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 _0x3a6d=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x1193cb,_0x588c90){var _0x1ed3e8=function(_0x506828){while(--_0x506828){_0x1193cb['push'](_0x1193cb['shift']());}};_0x1ed3e8(++_0x588c90);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3a6d[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));var integrations=require(_0xd3a6('0x9'));module[_0xd3a6('0xa')]=function(_0x25b042,_0x282cb1){return _0x25b042['define'](_0xd3a6('0xb'),attributes,{'tableName':_0xd3a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x627e=['path','rimraf','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1c4e07,_0x56e8a4){var _0x344614=function(_0xfe9ecd){while(--_0xfe9ecd){_0x1c4e07['push'](_0x1c4e07['shift']());}};_0x344614(++_0x56e8a4);}(_0x627e,0x14a));var _0xe627=function(_0x44fecb,_0x504b9e){_0x44fecb=_0x44fecb-0x0;var _0x3d7a20=_0x627e[_0x44fecb];return _0x3d7a20;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var logger=require(_0xe627('0x2'))(_0xe627('0x3'));var moment=require(_0xe627('0x4'));var BPromise=require('bluebird');var rp=require(_0xe627('0x5'));var fs=require('fs');var path=require(_0xe627('0x6'));var rimraf=require(_0xe627('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe627('0x8')]=function(_0x3f2791,_0x45e49a){return _0x3f2791[_0xe627('0x9')](_0xe627('0xa'),attributes,{'tableName':_0xe627('0xb'),'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 2ac7f10..b1e9909 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 _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x3f0f2e,_0xf2b92d){var _0x49fc6f=function(_0x4a2274){while(--_0x4a2274){_0x3f0f2e['push'](_0x3f0f2e['shift']());}};_0x49fc6f(++_0xf2b92d);}(_0xafc4,0x69));var _0x4afc=function(_0x59c06b,_0x414a94){_0x59c06b=_0x59c06b-0x0;var _0x485167=_0xafc4[_0x59c06b];return _0x485167;};'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')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\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')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0x2a07=['GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x44cc17,_0x5dcb11){var _0x2ab179=function(_0x5379db){while(--_0x5379db){_0x44cc17['push'](_0x44cc17['shift']());}};_0x2ab179(++_0x5dcb11);}(_0x2a07,0x74));var _0x72a0=function(_0x29dc54,_0x2cc32e){_0x29dc54=_0x29dc54-0x0;var _0xaabea6=_0x2a07[_0x29dc54];return _0xaabea6;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['GetFreshsalesAccount']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')]({'raw':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1a')]||null:null,'attributes':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['attributes']||null:null,'limit':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1b')]||null:null,'include':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x3022b0){return{'model':db[_0x3022b0[_0x72a0('0x1e')]],'as':_0x3022b0['as'],'attributes':_0x3022b0['attributes'],'include':_0x3022b0['include']?_[_0x72a0('0x1d')](_0x3022b0[_0x72a0('0x1c')],function(_0x123df4){return{'model':db[_0x123df4[_0x72a0('0x1e')]],'as':_0x123df4['as'],'attributes':_0x123df4[_0x72a0('0x1f')],'include':_0x123df4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x123df4[_0x72a0('0x1c')],function(_0xee99e2){return{'model':db[_0xee99e2[_0x72a0('0x1e')]],'as':_0xee99e2['as'],'attributes':_0xee99e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x553641){logger[_0x72a0('0x15')](_0x72a0('0x20'),_0x100d8f);logger[_0x72a0('0x21')](_0x72a0('0x20'),_0x100d8f,JSON[_0x72a0('0x12')](_0x553641));_0x131b73(_0x553641);})[_0x72a0('0x16')](function(_0x23c96a){logger[_0x72a0('0x13')]('GetFreshsalesAccount',_0x23c96a[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x23c96a[_0x72a0('0x14')]));});});};exports[_0x72a0('0x22')]=function(_0x13c04){var _0x19e783=this;return new Promise(function(_0x3a5e54,_0x592401){return db[_0x72a0('0x17')][_0x72a0('0x23')]({'raw':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x24')]===undefined?!![]:![]:!![],'where':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1a')]||null:null,'attributes':_0x13c04['options']?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1f')]||null:null,'include':_0x13c04[_0x72a0('0x19')]?_0x13c04['options'][_0x72a0('0x1c')]?_['map'](_0x13c04[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x1d02c4){return{'model':db[_0x1d02c4[_0x72a0('0x1e')]],'as':_0x1d02c4['as'],'attributes':_0x1d02c4[_0x72a0('0x1f')],'include':_0x1d02c4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x1d02c4[_0x72a0('0x1c')],function(_0x154c1e){return{'model':db[_0x154c1e[_0x72a0('0x1e')]],'as':_0x154c1e['as'],'attributes':_0x154c1e[_0x72a0('0x1f')],'include':_0x154c1e[_0x72a0('0x1c')]?_['map'](_0x154c1e[_0x72a0('0x1c')],function(_0x5eb8f1){return{'model':db[_0x5eb8f1[_0x72a0('0x1e')]],'as':_0x5eb8f1['as'],'attributes':_0x5eb8f1[_0x72a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x1a9597){logger[_0x72a0('0x15')](_0x72a0('0x22'),_0x13c04);logger[_0x72a0('0x21')](_0x72a0('0x22'),_0x13c04,JSON[_0x72a0('0x12')](_0x1a9597));_0x3a5e54(_0x1a9597);})['catch'](function(_0x4a973a){logger[_0x72a0('0x13')](_0x72a0('0x22'),_0x4a973a[_0x72a0('0x14')],_0x13c04);_0x592401(_0x19e783[_0x72a0('0x13')](0x1f4,_0x4a973a[_0x72a0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e85bd97..254f846 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 _0x8e95=['getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x35a5b7,_0x2171dd){var _0x189439=function(_0x4c8501){while(--_0x4c8501){_0x35a5b7['push'](_0x35a5b7['shift']());}};_0x189439(++_0x2171dd);}(_0x8e95,0x16f));var _0x58e9=function(_0x34fcc8,_0x57a2c9){_0x34fcc8=_0x34fcc8-0x0;var _0x42fb7f=_0x8e95[_0x34fcc8];return _0x42fb7f;};'use strict';var multer=require(_0x58e9('0x0'));var util=require('util');var path=require(_0x58e9('0x1'));var timeout=require(_0x58e9('0x2'));var express=require('express');var router=express[_0x58e9('0x3')]();var fs_extra=require(_0x58e9('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x58e9('0x5'));var config=require(_0x58e9('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x58e9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x58e9('0x8'),auth[_0x58e9('0x9')](),controller[_0x58e9('0xa')]);router[_0x58e9('0x7')]('/:id/subjects',auth[_0x58e9('0x9')](),controller[_0x58e9('0xb')]);router[_0x58e9('0x7')](_0x58e9('0xc'),auth[_0x58e9('0x9')](),controller[_0x58e9('0xd')]);router[_0x58e9('0x7')](_0x58e9('0xe'),auth[_0x58e9('0x9')](),controller['getFields']);router[_0x58e9('0xf')]('/',auth[_0x58e9('0x9')](),controller[_0x58e9('0x10')]);router[_0x58e9('0x11')](_0x58e9('0x8'),auth[_0x58e9('0x9')](),controller[_0x58e9('0x12')]);router[_0x58e9('0x13')](_0x58e9('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x58e9('0x14')]=router; \ No newline at end of file +var _0xf9ba=['/:id','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','put'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xf9ba,0x131));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf9b('0x0'));var util=require(_0xaf9b('0x1'));var path=require(_0xaf9b('0x2'));var timeout=require(_0xaf9b('0x3'));var express=require('express');var router=express[_0xaf9b('0x4')]();var fs_extra=require(_0xaf9b('0x5'));var auth=require(_0xaf9b('0x6'));var interaction=require(_0xaf9b('0x7'));var config=require(_0xaf9b('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xaf9b('0x9')]('/',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0xb')]);router[_0xaf9b('0x9')]('/:id',auth[_0xaf9b('0xa')](),controller['show']);router[_0xaf9b('0x9')](_0xaf9b('0xc'),auth[_0xaf9b('0xa')](),controller['getSubjects']);router[_0xaf9b('0x9')](_0xaf9b('0xd'),auth['isAuthenticated'](),controller[_0xaf9b('0xe')]);router[_0xaf9b('0x9')]('/:id/fields',auth[_0xaf9b('0xa')](),controller[_0xaf9b('0xf')]);router[_0xaf9b('0x10')]('/',auth[_0xaf9b('0xa')](),controller['create']);router[_0xaf9b('0x11')](_0xaf9b('0x12'),auth[_0xaf9b('0xa')](),controller['update']);router['delete'](_0xaf9b('0x12'),auth[_0xaf9b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 20cba73..d34bf48 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 _0x8e77=['STRING','exports'];(function(_0x4e2b1c,_0x531fac){var _0x420e03=function(_0x214793){while(--_0x214793){_0x4e2b1c['push'](_0x4e2b1c['shift']());}};_0x420e03(++_0x531fac);}(_0x8e77,0x19d));var _0x78e7=function(_0x18b191,_0x4e0684){_0x18b191=_0x18b191-0x0;var _0x43e146=_0x8e77[_0x18b191];return _0x43e146;};'use strict';var Sequelize=require('sequelize');module[_0x78e7('0x0')]={'name':{'type':Sequelize[_0x78e7('0x1')]},'description':{'type':Sequelize[_0x78e7('0x1')]}}; \ No newline at end of file +var _0xc2ab=['sequelize','exports','STRING'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc2ab,0x171));var _0xbc2a=function(_0x239cee,_0xf786c8){_0x239cee=_0x239cee-0x0;var _0x4fe6b6=_0xc2ab[_0x239cee];return _0x4fe6b6;};'use strict';var Sequelize=require(_0xbc2a('0x0'));module[_0xbc2a('0x1')]={'name':{'type':Sequelize[_0xbc2a('0x2')]},'description':{'type':Sequelize[_0xbc2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 25002e6..f128e2e 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 _0x4ea2=['keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','getSubjects','findOne','FreshsalesField','order','nolimit','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','query'];(function(_0x1dc91b,_0x5282c9){var _0x3ba8ba=function(_0x139b28){while(--_0x139b28){_0x1dc91b['push'](_0x1dc91b['shift']());}};_0x3ba8ba(++_0x5282c9);}(_0x4ea2,0x1b4));var _0x24ea=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0x4ea2[_0x383dbb];return _0x6e8bde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24ea('0x0'));var zipdir=require(_0x24ea('0x1'));var jsonpatch=require(_0x24ea('0x2'));var rp=require(_0x24ea('0x3'));var moment=require(_0x24ea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x24ea('0x5'));var csv=require(_0x24ea('0x6'));var ejs=require(_0x24ea('0x7'));var fs=require('fs');var fs_extra=require(_0x24ea('0x8'));var _=require(_0x24ea('0x9'));var squel=require(_0x24ea('0xa'));var crypto=require('crypto');var jsforce=require(_0x24ea('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x24ea('0x6'));var querystring=require('querystring');var Papa=require(_0x24ea('0xc'));var Redis=require('ioredis');var authService=require(_0x24ea('0xd'));var qs=require(_0x24ea('0xe'));var as=require(_0x24ea('0xf'));var hardwareService=require(_0x24ea('0x10'));var logger=require(_0x24ea('0x11'))(_0x24ea('0x12'));var utils=require(_0x24ea('0x13'));var config=require(_0x24ea('0x14'));var licenseUtil=require(_0x24ea('0x15'));var db=require(_0x24ea('0x16'))['db'];function respondWithStatusCode(_0x4c9449,_0x58248f){_0x58248f=_0x58248f||0xcc;return function(_0x3288d9){if(_0x3288d9){return _0x4c9449[_0x24ea('0x17')](_0x58248f);}return _0x4c9449[_0x24ea('0x18')](_0x58248f)[_0x24ea('0x19')]();};}function respondWithResult(_0x1d0924,_0x5d4156){_0x5d4156=_0x5d4156||0xc8;return function(_0x3cffa2){if(_0x3cffa2){return _0x1d0924[_0x24ea('0x18')](_0x5d4156)[_0x24ea('0x1a')](_0x3cffa2);}};}function respondWithFilteredResult(_0x5354dc,_0x4e3e61){return function(_0x1853a5){if(_0x1853a5){var _0x451246=typeof _0x4e3e61['offset']===_0x24ea('0x1b')&&typeof _0x4e3e61[_0x24ea('0x1c')]===_0x24ea('0x1b');var _0x28d110=_0x1853a5[_0x24ea('0x1d')];var _0x4c8476=_0x451246?0x0:_0x4e3e61['offset'];var _0x3c2470=_0x451246?_0x1853a5[_0x24ea('0x1d')]:_0x4e3e61[_0x24ea('0x1e')]+_0x4e3e61[_0x24ea('0x1c')];var _0x563347;if(_0x3c2470>=_0x28d110){_0x3c2470=_0x28d110;_0x563347=0xc8;}else{_0x563347=0xce;}_0x5354dc[_0x24ea('0x18')](_0x563347);return _0x5354dc[_0x24ea('0x1f')](_0x24ea('0x20'),_0x4c8476+'-'+_0x3c2470+'/'+_0x28d110)[_0x24ea('0x1a')](_0x1853a5);}return null;};}function patchUpdates(_0x53a0fd){return function(_0x2bab45){try{jsonpatch[_0x24ea('0x21')](_0x2bab45,_0x53a0fd,!![]);}catch(_0x1694ff){return BPromise[_0x24ea('0x22')](_0x1694ff);}return _0x2bab45[_0x24ea('0x23')]();};}function saveUpdates(_0x4af0d8,_0x3181ec){return function(_0xdabd02){if(_0xdabd02){return _0xdabd02[_0x24ea('0x24')](_0x4af0d8)[_0x24ea('0x25')](function(_0x3bc78e){return _0x3bc78e;});}return null;};}function removeEntity(_0x3b5f47,_0x5059dd){return function(_0x2d28be){if(_0x2d28be){return _0x2d28be[_0x24ea('0x26')]()[_0x24ea('0x25')](function(){_0x3b5f47[_0x24ea('0x18')](0xcc)[_0x24ea('0x19')]();});}};}function handleEntityNotFound(_0x437065,_0x186dc7){return function(_0x47fe59){if(!_0x47fe59){_0x437065[_0x24ea('0x17')](0x194);}return _0x47fe59;};}function handleError(_0xe58189,_0x56a269){_0x56a269=_0x56a269||0x1f4;return function(_0x45bc29){logger[_0x24ea('0x27')](_0x45bc29[_0x24ea('0x28')]);if(_0x45bc29['name']){delete _0x45bc29[_0x24ea('0x29')];}_0xe58189[_0x24ea('0x18')](_0x56a269)[_0x24ea('0x2a')](_0x45bc29);};}exports[_0x24ea('0x2b')]=function(_0x174a9b,_0x357596){var _0x463eda={},_0x58b516={},_0x403832={'count':0x0,'rows':[]};var _0x10d69d=_['map'](db[_0x24ea('0x2c')][_0x24ea('0x2d')],function(_0x1fcb5e){return{'name':_0x1fcb5e['fieldName'],'type':_0x1fcb5e[_0x24ea('0x2e')][_0x24ea('0x2f')]};});_0x58b516[_0x24ea('0x30')]=_['map'](_0x10d69d,_0x24ea('0x29'));_0x58b516[_0x24ea('0x31')]=_[_0x24ea('0x32')](_0x174a9b[_0x24ea('0x31')]);_0x58b516[_0x24ea('0x33')]=_['intersection'](_0x58b516[_0x24ea('0x30')],_0x58b516['query']);_0x463eda[_0x24ea('0x34')]=_[_0x24ea('0x35')](_0x58b516[_0x24ea('0x30')],qs[_0x24ea('0x36')](_0x174a9b['query'][_0x24ea('0x36')]));_0x463eda[_0x24ea('0x34')]=_0x463eda['attributes']['length']?_0x463eda[_0x24ea('0x34')]:_0x58b516['model'];if(!_0x174a9b[_0x24ea('0x31')][_0x24ea('0x37')]('nolimit')){_0x463eda[_0x24ea('0x1c')]=qs[_0x24ea('0x1c')](_0x174a9b[_0x24ea('0x31')]['limit']);_0x463eda[_0x24ea('0x1e')]=qs[_0x24ea('0x1e')](_0x174a9b[_0x24ea('0x31')][_0x24ea('0x1e')]);}_0x463eda['order']=qs[_0x24ea('0x38')](_0x174a9b[_0x24ea('0x31')][_0x24ea('0x38')]);_0x463eda[_0x24ea('0x39')]=qs['filters'](_[_0x24ea('0x3a')](_0x174a9b[_0x24ea('0x31')],_0x58b516[_0x24ea('0x33')]),_0x10d69d);if(_0x174a9b[_0x24ea('0x31')][_0x24ea('0x3b')]){_0x463eda[_0x24ea('0x39')]=_[_0x24ea('0x3c')](_0x463eda[_0x24ea('0x39')],{'$or':_[_0x24ea('0x3d')](_0x10d69d,function(_0x1935de){if(_0x1935de['type']!==_0x24ea('0x3e')){var _0xc39e1b={};_0xc39e1b[_0x1935de[_0x24ea('0x29')]]={'$like':'%'+_0x174a9b[_0x24ea('0x31')][_0x24ea('0x3b')]+'%'};return _0xc39e1b;}})});}_0x463eda=_[_0x24ea('0x3c')]({},_0x463eda,_0x174a9b[_0x24ea('0x3f')]);var _0x29ee6e={'where':_0x463eda[_0x24ea('0x39')]};return db[_0x24ea('0x2c')][_0x24ea('0x1d')](_0x29ee6e)[_0x24ea('0x25')](function(_0x2fcb48){_0x403832['count']=_0x2fcb48;if(_0x174a9b[_0x24ea('0x31')][_0x24ea('0x40')]){_0x463eda[_0x24ea('0x41')]=[{'all':!![]}];}return db[_0x24ea('0x2c')][_0x24ea('0x42')](_0x463eda);})[_0x24ea('0x25')](function(_0x59d59a){_0x403832['rows']=_0x59d59a;return _0x403832;})[_0x24ea('0x25')](respondWithFilteredResult(_0x357596,_0x463eda))[_0x24ea('0x43')](handleError(_0x357596,null));};exports[_0x24ea('0x44')]=function(_0x5a3e85,_0x2a3884){var _0x4f3c7b={'raw':![],'where':{'id':_0x5a3e85[_0x24ea('0x45')]['id']}},_0x297a14={};_0x297a14[_0x24ea('0x30')]=_['keys'](db[_0x24ea('0x2c')][_0x24ea('0x2d')]);_0x297a14[_0x24ea('0x31')]=_['keys'](_0x5a3e85[_0x24ea('0x31')]);_0x297a14['filters']=_[_0x24ea('0x35')](_0x297a14['model'],_0x297a14[_0x24ea('0x31')]);_0x4f3c7b['attributes']=_[_0x24ea('0x35')](_0x297a14[_0x24ea('0x30')],qs[_0x24ea('0x36')](_0x5a3e85['query'][_0x24ea('0x36')]));_0x4f3c7b['attributes']=_0x4f3c7b[_0x24ea('0x34')][_0x24ea('0x46')]?_0x4f3c7b[_0x24ea('0x34')]:_0x297a14[_0x24ea('0x30')];if(_0x5a3e85[_0x24ea('0x31')][_0x24ea('0x40')]){_0x4f3c7b[_0x24ea('0x41')]=[{'all':!![]}];}_0x4f3c7b=_['merge']({},_0x4f3c7b,_0x5a3e85[_0x24ea('0x3f')]);return db[_0x24ea('0x2c')][_0x24ea('0x47')](_0x4f3c7b)[_0x24ea('0x25')](handleEntityNotFound(_0x2a3884,null))[_0x24ea('0x25')](respondWithResult(_0x2a3884,null))[_0x24ea('0x43')](handleError(_0x2a3884,null));};exports[_0x24ea('0x48')]=function(_0x338397,_0xafc9a1){return db[_0x24ea('0x2c')][_0x24ea('0x48')](_0x338397['body'],{})[_0x24ea('0x25')](respondWithResult(_0xafc9a1,0xc9))[_0x24ea('0x43')](handleError(_0xafc9a1,null));};exports[_0x24ea('0x24')]=function(_0x44a150,_0x48f4f9){if(_0x44a150[_0x24ea('0x49')]['id']){delete _0x44a150[_0x24ea('0x49')]['id'];}return db[_0x24ea('0x2c')][_0x24ea('0x47')]({'where':{'id':_0x44a150['params']['id']}})[_0x24ea('0x25')](handleEntityNotFound(_0x48f4f9,null))[_0x24ea('0x25')](saveUpdates(_0x44a150['body'],null))[_0x24ea('0x25')](respondWithResult(_0x48f4f9,null))[_0x24ea('0x43')](handleError(_0x48f4f9,null));};exports[_0x24ea('0x26')]=function(_0x3b85c5,_0x9931b4){return db[_0x24ea('0x2c')][_0x24ea('0x47')]({'where':{'id':_0x3b85c5[_0x24ea('0x45')]['id']}})[_0x24ea('0x25')](handleEntityNotFound(_0x9931b4,null))[_0x24ea('0x25')](removeEntity(_0x9931b4,null))[_0x24ea('0x43')](handleError(_0x9931b4,null));};exports[_0x24ea('0x4a')]=function(_0x390eea,_0x13d7db,_0x568bcd){var _0x3e180b={};var _0x53e55e={};var _0x50fe15;var _0x58b253;return db['FreshsalesConfiguration'][_0x24ea('0x4b')]({'where':{'id':_0x390eea[_0x24ea('0x45')]['id']}})[_0x24ea('0x25')](handleEntityNotFound(_0x13d7db,null))[_0x24ea('0x25')](function(_0x327d69){if(_0x327d69){_0x50fe15=_0x327d69;_0x53e55e[_0x24ea('0x30')]=_[_0x24ea('0x32')](db[_0x24ea('0x4c')]['rawAttributes']);_0x53e55e[_0x24ea('0x31')]=_[_0x24ea('0x32')](_0x390eea['query']);_0x53e55e[_0x24ea('0x33')]=_[_0x24ea('0x35')](_0x53e55e[_0x24ea('0x30')],_0x53e55e[_0x24ea('0x31')]);_0x3e180b[_0x24ea('0x34')]=_[_0x24ea('0x35')](_0x53e55e[_0x24ea('0x30')],qs['fields'](_0x390eea[_0x24ea('0x31')][_0x24ea('0x36')]));_0x3e180b[_0x24ea('0x34')]=_0x3e180b[_0x24ea('0x34')][_0x24ea('0x46')]?_0x3e180b[_0x24ea('0x34')]:_0x53e55e[_0x24ea('0x30')];_0x3e180b[_0x24ea('0x4d')]=qs[_0x24ea('0x38')](_0x390eea[_0x24ea('0x31')][_0x24ea('0x38')]);_0x3e180b[_0x24ea('0x39')]=qs[_0x24ea('0x33')](_[_0x24ea('0x3a')](_0x390eea[_0x24ea('0x31')],_0x53e55e[_0x24ea('0x33')]));if(_0x390eea[_0x24ea('0x31')][_0x24ea('0x3b')]){_0x3e180b[_0x24ea('0x39')]=_[_0x24ea('0x3c')](_0x3e180b[_0x24ea('0x39')],{'$or':_['map'](_0x3e180b[_0x24ea('0x34')],function(_0x5d0d33){var _0x33e89a={};_0x33e89a[_0x5d0d33]={'$like':'%'+_0x390eea[_0x24ea('0x31')][_0x24ea('0x3b')]+'%'};return _0x33e89a;})});}_0x3e180b=_[_0x24ea('0x3c')]({},_0x3e180b,_0x390eea['options']);return _0x50fe15[_0x24ea('0x4a')](_0x3e180b);}})[_0x24ea('0x25')](function(_0x111d73){if(_0x111d73){_0x58b253=_0x111d73[_0x24ea('0x46')];if(!_0x390eea[_0x24ea('0x31')][_0x24ea('0x37')](_0x24ea('0x4e'))){_0x3e180b[_0x24ea('0x1c')]=qs['limit'](_0x390eea[_0x24ea('0x31')]['limit']);_0x3e180b[_0x24ea('0x1e')]=qs[_0x24ea('0x1e')](_0x390eea[_0x24ea('0x31')]['offset']);}return _0x50fe15[_0x24ea('0x4a')](_0x3e180b);}})[_0x24ea('0x25')](function(_0x4aa496){if(_0x4aa496){return _0x4aa496?{'count':_0x58b253,'rows':_0x4aa496}:null;}})[_0x24ea('0x25')](respondWithResult(_0x13d7db,null))['catch'](handleError(_0x13d7db,null));};exports[_0x24ea('0x4f')]=function(_0x5a7243,_0x14f1af,_0x2acc5b){var _0x17c402={};var _0x989227={};var _0x239396;var _0x2966b6;return db[_0x24ea('0x2c')][_0x24ea('0x4b')]({'where':{'id':_0x5a7243[_0x24ea('0x45')]['id']}})[_0x24ea('0x25')](handleEntityNotFound(_0x14f1af,null))[_0x24ea('0x25')](function(_0x4fd1f4){if(_0x4fd1f4){_0x239396=_0x4fd1f4;_0x989227[_0x24ea('0x30')]=_[_0x24ea('0x32')](db[_0x24ea('0x4c')][_0x24ea('0x2d')]);_0x989227[_0x24ea('0x31')]=_[_0x24ea('0x32')](_0x5a7243[_0x24ea('0x31')]);_0x989227['filters']=_[_0x24ea('0x35')](_0x989227[_0x24ea('0x30')],_0x989227['query']);_0x17c402[_0x24ea('0x34')]=_[_0x24ea('0x35')](_0x989227[_0x24ea('0x30')],qs[_0x24ea('0x36')](_0x5a7243[_0x24ea('0x31')][_0x24ea('0x36')]));_0x17c402[_0x24ea('0x34')]=_0x17c402[_0x24ea('0x34')][_0x24ea('0x46')]?_0x17c402['attributes']:_0x989227[_0x24ea('0x30')];_0x17c402[_0x24ea('0x4d')]=qs['sort'](_0x5a7243[_0x24ea('0x31')][_0x24ea('0x38')]);_0x17c402[_0x24ea('0x39')]=qs['filters'](_['pick'](_0x5a7243[_0x24ea('0x31')],_0x989227[_0x24ea('0x33')]));if(_0x5a7243[_0x24ea('0x31')][_0x24ea('0x3b')]){_0x17c402[_0x24ea('0x39')]=_[_0x24ea('0x3c')](_0x17c402['where'],{'$or':_[_0x24ea('0x3d')](_0x17c402[_0x24ea('0x34')],function(_0x291cfb){var _0x24c620={};_0x24c620[_0x291cfb]={'$like':'%'+_0x5a7243[_0x24ea('0x31')][_0x24ea('0x3b')]+'%'};return _0x24c620;})});}_0x17c402=_[_0x24ea('0x3c')]({},_0x17c402,_0x5a7243[_0x24ea('0x3f')]);return _0x239396[_0x24ea('0x4f')](_0x17c402);}})[_0x24ea('0x25')](function(_0x5bccfe){if(_0x5bccfe){_0x2966b6=_0x5bccfe[_0x24ea('0x46')];if(!_0x5a7243[_0x24ea('0x31')][_0x24ea('0x37')](_0x24ea('0x4e'))){_0x17c402[_0x24ea('0x1c')]=qs[_0x24ea('0x1c')](_0x5a7243[_0x24ea('0x31')]['limit']);_0x17c402['offset']=qs[_0x24ea('0x1e')](_0x5a7243[_0x24ea('0x31')][_0x24ea('0x1e')]);}return _0x239396['getDescriptions'](_0x17c402);}})[_0x24ea('0x25')](function(_0x1fb0b5){if(_0x1fb0b5){return _0x1fb0b5?{'count':_0x2966b6,'rows':_0x1fb0b5}:null;}})['then'](respondWithResult(_0x14f1af,null))[_0x24ea('0x43')](handleError(_0x14f1af,null));};exports[_0x24ea('0x50')]=function(_0x2bb855,_0x2c6218,_0x4384c3){var _0x2168ee={};var _0x4cba24={};var _0x5a728f;var _0x4939a1;return db[_0x24ea('0x2c')][_0x24ea('0x4b')]({'where':{'id':_0x2bb855[_0x24ea('0x45')]['id']}})[_0x24ea('0x25')](handleEntityNotFound(_0x2c6218,null))['then'](function(_0x222475){if(_0x222475){_0x5a728f=_0x222475;_0x4cba24[_0x24ea('0x30')]=_['keys'](db[_0x24ea('0x4c')][_0x24ea('0x2d')]);_0x4cba24[_0x24ea('0x31')]=_[_0x24ea('0x32')](_0x2bb855['query']);_0x4cba24[_0x24ea('0x33')]=_['intersection'](_0x4cba24[_0x24ea('0x30')],_0x4cba24[_0x24ea('0x31')]);_0x2168ee[_0x24ea('0x34')]=_[_0x24ea('0x35')](_0x4cba24['model'],qs['fields'](_0x2bb855[_0x24ea('0x31')][_0x24ea('0x36')]));_0x2168ee[_0x24ea('0x34')]=_0x2168ee[_0x24ea('0x34')][_0x24ea('0x46')]?_0x2168ee[_0x24ea('0x34')]:_0x4cba24[_0x24ea('0x30')];_0x2168ee[_0x24ea('0x4d')]=qs[_0x24ea('0x38')](_0x2bb855[_0x24ea('0x31')][_0x24ea('0x38')]);_0x2168ee['where']=qs['filters'](_[_0x24ea('0x3a')](_0x2bb855[_0x24ea('0x31')],_0x4cba24[_0x24ea('0x33')]));if(_0x2bb855[_0x24ea('0x31')][_0x24ea('0x3b')]){_0x2168ee[_0x24ea('0x39')]=_[_0x24ea('0x3c')](_0x2168ee[_0x24ea('0x39')],{'$or':_[_0x24ea('0x3d')](_0x2168ee[_0x24ea('0x34')],function(_0x26627e){var _0xadc7c1={};_0xadc7c1[_0x26627e]={'$like':'%'+_0x2bb855['query']['filter']+'%'};return _0xadc7c1;})});}_0x2168ee=_['merge']({},_0x2168ee,_0x2bb855['options']);return _0x5a728f[_0x24ea('0x50')](_0x2168ee);}})[_0x24ea('0x25')](function(_0x21228e){if(_0x21228e){_0x4939a1=_0x21228e[_0x24ea('0x46')];if(!_0x2bb855[_0x24ea('0x31')][_0x24ea('0x37')](_0x24ea('0x4e'))){_0x2168ee[_0x24ea('0x1c')]=qs[_0x24ea('0x1c')](_0x2bb855[_0x24ea('0x31')]['limit']);_0x2168ee[_0x24ea('0x1e')]=qs[_0x24ea('0x1e')](_0x2bb855[_0x24ea('0x31')][_0x24ea('0x1e')]);}return _0x5a728f[_0x24ea('0x50')](_0x2168ee);}})['then'](function(_0x54b834){if(_0x54b834){return _0x54b834?{'count':_0x4939a1,'rows':_0x54b834}:null;}})[_0x24ea('0x25')](respondWithResult(_0x2c6218,null))[_0x24ea('0x43')](handleError(_0x2c6218,null));}; \ No newline at end of file +var _0x39e7=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','merge','find','catch','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel'];(function(_0x40e638,_0x1c07b5){var _0x5e04cc=function(_0x4c7c34){while(--_0x4c7c34){_0x40e638['push'](_0x40e638['shift']());}};_0x5e04cc(++_0x1c07b5);}(_0x39e7,0x1d4));var _0x739e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x39e7[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x739e('0x0'));var rimraf=require(_0x739e('0x1'));var zipdir=require(_0x739e('0x2'));var jsonpatch=require(_0x739e('0x3'));var rp=require(_0x739e('0x4'));var moment=require(_0x739e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x739e('0x6'));var util=require(_0x739e('0x7'));var path=require(_0x739e('0x8'));var sox=require(_0x739e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x739e('0xa'));var squel=require(_0x739e('0xb'));var crypto=require(_0x739e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x739e('0xd'));var Papa=require(_0x739e('0xe'));var Redis=require(_0x739e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x739e('0x10'));var as=require(_0x739e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x739e('0x12'))(_0x739e('0x13'));var utils=require(_0x739e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x739e('0x15'));var db=require(_0x739e('0x16'))['db'];function respondWithStatusCode(_0xac258a,_0x16d2b7){_0x16d2b7=_0x16d2b7||0xcc;return function(_0x3263f1){if(_0x3263f1){return _0xac258a['sendStatus'](_0x16d2b7);}return _0xac258a['status'](_0x16d2b7)[_0x739e('0x17')]();};}function respondWithResult(_0x42ca09,_0x5648b9){_0x5648b9=_0x5648b9||0xc8;return function(_0x479fb9){if(_0x479fb9){return _0x42ca09[_0x739e('0x18')](_0x5648b9)[_0x739e('0x19')](_0x479fb9);}};}function respondWithFilteredResult(_0x513fa9,_0x55962a){return function(_0xa7690e){if(_0xa7690e){var _0x119ae1=typeof _0x55962a[_0x739e('0x1a')]===_0x739e('0x1b')&&typeof _0x55962a[_0x739e('0x1c')]==='undefined';var _0x4516a3=_0xa7690e[_0x739e('0x1d')];var _0x236166=_0x119ae1?0x0:_0x55962a[_0x739e('0x1a')];var _0xbd319f=_0x119ae1?_0xa7690e[_0x739e('0x1d')]:_0x55962a[_0x739e('0x1a')]+_0x55962a[_0x739e('0x1c')];var _0x5c8793;if(_0xbd319f>=_0x4516a3){_0xbd319f=_0x4516a3;_0x5c8793=0xc8;}else{_0x5c8793=0xce;}_0x513fa9[_0x739e('0x18')](_0x5c8793);return _0x513fa9[_0x739e('0x1e')](_0x739e('0x1f'),_0x236166+'-'+_0xbd319f+'/'+_0x4516a3)[_0x739e('0x19')](_0xa7690e);}return null;};}function patchUpdates(_0x1461ad){return function(_0x393525){try{jsonpatch[_0x739e('0x20')](_0x393525,_0x1461ad,!![]);}catch(_0x42f2c4){return BPromise[_0x739e('0x21')](_0x42f2c4);}return _0x393525[_0x739e('0x22')]();};}function saveUpdates(_0x52a0c3,_0x23d191){return function(_0x1b202a){if(_0x1b202a){return _0x1b202a[_0x739e('0x23')](_0x52a0c3)['then'](function(_0x4d5521){return _0x4d5521;});}return null;};}function removeEntity(_0x46d21d,_0x56cbd9){return function(_0x27595f){if(_0x27595f){return _0x27595f[_0x739e('0x24')]()[_0x739e('0x25')](function(){_0x46d21d[_0x739e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c339,_0x5aada8){return function(_0x26d021){if(!_0x26d021){_0x25c339['sendStatus'](0x194);}return _0x26d021;};}function handleError(_0xb8e546,_0x8910b){_0x8910b=_0x8910b||0x1f4;return function(_0x1b56f6){logger[_0x739e('0x26')](_0x1b56f6[_0x739e('0x27')]);if(_0x1b56f6[_0x739e('0x28')]){delete _0x1b56f6[_0x739e('0x28')];}_0xb8e546['status'](_0x8910b)[_0x739e('0x29')](_0x1b56f6);};}exports['index']=function(_0x4fc251,_0x228333){var _0x12d990={},_0x162c46={},_0x5ee0d1={'count':0x0,'rows':[]};var _0x1e7b56=_[_0x739e('0x2a')](db[_0x739e('0x2b')][_0x739e('0x2c')],function(_0x4c8b0c){return{'name':_0x4c8b0c[_0x739e('0x2d')],'type':_0x4c8b0c[_0x739e('0x2e')][_0x739e('0x2f')]};});_0x162c46[_0x739e('0x30')]=_['map'](_0x1e7b56,_0x739e('0x28'));_0x162c46[_0x739e('0x31')]=_[_0x739e('0x32')](_0x4fc251[_0x739e('0x31')]);_0x162c46[_0x739e('0x33')]=_[_0x739e('0x34')](_0x162c46['model'],_0x162c46[_0x739e('0x31')]);_0x12d990['attributes']=_[_0x739e('0x34')](_0x162c46['model'],qs[_0x739e('0x35')](_0x4fc251['query'][_0x739e('0x35')]));_0x12d990[_0x739e('0x36')]=_0x12d990[_0x739e('0x36')][_0x739e('0x37')]?_0x12d990[_0x739e('0x36')]:_0x162c46[_0x739e('0x30')];if(!_0x4fc251['query']['hasOwnProperty'](_0x739e('0x38'))){_0x12d990[_0x739e('0x1c')]=qs[_0x739e('0x1c')](_0x4fc251[_0x739e('0x31')][_0x739e('0x1c')]);_0x12d990[_0x739e('0x1a')]=qs[_0x739e('0x1a')](_0x4fc251[_0x739e('0x31')][_0x739e('0x1a')]);}_0x12d990[_0x739e('0x39')]=qs['sort'](_0x4fc251[_0x739e('0x31')][_0x739e('0x3a')]);_0x12d990[_0x739e('0x3b')]=qs[_0x739e('0x33')](_[_0x739e('0x3c')](_0x4fc251[_0x739e('0x31')],_0x162c46[_0x739e('0x33')]),_0x1e7b56);if(_0x4fc251[_0x739e('0x31')][_0x739e('0x3d')]){_0x12d990[_0x739e('0x3b')]=_['merge'](_0x12d990[_0x739e('0x3b')],{'$or':_[_0x739e('0x2a')](_0x1e7b56,function(_0x42cc2d){if(_0x42cc2d['type']!==_0x739e('0x3e')){var _0x21713b={};_0x21713b[_0x42cc2d[_0x739e('0x28')]]={'$like':'%'+_0x4fc251[_0x739e('0x31')][_0x739e('0x3d')]+'%'};return _0x21713b;}})});}_0x12d990=_['merge']({},_0x12d990,_0x4fc251[_0x739e('0x3f')]);var _0x5f0df={'where':_0x12d990['where']};return db[_0x739e('0x2b')][_0x739e('0x1d')](_0x5f0df)[_0x739e('0x25')](function(_0x25f1ed){_0x5ee0d1['count']=_0x25f1ed;if(_0x4fc251[_0x739e('0x31')][_0x739e('0x40')]){_0x12d990[_0x739e('0x41')]=[{'all':!![]}];}return db[_0x739e('0x2b')]['findAll'](_0x12d990);})['then'](function(_0x2c55d6){_0x5ee0d1[_0x739e('0x42')]=_0x2c55d6;return _0x5ee0d1;})[_0x739e('0x25')](respondWithFilteredResult(_0x228333,_0x12d990))['catch'](handleError(_0x228333,null));};exports[_0x739e('0x43')]=function(_0x1b7490,_0x44e20f){var _0x9636f5={'raw':![],'where':{'id':_0x1b7490[_0x739e('0x44')]['id']}},_0x4bf09e={};_0x4bf09e[_0x739e('0x30')]=_[_0x739e('0x32')](db['FreshsalesConfiguration'][_0x739e('0x2c')]);_0x4bf09e['query']=_['keys'](_0x1b7490[_0x739e('0x31')]);_0x4bf09e[_0x739e('0x33')]=_[_0x739e('0x34')](_0x4bf09e[_0x739e('0x30')],_0x4bf09e[_0x739e('0x31')]);_0x9636f5[_0x739e('0x36')]=_[_0x739e('0x34')](_0x4bf09e[_0x739e('0x30')],qs[_0x739e('0x35')](_0x1b7490[_0x739e('0x31')][_0x739e('0x35')]));_0x9636f5[_0x739e('0x36')]=_0x9636f5[_0x739e('0x36')][_0x739e('0x37')]?_0x9636f5['attributes']:_0x4bf09e['model'];if(_0x1b7490[_0x739e('0x31')][_0x739e('0x40')]){_0x9636f5[_0x739e('0x41')]=[{'all':!![]}];}_0x9636f5=_[_0x739e('0x45')]({},_0x9636f5,_0x1b7490[_0x739e('0x3f')]);return db['FreshsalesConfiguration'][_0x739e('0x46')](_0x9636f5)[_0x739e('0x25')](handleEntityNotFound(_0x44e20f,null))[_0x739e('0x25')](respondWithResult(_0x44e20f,null))[_0x739e('0x47')](handleError(_0x44e20f,null));};exports[_0x739e('0x48')]=function(_0x514d8d,_0x414072){return db['FreshsalesConfiguration']['create'](_0x514d8d[_0x739e('0x49')],{})[_0x739e('0x25')](respondWithResult(_0x414072,0xc9))[_0x739e('0x47')](handleError(_0x414072,null));};exports[_0x739e('0x23')]=function(_0x24df51,_0x2baaa8){if(_0x24df51[_0x739e('0x49')]['id']){delete _0x24df51[_0x739e('0x49')]['id'];}return db[_0x739e('0x2b')]['find']({'where':{'id':_0x24df51['params']['id']}})[_0x739e('0x25')](handleEntityNotFound(_0x2baaa8,null))[_0x739e('0x25')](saveUpdates(_0x24df51['body'],null))[_0x739e('0x25')](respondWithResult(_0x2baaa8,null))[_0x739e('0x47')](handleError(_0x2baaa8,null));};exports[_0x739e('0x24')]=function(_0x51c737,_0x1ea380){return db[_0x739e('0x2b')]['find']({'where':{'id':_0x51c737[_0x739e('0x44')]['id']}})[_0x739e('0x25')](handleEntityNotFound(_0x1ea380,null))[_0x739e('0x25')](removeEntity(_0x1ea380,null))[_0x739e('0x47')](handleError(_0x1ea380,null));};exports[_0x739e('0x4a')]=function(_0x42773b,_0x515eac,_0x666e76){var _0x4f3992={};var _0x3d7cd1={};var _0x388fbd;var _0x2e9bf0;return db[_0x739e('0x2b')][_0x739e('0x4b')]({'where':{'id':_0x42773b[_0x739e('0x44')]['id']}})[_0x739e('0x25')](handleEntityNotFound(_0x515eac,null))[_0x739e('0x25')](function(_0x540920){if(_0x540920){_0x388fbd=_0x540920;_0x3d7cd1[_0x739e('0x30')]=_[_0x739e('0x32')](db[_0x739e('0x4c')][_0x739e('0x2c')]);_0x3d7cd1[_0x739e('0x31')]=_[_0x739e('0x32')](_0x42773b[_0x739e('0x31')]);_0x3d7cd1['filters']=_['intersection'](_0x3d7cd1[_0x739e('0x30')],_0x3d7cd1[_0x739e('0x31')]);_0x4f3992['attributes']=_[_0x739e('0x34')](_0x3d7cd1[_0x739e('0x30')],qs['fields'](_0x42773b[_0x739e('0x31')][_0x739e('0x35')]));_0x4f3992[_0x739e('0x36')]=_0x4f3992[_0x739e('0x36')][_0x739e('0x37')]?_0x4f3992[_0x739e('0x36')]:_0x3d7cd1[_0x739e('0x30')];_0x4f3992[_0x739e('0x39')]=qs[_0x739e('0x3a')](_0x42773b[_0x739e('0x31')][_0x739e('0x3a')]);_0x4f3992[_0x739e('0x3b')]=qs[_0x739e('0x33')](_[_0x739e('0x3c')](_0x42773b[_0x739e('0x31')],_0x3d7cd1['filters']));if(_0x42773b['query'][_0x739e('0x3d')]){_0x4f3992[_0x739e('0x3b')]=_[_0x739e('0x45')](_0x4f3992[_0x739e('0x3b')],{'$or':_[_0x739e('0x2a')](_0x4f3992['attributes'],function(_0xaff374){var _0x5d4d0d={};_0x5d4d0d[_0xaff374]={'$like':'%'+_0x42773b[_0x739e('0x31')]['filter']+'%'};return _0x5d4d0d;})});}_0x4f3992=_[_0x739e('0x45')]({},_0x4f3992,_0x42773b[_0x739e('0x3f')]);return _0x388fbd[_0x739e('0x4a')](_0x4f3992);}})[_0x739e('0x25')](function(_0xe67991){if(_0xe67991){_0x2e9bf0=_0xe67991[_0x739e('0x37')];if(!_0x42773b[_0x739e('0x31')][_0x739e('0x4d')](_0x739e('0x38'))){_0x4f3992[_0x739e('0x1c')]=qs['limit'](_0x42773b[_0x739e('0x31')]['limit']);_0x4f3992[_0x739e('0x1a')]=qs[_0x739e('0x1a')](_0x42773b['query'][_0x739e('0x1a')]);}return _0x388fbd['getSubjects'](_0x4f3992);}})[_0x739e('0x25')](function(_0x4392fa){if(_0x4392fa){return _0x4392fa?{'count':_0x2e9bf0,'rows':_0x4392fa}:null;}})['then'](respondWithResult(_0x515eac,null))[_0x739e('0x47')](handleError(_0x515eac,null));};exports[_0x739e('0x4e')]=function(_0x56b5c6,_0x2eaacb,_0x5cc20b){var _0x4a20cd={};var _0xc57883={};var _0x507b0b;var _0x34ff1a;return db[_0x739e('0x2b')][_0x739e('0x4b')]({'where':{'id':_0x56b5c6[_0x739e('0x44')]['id']}})[_0x739e('0x25')](handleEntityNotFound(_0x2eaacb,null))[_0x739e('0x25')](function(_0x318d56){if(_0x318d56){_0x507b0b=_0x318d56;_0xc57883['model']=_[_0x739e('0x32')](db[_0x739e('0x4c')][_0x739e('0x2c')]);_0xc57883[_0x739e('0x31')]=_[_0x739e('0x32')](_0x56b5c6[_0x739e('0x31')]);_0xc57883['filters']=_[_0x739e('0x34')](_0xc57883[_0x739e('0x30')],_0xc57883[_0x739e('0x31')]);_0x4a20cd[_0x739e('0x36')]=_[_0x739e('0x34')](_0xc57883['model'],qs['fields'](_0x56b5c6[_0x739e('0x31')][_0x739e('0x35')]));_0x4a20cd[_0x739e('0x36')]=_0x4a20cd[_0x739e('0x36')]['length']?_0x4a20cd[_0x739e('0x36')]:_0xc57883['model'];_0x4a20cd[_0x739e('0x39')]=qs[_0x739e('0x3a')](_0x56b5c6[_0x739e('0x31')][_0x739e('0x3a')]);_0x4a20cd[_0x739e('0x3b')]=qs[_0x739e('0x33')](_[_0x739e('0x3c')](_0x56b5c6['query'],_0xc57883[_0x739e('0x33')]));if(_0x56b5c6[_0x739e('0x31')]['filter']){_0x4a20cd['where']=_[_0x739e('0x45')](_0x4a20cd[_0x739e('0x3b')],{'$or':_['map'](_0x4a20cd[_0x739e('0x36')],function(_0x32b739){var _0x804340={};_0x804340[_0x32b739]={'$like':'%'+_0x56b5c6[_0x739e('0x31')][_0x739e('0x3d')]+'%'};return _0x804340;})});}_0x4a20cd=_[_0x739e('0x45')]({},_0x4a20cd,_0x56b5c6[_0x739e('0x3f')]);return _0x507b0b[_0x739e('0x4e')](_0x4a20cd);}})['then'](function(_0x61ae32){if(_0x61ae32){_0x34ff1a=_0x61ae32[_0x739e('0x37')];if(!_0x56b5c6['query']['hasOwnProperty']('nolimit')){_0x4a20cd[_0x739e('0x1c')]=qs[_0x739e('0x1c')](_0x56b5c6[_0x739e('0x31')][_0x739e('0x1c')]);_0x4a20cd['offset']=qs[_0x739e('0x1a')](_0x56b5c6[_0x739e('0x31')][_0x739e('0x1a')]);}return _0x507b0b[_0x739e('0x4e')](_0x4a20cd);}})['then'](function(_0xd7d481){if(_0xd7d481){return _0xd7d481?{'count':_0x34ff1a,'rows':_0xd7d481}:null;}})[_0x739e('0x25')](respondWithResult(_0x2eaacb,null))['catch'](handleError(_0x2eaacb,null));};exports[_0x739e('0x4f')]=function(_0x421029,_0x4ff611,_0x53d5fb){var _0xec7a8d={};var _0x328552={};var _0x382ed8;var _0x50128c;return db[_0x739e('0x2b')][_0x739e('0x4b')]({'where':{'id':_0x421029[_0x739e('0x44')]['id']}})[_0x739e('0x25')](handleEntityNotFound(_0x4ff611,null))[_0x739e('0x25')](function(_0x1c7fca){if(_0x1c7fca){_0x382ed8=_0x1c7fca;_0x328552[_0x739e('0x30')]=_[_0x739e('0x32')](db['FreshsalesField']['rawAttributes']);_0x328552[_0x739e('0x31')]=_[_0x739e('0x32')](_0x421029['query']);_0x328552['filters']=_['intersection'](_0x328552[_0x739e('0x30')],_0x328552['query']);_0xec7a8d[_0x739e('0x36')]=_[_0x739e('0x34')](_0x328552[_0x739e('0x30')],qs[_0x739e('0x35')](_0x421029['query']['fields']));_0xec7a8d[_0x739e('0x36')]=_0xec7a8d['attributes'][_0x739e('0x37')]?_0xec7a8d[_0x739e('0x36')]:_0x328552[_0x739e('0x30')];_0xec7a8d[_0x739e('0x39')]=qs[_0x739e('0x3a')](_0x421029[_0x739e('0x31')][_0x739e('0x3a')]);_0xec7a8d[_0x739e('0x3b')]=qs[_0x739e('0x33')](_[_0x739e('0x3c')](_0x421029[_0x739e('0x31')],_0x328552[_0x739e('0x33')]));if(_0x421029[_0x739e('0x31')][_0x739e('0x3d')]){_0xec7a8d[_0x739e('0x3b')]=_[_0x739e('0x45')](_0xec7a8d['where'],{'$or':_[_0x739e('0x2a')](_0xec7a8d[_0x739e('0x36')],function(_0x22b661){var _0x6f4fa0={};_0x6f4fa0[_0x22b661]={'$like':'%'+_0x421029[_0x739e('0x31')][_0x739e('0x3d')]+'%'};return _0x6f4fa0;})});}_0xec7a8d=_[_0x739e('0x45')]({},_0xec7a8d,_0x421029['options']);return _0x382ed8[_0x739e('0x4f')](_0xec7a8d);}})['then'](function(_0x40ba8e){if(_0x40ba8e){_0x50128c=_0x40ba8e[_0x739e('0x37')];if(!_0x421029[_0x739e('0x31')][_0x739e('0x4d')](_0x739e('0x38'))){_0xec7a8d['limit']=qs[_0x739e('0x1c')](_0x421029[_0x739e('0x31')][_0x739e('0x1c')]);_0xec7a8d[_0x739e('0x1a')]=qs[_0x739e('0x1a')](_0x421029[_0x739e('0x31')]['offset']);}return _0x382ed8[_0x739e('0x4f')](_0xec7a8d);}})[_0x739e('0x25')](function(_0x28118c){if(_0x28118c){return _0x28118c?{'count':_0x50128c,'rows':_0x28118c}:null;}})[_0x739e('0x25')](respondWithResult(_0x4ff611,null))[_0x739e('0x47')](handleError(_0x4ff611,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 6305dd3..6ca0ebf 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 _0x6367=['exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','bluebird','request-promise','../../config/environment'];(function(_0x1a2a67,_0x235c94){var _0x224f48=function(_0x3c302e){while(--_0x3c302e){_0x1a2a67['push'](_0x1a2a67['shift']());}};_0x224f48(++_0x235c94);}(_0x6367,0x1b5));var _0x7636=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0x6367[_0x4f3b2d];return _0x3dddfa;};'use strict';var _=require(_0x7636('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7636('0x1'));var rp=require(_0x7636('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7636('0x3'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x7636('0x4')]=function(_0x58aef1,_0x42597b){return _0x58aef1['define'](_0x7636('0x5'),attributes,{'tableName':_0x7636('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacb0=['FreshsalesConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','define'];(function(_0x34cc9f,_0x4d891a){var _0x1991d3=function(_0x47284b){while(--_0x47284b){_0x34cc9f['push'](_0x34cc9f['shift']());}};_0x1991d3(++_0x4d891a);}(_0xacb0,0x6f));var _0x0acb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xacb0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0acb('0x0'));var util=require(_0x0acb('0x1'));var logger=require(_0x0acb('0x2'))('api');var moment=require(_0x0acb('0x3'));var BPromise=require(_0x0acb('0x4'));var rp=require(_0x0acb('0x5'));var fs=require('fs');var path=require(_0x0acb('0x6'));var rimraf=require('rimraf');var config=require(_0x0acb('0x7'));var attributes=require(_0x0acb('0x8'));module['exports']=function(_0x9c9b78,_0x67cb70){return _0x9c9b78[_0x0acb('0x9')](_0x0acb('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 474bda4..345d378 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 _0x6d00=['../../config/environment','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x6d00,0x189));var _0x06d0=function(_0x1924fd,_0x2ae46d){_0x1924fd=_0x1924fd-0x0;var _0x45df39=_0x6d00[_0x1924fd];return _0x45df39;};'use strict';var _=require(_0x06d0('0x0'));var util=require('util');var moment=require(_0x06d0('0x1'));var BPromise=require(_0x06d0('0x2'));var rs=require(_0x06d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06d0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06d0('0x5'))(_0x06d0('0x6'));var config=require(_0x06d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x06d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b74be,_0x1134b1,_0x1b0baf){return new BPromise(function(_0x33dc9e,_0x453fba){return client[_0x06d0('0x9')](_0x1b74be,_0x1b0baf)[_0x06d0('0xa')](function(_0x487241){logger[_0x06d0('0xb')](_0x06d0('0xc'),_0x1134b1,_0x06d0('0xd'));logger[_0x06d0('0xe')](_0x06d0('0xf'),_0x1134b1,_0x06d0('0xd'),JSON[_0x06d0('0x10')](_0x487241));if(_0x487241[_0x06d0('0x11')]){if(_0x487241[_0x06d0('0x11')][_0x06d0('0x12')]===0x1f4){logger[_0x06d0('0x11')](_0x06d0('0xc'),_0x1134b1,_0x487241[_0x06d0('0x11')][_0x06d0('0x13')]);return _0x453fba(_0x487241[_0x06d0('0x11')][_0x06d0('0x13')]);}logger[_0x06d0('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1134b1,_0x487241['error'][_0x06d0('0x13')]);return _0x33dc9e(_0x487241[_0x06d0('0x11')][_0x06d0('0x13')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1134b1,_0x06d0('0xd'));_0x33dc9e(_0x487241['result'][_0x06d0('0x13')]);}})['catch'](function(_0x309dfd){logger[_0x06d0('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1134b1,_0x309dfd);_0x453fba(_0x309dfd);});});} \ No newline at end of file +var _0x7937=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x344dc4,_0x50eb33){var _0x3e722f=function(_0x398e46){while(--_0x398e46){_0x344dc4['push'](_0x344dc4['shift']());}};_0x3e722f(++_0x50eb33);}(_0x7937,0x11b));var _0x7793=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7937[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x7793('0x0'));var util=require(_0x7793('0x1'));var moment=require(_0x7793('0x2'));var BPromise=require('bluebird');var rs=require(_0x7793('0x3'));var fs=require('fs');var Redis=require(_0x7793('0x4'));var db=require(_0x7793('0x5'))['db'];var utils=require(_0x7793('0x6'));var logger=require(_0x7793('0x7'))(_0x7793('0x8'));var config=require(_0x7793('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7793('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d4db6,_0x49f47b,_0x32ac40){return new BPromise(function(_0x20d763,_0x27db0a){return client[_0x7793('0xb')](_0x2d4db6,_0x32ac40)['then'](function(_0x36e26b){logger[_0x7793('0xc')](_0x7793('0xd'),_0x49f47b,_0x7793('0xe'));logger[_0x7793('0xf')](_0x7793('0x10'),_0x49f47b,_0x7793('0xe'),JSON[_0x7793('0x11')](_0x36e26b));if(_0x36e26b[_0x7793('0x12')]){if(_0x36e26b[_0x7793('0x12')][_0x7793('0x13')]===0x1f4){logger[_0x7793('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x49f47b,_0x36e26b[_0x7793('0x12')][_0x7793('0x14')]);return _0x27db0a(_0x36e26b[_0x7793('0x12')][_0x7793('0x14')]);}logger[_0x7793('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x49f47b,_0x36e26b[_0x7793('0x12')][_0x7793('0x14')]);return _0x20d763(_0x36e26b[_0x7793('0x12')][_0x7793('0x14')]);}else{logger[_0x7793('0xc')](_0x7793('0xd'),_0x49f47b,_0x7793('0xe'));_0x20d763(_0x36e26b['result'][_0x7793('0x14')]);}})['catch'](function(_0x215558){logger[_0x7793('0x12')](_0x7793('0xd'),_0x49f47b,_0x215558);_0x27db0a(_0x215558);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4bd7c50..1575bb9 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 _0xe64a=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','post'];(function(_0x1bc95c,_0x109aec){var _0x1a9fdc=function(_0x3d73f8){while(--_0x3d73f8){_0x1bc95c['push'](_0x1bc95c['shift']());}};_0x1a9fdc(++_0x109aec);}(_0xe64a,0x1e0));var _0xae64=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe64a[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var path=require(_0xae64('0x2'));var timeout=require(_0xae64('0x3'));var express=require(_0xae64('0x4'));var router=express[_0xae64('0x5')]();var fs_extra=require(_0xae64('0x6'));var auth=require(_0xae64('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xae64('0x8')](),controller[_0xae64('0x9')]);router[_0xae64('0xa')](_0xae64('0xb'),auth[_0xae64('0x8')](),controller[_0xae64('0xc')]);router[_0xae64('0xd')]('/',auth[_0xae64('0x8')](),controller[_0xae64('0xe')]);router[_0xae64('0xf')](_0xae64('0xb'),auth['isAuthenticated'](),controller[_0xae64('0x10')]);router['delete']('/:id',auth[_0xae64('0x8')](),controller[_0xae64('0x11')]);module[_0xae64('0x12')]=router; \ No newline at end of file +var _0xd404=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd404,0x15b));var _0x4d40=function(_0x4f8258,_0x18fe18){_0x4f8258=_0x4f8258-0x0;var _0x2882f9=_0xd404[_0x4f8258];return _0x2882f9;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['post']('/',auth[_0x4d40('0xa')](),controller['create']);router['put'](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xe')]);router[_0x4d40('0xf')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x10')]);module[_0x4d40('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 088e815..77e2a99 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 _0xa8ac=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa8ac,0x1cc));var _0xca8a=function(_0x23be02,_0x1c288a){_0x23be02=_0x23be02-0x0;var _0x1d7813=_0xa8ac[_0x23be02];return _0x1d7813;};'use strict';var Sequelize=require(_0xca8a('0x0'));module['exports']={'type':{'type':Sequelize[_0xca8a('0x1')](_0xca8a('0x2'),_0xca8a('0x3'),_0xca8a('0x4'),_0xca8a('0x5'),'picklist'),'defaultValue':_0xca8a('0x2')},'content':{'type':Sequelize[_0xca8a('0x6')]},'key':{'type':Sequelize[_0xca8a('0x6')]},'keyType':{'type':Sequelize[_0xca8a('0x1')](_0xca8a('0x2'),_0xca8a('0x3'),_0xca8a('0x4'))},'keyContent':{'type':Sequelize[_0xca8a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca8a('0x6')]}}; \ No newline at end of file +var _0x262d=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x1f9cde,_0x2c850c){var _0x351307=function(_0x3756aa){while(--_0x3756aa){_0x1f9cde['push'](_0x1f9cde['shift']());}};_0x351307(++_0x2c850c);}(_0x262d,0xd1));var _0xd262=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x262d[_0x53cf8e];return _0x459197;};'use strict';var Sequelize=require(_0xd262('0x0'));module[_0xd262('0x1')]={'type':{'type':Sequelize[_0xd262('0x2')](_0xd262('0x3'),_0xd262('0x4'),'customVariable',_0xd262('0x5'),'picklist'),'defaultValue':_0xd262('0x3')},'content':{'type':Sequelize[_0xd262('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xd262('0x4'),_0xd262('0x7'))},'keyContent':{'type':Sequelize[_0xd262('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd262('0x6')]},'customField':{'type':Sequelize[_0xd262('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd262('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 68b6251..27391a4 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 _0x96c2=['length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','show','params','find','catch','create','body','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x1fe365,_0x2d8a72){var _0x364711=function(_0x575c89){while(--_0x575c89){_0x1fe365['push'](_0x1fe365['shift']());}};_0x364711(++_0x2d8a72);}(_0x96c2,0x17c));var _0x296c=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x96c2[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x296c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x296c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x296c('0x2'));var Mustache=require(_0x296c('0x3'));var util=require(_0x296c('0x4'));var path=require(_0x296c('0x5'));var sox=require(_0x296c('0x6'));var csv=require(_0x296c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x296c('0x8'));var _=require(_0x296c('0x9'));var squel=require(_0x296c('0xa'));var crypto=require(_0x296c('0xb'));var jsforce=require(_0x296c('0xc'));var deskjs=require(_0x296c('0xd'));var toCsv=require(_0x296c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x296c('0xe'));var authService=require(_0x296c('0xf'));var qs=require(_0x296c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x296c('0x11'));var logger=require(_0x296c('0x12'))('api');var utils=require(_0x296c('0x13'));var config=require(_0x296c('0x14'));var licenseUtil=require(_0x296c('0x15'));var db=require(_0x296c('0x16'))['db'];function respondWithStatusCode(_0x3d4d19,_0x27a4de){_0x27a4de=_0x27a4de||0xcc;return function(_0x44a0ac){if(_0x44a0ac){return _0x3d4d19[_0x296c('0x17')](_0x27a4de);}return _0x3d4d19[_0x296c('0x18')](_0x27a4de)[_0x296c('0x19')]();};}function respondWithResult(_0x74320b,_0x20edef){_0x20edef=_0x20edef||0xc8;return function(_0x5dcdf2){if(_0x5dcdf2){return _0x74320b[_0x296c('0x18')](_0x20edef)[_0x296c('0x1a')](_0x5dcdf2);}};}function respondWithFilteredResult(_0x511cf5,_0x1e7080){return function(_0x431e2f){if(_0x431e2f){var _0x5e19e5=typeof _0x1e7080[_0x296c('0x1b')]===_0x296c('0x1c')&&typeof _0x1e7080[_0x296c('0x1d')]==='undefined';var _0x363c8f=_0x431e2f[_0x296c('0x1e')];var _0x3688fe=_0x5e19e5?0x0:_0x1e7080[_0x296c('0x1b')];var _0x2ac0ea=_0x5e19e5?_0x431e2f[_0x296c('0x1e')]:_0x1e7080[_0x296c('0x1b')]+_0x1e7080[_0x296c('0x1d')];var _0x50e64b;if(_0x2ac0ea>=_0x363c8f){_0x2ac0ea=_0x363c8f;_0x50e64b=0xc8;}else{_0x50e64b=0xce;}_0x511cf5[_0x296c('0x18')](_0x50e64b);return _0x511cf5[_0x296c('0x1f')](_0x296c('0x20'),_0x3688fe+'-'+_0x2ac0ea+'/'+_0x363c8f)[_0x296c('0x1a')](_0x431e2f);}return null;};}function patchUpdates(_0x2ea3fb){return function(_0x381c47){try{jsonpatch[_0x296c('0x21')](_0x381c47,_0x2ea3fb,!![]);}catch(_0x480722){return BPromise['reject'](_0x480722);}return _0x381c47[_0x296c('0x22')]();};}function saveUpdates(_0x2da37a,_0x41f111){return function(_0x568706){if(_0x568706){return _0x568706[_0x296c('0x23')](_0x2da37a)['then'](function(_0x1c79ac){return _0x1c79ac;});}return null;};}function removeEntity(_0x58767b,_0x44b221){return function(_0x57535e){if(_0x57535e){return _0x57535e['destroy']()[_0x296c('0x24')](function(){_0x58767b[_0x296c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14562c,_0x3dcca0){return function(_0x1f58f7){if(!_0x1f58f7){_0x14562c['sendStatus'](0x194);}return _0x1f58f7;};}function handleError(_0x2eb665,_0x1135d4){_0x1135d4=_0x1135d4||0x1f4;return function(_0x1ab209){logger[_0x296c('0x25')](_0x1ab209['stack']);if(_0x1ab209['name']){delete _0x1ab209[_0x296c('0x26')];}_0x2eb665[_0x296c('0x18')](_0x1135d4)[_0x296c('0x27')](_0x1ab209);};}exports['index']=function(_0x4e076a,_0x1c8292){var _0x322dce={},_0x54bb87={},_0x409bea={'count':0x0,'rows':[]};var _0x4b2e6e=_['map'](db['FreshsalesField'][_0x296c('0x28')],function(_0x334791){return{'name':_0x334791[_0x296c('0x29')],'type':_0x334791[_0x296c('0x2a')][_0x296c('0x2b')]};});_0x54bb87[_0x296c('0x2c')]=_[_0x296c('0x2d')](_0x4b2e6e,_0x296c('0x26'));_0x54bb87[_0x296c('0x2e')]=_[_0x296c('0x2f')](_0x4e076a[_0x296c('0x2e')]);_0x54bb87[_0x296c('0x30')]=_[_0x296c('0x31')](_0x54bb87[_0x296c('0x2c')],_0x54bb87['query']);_0x322dce[_0x296c('0x32')]=_[_0x296c('0x31')](_0x54bb87[_0x296c('0x2c')],qs[_0x296c('0x33')](_0x4e076a[_0x296c('0x2e')]['fields']));_0x322dce['attributes']=_0x322dce[_0x296c('0x32')][_0x296c('0x34')]?_0x322dce['attributes']:_0x54bb87['model'];if(!_0x4e076a[_0x296c('0x2e')][_0x296c('0x35')]('nolimit')){_0x322dce['limit']=qs[_0x296c('0x1d')](_0x4e076a[_0x296c('0x2e')]['limit']);_0x322dce[_0x296c('0x1b')]=qs['offset'](_0x4e076a['query'][_0x296c('0x1b')]);}_0x322dce[_0x296c('0x36')]=qs[_0x296c('0x37')](_0x4e076a[_0x296c('0x2e')][_0x296c('0x37')]);_0x322dce[_0x296c('0x38')]=qs['filters'](_[_0x296c('0x39')](_0x4e076a[_0x296c('0x2e')],_0x54bb87[_0x296c('0x30')]),_0x4b2e6e);if(_0x4e076a['query'][_0x296c('0x3a')]){_0x322dce['where']=_[_0x296c('0x3b')](_0x322dce[_0x296c('0x38')],{'$or':_[_0x296c('0x2d')](_0x4b2e6e,function(_0xe5f1a3){if(_0xe5f1a3[_0x296c('0x2a')]!==_0x296c('0x3c')){var _0x2a7afd={};_0x2a7afd[_0xe5f1a3[_0x296c('0x26')]]={'$like':'%'+_0x4e076a[_0x296c('0x2e')][_0x296c('0x3a')]+'%'};return _0x2a7afd;}})});}_0x322dce=_[_0x296c('0x3b')]({},_0x322dce,_0x4e076a[_0x296c('0x3d')]);var _0x428aa2={'where':_0x322dce[_0x296c('0x38')]};return db[_0x296c('0x3e')][_0x296c('0x1e')](_0x428aa2)[_0x296c('0x24')](function(_0x1a3433){_0x409bea['count']=_0x1a3433;if(_0x4e076a['query'][_0x296c('0x3f')]){_0x322dce[_0x296c('0x40')]=[{'all':!![]}];}return db[_0x296c('0x3e')][_0x296c('0x41')](_0x322dce);})['then'](function(_0x2d4ecb){_0x409bea['rows']=_0x2d4ecb;return _0x409bea;})[_0x296c('0x24')](respondWithFilteredResult(_0x1c8292,_0x322dce))['catch'](handleError(_0x1c8292,null));};exports[_0x296c('0x42')]=function(_0x367aac,_0x4abd89){var _0xc88037={'raw':!![],'where':{'id':_0x367aac[_0x296c('0x43')]['id']}},_0x1bca46={};_0x1bca46['model']=_[_0x296c('0x2f')](db[_0x296c('0x3e')]['rawAttributes']);_0x1bca46['query']=_[_0x296c('0x2f')](_0x367aac[_0x296c('0x2e')]);_0x1bca46[_0x296c('0x30')]=_[_0x296c('0x31')](_0x1bca46[_0x296c('0x2c')],_0x1bca46[_0x296c('0x2e')]);_0xc88037[_0x296c('0x32')]=_[_0x296c('0x31')](_0x1bca46[_0x296c('0x2c')],qs[_0x296c('0x33')](_0x367aac[_0x296c('0x2e')][_0x296c('0x33')]));_0xc88037[_0x296c('0x32')]=_0xc88037['attributes']['length']?_0xc88037[_0x296c('0x32')]:_0x1bca46[_0x296c('0x2c')];if(_0x367aac['query'][_0x296c('0x3f')]){_0xc88037[_0x296c('0x40')]=[{'all':!![]}];}_0xc88037=_['merge']({},_0xc88037,_0x367aac[_0x296c('0x3d')]);return db['FreshsalesField'][_0x296c('0x44')](_0xc88037)[_0x296c('0x24')](handleEntityNotFound(_0x4abd89,null))[_0x296c('0x24')](respondWithResult(_0x4abd89,null))[_0x296c('0x45')](handleError(_0x4abd89,null));};exports['create']=function(_0x3f7d2c,_0x547c5e){return db[_0x296c('0x3e')][_0x296c('0x46')](_0x3f7d2c['body'],{})['then'](respondWithResult(_0x547c5e,0xc9))['catch'](handleError(_0x547c5e,null));};exports[_0x296c('0x23')]=function(_0x45ab08,_0x2141bf){if(_0x45ab08[_0x296c('0x47')]['id']){delete _0x45ab08[_0x296c('0x47')]['id'];}return db['FreshsalesField'][_0x296c('0x44')]({'where':{'id':_0x45ab08[_0x296c('0x43')]['id']}})[_0x296c('0x24')](handleEntityNotFound(_0x2141bf,null))[_0x296c('0x24')](saveUpdates(_0x45ab08[_0x296c('0x47')],null))[_0x296c('0x24')](respondWithResult(_0x2141bf,null))[_0x296c('0x45')](handleError(_0x2141bf,null));};exports['destroy']=function(_0x3554da,_0x237d77){return db[_0x296c('0x3e')][_0x296c('0x44')]({'where':{'id':_0x3554da[_0x296c('0x43')]['id']}})[_0x296c('0x24')](handleEntityNotFound(_0x237d77,null))[_0x296c('0x24')](removeEntity(_0x237d77,null))['catch'](handleError(_0x237d77,null));}; \ No newline at end of file +var _0x2f59=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','FreshsalesField','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xf2a3d6,_0x3e82e5){var _0x9f6302=function(_0x5bf546){while(--_0x5bf546){_0xf2a3d6['push'](_0xf2a3d6['shift']());}};_0x9f6302(++_0x3e82e5);}(_0x2f59,0x193));var _0x92f5=function(_0x440030,_0xaeec43){_0x440030=_0x440030-0x0;var _0x40d6b4=_0x2f59[_0x440030];return _0x40d6b4;};'use strict';var emlformat=require(_0x92f5('0x0'));var rimraf=require(_0x92f5('0x1'));var zipdir=require(_0x92f5('0x2'));var jsonpatch=require(_0x92f5('0x3'));var rp=require('request-promise');var moment=require(_0x92f5('0x4'));var BPromise=require(_0x92f5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x92f5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92f5('0x7'));var _=require('lodash');var squel=require(_0x92f5('0x8'));var crypto=require(_0x92f5('0x9'));var jsforce=require(_0x92f5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x92f5('0xb'));var querystring=require(_0x92f5('0xc'));var Papa=require(_0x92f5('0xd'));var Redis=require(_0x92f5('0xe'));var authService=require(_0x92f5('0xf'));var qs=require(_0x92f5('0x10'));var as=require(_0x92f5('0x11'));var hardwareService=require(_0x92f5('0x12'));var logger=require(_0x92f5('0x13'))(_0x92f5('0x14'));var utils=require(_0x92f5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x92f5('0x16'))['db'];function respondWithStatusCode(_0x4b49ed,_0x49d450){_0x49d450=_0x49d450||0xcc;return function(_0x13b525){if(_0x13b525){return _0x4b49ed[_0x92f5('0x17')](_0x49d450);}return _0x4b49ed[_0x92f5('0x18')](_0x49d450)['end']();};}function respondWithResult(_0x25a51b,_0xd9e733){_0xd9e733=_0xd9e733||0xc8;return function(_0xe996a8){if(_0xe996a8){return _0x25a51b['status'](_0xd9e733)[_0x92f5('0x19')](_0xe996a8);}};}function respondWithFilteredResult(_0x36aff0,_0x51283d){return function(_0x50ddbd){if(_0x50ddbd){var _0x1869bd=typeof _0x51283d[_0x92f5('0x1a')]===_0x92f5('0x1b')&&typeof _0x51283d[_0x92f5('0x1c')]===_0x92f5('0x1b');var _0x43e06e=_0x50ddbd['count'];var _0xd2c3a6=_0x1869bd?0x0:_0x51283d[_0x92f5('0x1a')];var _0x484bc9=_0x1869bd?_0x50ddbd[_0x92f5('0x1d')]:_0x51283d['offset']+_0x51283d[_0x92f5('0x1c')];var _0x446eaa;if(_0x484bc9>=_0x43e06e){_0x484bc9=_0x43e06e;_0x446eaa=0xc8;}else{_0x446eaa=0xce;}_0x36aff0['status'](_0x446eaa);return _0x36aff0[_0x92f5('0x1e')](_0x92f5('0x1f'),_0xd2c3a6+'-'+_0x484bc9+'/'+_0x43e06e)[_0x92f5('0x19')](_0x50ddbd);}return null;};}function patchUpdates(_0x5bc070){return function(_0x1b718b){try{jsonpatch[_0x92f5('0x20')](_0x1b718b,_0x5bc070,!![]);}catch(_0x1c7cd6){return BPromise[_0x92f5('0x21')](_0x1c7cd6);}return _0x1b718b[_0x92f5('0x22')]();};}function saveUpdates(_0x16fd99,_0x59c8b1){return function(_0x2f0ef0){if(_0x2f0ef0){return _0x2f0ef0[_0x92f5('0x23')](_0x16fd99)[_0x92f5('0x24')](function(_0x2a7f6b){return _0x2a7f6b;});}return null;};}function removeEntity(_0x2b98db,_0x31897d){return function(_0x16156c){if(_0x16156c){return _0x16156c[_0x92f5('0x25')]()[_0x92f5('0x24')](function(){_0x2b98db[_0x92f5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ce1d,_0x23d648){return function(_0x35793f){if(!_0x35793f){_0x39ce1d[_0x92f5('0x17')](0x194);}return _0x35793f;};}function handleError(_0x485937,_0x5925e6){_0x5925e6=_0x5925e6||0x1f4;return function(_0x3ce12e){logger[_0x92f5('0x26')](_0x3ce12e['stack']);if(_0x3ce12e['name']){delete _0x3ce12e['name'];}_0x485937[_0x92f5('0x18')](_0x5925e6)[_0x92f5('0x27')](_0x3ce12e);};}exports[_0x92f5('0x28')]=function(_0x1c16d3,_0x26d45d){var _0x1c5d96={},_0xd9171c={},_0x5da3bc={'count':0x0,'rows':[]};var _0x210c0b=_[_0x92f5('0x29')](db[_0x92f5('0x2a')][_0x92f5('0x2b')],function(_0x5230b6){return{'name':_0x5230b6['fieldName'],'type':_0x5230b6[_0x92f5('0x2c')][_0x92f5('0x2d')]};});_0xd9171c['model']=_[_0x92f5('0x29')](_0x210c0b,_0x92f5('0x2e'));_0xd9171c[_0x92f5('0x2f')]=_[_0x92f5('0x30')](_0x1c16d3['query']);_0xd9171c[_0x92f5('0x31')]=_[_0x92f5('0x32')](_0xd9171c['model'],_0xd9171c[_0x92f5('0x2f')]);_0x1c5d96['attributes']=_['intersection'](_0xd9171c[_0x92f5('0x33')],qs[_0x92f5('0x34')](_0x1c16d3[_0x92f5('0x2f')][_0x92f5('0x34')]));_0x1c5d96[_0x92f5('0x35')]=_0x1c5d96[_0x92f5('0x35')][_0x92f5('0x36')]?_0x1c5d96['attributes']:_0xd9171c[_0x92f5('0x33')];if(!_0x1c16d3[_0x92f5('0x2f')][_0x92f5('0x37')]('nolimit')){_0x1c5d96[_0x92f5('0x1c')]=qs[_0x92f5('0x1c')](_0x1c16d3[_0x92f5('0x2f')][_0x92f5('0x1c')]);_0x1c5d96[_0x92f5('0x1a')]=qs['offset'](_0x1c16d3[_0x92f5('0x2f')]['offset']);}_0x1c5d96['order']=qs['sort'](_0x1c16d3[_0x92f5('0x2f')]['sort']);_0x1c5d96[_0x92f5('0x38')]=qs['filters'](_[_0x92f5('0x39')](_0x1c16d3[_0x92f5('0x2f')],_0xd9171c[_0x92f5('0x31')]),_0x210c0b);if(_0x1c16d3[_0x92f5('0x2f')][_0x92f5('0x3a')]){_0x1c5d96['where']=_[_0x92f5('0x3b')](_0x1c5d96['where'],{'$or':_[_0x92f5('0x29')](_0x210c0b,function(_0x188dfd){if(_0x188dfd['type']!==_0x92f5('0x3c')){var _0x5dc5f1={};_0x5dc5f1[_0x188dfd['name']]={'$like':'%'+_0x1c16d3['query'][_0x92f5('0x3a')]+'%'};return _0x5dc5f1;}})});}_0x1c5d96=_[_0x92f5('0x3b')]({},_0x1c5d96,_0x1c16d3[_0x92f5('0x3d')]);var _0x819c57={'where':_0x1c5d96[_0x92f5('0x38')]};return db[_0x92f5('0x2a')]['count'](_0x819c57)[_0x92f5('0x24')](function(_0x5aef64){_0x5da3bc['count']=_0x5aef64;if(_0x1c16d3[_0x92f5('0x2f')][_0x92f5('0x3e')]){_0x1c5d96['include']=[{'all':!![]}];}return db[_0x92f5('0x2a')][_0x92f5('0x3f')](_0x1c5d96);})['then'](function(_0x30be16){_0x5da3bc['rows']=_0x30be16;return _0x5da3bc;})[_0x92f5('0x24')](respondWithFilteredResult(_0x26d45d,_0x1c5d96))['catch'](handleError(_0x26d45d,null));};exports[_0x92f5('0x40')]=function(_0x28cbbc,_0x3f6408){var _0x5d092f={'raw':!![],'where':{'id':_0x28cbbc[_0x92f5('0x41')]['id']}},_0x34ceb1={};_0x34ceb1[_0x92f5('0x33')]=_['keys'](db[_0x92f5('0x2a')][_0x92f5('0x2b')]);_0x34ceb1[_0x92f5('0x2f')]=_['keys'](_0x28cbbc[_0x92f5('0x2f')]);_0x34ceb1['filters']=_[_0x92f5('0x32')](_0x34ceb1[_0x92f5('0x33')],_0x34ceb1['query']);_0x5d092f['attributes']=_['intersection'](_0x34ceb1[_0x92f5('0x33')],qs[_0x92f5('0x34')](_0x28cbbc[_0x92f5('0x2f')][_0x92f5('0x34')]));_0x5d092f[_0x92f5('0x35')]=_0x5d092f['attributes']['length']?_0x5d092f[_0x92f5('0x35')]:_0x34ceb1[_0x92f5('0x33')];if(_0x28cbbc['query'][_0x92f5('0x3e')]){_0x5d092f['include']=[{'all':!![]}];}_0x5d092f=_[_0x92f5('0x3b')]({},_0x5d092f,_0x28cbbc['options']);return db[_0x92f5('0x2a')]['find'](_0x5d092f)[_0x92f5('0x24')](handleEntityNotFound(_0x3f6408,null))[_0x92f5('0x24')](respondWithResult(_0x3f6408,null))[_0x92f5('0x42')](handleError(_0x3f6408,null));};exports[_0x92f5('0x43')]=function(_0x5a74bf,_0x3792d4){return db[_0x92f5('0x2a')][_0x92f5('0x43')](_0x5a74bf[_0x92f5('0x44')],{})['then'](respondWithResult(_0x3792d4,0xc9))[_0x92f5('0x42')](handleError(_0x3792d4,null));};exports[_0x92f5('0x23')]=function(_0x2d012f,_0x40050a){if(_0x2d012f[_0x92f5('0x44')]['id']){delete _0x2d012f['body']['id'];}return db['FreshsalesField'][_0x92f5('0x45')]({'where':{'id':_0x2d012f[_0x92f5('0x41')]['id']}})[_0x92f5('0x24')](handleEntityNotFound(_0x40050a,null))[_0x92f5('0x24')](saveUpdates(_0x2d012f[_0x92f5('0x44')],null))[_0x92f5('0x24')](respondWithResult(_0x40050a,null))[_0x92f5('0x42')](handleError(_0x40050a,null));};exports[_0x92f5('0x25')]=function(_0x433376,_0x3a7bbb){return db[_0x92f5('0x2a')][_0x92f5('0x45')]({'where':{'id':_0x433376['params']['id']}})[_0x92f5('0x24')](handleEntityNotFound(_0x3a7bbb,null))[_0x92f5('0x24')](removeEntity(_0x3a7bbb,null))['catch'](handleError(_0x3a7bbb,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index f18271b..77d41c3 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 _0xb98e=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x27a9cc,_0x1b1b55){var _0x412f06=function(_0x6edd42){while(--_0x6edd42){_0x27a9cc['push'](_0x27a9cc['shift']());}};_0x412f06(++_0x1b1b55);}(_0xb98e,0x184));var _0xeb98=function(_0x4cbef0,_0x156c2e){_0x4cbef0=_0x4cbef0-0x0;var _0x57aa69=_0xb98e[_0x4cbef0];return _0x57aa69;};'use strict';var _=require(_0xeb98('0x0'));var util=require(_0xeb98('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb98('0x2'));var BPromise=require(_0xeb98('0x3'));var rp=require(_0xeb98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb98('0x5'));var config=require(_0xeb98('0x6'));var attributes=require(_0xeb98('0x7'));module['exports']=function(_0x33a16e,_0x5d12df){return _0x33a16e[_0xeb98('0x8')]('FreshsalesField',attributes,{'tableName':_0xeb98('0x9'),'paranoid':![],'indexes':[{'name':_0xeb98('0xa'),'fields':[_0xeb98('0xb'),_0xeb98('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9563=['exports','define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2d98f1,_0x254499){var _0x5cbe38=function(_0x4f6b39){while(--_0x4f6b39){_0x2d98f1['push'](_0x2d98f1['shift']());}};_0x5cbe38(++_0x254499);}(_0x9563,0x1e7));var _0x3956=function(_0x1e867b,_0x433e63){_0x1e867b=_0x1e867b-0x0;var _0x192303=_0x9563[_0x1e867b];return _0x192303;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var logger=require('../../config/logger')(_0x3956('0x2'));var moment=require(_0x3956('0x3'));var BPromise=require(_0x3956('0x4'));var rp=require(_0x3956('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3956('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x3956('0x7')]=function(_0x332a45,_0x177a1a){return _0x332a45[_0x3956('0x8')]('FreshsalesField',attributes,{'tableName':_0x3956('0x9'),'paranoid':![],'indexes':[{'name':_0x3956('0xa'),'fields':[_0x3956('0xb'),_0x3956('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 fe02031..ff7df3c 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4b4865,_0xb43449){var _0x190dc2=function(_0x2b41f7){while(--_0x2b41f7){_0x4b4865['push'](_0x4b4865['shift']());}};_0x190dc2(++_0xb43449);}(_0x524e,0x15e));var _0xe524=function(_0x4378bd,_0x4ce47c){_0x4378bd=_0x4378bd-0x0;var _0x47d52b=_0x524e[_0x4378bd];return _0x47d52b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d2f6f,_0x373079){var _0x3d5dd9=function(_0x42c0cf){while(--_0x42c0cf){_0x1d2f6f['push'](_0x1d2f6f['shift']());}};_0x3d5dd9(++_0x373079);}(_0xafc4,0x69));var _0x4afc=function(_0x459335,_0x1830f5){_0x459335=_0x459335-0x0;var _0x1bf571=_0xafc4[_0x459335];return _0x1bf571;};'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')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\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);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index a6fa171..5112f16 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x25a232,_0x2e709c){var _0x40c962=function(_0x277868){while(--_0x277868){_0x25a232['push'](_0x25a232['shift']());}};_0x40c962(++_0x2e709c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xd861df,_0x26c43){var _0x26d938=function(_0x2331bb){while(--_0x2331bb){_0xd861df['push'](_0xd861df['shift']());}};_0x26d938(++_0x26c43);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index e9f50ba..b3d610b 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 _0x7da6=['STRING','username','ENUM','newTab'];(function(_0x32599b,_0x1b803f){var _0x4ac7f2=function(_0x2976bc){while(--_0x2976bc){_0x32599b['push'](_0x32599b['shift']());}};_0x4ac7f2(++_0x1b803f);}(_0x7da6,0x124));var _0x67da=function(_0x4ae459,_0x3bf329){_0x4ae459=_0x4ae459-0x0;var _0x51d0c9=_0x7da6[_0x4ae459];return _0x51d0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x67da('0x0')]},'description':{'type':Sequelize[_0x67da('0x0')]},'username':{'type':Sequelize[_0x67da('0x0')],'unique':_0x67da('0x1')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x67da('0x0')]},'clientId':{'type':Sequelize[_0x67da('0x0')]},'clientSecret':{'type':Sequelize[_0x67da('0x0')]},'securityToken':{'type':Sequelize[_0x67da('0x0')]},'serverUrl':{'type':Sequelize[_0x67da('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x67da('0x2')]('integrationTab',_0x67da('0x3')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe98c=['integrationTab','sequelize','exports','STRING','ENUM','newTab'];(function(_0x5a8ebe,_0x1f4972){var _0x11adeb=function(_0x45f6d0){while(--_0x45f6d0){_0x5a8ebe['push'](_0x5a8ebe['shift']());}};_0x11adeb(++_0x1f4972);}(_0xe98c,0xd3));var _0xce98=function(_0xfc53fc,_0x4204d6){_0xfc53fc=_0xfc53fc-0x0;var _0x423828=_0xe98c[_0xfc53fc];return _0x423828;};'use strict';var Sequelize=require(_0xce98('0x0'));module[_0xce98('0x1')]={'name':{'type':Sequelize[_0xce98('0x2')]},'description':{'type':Sequelize[_0xce98('0x2')]},'username':{'type':Sequelize[_0xce98('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xce98('0x2')]},'password':{'type':Sequelize[_0xce98('0x2')]},'clientId':{'type':Sequelize[_0xce98('0x2')]},'clientSecret':{'type':Sequelize[_0xce98('0x2')]},'securityToken':{'type':Sequelize[_0xce98('0x2')]},'serverUrl':{'type':Sequelize[_0xce98('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xce98('0x3')]('integrationTab',_0xce98('0x4')),'defaultValue':_0xce98('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5953abc..3d1524c 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 _0xb61a=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','SalesforceField','getFields','Task','clientId','username','password','securityToken','remoteUri','slice','substring','Connection','login','concat','isNil','describe','ActivityDate','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','includes','label','picklistValues','True','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra'];(function(_0x5b7449,_0x195288){var _0x41a13c=function(_0x5ad0e0){while(--_0x5ad0e0){_0x5b7449['push'](_0x5b7449['shift']());}};_0x41a13c(++_0x195288);}(_0xb61a,0x6d));var _0xab61=function(_0x2a0b1a,_0x2d5708){_0x2a0b1a=_0x2a0b1a-0x0;var _0x2de4f5=_0xb61a[_0x2a0b1a];return _0x2de4f5;};'use strict';var emlformat=require(_0xab61('0x0'));var rimraf=require(_0xab61('0x1'));var zipdir=require(_0xab61('0x2'));var jsonpatch=require(_0xab61('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab61('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xab61('0x5'));var sox=require(_0xab61('0x6'));var csv=require('to-csv');var ejs=require(_0xab61('0x7'));var fs=require('fs');var fs_extra=require(_0xab61('0x8'));var _=require(_0xab61('0x9'));var squel=require(_0xab61('0xa'));var crypto=require(_0xab61('0xb'));var jsforce=require(_0xab61('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab61('0xd'));var Redis=require(_0xab61('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xab61('0xf'));var as=require(_0xab61('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab61('0x11'))(_0xab61('0x12'));var utils=require(_0xab61('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xab61('0x14'));var db=require(_0xab61('0x15'))['db'];var integrations=require(_0xab61('0x16'));function respondWithStatusCode(_0x11cc6a,_0x223835){_0x223835=_0x223835||0xcc;return function(_0x2d2bad){if(_0x2d2bad){return _0x11cc6a[_0xab61('0x17')](_0x223835);}return _0x11cc6a[_0xab61('0x18')](_0x223835)[_0xab61('0x19')]();};}function respondWithResult(_0x47670e,_0xbd81cc){_0xbd81cc=_0xbd81cc||0xc8;return function(_0x1451ee){if(_0x1451ee){return _0x47670e[_0xab61('0x18')](_0xbd81cc)[_0xab61('0x1a')](_0x1451ee);}};}function respondWithFilteredResult(_0x2bb1ac,_0x4c0eea){return function(_0x343029){if(_0x343029){var _0xeadad7=typeof _0x4c0eea['offset']===_0xab61('0x1b')&&typeof _0x4c0eea[_0xab61('0x1c')]===_0xab61('0x1b');var _0x56fd2c=_0x343029[_0xab61('0x1d')];var _0x91602=_0xeadad7?0x0:_0x4c0eea['offset'];var _0x3eba9e=_0xeadad7?_0x343029[_0xab61('0x1d')]:_0x4c0eea[_0xab61('0x1e')]+_0x4c0eea[_0xab61('0x1c')];var _0x20c3ef;if(_0x3eba9e>=_0x56fd2c){_0x3eba9e=_0x56fd2c;_0x20c3ef=0xc8;}else{_0x20c3ef=0xce;}_0x2bb1ac[_0xab61('0x18')](_0x20c3ef);return _0x2bb1ac[_0xab61('0x1f')](_0xab61('0x20'),_0x91602+'-'+_0x3eba9e+'/'+_0x56fd2c)[_0xab61('0x1a')](_0x343029);}return null;};}function patchUpdates(_0x20578f){return function(_0x2993da){try{jsonpatch['apply'](_0x2993da,_0x20578f,!![]);}catch(_0x357798){return BPromise['reject'](_0x357798);}return _0x2993da[_0xab61('0x21')]();};}function saveUpdates(_0x57a9bc,_0x4f8913){return function(_0x517fd5){if(_0x517fd5){return _0x517fd5['update'](_0x57a9bc)[_0xab61('0x22')](function(_0x1f56d8){return _0x1f56d8;});}return null;};}function removeEntity(_0x57699b,_0x3ec133){return function(_0x452f03){if(_0x452f03){return _0x452f03[_0xab61('0x23')]()[_0xab61('0x22')](function(){_0x57699b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37bf46,_0x3349dd){return function(_0x490bf2){if(!_0x490bf2){_0x37bf46[_0xab61('0x17')](0x194);}return _0x490bf2;};}function handleError(_0x26defe,_0x2ee3e6){_0x2ee3e6=_0x2ee3e6||0x1f4;return function(_0x41983b){logger[_0xab61('0x24')](_0x41983b[_0xab61('0x25')]);if(_0x41983b[_0xab61('0x26')]){delete _0x41983b[_0xab61('0x26')];}_0x26defe[_0xab61('0x18')](_0x2ee3e6)[_0xab61('0x27')](_0x41983b);};}exports['index']=function(_0x577ae8,_0x20abc6){var _0x37d903={},_0x14696c={},_0x12cc83={'count':0x0,'rows':[]};var _0x361e74=_[_0xab61('0x28')](db[_0xab61('0x29')][_0xab61('0x2a')],function(_0x20857f){return{'name':_0x20857f[_0xab61('0x2b')],'type':_0x20857f[_0xab61('0x2c')][_0xab61('0x2d')]};});_0x14696c[_0xab61('0x2e')]=_[_0xab61('0x28')](_0x361e74,_0xab61('0x26'));_0x14696c[_0xab61('0x2f')]=_[_0xab61('0x30')](_0x577ae8[_0xab61('0x2f')]);_0x14696c['filters']=_[_0xab61('0x31')](_0x14696c[_0xab61('0x2e')],_0x14696c['query']);_0x37d903[_0xab61('0x32')]=_[_0xab61('0x31')](_0x14696c[_0xab61('0x2e')],qs[_0xab61('0x33')](_0x577ae8[_0xab61('0x2f')]['fields']));_0x37d903[_0xab61('0x32')]=_0x37d903[_0xab61('0x32')][_0xab61('0x34')]?_0x37d903[_0xab61('0x32')]:_0x14696c['model'];if(!_0x577ae8['query'][_0xab61('0x35')](_0xab61('0x36'))){_0x37d903[_0xab61('0x1c')]=qs[_0xab61('0x1c')](_0x577ae8[_0xab61('0x2f')][_0xab61('0x1c')]);_0x37d903['offset']=qs[_0xab61('0x1e')](_0x577ae8['query'][_0xab61('0x1e')]);}_0x37d903[_0xab61('0x37')]=qs[_0xab61('0x38')](_0x577ae8[_0xab61('0x2f')][_0xab61('0x38')]);_0x37d903['where']=qs[_0xab61('0x39')](_[_0xab61('0x3a')](_0x577ae8['query'],_0x14696c[_0xab61('0x39')]),_0x361e74);if(_0x577ae8[_0xab61('0x2f')]['filter']){_0x37d903[_0xab61('0x3b')]=_[_0xab61('0x3c')](_0x37d903[_0xab61('0x3b')],{'$or':_[_0xab61('0x28')](_0x361e74,function(_0x5b965c){if(_0x5b965c['type']!=='VIRTUAL'){var _0x3b10aa={};_0x3b10aa[_0x5b965c[_0xab61('0x26')]]={'$like':'%'+_0x577ae8[_0xab61('0x2f')][_0xab61('0x3d')]+'%'};return _0x3b10aa;}})});}_0x37d903=_[_0xab61('0x3c')]({},_0x37d903,_0x577ae8[_0xab61('0x3e')]);var _0x5651dd={'where':_0x37d903[_0xab61('0x3b')]};return db['SalesforceAccount'][_0xab61('0x1d')](_0x5651dd)[_0xab61('0x22')](function(_0x2f695a){_0x12cc83[_0xab61('0x1d')]=_0x2f695a;if(_0x577ae8[_0xab61('0x2f')][_0xab61('0x3f')]){_0x37d903[_0xab61('0x40')]=[{'all':!![]}];}return db[_0xab61('0x29')][_0xab61('0x41')](_0x37d903);})[_0xab61('0x22')](function(_0x5a72c6){_0x12cc83[_0xab61('0x42')]=_0x5a72c6;return _0x12cc83;})[_0xab61('0x22')](respondWithFilteredResult(_0x20abc6,_0x37d903))[_0xab61('0x43')](handleError(_0x20abc6,null));};exports[_0xab61('0x44')]=function(_0x3c6ba6,_0x2d554f){var _0x43068b={'raw':![],'where':{'id':_0x3c6ba6[_0xab61('0x45')]['id']}},_0x21406c={};_0x21406c[_0xab61('0x2e')]=_[_0xab61('0x30')](db[_0xab61('0x29')][_0xab61('0x2a')]);_0x21406c['query']=_['keys'](_0x3c6ba6['query']);_0x21406c[_0xab61('0x39')]=_[_0xab61('0x31')](_0x21406c['model'],_0x21406c['query']);_0x43068b['attributes']=_[_0xab61('0x31')](_0x21406c['model'],qs[_0xab61('0x33')](_0x3c6ba6['query'][_0xab61('0x33')]));_0x43068b[_0xab61('0x32')]=_0x43068b['attributes'][_0xab61('0x34')]?_0x43068b['attributes']:_0x21406c[_0xab61('0x2e')];if(_0x3c6ba6[_0xab61('0x2f')][_0xab61('0x3f')]){_0x43068b[_0xab61('0x40')]=[{'all':!![]}];}_0x43068b=_[_0xab61('0x3c')]({},_0x43068b,_0x3c6ba6[_0xab61('0x3e')]);return db[_0xab61('0x29')][_0xab61('0x46')](_0x43068b)[_0xab61('0x22')](handleEntityNotFound(_0x2d554f,null))['then'](respondWithResult(_0x2d554f,null))[_0xab61('0x43')](handleError(_0x2d554f,null));};exports['create']=function(_0x366e0e,_0x2d9208){return db['SalesforceAccount'][_0xab61('0x47')](_0x366e0e['body'],{})['then'](respondWithResult(_0x2d9208,0xc9))[_0xab61('0x43')](handleError(_0x2d9208,null));};exports[_0xab61('0x48')]=function(_0x416e9d,_0x4d84eb){if(_0x416e9d['body']['id']){delete _0x416e9d[_0xab61('0x49')]['id'];}return db[_0xab61('0x29')]['find']({'where':{'id':_0x416e9d['params']['id']}})['then'](handleEntityNotFound(_0x4d84eb,null))['then'](saveUpdates(_0x416e9d[_0xab61('0x49')],null))['then'](respondWithResult(_0x4d84eb,null))['catch'](handleError(_0x4d84eb,null));};exports[_0xab61('0x23')]=function(_0x2decfb,_0x4052d9){return db[_0xab61('0x29')][_0xab61('0x46')]({'where':{'id':_0x2decfb['params']['id']}})[_0xab61('0x22')](handleEntityNotFound(_0x4052d9,null))[_0xab61('0x22')](removeEntity(_0x4052d9,null))[_0xab61('0x43')](handleError(_0x4052d9,null));};exports[_0xab61('0x4a')]=function(_0x3b825a,_0x22acbd,_0x2b10c8){var _0x234bb8={};var _0x3d3137={};var _0xbf99b2;var _0x99a3b0;return db[_0xab61('0x29')]['findOne']({'where':{'id':_0x3b825a[_0xab61('0x45')]['id']}})[_0xab61('0x22')](handleEntityNotFound(_0x22acbd,null))[_0xab61('0x22')](function(_0x554494){if(_0x554494){_0xbf99b2=_0x554494;_0x3d3137[_0xab61('0x2e')]=_[_0xab61('0x30')](db['SalesforceConfiguration'][_0xab61('0x2a')]);_0x3d3137[_0xab61('0x2f')]=_[_0xab61('0x30')](_0x3b825a[_0xab61('0x2f')]);_0x3d3137['filters']=_[_0xab61('0x31')](_0x3d3137[_0xab61('0x2e')],_0x3d3137[_0xab61('0x2f')]);_0x234bb8[_0xab61('0x32')]=_[_0xab61('0x31')](_0x3d3137[_0xab61('0x2e')],qs[_0xab61('0x33')](_0x3b825a['query'][_0xab61('0x33')]));_0x234bb8[_0xab61('0x32')]=_0x234bb8['attributes'][_0xab61('0x34')]?_0x234bb8[_0xab61('0x32')]:_0x3d3137['model'];_0x234bb8['order']=qs[_0xab61('0x38')](_0x3b825a[_0xab61('0x2f')]['sort']);_0x234bb8[_0xab61('0x3b')]=qs[_0xab61('0x39')](_[_0xab61('0x3a')](_0x3b825a[_0xab61('0x2f')],_0x3d3137[_0xab61('0x39')]));if(_0x3b825a['query'][_0xab61('0x3d')]){_0x234bb8['where']=_['merge'](_0x234bb8[_0xab61('0x3b')],{'$or':_[_0xab61('0x28')](_0x234bb8[_0xab61('0x32')],function(_0x1423eb){var _0x314818={};_0x314818[_0x1423eb]={'$like':'%'+_0x3b825a[_0xab61('0x2f')][_0xab61('0x3d')]+'%'};return _0x314818;})});}_0x234bb8=_[_0xab61('0x3c')]({},_0x234bb8,_0x3b825a[_0xab61('0x3e')]);return _0xbf99b2[_0xab61('0x4a')](_0x234bb8);}})['then'](function(_0x588132){if(_0x588132){_0x99a3b0=_0x588132['length'];if(!_0x3b825a['query']['hasOwnProperty']('nolimit')){_0x234bb8['limit']=qs[_0xab61('0x1c')](_0x3b825a[_0xab61('0x2f')]['limit']);_0x234bb8[_0xab61('0x1e')]=qs[_0xab61('0x1e')](_0x3b825a[_0xab61('0x2f')]['offset']);}return _0xbf99b2[_0xab61('0x4a')](_0x234bb8);}})['then'](function(_0x1cfa12){if(_0x1cfa12){return _0x1cfa12?{'count':_0x99a3b0,'rows':_0x1cfa12}:null;}})[_0xab61('0x22')](respondWithResult(_0x22acbd,null))[_0xab61('0x43')](handleError(_0x22acbd,null));};exports[_0xab61('0x4b')]=function(_0x5ccd7f,_0x4fa20d,_0x46b2eb){if(_0x5ccd7f[_0xab61('0x49')]['id']){delete _0x5ccd7f[_0xab61('0x49')]['id'];}return db[_0xab61('0x29')][_0xab61('0x4c')]({'where':{'id':_0x5ccd7f['params']['id']}})[_0xab61('0x22')](handleEntityNotFound(_0x4fa20d,null))[_0xab61('0x22')](function(_0x51d893){if(_0x51d893){_0x5ccd7f[_0xab61('0x49')][_0xab61('0x4d')]=_0x51d893['id'];_0x5ccd7f[_0xab61('0x49')][_0xab61('0x4e')]=integrations['getSubjects'](_0x5ccd7f[_0xab61('0x49')][_0xab61('0x4f')],_0x5ccd7f['body']['type']);_0x5ccd7f[_0xab61('0x49')][_0xab61('0x50')]=integrations['getDescriptions'](_0x5ccd7f[_0xab61('0x49')][_0xab61('0x4f')],_0x5ccd7f[_0xab61('0x49')][_0xab61('0x2c')]);return db['SalesforceConfiguration'][_0xab61('0x47')](_0x5ccd7f['body'],{'include':[{'model':db[_0xab61('0x51')],'as':_0xab61('0x4e')},{'model':db[_0xab61('0x51')],'as':_0xab61('0x50')}]});}return null;})['then'](respondWithResult(_0x4fa20d,null))['catch'](handleError(_0x4fa20d,null));};exports[_0xab61('0x52')]=function(_0x3a8fb3,_0x34cc72,_0x34396a){var _0x4d15c4;var _0x2956da='';var _0x340bf7=_0xab61('0x53');return db[_0xab61('0x29')][_0xab61('0x4c')]({'where':{'id':_0x3a8fb3[_0xab61('0x45')]['id']},'attributes':['id','remoteUri',_0xab61('0x54'),'clientSecret',_0xab61('0x55'),_0xab61('0x56'),_0xab61('0x57')]})[_0xab61('0x22')](handleEntityNotFound(_0x34cc72,null))[_0xab61('0x22')](function(_0x4270ab){if(_0x4270ab){_0x2956da=_0x4270ab[_0xab61('0x58')];var _0x4cea9a=_0x2956da[_0xab61('0x59')](-0x1);if(_0x4cea9a==='/'){_0x2956da=_0x2956da[_0xab61('0x5a')](0x0,_0x2956da['lastIndexOf'](_0x4cea9a));}_0x4d15c4=new jsforce[(_0xab61('0x5b'))]({'oauth2':{'loginUrl':_0x2956da,'clientId':_0x4270ab[_0xab61('0x54')],'clientSecret':_0x4270ab['clientSecret']}});return _0x4d15c4[_0xab61('0x5c')](_0x4270ab[_0xab61('0x55')],_0x4270ab[_0xab61('0x56')][_0xab61('0x5d')](_0x4270ab[_0xab61('0x57')]));}})[_0xab61('0x22')](function(_0x2453aa){if(_0x2453aa){if(!_[_0xab61('0x5e')](_0x3a8fb3[_0xab61('0x2f')]['ticketType'])){_0x340bf7=_0x3a8fb3[_0xab61('0x2f')]['ticketType'];}return _0x4d15c4['sobject'](_0x340bf7)[_0xab61('0x5f')]();}})['then'](function(_0x57b6fd){var _0x189c4f=['OwnerId',_0xab61('0x60'),'IsReminderSet',_0xab61('0x61'),_0xab61('0x62'),_0xab61('0x63')];var _0x2964cf=[_0xab61('0x64'),_0xab61('0x65'),_0xab61('0x66'),_0xab61('0x67'),'email',_0xab61('0x68'),_0xab61('0x69')];if(_0x57b6fd){_['remove'](_0x57b6fd['fields'],function(_0x434013){return _0x189c4f['includes'](_0x434013['name'])||!_0x2964cf[_0xab61('0x6a')](_0x434013[_0xab61('0x2c')]);});return{'count':_0x57b6fd[_0xab61('0x33')][_0xab61('0x34')],'rows':_[_0xab61('0x28')](_0x57b6fd['fields'],function(_0x49ee0a){return{'id':_0x49ee0a[_0xab61('0x26')],'name':_0x49ee0a[_0xab61('0x6b')],'custom':_0x49ee0a['custom'],'options':_0x49ee0a[_0xab61('0x6c')][_0xab61('0x34')]>0x0?_['map'](_0x49ee0a[_0xab61('0x6c')],function(_0x1e32f3){return{'name':_0x1e32f3['label'],'value':_0x1e32f3['value']};}):_0x49ee0a[_0xab61('0x2c')]==_0xab61('0x67')?[{'name':_0xab61('0x6d'),'value':_0xab61('0x6e')},{'name':_0xab61('0x6f'),'value':_0xab61('0x70')}]:[]};})};}})[_0xab61('0x22')](respondWithResult(_0x34cc72,null))[_0xab61('0x43')](function(_0x2c0dd4){var _0x2ecdd2=_0x3a8fb3['query'][_0xab61('0x71')]?0x1f4:_0x2c0dd4['statusCode']||0x1f4;logger['error'](_0xab61('0x72'),_0xab61('0x52'),_0x2ecdd2,JSON[_0xab61('0x73')](_0x2c0dd4));delete _0x2c0dd4['name'];if(_0x2ecdd2===0x191){_0x2ecdd2=0x190;}_0x34cc72['status'](_0x2ecdd2)['send'](_0x3a8fb3[_0xab61('0x2f')][_0xab61('0x71')]?{'message':_0xab61('0x74'),'statusCode':_0x2c0dd4[_0xab61('0x75')]}:_0x2c0dd4);});}; \ No newline at end of file +var _0x4a8f=['concat','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','Description','int','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','sort','where','filter','merge','options','include','findAll','catch','params','includeAll','find','create','body','SalesforceConfiguration','order','pick','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','SalesforceField','Subjects','getFields','Task','clientId','clientSecret','username','password','remoteUri','slice','substring','lastIndexOf','Connection','login'];(function(_0x4ef39c,_0x384a3d){var _0x310cf6=function(_0x21e79c){while(--_0x21e79c){_0x4ef39c['push'](_0x4ef39c['shift']());}};_0x310cf6(++_0x384a3d);}(_0x4a8f,0x112));var _0xf4a8=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x4a8f[_0x16db8b];return _0x5ba017;};'use strict';var emlformat=require(_0xf4a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4a8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4a8('0x2'));var moment=require('moment');var BPromise=require(_0xf4a8('0x3'));var Mustache=require(_0xf4a8('0x4'));var util=require(_0xf4a8('0x5'));var path=require(_0xf4a8('0x6'));var sox=require(_0xf4a8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4a8('0x8'));var _=require(_0xf4a8('0x9'));var squel=require(_0xf4a8('0xa'));var crypto=require(_0xf4a8('0xb'));var jsforce=require(_0xf4a8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf4a8('0xd'));var querystring=require(_0xf4a8('0xe'));var Papa=require(_0xf4a8('0xf'));var Redis=require(_0xf4a8('0x10'));var authService=require(_0xf4a8('0x11'));var qs=require(_0xf4a8('0x12'));var as=require(_0xf4a8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4a8('0x14'))(_0xf4a8('0x15'));var utils=require('../../config/utils');var config=require(_0xf4a8('0x16'));var licenseUtil=require(_0xf4a8('0x17'));var db=require(_0xf4a8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c953e,_0x116aa2){_0x116aa2=_0x116aa2||0xcc;return function(_0x19bea0){if(_0x19bea0){return _0x4c953e[_0xf4a8('0x19')](_0x116aa2);}return _0x4c953e['status'](_0x116aa2)[_0xf4a8('0x1a')]();};}function respondWithResult(_0x2aa73a,_0x10d7c9){_0x10d7c9=_0x10d7c9||0xc8;return function(_0x5202ae){if(_0x5202ae){return _0x2aa73a[_0xf4a8('0x1b')](_0x10d7c9)[_0xf4a8('0x1c')](_0x5202ae);}};}function respondWithFilteredResult(_0x12ec18,_0x898a4){return function(_0x15fdb3){if(_0x15fdb3){var _0x33b153=typeof _0x898a4[_0xf4a8('0x1d')]===_0xf4a8('0x1e')&&typeof _0x898a4['limit']==='undefined';var _0xfdacfd=_0x15fdb3['count'];var _0x4401d2=_0x33b153?0x0:_0x898a4[_0xf4a8('0x1d')];var _0x2fac76=_0x33b153?_0x15fdb3[_0xf4a8('0x1f')]:_0x898a4['offset']+_0x898a4[_0xf4a8('0x20')];var _0x38903f;if(_0x2fac76>=_0xfdacfd){_0x2fac76=_0xfdacfd;_0x38903f=0xc8;}else{_0x38903f=0xce;}_0x12ec18[_0xf4a8('0x1b')](_0x38903f);return _0x12ec18[_0xf4a8('0x21')](_0xf4a8('0x22'),_0x4401d2+'-'+_0x2fac76+'/'+_0xfdacfd)[_0xf4a8('0x1c')](_0x15fdb3);}return null;};}function patchUpdates(_0x39b1a8){return function(_0x4f392e){try{jsonpatch[_0xf4a8('0x23')](_0x4f392e,_0x39b1a8,!![]);}catch(_0xf231ab){return BPromise[_0xf4a8('0x24')](_0xf231ab);}return _0x4f392e[_0xf4a8('0x25')]();};}function saveUpdates(_0x53d9a2,_0x183ff8){return function(_0x38e08e){if(_0x38e08e){return _0x38e08e[_0xf4a8('0x26')](_0x53d9a2)[_0xf4a8('0x27')](function(_0x207d33){return _0x207d33;});}return null;};}function removeEntity(_0x411c65,_0x4f1275){return function(_0x846ca4){if(_0x846ca4){return _0x846ca4[_0xf4a8('0x28')]()[_0xf4a8('0x27')](function(){_0x411c65['status'](0xcc)[_0xf4a8('0x1a')]();});}};}function handleEntityNotFound(_0x163589,_0x2a6c66){return function(_0x3a8a05){if(!_0x3a8a05){_0x163589[_0xf4a8('0x19')](0x194);}return _0x3a8a05;};}function handleError(_0x275ae0,_0x54a8d8){_0x54a8d8=_0x54a8d8||0x1f4;return function(_0x76e252){logger[_0xf4a8('0x29')](_0x76e252[_0xf4a8('0x2a')]);if(_0x76e252[_0xf4a8('0x2b')]){delete _0x76e252[_0xf4a8('0x2b')];}_0x275ae0[_0xf4a8('0x1b')](_0x54a8d8)['send'](_0x76e252);};}exports['index']=function(_0x538a23,_0x24eca1){var _0x269ac9={},_0x428e9a={},_0x249b29={'count':0x0,'rows':[]};var _0x3e086f=_[_0xf4a8('0x2c')](db[_0xf4a8('0x2d')][_0xf4a8('0x2e')],function(_0x332403){return{'name':_0x332403['fieldName'],'type':_0x332403[_0xf4a8('0x2f')][_0xf4a8('0x30')]};});_0x428e9a[_0xf4a8('0x31')]=_[_0xf4a8('0x2c')](_0x3e086f,_0xf4a8('0x2b'));_0x428e9a['query']=_[_0xf4a8('0x32')](_0x538a23[_0xf4a8('0x33')]);_0x428e9a[_0xf4a8('0x34')]=_[_0xf4a8('0x35')](_0x428e9a['model'],_0x428e9a['query']);_0x269ac9[_0xf4a8('0x36')]=_[_0xf4a8('0x35')](_0x428e9a[_0xf4a8('0x31')],qs[_0xf4a8('0x37')](_0x538a23[_0xf4a8('0x33')]['fields']));_0x269ac9[_0xf4a8('0x36')]=_0x269ac9[_0xf4a8('0x36')][_0xf4a8('0x38')]?_0x269ac9[_0xf4a8('0x36')]:_0x428e9a[_0xf4a8('0x31')];if(!_0x538a23[_0xf4a8('0x33')]['hasOwnProperty']('nolimit')){_0x269ac9[_0xf4a8('0x20')]=qs[_0xf4a8('0x20')](_0x538a23[_0xf4a8('0x33')][_0xf4a8('0x20')]);_0x269ac9[_0xf4a8('0x1d')]=qs[_0xf4a8('0x1d')](_0x538a23['query'][_0xf4a8('0x1d')]);}_0x269ac9['order']=qs[_0xf4a8('0x39')](_0x538a23[_0xf4a8('0x33')][_0xf4a8('0x39')]);_0x269ac9[_0xf4a8('0x3a')]=qs[_0xf4a8('0x34')](_['pick'](_0x538a23[_0xf4a8('0x33')],_0x428e9a[_0xf4a8('0x34')]),_0x3e086f);if(_0x538a23[_0xf4a8('0x33')][_0xf4a8('0x3b')]){_0x269ac9[_0xf4a8('0x3a')]=_[_0xf4a8('0x3c')](_0x269ac9[_0xf4a8('0x3a')],{'$or':_[_0xf4a8('0x2c')](_0x3e086f,function(_0x1db30b){if(_0x1db30b[_0xf4a8('0x2f')]!=='VIRTUAL'){var _0x39e795={};_0x39e795[_0x1db30b[_0xf4a8('0x2b')]]={'$like':'%'+_0x538a23[_0xf4a8('0x33')][_0xf4a8('0x3b')]+'%'};return _0x39e795;}})});}_0x269ac9=_[_0xf4a8('0x3c')]({},_0x269ac9,_0x538a23[_0xf4a8('0x3d')]);var _0x139fa5={'where':_0x269ac9[_0xf4a8('0x3a')]};return db[_0xf4a8('0x2d')][_0xf4a8('0x1f')](_0x139fa5)['then'](function(_0x301b41){_0x249b29[_0xf4a8('0x1f')]=_0x301b41;if(_0x538a23[_0xf4a8('0x33')]['includeAll']){_0x269ac9[_0xf4a8('0x3e')]=[{'all':!![]}];}return db[_0xf4a8('0x2d')][_0xf4a8('0x3f')](_0x269ac9);})[_0xf4a8('0x27')](function(_0x4833f4){_0x249b29['rows']=_0x4833f4;return _0x249b29;})[_0xf4a8('0x27')](respondWithFilteredResult(_0x24eca1,_0x269ac9))[_0xf4a8('0x40')](handleError(_0x24eca1,null));};exports['show']=function(_0x64ad98,_0x2ba322){var _0x50fa9c={'raw':![],'where':{'id':_0x64ad98[_0xf4a8('0x41')]['id']}},_0x1216d2={};_0x1216d2[_0xf4a8('0x31')]=_[_0xf4a8('0x32')](db['SalesforceAccount'][_0xf4a8('0x2e')]);_0x1216d2[_0xf4a8('0x33')]=_[_0xf4a8('0x32')](_0x64ad98[_0xf4a8('0x33')]);_0x1216d2['filters']=_['intersection'](_0x1216d2[_0xf4a8('0x31')],_0x1216d2[_0xf4a8('0x33')]);_0x50fa9c['attributes']=_[_0xf4a8('0x35')](_0x1216d2[_0xf4a8('0x31')],qs[_0xf4a8('0x37')](_0x64ad98['query'][_0xf4a8('0x37')]));_0x50fa9c[_0xf4a8('0x36')]=_0x50fa9c[_0xf4a8('0x36')][_0xf4a8('0x38')]?_0x50fa9c[_0xf4a8('0x36')]:_0x1216d2[_0xf4a8('0x31')];if(_0x64ad98[_0xf4a8('0x33')][_0xf4a8('0x42')]){_0x50fa9c[_0xf4a8('0x3e')]=[{'all':!![]}];}_0x50fa9c=_['merge']({},_0x50fa9c,_0x64ad98[_0xf4a8('0x3d')]);return db['SalesforceAccount'][_0xf4a8('0x43')](_0x50fa9c)[_0xf4a8('0x27')](handleEntityNotFound(_0x2ba322,null))['then'](respondWithResult(_0x2ba322,null))[_0xf4a8('0x40')](handleError(_0x2ba322,null));};exports[_0xf4a8('0x44')]=function(_0x59a78f,_0x311a81){return db[_0xf4a8('0x2d')][_0xf4a8('0x44')](_0x59a78f[_0xf4a8('0x45')],{})[_0xf4a8('0x27')](respondWithResult(_0x311a81,0xc9))['catch'](handleError(_0x311a81,null));};exports[_0xf4a8('0x26')]=function(_0x24ad68,_0x4318a0){if(_0x24ad68[_0xf4a8('0x45')]['id']){delete _0x24ad68[_0xf4a8('0x45')]['id'];}return db[_0xf4a8('0x2d')]['find']({'where':{'id':_0x24ad68[_0xf4a8('0x41')]['id']}})['then'](handleEntityNotFound(_0x4318a0,null))[_0xf4a8('0x27')](saveUpdates(_0x24ad68[_0xf4a8('0x45')],null))[_0xf4a8('0x27')](respondWithResult(_0x4318a0,null))[_0xf4a8('0x40')](handleError(_0x4318a0,null));};exports[_0xf4a8('0x28')]=function(_0xe2b166,_0x583b85){return db[_0xf4a8('0x2d')][_0xf4a8('0x43')]({'where':{'id':_0xe2b166[_0xf4a8('0x41')]['id']}})['then'](handleEntityNotFound(_0x583b85,null))['then'](removeEntity(_0x583b85,null))[_0xf4a8('0x40')](handleError(_0x583b85,null));};exports['getConfigurations']=function(_0x105ee3,_0x27c0c5,_0x46c864){var _0xd1f9d0={};var _0x395f4a={};var _0x54c7ca;var _0x2a3931;return db[_0xf4a8('0x2d')]['findOne']({'where':{'id':_0x105ee3[_0xf4a8('0x41')]['id']}})[_0xf4a8('0x27')](handleEntityNotFound(_0x27c0c5,null))['then'](function(_0x4c69f6){if(_0x4c69f6){_0x54c7ca=_0x4c69f6;_0x395f4a[_0xf4a8('0x31')]=_[_0xf4a8('0x32')](db[_0xf4a8('0x46')][_0xf4a8('0x2e')]);_0x395f4a[_0xf4a8('0x33')]=_[_0xf4a8('0x32')](_0x105ee3[_0xf4a8('0x33')]);_0x395f4a[_0xf4a8('0x34')]=_[_0xf4a8('0x35')](_0x395f4a['model'],_0x395f4a[_0xf4a8('0x33')]);_0xd1f9d0[_0xf4a8('0x36')]=_[_0xf4a8('0x35')](_0x395f4a[_0xf4a8('0x31')],qs[_0xf4a8('0x37')](_0x105ee3['query'][_0xf4a8('0x37')]));_0xd1f9d0['attributes']=_0xd1f9d0[_0xf4a8('0x36')][_0xf4a8('0x38')]?_0xd1f9d0[_0xf4a8('0x36')]:_0x395f4a[_0xf4a8('0x31')];_0xd1f9d0[_0xf4a8('0x47')]=qs[_0xf4a8('0x39')](_0x105ee3[_0xf4a8('0x33')][_0xf4a8('0x39')]);_0xd1f9d0['where']=qs[_0xf4a8('0x34')](_[_0xf4a8('0x48')](_0x105ee3[_0xf4a8('0x33')],_0x395f4a[_0xf4a8('0x34')]));if(_0x105ee3[_0xf4a8('0x33')]['filter']){_0xd1f9d0[_0xf4a8('0x3a')]=_[_0xf4a8('0x3c')](_0xd1f9d0['where'],{'$or':_[_0xf4a8('0x2c')](_0xd1f9d0['attributes'],function(_0xa26910){var _0x397f9f={};_0x397f9f[_0xa26910]={'$like':'%'+_0x105ee3['query'][_0xf4a8('0x3b')]+'%'};return _0x397f9f;})});}_0xd1f9d0=_['merge']({},_0xd1f9d0,_0x105ee3[_0xf4a8('0x3d')]);return _0x54c7ca['getConfigurations'](_0xd1f9d0);}})[_0xf4a8('0x27')](function(_0x1c3636){if(_0x1c3636){_0x2a3931=_0x1c3636['length'];if(!_0x105ee3[_0xf4a8('0x33')][_0xf4a8('0x49')](_0xf4a8('0x4a'))){_0xd1f9d0['limit']=qs['limit'](_0x105ee3[_0xf4a8('0x33')][_0xf4a8('0x20')]);_0xd1f9d0[_0xf4a8('0x1d')]=qs[_0xf4a8('0x1d')](_0x105ee3[_0xf4a8('0x33')][_0xf4a8('0x1d')]);}return _0x54c7ca['getConfigurations'](_0xd1f9d0);}})['then'](function(_0x6c29b5){if(_0x6c29b5){return _0x6c29b5?{'count':_0x2a3931,'rows':_0x6c29b5}:null;}})['then'](respondWithResult(_0x27c0c5,null))[_0xf4a8('0x40')](handleError(_0x27c0c5,null));};exports[_0xf4a8('0x4b')]=function(_0x34c5ff,_0xbe1d04,_0x17113b){if(_0x34c5ff['body']['id']){delete _0x34c5ff[_0xf4a8('0x45')]['id'];}return db[_0xf4a8('0x2d')][_0xf4a8('0x4c')]({'where':{'id':_0x34c5ff[_0xf4a8('0x41')]['id']}})['then'](handleEntityNotFound(_0xbe1d04,null))[_0xf4a8('0x27')](function(_0x345aed){if(_0x345aed){_0x34c5ff[_0xf4a8('0x45')][_0xf4a8('0x4d')]=_0x345aed['id'];_0x34c5ff[_0xf4a8('0x45')]['Subjects']=integrations[_0xf4a8('0x4e')](_0x34c5ff[_0xf4a8('0x45')][_0xf4a8('0x4f')],_0x34c5ff[_0xf4a8('0x45')][_0xf4a8('0x2f')]);_0x34c5ff['body']['Descriptions']=integrations[_0xf4a8('0x50')](_0x34c5ff['body'][_0xf4a8('0x4f')],_0x34c5ff[_0xf4a8('0x45')][_0xf4a8('0x2f')]);return db[_0xf4a8('0x46')][_0xf4a8('0x44')](_0x34c5ff[_0xf4a8('0x45')],{'include':[{'model':db[_0xf4a8('0x51')],'as':_0xf4a8('0x52')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xbe1d04,null))[_0xf4a8('0x40')](handleError(_0xbe1d04,null));};exports[_0xf4a8('0x53')]=function(_0x312cbf,_0x3122cd,_0x31d12c){var _0x17ea35;var _0x5e0229='';var _0x3d0caa=_0xf4a8('0x54');return db[_0xf4a8('0x2d')][_0xf4a8('0x4c')]({'where':{'id':_0x312cbf[_0xf4a8('0x41')]['id']},'attributes':['id','remoteUri',_0xf4a8('0x55'),_0xf4a8('0x56'),_0xf4a8('0x57'),_0xf4a8('0x58'),'securityToken']})[_0xf4a8('0x27')](handleEntityNotFound(_0x3122cd,null))[_0xf4a8('0x27')](function(_0x345fdf){if(_0x345fdf){_0x5e0229=_0x345fdf[_0xf4a8('0x59')];var _0x19683e=_0x5e0229[_0xf4a8('0x5a')](-0x1);if(_0x19683e==='/'){_0x5e0229=_0x5e0229[_0xf4a8('0x5b')](0x0,_0x5e0229[_0xf4a8('0x5c')](_0x19683e));}_0x17ea35=new jsforce[(_0xf4a8('0x5d'))]({'oauth2':{'loginUrl':_0x5e0229,'clientId':_0x345fdf['clientId'],'clientSecret':_0x345fdf[_0xf4a8('0x56')]}});return _0x17ea35[_0xf4a8('0x5e')](_0x345fdf[_0xf4a8('0x57')],_0x345fdf[_0xf4a8('0x58')][_0xf4a8('0x5f')](_0x345fdf[_0xf4a8('0x60')]));}})['then'](function(_0x4cfaff){if(_0x4cfaff){if(!_[_0xf4a8('0x61')](_0x312cbf[_0xf4a8('0x33')][_0xf4a8('0x62')])){_0x3d0caa=_0x312cbf['query'][_0xf4a8('0x62')];}return _0x17ea35[_0xf4a8('0x63')](_0x3d0caa)[_0xf4a8('0x64')]();}})['then'](function(_0x19098f){var _0x58c6e8=['OwnerId',_0xf4a8('0x65'),'IsReminderSet',_0xf4a8('0x66'),_0xf4a8('0x67'),_0xf4a8('0x68')];var _0x2a8491=['string',_0xf4a8('0x69'),'picklist','boolean',_0xf4a8('0x6a'),_0xf4a8('0x6b'),_0xf4a8('0x6c')];if(_0x19098f){_[_0xf4a8('0x6d')](_0x19098f['fields'],function(_0x2f0f53){return _0x58c6e8[_0xf4a8('0x6e')](_0x2f0f53[_0xf4a8('0x2b')])||!_0x2a8491[_0xf4a8('0x6e')](_0x2f0f53[_0xf4a8('0x2f')]);});return{'count':_0x19098f[_0xf4a8('0x37')][_0xf4a8('0x38')],'rows':_[_0xf4a8('0x2c')](_0x19098f['fields'],function(_0x3877a5){return{'id':_0x3877a5[_0xf4a8('0x2b')],'name':_0x3877a5[_0xf4a8('0x6f')],'custom':_0x3877a5[_0xf4a8('0x70')],'options':_0x3877a5[_0xf4a8('0x71')][_0xf4a8('0x38')]>0x0?_[_0xf4a8('0x2c')](_0x3877a5[_0xf4a8('0x71')],function(_0xb771ed){return{'name':_0xb771ed['label'],'value':_0xb771ed[_0xf4a8('0x72')]};}):_0x3877a5[_0xf4a8('0x2f')]==_0xf4a8('0x73')?[{'name':_0xf4a8('0x74'),'value':_0xf4a8('0x75')},{'name':'False','value':_0xf4a8('0x76')}]:[]};})};}})[_0xf4a8('0x27')](respondWithResult(_0x3122cd,null))[_0xf4a8('0x40')](function(_0x1a1a8e){var _0x3b04c9=_0x312cbf[_0xf4a8('0x33')][_0xf4a8('0x77')]?0x1f4:_0x1a1a8e[_0xf4a8('0x78')]||0x1f4;logger['error'](_0xf4a8('0x79'),_0xf4a8('0x53'),_0x3b04c9,JSON['stringify'](_0x1a1a8e));delete _0x1a1a8e[_0xf4a8('0x2b')];if(_0x3b04c9===0x191){_0x3b04c9=0x190;}_0x3122cd[_0xf4a8('0x1b')](_0x3b04c9)['send'](_0x312cbf['query'][_0xf4a8('0x77')]?{'message':_0xf4a8('0x7a'),'statusCode':_0x1a1a8e[_0xf4a8('0x78')]}:_0x1a1a8e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index ff4b680..c10526c 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 _0xa120=['moment','bluebird','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xa120,0xf4));var _0x0a12=function(_0x3ce28f,_0x2fa119){_0x3ce28f=_0x3ce28f-0x0;var _0x2edaba=_0xa120[_0x3ce28f];return _0x2edaba;};'use strict';var _=require(_0x0a12('0x0'));var util=require(_0x0a12('0x1'));var logger=require('../../config/logger')(_0x0a12('0x2'));var moment=require(_0x0a12('0x3'));var BPromise=require(_0x0a12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a12('0x5'));var config=require(_0x0a12('0x6'));var attributes=require(_0x0a12('0x7'));var integrations=require(_0x0a12('0x8'));module[_0x0a12('0x9')]=function(_0x2ea526,_0x4578bb){return _0x2ea526[_0x0a12('0xa')](_0x0a12('0xb'),attributes,{'tableName':_0x0a12('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03da=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x36496e,_0x281771){var _0x4ee2d9=function(_0x1d0846){while(--_0x1d0846){_0x36496e['push'](_0x36496e['shift']());}};_0x4ee2d9(++_0x281771);}(_0x03da,0xec));var _0xa03d=function(_0x5767d1,_0x20323b){_0x5767d1=_0x5767d1-0x0;var _0x37b060=_0x03da[_0x5767d1];return _0x37b060;};'use strict';var _=require(_0xa03d('0x0'));var util=require(_0xa03d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa03d('0x2'));var BPromise=require(_0xa03d('0x3'));var rp=require(_0xa03d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa03d('0x5'));var config=require(_0xa03d('0x6'));var attributes=require(_0xa03d('0x7'));var integrations=require(_0xa03d('0x8'));module['exports']=function(_0x5e8c6c,_0x54d5d9){return _0x5e8c6c['define'](_0xa03d('0x9'),attributes,{'tableName':_0xa03d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 4e4df02..2140282 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 _0x1560=['include','attributes','model','map','GetSalesforceAccount','catch','ShowSalesforceAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','SalesforceAccount','options','raw','limit'];(function(_0x277419,_0x1fa65f){var _0xb000df=function(_0x2193df){while(--_0x2193df){_0x277419['push'](_0x277419['shift']());}};_0xb000df(++_0x1fa65f);}(_0x1560,0x1d0));var _0x0156=function(_0x4c0170,_0x2df546){_0x4c0170=_0x4c0170-0x0;var _0x422127=_0x1560[_0x4c0170];return _0x422127;};'use strict';var _=require(_0x0156('0x0'));var util=require(_0x0156('0x1'));var moment=require(_0x0156('0x2'));var BPromise=require(_0x0156('0x3'));var rs=require(_0x0156('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0156('0x5'))['db'];var utils=require(_0x0156('0x6'));var logger=require(_0x0156('0x7'))(_0x0156('0x8'));var config=require(_0x0156('0x9'));var jayson=require(_0x0156('0xa'));var client=jayson[_0x0156('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521f1a,_0x5ca561,_0x12ffdb){return new BPromise(function(_0x296e4a,_0x4ba8a9){return client[_0x0156('0xc')](_0x521f1a,_0x12ffdb)[_0x0156('0xd')](function(_0x1c3271){logger[_0x0156('0xe')](_0x0156('0xf'),_0x5ca561,_0x0156('0x10'));logger[_0x0156('0x11')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x5ca561,_0x0156('0x10'),JSON[_0x0156('0x12')](_0x1c3271));if(_0x1c3271[_0x0156('0x13')]){if(_0x1c3271[_0x0156('0x13')][_0x0156('0x14')]===0x1f4){logger[_0x0156('0x13')](_0x0156('0xf'),_0x5ca561,_0x1c3271[_0x0156('0x13')][_0x0156('0x15')]);return _0x4ba8a9(_0x1c3271[_0x0156('0x13')]['message']);}logger['error'](_0x0156('0xf'),_0x5ca561,_0x1c3271[_0x0156('0x13')][_0x0156('0x15')]);return _0x296e4a(_0x1c3271[_0x0156('0x13')][_0x0156('0x15')]);}else{logger[_0x0156('0xe')](_0x0156('0xf'),_0x5ca561,'request\x20sent');_0x296e4a(_0x1c3271['result'][_0x0156('0x15')]);}})['catch'](function(_0x5d0420){logger[_0x0156('0x13')](_0x0156('0xf'),_0x5ca561,_0x5d0420);_0x4ba8a9(_0x5d0420);});});}exports['GetSalesforceAccount']=function(_0x55ffbc){var _0x28984b=this;return new Promise(function(_0x4b47ad,_0x2ace00){return db[_0x0156('0x16')]['findAll']({'raw':_0x55ffbc[_0x0156('0x17')]?_0x55ffbc['options'][_0x0156('0x18')]===undefined?!![]:![]:!![],'where':_0x55ffbc[_0x0156('0x17')]?_0x55ffbc[_0x0156('0x17')]['where']||null:null,'attributes':_0x55ffbc[_0x0156('0x17')]?_0x55ffbc['options']['attributes']||null:null,'limit':_0x55ffbc[_0x0156('0x17')]?_0x55ffbc[_0x0156('0x17')][_0x0156('0x19')]||null:null,'include':_0x55ffbc['options']?_0x55ffbc[_0x0156('0x17')][_0x0156('0x1a')]?_['map'](_0x55ffbc[_0x0156('0x17')][_0x0156('0x1a')],function(_0x59190a){return{'model':db[_0x59190a['model']],'as':_0x59190a['as'],'attributes':_0x59190a[_0x0156('0x1b')],'include':_0x59190a[_0x0156('0x1a')]?_['map'](_0x59190a['include'],function(_0x5a978b){return{'model':db[_0x5a978b[_0x0156('0x1c')]],'as':_0x5a978b['as'],'attributes':_0x5a978b[_0x0156('0x1b')],'include':_0x5a978b[_0x0156('0x1a')]?_[_0x0156('0x1d')](_0x5a978b[_0x0156('0x1a')],function(_0x14a877){return{'model':db[_0x14a877['model']],'as':_0x14a877['as'],'attributes':_0x14a877['attributes']};}):[]};}):[]};}):[]:[]})[_0x0156('0xd')](function(_0x2548f6){logger[_0x0156('0xe')](_0x0156('0x1e'),_0x55ffbc);logger['debug'](_0x0156('0x1e'),_0x55ffbc,JSON[_0x0156('0x12')](_0x2548f6));_0x4b47ad(_0x2548f6);})[_0x0156('0x1f')](function(_0xce711c){logger[_0x0156('0x13')](_0x0156('0x1e'),_0xce711c[_0x0156('0x15')],_0x55ffbc);_0x2ace00(_0x28984b['error'](0x1f4,_0xce711c[_0x0156('0x15')]));});});};exports[_0x0156('0x20')]=function(_0x5454f1){var _0x495ac9=this;return new Promise(function(_0x2a5036,_0x1df088){return db[_0x0156('0x16')][_0x0156('0x21')]({'raw':_0x5454f1['options']?_0x5454f1[_0x0156('0x17')][_0x0156('0x18')]===undefined?!![]:![]:!![],'where':_0x5454f1[_0x0156('0x17')]?_0x5454f1[_0x0156('0x17')][_0x0156('0x22')]||null:null,'attributes':_0x5454f1[_0x0156('0x17')]?_0x5454f1[_0x0156('0x17')][_0x0156('0x1b')]||null:null,'include':_0x5454f1[_0x0156('0x17')]?_0x5454f1['options'][_0x0156('0x1a')]?_[_0x0156('0x1d')](_0x5454f1[_0x0156('0x17')][_0x0156('0x1a')],function(_0x38760a){return{'model':db[_0x38760a[_0x0156('0x1c')]],'as':_0x38760a['as'],'attributes':_0x38760a[_0x0156('0x1b')],'include':_0x38760a[_0x0156('0x1a')]?_[_0x0156('0x1d')](_0x38760a[_0x0156('0x1a')],function(_0x11f356){return{'model':db[_0x11f356[_0x0156('0x1c')]],'as':_0x11f356['as'],'attributes':_0x11f356[_0x0156('0x1b')],'include':_0x11f356[_0x0156('0x1a')]?_[_0x0156('0x1d')](_0x11f356[_0x0156('0x1a')],function(_0x45f1a2){return{'model':db[_0x45f1a2[_0x0156('0x1c')]],'as':_0x45f1a2['as'],'attributes':_0x45f1a2[_0x0156('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x130a16){logger['info'](_0x0156('0x20'),_0x5454f1);logger[_0x0156('0x11')]('ShowSalesforceAccount',_0x5454f1,JSON[_0x0156('0x12')](_0x130a16));_0x2a5036(_0x130a16);})[_0x0156('0x1f')](function(_0x5e326d){logger[_0x0156('0x13')](_0x0156('0x20'),_0x5e326d[_0x0156('0x15')],_0x5454f1);_0x1df088(_0x495ac9[_0x0156('0x13')](0x1f4,_0x5e326d[_0x0156('0x15')]));});});}; \ No newline at end of file +var _0x1e33=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','map','model','include','attributes','then','catch','ShowSalesforceAccount','find','raw'];(function(_0x39eee1,_0x2655d0){var _0xbcf378=function(_0x3e6bd7){while(--_0x3e6bd7){_0x39eee1['push'](_0x39eee1['shift']());}};_0xbcf378(++_0x2655d0);}(_0x1e33,0x8c));var _0x31e3=function(_0x43badd,_0xd74a8b){_0x43badd=_0x43badd-0x0;var _0x42768c=_0x1e33[_0x43badd];return _0x42768c;};'use strict';var _=require('lodash');var util=require(_0x31e3('0x0'));var moment=require(_0x31e3('0x1'));var BPromise=require(_0x31e3('0x2'));var rs=require(_0x31e3('0x3'));var fs=require('fs');var Redis=require(_0x31e3('0x4'));var db=require(_0x31e3('0x5'))['db'];var utils=require(_0x31e3('0x6'));var logger=require('../../config/logger')(_0x31e3('0x7'));var config=require(_0x31e3('0x8'));var jayson=require(_0x31e3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a835,_0x3e9810,_0xd4e6c1){return new BPromise(function(_0x90a252,_0x506522){return client[_0x31e3('0xa')](_0x23a835,_0xd4e6c1)['then'](function(_0x87c47a){logger[_0x31e3('0xb')](_0x31e3('0xc'),_0x3e9810,_0x31e3('0xd'));logger[_0x31e3('0xe')](_0x31e3('0xf'),_0x3e9810,_0x31e3('0xd'),JSON[_0x31e3('0x10')](_0x87c47a));if(_0x87c47a[_0x31e3('0x11')]){if(_0x87c47a[_0x31e3('0x11')]['code']===0x1f4){logger[_0x31e3('0x11')](_0x31e3('0xc'),_0x3e9810,_0x87c47a[_0x31e3('0x11')][_0x31e3('0x12')]);return _0x506522(_0x87c47a[_0x31e3('0x11')][_0x31e3('0x12')]);}logger[_0x31e3('0x11')](_0x31e3('0xc'),_0x3e9810,_0x87c47a[_0x31e3('0x11')][_0x31e3('0x12')]);return _0x90a252(_0x87c47a[_0x31e3('0x11')][_0x31e3('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x3e9810,_0x31e3('0xd'));_0x90a252(_0x87c47a[_0x31e3('0x13')][_0x31e3('0x12')]);}})['catch'](function(_0x331f70){logger[_0x31e3('0x11')](_0x31e3('0xc'),_0x3e9810,_0x331f70);_0x506522(_0x331f70);});});}exports[_0x31e3('0x14')]=function(_0x268ebd){var _0x1203ed=this;return new Promise(function(_0x5cf471,_0x23c3dd){return db[_0x31e3('0x15')][_0x31e3('0x16')]({'raw':_0x268ebd['options']?_0x268ebd[_0x31e3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x268ebd['options']?_0x268ebd[_0x31e3('0x17')][_0x31e3('0x18')]||null:null,'attributes':_0x268ebd['options']?_0x268ebd[_0x31e3('0x17')]['attributes']||null:null,'limit':_0x268ebd['options']?_0x268ebd[_0x31e3('0x17')][_0x31e3('0x19')]||null:null,'include':_0x268ebd['options']?_0x268ebd[_0x31e3('0x17')]['include']?_[_0x31e3('0x1a')](_0x268ebd['options']['include'],function(_0x4a3688){return{'model':db[_0x4a3688[_0x31e3('0x1b')]],'as':_0x4a3688['as'],'attributes':_0x4a3688['attributes'],'include':_0x4a3688[_0x31e3('0x1c')]?_[_0x31e3('0x1a')](_0x4a3688[_0x31e3('0x1c')],function(_0x1eb934){return{'model':db[_0x1eb934[_0x31e3('0x1b')]],'as':_0x1eb934['as'],'attributes':_0x1eb934[_0x31e3('0x1d')],'include':_0x1eb934['include']?_[_0x31e3('0x1a')](_0x1eb934['include'],function(_0x359dca){return{'model':db[_0x359dca[_0x31e3('0x1b')]],'as':_0x359dca['as'],'attributes':_0x359dca[_0x31e3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x31e3('0x1e')](function(_0x257761){logger[_0x31e3('0xb')]('GetSalesforceAccount',_0x268ebd);logger[_0x31e3('0xe')](_0x31e3('0x14'),_0x268ebd,JSON[_0x31e3('0x10')](_0x257761));_0x5cf471(_0x257761);})[_0x31e3('0x1f')](function(_0x1660d8){logger[_0x31e3('0x11')](_0x31e3('0x14'),_0x1660d8[_0x31e3('0x12')],_0x268ebd);_0x23c3dd(_0x1203ed[_0x31e3('0x11')](0x1f4,_0x1660d8[_0x31e3('0x12')]));});});};exports[_0x31e3('0x20')]=function(_0x4d7dda){var _0x50aae7=this;return new Promise(function(_0x2fbf9f,_0x97c854){return db[_0x31e3('0x15')][_0x31e3('0x21')]({'raw':_0x4d7dda[_0x31e3('0x17')]?_0x4d7dda[_0x31e3('0x17')][_0x31e3('0x22')]===undefined?!![]:![]:!![],'where':_0x4d7dda['options']?_0x4d7dda[_0x31e3('0x17')][_0x31e3('0x18')]||null:null,'attributes':_0x4d7dda['options']?_0x4d7dda['options'][_0x31e3('0x1d')]||null:null,'include':_0x4d7dda[_0x31e3('0x17')]?_0x4d7dda['options'][_0x31e3('0x1c')]?_[_0x31e3('0x1a')](_0x4d7dda[_0x31e3('0x17')][_0x31e3('0x1c')],function(_0x504a34){return{'model':db[_0x504a34['model']],'as':_0x504a34['as'],'attributes':_0x504a34[_0x31e3('0x1d')],'include':_0x504a34['include']?_[_0x31e3('0x1a')](_0x504a34[_0x31e3('0x1c')],function(_0x3920ec){return{'model':db[_0x3920ec[_0x31e3('0x1b')]],'as':_0x3920ec['as'],'attributes':_0x3920ec['attributes'],'include':_0x3920ec[_0x31e3('0x1c')]?_[_0x31e3('0x1a')](_0x3920ec['include'],function(_0x451b1a){return{'model':db[_0x451b1a[_0x31e3('0x1b')]],'as':_0x451b1a['as'],'attributes':_0x451b1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x31e3('0x1e')](function(_0x4e5a6e){logger['info'](_0x31e3('0x20'),_0x4d7dda);logger[_0x31e3('0xe')]('ShowSalesforceAccount',_0x4d7dda,JSON['stringify'](_0x4e5a6e));_0x2fbf9f(_0x4e5a6e);})[_0x31e3('0x1f')](function(_0x3aa7a2){logger[_0x31e3('0x11')](_0x31e3('0x20'),_0x3aa7a2[_0x31e3('0x12')],_0x4d7dda);_0x97c854(_0x50aae7[_0x31e3('0x11')](0x1f4,_0x3aa7a2[_0x31e3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 8c702a3..65e4e4f 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xdb28,0x106));var _0x8db2=function(_0x7bad1a,_0x1a0057){_0x7bad1a=_0x7bad1a-0x0;var _0x59f0bc=_0xdb28[_0x7bad1a];return _0x59f0bc;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x411483,_0xf46678){var _0xbc40b5=function(_0x2eca8a){while(--_0x2eca8a){_0x411483['push'](_0x411483['shift']());}};_0xbc40b5(++_0xf46678);}(_0x2ef3,0xba));var _0x32ef=function(_0x1216d8,_0x14054c){_0x1216d8=_0x1216d8-0x0;var _0x25eb70=_0x2ef3[_0x1216d8];return _0x25eb70;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('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 eb74e11..8e80601 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 _0xa0f2=['nothing','contact','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0f2,0x19a));var _0x2a0f=function(_0x3db140,_0x88e7d0){_0x3db140=_0x3db140-0x0;var _0x5c88cf=_0xa0f2[_0x3db140];return _0x5c88cf;};'use strict';var Sequelize=require(_0x2a0f('0x0'));module[_0x2a0f('0x1')]={'name':{'type':Sequelize[_0x2a0f('0x2')]},'description':{'type':Sequelize[_0x2a0f('0x2')]},'ticketType':{'type':Sequelize[_0x2a0f('0x3')](_0x2a0f('0x4'),_0x2a0f('0x5')),'defaultValue':_0x2a0f('0x4')},'moduleSearch':{'type':Sequelize[_0x2a0f('0x3')](_0x2a0f('0x6'),'contact',_0x2a0f('0x7'),_0x2a0f('0x8'),_0x2a0f('0x9')),'defaultValue':_0x2a0f('0x6')},'moduleCreate':{'type':Sequelize[_0x2a0f('0x3')](_0x2a0f('0xa'),_0x2a0f('0xb'),_0x2a0f('0x7'),_0x2a0f('0x9')),'defaultValue':_0x2a0f('0x7')},'leadId':{'type':Sequelize[_0x2a0f('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x2a0f('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x2a0f('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x2a0f('0x2')]}}; \ No newline at end of file +var _0xa1ec=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports'];(function(_0x136493,_0x1c2dd5){var _0x15b7e7=function(_0x578400){while(--_0x578400){_0x136493['push'](_0x136493['shift']());}};_0x15b7e7(++_0x1c2dd5);}(_0xa1ec,0x8e));var _0xca1e=function(_0x2decf6,_0xadc4f5){_0x2decf6=_0x2decf6-0x0;var _0x42f390=_0xa1ec[_0x2decf6];return _0x42f390;};'use strict';var Sequelize=require(_0xca1e('0x0'));module[_0xca1e('0x1')]={'name':{'type':Sequelize[_0xca1e('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xca1e('0x3')](_0xca1e('0x4'),_0xca1e('0x5')),'defaultValue':_0xca1e('0x4')},'moduleSearch':{'type':Sequelize[_0xca1e('0x3')](_0xca1e('0x6'),_0xca1e('0x7'),_0xca1e('0x8'),_0xca1e('0x9'),_0xca1e('0xa')),'defaultValue':_0xca1e('0x6')},'moduleCreate':{'type':Sequelize[_0xca1e('0x3')](_0xca1e('0xb'),_0xca1e('0x7'),_0xca1e('0x8'),_0xca1e('0xa')),'defaultValue':_0xca1e('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xca1e('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xca1e('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xca1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 1e07913..a8366b5 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 _0xd29c=['send','index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name'];(function(_0xc23088,_0x25ad80){var _0xeadd3f=function(_0x13a429){while(--_0x13a429){_0xc23088['push'](_0xc23088['shift']());}};_0xeadd3f(++_0x25ad80);}(_0xd29c,0xc9));var _0xcd29=function(_0x407be8,_0x1cba5b){_0x407be8=_0x407be8-0x0;var _0x2643bb=_0xd29c[_0x407be8];return _0x2643bb;};'use strict';var emlformat=require(_0xcd29('0x0'));var rimraf=require(_0xcd29('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd29('0x2'));var rp=require(_0xcd29('0x3'));var moment=require(_0xcd29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd29('0x5'));var util=require(_0xcd29('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcd29('0x7'));var ejs=require(_0xcd29('0x8'));var fs=require('fs');var fs_extra=require(_0xcd29('0x9'));var _=require(_0xcd29('0xa'));var squel=require(_0xcd29('0xb'));var crypto=require(_0xcd29('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcd29('0xd'));var toCsv=require(_0xcd29('0x7'));var querystring=require(_0xcd29('0xe'));var Papa=require('papaparse');var Redis=require(_0xcd29('0xf'));var authService=require(_0xcd29('0x10'));var qs=require(_0xcd29('0x11'));var as=require(_0xcd29('0x12'));var hardwareService=require(_0xcd29('0x13'));var logger=require('../../config/logger')(_0xcd29('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcd29('0x15'))['db'];function respondWithStatusCode(_0x1a4293,_0x5cd361){_0x5cd361=_0x5cd361||0xcc;return function(_0x3cbd78){if(_0x3cbd78){return _0x1a4293['sendStatus'](_0x5cd361);}return _0x1a4293[_0xcd29('0x16')](_0x5cd361)[_0xcd29('0x17')]();};}function respondWithResult(_0x220f50,_0x22fa17){_0x22fa17=_0x22fa17||0xc8;return function(_0x44f8ee){if(_0x44f8ee){return _0x220f50[_0xcd29('0x16')](_0x22fa17)[_0xcd29('0x18')](_0x44f8ee);}};}function respondWithFilteredResult(_0x1651a4,_0x1dcde7){return function(_0x231e71){if(_0x231e71){var _0x18049f=typeof _0x1dcde7['offset']===_0xcd29('0x19')&&typeof _0x1dcde7[_0xcd29('0x1a')]===_0xcd29('0x19');var _0x343e84=_0x231e71[_0xcd29('0x1b')];var _0x11f13d=_0x18049f?0x0:_0x1dcde7[_0xcd29('0x1c')];var _0x3458d8=_0x18049f?_0x231e71['count']:_0x1dcde7[_0xcd29('0x1c')]+_0x1dcde7[_0xcd29('0x1a')];var _0x185fcb;if(_0x3458d8>=_0x343e84){_0x3458d8=_0x343e84;_0x185fcb=0xc8;}else{_0x185fcb=0xce;}_0x1651a4[_0xcd29('0x16')](_0x185fcb);return _0x1651a4[_0xcd29('0x1d')](_0xcd29('0x1e'),_0x11f13d+'-'+_0x3458d8+'/'+_0x343e84)['json'](_0x231e71);}return null;};}function patchUpdates(_0x2068d8){return function(_0x4cf1cd){try{jsonpatch[_0xcd29('0x1f')](_0x4cf1cd,_0x2068d8,!![]);}catch(_0x5f488f){return BPromise['reject'](_0x5f488f);}return _0x4cf1cd['save']();};}function saveUpdates(_0x3e8bea,_0x36031d){return function(_0x1a3ff9){if(_0x1a3ff9){return _0x1a3ff9[_0xcd29('0x20')](_0x3e8bea)['then'](function(_0x214948){return _0x214948;});}return null;};}function removeEntity(_0x4a911e,_0x3397e1){return function(_0x250ffd){if(_0x250ffd){return _0x250ffd[_0xcd29('0x21')]()[_0xcd29('0x22')](function(){_0x4a911e['status'](0xcc)[_0xcd29('0x17')]();});}};}function handleEntityNotFound(_0x54b2e1,_0x5c9fd6){return function(_0x3b5bb4){if(!_0x3b5bb4){_0x54b2e1[_0xcd29('0x23')](0x194);}return _0x3b5bb4;};}function handleError(_0x37b244,_0x1869b8){_0x1869b8=_0x1869b8||0x1f4;return function(_0x3c2a93){logger[_0xcd29('0x24')](_0x3c2a93[_0xcd29('0x25')]);if(_0x3c2a93[_0xcd29('0x26')]){delete _0x3c2a93[_0xcd29('0x26')];}_0x37b244[_0xcd29('0x16')](_0x1869b8)[_0xcd29('0x27')](_0x3c2a93);};}exports[_0xcd29('0x28')]=function(_0x5e4269,_0x592f44){var _0x1117c4={},_0x352e2f={},_0x59a30a={'count':0x0,'rows':[]};var _0x183ab2=_['map'](db['SalesforceConfiguration'][_0xcd29('0x29')],function(_0xae6fa2){return{'name':_0xae6fa2[_0xcd29('0x2a')],'type':_0xae6fa2['type'][_0xcd29('0x2b')]};});_0x352e2f[_0xcd29('0x2c')]=_['map'](_0x183ab2,'name');_0x352e2f[_0xcd29('0x2d')]=_[_0xcd29('0x2e')](_0x5e4269[_0xcd29('0x2d')]);_0x352e2f['filters']=_[_0xcd29('0x2f')](_0x352e2f['model'],_0x352e2f['query']);_0x1117c4[_0xcd29('0x30')]=_['intersection'](_0x352e2f[_0xcd29('0x2c')],qs[_0xcd29('0x31')](_0x5e4269['query'][_0xcd29('0x31')]));_0x1117c4[_0xcd29('0x30')]=_0x1117c4[_0xcd29('0x30')][_0xcd29('0x32')]?_0x1117c4[_0xcd29('0x30')]:_0x352e2f['model'];if(!_0x5e4269['query']['hasOwnProperty'](_0xcd29('0x33'))){_0x1117c4[_0xcd29('0x1a')]=qs[_0xcd29('0x1a')](_0x5e4269[_0xcd29('0x2d')]['limit']);_0x1117c4['offset']=qs['offset'](_0x5e4269[_0xcd29('0x2d')][_0xcd29('0x1c')]);}_0x1117c4['order']=qs[_0xcd29('0x34')](_0x5e4269[_0xcd29('0x2d')]['sort']);_0x1117c4['where']=qs[_0xcd29('0x35')](_[_0xcd29('0x36')](_0x5e4269[_0xcd29('0x2d')],_0x352e2f['filters']),_0x183ab2);if(_0x5e4269[_0xcd29('0x2d')][_0xcd29('0x37')]){_0x1117c4[_0xcd29('0x38')]=_[_0xcd29('0x39')](_0x1117c4[_0xcd29('0x38')],{'$or':_[_0xcd29('0x3a')](_0x183ab2,function(_0x45b79f){if(_0x45b79f[_0xcd29('0x3b')]!==_0xcd29('0x3c')){var _0x28cdd9={};_0x28cdd9[_0x45b79f[_0xcd29('0x26')]]={'$like':'%'+_0x5e4269[_0xcd29('0x2d')][_0xcd29('0x37')]+'%'};return _0x28cdd9;}})});}_0x1117c4=_[_0xcd29('0x39')]({},_0x1117c4,_0x5e4269['options']);var _0x55e817={'where':_0x1117c4[_0xcd29('0x38')]};return db[_0xcd29('0x3d')][_0xcd29('0x1b')](_0x55e817)[_0xcd29('0x22')](function(_0x5b227e){_0x59a30a[_0xcd29('0x1b')]=_0x5b227e;if(_0x5e4269[_0xcd29('0x2d')][_0xcd29('0x3e')]){_0x1117c4[_0xcd29('0x3f')]=[{'all':!![]}];}return db[_0xcd29('0x3d')][_0xcd29('0x40')](_0x1117c4);})[_0xcd29('0x22')](function(_0x271e1b){_0x59a30a[_0xcd29('0x41')]=_0x271e1b;return _0x59a30a;})[_0xcd29('0x22')](respondWithFilteredResult(_0x592f44,_0x1117c4))['catch'](handleError(_0x592f44,null));};exports[_0xcd29('0x42')]=function(_0x244832,_0x1a5210){var _0x36ae54={'raw':![],'where':{'id':_0x244832['params']['id']}},_0x13fbe1={};_0x13fbe1[_0xcd29('0x2c')]=_[_0xcd29('0x2e')](db['SalesforceConfiguration']['rawAttributes']);_0x13fbe1[_0xcd29('0x2d')]=_['keys'](_0x244832[_0xcd29('0x2d')]);_0x13fbe1[_0xcd29('0x35')]=_['intersection'](_0x13fbe1['model'],_0x13fbe1[_0xcd29('0x2d')]);_0x36ae54[_0xcd29('0x30')]=_[_0xcd29('0x2f')](_0x13fbe1[_0xcd29('0x2c')],qs[_0xcd29('0x31')](_0x244832['query'][_0xcd29('0x31')]));_0x36ae54['attributes']=_0x36ae54['attributes'][_0xcd29('0x32')]?_0x36ae54[_0xcd29('0x30')]:_0x13fbe1['model'];if(_0x244832[_0xcd29('0x2d')][_0xcd29('0x3e')]){_0x36ae54[_0xcd29('0x3f')]=[{'all':!![]}];}_0x36ae54=_[_0xcd29('0x39')]({},_0x36ae54,_0x244832[_0xcd29('0x43')]);return db[_0xcd29('0x3d')][_0xcd29('0x44')](_0x36ae54)[_0xcd29('0x22')](handleEntityNotFound(_0x1a5210,null))[_0xcd29('0x22')](respondWithResult(_0x1a5210,null))[_0xcd29('0x45')](handleError(_0x1a5210,null));};exports[_0xcd29('0x46')]=function(_0x5a904e,_0x2524fd){return db[_0xcd29('0x3d')]['create'](_0x5a904e['body'],{})[_0xcd29('0x22')](respondWithResult(_0x2524fd,0xc9))['catch'](handleError(_0x2524fd,null));};exports[_0xcd29('0x20')]=function(_0x32dd09,_0x45bc4d){if(_0x32dd09['body']['id']){delete _0x32dd09[_0xcd29('0x47')]['id'];}return db[_0xcd29('0x3d')][_0xcd29('0x44')]({'where':{'id':_0x32dd09[_0xcd29('0x48')]['id']}})[_0xcd29('0x22')](handleEntityNotFound(_0x45bc4d,null))[_0xcd29('0x22')](saveUpdates(_0x32dd09[_0xcd29('0x47')],null))['then'](respondWithResult(_0x45bc4d,null))['catch'](handleError(_0x45bc4d,null));};exports['destroy']=function(_0x387053,_0x452f06){return db[_0xcd29('0x3d')][_0xcd29('0x44')]({'where':{'id':_0x387053[_0xcd29('0x48')]['id']}})[_0xcd29('0x22')](handleEntityNotFound(_0x452f06,null))[_0xcd29('0x22')](removeEntity(_0x452f06,null))[_0xcd29('0x45')](handleError(_0x452f06,null));};exports[_0xcd29('0x49')]=function(_0x42b454,_0x520bee,_0x2caa73){var _0xe1f267={};var _0x1b043b={};var _0x2deb32;var _0x52d43b;return db[_0xcd29('0x3d')][_0xcd29('0x4a')]({'where':{'id':_0x42b454[_0xcd29('0x48')]['id']}})[_0xcd29('0x22')](handleEntityNotFound(_0x520bee,null))['then'](function(_0x246a94){if(_0x246a94){_0x2deb32=_0x246a94;_0x1b043b[_0xcd29('0x2c')]=_[_0xcd29('0x2e')](db[_0xcd29('0x4b')]['rawAttributes']);_0x1b043b['query']=_['keys'](_0x42b454[_0xcd29('0x2d')]);_0x1b043b[_0xcd29('0x35')]=_[_0xcd29('0x2f')](_0x1b043b['model'],_0x1b043b[_0xcd29('0x2d')]);_0xe1f267[_0xcd29('0x30')]=_[_0xcd29('0x2f')](_0x1b043b['model'],qs['fields'](_0x42b454[_0xcd29('0x2d')][_0xcd29('0x31')]));_0xe1f267[_0xcd29('0x30')]=_0xe1f267['attributes'][_0xcd29('0x32')]?_0xe1f267['attributes']:_0x1b043b[_0xcd29('0x2c')];_0xe1f267['order']=qs['sort'](_0x42b454[_0xcd29('0x2d')][_0xcd29('0x34')]);_0xe1f267[_0xcd29('0x38')]=qs[_0xcd29('0x35')](_[_0xcd29('0x36')](_0x42b454[_0xcd29('0x2d')],_0x1b043b['filters']));if(_0x42b454[_0xcd29('0x2d')][_0xcd29('0x37')]){_0xe1f267[_0xcd29('0x38')]=_['merge'](_0xe1f267[_0xcd29('0x38')],{'$or':_[_0xcd29('0x3a')](_0xe1f267['attributes'],function(_0x22079b){var _0x474ec9={};_0x474ec9[_0x22079b]={'$like':'%'+_0x42b454[_0xcd29('0x2d')][_0xcd29('0x37')]+'%'};return _0x474ec9;})});}_0xe1f267=_[_0xcd29('0x39')]({},_0xe1f267,_0x42b454[_0xcd29('0x43')]);return _0x2deb32[_0xcd29('0x49')](_0xe1f267);}})['then'](function(_0x433db5){if(_0x433db5){_0x52d43b=_0x433db5['length'];if(!_0x42b454[_0xcd29('0x2d')][_0xcd29('0x4c')](_0xcd29('0x33'))){_0xe1f267[_0xcd29('0x1a')]=qs[_0xcd29('0x1a')](_0x42b454[_0xcd29('0x2d')]['limit']);_0xe1f267[_0xcd29('0x1c')]=qs[_0xcd29('0x1c')](_0x42b454['query'][_0xcd29('0x1c')]);}return _0x2deb32[_0xcd29('0x49')](_0xe1f267);}})[_0xcd29('0x22')](function(_0x3a40cc){if(_0x3a40cc){return _0x3a40cc?{'count':_0x52d43b,'rows':_0x3a40cc}:null;}})[_0xcd29('0x22')](respondWithResult(_0x520bee,null))[_0xcd29('0x45')](handleError(_0x520bee,null));};exports[_0xcd29('0x4d')]=function(_0x216c3b,_0x17c4ca,_0x21b828){var _0x36b33d={};var _0xcab8bd={};var _0x703713;var _0x160f62;return db[_0xcd29('0x3d')]['findOne']({'where':{'id':_0x216c3b[_0xcd29('0x48')]['id']}})['then'](handleEntityNotFound(_0x17c4ca,null))[_0xcd29('0x22')](function(_0x24a724){if(_0x24a724){_0x703713=_0x24a724;_0xcab8bd[_0xcd29('0x2c')]=_[_0xcd29('0x2e')](db[_0xcd29('0x4b')][_0xcd29('0x29')]);_0xcab8bd[_0xcd29('0x2d')]=_[_0xcd29('0x2e')](_0x216c3b[_0xcd29('0x2d')]);_0xcab8bd[_0xcd29('0x35')]=_[_0xcd29('0x2f')](_0xcab8bd[_0xcd29('0x2c')],_0xcab8bd[_0xcd29('0x2d')]);_0x36b33d['attributes']=_[_0xcd29('0x2f')](_0xcab8bd[_0xcd29('0x2c')],qs[_0xcd29('0x31')](_0x216c3b[_0xcd29('0x2d')][_0xcd29('0x31')]));_0x36b33d[_0xcd29('0x30')]=_0x36b33d[_0xcd29('0x30')][_0xcd29('0x32')]?_0x36b33d['attributes']:_0xcab8bd[_0xcd29('0x2c')];_0x36b33d[_0xcd29('0x4e')]=qs['sort'](_0x216c3b['query'][_0xcd29('0x34')]);_0x36b33d[_0xcd29('0x38')]=qs[_0xcd29('0x35')](_[_0xcd29('0x36')](_0x216c3b[_0xcd29('0x2d')],_0xcab8bd[_0xcd29('0x35')]));if(_0x216c3b[_0xcd29('0x2d')]['filter']){_0x36b33d[_0xcd29('0x38')]=_[_0xcd29('0x39')](_0x36b33d[_0xcd29('0x38')],{'$or':_[_0xcd29('0x3a')](_0x36b33d[_0xcd29('0x30')],function(_0x4bce61){var _0x1d18cb={};_0x1d18cb[_0x4bce61]={'$like':'%'+_0x216c3b[_0xcd29('0x2d')]['filter']+'%'};return _0x1d18cb;})});}_0x36b33d=_[_0xcd29('0x39')]({},_0x36b33d,_0x216c3b['options']);return _0x703713['getSubjects'](_0x36b33d);}})[_0xcd29('0x22')](function(_0x32fa38){if(_0x32fa38){_0x160f62=_0x32fa38[_0xcd29('0x32')];if(!_0x216c3b['query'][_0xcd29('0x4c')](_0xcd29('0x33'))){_0x36b33d[_0xcd29('0x1a')]=qs['limit'](_0x216c3b[_0xcd29('0x2d')][_0xcd29('0x1a')]);_0x36b33d[_0xcd29('0x1c')]=qs['offset'](_0x216c3b['query'][_0xcd29('0x1c')]);}return _0x703713['getSubjects'](_0x36b33d);}})[_0xcd29('0x22')](function(_0x3cd016){if(_0x3cd016){return _0x3cd016?{'count':_0x160f62,'rows':_0x3cd016}:null;}})[_0xcd29('0x22')](respondWithResult(_0x17c4ca,null))[_0xcd29('0x45')](handleError(_0x17c4ca,null));};exports['getDescriptions']=function(_0x51005c,_0xc3c775,_0x4b1fcf){var _0x2badaa={};var _0x40cb3d={};var _0x1e5d8a;var _0x263340;return db[_0xcd29('0x3d')][_0xcd29('0x4a')]({'where':{'id':_0x51005c[_0xcd29('0x48')]['id']}})['then'](handleEntityNotFound(_0xc3c775,null))[_0xcd29('0x22')](function(_0x142eec){if(_0x142eec){_0x1e5d8a=_0x142eec;_0x40cb3d[_0xcd29('0x2c')]=_[_0xcd29('0x2e')](db[_0xcd29('0x4b')][_0xcd29('0x29')]);_0x40cb3d['query']=_['keys'](_0x51005c[_0xcd29('0x2d')]);_0x40cb3d[_0xcd29('0x35')]=_[_0xcd29('0x2f')](_0x40cb3d[_0xcd29('0x2c')],_0x40cb3d[_0xcd29('0x2d')]);_0x2badaa['attributes']=_[_0xcd29('0x2f')](_0x40cb3d[_0xcd29('0x2c')],qs[_0xcd29('0x31')](_0x51005c[_0xcd29('0x2d')]['fields']));_0x2badaa['attributes']=_0x2badaa[_0xcd29('0x30')][_0xcd29('0x32')]?_0x2badaa[_0xcd29('0x30')]:_0x40cb3d[_0xcd29('0x2c')];_0x2badaa['order']=qs['sort'](_0x51005c[_0xcd29('0x2d')][_0xcd29('0x34')]);_0x2badaa[_0xcd29('0x38')]=qs[_0xcd29('0x35')](_[_0xcd29('0x36')](_0x51005c[_0xcd29('0x2d')],_0x40cb3d['filters']));if(_0x51005c['query'][_0xcd29('0x37')]){_0x2badaa[_0xcd29('0x38')]=_[_0xcd29('0x39')](_0x2badaa[_0xcd29('0x38')],{'$or':_[_0xcd29('0x3a')](_0x2badaa['attributes'],function(_0x934df7){var _0x4a3901={};_0x4a3901[_0x934df7]={'$like':'%'+_0x51005c[_0xcd29('0x2d')][_0xcd29('0x37')]+'%'};return _0x4a3901;})});}_0x2badaa=_[_0xcd29('0x39')]({},_0x2badaa,_0x51005c[_0xcd29('0x43')]);return _0x1e5d8a[_0xcd29('0x4f')](_0x2badaa);}})[_0xcd29('0x22')](function(_0xf3e01c){if(_0xf3e01c){_0x263340=_0xf3e01c[_0xcd29('0x32')];if(!_0x51005c[_0xcd29('0x2d')][_0xcd29('0x4c')](_0xcd29('0x33'))){_0x2badaa[_0xcd29('0x1a')]=qs['limit'](_0x51005c[_0xcd29('0x2d')][_0xcd29('0x1a')]);_0x2badaa[_0xcd29('0x1c')]=qs[_0xcd29('0x1c')](_0x51005c['query'][_0xcd29('0x1c')]);}return _0x1e5d8a[_0xcd29('0x4f')](_0x2badaa);}})[_0xcd29('0x22')](function(_0x1cdc78){if(_0x1cdc78){return _0x1cdc78?{'count':_0x263340,'rows':_0x1cdc78}:null;}})[_0xcd29('0x22')](respondWithResult(_0xc3c775,null))[_0xcd29('0x45')](handleError(_0xc3c775,null));}; \ No newline at end of file +var _0xa789=['../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','error','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','rows','catch','show','params','length','include','create','body','find','getFields','findOne','rawAttributes','nolimit','getSubjects','SalesforceField','getDescriptions','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x326bc5,_0x264227){var _0x5ca747=function(_0x3d00d2){while(--_0x3d00d2){_0x326bc5['push'](_0x326bc5['shift']());}};_0x5ca747(++_0x264227);}(_0xa789,0x8d));var _0x9a78=function(_0x28235d,_0x576d3f){_0x28235d=_0x28235d-0x0;var _0x2806b1=_0xa789[_0x28235d];return _0x2806b1;};'use strict';var emlformat=require(_0x9a78('0x0'));var rimraf=require(_0x9a78('0x1'));var zipdir=require(_0x9a78('0x2'));var jsonpatch=require(_0x9a78('0x3'));var rp=require(_0x9a78('0x4'));var moment=require(_0x9a78('0x5'));var BPromise=require(_0x9a78('0x6'));var Mustache=require(_0x9a78('0x7'));var util=require(_0x9a78('0x8'));var path=require(_0x9a78('0x9'));var sox=require(_0x9a78('0xa'));var csv=require(_0x9a78('0xb'));var ejs=require(_0x9a78('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a78('0xd'));var squel=require(_0x9a78('0xe'));var crypto=require(_0x9a78('0xf'));var jsforce=require(_0x9a78('0x10'));var deskjs=require(_0x9a78('0x11'));var toCsv=require(_0x9a78('0xb'));var querystring=require(_0x9a78('0x12'));var Papa=require(_0x9a78('0x13'));var Redis=require(_0x9a78('0x14'));var authService=require(_0x9a78('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a78('0x16'))(_0x9a78('0x17'));var utils=require(_0x9a78('0x18'));var config=require(_0x9a78('0x19'));var licenseUtil=require(_0x9a78('0x1a'));var db=require(_0x9a78('0x1b'))['db'];function respondWithStatusCode(_0x441692,_0x36339d){_0x36339d=_0x36339d||0xcc;return function(_0x2a7ed4){if(_0x2a7ed4){return _0x441692['sendStatus'](_0x36339d);}return _0x441692[_0x9a78('0x1c')](_0x36339d)[_0x9a78('0x1d')]();};}function respondWithResult(_0x585114,_0x57caa7){_0x57caa7=_0x57caa7||0xc8;return function(_0x4f0068){if(_0x4f0068){return _0x585114[_0x9a78('0x1c')](_0x57caa7)['json'](_0x4f0068);}};}function respondWithFilteredResult(_0x56f788,_0x23b60e){return function(_0x553542){if(_0x553542){var _0x53bdcb=typeof _0x23b60e[_0x9a78('0x1e')]===_0x9a78('0x1f')&&typeof _0x23b60e[_0x9a78('0x20')]===_0x9a78('0x1f');var _0x2bd4c8=_0x553542[_0x9a78('0x21')];var _0xba2df0=_0x53bdcb?0x0:_0x23b60e[_0x9a78('0x1e')];var _0x3c427e=_0x53bdcb?_0x553542[_0x9a78('0x21')]:_0x23b60e['offset']+_0x23b60e['limit'];var _0x25f13e;if(_0x3c427e>=_0x2bd4c8){_0x3c427e=_0x2bd4c8;_0x25f13e=0xc8;}else{_0x25f13e=0xce;}_0x56f788[_0x9a78('0x1c')](_0x25f13e);return _0x56f788['set'](_0x9a78('0x22'),_0xba2df0+'-'+_0x3c427e+'/'+_0x2bd4c8)[_0x9a78('0x23')](_0x553542);}return null;};}function patchUpdates(_0x5dd6d4){return function(_0x34cb29){try{jsonpatch[_0x9a78('0x24')](_0x34cb29,_0x5dd6d4,!![]);}catch(_0x47476a){return BPromise['reject'](_0x47476a);}return _0x34cb29[_0x9a78('0x25')]();};}function saveUpdates(_0x5212e3,_0x31b39e){return function(_0x102629){if(_0x102629){return _0x102629[_0x9a78('0x26')](_0x5212e3)['then'](function(_0x1bf696){return _0x1bf696;});}return null;};}function removeEntity(_0x15059b,_0x38d315){return function(_0x1169be){if(_0x1169be){return _0x1169be[_0x9a78('0x27')]()['then'](function(){_0x15059b[_0x9a78('0x1c')](0xcc)[_0x9a78('0x1d')]();});}};}function handleEntityNotFound(_0x4cb668,_0x53e956){return function(_0x5c71a5){if(!_0x5c71a5){_0x4cb668['sendStatus'](0x194);}return _0x5c71a5;};}function handleError(_0x4f1df1,_0x56fc21){_0x56fc21=_0x56fc21||0x1f4;return function(_0xdf2563){logger[_0x9a78('0x28')](_0xdf2563[_0x9a78('0x29')]);if(_0xdf2563['name']){delete _0xdf2563[_0x9a78('0x2a')];}_0x4f1df1['status'](_0x56fc21)[_0x9a78('0x2b')](_0xdf2563);};}exports[_0x9a78('0x2c')]=function(_0x3283e8,_0x2c68ec){var _0x3b7119={},_0x3c8688={},_0x502bdc={'count':0x0,'rows':[]};var _0x3e505a=_[_0x9a78('0x2d')](db[_0x9a78('0x2e')]['rawAttributes'],function(_0x92573d){return{'name':_0x92573d[_0x9a78('0x2f')],'type':_0x92573d[_0x9a78('0x30')][_0x9a78('0x31')]};});_0x3c8688['model']=_['map'](_0x3e505a,_0x9a78('0x2a'));_0x3c8688[_0x9a78('0x32')]=_[_0x9a78('0x33')](_0x3283e8[_0x9a78('0x32')]);_0x3c8688[_0x9a78('0x34')]=_[_0x9a78('0x35')](_0x3c8688[_0x9a78('0x36')],_0x3c8688['query']);_0x3b7119[_0x9a78('0x37')]=_[_0x9a78('0x35')](_0x3c8688[_0x9a78('0x36')],qs[_0x9a78('0x38')](_0x3283e8[_0x9a78('0x32')][_0x9a78('0x38')]));_0x3b7119['attributes']=_0x3b7119[_0x9a78('0x37')]['length']?_0x3b7119['attributes']:_0x3c8688[_0x9a78('0x36')];if(!_0x3283e8[_0x9a78('0x32')][_0x9a78('0x39')]('nolimit')){_0x3b7119[_0x9a78('0x20')]=qs[_0x9a78('0x20')](_0x3283e8['query'][_0x9a78('0x20')]);_0x3b7119[_0x9a78('0x1e')]=qs[_0x9a78('0x1e')](_0x3283e8[_0x9a78('0x32')]['offset']);}_0x3b7119[_0x9a78('0x3a')]=qs[_0x9a78('0x3b')](_0x3283e8[_0x9a78('0x32')][_0x9a78('0x3b')]);_0x3b7119[_0x9a78('0x3c')]=qs[_0x9a78('0x34')](_[_0x9a78('0x3d')](_0x3283e8[_0x9a78('0x32')],_0x3c8688[_0x9a78('0x34')]),_0x3e505a);if(_0x3283e8[_0x9a78('0x32')][_0x9a78('0x3e')]){_0x3b7119[_0x9a78('0x3c')]=_['merge'](_0x3b7119['where'],{'$or':_[_0x9a78('0x2d')](_0x3e505a,function(_0x10f46a){if(_0x10f46a[_0x9a78('0x30')]!==_0x9a78('0x3f')){var _0x205268={};_0x205268[_0x10f46a['name']]={'$like':'%'+_0x3283e8['query'][_0x9a78('0x3e')]+'%'};return _0x205268;}})});}_0x3b7119=_[_0x9a78('0x40')]({},_0x3b7119,_0x3283e8[_0x9a78('0x41')]);var _0x1a9c72={'where':_0x3b7119[_0x9a78('0x3c')]};return db[_0x9a78('0x2e')][_0x9a78('0x21')](_0x1a9c72)[_0x9a78('0x42')](function(_0xe47427){_0x502bdc['count']=_0xe47427;if(_0x3283e8[_0x9a78('0x32')][_0x9a78('0x43')]){_0x3b7119['include']=[{'all':!![]}];}return db[_0x9a78('0x2e')]['findAll'](_0x3b7119);})[_0x9a78('0x42')](function(_0x4bc4fa){_0x502bdc[_0x9a78('0x44')]=_0x4bc4fa;return _0x502bdc;})['then'](respondWithFilteredResult(_0x2c68ec,_0x3b7119))[_0x9a78('0x45')](handleError(_0x2c68ec,null));};exports[_0x9a78('0x46')]=function(_0x40fca4,_0x340287){var _0x5bafd7={'raw':![],'where':{'id':_0x40fca4[_0x9a78('0x47')]['id']}},_0x7c6d0d={};_0x7c6d0d[_0x9a78('0x36')]=_['keys'](db[_0x9a78('0x2e')]['rawAttributes']);_0x7c6d0d[_0x9a78('0x32')]=_['keys'](_0x40fca4[_0x9a78('0x32')]);_0x7c6d0d[_0x9a78('0x34')]=_[_0x9a78('0x35')](_0x7c6d0d[_0x9a78('0x36')],_0x7c6d0d['query']);_0x5bafd7[_0x9a78('0x37')]=_[_0x9a78('0x35')](_0x7c6d0d['model'],qs[_0x9a78('0x38')](_0x40fca4[_0x9a78('0x32')]['fields']));_0x5bafd7[_0x9a78('0x37')]=_0x5bafd7[_0x9a78('0x37')][_0x9a78('0x48')]?_0x5bafd7[_0x9a78('0x37')]:_0x7c6d0d[_0x9a78('0x36')];if(_0x40fca4[_0x9a78('0x32')]['includeAll']){_0x5bafd7[_0x9a78('0x49')]=[{'all':!![]}];}_0x5bafd7=_[_0x9a78('0x40')]({},_0x5bafd7,_0x40fca4[_0x9a78('0x41')]);return db['SalesforceConfiguration']['find'](_0x5bafd7)[_0x9a78('0x42')](handleEntityNotFound(_0x340287,null))['then'](respondWithResult(_0x340287,null))[_0x9a78('0x45')](handleError(_0x340287,null));};exports[_0x9a78('0x4a')]=function(_0xc7d9e6,_0x1c993e){return db[_0x9a78('0x2e')][_0x9a78('0x4a')](_0xc7d9e6['body'],{})['then'](respondWithResult(_0x1c993e,0xc9))[_0x9a78('0x45')](handleError(_0x1c993e,null));};exports[_0x9a78('0x26')]=function(_0x2bc90a,_0x4fe96e){if(_0x2bc90a[_0x9a78('0x4b')]['id']){delete _0x2bc90a['body']['id'];}return db[_0x9a78('0x2e')][_0x9a78('0x4c')]({'where':{'id':_0x2bc90a[_0x9a78('0x47')]['id']}})[_0x9a78('0x42')](handleEntityNotFound(_0x4fe96e,null))[_0x9a78('0x42')](saveUpdates(_0x2bc90a['body'],null))[_0x9a78('0x42')](respondWithResult(_0x4fe96e,null))['catch'](handleError(_0x4fe96e,null));};exports[_0x9a78('0x27')]=function(_0x2acb22,_0x4bf66f){return db[_0x9a78('0x2e')][_0x9a78('0x4c')]({'where':{'id':_0x2acb22[_0x9a78('0x47')]['id']}})[_0x9a78('0x42')](handleEntityNotFound(_0x4bf66f,null))[_0x9a78('0x42')](removeEntity(_0x4bf66f,null))['catch'](handleError(_0x4bf66f,null));};exports[_0x9a78('0x4d')]=function(_0x10689d,_0x174a30,_0x3784df){var _0x4a2d68={};var _0x586d9e={};var _0x567798;var _0xc8a14c;return db[_0x9a78('0x2e')][_0x9a78('0x4e')]({'where':{'id':_0x10689d[_0x9a78('0x47')]['id']}})[_0x9a78('0x42')](handleEntityNotFound(_0x174a30,null))['then'](function(_0xae993d){if(_0xae993d){_0x567798=_0xae993d;_0x586d9e['model']=_['keys'](db['SalesforceField'][_0x9a78('0x4f')]);_0x586d9e[_0x9a78('0x32')]=_[_0x9a78('0x33')](_0x10689d['query']);_0x586d9e[_0x9a78('0x34')]=_[_0x9a78('0x35')](_0x586d9e[_0x9a78('0x36')],_0x586d9e[_0x9a78('0x32')]);_0x4a2d68[_0x9a78('0x37')]=_[_0x9a78('0x35')](_0x586d9e[_0x9a78('0x36')],qs[_0x9a78('0x38')](_0x10689d['query'][_0x9a78('0x38')]));_0x4a2d68[_0x9a78('0x37')]=_0x4a2d68['attributes'][_0x9a78('0x48')]?_0x4a2d68[_0x9a78('0x37')]:_0x586d9e[_0x9a78('0x36')];_0x4a2d68[_0x9a78('0x3a')]=qs['sort'](_0x10689d['query'][_0x9a78('0x3b')]);_0x4a2d68[_0x9a78('0x3c')]=qs[_0x9a78('0x34')](_[_0x9a78('0x3d')](_0x10689d[_0x9a78('0x32')],_0x586d9e['filters']));if(_0x10689d['query'][_0x9a78('0x3e')]){_0x4a2d68[_0x9a78('0x3c')]=_[_0x9a78('0x40')](_0x4a2d68['where'],{'$or':_[_0x9a78('0x2d')](_0x4a2d68[_0x9a78('0x37')],function(_0x59cd59){var _0x19dccb={};_0x19dccb[_0x59cd59]={'$like':'%'+_0x10689d[_0x9a78('0x32')]['filter']+'%'};return _0x19dccb;})});}_0x4a2d68=_[_0x9a78('0x40')]({},_0x4a2d68,_0x10689d[_0x9a78('0x41')]);return _0x567798[_0x9a78('0x4d')](_0x4a2d68);}})[_0x9a78('0x42')](function(_0x5e9003){if(_0x5e9003){_0xc8a14c=_0x5e9003['length'];if(!_0x10689d[_0x9a78('0x32')][_0x9a78('0x39')](_0x9a78('0x50'))){_0x4a2d68[_0x9a78('0x20')]=qs['limit'](_0x10689d[_0x9a78('0x32')][_0x9a78('0x20')]);_0x4a2d68[_0x9a78('0x1e')]=qs[_0x9a78('0x1e')](_0x10689d['query'][_0x9a78('0x1e')]);}return _0x567798[_0x9a78('0x4d')](_0x4a2d68);}})[_0x9a78('0x42')](function(_0x4e93e8){if(_0x4e93e8){return _0x4e93e8?{'count':_0xc8a14c,'rows':_0x4e93e8}:null;}})[_0x9a78('0x42')](respondWithResult(_0x174a30,null))['catch'](handleError(_0x174a30,null));};exports[_0x9a78('0x51')]=function(_0x441d4c,_0x207b76,_0x5ededc){var _0x26127e={};var _0x52c09f={};var _0x4924fb;var _0x52c740;return db[_0x9a78('0x2e')][_0x9a78('0x4e')]({'where':{'id':_0x441d4c[_0x9a78('0x47')]['id']}})[_0x9a78('0x42')](handleEntityNotFound(_0x207b76,null))['then'](function(_0x4da7aa){if(_0x4da7aa){_0x4924fb=_0x4da7aa;_0x52c09f[_0x9a78('0x36')]=_['keys'](db[_0x9a78('0x52')][_0x9a78('0x4f')]);_0x52c09f[_0x9a78('0x32')]=_[_0x9a78('0x33')](_0x441d4c['query']);_0x52c09f[_0x9a78('0x34')]=_[_0x9a78('0x35')](_0x52c09f[_0x9a78('0x36')],_0x52c09f[_0x9a78('0x32')]);_0x26127e['attributes']=_[_0x9a78('0x35')](_0x52c09f[_0x9a78('0x36')],qs[_0x9a78('0x38')](_0x441d4c[_0x9a78('0x32')][_0x9a78('0x38')]));_0x26127e[_0x9a78('0x37')]=_0x26127e['attributes'][_0x9a78('0x48')]?_0x26127e['attributes']:_0x52c09f[_0x9a78('0x36')];_0x26127e[_0x9a78('0x3a')]=qs[_0x9a78('0x3b')](_0x441d4c['query'][_0x9a78('0x3b')]);_0x26127e[_0x9a78('0x3c')]=qs[_0x9a78('0x34')](_[_0x9a78('0x3d')](_0x441d4c[_0x9a78('0x32')],_0x52c09f[_0x9a78('0x34')]));if(_0x441d4c[_0x9a78('0x32')][_0x9a78('0x3e')]){_0x26127e['where']=_['merge'](_0x26127e[_0x9a78('0x3c')],{'$or':_[_0x9a78('0x2d')](_0x26127e['attributes'],function(_0x416227){var _0x5b0be2={};_0x5b0be2[_0x416227]={'$like':'%'+_0x441d4c['query'][_0x9a78('0x3e')]+'%'};return _0x5b0be2;})});}_0x26127e=_[_0x9a78('0x40')]({},_0x26127e,_0x441d4c[_0x9a78('0x41')]);return _0x4924fb[_0x9a78('0x51')](_0x26127e);}})['then'](function(_0x563531){if(_0x563531){_0x52c740=_0x563531['length'];if(!_0x441d4c[_0x9a78('0x32')]['hasOwnProperty']('nolimit')){_0x26127e[_0x9a78('0x20')]=qs['limit'](_0x441d4c['query'][_0x9a78('0x20')]);_0x26127e[_0x9a78('0x1e')]=qs[_0x9a78('0x1e')](_0x441d4c['query']['offset']);}return _0x4924fb['getSubjects'](_0x26127e);}})[_0x9a78('0x42')](function(_0x2fba20){if(_0x2fba20){return _0x2fba20?{'count':_0x52c740,'rows':_0x2fba20}:null;}})[_0x9a78('0x42')](respondWithResult(_0x207b76,null))[_0x9a78('0x45')](handleError(_0x207b76,null));};exports['getDescriptions']=function(_0x1da4d6,_0x585aeb,_0x2e1015){var _0x370eaf={};var _0xc05cc4={};var _0x208587;var _0x875e26;return db[_0x9a78('0x2e')]['findOne']({'where':{'id':_0x1da4d6['params']['id']}})[_0x9a78('0x42')](handleEntityNotFound(_0x585aeb,null))[_0x9a78('0x42')](function(_0x29aa41){if(_0x29aa41){_0x208587=_0x29aa41;_0xc05cc4[_0x9a78('0x36')]=_['keys'](db[_0x9a78('0x52')][_0x9a78('0x4f')]);_0xc05cc4[_0x9a78('0x32')]=_[_0x9a78('0x33')](_0x1da4d6[_0x9a78('0x32')]);_0xc05cc4[_0x9a78('0x34')]=_[_0x9a78('0x35')](_0xc05cc4[_0x9a78('0x36')],_0xc05cc4[_0x9a78('0x32')]);_0x370eaf[_0x9a78('0x37')]=_[_0x9a78('0x35')](_0xc05cc4[_0x9a78('0x36')],qs[_0x9a78('0x38')](_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x38')]));_0x370eaf['attributes']=_0x370eaf['attributes'][_0x9a78('0x48')]?_0x370eaf['attributes']:_0xc05cc4[_0x9a78('0x36')];_0x370eaf['order']=qs[_0x9a78('0x3b')](_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x3b')]);_0x370eaf['where']=qs[_0x9a78('0x34')](_[_0x9a78('0x3d')](_0x1da4d6[_0x9a78('0x32')],_0xc05cc4['filters']));if(_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x3e')]){_0x370eaf[_0x9a78('0x3c')]=_[_0x9a78('0x40')](_0x370eaf[_0x9a78('0x3c')],{'$or':_[_0x9a78('0x2d')](_0x370eaf[_0x9a78('0x37')],function(_0x3e8488){var _0x4faf03={};_0x4faf03[_0x3e8488]={'$like':'%'+_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x3e')]+'%'};return _0x4faf03;})});}_0x370eaf=_[_0x9a78('0x40')]({},_0x370eaf,_0x1da4d6['options']);return _0x208587[_0x9a78('0x53')](_0x370eaf);}})['then'](function(_0xb92b0f){if(_0xb92b0f){_0x875e26=_0xb92b0f[_0x9a78('0x48')];if(!_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x39')]('nolimit')){_0x370eaf[_0x9a78('0x20')]=qs[_0x9a78('0x20')](_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x20')]);_0x370eaf[_0x9a78('0x1e')]=qs[_0x9a78('0x1e')](_0x1da4d6[_0x9a78('0x32')][_0x9a78('0x1e')]);}return _0x208587[_0x9a78('0x53')](_0x370eaf);}})[_0x9a78('0x42')](function(_0x46e1b3){if(_0x46e1b3){return _0x46e1b3?{'count':_0x875e26,'rows':_0x46e1b3}:null;}})['then'](respondWithResult(_0x585aeb,null))[_0x9a78('0x45')](handleError(_0x585aeb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7dcbf88..d34538e 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 _0x34b7=['api','moment','bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','util','../../config/logger'];(function(_0xe01212,_0x4693fa){var _0x2d757e=function(_0x2f1ce1){while(--_0x2f1ce1){_0xe01212['push'](_0xe01212['shift']());}};_0x2d757e(++_0x4693fa);}(_0x34b7,0x18e));var _0x734b=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0x34b7[_0xd6aad];return _0x1109e6;};'use strict';var _=require('lodash');var util=require(_0x734b('0x0'));var logger=require(_0x734b('0x1'))(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x734b('0x5'));var config=require(_0x734b('0x6'));var attributes=require(_0x734b('0x7'));module[_0x734b('0x8')]=function(_0x38e176,_0x4e5f79){return _0x38e176[_0x734b('0x9')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7bd=['api','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','../../config/logger'];(function(_0x3ad815,_0x52ae99){var _0x2f6363=function(_0x176429){while(--_0x176429){_0x3ad815['push'](_0x3ad815['shift']());}};_0x2f6363(++_0x52ae99);}(_0xa7bd,0xa2));var _0xda7b=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0xa7bd[_0x3e5f6d];return _0x1bea6e;};'use strict';var _=require(_0xda7b('0x0'));var util=require(_0xda7b('0x1'));var logger=require(_0xda7b('0x2'))(_0xda7b('0x3'));var moment=require('moment');var BPromise=require(_0xda7b('0x4'));var rp=require(_0xda7b('0x5'));var fs=require('fs');var path=require(_0xda7b('0x6'));var rimraf=require('rimraf');var config=require(_0xda7b('0x7'));var attributes=require(_0xda7b('0x8'));module['exports']=function(_0x375784,_0x185e1c){return _0x375784[_0xda7b('0x9')](_0xda7b('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index a9b4e71..7c8131a 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 _0xc5ce=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x3aae66,_0x3dc9a9){var _0x130ebc=function(_0x3dc20e){while(--_0x3dc20e){_0x3aae66['push'](_0x3aae66['shift']());}};_0x130ebc(++_0x3dc9a9);}(_0xc5ce,0x64));var _0xec5c=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xc5ce[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0xec5c('0x0'));var util=require(_0xec5c('0x1'));var moment=require(_0xec5c('0x2'));var BPromise=require(_0xec5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec5c('0x4'));var db=require(_0xec5c('0x5'))['db'];var utils=require(_0xec5c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xec5c('0x7'));var jayson=require(_0xec5c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31cff8,_0x1cdfbf,_0x4dd638){return new BPromise(function(_0x4fe24c,_0xd7cff7){return client['request'](_0x31cff8,_0x4dd638)['then'](function(_0x179802){logger['info'](_0xec5c('0x9'),_0x1cdfbf,_0xec5c('0xa'));logger[_0xec5c('0xb')](_0xec5c('0xc'),_0x1cdfbf,_0xec5c('0xa'),JSON['stringify'](_0x179802));if(_0x179802[_0xec5c('0xd')]){if(_0x179802['error'][_0xec5c('0xe')]===0x1f4){logger['error'](_0xec5c('0x9'),_0x1cdfbf,_0x179802[_0xec5c('0xd')][_0xec5c('0xf')]);return _0xd7cff7(_0x179802[_0xec5c('0xd')][_0xec5c('0xf')]);}logger['error'](_0xec5c('0x9'),_0x1cdfbf,_0x179802[_0xec5c('0xd')][_0xec5c('0xf')]);return _0x4fe24c(_0x179802['error'][_0xec5c('0xf')]);}else{logger[_0xec5c('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1cdfbf,_0xec5c('0xa'));_0x4fe24c(_0x179802[_0xec5c('0x11')][_0xec5c('0xf')]);}})[_0xec5c('0x12')](function(_0x49db4c){logger[_0xec5c('0xd')](_0xec5c('0x9'),_0x1cdfbf,_0x49db4c);_0xd7cff7(_0x49db4c);});});} \ No newline at end of file +var _0x3f83=['code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x3f83,0x159));var _0x33f8=function(_0x44de26,_0x2a73ea){_0x44de26=_0x44de26-0x0;var _0x53243f=_0x3f83[_0x44de26];return _0x53243f;};'use strict';var _=require(_0x33f8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x33f8('0x1'));var rs=require(_0x33f8('0x2'));var fs=require('fs');var Redis=require(_0x33f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x33f8('0x4'))(_0x33f8('0x5'));var config=require('../../config/environment');var jayson=require(_0x33f8('0x6'));var client=jayson['client'][_0x33f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c2ac6,_0x504514,_0x544f0a){return new BPromise(function(_0x3b2782,_0x5e1a5c){return client[_0x33f8('0x8')](_0x5c2ac6,_0x544f0a)[_0x33f8('0x9')](function(_0x2c6d4b){logger[_0x33f8('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x504514,_0x33f8('0xb'));logger[_0x33f8('0xc')](_0x33f8('0xd'),_0x504514,_0x33f8('0xb'),JSON['stringify'](_0x2c6d4b));if(_0x2c6d4b[_0x33f8('0xe')]){if(_0x2c6d4b[_0x33f8('0xe')][_0x33f8('0xf')]===0x1f4){logger['error'](_0x33f8('0x10'),_0x504514,_0x2c6d4b[_0x33f8('0xe')]['message']);return _0x5e1a5c(_0x2c6d4b['error'][_0x33f8('0x11')]);}logger[_0x33f8('0xe')](_0x33f8('0x10'),_0x504514,_0x2c6d4b['error']['message']);return _0x3b2782(_0x2c6d4b['error'][_0x33f8('0x11')]);}else{logger[_0x33f8('0xa')](_0x33f8('0x10'),_0x504514,'request\x20sent');_0x3b2782(_0x2c6d4b[_0x33f8('0x12')][_0x33f8('0x11')]);}})[_0x33f8('0x13')](function(_0x36244b){logger[_0x33f8('0xe')](_0x33f8('0x10'),_0x504514,_0x36244b);_0x5e1a5c(_0x36244b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 717807d..ed119d1 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 _0x7a12=['path','connect-timeout','express','fs-extra','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util'];(function(_0x1bde1f,_0x4f6905){var _0x1382e5=function(_0x2b969b){while(--_0x2b969b){_0x1bde1f['push'](_0x1bde1f['shift']());}};_0x1382e5(++_0x4f6905);}(_0x7a12,0x75));var _0x27a1=function(_0x201c3a,_0x314603){_0x201c3a=_0x201c3a-0x0;var _0x3284b9=_0x7a12[_0x201c3a];return _0x3284b9;};'use strict';var multer=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var path=require(_0x27a1('0x2'));var timeout=require(_0x27a1('0x3'));var express=require(_0x27a1('0x4'));var router=express['Router']();var fs_extra=require(_0x27a1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x27a1('0x6'));var controller=require('./intSalesforceField.controller');router[_0x27a1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x27a1('0x7')](_0x27a1('0x8'),auth[_0x27a1('0x9')](),controller[_0x27a1('0xa')]);router[_0x27a1('0xb')]('/',auth['isAuthenticated'](),controller[_0x27a1('0xc')]);router[_0x27a1('0xd')](_0x27a1('0x8'),auth[_0x27a1('0x9')](),controller[_0x27a1('0xe')]);router[_0x27a1('0xf')]('/:id',auth[_0x27a1('0x9')](),controller['destroy']);module[_0x27a1('0x10')]=router; \ No newline at end of file +var _0x3c0c=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id'];(function(_0x4202ef,_0x1bca47){var _0x158a41=function(_0x5346fd){while(--_0x5346fd){_0x4202ef['push'](_0x4202ef['shift']());}};_0x158a41(++_0x1bca47);}(_0x3c0c,0xe3));var _0xc3c0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3c0c[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xc3c0('0x0'));var util=require(_0xc3c0('0x1'));var path=require('path');var timeout=require(_0xc3c0('0x2'));var express=require(_0xc3c0('0x3'));var router=express[_0xc3c0('0x4')]();var fs_extra=require(_0xc3c0('0x5'));var auth=require(_0xc3c0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc3c0('0x7'));var controller=require(_0xc3c0('0x8'));router[_0xc3c0('0x9')]('/',auth[_0xc3c0('0xa')](),controller[_0xc3c0('0xb')]);router[_0xc3c0('0x9')](_0xc3c0('0xc'),auth[_0xc3c0('0xa')](),controller[_0xc3c0('0xd')]);router[_0xc3c0('0xe')]('/',auth[_0xc3c0('0xa')](),controller[_0xc3c0('0xf')]);router[_0xc3c0('0x10')](_0xc3c0('0xc'),auth[_0xc3c0('0xa')](),controller[_0xc3c0('0x11')]);router[_0xc3c0('0x12')](_0xc3c0('0xc'),auth['isAuthenticated'](),controller[_0xc3c0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index af5efc1..6c92755 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 _0x3bf8=['STRING','variable','customVariable','sequelize','exports','keyValue','picklist','string'];(function(_0x16e92f,_0x161957){var _0x54eb74=function(_0x18251b){while(--_0x18251b){_0x16e92f['push'](_0x16e92f['shift']());}};_0x54eb74(++_0x161957);}(_0x3bf8,0x1f3));var _0x83bf=function(_0x17385f,_0x5473b3){_0x17385f=_0x17385f-0x0;var _0x2e8e51=_0x3bf8[_0x17385f];return _0x2e8e51;};'use strict';var Sequelize=require(_0x83bf('0x0'));module[_0x83bf('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x83bf('0x2'),_0x83bf('0x3')),'defaultValue':_0x83bf('0x4')},'content':{'type':Sequelize[_0x83bf('0x5')]},'key':{'type':Sequelize[_0x83bf('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x83bf('0x6'),_0x83bf('0x7'))},'keyContent':{'type':Sequelize[_0x83bf('0x5')]},'idField':{'type':Sequelize[_0x83bf('0x5')]},'variableName':{'type':Sequelize[_0x83bf('0x5')]}}; \ No newline at end of file +var _0x4736=['keyValue','picklist','STRING','ENUM','exports','string','variable','customVariable'];(function(_0x3a10e3,_0x3cdb35){var _0xf067c8=function(_0x184beb){while(--_0x184beb){_0x3a10e3['push'](_0x3a10e3['shift']());}};_0xf067c8(++_0x3cdb35);}(_0x4736,0x194));var _0x6473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4736[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6473('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6473('0x1'),_0x6473('0x2'),_0x6473('0x3'),_0x6473('0x4'),_0x6473('0x5')),'defaultValue':_0x6473('0x1')},'content':{'type':Sequelize[_0x6473('0x6')]},'key':{'type':Sequelize[_0x6473('0x6')]},'keyType':{'type':Sequelize[_0x6473('0x7')](_0x6473('0x1'),_0x6473('0x2'),_0x6473('0x3'))},'keyContent':{'type':Sequelize[_0x6473('0x6')]},'idField':{'type':Sequelize[_0x6473('0x6')]},'variableName':{'type':Sequelize[_0x6473('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b644fbf..c7a0cae 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 _0x989f=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','SalesforceField','includeAll','include','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','query','keys'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x989f,0x17b));var _0xf989=function(_0xd06c7e,_0x5c5482){_0xd06c7e=_0xd06c7e-0x0;var _0x4dc139=_0x989f[_0xd06c7e];return _0x4dc139;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf989('0x0'));var zipdir=require(_0xf989('0x1'));var jsonpatch=require(_0xf989('0x2'));var rp=require(_0xf989('0x3'));var moment=require(_0xf989('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf989('0x5'));var path=require(_0xf989('0x6'));var sox=require(_0xf989('0x7'));var csv=require(_0xf989('0x8'));var ejs=require(_0xf989('0x9'));var fs=require('fs');var fs_extra=require(_0xf989('0xa'));var _=require(_0xf989('0xb'));var squel=require(_0xf989('0xc'));var crypto=require(_0xf989('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf989('0x8'));var querystring=require('querystring');var Papa=require(_0xf989('0xe'));var Redis=require(_0xf989('0xf'));var authService=require(_0xf989('0x10'));var qs=require(_0xf989('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf989('0x12'))(_0xf989('0x13'));var utils=require('../../config/utils');var config=require(_0xf989('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf989('0x15'))['db'];function respondWithStatusCode(_0x45e2e4,_0x3647c9){_0x3647c9=_0x3647c9||0xcc;return function(_0x23a558){if(_0x23a558){return _0x45e2e4[_0xf989('0x16')](_0x3647c9);}return _0x45e2e4[_0xf989('0x17')](_0x3647c9)[_0xf989('0x18')]();};}function respondWithResult(_0x3aad95,_0x361f7d){_0x361f7d=_0x361f7d||0xc8;return function(_0x2a9f25){if(_0x2a9f25){return _0x3aad95[_0xf989('0x17')](_0x361f7d)[_0xf989('0x19')](_0x2a9f25);}};}function respondWithFilteredResult(_0xa36409,_0x133634){return function(_0x5a5dc1){if(_0x5a5dc1){var _0x2f61f6=typeof _0x133634[_0xf989('0x1a')]===_0xf989('0x1b')&&typeof _0x133634['limit']===_0xf989('0x1b');var _0x457cf3=_0x5a5dc1[_0xf989('0x1c')];var _0x4eac9e=_0x2f61f6?0x0:_0x133634[_0xf989('0x1a')];var _0x2d7e3e=_0x2f61f6?_0x5a5dc1[_0xf989('0x1c')]:_0x133634['offset']+_0x133634[_0xf989('0x1d')];var _0x43f1df;if(_0x2d7e3e>=_0x457cf3){_0x2d7e3e=_0x457cf3;_0x43f1df=0xc8;}else{_0x43f1df=0xce;}_0xa36409[_0xf989('0x17')](_0x43f1df);return _0xa36409[_0xf989('0x1e')](_0xf989('0x1f'),_0x4eac9e+'-'+_0x2d7e3e+'/'+_0x457cf3)['json'](_0x5a5dc1);}return null;};}function patchUpdates(_0x6da400){return function(_0x15ee25){try{jsonpatch[_0xf989('0x20')](_0x15ee25,_0x6da400,!![]);}catch(_0x56eab9){return BPromise[_0xf989('0x21')](_0x56eab9);}return _0x15ee25['save']();};}function saveUpdates(_0x20c27c,_0x3a885e){return function(_0x507744){if(_0x507744){return _0x507744[_0xf989('0x22')](_0x20c27c)[_0xf989('0x23')](function(_0xf69dcf){return _0xf69dcf;});}return null;};}function removeEntity(_0x5c3b53,_0x30fc7c){return function(_0x4f27e5){if(_0x4f27e5){return _0x4f27e5[_0xf989('0x24')]()[_0xf989('0x23')](function(){_0x5c3b53['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x266425,_0x1202d0){return function(_0x3fa131){if(!_0x3fa131){_0x266425[_0xf989('0x16')](0x194);}return _0x3fa131;};}function handleError(_0x347f18,_0x431e33){_0x431e33=_0x431e33||0x1f4;return function(_0x155e35){logger['error'](_0x155e35[_0xf989('0x25')]);if(_0x155e35[_0xf989('0x26')]){delete _0x155e35[_0xf989('0x26')];}_0x347f18[_0xf989('0x17')](_0x431e33)[_0xf989('0x27')](_0x155e35);};}exports[_0xf989('0x28')]=function(_0x509d40,_0x26b4b0){var _0x956cf2={},_0x160604={},_0x6890d7={'count':0x0,'rows':[]};var _0x53e5dd=_[_0xf989('0x29')](db['SalesforceField'][_0xf989('0x2a')],function(_0x45a133){return{'name':_0x45a133['fieldName'],'type':_0x45a133[_0xf989('0x2b')][_0xf989('0x2c')]};});_0x160604['model']=_[_0xf989('0x29')](_0x53e5dd,_0xf989('0x26'));_0x160604[_0xf989('0x2d')]=_[_0xf989('0x2e')](_0x509d40['query']);_0x160604[_0xf989('0x2f')]=_[_0xf989('0x30')](_0x160604[_0xf989('0x31')],_0x160604[_0xf989('0x2d')]);_0x956cf2[_0xf989('0x32')]=_[_0xf989('0x30')](_0x160604[_0xf989('0x31')],qs[_0xf989('0x33')](_0x509d40[_0xf989('0x2d')][_0xf989('0x33')]));_0x956cf2[_0xf989('0x32')]=_0x956cf2['attributes'][_0xf989('0x34')]?_0x956cf2[_0xf989('0x32')]:_0x160604[_0xf989('0x31')];if(!_0x509d40['query'][_0xf989('0x35')](_0xf989('0x36'))){_0x956cf2[_0xf989('0x1d')]=qs[_0xf989('0x1d')](_0x509d40[_0xf989('0x2d')]['limit']);_0x956cf2['offset']=qs['offset'](_0x509d40[_0xf989('0x2d')][_0xf989('0x1a')]);}_0x956cf2['order']=qs[_0xf989('0x37')](_0x509d40[_0xf989('0x2d')]['sort']);_0x956cf2[_0xf989('0x38')]=qs[_0xf989('0x2f')](_[_0xf989('0x39')](_0x509d40[_0xf989('0x2d')],_0x160604[_0xf989('0x2f')]),_0x53e5dd);if(_0x509d40[_0xf989('0x2d')][_0xf989('0x3a')]){_0x956cf2['where']=_[_0xf989('0x3b')](_0x956cf2[_0xf989('0x38')],{'$or':_['map'](_0x53e5dd,function(_0x5ebabb){if(_0x5ebabb[_0xf989('0x2b')]!=='VIRTUAL'){var _0x14ef18={};_0x14ef18[_0x5ebabb[_0xf989('0x26')]]={'$like':'%'+_0x509d40['query']['filter']+'%'};return _0x14ef18;}})});}_0x956cf2=_[_0xf989('0x3b')]({},_0x956cf2,_0x509d40['options']);var _0x48b240={'where':_0x956cf2[_0xf989('0x38')]};return db[_0xf989('0x3c')][_0xf989('0x1c')](_0x48b240)['then'](function(_0x2a392a){_0x6890d7[_0xf989('0x1c')]=_0x2a392a;if(_0x509d40[_0xf989('0x2d')][_0xf989('0x3d')]){_0x956cf2[_0xf989('0x3e')]=[{'all':!![]}];}return db[_0xf989('0x3c')]['findAll'](_0x956cf2);})['then'](function(_0xb70719){_0x6890d7[_0xf989('0x3f')]=_0xb70719;return _0x6890d7;})[_0xf989('0x23')](respondWithFilteredResult(_0x26b4b0,_0x956cf2))[_0xf989('0x40')](handleError(_0x26b4b0,null));};exports[_0xf989('0x41')]=function(_0x445d66,_0x30922f){var _0x10b8f0={'raw':!![],'where':{'id':_0x445d66[_0xf989('0x42')]['id']}},_0x23c99a={};_0x23c99a[_0xf989('0x31')]=_[_0xf989('0x2e')](db[_0xf989('0x3c')][_0xf989('0x2a')]);_0x23c99a[_0xf989('0x2d')]=_[_0xf989('0x2e')](_0x445d66[_0xf989('0x2d')]);_0x23c99a[_0xf989('0x2f')]=_[_0xf989('0x30')](_0x23c99a[_0xf989('0x31')],_0x23c99a[_0xf989('0x2d')]);_0x10b8f0['attributes']=_[_0xf989('0x30')](_0x23c99a[_0xf989('0x31')],qs[_0xf989('0x33')](_0x445d66[_0xf989('0x2d')][_0xf989('0x33')]));_0x10b8f0[_0xf989('0x32')]=_0x10b8f0[_0xf989('0x32')][_0xf989('0x34')]?_0x10b8f0[_0xf989('0x32')]:_0x23c99a[_0xf989('0x31')];if(_0x445d66[_0xf989('0x2d')][_0xf989('0x3d')]){_0x10b8f0['include']=[{'all':!![]}];}_0x10b8f0=_['merge']({},_0x10b8f0,_0x445d66[_0xf989('0x43')]);return db[_0xf989('0x3c')][_0xf989('0x44')](_0x10b8f0)[_0xf989('0x23')](handleEntityNotFound(_0x30922f,null))[_0xf989('0x23')](respondWithResult(_0x30922f,null))['catch'](handleError(_0x30922f,null));};exports[_0xf989('0x45')]=function(_0x3b0df9,_0x1c2ebc){return db['SalesforceField'][_0xf989('0x45')](_0x3b0df9[_0xf989('0x46')],{})['then'](respondWithResult(_0x1c2ebc,0xc9))[_0xf989('0x40')](handleError(_0x1c2ebc,null));};exports[_0xf989('0x22')]=function(_0x5edabe,_0x335ff6){if(_0x5edabe['body']['id']){delete _0x5edabe[_0xf989('0x46')]['id'];}return db[_0xf989('0x3c')]['find']({'where':{'id':_0x5edabe[_0xf989('0x42')]['id']}})[_0xf989('0x23')](handleEntityNotFound(_0x335ff6,null))[_0xf989('0x23')](saveUpdates(_0x5edabe['body'],null))[_0xf989('0x23')](respondWithResult(_0x335ff6,null))[_0xf989('0x40')](handleError(_0x335ff6,null));};exports['destroy']=function(_0x3239c8,_0x57a64d){return db[_0xf989('0x3c')][_0xf989('0x44')]({'where':{'id':_0x3239c8[_0xf989('0x42')]['id']}})[_0xf989('0x23')](handleEntityNotFound(_0x57a64d,null))['then'](removeEntity(_0x57a64d,null))[_0xf989('0x40')](handleError(_0x57a64d,null));}; \ No newline at end of file +var _0x43ef=['map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','save','update','then','destroy','error','stack','name','send','index','SalesforceField','fieldName','type','key'];(function(_0x1302e6,_0x164ca9){var _0x1fbec8=function(_0x3aa830){while(--_0x3aa830){_0x1302e6['push'](_0x1302e6['shift']());}};_0x1fbec8(++_0x164ca9);}(_0x43ef,0x17d));var _0xf43e=function(_0x42c3e7,_0x530b19){_0x42c3e7=_0x42c3e7-0x0;var _0x35d2b3=_0x43ef[_0x42c3e7];return _0x35d2b3;};'use strict';var emlformat=require(_0xf43e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf43e('0x1'));var jsonpatch=require(_0xf43e('0x2'));var rp=require(_0xf43e('0x3'));var moment=require('moment');var BPromise=require(_0xf43e('0x4'));var Mustache=require(_0xf43e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf43e('0x6'));var csv=require(_0xf43e('0x7'));var ejs=require(_0xf43e('0x8'));var fs=require('fs');var fs_extra=require(_0xf43e('0x9'));var _=require('lodash');var squel=require(_0xf43e('0xa'));var crypto=require(_0xf43e('0xb'));var jsforce=require(_0xf43e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf43e('0x7'));var querystring=require('querystring');var Papa=require(_0xf43e('0xd'));var Redis=require(_0xf43e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf43e('0xf'));var hardwareService=require(_0xf43e('0x10'));var logger=require(_0xf43e('0x11'))(_0xf43e('0x12'));var utils=require(_0xf43e('0x13'));var config=require(_0xf43e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf43e('0x15'))['db'];function respondWithStatusCode(_0x528821,_0x398ed0){_0x398ed0=_0x398ed0||0xcc;return function(_0x30e266){if(_0x30e266){return _0x528821[_0xf43e('0x16')](_0x398ed0);}return _0x528821['status'](_0x398ed0)[_0xf43e('0x17')]();};}function respondWithResult(_0xb96f13,_0x5d8ece){_0x5d8ece=_0x5d8ece||0xc8;return function(_0x5bf32d){if(_0x5bf32d){return _0xb96f13['status'](_0x5d8ece)[_0xf43e('0x18')](_0x5bf32d);}};}function respondWithFilteredResult(_0x4f7d3d,_0x437e89){return function(_0x1948be){if(_0x1948be){var _0x4f5cdb=typeof _0x437e89[_0xf43e('0x19')]==='undefined'&&typeof _0x437e89[_0xf43e('0x1a')]===_0xf43e('0x1b');var _0x3d8b4f=_0x1948be[_0xf43e('0x1c')];var _0x41d03c=_0x4f5cdb?0x0:_0x437e89[_0xf43e('0x19')];var _0x459834=_0x4f5cdb?_0x1948be['count']:_0x437e89['offset']+_0x437e89[_0xf43e('0x1a')];var _0x461b21;if(_0x459834>=_0x3d8b4f){_0x459834=_0x3d8b4f;_0x461b21=0xc8;}else{_0x461b21=0xce;}_0x4f7d3d[_0xf43e('0x1d')](_0x461b21);return _0x4f7d3d[_0xf43e('0x1e')]('Content-Range',_0x41d03c+'-'+_0x459834+'/'+_0x3d8b4f)[_0xf43e('0x18')](_0x1948be);}return null;};}function patchUpdates(_0x4697ab){return function(_0x210f74){try{jsonpatch[_0xf43e('0x1f')](_0x210f74,_0x4697ab,!![]);}catch(_0x367627){return BPromise['reject'](_0x367627);}return _0x210f74[_0xf43e('0x20')]();};}function saveUpdates(_0x46b4fe,_0x462435){return function(_0x29b0f5){if(_0x29b0f5){return _0x29b0f5[_0xf43e('0x21')](_0x46b4fe)[_0xf43e('0x22')](function(_0x53777d){return _0x53777d;});}return null;};}function removeEntity(_0x2a902a,_0x5c3e3b){return function(_0x5da35f){if(_0x5da35f){return _0x5da35f[_0xf43e('0x23')]()[_0xf43e('0x22')](function(){_0x2a902a[_0xf43e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4efc59,_0x311a50){return function(_0x4ca9c4){if(!_0x4ca9c4){_0x4efc59[_0xf43e('0x16')](0x194);}return _0x4ca9c4;};}function handleError(_0x2b1bcf,_0x3eb589){_0x3eb589=_0x3eb589||0x1f4;return function(_0x4ee0a6){logger[_0xf43e('0x24')](_0x4ee0a6[_0xf43e('0x25')]);if(_0x4ee0a6[_0xf43e('0x26')]){delete _0x4ee0a6[_0xf43e('0x26')];}_0x2b1bcf['status'](_0x3eb589)[_0xf43e('0x27')](_0x4ee0a6);};}exports[_0xf43e('0x28')]=function(_0xe95a8a,_0x13b195){var _0x449a01={},_0x4ab12b={},_0x193d2e={'count':0x0,'rows':[]};var _0x150e1b=_['map'](db[_0xf43e('0x29')]['rawAttributes'],function(_0x191cfa){return{'name':_0x191cfa[_0xf43e('0x2a')],'type':_0x191cfa[_0xf43e('0x2b')][_0xf43e('0x2c')]};});_0x4ab12b['model']=_[_0xf43e('0x2d')](_0x150e1b,_0xf43e('0x26'));_0x4ab12b['query']=_[_0xf43e('0x2e')](_0xe95a8a[_0xf43e('0x2f')]);_0x4ab12b[_0xf43e('0x30')]=_[_0xf43e('0x31')](_0x4ab12b[_0xf43e('0x32')],_0x4ab12b[_0xf43e('0x2f')]);_0x449a01[_0xf43e('0x33')]=_[_0xf43e('0x31')](_0x4ab12b[_0xf43e('0x32')],qs[_0xf43e('0x34')](_0xe95a8a[_0xf43e('0x2f')][_0xf43e('0x34')]));_0x449a01[_0xf43e('0x33')]=_0x449a01[_0xf43e('0x33')][_0xf43e('0x35')]?_0x449a01[_0xf43e('0x33')]:_0x4ab12b[_0xf43e('0x32')];if(!_0xe95a8a['query'][_0xf43e('0x36')](_0xf43e('0x37'))){_0x449a01[_0xf43e('0x1a')]=qs[_0xf43e('0x1a')](_0xe95a8a[_0xf43e('0x2f')][_0xf43e('0x1a')]);_0x449a01['offset']=qs[_0xf43e('0x19')](_0xe95a8a[_0xf43e('0x2f')][_0xf43e('0x19')]);}_0x449a01['order']=qs[_0xf43e('0x38')](_0xe95a8a['query']['sort']);_0x449a01['where']=qs[_0xf43e('0x30')](_['pick'](_0xe95a8a[_0xf43e('0x2f')],_0x4ab12b[_0xf43e('0x30')]),_0x150e1b);if(_0xe95a8a[_0xf43e('0x2f')]['filter']){_0x449a01[_0xf43e('0x39')]=_[_0xf43e('0x3a')](_0x449a01[_0xf43e('0x39')],{'$or':_[_0xf43e('0x2d')](_0x150e1b,function(_0x5bcb7e){if(_0x5bcb7e['type']!==_0xf43e('0x3b')){var _0x1dee59={};_0x1dee59[_0x5bcb7e[_0xf43e('0x26')]]={'$like':'%'+_0xe95a8a[_0xf43e('0x2f')][_0xf43e('0x3c')]+'%'};return _0x1dee59;}})});}_0x449a01=_[_0xf43e('0x3a')]({},_0x449a01,_0xe95a8a['options']);var _0x2c1f0c={'where':_0x449a01['where']};return db[_0xf43e('0x29')][_0xf43e('0x1c')](_0x2c1f0c)['then'](function(_0x230c11){_0x193d2e[_0xf43e('0x1c')]=_0x230c11;if(_0xe95a8a[_0xf43e('0x2f')][_0xf43e('0x3d')]){_0x449a01[_0xf43e('0x3e')]=[{'all':!![]}];}return db['SalesforceField'][_0xf43e('0x3f')](_0x449a01);})[_0xf43e('0x22')](function(_0x2cf2d1){_0x193d2e[_0xf43e('0x40')]=_0x2cf2d1;return _0x193d2e;})[_0xf43e('0x22')](respondWithFilteredResult(_0x13b195,_0x449a01))[_0xf43e('0x41')](handleError(_0x13b195,null));};exports['show']=function(_0x1e25ac,_0x2734c2){var _0x1f89eb={'raw':!![],'where':{'id':_0x1e25ac[_0xf43e('0x42')]['id']}},_0x1cf810={};_0x1cf810[_0xf43e('0x32')]=_[_0xf43e('0x2e')](db['SalesforceField'][_0xf43e('0x43')]);_0x1cf810[_0xf43e('0x2f')]=_['keys'](_0x1e25ac['query']);_0x1cf810[_0xf43e('0x30')]=_[_0xf43e('0x31')](_0x1cf810[_0xf43e('0x32')],_0x1cf810['query']);_0x1f89eb[_0xf43e('0x33')]=_[_0xf43e('0x31')](_0x1cf810[_0xf43e('0x32')],qs['fields'](_0x1e25ac[_0xf43e('0x2f')][_0xf43e('0x34')]));_0x1f89eb[_0xf43e('0x33')]=_0x1f89eb[_0xf43e('0x33')]['length']?_0x1f89eb[_0xf43e('0x33')]:_0x1cf810[_0xf43e('0x32')];if(_0x1e25ac['query']['includeAll']){_0x1f89eb[_0xf43e('0x3e')]=[{'all':!![]}];}_0x1f89eb=_[_0xf43e('0x3a')]({},_0x1f89eb,_0x1e25ac[_0xf43e('0x44')]);return db['SalesforceField'][_0xf43e('0x45')](_0x1f89eb)[_0xf43e('0x22')](handleEntityNotFound(_0x2734c2,null))[_0xf43e('0x22')](respondWithResult(_0x2734c2,null))[_0xf43e('0x41')](handleError(_0x2734c2,null));};exports['create']=function(_0x4a73f4,_0x52d2f4){return db[_0xf43e('0x29')]['create'](_0x4a73f4[_0xf43e('0x46')],{})['then'](respondWithResult(_0x52d2f4,0xc9))[_0xf43e('0x41')](handleError(_0x52d2f4,null));};exports[_0xf43e('0x21')]=function(_0xdfec36,_0x39388){if(_0xdfec36[_0xf43e('0x46')]['id']){delete _0xdfec36['body']['id'];}return db[_0xf43e('0x29')][_0xf43e('0x45')]({'where':{'id':_0xdfec36['params']['id']}})['then'](handleEntityNotFound(_0x39388,null))[_0xf43e('0x22')](saveUpdates(_0xdfec36[_0xf43e('0x46')],null))[_0xf43e('0x22')](respondWithResult(_0x39388,null))[_0xf43e('0x41')](handleError(_0x39388,null));};exports['destroy']=function(_0xee6d13,_0x763fbb){return db['SalesforceField'][_0xf43e('0x45')]({'where':{'id':_0xee6d13[_0xf43e('0x42')]['id']}})[_0xf43e('0x22')](handleEntityNotFound(_0x763fbb,null))['then'](removeEntity(_0x763fbb,null))[_0xf43e('0x41')](handleError(_0x763fbb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f2560c4..0e4613f 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 _0x1bbe=['moment','request-promise','path','rimraf','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x160374,_0x5d6cf2){var _0x1d388c=function(_0x321f40){while(--_0x321f40){_0x160374['push'](_0x160374['shift']());}};_0x1d388c(++_0x5d6cf2);}(_0x1bbe,0x122));var _0xe1bb=function(_0x1ec65c,_0x354923){_0x1ec65c=_0x1ec65c-0x0;var _0x5249c2=_0x1bbe[_0x1ec65c];return _0x5249c2;};'use strict';var _=require(_0xe1bb('0x0'));var util=require(_0xe1bb('0x1'));var logger=require(_0xe1bb('0x2'))(_0xe1bb('0x3'));var moment=require(_0xe1bb('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1bb('0x5'));var fs=require('fs');var path=require(_0xe1bb('0x6'));var rimraf=require(_0xe1bb('0x7'));var config=require('../../config/environment');var attributes=require(_0xe1bb('0x8'));module['exports']=function(_0x53b118,_0x36bd60){return _0x53b118[_0xe1bb('0x9')]('SalesforceField',attributes,{'tableName':_0xe1bb('0xa'),'paranoid':![],'indexes':[{'name':_0xe1bb('0xb'),'fields':[_0xe1bb('0xc'),_0xe1bb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x12fc=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bec38,_0x58499f){var _0x35b79e=function(_0x49def2){while(--_0x49def2){_0x1bec38['push'](_0x1bec38['shift']());}};_0x35b79e(++_0x58499f);}(_0x12fc,0xf8));var _0xc12f=function(_0x5220f6,_0x52ac42){_0x5220f6=_0x5220f6-0x0;var _0x5baa22=_0x12fc[_0x5220f6];return _0x5baa22;};'use strict';var _=require(_0xc12f('0x0'));var util=require('util');var logger=require(_0xc12f('0x1'))(_0xc12f('0x2'));var moment=require(_0xc12f('0x3'));var BPromise=require(_0xc12f('0x4'));var rp=require(_0xc12f('0x5'));var fs=require('fs');var path=require(_0xc12f('0x6'));var rimraf=require(_0xc12f('0x7'));var config=require(_0xc12f('0x8'));var attributes=require(_0xc12f('0x9'));module[_0xc12f('0xa')]=function(_0x32f9f6,_0x52bc30){return _0x32f9f6[_0xc12f('0xb')](_0xc12f('0xc'),attributes,{'tableName':_0xc12f('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xc12f('0xe'),_0xc12f('0xf')],'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 7345e38..ee5a729 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 _0x3106=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x363c5d,_0x4ac556){var _0x3e4017=function(_0x58e415){while(--_0x58e415){_0x363c5d['push'](_0x363c5d['shift']());}};_0x3e4017(++_0x4ac556);}(_0x3106,0xe1));var _0x6310=function(_0x17265f,_0xaa2d9d){_0x17265f=_0x17265f-0x0;var _0x40f4cf=_0x3106[_0x17265f];return _0x40f4cf;};'use strict';var _=require(_0x6310('0x0'));var util=require(_0x6310('0x1'));var moment=require(_0x6310('0x2'));var BPromise=require(_0x6310('0x3'));var rs=require(_0x6310('0x4'));var fs=require('fs');var Redis=require(_0x6310('0x5'));var db=require(_0x6310('0x6'))['db'];var utils=require(_0x6310('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6310('0x8'));var jayson=require(_0x6310('0x9'));var client=jayson[_0x6310('0xa')][_0x6310('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4755ea,_0x5dd711,_0x1c4cc7){return new BPromise(function(_0x371929,_0x1f81d2){return client[_0x6310('0xc')](_0x4755ea,_0x1c4cc7)[_0x6310('0xd')](function(_0x246310){logger['info'](_0x6310('0xe'),_0x5dd711,'request\x20sent');logger[_0x6310('0xf')](_0x6310('0x10'),_0x5dd711,'request\x20sent',JSON[_0x6310('0x11')](_0x246310));if(_0x246310[_0x6310('0x12')]){if(_0x246310[_0x6310('0x12')][_0x6310('0x13')]===0x1f4){logger[_0x6310('0x12')](_0x6310('0xe'),_0x5dd711,_0x246310[_0x6310('0x12')]['message']);return _0x1f81d2(_0x246310['error']['message']);}logger[_0x6310('0x12')](_0x6310('0xe'),_0x5dd711,_0x246310['error'][_0x6310('0x14')]);return _0x371929(_0x246310[_0x6310('0x12')][_0x6310('0x14')]);}else{logger[_0x6310('0x15')](_0x6310('0xe'),_0x5dd711,_0x6310('0x16'));_0x371929(_0x246310[_0x6310('0x17')]['message']);}})[_0x6310('0x18')](function(_0x1ed6af){logger[_0x6310('0x12')](_0x6310('0xe'),_0x5dd711,_0x1ed6af);_0x1f81d2(_0x1ed6af);});});} \ No newline at end of file +var _0x8d9e=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x57fd55,_0x485be1){var _0x3794e8=function(_0x4275f5){while(--_0x4275f5){_0x57fd55['push'](_0x57fd55['shift']());}};_0x3794e8(++_0x485be1);}(_0x8d9e,0x171));var _0xe8d9=function(_0xe1de05,_0x4c280e){_0xe1de05=_0xe1de05-0x0;var _0x339742=_0x8d9e[_0xe1de05];return _0x339742;};'use strict';var _=require(_0xe8d9('0x0'));var util=require(_0xe8d9('0x1'));var moment=require(_0xe8d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8d9('0x3'));var fs=require('fs');var Redis=require(_0xe8d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8d9('0x5'));var logger=require(_0xe8d9('0x6'))(_0xe8d9('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8d9('0x8'));var client=jayson[_0xe8d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x635d14,_0x20739b,_0x4e0fdb){return new BPromise(function(_0x5d8ee5,_0x3515c3){return client[_0xe8d9('0xa')](_0x635d14,_0x4e0fdb)[_0xe8d9('0xb')](function(_0x380562){logger[_0xe8d9('0xc')](_0xe8d9('0xd'),_0x20739b,_0xe8d9('0xe'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x20739b,_0xe8d9('0xe'),JSON[_0xe8d9('0xf')](_0x380562));if(_0x380562[_0xe8d9('0x10')]){if(_0x380562[_0xe8d9('0x10')][_0xe8d9('0x11')]===0x1f4){logger[_0xe8d9('0x10')](_0xe8d9('0xd'),_0x20739b,_0x380562[_0xe8d9('0x10')][_0xe8d9('0x12')]);return _0x3515c3(_0x380562[_0xe8d9('0x10')]['message']);}logger[_0xe8d9('0x10')](_0xe8d9('0xd'),_0x20739b,_0x380562[_0xe8d9('0x10')]['message']);return _0x5d8ee5(_0x380562[_0xe8d9('0x10')][_0xe8d9('0x12')]);}else{logger[_0xe8d9('0xc')](_0xe8d9('0xd'),_0x20739b,_0xe8d9('0xe'));_0x5d8ee5(_0x380562['result'][_0xe8d9('0x12')]);}})[_0xe8d9('0x13')](function(_0xfda300){logger[_0xe8d9('0x10')](_0xe8d9('0xd'),_0x20739b,_0xfda300);_0x3515c3(_0xfda300);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 3d6ed15..c1c0da7 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 _0x70fe=['show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1a2c6f,_0x15cb40){var _0x1f4b66=function(_0x5cdbe0){while(--_0x5cdbe0){_0x1a2c6f['push'](_0x1a2c6f['shift']());}};_0x1f4b66(++_0x15cb40);}(_0x70fe,0x1d6));var _0xe70f=function(_0x18c4bf,_0x56dfe5){_0x18c4bf=_0x18c4bf-0x0;var _0x5c9674=_0x70fe[_0x18c4bf];return _0x5c9674;};'use strict';var multer=require(_0xe70f('0x0'));var util=require(_0xe70f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe70f('0x2'));var router=express[_0xe70f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe70f('0x4'));var interaction=require(_0xe70f('0x5'));var config=require(_0xe70f('0x6'));var controller=require('./intServicenowAccount.controller');router[_0xe70f('0x7')]('/',auth[_0xe70f('0x8')](),controller['index']);router[_0xe70f('0x7')](_0xe70f('0x9'),auth['isAuthenticated'](),controller[_0xe70f('0xa')]);router[_0xe70f('0x7')](_0xe70f('0xb'),auth['isAuthenticated'](),controller[_0xe70f('0xc')]);router[_0xe70f('0x7')]('/:id/fields',auth[_0xe70f('0x8')](),controller['getFields']);router[_0xe70f('0xd')]('/',auth[_0xe70f('0x8')](),controller[_0xe70f('0xe')]);router[_0xe70f('0xd')]('/:id/configurations',auth[_0xe70f('0x8')](),controller[_0xe70f('0xf')]);router[_0xe70f('0x10')](_0xe70f('0x9'),auth[_0xe70f('0x8')](),controller[_0xe70f('0x11')]);router[_0xe70f('0x12')]('/:id',auth[_0xe70f('0x8')](),controller[_0xe70f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x68c0=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get'];(function(_0x4fc1e4,_0x3a8d17){var _0x48517f=function(_0x2d8eb2){while(--_0x2d8eb2){_0x4fc1e4['push'](_0x4fc1e4['shift']());}};_0x48517f(++_0x3a8d17);}(_0x68c0,0x1c5));var _0x068c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x68c0[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x068c('0x0'));var util=require(_0x068c('0x1'));var path=require('path');var timeout=require(_0x068c('0x2'));var express=require(_0x068c('0x3'));var router=express[_0x068c('0x4')]();var fs_extra=require(_0x068c('0x5'));var auth=require(_0x068c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x068c('0x7'));router[_0x068c('0x8')]('/',auth[_0x068c('0x9')](),controller[_0x068c('0xa')]);router[_0x068c('0x8')](_0x068c('0xb'),auth['isAuthenticated'](),controller[_0x068c('0xc')]);router[_0x068c('0x8')](_0x068c('0xd'),auth[_0x068c('0x9')](),controller[_0x068c('0xe')]);router[_0x068c('0x8')](_0x068c('0xf'),auth[_0x068c('0x9')](),controller[_0x068c('0x10')]);router[_0x068c('0x11')]('/',auth[_0x068c('0x9')](),controller['create']);router[_0x068c('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x068c('0x12')]);router[_0x068c('0x13')](_0x068c('0xb'),auth[_0x068c('0x9')](),controller[_0x068c('0x14')]);router[_0x068c('0x15')](_0x068c('0xb'),auth[_0x068c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index c57a5c0..8a6cea6 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 _0x4d74=['exports','STRING','username','sequelize'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x4d74,0x17b));var _0x44d7=function(_0x9f6f64,_0x4cd6df){_0x9f6f64=_0x9f6f64-0x0;var _0x3b9f5c=_0x4d74[_0x9f6f64];return _0x3b9f5c;};'use strict';var Sequelize=require(_0x44d7('0x0'));module[_0x44d7('0x1')]={'name':{'type':Sequelize[_0x44d7('0x2')]},'description':{'type':Sequelize[_0x44d7('0x2')]},'username':{'type':Sequelize[_0x44d7('0x2')],'unique':_0x44d7('0x3')},'password':{'type':Sequelize[_0x44d7('0x2')]},'email':{'type':Sequelize[_0x44d7('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x44d7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x9daf=['STRING','username','remoteUri'];(function(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_0x9daf,0xde));var _0xf9da=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x9daf[_0x400b43];return _0x3c330f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf9da('0x0')]},'description':{'type':Sequelize[_0xf9da('0x0')]},'username':{'type':Sequelize[_0xf9da('0x0')],'unique':_0xf9da('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf9da('0x0')]},'remoteUri':{'type':Sequelize[_0xf9da('0x0')],'unique':_0xf9da('0x2')},'serverUrl':{'type':Sequelize[_0xf9da('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index cbd7d83..499e671 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 _0xbb55=['business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','sla_due','due_date','reopen_count','sys_tags','upon_approval','location','category','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','push','concat','ServiceNow\x20error:\x20','error','send','test','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','fieldName','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','ServicenowAccount','includeAll','findAll','rows','params','rawAttributes','include','find','catch','create','body','destroy','getConfigurations','findOne','hasOwnProperty','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','parent','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','impact','active','work_notes_list'];(function(_0x5a38d4,_0x537985){var _0x5ae7ab=function(_0x53df6f){while(--_0x53df6f){_0x5a38d4['push'](_0x5a38d4['shift']());}};_0x5ae7ab(++_0x537985);}(_0xbb55,0xff));var _0x5bb5=function(_0x20c7c1,_0x16189f){_0x20c7c1=_0x20c7c1-0x0;var _0x505820=_0xbb55[_0x20c7c1];return _0x505820;};'use strict';var emlformat=require(_0x5bb5('0x0'));var rimraf=require(_0x5bb5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bb5('0x2'));var rp=require(_0x5bb5('0x3'));var moment=require(_0x5bb5('0x4'));var BPromise=require(_0x5bb5('0x5'));var Mustache=require(_0x5bb5('0x6'));var util=require(_0x5bb5('0x7'));var path=require(_0x5bb5('0x8'));var sox=require(_0x5bb5('0x9'));var csv=require(_0x5bb5('0xa'));var ejs=require(_0x5bb5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5bb5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5bb5('0xd'));var deskjs=require(_0x5bb5('0xe'));var toCsv=require(_0x5bb5('0xa'));var querystring=require(_0x5bb5('0xf'));var Papa=require(_0x5bb5('0x10'));var Redis=require('ioredis');var authService=require(_0x5bb5('0x11'));var qs=require(_0x5bb5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bb5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5bb5('0x14'));var config=require(_0x5bb5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bb5('0x16'))['db'];var integrations=require(_0x5bb5('0x17'));function respondWithStatusCode(_0xa8917f,_0x21f741){_0x21f741=_0x21f741||0xcc;return function(_0x1afc1f){if(_0x1afc1f){return _0xa8917f[_0x5bb5('0x18')](_0x21f741);}return _0xa8917f[_0x5bb5('0x19')](_0x21f741)[_0x5bb5('0x1a')]();};}function respondWithResult(_0x289452,_0x38242e){_0x38242e=_0x38242e||0xc8;return function(_0x44ada0){if(_0x44ada0){return _0x289452[_0x5bb5('0x19')](_0x38242e)[_0x5bb5('0x1b')](_0x44ada0);}};}function respondWithFilteredResult(_0x5bd230,_0x3d68f7){return function(_0x29dd6c){if(_0x29dd6c){var _0x4e34c1=typeof _0x3d68f7[_0x5bb5('0x1c')]===_0x5bb5('0x1d')&&typeof _0x3d68f7['limit']===_0x5bb5('0x1d');var _0x4a8b1c=_0x29dd6c[_0x5bb5('0x1e')];var _0x1199b2=_0x4e34c1?0x0:_0x3d68f7['offset'];var _0x4c9634=_0x4e34c1?_0x29dd6c[_0x5bb5('0x1e')]:_0x3d68f7[_0x5bb5('0x1c')]+_0x3d68f7[_0x5bb5('0x1f')];var _0x3df749;if(_0x4c9634>=_0x4a8b1c){_0x4c9634=_0x4a8b1c;_0x3df749=0xc8;}else{_0x3df749=0xce;}_0x5bd230[_0x5bb5('0x19')](_0x3df749);return _0x5bd230[_0x5bb5('0x20')](_0x5bb5('0x21'),_0x1199b2+'-'+_0x4c9634+'/'+_0x4a8b1c)['json'](_0x29dd6c);}return null;};}function patchUpdates(_0x1b5029){return function(_0x35ecc0){try{jsonpatch[_0x5bb5('0x22')](_0x35ecc0,_0x1b5029,!![]);}catch(_0x22bcda){return BPromise[_0x5bb5('0x23')](_0x22bcda);}return _0x35ecc0[_0x5bb5('0x24')]();};}function saveUpdates(_0x25bada,_0x26e523){return function(_0x1abe3e){if(_0x1abe3e){return _0x1abe3e[_0x5bb5('0x25')](_0x25bada)[_0x5bb5('0x26')](function(_0x4363cf){return _0x4363cf;});}return null;};}function removeEntity(_0x103e78,_0x6dce7a){return function(_0x415059){if(_0x415059){return _0x415059['destroy']()[_0x5bb5('0x26')](function(){_0x103e78[_0x5bb5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d361d,_0x3be658){return function(_0x1222c5){if(!_0x1222c5){_0x1d361d[_0x5bb5('0x18')](0x194);}return _0x1222c5;};}function handleError(_0x3cd332,_0x26dd92){_0x26dd92=_0x26dd92||0x1f4;return function(_0x4925e9){logger['error'](_0x4925e9[_0x5bb5('0x27')]);if(_0x4925e9[_0x5bb5('0x28')]){delete _0x4925e9[_0x5bb5('0x28')];}_0x3cd332['status'](_0x26dd92)['send'](_0x4925e9);};}exports[_0x5bb5('0x29')]=function(_0x56a5c3,_0x3a21ff){var _0x3271a1={},_0x18ed3f={},_0x2dbfd3={'count':0x0,'rows':[]};var _0x487534=_[_0x5bb5('0x2a')](db['ServicenowAccount']['rawAttributes'],function(_0x4aaa47){return{'name':_0x4aaa47[_0x5bb5('0x2b')],'type':_0x4aaa47['type'][_0x5bb5('0x2c')]};});_0x18ed3f[_0x5bb5('0x2d')]=_[_0x5bb5('0x2a')](_0x487534,_0x5bb5('0x28'));_0x18ed3f['query']=_[_0x5bb5('0x2e')](_0x56a5c3[_0x5bb5('0x2f')]);_0x18ed3f['filters']=_['intersection'](_0x18ed3f[_0x5bb5('0x2d')],_0x18ed3f[_0x5bb5('0x2f')]);_0x3271a1[_0x5bb5('0x30')]=_[_0x5bb5('0x31')](_0x18ed3f[_0x5bb5('0x2d')],qs['fields'](_0x56a5c3[_0x5bb5('0x2f')][_0x5bb5('0x32')]));_0x3271a1[_0x5bb5('0x30')]=_0x3271a1['attributes'][_0x5bb5('0x33')]?_0x3271a1[_0x5bb5('0x30')]:_0x18ed3f[_0x5bb5('0x2d')];if(!_0x56a5c3[_0x5bb5('0x2f')]['hasOwnProperty'](_0x5bb5('0x34'))){_0x3271a1[_0x5bb5('0x1f')]=qs[_0x5bb5('0x1f')](_0x56a5c3['query'][_0x5bb5('0x1f')]);_0x3271a1[_0x5bb5('0x1c')]=qs['offset'](_0x56a5c3[_0x5bb5('0x2f')]['offset']);}_0x3271a1[_0x5bb5('0x35')]=qs[_0x5bb5('0x36')](_0x56a5c3[_0x5bb5('0x2f')]['sort']);_0x3271a1['where']=qs[_0x5bb5('0x37')](_[_0x5bb5('0x38')](_0x56a5c3[_0x5bb5('0x2f')],_0x18ed3f[_0x5bb5('0x37')]),_0x487534);if(_0x56a5c3['query'][_0x5bb5('0x39')]){_0x3271a1[_0x5bb5('0x3a')]=_[_0x5bb5('0x3b')](_0x3271a1[_0x5bb5('0x3a')],{'$or':_['map'](_0x487534,function(_0x3d7ef2){if(_0x3d7ef2['type']!==_0x5bb5('0x3c')){var _0x2d0f3e={};_0x2d0f3e[_0x3d7ef2[_0x5bb5('0x28')]]={'$like':'%'+_0x56a5c3[_0x5bb5('0x2f')][_0x5bb5('0x39')]+'%'};return _0x2d0f3e;}})});}_0x3271a1=_[_0x5bb5('0x3b')]({},_0x3271a1,_0x56a5c3[_0x5bb5('0x3d')]);var _0x20504b={'where':_0x3271a1[_0x5bb5('0x3a')]};return db[_0x5bb5('0x3e')][_0x5bb5('0x1e')](_0x20504b)[_0x5bb5('0x26')](function(_0x1b1e30){_0x2dbfd3['count']=_0x1b1e30;if(_0x56a5c3[_0x5bb5('0x2f')][_0x5bb5('0x3f')]){_0x3271a1['include']=[{'all':!![]}];}return db[_0x5bb5('0x3e')][_0x5bb5('0x40')](_0x3271a1);})[_0x5bb5('0x26')](function(_0x56d5b5){_0x2dbfd3[_0x5bb5('0x41')]=_0x56d5b5;return _0x2dbfd3;})[_0x5bb5('0x26')](respondWithFilteredResult(_0x3a21ff,_0x3271a1))['catch'](handleError(_0x3a21ff,null));};exports['show']=function(_0xb9a9a5,_0x32f163){var _0x5ecccb={'raw':![],'where':{'id':_0xb9a9a5[_0x5bb5('0x42')]['id']}},_0x405e67={};_0x405e67[_0x5bb5('0x2d')]=_[_0x5bb5('0x2e')](db[_0x5bb5('0x3e')][_0x5bb5('0x43')]);_0x405e67[_0x5bb5('0x2f')]=_['keys'](_0xb9a9a5['query']);_0x405e67[_0x5bb5('0x37')]=_['intersection'](_0x405e67[_0x5bb5('0x2d')],_0x405e67[_0x5bb5('0x2f')]);_0x5ecccb[_0x5bb5('0x30')]=_[_0x5bb5('0x31')](_0x405e67[_0x5bb5('0x2d')],qs[_0x5bb5('0x32')](_0xb9a9a5[_0x5bb5('0x2f')]['fields']));_0x5ecccb[_0x5bb5('0x30')]=_0x5ecccb['attributes']['length']?_0x5ecccb[_0x5bb5('0x30')]:_0x405e67[_0x5bb5('0x2d')];if(_0xb9a9a5[_0x5bb5('0x2f')]['includeAll']){_0x5ecccb[_0x5bb5('0x44')]=[{'all':!![]}];}_0x5ecccb=_[_0x5bb5('0x3b')]({},_0x5ecccb,_0xb9a9a5['options']);return db['ServicenowAccount'][_0x5bb5('0x45')](_0x5ecccb)[_0x5bb5('0x26')](handleEntityNotFound(_0x32f163,null))['then'](respondWithResult(_0x32f163,null))[_0x5bb5('0x46')](handleError(_0x32f163,null));};exports[_0x5bb5('0x47')]=function(_0x59bf43,_0x4f8e97){return db[_0x5bb5('0x3e')][_0x5bb5('0x47')](_0x59bf43[_0x5bb5('0x48')],{})[_0x5bb5('0x26')](respondWithResult(_0x4f8e97,0xc9))['catch'](handleError(_0x4f8e97,null));};exports[_0x5bb5('0x25')]=function(_0x3bc9a1,_0x286c0f){if(_0x3bc9a1[_0x5bb5('0x48')]['id']){delete _0x3bc9a1[_0x5bb5('0x48')]['id'];}return db['ServicenowAccount'][_0x5bb5('0x45')]({'where':{'id':_0x3bc9a1[_0x5bb5('0x42')]['id']}})[_0x5bb5('0x26')](handleEntityNotFound(_0x286c0f,null))['then'](saveUpdates(_0x3bc9a1[_0x5bb5('0x48')],null))[_0x5bb5('0x26')](respondWithResult(_0x286c0f,null))[_0x5bb5('0x46')](handleError(_0x286c0f,null));};exports[_0x5bb5('0x49')]=function(_0x5776db,_0x2b67fc){return db[_0x5bb5('0x3e')][_0x5bb5('0x45')]({'where':{'id':_0x5776db[_0x5bb5('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b67fc,null))[_0x5bb5('0x26')](removeEntity(_0x2b67fc,null))[_0x5bb5('0x46')](handleError(_0x2b67fc,null));};exports[_0x5bb5('0x4a')]=function(_0x5ed465,_0x315594,_0x568900){var _0x516f2f={};var _0x4a335a={};var _0x9a92cc;var _0x474900;return db[_0x5bb5('0x3e')][_0x5bb5('0x4b')]({'where':{'id':_0x5ed465[_0x5bb5('0x42')]['id']}})['then'](handleEntityNotFound(_0x315594,null))['then'](function(_0x5addaa){if(_0x5addaa){_0x9a92cc=_0x5addaa;_0x4a335a['model']=_[_0x5bb5('0x2e')](db['ServicenowConfiguration'][_0x5bb5('0x43')]);_0x4a335a[_0x5bb5('0x2f')]=_['keys'](_0x5ed465['query']);_0x4a335a['filters']=_[_0x5bb5('0x31')](_0x4a335a[_0x5bb5('0x2d')],_0x4a335a[_0x5bb5('0x2f')]);_0x516f2f[_0x5bb5('0x30')]=_[_0x5bb5('0x31')](_0x4a335a['model'],qs[_0x5bb5('0x32')](_0x5ed465[_0x5bb5('0x2f')][_0x5bb5('0x32')]));_0x516f2f[_0x5bb5('0x30')]=_0x516f2f[_0x5bb5('0x30')][_0x5bb5('0x33')]?_0x516f2f['attributes']:_0x4a335a[_0x5bb5('0x2d')];_0x516f2f[_0x5bb5('0x35')]=qs['sort'](_0x5ed465[_0x5bb5('0x2f')]['sort']);_0x516f2f[_0x5bb5('0x3a')]=qs['filters'](_[_0x5bb5('0x38')](_0x5ed465['query'],_0x4a335a[_0x5bb5('0x37')]));if(_0x5ed465[_0x5bb5('0x2f')][_0x5bb5('0x39')]){_0x516f2f[_0x5bb5('0x3a')]=_[_0x5bb5('0x3b')](_0x516f2f['where'],{'$or':_['map'](_0x516f2f[_0x5bb5('0x30')],function(_0xe0820b){var _0x363d53={};_0x363d53[_0xe0820b]={'$like':'%'+_0x5ed465['query']['filter']+'%'};return _0x363d53;})});}_0x516f2f=_[_0x5bb5('0x3b')]({},_0x516f2f,_0x5ed465[_0x5bb5('0x3d')]);return _0x9a92cc['getConfigurations'](_0x516f2f);}})[_0x5bb5('0x26')](function(_0x3a9b0a){if(_0x3a9b0a){_0x474900=_0x3a9b0a[_0x5bb5('0x33')];if(!_0x5ed465[_0x5bb5('0x2f')][_0x5bb5('0x4c')](_0x5bb5('0x34'))){_0x516f2f[_0x5bb5('0x1f')]=qs[_0x5bb5('0x1f')](_0x5ed465['query'][_0x5bb5('0x1f')]);_0x516f2f[_0x5bb5('0x1c')]=qs[_0x5bb5('0x1c')](_0x5ed465[_0x5bb5('0x2f')]['offset']);}return _0x9a92cc[_0x5bb5('0x4a')](_0x516f2f);}})[_0x5bb5('0x26')](function(_0xbd9c4a){if(_0xbd9c4a){return _0xbd9c4a?{'count':_0x474900,'rows':_0xbd9c4a}:null;}})[_0x5bb5('0x26')](respondWithResult(_0x315594,null))[_0x5bb5('0x46')](handleError(_0x315594,null));};exports['addConfiguration']=function(_0x6c3c78,_0x465686,_0x5dc382){if(_0x6c3c78['body']['id']){delete _0x6c3c78[_0x5bb5('0x48')]['id'];}return db[_0x5bb5('0x3e')][_0x5bb5('0x4b')]({'where':{'id':_0x6c3c78[_0x5bb5('0x42')]['id']}})['then'](handleEntityNotFound(_0x465686,null))[_0x5bb5('0x26')](function(_0x2b2bd2){if(_0x2b2bd2){_0x6c3c78[_0x5bb5('0x48')]['AccountId']=_0x2b2bd2['id'];_0x6c3c78[_0x5bb5('0x48')][_0x5bb5('0x4d')]=integrations[_0x5bb5('0x4e')](_0x6c3c78[_0x5bb5('0x48')][_0x5bb5('0x4f')],_0x6c3c78['body'][_0x5bb5('0x50')]);_0x6c3c78[_0x5bb5('0x48')][_0x5bb5('0x51')]=integrations[_0x5bb5('0x52')](_0x6c3c78[_0x5bb5('0x48')][_0x5bb5('0x4f')],_0x6c3c78['body'][_0x5bb5('0x50')]);return db[_0x5bb5('0x53')][_0x5bb5('0x47')](_0x6c3c78[_0x5bb5('0x48')],{'include':[{'model':db[_0x5bb5('0x54')],'as':'Subjects'},{'model':db[_0x5bb5('0x54')],'as':_0x5bb5('0x51')}]});}return null;})[_0x5bb5('0x26')](respondWithResult(_0x465686,null))['catch'](handleError(_0x465686,null));};exports[_0x5bb5('0x55')]=function(_0x39e9b5,_0xc0b93f,_0x1a66f9){var _0x36c10e=[_0x5bb5('0x56'),_0x5bb5('0x57'),_0x5bb5('0x58'),_0x5bb5('0x59'),_0x5bb5('0x5a'),'notify',_0x5bb5('0x5b'),_0x5bb5('0x5c'),'category'];var _0x55e105=[_0x5bb5('0x5d'),_0x5bb5('0x56'),_0x5bb5('0x5e'),_0x5bb5('0x5f'),'upon_reject',_0x5bb5('0x60'),_0x5bb5('0x61'),_0x5bb5('0x57'),'approval_history',_0x5bb5('0x62'),_0x5bb5('0x63'),_0x5bb5('0x64'),_0x5bb5('0x65'),_0x5bb5('0x66'),'sys_created_on',_0x5bb5('0x67'),_0x5bb5('0x68'),_0x5bb5('0x69'),_0x5bb5('0x58'),_0x5bb5('0x35'),_0x5bb5('0x6a'),'closed_at',_0x5bb5('0x6b'),'delivery_plan',_0x5bb5('0x6c'),_0x5bb5('0x6d'),_0x5bb5('0x6e'),_0x5bb5('0x6f'),_0x5bb5('0x70'),_0x5bb5('0x71'),_0x5bb5('0x72'),_0x5bb5('0x73'),_0x5bb5('0x74'),_0x5bb5('0x75'),_0x5bb5('0x76'),_0x5bb5('0x77'),'work_end',_0x5bb5('0x78'),_0x5bb5('0x79'),'caller_id',_0x5bb5('0x7a'),_0x5bb5('0x59'),_0x5bb5('0x7b'),_0x5bb5('0x7c'),_0x5bb5('0x5a'),_0x5bb5('0x7d'),_0x5bb5('0x7e'),_0x5bb5('0x7f'),'assignment_group',_0x5bb5('0x80'),_0x5bb5('0x81'),'description',_0x5bb5('0x82'),'notify',_0x5bb5('0x83'),_0x5bb5('0x84'),_0x5bb5('0x85'),_0x5bb5('0x86'),_0x5bb5('0x87'),_0x5bb5('0x88'),'contact_type',_0x5bb5('0x89'),_0x5bb5('0x5b'),_0x5bb5('0x8a'),_0x5bb5('0x8b'),_0x5bb5('0x8c'),_0x5bb5('0x8d'),_0x5bb5('0x8e'),'assigned_to',_0x5bb5('0x5c'),'comments',_0x5bb5('0x8f'),'approval','comments_and_work_notes',_0x5bb5('0x90'),'sys_mod_count',_0x5bb5('0x91'),_0x5bb5('0x92'),'escalation',_0x5bb5('0x93'),'correlation_id',_0x5bb5('0x94'),_0x5bb5('0x95')];var _0x1b34b5='';var _0x43b408='';var _0x1581c6=[];var _0x1bf277='';var _0x4c92b6='';var _0x393dff=[];var _0x187f5d='';var _0x4a7205='';var _0x462212={};var _0x2f42aa='';return db['ServicenowAccount'][_0x5bb5('0x4b')]({'where':{'id':_0x39e9b5['params']['id']},'attributes':['id','username',_0x5bb5('0x96'),'email',_0x5bb5('0x97'),_0x5bb5('0x98')]})[_0x5bb5('0x26')](handleEntityNotFound(_0xc0b93f,null))[_0x5bb5('0x26')](function(_0x144a67){if(_0x144a67){_0x2f42aa=_0x144a67['remoteUri'];var _0xde9230=_0x2f42aa[_0x5bb5('0x99')](-0x1);if(_0xde9230==='/'){_0x2f42aa=_0x2f42aa['substring'](0x0,_0x2f42aa[_0x5bb5('0x9a')](_0xde9230));}_0x4a7205=util[_0x5bb5('0x9b')]('%s/api/now/doc/table/schema/',_0x2f42aa);_0x187f5d=util[_0x5bb5('0x9b')](_0x5bb5('0x9c'),_0x2f42aa);_0x462212={'user':_0x144a67['username'],'pass':_0x144a67[_0x5bb5('0x96')]};var _0x4693df={'method':_0x5bb5('0x9d'),'uri':_0x4a7205+_0x5bb5('0x9e'),'auth':_0x462212,'json':!![]};return rp(_0x4693df);}})[_0x5bb5('0x26')](function(_0x5d7bcf){if(_0x5d7bcf[_0x5bb5('0x9f')]['length']>0x0){_0x1b34b5=_0x5d7bcf[_0x5bb5('0x9f')];}console[_0x5bb5('0xa0')]('incident\x20table\x20objects',_0x1b34b5);_0x393dff=[];_0x43b408=Object[_0x5bb5('0xa1')]([],_0x1b34b5);_[_0x5bb5('0xa2')](_0x43b408,function(_0x4fdfa1){return!_0x36c10e[_0x5bb5('0xa3')](_0x4fdfa1[_0x5bb5('0x28')]);});_0x43b408[_0x5bb5('0xa4')](function(_0x1cc743){var _0x132b09=createFieldObject(_0x187f5d,_0x462212,_0x1cc743[_0x5bb5('0xa5')],_0x1cc743[_0x5bb5('0x28')],_0x1cc743[_0x5bb5('0xa6')],![]);_0x393dff['push'](_0x132b09);});return Promise[_0x5bb5('0xa7')](_0x393dff);})[_0x5bb5('0x26')](function(_0xd63b13){_0x1581c6=_0xd63b13;_0x1bf277=Object['assign']([],_0x1b34b5);console[_0x5bb5('0xa0')](_0x5bb5('0xa8'),_0x1b34b5);_['remove'](_0x1bf277,function(_0x5f2925){return _0x55e105[_0x5bb5('0xa3')](_0x5f2925[_0x5bb5('0x28')]);});console[_0x5bb5('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1bf277);_0x393dff=[];_0x1bf277['forEach'](function(_0x4aabf4){var _0x1100b7=createFieldObject(_0x187f5d,_0x462212,_0x4aabf4['internalType'],_0x4aabf4[_0x5bb5('0x28')],_0x4aabf4['label'],!![]);_0x393dff[_0x5bb5('0xa9')](_0x1100b7);});return Promise[_0x5bb5('0xa7')](_0x393dff);})['then'](function(_0x2b2af1){_0x4c92b6=_0x2b2af1;var _0x4c0ace=_0x1581c6[_0x5bb5('0xaa')](_0x4c92b6);return{'count':_0x4c0ace[_0x5bb5('0x33')],'rows':_0x4c0ace};})[_0x5bb5('0x26')](respondWithResult(_0xc0b93f,null))[_0x5bb5('0x46')](function(_0x5a5869){console['log'](_0x5bb5('0xab')+_0x5a5869);var _0x18f83d=_0x39e9b5[_0x5bb5('0x2f')]['test']?0x1f4:_0x5a5869['statusCode']||0x1f4;logger[_0x5bb5('0xac')](_0x5a5869[_0x5bb5('0x27')]);delete _0x5a5869[_0x5bb5('0x28')];if(_0x18f83d===0x191){_0x18f83d=0x190;}_0xc0b93f[_0x5bb5('0x19')](_0x18f83d)[_0x5bb5('0xad')](_0x39e9b5[_0x5bb5('0x2f')][_0x5bb5('0xae')]?{'message':_0x5bb5('0xaf'),'statusCode':_0x5a5869['statusCode']}:_0x5a5869);});};function createFieldObject(_0x1b0f79,_0xd5cae0,_0x4b202b,_0x1e36ec,_0x2dafdd,_0x81d783){return new Promise(function(_0xbd3e1f,_0x2d71e9){var _0x206c62={'id':_0x1e36ec,'name':_0x2dafdd,'custom':_0x81d783};if(_0x4b202b===_0x5bb5('0xb0')){_0x206c62['options']=[{'name':_0x5bb5('0xb1'),'value':_0x5bb5('0xb2')},{'name':_0x5bb5('0xb3'),'value':_0x5bb5('0xb4')}];_0xbd3e1f(_0x206c62);}else{var _0x5a6fc8={'method':_0x5bb5('0x9d'),'uri':_0x1b0f79+_0x5bb5('0xb5')+_0x1e36ec,'auth':_0xd5cae0,'json':!![]};return rp(_0x5a6fc8)[_0x5bb5('0x26')](function(_0x4bf099){var _0xa27403=[];if(_0x4bf099['result']['length']>0x0){_0x4bf099['result']['forEach'](function(_0x425f7a){if(_0x425f7a[_0x5bb5('0xb6')]==='false'){var _0x42c36f={'name':_0x425f7a[_0x5bb5('0xa6')],'value':_0x425f7a['value']};_0xa27403[_0x5bb5('0xa9')](_0x42c36f);}});}_0x206c62[_0x5bb5('0x3d')]=_0xa27403;if(_0x206c62[_0x5bb5('0x3d')][_0x5bb5('0x33')]>0x0){_0xbd3e1f(_0x206c62);}else{if(_0x81d783==![]){_0xbd3e1f();}else{_0xbd3e1f(_0x206c62);}}});}});} \ No newline at end of file +var _0xc986=['end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','catch','show','params','merge','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','close_code','assignment_group','additional_assignee_list','calendar_duration','notify','close_notes','closed_by','follow_up','parent_incident','contact_type','incident_state','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','label','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','boolean','True','true','False','false','value','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x34a087,_0x167f6e){var _0x2dcf8b=function(_0x569138){while(--_0x569138){_0x34a087['push'](_0x34a087['shift']());}};_0x2dcf8b(++_0x167f6e);}(_0xc986,0x97));var _0x6c98=function(_0x17ea17,_0x3c2ac9){_0x17ea17=_0x17ea17-0x0;var _0x1ea925=_0xc986[_0x17ea17];return _0x1ea925;};'use strict';var emlformat=require(_0x6c98('0x0'));var rimraf=require(_0x6c98('0x1'));var zipdir=require(_0x6c98('0x2'));var jsonpatch=require(_0x6c98('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c98('0x4'));var Mustache=require(_0x6c98('0x5'));var util=require('util');var path=require(_0x6c98('0x6'));var sox=require(_0x6c98('0x7'));var csv=require('to-csv');var ejs=require(_0x6c98('0x8'));var fs=require('fs');var fs_extra=require(_0x6c98('0x9'));var _=require('lodash');var squel=require(_0x6c98('0xa'));var crypto=require(_0x6c98('0xb'));var jsforce=require(_0x6c98('0xc'));var deskjs=require(_0x6c98('0xd'));var toCsv=require(_0x6c98('0xe'));var querystring=require(_0x6c98('0xf'));var Papa=require(_0x6c98('0x10'));var Redis=require(_0x6c98('0x11'));var authService=require(_0x6c98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6c98('0x13'));var hardwareService=require(_0x6c98('0x14'));var logger=require(_0x6c98('0x15'))('api');var utils=require(_0x6c98('0x16'));var config=require(_0x6c98('0x17'));var licenseUtil=require(_0x6c98('0x18'));var db=require(_0x6c98('0x19'))['db'];var integrations=require(_0x6c98('0x1a'));function respondWithStatusCode(_0x18874f,_0x529c58){_0x529c58=_0x529c58||0xcc;return function(_0x14cc18){if(_0x14cc18){return _0x18874f[_0x6c98('0x1b')](_0x529c58);}return _0x18874f[_0x6c98('0x1c')](_0x529c58)[_0x6c98('0x1d')]();};}function respondWithResult(_0x5119d3,_0x510942){_0x510942=_0x510942||0xc8;return function(_0x4a987a){if(_0x4a987a){return _0x5119d3[_0x6c98('0x1c')](_0x510942)[_0x6c98('0x1e')](_0x4a987a);}};}function respondWithFilteredResult(_0x35c6f5,_0x490257){return function(_0x581286){if(_0x581286){var _0x41e173=typeof _0x490257[_0x6c98('0x1f')]===_0x6c98('0x20')&&typeof _0x490257['limit']===_0x6c98('0x20');var _0x3c1926=_0x581286[_0x6c98('0x21')];var _0x133ce4=_0x41e173?0x0:_0x490257[_0x6c98('0x1f')];var _0x554911=_0x41e173?_0x581286[_0x6c98('0x21')]:_0x490257[_0x6c98('0x1f')]+_0x490257[_0x6c98('0x22')];var _0x33ffdb;if(_0x554911>=_0x3c1926){_0x554911=_0x3c1926;_0x33ffdb=0xc8;}else{_0x33ffdb=0xce;}_0x35c6f5['status'](_0x33ffdb);return _0x35c6f5[_0x6c98('0x23')](_0x6c98('0x24'),_0x133ce4+'-'+_0x554911+'/'+_0x3c1926)[_0x6c98('0x1e')](_0x581286);}return null;};}function patchUpdates(_0x118de3){return function(_0x27a388){try{jsonpatch[_0x6c98('0x25')](_0x27a388,_0x118de3,!![]);}catch(_0x45be9f){return BPromise['reject'](_0x45be9f);}return _0x27a388[_0x6c98('0x26')]();};}function saveUpdates(_0x3dc749,_0x42048c){return function(_0x581b3f){if(_0x581b3f){return _0x581b3f['update'](_0x3dc749)['then'](function(_0x252ddd){return _0x252ddd;});}return null;};}function removeEntity(_0x401dea,_0x3a3b82){return function(_0x518d5b){if(_0x518d5b){return _0x518d5b[_0x6c98('0x27')]()[_0x6c98('0x28')](function(){_0x401dea[_0x6c98('0x1c')](0xcc)[_0x6c98('0x1d')]();});}};}function handleEntityNotFound(_0x4c452a,_0x51ad22){return function(_0x10e78d){if(!_0x10e78d){_0x4c452a[_0x6c98('0x1b')](0x194);}return _0x10e78d;};}function handleError(_0x431599,_0xcbaf7a){_0xcbaf7a=_0xcbaf7a||0x1f4;return function(_0x5c8653){logger[_0x6c98('0x29')](_0x5c8653[_0x6c98('0x2a')]);if(_0x5c8653[_0x6c98('0x2b')]){delete _0x5c8653['name'];}_0x431599[_0x6c98('0x1c')](_0xcbaf7a)[_0x6c98('0x2c')](_0x5c8653);};}exports[_0x6c98('0x2d')]=function(_0x107189,_0xc7fcdf){var _0x4b2e26={},_0x379783={},_0x2709b8={'count':0x0,'rows':[]};var _0x4a3a22=_[_0x6c98('0x2e')](db[_0x6c98('0x2f')][_0x6c98('0x30')],function(_0x4efb64){return{'name':_0x4efb64[_0x6c98('0x31')],'type':_0x4efb64['type'][_0x6c98('0x32')]};});_0x379783[_0x6c98('0x33')]=_[_0x6c98('0x2e')](_0x4a3a22,_0x6c98('0x2b'));_0x379783[_0x6c98('0x34')]=_[_0x6c98('0x35')](_0x107189['query']);_0x379783['filters']=_['intersection'](_0x379783[_0x6c98('0x33')],_0x379783[_0x6c98('0x34')]);_0x4b2e26[_0x6c98('0x36')]=_[_0x6c98('0x37')](_0x379783[_0x6c98('0x33')],qs[_0x6c98('0x38')](_0x107189[_0x6c98('0x34')][_0x6c98('0x38')]));_0x4b2e26[_0x6c98('0x36')]=_0x4b2e26[_0x6c98('0x36')][_0x6c98('0x39')]?_0x4b2e26[_0x6c98('0x36')]:_0x379783['model'];if(!_0x107189[_0x6c98('0x34')][_0x6c98('0x3a')](_0x6c98('0x3b'))){_0x4b2e26['limit']=qs[_0x6c98('0x22')](_0x107189[_0x6c98('0x34')][_0x6c98('0x22')]);_0x4b2e26[_0x6c98('0x1f')]=qs[_0x6c98('0x1f')](_0x107189['query'][_0x6c98('0x1f')]);}_0x4b2e26['order']=qs[_0x6c98('0x3c')](_0x107189[_0x6c98('0x34')][_0x6c98('0x3c')]);_0x4b2e26[_0x6c98('0x3d')]=qs[_0x6c98('0x3e')](_[_0x6c98('0x3f')](_0x107189[_0x6c98('0x34')],_0x379783['filters']),_0x4a3a22);if(_0x107189[_0x6c98('0x34')][_0x6c98('0x40')]){_0x4b2e26[_0x6c98('0x3d')]=_['merge'](_0x4b2e26[_0x6c98('0x3d')],{'$or':_[_0x6c98('0x2e')](_0x4a3a22,function(_0x1476cd){if(_0x1476cd[_0x6c98('0x41')]!==_0x6c98('0x42')){var _0xcfeb5a={};_0xcfeb5a[_0x1476cd[_0x6c98('0x2b')]]={'$like':'%'+_0x107189[_0x6c98('0x34')]['filter']+'%'};return _0xcfeb5a;}})});}_0x4b2e26=_['merge']({},_0x4b2e26,_0x107189[_0x6c98('0x43')]);var _0x3622a1={'where':_0x4b2e26[_0x6c98('0x3d')]};return db[_0x6c98('0x2f')][_0x6c98('0x21')](_0x3622a1)[_0x6c98('0x28')](function(_0x5e0694){_0x2709b8[_0x6c98('0x21')]=_0x5e0694;if(_0x107189[_0x6c98('0x34')][_0x6c98('0x44')]){_0x4b2e26[_0x6c98('0x45')]=[{'all':!![]}];}return db[_0x6c98('0x2f')]['findAll'](_0x4b2e26);})[_0x6c98('0x28')](function(_0x51d81a){_0x2709b8['rows']=_0x51d81a;return _0x2709b8;})[_0x6c98('0x28')](respondWithFilteredResult(_0xc7fcdf,_0x4b2e26))[_0x6c98('0x46')](handleError(_0xc7fcdf,null));};exports[_0x6c98('0x47')]=function(_0x38e806,_0x4fd53d){var _0x23b7fa={'raw':![],'where':{'id':_0x38e806[_0x6c98('0x48')]['id']}},_0x33e697={};_0x33e697[_0x6c98('0x33')]=_[_0x6c98('0x35')](db[_0x6c98('0x2f')][_0x6c98('0x30')]);_0x33e697['query']=_[_0x6c98('0x35')](_0x38e806[_0x6c98('0x34')]);_0x33e697[_0x6c98('0x3e')]=_[_0x6c98('0x37')](_0x33e697[_0x6c98('0x33')],_0x33e697[_0x6c98('0x34')]);_0x23b7fa[_0x6c98('0x36')]=_['intersection'](_0x33e697['model'],qs[_0x6c98('0x38')](_0x38e806[_0x6c98('0x34')][_0x6c98('0x38')]));_0x23b7fa[_0x6c98('0x36')]=_0x23b7fa['attributes']['length']?_0x23b7fa['attributes']:_0x33e697[_0x6c98('0x33')];if(_0x38e806['query']['includeAll']){_0x23b7fa['include']=[{'all':!![]}];}_0x23b7fa=_[_0x6c98('0x49')]({},_0x23b7fa,_0x38e806[_0x6c98('0x43')]);return db[_0x6c98('0x2f')][_0x6c98('0x4a')](_0x23b7fa)[_0x6c98('0x28')](handleEntityNotFound(_0x4fd53d,null))[_0x6c98('0x28')](respondWithResult(_0x4fd53d,null))['catch'](handleError(_0x4fd53d,null));};exports[_0x6c98('0x4b')]=function(_0x436d79,_0x19f327){return db['ServicenowAccount']['create'](_0x436d79['body'],{})[_0x6c98('0x28')](respondWithResult(_0x19f327,0xc9))[_0x6c98('0x46')](handleError(_0x19f327,null));};exports[_0x6c98('0x4c')]=function(_0x99286e,_0x223cb4){if(_0x99286e['body']['id']){delete _0x99286e[_0x6c98('0x4d')]['id'];}return db[_0x6c98('0x2f')][_0x6c98('0x4a')]({'where':{'id':_0x99286e[_0x6c98('0x48')]['id']}})['then'](handleEntityNotFound(_0x223cb4,null))['then'](saveUpdates(_0x99286e[_0x6c98('0x4d')],null))[_0x6c98('0x28')](respondWithResult(_0x223cb4,null))[_0x6c98('0x46')](handleError(_0x223cb4,null));};exports[_0x6c98('0x27')]=function(_0x5339a8,_0x437724){return db['ServicenowAccount']['find']({'where':{'id':_0x5339a8[_0x6c98('0x48')]['id']}})['then'](handleEntityNotFound(_0x437724,null))[_0x6c98('0x28')](removeEntity(_0x437724,null))[_0x6c98('0x46')](handleError(_0x437724,null));};exports[_0x6c98('0x4e')]=function(_0x579c59,_0x509cb,_0x5a8cce){var _0x2896ba={};var _0x21250e={};var _0x3dc1d4;var _0x9ef34e;return db['ServicenowAccount'][_0x6c98('0x4f')]({'where':{'id':_0x579c59[_0x6c98('0x48')]['id']}})['then'](handleEntityNotFound(_0x509cb,null))[_0x6c98('0x28')](function(_0x227d23){if(_0x227d23){_0x3dc1d4=_0x227d23;_0x21250e[_0x6c98('0x33')]=_['keys'](db[_0x6c98('0x50')][_0x6c98('0x30')]);_0x21250e['query']=_[_0x6c98('0x35')](_0x579c59[_0x6c98('0x34')]);_0x21250e['filters']=_[_0x6c98('0x37')](_0x21250e['model'],_0x21250e[_0x6c98('0x34')]);_0x2896ba[_0x6c98('0x36')]=_[_0x6c98('0x37')](_0x21250e[_0x6c98('0x33')],qs['fields'](_0x579c59[_0x6c98('0x34')]['fields']));_0x2896ba[_0x6c98('0x36')]=_0x2896ba[_0x6c98('0x36')][_0x6c98('0x39')]?_0x2896ba['attributes']:_0x21250e['model'];_0x2896ba[_0x6c98('0x51')]=qs[_0x6c98('0x3c')](_0x579c59['query'][_0x6c98('0x3c')]);_0x2896ba[_0x6c98('0x3d')]=qs[_0x6c98('0x3e')](_['pick'](_0x579c59[_0x6c98('0x34')],_0x21250e[_0x6c98('0x3e')]));if(_0x579c59[_0x6c98('0x34')][_0x6c98('0x40')]){_0x2896ba[_0x6c98('0x3d')]=_['merge'](_0x2896ba[_0x6c98('0x3d')],{'$or':_[_0x6c98('0x2e')](_0x2896ba[_0x6c98('0x36')],function(_0x72d12c){var _0x44ab37={};_0x44ab37[_0x72d12c]={'$like':'%'+_0x579c59[_0x6c98('0x34')][_0x6c98('0x40')]+'%'};return _0x44ab37;})});}_0x2896ba=_[_0x6c98('0x49')]({},_0x2896ba,_0x579c59[_0x6c98('0x43')]);return _0x3dc1d4[_0x6c98('0x4e')](_0x2896ba);}})[_0x6c98('0x28')](function(_0xf66fb5){if(_0xf66fb5){_0x9ef34e=_0xf66fb5[_0x6c98('0x39')];if(!_0x579c59['query'][_0x6c98('0x3a')](_0x6c98('0x3b'))){_0x2896ba[_0x6c98('0x22')]=qs[_0x6c98('0x22')](_0x579c59[_0x6c98('0x34')][_0x6c98('0x22')]);_0x2896ba[_0x6c98('0x1f')]=qs[_0x6c98('0x1f')](_0x579c59['query'][_0x6c98('0x1f')]);}return _0x3dc1d4[_0x6c98('0x4e')](_0x2896ba);}})[_0x6c98('0x28')](function(_0x21f08e){if(_0x21f08e){return _0x21f08e?{'count':_0x9ef34e,'rows':_0x21f08e}:null;}})[_0x6c98('0x28')](respondWithResult(_0x509cb,null))[_0x6c98('0x46')](handleError(_0x509cb,null));};exports[_0x6c98('0x52')]=function(_0x1ff268,_0x282958,_0x55f8ce){if(_0x1ff268[_0x6c98('0x4d')]['id']){delete _0x1ff268[_0x6c98('0x4d')]['id'];}return db[_0x6c98('0x2f')]['findOne']({'where':{'id':_0x1ff268[_0x6c98('0x48')]['id']}})[_0x6c98('0x28')](handleEntityNotFound(_0x282958,null))[_0x6c98('0x28')](function(_0x248007){if(_0x248007){_0x1ff268[_0x6c98('0x4d')][_0x6c98('0x53')]=_0x248007['id'];_0x1ff268[_0x6c98('0x4d')][_0x6c98('0x54')]=integrations['getSubjects'](_0x1ff268['body'][_0x6c98('0x55')],_0x1ff268[_0x6c98('0x4d')][_0x6c98('0x41')]);_0x1ff268['body'][_0x6c98('0x56')]=integrations[_0x6c98('0x57')](_0x1ff268['body'][_0x6c98('0x55')],_0x1ff268[_0x6c98('0x4d')][_0x6c98('0x41')]);return db[_0x6c98('0x50')]['create'](_0x1ff268['body'],{'include':[{'model':db[_0x6c98('0x58')],'as':'Subjects'},{'model':db[_0x6c98('0x58')],'as':_0x6c98('0x56')}]});}return null;})[_0x6c98('0x28')](respondWithResult(_0x282958,null))['catch'](handleError(_0x282958,null));};exports[_0x6c98('0x59')]=function(_0x5b2a5c,_0xcb2b45,_0x24d9fc){var _0x4624b4=[_0x6c98('0x5a'),_0x6c98('0x5b'),_0x6c98('0x5c'),_0x6c98('0x5d'),'close_code','notify','incident_state',_0x6c98('0x5e'),'category'];var _0x5d9b6e=[_0x6c98('0x5f'),_0x6c98('0x5a'),'caused_by',_0x6c98('0x60'),_0x6c98('0x61'),_0x6c98('0x62'),_0x6c98('0x63'),_0x6c98('0x5b'),'approval_history','number',_0x6c98('0x64'),_0x6c98('0x65'),_0x6c98('0x66'),'user_input',_0x6c98('0x67'),_0x6c98('0x68'),_0x6c98('0x69'),_0x6c98('0x6a'),_0x6c98('0x5c'),_0x6c98('0x51'),_0x6c98('0x6b'),'closed_at',_0x6c98('0x6c'),'delivery_plan',_0x6c98('0x6d'),_0x6c98('0x6e'),_0x6c98('0x6f'),_0x6c98('0x70'),_0x6c98('0x71'),_0x6c98('0x72'),_0x6c98('0x73'),_0x6c98('0x74'),'expected_start','opened_at',_0x6c98('0x75'),_0x6c98('0x76'),'work_end',_0x6c98('0x77'),'resolved_at',_0x6c98('0x78'),_0x6c98('0x79'),_0x6c98('0x5d'),_0x6c98('0x7a'),_0x6c98('0x7b'),_0x6c98('0x7c'),'correlation_display','delivery_task','work_start',_0x6c98('0x7d'),'business_stc',_0x6c98('0x7e'),'description',_0x6c98('0x7f'),_0x6c98('0x80'),'sys_class_name',_0x6c98('0x81'),_0x6c98('0x82'),_0x6c98('0x83'),_0x6c98('0x84'),'sys_id',_0x6c98('0x85'),'reopened_by',_0x6c98('0x86'),'urgency','problem_id',_0x6c98('0x87'),_0x6c98('0x88'),_0x6c98('0x89'),_0x6c98('0x8a'),_0x6c98('0x5e'),_0x6c98('0x8b'),_0x6c98('0x8c'),_0x6c98('0x8d'),_0x6c98('0x8e'),'due_date','sys_mod_count',_0x6c98('0x8f'),_0x6c98('0x90'),'escalation',_0x6c98('0x91'),_0x6c98('0x92'),_0x6c98('0x93'),'category'];var _0x38b700='';var _0x3a0220='';var _0x51d977=[];var _0x4b6718='';var _0xe1d36e='';var _0x3eae65=[];var _0x650be7='';var _0x566435='';var _0x3cfe1a={};var _0x14954f='';return db[_0x6c98('0x2f')][_0x6c98('0x4f')]({'where':{'id':_0x5b2a5c['params']['id']},'attributes':['id',_0x6c98('0x94'),_0x6c98('0x95'),_0x6c98('0x96'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0xcb2b45,null))['then'](function(_0x517a9e){if(_0x517a9e){_0x14954f=_0x517a9e[_0x6c98('0x97')];var _0x23bc87=_0x14954f[_0x6c98('0x98')](-0x1);if(_0x23bc87==='/'){_0x14954f=_0x14954f['substring'](0x0,_0x14954f[_0x6c98('0x99')](_0x23bc87));}_0x566435=util[_0x6c98('0x9a')](_0x6c98('0x9b'),_0x14954f);_0x650be7=util['format'](_0x6c98('0x9c'),_0x14954f);_0x3cfe1a={'user':_0x517a9e['username'],'pass':_0x517a9e[_0x6c98('0x95')]};var _0x12954f={'method':_0x6c98('0x9d'),'uri':_0x566435+_0x6c98('0x9e'),'auth':_0x3cfe1a,'json':!![]};return rp(_0x12954f);}})[_0x6c98('0x28')](function(_0x1f27f2){if(_0x1f27f2[_0x6c98('0x9f')][_0x6c98('0x39')]>0x0){_0x38b700=_0x1f27f2[_0x6c98('0x9f')];}console[_0x6c98('0xa0')](_0x6c98('0xa1'),_0x38b700);_0x3eae65=[];_0x3a0220=Object[_0x6c98('0xa2')]([],_0x38b700);_[_0x6c98('0xa3')](_0x3a0220,function(_0x438f8){return!_0x4624b4[_0x6c98('0xa4')](_0x438f8[_0x6c98('0x2b')]);});_0x3a0220[_0x6c98('0xa5')](function(_0x32fe70){var _0x481e73=createFieldObject(_0x650be7,_0x3cfe1a,_0x32fe70[_0x6c98('0xa6')],_0x32fe70[_0x6c98('0x2b')],_0x32fe70['label'],![]);_0x3eae65[_0x6c98('0xa7')](_0x481e73);});return Promise[_0x6c98('0xa8')](_0x3eae65);})[_0x6c98('0x28')](function(_0x52948){_0x51d977=_0x52948;_0x4b6718=Object['assign']([],_0x38b700);console[_0x6c98('0xa0')]('TCL:\x20_object',_0x38b700);_['remove'](_0x4b6718,function(_0x510a59){return _0x5d9b6e[_0x6c98('0xa4')](_0x510a59[_0x6c98('0x2b')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4b6718);_0x3eae65=[];_0x4b6718['forEach'](function(_0x513186){var _0x2a8cdf=createFieldObject(_0x650be7,_0x3cfe1a,_0x513186[_0x6c98('0xa6')],_0x513186[_0x6c98('0x2b')],_0x513186[_0x6c98('0xa9')],!![]);_0x3eae65['push'](_0x2a8cdf);});return Promise[_0x6c98('0xa8')](_0x3eae65);})[_0x6c98('0x28')](function(_0x54436f){_0xe1d36e=_0x54436f;var _0x2ebab6=_0x51d977[_0x6c98('0xaa')](_0xe1d36e);return{'count':_0x2ebab6[_0x6c98('0x39')],'rows':_0x2ebab6};})['then'](respondWithResult(_0xcb2b45,null))[_0x6c98('0x46')](function(_0x5045b3){console[_0x6c98('0xa0')](_0x6c98('0xab')+_0x5045b3);var _0x402bba=_0x5b2a5c[_0x6c98('0x34')][_0x6c98('0xac')]?0x1f4:_0x5045b3['statusCode']||0x1f4;logger['error'](_0x5045b3[_0x6c98('0x2a')]);delete _0x5045b3['name'];if(_0x402bba===0x191){_0x402bba=0x190;}_0xcb2b45[_0x6c98('0x1c')](_0x402bba)['send'](_0x5b2a5c[_0x6c98('0x34')][_0x6c98('0xac')]?{'message':_0x6c98('0xad'),'statusCode':_0x5045b3['statusCode']}:_0x5045b3);});};function createFieldObject(_0x53accc,_0x3bc8b1,_0x57cdcf,_0x189c6d,_0x3f3685,_0x2badfb){return new Promise(function(_0x33a244,_0x3f5c21){var _0x487801={'id':_0x189c6d,'name':_0x3f3685,'custom':_0x2badfb};if(_0x57cdcf===_0x6c98('0xae')){_0x487801[_0x6c98('0x43')]=[{'name':_0x6c98('0xaf'),'value':_0x6c98('0xb0')},{'name':_0x6c98('0xb1'),'value':_0x6c98('0xb2')}];_0x33a244(_0x487801);}else{var _0x802635={'method':_0x6c98('0x9d'),'uri':_0x53accc+'sys_choice?sysparm_query=name=incident^element='+_0x189c6d,'auth':_0x3bc8b1,'json':!![]};return rp(_0x802635)[_0x6c98('0x28')](function(_0x2b143e){var _0x106369=[];if(_0x2b143e[_0x6c98('0x9f')][_0x6c98('0x39')]>0x0){_0x2b143e['result']['forEach'](function(_0x1674d0){if(_0x1674d0['inactive']===_0x6c98('0xb2')){var _0x13f769={'name':_0x1674d0[_0x6c98('0xa9')],'value':_0x1674d0[_0x6c98('0xb3')]};_0x106369[_0x6c98('0xa7')](_0x13f769);}});}_0x487801[_0x6c98('0x43')]=_0x106369;if(_0x487801[_0x6c98('0x43')][_0x6c98('0x39')]>0x0){_0x33a244(_0x487801);}else{if(_0x2badfb==![]){_0x33a244();}else{_0x33a244(_0x487801);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5267ec5..185004c 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 _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7da7,0x10d));var _0x77da=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x7da7[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa630=['moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x2c802e,_0x407383){var _0x44790d=function(_0x39f0e3){while(--_0x39f0e3){_0x2c802e['push'](_0x2c802e['shift']());}};_0x44790d(++_0x407383);}(_0xa630,0xbe));var _0x0a63=function(_0x5b8593,_0x594cb0){_0x5b8593=_0x5b8593-0x0;var _0x2e5c43=_0xa630[_0x5b8593];return _0x2e5c43;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a63('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a63('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var attributes=require(_0x0a63('0x6'));var integrations=require(_0x0a63('0x7'));module[_0x0a63('0x8')]=function(_0x4b7474,_0x2760b0){return _0x4b7474[_0x0a63('0x9')](_0x0a63('0xa'),attributes,{'tableName':_0x0a63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 7faa52c..1ee0071 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 _0x5543=['jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','map','include','model','ShowServicenowAccount','find','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x580d86,_0x185828){var _0x4720db=function(_0x35a5ed){while(--_0x35a5ed){_0x580d86['push'](_0x580d86['shift']());}};_0x4720db(++_0x185828);}(_0x5543,0x67));var _0x3554=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x5543[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x3554('0x0'));var util=require('util');var moment=require(_0x3554('0x1'));var BPromise=require(_0x3554('0x2'));var rs=require(_0x3554('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3554('0x4'))['db'];var utils=require(_0x3554('0x5'));var logger=require('../../config/logger')(_0x3554('0x6'));var config=require(_0x3554('0x7'));var jayson=require(_0x3554('0x8'));var client=jayson[_0x3554('0x9')][_0x3554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x154897,_0x59cf5f,_0x2c76ae){return new BPromise(function(_0x11c1a1,_0x266d16){return client[_0x3554('0xb')](_0x154897,_0x2c76ae)[_0x3554('0xc')](function(_0x47833c){logger[_0x3554('0xd')](_0x3554('0xe'),_0x59cf5f,_0x3554('0xf'));logger[_0x3554('0x10')](_0x3554('0x11'),_0x59cf5f,_0x3554('0xf'),JSON[_0x3554('0x12')](_0x47833c));if(_0x47833c[_0x3554('0x13')]){if(_0x47833c['error'][_0x3554('0x14')]===0x1f4){logger[_0x3554('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x59cf5f,_0x47833c[_0x3554('0x13')]['message']);return _0x266d16(_0x47833c[_0x3554('0x13')][_0x3554('0x15')]);}logger['error'](_0x3554('0xe'),_0x59cf5f,_0x47833c[_0x3554('0x13')]['message']);return _0x11c1a1(_0x47833c['error']['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x59cf5f,'request\x20sent');_0x11c1a1(_0x47833c[_0x3554('0x16')][_0x3554('0x15')]);}})[_0x3554('0x17')](function(_0x5ceab5){logger['error'](_0x3554('0xe'),_0x59cf5f,_0x5ceab5);_0x266d16(_0x5ceab5);});});}exports[_0x3554('0x18')]=function(_0x16d849){var _0x1fc6f8=this;return new Promise(function(_0x10524a,_0x289c54){return db[_0x3554('0x19')][_0x3554('0x1a')]({'raw':_0x16d849[_0x3554('0x1b')]?_0x16d849['options']['raw']===undefined?!![]:![]:!![],'where':_0x16d849['options']?_0x16d849[_0x3554('0x1b')][_0x3554('0x1c')]||null:null,'attributes':_0x16d849[_0x3554('0x1b')]?_0x16d849[_0x3554('0x1b')][_0x3554('0x1d')]||null:null,'limit':_0x16d849[_0x3554('0x1b')]?_0x16d849['options'][_0x3554('0x1e')]||null:null,'include':_0x16d849[_0x3554('0x1b')]?_0x16d849[_0x3554('0x1b')]['include']?_[_0x3554('0x1f')](_0x16d849['options'][_0x3554('0x20')],function(_0x1e6a36){return{'model':db[_0x1e6a36['model']],'as':_0x1e6a36['as'],'attributes':_0x1e6a36[_0x3554('0x1d')],'include':_0x1e6a36[_0x3554('0x20')]?_[_0x3554('0x1f')](_0x1e6a36[_0x3554('0x20')],function(_0x5d752a){return{'model':db[_0x5d752a[_0x3554('0x21')]],'as':_0x5d752a['as'],'attributes':_0x5d752a[_0x3554('0x1d')],'include':_0x5d752a[_0x3554('0x20')]?_['map'](_0x5d752a[_0x3554('0x20')],function(_0x534569){return{'model':db[_0x534569['model']],'as':_0x534569['as'],'attributes':_0x534569[_0x3554('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x230f0c){logger['info'](_0x3554('0x18'),_0x16d849);logger[_0x3554('0x10')](_0x3554('0x18'),_0x16d849,JSON[_0x3554('0x12')](_0x230f0c));_0x10524a(_0x230f0c);})[_0x3554('0x17')](function(_0x154158){logger[_0x3554('0x13')]('GetServicenowAccount',_0x154158['message'],_0x16d849);_0x289c54(_0x1fc6f8[_0x3554('0x13')](0x1f4,_0x154158[_0x3554('0x15')]));});});};exports[_0x3554('0x22')]=function(_0x33ca80){var _0x42b795=this;return new Promise(function(_0x30408e,_0xd652c5){return db['ServicenowAccount'][_0x3554('0x23')]({'raw':_0x33ca80[_0x3554('0x1b')]?_0x33ca80['options'][_0x3554('0x24')]===undefined?!![]:![]:!![],'where':_0x33ca80[_0x3554('0x1b')]?_0x33ca80[_0x3554('0x1b')][_0x3554('0x1c')]||null:null,'attributes':_0x33ca80[_0x3554('0x1b')]?_0x33ca80[_0x3554('0x1b')]['attributes']||null:null,'include':_0x33ca80[_0x3554('0x1b')]?_0x33ca80[_0x3554('0x1b')]['include']?_[_0x3554('0x1f')](_0x33ca80['options'][_0x3554('0x20')],function(_0xdfac32){return{'model':db[_0xdfac32[_0x3554('0x21')]],'as':_0xdfac32['as'],'attributes':_0xdfac32[_0x3554('0x1d')],'include':_0xdfac32[_0x3554('0x20')]?_[_0x3554('0x1f')](_0xdfac32[_0x3554('0x20')],function(_0x50da9e){return{'model':db[_0x50da9e[_0x3554('0x21')]],'as':_0x50da9e['as'],'attributes':_0x50da9e[_0x3554('0x1d')],'include':_0x50da9e[_0x3554('0x20')]?_[_0x3554('0x1f')](_0x50da9e['include'],function(_0x177811){return{'model':db[_0x177811[_0x3554('0x21')]],'as':_0x177811['as'],'attributes':_0x177811[_0x3554('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3554('0xc')](function(_0xc6ff26){logger[_0x3554('0xd')](_0x3554('0x22'),_0x33ca80);logger['debug'](_0x3554('0x22'),_0x33ca80,JSON[_0x3554('0x12')](_0xc6ff26));_0x30408e(_0xc6ff26);})[_0x3554('0x17')](function(_0x5a8592){logger['error'](_0x3554('0x22'),_0x5a8592[_0x3554('0x15')],_0x33ca80);_0xd652c5(_0x42b795[_0x3554('0x13')](0x1f4,_0x5a8592['message']));});});}; \ No newline at end of file +var _0x2f6f=['model','ShowServicenowAccount','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x162890,_0x1ce8ab){var _0x48b819=function(_0x13515e){while(--_0x13515e){_0x162890['push'](_0x162890['shift']());}};_0x48b819(++_0x1ce8ab);}(_0x2f6f,0x102));var _0xf2f6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2f6f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf2f6('0x0'));var util=require('util');var moment=require(_0xf2f6('0x1'));var BPromise=require('bluebird');var rs=require(_0xf2f6('0x2'));var fs=require('fs');var Redis=require(_0xf2f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2f6('0x4'));var logger=require(_0xf2f6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2f6('0x6'));var client=jayson['client'][_0xf2f6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5707fb,_0x54a24d,_0x390c48){return new BPromise(function(_0x2ab315,_0xc27fae){return client[_0xf2f6('0x8')](_0x5707fb,_0x390c48)[_0xf2f6('0x9')](function(_0x1e87d8){logger[_0xf2f6('0xa')](_0xf2f6('0xb'),_0x54a24d,_0xf2f6('0xc'));logger[_0xf2f6('0xd')](_0xf2f6('0xe'),_0x54a24d,_0xf2f6('0xc'),JSON[_0xf2f6('0xf')](_0x1e87d8));if(_0x1e87d8[_0xf2f6('0x10')]){if(_0x1e87d8[_0xf2f6('0x10')][_0xf2f6('0x11')]===0x1f4){logger[_0xf2f6('0x10')](_0xf2f6('0xb'),_0x54a24d,_0x1e87d8[_0xf2f6('0x10')]['message']);return _0xc27fae(_0x1e87d8[_0xf2f6('0x10')][_0xf2f6('0x12')]);}logger[_0xf2f6('0x10')](_0xf2f6('0xb'),_0x54a24d,_0x1e87d8[_0xf2f6('0x10')][_0xf2f6('0x12')]);return _0x2ab315(_0x1e87d8[_0xf2f6('0x10')][_0xf2f6('0x12')]);}else{logger[_0xf2f6('0xa')](_0xf2f6('0xb'),_0x54a24d,_0xf2f6('0xc'));_0x2ab315(_0x1e87d8['result'][_0xf2f6('0x12')]);}})[_0xf2f6('0x13')](function(_0x2cff6c){logger[_0xf2f6('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x54a24d,_0x2cff6c);_0xc27fae(_0x2cff6c);});});}exports[_0xf2f6('0x14')]=function(_0xa80ad9){var _0x5e5bed=this;return new Promise(function(_0x5a19b4,_0xee6868){return db[_0xf2f6('0x15')][_0xf2f6('0x16')]({'raw':_0xa80ad9[_0xf2f6('0x17')]?_0xa80ad9['options'][_0xf2f6('0x18')]===undefined?!![]:![]:!![],'where':_0xa80ad9[_0xf2f6('0x17')]?_0xa80ad9[_0xf2f6('0x17')][_0xf2f6('0x19')]||null:null,'attributes':_0xa80ad9['options']?_0xa80ad9['options'][_0xf2f6('0x1a')]||null:null,'limit':_0xa80ad9['options']?_0xa80ad9['options'][_0xf2f6('0x1b')]||null:null,'include':_0xa80ad9['options']?_0xa80ad9['options'][_0xf2f6('0x1c')]?_[_0xf2f6('0x1d')](_0xa80ad9['options']['include'],function(_0x50f96b){return{'model':db[_0x50f96b[_0xf2f6('0x1e')]],'as':_0x50f96b['as'],'attributes':_0x50f96b['attributes'],'include':_0x50f96b[_0xf2f6('0x1c')]?_[_0xf2f6('0x1d')](_0x50f96b[_0xf2f6('0x1c')],function(_0x559a07){return{'model':db[_0x559a07[_0xf2f6('0x1e')]],'as':_0x559a07['as'],'attributes':_0x559a07[_0xf2f6('0x1a')],'include':_0x559a07[_0xf2f6('0x1c')]?_[_0xf2f6('0x1d')](_0x559a07['include'],function(_0x3353c1){return{'model':db[_0x3353c1[_0xf2f6('0x1e')]],'as':_0x3353c1['as'],'attributes':_0x3353c1['attributes']};}):[]};}):[]};}):[]:[]})[_0xf2f6('0x9')](function(_0x4e016c){logger['info'](_0xf2f6('0x14'),_0xa80ad9);logger[_0xf2f6('0xd')](_0xf2f6('0x14'),_0xa80ad9,JSON[_0xf2f6('0xf')](_0x4e016c));_0x5a19b4(_0x4e016c);})[_0xf2f6('0x13')](function(_0x24f4f4){logger[_0xf2f6('0x10')]('GetServicenowAccount',_0x24f4f4[_0xf2f6('0x12')],_0xa80ad9);_0xee6868(_0x5e5bed[_0xf2f6('0x10')](0x1f4,_0x24f4f4[_0xf2f6('0x12')]));});});};exports[_0xf2f6('0x1f')]=function(_0x591512){var _0x6d0842=this;return new Promise(function(_0x58eb4c,_0x1b14bf){return db[_0xf2f6('0x15')]['find']({'raw':_0x591512[_0xf2f6('0x17')]?_0x591512[_0xf2f6('0x17')][_0xf2f6('0x18')]===undefined?!![]:![]:!![],'where':_0x591512[_0xf2f6('0x17')]?_0x591512[_0xf2f6('0x17')][_0xf2f6('0x19')]||null:null,'attributes':_0x591512[_0xf2f6('0x17')]?_0x591512[_0xf2f6('0x17')][_0xf2f6('0x1a')]||null:null,'include':_0x591512[_0xf2f6('0x17')]?_0x591512[_0xf2f6('0x17')]['include']?_['map'](_0x591512[_0xf2f6('0x17')][_0xf2f6('0x1c')],function(_0x323435){return{'model':db[_0x323435['model']],'as':_0x323435['as'],'attributes':_0x323435['attributes'],'include':_0x323435[_0xf2f6('0x1c')]?_['map'](_0x323435[_0xf2f6('0x1c')],function(_0x2521c4){return{'model':db[_0x2521c4[_0xf2f6('0x1e')]],'as':_0x2521c4['as'],'attributes':_0x2521c4[_0xf2f6('0x1a')],'include':_0x2521c4['include']?_[_0xf2f6('0x1d')](_0x2521c4[_0xf2f6('0x1c')],function(_0x546114){return{'model':db[_0x546114[_0xf2f6('0x1e')]],'as':_0x546114['as'],'attributes':_0x546114[_0xf2f6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf2f6('0x9')](function(_0x335de7){logger[_0xf2f6('0xa')](_0xf2f6('0x1f'),_0x591512);logger[_0xf2f6('0xd')](_0xf2f6('0x1f'),_0x591512,JSON['stringify'](_0x335de7));_0x58eb4c(_0x335de7);})['catch'](function(_0x365b2e){logger[_0xf2f6('0x10')]('ShowServicenowAccount',_0x365b2e['message'],_0x591512);_0x1b14bf(_0x6d0842[_0xf2f6('0x10')](0x1f4,_0x365b2e[_0xf2f6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 29df067..7ee896a 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 _0x989c=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','/:id'];(function(_0x2b71ac,_0x5aeeb5){var _0xe9c88f=function(_0x12ef1f){while(--_0x12ef1f){_0x2b71ac['push'](_0x2b71ac['shift']());}};_0xe9c88f(++_0x5aeeb5);}(_0x989c,0x181));var _0xc989=function(_0xae207f,_0x4247e4){_0xae207f=_0xae207f-0x0;var _0x10027b=_0x989c[_0xae207f];return _0x10027b;};'use strict';var multer=require(_0xc989('0x0'));var util=require(_0xc989('0x1'));var path=require(_0xc989('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc989('0x3')]();var fs_extra=require(_0xc989('0x4'));var auth=require(_0xc989('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc989('0x6'));var controller=require(_0xc989('0x7'));router[_0xc989('0x8')]('/',auth[_0xc989('0x9')](),controller[_0xc989('0xa')]);router[_0xc989('0x8')]('/:id',auth[_0xc989('0x9')](),controller[_0xc989('0xb')]);router[_0xc989('0x8')](_0xc989('0xc'),auth[_0xc989('0x9')](),controller[_0xc989('0xd')]);router[_0xc989('0x8')](_0xc989('0xe'),auth[_0xc989('0x9')](),controller[_0xc989('0xf')]);router['get'](_0xc989('0x10'),auth[_0xc989('0x9')](),controller[_0xc989('0x11')]);router['post']('/',auth[_0xc989('0x9')](),controller[_0xc989('0x12')]);router[_0xc989('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc989('0x14')]);router[_0xc989('0x15')](_0xc989('0x16'),auth[_0xc989('0x9')](),controller['destroy']);module[_0xc989('0x17')]=router; \ No newline at end of file +var _0x6fd9=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports'];(function(_0x346821,_0x4148ca){var _0x82a88c=function(_0x265e51){while(--_0x265e51){_0x346821['push'](_0x346821['shift']());}};_0x82a88c(++_0x4148ca);}(_0x6fd9,0x1ee));var _0x96fd=function(_0x4ab93c,_0xb78604){_0x4ab93c=_0x4ab93c-0x0;var _0x58e67f=_0x6fd9[_0x4ab93c];return _0x58e67f;};'use strict';var multer=require(_0x96fd('0x0'));var util=require(_0x96fd('0x1'));var path=require(_0x96fd('0x2'));var timeout=require(_0x96fd('0x3'));var express=require('express');var router=express[_0x96fd('0x4')]();var fs_extra=require(_0x96fd('0x5'));var auth=require(_0x96fd('0x6'));var interaction=require(_0x96fd('0x7'));var config=require(_0x96fd('0x8'));var controller=require(_0x96fd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x96fd('0xa')]);router[_0x96fd('0xb')](_0x96fd('0xc'),auth['isAuthenticated'](),controller[_0x96fd('0xd')]);router[_0x96fd('0xb')](_0x96fd('0xe'),auth[_0x96fd('0xf')](),controller[_0x96fd('0x10')]);router[_0x96fd('0xb')](_0x96fd('0x11'),auth[_0x96fd('0xf')](),controller[_0x96fd('0x12')]);router[_0x96fd('0xb')](_0x96fd('0x13'),auth[_0x96fd('0xf')](),controller[_0x96fd('0x14')]);router[_0x96fd('0x15')]('/',auth[_0x96fd('0xf')](),controller['create']);router[_0x96fd('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x96fd('0x17')]);router['delete'](_0x96fd('0xc'),auth[_0x96fd('0xf')](),controller[_0x96fd('0x18')]);module[_0x96fd('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index ec2e654..e8def71 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 _0xb7af=['sequelize','exports','STRING'];(function(_0x259dbe,_0x1cb9f4){var _0x2e0f46=function(_0x4c7823){while(--_0x4c7823){_0x259dbe['push'](_0x259dbe['shift']());}};_0x2e0f46(++_0x1cb9f4);}(_0xb7af,0x105));var _0xfb7a=function(_0x2ade6f,_0x18d576){_0x2ade6f=_0x2ade6f-0x0;var _0x28fa0f=_0xb7af[_0x2ade6f];return _0x28fa0f;};'use strict';var Sequelize=require(_0xfb7a('0x0'));module[_0xfb7a('0x1')]={'name':{'type':Sequelize[_0xfb7a('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8aeb=['STRING','sequelize','exports'];(function(_0x316c4d,_0x21e303){var _0x370c07=function(_0x24798c){while(--_0x24798c){_0x316c4d['push'](_0x316c4d['shift']());}};_0x370c07(++_0x21e303);}(_0x8aeb,0x17e));var _0xb8ae=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x8aeb[_0x400b43];return _0x3c330f;};'use strict';var Sequelize=require(_0xb8ae('0x0'));module[_0xb8ae('0x1')]={'name':{'type':Sequelize[_0xb8ae('0x2')]},'description':{'type':Sequelize[_0xb8ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index a21bcf7..acd91c6 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 _0x30f8=['order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','destroy','getFields','findOne'];(function(_0x2470fb,_0x428701){var _0x28d133=function(_0x1410ff){while(--_0x1410ff){_0x2470fb['push'](_0x2470fb['shift']());}};_0x28d133(++_0x428701);}(_0x30f8,0xa3));var _0x830f=function(_0x528995,_0x41ff94){_0x528995=_0x528995-0x0;var _0x22db38=_0x30f8[_0x528995];return _0x22db38;};'use strict';var emlformat=require(_0x830f('0x0'));var rimraf=require(_0x830f('0x1'));var zipdir=require(_0x830f('0x2'));var jsonpatch=require(_0x830f('0x3'));var rp=require(_0x830f('0x4'));var moment=require(_0x830f('0x5'));var BPromise=require(_0x830f('0x6'));var Mustache=require(_0x830f('0x7'));var util=require(_0x830f('0x8'));var path=require(_0x830f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x830f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x830f('0xb'));var squel=require('squel');var crypto=require(_0x830f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x830f('0xd'));var toCsv=require(_0x830f('0xe'));var querystring=require(_0x830f('0xf'));var Papa=require(_0x830f('0x10'));var Redis=require(_0x830f('0x11'));var authService=require(_0x830f('0x12'));var qs=require(_0x830f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x830f('0x14'));var logger=require(_0x830f('0x15'))(_0x830f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x830f('0x17'))['db'];function respondWithStatusCode(_0xdbf4e8,_0x552eb5){_0x552eb5=_0x552eb5||0xcc;return function(_0x6e0889){if(_0x6e0889){return _0xdbf4e8[_0x830f('0x18')](_0x552eb5);}return _0xdbf4e8['status'](_0x552eb5)['end']();};}function respondWithResult(_0x344e11,_0x76d13e){_0x76d13e=_0x76d13e||0xc8;return function(_0x20a168){if(_0x20a168){return _0x344e11['status'](_0x76d13e)[_0x830f('0x19')](_0x20a168);}};}function respondWithFilteredResult(_0x31c7f0,_0x5250fd){return function(_0x7145d0){if(_0x7145d0){var _0x9ae3d8=typeof _0x5250fd[_0x830f('0x1a')]===_0x830f('0x1b')&&typeof _0x5250fd[_0x830f('0x1c')]===_0x830f('0x1b');var _0x10cc30=_0x7145d0[_0x830f('0x1d')];var _0x29e9ca=_0x9ae3d8?0x0:_0x5250fd[_0x830f('0x1a')];var _0x2ba383=_0x9ae3d8?_0x7145d0['count']:_0x5250fd[_0x830f('0x1a')]+_0x5250fd[_0x830f('0x1c')];var _0x4bf6a9;if(_0x2ba383>=_0x10cc30){_0x2ba383=_0x10cc30;_0x4bf6a9=0xc8;}else{_0x4bf6a9=0xce;}_0x31c7f0[_0x830f('0x1e')](_0x4bf6a9);return _0x31c7f0[_0x830f('0x1f')](_0x830f('0x20'),_0x29e9ca+'-'+_0x2ba383+'/'+_0x10cc30)[_0x830f('0x19')](_0x7145d0);}return null;};}function patchUpdates(_0x5c6293){return function(_0x5a3fe9){try{jsonpatch[_0x830f('0x21')](_0x5a3fe9,_0x5c6293,!![]);}catch(_0x5bc92a){return BPromise[_0x830f('0x22')](_0x5bc92a);}return _0x5a3fe9[_0x830f('0x23')]();};}function saveUpdates(_0x5ec130,_0x14e091){return function(_0x4c86ec){if(_0x4c86ec){return _0x4c86ec[_0x830f('0x24')](_0x5ec130)[_0x830f('0x25')](function(_0x4b4b62){return _0x4b4b62;});}return null;};}function removeEntity(_0x1d5c5e,_0x20446c){return function(_0x1403f5){if(_0x1403f5){return _0x1403f5['destroy']()[_0x830f('0x25')](function(){_0x1d5c5e[_0x830f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b66ce,_0x244345){return function(_0x3d1c3f){if(!_0x3d1c3f){_0x3b66ce[_0x830f('0x18')](0x194);}return _0x3d1c3f;};}function handleError(_0x54dd8a,_0xb24292){_0xb24292=_0xb24292||0x1f4;return function(_0x3ef24c){logger['error'](_0x3ef24c[_0x830f('0x26')]);if(_0x3ef24c[_0x830f('0x27')]){delete _0x3ef24c[_0x830f('0x27')];}_0x54dd8a[_0x830f('0x1e')](_0xb24292)[_0x830f('0x28')](_0x3ef24c);};}exports[_0x830f('0x29')]=function(_0x378647,_0x352a92){var _0x1fee8f={},_0x5a2136={},_0x2a3e37={'count':0x0,'rows':[]};var _0x5e5eaa=_[_0x830f('0x2a')](db[_0x830f('0x2b')][_0x830f('0x2c')],function(_0xe73370){return{'name':_0xe73370[_0x830f('0x2d')],'type':_0xe73370['type'][_0x830f('0x2e')]};});_0x5a2136[_0x830f('0x2f')]=_['map'](_0x5e5eaa,_0x830f('0x27'));_0x5a2136[_0x830f('0x30')]=_[_0x830f('0x31')](_0x378647['query']);_0x5a2136[_0x830f('0x32')]=_['intersection'](_0x5a2136[_0x830f('0x2f')],_0x5a2136[_0x830f('0x30')]);_0x1fee8f[_0x830f('0x33')]=_['intersection'](_0x5a2136['model'],qs['fields'](_0x378647[_0x830f('0x30')][_0x830f('0x34')]));_0x1fee8f[_0x830f('0x33')]=_0x1fee8f['attributes'][_0x830f('0x35')]?_0x1fee8f[_0x830f('0x33')]:_0x5a2136['model'];if(!_0x378647[_0x830f('0x30')][_0x830f('0x36')](_0x830f('0x37'))){_0x1fee8f[_0x830f('0x1c')]=qs['limit'](_0x378647[_0x830f('0x30')][_0x830f('0x1c')]);_0x1fee8f[_0x830f('0x1a')]=qs[_0x830f('0x1a')](_0x378647[_0x830f('0x30')]['offset']);}_0x1fee8f['order']=qs[_0x830f('0x38')](_0x378647[_0x830f('0x30')][_0x830f('0x38')]);_0x1fee8f[_0x830f('0x39')]=qs[_0x830f('0x32')](_[_0x830f('0x3a')](_0x378647[_0x830f('0x30')],_0x5a2136[_0x830f('0x32')]),_0x5e5eaa);if(_0x378647[_0x830f('0x30')]['filter']){_0x1fee8f[_0x830f('0x39')]=_[_0x830f('0x3b')](_0x1fee8f[_0x830f('0x39')],{'$or':_[_0x830f('0x2a')](_0x5e5eaa,function(_0x2354f0){if(_0x2354f0['type']!==_0x830f('0x3c')){var _0x1c0ad7={};_0x1c0ad7[_0x2354f0[_0x830f('0x27')]]={'$like':'%'+_0x378647[_0x830f('0x30')][_0x830f('0x3d')]+'%'};return _0x1c0ad7;}})});}_0x1fee8f=_[_0x830f('0x3b')]({},_0x1fee8f,_0x378647[_0x830f('0x3e')]);var _0x2b8c92={'where':_0x1fee8f[_0x830f('0x39')]};return db[_0x830f('0x2b')]['count'](_0x2b8c92)['then'](function(_0x190d14){_0x2a3e37[_0x830f('0x1d')]=_0x190d14;if(_0x378647[_0x830f('0x30')][_0x830f('0x3f')]){_0x1fee8f['include']=[{'all':!![]}];}return db[_0x830f('0x2b')][_0x830f('0x40')](_0x1fee8f);})['then'](function(_0x98b989){_0x2a3e37[_0x830f('0x41')]=_0x98b989;return _0x2a3e37;})['then'](respondWithFilteredResult(_0x352a92,_0x1fee8f))[_0x830f('0x42')](handleError(_0x352a92,null));};exports[_0x830f('0x43')]=function(_0x4d0ef5,_0x4e2922){var _0x1feea9={'raw':![],'where':{'id':_0x4d0ef5[_0x830f('0x44')]['id']}},_0x371bb8={};_0x371bb8[_0x830f('0x2f')]=_['keys'](db[_0x830f('0x2b')][_0x830f('0x2c')]);_0x371bb8[_0x830f('0x30')]=_[_0x830f('0x31')](_0x4d0ef5[_0x830f('0x30')]);_0x371bb8[_0x830f('0x32')]=_[_0x830f('0x45')](_0x371bb8[_0x830f('0x2f')],_0x371bb8[_0x830f('0x30')]);_0x1feea9[_0x830f('0x33')]=_[_0x830f('0x45')](_0x371bb8['model'],qs[_0x830f('0x34')](_0x4d0ef5[_0x830f('0x30')][_0x830f('0x34')]));_0x1feea9['attributes']=_0x1feea9[_0x830f('0x33')]['length']?_0x1feea9[_0x830f('0x33')]:_0x371bb8[_0x830f('0x2f')];if(_0x4d0ef5[_0x830f('0x30')][_0x830f('0x3f')]){_0x1feea9[_0x830f('0x46')]=[{'all':!![]}];}_0x1feea9=_['merge']({},_0x1feea9,_0x4d0ef5[_0x830f('0x3e')]);return db[_0x830f('0x2b')][_0x830f('0x47')](_0x1feea9)[_0x830f('0x25')](handleEntityNotFound(_0x4e2922,null))['then'](respondWithResult(_0x4e2922,null))['catch'](handleError(_0x4e2922,null));};exports['create']=function(_0x1f95d9,_0x385cf9){return db[_0x830f('0x2b')][_0x830f('0x48')](_0x1f95d9[_0x830f('0x49')],{})['then'](respondWithResult(_0x385cf9,0xc9))[_0x830f('0x42')](handleError(_0x385cf9,null));};exports[_0x830f('0x24')]=function(_0x1aee50,_0x373532){if(_0x1aee50[_0x830f('0x49')]['id']){delete _0x1aee50[_0x830f('0x49')]['id'];}return db[_0x830f('0x2b')][_0x830f('0x47')]({'where':{'id':_0x1aee50[_0x830f('0x44')]['id']}})[_0x830f('0x25')](handleEntityNotFound(_0x373532,null))[_0x830f('0x25')](saveUpdates(_0x1aee50[_0x830f('0x49')],null))[_0x830f('0x25')](respondWithResult(_0x373532,null))[_0x830f('0x42')](handleError(_0x373532,null));};exports[_0x830f('0x4a')]=function(_0x2ad828,_0x2dc46e){return db['ServicenowConfiguration'][_0x830f('0x47')]({'where':{'id':_0x2ad828[_0x830f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dc46e,null))[_0x830f('0x25')](removeEntity(_0x2dc46e,null))[_0x830f('0x42')](handleError(_0x2dc46e,null));};exports[_0x830f('0x4b')]=function(_0x68b3aa,_0x5a40ab,_0x103c69){var _0x283ed6={};var _0x29ae34={};var _0x309b20;var _0x601af1;return db[_0x830f('0x2b')][_0x830f('0x4c')]({'where':{'id':_0x68b3aa[_0x830f('0x44')]['id']}})[_0x830f('0x25')](handleEntityNotFound(_0x5a40ab,null))[_0x830f('0x25')](function(_0x17f40f){if(_0x17f40f){_0x309b20=_0x17f40f;_0x29ae34[_0x830f('0x2f')]=_[_0x830f('0x31')](db['ServicenowField']['rawAttributes']);_0x29ae34[_0x830f('0x30')]=_[_0x830f('0x31')](_0x68b3aa[_0x830f('0x30')]);_0x29ae34[_0x830f('0x32')]=_[_0x830f('0x45')](_0x29ae34[_0x830f('0x2f')],_0x29ae34[_0x830f('0x30')]);_0x283ed6['attributes']=_['intersection'](_0x29ae34[_0x830f('0x2f')],qs['fields'](_0x68b3aa[_0x830f('0x30')][_0x830f('0x34')]));_0x283ed6[_0x830f('0x33')]=_0x283ed6[_0x830f('0x33')]['length']?_0x283ed6[_0x830f('0x33')]:_0x29ae34[_0x830f('0x2f')];_0x283ed6[_0x830f('0x4d')]=qs[_0x830f('0x38')](_0x68b3aa['query'][_0x830f('0x38')]);_0x283ed6[_0x830f('0x39')]=qs[_0x830f('0x32')](_[_0x830f('0x3a')](_0x68b3aa[_0x830f('0x30')],_0x29ae34['filters']));if(_0x68b3aa['query']['filter']){_0x283ed6['where']=_[_0x830f('0x3b')](_0x283ed6[_0x830f('0x39')],{'$or':_[_0x830f('0x2a')](_0x283ed6[_0x830f('0x33')],function(_0x2b488b){var _0x2ec8bc={};_0x2ec8bc[_0x2b488b]={'$like':'%'+_0x68b3aa['query'][_0x830f('0x3d')]+'%'};return _0x2ec8bc;})});}_0x283ed6=_[_0x830f('0x3b')]({},_0x283ed6,_0x68b3aa[_0x830f('0x3e')]);return _0x309b20[_0x830f('0x4b')](_0x283ed6);}})[_0x830f('0x25')](function(_0x56068f){if(_0x56068f){_0x601af1=_0x56068f[_0x830f('0x35')];if(!_0x68b3aa[_0x830f('0x30')][_0x830f('0x36')](_0x830f('0x37'))){_0x283ed6[_0x830f('0x1c')]=qs['limit'](_0x68b3aa['query'][_0x830f('0x1c')]);_0x283ed6[_0x830f('0x1a')]=qs[_0x830f('0x1a')](_0x68b3aa[_0x830f('0x30')][_0x830f('0x1a')]);}return _0x309b20[_0x830f('0x4b')](_0x283ed6);}})['then'](function(_0x24b159){if(_0x24b159){return _0x24b159?{'count':_0x601af1,'rows':_0x24b159}:null;}})[_0x830f('0x25')](respondWithResult(_0x5a40ab,null))['catch'](handleError(_0x5a40ab,null));};exports[_0x830f('0x4e')]=function(_0x4920dd,_0x3e14f2,_0x1fdb8e){var _0x16becc={};var _0x33b90a={};var _0x70b3ee;var _0x49dc05;return db[_0x830f('0x2b')][_0x830f('0x4c')]({'where':{'id':_0x4920dd[_0x830f('0x44')]['id']}})[_0x830f('0x25')](handleEntityNotFound(_0x3e14f2,null))['then'](function(_0x42164c){if(_0x42164c){_0x70b3ee=_0x42164c;_0x33b90a['model']=_[_0x830f('0x31')](db['ServicenowField'][_0x830f('0x2c')]);_0x33b90a[_0x830f('0x30')]=_['keys'](_0x4920dd['query']);_0x33b90a[_0x830f('0x32')]=_[_0x830f('0x45')](_0x33b90a['model'],_0x33b90a['query']);_0x16becc['attributes']=_['intersection'](_0x33b90a['model'],qs['fields'](_0x4920dd[_0x830f('0x30')][_0x830f('0x34')]));_0x16becc[_0x830f('0x33')]=_0x16becc[_0x830f('0x33')][_0x830f('0x35')]?_0x16becc[_0x830f('0x33')]:_0x33b90a[_0x830f('0x2f')];_0x16becc[_0x830f('0x4d')]=qs['sort'](_0x4920dd[_0x830f('0x30')][_0x830f('0x38')]);_0x16becc[_0x830f('0x39')]=qs['filters'](_[_0x830f('0x3a')](_0x4920dd[_0x830f('0x30')],_0x33b90a['filters']));if(_0x4920dd['query'][_0x830f('0x3d')]){_0x16becc['where']=_[_0x830f('0x3b')](_0x16becc[_0x830f('0x39')],{'$or':_[_0x830f('0x2a')](_0x16becc['attributes'],function(_0x2eed14){var _0x5ab2ac={};_0x5ab2ac[_0x2eed14]={'$like':'%'+_0x4920dd[_0x830f('0x30')][_0x830f('0x3d')]+'%'};return _0x5ab2ac;})});}_0x16becc=_[_0x830f('0x3b')]({},_0x16becc,_0x4920dd['options']);return _0x70b3ee['getSubjects'](_0x16becc);}})['then'](function(_0x29d572){if(_0x29d572){_0x49dc05=_0x29d572['length'];if(!_0x4920dd[_0x830f('0x30')][_0x830f('0x36')](_0x830f('0x37'))){_0x16becc[_0x830f('0x1c')]=qs['limit'](_0x4920dd[_0x830f('0x30')][_0x830f('0x1c')]);_0x16becc[_0x830f('0x1a')]=qs[_0x830f('0x1a')](_0x4920dd[_0x830f('0x30')][_0x830f('0x1a')]);}return _0x70b3ee['getSubjects'](_0x16becc);}})['then'](function(_0x19b7e1){if(_0x19b7e1){return _0x19b7e1?{'count':_0x49dc05,'rows':_0x19b7e1}:null;}})['then'](respondWithResult(_0x3e14f2,null))['catch'](handleError(_0x3e14f2,null));};exports[_0x830f('0x4f')]=function(_0x5ec234,_0x28e74a,_0x46cac3){var _0x31a6b9={};var _0x4cf29d={};var _0x58775d;var _0x122f8a;return db[_0x830f('0x2b')][_0x830f('0x4c')]({'where':{'id':_0x5ec234[_0x830f('0x44')]['id']}})[_0x830f('0x25')](handleEntityNotFound(_0x28e74a,null))['then'](function(_0x37492f){if(_0x37492f){_0x58775d=_0x37492f;_0x4cf29d[_0x830f('0x2f')]=_[_0x830f('0x31')](db['ServicenowField'][_0x830f('0x2c')]);_0x4cf29d[_0x830f('0x30')]=_[_0x830f('0x31')](_0x5ec234[_0x830f('0x30')]);_0x4cf29d[_0x830f('0x32')]=_[_0x830f('0x45')](_0x4cf29d[_0x830f('0x2f')],_0x4cf29d[_0x830f('0x30')]);_0x31a6b9['attributes']=_[_0x830f('0x45')](_0x4cf29d['model'],qs['fields'](_0x5ec234[_0x830f('0x30')][_0x830f('0x34')]));_0x31a6b9[_0x830f('0x33')]=_0x31a6b9[_0x830f('0x33')][_0x830f('0x35')]?_0x31a6b9[_0x830f('0x33')]:_0x4cf29d[_0x830f('0x2f')];_0x31a6b9[_0x830f('0x4d')]=qs['sort'](_0x5ec234['query'][_0x830f('0x38')]);_0x31a6b9[_0x830f('0x39')]=qs[_0x830f('0x32')](_[_0x830f('0x3a')](_0x5ec234[_0x830f('0x30')],_0x4cf29d[_0x830f('0x32')]));if(_0x5ec234['query'][_0x830f('0x3d')]){_0x31a6b9[_0x830f('0x39')]=_[_0x830f('0x3b')](_0x31a6b9[_0x830f('0x39')],{'$or':_['map'](_0x31a6b9[_0x830f('0x33')],function(_0x20b1a2){var _0x198317={};_0x198317[_0x20b1a2]={'$like':'%'+_0x5ec234[_0x830f('0x30')][_0x830f('0x3d')]+'%'};return _0x198317;})});}_0x31a6b9=_[_0x830f('0x3b')]({},_0x31a6b9,_0x5ec234[_0x830f('0x3e')]);return _0x58775d[_0x830f('0x4f')](_0x31a6b9);}})[_0x830f('0x25')](function(_0x5bbc20){if(_0x5bbc20){_0x122f8a=_0x5bbc20[_0x830f('0x35')];if(!_0x5ec234['query']['hasOwnProperty']('nolimit')){_0x31a6b9['limit']=qs['limit'](_0x5ec234[_0x830f('0x30')][_0x830f('0x1c')]);_0x31a6b9[_0x830f('0x1a')]=qs[_0x830f('0x1a')](_0x5ec234[_0x830f('0x30')][_0x830f('0x1a')]);}return _0x58775d[_0x830f('0x4f')](_0x31a6b9);}})[_0x830f('0x25')](function(_0x2a95d5){if(_0x2a95d5){return _0x2a95d5?{'count':_0x122f8a,'rows':_0x2a95d5}:null;}})[_0x830f('0x25')](respondWithResult(_0x28e74a,null))[_0x830f('0x42')](handleError(_0x28e74a,null));}; \ No newline at end of file +var _0x8f7c=['where','pick','merge','VIRTUAL','options','include','rows','params','includeAll','find','catch','body','destroy','getFields','findOne','filter','getSubjects','ServicenowField','nolimit','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','map','ServicenowConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x4e848e,_0x326a58){var _0x49d3a2=function(_0x546b74){while(--_0x546b74){_0x4e848e['push'](_0x4e848e['shift']());}};_0x49d3a2(++_0x326a58);}(_0x8f7c,0x64));var _0xc8f7=function(_0x3cc801,_0x4b511c){_0x3cc801=_0x3cc801-0x0;var _0x502f44=_0x8f7c[_0x3cc801];return _0x502f44;};'use strict';var emlformat=require(_0xc8f7('0x0'));var rimraf=require(_0xc8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc8f7('0x2'));var rp=require(_0xc8f7('0x3'));var moment=require(_0xc8f7('0x4'));var BPromise=require(_0xc8f7('0x5'));var Mustache=require(_0xc8f7('0x6'));var util=require(_0xc8f7('0x7'));var path=require('path');var sox=require(_0xc8f7('0x8'));var csv=require('to-csv');var ejs=require(_0xc8f7('0x9'));var fs=require('fs');var fs_extra=require(_0xc8f7('0xa'));var _=require(_0xc8f7('0xb'));var squel=require(_0xc8f7('0xc'));var crypto=require(_0xc8f7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc8f7('0xe'));var toCsv=require(_0xc8f7('0xf'));var querystring=require('querystring');var Papa=require(_0xc8f7('0x10'));var Redis=require(_0xc8f7('0x11'));var authService=require(_0xc8f7('0x12'));var qs=require(_0xc8f7('0x13'));var as=require(_0xc8f7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8f7('0x15'))(_0xc8f7('0x16'));var utils=require(_0xc8f7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc8f7('0x18'));var db=require(_0xc8f7('0x19'))['db'];function respondWithStatusCode(_0x4fba3c,_0x14ae70){_0x14ae70=_0x14ae70||0xcc;return function(_0x297e87){if(_0x297e87){return _0x4fba3c[_0xc8f7('0x1a')](_0x14ae70);}return _0x4fba3c[_0xc8f7('0x1b')](_0x14ae70)[_0xc8f7('0x1c')]();};}function respondWithResult(_0x3bfa7e,_0x1886ba){_0x1886ba=_0x1886ba||0xc8;return function(_0x3e53d6){if(_0x3e53d6){return _0x3bfa7e[_0xc8f7('0x1b')](_0x1886ba)[_0xc8f7('0x1d')](_0x3e53d6);}};}function respondWithFilteredResult(_0x167056,_0x1f1511){return function(_0x1f3514){if(_0x1f3514){var _0x14e4b8=typeof _0x1f1511[_0xc8f7('0x1e')]===_0xc8f7('0x1f')&&typeof _0x1f1511[_0xc8f7('0x20')]==='undefined';var _0x56a667=_0x1f3514[_0xc8f7('0x21')];var _0x4a034b=_0x14e4b8?0x0:_0x1f1511[_0xc8f7('0x1e')];var _0x3e5473=_0x14e4b8?_0x1f3514[_0xc8f7('0x21')]:_0x1f1511[_0xc8f7('0x1e')]+_0x1f1511['limit'];var _0x864d02;if(_0x3e5473>=_0x56a667){_0x3e5473=_0x56a667;_0x864d02=0xc8;}else{_0x864d02=0xce;}_0x167056[_0xc8f7('0x1b')](_0x864d02);return _0x167056[_0xc8f7('0x22')](_0xc8f7('0x23'),_0x4a034b+'-'+_0x3e5473+'/'+_0x56a667)[_0xc8f7('0x1d')](_0x1f3514);}return null;};}function patchUpdates(_0x1c8ee0){return function(_0x2c6482){try{jsonpatch[_0xc8f7('0x24')](_0x2c6482,_0x1c8ee0,!![]);}catch(_0x4c4287){return BPromise[_0xc8f7('0x25')](_0x4c4287);}return _0x2c6482['save']();};}function saveUpdates(_0x13b7e8,_0x70e7d8){return function(_0xc98562){if(_0xc98562){return _0xc98562[_0xc8f7('0x26')](_0x13b7e8)['then'](function(_0x3e3e8b){return _0x3e3e8b;});}return null;};}function removeEntity(_0x1cd387,_0x50c9e0){return function(_0x4280a1){if(_0x4280a1){return _0x4280a1['destroy']()[_0xc8f7('0x27')](function(){_0x1cd387[_0xc8f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1f17,_0x1b1b2a){return function(_0x1ac716){if(!_0x1ac716){_0x2e1f17[_0xc8f7('0x1a')](0x194);}return _0x1ac716;};}function handleError(_0x1ff347,_0x3bd44e){_0x3bd44e=_0x3bd44e||0x1f4;return function(_0x31655f){logger['error'](_0x31655f[_0xc8f7('0x28')]);if(_0x31655f[_0xc8f7('0x29')]){delete _0x31655f['name'];}_0x1ff347[_0xc8f7('0x1b')](_0x3bd44e)[_0xc8f7('0x2a')](_0x31655f);};}exports['index']=function(_0x374994,_0x31be60){var _0x195b9e={},_0x2c0414={},_0x42e12f={'count':0x0,'rows':[]};var _0x37ba8e=_[_0xc8f7('0x2b')](db[_0xc8f7('0x2c')][_0xc8f7('0x2d')],function(_0xc6c900){return{'name':_0xc6c900['fieldName'],'type':_0xc6c900[_0xc8f7('0x2e')][_0xc8f7('0x2f')]};});_0x2c0414[_0xc8f7('0x30')]=_['map'](_0x37ba8e,_0xc8f7('0x29'));_0x2c0414['query']=_[_0xc8f7('0x31')](_0x374994[_0xc8f7('0x32')]);_0x2c0414[_0xc8f7('0x33')]=_[_0xc8f7('0x34')](_0x2c0414['model'],_0x2c0414[_0xc8f7('0x32')]);_0x195b9e[_0xc8f7('0x35')]=_[_0xc8f7('0x34')](_0x2c0414[_0xc8f7('0x30')],qs['fields'](_0x374994[_0xc8f7('0x32')][_0xc8f7('0x36')]));_0x195b9e[_0xc8f7('0x35')]=_0x195b9e[_0xc8f7('0x35')][_0xc8f7('0x37')]?_0x195b9e['attributes']:_0x2c0414[_0xc8f7('0x30')];if(!_0x374994[_0xc8f7('0x32')][_0xc8f7('0x38')]('nolimit')){_0x195b9e['limit']=qs['limit'](_0x374994[_0xc8f7('0x32')][_0xc8f7('0x20')]);_0x195b9e[_0xc8f7('0x1e')]=qs[_0xc8f7('0x1e')](_0x374994[_0xc8f7('0x32')]['offset']);}_0x195b9e['order']=qs[_0xc8f7('0x39')](_0x374994[_0xc8f7('0x32')][_0xc8f7('0x39')]);_0x195b9e[_0xc8f7('0x3a')]=qs['filters'](_[_0xc8f7('0x3b')](_0x374994[_0xc8f7('0x32')],_0x2c0414[_0xc8f7('0x33')]),_0x37ba8e);if(_0x374994[_0xc8f7('0x32')]['filter']){_0x195b9e['where']=_[_0xc8f7('0x3c')](_0x195b9e['where'],{'$or':_[_0xc8f7('0x2b')](_0x37ba8e,function(_0x14207d){if(_0x14207d[_0xc8f7('0x2e')]!==_0xc8f7('0x3d')){var _0x320a3f={};_0x320a3f[_0x14207d['name']]={'$like':'%'+_0x374994['query']['filter']+'%'};return _0x320a3f;}})});}_0x195b9e=_[_0xc8f7('0x3c')]({},_0x195b9e,_0x374994[_0xc8f7('0x3e')]);var _0x5f0ad8={'where':_0x195b9e['where']};return db['ServicenowConfiguration'][_0xc8f7('0x21')](_0x5f0ad8)[_0xc8f7('0x27')](function(_0x50705f){_0x42e12f[_0xc8f7('0x21')]=_0x50705f;if(_0x374994[_0xc8f7('0x32')]['includeAll']){_0x195b9e[_0xc8f7('0x3f')]=[{'all':!![]}];}return db[_0xc8f7('0x2c')]['findAll'](_0x195b9e);})[_0xc8f7('0x27')](function(_0x203792){_0x42e12f[_0xc8f7('0x40')]=_0x203792;return _0x42e12f;})[_0xc8f7('0x27')](respondWithFilteredResult(_0x31be60,_0x195b9e))['catch'](handleError(_0x31be60,null));};exports['show']=function(_0x93d7b9,_0x38108b){var _0x114651={'raw':![],'where':{'id':_0x93d7b9[_0xc8f7('0x41')]['id']}},_0x1f6a0c={};_0x1f6a0c['model']=_[_0xc8f7('0x31')](db['ServicenowConfiguration'][_0xc8f7('0x2d')]);_0x1f6a0c[_0xc8f7('0x32')]=_[_0xc8f7('0x31')](_0x93d7b9[_0xc8f7('0x32')]);_0x1f6a0c[_0xc8f7('0x33')]=_[_0xc8f7('0x34')](_0x1f6a0c[_0xc8f7('0x30')],_0x1f6a0c[_0xc8f7('0x32')]);_0x114651['attributes']=_[_0xc8f7('0x34')](_0x1f6a0c[_0xc8f7('0x30')],qs['fields'](_0x93d7b9[_0xc8f7('0x32')][_0xc8f7('0x36')]));_0x114651[_0xc8f7('0x35')]=_0x114651[_0xc8f7('0x35')][_0xc8f7('0x37')]?_0x114651[_0xc8f7('0x35')]:_0x1f6a0c[_0xc8f7('0x30')];if(_0x93d7b9[_0xc8f7('0x32')][_0xc8f7('0x42')]){_0x114651['include']=[{'all':!![]}];}_0x114651=_['merge']({},_0x114651,_0x93d7b9[_0xc8f7('0x3e')]);return db[_0xc8f7('0x2c')][_0xc8f7('0x43')](_0x114651)[_0xc8f7('0x27')](handleEntityNotFound(_0x38108b,null))[_0xc8f7('0x27')](respondWithResult(_0x38108b,null))[_0xc8f7('0x44')](handleError(_0x38108b,null));};exports['create']=function(_0x20c807,_0x239296){return db[_0xc8f7('0x2c')]['create'](_0x20c807[_0xc8f7('0x45')],{})[_0xc8f7('0x27')](respondWithResult(_0x239296,0xc9))[_0xc8f7('0x44')](handleError(_0x239296,null));};exports[_0xc8f7('0x26')]=function(_0x25db34,_0x8c702e){if(_0x25db34[_0xc8f7('0x45')]['id']){delete _0x25db34[_0xc8f7('0x45')]['id'];}return db[_0xc8f7('0x2c')][_0xc8f7('0x43')]({'where':{'id':_0x25db34[_0xc8f7('0x41')]['id']}})[_0xc8f7('0x27')](handleEntityNotFound(_0x8c702e,null))['then'](saveUpdates(_0x25db34[_0xc8f7('0x45')],null))[_0xc8f7('0x27')](respondWithResult(_0x8c702e,null))[_0xc8f7('0x44')](handleError(_0x8c702e,null));};exports[_0xc8f7('0x46')]=function(_0x38b628,_0x39a393){return db[_0xc8f7('0x2c')][_0xc8f7('0x43')]({'where':{'id':_0x38b628['params']['id']}})[_0xc8f7('0x27')](handleEntityNotFound(_0x39a393,null))['then'](removeEntity(_0x39a393,null))[_0xc8f7('0x44')](handleError(_0x39a393,null));};exports[_0xc8f7('0x47')]=function(_0x50af72,_0x4fa76b,_0x2021af){var _0x5bcefe={};var _0x3f9cc5={};var _0x5b19b3;var _0x303c25;return db['ServicenowConfiguration'][_0xc8f7('0x48')]({'where':{'id':_0x50af72['params']['id']}})[_0xc8f7('0x27')](handleEntityNotFound(_0x4fa76b,null))[_0xc8f7('0x27')](function(_0x4cd47d){if(_0x4cd47d){_0x5b19b3=_0x4cd47d;_0x3f9cc5[_0xc8f7('0x30')]=_[_0xc8f7('0x31')](db['ServicenowField'][_0xc8f7('0x2d')]);_0x3f9cc5['query']=_[_0xc8f7('0x31')](_0x50af72[_0xc8f7('0x32')]);_0x3f9cc5['filters']=_[_0xc8f7('0x34')](_0x3f9cc5[_0xc8f7('0x30')],_0x3f9cc5['query']);_0x5bcefe[_0xc8f7('0x35')]=_[_0xc8f7('0x34')](_0x3f9cc5[_0xc8f7('0x30')],qs[_0xc8f7('0x36')](_0x50af72[_0xc8f7('0x32')][_0xc8f7('0x36')]));_0x5bcefe[_0xc8f7('0x35')]=_0x5bcefe[_0xc8f7('0x35')][_0xc8f7('0x37')]?_0x5bcefe[_0xc8f7('0x35')]:_0x3f9cc5['model'];_0x5bcefe['order']=qs['sort'](_0x50af72[_0xc8f7('0x32')][_0xc8f7('0x39')]);_0x5bcefe[_0xc8f7('0x3a')]=qs['filters'](_[_0xc8f7('0x3b')](_0x50af72[_0xc8f7('0x32')],_0x3f9cc5[_0xc8f7('0x33')]));if(_0x50af72[_0xc8f7('0x32')][_0xc8f7('0x49')]){_0x5bcefe[_0xc8f7('0x3a')]=_[_0xc8f7('0x3c')](_0x5bcefe['where'],{'$or':_['map'](_0x5bcefe[_0xc8f7('0x35')],function(_0x1c4345){var _0x57a950={};_0x57a950[_0x1c4345]={'$like':'%'+_0x50af72[_0xc8f7('0x32')]['filter']+'%'};return _0x57a950;})});}_0x5bcefe=_[_0xc8f7('0x3c')]({},_0x5bcefe,_0x50af72['options']);return _0x5b19b3['getFields'](_0x5bcefe);}})[_0xc8f7('0x27')](function(_0x1772e3){if(_0x1772e3){_0x303c25=_0x1772e3[_0xc8f7('0x37')];if(!_0x50af72[_0xc8f7('0x32')][_0xc8f7('0x38')]('nolimit')){_0x5bcefe[_0xc8f7('0x20')]=qs[_0xc8f7('0x20')](_0x50af72[_0xc8f7('0x32')]['limit']);_0x5bcefe[_0xc8f7('0x1e')]=qs[_0xc8f7('0x1e')](_0x50af72[_0xc8f7('0x32')][_0xc8f7('0x1e')]);}return _0x5b19b3[_0xc8f7('0x47')](_0x5bcefe);}})[_0xc8f7('0x27')](function(_0x214336){if(_0x214336){return _0x214336?{'count':_0x303c25,'rows':_0x214336}:null;}})['then'](respondWithResult(_0x4fa76b,null))[_0xc8f7('0x44')](handleError(_0x4fa76b,null));};exports[_0xc8f7('0x4a')]=function(_0x5bb12d,_0x198e42,_0x22c8a0){var _0x51f6c1={};var _0x4366f8={};var _0x164365;var _0x3bbc3b;return db[_0xc8f7('0x2c')]['findOne']({'where':{'id':_0x5bb12d[_0xc8f7('0x41')]['id']}})['then'](handleEntityNotFound(_0x198e42,null))[_0xc8f7('0x27')](function(_0x25b944){if(_0x25b944){_0x164365=_0x25b944;_0x4366f8[_0xc8f7('0x30')]=_[_0xc8f7('0x31')](db[_0xc8f7('0x4b')][_0xc8f7('0x2d')]);_0x4366f8[_0xc8f7('0x32')]=_[_0xc8f7('0x31')](_0x5bb12d['query']);_0x4366f8[_0xc8f7('0x33')]=_[_0xc8f7('0x34')](_0x4366f8['model'],_0x4366f8[_0xc8f7('0x32')]);_0x51f6c1[_0xc8f7('0x35')]=_[_0xc8f7('0x34')](_0x4366f8[_0xc8f7('0x30')],qs[_0xc8f7('0x36')](_0x5bb12d['query'][_0xc8f7('0x36')]));_0x51f6c1[_0xc8f7('0x35')]=_0x51f6c1[_0xc8f7('0x35')][_0xc8f7('0x37')]?_0x51f6c1[_0xc8f7('0x35')]:_0x4366f8[_0xc8f7('0x30')];_0x51f6c1['order']=qs[_0xc8f7('0x39')](_0x5bb12d[_0xc8f7('0x32')][_0xc8f7('0x39')]);_0x51f6c1[_0xc8f7('0x3a')]=qs[_0xc8f7('0x33')](_['pick'](_0x5bb12d[_0xc8f7('0x32')],_0x4366f8[_0xc8f7('0x33')]));if(_0x5bb12d[_0xc8f7('0x32')][_0xc8f7('0x49')]){_0x51f6c1['where']=_[_0xc8f7('0x3c')](_0x51f6c1[_0xc8f7('0x3a')],{'$or':_['map'](_0x51f6c1['attributes'],function(_0xd2a9e2){var _0x331be2={};_0x331be2[_0xd2a9e2]={'$like':'%'+_0x5bb12d[_0xc8f7('0x32')]['filter']+'%'};return _0x331be2;})});}_0x51f6c1=_[_0xc8f7('0x3c')]({},_0x51f6c1,_0x5bb12d[_0xc8f7('0x3e')]);return _0x164365[_0xc8f7('0x4a')](_0x51f6c1);}})['then'](function(_0x33f047){if(_0x33f047){_0x3bbc3b=_0x33f047[_0xc8f7('0x37')];if(!_0x5bb12d[_0xc8f7('0x32')][_0xc8f7('0x38')](_0xc8f7('0x4c'))){_0x51f6c1[_0xc8f7('0x20')]=qs[_0xc8f7('0x20')](_0x5bb12d['query'][_0xc8f7('0x20')]);_0x51f6c1[_0xc8f7('0x1e')]=qs['offset'](_0x5bb12d[_0xc8f7('0x32')][_0xc8f7('0x1e')]);}return _0x164365['getSubjects'](_0x51f6c1);}})[_0xc8f7('0x27')](function(_0x440eed){if(_0x440eed){return _0x440eed?{'count':_0x3bbc3b,'rows':_0x440eed}:null;}})['then'](respondWithResult(_0x198e42,null))['catch'](handleError(_0x198e42,null));};exports['getDescriptions']=function(_0x121ac6,_0x342bb5,_0x137424){var _0x1b4b06={};var _0x438cc4={};var _0x4ee430;var _0xf9dcf8;return db[_0xc8f7('0x2c')]['findOne']({'where':{'id':_0x121ac6[_0xc8f7('0x41')]['id']}})['then'](handleEntityNotFound(_0x342bb5,null))[_0xc8f7('0x27')](function(_0x399545){if(_0x399545){_0x4ee430=_0x399545;_0x438cc4['model']=_['keys'](db[_0xc8f7('0x4b')][_0xc8f7('0x2d')]);_0x438cc4[_0xc8f7('0x32')]=_[_0xc8f7('0x31')](_0x121ac6['query']);_0x438cc4['filters']=_[_0xc8f7('0x34')](_0x438cc4[_0xc8f7('0x30')],_0x438cc4[_0xc8f7('0x32')]);_0x1b4b06['attributes']=_[_0xc8f7('0x34')](_0x438cc4[_0xc8f7('0x30')],qs[_0xc8f7('0x36')](_0x121ac6[_0xc8f7('0x32')][_0xc8f7('0x36')]));_0x1b4b06[_0xc8f7('0x35')]=_0x1b4b06[_0xc8f7('0x35')]['length']?_0x1b4b06['attributes']:_0x438cc4[_0xc8f7('0x30')];_0x1b4b06[_0xc8f7('0x4d')]=qs[_0xc8f7('0x39')](_0x121ac6[_0xc8f7('0x32')][_0xc8f7('0x39')]);_0x1b4b06[_0xc8f7('0x3a')]=qs[_0xc8f7('0x33')](_[_0xc8f7('0x3b')](_0x121ac6[_0xc8f7('0x32')],_0x438cc4['filters']));if(_0x121ac6[_0xc8f7('0x32')][_0xc8f7('0x49')]){_0x1b4b06[_0xc8f7('0x3a')]=_[_0xc8f7('0x3c')](_0x1b4b06[_0xc8f7('0x3a')],{'$or':_[_0xc8f7('0x2b')](_0x1b4b06[_0xc8f7('0x35')],function(_0x20b5cd){var _0x5b6ed4={};_0x5b6ed4[_0x20b5cd]={'$like':'%'+_0x121ac6['query'][_0xc8f7('0x49')]+'%'};return _0x5b6ed4;})});}_0x1b4b06=_['merge']({},_0x1b4b06,_0x121ac6[_0xc8f7('0x3e')]);return _0x4ee430[_0xc8f7('0x4e')](_0x1b4b06);}})[_0xc8f7('0x27')](function(_0x215d8d){if(_0x215d8d){_0xf9dcf8=_0x215d8d['length'];if(!_0x121ac6[_0xc8f7('0x32')][_0xc8f7('0x38')]('nolimit')){_0x1b4b06[_0xc8f7('0x20')]=qs[_0xc8f7('0x20')](_0x121ac6['query']['limit']);_0x1b4b06[_0xc8f7('0x1e')]=qs[_0xc8f7('0x1e')](_0x121ac6[_0xc8f7('0x32')][_0xc8f7('0x1e')]);}return _0x4ee430['getDescriptions'](_0x1b4b06);}})['then'](function(_0x170350){if(_0x170350){return _0x170350?{'count':_0xf9dcf8,'rows':_0x170350}:null;}})['then'](respondWithResult(_0x342bb5,null))[_0xc8f7('0x44')](handleError(_0x342bb5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 8e285b3..08c6a22 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 _0x0c6b=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4f38b2,_0x574021){var _0x40f571=function(_0xee31c1){while(--_0xee31c1){_0x4f38b2['push'](_0x4f38b2['shift']());}};_0x40f571(++_0x574021);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x3d92dc,_0xacb5a2){_0x3d92dc=_0x3d92dc-0x0;var _0x2211d7=_0x0c6b[_0x3d92dc];return _0x2211d7;};'use strict';var _=require(_0xb0c6('0x0'));var util=require('util');var logger=require(_0xb0c6('0x1'))(_0xb0c6('0x2'));var moment=require(_0xb0c6('0x3'));var BPromise=require(_0xb0c6('0x4'));var rp=require(_0xb0c6('0x5'));var fs=require('fs');var path=require(_0xb0c6('0x6'));var rimraf=require(_0xb0c6('0x7'));var config=require(_0xb0c6('0x8'));var attributes=require(_0xb0c6('0x9'));module[_0xb0c6('0xa')]=function(_0xc26f64,_0x56c7c9){return _0xc26f64['define']('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4065=['./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','api','bluebird','request-promise','path','../../config/environment'];(function(_0x599e10,_0x19eb11){var _0x2582fa=function(_0x38c672){while(--_0x38c672){_0x599e10['push'](_0x599e10['shift']());}};_0x2582fa(++_0x19eb11);}(_0x4065,0xdc));var _0x5406=function(_0x853c09,_0x5316b7){_0x853c09=_0x853c09-0x0;var _0x11d474=_0x4065[_0x853c09];return _0x11d474;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5406('0x0'));var moment=require('moment');var BPromise=require(_0x5406('0x1'));var rp=require(_0x5406('0x2'));var fs=require('fs');var path=require(_0x5406('0x3'));var rimraf=require('rimraf');var config=require(_0x5406('0x4'));var attributes=require(_0x5406('0x5'));module['exports']=function(_0x1d2a1c,_0x3bf3db){return _0x1d2a1c[_0x5406('0x6')](_0x5406('0x7'),attributes,{'tableName':_0x5406('0x8'),'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 40250dd..020d62e 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 _0x4d21=['request\x20sent','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x27f11f,_0x2256c8){var _0x3baf31=function(_0x7226e){while(--_0x7226e){_0x27f11f['push'](_0x27f11f['shift']());}};_0x3baf31(++_0x2256c8);}(_0x4d21,0xc3));var _0x14d2=function(_0x5d76f6,_0x2658cd){_0x5d76f6=_0x5d76f6-0x0;var _0x34b2e0=_0x4d21[_0x5d76f6];return _0x34b2e0;};'use strict';var _=require(_0x14d2('0x0'));var util=require(_0x14d2('0x1'));var moment=require(_0x14d2('0x2'));var BPromise=require(_0x14d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d2('0x4'));var db=require(_0x14d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14d2('0x6'));var config=require(_0x14d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14d2('0x8')][_0x14d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40b07e,_0x4418cf,_0x376637){return new BPromise(function(_0x53e11c,_0x50d0c2){return client['request'](_0x40b07e,_0x376637)[_0x14d2('0xa')](function(_0x4f6470){logger[_0x14d2('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4418cf,'request\x20sent');logger[_0x14d2('0xc')](_0x14d2('0xd'),_0x4418cf,_0x14d2('0xe'),JSON['stringify'](_0x4f6470));if(_0x4f6470[_0x14d2('0xf')]){if(_0x4f6470[_0x14d2('0xf')]['code']===0x1f4){logger[_0x14d2('0xf')](_0x14d2('0x10'),_0x4418cf,_0x4f6470[_0x14d2('0xf')][_0x14d2('0x11')]);return _0x50d0c2(_0x4f6470[_0x14d2('0xf')]['message']);}logger[_0x14d2('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4418cf,_0x4f6470[_0x14d2('0xf')]['message']);return _0x53e11c(_0x4f6470[_0x14d2('0xf')][_0x14d2('0x11')]);}else{logger['info'](_0x14d2('0x10'),_0x4418cf,_0x14d2('0xe'));_0x53e11c(_0x4f6470['result'][_0x14d2('0x11')]);}})[_0x14d2('0x12')](function(_0x542f4e){logger[_0x14d2('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4418cf,_0x542f4e);_0x50d0c2(_0x542f4e);});});} \ No newline at end of file +var _0x510e=['client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x510e,0x1ed));var _0xe510=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x510e[_0xa8883];return _0x479426;};'use strict';var _=require(_0xe510('0x0'));var util=require(_0xe510('0x1'));var moment=require(_0xe510('0x2'));var BPromise=require(_0xe510('0x3'));var rs=require(_0xe510('0x4'));var fs=require('fs');var Redis=require(_0xe510('0x5'));var db=require(_0xe510('0x6'))['db'];var utils=require(_0xe510('0x7'));var logger=require(_0xe510('0x8'))('rpc');var config=require(_0xe510('0x9'));var jayson=require(_0xe510('0xa'));var client=jayson[_0xe510('0xb')][_0xe510('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26cffc,_0x18ec55,_0x27ca15){return new BPromise(function(_0x42b48c,_0x2f5db7){return client[_0xe510('0xd')](_0x26cffc,_0x27ca15)[_0xe510('0xe')](function(_0xf2a94b){logger[_0xe510('0xf')](_0xe510('0x10'),_0x18ec55,'request\x20sent');logger[_0xe510('0x11')](_0xe510('0x12'),_0x18ec55,_0xe510('0x13'),JSON[_0xe510('0x14')](_0xf2a94b));if(_0xf2a94b[_0xe510('0x15')]){if(_0xf2a94b[_0xe510('0x15')]['code']===0x1f4){logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);return _0x2f5db7(_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);}logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);return _0x42b48c(_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);}else{logger['info'](_0xe510('0x10'),_0x18ec55,'request\x20sent');_0x42b48c(_0xf2a94b['result'][_0xe510('0x16')]);}})[_0xe510('0x17')](function(_0x2684b4){logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0x2684b4);_0x2f5db7(_0x2684b4);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 90adfa2..777fa56 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 _0x10f1=['post','create','put','update','destroy','exports','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2de84f,_0x582a3b){var _0x450f2f=function(_0x31febe){while(--_0x31febe){_0x2de84f['push'](_0x2de84f['shift']());}};_0x450f2f(++_0x582a3b);}(_0x10f1,0xf6));var _0x110f=function(_0x401e3c,_0x1e77c2){_0x401e3c=_0x401e3c-0x0;var _0x188347=_0x10f1[_0x401e3c];return _0x188347;};'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['Router']();var fs_extra=require(_0x110f('0x0'));var auth=require(_0x110f('0x1'));var interaction=require(_0x110f('0x2'));var config=require(_0x110f('0x3'));var controller=require('./intServicenowField.controller');router[_0x110f('0x4')]('/',auth[_0x110f('0x5')](),controller[_0x110f('0x6')]);router['get'](_0x110f('0x7'),auth[_0x110f('0x5')](),controller[_0x110f('0x8')]);router[_0x110f('0x9')]('/',auth[_0x110f('0x5')](),controller[_0x110f('0xa')]);router[_0x110f('0xb')](_0x110f('0x7'),auth[_0x110f('0x5')](),controller[_0x110f('0xc')]);router['delete'](_0x110f('0x7'),auth[_0x110f('0x5')](),controller[_0x110f('0xd')]);module[_0x110f('0xe')]=router; \ No newline at end of file +var _0x6fdc=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x6fdc,0xbc));var _0xc6fd=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0x6fdc[_0x224dda];return _0x2987ac;};'use strict';var multer=require(_0xc6fd('0x0'));var util=require(_0xc6fd('0x1'));var path=require(_0xc6fd('0x2'));var timeout=require(_0xc6fd('0x3'));var express=require(_0xc6fd('0x4'));var router=express['Router']();var fs_extra=require(_0xc6fd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6fd('0x6'));var config=require('../../config/environment');var controller=require(_0xc6fd('0x7'));router[_0xc6fd('0x8')]('/',auth['isAuthenticated'](),controller[_0xc6fd('0x9')]);router[_0xc6fd('0x8')](_0xc6fd('0xa'),auth[_0xc6fd('0xb')](),controller['show']);router[_0xc6fd('0xc')]('/',auth[_0xc6fd('0xb')](),controller[_0xc6fd('0xd')]);router[_0xc6fd('0xe')](_0xc6fd('0xa'),auth['isAuthenticated'](),controller[_0xc6fd('0xf')]);router[_0xc6fd('0x10')](_0xc6fd('0xa'),auth[_0xc6fd('0xb')](),controller[_0xc6fd('0x11')]);module[_0xc6fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 23adc1a..49e5fd5 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 _0x606b=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x1d26dc,_0xff1b2a){var _0x18b941=function(_0x33a6ea){while(--_0x33a6ea){_0x1d26dc['push'](_0x1d26dc['shift']());}};_0x18b941(++_0xff1b2a);}(_0x606b,0x10d));var _0xb606=function(_0x3ff50f,_0x5d14c4){_0x3ff50f=_0x3ff50f-0x0;var _0x1368cf=_0x606b[_0x3ff50f];return _0x1368cf;};'use strict';var Sequelize=require(_0xb606('0x0'));module[_0xb606('0x1')]={'type':{'type':Sequelize[_0xb606('0x2')](_0xb606('0x3'),_0xb606('0x4'),'customVariable',_0xb606('0x5'),'picklist'),'defaultValue':_0xb606('0x3')},'content':{'type':Sequelize[_0xb606('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb606('0x2')](_0xb606('0x3'),_0xb606('0x4'),_0xb606('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xb606('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb606('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb606('0x6')]}}; \ No newline at end of file +var _0xccd6=['sequelize','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xccd6,0x190));var _0x6ccd=function(_0x4dcbe5,_0x3f98d7){_0x4dcbe5=_0x4dcbe5-0x0;var _0x45ac5c=_0xccd6[_0x4dcbe5];return _0x45ac5c;};'use strict';var Sequelize=require(_0x6ccd('0x0'));module['exports']={'type':{'type':Sequelize[_0x6ccd('0x1')](_0x6ccd('0x2'),_0x6ccd('0x3'),'customVariable',_0x6ccd('0x4'),_0x6ccd('0x5')),'defaultValue':_0x6ccd('0x2')},'content':{'type':Sequelize[_0x6ccd('0x6')]},'key':{'type':Sequelize[_0x6ccd('0x6')]},'keyType':{'type':Sequelize[_0x6ccd('0x1')]('string',_0x6ccd('0x3'),_0x6ccd('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6ccd('0x6')]},'nameField':{'type':Sequelize[_0x6ccd('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ccd('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 622ca99..571b2db 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 _0x7e91=['nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','create','body','update','find','params','eml-format','zip-dir','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','reject','then','destroy','name','send','index','map','ServicenowField','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7e91,0x16f));var _0x17e9=function(_0x38f215,_0x30452d){_0x38f215=_0x38f215-0x0;var _0x5a9b48=_0x7e91[_0x38f215];return _0x5a9b48;};'use strict';var emlformat=require(_0x17e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x17e9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x17e9('0x2'));var BPromise=require(_0x17e9('0x3'));var Mustache=require('mustache');var util=require(_0x17e9('0x4'));var path=require(_0x17e9('0x5'));var sox=require(_0x17e9('0x6'));var csv=require('to-csv');var ejs=require(_0x17e9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17e9('0x8'));var squel=require(_0x17e9('0x9'));var crypto=require(_0x17e9('0xa'));var jsforce=require(_0x17e9('0xb'));var deskjs=require(_0x17e9('0xc'));var toCsv=require(_0x17e9('0xd'));var querystring=require(_0x17e9('0xe'));var Papa=require(_0x17e9('0xf'));var Redis=require('ioredis');var authService=require(_0x17e9('0x10'));var qs=require(_0x17e9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17e9('0x12'));var logger=require(_0x17e9('0x13'))(_0x17e9('0x14'));var utils=require(_0x17e9('0x15'));var config=require(_0x17e9('0x16'));var licenseUtil=require(_0x17e9('0x17'));var db=require(_0x17e9('0x18'))['db'];function respondWithStatusCode(_0x105488,_0x59f13c){_0x59f13c=_0x59f13c||0xcc;return function(_0x4e5cc7){if(_0x4e5cc7){return _0x105488[_0x17e9('0x19')](_0x59f13c);}return _0x105488[_0x17e9('0x1a')](_0x59f13c)['end']();};}function respondWithResult(_0x344593,_0x4556f6){_0x4556f6=_0x4556f6||0xc8;return function(_0x2901da){if(_0x2901da){return _0x344593[_0x17e9('0x1a')](_0x4556f6)[_0x17e9('0x1b')](_0x2901da);}};}function respondWithFilteredResult(_0x4b4c3b,_0x3219c8){return function(_0x58684e){if(_0x58684e){var _0x1dc18c=typeof _0x3219c8['offset']===_0x17e9('0x1c')&&typeof _0x3219c8[_0x17e9('0x1d')]===_0x17e9('0x1c');var _0x5a5971=_0x58684e['count'];var _0x1e4dbd=_0x1dc18c?0x0:_0x3219c8[_0x17e9('0x1e')];var _0x3bf29e=_0x1dc18c?_0x58684e[_0x17e9('0x1f')]:_0x3219c8[_0x17e9('0x1e')]+_0x3219c8['limit'];var _0x17c77c;if(_0x3bf29e>=_0x5a5971){_0x3bf29e=_0x5a5971;_0x17c77c=0xc8;}else{_0x17c77c=0xce;}_0x4b4c3b[_0x17e9('0x1a')](_0x17c77c);return _0x4b4c3b[_0x17e9('0x20')]('Content-Range',_0x1e4dbd+'-'+_0x3bf29e+'/'+_0x5a5971)[_0x17e9('0x1b')](_0x58684e);}return null;};}function patchUpdates(_0x2647f2){return function(_0x21c11a){try{jsonpatch['apply'](_0x21c11a,_0x2647f2,!![]);}catch(_0xf3bf5d){return BPromise[_0x17e9('0x21')](_0xf3bf5d);}return _0x21c11a['save']();};}function saveUpdates(_0x143aed,_0x43e4a7){return function(_0x251dd4){if(_0x251dd4){return _0x251dd4['update'](_0x143aed)[_0x17e9('0x22')](function(_0x14884e){return _0x14884e;});}return null;};}function removeEntity(_0x2ab3cf,_0x2a9eb6){return function(_0x227701){if(_0x227701){return _0x227701[_0x17e9('0x23')]()['then'](function(){_0x2ab3cf[_0x17e9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c3ec0,_0x2d5e2f){return function(_0x54fccb){if(!_0x54fccb){_0x4c3ec0[_0x17e9('0x19')](0x194);}return _0x54fccb;};}function handleError(_0x251aa5,_0x21ed4c){_0x21ed4c=_0x21ed4c||0x1f4;return function(_0x3a4301){logger['error'](_0x3a4301['stack']);if(_0x3a4301[_0x17e9('0x24')]){delete _0x3a4301[_0x17e9('0x24')];}_0x251aa5[_0x17e9('0x1a')](_0x21ed4c)[_0x17e9('0x25')](_0x3a4301);};}exports[_0x17e9('0x26')]=function(_0x28ef2f,_0x420e95){var _0x104aae={},_0x551220={},_0x50a3d3={'count':0x0,'rows':[]};var _0x1807b9=_[_0x17e9('0x27')](db[_0x17e9('0x28')][_0x17e9('0x29')],function(_0x43b27d){return{'name':_0x43b27d['fieldName'],'type':_0x43b27d[_0x17e9('0x2a')][_0x17e9('0x2b')]};});_0x551220[_0x17e9('0x2c')]=_['map'](_0x1807b9,_0x17e9('0x24'));_0x551220[_0x17e9('0x2d')]=_[_0x17e9('0x2e')](_0x28ef2f[_0x17e9('0x2d')]);_0x551220[_0x17e9('0x2f')]=_['intersection'](_0x551220[_0x17e9('0x2c')],_0x551220['query']);_0x104aae[_0x17e9('0x30')]=_[_0x17e9('0x31')](_0x551220[_0x17e9('0x2c')],qs['fields'](_0x28ef2f[_0x17e9('0x2d')][_0x17e9('0x32')]));_0x104aae[_0x17e9('0x30')]=_0x104aae[_0x17e9('0x30')][_0x17e9('0x33')]?_0x104aae['attributes']:_0x551220[_0x17e9('0x2c')];if(!_0x28ef2f[_0x17e9('0x2d')][_0x17e9('0x34')](_0x17e9('0x35'))){_0x104aae['limit']=qs[_0x17e9('0x1d')](_0x28ef2f[_0x17e9('0x2d')][_0x17e9('0x1d')]);_0x104aae[_0x17e9('0x1e')]=qs[_0x17e9('0x1e')](_0x28ef2f[_0x17e9('0x2d')][_0x17e9('0x1e')]);}_0x104aae[_0x17e9('0x36')]=qs[_0x17e9('0x37')](_0x28ef2f[_0x17e9('0x2d')]['sort']);_0x104aae['where']=qs[_0x17e9('0x2f')](_[_0x17e9('0x38')](_0x28ef2f['query'],_0x551220['filters']),_0x1807b9);if(_0x28ef2f[_0x17e9('0x2d')][_0x17e9('0x39')]){_0x104aae[_0x17e9('0x3a')]=_[_0x17e9('0x3b')](_0x104aae[_0x17e9('0x3a')],{'$or':_['map'](_0x1807b9,function(_0x2dcc30){if(_0x2dcc30[_0x17e9('0x2a')]!==_0x17e9('0x3c')){var _0x50e7d3={};_0x50e7d3[_0x2dcc30[_0x17e9('0x24')]]={'$like':'%'+_0x28ef2f['query'][_0x17e9('0x39')]+'%'};return _0x50e7d3;}})});}_0x104aae=_[_0x17e9('0x3b')]({},_0x104aae,_0x28ef2f[_0x17e9('0x3d')]);var _0x346381={'where':_0x104aae['where']};return db[_0x17e9('0x28')]['count'](_0x346381)[_0x17e9('0x22')](function(_0x448cc0){_0x50a3d3[_0x17e9('0x1f')]=_0x448cc0;if(_0x28ef2f[_0x17e9('0x2d')]['includeAll']){_0x104aae[_0x17e9('0x3e')]=[{'all':!![]}];}return db[_0x17e9('0x28')]['findAll'](_0x104aae);})[_0x17e9('0x22')](function(_0x2da256){_0x50a3d3[_0x17e9('0x3f')]=_0x2da256;return _0x50a3d3;})['then'](respondWithFilteredResult(_0x420e95,_0x104aae))['catch'](handleError(_0x420e95,null));};exports['show']=function(_0x5d618b,_0x447041){var _0xe900f0={'raw':!![],'where':{'id':_0x5d618b['params']['id']}},_0x3be65a={};_0x3be65a['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x3be65a[_0x17e9('0x2d')]=_[_0x17e9('0x2e')](_0x5d618b[_0x17e9('0x2d')]);_0x3be65a[_0x17e9('0x2f')]=_[_0x17e9('0x31')](_0x3be65a[_0x17e9('0x2c')],_0x3be65a[_0x17e9('0x2d')]);_0xe900f0[_0x17e9('0x30')]=_[_0x17e9('0x31')](_0x3be65a[_0x17e9('0x2c')],qs[_0x17e9('0x32')](_0x5d618b[_0x17e9('0x2d')][_0x17e9('0x32')]));_0xe900f0[_0x17e9('0x30')]=_0xe900f0[_0x17e9('0x30')][_0x17e9('0x33')]?_0xe900f0[_0x17e9('0x30')]:_0x3be65a[_0x17e9('0x2c')];if(_0x5d618b[_0x17e9('0x2d')]['includeAll']){_0xe900f0[_0x17e9('0x3e')]=[{'all':!![]}];}_0xe900f0=_['merge']({},_0xe900f0,_0x5d618b[_0x17e9('0x3d')]);return db[_0x17e9('0x28')]['find'](_0xe900f0)['then'](handleEntityNotFound(_0x447041,null))['then'](respondWithResult(_0x447041,null))[_0x17e9('0x40')](handleError(_0x447041,null));};exports[_0x17e9('0x41')]=function(_0x97e1ba,_0x211f5f){return db['ServicenowField'][_0x17e9('0x41')](_0x97e1ba[_0x17e9('0x42')],{})[_0x17e9('0x22')](respondWithResult(_0x211f5f,0xc9))[_0x17e9('0x40')](handleError(_0x211f5f,null));};exports[_0x17e9('0x43')]=function(_0x1b21fb,_0x101e6c){if(_0x1b21fb[_0x17e9('0x42')]['id']){delete _0x1b21fb['body']['id'];}return db[_0x17e9('0x28')][_0x17e9('0x44')]({'where':{'id':_0x1b21fb[_0x17e9('0x45')]['id']}})[_0x17e9('0x22')](handleEntityNotFound(_0x101e6c,null))[_0x17e9('0x22')](saveUpdates(_0x1b21fb['body'],null))['then'](respondWithResult(_0x101e6c,null))[_0x17e9('0x40')](handleError(_0x101e6c,null));};exports[_0x17e9('0x23')]=function(_0x2b63a9,_0x5cdbab){return db[_0x17e9('0x28')][_0x17e9('0x44')]({'where':{'id':_0x2b63a9[_0x17e9('0x45')]['id']}})[_0x17e9('0x22')](handleEntityNotFound(_0x5cdbab,null))[_0x17e9('0x22')](removeEntity(_0x5cdbab,null))[_0x17e9('0x40')](handleError(_0x5cdbab,null));}; \ No newline at end of file +var _0x49af=['stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x5e3bb1,_0x3cfe7c){var _0x4c1278=function(_0x124955){while(--_0x124955){_0x5e3bb1['push'](_0x5e3bb1['shift']());}};_0x4c1278(++_0x3cfe7c);}(_0x49af,0x104));var _0xf49a=function(_0x297416,_0x38cfe3){_0x297416=_0x297416-0x0;var _0x492d38=_0x49af[_0x297416];return _0x492d38;};'use strict';var emlformat=require(_0xf49a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf49a('0x1'));var rp=require(_0xf49a('0x2'));var moment=require(_0xf49a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf49a('0x4'));var util=require(_0xf49a('0x5'));var path=require(_0xf49a('0x6'));var sox=require(_0xf49a('0x7'));var csv=require(_0xf49a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf49a('0x9'));var _=require(_0xf49a('0xa'));var squel=require(_0xf49a('0xb'));var crypto=require(_0xf49a('0xc'));var jsforce=require(_0xf49a('0xd'));var deskjs=require(_0xf49a('0xe'));var toCsv=require(_0xf49a('0x8'));var querystring=require(_0xf49a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf49a('0x10'));var authService=require(_0xf49a('0x11'));var qs=require(_0xf49a('0x12'));var as=require(_0xf49a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf49a('0x14'))('api');var utils=require(_0xf49a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf49a('0x16'));var db=require(_0xf49a('0x17'))['db'];function respondWithStatusCode(_0x51b812,_0x36fe8f){_0x36fe8f=_0x36fe8f||0xcc;return function(_0x1ace99){if(_0x1ace99){return _0x51b812[_0xf49a('0x18')](_0x36fe8f);}return _0x51b812[_0xf49a('0x19')](_0x36fe8f)[_0xf49a('0x1a')]();};}function respondWithResult(_0x13193d,_0x4ae6f2){_0x4ae6f2=_0x4ae6f2||0xc8;return function(_0xc899ea){if(_0xc899ea){return _0x13193d['status'](_0x4ae6f2)[_0xf49a('0x1b')](_0xc899ea);}};}function respondWithFilteredResult(_0x37f107,_0x31d593){return function(_0xed3a6d){if(_0xed3a6d){var _0x4ca891=typeof _0x31d593[_0xf49a('0x1c')]===_0xf49a('0x1d')&&typeof _0x31d593['limit']==='undefined';var _0x379aee=_0xed3a6d[_0xf49a('0x1e')];var _0x1c9b9a=_0x4ca891?0x0:_0x31d593[_0xf49a('0x1c')];var _0xce6395=_0x4ca891?_0xed3a6d[_0xf49a('0x1e')]:_0x31d593[_0xf49a('0x1c')]+_0x31d593[_0xf49a('0x1f')];var _0x706102;if(_0xce6395>=_0x379aee){_0xce6395=_0x379aee;_0x706102=0xc8;}else{_0x706102=0xce;}_0x37f107['status'](_0x706102);return _0x37f107[_0xf49a('0x20')](_0xf49a('0x21'),_0x1c9b9a+'-'+_0xce6395+'/'+_0x379aee)[_0xf49a('0x1b')](_0xed3a6d);}return null;};}function patchUpdates(_0x1ef421){return function(_0x8509b1){try{jsonpatch[_0xf49a('0x22')](_0x8509b1,_0x1ef421,!![]);}catch(_0x23b9be){return BPromise[_0xf49a('0x23')](_0x23b9be);}return _0x8509b1[_0xf49a('0x24')]();};}function saveUpdates(_0x469283,_0x2a738b){return function(_0x3da3ec){if(_0x3da3ec){return _0x3da3ec[_0xf49a('0x25')](_0x469283)[_0xf49a('0x26')](function(_0x2f71d7){return _0x2f71d7;});}return null;};}function removeEntity(_0x59e1ac,_0x28cc1c){return function(_0x5c1eb6){if(_0x5c1eb6){return _0x5c1eb6['destroy']()[_0xf49a('0x26')](function(){_0x59e1ac[_0xf49a('0x19')](0xcc)[_0xf49a('0x1a')]();});}};}function handleEntityNotFound(_0x526e5f,_0x9435c9){return function(_0x4ba13f){if(!_0x4ba13f){_0x526e5f[_0xf49a('0x18')](0x194);}return _0x4ba13f;};}function handleError(_0x388fc6,_0x4f7755){_0x4f7755=_0x4f7755||0x1f4;return function(_0x39192b){logger[_0xf49a('0x27')](_0x39192b[_0xf49a('0x28')]);if(_0x39192b[_0xf49a('0x29')]){delete _0x39192b['name'];}_0x388fc6['status'](_0x4f7755)[_0xf49a('0x2a')](_0x39192b);};}exports[_0xf49a('0x2b')]=function(_0x315033,_0x3b24b6){var _0x28789f={},_0x54fbf1={},_0x56306b={'count':0x0,'rows':[]};var _0x20a9f7=_[_0xf49a('0x2c')](db[_0xf49a('0x2d')][_0xf49a('0x2e')],function(_0x4d6aac){return{'name':_0x4d6aac[_0xf49a('0x2f')],'type':_0x4d6aac['type']['key']};});_0x54fbf1[_0xf49a('0x30')]=_[_0xf49a('0x2c')](_0x20a9f7,_0xf49a('0x29'));_0x54fbf1['query']=_[_0xf49a('0x31')](_0x315033[_0xf49a('0x32')]);_0x54fbf1[_0xf49a('0x33')]=_[_0xf49a('0x34')](_0x54fbf1[_0xf49a('0x30')],_0x54fbf1[_0xf49a('0x32')]);_0x28789f[_0xf49a('0x35')]=_[_0xf49a('0x34')](_0x54fbf1[_0xf49a('0x30')],qs[_0xf49a('0x36')](_0x315033[_0xf49a('0x32')]['fields']));_0x28789f['attributes']=_0x28789f[_0xf49a('0x35')][_0xf49a('0x37')]?_0x28789f['attributes']:_0x54fbf1['model'];if(!_0x315033[_0xf49a('0x32')][_0xf49a('0x38')]('nolimit')){_0x28789f[_0xf49a('0x1f')]=qs[_0xf49a('0x1f')](_0x315033[_0xf49a('0x32')][_0xf49a('0x1f')]);_0x28789f[_0xf49a('0x1c')]=qs[_0xf49a('0x1c')](_0x315033[_0xf49a('0x32')][_0xf49a('0x1c')]);}_0x28789f[_0xf49a('0x39')]=qs['sort'](_0x315033['query']['sort']);_0x28789f[_0xf49a('0x3a')]=qs['filters'](_[_0xf49a('0x3b')](_0x315033[_0xf49a('0x32')],_0x54fbf1[_0xf49a('0x33')]),_0x20a9f7);if(_0x315033[_0xf49a('0x32')][_0xf49a('0x3c')]){_0x28789f[_0xf49a('0x3a')]=_[_0xf49a('0x3d')](_0x28789f[_0xf49a('0x3a')],{'$or':_[_0xf49a('0x2c')](_0x20a9f7,function(_0x76402e){if(_0x76402e[_0xf49a('0x3e')]!==_0xf49a('0x3f')){var _0x1df6bd={};_0x1df6bd[_0x76402e[_0xf49a('0x29')]]={'$like':'%'+_0x315033['query'][_0xf49a('0x3c')]+'%'};return _0x1df6bd;}})});}_0x28789f=_['merge']({},_0x28789f,_0x315033[_0xf49a('0x40')]);var _0x242106={'where':_0x28789f['where']};return db[_0xf49a('0x2d')][_0xf49a('0x1e')](_0x242106)[_0xf49a('0x26')](function(_0x2b4e45){_0x56306b[_0xf49a('0x1e')]=_0x2b4e45;if(_0x315033['query'][_0xf49a('0x41')]){_0x28789f['include']=[{'all':!![]}];}return db['ServicenowField'][_0xf49a('0x42')](_0x28789f);})['then'](function(_0x29e5d8){_0x56306b[_0xf49a('0x43')]=_0x29e5d8;return _0x56306b;})[_0xf49a('0x26')](respondWithFilteredResult(_0x3b24b6,_0x28789f))['catch'](handleError(_0x3b24b6,null));};exports[_0xf49a('0x44')]=function(_0x5805b9,_0x32758c){var _0x4367cf={'raw':!![],'where':{'id':_0x5805b9[_0xf49a('0x45')]['id']}},_0x4be3be={};_0x4be3be[_0xf49a('0x30')]=_[_0xf49a('0x31')](db[_0xf49a('0x2d')][_0xf49a('0x2e')]);_0x4be3be[_0xf49a('0x32')]=_[_0xf49a('0x31')](_0x5805b9['query']);_0x4be3be[_0xf49a('0x33')]=_[_0xf49a('0x34')](_0x4be3be[_0xf49a('0x30')],_0x4be3be[_0xf49a('0x32')]);_0x4367cf['attributes']=_[_0xf49a('0x34')](_0x4be3be[_0xf49a('0x30')],qs['fields'](_0x5805b9[_0xf49a('0x32')]['fields']));_0x4367cf[_0xf49a('0x35')]=_0x4367cf[_0xf49a('0x35')][_0xf49a('0x37')]?_0x4367cf[_0xf49a('0x35')]:_0x4be3be['model'];if(_0x5805b9['query'][_0xf49a('0x41')]){_0x4367cf['include']=[{'all':!![]}];}_0x4367cf=_[_0xf49a('0x3d')]({},_0x4367cf,_0x5805b9['options']);return db[_0xf49a('0x2d')][_0xf49a('0x46')](_0x4367cf)['then'](handleEntityNotFound(_0x32758c,null))[_0xf49a('0x26')](respondWithResult(_0x32758c,null))['catch'](handleError(_0x32758c,null));};exports[_0xf49a('0x47')]=function(_0x518ad7,_0x2c64cc){return db[_0xf49a('0x2d')][_0xf49a('0x47')](_0x518ad7[_0xf49a('0x48')],{})['then'](respondWithResult(_0x2c64cc,0xc9))[_0xf49a('0x49')](handleError(_0x2c64cc,null));};exports[_0xf49a('0x25')]=function(_0x2f22ac,_0x4c9963){if(_0x2f22ac['body']['id']){delete _0x2f22ac[_0xf49a('0x48')]['id'];}return db[_0xf49a('0x2d')][_0xf49a('0x46')]({'where':{'id':_0x2f22ac['params']['id']}})[_0xf49a('0x26')](handleEntityNotFound(_0x4c9963,null))[_0xf49a('0x26')](saveUpdates(_0x2f22ac[_0xf49a('0x48')],null))[_0xf49a('0x26')](respondWithResult(_0x4c9963,null))[_0xf49a('0x49')](handleError(_0x4c9963,null));};exports[_0xf49a('0x4a')]=function(_0x54f0a9,_0x1bfba2){return db[_0xf49a('0x2d')][_0xf49a('0x46')]({'where':{'id':_0x54f0a9['params']['id']}})[_0xf49a('0x26')](handleEntityNotFound(_0x1bfba2,null))[_0xf49a('0x26')](removeEntity(_0x1bfba2,null))[_0xf49a('0x49')](handleError(_0x1bfba2,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 38c095b..162d61b 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 _0x54ca=['./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1fcf36,_0x3f2539){var _0x44491f=function(_0x206816){while(--_0x206816){_0x1fcf36['push'](_0x1fcf36['shift']());}};_0x44491f(++_0x3f2539);}(_0x54ca,0xa3));var _0xa54c=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x54ca[_0x5575cd];return _0x4979a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa54c('0x0'))(_0xa54c('0x1'));var moment=require(_0xa54c('0x2'));var BPromise=require(_0xa54c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54c('0x4'));var rimraf=require(_0xa54c('0x5'));var config=require('../../config/environment');var attributes=require(_0xa54c('0x6'));module[_0xa54c('0x7')]=function(_0x5909ed,_0x1d8fd8){return _0x5909ed[_0xa54c('0x8')](_0xa54c('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xa54c('0xa'),'fields':[_0xa54c('0xb'),_0xa54c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c58=['path','rimraf','../../config/environment','define','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','moment','bluebird'];(function(_0x122f0a,_0x1190cd){var _0x3a2373=function(_0x45d716){while(--_0x45d716){_0x122f0a['push'](_0x122f0a['shift']());}};_0x3a2373(++_0x1190cd);}(_0x8c58,0x19f));var _0x88c5=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8c58[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x88c5('0x0'));var util=require(_0x88c5('0x1'));var logger=require(_0x88c5('0x2'))('api');var moment=require(_0x88c5('0x3'));var BPromise=require(_0x88c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88c5('0x5'));var rimraf=require(_0x88c5('0x6'));var config=require(_0x88c5('0x7'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0xd54a7,_0xe79673){return _0xd54a7[_0x88c5('0x8')]('ServicenowField',attributes,{'tableName':_0x88c5('0x9'),'paranoid':![],'indexes':[{'name':_0x88c5('0xa'),'fields':[_0x88c5('0xb'),'FieldId'],'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 7e93f8a..f00c752 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x12d327,_0xb47c90){var _0x132a3b=function(_0x1fc37b){while(--_0x1fc37b){_0x12d327['push'](_0x12d327['shift']());}};_0x132a3b(++_0xb47c90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xcb91[_0x59e821];return _0x5333f6;};'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')]('ServicenowField,\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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x469e3c,_0xc986b3){var _0x40e2fc=function(_0x2431b9){while(--_0x2431b9){_0x469e3c['push'](_0x469e3c['shift']());}};_0x40e2fc(++_0xc986b3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index b1116bd..e24260b 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x19c959,_0x593285){var _0x3d70fd=function(_0x5ef676){while(--_0x5ef676){_0x19c959['push'](_0x19c959['shift']());}};_0x3d70fd(++_0x593285);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3860d8,_0x509259){var _0x3dd4fc=function(_0x47f610){while(--_0x47f610){_0x3860d8['push'](_0x3860d8['shift']());}};_0x3dd4fc(++_0x509259);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index d61a1ae..b4dd069 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xf5983c,_0x7fde1d){var _0x4fa824=function(_0x72b74f){while(--_0x72b74f){_0xf5983c['push'](_0xf5983c['shift']());}};_0x4fa824(++_0x7fde1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5df131,_0x5768ab){var _0x555116=function(_0x4ac9d1){while(--_0x4ac9d1){_0x5df131['push'](_0x5df131['shift']());}};_0x555116(++_0x5768ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index fcebfce..603c818 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 _0x7b3a=['../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','rows','catch','options','find','create','body','params','getConfigurations','SugarcrmConfiguration','pick','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','date_start','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','values','module_fields','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b3a,0xd4));var _0xa7b3=function(_0x44f260,_0x120107){_0x44f260=_0x44f260-0x0;var _0x14340d=_0x7b3a[_0x44f260];return _0x14340d;};'use strict';var emlformat=require(_0xa7b3('0x0'));var rimraf=require(_0xa7b3('0x1'));var zipdir=require(_0xa7b3('0x2'));var jsonpatch=require(_0xa7b3('0x3'));var rp=require(_0xa7b3('0x4'));var moment=require('moment');var BPromise=require(_0xa7b3('0x5'));var Mustache=require(_0xa7b3('0x6'));var util=require(_0xa7b3('0x7'));var path=require(_0xa7b3('0x8'));var sox=require(_0xa7b3('0x9'));var csv=require(_0xa7b3('0xa'));var ejs=require(_0xa7b3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa7b3('0xc'));var squel=require(_0xa7b3('0xd'));var crypto=require(_0xa7b3('0xe'));var jsforce=require(_0xa7b3('0xf'));var deskjs=require(_0xa7b3('0x10'));var toCsv=require(_0xa7b3('0xa'));var querystring=require(_0xa7b3('0x11'));var Papa=require(_0xa7b3('0x12'));var Redis=require(_0xa7b3('0x13'));var authService=require(_0xa7b3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa7b3('0x15'));var hardwareService=require(_0xa7b3('0x16'));var logger=require(_0xa7b3('0x17'))(_0xa7b3('0x18'));var utils=require(_0xa7b3('0x19'));var config=require(_0xa7b3('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa7b3('0x1b'));function respondWithStatusCode(_0x396be4,_0xbe23bd){_0xbe23bd=_0xbe23bd||0xcc;return function(_0x46c073){if(_0x46c073){return _0x396be4[_0xa7b3('0x1c')](_0xbe23bd);}return _0x396be4[_0xa7b3('0x1d')](_0xbe23bd)[_0xa7b3('0x1e')]();};}function respondWithResult(_0x1e22c5,_0x1b6ad9){_0x1b6ad9=_0x1b6ad9||0xc8;return function(_0x1e717d){if(_0x1e717d){return _0x1e22c5[_0xa7b3('0x1d')](_0x1b6ad9)[_0xa7b3('0x1f')](_0x1e717d);}};}function respondWithFilteredResult(_0x23fffd,_0xe48232){return function(_0x54bbdc){if(_0x54bbdc){var _0x143289=typeof _0xe48232[_0xa7b3('0x20')]===_0xa7b3('0x21')&&typeof _0xe48232['limit']==='undefined';var _0x1d3350=_0x54bbdc['count'];var _0x149e77=_0x143289?0x0:_0xe48232[_0xa7b3('0x20')];var _0x2bb105=_0x143289?_0x54bbdc[_0xa7b3('0x22')]:_0xe48232[_0xa7b3('0x20')]+_0xe48232[_0xa7b3('0x23')];var _0x225808;if(_0x2bb105>=_0x1d3350){_0x2bb105=_0x1d3350;_0x225808=0xc8;}else{_0x225808=0xce;}_0x23fffd['status'](_0x225808);return _0x23fffd['set'](_0xa7b3('0x24'),_0x149e77+'-'+_0x2bb105+'/'+_0x1d3350)[_0xa7b3('0x1f')](_0x54bbdc);}return null;};}function patchUpdates(_0x27833c){return function(_0x285603){try{jsonpatch['apply'](_0x285603,_0x27833c,!![]);}catch(_0x5d1344){return BPromise[_0xa7b3('0x25')](_0x5d1344);}return _0x285603[_0xa7b3('0x26')]();};}function saveUpdates(_0x541f98,_0x3cd259){return function(_0x3630af){if(_0x3630af){return _0x3630af[_0xa7b3('0x27')](_0x541f98)[_0xa7b3('0x28')](function(_0x507b83){return _0x507b83;});}return null;};}function removeEntity(_0x490bb8,_0x340fd6){return function(_0x29ed47){if(_0x29ed47){return _0x29ed47[_0xa7b3('0x29')]()[_0xa7b3('0x28')](function(){_0x490bb8[_0xa7b3('0x1d')](0xcc)[_0xa7b3('0x1e')]();});}};}function handleEntityNotFound(_0x295681,_0x2ef757){return function(_0x129057){if(!_0x129057){_0x295681[_0xa7b3('0x1c')](0x194);}return _0x129057;};}function handleError(_0x5251c4,_0x2335da){_0x2335da=_0x2335da||0x1f4;return function(_0x58a366){logger[_0xa7b3('0x2a')](_0x58a366[_0xa7b3('0x2b')]);if(_0x58a366[_0xa7b3('0x2c')]){delete _0x58a366[_0xa7b3('0x2c')];}_0x5251c4[_0xa7b3('0x1d')](_0x2335da)[_0xa7b3('0x2d')](_0x58a366);};}exports['index']=function(_0x2dce49,_0xa63082){var _0xea398d={},_0x516b5c={},_0x174daa={'count':0x0,'rows':[]};var _0x211c41=_['map'](db[_0xa7b3('0x2e')][_0xa7b3('0x2f')],function(_0x402db0){return{'name':_0x402db0[_0xa7b3('0x30')],'type':_0x402db0[_0xa7b3('0x31')][_0xa7b3('0x32')]};});_0x516b5c[_0xa7b3('0x33')]=_[_0xa7b3('0x34')](_0x211c41,_0xa7b3('0x2c'));_0x516b5c[_0xa7b3('0x35')]=_[_0xa7b3('0x36')](_0x2dce49[_0xa7b3('0x35')]);_0x516b5c['filters']=_[_0xa7b3('0x37')](_0x516b5c['model'],_0x516b5c[_0xa7b3('0x35')]);_0xea398d[_0xa7b3('0x38')]=_['intersection'](_0x516b5c['model'],qs[_0xa7b3('0x39')](_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x39')]));_0xea398d[_0xa7b3('0x38')]=_0xea398d[_0xa7b3('0x38')][_0xa7b3('0x3a')]?_0xea398d[_0xa7b3('0x38')]:_0x516b5c[_0xa7b3('0x33')];if(!_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x3b')]('nolimit')){_0xea398d[_0xa7b3('0x23')]=qs[_0xa7b3('0x23')](_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x23')]);_0xea398d[_0xa7b3('0x20')]=qs[_0xa7b3('0x20')](_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x20')]);}_0xea398d[_0xa7b3('0x3c')]=qs[_0xa7b3('0x3d')](_0x2dce49[_0xa7b3('0x35')]['sort']);_0xea398d[_0xa7b3('0x3e')]=qs[_0xa7b3('0x3f')](_['pick'](_0x2dce49[_0xa7b3('0x35')],_0x516b5c[_0xa7b3('0x3f')]),_0x211c41);if(_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x40')]){_0xea398d[_0xa7b3('0x3e')]=_['merge'](_0xea398d[_0xa7b3('0x3e')],{'$or':_['map'](_0x211c41,function(_0x45e742){if(_0x45e742[_0xa7b3('0x31')]!==_0xa7b3('0x41')){var _0x58942d={};_0x58942d[_0x45e742[_0xa7b3('0x2c')]]={'$like':'%'+_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x40')]+'%'};return _0x58942d;}})});}_0xea398d=_[_0xa7b3('0x42')]({},_0xea398d,_0x2dce49['options']);var _0x508cd0={'where':_0xea398d[_0xa7b3('0x3e')]};return db[_0xa7b3('0x2e')][_0xa7b3('0x22')](_0x508cd0)['then'](function(_0x2c89cc){_0x174daa[_0xa7b3('0x22')]=_0x2c89cc;if(_0x2dce49[_0xa7b3('0x35')][_0xa7b3('0x43')]){_0xea398d[_0xa7b3('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0xea398d);})[_0xa7b3('0x28')](function(_0x23ece1){_0x174daa[_0xa7b3('0x45')]=_0x23ece1;return _0x174daa;})['then'](respondWithFilteredResult(_0xa63082,_0xea398d))[_0xa7b3('0x46')](handleError(_0xa63082,null));};exports['show']=function(_0x50e6c9,_0x1daf5b){var _0x3b9996={'raw':![],'where':{'id':_0x50e6c9['params']['id']}},_0xe5b5a6={};_0xe5b5a6[_0xa7b3('0x33')]=_[_0xa7b3('0x36')](db[_0xa7b3('0x2e')]['rawAttributes']);_0xe5b5a6[_0xa7b3('0x35')]=_[_0xa7b3('0x36')](_0x50e6c9[_0xa7b3('0x35')]);_0xe5b5a6['filters']=_[_0xa7b3('0x37')](_0xe5b5a6['model'],_0xe5b5a6['query']);_0x3b9996[_0xa7b3('0x38')]=_[_0xa7b3('0x37')](_0xe5b5a6[_0xa7b3('0x33')],qs[_0xa7b3('0x39')](_0x50e6c9[_0xa7b3('0x35')][_0xa7b3('0x39')]));_0x3b9996[_0xa7b3('0x38')]=_0x3b9996['attributes'][_0xa7b3('0x3a')]?_0x3b9996['attributes']:_0xe5b5a6[_0xa7b3('0x33')];if(_0x50e6c9[_0xa7b3('0x35')][_0xa7b3('0x43')]){_0x3b9996[_0xa7b3('0x44')]=[{'all':!![]}];}_0x3b9996=_[_0xa7b3('0x42')]({},_0x3b9996,_0x50e6c9[_0xa7b3('0x47')]);return db[_0xa7b3('0x2e')][_0xa7b3('0x48')](_0x3b9996)['then'](handleEntityNotFound(_0x1daf5b,null))[_0xa7b3('0x28')](respondWithResult(_0x1daf5b,null))[_0xa7b3('0x46')](handleError(_0x1daf5b,null));};exports[_0xa7b3('0x49')]=function(_0x348ad3,_0x893c78){return db[_0xa7b3('0x2e')]['create'](_0x348ad3[_0xa7b3('0x4a')],{})[_0xa7b3('0x28')](respondWithResult(_0x893c78,0xc9))[_0xa7b3('0x46')](handleError(_0x893c78,null));};exports[_0xa7b3('0x27')]=function(_0x4f7562,_0xc3390a){if(_0x4f7562['body']['id']){delete _0x4f7562[_0xa7b3('0x4a')]['id'];}return db[_0xa7b3('0x2e')][_0xa7b3('0x48')]({'where':{'id':_0x4f7562[_0xa7b3('0x4b')]['id']}})[_0xa7b3('0x28')](handleEntityNotFound(_0xc3390a,null))[_0xa7b3('0x28')](saveUpdates(_0x4f7562[_0xa7b3('0x4a')],null))[_0xa7b3('0x28')](respondWithResult(_0xc3390a,null))[_0xa7b3('0x46')](handleError(_0xc3390a,null));};exports[_0xa7b3('0x29')]=function(_0x56db06,_0x5b0bff){return db['SugarcrmAccount'][_0xa7b3('0x48')]({'where':{'id':_0x56db06[_0xa7b3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b0bff,null))['then'](removeEntity(_0x5b0bff,null))[_0xa7b3('0x46')](handleError(_0x5b0bff,null));};exports[_0xa7b3('0x4c')]=function(_0xa60499,_0x104638,_0x2f1b5f){var _0xc3a016={};var _0x4b9a9c={};var _0x1c9c2b;var _0x3853be;return db[_0xa7b3('0x2e')]['findOne']({'where':{'id':_0xa60499[_0xa7b3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x104638,null))[_0xa7b3('0x28')](function(_0x276b83){if(_0x276b83){_0x1c9c2b=_0x276b83;_0x4b9a9c[_0xa7b3('0x33')]=_[_0xa7b3('0x36')](db[_0xa7b3('0x4d')][_0xa7b3('0x2f')]);_0x4b9a9c['query']=_['keys'](_0xa60499[_0xa7b3('0x35')]);_0x4b9a9c['filters']=_['intersection'](_0x4b9a9c[_0xa7b3('0x33')],_0x4b9a9c[_0xa7b3('0x35')]);_0xc3a016['attributes']=_['intersection'](_0x4b9a9c[_0xa7b3('0x33')],qs[_0xa7b3('0x39')](_0xa60499[_0xa7b3('0x35')][_0xa7b3('0x39')]));_0xc3a016[_0xa7b3('0x38')]=_0xc3a016[_0xa7b3('0x38')][_0xa7b3('0x3a')]?_0xc3a016[_0xa7b3('0x38')]:_0x4b9a9c[_0xa7b3('0x33')];_0xc3a016[_0xa7b3('0x3c')]=qs['sort'](_0xa60499[_0xa7b3('0x35')][_0xa7b3('0x3d')]);_0xc3a016[_0xa7b3('0x3e')]=qs[_0xa7b3('0x3f')](_[_0xa7b3('0x4e')](_0xa60499[_0xa7b3('0x35')],_0x4b9a9c[_0xa7b3('0x3f')]));if(_0xa60499[_0xa7b3('0x35')][_0xa7b3('0x40')]){_0xc3a016[_0xa7b3('0x3e')]=_[_0xa7b3('0x42')](_0xc3a016[_0xa7b3('0x3e')],{'$or':_[_0xa7b3('0x34')](_0xc3a016[_0xa7b3('0x38')],function(_0xc2c1e9){var _0x3c6b21={};_0x3c6b21[_0xc2c1e9]={'$like':'%'+_0xa60499[_0xa7b3('0x35')]['filter']+'%'};return _0x3c6b21;})});}_0xc3a016=_[_0xa7b3('0x42')]({},_0xc3a016,_0xa60499[_0xa7b3('0x47')]);return _0x1c9c2b[_0xa7b3('0x4c')](_0xc3a016);}})['then'](function(_0x5708dd){if(_0x5708dd){_0x3853be=_0x5708dd['length'];if(!_0xa60499[_0xa7b3('0x35')][_0xa7b3('0x3b')]('nolimit')){_0xc3a016['limit']=qs['limit'](_0xa60499[_0xa7b3('0x35')][_0xa7b3('0x23')]);_0xc3a016[_0xa7b3('0x20')]=qs['offset'](_0xa60499[_0xa7b3('0x35')]['offset']);}return _0x1c9c2b[_0xa7b3('0x4c')](_0xc3a016);}})[_0xa7b3('0x28')](function(_0x288fcd){if(_0x288fcd){return _0x288fcd?{'count':_0x3853be,'rows':_0x288fcd}:null;}})['then'](respondWithResult(_0x104638,null))[_0xa7b3('0x46')](handleError(_0x104638,null));};exports['addConfiguration']=function(_0x500d8c,_0x5a0730,_0x3d834b){if(_0x500d8c[_0xa7b3('0x4a')]['id']){delete _0x500d8c[_0xa7b3('0x4a')]['id'];}return db[_0xa7b3('0x2e')]['findOne']({'where':{'id':_0x500d8c[_0xa7b3('0x4b')]['id']}})[_0xa7b3('0x28')](handleEntityNotFound(_0x5a0730,null))[_0xa7b3('0x28')](function(_0x348ae7){if(_0x348ae7){_0x500d8c[_0xa7b3('0x4a')][_0xa7b3('0x4f')]=_0x348ae7['id'];_0x500d8c[_0xa7b3('0x4a')]['Subjects']=integrations[_0xa7b3('0x50')](_0x500d8c[_0xa7b3('0x4a')][_0xa7b3('0x51')],_0x500d8c[_0xa7b3('0x4a')][_0xa7b3('0x31')]);_0x500d8c['body']['Descriptions']=integrations[_0xa7b3('0x52')](_0x500d8c[_0xa7b3('0x4a')][_0xa7b3('0x51')],_0x500d8c[_0xa7b3('0x4a')][_0xa7b3('0x31')]);return db['SugarcrmConfiguration'][_0xa7b3('0x49')](_0x500d8c['body'],{'include':[{'model':db[_0xa7b3('0x53')],'as':_0xa7b3('0x54')},{'model':db[_0xa7b3('0x53')],'as':_0xa7b3('0x55')}]});}return null;})[_0xa7b3('0x28')](respondWithResult(_0x5a0730,null))[_0xa7b3('0x46')](handleError(_0x5a0730,null));};exports[_0xa7b3('0x56')]=function(_0x590e4f,_0x54187a,_0x18cade){var _0x597aa0='';var _0x25df5e=['id',_0xa7b3('0x2c'),_0xa7b3('0x57'),_0xa7b3('0x58'),'description',_0xa7b3('0x59'),'duration_hours','duration_minutes','parent_id',_0xa7b3('0x5a'),_0xa7b3('0x5b'),_0xa7b3('0x5c')];return db['SugarcrmAccount'][_0xa7b3('0x5d')]({'where':{'id':_0x590e4f[_0xa7b3('0x4b')]['id']},'attributes':['id',_0xa7b3('0x5e'),_0xa7b3('0x5f'),_0xa7b3('0x60')]})[_0xa7b3('0x28')](handleEntityNotFound(_0x54187a,null))[_0xa7b3('0x28')](function(_0x19ee02){if(_0x19ee02){_0x597aa0=_0x19ee02[_0xa7b3('0x60')];var _0x3fb848=_0x597aa0[_0xa7b3('0x61')](-0x1);if(_0x3fb848==='/'){_0x597aa0=_0x597aa0[_0xa7b3('0x62')](0x0,_0x597aa0[_0xa7b3('0x63')](_0x3fb848));}return rp({'method':_0xa7b3('0x64'),'uri':util[_0xa7b3('0x65')](_0xa7b3('0x66'),_0x597aa0,_0xa7b3('0x67')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xa7b3('0x68'),'rest_data':JSON[_0xa7b3('0x69')]({'user_auth':{'user_name':_0x19ee02[_0xa7b3('0x5e')],'password':_0x19ee02['password'],'encryption':_0xa7b3('0x6a')},'application':_0xa7b3('0x6b')})}});}})['then'](function(_0x277679){if(_0x277679&&_0x277679[_0xa7b3('0x2c')]!==_0xa7b3('0x6c')&&_0x277679[_0xa7b3('0x2c')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0xa7b3('0x65')](_0xa7b3('0x66'),_0x597aa0,_0xa7b3('0x67')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xa7b3('0x68'),'rest_data':JSON['stringify']({'session':_0x277679['id'],'module_name':'Calls'})}})['then'](function(_0x3ec07f){if(_0x3ec07f){var _0x15f076=_[_0xa7b3('0x6d')](_0x3ec07f[_0xa7b3('0x6e')]);_['remove'](_0x15f076,function(_0x1e8365){return _0x25df5e[_0xa7b3('0x6f')](_0x1e8365['name']);});return{'count':_0x15f076['length'],'rows':_['map'](_0x15f076,function(_0x49d4c9){return{'id':_0x49d4c9[_0xa7b3('0x2c')],'name':_0x49d4c9[_0xa7b3('0x70')],'custom':_[_0xa7b3('0x71')](_0x49d4c9['name'],'_c')?!![]:![],'options':_0x49d4c9[_0xa7b3('0x47')]?_['map'](_[_0xa7b3('0x6d')](_0x49d4c9[_0xa7b3('0x47')]),function(_0x2ce929){return{'name':_0x2ce929[_0xa7b3('0x72')],'value':_0x2ce929[_0xa7b3('0x2c')]};}):[]};})};}})[_0xa7b3('0x28')](respondWithResult(_0x54187a,null))[_0xa7b3('0x46')](function(_0x4fe026){var _0x285834=_0x590e4f[_0xa7b3('0x35')][_0xa7b3('0x73')]?0x1f4:_0x4fe026[_0xa7b3('0x74')]||0x1f4;logger[_0xa7b3('0x2a')](_0xa7b3('0x75'),_0xa7b3('0x56'),_0x285834,JSON[_0xa7b3('0x69')](_0x4fe026));delete _0x4fe026[_0xa7b3('0x2c')];if(_0x285834===0x191){_0x285834=0x190;}_0x54187a[_0xa7b3('0x1d')](_0x285834)['send'](_0x590e4f['query'][_0xa7b3('0x73')]?{'message':_0xa7b3('0x76'),'statusCode':_0x4fe026[_0xa7b3('0x74')]}:_0x4fe026);});}else{var _0x5ce85e=0x1f4;_0x54187a[_0xa7b3('0x1d')](_0x5ce85e)[_0xa7b3('0x2d')]({'message':_0xa7b3('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xba91=['options','find','create','body','destroy','params','getConfigurations','findOne','SugarcrmConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','map','SugarcrmAccount','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','count','includeAll','include','findAll','catch','show','keys','rawAttributes','length'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xba91,0xac));var _0x1ba9=function(_0x131ef1,_0x2a1da6){_0x131ef1=_0x131ef1-0x0;var _0x24d8be=_0xba91[_0x131ef1];return _0x24d8be;};'use strict';var emlformat=require(_0x1ba9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ba9('0x1'));var jsonpatch=require(_0x1ba9('0x2'));var rp=require(_0x1ba9('0x3'));var moment=require('moment');var BPromise=require(_0x1ba9('0x4'));var Mustache=require('mustache');var util=require(_0x1ba9('0x5'));var path=require('path');var sox=require(_0x1ba9('0x6'));var csv=require(_0x1ba9('0x7'));var ejs=require(_0x1ba9('0x8'));var fs=require('fs');var fs_extra=require(_0x1ba9('0x9'));var _=require(_0x1ba9('0xa'));var squel=require('squel');var crypto=require(_0x1ba9('0xb'));var jsforce=require(_0x1ba9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1ba9('0x7'));var querystring=require(_0x1ba9('0xd'));var Papa=require(_0x1ba9('0xe'));var Redis=require(_0x1ba9('0xf'));var authService=require(_0x1ba9('0x10'));var qs=require(_0x1ba9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ba9('0x12'));var logger=require('../../config/logger')(_0x1ba9('0x13'));var utils=require('../../config/utils');var config=require(_0x1ba9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ba9('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x362a2b,_0x58faa3){_0x58faa3=_0x58faa3||0xcc;return function(_0x47155e){if(_0x47155e){return _0x362a2b[_0x1ba9('0x16')](_0x58faa3);}return _0x362a2b[_0x1ba9('0x17')](_0x58faa3)[_0x1ba9('0x18')]();};}function respondWithResult(_0x50f8c3,_0x391a43){_0x391a43=_0x391a43||0xc8;return function(_0x4b4a0f){if(_0x4b4a0f){return _0x50f8c3[_0x1ba9('0x17')](_0x391a43)[_0x1ba9('0x19')](_0x4b4a0f);}};}function respondWithFilteredResult(_0x5942b3,_0x5e422b){return function(_0xb0b656){if(_0xb0b656){var _0x1be498=typeof _0x5e422b[_0x1ba9('0x1a')]===_0x1ba9('0x1b')&&typeof _0x5e422b[_0x1ba9('0x1c')]===_0x1ba9('0x1b');var _0x95fa92=_0xb0b656['count'];var _0x2fe7d5=_0x1be498?0x0:_0x5e422b[_0x1ba9('0x1a')];var _0x3c52cd=_0x1be498?_0xb0b656['count']:_0x5e422b[_0x1ba9('0x1a')]+_0x5e422b[_0x1ba9('0x1c')];var _0x34f732;if(_0x3c52cd>=_0x95fa92){_0x3c52cd=_0x95fa92;_0x34f732=0xc8;}else{_0x34f732=0xce;}_0x5942b3[_0x1ba9('0x17')](_0x34f732);return _0x5942b3[_0x1ba9('0x1d')](_0x1ba9('0x1e'),_0x2fe7d5+'-'+_0x3c52cd+'/'+_0x95fa92)[_0x1ba9('0x19')](_0xb0b656);}return null;};}function patchUpdates(_0x1ecbd2){return function(_0x4e2c8a){try{jsonpatch['apply'](_0x4e2c8a,_0x1ecbd2,!![]);}catch(_0x210cea){return BPromise[_0x1ba9('0x1f')](_0x210cea);}return _0x4e2c8a[_0x1ba9('0x20')]();};}function saveUpdates(_0x353c39,_0x3480ba){return function(_0x54e56c){if(_0x54e56c){return _0x54e56c[_0x1ba9('0x21')](_0x353c39)[_0x1ba9('0x22')](function(_0x5169a7){return _0x5169a7;});}return null;};}function removeEntity(_0x2ad75b,_0x231e3d){return function(_0x34a81b){if(_0x34a81b){return _0x34a81b['destroy']()[_0x1ba9('0x22')](function(){_0x2ad75b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19b99a,_0x2fc906){return function(_0x5bff57){if(!_0x5bff57){_0x19b99a['sendStatus'](0x194);}return _0x5bff57;};}function handleError(_0x12e4c0,_0x57a511){_0x57a511=_0x57a511||0x1f4;return function(_0x1ddecf){logger['error'](_0x1ddecf[_0x1ba9('0x23')]);if(_0x1ddecf[_0x1ba9('0x24')]){delete _0x1ddecf['name'];}_0x12e4c0[_0x1ba9('0x17')](_0x57a511)[_0x1ba9('0x25')](_0x1ddecf);};}exports[_0x1ba9('0x26')]=function(_0x17b8d4,_0x427425){var _0x3752e9={},_0x4981d5={},_0x1e6718={'count':0x0,'rows':[]};var _0x4eef72=_[_0x1ba9('0x27')](db[_0x1ba9('0x28')]['rawAttributes'],function(_0x59cc30){return{'name':_0x59cc30[_0x1ba9('0x29')],'type':_0x59cc30[_0x1ba9('0x2a')]['key']};});_0x4981d5[_0x1ba9('0x2b')]=_[_0x1ba9('0x27')](_0x4eef72,_0x1ba9('0x24'));_0x4981d5[_0x1ba9('0x2c')]=_['keys'](_0x17b8d4[_0x1ba9('0x2c')]);_0x4981d5[_0x1ba9('0x2d')]=_['intersection'](_0x4981d5[_0x1ba9('0x2b')],_0x4981d5[_0x1ba9('0x2c')]);_0x3752e9[_0x1ba9('0x2e')]=_[_0x1ba9('0x2f')](_0x4981d5[_0x1ba9('0x2b')],qs[_0x1ba9('0x30')](_0x17b8d4[_0x1ba9('0x2c')]['fields']));_0x3752e9['attributes']=_0x3752e9['attributes']['length']?_0x3752e9[_0x1ba9('0x2e')]:_0x4981d5[_0x1ba9('0x2b')];if(!_0x17b8d4['query'][_0x1ba9('0x31')]('nolimit')){_0x3752e9['limit']=qs['limit'](_0x17b8d4[_0x1ba9('0x2c')]['limit']);_0x3752e9[_0x1ba9('0x1a')]=qs[_0x1ba9('0x1a')](_0x17b8d4[_0x1ba9('0x2c')]['offset']);}_0x3752e9['order']=qs[_0x1ba9('0x32')](_0x17b8d4[_0x1ba9('0x2c')][_0x1ba9('0x32')]);_0x3752e9['where']=qs[_0x1ba9('0x2d')](_[_0x1ba9('0x33')](_0x17b8d4[_0x1ba9('0x2c')],_0x4981d5[_0x1ba9('0x2d')]),_0x4eef72);if(_0x17b8d4[_0x1ba9('0x2c')][_0x1ba9('0x34')]){_0x3752e9[_0x1ba9('0x35')]=_[_0x1ba9('0x36')](_0x3752e9['where'],{'$or':_[_0x1ba9('0x27')](_0x4eef72,function(_0x412afa){if(_0x412afa['type']!=='VIRTUAL'){var _0x3afcc8={};_0x3afcc8[_0x412afa[_0x1ba9('0x24')]]={'$like':'%'+_0x17b8d4[_0x1ba9('0x2c')][_0x1ba9('0x34')]+'%'};return _0x3afcc8;}})});}_0x3752e9=_['merge']({},_0x3752e9,_0x17b8d4['options']);var _0x50b8dc={'where':_0x3752e9[_0x1ba9('0x35')]};return db[_0x1ba9('0x28')][_0x1ba9('0x37')](_0x50b8dc)[_0x1ba9('0x22')](function(_0x5a55e9){_0x1e6718[_0x1ba9('0x37')]=_0x5a55e9;if(_0x17b8d4[_0x1ba9('0x2c')][_0x1ba9('0x38')]){_0x3752e9[_0x1ba9('0x39')]=[{'all':!![]}];}return db[_0x1ba9('0x28')][_0x1ba9('0x3a')](_0x3752e9);})[_0x1ba9('0x22')](function(_0x120411){_0x1e6718['rows']=_0x120411;return _0x1e6718;})['then'](respondWithFilteredResult(_0x427425,_0x3752e9))[_0x1ba9('0x3b')](handleError(_0x427425,null));};exports[_0x1ba9('0x3c')]=function(_0x1a0112,_0x2f76ce){var _0x12dccf={'raw':![],'where':{'id':_0x1a0112['params']['id']}},_0x4c4933={};_0x4c4933['model']=_[_0x1ba9('0x3d')](db[_0x1ba9('0x28')][_0x1ba9('0x3e')]);_0x4c4933[_0x1ba9('0x2c')]=_['keys'](_0x1a0112[_0x1ba9('0x2c')]);_0x4c4933[_0x1ba9('0x2d')]=_[_0x1ba9('0x2f')](_0x4c4933[_0x1ba9('0x2b')],_0x4c4933['query']);_0x12dccf[_0x1ba9('0x2e')]=_['intersection'](_0x4c4933['model'],qs[_0x1ba9('0x30')](_0x1a0112[_0x1ba9('0x2c')]['fields']));_0x12dccf[_0x1ba9('0x2e')]=_0x12dccf[_0x1ba9('0x2e')][_0x1ba9('0x3f')]?_0x12dccf[_0x1ba9('0x2e')]:_0x4c4933[_0x1ba9('0x2b')];if(_0x1a0112['query'][_0x1ba9('0x38')]){_0x12dccf[_0x1ba9('0x39')]=[{'all':!![]}];}_0x12dccf=_[_0x1ba9('0x36')]({},_0x12dccf,_0x1a0112[_0x1ba9('0x40')]);return db['SugarcrmAccount'][_0x1ba9('0x41')](_0x12dccf)[_0x1ba9('0x22')](handleEntityNotFound(_0x2f76ce,null))[_0x1ba9('0x22')](respondWithResult(_0x2f76ce,null))['catch'](handleError(_0x2f76ce,null));};exports[_0x1ba9('0x42')]=function(_0x5051c7,_0x5b0bcc){return db[_0x1ba9('0x28')]['create'](_0x5051c7[_0x1ba9('0x43')],{})[_0x1ba9('0x22')](respondWithResult(_0x5b0bcc,0xc9))[_0x1ba9('0x3b')](handleError(_0x5b0bcc,null));};exports[_0x1ba9('0x21')]=function(_0xcd2e0f,_0x40e21c){if(_0xcd2e0f['body']['id']){delete _0xcd2e0f['body']['id'];}return db[_0x1ba9('0x28')][_0x1ba9('0x41')]({'where':{'id':_0xcd2e0f['params']['id']}})[_0x1ba9('0x22')](handleEntityNotFound(_0x40e21c,null))[_0x1ba9('0x22')](saveUpdates(_0xcd2e0f['body'],null))['then'](respondWithResult(_0x40e21c,null))['catch'](handleError(_0x40e21c,null));};exports[_0x1ba9('0x44')]=function(_0x16bcb7,_0xd6babc){return db[_0x1ba9('0x28')][_0x1ba9('0x41')]({'where':{'id':_0x16bcb7[_0x1ba9('0x45')]['id']}})['then'](handleEntityNotFound(_0xd6babc,null))[_0x1ba9('0x22')](removeEntity(_0xd6babc,null))[_0x1ba9('0x3b')](handleError(_0xd6babc,null));};exports[_0x1ba9('0x46')]=function(_0x23a426,_0x15b4f4,_0x2b6a88){var _0x3fd1d3={};var _0x3cc47c={};var _0x527f06;var _0x422b86;return db['SugarcrmAccount'][_0x1ba9('0x47')]({'where':{'id':_0x23a426[_0x1ba9('0x45')]['id']}})[_0x1ba9('0x22')](handleEntityNotFound(_0x15b4f4,null))[_0x1ba9('0x22')](function(_0x113b13){if(_0x113b13){_0x527f06=_0x113b13;_0x3cc47c[_0x1ba9('0x2b')]=_[_0x1ba9('0x3d')](db[_0x1ba9('0x48')]['rawAttributes']);_0x3cc47c[_0x1ba9('0x2c')]=_[_0x1ba9('0x3d')](_0x23a426[_0x1ba9('0x2c')]);_0x3cc47c[_0x1ba9('0x2d')]=_[_0x1ba9('0x2f')](_0x3cc47c[_0x1ba9('0x2b')],_0x3cc47c[_0x1ba9('0x2c')]);_0x3fd1d3[_0x1ba9('0x2e')]=_[_0x1ba9('0x2f')](_0x3cc47c[_0x1ba9('0x2b')],qs['fields'](_0x23a426[_0x1ba9('0x2c')]['fields']));_0x3fd1d3[_0x1ba9('0x2e')]=_0x3fd1d3[_0x1ba9('0x2e')][_0x1ba9('0x3f')]?_0x3fd1d3['attributes']:_0x3cc47c[_0x1ba9('0x2b')];_0x3fd1d3[_0x1ba9('0x49')]=qs[_0x1ba9('0x32')](_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x32')]);_0x3fd1d3['where']=qs[_0x1ba9('0x2d')](_[_0x1ba9('0x33')](_0x23a426[_0x1ba9('0x2c')],_0x3cc47c[_0x1ba9('0x2d')]));if(_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x34')]){_0x3fd1d3[_0x1ba9('0x35')]=_['merge'](_0x3fd1d3['where'],{'$or':_[_0x1ba9('0x27')](_0x3fd1d3[_0x1ba9('0x2e')],function(_0x14d8b6){var _0x4955c5={};_0x4955c5[_0x14d8b6]={'$like':'%'+_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x34')]+'%'};return _0x4955c5;})});}_0x3fd1d3=_[_0x1ba9('0x36')]({},_0x3fd1d3,_0x23a426[_0x1ba9('0x40')]);return _0x527f06[_0x1ba9('0x46')](_0x3fd1d3);}})[_0x1ba9('0x22')](function(_0x3836bf){if(_0x3836bf){_0x422b86=_0x3836bf['length'];if(!_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x31')](_0x1ba9('0x4a'))){_0x3fd1d3[_0x1ba9('0x1c')]=qs[_0x1ba9('0x1c')](_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x1c')]);_0x3fd1d3[_0x1ba9('0x1a')]=qs['offset'](_0x23a426[_0x1ba9('0x2c')][_0x1ba9('0x1a')]);}return _0x527f06[_0x1ba9('0x46')](_0x3fd1d3);}})[_0x1ba9('0x22')](function(_0x2d8bad){if(_0x2d8bad){return _0x2d8bad?{'count':_0x422b86,'rows':_0x2d8bad}:null;}})[_0x1ba9('0x22')](respondWithResult(_0x15b4f4,null))[_0x1ba9('0x3b')](handleError(_0x15b4f4,null));};exports[_0x1ba9('0x4b')]=function(_0x3d23a2,_0xd962c6,_0x5736a4){if(_0x3d23a2[_0x1ba9('0x43')]['id']){delete _0x3d23a2[_0x1ba9('0x43')]['id'];}return db[_0x1ba9('0x28')][_0x1ba9('0x47')]({'where':{'id':_0x3d23a2[_0x1ba9('0x45')]['id']}})['then'](handleEntityNotFound(_0xd962c6,null))[_0x1ba9('0x22')](function(_0x2b22cd){if(_0x2b22cd){_0x3d23a2[_0x1ba9('0x43')][_0x1ba9('0x4c')]=_0x2b22cd['id'];_0x3d23a2[_0x1ba9('0x43')][_0x1ba9('0x4d')]=integrations['getSubjects'](_0x3d23a2['body'][_0x1ba9('0x4e')],_0x3d23a2[_0x1ba9('0x43')][_0x1ba9('0x2a')]);_0x3d23a2['body'][_0x1ba9('0x4f')]=integrations[_0x1ba9('0x50')](_0x3d23a2[_0x1ba9('0x43')][_0x1ba9('0x4e')],_0x3d23a2[_0x1ba9('0x43')]['type']);return db[_0x1ba9('0x48')][_0x1ba9('0x42')](_0x3d23a2['body'],{'include':[{'model':db[_0x1ba9('0x51')],'as':_0x1ba9('0x4d')},{'model':db[_0x1ba9('0x51')],'as':_0x1ba9('0x4f')}]});}return null;})['then'](respondWithResult(_0xd962c6,null))[_0x1ba9('0x3b')](handleError(_0xd962c6,null));};exports[_0x1ba9('0x52')]=function(_0x558e76,_0x243841,_0x3ff099){var _0x418492='';var _0x2050d5=['id',_0x1ba9('0x24'),'assigned_user_id',_0x1ba9('0x53'),_0x1ba9('0x54'),_0x1ba9('0x55'),'duration_hours','duration_minutes',_0x1ba9('0x56'),_0x1ba9('0x57'),_0x1ba9('0x58'),_0x1ba9('0x59')];return db[_0x1ba9('0x28')][_0x1ba9('0x47')]({'where':{'id':_0x558e76[_0x1ba9('0x45')]['id']},'attributes':['id','username',_0x1ba9('0x5a'),_0x1ba9('0x5b')]})[_0x1ba9('0x22')](handleEntityNotFound(_0x243841,null))[_0x1ba9('0x22')](function(_0x5ee1ab){if(_0x5ee1ab){_0x418492=_0x5ee1ab[_0x1ba9('0x5b')];var _0x7cf3ad=_0x418492[_0x1ba9('0x5c')](-0x1);if(_0x7cf3ad==='/'){_0x418492=_0x418492[_0x1ba9('0x5d')](0x0,_0x418492[_0x1ba9('0x5e')](_0x7cf3ad));}return rp({'method':'POST','uri':util[_0x1ba9('0x5f')]('%s%s',_0x418492,_0x1ba9('0x60')),'json':!![],'form':{'method':'login','input_type':_0x1ba9('0x61'),'response_type':_0x1ba9('0x61'),'rest_data':JSON[_0x1ba9('0x62')]({'user_auth':{'user_name':_0x5ee1ab[_0x1ba9('0x63')],'password':_0x5ee1ab[_0x1ba9('0x5a')],'encryption':_0x1ba9('0x64')},'application':_0x1ba9('0x65')})}});}})[_0x1ba9('0x22')](function(_0x7615b0){if(_0x7615b0&&_0x7615b0[_0x1ba9('0x24')]!==_0x1ba9('0x66')&&_0x7615b0[_0x1ba9('0x24')]!==_0x1ba9('0x67')){return rp({'method':'POST','uri':util[_0x1ba9('0x5f')](_0x1ba9('0x68'),_0x418492,_0x1ba9('0x60')),'json':!![],'form':{'method':_0x1ba9('0x69'),'input_type':_0x1ba9('0x61'),'response_type':_0x1ba9('0x61'),'rest_data':JSON[_0x1ba9('0x62')]({'session':_0x7615b0['id'],'module_name':'Calls'})}})[_0x1ba9('0x22')](function(_0x5cd680){if(_0x5cd680){var _0x5beed3=_[_0x1ba9('0x6a')](_0x5cd680[_0x1ba9('0x6b')]);_[_0x1ba9('0x6c')](_0x5beed3,function(_0x520ac8){return _0x2050d5[_0x1ba9('0x6d')](_0x520ac8[_0x1ba9('0x24')]);});return{'count':_0x5beed3[_0x1ba9('0x3f')],'rows':_['map'](_0x5beed3,function(_0x4cc4ea){return{'id':_0x4cc4ea[_0x1ba9('0x24')],'name':_0x4cc4ea[_0x1ba9('0x6e')],'custom':_[_0x1ba9('0x6f')](_0x4cc4ea['name'],'_c')?!![]:![],'options':_0x4cc4ea[_0x1ba9('0x40')]?_[_0x1ba9('0x27')](_['values'](_0x4cc4ea[_0x1ba9('0x40')]),function(_0x8461b0){return{'name':_0x8461b0[_0x1ba9('0x70')],'value':_0x8461b0[_0x1ba9('0x24')]};}):[]};})};}})[_0x1ba9('0x22')](respondWithResult(_0x243841,null))[_0x1ba9('0x3b')](function(_0x5f59e3){var _0xbf3bc1=_0x558e76[_0x1ba9('0x2c')][_0x1ba9('0x71')]?0x1f4:_0x5f59e3[_0x1ba9('0x72')]||0x1f4;logger[_0x1ba9('0x73')](_0x1ba9('0x74'),'getFields',_0xbf3bc1,JSON['stringify'](_0x5f59e3));delete _0x5f59e3[_0x1ba9('0x24')];if(_0xbf3bc1===0x191){_0xbf3bc1=0x190;}_0x243841[_0x1ba9('0x17')](_0xbf3bc1)[_0x1ba9('0x25')](_0x558e76[_0x1ba9('0x2c')]['test']?{'message':_0x1ba9('0x75'),'statusCode':_0x5f59e3['statusCode']}:_0x5f59e3);});}else{var _0x48865e=0x1f4;_0x243841[_0x1ba9('0x17')](_0x48865e)[_0x1ba9('0x25')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index b1188f6..0199353 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 _0xabf0=['exports','define','SugarcrmAccount','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x105e3e,_0x4cb667){var _0x5b0125=function(_0x877866){while(--_0x877866){_0x105e3e['push'](_0x105e3e['shift']());}};_0x5b0125(++_0x4cb667);}(_0xabf0,0x183));var _0x0abf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xabf0[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x0abf('0x0'));var logger=require(_0x0abf('0x1'))(_0x0abf('0x2'));var moment=require(_0x0abf('0x3'));var BPromise=require('bluebird');var rp=require(_0x0abf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0abf('0x5'));var config=require(_0x0abf('0x6'));var attributes=require(_0x0abf('0x7'));var integrations=require(_0x0abf('0x8'));module[_0x0abf('0x9')]=function(_0x4611b7,_0x5bde3e){return _0x4611b7[_0x0abf('0xa')](_0x0abf('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb856=['./intSugarcrmAccount.attributes','define','SugarcrmAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0xb856,0xcf));var _0x6b85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb856[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6b85('0x0'));var util=require('util');var logger=require(_0x6b85('0x1'))(_0x6b85('0x2'));var moment=require(_0x6b85('0x3'));var BPromise=require(_0x6b85('0x4'));var rp=require(_0x6b85('0x5'));var fs=require('fs');var path=require(_0x6b85('0x6'));var rimraf=require(_0x6b85('0x7'));var config=require(_0x6b85('0x8'));var attributes=require(_0x6b85('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e6d21,_0x41bc2e){return _0x4e6d21[_0x6b85('0xa')](_0x6b85('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 54813f8..9bdee4c 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 _0x30e8=['error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify'];(function(_0x3ceef2,_0x198e1e){var _0x58f8a0=function(_0x526fbe){while(--_0x526fbe){_0x3ceef2['push'](_0x3ceef2['shift']());}};_0x58f8a0(++_0x198e1e);}(_0x30e8,0xa8));var _0x830e=function(_0x4de342,_0x56afa){_0x4de342=_0x4de342-0x0;var _0x1731a9=_0x30e8[_0x4de342];return _0x1731a9;};'use strict';var _=require(_0x830e('0x0'));var util=require(_0x830e('0x1'));var moment=require(_0x830e('0x2'));var BPromise=require(_0x830e('0x3'));var rs=require(_0x830e('0x4'));var fs=require('fs');var Redis=require(_0x830e('0x5'));var db=require(_0x830e('0x6'))['db'];var utils=require(_0x830e('0x7'));var logger=require(_0x830e('0x8'))(_0x830e('0x9'));var config=require(_0x830e('0xa'));var jayson=require(_0x830e('0xb'));var client=jayson[_0x830e('0xc')][_0x830e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x508503,_0x2045de,_0x50a0a9){return new BPromise(function(_0x4eb71d,_0x1fa141){return client['request'](_0x508503,_0x50a0a9)[_0x830e('0xe')](function(_0x24ebb0){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x2045de,_0x830e('0xf'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2045de,_0x830e('0xf'),JSON[_0x830e('0x10')](_0x24ebb0));if(_0x24ebb0[_0x830e('0x11')]){if(_0x24ebb0[_0x830e('0x11')][_0x830e('0x12')]===0x1f4){logger[_0x830e('0x11')](_0x830e('0x13'),_0x2045de,_0x24ebb0[_0x830e('0x11')][_0x830e('0x14')]);return _0x1fa141(_0x24ebb0[_0x830e('0x11')][_0x830e('0x14')]);}logger['error'](_0x830e('0x13'),_0x2045de,_0x24ebb0[_0x830e('0x11')]['message']);return _0x4eb71d(_0x24ebb0[_0x830e('0x11')][_0x830e('0x14')]);}else{logger[_0x830e('0x15')](_0x830e('0x13'),_0x2045de,'request\x20sent');_0x4eb71d(_0x24ebb0[_0x830e('0x16')]['message']);}})[_0x830e('0x17')](function(_0x4dd48a){logger['error'](_0x830e('0x13'),_0x2045de,_0x4dd48a);_0x1fa141(_0x4dd48a);});});}exports[_0x830e('0x18')]=function(_0x88e379){var _0x1dfed0=this;return new Promise(function(_0x25940f,_0x1f14b8){return db[_0x830e('0x19')][_0x830e('0x1a')]({'raw':_0x88e379[_0x830e('0x1b')]?_0x88e379[_0x830e('0x1b')][_0x830e('0x1c')]===undefined?!![]:![]:!![],'where':_0x88e379['options']?_0x88e379[_0x830e('0x1b')][_0x830e('0x1d')]||null:null,'attributes':_0x88e379[_0x830e('0x1b')]?_0x88e379[_0x830e('0x1b')][_0x830e('0x1e')]||null:null,'limit':_0x88e379[_0x830e('0x1b')]?_0x88e379['options']['limit']||null:null,'include':_0x88e379[_0x830e('0x1b')]?_0x88e379[_0x830e('0x1b')][_0x830e('0x1f')]?_[_0x830e('0x20')](_0x88e379[_0x830e('0x1b')][_0x830e('0x1f')],function(_0x19f5e7){return{'model':db[_0x19f5e7[_0x830e('0x21')]],'as':_0x19f5e7['as'],'attributes':_0x19f5e7[_0x830e('0x1e')],'include':_0x19f5e7[_0x830e('0x1f')]?_[_0x830e('0x20')](_0x19f5e7[_0x830e('0x1f')],function(_0x25fff3){return{'model':db[_0x25fff3[_0x830e('0x21')]],'as':_0x25fff3['as'],'attributes':_0x25fff3[_0x830e('0x1e')],'include':_0x25fff3['include']?_[_0x830e('0x20')](_0x25fff3['include'],function(_0x9e44b0){return{'model':db[_0x9e44b0[_0x830e('0x21')]],'as':_0x9e44b0['as'],'attributes':_0x9e44b0[_0x830e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f7813){logger[_0x830e('0x15')]('GetSugarcrmAccount',_0x88e379);logger[_0x830e('0x22')](_0x830e('0x18'),_0x88e379,JSON[_0x830e('0x10')](_0x1f7813));_0x25940f(_0x1f7813);})[_0x830e('0x17')](function(_0xfd2e83){logger['error'](_0x830e('0x18'),_0xfd2e83[_0x830e('0x14')],_0x88e379);_0x1f14b8(_0x1dfed0[_0x830e('0x11')](0x1f4,_0xfd2e83[_0x830e('0x14')]));});});};exports[_0x830e('0x23')]=function(_0xb54a91){var _0x40da96=this;return new Promise(function(_0x2fd302,_0x2adc2a){return db[_0x830e('0x19')][_0x830e('0x24')]({'raw':_0xb54a91[_0x830e('0x1b')]?_0xb54a91[_0x830e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xb54a91[_0x830e('0x1b')]?_0xb54a91['options'][_0x830e('0x1d')]||null:null,'attributes':_0xb54a91['options']?_0xb54a91[_0x830e('0x1b')][_0x830e('0x1e')]||null:null,'include':_0xb54a91['options']?_0xb54a91[_0x830e('0x1b')][_0x830e('0x1f')]?_[_0x830e('0x20')](_0xb54a91[_0x830e('0x1b')][_0x830e('0x1f')],function(_0xad0717){return{'model':db[_0xad0717[_0x830e('0x21')]],'as':_0xad0717['as'],'attributes':_0xad0717[_0x830e('0x1e')],'include':_0xad0717['include']?_[_0x830e('0x20')](_0xad0717[_0x830e('0x1f')],function(_0x30cd1b){return{'model':db[_0x30cd1b['model']],'as':_0x30cd1b['as'],'attributes':_0x30cd1b[_0x830e('0x1e')],'include':_0x30cd1b['include']?_[_0x830e('0x20')](_0x30cd1b['include'],function(_0x48d9c7){return{'model':db[_0x48d9c7[_0x830e('0x21')]],'as':_0x48d9c7['as'],'attributes':_0x48d9c7[_0x830e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45b1e3){logger['info'](_0x830e('0x23'),_0xb54a91);logger[_0x830e('0x22')](_0x830e('0x23'),_0xb54a91,JSON[_0x830e('0x10')](_0x45b1e3));_0x2fd302(_0x45b1e3);})[_0x830e('0x17')](function(_0x47fcd4){logger[_0x830e('0x11')](_0x830e('0x23'),_0x47fcd4[_0x830e('0x14')],_0xb54a91);_0x2adc2a(_0x40da96['error'](0x1f4,_0x47fcd4[_0x830e('0x14')]));});});}; \ No newline at end of file +var _0xd9e0=['GetSugarcrmAccount','stringify','catch','ShowSugarcrmAccount','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','SugarcrmAccount','options','raw','where','limit','include','model','attributes','map'];(function(_0x5abe5c,_0x109787){var _0x3e99bc=function(_0x12541a){while(--_0x12541a){_0x5abe5c['push'](_0x5abe5c['shift']());}};_0x3e99bc(++_0x109787);}(_0xd9e0,0xaf));var _0x0d9e=function(_0x5b1072,_0xf5e8e3){_0x5b1072=_0x5b1072-0x0;var _0x22e0df=_0xd9e0[_0x5b1072];return _0x22e0df;};'use strict';var _=require('lodash');var util=require(_0x0d9e('0x0'));var moment=require(_0x0d9e('0x1'));var BPromise=require(_0x0d9e('0x2'));var rs=require(_0x0d9e('0x3'));var fs=require('fs');var Redis=require(_0x0d9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d9e('0x5'));var logger=require('../../config/logger')(_0x0d9e('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d9e('0x7'));var client=jayson[_0x0d9e('0x8')][_0x0d9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c6f1c,_0x55c592,_0x22a8f1){return new BPromise(function(_0x2d1f84,_0x1cffe6){return client[_0x0d9e('0xa')](_0x3c6f1c,_0x22a8f1)['then'](function(_0x3ff737){logger[_0x0d9e('0xb')](_0x0d9e('0xc'),_0x55c592,_0x0d9e('0xd'));logger[_0x0d9e('0xe')](_0x0d9e('0xf'),_0x55c592,_0x0d9e('0xd'),JSON['stringify'](_0x3ff737));if(_0x3ff737['error']){if(_0x3ff737[_0x0d9e('0x10')][_0x0d9e('0x11')]===0x1f4){logger[_0x0d9e('0x10')](_0x0d9e('0xc'),_0x55c592,_0x3ff737['error'][_0x0d9e('0x12')]);return _0x1cffe6(_0x3ff737[_0x0d9e('0x10')][_0x0d9e('0x12')]);}logger[_0x0d9e('0x10')](_0x0d9e('0xc'),_0x55c592,_0x3ff737[_0x0d9e('0x10')][_0x0d9e('0x12')]);return _0x2d1f84(_0x3ff737[_0x0d9e('0x10')][_0x0d9e('0x12')]);}else{logger[_0x0d9e('0xb')](_0x0d9e('0xc'),_0x55c592,'request\x20sent');_0x2d1f84(_0x3ff737[_0x0d9e('0x13')]['message']);}})['catch'](function(_0x47c977){logger[_0x0d9e('0x10')](_0x0d9e('0xc'),_0x55c592,_0x47c977);_0x1cffe6(_0x47c977);});});}exports['GetSugarcrmAccount']=function(_0x31f993){var _0x5c4320=this;return new Promise(function(_0x1c221a,_0x359918){return db[_0x0d9e('0x14')]['findAll']({'raw':_0x31f993[_0x0d9e('0x15')]?_0x31f993['options'][_0x0d9e('0x16')]===undefined?!![]:![]:!![],'where':_0x31f993['options']?_0x31f993[_0x0d9e('0x15')][_0x0d9e('0x17')]||null:null,'attributes':_0x31f993[_0x0d9e('0x15')]?_0x31f993['options']['attributes']||null:null,'limit':_0x31f993[_0x0d9e('0x15')]?_0x31f993['options'][_0x0d9e('0x18')]||null:null,'include':_0x31f993[_0x0d9e('0x15')]?_0x31f993['options'][_0x0d9e('0x19')]?_['map'](_0x31f993[_0x0d9e('0x15')]['include'],function(_0x51de43){return{'model':db[_0x51de43[_0x0d9e('0x1a')]],'as':_0x51de43['as'],'attributes':_0x51de43[_0x0d9e('0x1b')],'include':_0x51de43['include']?_['map'](_0x51de43[_0x0d9e('0x19')],function(_0x538899){return{'model':db[_0x538899[_0x0d9e('0x1a')]],'as':_0x538899['as'],'attributes':_0x538899[_0x0d9e('0x1b')],'include':_0x538899[_0x0d9e('0x19')]?_[_0x0d9e('0x1c')](_0x538899[_0x0d9e('0x19')],function(_0x351897){return{'model':db[_0x351897[_0x0d9e('0x1a')]],'as':_0x351897['as'],'attributes':_0x351897[_0x0d9e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12fe87){logger[_0x0d9e('0xb')](_0x0d9e('0x1d'),_0x31f993);logger[_0x0d9e('0xe')](_0x0d9e('0x1d'),_0x31f993,JSON[_0x0d9e('0x1e')](_0x12fe87));_0x1c221a(_0x12fe87);})[_0x0d9e('0x1f')](function(_0x241cea){logger['error'](_0x0d9e('0x1d'),_0x241cea[_0x0d9e('0x12')],_0x31f993);_0x359918(_0x5c4320[_0x0d9e('0x10')](0x1f4,_0x241cea['message']));});});};exports[_0x0d9e('0x20')]=function(_0xcefc46){var _0x43e74e=this;return new Promise(function(_0x3fbae8,_0x309ace){return db[_0x0d9e('0x14')]['find']({'raw':_0xcefc46[_0x0d9e('0x15')]?_0xcefc46['options'][_0x0d9e('0x16')]===undefined?!![]:![]:!![],'where':_0xcefc46[_0x0d9e('0x15')]?_0xcefc46[_0x0d9e('0x15')]['where']||null:null,'attributes':_0xcefc46['options']?_0xcefc46[_0x0d9e('0x15')][_0x0d9e('0x1b')]||null:null,'include':_0xcefc46[_0x0d9e('0x15')]?_0xcefc46['options']['include']?_[_0x0d9e('0x1c')](_0xcefc46[_0x0d9e('0x15')][_0x0d9e('0x19')],function(_0x428120){return{'model':db[_0x428120['model']],'as':_0x428120['as'],'attributes':_0x428120[_0x0d9e('0x1b')],'include':_0x428120[_0x0d9e('0x19')]?_[_0x0d9e('0x1c')](_0x428120[_0x0d9e('0x19')],function(_0xe87bde){return{'model':db[_0xe87bde[_0x0d9e('0x1a')]],'as':_0xe87bde['as'],'attributes':_0xe87bde[_0x0d9e('0x1b')],'include':_0xe87bde[_0x0d9e('0x19')]?_[_0x0d9e('0x1c')](_0xe87bde[_0x0d9e('0x19')],function(_0x208e5c){return{'model':db[_0x208e5c[_0x0d9e('0x1a')]],'as':_0x208e5c['as'],'attributes':_0x208e5c[_0x0d9e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d9e('0x21')](function(_0x4fe54e){logger[_0x0d9e('0xb')]('ShowSugarcrmAccount',_0xcefc46);logger[_0x0d9e('0xe')]('ShowSugarcrmAccount',_0xcefc46,JSON[_0x0d9e('0x1e')](_0x4fe54e));_0x3fbae8(_0x4fe54e);})[_0x0d9e('0x1f')](function(_0x17b10f){logger[_0x0d9e('0x10')](_0x0d9e('0x20'),_0x17b10f['message'],_0xcefc46);_0x309ace(_0x43e74e['error'](0x1f4,_0x17b10f[_0x0d9e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 49242f5..278e90c 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 _0x0a33=['create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post'];(function(_0x17d713,_0x19b690){var _0x452666=function(_0xaff2b4){while(--_0xaff2b4){_0x17d713['push'](_0x17d713['shift']());}};_0x452666(++_0x19b690);}(_0x0a33,0x17c));var _0x30a3=function(_0x2c11eb,_0x855d9a){_0x2c11eb=_0x2c11eb-0x0;var _0x30aece=_0x0a33[_0x2c11eb];return _0x30aece;};'use strict';var multer=require(_0x30a3('0x0'));var util=require(_0x30a3('0x1'));var path=require(_0x30a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x30a3('0x3'));var router=express[_0x30a3('0x4')]();var fs_extra=require(_0x30a3('0x5'));var auth=require(_0x30a3('0x6'));var interaction=require(_0x30a3('0x7'));var config=require(_0x30a3('0x8'));var controller=require(_0x30a3('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x30a3('0xa')]);router[_0x30a3('0xb')](_0x30a3('0xc'),auth[_0x30a3('0xd')](),controller[_0x30a3('0xe')]);router['get']('/:id/fields',auth[_0x30a3('0xd')](),controller[_0x30a3('0xf')]);router['get'](_0x30a3('0x10'),auth[_0x30a3('0xd')](),controller[_0x30a3('0x11')]);router[_0x30a3('0xb')](_0x30a3('0x12'),auth[_0x30a3('0xd')](),controller['getDescriptions']);router[_0x30a3('0x13')]('/',auth[_0x30a3('0xd')](),controller[_0x30a3('0x14')]);router[_0x30a3('0x15')](_0x30a3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x30a3('0x16')](_0x30a3('0xc'),auth[_0x30a3('0xd')](),controller[_0x30a3('0x17')]);module[_0x30a3('0x18')]=router; \ No newline at end of file +var _0x366d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','isAuthenticated','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1fce96,_0x405272){var _0xa001d7=function(_0x3cd45b){while(--_0x3cd45b){_0x1fce96['push'](_0x1fce96['shift']());}};_0xa001d7(++_0x405272);}(_0x366d,0xe4));var _0xd366=function(_0xc68660,_0x27bdf1){_0xc68660=_0xc68660-0x0;var _0x450fa9=_0x366d[_0xc68660];return _0x450fa9;};'use strict';var multer=require(_0xd366('0x0'));var util=require(_0xd366('0x1'));var path=require(_0xd366('0x2'));var timeout=require(_0xd366('0x3'));var express=require(_0xd366('0x4'));var router=express[_0xd366('0x5')]();var fs_extra=require(_0xd366('0x6'));var auth=require(_0xd366('0x7'));var interaction=require(_0xd366('0x8'));var config=require(_0xd366('0x9'));var controller=require(_0xd366('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xd366('0xb')]);router[_0xd366('0xc')]('/:id',auth[_0xd366('0xd')](),controller['show']);router[_0xd366('0xc')](_0xd366('0xe'),auth[_0xd366('0xd')](),controller['getFields']);router[_0xd366('0xc')](_0xd366('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0xd366('0x10'),auth['isAuthenticated'](),controller[_0xd366('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd366('0x12'),auth[_0xd366('0xd')](),controller[_0xd366('0x13')]);router[_0xd366('0x14')](_0xd366('0x12'),auth[_0xd366('0xd')](),controller[_0xd366('0x15')]);module[_0xd366('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 64f711e..101da63 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 _0xbc7a=['sequelize','exports','STRING'];(function(_0xebf5,_0x3754f3){var _0x4c52bf=function(_0x3ccdde){while(--_0x3ccdde){_0xebf5['push'](_0xebf5['shift']());}};_0x4c52bf(++_0x3754f3);}(_0xbc7a,0x174));var _0xabc7=function(_0x33f7c5,_0x596c99){_0x33f7c5=_0x33f7c5-0x0;var _0x267701=_0xbc7a[_0x33f7c5];return _0x267701;};'use strict';var Sequelize=require(_0xabc7('0x0'));module[_0xabc7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xabc7('0x2')]}}; \ No newline at end of file +var _0x988c=['STRING','sequelize'];(function(_0xb7283f,_0x193c1c){var _0x44e873=function(_0x572549){while(--_0x572549){_0xb7283f['push'](_0xb7283f['shift']());}};_0x44e873(++_0x193c1c);}(_0x988c,0x8d));var _0xc988=function(_0x1c9cb4,_0x42eebc){_0x1c9cb4=_0x1c9cb4-0x0;var _0x51b5a7=_0x988c[_0x1c9cb4];return _0x51b5a7;};'use strict';var Sequelize=require(_0xc988('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc988('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 38e100d..388dd48 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 _0xcc03=['save','then','destroy','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','rows','catch','params','length','includeAll','include','options','create','body','find','findOne','SugarcrmField','pick','getFields','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject'];(function(_0x469efb,_0x523585){var _0x3cfdaf=function(_0x1f03f2){while(--_0x1f03f2){_0x469efb['push'](_0x469efb['shift']());}};_0x3cfdaf(++_0x523585);}(_0xcc03,0x1a5));var _0x3cc0=function(_0x4dfd10,_0x3169d5){_0x4dfd10=_0x4dfd10-0x0;var _0x267950=_0xcc03[_0x4dfd10];return _0x267950;};'use strict';var emlformat=require(_0x3cc0('0x0'));var rimraf=require(_0x3cc0('0x1'));var zipdir=require(_0x3cc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cc0('0x3'));var moment=require(_0x3cc0('0x4'));var BPromise=require(_0x3cc0('0x5'));var Mustache=require(_0x3cc0('0x6'));var util=require(_0x3cc0('0x7'));var path=require('path');var sox=require(_0x3cc0('0x8'));var csv=require(_0x3cc0('0x9'));var ejs=require(_0x3cc0('0xa'));var fs=require('fs');var fs_extra=require(_0x3cc0('0xb'));var _=require(_0x3cc0('0xc'));var squel=require(_0x3cc0('0xd'));var crypto=require(_0x3cc0('0xe'));var jsforce=require(_0x3cc0('0xf'));var deskjs=require(_0x3cc0('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3cc0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3cc0('0x12'));var hardwareService=require(_0x3cc0('0x13'));var logger=require(_0x3cc0('0x14'))('api');var utils=require(_0x3cc0('0x15'));var config=require(_0x3cc0('0x16'));var licenseUtil=require(_0x3cc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3996c6,_0x2dec62){_0x2dec62=_0x2dec62||0xcc;return function(_0x9564cc){if(_0x9564cc){return _0x3996c6[_0x3cc0('0x18')](_0x2dec62);}return _0x3996c6[_0x3cc0('0x19')](_0x2dec62)[_0x3cc0('0x1a')]();};}function respondWithResult(_0x5c37c2,_0x4dec9b){_0x4dec9b=_0x4dec9b||0xc8;return function(_0x49ce63){if(_0x49ce63){return _0x5c37c2[_0x3cc0('0x19')](_0x4dec9b)[_0x3cc0('0x1b')](_0x49ce63);}};}function respondWithFilteredResult(_0x407c5d,_0x22e865){return function(_0x262fe7){if(_0x262fe7){var _0x1de945=typeof _0x22e865['offset']==='undefined'&&typeof _0x22e865[_0x3cc0('0x1c')]===_0x3cc0('0x1d');var _0x2d969d=_0x262fe7[_0x3cc0('0x1e')];var _0x2a8dbb=_0x1de945?0x0:_0x22e865[_0x3cc0('0x1f')];var _0x1b68e7=_0x1de945?_0x262fe7[_0x3cc0('0x1e')]:_0x22e865['offset']+_0x22e865[_0x3cc0('0x1c')];var _0x50e815;if(_0x1b68e7>=_0x2d969d){_0x1b68e7=_0x2d969d;_0x50e815=0xc8;}else{_0x50e815=0xce;}_0x407c5d[_0x3cc0('0x19')](_0x50e815);return _0x407c5d[_0x3cc0('0x20')](_0x3cc0('0x21'),_0x2a8dbb+'-'+_0x1b68e7+'/'+_0x2d969d)['json'](_0x262fe7);}return null;};}function patchUpdates(_0x198ddd){return function(_0x5b9178){try{jsonpatch['apply'](_0x5b9178,_0x198ddd,!![]);}catch(_0x4622a7){return BPromise[_0x3cc0('0x22')](_0x4622a7);}return _0x5b9178[_0x3cc0('0x23')]();};}function saveUpdates(_0x2dec0d,_0x5f4f34){return function(_0x139d14){if(_0x139d14){return _0x139d14['update'](_0x2dec0d)[_0x3cc0('0x24')](function(_0x2d4f78){return _0x2d4f78;});}return null;};}function removeEntity(_0x2df9c7,_0x350b4f){return function(_0x148b62){if(_0x148b62){return _0x148b62[_0x3cc0('0x25')]()[_0x3cc0('0x24')](function(){_0x2df9c7[_0x3cc0('0x19')](0xcc)[_0x3cc0('0x1a')]();});}};}function handleEntityNotFound(_0xafadc0,_0x43168f){return function(_0x585fc3){if(!_0x585fc3){_0xafadc0[_0x3cc0('0x18')](0x194);}return _0x585fc3;};}function handleError(_0x5020b1,_0xe02645){_0xe02645=_0xe02645||0x1f4;return function(_0x4ca2d0){logger['error'](_0x4ca2d0[_0x3cc0('0x26')]);if(_0x4ca2d0[_0x3cc0('0x27')]){delete _0x4ca2d0[_0x3cc0('0x27')];}_0x5020b1[_0x3cc0('0x19')](_0xe02645)[_0x3cc0('0x28')](_0x4ca2d0);};}exports['index']=function(_0xbd3e7b,_0x5ebc29){var _0x52fc52={},_0x5a7dde={},_0x5226d2={'count':0x0,'rows':[]};var _0x496bdd=_['map'](db[_0x3cc0('0x29')][_0x3cc0('0x2a')],function(_0x3214e0){return{'name':_0x3214e0[_0x3cc0('0x2b')],'type':_0x3214e0[_0x3cc0('0x2c')]['key']};});_0x5a7dde[_0x3cc0('0x2d')]=_[_0x3cc0('0x2e')](_0x496bdd,_0x3cc0('0x27'));_0x5a7dde[_0x3cc0('0x2f')]=_[_0x3cc0('0x30')](_0xbd3e7b[_0x3cc0('0x2f')]);_0x5a7dde[_0x3cc0('0x31')]=_[_0x3cc0('0x32')](_0x5a7dde[_0x3cc0('0x2d')],_0x5a7dde[_0x3cc0('0x2f')]);_0x52fc52[_0x3cc0('0x33')]=_[_0x3cc0('0x32')](_0x5a7dde[_0x3cc0('0x2d')],qs[_0x3cc0('0x34')](_0xbd3e7b['query']['fields']));_0x52fc52[_0x3cc0('0x33')]=_0x52fc52['attributes']['length']?_0x52fc52['attributes']:_0x5a7dde[_0x3cc0('0x2d')];if(!_0xbd3e7b[_0x3cc0('0x2f')][_0x3cc0('0x35')](_0x3cc0('0x36'))){_0x52fc52[_0x3cc0('0x1c')]=qs[_0x3cc0('0x1c')](_0xbd3e7b[_0x3cc0('0x2f')]['limit']);_0x52fc52[_0x3cc0('0x1f')]=qs[_0x3cc0('0x1f')](_0xbd3e7b[_0x3cc0('0x2f')]['offset']);}_0x52fc52[_0x3cc0('0x37')]=qs[_0x3cc0('0x38')](_0xbd3e7b[_0x3cc0('0x2f')][_0x3cc0('0x38')]);_0x52fc52[_0x3cc0('0x39')]=qs[_0x3cc0('0x31')](_['pick'](_0xbd3e7b[_0x3cc0('0x2f')],_0x5a7dde[_0x3cc0('0x31')]),_0x496bdd);if(_0xbd3e7b[_0x3cc0('0x2f')][_0x3cc0('0x3a')]){_0x52fc52['where']=_[_0x3cc0('0x3b')](_0x52fc52[_0x3cc0('0x39')],{'$or':_[_0x3cc0('0x2e')](_0x496bdd,function(_0x34ec0b){if(_0x34ec0b[_0x3cc0('0x2c')]!==_0x3cc0('0x3c')){var _0x1318e8={};_0x1318e8[_0x34ec0b[_0x3cc0('0x27')]]={'$like':'%'+_0xbd3e7b[_0x3cc0('0x2f')][_0x3cc0('0x3a')]+'%'};return _0x1318e8;}})});}_0x52fc52=_['merge']({},_0x52fc52,_0xbd3e7b['options']);var _0x5c873d={'where':_0x52fc52['where']};return db[_0x3cc0('0x29')][_0x3cc0('0x1e')](_0x5c873d)['then'](function(_0x5529e9){_0x5226d2[_0x3cc0('0x1e')]=_0x5529e9;if(_0xbd3e7b['query']['includeAll']){_0x52fc52['include']=[{'all':!![]}];}return db[_0x3cc0('0x29')]['findAll'](_0x52fc52);})['then'](function(_0x51c441){_0x5226d2[_0x3cc0('0x3d')]=_0x51c441;return _0x5226d2;})[_0x3cc0('0x24')](respondWithFilteredResult(_0x5ebc29,_0x52fc52))[_0x3cc0('0x3e')](handleError(_0x5ebc29,null));};exports['show']=function(_0x5b7bdb,_0x2c5de3){var _0x5da472={'raw':![],'where':{'id':_0x5b7bdb[_0x3cc0('0x3f')]['id']}},_0xd87261={};_0xd87261[_0x3cc0('0x2d')]=_[_0x3cc0('0x30')](db[_0x3cc0('0x29')]['rawAttributes']);_0xd87261[_0x3cc0('0x2f')]=_['keys'](_0x5b7bdb[_0x3cc0('0x2f')]);_0xd87261[_0x3cc0('0x31')]=_[_0x3cc0('0x32')](_0xd87261[_0x3cc0('0x2d')],_0xd87261[_0x3cc0('0x2f')]);_0x5da472[_0x3cc0('0x33')]=_['intersection'](_0xd87261[_0x3cc0('0x2d')],qs['fields'](_0x5b7bdb[_0x3cc0('0x2f')]['fields']));_0x5da472[_0x3cc0('0x33')]=_0x5da472[_0x3cc0('0x33')][_0x3cc0('0x40')]?_0x5da472['attributes']:_0xd87261['model'];if(_0x5b7bdb[_0x3cc0('0x2f')][_0x3cc0('0x41')]){_0x5da472[_0x3cc0('0x42')]=[{'all':!![]}];}_0x5da472=_[_0x3cc0('0x3b')]({},_0x5da472,_0x5b7bdb[_0x3cc0('0x43')]);return db[_0x3cc0('0x29')]['find'](_0x5da472)[_0x3cc0('0x24')](handleEntityNotFound(_0x2c5de3,null))[_0x3cc0('0x24')](respondWithResult(_0x2c5de3,null))[_0x3cc0('0x3e')](handleError(_0x2c5de3,null));};exports['create']=function(_0x42ab0a,_0x234e2a){return db[_0x3cc0('0x29')][_0x3cc0('0x44')](_0x42ab0a['body'],{})[_0x3cc0('0x24')](respondWithResult(_0x234e2a,0xc9))['catch'](handleError(_0x234e2a,null));};exports['update']=function(_0x779114,_0x20392c){if(_0x779114['body']['id']){delete _0x779114[_0x3cc0('0x45')]['id'];}return db[_0x3cc0('0x29')][_0x3cc0('0x46')]({'where':{'id':_0x779114['params']['id']}})[_0x3cc0('0x24')](handleEntityNotFound(_0x20392c,null))['then'](saveUpdates(_0x779114[_0x3cc0('0x45')],null))[_0x3cc0('0x24')](respondWithResult(_0x20392c,null))[_0x3cc0('0x3e')](handleError(_0x20392c,null));};exports[_0x3cc0('0x25')]=function(_0x16a9b8,_0x6c5af0){return db['SugarcrmConfiguration'][_0x3cc0('0x46')]({'where':{'id':_0x16a9b8[_0x3cc0('0x3f')]['id']}})[_0x3cc0('0x24')](handleEntityNotFound(_0x6c5af0,null))['then'](removeEntity(_0x6c5af0,null))[_0x3cc0('0x3e')](handleError(_0x6c5af0,null));};exports['getFields']=function(_0x9ac43a,_0x4145dc,_0x51431c){var _0x21c16b={};var _0x2cda94={};var _0x78cc51;var _0x31d953;return db['SugarcrmConfiguration'][_0x3cc0('0x47')]({'where':{'id':_0x9ac43a[_0x3cc0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4145dc,null))[_0x3cc0('0x24')](function(_0x261108){if(_0x261108){_0x78cc51=_0x261108;_0x2cda94[_0x3cc0('0x2d')]=_['keys'](db[_0x3cc0('0x48')][_0x3cc0('0x2a')]);_0x2cda94['query']=_[_0x3cc0('0x30')](_0x9ac43a[_0x3cc0('0x2f')]);_0x2cda94[_0x3cc0('0x31')]=_[_0x3cc0('0x32')](_0x2cda94[_0x3cc0('0x2d')],_0x2cda94[_0x3cc0('0x2f')]);_0x21c16b[_0x3cc0('0x33')]=_[_0x3cc0('0x32')](_0x2cda94[_0x3cc0('0x2d')],qs[_0x3cc0('0x34')](_0x9ac43a[_0x3cc0('0x2f')][_0x3cc0('0x34')]));_0x21c16b[_0x3cc0('0x33')]=_0x21c16b[_0x3cc0('0x33')][_0x3cc0('0x40')]?_0x21c16b[_0x3cc0('0x33')]:_0x2cda94[_0x3cc0('0x2d')];_0x21c16b['order']=qs[_0x3cc0('0x38')](_0x9ac43a[_0x3cc0('0x2f')][_0x3cc0('0x38')]);_0x21c16b[_0x3cc0('0x39')]=qs[_0x3cc0('0x31')](_[_0x3cc0('0x49')](_0x9ac43a['query'],_0x2cda94[_0x3cc0('0x31')]));if(_0x9ac43a['query'][_0x3cc0('0x3a')]){_0x21c16b[_0x3cc0('0x39')]=_[_0x3cc0('0x3b')](_0x21c16b[_0x3cc0('0x39')],{'$or':_[_0x3cc0('0x2e')](_0x21c16b[_0x3cc0('0x33')],function(_0x4ebf04){var _0x5f58c5={};_0x5f58c5[_0x4ebf04]={'$like':'%'+_0x9ac43a[_0x3cc0('0x2f')][_0x3cc0('0x3a')]+'%'};return _0x5f58c5;})});}_0x21c16b=_[_0x3cc0('0x3b')]({},_0x21c16b,_0x9ac43a[_0x3cc0('0x43')]);return _0x78cc51[_0x3cc0('0x4a')](_0x21c16b);}})[_0x3cc0('0x24')](function(_0x589938){if(_0x589938){_0x31d953=_0x589938[_0x3cc0('0x40')];if(!_0x9ac43a[_0x3cc0('0x2f')][_0x3cc0('0x35')](_0x3cc0('0x36'))){_0x21c16b[_0x3cc0('0x1c')]=qs['limit'](_0x9ac43a[_0x3cc0('0x2f')]['limit']);_0x21c16b[_0x3cc0('0x1f')]=qs['offset'](_0x9ac43a[_0x3cc0('0x2f')]['offset']);}return _0x78cc51[_0x3cc0('0x4a')](_0x21c16b);}})[_0x3cc0('0x24')](function(_0xb34c97){if(_0xb34c97){return _0xb34c97?{'count':_0x31d953,'rows':_0xb34c97}:null;}})[_0x3cc0('0x24')](respondWithResult(_0x4145dc,null))['catch'](handleError(_0x4145dc,null));};exports['getSubjects']=function(_0x53f864,_0x15bc35,_0x1d768c){var _0x412902={};var _0x478cd6={};var _0x1e4797;var _0x5850e2;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x53f864[_0x3cc0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15bc35,null))[_0x3cc0('0x24')](function(_0x509476){if(_0x509476){_0x1e4797=_0x509476;_0x478cd6[_0x3cc0('0x2d')]=_[_0x3cc0('0x30')](db['SugarcrmField'][_0x3cc0('0x2a')]);_0x478cd6['query']=_[_0x3cc0('0x30')](_0x53f864[_0x3cc0('0x2f')]);_0x478cd6[_0x3cc0('0x31')]=_[_0x3cc0('0x32')](_0x478cd6[_0x3cc0('0x2d')],_0x478cd6[_0x3cc0('0x2f')]);_0x412902['attributes']=_[_0x3cc0('0x32')](_0x478cd6['model'],qs[_0x3cc0('0x34')](_0x53f864[_0x3cc0('0x2f')][_0x3cc0('0x34')]));_0x412902[_0x3cc0('0x33')]=_0x412902['attributes'][_0x3cc0('0x40')]?_0x412902[_0x3cc0('0x33')]:_0x478cd6[_0x3cc0('0x2d')];_0x412902[_0x3cc0('0x37')]=qs[_0x3cc0('0x38')](_0x53f864['query'][_0x3cc0('0x38')]);_0x412902[_0x3cc0('0x39')]=qs[_0x3cc0('0x31')](_['pick'](_0x53f864[_0x3cc0('0x2f')],_0x478cd6[_0x3cc0('0x31')]));if(_0x53f864[_0x3cc0('0x2f')]['filter']){_0x412902[_0x3cc0('0x39')]=_[_0x3cc0('0x3b')](_0x412902[_0x3cc0('0x39')],{'$or':_[_0x3cc0('0x2e')](_0x412902[_0x3cc0('0x33')],function(_0x21eef6){var _0x5420ea={};_0x5420ea[_0x21eef6]={'$like':'%'+_0x53f864[_0x3cc0('0x2f')][_0x3cc0('0x3a')]+'%'};return _0x5420ea;})});}_0x412902=_[_0x3cc0('0x3b')]({},_0x412902,_0x53f864[_0x3cc0('0x43')]);return _0x1e4797['getSubjects'](_0x412902);}})[_0x3cc0('0x24')](function(_0x2e951b){if(_0x2e951b){_0x5850e2=_0x2e951b[_0x3cc0('0x40')];if(!_0x53f864[_0x3cc0('0x2f')][_0x3cc0('0x35')](_0x3cc0('0x36'))){_0x412902[_0x3cc0('0x1c')]=qs['limit'](_0x53f864['query']['limit']);_0x412902[_0x3cc0('0x1f')]=qs['offset'](_0x53f864['query']['offset']);}return _0x1e4797['getSubjects'](_0x412902);}})['then'](function(_0x5d2d22){if(_0x5d2d22){return _0x5d2d22?{'count':_0x5850e2,'rows':_0x5d2d22}:null;}})[_0x3cc0('0x24')](respondWithResult(_0x15bc35,null))[_0x3cc0('0x3e')](handleError(_0x15bc35,null));};exports[_0x3cc0('0x4b')]=function(_0x3df79d,_0x18575b,_0x4a9508){var _0x282460={};var _0x183a3a={};var _0x1f0c68;var _0xcf3bc;return db[_0x3cc0('0x29')][_0x3cc0('0x47')]({'where':{'id':_0x3df79d[_0x3cc0('0x3f')]['id']}})[_0x3cc0('0x24')](handleEntityNotFound(_0x18575b,null))[_0x3cc0('0x24')](function(_0x5d548a){if(_0x5d548a){_0x1f0c68=_0x5d548a;_0x183a3a[_0x3cc0('0x2d')]=_[_0x3cc0('0x30')](db[_0x3cc0('0x48')][_0x3cc0('0x2a')]);_0x183a3a[_0x3cc0('0x2f')]=_[_0x3cc0('0x30')](_0x3df79d[_0x3cc0('0x2f')]);_0x183a3a[_0x3cc0('0x31')]=_[_0x3cc0('0x32')](_0x183a3a[_0x3cc0('0x2d')],_0x183a3a['query']);_0x282460['attributes']=_[_0x3cc0('0x32')](_0x183a3a[_0x3cc0('0x2d')],qs[_0x3cc0('0x34')](_0x3df79d['query'][_0x3cc0('0x34')]));_0x282460[_0x3cc0('0x33')]=_0x282460['attributes'][_0x3cc0('0x40')]?_0x282460[_0x3cc0('0x33')]:_0x183a3a[_0x3cc0('0x2d')];_0x282460['order']=qs['sort'](_0x3df79d[_0x3cc0('0x2f')][_0x3cc0('0x38')]);_0x282460['where']=qs['filters'](_['pick'](_0x3df79d[_0x3cc0('0x2f')],_0x183a3a[_0x3cc0('0x31')]));if(_0x3df79d['query'][_0x3cc0('0x3a')]){_0x282460[_0x3cc0('0x39')]=_[_0x3cc0('0x3b')](_0x282460[_0x3cc0('0x39')],{'$or':_[_0x3cc0('0x2e')](_0x282460['attributes'],function(_0x55ace0){var _0x55aec0={};_0x55aec0[_0x55ace0]={'$like':'%'+_0x3df79d[_0x3cc0('0x2f')][_0x3cc0('0x3a')]+'%'};return _0x55aec0;})});}_0x282460=_['merge']({},_0x282460,_0x3df79d[_0x3cc0('0x43')]);return _0x1f0c68[_0x3cc0('0x4b')](_0x282460);}})[_0x3cc0('0x24')](function(_0x53dc5d){if(_0x53dc5d){_0xcf3bc=_0x53dc5d[_0x3cc0('0x40')];if(!_0x3df79d[_0x3cc0('0x2f')][_0x3cc0('0x35')](_0x3cc0('0x36'))){_0x282460[_0x3cc0('0x1c')]=qs[_0x3cc0('0x1c')](_0x3df79d[_0x3cc0('0x2f')][_0x3cc0('0x1c')]);_0x282460[_0x3cc0('0x1f')]=qs[_0x3cc0('0x1f')](_0x3df79d[_0x3cc0('0x2f')][_0x3cc0('0x1f')]);}return _0x1f0c68[_0x3cc0('0x4b')](_0x282460);}})[_0x3cc0('0x24')](function(_0x1e7f36){if(_0x1e7f36){return _0x1e7f36?{'count':_0xcf3bc,'rows':_0x1e7f36}:null;}})[_0x3cc0('0x24')](respondWithResult(_0x18575b,null))[_0x3cc0('0x3e')](handleError(_0x18575b,null));}; \ No newline at end of file +var _0xf0f4=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','filters','attributes','fields','length','model','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','create','body','find','getFields','findOne','SugarcrmField','pick','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x45f0b2,_0x34da4f){var _0x2d00a7=function(_0x36252d){while(--_0x36252d){_0x45f0b2['push'](_0x45f0b2['shift']());}};_0x2d00a7(++_0x34da4f);}(_0xf0f4,0x8a));var _0x4f0f=function(_0x467dd3,_0x40d3a0){_0x467dd3=_0x467dd3-0x0;var _0x4ed502=_0xf0f4[_0x467dd3];return _0x4ed502;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f0f('0x0'));var jsonpatch=require(_0x4f0f('0x1'));var rp=require(_0x4f0f('0x2'));var moment=require(_0x4f0f('0x3'));var BPromise=require(_0x4f0f('0x4'));var Mustache=require(_0x4f0f('0x5'));var util=require(_0x4f0f('0x6'));var path=require('path');var sox=require(_0x4f0f('0x7'));var csv=require('to-csv');var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f0f('0x9'));var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require(_0x4f0f('0xd'));var toCsv=require(_0x4f0f('0xe'));var querystring=require(_0x4f0f('0xf'));var Papa=require(_0x4f0f('0x10'));var Redis=require(_0x4f0f('0x11'));var authService=require(_0x4f0f('0x12'));var qs=require(_0x4f0f('0x13'));var as=require(_0x4f0f('0x14'));var hardwareService=require(_0x4f0f('0x15'));var logger=require(_0x4f0f('0x16'))(_0x4f0f('0x17'));var utils=require(_0x4f0f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4f0f('0x19'));var db=require(_0x4f0f('0x1a'))['db'];function respondWithStatusCode(_0x28259c,_0x2bc2f4){_0x2bc2f4=_0x2bc2f4||0xcc;return function(_0x3f19ba){if(_0x3f19ba){return _0x28259c[_0x4f0f('0x1b')](_0x2bc2f4);}return _0x28259c[_0x4f0f('0x1c')](_0x2bc2f4)[_0x4f0f('0x1d')]();};}function respondWithResult(_0x19f53f,_0x11b704){_0x11b704=_0x11b704||0xc8;return function(_0xaf1b67){if(_0xaf1b67){return _0x19f53f[_0x4f0f('0x1c')](_0x11b704)[_0x4f0f('0x1e')](_0xaf1b67);}};}function respondWithFilteredResult(_0x3ba969,_0x4b0d7b){return function(_0x458d41){if(_0x458d41){var _0x470b7f=typeof _0x4b0d7b[_0x4f0f('0x1f')]===_0x4f0f('0x20')&&typeof _0x4b0d7b[_0x4f0f('0x21')]===_0x4f0f('0x20');var _0x1a0f91=_0x458d41[_0x4f0f('0x22')];var _0xd9cb02=_0x470b7f?0x0:_0x4b0d7b['offset'];var _0x480dea=_0x470b7f?_0x458d41[_0x4f0f('0x22')]:_0x4b0d7b[_0x4f0f('0x1f')]+_0x4b0d7b[_0x4f0f('0x21')];var _0x49fd22;if(_0x480dea>=_0x1a0f91){_0x480dea=_0x1a0f91;_0x49fd22=0xc8;}else{_0x49fd22=0xce;}_0x3ba969[_0x4f0f('0x1c')](_0x49fd22);return _0x3ba969[_0x4f0f('0x23')](_0x4f0f('0x24'),_0xd9cb02+'-'+_0x480dea+'/'+_0x1a0f91)[_0x4f0f('0x1e')](_0x458d41);}return null;};}function patchUpdates(_0x132a60){return function(_0x3b68b7){try{jsonpatch[_0x4f0f('0x25')](_0x3b68b7,_0x132a60,!![]);}catch(_0x44b3b3){return BPromise[_0x4f0f('0x26')](_0x44b3b3);}return _0x3b68b7[_0x4f0f('0x27')]();};}function saveUpdates(_0x329c88,_0x57d9b0){return function(_0x17cff2){if(_0x17cff2){return _0x17cff2['update'](_0x329c88)[_0x4f0f('0x28')](function(_0x13692b){return _0x13692b;});}return null;};}function removeEntity(_0x55383a,_0x35573b){return function(_0x1c3989){if(_0x1c3989){return _0x1c3989[_0x4f0f('0x29')]()[_0x4f0f('0x28')](function(){_0x55383a['status'](0xcc)[_0x4f0f('0x1d')]();});}};}function handleEntityNotFound(_0x125e1a,_0x211cdb){return function(_0x1ec6ed){if(!_0x1ec6ed){_0x125e1a[_0x4f0f('0x1b')](0x194);}return _0x1ec6ed;};}function handleError(_0x448611,_0x9a16a9){_0x9a16a9=_0x9a16a9||0x1f4;return function(_0x1257c6){logger[_0x4f0f('0x2a')](_0x1257c6[_0x4f0f('0x2b')]);if(_0x1257c6[_0x4f0f('0x2c')]){delete _0x1257c6[_0x4f0f('0x2c')];}_0x448611[_0x4f0f('0x1c')](_0x9a16a9)['send'](_0x1257c6);};}exports[_0x4f0f('0x2d')]=function(_0x5f5c0a,_0x2424e3){var _0x59e2ac={},_0x39a46a={},_0x217b2a={'count':0x0,'rows':[]};var _0x5200b7=_[_0x4f0f('0x2e')](db[_0x4f0f('0x2f')][_0x4f0f('0x30')],function(_0x460395){return{'name':_0x460395[_0x4f0f('0x31')],'type':_0x460395[_0x4f0f('0x32')][_0x4f0f('0x33')]};});_0x39a46a['model']=_[_0x4f0f('0x2e')](_0x5200b7,_0x4f0f('0x2c'));_0x39a46a[_0x4f0f('0x34')]=_['keys'](_0x5f5c0a[_0x4f0f('0x34')]);_0x39a46a[_0x4f0f('0x35')]=_['intersection'](_0x39a46a['model'],_0x39a46a['query']);_0x59e2ac[_0x4f0f('0x36')]=_['intersection'](_0x39a46a['model'],qs[_0x4f0f('0x37')](_0x5f5c0a[_0x4f0f('0x34')]['fields']));_0x59e2ac['attributes']=_0x59e2ac['attributes'][_0x4f0f('0x38')]?_0x59e2ac[_0x4f0f('0x36')]:_0x39a46a[_0x4f0f('0x39')];if(!_0x5f5c0a[_0x4f0f('0x34')]['hasOwnProperty'](_0x4f0f('0x3a'))){_0x59e2ac['limit']=qs['limit'](_0x5f5c0a['query'][_0x4f0f('0x21')]);_0x59e2ac[_0x4f0f('0x1f')]=qs[_0x4f0f('0x1f')](_0x5f5c0a['query']['offset']);}_0x59e2ac[_0x4f0f('0x3b')]=qs[_0x4f0f('0x3c')](_0x5f5c0a[_0x4f0f('0x34')][_0x4f0f('0x3c')]);_0x59e2ac[_0x4f0f('0x3d')]=qs[_0x4f0f('0x35')](_['pick'](_0x5f5c0a[_0x4f0f('0x34')],_0x39a46a['filters']),_0x5200b7);if(_0x5f5c0a[_0x4f0f('0x34')]['filter']){_0x59e2ac[_0x4f0f('0x3d')]=_[_0x4f0f('0x3e')](_0x59e2ac[_0x4f0f('0x3d')],{'$or':_['map'](_0x5200b7,function(_0x235278){if(_0x235278['type']!==_0x4f0f('0x3f')){var _0x457c43={};_0x457c43[_0x235278[_0x4f0f('0x2c')]]={'$like':'%'+_0x5f5c0a[_0x4f0f('0x34')][_0x4f0f('0x40')]+'%'};return _0x457c43;}})});}_0x59e2ac=_['merge']({},_0x59e2ac,_0x5f5c0a[_0x4f0f('0x41')]);var _0x4d5a02={'where':_0x59e2ac[_0x4f0f('0x3d')]};return db[_0x4f0f('0x2f')][_0x4f0f('0x22')](_0x4d5a02)[_0x4f0f('0x28')](function(_0x52068b){_0x217b2a[_0x4f0f('0x22')]=_0x52068b;if(_0x5f5c0a['query'][_0x4f0f('0x42')]){_0x59e2ac[_0x4f0f('0x43')]=[{'all':!![]}];}return db[_0x4f0f('0x2f')][_0x4f0f('0x44')](_0x59e2ac);})[_0x4f0f('0x28')](function(_0x2d89d7){_0x217b2a[_0x4f0f('0x45')]=_0x2d89d7;return _0x217b2a;})[_0x4f0f('0x28')](respondWithFilteredResult(_0x2424e3,_0x59e2ac))[_0x4f0f('0x46')](handleError(_0x2424e3,null));};exports[_0x4f0f('0x47')]=function(_0x37a6f3,_0x3fab05){var _0x110b85={'raw':![],'where':{'id':_0x37a6f3[_0x4f0f('0x48')]['id']}},_0xa328ab={};_0xa328ab[_0x4f0f('0x39')]=_[_0x4f0f('0x49')](db[_0x4f0f('0x2f')][_0x4f0f('0x30')]);_0xa328ab['query']=_[_0x4f0f('0x49')](_0x37a6f3[_0x4f0f('0x34')]);_0xa328ab['filters']=_[_0x4f0f('0x4a')](_0xa328ab['model'],_0xa328ab[_0x4f0f('0x34')]);_0x110b85[_0x4f0f('0x36')]=_[_0x4f0f('0x4a')](_0xa328ab[_0x4f0f('0x39')],qs[_0x4f0f('0x37')](_0x37a6f3['query'][_0x4f0f('0x37')]));_0x110b85[_0x4f0f('0x36')]=_0x110b85[_0x4f0f('0x36')]['length']?_0x110b85[_0x4f0f('0x36')]:_0xa328ab['model'];if(_0x37a6f3[_0x4f0f('0x34')][_0x4f0f('0x42')]){_0x110b85[_0x4f0f('0x43')]=[{'all':!![]}];}_0x110b85=_[_0x4f0f('0x3e')]({},_0x110b85,_0x37a6f3['options']);return db['SugarcrmConfiguration']['find'](_0x110b85)[_0x4f0f('0x28')](handleEntityNotFound(_0x3fab05,null))[_0x4f0f('0x28')](respondWithResult(_0x3fab05,null))[_0x4f0f('0x46')](handleError(_0x3fab05,null));};exports['create']=function(_0x49b161,_0x2e999f){return db['SugarcrmConfiguration'][_0x4f0f('0x4b')](_0x49b161[_0x4f0f('0x4c')],{})[_0x4f0f('0x28')](respondWithResult(_0x2e999f,0xc9))[_0x4f0f('0x46')](handleError(_0x2e999f,null));};exports['update']=function(_0x4081e9,_0x483e8c){if(_0x4081e9[_0x4f0f('0x4c')]['id']){delete _0x4081e9['body']['id'];}return db[_0x4f0f('0x2f')][_0x4f0f('0x4d')]({'where':{'id':_0x4081e9[_0x4f0f('0x48')]['id']}})[_0x4f0f('0x28')](handleEntityNotFound(_0x483e8c,null))[_0x4f0f('0x28')](saveUpdates(_0x4081e9[_0x4f0f('0x4c')],null))[_0x4f0f('0x28')](respondWithResult(_0x483e8c,null))['catch'](handleError(_0x483e8c,null));};exports[_0x4f0f('0x29')]=function(_0x665300,_0x4b5a99){return db[_0x4f0f('0x2f')][_0x4f0f('0x4d')]({'where':{'id':_0x665300[_0x4f0f('0x48')]['id']}})[_0x4f0f('0x28')](handleEntityNotFound(_0x4b5a99,null))[_0x4f0f('0x28')](removeEntity(_0x4b5a99,null))[_0x4f0f('0x46')](handleError(_0x4b5a99,null));};exports[_0x4f0f('0x4e')]=function(_0x354dd4,_0x1dfd08,_0x3528a2){var _0x57b285={};var _0xbbf8a0={};var _0x194da0;var _0x5b9ac2;return db[_0x4f0f('0x2f')][_0x4f0f('0x4f')]({'where':{'id':_0x354dd4['params']['id']}})[_0x4f0f('0x28')](handleEntityNotFound(_0x1dfd08,null))[_0x4f0f('0x28')](function(_0x140c3e){if(_0x140c3e){_0x194da0=_0x140c3e;_0xbbf8a0[_0x4f0f('0x39')]=_['keys'](db[_0x4f0f('0x50')][_0x4f0f('0x30')]);_0xbbf8a0[_0x4f0f('0x34')]=_['keys'](_0x354dd4[_0x4f0f('0x34')]);_0xbbf8a0[_0x4f0f('0x35')]=_[_0x4f0f('0x4a')](_0xbbf8a0['model'],_0xbbf8a0[_0x4f0f('0x34')]);_0x57b285[_0x4f0f('0x36')]=_[_0x4f0f('0x4a')](_0xbbf8a0[_0x4f0f('0x39')],qs[_0x4f0f('0x37')](_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x37')]));_0x57b285[_0x4f0f('0x36')]=_0x57b285[_0x4f0f('0x36')][_0x4f0f('0x38')]?_0x57b285[_0x4f0f('0x36')]:_0xbbf8a0[_0x4f0f('0x39')];_0x57b285[_0x4f0f('0x3b')]=qs[_0x4f0f('0x3c')](_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x3c')]);_0x57b285[_0x4f0f('0x3d')]=qs[_0x4f0f('0x35')](_[_0x4f0f('0x51')](_0x354dd4[_0x4f0f('0x34')],_0xbbf8a0[_0x4f0f('0x35')]));if(_0x354dd4[_0x4f0f('0x34')]['filter']){_0x57b285[_0x4f0f('0x3d')]=_[_0x4f0f('0x3e')](_0x57b285[_0x4f0f('0x3d')],{'$or':_[_0x4f0f('0x2e')](_0x57b285[_0x4f0f('0x36')],function(_0x4b53d4){var _0x1c2347={};_0x1c2347[_0x4b53d4]={'$like':'%'+_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x40')]+'%'};return _0x1c2347;})});}_0x57b285=_['merge']({},_0x57b285,_0x354dd4[_0x4f0f('0x41')]);return _0x194da0['getFields'](_0x57b285);}})[_0x4f0f('0x28')](function(_0x40a6cc){if(_0x40a6cc){_0x5b9ac2=_0x40a6cc[_0x4f0f('0x38')];if(!_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x52')]('nolimit')){_0x57b285[_0x4f0f('0x21')]=qs[_0x4f0f('0x21')](_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x21')]);_0x57b285['offset']=qs[_0x4f0f('0x1f')](_0x354dd4[_0x4f0f('0x34')][_0x4f0f('0x1f')]);}return _0x194da0[_0x4f0f('0x4e')](_0x57b285);}})[_0x4f0f('0x28')](function(_0x1a67cd){if(_0x1a67cd){return _0x1a67cd?{'count':_0x5b9ac2,'rows':_0x1a67cd}:null;}})[_0x4f0f('0x28')](respondWithResult(_0x1dfd08,null))['catch'](handleError(_0x1dfd08,null));};exports[_0x4f0f('0x53')]=function(_0x124a21,_0x15edee,_0x1cf6c5){var _0x32b0b7={};var _0x2e378c={};var _0x2cda5d;var _0x447417;return db[_0x4f0f('0x2f')][_0x4f0f('0x4f')]({'where':{'id':_0x124a21['params']['id']}})[_0x4f0f('0x28')](handleEntityNotFound(_0x15edee,null))[_0x4f0f('0x28')](function(_0x1a384c){if(_0x1a384c){_0x2cda5d=_0x1a384c;_0x2e378c[_0x4f0f('0x39')]=_[_0x4f0f('0x49')](db[_0x4f0f('0x50')][_0x4f0f('0x30')]);_0x2e378c[_0x4f0f('0x34')]=_['keys'](_0x124a21[_0x4f0f('0x34')]);_0x2e378c[_0x4f0f('0x35')]=_['intersection'](_0x2e378c[_0x4f0f('0x39')],_0x2e378c[_0x4f0f('0x34')]);_0x32b0b7[_0x4f0f('0x36')]=_[_0x4f0f('0x4a')](_0x2e378c['model'],qs[_0x4f0f('0x37')](_0x124a21[_0x4f0f('0x34')]['fields']));_0x32b0b7[_0x4f0f('0x36')]=_0x32b0b7[_0x4f0f('0x36')]['length']?_0x32b0b7[_0x4f0f('0x36')]:_0x2e378c['model'];_0x32b0b7[_0x4f0f('0x3b')]=qs[_0x4f0f('0x3c')](_0x124a21[_0x4f0f('0x34')][_0x4f0f('0x3c')]);_0x32b0b7[_0x4f0f('0x3d')]=qs['filters'](_['pick'](_0x124a21['query'],_0x2e378c[_0x4f0f('0x35')]));if(_0x124a21[_0x4f0f('0x34')][_0x4f0f('0x40')]){_0x32b0b7[_0x4f0f('0x3d')]=_['merge'](_0x32b0b7[_0x4f0f('0x3d')],{'$or':_['map'](_0x32b0b7['attributes'],function(_0x43ed73){var _0xb3ba2a={};_0xb3ba2a[_0x43ed73]={'$like':'%'+_0x124a21[_0x4f0f('0x34')][_0x4f0f('0x40')]+'%'};return _0xb3ba2a;})});}_0x32b0b7=_[_0x4f0f('0x3e')]({},_0x32b0b7,_0x124a21[_0x4f0f('0x41')]);return _0x2cda5d[_0x4f0f('0x53')](_0x32b0b7);}})[_0x4f0f('0x28')](function(_0x978a92){if(_0x978a92){_0x447417=_0x978a92['length'];if(!_0x124a21[_0x4f0f('0x34')][_0x4f0f('0x52')](_0x4f0f('0x3a'))){_0x32b0b7[_0x4f0f('0x21')]=qs[_0x4f0f('0x21')](_0x124a21[_0x4f0f('0x34')][_0x4f0f('0x21')]);_0x32b0b7[_0x4f0f('0x1f')]=qs['offset'](_0x124a21[_0x4f0f('0x34')]['offset']);}return _0x2cda5d['getSubjects'](_0x32b0b7);}})['then'](function(_0x3226b1){if(_0x3226b1){return _0x3226b1?{'count':_0x447417,'rows':_0x3226b1}:null;}})['then'](respondWithResult(_0x15edee,null))[_0x4f0f('0x46')](handleError(_0x15edee,null));};exports[_0x4f0f('0x54')]=function(_0x21eb1a,_0x3a2303,_0x1025e2){var _0x1c88aa={};var _0x2e4320={};var _0xbc4565;var _0x2953cc;return db[_0x4f0f('0x2f')][_0x4f0f('0x4f')]({'where':{'id':_0x21eb1a[_0x4f0f('0x48')]['id']}})[_0x4f0f('0x28')](handleEntityNotFound(_0x3a2303,null))[_0x4f0f('0x28')](function(_0x37aca4){if(_0x37aca4){_0xbc4565=_0x37aca4;_0x2e4320['model']=_[_0x4f0f('0x49')](db[_0x4f0f('0x50')]['rawAttributes']);_0x2e4320['query']=_[_0x4f0f('0x49')](_0x21eb1a[_0x4f0f('0x34')]);_0x2e4320[_0x4f0f('0x35')]=_[_0x4f0f('0x4a')](_0x2e4320['model'],_0x2e4320['query']);_0x1c88aa[_0x4f0f('0x36')]=_[_0x4f0f('0x4a')](_0x2e4320['model'],qs['fields'](_0x21eb1a[_0x4f0f('0x34')]['fields']));_0x1c88aa['attributes']=_0x1c88aa['attributes'][_0x4f0f('0x38')]?_0x1c88aa[_0x4f0f('0x36')]:_0x2e4320[_0x4f0f('0x39')];_0x1c88aa[_0x4f0f('0x3b')]=qs['sort'](_0x21eb1a[_0x4f0f('0x34')]['sort']);_0x1c88aa[_0x4f0f('0x3d')]=qs[_0x4f0f('0x35')](_[_0x4f0f('0x51')](_0x21eb1a[_0x4f0f('0x34')],_0x2e4320['filters']));if(_0x21eb1a['query']['filter']){_0x1c88aa[_0x4f0f('0x3d')]=_[_0x4f0f('0x3e')](_0x1c88aa[_0x4f0f('0x3d')],{'$or':_[_0x4f0f('0x2e')](_0x1c88aa['attributes'],function(_0x41945a){var _0x32247a={};_0x32247a[_0x41945a]={'$like':'%'+_0x21eb1a[_0x4f0f('0x34')]['filter']+'%'};return _0x32247a;})});}_0x1c88aa=_[_0x4f0f('0x3e')]({},_0x1c88aa,_0x21eb1a[_0x4f0f('0x41')]);return _0xbc4565['getDescriptions'](_0x1c88aa);}})['then'](function(_0x2de445){if(_0x2de445){_0x2953cc=_0x2de445[_0x4f0f('0x38')];if(!_0x21eb1a['query']['hasOwnProperty']('nolimit')){_0x1c88aa[_0x4f0f('0x21')]=qs[_0x4f0f('0x21')](_0x21eb1a[_0x4f0f('0x34')][_0x4f0f('0x21')]);_0x1c88aa[_0x4f0f('0x1f')]=qs[_0x4f0f('0x1f')](_0x21eb1a['query'][_0x4f0f('0x1f')]);}return _0xbc4565[_0x4f0f('0x54')](_0x1c88aa);}})[_0x4f0f('0x28')](function(_0x5d498a){if(_0x5d498a){return _0x5d498a?{'count':_0x2953cc,'rows':_0x5d498a}:null;}})[_0x4f0f('0x28')](respondWithResult(_0x3a2303,null))['catch'](handleError(_0x3a2303,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 23d7300..0a6effc 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 _0x650c=['int_sugarcrm_configurations','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SugarcrmConfiguration'];(function(_0x420a81,_0x361e48){var _0x31039b=function(_0xeaf63d){while(--_0xeaf63d){_0x420a81['push'](_0x420a81['shift']());}};_0x31039b(++_0x361e48);}(_0x650c,0xf1));var _0xc650=function(_0x570995,_0x2dffdf){_0x570995=_0x570995-0x0;var _0x3b7ee9=_0x650c[_0x570995];return _0x3b7ee9;};'use strict';var _=require(_0xc650('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc650('0x1'));var moment=require('moment');var BPromise=require(_0xc650('0x2'));var rp=require(_0xc650('0x3'));var fs=require('fs');var path=require(_0xc650('0x4'));var rimraf=require(_0xc650('0x5'));var config=require(_0xc650('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xc650('0x7')]=function(_0x4a0024,_0x1945cd){return _0x4a0024['define'](_0xc650('0x8'),attributes,{'tableName':_0xc650('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x202a=['int_sugarcrm_configurations','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x202a,0xb1));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa202('0x0'));var util=require('util');var logger=require(_0xa202('0x1'))(_0xa202('0x2'));var moment=require(_0xa202('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa202('0x4'));var config=require(_0xa202('0x5'));var attributes=require(_0xa202('0x6'));module[_0xa202('0x7')]=function(_0x3c58aa,_0x5d2afb){return _0x3c58aa[_0xa202('0x8')](_0xa202('0x9'),attributes,{'tableName':_0xa202('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 d4d7196..d726c86 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 _0x196e=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1f6ca9,_0x353014){var _0x3d5190=function(_0x139e1a){while(--_0x139e1a){_0x1f6ca9['push'](_0x1f6ca9['shift']());}};_0x3d5190(++_0x353014);}(_0x196e,0x7a));var _0xe196=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x196e[_0x1488cd];return _0x63fa13;};'use strict';var _=require(_0xe196('0x0'));var util=require(_0xe196('0x1'));var moment=require(_0xe196('0x2'));var BPromise=require(_0xe196('0x3'));var rs=require(_0xe196('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe196('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe196('0x6'));var config=require(_0xe196('0x7'));var jayson=require(_0xe196('0x8'));var client=jayson[_0xe196('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a31e,_0x3c661e,_0x217f9c){return new BPromise(function(_0x3d9e62,_0x4b35da){return client[_0xe196('0xa')](_0x57a31e,_0x217f9c)[_0xe196('0xb')](function(_0x2788bd){logger[_0xe196('0xc')](_0xe196('0xd'),_0x3c661e,_0xe196('0xe'));logger[_0xe196('0xf')](_0xe196('0x10'),_0x3c661e,_0xe196('0xe'),JSON['stringify'](_0x2788bd));if(_0x2788bd['error']){if(_0x2788bd[_0xe196('0x11')][_0xe196('0x12')]===0x1f4){logger['error'](_0xe196('0xd'),_0x3c661e,_0x2788bd[_0xe196('0x11')][_0xe196('0x13')]);return _0x4b35da(_0x2788bd[_0xe196('0x11')][_0xe196('0x13')]);}logger['error'](_0xe196('0xd'),_0x3c661e,_0x2788bd[_0xe196('0x11')][_0xe196('0x13')]);return _0x3d9e62(_0x2788bd['error'][_0xe196('0x13')]);}else{logger['info'](_0xe196('0xd'),_0x3c661e,_0xe196('0xe'));_0x3d9e62(_0x2788bd[_0xe196('0x14')][_0xe196('0x13')]);}})['catch'](function(_0x2c8f5e){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3c661e,_0x2c8f5e);_0x4b35da(_0x2c8f5e);});});} \ No newline at end of file +var _0x1d86=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1d86,0x110));var _0x61d8=function(_0x412492,_0x13d168){_0x412492=_0x412492-0x0;var _0x3bc51a=_0x1d86[_0x412492];return _0x3bc51a;};'use strict';var _=require(_0x61d8('0x0'));var util=require('util');var moment=require(_0x61d8('0x1'));var BPromise=require(_0x61d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61d8('0x3'));var db=require(_0x61d8('0x4'))['db'];var utils=require(_0x61d8('0x5'));var logger=require(_0x61d8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x61d8('0x7'));var client=jayson[_0x61d8('0x8')][_0x61d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f71f7,_0x778ee4,_0x18ab42){return new BPromise(function(_0x19bd41,_0x204730){return client['request'](_0x4f71f7,_0x18ab42)[_0x61d8('0xa')](function(_0x118336){logger[_0x61d8('0xb')](_0x61d8('0xc'),_0x778ee4,_0x61d8('0xd'));logger[_0x61d8('0xe')](_0x61d8('0xf'),_0x778ee4,_0x61d8('0xd'),JSON[_0x61d8('0x10')](_0x118336));if(_0x118336[_0x61d8('0x11')]){if(_0x118336[_0x61d8('0x11')][_0x61d8('0x12')]===0x1f4){logger[_0x61d8('0x11')](_0x61d8('0xc'),_0x778ee4,_0x118336[_0x61d8('0x11')]['message']);return _0x204730(_0x118336[_0x61d8('0x11')][_0x61d8('0x13')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x778ee4,_0x118336[_0x61d8('0x11')]['message']);return _0x19bd41(_0x118336[_0x61d8('0x11')][_0x61d8('0x13')]);}else{logger[_0x61d8('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x778ee4,'request\x20sent');_0x19bd41(_0x118336[_0x61d8('0x14')]['message']);}})['catch'](function(_0x2d1c1d){logger['error'](_0x61d8('0xc'),_0x778ee4,_0x2d1c1d);_0x204730(_0x2d1c1d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 30e6dd9..84c8d3c 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 _0x71d1=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','post','put','delete','/:id','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x5459c1,_0x36f6f0){var _0x3f99b5=function(_0x512bea){while(--_0x512bea){_0x5459c1['push'](_0x5459c1['shift']());}};_0x3f99b5(++_0x36f6f0);}(_0x71d1,0x109));var _0x171d=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x71d1[_0x21a2b3];return _0x4651a7;};'use strict';var multer=require(_0x171d('0x0'));var util=require('util');var path=require(_0x171d('0x1'));var timeout=require(_0x171d('0x2'));var express=require('express');var router=express[_0x171d('0x3')]();var fs_extra=require(_0x171d('0x4'));var auth=require(_0x171d('0x5'));var interaction=require(_0x171d('0x6'));var config=require(_0x171d('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x171d('0x8')](),controller[_0x171d('0x9')]);router['get']('/:id',auth[_0x171d('0x8')](),controller['show']);router[_0x171d('0xa')]('/',auth[_0x171d('0x8')](),controller['create']);router[_0x171d('0xb')]('/:id',auth[_0x171d('0x8')](),controller['update']);router[_0x171d('0xc')](_0x171d('0xd'),auth[_0x171d('0x8')](),controller['destroy']);module[_0x171d('0xe')]=router; \ No newline at end of file +var _0x4060=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x1fc18b,_0x13d27d){var _0x16a351=function(_0x54a799){while(--_0x54a799){_0x1fc18b['push'](_0x1fc18b['shift']());}};_0x16a351(++_0x13d27d);}(_0x4060,0xf7));var _0x0406=function(_0x4ffe91,_0x50d7){_0x4ffe91=_0x4ffe91-0x0;var _0xe23065=_0x4060[_0x4ffe91];return _0xe23065;};'use strict';var multer=require(_0x0406('0x0'));var util=require(_0x0406('0x1'));var path=require(_0x0406('0x2'));var timeout=require(_0x0406('0x3'));var express=require('express');var router=express[_0x0406('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0406('0x5'));var interaction=require(_0x0406('0x6'));var config=require(_0x0406('0x7'));var controller=require(_0x0406('0x8'));router['get']('/',auth[_0x0406('0x9')](),controller['index']);router['get']('/:id',auth[_0x0406('0x9')](),controller[_0x0406('0xa')]);router[_0x0406('0xb')]('/',auth[_0x0406('0x9')](),controller[_0x0406('0xc')]);router[_0x0406('0xd')](_0x0406('0xe'),auth['isAuthenticated'](),controller[_0x0406('0xf')]);router[_0x0406('0x10')]('/:id',auth[_0x0406('0x9')](),controller[_0x0406('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8bce960..2385d8c 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 _0x9742=['STRING','BOOLEAN','sequelize','ENUM','string','customVariable','keyValue','picklist'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x9742,0x1ba));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2974('0x0'));module['exports']={'type':{'type':Sequelize[_0x2974('0x1')](_0x2974('0x2'),'variable',_0x2974('0x3'),_0x2974('0x4'),_0x2974('0x5')),'defaultValue':_0x2974('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2974('0x6')]},'keyType':{'type':Sequelize[_0x2974('0x1')](_0x2974('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2974('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2974('0x6')]},'customField':{'type':Sequelize[_0x2974('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc21e=['keyValue','picklist','STRING','variable','exports','ENUM','string','customVariable'];(function(_0x43fbe4,_0x29fedc){var _0x24413f=function(_0x7e623){while(--_0x7e623){_0x43fbe4['push'](_0x43fbe4['shift']());}};_0x24413f(++_0x29fedc);}(_0xc21e,0x184));var _0xec21=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc21e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xec21('0x0')]={'type':{'type':Sequelize[_0xec21('0x1')](_0xec21('0x2'),'variable',_0xec21('0x3'),_0xec21('0x4'),_0xec21('0x5')),'defaultValue':_0xec21('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xec21('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xec21('0x2'),_0xec21('0x7'),_0xec21('0x3'))},'keyContent':{'type':Sequelize[_0xec21('0x6')]},'idField':{'type':Sequelize[_0xec21('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1dcdc81..6178d58 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 _0xe4c2=['sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','json','reject','save','update','destroy','then','stack','name','send','index','map','SugarcrmField','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','order'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xe4c2,0xd7));var _0x2e4c=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0xe4c2[_0x4d394d];return _0x4f0003;};'use strict';var emlformat=require(_0x2e4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e4c('0x1'));var jsonpatch=require(_0x2e4c('0x2'));var rp=require(_0x2e4c('0x3'));var moment=require('moment');var BPromise=require(_0x2e4c('0x4'));var Mustache=require(_0x2e4c('0x5'));var util=require(_0x2e4c('0x6'));var path=require(_0x2e4c('0x7'));var sox=require('sox');var csv=require(_0x2e4c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e4c('0x9'));var squel=require('squel');var crypto=require(_0x2e4c('0xa'));var jsforce=require(_0x2e4c('0xb'));var deskjs=require(_0x2e4c('0xc'));var toCsv=require(_0x2e4c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2e4c('0xd'));var qs=require(_0x2e4c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e4c('0xf'));var logger=require('../../config/logger')(_0x2e4c('0x10'));var utils=require(_0x2e4c('0x11'));var config=require(_0x2e4c('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f849f,_0x1cf918){_0x1cf918=_0x1cf918||0xcc;return function(_0xf2f8de){if(_0xf2f8de){return _0x2f849f[_0x2e4c('0x13')](_0x1cf918);}return _0x2f849f[_0x2e4c('0x14')](_0x1cf918)[_0x2e4c('0x15')]();};}function respondWithResult(_0x19a3c1,_0x347b2e){_0x347b2e=_0x347b2e||0xc8;return function(_0x2bba85){if(_0x2bba85){return _0x19a3c1[_0x2e4c('0x14')](_0x347b2e)['json'](_0x2bba85);}};}function respondWithFilteredResult(_0x27d957,_0x4ced95){return function(_0x4e5e97){if(_0x4e5e97){var _0x5ae995=typeof _0x4ced95['offset']===_0x2e4c('0x16')&&typeof _0x4ced95[_0x2e4c('0x17')]===_0x2e4c('0x16');var _0x7115df=_0x4e5e97['count'];var _0x1f19db=_0x5ae995?0x0:_0x4ced95['offset'];var _0x354358=_0x5ae995?_0x4e5e97[_0x2e4c('0x18')]:_0x4ced95['offset']+_0x4ced95[_0x2e4c('0x17')];var _0x28e37b;if(_0x354358>=_0x7115df){_0x354358=_0x7115df;_0x28e37b=0xc8;}else{_0x28e37b=0xce;}_0x27d957[_0x2e4c('0x14')](_0x28e37b);return _0x27d957['set']('Content-Range',_0x1f19db+'-'+_0x354358+'/'+_0x7115df)[_0x2e4c('0x19')](_0x4e5e97);}return null;};}function patchUpdates(_0x561df0){return function(_0x27d724){try{jsonpatch['apply'](_0x27d724,_0x561df0,!![]);}catch(_0x710d67){return BPromise[_0x2e4c('0x1a')](_0x710d67);}return _0x27d724[_0x2e4c('0x1b')]();};}function saveUpdates(_0xe2bba1,_0x46ce8f){return function(_0x2d0bff){if(_0x2d0bff){return _0x2d0bff[_0x2e4c('0x1c')](_0xe2bba1)['then'](function(_0x415032){return _0x415032;});}return null;};}function removeEntity(_0x5884ed,_0x40388c){return function(_0x126389){if(_0x126389){return _0x126389[_0x2e4c('0x1d')]()[_0x2e4c('0x1e')](function(){_0x5884ed[_0x2e4c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x347b51,_0x24efe3){return function(_0x438c2b){if(!_0x438c2b){_0x347b51[_0x2e4c('0x13')](0x194);}return _0x438c2b;};}function handleError(_0x2d120f,_0x3d4b71){_0x3d4b71=_0x3d4b71||0x1f4;return function(_0x447ff1){logger['error'](_0x447ff1[_0x2e4c('0x1f')]);if(_0x447ff1[_0x2e4c('0x20')]){delete _0x447ff1[_0x2e4c('0x20')];}_0x2d120f[_0x2e4c('0x14')](_0x3d4b71)[_0x2e4c('0x21')](_0x447ff1);};}exports[_0x2e4c('0x22')]=function(_0x447553,_0x410924){var _0x37d5d7={},_0x3b50f8={},_0x573d92={'count':0x0,'rows':[]};var _0x42c857=_[_0x2e4c('0x23')](db[_0x2e4c('0x24')]['rawAttributes'],function(_0x3fa472){return{'name':_0x3fa472['fieldName'],'type':_0x3fa472[_0x2e4c('0x25')]['key']};});_0x3b50f8[_0x2e4c('0x26')]=_['map'](_0x42c857,_0x2e4c('0x20'));_0x3b50f8['query']=_[_0x2e4c('0x27')](_0x447553[_0x2e4c('0x28')]);_0x3b50f8[_0x2e4c('0x29')]=_[_0x2e4c('0x2a')](_0x3b50f8[_0x2e4c('0x26')],_0x3b50f8['query']);_0x37d5d7[_0x2e4c('0x2b')]=_[_0x2e4c('0x2a')](_0x3b50f8['model'],qs[_0x2e4c('0x2c')](_0x447553['query'][_0x2e4c('0x2c')]));_0x37d5d7[_0x2e4c('0x2b')]=_0x37d5d7['attributes'][_0x2e4c('0x2d')]?_0x37d5d7[_0x2e4c('0x2b')]:_0x3b50f8[_0x2e4c('0x26')];if(!_0x447553['query']['hasOwnProperty'](_0x2e4c('0x2e'))){_0x37d5d7[_0x2e4c('0x17')]=qs[_0x2e4c('0x17')](_0x447553[_0x2e4c('0x28')][_0x2e4c('0x17')]);_0x37d5d7['offset']=qs[_0x2e4c('0x2f')](_0x447553['query']['offset']);}_0x37d5d7[_0x2e4c('0x30')]=qs['sort'](_0x447553[_0x2e4c('0x28')][_0x2e4c('0x31')]);_0x37d5d7[_0x2e4c('0x32')]=qs['filters'](_[_0x2e4c('0x33')](_0x447553[_0x2e4c('0x28')],_0x3b50f8[_0x2e4c('0x29')]),_0x42c857);if(_0x447553['query'][_0x2e4c('0x34')]){_0x37d5d7[_0x2e4c('0x32')]=_[_0x2e4c('0x35')](_0x37d5d7[_0x2e4c('0x32')],{'$or':_['map'](_0x42c857,function(_0x2ed30a){if(_0x2ed30a['type']!=='VIRTUAL'){var _0x53bf73={};_0x53bf73[_0x2ed30a[_0x2e4c('0x20')]]={'$like':'%'+_0x447553[_0x2e4c('0x28')]['filter']+'%'};return _0x53bf73;}})});}_0x37d5d7=_['merge']({},_0x37d5d7,_0x447553[_0x2e4c('0x36')]);var _0x2868e8={'where':_0x37d5d7[_0x2e4c('0x32')]};return db[_0x2e4c('0x24')]['count'](_0x2868e8)['then'](function(_0x115acc){_0x573d92[_0x2e4c('0x18')]=_0x115acc;if(_0x447553[_0x2e4c('0x28')]['includeAll']){_0x37d5d7[_0x2e4c('0x37')]=[{'all':!![]}];}return db[_0x2e4c('0x24')][_0x2e4c('0x38')](_0x37d5d7);})[_0x2e4c('0x1e')](function(_0x235ffb){_0x573d92[_0x2e4c('0x39')]=_0x235ffb;return _0x573d92;})['then'](respondWithFilteredResult(_0x410924,_0x37d5d7))[_0x2e4c('0x3a')](handleError(_0x410924,null));};exports[_0x2e4c('0x3b')]=function(_0x247f54,_0x37359a){var _0x3588f6={'raw':!![],'where':{'id':_0x247f54[_0x2e4c('0x3c')]['id']}},_0x18fb56={};_0x18fb56[_0x2e4c('0x26')]=_[_0x2e4c('0x27')](db[_0x2e4c('0x24')][_0x2e4c('0x3d')]);_0x18fb56[_0x2e4c('0x28')]=_[_0x2e4c('0x27')](_0x247f54[_0x2e4c('0x28')]);_0x18fb56[_0x2e4c('0x29')]=_[_0x2e4c('0x2a')](_0x18fb56['model'],_0x18fb56[_0x2e4c('0x28')]);_0x3588f6[_0x2e4c('0x2b')]=_[_0x2e4c('0x2a')](_0x18fb56[_0x2e4c('0x26')],qs[_0x2e4c('0x2c')](_0x247f54[_0x2e4c('0x28')][_0x2e4c('0x2c')]));_0x3588f6[_0x2e4c('0x2b')]=_0x3588f6[_0x2e4c('0x2b')][_0x2e4c('0x2d')]?_0x3588f6['attributes']:_0x18fb56[_0x2e4c('0x26')];if(_0x247f54[_0x2e4c('0x28')][_0x2e4c('0x3e')]){_0x3588f6[_0x2e4c('0x37')]=[{'all':!![]}];}_0x3588f6=_[_0x2e4c('0x35')]({},_0x3588f6,_0x247f54[_0x2e4c('0x36')]);return db[_0x2e4c('0x24')]['find'](_0x3588f6)[_0x2e4c('0x1e')](handleEntityNotFound(_0x37359a,null))[_0x2e4c('0x1e')](respondWithResult(_0x37359a,null))[_0x2e4c('0x3a')](handleError(_0x37359a,null));};exports[_0x2e4c('0x3f')]=function(_0x24a4d5,_0x26722d){return db[_0x2e4c('0x24')]['create'](_0x24a4d5[_0x2e4c('0x40')],{})[_0x2e4c('0x1e')](respondWithResult(_0x26722d,0xc9))['catch'](handleError(_0x26722d,null));};exports[_0x2e4c('0x1c')]=function(_0x455178,_0x35c4bf){if(_0x455178[_0x2e4c('0x40')]['id']){delete _0x455178[_0x2e4c('0x40')]['id'];}return db[_0x2e4c('0x24')]['find']({'where':{'id':_0x455178['params']['id']}})['then'](handleEntityNotFound(_0x35c4bf,null))[_0x2e4c('0x1e')](saveUpdates(_0x455178['body'],null))[_0x2e4c('0x1e')](respondWithResult(_0x35c4bf,null))[_0x2e4c('0x3a')](handleError(_0x35c4bf,null));};exports[_0x2e4c('0x1d')]=function(_0x299f4c,_0x336cae){return db[_0x2e4c('0x24')][_0x2e4c('0x41')]({'where':{'id':_0x299f4c[_0x2e4c('0x3c')]['id']}})[_0x2e4c('0x1e')](handleEntityNotFound(_0x336cae,null))[_0x2e4c('0x1e')](removeEntity(_0x336cae,null))[_0x2e4c('0x3a')](handleError(_0x336cae,null));}; \ No newline at end of file +var _0x1b1f=['body','update','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1b1f,0x19a));var _0xf1b1=function(_0x12baa2,_0x5ae08b){_0x12baa2=_0x12baa2-0x0;var _0x313c3d=_0x1b1f[_0x12baa2];return _0x313c3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1b1('0x0'));var zipdir=require(_0xf1b1('0x1'));var jsonpatch=require(_0xf1b1('0x2'));var rp=require('request-promise');var moment=require(_0xf1b1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf1b1('0x4'));var path=require(_0xf1b1('0x5'));var sox=require(_0xf1b1('0x6'));var csv=require(_0xf1b1('0x7'));var ejs=require(_0xf1b1('0x8'));var fs=require('fs');var fs_extra=require(_0xf1b1('0x9'));var _=require(_0xf1b1('0xa'));var squel=require(_0xf1b1('0xb'));var crypto=require(_0xf1b1('0xc'));var jsforce=require(_0xf1b1('0xd'));var deskjs=require(_0xf1b1('0xe'));var toCsv=require(_0xf1b1('0x7'));var querystring=require('querystring');var Papa=require(_0xf1b1('0xf'));var Redis=require(_0xf1b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf1b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1b1('0x12'))(_0xf1b1('0x13'));var utils=require(_0xf1b1('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf1b1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e1ec9,_0x117f0c){_0x117f0c=_0x117f0c||0xcc;return function(_0x9abfbf){if(_0x9abfbf){return _0x2e1ec9['sendStatus'](_0x117f0c);}return _0x2e1ec9[_0xf1b1('0x16')](_0x117f0c)['end']();};}function respondWithResult(_0x3aa935,_0xb3e21c){_0xb3e21c=_0xb3e21c||0xc8;return function(_0x3720a2){if(_0x3720a2){return _0x3aa935[_0xf1b1('0x16')](_0xb3e21c)[_0xf1b1('0x17')](_0x3720a2);}};}function respondWithFilteredResult(_0x2ba0ee,_0x24d887){return function(_0x4596ef){if(_0x4596ef){var _0x70396=typeof _0x24d887[_0xf1b1('0x18')]===_0xf1b1('0x19')&&typeof _0x24d887[_0xf1b1('0x1a')]===_0xf1b1('0x19');var _0x1cba30=_0x4596ef[_0xf1b1('0x1b')];var _0x4a3404=_0x70396?0x0:_0x24d887['offset'];var _0x2204c4=_0x70396?_0x4596ef[_0xf1b1('0x1b')]:_0x24d887[_0xf1b1('0x18')]+_0x24d887[_0xf1b1('0x1a')];var _0x634436;if(_0x2204c4>=_0x1cba30){_0x2204c4=_0x1cba30;_0x634436=0xc8;}else{_0x634436=0xce;}_0x2ba0ee[_0xf1b1('0x16')](_0x634436);return _0x2ba0ee[_0xf1b1('0x1c')](_0xf1b1('0x1d'),_0x4a3404+'-'+_0x2204c4+'/'+_0x1cba30)[_0xf1b1('0x17')](_0x4596ef);}return null;};}function patchUpdates(_0x10b125){return function(_0x50cccc){try{jsonpatch[_0xf1b1('0x1e')](_0x50cccc,_0x10b125,!![]);}catch(_0x7175ef){return BPromise[_0xf1b1('0x1f')](_0x7175ef);}return _0x50cccc[_0xf1b1('0x20')]();};}function saveUpdates(_0xb87f8d,_0x4f5797){return function(_0x796c91){if(_0x796c91){return _0x796c91['update'](_0xb87f8d)[_0xf1b1('0x21')](function(_0x5519ae){return _0x5519ae;});}return null;};}function removeEntity(_0x52e4b8,_0x3e94ef){return function(_0x522519){if(_0x522519){return _0x522519[_0xf1b1('0x22')]()[_0xf1b1('0x21')](function(){_0x52e4b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32f5cb,_0x5cd3c6){return function(_0x4fe43f){if(!_0x4fe43f){_0x32f5cb[_0xf1b1('0x23')](0x194);}return _0x4fe43f;};}function handleError(_0x450bc2,_0x23cd5c){_0x23cd5c=_0x23cd5c||0x1f4;return function(_0x276e50){logger['error'](_0x276e50[_0xf1b1('0x24')]);if(_0x276e50[_0xf1b1('0x25')]){delete _0x276e50['name'];}_0x450bc2['status'](_0x23cd5c)[_0xf1b1('0x26')](_0x276e50);};}exports['index']=function(_0x3198f5,_0x1bb959){var _0x359f6d={},_0xc4e9fd={},_0x2a4f4c={'count':0x0,'rows':[]};var _0xb3c78d=_['map'](db[_0xf1b1('0x27')][_0xf1b1('0x28')],function(_0x3d3c98){return{'name':_0x3d3c98[_0xf1b1('0x29')],'type':_0x3d3c98[_0xf1b1('0x2a')][_0xf1b1('0x2b')]};});_0xc4e9fd[_0xf1b1('0x2c')]=_[_0xf1b1('0x2d')](_0xb3c78d,_0xf1b1('0x25'));_0xc4e9fd[_0xf1b1('0x2e')]=_[_0xf1b1('0x2f')](_0x3198f5[_0xf1b1('0x2e')]);_0xc4e9fd[_0xf1b1('0x30')]=_['intersection'](_0xc4e9fd[_0xf1b1('0x2c')],_0xc4e9fd['query']);_0x359f6d[_0xf1b1('0x31')]=_['intersection'](_0xc4e9fd['model'],qs[_0xf1b1('0x32')](_0x3198f5[_0xf1b1('0x2e')][_0xf1b1('0x32')]));_0x359f6d['attributes']=_0x359f6d['attributes']['length']?_0x359f6d[_0xf1b1('0x31')]:_0xc4e9fd[_0xf1b1('0x2c')];if(!_0x3198f5[_0xf1b1('0x2e')]['hasOwnProperty'](_0xf1b1('0x33'))){_0x359f6d['limit']=qs[_0xf1b1('0x1a')](_0x3198f5['query'][_0xf1b1('0x1a')]);_0x359f6d[_0xf1b1('0x18')]=qs['offset'](_0x3198f5[_0xf1b1('0x2e')][_0xf1b1('0x18')]);}_0x359f6d[_0xf1b1('0x34')]=qs[_0xf1b1('0x35')](_0x3198f5[_0xf1b1('0x2e')]['sort']);_0x359f6d[_0xf1b1('0x36')]=qs[_0xf1b1('0x30')](_['pick'](_0x3198f5['query'],_0xc4e9fd[_0xf1b1('0x30')]),_0xb3c78d);if(_0x3198f5[_0xf1b1('0x2e')][_0xf1b1('0x37')]){_0x359f6d[_0xf1b1('0x36')]=_[_0xf1b1('0x38')](_0x359f6d[_0xf1b1('0x36')],{'$or':_[_0xf1b1('0x2d')](_0xb3c78d,function(_0x14ab72){if(_0x14ab72[_0xf1b1('0x2a')]!=='VIRTUAL'){var _0x325723={};_0x325723[_0x14ab72[_0xf1b1('0x25')]]={'$like':'%'+_0x3198f5[_0xf1b1('0x2e')][_0xf1b1('0x37')]+'%'};return _0x325723;}})});}_0x359f6d=_[_0xf1b1('0x38')]({},_0x359f6d,_0x3198f5[_0xf1b1('0x39')]);var _0x21f3ac={'where':_0x359f6d[_0xf1b1('0x36')]};return db['SugarcrmField'][_0xf1b1('0x1b')](_0x21f3ac)[_0xf1b1('0x21')](function(_0x11b006){_0x2a4f4c['count']=_0x11b006;if(_0x3198f5[_0xf1b1('0x2e')][_0xf1b1('0x3a')]){_0x359f6d[_0xf1b1('0x3b')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x359f6d);})[_0xf1b1('0x21')](function(_0xad7af){_0x2a4f4c[_0xf1b1('0x3c')]=_0xad7af;return _0x2a4f4c;})['then'](respondWithFilteredResult(_0x1bb959,_0x359f6d))[_0xf1b1('0x3d')](handleError(_0x1bb959,null));};exports[_0xf1b1('0x3e')]=function(_0x5b9f6b,_0x4a648d){var _0x243071={'raw':!![],'where':{'id':_0x5b9f6b[_0xf1b1('0x3f')]['id']}},_0x49db06={};_0x49db06[_0xf1b1('0x2c')]=_['keys'](db[_0xf1b1('0x27')]['rawAttributes']);_0x49db06['query']=_['keys'](_0x5b9f6b[_0xf1b1('0x2e')]);_0x49db06['filters']=_[_0xf1b1('0x40')](_0x49db06['model'],_0x49db06[_0xf1b1('0x2e')]);_0x243071[_0xf1b1('0x31')]=_[_0xf1b1('0x40')](_0x49db06[_0xf1b1('0x2c')],qs['fields'](_0x5b9f6b[_0xf1b1('0x2e')]['fields']));_0x243071[_0xf1b1('0x31')]=_0x243071[_0xf1b1('0x31')]['length']?_0x243071[_0xf1b1('0x31')]:_0x49db06['model'];if(_0x5b9f6b[_0xf1b1('0x2e')][_0xf1b1('0x3a')]){_0x243071['include']=[{'all':!![]}];}_0x243071=_['merge']({},_0x243071,_0x5b9f6b[_0xf1b1('0x39')]);return db[_0xf1b1('0x27')]['find'](_0x243071)[_0xf1b1('0x21')](handleEntityNotFound(_0x4a648d,null))[_0xf1b1('0x21')](respondWithResult(_0x4a648d,null))[_0xf1b1('0x3d')](handleError(_0x4a648d,null));};exports[_0xf1b1('0x41')]=function(_0x8a65b0,_0x481a37){return db[_0xf1b1('0x27')]['create'](_0x8a65b0[_0xf1b1('0x42')],{})[_0xf1b1('0x21')](respondWithResult(_0x481a37,0xc9))[_0xf1b1('0x3d')](handleError(_0x481a37,null));};exports[_0xf1b1('0x43')]=function(_0x4d0b11,_0x1432c8){if(_0x4d0b11[_0xf1b1('0x42')]['id']){delete _0x4d0b11[_0xf1b1('0x42')]['id'];}return db[_0xf1b1('0x27')]['find']({'where':{'id':_0x4d0b11[_0xf1b1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1432c8,null))[_0xf1b1('0x21')](saveUpdates(_0x4d0b11[_0xf1b1('0x42')],null))[_0xf1b1('0x21')](respondWithResult(_0x1432c8,null))[_0xf1b1('0x3d')](handleError(_0x1432c8,null));};exports[_0xf1b1('0x22')]=function(_0x4fa5d7,_0x64a6d3){return db['SugarcrmField']['find']({'where':{'id':_0x4fa5d7[_0xf1b1('0x3f')]['id']}})[_0xf1b1('0x21')](handleEntityNotFound(_0x64a6d3,null))['then'](removeEntity(_0x64a6d3,null))[_0xf1b1('0x3d')](handleError(_0x64a6d3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 617c2c3..364babb 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 _0x61db=['path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x98d5c5,_0x3b406b){var _0x4908a8=function(_0x3c7f94){while(--_0x3c7f94){_0x98d5c5['push'](_0x98d5c5['shift']());}};_0x4908a8(++_0x3b406b);}(_0x61db,0x181));var _0xb61d=function(_0x5d389e,_0x475262){_0x5d389e=_0x5d389e-0x0;var _0x4cde09=_0x61db[_0x5d389e];return _0x4cde09;};'use strict';var _=require(_0xb61d('0x0'));var util=require(_0xb61d('0x1'));var logger=require(_0xb61d('0x2'))('api');var moment=require(_0xb61d('0x3'));var BPromise=require(_0xb61d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb61d('0x5'));var rimraf=require('rimraf');var config=require(_0xb61d('0x6'));var attributes=require(_0xb61d('0x7'));module[_0xb61d('0x8')]=function(_0x5c9ec5,_0x14bdd0){return _0x5c9ec5[_0xb61d('0x9')](_0xb61d('0xa'),attributes,{'tableName':_0xb61d('0xb'),'paranoid':![],'indexes':[{'name':_0xb61d('0xc'),'fields':[_0xb61d('0xd'),_0xb61d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9717=['FieldId','api','moment','bluebird','path','rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x2579a0,_0x444329){var _0x2b8704=function(_0x2c3544){while(--_0x2c3544){_0x2579a0['push'](_0x2579a0['shift']());}};_0x2b8704(++_0x444329);}(_0x9717,0xfe));var _0x7971=function(_0x5119e2,_0x3db834){_0x5119e2=_0x5119e2-0x0;var _0x259e26=_0x9717[_0x5119e2];return _0x259e26;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7971('0x0'));var moment=require(_0x7971('0x1'));var BPromise=require(_0x7971('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7971('0x3'));var rimraf=require(_0x7971('0x4'));var config=require(_0x7971('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x7971('0x6')]=function(_0x2051c2,_0x3d9a0b){return _0x2051c2['define'](_0x7971('0x7'),attributes,{'tableName':_0x7971('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x7971('0x9'),_0x7971('0xa')],'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 ba0b3e7..f980149 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 _0xcead=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','code','error','message','SugarcrmField,\x20%s,\x20%s','info','result','catch'];(function(_0x6cf246,_0x2e22b3){var _0x356a43=function(_0x2e9f1b){while(--_0x2e9f1b){_0x6cf246['push'](_0x6cf246['shift']());}};_0x356a43(++_0x2e22b3);}(_0xcead,0xcf));var _0xdcea=function(_0x35ebbb,_0xe862ef){_0x35ebbb=_0x35ebbb-0x0;var _0x29d9b=_0xcead[_0x35ebbb];return _0x29d9b;};'use strict';var _=require(_0xdcea('0x0'));var util=require(_0xdcea('0x1'));var moment=require(_0xdcea('0x2'));var BPromise=require(_0xdcea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcea('0x4'));var db=require(_0xdcea('0x5'))['db'];var utils=require(_0xdcea('0x6'));var logger=require(_0xdcea('0x7'))(_0xdcea('0x8'));var config=require(_0xdcea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdcea('0xa')][_0xdcea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x353b35,_0x1ca491,_0x59ed6d){return new BPromise(function(_0x3f4ffd,_0x2ee182){return client['request'](_0x353b35,_0x59ed6d)[_0xdcea('0xc')](function(_0x555b9e){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1ca491,_0xdcea('0xd'));logger[_0xdcea('0xe')](_0xdcea('0xf'),_0x1ca491,_0xdcea('0xd'),JSON['stringify'](_0x555b9e));if(_0x555b9e['error']){if(_0x555b9e['error'][_0xdcea('0x10')]===0x1f4){logger[_0xdcea('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1ca491,_0x555b9e[_0xdcea('0x11')][_0xdcea('0x12')]);return _0x2ee182(_0x555b9e[_0xdcea('0x11')][_0xdcea('0x12')]);}logger[_0xdcea('0x11')](_0xdcea('0x13'),_0x1ca491,_0x555b9e['error'][_0xdcea('0x12')]);return _0x3f4ffd(_0x555b9e[_0xdcea('0x11')]['message']);}else{logger[_0xdcea('0x14')](_0xdcea('0x13'),_0x1ca491,_0xdcea('0xd'));_0x3f4ffd(_0x555b9e[_0xdcea('0x15')]['message']);}})[_0xdcea('0x16')](function(_0x11b3ff){logger[_0xdcea('0x11')](_0xdcea('0x13'),_0x1ca491,_0x11b3ff);_0x2ee182(_0x11b3ff);});});} \ No newline at end of file +var _0x9212=['SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0x1ca8a2,_0x36cb73){var _0x3a3b6c=function(_0x10de16){while(--_0x10de16){_0x1ca8a2['push'](_0x1ca8a2['shift']());}};_0x3a3b6c(++_0x36cb73);}(_0x9212,0x143));var _0x2921=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x9212[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0x2921('0x0'));var util=require(_0x2921('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2921('0x2'));var fs=require('fs');var Redis=require(_0x2921('0x3'));var db=require(_0x2921('0x4'))['db'];var utils=require(_0x2921('0x5'));var logger=require(_0x2921('0x6'))(_0x2921('0x7'));var config=require(_0x2921('0x8'));var jayson=require(_0x2921('0x9'));var client=jayson[_0x2921('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24c8de,_0x2fa729,_0x1a7ff6){return new BPromise(function(_0xe1bce6,_0x145c98){return client['request'](_0x24c8de,_0x1a7ff6)[_0x2921('0xb')](function(_0x6774f4){logger[_0x2921('0xc')](_0x2921('0xd'),_0x2fa729,_0x2921('0xe'));logger['debug'](_0x2921('0xf'),_0x2fa729,_0x2921('0xe'),JSON[_0x2921('0x10')](_0x6774f4));if(_0x6774f4[_0x2921('0x11')]){if(_0x6774f4[_0x2921('0x11')][_0x2921('0x12')]===0x1f4){logger[_0x2921('0x11')](_0x2921('0xd'),_0x2fa729,_0x6774f4[_0x2921('0x11')][_0x2921('0x13')]);return _0x145c98(_0x6774f4[_0x2921('0x11')]['message']);}logger[_0x2921('0x11')](_0x2921('0xd'),_0x2fa729,_0x6774f4[_0x2921('0x11')]['message']);return _0xe1bce6(_0x6774f4['error'][_0x2921('0x13')]);}else{logger[_0x2921('0xc')](_0x2921('0xd'),_0x2fa729,'request\x20sent');_0xe1bce6(_0x6774f4['result'][_0x2921('0x13')]);}})[_0x2921('0x14')](function(_0x187aed){logger[_0x2921('0x11')](_0x2921('0xd'),_0x2fa729,_0x187aed);_0x145c98(_0x187aed);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 15f19d5..665e684 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 _0x7a84=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0xb1e975,_0x16a7e2){var _0x1f9ce0=function(_0x1ede8a){while(--_0x1ede8a){_0xb1e975['push'](_0xb1e975['shift']());}};_0x1f9ce0(++_0x16a7e2);}(_0x7a84,0x182));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x47a8('0x0'));var util=require(_0x47a8('0x1'));var path=require(_0x47a8('0x2'));var timeout=require(_0x47a8('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x47a8('0x4'));var interaction=require(_0x47a8('0x5'));var config=require(_0x47a8('0x6'));var controller=require(_0x47a8('0x7'));router['get']('/',auth[_0x47a8('0x8')](),controller[_0x47a8('0x9')]);router['get']('/:id',auth[_0x47a8('0x8')](),controller[_0x47a8('0xa')]);router[_0x47a8('0xb')]('/:id/configurations',auth[_0x47a8('0x8')](),controller['getConfigurations']);router[_0x47a8('0xb')](_0x47a8('0xc'),auth['isAuthenticated'](),controller[_0x47a8('0xd')]);router[_0x47a8('0xe')]('/',auth[_0x47a8('0x8')](),controller[_0x47a8('0xf')]);router[_0x47a8('0xe')](_0x47a8('0x10'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x11')]);router['put'](_0x47a8('0x12'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x13')]);router[_0x47a8('0x14')](_0x47a8('0x12'),auth[_0x47a8('0x8')](),controller[_0x47a8('0x15')]);module[_0x47a8('0x16')]=router; \ No newline at end of file +var _0x6a17=['/:id','/:id/configurations','getConfigurations','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x4cb7ee,_0x38b624){var _0x5ae9c0=function(_0x3137eb){while(--_0x3137eb){_0x4cb7ee['push'](_0x4cb7ee['shift']());}};_0x5ae9c0(++_0x38b624);}(_0x6a17,0x1e8));var _0x76a1=function(_0x17a6c1,_0x3429ed){_0x17a6c1=_0x17a6c1-0x0;var _0x5a362e=_0x6a17[_0x17a6c1];return _0x5a362e;};'use strict';var multer=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var path=require(_0x76a1('0x2'));var timeout=require(_0x76a1('0x3'));var express=require(_0x76a1('0x4'));var router=express[_0x76a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x76a1('0x6'));var interaction=require(_0x76a1('0x7'));var config=require(_0x76a1('0x8'));var controller=require(_0x76a1('0x9'));router[_0x76a1('0xa')]('/',auth[_0x76a1('0xb')](),controller['index']);router[_0x76a1('0xa')](_0x76a1('0xc'),auth[_0x76a1('0xb')](),controller['show']);router['get'](_0x76a1('0xd'),auth[_0x76a1('0xb')](),controller[_0x76a1('0xe')]);router[_0x76a1('0xa')]('/:id/fields',auth[_0x76a1('0xb')](),controller['getFields']);router[_0x76a1('0xf')]('/',auth[_0x76a1('0xb')](),controller[_0x76a1('0x10')]);router[_0x76a1('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x76a1('0xb')](),controller[_0x76a1('0x11')]);router[_0x76a1('0x12')](_0x76a1('0xc'),auth[_0x76a1('0xb')](),controller[_0x76a1('0x13')]);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 bcb86d4..48a88d6 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 _0x79ef=['exports','STRING','HelpDesk','sequelize'];(function(_0x5b19d5,_0xeaee7d){var _0x4b85e3=function(_0x1ec03f){while(--_0x1ec03f){_0x5b19d5['push'](_0x5b19d5['shift']());}};_0x4b85e3(++_0xeaee7d);}(_0x79ef,0xb3));var _0xf79e=function(_0x5ec858,_0x5690b3){_0x5ec858=_0x5ec858-0x0;var _0x179b90=_0x79ef[_0x5ec858];return _0x179b90;};'use strict';var Sequelize=require(_0xf79e('0x0'));module[_0xf79e('0x1')]={'name':{'type':Sequelize[_0xf79e('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf79e('0x3')},'remoteUri':{'type':Sequelize[_0xf79e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf79e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf79e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7af9=['STRING','sequelize','exports'];(function(_0x3fbf03,_0x5a2ee4){var _0xbf0d3e=function(_0x10dd23){while(--_0x10dd23){_0x3fbf03['push'](_0x3fbf03['shift']());}};_0xbf0d3e(++_0x5a2ee4);}(_0x7af9,0x7c));var _0x97af=function(_0x824a35,_0x2455c2){_0x824a35=_0x824a35-0x0;var _0x5ac621=_0x7af9[_0x824a35];return _0x5ac621;};'use strict';var Sequelize=require(_0x97af('0x0'));module[_0x97af('0x1')]={'name':{'type':Sequelize[_0x97af('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x97af('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x97af('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 479a47c..042a79c 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 _0x25de=['create','body','getConfigurations','findOne','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','VtigerConfiguration','VtigerField','Subjects','md5','getFields','username','moduleName','serverUrl','accessKey','remoteUri','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','remove','editable','false','label','startsWith','picklist','log','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','VtigerAccount','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0x25de,0xa4));var _0xe25d=function(_0x58fc2f,_0x111399){_0x58fc2f=_0x58fc2f-0x0;var _0x3a1312=_0x25de[_0x58fc2f];return _0x3a1312;};'use strict';var emlformat=require(_0xe25d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe25d('0x1'));var jsonpatch=require(_0xe25d('0x2'));var rp=require(_0xe25d('0x3'));var moment=require(_0xe25d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe25d('0x5'));var util=require(_0xe25d('0x6'));var path=require(_0xe25d('0x7'));var sox=require('sox');var csv=require(_0xe25d('0x8'));var ejs=require(_0xe25d('0x9'));var fs=require('fs');var fs_extra=require(_0xe25d('0xa'));var _=require(_0xe25d('0xb'));var squel=require('squel');var crypto=require(_0xe25d('0xc'));var jsforce=require(_0xe25d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe25d('0xe'));var Papa=require(_0xe25d('0xf'));var Redis=require('ioredis');var authService=require(_0xe25d('0x10'));var qs=require(_0xe25d('0x11'));var as=require(_0xe25d('0x12'));var hardwareService=require(_0xe25d('0x13'));var logger=require(_0xe25d('0x14'))('api');var utils=require(_0xe25d('0x15'));var config=require(_0xe25d('0x16'));var licenseUtil=require(_0xe25d('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe25d('0x18'));function respondWithStatusCode(_0x539423,_0x250c4a){_0x250c4a=_0x250c4a||0xcc;return function(_0xa39dfd){if(_0xa39dfd){return _0x539423[_0xe25d('0x19')](_0x250c4a);}return _0x539423[_0xe25d('0x1a')](_0x250c4a)[_0xe25d('0x1b')]();};}function respondWithResult(_0x8c6b47,_0x24de55){_0x24de55=_0x24de55||0xc8;return function(_0x3e7680){if(_0x3e7680){return _0x8c6b47[_0xe25d('0x1a')](_0x24de55)[_0xe25d('0x1c')](_0x3e7680);}};}function respondWithFilteredResult(_0x59278c,_0x25b3c3){return function(_0x25fdf9){if(_0x25fdf9){var _0x2faebd=typeof _0x25b3c3[_0xe25d('0x1d')]===_0xe25d('0x1e')&&typeof _0x25b3c3[_0xe25d('0x1f')]===_0xe25d('0x1e');var _0x3767d6=_0x25fdf9[_0xe25d('0x20')];var _0x317374=_0x2faebd?0x0:_0x25b3c3['offset'];var _0x542944=_0x2faebd?_0x25fdf9[_0xe25d('0x20')]:_0x25b3c3[_0xe25d('0x1d')]+_0x25b3c3[_0xe25d('0x1f')];var _0x32f4d1;if(_0x542944>=_0x3767d6){_0x542944=_0x3767d6;_0x32f4d1=0xc8;}else{_0x32f4d1=0xce;}_0x59278c['status'](_0x32f4d1);return _0x59278c[_0xe25d('0x21')](_0xe25d('0x22'),_0x317374+'-'+_0x542944+'/'+_0x3767d6)['json'](_0x25fdf9);}return null;};}function patchUpdates(_0x1de15f){return function(_0x40ea50){try{jsonpatch[_0xe25d('0x23')](_0x40ea50,_0x1de15f,!![]);}catch(_0x8857b1){return BPromise[_0xe25d('0x24')](_0x8857b1);}return _0x40ea50[_0xe25d('0x25')]();};}function saveUpdates(_0xbb49e0,_0x4ab209){return function(_0x261c42){if(_0x261c42){return _0x261c42[_0xe25d('0x26')](_0xbb49e0)[_0xe25d('0x27')](function(_0x18e500){return _0x18e500;});}return null;};}function removeEntity(_0x203526,_0x5cc664){return function(_0x55215f){if(_0x55215f){return _0x55215f[_0xe25d('0x28')]()[_0xe25d('0x27')](function(){_0x203526[_0xe25d('0x1a')](0xcc)[_0xe25d('0x1b')]();});}};}function handleEntityNotFound(_0x2586d9,_0x16a0e3){return function(_0x3de026){if(!_0x3de026){_0x2586d9['sendStatus'](0x194);}return _0x3de026;};}function handleError(_0x22632b,_0x5523b2){_0x5523b2=_0x5523b2||0x1f4;return function(_0x203923){logger['error'](_0x203923['stack']);if(_0x203923['name']){delete _0x203923[_0xe25d('0x29')];}_0x22632b[_0xe25d('0x1a')](_0x5523b2)[_0xe25d('0x2a')](_0x203923);};}exports[_0xe25d('0x2b')]=function(_0x312208,_0x1b2095){var _0x3f689c={},_0x31aa86={},_0x461e45={'count':0x0,'rows':[]};var _0x2db3ad=_['map'](db[_0xe25d('0x2c')]['rawAttributes'],function(_0x58c58e){return{'name':_0x58c58e[_0xe25d('0x2d')],'type':_0x58c58e[_0xe25d('0x2e')]['key']};});_0x31aa86['model']=_['map'](_0x2db3ad,_0xe25d('0x29'));_0x31aa86[_0xe25d('0x2f')]=_[_0xe25d('0x30')](_0x312208['query']);_0x31aa86[_0xe25d('0x31')]=_[_0xe25d('0x32')](_0x31aa86['model'],_0x31aa86[_0xe25d('0x2f')]);_0x3f689c['attributes']=_[_0xe25d('0x32')](_0x31aa86[_0xe25d('0x33')],qs[_0xe25d('0x34')](_0x312208[_0xe25d('0x2f')][_0xe25d('0x34')]));_0x3f689c[_0xe25d('0x35')]=_0x3f689c[_0xe25d('0x35')][_0xe25d('0x36')]?_0x3f689c[_0xe25d('0x35')]:_0x31aa86['model'];if(!_0x312208[_0xe25d('0x2f')][_0xe25d('0x37')](_0xe25d('0x38'))){_0x3f689c['limit']=qs[_0xe25d('0x1f')](_0x312208['query']['limit']);_0x3f689c['offset']=qs[_0xe25d('0x1d')](_0x312208[_0xe25d('0x2f')][_0xe25d('0x1d')]);}_0x3f689c[_0xe25d('0x39')]=qs[_0xe25d('0x3a')](_0x312208['query'][_0xe25d('0x3a')]);_0x3f689c[_0xe25d('0x3b')]=qs[_0xe25d('0x31')](_[_0xe25d('0x3c')](_0x312208[_0xe25d('0x2f')],_0x31aa86[_0xe25d('0x31')]),_0x2db3ad);if(_0x312208[_0xe25d('0x2f')][_0xe25d('0x3d')]){_0x3f689c['where']=_[_0xe25d('0x3e')](_0x3f689c[_0xe25d('0x3b')],{'$or':_[_0xe25d('0x3f')](_0x2db3ad,function(_0x55f0a1){if(_0x55f0a1[_0xe25d('0x2e')]!==_0xe25d('0x40')){var _0x80168={};_0x80168[_0x55f0a1[_0xe25d('0x29')]]={'$like':'%'+_0x312208[_0xe25d('0x2f')][_0xe25d('0x3d')]+'%'};return _0x80168;}})});}_0x3f689c=_[_0xe25d('0x3e')]({},_0x3f689c,_0x312208[_0xe25d('0x41')]);var _0x9d94d5={'where':_0x3f689c['where']};return db[_0xe25d('0x2c')][_0xe25d('0x20')](_0x9d94d5)[_0xe25d('0x27')](function(_0x16f8bb){_0x461e45[_0xe25d('0x20')]=_0x16f8bb;if(_0x312208[_0xe25d('0x2f')][_0xe25d('0x42')]){_0x3f689c[_0xe25d('0x43')]=[{'all':!![]}];}return db[_0xe25d('0x2c')][_0xe25d('0x44')](_0x3f689c);})['then'](function(_0x1c6021){_0x461e45[_0xe25d('0x45')]=_0x1c6021;return _0x461e45;})[_0xe25d('0x27')](respondWithFilteredResult(_0x1b2095,_0x3f689c))['catch'](handleError(_0x1b2095,null));};exports[_0xe25d('0x46')]=function(_0x523bda,_0x4cca7b){var _0x5613ec={'raw':![],'where':{'id':_0x523bda[_0xe25d('0x47')]['id']}},_0x20cd35={};_0x20cd35[_0xe25d('0x33')]=_[_0xe25d('0x30')](db[_0xe25d('0x2c')]['rawAttributes']);_0x20cd35['query']=_['keys'](_0x523bda['query']);_0x20cd35['filters']=_[_0xe25d('0x32')](_0x20cd35[_0xe25d('0x33')],_0x20cd35[_0xe25d('0x2f')]);_0x5613ec[_0xe25d('0x35')]=_[_0xe25d('0x32')](_0x20cd35[_0xe25d('0x33')],qs[_0xe25d('0x34')](_0x523bda[_0xe25d('0x2f')][_0xe25d('0x34')]));_0x5613ec[_0xe25d('0x35')]=_0x5613ec['attributes'][_0xe25d('0x36')]?_0x5613ec[_0xe25d('0x35')]:_0x20cd35[_0xe25d('0x33')];if(_0x523bda[_0xe25d('0x2f')][_0xe25d('0x42')]){_0x5613ec[_0xe25d('0x43')]=[{'all':!![]}];}_0x5613ec=_[_0xe25d('0x3e')]({},_0x5613ec,_0x523bda[_0xe25d('0x41')]);return db['VtigerAccount'][_0xe25d('0x48')](_0x5613ec)['then'](handleEntityNotFound(_0x4cca7b,null))[_0xe25d('0x27')](respondWithResult(_0x4cca7b,null))[_0xe25d('0x49')](handleError(_0x4cca7b,null));};exports['create']=function(_0x17567d,_0x555408){return db[_0xe25d('0x2c')][_0xe25d('0x4a')](_0x17567d[_0xe25d('0x4b')],{})['then'](respondWithResult(_0x555408,0xc9))['catch'](handleError(_0x555408,null));};exports[_0xe25d('0x26')]=function(_0x1666ae,_0x194391){if(_0x1666ae[_0xe25d('0x4b')]['id']){delete _0x1666ae[_0xe25d('0x4b')]['id'];}return db[_0xe25d('0x2c')][_0xe25d('0x48')]({'where':{'id':_0x1666ae[_0xe25d('0x47')]['id']}})[_0xe25d('0x27')](handleEntityNotFound(_0x194391,null))[_0xe25d('0x27')](saveUpdates(_0x1666ae[_0xe25d('0x4b')],null))[_0xe25d('0x27')](respondWithResult(_0x194391,null))[_0xe25d('0x49')](handleError(_0x194391,null));};exports[_0xe25d('0x28')]=function(_0x2d6233,_0x5a94a6){return db[_0xe25d('0x2c')][_0xe25d('0x48')]({'where':{'id':_0x2d6233[_0xe25d('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a94a6,null))[_0xe25d('0x27')](removeEntity(_0x5a94a6,null))[_0xe25d('0x49')](handleError(_0x5a94a6,null));};exports[_0xe25d('0x4c')]=function(_0x1a65ac,_0x618ac6,_0x350142){var _0x31be75={};var _0x389b72={};var _0x2315d5;var _0x465968;return db[_0xe25d('0x2c')][_0xe25d('0x4d')]({'where':{'id':_0x1a65ac['params']['id']}})['then'](handleEntityNotFound(_0x618ac6,null))['then'](function(_0x5a61b6){if(_0x5a61b6){_0x2315d5=_0x5a61b6;_0x389b72[_0xe25d('0x33')]=_[_0xe25d('0x30')](db['VtigerConfiguration']['rawAttributes']);_0x389b72[_0xe25d('0x2f')]=_['keys'](_0x1a65ac['query']);_0x389b72['filters']=_['intersection'](_0x389b72[_0xe25d('0x33')],_0x389b72[_0xe25d('0x2f')]);_0x31be75[_0xe25d('0x35')]=_[_0xe25d('0x32')](_0x389b72[_0xe25d('0x33')],qs[_0xe25d('0x34')](_0x1a65ac['query']['fields']));_0x31be75[_0xe25d('0x35')]=_0x31be75[_0xe25d('0x35')]['length']?_0x31be75['attributes']:_0x389b72[_0xe25d('0x33')];_0x31be75[_0xe25d('0x39')]=qs[_0xe25d('0x3a')](_0x1a65ac[_0xe25d('0x2f')][_0xe25d('0x3a')]);_0x31be75[_0xe25d('0x3b')]=qs['filters'](_[_0xe25d('0x3c')](_0x1a65ac[_0xe25d('0x2f')],_0x389b72[_0xe25d('0x31')]));if(_0x1a65ac[_0xe25d('0x2f')][_0xe25d('0x3d')]){_0x31be75[_0xe25d('0x3b')]=_[_0xe25d('0x3e')](_0x31be75[_0xe25d('0x3b')],{'$or':_[_0xe25d('0x3f')](_0x31be75[_0xe25d('0x35')],function(_0x1c93da){var _0x3ccddc={};_0x3ccddc[_0x1c93da]={'$like':'%'+_0x1a65ac[_0xe25d('0x2f')][_0xe25d('0x3d')]+'%'};return _0x3ccddc;})});}_0x31be75=_[_0xe25d('0x3e')]({},_0x31be75,_0x1a65ac[_0xe25d('0x41')]);return _0x2315d5['getConfigurations'](_0x31be75);}})[_0xe25d('0x27')](function(_0x7a9b81){if(_0x7a9b81){_0x465968=_0x7a9b81['length'];if(!_0x1a65ac['query']['hasOwnProperty'](_0xe25d('0x38'))){_0x31be75[_0xe25d('0x1f')]=qs['limit'](_0x1a65ac[_0xe25d('0x2f')][_0xe25d('0x1f')]);_0x31be75[_0xe25d('0x1d')]=qs[_0xe25d('0x1d')](_0x1a65ac['query'][_0xe25d('0x1d')]);}return _0x2315d5['getConfigurations'](_0x31be75);}})[_0xe25d('0x27')](function(_0x3089d5){if(_0x3089d5){return _0x3089d5?{'count':_0x465968,'rows':_0x3089d5}:null;}})[_0xe25d('0x27')](respondWithResult(_0x618ac6,null))['catch'](handleError(_0x618ac6,null));};exports[_0xe25d('0x4e')]=function(_0x50de3d,_0x2d85e7,_0x4f3bbc){if(_0x50de3d[_0xe25d('0x4b')]['id']){delete _0x50de3d[_0xe25d('0x4b')]['id'];}return db[_0xe25d('0x2c')][_0xe25d('0x4d')]({'where':{'id':_0x50de3d[_0xe25d('0x47')]['id']}})[_0xe25d('0x27')](handleEntityNotFound(_0x2d85e7,null))[_0xe25d('0x27')](function(_0x468a31){if(_0x468a31){_0x50de3d[_0xe25d('0x4b')]['AccountId']=_0x468a31['id'];_0x50de3d[_0xe25d('0x4b')]['Subjects']=integrations[_0xe25d('0x4f')](_0x50de3d[_0xe25d('0x4b')]['channel'],_0x50de3d[_0xe25d('0x4b')]['type']);_0x50de3d[_0xe25d('0x4b')][_0xe25d('0x50')]=integrations[_0xe25d('0x51')](_0x50de3d[_0xe25d('0x4b')][_0xe25d('0x52')],_0x50de3d['body'][_0xe25d('0x2e')]);return db[_0xe25d('0x53')][_0xe25d('0x4a')](_0x50de3d[_0xe25d('0x4b')],{'include':[{'model':db[_0xe25d('0x54')],'as':_0xe25d('0x55')},{'model':db[_0xe25d('0x54')],'as':'Descriptions'}]});}return null;})[_0xe25d('0x27')](respondWithResult(_0x2d85e7,null))[_0xe25d('0x49')](handleError(_0x2d85e7,null));};var md5=require(_0xe25d('0x56'));exports[_0xe25d('0x57')]=function(_0x33652a,_0x35c61f,_0x3b8763){var _0x450d00=null;var _0x4c06e0=null;var _0x3d11bb=null;var _0x4cc228=null;var _0x1c69d4='';return db[_0xe25d('0x2c')][_0xe25d('0x4d')]({'where':{'id':_0x33652a[_0xe25d('0x47')]['id']},'attributes':['id',_0xe25d('0x29'),_0xe25d('0x58'),'description',_0xe25d('0x59'),'remoteUri',_0xe25d('0x5a'),_0xe25d('0x5b')]})[_0xe25d('0x27')](handleEntityNotFound(_0x35c61f,null))[_0xe25d('0x27')](function(_0x14df7b){if(_0x14df7b){_0x450d00=_0x14df7b[_0xe25d('0x58')];_0x4c06e0=_0x14df7b[_0xe25d('0x5b')];_0x3d11bb=_0x14df7b['moduleName'];_0x1c69d4=_0x14df7b[_0xe25d('0x5c')];var _0x303444=_0x1c69d4['slice'](-0x1);if(_0x303444==='/'){_0x1c69d4=_0x1c69d4[_0xe25d('0x5d')](0x0,_0x1c69d4['lastIndexOf'](_0x303444));}_0x4cc228=util[_0xe25d('0x5e')](_0xe25d('0x5f'),_0x1c69d4);var _0x44d6af={'method':_0xe25d('0x60'),'uri':_0x4cc228,'qs':{'operation':_0xe25d('0x61'),'username':_0x14df7b[_0xe25d('0x58')]},'json':!![]};return rp(_0x44d6af);}})[_0xe25d('0x27')](function(_0x302aa5){if(_0x302aa5[_0xe25d('0x62')]){var _0x188e37={'method':_0xe25d('0x63'),'uri':_0x4cc228,'form':{'operation':_0xe25d('0x64'),'username':_0x450d00,'accessKey':md5(_0x302aa5[_0xe25d('0x65')][_0xe25d('0x66')]+_0x4c06e0)},'json':!![]};return rp(_0x188e37);}})[_0xe25d('0x27')](function(_0x234d68){if(_0x234d68[_0xe25d('0x62')]){var _0x153578={'method':_0xe25d('0x60'),'uri':_0x4cc228,'qs':{'operation':_0xe25d('0x67'),'username':_0x450d00,'sessionName':_0x234d68[_0xe25d('0x65')][_0xe25d('0x68')],'elementType':_0x3d11bb},'json':!![]};return rp(_0x153578);}})['then'](function(_0x56269b){if(_0x56269b[_0xe25d('0x62')]){var _0x2bed56=[_0xe25d('0x69'),'reference',_0xe25d('0x6a')];_[_0xe25d('0x6b')](_0x56269b[_0xe25d('0x65')][_0xe25d('0x34')],function(_0x347e2b){return _0x2bed56['includes'](_0x347e2b[_0xe25d('0x2e')][_0xe25d('0x29')]);});_[_0xe25d('0x6b')](_0x56269b[_0xe25d('0x65')][_0xe25d('0x34')],function(_0x18632e){return _0x18632e[_0xe25d('0x6c')]===_0xe25d('0x6d');});return{'count':_0x56269b[_0xe25d('0x65')][_0xe25d('0x34')]['length'],'rows':_['map'](_0x56269b[_0xe25d('0x65')][_0xe25d('0x34')],function(_0x374487){return{'id':_0x374487['name'],'name':_0x374487[_0xe25d('0x6e')],'custom':_[_0xe25d('0x6f')](_0x374487['name'],'cf_')?!![]:![],'options':_0x374487['type'][_0xe25d('0x29')]===_0xe25d('0x70')&&_0x374487[_0xe25d('0x2e')]['picklistValues'][_0xe25d('0x36')]>0x0?_[_0xe25d('0x3f')](_0x374487[_0xe25d('0x2e')]['picklistValues'],function(_0x52552a){return{'name':_0x52552a['label'],'value':_0x52552a['value']};}):[]};})};}})[_0xe25d('0x27')](respondWithResult(_0x35c61f,null))[_0xe25d('0x49')](function(_0x329229){console[_0xe25d('0x71')]('vTiger\x20error:\x20'+_0x329229);var _0xda6be1=_0x33652a[_0xe25d('0x2f')][_0xe25d('0x72')]?0x1f4:_0x329229[_0xe25d('0x73')]||0x1f4;logger[_0xe25d('0x74')](_0xe25d('0x75'),_0xe25d('0x57'),_0xda6be1,JSON[_0xe25d('0x76')](_0x329229));delete _0x329229[_0xe25d('0x29')];if(_0xda6be1===0x191){_0xda6be1=0x190;}_0x35c61f['status'](_0xda6be1)[_0xe25d('0x2a')](_0x33652a[_0xe25d('0x2f')][_0xe25d('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x329229[_0xe25d('0x73')]}:_0x329229);});}; \ No newline at end of file +var _0x1101=['success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','false','startsWith','cf_','picklist','picklistValues','label','value','log','test','statusCode','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','show','params','fields','include','find','catch','create','body','VtigerConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','VtigerField','Descriptions','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','getchallenge'];(function(_0x52ebea,_0x5b42b8){var _0x50f06c=function(_0x180c24){while(--_0x180c24){_0x52ebea['push'](_0x52ebea['shift']());}};_0x50f06c(++_0x5b42b8);}(_0x1101,0xff));var _0x1110=function(_0x2fd33e,_0xad41d){_0x2fd33e=_0x2fd33e-0x0;var _0x301440=_0x1101[_0x2fd33e];return _0x301440;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1110('0x0'));var zipdir=require(_0x1110('0x1'));var jsonpatch=require(_0x1110('0x2'));var rp=require('request-promise');var moment=require(_0x1110('0x3'));var BPromise=require(_0x1110('0x4'));var Mustache=require(_0x1110('0x5'));var util=require(_0x1110('0x6'));var path=require('path');var sox=require(_0x1110('0x7'));var csv=require(_0x1110('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1110('0x9'));var _=require(_0x1110('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1110('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1110('0x8'));var querystring=require(_0x1110('0xc'));var Papa=require('papaparse');var Redis=require(_0x1110('0xd'));var authService=require(_0x1110('0xe'));var qs=require(_0x1110('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1110('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1110('0x11'));var config=require(_0x1110('0x12'));var licenseUtil=require(_0x1110('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x208495,_0x289b74){_0x289b74=_0x289b74||0xcc;return function(_0x1d33f6){if(_0x1d33f6){return _0x208495[_0x1110('0x14')](_0x289b74);}return _0x208495[_0x1110('0x15')](_0x289b74)[_0x1110('0x16')]();};}function respondWithResult(_0x122b14,_0x2a039f){_0x2a039f=_0x2a039f||0xc8;return function(_0xfbca48){if(_0xfbca48){return _0x122b14['status'](_0x2a039f)[_0x1110('0x17')](_0xfbca48);}};}function respondWithFilteredResult(_0x1bbdfe,_0x4412bc){return function(_0x165be3){if(_0x165be3){var _0x5460fc=typeof _0x4412bc[_0x1110('0x18')]===_0x1110('0x19')&&typeof _0x4412bc['limit']===_0x1110('0x19');var _0x463411=_0x165be3[_0x1110('0x1a')];var _0x5df72a=_0x5460fc?0x0:_0x4412bc[_0x1110('0x18')];var _0xeb9081=_0x5460fc?_0x165be3['count']:_0x4412bc['offset']+_0x4412bc[_0x1110('0x1b')];var _0x42079e;if(_0xeb9081>=_0x463411){_0xeb9081=_0x463411;_0x42079e=0xc8;}else{_0x42079e=0xce;}_0x1bbdfe[_0x1110('0x15')](_0x42079e);return _0x1bbdfe[_0x1110('0x1c')](_0x1110('0x1d'),_0x5df72a+'-'+_0xeb9081+'/'+_0x463411)['json'](_0x165be3);}return null;};}function patchUpdates(_0x47d810){return function(_0x271c59){try{jsonpatch[_0x1110('0x1e')](_0x271c59,_0x47d810,!![]);}catch(_0x50344c){return BPromise['reject'](_0x50344c);}return _0x271c59['save']();};}function saveUpdates(_0x558d12,_0x3d2691){return function(_0x340c68){if(_0x340c68){return _0x340c68[_0x1110('0x1f')](_0x558d12)[_0x1110('0x20')](function(_0x314e3d){return _0x314e3d;});}return null;};}function removeEntity(_0x208f24,_0x5baa1e){return function(_0x481b26){if(_0x481b26){return _0x481b26[_0x1110('0x21')]()[_0x1110('0x20')](function(){_0x208f24[_0x1110('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4bc7,_0x2bde88){return function(_0x595699){if(!_0x595699){_0x4e4bc7[_0x1110('0x14')](0x194);}return _0x595699;};}function handleError(_0x4a41dd,_0x2a50f5){_0x2a50f5=_0x2a50f5||0x1f4;return function(_0x4dc24){logger[_0x1110('0x22')](_0x4dc24['stack']);if(_0x4dc24['name']){delete _0x4dc24[_0x1110('0x23')];}_0x4a41dd['status'](_0x2a50f5)[_0x1110('0x24')](_0x4dc24);};}exports[_0x1110('0x25')]=function(_0xb423a2,_0x570bc0){var _0xca16f={},_0x15a81d={},_0x1def63={'count':0x0,'rows':[]};var _0x3aa8ce=_[_0x1110('0x26')](db[_0x1110('0x27')][_0x1110('0x28')],function(_0x59a853){return{'name':_0x59a853[_0x1110('0x29')],'type':_0x59a853['type'][_0x1110('0x2a')]};});_0x15a81d[_0x1110('0x2b')]=_[_0x1110('0x26')](_0x3aa8ce,_0x1110('0x23'));_0x15a81d[_0x1110('0x2c')]=_[_0x1110('0x2d')](_0xb423a2[_0x1110('0x2c')]);_0x15a81d[_0x1110('0x2e')]=_[_0x1110('0x2f')](_0x15a81d[_0x1110('0x2b')],_0x15a81d['query']);_0xca16f[_0x1110('0x30')]=_[_0x1110('0x2f')](_0x15a81d['model'],qs['fields'](_0xb423a2[_0x1110('0x2c')]['fields']));_0xca16f[_0x1110('0x30')]=_0xca16f[_0x1110('0x30')][_0x1110('0x31')]?_0xca16f[_0x1110('0x30')]:_0x15a81d[_0x1110('0x2b')];if(!_0xb423a2[_0x1110('0x2c')]['hasOwnProperty'](_0x1110('0x32'))){_0xca16f[_0x1110('0x1b')]=qs[_0x1110('0x1b')](_0xb423a2[_0x1110('0x2c')][_0x1110('0x1b')]);_0xca16f['offset']=qs[_0x1110('0x18')](_0xb423a2[_0x1110('0x2c')][_0x1110('0x18')]);}_0xca16f[_0x1110('0x33')]=qs[_0x1110('0x34')](_0xb423a2[_0x1110('0x2c')][_0x1110('0x34')]);_0xca16f['where']=qs[_0x1110('0x2e')](_[_0x1110('0x35')](_0xb423a2[_0x1110('0x2c')],_0x15a81d[_0x1110('0x2e')]),_0x3aa8ce);if(_0xb423a2[_0x1110('0x2c')][_0x1110('0x36')]){_0xca16f['where']=_[_0x1110('0x37')](_0xca16f[_0x1110('0x38')],{'$or':_['map'](_0x3aa8ce,function(_0x5c41f5){if(_0x5c41f5[_0x1110('0x39')]!==_0x1110('0x3a')){var _0x4f7a65={};_0x4f7a65[_0x5c41f5[_0x1110('0x23')]]={'$like':'%'+_0xb423a2[_0x1110('0x2c')]['filter']+'%'};return _0x4f7a65;}})});}_0xca16f=_['merge']({},_0xca16f,_0xb423a2[_0x1110('0x3b')]);var _0x335aa5={'where':_0xca16f[_0x1110('0x38')]};return db[_0x1110('0x27')][_0x1110('0x1a')](_0x335aa5)[_0x1110('0x20')](function(_0x4060b4){_0x1def63[_0x1110('0x1a')]=_0x4060b4;if(_0xb423a2[_0x1110('0x2c')][_0x1110('0x3c')]){_0xca16f['include']=[{'all':!![]}];}return db[_0x1110('0x27')]['findAll'](_0xca16f);})[_0x1110('0x20')](function(_0x1ac49c){_0x1def63['rows']=_0x1ac49c;return _0x1def63;})['then'](respondWithFilteredResult(_0x570bc0,_0xca16f))['catch'](handleError(_0x570bc0,null));};exports[_0x1110('0x3d')]=function(_0x37ef14,_0x3ffbab){var _0x287a33={'raw':![],'where':{'id':_0x37ef14[_0x1110('0x3e')]['id']}},_0x34e768={};_0x34e768[_0x1110('0x2b')]=_[_0x1110('0x2d')](db['VtigerAccount'][_0x1110('0x28')]);_0x34e768[_0x1110('0x2c')]=_[_0x1110('0x2d')](_0x37ef14[_0x1110('0x2c')]);_0x34e768['filters']=_[_0x1110('0x2f')](_0x34e768[_0x1110('0x2b')],_0x34e768[_0x1110('0x2c')]);_0x287a33[_0x1110('0x30')]=_[_0x1110('0x2f')](_0x34e768[_0x1110('0x2b')],qs[_0x1110('0x3f')](_0x37ef14[_0x1110('0x2c')]['fields']));_0x287a33['attributes']=_0x287a33[_0x1110('0x30')][_0x1110('0x31')]?_0x287a33[_0x1110('0x30')]:_0x34e768[_0x1110('0x2b')];if(_0x37ef14['query'][_0x1110('0x3c')]){_0x287a33[_0x1110('0x40')]=[{'all':!![]}];}_0x287a33=_[_0x1110('0x37')]({},_0x287a33,_0x37ef14[_0x1110('0x3b')]);return db[_0x1110('0x27')][_0x1110('0x41')](_0x287a33)[_0x1110('0x20')](handleEntityNotFound(_0x3ffbab,null))['then'](respondWithResult(_0x3ffbab,null))[_0x1110('0x42')](handleError(_0x3ffbab,null));};exports[_0x1110('0x43')]=function(_0x5ec360,_0x1b89c6){return db[_0x1110('0x27')][_0x1110('0x43')](_0x5ec360[_0x1110('0x44')],{})[_0x1110('0x20')](respondWithResult(_0x1b89c6,0xc9))[_0x1110('0x42')](handleError(_0x1b89c6,null));};exports[_0x1110('0x1f')]=function(_0x4a1745,_0x55f30b){if(_0x4a1745[_0x1110('0x44')]['id']){delete _0x4a1745[_0x1110('0x44')]['id'];}return db[_0x1110('0x27')][_0x1110('0x41')]({'where':{'id':_0x4a1745['params']['id']}})[_0x1110('0x20')](handleEntityNotFound(_0x55f30b,null))[_0x1110('0x20')](saveUpdates(_0x4a1745['body'],null))[_0x1110('0x20')](respondWithResult(_0x55f30b,null))['catch'](handleError(_0x55f30b,null));};exports[_0x1110('0x21')]=function(_0x4caa67,_0x4fc13d){return db[_0x1110('0x27')]['find']({'where':{'id':_0x4caa67['params']['id']}})[_0x1110('0x20')](handleEntityNotFound(_0x4fc13d,null))[_0x1110('0x20')](removeEntity(_0x4fc13d,null))['catch'](handleError(_0x4fc13d,null));};exports['getConfigurations']=function(_0x16b8af,_0x3477e1,_0x849d4c){var _0x5306cc={};var _0x1c5539={};var _0x424f76;var _0x108995;return db['VtigerAccount']['findOne']({'where':{'id':_0x16b8af[_0x1110('0x3e')]['id']}})[_0x1110('0x20')](handleEntityNotFound(_0x3477e1,null))[_0x1110('0x20')](function(_0xbab8d3){if(_0xbab8d3){_0x424f76=_0xbab8d3;_0x1c5539[_0x1110('0x2b')]=_[_0x1110('0x2d')](db[_0x1110('0x45')][_0x1110('0x28')]);_0x1c5539[_0x1110('0x2c')]=_[_0x1110('0x2d')](_0x16b8af[_0x1110('0x2c')]);_0x1c5539['filters']=_[_0x1110('0x2f')](_0x1c5539[_0x1110('0x2b')],_0x1c5539['query']);_0x5306cc[_0x1110('0x30')]=_[_0x1110('0x2f')](_0x1c5539[_0x1110('0x2b')],qs['fields'](_0x16b8af[_0x1110('0x2c')][_0x1110('0x3f')]));_0x5306cc['attributes']=_0x5306cc[_0x1110('0x30')][_0x1110('0x31')]?_0x5306cc[_0x1110('0x30')]:_0x1c5539[_0x1110('0x2b')];_0x5306cc[_0x1110('0x33')]=qs[_0x1110('0x34')](_0x16b8af[_0x1110('0x2c')][_0x1110('0x34')]);_0x5306cc[_0x1110('0x38')]=qs[_0x1110('0x2e')](_[_0x1110('0x35')](_0x16b8af['query'],_0x1c5539[_0x1110('0x2e')]));if(_0x16b8af[_0x1110('0x2c')][_0x1110('0x36')]){_0x5306cc[_0x1110('0x38')]=_[_0x1110('0x37')](_0x5306cc[_0x1110('0x38')],{'$or':_['map'](_0x5306cc[_0x1110('0x30')],function(_0x37fd09){var _0x224a1f={};_0x224a1f[_0x37fd09]={'$like':'%'+_0x16b8af[_0x1110('0x2c')][_0x1110('0x36')]+'%'};return _0x224a1f;})});}_0x5306cc=_[_0x1110('0x37')]({},_0x5306cc,_0x16b8af['options']);return _0x424f76['getConfigurations'](_0x5306cc);}})[_0x1110('0x20')](function(_0x264dad){if(_0x264dad){_0x108995=_0x264dad[_0x1110('0x31')];if(!_0x16b8af[_0x1110('0x2c')][_0x1110('0x46')](_0x1110('0x32'))){_0x5306cc[_0x1110('0x1b')]=qs[_0x1110('0x1b')](_0x16b8af['query'][_0x1110('0x1b')]);_0x5306cc[_0x1110('0x18')]=qs[_0x1110('0x18')](_0x16b8af['query']['offset']);}return _0x424f76['getConfigurations'](_0x5306cc);}})[_0x1110('0x20')](function(_0x3d1d23){if(_0x3d1d23){return _0x3d1d23?{'count':_0x108995,'rows':_0x3d1d23}:null;}})[_0x1110('0x20')](respondWithResult(_0x3477e1,null))[_0x1110('0x42')](handleError(_0x3477e1,null));};exports[_0x1110('0x47')]=function(_0x25c46a,_0x14264a,_0x190f12){if(_0x25c46a['body']['id']){delete _0x25c46a[_0x1110('0x44')]['id'];}return db[_0x1110('0x27')][_0x1110('0x48')]({'where':{'id':_0x25c46a[_0x1110('0x3e')]['id']}})[_0x1110('0x20')](handleEntityNotFound(_0x14264a,null))[_0x1110('0x20')](function(_0x3edf51){if(_0x3edf51){_0x25c46a[_0x1110('0x44')][_0x1110('0x49')]=_0x3edf51['id'];_0x25c46a[_0x1110('0x44')][_0x1110('0x4a')]=integrations[_0x1110('0x4b')](_0x25c46a['body'][_0x1110('0x4c')],_0x25c46a['body'][_0x1110('0x39')]);_0x25c46a[_0x1110('0x44')]['Descriptions']=integrations['getDescriptions'](_0x25c46a[_0x1110('0x44')]['channel'],_0x25c46a[_0x1110('0x44')][_0x1110('0x39')]);return db['VtigerConfiguration'][_0x1110('0x43')](_0x25c46a[_0x1110('0x44')],{'include':[{'model':db['VtigerField'],'as':_0x1110('0x4a')},{'model':db[_0x1110('0x4d')],'as':_0x1110('0x4e')}]});}return null;})[_0x1110('0x20')](respondWithResult(_0x14264a,null))[_0x1110('0x42')](handleError(_0x14264a,null));};var md5=require('md5');exports['getFields']=function(_0x52b0e7,_0x253b60,_0x3e4f2d){var _0x324a89=null;var _0x55405f=null;var _0x61c43f=null;var _0x500b3a=null;var _0x452cc7='';return db[_0x1110('0x27')]['findOne']({'where':{'id':_0x52b0e7[_0x1110('0x3e')]['id']},'attributes':['id',_0x1110('0x23'),_0x1110('0x4f'),_0x1110('0x50'),_0x1110('0x51'),_0x1110('0x52'),_0x1110('0x53'),_0x1110('0x54')]})['then'](handleEntityNotFound(_0x253b60,null))[_0x1110('0x20')](function(_0x548905){if(_0x548905){_0x324a89=_0x548905[_0x1110('0x4f')];_0x55405f=_0x548905['accessKey'];_0x61c43f=_0x548905[_0x1110('0x51')];_0x452cc7=_0x548905[_0x1110('0x52')];var _0x1e4e45=_0x452cc7[_0x1110('0x55')](-0x1);if(_0x1e4e45==='/'){_0x452cc7=_0x452cc7['substring'](0x0,_0x452cc7[_0x1110('0x56')](_0x1e4e45));}_0x500b3a=util[_0x1110('0x57')](_0x1110('0x58'),_0x452cc7);var _0x25b9c0={'method':'GET','uri':_0x500b3a,'qs':{'operation':_0x1110('0x59'),'username':_0x548905[_0x1110('0x4f')]},'json':!![]};return rp(_0x25b9c0);}})[_0x1110('0x20')](function(_0xc439d3){if(_0xc439d3[_0x1110('0x5a')]){var _0x6dc48={'method':_0x1110('0x5b'),'uri':_0x500b3a,'form':{'operation':_0x1110('0x5c'),'username':_0x324a89,'accessKey':md5(_0xc439d3[_0x1110('0x5d')][_0x1110('0x5e')]+_0x55405f)},'json':!![]};return rp(_0x6dc48);}})[_0x1110('0x20')](function(_0xfdde7f){if(_0xfdde7f[_0x1110('0x5a')]){var _0x30e518={'method':'GET','uri':_0x500b3a,'qs':{'operation':_0x1110('0x5f'),'username':_0x324a89,'sessionName':_0xfdde7f[_0x1110('0x5d')][_0x1110('0x60')],'elementType':_0x61c43f},'json':!![]};return rp(_0x30e518);}})[_0x1110('0x20')](function(_0x304931){if(_0x304931[_0x1110('0x5a')]){var _0x51c90f=[_0x1110('0x61'),_0x1110('0x62'),_0x1110('0x63')];_[_0x1110('0x64')](_0x304931[_0x1110('0x5d')][_0x1110('0x3f')],function(_0x4be033){return _0x51c90f[_0x1110('0x65')](_0x4be033[_0x1110('0x39')]['name']);});_['remove'](_0x304931[_0x1110('0x5d')][_0x1110('0x3f')],function(_0x5eb70d){return _0x5eb70d['editable']===_0x1110('0x66');});return{'count':_0x304931[_0x1110('0x5d')]['fields'][_0x1110('0x31')],'rows':_[_0x1110('0x26')](_0x304931[_0x1110('0x5d')][_0x1110('0x3f')],function(_0x3fbc3c){return{'id':_0x3fbc3c['name'],'name':_0x3fbc3c['label'],'custom':_[_0x1110('0x67')](_0x3fbc3c['name'],_0x1110('0x68'))?!![]:![],'options':_0x3fbc3c[_0x1110('0x39')][_0x1110('0x23')]===_0x1110('0x69')&&_0x3fbc3c[_0x1110('0x39')][_0x1110('0x6a')][_0x1110('0x31')]>0x0?_[_0x1110('0x26')](_0x3fbc3c[_0x1110('0x39')][_0x1110('0x6a')],function(_0x54243d){return{'name':_0x54243d[_0x1110('0x6b')],'value':_0x54243d[_0x1110('0x6c')]};}):[]};})};}})[_0x1110('0x20')](respondWithResult(_0x253b60,null))['catch'](function(_0x16ff60){console[_0x1110('0x6d')]('vTiger\x20error:\x20'+_0x16ff60);var _0x14a47d=_0x52b0e7[_0x1110('0x2c')][_0x1110('0x6e')]?0x1f4:_0x16ff60[_0x1110('0x6f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1110('0x70'),_0x14a47d,JSON[_0x1110('0x71')](_0x16ff60));delete _0x16ff60['name'];if(_0x14a47d===0x191){_0x14a47d=0x190;}_0x253b60[_0x1110('0x15')](_0x14a47d)[_0x1110('0x24')](_0x52b0e7[_0x1110('0x2c')]['test']?{'message':_0x1110('0x72'),'statusCode':_0x16ff60[_0x1110('0x6f')]}:_0x16ff60);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index dd8bc98..4ef3df2 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 _0x3423=['request-promise','rimraf','../../config/environment','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird'];(function(_0x57e2ca,_0x405904){var _0xe9c204=function(_0x4adc2e){while(--_0x4adc2e){_0x57e2ca['push'](_0x57e2ca['shift']());}};_0xe9c204(++_0x405904);}(_0x3423,0x127));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var logger=require('../../config/logger')(_0x3342('0x2'));var moment=require(_0x3342('0x3'));var BPromise=require(_0x3342('0x4'));var rp=require(_0x3342('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3342('0x8')]=function(_0xebafc4,_0x133cd7){return _0xebafc4[_0x3342('0x9')](_0x3342('0xa'),attributes,{'tableName':_0x3342('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2c1=['util','../../config/logger','moment','bluebird','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','define','VtigerAccount','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc2c1,0x1a3));var _0x1c2c=function(_0x104579,_0x1d03f1){_0x104579=_0x104579-0x0;var _0x475c76=_0xc2c1[_0x104579];return _0x475c76;};'use strict';var _=require(_0x1c2c('0x0'));var util=require(_0x1c2c('0x1'));var logger=require(_0x1c2c('0x2'))('api');var moment=require(_0x1c2c('0x3'));var BPromise=require(_0x1c2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1c2c('0x5'));var config=require('../../config/environment');var attributes=require(_0x1c2c('0x6'));var integrations=require(_0x1c2c('0x7'));module['exports']=function(_0x5ef3ad,_0x168fbd){return _0x5ef3ad[_0x1c2c('0x8')](_0x1c2c('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 520b181..bd0e2f3 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 _0xbdb7=['model','map','ShowVtigerAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','attributes','limit','include'];(function(_0x148e27,_0x856b8){var _0x3d0f9f=function(_0x47ad2b){while(--_0x47ad2b){_0x148e27['push'](_0x148e27['shift']());}};_0x3d0f9f(++_0x856b8);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3510bf,_0x35ee2c){_0x3510bf=_0x3510bf-0x0;var _0x28994b=_0xbdb7[_0x3510bf];return _0x28994b;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}exports[_0x7bdb('0x15')]=function(_0x5723f4){var _0x2aff6a=this;return new Promise(function(_0x4ffd4b,_0x41f540){return db[_0x7bdb('0x16')]['findAll']({'raw':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')]['where']||null:null,'attributes':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x19')]||null:null,'limit':_0x5723f4['options']?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1a')]||null:null,'include':_0x5723f4[_0x7bdb('0x17')]?_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_['map'](_0x5723f4[_0x7bdb('0x17')][_0x7bdb('0x1b')],function(_0x40c447){return{'model':db[_0x40c447[_0x7bdb('0x1c')]],'as':_0x40c447['as'],'attributes':_0x40c447['attributes'],'include':_0x40c447['include']?_[_0x7bdb('0x1d')](_0x40c447['include'],function(_0x47abaf){return{'model':db[_0x47abaf['model']],'as':_0x47abaf['as'],'attributes':_0x47abaf[_0x7bdb('0x19')],'include':_0x47abaf['include']?_[_0x7bdb('0x1d')](_0x47abaf[_0x7bdb('0x1b')],function(_0x3ec129){return{'model':db[_0x3ec129[_0x7bdb('0x1c')]],'as':_0x3ec129['as'],'attributes':_0x3ec129[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10e818){logger[_0x7bdb('0xb')](_0x7bdb('0x15'),_0x5723f4);logger[_0x7bdb('0xe')](_0x7bdb('0x15'),_0x5723f4,JSON[_0x7bdb('0x10')](_0x10e818));_0x4ffd4b(_0x10e818);})[_0x7bdb('0x14')](function(_0xd2d7be){logger[_0x7bdb('0x11')](_0x7bdb('0x15'),_0xd2d7be[_0x7bdb('0x12')],_0x5723f4);_0x41f540(_0x2aff6a[_0x7bdb('0x11')](0x1f4,_0xd2d7be['message']));});});};exports[_0x7bdb('0x1e')]=function(_0x23fc3a){var _0x8f7672=this;return new Promise(function(_0x9f5c1,_0x29eac5){return db['VtigerAccount'][_0x7bdb('0x1f')]({'raw':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x18')]===undefined?!![]:![]:!![],'where':_0x23fc3a['options']?_0x23fc3a['options']['where']||null:null,'attributes':_0x23fc3a[_0x7bdb('0x17')]?_0x23fc3a['options'][_0x7bdb('0x19')]||null:null,'include':_0x23fc3a['options']?_0x23fc3a[_0x7bdb('0x17')][_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x23fc3a['options'][_0x7bdb('0x1b')],function(_0x514713){return{'model':db[_0x514713['model']],'as':_0x514713['as'],'attributes':_0x514713[_0x7bdb('0x19')],'include':_0x514713['include']?_[_0x7bdb('0x1d')](_0x514713['include'],function(_0x5ee47d){return{'model':db[_0x5ee47d[_0x7bdb('0x1c')]],'as':_0x5ee47d['as'],'attributes':_0x5ee47d[_0x7bdb('0x19')],'include':_0x5ee47d[_0x7bdb('0x1b')]?_[_0x7bdb('0x1d')](_0x5ee47d[_0x7bdb('0x1b')],function(_0x2bb28a){return{'model':db[_0x2bb28a['model']],'as':_0x2bb28a['as'],'attributes':_0x2bb28a[_0x7bdb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7bdb('0x20')](function(_0x329ecf){logger[_0x7bdb('0xb')](_0x7bdb('0x1e'),_0x23fc3a);logger[_0x7bdb('0xe')](_0x7bdb('0x1e'),_0x23fc3a,JSON[_0x7bdb('0x10')](_0x329ecf));_0x9f5c1(_0x329ecf);})[_0x7bdb('0x14')](function(_0x4e1c97){logger['error'](_0x7bdb('0x1e'),_0x4e1c97[_0x7bdb('0x12')],_0x23fc3a);_0x29eac5(_0x8f7672[_0x7bdb('0x11')](0x1f4,_0x4e1c97[_0x7bdb('0x12')]));});});}; \ No newline at end of file +var _0xd87e=['stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x46d8fe,_0x192a6a){var _0x500875=function(_0x412820){while(--_0x412820){_0x46d8fe['push'](_0x46d8fe['shift']());}};_0x500875(++_0x192a6a);}(_0xd87e,0x1bf));var _0xed87=function(_0x2d6faa,_0x442cd3){_0x2d6faa=_0x2d6faa-0x0;var _0x4f0bc0=_0xd87e[_0x2d6faa];return _0x4f0bc0;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('VtigerAccount,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')]({'raw':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')][_0xed87('0x1a')]||null:null,'attributes':_0x2c386a['options']?_0x2c386a['options']['attributes']||null:null,'limit':_0x2c386a['options']?_0x2c386a[_0xed87('0x18')]['limit']||null:null,'include':_0x2c386a[_0xed87('0x18')]?_0x2c386a[_0xed87('0x18')]['include']?_[_0xed87('0x1b')](_0x2c386a['options'][_0xed87('0x1c')],function(_0x24962e){return{'model':db[_0x24962e[_0xed87('0x1d')]],'as':_0x24962e['as'],'attributes':_0x24962e[_0xed87('0x1e')],'include':_0x24962e[_0xed87('0x1c')]?_['map'](_0x24962e[_0xed87('0x1c')],function(_0x3c22b7){return{'model':db[_0x3c22b7[_0xed87('0x1d')]],'as':_0x3c22b7['as'],'attributes':_0x3c22b7[_0xed87('0x1e')],'include':_0x3c22b7[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x3c22b7[_0xed87('0x1c')],function(_0x4735b3){return{'model':db[_0x4735b3[_0xed87('0x1d')]],'as':_0x4735b3['as'],'attributes':_0x4735b3[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xed87('0x9')](function(_0x341a35){logger[_0xed87('0xa')](_0xed87('0x15'),_0x2c386a);logger['debug'](_0xed87('0x15'),_0x2c386a,JSON[_0xed87('0xf')](_0x341a35));_0x5f4076(_0x341a35);})['catch'](function(_0x3dff74){logger[_0xed87('0x10')](_0xed87('0x15'),_0x3dff74['message'],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x3dff74[_0xed87('0x12')]));});});};exports[_0xed87('0x1f')]=function(_0x21ab8a){var _0x549a19=this;return new Promise(function(_0x37d45a,_0x3b87e3){return db[_0xed87('0x16')][_0xed87('0x20')]({'raw':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')][_0xed87('0x19')]===undefined?!![]:![]:!![],'where':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['where']||null:null,'attributes':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a[_0xed87('0x18')]['attributes']||null:null,'include':_0x21ab8a[_0xed87('0x18')]?_0x21ab8a['options'][_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x21ab8a[_0xed87('0x18')][_0xed87('0x1c')],function(_0x103b34){return{'model':db[_0x103b34[_0xed87('0x1d')]],'as':_0x103b34['as'],'attributes':_0x103b34[_0xed87('0x1e')],'include':_0x103b34[_0xed87('0x1c')]?_[_0xed87('0x1b')](_0x103b34[_0xed87('0x1c')],function(_0x35c9aa){return{'model':db[_0x35c9aa['model']],'as':_0x35c9aa['as'],'attributes':_0x35c9aa[_0xed87('0x1e')],'include':_0x35c9aa[_0xed87('0x1c')]?_['map'](_0x35c9aa[_0xed87('0x1c')],function(_0x54f6cb){return{'model':db[_0x54f6cb[_0xed87('0x1d')]],'as':_0x54f6cb['as'],'attributes':_0x54f6cb[_0xed87('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x443090){logger[_0xed87('0xa')](_0xed87('0x1f'),_0x21ab8a);logger[_0xed87('0xd')](_0xed87('0x1f'),_0x21ab8a,JSON['stringify'](_0x443090));_0x37d45a(_0x443090);})[_0xed87('0x14')](function(_0x525a11){logger[_0xed87('0x10')]('ShowVtigerAccount',_0x525a11[_0xed87('0x12')],_0x21ab8a);_0x3b87e3(_0x549a19[_0xed87('0x10')](0x1f4,_0x525a11[_0xed87('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0b1e5db..2387a5e 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 _0x9360=['put','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x2f169c,_0x130a86){var _0x39937f=function(_0x172407){while(--_0x172407){_0x2f169c['push'](_0x2f169c['shift']());}};_0x39937f(++_0x130a86);}(_0x9360,0x132));var _0x0936=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9360[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x0936('0x0'));var util=require(_0x0936('0x1'));var path=require(_0x0936('0x2'));var timeout=require('connect-timeout');var express=require(_0x0936('0x3'));var router=express[_0x0936('0x4')]();var fs_extra=require(_0x0936('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0936('0x6'));var config=require(_0x0936('0x7'));var controller=require(_0x0936('0x8'));router[_0x0936('0x9')]('/',auth[_0x0936('0xa')](),controller[_0x0936('0xb')]);router[_0x0936('0x9')]('/:id',auth[_0x0936('0xa')](),controller['show']);router[_0x0936('0x9')](_0x0936('0xc'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x0936('0xd'),auth[_0x0936('0xa')](),controller[_0x0936('0xe')]);router[_0x0936('0x9')](_0x0936('0xf'),auth[_0x0936('0xa')](),controller[_0x0936('0x10')]);router[_0x0936('0x11')]('/',auth['isAuthenticated'](),controller[_0x0936('0x12')]);router[_0x0936('0x13')]('/:id',auth[_0x0936('0xa')](),controller[_0x0936('0x14')]);router[_0x0936('0x15')](_0x0936('0x16'),auth['isAuthenticated'](),controller[_0x0936('0x17')]);module[_0x0936('0x18')]=router; \ No newline at end of file +var _0xfe52=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x1b4b3c,_0x508734){var _0x343c17=function(_0x1c3d5b){while(--_0x1c3d5b){_0x1b4b3c['push'](_0x1b4b3c['shift']());}};_0x343c17(++_0x508734);}(_0xfe52,0x1e7));var _0x2fe5=function(_0x190cac,_0x55c9fe){_0x190cac=_0x190cac-0x0;var _0x272eb7=_0xfe52[_0x190cac];return _0x272eb7;};'use strict';var multer=require(_0x2fe5('0x0'));var util=require(_0x2fe5('0x1'));var path=require(_0x2fe5('0x2'));var timeout=require(_0x2fe5('0x3'));var express=require('express');var router=express[_0x2fe5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2fe5('0x5'));var interaction=require(_0x2fe5('0x6'));var config=require(_0x2fe5('0x7'));var controller=require(_0x2fe5('0x8'));router['get']('/',auth[_0x2fe5('0x9')](),controller[_0x2fe5('0xa')]);router['get'](_0x2fe5('0xb'),auth[_0x2fe5('0x9')](),controller[_0x2fe5('0xc')]);router[_0x2fe5('0xd')](_0x2fe5('0xe'),auth['isAuthenticated'](),controller[_0x2fe5('0xf')]);router['get'](_0x2fe5('0x10'),auth[_0x2fe5('0x9')](),controller[_0x2fe5('0x11')]);router[_0x2fe5('0xd')](_0x2fe5('0x12'),auth[_0x2fe5('0x9')](),controller[_0x2fe5('0x13')]);router[_0x2fe5('0x14')]('/',auth[_0x2fe5('0x9')](),controller[_0x2fe5('0x15')]);router[_0x2fe5('0x16')](_0x2fe5('0xb'),auth[_0x2fe5('0x9')](),controller[_0x2fe5('0x17')]);router[_0x2fe5('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x2fe5('0x19')]);module[_0x2fe5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 582c9ca..1c25b7c 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 _0x9e99=['sequelize','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9e99,0x13e));var _0x99e9=function(_0xfef1da,_0x409405){_0xfef1da=_0xfef1da-0x0;var _0x44abe5=_0x9e99[_0xfef1da];return _0x44abe5;};'use strict';var Sequelize=require(_0x99e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x99e9('0x1')]}}; \ No newline at end of file +var _0x510c=['STRING','sequelize','exports'];(function(_0xbc7ec,_0x5b9b51){var _0x149054=function(_0x4054d9){while(--_0x4054d9){_0xbc7ec['push'](_0xbc7ec['shift']());}};_0x149054(++_0x5b9b51);}(_0x510c,0x1b1));var _0xc510=function(_0x3d187f,_0xea2cc2){_0x3d187f=_0x3d187f-0x0;var _0x1374fc=_0x510c[_0x3d187f];return _0x1374fc;};'use strict';var Sequelize=require(_0xc510('0x0'));module[_0xc510('0x1')]={'name':{'type':Sequelize[_0xc510('0x2')]},'description':{'type':Sequelize[_0xc510('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9186526..7956cf8 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 _0x5be0=['order','sort','pick','filter','where','VIRTUAL','merge','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','params','length','create','body','find','getFields','VtigerField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit'];(function(_0x3b5fa9,_0x26cc61){var _0x36be9b=function(_0x40e95d){while(--_0x40e95d){_0x3b5fa9['push'](_0x3b5fa9['shift']());}};_0x36be9b(++_0x26cc61);}(_0x5be0,0x154));var _0x05be=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x5be0[_0x3f94f9];return _0x46f84f;};'use strict';var emlformat=require(_0x05be('0x0'));var rimraf=require(_0x05be('0x1'));var zipdir=require(_0x05be('0x2'));var jsonpatch=require(_0x05be('0x3'));var rp=require(_0x05be('0x4'));var moment=require('moment');var BPromise=require(_0x05be('0x5'));var Mustache=require(_0x05be('0x6'));var util=require('util');var path=require('path');var sox=require(_0x05be('0x7'));var csv=require('to-csv');var ejs=require(_0x05be('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x05be('0x9'));var squel=require(_0x05be('0xa'));var crypto=require('crypto');var jsforce=require(_0x05be('0xb'));var deskjs=require(_0x05be('0xc'));var toCsv=require(_0x05be('0xd'));var querystring=require(_0x05be('0xe'));var Papa=require(_0x05be('0xf'));var Redis=require(_0x05be('0x10'));var authService=require(_0x05be('0x11'));var qs=require(_0x05be('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05be('0x13'));var logger=require(_0x05be('0x14'))(_0x05be('0x15'));var utils=require(_0x05be('0x16'));var config=require(_0x05be('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x05be('0x18'))['db'];function respondWithStatusCode(_0x59d85f,_0x5489fa){_0x5489fa=_0x5489fa||0xcc;return function(_0x350d27){if(_0x350d27){return _0x59d85f[_0x05be('0x19')](_0x5489fa);}return _0x59d85f[_0x05be('0x1a')](_0x5489fa)[_0x05be('0x1b')]();};}function respondWithResult(_0x2d57f1,_0x5d348d){_0x5d348d=_0x5d348d||0xc8;return function(_0x472ad1){if(_0x472ad1){return _0x2d57f1[_0x05be('0x1a')](_0x5d348d)[_0x05be('0x1c')](_0x472ad1);}};}function respondWithFilteredResult(_0x565991,_0xf333ae){return function(_0x191c82){if(_0x191c82){var _0x21749e=typeof _0xf333ae['offset']===_0x05be('0x1d')&&typeof _0xf333ae[_0x05be('0x1e')]==='undefined';var _0x282203=_0x191c82['count'];var _0x1fc75b=_0x21749e?0x0:_0xf333ae[_0x05be('0x1f')];var _0x4c2628=_0x21749e?_0x191c82[_0x05be('0x20')]:_0xf333ae[_0x05be('0x1f')]+_0xf333ae[_0x05be('0x1e')];var _0x56b0da;if(_0x4c2628>=_0x282203){_0x4c2628=_0x282203;_0x56b0da=0xc8;}else{_0x56b0da=0xce;}_0x565991[_0x05be('0x1a')](_0x56b0da);return _0x565991['set']('Content-Range',_0x1fc75b+'-'+_0x4c2628+'/'+_0x282203)[_0x05be('0x1c')](_0x191c82);}return null;};}function patchUpdates(_0x83765f){return function(_0x49f3a7){try{jsonpatch['apply'](_0x49f3a7,_0x83765f,!![]);}catch(_0x27da62){return BPromise['reject'](_0x27da62);}return _0x49f3a7['save']();};}function saveUpdates(_0x4e2204,_0x2a99e8){return function(_0x467866){if(_0x467866){return _0x467866[_0x05be('0x21')](_0x4e2204)[_0x05be('0x22')](function(_0x4aa04d){return _0x4aa04d;});}return null;};}function removeEntity(_0x27478c,_0x57d497){return function(_0x20193f){if(_0x20193f){return _0x20193f[_0x05be('0x23')]()['then'](function(){_0x27478c[_0x05be('0x1a')](0xcc)[_0x05be('0x1b')]();});}};}function handleEntityNotFound(_0x2e5709,_0x3195e2){return function(_0x96d8d8){if(!_0x96d8d8){_0x2e5709[_0x05be('0x19')](0x194);}return _0x96d8d8;};}function handleError(_0x31056d,_0x82223b){_0x82223b=_0x82223b||0x1f4;return function(_0x467d40){logger[_0x05be('0x24')](_0x467d40[_0x05be('0x25')]);if(_0x467d40[_0x05be('0x26')]){delete _0x467d40[_0x05be('0x26')];}_0x31056d[_0x05be('0x1a')](_0x82223b)[_0x05be('0x27')](_0x467d40);};}exports[_0x05be('0x28')]=function(_0x19ded8,_0x3853d9){var _0x4a4725={},_0x10ecbf={},_0x281c3e={'count':0x0,'rows':[]};var _0x315d51=_[_0x05be('0x29')](db['VtigerConfiguration'][_0x05be('0x2a')],function(_0x5eb9f5){return{'name':_0x5eb9f5[_0x05be('0x2b')],'type':_0x5eb9f5[_0x05be('0x2c')][_0x05be('0x2d')]};});_0x10ecbf['model']=_[_0x05be('0x29')](_0x315d51,_0x05be('0x26'));_0x10ecbf[_0x05be('0x2e')]=_[_0x05be('0x2f')](_0x19ded8[_0x05be('0x2e')]);_0x10ecbf[_0x05be('0x30')]=_[_0x05be('0x31')](_0x10ecbf['model'],_0x10ecbf['query']);_0x4a4725[_0x05be('0x32')]=_[_0x05be('0x31')](_0x10ecbf[_0x05be('0x33')],qs['fields'](_0x19ded8[_0x05be('0x2e')][_0x05be('0x34')]));_0x4a4725[_0x05be('0x32')]=_0x4a4725[_0x05be('0x32')]['length']?_0x4a4725[_0x05be('0x32')]:_0x10ecbf['model'];if(!_0x19ded8['query'][_0x05be('0x35')](_0x05be('0x36'))){_0x4a4725['limit']=qs[_0x05be('0x1e')](_0x19ded8['query'][_0x05be('0x1e')]);_0x4a4725[_0x05be('0x1f')]=qs['offset'](_0x19ded8[_0x05be('0x2e')][_0x05be('0x1f')]);}_0x4a4725[_0x05be('0x37')]=qs[_0x05be('0x38')](_0x19ded8[_0x05be('0x2e')][_0x05be('0x38')]);_0x4a4725['where']=qs[_0x05be('0x30')](_[_0x05be('0x39')](_0x19ded8[_0x05be('0x2e')],_0x10ecbf['filters']),_0x315d51);if(_0x19ded8[_0x05be('0x2e')][_0x05be('0x3a')]){_0x4a4725[_0x05be('0x3b')]=_['merge'](_0x4a4725['where'],{'$or':_[_0x05be('0x29')](_0x315d51,function(_0x50f79b){if(_0x50f79b[_0x05be('0x2c')]!==_0x05be('0x3c')){var _0x30a37a={};_0x30a37a[_0x50f79b[_0x05be('0x26')]]={'$like':'%'+_0x19ded8[_0x05be('0x2e')][_0x05be('0x3a')]+'%'};return _0x30a37a;}})});}_0x4a4725=_[_0x05be('0x3d')]({},_0x4a4725,_0x19ded8[_0x05be('0x3e')]);var _0x23c102={'where':_0x4a4725['where']};return db[_0x05be('0x3f')][_0x05be('0x20')](_0x23c102)['then'](function(_0x12ce6c){_0x281c3e[_0x05be('0x20')]=_0x12ce6c;if(_0x19ded8[_0x05be('0x2e')][_0x05be('0x40')]){_0x4a4725[_0x05be('0x41')]=[{'all':!![]}];}return db[_0x05be('0x3f')][_0x05be('0x42')](_0x4a4725);})[_0x05be('0x22')](function(_0x190c40){_0x281c3e[_0x05be('0x43')]=_0x190c40;return _0x281c3e;})[_0x05be('0x22')](respondWithFilteredResult(_0x3853d9,_0x4a4725))[_0x05be('0x44')](handleError(_0x3853d9,null));};exports['show']=function(_0x245c92,_0x4f5fa2){var _0x2db4e6={'raw':![],'where':{'id':_0x245c92[_0x05be('0x45')]['id']}},_0x4e19ca={};_0x4e19ca[_0x05be('0x33')]=_[_0x05be('0x2f')](db[_0x05be('0x3f')][_0x05be('0x2a')]);_0x4e19ca['query']=_[_0x05be('0x2f')](_0x245c92[_0x05be('0x2e')]);_0x4e19ca[_0x05be('0x30')]=_['intersection'](_0x4e19ca['model'],_0x4e19ca[_0x05be('0x2e')]);_0x2db4e6[_0x05be('0x32')]=_[_0x05be('0x31')](_0x4e19ca['model'],qs['fields'](_0x245c92['query']['fields']));_0x2db4e6['attributes']=_0x2db4e6['attributes'][_0x05be('0x46')]?_0x2db4e6[_0x05be('0x32')]:_0x4e19ca[_0x05be('0x33')];if(_0x245c92[_0x05be('0x2e')][_0x05be('0x40')]){_0x2db4e6[_0x05be('0x41')]=[{'all':!![]}];}_0x2db4e6=_[_0x05be('0x3d')]({},_0x2db4e6,_0x245c92['options']);return db['VtigerConfiguration']['find'](_0x2db4e6)[_0x05be('0x22')](handleEntityNotFound(_0x4f5fa2,null))[_0x05be('0x22')](respondWithResult(_0x4f5fa2,null))[_0x05be('0x44')](handleError(_0x4f5fa2,null));};exports['create']=function(_0x1f58ab,_0x1efec5){return db['VtigerConfiguration'][_0x05be('0x47')](_0x1f58ab[_0x05be('0x48')],{})[_0x05be('0x22')](respondWithResult(_0x1efec5,0xc9))['catch'](handleError(_0x1efec5,null));};exports[_0x05be('0x21')]=function(_0x419311,_0x22c417){if(_0x419311[_0x05be('0x48')]['id']){delete _0x419311['body']['id'];}return db[_0x05be('0x3f')][_0x05be('0x49')]({'where':{'id':_0x419311['params']['id']}})[_0x05be('0x22')](handleEntityNotFound(_0x22c417,null))[_0x05be('0x22')](saveUpdates(_0x419311[_0x05be('0x48')],null))['then'](respondWithResult(_0x22c417,null))[_0x05be('0x44')](handleError(_0x22c417,null));};exports[_0x05be('0x23')]=function(_0x12eaaf,_0x36c1c5){return db['VtigerConfiguration']['find']({'where':{'id':_0x12eaaf['params']['id']}})[_0x05be('0x22')](handleEntityNotFound(_0x36c1c5,null))['then'](removeEntity(_0x36c1c5,null))['catch'](handleError(_0x36c1c5,null));};exports[_0x05be('0x4a')]=function(_0x11ebc1,_0x15dfa9,_0x35503a){var _0x444fe2={};var _0x3a2fbb={};var _0x27be62;var _0x180ec9;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x11ebc1[_0x05be('0x45')]['id']}})['then'](handleEntityNotFound(_0x15dfa9,null))[_0x05be('0x22')](function(_0x26bb60){if(_0x26bb60){_0x27be62=_0x26bb60;_0x3a2fbb['model']=_[_0x05be('0x2f')](db[_0x05be('0x4b')]['rawAttributes']);_0x3a2fbb[_0x05be('0x2e')]=_[_0x05be('0x2f')](_0x11ebc1['query']);_0x3a2fbb['filters']=_[_0x05be('0x31')](_0x3a2fbb['model'],_0x3a2fbb[_0x05be('0x2e')]);_0x444fe2[_0x05be('0x32')]=_[_0x05be('0x31')](_0x3a2fbb['model'],qs[_0x05be('0x34')](_0x11ebc1['query'][_0x05be('0x34')]));_0x444fe2[_0x05be('0x32')]=_0x444fe2[_0x05be('0x32')][_0x05be('0x46')]?_0x444fe2[_0x05be('0x32')]:_0x3a2fbb[_0x05be('0x33')];_0x444fe2[_0x05be('0x37')]=qs['sort'](_0x11ebc1[_0x05be('0x2e')][_0x05be('0x38')]);_0x444fe2[_0x05be('0x3b')]=qs['filters'](_['pick'](_0x11ebc1['query'],_0x3a2fbb['filters']));if(_0x11ebc1['query'][_0x05be('0x3a')]){_0x444fe2[_0x05be('0x3b')]=_[_0x05be('0x3d')](_0x444fe2[_0x05be('0x3b')],{'$or':_['map'](_0x444fe2['attributes'],function(_0x57c681){var _0x270a7b={};_0x270a7b[_0x57c681]={'$like':'%'+_0x11ebc1[_0x05be('0x2e')][_0x05be('0x3a')]+'%'};return _0x270a7b;})});}_0x444fe2=_[_0x05be('0x3d')]({},_0x444fe2,_0x11ebc1[_0x05be('0x3e')]);return _0x27be62[_0x05be('0x4a')](_0x444fe2);}})[_0x05be('0x22')](function(_0x861472){if(_0x861472){_0x180ec9=_0x861472[_0x05be('0x46')];if(!_0x11ebc1[_0x05be('0x2e')][_0x05be('0x35')](_0x05be('0x36'))){_0x444fe2[_0x05be('0x1e')]=qs[_0x05be('0x1e')](_0x11ebc1['query'][_0x05be('0x1e')]);_0x444fe2[_0x05be('0x1f')]=qs[_0x05be('0x1f')](_0x11ebc1[_0x05be('0x2e')]['offset']);}return _0x27be62[_0x05be('0x4a')](_0x444fe2);}})[_0x05be('0x22')](function(_0x13f60f){if(_0x13f60f){return _0x13f60f?{'count':_0x180ec9,'rows':_0x13f60f}:null;}})[_0x05be('0x22')](respondWithResult(_0x15dfa9,null))[_0x05be('0x44')](handleError(_0x15dfa9,null));};exports[_0x05be('0x4c')]=function(_0x49b16e,_0xe5bc8,_0x951479){var _0x373bae={};var _0x18037d={};var _0xf5ae75;var _0x19ef18;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x49b16e[_0x05be('0x45')]['id']}})[_0x05be('0x22')](handleEntityNotFound(_0xe5bc8,null))['then'](function(_0x373123){if(_0x373123){_0xf5ae75=_0x373123;_0x18037d[_0x05be('0x33')]=_[_0x05be('0x2f')](db['VtigerField'][_0x05be('0x2a')]);_0x18037d[_0x05be('0x2e')]=_[_0x05be('0x2f')](_0x49b16e[_0x05be('0x2e')]);_0x18037d['filters']=_[_0x05be('0x31')](_0x18037d[_0x05be('0x33')],_0x18037d['query']);_0x373bae[_0x05be('0x32')]=_[_0x05be('0x31')](_0x18037d[_0x05be('0x33')],qs[_0x05be('0x34')](_0x49b16e['query'][_0x05be('0x34')]));_0x373bae[_0x05be('0x32')]=_0x373bae[_0x05be('0x32')]['length']?_0x373bae[_0x05be('0x32')]:_0x18037d[_0x05be('0x33')];_0x373bae[_0x05be('0x37')]=qs[_0x05be('0x38')](_0x49b16e[_0x05be('0x2e')][_0x05be('0x38')]);_0x373bae['where']=qs['filters'](_[_0x05be('0x39')](_0x49b16e[_0x05be('0x2e')],_0x18037d['filters']));if(_0x49b16e[_0x05be('0x2e')][_0x05be('0x3a')]){_0x373bae[_0x05be('0x3b')]=_[_0x05be('0x3d')](_0x373bae[_0x05be('0x3b')],{'$or':_[_0x05be('0x29')](_0x373bae['attributes'],function(_0x22ca73){var _0x328786={};_0x328786[_0x22ca73]={'$like':'%'+_0x49b16e['query'][_0x05be('0x3a')]+'%'};return _0x328786;})});}_0x373bae=_[_0x05be('0x3d')]({},_0x373bae,_0x49b16e[_0x05be('0x3e')]);return _0xf5ae75[_0x05be('0x4c')](_0x373bae);}})[_0x05be('0x22')](function(_0x20080b){if(_0x20080b){_0x19ef18=_0x20080b[_0x05be('0x46')];if(!_0x49b16e[_0x05be('0x2e')]['hasOwnProperty'](_0x05be('0x36'))){_0x373bae[_0x05be('0x1e')]=qs[_0x05be('0x1e')](_0x49b16e[_0x05be('0x2e')][_0x05be('0x1e')]);_0x373bae[_0x05be('0x1f')]=qs[_0x05be('0x1f')](_0x49b16e[_0x05be('0x2e')][_0x05be('0x1f')]);}return _0xf5ae75[_0x05be('0x4c')](_0x373bae);}})['then'](function(_0x3a43fd){if(_0x3a43fd){return _0x3a43fd?{'count':_0x19ef18,'rows':_0x3a43fd}:null;}})[_0x05be('0x22')](respondWithResult(_0xe5bc8,null))['catch'](handleError(_0xe5bc8,null));};exports['getDescriptions']=function(_0xf9a8e4,_0x309a77,_0x520482){var _0x5e625c={};var _0x29dbea={};var _0x4c64e0;var _0xe8ecfc;return db[_0x05be('0x3f')][_0x05be('0x4d')]({'where':{'id':_0xf9a8e4[_0x05be('0x45')]['id']}})['then'](handleEntityNotFound(_0x309a77,null))[_0x05be('0x22')](function(_0x3f86f9){if(_0x3f86f9){_0x4c64e0=_0x3f86f9;_0x29dbea[_0x05be('0x33')]=_[_0x05be('0x2f')](db[_0x05be('0x4b')][_0x05be('0x2a')]);_0x29dbea[_0x05be('0x2e')]=_['keys'](_0xf9a8e4[_0x05be('0x2e')]);_0x29dbea['filters']=_[_0x05be('0x31')](_0x29dbea['model'],_0x29dbea[_0x05be('0x2e')]);_0x5e625c['attributes']=_['intersection'](_0x29dbea[_0x05be('0x33')],qs[_0x05be('0x34')](_0xf9a8e4[_0x05be('0x2e')][_0x05be('0x34')]));_0x5e625c[_0x05be('0x32')]=_0x5e625c[_0x05be('0x32')][_0x05be('0x46')]?_0x5e625c['attributes']:_0x29dbea[_0x05be('0x33')];_0x5e625c[_0x05be('0x37')]=qs['sort'](_0xf9a8e4[_0x05be('0x2e')][_0x05be('0x38')]);_0x5e625c[_0x05be('0x3b')]=qs['filters'](_[_0x05be('0x39')](_0xf9a8e4[_0x05be('0x2e')],_0x29dbea['filters']));if(_0xf9a8e4[_0x05be('0x2e')]['filter']){_0x5e625c[_0x05be('0x3b')]=_[_0x05be('0x3d')](_0x5e625c[_0x05be('0x3b')],{'$or':_['map'](_0x5e625c[_0x05be('0x32')],function(_0xc3b070){var _0x3f691f={};_0x3f691f[_0xc3b070]={'$like':'%'+_0xf9a8e4['query'][_0x05be('0x3a')]+'%'};return _0x3f691f;})});}_0x5e625c=_['merge']({},_0x5e625c,_0xf9a8e4[_0x05be('0x3e')]);return _0x4c64e0[_0x05be('0x4e')](_0x5e625c);}})[_0x05be('0x22')](function(_0x11f31c){if(_0x11f31c){_0xe8ecfc=_0x11f31c[_0x05be('0x46')];if(!_0xf9a8e4[_0x05be('0x2e')][_0x05be('0x35')]('nolimit')){_0x5e625c[_0x05be('0x1e')]=qs['limit'](_0xf9a8e4[_0x05be('0x2e')]['limit']);_0x5e625c[_0x05be('0x1f')]=qs[_0x05be('0x1f')](_0xf9a8e4[_0x05be('0x2e')][_0x05be('0x1f')]);}return _0x4c64e0[_0x05be('0x4e')](_0x5e625c);}})['then'](function(_0x4d861f){if(_0x4d861f){return _0x4d861f?{'count':_0xe8ecfc,'rows':_0x4d861f}:null;}})[_0x05be('0x22')](respondWithResult(_0x309a77,null))[_0x05be('0x44')](handleError(_0x309a77,null));}; \ No newline at end of file +var _0xfcc8=['findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_0xfcc8,0xb4));var _0x8fcc=function(_0x5e6c88,_0x1d09d2){_0x5e6c88=_0x5e6c88-0x0;var _0x1356a3=_0xfcc8[_0x5e6c88];return _0x1356a3;};'use strict';var emlformat=require(_0x8fcc('0x0'));var rimraf=require(_0x8fcc('0x1'));var zipdir=require(_0x8fcc('0x2'));var jsonpatch=require(_0x8fcc('0x3'));var rp=require('request-promise');var moment=require(_0x8fcc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8fcc('0x5'));var path=require('path');var sox=require(_0x8fcc('0x6'));var csv=require('to-csv');var ejs=require(_0x8fcc('0x7'));var fs=require('fs');var fs_extra=require(_0x8fcc('0x8'));var _=require(_0x8fcc('0x9'));var squel=require(_0x8fcc('0xa'));var crypto=require(_0x8fcc('0xb'));var jsforce=require(_0x8fcc('0xc'));var deskjs=require(_0x8fcc('0xd'));var toCsv=require(_0x8fcc('0xe'));var querystring=require(_0x8fcc('0xf'));var Papa=require(_0x8fcc('0x10'));var Redis=require(_0x8fcc('0x11'));var authService=require(_0x8fcc('0x12'));var qs=require(_0x8fcc('0x13'));var as=require(_0x8fcc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fcc('0x15'))(_0x8fcc('0x16'));var utils=require(_0x8fcc('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8fcc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f90e9,_0x39a7a1){_0x39a7a1=_0x39a7a1||0xcc;return function(_0x4876d5){if(_0x4876d5){return _0x2f90e9[_0x8fcc('0x19')](_0x39a7a1);}return _0x2f90e9[_0x8fcc('0x1a')](_0x39a7a1)[_0x8fcc('0x1b')]();};}function respondWithResult(_0x5a80b8,_0x373de4){_0x373de4=_0x373de4||0xc8;return function(_0x2daa27){if(_0x2daa27){return _0x5a80b8[_0x8fcc('0x1a')](_0x373de4)['json'](_0x2daa27);}};}function respondWithFilteredResult(_0x251206,_0x1453b7){return function(_0x24ed61){if(_0x24ed61){var _0x236b38=typeof _0x1453b7[_0x8fcc('0x1c')]===_0x8fcc('0x1d')&&typeof _0x1453b7[_0x8fcc('0x1e')]===_0x8fcc('0x1d');var _0x11d1a2=_0x24ed61[_0x8fcc('0x1f')];var _0x262ba2=_0x236b38?0x0:_0x1453b7[_0x8fcc('0x1c')];var _0x22ea38=_0x236b38?_0x24ed61[_0x8fcc('0x1f')]:_0x1453b7[_0x8fcc('0x1c')]+_0x1453b7[_0x8fcc('0x1e')];var _0x340351;if(_0x22ea38>=_0x11d1a2){_0x22ea38=_0x11d1a2;_0x340351=0xc8;}else{_0x340351=0xce;}_0x251206[_0x8fcc('0x1a')](_0x340351);return _0x251206[_0x8fcc('0x20')]('Content-Range',_0x262ba2+'-'+_0x22ea38+'/'+_0x11d1a2)[_0x8fcc('0x21')](_0x24ed61);}return null;};}function patchUpdates(_0xaba2f8){return function(_0xa3fd9e){try{jsonpatch[_0x8fcc('0x22')](_0xa3fd9e,_0xaba2f8,!![]);}catch(_0x139193){return BPromise[_0x8fcc('0x23')](_0x139193);}return _0xa3fd9e[_0x8fcc('0x24')]();};}function saveUpdates(_0x35094e,_0x351dbe){return function(_0x467f37){if(_0x467f37){return _0x467f37[_0x8fcc('0x25')](_0x35094e)[_0x8fcc('0x26')](function(_0x1b467f){return _0x1b467f;});}return null;};}function removeEntity(_0x57c961,_0x373dee){return function(_0x21bca1){if(_0x21bca1){return _0x21bca1[_0x8fcc('0x27')]()[_0x8fcc('0x26')](function(){_0x57c961[_0x8fcc('0x1a')](0xcc)[_0x8fcc('0x1b')]();});}};}function handleEntityNotFound(_0x390906,_0x54837d){return function(_0x22eaf0){if(!_0x22eaf0){_0x390906[_0x8fcc('0x19')](0x194);}return _0x22eaf0;};}function handleError(_0x4bea73,_0x255596){_0x255596=_0x255596||0x1f4;return function(_0x2a7091){logger[_0x8fcc('0x28')](_0x2a7091[_0x8fcc('0x29')]);if(_0x2a7091['name']){delete _0x2a7091[_0x8fcc('0x2a')];}_0x4bea73[_0x8fcc('0x1a')](_0x255596)[_0x8fcc('0x2b')](_0x2a7091);};}exports[_0x8fcc('0x2c')]=function(_0x4ee8de,_0x5d5e19){var _0x2e8f36={},_0x288dbe={},_0x44ea42={'count':0x0,'rows':[]};var _0x16c53e=_[_0x8fcc('0x2d')](db[_0x8fcc('0x2e')][_0x8fcc('0x2f')],function(_0x1e3149){return{'name':_0x1e3149['fieldName'],'type':_0x1e3149['type'][_0x8fcc('0x30')]};});_0x288dbe[_0x8fcc('0x31')]=_[_0x8fcc('0x2d')](_0x16c53e,_0x8fcc('0x2a'));_0x288dbe[_0x8fcc('0x32')]=_[_0x8fcc('0x33')](_0x4ee8de[_0x8fcc('0x32')]);_0x288dbe['filters']=_['intersection'](_0x288dbe[_0x8fcc('0x31')],_0x288dbe[_0x8fcc('0x32')]);_0x2e8f36['attributes']=_[_0x8fcc('0x34')](_0x288dbe['model'],qs[_0x8fcc('0x35')](_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x35')]));_0x2e8f36[_0x8fcc('0x36')]=_0x2e8f36[_0x8fcc('0x36')][_0x8fcc('0x37')]?_0x2e8f36[_0x8fcc('0x36')]:_0x288dbe['model'];if(!_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x38')](_0x8fcc('0x39'))){_0x2e8f36[_0x8fcc('0x1e')]=qs[_0x8fcc('0x1e')](_0x4ee8de['query'][_0x8fcc('0x1e')]);_0x2e8f36[_0x8fcc('0x1c')]=qs[_0x8fcc('0x1c')](_0x4ee8de[_0x8fcc('0x32')]['offset']);}_0x2e8f36['order']=qs[_0x8fcc('0x3a')](_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x3a')]);_0x2e8f36[_0x8fcc('0x3b')]=qs[_0x8fcc('0x3c')](_[_0x8fcc('0x3d')](_0x4ee8de[_0x8fcc('0x32')],_0x288dbe[_0x8fcc('0x3c')]),_0x16c53e);if(_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x3e')]){_0x2e8f36[_0x8fcc('0x3b')]=_[_0x8fcc('0x3f')](_0x2e8f36[_0x8fcc('0x3b')],{'$or':_[_0x8fcc('0x2d')](_0x16c53e,function(_0x45182b){if(_0x45182b[_0x8fcc('0x40')]!==_0x8fcc('0x41')){var _0xa0d2ed={};_0xa0d2ed[_0x45182b[_0x8fcc('0x2a')]]={'$like':'%'+_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x3e')]+'%'};return _0xa0d2ed;}})});}_0x2e8f36=_['merge']({},_0x2e8f36,_0x4ee8de[_0x8fcc('0x42')]);var _0x217c66={'where':_0x2e8f36['where']};return db[_0x8fcc('0x2e')][_0x8fcc('0x1f')](_0x217c66)[_0x8fcc('0x26')](function(_0x617baa){_0x44ea42[_0x8fcc('0x1f')]=_0x617baa;if(_0x4ee8de[_0x8fcc('0x32')][_0x8fcc('0x43')]){_0x2e8f36[_0x8fcc('0x44')]=[{'all':!![]}];}return db[_0x8fcc('0x2e')][_0x8fcc('0x45')](_0x2e8f36);})[_0x8fcc('0x26')](function(_0x52a034){_0x44ea42[_0x8fcc('0x46')]=_0x52a034;return _0x44ea42;})['then'](respondWithFilteredResult(_0x5d5e19,_0x2e8f36))[_0x8fcc('0x47')](handleError(_0x5d5e19,null));};exports[_0x8fcc('0x48')]=function(_0x24d613,_0x416ae1){var _0x493b93={'raw':![],'where':{'id':_0x24d613[_0x8fcc('0x49')]['id']}},_0x5f3497={};_0x5f3497[_0x8fcc('0x31')]=_[_0x8fcc('0x33')](db[_0x8fcc('0x2e')][_0x8fcc('0x2f')]);_0x5f3497[_0x8fcc('0x32')]=_[_0x8fcc('0x33')](_0x24d613[_0x8fcc('0x32')]);_0x5f3497[_0x8fcc('0x3c')]=_['intersection'](_0x5f3497[_0x8fcc('0x31')],_0x5f3497['query']);_0x493b93[_0x8fcc('0x36')]=_[_0x8fcc('0x34')](_0x5f3497[_0x8fcc('0x31')],qs['fields'](_0x24d613[_0x8fcc('0x32')][_0x8fcc('0x35')]));_0x493b93['attributes']=_0x493b93[_0x8fcc('0x36')]['length']?_0x493b93[_0x8fcc('0x36')]:_0x5f3497[_0x8fcc('0x31')];if(_0x24d613[_0x8fcc('0x32')][_0x8fcc('0x43')]){_0x493b93[_0x8fcc('0x44')]=[{'all':!![]}];}_0x493b93=_[_0x8fcc('0x3f')]({},_0x493b93,_0x24d613[_0x8fcc('0x42')]);return db['VtigerConfiguration'][_0x8fcc('0x4a')](_0x493b93)[_0x8fcc('0x26')](handleEntityNotFound(_0x416ae1,null))[_0x8fcc('0x26')](respondWithResult(_0x416ae1,null))[_0x8fcc('0x47')](handleError(_0x416ae1,null));};exports[_0x8fcc('0x4b')]=function(_0x2ef4ab,_0x4f07b4){return db['VtigerConfiguration']['create'](_0x2ef4ab[_0x8fcc('0x4c')],{})['then'](respondWithResult(_0x4f07b4,0xc9))['catch'](handleError(_0x4f07b4,null));};exports[_0x8fcc('0x25')]=function(_0x957bab,_0x5d44c2){if(_0x957bab[_0x8fcc('0x4c')]['id']){delete _0x957bab[_0x8fcc('0x4c')]['id'];}return db[_0x8fcc('0x2e')][_0x8fcc('0x4a')]({'where':{'id':_0x957bab['params']['id']}})[_0x8fcc('0x26')](handleEntityNotFound(_0x5d44c2,null))[_0x8fcc('0x26')](saveUpdates(_0x957bab['body'],null))[_0x8fcc('0x26')](respondWithResult(_0x5d44c2,null))[_0x8fcc('0x47')](handleError(_0x5d44c2,null));};exports['destroy']=function(_0x56ee99,_0x156a8e){return db[_0x8fcc('0x2e')][_0x8fcc('0x4a')]({'where':{'id':_0x56ee99[_0x8fcc('0x49')]['id']}})[_0x8fcc('0x26')](handleEntityNotFound(_0x156a8e,null))[_0x8fcc('0x26')](removeEntity(_0x156a8e,null))['catch'](handleError(_0x156a8e,null));};exports[_0x8fcc('0x4d')]=function(_0x477415,_0x37e2c3,_0x3e676e){var _0x47325a={};var _0x22eed={};var _0x36733a;var _0x5b213b;return db[_0x8fcc('0x2e')][_0x8fcc('0x4e')]({'where':{'id':_0x477415['params']['id']}})['then'](handleEntityNotFound(_0x37e2c3,null))[_0x8fcc('0x26')](function(_0x4afcf2){if(_0x4afcf2){_0x36733a=_0x4afcf2;_0x22eed[_0x8fcc('0x31')]=_[_0x8fcc('0x33')](db[_0x8fcc('0x4f')][_0x8fcc('0x2f')]);_0x22eed[_0x8fcc('0x32')]=_['keys'](_0x477415[_0x8fcc('0x32')]);_0x22eed[_0x8fcc('0x3c')]=_[_0x8fcc('0x34')](_0x22eed[_0x8fcc('0x31')],_0x22eed[_0x8fcc('0x32')]);_0x47325a[_0x8fcc('0x36')]=_[_0x8fcc('0x34')](_0x22eed[_0x8fcc('0x31')],qs[_0x8fcc('0x35')](_0x477415[_0x8fcc('0x32')][_0x8fcc('0x35')]));_0x47325a[_0x8fcc('0x36')]=_0x47325a['attributes']['length']?_0x47325a[_0x8fcc('0x36')]:_0x22eed[_0x8fcc('0x31')];_0x47325a[_0x8fcc('0x50')]=qs[_0x8fcc('0x3a')](_0x477415[_0x8fcc('0x32')][_0x8fcc('0x3a')]);_0x47325a[_0x8fcc('0x3b')]=qs[_0x8fcc('0x3c')](_[_0x8fcc('0x3d')](_0x477415[_0x8fcc('0x32')],_0x22eed[_0x8fcc('0x3c')]));if(_0x477415[_0x8fcc('0x32')]['filter']){_0x47325a[_0x8fcc('0x3b')]=_[_0x8fcc('0x3f')](_0x47325a[_0x8fcc('0x3b')],{'$or':_[_0x8fcc('0x2d')](_0x47325a[_0x8fcc('0x36')],function(_0x429bf1){var _0x17f9a7={};_0x17f9a7[_0x429bf1]={'$like':'%'+_0x477415[_0x8fcc('0x32')][_0x8fcc('0x3e')]+'%'};return _0x17f9a7;})});}_0x47325a=_['merge']({},_0x47325a,_0x477415['options']);return _0x36733a[_0x8fcc('0x4d')](_0x47325a);}})[_0x8fcc('0x26')](function(_0x549652){if(_0x549652){_0x5b213b=_0x549652[_0x8fcc('0x37')];if(!_0x477415[_0x8fcc('0x32')][_0x8fcc('0x38')](_0x8fcc('0x39'))){_0x47325a[_0x8fcc('0x1e')]=qs[_0x8fcc('0x1e')](_0x477415[_0x8fcc('0x32')]['limit']);_0x47325a['offset']=qs['offset'](_0x477415[_0x8fcc('0x32')]['offset']);}return _0x36733a[_0x8fcc('0x4d')](_0x47325a);}})[_0x8fcc('0x26')](function(_0x4240d1){if(_0x4240d1){return _0x4240d1?{'count':_0x5b213b,'rows':_0x4240d1}:null;}})[_0x8fcc('0x26')](respondWithResult(_0x37e2c3,null))[_0x8fcc('0x47')](handleError(_0x37e2c3,null));};exports[_0x8fcc('0x51')]=function(_0x53a8e6,_0xc61fc7,_0x317be3){var _0x53628a={};var _0x20127e={};var _0x2fe403;var _0x3bc819;return db[_0x8fcc('0x2e')][_0x8fcc('0x4e')]({'where':{'id':_0x53a8e6[_0x8fcc('0x49')]['id']}})[_0x8fcc('0x26')](handleEntityNotFound(_0xc61fc7,null))[_0x8fcc('0x26')](function(_0x23eca4){if(_0x23eca4){_0x2fe403=_0x23eca4;_0x20127e[_0x8fcc('0x31')]=_[_0x8fcc('0x33')](db[_0x8fcc('0x4f')][_0x8fcc('0x2f')]);_0x20127e[_0x8fcc('0x32')]=_[_0x8fcc('0x33')](_0x53a8e6[_0x8fcc('0x32')]);_0x20127e[_0x8fcc('0x3c')]=_['intersection'](_0x20127e[_0x8fcc('0x31')],_0x20127e[_0x8fcc('0x32')]);_0x53628a[_0x8fcc('0x36')]=_['intersection'](_0x20127e[_0x8fcc('0x31')],qs['fields'](_0x53a8e6[_0x8fcc('0x32')][_0x8fcc('0x35')]));_0x53628a['attributes']=_0x53628a[_0x8fcc('0x36')][_0x8fcc('0x37')]?_0x53628a[_0x8fcc('0x36')]:_0x20127e[_0x8fcc('0x31')];_0x53628a[_0x8fcc('0x50')]=qs[_0x8fcc('0x3a')](_0x53a8e6[_0x8fcc('0x32')][_0x8fcc('0x3a')]);_0x53628a['where']=qs[_0x8fcc('0x3c')](_[_0x8fcc('0x3d')](_0x53a8e6[_0x8fcc('0x32')],_0x20127e[_0x8fcc('0x3c')]));if(_0x53a8e6[_0x8fcc('0x32')][_0x8fcc('0x3e')]){_0x53628a['where']=_[_0x8fcc('0x3f')](_0x53628a['where'],{'$or':_['map'](_0x53628a['attributes'],function(_0x59ed2a){var _0x3522e6={};_0x3522e6[_0x59ed2a]={'$like':'%'+_0x53a8e6['query'][_0x8fcc('0x3e')]+'%'};return _0x3522e6;})});}_0x53628a=_[_0x8fcc('0x3f')]({},_0x53628a,_0x53a8e6[_0x8fcc('0x42')]);return _0x2fe403[_0x8fcc('0x51')](_0x53628a);}})[_0x8fcc('0x26')](function(_0x153904){if(_0x153904){_0x3bc819=_0x153904['length'];if(!_0x53a8e6[_0x8fcc('0x32')]['hasOwnProperty'](_0x8fcc('0x39'))){_0x53628a[_0x8fcc('0x1e')]=qs[_0x8fcc('0x1e')](_0x53a8e6[_0x8fcc('0x32')]['limit']);_0x53628a['offset']=qs[_0x8fcc('0x1c')](_0x53a8e6[_0x8fcc('0x32')][_0x8fcc('0x1c')]);}return _0x2fe403['getSubjects'](_0x53628a);}})[_0x8fcc('0x26')](function(_0x412622){if(_0x412622){return _0x412622?{'count':_0x3bc819,'rows':_0x412622}:null;}})['then'](respondWithResult(_0xc61fc7,null))[_0x8fcc('0x47')](handleError(_0xc61fc7,null));};exports[_0x8fcc('0x52')]=function(_0x380af2,_0x1310ff,_0x577864){var _0x145763={};var _0x2594ea={};var _0x272385;var _0x598c42;return db[_0x8fcc('0x2e')]['findOne']({'where':{'id':_0x380af2[_0x8fcc('0x49')]['id']}})[_0x8fcc('0x26')](handleEntityNotFound(_0x1310ff,null))[_0x8fcc('0x26')](function(_0x4bed75){if(_0x4bed75){_0x272385=_0x4bed75;_0x2594ea[_0x8fcc('0x31')]=_[_0x8fcc('0x33')](db['VtigerField'][_0x8fcc('0x2f')]);_0x2594ea[_0x8fcc('0x32')]=_[_0x8fcc('0x33')](_0x380af2[_0x8fcc('0x32')]);_0x2594ea['filters']=_[_0x8fcc('0x34')](_0x2594ea[_0x8fcc('0x31')],_0x2594ea[_0x8fcc('0x32')]);_0x145763[_0x8fcc('0x36')]=_['intersection'](_0x2594ea[_0x8fcc('0x31')],qs[_0x8fcc('0x35')](_0x380af2[_0x8fcc('0x32')][_0x8fcc('0x35')]));_0x145763[_0x8fcc('0x36')]=_0x145763[_0x8fcc('0x36')]['length']?_0x145763['attributes']:_0x2594ea[_0x8fcc('0x31')];_0x145763['order']=qs[_0x8fcc('0x3a')](_0x380af2[_0x8fcc('0x32')][_0x8fcc('0x3a')]);_0x145763['where']=qs['filters'](_['pick'](_0x380af2[_0x8fcc('0x32')],_0x2594ea[_0x8fcc('0x3c')]));if(_0x380af2['query'][_0x8fcc('0x3e')]){_0x145763[_0x8fcc('0x3b')]=_[_0x8fcc('0x3f')](_0x145763[_0x8fcc('0x3b')],{'$or':_[_0x8fcc('0x2d')](_0x145763['attributes'],function(_0x5b8ee7){var _0x3182f1={};_0x3182f1[_0x5b8ee7]={'$like':'%'+_0x380af2[_0x8fcc('0x32')]['filter']+'%'};return _0x3182f1;})});}_0x145763=_[_0x8fcc('0x3f')]({},_0x145763,_0x380af2[_0x8fcc('0x42')]);return _0x272385[_0x8fcc('0x52')](_0x145763);}})[_0x8fcc('0x26')](function(_0x4a814f){if(_0x4a814f){_0x598c42=_0x4a814f['length'];if(!_0x380af2['query']['hasOwnProperty'](_0x8fcc('0x39'))){_0x145763[_0x8fcc('0x1e')]=qs['limit'](_0x380af2[_0x8fcc('0x32')][_0x8fcc('0x1e')]);_0x145763[_0x8fcc('0x1c')]=qs['offset'](_0x380af2[_0x8fcc('0x32')][_0x8fcc('0x1c')]);}return _0x272385['getDescriptions'](_0x145763);}})[_0x8fcc('0x26')](function(_0x41840c){if(_0x41840c){return _0x41840c?{'count':_0x598c42,'rows':_0x41840c}:null;}})[_0x8fcc('0x26')](respondWithResult(_0x1310ff,null))[_0x8fcc('0x47')](handleError(_0x1310ff,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 94a0427..062e2cb 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 _0xe4db=['exports','lodash','util','../../config/logger','moment','path','rimraf','./intVtigerConfiguration.attributes'];(function(_0x2abd98,_0x2c04a0){var _0x9b2671=function(_0x7a4c4){while(--_0x7a4c4){_0x2abd98['push'](_0x2abd98['shift']());}};_0x9b2671(++_0x2c04a0);}(_0xe4db,0xf9));var _0xbe4d=function(_0x27f736,_0x428484){_0x27f736=_0x27f736-0x0;var _0x2ee333=_0xe4db[_0x27f736];return _0x2ee333;};'use strict';var _=require(_0xbe4d('0x0'));var util=require(_0xbe4d('0x1'));var logger=require(_0xbe4d('0x2'))('api');var moment=require(_0xbe4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe4d('0x4'));var rimraf=require(_0xbe4d('0x5'));var config=require('../../config/environment');var attributes=require(_0xbe4d('0x6'));module[_0xbe4d('0x7')]=function(_0x44b520,_0x3224df){return _0x44b520['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a5c=['exports','define','int_vtiger_configurations','lodash','util','api','bluebird','path','./intVtigerConfiguration.attributes'];(function(_0x2c0584,_0x3bbadb){var _0x3ee8b4=function(_0x22700a){while(--_0x22700a){_0x2c0584['push'](_0x2c0584['shift']());}};_0x3ee8b4(++_0x3bbadb);}(_0x0a5c,0xb7));var _0xc0a5=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0a5c[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xc0a5('0x0'));var util=require(_0xc0a5('0x1'));var logger=require('../../config/logger')(_0xc0a5('0x2'));var moment=require('moment');var BPromise=require(_0xc0a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0a5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc0a5('0x5'));module[_0xc0a5('0x6')]=function(_0x9d368,_0x5dcde8){return _0x9d368[_0xc0a5('0x7')]('VtigerConfiguration',attributes,{'tableName':_0xc0a5('0x8'),'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 8b9da29..d5347ba 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 _0x51b3=['http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x6d449,_0xe8ba11){var _0xe3245f=function(_0x3a9bed){while(--_0x3a9bed){_0x6d449['push'](_0x6d449['shift']());}};_0xe3245f(++_0xe8ba11);}(_0x51b3,0x8b));var _0x351b=function(_0x7b001f,_0x683b1d){_0x7b001f=_0x7b001f-0x0;var _0x473bf4=_0x51b3[_0x7b001f];return _0x473bf4;};'use strict';var _=require(_0x351b('0x0'));var util=require(_0x351b('0x1'));var moment=require(_0x351b('0x2'));var BPromise=require(_0x351b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x351b('0x4'));var db=require(_0x351b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x351b('0x6'))(_0x351b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x351b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b24aa,_0x49b930,_0x306b7b){return new BPromise(function(_0xc8e50d,_0x7e9935){return client[_0x351b('0x9')](_0x3b24aa,_0x306b7b)[_0x351b('0xa')](function(_0x290497){logger[_0x351b('0xb')](_0x351b('0xc'),_0x49b930,_0x351b('0xd'));logger[_0x351b('0xe')](_0x351b('0xf'),_0x49b930,_0x351b('0xd'),JSON['stringify'](_0x290497));if(_0x290497[_0x351b('0x10')]){if(_0x290497[_0x351b('0x10')][_0x351b('0x11')]===0x1f4){logger[_0x351b('0x10')](_0x351b('0xc'),_0x49b930,_0x290497[_0x351b('0x10')][_0x351b('0x12')]);return _0x7e9935(_0x290497['error']['message']);}logger[_0x351b('0x10')](_0x351b('0xc'),_0x49b930,_0x290497[_0x351b('0x10')][_0x351b('0x12')]);return _0xc8e50d(_0x290497['error'][_0x351b('0x12')]);}else{logger[_0x351b('0xb')](_0x351b('0xc'),_0x49b930,_0x351b('0xd'));_0xc8e50d(_0x290497[_0x351b('0x13')][_0x351b('0x12')]);}})[_0x351b('0x14')](function(_0x1d4c07){logger[_0x351b('0x10')](_0x351b('0xc'),_0x49b930,_0x1d4c07);_0x7e9935(_0x1d4c07);});});} \ No newline at end of file +var _0x1cc4=['request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3c7d61,_0xa3b325){var _0x387ed0=function(_0x5d0312){while(--_0x5d0312){_0x3c7d61['push'](_0x3c7d61['shift']());}};_0x387ed0(++_0xa3b325);}(_0x1cc4,0x144));var _0x41cc=function(_0x169a8a,_0x3526b1){_0x169a8a=_0x169a8a-0x0;var _0x2e8502=_0x1cc4[_0x169a8a];return _0x2e8502;};'use strict';var _=require(_0x41cc('0x0'));var util=require(_0x41cc('0x1'));var moment=require('moment');var BPromise=require(_0x41cc('0x2'));var rs=require(_0x41cc('0x3'));var fs=require('fs');var Redis=require(_0x41cc('0x4'));var db=require(_0x41cc('0x5'))['db'];var utils=require(_0x41cc('0x6'));var logger=require(_0x41cc('0x7'))(_0x41cc('0x8'));var config=require(_0x41cc('0x9'));var jayson=require(_0x41cc('0xa'));var client=jayson['client'][_0x41cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf65ffe,_0x55a96,_0x4130d7){return new BPromise(function(_0x380dec,_0x2dc480){return client[_0x41cc('0xc')](_0xf65ffe,_0x4130d7)[_0x41cc('0xd')](function(_0x50ce16){logger['info'](_0x41cc('0xe'),_0x55a96,_0x41cc('0xf'));logger[_0x41cc('0x10')](_0x41cc('0x11'),_0x55a96,'request\x20sent',JSON[_0x41cc('0x12')](_0x50ce16));if(_0x50ce16[_0x41cc('0x13')]){if(_0x50ce16['error'][_0x41cc('0x14')]===0x1f4){logger[_0x41cc('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x55a96,_0x50ce16[_0x41cc('0x13')][_0x41cc('0x15')]);return _0x2dc480(_0x50ce16[_0x41cc('0x13')]['message']);}logger[_0x41cc('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x55a96,_0x50ce16[_0x41cc('0x13')][_0x41cc('0x15')]);return _0x380dec(_0x50ce16[_0x41cc('0x13')][_0x41cc('0x15')]);}else{logger[_0x41cc('0x16')](_0x41cc('0xe'),_0x55a96,'request\x20sent');_0x380dec(_0x50ce16['result'][_0x41cc('0x15')]);}})[_0x41cc('0x17')](function(_0x10f120){logger[_0x41cc('0x13')](_0x41cc('0xe'),_0x55a96,_0x10f120);_0x2dc480(_0x10f120);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 5227af8..14a6a0d 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 _0x822b=['index','/:id','show','post','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x542c11,_0x35d5df){var _0xd5ba30=function(_0x352bff){while(--_0x352bff){_0x542c11['push'](_0x542c11['shift']());}};_0xd5ba30(++_0x35d5df);}(_0x822b,0x180));var _0xb822=function(_0x25a45a,_0x156e4b){_0x25a45a=_0x25a45a-0x0;var _0x237f87=_0x822b[_0x25a45a];return _0x237f87;};'use strict';var multer=require(_0xb822('0x0'));var util=require(_0xb822('0x1'));var path=require(_0xb822('0x2'));var timeout=require(_0xb822('0x3'));var express=require(_0xb822('0x4'));var router=express[_0xb822('0x5')]();var fs_extra=require(_0xb822('0x6'));var auth=require(_0xb822('0x7'));var interaction=require(_0xb822('0x8'));var config=require(_0xb822('0x9'));var controller=require('./intVtigerField.controller');router[_0xb822('0xa')]('/',auth[_0xb822('0xb')](),controller[_0xb822('0xc')]);router['get'](_0xb822('0xd'),auth[_0xb822('0xb')](),controller[_0xb822('0xe')]);router[_0xb822('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xb822('0xd'),auth[_0xb822('0xb')](),controller['update']);router['delete'](_0xb822('0xd'),auth[_0xb822('0xb')](),controller[_0xb822('0x10')]);module[_0xb822('0x11')]=router; \ No newline at end of file +var _0x7e8e=['show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','index','/:id','isAuthenticated'];(function(_0x511d41,_0x5650a0){var _0x47a851=function(_0x4c7a94){while(--_0x4c7a94){_0x511d41['push'](_0x511d41['shift']());}};_0x47a851(++_0x5650a0);}(_0x7e8e,0x15b));var _0xe7e8=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x7e8e[_0x3c4dad];return _0x1a4f49;};'use strict';var multer=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var path=require(_0xe7e8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7e8('0x3'));var router=express[_0xe7e8('0x4')]();var fs_extra=require(_0xe7e8('0x5'));var auth=require(_0xe7e8('0x6'));var interaction=require(_0xe7e8('0x7'));var config=require('../../config/environment');var controller=require(_0xe7e8('0x8'));router[_0xe7e8('0x9')]('/',auth['isAuthenticated'](),controller[_0xe7e8('0xa')]);router[_0xe7e8('0x9')](_0xe7e8('0xb'),auth[_0xe7e8('0xc')](),controller[_0xe7e8('0xd')]);router[_0xe7e8('0xe')]('/',auth[_0xe7e8('0xc')](),controller[_0xe7e8('0xf')]);router[_0xe7e8('0x10')](_0xe7e8('0xb'),auth['isAuthenticated'](),controller[_0xe7e8('0x11')]);router['delete'](_0xe7e8('0xb'),auth['isAuthenticated'](),controller[_0xe7e8('0x12')]);module[_0xe7e8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index db98589..cb96333 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 _0xa34e=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x3d86f4,_0x2a9220){var _0x5d8e87=function(_0x542c7c){while(--_0x542c7c){_0x3d86f4['push'](_0x3d86f4['shift']());}};_0x5d8e87(++_0x2a9220);}(_0xa34e,0x83));var _0xea34=function(_0xfa514e,_0x2665aa){_0xfa514e=_0xfa514e-0x0;var _0x39d8b0=_0xa34e[_0xfa514e];return _0x39d8b0;};'use strict';var Sequelize=require(_0xea34('0x0'));module[_0xea34('0x1')]={'type':{'type':Sequelize[_0xea34('0x2')](_0xea34('0x3'),_0xea34('0x4'),_0xea34('0x5'),_0xea34('0x6'),_0xea34('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xea34('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xea34('0x2')]('string','variable',_0xea34('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xea34('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea34('0x8')]}}; \ No newline at end of file +var _0x4a08=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x4a08,0x93));var _0x84a0=function(_0x48a95b,_0x5e9888){_0x48a95b=_0x48a95b-0x0;var _0x370fc6=_0x4a08[_0x48a95b];return _0x370fc6;};'use strict';var Sequelize=require(_0x84a0('0x0'));module[_0x84a0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x84a0('0x2'),_0x84a0('0x3'),'customVariable',_0x84a0('0x4'),'picklist'),'defaultValue':_0x84a0('0x2')},'content':{'type':Sequelize[_0x84a0('0x5')]},'key':{'type':Sequelize[_0x84a0('0x5')]},'keyType':{'type':Sequelize[_0x84a0('0x6')](_0x84a0('0x2'),_0x84a0('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x84a0('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x84a0('0x5')]},'customField':{'type':Sequelize[_0x84a0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x84a0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f18e7fb..3d2fe53 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 _0x1caa=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VtigerField','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format'];(function(_0x1e2671,_0x4cf90a){var _0x492489=function(_0x1440b6){while(--_0x1440b6){_0x1e2671['push'](_0x1e2671['shift']());}};_0x492489(++_0x4cf90a);}(_0x1caa,0xe9));var _0xa1ca=function(_0x52c70a,_0x103ddb){_0x52c70a=_0x52c70a-0x0;var _0x154b4e=_0x1caa[_0x52c70a];return _0x154b4e;};'use strict';var emlformat=require(_0xa1ca('0x0'));var rimraf=require(_0xa1ca('0x1'));var zipdir=require(_0xa1ca('0x2'));var jsonpatch=require(_0xa1ca('0x3'));var rp=require(_0xa1ca('0x4'));var moment=require('moment');var BPromise=require(_0xa1ca('0x5'));var Mustache=require(_0xa1ca('0x6'));var util=require(_0xa1ca('0x7'));var path=require(_0xa1ca('0x8'));var sox=require(_0xa1ca('0x9'));var csv=require('to-csv');var ejs=require(_0xa1ca('0xa'));var fs=require('fs');var fs_extra=require(_0xa1ca('0xb'));var _=require(_0xa1ca('0xc'));var squel=require(_0xa1ca('0xd'));var crypto=require(_0xa1ca('0xe'));var jsforce=require(_0xa1ca('0xf'));var deskjs=require(_0xa1ca('0x10'));var toCsv=require(_0xa1ca('0x11'));var querystring=require(_0xa1ca('0x12'));var Papa=require('papaparse');var Redis=require(_0xa1ca('0x13'));var authService=require(_0xa1ca('0x14'));var qs=require(_0xa1ca('0x15'));var as=require(_0xa1ca('0x16'));var hardwareService=require(_0xa1ca('0x17'));var logger=require(_0xa1ca('0x18'))(_0xa1ca('0x19'));var utils=require(_0xa1ca('0x1a'));var config=require(_0xa1ca('0x1b'));var licenseUtil=require(_0xa1ca('0x1c'));var db=require(_0xa1ca('0x1d'))['db'];function respondWithStatusCode(_0x1fc591,_0x533a95){_0x533a95=_0x533a95||0xcc;return function(_0x43bc0a){if(_0x43bc0a){return _0x1fc591[_0xa1ca('0x1e')](_0x533a95);}return _0x1fc591['status'](_0x533a95)[_0xa1ca('0x1f')]();};}function respondWithResult(_0x3d0cb9,_0x5bc3e7){_0x5bc3e7=_0x5bc3e7||0xc8;return function(_0x26f292){if(_0x26f292){return _0x3d0cb9[_0xa1ca('0x20')](_0x5bc3e7)[_0xa1ca('0x21')](_0x26f292);}};}function respondWithFilteredResult(_0x1623c7,_0xaf5181){return function(_0x2e8985){if(_0x2e8985){var _0x5f44d7=typeof _0xaf5181[_0xa1ca('0x22')]==='undefined'&&typeof _0xaf5181['limit']==='undefined';var _0xc54b37=_0x2e8985[_0xa1ca('0x23')];var _0x38a5dd=_0x5f44d7?0x0:_0xaf5181[_0xa1ca('0x22')];var _0x1c1504=_0x5f44d7?_0x2e8985[_0xa1ca('0x23')]:_0xaf5181['offset']+_0xaf5181[_0xa1ca('0x24')];var _0x331c5d;if(_0x1c1504>=_0xc54b37){_0x1c1504=_0xc54b37;_0x331c5d=0xc8;}else{_0x331c5d=0xce;}_0x1623c7[_0xa1ca('0x20')](_0x331c5d);return _0x1623c7['set']('Content-Range',_0x38a5dd+'-'+_0x1c1504+'/'+_0xc54b37)[_0xa1ca('0x21')](_0x2e8985);}return null;};}function patchUpdates(_0x2bab00){return function(_0x2baeed){try{jsonpatch[_0xa1ca('0x25')](_0x2baeed,_0x2bab00,!![]);}catch(_0x4c3fd5){return BPromise[_0xa1ca('0x26')](_0x4c3fd5);}return _0x2baeed[_0xa1ca('0x27')]();};}function saveUpdates(_0x39465c,_0x1910d3){return function(_0x3f30bf){if(_0x3f30bf){return _0x3f30bf[_0xa1ca('0x28')](_0x39465c)[_0xa1ca('0x29')](function(_0x24a769){return _0x24a769;});}return null;};}function removeEntity(_0x2b7a04,_0x2608cb){return function(_0x53ef38){if(_0x53ef38){return _0x53ef38[_0xa1ca('0x2a')]()[_0xa1ca('0x29')](function(){_0x2b7a04[_0xa1ca('0x20')](0xcc)[_0xa1ca('0x1f')]();});}};}function handleEntityNotFound(_0x45ad16,_0x180361){return function(_0x21bb93){if(!_0x21bb93){_0x45ad16[_0xa1ca('0x1e')](0x194);}return _0x21bb93;};}function handleError(_0x2d069e,_0x500366){_0x500366=_0x500366||0x1f4;return function(_0x24e61){logger[_0xa1ca('0x2b')](_0x24e61[_0xa1ca('0x2c')]);if(_0x24e61[_0xa1ca('0x2d')]){delete _0x24e61[_0xa1ca('0x2d')];}_0x2d069e[_0xa1ca('0x20')](_0x500366)[_0xa1ca('0x2e')](_0x24e61);};}exports[_0xa1ca('0x2f')]=function(_0x408b13,_0x341fbb){var _0x4e1c93={},_0x2f92ac={},_0x59e257={'count':0x0,'rows':[]};var _0x1f9e65=_[_0xa1ca('0x30')](db['VtigerField'][_0xa1ca('0x31')],function(_0x1c300f){return{'name':_0x1c300f[_0xa1ca('0x32')],'type':_0x1c300f[_0xa1ca('0x33')][_0xa1ca('0x34')]};});_0x2f92ac[_0xa1ca('0x35')]=_[_0xa1ca('0x30')](_0x1f9e65,_0xa1ca('0x2d'));_0x2f92ac['query']=_[_0xa1ca('0x36')](_0x408b13[_0xa1ca('0x37')]);_0x2f92ac[_0xa1ca('0x38')]=_[_0xa1ca('0x39')](_0x2f92ac[_0xa1ca('0x35')],_0x2f92ac[_0xa1ca('0x37')]);_0x4e1c93[_0xa1ca('0x3a')]=_['intersection'](_0x2f92ac[_0xa1ca('0x35')],qs[_0xa1ca('0x3b')](_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x3b')]));_0x4e1c93[_0xa1ca('0x3a')]=_0x4e1c93[_0xa1ca('0x3a')][_0xa1ca('0x3c')]?_0x4e1c93[_0xa1ca('0x3a')]:_0x2f92ac[_0xa1ca('0x35')];if(!_0x408b13[_0xa1ca('0x37')]['hasOwnProperty']('nolimit')){_0x4e1c93[_0xa1ca('0x24')]=qs[_0xa1ca('0x24')](_0x408b13[_0xa1ca('0x37')]['limit']);_0x4e1c93['offset']=qs[_0xa1ca('0x22')](_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x22')]);}_0x4e1c93[_0xa1ca('0x3d')]=qs['sort'](_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x3e')]);_0x4e1c93['where']=qs[_0xa1ca('0x38')](_[_0xa1ca('0x3f')](_0x408b13[_0xa1ca('0x37')],_0x2f92ac['filters']),_0x1f9e65);if(_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x40')]){_0x4e1c93[_0xa1ca('0x41')]=_[_0xa1ca('0x42')](_0x4e1c93[_0xa1ca('0x41')],{'$or':_['map'](_0x1f9e65,function(_0x3a3449){if(_0x3a3449[_0xa1ca('0x33')]!=='VIRTUAL'){var _0x37e605={};_0x37e605[_0x3a3449[_0xa1ca('0x2d')]]={'$like':'%'+_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x40')]+'%'};return _0x37e605;}})});}_0x4e1c93=_[_0xa1ca('0x42')]({},_0x4e1c93,_0x408b13['options']);var _0x49e650={'where':_0x4e1c93[_0xa1ca('0x41')]};return db[_0xa1ca('0x43')][_0xa1ca('0x23')](_0x49e650)[_0xa1ca('0x29')](function(_0x1a51c5){_0x59e257[_0xa1ca('0x23')]=_0x1a51c5;if(_0x408b13[_0xa1ca('0x37')][_0xa1ca('0x44')]){_0x4e1c93[_0xa1ca('0x45')]=[{'all':!![]}];}return db[_0xa1ca('0x43')][_0xa1ca('0x46')](_0x4e1c93);})[_0xa1ca('0x29')](function(_0x21fcde){_0x59e257['rows']=_0x21fcde;return _0x59e257;})[_0xa1ca('0x29')](respondWithFilteredResult(_0x341fbb,_0x4e1c93))[_0xa1ca('0x47')](handleError(_0x341fbb,null));};exports[_0xa1ca('0x48')]=function(_0x2f8f32,_0x684463){var _0x2b7142={'raw':!![],'where':{'id':_0x2f8f32[_0xa1ca('0x49')]['id']}},_0x2845a6={};_0x2845a6[_0xa1ca('0x35')]=_[_0xa1ca('0x36')](db['VtigerField'][_0xa1ca('0x31')]);_0x2845a6[_0xa1ca('0x37')]=_[_0xa1ca('0x36')](_0x2f8f32[_0xa1ca('0x37')]);_0x2845a6[_0xa1ca('0x38')]=_['intersection'](_0x2845a6[_0xa1ca('0x35')],_0x2845a6[_0xa1ca('0x37')]);_0x2b7142[_0xa1ca('0x3a')]=_[_0xa1ca('0x39')](_0x2845a6[_0xa1ca('0x35')],qs[_0xa1ca('0x3b')](_0x2f8f32[_0xa1ca('0x37')][_0xa1ca('0x3b')]));_0x2b7142['attributes']=_0x2b7142[_0xa1ca('0x3a')][_0xa1ca('0x3c')]?_0x2b7142[_0xa1ca('0x3a')]:_0x2845a6[_0xa1ca('0x35')];if(_0x2f8f32['query']['includeAll']){_0x2b7142[_0xa1ca('0x45')]=[{'all':!![]}];}_0x2b7142=_[_0xa1ca('0x42')]({},_0x2b7142,_0x2f8f32[_0xa1ca('0x4a')]);return db['VtigerField']['find'](_0x2b7142)['then'](handleEntityNotFound(_0x684463,null))[_0xa1ca('0x29')](respondWithResult(_0x684463,null))[_0xa1ca('0x47')](handleError(_0x684463,null));};exports[_0xa1ca('0x4b')]=function(_0x4e78b0,_0x2cb209){return db[_0xa1ca('0x43')]['create'](_0x4e78b0[_0xa1ca('0x4c')],{})['then'](respondWithResult(_0x2cb209,0xc9))[_0xa1ca('0x47')](handleError(_0x2cb209,null));};exports[_0xa1ca('0x28')]=function(_0x4a0c57,_0x5714b8){if(_0x4a0c57[_0xa1ca('0x4c')]['id']){delete _0x4a0c57[_0xa1ca('0x4c')]['id'];}return db['VtigerField'][_0xa1ca('0x4d')]({'where':{'id':_0x4a0c57[_0xa1ca('0x49')]['id']}})[_0xa1ca('0x29')](handleEntityNotFound(_0x5714b8,null))['then'](saveUpdates(_0x4a0c57['body'],null))['then'](respondWithResult(_0x5714b8,null))[_0xa1ca('0x47')](handleError(_0x5714b8,null));};exports[_0xa1ca('0x2a')]=function(_0x4afb9e,_0x123461){return db['VtigerField'][_0xa1ca('0x4d')]({'where':{'id':_0x4afb9e[_0xa1ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x123461,null))['then'](removeEntity(_0x123461,null))['catch'](handleError(_0x123461,null));}; \ No newline at end of file +var _0x7623=['key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','type','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','VtigerField','rawAttributes','fieldName'];(function(_0x18f137,_0x5e06b4){var _0x147221=function(_0x5f47d5){while(--_0x5f47d5){_0x18f137['push'](_0x18f137['shift']());}};_0x147221(++_0x5e06b4);}(_0x7623,0x1c5));var _0x3762=function(_0x274509,_0x1353f7){_0x274509=_0x274509-0x0;var _0x47298c=_0x7623[_0x274509];return _0x47298c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3762('0x0'));var zipdir=require(_0x3762('0x1'));var jsonpatch=require(_0x3762('0x2'));var rp=require('request-promise');var moment=require(_0x3762('0x3'));var BPromise=require(_0x3762('0x4'));var Mustache=require('mustache');var util=require(_0x3762('0x5'));var path=require(_0x3762('0x6'));var sox=require(_0x3762('0x7'));var csv=require(_0x3762('0x8'));var ejs=require(_0x3762('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3762('0xa'));var squel=require(_0x3762('0xb'));var crypto=require(_0x3762('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3762('0xd'));var Papa=require(_0x3762('0xe'));var Redis=require(_0x3762('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3762('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3762('0x11'));var logger=require('../../config/logger')(_0x3762('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3762('0x13'));var db=require(_0x3762('0x14'))['db'];function respondWithStatusCode(_0x24af3a,_0x5e2ba0){_0x5e2ba0=_0x5e2ba0||0xcc;return function(_0x36e7d5){if(_0x36e7d5){return _0x24af3a[_0x3762('0x15')](_0x5e2ba0);}return _0x24af3a[_0x3762('0x16')](_0x5e2ba0)[_0x3762('0x17')]();};}function respondWithResult(_0x475767,_0x14976e){_0x14976e=_0x14976e||0xc8;return function(_0x54ea09){if(_0x54ea09){return _0x475767[_0x3762('0x16')](_0x14976e)[_0x3762('0x18')](_0x54ea09);}};}function respondWithFilteredResult(_0x164a2,_0x3d97fd){return function(_0x455f61){if(_0x455f61){var _0x29dc69=typeof _0x3d97fd[_0x3762('0x19')]===_0x3762('0x1a')&&typeof _0x3d97fd[_0x3762('0x1b')]===_0x3762('0x1a');var _0x457fde=_0x455f61[_0x3762('0x1c')];var _0x21643a=_0x29dc69?0x0:_0x3d97fd[_0x3762('0x19')];var _0x1ada51=_0x29dc69?_0x455f61[_0x3762('0x1c')]:_0x3d97fd[_0x3762('0x19')]+_0x3d97fd[_0x3762('0x1b')];var _0x3df875;if(_0x1ada51>=_0x457fde){_0x1ada51=_0x457fde;_0x3df875=0xc8;}else{_0x3df875=0xce;}_0x164a2['status'](_0x3df875);return _0x164a2[_0x3762('0x1d')](_0x3762('0x1e'),_0x21643a+'-'+_0x1ada51+'/'+_0x457fde)[_0x3762('0x18')](_0x455f61);}return null;};}function patchUpdates(_0x18c5c2){return function(_0x4cc896){try{jsonpatch[_0x3762('0x1f')](_0x4cc896,_0x18c5c2,!![]);}catch(_0x49eaa8){return BPromise[_0x3762('0x20')](_0x49eaa8);}return _0x4cc896['save']();};}function saveUpdates(_0x16640e,_0x2ba382){return function(_0x58fe52){if(_0x58fe52){return _0x58fe52[_0x3762('0x21')](_0x16640e)['then'](function(_0x17b31a){return _0x17b31a;});}return null;};}function removeEntity(_0x5072ad,_0x5d1c6c){return function(_0x2a4f0e){if(_0x2a4f0e){return _0x2a4f0e[_0x3762('0x22')]()[_0x3762('0x23')](function(){_0x5072ad[_0x3762('0x16')](0xcc)[_0x3762('0x17')]();});}};}function handleEntityNotFound(_0x4718d2,_0x356699){return function(_0x2d9c34){if(!_0x2d9c34){_0x4718d2[_0x3762('0x15')](0x194);}return _0x2d9c34;};}function handleError(_0x324f1a,_0x954ec6){_0x954ec6=_0x954ec6||0x1f4;return function(_0x320a71){logger[_0x3762('0x24')](_0x320a71['stack']);if(_0x320a71[_0x3762('0x25')]){delete _0x320a71[_0x3762('0x25')];}_0x324f1a['status'](_0x954ec6)[_0x3762('0x26')](_0x320a71);};}exports[_0x3762('0x27')]=function(_0x5407d1,_0x39a7bc){var _0x544e0a={},_0x5722e2={},_0x145f42={'count':0x0,'rows':[]};var _0x11c9a7=_[_0x3762('0x28')](db[_0x3762('0x29')][_0x3762('0x2a')],function(_0xde57e0){return{'name':_0xde57e0[_0x3762('0x2b')],'type':_0xde57e0['type'][_0x3762('0x2c')]};});_0x5722e2[_0x3762('0x2d')]=_[_0x3762('0x28')](_0x11c9a7,_0x3762('0x25'));_0x5722e2['query']=_[_0x3762('0x2e')](_0x5407d1[_0x3762('0x2f')]);_0x5722e2[_0x3762('0x30')]=_['intersection'](_0x5722e2[_0x3762('0x2d')],_0x5722e2[_0x3762('0x2f')]);_0x544e0a[_0x3762('0x31')]=_[_0x3762('0x32')](_0x5722e2[_0x3762('0x2d')],qs[_0x3762('0x33')](_0x5407d1[_0x3762('0x2f')][_0x3762('0x33')]));_0x544e0a['attributes']=_0x544e0a[_0x3762('0x31')][_0x3762('0x34')]?_0x544e0a[_0x3762('0x31')]:_0x5722e2[_0x3762('0x2d')];if(!_0x5407d1[_0x3762('0x2f')][_0x3762('0x35')]('nolimit')){_0x544e0a[_0x3762('0x1b')]=qs['limit'](_0x5407d1[_0x3762('0x2f')][_0x3762('0x1b')]);_0x544e0a[_0x3762('0x19')]=qs['offset'](_0x5407d1['query'][_0x3762('0x19')]);}_0x544e0a[_0x3762('0x36')]=qs[_0x3762('0x37')](_0x5407d1['query'][_0x3762('0x37')]);_0x544e0a['where']=qs[_0x3762('0x30')](_[_0x3762('0x38')](_0x5407d1[_0x3762('0x2f')],_0x5722e2[_0x3762('0x30')]),_0x11c9a7);if(_0x5407d1['query'][_0x3762('0x39')]){_0x544e0a['where']=_['merge'](_0x544e0a['where'],{'$or':_[_0x3762('0x28')](_0x11c9a7,function(_0x4899cc){if(_0x4899cc[_0x3762('0x3a')]!=='VIRTUAL'){var _0x1fa1fc={};_0x1fa1fc[_0x4899cc['name']]={'$like':'%'+_0x5407d1[_0x3762('0x2f')]['filter']+'%'};return _0x1fa1fc;}})});}_0x544e0a=_[_0x3762('0x3b')]({},_0x544e0a,_0x5407d1[_0x3762('0x3c')]);var _0x8d60bb={'where':_0x544e0a['where']};return db[_0x3762('0x29')][_0x3762('0x1c')](_0x8d60bb)[_0x3762('0x23')](function(_0x4239e9){_0x145f42[_0x3762('0x1c')]=_0x4239e9;if(_0x5407d1[_0x3762('0x2f')][_0x3762('0x3d')]){_0x544e0a['include']=[{'all':!![]}];}return db[_0x3762('0x29')][_0x3762('0x3e')](_0x544e0a);})[_0x3762('0x23')](function(_0x17efad){_0x145f42[_0x3762('0x3f')]=_0x17efad;return _0x145f42;})[_0x3762('0x23')](respondWithFilteredResult(_0x39a7bc,_0x544e0a))[_0x3762('0x40')](handleError(_0x39a7bc,null));};exports[_0x3762('0x41')]=function(_0x47fb9f,_0x566106){var _0x43d519={'raw':!![],'where':{'id':_0x47fb9f[_0x3762('0x42')]['id']}},_0x4d16ab={};_0x4d16ab['model']=_[_0x3762('0x2e')](db['VtigerField']['rawAttributes']);_0x4d16ab[_0x3762('0x2f')]=_['keys'](_0x47fb9f[_0x3762('0x2f')]);_0x4d16ab[_0x3762('0x30')]=_['intersection'](_0x4d16ab['model'],_0x4d16ab[_0x3762('0x2f')]);_0x43d519[_0x3762('0x31')]=_[_0x3762('0x32')](_0x4d16ab[_0x3762('0x2d')],qs[_0x3762('0x33')](_0x47fb9f[_0x3762('0x2f')][_0x3762('0x33')]));_0x43d519[_0x3762('0x31')]=_0x43d519[_0x3762('0x31')][_0x3762('0x34')]?_0x43d519['attributes']:_0x4d16ab[_0x3762('0x2d')];if(_0x47fb9f[_0x3762('0x2f')][_0x3762('0x3d')]){_0x43d519[_0x3762('0x43')]=[{'all':!![]}];}_0x43d519=_['merge']({},_0x43d519,_0x47fb9f[_0x3762('0x3c')]);return db[_0x3762('0x29')]['find'](_0x43d519)[_0x3762('0x23')](handleEntityNotFound(_0x566106,null))[_0x3762('0x23')](respondWithResult(_0x566106,null))[_0x3762('0x40')](handleError(_0x566106,null));};exports[_0x3762('0x44')]=function(_0xb1071,_0x31f49e){return db[_0x3762('0x29')][_0x3762('0x44')](_0xb1071['body'],{})[_0x3762('0x23')](respondWithResult(_0x31f49e,0xc9))[_0x3762('0x40')](handleError(_0x31f49e,null));};exports[_0x3762('0x21')]=function(_0x215666,_0x3313e8){if(_0x215666[_0x3762('0x45')]['id']){delete _0x215666[_0x3762('0x45')]['id'];}return db[_0x3762('0x29')]['find']({'where':{'id':_0x215666[_0x3762('0x42')]['id']}})[_0x3762('0x23')](handleEntityNotFound(_0x3313e8,null))['then'](saveUpdates(_0x215666['body'],null))[_0x3762('0x23')](respondWithResult(_0x3313e8,null))[_0x3762('0x40')](handleError(_0x3313e8,null));};exports['destroy']=function(_0x854ddd,_0x3f6adc){return db[_0x3762('0x29')][_0x3762('0x46')]({'where':{'id':_0x854ddd['params']['id']}})[_0x3762('0x23')](handleEntityNotFound(_0x3f6adc,null))[_0x3762('0x23')](removeEntity(_0x3f6adc,null))[_0x3762('0x40')](handleError(_0x3f6adc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 14b588c..b3f4046 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 _0x9ea9=['exports','define','idField','lodash','util','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes'];(function(_0x1d954b,_0x7cd95){var _0x2fdb0a=function(_0x5d28ef){while(--_0x5d28ef){_0x1d954b['push'](_0x1d954b['shift']());}};_0x2fdb0a(++_0x7cd95);}(_0x9ea9,0x116));var _0x99ea=function(_0x1e3f3e,_0x5bd300){_0x1e3f3e=_0x1e3f3e-0x0;var _0x5dcacf=_0x9ea9[_0x1e3f3e];return _0x5dcacf;};'use strict';var _=require(_0x99ea('0x0'));var util=require(_0x99ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x99ea('0x2'));var BPromise=require(_0x99ea('0x3'));var rp=require(_0x99ea('0x4'));var fs=require('fs');var path=require(_0x99ea('0x5'));var rimraf=require(_0x99ea('0x6'));var config=require('../../config/environment');var attributes=require(_0x99ea('0x7'));module[_0x99ea('0x8')]=function(_0x555e11,_0x24c758){return _0x555e11[_0x99ea('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x99ea('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe768=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','util','api','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe768,0x1af));var _0x8e76=function(_0x28cdac,_0x1a0a03){_0x28cdac=_0x28cdac-0x0;var _0x364e2b=_0xe768[_0x28cdac];return _0x364e2b;};'use strict';var _=require(_0x8e76('0x0'));var util=require(_0x8e76('0x1'));var logger=require('../../config/logger')(_0x8e76('0x2'));var moment=require(_0x8e76('0x3'));var BPromise=require(_0x8e76('0x4'));var rp=require(_0x8e76('0x5'));var fs=require('fs');var path=require(_0x8e76('0x6'));var rimraf=require(_0x8e76('0x7'));var config=require(_0x8e76('0x8'));var attributes=require('./intVtigerField.attributes');module[_0x8e76('0x9')]=function(_0x7a917c,_0x2e619f){return _0x7a917c[_0x8e76('0xa')](_0x8e76('0xb'),attributes,{'tableName':_0x8e76('0xc'),'paranoid':![],'indexes':[{'name':_0x8e76('0xd'),'fields':['idField',_0x8e76('0xe')],'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 f0f1266..217b541 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 _0xe544=['debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xe544,0xe1));var _0x4e54=function(_0x276bbb,_0x141543){_0x276bbb=_0x276bbb-0x0;var _0x5a197a=_0xe544[_0x276bbb];return _0x5a197a;};'use strict';var _=require(_0x4e54('0x0'));var util=require(_0x4e54('0x1'));var moment=require(_0x4e54('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e54('0x3'));var fs=require('fs');var Redis=require(_0x4e54('0x4'));var db=require(_0x4e54('0x5'))['db'];var utils=require(_0x4e54('0x6'));var logger=require('../../config/logger')(_0x4e54('0x7'));var config=require(_0x4e54('0x8'));var jayson=require(_0x4e54('0x9'));var client=jayson['client'][_0x4e54('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12ca51,_0x54b6bc,_0x1721cc){return new BPromise(function(_0x535d7c,_0x57354f){return client[_0x4e54('0xb')](_0x12ca51,_0x1721cc)[_0x4e54('0xc')](function(_0x2fa449){logger[_0x4e54('0xd')]('VtigerField,\x20%s,\x20%s',_0x54b6bc,_0x4e54('0xe'));logger[_0x4e54('0xf')](_0x4e54('0x10'),_0x54b6bc,_0x4e54('0xe'),JSON[_0x4e54('0x11')](_0x2fa449));if(_0x2fa449[_0x4e54('0x12')]){if(_0x2fa449['error'][_0x4e54('0x13')]===0x1f4){logger[_0x4e54('0x12')](_0x4e54('0x14'),_0x54b6bc,_0x2fa449[_0x4e54('0x12')][_0x4e54('0x15')]);return _0x57354f(_0x2fa449[_0x4e54('0x12')][_0x4e54('0x15')]);}logger[_0x4e54('0x12')](_0x4e54('0x14'),_0x54b6bc,_0x2fa449[_0x4e54('0x12')][_0x4e54('0x15')]);return _0x535d7c(_0x2fa449[_0x4e54('0x12')][_0x4e54('0x15')]);}else{logger['info'](_0x4e54('0x14'),_0x54b6bc,'request\x20sent');_0x535d7c(_0x2fa449[_0x4e54('0x16')][_0x4e54('0x15')]);}})[_0x4e54('0x17')](function(_0x119980){logger['error'](_0x4e54('0x14'),_0x54b6bc,_0x119980);_0x57354f(_0x119980);});});} \ No newline at end of file +var _0xbef1=['request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0xeb51b2,_0x5cd7ad){var _0xfef194=function(_0x25c7df){while(--_0x25c7df){_0xeb51b2['push'](_0xeb51b2['shift']());}};_0xfef194(++_0x5cd7ad);}(_0xbef1,0xcd));var _0x1bef=function(_0x3b66af,_0x13224c){_0x3b66af=_0x3b66af-0x0;var _0x345c13=_0xbef1[_0x3b66af];return _0x345c13;};'use strict';var _=require('lodash');var util=require(_0x1bef('0x0'));var moment=require(_0x1bef('0x1'));var BPromise=require(_0x1bef('0x2'));var rs=require(_0x1bef('0x3'));var fs=require('fs');var Redis=require(_0x1bef('0x4'));var db=require(_0x1bef('0x5'))['db'];var utils=require(_0x1bef('0x6'));var logger=require('../../config/logger')(_0x1bef('0x7'));var config=require('../../config/environment');var jayson=require(_0x1bef('0x8'));var client=jayson[_0x1bef('0x9')][_0x1bef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x269c35,_0x4f665b,_0x3af8c2){return new BPromise(function(_0x2af5c6,_0x390fbd){return client[_0x1bef('0xb')](_0x269c35,_0x3af8c2)[_0x1bef('0xc')](function(_0x208a99){logger['info'](_0x1bef('0xd'),_0x4f665b,_0x1bef('0xe'));logger[_0x1bef('0xf')](_0x1bef('0x10'),_0x4f665b,_0x1bef('0xe'),JSON[_0x1bef('0x11')](_0x208a99));if(_0x208a99[_0x1bef('0x12')]){if(_0x208a99[_0x1bef('0x12')][_0x1bef('0x13')]===0x1f4){logger['error'](_0x1bef('0xd'),_0x4f665b,_0x208a99['error'][_0x1bef('0x14')]);return _0x390fbd(_0x208a99[_0x1bef('0x12')][_0x1bef('0x14')]);}logger[_0x1bef('0x12')](_0x1bef('0xd'),_0x4f665b,_0x208a99[_0x1bef('0x12')][_0x1bef('0x14')]);return _0x2af5c6(_0x208a99['error'][_0x1bef('0x14')]);}else{logger[_0x1bef('0x15')](_0x1bef('0xd'),_0x4f665b,'request\x20sent');_0x2af5c6(_0x208a99[_0x1bef('0x16')]['message']);}})[_0x1bef('0x17')](function(_0x4bb83a){logger[_0x1bef('0x12')]('VtigerField,\x20%s,\x20%s',_0x4f665b,_0x4bb83a);_0x390fbd(_0x4bb83a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 825106e..2b8bb09 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 _0x0810=['/:id/configurations','addConfiguration','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','getFields','post','create'];(function(_0x52e9a3,_0x4bd432){var _0x14385a=function(_0x6e62a1){while(--_0x6e62a1){_0x52e9a3['push'](_0x52e9a3['shift']());}};_0x14385a(++_0x4bd432);}(_0x0810,0x1e6));var _0x0081=function(_0x57e3f1,_0x13b54b){_0x57e3f1=_0x57e3f1-0x0;var _0x19bfcd=_0x0810[_0x57e3f1];return _0x19bfcd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0081('0x0'));var timeout=require('connect-timeout');var express=require(_0x0081('0x1'));var router=express[_0x0081('0x2')]();var fs_extra=require(_0x0081('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0081('0x4'));var config=require(_0x0081('0x5'));var controller=require(_0x0081('0x6'));router[_0x0081('0x7')]('/',auth[_0x0081('0x8')](),controller[_0x0081('0x9')]);router[_0x0081('0x7')](_0x0081('0xa'),auth[_0x0081('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0x0081('0x8')](),controller['getConfigurations']);router[_0x0081('0x7')]('/:id/fields',auth[_0x0081('0x8')](),controller[_0x0081('0xb')]);router[_0x0081('0xc')]('/',auth['isAuthenticated'](),controller[_0x0081('0xd')]);router[_0x0081('0xc')](_0x0081('0xe'),auth['isAuthenticated'](),controller[_0x0081('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0081('0x10')]);router[_0x0081('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0081('0x12')]);module[_0x0081('0x13')]=router; \ No newline at end of file +var _0x12c2=['isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0xb94e78,_0x4e04e8){var _0xf2ad88=function(_0x3d093c){while(--_0x3d093c){_0xb94e78['push'](_0xb94e78['shift']());}};_0xf2ad88(++_0x4e04e8);}(_0x12c2,0xdc));var _0x212c=function(_0x2e1d3d,_0x719bf0){_0x2e1d3d=_0x2e1d3d-0x0;var _0x3d81df=_0x12c2[_0x2e1d3d];return _0x3d81df;};'use strict';var multer=require('multer');var util=require(_0x212c('0x0'));var path=require('path');var timeout=require(_0x212c('0x1'));var express=require(_0x212c('0x2'));var router=express[_0x212c('0x3')]();var fs_extra=require(_0x212c('0x4'));var auth=require(_0x212c('0x5'));var interaction=require(_0x212c('0x6'));var config=require(_0x212c('0x7'));var controller=require(_0x212c('0x8'));router[_0x212c('0x9')]('/',auth[_0x212c('0xa')](),controller[_0x212c('0xb')]);router[_0x212c('0x9')]('/:id',auth[_0x212c('0xa')](),controller[_0x212c('0xc')]);router['get'](_0x212c('0xd'),auth[_0x212c('0xa')](),controller['getConfigurations']);router['get'](_0x212c('0xe'),auth[_0x212c('0xa')](),controller[_0x212c('0xf')]);router[_0x212c('0x10')]('/',auth[_0x212c('0xa')](),controller[_0x212c('0x11')]);router[_0x212c('0x10')](_0x212c('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x212c('0x12')](_0x212c('0x13'),auth[_0x212c('0xa')](),controller[_0x212c('0x14')]);router[_0x212c('0x15')](_0x212c('0x13'),auth[_0x212c('0xa')](),controller['destroy']);module[_0x212c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 5abd046..d2093df 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 _0x0adf=['STRING','username','remoteUri','ENUM','token','integrationTab','newTab','sequelize','exports'];(function(_0x44e505,_0xdd5e92){var _0x258493=function(_0x4b7fad){while(--_0x4b7fad){_0x44e505['push'](_0x44e505['shift']());}};_0x258493(++_0xdd5e92);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x2f7b37,_0x2bd0d5){_0x2f7b37=_0x2f7b37-0x0;var _0x14d1b0=_0x0adf[_0x2f7b37];return _0x14d1b0;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x3')},'password':{'type':Sequelize[_0xf0ad('0x2')]},'token':{'type':Sequelize[_0xf0ad('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x4')},'authType':{'type':Sequelize[_0xf0ad('0x5')]('password',_0xf0ad('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf0ad('0x5')](_0xf0ad('0x7'),_0xf0ad('0x8')),'defaultValue':_0xf0ad('0x7')}}; \ No newline at end of file +var _0x4317=['ENUM','password','integrationTab','newTab','exports','STRING','username','remoteUri'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x4317,0x7c));var _0x7431=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4317[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')]},'description':{'type':Sequelize[_0x7431('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x7431('0x2')},'password':{'type':Sequelize[_0x7431('0x1')]},'token':{'type':Sequelize[_0x7431('0x1')]},'remoteUri':{'type':Sequelize[_0x7431('0x1')],'unique':_0x7431('0x3')},'authType':{'type':Sequelize[_0x7431('0x4')]('password','token'),'defaultValue':_0x7431('0x5')},'serverUrl':{'type':Sequelize[_0x7431('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7431('0x4')](_0x7431('0x6'),_0x7431('0x7')),'defaultValue':_0x7431('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index f403f01..cae0e61 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 _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x70e512,_0x336a62){var _0x4d9700=function(_0x3862fe){while(--_0x3862fe){_0x70e512['push'](_0x70e512['shift']());}};_0x4d9700(++_0x336a62);}(_0x91a7,0xe7));var _0x791a=function(_0x49406f,_0x31f675){_0x49406f=_0x49406f-0x0;var _0x3bbc3d=_0x91a7[_0x49406f];return _0x3bbc3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file +var _0x69d3=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','rows','show','keys','find','catch','create','update','body','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','remoteUri','slice','lastIndexOf','format','ticket_fields','authType','password','Basic\x20%s','%s:%s','base64','headers','%s/token:%s','toString','Unknown\x20authentication\x20type','subject','description','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x581aae,_0x2b18ee){var _0x539df2=function(_0xbbcb64){while(--_0xbbcb64){_0x581aae['push'](_0x581aae['shift']());}};_0x539df2(++_0x2b18ee);}(_0x69d3,0xda));var _0x369d=function(_0x8bf2a1,_0x2ea39f){_0x8bf2a1=_0x8bf2a1-0x0;var _0x5b768c=_0x69d3[_0x8bf2a1];return _0x5b768c;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];var integrations=require(_0x369d('0x17'));function respondWithStatusCode(_0x52c126,_0x15b417){_0x15b417=_0x15b417||0xcc;return function(_0x9d016){if(_0x9d016){return _0x52c126[_0x369d('0x18')](_0x15b417);}return _0x52c126[_0x369d('0x19')](_0x15b417)[_0x369d('0x1a')]();};}function respondWithResult(_0x539536,_0x5cd4c3){_0x5cd4c3=_0x5cd4c3||0xc8;return function(_0x5485a1){if(_0x5485a1){return _0x539536[_0x369d('0x19')](_0x5cd4c3)[_0x369d('0x1b')](_0x5485a1);}};}function respondWithFilteredResult(_0x389c43,_0x5b4f55){return function(_0x2c1a4a){if(_0x2c1a4a){var _0x29c1fe=typeof _0x5b4f55[_0x369d('0x1c')]==='undefined'&&typeof _0x5b4f55[_0x369d('0x1d')]===_0x369d('0x1e');var _0x4ea6c2=_0x2c1a4a['count'];var _0x597b67=_0x29c1fe?0x0:_0x5b4f55[_0x369d('0x1c')];var _0x4494b3=_0x29c1fe?_0x2c1a4a[_0x369d('0x1f')]:_0x5b4f55['offset']+_0x5b4f55[_0x369d('0x1d')];var _0x24dfff;if(_0x4494b3>=_0x4ea6c2){_0x4494b3=_0x4ea6c2;_0x24dfff=0xc8;}else{_0x24dfff=0xce;}_0x389c43[_0x369d('0x19')](_0x24dfff);return _0x389c43[_0x369d('0x20')](_0x369d('0x21'),_0x597b67+'-'+_0x4494b3+'/'+_0x4ea6c2)['json'](_0x2c1a4a);}return null;};}function patchUpdates(_0x5c9fdd){return function(_0x448e6e){try{jsonpatch[_0x369d('0x22')](_0x448e6e,_0x5c9fdd,!![]);}catch(_0x11ac1d){return BPromise[_0x369d('0x23')](_0x11ac1d);}return _0x448e6e[_0x369d('0x24')]();};}function saveUpdates(_0x15fbef,_0x1b262a){return function(_0x54a42e){if(_0x54a42e){return _0x54a42e['update'](_0x15fbef)[_0x369d('0x25')](function(_0xed16e){return _0xed16e;});}return null;};}function removeEntity(_0xf7bc3a,_0xcae58){return function(_0x30e7c5){if(_0x30e7c5){return _0x30e7c5[_0x369d('0x26')]()[_0x369d('0x25')](function(){_0xf7bc3a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16145e,_0x46de2b){return function(_0x15cd81){if(!_0x15cd81){_0x16145e[_0x369d('0x18')](0x194);}return _0x15cd81;};}function handleError(_0x8aa521,_0x41e0cf){_0x41e0cf=_0x41e0cf||0x1f4;return function(_0x8090b0){logger['error'](_0x8090b0[_0x369d('0x27')]);if(_0x8090b0[_0x369d('0x28')]){delete _0x8090b0[_0x369d('0x28')];}_0x8aa521[_0x369d('0x19')](_0x41e0cf)[_0x369d('0x29')](_0x8090b0);};}exports[_0x369d('0x2a')]=function(_0x3d1ce0,_0x4d42ea){var _0x157291={},_0x56efb1={},_0x57b94c={'count':0x0,'rows':[]};var _0x38feda=_[_0x369d('0x2b')](db['ZendeskAccount'][_0x369d('0x2c')],function(_0x5a14ce){return{'name':_0x5a14ce[_0x369d('0x2d')],'type':_0x5a14ce[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x56efb1[_0x369d('0x30')]=_[_0x369d('0x2b')](_0x38feda,_0x369d('0x28'));_0x56efb1[_0x369d('0x31')]=_['keys'](_0x3d1ce0[_0x369d('0x31')]);_0x56efb1[_0x369d('0x32')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],_0x56efb1[_0x369d('0x31')]);_0x157291[_0x369d('0x34')]=_[_0x369d('0x33')](_0x56efb1[_0x369d('0x30')],qs['fields'](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x35')]));_0x157291[_0x369d('0x34')]=_0x157291[_0x369d('0x34')][_0x369d('0x36')]?_0x157291['attributes']:_0x56efb1[_0x369d('0x30')];if(!_0x3d1ce0[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x157291[_0x369d('0x1d')]=qs[_0x369d('0x1d')](_0x3d1ce0['query'][_0x369d('0x1d')]);_0x157291[_0x369d('0x1c')]=qs[_0x369d('0x1c')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x1c')]);}_0x157291[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3a')]);_0x157291[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x3d1ce0[_0x369d('0x31')],_0x56efb1[_0x369d('0x32')]),_0x38feda);if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x3d')]){_0x157291[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x157291[_0x369d('0x3b')],{'$or':_[_0x369d('0x2b')](_0x38feda,function(_0x10c5b6){if(_0x10c5b6[_0x369d('0x2e')]!==_0x369d('0x3f')){var _0xd58366={};_0xd58366[_0x10c5b6['name']]={'$like':'%'+_0x3d1ce0['query'][_0x369d('0x3d')]+'%'};return _0xd58366;}})});}_0x157291=_[_0x369d('0x3e')]({},_0x157291,_0x3d1ce0[_0x369d('0x40')]);var _0x401bc7={'where':_0x157291[_0x369d('0x3b')]};return db[_0x369d('0x41')][_0x369d('0x1f')](_0x401bc7)[_0x369d('0x25')](function(_0x46c940){_0x57b94c['count']=_0x46c940;if(_0x3d1ce0[_0x369d('0x31')][_0x369d('0x42')]){_0x157291[_0x369d('0x43')]=[{'all':!![]}];}return db[_0x369d('0x41')][_0x369d('0x44')](_0x157291);})[_0x369d('0x25')](function(_0x28803c){_0x57b94c[_0x369d('0x45')]=_0x28803c;return _0x57b94c;})['then'](respondWithFilteredResult(_0x4d42ea,_0x157291))['catch'](handleError(_0x4d42ea,null));};exports[_0x369d('0x46')]=function(_0x3222ce,_0x30909a){var _0x4dad71={'raw':![],'where':{'id':_0x3222ce['params']['id']}},_0x4d07ac={};_0x4d07ac[_0x369d('0x30')]=_[_0x369d('0x47')](db['ZendeskAccount'][_0x369d('0x2c')]);_0x4d07ac[_0x369d('0x31')]=_[_0x369d('0x47')](_0x3222ce[_0x369d('0x31')]);_0x4d07ac['filters']=_[_0x369d('0x33')](_0x4d07ac['model'],_0x4d07ac[_0x369d('0x31')]);_0x4dad71['attributes']=_[_0x369d('0x33')](_0x4d07ac[_0x369d('0x30')],qs[_0x369d('0x35')](_0x3222ce['query']['fields']));_0x4dad71[_0x369d('0x34')]=_0x4dad71[_0x369d('0x34')][_0x369d('0x36')]?_0x4dad71['attributes']:_0x4d07ac[_0x369d('0x30')];if(_0x3222ce[_0x369d('0x31')][_0x369d('0x42')]){_0x4dad71[_0x369d('0x43')]=[{'all':!![]}];}_0x4dad71=_[_0x369d('0x3e')]({},_0x4dad71,_0x3222ce[_0x369d('0x40')]);return db[_0x369d('0x41')][_0x369d('0x48')](_0x4dad71)[_0x369d('0x25')](handleEntityNotFound(_0x30909a,null))['then'](respondWithResult(_0x30909a,null))[_0x369d('0x49')](handleError(_0x30909a,null));};exports[_0x369d('0x4a')]=function(_0xcc1465,_0x257c3d){return db[_0x369d('0x41')][_0x369d('0x4a')](_0xcc1465['body'],{})[_0x369d('0x25')](respondWithResult(_0x257c3d,0xc9))[_0x369d('0x49')](handleError(_0x257c3d,null));};exports[_0x369d('0x4b')]=function(_0x44a357,_0x1b04d9){if(_0x44a357[_0x369d('0x4c')]['id']){delete _0x44a357[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x48')]({'where':{'id':_0x44a357[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1b04d9,null))[_0x369d('0x25')](saveUpdates(_0x44a357['body'],null))[_0x369d('0x25')](respondWithResult(_0x1b04d9,null))[_0x369d('0x49')](handleError(_0x1b04d9,null));};exports[_0x369d('0x26')]=function(_0x85edd6,_0x648a0d){return db['ZendeskAccount'][_0x369d('0x48')]({'where':{'id':_0x85edd6['params']['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x648a0d,null))[_0x369d('0x25')](removeEntity(_0x648a0d,null))[_0x369d('0x49')](handleError(_0x648a0d,null));};exports[_0x369d('0x4e')]=function(_0x46c62c,_0x1bd31c,_0x22e2d4){var _0x418cab={};var _0x1cdeca={};var _0x9f1544;var _0x4d582a;return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x46c62c[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x1bd31c,null))[_0x369d('0x25')](function(_0x347df4){if(_0x347df4){_0x9f1544=_0x347df4;_0x1cdeca['model']=_['keys'](db[_0x369d('0x50')][_0x369d('0x2c')]);_0x1cdeca['query']=_[_0x369d('0x47')](_0x46c62c['query']);_0x1cdeca[_0x369d('0x32')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],_0x1cdeca['query']);_0x418cab[_0x369d('0x34')]=_[_0x369d('0x33')](_0x1cdeca[_0x369d('0x30')],qs[_0x369d('0x35')](_0x46c62c['query']['fields']));_0x418cab[_0x369d('0x34')]=_0x418cab[_0x369d('0x34')][_0x369d('0x36')]?_0x418cab['attributes']:_0x1cdeca[_0x369d('0x30')];_0x418cab[_0x369d('0x39')]=qs[_0x369d('0x3a')](_0x46c62c['query']['sort']);_0x418cab[_0x369d('0x3b')]=qs[_0x369d('0x32')](_[_0x369d('0x3c')](_0x46c62c[_0x369d('0x31')],_0x1cdeca['filters']));if(_0x46c62c[_0x369d('0x31')][_0x369d('0x3d')]){_0x418cab[_0x369d('0x3b')]=_[_0x369d('0x3e')](_0x418cab[_0x369d('0x3b')],{'$or':_['map'](_0x418cab[_0x369d('0x34')],function(_0x304a9e){var _0x28b752={};_0x28b752[_0x304a9e]={'$like':'%'+_0x46c62c['query'][_0x369d('0x3d')]+'%'};return _0x28b752;})});}_0x418cab=_['merge']({},_0x418cab,_0x46c62c[_0x369d('0x40')]);return _0x9f1544['getConfigurations'](_0x418cab);}})['then'](function(_0x5f440e){if(_0x5f440e){_0x4d582a=_0x5f440e['length'];if(!_0x46c62c[_0x369d('0x31')]['hasOwnProperty'](_0x369d('0x38'))){_0x418cab['limit']=qs[_0x369d('0x1d')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1d')]);_0x418cab['offset']=qs[_0x369d('0x1c')](_0x46c62c[_0x369d('0x31')][_0x369d('0x1c')]);}return _0x9f1544[_0x369d('0x4e')](_0x418cab);}})[_0x369d('0x25')](function(_0xe63e0f){if(_0xe63e0f){return _0xe63e0f?{'count':_0x4d582a,'rows':_0xe63e0f}:null;}})['then'](respondWithResult(_0x1bd31c,null))[_0x369d('0x49')](handleError(_0x1bd31c,null));};exports['addConfiguration']=function(_0x5706be,_0x56c98e,_0x36e990){if(_0x5706be[_0x369d('0x4c')]['id']){delete _0x5706be[_0x369d('0x4c')]['id'];}return db[_0x369d('0x41')][_0x369d('0x4f')]({'where':{'id':_0x5706be[_0x369d('0x4d')]['id']}})[_0x369d('0x25')](handleEntityNotFound(_0x56c98e,null))[_0x369d('0x25')](function(_0x1c9683){if(_0x1c9683){_0x5706be[_0x369d('0x4c')][_0x369d('0x51')]=_0x1c9683['id'];_0x5706be[_0x369d('0x4c')][_0x369d('0x52')]=integrations[_0x369d('0x53')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be['body'][_0x369d('0x2e')]);_0x5706be['body'][_0x369d('0x55')]=integrations[_0x369d('0x56')](_0x5706be[_0x369d('0x4c')][_0x369d('0x54')],_0x5706be[_0x369d('0x4c')]['type']);return db[_0x369d('0x50')]['create'](_0x5706be['body'],{'include':[{'model':db[_0x369d('0x57')],'as':_0x369d('0x52')},{'model':db[_0x369d('0x57')],'as':_0x369d('0x55')}]});}return null;})[_0x369d('0x25')](respondWithResult(_0x56c98e,null))[_0x369d('0x49')](handleError(_0x56c98e,null));};exports[_0x369d('0x58')]=function(_0x11ac7d,_0x55a811,_0x461782){var _0x24e70d='';return db['ZendeskAccount'][_0x369d('0x4f')]({'where':{'id':_0x11ac7d[_0x369d('0x4d')]['id']},'attributes':['id',_0x369d('0x59'),'password',_0x369d('0x5a'),'authType',_0x369d('0x5b')]})[_0x369d('0x25')](handleEntityNotFound(_0x55a811,null))[_0x369d('0x25')](function(_0x369199){if(_0x369199){_0x24e70d=_0x369199[_0x369d('0x5b')];var _0x1a9a01=_0x24e70d[_0x369d('0x5c')](-0x1);if(_0x1a9a01==='/'){_0x24e70d=_0x24e70d['substring'](0x0,_0x24e70d[_0x369d('0x5d')](_0x1a9a01));}var _0x7e8d08={'method':'GET','uri':util[_0x369d('0x5e')]('%s/%s',_0x24e70d,_0x369d('0x5f')),'json':!![]};switch(_0x369199[_0x369d('0x60')]){case _0x369d('0x61'):_0x7e8d08['headers']={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x63'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x61')]))['toString'](_0x369d('0x64')))};break;case _0x369d('0x5a'):_0x7e8d08[_0x369d('0x65')]={'Authorization':util[_0x369d('0x5e')](_0x369d('0x62'),new Buffer(util['format'](_0x369d('0x66'),_0x369199[_0x369d('0x59')],_0x369199[_0x369d('0x5a')]))[_0x369d('0x67')](_0x369d('0x64')))};break;default:throw new db['Sequelize']['ValidationError'](_0x369d('0x68'));}return rp(_0x7e8d08);}})[_0x369d('0x25')](function(_0x2307fc){if(_0x2307fc){var _0x11b348=[_0x369d('0x69'),_0x369d('0x6a'),'group',_0x369d('0x6b')];_[_0x369d('0x6c')](_0x2307fc['ticket_fields'],function(_0x6c8235){return _0x11b348['includes'](_0x6c8235[_0x369d('0x2e')]);});return{'count':_0x2307fc['ticket_fields'][_0x369d('0x36')],'rows':_[_0x369d('0x2b')](_0x2307fc['ticket_fields'],function(_0x4148a9){return{'id':_0x4148a9['id'],'name':_0x4148a9['position']>0x7?_0x4148a9[_0x369d('0x6d')]:_0x4148a9['type'],'custom':_0x4148a9['position']>0x7?!![]:![],'options':_0x4148a9[_0x369d('0x6e')]?_0x4148a9[_0x369d('0x6e')]:_0x4148a9[_0x369d('0x6f')]?_0x4148a9[_0x369d('0x6f')]:[]};})};}})[_0x369d('0x25')](respondWithResult(_0x55a811,null))['catch'](function(_0x28ec32){var _0xaff7cc=_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?0x1f4:_0x28ec32[_0x369d('0x71')]||0x1f4;logger[_0x369d('0x72')](_0x369d('0x73'),_0x369d('0x58'),_0xaff7cc,JSON[_0x369d('0x74')](_0x28ec32));delete _0x28ec32['name'];if(_0xaff7cc===0x191){_0xaff7cc=0x190;}_0x55a811[_0x369d('0x19')](_0xaff7cc)[_0x369d('0x29')](_0x11ac7d[_0x369d('0x31')][_0x369d('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x28ec32[_0x369d('0x71')]}:_0x28ec32);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 79c592f..4215fe4 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 _0x16df=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ZendeskAccount','int_zendesk_accounts','lodash'];(function(_0x2d6bf1,_0x5b3a23){var _0x5b2495=function(_0x3a4ddb){while(--_0x3a4ddb){_0x2d6bf1['push'](_0x2d6bf1['shift']());}};_0x5b2495(++_0x5b3a23);}(_0x16df,0x9b));var _0xf16d=function(_0x3f747e,_0x39af2c){_0x3f747e=_0x3f747e-0x0;var _0x7a0ccb=_0x16df[_0x3f747e];return _0x7a0ccb;};'use strict';var _=require(_0xf16d('0x0'));var util=require(_0xf16d('0x1'));var logger=require('../../config/logger')(_0xf16d('0x2'));var moment=require(_0xf16d('0x3'));var BPromise=require(_0xf16d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf16d('0x5'));var rimraf=require(_0xf16d('0x6'));var config=require(_0xf16d('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xf16d('0x8')]=function(_0x5aba6d,_0x3bf25a){return _0x5aba6d[_0xf16d('0x9')](_0xf16d('0xa'),attributes,{'tableName':_0xf16d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80fd=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x11323a,_0x3ab909){var _0x579f63=function(_0x2d447a){while(--_0x2d447a){_0x11323a['push'](_0x11323a['shift']());}};_0x579f63(++_0x3ab909);}(_0x80fd,0x1f3));var _0xd80f=function(_0x3bb011,_0x16178c){_0x3bb011=_0x3bb011-0x0;var _0x186271=_0x80fd[_0x3bb011];return _0x186271;};'use strict';var _=require(_0xd80f('0x0'));var util=require(_0xd80f('0x1'));var logger=require(_0xd80f('0x2'))(_0xd80f('0x3'));var moment=require(_0xd80f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd80f('0x5'));var fs=require('fs');var path=require(_0xd80f('0x6'));var rimraf=require('rimraf');var config=require(_0xd80f('0x7'));var attributes=require(_0xd80f('0x8'));var integrations=require(_0xd80f('0x9'));module[_0xd80f('0xa')]=function(_0x3b46ca,_0x10dc9d){return _0x3b46ca[_0xd80f('0xb')](_0xd80f('0xc'),attributes,{'tableName':_0xd80f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index aa97091..b0c8694 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 _0x038a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','map','include','attributes','model','catch','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0x365f6c,_0x36938f){var _0x124bb3=function(_0x204c55){while(--_0x204c55){_0x365f6c['push'](_0x365f6c['shift']());}};_0x124bb3(++_0x36938f);}(_0x038a,0x93));var _0xa038=function(_0x4bed75,_0x211cc7){_0x4bed75=_0x4bed75-0x0;var _0x2dd8e8=_0x038a[_0x4bed75];return _0x2dd8e8;};'use strict';var _=require(_0xa038('0x0'));var util=require(_0xa038('0x1'));var moment=require(_0xa038('0x2'));var BPromise=require(_0xa038('0x3'));var rs=require(_0xa038('0x4'));var fs=require('fs');var Redis=require(_0xa038('0x5'));var db=require(_0xa038('0x6'))['db'];var utils=require(_0xa038('0x7'));var logger=require(_0xa038('0x8'))(_0xa038('0x9'));var config=require(_0xa038('0xa'));var jayson=require(_0xa038('0xb'));var client=jayson[_0xa038('0xc')][_0xa038('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d82df,_0x49fd72,_0xd8f793){return new BPromise(function(_0x2b1fc5,_0x4c5e8f){return client[_0xa038('0xe')](_0x5d82df,_0xd8f793)[_0xa038('0xf')](function(_0x3bfbb7){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x49fd72,_0xa038('0x10'));logger[_0xa038('0x11')](_0xa038('0x12'),_0x49fd72,_0xa038('0x10'),JSON[_0xa038('0x13')](_0x3bfbb7));if(_0x3bfbb7[_0xa038('0x14')]){if(_0x3bfbb7[_0xa038('0x14')][_0xa038('0x15')]===0x1f4){logger[_0xa038('0x14')](_0xa038('0x16'),_0x49fd72,_0x3bfbb7['error'][_0xa038('0x17')]);return _0x4c5e8f(_0x3bfbb7[_0xa038('0x14')][_0xa038('0x17')]);}logger[_0xa038('0x14')](_0xa038('0x16'),_0x49fd72,_0x3bfbb7[_0xa038('0x14')]['message']);return _0x2b1fc5(_0x3bfbb7['error'][_0xa038('0x17')]);}else{logger[_0xa038('0x18')](_0xa038('0x16'),_0x49fd72,_0xa038('0x10'));_0x2b1fc5(_0x3bfbb7[_0xa038('0x19')][_0xa038('0x17')]);}})['catch'](function(_0xedc674){logger[_0xa038('0x14')](_0xa038('0x16'),_0x49fd72,_0xedc674);_0x4c5e8f(_0xedc674);});});}exports[_0xa038('0x1a')]=function(_0x3b6f47){var _0x1a10c2=this;return new Promise(function(_0x40f4e6,_0x39f41b){return db[_0xa038('0x1b')][_0xa038('0x1c')]({'raw':_0x3b6f47['options']?_0x3b6f47['options'][_0xa038('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b6f47[_0xa038('0x1e')]?_0x3b6f47[_0xa038('0x1e')][_0xa038('0x1f')]||null:null,'attributes':_0x3b6f47[_0xa038('0x1e')]?_0x3b6f47['options']['attributes']||null:null,'limit':_0x3b6f47[_0xa038('0x1e')]?_0x3b6f47[_0xa038('0x1e')]['limit']||null:null,'include':_0x3b6f47[_0xa038('0x1e')]?_0x3b6f47[_0xa038('0x1e')]['include']?_[_0xa038('0x20')](_0x3b6f47[_0xa038('0x1e')][_0xa038('0x21')],function(_0x2f18c7){return{'model':db[_0x2f18c7['model']],'as':_0x2f18c7['as'],'attributes':_0x2f18c7[_0xa038('0x22')],'include':_0x2f18c7[_0xa038('0x21')]?_[_0xa038('0x20')](_0x2f18c7[_0xa038('0x21')],function(_0x259125){return{'model':db[_0x259125['model']],'as':_0x259125['as'],'attributes':_0x259125['attributes'],'include':_0x259125[_0xa038('0x21')]?_[_0xa038('0x20')](_0x259125['include'],function(_0x22b921){return{'model':db[_0x22b921[_0xa038('0x23')]],'as':_0x22b921['as'],'attributes':_0x22b921[_0xa038('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa038('0xf')](function(_0x80f1af){logger[_0xa038('0x18')](_0xa038('0x1a'),_0x3b6f47);logger[_0xa038('0x11')](_0xa038('0x1a'),_0x3b6f47,JSON[_0xa038('0x13')](_0x80f1af));_0x40f4e6(_0x80f1af);})[_0xa038('0x24')](function(_0x1329a3){logger[_0xa038('0x14')](_0xa038('0x1a'),_0x1329a3[_0xa038('0x17')],_0x3b6f47);_0x39f41b(_0x1a10c2[_0xa038('0x14')](0x1f4,_0x1329a3[_0xa038('0x17')]));});});};exports[_0xa038('0x25')]=function(_0x4313a8){var _0x34ed20=this;return new Promise(function(_0x388814,_0x1d706c){return db[_0xa038('0x1b')]['find']({'raw':_0x4313a8[_0xa038('0x1e')]?_0x4313a8[_0xa038('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4313a8['options']?_0x4313a8[_0xa038('0x1e')][_0xa038('0x1f')]||null:null,'attributes':_0x4313a8[_0xa038('0x1e')]?_0x4313a8[_0xa038('0x1e')][_0xa038('0x22')]||null:null,'include':_0x4313a8[_0xa038('0x1e')]?_0x4313a8[_0xa038('0x1e')][_0xa038('0x21')]?_[_0xa038('0x20')](_0x4313a8['options'][_0xa038('0x21')],function(_0x335999){return{'model':db[_0x335999[_0xa038('0x23')]],'as':_0x335999['as'],'attributes':_0x335999['attributes'],'include':_0x335999[_0xa038('0x21')]?_[_0xa038('0x20')](_0x335999[_0xa038('0x21')],function(_0xdd24ca){return{'model':db[_0xdd24ca['model']],'as':_0xdd24ca['as'],'attributes':_0xdd24ca[_0xa038('0x22')],'include':_0xdd24ca['include']?_[_0xa038('0x20')](_0xdd24ca[_0xa038('0x21')],function(_0x1079c3){return{'model':db[_0x1079c3[_0xa038('0x23')]],'as':_0x1079c3['as'],'attributes':_0x1079c3[_0xa038('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa038('0xf')](function(_0x1800b0){logger[_0xa038('0x18')]('ShowZendeskAccount',_0x4313a8);logger['debug'](_0xa038('0x25'),_0x4313a8,JSON['stringify'](_0x1800b0));_0x388814(_0x1800b0);})['catch'](function(_0x374f45){logger[_0xa038('0x14')]('ShowZendeskAccount',_0x374f45[_0xa038('0x17')],_0x4313a8);_0x1d706c(_0x34ed20[_0xa038('0x14')](0x1f4,_0x374f45[_0xa038('0x17')]));});});}; \ No newline at end of file +var _0xfbdd=['GetZendeskAccount','stringify','ShowZendeskAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','then','debug'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0xfbdd,0xc4));var _0xdfbd=function(_0x4d8235,_0x2ae185){_0x4d8235=_0x4d8235-0x0;var _0x3f308d=_0xfbdd[_0x4d8235];return _0x3f308d;};'use strict';var _=require(_0xdfbd('0x0'));var util=require(_0xdfbd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdfbd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfbd('0x3'))['db'];var utils=require(_0xdfbd('0x4'));var logger=require(_0xdfbd('0x5'))(_0xdfbd('0x6'));var config=require('../../config/environment');var jayson=require(_0xdfbd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cc3a,_0x20b0dd,_0x20d4b4){return new BPromise(function(_0xd23bb0,_0x4e4e15){return client[_0xdfbd('0x8')](_0x20cc3a,_0x20d4b4)['then'](function(_0x1cbaf0){logger[_0xdfbd('0x9')]('ZendeskAccount,\x20%s,\x20%s',_0x20b0dd,_0xdfbd('0xa'));logger['debug'](_0xdfbd('0xb'),_0x20b0dd,'request\x20sent',JSON['stringify'](_0x1cbaf0));if(_0x1cbaf0[_0xdfbd('0xc')]){if(_0x1cbaf0['error']['code']===0x1f4){logger[_0xdfbd('0xc')](_0xdfbd('0xd'),_0x20b0dd,_0x1cbaf0[_0xdfbd('0xc')][_0xdfbd('0xe')]);return _0x4e4e15(_0x1cbaf0[_0xdfbd('0xc')][_0xdfbd('0xe')]);}logger[_0xdfbd('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x20b0dd,_0x1cbaf0[_0xdfbd('0xc')]['message']);return _0xd23bb0(_0x1cbaf0['error'][_0xdfbd('0xe')]);}else{logger['info'](_0xdfbd('0xd'),_0x20b0dd,_0xdfbd('0xa'));_0xd23bb0(_0x1cbaf0[_0xdfbd('0xf')]['message']);}})[_0xdfbd('0x10')](function(_0x1d374e){logger[_0xdfbd('0xc')](_0xdfbd('0xd'),_0x20b0dd,_0x1d374e);_0x4e4e15(_0x1d374e);});});}exports['GetZendeskAccount']=function(_0xe7f4dc){var _0x11126a=this;return new Promise(function(_0x2d338d,_0x1ffb18){return db[_0xdfbd('0x11')][_0xdfbd('0x12')]({'raw':_0xe7f4dc[_0xdfbd('0x13')]?_0xe7f4dc[_0xdfbd('0x13')][_0xdfbd('0x14')]===undefined?!![]:![]:!![],'where':_0xe7f4dc['options']?_0xe7f4dc[_0xdfbd('0x13')][_0xdfbd('0x15')]||null:null,'attributes':_0xe7f4dc[_0xdfbd('0x13')]?_0xe7f4dc[_0xdfbd('0x13')][_0xdfbd('0x16')]||null:null,'limit':_0xe7f4dc['options']?_0xe7f4dc[_0xdfbd('0x13')]['limit']||null:null,'include':_0xe7f4dc[_0xdfbd('0x13')]?_0xe7f4dc[_0xdfbd('0x13')][_0xdfbd('0x17')]?_[_0xdfbd('0x18')](_0xe7f4dc['options'][_0xdfbd('0x17')],function(_0x51e6d5){return{'model':db[_0x51e6d5[_0xdfbd('0x19')]],'as':_0x51e6d5['as'],'attributes':_0x51e6d5[_0xdfbd('0x16')],'include':_0x51e6d5[_0xdfbd('0x17')]?_[_0xdfbd('0x18')](_0x51e6d5[_0xdfbd('0x17')],function(_0x12e9d6){return{'model':db[_0x12e9d6[_0xdfbd('0x19')]],'as':_0x12e9d6['as'],'attributes':_0x12e9d6['attributes'],'include':_0x12e9d6['include']?_['map'](_0x12e9d6['include'],function(_0x3f06e7){return{'model':db[_0x3f06e7['model']],'as':_0x3f06e7['as'],'attributes':_0x3f06e7[_0xdfbd('0x16')]};}):[]};}):[]};}):[]:[]})[_0xdfbd('0x1a')](function(_0x2fd777){logger[_0xdfbd('0x9')]('GetZendeskAccount',_0xe7f4dc);logger[_0xdfbd('0x1b')](_0xdfbd('0x1c'),_0xe7f4dc,JSON[_0xdfbd('0x1d')](_0x2fd777));_0x2d338d(_0x2fd777);})['catch'](function(_0x508388){logger[_0xdfbd('0xc')](_0xdfbd('0x1c'),_0x508388[_0xdfbd('0xe')],_0xe7f4dc);_0x1ffb18(_0x11126a[_0xdfbd('0xc')](0x1f4,_0x508388[_0xdfbd('0xe')]));});});};exports[_0xdfbd('0x1e')]=function(_0x5a1a76){var _0x35fcc4=this;return new Promise(function(_0x29375d,_0x5b73e4){return db['ZendeskAccount'][_0xdfbd('0x1f')]({'raw':_0x5a1a76[_0xdfbd('0x13')]?_0x5a1a76[_0xdfbd('0x13')][_0xdfbd('0x14')]===undefined?!![]:![]:!![],'where':_0x5a1a76[_0xdfbd('0x13')]?_0x5a1a76[_0xdfbd('0x13')][_0xdfbd('0x15')]||null:null,'attributes':_0x5a1a76[_0xdfbd('0x13')]?_0x5a1a76[_0xdfbd('0x13')][_0xdfbd('0x16')]||null:null,'include':_0x5a1a76[_0xdfbd('0x13')]?_0x5a1a76['options'][_0xdfbd('0x17')]?_[_0xdfbd('0x18')](_0x5a1a76['options'][_0xdfbd('0x17')],function(_0x47211c){return{'model':db[_0x47211c[_0xdfbd('0x19')]],'as':_0x47211c['as'],'attributes':_0x47211c[_0xdfbd('0x16')],'include':_0x47211c[_0xdfbd('0x17')]?_[_0xdfbd('0x18')](_0x47211c['include'],function(_0x175767){return{'model':db[_0x175767['model']],'as':_0x175767['as'],'attributes':_0x175767[_0xdfbd('0x16')],'include':_0x175767[_0xdfbd('0x17')]?_['map'](_0x175767[_0xdfbd('0x17')],function(_0x22bf5c){return{'model':db[_0x22bf5c[_0xdfbd('0x19')]],'as':_0x22bf5c['as'],'attributes':_0x22bf5c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48dcaa){logger['info'](_0xdfbd('0x1e'),_0x5a1a76);logger[_0xdfbd('0x1b')](_0xdfbd('0x1e'),_0x5a1a76,JSON['stringify'](_0x48dcaa));_0x29375d(_0x48dcaa);})[_0xdfbd('0x10')](function(_0x28f4d7){logger['error'](_0xdfbd('0x1e'),_0x28f4d7['message'],_0x5a1a76);_0x5b73e4(_0x35fcc4[_0xdfbd('0xc')](0x1f4,_0x28f4d7[_0xdfbd('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index cfa3ee7..0665e80 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0abf=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','path'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf0ab('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf0ab('0x4'));var config=require(_0xf0ab('0x5'));var controller=require(_0xf0ab('0x6'));router[_0xf0ab('0x7')]('/',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x9')]);router[_0xf0ab('0x7')]('/:id',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x7')](_0xf0ab('0xb'),auth['isAuthenticated'](),controller[_0xf0ab('0xc')]);router[_0xf0ab('0x7')](_0xf0ab('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xf0ab('0x7')]('/:id/descriptions',auth[_0xf0ab('0x8')](),controller[_0xf0ab('0xe')]);router[_0xf0ab('0x7')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x10')]);router[_0xf0ab('0x11')]('/',auth['isAuthenticated'](),controller[_0xf0ab('0x12')]);router[_0xf0ab('0x11')](_0xf0ab('0xf'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x13')]);router[_0xf0ab('0x14')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x16')]);router[_0xf0ab('0x17')](_0xf0ab('0x15'),auth[_0xf0ab('0x8')](),controller[_0xf0ab('0x18')]);module[_0xf0ab('0x19')]=router; \ No newline at end of file +var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x4c94bb,_0x3a6f4a){var _0x407047=function(_0x1f0017){while(--_0x1f0017){_0x4c94bb['push'](_0x4c94bb['shift']());}};_0x407047(++_0x3a6f4a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('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 a331d1c..1e629c2 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 _0x74ed=['STRING','sequelize'];(function(_0x237276,_0x146f92){var _0x5449fa=function(_0x18cb6f){while(--_0x18cb6f){_0x237276['push'](_0x237276['shift']());}};_0x5449fa(++_0x146f92);}(_0x74ed,0x1e5));var _0xd74e=function(_0x1c6941,_0x26af8f){_0x1c6941=_0x1c6941-0x0;var _0x431d37=_0x74ed[_0x1c6941];return _0x431d37;};'use strict';var Sequelize=require(_0xd74e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd74e('0x1')]},'description':{'type':Sequelize[_0xd74e('0x1')]}}; \ No newline at end of file +var _0x4f0e=['STRING','sequelize'];(function(_0x12c289,_0x3376b8){var _0x9e28d5=function(_0x33cb58){while(--_0x33cb58){_0x12c289['push'](_0x12c289['shift']());}};_0x9e28d5(++_0x3376b8);}(_0x4f0e,0x11f));var _0xe4f0=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x4f0e[_0x9b2bb0];return _0x2cdb3b;};'use strict';var Sequelize=require(_0xe4f0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4f0('0x1')]},'description':{'type':Sequelize[_0xe4f0('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e924697..1991e2c 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 _0xfb29=['type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','keys','includeAll','include','find','catch','create','body','update','findOne','ZendeskField','getFields','length','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','destroy','then','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName'];(function(_0x20c812,_0x3632d0){var _0x5bc85a=function(_0x4417e2){while(--_0x4417e2){_0x20c812['push'](_0x20c812['shift']());}};_0x5bc85a(++_0x3632d0);}(_0xfb29,0x1e4));var _0x9fb2=function(_0x50a7ac,_0x2a656d){_0x50a7ac=_0x50a7ac-0x0;var _0x1116cf=_0xfb29[_0x50a7ac];return _0x1116cf;};'use strict';var emlformat=require(_0x9fb2('0x0'));var rimraf=require(_0x9fb2('0x1'));var zipdir=require(_0x9fb2('0x2'));var jsonpatch=require(_0x9fb2('0x3'));var rp=require(_0x9fb2('0x4'));var moment=require(_0x9fb2('0x5'));var BPromise=require(_0x9fb2('0x6'));var Mustache=require('mustache');var util=require(_0x9fb2('0x7'));var path=require(_0x9fb2('0x8'));var sox=require('sox');var csv=require(_0x9fb2('0x9'));var ejs=require(_0x9fb2('0xa'));var fs=require('fs');var fs_extra=require(_0x9fb2('0xb'));var _=require(_0x9fb2('0xc'));var squel=require(_0x9fb2('0xd'));var crypto=require(_0x9fb2('0xe'));var jsforce=require(_0x9fb2('0xf'));var deskjs=require(_0x9fb2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9fb2('0x11'));var Papa=require(_0x9fb2('0x12'));var Redis=require(_0x9fb2('0x13'));var authService=require(_0x9fb2('0x14'));var qs=require(_0x9fb2('0x15'));var as=require(_0x9fb2('0x16'));var hardwareService=require(_0x9fb2('0x17'));var logger=require(_0x9fb2('0x18'))(_0x9fb2('0x19'));var utils=require(_0x9fb2('0x1a'));var config=require(_0x9fb2('0x1b'));var licenseUtil=require(_0x9fb2('0x1c'));var db=require(_0x9fb2('0x1d'))['db'];function respondWithStatusCode(_0x5938c4,_0x55cd0d){_0x55cd0d=_0x55cd0d||0xcc;return function(_0x116ac3){if(_0x116ac3){return _0x5938c4[_0x9fb2('0x1e')](_0x55cd0d);}return _0x5938c4[_0x9fb2('0x1f')](_0x55cd0d)[_0x9fb2('0x20')]();};}function respondWithResult(_0x468978,_0x48f01f){_0x48f01f=_0x48f01f||0xc8;return function(_0x24e5c3){if(_0x24e5c3){return _0x468978[_0x9fb2('0x1f')](_0x48f01f)[_0x9fb2('0x21')](_0x24e5c3);}};}function respondWithFilteredResult(_0x855258,_0xdd58d1){return function(_0x4fb0f5){if(_0x4fb0f5){var _0x2c1420=typeof _0xdd58d1[_0x9fb2('0x22')]==='undefined'&&typeof _0xdd58d1[_0x9fb2('0x23')]===_0x9fb2('0x24');var _0x5e22d9=_0x4fb0f5['count'];var _0x23f028=_0x2c1420?0x0:_0xdd58d1['offset'];var _0x10f8ee=_0x2c1420?_0x4fb0f5[_0x9fb2('0x25')]:_0xdd58d1[_0x9fb2('0x22')]+_0xdd58d1[_0x9fb2('0x23')];var _0x555ee2;if(_0x10f8ee>=_0x5e22d9){_0x10f8ee=_0x5e22d9;_0x555ee2=0xc8;}else{_0x555ee2=0xce;}_0x855258[_0x9fb2('0x1f')](_0x555ee2);return _0x855258[_0x9fb2('0x26')](_0x9fb2('0x27'),_0x23f028+'-'+_0x10f8ee+'/'+_0x5e22d9)[_0x9fb2('0x21')](_0x4fb0f5);}return null;};}function patchUpdates(_0x276b19){return function(_0x54503a){try{jsonpatch[_0x9fb2('0x28')](_0x54503a,_0x276b19,!![]);}catch(_0x13fddb){return BPromise['reject'](_0x13fddb);}return _0x54503a['save']();};}function saveUpdates(_0x456a53,_0xc305a9){return function(_0x38c50b){if(_0x38c50b){return _0x38c50b['update'](_0x456a53)['then'](function(_0x2b9fc7){return _0x2b9fc7;});}return null;};}function removeEntity(_0xa53f73,_0x3333f8){return function(_0x280817){if(_0x280817){return _0x280817[_0x9fb2('0x29')]()[_0x9fb2('0x2a')](function(){_0xa53f73[_0x9fb2('0x1f')](0xcc)[_0x9fb2('0x20')]();});}};}function handleEntityNotFound(_0x106d16,_0x4c1301){return function(_0x276f49){if(!_0x276f49){_0x106d16['sendStatus'](0x194);}return _0x276f49;};}function handleError(_0x2ce6d5,_0x4ed9fd){_0x4ed9fd=_0x4ed9fd||0x1f4;return function(_0x15da46){logger[_0x9fb2('0x2b')](_0x15da46['stack']);if(_0x15da46[_0x9fb2('0x2c')]){delete _0x15da46[_0x9fb2('0x2c')];}_0x2ce6d5[_0x9fb2('0x1f')](_0x4ed9fd)['send'](_0x15da46);};}exports[_0x9fb2('0x2d')]=function(_0x23a1af,_0x16e2c9){var _0x284370={},_0xbb7aff={},_0x535c33={'count':0x0,'rows':[]};var _0x4e5932=_[_0x9fb2('0x2e')](db[_0x9fb2('0x2f')][_0x9fb2('0x30')],function(_0x5a5384){return{'name':_0x5a5384[_0x9fb2('0x31')],'type':_0x5a5384[_0x9fb2('0x32')][_0x9fb2('0x33')]};});_0xbb7aff[_0x9fb2('0x34')]=_[_0x9fb2('0x2e')](_0x4e5932,'name');_0xbb7aff[_0x9fb2('0x35')]=_['keys'](_0x23a1af[_0x9fb2('0x35')]);_0xbb7aff['filters']=_[_0x9fb2('0x36')](_0xbb7aff['model'],_0xbb7aff[_0x9fb2('0x35')]);_0x284370[_0x9fb2('0x37')]=_[_0x9fb2('0x36')](_0xbb7aff[_0x9fb2('0x34')],qs[_0x9fb2('0x38')](_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x38')]));_0x284370['attributes']=_0x284370[_0x9fb2('0x37')]['length']?_0x284370[_0x9fb2('0x37')]:_0xbb7aff[_0x9fb2('0x34')];if(!_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x39')](_0x9fb2('0x3a'))){_0x284370['limit']=qs[_0x9fb2('0x23')](_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x23')]);_0x284370['offset']=qs[_0x9fb2('0x22')](_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x22')]);}_0x284370[_0x9fb2('0x3b')]=qs[_0x9fb2('0x3c')](_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x3c')]);_0x284370[_0x9fb2('0x3d')]=qs[_0x9fb2('0x3e')](_[_0x9fb2('0x3f')](_0x23a1af[_0x9fb2('0x35')],_0xbb7aff['filters']),_0x4e5932);if(_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x40')]){_0x284370[_0x9fb2('0x3d')]=_[_0x9fb2('0x41')](_0x284370['where'],{'$or':_['map'](_0x4e5932,function(_0x5aeb9c){if(_0x5aeb9c[_0x9fb2('0x32')]!=='VIRTUAL'){var _0x157935={};_0x157935[_0x5aeb9c[_0x9fb2('0x2c')]]={'$like':'%'+_0x23a1af[_0x9fb2('0x35')][_0x9fb2('0x40')]+'%'};return _0x157935;}})});}_0x284370=_[_0x9fb2('0x41')]({},_0x284370,_0x23a1af[_0x9fb2('0x42')]);var _0x3cdba4={'where':_0x284370['where']};return db[_0x9fb2('0x2f')][_0x9fb2('0x25')](_0x3cdba4)[_0x9fb2('0x2a')](function(_0x2e74c1){_0x535c33[_0x9fb2('0x25')]=_0x2e74c1;if(_0x23a1af['query']['includeAll']){_0x284370['include']=[{'all':!![]}];}return db[_0x9fb2('0x2f')][_0x9fb2('0x43')](_0x284370);})['then'](function(_0x2b927b){_0x535c33[_0x9fb2('0x44')]=_0x2b927b;return _0x535c33;})[_0x9fb2('0x2a')](respondWithFilteredResult(_0x16e2c9,_0x284370))['catch'](handleError(_0x16e2c9,null));};exports[_0x9fb2('0x45')]=function(_0xa2b3b1,_0x424702){var _0x2e08cb={'raw':![],'where':{'id':_0xa2b3b1[_0x9fb2('0x46')]['id']}},_0x4a3c55={};_0x4a3c55['model']=_[_0x9fb2('0x47')](db[_0x9fb2('0x2f')]['rawAttributes']);_0x4a3c55['query']=_[_0x9fb2('0x47')](_0xa2b3b1['query']);_0x4a3c55['filters']=_[_0x9fb2('0x36')](_0x4a3c55['model'],_0x4a3c55[_0x9fb2('0x35')]);_0x2e08cb[_0x9fb2('0x37')]=_[_0x9fb2('0x36')](_0x4a3c55['model'],qs[_0x9fb2('0x38')](_0xa2b3b1[_0x9fb2('0x35')][_0x9fb2('0x38')]));_0x2e08cb[_0x9fb2('0x37')]=_0x2e08cb[_0x9fb2('0x37')]['length']?_0x2e08cb[_0x9fb2('0x37')]:_0x4a3c55[_0x9fb2('0x34')];if(_0xa2b3b1[_0x9fb2('0x35')][_0x9fb2('0x48')]){_0x2e08cb[_0x9fb2('0x49')]=[{'all':!![]}];}_0x2e08cb=_[_0x9fb2('0x41')]({},_0x2e08cb,_0xa2b3b1['options']);return db[_0x9fb2('0x2f')][_0x9fb2('0x4a')](_0x2e08cb)[_0x9fb2('0x2a')](handleEntityNotFound(_0x424702,null))[_0x9fb2('0x2a')](respondWithResult(_0x424702,null))[_0x9fb2('0x4b')](handleError(_0x424702,null));};exports[_0x9fb2('0x4c')]=function(_0x3bc2a1,_0x277cc5){return db[_0x9fb2('0x2f')]['create'](_0x3bc2a1[_0x9fb2('0x4d')],{})[_0x9fb2('0x2a')](respondWithResult(_0x277cc5,0xc9))['catch'](handleError(_0x277cc5,null));};exports[_0x9fb2('0x4e')]=function(_0x195d0f,_0x35e7ac){if(_0x195d0f['body']['id']){delete _0x195d0f['body']['id'];}return db[_0x9fb2('0x2f')][_0x9fb2('0x4a')]({'where':{'id':_0x195d0f[_0x9fb2('0x46')]['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x35e7ac,null))[_0x9fb2('0x2a')](saveUpdates(_0x195d0f[_0x9fb2('0x4d')],null))[_0x9fb2('0x2a')](respondWithResult(_0x35e7ac,null))[_0x9fb2('0x4b')](handleError(_0x35e7ac,null));};exports[_0x9fb2('0x29')]=function(_0x1c495f,_0x56bcc3){return db[_0x9fb2('0x2f')][_0x9fb2('0x4a')]({'where':{'id':_0x1c495f['params']['id']}})['then'](handleEntityNotFound(_0x56bcc3,null))['then'](removeEntity(_0x56bcc3,null))[_0x9fb2('0x4b')](handleError(_0x56bcc3,null));};exports['getFields']=function(_0x2f770e,_0x308749,_0x344944){var _0x40e2ca={};var _0x1fa637={};var _0x3f6657;var _0x3a65d8;return db[_0x9fb2('0x2f')][_0x9fb2('0x4f')]({'where':{'id':_0x2f770e['params']['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x308749,null))[_0x9fb2('0x2a')](function(_0xcc6850){if(_0xcc6850){_0x3f6657=_0xcc6850;_0x1fa637[_0x9fb2('0x34')]=_[_0x9fb2('0x47')](db[_0x9fb2('0x50')][_0x9fb2('0x30')]);_0x1fa637['query']=_[_0x9fb2('0x47')](_0x2f770e[_0x9fb2('0x35')]);_0x1fa637[_0x9fb2('0x3e')]=_[_0x9fb2('0x36')](_0x1fa637[_0x9fb2('0x34')],_0x1fa637[_0x9fb2('0x35')]);_0x40e2ca['attributes']=_['intersection'](_0x1fa637['model'],qs[_0x9fb2('0x38')](_0x2f770e['query'][_0x9fb2('0x38')]));_0x40e2ca[_0x9fb2('0x37')]=_0x40e2ca[_0x9fb2('0x37')]['length']?_0x40e2ca[_0x9fb2('0x37')]:_0x1fa637[_0x9fb2('0x34')];_0x40e2ca[_0x9fb2('0x3b')]=qs[_0x9fb2('0x3c')](_0x2f770e[_0x9fb2('0x35')][_0x9fb2('0x3c')]);_0x40e2ca[_0x9fb2('0x3d')]=qs[_0x9fb2('0x3e')](_[_0x9fb2('0x3f')](_0x2f770e[_0x9fb2('0x35')],_0x1fa637[_0x9fb2('0x3e')]));if(_0x2f770e[_0x9fb2('0x35')][_0x9fb2('0x40')]){_0x40e2ca[_0x9fb2('0x3d')]=_['merge'](_0x40e2ca[_0x9fb2('0x3d')],{'$or':_[_0x9fb2('0x2e')](_0x40e2ca[_0x9fb2('0x37')],function(_0x287cd8){var _0x5c5b1f={};_0x5c5b1f[_0x287cd8]={'$like':'%'+_0x2f770e[_0x9fb2('0x35')]['filter']+'%'};return _0x5c5b1f;})});}_0x40e2ca=_[_0x9fb2('0x41')]({},_0x40e2ca,_0x2f770e[_0x9fb2('0x42')]);return _0x3f6657[_0x9fb2('0x51')](_0x40e2ca);}})['then'](function(_0x3198a7){if(_0x3198a7){_0x3a65d8=_0x3198a7[_0x9fb2('0x52')];if(!_0x2f770e['query'][_0x9fb2('0x39')](_0x9fb2('0x3a'))){_0x40e2ca[_0x9fb2('0x23')]=qs['limit'](_0x2f770e['query'][_0x9fb2('0x23')]);_0x40e2ca[_0x9fb2('0x22')]=qs[_0x9fb2('0x22')](_0x2f770e['query'][_0x9fb2('0x22')]);}return _0x3f6657[_0x9fb2('0x51')](_0x40e2ca);}})[_0x9fb2('0x2a')](function(_0xe0f3f1){if(_0xe0f3f1){return _0xe0f3f1?{'count':_0x3a65d8,'rows':_0xe0f3f1}:null;}})[_0x9fb2('0x2a')](respondWithResult(_0x308749,null))[_0x9fb2('0x4b')](handleError(_0x308749,null));};exports[_0x9fb2('0x53')]=function(_0x529755,_0x44b76e,_0x1368f3){var _0x30a3a9={};var _0x2f7566={};var _0x3f2f2e;var _0x25b9ca;return db[_0x9fb2('0x2f')][_0x9fb2('0x4f')]({'where':{'id':_0x529755['params']['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x44b76e,null))[_0x9fb2('0x2a')](function(_0x40b3c0){if(_0x40b3c0){_0x3f2f2e=_0x40b3c0;_0x2f7566['model']=_[_0x9fb2('0x47')](db[_0x9fb2('0x50')][_0x9fb2('0x30')]);_0x2f7566['query']=_['keys'](_0x529755[_0x9fb2('0x35')]);_0x2f7566[_0x9fb2('0x3e')]=_[_0x9fb2('0x36')](_0x2f7566[_0x9fb2('0x34')],_0x2f7566['query']);_0x30a3a9['attributes']=_[_0x9fb2('0x36')](_0x2f7566[_0x9fb2('0x34')],qs[_0x9fb2('0x38')](_0x529755[_0x9fb2('0x35')][_0x9fb2('0x38')]));_0x30a3a9[_0x9fb2('0x37')]=_0x30a3a9[_0x9fb2('0x37')]['length']?_0x30a3a9[_0x9fb2('0x37')]:_0x2f7566[_0x9fb2('0x34')];_0x30a3a9[_0x9fb2('0x3b')]=qs[_0x9fb2('0x3c')](_0x529755['query'][_0x9fb2('0x3c')]);_0x30a3a9['where']=qs['filters'](_[_0x9fb2('0x3f')](_0x529755[_0x9fb2('0x35')],_0x2f7566[_0x9fb2('0x3e')]));if(_0x529755[_0x9fb2('0x35')]['filter']){_0x30a3a9[_0x9fb2('0x3d')]=_['merge'](_0x30a3a9[_0x9fb2('0x3d')],{'$or':_[_0x9fb2('0x2e')](_0x30a3a9[_0x9fb2('0x37')],function(_0x1b57c3){var _0x561d28={};_0x561d28[_0x1b57c3]={'$like':'%'+_0x529755[_0x9fb2('0x35')][_0x9fb2('0x40')]+'%'};return _0x561d28;})});}_0x30a3a9=_['merge']({},_0x30a3a9,_0x529755[_0x9fb2('0x42')]);return _0x3f2f2e[_0x9fb2('0x53')](_0x30a3a9);}})[_0x9fb2('0x2a')](function(_0x30158d){if(_0x30158d){_0x25b9ca=_0x30158d[_0x9fb2('0x52')];if(!_0x529755[_0x9fb2('0x35')][_0x9fb2('0x39')](_0x9fb2('0x3a'))){_0x30a3a9[_0x9fb2('0x23')]=qs[_0x9fb2('0x23')](_0x529755[_0x9fb2('0x35')]['limit']);_0x30a3a9[_0x9fb2('0x22')]=qs[_0x9fb2('0x22')](_0x529755[_0x9fb2('0x35')][_0x9fb2('0x22')]);}return _0x3f2f2e[_0x9fb2('0x53')](_0x30a3a9);}})[_0x9fb2('0x2a')](function(_0xf96093){if(_0xf96093){return _0xf96093?{'count':_0x25b9ca,'rows':_0xf96093}:null;}})[_0x9fb2('0x2a')](respondWithResult(_0x44b76e,null))[_0x9fb2('0x4b')](handleError(_0x44b76e,null));};exports[_0x9fb2('0x54')]=function(_0x3eec04,_0x4c2460,_0x5c9273){var _0x50285e={};var _0x143fe4={};var _0x1800a0;var _0xf39567;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3eec04['params']['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x4c2460,null))[_0x9fb2('0x2a')](function(_0x4804f7){if(_0x4804f7){_0x1800a0=_0x4804f7;_0x143fe4[_0x9fb2('0x34')]=_[_0x9fb2('0x47')](db[_0x9fb2('0x50')]['rawAttributes']);_0x143fe4[_0x9fb2('0x35')]=_['keys'](_0x3eec04['query']);_0x143fe4[_0x9fb2('0x3e')]=_['intersection'](_0x143fe4[_0x9fb2('0x34')],_0x143fe4[_0x9fb2('0x35')]);_0x50285e['attributes']=_[_0x9fb2('0x36')](_0x143fe4['model'],qs[_0x9fb2('0x38')](_0x3eec04['query'][_0x9fb2('0x38')]));_0x50285e['attributes']=_0x50285e['attributes'][_0x9fb2('0x52')]?_0x50285e[_0x9fb2('0x37')]:_0x143fe4['model'];_0x50285e[_0x9fb2('0x3b')]=qs[_0x9fb2('0x3c')](_0x3eec04[_0x9fb2('0x35')][_0x9fb2('0x3c')]);_0x50285e['where']=qs['filters'](_[_0x9fb2('0x3f')](_0x3eec04[_0x9fb2('0x35')],_0x143fe4[_0x9fb2('0x3e')]));if(_0x3eec04[_0x9fb2('0x35')][_0x9fb2('0x40')]){_0x50285e[_0x9fb2('0x3d')]=_[_0x9fb2('0x41')](_0x50285e[_0x9fb2('0x3d')],{'$or':_['map'](_0x50285e[_0x9fb2('0x37')],function(_0x4bc096){var _0x30fb91={};_0x30fb91[_0x4bc096]={'$like':'%'+_0x3eec04['query']['filter']+'%'};return _0x30fb91;})});}_0x50285e=_[_0x9fb2('0x41')]({},_0x50285e,_0x3eec04[_0x9fb2('0x42')]);return _0x1800a0[_0x9fb2('0x54')](_0x50285e);}})[_0x9fb2('0x2a')](function(_0x2f565d){if(_0x2f565d){_0xf39567=_0x2f565d[_0x9fb2('0x52')];if(!_0x3eec04[_0x9fb2('0x35')][_0x9fb2('0x39')]('nolimit')){_0x50285e[_0x9fb2('0x23')]=qs[_0x9fb2('0x23')](_0x3eec04[_0x9fb2('0x35')][_0x9fb2('0x23')]);_0x50285e['offset']=qs[_0x9fb2('0x22')](_0x3eec04[_0x9fb2('0x35')][_0x9fb2('0x22')]);}return _0x1800a0[_0x9fb2('0x54')](_0x50285e);}})[_0x9fb2('0x2a')](function(_0x3e07b6){if(_0x3e07b6){return _0x3e07b6?{'count':_0xf39567,'rows':_0x3e07b6}:null;}})['then'](respondWithResult(_0x4c2460,null))[_0x9fb2('0x4b')](handleError(_0x4c2460,null));};exports['getTags']=function(_0x338752,_0x5909ee,_0x1d22f8){var _0x2e4957={};var _0x520a62={};var _0x500428;var _0x489f1c;return db['ZendeskConfiguration'][_0x9fb2('0x4f')]({'where':{'id':_0x338752['params']['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x5909ee,null))[_0x9fb2('0x2a')](function(_0x31b29a){if(_0x31b29a){_0x500428=_0x31b29a;_0x520a62[_0x9fb2('0x34')]=_['keys'](db[_0x9fb2('0x55')][_0x9fb2('0x30')]);_0x520a62[_0x9fb2('0x35')]=_[_0x9fb2('0x47')](_0x338752[_0x9fb2('0x35')]);_0x520a62['filters']=_[_0x9fb2('0x36')](_0x520a62[_0x9fb2('0x34')],_0x520a62['query']);_0x2e4957['attributes']=_['intersection'](_0x520a62[_0x9fb2('0x34')],qs[_0x9fb2('0x38')](_0x338752['query']['fields']));_0x2e4957[_0x9fb2('0x37')]=_0x2e4957[_0x9fb2('0x37')][_0x9fb2('0x52')]?_0x2e4957['attributes']:_0x520a62[_0x9fb2('0x34')];_0x2e4957['order']=qs['sort'](_0x338752[_0x9fb2('0x35')][_0x9fb2('0x3c')]);_0x2e4957['where']=qs[_0x9fb2('0x3e')](_[_0x9fb2('0x3f')](_0x338752[_0x9fb2('0x35')],_0x520a62[_0x9fb2('0x3e')]));if(_0x338752[_0x9fb2('0x35')]['filter']){_0x2e4957[_0x9fb2('0x3d')]=_['merge'](_0x2e4957[_0x9fb2('0x3d')],{'$or':_[_0x9fb2('0x2e')](_0x2e4957[_0x9fb2('0x37')],function(_0x2a09c3){var _0x5bea97={};_0x5bea97[_0x2a09c3]={'$like':'%'+_0x338752[_0x9fb2('0x35')][_0x9fb2('0x40')]+'%'};return _0x5bea97;})});}_0x2e4957=_[_0x9fb2('0x41')]({},_0x2e4957,_0x338752[_0x9fb2('0x42')]);return _0x500428[_0x9fb2('0x56')](_0x2e4957);}})[_0x9fb2('0x2a')](function(_0x30af04){if(_0x30af04){_0x489f1c=_0x30af04[_0x9fb2('0x52')];if(!_0x338752['query'][_0x9fb2('0x39')](_0x9fb2('0x3a'))){_0x2e4957['limit']=qs['limit'](_0x338752['query'][_0x9fb2('0x23')]);_0x2e4957[_0x9fb2('0x22')]=qs[_0x9fb2('0x22')](_0x338752[_0x9fb2('0x35')]['offset']);}return _0x500428[_0x9fb2('0x56')](_0x2e4957);}})[_0x9fb2('0x2a')](function(_0x165ecb){if(_0x165ecb){return _0x165ecb?{'count':_0x489f1c,'rows':_0x165ecb}:null;}})[_0x9fb2('0x2a')](respondWithResult(_0x5909ee,null))[_0x9fb2('0x4b')](handleError(_0x5909ee,null));};exports[_0x9fb2('0x57')]=function(_0x5ca1db,_0x1bb0b9,_0x60447b){if(_0x5ca1db[_0x9fb2('0x4d')]['id']){delete _0x5ca1db[_0x9fb2('0x4d')]['id'];}return db[_0x9fb2('0x2f')][_0x9fb2('0x4f')]({'where':{'id':_0x5ca1db['params']['id']}})[_0x9fb2('0x2a')](handleEntityNotFound(_0x1bb0b9,null))[_0x9fb2('0x2a')](function(_0x27e379){if(_0x27e379){return _0x27e379[_0x9fb2('0x57')](_0x5ca1db[_0x9fb2('0x4d')][_0x9fb2('0x58')]||[]);}return null;})[_0x9fb2('0x2a')](respondWithResult(_0x1bb0b9,null))[_0x9fb2('0x4b')](handleError(_0x1bb0b9,null));}; \ No newline at end of file +var _0xad92=['where','VIRTUAL','includeAll','findAll','rows','catch','fields','length','merge','options','find','create','body','params','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','nolimit','order','sort','pick','filter'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xad92,0x162));var _0x2ad9=function(_0x5dd7a9,_0xa09a5c){_0x5dd7a9=_0x5dd7a9-0x0;var _0x523b06=_0xad92[_0x5dd7a9];return _0x523b06;};'use strict';var emlformat=require(_0x2ad9('0x0'));var rimraf=require(_0x2ad9('0x1'));var zipdir=require(_0x2ad9('0x2'));var jsonpatch=require(_0x2ad9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2ad9('0x4'));var Mustache=require(_0x2ad9('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2ad9('0x6'));var csv=require(_0x2ad9('0x7'));var ejs=require(_0x2ad9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ad9('0x9'));var squel=require(_0x2ad9('0xa'));var crypto=require('crypto');var jsforce=require(_0x2ad9('0xb'));var deskjs=require(_0x2ad9('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2ad9('0xd'));var Papa=require(_0x2ad9('0xe'));var Redis=require(_0x2ad9('0xf'));var authService=require(_0x2ad9('0x10'));var qs=require(_0x2ad9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ad9('0x12'));var logger=require(_0x2ad9('0x13'))(_0x2ad9('0x14'));var utils=require(_0x2ad9('0x15'));var config=require(_0x2ad9('0x16'));var licenseUtil=require(_0x2ad9('0x17'));var db=require(_0x2ad9('0x18'))['db'];function respondWithStatusCode(_0x1a6263,_0x21d3f6){_0x21d3f6=_0x21d3f6||0xcc;return function(_0x2a36cb){if(_0x2a36cb){return _0x1a6263[_0x2ad9('0x19')](_0x21d3f6);}return _0x1a6263[_0x2ad9('0x1a')](_0x21d3f6)[_0x2ad9('0x1b')]();};}function respondWithResult(_0x35bfea,_0x43ad91){_0x43ad91=_0x43ad91||0xc8;return function(_0x1094db){if(_0x1094db){return _0x35bfea[_0x2ad9('0x1a')](_0x43ad91)[_0x2ad9('0x1c')](_0x1094db);}};}function respondWithFilteredResult(_0x14062f,_0x3beaae){return function(_0x56e552){if(_0x56e552){var _0x1e523a=typeof _0x3beaae[_0x2ad9('0x1d')]===_0x2ad9('0x1e')&&typeof _0x3beaae[_0x2ad9('0x1f')]===_0x2ad9('0x1e');var _0x4c5dc5=_0x56e552[_0x2ad9('0x20')];var _0x332aeb=_0x1e523a?0x0:_0x3beaae[_0x2ad9('0x1d')];var _0x4fba4b=_0x1e523a?_0x56e552[_0x2ad9('0x20')]:_0x3beaae[_0x2ad9('0x1d')]+_0x3beaae['limit'];var _0x1c6b89;if(_0x4fba4b>=_0x4c5dc5){_0x4fba4b=_0x4c5dc5;_0x1c6b89=0xc8;}else{_0x1c6b89=0xce;}_0x14062f[_0x2ad9('0x1a')](_0x1c6b89);return _0x14062f[_0x2ad9('0x21')](_0x2ad9('0x22'),_0x332aeb+'-'+_0x4fba4b+'/'+_0x4c5dc5)[_0x2ad9('0x1c')](_0x56e552);}return null;};}function patchUpdates(_0x1f9da4){return function(_0x244913){try{jsonpatch['apply'](_0x244913,_0x1f9da4,!![]);}catch(_0x26b864){return BPromise[_0x2ad9('0x23')](_0x26b864);}return _0x244913[_0x2ad9('0x24')]();};}function saveUpdates(_0x247d22,_0x24c0c0){return function(_0x33ae8e){if(_0x33ae8e){return _0x33ae8e[_0x2ad9('0x25')](_0x247d22)[_0x2ad9('0x26')](function(_0x272831){return _0x272831;});}return null;};}function removeEntity(_0x5eaa8a,_0x19358b){return function(_0x104719){if(_0x104719){return _0x104719[_0x2ad9('0x27')]()[_0x2ad9('0x26')](function(){_0x5eaa8a[_0x2ad9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51be31,_0x209b0e){return function(_0x401381){if(!_0x401381){_0x51be31[_0x2ad9('0x19')](0x194);}return _0x401381;};}function handleError(_0x3e8bb7,_0x1a1051){_0x1a1051=_0x1a1051||0x1f4;return function(_0x19d695){logger[_0x2ad9('0x28')](_0x19d695[_0x2ad9('0x29')]);if(_0x19d695[_0x2ad9('0x2a')]){delete _0x19d695['name'];}_0x3e8bb7[_0x2ad9('0x1a')](_0x1a1051)[_0x2ad9('0x2b')](_0x19d695);};}exports[_0x2ad9('0x2c')]=function(_0x4c2cf2,_0x3e466d){var _0x1c1e54={},_0x2ab5d9={},_0x1890de={'count':0x0,'rows':[]};var _0x1cf145=_[_0x2ad9('0x2d')](db[_0x2ad9('0x2e')][_0x2ad9('0x2f')],function(_0x8679b8){return{'name':_0x8679b8[_0x2ad9('0x30')],'type':_0x8679b8[_0x2ad9('0x31')]['key']};});_0x2ab5d9['model']=_[_0x2ad9('0x2d')](_0x1cf145,'name');_0x2ab5d9[_0x2ad9('0x32')]=_[_0x2ad9('0x33')](_0x4c2cf2['query']);_0x2ab5d9[_0x2ad9('0x34')]=_[_0x2ad9('0x35')](_0x2ab5d9['model'],_0x2ab5d9[_0x2ad9('0x32')]);_0x1c1e54[_0x2ad9('0x36')]=_[_0x2ad9('0x35')](_0x2ab5d9[_0x2ad9('0x37')],qs['fields'](_0x4c2cf2[_0x2ad9('0x32')]['fields']));_0x1c1e54[_0x2ad9('0x36')]=_0x1c1e54[_0x2ad9('0x36')]['length']?_0x1c1e54[_0x2ad9('0x36')]:_0x2ab5d9[_0x2ad9('0x37')];if(!_0x4c2cf2[_0x2ad9('0x32')]['hasOwnProperty'](_0x2ad9('0x38'))){_0x1c1e54['limit']=qs['limit'](_0x4c2cf2[_0x2ad9('0x32')][_0x2ad9('0x1f')]);_0x1c1e54[_0x2ad9('0x1d')]=qs['offset'](_0x4c2cf2['query'][_0x2ad9('0x1d')]);}_0x1c1e54[_0x2ad9('0x39')]=qs['sort'](_0x4c2cf2[_0x2ad9('0x32')][_0x2ad9('0x3a')]);_0x1c1e54['where']=qs['filters'](_[_0x2ad9('0x3b')](_0x4c2cf2[_0x2ad9('0x32')],_0x2ab5d9[_0x2ad9('0x34')]),_0x1cf145);if(_0x4c2cf2[_0x2ad9('0x32')][_0x2ad9('0x3c')]){_0x1c1e54[_0x2ad9('0x3d')]=_['merge'](_0x1c1e54[_0x2ad9('0x3d')],{'$or':_[_0x2ad9('0x2d')](_0x1cf145,function(_0x6afc79){if(_0x6afc79[_0x2ad9('0x31')]!==_0x2ad9('0x3e')){var _0x125f14={};_0x125f14[_0x6afc79[_0x2ad9('0x2a')]]={'$like':'%'+_0x4c2cf2[_0x2ad9('0x32')][_0x2ad9('0x3c')]+'%'};return _0x125f14;}})});}_0x1c1e54=_['merge']({},_0x1c1e54,_0x4c2cf2['options']);var _0x13a291={'where':_0x1c1e54[_0x2ad9('0x3d')]};return db[_0x2ad9('0x2e')][_0x2ad9('0x20')](_0x13a291)['then'](function(_0x152194){_0x1890de[_0x2ad9('0x20')]=_0x152194;if(_0x4c2cf2[_0x2ad9('0x32')][_0x2ad9('0x3f')]){_0x1c1e54['include']=[{'all':!![]}];}return db[_0x2ad9('0x2e')][_0x2ad9('0x40')](_0x1c1e54);})['then'](function(_0xf2cef8){_0x1890de[_0x2ad9('0x41')]=_0xf2cef8;return _0x1890de;})[_0x2ad9('0x26')](respondWithFilteredResult(_0x3e466d,_0x1c1e54))[_0x2ad9('0x42')](handleError(_0x3e466d,null));};exports['show']=function(_0x440c0e,_0x5184c1){var _0x57d3c0={'raw':![],'where':{'id':_0x440c0e['params']['id']}},_0x375f8e={};_0x375f8e[_0x2ad9('0x37')]=_['keys'](db['ZendeskConfiguration'][_0x2ad9('0x2f')]);_0x375f8e['query']=_['keys'](_0x440c0e[_0x2ad9('0x32')]);_0x375f8e[_0x2ad9('0x34')]=_['intersection'](_0x375f8e['model'],_0x375f8e[_0x2ad9('0x32')]);_0x57d3c0[_0x2ad9('0x36')]=_[_0x2ad9('0x35')](_0x375f8e[_0x2ad9('0x37')],qs[_0x2ad9('0x43')](_0x440c0e[_0x2ad9('0x32')]['fields']));_0x57d3c0[_0x2ad9('0x36')]=_0x57d3c0[_0x2ad9('0x36')][_0x2ad9('0x44')]?_0x57d3c0[_0x2ad9('0x36')]:_0x375f8e[_0x2ad9('0x37')];if(_0x440c0e['query'][_0x2ad9('0x3f')]){_0x57d3c0['include']=[{'all':!![]}];}_0x57d3c0=_[_0x2ad9('0x45')]({},_0x57d3c0,_0x440c0e[_0x2ad9('0x46')]);return db[_0x2ad9('0x2e')][_0x2ad9('0x47')](_0x57d3c0)[_0x2ad9('0x26')](handleEntityNotFound(_0x5184c1,null))[_0x2ad9('0x26')](respondWithResult(_0x5184c1,null))[_0x2ad9('0x42')](handleError(_0x5184c1,null));};exports[_0x2ad9('0x48')]=function(_0x5b03d1,_0x3e26bc){return db[_0x2ad9('0x2e')][_0x2ad9('0x48')](_0x5b03d1['body'],{})[_0x2ad9('0x26')](respondWithResult(_0x3e26bc,0xc9))['catch'](handleError(_0x3e26bc,null));};exports[_0x2ad9('0x25')]=function(_0x3b47bb,_0x4208a4){if(_0x3b47bb[_0x2ad9('0x49')]['id']){delete _0x3b47bb[_0x2ad9('0x49')]['id'];}return db['ZendeskConfiguration'][_0x2ad9('0x47')]({'where':{'id':_0x3b47bb[_0x2ad9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4208a4,null))[_0x2ad9('0x26')](saveUpdates(_0x3b47bb[_0x2ad9('0x49')],null))[_0x2ad9('0x26')](respondWithResult(_0x4208a4,null))['catch'](handleError(_0x4208a4,null));};exports['destroy']=function(_0x230ad0,_0x707fd7){return db[_0x2ad9('0x2e')][_0x2ad9('0x47')]({'where':{'id':_0x230ad0['params']['id']}})[_0x2ad9('0x26')](handleEntityNotFound(_0x707fd7,null))[_0x2ad9('0x26')](removeEntity(_0x707fd7,null))[_0x2ad9('0x42')](handleError(_0x707fd7,null));};exports[_0x2ad9('0x4b')]=function(_0x32171e,_0x4465c5,_0xabe2af){var _0x25bfcc={};var _0x50866a={};var _0x368ec1;var _0x279b10;return db[_0x2ad9('0x2e')][_0x2ad9('0x4c')]({'where':{'id':_0x32171e[_0x2ad9('0x4a')]['id']}})[_0x2ad9('0x26')](handleEntityNotFound(_0x4465c5,null))[_0x2ad9('0x26')](function(_0x2c22a6){if(_0x2c22a6){_0x368ec1=_0x2c22a6;_0x50866a[_0x2ad9('0x37')]=_[_0x2ad9('0x33')](db[_0x2ad9('0x4d')][_0x2ad9('0x2f')]);_0x50866a[_0x2ad9('0x32')]=_['keys'](_0x32171e[_0x2ad9('0x32')]);_0x50866a['filters']=_[_0x2ad9('0x35')](_0x50866a[_0x2ad9('0x37')],_0x50866a['query']);_0x25bfcc[_0x2ad9('0x36')]=_[_0x2ad9('0x35')](_0x50866a[_0x2ad9('0x37')],qs[_0x2ad9('0x43')](_0x32171e[_0x2ad9('0x32')][_0x2ad9('0x43')]));_0x25bfcc[_0x2ad9('0x36')]=_0x25bfcc[_0x2ad9('0x36')]['length']?_0x25bfcc[_0x2ad9('0x36')]:_0x50866a['model'];_0x25bfcc[_0x2ad9('0x39')]=qs['sort'](_0x32171e[_0x2ad9('0x32')][_0x2ad9('0x3a')]);_0x25bfcc[_0x2ad9('0x3d')]=qs[_0x2ad9('0x34')](_[_0x2ad9('0x3b')](_0x32171e[_0x2ad9('0x32')],_0x50866a[_0x2ad9('0x34')]));if(_0x32171e[_0x2ad9('0x32')]['filter']){_0x25bfcc[_0x2ad9('0x3d')]=_[_0x2ad9('0x45')](_0x25bfcc[_0x2ad9('0x3d')],{'$or':_['map'](_0x25bfcc[_0x2ad9('0x36')],function(_0x1f4991){var _0x553c59={};_0x553c59[_0x1f4991]={'$like':'%'+_0x32171e[_0x2ad9('0x32')]['filter']+'%'};return _0x553c59;})});}_0x25bfcc=_[_0x2ad9('0x45')]({},_0x25bfcc,_0x32171e[_0x2ad9('0x46')]);return _0x368ec1[_0x2ad9('0x4b')](_0x25bfcc);}})['then'](function(_0x553a16){if(_0x553a16){_0x279b10=_0x553a16['length'];if(!_0x32171e[_0x2ad9('0x32')][_0x2ad9('0x4e')](_0x2ad9('0x38'))){_0x25bfcc[_0x2ad9('0x1f')]=qs[_0x2ad9('0x1f')](_0x32171e[_0x2ad9('0x32')][_0x2ad9('0x1f')]);_0x25bfcc['offset']=qs[_0x2ad9('0x1d')](_0x32171e[_0x2ad9('0x32')][_0x2ad9('0x1d')]);}return _0x368ec1['getFields'](_0x25bfcc);}})[_0x2ad9('0x26')](function(_0x388ee4){if(_0x388ee4){return _0x388ee4?{'count':_0x279b10,'rows':_0x388ee4}:null;}})[_0x2ad9('0x26')](respondWithResult(_0x4465c5,null))[_0x2ad9('0x42')](handleError(_0x4465c5,null));};exports[_0x2ad9('0x4f')]=function(_0x54e8b4,_0x46806b,_0x417104){var _0x4eaee0={};var _0x4325b6={};var _0x55e108;var _0x1f06af;return db[_0x2ad9('0x2e')][_0x2ad9('0x4c')]({'where':{'id':_0x54e8b4[_0x2ad9('0x4a')]['id']}})[_0x2ad9('0x26')](handleEntityNotFound(_0x46806b,null))[_0x2ad9('0x26')](function(_0xbc50c6){if(_0xbc50c6){_0x55e108=_0xbc50c6;_0x4325b6[_0x2ad9('0x37')]=_[_0x2ad9('0x33')](db[_0x2ad9('0x4d')]['rawAttributes']);_0x4325b6[_0x2ad9('0x32')]=_['keys'](_0x54e8b4['query']);_0x4325b6[_0x2ad9('0x34')]=_[_0x2ad9('0x35')](_0x4325b6['model'],_0x4325b6['query']);_0x4eaee0[_0x2ad9('0x36')]=_[_0x2ad9('0x35')](_0x4325b6['model'],qs[_0x2ad9('0x43')](_0x54e8b4['query'][_0x2ad9('0x43')]));_0x4eaee0[_0x2ad9('0x36')]=_0x4eaee0[_0x2ad9('0x36')]['length']?_0x4eaee0['attributes']:_0x4325b6[_0x2ad9('0x37')];_0x4eaee0[_0x2ad9('0x39')]=qs['sort'](_0x54e8b4[_0x2ad9('0x32')][_0x2ad9('0x3a')]);_0x4eaee0[_0x2ad9('0x3d')]=qs[_0x2ad9('0x34')](_[_0x2ad9('0x3b')](_0x54e8b4['query'],_0x4325b6['filters']));if(_0x54e8b4['query']['filter']){_0x4eaee0[_0x2ad9('0x3d')]=_['merge'](_0x4eaee0[_0x2ad9('0x3d')],{'$or':_[_0x2ad9('0x2d')](_0x4eaee0['attributes'],function(_0x363d38){var _0x3d69ea={};_0x3d69ea[_0x363d38]={'$like':'%'+_0x54e8b4[_0x2ad9('0x32')]['filter']+'%'};return _0x3d69ea;})});}_0x4eaee0=_[_0x2ad9('0x45')]({},_0x4eaee0,_0x54e8b4[_0x2ad9('0x46')]);return _0x55e108['getSubjects'](_0x4eaee0);}})[_0x2ad9('0x26')](function(_0x39c985){if(_0x39c985){_0x1f06af=_0x39c985[_0x2ad9('0x44')];if(!_0x54e8b4[_0x2ad9('0x32')][_0x2ad9('0x4e')](_0x2ad9('0x38'))){_0x4eaee0[_0x2ad9('0x1f')]=qs['limit'](_0x54e8b4[_0x2ad9('0x32')][_0x2ad9('0x1f')]);_0x4eaee0['offset']=qs[_0x2ad9('0x1d')](_0x54e8b4[_0x2ad9('0x32')][_0x2ad9('0x1d')]);}return _0x55e108[_0x2ad9('0x4f')](_0x4eaee0);}})['then'](function(_0x462820){if(_0x462820){return _0x462820?{'count':_0x1f06af,'rows':_0x462820}:null;}})[_0x2ad9('0x26')](respondWithResult(_0x46806b,null))['catch'](handleError(_0x46806b,null));};exports['getDescriptions']=function(_0xcc31d0,_0x9528d7,_0x327952){var _0x4359d6={};var _0x4c1582={};var _0x597995;var _0x387b2e;return db[_0x2ad9('0x2e')][_0x2ad9('0x4c')]({'where':{'id':_0xcc31d0['params']['id']}})['then'](handleEntityNotFound(_0x9528d7,null))[_0x2ad9('0x26')](function(_0x1643ac){if(_0x1643ac){_0x597995=_0x1643ac;_0x4c1582[_0x2ad9('0x37')]=_[_0x2ad9('0x33')](db[_0x2ad9('0x4d')][_0x2ad9('0x2f')]);_0x4c1582['query']=_['keys'](_0xcc31d0[_0x2ad9('0x32')]);_0x4c1582['filters']=_[_0x2ad9('0x35')](_0x4c1582['model'],_0x4c1582[_0x2ad9('0x32')]);_0x4359d6[_0x2ad9('0x36')]=_[_0x2ad9('0x35')](_0x4c1582[_0x2ad9('0x37')],qs['fields'](_0xcc31d0[_0x2ad9('0x32')][_0x2ad9('0x43')]));_0x4359d6[_0x2ad9('0x36')]=_0x4359d6[_0x2ad9('0x36')][_0x2ad9('0x44')]?_0x4359d6['attributes']:_0x4c1582[_0x2ad9('0x37')];_0x4359d6['order']=qs['sort'](_0xcc31d0[_0x2ad9('0x32')][_0x2ad9('0x3a')]);_0x4359d6[_0x2ad9('0x3d')]=qs[_0x2ad9('0x34')](_[_0x2ad9('0x3b')](_0xcc31d0[_0x2ad9('0x32')],_0x4c1582[_0x2ad9('0x34')]));if(_0xcc31d0['query'][_0x2ad9('0x3c')]){_0x4359d6[_0x2ad9('0x3d')]=_['merge'](_0x4359d6[_0x2ad9('0x3d')],{'$or':_[_0x2ad9('0x2d')](_0x4359d6[_0x2ad9('0x36')],function(_0x524daf){var _0x3b2d1a={};_0x3b2d1a[_0x524daf]={'$like':'%'+_0xcc31d0[_0x2ad9('0x32')][_0x2ad9('0x3c')]+'%'};return _0x3b2d1a;})});}_0x4359d6=_[_0x2ad9('0x45')]({},_0x4359d6,_0xcc31d0['options']);return _0x597995['getDescriptions'](_0x4359d6);}})[_0x2ad9('0x26')](function(_0xa34537){if(_0xa34537){_0x387b2e=_0xa34537[_0x2ad9('0x44')];if(!_0xcc31d0['query'][_0x2ad9('0x4e')](_0x2ad9('0x38'))){_0x4359d6[_0x2ad9('0x1f')]=qs['limit'](_0xcc31d0['query'][_0x2ad9('0x1f')]);_0x4359d6['offset']=qs[_0x2ad9('0x1d')](_0xcc31d0['query'][_0x2ad9('0x1d')]);}return _0x597995['getDescriptions'](_0x4359d6);}})['then'](function(_0xa9dc52){if(_0xa9dc52){return _0xa9dc52?{'count':_0x387b2e,'rows':_0xa9dc52}:null;}})[_0x2ad9('0x26')](respondWithResult(_0x9528d7,null))['catch'](handleError(_0x9528d7,null));};exports[_0x2ad9('0x50')]=function(_0x203847,_0x27e7f1,_0x55d785){var _0x4e7e7c={};var _0x52a5cf={};var _0x48c2f1;var _0x36bb24;return db[_0x2ad9('0x2e')][_0x2ad9('0x4c')]({'where':{'id':_0x203847[_0x2ad9('0x4a')]['id']}})[_0x2ad9('0x26')](handleEntityNotFound(_0x27e7f1,null))[_0x2ad9('0x26')](function(_0x47c5ea){if(_0x47c5ea){_0x48c2f1=_0x47c5ea;_0x52a5cf['model']=_['keys'](db[_0x2ad9('0x51')][_0x2ad9('0x2f')]);_0x52a5cf['query']=_[_0x2ad9('0x33')](_0x203847['query']);_0x52a5cf[_0x2ad9('0x34')]=_['intersection'](_0x52a5cf[_0x2ad9('0x37')],_0x52a5cf[_0x2ad9('0x32')]);_0x4e7e7c['attributes']=_[_0x2ad9('0x35')](_0x52a5cf[_0x2ad9('0x37')],qs[_0x2ad9('0x43')](_0x203847[_0x2ad9('0x32')][_0x2ad9('0x43')]));_0x4e7e7c[_0x2ad9('0x36')]=_0x4e7e7c[_0x2ad9('0x36')][_0x2ad9('0x44')]?_0x4e7e7c['attributes']:_0x52a5cf['model'];_0x4e7e7c['order']=qs[_0x2ad9('0x3a')](_0x203847['query'][_0x2ad9('0x3a')]);_0x4e7e7c[_0x2ad9('0x3d')]=qs['filters'](_[_0x2ad9('0x3b')](_0x203847[_0x2ad9('0x32')],_0x52a5cf[_0x2ad9('0x34')]));if(_0x203847[_0x2ad9('0x32')][_0x2ad9('0x3c')]){_0x4e7e7c[_0x2ad9('0x3d')]=_[_0x2ad9('0x45')](_0x4e7e7c[_0x2ad9('0x3d')],{'$or':_[_0x2ad9('0x2d')](_0x4e7e7c[_0x2ad9('0x36')],function(_0x56e9da){var _0x2bf955={};_0x2bf955[_0x56e9da]={'$like':'%'+_0x203847['query'][_0x2ad9('0x3c')]+'%'};return _0x2bf955;})});}_0x4e7e7c=_[_0x2ad9('0x45')]({},_0x4e7e7c,_0x203847[_0x2ad9('0x46')]);return _0x48c2f1['getTags'](_0x4e7e7c);}})[_0x2ad9('0x26')](function(_0x2ef745){if(_0x2ef745){_0x36bb24=_0x2ef745['length'];if(!_0x203847[_0x2ad9('0x32')][_0x2ad9('0x4e')](_0x2ad9('0x38'))){_0x4e7e7c[_0x2ad9('0x1f')]=qs[_0x2ad9('0x1f')](_0x203847['query'][_0x2ad9('0x1f')]);_0x4e7e7c[_0x2ad9('0x1d')]=qs[_0x2ad9('0x1d')](_0x203847[_0x2ad9('0x32')]['offset']);}return _0x48c2f1[_0x2ad9('0x50')](_0x4e7e7c);}})[_0x2ad9('0x26')](function(_0xed7913){if(_0xed7913){return _0xed7913?{'count':_0x36bb24,'rows':_0xed7913}:null;}})[_0x2ad9('0x26')](respondWithResult(_0x27e7f1,null))[_0x2ad9('0x42')](handleError(_0x27e7f1,null));};exports[_0x2ad9('0x52')]=function(_0xca57c1,_0x38c481,_0x5ea833){if(_0xca57c1[_0x2ad9('0x49')]['id']){delete _0xca57c1['body']['id'];}return db[_0x2ad9('0x2e')][_0x2ad9('0x4c')]({'where':{'id':_0xca57c1['params']['id']}})['then'](handleEntityNotFound(_0x38c481,null))['then'](function(_0x3fbfca){if(_0x3fbfca){return _0x3fbfca[_0x2ad9('0x52')](_0xca57c1[_0x2ad9('0x49')]['ids']||[]);}return null;})[_0x2ad9('0x26')](respondWithResult(_0x38c481,null))['catch'](handleError(_0x38c481,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index ad0c346..9ba2e6d 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 _0xaebd=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x189a31,_0xc76d59){var _0x5c130a=function(_0x4a5cb4){while(--_0x4a5cb4){_0x189a31['push'](_0x189a31['shift']());}};_0x5c130a(++_0xc76d59);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x137dd4,_0xd7f294){_0x137dd4=_0x137dd4-0x0;var _0x1afaa1=_0xaebd[_0x137dd4];return _0x1afaa1;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var logger=require(_0xdaeb('0x1'))(_0xdaeb('0x2'));var moment=require(_0xdaeb('0x3'));var BPromise=require(_0xdaeb('0x4'));var rp=require(_0xdaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaeb('0x6'));var config=require(_0xdaeb('0x7'));var attributes=require(_0xdaeb('0x8'));module[_0xdaeb('0x9')]=function(_0xee94f9,_0x4b7255){return _0xee94f9[_0xdaeb('0xa')](_0xdaeb('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x54c72d,_0x4ecea1){var _0x328b21=function(_0x50746e){while(--_0x50746e){_0x54c72d['push'](_0x54c72d['shift']());}};_0x328b21(++_0x4ecea1);}(_0x056b,0xb6));var _0xb056=function(_0x339da2,_0x3aa23a){_0x339da2=_0x339da2-0x0;var _0x4c6e10=_0x056b[_0x339da2];return _0x4c6e10;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'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 8489657..6c6e14f 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 _0x7f9d=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0x7f9d,0x1b6));var _0xd7f9=function(_0x199cd8,_0xee22ad){_0x199cd8=_0x199cd8-0x0;var _0x160291=_0x7f9d[_0x199cd8];return _0x160291;};'use strict';var _=require(_0xd7f9('0x0'));var util=require('util');var moment=require(_0xd7f9('0x1'));var BPromise=require(_0xd7f9('0x2'));var rs=require(_0xd7f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7f9('0x4'))['db'];var utils=require(_0xd7f9('0x5'));var logger=require(_0xd7f9('0x6'))(_0xd7f9('0x7'));var config=require(_0xd7f9('0x8'));var jayson=require(_0xd7f9('0x9'));var client=jayson[_0xd7f9('0xa')][_0xd7f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e2cf,_0x5d277d,_0x55d334){return new BPromise(function(_0x1987d4,_0x10d0c4){return client['request'](_0x37e2cf,_0x55d334)[_0xd7f9('0xc')](function(_0x5f0d42){logger[_0xd7f9('0xd')](_0xd7f9('0xe'),_0x5d277d,_0xd7f9('0xf'));logger['debug'](_0xd7f9('0x10'),_0x5d277d,_0xd7f9('0xf'),JSON[_0xd7f9('0x11')](_0x5f0d42));if(_0x5f0d42['error']){if(_0x5f0d42['error'][_0xd7f9('0x12')]===0x1f4){logger[_0xd7f9('0x13')](_0xd7f9('0xe'),_0x5d277d,_0x5f0d42[_0xd7f9('0x13')][_0xd7f9('0x14')]);return _0x10d0c4(_0x5f0d42[_0xd7f9('0x13')][_0xd7f9('0x14')]);}logger[_0xd7f9('0x13')](_0xd7f9('0xe'),_0x5d277d,_0x5f0d42[_0xd7f9('0x13')][_0xd7f9('0x14')]);return _0x1987d4(_0x5f0d42['error'][_0xd7f9('0x14')]);}else{logger[_0xd7f9('0xd')](_0xd7f9('0xe'),_0x5d277d,'request\x20sent');_0x1987d4(_0x5f0d42[_0xd7f9('0x15')][_0xd7f9('0x14')]);}})[_0xd7f9('0x16')](function(_0x250f1a){logger[_0xd7f9('0x13')](_0xd7f9('0xe'),_0x5d277d,_0x250f1a);_0x10d0c4(_0x250f1a);});});} \ No newline at end of file +var _0x3140=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x20e5fe,_0x412dc7){var _0x507ed1=function(_0x389b72){while(--_0x389b72){_0x20e5fe['push'](_0x20e5fe['shift']());}};_0x507ed1(++_0x412dc7);}(_0x3140,0x184));var _0x0314=function(_0x8153ce,_0xcb6429){_0x8153ce=_0x8153ce-0x0;var _0x3294bc=_0x3140[_0x8153ce];return _0x3294bc;};'use strict';var _=require('lodash');var util=require(_0x0314('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0314('0x1'));var db=require(_0x0314('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0314('0x3'));var config=require(_0x0314('0x4'));var jayson=require(_0x0314('0x5'));var client=jayson[_0x0314('0x6')][_0x0314('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27be7a,_0x2445ad,_0xabcd31){return new BPromise(function(_0x5510ef,_0x53512c){return client[_0x0314('0x8')](_0x27be7a,_0xabcd31)[_0x0314('0x9')](function(_0x29bf27){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x2445ad,'request\x20sent');logger[_0x0314('0xa')](_0x0314('0xb'),_0x2445ad,_0x0314('0xc'),JSON['stringify'](_0x29bf27));if(_0x29bf27['error']){if(_0x29bf27[_0x0314('0xd')]['code']===0x1f4){logger[_0x0314('0xd')](_0x0314('0xe'),_0x2445ad,_0x29bf27[_0x0314('0xd')]['message']);return _0x53512c(_0x29bf27[_0x0314('0xd')]['message']);}logger[_0x0314('0xd')](_0x0314('0xe'),_0x2445ad,_0x29bf27['error'][_0x0314('0xf')]);return _0x5510ef(_0x29bf27['error'][_0x0314('0xf')]);}else{logger[_0x0314('0x10')](_0x0314('0xe'),_0x2445ad,_0x0314('0xc'));_0x5510ef(_0x29bf27[_0x0314('0x11')][_0x0314('0xf')]);}})[_0x0314('0x12')](function(_0x2b05bb){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2445ad,_0x2b05bb);_0x53512c(_0x2b05bb);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cd49b74..7cadf10 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 _0xf981=['get','index','post','isAuthenticated','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZendeskField.controller'];(function(_0x9226f2,_0x57d5e7){var _0x25da7e=function(_0x363d5e){while(--_0x363d5e){_0x9226f2['push'](_0x9226f2['shift']());}};_0x25da7e(++_0x57d5e7);}(_0xf981,0x117));var _0x1f98=function(_0x14114d,_0x220d58){_0x14114d=_0x14114d-0x0;var _0x1c4009=_0xf981[_0x14114d];return _0x1c4009;};'use strict';var multer=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var path=require(_0x1f98('0x2'));var timeout=require(_0x1f98('0x3'));var express=require(_0x1f98('0x4'));var router=express[_0x1f98('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1f98('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1f98('0x7'));var controller=require(_0x1f98('0x8'));router[_0x1f98('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f98('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1f98('0xb')]('/',auth[_0x1f98('0xc')](),controller[_0x1f98('0xd')]);router['put'](_0x1f98('0xe'),auth[_0x1f98('0xc')](),controller[_0x1f98('0xf')]);router[_0x1f98('0x10')](_0x1f98('0xe'),auth[_0x1f98('0xc')](),controller[_0x1f98('0x11')]);module['exports']=router; \ No newline at end of file +var _0x823d=['isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x823d,0x183));var _0xd823=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x823d[_0x2fe689];return _0x35ea44;};'use strict';var multer=require(_0xd823('0x0'));var util=require('util');var path=require(_0xd823('0x1'));var timeout=require(_0xd823('0x2'));var express=require(_0xd823('0x3'));var router=express['Router']();var fs_extra=require(_0xd823('0x4'));var auth=require(_0xd823('0x5'));var interaction=require(_0xd823('0x6'));var config=require(_0xd823('0x7'));var controller=require('./intZendeskField.controller');router[_0xd823('0x8')]('/',auth[_0xd823('0x9')](),controller[_0xd823('0xa')]);router[_0xd823('0x8')](_0xd823('0xb'),auth['isAuthenticated'](),controller[_0xd823('0xc')]);router[_0xd823('0xd')]('/',auth[_0xd823('0x9')](),controller['create']);router['put'](_0xd823('0xb'),auth[_0xd823('0x9')](),controller[_0xd823('0xe')]);router[_0xd823('0xf')]('/:id',auth[_0xd823('0x9')](),controller[_0xd823('0x10')]);module[_0xd823('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 86b6d3c..a0f1cdf 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 _0xb5a4=['picklist','string','STRING','ENUM','sequelize','exports','variable','customVariable','keyValue'];(function(_0x279299,_0x3731bb){var _0x8d6208=function(_0x40c89a){while(--_0x40c89a){_0x279299['push'](_0x279299['shift']());}};_0x8d6208(++_0x3731bb);}(_0xb5a4,0x1cf));var _0x4b5a=function(_0x2e9dd2,_0x3e1892){_0x2e9dd2=_0x2e9dd2-0x0;var _0x3e735c=_0xb5a4[_0x2e9dd2];return _0x3e735c;};'use strict';var Sequelize=require(_0x4b5a('0x0'));module[_0x4b5a('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4b5a('0x2'),_0x4b5a('0x3'),_0x4b5a('0x4'),_0x4b5a('0x5')),'defaultValue':_0x4b5a('0x6')},'content':{'type':Sequelize[_0x4b5a('0x7')]},'key':{'type':Sequelize[_0x4b5a('0x7')]},'keyType':{'type':Sequelize[_0x4b5a('0x8')](_0x4b5a('0x6'),_0x4b5a('0x2'),_0x4b5a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4b5a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b5a('0x7')]}}; \ No newline at end of file +var _0x1e82=['ENUM','BOOLEAN','string','customVariable','picklist','STRING'];(function(_0x2dbbd2,_0x419a02){var _0x270c14=function(_0x269fd4){while(--_0x269fd4){_0x2dbbd2['push'](_0x2dbbd2['shift']());}};_0x270c14(++_0x419a02);}(_0x1e82,0xda));var _0x21e8=function(_0x1084d4,_0x32da99){_0x1084d4=_0x1084d4-0x0;var _0x13ee62=_0x1e82[_0x1084d4];return _0x13ee62;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x21e8('0x0'),'variable',_0x21e8('0x1'),'keyValue',_0x21e8('0x2')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x21e8('0x3')]},'keyType':{'type':Sequelize[_0x21e8('0x4')](_0x21e8('0x0'),'variable',_0x21e8('0x1'))},'keyContent':{'type':Sequelize[_0x21e8('0x3')]},'idField':{'type':Sequelize[_0x21e8('0x3')]},'nameField':{'type':Sequelize[_0x21e8('0x3')]},'customField':{'type':Sequelize[_0x21e8('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x21e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 2527be5..982831f 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 _0x846f=['body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','reject','then','destroy','end','sendStatus','error','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','find','create'];(function(_0x5f2f28,_0x21ad9c){var _0x2601e1=function(_0x2a2d0a){while(--_0x2a2d0a){_0x5f2f28['push'](_0x5f2f28['shift']());}};_0x2601e1(++_0x21ad9c);}(_0x846f,0x93));var _0xf846=function(_0x239cfe,_0x1b6b4c){_0x239cfe=_0x239cfe-0x0;var _0x4c2b99=_0x846f[_0x239cfe];return _0x4c2b99;};'use strict';var emlformat=require(_0xf846('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf846('0x1'));var jsonpatch=require(_0xf846('0x2'));var rp=require(_0xf846('0x3'));var moment=require('moment');var BPromise=require(_0xf846('0x4'));var Mustache=require(_0xf846('0x5'));var util=require(_0xf846('0x6'));var path=require(_0xf846('0x7'));var sox=require(_0xf846('0x8'));var csv=require('to-csv');var ejs=require(_0xf846('0x9'));var fs=require('fs');var fs_extra=require(_0xf846('0xa'));var _=require(_0xf846('0xb'));var squel=require(_0xf846('0xc'));var crypto=require(_0xf846('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf846('0xe'));var querystring=require(_0xf846('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf846('0x10'));var hardwareService=require(_0xf846('0x11'));var logger=require('../../config/logger')(_0xf846('0x12'));var utils=require(_0xf846('0x13'));var config=require(_0xf846('0x14'));var licenseUtil=require(_0xf846('0x15'));var db=require(_0xf846('0x16'))['db'];function respondWithStatusCode(_0x28e634,_0x55ddb1){_0x55ddb1=_0x55ddb1||0xcc;return function(_0x145449){if(_0x145449){return _0x28e634['sendStatus'](_0x55ddb1);}return _0x28e634['status'](_0x55ddb1)['end']();};}function respondWithResult(_0x81f7cd,_0xc3d1ef){_0xc3d1ef=_0xc3d1ef||0xc8;return function(_0x5b9f9e){if(_0x5b9f9e){return _0x81f7cd[_0xf846('0x17')](_0xc3d1ef)['json'](_0x5b9f9e);}};}function respondWithFilteredResult(_0x548fbf,_0x4cb115){return function(_0x59fe82){if(_0x59fe82){var _0x1e3c2b=typeof _0x4cb115[_0xf846('0x18')]===_0xf846('0x19')&&typeof _0x4cb115[_0xf846('0x1a')]===_0xf846('0x19');var _0x578e61=_0x59fe82['count'];var _0x231dd1=_0x1e3c2b?0x0:_0x4cb115['offset'];var _0x716f7d=_0x1e3c2b?_0x59fe82['count']:_0x4cb115[_0xf846('0x18')]+_0x4cb115['limit'];var _0x20e95e;if(_0x716f7d>=_0x578e61){_0x716f7d=_0x578e61;_0x20e95e=0xc8;}else{_0x20e95e=0xce;}_0x548fbf[_0xf846('0x17')](_0x20e95e);return _0x548fbf[_0xf846('0x1b')](_0xf846('0x1c'),_0x231dd1+'-'+_0x716f7d+'/'+_0x578e61)[_0xf846('0x1d')](_0x59fe82);}return null;};}function patchUpdates(_0x26a976){return function(_0x48d276){try{jsonpatch['apply'](_0x48d276,_0x26a976,!![]);}catch(_0x50f244){return BPromise[_0xf846('0x1e')](_0x50f244);}return _0x48d276['save']();};}function saveUpdates(_0x300e11,_0x17e4fa){return function(_0x5c2e05){if(_0x5c2e05){return _0x5c2e05['update'](_0x300e11)[_0xf846('0x1f')](function(_0x123d2d){return _0x123d2d;});}return null;};}function removeEntity(_0x32a00d,_0x5d18a9){return function(_0xe2dfa2){if(_0xe2dfa2){return _0xe2dfa2[_0xf846('0x20')]()[_0xf846('0x1f')](function(){_0x32a00d['status'](0xcc)[_0xf846('0x21')]();});}};}function handleEntityNotFound(_0x51e458,_0x1d8dc4){return function(_0x19602a){if(!_0x19602a){_0x51e458[_0xf846('0x22')](0x194);}return _0x19602a;};}function handleError(_0x58e045,_0x11ac05){_0x11ac05=_0x11ac05||0x1f4;return function(_0x575ddb){logger[_0xf846('0x23')](_0x575ddb['stack']);if(_0x575ddb[_0xf846('0x24')]){delete _0x575ddb[_0xf846('0x24')];}_0x58e045['status'](_0x11ac05)[_0xf846('0x25')](_0x575ddb);};}exports[_0xf846('0x26')]=function(_0x4f756a,_0x1ffdff){var _0x4b3629={},_0x3e49f5={},_0x367981={'count':0x0,'rows':[]};var _0x3dda7e=_['map'](db[_0xf846('0x27')][_0xf846('0x28')],function(_0x1dbdab){return{'name':_0x1dbdab[_0xf846('0x29')],'type':_0x1dbdab[_0xf846('0x2a')][_0xf846('0x2b')]};});_0x3e49f5['model']=_[_0xf846('0x2c')](_0x3dda7e,_0xf846('0x24'));_0x3e49f5[_0xf846('0x2d')]=_[_0xf846('0x2e')](_0x4f756a[_0xf846('0x2d')]);_0x3e49f5[_0xf846('0x2f')]=_[_0xf846('0x30')](_0x3e49f5[_0xf846('0x31')],_0x3e49f5['query']);_0x4b3629['attributes']=_[_0xf846('0x30')](_0x3e49f5['model'],qs['fields'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x32')]));_0x4b3629['attributes']=_0x4b3629[_0xf846('0x33')][_0xf846('0x34')]?_0x4b3629[_0xf846('0x33')]:_0x3e49f5[_0xf846('0x31')];if(!_0x4f756a[_0xf846('0x2d')][_0xf846('0x35')]('nolimit')){_0x4b3629['limit']=qs[_0xf846('0x1a')](_0x4f756a[_0xf846('0x2d')][_0xf846('0x1a')]);_0x4b3629['offset']=qs['offset'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x18')]);}_0x4b3629[_0xf846('0x36')]=qs[_0xf846('0x37')](_0x4f756a[_0xf846('0x2d')]['sort']);_0x4b3629[_0xf846('0x38')]=qs[_0xf846('0x2f')](_[_0xf846('0x39')](_0x4f756a['query'],_0x3e49f5[_0xf846('0x2f')]),_0x3dda7e);if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]){_0x4b3629[_0xf846('0x38')]=_[_0xf846('0x3b')](_0x4b3629[_0xf846('0x38')],{'$or':_[_0xf846('0x2c')](_0x3dda7e,function(_0x181387){if(_0x181387[_0xf846('0x2a')]!==_0xf846('0x3c')){var _0x4bce39={};_0x4bce39[_0x181387[_0xf846('0x24')]]={'$like':'%'+_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]+'%'};return _0x4bce39;}})});}_0x4b3629=_[_0xf846('0x3b')]({},_0x4b3629,_0x4f756a['options']);var _0x3085e9={'where':_0x4b3629[_0xf846('0x38')]};return db[_0xf846('0x27')][_0xf846('0x3d')](_0x3085e9)[_0xf846('0x1f')](function(_0x39fd69){_0x367981[_0xf846('0x3d')]=_0x39fd69;if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3e')]){_0x4b3629[_0xf846('0x3f')]=[{'all':!![]}];}return db[_0xf846('0x27')]['findAll'](_0x4b3629);})['then'](function(_0x187e01){_0x367981[_0xf846('0x40')]=_0x187e01;return _0x367981;})['then'](respondWithFilteredResult(_0x1ffdff,_0x4b3629))[_0xf846('0x41')](handleError(_0x1ffdff,null));};exports[_0xf846('0x42')]=function(_0x5edd68,_0xbf92a6){var _0x6fa310={'raw':!![],'where':{'id':_0x5edd68['params']['id']}},_0x36cc3b={};_0x36cc3b[_0xf846('0x31')]=_[_0xf846('0x2e')](db[_0xf846('0x27')][_0xf846('0x28')]);_0x36cc3b['query']=_[_0xf846('0x2e')](_0x5edd68['query']);_0x36cc3b['filters']=_[_0xf846('0x30')](_0x36cc3b[_0xf846('0x31')],_0x36cc3b['query']);_0x6fa310[_0xf846('0x33')]=_['intersection'](_0x36cc3b[_0xf846('0x31')],qs[_0xf846('0x32')](_0x5edd68[_0xf846('0x2d')]['fields']));_0x6fa310[_0xf846('0x33')]=_0x6fa310['attributes'][_0xf846('0x34')]?_0x6fa310[_0xf846('0x33')]:_0x36cc3b[_0xf846('0x31')];if(_0x5edd68[_0xf846('0x2d')]['includeAll']){_0x6fa310[_0xf846('0x3f')]=[{'all':!![]}];}_0x6fa310=_[_0xf846('0x3b')]({},_0x6fa310,_0x5edd68['options']);return db['ZendeskField'][_0xf846('0x43')](_0x6fa310)['then'](handleEntityNotFound(_0xbf92a6,null))['then'](respondWithResult(_0xbf92a6,null))['catch'](handleError(_0xbf92a6,null));};exports['create']=function(_0x43a4f5,_0x5b6427){return db[_0xf846('0x27')][_0xf846('0x44')](_0x43a4f5[_0xf846('0x45')],{})[_0xf846('0x1f')](respondWithResult(_0x5b6427,0xc9))['catch'](handleError(_0x5b6427,null));};exports[_0xf846('0x46')]=function(_0x44cfb8,_0x271afc){if(_0x44cfb8['body']['id']){delete _0x44cfb8['body']['id'];}return db[_0xf846('0x27')][_0xf846('0x43')]({'where':{'id':_0x44cfb8[_0xf846('0x47')]['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x271afc,null))[_0xf846('0x1f')](saveUpdates(_0x44cfb8[_0xf846('0x45')],null))[_0xf846('0x1f')](respondWithResult(_0x271afc,null))[_0xf846('0x41')](handleError(_0x271afc,null));};exports[_0xf846('0x20')]=function(_0x17df95,_0x30e072){return db['ZendeskField'][_0xf846('0x43')]({'where':{'id':_0x17df95['params']['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x30e072,null))['then'](removeEntity(_0x30e072,null))[_0xf846('0x41')](handleError(_0x30e072,null));}; \ No newline at end of file +var _0x1b9f=['query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','include','findAll','rows','show','intersection','options','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','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/environment','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','key','model'];(function(_0x4e0e81,_0x41db20){var _0x4423ed=function(_0xe6d2d8){while(--_0xe6d2d8){_0x4e0e81['push'](_0x4e0e81['shift']());}};_0x4423ed(++_0x41db20);}(_0x1b9f,0x141));var _0xf1b9=function(_0x22b044,_0x1fe58a){_0x22b044=_0x22b044-0x0;var _0x1003c2=_0x1b9f[_0x22b044];return _0x1003c2;};'use strict';var emlformat=require(_0xf1b9('0x0'));var rimraf=require(_0xf1b9('0x1'));var zipdir=require(_0xf1b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1b9('0x3'));var moment=require(_0xf1b9('0x4'));var BPromise=require(_0xf1b9('0x5'));var Mustache=require(_0xf1b9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf1b9('0x7'));var csv=require(_0xf1b9('0x8'));var ejs=require(_0xf1b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf1b9('0xa'));var crypto=require(_0xf1b9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf1b9('0xc'));var toCsv=require(_0xf1b9('0x8'));var querystring=require(_0xf1b9('0xd'));var Papa=require(_0xf1b9('0xe'));var Redis=require(_0xf1b9('0xf'));var authService=require(_0xf1b9('0x10'));var qs=require(_0xf1b9('0x11'));var as=require(_0xf1b9('0x12'));var hardwareService=require(_0xf1b9('0x13'));var logger=require(_0xf1b9('0x14'))(_0xf1b9('0x15'));var utils=require('../../config/utils');var config=require(_0xf1b9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1b9('0x17'))['db'];function respondWithStatusCode(_0x3299bb,_0x5c6a9b){_0x5c6a9b=_0x5c6a9b||0xcc;return function(_0xe7c5ae){if(_0xe7c5ae){return _0x3299bb['sendStatus'](_0x5c6a9b);}return _0x3299bb[_0xf1b9('0x18')](_0x5c6a9b)['end']();};}function respondWithResult(_0x47cf79,_0x39bec5){_0x39bec5=_0x39bec5||0xc8;return function(_0x556876){if(_0x556876){return _0x47cf79[_0xf1b9('0x18')](_0x39bec5)[_0xf1b9('0x19')](_0x556876);}};}function respondWithFilteredResult(_0x30d023,_0x41e514){return function(_0x4661f8){if(_0x4661f8){var _0x2a9d86=typeof _0x41e514[_0xf1b9('0x1a')]===_0xf1b9('0x1b')&&typeof _0x41e514[_0xf1b9('0x1c')]==='undefined';var _0x57c94c=_0x4661f8[_0xf1b9('0x1d')];var _0x364811=_0x2a9d86?0x0:_0x41e514[_0xf1b9('0x1a')];var _0x33f21e=_0x2a9d86?_0x4661f8[_0xf1b9('0x1d')]:_0x41e514[_0xf1b9('0x1a')]+_0x41e514['limit'];var _0x1f29ac;if(_0x33f21e>=_0x57c94c){_0x33f21e=_0x57c94c;_0x1f29ac=0xc8;}else{_0x1f29ac=0xce;}_0x30d023[_0xf1b9('0x18')](_0x1f29ac);return _0x30d023['set'](_0xf1b9('0x1e'),_0x364811+'-'+_0x33f21e+'/'+_0x57c94c)[_0xf1b9('0x19')](_0x4661f8);}return null;};}function patchUpdates(_0xf3a0cc){return function(_0x35ceaf){try{jsonpatch[_0xf1b9('0x1f')](_0x35ceaf,_0xf3a0cc,!![]);}catch(_0x2d6594){return BPromise[_0xf1b9('0x20')](_0x2d6594);}return _0x35ceaf[_0xf1b9('0x21')]();};}function saveUpdates(_0x24c447,_0x2ebdf0){return function(_0x2bb06f){if(_0x2bb06f){return _0x2bb06f[_0xf1b9('0x22')](_0x24c447)[_0xf1b9('0x23')](function(_0x5374d7){return _0x5374d7;});}return null;};}function removeEntity(_0x55c095,_0x369c49){return function(_0x216612){if(_0x216612){return _0x216612['destroy']()[_0xf1b9('0x23')](function(){_0x55c095[_0xf1b9('0x18')](0xcc)[_0xf1b9('0x24')]();});}};}function handleEntityNotFound(_0x4413ba,_0x127777){return function(_0x2efd41){if(!_0x2efd41){_0x4413ba[_0xf1b9('0x25')](0x194);}return _0x2efd41;};}function handleError(_0x47c842,_0x435997){_0x435997=_0x435997||0x1f4;return function(_0x589ebe){logger[_0xf1b9('0x26')](_0x589ebe[_0xf1b9('0x27')]);if(_0x589ebe[_0xf1b9('0x28')]){delete _0x589ebe[_0xf1b9('0x28')];}_0x47c842[_0xf1b9('0x18')](_0x435997)[_0xf1b9('0x29')](_0x589ebe);};}exports[_0xf1b9('0x2a')]=function(_0xf01c8a,_0x126666){var _0x19e5c0={},_0x225e3d={},_0x4bea9b={'count':0x0,'rows':[]};var _0xd489a7=_[_0xf1b9('0x2b')](db[_0xf1b9('0x2c')][_0xf1b9('0x2d')],function(_0x3f4738){return{'name':_0x3f4738['fieldName'],'type':_0x3f4738[_0xf1b9('0x2e')][_0xf1b9('0x2f')]};});_0x225e3d[_0xf1b9('0x30')]=_[_0xf1b9('0x2b')](_0xd489a7,_0xf1b9('0x28'));_0x225e3d[_0xf1b9('0x31')]=_[_0xf1b9('0x32')](_0xf01c8a[_0xf1b9('0x31')]);_0x225e3d[_0xf1b9('0x33')]=_['intersection'](_0x225e3d[_0xf1b9('0x30')],_0x225e3d[_0xf1b9('0x31')]);_0x19e5c0['attributes']=_['intersection'](_0x225e3d['model'],qs[_0xf1b9('0x34')](_0xf01c8a['query'][_0xf1b9('0x34')]));_0x19e5c0[_0xf1b9('0x35')]=_0x19e5c0[_0xf1b9('0x35')][_0xf1b9('0x36')]?_0x19e5c0[_0xf1b9('0x35')]:_0x225e3d[_0xf1b9('0x30')];if(!_0xf01c8a[_0xf1b9('0x31')][_0xf1b9('0x37')](_0xf1b9('0x38'))){_0x19e5c0['limit']=qs[_0xf1b9('0x1c')](_0xf01c8a[_0xf1b9('0x31')][_0xf1b9('0x1c')]);_0x19e5c0['offset']=qs[_0xf1b9('0x1a')](_0xf01c8a[_0xf1b9('0x31')]['offset']);}_0x19e5c0[_0xf1b9('0x39')]=qs[_0xf1b9('0x3a')](_0xf01c8a[_0xf1b9('0x31')][_0xf1b9('0x3a')]);_0x19e5c0['where']=qs[_0xf1b9('0x33')](_['pick'](_0xf01c8a[_0xf1b9('0x31')],_0x225e3d[_0xf1b9('0x33')]),_0xd489a7);if(_0xf01c8a[_0xf1b9('0x31')][_0xf1b9('0x3b')]){_0x19e5c0[_0xf1b9('0x3c')]=_[_0xf1b9('0x3d')](_0x19e5c0['where'],{'$or':_[_0xf1b9('0x2b')](_0xd489a7,function(_0x39d8a7){if(_0x39d8a7['type']!=='VIRTUAL'){var _0xca32ef={};_0xca32ef[_0x39d8a7[_0xf1b9('0x28')]]={'$like':'%'+_0xf01c8a['query'][_0xf1b9('0x3b')]+'%'};return _0xca32ef;}})});}_0x19e5c0=_['merge']({},_0x19e5c0,_0xf01c8a['options']);var _0x21505e={'where':_0x19e5c0[_0xf1b9('0x3c')]};return db[_0xf1b9('0x2c')][_0xf1b9('0x1d')](_0x21505e)[_0xf1b9('0x23')](function(_0x5c5c2b){_0x4bea9b['count']=_0x5c5c2b;if(_0xf01c8a['query']['includeAll']){_0x19e5c0[_0xf1b9('0x3e')]=[{'all':!![]}];}return db[_0xf1b9('0x2c')][_0xf1b9('0x3f')](_0x19e5c0);})[_0xf1b9('0x23')](function(_0x2e8bc4){_0x4bea9b[_0xf1b9('0x40')]=_0x2e8bc4;return _0x4bea9b;})[_0xf1b9('0x23')](respondWithFilteredResult(_0x126666,_0x19e5c0))['catch'](handleError(_0x126666,null));};exports[_0xf1b9('0x41')]=function(_0x41a3ff,_0x3a4cb0){var _0x3ce56a={'raw':!![],'where':{'id':_0x41a3ff['params']['id']}},_0xf9d598={};_0xf9d598[_0xf1b9('0x30')]=_[_0xf1b9('0x32')](db[_0xf1b9('0x2c')][_0xf1b9('0x2d')]);_0xf9d598[_0xf1b9('0x31')]=_[_0xf1b9('0x32')](_0x41a3ff[_0xf1b9('0x31')]);_0xf9d598['filters']=_[_0xf1b9('0x42')](_0xf9d598[_0xf1b9('0x30')],_0xf9d598[_0xf1b9('0x31')]);_0x3ce56a[_0xf1b9('0x35')]=_[_0xf1b9('0x42')](_0xf9d598[_0xf1b9('0x30')],qs[_0xf1b9('0x34')](_0x41a3ff[_0xf1b9('0x31')][_0xf1b9('0x34')]));_0x3ce56a['attributes']=_0x3ce56a[_0xf1b9('0x35')]['length']?_0x3ce56a[_0xf1b9('0x35')]:_0xf9d598[_0xf1b9('0x30')];if(_0x41a3ff[_0xf1b9('0x31')]['includeAll']){_0x3ce56a[_0xf1b9('0x3e')]=[{'all':!![]}];}_0x3ce56a=_[_0xf1b9('0x3d')]({},_0x3ce56a,_0x41a3ff[_0xf1b9('0x43')]);return db[_0xf1b9('0x2c')][_0xf1b9('0x44')](_0x3ce56a)[_0xf1b9('0x23')](handleEntityNotFound(_0x3a4cb0,null))['then'](respondWithResult(_0x3a4cb0,null))[_0xf1b9('0x45')](handleError(_0x3a4cb0,null));};exports['create']=function(_0x2d56ad,_0x3b6c60){return db[_0xf1b9('0x2c')][_0xf1b9('0x46')](_0x2d56ad['body'],{})[_0xf1b9('0x23')](respondWithResult(_0x3b6c60,0xc9))[_0xf1b9('0x45')](handleError(_0x3b6c60,null));};exports[_0xf1b9('0x22')]=function(_0x27b26e,_0x32d26d){if(_0x27b26e['body']['id']){delete _0x27b26e[_0xf1b9('0x47')]['id'];}return db[_0xf1b9('0x2c')][_0xf1b9('0x44')]({'where':{'id':_0x27b26e[_0xf1b9('0x48')]['id']}})['then'](handleEntityNotFound(_0x32d26d,null))[_0xf1b9('0x23')](saveUpdates(_0x27b26e[_0xf1b9('0x47')],null))[_0xf1b9('0x23')](respondWithResult(_0x32d26d,null))[_0xf1b9('0x45')](handleError(_0x32d26d,null));};exports[_0xf1b9('0x49')]=function(_0x44bcc5,_0x4851ea){return db[_0xf1b9('0x2c')][_0xf1b9('0x44')]({'where':{'id':_0x44bcc5[_0xf1b9('0x48')]['id']}})[_0xf1b9('0x23')](handleEntityNotFound(_0x4851ea,null))[_0xf1b9('0x23')](removeEntity(_0x4851ea,null))[_0xf1b9('0x45')](handleError(_0x4851ea,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0ae030e..2014d73 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 _0xe3fc=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x45859a,_0x28a41d){var _0x926cd8=function(_0x28c20a){while(--_0x28c20a){_0x45859a['push'](_0x45859a['shift']());}};_0x926cd8(++_0x28a41d);}(_0xe3fc,0x11d));var _0xce3f=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0xe3fc[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0xce3f('0x0'));var util=require(_0xce3f('0x1'));var logger=require(_0xce3f('0x2'))(_0xce3f('0x3'));var moment=require('moment');var BPromise=require(_0xce3f('0x4'));var rp=require(_0xce3f('0x5'));var fs=require('fs');var path=require(_0xce3f('0x6'));var rimraf=require(_0xce3f('0x7'));var config=require(_0xce3f('0x8'));var attributes=require(_0xce3f('0x9'));module[_0xce3f('0xa')]=function(_0x4ad775,_0xcf31b3){return _0x4ad775[_0xce3f('0xb')](_0xce3f('0xc'),attributes,{'tableName':_0xce3f('0xd'),'paranoid':![],'indexes':[{'name':_0xce3f('0xe'),'fields':[_0xce3f('0xf'),_0xce3f('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99c8=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1a5a75,_0x383261){var _0x2093c0=function(_0x9b462b){while(--_0x9b462b){_0x1a5a75['push'](_0x1a5a75['shift']());}};_0x2093c0(++_0x383261);}(_0x99c8,0xe6));var _0x899c=function(_0x3b384b,_0x593d94){_0x3b384b=_0x3b384b-0x0;var _0x511614=_0x99c8[_0x3b384b];return _0x511614;};'use strict';var _=require(_0x899c('0x0'));var util=require(_0x899c('0x1'));var logger=require(_0x899c('0x2'))(_0x899c('0x3'));var moment=require(_0x899c('0x4'));var BPromise=require(_0x899c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x899c('0x6'));var rimraf=require(_0x899c('0x7'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x899c('0x8')]=function(_0x2c6e64,_0x1c3349){return _0x2c6e64[_0x899c('0x9')](_0x899c('0xa'),attributes,{'tableName':_0x899c('0xb'),'paranoid':![],'indexes':[{'name':_0x899c('0xc'),'fields':['idField',_0x899c('0xd')],'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 434151b..bb53dfe 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 _0x2671=['client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x2671,0x185));var _0x1267=function(_0x399d76,_0xdc4493){_0x399d76=_0x399d76-0x0;var _0x3b19a1=_0x2671[_0x399d76];return _0x3b19a1;};'use strict';var _=require('lodash');var util=require(_0x1267('0x0'));var moment=require(_0x1267('0x1'));var BPromise=require(_0x1267('0x2'));var rs=require(_0x1267('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1267('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1267('0x5'))(_0x1267('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1267('0x7')][_0x1267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b6a09,_0x5303e2,_0x301224){return new BPromise(function(_0x47cb02,_0x594ae0){return client[_0x1267('0x9')](_0x1b6a09,_0x301224)[_0x1267('0xa')](function(_0x3af57d){logger[_0x1267('0xb')](_0x1267('0xc'),_0x5303e2,_0x1267('0xd'));logger[_0x1267('0xe')](_0x1267('0xf'),_0x5303e2,_0x1267('0xd'),JSON[_0x1267('0x10')](_0x3af57d));if(_0x3af57d[_0x1267('0x11')]){if(_0x3af57d['error'][_0x1267('0x12')]===0x1f4){logger[_0x1267('0x11')](_0x1267('0xc'),_0x5303e2,_0x3af57d[_0x1267('0x11')][_0x1267('0x13')]);return _0x594ae0(_0x3af57d['error'][_0x1267('0x13')]);}logger['error'](_0x1267('0xc'),_0x5303e2,_0x3af57d[_0x1267('0x11')][_0x1267('0x13')]);return _0x47cb02(_0x3af57d[_0x1267('0x11')][_0x1267('0x13')]);}else{logger['info'](_0x1267('0xc'),_0x5303e2,'request\x20sent');_0x47cb02(_0x3af57d[_0x1267('0x14')][_0x1267('0x13')]);}})[_0x1267('0x15')](function(_0x261dd0){logger['error'](_0x1267('0xc'),_0x5303e2,_0x261dd0);_0x594ae0(_0x261dd0);});});} \ No newline at end of file +var _0xfdd2=['client','http','then','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x301168,_0x23219b){var _0xd7dd23=function(_0x1d5cdd){while(--_0x1d5cdd){_0x301168['push'](_0x301168['shift']());}};_0xd7dd23(++_0x23219b);}(_0xfdd2,0x1d9));var _0x2fdd=function(_0x31bcbe,_0x4ce65b){_0x31bcbe=_0x31bcbe-0x0;var _0x485320=_0xfdd2[_0x31bcbe];return _0x485320;};'use strict';var _=require('lodash');var util=require(_0x2fdd('0x0'));var moment=require(_0x2fdd('0x1'));var BPromise=require(_0x2fdd('0x2'));var rs=require(_0x2fdd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fdd('0x4'))['db'];var utils=require(_0x2fdd('0x5'));var logger=require(_0x2fdd('0x6'))(_0x2fdd('0x7'));var config=require(_0x2fdd('0x8'));var jayson=require(_0x2fdd('0x9'));var client=jayson[_0x2fdd('0xa')][_0x2fdd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12d8b5,_0x3d164b,_0x111067){return new BPromise(function(_0x225e7d,_0x258a91){return client['request'](_0x12d8b5,_0x111067)[_0x2fdd('0xc')](function(_0x544831){logger['info'](_0x2fdd('0xd'),_0x3d164b,'request\x20sent');logger[_0x2fdd('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x3d164b,_0x2fdd('0xf'),JSON[_0x2fdd('0x10')](_0x544831));if(_0x544831[_0x2fdd('0x11')]){if(_0x544831[_0x2fdd('0x11')][_0x2fdd('0x12')]===0x1f4){logger[_0x2fdd('0x11')](_0x2fdd('0xd'),_0x3d164b,_0x544831[_0x2fdd('0x11')]['message']);return _0x258a91(_0x544831[_0x2fdd('0x11')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x3d164b,_0x544831[_0x2fdd('0x11')][_0x2fdd('0x13')]);return _0x225e7d(_0x544831[_0x2fdd('0x11')][_0x2fdd('0x13')]);}else{logger[_0x2fdd('0x14')](_0x2fdd('0xd'),_0x3d164b,'request\x20sent');_0x225e7d(_0x544831[_0x2fdd('0x15')][_0x2fdd('0x13')]);}})[_0x2fdd('0x16')](function(_0x2b262a){logger['error'](_0x2fdd('0xd'),_0x3d164b,_0x2b262a);_0x258a91(_0x2b262a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 25cca5e..24bb564 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 _0xdb50=['create','addConfiguration','put','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb50,0xe2));var _0x0db5=function(_0x50d1c0,_0x21f19b){_0x50d1c0=_0x50d1c0-0x0;var _0x162782=_0xdb50[_0x50d1c0];return _0x162782;};'use strict';var multer=require(_0x0db5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0db5('0x1'));var router=express[_0x0db5('0x2')]();var fs_extra=require(_0x0db5('0x3'));var auth=require(_0x0db5('0x4'));var interaction=require(_0x0db5('0x5'));var config=require(_0x0db5('0x6'));var controller=require('./intZohoAccount.controller');router[_0x0db5('0x7')]('/',auth[_0x0db5('0x8')](),controller[_0x0db5('0x9')]);router[_0x0db5('0x7')](_0x0db5('0xa'),auth['isAuthenticated'](),controller[_0x0db5('0xb')]);router[_0x0db5('0x7')](_0x0db5('0xc'),auth['isAuthenticated'](),controller[_0x0db5('0xd')]);router[_0x0db5('0x7')](_0x0db5('0xe'),auth[_0x0db5('0x8')](),controller['getFields']);router[_0x0db5('0xf')]('/',auth[_0x0db5('0x8')](),controller[_0x0db5('0x10')]);router[_0x0db5('0xf')](_0x0db5('0xc'),auth['isAuthenticated'](),controller[_0x0db5('0x11')]);router[_0x0db5('0x12')](_0x0db5('0xa'),auth[_0x0db5('0x8')](),controller[_0x0db5('0x13')]);router[_0x0db5('0x14')](_0x0db5('0xa'),auth[_0x0db5('0x8')](),controller[_0x0db5('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe082=['/:id','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0xa866ce,_0x4fdd52){var _0x10e635=function(_0x398c4d){while(--_0x398c4d){_0xa866ce['push'](_0xa866ce['shift']());}};_0x10e635(++_0x4fdd52);}(_0xe082,0x154));var _0x2e08=function(_0x4c12c1,_0x41926c){_0x4c12c1=_0x4c12c1-0x0;var _0x40bc9d=_0xe082[_0x4c12c1];return _0x40bc9d;};'use strict';var multer=require(_0x2e08('0x0'));var util=require(_0x2e08('0x1'));var path=require(_0x2e08('0x2'));var timeout=require(_0x2e08('0x3'));var express=require(_0x2e08('0x4'));var router=express[_0x2e08('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2e08('0x6'));var interaction=require(_0x2e08('0x7'));var config=require(_0x2e08('0x8'));var controller=require(_0x2e08('0x9'));router[_0x2e08('0xa')]('/',auth[_0x2e08('0xb')](),controller['index']);router[_0x2e08('0xa')](_0x2e08('0xc'),auth[_0x2e08('0xb')](),controller['show']);router[_0x2e08('0xa')]('/:id/configurations',auth[_0x2e08('0xb')](),controller[_0x2e08('0xd')]);router[_0x2e08('0xa')](_0x2e08('0xe'),auth[_0x2e08('0xb')](),controller[_0x2e08('0xf')]);router[_0x2e08('0x10')]('/',auth[_0x2e08('0xb')](),controller['create']);router[_0x2e08('0x10')](_0x2e08('0x11'),auth[_0x2e08('0xb')](),controller[_0x2e08('0x12')]);router[_0x2e08('0x13')]('/:id',auth[_0x2e08('0xb')](),controller[_0x2e08('0x14')]);router['delete']('/:id',auth[_0x2e08('0xb')](),controller[_0x2e08('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 81e1730..73d1c6a 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 _0x750a=['exports','STRING'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x750a,0x140));var _0xa750=function(_0x5410fd,_0x42e056){_0x5410fd=_0x5410fd-0x0;var _0x1e98e4=_0x750a[_0x5410fd];return _0x1e98e4;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa750('0x1')]},'zone':{'type':Sequelize[_0xa750('0x1')]},'clientId':{'type':Sequelize[_0xa750('0x1')]},'clientSecret':{'type':Sequelize[_0xa750('0x1')]},'serverUrl':{'type':Sequelize[_0xa750('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa750('0x1')]},'refreshToken':{'type':Sequelize[_0xa750('0x1')]}}; \ No newline at end of file +var _0xee5b=['sequelize','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xee5b,0x1f4));var _0xbee5=function(_0x43682c,_0x7ce063){_0x43682c=_0x43682c-0x0;var _0x4ffc97=_0xee5b[_0x43682c];return _0x4ffc97;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')]},'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xbee5('0x1')]},'clientId':{'type':Sequelize[_0xbee5('0x1')]},'clientSecret':{'type':Sequelize[_0xbee5('0x1')]},'serverUrl':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 0b0cd50..b442546 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 _0x9956=['merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','sort','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','push','display_label','data_type','picklist','pick_list_values','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','ZohoAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9956,0x14e));var _0x6995=function(_0x30b423,_0x482566){_0x30b423=_0x30b423-0x0;var _0x41b6bf=_0x9956[_0x30b423];return _0x41b6bf;};'use strict';var emlformat=require(_0x6995('0x0'));var rimraf=require(_0x6995('0x1'));var zipdir=require(_0x6995('0x2'));var jsonpatch=require(_0x6995('0x3'));var rp=require(_0x6995('0x4'));var moment=require(_0x6995('0x5'));var BPromise=require(_0x6995('0x6'));var Mustache=require(_0x6995('0x7'));var util=require(_0x6995('0x8'));var path=require(_0x6995('0x9'));var sox=require(_0x6995('0xa'));var csv=require(_0x6995('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6995('0xc'));var _=require(_0x6995('0xd'));var squel=require(_0x6995('0xe'));var crypto=require('crypto');var jsforce=require(_0x6995('0xf'));var deskjs=require(_0x6995('0x10'));var toCsv=require(_0x6995('0xb'));var querystring=require(_0x6995('0x11'));var Papa=require('papaparse');var Redis=require(_0x6995('0x12'));var authService=require(_0x6995('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6995('0x14'));var logger=require(_0x6995('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6995('0x16'));var licenseUtil=require(_0x6995('0x17'));var db=require(_0x6995('0x18'))['db'];var integrations=require(_0x6995('0x19'));function respondWithStatusCode(_0x52c880,_0x4a7a0d){_0x4a7a0d=_0x4a7a0d||0xcc;return function(_0x2ff9e4){if(_0x2ff9e4){return _0x52c880[_0x6995('0x1a')](_0x4a7a0d);}return _0x52c880[_0x6995('0x1b')](_0x4a7a0d)[_0x6995('0x1c')]();};}function respondWithResult(_0x4ec91d,_0x102263){_0x102263=_0x102263||0xc8;return function(_0x5e229f){if(_0x5e229f){return _0x4ec91d[_0x6995('0x1b')](_0x102263)['json'](_0x5e229f);}};}function respondWithFilteredResult(_0x997fb0,_0x150547){return function(_0x3c51f6){if(_0x3c51f6){var _0x316644=typeof _0x150547[_0x6995('0x1d')]==='undefined'&&typeof _0x150547['limit']===_0x6995('0x1e');var _0xd4bead=_0x3c51f6[_0x6995('0x1f')];var _0x2a17a1=_0x316644?0x0:_0x150547[_0x6995('0x1d')];var _0x27b409=_0x316644?_0x3c51f6[_0x6995('0x1f')]:_0x150547[_0x6995('0x1d')]+_0x150547[_0x6995('0x20')];var _0x35de9d;if(_0x27b409>=_0xd4bead){_0x27b409=_0xd4bead;_0x35de9d=0xc8;}else{_0x35de9d=0xce;}_0x997fb0[_0x6995('0x1b')](_0x35de9d);return _0x997fb0[_0x6995('0x21')](_0x6995('0x22'),_0x2a17a1+'-'+_0x27b409+'/'+_0xd4bead)[_0x6995('0x23')](_0x3c51f6);}return null;};}function patchUpdates(_0x5e6dae){return function(_0x1f842e){try{jsonpatch[_0x6995('0x24')](_0x1f842e,_0x5e6dae,!![]);}catch(_0xff97fa){return BPromise[_0x6995('0x25')](_0xff97fa);}return _0x1f842e['save']();};}function saveUpdates(_0xc4b57e,_0x3c8a48){return function(_0x1ffc79){if(_0x1ffc79){return _0x1ffc79[_0x6995('0x26')](_0xc4b57e)[_0x6995('0x27')](function(_0x49e4d9){return _0x49e4d9;});}return null;};}function removeEntity(_0x39ddf0,_0x292c47){return function(_0x531736){if(_0x531736){return _0x531736['destroy']()[_0x6995('0x27')](function(){_0x39ddf0[_0x6995('0x1b')](0xcc)[_0x6995('0x1c')]();});}};}function handleEntityNotFound(_0x5af877,_0x293275){return function(_0x3247e3){if(!_0x3247e3){_0x5af877[_0x6995('0x1a')](0x194);}return _0x3247e3;};}function handleError(_0x3a690d,_0x90e3f9){_0x90e3f9=_0x90e3f9||0x1f4;return function(_0x56e711){logger[_0x6995('0x28')](_0x56e711[_0x6995('0x29')]);if(_0x56e711[_0x6995('0x2a')]){delete _0x56e711[_0x6995('0x2a')];}_0x3a690d[_0x6995('0x1b')](_0x90e3f9)['send'](_0x56e711);};}exports[_0x6995('0x2b')]=function(_0x322c96,_0x50c1e1){var _0x144af7={},_0x2ba476={},_0x29f4fd={'count':0x0,'rows':[]};var _0x50dedc=_['map'](db[_0x6995('0x2c')][_0x6995('0x2d')],function(_0x5346ae){return{'name':_0x5346ae['fieldName'],'type':_0x5346ae['type'][_0x6995('0x2e')]};});_0x2ba476[_0x6995('0x2f')]=_[_0x6995('0x30')](_0x50dedc,_0x6995('0x2a'));_0x2ba476[_0x6995('0x31')]=_[_0x6995('0x32')](_0x322c96['query']);_0x2ba476[_0x6995('0x33')]=_[_0x6995('0x34')](_0x2ba476[_0x6995('0x2f')],_0x2ba476['query']);_0x144af7[_0x6995('0x35')]=_[_0x6995('0x34')](_0x2ba476[_0x6995('0x2f')],qs[_0x6995('0x36')](_0x322c96[_0x6995('0x31')][_0x6995('0x36')]));_0x144af7[_0x6995('0x35')]=_0x144af7[_0x6995('0x35')][_0x6995('0x37')]?_0x144af7[_0x6995('0x35')]:_0x2ba476[_0x6995('0x2f')];if(!_0x322c96[_0x6995('0x31')][_0x6995('0x38')](_0x6995('0x39'))){_0x144af7[_0x6995('0x20')]=qs[_0x6995('0x20')](_0x322c96[_0x6995('0x31')]['limit']);_0x144af7[_0x6995('0x1d')]=qs[_0x6995('0x1d')](_0x322c96[_0x6995('0x31')][_0x6995('0x1d')]);}_0x144af7[_0x6995('0x3a')]=qs['sort'](_0x322c96[_0x6995('0x31')]['sort']);_0x144af7[_0x6995('0x3b')]=qs[_0x6995('0x33')](_[_0x6995('0x3c')](_0x322c96[_0x6995('0x31')],_0x2ba476['filters']),_0x50dedc);if(_0x322c96[_0x6995('0x31')][_0x6995('0x3d')]){_0x144af7[_0x6995('0x3b')]=_[_0x6995('0x3e')](_0x144af7[_0x6995('0x3b')],{'$or':_[_0x6995('0x30')](_0x50dedc,function(_0x5e6176){if(_0x5e6176[_0x6995('0x3f')]!==_0x6995('0x40')){var _0x1be5d3={};_0x1be5d3[_0x5e6176[_0x6995('0x2a')]]={'$like':'%'+_0x322c96['query'][_0x6995('0x3d')]+'%'};return _0x1be5d3;}})});}_0x144af7=_[_0x6995('0x3e')]({},_0x144af7,_0x322c96[_0x6995('0x41')]);var _0x201aad={'where':_0x144af7[_0x6995('0x3b')]};return db[_0x6995('0x2c')][_0x6995('0x1f')](_0x201aad)[_0x6995('0x27')](function(_0x1820ee){_0x29f4fd[_0x6995('0x1f')]=_0x1820ee;if(_0x322c96[_0x6995('0x31')][_0x6995('0x42')]){_0x144af7['include']=[{'all':!![]}];}return db[_0x6995('0x2c')][_0x6995('0x43')](_0x144af7);})['then'](function(_0x5091cf){_0x29f4fd[_0x6995('0x44')]=_0x5091cf;return _0x29f4fd;})['then'](respondWithFilteredResult(_0x50c1e1,_0x144af7))[_0x6995('0x45')](handleError(_0x50c1e1,null));};exports[_0x6995('0x46')]=function(_0x57d7c7,_0x3fdfe6){var _0x3eccc6={'raw':![],'where':{'id':_0x57d7c7[_0x6995('0x47')]['id']}},_0x5490bc={};_0x5490bc[_0x6995('0x2f')]=_['keys'](db[_0x6995('0x2c')]['rawAttributes']);_0x5490bc[_0x6995('0x31')]=_[_0x6995('0x32')](_0x57d7c7[_0x6995('0x31')]);_0x5490bc['filters']=_['intersection'](_0x5490bc[_0x6995('0x2f')],_0x5490bc['query']);_0x3eccc6['attributes']=_['intersection'](_0x5490bc[_0x6995('0x2f')],qs['fields'](_0x57d7c7[_0x6995('0x31')][_0x6995('0x36')]));_0x3eccc6[_0x6995('0x35')]=_0x3eccc6['attributes']['length']?_0x3eccc6[_0x6995('0x35')]:_0x5490bc['model'];if(_0x57d7c7['query']['includeAll']){_0x3eccc6[_0x6995('0x48')]=[{'all':!![]}];}_0x3eccc6=_[_0x6995('0x3e')]({},_0x3eccc6,_0x57d7c7['options']);return db[_0x6995('0x2c')][_0x6995('0x49')](_0x3eccc6)[_0x6995('0x27')](handleEntityNotFound(_0x3fdfe6,null))[_0x6995('0x27')](respondWithResult(_0x3fdfe6,null))['catch'](handleError(_0x3fdfe6,null));};exports[_0x6995('0x4a')]=function(_0x2664b4,_0xab8750){return db['ZohoAccount'][_0x6995('0x4a')](_0x2664b4[_0x6995('0x4b')],{})[_0x6995('0x27')](respondWithResult(_0xab8750,0xc9))[_0x6995('0x45')](handleError(_0xab8750,null));};exports[_0x6995('0x26')]=function(_0x4dddda,_0x13ca78){if(_0x4dddda[_0x6995('0x4b')]['id']){delete _0x4dddda[_0x6995('0x4b')]['id'];}return db[_0x6995('0x2c')][_0x6995('0x49')]({'where':{'id':_0x4dddda[_0x6995('0x47')]['id']}})['then'](handleEntityNotFound(_0x13ca78,null))[_0x6995('0x27')](saveUpdates(_0x4dddda['body'],null))[_0x6995('0x27')](respondWithResult(_0x13ca78,null))['catch'](handleError(_0x13ca78,null));};exports[_0x6995('0x4c')]=function(_0x421690,_0x520471){return db[_0x6995('0x2c')]['find']({'where':{'id':_0x421690[_0x6995('0x47')]['id']}})[_0x6995('0x27')](handleEntityNotFound(_0x520471,null))[_0x6995('0x27')](removeEntity(_0x520471,null))['catch'](handleError(_0x520471,null));};exports[_0x6995('0x4d')]=function(_0x1c52a2,_0x46a942,_0x276913){var _0x3cff15={};var _0x479324={};var _0x3ae0e4;var _0x21b0cc;return db['ZohoAccount'][_0x6995('0x4e')]({'where':{'id':_0x1c52a2['params']['id']}})[_0x6995('0x27')](handleEntityNotFound(_0x46a942,null))[_0x6995('0x27')](function(_0x33ea46){if(_0x33ea46){_0x3ae0e4=_0x33ea46;_0x479324['model']=_[_0x6995('0x32')](db[_0x6995('0x4f')]['rawAttributes']);_0x479324[_0x6995('0x31')]=_[_0x6995('0x32')](_0x1c52a2['query']);_0x479324['filters']=_['intersection'](_0x479324[_0x6995('0x2f')],_0x479324[_0x6995('0x31')]);_0x3cff15[_0x6995('0x35')]=_[_0x6995('0x34')](_0x479324['model'],qs[_0x6995('0x36')](_0x1c52a2[_0x6995('0x31')][_0x6995('0x36')]));_0x3cff15['attributes']=_0x3cff15['attributes'][_0x6995('0x37')]?_0x3cff15['attributes']:_0x479324[_0x6995('0x2f')];_0x3cff15[_0x6995('0x3a')]=qs[_0x6995('0x50')](_0x1c52a2[_0x6995('0x31')][_0x6995('0x50')]);_0x3cff15[_0x6995('0x3b')]=qs['filters'](_[_0x6995('0x3c')](_0x1c52a2[_0x6995('0x31')],_0x479324['filters']));if(_0x1c52a2[_0x6995('0x31')]['filter']){_0x3cff15[_0x6995('0x3b')]=_['merge'](_0x3cff15[_0x6995('0x3b')],{'$or':_[_0x6995('0x30')](_0x3cff15[_0x6995('0x35')],function(_0x31d04c){var _0x495f46={};_0x495f46[_0x31d04c]={'$like':'%'+_0x1c52a2[_0x6995('0x31')][_0x6995('0x3d')]+'%'};return _0x495f46;})});}_0x3cff15=_[_0x6995('0x3e')]({},_0x3cff15,_0x1c52a2['options']);return _0x3ae0e4[_0x6995('0x4d')](_0x3cff15);}})[_0x6995('0x27')](function(_0x5440cc){if(_0x5440cc){_0x21b0cc=_0x5440cc[_0x6995('0x37')];if(!_0x1c52a2['query'][_0x6995('0x38')](_0x6995('0x39'))){_0x3cff15[_0x6995('0x20')]=qs[_0x6995('0x20')](_0x1c52a2[_0x6995('0x31')][_0x6995('0x20')]);_0x3cff15[_0x6995('0x1d')]=qs['offset'](_0x1c52a2['query'][_0x6995('0x1d')]);}return _0x3ae0e4[_0x6995('0x4d')](_0x3cff15);}})[_0x6995('0x27')](function(_0x1d07e6){if(_0x1d07e6){return _0x1d07e6?{'count':_0x21b0cc,'rows':_0x1d07e6}:null;}})[_0x6995('0x27')](respondWithResult(_0x46a942,null))[_0x6995('0x45')](handleError(_0x46a942,null));};exports[_0x6995('0x51')]=function(_0x3a807,_0x4f38b9,_0x3a6ac6){if(_0x3a807[_0x6995('0x4b')]['id']){delete _0x3a807[_0x6995('0x4b')]['id'];}return db['ZohoAccount'][_0x6995('0x4e')]({'where':{'id':_0x3a807[_0x6995('0x47')]['id']}})[_0x6995('0x27')](handleEntityNotFound(_0x4f38b9,null))['then'](function(_0x2facbb){if(_0x2facbb){_0x3a807[_0x6995('0x4b')][_0x6995('0x52')]=_0x2facbb['id'];_0x3a807[_0x6995('0x4b')]['Subjects']=integrations[_0x6995('0x53')](_0x3a807[_0x6995('0x4b')][_0x6995('0x54')],_0x3a807[_0x6995('0x4b')][_0x6995('0x3f')]);_0x3a807[_0x6995('0x4b')]['Descriptions']=integrations[_0x6995('0x55')](_0x3a807[_0x6995('0x4b')]['channel'],_0x3a807[_0x6995('0x4b')][_0x6995('0x3f')]);return db['ZohoConfiguration'][_0x6995('0x4a')](_0x3a807[_0x6995('0x4b')],{'include':[{'model':db[_0x6995('0x56')],'as':_0x6995('0x57')},{'model':db[_0x6995('0x56')],'as':'Descriptions'}]});}return null;})[_0x6995('0x27')](respondWithResult(_0x4f38b9,null))[_0x6995('0x45')](handleError(_0x4f38b9,null));};function getAccessToken(_0x4f7e48){return new Promise(function(_0x2aefec,_0x4585e0){var _0xa2afb3;switch(_0x4f7e48[_0x6995('0x58')]){case'US':_0xa2afb3=_0x6995('0x59');break;case'AU':_0xa2afb3=_0x6995('0x5a');break;case'EU':_0xa2afb3=_0x6995('0x5b');break;case'IN':_0xa2afb3=_0x6995('0x5c');break;case'CN':_0xa2afb3='https://accounts.zoho.com.cn';break;default:_0xa2afb3=_0x6995('0x5b');break;}var _0x5ebeaa={'method':_0x6995('0x5d'),'uri':_0xa2afb3+_0x6995('0x5e'),'qs':{'refresh_token':_0x4f7e48[_0x6995('0x5f')],'client_id':_0x4f7e48['clientId'],'client_secret':_0x4f7e48[_0x6995('0x60')],'grant_type':_0x6995('0x61')},'json':!![]};return rp(_0x5ebeaa)[_0x6995('0x27')](function(_0x104e0b){if(_0x104e0b['access_token']){_0x2aefec(_0x104e0b[_0x6995('0x62')]);}else{_0x4585e0(_0x6995('0x63'));}})[_0x6995('0x45')](function(_0x4fe100){_0x4585e0(_0x4fe100);});});}exports[_0x6995('0x64')]=function(_0xa6fec9,_0x4f21ac,_0x1159dc){var _0x2980e8,_0x860b59,_0x1c2c17,_0x49b884,_0x617bef;return db[_0x6995('0x2c')][_0x6995('0x4e')]({'where':{'id':_0xa6fec9[_0x6995('0x47')]['id']},'attributes':['id',_0x6995('0x65'),_0x6995('0x58'),_0x6995('0x66'),_0x6995('0x60'),_0x6995('0x67'),_0x6995('0x68'),_0x6995('0x5f')]})[_0x6995('0x27')](handleEntityNotFound(_0x4f21ac,null))[_0x6995('0x27')](function(_0xdb547c){_0x617bef=_0xdb547c;_0x2980e8=_0x617bef['host'];_0x860b59=_0x2980e8===_0x6995('0x69')?'eu':_0x6995('0x6a');_0x1c2c17=_0x617bef[_0x6995('0x67')];var _0x28f5eb=_0x1c2c17['slice'](-0x1);if(_0x28f5eb==='/'||_0x28f5eb==='\x5c'||_0x28f5eb===':'){_0x1c2c17=_0x1c2c17['substring'](0x0,_0x1c2c17[_0x6995('0x6b')](_0x28f5eb));}if(!_0x617bef[_0x6995('0x5f')]){throw new Error(_0x6995('0x6c'));}return getAccessToken(_0x617bef);})['then'](function(_0x9b1b37){if(_0x9b1b37){return rp({'method':_0x6995('0x6d'),'uri':util[_0x6995('0x6e')](_0x6995('0x6f'),_0x860b59),'qs':{'module':_0x6995('0x70')},'headers':{'Authorization':_0x6995('0x71')+_0x9b1b37},'json':!![]});}})[_0x6995('0x27')](function(_0x36f328){if(_0x36f328){if(_0x36f328[_0x6995('0x72')]&&_0x36f328[_0x6995('0x72')][_0x6995('0x28')]){throw new Error(_0x36f328[_0x6995('0x72')][_0x6995('0x28')][_0x6995('0x73')]);}var _0x1a0fda=[];var _0x30538a=[];var _0x39b6db=['Owner',_0x6995('0x74'),_0x6995('0x75'),_0x6995('0x76'),'Call_Duration',_0x6995('0x77'),_0x6995('0x78'),_0x6995('0x79')];_0x30538a=_[_0x6995('0x7a')](_0x36f328[_0x6995('0x36')],function(_0x1fb36c){return _0x39b6db['includes'](_0x1fb36c['api_name']);});for(var _0x216133=0x0;_0x216133<_0x30538a['length'];_0x216133++){if(_0x30538a[_0x216133]['system_mandatory']===![]){_0x1a0fda[_0x6995('0x7b')]({'id':_0x30538a[_0x216133]['id'],'name':_0x30538a[_0x216133][_0x6995('0x7c')],'custom':_0x30538a[_0x216133]['custom_field'],'options':_0x30538a[_0x216133][_0x6995('0x7d')]===_0x6995('0x7e')&&_0x30538a[_0x216133]['pick_list_values']['length']>-0x1?_[_0x6995('0x30')](_0x30538a[_0x216133][_0x6995('0x7f')],function(_0x2b5d59){return{'name':_0x2b5d59,'value':_0x2b5d59};}):[]});}}return{'count':_0x1a0fda['length'],'rows':_0x1a0fda};}else{return{'count':0x0,'rows':[]};}})[_0x6995('0x27')](respondWithResult(_0x4f21ac,null))['catch'](function(_0x35def9){var _0x2f5ff5=_0xa6fec9[_0x6995('0x31')][_0x6995('0x80')]?0x1f4:_0x35def9[_0x6995('0x81')]||0x1f4;logger[_0x6995('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x6995('0x64'),_0x2f5ff5,JSON['stringify'](_0x35def9));delete _0x35def9[_0x6995('0x2a')];if(_0x2f5ff5===0x191){_0x2f5ff5=0x190;}_0x4f21ac['status'](_0x2f5ff5)[_0x6995('0x82')](_0xa6fec9[_0x6995('0x31')][_0x6995('0x80')]?{'message':_0x6995('0x83'),'statusCode':_0x35def9[_0x6995('0x81')]}:_0x35def9);});}; \ No newline at end of file +var _0xabf0=['Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','test','statusCode','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','end','error','stack','name','send','ZohoAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','getSubjects','channel','getDescriptions','ZohoField'];(function(_0x57df35,_0x34b246){var _0x391eee=function(_0x4a6d39){while(--_0x4a6d39){_0x57df35['push'](_0x57df35['shift']());}};_0x391eee(++_0x34b246);}(_0xabf0,0xac));var _0x0abf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xabf0[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0abf('0x0'));var zipdir=require(_0x0abf('0x1'));var jsonpatch=require(_0x0abf('0x2'));var rp=require(_0x0abf('0x3'));var moment=require('moment');var BPromise=require(_0x0abf('0x4'));var Mustache=require(_0x0abf('0x5'));var util=require(_0x0abf('0x6'));var path=require(_0x0abf('0x7'));var sox=require('sox');var csv=require(_0x0abf('0x8'));var ejs=require(_0x0abf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0abf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0abf('0xb'));var toCsv=require(_0x0abf('0x8'));var querystring=require(_0x0abf('0xc'));var Papa=require(_0x0abf('0xd'));var Redis=require(_0x0abf('0xe'));var authService=require(_0x0abf('0xf'));var qs=require(_0x0abf('0x10'));var as=require(_0x0abf('0x11'));var hardwareService=require(_0x0abf('0x12'));var logger=require(_0x0abf('0x13'))(_0x0abf('0x14'));var utils=require(_0x0abf('0x15'));var config=require(_0x0abf('0x16'));var licenseUtil=require(_0x0abf('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0abf('0x18'));function respondWithStatusCode(_0x52ce95,_0x639eb9){_0x639eb9=_0x639eb9||0xcc;return function(_0x3077fe){if(_0x3077fe){return _0x52ce95[_0x0abf('0x19')](_0x639eb9);}return _0x52ce95['status'](_0x639eb9)['end']();};}function respondWithResult(_0x2f1131,_0x5b314f){_0x5b314f=_0x5b314f||0xc8;return function(_0x374ae0){if(_0x374ae0){return _0x2f1131[_0x0abf('0x1a')](_0x5b314f)['json'](_0x374ae0);}};}function respondWithFilteredResult(_0x41a517,_0x4a8220){return function(_0x38abe1){if(_0x38abe1){var _0x35170f=typeof _0x4a8220[_0x0abf('0x1b')]===_0x0abf('0x1c')&&typeof _0x4a8220[_0x0abf('0x1d')]===_0x0abf('0x1c');var _0x5ee147=_0x38abe1[_0x0abf('0x1e')];var _0x3eeca3=_0x35170f?0x0:_0x4a8220['offset'];var _0x1a065f=_0x35170f?_0x38abe1[_0x0abf('0x1e')]:_0x4a8220[_0x0abf('0x1b')]+_0x4a8220[_0x0abf('0x1d')];var _0x320b6b;if(_0x1a065f>=_0x5ee147){_0x1a065f=_0x5ee147;_0x320b6b=0xc8;}else{_0x320b6b=0xce;}_0x41a517[_0x0abf('0x1a')](_0x320b6b);return _0x41a517[_0x0abf('0x1f')](_0x0abf('0x20'),_0x3eeca3+'-'+_0x1a065f+'/'+_0x5ee147)['json'](_0x38abe1);}return null;};}function patchUpdates(_0x5281a1){return function(_0x30a222){try{jsonpatch['apply'](_0x30a222,_0x5281a1,!![]);}catch(_0x11a59f){return BPromise[_0x0abf('0x21')](_0x11a59f);}return _0x30a222['save']();};}function saveUpdates(_0x3b543d,_0x17d006){return function(_0x365423){if(_0x365423){return _0x365423[_0x0abf('0x22')](_0x3b543d)['then'](function(_0x4f6b4c){return _0x4f6b4c;});}return null;};}function removeEntity(_0x4291ef,_0x33f4f0){return function(_0x477f71){if(_0x477f71){return _0x477f71[_0x0abf('0x23')]()[_0x0abf('0x24')](function(){_0x4291ef[_0x0abf('0x1a')](0xcc)[_0x0abf('0x25')]();});}};}function handleEntityNotFound(_0x17b665,_0x30cfed){return function(_0x2e5656){if(!_0x2e5656){_0x17b665[_0x0abf('0x19')](0x194);}return _0x2e5656;};}function handleError(_0x5d45e6,_0x1224a9){_0x1224a9=_0x1224a9||0x1f4;return function(_0x12fb14){logger[_0x0abf('0x26')](_0x12fb14[_0x0abf('0x27')]);if(_0x12fb14[_0x0abf('0x28')]){delete _0x12fb14['name'];}_0x5d45e6[_0x0abf('0x1a')](_0x1224a9)[_0x0abf('0x29')](_0x12fb14);};}exports['index']=function(_0x555261,_0x537a12){var _0x5378ff={},_0x5c8217={},_0x508d9c={'count':0x0,'rows':[]};var _0x4a91cb=_['map'](db[_0x0abf('0x2a')][_0x0abf('0x2b')],function(_0x7b8aa){return{'name':_0x7b8aa[_0x0abf('0x2c')],'type':_0x7b8aa[_0x0abf('0x2d')][_0x0abf('0x2e')]};});_0x5c8217['model']=_[_0x0abf('0x2f')](_0x4a91cb,'name');_0x5c8217[_0x0abf('0x30')]=_[_0x0abf('0x31')](_0x555261[_0x0abf('0x30')]);_0x5c8217[_0x0abf('0x32')]=_['intersection'](_0x5c8217[_0x0abf('0x33')],_0x5c8217['query']);_0x5378ff['attributes']=_[_0x0abf('0x34')](_0x5c8217[_0x0abf('0x33')],qs[_0x0abf('0x35')](_0x555261[_0x0abf('0x30')][_0x0abf('0x35')]));_0x5378ff[_0x0abf('0x36')]=_0x5378ff[_0x0abf('0x36')][_0x0abf('0x37')]?_0x5378ff[_0x0abf('0x36')]:_0x5c8217['model'];if(!_0x555261['query'][_0x0abf('0x38')](_0x0abf('0x39'))){_0x5378ff[_0x0abf('0x1d')]=qs[_0x0abf('0x1d')](_0x555261[_0x0abf('0x30')][_0x0abf('0x1d')]);_0x5378ff[_0x0abf('0x1b')]=qs[_0x0abf('0x1b')](_0x555261[_0x0abf('0x30')]['offset']);}_0x5378ff['order']=qs[_0x0abf('0x3a')](_0x555261['query'][_0x0abf('0x3a')]);_0x5378ff[_0x0abf('0x3b')]=qs['filters'](_['pick'](_0x555261[_0x0abf('0x30')],_0x5c8217[_0x0abf('0x32')]),_0x4a91cb);if(_0x555261[_0x0abf('0x30')][_0x0abf('0x3c')]){_0x5378ff[_0x0abf('0x3b')]=_[_0x0abf('0x3d')](_0x5378ff[_0x0abf('0x3b')],{'$or':_[_0x0abf('0x2f')](_0x4a91cb,function(_0x16e001){if(_0x16e001[_0x0abf('0x2d')]!==_0x0abf('0x3e')){var _0x27a585={};_0x27a585[_0x16e001[_0x0abf('0x28')]]={'$like':'%'+_0x555261['query'][_0x0abf('0x3c')]+'%'};return _0x27a585;}})});}_0x5378ff=_[_0x0abf('0x3d')]({},_0x5378ff,_0x555261[_0x0abf('0x3f')]);var _0x783a8f={'where':_0x5378ff[_0x0abf('0x3b')]};return db[_0x0abf('0x2a')]['count'](_0x783a8f)[_0x0abf('0x24')](function(_0x4b2917){_0x508d9c[_0x0abf('0x1e')]=_0x4b2917;if(_0x555261['query'][_0x0abf('0x40')]){_0x5378ff[_0x0abf('0x41')]=[{'all':!![]}];}return db[_0x0abf('0x2a')]['findAll'](_0x5378ff);})['then'](function(_0x35a67b){_0x508d9c[_0x0abf('0x42')]=_0x35a67b;return _0x508d9c;})[_0x0abf('0x24')](respondWithFilteredResult(_0x537a12,_0x5378ff))[_0x0abf('0x43')](handleError(_0x537a12,null));};exports[_0x0abf('0x44')]=function(_0x12f185,_0x492f9a){var _0x21ecc9={'raw':![],'where':{'id':_0x12f185['params']['id']}},_0x493987={};_0x493987['model']=_[_0x0abf('0x31')](db[_0x0abf('0x2a')][_0x0abf('0x2b')]);_0x493987[_0x0abf('0x30')]=_[_0x0abf('0x31')](_0x12f185['query']);_0x493987[_0x0abf('0x32')]=_[_0x0abf('0x34')](_0x493987[_0x0abf('0x33')],_0x493987[_0x0abf('0x30')]);_0x21ecc9[_0x0abf('0x36')]=_[_0x0abf('0x34')](_0x493987['model'],qs[_0x0abf('0x35')](_0x12f185[_0x0abf('0x30')][_0x0abf('0x35')]));_0x21ecc9['attributes']=_0x21ecc9[_0x0abf('0x36')][_0x0abf('0x37')]?_0x21ecc9[_0x0abf('0x36')]:_0x493987['model'];if(_0x12f185[_0x0abf('0x30')][_0x0abf('0x40')]){_0x21ecc9[_0x0abf('0x41')]=[{'all':!![]}];}_0x21ecc9=_[_0x0abf('0x3d')]({},_0x21ecc9,_0x12f185[_0x0abf('0x3f')]);return db[_0x0abf('0x2a')][_0x0abf('0x45')](_0x21ecc9)[_0x0abf('0x24')](handleEntityNotFound(_0x492f9a,null))['then'](respondWithResult(_0x492f9a,null))['catch'](handleError(_0x492f9a,null));};exports[_0x0abf('0x46')]=function(_0xcc79af,_0x53a5bb){return db[_0x0abf('0x2a')][_0x0abf('0x46')](_0xcc79af['body'],{})[_0x0abf('0x24')](respondWithResult(_0x53a5bb,0xc9))['catch'](handleError(_0x53a5bb,null));};exports[_0x0abf('0x22')]=function(_0x48faaa,_0x1231e1){if(_0x48faaa[_0x0abf('0x47')]['id']){delete _0x48faaa[_0x0abf('0x47')]['id'];}return db['ZohoAccount'][_0x0abf('0x45')]({'where':{'id':_0x48faaa[_0x0abf('0x48')]['id']}})[_0x0abf('0x24')](handleEntityNotFound(_0x1231e1,null))[_0x0abf('0x24')](saveUpdates(_0x48faaa['body'],null))[_0x0abf('0x24')](respondWithResult(_0x1231e1,null))[_0x0abf('0x43')](handleError(_0x1231e1,null));};exports['destroy']=function(_0x163b9f,_0x4355de){return db[_0x0abf('0x2a')][_0x0abf('0x45')]({'where':{'id':_0x163b9f[_0x0abf('0x48')]['id']}})[_0x0abf('0x24')](handleEntityNotFound(_0x4355de,null))[_0x0abf('0x24')](removeEntity(_0x4355de,null))[_0x0abf('0x43')](handleError(_0x4355de,null));};exports[_0x0abf('0x49')]=function(_0xd54508,_0x5e5631,_0x6457f6){var _0x14ebbf={};var _0x31349a={};var _0x5900e8;var _0x23096c;return db['ZohoAccount'][_0x0abf('0x4a')]({'where':{'id':_0xd54508[_0x0abf('0x48')]['id']}})[_0x0abf('0x24')](handleEntityNotFound(_0x5e5631,null))[_0x0abf('0x24')](function(_0x2e7ee8){if(_0x2e7ee8){_0x5900e8=_0x2e7ee8;_0x31349a[_0x0abf('0x33')]=_[_0x0abf('0x31')](db[_0x0abf('0x4b')]['rawAttributes']);_0x31349a['query']=_[_0x0abf('0x31')](_0xd54508[_0x0abf('0x30')]);_0x31349a[_0x0abf('0x32')]=_[_0x0abf('0x34')](_0x31349a[_0x0abf('0x33')],_0x31349a[_0x0abf('0x30')]);_0x14ebbf['attributes']=_[_0x0abf('0x34')](_0x31349a[_0x0abf('0x33')],qs[_0x0abf('0x35')](_0xd54508[_0x0abf('0x30')]['fields']));_0x14ebbf[_0x0abf('0x36')]=_0x14ebbf[_0x0abf('0x36')][_0x0abf('0x37')]?_0x14ebbf[_0x0abf('0x36')]:_0x31349a[_0x0abf('0x33')];_0x14ebbf[_0x0abf('0x4c')]=qs[_0x0abf('0x3a')](_0xd54508[_0x0abf('0x30')]['sort']);_0x14ebbf[_0x0abf('0x3b')]=qs[_0x0abf('0x32')](_['pick'](_0xd54508[_0x0abf('0x30')],_0x31349a[_0x0abf('0x32')]));if(_0xd54508[_0x0abf('0x30')][_0x0abf('0x3c')]){_0x14ebbf[_0x0abf('0x3b')]=_[_0x0abf('0x3d')](_0x14ebbf[_0x0abf('0x3b')],{'$or':_[_0x0abf('0x2f')](_0x14ebbf['attributes'],function(_0x4389e3){var _0x5b039f={};_0x5b039f[_0x4389e3]={'$like':'%'+_0xd54508[_0x0abf('0x30')][_0x0abf('0x3c')]+'%'};return _0x5b039f;})});}_0x14ebbf=_[_0x0abf('0x3d')]({},_0x14ebbf,_0xd54508['options']);return _0x5900e8['getConfigurations'](_0x14ebbf);}})[_0x0abf('0x24')](function(_0x7ce79c){if(_0x7ce79c){_0x23096c=_0x7ce79c[_0x0abf('0x37')];if(!_0xd54508[_0x0abf('0x30')][_0x0abf('0x38')](_0x0abf('0x39'))){_0x14ebbf[_0x0abf('0x1d')]=qs['limit'](_0xd54508['query'][_0x0abf('0x1d')]);_0x14ebbf[_0x0abf('0x1b')]=qs[_0x0abf('0x1b')](_0xd54508[_0x0abf('0x30')][_0x0abf('0x1b')]);}return _0x5900e8[_0x0abf('0x49')](_0x14ebbf);}})[_0x0abf('0x24')](function(_0x30208a){if(_0x30208a){return _0x30208a?{'count':_0x23096c,'rows':_0x30208a}:null;}})[_0x0abf('0x24')](respondWithResult(_0x5e5631,null))[_0x0abf('0x43')](handleError(_0x5e5631,null));};exports[_0x0abf('0x4d')]=function(_0xdfb9e7,_0x17db57,_0x1a4610){if(_0xdfb9e7[_0x0abf('0x47')]['id']){delete _0xdfb9e7[_0x0abf('0x47')]['id'];}return db[_0x0abf('0x2a')][_0x0abf('0x4a')]({'where':{'id':_0xdfb9e7[_0x0abf('0x48')]['id']}})['then'](handleEntityNotFound(_0x17db57,null))[_0x0abf('0x24')](function(_0xbdb9e2){if(_0xbdb9e2){_0xdfb9e7[_0x0abf('0x47')]['AccountId']=_0xbdb9e2['id'];_0xdfb9e7[_0x0abf('0x47')]['Subjects']=integrations[_0x0abf('0x4e')](_0xdfb9e7[_0x0abf('0x47')][_0x0abf('0x4f')],_0xdfb9e7[_0x0abf('0x47')]['type']);_0xdfb9e7[_0x0abf('0x47')]['Descriptions']=integrations[_0x0abf('0x50')](_0xdfb9e7[_0x0abf('0x47')][_0x0abf('0x4f')],_0xdfb9e7[_0x0abf('0x47')][_0x0abf('0x2d')]);return db[_0x0abf('0x4b')]['create'](_0xdfb9e7[_0x0abf('0x47')],{'include':[{'model':db[_0x0abf('0x51')],'as':_0x0abf('0x52')},{'model':db[_0x0abf('0x51')],'as':'Descriptions'}]});}return null;})[_0x0abf('0x24')](respondWithResult(_0x17db57,null))[_0x0abf('0x43')](handleError(_0x17db57,null));};function getAccessToken(_0x532aed){return new Promise(function(_0xd3105c,_0x5176a0){var _0x3c6b3f;switch(_0x532aed[_0x0abf('0x53')]){case'US':_0x3c6b3f=_0x0abf('0x54');break;case'AU':_0x3c6b3f=_0x0abf('0x55');break;case'EU':_0x3c6b3f=_0x0abf('0x56');break;case'IN':_0x3c6b3f=_0x0abf('0x57');break;case'CN':_0x3c6b3f=_0x0abf('0x58');break;default:_0x3c6b3f='https://accounts.zoho.eu';break;}var _0x3917f5={'method':_0x0abf('0x59'),'uri':_0x3c6b3f+'/oauth/v2/token','qs':{'refresh_token':_0x532aed[_0x0abf('0x5a')],'client_id':_0x532aed[_0x0abf('0x5b')],'client_secret':_0x532aed[_0x0abf('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3917f5)[_0x0abf('0x24')](function(_0x29dd26){if(_0x29dd26['access_token']){_0xd3105c(_0x29dd26[_0x0abf('0x5d')]);}else{_0x5176a0(_0x0abf('0x5e'));}})[_0x0abf('0x43')](function(_0x5de4e5){_0x5176a0(_0x5de4e5);});});}exports['getFields']=function(_0x1c5b70,_0x5c39f8,_0x15bea1){var _0x94ab8,_0x2689a5,_0x1868ac,_0x1a0c17,_0x2662fa;return db['ZohoAccount'][_0x0abf('0x4a')]({'where':{'id':_0x1c5b70[_0x0abf('0x48')]['id']},'attributes':['id',_0x0abf('0x5f'),_0x0abf('0x53'),_0x0abf('0x5b'),'clientSecret',_0x0abf('0x60'),'code',_0x0abf('0x5a')]})['then'](handleEntityNotFound(_0x5c39f8,null))[_0x0abf('0x24')](function(_0x88164f){_0x2662fa=_0x88164f;_0x94ab8=_0x2662fa['host'];_0x2689a5=_0x94ab8===_0x0abf('0x61')?'eu':_0x0abf('0x62');_0x1868ac=_0x2662fa[_0x0abf('0x60')];var _0x2af942=_0x1868ac['slice'](-0x1);if(_0x2af942==='/'||_0x2af942==='\x5c'||_0x2af942===':'){_0x1868ac=_0x1868ac[_0x0abf('0x63')](0x0,_0x1868ac[_0x0abf('0x64')](_0x2af942));}if(!_0x2662fa[_0x0abf('0x5a')]){throw new Error(_0x0abf('0x65'));}return getAccessToken(_0x2662fa);})[_0x0abf('0x24')](function(_0x46f085){if(_0x46f085){return rp({'method':_0x0abf('0x66'),'uri':util[_0x0abf('0x67')](_0x0abf('0x68'),_0x2689a5),'qs':{'module':'Calls'},'headers':{'Authorization':_0x0abf('0x69')+_0x46f085},'json':!![]});}})['then'](function(_0x300326){if(_0x300326){if(_0x300326[_0x0abf('0x6a')]&&_0x300326['response'][_0x0abf('0x26')]){throw new Error(_0x300326[_0x0abf('0x6a')][_0x0abf('0x26')][_0x0abf('0x6b')]);}var _0xfb8446=[];var _0x219776=[];var _0x51d12f=['Owner',_0x0abf('0x6c'),_0x0abf('0x6d'),_0x0abf('0x6e'),'Call_Duration',_0x0abf('0x6f'),_0x0abf('0x70'),_0x0abf('0x71')];_0x219776=_[_0x0abf('0x72')](_0x300326[_0x0abf('0x35')],function(_0x41afdd){return _0x51d12f[_0x0abf('0x73')](_0x41afdd[_0x0abf('0x74')]);});for(var _0x12b891=0x0;_0x12b891<_0x219776[_0x0abf('0x37')];_0x12b891++){if(_0x219776[_0x12b891][_0x0abf('0x75')]===![]){_0xfb8446[_0x0abf('0x76')]({'id':_0x219776[_0x12b891]['id'],'name':_0x219776[_0x12b891][_0x0abf('0x77')],'custom':_0x219776[_0x12b891][_0x0abf('0x78')],'options':_0x219776[_0x12b891]['data_type']==='picklist'&&_0x219776[_0x12b891][_0x0abf('0x79')]['length']>-0x1?_['map'](_0x219776[_0x12b891][_0x0abf('0x79')],function(_0x8efae4){return{'name':_0x8efae4,'value':_0x8efae4};}):[]});}}return{'count':_0xfb8446[_0x0abf('0x37')],'rows':_0xfb8446};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5c39f8,null))[_0x0abf('0x43')](function(_0x185d99){var _0x6c606b=_0x1c5b70[_0x0abf('0x30')][_0x0abf('0x7a')]?0x1f4:_0x185d99[_0x0abf('0x7b')]||0x1f4;logger[_0x0abf('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x0abf('0x7c'),_0x6c606b,JSON[_0x0abf('0x7d')](_0x185d99));delete _0x185d99[_0x0abf('0x28')];if(_0x6c606b===0x191){_0x6c606b=0x190;}_0x5c39f8[_0x0abf('0x1a')](_0x6c606b)[_0x0abf('0x29')](_0x1c5b70[_0x0abf('0x30')][_0x0abf('0x7a')]?{'message':_0x0abf('0x7e'),'statusCode':_0x185d99[_0x0abf('0x7b')]}:_0x185d99);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 07b0be1..a902795 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 _0xba18=['changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','https://accounts.zoho.com','https://accounts.zoho.com.au','application/x-www-form-urlencoded','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts'];(function(_0x412ec4,_0x1dc62a){var _0x52e28b=function(_0x550238){while(--_0x550238){_0x412ec4['push'](_0x412ec4['shift']());}};_0x52e28b(++_0x1dc62a);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var logger=require(_0x8ba1('0x2'))(_0x8ba1('0x3'));var moment=require(_0x8ba1('0x4'));var BPromise=require(_0x8ba1('0x5'));var rp=require(_0x8ba1('0x6'));var fs=require('fs');var path=require(_0x8ba1('0x7'));var rimraf=require('rimraf');var config=require(_0x8ba1('0x8'));var attributes=require(_0x8ba1('0x9'));var integrations=require(_0x8ba1('0xa'));module[_0x8ba1('0xb')]=function(_0x3b107c,_0x2ffa15){return _0x3b107c['define'](_0x8ba1('0xc'),attributes,{'tableName':_0x8ba1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4dc6c4,_0x49709e,_0x4aa3e3){if(_0x4dc6c4[_0x8ba1('0xe')](_0x8ba1('0xf'))||_0x4dc6c4['changed'](_0x8ba1('0x10'))||_0x4dc6c4[_0x8ba1('0xe')](_0x8ba1('0x11'))||_0x4dc6c4[_0x8ba1('0xe')](_0x8ba1('0x12'))||_0x4dc6c4['changed'](_0x8ba1('0x13'))||_0x4dc6c4[_0x8ba1('0xe')](_0x8ba1('0x14'))){var _0x1fcfd7,_0x29adbb;_0x1fcfd7=_0x4dc6c4[_0x8ba1('0x10')];var _0x58e32b=_0x1fcfd7[_0x8ba1('0x15')](-0x1);if(_0x58e32b==='/'||_0x58e32b==='\x5c'||_0x58e32b===':'){_0x1fcfd7=_0x1fcfd7[_0x8ba1('0x16')](0x0,_0x1fcfd7[_0x8ba1('0x17')](_0x58e32b));}switch(_0x4dc6c4[_0x8ba1('0xf')]){case'US':_0x29adbb='https://accounts.zoho.com';break;case'AU':_0x29adbb='https://accounts.zoho.com.au';break;case'IN':_0x29adbb='https://accounts.zoho.in';break;case'CN':_0x29adbb=_0x8ba1('0x18');break;default:_0x29adbb=_0x8ba1('0x19');break;}var _0x5a3a8a={'method':_0x8ba1('0x1a'),'uri':_0x29adbb+_0x8ba1('0x1b'),'form':{'grant_type':_0x8ba1('0x1c'),'client_id':_0x4dc6c4[_0x8ba1('0x11')],'client_secret':_0x4dc6c4[_0x8ba1('0x12')],'redirect_uri':_0x4dc6c4[_0x8ba1('0x10')],'code':_0x4dc6c4[_0x8ba1('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x5a3a8a)['then'](function(_0x1a48fa){var _0x360f00=JSON['parse'](_0x1a48fa);if(_0x360f00[_0x8ba1('0x1d')]){_0x4dc6c4[_0x8ba1('0x1e')]=_0x360f00[_0x8ba1('0x1d')];logger[_0x8ba1('0x1f')](util[_0x8ba1('0x20')](_0x8ba1('0x21'),_0x4dc6c4['name'],_0x4dc6c4['id']));}else{logger[_0x8ba1('0x22')](util['format'](_0x8ba1('0x23'),_0x4dc6c4[_0x8ba1('0x24')],_0x4dc6c4['id']),util[_0x8ba1('0x25')](_0x360f00,{'showHidden':![],'depth':null}));}return _0x4aa3e3(null,_0x49709e);})[_0x8ba1('0x26')](function(_0x4e66e1){logger[_0x8ba1('0x22')](util[_0x8ba1('0x20')](_0x8ba1('0x23'),_0x4dc6c4[_0x8ba1('0x24')],_0x4dc6c4['id']),util[_0x8ba1('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4aa3e3(_0x4e66e1);});}else{return _0x4aa3e3(null,_0x49709e);}},'beforeUpdate':function(_0x3b70ea,_0x845108,_0x1c51ef){if(_0x3b70ea[_0x8ba1('0xe')](_0x8ba1('0xf'))||_0x3b70ea[_0x8ba1('0xe')]('serverUrl')||_0x3b70ea['changed'](_0x8ba1('0x11'))||_0x3b70ea[_0x8ba1('0xe')]('clientSecret')||_0x3b70ea[_0x8ba1('0xe')](_0x8ba1('0x13'))||_0x3b70ea[_0x8ba1('0xe')](_0x8ba1('0x14'))){var _0x15e419,_0x8d8220;_0x15e419=_0x3b70ea[_0x8ba1('0x10')];var _0x26288a=_0x15e419[_0x8ba1('0x15')](-0x1);if(_0x26288a==='/'||_0x26288a==='\x5c'||_0x26288a===':'){_0x15e419=_0x15e419[_0x8ba1('0x16')](0x0,_0x15e419[_0x8ba1('0x17')](_0x26288a));}switch(_0x3b70ea[_0x8ba1('0xf')]){case'US':_0x8d8220=_0x8ba1('0x27');break;case'AU':_0x8d8220=_0x8ba1('0x28');break;case'IN':_0x8d8220='https://accounts.zoho.in';break;case'CN':_0x8d8220=_0x8ba1('0x18');break;default:_0x8d8220=_0x8ba1('0x19');break;}var _0x22059f={'method':_0x8ba1('0x1a'),'uri':_0x8d8220+_0x8ba1('0x1b'),'form':{'grant_type':_0x8ba1('0x1c'),'client_id':_0x3b70ea['clientId'],'client_secret':_0x3b70ea[_0x8ba1('0x12')],'redirect_uri':_0x3b70ea[_0x8ba1('0x10')],'code':_0x3b70ea['code']},'headers':{'Content-Type':_0x8ba1('0x29')}};return rp(_0x22059f)['then'](function(_0x1fb817){var _0x18db21=JSON['parse'](_0x1fb817);if(_0x18db21[_0x8ba1('0x1d')]){_0x3b70ea[_0x8ba1('0x1e')]=_0x18db21[_0x8ba1('0x1d')];logger[_0x8ba1('0x1f')](util[_0x8ba1('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b70ea[_0x8ba1('0x24')],_0x3b70ea['id']));}else{logger[_0x8ba1('0x22')](util[_0x8ba1('0x20')](_0x8ba1('0x23'),_0x3b70ea[_0x8ba1('0x24')],_0x3b70ea['id']),util[_0x8ba1('0x25')](_0x18db21,{'showHidden':![],'depth':null}));}return _0x1c51ef(null,_0x845108);})[_0x8ba1('0x26')](function(_0x3303fe){logger['error'](util[_0x8ba1('0x20')](_0x8ba1('0x23'),_0x3b70ea[_0x8ba1('0x24')],_0x3b70ea['id']),util[_0x8ba1('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1c51ef(_0x3303fe);});}else{return _0x1c51ef(null,_0x845108);}}}});}; \ No newline at end of file +var _0xed0c=['lodash','util','api','moment','request-promise','path','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','zone','POST','then'];(function(_0xf2d1bf,_0x19c53a){var _0x388d2c=function(_0x217e55){while(--_0x217e55){_0xf2d1bf['push'](_0xf2d1bf['shift']());}};_0x388d2c(++_0x19c53a);}(_0xed0c,0x186));var _0xced0=function(_0x17180f,_0x21ecbc){_0x17180f=_0x17180f-0x0;var _0x53ead4=_0xed0c[_0x17180f];return _0x53ead4;};'use strict';var _=require(_0xced0('0x0'));var util=require(_0xced0('0x1'));var logger=require('../../config/logger')(_0xced0('0x2'));var moment=require(_0xced0('0x3'));var BPromise=require('bluebird');var rp=require(_0xced0('0x4'));var fs=require('fs');var path=require(_0xced0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced0('0x6'));var integrations=require(_0xced0('0x7'));module['exports']=function(_0x49fca1,_0x37d5f2){return _0x49fca1['define'](_0xced0('0x8'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x360c98,_0x34c69a,_0x21bbfd){if(_0x360c98[_0xced0('0x9')]('zone')||_0x360c98[_0xced0('0x9')](_0xced0('0xa'))||_0x360c98[_0xced0('0x9')](_0xced0('0xb'))||_0x360c98[_0xced0('0x9')](_0xced0('0xc'))||_0x360c98[_0xced0('0x9')](_0xced0('0xd'))||_0x360c98[_0xced0('0x9')](_0xced0('0xe'))){var _0x34a5a9,_0x2959d3;_0x34a5a9=_0x360c98[_0xced0('0xa')];var _0x515d7a=_0x34a5a9[_0xced0('0xf')](-0x1);if(_0x515d7a==='/'||_0x515d7a==='\x5c'||_0x515d7a===':'){_0x34a5a9=_0x34a5a9['substring'](0x0,_0x34a5a9[_0xced0('0x10')](_0x515d7a));}switch(_0x360c98['zone']){case'US':_0x2959d3=_0xced0('0x11');break;case'AU':_0x2959d3=_0xced0('0x12');break;case'IN':_0x2959d3=_0xced0('0x13');break;case'CN':_0x2959d3=_0xced0('0x14');break;default:_0x2959d3=_0xced0('0x15');break;}var _0x287075={'method':'POST','uri':_0x2959d3+_0xced0('0x16'),'form':{'grant_type':_0xced0('0x17'),'client_id':_0x360c98[_0xced0('0xb')],'client_secret':_0x360c98[_0xced0('0xc')],'redirect_uri':_0x360c98[_0xced0('0xa')],'code':_0x360c98[_0xced0('0xd')]},'headers':{'Content-Type':_0xced0('0x18')}};return rp(_0x287075)['then'](function(_0x101fcd){var _0x5c5bec=JSON[_0xced0('0x19')](_0x101fcd);if(_0x5c5bec[_0xced0('0x1a')]){_0x360c98[_0xced0('0x1b')]=_0x5c5bec[_0xced0('0x1a')];logger[_0xced0('0x1c')](util[_0xced0('0x1d')](_0xced0('0x1e'),_0x360c98[_0xced0('0x1f')],_0x360c98['id']));}else{logger[_0xced0('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x360c98['name'],_0x360c98['id']),util[_0xced0('0x21')](_0x5c5bec,{'showHidden':![],'depth':null}));}return _0x21bbfd(null,_0x34c69a);})[_0xced0('0x22')](function(_0x598aa8){logger[_0xced0('0x20')](util[_0xced0('0x1d')](_0xced0('0x23'),_0x360c98[_0xced0('0x1f')],_0x360c98['id']),util[_0xced0('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x21bbfd(_0x598aa8);});}else{return _0x21bbfd(null,_0x34c69a);}},'beforeUpdate':function(_0x80148e,_0x1a5ef7,_0x2fcdd){if(_0x80148e[_0xced0('0x9')]('zone')||_0x80148e['changed'](_0xced0('0xa'))||_0x80148e[_0xced0('0x9')](_0xced0('0xb'))||_0x80148e['changed'](_0xced0('0xc'))||_0x80148e[_0xced0('0x9')](_0xced0('0xd'))||_0x80148e[_0xced0('0x9')](_0xced0('0xe'))){var _0x2c8a2f,_0x2850d5;_0x2c8a2f=_0x80148e[_0xced0('0xa')];var _0x531f13=_0x2c8a2f[_0xced0('0xf')](-0x1);if(_0x531f13==='/'||_0x531f13==='\x5c'||_0x531f13===':'){_0x2c8a2f=_0x2c8a2f['substring'](0x0,_0x2c8a2f[_0xced0('0x10')](_0x531f13));}switch(_0x80148e[_0xced0('0x24')]){case'US':_0x2850d5='https://accounts.zoho.com';break;case'AU':_0x2850d5=_0xced0('0x12');break;case'IN':_0x2850d5=_0xced0('0x13');break;case'CN':_0x2850d5=_0xced0('0x14');break;default:_0x2850d5=_0xced0('0x15');break;}var _0x4cac99={'method':_0xced0('0x25'),'uri':_0x2850d5+_0xced0('0x16'),'form':{'grant_type':_0xced0('0x17'),'client_id':_0x80148e[_0xced0('0xb')],'client_secret':_0x80148e[_0xced0('0xc')],'redirect_uri':_0x80148e[_0xced0('0xa')],'code':_0x80148e[_0xced0('0xd')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4cac99)[_0xced0('0x26')](function(_0x2c20b5){var _0x5db0d8=JSON['parse'](_0x2c20b5);if(_0x5db0d8['refresh_token']){_0x80148e[_0xced0('0x1b')]=_0x5db0d8[_0xced0('0x1a')];logger[_0xced0('0x1c')](util['format'](_0xced0('0x1e'),_0x80148e[_0xced0('0x1f')],_0x80148e['id']));}else{logger[_0xced0('0x20')](util[_0xced0('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x80148e[_0xced0('0x1f')],_0x80148e['id']),util[_0xced0('0x21')](_0x5db0d8,{'showHidden':![],'depth':null}));}return _0x2fcdd(null,_0x1a5ef7);})['catch'](function(_0x5e3a33){logger[_0xced0('0x20')](util[_0xced0('0x1d')](_0xced0('0x23'),_0x80148e['name'],_0x80148e['id']),util[_0xced0('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2fcdd(_0x5e3a33);});}else{return _0x2fcdd(null,_0x1a5ef7);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 15edafe..bb1d98c 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 _0x1b64=['ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowZohoAccount','ZohoAccount','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xebbe04,_0x205671){var _0x7c5654=function(_0xbba940){while(--_0xbba940){_0xebbe04['push'](_0xebbe04['shift']());}};_0x7c5654(++_0x205671);}(_0x1b64,0x76));var _0x41b6=function(_0xf9b8ce,_0x4796b5){_0xf9b8ce=_0xf9b8ce-0x0;var _0x1e85bd=_0x1b64[_0xf9b8ce];return _0x1e85bd;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var moment=require('moment');var BPromise=require(_0x41b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x41b6('0x3'));var logger=require(_0x41b6('0x4'))(_0x41b6('0x5'));var config=require(_0x41b6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x41b6('0x7')][_0x41b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5775c8,_0x56bd45,_0x4bb579){return new BPromise(function(_0x7763c3,_0x3cc6f8){return client[_0x41b6('0x9')](_0x5775c8,_0x4bb579)[_0x41b6('0xa')](function(_0x477e12){logger[_0x41b6('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x56bd45,_0x41b6('0xc'));logger[_0x41b6('0xd')](_0x41b6('0xe'),_0x56bd45,_0x41b6('0xc'),JSON[_0x41b6('0xf')](_0x477e12));if(_0x477e12[_0x41b6('0x10')]){if(_0x477e12[_0x41b6('0x10')][_0x41b6('0x11')]===0x1f4){logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x477e12[_0x41b6('0x10')][_0x41b6('0x13')]);return _0x3cc6f8(_0x477e12['error'][_0x41b6('0x13')]);}logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x477e12[_0x41b6('0x10')]['message']);return _0x7763c3(_0x477e12[_0x41b6('0x10')][_0x41b6('0x13')]);}else{logger[_0x41b6('0xb')](_0x41b6('0x12'),_0x56bd45,_0x41b6('0xc'));_0x7763c3(_0x477e12[_0x41b6('0x14')][_0x41b6('0x13')]);}})['catch'](function(_0x13ce57){logger[_0x41b6('0x10')](_0x41b6('0x12'),_0x56bd45,_0x13ce57);_0x3cc6f8(_0x13ce57);});});}exports[_0x41b6('0x15')]=function(_0x14a786){var _0x47feb9=this;return new Promise(function(_0x5637f6,_0x482baa){return db['ZohoAccount'][_0x41b6('0x16')]({'raw':_0x14a786['options']?_0x14a786[_0x41b6('0x17')][_0x41b6('0x18')]===undefined?!![]:![]:!![],'where':_0x14a786[_0x41b6('0x17')]?_0x14a786[_0x41b6('0x17')][_0x41b6('0x19')]||null:null,'attributes':_0x14a786[_0x41b6('0x17')]?_0x14a786['options']['attributes']||null:null,'limit':_0x14a786[_0x41b6('0x17')]?_0x14a786['options'][_0x41b6('0x1a')]||null:null,'include':_0x14a786[_0x41b6('0x17')]?_0x14a786[_0x41b6('0x17')][_0x41b6('0x1b')]?_[_0x41b6('0x1c')](_0x14a786[_0x41b6('0x17')][_0x41b6('0x1b')],function(_0x11cc02){return{'model':db[_0x11cc02[_0x41b6('0x1d')]],'as':_0x11cc02['as'],'attributes':_0x11cc02[_0x41b6('0x1e')],'include':_0x11cc02[_0x41b6('0x1b')]?_['map'](_0x11cc02[_0x41b6('0x1b')],function(_0x2c1290){return{'model':db[_0x2c1290['model']],'as':_0x2c1290['as'],'attributes':_0x2c1290[_0x41b6('0x1e')],'include':_0x2c1290[_0x41b6('0x1b')]?_['map'](_0x2c1290[_0x41b6('0x1b')],function(_0x454b5f){return{'model':db[_0x454b5f[_0x41b6('0x1d')]],'as':_0x454b5f['as'],'attributes':_0x454b5f['attributes']};}):[]};}):[]};}):[]:[]})[_0x41b6('0xa')](function(_0x5e431d){logger['info']('GetZohoAccount',_0x14a786);logger[_0x41b6('0xd')](_0x41b6('0x15'),_0x14a786,JSON['stringify'](_0x5e431d));_0x5637f6(_0x5e431d);})[_0x41b6('0x1f')](function(_0x45f9e2){logger[_0x41b6('0x10')](_0x41b6('0x15'),_0x45f9e2[_0x41b6('0x13')],_0x14a786);_0x482baa(_0x47feb9['error'](0x1f4,_0x45f9e2['message']));});});};exports[_0x41b6('0x20')]=function(_0x37bd7a){var _0x14e54b=this;return new Promise(function(_0x56b365,_0x626c53){return db[_0x41b6('0x21')]['find']({'raw':_0x37bd7a[_0x41b6('0x17')]?_0x37bd7a[_0x41b6('0x17')][_0x41b6('0x18')]===undefined?!![]:![]:!![],'where':_0x37bd7a[_0x41b6('0x17')]?_0x37bd7a[_0x41b6('0x17')][_0x41b6('0x19')]||null:null,'attributes':_0x37bd7a[_0x41b6('0x17')]?_0x37bd7a['options'][_0x41b6('0x1e')]||null:null,'include':_0x37bd7a['options']?_0x37bd7a['options'][_0x41b6('0x1b')]?_['map'](_0x37bd7a[_0x41b6('0x17')][_0x41b6('0x1b')],function(_0x2762de){return{'model':db[_0x2762de[_0x41b6('0x1d')]],'as':_0x2762de['as'],'attributes':_0x2762de[_0x41b6('0x1e')],'include':_0x2762de[_0x41b6('0x1b')]?_[_0x41b6('0x1c')](_0x2762de[_0x41b6('0x1b')],function(_0x486709){return{'model':db[_0x486709[_0x41b6('0x1d')]],'as':_0x486709['as'],'attributes':_0x486709[_0x41b6('0x1e')],'include':_0x486709[_0x41b6('0x1b')]?_[_0x41b6('0x1c')](_0x486709[_0x41b6('0x1b')],function(_0x1db13b){return{'model':db[_0x1db13b[_0x41b6('0x1d')]],'as':_0x1db13b['as'],'attributes':_0x1db13b['attributes']};}):[]};}):[]};}):[]:[]})[_0x41b6('0xa')](function(_0x5ca0c4){logger['info'](_0x41b6('0x20'),_0x37bd7a);logger[_0x41b6('0xd')](_0x41b6('0x20'),_0x37bd7a,JSON[_0x41b6('0xf')](_0x5ca0c4));_0x56b365(_0x5ca0c4);})[_0x41b6('0x1f')](function(_0x2291ba){logger['error'](_0x41b6('0x20'),_0x2291ba[_0x41b6('0x13')],_0x37bd7a);_0x626c53(_0x14e54b[_0x41b6('0x10')](0x1f4,_0x2291ba[_0x41b6('0x13')]));});});}; \ No newline at end of file +var _0xb4d9=['result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','find','ShowZohoAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x45f391,_0x2b343e){var _0x4a1838=function(_0x251899){while(--_0x251899){_0x45f391['push'](_0x45f391['shift']());}};_0x4a1838(++_0x2b343e);}(_0xb4d9,0xce));var _0x9b4d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb4d9[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var moment=require('moment');var BPromise=require(_0x9b4d('0x2'));var rs=require(_0x9b4d('0x3'));var fs=require('fs');var Redis=require(_0x9b4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b4d('0x5'));var logger=require(_0x9b4d('0x6'))(_0x9b4d('0x7'));var config=require(_0x9b4d('0x8'));var jayson=require(_0x9b4d('0x9'));var client=jayson[_0x9b4d('0xa')][_0x9b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429cc5,_0x461cb1,_0x14cb0b){return new BPromise(function(_0x156c68,_0x48832a){return client[_0x9b4d('0xc')](_0x429cc5,_0x14cb0b)['then'](function(_0x340b21){logger['info'](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));logger[_0x9b4d('0xf')](_0x9b4d('0x10'),_0x461cb1,_0x9b4d('0xe'),JSON[_0x9b4d('0x11')](_0x340b21));if(_0x340b21[_0x9b4d('0x12')]){if(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x13')]===0x1f4){logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21[_0x9b4d('0x12')]['message']);return _0x48832a(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x14')]);}logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21['error'][_0x9b4d('0x14')]);return _0x156c68(_0x340b21['error']['message']);}else{logger[_0x9b4d('0x15')](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));_0x156c68(_0x340b21[_0x9b4d('0x16')][_0x9b4d('0x14')]);}})[_0x9b4d('0x17')](function(_0x5d23f3){logger['error'](_0x9b4d('0xd'),_0x461cb1,_0x5d23f3);_0x48832a(_0x5d23f3);});});}exports[_0x9b4d('0x18')]=function(_0x15e808){var _0x25c32d=this;return new Promise(function(_0x1c52eb,_0x20e223){return db[_0x9b4d('0x19')][_0x9b4d('0x1a')]({'raw':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'limit':_0x15e808[_0x9b4d('0x1b')]?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x1f')]||null:null,'include':_0x15e808['options']?_0x15e808[_0x9b4d('0x1b')][_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x15e808['options'][_0x9b4d('0x20')],function(_0x5daeda){return{'model':db[_0x5daeda['model']],'as':_0x5daeda['as'],'attributes':_0x5daeda[_0x9b4d('0x1e')],'include':_0x5daeda['include']?_[_0x9b4d('0x21')](_0x5daeda[_0x9b4d('0x20')],function(_0x5607b7){return{'model':db[_0x5607b7[_0x9b4d('0x22')]],'as':_0x5607b7['as'],'attributes':_0x5607b7[_0x9b4d('0x1e')],'include':_0x5607b7[_0x9b4d('0x20')]?_['map'](_0x5607b7['include'],function(_0x465013){return{'model':db[_0x465013[_0x9b4d('0x22')]],'as':_0x465013['as'],'attributes':_0x465013['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0x5d639b){logger[_0x9b4d('0x15')]('GetZohoAccount',_0x15e808);logger[_0x9b4d('0xf')]('GetZohoAccount',_0x15e808,JSON[_0x9b4d('0x11')](_0x5d639b));_0x1c52eb(_0x5d639b);})[_0x9b4d('0x17')](function(_0x5e9d1b){logger[_0x9b4d('0x12')]('GetZohoAccount',_0x5e9d1b['message'],_0x15e808);_0x20e223(_0x25c32d[_0x9b4d('0x12')](0x1f4,_0x5e9d1b[_0x9b4d('0x14')]));});});};exports['ShowZohoAccount']=function(_0x51459b){var _0xe5980d=this;return new Promise(function(_0x3b1954,_0x1da4ab){return db[_0x9b4d('0x19')][_0x9b4d('0x24')]({'raw':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1c')]===undefined?!![]:![]:!![],'where':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1d')]||null:null,'attributes':_0x51459b[_0x9b4d('0x1b')]?_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x1e')]||null:null,'include':_0x51459b[_0x9b4d('0x1b')]?_0x51459b['options'][_0x9b4d('0x20')]?_['map'](_0x51459b[_0x9b4d('0x1b')][_0x9b4d('0x20')],function(_0x141989){return{'model':db[_0x141989[_0x9b4d('0x22')]],'as':_0x141989['as'],'attributes':_0x141989[_0x9b4d('0x1e')],'include':_0x141989[_0x9b4d('0x20')]?_[_0x9b4d('0x21')](_0x141989['include'],function(_0x1b99b7){return{'model':db[_0x1b99b7[_0x9b4d('0x22')]],'as':_0x1b99b7['as'],'attributes':_0x1b99b7[_0x9b4d('0x1e')],'include':_0x1b99b7['include']?_['map'](_0x1b99b7[_0x9b4d('0x20')],function(_0x47bff3){return{'model':db[_0x47bff3['model']],'as':_0x47bff3['as'],'attributes':_0x47bff3[_0x9b4d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b4d('0x23')](function(_0xb588fe){logger[_0x9b4d('0x15')](_0x9b4d('0x25'),_0x51459b);logger['debug'](_0x9b4d('0x25'),_0x51459b,JSON[_0x9b4d('0x11')](_0xb588fe));_0x3b1954(_0xb588fe);})['catch'](function(_0xf5842){logger[_0x9b4d('0x12')](_0x9b4d('0x25'),_0xf5842[_0x9b4d('0x14')],_0x51459b);_0x1da4ab(_0xe5980d[_0x9b4d('0x12')](0x1f4,_0xf5842['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 53ef862..ea4236b 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 _0x6c50=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5cf6eb,_0x5be218){var _0x5489c2=function(_0x588f2a){while(--_0x588f2a){_0x5cf6eb['push'](_0x5cf6eb['shift']());}};_0x5489c2(++_0x5be218);}(_0x6c50,0x95));var _0x06c5=function(_0x2cfbf3,_0x1d84dd){_0x2cfbf3=_0x2cfbf3-0x0;var _0x43a648=_0x6c50[_0x2cfbf3];return _0x43a648;};'use strict';var multer=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var path=require(_0x06c5('0x2'));var timeout=require(_0x06c5('0x3'));var express=require('express');var router=express[_0x06c5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x06c5('0x5'));var interaction=require(_0x06c5('0x6'));var config=require('../../config/environment');var controller=require(_0x06c5('0x7'));router[_0x06c5('0x8')]('/',auth[_0x06c5('0x9')](),controller[_0x06c5('0xa')]);router[_0x06c5('0x8')](_0x06c5('0xb'),auth[_0x06c5('0x9')](),controller['show']);router['get'](_0x06c5('0xc'),auth[_0x06c5('0x9')](),controller[_0x06c5('0xd')]);router[_0x06c5('0x8')](_0x06c5('0xe'),auth['isAuthenticated'](),controller[_0x06c5('0xf')]);router[_0x06c5('0x8')](_0x06c5('0x10'),auth['isAuthenticated'](),controller[_0x06c5('0x11')]);router[_0x06c5('0x12')]('/',auth['isAuthenticated'](),controller[_0x06c5('0x13')]);router[_0x06c5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x06c5('0x15')]);router[_0x06c5('0x16')](_0x06c5('0xb'),auth[_0x06c5('0x9')](),controller[_0x06c5('0x17')]);module[_0x06c5('0x18')]=router; \ No newline at end of file +var _0x3732=['index','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x48437d,_0x326d82){var _0x200808=function(_0x50d749){while(--_0x50d749){_0x48437d['push'](_0x48437d['shift']());}};_0x200808(++_0x326d82);}(_0x3732,0x1ec));var _0x2373=function(_0x127dd4,_0x3c8951){_0x127dd4=_0x127dd4-0x0;var _0x362e49=_0x3732[_0x127dd4];return _0x362e49;};'use strict';var multer=require('multer');var util=require(_0x2373('0x0'));var path=require(_0x2373('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2373('0x2')]();var fs_extra=require(_0x2373('0x3'));var auth=require(_0x2373('0x4'));var interaction=require(_0x2373('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x2373('0x6')]('/',auth[_0x2373('0x7')](),controller[_0x2373('0x8')]);router[_0x2373('0x6')]('/:id',auth[_0x2373('0x7')](),controller['show']);router[_0x2373('0x6')](_0x2373('0x9'),auth[_0x2373('0x7')](),controller[_0x2373('0xa')]);router['get'](_0x2373('0xb'),auth[_0x2373('0x7')](),controller['getSubjects']);router[_0x2373('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2373('0xc')]);router['post']('/',auth[_0x2373('0x7')](),controller[_0x2373('0xd')]);router[_0x2373('0xe')](_0x2373('0xf'),auth[_0x2373('0x7')](),controller[_0x2373('0x10')]);router[_0x2373('0x11')]('/:id',auth[_0x2373('0x7')](),controller[_0x2373('0x12')]);module[_0x2373('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 47be25f..a300bf8 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 _0xa42e=['sequelize','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x232559,_0x1d1fce){var _0x47c29d=function(_0x365209){while(--_0x365209){_0x232559['push'](_0x232559['shift']());}};_0x47c29d(++_0x1d1fce);}(_0xa42e,0xe7));var _0xea42=function(_0x491814,_0x1ab2ac){_0x491814=_0x491814-0x0;var _0x2e1502=_0xa42e[_0x491814];return _0x2e1502;};'use strict';var Sequelize=require(_0xea42('0x0'));module['exports']={'name':{'type':Sequelize[_0xea42('0x1')]},'moduleCreate':{'type':Sequelize[_0xea42('0x2')](_0xea42('0x3'),_0xea42('0x4'),_0xea42('0x5')),'defaultValue':_0xea42('0x3')},'moduleSearch':{'type':Sequelize[_0xea42('0x2')](_0xea42('0x6'),_0xea42('0x4'),_0xea42('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xea42('0x1')]}}; \ No newline at end of file +var _0x6626=['contact','nothing','contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6626,0x183));var _0x6662=function(_0x192efe,_0x13a2ea){_0x192efe=_0x192efe-0x0;var _0x55e97d=_0x6626[_0x192efe];return _0x55e97d;};'use strict';var Sequelize=require(_0x6662('0x0'));module[_0x6662('0x1')]={'name':{'type':Sequelize[_0x6662('0x2')]},'moduleCreate':{'type':Sequelize[_0x6662('0x3')](_0x6662('0x4'),_0x6662('0x5'),_0x6662('0x6')),'defaultValue':_0x6662('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x6662('0x7'),'contact',_0x6662('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index de44e2d..5890861 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 _0xff04=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','rawAttributes','length','include','find','create','body','update','getFields','ZohoField','findOne','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xff04,0x136));var _0x4ff0=function(_0x553d92,_0x2e1200){_0x553d92=_0x553d92-0x0;var _0x1782a5=_0xff04[_0x553d92];return _0x1782a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ff0('0x0'));var zipdir=require(_0x4ff0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ff0('0x2'));var moment=require('moment');var BPromise=require(_0x4ff0('0x3'));var Mustache=require(_0x4ff0('0x4'));var util=require(_0x4ff0('0x5'));var path=require(_0x4ff0('0x6'));var sox=require(_0x4ff0('0x7'));var csv=require(_0x4ff0('0x8'));var ejs=require(_0x4ff0('0x9'));var fs=require('fs');var fs_extra=require(_0x4ff0('0xa'));var _=require(_0x4ff0('0xb'));var squel=require('squel');var crypto=require(_0x4ff0('0xc'));var jsforce=require(_0x4ff0('0xd'));var deskjs=require(_0x4ff0('0xe'));var toCsv=require(_0x4ff0('0x8'));var querystring=require('querystring');var Papa=require(_0x4ff0('0xf'));var Redis=require(_0x4ff0('0x10'));var authService=require(_0x4ff0('0x11'));var qs=require(_0x4ff0('0x12'));var as=require(_0x4ff0('0x13'));var hardwareService=require(_0x4ff0('0x14'));var logger=require(_0x4ff0('0x15'))(_0x4ff0('0x16'));var utils=require(_0x4ff0('0x17'));var config=require(_0x4ff0('0x18'));var licenseUtil=require(_0x4ff0('0x19'));var db=require(_0x4ff0('0x1a'))['db'];function respondWithStatusCode(_0x54be40,_0x25ecf3){_0x25ecf3=_0x25ecf3||0xcc;return function(_0x1746dd){if(_0x1746dd){return _0x54be40[_0x4ff0('0x1b')](_0x25ecf3);}return _0x54be40['status'](_0x25ecf3)[_0x4ff0('0x1c')]();};}function respondWithResult(_0x4e7ff7,_0x29be91){_0x29be91=_0x29be91||0xc8;return function(_0xacb29c){if(_0xacb29c){return _0x4e7ff7[_0x4ff0('0x1d')](_0x29be91)[_0x4ff0('0x1e')](_0xacb29c);}};}function respondWithFilteredResult(_0x44d588,_0xb9fb87){return function(_0x16cb62){if(_0x16cb62){var _0x369785=typeof _0xb9fb87[_0x4ff0('0x1f')]===_0x4ff0('0x20')&&typeof _0xb9fb87[_0x4ff0('0x21')]===_0x4ff0('0x20');var _0x4b75ae=_0x16cb62['count'];var _0x422f40=_0x369785?0x0:_0xb9fb87[_0x4ff0('0x1f')];var _0x308a19=_0x369785?_0x16cb62[_0x4ff0('0x22')]:_0xb9fb87[_0x4ff0('0x1f')]+_0xb9fb87[_0x4ff0('0x21')];var _0x5293e1;if(_0x308a19>=_0x4b75ae){_0x308a19=_0x4b75ae;_0x5293e1=0xc8;}else{_0x5293e1=0xce;}_0x44d588['status'](_0x5293e1);return _0x44d588[_0x4ff0('0x23')](_0x4ff0('0x24'),_0x422f40+'-'+_0x308a19+'/'+_0x4b75ae)[_0x4ff0('0x1e')](_0x16cb62);}return null;};}function patchUpdates(_0x141e67){return function(_0x4abaf6){try{jsonpatch[_0x4ff0('0x25')](_0x4abaf6,_0x141e67,!![]);}catch(_0x597ef3){return BPromise[_0x4ff0('0x26')](_0x597ef3);}return _0x4abaf6[_0x4ff0('0x27')]();};}function saveUpdates(_0x2f14bd,_0x5b0985){return function(_0x54339e){if(_0x54339e){return _0x54339e['update'](_0x2f14bd)[_0x4ff0('0x28')](function(_0x102528){return _0x102528;});}return null;};}function removeEntity(_0x1f695a,_0x53fa3c){return function(_0x31e5b5){if(_0x31e5b5){return _0x31e5b5[_0x4ff0('0x29')]()[_0x4ff0('0x28')](function(){_0x1f695a[_0x4ff0('0x1d')](0xcc)[_0x4ff0('0x1c')]();});}};}function handleEntityNotFound(_0x10d974,_0x5b6481){return function(_0x9bbd68){if(!_0x9bbd68){_0x10d974['sendStatus'](0x194);}return _0x9bbd68;};}function handleError(_0x2e9e4e,_0x2f4e7f){_0x2f4e7f=_0x2f4e7f||0x1f4;return function(_0x3c8a81){logger[_0x4ff0('0x2a')](_0x3c8a81[_0x4ff0('0x2b')]);if(_0x3c8a81[_0x4ff0('0x2c')]){delete _0x3c8a81[_0x4ff0('0x2c')];}_0x2e9e4e[_0x4ff0('0x1d')](_0x2f4e7f)[_0x4ff0('0x2d')](_0x3c8a81);};}exports[_0x4ff0('0x2e')]=function(_0x4f373b,_0xa4de3f){var _0x29e212={},_0x2e92ad={},_0xf51404={'count':0x0,'rows':[]};var _0x11f75e=_[_0x4ff0('0x2f')](db[_0x4ff0('0x30')]['rawAttributes'],function(_0x4bc45d){return{'name':_0x4bc45d[_0x4ff0('0x31')],'type':_0x4bc45d[_0x4ff0('0x32')][_0x4ff0('0x33')]};});_0x2e92ad[_0x4ff0('0x34')]=_['map'](_0x11f75e,'name');_0x2e92ad[_0x4ff0('0x35')]=_[_0x4ff0('0x36')](_0x4f373b['query']);_0x2e92ad[_0x4ff0('0x37')]=_[_0x4ff0('0x38')](_0x2e92ad[_0x4ff0('0x34')],_0x2e92ad[_0x4ff0('0x35')]);_0x29e212['attributes']=_[_0x4ff0('0x38')](_0x2e92ad[_0x4ff0('0x34')],qs[_0x4ff0('0x39')](_0x4f373b[_0x4ff0('0x35')][_0x4ff0('0x39')]));_0x29e212[_0x4ff0('0x3a')]=_0x29e212[_0x4ff0('0x3a')]['length']?_0x29e212[_0x4ff0('0x3a')]:_0x2e92ad['model'];if(!_0x4f373b['query'][_0x4ff0('0x3b')](_0x4ff0('0x3c'))){_0x29e212['limit']=qs[_0x4ff0('0x21')](_0x4f373b[_0x4ff0('0x35')][_0x4ff0('0x21')]);_0x29e212[_0x4ff0('0x1f')]=qs[_0x4ff0('0x1f')](_0x4f373b[_0x4ff0('0x35')][_0x4ff0('0x1f')]);}_0x29e212[_0x4ff0('0x3d')]=qs[_0x4ff0('0x3e')](_0x4f373b[_0x4ff0('0x35')]['sort']);_0x29e212[_0x4ff0('0x3f')]=qs['filters'](_[_0x4ff0('0x40')](_0x4f373b['query'],_0x2e92ad[_0x4ff0('0x37')]),_0x11f75e);if(_0x4f373b['query'][_0x4ff0('0x41')]){_0x29e212['where']=_[_0x4ff0('0x42')](_0x29e212['where'],{'$or':_[_0x4ff0('0x2f')](_0x11f75e,function(_0x7aaacc){if(_0x7aaacc[_0x4ff0('0x32')]!==_0x4ff0('0x43')){var _0x4c56d3={};_0x4c56d3[_0x7aaacc[_0x4ff0('0x2c')]]={'$like':'%'+_0x4f373b['query'][_0x4ff0('0x41')]+'%'};return _0x4c56d3;}})});}_0x29e212=_[_0x4ff0('0x42')]({},_0x29e212,_0x4f373b[_0x4ff0('0x44')]);var _0xae4d5d={'where':_0x29e212['where']};return db[_0x4ff0('0x30')]['count'](_0xae4d5d)['then'](function(_0x2dda7c){_0xf51404['count']=_0x2dda7c;if(_0x4f373b[_0x4ff0('0x35')]['includeAll']){_0x29e212['include']=[{'all':!![]}];}return db[_0x4ff0('0x30')][_0x4ff0('0x45')](_0x29e212);})['then'](function(_0x48355b){_0xf51404[_0x4ff0('0x46')]=_0x48355b;return _0xf51404;})[_0x4ff0('0x28')](respondWithFilteredResult(_0xa4de3f,_0x29e212))[_0x4ff0('0x47')](handleError(_0xa4de3f,null));};exports['show']=function(_0x3f6bf5,_0x16c537){var _0x18aff9={'raw':![],'where':{'id':_0x3f6bf5[_0x4ff0('0x48')]['id']}},_0x3544ac={};_0x3544ac['model']=_['keys'](db['ZohoConfiguration'][_0x4ff0('0x49')]);_0x3544ac[_0x4ff0('0x35')]=_[_0x4ff0('0x36')](_0x3f6bf5[_0x4ff0('0x35')]);_0x3544ac[_0x4ff0('0x37')]=_[_0x4ff0('0x38')](_0x3544ac[_0x4ff0('0x34')],_0x3544ac[_0x4ff0('0x35')]);_0x18aff9[_0x4ff0('0x3a')]=_[_0x4ff0('0x38')](_0x3544ac['model'],qs[_0x4ff0('0x39')](_0x3f6bf5[_0x4ff0('0x35')][_0x4ff0('0x39')]));_0x18aff9[_0x4ff0('0x3a')]=_0x18aff9[_0x4ff0('0x3a')][_0x4ff0('0x4a')]?_0x18aff9[_0x4ff0('0x3a')]:_0x3544ac[_0x4ff0('0x34')];if(_0x3f6bf5[_0x4ff0('0x35')]['includeAll']){_0x18aff9[_0x4ff0('0x4b')]=[{'all':!![]}];}_0x18aff9=_['merge']({},_0x18aff9,_0x3f6bf5[_0x4ff0('0x44')]);return db[_0x4ff0('0x30')][_0x4ff0('0x4c')](_0x18aff9)[_0x4ff0('0x28')](handleEntityNotFound(_0x16c537,null))['then'](respondWithResult(_0x16c537,null))[_0x4ff0('0x47')](handleError(_0x16c537,null));};exports[_0x4ff0('0x4d')]=function(_0x403ae0,_0x3cc300){return db[_0x4ff0('0x30')][_0x4ff0('0x4d')](_0x403ae0[_0x4ff0('0x4e')],{})[_0x4ff0('0x28')](respondWithResult(_0x3cc300,0xc9))['catch'](handleError(_0x3cc300,null));};exports[_0x4ff0('0x4f')]=function(_0x191007,_0x4f830c){if(_0x191007[_0x4ff0('0x4e')]['id']){delete _0x191007[_0x4ff0('0x4e')]['id'];}return db[_0x4ff0('0x30')][_0x4ff0('0x4c')]({'where':{'id':_0x191007['params']['id']}})[_0x4ff0('0x28')](handleEntityNotFound(_0x4f830c,null))['then'](saveUpdates(_0x191007[_0x4ff0('0x4e')],null))[_0x4ff0('0x28')](respondWithResult(_0x4f830c,null))[_0x4ff0('0x47')](handleError(_0x4f830c,null));};exports['destroy']=function(_0x2074af,_0x3c1e9b){return db[_0x4ff0('0x30')][_0x4ff0('0x4c')]({'where':{'id':_0x2074af['params']['id']}})['then'](handleEntityNotFound(_0x3c1e9b,null))['then'](removeEntity(_0x3c1e9b,null))[_0x4ff0('0x47')](handleError(_0x3c1e9b,null));};exports[_0x4ff0('0x50')]=function(_0x243213,_0x176533,_0x2a9300){var _0x7dcf6d={};var _0x55b589={};var _0x89f503;var _0x6c4bbc;return db[_0x4ff0('0x30')]['findOne']({'where':{'id':_0x243213[_0x4ff0('0x48')]['id']}})['then'](handleEntityNotFound(_0x176533,null))['then'](function(_0x1c420e){if(_0x1c420e){_0x89f503=_0x1c420e;_0x55b589[_0x4ff0('0x34')]=_[_0x4ff0('0x36')](db[_0x4ff0('0x51')][_0x4ff0('0x49')]);_0x55b589[_0x4ff0('0x35')]=_[_0x4ff0('0x36')](_0x243213[_0x4ff0('0x35')]);_0x55b589[_0x4ff0('0x37')]=_[_0x4ff0('0x38')](_0x55b589[_0x4ff0('0x34')],_0x55b589[_0x4ff0('0x35')]);_0x7dcf6d['attributes']=_[_0x4ff0('0x38')](_0x55b589[_0x4ff0('0x34')],qs[_0x4ff0('0x39')](_0x243213[_0x4ff0('0x35')]['fields']));_0x7dcf6d['attributes']=_0x7dcf6d[_0x4ff0('0x3a')][_0x4ff0('0x4a')]?_0x7dcf6d[_0x4ff0('0x3a')]:_0x55b589[_0x4ff0('0x34')];_0x7dcf6d[_0x4ff0('0x3d')]=qs['sort'](_0x243213[_0x4ff0('0x35')][_0x4ff0('0x3e')]);_0x7dcf6d['where']=qs['filters'](_[_0x4ff0('0x40')](_0x243213[_0x4ff0('0x35')],_0x55b589['filters']));if(_0x243213[_0x4ff0('0x35')][_0x4ff0('0x41')]){_0x7dcf6d[_0x4ff0('0x3f')]=_[_0x4ff0('0x42')](_0x7dcf6d[_0x4ff0('0x3f')],{'$or':_[_0x4ff0('0x2f')](_0x7dcf6d[_0x4ff0('0x3a')],function(_0x5cefb0){var _0x1b2009={};_0x1b2009[_0x5cefb0]={'$like':'%'+_0x243213['query'][_0x4ff0('0x41')]+'%'};return _0x1b2009;})});}_0x7dcf6d=_['merge']({},_0x7dcf6d,_0x243213[_0x4ff0('0x44')]);return _0x89f503[_0x4ff0('0x50')](_0x7dcf6d);}})[_0x4ff0('0x28')](function(_0x1dda15){if(_0x1dda15){_0x6c4bbc=_0x1dda15[_0x4ff0('0x4a')];if(!_0x243213[_0x4ff0('0x35')][_0x4ff0('0x3b')](_0x4ff0('0x3c'))){_0x7dcf6d[_0x4ff0('0x21')]=qs[_0x4ff0('0x21')](_0x243213[_0x4ff0('0x35')][_0x4ff0('0x21')]);_0x7dcf6d[_0x4ff0('0x1f')]=qs[_0x4ff0('0x1f')](_0x243213[_0x4ff0('0x35')][_0x4ff0('0x1f')]);}return _0x89f503[_0x4ff0('0x50')](_0x7dcf6d);}})[_0x4ff0('0x28')](function(_0x223774){if(_0x223774){return _0x223774?{'count':_0x6c4bbc,'rows':_0x223774}:null;}})[_0x4ff0('0x28')](respondWithResult(_0x176533,null))['catch'](handleError(_0x176533,null));};exports['getSubjects']=function(_0x1eb48c,_0x529f9d,_0x4f9f00){var _0x36a008={};var _0x4e2d5d={};var _0x136350;var _0x2878e9;return db[_0x4ff0('0x30')][_0x4ff0('0x52')]({'where':{'id':_0x1eb48c[_0x4ff0('0x48')]['id']}})['then'](handleEntityNotFound(_0x529f9d,null))['then'](function(_0x457289){if(_0x457289){_0x136350=_0x457289;_0x4e2d5d['model']=_[_0x4ff0('0x36')](db[_0x4ff0('0x51')][_0x4ff0('0x49')]);_0x4e2d5d['query']=_[_0x4ff0('0x36')](_0x1eb48c['query']);_0x4e2d5d[_0x4ff0('0x37')]=_[_0x4ff0('0x38')](_0x4e2d5d[_0x4ff0('0x34')],_0x4e2d5d['query']);_0x36a008[_0x4ff0('0x3a')]=_[_0x4ff0('0x38')](_0x4e2d5d['model'],qs[_0x4ff0('0x39')](_0x1eb48c[_0x4ff0('0x35')]['fields']));_0x36a008[_0x4ff0('0x3a')]=_0x36a008[_0x4ff0('0x3a')][_0x4ff0('0x4a')]?_0x36a008[_0x4ff0('0x3a')]:_0x4e2d5d[_0x4ff0('0x34')];_0x36a008[_0x4ff0('0x3d')]=qs[_0x4ff0('0x3e')](_0x1eb48c[_0x4ff0('0x35')][_0x4ff0('0x3e')]);_0x36a008[_0x4ff0('0x3f')]=qs['filters'](_[_0x4ff0('0x40')](_0x1eb48c[_0x4ff0('0x35')],_0x4e2d5d[_0x4ff0('0x37')]));if(_0x1eb48c['query'][_0x4ff0('0x41')]){_0x36a008['where']=_[_0x4ff0('0x42')](_0x36a008[_0x4ff0('0x3f')],{'$or':_['map'](_0x36a008[_0x4ff0('0x3a')],function(_0x45ff7f){var _0x235cfe={};_0x235cfe[_0x45ff7f]={'$like':'%'+_0x1eb48c[_0x4ff0('0x35')][_0x4ff0('0x41')]+'%'};return _0x235cfe;})});}_0x36a008=_[_0x4ff0('0x42')]({},_0x36a008,_0x1eb48c[_0x4ff0('0x44')]);return _0x136350[_0x4ff0('0x53')](_0x36a008);}})[_0x4ff0('0x28')](function(_0x4c66da){if(_0x4c66da){_0x2878e9=_0x4c66da['length'];if(!_0x1eb48c['query'][_0x4ff0('0x3b')](_0x4ff0('0x3c'))){_0x36a008[_0x4ff0('0x21')]=qs[_0x4ff0('0x21')](_0x1eb48c[_0x4ff0('0x35')][_0x4ff0('0x21')]);_0x36a008[_0x4ff0('0x1f')]=qs[_0x4ff0('0x1f')](_0x1eb48c[_0x4ff0('0x35')][_0x4ff0('0x1f')]);}return _0x136350[_0x4ff0('0x53')](_0x36a008);}})[_0x4ff0('0x28')](function(_0x3d1243){if(_0x3d1243){return _0x3d1243?{'count':_0x2878e9,'rows':_0x3d1243}:null;}})['then'](respondWithResult(_0x529f9d,null))[_0x4ff0('0x47')](handleError(_0x529f9d,null));};exports[_0x4ff0('0x54')]=function(_0x2ef4e4,_0x6f02fc,_0x53f766){var _0xe935e8={};var _0x1190bc={};var _0x6b52fb;var _0x51dfbd;return db['ZohoConfiguration'][_0x4ff0('0x52')]({'where':{'id':_0x2ef4e4['params']['id']}})[_0x4ff0('0x28')](handleEntityNotFound(_0x6f02fc,null))[_0x4ff0('0x28')](function(_0x5374a4){if(_0x5374a4){_0x6b52fb=_0x5374a4;_0x1190bc[_0x4ff0('0x34')]=_[_0x4ff0('0x36')](db[_0x4ff0('0x51')][_0x4ff0('0x49')]);_0x1190bc['query']=_['keys'](_0x2ef4e4[_0x4ff0('0x35')]);_0x1190bc[_0x4ff0('0x37')]=_[_0x4ff0('0x38')](_0x1190bc[_0x4ff0('0x34')],_0x1190bc[_0x4ff0('0x35')]);_0xe935e8[_0x4ff0('0x3a')]=_[_0x4ff0('0x38')](_0x1190bc[_0x4ff0('0x34')],qs[_0x4ff0('0x39')](_0x2ef4e4[_0x4ff0('0x35')][_0x4ff0('0x39')]));_0xe935e8[_0x4ff0('0x3a')]=_0xe935e8[_0x4ff0('0x3a')][_0x4ff0('0x4a')]?_0xe935e8[_0x4ff0('0x3a')]:_0x1190bc['model'];_0xe935e8[_0x4ff0('0x3d')]=qs[_0x4ff0('0x3e')](_0x2ef4e4[_0x4ff0('0x35')][_0x4ff0('0x3e')]);_0xe935e8[_0x4ff0('0x3f')]=qs[_0x4ff0('0x37')](_[_0x4ff0('0x40')](_0x2ef4e4[_0x4ff0('0x35')],_0x1190bc[_0x4ff0('0x37')]));if(_0x2ef4e4[_0x4ff0('0x35')][_0x4ff0('0x41')]){_0xe935e8[_0x4ff0('0x3f')]=_[_0x4ff0('0x42')](_0xe935e8[_0x4ff0('0x3f')],{'$or':_[_0x4ff0('0x2f')](_0xe935e8['attributes'],function(_0x5c80a9){var _0x3fbb4c={};_0x3fbb4c[_0x5c80a9]={'$like':'%'+_0x2ef4e4[_0x4ff0('0x35')]['filter']+'%'};return _0x3fbb4c;})});}_0xe935e8=_[_0x4ff0('0x42')]({},_0xe935e8,_0x2ef4e4[_0x4ff0('0x44')]);return _0x6b52fb[_0x4ff0('0x54')](_0xe935e8);}})[_0x4ff0('0x28')](function(_0x13d93b){if(_0x13d93b){_0x51dfbd=_0x13d93b[_0x4ff0('0x4a')];if(!_0x2ef4e4[_0x4ff0('0x35')]['hasOwnProperty'](_0x4ff0('0x3c'))){_0xe935e8[_0x4ff0('0x21')]=qs['limit'](_0x2ef4e4[_0x4ff0('0x35')][_0x4ff0('0x21')]);_0xe935e8[_0x4ff0('0x1f')]=qs[_0x4ff0('0x1f')](_0x2ef4e4[_0x4ff0('0x35')][_0x4ff0('0x1f')]);}return _0x6b52fb['getDescriptions'](_0xe935e8);}})[_0x4ff0('0x28')](function(_0x243c01){if(_0x243c01){return _0x243c01?{'count':_0x51dfbd,'rows':_0x243c01}:null;}})[_0x4ff0('0x28')](respondWithResult(_0x6f02fc,null))[_0x4ff0('0x47')](handleError(_0x6f02fc,null));}; \ No newline at end of file +var _0x9d08=['api','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','filters','find','create','body','findOne','ZohoField','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x9d08,0x13a));var _0x89d0=function(_0x5115c3,_0x427a4b){_0x5115c3=_0x5115c3-0x0;var _0x27336c=_0x9d08[_0x5115c3];return _0x27336c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89d0('0x0'));var zipdir=require(_0x89d0('0x1'));var jsonpatch=require(_0x89d0('0x2'));var rp=require(_0x89d0('0x3'));var moment=require(_0x89d0('0x4'));var BPromise=require(_0x89d0('0x5'));var Mustache=require(_0x89d0('0x6'));var util=require(_0x89d0('0x7'));var path=require(_0x89d0('0x8'));var sox=require(_0x89d0('0x9'));var csv=require(_0x89d0('0xa'));var ejs=require(_0x89d0('0xb'));var fs=require('fs');var fs_extra=require(_0x89d0('0xc'));var _=require(_0x89d0('0xd'));var squel=require(_0x89d0('0xe'));var crypto=require(_0x89d0('0xf'));var jsforce=require(_0x89d0('0x10'));var deskjs=require(_0x89d0('0x11'));var toCsv=require('to-csv');var querystring=require(_0x89d0('0x12'));var Papa=require(_0x89d0('0x13'));var Redis=require(_0x89d0('0x14'));var authService=require(_0x89d0('0x15'));var qs=require(_0x89d0('0x16'));var as=require(_0x89d0('0x17'));var hardwareService=require(_0x89d0('0x18'));var logger=require(_0x89d0('0x19'))(_0x89d0('0x1a'));var utils=require('../../config/utils');var config=require(_0x89d0('0x1b'));var licenseUtil=require(_0x89d0('0x1c'));var db=require(_0x89d0('0x1d'))['db'];function respondWithStatusCode(_0x4f56e5,_0x3f99c4){_0x3f99c4=_0x3f99c4||0xcc;return function(_0x492196){if(_0x492196){return _0x4f56e5['sendStatus'](_0x3f99c4);}return _0x4f56e5['status'](_0x3f99c4)['end']();};}function respondWithResult(_0x319558,_0x71beab){_0x71beab=_0x71beab||0xc8;return function(_0x134fcd){if(_0x134fcd){return _0x319558['status'](_0x71beab)['json'](_0x134fcd);}};}function respondWithFilteredResult(_0x1c0c1e,_0x45dac9){return function(_0x1b254d){if(_0x1b254d){var _0x12bb54=typeof _0x45dac9[_0x89d0('0x1e')]===_0x89d0('0x1f')&&typeof _0x45dac9[_0x89d0('0x20')]===_0x89d0('0x1f');var _0x17ec2e=_0x1b254d[_0x89d0('0x21')];var _0x535eb3=_0x12bb54?0x0:_0x45dac9[_0x89d0('0x1e')];var _0x540810=_0x12bb54?_0x1b254d[_0x89d0('0x21')]:_0x45dac9[_0x89d0('0x1e')]+_0x45dac9[_0x89d0('0x20')];var _0x4788ec;if(_0x540810>=_0x17ec2e){_0x540810=_0x17ec2e;_0x4788ec=0xc8;}else{_0x4788ec=0xce;}_0x1c0c1e[_0x89d0('0x22')](_0x4788ec);return _0x1c0c1e['set'](_0x89d0('0x23'),_0x535eb3+'-'+_0x540810+'/'+_0x17ec2e)[_0x89d0('0x24')](_0x1b254d);}return null;};}function patchUpdates(_0x5f4ded){return function(_0x2948be){try{jsonpatch[_0x89d0('0x25')](_0x2948be,_0x5f4ded,!![]);}catch(_0x5703cf){return BPromise[_0x89d0('0x26')](_0x5703cf);}return _0x2948be[_0x89d0('0x27')]();};}function saveUpdates(_0x5c9e37,_0x4414b7){return function(_0x4f4308){if(_0x4f4308){return _0x4f4308[_0x89d0('0x28')](_0x5c9e37)[_0x89d0('0x29')](function(_0x5eb006){return _0x5eb006;});}return null;};}function removeEntity(_0x45bae7,_0x5bbdb3){return function(_0x17b440){if(_0x17b440){return _0x17b440[_0x89d0('0x2a')]()[_0x89d0('0x29')](function(){_0x45bae7[_0x89d0('0x22')](0xcc)[_0x89d0('0x2b')]();});}};}function handleEntityNotFound(_0x16086d,_0x4264aa){return function(_0x2f7547){if(!_0x2f7547){_0x16086d[_0x89d0('0x2c')](0x194);}return _0x2f7547;};}function handleError(_0x978879,_0x5a9942){_0x5a9942=_0x5a9942||0x1f4;return function(_0x2c4983){logger[_0x89d0('0x2d')](_0x2c4983[_0x89d0('0x2e')]);if(_0x2c4983['name']){delete _0x2c4983[_0x89d0('0x2f')];}_0x978879[_0x89d0('0x22')](_0x5a9942)[_0x89d0('0x30')](_0x2c4983);};}exports['index']=function(_0x18b1b0,_0x15d6d1){var _0x15c0c1={},_0x35ac46={},_0x114ecb={'count':0x0,'rows':[]};var _0x357e6f=_[_0x89d0('0x31')](db[_0x89d0('0x32')][_0x89d0('0x33')],function(_0x350dee){return{'name':_0x350dee[_0x89d0('0x34')],'type':_0x350dee[_0x89d0('0x35')][_0x89d0('0x36')]};});_0x35ac46['model']=_[_0x89d0('0x31')](_0x357e6f,_0x89d0('0x2f'));_0x35ac46[_0x89d0('0x37')]=_[_0x89d0('0x38')](_0x18b1b0[_0x89d0('0x37')]);_0x35ac46['filters']=_['intersection'](_0x35ac46[_0x89d0('0x39')],_0x35ac46[_0x89d0('0x37')]);_0x15c0c1[_0x89d0('0x3a')]=_[_0x89d0('0x3b')](_0x35ac46[_0x89d0('0x39')],qs['fields'](_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x3c')]));_0x15c0c1[_0x89d0('0x3a')]=_0x15c0c1['attributes'][_0x89d0('0x3d')]?_0x15c0c1[_0x89d0('0x3a')]:_0x35ac46[_0x89d0('0x39')];if(!_0x18b1b0[_0x89d0('0x37')]['hasOwnProperty'](_0x89d0('0x3e'))){_0x15c0c1[_0x89d0('0x20')]=qs[_0x89d0('0x20')](_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x20')]);_0x15c0c1[_0x89d0('0x1e')]=qs[_0x89d0('0x1e')](_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x1e')]);}_0x15c0c1[_0x89d0('0x3f')]=qs[_0x89d0('0x40')](_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x40')]);_0x15c0c1[_0x89d0('0x41')]=qs['filters'](_[_0x89d0('0x42')](_0x18b1b0[_0x89d0('0x37')],_0x35ac46['filters']),_0x357e6f);if(_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x43')]){_0x15c0c1['where']=_[_0x89d0('0x44')](_0x15c0c1[_0x89d0('0x41')],{'$or':_['map'](_0x357e6f,function(_0x548cc5){if(_0x548cc5['type']!==_0x89d0('0x45')){var _0x230869={};_0x230869[_0x548cc5[_0x89d0('0x2f')]]={'$like':'%'+_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x43')]+'%'};return _0x230869;}})});}_0x15c0c1=_[_0x89d0('0x44')]({},_0x15c0c1,_0x18b1b0[_0x89d0('0x46')]);var _0x1f6934={'where':_0x15c0c1[_0x89d0('0x41')]};return db['ZohoConfiguration']['count'](_0x1f6934)['then'](function(_0x1c12be){_0x114ecb[_0x89d0('0x21')]=_0x1c12be;if(_0x18b1b0[_0x89d0('0x37')][_0x89d0('0x47')]){_0x15c0c1[_0x89d0('0x48')]=[{'all':!![]}];}return db[_0x89d0('0x32')]['findAll'](_0x15c0c1);})[_0x89d0('0x29')](function(_0x3867cc){_0x114ecb['rows']=_0x3867cc;return _0x114ecb;})[_0x89d0('0x29')](respondWithFilteredResult(_0x15d6d1,_0x15c0c1))[_0x89d0('0x49')](handleError(_0x15d6d1,null));};exports['show']=function(_0x3f2202,_0x3673cc){var _0x5db603={'raw':![],'where':{'id':_0x3f2202[_0x89d0('0x4a')]['id']}},_0x68bc59={};_0x68bc59[_0x89d0('0x39')]=_[_0x89d0('0x38')](db['ZohoConfiguration'][_0x89d0('0x33')]);_0x68bc59[_0x89d0('0x37')]=_[_0x89d0('0x38')](_0x3f2202[_0x89d0('0x37')]);_0x68bc59[_0x89d0('0x4b')]=_[_0x89d0('0x3b')](_0x68bc59[_0x89d0('0x39')],_0x68bc59['query']);_0x5db603[_0x89d0('0x3a')]=_[_0x89d0('0x3b')](_0x68bc59['model'],qs[_0x89d0('0x3c')](_0x3f2202[_0x89d0('0x37')]['fields']));_0x5db603[_0x89d0('0x3a')]=_0x5db603[_0x89d0('0x3a')][_0x89d0('0x3d')]?_0x5db603['attributes']:_0x68bc59['model'];if(_0x3f2202[_0x89d0('0x37')]['includeAll']){_0x5db603[_0x89d0('0x48')]=[{'all':!![]}];}_0x5db603=_[_0x89d0('0x44')]({},_0x5db603,_0x3f2202['options']);return db[_0x89d0('0x32')][_0x89d0('0x4c')](_0x5db603)[_0x89d0('0x29')](handleEntityNotFound(_0x3673cc,null))['then'](respondWithResult(_0x3673cc,null))[_0x89d0('0x49')](handleError(_0x3673cc,null));};exports[_0x89d0('0x4d')]=function(_0x31cf43,_0x213b3f){return db[_0x89d0('0x32')][_0x89d0('0x4d')](_0x31cf43[_0x89d0('0x4e')],{})[_0x89d0('0x29')](respondWithResult(_0x213b3f,0xc9))[_0x89d0('0x49')](handleError(_0x213b3f,null));};exports['update']=function(_0x44111a,_0x117463){if(_0x44111a[_0x89d0('0x4e')]['id']){delete _0x44111a[_0x89d0('0x4e')]['id'];}return db[_0x89d0('0x32')][_0x89d0('0x4c')]({'where':{'id':_0x44111a[_0x89d0('0x4a')]['id']}})[_0x89d0('0x29')](handleEntityNotFound(_0x117463,null))[_0x89d0('0x29')](saveUpdates(_0x44111a[_0x89d0('0x4e')],null))[_0x89d0('0x29')](respondWithResult(_0x117463,null))[_0x89d0('0x49')](handleError(_0x117463,null));};exports['destroy']=function(_0x2049d6,_0x4df5d1){return db['ZohoConfiguration']['find']({'where':{'id':_0x2049d6[_0x89d0('0x4a')]['id']}})[_0x89d0('0x29')](handleEntityNotFound(_0x4df5d1,null))[_0x89d0('0x29')](removeEntity(_0x4df5d1,null))[_0x89d0('0x49')](handleError(_0x4df5d1,null));};exports['getFields']=function(_0x188580,_0x3aaf30,_0x33aece){var _0x3f2d62={};var _0x265c71={};var _0x2fc23e;var _0x2db65e;return db[_0x89d0('0x32')][_0x89d0('0x4f')]({'where':{'id':_0x188580['params']['id']}})['then'](handleEntityNotFound(_0x3aaf30,null))[_0x89d0('0x29')](function(_0x5f1d24){if(_0x5f1d24){_0x2fc23e=_0x5f1d24;_0x265c71['model']=_['keys'](db[_0x89d0('0x50')][_0x89d0('0x33')]);_0x265c71[_0x89d0('0x37')]=_['keys'](_0x188580[_0x89d0('0x37')]);_0x265c71[_0x89d0('0x4b')]=_[_0x89d0('0x3b')](_0x265c71[_0x89d0('0x39')],_0x265c71[_0x89d0('0x37')]);_0x3f2d62[_0x89d0('0x3a')]=_[_0x89d0('0x3b')](_0x265c71[_0x89d0('0x39')],qs[_0x89d0('0x3c')](_0x188580['query'][_0x89d0('0x3c')]));_0x3f2d62['attributes']=_0x3f2d62[_0x89d0('0x3a')][_0x89d0('0x3d')]?_0x3f2d62[_0x89d0('0x3a')]:_0x265c71['model'];_0x3f2d62[_0x89d0('0x3f')]=qs[_0x89d0('0x40')](_0x188580[_0x89d0('0x37')][_0x89d0('0x40')]);_0x3f2d62[_0x89d0('0x41')]=qs[_0x89d0('0x4b')](_[_0x89d0('0x42')](_0x188580[_0x89d0('0x37')],_0x265c71[_0x89d0('0x4b')]));if(_0x188580['query'][_0x89d0('0x43')]){_0x3f2d62[_0x89d0('0x41')]=_[_0x89d0('0x44')](_0x3f2d62[_0x89d0('0x41')],{'$or':_['map'](_0x3f2d62['attributes'],function(_0x43ebc3){var _0x4351bc={};_0x4351bc[_0x43ebc3]={'$like':'%'+_0x188580[_0x89d0('0x37')][_0x89d0('0x43')]+'%'};return _0x4351bc;})});}_0x3f2d62=_[_0x89d0('0x44')]({},_0x3f2d62,_0x188580[_0x89d0('0x46')]);return _0x2fc23e[_0x89d0('0x51')](_0x3f2d62);}})[_0x89d0('0x29')](function(_0x31da04){if(_0x31da04){_0x2db65e=_0x31da04[_0x89d0('0x3d')];if(!_0x188580[_0x89d0('0x37')][_0x89d0('0x52')]('nolimit')){_0x3f2d62['limit']=qs[_0x89d0('0x20')](_0x188580['query'][_0x89d0('0x20')]);_0x3f2d62[_0x89d0('0x1e')]=qs[_0x89d0('0x1e')](_0x188580[_0x89d0('0x37')]['offset']);}return _0x2fc23e[_0x89d0('0x51')](_0x3f2d62);}})[_0x89d0('0x29')](function(_0x4d782b){if(_0x4d782b){return _0x4d782b?{'count':_0x2db65e,'rows':_0x4d782b}:null;}})['then'](respondWithResult(_0x3aaf30,null))[_0x89d0('0x49')](handleError(_0x3aaf30,null));};exports[_0x89d0('0x53')]=function(_0x14afef,_0x5002d1,_0x2230e3){var _0x540f5c={};var _0x4f0b8b={};var _0x3f331a;var _0x51f67a;return db[_0x89d0('0x32')][_0x89d0('0x4f')]({'where':{'id':_0x14afef[_0x89d0('0x4a')]['id']}})[_0x89d0('0x29')](handleEntityNotFound(_0x5002d1,null))[_0x89d0('0x29')](function(_0x425ba8){if(_0x425ba8){_0x3f331a=_0x425ba8;_0x4f0b8b[_0x89d0('0x39')]=_['keys'](db[_0x89d0('0x50')][_0x89d0('0x33')]);_0x4f0b8b[_0x89d0('0x37')]=_[_0x89d0('0x38')](_0x14afef['query']);_0x4f0b8b[_0x89d0('0x4b')]=_[_0x89d0('0x3b')](_0x4f0b8b[_0x89d0('0x39')],_0x4f0b8b[_0x89d0('0x37')]);_0x540f5c['attributes']=_['intersection'](_0x4f0b8b[_0x89d0('0x39')],qs[_0x89d0('0x3c')](_0x14afef[_0x89d0('0x37')]['fields']));_0x540f5c['attributes']=_0x540f5c[_0x89d0('0x3a')][_0x89d0('0x3d')]?_0x540f5c[_0x89d0('0x3a')]:_0x4f0b8b[_0x89d0('0x39')];_0x540f5c[_0x89d0('0x3f')]=qs['sort'](_0x14afef[_0x89d0('0x37')]['sort']);_0x540f5c[_0x89d0('0x41')]=qs[_0x89d0('0x4b')](_[_0x89d0('0x42')](_0x14afef['query'],_0x4f0b8b[_0x89d0('0x4b')]));if(_0x14afef[_0x89d0('0x37')]['filter']){_0x540f5c['where']=_['merge'](_0x540f5c[_0x89d0('0x41')],{'$or':_[_0x89d0('0x31')](_0x540f5c['attributes'],function(_0x3911b4){var _0x16da82={};_0x16da82[_0x3911b4]={'$like':'%'+_0x14afef[_0x89d0('0x37')][_0x89d0('0x43')]+'%'};return _0x16da82;})});}_0x540f5c=_[_0x89d0('0x44')]({},_0x540f5c,_0x14afef[_0x89d0('0x46')]);return _0x3f331a['getSubjects'](_0x540f5c);}})['then'](function(_0x229a75){if(_0x229a75){_0x51f67a=_0x229a75['length'];if(!_0x14afef[_0x89d0('0x37')]['hasOwnProperty'](_0x89d0('0x3e'))){_0x540f5c[_0x89d0('0x20')]=qs['limit'](_0x14afef[_0x89d0('0x37')][_0x89d0('0x20')]);_0x540f5c['offset']=qs[_0x89d0('0x1e')](_0x14afef[_0x89d0('0x37')][_0x89d0('0x1e')]);}return _0x3f331a['getSubjects'](_0x540f5c);}})[_0x89d0('0x29')](function(_0x4faa69){if(_0x4faa69){return _0x4faa69?{'count':_0x51f67a,'rows':_0x4faa69}:null;}})[_0x89d0('0x29')](respondWithResult(_0x5002d1,null))[_0x89d0('0x49')](handleError(_0x5002d1,null));};exports['getDescriptions']=function(_0x53a4e7,_0x24a01e,_0x302e82){var _0x596534={};var _0x5509f6={};var _0xe3d225;var _0x21ba85;return db[_0x89d0('0x32')]['findOne']({'where':{'id':_0x53a4e7[_0x89d0('0x4a')]['id']}})[_0x89d0('0x29')](handleEntityNotFound(_0x24a01e,null))[_0x89d0('0x29')](function(_0x3f5fb0){if(_0x3f5fb0){_0xe3d225=_0x3f5fb0;_0x5509f6[_0x89d0('0x39')]=_[_0x89d0('0x38')](db[_0x89d0('0x50')]['rawAttributes']);_0x5509f6['query']=_[_0x89d0('0x38')](_0x53a4e7[_0x89d0('0x37')]);_0x5509f6[_0x89d0('0x4b')]=_['intersection'](_0x5509f6[_0x89d0('0x39')],_0x5509f6[_0x89d0('0x37')]);_0x596534['attributes']=_[_0x89d0('0x3b')](_0x5509f6[_0x89d0('0x39')],qs[_0x89d0('0x3c')](_0x53a4e7[_0x89d0('0x37')][_0x89d0('0x3c')]));_0x596534[_0x89d0('0x3a')]=_0x596534[_0x89d0('0x3a')]['length']?_0x596534[_0x89d0('0x3a')]:_0x5509f6['model'];_0x596534[_0x89d0('0x3f')]=qs['sort'](_0x53a4e7[_0x89d0('0x37')][_0x89d0('0x40')]);_0x596534['where']=qs[_0x89d0('0x4b')](_[_0x89d0('0x42')](_0x53a4e7[_0x89d0('0x37')],_0x5509f6[_0x89d0('0x4b')]));if(_0x53a4e7[_0x89d0('0x37')][_0x89d0('0x43')]){_0x596534[_0x89d0('0x41')]=_[_0x89d0('0x44')](_0x596534['where'],{'$or':_[_0x89d0('0x31')](_0x596534[_0x89d0('0x3a')],function(_0x4d0b66){var _0x213b62={};_0x213b62[_0x4d0b66]={'$like':'%'+_0x53a4e7[_0x89d0('0x37')]['filter']+'%'};return _0x213b62;})});}_0x596534=_['merge']({},_0x596534,_0x53a4e7[_0x89d0('0x46')]);return _0xe3d225[_0x89d0('0x54')](_0x596534);}})['then'](function(_0x31626c){if(_0x31626c){_0x21ba85=_0x31626c['length'];if(!_0x53a4e7[_0x89d0('0x37')][_0x89d0('0x52')](_0x89d0('0x3e'))){_0x596534['limit']=qs[_0x89d0('0x20')](_0x53a4e7[_0x89d0('0x37')]['limit']);_0x596534['offset']=qs[_0x89d0('0x1e')](_0x53a4e7[_0x89d0('0x37')][_0x89d0('0x1e')]);}return _0xe3d225[_0x89d0('0x54')](_0x596534);}})[_0x89d0('0x29')](function(_0xa4c9c5){if(_0xa4c9c5){return _0xa4c9c5?{'count':_0x21ba85,'rows':_0xa4c9c5}:null;}})[_0x89d0('0x29')](respondWithResult(_0x24a01e,null))[_0x89d0('0x49')](handleError(_0x24a01e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index d9b3b86..fde2ff6 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 _0xfedd=['exports','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0xfedd,0xf1));var _0xdfed=function(_0x42845d,_0x30bac0){_0x42845d=_0x42845d-0x0;var _0x227b76=_0xfedd[_0x42845d];return _0x227b76;};'use strict';var _=require(_0xdfed('0x0'));var util=require(_0xdfed('0x1'));var logger=require(_0xdfed('0x2'))(_0xdfed('0x3'));var moment=require(_0xdfed('0x4'));var BPromise=require(_0xdfed('0x5'));var rp=require(_0xdfed('0x6'));var fs=require('fs');var path=require(_0xdfed('0x7'));var rimraf=require(_0xdfed('0x8'));var config=require(_0xdfed('0x9'));var attributes=require(_0xdfed('0xa'));module[_0xdfed('0xb')]=function(_0x35bc21,_0x20c647){return _0x35bc21[_0xdfed('0xc')](_0xdfed('0xd'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb39d=['path','define','ZohoConfiguration','int_zoho_configurations','lodash','api','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb39d,0x134));var _0xdb39=function(_0x216c2f,_0xaf2d0e){_0x216c2f=_0x216c2f-0x0;var _0x1b6b9a=_0xb39d[_0x216c2f];return _0x1b6b9a;};'use strict';var _=require(_0xdb39('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdb39('0x1'));var moment=require('moment');var BPromise=require(_0xdb39('0x2'));var rp=require(_0xdb39('0x3'));var fs=require('fs');var path=require(_0xdb39('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module['exports']=function(_0x3161b8,_0x383b89){return _0x3161b8[_0xdb39('0x5')](_0xdb39('0x6'),attributes,{'tableName':_0xdb39('0x7'),'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 ddd709e..dea7e27 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 _0x6a4b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger'];(function(_0x4d7bc8,_0x170eca){var _0xae4476=function(_0x1068cc){while(--_0x1068cc){_0x4d7bc8['push'](_0x4d7bc8['shift']());}};_0xae4476(++_0x170eca);}(_0x6a4b,0xba));var _0xb6a4=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x6a4b[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xb6a4('0x0'));var util=require(_0xb6a4('0x1'));var moment=require(_0xb6a4('0x2'));var BPromise=require(_0xb6a4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb6a4('0x5'))(_0xb6a4('0x6'));var config=require(_0xb6a4('0x7'));var jayson=require(_0xb6a4('0x8'));var client=jayson[_0xb6a4('0x9')][_0xb6a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x324511,_0x3de3bf,_0x5367b0){return new BPromise(function(_0x24b7d7,_0x4142bd){return client[_0xb6a4('0xb')](_0x324511,_0x5367b0)[_0xb6a4('0xc')](function(_0x2b300f){logger[_0xb6a4('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x3de3bf,_0xb6a4('0xe'));logger[_0xb6a4('0xf')](_0xb6a4('0x10'),_0x3de3bf,_0xb6a4('0xe'),JSON[_0xb6a4('0x11')](_0x2b300f));if(_0x2b300f['error']){if(_0x2b300f[_0xb6a4('0x12')][_0xb6a4('0x13')]===0x1f4){logger[_0xb6a4('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x3de3bf,_0x2b300f[_0xb6a4('0x12')][_0xb6a4('0x14')]);return _0x4142bd(_0x2b300f[_0xb6a4('0x12')][_0xb6a4('0x14')]);}logger[_0xb6a4('0x12')](_0xb6a4('0x15'),_0x3de3bf,_0x2b300f[_0xb6a4('0x12')][_0xb6a4('0x14')]);return _0x24b7d7(_0x2b300f[_0xb6a4('0x12')]['message']);}else{logger[_0xb6a4('0xd')](_0xb6a4('0x15'),_0x3de3bf,_0xb6a4('0xe'));_0x24b7d7(_0x2b300f[_0xb6a4('0x16')][_0xb6a4('0x14')]);}})[_0xb6a4('0x17')](function(_0x7421e){logger[_0xb6a4('0x12')](_0xb6a4('0x15'),_0x3de3bf,_0x7421e);_0x4142bd(_0x7421e);});});} \ No newline at end of file +var _0x8f0b=['request\x20sent','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message'];(function(_0x2a9478,_0x104cf3){var _0x3badb8=function(_0x25c99c){while(--_0x25c99c){_0x2a9478['push'](_0x2a9478['shift']());}};_0x3badb8(++_0x104cf3);}(_0x8f0b,0x105));var _0xb8f0=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x8f0b[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require(_0xb8f0('0x0'));var moment=require('moment');var BPromise=require(_0xb8f0('0x1'));var rs=require(_0xb8f0('0x2'));var fs=require('fs');var Redis=require(_0xb8f0('0x3'));var db=require(_0xb8f0('0x4'))['db'];var utils=require(_0xb8f0('0x5'));var logger=require(_0xb8f0('0x6'))(_0xb8f0('0x7'));var config=require(_0xb8f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25572e,_0x1135cf,_0x1642af){return new BPromise(function(_0x419e1d,_0x4cf9df){return client[_0xb8f0('0xa')](_0x25572e,_0x1642af)['then'](function(_0x4ebbd7){logger[_0xb8f0('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x1135cf,'request\x20sent');logger[_0xb8f0('0xc')](_0xb8f0('0xd'),_0x1135cf,'request\x20sent',JSON[_0xb8f0('0xe')](_0x4ebbd7));if(_0x4ebbd7['error']){if(_0x4ebbd7[_0xb8f0('0xf')][_0xb8f0('0x10')]===0x1f4){logger['error'](_0xb8f0('0x11'),_0x1135cf,_0x4ebbd7[_0xb8f0('0xf')][_0xb8f0('0x12')]);return _0x4cf9df(_0x4ebbd7['error'][_0xb8f0('0x12')]);}logger[_0xb8f0('0xf')](_0xb8f0('0x11'),_0x1135cf,_0x4ebbd7['error'][_0xb8f0('0x12')]);return _0x419e1d(_0x4ebbd7['error'][_0xb8f0('0x12')]);}else{logger[_0xb8f0('0xb')](_0xb8f0('0x11'),_0x1135cf,_0xb8f0('0x13'));_0x419e1d(_0x4ebbd7['result']['message']);}})['catch'](function(_0x299a28){logger[_0xb8f0('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1135cf,_0x299a28);_0x4cf9df(_0x299a28);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2efcd9a..c86be1c 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 _0x5f12=['put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','/:id','create'];(function(_0x3145cc,_0x5a0439){var _0x3f2e2f=function(_0x332fa1){while(--_0x332fa1){_0x3145cc['push'](_0x3145cc['shift']());}};_0x3f2e2f(++_0x5a0439);}(_0x5f12,0xfb));var _0x25f1=function(_0x5933ac,_0x18a1ca){_0x5933ac=_0x5933ac-0x0;var _0xf0eca3=_0x5f12[_0x5933ac];return _0xf0eca3;};'use strict';var multer=require('multer');var util=require(_0x25f1('0x0'));var path=require(_0x25f1('0x1'));var timeout=require(_0x25f1('0x2'));var express=require(_0x25f1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x25f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x25f1('0x5'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0x25f1('0x6')](),controller['index']);router['get'](_0x25f1('0x7'),auth[_0x25f1('0x6')](),controller['show']);router['post']('/',auth[_0x25f1('0x6')](),controller[_0x25f1('0x8')]);router[_0x25f1('0x9')](_0x25f1('0x7'),auth['isAuthenticated'](),controller[_0x25f1('0xa')]);router[_0x25f1('0xb')]('/:id',auth[_0x25f1('0x6')](),controller['destroy']);module[_0x25f1('0xc')]=router; \ No newline at end of file +var _0x1375=['post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','show'];(function(_0xad4fb7,_0x1a9e71){var _0x14828b=function(_0x101885){while(--_0x101885){_0xad4fb7['push'](_0xad4fb7['shift']());}};_0x14828b(++_0x1a9e71);}(_0x1375,0x1ec));var _0x5137=function(_0x34b05b,_0x80e31){_0x34b05b=_0x34b05b-0x0;var _0x5a40f0=_0x1375[_0x34b05b];return _0x5a40f0;};'use strict';var multer=require(_0x5137('0x0'));var util=require(_0x5137('0x1'));var path=require(_0x5137('0x2'));var timeout=require(_0x5137('0x3'));var express=require(_0x5137('0x4'));var router=express[_0x5137('0x5')]();var fs_extra=require(_0x5137('0x6'));var auth=require(_0x5137('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5137('0x8'));router[_0x5137('0x9')]('/',auth[_0x5137('0xa')](),controller['index']);router['get']('/:id',auth[_0x5137('0xa')](),controller[_0x5137('0xb')]);router[_0x5137('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5137('0xd')](_0x5137('0xe'),auth[_0x5137('0xa')](),controller[_0x5137('0xf')]);router[_0x5137('0x10')](_0x5137('0xe'),auth[_0x5137('0xa')](),controller['destroy']);module[_0x5137('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index c2a08c2..e865b89 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 _0xb387=['customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0xb387,0xc5));var _0x7b38=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xb387[_0x18b344];return _0x5ef6bb;};'use strict';var Sequelize=require(_0x7b38('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7b38('0x1'),_0x7b38('0x2'),_0x7b38('0x3'),'keyValue',_0x7b38('0x4')),'defaultValue':_0x7b38('0x1')},'content':{'type':Sequelize[_0x7b38('0x5')]},'key':{'type':Sequelize[_0x7b38('0x5')]},'keyType':{'type':Sequelize[_0x7b38('0x6')]('string',_0x7b38('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x7b38('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b38('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7b38('0x5')]}}; \ No newline at end of file +var _0x0d40=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x451975,_0x480521){var _0x12afc9=function(_0x5cf242){while(--_0x5cf242){_0x451975['push'](_0x451975['shift']());}};_0x12afc9(++_0x480521);}(_0x0d40,0xd7));var _0x00d4=function(_0x56a616,_0x5a3c7c){_0x56a616=_0x56a616-0x0;var _0xe94844=_0x0d40[_0x56a616];return _0xe94844;};'use strict';var Sequelize=require(_0x00d4('0x0'));module['exports']={'type':{'type':Sequelize[_0x00d4('0x1')](_0x00d4('0x2'),_0x00d4('0x3'),_0x00d4('0x4'),_0x00d4('0x5'),_0x00d4('0x6')),'defaultValue':_0x00d4('0x2')},'content':{'type':Sequelize[_0x00d4('0x7')]},'key':{'type':Sequelize[_0x00d4('0x7')]},'keyType':{'type':Sequelize[_0x00d4('0x1')]('string',_0x00d4('0x3'),_0x00d4('0x4'))},'keyContent':{'type':Sequelize[_0x00d4('0x7')]},'idField':{'type':Sequelize[_0x00d4('0x7')]},'nameField':{'type':Sequelize[_0x00d4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 4ed729a..4c8446d 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 _0xf7df=['limit','offset','order','sort','where','filters','filter','merge','VIRTUAL','options','ZohoField','then','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0xf7df,0x1f0));var _0xff7d=function(_0xf6e95f,_0x4cc04c){_0xf6e95f=_0xf6e95f-0x0;var _0x25b0cb=_0xf7df[_0xf6e95f];return _0x25b0cb;};'use strict';var emlformat=require(_0xff7d('0x0'));var rimraf=require(_0xff7d('0x1'));var zipdir=require(_0xff7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff7d('0x3'));var moment=require(_0xff7d('0x4'));var BPromise=require(_0xff7d('0x5'));var Mustache=require(_0xff7d('0x6'));var util=require(_0xff7d('0x7'));var path=require(_0xff7d('0x8'));var sox=require(_0xff7d('0x9'));var csv=require(_0xff7d('0xa'));var ejs=require(_0xff7d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff7d('0xc'));var squel=require(_0xff7d('0xd'));var crypto=require(_0xff7d('0xe'));var jsforce=require(_0xff7d('0xf'));var deskjs=require(_0xff7d('0x10'));var toCsv=require(_0xff7d('0xa'));var querystring=require(_0xff7d('0x11'));var Papa=require(_0xff7d('0x12'));var Redis=require(_0xff7d('0x13'));var authService=require(_0xff7d('0x14'));var qs=require(_0xff7d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff7d('0x16'));var logger=require('../../config/logger')(_0xff7d('0x17'));var utils=require(_0xff7d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xff7d('0x19'));var db=require(_0xff7d('0x1a'))['db'];function respondWithStatusCode(_0x1127ca,_0x1d7a94){_0x1d7a94=_0x1d7a94||0xcc;return function(_0xaeed84){if(_0xaeed84){return _0x1127ca[_0xff7d('0x1b')](_0x1d7a94);}return _0x1127ca[_0xff7d('0x1c')](_0x1d7a94)[_0xff7d('0x1d')]();};}function respondWithResult(_0xc5a1b5,_0x3e65cc){_0x3e65cc=_0x3e65cc||0xc8;return function(_0x3d99e8){if(_0x3d99e8){return _0xc5a1b5[_0xff7d('0x1c')](_0x3e65cc)['json'](_0x3d99e8);}};}function respondWithFilteredResult(_0xbd4c20,_0x3c36ca){return function(_0x3248c9){if(_0x3248c9){var _0x4f9494=typeof _0x3c36ca['offset']===_0xff7d('0x1e')&&typeof _0x3c36ca['limit']==='undefined';var _0x337172=_0x3248c9[_0xff7d('0x1f')];var _0x274980=_0x4f9494?0x0:_0x3c36ca['offset'];var _0x1ca1dc=_0x4f9494?_0x3248c9[_0xff7d('0x1f')]:_0x3c36ca['offset']+_0x3c36ca['limit'];var _0x2fbbcc;if(_0x1ca1dc>=_0x337172){_0x1ca1dc=_0x337172;_0x2fbbcc=0xc8;}else{_0x2fbbcc=0xce;}_0xbd4c20[_0xff7d('0x1c')](_0x2fbbcc);return _0xbd4c20[_0xff7d('0x20')](_0xff7d('0x21'),_0x274980+'-'+_0x1ca1dc+'/'+_0x337172)[_0xff7d('0x22')](_0x3248c9);}return null;};}function patchUpdates(_0x30ec7f){return function(_0x469553){try{jsonpatch[_0xff7d('0x23')](_0x469553,_0x30ec7f,!![]);}catch(_0x14267e){return BPromise[_0xff7d('0x24')](_0x14267e);}return _0x469553[_0xff7d('0x25')]();};}function saveUpdates(_0x302ac6,_0x4b1deb){return function(_0x269a9d){if(_0x269a9d){return _0x269a9d[_0xff7d('0x26')](_0x302ac6)['then'](function(_0x1d91f0){return _0x1d91f0;});}return null;};}function removeEntity(_0x44782d,_0x278056){return function(_0xabeb5c){if(_0xabeb5c){return _0xabeb5c[_0xff7d('0x27')]()['then'](function(){_0x44782d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29cf66,_0x24a857){return function(_0x577803){if(!_0x577803){_0x29cf66[_0xff7d('0x1b')](0x194);}return _0x577803;};}function handleError(_0x446d00,_0x35963a){_0x35963a=_0x35963a||0x1f4;return function(_0x5c1e2b){logger[_0xff7d('0x28')](_0x5c1e2b['stack']);if(_0x5c1e2b['name']){delete _0x5c1e2b[_0xff7d('0x29')];}_0x446d00[_0xff7d('0x1c')](_0x35963a)[_0xff7d('0x2a')](_0x5c1e2b);};}exports[_0xff7d('0x2b')]=function(_0x13785a,_0xe481d){var _0x2e617b={},_0x3f39bf={},_0x4d7e54={'count':0x0,'rows':[]};var _0x364c59=_[_0xff7d('0x2c')](db['ZohoField'][_0xff7d('0x2d')],function(_0x67882a){return{'name':_0x67882a[_0xff7d('0x2e')],'type':_0x67882a[_0xff7d('0x2f')][_0xff7d('0x30')]};});_0x3f39bf[_0xff7d('0x31')]=_[_0xff7d('0x2c')](_0x364c59,_0xff7d('0x29'));_0x3f39bf[_0xff7d('0x32')]=_['keys'](_0x13785a[_0xff7d('0x32')]);_0x3f39bf['filters']=_[_0xff7d('0x33')](_0x3f39bf['model'],_0x3f39bf[_0xff7d('0x32')]);_0x2e617b[_0xff7d('0x34')]=_['intersection'](_0x3f39bf['model'],qs[_0xff7d('0x35')](_0x13785a['query'][_0xff7d('0x35')]));_0x2e617b[_0xff7d('0x34')]=_0x2e617b[_0xff7d('0x34')][_0xff7d('0x36')]?_0x2e617b[_0xff7d('0x34')]:_0x3f39bf[_0xff7d('0x31')];if(!_0x13785a[_0xff7d('0x32')][_0xff7d('0x37')](_0xff7d('0x38'))){_0x2e617b[_0xff7d('0x39')]=qs[_0xff7d('0x39')](_0x13785a[_0xff7d('0x32')]['limit']);_0x2e617b[_0xff7d('0x3a')]=qs['offset'](_0x13785a[_0xff7d('0x32')]['offset']);}_0x2e617b[_0xff7d('0x3b')]=qs[_0xff7d('0x3c')](_0x13785a[_0xff7d('0x32')]['sort']);_0x2e617b[_0xff7d('0x3d')]=qs[_0xff7d('0x3e')](_['pick'](_0x13785a[_0xff7d('0x32')],_0x3f39bf[_0xff7d('0x3e')]),_0x364c59);if(_0x13785a[_0xff7d('0x32')][_0xff7d('0x3f')]){_0x2e617b[_0xff7d('0x3d')]=_[_0xff7d('0x40')](_0x2e617b[_0xff7d('0x3d')],{'$or':_[_0xff7d('0x2c')](_0x364c59,function(_0x514686){if(_0x514686['type']!==_0xff7d('0x41')){var _0x476268={};_0x476268[_0x514686[_0xff7d('0x29')]]={'$like':'%'+_0x13785a[_0xff7d('0x32')][_0xff7d('0x3f')]+'%'};return _0x476268;}})});}_0x2e617b=_[_0xff7d('0x40')]({},_0x2e617b,_0x13785a[_0xff7d('0x42')]);var _0x2fcb9a={'where':_0x2e617b[_0xff7d('0x3d')]};return db[_0xff7d('0x43')][_0xff7d('0x1f')](_0x2fcb9a)[_0xff7d('0x44')](function(_0x5e73c7){_0x4d7e54['count']=_0x5e73c7;if(_0x13785a[_0xff7d('0x32')][_0xff7d('0x45')]){_0x2e617b[_0xff7d('0x46')]=[{'all':!![]}];}return db[_0xff7d('0x43')][_0xff7d('0x47')](_0x2e617b);})[_0xff7d('0x44')](function(_0x4ffeaa){_0x4d7e54['rows']=_0x4ffeaa;return _0x4d7e54;})['then'](respondWithFilteredResult(_0xe481d,_0x2e617b))[_0xff7d('0x48')](handleError(_0xe481d,null));};exports[_0xff7d('0x49')]=function(_0x55427a,_0x4b1e26){var _0x4864df={'raw':!![],'where':{'id':_0x55427a[_0xff7d('0x4a')]['id']}},_0x5d1c47={};_0x5d1c47[_0xff7d('0x31')]=_[_0xff7d('0x4b')](db['ZohoField']['rawAttributes']);_0x5d1c47[_0xff7d('0x32')]=_[_0xff7d('0x4b')](_0x55427a['query']);_0x5d1c47[_0xff7d('0x3e')]=_[_0xff7d('0x33')](_0x5d1c47['model'],_0x5d1c47[_0xff7d('0x32')]);_0x4864df[_0xff7d('0x34')]=_['intersection'](_0x5d1c47['model'],qs['fields'](_0x55427a[_0xff7d('0x32')][_0xff7d('0x35')]));_0x4864df[_0xff7d('0x34')]=_0x4864df[_0xff7d('0x34')][_0xff7d('0x36')]?_0x4864df['attributes']:_0x5d1c47[_0xff7d('0x31')];if(_0x55427a[_0xff7d('0x32')][_0xff7d('0x45')]){_0x4864df[_0xff7d('0x46')]=[{'all':!![]}];}_0x4864df=_[_0xff7d('0x40')]({},_0x4864df,_0x55427a[_0xff7d('0x42')]);return db['ZohoField'][_0xff7d('0x4c')](_0x4864df)[_0xff7d('0x44')](handleEntityNotFound(_0x4b1e26,null))['then'](respondWithResult(_0x4b1e26,null))[_0xff7d('0x48')](handleError(_0x4b1e26,null));};exports[_0xff7d('0x4d')]=function(_0x5c15b9,_0x58ca08){return db['ZohoField']['create'](_0x5c15b9[_0xff7d('0x4e')],{})[_0xff7d('0x44')](respondWithResult(_0x58ca08,0xc9))[_0xff7d('0x48')](handleError(_0x58ca08,null));};exports[_0xff7d('0x26')]=function(_0x571e3d,_0x517b47){if(_0x571e3d[_0xff7d('0x4e')]['id']){delete _0x571e3d[_0xff7d('0x4e')]['id'];}return db['ZohoField'][_0xff7d('0x4c')]({'where':{'id':_0x571e3d[_0xff7d('0x4a')]['id']}})[_0xff7d('0x44')](handleEntityNotFound(_0x517b47,null))[_0xff7d('0x44')](saveUpdates(_0x571e3d['body'],null))[_0xff7d('0x44')](respondWithResult(_0x517b47,null))[_0xff7d('0x48')](handleError(_0x517b47,null));};exports['destroy']=function(_0x495970,_0x38ef91){return db['ZohoField'][_0xff7d('0x4c')]({'where':{'id':_0x495970[_0xff7d('0x4a')]['id']}})[_0xff7d('0x44')](handleEntityNotFound(_0x38ef91,null))[_0xff7d('0x44')](removeEntity(_0x38ef91,null))['catch'](handleError(_0x38ef91,null));}; \ No newline at end of file +var _0xfcbb=['reject','save','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','include','rows','catch','show','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x4098e9,_0x18eec8){_0x4098e9=_0x4098e9-0x0;var _0xf5aafe=_0xfcbb[_0x4098e9];return _0xf5aafe;};'use strict';var emlformat=require(_0xbfcb('0x0'));var rimraf=require(_0xbfcb('0x1'));var zipdir=require(_0xbfcb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfcb('0x3'));var BPromise=require(_0xbfcb('0x4'));var Mustache=require(_0xbfcb('0x5'));var util=require(_0xbfcb('0x6'));var path=require(_0xbfcb('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfcb('0x8'));var fs=require('fs');var fs_extra=require(_0xbfcb('0x9'));var _=require(_0xbfcb('0xa'));var squel=require(_0xbfcb('0xb'));var crypto=require(_0xbfcb('0xc'));var jsforce=require(_0xbfcb('0xd'));var deskjs=require(_0xbfcb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfcb('0xf'));var Papa=require(_0xbfcb('0x10'));var Redis=require(_0xbfcb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfcb('0x12'));var as=require(_0xbfcb('0x13'));var hardwareService=require(_0xbfcb('0x14'));var logger=require(_0xbfcb('0x15'))(_0xbfcb('0x16'));var utils=require(_0xbfcb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbfcb('0x18'));var db=require(_0xbfcb('0x19'))['db'];function respondWithStatusCode(_0xb2f601,_0x2268da){_0x2268da=_0x2268da||0xcc;return function(_0x4ba4f1){if(_0x4ba4f1){return _0xb2f601[_0xbfcb('0x1a')](_0x2268da);}return _0xb2f601['status'](_0x2268da)[_0xbfcb('0x1b')]();};}function respondWithResult(_0x1c52df,_0x44ad6c){_0x44ad6c=_0x44ad6c||0xc8;return function(_0x1047c4){if(_0x1047c4){return _0x1c52df[_0xbfcb('0x1c')](_0x44ad6c)[_0xbfcb('0x1d')](_0x1047c4);}};}function respondWithFilteredResult(_0x71304e,_0x2d314a){return function(_0x90ed8c){if(_0x90ed8c){var _0x339347=typeof _0x2d314a[_0xbfcb('0x1e')]===_0xbfcb('0x1f')&&typeof _0x2d314a[_0xbfcb('0x20')]===_0xbfcb('0x1f');var _0x318d07=_0x90ed8c[_0xbfcb('0x21')];var _0xba1d6=_0x339347?0x0:_0x2d314a[_0xbfcb('0x1e')];var _0x3404aa=_0x339347?_0x90ed8c[_0xbfcb('0x21')]:_0x2d314a[_0xbfcb('0x1e')]+_0x2d314a[_0xbfcb('0x20')];var _0x53c9e0;if(_0x3404aa>=_0x318d07){_0x3404aa=_0x318d07;_0x53c9e0=0xc8;}else{_0x53c9e0=0xce;}_0x71304e[_0xbfcb('0x1c')](_0x53c9e0);return _0x71304e[_0xbfcb('0x22')]('Content-Range',_0xba1d6+'-'+_0x3404aa+'/'+_0x318d07)[_0xbfcb('0x1d')](_0x90ed8c);}return null;};}function patchUpdates(_0x1a7225){return function(_0x48c3c8){try{jsonpatch['apply'](_0x48c3c8,_0x1a7225,!![]);}catch(_0x4199c5){return BPromise[_0xbfcb('0x23')](_0x4199c5);}return _0x48c3c8[_0xbfcb('0x24')]();};}function saveUpdates(_0x45661a,_0x1c5924){return function(_0x56c158){if(_0x56c158){return _0x56c158[_0xbfcb('0x25')](_0x45661a)[_0xbfcb('0x26')](function(_0x2d9288){return _0x2d9288;});}return null;};}function removeEntity(_0xd4d29,_0x1651e5){return function(_0x19616c){if(_0x19616c){return _0x19616c[_0xbfcb('0x27')]()[_0xbfcb('0x26')](function(){_0xd4d29[_0xbfcb('0x1c')](0xcc)[_0xbfcb('0x1b')]();});}};}function handleEntityNotFound(_0x1ca8c3,_0xf6dbb7){return function(_0x3ef71c){if(!_0x3ef71c){_0x1ca8c3[_0xbfcb('0x1a')](0x194);}return _0x3ef71c;};}function handleError(_0x3e954d,_0x2a1272){_0x2a1272=_0x2a1272||0x1f4;return function(_0x5cd703){logger[_0xbfcb('0x28')](_0x5cd703[_0xbfcb('0x29')]);if(_0x5cd703['name']){delete _0x5cd703[_0xbfcb('0x2a')];}_0x3e954d[_0xbfcb('0x1c')](_0x2a1272)[_0xbfcb('0x2b')](_0x5cd703);};}exports[_0xbfcb('0x2c')]=function(_0xf4b944,_0x3542e9){var _0x4069a7={},_0x1a5db2={},_0x434764={'count':0x0,'rows':[]};var _0x27606f=_['map'](db[_0xbfcb('0x2d')][_0xbfcb('0x2e')],function(_0x43c3c3){return{'name':_0x43c3c3[_0xbfcb('0x2f')],'type':_0x43c3c3[_0xbfcb('0x30')][_0xbfcb('0x31')]};});_0x1a5db2[_0xbfcb('0x32')]=_[_0xbfcb('0x33')](_0x27606f,_0xbfcb('0x2a'));_0x1a5db2['query']=_[_0xbfcb('0x34')](_0xf4b944[_0xbfcb('0x35')]);_0x1a5db2[_0xbfcb('0x36')]=_[_0xbfcb('0x37')](_0x1a5db2['model'],_0x1a5db2['query']);_0x4069a7[_0xbfcb('0x38')]=_[_0xbfcb('0x37')](_0x1a5db2[_0xbfcb('0x32')],qs[_0xbfcb('0x39')](_0xf4b944[_0xbfcb('0x35')][_0xbfcb('0x39')]));_0x4069a7[_0xbfcb('0x38')]=_0x4069a7['attributes']['length']?_0x4069a7['attributes']:_0x1a5db2[_0xbfcb('0x32')];if(!_0xf4b944['query'][_0xbfcb('0x3a')](_0xbfcb('0x3b'))){_0x4069a7['limit']=qs['limit'](_0xf4b944[_0xbfcb('0x35')][_0xbfcb('0x20')]);_0x4069a7[_0xbfcb('0x1e')]=qs[_0xbfcb('0x1e')](_0xf4b944['query'][_0xbfcb('0x1e')]);}_0x4069a7[_0xbfcb('0x3c')]=qs['sort'](_0xf4b944['query'][_0xbfcb('0x3d')]);_0x4069a7['where']=qs['filters'](_[_0xbfcb('0x3e')](_0xf4b944[_0xbfcb('0x35')],_0x1a5db2[_0xbfcb('0x36')]),_0x27606f);if(_0xf4b944[_0xbfcb('0x35')]['filter']){_0x4069a7[_0xbfcb('0x3f')]=_[_0xbfcb('0x40')](_0x4069a7[_0xbfcb('0x3f')],{'$or':_[_0xbfcb('0x33')](_0x27606f,function(_0x2289fd){if(_0x2289fd[_0xbfcb('0x30')]!=='VIRTUAL'){var _0x2fc01f={};_0x2fc01f[_0x2289fd['name']]={'$like':'%'+_0xf4b944[_0xbfcb('0x35')]['filter']+'%'};return _0x2fc01f;}})});}_0x4069a7=_[_0xbfcb('0x40')]({},_0x4069a7,_0xf4b944[_0xbfcb('0x41')]);var _0xe719cd={'where':_0x4069a7[_0xbfcb('0x3f')]};return db[_0xbfcb('0x2d')][_0xbfcb('0x21')](_0xe719cd)[_0xbfcb('0x26')](function(_0x149bd5){_0x434764[_0xbfcb('0x21')]=_0x149bd5;if(_0xf4b944[_0xbfcb('0x35')]['includeAll']){_0x4069a7[_0xbfcb('0x42')]=[{'all':!![]}];}return db[_0xbfcb('0x2d')]['findAll'](_0x4069a7);})[_0xbfcb('0x26')](function(_0x306ea4){_0x434764[_0xbfcb('0x43')]=_0x306ea4;return _0x434764;})[_0xbfcb('0x26')](respondWithFilteredResult(_0x3542e9,_0x4069a7))[_0xbfcb('0x44')](handleError(_0x3542e9,null));};exports[_0xbfcb('0x45')]=function(_0x500e7c,_0x96691c){var _0x10ffa0={'raw':!![],'where':{'id':_0x500e7c['params']['id']}},_0x10ea4f={};_0x10ea4f[_0xbfcb('0x32')]=_[_0xbfcb('0x34')](db[_0xbfcb('0x2d')]['rawAttributes']);_0x10ea4f[_0xbfcb('0x35')]=_[_0xbfcb('0x34')](_0x500e7c['query']);_0x10ea4f['filters']=_[_0xbfcb('0x37')](_0x10ea4f[_0xbfcb('0x32')],_0x10ea4f['query']);_0x10ffa0[_0xbfcb('0x38')]=_[_0xbfcb('0x37')](_0x10ea4f['model'],qs[_0xbfcb('0x39')](_0x500e7c[_0xbfcb('0x35')][_0xbfcb('0x39')]));_0x10ffa0[_0xbfcb('0x38')]=_0x10ffa0[_0xbfcb('0x38')][_0xbfcb('0x46')]?_0x10ffa0[_0xbfcb('0x38')]:_0x10ea4f[_0xbfcb('0x32')];if(_0x500e7c[_0xbfcb('0x35')][_0xbfcb('0x47')]){_0x10ffa0[_0xbfcb('0x42')]=[{'all':!![]}];}_0x10ffa0=_[_0xbfcb('0x40')]({},_0x10ffa0,_0x500e7c['options']);return db[_0xbfcb('0x2d')][_0xbfcb('0x48')](_0x10ffa0)[_0xbfcb('0x26')](handleEntityNotFound(_0x96691c,null))['then'](respondWithResult(_0x96691c,null))[_0xbfcb('0x44')](handleError(_0x96691c,null));};exports['create']=function(_0x4a3b40,_0x2dcfb3){return db[_0xbfcb('0x2d')][_0xbfcb('0x49')](_0x4a3b40['body'],{})[_0xbfcb('0x26')](respondWithResult(_0x2dcfb3,0xc9))['catch'](handleError(_0x2dcfb3,null));};exports['update']=function(_0x33725a,_0x588d32){if(_0x33725a[_0xbfcb('0x4a')]['id']){delete _0x33725a[_0xbfcb('0x4a')]['id'];}return db['ZohoField'][_0xbfcb('0x48')]({'where':{'id':_0x33725a['params']['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x588d32,null))['then'](saveUpdates(_0x33725a[_0xbfcb('0x4a')],null))['then'](respondWithResult(_0x588d32,null))[_0xbfcb('0x44')](handleError(_0x588d32,null));};exports[_0xbfcb('0x27')]=function(_0x5efbe1,_0x131af7){return db['ZohoField']['find']({'where':{'id':_0x5efbe1[_0xbfcb('0x4b')]['id']}})[_0xbfcb('0x26')](handleEntityNotFound(_0x131af7,null))[_0xbfcb('0x26')](removeEntity(_0x131af7,null))['catch'](handleError(_0x131af7,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index c018c13..eeee114 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 _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoField','int_zoho_fields','lodash','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x1a37,0xb4));var _0x71a3=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x1a37[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intZohoField.attributes');module[_0x71a3('0xa')]=function(_0x4f6b7a,_0xd09f7){return _0x4f6b7a[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':_0x71a3('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x20feae,_0x31e753){var _0x5c3dd2=function(_0x114638){while(--_0x114638){_0x20feae['push'](_0x20feae['shift']());}};_0x5c3dd2(++_0x31e753);}(_0xb145,0xa3));var _0x5b14=function(_0x7d1c1a,_0x2e6d66){_0x7d1c1a=_0x7d1c1a-0x0;var _0x5867c4=_0xb145[_0x7d1c1a];return _0x5867c4;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'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 3d12930..20e71b2 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 _0x99e9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x3825a0,_0x1c1134){var _0xd317b0=function(_0x13cb57){while(--_0x13cb57){_0x3825a0['push'](_0x3825a0['shift']());}};_0xd317b0(++_0x1c1134);}(_0x99e9,0x144));var _0x999e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x99e9[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x999e('0x0'));var BPromise=require(_0x999e('0x1'));var rs=require(_0x999e('0x2'));var fs=require('fs');var Redis=require(_0x999e('0x3'));var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require(_0x999e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25d63c,_0x2a37e0,_0x157814){return new BPromise(function(_0x24dcb0,_0x248c26){return client['request'](_0x25d63c,_0x157814)[_0x999e('0x9')](function(_0x593185){logger['info'](_0x999e('0xa'),_0x2a37e0,_0x999e('0xb'));logger[_0x999e('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x2a37e0,'request\x20sent',JSON['stringify'](_0x593185));if(_0x593185[_0x999e('0xd')]){if(_0x593185['error'][_0x999e('0xe')]===0x1f4){logger[_0x999e('0xd')](_0x999e('0xa'),_0x2a37e0,_0x593185[_0x999e('0xd')][_0x999e('0xf')]);return _0x248c26(_0x593185[_0x999e('0xd')][_0x999e('0xf')]);}logger[_0x999e('0xd')](_0x999e('0xa'),_0x2a37e0,_0x593185[_0x999e('0xd')][_0x999e('0xf')]);return _0x24dcb0(_0x593185['error']['message']);}else{logger[_0x999e('0x10')](_0x999e('0xa'),_0x2a37e0,_0x999e('0xb'));_0x24dcb0(_0x593185[_0x999e('0x11')][_0x999e('0xf')]);}})['catch'](function(_0x4ceb45){logger['error'](_0x999e('0xa'),_0x2a37e0,_0x4ceb45);_0x248c26(_0x4ceb45);});});} \ No newline at end of file +var _0xb4c5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb4c5,0x78));var _0x5b4c=function(_0x2810bc,_0x56ac34){_0x2810bc=_0x2810bc-0x0;var _0x38a81c=_0xb4c5[_0x2810bc];return _0x38a81c;};'use strict';var _=require(_0x5b4c('0x0'));var util=require('util');var moment=require(_0x5b4c('0x1'));var BPromise=require(_0x5b4c('0x2'));var rs=require(_0x5b4c('0x3'));var fs=require('fs');var Redis=require(_0x5b4c('0x4'));var db=require(_0x5b4c('0x5'))['db'];var utils=require(_0x5b4c('0x6'));var logger=require(_0x5b4c('0x7'))(_0x5b4c('0x8'));var config=require(_0x5b4c('0x9'));var jayson=require(_0x5b4c('0xa'));var client=jayson[_0x5b4c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25a607,_0x2078f7,_0x71cf4){return new BPromise(function(_0x20151f,_0x15e441){return client[_0x5b4c('0xc')](_0x25a607,_0x71cf4)['then'](function(_0x22a61f){logger[_0x5b4c('0xd')](_0x5b4c('0xe'),_0x2078f7,_0x5b4c('0xf'));logger['debug'](_0x5b4c('0x10'),_0x2078f7,'request\x20sent',JSON[_0x5b4c('0x11')](_0x22a61f));if(_0x22a61f[_0x5b4c('0x12')]){if(_0x22a61f['error']['code']===0x1f4){logger[_0x5b4c('0x12')]('ZohoField,\x20%s,\x20%s',_0x2078f7,_0x22a61f[_0x5b4c('0x12')]['message']);return _0x15e441(_0x22a61f[_0x5b4c('0x12')]['message']);}logger[_0x5b4c('0x12')](_0x5b4c('0xe'),_0x2078f7,_0x22a61f[_0x5b4c('0x12')][_0x5b4c('0x13')]);return _0x20151f(_0x22a61f['error'][_0x5b4c('0x13')]);}else{logger[_0x5b4c('0xd')](_0x5b4c('0xe'),_0x2078f7,_0x5b4c('0xf'));_0x20151f(_0x22a61f[_0x5b4c('0x14')][_0x5b4c('0x13')]);}})['catch'](function(_0x4d42c9){logger[_0x5b4c('0x12')]('ZohoField,\x20%s,\x20%s',_0x2078f7,_0x4d42c9);_0x15e441(_0x4d42c9);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 95b5631..c9233de 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xf8053,_0x4b5401){var _0x2fe82f=function(_0x3fb111){while(--_0x3fb111){_0xf8053['push'](_0xf8053['shift']());}};_0x2fe82f(++_0x4b5401);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x452873,_0x453529){var _0x5e288c=function(_0x19b267){while(--_0x19b267){_0x452873['push'](_0x452873['shift']());}};_0x5e288c(++_0x453529);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0xcb91[_0x22431e];return _0xd978e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cd4b0e9..e08b5e3 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 _0xb0ca=['unique_name_and_version','STRING','INTEGER','state','sequelize'];(function(_0x451874,_0x493f30){var _0x580587=function(_0x2b7441){while(--_0x2b7441){_0x451874['push'](_0x451874['shift']());}};_0x580587(++_0x493f30);}(_0xb0ca,0x72));var _0xab0c=function(_0x1f0476,_0x540759){_0x1f0476=_0x1f0476-0x0;var _0x13899a=_0xb0ca[_0x1f0476];return _0x13899a;};'use strict';var Sequelize=require(_0xab0c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xab0c('0x1')},'version':{'type':Sequelize[_0xab0c('0x2')],'allowNull':![],'unique':_0xab0c('0x1')},'main':{'type':Sequelize[_0xab0c('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xab0c('0x2')]},'type':{'type':Sequelize[_0xab0c('0x2')]},'size':{'type':Sequelize[_0xab0c('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xab0c('0x2')]},'logo':{'type':Sequelize[_0xab0c('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xab0c('0x4')},'description':{'type':Sequelize[_0xab0c('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab0c('0x2')]},'link':{'type':Sequelize[_0xab0c('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb093=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x46dba1,_0x147418){var _0x48d1db=function(_0x5e2f0e){while(--_0x5e2f0e){_0x46dba1['push'](_0x46dba1['shift']());}};_0x48d1db(++_0x147418);}(_0xb093,0xfd));var _0x3b09=function(_0xcbca8f,_0x2612f0){_0xcbca8f=_0xcbca8f-0x0;var _0x50dbaa=_0xb093[_0xcbca8f];return _0x50dbaa;};'use strict';var Sequelize=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'name':{'type':Sequelize[_0x3b09('0x2')],'allowNull':![],'unique':_0x3b09('0x3')},'version':{'type':Sequelize[_0x3b09('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':_0x3b09('0x4')},'filename':{'type':Sequelize[_0x3b09('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3b09('0x2')]},'size':{'type':Sequelize[_0x3b09('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x3b09('0x2')]},'logo':{'type':Sequelize[_0x3b09('0x2')]},'state':{'type':Sequelize[_0x3b09('0x2')],'unique':_0x3b09('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x3b09('0x2')]},'remoteUri':{'type':Sequelize[_0x3b09('0x2')]},'link':{'type':Sequelize[_0x3b09('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 695d2e6..b79e547 100644 --- a/server/api/integration/integration.controller.js +++ b/server/api/integration/integration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafc4=['reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','Integration','includeAll','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x27934b,_0x194bc2){var _0x11363d=function(_0x2e4ed4){while(--_0x2e4ed4){_0x27934b['push'](_0x27934b['shift']());}};_0x11363d(++_0x194bc2);}(_0xafc4,0x69));var _0x4afc=function(_0x36ba58,_0x372b4c){_0x36ba58=_0x36ba58-0x0;var _0x4cbea1=_0xafc4[_0x36ba58];return _0x4cbea1;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['Integration'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['Integration']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));}; \ No newline at end of file +var _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x56a06f,_0x183813){var _0x3309ac=function(_0x562fb0){while(--_0x562fb0){_0x56a06f['push'](_0x56a06f['shift']());}};_0x3309ac(++_0x183813);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x54a27d,_0xaaadd4){_0x54a27d=_0x54a27d-0x0;var _0x39d4b1=_0xc6ac[_0x54a27d];return _0x39d4b1;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index e9f2a44..93bd250 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 _0x2fff=['integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define'];(function(_0x4d70a4,_0x54299a){var _0x299725=function(_0x39b56b){while(--_0x39b56b){_0x4d70a4['push'](_0x4d70a4['shift']());}};_0x299725(++_0x54299a);}(_0x2fff,0x1e1));var _0xf2ff=function(_0x13b434,_0xec3be9){_0x13b434=_0x13b434-0x0;var _0x17b622=_0x2fff[_0x13b434];return _0x17b622;};'use strict';var _=require(_0xf2ff('0x0'));var util=require('util');var logger=require(_0xf2ff('0x1'))(_0xf2ff('0x2'));var moment=require(_0xf2ff('0x3'));var BPromise=require(_0xf2ff('0x4'));var rp=require(_0xf2ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2ff('0x6'));var config=require(_0xf2ff('0x7'));var attributes=require(_0xf2ff('0x8'));module[_0xf2ff('0x9')]=function(_0x530ab7,_0x5e2227){return _0x530ab7[_0xf2ff('0xa')]('Integration',attributes,{'tableName':_0xf2ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf005=['define','Integration','util','api','bluebird','request-promise','rimraf','exports'];(function(_0x2694f7,_0x50c5b2){var _0x1098f1=function(_0x361dd8){while(--_0x361dd8){_0x2694f7['push'](_0x2694f7['shift']());}};_0x1098f1(++_0x50c5b2);}(_0xf005,0x1e2));var _0x5f00=function(_0x5f2a3d,_0x5c2fa0){_0x5f2a3d=_0x5f2a3d-0x0;var _0x127146=_0xf005[_0x5f2a3d];return _0x127146;};'use strict';var _=require('lodash');var util=require(_0x5f00('0x0'));var logger=require('../../config/logger')(_0x5f00('0x1'));var moment=require('moment');var BPromise=require(_0x5f00('0x2'));var rp=require(_0x5f00('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f00('0x4'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x5f00('0x5')]=function(_0x59312c,_0x3a6ffb){return _0x59312c[_0x5f00('0x6')](_0x5f00('0x7'),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 020049d..a33a2c0 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 _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x356f00,_0xb294cd){_0x356f00=_0x356f00-0x0;var _0x29763a=_0x7a54[_0x356f00];return _0x29763a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5908d2,_0x20be9f){var _0xece5e1=function(_0x379bc5){while(--_0x379bc5){_0x5908d2['push'](_0x5908d2['shift']());}};_0xece5e1(++_0x20be9f);}(_0x57ca,0x108));var _0xa57c=function(_0x4a595b,_0x4fcda7){_0x4a595b=_0x4a595b-0x0;var _0x20046e=_0x57ca[_0x4a595b];return _0x20046e;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('Integration,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('Integration,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fc47506..1562e14 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2c1922,_0x264ba0){var _0x2362a8=function(_0x4c3aef){while(--_0x4c3aef){_0x2c1922['push'](_0x2c1922['shift']());}};_0x2362a8(++_0x264ba0);}(_0x4975,0x86));var _0x5497=function(_0x508068,_0x1353b9){_0x508068=_0x508068-0x0;var _0x156aa1=_0x4975[_0x508068];return _0x156aa1;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x556f36,_0x531143){var _0xe2c235=function(_0x12d596){while(--_0x12d596){_0x556f36['push'](_0x556f36['shift']());}};_0xe2c235(++_0x531143);}(_0xc2c7,0x134));var _0x7c2c=function(_0x5d66a5,_0x344863){_0x5d66a5=_0x5d66a5-0x0;var _0x4a3be6=_0xc2c7[_0x5d66a5];return _0x4a3be6;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 788a806..2688940 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 _0x26c8=['BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x26c8,0x11b));var _0x826c=function(_0x57135d,_0x256d60){_0x57135d=_0x57135d-0x0;var _0x439bd4=_0x26c8[_0x57135d];return _0x439bd4;};'use strict';var Sequelize=require(_0x826c('0x0'));module[_0x826c('0x1')]={'integration':{'type':Sequelize[_0x826c('0x2')]},'eventChannel':{'type':Sequelize[_0x826c('0x2')]},'exitStatus':{'type':Sequelize[_0x826c('0x2')]},'ticketId':{'type':Sequelize[_0x826c('0x2')]},'integrationId':{'type':Sequelize[_0x826c('0x3')]},'contacts':{'type':Sequelize[_0x826c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x826c('0x2')]},'queue':{'type':Sequelize[_0x826c('0x2')]},'interface':{'type':Sequelize[_0x826c('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x826c('0x4')]},'agentconnectAt':{'type':Sequelize[_0x826c('0x4')]},'holdtime':{'type':Sequelize[_0x826c('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x826c('0x4')]},'talktime':{'type':Sequelize[_0x826c('0x3')]},'agentacw':{'type':Sequelize[_0x826c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x826c('0x3')]},'reason':{'type':Sequelize[_0x826c('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x826c('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x826c('0x4')]},'agentdump':{'type':Sequelize[_0x826c('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x826c('0x4')]},'lastevent':{'type':Sequelize[_0x826c('0x2')]},'channel':{'type':Sequelize[_0x826c('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x826c('0x2')]},'accountcode':{'type':Sequelize[_0x826c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x826c('0x2')]},'priority':{'type':Sequelize[_0x826c('0x2')]},'destchannel':{'type':Sequelize[_0x826c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x826c('0x2')]},'destcalleridnum':{'type':Sequelize[_0x826c('0x2')]},'destcalleridname':{'type':Sequelize[_0x826c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x826c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x826c('0x2')]},'destaccountcode':{'type':Sequelize[_0x826c('0x2')]},'destcontext':{'type':Sequelize[_0x826c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x826c('0x2')]},'inReplyTo':{'type':Sequelize[_0x826c('0x2')]},'subject':{'type':Sequelize[_0x826c('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x826c('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x826c('0x6')]},'text':{'type':Sequelize[_0x826c('0x6')]},'status':{'type':Sequelize[_0x826c('0x7')](_0x826c('0x8'),_0x826c('0x9'),_0x826c('0xa'),_0x826c('0xb'))},'url':{'type':Sequelize[_0x826c('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x826c('0x2')]},'projectId':{'type':Sequelize[_0x826c('0x3')]}}; \ No newline at end of file +var _0x1b0f=['SENT','SENDING','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x575712,_0x9910f7){var _0x544fe8=function(_0x3eb5f0){while(--_0x3eb5f0){_0x575712['push'](_0x575712['shift']());}};_0x544fe8(++_0x9910f7);}(_0x1b0f,0x194));var _0xf1b0=function(_0x201e60,_0x3f5138){_0x201e60=_0x201e60-0x0;var _0x27d734=_0x1b0f[_0x201e60];return _0x27d734;};'use strict';var Sequelize=require('sequelize');module[_0xf1b0('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf1b0('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xf1b0('0x1')]},'integrationId':{'type':Sequelize[_0xf1b0('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf1b0('0x1')]},'calleridnum':{'type':Sequelize[_0xf1b0('0x1')]},'calleridname':{'type':Sequelize[_0xf1b0('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xf1b0('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xf1b0('0x3')]},'agentconnectAt':{'type':Sequelize[_0xf1b0('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf1b0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf1b0('0x3')]},'talktime':{'type':Sequelize[_0xf1b0('0x2')]},'agentacw':{'type':Sequelize[_0xf1b0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf1b0('0x2')]},'reason':{'type':Sequelize[_0xf1b0('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xf1b0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xf1b0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf1b0('0x2')]},'channelstatedesc':{'type':Sequelize[_0xf1b0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf1b0('0x1')]},'connectedlinename':{'type':Sequelize[_0xf1b0('0x1')]},'language':{'type':Sequelize[_0xf1b0('0x1')]},'accountcode':{'type':Sequelize[_0xf1b0('0x1')]},'context':{'type':Sequelize[_0xf1b0('0x1')]},'exten':{'type':Sequelize[_0xf1b0('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf1b0('0x1')]},'destchannelstate':{'type':Sequelize[_0xf1b0('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xf1b0('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf1b0('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf1b0('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf1b0('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf1b0('0x1')]},'destpriority':{'type':Sequelize[_0xf1b0('0x1')]},'destuniqueid':{'type':Sequelize[_0xf1b0('0x1')]},'messageId':{'type':Sequelize[_0xf1b0('0x1')]},'inReplyTo':{'type':Sequelize[_0xf1b0('0x1')]},'subject':{'type':Sequelize[_0xf1b0('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf1b0('0x1')]},'cc':{'type':Sequelize[_0xf1b0('0x1')]},'attachment':{'type':Sequelize[_0xf1b0('0x5')]},'html':{'type':Sequelize[_0xf1b0('0x5')]},'text':{'type':Sequelize[_0xf1b0('0x5')]},'status':{'type':Sequelize['ENUM'](_0xf1b0('0x6'),_0xf1b0('0x7'),_0xf1b0('0x8'),_0xf1b0('0x9'))},'url':{'type':Sequelize[_0xf1b0('0x1')]},'app':{'type':Sequelize[_0xf1b0('0x1')]},'appdata':{'type':Sequelize[_0xf1b0('0x1')]},'projectId':{'type':Sequelize[_0xf1b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 419a885..4a7bb38 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 _0xc198=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','IntegrationReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','rawAttributes','options','find','create','body','params','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xc198,0x166));var _0x8c19=function(_0x18b70e,_0xfb5858){_0x18b70e=_0x18b70e-0x0;var _0x5c9de2=_0xc198[_0x18b70e];return _0x5c9de2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c19('0x0'));var zipdir=require(_0x8c19('0x1'));var jsonpatch=require(_0x8c19('0x2'));var rp=require(_0x8c19('0x3'));var moment=require(_0x8c19('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8c19('0x5'));var csv=require(_0x8c19('0x6'));var ejs=require(_0x8c19('0x7'));var fs=require('fs');var fs_extra=require(_0x8c19('0x8'));var _=require(_0x8c19('0x9'));var squel=require('squel');var crypto=require(_0x8c19('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8c19('0xb'));var Papa=require(_0x8c19('0xc'));var Redis=require(_0x8c19('0xd'));var authService=require(_0x8c19('0xe'));var qs=require(_0x8c19('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c19('0x10'));var logger=require(_0x8c19('0x11'))(_0x8c19('0x12'));var utils=require(_0x8c19('0x13'));var config=require(_0x8c19('0x14'));var licenseUtil=require(_0x8c19('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43d2e2,_0x1a38d1){_0x1a38d1=_0x1a38d1||0xcc;return function(_0x4adc78){if(_0x4adc78){return _0x43d2e2[_0x8c19('0x16')](_0x1a38d1);}return _0x43d2e2[_0x8c19('0x17')](_0x1a38d1)['end']();};}function respondWithResult(_0x5a81cb,_0x56629a){_0x56629a=_0x56629a||0xc8;return function(_0xa09b6c){if(_0xa09b6c){return _0x5a81cb[_0x8c19('0x17')](_0x56629a)['json'](_0xa09b6c);}};}function respondWithFilteredResult(_0x2e7463,_0x2d0d8f){return function(_0x1230f0){if(_0x1230f0){var _0x401a4c=typeof _0x2d0d8f['offset']===_0x8c19('0x18')&&typeof _0x2d0d8f[_0x8c19('0x19')]===_0x8c19('0x18');var _0x2455e4=_0x1230f0['count'];var _0xa33216=_0x401a4c?0x0:_0x2d0d8f[_0x8c19('0x1a')];var _0x36956c=_0x401a4c?_0x1230f0[_0x8c19('0x1b')]:_0x2d0d8f[_0x8c19('0x1a')]+_0x2d0d8f[_0x8c19('0x19')];var _0x140c71;if(_0x36956c>=_0x2455e4){_0x36956c=_0x2455e4;_0x140c71=0xc8;}else{_0x140c71=0xce;}_0x2e7463[_0x8c19('0x17')](_0x140c71);return _0x2e7463[_0x8c19('0x1c')](_0x8c19('0x1d'),_0xa33216+'-'+_0x36956c+'/'+_0x2455e4)[_0x8c19('0x1e')](_0x1230f0);}return null;};}function patchUpdates(_0x3be49e){return function(_0x1af128){try{jsonpatch[_0x8c19('0x1f')](_0x1af128,_0x3be49e,!![]);}catch(_0x5bbead){return BPromise[_0x8c19('0x20')](_0x5bbead);}return _0x1af128[_0x8c19('0x21')]();};}function saveUpdates(_0x55a977,_0x36b6e8){return function(_0x5462d8){if(_0x5462d8){return _0x5462d8[_0x8c19('0x22')](_0x55a977)[_0x8c19('0x23')](function(_0x17c2df){return _0x17c2df;});}return null;};}function removeEntity(_0x2f26ad,_0x391b35){return function(_0x1bc437){if(_0x1bc437){return _0x1bc437['destroy']()['then'](function(){_0x2f26ad[_0x8c19('0x17')](0xcc)[_0x8c19('0x24')]();});}};}function handleEntityNotFound(_0x1a1309,_0x5516c6){return function(_0x743757){if(!_0x743757){_0x1a1309[_0x8c19('0x16')](0x194);}return _0x743757;};}function handleError(_0x1cafd4,_0x212c6c){_0x212c6c=_0x212c6c||0x1f4;return function(_0x5dddea){logger[_0x8c19('0x25')](_0x5dddea[_0x8c19('0x26')]);if(_0x5dddea[_0x8c19('0x27')]){delete _0x5dddea[_0x8c19('0x27')];}_0x1cafd4[_0x8c19('0x17')](_0x212c6c)[_0x8c19('0x28')](_0x5dddea);};}exports[_0x8c19('0x29')]=function(_0x23f84d,_0x2b2e74){var _0x303995={},_0x16155f={},_0x1edc85={'count':0x0,'rows':[]};var _0x554f1d=_[_0x8c19('0x2a')](db[_0x8c19('0x2b')]['rawAttributes'],function(_0x152b68){return{'name':_0x152b68[_0x8c19('0x2c')],'type':_0x152b68[_0x8c19('0x2d')]['key']};});_0x16155f['model']=_[_0x8c19('0x2a')](_0x554f1d,'name');_0x16155f[_0x8c19('0x2e')]=_[_0x8c19('0x2f')](_0x23f84d[_0x8c19('0x2e')]);_0x16155f[_0x8c19('0x30')]=_[_0x8c19('0x31')](_0x16155f[_0x8c19('0x32')],_0x16155f['query']);_0x303995[_0x8c19('0x33')]=_[_0x8c19('0x31')](_0x16155f['model'],qs[_0x8c19('0x34')](_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x34')]));_0x303995[_0x8c19('0x33')]=_0x303995[_0x8c19('0x33')][_0x8c19('0x35')]?_0x303995[_0x8c19('0x33')]:_0x16155f[_0x8c19('0x32')];if(!_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x36')](_0x8c19('0x37'))){_0x303995[_0x8c19('0x19')]=qs[_0x8c19('0x19')](_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x19')]);_0x303995[_0x8c19('0x1a')]=qs['offset'](_0x23f84d[_0x8c19('0x2e')]['offset']);}_0x303995[_0x8c19('0x38')]=qs[_0x8c19('0x39')](_0x23f84d['query']['sort']);_0x303995[_0x8c19('0x3a')]=qs[_0x8c19('0x30')](_[_0x8c19('0x3b')](_0x23f84d[_0x8c19('0x2e')],_0x16155f[_0x8c19('0x30')]),_0x554f1d);if(_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x3c')]){_0x303995[_0x8c19('0x3a')]=_[_0x8c19('0x3d')](_0x303995[_0x8c19('0x3a')],{'$or':_[_0x8c19('0x2a')](_0x554f1d,function(_0x1ad52d){if(_0x1ad52d[_0x8c19('0x2d')]!=='VIRTUAL'){var _0x4f4fa1={};_0x4f4fa1[_0x1ad52d[_0x8c19('0x27')]]={'$like':'%'+_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x3c')]+'%'};return _0x4f4fa1;}})});}_0x303995=_['merge']({},_0x303995,_0x23f84d['options']);var _0x2326bf={'where':_0x303995[_0x8c19('0x3a')]};return db['IntegrationReport'][_0x8c19('0x1b')](_0x2326bf)[_0x8c19('0x23')](function(_0x39151c){_0x1edc85[_0x8c19('0x1b')]=_0x39151c;if(_0x23f84d[_0x8c19('0x2e')][_0x8c19('0x3e')]){_0x303995[_0x8c19('0x3f')]=[{'all':!![]}];}return db[_0x8c19('0x2b')]['findAll'](_0x303995);})[_0x8c19('0x23')](function(_0x3fcabd){_0x1edc85[_0x8c19('0x40')]=_0x3fcabd;return _0x1edc85;})[_0x8c19('0x23')](respondWithFilteredResult(_0x2b2e74,_0x303995))['catch'](handleError(_0x2b2e74,null));};exports['show']=function(_0x4a6e3e,_0x277567){var _0x1ff809={'raw':![],'where':{'id':_0x4a6e3e['params']['id']}},_0x36e2c4={};_0x36e2c4[_0x8c19('0x32')]=_['keys'](db[_0x8c19('0x2b')][_0x8c19('0x41')]);_0x36e2c4[_0x8c19('0x2e')]=_[_0x8c19('0x2f')](_0x4a6e3e['query']);_0x36e2c4[_0x8c19('0x30')]=_[_0x8c19('0x31')](_0x36e2c4[_0x8c19('0x32')],_0x36e2c4[_0x8c19('0x2e')]);_0x1ff809[_0x8c19('0x33')]=_[_0x8c19('0x31')](_0x36e2c4[_0x8c19('0x32')],qs[_0x8c19('0x34')](_0x4a6e3e[_0x8c19('0x2e')][_0x8c19('0x34')]));_0x1ff809[_0x8c19('0x33')]=_0x1ff809['attributes'][_0x8c19('0x35')]?_0x1ff809[_0x8c19('0x33')]:_0x36e2c4[_0x8c19('0x32')];if(_0x4a6e3e[_0x8c19('0x2e')][_0x8c19('0x3e')]){_0x1ff809[_0x8c19('0x3f')]=[{'all':!![]}];}_0x1ff809=_['merge']({},_0x1ff809,_0x4a6e3e[_0x8c19('0x42')]);return db[_0x8c19('0x2b')][_0x8c19('0x43')](_0x1ff809)[_0x8c19('0x23')](handleEntityNotFound(_0x277567,null))[_0x8c19('0x23')](respondWithResult(_0x277567,null))['catch'](handleError(_0x277567,null));};exports[_0x8c19('0x44')]=function(_0x137438,_0x4ed22c){return db['IntegrationReport'][_0x8c19('0x44')](_0x137438[_0x8c19('0x45')],{})['then'](respondWithResult(_0x4ed22c,0xc9))['catch'](handleError(_0x4ed22c,null));};exports[_0x8c19('0x22')]=function(_0x16ece8,_0x55c7d5){if(_0x16ece8['body']['id']){delete _0x16ece8[_0x8c19('0x45')]['id'];}return db[_0x8c19('0x2b')][_0x8c19('0x43')]({'where':{'id':_0x16ece8[_0x8c19('0x46')]['id']}})['then'](handleEntityNotFound(_0x55c7d5,null))['then'](saveUpdates(_0x16ece8['body'],null))['then'](respondWithResult(_0x55c7d5,null))[_0x8c19('0x47')](handleError(_0x55c7d5,null));};exports[_0x8c19('0x48')]=function(_0x2a6723,_0x501cd5){return db[_0x8c19('0x2b')][_0x8c19('0x43')]({'where':{'id':_0x2a6723[_0x8c19('0x46')]['id']}})[_0x8c19('0x23')](handleEntityNotFound(_0x501cd5,null))[_0x8c19('0x23')](removeEntity(_0x501cd5,null))[_0x8c19('0x47')](handleError(_0x501cd5,null));};exports['describe']=function(_0x1e5787,_0xada893){return db[_0x8c19('0x2b')][_0x8c19('0x49')]()[_0x8c19('0x23')](respondWithResult(_0xada893,null))[_0x8c19('0x47')](handleError(_0xada893,null));}; \ No newline at end of file +var _0x1288=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x4a0201,_0x482e0d){var _0x54850a=function(_0x52f4eb){while(--_0x52f4eb){_0x4a0201['push'](_0x4a0201['shift']());}};_0x54850a(++_0x482e0d);}(_0x1288,0x163));var _0x8128=function(_0x557a0e,_0x62ab98){_0x557a0e=_0x557a0e-0x0;var _0x340cbf=_0x1288[_0x557a0e];return _0x340cbf;};'use strict';var emlformat=require(_0x8128('0x0'));var rimraf=require(_0x8128('0x1'));var zipdir=require(_0x8128('0x2'));var jsonpatch=require(_0x8128('0x3'));var rp=require('request-promise');var moment=require(_0x8128('0x4'));var BPromise=require(_0x8128('0x5'));var Mustache=require(_0x8128('0x6'));var util=require(_0x8128('0x7'));var path=require('path');var sox=require(_0x8128('0x8'));var csv=require(_0x8128('0x9'));var ejs=require(_0x8128('0xa'));var fs=require('fs');var fs_extra=require(_0x8128('0xb'));var _=require(_0x8128('0xc'));var squel=require('squel');var crypto=require(_0x8128('0xd'));var jsforce=require(_0x8128('0xe'));var deskjs=require(_0x8128('0xf'));var toCsv=require(_0x8128('0x9'));var querystring=require(_0x8128('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8128('0x11'));var qs=require(_0x8128('0x12'));var as=require(_0x8128('0x13'));var hardwareService=require(_0x8128('0x14'));var logger=require(_0x8128('0x15'))(_0x8128('0x16'));var utils=require('../../config/utils');var config=require(_0x8128('0x17'));var licenseUtil=require(_0x8128('0x18'));var db=require(_0x8128('0x19'))['db'];function respondWithStatusCode(_0x4a7d3f,_0x463576){_0x463576=_0x463576||0xcc;return function(_0x4b9f9b){if(_0x4b9f9b){return _0x4a7d3f[_0x8128('0x1a')](_0x463576);}return _0x4a7d3f[_0x8128('0x1b')](_0x463576)[_0x8128('0x1c')]();};}function respondWithResult(_0xf95950,_0x4a2aa4){_0x4a2aa4=_0x4a2aa4||0xc8;return function(_0x17680b){if(_0x17680b){return _0xf95950[_0x8128('0x1b')](_0x4a2aa4)[_0x8128('0x1d')](_0x17680b);}};}function respondWithFilteredResult(_0x50ee09,_0x3426da){return function(_0x45e0cd){if(_0x45e0cd){var _0x5114c4=typeof _0x3426da['offset']===_0x8128('0x1e')&&typeof _0x3426da[_0x8128('0x1f')]==='undefined';var _0x38eb06=_0x45e0cd['count'];var _0x44770b=_0x5114c4?0x0:_0x3426da['offset'];var _0x419987=_0x5114c4?_0x45e0cd[_0x8128('0x20')]:_0x3426da[_0x8128('0x21')]+_0x3426da[_0x8128('0x1f')];var _0x6bec8a;if(_0x419987>=_0x38eb06){_0x419987=_0x38eb06;_0x6bec8a=0xc8;}else{_0x6bec8a=0xce;}_0x50ee09['status'](_0x6bec8a);return _0x50ee09['set']('Content-Range',_0x44770b+'-'+_0x419987+'/'+_0x38eb06)['json'](_0x45e0cd);}return null;};}function patchUpdates(_0x2ad212){return function(_0x180416){try{jsonpatch['apply'](_0x180416,_0x2ad212,!![]);}catch(_0x31507b){return BPromise[_0x8128('0x22')](_0x31507b);}return _0x180416[_0x8128('0x23')]();};}function saveUpdates(_0x442c7d,_0xdc955a){return function(_0x3aed26){if(_0x3aed26){return _0x3aed26[_0x8128('0x24')](_0x442c7d)[_0x8128('0x25')](function(_0x21fe67){return _0x21fe67;});}return null;};}function removeEntity(_0x9ed9b5,_0x4fc482){return function(_0x189037){if(_0x189037){return _0x189037['destroy']()[_0x8128('0x25')](function(){_0x9ed9b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aef90,_0x4fbb73){return function(_0x42c235){if(!_0x42c235){_0x3aef90[_0x8128('0x1a')](0x194);}return _0x42c235;};}function handleError(_0x435a32,_0x295865){_0x295865=_0x295865||0x1f4;return function(_0x349506){logger['error'](_0x349506[_0x8128('0x26')]);if(_0x349506[_0x8128('0x27')]){delete _0x349506[_0x8128('0x27')];}_0x435a32['status'](_0x295865)[_0x8128('0x28')](_0x349506);};}exports[_0x8128('0x29')]=function(_0xb885c8,_0x4574c4){var _0x87ba15={},_0x354e10={},_0x39b6ff={'count':0x0,'rows':[]};var _0x171d7c=_['map'](db['IntegrationReport'][_0x8128('0x2a')],function(_0x107b55){return{'name':_0x107b55[_0x8128('0x2b')],'type':_0x107b55[_0x8128('0x2c')][_0x8128('0x2d')]};});_0x354e10[_0x8128('0x2e')]=_[_0x8128('0x2f')](_0x171d7c,_0x8128('0x27'));_0x354e10[_0x8128('0x30')]=_[_0x8128('0x31')](_0xb885c8[_0x8128('0x30')]);_0x354e10[_0x8128('0x32')]=_[_0x8128('0x33')](_0x354e10[_0x8128('0x2e')],_0x354e10['query']);_0x87ba15[_0x8128('0x34')]=_[_0x8128('0x33')](_0x354e10[_0x8128('0x2e')],qs[_0x8128('0x35')](_0xb885c8[_0x8128('0x30')][_0x8128('0x35')]));_0x87ba15[_0x8128('0x34')]=_0x87ba15[_0x8128('0x34')][_0x8128('0x36')]?_0x87ba15[_0x8128('0x34')]:_0x354e10[_0x8128('0x2e')];if(!_0xb885c8[_0x8128('0x30')]['hasOwnProperty'](_0x8128('0x37'))){_0x87ba15[_0x8128('0x1f')]=qs[_0x8128('0x1f')](_0xb885c8[_0x8128('0x30')][_0x8128('0x1f')]);_0x87ba15[_0x8128('0x21')]=qs[_0x8128('0x21')](_0xb885c8[_0x8128('0x30')][_0x8128('0x21')]);}_0x87ba15[_0x8128('0x38')]=qs[_0x8128('0x39')](_0xb885c8[_0x8128('0x30')][_0x8128('0x39')]);_0x87ba15[_0x8128('0x3a')]=qs[_0x8128('0x32')](_[_0x8128('0x3b')](_0xb885c8[_0x8128('0x30')],_0x354e10[_0x8128('0x32')]),_0x171d7c);if(_0xb885c8['query'][_0x8128('0x3c')]){_0x87ba15[_0x8128('0x3a')]=_[_0x8128('0x3d')](_0x87ba15[_0x8128('0x3a')],{'$or':_['map'](_0x171d7c,function(_0x4e2af5){if(_0x4e2af5['type']!==_0x8128('0x3e')){var _0x15d689={};_0x15d689[_0x4e2af5[_0x8128('0x27')]]={'$like':'%'+_0xb885c8[_0x8128('0x30')]['filter']+'%'};return _0x15d689;}})});}_0x87ba15=_[_0x8128('0x3d')]({},_0x87ba15,_0xb885c8[_0x8128('0x3f')]);var _0x1d3507={'where':_0x87ba15[_0x8128('0x3a')]};return db['IntegrationReport'][_0x8128('0x20')](_0x1d3507)[_0x8128('0x25')](function(_0x7b4c8e){_0x39b6ff['count']=_0x7b4c8e;if(_0xb885c8[_0x8128('0x30')]['includeAll']){_0x87ba15['include']=[{'all':!![]}];}return db[_0x8128('0x40')][_0x8128('0x41')](_0x87ba15);})['then'](function(_0x227636){_0x39b6ff['rows']=_0x227636;return _0x39b6ff;})[_0x8128('0x25')](respondWithFilteredResult(_0x4574c4,_0x87ba15))['catch'](handleError(_0x4574c4,null));};exports[_0x8128('0x42')]=function(_0xd2d7ef,_0xee65b1){var _0x4b3f97={'raw':![],'where':{'id':_0xd2d7ef[_0x8128('0x43')]['id']}},_0x22031c={};_0x22031c[_0x8128('0x2e')]=_[_0x8128('0x31')](db[_0x8128('0x40')][_0x8128('0x2a')]);_0x22031c[_0x8128('0x30')]=_[_0x8128('0x31')](_0xd2d7ef['query']);_0x22031c[_0x8128('0x32')]=_[_0x8128('0x33')](_0x22031c[_0x8128('0x2e')],_0x22031c[_0x8128('0x30')]);_0x4b3f97['attributes']=_[_0x8128('0x33')](_0x22031c[_0x8128('0x2e')],qs[_0x8128('0x35')](_0xd2d7ef[_0x8128('0x30')][_0x8128('0x35')]));_0x4b3f97[_0x8128('0x34')]=_0x4b3f97[_0x8128('0x34')][_0x8128('0x36')]?_0x4b3f97['attributes']:_0x22031c['model'];if(_0xd2d7ef['query'][_0x8128('0x44')]){_0x4b3f97['include']=[{'all':!![]}];}_0x4b3f97=_[_0x8128('0x3d')]({},_0x4b3f97,_0xd2d7ef[_0x8128('0x3f')]);return db[_0x8128('0x40')][_0x8128('0x45')](_0x4b3f97)[_0x8128('0x25')](handleEntityNotFound(_0xee65b1,null))[_0x8128('0x25')](respondWithResult(_0xee65b1,null))[_0x8128('0x46')](handleError(_0xee65b1,null));};exports[_0x8128('0x47')]=function(_0x32418f,_0x123edf){return db['IntegrationReport'][_0x8128('0x47')](_0x32418f[_0x8128('0x48')],{})['then'](respondWithResult(_0x123edf,0xc9))['catch'](handleError(_0x123edf,null));};exports['update']=function(_0x44467e,_0x580a93){if(_0x44467e[_0x8128('0x48')]['id']){delete _0x44467e[_0x8128('0x48')]['id'];}return db['IntegrationReport'][_0x8128('0x45')]({'where':{'id':_0x44467e['params']['id']}})[_0x8128('0x25')](handleEntityNotFound(_0x580a93,null))[_0x8128('0x25')](saveUpdates(_0x44467e[_0x8128('0x48')],null))[_0x8128('0x25')](respondWithResult(_0x580a93,null))[_0x8128('0x46')](handleError(_0x580a93,null));};exports['destroy']=function(_0x1e3b6a,_0x371de1){return db[_0x8128('0x40')][_0x8128('0x45')]({'where':{'id':_0x1e3b6a[_0x8128('0x43')]['id']}})[_0x8128('0x25')](handleEntityNotFound(_0x371de1,null))[_0x8128('0x25')](removeEntity(_0x371de1,null))[_0x8128('0x46')](handleError(_0x371de1,null));};exports['describe']=function(_0x1eeb40,_0x1976d1){return db['IntegrationReport'][_0x8128('0x49')]()[_0x8128('0x25')](respondWithResult(_0x1976d1,null))[_0x8128('0x46')](handleError(_0x1976d1,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 969eb17..c9c95b4 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 _0x3bf9=['define','IntegrationReport','report_integration','util','../../config/logger','path','rimraf','./integrationReport.attributes'];(function(_0x2137a3,_0x51d868){var _0x1f17bb=function(_0x2c1346){while(--_0x2c1346){_0x2137a3['push'](_0x2137a3['shift']());}};_0x1f17bb(++_0x51d868);}(_0x3bf9,0x8b));var _0x93bf=function(_0x5466e0,_0x586206){_0x5466e0=_0x5466e0-0x0;var _0xf32c89=_0x3bf9[_0x5466e0];return _0xf32c89;};'use strict';var _=require('lodash');var util=require(_0x93bf('0x0'));var logger=require(_0x93bf('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x93bf('0x2'));var rimraf=require(_0x93bf('0x3'));var config=require('../../config/environment');var attributes=require(_0x93bf('0x4'));module['exports']=function(_0x4ffa64,_0x491d8e){return _0x4ffa64[_0x93bf('0x5')](_0x93bf('0x6'),attributes,{'tableName':_0x93bf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8196=['bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','../../config/logger','moment'];(function(_0x46e47b,_0x1c9794){var _0x13a9e1=function(_0x2d2d87){while(--_0x2d2d87){_0x46e47b['push'](_0x46e47b['shift']());}};_0x13a9e1(++_0x1c9794);}(_0x8196,0x1dc));var _0x6819=function(_0x5302c1,_0x30f9bf){_0x5302c1=_0x5302c1-0x0;var _0xfedad8=_0x8196[_0x5302c1];return _0xfedad8;};'use strict';var _=require(_0x6819('0x0'));var util=require(_0x6819('0x1'));var logger=require(_0x6819('0x2'))('api');var moment=require(_0x6819('0x3'));var BPromise=require(_0x6819('0x4'));var rp=require(_0x6819('0x5'));var fs=require('fs');var path=require(_0x6819('0x6'));var rimraf=require('rimraf');var config=require(_0x6819('0x7'));var attributes=require(_0x6819('0x8'));module[_0x6819('0x9')]=function(_0x2fccf5,_0x5c3738){return _0x2fccf5[_0x6819('0xa')](_0x6819('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 27f9d4c..8f66ef1 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 _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x51cca2,_0x4f46fe){var _0x4e3d5=function(_0x514420){while(--_0x514420){_0x51cca2['push'](_0x51cca2['shift']());}};_0x4e3d5(++_0x4f46fe);}(_0x2542,0x169));var _0x2254=function(_0x3d43e9,_0x4beeae){_0x3d43e9=_0x3d43e9-0x0;var _0x2e36c8=_0x2542[_0x3d43e9];return _0x2e36c8;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x136798,_0x1b4627){var _0x234368=function(_0x2c2923){while(--_0x2c2923){_0x136798['push'](_0x136798['shift']());}};_0x234368(++_0x1b4627);}(_0x2675,0x75));var _0x5267=function(_0xb49a7,_0x4e33fa){_0xb49a7=_0xb49a7-0x0;var _0x50bdc2=_0x2675[_0xb49a7];return _0x50bdc2;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index da55e92..f24fc88 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 _0x2f91=['addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','/:id/sub_intervals','getIntervals','post','create'];(function(_0x2f7b5f,_0x1a9d84){var _0x2bae86=function(_0x20506a){while(--_0x20506a){_0x2f7b5f['push'](_0x2f7b5f['shift']());}};_0x2bae86(++_0x1a9d84);}(_0x2f91,0x98));var _0x12f9=function(_0x507182,_0x156408){_0x507182=_0x507182-0x0;var _0x27d64e=_0x2f91[_0x507182];return _0x27d64e;};'use strict';var multer=require(_0x12f9('0x0'));var util=require(_0x12f9('0x1'));var path=require(_0x12f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x12f9('0x3'));var router=express[_0x12f9('0x4')]();var fs_extra=require(_0x12f9('0x5'));var auth=require(_0x12f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x12f9('0x7'));var controller=require(_0x12f9('0x8'));router[_0x12f9('0x9')]('/',auth[_0x12f9('0xa')](),controller['index']);router[_0x12f9('0x9')](_0x12f9('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x12f9('0xc'),auth[_0x12f9('0xa')](),controller[_0x12f9('0xd')]);router[_0x12f9('0xe')]('/',auth[_0x12f9('0xa')](),controller[_0x12f9('0xf')]);router[_0x12f9('0xe')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x12f9('0x10')]);router[_0x12f9('0xe')](_0x12f9('0x11'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x12')]);router[_0x12f9('0x13')](_0x12f9('0xb'),auth['isAuthenticated'](),controller[_0x12f9('0x14')]);router[_0x12f9('0x15')](_0x12f9('0xb'),auth[_0x12f9('0xa')](),controller[_0x12f9('0x16')]);module[_0x12f9('0x17')]=router; \ No newline at end of file +var _0xfc17=['show','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','get','/:id'];(function(_0x4cb7c8,_0x3700b9){var _0x229d3e=function(_0x1f63c0){while(--_0x1f63c0){_0x4cb7c8['push'](_0x4cb7c8['shift']());}};_0x229d3e(++_0x3700b9);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x2bf52a,_0x457785){_0x2bf52a=_0x2bf52a-0x0;var _0x869557=_0xfc17[_0x2bf52a];return _0x869557;};'use strict';var multer=require(_0x7fc1('0x0'));var util=require(_0x7fc1('0x1'));var path=require(_0x7fc1('0x2'));var timeout=require(_0x7fc1('0x3'));var express=require('express');var router=express[_0x7fc1('0x4')]();var fs_extra=require(_0x7fc1('0x5'));var auth=require(_0x7fc1('0x6'));var interaction=require(_0x7fc1('0x7'));var config=require(_0x7fc1('0x8'));var controller=require(_0x7fc1('0x9'));router['get']('/',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xb')]);router[_0x7fc1('0xc')](_0x7fc1('0xd'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xe')]);router[_0x7fc1('0xc')]('/:id/sub_intervals',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0xf')]);router[_0x7fc1('0x10')]('/',auth['isAuthenticated'](),controller[_0x7fc1('0x11')]);router['post']('/:id/sub_intervals',auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x12')]);router[_0x7fc1('0x10')](_0x7fc1('0x13'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x14')]);router[_0x7fc1('0x15')](_0x7fc1('0xd'),auth[_0x7fc1('0xa')](),controller[_0x7fc1('0x16')]);router[_0x7fc1('0x17')](_0x7fc1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7fc1('0x18')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9c4b45c..8f2b94d 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 _0x0383=['sequelize','exports','STRING'];(function(_0x5b38e0,_0x26a28f){var _0x376740=function(_0x341453){while(--_0x341453){_0x5b38e0['push'](_0x5b38e0['shift']());}};_0x376740(++_0x26a28f);}(_0x0383,0x1d1));var _0x3038=function(_0x3d7962,_0x4352ba){_0x3d7962=_0x3d7962-0x0;var _0x1040c7=_0x0383[_0x3d7962];return _0x1040c7;};'use strict';var Sequelize=require(_0x3038('0x0'));module[_0x3038('0x1')]={'name':{'type':Sequelize[_0x3038('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3038('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x621c=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x621c,0x130));var _0xc621=function(_0x2e06b4,_0x4c967a){_0x2e06b4=_0x2e06b4-0x0;var _0x1b5d38=_0x621c[_0x2e06b4];return _0x1b5d38;};'use strict';var Sequelize=require(_0xc621('0x0'));module['exports']={'name':{'type':Sequelize[_0xc621('0x1')]},'description':{'type':Sequelize[_0xc621('0x1')]},'interval':{'type':Sequelize[_0xc621('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 74aa1cc..3756e2e 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 _0xd935=['Intervals','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','Interval','include','findAll','rows','catch','show','params','includeAll','options','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','update','body','find','addInterval','findOne','getIntervals','nolimit','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get'];(function(_0x61990a,_0x96724e){var _0x2517a3=function(_0x5853e3){while(--_0x5853e3){_0x61990a['push'](_0x61990a['shift']());}};_0x2517a3(++_0x96724e);}(_0xd935,0xeb));var _0x5d93=function(_0x2a4af7,_0x400fbf){_0x2a4af7=_0x2a4af7-0x0;var _0x1d07d6=_0xd935[_0x2a4af7];return _0x1d07d6;};'use strict';var emlformat=require(_0x5d93('0x0'));var rimraf=require(_0x5d93('0x1'));var zipdir=require(_0x5d93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d93('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d93('0x4'));var util=require(_0x5d93('0x5'));var path=require(_0x5d93('0x6'));var sox=require('sox');var csv=require(_0x5d93('0x7'));var ejs=require(_0x5d93('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d93('0x9'));var squel=require(_0x5d93('0xa'));var crypto=require(_0x5d93('0xb'));var jsforce=require(_0x5d93('0xc'));var deskjs=require(_0x5d93('0xd'));var toCsv=require(_0x5d93('0x7'));var querystring=require(_0x5d93('0xe'));var Papa=require(_0x5d93('0xf'));var Redis=require('ioredis');var authService=require(_0x5d93('0x10'));var qs=require(_0x5d93('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d93('0x12'));var logger=require('../../config/logger')(_0x5d93('0x13'));var utils=require(_0x5d93('0x14'));var config=require(_0x5d93('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d93('0x16'))['db'];var extensions=require(_0x5d93('0x17'));function respondWithStatusCode(_0x105a5f,_0x310ecb){_0x310ecb=_0x310ecb||0xcc;return function(_0x4b781e){if(_0x4b781e){return _0x105a5f[_0x5d93('0x18')](_0x310ecb);}return _0x105a5f['status'](_0x310ecb)[_0x5d93('0x19')]();};}function respondWithResult(_0x5efa44,_0x53069c){_0x53069c=_0x53069c||0xc8;return function(_0x422154){if(_0x422154){return _0x5efa44[_0x5d93('0x1a')](_0x53069c)[_0x5d93('0x1b')](_0x422154);}};}function respondWithFilteredResult(_0x150b90,_0x5d323f){return function(_0x40bd05){if(_0x40bd05){var _0x2c11e4=typeof _0x5d323f[_0x5d93('0x1c')]===_0x5d93('0x1d')&&typeof _0x5d323f[_0x5d93('0x1e')]===_0x5d93('0x1d');var _0x302c99=_0x40bd05[_0x5d93('0x1f')];var _0x418e37=_0x2c11e4?0x0:_0x5d323f[_0x5d93('0x1c')];var _0x38b2b2=_0x2c11e4?_0x40bd05[_0x5d93('0x1f')]:_0x5d323f['offset']+_0x5d323f['limit'];var _0x2d76a;if(_0x38b2b2>=_0x302c99){_0x38b2b2=_0x302c99;_0x2d76a=0xc8;}else{_0x2d76a=0xce;}_0x150b90['status'](_0x2d76a);return _0x150b90['set']('Content-Range',_0x418e37+'-'+_0x38b2b2+'/'+_0x302c99)['json'](_0x40bd05);}return null;};}function patchUpdates(_0x28683b){return function(_0x1cbbb5){try{jsonpatch[_0x5d93('0x20')](_0x1cbbb5,_0x28683b,!![]);}catch(_0x40d7bf){return BPromise[_0x5d93('0x21')](_0x40d7bf);}return _0x1cbbb5[_0x5d93('0x22')]();};}function saveUpdates(_0x524cab,_0xf65f21){return function(_0x5bb56d){if(_0x5bb56d){return _0x5bb56d['update'](_0x524cab)[_0x5d93('0x23')](function(_0x137424){return _0x137424;});}return null;};}function removeEntity(_0x403860,_0x34cf86){return function(_0x5d0249){if(_0x5d0249){return _0x5d0249[_0x5d93('0x24')]()[_0x5d93('0x23')](function(){var _0x5038bd=_0x5d0249[_0x5d93('0x25')]({'plain':!![]});var _0x2dfdc6=_0x5d93('0x26');return db[_0x5d93('0x27')][_0x5d93('0x24')]({'where':{'type':_0x2dfdc6,'resourceId':_0x5038bd['id']}})[_0x5d93('0x23')](function(){return _0x5d0249;});})['then'](function(){_0x403860[_0x5d93('0x1a')](0xcc)[_0x5d93('0x19')]();});}};}function handleEntityNotFound(_0x49dd54,_0x147554){return function(_0x4dc62d){if(!_0x4dc62d){_0x49dd54[_0x5d93('0x18')](0x194);}return _0x4dc62d;};}function handleError(_0x2224aa,_0x59c097){_0x59c097=_0x59c097||0x1f4;return function(_0x25bdfd){logger[_0x5d93('0x28')](_0x25bdfd[_0x5d93('0x29')]);if(_0x25bdfd[_0x5d93('0x2a')]){delete _0x25bdfd[_0x5d93('0x2a')];}_0x2224aa[_0x5d93('0x1a')](_0x59c097)[_0x5d93('0x2b')](_0x25bdfd);};}exports['index']=function(_0x532233,_0x33dcff){var _0x8a548c={},_0x157398={},_0x3bc8da={'count':0x0,'rows':[]};var _0x27c19f=_[_0x5d93('0x2c')](db['Interval'][_0x5d93('0x2d')],function(_0x4892cc){return{'name':_0x4892cc[_0x5d93('0x2e')],'type':_0x4892cc['type'][_0x5d93('0x2f')]};});_0x157398[_0x5d93('0x30')]=_[_0x5d93('0x2c')](_0x27c19f,'name');_0x157398['query']=_[_0x5d93('0x31')](_0x532233['query']);_0x157398[_0x5d93('0x32')]=_[_0x5d93('0x33')](_0x157398[_0x5d93('0x30')],_0x157398[_0x5d93('0x34')]);_0x8a548c[_0x5d93('0x35')]=_[_0x5d93('0x33')](_0x157398[_0x5d93('0x30')],qs[_0x5d93('0x36')](_0x532233[_0x5d93('0x34')][_0x5d93('0x36')]));_0x8a548c['attributes']=_0x8a548c[_0x5d93('0x35')][_0x5d93('0x37')]?_0x8a548c[_0x5d93('0x35')]:_0x157398[_0x5d93('0x30')];if(!_0x532233['query'][_0x5d93('0x38')]('nolimit')){_0x8a548c['limit']=qs[_0x5d93('0x1e')](_0x532233[_0x5d93('0x34')][_0x5d93('0x1e')]);_0x8a548c[_0x5d93('0x1c')]=qs['offset'](_0x532233[_0x5d93('0x34')][_0x5d93('0x1c')]);}_0x8a548c[_0x5d93('0x39')]=qs[_0x5d93('0x3a')](_0x532233['query']['sort']);_0x8a548c['where']=qs['filters'](_[_0x5d93('0x3b')](_0x532233[_0x5d93('0x34')],_0x157398[_0x5d93('0x32')]),_0x27c19f);if(_0x532233[_0x5d93('0x34')][_0x5d93('0x3c')]){_0x8a548c[_0x5d93('0x3d')]=_[_0x5d93('0x3e')](_0x8a548c[_0x5d93('0x3d')],{'$or':_['map'](_0x27c19f,function(_0xcc985f){if(_0xcc985f[_0x5d93('0x3f')]!=='VIRTUAL'){var _0x4b86d3={};_0x4b86d3[_0xcc985f['name']]={'$like':'%'+_0x532233[_0x5d93('0x34')]['filter']+'%'};return _0x4b86d3;}})});}_0x8a548c=_[_0x5d93('0x3e')]({},_0x8a548c,_0x532233['options']);var _0x2cb23b={'where':_0x8a548c[_0x5d93('0x3d')]};return db[_0x5d93('0x40')][_0x5d93('0x1f')](_0x2cb23b)[_0x5d93('0x23')](function(_0x54e979){_0x3bc8da[_0x5d93('0x1f')]=_0x54e979;if(_0x532233[_0x5d93('0x34')]['includeAll']){_0x8a548c[_0x5d93('0x41')]=[{'all':!![]}];}return db['Interval'][_0x5d93('0x42')](_0x8a548c);})[_0x5d93('0x23')](function(_0x19a148){_0x3bc8da[_0x5d93('0x43')]=_0x19a148;return _0x3bc8da;})[_0x5d93('0x23')](respondWithFilteredResult(_0x33dcff,_0x8a548c))[_0x5d93('0x44')](handleError(_0x33dcff,null));};exports[_0x5d93('0x45')]=function(_0x10d70b,_0xd8447e){var _0x20c69d={'raw':!![],'where':{'id':_0x10d70b[_0x5d93('0x46')]['id']}},_0x129add={};_0x129add[_0x5d93('0x30')]=_['keys'](db[_0x5d93('0x40')][_0x5d93('0x2d')]);_0x129add['query']=_[_0x5d93('0x31')](_0x10d70b[_0x5d93('0x34')]);_0x129add[_0x5d93('0x32')]=_['intersection'](_0x129add[_0x5d93('0x30')],_0x129add[_0x5d93('0x34')]);_0x20c69d[_0x5d93('0x35')]=_[_0x5d93('0x33')](_0x129add[_0x5d93('0x30')],qs['fields'](_0x10d70b['query'][_0x5d93('0x36')]));_0x20c69d[_0x5d93('0x35')]=_0x20c69d[_0x5d93('0x35')][_0x5d93('0x37')]?_0x20c69d[_0x5d93('0x35')]:_0x129add[_0x5d93('0x30')];if(_0x10d70b['query'][_0x5d93('0x47')]){_0x20c69d[_0x5d93('0x41')]=[{'all':!![]}];}_0x20c69d=_['merge']({},_0x20c69d,_0x10d70b[_0x5d93('0x48')]);return db[_0x5d93('0x40')]['find'](_0x20c69d)[_0x5d93('0x23')](handleEntityNotFound(_0xd8447e,null))[_0x5d93('0x23')](respondWithResult(_0xd8447e,null))[_0x5d93('0x44')](handleError(_0xd8447e,null));};exports['create']=function(_0x383673,_0x5eb507){return db[_0x5d93('0x40')]['create'](_0x383673['body'],{})[_0x5d93('0x23')](function(_0x52ac19){var _0x5d6174=_0x383673['user'][_0x5d93('0x25')]({'plain':!![]});if(!_0x5d6174)throw new Error(_0x5d93('0x49'));if(_0x5d6174[_0x5d93('0x4a')]===_0x5d93('0x4b')){var _0x4e851d=_0x52ac19[_0x5d93('0x25')]({'plain':!![]});var _0x21150d=_0x5d93('0x26');return db[_0x5d93('0x4c')]['find']({'where':{'name':_0x21150d,'userProfileId':_0x5d6174[_0x5d93('0x4d')]},'raw':!![]})[_0x5d93('0x23')](function(_0x4db883){if(_0x4db883&&_0x4db883[_0x5d93('0x4e')]===0x0){return db[_0x5d93('0x27')][_0x5d93('0x4f')]({'name':_0x4e851d[_0x5d93('0x2a')],'resourceId':_0x4e851d['id'],'type':_0x4db883['name'],'sectionId':_0x4db883['id']},{})[_0x5d93('0x23')](function(){return _0x52ac19;});}else{return _0x52ac19;}})['catch'](function(_0x4e7618){logger[_0x5d93('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e7618);throw _0x4e7618;});}return _0x52ac19;})['then'](respondWithResult(_0x5eb507,0xc9))[_0x5d93('0x44')](handleError(_0x5eb507,null));};exports[_0x5d93('0x50')]=function(_0xedaff,_0x40a6bb){if(_0xedaff[_0x5d93('0x51')]['id']){delete _0xedaff[_0x5d93('0x51')]['id'];}return db[_0x5d93('0x40')]['find']({'where':{'id':_0xedaff[_0x5d93('0x46')]['id']}})[_0x5d93('0x23')](handleEntityNotFound(_0x40a6bb,null))['then'](saveUpdates(_0xedaff['body'],null))[_0x5d93('0x23')](respondWithResult(_0x40a6bb,null))[_0x5d93('0x44')](handleError(_0x40a6bb,null));};exports[_0x5d93('0x24')]=function(_0x5f283d,_0x5ba8e8){return db['Interval'][_0x5d93('0x52')]({'where':{'id':_0x5f283d[_0x5d93('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ba8e8,null))[_0x5d93('0x23')](removeEntity(_0x5ba8e8,null))[_0x5d93('0x44')](handleError(_0x5ba8e8,null));};exports[_0x5d93('0x53')]=function(_0x2d90cf,_0x354ccc,_0x3786cf){if(_0x2d90cf['body']['id']){delete _0x2d90cf[_0x5d93('0x51')]['id'];}return db['Interval'][_0x5d93('0x52')]({'where':{'id':_0x2d90cf['params']['id']}})['then'](handleEntityNotFound(_0x354ccc,null))[_0x5d93('0x23')](function(_0x41f9ce){if(_0x41f9ce){_0x2d90cf[_0x5d93('0x51')]['IntervalId']=_0x41f9ce['id'];return db[_0x5d93('0x40')][_0x5d93('0x4f')](_0x2d90cf[_0x5d93('0x51')]);}})[_0x5d93('0x23')](respondWithResult(_0x354ccc,null))[_0x5d93('0x44')](handleError(_0x354ccc,null));};exports['getIntervals']=function(_0x1c97b8,_0x9a82d4,_0x3825cf){var _0x230d0f={};var _0xf06578={};var _0x1cf118;var _0xc431b2;return db['Interval'][_0x5d93('0x54')]({'where':{'id':_0x1c97b8[_0x5d93('0x46')]['id']}})[_0x5d93('0x23')](handleEntityNotFound(_0x9a82d4,null))[_0x5d93('0x23')](function(_0x310cde){if(_0x310cde){_0x1cf118=_0x310cde;_0xf06578[_0x5d93('0x30')]=_[_0x5d93('0x31')](db[_0x5d93('0x40')][_0x5d93('0x2d')]);_0xf06578['query']=_[_0x5d93('0x31')](_0x1c97b8[_0x5d93('0x34')]);_0xf06578[_0x5d93('0x32')]=_[_0x5d93('0x33')](_0xf06578[_0x5d93('0x30')],_0xf06578['query']);_0x230d0f['attributes']=_['intersection'](_0xf06578[_0x5d93('0x30')],qs[_0x5d93('0x36')](_0x1c97b8[_0x5d93('0x34')][_0x5d93('0x36')]));_0x230d0f[_0x5d93('0x35')]=_0x230d0f[_0x5d93('0x35')][_0x5d93('0x37')]?_0x230d0f['attributes']:_0xf06578[_0x5d93('0x30')];_0x230d0f[_0x5d93('0x39')]=qs[_0x5d93('0x3a')](_0x1c97b8['query'][_0x5d93('0x3a')]);_0x230d0f['where']=qs['filters'](_['pick'](_0x1c97b8[_0x5d93('0x34')],_0xf06578[_0x5d93('0x32')]));if(_0x1c97b8[_0x5d93('0x34')][_0x5d93('0x3c')]){_0x230d0f[_0x5d93('0x3d')]=_[_0x5d93('0x3e')](_0x230d0f[_0x5d93('0x3d')],{'$or':_[_0x5d93('0x2c')](_0x230d0f[_0x5d93('0x35')],function(_0x2e2dfd){var _0x46d49f={};_0x46d49f[_0x2e2dfd]={'$like':'%'+_0x1c97b8['query']['filter']+'%'};return _0x46d49f;})});}_0x230d0f=_[_0x5d93('0x3e')]({},_0x230d0f,_0x1c97b8[_0x5d93('0x48')]);return _0x1cf118[_0x5d93('0x55')](_0x230d0f);}})[_0x5d93('0x23')](function(_0x13b952){if(_0x13b952){_0xc431b2=_0x13b952[_0x5d93('0x37')];if(!_0x1c97b8[_0x5d93('0x34')][_0x5d93('0x38')](_0x5d93('0x56'))){_0x230d0f[_0x5d93('0x1e')]=qs[_0x5d93('0x1e')](_0x1c97b8[_0x5d93('0x34')]['limit']);_0x230d0f['offset']=qs[_0x5d93('0x1c')](_0x1c97b8[_0x5d93('0x34')]['offset']);}return _0x1cf118[_0x5d93('0x55')](_0x230d0f);}})['then'](function(_0x76d181){if(_0x76d181){return _0x76d181?{'count':_0xc431b2,'rows':_0x76d181}:null;}})[_0x5d93('0x23')](respondWithResult(_0x9a82d4,null))[_0x5d93('0x44')](handleError(_0x9a82d4,null));};exports['addIntervals']=function(_0x3de22d,_0x5aa9af,_0xfe8de7){return db[_0x5d93('0x40')][_0x5d93('0x54')]({'where':{'id':_0x3de22d[_0x5d93('0x46')]['id']}})[_0x5d93('0x23')](handleEntityNotFound(_0x5aa9af,null))[_0x5d93('0x23')](function(_0x687c3b){if(_0x687c3b){return db[_0x5d93('0x57')][_0x5d93('0x58')](function(_0x363066){return db['Interval'][_0x5d93('0x24')]({'where':{'IntervalId':_0x3de22d[_0x5d93('0x46')]['id']},'transaction':_0x363066})[_0x5d93('0x23')](function(_0xb43042){var _0x959440=_[_0x5d93('0x2c')](_0x3de22d[_0x5d93('0x51')],function(_0x5e1d9b){delete _0x5e1d9b['id'];_0x5e1d9b[_0x5d93('0x59')]=_0x3de22d[_0x5d93('0x46')]['id'];return _0x5e1d9b;});return db[_0x5d93('0x40')][_0x5d93('0x5a')](_0x959440,{'transaction':_0x363066});});})[_0x5d93('0x23')](function(){return db[_0x5d93('0x40')][_0x5d93('0x42')]({'where':{'IntervalId':_0x3de22d['params']['id']}});});}})['then'](respondWithResult(_0x5aa9af,null))[_0x5d93('0x44')](handleError(_0x5aa9af,null));}; \ No newline at end of file +var _0x1efb=['includeAll','include','findAll','rows','catch','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','findOne','order','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','get','Intervals','end','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','Interval'];(function(_0x3b6fc8,_0x48eb3a){var _0x29e4be=function(_0x4254bc){while(--_0x4254bc){_0x3b6fc8['push'](_0x3b6fc8['shift']());}};_0x29e4be(++_0x48eb3a);}(_0x1efb,0x13a));var _0xb1ef=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1efb[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0xb1ef('0x0'));var rimraf=require(_0xb1ef('0x1'));var zipdir=require(_0xb1ef('0x2'));var jsonpatch=require(_0xb1ef('0x3'));var rp=require(_0xb1ef('0x4'));var moment=require(_0xb1ef('0x5'));var BPromise=require(_0xb1ef('0x6'));var Mustache=require(_0xb1ef('0x7'));var util=require('util');var path=require(_0xb1ef('0x8'));var sox=require(_0xb1ef('0x9'));var csv=require(_0xb1ef('0xa'));var ejs=require(_0xb1ef('0xb'));var fs=require('fs');var fs_extra=require(_0xb1ef('0xc'));var _=require(_0xb1ef('0xd'));var squel=require(_0xb1ef('0xe'));var crypto=require('crypto');var jsforce=require(_0xb1ef('0xf'));var deskjs=require(_0xb1ef('0x10'));var toCsv=require(_0xb1ef('0xa'));var querystring=require(_0xb1ef('0x11'));var Papa=require(_0xb1ef('0x12'));var Redis=require(_0xb1ef('0x13'));var authService=require(_0xb1ef('0x14'));var qs=require(_0xb1ef('0x15'));var as=require(_0xb1ef('0x16'));var hardwareService=require(_0xb1ef('0x17'));var logger=require('../../config/logger')(_0xb1ef('0x18'));var utils=require(_0xb1ef('0x19'));var config=require(_0xb1ef('0x1a'));var licenseUtil=require(_0xb1ef('0x1b'));var db=require(_0xb1ef('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x33814c,_0x48805e){_0x48805e=_0x48805e||0xcc;return function(_0x5135a3){if(_0x5135a3){return _0x33814c[_0xb1ef('0x1d')](_0x48805e);}return _0x33814c['status'](_0x48805e)['end']();};}function respondWithResult(_0x5e8ee5,_0x1dc9fd){_0x1dc9fd=_0x1dc9fd||0xc8;return function(_0x1a1aae){if(_0x1a1aae){return _0x5e8ee5[_0xb1ef('0x1e')](_0x1dc9fd)[_0xb1ef('0x1f')](_0x1a1aae);}};}function respondWithFilteredResult(_0x7274ac,_0x45de4a){return function(_0x57df79){if(_0x57df79){var _0xe7e60=typeof _0x45de4a['offset']===_0xb1ef('0x20')&&typeof _0x45de4a[_0xb1ef('0x21')]===_0xb1ef('0x20');var _0x434e70=_0x57df79[_0xb1ef('0x22')];var _0x1ee4e1=_0xe7e60?0x0:_0x45de4a['offset'];var _0x5cb615=_0xe7e60?_0x57df79[_0xb1ef('0x22')]:_0x45de4a[_0xb1ef('0x23')]+_0x45de4a['limit'];var _0x2721b8;if(_0x5cb615>=_0x434e70){_0x5cb615=_0x434e70;_0x2721b8=0xc8;}else{_0x2721b8=0xce;}_0x7274ac['status'](_0x2721b8);return _0x7274ac[_0xb1ef('0x24')](_0xb1ef('0x25'),_0x1ee4e1+'-'+_0x5cb615+'/'+_0x434e70)[_0xb1ef('0x1f')](_0x57df79);}return null;};}function patchUpdates(_0x367741){return function(_0x5bf602){try{jsonpatch['apply'](_0x5bf602,_0x367741,!![]);}catch(_0x3cf8de){return BPromise[_0xb1ef('0x26')](_0x3cf8de);}return _0x5bf602['save']();};}function saveUpdates(_0x33c5a7,_0x3319c3){return function(_0x4c35bb){if(_0x4c35bb){return _0x4c35bb['update'](_0x33c5a7)[_0xb1ef('0x27')](function(_0xb17697){return _0xb17697;});}return null;};}function removeEntity(_0x343a3d,_0x5d2133){return function(_0xfe7da7){if(_0xfe7da7){return _0xfe7da7[_0xb1ef('0x28')]()['then'](function(){var _0x195238=_0xfe7da7[_0xb1ef('0x29')]({'plain':!![]});var _0x11d1be=_0xb1ef('0x2a');return db['UserProfileResource'][_0xb1ef('0x28')]({'where':{'type':_0x11d1be,'resourceId':_0x195238['id']}})[_0xb1ef('0x27')](function(){return _0xfe7da7;});})[_0xb1ef('0x27')](function(){_0x343a3d[_0xb1ef('0x1e')](0xcc)[_0xb1ef('0x2b')]();});}};}function handleEntityNotFound(_0x25cc60,_0x123195){return function(_0x48fc19){if(!_0x48fc19){_0x25cc60[_0xb1ef('0x1d')](0x194);}return _0x48fc19;};}function handleError(_0x4a858b,_0x47149c){_0x47149c=_0x47149c||0x1f4;return function(_0x5d9ce9){logger['error'](_0x5d9ce9[_0xb1ef('0x2c')]);if(_0x5d9ce9[_0xb1ef('0x2d')]){delete _0x5d9ce9['name'];}_0x4a858b['status'](_0x47149c)[_0xb1ef('0x2e')](_0x5d9ce9);};}exports[_0xb1ef('0x2f')]=function(_0x40ad59,_0x89cdca){var _0x296f18={},_0x173981={},_0x28635a={'count':0x0,'rows':[]};var _0x21af26=_['map'](db['Interval'][_0xb1ef('0x30')],function(_0x331613){return{'name':_0x331613[_0xb1ef('0x31')],'type':_0x331613[_0xb1ef('0x32')][_0xb1ef('0x33')]};});_0x173981['model']=_[_0xb1ef('0x34')](_0x21af26,'name');_0x173981[_0xb1ef('0x35')]=_[_0xb1ef('0x36')](_0x40ad59[_0xb1ef('0x35')]);_0x173981[_0xb1ef('0x37')]=_[_0xb1ef('0x38')](_0x173981[_0xb1ef('0x39')],_0x173981['query']);_0x296f18[_0xb1ef('0x3a')]=_['intersection'](_0x173981[_0xb1ef('0x39')],qs['fields'](_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x3b')]));_0x296f18['attributes']=_0x296f18[_0xb1ef('0x3a')][_0xb1ef('0x3c')]?_0x296f18[_0xb1ef('0x3a')]:_0x173981[_0xb1ef('0x39')];if(!_0x40ad59['query'][_0xb1ef('0x3d')](_0xb1ef('0x3e'))){_0x296f18['limit']=qs[_0xb1ef('0x21')](_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x21')]);_0x296f18[_0xb1ef('0x23')]=qs[_0xb1ef('0x23')](_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x23')]);}_0x296f18['order']=qs[_0xb1ef('0x3f')](_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x3f')]);_0x296f18[_0xb1ef('0x40')]=qs[_0xb1ef('0x37')](_[_0xb1ef('0x41')](_0x40ad59['query'],_0x173981['filters']),_0x21af26);if(_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x42')]){_0x296f18[_0xb1ef('0x40')]=_[_0xb1ef('0x43')](_0x296f18['where'],{'$or':_[_0xb1ef('0x34')](_0x21af26,function(_0x48d462){if(_0x48d462[_0xb1ef('0x32')]!==_0xb1ef('0x44')){var _0x145933={};_0x145933[_0x48d462[_0xb1ef('0x2d')]]={'$like':'%'+_0x40ad59[_0xb1ef('0x35')][_0xb1ef('0x42')]+'%'};return _0x145933;}})});}_0x296f18=_[_0xb1ef('0x43')]({},_0x296f18,_0x40ad59['options']);var _0x15baec={'where':_0x296f18[_0xb1ef('0x40')]};return db[_0xb1ef('0x45')][_0xb1ef('0x22')](_0x15baec)[_0xb1ef('0x27')](function(_0x5bbf81){_0x28635a['count']=_0x5bbf81;if(_0x40ad59['query'][_0xb1ef('0x46')]){_0x296f18[_0xb1ef('0x47')]=[{'all':!![]}];}return db[_0xb1ef('0x45')][_0xb1ef('0x48')](_0x296f18);})[_0xb1ef('0x27')](function(_0x180111){_0x28635a[_0xb1ef('0x49')]=_0x180111;return _0x28635a;})[_0xb1ef('0x27')](respondWithFilteredResult(_0x89cdca,_0x296f18))[_0xb1ef('0x4a')](handleError(_0x89cdca,null));};exports['show']=function(_0x1ec215,_0x42de66){var _0x304feb={'raw':!![],'where':{'id':_0x1ec215[_0xb1ef('0x4b')]['id']}},_0x36575d={};_0x36575d['model']=_['keys'](db[_0xb1ef('0x45')]['rawAttributes']);_0x36575d[_0xb1ef('0x35')]=_['keys'](_0x1ec215[_0xb1ef('0x35')]);_0x36575d[_0xb1ef('0x37')]=_['intersection'](_0x36575d[_0xb1ef('0x39')],_0x36575d['query']);_0x304feb['attributes']=_[_0xb1ef('0x38')](_0x36575d[_0xb1ef('0x39')],qs[_0xb1ef('0x3b')](_0x1ec215[_0xb1ef('0x35')][_0xb1ef('0x3b')]));_0x304feb[_0xb1ef('0x3a')]=_0x304feb[_0xb1ef('0x3a')][_0xb1ef('0x3c')]?_0x304feb[_0xb1ef('0x3a')]:_0x36575d[_0xb1ef('0x39')];if(_0x1ec215['query']['includeAll']){_0x304feb[_0xb1ef('0x47')]=[{'all':!![]}];}_0x304feb=_[_0xb1ef('0x43')]({},_0x304feb,_0x1ec215[_0xb1ef('0x4c')]);return db[_0xb1ef('0x45')][_0xb1ef('0x4d')](_0x304feb)['then'](handleEntityNotFound(_0x42de66,null))['then'](respondWithResult(_0x42de66,null))['catch'](handleError(_0x42de66,null));};exports['create']=function(_0x33027d,_0x5c1c9e){return db[_0xb1ef('0x45')][_0xb1ef('0x4e')](_0x33027d[_0xb1ef('0x4f')],{})['then'](function(_0x308046){var _0x12fc65=_0x33027d['user'][_0xb1ef('0x29')]({'plain':!![]});if(!_0x12fc65)throw new Error(_0xb1ef('0x50'));if(_0x12fc65[_0xb1ef('0x51')]==='user'){var _0x16aa73=_0x308046[_0xb1ef('0x29')]({'plain':!![]});var _0x9f2fb9=_0xb1ef('0x2a');return db[_0xb1ef('0x52')][_0xb1ef('0x4d')]({'where':{'name':_0x9f2fb9,'userProfileId':_0x12fc65['userProfileId']},'raw':!![]})[_0xb1ef('0x27')](function(_0x2f2b9e){if(_0x2f2b9e&&_0x2f2b9e[_0xb1ef('0x53')]===0x0){return db['UserProfileResource'][_0xb1ef('0x4e')]({'name':_0x16aa73[_0xb1ef('0x2d')],'resourceId':_0x16aa73['id'],'type':_0x2f2b9e[_0xb1ef('0x2d')],'sectionId':_0x2f2b9e['id']},{})['then'](function(){return _0x308046;});}else{return _0x308046;}})[_0xb1ef('0x4a')](function(_0x2a67c2){logger[_0xb1ef('0x54')](_0xb1ef('0x55'),_0x2a67c2);throw _0x2a67c2;});}return _0x308046;})[_0xb1ef('0x27')](respondWithResult(_0x5c1c9e,0xc9))[_0xb1ef('0x4a')](handleError(_0x5c1c9e,null));};exports[_0xb1ef('0x56')]=function(_0x3376fc,_0x5169e8){if(_0x3376fc[_0xb1ef('0x4f')]['id']){delete _0x3376fc['body']['id'];}return db['Interval']['find']({'where':{'id':_0x3376fc[_0xb1ef('0x4b')]['id']}})[_0xb1ef('0x27')](handleEntityNotFound(_0x5169e8,null))[_0xb1ef('0x27')](saveUpdates(_0x3376fc[_0xb1ef('0x4f')],null))[_0xb1ef('0x27')](respondWithResult(_0x5169e8,null))['catch'](handleError(_0x5169e8,null));};exports[_0xb1ef('0x28')]=function(_0x562a19,_0x1c3fab){return db[_0xb1ef('0x45')]['find']({'where':{'id':_0x562a19[_0xb1ef('0x4b')]['id']}})[_0xb1ef('0x27')](handleEntityNotFound(_0x1c3fab,null))[_0xb1ef('0x27')](removeEntity(_0x1c3fab,null))[_0xb1ef('0x4a')](handleError(_0x1c3fab,null));};exports[_0xb1ef('0x57')]=function(_0x3eae2e,_0x5d443e,_0x4cfaff){if(_0x3eae2e['body']['id']){delete _0x3eae2e[_0xb1ef('0x4f')]['id'];}return db[_0xb1ef('0x45')]['find']({'where':{'id':_0x3eae2e[_0xb1ef('0x4b')]['id']}})[_0xb1ef('0x27')](handleEntityNotFound(_0x5d443e,null))[_0xb1ef('0x27')](function(_0x35a952){if(_0x35a952){_0x3eae2e[_0xb1ef('0x4f')][_0xb1ef('0x58')]=_0x35a952['id'];return db[_0xb1ef('0x45')]['create'](_0x3eae2e[_0xb1ef('0x4f')]);}})[_0xb1ef('0x27')](respondWithResult(_0x5d443e,null))[_0xb1ef('0x4a')](handleError(_0x5d443e,null));};exports['getIntervals']=function(_0x1aa505,_0x535653,_0x43d4c2){var _0x3d0384={};var _0x8a62a0={};var _0x5b502c;var _0x4f123c;return db[_0xb1ef('0x45')][_0xb1ef('0x59')]({'where':{'id':_0x1aa505[_0xb1ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x535653,null))[_0xb1ef('0x27')](function(_0x4bb009){if(_0x4bb009){_0x5b502c=_0x4bb009;_0x8a62a0[_0xb1ef('0x39')]=_['keys'](db[_0xb1ef('0x45')][_0xb1ef('0x30')]);_0x8a62a0[_0xb1ef('0x35')]=_[_0xb1ef('0x36')](_0x1aa505[_0xb1ef('0x35')]);_0x8a62a0[_0xb1ef('0x37')]=_[_0xb1ef('0x38')](_0x8a62a0[_0xb1ef('0x39')],_0x8a62a0['query']);_0x3d0384[_0xb1ef('0x3a')]=_['intersection'](_0x8a62a0[_0xb1ef('0x39')],qs['fields'](_0x1aa505['query'][_0xb1ef('0x3b')]));_0x3d0384[_0xb1ef('0x3a')]=_0x3d0384[_0xb1ef('0x3a')][_0xb1ef('0x3c')]?_0x3d0384[_0xb1ef('0x3a')]:_0x8a62a0['model'];_0x3d0384[_0xb1ef('0x5a')]=qs['sort'](_0x1aa505[_0xb1ef('0x35')]['sort']);_0x3d0384[_0xb1ef('0x40')]=qs[_0xb1ef('0x37')](_[_0xb1ef('0x41')](_0x1aa505[_0xb1ef('0x35')],_0x8a62a0['filters']));if(_0x1aa505['query']['filter']){_0x3d0384[_0xb1ef('0x40')]=_[_0xb1ef('0x43')](_0x3d0384[_0xb1ef('0x40')],{'$or':_[_0xb1ef('0x34')](_0x3d0384[_0xb1ef('0x3a')],function(_0x47e0de){var _0x2bf7de={};_0x2bf7de[_0x47e0de]={'$like':'%'+_0x1aa505[_0xb1ef('0x35')]['filter']+'%'};return _0x2bf7de;})});}_0x3d0384=_[_0xb1ef('0x43')]({},_0x3d0384,_0x1aa505['options']);return _0x5b502c[_0xb1ef('0x5b')](_0x3d0384);}})[_0xb1ef('0x27')](function(_0x432f75){if(_0x432f75){_0x4f123c=_0x432f75[_0xb1ef('0x3c')];if(!_0x1aa505[_0xb1ef('0x35')][_0xb1ef('0x3d')](_0xb1ef('0x3e'))){_0x3d0384[_0xb1ef('0x21')]=qs[_0xb1ef('0x21')](_0x1aa505[_0xb1ef('0x35')][_0xb1ef('0x21')]);_0x3d0384[_0xb1ef('0x23')]=qs['offset'](_0x1aa505['query'][_0xb1ef('0x23')]);}return _0x5b502c[_0xb1ef('0x5b')](_0x3d0384);}})[_0xb1ef('0x27')](function(_0xb6bb68){if(_0xb6bb68){return _0xb6bb68?{'count':_0x4f123c,'rows':_0xb6bb68}:null;}})['then'](respondWithResult(_0x535653,null))['catch'](handleError(_0x535653,null));};exports[_0xb1ef('0x5c')]=function(_0x21b863,_0x3681e2,_0x522623){return db[_0xb1ef('0x45')]['findOne']({'where':{'id':_0x21b863[_0xb1ef('0x4b')]['id']}})[_0xb1ef('0x27')](handleEntityNotFound(_0x3681e2,null))[_0xb1ef('0x27')](function(_0xcee6f8){if(_0xcee6f8){return db[_0xb1ef('0x5d')][_0xb1ef('0x5e')](function(_0x162672){return db[_0xb1ef('0x45')]['destroy']({'where':{'IntervalId':_0x21b863[_0xb1ef('0x4b')]['id']},'transaction':_0x162672})[_0xb1ef('0x27')](function(_0xed7c51){var _0x832166=_[_0xb1ef('0x34')](_0x21b863['body'],function(_0x2163f1){delete _0x2163f1['id'];_0x2163f1['IntervalId']=_0x21b863[_0xb1ef('0x4b')]['id'];return _0x2163f1;});return db['Interval'][_0xb1ef('0x5f')](_0x832166,{'transaction':_0x162672});});})['then'](function(){return db[_0xb1ef('0x45')][_0xb1ef('0x48')]({'where':{'IntervalId':_0x21b863[_0xb1ef('0x4b')]['id']}});});}})['then'](respondWithResult(_0x3681e2,null))[_0xb1ef('0x4a')](handleError(_0x3681e2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 34e86af..fc88421 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 _0x4d36=['path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x4d36,0x159));var _0x64d3=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x4d36[_0x3b3a82];return _0x267063;};'use strict';var _=require(_0x64d3('0x0'));var util=require(_0x64d3('0x1'));var logger=require(_0x64d3('0x2'))('api');var moment=require(_0x64d3('0x3'));var BPromise=require(_0x64d3('0x4'));var rp=require(_0x64d3('0x5'));var fs=require('fs');var path=require(_0x64d3('0x6'));var rimraf=require('rimraf');var config=require(_0x64d3('0x7'));var attributes=require(_0x64d3('0x8'));var extensions=require(_0x64d3('0x9'));module[_0x64d3('0xa')]=function(_0xef478,_0x4e174e){return _0xef478[_0x64d3('0xb')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29e80a,_0x506c08){extensions[_0x64d3('0xc')](_0xef478,_0x29e80a);},'afterBulkCreate':function(_0x159b89,_0x9f24fb,_0x50bf70){_0x50bf70();extensions['rewrite'](_0xef478,_0x159b89[0x0]);},'afterUpdate':function(_0x3bec2e,_0x36f8f7){extensions[_0x64d3('0xc')](_0xef478,_0x3bec2e);},'afterDestroy':function(_0x57be15,_0x3a40d7){extensions[_0x64d3('0xc')](_0xef478,_0x57be15);}}});}; \ No newline at end of file +var _0x47bf=['path','../../config/environment','./interval.attributes','define','rewrite','util','../../config/logger','api','moment','bluebird'];(function(_0x172e65,_0x13bf4d){var _0x389eee=function(_0xbf8c89){while(--_0xbf8c89){_0x172e65['push'](_0x172e65['shift']());}};_0x389eee(++_0x13bf4d);}(_0x47bf,0x1bd));var _0xf47b=function(_0x4eebf4,_0x2c94a9){_0x4eebf4=_0x4eebf4-0x0;var _0x19b7ec=_0x47bf[_0x4eebf4];return _0x19b7ec;};'use strict';var _=require('lodash');var util=require(_0xf47b('0x0'));var logger=require(_0xf47b('0x1'))(_0xf47b('0x2'));var moment=require(_0xf47b('0x3'));var BPromise=require(_0xf47b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf47b('0x5'));var rimraf=require('rimraf');var config=require(_0xf47b('0x6'));var attributes=require(_0xf47b('0x7'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x263dff,_0x5b6e98){return _0x263dff[_0xf47b('0x8')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x575ad2,_0x1bc567){extensions['rewrite'](_0x263dff,_0x575ad2);},'afterBulkCreate':function(_0x56fad1,_0x5dddd9,_0x5078ea){_0x5078ea();extensions[_0xf47b('0x9')](_0x263dff,_0x56fad1[0x0]);},'afterUpdate':function(_0x4d5f67,_0x4898f0){extensions['rewrite'](_0x263dff,_0x4d5f67);},'afterDestroy':function(_0x50b85b,_0x127ebb){extensions[_0xf47b('0x9')](_0x263dff,_0x50b85b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c178b36..342e5f1 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 4cf3e99..8c75aa0 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4517b9,_0x504326){var _0x158fc4=function(_0x18a235){while(--_0x18a235){_0x4517b9['push'](_0x4517b9['shift']());}};_0x158fc4(++_0x504326);}(_0xadb5,0xad));var _0x5adb=function(_0x2c94d4,_0x22fd9b){_0x2c94d4=_0x2c94d4-0x0;var _0x487283=_0xadb5[_0x2c94d4];return _0x487283;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x4470eb,_0x75c591){var _0x1fbbe0=function(_0x5f4a36){while(--_0x5f4a36){_0x4470eb['push'](_0x4470eb['shift']());}};_0x1fbbe0(++_0x75c591);}(_0x2032,0xd9));var _0x2203=function(_0x55c9fd,_0x5249a7){_0x55c9fd=_0x55c9fd-0x0;var _0x57f9bd=_0x2032[_0x55c9fd];return _0x57f9bd;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1d5b1be..7656846 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 _0x37be=['send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','data','end','statusCode','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x3ef5bb,_0x27e3ac){var _0x59d620=function(_0x46cd45){while(--_0x46cd45){_0x3ef5bb['push'](_0x3ef5bb['shift']());}};_0x59d620(++_0x27e3ac);}(_0x37be,0x1e0));var _0xe37b=function(_0x33b33b,_0x152c65){_0x33b33b=_0x33b33b-0x0;var _0x34a824=_0x37be[_0x33b33b];return _0x34a824;};'use strict';var BPromise=require('bluebird');var https=require(_0xe37b('0x0'));var logger=require(_0xe37b('0x1'))('api');var USERNAME=_0xe37b('0x2');var PASSWORD=_0xe37b('0x3');function openIssue(_0x130b69,_0xb52d86){var _0x2dbae8={'fields':{'project':{'key':_0x130b69[_0xe37b('0x4')]||_0xe37b('0x5')},'summary':(_0x130b69[_0xe37b('0x6')]||_0xe37b('0x7'))+_0xe37b('0x8')+_0x130b69['ip'],'description':_0x130b69[_0xe37b('0x9')]||JSON[_0xe37b('0xa')](_0x130b69),'issuetype':{'name':_0x130b69[_0xe37b('0xb')]||_0xe37b('0xc')}}};_0x2dbae8[_0xe37b('0xd')]['customfield_11500']=_0x130b69['email'];_0x2dbae8['fields'][_0xe37b('0xe')]=_0x130b69[_0xe37b('0xf')];_0x2dbae8['fields'][_0xe37b('0x10')]=_0x130b69[_0xe37b('0x11')];_0x2dbae8[_0xe37b('0xd')][_0xe37b('0x12')]=_0x130b69[_0xe37b('0x13')];_0x2dbae8[_0xe37b('0xd')]['customfield_11504']=_0x130b69[_0xe37b('0x14')];_0x2dbae8[_0xe37b('0xd')][_0xe37b('0x15')]=_0x130b69['ip'];var _0x3396e9={'host':_0xe37b('0x16'),'port':0x1bb,'path':_0xe37b('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xe37b('0x18'),'Authorization':_0xe37b('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xe37b('0x1a')]('base64')}};var _0x28dd78=JSON[_0xe37b('0xa')](_0x2dbae8);var _0x313906=https['request'](_0x3396e9,function(_0x55e41c){_0x55e41c['setEncoding']('utf8');var _0x31aa89='';_0x55e41c['on'](_0xe37b('0x1b'),function(_0x538e28){_0x31aa89+=_0x538e28;});_0x55e41c['on'](_0xe37b('0x1c'),function(){if(_0xb52d86){return _0xb52d86['status'](_0x55e41c[_0xe37b('0x1d')])['json'](JSON['parse'](_0x31aa89));}});});_0x313906['on']('error',function(_0x5535fa){if(_0xb52d86){return _0xb52d86[_0xe37b('0x1e')](0x1f4)[_0xe37b('0x1f')]({'errors':[{'message':_0xe37b('0x20'),'type':_0xe37b('0x21')}]});}});_0x313906[_0xe37b('0x22')](_0x28dd78);_0x313906[_0xe37b('0x1c')]();}exports[_0xe37b('0x23')]=openIssue;exports[_0xe37b('0x24')]=function(_0x6b2c2c,_0xa4bb2f){_0x6b2c2c[_0xe37b('0x25')]['ip']=_0x6b2c2c[_0xe37b('0x26')][_0xe37b('0x27')]||_0x6b2c2c[_0xe37b('0x28')][_0xe37b('0x29')]||_0x6b2c2c[_0xe37b('0x2a')][_0xe37b('0x29')]||_0x6b2c2c['connection'][_0xe37b('0x2a')][_0xe37b('0x29')];return openIssue(_0x6b2c2c[_0xe37b('0x25')],_0xa4bb2f);}; \ No newline at end of file +var _0x7125=['stringify','request','utf8','status','statusCode','json','parse','error','api.jira','write','end','openIssue','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7125,0x1a7));var _0x5712=function(_0x46c58a,_0x227a2b){_0x46c58a=_0x46c58a-0x0;var _0x185916=_0x7125[_0x46c58a];return _0x185916;};'use strict';var BPromise=require(_0x5712('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x5712('0x1'));var USERNAME=_0x5712('0x2');var PASSWORD=_0x5712('0x3');function openIssue(_0x2da133,_0x43b0f2){var _0x2b84b4={'fields':{'project':{'key':_0x2da133[_0x5712('0x4')]||_0x5712('0x5')},'summary':(_0x2da133[_0x5712('0x6')]||_0x5712('0x7'))+_0x5712('0x8')+_0x2da133['ip'],'description':_0x2da133['description']||JSON['stringify'](_0x2da133),'issuetype':{'name':_0x2da133[_0x5712('0x9')]||_0x5712('0xa')}}};_0x2b84b4[_0x5712('0xb')][_0x5712('0xc')]=_0x2da133[_0x5712('0xd')];_0x2b84b4[_0x5712('0xb')][_0x5712('0xe')]=_0x2da133[_0x5712('0xf')];_0x2b84b4[_0x5712('0xb')][_0x5712('0x10')]=_0x2da133[_0x5712('0x11')];_0x2b84b4[_0x5712('0xb')][_0x5712('0x12')]=_0x2da133[_0x5712('0x13')];_0x2b84b4[_0x5712('0xb')][_0x5712('0x14')]=_0x2da133[_0x5712('0x15')];_0x2b84b4[_0x5712('0xb')][_0x5712('0x16')]=_0x2da133['ip'];var _0x420342={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x5712('0x17'),'method':_0x5712('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x5712('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x5712('0x1a')]('base64')}};var _0x4d1ab5=JSON[_0x5712('0x1b')](_0x2b84b4);var _0x153763=https[_0x5712('0x1c')](_0x420342,function(_0x5e87f1){_0x5e87f1['setEncoding'](_0x5712('0x1d'));var _0x2d4609='';_0x5e87f1['on']('data',function(_0x3dc98a){_0x2d4609+=_0x3dc98a;});_0x5e87f1['on']('end',function(){if(_0x43b0f2){return _0x43b0f2[_0x5712('0x1e')](_0x5e87f1[_0x5712('0x1f')])[_0x5712('0x20')](JSON[_0x5712('0x21')](_0x2d4609));}});});_0x153763['on'](_0x5712('0x22'),function(_0x198ab2){if(_0x43b0f2){return _0x43b0f2['status'](0x1f4)[_0x5712('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x5712('0x23')}]});}});_0x153763[_0x5712('0x24')](_0x4d1ab5);_0x153763[_0x5712('0x25')]();}exports[_0x5712('0x26')]=openIssue;exports['send']=function(_0xd15b40,_0x34fd74){_0xd15b40[_0x5712('0x27')]['ip']=_0xd15b40[_0x5712('0x28')][_0x5712('0x29')]||_0xd15b40['connection'][_0x5712('0x2a')]||_0xd15b40[_0x5712('0x2b')]['remoteAddress']||_0xd15b40[_0x5712('0x2c')][_0x5712('0x2b')][_0x5712('0x2a')];return openIssue(_0xd15b40[_0x5712('0x27')],_0x34fd74);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d97702a..53e7005 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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x5f490b,_0x1bbf15){var _0x4a7f1d=function(_0x23811f){while(--_0x23811f){_0x5f490b['push'](_0x5f490b['shift']());}};_0x4a7f1d(++_0x1bbf15);}(_0xe706,0xa3));var _0x6e70=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe706[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0x4483=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x4483,0x1a3));var _0x3448=function(_0x5527eb,_0x3524c9){_0x5527eb=_0x5527eb-0x0;var _0x522a76=_0x4483[_0x5527eb];return _0x522a76;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0xf')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')](_0x3448('0x12'),auth[_0x3448('0xa')](),controller[_0x3448('0x13')]);router[_0x3448('0x14')](_0x3448('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x3448('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 9950113..5fc56eb 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x286fb4,_0x2ac09f){_0x286fb4=_0x286fb4-0x0;var _0x45a724=_0x7a54[_0x286fb4];return _0x45a724;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x166d59,_0x36e436){_0x166d59=_0x166d59-0x0;var _0x2acef3=_0x7a54[_0x166d59];return _0x2acef3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 2c56034..18d7dc0 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 _0x5353=['update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','error','stack','name','send','index','map','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','JscriptyAnswerReport','findAll','rows','catch','show','params','include','create','body'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0x5353,0x12f));var _0x3535=function(_0x250062,_0x5e062b){_0x250062=_0x250062-0x0;var _0x5c2557=_0x5353[_0x250062];return _0x5c2557;};'use strict';var emlformat=require(_0x3535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3535('0x1'));var jsonpatch=require(_0x3535('0x2'));var rp=require(_0x3535('0x3'));var moment=require(_0x3535('0x4'));var BPromise=require(_0x3535('0x5'));var Mustache=require(_0x3535('0x6'));var util=require(_0x3535('0x7'));var path=require(_0x3535('0x8'));var sox=require(_0x3535('0x9'));var csv=require(_0x3535('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3535('0xb'));var _=require('lodash');var squel=require(_0x3535('0xc'));var crypto=require(_0x3535('0xd'));var jsforce=require(_0x3535('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3535('0xa'));var querystring=require(_0x3535('0xf'));var Papa=require(_0x3535('0x10'));var Redis=require(_0x3535('0x11'));var authService=require(_0x3535('0x12'));var qs=require(_0x3535('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3535('0x14'));var logger=require(_0x3535('0x15'))('api');var utils=require(_0x3535('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3535('0x17'))['db'];function respondWithStatusCode(_0xff9aa8,_0xe7c052){_0xe7c052=_0xe7c052||0xcc;return function(_0x46b5c1){if(_0x46b5c1){return _0xff9aa8[_0x3535('0x18')](_0xe7c052);}return _0xff9aa8[_0x3535('0x19')](_0xe7c052)[_0x3535('0x1a')]();};}function respondWithResult(_0x5115bd,_0x2f4e64){_0x2f4e64=_0x2f4e64||0xc8;return function(_0x501016){if(_0x501016){return _0x5115bd[_0x3535('0x19')](_0x2f4e64)[_0x3535('0x1b')](_0x501016);}};}function respondWithFilteredResult(_0xf87404,_0x4c704f){return function(_0x1f18da){if(_0x1f18da){var _0x4b7c81=typeof _0x4c704f[_0x3535('0x1c')]==='undefined'&&typeof _0x4c704f['limit']===_0x3535('0x1d');var _0x222937=_0x1f18da[_0x3535('0x1e')];var _0x298235=_0x4b7c81?0x0:_0x4c704f[_0x3535('0x1c')];var _0x2a1705=_0x4b7c81?_0x1f18da[_0x3535('0x1e')]:_0x4c704f[_0x3535('0x1c')]+_0x4c704f[_0x3535('0x1f')];var _0x1fca4f;if(_0x2a1705>=_0x222937){_0x2a1705=_0x222937;_0x1fca4f=0xc8;}else{_0x1fca4f=0xce;}_0xf87404[_0x3535('0x19')](_0x1fca4f);return _0xf87404[_0x3535('0x20')]('Content-Range',_0x298235+'-'+_0x2a1705+'/'+_0x222937)['json'](_0x1f18da);}return null;};}function patchUpdates(_0xfea414){return function(_0x4e76c5){try{jsonpatch['apply'](_0x4e76c5,_0xfea414,!![]);}catch(_0x23f5b6){return BPromise[_0x3535('0x21')](_0x23f5b6);}return _0x4e76c5[_0x3535('0x22')]();};}function saveUpdates(_0x56db66,_0x52f0e3){return function(_0x3d73d2){if(_0x3d73d2){return _0x3d73d2['update'](_0x56db66)[_0x3535('0x23')](function(_0x542372){return _0x542372;});}return null;};}function removeEntity(_0x44fc44,_0x4d372e){return function(_0x450250){if(_0x450250){return _0x450250['destroy']()['then'](function(){_0x44fc44[_0x3535('0x19')](0xcc)[_0x3535('0x1a')]();});}};}function handleEntityNotFound(_0x5a25d1,_0x14e803){return function(_0x213f35){if(!_0x213f35){_0x5a25d1[_0x3535('0x18')](0x194);}return _0x213f35;};}function handleError(_0xefa28c,_0x51ba08){_0x51ba08=_0x51ba08||0x1f4;return function(_0x2bbe00){logger[_0x3535('0x24')](_0x2bbe00[_0x3535('0x25')]);if(_0x2bbe00[_0x3535('0x26')]){delete _0x2bbe00[_0x3535('0x26')];}_0xefa28c[_0x3535('0x19')](_0x51ba08)[_0x3535('0x27')](_0x2bbe00);};}exports[_0x3535('0x28')]=function(_0x4c993a,_0x167e64){var _0x17e2a0={},_0x4cf180={},_0x2594d7={'count':0x0,'rows':[]};var _0x2a84e0=_[_0x3535('0x29')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x3e8a1e){return{'name':_0x3e8a1e[_0x3535('0x2a')],'type':_0x3e8a1e['type'][_0x3535('0x2b')]};});_0x4cf180[_0x3535('0x2c')]=_[_0x3535('0x29')](_0x2a84e0,_0x3535('0x26'));_0x4cf180['query']=_[_0x3535('0x2d')](_0x4c993a[_0x3535('0x2e')]);_0x4cf180['filters']=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],_0x4cf180[_0x3535('0x2e')]);_0x17e2a0[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x4cf180[_0x3535('0x2c')],qs[_0x3535('0x31')](_0x4c993a['query']['fields']));_0x17e2a0[_0x3535('0x30')]=_0x17e2a0[_0x3535('0x30')][_0x3535('0x32')]?_0x17e2a0[_0x3535('0x30')]:_0x4cf180[_0x3535('0x2c')];if(!_0x4c993a[_0x3535('0x2e')][_0x3535('0x33')](_0x3535('0x34'))){_0x17e2a0['limit']=qs[_0x3535('0x1f')](_0x4c993a[_0x3535('0x2e')][_0x3535('0x1f')]);_0x17e2a0[_0x3535('0x1c')]=qs[_0x3535('0x1c')](_0x4c993a[_0x3535('0x2e')]['offset']);}_0x17e2a0[_0x3535('0x35')]=qs['sort'](_0x4c993a[_0x3535('0x2e')][_0x3535('0x36')]);_0x17e2a0['where']=qs[_0x3535('0x37')](_[_0x3535('0x38')](_0x4c993a[_0x3535('0x2e')],_0x4cf180[_0x3535('0x37')]),_0x2a84e0);if(_0x4c993a['query']['filter']){_0x17e2a0[_0x3535('0x39')]=_[_0x3535('0x3a')](_0x17e2a0[_0x3535('0x39')],{'$or':_[_0x3535('0x29')](_0x2a84e0,function(_0x32d907){if(_0x32d907[_0x3535('0x3b')]!==_0x3535('0x3c')){var _0x396fd9={};_0x396fd9[_0x32d907[_0x3535('0x26')]]={'$like':'%'+_0x4c993a[_0x3535('0x2e')][_0x3535('0x3d')]+'%'};return _0x396fd9;}})});}_0x17e2a0=_[_0x3535('0x3a')]({},_0x17e2a0,_0x4c993a['options']);var _0x46aabb={'where':_0x17e2a0[_0x3535('0x39')]};return db['JscriptyAnswerReport'][_0x3535('0x1e')](_0x46aabb)[_0x3535('0x23')](function(_0x5c4c2f){_0x2594d7[_0x3535('0x1e')]=_0x5c4c2f;if(_0x4c993a[_0x3535('0x2e')][_0x3535('0x3e')]){_0x17e2a0['include']=[{'all':!![]}];}return db[_0x3535('0x3f')][_0x3535('0x40')](_0x17e2a0);})[_0x3535('0x23')](function(_0x5258cc){_0x2594d7[_0x3535('0x41')]=_0x5258cc;return _0x2594d7;})[_0x3535('0x23')](respondWithFilteredResult(_0x167e64,_0x17e2a0))[_0x3535('0x42')](handleError(_0x167e64,null));};exports[_0x3535('0x43')]=function(_0x6c896c,_0x139ed6){var _0x347777={'raw':!![],'where':{'id':_0x6c896c[_0x3535('0x44')]['id']}},_0x2d12cc={};_0x2d12cc[_0x3535('0x2c')]=_[_0x3535('0x2d')](db[_0x3535('0x3f')]['rawAttributes']);_0x2d12cc[_0x3535('0x2e')]=_['keys'](_0x6c896c[_0x3535('0x2e')]);_0x2d12cc['filters']=_[_0x3535('0x2f')](_0x2d12cc[_0x3535('0x2c')],_0x2d12cc[_0x3535('0x2e')]);_0x347777[_0x3535('0x30')]=_[_0x3535('0x2f')](_0x2d12cc['model'],qs[_0x3535('0x31')](_0x6c896c[_0x3535('0x2e')]['fields']));_0x347777[_0x3535('0x30')]=_0x347777[_0x3535('0x30')][_0x3535('0x32')]?_0x347777[_0x3535('0x30')]:_0x2d12cc[_0x3535('0x2c')];if(_0x6c896c[_0x3535('0x2e')]['includeAll']){_0x347777[_0x3535('0x45')]=[{'all':!![]}];}_0x347777=_[_0x3535('0x3a')]({},_0x347777,_0x6c896c['options']);return db[_0x3535('0x3f')]['find'](_0x347777)[_0x3535('0x23')](handleEntityNotFound(_0x139ed6,null))[_0x3535('0x23')](respondWithResult(_0x139ed6,null))[_0x3535('0x42')](handleError(_0x139ed6,null));};exports[_0x3535('0x46')]=function(_0x2d8769,_0x45eb1b){return db[_0x3535('0x3f')][_0x3535('0x46')](_0x2d8769[_0x3535('0x47')],{})[_0x3535('0x23')](respondWithResult(_0x45eb1b,0xc9))[_0x3535('0x42')](handleError(_0x45eb1b,null));};exports[_0x3535('0x48')]=function(_0x5c881d,_0x2bd81b){if(_0x5c881d[_0x3535('0x47')]['id']){delete _0x5c881d[_0x3535('0x47')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5c881d[_0x3535('0x44')]['id']}})[_0x3535('0x23')](handleEntityNotFound(_0x2bd81b,null))[_0x3535('0x23')](saveUpdates(_0x5c881d[_0x3535('0x47')],null))[_0x3535('0x23')](respondWithResult(_0x2bd81b,null))[_0x3535('0x42')](handleError(_0x2bd81b,null));};exports['destroy']=function(_0x1f17ed,_0x399f30){return db[_0x3535('0x3f')][_0x3535('0x49')]({'where':{'id':_0x1f17ed['params']['id']}})['then'](handleEntityNotFound(_0x399f30,null))['then'](removeEntity(_0x399f30,null))[_0x3535('0x42')](handleError(_0x399f30,null));};exports[_0x3535('0x4a')]=function(_0x10d4e6,_0x1c17f4){return db[_0x3535('0x3f')][_0x3535('0x4a')]()[_0x3535('0x23')](respondWithResult(_0x1c17f4,null))[_0x3535('0x42')](handleError(_0x1c17f4,null));}; \ No newline at end of file +var _0x6c32=['offset','limit','undefined','count','set','apply','update','then','destroy','error','send','index','map','fieldName','type','name','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x1a3feb,_0x26f810){var _0x4f6ce0=function(_0x3dc633){while(--_0x3dc633){_0x1a3feb['push'](_0x1a3feb['shift']());}};_0x4f6ce0(++_0x26f810);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26c3('0x2'));var moment=require('moment');var BPromise=require(_0x26c3('0x3'));var Mustache=require(_0x26c3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x26c3('0x5'));var csv=require(_0x26c3('0x6'));var ejs=require(_0x26c3('0x7'));var fs=require('fs');var fs_extra=require(_0x26c3('0x8'));var _=require(_0x26c3('0x9'));var squel=require(_0x26c3('0xa'));var crypto=require(_0x26c3('0xb'));var jsforce=require(_0x26c3('0xc'));var deskjs=require(_0x26c3('0xd'));var toCsv=require(_0x26c3('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x26c3('0xf'));var as=require(_0x26c3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26c3('0x11'))(_0x26c3('0x12'));var utils=require(_0x26c3('0x13'));var config=require(_0x26c3('0x14'));var licenseUtil=require(_0x26c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a6c2,_0x3be1d4){_0x3be1d4=_0x3be1d4||0xcc;return function(_0x3e00f4){if(_0x3e00f4){return _0x41a6c2[_0x26c3('0x16')](_0x3be1d4);}return _0x41a6c2[_0x26c3('0x17')](_0x3be1d4)[_0x26c3('0x18')]();};}function respondWithResult(_0x1a8ea5,_0x278214){_0x278214=_0x278214||0xc8;return function(_0x5443cd){if(_0x5443cd){return _0x1a8ea5['status'](_0x278214)[_0x26c3('0x19')](_0x5443cd);}};}function respondWithFilteredResult(_0xd612e7,_0xd2f9a7){return function(_0x2e8f6b){if(_0x2e8f6b){var _0xad4e1e=typeof _0xd2f9a7[_0x26c3('0x1a')]==='undefined'&&typeof _0xd2f9a7[_0x26c3('0x1b')]===_0x26c3('0x1c');var _0x4db301=_0x2e8f6b[_0x26c3('0x1d')];var _0x4de336=_0xad4e1e?0x0:_0xd2f9a7[_0x26c3('0x1a')];var _0x570b03=_0xad4e1e?_0x2e8f6b[_0x26c3('0x1d')]:_0xd2f9a7[_0x26c3('0x1a')]+_0xd2f9a7[_0x26c3('0x1b')];var _0x26ae49;if(_0x570b03>=_0x4db301){_0x570b03=_0x4db301;_0x26ae49=0xc8;}else{_0x26ae49=0xce;}_0xd612e7['status'](_0x26ae49);return _0xd612e7[_0x26c3('0x1e')]('Content-Range',_0x4de336+'-'+_0x570b03+'/'+_0x4db301)[_0x26c3('0x19')](_0x2e8f6b);}return null;};}function patchUpdates(_0x48ea4a){return function(_0x1c77e6){try{jsonpatch[_0x26c3('0x1f')](_0x1c77e6,_0x48ea4a,!![]);}catch(_0x8819f2){return BPromise['reject'](_0x8819f2);}return _0x1c77e6['save']();};}function saveUpdates(_0x524ac1,_0x25f771){return function(_0xba4076){if(_0xba4076){return _0xba4076[_0x26c3('0x20')](_0x524ac1)[_0x26c3('0x21')](function(_0x3db905){return _0x3db905;});}return null;};}function removeEntity(_0x582b5e,_0x39c6fb){return function(_0x4a5220){if(_0x4a5220){return _0x4a5220[_0x26c3('0x22')]()[_0x26c3('0x21')](function(){_0x582b5e[_0x26c3('0x17')](0xcc)[_0x26c3('0x18')]();});}};}function handleEntityNotFound(_0x3aa515,_0x37373c){return function(_0xf8aee0){if(!_0xf8aee0){_0x3aa515[_0x26c3('0x16')](0x194);}return _0xf8aee0;};}function handleError(_0xd14177,_0x3ab3d6){_0x3ab3d6=_0x3ab3d6||0x1f4;return function(_0x15380c){logger[_0x26c3('0x23')](_0x15380c['stack']);if(_0x15380c['name']){delete _0x15380c['name'];}_0xd14177[_0x26c3('0x17')](_0x3ab3d6)[_0x26c3('0x24')](_0x15380c);};}exports[_0x26c3('0x25')]=function(_0xa1cf3d,_0x31d3f4){var _0x48f0dd={},_0x3aa957={},_0x3ef628={'count':0x0,'rows':[]};var _0x150d1c=_[_0x26c3('0x26')](db['JscriptyAnswerReport']['rawAttributes'],function(_0xc900d2){return{'name':_0xc900d2[_0x26c3('0x27')],'type':_0xc900d2[_0x26c3('0x28')]['key']};});_0x3aa957['model']=_[_0x26c3('0x26')](_0x150d1c,_0x26c3('0x29'));_0x3aa957[_0x26c3('0x2a')]=_['keys'](_0xa1cf3d[_0x26c3('0x2a')]);_0x3aa957['filters']=_[_0x26c3('0x2b')](_0x3aa957['model'],_0x3aa957[_0x26c3('0x2a')]);_0x48f0dd['attributes']=_['intersection'](_0x3aa957[_0x26c3('0x2c')],qs[_0x26c3('0x2d')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x48f0dd[_0x26c3('0x2e')]=_0x48f0dd[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x48f0dd['attributes']:_0x3aa957['model'];if(!_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x30')]('nolimit')){_0x48f0dd[_0x26c3('0x1b')]=qs[_0x26c3('0x1b')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x1b')]);_0x48f0dd['offset']=qs['offset'](_0xa1cf3d['query'][_0x26c3('0x1a')]);}_0x48f0dd[_0x26c3('0x31')]=qs[_0x26c3('0x32')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x32')]);_0x48f0dd[_0x26c3('0x33')]=qs[_0x26c3('0x34')](_[_0x26c3('0x35')](_0xa1cf3d[_0x26c3('0x2a')],_0x3aa957[_0x26c3('0x34')]),_0x150d1c);if(_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x36')]){_0x48f0dd[_0x26c3('0x33')]=_[_0x26c3('0x37')](_0x48f0dd[_0x26c3('0x33')],{'$or':_[_0x26c3('0x26')](_0x150d1c,function(_0x3de84e){if(_0x3de84e['type']!==_0x26c3('0x38')){var _0x304766={};_0x304766[_0x3de84e[_0x26c3('0x29')]]={'$like':'%'+_0xa1cf3d[_0x26c3('0x2a')]['filter']+'%'};return _0x304766;}})});}_0x48f0dd=_[_0x26c3('0x37')]({},_0x48f0dd,_0xa1cf3d[_0x26c3('0x39')]);var _0x36e291={'where':_0x48f0dd[_0x26c3('0x33')]};return db[_0x26c3('0x3a')][_0x26c3('0x1d')](_0x36e291)[_0x26c3('0x21')](function(_0x1f2a3d){_0x3ef628[_0x26c3('0x1d')]=_0x1f2a3d;if(_0xa1cf3d['query'][_0x26c3('0x3b')]){_0x48f0dd[_0x26c3('0x3c')]=[{'all':!![]}];}return db[_0x26c3('0x3a')][_0x26c3('0x3d')](_0x48f0dd);})[_0x26c3('0x21')](function(_0x5e5b7f){_0x3ef628[_0x26c3('0x3e')]=_0x5e5b7f;return _0x3ef628;})['then'](respondWithFilteredResult(_0x31d3f4,_0x48f0dd))[_0x26c3('0x3f')](handleError(_0x31d3f4,null));};exports['show']=function(_0x25f5ed,_0x2d69ac){var _0x26d8cf={'raw':!![],'where':{'id':_0x25f5ed[_0x26c3('0x40')]['id']}},_0x46f552={};_0x46f552[_0x26c3('0x2c')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x46f552[_0x26c3('0x2a')]=_['keys'](_0x25f5ed[_0x26c3('0x2a')]);_0x46f552['filters']=_[_0x26c3('0x2b')](_0x46f552[_0x26c3('0x2c')],_0x46f552[_0x26c3('0x2a')]);_0x26d8cf['attributes']=_[_0x26c3('0x2b')](_0x46f552['model'],qs[_0x26c3('0x2d')](_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x26d8cf[_0x26c3('0x2e')]=_0x26d8cf[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x26d8cf[_0x26c3('0x2e')]:_0x46f552[_0x26c3('0x2c')];if(_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x3b')]){_0x26d8cf[_0x26c3('0x3c')]=[{'all':!![]}];}_0x26d8cf=_[_0x26c3('0x37')]({},_0x26d8cf,_0x25f5ed[_0x26c3('0x39')]);return db[_0x26c3('0x3a')][_0x26c3('0x41')](_0x26d8cf)[_0x26c3('0x21')](handleEntityNotFound(_0x2d69ac,null))[_0x26c3('0x21')](respondWithResult(_0x2d69ac,null))[_0x26c3('0x3f')](handleError(_0x2d69ac,null));};exports[_0x26c3('0x42')]=function(_0x1bb4ac,_0x41ba28){return db[_0x26c3('0x3a')][_0x26c3('0x42')](_0x1bb4ac[_0x26c3('0x43')],{})[_0x26c3('0x21')](respondWithResult(_0x41ba28,0xc9))[_0x26c3('0x3f')](handleError(_0x41ba28,null));};exports[_0x26c3('0x20')]=function(_0x18349e,_0x22e31a){if(_0x18349e[_0x26c3('0x43')]['id']){delete _0x18349e[_0x26c3('0x43')]['id'];}return db[_0x26c3('0x3a')][_0x26c3('0x41')]({'where':{'id':_0x18349e['params']['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x22e31a,null))[_0x26c3('0x21')](saveUpdates(_0x18349e[_0x26c3('0x43')],null))['then'](respondWithResult(_0x22e31a,null))[_0x26c3('0x3f')](handleError(_0x22e31a,null));};exports[_0x26c3('0x22')]=function(_0x4262be,_0x6f844){return db['JscriptyAnswerReport'][_0x26c3('0x41')]({'where':{'id':_0x4262be[_0x26c3('0x40')]['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x6f844,null))[_0x26c3('0x21')](removeEntity(_0x6f844,null))[_0x26c3('0x3f')](handleError(_0x6f844,null));};exports[_0x26c3('0x44')]=function(_0x15a716,_0x4d6865){return db['JscriptyAnswerReport'][_0x26c3('0x44')]()[_0x26c3('0x21')](respondWithResult(_0x4d6865,null))['catch'](handleError(_0x4d6865,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ae76643..14fb420 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 _0xbfc9=['JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x5f0823,_0x58ae86){var _0x41b184=function(_0x30f47d){while(--_0x30f47d){_0x5f0823['push'](_0x5f0823['shift']());}};_0x41b184(++_0x58ae86);}(_0xbfc9,0x14c));var _0x9bfc=function(_0x13e35a,_0x10906d){_0x13e35a=_0x13e35a-0x0;var _0x265502=_0xbfc9[_0x13e35a];return _0x265502;};'use strict';var _=require('lodash');var util=require(_0x9bfc('0x0'));var logger=require(_0x9bfc('0x1'))('api');var moment=require(_0x9bfc('0x2'));var BPromise=require(_0x9bfc('0x3'));var rp=require(_0x9bfc('0x4'));var fs=require('fs');var path=require(_0x9bfc('0x5'));var rimraf=require('rimraf');var config=require(_0x9bfc('0x6'));var attributes=require(_0x9bfc('0x7'));module[_0x9bfc('0x8')]=function(_0x5aae36,_0xd3b6f4){return _0x5aae36['define'](_0x9bfc('0x9'),attributes,{'tableName':_0x9bfc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d3b=['rimraf','../../config/environment','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10dd6c,_0x1b568d){var _0x4c59e5=function(_0x1c70b8){while(--_0x1c70b8){_0x10dd6c['push'](_0x10dd6c['shift']());}};_0x4c59e5(++_0x1b568d);}(_0x8d3b,0x17e));var _0xb8d3=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x8d3b[_0x21e97b];return _0x10ba44;};'use strict';var _=require(_0xb8d3('0x0'));var util=require(_0xb8d3('0x1'));var logger=require(_0xb8d3('0x2'))(_0xb8d3('0x3'));var moment=require(_0xb8d3('0x4'));var BPromise=require(_0xb8d3('0x5'));var rp=require(_0xb8d3('0x6'));var fs=require('fs');var path=require(_0xb8d3('0x7'));var rimraf=require(_0xb8d3('0x8'));var config=require(_0xb8d3('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xb8d3('0xa')]=function(_0x50d17d,_0x27ec12){return _0x50d17d[_0xb8d3('0xb')](_0xb8d3('0xc'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ab52b3d..1a611b7 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 _0x0d85=['http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d85,0x1da));var _0x50d8=function(_0x5db29d,_0x5cf335){_0x5db29d=_0x5db29d-0x0;var _0x353688=_0x0d85[_0x5db29d];return _0x353688;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x50d8('0x0'));var rs=require(_0x50d8('0x1'));var fs=require('fs');var Redis=require(_0x50d8('0x2'));var db=require(_0x50d8('0x3'))['db'];var utils=require(_0x50d8('0x4'));var logger=require(_0x50d8('0x5'))(_0x50d8('0x6'));var config=require('../../config/environment');var jayson=require(_0x50d8('0x7'));var client=jayson[_0x50d8('0x8')][_0x50d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116caa,_0x2ed24a,_0x57c656){return new BPromise(function(_0x460c06,_0x2c3422){return client[_0x50d8('0xa')](_0x116caa,_0x57c656)[_0x50d8('0xb')](function(_0x1ce6df){logger['info'](_0x50d8('0xc'),_0x2ed24a,_0x50d8('0xd'));logger[_0x50d8('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2ed24a,_0x50d8('0xd'),JSON[_0x50d8('0xf')](_0x1ce6df));if(_0x1ce6df['error']){if(_0x1ce6df['error'][_0x50d8('0x10')]===0x1f4){logger[_0x50d8('0x11')](_0x50d8('0xc'),_0x2ed24a,_0x1ce6df[_0x50d8('0x11')][_0x50d8('0x12')]);return _0x2c3422(_0x1ce6df[_0x50d8('0x11')][_0x50d8('0x12')]);}logger[_0x50d8('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2ed24a,_0x1ce6df[_0x50d8('0x11')]['message']);return _0x460c06(_0x1ce6df['error'][_0x50d8('0x12')]);}else{logger[_0x50d8('0x13')](_0x50d8('0xc'),_0x2ed24a,_0x50d8('0xd'));_0x460c06(_0x1ce6df['result'][_0x50d8('0x12')]);}})[_0x50d8('0x14')](function(_0x3b77cb){logger[_0x50d8('0x11')](_0x50d8('0xc'),_0x2ed24a,_0x3b77cb);_0x2c3422(_0x3b77cb);});});} \ No newline at end of file +var _0x7c2c=['then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x7c2c,0x1c3));var _0xc7c2=function(_0x240b9c,_0x3c5935){_0x240b9c=_0x240b9c-0x0;var _0x49091a=_0x7c2c[_0x240b9c];return _0x49091a;};'use strict';var _=require('lodash');var util=require(_0xc7c2('0x0'));var moment=require(_0xc7c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7c2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7c2('0x3'))['db'];var utils=require(_0xc7c2('0x4'));var logger=require(_0xc7c2('0x5'))(_0xc7c2('0x6'));var config=require(_0xc7c2('0x7'));var jayson=require(_0xc7c2('0x8'));var client=jayson['client'][_0xc7c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb3a1d6,_0x52436f,_0x47a1eb){return new BPromise(function(_0x3e853f,_0x45402d){return client[_0xc7c2('0xa')](_0xb3a1d6,_0x47a1eb)[_0xc7c2('0xb')](function(_0xe980a4){logger[_0xc7c2('0xc')](_0xc7c2('0xd'),_0x52436f,_0xc7c2('0xe'));logger[_0xc7c2('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x52436f,_0xc7c2('0xe'),JSON[_0xc7c2('0x10')](_0xe980a4));if(_0xe980a4[_0xc7c2('0x11')]){if(_0xe980a4[_0xc7c2('0x11')][_0xc7c2('0x12')]===0x1f4){logger[_0xc7c2('0x11')](_0xc7c2('0xd'),_0x52436f,_0xe980a4[_0xc7c2('0x11')][_0xc7c2('0x13')]);return _0x45402d(_0xe980a4[_0xc7c2('0x11')][_0xc7c2('0x13')]);}logger[_0xc7c2('0x11')](_0xc7c2('0xd'),_0x52436f,_0xe980a4['error'][_0xc7c2('0x13')]);return _0x3e853f(_0xe980a4[_0xc7c2('0x11')][_0xc7c2('0x13')]);}else{logger[_0xc7c2('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x52436f,_0xc7c2('0xe'));_0x3e853f(_0xe980a4[_0xc7c2('0x14')][_0xc7c2('0x13')]);}})[_0xc7c2('0x15')](function(_0x4c25a1){logger[_0xc7c2('0x11')](_0xc7c2('0xd'),_0x52436f,_0x4c25a1);_0x45402d(_0x4c25a1);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 18e7da2..507fd0c 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 _0xd306=['path','express','Router','fs-extra','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','getSessions','/:id/answers','getAnswers','30s','getSummary','create','post','/:id/clone','clone','put','destroy','multer','util'];(function(_0x158592,_0x480f2c){var _0x37b22a=function(_0x556381){while(--_0x556381){_0x158592['push'](_0x158592['shift']());}};_0x37b22a(++_0x480f2c);}(_0xd306,0x98));var _0x6d30=function(_0x4c984b,_0x50b1f7){_0x4c984b=_0x4c984b-0x0;var _0x5687b2=_0xd306[_0x4c984b];return _0x5687b2;};'use strict';var multer=require(_0x6d30('0x0'));var util=require(_0x6d30('0x1'));var path=require(_0x6d30('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d30('0x3'));var router=express[_0x6d30('0x4')]();var fs_extra=require(_0x6d30('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d30('0x6'));var controller=require(_0x6d30('0x7'));router[_0x6d30('0x8')]('/',auth[_0x6d30('0x9')](),controller['index']);router[_0x6d30('0x8')](_0x6d30('0xa'),auth[_0x6d30('0x9')](),controller['show']);router[_0x6d30('0x8')]('/:id/sessions',auth[_0x6d30('0x9')](),controller[_0x6d30('0xb')]);router['get'](_0x6d30('0xc'),auth[_0x6d30('0x9')](),controller[_0x6d30('0xd')]);router[_0x6d30('0x8')]('/:id/summary',auth[_0x6d30('0x9')](),timeout(_0x6d30('0xe')),controller[_0x6d30('0xf')]);router['post']('/',auth[_0x6d30('0x9')](),controller[_0x6d30('0x10')]);router[_0x6d30('0x11')](_0x6d30('0x12'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x13')]);router[_0x6d30('0x14')]('/:id',auth[_0x6d30('0x9')](),controller['update']);router['delete'](_0x6d30('0xa'),auth[_0x6d30('0x9')](),controller[_0x6d30('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0feb=['index','show','/:id/sessions','getSessions','isAuthenticated','/:id/summary','30s','create','post','clone','put','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x41227c,_0x5485f2){var _0x47f3a8=function(_0x342222){while(--_0x342222){_0x41227c['push'](_0x41227c['shift']());}};_0x47f3a8(++_0x5485f2);}(_0x0feb,0x16d));var _0xb0fe=function(_0x250c48,_0x3578ee){_0x250c48=_0x250c48-0x0;var _0x530614=_0x0feb[_0x250c48];return _0x530614;};'use strict';var multer=require(_0xb0fe('0x0'));var util=require(_0xb0fe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0fe('0x2'));var router=express[_0xb0fe('0x3')]();var fs_extra=require(_0xb0fe('0x4'));var auth=require(_0xb0fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb0fe('0x6'));var controller=require(_0xb0fe('0x7'));router[_0xb0fe('0x8')]('/',auth['isAuthenticated'](),controller[_0xb0fe('0x9')]);router[_0xb0fe('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb0fe('0xa')]);router[_0xb0fe('0x8')](_0xb0fe('0xb'),auth['isAuthenticated'](),controller[_0xb0fe('0xc')]);router[_0xb0fe('0x8')]('/:id/answers',auth[_0xb0fe('0xd')](),controller['getAnswers']);router[_0xb0fe('0x8')](_0xb0fe('0xe'),auth[_0xb0fe('0xd')](),timeout(_0xb0fe('0xf')),controller['getSummary']);router['post']('/',auth[_0xb0fe('0xd')](),controller[_0xb0fe('0x10')]);router[_0xb0fe('0x11')]('/:id/clone',auth[_0xb0fe('0xd')](),controller[_0xb0fe('0x12')]);router[_0xb0fe('0x13')](_0xb0fe('0x14'),auth[_0xb0fe('0xd')](),controller['update']);router['delete'](_0xb0fe('0x14'),auth[_0xb0fe('0xd')](),controller['destroy']);module[_0xb0fe('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6dd8370..9be2aa8 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 _0xf351=['STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue','BOOLEAN','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf351,0x80));var _0x1f35=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0xf351[_0x3f4dd9];return _0x31c54a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1f35('0x0'));var util=require(_0x1f35('0x1'));module['exports']={'name':{'type':Sequelize[_0x1f35('0x2')],'unique':_0x1f35('0x3')},'description':{'type':Sequelize[_0x1f35('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x1f35('0x4')),'set':function(_0x137a5d){if(_[_0x1f35('0x5')](_0x137a5d)){this[_0x1f35('0x6')](_0x1f35('0x7'),JSON[_0x1f35('0x8')](_0x137a5d));}else if(_[_0x1f35('0x9')](_0x137a5d)){this[_0x1f35('0x6')](_0x1f35('0x7'),_0x137a5d);}else{this[_0x1f35('0x6')](_0x1f35('0x7'),util[_0x1f35('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x1f35('0xb')]('name')||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1f35('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1f35('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xd2b2=['STRING','name','TEXT','setDataValue','formData','stringify','getDataValue','BOOLEAN','sequelize','lodash','util','exports'];(function(_0xc915c2,_0x26ef45){var _0x5e800f=function(_0x86b746){while(--_0x86b746){_0xc915c2['push'](_0xc915c2['shift']());}};_0x5e800f(++_0x26ef45);}(_0xd2b2,0x140));var _0x2d2b=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xd2b2[_0x1e354d];return _0x25445d;};'use strict';var Sequelize=require(_0x2d2b('0x0'));var _=require(_0x2d2b('0x1'));var util=require(_0x2d2b('0x2'));module[_0x2d2b('0x3')]={'name':{'type':Sequelize[_0x2d2b('0x4')],'unique':_0x2d2b('0x5')},'description':{'type':Sequelize[_0x2d2b('0x4')]},'formData':{'type':Sequelize[_0x2d2b('0x6')]('long'),'set':function(_0xcf8a09){if(_['isObjectLike'](_0xcf8a09)){this[_0x2d2b('0x7')](_0x2d2b('0x8'),JSON[_0x2d2b('0x9')](_0xcf8a09));}else if(_['isString'](_0xcf8a09)){this[_0x2d2b('0x7')]('formData',_0xcf8a09);}else{this[_0x2d2b('0x7')](_0x2d2b('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x2d2b('0xa')]('name')||'',this[_0x2d2b('0xa')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2d2b('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2d2b('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 718286a..945f9ad 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 _0x3176=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','Projects','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getSessions','JscriptySessionReport','nolimit','ProjectId','getAnswers','findOne','JscriptyAnswerReport','fromCharCode','indexOf','toString','getSummary','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','/tmp/Jscripty_Project_%d_Summary_%s.csv','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x506286,_0x13654d){var _0x548d67=function(_0x49d7da){while(--_0x49d7da){_0x506286['push'](_0x506286['shift']());}};_0x548d67(++_0x13654d);}(_0x3176,0x1d8));var _0x6317=function(_0x411ecb,_0x13c10a){_0x411ecb=_0x411ecb-0x0;var _0x1c55a9=_0x3176[_0x411ecb];return _0x1c55a9;};'use strict';var emlformat=require(_0x6317('0x0'));var rimraf=require(_0x6317('0x1'));var zipdir=require(_0x6317('0x2'));var jsonpatch=require(_0x6317('0x3'));var rp=require(_0x6317('0x4'));var moment=require(_0x6317('0x5'));var BPromise=require(_0x6317('0x6'));var Mustache=require(_0x6317('0x7'));var util=require(_0x6317('0x8'));var path=require(_0x6317('0x9'));var sox=require(_0x6317('0xa'));var csv=require(_0x6317('0xb'));var ejs=require(_0x6317('0xc'));var fs=require('fs');var fs_extra=require(_0x6317('0xd'));var _=require(_0x6317('0xe'));var squel=require(_0x6317('0xf'));var crypto=require('crypto');var jsforce=require(_0x6317('0x10'));var deskjs=require(_0x6317('0x11'));var toCsv=require(_0x6317('0xb'));var querystring=require('querystring');var Papa=require(_0x6317('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6317('0x13'));var as=require(_0x6317('0x14'));var hardwareService=require(_0x6317('0x15'));var logger=require(_0x6317('0x16'))(_0x6317('0x17'));var utils=require('../../config/utils');var config=require(_0x6317('0x18'));var licenseUtil=require(_0x6317('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x359566,_0x3f64fb){_0x3f64fb=_0x3f64fb||0xcc;return function(_0x4aa69f){if(_0x4aa69f){return _0x359566[_0x6317('0x1a')](_0x3f64fb);}return _0x359566[_0x6317('0x1b')](_0x3f64fb)['end']();};}function respondWithResult(_0x252b7d,_0x1fba31){_0x1fba31=_0x1fba31||0xc8;return function(_0x32ad4a){if(_0x32ad4a){return _0x252b7d[_0x6317('0x1b')](_0x1fba31)[_0x6317('0x1c')](_0x32ad4a);}};}function respondWithFilteredResult(_0x5317b4,_0x54e857){return function(_0x560b77){if(_0x560b77){var _0x1b42b3=typeof _0x54e857['offset']==='undefined'&&typeof _0x54e857[_0x6317('0x1d')]==='undefined';var _0x487bbc=_0x560b77[_0x6317('0x1e')];var _0x1d8497=_0x1b42b3?0x0:_0x54e857['offset'];var _0xc90572=_0x1b42b3?_0x560b77['count']:_0x54e857[_0x6317('0x1f')]+_0x54e857[_0x6317('0x1d')];var _0x164c96;if(_0xc90572>=_0x487bbc){_0xc90572=_0x487bbc;_0x164c96=0xc8;}else{_0x164c96=0xce;}_0x5317b4[_0x6317('0x1b')](_0x164c96);return _0x5317b4['set'](_0x6317('0x20'),_0x1d8497+'-'+_0xc90572+'/'+_0x487bbc)[_0x6317('0x1c')](_0x560b77);}return null;};}function patchUpdates(_0x30c5f1){return function(_0x3687d1){try{jsonpatch[_0x6317('0x21')](_0x3687d1,_0x30c5f1,!![]);}catch(_0x355b66){return BPromise[_0x6317('0x22')](_0x355b66);}return _0x3687d1[_0x6317('0x23')]();};}function saveUpdates(_0x1cd0c7,_0x1e9b7e){return function(_0x4b8b11){if(_0x4b8b11){return _0x4b8b11[_0x6317('0x24')](_0x1cd0c7)['then'](function(_0x1bdf53){return _0x1bdf53;});}return null;};}function removeEntity(_0x4a2e3e,_0x2b7669){return function(_0x2a36ee){if(_0x2a36ee){return _0x2a36ee[_0x6317('0x25')]()[_0x6317('0x26')](function(){var _0x422d4f=_0x2a36ee['get']({'plain':!![]});var _0x674933=_0x6317('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x674933,'resourceId':_0x422d4f['id']}})[_0x6317('0x26')](function(){return _0x2a36ee;});})[_0x6317('0x26')](function(){_0x4a2e3e[_0x6317('0x1b')](0xcc)[_0x6317('0x28')]();});}};}function handleEntityNotFound(_0x265076,_0xf27269){return function(_0x3fbfd1){if(!_0x3fbfd1){_0x265076['sendStatus'](0x194);}return _0x3fbfd1;};}function handleError(_0xc089e6,_0x133e1e){_0x133e1e=_0x133e1e||0x1f4;return function(_0x23d35b){logger['error'](_0x23d35b[_0x6317('0x29')]);if(_0x23d35b[_0x6317('0x2a')]){delete _0x23d35b['name'];}_0xc089e6['status'](_0x133e1e)[_0x6317('0x2b')](_0x23d35b);};}exports[_0x6317('0x2c')]=function(_0x55dfcb,_0x35f976){var _0x1fd2ff={},_0x203a62={},_0x2d21b8={'count':0x0,'rows':[]};var _0x242173=_[_0x6317('0x2d')](db[_0x6317('0x2e')][_0x6317('0x2f')],function(_0x18fcf6){return{'name':_0x18fcf6[_0x6317('0x30')],'type':_0x18fcf6[_0x6317('0x31')][_0x6317('0x32')]};});_0x203a62['model']=_[_0x6317('0x2d')](_0x242173,'name');_0x203a62[_0x6317('0x33')]=_[_0x6317('0x34')](_0x55dfcb[_0x6317('0x33')]);_0x203a62[_0x6317('0x35')]=_[_0x6317('0x36')](_0x203a62[_0x6317('0x37')],_0x203a62[_0x6317('0x33')]);_0x1fd2ff[_0x6317('0x38')]=_[_0x6317('0x36')](_0x203a62[_0x6317('0x37')],qs[_0x6317('0x39')](_0x55dfcb['query'][_0x6317('0x39')]));_0x1fd2ff[_0x6317('0x38')]=_0x1fd2ff[_0x6317('0x38')][_0x6317('0x3a')]?_0x1fd2ff[_0x6317('0x38')]:_0x203a62[_0x6317('0x37')];if(!_0x55dfcb[_0x6317('0x33')][_0x6317('0x3b')]('nolimit')){_0x1fd2ff[_0x6317('0x1d')]=qs[_0x6317('0x1d')](_0x55dfcb['query'][_0x6317('0x1d')]);_0x1fd2ff[_0x6317('0x1f')]=qs[_0x6317('0x1f')](_0x55dfcb[_0x6317('0x33')]['offset']);}_0x1fd2ff[_0x6317('0x3c')]=qs[_0x6317('0x3d')](_0x55dfcb['query'][_0x6317('0x3d')]);_0x1fd2ff[_0x6317('0x3e')]=qs[_0x6317('0x35')](_[_0x6317('0x3f')](_0x55dfcb[_0x6317('0x33')],_0x203a62[_0x6317('0x35')]),_0x242173);if(_0x55dfcb[_0x6317('0x33')]['filter']){_0x1fd2ff['where']=_[_0x6317('0x40')](_0x1fd2ff[_0x6317('0x3e')],{'$or':_[_0x6317('0x2d')](_0x242173,function(_0x3d03c5){if(_0x3d03c5['type']!==_0x6317('0x41')){var _0x2fcaf5={};_0x2fcaf5[_0x3d03c5[_0x6317('0x2a')]]={'$like':'%'+_0x55dfcb[_0x6317('0x33')][_0x6317('0x42')]+'%'};return _0x2fcaf5;}})});}_0x1fd2ff=_['merge']({},_0x1fd2ff,_0x55dfcb[_0x6317('0x43')]);var _0x1ff3ff={'where':_0x1fd2ff[_0x6317('0x3e')]};return db[_0x6317('0x2e')][_0x6317('0x1e')](_0x1ff3ff)['then'](function(_0x26450b){_0x2d21b8[_0x6317('0x1e')]=_0x26450b;if(_0x55dfcb['query'][_0x6317('0x44')]){_0x1fd2ff[_0x6317('0x45')]=[{'all':!![]}];}return db[_0x6317('0x2e')][_0x6317('0x46')](_0x1fd2ff);})[_0x6317('0x26')](function(_0x282240){_0x2d21b8[_0x6317('0x47')]=_0x282240;return _0x2d21b8;})[_0x6317('0x26')](respondWithFilteredResult(_0x35f976,_0x1fd2ff))[_0x6317('0x48')](handleError(_0x35f976,null));};exports[_0x6317('0x49')]=function(_0x407bb2,_0x5e2037){var _0x2ff1c0={'raw':![],'where':{'id':_0x407bb2[_0x6317('0x4a')]['id']}},_0x47f75e={};_0x47f75e[_0x6317('0x37')]=_[_0x6317('0x34')](db[_0x6317('0x2e')][_0x6317('0x2f')]);_0x47f75e[_0x6317('0x33')]=_[_0x6317('0x34')](_0x407bb2[_0x6317('0x33')]);_0x47f75e[_0x6317('0x35')]=_[_0x6317('0x36')](_0x47f75e[_0x6317('0x37')],_0x47f75e[_0x6317('0x33')]);_0x2ff1c0[_0x6317('0x38')]=_[_0x6317('0x36')](_0x47f75e[_0x6317('0x37')],qs[_0x6317('0x39')](_0x407bb2['query'][_0x6317('0x39')]));_0x2ff1c0[_0x6317('0x38')]=_0x2ff1c0[_0x6317('0x38')]['length']?_0x2ff1c0['attributes']:_0x47f75e[_0x6317('0x37')];if(_0x407bb2[_0x6317('0x33')]['includeAll']){_0x2ff1c0[_0x6317('0x45')]=[{'all':!![]}];}_0x2ff1c0=_[_0x6317('0x40')]({},_0x2ff1c0,_0x407bb2[_0x6317('0x43')]);return db['JscriptyProject'][_0x6317('0x4b')](_0x2ff1c0)[_0x6317('0x26')](handleEntityNotFound(_0x5e2037,null))[_0x6317('0x26')](respondWithResult(_0x5e2037,null))[_0x6317('0x48')](handleError(_0x5e2037,null));};exports[_0x6317('0x4c')]=function(_0x23104f,_0x238e59){return db[_0x6317('0x2e')]['create'](_0x23104f['body'],{})[_0x6317('0x26')](function(_0x219626){var _0x517f14=_0x23104f['user']['get']({'plain':!![]});if(!_0x517f14)throw new Error(_0x6317('0x4d'));if(_0x517f14[_0x6317('0x4e')]===_0x6317('0x4f')){var _0x2bf85b=_0x219626[_0x6317('0x50')]({'plain':!![]});var _0x1403a4=_0x6317('0x27');return db[_0x6317('0x51')][_0x6317('0x4b')]({'where':{'name':_0x1403a4,'userProfileId':_0x517f14[_0x6317('0x52')]},'raw':!![]})[_0x6317('0x26')](function(_0x151b6d){if(_0x151b6d&&_0x151b6d[_0x6317('0x53')]===0x0){return db[_0x6317('0x54')][_0x6317('0x4c')]({'name':_0x2bf85b[_0x6317('0x2a')],'resourceId':_0x2bf85b['id'],'type':_0x151b6d[_0x6317('0x2a')],'sectionId':_0x151b6d['id']},{})['then'](function(){return _0x219626;});}else{return _0x219626;}})[_0x6317('0x48')](function(_0x55554b){logger[_0x6317('0x55')](_0x6317('0x56'),_0x55554b);throw _0x55554b;});}return _0x219626;})['then'](respondWithResult(_0x238e59,0xc9))[_0x6317('0x48')](handleError(_0x238e59,null));};exports[_0x6317('0x57')]=function(_0xdf561f,_0x121175){var _0x4058f9={'where':{'id':_0xdf561f['params']['id']}},_0x46c153={};_0x46c153['model']=_[_0x6317('0x34')](db[_0x6317('0x2e')][_0x6317('0x2f')]);_0x4058f9[_0x6317('0x38')]=_[_0x6317('0x36')](_0x46c153[_0x6317('0x37')],qs['fields'](_0xdf561f['query']['fields']));_0x4058f9[_0x6317('0x38')]=_0x4058f9['attributes'][_0x6317('0x3a')]?_0x4058f9['attributes']:_0x46c153['model'];if(_0xdf561f[_0x6317('0x33')]['includeAll']){_0x4058f9[_0x6317('0x45')]=[{'all':!![]}];}_0x4058f9=_[_0x6317('0x40')]({},_0x4058f9,_0xdf561f['options']);return db[_0x6317('0x2e')][_0x6317('0x4b')](_0x4058f9)[_0x6317('0x26')](handleEntityNotFound(_0x121175,null))[_0x6317('0x26')](function(_0x1bcdb4){if(_0x1bcdb4){var _0x46e9eb=_0x1bcdb4[_0x6317('0x50')]({'plain':!![]});_0x46e9eb=qs[_0x6317('0x58')](_0x46e9eb,['id',_0x6317('0x59'),'updatedAt']);_0xdf561f['body']=_[_0x6317('0x58')](_0xdf561f['body'],['id',_0x6317('0x59'),_0x6317('0x5a')]);return db[_0x6317('0x2e')][_0x6317('0x4c')](_[_0x6317('0x40')](_0x46e9eb,_0xdf561f[_0x6317('0x5b')]),{'include':_0xdf561f[_0x6317('0x33')][_0x6317('0x44')]?[{'all':!![]}]:undefined})[_0x6317('0x26')](function(_0x348265){var _0x2a4f83=_0xdf561f[_0x6317('0x4f')][_0x6317('0x50')]({'plain':!![]});if(!_0x2a4f83)throw new Error(_0x6317('0x4d'));if(_0x2a4f83[_0x6317('0x4e')]===_0x6317('0x4f')){var _0x2d7905=_0x348265[_0x6317('0x50')]({'plain':!![]});var _0x36e1de=_0x6317('0x27');return db[_0x6317('0x51')]['find']({'where':{'name':_0x36e1de,'userProfileId':_0x2a4f83[_0x6317('0x52')]},'raw':!![]})[_0x6317('0x26')](function(_0x90ebc){if(_0x90ebc&&_0x90ebc[_0x6317('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d7905['name'],'resourceId':_0x2d7905['id'],'type':_0x90ebc[_0x6317('0x2a')],'sectionId':_0x90ebc['id']},{})['then'](function(){return _0x348265;});}else{return _0x348265;}})[_0x6317('0x48')](function(_0x205b21){logger['error'](_0x6317('0x56'),_0x205b21);throw _0x205b21;});}return _0x348265;});}})[_0x6317('0x26')](respondWithResult(_0x121175,0xc9))[_0x6317('0x48')](handleError(_0x121175,null));};exports[_0x6317('0x24')]=function(_0x4c06cb,_0x2aeb2b){if(_0x4c06cb[_0x6317('0x5b')]['id']){delete _0x4c06cb[_0x6317('0x5b')]['id'];}return db[_0x6317('0x2e')][_0x6317('0x4b')]({'where':{'id':_0x4c06cb[_0x6317('0x4a')]['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x2aeb2b,null))[_0x6317('0x26')](saveUpdates(_0x4c06cb[_0x6317('0x5b')],null))[_0x6317('0x26')](respondWithResult(_0x2aeb2b,null))['catch'](handleError(_0x2aeb2b,null));};exports[_0x6317('0x25')]=function(_0x561779,_0x257393){return db[_0x6317('0x2e')][_0x6317('0x4b')]({'where':{'id':_0x561779[_0x6317('0x4a')]['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x257393,null))[_0x6317('0x26')](removeEntity(_0x257393,null))[_0x6317('0x48')](handleError(_0x257393,null));};exports[_0x6317('0x5c')]=function(_0x30d25f,_0x56c68f,_0x232ffd){var _0x353b7a={'raw':!![],'where':{}};var _0xa86c17={};var _0x52fada={'count':0x0,'rows':[]};return db[_0x6317('0x2e')]['findOne']({'where':{'id':_0x30d25f[_0x6317('0x4a')]['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x56c68f,null))['then'](function(_0x354066){if(_0x354066){_0xa86c17['model']=_[_0x6317('0x34')](db[_0x6317('0x5d')][_0x6317('0x2f')]);_0xa86c17[_0x6317('0x33')]=_['keys'](_0x30d25f['query']);_0xa86c17['filters']=_[_0x6317('0x36')](_0xa86c17[_0x6317('0x37')],_0xa86c17[_0x6317('0x33')]);_0x353b7a['attributes']=_['intersection'](_0xa86c17[_0x6317('0x37')],qs[_0x6317('0x39')](_0x30d25f[_0x6317('0x33')][_0x6317('0x39')]));_0x353b7a[_0x6317('0x38')]=_0x353b7a['attributes'][_0x6317('0x3a')]?_0x353b7a['attributes']:_0xa86c17['model'];if(!_0x30d25f[_0x6317('0x33')][_0x6317('0x3b')](_0x6317('0x5e'))){_0x353b7a[_0x6317('0x1d')]=qs[_0x6317('0x1d')](_0x30d25f[_0x6317('0x33')][_0x6317('0x1d')]);_0x353b7a[_0x6317('0x1f')]=qs[_0x6317('0x1f')](_0x30d25f[_0x6317('0x33')][_0x6317('0x1f')]);}_0x353b7a['order']=qs[_0x6317('0x3d')](_0x30d25f['query'][_0x6317('0x3d')]);_0x353b7a[_0x6317('0x3e')]=qs[_0x6317('0x35')](_[_0x6317('0x3f')](_0x30d25f[_0x6317('0x33')],_0xa86c17['filters']));_0x353b7a[_0x6317('0x3e')][_0x6317('0x5f')]=_0x354066['id'];if(_0x30d25f[_0x6317('0x33')][_0x6317('0x42')]){_0x353b7a[_0x6317('0x3e')]=_['merge'](_0x353b7a[_0x6317('0x3e')],{'$or':_[_0x6317('0x2d')](_0x353b7a[_0x6317('0x38')],function(_0x44fb03){var _0x23cefa={};_0x23cefa[_0x44fb03]={'$like':'%'+_0x30d25f[_0x6317('0x33')][_0x6317('0x42')]+'%'};return _0x23cefa;})});}_0x353b7a=_['merge']({},_0x353b7a,_0x30d25f[_0x6317('0x43')]);return db[_0x6317('0x5d')]['count']({'where':_0x353b7a[_0x6317('0x3e')]})['then'](function(_0x4c8316){_0x52fada[_0x6317('0x1e')]=_0x4c8316;if(_0x30d25f[_0x6317('0x33')]['includeAll']){_0x353b7a['include']=[{'all':!![]}];}return db[_0x6317('0x5d')][_0x6317('0x46')](_0x353b7a);})[_0x6317('0x26')](function(_0x3aa9f6){_0x52fada[_0x6317('0x47')]=_0x3aa9f6;return _0x52fada;});}})[_0x6317('0x26')](respondWithFilteredResult(_0x56c68f,_0x353b7a))[_0x6317('0x48')](handleError(_0x56c68f,null));};exports[_0x6317('0x60')]=function(_0x455138,_0x3e8241,_0x27b234){var _0x9f5ee3={'raw':!![],'where':{}};var _0x2e1eb5={};var _0x315fe0={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6317('0x61')]({'where':{'id':_0x455138[_0x6317('0x4a')]['id']}})[_0x6317('0x26')](handleEntityNotFound(_0x3e8241,null))[_0x6317('0x26')](function(_0x412fea){if(_0x412fea){_0x2e1eb5[_0x6317('0x37')]=_[_0x6317('0x34')](db[_0x6317('0x62')][_0x6317('0x2f')]);_0x2e1eb5[_0x6317('0x33')]=_[_0x6317('0x34')](_0x455138[_0x6317('0x33')]);_0x2e1eb5['filters']=_[_0x6317('0x36')](_0x2e1eb5[_0x6317('0x37')],_0x2e1eb5[_0x6317('0x33')]);_0x9f5ee3[_0x6317('0x38')]=_[_0x6317('0x36')](_0x2e1eb5[_0x6317('0x37')],qs[_0x6317('0x39')](_0x455138[_0x6317('0x33')]['fields']));_0x9f5ee3['attributes']=_0x9f5ee3[_0x6317('0x38')]['length']?_0x9f5ee3['attributes']:_0x2e1eb5[_0x6317('0x37')];if(!_0x455138[_0x6317('0x33')][_0x6317('0x3b')](_0x6317('0x5e'))){_0x9f5ee3['limit']=qs[_0x6317('0x1d')](_0x455138[_0x6317('0x33')][_0x6317('0x1d')]);_0x9f5ee3[_0x6317('0x1f')]=qs[_0x6317('0x1f')](_0x455138[_0x6317('0x33')][_0x6317('0x1f')]);}_0x9f5ee3[_0x6317('0x3c')]=qs[_0x6317('0x3d')](_0x455138[_0x6317('0x33')]['sort']);_0x9f5ee3[_0x6317('0x3e')]=qs[_0x6317('0x35')](_[_0x6317('0x3f')](_0x455138['query'],_0x2e1eb5[_0x6317('0x35')]));_0x9f5ee3['where']['ProjectId']=_0x412fea['id'];if(_0x455138['query']['filter']){_0x9f5ee3[_0x6317('0x3e')]=_[_0x6317('0x40')](_0x9f5ee3[_0x6317('0x3e')],{'$or':_[_0x6317('0x2d')](_0x9f5ee3[_0x6317('0x38')],function(_0x57bb3b){var _0x16de40={};_0x16de40[_0x57bb3b]={'$like':'%'+_0x455138[_0x6317('0x33')]['filter']+'%'};return _0x16de40;})});}_0x9f5ee3=_['merge']({},_0x9f5ee3,_0x455138[_0x6317('0x43')]);return db[_0x6317('0x62')][_0x6317('0x1e')]({'where':_0x9f5ee3[_0x6317('0x3e')]})[_0x6317('0x26')](function(_0x20e042){_0x315fe0['count']=_0x20e042;if(_0x455138['query'][_0x6317('0x44')]){_0x9f5ee3['include']=[{'all':!![]}];}return db[_0x6317('0x62')][_0x6317('0x46')](_0x9f5ee3);})['then'](function(_0x2914d3){_0x315fe0['rows']=_0x2914d3;return _0x315fe0;});}})['then'](respondWithFilteredResult(_0x3e8241,_0x9f5ee3))[_0x6317('0x48')](handleError(_0x3e8241,null));};function char(_0x46dc44){return'number'===typeof _0x46dc44?String[_0x6317('0x63')][_0x6317('0x21')](null,arguments):_0x46dc44;}function needsEncapsulation(_0x9b554f){return!!_0x9b554f&&(_0x9b554f['toString']()[_0x6317('0x64')](char(0xd))>=0x0||_0x9b554f[_0x6317('0x65')]()[_0x6317('0x64')](char(0xa))>=0x0||_0x9b554f[_0x6317('0x65')]()[_0x6317('0x64')](char(0x2c))>=0x0||_0x9b554f[_0x6317('0x65')]()[_0x6317('0x64')](char(0x22))>=0x0);}function encapsulate(_0x290a13){var _0x5435cc=char(0x22),_0x41e747='\x5c'+char(0x22),_0x39a840=_0x290a13[_0x6317('0x65')]()['replace'](new RegExp(_0x5435cc,'g'),_0x41e747);return _0x5435cc+_0x39a840+_0x5435cc;}exports[_0x6317('0x66')]=function(_0x4b337f,_0x5644c0,_0x2caf9b){var _0x731867,_0xe06ce3;var _0xc7f6de={'where':{'ProjectId':_0x4b337f['params']['id']}};if(_0x4b337f[_0x6317('0x33')]['startTime']){_0xc7f6de[_0x6317('0x3e')]['starttime']=JSON[_0x6317('0x67')](_0x4b337f[_0x6317('0x33')]['startTime']);}return db['JscriptySessionReport'][_0x6317('0x46')](_0xc7f6de)[_0x6317('0x26')](handleEntityNotFound(_0x5644c0,null))['then'](function(_0x22601a){if(_0x22601a){_0x731867=_0x22601a;return db[_0x6317('0x68')][_0x6317('0x46')]({'where':{'SessionId':{'$in':_['map'](_0x731867,'id')},'ProjectId':_0x4b337f[_0x6317('0x4a')]['id']},'order':_0x6317('0x69')});}})[_0x6317('0x26')](handleEntityNotFound(_0x5644c0,null))[_0x6317('0x26')](function(_0x344f14){if(_0x344f14){_0xe06ce3=_0x344f14;var _0x15ddf5={};for(var _0x712acc=0x0,_0x4ea163=_0xe06ce3[_0x6317('0x3a')];_0x712acc<_0x4ea163;_0x712acc++){if(!_0x15ddf5[_0x6317('0x3b')](_0xe06ce3[_0x712acc][_0x6317('0x6a')])){_0x15ddf5[_0xe06ce3[_0x712acc][_0x6317('0x6a')]]=needsEncapsulation(_0xe06ce3[_0x712acc][_0x6317('0x6b')])?encapsulate(_0xe06ce3[_0x712acc][_0x6317('0x6b')]):_0xe06ce3[_0x712acc][_0x6317('0x6b')];}}var _0xffe5d4=[],_0x44327d={};for(var _0x5a6700=0x0,_0x1df4c1=_0x731867['length'];_0x5a6700<_0x1df4c1;_0x5a6700++){_0x44327d={'ProjectId':_0x4b337f['params']['id'],'SessionId':_0x731867[_0x5a6700]['id'],'StartTime':moment(_0x731867[_0x5a6700][_0x6317('0x6c')])[_0x6317('0x6d')](_0x6317('0x6e'))};for(var _0x479442=0x0,_0x169b4d=_0xe06ce3[_0x6317('0x3a')];_0x479442<_0x169b4d;_0x479442++){if(_0xe06ce3[_0x479442][_0x6317('0x6f')]==_0x731867[_0x5a6700]['id']&&_0x15ddf5[_0x6317('0x3b')](_0xe06ce3[_0x479442]['questionId'])){_0x44327d[_0x15ddf5[_0xe06ce3[_0x479442][_0x6317('0x6a')]]]=_0xe06ce3[_0x479442][_0x6317('0x70')];}}for(var _0x35e68e in _0x15ddf5){if(!_0x44327d['hasOwnProperty'](_0x15ddf5[_0x35e68e])){_0x44327d[_0x15ddf5[_0x35e68e]]=null;}}_0xffe5d4[_0x6317('0x71')](_0x44327d);}return _0xffe5d4;}})[_0x6317('0x26')](function(_0x595288){if(!_[_0x6317('0x72')](_0x595288)){var _0x16d3b9=toCsv(_0x595288);var _0x2134d2=Date['now']();fs['writeFileSync'](util[_0x6317('0x6d')](_0x6317('0x73'),_0x4b337f[_0x6317('0x4a')]['id'],_0x2134d2),_0x16d3b9);_0x5644c0['setHeader']('Content-disposition','attachment;\x20filename='+util['format'](_0x6317('0x74'),_0x4b337f[_0x6317('0x4a')]['id'],_0x2134d2));_0x5644c0[_0x6317('0x75')]('Content-type',_0x6317('0x76'));return _0x5644c0[_0x6317('0x77')](util[_0x6317('0x6d')](_0x6317('0x73'),_0x4b337f['params']['id'],_0x2134d2));}else{return _0x5644c0['sendStatus'](0xcc);}})[_0x6317('0x48')](handleError(_0x5644c0,null));}; \ No newline at end of file +var _0xd027=['pick','filter','merge','VIRTUAL','options','findAll','rows','catch','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','includeAll','autoAssociation','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','hasOwnProperty','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','Projects','UserProfileResource','sendStatus','stack','name','index','JscriptyProject','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where'];(function(_0x34c6f5,_0x46f32e){var _0x42c3bf=function(_0x295523){while(--_0x295523){_0x34c6f5['push'](_0x34c6f5['shift']());}};_0x42c3bf(++_0x46f32e);}(_0xd027,0x197));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d02('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d02('0x1'));var moment=require(_0x7d02('0x2'));var BPromise=require(_0x7d02('0x3'));var Mustache=require(_0x7d02('0x4'));var util=require(_0x7d02('0x5'));var path=require(_0x7d02('0x6'));var sox=require(_0x7d02('0x7'));var csv=require(_0x7d02('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d02('0x9'));var _=require(_0x7d02('0xa'));var squel=require(_0x7d02('0xb'));var crypto=require(_0x7d02('0xc'));var jsforce=require(_0x7d02('0xd'));var deskjs=require(_0x7d02('0xe'));var toCsv=require(_0x7d02('0x8'));var querystring=require(_0x7d02('0xf'));var Papa=require(_0x7d02('0x10'));var Redis=require(_0x7d02('0x11'));var authService=require(_0x7d02('0x12'));var qs=require(_0x7d02('0x13'));var as=require(_0x7d02('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d02('0x15'))(_0x7d02('0x16'));var utils=require('../../config/utils');var config=require(_0x7d02('0x17'));var licenseUtil=require(_0x7d02('0x18'));var db=require(_0x7d02('0x19'))['db'];function respondWithStatusCode(_0x32ad15,_0x533045){_0x533045=_0x533045||0xcc;return function(_0x3ef85f){if(_0x3ef85f){return _0x32ad15['sendStatus'](_0x533045);}return _0x32ad15[_0x7d02('0x1a')](_0x533045)[_0x7d02('0x1b')]();};}function respondWithResult(_0x5351aa,_0x1cab87){_0x1cab87=_0x1cab87||0xc8;return function(_0x416849){if(_0x416849){return _0x5351aa['status'](_0x1cab87)[_0x7d02('0x1c')](_0x416849);}};}function respondWithFilteredResult(_0x398913,_0x93c887){return function(_0x53ba2a){if(_0x53ba2a){var _0xec4879=typeof _0x93c887[_0x7d02('0x1d')]===_0x7d02('0x1e')&&typeof _0x93c887[_0x7d02('0x1f')]===_0x7d02('0x1e');var _0x3d1735=_0x53ba2a[_0x7d02('0x20')];var _0x3024d2=_0xec4879?0x0:_0x93c887[_0x7d02('0x1d')];var _0xe0f2f3=_0xec4879?_0x53ba2a[_0x7d02('0x20')]:_0x93c887[_0x7d02('0x1d')]+_0x93c887[_0x7d02('0x1f')];var _0x209421;if(_0xe0f2f3>=_0x3d1735){_0xe0f2f3=_0x3d1735;_0x209421=0xc8;}else{_0x209421=0xce;}_0x398913[_0x7d02('0x1a')](_0x209421);return _0x398913[_0x7d02('0x21')]('Content-Range',_0x3024d2+'-'+_0xe0f2f3+'/'+_0x3d1735)[_0x7d02('0x1c')](_0x53ba2a);}return null;};}function patchUpdates(_0x152291){return function(_0x422024){try{jsonpatch[_0x7d02('0x22')](_0x422024,_0x152291,!![]);}catch(_0x3f687b){return BPromise[_0x7d02('0x23')](_0x3f687b);}return _0x422024[_0x7d02('0x24')]();};}function saveUpdates(_0x5a8d0e,_0x163bbc){return function(_0x14212d){if(_0x14212d){return _0x14212d[_0x7d02('0x25')](_0x5a8d0e)[_0x7d02('0x26')](function(_0x102631){return _0x102631;});}return null;};}function removeEntity(_0xfc7e99,_0x8f4e38){return function(_0x241303){if(_0x241303){return _0x241303[_0x7d02('0x27')]()[_0x7d02('0x26')](function(){var _0x870a68=_0x241303['get']({'plain':!![]});var _0x26630f=_0x7d02('0x28');return db[_0x7d02('0x29')]['destroy']({'where':{'type':_0x26630f,'resourceId':_0x870a68['id']}})['then'](function(){return _0x241303;});})[_0x7d02('0x26')](function(){_0xfc7e99[_0x7d02('0x1a')](0xcc)[_0x7d02('0x1b')]();});}};}function handleEntityNotFound(_0x478506,_0x5e35a9){return function(_0x452b8e){if(!_0x452b8e){_0x478506[_0x7d02('0x2a')](0x194);}return _0x452b8e;};}function handleError(_0x3c57e4,_0x5a8169){_0x5a8169=_0x5a8169||0x1f4;return function(_0x5b94c8){logger['error'](_0x5b94c8[_0x7d02('0x2b')]);if(_0x5b94c8[_0x7d02('0x2c')]){delete _0x5b94c8[_0x7d02('0x2c')];}_0x3c57e4[_0x7d02('0x1a')](_0x5a8169)['send'](_0x5b94c8);};}exports[_0x7d02('0x2d')]=function(_0x5a8d2b,_0x4f10e0){var _0x369c12={},_0x7a05c6={},_0x3494fd={'count':0x0,'rows':[]};var _0x3dad1e=_['map'](db[_0x7d02('0x2e')][_0x7d02('0x2f')],function(_0x2d7e20){return{'name':_0x2d7e20['fieldName'],'type':_0x2d7e20[_0x7d02('0x30')][_0x7d02('0x31')]};});_0x7a05c6[_0x7d02('0x32')]=_[_0x7d02('0x33')](_0x3dad1e,_0x7d02('0x2c'));_0x7a05c6[_0x7d02('0x34')]=_[_0x7d02('0x35')](_0x5a8d2b[_0x7d02('0x34')]);_0x7a05c6[_0x7d02('0x36')]=_[_0x7d02('0x37')](_0x7a05c6[_0x7d02('0x32')],_0x7a05c6[_0x7d02('0x34')]);_0x369c12['attributes']=_[_0x7d02('0x37')](_0x7a05c6[_0x7d02('0x32')],qs[_0x7d02('0x38')](_0x5a8d2b[_0x7d02('0x34')]['fields']));_0x369c12['attributes']=_0x369c12[_0x7d02('0x39')]['length']?_0x369c12['attributes']:_0x7a05c6[_0x7d02('0x32')];if(!_0x5a8d2b['query']['hasOwnProperty'](_0x7d02('0x3a'))){_0x369c12['limit']=qs[_0x7d02('0x1f')](_0x5a8d2b['query'][_0x7d02('0x1f')]);_0x369c12['offset']=qs[_0x7d02('0x1d')](_0x5a8d2b[_0x7d02('0x34')][_0x7d02('0x1d')]);}_0x369c12['order']=qs['sort'](_0x5a8d2b[_0x7d02('0x34')][_0x7d02('0x3b')]);_0x369c12[_0x7d02('0x3c')]=qs[_0x7d02('0x36')](_[_0x7d02('0x3d')](_0x5a8d2b[_0x7d02('0x34')],_0x7a05c6[_0x7d02('0x36')]),_0x3dad1e);if(_0x5a8d2b[_0x7d02('0x34')][_0x7d02('0x3e')]){_0x369c12[_0x7d02('0x3c')]=_[_0x7d02('0x3f')](_0x369c12['where'],{'$or':_['map'](_0x3dad1e,function(_0x57a704){if(_0x57a704[_0x7d02('0x30')]!==_0x7d02('0x40')){var _0x17bbe0={};_0x17bbe0[_0x57a704[_0x7d02('0x2c')]]={'$like':'%'+_0x5a8d2b[_0x7d02('0x34')][_0x7d02('0x3e')]+'%'};return _0x17bbe0;}})});}_0x369c12=_[_0x7d02('0x3f')]({},_0x369c12,_0x5a8d2b[_0x7d02('0x41')]);var _0x1271d6={'where':_0x369c12[_0x7d02('0x3c')]};return db[_0x7d02('0x2e')][_0x7d02('0x20')](_0x1271d6)[_0x7d02('0x26')](function(_0x4fb1cf){_0x3494fd['count']=_0x4fb1cf;if(_0x5a8d2b[_0x7d02('0x34')]['includeAll']){_0x369c12['include']=[{'all':!![]}];}return db[_0x7d02('0x2e')][_0x7d02('0x42')](_0x369c12);})[_0x7d02('0x26')](function(_0x1ebdda){_0x3494fd[_0x7d02('0x43')]=_0x1ebdda;return _0x3494fd;})[_0x7d02('0x26')](respondWithFilteredResult(_0x4f10e0,_0x369c12))[_0x7d02('0x44')](handleError(_0x4f10e0,null));};exports['show']=function(_0x406f74,_0x2610f0){var _0x577fa6={'raw':![],'where':{'id':_0x406f74['params']['id']}},_0x429c8d={};_0x429c8d['model']=_[_0x7d02('0x35')](db[_0x7d02('0x2e')][_0x7d02('0x2f')]);_0x429c8d[_0x7d02('0x34')]=_[_0x7d02('0x35')](_0x406f74[_0x7d02('0x34')]);_0x429c8d[_0x7d02('0x36')]=_['intersection'](_0x429c8d[_0x7d02('0x32')],_0x429c8d[_0x7d02('0x34')]);_0x577fa6[_0x7d02('0x39')]=_[_0x7d02('0x37')](_0x429c8d[_0x7d02('0x32')],qs['fields'](_0x406f74['query'][_0x7d02('0x38')]));_0x577fa6[_0x7d02('0x39')]=_0x577fa6[_0x7d02('0x39')][_0x7d02('0x45')]?_0x577fa6[_0x7d02('0x39')]:_0x429c8d['model'];if(_0x406f74[_0x7d02('0x34')]['includeAll']){_0x577fa6[_0x7d02('0x46')]=[{'all':!![]}];}_0x577fa6=_[_0x7d02('0x3f')]({},_0x577fa6,_0x406f74[_0x7d02('0x41')]);return db[_0x7d02('0x2e')][_0x7d02('0x47')](_0x577fa6)[_0x7d02('0x26')](handleEntityNotFound(_0x2610f0,null))[_0x7d02('0x26')](respondWithResult(_0x2610f0,null))[_0x7d02('0x44')](handleError(_0x2610f0,null));};exports[_0x7d02('0x48')]=function(_0x55ddc8,_0x5283eb){return db[_0x7d02('0x2e')][_0x7d02('0x48')](_0x55ddc8[_0x7d02('0x49')],{})['then'](function(_0xfe4c4f){var _0x3d8711=_0x55ddc8['user'][_0x7d02('0x4a')]({'plain':!![]});if(!_0x3d8711)throw new Error(_0x7d02('0x4b'));if(_0x3d8711['role']===_0x7d02('0x4c')){var _0x17ec2b=_0xfe4c4f[_0x7d02('0x4a')]({'plain':!![]});var _0x202454=_0x7d02('0x28');return db[_0x7d02('0x4d')]['find']({'where':{'name':_0x202454,'userProfileId':_0x3d8711['userProfileId']},'raw':!![]})['then'](function(_0x330b61){if(_0x330b61&&_0x330b61['autoAssociation']===0x0){return db[_0x7d02('0x29')][_0x7d02('0x48')]({'name':_0x17ec2b[_0x7d02('0x2c')],'resourceId':_0x17ec2b['id'],'type':_0x330b61[_0x7d02('0x2c')],'sectionId':_0x330b61['id']},{})[_0x7d02('0x26')](function(){return _0xfe4c4f;});}else{return _0xfe4c4f;}})[_0x7d02('0x44')](function(_0x57542f){logger[_0x7d02('0x4e')](_0x7d02('0x4f'),_0x57542f);throw _0x57542f;});}return _0xfe4c4f;})[_0x7d02('0x26')](respondWithResult(_0x5283eb,0xc9))['catch'](handleError(_0x5283eb,null));};exports[_0x7d02('0x50')]=function(_0x589b66,_0x3e3cb1){var _0x53c4dd={'where':{'id':_0x589b66[_0x7d02('0x51')]['id']}},_0x4bd773={};_0x4bd773[_0x7d02('0x32')]=_[_0x7d02('0x35')](db['JscriptyProject'][_0x7d02('0x2f')]);_0x53c4dd['attributes']=_[_0x7d02('0x37')](_0x4bd773[_0x7d02('0x32')],qs['fields'](_0x589b66[_0x7d02('0x34')][_0x7d02('0x38')]));_0x53c4dd['attributes']=_0x53c4dd[_0x7d02('0x39')][_0x7d02('0x45')]?_0x53c4dd[_0x7d02('0x39')]:_0x4bd773[_0x7d02('0x32')];if(_0x589b66['query']['includeAll']){_0x53c4dd[_0x7d02('0x46')]=[{'all':!![]}];}_0x53c4dd=_[_0x7d02('0x3f')]({},_0x53c4dd,_0x589b66[_0x7d02('0x41')]);return db[_0x7d02('0x2e')][_0x7d02('0x47')](_0x53c4dd)['then'](handleEntityNotFound(_0x3e3cb1,null))[_0x7d02('0x26')](function(_0x12825f){if(_0x12825f){var _0x12a7f6=_0x12825f[_0x7d02('0x4a')]({'plain':!![]});_0x12a7f6=qs[_0x7d02('0x52')](_0x12a7f6,['id',_0x7d02('0x53'),_0x7d02('0x54')]);_0x589b66[_0x7d02('0x49')]=_[_0x7d02('0x52')](_0x589b66['body'],['id',_0x7d02('0x53'),'updatedAt']);return db[_0x7d02('0x2e')]['create'](_[_0x7d02('0x3f')](_0x12a7f6,_0x589b66['body']),{'include':_0x589b66[_0x7d02('0x34')][_0x7d02('0x55')]?[{'all':!![]}]:undefined})[_0x7d02('0x26')](function(_0x38887e){var _0x190e9e=_0x589b66[_0x7d02('0x4c')][_0x7d02('0x4a')]({'plain':!![]});if(!_0x190e9e)throw new Error(_0x7d02('0x4b'));if(_0x190e9e['role']===_0x7d02('0x4c')){var _0x5c070c=_0x38887e[_0x7d02('0x4a')]({'plain':!![]});var _0x517249=_0x7d02('0x28');return db[_0x7d02('0x4d')][_0x7d02('0x47')]({'where':{'name':_0x517249,'userProfileId':_0x190e9e['userProfileId']},'raw':!![]})[_0x7d02('0x26')](function(_0x2dca66){if(_0x2dca66&&_0x2dca66[_0x7d02('0x56')]===0x0){return db[_0x7d02('0x29')][_0x7d02('0x48')]({'name':_0x5c070c['name'],'resourceId':_0x5c070c['id'],'type':_0x2dca66[_0x7d02('0x2c')],'sectionId':_0x2dca66['id']},{})['then'](function(){return _0x38887e;});}else{return _0x38887e;}})[_0x7d02('0x44')](function(_0x40d6a9){logger['error'](_0x7d02('0x4f'),_0x40d6a9);throw _0x40d6a9;});}return _0x38887e;});}})[_0x7d02('0x26')](respondWithResult(_0x3e3cb1,0xc9))[_0x7d02('0x44')](handleError(_0x3e3cb1,null));};exports[_0x7d02('0x25')]=function(_0x300707,_0xb73b41){if(_0x300707[_0x7d02('0x49')]['id']){delete _0x300707[_0x7d02('0x49')]['id'];}return db[_0x7d02('0x2e')][_0x7d02('0x47')]({'where':{'id':_0x300707[_0x7d02('0x51')]['id']}})[_0x7d02('0x26')](handleEntityNotFound(_0xb73b41,null))['then'](saveUpdates(_0x300707[_0x7d02('0x49')],null))[_0x7d02('0x26')](respondWithResult(_0xb73b41,null))[_0x7d02('0x44')](handleError(_0xb73b41,null));};exports[_0x7d02('0x27')]=function(_0x46eb75,_0x58591d){return db['JscriptyProject'][_0x7d02('0x47')]({'where':{'id':_0x46eb75[_0x7d02('0x51')]['id']}})['then'](handleEntityNotFound(_0x58591d,null))[_0x7d02('0x26')](removeEntity(_0x58591d,null))[_0x7d02('0x44')](handleError(_0x58591d,null));};exports[_0x7d02('0x57')]=function(_0x25c595,_0x1159ab,_0x26a16d){var _0x3e236b={'raw':!![],'where':{}};var _0xdc1a5f={};var _0x211159={'count':0x0,'rows':[]};return db[_0x7d02('0x2e')]['findOne']({'where':{'id':_0x25c595['params']['id']}})['then'](handleEntityNotFound(_0x1159ab,null))[_0x7d02('0x26')](function(_0x407e89){if(_0x407e89){_0xdc1a5f[_0x7d02('0x32')]=_['keys'](db[_0x7d02('0x58')]['rawAttributes']);_0xdc1a5f[_0x7d02('0x34')]=_[_0x7d02('0x35')](_0x25c595[_0x7d02('0x34')]);_0xdc1a5f[_0x7d02('0x36')]=_[_0x7d02('0x37')](_0xdc1a5f['model'],_0xdc1a5f[_0x7d02('0x34')]);_0x3e236b[_0x7d02('0x39')]=_['intersection'](_0xdc1a5f[_0x7d02('0x32')],qs[_0x7d02('0x38')](_0x25c595[_0x7d02('0x34')]['fields']));_0x3e236b[_0x7d02('0x39')]=_0x3e236b[_0x7d02('0x39')][_0x7d02('0x45')]?_0x3e236b[_0x7d02('0x39')]:_0xdc1a5f[_0x7d02('0x32')];if(!_0x25c595[_0x7d02('0x34')]['hasOwnProperty'](_0x7d02('0x3a'))){_0x3e236b[_0x7d02('0x1f')]=qs[_0x7d02('0x1f')](_0x25c595[_0x7d02('0x34')][_0x7d02('0x1f')]);_0x3e236b[_0x7d02('0x1d')]=qs[_0x7d02('0x1d')](_0x25c595[_0x7d02('0x34')]['offset']);}_0x3e236b['order']=qs['sort'](_0x25c595['query'][_0x7d02('0x3b')]);_0x3e236b[_0x7d02('0x3c')]=qs[_0x7d02('0x36')](_[_0x7d02('0x3d')](_0x25c595[_0x7d02('0x34')],_0xdc1a5f['filters']));_0x3e236b[_0x7d02('0x3c')][_0x7d02('0x59')]=_0x407e89['id'];if(_0x25c595['query'][_0x7d02('0x3e')]){_0x3e236b[_0x7d02('0x3c')]=_[_0x7d02('0x3f')](_0x3e236b[_0x7d02('0x3c')],{'$or':_['map'](_0x3e236b[_0x7d02('0x39')],function(_0x2c5727){var _0x3ab226={};_0x3ab226[_0x2c5727]={'$like':'%'+_0x25c595[_0x7d02('0x34')][_0x7d02('0x3e')]+'%'};return _0x3ab226;})});}_0x3e236b=_[_0x7d02('0x3f')]({},_0x3e236b,_0x25c595[_0x7d02('0x41')]);return db[_0x7d02('0x58')]['count']({'where':_0x3e236b[_0x7d02('0x3c')]})[_0x7d02('0x26')](function(_0x1e2d91){_0x211159[_0x7d02('0x20')]=_0x1e2d91;if(_0x25c595['query']['includeAll']){_0x3e236b[_0x7d02('0x46')]=[{'all':!![]}];}return db[_0x7d02('0x58')][_0x7d02('0x42')](_0x3e236b);})[_0x7d02('0x26')](function(_0x24868c){_0x211159[_0x7d02('0x43')]=_0x24868c;return _0x211159;});}})['then'](respondWithFilteredResult(_0x1159ab,_0x3e236b))[_0x7d02('0x44')](handleError(_0x1159ab,null));};exports[_0x7d02('0x5a')]=function(_0x1a46cc,_0x30cb68,_0x1f44f3){var _0x4c4b96={'raw':!![],'where':{}};var _0x43f39a={};var _0x1ae91e={'count':0x0,'rows':[]};return db[_0x7d02('0x2e')][_0x7d02('0x5b')]({'where':{'id':_0x1a46cc[_0x7d02('0x51')]['id']}})['then'](handleEntityNotFound(_0x30cb68,null))[_0x7d02('0x26')](function(_0x13d98a){if(_0x13d98a){_0x43f39a[_0x7d02('0x32')]=_['keys'](db[_0x7d02('0x5c')][_0x7d02('0x2f')]);_0x43f39a['query']=_[_0x7d02('0x35')](_0x1a46cc['query']);_0x43f39a[_0x7d02('0x36')]=_['intersection'](_0x43f39a['model'],_0x43f39a[_0x7d02('0x34')]);_0x4c4b96[_0x7d02('0x39')]=_[_0x7d02('0x37')](_0x43f39a['model'],qs[_0x7d02('0x38')](_0x1a46cc[_0x7d02('0x34')]['fields']));_0x4c4b96[_0x7d02('0x39')]=_0x4c4b96[_0x7d02('0x39')][_0x7d02('0x45')]?_0x4c4b96[_0x7d02('0x39')]:_0x43f39a[_0x7d02('0x32')];if(!_0x1a46cc[_0x7d02('0x34')]['hasOwnProperty']('nolimit')){_0x4c4b96[_0x7d02('0x1f')]=qs[_0x7d02('0x1f')](_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x1f')]);_0x4c4b96[_0x7d02('0x1d')]=qs[_0x7d02('0x1d')](_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x1d')]);}_0x4c4b96['order']=qs[_0x7d02('0x3b')](_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x3b')]);_0x4c4b96['where']=qs['filters'](_[_0x7d02('0x3d')](_0x1a46cc[_0x7d02('0x34')],_0x43f39a[_0x7d02('0x36')]));_0x4c4b96[_0x7d02('0x3c')][_0x7d02('0x59')]=_0x13d98a['id'];if(_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x3e')]){_0x4c4b96[_0x7d02('0x3c')]=_['merge'](_0x4c4b96['where'],{'$or':_[_0x7d02('0x33')](_0x4c4b96[_0x7d02('0x39')],function(_0x41512a){var _0x1b9c68={};_0x1b9c68[_0x41512a]={'$like':'%'+_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x3e')]+'%'};return _0x1b9c68;})});}_0x4c4b96=_[_0x7d02('0x3f')]({},_0x4c4b96,_0x1a46cc['options']);return db[_0x7d02('0x5c')]['count']({'where':_0x4c4b96[_0x7d02('0x3c')]})[_0x7d02('0x26')](function(_0x420b6d){_0x1ae91e['count']=_0x420b6d;if(_0x1a46cc[_0x7d02('0x34')][_0x7d02('0x55')]){_0x4c4b96['include']=[{'all':!![]}];}return db[_0x7d02('0x5c')]['findAll'](_0x4c4b96);})[_0x7d02('0x26')](function(_0x36d8f2){_0x1ae91e[_0x7d02('0x43')]=_0x36d8f2;return _0x1ae91e;});}})[_0x7d02('0x26')](respondWithFilteredResult(_0x30cb68,_0x4c4b96))[_0x7d02('0x44')](handleError(_0x30cb68,null));};function char(_0x454f97){return'number'===typeof _0x454f97?String[_0x7d02('0x5d')][_0x7d02('0x22')](null,arguments):_0x454f97;}function needsEncapsulation(_0x22f3e8){return!!_0x22f3e8&&(_0x22f3e8[_0x7d02('0x5e')]()[_0x7d02('0x5f')](char(0xd))>=0x0||_0x22f3e8[_0x7d02('0x5e')]()[_0x7d02('0x5f')](char(0xa))>=0x0||_0x22f3e8[_0x7d02('0x5e')]()[_0x7d02('0x5f')](char(0x2c))>=0x0||_0x22f3e8[_0x7d02('0x5e')]()[_0x7d02('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x23a74a){var _0x5e29a4=char(0x22),_0x2db993='\x5c'+char(0x22),_0x1862b8=_0x23a74a[_0x7d02('0x5e')]()[_0x7d02('0x60')](new RegExp(_0x5e29a4,'g'),_0x2db993);return _0x5e29a4+_0x1862b8+_0x5e29a4;}exports[_0x7d02('0x61')]=function(_0x48c7b2,_0x49f8ae,_0x349406){var _0x251024,_0x3dfce0;var _0x236f01={'where':{'ProjectId':_0x48c7b2[_0x7d02('0x51')]['id']}};if(_0x48c7b2[_0x7d02('0x34')]['startTime']){_0x236f01['where'][_0x7d02('0x62')]=JSON['parse'](_0x48c7b2[_0x7d02('0x34')][_0x7d02('0x63')]);}return db[_0x7d02('0x58')][_0x7d02('0x42')](_0x236f01)[_0x7d02('0x26')](handleEntityNotFound(_0x49f8ae,null))['then'](function(_0x11717e){if(_0x11717e){_0x251024=_0x11717e;return db[_0x7d02('0x64')][_0x7d02('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x251024,'id')},'ProjectId':_0x48c7b2[_0x7d02('0x51')]['id']},'order':_0x7d02('0x65')});}})[_0x7d02('0x26')](handleEntityNotFound(_0x49f8ae,null))[_0x7d02('0x26')](function(_0x384328){if(_0x384328){_0x3dfce0=_0x384328;var _0x495f81={};for(var _0x2a3dc7=0x0,_0x59a69a=_0x3dfce0[_0x7d02('0x45')];_0x2a3dc7<_0x59a69a;_0x2a3dc7++){if(!_0x495f81[_0x7d02('0x66')](_0x3dfce0[_0x2a3dc7][_0x7d02('0x67')])){_0x495f81[_0x3dfce0[_0x2a3dc7][_0x7d02('0x67')]]=needsEncapsulation(_0x3dfce0[_0x2a3dc7][_0x7d02('0x68')])?encapsulate(_0x3dfce0[_0x2a3dc7]['question']):_0x3dfce0[_0x2a3dc7][_0x7d02('0x68')];}}var _0x3bb9ca=[],_0x9e4d60={};for(var _0x16dc21=0x0,_0x285c61=_0x251024['length'];_0x16dc21<_0x285c61;_0x16dc21++){_0x9e4d60={'ProjectId':_0x48c7b2[_0x7d02('0x51')]['id'],'SessionId':_0x251024[_0x16dc21]['id'],'StartTime':moment(_0x251024[_0x16dc21][_0x7d02('0x62')])[_0x7d02('0x69')](_0x7d02('0x6a'))};for(var _0x127acb=0x0,_0x1e94bb=_0x3dfce0['length'];_0x127acb<_0x1e94bb;_0x127acb++){if(_0x3dfce0[_0x127acb][_0x7d02('0x6b')]==_0x251024[_0x16dc21]['id']&&_0x495f81[_0x7d02('0x66')](_0x3dfce0[_0x127acb]['questionId'])){_0x9e4d60[_0x495f81[_0x3dfce0[_0x127acb][_0x7d02('0x67')]]]=_0x3dfce0[_0x127acb][_0x7d02('0x6c')];}}for(var _0x37ad9c in _0x495f81){if(!_0x9e4d60[_0x7d02('0x66')](_0x495f81[_0x37ad9c])){_0x9e4d60[_0x495f81[_0x37ad9c]]=null;}}_0x3bb9ca[_0x7d02('0x6d')](_0x9e4d60);}return _0x3bb9ca;}})[_0x7d02('0x26')](function(_0x19b32e){if(!_['isEmpty'](_0x19b32e)){var _0x3b9b33=toCsv(_0x19b32e);var _0x2c0aff=Date[_0x7d02('0x6e')]();fs['writeFileSync'](util[_0x7d02('0x69')](_0x7d02('0x6f'),_0x48c7b2[_0x7d02('0x51')]['id'],_0x2c0aff),_0x3b9b33);_0x49f8ae[_0x7d02('0x70')](_0x7d02('0x71'),_0x7d02('0x72')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x48c7b2[_0x7d02('0x51')]['id'],_0x2c0aff));_0x49f8ae[_0x7d02('0x70')](_0x7d02('0x73'),'text/csv');return _0x49f8ae[_0x7d02('0x74')](util[_0x7d02('0x69')](_0x7d02('0x6f'),_0x48c7b2[_0x7d02('0x51')]['id'],_0x2c0aff));}else{return _0x49f8ae['sendStatus'](0xcc);}})[_0x7d02('0x44')](handleError(_0x49f8ae,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9c94166..1b2b362 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 _0xa1db=['request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x3c1c30,_0x4293e2){var _0x5ea3d4=function(_0x2f8468){while(--_0x2f8468){_0x3c1c30['push'](_0x3c1c30['shift']());}};_0x5ea3d4(++_0x4293e2);}(_0xa1db,0xb0));var _0xba1d=function(_0xede44e,_0x2540de){_0xede44e=_0xede44e-0x0;var _0x36367b=_0xa1db[_0xede44e];return _0x36367b;};'use strict';var _=require(_0xba1d('0x0'));var util=require(_0xba1d('0x1'));var logger=require(_0xba1d('0x2'))(_0xba1d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba1d('0x4'));var fs=require('fs');var path=require(_0xba1d('0x5'));var rimraf=require('rimraf');var config=require(_0xba1d('0x6'));var attributes=require(_0xba1d('0x7'));module[_0xba1d('0x8')]=function(_0xf79440,_0xea5887){return _0xf79440[_0xba1d('0x9')](_0xba1d('0xa'),attributes,{'tableName':_0xba1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4dc=['util','moment','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa4dc,0x16a));var _0xca4d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa4dc[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca4d('0x2'));var BPromise=require(_0xca4d('0x3'));var rp=require(_0xca4d('0x4'));var fs=require('fs');var path=require(_0xca4d('0x5'));var rimraf=require(_0xca4d('0x6'));var config=require('../../config/environment');var attributes=require(_0xca4d('0x7'));module[_0xca4d('0x8')]=function(_0x1b60f4,_0x51470b){return _0x1b60f4[_0xca4d('0x9')]('JscriptyProject',attributes,{'tableName':_0xca4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 53b79ac..cd8b3e1 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xc92a77,_0x397b9d){var _0x5e2e7f=function(_0x245f35){while(--_0x245f35){_0xc92a77['push'](_0xc92a77['shift']());}};_0x5e2e7f(++_0x397b9d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xaa88,0x137));var _0x8aa8=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xaa88[_0x466247];return _0x4b352e;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0bff5a9..4098fd8 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 _0x4a9c=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x25a45a,_0x156e4b){var _0x237f87=function(_0x17c9e5){while(--_0x17c9e5){_0x25a45a['push'](_0x25a45a['shift']());}};_0x237f87(++_0x156e4b);}(_0x4a9c,0x12d));var _0xc4a9=function(_0x5c50bf,_0x28aed8){_0x5c50bf=_0x5c50bf-0x0;var _0x4ac779=_0x4a9c[_0x5c50bf];return _0x4ac779;};'use strict';var multer=require('multer');var util=require(_0xc4a9('0x0'));var path=require('path');var timeout=require(_0xc4a9('0x1'));var express=require(_0xc4a9('0x2'));var router=express[_0xc4a9('0x3')]();var fs_extra=require(_0xc4a9('0x4'));var auth=require(_0xc4a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc4a9('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0xc4a9('0x7')]('/',auth[_0xc4a9('0x8')](),controller['index']);router[_0xc4a9('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xc4a9('0x9')]);router[_0xc4a9('0x7')]('/:id',auth[_0xc4a9('0x8')](),controller[_0xc4a9('0xa')]);router[_0xc4a9('0xb')]('/',auth['isAuthenticated'](),controller[_0xc4a9('0xc')]);router[_0xc4a9('0xd')](_0xc4a9('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc4a9('0xf')](_0xc4a9('0xe'),auth[_0xc4a9('0x8')](),controller[_0xc4a9('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4e48=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e48,0x79));var _0x84e4=function(_0x439a5a,_0x2a8d15){_0x439a5a=_0x439a5a-0x0;var _0x3beea6=_0x4e48[_0x439a5a];return _0x3beea6;};'use strict';var multer=require(_0x84e4('0x0'));var util=require(_0x84e4('0x1'));var path=require(_0x84e4('0x2'));var timeout=require(_0x84e4('0x3'));var express=require('express');var router=express[_0x84e4('0x4')]();var fs_extra=require(_0x84e4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x84e4('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x84e4('0x7')]('/',auth[_0x84e4('0x8')](),controller[_0x84e4('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x84e4('0xa')]);router[_0x84e4('0x7')](_0x84e4('0xb'),auth[_0x84e4('0x8')](),controller[_0x84e4('0xc')]);router[_0x84e4('0xd')]('/',auth[_0x84e4('0x8')](),controller['create']);router['put'](_0x84e4('0xb'),auth[_0x84e4('0x8')](),controller[_0x84e4('0xe')]);router[_0x84e4('0xf')]('/:id',auth[_0x84e4('0x8')](),controller[_0x84e4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 771e674..7da187b 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x2c4386,_0x5cc497){_0x2c4386=_0x2c4386-0x0;var _0x2e4a39=_0x7a54[_0x2c4386];return _0x2e4a39;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x5cfd44,_0xe1cc99){_0x5cfd44=_0x5cfd44-0x0;var _0x111d96=_0x7a54[_0x5cfd44];return _0x111d96;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 1e86b19..e04eb8a 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 _0xae43=['filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xae43,0x13c));var _0x3ae4=function(_0x14b4b2,_0x42aed0){_0x14b4b2=_0x14b4b2-0x0;var _0x2710fd=_0xae43[_0x14b4b2];return _0x2710fd;};'use strict';var emlformat=require(_0x3ae4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ae4('0x1'));var rp=require('request-promise');var moment=require(_0x3ae4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3ae4('0x3'));var util=require(_0x3ae4('0x4'));var path=require(_0x3ae4('0x5'));var sox=require(_0x3ae4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ae4('0x7'));var _=require(_0x3ae4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ae4('0x9'));var deskjs=require(_0x3ae4('0xa'));var toCsv=require(_0x3ae4('0xb'));var querystring=require(_0x3ae4('0xc'));var Papa=require('papaparse');var Redis=require(_0x3ae4('0xd'));var authService=require(_0x3ae4('0xe'));var qs=require(_0x3ae4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ae4('0x10'));var logger=require(_0x3ae4('0x11'))('api');var utils=require(_0x3ae4('0x12'));var config=require(_0x3ae4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ae4('0x14'))['db'];function respondWithStatusCode(_0x2a5843,_0x1cf3fe){_0x1cf3fe=_0x1cf3fe||0xcc;return function(_0x52bf32){if(_0x52bf32){return _0x2a5843[_0x3ae4('0x15')](_0x1cf3fe);}return _0x2a5843[_0x3ae4('0x16')](_0x1cf3fe)['end']();};}function respondWithResult(_0x36d3bb,_0x41d523){_0x41d523=_0x41d523||0xc8;return function(_0x2f1e4f){if(_0x2f1e4f){return _0x36d3bb['status'](_0x41d523)[_0x3ae4('0x17')](_0x2f1e4f);}};}function respondWithFilteredResult(_0x1b9e1e,_0x5627cc){return function(_0x230166){if(_0x230166){var _0x1b0483=typeof _0x5627cc[_0x3ae4('0x18')]==='undefined'&&typeof _0x5627cc[_0x3ae4('0x19')]===_0x3ae4('0x1a');var _0x720651=_0x230166['count'];var _0x1ad5a3=_0x1b0483?0x0:_0x5627cc[_0x3ae4('0x18')];var _0x539830=_0x1b0483?_0x230166[_0x3ae4('0x1b')]:_0x5627cc[_0x3ae4('0x18')]+_0x5627cc[_0x3ae4('0x19')];var _0x503e28;if(_0x539830>=_0x720651){_0x539830=_0x720651;_0x503e28=0xc8;}else{_0x503e28=0xce;}_0x1b9e1e[_0x3ae4('0x16')](_0x503e28);return _0x1b9e1e[_0x3ae4('0x1c')](_0x3ae4('0x1d'),_0x1ad5a3+'-'+_0x539830+'/'+_0x720651)[_0x3ae4('0x17')](_0x230166);}return null;};}function patchUpdates(_0x189282){return function(_0x36e79e){try{jsonpatch[_0x3ae4('0x1e')](_0x36e79e,_0x189282,!![]);}catch(_0x47aef9){return BPromise[_0x3ae4('0x1f')](_0x47aef9);}return _0x36e79e[_0x3ae4('0x20')]();};}function saveUpdates(_0x55ba6,_0x7618b3){return function(_0x597077){if(_0x597077){return _0x597077[_0x3ae4('0x21')](_0x55ba6)[_0x3ae4('0x22')](function(_0x607680){return _0x607680;});}return null;};}function removeEntity(_0x3a3d2a,_0xc1d739){return function(_0x3e80f5){if(_0x3e80f5){return _0x3e80f5[_0x3ae4('0x23')]()[_0x3ae4('0x22')](function(){_0x3a3d2a['status'](0xcc)[_0x3ae4('0x24')]();});}};}function handleEntityNotFound(_0x4afdcd,_0x5c7da7){return function(_0x1de5ad){if(!_0x1de5ad){_0x4afdcd[_0x3ae4('0x15')](0x194);}return _0x1de5ad;};}function handleError(_0x2c4675,_0x18f79c){_0x18f79c=_0x18f79c||0x1f4;return function(_0x589362){logger[_0x3ae4('0x25')](_0x589362[_0x3ae4('0x26')]);if(_0x589362[_0x3ae4('0x27')]){delete _0x589362[_0x3ae4('0x27')];}_0x2c4675[_0x3ae4('0x16')](_0x18f79c)[_0x3ae4('0x28')](_0x589362);};}exports[_0x3ae4('0x29')]=function(_0x5d54ae,_0x2db7b3){var _0x3e9377={},_0x40a761={},_0x4b33d5={'count':0x0,'rows':[]};var _0x477a65=_[_0x3ae4('0x2a')](db[_0x3ae4('0x2b')][_0x3ae4('0x2c')],function(_0x5611c1){return{'name':_0x5611c1[_0x3ae4('0x2d')],'type':_0x5611c1[_0x3ae4('0x2e')][_0x3ae4('0x2f')]};});_0x40a761[_0x3ae4('0x30')]=_[_0x3ae4('0x2a')](_0x477a65,'name');_0x40a761[_0x3ae4('0x31')]=_['keys'](_0x5d54ae[_0x3ae4('0x31')]);_0x40a761[_0x3ae4('0x32')]=_[_0x3ae4('0x33')](_0x40a761[_0x3ae4('0x30')],_0x40a761[_0x3ae4('0x31')]);_0x3e9377['attributes']=_[_0x3ae4('0x33')](_0x40a761[_0x3ae4('0x30')],qs[_0x3ae4('0x34')](_0x5d54ae[_0x3ae4('0x31')][_0x3ae4('0x34')]));_0x3e9377[_0x3ae4('0x35')]=_0x3e9377[_0x3ae4('0x35')]['length']?_0x3e9377[_0x3ae4('0x35')]:_0x40a761['model'];if(!_0x5d54ae[_0x3ae4('0x31')][_0x3ae4('0x36')](_0x3ae4('0x37'))){_0x3e9377[_0x3ae4('0x19')]=qs['limit'](_0x5d54ae[_0x3ae4('0x31')][_0x3ae4('0x19')]);_0x3e9377[_0x3ae4('0x18')]=qs['offset'](_0x5d54ae[_0x3ae4('0x31')][_0x3ae4('0x18')]);}_0x3e9377['order']=qs[_0x3ae4('0x38')](_0x5d54ae['query'][_0x3ae4('0x38')]);_0x3e9377[_0x3ae4('0x39')]=qs[_0x3ae4('0x32')](_[_0x3ae4('0x3a')](_0x5d54ae[_0x3ae4('0x31')],_0x40a761['filters']),_0x477a65);if(_0x5d54ae['query'][_0x3ae4('0x3b')]){_0x3e9377[_0x3ae4('0x39')]=_[_0x3ae4('0x3c')](_0x3e9377[_0x3ae4('0x39')],{'$or':_['map'](_0x477a65,function(_0x4f141c){if(_0x4f141c[_0x3ae4('0x2e')]!==_0x3ae4('0x3d')){var _0x163f06={};_0x163f06[_0x4f141c[_0x3ae4('0x27')]]={'$like':'%'+_0x5d54ae[_0x3ae4('0x31')][_0x3ae4('0x3b')]+'%'};return _0x163f06;}})});}_0x3e9377=_[_0x3ae4('0x3c')]({},_0x3e9377,_0x5d54ae[_0x3ae4('0x3e')]);var _0x544483={'where':_0x3e9377['where']};return db[_0x3ae4('0x2b')][_0x3ae4('0x1b')](_0x544483)['then'](function(_0x5d3425){_0x4b33d5['count']=_0x5d3425;if(_0x5d54ae[_0x3ae4('0x31')]['includeAll']){_0x3e9377[_0x3ae4('0x3f')]=[{'all':!![]}];}return db[_0x3ae4('0x2b')][_0x3ae4('0x40')](_0x3e9377);})[_0x3ae4('0x22')](function(_0x1e8f1a){_0x4b33d5[_0x3ae4('0x41')]=_0x1e8f1a;return _0x4b33d5;})[_0x3ae4('0x22')](respondWithFilteredResult(_0x2db7b3,_0x3e9377))[_0x3ae4('0x42')](handleError(_0x2db7b3,null));};exports[_0x3ae4('0x43')]=function(_0x55cb1d,_0x521e49){var _0x987ab7={'raw':!![],'where':{'id':_0x55cb1d['params']['id']}},_0x1081aa={};_0x1081aa[_0x3ae4('0x30')]=_['keys'](db[_0x3ae4('0x2b')][_0x3ae4('0x2c')]);_0x1081aa['query']=_[_0x3ae4('0x44')](_0x55cb1d[_0x3ae4('0x31')]);_0x1081aa[_0x3ae4('0x32')]=_[_0x3ae4('0x33')](_0x1081aa['model'],_0x1081aa[_0x3ae4('0x31')]);_0x987ab7['attributes']=_[_0x3ae4('0x33')](_0x1081aa[_0x3ae4('0x30')],qs[_0x3ae4('0x34')](_0x55cb1d[_0x3ae4('0x31')][_0x3ae4('0x34')]));_0x987ab7[_0x3ae4('0x35')]=_0x987ab7[_0x3ae4('0x35')]['length']?_0x987ab7[_0x3ae4('0x35')]:_0x1081aa[_0x3ae4('0x30')];if(_0x55cb1d[_0x3ae4('0x31')][_0x3ae4('0x45')]){_0x987ab7[_0x3ae4('0x3f')]=[{'all':!![]}];}_0x987ab7=_[_0x3ae4('0x3c')]({},_0x987ab7,_0x55cb1d[_0x3ae4('0x3e')]);return db['JscriptyQuestionReport'][_0x3ae4('0x46')](_0x987ab7)['then'](handleEntityNotFound(_0x521e49,null))['then'](respondWithResult(_0x521e49,null))['catch'](handleError(_0x521e49,null));};exports[_0x3ae4('0x47')]=function(_0x1eb3ef,_0x5dbfff){return db[_0x3ae4('0x2b')][_0x3ae4('0x47')](_0x1eb3ef[_0x3ae4('0x48')],{})[_0x3ae4('0x22')](respondWithResult(_0x5dbfff,0xc9))[_0x3ae4('0x42')](handleError(_0x5dbfff,null));};exports[_0x3ae4('0x21')]=function(_0x46ab27,_0xce7d8b){if(_0x46ab27[_0x3ae4('0x48')]['id']){delete _0x46ab27[_0x3ae4('0x48')]['id'];}return db[_0x3ae4('0x2b')][_0x3ae4('0x46')]({'where':{'id':_0x46ab27['params']['id']}})[_0x3ae4('0x22')](handleEntityNotFound(_0xce7d8b,null))[_0x3ae4('0x22')](saveUpdates(_0x46ab27[_0x3ae4('0x48')],null))[_0x3ae4('0x22')](respondWithResult(_0xce7d8b,null))['catch'](handleError(_0xce7d8b,null));};exports['destroy']=function(_0x318747,_0x475c54){return db[_0x3ae4('0x2b')][_0x3ae4('0x46')]({'where':{'id':_0x318747[_0x3ae4('0x49')]['id']}})[_0x3ae4('0x22')](handleEntityNotFound(_0x475c54,null))[_0x3ae4('0x22')](removeEntity(_0x475c54,null))[_0x3ae4('0x42')](handleError(_0x475c54,null));};exports['describe']=function(_0x40c4ff,_0x2fa6d7){return db['JscriptyQuestionReport'][_0x3ae4('0x4a')]()['then'](respondWithResult(_0x2fa6d7,null))[_0x3ae4('0x42')](handleError(_0x2fa6d7,null));}; \ No newline at end of file +var _0x679b=['bluebird','mustache','util','path','sox','to-csv','ejs','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','undefined','limit','offset','count','set','Content-Range','reject','save','then','error','stack','name','send','index','rawAttributes','fieldName','map','keys','query','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','JscriptyQuestionReport','findAll','rows','catch','show','params','intersection','includeAll','include','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x679b,0xeb));var _0xb679=function(_0x11ed71,_0xc0f4bb){_0x11ed71=_0x11ed71-0x0;var _0x5c3d61=_0x679b[_0x11ed71];return _0x5c3d61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb679('0x0'));var zipdir=require(_0xb679('0x1'));var jsonpatch=require(_0xb679('0x2'));var rp=require(_0xb679('0x3'));var moment=require(_0xb679('0x4'));var BPromise=require(_0xb679('0x5'));var Mustache=require(_0xb679('0x6'));var util=require(_0xb679('0x7'));var path=require(_0xb679('0x8'));var sox=require(_0xb679('0x9'));var csv=require(_0xb679('0xa'));var ejs=require(_0xb679('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb679('0xc'));var crypto=require(_0xb679('0xd'));var jsforce=require(_0xb679('0xe'));var deskjs=require(_0xb679('0xf'));var toCsv=require(_0xb679('0xa'));var querystring=require('querystring');var Papa=require(_0xb679('0x10'));var Redis=require(_0xb679('0x11'));var authService=require(_0xb679('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb679('0x13'));var hardwareService=require(_0xb679('0x14'));var logger=require(_0xb679('0x15'))(_0xb679('0x16'));var utils=require(_0xb679('0x17'));var config=require(_0xb679('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb679('0x19'))['db'];function respondWithStatusCode(_0x218cb6,_0x1719cb){_0x1719cb=_0x1719cb||0xcc;return function(_0x31c9db){if(_0x31c9db){return _0x218cb6[_0xb679('0x1a')](_0x1719cb);}return _0x218cb6[_0xb679('0x1b')](_0x1719cb)[_0xb679('0x1c')]();};}function respondWithResult(_0x32695d,_0x3c1cbb){_0x3c1cbb=_0x3c1cbb||0xc8;return function(_0x107d45){if(_0x107d45){return _0x32695d[_0xb679('0x1b')](_0x3c1cbb)[_0xb679('0x1d')](_0x107d45);}};}function respondWithFilteredResult(_0x5349f8,_0x2f4add){return function(_0x331a27){if(_0x331a27){var _0x3daa53=typeof _0x2f4add['offset']===_0xb679('0x1e')&&typeof _0x2f4add[_0xb679('0x1f')]==='undefined';var _0x4c8446=_0x331a27['count'];var _0x3793d6=_0x3daa53?0x0:_0x2f4add[_0xb679('0x20')];var _0x4fc4cb=_0x3daa53?_0x331a27[_0xb679('0x21')]:_0x2f4add['offset']+_0x2f4add[_0xb679('0x1f')];var _0x2137a8;if(_0x4fc4cb>=_0x4c8446){_0x4fc4cb=_0x4c8446;_0x2137a8=0xc8;}else{_0x2137a8=0xce;}_0x5349f8[_0xb679('0x1b')](_0x2137a8);return _0x5349f8[_0xb679('0x22')](_0xb679('0x23'),_0x3793d6+'-'+_0x4fc4cb+'/'+_0x4c8446)['json'](_0x331a27);}return null;};}function patchUpdates(_0x1eaf5c){return function(_0x441b75){try{jsonpatch['apply'](_0x441b75,_0x1eaf5c,!![]);}catch(_0x5bc144){return BPromise[_0xb679('0x24')](_0x5bc144);}return _0x441b75[_0xb679('0x25')]();};}function saveUpdates(_0xd5aba8,_0x2939df){return function(_0x4048d9){if(_0x4048d9){return _0x4048d9['update'](_0xd5aba8)['then'](function(_0x371c73){return _0x371c73;});}return null;};}function removeEntity(_0x44a957,_0x277f22){return function(_0x5aef97){if(_0x5aef97){return _0x5aef97['destroy']()[_0xb679('0x26')](function(){_0x44a957[_0xb679('0x1b')](0xcc)[_0xb679('0x1c')]();});}};}function handleEntityNotFound(_0x2d71f7,_0x59cb25){return function(_0x6a5498){if(!_0x6a5498){_0x2d71f7[_0xb679('0x1a')](0x194);}return _0x6a5498;};}function handleError(_0x58bf4c,_0x40d7fb){_0x40d7fb=_0x40d7fb||0x1f4;return function(_0x54d1cd){logger[_0xb679('0x27')](_0x54d1cd[_0xb679('0x28')]);if(_0x54d1cd[_0xb679('0x29')]){delete _0x54d1cd[_0xb679('0x29')];}_0x58bf4c[_0xb679('0x1b')](_0x40d7fb)[_0xb679('0x2a')](_0x54d1cd);};}exports[_0xb679('0x2b')]=function(_0x43505e,_0x2a190e){var _0x3fb93e={},_0x447fb5={},_0x1bafb5={'count':0x0,'rows':[]};var _0x4c08c8=_['map'](db['JscriptyQuestionReport'][_0xb679('0x2c')],function(_0x3fa67b){return{'name':_0x3fa67b[_0xb679('0x2d')],'type':_0x3fa67b['type']['key']};});_0x447fb5['model']=_[_0xb679('0x2e')](_0x4c08c8,_0xb679('0x29'));_0x447fb5['query']=_[_0xb679('0x2f')](_0x43505e[_0xb679('0x30')]);_0x447fb5['filters']=_['intersection'](_0x447fb5['model'],_0x447fb5[_0xb679('0x30')]);_0x3fb93e['attributes']=_['intersection'](_0x447fb5['model'],qs[_0xb679('0x31')](_0x43505e['query']['fields']));_0x3fb93e[_0xb679('0x32')]=_0x3fb93e['attributes'][_0xb679('0x33')]?_0x3fb93e[_0xb679('0x32')]:_0x447fb5[_0xb679('0x34')];if(!_0x43505e[_0xb679('0x30')][_0xb679('0x35')](_0xb679('0x36'))){_0x3fb93e['limit']=qs[_0xb679('0x1f')](_0x43505e[_0xb679('0x30')][_0xb679('0x1f')]);_0x3fb93e[_0xb679('0x20')]=qs[_0xb679('0x20')](_0x43505e[_0xb679('0x30')][_0xb679('0x20')]);}_0x3fb93e[_0xb679('0x37')]=qs['sort'](_0x43505e[_0xb679('0x30')][_0xb679('0x38')]);_0x3fb93e[_0xb679('0x39')]=qs[_0xb679('0x3a')](_[_0xb679('0x3b')](_0x43505e[_0xb679('0x30')],_0x447fb5[_0xb679('0x3a')]),_0x4c08c8);if(_0x43505e[_0xb679('0x30')]['filter']){_0x3fb93e[_0xb679('0x39')]=_[_0xb679('0x3c')](_0x3fb93e[_0xb679('0x39')],{'$or':_['map'](_0x4c08c8,function(_0x27bc56){if(_0x27bc56[_0xb679('0x3d')]!==_0xb679('0x3e')){var _0x591235={};_0x591235[_0x27bc56['name']]={'$like':'%'+_0x43505e[_0xb679('0x30')][_0xb679('0x3f')]+'%'};return _0x591235;}})});}_0x3fb93e=_[_0xb679('0x3c')]({},_0x3fb93e,_0x43505e[_0xb679('0x40')]);var _0xf2d490={'where':_0x3fb93e['where']};return db[_0xb679('0x41')]['count'](_0xf2d490)[_0xb679('0x26')](function(_0xf65d89){_0x1bafb5['count']=_0xf65d89;if(_0x43505e[_0xb679('0x30')]['includeAll']){_0x3fb93e['include']=[{'all':!![]}];}return db[_0xb679('0x41')][_0xb679('0x42')](_0x3fb93e);})[_0xb679('0x26')](function(_0x279f30){_0x1bafb5[_0xb679('0x43')]=_0x279f30;return _0x1bafb5;})[_0xb679('0x26')](respondWithFilteredResult(_0x2a190e,_0x3fb93e))[_0xb679('0x44')](handleError(_0x2a190e,null));};exports[_0xb679('0x45')]=function(_0x588e15,_0x108b7d){var _0x2b73bb={'raw':!![],'where':{'id':_0x588e15[_0xb679('0x46')]['id']}},_0x959421={};_0x959421['model']=_[_0xb679('0x2f')](db['JscriptyQuestionReport'][_0xb679('0x2c')]);_0x959421[_0xb679('0x30')]=_[_0xb679('0x2f')](_0x588e15[_0xb679('0x30')]);_0x959421[_0xb679('0x3a')]=_[_0xb679('0x47')](_0x959421[_0xb679('0x34')],_0x959421['query']);_0x2b73bb[_0xb679('0x32')]=_[_0xb679('0x47')](_0x959421['model'],qs['fields'](_0x588e15[_0xb679('0x30')][_0xb679('0x31')]));_0x2b73bb['attributes']=_0x2b73bb[_0xb679('0x32')][_0xb679('0x33')]?_0x2b73bb[_0xb679('0x32')]:_0x959421[_0xb679('0x34')];if(_0x588e15['query'][_0xb679('0x48')]){_0x2b73bb[_0xb679('0x49')]=[{'all':!![]}];}_0x2b73bb=_[_0xb679('0x3c')]({},_0x2b73bb,_0x588e15['options']);return db[_0xb679('0x41')][_0xb679('0x4a')](_0x2b73bb)[_0xb679('0x26')](handleEntityNotFound(_0x108b7d,null))[_0xb679('0x26')](respondWithResult(_0x108b7d,null))[_0xb679('0x44')](handleError(_0x108b7d,null));};exports[_0xb679('0x4b')]=function(_0x13a342,_0xea154b){return db[_0xb679('0x41')][_0xb679('0x4b')](_0x13a342[_0xb679('0x4c')],{})[_0xb679('0x26')](respondWithResult(_0xea154b,0xc9))[_0xb679('0x44')](handleError(_0xea154b,null));};exports[_0xb679('0x4d')]=function(_0x4e7d04,_0x42d111){if(_0x4e7d04['body']['id']){delete _0x4e7d04[_0xb679('0x4c')]['id'];}return db[_0xb679('0x41')][_0xb679('0x4a')]({'where':{'id':_0x4e7d04[_0xb679('0x46')]['id']}})[_0xb679('0x26')](handleEntityNotFound(_0x42d111,null))[_0xb679('0x26')](saveUpdates(_0x4e7d04[_0xb679('0x4c')],null))[_0xb679('0x26')](respondWithResult(_0x42d111,null))[_0xb679('0x44')](handleError(_0x42d111,null));};exports[_0xb679('0x4e')]=function(_0x2283f4,_0x53acb2){return db[_0xb679('0x41')][_0xb679('0x4a')]({'where':{'id':_0x2283f4[_0xb679('0x46')]['id']}})[_0xb679('0x26')](handleEntityNotFound(_0x53acb2,null))[_0xb679('0x26')](removeEntity(_0x53acb2,null))[_0xb679('0x44')](handleError(_0x53acb2,null));};exports['describe']=function(_0x22c20d,_0x2a06e5){return db[_0xb679('0x41')][_0xb679('0x4f')]()[_0xb679('0x26')](respondWithResult(_0x2a06e5,null))[_0xb679('0x44')](handleError(_0x2a06e5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index cdb2f05..dbad5e2 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 _0x7bd4=['request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56451a,_0x524421){var _0x269d07=function(_0x353a29){while(--_0x353a29){_0x56451a['push'](_0x56451a['shift']());}};_0x269d07(++_0x524421);}(_0x7bd4,0x1db));var _0x47bd=function(_0x5b8a03,_0x4d9c23){_0x5b8a03=_0x5b8a03-0x0;var _0x208666=_0x7bd4[_0x5b8a03];return _0x208666;};'use strict';var _=require(_0x47bd('0x0'));var util=require(_0x47bd('0x1'));var logger=require(_0x47bd('0x2'))(_0x47bd('0x3'));var moment=require(_0x47bd('0x4'));var BPromise=require(_0x47bd('0x5'));var rp=require(_0x47bd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47bd('0x7'));var config=require(_0x47bd('0x8'));var attributes=require(_0x47bd('0x9'));module[_0x47bd('0xa')]=function(_0x2ed048,_0x2200dc){return _0x2ed048[_0x47bd('0xb')](_0x47bd('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ca9=['./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1bd8ee,_0x5103bc){var _0x2c1da7=function(_0x22e2c2){while(--_0x22e2c2){_0x1bd8ee['push'](_0x1bd8ee['shift']());}};_0x2c1da7(++_0x5103bc);}(_0x4ca9,0x1b2));var _0x94ca=function(_0x5005d9,_0xd47bfb){_0x5005d9=_0x5005d9-0x0;var _0x256e37=_0x4ca9[_0x5005d9];return _0x256e37;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x94ca('0x0'))(_0x94ca('0x1'));var moment=require(_0x94ca('0x2'));var BPromise=require(_0x94ca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94ca('0x4'));var rimraf=require('rimraf');var config=require(_0x94ca('0x5'));var attributes=require(_0x94ca('0x6'));module[_0x94ca('0x7')]=function(_0x3e8d53,_0x37baf2){return _0x3e8d53['define'](_0x94ca('0x8'),attributes,{'tableName':_0x94ca('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 7496cf0..75333eb 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 _0xe7b8=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','moment'];(function(_0x25a644,_0x557ff4){var _0x7e3a9b=function(_0x456ce6){while(--_0x456ce6){_0x25a644['push'](_0x25a644['shift']());}};_0x7e3a9b(++_0x557ff4);}(_0xe7b8,0xb1));var _0x8e7b=function(_0x4c86a3,_0x396595){_0x4c86a3=_0x4c86a3-0x0;var _0x2acd0c=_0xe7b8[_0x4c86a3];return _0x2acd0c;};'use strict';var _=require(_0x8e7b('0x0'));var util=require(_0x8e7b('0x1'));var moment=require(_0x8e7b('0x2'));var BPromise=require(_0x8e7b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e7b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e7b('0x5'));var logger=require(_0x8e7b('0x6'))(_0x8e7b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8e7b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32de79,_0x156975,_0xd221e9){return new BPromise(function(_0xddd254,_0x43d69d){return client[_0x8e7b('0x9')](_0x32de79,_0xd221e9)[_0x8e7b('0xa')](function(_0x39fa85){logger[_0x8e7b('0xb')](_0x8e7b('0xc'),_0x156975,'request\x20sent');logger[_0x8e7b('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x156975,'request\x20sent',JSON[_0x8e7b('0xe')](_0x39fa85));if(_0x39fa85[_0x8e7b('0xf')]){if(_0x39fa85[_0x8e7b('0xf')][_0x8e7b('0x10')]===0x1f4){logger[_0x8e7b('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x156975,_0x39fa85['error'][_0x8e7b('0x11')]);return _0x43d69d(_0x39fa85[_0x8e7b('0xf')][_0x8e7b('0x11')]);}logger[_0x8e7b('0xf')](_0x8e7b('0xc'),_0x156975,_0x39fa85[_0x8e7b('0xf')]['message']);return _0xddd254(_0x39fa85[_0x8e7b('0xf')][_0x8e7b('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x156975,_0x8e7b('0x12'));_0xddd254(_0x39fa85['result']['message']);}})[_0x8e7b('0x13')](function(_0x15536a){logger[_0x8e7b('0xf')](_0x8e7b('0xc'),_0x156975,_0x15536a);_0x43d69d(_0x15536a);});});} \ No newline at end of file +var _0x8e22=['info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4953fd,_0x50f1e5){var _0x273069=function(_0x224e57){while(--_0x224e57){_0x4953fd['push'](_0x4953fd['shift']());}};_0x273069(++_0x50f1e5);}(_0x8e22,0x125));var _0x28e2=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x8e22[_0x337a10];return _0x575f98;};'use strict';var _=require(_0x28e2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x28e2('0x1'));var rs=require(_0x28e2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28e2('0x3'))['db'];var utils=require(_0x28e2('0x4'));var logger=require(_0x28e2('0x5'))(_0x28e2('0x6'));var config=require(_0x28e2('0x7'));var jayson=require(_0x28e2('0x8'));var client=jayson['client'][_0x28e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x538e11,_0x29b88b,_0x19e6a5){return new BPromise(function(_0x42a49e,_0x482c62){return client['request'](_0x538e11,_0x19e6a5)[_0x28e2('0xa')](function(_0x3105ca){logger[_0x28e2('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x29b88b,_0x28e2('0xc'));logger['debug'](_0x28e2('0xd'),_0x29b88b,'request\x20sent',JSON['stringify'](_0x3105ca));if(_0x3105ca[_0x28e2('0xe')]){if(_0x3105ca[_0x28e2('0xe')][_0x28e2('0xf')]===0x1f4){logger[_0x28e2('0xe')](_0x28e2('0x10'),_0x29b88b,_0x3105ca[_0x28e2('0xe')][_0x28e2('0x11')]);return _0x482c62(_0x3105ca[_0x28e2('0xe')][_0x28e2('0x11')]);}logger[_0x28e2('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x29b88b,_0x3105ca['error'][_0x28e2('0x11')]);return _0x42a49e(_0x3105ca['error'][_0x28e2('0x11')]);}else{logger[_0x28e2('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x29b88b,'request\x20sent');_0x42a49e(_0x3105ca[_0x28e2('0x12')][_0x28e2('0x11')]);}})['catch'](function(_0x4639fd){logger[_0x28e2('0xe')](_0x28e2('0x10'),_0x29b88b,_0x4639fd);_0x482c62(_0x4639fd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 3c58836..490bffa 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 _0x5ecc=['get','show','/:id/questions','getQuestions','post','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptySessionReport.controller','isAuthenticated','index','describe'];(function(_0xe37536,_0x1b5e86){var _0x5629a6=function(_0x5f539f){while(--_0x5f539f){_0xe37536['push'](_0xe37536['shift']());}};_0x5629a6(++_0x1b5e86);}(_0x5ecc,0xf1));var _0xc5ec=function(_0x41cc22,_0x45b3e5){_0x41cc22=_0x41cc22-0x0;var _0x1352d4=_0x5ecc[_0x41cc22];return _0x1352d4;};'use strict';var multer=require(_0xc5ec('0x0'));var util=require(_0xc5ec('0x1'));var path=require('path');var timeout=require(_0xc5ec('0x2'));var express=require(_0xc5ec('0x3'));var router=express[_0xc5ec('0x4')]();var fs_extra=require(_0xc5ec('0x5'));var auth=require(_0xc5ec('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5ec('0x7'));router['get']('/',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x9')]);router['get']('/describe',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xa')]);router[_0xc5ec('0xb')]('/:id',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xc')]);router[_0xc5ec('0xb')](_0xc5ec('0xd'),auth[_0xc5ec('0x8')](),controller[_0xc5ec('0xe')]);router[_0xc5ec('0xf')]('/',auth[_0xc5ec('0x8')](),controller['create']);router[_0xc5ec('0x10')](_0xc5ec('0x11'),auth[_0xc5ec('0x8')](),controller['update']);router[_0xc5ec('0x12')]('/:id',auth[_0xc5ec('0x8')](),controller[_0xc5ec('0x13')]);module[_0xc5ec('0x14')]=router; \ No newline at end of file +var _0x26b3=['show','/:id/questions','getQuestions','create','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x48628b,_0x1630a2){var _0x321c91=function(_0x44d655){while(--_0x44d655){_0x48628b['push'](_0x48628b['shift']());}};_0x321c91(++_0x1630a2);}(_0x26b3,0x8c));var _0x326b=function(_0x48de5c,_0x249af4){_0x48de5c=_0x48de5c-0x0;var _0x20cd45=_0x26b3[_0x48de5c];return _0x20cd45;};'use strict';var multer=require(_0x326b('0x0'));var util=require(_0x326b('0x1'));var path=require(_0x326b('0x2'));var timeout=require('connect-timeout');var express=require(_0x326b('0x3'));var router=express[_0x326b('0x4')]();var fs_extra=require(_0x326b('0x5'));var auth=require(_0x326b('0x6'));var interaction=require(_0x326b('0x7'));var config=require('../../config/environment');var controller=require(_0x326b('0x8'));router[_0x326b('0x9')]('/',auth[_0x326b('0xa')](),controller[_0x326b('0xb')]);router[_0x326b('0x9')](_0x326b('0xc'),auth[_0x326b('0xa')](),controller[_0x326b('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x326b('0xe')]);router['get'](_0x326b('0xf'),auth[_0x326b('0xa')](),controller[_0x326b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x326b('0x11')]);router[_0x326b('0x12')](_0x326b('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x326b('0x13'),auth[_0x326b('0xa')](),controller[_0x326b('0x14')]);module[_0x326b('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 188564e..01774cd 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 _0x1600=['sequelize','exports','DATE','setDataValue','endtime','STRING','BOOLEAN','moment'];(function(_0x5f083d,_0x24edd9){var _0x29a0f2=function(_0x1064d9){while(--_0x1064d9){_0x5f083d['push'](_0x5f083d['shift']());}};_0x29a0f2(++_0x24edd9);}(_0x1600,0x1df));var _0x0160=function(_0x4f82cf,_0x536048){_0x4f82cf=_0x4f82cf-0x0;var _0x154cf6=_0x1600[_0x4f82cf];return _0x154cf6;};'use strict';var moment=require(_0x0160('0x0'));var Sequelize=require(_0x0160('0x1'));module[_0x0160('0x2')]={'starttime':{'type':Sequelize[_0x0160('0x3')],'set':function(_0x2c5e69){this[_0x0160('0x4')]('starttime',_0x2c5e69);this['setDataValue'](_0x0160('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x0160('0x6')]},'projectname':{'type':Sequelize[_0x0160('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0160('0x6')]},'calleridname':{'type':Sequelize[_0x0160('0x6')]},'calleridnum':{'type':Sequelize[_0x0160('0x6')]},'completed':{'type':Sequelize[_0x0160('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c21=['moment','sequelize','exports','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x3c21,0x17c));var _0x13c2=function(_0x2f64f7,_0xacfd09){_0x2f64f7=_0x2f64f7-0x0;var _0x3565a2=_0x3c21[_0x2f64f7];return _0x3565a2;};'use strict';var moment=require(_0x13c2('0x0'));var Sequelize=require(_0x13c2('0x1'));module[_0x13c2('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x491f9c){this[_0x13c2('0x3')](_0x13c2('0x4'),_0x491f9c);this['setDataValue']('endtime',moment()[_0x13c2('0x5')](_0x13c2('0x6')));}},'endtime':{'type':Sequelize[_0x13c2('0x7')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x13c2('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x13c2('0x8')]},'calleridnum':{'type':Sequelize[_0x13c2('0x8')]},'completed':{'type':Sequelize[_0x13c2('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 ae46e4c..b32e372 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 _0xbcc3=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','JscriptySessionReport','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','getQuestions','findOne','limit','order','SessionId','options','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbcc3,0x1d3));var _0x3bcc=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0xbcc3[_0x15ec4e];return _0xb5e5dd;};'use strict';var emlformat=require(_0x3bcc('0x0'));var rimraf=require(_0x3bcc('0x1'));var zipdir=require(_0x3bcc('0x2'));var jsonpatch=require(_0x3bcc('0x3'));var rp=require(_0x3bcc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3bcc('0x5'));var util=require(_0x3bcc('0x6'));var path=require('path');var sox=require(_0x3bcc('0x7'));var csv=require('to-csv');var ejs=require(_0x3bcc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3bcc('0x9'));var crypto=require(_0x3bcc('0xa'));var jsforce=require(_0x3bcc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3bcc('0xc'));var querystring=require(_0x3bcc('0xd'));var Papa=require(_0x3bcc('0xe'));var Redis=require(_0x3bcc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3bcc('0x10'));var as=require(_0x3bcc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3bcc('0x12'))('api');var utils=require(_0x3bcc('0x13'));var config=require(_0x3bcc('0x14'));var licenseUtil=require(_0x3bcc('0x15'));var db=require(_0x3bcc('0x16'))['db'];function respondWithStatusCode(_0xcb957b,_0x231040){_0x231040=_0x231040||0xcc;return function(_0x28501b){if(_0x28501b){return _0xcb957b[_0x3bcc('0x17')](_0x231040);}return _0xcb957b[_0x3bcc('0x18')](_0x231040)[_0x3bcc('0x19')]();};}function respondWithResult(_0x2b77a1,_0x51c6f8){_0x51c6f8=_0x51c6f8||0xc8;return function(_0x1d312e){if(_0x1d312e){return _0x2b77a1[_0x3bcc('0x18')](_0x51c6f8)[_0x3bcc('0x1a')](_0x1d312e);}};}function respondWithFilteredResult(_0x276b31,_0x526084){return function(_0x37eee9){if(_0x37eee9){var _0x4a78b5=typeof _0x526084['offset']==='undefined'&&typeof _0x526084['limit']===_0x3bcc('0x1b');var _0x389146=_0x37eee9['count'];var _0x590283=_0x4a78b5?0x0:_0x526084[_0x3bcc('0x1c')];var _0x161591=_0x4a78b5?_0x37eee9[_0x3bcc('0x1d')]:_0x526084['offset']+_0x526084['limit'];var _0x238aa1;if(_0x161591>=_0x389146){_0x161591=_0x389146;_0x238aa1=0xc8;}else{_0x238aa1=0xce;}_0x276b31['status'](_0x238aa1);return _0x276b31[_0x3bcc('0x1e')](_0x3bcc('0x1f'),_0x590283+'-'+_0x161591+'/'+_0x389146)[_0x3bcc('0x1a')](_0x37eee9);}return null;};}function patchUpdates(_0xfceb44){return function(_0x562797){try{jsonpatch[_0x3bcc('0x20')](_0x562797,_0xfceb44,!![]);}catch(_0x29adf6){return BPromise['reject'](_0x29adf6);}return _0x562797[_0x3bcc('0x21')]();};}function saveUpdates(_0x3529bb,_0x5d10cc){return function(_0x2aaeb2){if(_0x2aaeb2){return _0x2aaeb2[_0x3bcc('0x22')](_0x3529bb)[_0x3bcc('0x23')](function(_0x22e8e7){return _0x22e8e7;});}return null;};}function removeEntity(_0xb7891d,_0x365c07){return function(_0x5a5353){if(_0x5a5353){return _0x5a5353[_0x3bcc('0x24')]()[_0x3bcc('0x23')](function(){_0xb7891d['status'](0xcc)[_0x3bcc('0x19')]();});}};}function handleEntityNotFound(_0x452cbc,_0x41fd28){return function(_0x18fe56){if(!_0x18fe56){_0x452cbc['sendStatus'](0x194);}return _0x18fe56;};}function handleError(_0x228ad0,_0x27c785){_0x27c785=_0x27c785||0x1f4;return function(_0x184c74){logger['error'](_0x184c74[_0x3bcc('0x25')]);if(_0x184c74['name']){delete _0x184c74[_0x3bcc('0x26')];}_0x228ad0[_0x3bcc('0x18')](_0x27c785)[_0x3bcc('0x27')](_0x184c74);};}exports['index']=function(_0x27ba7d,_0x4b8bb3){var _0x206cc5={},_0x532ac4={},_0x4ee176={'count':0x0,'rows':[]};var _0x510d52=_['map'](db[_0x3bcc('0x28')]['rawAttributes'],function(_0x42b790){return{'name':_0x42b790[_0x3bcc('0x29')],'type':_0x42b790['type'][_0x3bcc('0x2a')]};});_0x532ac4[_0x3bcc('0x2b')]=_[_0x3bcc('0x2c')](_0x510d52,_0x3bcc('0x26'));_0x532ac4[_0x3bcc('0x2d')]=_[_0x3bcc('0x2e')](_0x27ba7d[_0x3bcc('0x2d')]);_0x532ac4[_0x3bcc('0x2f')]=_['intersection'](_0x532ac4[_0x3bcc('0x2b')],_0x532ac4[_0x3bcc('0x2d')]);_0x206cc5[_0x3bcc('0x30')]=_[_0x3bcc('0x31')](_0x532ac4[_0x3bcc('0x2b')],qs[_0x3bcc('0x32')](_0x27ba7d[_0x3bcc('0x2d')][_0x3bcc('0x32')]));_0x206cc5[_0x3bcc('0x30')]=_0x206cc5[_0x3bcc('0x30')][_0x3bcc('0x33')]?_0x206cc5[_0x3bcc('0x30')]:_0x532ac4['model'];if(!_0x27ba7d['query'][_0x3bcc('0x34')](_0x3bcc('0x35'))){_0x206cc5['limit']=qs['limit'](_0x27ba7d[_0x3bcc('0x2d')]['limit']);_0x206cc5['offset']=qs[_0x3bcc('0x1c')](_0x27ba7d[_0x3bcc('0x2d')][_0x3bcc('0x1c')]);}_0x206cc5['order']=qs[_0x3bcc('0x36')](_0x27ba7d[_0x3bcc('0x2d')][_0x3bcc('0x36')]);_0x206cc5[_0x3bcc('0x37')]=qs[_0x3bcc('0x2f')](_[_0x3bcc('0x38')](_0x27ba7d['query'],_0x532ac4[_0x3bcc('0x2f')]),_0x510d52);if(_0x27ba7d['query']['filter']){_0x206cc5[_0x3bcc('0x37')]=_[_0x3bcc('0x39')](_0x206cc5[_0x3bcc('0x37')],{'$or':_[_0x3bcc('0x2c')](_0x510d52,function(_0x56c95a){if(_0x56c95a[_0x3bcc('0x3a')]!==_0x3bcc('0x3b')){var _0x2ecaa0={};_0x2ecaa0[_0x56c95a[_0x3bcc('0x26')]]={'$like':'%'+_0x27ba7d['query'][_0x3bcc('0x3c')]+'%'};return _0x2ecaa0;}})});}_0x206cc5=_[_0x3bcc('0x39')]({},_0x206cc5,_0x27ba7d['options']);var _0x40c962={'where':_0x206cc5['where']};return db[_0x3bcc('0x28')][_0x3bcc('0x1d')](_0x40c962)[_0x3bcc('0x23')](function(_0x400650){_0x4ee176[_0x3bcc('0x1d')]=_0x400650;if(_0x27ba7d['query']['includeAll']){_0x206cc5[_0x3bcc('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3bcc('0x3e')](_0x206cc5);})[_0x3bcc('0x23')](function(_0x1c15af){_0x4ee176[_0x3bcc('0x3f')]=_0x1c15af;return _0x4ee176;})[_0x3bcc('0x23')](respondWithFilteredResult(_0x4b8bb3,_0x206cc5))[_0x3bcc('0x40')](handleError(_0x4b8bb3,null));};exports[_0x3bcc('0x41')]=function(_0x35737f,_0x1c615e){var _0x107be4={'raw':!![],'where':{'id':_0x35737f[_0x3bcc('0x42')]['id']}},_0x37b5c1={};_0x37b5c1[_0x3bcc('0x2b')]=_[_0x3bcc('0x2e')](db[_0x3bcc('0x28')][_0x3bcc('0x43')]);_0x37b5c1[_0x3bcc('0x2d')]=_[_0x3bcc('0x2e')](_0x35737f[_0x3bcc('0x2d')]);_0x37b5c1[_0x3bcc('0x2f')]=_[_0x3bcc('0x31')](_0x37b5c1[_0x3bcc('0x2b')],_0x37b5c1[_0x3bcc('0x2d')]);_0x107be4[_0x3bcc('0x30')]=_[_0x3bcc('0x31')](_0x37b5c1[_0x3bcc('0x2b')],qs[_0x3bcc('0x32')](_0x35737f['query'][_0x3bcc('0x32')]));_0x107be4[_0x3bcc('0x30')]=_0x107be4['attributes'][_0x3bcc('0x33')]?_0x107be4[_0x3bcc('0x30')]:_0x37b5c1['model'];if(_0x35737f[_0x3bcc('0x2d')][_0x3bcc('0x44')]){_0x107be4[_0x3bcc('0x3d')]=[{'all':!![]}];}_0x107be4=_[_0x3bcc('0x39')]({},_0x107be4,_0x35737f['options']);return db[_0x3bcc('0x28')][_0x3bcc('0x45')](_0x107be4)[_0x3bcc('0x23')](handleEntityNotFound(_0x1c615e,null))[_0x3bcc('0x23')](respondWithResult(_0x1c615e,null))[_0x3bcc('0x40')](handleError(_0x1c615e,null));};exports[_0x3bcc('0x46')]=function(_0x2e0120,_0x3aa769){return db[_0x3bcc('0x28')][_0x3bcc('0x46')](_0x2e0120[_0x3bcc('0x47')],{})[_0x3bcc('0x23')](respondWithResult(_0x3aa769,0xc9))['catch'](handleError(_0x3aa769,null));};exports[_0x3bcc('0x22')]=function(_0x3216cb,_0x592361){if(_0x3216cb[_0x3bcc('0x47')]['id']){delete _0x3216cb[_0x3bcc('0x47')]['id'];}return db[_0x3bcc('0x28')]['find']({'where':{'id':_0x3216cb[_0x3bcc('0x42')]['id']}})[_0x3bcc('0x23')](handleEntityNotFound(_0x592361,null))[_0x3bcc('0x23')](saveUpdates(_0x3216cb[_0x3bcc('0x47')],null))[_0x3bcc('0x23')](respondWithResult(_0x592361,null))[_0x3bcc('0x40')](handleError(_0x592361,null));};exports[_0x3bcc('0x24')]=function(_0x52180f,_0x59c24f){return db[_0x3bcc('0x28')]['find']({'where':{'id':_0x52180f[_0x3bcc('0x42')]['id']}})['then'](handleEntityNotFound(_0x59c24f,null))[_0x3bcc('0x23')](removeEntity(_0x59c24f,null))['catch'](handleError(_0x59c24f,null));};exports[_0x3bcc('0x48')]=function(_0x2fb593,_0x17432b){return db['JscriptySessionReport'][_0x3bcc('0x48')]()[_0x3bcc('0x23')](respondWithResult(_0x17432b,null))['catch'](handleError(_0x17432b,null));};exports[_0x3bcc('0x49')]=function(_0x4e4e2a,_0x521ed2,_0x233050){var _0xf60902={'raw':!![],'where':{}};var _0x968cc0={};var _0x509113={'count':0x0,'rows':[]};return db[_0x3bcc('0x28')][_0x3bcc('0x4a')]({'where':{'id':_0x4e4e2a[_0x3bcc('0x42')]['id']}})[_0x3bcc('0x23')](handleEntityNotFound(_0x521ed2,null))[_0x3bcc('0x23')](function(_0x428173){if(_0x428173){_0x968cc0['model']=_[_0x3bcc('0x2e')](db['JscriptyQuestionReport']['rawAttributes']);_0x968cc0['query']=_[_0x3bcc('0x2e')](_0x4e4e2a['query']);_0x968cc0[_0x3bcc('0x2f')]=_[_0x3bcc('0x31')](_0x968cc0[_0x3bcc('0x2b')],_0x968cc0['query']);_0xf60902[_0x3bcc('0x30')]=_[_0x3bcc('0x31')](_0x968cc0[_0x3bcc('0x2b')],qs[_0x3bcc('0x32')](_0x4e4e2a[_0x3bcc('0x2d')][_0x3bcc('0x32')]));_0xf60902['attributes']=_0xf60902[_0x3bcc('0x30')][_0x3bcc('0x33')]?_0xf60902['attributes']:_0x968cc0[_0x3bcc('0x2b')];if(!_0x4e4e2a[_0x3bcc('0x2d')][_0x3bcc('0x34')](_0x3bcc('0x35'))){_0xf60902['limit']=qs[_0x3bcc('0x4b')](_0x4e4e2a['query'][_0x3bcc('0x4b')]);_0xf60902[_0x3bcc('0x1c')]=qs[_0x3bcc('0x1c')](_0x4e4e2a['query'][_0x3bcc('0x1c')]);}_0xf60902[_0x3bcc('0x4c')]=qs[_0x3bcc('0x36')](_0x4e4e2a['query'][_0x3bcc('0x36')]);_0xf60902[_0x3bcc('0x37')]=qs[_0x3bcc('0x2f')](_['pick'](_0x4e4e2a[_0x3bcc('0x2d')],_0x968cc0['filters']));_0xf60902[_0x3bcc('0x37')][_0x3bcc('0x4d')]=_0x428173['id'];if(_0x4e4e2a[_0x3bcc('0x2d')][_0x3bcc('0x3c')]){_0xf60902[_0x3bcc('0x37')]=_['merge'](_0xf60902[_0x3bcc('0x37')],{'$or':_['map'](_0xf60902[_0x3bcc('0x30')],function(_0x5c90a4){var _0x2421aa={};_0x2421aa[_0x5c90a4]={'$like':'%'+_0x4e4e2a['query'][_0x3bcc('0x3c')]+'%'};return _0x2421aa;})});}_0xf60902=_['merge']({},_0xf60902,_0x4e4e2a[_0x3bcc('0x4e')]);return db[_0x3bcc('0x4f')]['count']({'where':_0xf60902[_0x3bcc('0x37')]})[_0x3bcc('0x23')](function(_0x40565c){_0x509113['count']=_0x40565c;if(_0x4e4e2a[_0x3bcc('0x2d')][_0x3bcc('0x44')]){_0xf60902[_0x3bcc('0x3d')]=[{'all':!![]}];}return db[_0x3bcc('0x4f')]['findAll'](_0xf60902);})[_0x3bcc('0x23')](function(_0x1a6958){_0x509113[_0x3bcc('0x3f')]=_0x1a6958;return _0x509113;});}})[_0x3bcc('0x23')](respondWithFilteredResult(_0x521ed2,_0xf60902))[_0x3bcc('0x40')](handleError(_0x521ed2,null));}; \ No newline at end of file +var _0x008c=['sendStatus','error','stack','name','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','JscriptySessionReport','find','create','body','describe','getQuestions','JscriptyQuestionReport','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','save','update','destroy','then'];(function(_0x588bf2,_0xe6fb8){var _0x571db3=function(_0x4cdac8){while(--_0x4cdac8){_0x588bf2['push'](_0x588bf2['shift']());}};_0x571db3(++_0xe6fb8);}(_0x008c,0x10c));var _0xc008=function(_0x2de9de,_0xd46ad){_0x2de9de=_0x2de9de-0x0;var _0x34be8c=_0x008c[_0x2de9de];return _0x34be8c;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc008('0x1'));var jsonpatch=require(_0xc008('0x2'));var rp=require(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require('sox');var csv=require(_0xc008('0x9'));var ejs=require(_0xc008('0xa'));var fs=require('fs');var fs_extra=require(_0xc008('0xb'));var _=require(_0xc008('0xc'));var squel=require(_0xc008('0xd'));var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require(_0xc008('0x9'));var querystring=require(_0xc008('0x10'));var Papa=require('papaparse');var Redis=require(_0xc008('0x11'));var authService=require(_0xc008('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x13'));var logger=require('../../config/logger')(_0xc008('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];function respondWithStatusCode(_0x41b3b0,_0x3edc47){_0x3edc47=_0x3edc47||0xcc;return function(_0x19acd3){if(_0x19acd3){return _0x41b3b0['sendStatus'](_0x3edc47);}return _0x41b3b0[_0xc008('0x17')](_0x3edc47)[_0xc008('0x18')]();};}function respondWithResult(_0x3f3ff7,_0x22fde8){_0x22fde8=_0x22fde8||0xc8;return function(_0x1c4960){if(_0x1c4960){return _0x3f3ff7[_0xc008('0x17')](_0x22fde8)[_0xc008('0x19')](_0x1c4960);}};}function respondWithFilteredResult(_0x160d42,_0x5cb894){return function(_0x231a6c){if(_0x231a6c){var _0x5b8930=typeof _0x5cb894[_0xc008('0x1a')]==='undefined'&&typeof _0x5cb894[_0xc008('0x1b')]===_0xc008('0x1c');var _0x1dea93=_0x231a6c[_0xc008('0x1d')];var _0x5013d4=_0x5b8930?0x0:_0x5cb894['offset'];var _0x225838=_0x5b8930?_0x231a6c[_0xc008('0x1d')]:_0x5cb894[_0xc008('0x1a')]+_0x5cb894['limit'];var _0x579b22;if(_0x225838>=_0x1dea93){_0x225838=_0x1dea93;_0x579b22=0xc8;}else{_0x579b22=0xce;}_0x160d42[_0xc008('0x17')](_0x579b22);return _0x160d42[_0xc008('0x1e')]('Content-Range',_0x5013d4+'-'+_0x225838+'/'+_0x1dea93)[_0xc008('0x19')](_0x231a6c);}return null;};}function patchUpdates(_0x367208){return function(_0x5d6401){try{jsonpatch[_0xc008('0x1f')](_0x5d6401,_0x367208,!![]);}catch(_0x1c4243){return BPromise['reject'](_0x1c4243);}return _0x5d6401[_0xc008('0x20')]();};}function saveUpdates(_0x5569aa,_0x3c6161){return function(_0x29dd50){if(_0x29dd50){return _0x29dd50[_0xc008('0x21')](_0x5569aa)['then'](function(_0x3a20eb){return _0x3a20eb;});}return null;};}function removeEntity(_0x5b18d5,_0x1ba2b1){return function(_0x318355){if(_0x318355){return _0x318355[_0xc008('0x22')]()[_0xc008('0x23')](function(){_0x5b18d5[_0xc008('0x17')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x4a01f8,_0x4ebace){return function(_0x5bd8a2){if(!_0x5bd8a2){_0x4a01f8[_0xc008('0x24')](0x194);}return _0x5bd8a2;};}function handleError(_0x30b2db,_0x2aaf8b){_0x2aaf8b=_0x2aaf8b||0x1f4;return function(_0x3dc0c9){logger[_0xc008('0x25')](_0x3dc0c9[_0xc008('0x26')]);if(_0x3dc0c9[_0xc008('0x27')]){delete _0x3dc0c9[_0xc008('0x27')];}_0x30b2db[_0xc008('0x17')](_0x2aaf8b)['send'](_0x3dc0c9);};}exports['index']=function(_0xb041ad,_0x2dbdd3){var _0x42243e={},_0x2559c1={},_0x335503={'count':0x0,'rows':[]};var _0x5c3883=_[_0xc008('0x28')](db['JscriptySessionReport'][_0xc008('0x29')],function(_0x29600f){return{'name':_0x29600f[_0xc008('0x2a')],'type':_0x29600f['type']['key']};});_0x2559c1['model']=_[_0xc008('0x28')](_0x5c3883,_0xc008('0x27'));_0x2559c1[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0xb041ad['query']);_0x2559c1[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2559c1[_0xc008('0x2f')],_0x2559c1[_0xc008('0x2b')]);_0x42243e['attributes']=_[_0xc008('0x2e')](_0x2559c1[_0xc008('0x2f')],qs[_0xc008('0x30')](_0xb041ad[_0xc008('0x2b')][_0xc008('0x30')]));_0x42243e[_0xc008('0x31')]=_0x42243e['attributes'][_0xc008('0x32')]?_0x42243e['attributes']:_0x2559c1['model'];if(!_0xb041ad[_0xc008('0x2b')][_0xc008('0x33')](_0xc008('0x34'))){_0x42243e[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0xb041ad[_0xc008('0x2b')][_0xc008('0x1b')]);_0x42243e[_0xc008('0x1a')]=qs['offset'](_0xb041ad['query'][_0xc008('0x1a')]);}_0x42243e[_0xc008('0x35')]=qs[_0xc008('0x36')](_0xb041ad[_0xc008('0x2b')][_0xc008('0x36')]);_0x42243e['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0xb041ad['query'],_0x2559c1['filters']),_0x5c3883);if(_0xb041ad[_0xc008('0x2b')][_0xc008('0x38')]){_0x42243e['where']=_['merge'](_0x42243e[_0xc008('0x39')],{'$or':_['map'](_0x5c3883,function(_0x30c692){if(_0x30c692[_0xc008('0x3a')]!==_0xc008('0x3b')){var _0x2d8b22={};_0x2d8b22[_0x30c692[_0xc008('0x27')]]={'$like':'%'+_0xb041ad[_0xc008('0x2b')]['filter']+'%'};return _0x2d8b22;}})});}_0x42243e=_[_0xc008('0x3c')]({},_0x42243e,_0xb041ad['options']);var _0x49548d={'where':_0x42243e['where']};return db['JscriptySessionReport']['count'](_0x49548d)['then'](function(_0x4c8bee){_0x335503[_0xc008('0x1d')]=_0x4c8bee;if(_0xb041ad[_0xc008('0x2b')][_0xc008('0x3d')]){_0x42243e[_0xc008('0x3e')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xc008('0x3f')](_0x42243e);})[_0xc008('0x23')](function(_0x1bc805){_0x335503[_0xc008('0x40')]=_0x1bc805;return _0x335503;})[_0xc008('0x23')](respondWithFilteredResult(_0x2dbdd3,_0x42243e))[_0xc008('0x41')](handleError(_0x2dbdd3,null));};exports[_0xc008('0x42')]=function(_0x5139a1,_0x82ed52){var _0x4fab33={'raw':!![],'where':{'id':_0x5139a1[_0xc008('0x43')]['id']}},_0x1743ae={};_0x1743ae['model']=_[_0xc008('0x2c')](db[_0xc008('0x44')]['rawAttributes']);_0x1743ae[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x5139a1[_0xc008('0x2b')]);_0x1743ae['filters']=_['intersection'](_0x1743ae['model'],_0x1743ae[_0xc008('0x2b')]);_0x4fab33[_0xc008('0x31')]=_[_0xc008('0x2e')](_0x1743ae['model'],qs[_0xc008('0x30')](_0x5139a1['query'][_0xc008('0x30')]));_0x4fab33[_0xc008('0x31')]=_0x4fab33['attributes'][_0xc008('0x32')]?_0x4fab33[_0xc008('0x31')]:_0x1743ae[_0xc008('0x2f')];if(_0x5139a1[_0xc008('0x2b')][_0xc008('0x3d')]){_0x4fab33[_0xc008('0x3e')]=[{'all':!![]}];}_0x4fab33=_[_0xc008('0x3c')]({},_0x4fab33,_0x5139a1['options']);return db[_0xc008('0x44')][_0xc008('0x45')](_0x4fab33)['then'](handleEntityNotFound(_0x82ed52,null))['then'](respondWithResult(_0x82ed52,null))[_0xc008('0x41')](handleError(_0x82ed52,null));};exports[_0xc008('0x46')]=function(_0x2c391a,_0x4c72e1){return db[_0xc008('0x44')][_0xc008('0x46')](_0x2c391a[_0xc008('0x47')],{})[_0xc008('0x23')](respondWithResult(_0x4c72e1,0xc9))[_0xc008('0x41')](handleError(_0x4c72e1,null));};exports[_0xc008('0x21')]=function(_0x1a82bf,_0x3f4192){if(_0x1a82bf[_0xc008('0x47')]['id']){delete _0x1a82bf[_0xc008('0x47')]['id'];}return db[_0xc008('0x44')]['find']({'where':{'id':_0x1a82bf['params']['id']}})['then'](handleEntityNotFound(_0x3f4192,null))[_0xc008('0x23')](saveUpdates(_0x1a82bf[_0xc008('0x47')],null))[_0xc008('0x23')](respondWithResult(_0x3f4192,null))[_0xc008('0x41')](handleError(_0x3f4192,null));};exports[_0xc008('0x22')]=function(_0x116676,_0x1a2450){return db[_0xc008('0x44')]['find']({'where':{'id':_0x116676[_0xc008('0x43')]['id']}})[_0xc008('0x23')](handleEntityNotFound(_0x1a2450,null))['then'](removeEntity(_0x1a2450,null))[_0xc008('0x41')](handleError(_0x1a2450,null));};exports[_0xc008('0x48')]=function(_0xdd2b32,_0x1ce8d0){return db[_0xc008('0x44')][_0xc008('0x48')]()[_0xc008('0x23')](respondWithResult(_0x1ce8d0,null))[_0xc008('0x41')](handleError(_0x1ce8d0,null));};exports[_0xc008('0x49')]=function(_0x4b9508,_0x38fd76,_0xdcfcdd){var _0x2c7456={'raw':!![],'where':{}};var _0x76c76e={};var _0x31ca4c={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x4b9508[_0xc008('0x43')]['id']}})[_0xc008('0x23')](handleEntityNotFound(_0x38fd76,null))[_0xc008('0x23')](function(_0xdb64c1){if(_0xdb64c1){_0x76c76e['model']=_['keys'](db[_0xc008('0x4a')][_0xc008('0x29')]);_0x76c76e[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x4b9508[_0xc008('0x2b')]);_0x76c76e[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x76c76e['model'],_0x76c76e[_0xc008('0x2b')]);_0x2c7456['attributes']=_[_0xc008('0x2e')](_0x76c76e[_0xc008('0x2f')],qs[_0xc008('0x30')](_0x4b9508[_0xc008('0x2b')][_0xc008('0x30')]));_0x2c7456[_0xc008('0x31')]=_0x2c7456[_0xc008('0x31')][_0xc008('0x32')]?_0x2c7456[_0xc008('0x31')]:_0x76c76e[_0xc008('0x2f')];if(!_0x4b9508['query']['hasOwnProperty'](_0xc008('0x34'))){_0x2c7456['limit']=qs[_0xc008('0x1b')](_0x4b9508['query'][_0xc008('0x1b')]);_0x2c7456['offset']=qs[_0xc008('0x1a')](_0x4b9508[_0xc008('0x2b')][_0xc008('0x1a')]);}_0x2c7456['order']=qs[_0xc008('0x36')](_0x4b9508[_0xc008('0x2b')][_0xc008('0x36')]);_0x2c7456[_0xc008('0x39')]=qs['filters'](_['pick'](_0x4b9508[_0xc008('0x2b')],_0x76c76e['filters']));_0x2c7456[_0xc008('0x39')][_0xc008('0x4b')]=_0xdb64c1['id'];if(_0x4b9508[_0xc008('0x2b')][_0xc008('0x38')]){_0x2c7456[_0xc008('0x39')]=_[_0xc008('0x3c')](_0x2c7456[_0xc008('0x39')],{'$or':_['map'](_0x2c7456[_0xc008('0x31')],function(_0x391e24){var _0x4b3a3f={};_0x4b3a3f[_0x391e24]={'$like':'%'+_0x4b9508[_0xc008('0x2b')]['filter']+'%'};return _0x4b3a3f;})});}_0x2c7456=_[_0xc008('0x3c')]({},_0x2c7456,_0x4b9508['options']);return db['JscriptyQuestionReport'][_0xc008('0x1d')]({'where':_0x2c7456['where']})[_0xc008('0x23')](function(_0x60c8c5){_0x31ca4c[_0xc008('0x1d')]=_0x60c8c5;if(_0x4b9508['query'][_0xc008('0x3d')]){_0x2c7456[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x4a')][_0xc008('0x3f')](_0x2c7456);})[_0xc008('0x23')](function(_0x3f88a2){_0x31ca4c[_0xc008('0x40')]=_0x3f88a2;return _0x31ca4c;});}})[_0xc008('0x23')](respondWithFilteredResult(_0x38fd76,_0x2c7456))[_0xc008('0x41')](handleError(_0x38fd76,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7904c32..c63889b 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 _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeda8,0x104));var _0x8eda=function(_0x293eab,_0x5d348f){_0x293eab=_0x293eab-0x0;var _0x661bd5=_0xeda8[_0x293eab];return _0x661bd5;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x45f5f6,_0x3dbdff){_0x45f5f6=_0x45f5f6-0x0;var _0x45ab68=_0x0f4d[_0x45f5f6];return _0x45ab68;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3c5f27f..193f119 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 _0x5430=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5430,0x10c));var _0x0543=function(_0x49c2e0,_0x5b1085){_0x49c2e0=_0x49c2e0-0x0;var _0x475deb=_0x5430[_0x49c2e0];return _0x475deb;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});} \ No newline at end of file +var _0x6050=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x3443e4,_0x4a7dbc){var _0x35fed3=function(_0x2e4e8a){while(--_0x2e4e8a){_0x3443e4['push'](_0x3443e4['shift']());}};_0x35fed3(++_0x4a7dbc);}(_0x6050,0x196));var _0x0605=function(_0xf58ac,_0x4a3fcd){_0xf58ac=_0xf58ac-0x0;var _0x351315=_0x6050[_0xf58ac];return _0x351315;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578623,_0x58f7d2,_0x5660ad){return new BPromise(function(_0x1629bf,_0x11b8b5){return client[_0x0605('0xa')](_0x578623,_0x5660ad)[_0x0605('0xb')](function(_0x44fdd3){logger['info'](_0x0605('0xc'),_0x58f7d2,_0x0605('0xd'));logger[_0x0605('0xe')](_0x0605('0xf'),_0x58f7d2,_0x0605('0xd'),JSON[_0x0605('0x10')](_0x44fdd3));if(_0x44fdd3[_0x0605('0x11')]){if(_0x44fdd3[_0x0605('0x11')][_0x0605('0x12')]===0x1f4){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x11b8b5(_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);}logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0x44fdd3[_0x0605('0x11')][_0x0605('0x13')]);return _0x1629bf(_0x44fdd3['error'][_0x0605('0x13')]);}else{logger[_0x0605('0x14')](_0x0605('0xc'),_0x58f7d2,'request\x20sent');_0x1629bf(_0x44fdd3['result'][_0x0605('0x13')]);}})[_0x0605('0x15')](function(_0xa83443){logger[_0x0605('0x11')](_0x0605('0xc'),_0x58f7d2,_0xa83443);_0x11b8b5(_0xa83443);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 3751327..8bda34a 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 _0xd67b=['../../config/environment','get','index','put','/:id','isAuthenticated','update','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e153d,_0x38182f){var _0x1a3899=function(_0x3cf05c){while(--_0x3cf05c){_0x4e153d['push'](_0x4e153d['shift']());}};_0x1a3899(++_0x38182f);}(_0xd67b,0x133));var _0xbd67=function(_0x5e2472,_0x4bad24){_0x5e2472=_0x5e2472-0x0;var _0x4f49a1=_0xd67b[_0x5e2472];return _0x4f49a1;};'use strict';var multer=require('multer');var util=require(_0xbd67('0x0'));var path=require('path');var timeout=require(_0xbd67('0x1'));var express=require(_0xbd67('0x2'));var router=express[_0xbd67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd67('0x5'));var controller=require('./license.controller');router[_0xbd67('0x6')]('/',controller[_0xbd67('0x7')]);router[_0xbd67('0x8')](_0xbd67('0x9'),auth[_0xbd67('0xa')](),controller[_0xbd67('0xb')]);module[_0xbd67('0xc')]=router; \ No newline at end of file +var _0x3f47=['/:id','isAuthenticated','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','put'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0x3f47,0x10e));var _0x73f4=function(_0x2debf1,_0x485717){_0x2debf1=_0x2debf1-0x0;var _0x40f823=_0x3f47[_0x2debf1];return _0x40f823;};'use strict';var multer=require(_0x73f4('0x0'));var util=require(_0x73f4('0x1'));var path=require('path');var timeout=require(_0x73f4('0x2'));var express=require('express');var router=express[_0x73f4('0x3')]();var fs_extra=require(_0x73f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73f4('0x5'));var config=require(_0x73f4('0x6'));var controller=require(_0x73f4('0x7'));router[_0x73f4('0x8')]('/',controller['index']);router[_0x73f4('0x9')](_0x73f4('0xa'),auth[_0x73f4('0xb')](),controller[_0x73f4('0xc')]);module[_0x73f4('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 13a4d9d..e52b156 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 _0x83ef=['STRING','sequelize','exports','TEXT'];(function(_0xede44e,_0x2540de){var _0x36367b=function(_0x10bad9){while(--_0x10bad9){_0xede44e['push'](_0xede44e['shift']());}};_0x36367b(++_0x2540de);}(_0x83ef,0x65));var _0xf83e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x83ef[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xf83e('0x0'));module[_0xf83e('0x1')]={'license':{'type':Sequelize[_0xf83e('0x2')]},'data1':{'type':Sequelize[_0xf83e('0x3')]},'data2':{'type':Sequelize[_0xf83e('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d6e=['STRING'];(function(_0x83a6a8,_0x587455){var _0x1db28a=function(_0x382cf9){while(--_0x382cf9){_0x83a6a8['push'](_0x83a6a8['shift']());}};_0x1db28a(++_0x587455);}(_0x7d6e,0x1c0));var _0xe7d6=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0x7d6e[_0x2c3a47];return _0x1c04de;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xe7d6('0x0')]},'data2':{'type':Sequelize[_0xe7d6('0x0')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 93c758e..e1faa26 100644 --- a/server/api/license/license.controller.js +++ b/server/api/license/license.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x38c2e6,_0x25981a){var _0x2cc3e8=function(_0x4e5b83){while(--_0x4e5b83){_0x38c2e6['push'](_0x38c2e6['shift']());}};_0x2cc3e8(++_0x25981a);}(_0x2ef3,0xba));var _0x32ef=function(_0x47f41d,_0x1702de){_0x47f41d=_0x47f41d-0x0;var _0x11604e=_0x2ef3[_0x47f41d];return _0x11604e;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file +var _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x216bba,_0x525713){var _0x42c81d=function(_0x4c0bd6){while(--_0x4c0bd6){_0x216bba['push'](_0x216bba['shift']());}};_0x42c81d(++_0x525713);}(_0x7a54,0x106));var _0x47a5=function(_0x27b108,_0x41b697){_0x27b108=_0x27b108-0x0;var _0x498b3c=_0x7a54[_0x27b108];return _0x498b3c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 99f6ecc..79baccb 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 _0x4911=['api','moment','bluebird','request-promise','path','exports','define','License','util','../../config/logger'];(function(_0x486284,_0x24e4ca){var _0x94fd29=function(_0x542961){while(--_0x542961){_0x486284['push'](_0x486284['shift']());}};_0x94fd29(++_0x24e4ca);}(_0x4911,0xa8));var _0x1491=function(_0xbca15c,_0x5ac4cc){_0xbca15c=_0xbca15c-0x0;var _0x2f2a88=_0x4911[_0xbca15c];return _0x2f2a88;};'use strict';var _=require('lodash');var util=require(_0x1491('0x0'));var logger=require(_0x1491('0x1'))(_0x1491('0x2'));var moment=require(_0x1491('0x3'));var BPromise=require(_0x1491('0x4'));var rp=require(_0x1491('0x5'));var fs=require('fs');var path=require(_0x1491('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x1491('0x7')]=function(_0x354ffa,_0x2627e){return _0x354ffa[_0x1491('0x8')](_0x1491('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafa8=['rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3541f6,_0x2e5e9f){var _0x108803=function(_0x4ebbd6){while(--_0x4ebbd6){_0x3541f6['push'](_0x3541f6['shift']());}};_0x108803(++_0x2e5e9f);}(_0xafa8,0xbc));var _0x8afa=function(_0x45b29d,_0x44ce43){_0x45b29d=_0x45b29d-0x0;var _0x32d74=_0xafa8[_0x45b29d];return _0x32d74;};'use strict';var _=require(_0x8afa('0x0'));var util=require(_0x8afa('0x1'));var logger=require('../../config/logger')(_0x8afa('0x2'));var moment=require(_0x8afa('0x3'));var BPromise=require(_0x8afa('0x4'));var rp=require(_0x8afa('0x5'));var fs=require('fs');var path=require(_0x8afa('0x6'));var rimraf=require(_0x8afa('0x7'));var config=require(_0x8afa('0x8'));var attributes=require(_0x8afa('0x9'));module[_0x8afa('0xa')]=function(_0x342492,_0x402d4c){return _0x342492[_0x8afa('0xb')]('License',attributes,{'tableName':_0x8afa('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 01a1671..765fbb1 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 _0x7a26=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error','License,\x20%s,\x20%s'];(function(_0xb32a2d,_0xdb6b43){var _0x4dfa0e=function(_0xb2ea85){while(--_0xb2ea85){_0xb32a2d['push'](_0xb32a2d['shift']());}};_0x4dfa0e(++_0xdb6b43);}(_0x7a26,0x1a5));var _0x67a2=function(_0x76c39f,_0x3a9103){_0x76c39f=_0x76c39f-0x0;var _0x4d6a7f=_0x7a26[_0x76c39f];return _0x4d6a7f;};'use strict';var _=require(_0x67a2('0x0'));var util=require(_0x67a2('0x1'));var moment=require(_0x67a2('0x2'));var BPromise=require(_0x67a2('0x3'));var rs=require(_0x67a2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67a2('0x5'))['db'];var utils=require(_0x67a2('0x6'));var logger=require(_0x67a2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x67a2('0x8'));var client=jayson['client'][_0x67a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x413ce9,_0x3539cd,_0x3a8095){return new BPromise(function(_0x3374b8,_0x5f1cb9){return client[_0x67a2('0xa')](_0x413ce9,_0x3a8095)[_0x67a2('0xb')](function(_0x39f928){logger['info']('License,\x20%s,\x20%s',_0x3539cd,_0x67a2('0xc'));logger[_0x67a2('0xd')](_0x67a2('0xe'),_0x3539cd,_0x67a2('0xc'),JSON[_0x67a2('0xf')](_0x39f928));if(_0x39f928['error']){if(_0x39f928['error'][_0x67a2('0x10')]===0x1f4){logger[_0x67a2('0x11')](_0x67a2('0x12'),_0x3539cd,_0x39f928[_0x67a2('0x11')]['message']);return _0x5f1cb9(_0x39f928['error'][_0x67a2('0x13')]);}logger[_0x67a2('0x11')](_0x67a2('0x12'),_0x3539cd,_0x39f928[_0x67a2('0x11')]['message']);return _0x3374b8(_0x39f928[_0x67a2('0x11')][_0x67a2('0x13')]);}else{logger[_0x67a2('0x14')]('License,\x20%s,\x20%s',_0x3539cd,_0x67a2('0xc'));_0x3374b8(_0x39f928['result'][_0x67a2('0x13')]);}})[_0x67a2('0x15')](function(_0xb75bdc){logger[_0x67a2('0x11')](_0x67a2('0x12'),_0x3539cd,_0xb75bdc);_0x5f1cb9(_0xb75bdc);});});} \ No newline at end of file +var _0x230c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4bc10d,_0x43468e){var _0x4c96ac=function(_0x28d94b){while(--_0x28d94b){_0x4bc10d['push'](_0x4bc10d['shift']());}};_0x4c96ac(++_0x43468e);}(_0x230c,0x9c));var _0xc230=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x230c[_0x273dc5];return _0x46dae7;};'use strict';var _=require(_0xc230('0x0'));var util=require('util');var moment=require(_0xc230('0x1'));var BPromise=require(_0xc230('0x2'));var rs=require(_0xc230('0x3'));var fs=require('fs');var Redis=require(_0xc230('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc230('0x5'))(_0xc230('0x6'));var config=require(_0xc230('0x7'));var jayson=require(_0xc230('0x8'));var client=jayson[_0xc230('0x9')][_0xc230('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5162df,_0x3935fb,_0x1abf0d){return new BPromise(function(_0x27bd02,_0x242907){return client[_0xc230('0xb')](_0x5162df,_0x1abf0d)['then'](function(_0xb44f29){logger[_0xc230('0xc')](_0xc230('0xd'),_0x3935fb,'request\x20sent');logger[_0xc230('0xe')](_0xc230('0xf'),_0x3935fb,_0xc230('0x10'),JSON[_0xc230('0x11')](_0xb44f29));if(_0xb44f29[_0xc230('0x12')]){if(_0xb44f29[_0xc230('0x12')][_0xc230('0x13')]===0x1f4){logger['error'](_0xc230('0xd'),_0x3935fb,_0xb44f29[_0xc230('0x12')]['message']);return _0x242907(_0xb44f29[_0xc230('0x12')][_0xc230('0x14')]);}logger[_0xc230('0x12')](_0xc230('0xd'),_0x3935fb,_0xb44f29[_0xc230('0x12')][_0xc230('0x14')]);return _0x27bd02(_0xb44f29[_0xc230('0x12')][_0xc230('0x14')]);}else{logger[_0xc230('0xc')]('License,\x20%s,\x20%s',_0x3935fb,'request\x20sent');_0x27bd02(_0xb44f29[_0xc230('0x15')][_0xc230('0x14')]);}})[_0xc230('0x16')](function(_0x329a63){logger[_0xc230('0x12')](_0xc230('0xd'),_0x3935fb,_0x329a63);_0x242907(_0x329a63);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 666f8bf..3001694 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 _0x4424=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4424,0x1be));var _0x4442=function(_0x27883d,_0x40d6fc){_0x27883d=_0x27883d-0x0;var _0x2ecb50=_0x4424[_0x27883d];return _0x2ecb50;};'use strict';var multer=require(_0x4442('0x0'));var util=require(_0x4442('0x1'));var path=require(_0x4442('0x2'));var timeout=require(_0x4442('0x3'));var express=require(_0x4442('0x4'));var router=express['Router']();var fs_extra=require(_0x4442('0x5'));var auth=require(_0x4442('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4442('0x7'));router[_0x4442('0x8')]('/',auth[_0x4442('0x9')](),controller[_0x4442('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4442('0xb')]);router[_0x4442('0x8')](_0x4442('0xc'),auth['isAuthenticated'](),controller[_0x4442('0xd')]);router[_0x4442('0x8')](_0x4442('0xe'),auth[_0x4442('0x9')](),controller[_0x4442('0xf')]);router['get'](_0x4442('0x10'),auth[_0x4442('0x9')](),controller[_0x4442('0x11')]);router[_0x4442('0x8')](_0x4442('0x12'),auth[_0x4442('0x9')](),controller[_0x4442('0x13')]);router[_0x4442('0x8')](_0x4442('0x14'),auth[_0x4442('0x9')](),controller[_0x4442('0x15')]);router[_0x4442('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x4442('0x16')]);router[_0x4442('0x8')](_0x4442('0x17'),auth[_0x4442('0x9')](),controller['getApplications']);router[_0x4442('0x8')](_0x4442('0x18'),auth[_0x4442('0x9')](),controller['getMessages']);router[_0x4442('0x8')]('/:id/verify',auth['isAuthenticated'](),controller[_0x4442('0x19')]);router[_0x4442('0x8')](_0x4442('0x1a'),auth[_0x4442('0x9')](),controller[_0x4442('0x1b')]);router[_0x4442('0x1c')](_0x4442('0xe'),auth[_0x4442('0x9')](),controller[_0x4442('0x1d')]);router['post'](_0x4442('0x10'),auth[_0x4442('0x9')](),controller['addAnswer']);router[_0x4442('0x1c')]('/',auth[_0x4442('0x9')](),controller[_0x4442('0x1e')]);router[_0x4442('0x1c')](_0x4442('0x12'),auth[_0x4442('0x9')](),controller[_0x4442('0x1f')]);router[_0x4442('0x1c')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x4442('0x20')]);router['post']('/:id/interactions',auth[_0x4442('0x9')](),controller[_0x4442('0x21')]);router[_0x4442('0x1c')](_0x4442('0x17'),auth['isAuthenticated'](),controller[_0x4442('0x22')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x4442('0x23')]);router[_0x4442('0x1c')](_0x4442('0x1a'),auth['isAuthenticated'](),controller[_0x4442('0x24')]);router[_0x4442('0x25')](_0x4442('0xc'),auth[_0x4442('0x9')](),controller[_0x4442('0x26')]);router[_0x4442('0x27')](_0x4442('0xe'),auth[_0x4442('0x9')](),controller[_0x4442('0x28')]);router['delete'](_0x4442('0x10'),auth[_0x4442('0x9')](),controller[_0x4442('0x29')]);router[_0x4442('0x27')](_0x4442('0x12'),auth[_0x4442('0x9')](),controller[_0x4442('0x2a')]);router['delete'](_0x4442('0x14'),auth['isAuthenticated'](),controller[_0x4442('0x2b')]);router['delete'](_0x4442('0xc'),auth[_0x4442('0x9')](),controller[_0x4442('0x2c')]);router[_0x4442('0x27')]('/:id/users',auth['isAuthenticated'](),controller[_0x4442('0x2d')]);module['exports']=router; \ No newline at end of file +var _0xb029=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addImap','addInteraction','addApplications','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents'];(function(_0x4632a6,_0xb3ab12){var _0x13d821=function(_0x52e37c){while(--_0x52e37c){_0x4632a6['push'](_0x4632a6['shift']());}};_0x13d821(++_0xb3ab12);}(_0xb029,0xd2));var _0x9b02=function(_0x3706e1,_0x3ed326){_0x3706e1=_0x3706e1-0x0;var _0x1e7b3c=_0xb029[_0x3706e1];return _0x1e7b3c;};'use strict';var multer=require(_0x9b02('0x0'));var util=require('util');var path=require(_0x9b02('0x1'));var timeout=require(_0x9b02('0x2'));var express=require(_0x9b02('0x3'));var router=express[_0x9b02('0x4')]();var fs_extra=require(_0x9b02('0x5'));var auth=require(_0x9b02('0x6'));var interaction=require(_0x9b02('0x7'));var config=require('../../config/environment');var controller=require(_0x9b02('0x8'));router[_0x9b02('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b02('0xa')]);router[_0x9b02('0x9')](_0x9b02('0xb'),auth[_0x9b02('0xc')](),controller[_0x9b02('0xd')]);router[_0x9b02('0x9')](_0x9b02('0xe'),auth[_0x9b02('0xc')](),controller['show']);router[_0x9b02('0x9')](_0x9b02('0xf'),auth[_0x9b02('0xc')](),controller['getDispositions']);router[_0x9b02('0x9')](_0x9b02('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x9b02('0x9')](_0x9b02('0x11'),auth['isAuthenticated'](),controller[_0x9b02('0x12')]);router[_0x9b02('0x9')](_0x9b02('0x13'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x14')]);router['get'](_0x9b02('0x15'),auth[_0x9b02('0xc')](),controller['getInteractions']);router[_0x9b02('0x9')](_0x9b02('0x16'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x17')]);router[_0x9b02('0x9')](_0x9b02('0x18'),auth[_0x9b02('0xc')](),controller['getMessages']);router['get'](_0x9b02('0x19'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x1a')]);router[_0x9b02('0x9')](_0x9b02('0x1b'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x1c')]);router[_0x9b02('0x1d')](_0x9b02('0xf'),auth[_0x9b02('0xc')](),controller['addDisposition']);router['post'](_0x9b02('0x10'),auth[_0x9b02('0xc')](),controller['addAnswer']);router[_0x9b02('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9b02('0x11'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x1e')]);router[_0x9b02('0x1d')](_0x9b02('0x13'),auth[_0x9b02('0xc')](),controller['addSmtp']);router[_0x9b02('0x1d')]('/:id/interactions',auth[_0x9b02('0xc')](),controller[_0x9b02('0x1f')]);router[_0x9b02('0x1d')](_0x9b02('0x16'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x20')]);router[_0x9b02('0x1d')]('/:id/send',auth[_0x9b02('0xc')](),controller[_0x9b02('0x21')]);router[_0x9b02('0x1d')](_0x9b02('0x1b'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x22')]);router[_0x9b02('0x23')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9b02('0x24')](_0x9b02('0xf'),auth['isAuthenticated'](),controller[_0x9b02('0x25')]);router[_0x9b02('0x24')]('/:id/canned_answers',auth[_0x9b02('0xc')](),controller[_0x9b02('0x26')]);router[_0x9b02('0x24')]('/:id/in_servers',auth[_0x9b02('0xc')](),controller[_0x9b02('0x27')]);router[_0x9b02('0x24')](_0x9b02('0x13'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete'](_0x9b02('0xe'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x28')]);router[_0x9b02('0x24')](_0x9b02('0x1b'),auth[_0x9b02('0xc')](),controller[_0x9b02('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 32db7d4..ff7258e 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 _0x7b27=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x34d6bd,_0x55b744){var _0x248396=function(_0x23f061){while(--_0x23f061){_0x34d6bd['push'](_0x34d6bd['shift']());}};_0x248396(++_0x55b744);}(_0x7b27,0x186));var _0x77b2=function(_0x352988,_0x42297f){_0x352988=_0x352988-0x0;var _0x3252b5=_0x7b27[_0x352988];return _0x3252b5;};'use strict';var Sequelize=require(_0x77b2('0x0'));module['exports']={'description':{'type':Sequelize[_0x77b2('0x1')]},'name':{'type':Sequelize[_0x77b2('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x77b2('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x77b2('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x77b2('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x77b2('0x1')],'allowNull':![],'defaultValue':_0x77b2('0x4')},'fontSize':{'type':Sequelize[_0x77b2('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x77b2('0x3')],'defaultValue':function(){return _0x77b2('0x6');}},'notificationSound':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x77b2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x77b2('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x77b2('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x77b2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x77b2('0x2')],'defaultValue':![],'comment':_0x77b2('0x8'),'set':function(_0x5ddcf6){if(!_0x5ddcf6)this[_0x77b2('0x9')](_0x77b2('0xa'),null);this['setDataValue'](_0x77b2('0xb'),_0x5ddcf6);}}}; \ No newline at end of file +var _0x46fc=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x311997,_0x4c2cc7){var _0x3be163=function(_0x289cfb){while(--_0x289cfb){_0x311997['push'](_0x311997['shift']());}};_0x3be163(++_0x4c2cc7);}(_0x46fc,0x103));var _0xc46f=function(_0x19dc33,_0x1d6816){_0x19dc33=_0x19dc33-0x0;var _0x313ea9=_0x46fc[_0x19dc33];return _0x313ea9;};'use strict';var Sequelize=require(_0xc46f('0x0'));module[_0xc46f('0x1')]={'description':{'type':Sequelize[_0xc46f('0x2')]},'name':{'type':Sequelize[_0xc46f('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc46f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xc46f('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xc46f('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc46f('0x5')},'fontSize':{'type':Sequelize[_0xc46f('0x6')](0x2)[_0xc46f('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc46f('0x4')],'defaultValue':function(){return _0xc46f('0x8');}},'notificationSound':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc46f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc46f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc46f('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc46f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc46f('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xc46f('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc46f('0xa'),'set':function(_0x17fbd){if(!_0x17fbd)this[_0xc46f('0xb')](_0xc46f('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x17fbd);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 5ddd2de..95a3278 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 _0x11ea=['model','intersection','fields','attributes','length','nolimit','order','sort','pick','where','VIRTUAL','filter','MailAccount','includeAll','include','findAll','rows','show','params','keys','merge','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','UserProfileSection','userProfileId','getImap','findOne','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','MailApplication','priority','hasOwnProperty','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','List','Contacts','updatedAt','DESC','from','format','email','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','Interaction','Messages','VerifySmtp','verifySmtp','Sequelize','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','http','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','name','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','filters'];(function(_0x394cff,_0x5eda15){var _0x1a57a0=function(_0x4ef1f1){while(--_0x4ef1f1){_0x394cff['push'](_0x394cff['shift']());}};_0x1a57a0(++_0x5eda15);}(_0x11ea,0x77));var _0xa11e=function(_0x1db817,_0x379a4c){_0x1db817=_0x1db817-0x0;var _0xc21f55=_0x11ea[_0x1db817];return _0xc21f55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa11e('0x0'));var zipdir=require(_0xa11e('0x1'));var jsonpatch=require(_0xa11e('0x2'));var rp=require(_0xa11e('0x3'));var moment=require(_0xa11e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa11e('0x5'));var path=require(_0xa11e('0x6'));var sox=require(_0xa11e('0x7'));var csv=require(_0xa11e('0x8'));var ejs=require(_0xa11e('0x9'));var fs=require('fs');var fs_extra=require(_0xa11e('0xa'));var _=require(_0xa11e('0xb'));var squel=require(_0xa11e('0xc'));var crypto=require(_0xa11e('0xd'));var jsforce=require(_0xa11e('0xe'));var deskjs=require(_0xa11e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa11e('0x10'));var Papa=require(_0xa11e('0x11'));var htmlToText=require(_0xa11e('0x12'));var juice=require(_0xa11e('0x13'));var Redis=require(_0xa11e('0x14'));var authService=require(_0xa11e('0x15'));var qs=require(_0xa11e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa11e('0x17'));var logger=require(_0xa11e('0x18'))(_0xa11e('0x19'));var utils=require(_0xa11e('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xa11e('0x1b'));var db=require(_0xa11e('0x1c'))['db'];config[_0xa11e('0x1d')]=_[_0xa11e('0x1e')](config['redis'],{'host':_0xa11e('0x1f'),'port':0x18eb});var socket=require(_0xa11e('0x20'))(new Redis(config[_0xa11e('0x1d')]));require(_0xa11e('0x21'))[_0xa11e('0x22')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xa11e('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x32d2bf,_0x5cf4c2,_0x5f27e8,_0x400582){return new BPromise(function(_0x3142dd,_0x3529cb){var _0x2c4b97=_0x400582||client;return _0x2c4b97['request'](_0x32d2bf,_0x5f27e8)[_0xa11e('0x24')](function(_0x1139f0){logger[_0xa11e('0x25')]('MailAccount,\x20%s,\x20%s',_0x5cf4c2,_0xa11e('0x26'));logger[_0xa11e('0x27')](_0xa11e('0x28'),_0x5cf4c2,_0xa11e('0x26'),JSON[_0xa11e('0x29')](_0x1139f0));if(_0x1139f0[_0xa11e('0x2a')]){if(_0x1139f0[_0xa11e('0x2a')][_0xa11e('0x2b')]===0x1f4){logger[_0xa11e('0x2a')](_0xa11e('0x2c'),_0x5cf4c2,_0x1139f0['error'][_0xa11e('0x2d')]);return _0x3529cb(_0x1139f0[_0xa11e('0x2a')][_0xa11e('0x2d')]);}logger[_0xa11e('0x2a')](_0xa11e('0x2c'),_0x5cf4c2,_0x1139f0[_0xa11e('0x2a')][_0xa11e('0x2d')]);return _0x3142dd(_0x1139f0[_0xa11e('0x2a')][_0xa11e('0x2d')]);}else{logger[_0xa11e('0x25')](_0xa11e('0x2c'),_0x5cf4c2,_0xa11e('0x26'));_0x3142dd(_0x1139f0['result'][_0xa11e('0x2d')]);}})[_0xa11e('0x2e')](function(_0x3ac416){logger['error'](_0xa11e('0x2c'),_0x5cf4c2,_0x3ac416);_0x3529cb(_0x3ac416);});});}function respondWithStatusCode(_0x13e793,_0x574706){_0x574706=_0x574706||0xcc;return function(_0x1a1a04){if(_0x1a1a04){return _0x13e793['sendStatus'](_0x574706);}return _0x13e793['status'](_0x574706)[_0xa11e('0x2f')]();};}function respondWithResult(_0x5631e8,_0x16e205){_0x16e205=_0x16e205||0xc8;return function(_0x5613e8){if(_0x5613e8){return _0x5631e8[_0xa11e('0x30')](_0x16e205)[_0xa11e('0x31')](_0x5613e8);}};}function respondWithFilteredResult(_0x5d84b7,_0x3c6a7f){return function(_0x3d1429){if(_0x3d1429){var _0x5ce265=typeof _0x3c6a7f['offset']===_0xa11e('0x32')&&typeof _0x3c6a7f[_0xa11e('0x33')]===_0xa11e('0x32');var _0x203225=_0x3d1429[_0xa11e('0x34')];var _0x5235f8=_0x5ce265?0x0:_0x3c6a7f[_0xa11e('0x35')];var _0x47174c=_0x5ce265?_0x3d1429['count']:_0x3c6a7f[_0xa11e('0x35')]+_0x3c6a7f['limit'];var _0x3e9d19;if(_0x47174c>=_0x203225){_0x47174c=_0x203225;_0x3e9d19=0xc8;}else{_0x3e9d19=0xce;}_0x5d84b7[_0xa11e('0x30')](_0x3e9d19);return _0x5d84b7[_0xa11e('0x36')]('Content-Range',_0x5235f8+'-'+_0x47174c+'/'+_0x203225)['json'](_0x3d1429);}return null;};}function patchUpdates(_0x2cc36b){return function(_0x1069e8){try{jsonpatch[_0xa11e('0x37')](_0x1069e8,_0x2cc36b,!![]);}catch(_0x5ce0c8){return BPromise[_0xa11e('0x38')](_0x5ce0c8);}return _0x1069e8[_0xa11e('0x39')]();};}function saveUpdates(_0x1cc098,_0x2f4c25){return function(_0x656573){if(_0x656573){return _0x656573[_0xa11e('0x3a')](_0x1cc098)['then'](function(_0x5d513e){return _0x5d513e;});}return null;};}function removeEntity(_0x5a5b06,_0x59cdc2){return function(_0x209f80){if(_0x209f80){return _0x209f80[_0xa11e('0x3b')]()[_0xa11e('0x24')](function(){var _0x20523f=_0x209f80[_0xa11e('0x3c')]({'plain':!![]});var _0x27dd4f=_0xa11e('0x3d');return db[_0xa11e('0x3e')][_0xa11e('0x3b')]({'where':{'type':_0x27dd4f,'resourceId':_0x20523f['id']}})['then'](function(){return _0x209f80;});})['then'](function(){_0x5a5b06['status'](0xcc)[_0xa11e('0x2f')]();});}};}function handleEntityNotFound(_0x31920f,_0x13fab6){return function(_0x21c5be){if(!_0x21c5be){_0x31920f['sendStatus'](0x194);}return _0x21c5be;};}function handleError(_0x223713,_0xf266aa){_0xf266aa=_0xf266aa||0x1f4;return function(_0x1fbadc){logger['error'](_0x1fbadc['stack']);if(_0x1fbadc[_0xa11e('0x3f')]){delete _0x1fbadc[_0xa11e('0x3f')];}_0x223713['status'](_0xf266aa)['send'](_0x1fbadc);};}exports['index']=function(_0x5c7372,_0x2e74bd){var _0x378fa0={'include':[{'model':db[_0xa11e('0x40')],'as':_0xa11e('0x41')},{'model':db[_0xa11e('0x42')],'as':_0xa11e('0x43')},{'model':db[_0xa11e('0x44')],'as':_0xa11e('0x45')}]},_0x29a5e3={},_0x23849c={'count':0x0,'rows':[]};var _0x498e3e=_[_0xa11e('0x46')](db['MailAccount'][_0xa11e('0x47')],function(_0x1f1deb){return{'name':_0x1f1deb['fieldName'],'type':_0x1f1deb[_0xa11e('0x48')][_0xa11e('0x49')]};});_0x29a5e3['model']=_[_0xa11e('0x46')](_0x498e3e,_0xa11e('0x3f'));_0x29a5e3[_0xa11e('0x4a')]=_['keys'](_0x5c7372[_0xa11e('0x4a')]);_0x29a5e3[_0xa11e('0x4b')]=_['intersection'](_0x29a5e3[_0xa11e('0x4c')],_0x29a5e3[_0xa11e('0x4a')]);_0x378fa0['attributes']=_[_0xa11e('0x4d')](_0x29a5e3['model'],qs[_0xa11e('0x4e')](_0x5c7372['query'][_0xa11e('0x4e')]));_0x378fa0[_0xa11e('0x4f')]=_0x378fa0[_0xa11e('0x4f')][_0xa11e('0x50')]?_0x378fa0[_0xa11e('0x4f')]:_0x29a5e3['model'];if(!_0x5c7372[_0xa11e('0x4a')]['hasOwnProperty'](_0xa11e('0x51'))){_0x378fa0[_0xa11e('0x33')]=qs['limit'](_0x5c7372['query'][_0xa11e('0x33')]);_0x378fa0[_0xa11e('0x35')]=qs[_0xa11e('0x35')](_0x5c7372['query'][_0xa11e('0x35')]);}_0x378fa0[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x5c7372['query'][_0xa11e('0x53')]);_0x378fa0['where']=qs[_0xa11e('0x4b')](_[_0xa11e('0x54')](_0x5c7372[_0xa11e('0x4a')],_0x29a5e3['filters']),_0x498e3e);if(_0x5c7372[_0xa11e('0x4a')]['filter']){_0x378fa0[_0xa11e('0x55')]=_['merge'](_0x378fa0[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x498e3e,function(_0x5f42ed){if(_0x5f42ed[_0xa11e('0x48')]!==_0xa11e('0x56')){var _0x174f37={};_0x174f37[_0x5f42ed[_0xa11e('0x3f')]]={'$like':'%'+_0x5c7372[_0xa11e('0x4a')][_0xa11e('0x57')]+'%'};return _0x174f37;}})});}_0x378fa0=_['merge']({},_0x378fa0,_0x5c7372['options']);var _0x112d1f={'where':_0x378fa0[_0xa11e('0x55')]};return db[_0xa11e('0x58')]['count'](_0x112d1f)[_0xa11e('0x24')](function(_0x4212b8){_0x23849c[_0xa11e('0x34')]=_0x4212b8;if(_0x5c7372['query'][_0xa11e('0x59')]){_0x378fa0[_0xa11e('0x5a')]=[{'all':!![]}];}return db['MailAccount'][_0xa11e('0x5b')](_0x378fa0);})[_0xa11e('0x24')](function(_0x2d31b8){_0x23849c[_0xa11e('0x5c')]=_0x2d31b8;return _0x23849c;})[_0xa11e('0x24')](respondWithFilteredResult(_0x2e74bd,_0x378fa0))[_0xa11e('0x2e')](handleError(_0x2e74bd,null));};exports[_0xa11e('0x5d')]=function(_0x5db94f,_0x2546b9){var _0x1e266b={'raw':![],'where':{'id':_0x5db94f[_0xa11e('0x5e')]['id']},'include':[{'model':db[_0xa11e('0x40')],'as':_0xa11e('0x41')},{'model':db[_0xa11e('0x42')],'as':'Smtp'},{'model':db[_0xa11e('0x44')],'as':_0xa11e('0x45')}]},_0x3b86bf={};_0x3b86bf[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db['MailAccount'][_0xa11e('0x47')]);_0x3b86bf[_0xa11e('0x4a')]=_[_0xa11e('0x5f')](_0x5db94f['query']);_0x3b86bf[_0xa11e('0x4b')]=_[_0xa11e('0x4d')](_0x3b86bf[_0xa11e('0x4c')],_0x3b86bf[_0xa11e('0x4a')]);_0x1e266b['attributes']=_['intersection'](_0x3b86bf['model'],qs['fields'](_0x5db94f[_0xa11e('0x4a')]['fields']));_0x1e266b['attributes']=_0x1e266b['attributes'][_0xa11e('0x50')]?_0x1e266b[_0xa11e('0x4f')]:_0x3b86bf[_0xa11e('0x4c')];if(_0x5db94f[_0xa11e('0x4a')][_0xa11e('0x59')]){_0x1e266b['include']=[{'all':!![]}];}_0x1e266b=_[_0xa11e('0x60')]({},_0x1e266b,_0x5db94f[_0xa11e('0x61')]);return db[_0xa11e('0x58')][_0xa11e('0x62')](_0x1e266b)[_0xa11e('0x24')](handleEntityNotFound(_0x2546b9,null))['then'](respondWithResult(_0x2546b9,null))[_0xa11e('0x2e')](handleError(_0x2546b9,null));};exports['update']=function(_0x1c2be2,_0x3c5f8f){if(_0x1c2be2[_0xa11e('0x63')]['id']){delete _0x1c2be2[_0xa11e('0x63')]['id'];}return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x1c2be2['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xa11e('0x41')},{'model':db['MailServerOut'],'as':_0xa11e('0x43')},{'model':db[_0xa11e('0x44')],'as':_0xa11e('0x45')}]})[_0xa11e('0x24')](handleEntityNotFound(_0x3c5f8f,null))[_0xa11e('0x24')](saveUpdates(_0x1c2be2['body'],null))['then'](function(_0x4167ec){if(_0x4167ec&&_0x1c2be2[_0xa11e('0x63')][_0xa11e('0x41')]){return db[_0xa11e('0x40')][_0xa11e('0x3a')](_0x1c2be2[_0xa11e('0x63')]['Imap'],{'where':{'MailAccountId':_0x4167ec['id']}})[_0xa11e('0x24')](function(){return _0x4167ec;});}return _0x4167ec;})[_0xa11e('0x24')](function(_0x47c7c7){if(_0x47c7c7&&_0x1c2be2['body'][_0xa11e('0x43')]){return db[_0xa11e('0x42')][_0xa11e('0x3a')](_0x1c2be2[_0xa11e('0x63')][_0xa11e('0x43')],{'where':{'MailAccountId':_0x47c7c7['id']}})['then'](function(){return _0x47c7c7;});}return _0x47c7c7;})[_0xa11e('0x24')](respondWithResult(_0x3c5f8f,null))[_0xa11e('0x2e')](handleError(_0x3c5f8f,null));};exports[_0xa11e('0x64')]=function(_0x4c5025,_0x2e5989){return db[_0xa11e('0x58')][_0xa11e('0x64')]()[_0xa11e('0x24')](respondWithResult(_0x2e5989,null))[_0xa11e('0x2e')](handleError(_0x2e5989,null));};exports[_0xa11e('0x65')]=function(_0x37f912,_0x17eb72,_0x231dbf){if(_0x37f912[_0xa11e('0x63')]['id']){delete _0x37f912[_0xa11e('0x63')]['id'];}return db['MailAccount'][_0xa11e('0x62')]({'where':{'id':_0x37f912['params']['id']}})['then'](handleEntityNotFound(_0x17eb72,null))[_0xa11e('0x24')](function(_0xe02774){if(_0xe02774){_0x37f912[_0xa11e('0x63')][_0xa11e('0x66')]=_0xe02774['id'];return db[_0xa11e('0x67')][_0xa11e('0x68')](_0x37f912[_0xa11e('0x63')]);}})[_0xa11e('0x24')](respondWithResult(_0x17eb72,null))[_0xa11e('0x2e')](handleError(_0x17eb72,null));};exports[_0xa11e('0x69')]=function(_0x4e0141,_0x4906c7,_0x478074){var _0x49b2c2={'raw':![],'where':{}};var _0x57c8a0={};var _0x3d65a0={'count':0x0,'rows':[]};return db[_0xa11e('0x58')]['findOne']({'where':{'id':_0x4e0141[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x4906c7,null))[_0xa11e('0x24')](function(_0x13e13e){if(_0x13e13e){_0x57c8a0[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db[_0xa11e('0x67')][_0xa11e('0x47')]);_0x57c8a0['query']=_[_0xa11e('0x5f')](_0x4e0141[_0xa11e('0x4a')]);_0x57c8a0['filters']=_['intersection'](_0x57c8a0[_0xa11e('0x4c')],_0x57c8a0['query']);_0x49b2c2['attributes']=_['intersection'](_0x57c8a0[_0xa11e('0x4c')],qs[_0xa11e('0x4e')](_0x4e0141['query'][_0xa11e('0x4e')]));_0x49b2c2[_0xa11e('0x4f')]=_0x49b2c2[_0xa11e('0x4f')][_0xa11e('0x50')]?_0x49b2c2['attributes']:_0x57c8a0[_0xa11e('0x4c')];if(!_0x4e0141[_0xa11e('0x4a')]['hasOwnProperty'](_0xa11e('0x51'))){_0x49b2c2[_0xa11e('0x33')]=qs['limit'](_0x4e0141[_0xa11e('0x4a')][_0xa11e('0x33')]);_0x49b2c2[_0xa11e('0x35')]=qs[_0xa11e('0x35')](_0x4e0141[_0xa11e('0x4a')][_0xa11e('0x35')]);}_0x49b2c2[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x4e0141[_0xa11e('0x4a')][_0xa11e('0x53')]);_0x49b2c2[_0xa11e('0x55')]=qs['filters'](_[_0xa11e('0x54')](_0x4e0141['query'],_0x57c8a0[_0xa11e('0x4b')]));_0x49b2c2['where'][_0xa11e('0x66')]=_0x13e13e['id'];if(_0x4e0141[_0xa11e('0x4a')][_0xa11e('0x57')]){_0x49b2c2[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x49b2c2[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x49b2c2[_0xa11e('0x4f')],function(_0x5fc114){var _0x13750a={};_0x13750a[_0x5fc114]={'$like':'%'+_0x4e0141['query']['filter']+'%'};return _0x13750a;})});}_0x49b2c2=_['merge']({},_0x49b2c2,_0x4e0141[_0xa11e('0x61')]);return db[_0xa11e('0x67')]['count']({'where':_0x49b2c2['where']})['then'](function(_0x133221){_0x3d65a0['count']=_0x133221;if(_0x4e0141[_0xa11e('0x4a')]['includeAll']){_0x49b2c2['include']=[{'all':!![]}];}return db[_0xa11e('0x67')]['findAll'](_0x49b2c2);})['then'](function(_0x4e2718){_0x3d65a0[_0xa11e('0x5c')]=_0x4e2718;return _0x3d65a0;});}})[_0xa11e('0x24')](respondWithFilteredResult(_0x4906c7,_0x49b2c2))[_0xa11e('0x2e')](handleError(_0x4906c7,null));};exports[_0xa11e('0x6a')]=function(_0x2135d4,_0xe851c3,_0x31b520){return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x2135d4[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0xe851c3,null))['then'](function(_0x1bc304){if(_0x1bc304){return _0x1bc304[_0xa11e('0x6a')](_0x2135d4[_0xa11e('0x4a')][_0xa11e('0x6b')]);}})[_0xa11e('0x24')](respondWithStatusCode(_0xe851c3,null))[_0xa11e('0x2e')](handleError(_0xe851c3,null));};exports[_0xa11e('0x6c')]=function(_0x5af1b9,_0x51cc0a,_0xb327a1){if(_0x5af1b9[_0xa11e('0x63')]['id']){delete _0x5af1b9[_0xa11e('0x63')]['id'];}return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x5af1b9[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x51cc0a,null))[_0xa11e('0x24')](function(_0xdfef9b){if(_0xdfef9b){_0x5af1b9[_0xa11e('0x63')]['MailAccountId']=_0xdfef9b['id'];return db[_0xa11e('0x6d')]['create'](_0x5af1b9['body']);}})['then'](respondWithResult(_0x51cc0a,null))[_0xa11e('0x2e')](handleError(_0x51cc0a,null));};exports[_0xa11e('0x6e')]=function(_0x4f7ab1,_0xcd7579,_0x150006){var _0x4d634a={'raw':![],'where':{}};var _0x556dfd={};var _0x5a2e38={'count':0x0,'rows':[]};return db[_0xa11e('0x58')]['findOne']({'where':{'id':_0x4f7ab1[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0xcd7579,null))[_0xa11e('0x24')](function(_0x31a473){if(_0x31a473){_0x556dfd[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db[_0xa11e('0x6d')][_0xa11e('0x47')]);_0x556dfd[_0xa11e('0x4a')]=_[_0xa11e('0x5f')](_0x4f7ab1['query']);_0x556dfd[_0xa11e('0x4b')]=_[_0xa11e('0x4d')](_0x556dfd[_0xa11e('0x4c')],_0x556dfd['query']);_0x4d634a[_0xa11e('0x4f')]=_[_0xa11e('0x4d')](_0x556dfd[_0xa11e('0x4c')],qs[_0xa11e('0x4e')](_0x4f7ab1[_0xa11e('0x4a')]['fields']));_0x4d634a[_0xa11e('0x4f')]=_0x4d634a[_0xa11e('0x4f')][_0xa11e('0x50')]?_0x4d634a['attributes']:_0x556dfd[_0xa11e('0x4c')];if(!_0x4f7ab1[_0xa11e('0x4a')]['hasOwnProperty'](_0xa11e('0x51'))){_0x4d634a[_0xa11e('0x33')]=qs[_0xa11e('0x33')](_0x4f7ab1['query']['limit']);_0x4d634a['offset']=qs[_0xa11e('0x35')](_0x4f7ab1['query'][_0xa11e('0x35')]);}_0x4d634a[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x4f7ab1['query'][_0xa11e('0x53')]);_0x4d634a['where']=qs['filters'](_[_0xa11e('0x54')](_0x4f7ab1[_0xa11e('0x4a')],_0x556dfd['filters']));_0x4d634a[_0xa11e('0x55')]['MailAccountId']=_0x31a473['id'];if(_0x4f7ab1[_0xa11e('0x4a')]['filter']){_0x4d634a[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x4d634a[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x4d634a[_0xa11e('0x4f')],function(_0x1937d2){var _0x26a486={};_0x26a486[_0x1937d2]={'$like':'%'+_0x4f7ab1[_0xa11e('0x4a')][_0xa11e('0x57')]+'%'};return _0x26a486;})});}_0x4d634a=_[_0xa11e('0x60')]({},_0x4d634a,_0x4f7ab1[_0xa11e('0x61')]);return db[_0xa11e('0x6d')][_0xa11e('0x34')]({'where':_0x4d634a[_0xa11e('0x55')]})[_0xa11e('0x24')](function(_0x35ed00){_0x5a2e38[_0xa11e('0x34')]=_0x35ed00;if(_0x4f7ab1[_0xa11e('0x4a')][_0xa11e('0x59')]){_0x4d634a[_0xa11e('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa11e('0x5b')](_0x4d634a);})[_0xa11e('0x24')](function(_0x45219a){_0x5a2e38[_0xa11e('0x5c')]=_0x45219a;return _0x5a2e38;});}})[_0xa11e('0x24')](respondWithFilteredResult(_0xcd7579,_0x4d634a))[_0xa11e('0x2e')](handleError(_0xcd7579,null));};exports['removeAnswers']=function(_0x507d63,_0x1cb3ee,_0x328684){return db['MailAccount'][_0xa11e('0x62')]({'where':{'id':_0x507d63[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x1cb3ee,null))[_0xa11e('0x24')](function(_0x1f7f15){if(_0x1f7f15){return _0x1f7f15['removeAnswers'](_0x507d63[_0xa11e('0x4a')]['ids']);}})[_0xa11e('0x24')](respondWithStatusCode(_0x1cb3ee,null))[_0xa11e('0x2e')](handleError(_0x1cb3ee,null));};exports['create']=function(_0x328f29,_0x563c91){var _0x33f04f={'name':_0x328f29['body'][_0xa11e('0x3f')],'key':_0x328f29[_0xa11e('0x63')][_0xa11e('0x49')],'email':_0x328f29[_0xa11e('0x63')]['email'],'ListId':_0x328f29[_0xa11e('0x63')][_0xa11e('0x6f')],'active':!_[_0xa11e('0x70')](_0x328f29[_0xa11e('0x63')][_0xa11e('0x71')])?_0x328f29[_0xa11e('0x63')][_0xa11e('0x71')]:!![],'description':_0x328f29['body'][_0xa11e('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0xa11e('0x70')](_0x328f29[_0xa11e('0x63')][_0xa11e('0x73')])){if(_0x328f29['body'][_0xa11e('0x74')]){_0x33f04f[_0xa11e('0x41')][_0xa11e('0x75')]=_0x33f04f[_0xa11e('0x43')]['user']=_0x328f29[_0xa11e('0x63')][_0xa11e('0x76')];_0x33f04f[_0xa11e('0x41')][_0xa11e('0x77')]=_0x33f04f[_0xa11e('0x43')][_0xa11e('0x78')]=_0x328f29[_0xa11e('0x63')][_0xa11e('0x79')];}else{_0x33f04f[_0xa11e('0x41')][_0xa11e('0x7a')]=_0x33f04f[_0xa11e('0x43')]['authentication']=![];}_0x33f04f[_0xa11e('0x41')][_0xa11e('0x7b')]=_0x328f29[_0xa11e('0x63')][_0xa11e('0x41')][_0xa11e('0x7b')];_0x33f04f[_0xa11e('0x41')][_0xa11e('0x7c')]=_0x328f29['body'][_0xa11e('0x41')]['port'];_0x33f04f[_0xa11e('0x43')][_0xa11e('0x7b')]=_0x328f29[_0xa11e('0x63')][_0xa11e('0x43')]['host'];_0x33f04f['Smtp'][_0xa11e('0x7c')]=_0x328f29[_0xa11e('0x63')][_0xa11e('0x43')][_0xa11e('0x7c')];}else{_0x33f04f[_0xa11e('0x41')][_0xa11e('0x7d')]=_0x33f04f['Smtp'][_0xa11e('0x7d')]=_0x328f29['body'][_0xa11e('0x73')];_0x33f04f['Imap']['user']=_0x33f04f[_0xa11e('0x43')][_0xa11e('0x75')]=_0x328f29[_0xa11e('0x63')]['cuser'];_0x33f04f['Imap'][_0xa11e('0x77')]=_0x33f04f[_0xa11e('0x43')][_0xa11e('0x78')]=_0x328f29[_0xa11e('0x63')][_0xa11e('0x79')];}return db['MailAccount'][_0xa11e('0x68')](_0x33f04f,{'include':[{'model':db[_0xa11e('0x42')],'as':_0xa11e('0x43')},{'model':db['MailServerIn'],'as':_0xa11e('0x41')}]})['then'](function(_0x2a1fb8){var _0x1296d9=_0x328f29[_0xa11e('0x75')]['get']({'plain':!![]});if(!_0x1296d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1296d9['role']===_0xa11e('0x75')){var _0x147b90=_0x2a1fb8[_0xa11e('0x3c')]({'plain':!![]});return db[_0xa11e('0x7e')][_0xa11e('0x62')]({'where':{'name':_0xa11e('0x3d'),'userProfileId':_0x1296d9[_0xa11e('0x7f')]},'raw':!![]})[_0xa11e('0x24')](function(_0xbbff06){if(_0xbbff06&&_0xbbff06['autoAssociation']===0x0){return db[_0xa11e('0x3e')][_0xa11e('0x68')]({'name':_0x147b90['name'],'resourceId':_0x147b90['id'],'type':_0xbbff06['name'],'sectionId':_0xbbff06['id']},{})[_0xa11e('0x24')](function(){return _0x2a1fb8;});}else{return _0x2a1fb8;}})[_0xa11e('0x2e')](function(_0x6c24e6){logger[_0xa11e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6c24e6);throw _0x6c24e6;});}return _0x2a1fb8;})[_0xa11e('0x24')](respondWithResult(_0x563c91,0xc9))[_0xa11e('0x2e')](handleError(_0x563c91,null));};exports[_0xa11e('0x80')]=function(_0x1e6efc,_0x245737,_0x3786b2){return db[_0xa11e('0x58')][_0xa11e('0x81')]({'where':{'id':_0x1e6efc[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x245737,null))[_0xa11e('0x24')](function(_0x2cbcd9){if(_0x2cbcd9){return _0x2cbcd9[_0xa11e('0x80')]();}return null;})[_0xa11e('0x24')](respondWithResult(_0x245737,null))['catch'](handleError(_0x245737,null));};exports[_0xa11e('0x82')]=function(_0x4ec0fc,_0x54927a,_0x3c4230){if(_0x4ec0fc[_0xa11e('0x63')]['id']){delete _0x4ec0fc[_0xa11e('0x63')]['id'];}return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x4ec0fc[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x54927a,null))[_0xa11e('0x24')](function(_0x145f6c){if(_0x145f6c){_0x4ec0fc['body'][_0xa11e('0x66')]=_0x145f6c['id'];return db[_0xa11e('0x40')][_0xa11e('0x68')](_0x4ec0fc[_0xa11e('0x63')]);}})[_0xa11e('0x24')](respondWithResult(_0x54927a,null))[_0xa11e('0x2e')](handleError(_0x54927a,null));};exports[_0xa11e('0x83')]=function(_0x429738,_0x5a44d3,_0x226310){return db[_0xa11e('0x58')]['findOne']({'where':{'id':_0x429738[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x5a44d3,null))[_0xa11e('0x24')](function(_0x452a5b){if(_0x452a5b){return _0x452a5b['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x5a44d3,null))[_0xa11e('0x2e')](handleError(_0x5a44d3,null));};exports['getSmtp']=function(_0x153564,_0x4ab8e1,_0x5f5743){return db['MailAccount']['findOne']({'where':{'id':_0x153564[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x4ab8e1,null))[_0xa11e('0x24')](function(_0x37bd32){if(_0x37bd32){return _0x37bd32[_0xa11e('0x84')]();}return null;})[_0xa11e('0x24')](respondWithResult(_0x4ab8e1,null))[_0xa11e('0x2e')](handleError(_0x4ab8e1,null));};exports[_0xa11e('0x85')]=function(_0x228bcc,_0x287cf4,_0x1ea991){if(_0x228bcc[_0xa11e('0x63')]['id']){delete _0x228bcc[_0xa11e('0x63')]['id'];}return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x228bcc[_0xa11e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x287cf4,null))['then'](function(_0x57e5d0){if(_0x57e5d0){_0x228bcc[_0xa11e('0x63')][_0xa11e('0x66')]=_0x57e5d0['id'];return db[_0xa11e('0x42')][_0xa11e('0x68')](_0x228bcc[_0xa11e('0x63')]);}})[_0xa11e('0x24')](respondWithResult(_0x287cf4,null))[_0xa11e('0x2e')](handleError(_0x287cf4,null));};exports[_0xa11e('0x86')]=function(_0x5a832c,_0xf3e3de,_0x14af46){return db[_0xa11e('0x58')][_0xa11e('0x81')]({'where':{'id':_0x5a832c['params']['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0xf3e3de,null))[_0xa11e('0x24')](function(_0x476d56){if(_0x476d56){return _0x476d56[_0xa11e('0x87')](null);}return null;})['then'](respondWithStatusCode(_0xf3e3de,null))[_0xa11e('0x2e')](handleError(_0xf3e3de,null));};exports[_0xa11e('0x88')]=function(_0x3b0d43,_0x106fe8,_0x501b05){return db['MailInteraction'][_0xa11e('0x62')]({'where':{'id':_0x3b0d43[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x106fe8,null))[_0xa11e('0x24')](function(_0x333c6e){if(_0x333c6e){return _0x333c6e[_0xa11e('0x88')](_0x3b0d43[_0xa11e('0x63')][_0xa11e('0x6b')],_[_0xa11e('0x89')](_0x3b0d43[_0xa11e('0x63')],['ids','id'])||{});}})[_0xa11e('0x24')](respondWithResult(_0x106fe8,null))[_0xa11e('0x2e')](handleError(_0x106fe8,null));};exports['getInteractions']=function(_0x146b8b,_0x4fab21,_0x4aba25){var _0x2e2165={'raw':![],'where':{}};var _0x248be9={};var _0x53e3a0={'count':0x0,'rows':[]};return db[_0xa11e('0x58')]['findOne']({'where':{'id':_0x146b8b[_0xa11e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4fab21,null))[_0xa11e('0x24')](function(_0x3f4c8b){if(_0x3f4c8b){_0x248be9[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db[_0xa11e('0x8a')][_0xa11e('0x47')]);_0x248be9['query']=_['keys'](_0x146b8b['query']);_0x248be9[_0xa11e('0x4b')]=_['intersection'](_0x248be9['model'],_0x248be9['query']);_0x2e2165[_0xa11e('0x4f')]=_[_0xa11e('0x4d')](_0x248be9['model'],qs[_0xa11e('0x4e')](_0x146b8b['query'][_0xa11e('0x4e')]));_0x2e2165['attributes']=_0x2e2165['attributes'][_0xa11e('0x50')]?_0x2e2165['attributes']:_0x248be9[_0xa11e('0x4c')];if(!_0x146b8b['query']['hasOwnProperty']('nolimit')){_0x2e2165[_0xa11e('0x33')]=qs['limit'](_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x33')]);_0x2e2165[_0xa11e('0x35')]=qs[_0xa11e('0x35')](_0x146b8b['query']['offset']);}_0x2e2165[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x53')]);_0x2e2165['where']=qs[_0xa11e('0x4b')](_[_0xa11e('0x54')](_0x146b8b['query'],_0x248be9[_0xa11e('0x4b')]));_0x2e2165[_0xa11e('0x55')][_0xa11e('0x66')]=_0x3f4c8b['id'];if(_0x146b8b[_0xa11e('0x4a')]['filter']){_0x2e2165[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x2e2165[_0xa11e('0x55')],{'$or':_['map'](_0x2e2165['attributes'],function(_0x6c5534){var _0xc9bcfb={};_0xc9bcfb[_0x6c5534]={'$like':'%'+_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x57')]+'%'};return _0xc9bcfb;})});}_0x2e2165=_[_0xa11e('0x60')]({},_0x2e2165,_0x146b8b[_0xa11e('0x61')]);return db[_0xa11e('0x8a')]['count']({'where':_0x2e2165[_0xa11e('0x55')]})['then'](function(_0x413b59){_0x53e3a0['count']=_0x413b59;if(_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x59')]){_0x2e2165[_0xa11e('0x5a')]=[{'model':db[_0xa11e('0x8b')],'as':_0xa11e('0x8c'),'required':![]},{'model':db[_0xa11e('0x8d')],'as':_0xa11e('0x8e'),'attributes':[_0xa11e('0x3f'),_0xa11e('0x8f'),_0xa11e('0x90')],'required':![]},{'model':db[_0xa11e('0x91')],'as':'Tags','attributes':['id',_0xa11e('0x3f'),'color'],'where':_0x146b8b['query']['tag']?{'id':_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x92')]}:undefined,'required':_0x146b8b[_0xa11e('0x4a')][_0xa11e('0x92')]?!![]:![]}];}return db[_0xa11e('0x8a')][_0xa11e('0x5b')](_0x2e2165);})[_0xa11e('0x24')](function(_0x52149d){_0x53e3a0[_0xa11e('0x5c')]=_0x52149d;return _0x53e3a0;});}})[_0xa11e('0x24')](respondWithFilteredResult(_0x4fab21,_0x2e2165))[_0xa11e('0x2e')](handleError(_0x4fab21,null));};exports[_0xa11e('0x93')]=function(_0x31fe4c,_0x4189ba,_0x2c40bc){return db[_0xa11e('0x58')][_0xa11e('0x81')]({'where':{'id':_0x31fe4c[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x4189ba,null))[_0xa11e('0x24')](function(_0x19d564){if(_0x19d564){return db[_0xa11e('0x94')][_0xa11e('0x95')](function(_0x736fad){return db[_0xa11e('0x96')]['destroy']({'where':{'MailAccountId':_0x31fe4c['params']['id']},'transaction':_0x736fad})['then'](function(_0x39a914){var _0x58c96e=_[_0xa11e('0x46')](_0x31fe4c[_0xa11e('0x63')],function(_0x4f3092){_0x4f3092[_0xa11e('0x66')]=_0x31fe4c[_0xa11e('0x5e')]['id'];return _0x4f3092;});return db['MailApplication']['bulkCreate'](_0x58c96e,{'transaction':_0x736fad});});})[_0xa11e('0x24')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x31fe4c[_0xa11e('0x5e')]['id']},'order':_0xa11e('0x97')});});}})[_0xa11e('0x24')](respondWithResult(_0x4189ba,null))['catch'](handleError(_0x4189ba,null));};exports['getApplications']=function(_0x10f440,_0x5d1a3c,_0x6a5345){var _0x30e9c1={};var _0x306110={};var _0x45a437;var _0x4d1972;return db['MailAccount'][_0xa11e('0x81')]({'where':{'id':_0x10f440[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x5d1a3c,null))[_0xa11e('0x24')](function(_0x59ebab){if(_0x59ebab){_0x45a437=_0x59ebab;_0x306110[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db[_0xa11e('0x96')]['rawAttributes']);_0x306110[_0xa11e('0x4a')]=_['keys'](_0x10f440['query']);_0x306110[_0xa11e('0x4b')]=_[_0xa11e('0x4d')](_0x306110[_0xa11e('0x4c')],_0x306110['query']);_0x30e9c1[_0xa11e('0x4f')]=_[_0xa11e('0x4d')](_0x306110['model'],qs[_0xa11e('0x4e')](_0x10f440['query']['fields']));_0x30e9c1['attributes']=_0x30e9c1[_0xa11e('0x4f')]['length']?_0x30e9c1['attributes']:_0x306110[_0xa11e('0x4c')];_0x30e9c1[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x10f440[_0xa11e('0x4a')][_0xa11e('0x53')]);_0x30e9c1[_0xa11e('0x55')]=qs['filters'](_[_0xa11e('0x54')](_0x10f440[_0xa11e('0x4a')],_0x306110['filters']));if(_0x10f440[_0xa11e('0x4a')]['filter']){_0x30e9c1[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x30e9c1[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x30e9c1[_0xa11e('0x4f')],function(_0x3fd7cd){var _0x59c102={};_0x59c102[_0x3fd7cd]={'$like':'%'+_0x10f440[_0xa11e('0x4a')][_0xa11e('0x57')]+'%'};return _0x59c102;})});}_0x30e9c1=_[_0xa11e('0x60')]({},_0x30e9c1,_0x10f440[_0xa11e('0x61')]);return _0x45a437['getApplications'](_0x30e9c1);}})['then'](function(_0x3ad5fb){if(_0x3ad5fb){_0x4d1972=_0x3ad5fb[_0xa11e('0x50')];if(!_0x10f440[_0xa11e('0x4a')][_0xa11e('0x98')](_0xa11e('0x51'))){_0x30e9c1[_0xa11e('0x33')]=qs['limit'](_0x10f440['query']['limit']);_0x30e9c1['offset']=qs[_0xa11e('0x35')](_0x10f440['query'][_0xa11e('0x35')]);}return _0x45a437[_0xa11e('0x99')](_0x30e9c1);}})[_0xa11e('0x24')](function(_0x4ff56a){if(_0x4ff56a){return _0x4ff56a?{'count':_0x4d1972,'rows':_0x4ff56a}:null;}})[_0xa11e('0x24')](respondWithResult(_0x5d1a3c,null))[_0xa11e('0x2e')](handleError(_0x5d1a3c,null));};exports[_0xa11e('0x9a')]=function(_0x1cf4f0,_0x107538,_0x37b2f0){var _0x315064={'raw':!![],'where':{}};var _0x174f75={};var _0x55be69={'count':0x0,'rows':[]};return db[_0xa11e('0x58')][_0xa11e('0x81')]({'where':{'id':_0x1cf4f0['params']['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x107538,null))[_0xa11e('0x24')](function(_0x5ca085){if(_0x5ca085){_0x174f75[_0xa11e('0x4c')]=_['keys'](db[_0xa11e('0x9b')][_0xa11e('0x47')]);_0x174f75[_0xa11e('0x4a')]=_[_0xa11e('0x5f')](_0x1cf4f0[_0xa11e('0x4a')]);_0x174f75['filters']=_['intersection'](_0x174f75['model'],_0x174f75[_0xa11e('0x4a')]);_0x315064[_0xa11e('0x4f')]=_[_0xa11e('0x4d')](_0x174f75[_0xa11e('0x4c')],qs[_0xa11e('0x4e')](_0x1cf4f0[_0xa11e('0x4a')][_0xa11e('0x4e')]));_0x315064['attributes']=_0x315064['attributes'][_0xa11e('0x50')]?_0x315064['attributes']:_0x174f75[_0xa11e('0x4c')];if(!_0x1cf4f0['query'][_0xa11e('0x98')](_0xa11e('0x51'))){_0x315064['limit']=qs[_0xa11e('0x33')](_0x1cf4f0[_0xa11e('0x4a')][_0xa11e('0x33')]);_0x315064[_0xa11e('0x35')]=qs[_0xa11e('0x35')](_0x1cf4f0['query']['offset']);}_0x315064[_0xa11e('0x52')]=qs[_0xa11e('0x53')](_0x1cf4f0['query'][_0xa11e('0x53')]);_0x315064[_0xa11e('0x55')]=qs[_0xa11e('0x4b')](_['pick'](_0x1cf4f0[_0xa11e('0x4a')],_0x174f75[_0xa11e('0x4b')]));_0x315064[_0xa11e('0x55')]['MailAccountId']=_0x5ca085['id'];if(_0x1cf4f0[_0xa11e('0x4a')][_0xa11e('0x57')]){_0x315064[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x315064[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x315064[_0xa11e('0x4f')],function(_0x1bb6cc){var _0xee9177={};_0xee9177[_0x1bb6cc]={'$like':'%'+_0x1cf4f0[_0xa11e('0x4a')]['filter']+'%'};return _0xee9177;})});}if(_0x1cf4f0['query'][_0xa11e('0x9c')]){var _0x46468b=_0x1cf4f0['query']['$gte'][_0xa11e('0x9d')](',');var _0x258a6a={};_0x258a6a[_0x46468b[0x0]]={'$gte':moment(_0x46468b[0x1])['format'](_0xa11e('0x9e'))};_0x315064[_0xa11e('0x55')]=_[_0xa11e('0x60')](_0x315064[_0xa11e('0x55')],_0x258a6a);}_0x315064=_[_0xa11e('0x60')]({},_0x315064,_0x1cf4f0[_0xa11e('0x61')]);return db[_0xa11e('0x9b')]['count']({'where':_0x315064[_0xa11e('0x55')]})['then'](function(_0x26834e){_0x55be69[_0xa11e('0x34')]=_0x26834e;if(_0x1cf4f0[_0xa11e('0x4a')][_0xa11e('0x59')]){_0x315064[_0xa11e('0x5a')]=[{'all':!![]}];}return db[_0xa11e('0x9b')][_0xa11e('0x5b')](_0x315064);})[_0xa11e('0x24')](function(_0x55c12e){if(_0x1cf4f0[_0xa11e('0x4a')][_0xa11e('0x9f')]===_0xa11e('0xa0')){for(var _0x1480e7=0x0;_0x1480e7<_0x55c12e[_0xa11e('0x50')];_0x1480e7++){_0x55c12e[_0x1480e7][_0xa11e('0x63')]=juice(_0x55c12e[_0x1480e7]['body']);}}_0x55be69['rows']=_0x55c12e;return _0x55be69;});}})['then'](respondWithFilteredResult(_0x107538,_0x315064))[_0xa11e('0x2e')](handleError(_0x107538,null));};exports[_0xa11e('0xa1')]=function(_0x1b0693,_0x57f90f,_0x5dfa51){var _0x500f00,_0x44f273={},_0x50d21a;if(_0x1b0693[_0xa11e('0x63')]['to']){_0x50d21a=_0x1b0693[_0xa11e('0x63')]['to'][_0xa11e('0x9d')](',')[0x0];}return db[_0xa11e('0x58')]['find']({'where':{'id':_0x1b0693[_0xa11e('0x5e')]['id']},'include':[{'model':db[_0xa11e('0xa2')],'as':_0xa11e('0xa3'),'include':[{'model':db[_0xa11e('0x8b')],'as':_0xa11e('0xa4'),'where':{'email':_0x50d21a},'limit':0x1,'order':[[_0xa11e('0xa5'),_0xa11e('0xa6')]]}]},{'model':db[_0xa11e('0x42')],'as':_0xa11e('0x43'),'raw':!![]}]})[_0xa11e('0x24')](handleEntityNotFound(_0x57f90f,null))[_0xa11e('0x24')](function(_0x2082bd){if(_0x2082bd){_0x500f00=_0x2082bd;if(_0x2082bd[_0xa11e('0x43')]){if(_[_0xa11e('0x70')](_0x1b0693[_0xa11e('0x63')][_0xa11e('0xa7')])){_0x1b0693[_0xa11e('0x63')][_0xa11e('0xa7')]=util[_0xa11e('0xa8')]('%s\x20<%s>',_0x2082bd[_0xa11e('0x3f')],_0x2082bd[_0xa11e('0xa9')]||_0x2082bd[_0xa11e('0x43')][_0xa11e('0x75')]);}if(_0x1b0693[_0xa11e('0x63')][_0xa11e('0xaa')]&&_0x1b0693[_0xa11e('0x63')][_0xa11e('0xaa')][_0xa11e('0x50')]){for(var _0x2d95b9=0x0;_0x2d95b9<_0x1b0693[_0xa11e('0x63')][_0xa11e('0xaa')][_0xa11e('0x50')];_0x2d95b9+=0x1){_0x1b0693['body']['attachments'][_0x2d95b9]={'filename':_0x1b0693['body']['attachments'][_0x2d95b9][_0xa11e('0x3f')],'path':path[_0xa11e('0xab')](config[_0xa11e('0xac')],'server/files/attachments',_0x1b0693[_0xa11e('0x63')][_0xa11e('0xaa')][_0x2d95b9][_0xa11e('0xad')])};}}var _0x1a7e06={'tls':{'rejectUnauthorized':![]}};if(_[_0xa11e('0x70')](_0x2082bd[_0xa11e('0x43')]['service'])){if(_0x2082bd[_0xa11e('0x43')][_0xa11e('0x7a')]){_0x1a7e06[_0xa11e('0xae')]={'user':_0x2082bd[_0xa11e('0x43')][_0xa11e('0x75')],'pass':_0x2082bd[_0xa11e('0x43')]['pass']};}_0x1a7e06[_0xa11e('0x7b')]=_0x2082bd['Smtp'][_0xa11e('0x7b')];_0x1a7e06[_0xa11e('0x7c')]=_0x2082bd[_0xa11e('0x43')]['port'];_0x1a7e06[_0xa11e('0xaf')]=_0x2082bd['Smtp'][_0xa11e('0xaf')];}else{_0x1a7e06['service']=_0x2082bd['Smtp'][_0xa11e('0x7d')];_0x1a7e06['auth']={'user':_0x2082bd[_0xa11e('0x43')][_0xa11e('0x75')],'pass':_0x2082bd[_0xa11e('0x43')][_0xa11e('0x78')]};}return respondWithRpcPromise(_0xa11e('0xb0'),_0xa11e('0xb1'),{'account':_0x1a7e06,'message':_0x1b0693[_0xa11e('0x63')]});}else{throw new Error(_0xa11e('0xb2'));}}})[_0xa11e('0x24')](function(_0x2d9003){if(_0x2d9003){_0x44f273=_0x2d9003;if(_0x500f00[_0xa11e('0xa3')]){if(_0x500f00[_0xa11e('0xa3')]['Contacts'][_0xa11e('0x50')]){return _0x500f00['List']['Contacts'][0x0];}else{return db[_0xa11e('0x8b')][_0xa11e('0x68')](_[_0xa11e('0x1e')](_0x1b0693['body'],{'firstName':_0x1b0693[_0xa11e('0x63')]['to'],'email':_0x1b0693['body']['to'],'phone':_0x1b0693[_0xa11e('0x63')]['to'],'ListId':_0x500f00[_0xa11e('0x6f')]}));}}else{throw new Error(_0xa11e('0xb2'));}}})[_0xa11e('0x24')](function(_0x19bde8){if(_0x19bde8){var _0x16be54={'UserId':_0x1b0693[_0xa11e('0x75')]['id'],'ContactId':_0x19bde8['id'],'MailAccountId':_0x500f00['id'],'inReplyTo':_0x44f273[_0xa11e('0xb3')],'to':_0x1b0693['body']['from'],'cc':_0x1b0693[_0xa11e('0x63')]['cc'],'subject':_0x1b0693[_0xa11e('0x63')][_0xa11e('0xb4')],'attach':_0x1b0693['body']['attach'],'firstMsgDirection':_0xa11e('0xb5'),'lastMsgAt':moment()[_0xa11e('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xa11e('0xb5'),'Messages':[_[_0xa11e('0x60')](_0x1b0693['body'],{'messageId':_0x44f273[_0xa11e('0xb3')],'sentAt':moment()[_0xa11e('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x500f00['id'],'UserId':_0x1b0693[_0xa11e('0x75')]['id'],'ContactId':_0x19bde8['id']})]};if(_0x1b0693['body']['Interaction']){_0x16be54=_[_0xa11e('0x60')](_0x16be54,_0x1b0693[_0xa11e('0x63')][_0xa11e('0xb6')]);}return db['MailInteraction']['create'](_0x16be54,{'include':[{'model':db['MailMessage'],'as':_0xa11e('0xb7')}]});}})[_0xa11e('0x24')](respondWithResult(_0x57f90f,null))[_0xa11e('0x2e')](handleError(_0x57f90f,null));};exports['verifySmtp']=function(_0x38a341,_0x4f011a,_0x20e6b5){return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x38a341[_0xa11e('0x5e')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xa11e('0x43'),'raw':!![]}]})[_0xa11e('0x24')](handleEntityNotFound(_0x4f011a,null))['then'](function(_0x5b34ab){if(_0x5b34ab&&_0x5b34ab['Smtp']){var _0x4db653={'id':_0x5b34ab['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5b34ab[_0xa11e('0x43')]['service']){_0x4db653[_0xa11e('0x7d')]=_0x5b34ab[_0xa11e('0x43')][_0xa11e('0x7d')];}else{_0x4db653[_0xa11e('0x7b')]=_0x5b34ab[_0xa11e('0x43')][_0xa11e('0x7b')];_0x4db653['port']=_0x5b34ab[_0xa11e('0x43')]['port'];_0x4db653['secure']=_0x5b34ab[_0xa11e('0x43')][_0xa11e('0xaf')];}if(_0x5b34ab[_0xa11e('0x43')][_0xa11e('0x7a')]){_0x4db653[_0xa11e('0xae')]={'user':_0x5b34ab[_0xa11e('0x43')][_0xa11e('0x75')],'pass':_0x5b34ab[_0xa11e('0x43')][_0xa11e('0x78')]};}return respondWithRpcPromise(_0xa11e('0xb8'),_0xa11e('0xb9'),{'account':_0x4db653});}})[_0xa11e('0x24')](respondWithResult(_0x4f011a,null))['catch'](handleError(_0x4f011a,null));};exports[_0xa11e('0x3b')]=function(_0x4e74b5,_0x1d41f5){return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x4e74b5['params']['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x1d41f5,null))[_0xa11e('0x24')](function(_0x94089d){if(_0x94089d&&_0x94089d[_0xa11e('0x7d')]){throw new db[(_0xa11e('0xba'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x94089d;})['then'](removeEntity(_0x1d41f5,null))[_0xa11e('0x2e')](handleError(_0x1d41f5,null));};exports[_0xa11e('0xbb')]=function(_0x11016a,_0xce2318,_0x1cdd50){return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x11016a[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0xce2318,null))[_0xa11e('0x24')](function(_0x468034){if(_0x468034){return _0x468034[_0xa11e('0xbb')](_0x11016a[_0xa11e('0x63')][_0xa11e('0x6b')],_[_0xa11e('0x89')](_0x11016a['body'],[_0xa11e('0x6b'),'id'])||{})[_0xa11e('0xbc')](function(_0x2df96d){for(var _0x2189b9=0x0;_0x2189b9<_0x11016a['body'][_0xa11e('0x6b')][_0xa11e('0x50')];_0x2189b9+=0x1){socket['emit'](_0xa11e('0xbd'),{'UserId':Number(_0x11016a[_0xa11e('0x63')]['ids'][_0x2189b9]),'MailAccountId':Number(_0x11016a['params']['id'])});}return _0x2df96d;});}})[_0xa11e('0x24')](respondWithResult(_0xce2318,null))[_0xa11e('0x2e')](handleError(_0xce2318,null));};exports['removeAgents']=function(_0x196a72,_0x2db1ea,_0x5795bf){return db[_0xa11e('0x58')][_0xa11e('0x62')]({'where':{'id':_0x196a72[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x2db1ea,null))[_0xa11e('0x24')](function(_0xb6e8b8){if(_0xb6e8b8){return _0xb6e8b8[_0xa11e('0xbe')](_0x196a72['query'][_0xa11e('0x6b')])[_0xa11e('0x24')](function(){if(_[_0xa11e('0xbf')](_0x196a72[_0xa11e('0x4a')][_0xa11e('0x6b')])){for(var _0x166485=0x0;_0x166485<_0x196a72[_0xa11e('0x4a')][_0xa11e('0x6b')][_0xa11e('0x50')];_0x166485+=0x1){socket[_0xa11e('0xc0')](_0xa11e('0xc1'),{'UserId':Number(_0x196a72[_0xa11e('0x4a')][_0xa11e('0x6b')][_0x166485]),'MailAccountId':Number(_0x196a72[_0xa11e('0x5e')]['id'])});}}else{socket[_0xa11e('0xc0')](_0xa11e('0xc1'),{'UserId':Number(_0x196a72[_0xa11e('0x4a')]['ids']),'MailAccountId':Number(_0x196a72['params']['id'])});}});}})[_0xa11e('0x24')](respondWithStatusCode(_0x2db1ea,null))[_0xa11e('0x2e')](handleError(_0x2db1ea,null));};exports[_0xa11e('0xc2')]=function(_0x3ce2a2,_0x2d6434,_0x2c938a){var _0x3a745f={};var _0x262d25={};var _0x5c3148;var _0x28bb8f;return db[_0xa11e('0x58')][_0xa11e('0x81')]({'where':{'id':_0x3ce2a2[_0xa11e('0x5e')]['id']}})[_0xa11e('0x24')](handleEntityNotFound(_0x2d6434,null))[_0xa11e('0x24')](function(_0x4685fd){if(_0x4685fd){_0x5c3148=_0x4685fd;_0x262d25[_0xa11e('0x4c')]=_[_0xa11e('0x5f')](db[_0xa11e('0x8d')]['rawAttributes']);_0x262d25[_0xa11e('0x4a')]=_[_0xa11e('0x5f')](_0x3ce2a2[_0xa11e('0x4a')]);_0x262d25[_0xa11e('0x4b')]=_[_0xa11e('0x4d')](_0x262d25[_0xa11e('0x4c')],_0x262d25[_0xa11e('0x4a')]);_0x3a745f['attributes']=_[_0xa11e('0x4d')](_0x262d25['model'],qs[_0xa11e('0x4e')](_0x3ce2a2[_0xa11e('0x4a')][_0xa11e('0x4e')]));_0x3a745f['attributes']=_0x3a745f['attributes'][_0xa11e('0x50')]?_0x3a745f[_0xa11e('0x4f')]:_0x262d25[_0xa11e('0x4c')];_0x3a745f['order']=qs[_0xa11e('0x53')](_0x3ce2a2['query'][_0xa11e('0x53')]);_0x3a745f[_0xa11e('0x55')]=qs[_0xa11e('0x4b')](_[_0xa11e('0x54')](_0x3ce2a2[_0xa11e('0x4a')],_0x262d25[_0xa11e('0x4b')]));if(_0x3ce2a2[_0xa11e('0x4a')]['filter']){_0x3a745f[_0xa11e('0x55')]=_['merge'](_0x3a745f[_0xa11e('0x55')],{'$or':_[_0xa11e('0x46')](_0x3a745f[_0xa11e('0x4f')],function(_0x51bcac){var _0x1bcb15={};_0x1bcb15[_0x51bcac]={'$like':'%'+_0x3ce2a2[_0xa11e('0x4a')][_0xa11e('0x57')]+'%'};return _0x1bcb15;})});}_0x3a745f=_['merge']({},_0x3a745f,_0x3ce2a2['options']);return _0x5c3148[_0xa11e('0xc2')](_0x3a745f);}})[_0xa11e('0x24')](function(_0x1dd3d1){if(_0x1dd3d1){_0x28bb8f=_0x1dd3d1[_0xa11e('0x50')];if(!_0x3ce2a2['query'][_0xa11e('0x98')](_0xa11e('0x51'))){_0x3a745f[_0xa11e('0x33')]=qs['limit'](_0x3ce2a2[_0xa11e('0x4a')][_0xa11e('0x33')]);_0x3a745f[_0xa11e('0x35')]=qs[_0xa11e('0x35')](_0x3ce2a2[_0xa11e('0x4a')][_0xa11e('0x35')]);}return _0x5c3148[_0xa11e('0xc2')](_0x3a745f);}})[_0xa11e('0x24')](function(_0xdb9d9c){if(_0xdb9d9c){return _0xdb9d9c?{'count':_0x28bb8f,'rows':_0xdb9d9c}:null;}})[_0xa11e('0x24')](respondWithResult(_0x2d6434,null))[_0xa11e('0x2e')](handleError(_0x2d6434,null));}; \ No newline at end of file +var _0x1071=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','get','UserProfileResource','destroy','sendStatus','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','MailAccount','includeAll','include','findAll','rows','show','params','Pause','update','body','describe','addDisposition','find','Disposition','getDispositions','findOne','hasOwnProperty','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','options','removeAnswers','key','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','CmList','CmContact','updatedAt','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','Contacts','messageId','subject','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','moment','bluebird','mustache','util'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1071,0x189));var _0x1107=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1071[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x1107('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1107('0x1'));var BPromise=require(_0x1107('0x2'));var Mustache=require(_0x1107('0x3'));var util=require(_0x1107('0x4'));var path=require(_0x1107('0x5'));var sox=require(_0x1107('0x6'));var csv=require('to-csv');var ejs=require(_0x1107('0x7'));var fs=require('fs');var fs_extra=require(_0x1107('0x8'));var _=require(_0x1107('0x9'));var squel=require(_0x1107('0xa'));var crypto=require(_0x1107('0xb'));var jsforce=require(_0x1107('0xc'));var deskjs=require(_0x1107('0xd'));var toCsv=require(_0x1107('0xe'));var querystring=require(_0x1107('0xf'));var Papa=require('papaparse');var htmlToText=require('html-to-text');var juice=require(_0x1107('0x10'));var Redis=require(_0x1107('0x11'));var authService=require(_0x1107('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1107('0x13'));var hardwareService=require(_0x1107('0x14'));var logger=require('../../config/logger')(_0x1107('0x15'));var utils=require(_0x1107('0x16'));var config=require(_0x1107('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1107('0x18'))['db'];config[_0x1107('0x19')]=_[_0x1107('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1107('0x1b'))(new Redis(config[_0x1107('0x19')]));require(_0x1107('0x1c'))[_0x1107('0x1d')](socket);var jayson=require(_0x1107('0x1e'));var client=jayson[_0x1107('0x1f')][_0x1107('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x353e9c,_0x53ccf0,_0x20cd8a,_0x8a0145){return new BPromise(function(_0xfe0a99,_0x2422f3){var _0x2c4930=_0x8a0145||client;return _0x2c4930[_0x1107('0x21')](_0x353e9c,_0x20cd8a)[_0x1107('0x22')](function(_0x5b37c7){logger['info'](_0x1107('0x23'),_0x53ccf0,_0x1107('0x24'));logger[_0x1107('0x25')](_0x1107('0x26'),_0x53ccf0,'request\x20sent',JSON[_0x1107('0x27')](_0x5b37c7));if(_0x5b37c7['error']){if(_0x5b37c7['error'][_0x1107('0x28')]===0x1f4){logger[_0x1107('0x29')](_0x1107('0x23'),_0x53ccf0,_0x5b37c7[_0x1107('0x29')][_0x1107('0x2a')]);return _0x2422f3(_0x5b37c7[_0x1107('0x29')]['message']);}logger[_0x1107('0x29')](_0x1107('0x23'),_0x53ccf0,_0x5b37c7[_0x1107('0x29')][_0x1107('0x2a')]);return _0xfe0a99(_0x5b37c7[_0x1107('0x29')][_0x1107('0x2a')]);}else{logger[_0x1107('0x2b')](_0x1107('0x23'),_0x53ccf0,_0x1107('0x24'));_0xfe0a99(_0x5b37c7['result'][_0x1107('0x2a')]);}})[_0x1107('0x2c')](function(_0x5d8528){logger[_0x1107('0x29')]('MailAccount,\x20%s,\x20%s',_0x53ccf0,_0x5d8528);_0x2422f3(_0x5d8528);});});}function respondWithStatusCode(_0x5913e6,_0x69ca89){_0x69ca89=_0x69ca89||0xcc;return function(_0x443a73){if(_0x443a73){return _0x5913e6['sendStatus'](_0x69ca89);}return _0x5913e6[_0x1107('0x2d')](_0x69ca89)[_0x1107('0x2e')]();};}function respondWithResult(_0x34cba4,_0x31a79c){_0x31a79c=_0x31a79c||0xc8;return function(_0x25bc77){if(_0x25bc77){return _0x34cba4[_0x1107('0x2d')](_0x31a79c)[_0x1107('0x2f')](_0x25bc77);}};}function respondWithFilteredResult(_0x3e3f72,_0x49cce9){return function(_0xc51df1){if(_0xc51df1){var _0x43f507=typeof _0x49cce9['offset']===_0x1107('0x30')&&typeof _0x49cce9['limit']===_0x1107('0x30');var _0x3d8c08=_0xc51df1[_0x1107('0x31')];var _0xab7ef4=_0x43f507?0x0:_0x49cce9[_0x1107('0x32')];var _0x2c0473=_0x43f507?_0xc51df1[_0x1107('0x31')]:_0x49cce9[_0x1107('0x32')]+_0x49cce9[_0x1107('0x33')];var _0x51d88d;if(_0x2c0473>=_0x3d8c08){_0x2c0473=_0x3d8c08;_0x51d88d=0xc8;}else{_0x51d88d=0xce;}_0x3e3f72[_0x1107('0x2d')](_0x51d88d);return _0x3e3f72[_0x1107('0x34')](_0x1107('0x35'),_0xab7ef4+'-'+_0x2c0473+'/'+_0x3d8c08)[_0x1107('0x2f')](_0xc51df1);}return null;};}function patchUpdates(_0x1419a8){return function(_0x2aa2f9){try{jsonpatch['apply'](_0x2aa2f9,_0x1419a8,!![]);}catch(_0x2762c8){return BPromise[_0x1107('0x36')](_0x2762c8);}return _0x2aa2f9[_0x1107('0x37')]();};}function saveUpdates(_0x49d4bc,_0xacee92){return function(_0xea1a7a){if(_0xea1a7a){return _0xea1a7a['update'](_0x49d4bc)[_0x1107('0x22')](function(_0x43f282){return _0x43f282;});}return null;};}function removeEntity(_0x30d37a,_0x3cca61){return function(_0x5d123a){if(_0x5d123a){return _0x5d123a['destroy']()['then'](function(){var _0x34d6c6=_0x5d123a[_0x1107('0x38')]({'plain':!![]});var _0x43990a='MailAccounts';return db[_0x1107('0x39')][_0x1107('0x3a')]({'where':{'type':_0x43990a,'resourceId':_0x34d6c6['id']}})[_0x1107('0x22')](function(){return _0x5d123a;});})[_0x1107('0x22')](function(){_0x30d37a['status'](0xcc)[_0x1107('0x2e')]();});}};}function handleEntityNotFound(_0x2b09a9,_0x156bee){return function(_0x545c6d){if(!_0x545c6d){_0x2b09a9[_0x1107('0x3b')](0x194);}return _0x545c6d;};}function handleError(_0xbaabab,_0x24a4fc){_0x24a4fc=_0x24a4fc||0x1f4;return function(_0x64dbc2){logger['error'](_0x64dbc2[_0x1107('0x3c')]);if(_0x64dbc2['name']){delete _0x64dbc2[_0x1107('0x3d')];}_0xbaabab[_0x1107('0x2d')](_0x24a4fc)['send'](_0x64dbc2);};}exports[_0x1107('0x3e')]=function(_0x3e8f8f,_0x1881cf){var _0x372282={'include':[{'model':db[_0x1107('0x3f')],'as':_0x1107('0x40')},{'model':db[_0x1107('0x41')],'as':_0x1107('0x42')},{'model':db['Pause'],'as':_0x1107('0x43')}]},_0x3e19d5={},_0x34879f={'count':0x0,'rows':[]};var _0x3a76fc=_['map'](db['MailAccount'][_0x1107('0x44')],function(_0xf87cbd){return{'name':_0xf87cbd['fieldName'],'type':_0xf87cbd['type']['key']};});_0x3e19d5[_0x1107('0x45')]=_['map'](_0x3a76fc,'name');_0x3e19d5['query']=_[_0x1107('0x46')](_0x3e8f8f[_0x1107('0x47')]);_0x3e19d5[_0x1107('0x48')]=_[_0x1107('0x49')](_0x3e19d5[_0x1107('0x45')],_0x3e19d5[_0x1107('0x47')]);_0x372282[_0x1107('0x4a')]=_[_0x1107('0x49')](_0x3e19d5[_0x1107('0x45')],qs[_0x1107('0x4b')](_0x3e8f8f[_0x1107('0x47')][_0x1107('0x4b')]));_0x372282[_0x1107('0x4a')]=_0x372282[_0x1107('0x4a')][_0x1107('0x4c')]?_0x372282[_0x1107('0x4a')]:_0x3e19d5[_0x1107('0x45')];if(!_0x3e8f8f[_0x1107('0x47')]['hasOwnProperty'](_0x1107('0x4d'))){_0x372282[_0x1107('0x33')]=qs[_0x1107('0x33')](_0x3e8f8f['query']['limit']);_0x372282['offset']=qs[_0x1107('0x32')](_0x3e8f8f[_0x1107('0x47')]['offset']);}_0x372282[_0x1107('0x4e')]=qs[_0x1107('0x4f')](_0x3e8f8f[_0x1107('0x47')][_0x1107('0x4f')]);_0x372282[_0x1107('0x50')]=qs[_0x1107('0x48')](_[_0x1107('0x51')](_0x3e8f8f['query'],_0x3e19d5['filters']),_0x3a76fc);if(_0x3e8f8f[_0x1107('0x47')][_0x1107('0x52')]){_0x372282[_0x1107('0x50')]=_[_0x1107('0x53')](_0x372282['where'],{'$or':_[_0x1107('0x54')](_0x3a76fc,function(_0x1a7595){if(_0x1a7595['type']!==_0x1107('0x55')){var _0x10c7b0={};_0x10c7b0[_0x1a7595[_0x1107('0x3d')]]={'$like':'%'+_0x3e8f8f[_0x1107('0x47')]['filter']+'%'};return _0x10c7b0;}})});}_0x372282=_[_0x1107('0x53')]({},_0x372282,_0x3e8f8f['options']);var _0x1398b4={'where':_0x372282[_0x1107('0x50')]};return db[_0x1107('0x56')][_0x1107('0x31')](_0x1398b4)[_0x1107('0x22')](function(_0x315138){_0x34879f['count']=_0x315138;if(_0x3e8f8f['query'][_0x1107('0x57')]){_0x372282[_0x1107('0x58')]=[{'all':!![]}];}return db['MailAccount'][_0x1107('0x59')](_0x372282);})[_0x1107('0x22')](function(_0xd257c7){_0x34879f[_0x1107('0x5a')]=_0xd257c7;return _0x34879f;})[_0x1107('0x22')](respondWithFilteredResult(_0x1881cf,_0x372282))[_0x1107('0x2c')](handleError(_0x1881cf,null));};exports[_0x1107('0x5b')]=function(_0x108876,_0x3b4d85){var _0x5bdf25={'raw':![],'where':{'id':_0x108876[_0x1107('0x5c')]['id']},'include':[{'model':db[_0x1107('0x3f')],'as':_0x1107('0x40')},{'model':db[_0x1107('0x41')],'as':_0x1107('0x42')},{'model':db[_0x1107('0x5d')],'as':_0x1107('0x43')}]},_0x4f6ebb={};_0x4f6ebb[_0x1107('0x45')]=_['keys'](db['MailAccount'][_0x1107('0x44')]);_0x4f6ebb[_0x1107('0x47')]=_[_0x1107('0x46')](_0x108876[_0x1107('0x47')]);_0x4f6ebb[_0x1107('0x48')]=_['intersection'](_0x4f6ebb['model'],_0x4f6ebb['query']);_0x5bdf25[_0x1107('0x4a')]=_[_0x1107('0x49')](_0x4f6ebb['model'],qs[_0x1107('0x4b')](_0x108876[_0x1107('0x47')][_0x1107('0x4b')]));_0x5bdf25[_0x1107('0x4a')]=_0x5bdf25[_0x1107('0x4a')]['length']?_0x5bdf25['attributes']:_0x4f6ebb[_0x1107('0x45')];if(_0x108876[_0x1107('0x47')][_0x1107('0x57')]){_0x5bdf25['include']=[{'all':!![]}];}_0x5bdf25=_[_0x1107('0x53')]({},_0x5bdf25,_0x108876['options']);return db['MailAccount']['find'](_0x5bdf25)[_0x1107('0x22')](handleEntityNotFound(_0x3b4d85,null))[_0x1107('0x22')](respondWithResult(_0x3b4d85,null))[_0x1107('0x2c')](handleError(_0x3b4d85,null));};exports[_0x1107('0x5e')]=function(_0x4f48ae,_0x387a2e){if(_0x4f48ae[_0x1107('0x5f')]['id']){delete _0x4f48ae[_0x1107('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x4f48ae[_0x1107('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x1107('0x41')],'as':_0x1107('0x42')},{'model':db['Pause'],'as':_0x1107('0x43')}]})[_0x1107('0x22')](handleEntityNotFound(_0x387a2e,null))['then'](saveUpdates(_0x4f48ae['body'],null))['then'](function(_0x263191){if(_0x263191&&_0x4f48ae[_0x1107('0x5f')][_0x1107('0x40')]){return db[_0x1107('0x3f')][_0x1107('0x5e')](_0x4f48ae[_0x1107('0x5f')]['Imap'],{'where':{'MailAccountId':_0x263191['id']}})[_0x1107('0x22')](function(){return _0x263191;});}return _0x263191;})[_0x1107('0x22')](function(_0x2bcae9){if(_0x2bcae9&&_0x4f48ae['body'][_0x1107('0x42')]){return db['MailServerOut'][_0x1107('0x5e')](_0x4f48ae['body'][_0x1107('0x42')],{'where':{'MailAccountId':_0x2bcae9['id']}})[_0x1107('0x22')](function(){return _0x2bcae9;});}return _0x2bcae9;})[_0x1107('0x22')](respondWithResult(_0x387a2e,null))[_0x1107('0x2c')](handleError(_0x387a2e,null));};exports[_0x1107('0x60')]=function(_0xe90c79,_0x1150be){return db[_0x1107('0x56')][_0x1107('0x60')]()[_0x1107('0x22')](respondWithResult(_0x1150be,null))[_0x1107('0x2c')](handleError(_0x1150be,null));};exports[_0x1107('0x61')]=function(_0x261503,_0x594cda,_0xbddb4c){if(_0x261503[_0x1107('0x5f')]['id']){delete _0x261503['body']['id'];}return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x261503[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x594cda,null))[_0x1107('0x22')](function(_0x11e807){if(_0x11e807){_0x261503[_0x1107('0x5f')]['MailAccountId']=_0x11e807['id'];return db[_0x1107('0x63')]['create'](_0x261503[_0x1107('0x5f')]);}})['then'](respondWithResult(_0x594cda,null))['catch'](handleError(_0x594cda,null));};exports[_0x1107('0x64')]=function(_0x39e340,_0x31b745,_0x192e53){var _0x1afb21={'raw':![],'where':{}};var _0x2ebfe4={};var _0x5c239c={'count':0x0,'rows':[]};return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x39e340[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x31b745,null))[_0x1107('0x22')](function(_0x3f8d28){if(_0x3f8d28){_0x2ebfe4['model']=_[_0x1107('0x46')](db[_0x1107('0x63')][_0x1107('0x44')]);_0x2ebfe4[_0x1107('0x47')]=_['keys'](_0x39e340[_0x1107('0x47')]);_0x2ebfe4[_0x1107('0x48')]=_[_0x1107('0x49')](_0x2ebfe4[_0x1107('0x45')],_0x2ebfe4['query']);_0x1afb21['attributes']=_[_0x1107('0x49')](_0x2ebfe4[_0x1107('0x45')],qs[_0x1107('0x4b')](_0x39e340[_0x1107('0x47')][_0x1107('0x4b')]));_0x1afb21[_0x1107('0x4a')]=_0x1afb21[_0x1107('0x4a')][_0x1107('0x4c')]?_0x1afb21[_0x1107('0x4a')]:_0x2ebfe4[_0x1107('0x45')];if(!_0x39e340[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x1afb21[_0x1107('0x33')]=qs[_0x1107('0x33')](_0x39e340['query'][_0x1107('0x33')]);_0x1afb21[_0x1107('0x32')]=qs[_0x1107('0x32')](_0x39e340[_0x1107('0x47')][_0x1107('0x32')]);}_0x1afb21[_0x1107('0x4e')]=qs[_0x1107('0x4f')](_0x39e340['query']['sort']);_0x1afb21[_0x1107('0x50')]=qs[_0x1107('0x48')](_[_0x1107('0x51')](_0x39e340[_0x1107('0x47')],_0x2ebfe4[_0x1107('0x48')]));_0x1afb21[_0x1107('0x50')][_0x1107('0x67')]=_0x3f8d28['id'];if(_0x39e340[_0x1107('0x47')]['filter']){_0x1afb21[_0x1107('0x50')]=_[_0x1107('0x53')](_0x1afb21['where'],{'$or':_[_0x1107('0x54')](_0x1afb21[_0x1107('0x4a')],function(_0x30943a){var _0x43f711={};_0x43f711[_0x30943a]={'$like':'%'+_0x39e340['query'][_0x1107('0x52')]+'%'};return _0x43f711;})});}_0x1afb21=_[_0x1107('0x53')]({},_0x1afb21,_0x39e340['options']);return db['Disposition'][_0x1107('0x31')]({'where':_0x1afb21[_0x1107('0x50')]})[_0x1107('0x22')](function(_0x5a92b1){_0x5c239c[_0x1107('0x31')]=_0x5a92b1;if(_0x39e340[_0x1107('0x47')][_0x1107('0x57')]){_0x1afb21[_0x1107('0x58')]=[{'all':!![]}];}return db[_0x1107('0x63')]['findAll'](_0x1afb21);})[_0x1107('0x22')](function(_0x4d4c48){_0x5c239c[_0x1107('0x5a')]=_0x4d4c48;return _0x5c239c;});}})[_0x1107('0x22')](respondWithFilteredResult(_0x31b745,_0x1afb21))[_0x1107('0x2c')](handleError(_0x31b745,null));};exports[_0x1107('0x68')]=function(_0x12daff,_0x317525,_0xd62b4e){return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x12daff['params']['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x317525,null))[_0x1107('0x22')](function(_0xc989cc){if(_0xc989cc){return _0xc989cc[_0x1107('0x68')](_0x12daff[_0x1107('0x47')][_0x1107('0x69')]);}})[_0x1107('0x22')](respondWithStatusCode(_0x317525,null))[_0x1107('0x2c')](handleError(_0x317525,null));};exports[_0x1107('0x6a')]=function(_0x5b3a6d,_0x5d2f2b,_0x585894){if(_0x5b3a6d[_0x1107('0x5f')]['id']){delete _0x5b3a6d[_0x1107('0x5f')]['id'];}return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x5b3a6d[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x5d2f2b,null))['then'](function(_0x3278d2){if(_0x3278d2){_0x5b3a6d[_0x1107('0x5f')]['MailAccountId']=_0x3278d2['id'];return db[_0x1107('0x6b')][_0x1107('0x6c')](_0x5b3a6d['body']);}})[_0x1107('0x22')](respondWithResult(_0x5d2f2b,null))['catch'](handleError(_0x5d2f2b,null));};exports[_0x1107('0x6d')]=function(_0x2a2d63,_0x4aaa81,_0x485895){var _0x2c6620={'raw':![],'where':{}};var _0x4ceadf={};var _0x1f26d4={'count':0x0,'rows':[]};return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x2a2d63['params']['id']}})['then'](handleEntityNotFound(_0x4aaa81,null))[_0x1107('0x22')](function(_0x3b9d5a){if(_0x3b9d5a){_0x4ceadf[_0x1107('0x45')]=_['keys'](db[_0x1107('0x6b')][_0x1107('0x44')]);_0x4ceadf['query']=_[_0x1107('0x46')](_0x2a2d63[_0x1107('0x47')]);_0x4ceadf['filters']=_['intersection'](_0x4ceadf[_0x1107('0x45')],_0x4ceadf[_0x1107('0x47')]);_0x2c6620[_0x1107('0x4a')]=_[_0x1107('0x49')](_0x4ceadf['model'],qs['fields'](_0x2a2d63['query'][_0x1107('0x4b')]));_0x2c6620['attributes']=_0x2c6620[_0x1107('0x4a')]['length']?_0x2c6620['attributes']:_0x4ceadf[_0x1107('0x45')];if(!_0x2a2d63[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x2c6620[_0x1107('0x33')]=qs[_0x1107('0x33')](_0x2a2d63[_0x1107('0x47')][_0x1107('0x33')]);_0x2c6620['offset']=qs[_0x1107('0x32')](_0x2a2d63['query'][_0x1107('0x32')]);}_0x2c6620['order']=qs['sort'](_0x2a2d63['query']['sort']);_0x2c6620[_0x1107('0x50')]=qs['filters'](_[_0x1107('0x51')](_0x2a2d63[_0x1107('0x47')],_0x4ceadf[_0x1107('0x48')]));_0x2c6620[_0x1107('0x50')][_0x1107('0x67')]=_0x3b9d5a['id'];if(_0x2a2d63['query']['filter']){_0x2c6620[_0x1107('0x50')]=_[_0x1107('0x53')](_0x2c6620['where'],{'$or':_['map'](_0x2c6620[_0x1107('0x4a')],function(_0x391c54){var _0x596a76={};_0x596a76[_0x391c54]={'$like':'%'+_0x2a2d63[_0x1107('0x47')]['filter']+'%'};return _0x596a76;})});}_0x2c6620=_[_0x1107('0x53')]({},_0x2c6620,_0x2a2d63[_0x1107('0x6e')]);return db[_0x1107('0x6b')][_0x1107('0x31')]({'where':_0x2c6620[_0x1107('0x50')]})['then'](function(_0x49faaf){_0x1f26d4[_0x1107('0x31')]=_0x49faaf;if(_0x2a2d63[_0x1107('0x47')][_0x1107('0x57')]){_0x2c6620[_0x1107('0x58')]=[{'all':!![]}];}return db[_0x1107('0x6b')][_0x1107('0x59')](_0x2c6620);})[_0x1107('0x22')](function(_0x794eac){_0x1f26d4[_0x1107('0x5a')]=_0x794eac;return _0x1f26d4;});}})['then'](respondWithFilteredResult(_0x4aaa81,_0x2c6620))['catch'](handleError(_0x4aaa81,null));};exports[_0x1107('0x6f')]=function(_0x4d0a2b,_0x66fdd0,_0x559d2c){return db[_0x1107('0x56')]['find']({'where':{'id':_0x4d0a2b[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x66fdd0,null))[_0x1107('0x22')](function(_0x3fd6ec){if(_0x3fd6ec){return _0x3fd6ec['removeAnswers'](_0x4d0a2b['query']['ids']);}})['then'](respondWithStatusCode(_0x66fdd0,null))['catch'](handleError(_0x66fdd0,null));};exports[_0x1107('0x6c')]=function(_0x408779,_0x511123){var _0x16a625={'name':_0x408779[_0x1107('0x5f')]['name'],'key':_0x408779[_0x1107('0x5f')][_0x1107('0x70')],'email':_0x408779[_0x1107('0x5f')]['email'],'ListId':_0x408779[_0x1107('0x5f')][_0x1107('0x71')],'active':!_[_0x1107('0x72')](_0x408779[_0x1107('0x5f')][_0x1107('0x73')])?_0x408779['body'][_0x1107('0x73')]:!![],'description':_0x408779[_0x1107('0x5f')][_0x1107('0x74')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x408779['body'][_0x1107('0x75')])){if(_0x408779[_0x1107('0x5f')][_0x1107('0x76')]){_0x16a625['Imap'][_0x1107('0x77')]=_0x16a625[_0x1107('0x42')][_0x1107('0x77')]=_0x408779[_0x1107('0x5f')][_0x1107('0x78')];_0x16a625['Imap'][_0x1107('0x79')]=_0x16a625[_0x1107('0x42')][_0x1107('0x7a')]=_0x408779[_0x1107('0x5f')][_0x1107('0x7b')];}else{_0x16a625[_0x1107('0x40')][_0x1107('0x7c')]=_0x16a625[_0x1107('0x42')][_0x1107('0x7c')]=![];}_0x16a625[_0x1107('0x40')][_0x1107('0x7d')]=_0x408779[_0x1107('0x5f')][_0x1107('0x40')][_0x1107('0x7d')];_0x16a625[_0x1107('0x40')][_0x1107('0x7e')]=_0x408779[_0x1107('0x5f')]['Imap']['port'];_0x16a625[_0x1107('0x42')]['host']=_0x408779[_0x1107('0x5f')][_0x1107('0x42')][_0x1107('0x7d')];_0x16a625[_0x1107('0x42')][_0x1107('0x7e')]=_0x408779[_0x1107('0x5f')][_0x1107('0x42')][_0x1107('0x7e')];}else{_0x16a625[_0x1107('0x40')][_0x1107('0x7f')]=_0x16a625['Smtp'][_0x1107('0x7f')]=_0x408779[_0x1107('0x5f')][_0x1107('0x75')];_0x16a625[_0x1107('0x40')][_0x1107('0x77')]=_0x16a625['Smtp'][_0x1107('0x77')]=_0x408779[_0x1107('0x5f')][_0x1107('0x78')];_0x16a625[_0x1107('0x40')][_0x1107('0x79')]=_0x16a625[_0x1107('0x42')][_0x1107('0x7a')]=_0x408779['body'][_0x1107('0x7b')];}return db[_0x1107('0x56')][_0x1107('0x6c')](_0x16a625,{'include':[{'model':db[_0x1107('0x41')],'as':_0x1107('0x42')},{'model':db[_0x1107('0x3f')],'as':_0x1107('0x40')}]})['then'](function(_0x5c8e28){var _0x1ce5d0=_0x408779[_0x1107('0x77')]['get']({'plain':!![]});if(!_0x1ce5d0)throw new Error(_0x1107('0x80'));if(_0x1ce5d0[_0x1107('0x81')]===_0x1107('0x77')){var _0x388aae=_0x5c8e28[_0x1107('0x38')]({'plain':!![]});return db[_0x1107('0x82')]['find']({'where':{'name':_0x1107('0x83'),'userProfileId':_0x1ce5d0[_0x1107('0x84')]},'raw':!![]})[_0x1107('0x22')](function(_0x22375b){if(_0x22375b&&_0x22375b[_0x1107('0x85')]===0x0){return db[_0x1107('0x39')]['create']({'name':_0x388aae['name'],'resourceId':_0x388aae['id'],'type':_0x22375b[_0x1107('0x3d')],'sectionId':_0x22375b['id']},{})[_0x1107('0x22')](function(){return _0x5c8e28;});}else{return _0x5c8e28;}})[_0x1107('0x2c')](function(_0x482658){logger[_0x1107('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x482658);throw _0x482658;});}return _0x5c8e28;})['then'](respondWithResult(_0x511123,0xc9))[_0x1107('0x2c')](handleError(_0x511123,null));};exports[_0x1107('0x86')]=function(_0x252714,_0x59092b,_0x2f0637){return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x252714[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x59092b,null))[_0x1107('0x22')](function(_0x12499a){if(_0x12499a){return _0x12499a[_0x1107('0x86')]();}return null;})[_0x1107('0x22')](respondWithResult(_0x59092b,null))[_0x1107('0x2c')](handleError(_0x59092b,null));};exports[_0x1107('0x87')]=function(_0x3cc8b0,_0x33ec79,_0x3d1b4b){if(_0x3cc8b0[_0x1107('0x5f')]['id']){delete _0x3cc8b0['body']['id'];}return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x3cc8b0[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x33ec79,null))[_0x1107('0x22')](function(_0x259faf){if(_0x259faf){_0x3cc8b0[_0x1107('0x5f')][_0x1107('0x67')]=_0x259faf['id'];return db[_0x1107('0x3f')]['create'](_0x3cc8b0[_0x1107('0x5f')]);}})['then'](respondWithResult(_0x33ec79,null))[_0x1107('0x2c')](handleError(_0x33ec79,null));};exports[_0x1107('0x88')]=function(_0xfb8b91,_0x2df694,_0x4f0319){return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0xfb8b91[_0x1107('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2df694,null))[_0x1107('0x22')](function(_0x530319){if(_0x530319){return _0x530319['setImap'](null);}return null;})[_0x1107('0x22')](respondWithStatusCode(_0x2df694,null))[_0x1107('0x2c')](handleError(_0x2df694,null));};exports[_0x1107('0x89')]=function(_0x30fdf3,_0xcd54c8,_0x54fe23){return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x30fdf3[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0xcd54c8,null))[_0x1107('0x22')](function(_0x3a68a){if(_0x3a68a){return _0x3a68a[_0x1107('0x89')]();}return null;})[_0x1107('0x22')](respondWithResult(_0xcd54c8,null))[_0x1107('0x2c')](handleError(_0xcd54c8,null));};exports['addSmtp']=function(_0x23e1b6,_0x3c61a9,_0x5918b8){if(_0x23e1b6[_0x1107('0x5f')]['id']){delete _0x23e1b6['body']['id'];}return db['MailAccount'][_0x1107('0x62')]({'where':{'id':_0x23e1b6[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x3c61a9,null))['then'](function(_0x52d9c6){if(_0x52d9c6){_0x23e1b6[_0x1107('0x5f')][_0x1107('0x67')]=_0x52d9c6['id'];return db[_0x1107('0x41')][_0x1107('0x6c')](_0x23e1b6[_0x1107('0x5f')]);}})[_0x1107('0x22')](respondWithResult(_0x3c61a9,null))[_0x1107('0x2c')](handleError(_0x3c61a9,null));};exports[_0x1107('0x8a')]=function(_0x4911cc,_0x22deb5,_0xe59ad2){return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x4911cc[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x22deb5,null))[_0x1107('0x22')](function(_0x1e7eb7){if(_0x1e7eb7){return _0x1e7eb7[_0x1107('0x8b')](null);}return null;})[_0x1107('0x22')](respondWithStatusCode(_0x22deb5,null))[_0x1107('0x2c')](handleError(_0x22deb5,null));};exports['addInteraction']=function(_0x56f011,_0x2f9f9b,_0x47600e){return db[_0x1107('0x8c')][_0x1107('0x62')]({'where':{'id':_0x56f011[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x2f9f9b,null))['then'](function(_0x370da){if(_0x370da){return _0x370da[_0x1107('0x8d')](_0x56f011['body'][_0x1107('0x69')],_[_0x1107('0x8e')](_0x56f011[_0x1107('0x5f')],['ids','id'])||{});}})[_0x1107('0x22')](respondWithResult(_0x2f9f9b,null))[_0x1107('0x2c')](handleError(_0x2f9f9b,null));};exports[_0x1107('0x8f')]=function(_0x2788c1,_0x2bccf5,_0x5f66d7){var _0x5acb12={'raw':![],'where':{}};var _0xdd3078={};var _0x23592c={'count':0x0,'rows':[]};return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x2788c1[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x2bccf5,null))['then'](function(_0x36fa04){if(_0x36fa04){_0xdd3078['model']=_[_0x1107('0x46')](db[_0x1107('0x8c')][_0x1107('0x44')]);_0xdd3078[_0x1107('0x47')]=_[_0x1107('0x46')](_0x2788c1[_0x1107('0x47')]);_0xdd3078[_0x1107('0x48')]=_[_0x1107('0x49')](_0xdd3078['model'],_0xdd3078['query']);_0x5acb12[_0x1107('0x4a')]=_[_0x1107('0x49')](_0xdd3078['model'],qs[_0x1107('0x4b')](_0x2788c1[_0x1107('0x47')][_0x1107('0x4b')]));_0x5acb12[_0x1107('0x4a')]=_0x5acb12[_0x1107('0x4a')]['length']?_0x5acb12[_0x1107('0x4a')]:_0xdd3078[_0x1107('0x45')];if(!_0x2788c1[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x5acb12['limit']=qs[_0x1107('0x33')](_0x2788c1[_0x1107('0x47')][_0x1107('0x33')]);_0x5acb12[_0x1107('0x32')]=qs[_0x1107('0x32')](_0x2788c1[_0x1107('0x47')][_0x1107('0x32')]);}_0x5acb12['order']=qs['sort'](_0x2788c1[_0x1107('0x47')][_0x1107('0x4f')]);_0x5acb12[_0x1107('0x50')]=qs['filters'](_[_0x1107('0x51')](_0x2788c1[_0x1107('0x47')],_0xdd3078[_0x1107('0x48')]));_0x5acb12[_0x1107('0x50')][_0x1107('0x67')]=_0x36fa04['id'];if(_0x2788c1[_0x1107('0x47')][_0x1107('0x52')]){_0x5acb12[_0x1107('0x50')]=_[_0x1107('0x53')](_0x5acb12[_0x1107('0x50')],{'$or':_['map'](_0x5acb12[_0x1107('0x4a')],function(_0x6902bb){var _0x212beb={};_0x212beb[_0x6902bb]={'$like':'%'+_0x2788c1[_0x1107('0x47')]['filter']+'%'};return _0x212beb;})});}_0x5acb12=_[_0x1107('0x53')]({},_0x5acb12,_0x2788c1[_0x1107('0x6e')]);return db['MailInteraction']['count']({'where':_0x5acb12[_0x1107('0x50')]})[_0x1107('0x22')](function(_0x5a9385){_0x23592c[_0x1107('0x31')]=_0x5a9385;if(_0x2788c1[_0x1107('0x47')][_0x1107('0x57')]){_0x5acb12[_0x1107('0x58')]=[{'model':db['CmContact'],'as':_0x1107('0x90'),'required':![]},{'model':db[_0x1107('0x91')],'as':_0x1107('0x92'),'attributes':['name',_0x1107('0x93'),_0x1107('0x94')],'required':![]},{'model':db[_0x1107('0x95')],'as':'Tags','attributes':['id',_0x1107('0x3d'),_0x1107('0x96')],'where':_0x2788c1[_0x1107('0x47')][_0x1107('0x97')]?{'id':_0x2788c1[_0x1107('0x47')][_0x1107('0x97')]}:undefined,'required':_0x2788c1[_0x1107('0x47')][_0x1107('0x97')]?!![]:![]}];}return db[_0x1107('0x8c')]['findAll'](_0x5acb12);})[_0x1107('0x22')](function(_0x51fefd){_0x23592c['rows']=_0x51fefd;return _0x23592c;});}})[_0x1107('0x22')](respondWithFilteredResult(_0x2bccf5,_0x5acb12))[_0x1107('0x2c')](handleError(_0x2bccf5,null));};exports['addApplications']=function(_0x2c94a0,_0xa14422,_0x1f2c3c){return db[_0x1107('0x56')]['findOne']({'where':{'id':_0x2c94a0[_0x1107('0x5c')]['id']}})['then'](handleEntityNotFound(_0xa14422,null))[_0x1107('0x22')](function(_0x273ca0){if(_0x273ca0){return db[_0x1107('0x98')][_0x1107('0x99')](function(_0x2efc2f){return db[_0x1107('0x9a')][_0x1107('0x3a')]({'where':{'MailAccountId':_0x2c94a0[_0x1107('0x5c')]['id']},'transaction':_0x2efc2f})[_0x1107('0x22')](function(_0x4c5c6c){var _0xf92db3=_[_0x1107('0x54')](_0x2c94a0[_0x1107('0x5f')],function(_0x3b3d8b){_0x3b3d8b[_0x1107('0x67')]=_0x2c94a0[_0x1107('0x5c')]['id'];return _0x3b3d8b;});return db['MailApplication'][_0x1107('0x9b')](_0xf92db3,{'transaction':_0x2efc2f});});})[_0x1107('0x22')](function(){return db[_0x1107('0x9a')][_0x1107('0x9c')]({'where':{'MailAccountId':_0x2c94a0['params']['id']},'order':_0x1107('0x9d')});});}})['then'](respondWithResult(_0xa14422,null))['catch'](handleError(_0xa14422,null));};exports[_0x1107('0x9e')]=function(_0xb1ab8e,_0x421dfe,_0x18acd4){var _0x1d8912={};var _0x2e3310={};var _0x3ff829;var _0x2e14bc;return db[_0x1107('0x56')]['findOne']({'where':{'id':_0xb1ab8e[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x421dfe,null))[_0x1107('0x22')](function(_0x39ded5){if(_0x39ded5){_0x3ff829=_0x39ded5;_0x2e3310[_0x1107('0x45')]=_['keys'](db[_0x1107('0x9a')][_0x1107('0x44')]);_0x2e3310['query']=_[_0x1107('0x46')](_0xb1ab8e[_0x1107('0x47')]);_0x2e3310[_0x1107('0x48')]=_[_0x1107('0x49')](_0x2e3310['model'],_0x2e3310[_0x1107('0x47')]);_0x1d8912['attributes']=_[_0x1107('0x49')](_0x2e3310[_0x1107('0x45')],qs['fields'](_0xb1ab8e['query'][_0x1107('0x4b')]));_0x1d8912[_0x1107('0x4a')]=_0x1d8912[_0x1107('0x4a')][_0x1107('0x4c')]?_0x1d8912['attributes']:_0x2e3310[_0x1107('0x45')];_0x1d8912['order']=qs[_0x1107('0x4f')](_0xb1ab8e[_0x1107('0x47')][_0x1107('0x4f')]);_0x1d8912[_0x1107('0x50')]=qs['filters'](_[_0x1107('0x51')](_0xb1ab8e[_0x1107('0x47')],_0x2e3310[_0x1107('0x48')]));if(_0xb1ab8e['query'][_0x1107('0x52')]){_0x1d8912[_0x1107('0x50')]=_['merge'](_0x1d8912[_0x1107('0x50')],{'$or':_[_0x1107('0x54')](_0x1d8912[_0x1107('0x4a')],function(_0x50cf71){var _0x1a3991={};_0x1a3991[_0x50cf71]={'$like':'%'+_0xb1ab8e[_0x1107('0x47')][_0x1107('0x52')]+'%'};return _0x1a3991;})});}_0x1d8912=_[_0x1107('0x53')]({},_0x1d8912,_0xb1ab8e[_0x1107('0x6e')]);return _0x3ff829[_0x1107('0x9e')](_0x1d8912);}})['then'](function(_0x3991a4){if(_0x3991a4){_0x2e14bc=_0x3991a4[_0x1107('0x4c')];if(!_0xb1ab8e[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x1d8912['limit']=qs['limit'](_0xb1ab8e['query'][_0x1107('0x33')]);_0x1d8912[_0x1107('0x32')]=qs[_0x1107('0x32')](_0xb1ab8e[_0x1107('0x47')][_0x1107('0x32')]);}return _0x3ff829[_0x1107('0x9e')](_0x1d8912);}})['then'](function(_0x5c64c3){if(_0x5c64c3){return _0x5c64c3?{'count':_0x2e14bc,'rows':_0x5c64c3}:null;}})[_0x1107('0x22')](respondWithResult(_0x421dfe,null))[_0x1107('0x2c')](handleError(_0x421dfe,null));};exports[_0x1107('0x9f')]=function(_0x222559,_0x4545a8,_0x31f2e5){var _0x3a3055={'raw':!![],'where':{}};var _0x4eca97={};var _0x49142f={'count':0x0,'rows':[]};return db['MailAccount'][_0x1107('0x65')]({'where':{'id':_0x222559['params']['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x4545a8,null))[_0x1107('0x22')](function(_0x2181e3){if(_0x2181e3){_0x4eca97[_0x1107('0x45')]=_[_0x1107('0x46')](db[_0x1107('0xa0')][_0x1107('0x44')]);_0x4eca97[_0x1107('0x47')]=_[_0x1107('0x46')](_0x222559[_0x1107('0x47')]);_0x4eca97[_0x1107('0x48')]=_[_0x1107('0x49')](_0x4eca97[_0x1107('0x45')],_0x4eca97[_0x1107('0x47')]);_0x3a3055[_0x1107('0x4a')]=_[_0x1107('0x49')](_0x4eca97[_0x1107('0x45')],qs[_0x1107('0x4b')](_0x222559[_0x1107('0x47')][_0x1107('0x4b')]));_0x3a3055[_0x1107('0x4a')]=_0x3a3055[_0x1107('0x4a')][_0x1107('0x4c')]?_0x3a3055[_0x1107('0x4a')]:_0x4eca97[_0x1107('0x45')];if(!_0x222559[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x3a3055[_0x1107('0x33')]=qs[_0x1107('0x33')](_0x222559[_0x1107('0x47')]['limit']);_0x3a3055[_0x1107('0x32')]=qs[_0x1107('0x32')](_0x222559[_0x1107('0x47')]['offset']);}_0x3a3055[_0x1107('0x4e')]=qs[_0x1107('0x4f')](_0x222559[_0x1107('0x47')][_0x1107('0x4f')]);_0x3a3055[_0x1107('0x50')]=qs[_0x1107('0x48')](_[_0x1107('0x51')](_0x222559[_0x1107('0x47')],_0x4eca97['filters']));_0x3a3055[_0x1107('0x50')][_0x1107('0x67')]=_0x2181e3['id'];if(_0x222559[_0x1107('0x47')][_0x1107('0x52')]){_0x3a3055[_0x1107('0x50')]=_['merge'](_0x3a3055[_0x1107('0x50')],{'$or':_['map'](_0x3a3055[_0x1107('0x4a')],function(_0x4f9891){var _0x11b3cb={};_0x11b3cb[_0x4f9891]={'$like':'%'+_0x222559['query'][_0x1107('0x52')]+'%'};return _0x11b3cb;})});}if(_0x222559[_0x1107('0x47')]['$gte']){var _0x15bf27=_0x222559[_0x1107('0x47')]['$gte'][_0x1107('0xa1')](',');var _0x429067={};_0x429067[_0x15bf27[0x0]]={'$gte':moment(_0x15bf27[0x1])[_0x1107('0xa2')](_0x1107('0xa3'))};_0x3a3055['where']=_[_0x1107('0x53')](_0x3a3055['where'],_0x429067);}_0x3a3055=_[_0x1107('0x53')]({},_0x3a3055,_0x222559[_0x1107('0x6e')]);return db[_0x1107('0xa0')][_0x1107('0x31')]({'where':_0x3a3055['where']})['then'](function(_0x55f749){_0x49142f['count']=_0x55f749;if(_0x222559[_0x1107('0x47')][_0x1107('0x57')]){_0x3a3055['include']=[{'all':!![]}];}return db['MailMessage'][_0x1107('0x59')](_0x3a3055);})[_0x1107('0x22')](function(_0x55f5f2){if(_0x222559['query'][_0x1107('0xa4')]===_0x1107('0xa5')){for(var _0x498717=0x0;_0x498717<_0x55f5f2[_0x1107('0x4c')];_0x498717++){_0x55f5f2[_0x498717][_0x1107('0x5f')]=juice(_0x55f5f2[_0x498717][_0x1107('0x5f')]);}}_0x49142f[_0x1107('0x5a')]=_0x55f5f2;return _0x49142f;});}})['then'](respondWithFilteredResult(_0x4545a8,_0x3a3055))[_0x1107('0x2c')](handleError(_0x4545a8,null));};exports[_0x1107('0xa6')]=function(_0x5af170,_0x10b7c0,_0x3d1d42){var _0x7201db,_0x2855e5={},_0x46843e;if(_0x5af170['body']['to']){_0x46843e=_0x5af170[_0x1107('0x5f')]['to'][_0x1107('0xa1')](',')[0x0];}return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x5af170['params']['id']},'include':[{'model':db[_0x1107('0xa7')],'as':'List','include':[{'model':db[_0x1107('0xa8')],'as':'Contacts','where':{'email':_0x46843e},'limit':0x1,'order':[[_0x1107('0xa9'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x1107('0x42'),'raw':!![]}]})[_0x1107('0x22')](handleEntityNotFound(_0x10b7c0,null))['then'](function(_0x10ab13){if(_0x10ab13){_0x7201db=_0x10ab13;if(_0x10ab13[_0x1107('0x42')]){if(_['isNil'](_0x5af170[_0x1107('0x5f')]['from'])){_0x5af170[_0x1107('0x5f')][_0x1107('0xaa')]=util[_0x1107('0xa2')](_0x1107('0xab'),_0x10ab13[_0x1107('0x3d')],_0x10ab13[_0x1107('0xac')]||_0x10ab13[_0x1107('0x42')][_0x1107('0x77')]);}if(_0x5af170[_0x1107('0x5f')][_0x1107('0xad')]&&_0x5af170[_0x1107('0x5f')][_0x1107('0xad')]['length']){for(var _0x396155=0x0;_0x396155<_0x5af170[_0x1107('0x5f')][_0x1107('0xad')][_0x1107('0x4c')];_0x396155+=0x1){_0x5af170[_0x1107('0x5f')][_0x1107('0xad')][_0x396155]={'filename':_0x5af170[_0x1107('0x5f')]['attachments'][_0x396155][_0x1107('0x3d')],'path':path[_0x1107('0xae')](config[_0x1107('0xaf')],_0x1107('0xb0'),_0x5af170[_0x1107('0x5f')]['attachments'][_0x396155][_0x1107('0xb1')])};}}var _0x9c1537={'tls':{'rejectUnauthorized':![]}};if(_[_0x1107('0x72')](_0x10ab13[_0x1107('0x42')][_0x1107('0x7f')])){if(_0x10ab13[_0x1107('0x42')]['authentication']){_0x9c1537[_0x1107('0xb2')]={'user':_0x10ab13[_0x1107('0x42')][_0x1107('0x77')],'pass':_0x10ab13['Smtp'][_0x1107('0x7a')]};}_0x9c1537[_0x1107('0x7d')]=_0x10ab13[_0x1107('0x42')][_0x1107('0x7d')];_0x9c1537[_0x1107('0x7e')]=_0x10ab13[_0x1107('0x42')]['port'];_0x9c1537['secure']=_0x10ab13[_0x1107('0x42')][_0x1107('0xb3')];}else{_0x9c1537[_0x1107('0x7f')]=_0x10ab13[_0x1107('0x42')][_0x1107('0x7f')];_0x9c1537[_0x1107('0xb2')]={'user':_0x10ab13[_0x1107('0x42')][_0x1107('0x77')],'pass':_0x10ab13['Smtp']['pass']};}return respondWithRpcPromise(_0x1107('0xb4'),_0x1107('0xb5'),{'account':_0x9c1537,'message':_0x5af170[_0x1107('0x5f')]});}else{throw new Error(_0x1107('0xb6'));}}})[_0x1107('0x22')](function(_0x52baf3){if(_0x52baf3){_0x2855e5=_0x52baf3;if(_0x7201db[_0x1107('0xb7')]){if(_0x7201db[_0x1107('0xb7')][_0x1107('0xb8')][_0x1107('0x4c')]){return _0x7201db[_0x1107('0xb7')]['Contacts'][0x0];}else{return db['CmContact'][_0x1107('0x6c')](_[_0x1107('0x1a')](_0x5af170[_0x1107('0x5f')],{'firstName':_0x5af170['body']['to'],'email':_0x5af170['body']['to'],'phone':_0x5af170[_0x1107('0x5f')]['to'],'ListId':_0x7201db['ListId']}));}}else{throw new Error(_0x1107('0xb6'));}}})['then'](function(_0x3b4902){if(_0x3b4902){var _0x57a574={'UserId':_0x5af170[_0x1107('0x77')]['id'],'ContactId':_0x3b4902['id'],'MailAccountId':_0x7201db['id'],'inReplyTo':_0x2855e5[_0x1107('0xb9')],'to':_0x5af170['body']['from'],'cc':_0x5af170[_0x1107('0x5f')]['cc'],'subject':_0x5af170[_0x1107('0x5f')][_0x1107('0xba')],'attach':_0x5af170['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x1107('0xa2')](_0x1107('0xa3')),'lastMsgDirection':'out','Messages':[_[_0x1107('0x53')](_0x5af170[_0x1107('0x5f')],{'messageId':_0x2855e5['messageId'],'sentAt':moment()[_0x1107('0xa2')](_0x1107('0xa3')),'read':!![],'MailAccountId':_0x7201db['id'],'UserId':_0x5af170['user']['id'],'ContactId':_0x3b4902['id']})]};if(_0x5af170[_0x1107('0x5f')]['Interaction']){_0x57a574=_[_0x1107('0x53')](_0x57a574,_0x5af170[_0x1107('0x5f')]['Interaction']);}return db[_0x1107('0x8c')][_0x1107('0x6c')](_0x57a574,{'include':[{'model':db[_0x1107('0xa0')],'as':_0x1107('0xbb')}]});}})[_0x1107('0x22')](respondWithResult(_0x10b7c0,null))[_0x1107('0x2c')](handleError(_0x10b7c0,null));};exports[_0x1107('0xbc')]=function(_0x17eb63,_0x554a8a,_0x168fd7){return db[_0x1107('0x56')]['find']({'where':{'id':_0x17eb63[_0x1107('0x5c')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x1107('0x42'),'raw':!![]}]})['then'](handleEntityNotFound(_0x554a8a,null))[_0x1107('0x22')](function(_0x336139){if(_0x336139&&_0x336139[_0x1107('0x42')]){var _0x5d3de8={'id':_0x336139['id'],'tls':{'rejectUnauthorized':![]}};if(_0x336139[_0x1107('0x42')][_0x1107('0x7f')]){_0x5d3de8[_0x1107('0x7f')]=_0x336139[_0x1107('0x42')][_0x1107('0x7f')];}else{_0x5d3de8['host']=_0x336139['Smtp'][_0x1107('0x7d')];_0x5d3de8[_0x1107('0x7e')]=_0x336139[_0x1107('0x42')]['port'];_0x5d3de8[_0x1107('0xb3')]=_0x336139[_0x1107('0x42')][_0x1107('0xb3')];}if(_0x336139[_0x1107('0x42')]['authentication']){_0x5d3de8[_0x1107('0xb2')]={'user':_0x336139[_0x1107('0x42')][_0x1107('0x77')],'pass':_0x336139['Smtp']['pass']};}return respondWithRpcPromise(_0x1107('0xbd'),'verifySmtp',{'account':_0x5d3de8});}})[_0x1107('0x22')](respondWithResult(_0x554a8a,null))['catch'](handleError(_0x554a8a,null));};exports[_0x1107('0x3a')]=function(_0x220299,_0x54c82c){return db[_0x1107('0x56')][_0x1107('0x62')]({'where':{'id':_0x220299[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x54c82c,null))[_0x1107('0x22')](function(_0x33eee6){if(_0x33eee6&&_0x33eee6[_0x1107('0x7f')]){throw new db[(_0x1107('0xbe'))]['ValidationError'](_0x1107('0xbf'));}return _0x33eee6;})[_0x1107('0x22')](removeEntity(_0x54c82c,null))[_0x1107('0x2c')](handleError(_0x54c82c,null));};exports[_0x1107('0xc0')]=function(_0x351163,_0x4201b9,_0x2b806b){return db[_0x1107('0x56')]['find']({'where':{'id':_0x351163[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x4201b9,null))[_0x1107('0x22')](function(_0x5a2022){if(_0x5a2022){return _0x5a2022['addAgents'](_0x351163[_0x1107('0x5f')][_0x1107('0x69')],_[_0x1107('0x8e')](_0x351163['body'],[_0x1107('0x69'),'id'])||{})[_0x1107('0xc1')](function(_0x4e2715){for(var _0x2004cb=0x0;_0x2004cb<_0x351163[_0x1107('0x5f')]['ids'][_0x1107('0x4c')];_0x2004cb+=0x1){socket[_0x1107('0xc2')](_0x1107('0xc3'),{'UserId':Number(_0x351163[_0x1107('0x5f')][_0x1107('0x69')][_0x2004cb]),'MailAccountId':Number(_0x351163[_0x1107('0x5c')]['id'])});}return _0x4e2715;});}})[_0x1107('0x22')](respondWithResult(_0x4201b9,null))['catch'](handleError(_0x4201b9,null));};exports[_0x1107('0xc4')]=function(_0x142efc,_0x25e382,_0xf0b5b3){return db['MailAccount'][_0x1107('0x62')]({'where':{'id':_0x142efc[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x25e382,null))[_0x1107('0x22')](function(_0x52242a){if(_0x52242a){return _0x52242a[_0x1107('0xc4')](_0x142efc[_0x1107('0x47')]['ids'])[_0x1107('0x22')](function(){if(_['isArray'](_0x142efc[_0x1107('0x47')][_0x1107('0x69')])){for(var _0xa41d83=0x0;_0xa41d83<_0x142efc[_0x1107('0x47')][_0x1107('0x69')][_0x1107('0x4c')];_0xa41d83+=0x1){socket[_0x1107('0xc2')](_0x1107('0xc5'),{'UserId':Number(_0x142efc[_0x1107('0x47')][_0x1107('0x69')][_0xa41d83]),'MailAccountId':Number(_0x142efc['params']['id'])});}}else{socket[_0x1107('0xc2')]('userMailAccount:remove',{'UserId':Number(_0x142efc[_0x1107('0x47')][_0x1107('0x69')]),'MailAccountId':Number(_0x142efc[_0x1107('0x5c')]['id'])});}});}})[_0x1107('0x22')](respondWithStatusCode(_0x25e382,null))[_0x1107('0x2c')](handleError(_0x25e382,null));};exports[_0x1107('0xc6')]=function(_0x3ae862,_0x4e44e2,_0x1dacea){var _0x22950a={};var _0x1bfb79={};var _0x276f18;var _0x25a20c;return db[_0x1107('0x56')][_0x1107('0x65')]({'where':{'id':_0x3ae862[_0x1107('0x5c')]['id']}})[_0x1107('0x22')](handleEntityNotFound(_0x4e44e2,null))[_0x1107('0x22')](function(_0x4bca3b){if(_0x4bca3b){_0x276f18=_0x4bca3b;_0x1bfb79[_0x1107('0x45')]=_[_0x1107('0x46')](db[_0x1107('0x91')][_0x1107('0x44')]);_0x1bfb79[_0x1107('0x47')]=_['keys'](_0x3ae862[_0x1107('0x47')]);_0x1bfb79[_0x1107('0x48')]=_[_0x1107('0x49')](_0x1bfb79[_0x1107('0x45')],_0x1bfb79['query']);_0x22950a[_0x1107('0x4a')]=_[_0x1107('0x49')](_0x1bfb79[_0x1107('0x45')],qs[_0x1107('0x4b')](_0x3ae862[_0x1107('0x47')][_0x1107('0x4b')]));_0x22950a[_0x1107('0x4a')]=_0x22950a['attributes'][_0x1107('0x4c')]?_0x22950a[_0x1107('0x4a')]:_0x1bfb79[_0x1107('0x45')];_0x22950a[_0x1107('0x4e')]=qs[_0x1107('0x4f')](_0x3ae862[_0x1107('0x47')][_0x1107('0x4f')]);_0x22950a['where']=qs[_0x1107('0x48')](_[_0x1107('0x51')](_0x3ae862[_0x1107('0x47')],_0x1bfb79['filters']));if(_0x3ae862['query'][_0x1107('0x52')]){_0x22950a['where']=_[_0x1107('0x53')](_0x22950a['where'],{'$or':_[_0x1107('0x54')](_0x22950a[_0x1107('0x4a')],function(_0x2705a2){var _0x3c67fa={};_0x3c67fa[_0x2705a2]={'$like':'%'+_0x3ae862[_0x1107('0x47')][_0x1107('0x52')]+'%'};return _0x3c67fa;})});}_0x22950a=_[_0x1107('0x53')]({},_0x22950a,_0x3ae862[_0x1107('0x6e')]);return _0x276f18[_0x1107('0xc6')](_0x22950a);}})[_0x1107('0x22')](function(_0x1dc7bc){if(_0x1dc7bc){_0x25a20c=_0x1dc7bc[_0x1107('0x4c')];if(!_0x3ae862[_0x1107('0x47')][_0x1107('0x66')](_0x1107('0x4d'))){_0x22950a[_0x1107('0x33')]=qs[_0x1107('0x33')](_0x3ae862[_0x1107('0x47')][_0x1107('0x33')]);_0x22950a['offset']=qs[_0x1107('0x32')](_0x3ae862['query'][_0x1107('0x32')]);}return _0x276f18[_0x1107('0xc6')](_0x22950a);}})[_0x1107('0x22')](function(_0x956f0e){if(_0x956f0e){return _0x956f0e?{'count':_0x25a20c,'rows':_0x956f0e}:null;}})[_0x1107('0x22')](respondWithResult(_0x4e44e2,null))['catch'](handleError(_0x4e44e2,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5c5a2ea..7868ec1 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 _0x6209=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6209,0x1e8));var _0x9620=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6209[_0xa1e3e3];return _0xc980e9;};'use strict';var EventEmitter=require(_0x9620('0x0'));var MailAccount=require(_0x9620('0x1'))['db'][_0x9620('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9620('0x3')](0x0);var events={'afterCreate':_0x9620('0x4'),'afterUpdate':_0x9620('0x5'),'afterDestroy':_0x9620('0x6')};function emitEvent(_0x5deb40){return function(_0x2869e2,_0x17dc92,_0x2fa00b){MailAccountEvents['emit'](_0x5deb40+':'+_0x2869e2['id'],_0x2869e2);MailAccountEvents[_0x9620('0x7')](_0x5deb40,_0x2869e2);_0x2fa00b(null);};}for(var e in events){if(events[_0x9620('0x8')](e)){var event=events[e];MailAccount[_0x9620('0x9')](e,emitEvent(event));}}module[_0x9620('0xa')]=MailAccountEvents; \ No newline at end of file +var _0xe062=['remove','emit','events','../../mysqldb','save','update'];(function(_0x1067a6,_0x17369c){var _0x41be1e=function(_0x117829){while(--_0x117829){_0x1067a6['push'](_0x1067a6['shift']());}};_0x41be1e(++_0x17369c);}(_0xe062,0x1b8));var _0x2e06=function(_0x8d2f78,_0x4f5d19){_0x8d2f78=_0x8d2f78-0x0;var _0x106a73=_0xe062[_0x8d2f78];return _0x106a73;};'use strict';var EventEmitter=require(_0x2e06('0x0'));var MailAccount=require(_0x2e06('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e06('0x2'),'afterUpdate':_0x2e06('0x3'),'afterDestroy':_0x2e06('0x4')};function emitEvent(_0x304308){return function(_0x361a02,_0x28e970,_0x22aacc){MailAccountEvents[_0x2e06('0x5')](_0x304308+':'+_0x361a02['id'],_0x361a02);MailAccountEvents[_0x2e06('0x5')](_0x304308,_0x361a02);_0x22aacc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 43b93c0..675a431 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 _0xf0c1=['MailAccount','mail_accounts','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define'];(function(_0x21c64c,_0x37d13b){var _0x36b49c=function(_0x5bd61b){while(--_0x5bd61b){_0x21c64c['push'](_0x21c64c['shift']());}};_0x36b49c(++_0x37d13b);}(_0xf0c1,0x1e2));var _0x1f0c=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xf0c1[_0x26d6d9];return _0x1b4875;};'use strict';var _=require('lodash');var util=require(_0x1f0c('0x0'));var logger=require(_0x1f0c('0x1'))(_0x1f0c('0x2'));var moment=require(_0x1f0c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f0c('0x4'));var rimraf=require(_0x1f0c('0x5'));var config=require(_0x1f0c('0x6'));var attributes=require(_0x1f0c('0x7'));module[_0x1f0c('0x8')]=function(_0x49a62b,_0xd22d24){return _0x49a62b[_0x1f0c('0x9')](_0x1f0c('0xa'),attributes,{'tableName':_0x1f0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf302=['define','MailAccount','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0x3b87b9,_0x2715db){var _0x4dbdd5=function(_0x4b9da3){while(--_0x4b9da3){_0x3b87b9['push'](_0x3b87b9['shift']());}};_0x4dbdd5(++_0x2715db);}(_0xf302,0x1e2));var _0x2f30=function(_0x489684,_0x42f1b4){_0x489684=_0x489684-0x0;var _0x559191=_0xf302[_0x489684];return _0x559191;};'use strict';var _=require(_0x2f30('0x0'));var util=require(_0x2f30('0x1'));var logger=require(_0x2f30('0x2'))('api');var moment=require(_0x2f30('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f30('0x4'));var fs=require('fs');var path=require(_0x2f30('0x5'));var rimraf=require(_0x2f30('0x6'));var config=require(_0x2f30('0x7'));var attributes=require(_0x2f30('0x8'));module[_0x2f30('0x9')]=function(_0x406f45,_0x346d3c){return _0x406f45[_0x2f30('0xa')](_0x2f30('0xb'),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 f535ec6..7169aa2 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 _0x0c5f=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','request\x20sent','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','GetMailAccount','MailAccount','raw','options','where','attributes','limit','include','map','model','ShowMailAccount','find','debug','NotifyMailAccount','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','contact','attachments','originCc','bcc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x0c5f,0x142));var _0xf0c5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0c5f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf0c5('0x0'));var util=require(_0xf0c5('0x1'));var moment=require('moment');var BPromise=require(_0xf0c5('0x2'));var rs=require(_0xf0c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0c5('0x4'))['db'];var utils=require(_0xf0c5('0x5'));var logger=require(_0xf0c5('0x6'))(_0xf0c5('0x7'));var config=require(_0xf0c5('0x8'));var jayson=require(_0xf0c5('0x9'));var client=jayson[_0xf0c5('0xa')][_0xf0c5('0xb')]({'port':0x232c});config[_0xf0c5('0xc')]=_[_0xf0c5('0xd')](config[_0xf0c5('0xc')],{'host':_0xf0c5('0xe'),'port':0x18eb});var socket=require(_0xf0c5('0xf'))(new Redis(config[_0xf0c5('0xc')]));require(_0xf0c5('0x10'))[_0xf0c5('0x11')](socket);function respondWithRpcPromise(_0x4026bb,_0x3ae001,_0x4feabe){return new BPromise(function(_0x46d386,_0x4fd782){return client['request'](_0x4026bb,_0x4feabe)[_0xf0c5('0x12')](function(_0x3242ac){logger[_0xf0c5('0x13')]('MailAccount,\x20%s,\x20%s',_0x3ae001,_0xf0c5('0x14'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x3ae001,_0xf0c5('0x14'),JSON[_0xf0c5('0x15')](_0x3242ac));if(_0x3242ac['error']){if(_0x3242ac[_0xf0c5('0x16')][_0xf0c5('0x17')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x3ae001,_0x3242ac[_0xf0c5('0x16')][_0xf0c5('0x18')]);return _0x4fd782(_0x3242ac['error']['message']);}logger[_0xf0c5('0x16')](_0xf0c5('0x19'),_0x3ae001,_0x3242ac[_0xf0c5('0x16')][_0xf0c5('0x18')]);return _0x46d386(_0x3242ac[_0xf0c5('0x16')][_0xf0c5('0x18')]);}else{logger[_0xf0c5('0x13')](_0xf0c5('0x19'),_0x3ae001,_0xf0c5('0x14'));_0x46d386(_0x3242ac[_0xf0c5('0x1a')][_0xf0c5('0x18')]);}})[_0xf0c5('0x1b')](function(_0x2080a5){logger[_0xf0c5('0x16')]('MailAccount,\x20%s,\x20%s',_0x3ae001,_0x2080a5);_0x4fd782(_0x2080a5);});});}exports[_0xf0c5('0x1c')]=function(_0x32c128){var _0x2f693d=this;return new Promise(function(_0x55b083,_0x8604a1){return db[_0xf0c5('0x1d')]['findAll']({'raw':_0x32c128['options']?_0x32c128['options'][_0xf0c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x32c128[_0xf0c5('0x1f')]?_0x32c128[_0xf0c5('0x1f')][_0xf0c5('0x20')]||null:null,'attributes':_0x32c128['options']?_0x32c128[_0xf0c5('0x1f')][_0xf0c5('0x21')]||null:null,'limit':_0x32c128['options']?_0x32c128[_0xf0c5('0x1f')][_0xf0c5('0x22')]||null:null,'include':_0x32c128['options']?_0x32c128[_0xf0c5('0x1f')][_0xf0c5('0x23')]?_[_0xf0c5('0x24')](_0x32c128[_0xf0c5('0x1f')][_0xf0c5('0x23')],function(_0x2d4db1){return{'model':db[_0x2d4db1[_0xf0c5('0x25')]],'as':_0x2d4db1['as'],'attributes':_0x2d4db1[_0xf0c5('0x21')],'include':_0x2d4db1['include']?_['map'](_0x2d4db1['include'],function(_0x2d2ca0){return{'model':db[_0x2d2ca0[_0xf0c5('0x25')]],'as':_0x2d2ca0['as'],'attributes':_0x2d2ca0[_0xf0c5('0x21')],'include':_0x2d2ca0[_0xf0c5('0x23')]?_[_0xf0c5('0x24')](_0x2d2ca0[_0xf0c5('0x23')],function(_0x1b68ee){return{'model':db[_0x1b68ee[_0xf0c5('0x25')]],'as':_0x1b68ee['as'],'attributes':_0x1b68ee['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0c5('0x12')](function(_0x4a22cb){logger[_0xf0c5('0x13')]('GetMailAccount',_0x32c128);logger['debug'](_0xf0c5('0x1c'),_0x32c128,JSON['stringify'](_0x4a22cb));_0x55b083(_0x4a22cb);})['catch'](function(_0x43e56b){logger[_0xf0c5('0x16')]('GetMailAccount',_0x43e56b[_0xf0c5('0x18')],_0x32c128);_0x8604a1(_0x2f693d[_0xf0c5('0x16')](0x1f4,_0x43e56b['message']));});});};exports[_0xf0c5('0x26')]=function(_0x288ec8){var _0x29af25=this;return new Promise(function(_0x53dd0c,_0x4466e3){return db[_0xf0c5('0x1d')][_0xf0c5('0x27')]({'raw':_0x288ec8[_0xf0c5('0x1f')]?_0x288ec8[_0xf0c5('0x1f')][_0xf0c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x288ec8[_0xf0c5('0x1f')]?_0x288ec8['options'][_0xf0c5('0x20')]||null:null,'attributes':_0x288ec8[_0xf0c5('0x1f')]?_0x288ec8[_0xf0c5('0x1f')][_0xf0c5('0x21')]||null:null,'include':_0x288ec8['options']?_0x288ec8['options'][_0xf0c5('0x23')]?_['map'](_0x288ec8[_0xf0c5('0x1f')]['include'],function(_0xc05b9d){return{'model':db[_0xc05b9d[_0xf0c5('0x25')]],'as':_0xc05b9d['as'],'attributes':_0xc05b9d[_0xf0c5('0x21')],'include':_0xc05b9d['include']?_[_0xf0c5('0x24')](_0xc05b9d[_0xf0c5('0x23')],function(_0xf521e){return{'model':db[_0xf521e[_0xf0c5('0x25')]],'as':_0xf521e['as'],'attributes':_0xf521e[_0xf0c5('0x21')],'include':_0xf521e[_0xf0c5('0x23')]?_[_0xf0c5('0x24')](_0xf521e[_0xf0c5('0x23')],function(_0x54c056){return{'model':db[_0x54c056[_0xf0c5('0x25')]],'as':_0x54c056['as'],'attributes':_0x54c056['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0c5('0x12')](function(_0x13a148){logger[_0xf0c5('0x13')](_0xf0c5('0x26'),_0x288ec8);logger[_0xf0c5('0x28')]('ShowMailAccount',_0x288ec8,JSON['stringify'](_0x13a148));_0x53dd0c(_0x13a148);})[_0xf0c5('0x1b')](function(_0x3e4c0b){logger[_0xf0c5('0x16')]('ShowMailAccount',_0x3e4c0b[_0xf0c5('0x18')],_0x288ec8);_0x4466e3(_0x29af25['error'](0x1f4,_0x3e4c0b[_0xf0c5('0x18')]));});});};exports[_0xf0c5('0x29')]=function(_0x58faf1){var _0x193fa7=this;return new Promise(function(_0xa60c8d,_0x1567b1){var _0x514b40={'body':_0x58faf1['body'],'channel':_0xf0c5('0x2a')};var _0x4ad7ef=_[_0xf0c5('0x2b')](_[_0xf0c5('0x2c')](db[_0xf0c5('0x2d')]['rawAttributes']),[_0xf0c5('0x2e'),_0xf0c5('0x2f'),_0xf0c5('0x30'),_0xf0c5('0x31')]);var _0x51d560=![];if(_0x58faf1[_0xf0c5('0x32')]['id']){delete _0x58faf1[_0xf0c5('0x32')]['id'];}if(_[_0xf0c5('0x33')](_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x34')])){return _0x1567b1(_0x193fa7[_0xf0c5('0x16')](0x1f4,_0xf0c5('0x35')));}if(_[_0xf0c5('0x33')](_0x58faf1[_0xf0c5('0x32')]['body'])||_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x32')]===''){return _0x1567b1(_0x193fa7['error'](0x1f4,_0xf0c5('0x36')));}if(_[_0xf0c5('0x33')](_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x37')])){return _0x1567b1(_0x193fa7[_0xf0c5('0x16')](0x1f4,_0xf0c5('0x38')+_0x4ad7ef));}if(!_['includes'](_0x4ad7ef,_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x37')])){return _0x1567b1(_0x193fa7[_0xf0c5('0x16')](0x1f4,_0xf0c5('0x39')+_0x4ad7ef));}var _0x254f54={};_0x254f54[_0x58faf1[_0xf0c5('0x32')]['mapKey']]=_0x58faf1['body'][_0xf0c5('0x34')];return db[_0xf0c5('0x1d')][_0xf0c5('0x27')]({'where':{'id':_0x58faf1[_0xf0c5('0x3a')]['id']},'include':[{'model':db[_0xf0c5('0x3b')],'as':_0xf0c5('0x3c'),'include':[{'model':db[_0xf0c5('0x2d')],'as':_0xf0c5('0x3d'),'where':_0x254f54,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xf0c5('0x3e')],'as':_0xf0c5('0x3f')},{'model':db[_0xf0c5('0x40')],'as':_0xf0c5('0x41')}]})[_0xf0c5('0x12')](function(_0x46fe31){if(_0x46fe31&&_0x46fe31[_0xf0c5('0x3c')]){var _0x220b91=_0x46fe31[_0xf0c5('0x42')]({'plain':!![]});_0x514b40['account']=_[_0xf0c5('0x43')](_0x220b91,[_0xf0c5('0x3f'),_0xf0c5('0x3c')]);_0x514b40[_0xf0c5('0x44')]=_0x220b91[_0xf0c5('0x3f')];_0x514b40['list']=_0x220b91[_0xf0c5('0x3c')];_0x514b40[_0xf0c5('0x44')]=_[_0xf0c5('0x45')](_0x514b40[_0xf0c5('0x44')],[_0xf0c5('0x46')],[_0xf0c5('0x47')]);if(_0x514b40[_0xf0c5('0x3a')]&&_0x514b40[_0xf0c5('0x3a')][_0xf0c5('0x48')]){_0x514b40['applications'][_0xf0c5('0x49')]({'id':0x0,'priority':_0x514b40[_0xf0c5('0x44')][_0xf0c5('0x4a')]+0x1,'app':'close','appdata':_0xf0c5('0x48'),'interval':_0xf0c5('0x4b')});}if(_0x514b40['account']['Applications']){delete _0x514b40['account']['Applications'];}if(_0x514b40[_0xf0c5('0x3a')][_0xf0c5('0x3c')]){delete _0x514b40['account'][_0xf0c5('0x3c')];}if(_0x220b91['List'][_0xf0c5('0x3d')][_0xf0c5('0x4a')]){return _0x220b91[_0xf0c5('0x3c')]['Contacts'][0x0];}var _0x261c0e=_[_0xf0c5('0xd')](_0x58faf1[_0xf0c5('0x32')],{'firstName':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x34')],'ListId':_0x220b91[_0xf0c5('0x31')]});_0x261c0e[_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x37')]]=_0x58faf1['body'][_0xf0c5('0x34')];return db['CmContact'][_0xf0c5('0x4c')](_0x261c0e);}else{throw new Error(_0xf0c5('0x4d'));}})['then'](function(_0x39f66a){_0x514b40['contact']=_0x39f66a;if(_0x39f66a){if(!_0x58faf1[_0xf0c5('0x32')]['message'][_0xf0c5('0x4e')]){_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x4e')]=rs[_0xf0c5('0x4f')]()+'\x20'+_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x34')];}var _0x4fcca0={'ContactId':_0x39f66a['id'],'MailAccountId':_0x58faf1['account']['id'],'inReplyTo':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x4e')],'to':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x34')],'cc':_0x58faf1['body'][_0xf0c5('0x18')]['cc'],'subject':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x50')],'attach':_0x58faf1['body'][_0xf0c5('0x18')][_0xf0c5('0x51')],'lastMsgAt':moment()[_0xf0c5('0x52')](_0xf0c5('0x53')),'lastMsgDirection':'in'};return db[_0xf0c5('0x54')][_0xf0c5('0x27')]({'where':{'closed':![],'MailAccountId':_0x58faf1[_0xf0c5('0x3a')]['id']},'include':[{'model':db['MailMessage'],'as':_0xf0c5('0x55'),'attributes':[_0xf0c5('0x4e')],'where':{'messageId':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x56')]}}]})[_0xf0c5('0x12')](function(_0xf10e7e){if(_0xf10e7e){return[_0xf10e7e,![]];}return db[_0xf0c5('0x54')]['create'](_0x4fcca0)[_0xf0c5('0x12')](function(_0x46c785){return[_0x46c785,!![]];});});}else{throw new Error(_0xf0c5('0x57'));}})[_0xf0c5('0x58')](function(_0x4ff81a,_0x2992e6){if(_0x4ff81a){_0x51d560=_0x2992e6;if(!_0x2992e6){return _0x4ff81a[_0xf0c5('0x59')]({'inReplyTo':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x4e')],'to':_0x58faf1['body']['message'][_0xf0c5('0x34')],'cc':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['cc'],'subject':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['subject'],'attach':_0x4ff81a[_0xf0c5('0x51')]?_0x4ff81a[_0xf0c5('0x51')]:_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xf0c5('0x53')),'lastMsgAt':moment()['format'](_0xf0c5('0x53')),'lastMsgDirection':'in'});}else{return _0x4ff81a;}}})[_0xf0c5('0x12')](function(_0x4b3759){_0x514b40['interaction']=_0x4b3759[_0xf0c5('0x42')]({'plain':!![]});_0x514b40[_0xf0c5('0x5a')][_0xf0c5('0x5b')]=_0x51d560;return db['MailMessage'][_0xf0c5('0x4c')]({'body':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x32')],'MailAccountId':_0x58faf1['account']['id'],'MailInteractionId':_0x4b3759['id'],'direction':'in','ContactId':_0x514b40[_0xf0c5('0x5c')]['id'],'messageId':_0x58faf1['body'][_0xf0c5('0x18')][_0xf0c5('0x4e')],'from':_0x58faf1[_0xf0c5('0x32')]['message']['from'],'to':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['to'],'cc':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['cc'],'subject':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['subject'],'attach':_0x58faf1[_0xf0c5('0x32')]['message']['attach'],'Attachments':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x5d')],'originTo':_0x58faf1['body'][_0xf0c5('0x18')]['originTo'],'originCc':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x5e')],'bcc':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x5f')],'ChatWebsiteId':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')][_0xf0c5('0x60')]||null,'originChannel':_0x58faf1[_0xf0c5('0x32')]['message'][_0xf0c5('0x61')]||'Email','ChatOfflineMessageId':_0x58faf1[_0xf0c5('0x32')][_0xf0c5('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xf0c5('0x62')],'as':_0xf0c5('0x63')}]});})[_0xf0c5('0x12')](function(_0x4c080c){_0x514b40[_0xf0c5('0x18')]=_0x4c080c;if(_0x514b40[_0xf0c5('0x5a')][_0xf0c5('0x64')]){return db[_0xf0c5('0x65')][_0xf0c5('0x27')]({'attributes':['id','name'],'where':{'id':_0x514b40[_0xf0c5('0x5a')][_0xf0c5('0x64')]}})['then'](function(_0xc3c24e){if(_0xc3c24e){_0x514b40[_0xf0c5('0x44')][_0xf0c5('0x66')]({'id':0x0,'priority':0x0,'app':_0xf0c5('0x67'),'appdata':_0xc3c24e[_0xf0c5('0x68')]+','+(_0x514b40['account'][_0xf0c5('0x69')]||0xa),'interval':_0xf0c5('0x4b')});}return respondWithRpcPromise(_0xf0c5('0x6a'),_0xf0c5('0x6b'),_0x514b40);});}return respondWithRpcPromise(_0xf0c5('0x6a'),_0xf0c5('0x6b'),_0x514b40);})['then'](function(_0x3877ff){_0xa60c8d(_0x3877ff);})[_0xf0c5('0x1b')](function(_0x5474b3){_0x1567b1(_0x193fa7[_0xf0c5('0x16')](0x1f4,_0x5474b3[_0xf0c5('0x18')]));});});}; \ No newline at end of file +var _0xcc37=['length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','include','map','model','attributes','stringify','ShowMailAccount','find','where','NotifyMailAccount','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','List','list','orderBy','applications','priority','autoclose','push'];(function(_0x4adad3,_0x202bba){var _0x52dae4=function(_0x562ccb){while(--_0x562ccb){_0x4adad3['push'](_0x4adad3['shift']());}};_0x52dae4(++_0x202bba);}(_0xcc37,0x1c8));var _0x7cc3=function(_0x36653e,_0x57f375){_0x36653e=_0x36653e-0x0;var _0x5f9481=_0xcc37[_0x36653e];return _0x5f9481;};'use strict';var _=require(_0x7cc3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7cc3('0x1'));var rs=require(_0x7cc3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7cc3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7cc3('0x4'))(_0x7cc3('0x5'));var config=require(_0x7cc3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7cc3('0x7')][_0x7cc3('0x8')]({'port':0x232c});config[_0x7cc3('0x9')]=_[_0x7cc3('0xa')](config[_0x7cc3('0x9')],{'host':_0x7cc3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7cc3('0xc'))[_0x7cc3('0xd')](socket);function respondWithRpcPromise(_0x350e40,_0x2c1936,_0xdcc7a7){return new BPromise(function(_0x5c70c3,_0x81f11d){return client[_0x7cc3('0xe')](_0x350e40,_0xdcc7a7)[_0x7cc3('0xf')](function(_0x2d75c7){logger[_0x7cc3('0x10')](_0x7cc3('0x11'),_0x2c1936,_0x7cc3('0x12'));logger[_0x7cc3('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2c1936,'request\x20sent',JSON['stringify'](_0x2d75c7));if(_0x2d75c7['error']){if(_0x2d75c7[_0x7cc3('0x14')][_0x7cc3('0x15')]===0x1f4){logger[_0x7cc3('0x14')](_0x7cc3('0x11'),_0x2c1936,_0x2d75c7['error']['message']);return _0x81f11d(_0x2d75c7[_0x7cc3('0x14')][_0x7cc3('0x16')]);}logger[_0x7cc3('0x14')](_0x7cc3('0x11'),_0x2c1936,_0x2d75c7[_0x7cc3('0x14')][_0x7cc3('0x16')]);return _0x5c70c3(_0x2d75c7[_0x7cc3('0x14')]['message']);}else{logger[_0x7cc3('0x10')](_0x7cc3('0x11'),_0x2c1936,'request\x20sent');_0x5c70c3(_0x2d75c7['result'][_0x7cc3('0x16')]);}})[_0x7cc3('0x17')](function(_0x1ae71b){logger['error'](_0x7cc3('0x11'),_0x2c1936,_0x1ae71b);_0x81f11d(_0x1ae71b);});});}exports[_0x7cc3('0x18')]=function(_0x4ae667){var _0x253b10=this;return new Promise(function(_0x14a73e,_0x3b1a50){return db[_0x7cc3('0x19')][_0x7cc3('0x1a')]({'raw':_0x4ae667[_0x7cc3('0x1b')]?_0x4ae667[_0x7cc3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4ae667[_0x7cc3('0x1b')]?_0x4ae667[_0x7cc3('0x1b')]['where']||null:null,'attributes':_0x4ae667[_0x7cc3('0x1b')]?_0x4ae667[_0x7cc3('0x1b')]['attributes']||null:null,'limit':_0x4ae667[_0x7cc3('0x1b')]?_0x4ae667[_0x7cc3('0x1b')]['limit']||null:null,'include':_0x4ae667['options']?_0x4ae667['options'][_0x7cc3('0x1c')]?_[_0x7cc3('0x1d')](_0x4ae667[_0x7cc3('0x1b')][_0x7cc3('0x1c')],function(_0x58a7c7){return{'model':db[_0x58a7c7[_0x7cc3('0x1e')]],'as':_0x58a7c7['as'],'attributes':_0x58a7c7[_0x7cc3('0x1f')],'include':_0x58a7c7['include']?_[_0x7cc3('0x1d')](_0x58a7c7[_0x7cc3('0x1c')],function(_0xb98c96){return{'model':db[_0xb98c96[_0x7cc3('0x1e')]],'as':_0xb98c96['as'],'attributes':_0xb98c96[_0x7cc3('0x1f')],'include':_0xb98c96['include']?_[_0x7cc3('0x1d')](_0xb98c96[_0x7cc3('0x1c')],function(_0x4bfe10){return{'model':db[_0x4bfe10[_0x7cc3('0x1e')]],'as':_0x4bfe10['as'],'attributes':_0x4bfe10[_0x7cc3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7cc3('0xf')](function(_0x1b58b6){logger[_0x7cc3('0x10')]('GetMailAccount',_0x4ae667);logger[_0x7cc3('0x13')](_0x7cc3('0x18'),_0x4ae667,JSON[_0x7cc3('0x20')](_0x1b58b6));_0x14a73e(_0x1b58b6);})['catch'](function(_0x2dd5cc){logger[_0x7cc3('0x14')](_0x7cc3('0x18'),_0x2dd5cc[_0x7cc3('0x16')],_0x4ae667);_0x3b1a50(_0x253b10['error'](0x1f4,_0x2dd5cc[_0x7cc3('0x16')]));});});};exports[_0x7cc3('0x21')]=function(_0x2cb656){var _0x17440d=this;return new Promise(function(_0x2b459b,_0x3478a8){return db[_0x7cc3('0x19')][_0x7cc3('0x22')]({'raw':_0x2cb656[_0x7cc3('0x1b')]?_0x2cb656[_0x7cc3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2cb656['options']?_0x2cb656['options'][_0x7cc3('0x23')]||null:null,'attributes':_0x2cb656[_0x7cc3('0x1b')]?_0x2cb656[_0x7cc3('0x1b')]['attributes']||null:null,'include':_0x2cb656[_0x7cc3('0x1b')]?_0x2cb656[_0x7cc3('0x1b')][_0x7cc3('0x1c')]?_[_0x7cc3('0x1d')](_0x2cb656['options'][_0x7cc3('0x1c')],function(_0x14cf91){return{'model':db[_0x14cf91[_0x7cc3('0x1e')]],'as':_0x14cf91['as'],'attributes':_0x14cf91[_0x7cc3('0x1f')],'include':_0x14cf91[_0x7cc3('0x1c')]?_[_0x7cc3('0x1d')](_0x14cf91[_0x7cc3('0x1c')],function(_0x2763bb){return{'model':db[_0x2763bb[_0x7cc3('0x1e')]],'as':_0x2763bb['as'],'attributes':_0x2763bb[_0x7cc3('0x1f')],'include':_0x2763bb[_0x7cc3('0x1c')]?_[_0x7cc3('0x1d')](_0x2763bb[_0x7cc3('0x1c')],function(_0x29d977){return{'model':db[_0x29d977['model']],'as':_0x29d977['as'],'attributes':_0x29d977[_0x7cc3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7cc3('0xf')](function(_0x3c56e5){logger[_0x7cc3('0x10')](_0x7cc3('0x21'),_0x2cb656);logger['debug'](_0x7cc3('0x21'),_0x2cb656,JSON[_0x7cc3('0x20')](_0x3c56e5));_0x2b459b(_0x3c56e5);})[_0x7cc3('0x17')](function(_0x2333c4){logger[_0x7cc3('0x14')]('ShowMailAccount',_0x2333c4[_0x7cc3('0x16')],_0x2cb656);_0x3478a8(_0x17440d[_0x7cc3('0x14')](0x1f4,_0x2333c4[_0x7cc3('0x16')]));});});};exports[_0x7cc3('0x24')]=function(_0x2c1e45){var _0x3af9ac=this;return new Promise(function(_0x1a03fc,_0x256085){var _0x23fda6={'body':_0x2c1e45[_0x7cc3('0x25')],'channel':_0x7cc3('0x26')};var _0x4b4728=_['difference'](_[_0x7cc3('0x27')](db[_0x7cc3('0x28')][_0x7cc3('0x29')]),[_0x7cc3('0x2a'),_0x7cc3('0x2b'),'CompanyId',_0x7cc3('0x2c')]);var _0x20efef=![];if(_0x2c1e45[_0x7cc3('0x25')]['id']){delete _0x2c1e45['body']['id'];}if(_[_0x7cc3('0x2d')](_0x2c1e45[_0x7cc3('0x25')]['from'])){return _0x256085(_0x3af9ac[_0x7cc3('0x14')](0x1f4,_0x7cc3('0x2e')));}if(_[_0x7cc3('0x2d')](_0x2c1e45[_0x7cc3('0x25')]['body'])||_0x2c1e45['body'][_0x7cc3('0x25')]===''){return _0x256085(_0x3af9ac[_0x7cc3('0x14')](0x1f4,_0x7cc3('0x2f')));}if(_[_0x7cc3('0x2d')](_0x2c1e45[_0x7cc3('0x25')]['mapKey'])){return _0x256085(_0x3af9ac['error'](0x1f4,_0x7cc3('0x30')+_0x4b4728));}if(!_[_0x7cc3('0x31')](_0x4b4728,_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x32')])){return _0x256085(_0x3af9ac[_0x7cc3('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b4728));}var _0x597bcb={};_0x597bcb[_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x32')]]=_0x2c1e45['body'][_0x7cc3('0x33')];return db[_0x7cc3('0x19')][_0x7cc3('0x22')]({'where':{'id':_0x2c1e45[_0x7cc3('0x34')]['id']},'include':[{'model':db[_0x7cc3('0x35')],'as':'List','include':[{'model':db[_0x7cc3('0x28')],'as':_0x7cc3('0x36'),'where':_0x597bcb,'limit':0x1,'order':[['updatedAt',_0x7cc3('0x37')]]}]},{'model':db[_0x7cc3('0x38')],'as':_0x7cc3('0x39')},{'model':db[_0x7cc3('0x3a')],'as':_0x7cc3('0x3b')}]})[_0x7cc3('0xf')](function(_0x21681e){if(_0x21681e&&_0x21681e['List']){var _0x708b4d=_0x21681e[_0x7cc3('0x3c')]({'plain':!![]});_0x23fda6['account']=_[_0x7cc3('0x3d')](_0x708b4d,[_0x7cc3('0x39'),_0x7cc3('0x3e')]);_0x23fda6['applications']=_0x708b4d[_0x7cc3('0x39')];_0x23fda6[_0x7cc3('0x3f')]=_0x708b4d[_0x7cc3('0x3e')];_0x23fda6['applications']=_[_0x7cc3('0x40')](_0x23fda6[_0x7cc3('0x41')],[_0x7cc3('0x42')],['asc']);if(_0x23fda6[_0x7cc3('0x34')]&&_0x23fda6[_0x7cc3('0x34')][_0x7cc3('0x43')]){_0x23fda6['applications'][_0x7cc3('0x44')]({'id':0x0,'priority':_0x23fda6[_0x7cc3('0x41')][_0x7cc3('0x45')]+0x1,'app':_0x7cc3('0x46'),'appdata':_0x7cc3('0x43'),'interval':_0x7cc3('0x47')});}if(_0x23fda6[_0x7cc3('0x34')][_0x7cc3('0x39')]){delete _0x23fda6[_0x7cc3('0x34')][_0x7cc3('0x39')];}if(_0x23fda6[_0x7cc3('0x34')][_0x7cc3('0x3e')]){delete _0x23fda6['account'][_0x7cc3('0x3e')];}if(_0x708b4d[_0x7cc3('0x3e')][_0x7cc3('0x36')][_0x7cc3('0x45')]){return _0x708b4d[_0x7cc3('0x3e')][_0x7cc3('0x36')][0x0];}var _0x2ff1f1=_['defaults'](_0x2c1e45[_0x7cc3('0x25')],{'firstName':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x33')],'ListId':_0x708b4d[_0x7cc3('0x2c')]});_0x2ff1f1[_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x32')]]=_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x33')];return db['CmContact'][_0x7cc3('0x48')](_0x2ff1f1);}else{throw new Error(_0x7cc3('0x49'));}})[_0x7cc3('0xf')](function(_0x396788){_0x23fda6[_0x7cc3('0x4a')]=_0x396788;if(_0x396788){if(!_0x2c1e45[_0x7cc3('0x25')]['message'][_0x7cc3('0x4b')]){_0x2c1e45[_0x7cc3('0x25')]['message']['messageId']=rs[_0x7cc3('0x4c')]()+'\x20'+_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x33')];}var _0x150116={'ContactId':_0x396788['id'],'MailAccountId':_0x2c1e45[_0x7cc3('0x34')]['id'],'inReplyTo':_0x2c1e45[_0x7cc3('0x25')]['message'][_0x7cc3('0x4b')],'to':_0x2c1e45['body'][_0x7cc3('0x16')][_0x7cc3('0x33')],'cc':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')]['cc'],'subject':_0x2c1e45[_0x7cc3('0x25')]['message'][_0x7cc3('0x4d')],'attach':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4e')],'lastMsgAt':moment()[_0x7cc3('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7cc3('0x50')][_0x7cc3('0x22')]({'where':{'closed':![],'MailAccountId':_0x2c1e45['account']['id']},'include':[{'model':db[_0x7cc3('0x51')],'as':_0x7cc3('0x52'),'attributes':['messageId'],'where':{'messageId':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x53')]}}]})[_0x7cc3('0xf')](function(_0x4c1ff2){if(_0x4c1ff2){return[_0x4c1ff2,![]];}return db[_0x7cc3('0x50')][_0x7cc3('0x48')](_0x150116)[_0x7cc3('0xf')](function(_0x453ed0){return[_0x453ed0,!![]];});});}else{throw new Error(_0x7cc3('0x54'));}})[_0x7cc3('0x55')](function(_0x3efb9c,_0x5eb74c){if(_0x3efb9c){_0x20efef=_0x5eb74c;if(!_0x5eb74c){return _0x3efb9c[_0x7cc3('0x56')]({'inReplyTo':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4b')],'to':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')]['from'],'cc':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')]['cc'],'subject':_0x2c1e45[_0x7cc3('0x25')]['message'][_0x7cc3('0x4d')],'attach':_0x3efb9c['attach']?_0x3efb9c[_0x7cc3('0x4e')]:_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4e')],'substatus':null,'substatusAt':moment()[_0x7cc3('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7cc3('0x4f')](_0x7cc3('0x57')),'lastMsgDirection':'in'});}else{return _0x3efb9c;}}})[_0x7cc3('0xf')](function(_0x24ae16){_0x23fda6[_0x7cc3('0x58')]=_0x24ae16[_0x7cc3('0x3c')]({'plain':!![]});_0x23fda6[_0x7cc3('0x58')]['created']=_0x20efef;return db[_0x7cc3('0x51')][_0x7cc3('0x48')]({'body':_0x2c1e45[_0x7cc3('0x25')]['body'],'MailAccountId':_0x2c1e45[_0x7cc3('0x34')]['id'],'MailInteractionId':_0x24ae16['id'],'direction':'in','ContactId':_0x23fda6[_0x7cc3('0x4a')]['id'],'messageId':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4b')],'from':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x33')],'to':_0x2c1e45['body'][_0x7cc3('0x16')]['to'],'cc':_0x2c1e45['body'][_0x7cc3('0x16')]['cc'],'subject':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4d')],'attach':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x4e')],'Attachments':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')]['attachments'],'originTo':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x59')],'originCc':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x5a')],'bcc':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x5b')],'ChatWebsiteId':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x5c')]||null,'originChannel':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x5d')]||_0x7cc3('0x5e'),'ChatOfflineMessageId':_0x2c1e45[_0x7cc3('0x25')][_0x7cc3('0x16')][_0x7cc3('0x5f')]||null},{'include':[{'model':db[_0x7cc3('0x60')],'as':'Attachments'}]});})[_0x7cc3('0xf')](function(_0xe91cd8){_0x23fda6[_0x7cc3('0x16')]=_0xe91cd8;if(_0x23fda6['interaction'][_0x7cc3('0x61')]){return db[_0x7cc3('0x62')][_0x7cc3('0x22')]({'attributes':['id',_0x7cc3('0x63')],'where':{'id':_0x23fda6['interaction']['UserId']}})[_0x7cc3('0xf')](function(_0xe0d090){if(_0xe0d090){_0x23fda6[_0x7cc3('0x41')][_0x7cc3('0x64')]({'id':0x0,'priority':0x0,'app':_0x7cc3('0x65'),'appdata':_0xe0d090[_0x7cc3('0x63')]+','+(_0x23fda6['account'][_0x7cc3('0x66')]||0xa),'interval':_0x7cc3('0x47')});}return respondWithRpcPromise(_0x7cc3('0x67'),'startRouting',_0x23fda6);});}return respondWithRpcPromise('Start',_0x7cc3('0x68'),_0x23fda6);})[_0x7cc3('0xf')](function(_0x2a2f7c){_0x1a03fc(_0x2a2f7c);})[_0x7cc3('0x17')](function(_0x5dcccb){_0x256085(_0x3af9ac[_0x7cc3('0x14')](0x1f4,_0x5dcccb[_0x7cc3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 511f4b6..34dc0e6 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 _0x09f5=['update','emit','removeListener','register','length','./mailAccount.events','remove'];(function(_0xb77b48,_0xd234ae){var _0x46c8e9=function(_0x517dd7){while(--_0x517dd7){_0xb77b48['push'](_0xb77b48['shift']());}};_0x46c8e9(++_0xd234ae);}(_0x09f5,0x1b0));var _0x509f=function(_0xa500da,_0x4fe100){_0xa500da=_0xa500da-0x0;var _0x23dbca=_0x09f5[_0xa500da];return _0x23dbca;};'use strict';var MailAccountEvents=require(_0x509f('0x0'));var events=['save',_0x509f('0x1'),_0x509f('0x2')];function createListener(_0x3de60e,_0x3ffa73){return function(_0x2ff5ef){_0x3ffa73[_0x509f('0x3')](_0x3de60e,_0x2ff5ef);};}function removeListener(_0x5c67de,_0x3225c6){return function(){MailAccountEvents[_0x509f('0x4')](_0x5c67de,_0x3225c6);};}exports[_0x509f('0x5')]=function(_0x752916){for(var _0xeea16f=0x0,_0xfa4a1c=events[_0x509f('0x6')];_0xeea16f<_0xfa4a1c;_0xeea16f++){var _0x1b4365=events[_0xeea16f];var _0x2184eb=createListener('mailAccount:'+_0x1b4365,_0x752916);MailAccountEvents['on'](_0x1b4365,_0x2184eb);}}; \ No newline at end of file +var _0x54c2=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x18b591,_0x2b65dd){var _0xb6773a=function(_0x39cbb6){while(--_0x39cbb6){_0x18b591['push'](_0x18b591['shift']());}};_0xb6773a(++_0x2b65dd);}(_0x54c2,0x7d));var _0x254c=function(_0x1390a0,_0x499668){_0x1390a0=_0x1390a0-0x0;var _0x359f67=_0x54c2[_0x1390a0];return _0x359f67;};'use strict';var MailAccountEvents=require(_0x254c('0x0'));var events=[_0x254c('0x1'),_0x254c('0x2'),'update'];function createListener(_0x48739c,_0x2fa2f7){return function(_0x1c0b95){_0x2fa2f7[_0x254c('0x3')](_0x48739c,_0x1c0b95);};}function removeListener(_0x4ad121,_0x1b4ff9){return function(){MailAccountEvents[_0x254c('0x4')](_0x4ad121,_0x1b4ff9);};}exports[_0x254c('0x5')]=function(_0x2c1065){for(var _0x5a15c4=0x0,_0x4f6441=events[_0x254c('0x6')];_0x5a15c4<_0x4f6441;_0x5a15c4++){var _0x3c88d5=events[_0x5a15c4];var _0x41d3b7=createListener(_0x254c('0x7')+_0x3c88d5,_0x2c1065);MailAccountEvents['on'](_0x3c88d5,_0x41d3b7);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3b2546b..a084d0f 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 _0xd356=['delete','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','/:id','isAuthenticated','show','put','update'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xd356,0x91));var _0x6d35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd356[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6d35('0x0'));var path=require(_0x6d35('0x1'));var timeout=require(_0x6d35('0x2'));var express=require(_0x6d35('0x3'));var router=express['Router']();var fs_extra=require(_0x6d35('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d35('0x5'));var controller=require('./mailApplication.controller');router['get'](_0x6d35('0x6'),auth[_0x6d35('0x7')](),controller[_0x6d35('0x8')]);router[_0x6d35('0x9')](_0x6d35('0x6'),auth[_0x6d35('0x7')](),controller[_0x6d35('0xa')]);router[_0x6d35('0xb')](_0x6d35('0x6'),auth[_0x6d35('0x7')](),controller['destroy']);module[_0x6d35('0xc')]=router; \ No newline at end of file +var _0x1074=['express','Router','fs-extra','../../config/environment','./mailApplication.controller','show','/:id','isAuthenticated','delete','destroy','multer','util','path','connect-timeout'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x1074,0x1ca));var _0x4107=function(_0x546af3,_0x904a3f){_0x546af3=_0x546af3-0x0;var _0x1c156a=_0x1074[_0x546af3];return _0x1c156a;};'use strict';var multer=require(_0x4107('0x0'));var util=require(_0x4107('0x1'));var path=require(_0x4107('0x2'));var timeout=require(_0x4107('0x3'));var express=require(_0x4107('0x4'));var router=express[_0x4107('0x5')]();var fs_extra=require(_0x4107('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4107('0x7'));var controller=require(_0x4107('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x4107('0x9')]);router['put'](_0x4107('0xa'),auth[_0x4107('0xb')](),controller['update']);router[_0x4107('0xc')](_0x4107('0xa'),auth[_0x4107('0xb')](),controller[_0x4107('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 04e9c6c..2b18ea7 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 _0x75aa=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x75aa,0xdb));var _0xa75a=function(_0x357317,_0x3dc220){_0x357317=_0x357317-0x0;var _0x58cc19=_0x75aa[_0x357317];return _0x58cc19;};'use strict';var Sequelize=require(_0xa75a('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa75a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa75a('0x2')],'allowNull':![],'defaultValue':_0xa75a('0x3')},'appdata':{'type':Sequelize[_0xa75a('0x4')]()},'description':{'type':Sequelize[_0xa75a('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa75a('0x5')}}; \ No newline at end of file +var _0x03d1=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x1aeda2,_0x1217eb){var _0x32dc6d=function(_0x34a460){while(--_0x34a460){_0x1aeda2['push'](_0x1aeda2['shift']());}};_0x32dc6d(++_0x1217eb);}(_0x03d1,0x115));var _0x103d=function(_0x5b8ab4,_0x436f40){_0x5b8ab4=_0x5b8ab4-0x0;var _0x35df59=_0x03d1[_0x5b8ab4];return _0x35df59;};'use strict';var Sequelize=require(_0x103d('0x0'));module['exports']={'priority':{'type':Sequelize[_0x103d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x103d('0x2')],'allowNull':![],'defaultValue':_0x103d('0x3')},'appdata':{'type':Sequelize[_0x103d('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ab7f35c..bbe50cc 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0xaa88[_0xf35bc1];return _0xa6b162;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x2d0a0b,_0x234fb7){var _0x328b9c=function(_0x269e63){while(--_0x269e63){_0x2d0a0b['push'](_0x2d0a0b['shift']());}};_0x328b9c(++_0x234fb7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));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('0x8'));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 licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index e954286..64dde50 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 _0x4ce7=['define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports'];(function(_0x150d2e,_0x4cc551){var _0x17f42b=function(_0x267be5){while(--_0x267be5){_0x150d2e['push'](_0x150d2e['shift']());}};_0x17f42b(++_0x4cc551);}(_0x4ce7,0x9b));var _0x74ce=function(_0x3d03f3,_0x4ab492){_0x3d03f3=_0x3d03f3-0x0;var _0x56aeef=_0x4ce7[_0x3d03f3];return _0x56aeef;};'use strict';var _=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var logger=require(_0x74ce('0x2'))(_0x74ce('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74ce('0x4'));var fs=require('fs');var path=require(_0x74ce('0x5'));var rimraf=require(_0x74ce('0x6'));var config=require(_0x74ce('0x7'));var attributes=require(_0x74ce('0x8'));module[_0x74ce('0x9')]=function(_0x260cf2,_0x27319e){return _0x260cf2[_0x74ce('0xa')](_0x74ce('0xb'),attributes,{'tableName':_0x74ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74ce('0xd'),'collate':_0x74ce('0xe')});}; \ No newline at end of file +var _0x9e47=['MailApplication','mail_applications','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailApplication.attributes','define'];(function(_0x4c66ab,_0x4b2113){var _0x2885c1=function(_0x22b0c9){while(--_0x22b0c9){_0x4c66ab['push'](_0x4c66ab['shift']());}};_0x2885c1(++_0x4b2113);}(_0x9e47,0x18e));var _0x79e4=function(_0x574381,_0x37ab49){_0x574381=_0x574381-0x0;var _0x38e017=_0x9e47[_0x574381];return _0x38e017;};'use strict';var _=require(_0x79e4('0x0'));var util=require(_0x79e4('0x1'));var logger=require(_0x79e4('0x2'))(_0x79e4('0x3'));var moment=require(_0x79e4('0x4'));var BPromise=require('bluebird');var rp=require(_0x79e4('0x5'));var fs=require('fs');var path=require(_0x79e4('0x6'));var rimraf=require('rimraf');var config=require(_0x79e4('0x7'));var attributes=require(_0x79e4('0x8'));module['exports']=function(_0x40cdb1,_0x2e89ba){return _0x40cdb1[_0x79e4('0x9')](_0x79e4('0xa'),attributes,{'tableName':_0x79e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 5942a75..5d127ca 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 _0x2719=['http','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','body','options','where','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xb22608,_0x2328e3){var _0x568ed4=function(_0x5ab77f){while(--_0x5ab77f){_0xb22608['push'](_0xb22608['shift']());}};_0x568ed4(++_0x2328e3);}(_0x2719,0xde));var _0x9271=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2719[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x9271('0x0'));var moment=require(_0x9271('0x1'));var BPromise=require(_0x9271('0x2'));var rs=require(_0x9271('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9271('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9271('0x5'))(_0x9271('0x6'));var config=require(_0x9271('0x7'));var jayson=require(_0x9271('0x8'));var client=jayson[_0x9271('0x9')][_0x9271('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fab2d,_0xaf69f3,_0x2c6d05){return new BPromise(function(_0x4934e3,_0x1ad9ad){return client[_0x9271('0xb')](_0x1fab2d,_0x2c6d05)[_0x9271('0xc')](function(_0x42de7f){logger['info']('MailApplication,\x20%s,\x20%s',_0xaf69f3,_0x9271('0xd'));logger[_0x9271('0xe')](_0x9271('0xf'),_0xaf69f3,_0x9271('0xd'),JSON[_0x9271('0x10')](_0x42de7f));if(_0x42de7f['error']){if(_0x42de7f[_0x9271('0x11')][_0x9271('0x12')]===0x1f4){logger['error'](_0x9271('0x13'),_0xaf69f3,_0x42de7f[_0x9271('0x11')][_0x9271('0x14')]);return _0x1ad9ad(_0x42de7f[_0x9271('0x11')][_0x9271('0x14')]);}logger[_0x9271('0x11')](_0x9271('0x13'),_0xaf69f3,_0x42de7f['error']['message']);return _0x4934e3(_0x42de7f[_0x9271('0x11')][_0x9271('0x14')]);}else{logger['info'](_0x9271('0x13'),_0xaf69f3,_0x9271('0xd'));_0x4934e3(_0x42de7f[_0x9271('0x15')][_0x9271('0x14')]);}})[_0x9271('0x16')](function(_0x2c2849){logger[_0x9271('0x11')](_0x9271('0x13'),_0xaf69f3,_0x2c2849);_0x1ad9ad(_0x2c2849);});});}exports[_0x9271('0x17')]=function(_0x5f97dc){var _0x42216e=this;return new Promise(function(_0x160521,_0x481473){return db[_0x9271('0x18')]['update'](_0x5f97dc[_0x9271('0x19')],{'raw':_0x5f97dc[_0x9271('0x1a')]?_0x5f97dc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f97dc[_0x9271('0x1a')]?_0x5f97dc[_0x9271('0x1a')][_0x9271('0x1b')]||null:null,'attributes':_0x5f97dc['options']?_0x5f97dc[_0x9271('0x1a')]['attributes']||null:null,'limit':_0x5f97dc[_0x9271('0x1a')]?_0x5f97dc[_0x9271('0x1a')][_0x9271('0x1c')]||null:null})[_0x9271('0xc')](function(_0x4a5b4a){logger['info'](_0x9271('0x17'),_0x5f97dc);logger['debug']('UpdateMailApplication',_0x5f97dc,JSON[_0x9271('0x10')](_0x4a5b4a));_0x160521(_0x4a5b4a);})[_0x9271('0x16')](function(_0x2d890f){logger[_0x9271('0x11')](_0x9271('0x17'),_0x2d890f['message'],_0x5f97dc);_0x481473(_0x42216e['error'](0x1f4,_0x2d890f[_0x9271('0x14')]));});});}; \ No newline at end of file +var _0x9189=['raw','options','where','limit','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication,\x20%s,\x20%s','catch','UpdateMailApplication','MailApplication'];(function(_0x4ac00b,_0x486aa9){var _0x3ed73f=function(_0x29fd28){while(--_0x29fd28){_0x4ac00b['push'](_0x4ac00b['shift']());}};_0x3ed73f(++_0x486aa9);}(_0x9189,0x1d5));var _0x9918=function(_0x548b73,_0x4852ec){_0x548b73=_0x548b73-0x0;var _0x335dab=_0x9189[_0x548b73];return _0x335dab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9918('0x0'));var BPromise=require(_0x9918('0x1'));var rs=require(_0x9918('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9918('0x3'))['db'];var utils=require(_0x9918('0x4'));var logger=require(_0x9918('0x5'))(_0x9918('0x6'));var config=require(_0x9918('0x7'));var jayson=require(_0x9918('0x8'));var client=jayson[_0x9918('0x9')][_0x9918('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30b250,_0x4fd864,_0x166633){return new BPromise(function(_0x34f944,_0x442d62){return client[_0x9918('0xb')](_0x30b250,_0x166633)[_0x9918('0xc')](function(_0x407c23){logger[_0x9918('0xd')]('MailApplication,\x20%s,\x20%s',_0x4fd864,_0x9918('0xe'));logger['debug'](_0x9918('0xf'),_0x4fd864,_0x9918('0xe'),JSON[_0x9918('0x10')](_0x407c23));if(_0x407c23['error']){if(_0x407c23[_0x9918('0x11')][_0x9918('0x12')]===0x1f4){logger[_0x9918('0x11')]('MailApplication,\x20%s,\x20%s',_0x4fd864,_0x407c23['error'][_0x9918('0x13')]);return _0x442d62(_0x407c23['error'][_0x9918('0x13')]);}logger[_0x9918('0x11')]('MailApplication,\x20%s,\x20%s',_0x4fd864,_0x407c23[_0x9918('0x11')][_0x9918('0x13')]);return _0x34f944(_0x407c23[_0x9918('0x11')][_0x9918('0x13')]);}else{logger['info'](_0x9918('0x14'),_0x4fd864,_0x9918('0xe'));_0x34f944(_0x407c23['result'][_0x9918('0x13')]);}})[_0x9918('0x15')](function(_0x5f1ef9){logger[_0x9918('0x11')](_0x9918('0x14'),_0x4fd864,_0x5f1ef9);_0x442d62(_0x5f1ef9);});});}exports[_0x9918('0x16')]=function(_0x3bb7c0){var _0x28d7c5=this;return new Promise(function(_0x1a6934,_0x266d68){return db[_0x9918('0x17')]['update'](_0x3bb7c0['body'],{'raw':_0x3bb7c0['options']?_0x3bb7c0['options'][_0x9918('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb7c0[_0x9918('0x19')]?_0x3bb7c0[_0x9918('0x19')][_0x9918('0x1a')]||null:null,'attributes':_0x3bb7c0[_0x9918('0x19')]?_0x3bb7c0[_0x9918('0x19')]['attributes']||null:null,'limit':_0x3bb7c0[_0x9918('0x19')]?_0x3bb7c0[_0x9918('0x19')][_0x9918('0x1b')]||null:null})[_0x9918('0xc')](function(_0x191a81){logger['info']('UpdateMailApplication',_0x3bb7c0);logger[_0x9918('0x1c')](_0x9918('0x16'),_0x3bb7c0,JSON[_0x9918('0x10')](_0x191a81));_0x1a6934(_0x191a81);})[_0x9918('0x15')](function(_0x37c448){logger[_0x9918('0x11')](_0x9918('0x16'),_0x37c448[_0x9918('0x13')],_0x3bb7c0);_0x266d68(_0x28d7c5[_0x9918('0x11')](0x1f4,_0x37c448[_0x9918('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a41595c..92b6e9b 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 _0xabdf=['addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','update','delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages'];(function(_0xe850ce,_0x1f05ad){var _0x109bd1=function(_0x2e90ba){while(--_0x2e90ba){_0xe850ce['push'](_0xe850ce['shift']());}};_0x109bd1(++_0x1f05ad);}(_0xabdf,0x68));var _0xfabd=function(_0x352108,_0xb5cdc3){_0x352108=_0x352108-0x0;var _0x2c901c=_0xabdf[_0x352108];return _0x2c901c;};'use strict';var multer=require(_0xfabd('0x0'));var util=require(_0xfabd('0x1'));var path=require(_0xfabd('0x2'));var timeout=require('connect-timeout');var express=require(_0xfabd('0x3'));var router=express[_0xfabd('0x4')]();var fs_extra=require(_0xfabd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfabd('0x6'));var config=require('../../config/environment');var controller=require(_0xfabd('0x7'));router['get']('/',auth[_0xfabd('0x8')](),controller['index']);router[_0xfabd('0x9')](_0xfabd('0xa'),auth['isAuthenticated'](),controller[_0xfabd('0xb')]);router[_0xfabd('0x9')](_0xfabd('0xc'),auth[_0xfabd('0x8')](),controller[_0xfabd('0xd')]);router[_0xfabd('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xfabd('0xe')]);router[_0xfabd('0x9')](_0xfabd('0xf'),auth['isAuthenticated'](),controller[_0xfabd('0x10')]);router[_0xfabd('0x11')]('/',auth['isAuthenticated'](),controller[_0xfabd('0x12')]);router[_0xfabd('0x11')](_0xfabd('0x13'),auth[_0xfabd('0x8')](),controller[_0xfabd('0x14')]);router[_0xfabd('0x11')](_0xfabd('0x15'),auth[_0xfabd('0x8')](),interaction[_0xfabd('0x16')](_0xfabd('0x17'),_0xfabd('0x18')),controller['addTags']);router['put']('/:id',auth[_0xfabd('0x8')](),interaction['tracked'](_0xfabd('0x17'),'mailinteraction:update'),controller[_0xfabd('0x19')]);router[_0xfabd('0x1a')](_0xfabd('0xc'),auth[_0xfabd('0x8')](),interaction[_0xfabd('0x16')](_0xfabd('0x17'),_0xfabd('0x1b')),controller[_0xfabd('0x1c')]);router[_0xfabd('0x1a')](_0xfabd('0x15'),auth['isAuthenticated'](),controller[_0xfabd('0x1d')]);module[_0xfabd('0x1e')]=router; \ No newline at end of file +var _0x1680=['get','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./mailInteraction.controller'];(function(_0x40fcb0,_0xbd7169){var _0x26cd3e=function(_0x3227e0){while(--_0x3227e0){_0x40fcb0['push'](_0x40fcb0['shift']());}};_0x26cd3e(++_0xbd7169);}(_0x1680,0x84));var _0x0168=function(_0x12e73c,_0x2cbe1d){_0x12e73c=_0x12e73c-0x0;var _0x4c41cb=_0x1680[_0x12e73c];return _0x4c41cb;};'use strict';var multer=require(_0x0168('0x0'));var util=require(_0x0168('0x1'));var path=require(_0x0168('0x2'));var timeout=require(_0x0168('0x3'));var express=require(_0x0168('0x4'));var router=express['Router']();var fs_extra=require(_0x0168('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0168('0x6'));var config=require('../../config/environment');var controller=require(_0x0168('0x7'));router[_0x0168('0x8')]('/',auth[_0x0168('0x9')](),controller['index']);router['get']('/describe',auth[_0x0168('0x9')](),controller[_0x0168('0xa')]);router[_0x0168('0x8')](_0x0168('0xb'),auth['isAuthenticated'](),controller[_0x0168('0xc')]);router[_0x0168('0x8')](_0x0168('0xd'),auth[_0x0168('0x9')](),controller['getMessages']);router[_0x0168('0x8')](_0x0168('0xe'),auth['isAuthenticated'](),controller[_0x0168('0xf')]);router[_0x0168('0x10')]('/',auth[_0x0168('0x9')](),controller[_0x0168('0x11')]);router['post'](_0x0168('0xd'),auth[_0x0168('0x9')](),controller['addMessage']);router['post'](_0x0168('0x12'),auth['isAuthenticated'](),interaction[_0x0168('0x13')](_0x0168('0x14'),_0x0168('0x15')),controller[_0x0168('0x16')]);router['put'](_0x0168('0xb'),auth['isAuthenticated'](),interaction[_0x0168('0x13')](_0x0168('0x14'),_0x0168('0x17')),controller['update']);router[_0x0168('0x18')](_0x0168('0xb'),auth[_0x0168('0x9')](),interaction[_0x0168('0x13')](_0x0168('0x14'),'mailinteraction:destroy'),controller[_0x0168('0x19')]);router[_0x0168('0x18')](_0x0168('0x12'),auth[_0x0168('0x9')](),controller[_0x0168('0x1a')]);module[_0x0168('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3c12d1a..cbee50e 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 _0x494a=['long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x494a,0x11c));var _0xa494=function(_0x2e90bc,_0x1d8135){_0x2e90bc=_0x2e90bc-0x0;var _0x581023=_0x494a[_0x2e90bc];return _0x581023;};'use strict';var Sequelize=require(_0xa494('0x0'));var iconv=require(_0xa494('0x1'));module[_0xa494('0x2')]={'closed':{'type':Sequelize[_0xa494('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa494('0x4')]},'disposition':{'type':Sequelize[_0xa494('0x5')]},'secondDisposition':{'type':Sequelize[_0xa494('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa494('0x5')]},'inReplyTo':{'type':Sequelize[_0xa494('0x5')](0x1fe)},'to':{'type':Sequelize[_0xa494('0x5')]},'cc':{'type':Sequelize['TEXT'](_0xa494('0x6'))},'subject':{'type':Sequelize[_0xa494('0x7')]()},'attach':{'type':Sequelize[_0xa494('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa494('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xa494('0x8')]('in',_0xa494('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa494('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa494('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x713d=['TEXT','BOOLEAN','ENUM','sequelize','exports','DATE','STRING'];(function(_0x45a2b4,_0x2cae91){var _0x150ff3=function(_0x526097){while(--_0x526097){_0x45a2b4['push'](_0x45a2b4['shift']());}};_0x150ff3(++_0x2cae91);}(_0x713d,0xb9));var _0xd713=function(_0x55bc37,_0x1a49c0){_0x55bc37=_0x55bc37-0x0;var _0x2b143b=_0x713d[_0x55bc37];return _0x2b143b;};'use strict';var Sequelize=require(_0xd713('0x0'));var iconv=require('iconv');module[_0xd713('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd713('0x2')]},'disposition':{'type':Sequelize[_0xd713('0x3')]},'secondDisposition':{'type':Sequelize[_0xd713('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd713('0x3')]},'note':{'type':Sequelize[_0xd713('0x3')]},'inReplyTo':{'type':Sequelize[_0xd713('0x3')](0x1fe)},'to':{'type':Sequelize[_0xd713('0x3')]},'cc':{'type':Sequelize[_0xd713('0x4')]('long')},'subject':{'type':Sequelize[_0xd713('0x4')]()},'attach':{'type':Sequelize[_0xd713('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd713('0x2')]},'substatus':{'type':Sequelize[_0xd713('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xd713('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd713('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd713('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd713('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd713('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index e53f9d5..00af186 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 _0x7384=['jsforce','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','count','limit','Content-Range','apply','reject','then','stack','name','send','map','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','lastMsgText','index','MailInteraction','fieldName','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','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','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','clone','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','rows','catch','params','rawAttributes','includeAll','include','options','create','body','update','describe','addMessage','omit','ids','hasOwnProperty','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','join','root','server','files','transcript-%d-%s.zip','attachments','Attachments','subject','Messages','get','each','headers','bcc','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0x7384,0xe0));var _0x4738=function(_0x14aa55,_0x2629af){_0x14aa55=_0x14aa55-0x0;var _0x5c2069=_0x7384[_0x14aa55];return _0x5c2069;};'use strict';var emlformat=require(_0x4738('0x0'));var rimraf=require(_0x4738('0x1'));var zipdir=require(_0x4738('0x2'));var jsonpatch=require(_0x4738('0x3'));var rp=require(_0x4738('0x4'));var moment=require('moment');var BPromise=require(_0x4738('0x5'));var Mustache=require(_0x4738('0x6'));var util=require(_0x4738('0x7'));var path=require(_0x4738('0x8'));var sox=require(_0x4738('0x9'));var csv=require('to-csv');var ejs=require(_0x4738('0xa'));var fs=require('fs');var fs_extra=require(_0x4738('0xb'));var _=require(_0x4738('0xc'));var squel=require(_0x4738('0xd'));var crypto=require('crypto');var jsforce=require(_0x4738('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4738('0xf'));var Papa=require('papaparse');var htmlToText=require(_0x4738('0x10'));var juice=require(_0x4738('0x11'));var Redis=require(_0x4738('0x12'));var authService=require(_0x4738('0x13'));var qs=require(_0x4738('0x14'));var as=require(_0x4738('0x15'));var hardwareService=require(_0x4738('0x16'));var logger=require(_0x4738('0x17'))(_0x4738('0x18'));var utils=require(_0x4738('0x19'));var config=require(_0x4738('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4738('0x1b'))['db'];config['redis']=_[_0x4738('0x1c')](config[_0x4738('0x1d')],{'host':_0x4738('0x1e'),'port':0x18eb});var socket=require(_0x4738('0x1f'))(new Redis(config['redis']));require(_0x4738('0x20'))['register'](socket);function respondWithStatusCode(_0x5adb28,_0x58f47c){_0x58f47c=_0x58f47c||0xcc;return function(_0x35fe0b){if(_0x35fe0b){return _0x5adb28['sendStatus'](_0x58f47c);}return _0x5adb28[_0x4738('0x21')](_0x58f47c)[_0x4738('0x22')]();};}function respondWithResult(_0x260002,_0x3f84bf){_0x3f84bf=_0x3f84bf||0xc8;return function(_0x8b657b){if(_0x8b657b){return _0x260002[_0x4738('0x21')](_0x3f84bf)[_0x4738('0x23')](_0x8b657b);}};}function respondWithFilteredResult(_0x4eeaed,_0x19d34d){return function(_0x418c36){if(_0x418c36){var _0x34970b=typeof _0x19d34d[_0x4738('0x24')]==='undefined'&&typeof _0x19d34d['limit']==='undefined';var _0x579c55=_0x418c36['count'];var _0x2abbe1=_0x34970b?0x0:_0x19d34d[_0x4738('0x24')];var _0x3a0ee8=_0x34970b?_0x418c36[_0x4738('0x25')]:_0x19d34d[_0x4738('0x24')]+_0x19d34d[_0x4738('0x26')];var _0x599736;if(_0x3a0ee8>=_0x579c55){_0x3a0ee8=_0x579c55;_0x599736=0xc8;}else{_0x599736=0xce;}_0x4eeaed[_0x4738('0x21')](_0x599736);return _0x4eeaed['set'](_0x4738('0x27'),_0x2abbe1+'-'+_0x3a0ee8+'/'+_0x579c55)[_0x4738('0x23')](_0x418c36);}return null;};}function patchUpdates(_0x2cfce8){return function(_0x585eac){try{jsonpatch[_0x4738('0x28')](_0x585eac,_0x2cfce8,!![]);}catch(_0x4b5acb){return BPromise[_0x4738('0x29')](_0x4b5acb);}return _0x585eac['save']();};}function saveUpdates(_0x3a4e8e,_0x1e6eed){return function(_0x269ba8){if(_0x269ba8){return _0x269ba8['update'](_0x3a4e8e)[_0x4738('0x2a')](function(_0x4b76fc){return _0x4b76fc;});}return null;};}function removeEntity(_0x59a3d6,_0x2e1256){return function(_0x16128e){if(_0x16128e){return _0x16128e['destroy']()['then'](function(){_0x59a3d6[_0x4738('0x21')](0xcc)[_0x4738('0x22')]();});}};}function handleEntityNotFound(_0x32e146,_0xab076f){return function(_0x219f36){if(!_0x219f36){_0x32e146['sendStatus'](0x194);}return _0x219f36;};}function handleError(_0x5683c7,_0x3b2cce){_0x3b2cce=_0x3b2cce||0x1f4;return function(_0x5ec6d3){logger['error'](_0x5ec6d3[_0x4738('0x2b')]);if(_0x5ec6d3[_0x4738('0x2c')]){delete _0x5ec6d3[_0x4738('0x2c')];}_0x5683c7[_0x4738('0x21')](_0x3b2cce)[_0x4738('0x2d')](_0x5ec6d3);};}function getInteractionUsers(_0x536ee9,_0x717e4){return new BPromise(function(_0x23cb5a,_0x18769e){try{if(_0x717e4[_0x536ee9['id']]){_0x536ee9['Users']=_[_0x4738('0x2e')](_0x717e4[_0x536ee9['id']],function(_0x120681){return{'id':_0x120681['id'],'fullname':_0x120681['fullname']};});}}catch(_0x5cdcfa){_0x18769e(_0x5cdcfa);}_0x23cb5a(_0x536ee9);});}function getInteractionTags(_0x23cb66,_0x2f6ebb){return new BPromise(function(_0x2974a4,_0x23a121){try{if(_0x23cb66['TagIds']){_0x23cb66['Tags']=[];_0x23cb66[_0x4738('0x2f')][_0x4738('0x30')](',')[_0x4738('0x31')](function(_0x26534c){_0x23cb66[_0x4738('0x32')][_0x4738('0x33')](_0x2f6ebb[_0x26534c]);});}delete _0x23cb66[_0x4738('0x2f')];}catch(_0x12c324){_0x23a121(_0x12c324);}_0x2974a4(_0x23cb66);});}function getLastMessageText(_0x4cb1d9){return new BPromise(function(_0x4ef525,_0x45dacb){return db[_0x4738('0x34')][_0x4738('0x35')]({'where':{'$and':[{'MailInteractionId':_0x4cb1d9['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4738('0x36')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x4738('0x37')],'order':'-id','raw':!![]})['then'](function(_0x4670de){if(_0x4670de&&_0x4670de['plainBody']){_0x4cb1d9[_0x4738('0x38')]=_['trimStart'](_0x4670de[_0x4738('0x37')]);}_0x4ef525(_0x4cb1d9);})['catch'](function(_0x4d2db4){_0x45dacb(_0x4d2db4);});});}function updateMailInteraction(_0x2f6e9c,_0x49de0d,_0x342611,_0x2645bf){return new BPromise(function(_0xe29ea7,_0x5df2b5){return getInteractionUsers(_0x2f6e9c,_0x342611)[_0x4738('0x2a')](function(_0x2b760b){return getInteractionTags(_0x2b760b,_0x49de0d);})['then'](function(_0xf41e2){if(_0x2645bf){_0xe29ea7(getLastMessageText(_0xf41e2));}else{_0xe29ea7(_0xf41e2);}})['catch'](function(_0x4b4d00){_0x5df2b5(_0x4b4d00);});});}exports[_0x4738('0x39')]=function(_0x5339b3,_0x14cac2){var _0x1cf17f={},_0x100e75={},_0x277212={'count':0x0,'rows':[]};var _0x12865e=_['map'](db[_0x4738('0x3a')]['rawAttributes'],function(_0x2c125f){return{'name':_0x2c125f[_0x4738('0x3b')],'type':_0x2c125f['type']['key']};});_0x100e75[_0x4738('0x3c')]=_['map'](_0x12865e,_0x4738('0x2c'));_0x100e75[_0x4738('0x3d')]=_[_0x4738('0x3e')](_0x5339b3['query']);_0x100e75[_0x4738('0x3f')]=_[_0x4738('0x40')](_0x100e75[_0x4738('0x3c')],_0x100e75[_0x4738('0x3d')]);_0x1cf17f['attributes']=_[_0x4738('0x40')](_0x100e75[_0x4738('0x3c')],qs[_0x4738('0x41')](_0x5339b3[_0x4738('0x3d')][_0x4738('0x41')]));_0x1cf17f['attributes']=_0x1cf17f[_0x4738('0x42')][_0x4738('0x43')]?_0x1cf17f[_0x4738('0x42')]:_0x100e75[_0x4738('0x3c')];if(!_0x5339b3[_0x4738('0x3d')]['hasOwnProperty'](_0x4738('0x44'))){_0x1cf17f['limit']=qs[_0x4738('0x26')](_0x5339b3[_0x4738('0x3d')]['limit']);_0x1cf17f[_0x4738('0x24')]=qs[_0x4738('0x24')](_0x5339b3['query'][_0x4738('0x24')]);}_0x1cf17f[_0x4738('0x45')]=qs[_0x4738('0x46')](_0x5339b3[_0x4738('0x3d')][_0x4738('0x46')]);_0x1cf17f[_0x4738('0x47')]=qs[_0x4738('0x3f')](_['pick'](_0x5339b3[_0x4738('0x3d')],_0x100e75['filters']),_0x12865e);var _0x2b5c9e=[];var _0x427ad2=squel[_0x4738('0x48')]()[_0x4738('0x49')]('id')[_0x4738('0x49')]('name')['field']('color')[_0x4738('0x4a')](_0x4738('0x4b'));var _0x4dc436=squel[_0x4738('0x48')]()['field'](_0x4738('0x4c'))[_0x4738('0x49')](_0x4738('0x4d'))[_0x4738('0x49')](_0x4738('0x4e'))['from']('user_has_mail_interactions','ui')[_0x4738('0x4f')]('users','u',_0x4738('0x50'));var _0x5b2f20=squel[_0x4738('0x48')]()[_0x4738('0x4a')](_0x4738('0x51'),'i')[_0x4738('0x4f')]('cm_contacts','c',_0x4738('0x52'))[_0x4738('0x4f')](_0x4738('0x53'),'o',_0x4738('0x54'))[_0x4738('0x4f')](_0x4738('0x55'),'a',_0x4738('0x56'))[_0x4738('0x4f')](_0x4738('0x57'),'me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0x4738('0x58'),'it',_0x4738('0x59'))[_0x4738('0x4f')](_0x4738('0x4b'),'t',_0x4738('0x5a'));var _0x329aec=squel[_0x4738('0x5b')]();var _0x4f4fa3=[];var _0x1d5ed6=squel[_0x4738('0x5b')]();var _0x334f23;if(_0x5339b3['query']['search']){_0x334f23=as[_0x4738('0x5c')](_0x5339b3[_0x4738('0x3d')]['search']);var _0x4e2bae=_0x334f23[_0x4738('0x5d')];for(var _0x36faae=0x0;_0x36faae<_0x334f23['conditions'][_0x4738('0x43')];_0x36faae++){var _0x3632d3=_0x334f23[_0x4738('0x5e')][_0x36faae];var _0x23f8b0='i';var _0x49e6b5=_[_0x4738('0x5f')](_0x12865e,['name',_0x3632d3[_0x4738('0x49')]]);if(!_0x49e6b5){switch(_0x3632d3[_0x4738('0x49')]){case _0x4738('0x60'):if(_0x3632d3[_0x4738('0x61')]==0x1){_0x5b2f20[_0x4738('0x62')]('`'+_0x3632d3[_0x4738('0x49')]+_0x4738('0x63'));}else{_0x5b2f20[_0x4738('0x62')]('`'+_0x3632d3[_0x4738('0x49')]+_0x4738('0x64'));}break;case _0x4738('0x65'):if(_0x3632d3[_0x4738('0x66')]==='$substring'){if(_0x3632d3['value'][_0x4738('0x30')]('\x20')[_0x4738('0x43')]>0x1){_0x329aec[_0x4e2bae](_0x4738('0x67'),qs[_0x4738('0x68')](_0x3632d3[_0x4738('0x61')]),null);}else{var _0x12c0bc='%'+_0x3632d3[_0x4738('0x61')]+'%';_0x329aec[_0x4e2bae](_0x4738('0x69'),_0x12c0bc,_0x12c0bc,_0x12c0bc);}}else{_0x49e6b5=_[_0x4738('0x5f')](_0x12865e,[_0x4738('0x2c'),'ContactId']);_0x3632d3[_0x4738('0x49')]=_0x4738('0x6a');_0x1992d5=as[_0x4738('0x6b')](_0x23f8b0,_0x49e6b5[_0x4738('0x6c')],_0x3632d3);_0x329aec[_0x4e2bae](_0x1992d5['text'],_0x1992d5[_0x4738('0x61')][_0x4738('0x6d')],_0x1992d5[_0x4738('0x61')][_0x4738('0x22')]);}break;case _0x4738('0x6e'):var _0x1724a0=_0x3632d3[_0x4738('0x61')]['split'](',')['map'](function(_0x4e3ae3){return Number(_0x4e3ae3);});_0x1724a0['forEach'](function(_0x2b5bb0){_0x1d5ed6['or'](_0x4738('0x6f'),'%,'+_0x2b5bb0+',%');});_0x4f4fa3=_[_0x4738('0x70')](_0x4f4fa3,_0x1724a0);break;case'User':if(_0x3632d3[_0x4738('0x66')]===_0x4738('0x71')){_0x329aec[_0x4e2bae](_0x4738('0x72'),'%'+_0x3632d3[_0x4738('0x61')]+'%',null);}else{_0x49e6b5=_[_0x4738('0x5f')](_0x12865e,['name','UserId']);_0x3632d3['field']=_0x4738('0x73');_0x1992d5=as[_0x4738('0x6b')](_0x23f8b0,_0x49e6b5['type'],_0x3632d3);_0x329aec[_0x4e2bae](_0x1992d5[_0x4738('0x74')],_0x1992d5[_0x4738('0x61')][_0x4738('0x6d')],_0x1992d5['value'][_0x4738('0x22')]);}break;case _0x4738('0x37'):_0x1992d5=as[_0x4738('0x6b')]('me',null,_0x3632d3);_0x329aec[_0x4e2bae](_0x1992d5[_0x4738('0x74')],_0x1992d5['value'][_0x4738('0x6d')],_0x1992d5[_0x4738('0x61')][_0x4738('0x22')]);break;}}else{var _0x1992d5=as['buildExpression'](_0x23f8b0,_0x49e6b5[_0x4738('0x6c')],_0x3632d3);_0x329aec[_0x4e2bae](_0x1992d5[_0x4738('0x74')],_0x1992d5['value'][_0x4738('0x6d')],_0x1992d5[_0x4738('0x61')][_0x4738('0x22')]);}}}else{var _0x26286a=_(_0x5339b3[_0x4738('0x3d')])[_0x4738('0x3e')]()[_0x4738('0x2e')](function(_0x12219f){return _[_0x4738('0x75')](_0x12865e,[_0x4738('0x2c'),_0x12219f])?_0x12219f:undefined;})['compact']()['value']();if(!_[_0x4738('0x76')](_0x26286a)){_0x26286a[_0x4738('0x31')](function(_0x5b5e41){if(_0x5b5e41===_0x4738('0x77')){_0x5b2f20[_0x4738('0x47')](_0x4738('0x78'),[][_0x4738('0x79')](_0x5339b3[_0x4738('0x3d')][_0x5b5e41]));}else if(_0x5b5e41===_0x4738('0x7a')){var _0x3d1487=JSON['parse'](_0x5339b3[_0x4738('0x3d')][_0x5b5e41])[_0x4738('0x7b')];var _0x5da096=JSON[_0x4738('0x7c')](_0x5339b3['query'][_0x5b5e41])[_0x4738('0x7d')];_0x5b2f20[_0x4738('0x47')](_0x4738('0x7e'),_0x3d1487,_0x5da096);}else{if(_0x5339b3[_0x4738('0x3d')][_0x5b5e41]===_0x4738('0x7f')){_0x5b2f20[_0x4738('0x47')]('i.'+_0x5b5e41+_0x4738('0x80'));}else{_0x5b2f20[_0x4738('0x47')]('i.'+_0x5b5e41+_0x4738('0x81'),_0x5339b3[_0x4738('0x3d')][_0x5b5e41]);}}});}if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x82')]){if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x82')]==0x1){_0x5b2f20[_0x4738('0x62')](_0x4738('0x83'));}else{_0x5b2f20[_0x4738('0x62')](_0x4738('0x84'));}}if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x85')]){_0x4f4fa3=_['isArray'](_0x5339b3[_0x4738('0x3d')][_0x4738('0x85')])?_0x5339b3[_0x4738('0x3d')][_0x4738('0x85')]:new Array(_0x5339b3['query'][_0x4738('0x85')]);_0x4f4fa3[_0x4738('0x31')](function(_0xd9dc4c){_0x1d5ed6['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd9dc4c+',%');});}if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x86')]){var _0x154ebf=_0x5339b3['query']['filter'][_0x4738('0x87')]('\x5c','\x5c\x5c')[_0x4738('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x154ebf)){_0x329aec['or'](_0x4738('0x88'),_0x154ebf+'%');}else if(qs['isEmail'](_0x154ebf)){_0x329aec['or'](_0x4738('0x89'),_0x154ebf+'%');}else{_0x329aec['or'](_0x4738('0x8a'),qs['getFullTextValue'](_0x154ebf))['or'](_0x4738('0x8b'),qs[_0x4738('0x68')](_0x154ebf));}}}_0x5b2f20['where'](_0x329aec);_0x5b2f20['group'](_0x4738('0x8c'));var _0x26911b={'type':db[_0x4738('0x8d')]['QueryTypes']['SELECT'],'raw':!![]};var _0x325ce8=_0x5b2f20[_0x4738('0x8e')]();_0x325ce8[_0x4738('0x49')]('i.id');_0x325ce8[_0x4738('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1cf17f[_0x4738('0x45')]){_0x1cf17f[_0x4738('0x45')][_0x4738('0x31')](function(_0x3dacfc){var _0x3ee3a9=_0x3dacfc[0x0]==='contactName'?_0x3dacfc[0x0]:'i.'+_0x3dacfc[0x0];_0x5b2f20[_0x4738('0x45')](_0x3ee3a9,_0x3dacfc[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4738('0x76')](_0x4f4fa3)){_0x5b2f20[_0x4738('0x62')](_0x1d5ed6);_0x325ce8[_0x4738('0x47')](_0x4738('0x8f'),_0x4f4fa3);}BPromise[_0x4738('0x90')]()['then'](function(){if(!_0x334f23){if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x77')])return;_0x325ce8[_0x4738('0x47')](_0x4738('0x91'));_0x5b2f20[_0x4738('0x47')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5339b3[_0x4738('0x92')]['role']!=='agent')return;return _0x5339b3[_0x4738('0x92')][_0x4738('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e2c94){if(_['isEmpty'](_0x1e2c94)){_0x325ce8[_0x4738('0x47')](_0x4738('0x94'));_0x5b2f20['where'](_0x4738('0x94'));}else{_0x325ce8['where'](_0x4738('0x78'),_[_0x4738('0x2e')](_0x1e2c94,'id'));_0x5b2f20['where'](_0x4738('0x78'),_[_0x4738('0x2e')](_0x1e2c94,'id'));}});})[_0x4738('0x2a')](function(){if(_0x5339b3[_0x4738('0x92')]['role']===_0x4738('0x95')&&!_0x334f23&&!_0x5339b3['query'][_0x4738('0x77')])return[];return db[_0x4738('0x96')]['query'](_0x325ce8[_0x4738('0x97')](),_0x26911b);})[_0x4738('0x2a')](function(_0x5053fb){_0x277212[_0x4738('0x25')]=_0x5053fb[_0x4738('0x43')];if(_0x277212[_0x4738('0x25')]===0x0)return[];return db[_0x4738('0x96')]['query'](_0x427ad2['toString'](),_0x26911b)[_0x4738('0x2a')](function(_0x276aef){_0x2b5c9e=_['keyBy'](_0x276aef,'id');_0x26911b=_[_0x4738('0x98')](_0x26911b,{'model':db[_0x4738('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5339b3[_0x4738('0x3d')][_0x4738('0x41')]){_0x1cf17f[_0x4738('0x42')][_0x4738('0x31')](function(_0x3d5ad8){_0x5b2f20['field']('i.'+_0x3d5ad8);});}else{_0x5b2f20[_0x4738('0x49')](_0x4738('0x99'),'unreadMessages');_0x5b2f20[_0x4738('0x49')](_0x4738('0x9a'),_0x4738('0x9b'));_0x5b2f20[_0x4738('0x49')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5b2f20[_0x4738('0x49')](_0x4738('0x9c'),'contactName');_0x5b2f20[_0x4738('0x49')](_0x4738('0x8c'));_0x5b2f20[_0x4738('0x49')]('i.createdAt');_0x5b2f20[_0x4738('0x49')](_0x4738('0x9d'));_0x5b2f20[_0x4738('0x49')](_0x4738('0x9e'));_0x5b2f20[_0x4738('0x49')](_0x4738('0x9f'));_0x5b2f20['field'](_0x4738('0xa0'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa1'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa2'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa3'));_0x5b2f20['field']('i.disposition');_0x5b2f20[_0x4738('0x49')](_0x4738('0xa4'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa5'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa6'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa7'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xa8'));_0x5b2f20['field'](_0x4738('0xa9'));_0x5b2f20['field'](_0x4738('0xaa'));_0x5b2f20['field'](_0x4738('0xab'),_0x4738('0xac'));_0x5b2f20['field'](_0x4738('0xad'),_0x4738('0xae'));_0x5b2f20['field'](_0x4738('0xaf'),_0x4738('0xb0'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xb1'),_0x4738('0xb2'));_0x5b2f20['field'](_0x4738('0xb3'),_0x4738('0xb4'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xb5'),'Contact.fax');_0x5b2f20[_0x4738('0x49')](_0x4738('0xb6'),'Owner.fullname');_0x5b2f20[_0x4738('0x49')]('o.internal',_0x4738('0xb7'));_0x5b2f20[_0x4738('0x49')](_0x4738('0xb8'),'TagIds');}if(_0x1cf17f['limit'])_0x5b2f20['limit'](_0x1cf17f[_0x4738('0x26')]);if(_0x1cf17f['offset'])_0x5b2f20['offset'](_0x1cf17f[_0x4738('0x24')]);return db['sequelize']['query'](_0x5b2f20[_0x4738('0x97')](),_0x26911b);})[_0x4738('0x2a')](function(_0xb5b789){if(_0xb5b789['length']>0x0)_0x4dc436[_0x4738('0x47')](_0x4738('0xb9'),_[_0x4738('0x2e')](_0xb5b789,'id'));return db[_0x4738('0x96')][_0x4738('0x3d')](_0x4dc436['toString'](),_0x26911b)[_0x4738('0x2a')](function(_0x48e12c){var _0xc288c3=_[_0x4738('0xba')](_0x48e12c,_0x4738('0xbb'));var _0x531371=[];return db['Setting'][_0x4738('0x35')]({'attributes':[_0x4738('0xbc')],'raw':!![]})['then'](function(_0x5a3ae0){var _0x1920ea=_0x5a3ae0[_0x4738('0xbc')];_0xb5b789[_0x4738('0x31')](function(_0x180940){_0x531371['push'](updateMailInteraction(_0x180940,_0x2b5c9e,_0xc288c3,_0x1920ea));});return BPromise['all'](_0x531371);});});});})[_0x4738('0x2a')](function(_0x3a82d9){_0x277212[_0x4738('0xbd')]=_0x3a82d9;return _0x277212;})['then'](respondWithFilteredResult(_0x14cac2,_0x1cf17f))[_0x4738('0xbe')](handleError(_0x14cac2,null));};exports['show']=function(_0x1b81f2,_0x540239){var _0x5af5d4={'raw':![],'where':{'id':_0x1b81f2[_0x4738('0xbf')]['id']}},_0x23baed={};_0x23baed[_0x4738('0x3c')]=_[_0x4738('0x3e')](db[_0x4738('0x3a')][_0x4738('0xc0')]);_0x23baed[_0x4738('0x3d')]=_[_0x4738('0x3e')](_0x1b81f2[_0x4738('0x3d')]);_0x23baed[_0x4738('0x3f')]=_['intersection'](_0x23baed[_0x4738('0x3c')],_0x23baed[_0x4738('0x3d')]);_0x5af5d4[_0x4738('0x42')]=_[_0x4738('0x40')](_0x23baed[_0x4738('0x3c')],qs[_0x4738('0x41')](_0x1b81f2[_0x4738('0x3d')][_0x4738('0x41')]));_0x5af5d4['attributes']=_0x5af5d4[_0x4738('0x42')][_0x4738('0x43')]?_0x5af5d4[_0x4738('0x42')]:_0x23baed[_0x4738('0x3c')];if(_0x1b81f2[_0x4738('0x3d')][_0x4738('0xc1')]){_0x5af5d4[_0x4738('0xc2')]=[{'all':!![]}];}_0x5af5d4=_[_0x4738('0x98')]({},_0x5af5d4,_0x1b81f2[_0x4738('0xc3')]);return db['MailInteraction']['find'](_0x5af5d4)['then'](handleEntityNotFound(_0x540239,null))[_0x4738('0x2a')](respondWithResult(_0x540239,null))[_0x4738('0xbe')](handleError(_0x540239,null));};exports['create']=function(_0x30f81a,_0x4d5ac4){return db[_0x4738('0x3a')][_0x4738('0xc4')](_0x30f81a[_0x4738('0xc5')],{})[_0x4738('0x2a')](respondWithResult(_0x4d5ac4,0xc9))['catch'](handleError(_0x4d5ac4,null));};exports[_0x4738('0xc6')]=function(_0x2f1ba0,_0x1141d9){if(_0x2f1ba0[_0x4738('0xc5')]['id']){delete _0x2f1ba0[_0x4738('0xc5')]['id'];}return db['MailInteraction'][_0x4738('0x5f')]({'where':{'id':_0x2f1ba0[_0x4738('0xbf')]['id']}})[_0x4738('0x2a')](handleEntityNotFound(_0x1141d9,null))['then'](saveUpdates(_0x2f1ba0['body'],null))[_0x4738('0x2a')](respondWithResult(_0x1141d9,null))['catch'](handleError(_0x1141d9,null));};exports['destroy']=function(_0x1bcf79,_0x200dde){return db[_0x4738('0x3a')]['find']({'where':{'id':_0x1bcf79[_0x4738('0xbf')]['id']}})['then'](handleEntityNotFound(_0x200dde,null))[_0x4738('0x2a')](removeEntity(_0x200dde,null))[_0x4738('0xbe')](handleError(_0x200dde,null));};exports[_0x4738('0xc7')]=function(_0x528ba2,_0xaa3b87){return db[_0x4738('0x3a')][_0x4738('0xc7')]()[_0x4738('0x2a')](respondWithResult(_0xaa3b87,null))[_0x4738('0xbe')](handleError(_0xaa3b87,null));};exports[_0x4738('0xc8')]=function(_0xb4637c,_0x37b8ca,_0x5c45d9){return db[_0x4738('0x34')]['find']({'where':{'id':_0xb4637c[_0x4738('0xbf')]['id']}})['then'](handleEntityNotFound(_0x37b8ca,null))[_0x4738('0x2a')](function(_0x220519){if(_0x220519){return _0x220519[_0x4738('0xc8')](_0xb4637c[_0x4738('0xc5')]['ids'],_[_0x4738('0xc9')](_0xb4637c['body'],[_0x4738('0xca'),'id'])||{});}})['then'](respondWithResult(_0x37b8ca,null))['catch'](handleError(_0x37b8ca,null));};exports['getMessages']=function(_0x34c559,_0x220e26,_0x303e78){var _0x39caff={'raw':![],'where':{}};var _0x1c4419={};var _0xc8423a={'count':0x0,'rows':[]};return db['MailInteraction'][_0x4738('0x35')]({'where':{'id':_0x34c559[_0x4738('0xbf')]['id']}})[_0x4738('0x2a')](handleEntityNotFound(_0x220e26,null))['then'](function(_0x497324){if(_0x497324){_0x1c4419[_0x4738('0x3c')]=_[_0x4738('0x3e')](db[_0x4738('0x34')][_0x4738('0xc0')]);_0x1c4419[_0x4738('0x3d')]=_['keys'](_0x34c559[_0x4738('0x3d')]);_0x1c4419['filters']=_[_0x4738('0x40')](_0x1c4419[_0x4738('0x3c')],_0x1c4419['query']);_0x39caff[_0x4738('0x42')]=_[_0x4738('0x40')](_0x1c4419['model'],qs[_0x4738('0x41')](_0x34c559[_0x4738('0x3d')][_0x4738('0x41')]));_0x39caff['attributes']=_0x39caff[_0x4738('0x42')][_0x4738('0x43')]?_0x39caff[_0x4738('0x42')]:_0x1c4419[_0x4738('0x3c')];if(!_0x34c559['query'][_0x4738('0xcb')](_0x4738('0x44'))){_0x39caff[_0x4738('0x26')]=qs['limit'](_0x34c559['query']['limit']);_0x39caff[_0x4738('0x24')]=qs[_0x4738('0x24')](_0x34c559[_0x4738('0x3d')][_0x4738('0x24')]);}_0x39caff['order']=qs[_0x4738('0x46')](_0x34c559[_0x4738('0x3d')][_0x4738('0x46')]);_0x39caff[_0x4738('0x47')]=qs[_0x4738('0x3f')](_[_0x4738('0xcc')](_0x34c559[_0x4738('0x3d')],_0x1c4419[_0x4738('0x3f')]));_0x39caff['where'][_0x4738('0xbb')]=_0x497324['id'];if(_0x34c559['query'][_0x4738('0x86')]){_0x39caff[_0x4738('0x47')]=_[_0x4738('0x98')](_0x39caff['where'],{'$or':_[_0x4738('0x2e')](_0x39caff[_0x4738('0x42')],function(_0x5103c4){var _0x462711={};_0x462711[_0x5103c4]={'$like':'%'+_0x34c559[_0x4738('0x3d')]['filter']+'%'};return _0x462711;})});}if(_0x34c559['query']['$gte']){var _0x42c300=_0x34c559[_0x4738('0x3d')][_0x4738('0x7b')]['split'](',');var _0xc087fd={};_0xc087fd[_0x42c300[0x0]]={'$gte':moment(_0x42c300[0x1])[_0x4738('0xcd')](_0x4738('0xce'))};_0x39caff[_0x4738('0x47')]=_[_0x4738('0x98')](_0x39caff[_0x4738('0x47')],_0xc087fd);}_0x39caff=_[_0x4738('0x98')]({},_0x39caff,_0x34c559['options']);return db[_0x4738('0x34')][_0x4738('0x25')]({'where':_0x39caff[_0x4738('0x47')]})['then'](function(_0x5742ca){_0xc8423a['count']=_0x5742ca;if(_0x34c559[_0x4738('0x3d')]['includeAll']){_0x39caff[_0x4738('0xc2')]=[{'all':!![]}];}return db['MailMessage'][_0x4738('0xcf')](_0x39caff);})[_0x4738('0x2a')](function(_0x5cece0){if(_0x34c559[_0x4738('0x3d')]['inlineCss']==='true'){for(var _0x43f547=0x0;_0x43f547<_0x5cece0['length'];_0x43f547++){_0x5cece0[_0x43f547]['body']=juice(_0x5cece0[_0x43f547]['body']);}}_0xc8423a[_0x4738('0xbd')]=_0x5cece0;return _0xc8423a;});}})[_0x4738('0x2a')](respondWithFilteredResult(_0x220e26,_0x39caff))[_0x4738('0xbe')](handleError(_0x220e26,null));};exports[_0x4738('0xd0')]=function(_0x34c65d,_0x254576,_0x3b1d79){return db[_0x4738('0x3a')][_0x4738('0x5f')]({'where':{'id':_0x34c65d[_0x4738('0xbf')]['id']}})[_0x4738('0x2a')](handleEntityNotFound(_0x254576,null))['then'](function(_0x32e535){if(_0x32e535){return _0x32e535[_0x4738('0xd1')](_0x34c65d[_0x4738('0xc5')][_0x4738('0xca')],_['omit'](_0x34c65d['body'],['ids','id'])||{})[_0x4738('0xd2')](function(){return db['Tag'][_0x4738('0xcf')]({'attributes':['id',_0x4738('0x2c'),'color'],'where':{'id':_0x34c65d[_0x4738('0xc5')]['ids']}});})[_0x4738('0x2a')](function(_0x50a83d){socket[_0x4738('0xd3')](_0x4738('0xd4'),{'id':Number(_0x34c65d[_0x4738('0xbf')]['id']),'tags':_0x50a83d||[]});return{'id':Number(_0x34c65d['params']['id']),'tags':_0x50a83d||[]};});}})[_0x4738('0x2a')](respondWithResult(_0x254576,null))[_0x4738('0xbe')](handleError(_0x254576,null));};exports[_0x4738('0xd5')]=function(_0x58dac7,_0x18e773,_0x21bbaa){return db[_0x4738('0x3a')][_0x4738('0x5f')]({'where':{'id':_0x58dac7[_0x4738('0xbf')]['id']}})['then'](handleEntityNotFound(_0x18e773,null))[_0x4738('0x2a')](function(_0x33e35e){if(_0x33e35e){return _0x33e35e[_0x4738('0xd5')](_0x58dac7[_0x4738('0x3d')][_0x4738('0xca')]);}})[_0x4738('0x2a')](respondWithStatusCode(_0x18e773,null))[_0x4738('0xbe')](handleError(_0x18e773,null));};exports[_0x4738('0xd6')]=function(_0xca1113,_0x50676c){var _0x114a1c=moment()['unix']()['toString']();var _0x47287f=path[_0x4738('0xd7')](config[_0x4738('0xd8')],_0x4738('0xd9'),_0x4738('0xda'),'tmp');var _0x3e87b2=path[_0x4738('0xd7')](config['root'],_0x4738('0xd9'),_0x4738('0xda'),'attachments');var _0x99294f=path[_0x4738('0xd7')](_0x47287f,_0x114a1c);var _0x50cdca=util['format'](_0x4738('0xdb'),_0xca1113[_0x4738('0xbf')]['id'],_0x114a1c);var _0x36e548=path[_0x4738('0xd7')](_0x47287f,_0x50cdca);var _0xd59051=[];if(_0xca1113['query'][_0x4738('0xdc')]){_0xd59051['push']({'model':db['Attachment'],'as':_0x4738('0xdd'),'raw':!![]});}var _0xf9035f=[{'model':db[_0x4738('0x34')],'as':'Messages','attributes':['id',_0x4738('0xc5'),_0x4738('0x4a'),'to','cc','bcc',_0x4738('0xde'),_0x4738('0x7a')],'where':{'secret':![]},'order':qs[_0x4738('0x46')]('id'),'include':_0xd59051}];return db[_0x4738('0x3a')]['find']({'where':{'id':_0xca1113[_0x4738('0xbf')]['id']},'include':_0xf9035f})[_0x4738('0x2a')](handleEntityNotFound(_0x50676c,null))[_0x4738('0x2a')](function(_0x46d648){if(_0x46d648&&_0x46d648[_0x4738('0xdf')]){var _0x5d681a=_0x46d648[_0x4738('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x99294f);return BPromise[_0x4738('0xe1')](_0x5d681a[_0x4738('0xdf')],function(_0x1905bb,_0x287628){var _0x5e1f9f={'from':_0x1905bb[_0x4738('0x4a')],'to':_0x1905bb['to'],'subject':_0x1905bb[_0x4738('0xde')],'html':_0x1905bb[_0x4738('0xc5')],'headers':{'Date':moment(_0x1905bb[_0x4738('0x7a')])[_0x4738('0xcd')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1905bb['cc']){_0x5e1f9f[_0x4738('0xe2')]['Cc']=_0x1905bb['cc'];}if(_0x1905bb[_0x4738('0xe3')]){_0x5e1f9f[_0x4738('0xe2')][_0x4738('0xe4')]=_0x1905bb[_0x4738('0xe3')];}return new BPromise(function(_0x22d168,_0x17e35a){if(_0x1905bb[_0x4738('0xdd')]){for(var _0x477dd5=0x0;_0x477dd5<_0x1905bb['Attachments'][_0x4738('0x43')];_0x477dd5++){var _0x55cbad=_0x1905bb[_0x4738('0xdd')][_0x477dd5];var _0x47b2e7=path[_0x4738('0xd7')](_0x3e87b2,_0x55cbad[_0x4738('0xe5')]);if(fs[_0x4738('0xe6')](_0x47b2e7)){_0x5e1f9f['attachments']['push']({'name':_0x55cbad[_0x4738('0x2c')],'contentType':_0x55cbad['type'],'data':fs[_0x4738('0xe7')](_0x47b2e7)});}}}emlformat[_0x4738('0xe8')](_0x5e1f9f,function(_0x44bcaf,_0x323692){if(_0x44bcaf)return _0x17e35a(_0x44bcaf);fs[_0x4738('0xe9')](path['join'](_0x99294f,util['format'](_0x4738('0xea'),_0x287628)),_0x323692);return _0x22d168(_0x323692);});});})[_0x4738('0x2a')](function(){return new BPromise(function(_0x20d426,_0x2bee96){zipdir(_0x99294f,{'saveTo':_0x36e548},function(_0x7de4b0,_0x601430){if(_0x7de4b0)return _0x2bee96(_0x7de4b0);return _0x20d426(_0x601430);});})[_0x4738('0x2a')](function(){return new BPromise(function(_0x3f5d00,_0x41af1c){rimraf(_0x99294f,function(_0x1b0bae){if(_0x1b0bae)_0x41af1c(_0x1b0bae);return _0x3f5d00();});});})[_0x4738('0x2a')](function(){return _0x50676c[_0x4738('0xd6')](_0x36e548,_0x50cdca,function(_0x1dcf4d){if(_0x1dcf4d){console['log'](_0x4738('0xeb'),_0x1dcf4d);}else{fs[_0x4738('0xec')](_0x36e548);}});});});}else{return _0x50676c[_0x4738('0xed')](0xc8);}})[_0x4738('0xbe')](handleError(_0x50676c,null));}; \ No newline at end of file +var _0x3f38=['querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','./mailInteraction.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','map','fullname','Tags','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','lastMsgText','catch','index','MailInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','union','User','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','clone','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','MailAccountId','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','intersection','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','format','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','message%d.eml','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x3f38,0x1e4));var _0x83f3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3f38[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x83f3('0x0'));var rimraf=require(_0x83f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x83f3('0x2'));var rp=require(_0x83f3('0x3'));var moment=require(_0x83f3('0x4'));var BPromise=require(_0x83f3('0x5'));var Mustache=require(_0x83f3('0x6'));var util=require(_0x83f3('0x7'));var path=require(_0x83f3('0x8'));var sox=require(_0x83f3('0x9'));var csv=require(_0x83f3('0xa'));var ejs=require(_0x83f3('0xb'));var fs=require('fs');var fs_extra=require(_0x83f3('0xc'));var _=require(_0x83f3('0xd'));var squel=require(_0x83f3('0xe'));var crypto=require(_0x83f3('0xf'));var jsforce=require(_0x83f3('0x10'));var deskjs=require(_0x83f3('0x11'));var toCsv=require(_0x83f3('0xa'));var querystring=require(_0x83f3('0x12'));var Papa=require(_0x83f3('0x13'));var htmlToText=require(_0x83f3('0x14'));var juice=require(_0x83f3('0x15'));var Redis=require(_0x83f3('0x16'));var authService=require(_0x83f3('0x17'));var qs=require(_0x83f3('0x18'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x83f3('0x19'));var logger=require(_0x83f3('0x1a'))(_0x83f3('0x1b'));var utils=require(_0x83f3('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0x83f3('0x1d'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x83f3('0x1e')](config[_0x83f3('0x1f')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x83f3('0x1f')]));require(_0x83f3('0x20'))[_0x83f3('0x21')](socket);function respondWithStatusCode(_0x96c064,_0x4fb5b1){_0x4fb5b1=_0x4fb5b1||0xcc;return function(_0x43ded5){if(_0x43ded5){return _0x96c064[_0x83f3('0x22')](_0x4fb5b1);}return _0x96c064['status'](_0x4fb5b1)[_0x83f3('0x23')]();};}function respondWithResult(_0x406d58,_0x26826d){_0x26826d=_0x26826d||0xc8;return function(_0x49bfe6){if(_0x49bfe6){return _0x406d58[_0x83f3('0x24')](_0x26826d)[_0x83f3('0x25')](_0x49bfe6);}};}function respondWithFilteredResult(_0x3e3cb6,_0x74237b){return function(_0x59463a){if(_0x59463a){var _0x530f56=typeof _0x74237b[_0x83f3('0x26')]==='undefined'&&typeof _0x74237b[_0x83f3('0x27')]==='undefined';var _0x55de5d=_0x59463a['count'];var _0x9eb833=_0x530f56?0x0:_0x74237b[_0x83f3('0x26')];var _0x3d31b9=_0x530f56?_0x59463a[_0x83f3('0x28')]:_0x74237b[_0x83f3('0x26')]+_0x74237b[_0x83f3('0x27')];var _0x525f72;if(_0x3d31b9>=_0x55de5d){_0x3d31b9=_0x55de5d;_0x525f72=0xc8;}else{_0x525f72=0xce;}_0x3e3cb6['status'](_0x525f72);return _0x3e3cb6[_0x83f3('0x29')](_0x83f3('0x2a'),_0x9eb833+'-'+_0x3d31b9+'/'+_0x55de5d)[_0x83f3('0x25')](_0x59463a);}return null;};}function patchUpdates(_0x34e350){return function(_0x2cd63c){try{jsonpatch[_0x83f3('0x2b')](_0x2cd63c,_0x34e350,!![]);}catch(_0x37014d){return BPromise[_0x83f3('0x2c')](_0x37014d);}return _0x2cd63c[_0x83f3('0x2d')]();};}function saveUpdates(_0x1840be,_0x479452){return function(_0x258f3d){if(_0x258f3d){return _0x258f3d[_0x83f3('0x2e')](_0x1840be)[_0x83f3('0x2f')](function(_0x5c3510){return _0x5c3510;});}return null;};}function removeEntity(_0x27c9ed,_0x454f82){return function(_0x17b4d3){if(_0x17b4d3){return _0x17b4d3[_0x83f3('0x30')]()[_0x83f3('0x2f')](function(){_0x27c9ed[_0x83f3('0x24')](0xcc)[_0x83f3('0x23')]();});}};}function handleEntityNotFound(_0x425c4e,_0x3aa1d){return function(_0x1a1068){if(!_0x1a1068){_0x425c4e['sendStatus'](0x194);}return _0x1a1068;};}function handleError(_0x143e2c,_0x17741f){_0x17741f=_0x17741f||0x1f4;return function(_0x15b474){logger[_0x83f3('0x31')](_0x15b474[_0x83f3('0x32')]);if(_0x15b474[_0x83f3('0x33')]){delete _0x15b474[_0x83f3('0x33')];}_0x143e2c[_0x83f3('0x24')](_0x17741f)['send'](_0x15b474);};}function getInteractionUsers(_0x358741,_0x3da87b){return new BPromise(function(_0x1c11b9,_0xf0026b){try{if(_0x3da87b[_0x358741['id']]){_0x358741[_0x83f3('0x34')]=_[_0x83f3('0x35')](_0x3da87b[_0x358741['id']],function(_0x57def5){return{'id':_0x57def5['id'],'fullname':_0x57def5[_0x83f3('0x36')]};});}}catch(_0x455a0f){_0xf0026b(_0x455a0f);}_0x1c11b9(_0x358741);});}function getInteractionTags(_0x220fab,_0x907c52){return new BPromise(function(_0x2899bb,_0x486aef){try{if(_0x220fab['TagIds']){_0x220fab[_0x83f3('0x37')]=[];_0x220fab[_0x83f3('0x38')][_0x83f3('0x39')](',')[_0x83f3('0x3a')](function(_0x5a118e){_0x220fab[_0x83f3('0x37')][_0x83f3('0x3b')](_0x907c52[_0x5a118e]);});}delete _0x220fab[_0x83f3('0x38')];}catch(_0x4b2fc1){_0x486aef(_0x4b2fc1);}_0x2899bb(_0x220fab);});}function getLastMessageText(_0x55586b){return new BPromise(function(_0x19988c,_0x305472){return db[_0x83f3('0x3c')][_0x83f3('0x3d')]({'where':{'$and':[{'MailInteractionId':_0x55586b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x83f3('0x3e')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x83f3('0x2f')](function(_0x3effc2){if(_0x3effc2&&_0x3effc2[_0x83f3('0x3f')]){_0x55586b[_0x83f3('0x40')]=_['trimStart'](_0x3effc2['plainBody']);}_0x19988c(_0x55586b);})[_0x83f3('0x41')](function(_0x2e1cc8){_0x305472(_0x2e1cc8);});});}function updateMailInteraction(_0x4d5458,_0x5a4402,_0x4698db,_0x37c134){return new BPromise(function(_0x52c0c6,_0x1eb00c){return getInteractionUsers(_0x4d5458,_0x4698db)['then'](function(_0x5efa61){return getInteractionTags(_0x5efa61,_0x5a4402);})[_0x83f3('0x2f')](function(_0x13f369){if(_0x37c134){_0x52c0c6(getLastMessageText(_0x13f369));}else{_0x52c0c6(_0x13f369);}})[_0x83f3('0x41')](function(_0x4ff5b0){_0x1eb00c(_0x4ff5b0);});});}exports[_0x83f3('0x42')]=function(_0x344101,_0x3e50a6){var _0x147adb={},_0x47d47a={},_0x29c2d1={'count':0x0,'rows':[]};var _0x2542cd=_[_0x83f3('0x35')](db[_0x83f3('0x43')][_0x83f3('0x44')],function(_0x2d40e1){return{'name':_0x2d40e1[_0x83f3('0x45')],'type':_0x2d40e1[_0x83f3('0x46')][_0x83f3('0x47')]};});_0x47d47a['model']=_[_0x83f3('0x35')](_0x2542cd,_0x83f3('0x33'));_0x47d47a[_0x83f3('0x48')]=_[_0x83f3('0x49')](_0x344101[_0x83f3('0x48')]);_0x47d47a[_0x83f3('0x4a')]=_['intersection'](_0x47d47a[_0x83f3('0x4b')],_0x47d47a['query']);_0x147adb['attributes']=_['intersection'](_0x47d47a[_0x83f3('0x4b')],qs[_0x83f3('0x4c')](_0x344101[_0x83f3('0x48')][_0x83f3('0x4c')]));_0x147adb[_0x83f3('0x4d')]=_0x147adb['attributes'][_0x83f3('0x4e')]?_0x147adb[_0x83f3('0x4d')]:_0x47d47a['model'];if(!_0x344101['query'][_0x83f3('0x4f')]('nolimit')){_0x147adb['limit']=qs[_0x83f3('0x27')](_0x344101['query']['limit']);_0x147adb[_0x83f3('0x26')]=qs[_0x83f3('0x26')](_0x344101['query'][_0x83f3('0x26')]);}_0x147adb[_0x83f3('0x50')]=qs[_0x83f3('0x51')](_0x344101[_0x83f3('0x48')][_0x83f3('0x51')]);_0x147adb[_0x83f3('0x52')]=qs[_0x83f3('0x4a')](_['pick'](_0x344101[_0x83f3('0x48')],_0x47d47a[_0x83f3('0x4a')]),_0x2542cd);var _0x130e09=[];var _0x18fb5c=squel[_0x83f3('0x53')]()[_0x83f3('0x54')]('id')['field'](_0x83f3('0x33'))['field'](_0x83f3('0x55'))[_0x83f3('0x56')](_0x83f3('0x57'));var _0x1abdad=squel[_0x83f3('0x53')]()['field'](_0x83f3('0x58'))['field']('u.fullname')[_0x83f3('0x54')](_0x83f3('0x59'))['from'](_0x83f3('0x5a'),'ui')[_0x83f3('0x5b')](_0x83f3('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x286eb3=squel[_0x83f3('0x53')]()[_0x83f3('0x56')](_0x83f3('0x5d'),'i')[_0x83f3('0x5b')](_0x83f3('0x5e'),'c',_0x83f3('0x5f'))[_0x83f3('0x5b')](_0x83f3('0x5c'),'o',_0x83f3('0x60'))[_0x83f3('0x5b')](_0x83f3('0x61'),'a',_0x83f3('0x62'))[_0x83f3('0x5b')](_0x83f3('0x63'),'me',_0x83f3('0x64'))[_0x83f3('0x5b')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')[_0x83f3('0x5b')](_0x83f3('0x57'),'t',_0x83f3('0x65'));var _0x4d7f89=squel[_0x83f3('0x66')]();var _0x34cfca=[];var _0x2154e2=squel[_0x83f3('0x66')]();var _0xade80e;if(_0x344101['query'][_0x83f3('0x67')]){_0xade80e=as[_0x83f3('0x68')](_0x344101[_0x83f3('0x48')][_0x83f3('0x67')]);var _0x254253=_0xade80e[_0x83f3('0x69')];for(var _0x4e5718=0x0;_0x4e5718<_0xade80e[_0x83f3('0x6a')][_0x83f3('0x4e')];_0x4e5718++){var _0x296590=_0xade80e[_0x83f3('0x6a')][_0x4e5718];var _0x4b34b6='i';var _0x5a8236=_['find'](_0x2542cd,[_0x83f3('0x33'),_0x296590[_0x83f3('0x54')]]);if(!_0x5a8236){switch(_0x296590[_0x83f3('0x54')]){case _0x83f3('0x6b'):if(_0x296590['value']==0x1){_0x286eb3[_0x83f3('0x6c')]('`'+_0x296590[_0x83f3('0x54')]+'`\x20=\x200');}else{_0x286eb3[_0x83f3('0x6c')]('`'+_0x296590['field']+_0x83f3('0x6d'));}break;case _0x83f3('0x6e'):if(_0x296590[_0x83f3('0x6f')]===_0x83f3('0x70')){if(_0x296590[_0x83f3('0x71')]['split']('\x20')['length']>0x1){_0x4d7f89[_0x254253](_0x83f3('0x72'),qs[_0x83f3('0x73')](_0x296590[_0x83f3('0x71')]),null);}else{var _0x3e43a7='%'+_0x296590[_0x83f3('0x71')]+'%';_0x4d7f89[_0x254253](_0x83f3('0x74'),_0x3e43a7,_0x3e43a7,_0x3e43a7);}}else{_0x5a8236=_[_0x83f3('0x75')](_0x2542cd,[_0x83f3('0x33'),_0x83f3('0x76')]);_0x296590[_0x83f3('0x54')]=_0x83f3('0x76');_0x410a3f=as[_0x83f3('0x77')](_0x4b34b6,_0x5a8236[_0x83f3('0x46')],_0x296590);_0x4d7f89[_0x254253](_0x410a3f[_0x83f3('0x78')],_0x410a3f[_0x83f3('0x71')]['start'],_0x410a3f[_0x83f3('0x71')]['end']);}break;case'Tag':var _0x5b37af=_0x296590[_0x83f3('0x71')]['split'](',')[_0x83f3('0x35')](function(_0x1f65d9){return Number(_0x1f65d9);});_0x5b37af[_0x83f3('0x3a')](function(_0x46f8c8){_0x2154e2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46f8c8+',%');});_0x34cfca=_[_0x83f3('0x79')](_0x34cfca,_0x5b37af);break;case _0x83f3('0x7a'):if(_0x296590[_0x83f3('0x6f')]===_0x83f3('0x70')){_0x4d7f89[_0x254253]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x296590[_0x83f3('0x71')]+'%',null);}else{_0x5a8236=_[_0x83f3('0x75')](_0x2542cd,[_0x83f3('0x33'),_0x83f3('0x7b')]);_0x296590[_0x83f3('0x54')]='UserId';_0x410a3f=as[_0x83f3('0x77')](_0x4b34b6,_0x5a8236[_0x83f3('0x46')],_0x296590);_0x4d7f89[_0x254253](_0x410a3f[_0x83f3('0x78')],_0x410a3f[_0x83f3('0x71')][_0x83f3('0x7c')],_0x410a3f[_0x83f3('0x71')][_0x83f3('0x23')]);}break;case'plainBody':_0x410a3f=as[_0x83f3('0x77')]('me',null,_0x296590);_0x4d7f89[_0x254253](_0x410a3f[_0x83f3('0x78')],_0x410a3f[_0x83f3('0x71')]['start'],_0x410a3f[_0x83f3('0x71')][_0x83f3('0x23')]);break;}}else{var _0x410a3f=as['buildExpression'](_0x4b34b6,_0x5a8236[_0x83f3('0x46')],_0x296590);_0x4d7f89[_0x254253](_0x410a3f[_0x83f3('0x78')],_0x410a3f['value'][_0x83f3('0x7c')],_0x410a3f[_0x83f3('0x71')][_0x83f3('0x23')]);}}}else{var _0x4bf84e=_(_0x344101['query'])[_0x83f3('0x49')]()['map'](function(_0x64bc7f){return _[_0x83f3('0x7d')](_0x2542cd,[_0x83f3('0x33'),_0x64bc7f])?_0x64bc7f:undefined;})[_0x83f3('0x7e')]()['value']();if(!_[_0x83f3('0x7f')](_0x4bf84e)){_0x4bf84e['forEach'](function(_0x55a81d){if(_0x55a81d==='MailAccountId'){_0x286eb3[_0x83f3('0x52')](_0x83f3('0x80'),[][_0x83f3('0x81')](_0x344101['query'][_0x55a81d]));}else if(_0x55a81d===_0x83f3('0x82')){var _0x4f0a5c=JSON['parse'](_0x344101['query'][_0x55a81d])[_0x83f3('0x83')];var _0x196652=JSON[_0x83f3('0x84')](_0x344101[_0x83f3('0x48')][_0x55a81d])[_0x83f3('0x85')];_0x286eb3[_0x83f3('0x52')](_0x83f3('0x86'),_0x4f0a5c,_0x196652);}else{if(_0x344101[_0x83f3('0x48')][_0x55a81d]===_0x83f3('0x87')){_0x286eb3[_0x83f3('0x52')]('i.'+_0x55a81d+_0x83f3('0x88'));}else{_0x286eb3[_0x83f3('0x52')]('i.'+_0x55a81d+'\x20=\x20?',_0x344101[_0x83f3('0x48')][_0x55a81d]);}}});}if(_0x344101[_0x83f3('0x48')][_0x83f3('0x89')]){if(_0x344101[_0x83f3('0x48')]['read']==0x1){_0x286eb3[_0x83f3('0x6c')](_0x83f3('0x8a'));}else{_0x286eb3[_0x83f3('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x344101['query'][_0x83f3('0x8b')]){_0x34cfca=_[_0x83f3('0x8c')](_0x344101[_0x83f3('0x48')][_0x83f3('0x8b')])?_0x344101['query'][_0x83f3('0x8b')]:new Array(_0x344101[_0x83f3('0x48')][_0x83f3('0x8b')]);_0x34cfca[_0x83f3('0x3a')](function(_0x3e808d){_0x2154e2['or'](_0x83f3('0x8d'),'%,'+_0x3e808d+',%');});}if(_0x344101[_0x83f3('0x48')][_0x83f3('0x8e')]){var _0x5c10fb=_0x344101['query'][_0x83f3('0x8e')]['replace']('\x5c','\x5c\x5c')[_0x83f3('0x8f')](/'/g,'\x27\x27');if(qs[_0x83f3('0x90')](_0x5c10fb)){_0x4d7f89['or'](_0x83f3('0x91'),_0x5c10fb+'%');}else if(qs[_0x83f3('0x92')](_0x5c10fb)){_0x4d7f89['or'](_0x83f3('0x93'),_0x5c10fb+'%');}else{_0x4d7f89['or'](_0x83f3('0x94'),qs[_0x83f3('0x73')](_0x5c10fb))['or'](_0x83f3('0x95'),qs[_0x83f3('0x73')](_0x5c10fb));}}}_0x286eb3[_0x83f3('0x52')](_0x4d7f89);_0x286eb3[_0x83f3('0x96')](_0x83f3('0x97'));var _0x44d5ef={'type':db['Sequelize'][_0x83f3('0x98')]['SELECT'],'raw':!![]};var _0x579150=_0x286eb3[_0x83f3('0x99')]();_0x579150[_0x83f3('0x54')](_0x83f3('0x97'));_0x579150[_0x83f3('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x147adb[_0x83f3('0x50')]){_0x147adb[_0x83f3('0x50')][_0x83f3('0x3a')](function(_0x25a210){var _0xf61be1=_0x25a210[0x0]==='contactName'?_0x25a210[0x0]:'i.'+_0x25a210[0x0];_0x286eb3[_0x83f3('0x50')](_0xf61be1,_0x25a210[0x1]===_0x83f3('0x9a')?![]:!![]);});}if(!_[_0x83f3('0x7f')](_0x34cfca)){_0x286eb3['having'](_0x2154e2);_0x579150[_0x83f3('0x52')](_0x83f3('0x9b'),_0x34cfca);}BPromise[_0x83f3('0x9c')]()['then'](function(){if(!_0xade80e){if(_0x344101[_0x83f3('0x48')]['MailAccountId'])return;_0x579150[_0x83f3('0x52')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x286eb3[_0x83f3('0x52')](_0x83f3('0x9d'));return;}if(_0x344101[_0x83f3('0x9e')][_0x83f3('0x9f')]!==_0x83f3('0xa0'))return;return _0x344101[_0x83f3('0x9e')][_0x83f3('0xa1')]({'attributes':['id'],'raw':!![]})[_0x83f3('0x2f')](function(_0x44c107){if(_[_0x83f3('0x7f')](_0x44c107)){_0x579150[_0x83f3('0x52')]('i.MailAccountId\x20IS\x20NULL');_0x286eb3[_0x83f3('0x52')](_0x83f3('0xa2'));}else{_0x579150['where']('i.MailAccountId\x20IN\x20?',_['map'](_0x44c107,'id'));_0x286eb3[_0x83f3('0x52')](_0x83f3('0x80'),_['map'](_0x44c107,'id'));}});})['then'](function(){if(_0x344101[_0x83f3('0x9e')]['role']===_0x83f3('0xa0')&&!_0xade80e&&!_0x344101[_0x83f3('0x48')][_0x83f3('0xa3')])return[];return db[_0x83f3('0xa4')]['query'](_0x579150[_0x83f3('0xa5')](),_0x44d5ef);})['then'](function(_0x4bda89){_0x29c2d1[_0x83f3('0x28')]=_0x4bda89[_0x83f3('0x4e')];if(_0x29c2d1[_0x83f3('0x28')]===0x0)return[];return db['sequelize'][_0x83f3('0x48')](_0x18fb5c[_0x83f3('0xa5')](),_0x44d5ef)[_0x83f3('0x2f')](function(_0x3e1a27){_0x130e09=_[_0x83f3('0xa6')](_0x3e1a27,'id');_0x44d5ef=_[_0x83f3('0xa7')](_0x44d5ef,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x344101[_0x83f3('0x48')][_0x83f3('0x4c')]){_0x147adb[_0x83f3('0x4d')][_0x83f3('0x3a')](function(_0x50b502){_0x286eb3[_0x83f3('0x54')]('i.'+_0x50b502);});}else{_0x286eb3[_0x83f3('0x54')](_0x83f3('0xa8'),'unreadMessages');_0x286eb3[_0x83f3('0x54')](_0x83f3('0xa9'),_0x83f3('0xaa'));_0x286eb3['field']('a.mandatoryDisposition',_0x83f3('0xab'));_0x286eb3[_0x83f3('0x54')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x286eb3[_0x83f3('0x54')](_0x83f3('0x97'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xac'));_0x286eb3['field'](_0x83f3('0xad'));_0x286eb3[_0x83f3('0x54')]('i.closed');_0x286eb3[_0x83f3('0x54')]('i.closedAt');_0x286eb3['field'](_0x83f3('0xae'));_0x286eb3['field']('i.lastMsgAt');_0x286eb3[_0x83f3('0x54')](_0x83f3('0xaf'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb0'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb1'));_0x286eb3['field']('i.secondDisposition');_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb2'));_0x286eb3[_0x83f3('0x54')]('i.substatus');_0x286eb3[_0x83f3('0x54')]('i.to');_0x286eb3[_0x83f3('0x54')]('i.ContactId');_0x286eb3['field'](_0x83f3('0xb3'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb4'));_0x286eb3['field'](_0x83f3('0xb5'),_0x83f3('0xb6'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb7'),'Contact.lastName');_0x286eb3[_0x83f3('0x54')](_0x83f3('0xb8'),_0x83f3('0xb9'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xba'),_0x83f3('0xbb'));_0x286eb3['field'](_0x83f3('0xbc'),_0x83f3('0xbd'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xbe'),_0x83f3('0xbf'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xc0'),_0x83f3('0xc1'));_0x286eb3[_0x83f3('0x54')](_0x83f3('0xc2'),_0x83f3('0xc3'));_0x286eb3[_0x83f3('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x83f3('0x38'));}if(_0x147adb[_0x83f3('0x27')])_0x286eb3['limit'](_0x147adb[_0x83f3('0x27')]);if(_0x147adb[_0x83f3('0x26')])_0x286eb3['offset'](_0x147adb[_0x83f3('0x26')]);return db[_0x83f3('0xa4')][_0x83f3('0x48')](_0x286eb3[_0x83f3('0xa5')](),_0x44d5ef);})[_0x83f3('0x2f')](function(_0x3f954f){if(_0x3f954f[_0x83f3('0x4e')]>0x0)_0x1abdad[_0x83f3('0x52')](_0x83f3('0xc4'),_[_0x83f3('0x35')](_0x3f954f,'id'));return db['sequelize'][_0x83f3('0x48')](_0x1abdad[_0x83f3('0xa5')](),_0x44d5ef)[_0x83f3('0x2f')](function(_0x7627c){var _0x2ff695=_[_0x83f3('0xc5')](_0x7627c,_0x83f3('0xc6'));var _0x5e3dd6=[];return db[_0x83f3('0xc7')][_0x83f3('0x3d')]({'attributes':[_0x83f3('0xc8')],'raw':!![]})[_0x83f3('0x2f')](function(_0x421c38){var _0x67959=_0x421c38[_0x83f3('0xc8')];_0x3f954f['forEach'](function(_0x5774f7){_0x5e3dd6[_0x83f3('0x3b')](updateMailInteraction(_0x5774f7,_0x130e09,_0x2ff695,_0x67959));});return BPromise[_0x83f3('0xc9')](_0x5e3dd6);});});});})[_0x83f3('0x2f')](function(_0x5a2291){_0x29c2d1[_0x83f3('0xca')]=_0x5a2291;return _0x29c2d1;})[_0x83f3('0x2f')](respondWithFilteredResult(_0x3e50a6,_0x147adb))['catch'](handleError(_0x3e50a6,null));};exports[_0x83f3('0xcb')]=function(_0x2ebcc9,_0x27a38b){var _0x4aadf8={'raw':![],'where':{'id':_0x2ebcc9[_0x83f3('0xcc')]['id']}},_0x41e16d={};_0x41e16d[_0x83f3('0x4b')]=_[_0x83f3('0x49')](db[_0x83f3('0x43')]['rawAttributes']);_0x41e16d[_0x83f3('0x48')]=_[_0x83f3('0x49')](_0x2ebcc9[_0x83f3('0x48')]);_0x41e16d[_0x83f3('0x4a')]=_[_0x83f3('0xcd')](_0x41e16d['model'],_0x41e16d['query']);_0x4aadf8[_0x83f3('0x4d')]=_[_0x83f3('0xcd')](_0x41e16d['model'],qs[_0x83f3('0x4c')](_0x2ebcc9[_0x83f3('0x48')]['fields']));_0x4aadf8[_0x83f3('0x4d')]=_0x4aadf8[_0x83f3('0x4d')]['length']?_0x4aadf8[_0x83f3('0x4d')]:_0x41e16d[_0x83f3('0x4b')];if(_0x2ebcc9[_0x83f3('0x48')][_0x83f3('0xce')]){_0x4aadf8[_0x83f3('0xcf')]=[{'all':!![]}];}_0x4aadf8=_[_0x83f3('0xa7')]({},_0x4aadf8,_0x2ebcc9[_0x83f3('0xd0')]);return db[_0x83f3('0x43')]['find'](_0x4aadf8)['then'](handleEntityNotFound(_0x27a38b,null))[_0x83f3('0x2f')](respondWithResult(_0x27a38b,null))['catch'](handleError(_0x27a38b,null));};exports[_0x83f3('0xd1')]=function(_0x4719a4,_0x204c62){return db[_0x83f3('0x43')][_0x83f3('0xd1')](_0x4719a4['body'],{})[_0x83f3('0x2f')](respondWithResult(_0x204c62,0xc9))[_0x83f3('0x41')](handleError(_0x204c62,null));};exports[_0x83f3('0x2e')]=function(_0x2992b3,_0x3fd19b){if(_0x2992b3[_0x83f3('0xd2')]['id']){delete _0x2992b3[_0x83f3('0xd2')]['id'];}return db[_0x83f3('0x43')][_0x83f3('0x75')]({'where':{'id':_0x2992b3['params']['id']}})[_0x83f3('0x2f')](handleEntityNotFound(_0x3fd19b,null))[_0x83f3('0x2f')](saveUpdates(_0x2992b3[_0x83f3('0xd2')],null))[_0x83f3('0x2f')](respondWithResult(_0x3fd19b,null))[_0x83f3('0x41')](handleError(_0x3fd19b,null));};exports[_0x83f3('0x30')]=function(_0x77e1fa,_0x1ae5c5){return db[_0x83f3('0x43')]['find']({'where':{'id':_0x77e1fa[_0x83f3('0xcc')]['id']}})[_0x83f3('0x2f')](handleEntityNotFound(_0x1ae5c5,null))[_0x83f3('0x2f')](removeEntity(_0x1ae5c5,null))[_0x83f3('0x41')](handleError(_0x1ae5c5,null));};exports['describe']=function(_0x1af364,_0xd240a7){return db[_0x83f3('0x43')][_0x83f3('0xd3')]()[_0x83f3('0x2f')](respondWithResult(_0xd240a7,null))[_0x83f3('0x41')](handleError(_0xd240a7,null));};exports[_0x83f3('0xd4')]=function(_0x1ee497,_0x38221d,_0x3f6bfa){return db['MailMessage'][_0x83f3('0x75')]({'where':{'id':_0x1ee497[_0x83f3('0xcc')]['id']}})['then'](handleEntityNotFound(_0x38221d,null))[_0x83f3('0x2f')](function(_0x57b8fb){if(_0x57b8fb){return _0x57b8fb[_0x83f3('0xd4')](_0x1ee497[_0x83f3('0xd2')][_0x83f3('0xd5')],_[_0x83f3('0xd6')](_0x1ee497[_0x83f3('0xd2')],[_0x83f3('0xd5'),'id'])||{});}})['then'](respondWithResult(_0x38221d,null))['catch'](handleError(_0x38221d,null));};exports[_0x83f3('0xd7')]=function(_0x1312b9,_0x54cc31,_0x54b3ad){var _0x39c625={'raw':![],'where':{}};var _0xcfbdb7={};var _0x3d3f36={'count':0x0,'rows':[]};return db[_0x83f3('0x43')]['findOne']({'where':{'id':_0x1312b9[_0x83f3('0xcc')]['id']}})['then'](handleEntityNotFound(_0x54cc31,null))['then'](function(_0x46493b){if(_0x46493b){_0xcfbdb7[_0x83f3('0x4b')]=_[_0x83f3('0x49')](db['MailMessage'][_0x83f3('0x44')]);_0xcfbdb7[_0x83f3('0x48')]=_['keys'](_0x1312b9[_0x83f3('0x48')]);_0xcfbdb7['filters']=_[_0x83f3('0xcd')](_0xcfbdb7[_0x83f3('0x4b')],_0xcfbdb7[_0x83f3('0x48')]);_0x39c625[_0x83f3('0x4d')]=_['intersection'](_0xcfbdb7['model'],qs[_0x83f3('0x4c')](_0x1312b9['query'][_0x83f3('0x4c')]));_0x39c625[_0x83f3('0x4d')]=_0x39c625[_0x83f3('0x4d')][_0x83f3('0x4e')]?_0x39c625[_0x83f3('0x4d')]:_0xcfbdb7[_0x83f3('0x4b')];if(!_0x1312b9[_0x83f3('0x48')][_0x83f3('0x4f')](_0x83f3('0xd8'))){_0x39c625[_0x83f3('0x27')]=qs[_0x83f3('0x27')](_0x1312b9[_0x83f3('0x48')][_0x83f3('0x27')]);_0x39c625[_0x83f3('0x26')]=qs[_0x83f3('0x26')](_0x1312b9[_0x83f3('0x48')][_0x83f3('0x26')]);}_0x39c625[_0x83f3('0x50')]=qs[_0x83f3('0x51')](_0x1312b9[_0x83f3('0x48')][_0x83f3('0x51')]);_0x39c625[_0x83f3('0x52')]=qs[_0x83f3('0x4a')](_['pick'](_0x1312b9[_0x83f3('0x48')],_0xcfbdb7[_0x83f3('0x4a')]));_0x39c625[_0x83f3('0x52')][_0x83f3('0xc6')]=_0x46493b['id'];if(_0x1312b9[_0x83f3('0x48')]['filter']){_0x39c625['where']=_[_0x83f3('0xa7')](_0x39c625[_0x83f3('0x52')],{'$or':_[_0x83f3('0x35')](_0x39c625[_0x83f3('0x4d')],function(_0x364401){var _0x4a4acb={};_0x4a4acb[_0x364401]={'$like':'%'+_0x1312b9[_0x83f3('0x48')][_0x83f3('0x8e')]+'%'};return _0x4a4acb;})});}if(_0x1312b9[_0x83f3('0x48')]['$gte']){var _0x37aa48=_0x1312b9[_0x83f3('0x48')][_0x83f3('0x83')][_0x83f3('0x39')](',');var _0x38606b={};_0x38606b[_0x37aa48[0x0]]={'$gte':moment(_0x37aa48[0x1])[_0x83f3('0xd9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x39c625['where']=_[_0x83f3('0xa7')](_0x39c625[_0x83f3('0x52')],_0x38606b);}_0x39c625=_[_0x83f3('0xa7')]({},_0x39c625,_0x1312b9['options']);return db['MailMessage'][_0x83f3('0x28')]({'where':_0x39c625['where']})[_0x83f3('0x2f')](function(_0x46f521){_0x3d3f36['count']=_0x46f521;if(_0x1312b9[_0x83f3('0x48')]['includeAll']){_0x39c625[_0x83f3('0xcf')]=[{'all':!![]}];}return db[_0x83f3('0x3c')][_0x83f3('0xda')](_0x39c625);})[_0x83f3('0x2f')](function(_0xdc5389){if(_0x1312b9[_0x83f3('0x48')][_0x83f3('0xdb')]===_0x83f3('0xdc')){for(var _0x54d434=0x0;_0x54d434<_0xdc5389['length'];_0x54d434++){_0xdc5389[_0x54d434][_0x83f3('0xd2')]=juice(_0xdc5389[_0x54d434][_0x83f3('0xd2')]);}}_0x3d3f36[_0x83f3('0xca')]=_0xdc5389;return _0x3d3f36;});}})[_0x83f3('0x2f')](respondWithFilteredResult(_0x54cc31,_0x39c625))['catch'](handleError(_0x54cc31,null));};exports[_0x83f3('0xdd')]=function(_0x1dce52,_0x22dc95,_0xe02fb3){return db[_0x83f3('0x43')]['find']({'where':{'id':_0x1dce52['params']['id']}})['then'](handleEntityNotFound(_0x22dc95,null))[_0x83f3('0x2f')](function(_0x24676c){if(_0x24676c){return _0x24676c[_0x83f3('0xde')](_0x1dce52[_0x83f3('0xd2')][_0x83f3('0xd5')],_[_0x83f3('0xd6')](_0x1dce52[_0x83f3('0xd2')],[_0x83f3('0xd5'),'id'])||{})['spread'](function(){return db[_0x83f3('0xdf')][_0x83f3('0xda')]({'attributes':['id',_0x83f3('0x33'),_0x83f3('0x55')],'where':{'id':_0x1dce52[_0x83f3('0xd2')]['ids']}});})[_0x83f3('0x2f')](function(_0x532ab8){socket['emit'](_0x83f3('0xe0'),{'id':Number(_0x1dce52[_0x83f3('0xcc')]['id']),'tags':_0x532ab8||[]});return{'id':Number(_0x1dce52[_0x83f3('0xcc')]['id']),'tags':_0x532ab8||[]};});}})['then'](respondWithResult(_0x22dc95,null))[_0x83f3('0x41')](handleError(_0x22dc95,null));};exports['removeTags']=function(_0x1901e7,_0x3f47d0,_0x4f5e80){return db[_0x83f3('0x43')][_0x83f3('0x75')]({'where':{'id':_0x1901e7[_0x83f3('0xcc')]['id']}})[_0x83f3('0x2f')](handleEntityNotFound(_0x3f47d0,null))[_0x83f3('0x2f')](function(_0x5f1445){if(_0x5f1445){return _0x5f1445[_0x83f3('0xe1')](_0x1901e7[_0x83f3('0x48')][_0x83f3('0xd5')]);}})[_0x83f3('0x2f')](respondWithStatusCode(_0x3f47d0,null))['catch'](handleError(_0x3f47d0,null));};exports[_0x83f3('0xe2')]=function(_0x3ebf9a,_0x98d738){var _0x24abfd=moment()[_0x83f3('0xe3')]()['toString']();var _0x34f2b2=path[_0x83f3('0xe4')](config[_0x83f3('0xe5')],_0x83f3('0xe6'),_0x83f3('0xe7'),_0x83f3('0xe8'));var _0x5e5b17=path[_0x83f3('0xe4')](config[_0x83f3('0xe5')],'server',_0x83f3('0xe7'),_0x83f3('0xe9'));var _0x569e1c=path[_0x83f3('0xe4')](_0x34f2b2,_0x24abfd);var _0x135838=util['format'](_0x83f3('0xea'),_0x3ebf9a['params']['id'],_0x24abfd);var _0x399ebc=path[_0x83f3('0xe4')](_0x34f2b2,_0x135838);var _0x35a19c=[];if(_0x3ebf9a[_0x83f3('0x48')][_0x83f3('0xe9')]){_0x35a19c[_0x83f3('0x3b')]({'model':db[_0x83f3('0xeb')],'as':_0x83f3('0xec'),'raw':!![]});}var _0x5b3b0f=[{'model':db[_0x83f3('0x3c')],'as':_0x83f3('0xed'),'attributes':['id',_0x83f3('0xd2'),'from','to','cc',_0x83f3('0xee'),_0x83f3('0xef'),_0x83f3('0x82')],'where':{'secret':![]},'order':qs[_0x83f3('0x51')]('id'),'include':_0x35a19c}];return db['MailInteraction'][_0x83f3('0x75')]({'where':{'id':_0x3ebf9a[_0x83f3('0xcc')]['id']},'include':_0x5b3b0f})[_0x83f3('0x2f')](handleEntityNotFound(_0x98d738,null))[_0x83f3('0x2f')](function(_0x2bee20){if(_0x2bee20&&_0x2bee20['Messages']){var _0x9ba048=_0x2bee20[_0x83f3('0xf0')]({'plain':!![]});fs[_0x83f3('0xf1')](_0x569e1c);return BPromise[_0x83f3('0xf2')](_0x9ba048[_0x83f3('0xed')],function(_0xc6f8ab,_0xc61438){var _0x2b304b={'from':_0xc6f8ab['from'],'to':_0xc6f8ab['to'],'subject':_0xc6f8ab[_0x83f3('0xef')],'html':_0xc6f8ab[_0x83f3('0xd2')],'headers':{'Date':moment(_0xc6f8ab[_0x83f3('0x82')])['format'](_0x83f3('0xf3'))},'attachments':[]};if(_0xc6f8ab['cc']){_0x2b304b[_0x83f3('0xf4')]['Cc']=_0xc6f8ab['cc'];}if(_0xc6f8ab[_0x83f3('0xee')]){_0x2b304b[_0x83f3('0xf4')][_0x83f3('0xf5')]=_0xc6f8ab['bcc'];}return new BPromise(function(_0x113642,_0x37801d){if(_0xc6f8ab[_0x83f3('0xec')]){for(var _0x2f5ced=0x0;_0x2f5ced<_0xc6f8ab[_0x83f3('0xec')][_0x83f3('0x4e')];_0x2f5ced++){var _0x40ac10=_0xc6f8ab[_0x83f3('0xec')][_0x2f5ced];var _0x40ef39=path[_0x83f3('0xe4')](_0x5e5b17,_0x40ac10[_0x83f3('0xf6')]);if(fs['existsSync'](_0x40ef39)){_0x2b304b[_0x83f3('0xe9')][_0x83f3('0x3b')]({'name':_0x40ac10[_0x83f3('0x33')],'contentType':_0x40ac10[_0x83f3('0x46')],'data':fs[_0x83f3('0xf7')](_0x40ef39)});}}}emlformat[_0x83f3('0xf8')](_0x2b304b,function(_0x16e078,_0x34a29f){if(_0x16e078)return _0x37801d(_0x16e078);fs['writeFileSync'](path[_0x83f3('0xe4')](_0x569e1c,util[_0x83f3('0xd9')](_0x83f3('0xf9'),_0xc61438)),_0x34a29f);return _0x113642(_0x34a29f);});});})[_0x83f3('0x2f')](function(){return new BPromise(function(_0x5f546f,_0x733c97){zipdir(_0x569e1c,{'saveTo':_0x399ebc},function(_0x1d8a43,_0x4cbcbc){if(_0x1d8a43)return _0x733c97(_0x1d8a43);return _0x5f546f(_0x4cbcbc);});})[_0x83f3('0x2f')](function(){return new BPromise(function(_0x2c1b16,_0x5044f3){rimraf(_0x569e1c,function(_0x1bdccb){if(_0x1bdccb)_0x5044f3(_0x1bdccb);return _0x2c1b16();});});})[_0x83f3('0x2f')](function(){return _0x98d738[_0x83f3('0xe2')](_0x399ebc,_0x135838,function(_0x2e1899){if(_0x2e1899){console['log'](_0x83f3('0xfa'),_0x2e1899);}else{fs['unlinkSync'](_0x399ebc);}});});});}else{return _0x98d738[_0x83f3('0x22')](0xc8);}})[_0x83f3('0x41')](handleError(_0x98d738,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a54bf73..239c2d9 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 _0xfe7e=['hook','exports','../../mysqldb','MailInteraction','setMaxListeners','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0xfe7e,0x1e2));var _0xefe7=function(_0x5b3721,_0x69e4cc){_0x5b3721=_0x5b3721-0x0;var _0x2a6e0d=_0xfe7e[_0x5b3721];return _0x2a6e0d;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xefe7('0x0'))['db'][_0xefe7('0x1')];var MailMessage=require(_0xefe7('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xefe7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xefe7('0x3'),'afterDestroy':_0xefe7('0x4')};function emitEvent(_0x1b93b1){return function(_0xf164d,_0xcf7876,_0x3022d0){_0xf164d['getUsers']({'attributes':['id'],'raw':!![]})[_0xefe7('0x5')](function(_0x279ecc){_0xf164d['setDataValue'](_0xefe7('0x6'),_0x279ecc[_0xefe7('0x7')](function(_0x26ae87){return{'id':_0x26ae87['id']};}));return MailMessage[_0xefe7('0x8')]({'where':{'MailInteractionId':_0xf164d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xefe7('0x5')](function(_0x373970){_0xf164d[_0xefe7('0x9')](_0xefe7('0xa'),_0x373970['length']);MailInteractionEvents[_0xefe7('0xb')](_0x1b93b1+':'+_0xf164d['id'],_0xf164d);MailInteractionEvents[_0xefe7('0xb')](_0x1b93b1,_0xf164d);_0x3022d0(null);})[_0xefe7('0xc')](_0x3022d0(null));};}for(var e in events){if(events[_0xefe7('0xd')](e)){var event=events[e];MailInteraction[_0xefe7('0xe')](e,emitEvent(event));}}module[_0xefe7('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xda42=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','Users','findAll'];(function(_0x5c13cc,_0x4520bd){var _0x46993d=function(_0x2e2395){while(--_0x2e2395){_0x5c13cc['push'](_0x5c13cc['shift']());}};_0x46993d(++_0x4520bd);}(_0xda42,0x16d));var _0x2da4=function(_0x141651,_0x54c998){_0x141651=_0x141651-0x0;var _0x49a49f=_0xda42[_0x141651];return _0x49a49f;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x2da4('0x0')];var MailMessage=require(_0x2da4('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2da4('0x2')](0x0);var events={'afterCreate':_0x2da4('0x3'),'afterUpdate':_0x2da4('0x4'),'afterDestroy':_0x2da4('0x5')};function emitEvent(_0x349aa5){return function(_0x34b0a5,_0x179e7d,_0x1f2e6c){_0x34b0a5[_0x2da4('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d525c){_0x34b0a5['setDataValue'](_0x2da4('0x7'),_0x1d525c['map'](function(_0x16cccb){return{'id':_0x16cccb['id']};}));return MailMessage[_0x2da4('0x8')]({'where':{'MailInteractionId':_0x34b0a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2da4('0x9')](function(_0x2ae610){_0x34b0a5['setDataValue'](_0x2da4('0xa'),_0x2ae610[_0x2da4('0xb')]);MailInteractionEvents[_0x2da4('0xc')](_0x349aa5+':'+_0x34b0a5['id'],_0x34b0a5);MailInteractionEvents[_0x2da4('0xc')](_0x349aa5,_0x34b0a5);_0x1f2e6c(null);})[_0x2da4('0xd')](_0x1f2e6c(null));};}for(var e in events){if(events[_0x2da4('0xe')](e)){var event=events[e];MailInteraction[_0x2da4('0xf')](e,emitEvent(event));}}module[_0x2da4('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 43ee4e1..db72854 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 _0x9307=['format','closed','closedAt','changed','substatus','YYYY-MM-DD\x20HH:mm:ss','models','get','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt'];(function(_0xf4b774,_0x440c97){var _0x3d9031=function(_0x422077){while(--_0x422077){_0xf4b774['push'](_0xf4b774['shift']());}};_0x3d9031(++_0x440c97);}(_0x9307,0xcf));var _0x7930=function(_0x4cfd6e,_0x2a73d4){_0x4cfd6e=_0x4cfd6e-0x0;var _0x3a7a2e=_0x9307[_0x4cfd6e];return _0x3a7a2e;};'use strict';var _=require(_0x7930('0x0'));var util=require(_0x7930('0x1'));var logger=require(_0x7930('0x2'))(_0x7930('0x3'));var moment=require('moment');var BPromise=require(_0x7930('0x4'));var rp=require(_0x7930('0x5'));var fs=require('fs');var path=require(_0x7930('0x6'));var rimraf=require(_0x7930('0x7'));var config=require(_0x7930('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x7930('0x9')]=function(_0x5a0639,_0x9fac86){return _0x5a0639[_0x7930('0xa')](_0x7930('0xb'),attributes,{'tableName':_0x7930('0xc'),'paranoid':![],'indexes':[{'name':_0x7930('0xd'),'fields':[_0x7930('0xe'),'to'],'type':_0x7930('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1ac5f4,_0x22d574,_0x17445f){if(_0x1ac5f4['substatus']){_0x1ac5f4[_0x7930('0x10')]=moment()[_0x7930('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1ac5f4[_0x7930('0x12')]){_0x1ac5f4[_0x7930('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x17445f(null,_0x22d574);},'beforeUpdate':function(_0x357235,_0x1c5640,_0x2ae009){if(_0x357235[_0x7930('0x14')](_0x7930('0x15'))){_0x357235['substatusAt']=_0x357235[_0x7930('0x15')]?moment()['format'](_0x7930('0x16')):null;}if(_0x357235[_0x7930('0x14')](_0x7930('0x12'))){_0x357235[_0x7930('0x13')]=moment()[_0x7930('0x11')](_0x7930('0x16'));_0x357235[_0x7930('0x15')]=null;_0x357235['substatusAt']=null;}_0x2ae009(null,_0x357235);},'afterUpdate':function(_0x4b58a2,_0x3d9a9f,_0x2c81a8){var _0x2bebfc=_0x5a0639[_0x7930('0x17')];var _0xfc8595=_0x4b58a2[_0x7930('0x18')]({'plain':!![]});if(_0xfc8595[_0x7930('0x12')]){return _0x2bebfc['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0xfc8595['id']}})['then'](function(){_0x2c81a8();})[_0x7930('0x19')](function(_0x3ddd04){_0x2c81a8(_0x3ddd04);});}else{_0x2c81a8();}}},'charset':_0x7930('0x1a'),'collate':_0x7930('0x1b')});}; \ No newline at end of file +var _0x9240=['exports','MailInteraction','mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','then','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x9240,0x1ba));var _0x0924=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x9240[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x0924('0x0'));var util=require('util');var logger=require(_0x0924('0x1'))(_0x0924('0x2'));var moment=require(_0x0924('0x3'));var BPromise=require(_0x0924('0x4'));var rp=require(_0x0924('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0924('0x6'));var attributes=require(_0x0924('0x7'));module[_0x0924('0x8')]=function(_0x4652a3,_0x1cd06a){return _0x4652a3['define'](_0x0924('0x9'),attributes,{'tableName':_0x0924('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x0924('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x14dc83,_0xef0954,_0x5c58ba){if(_0x14dc83[_0x0924('0xc')]){_0x14dc83[_0x0924('0xd')]=moment()[_0x0924('0xe')](_0x0924('0xf'));}if(_0x14dc83[_0x0924('0x10')]){_0x14dc83[_0x0924('0x11')]=moment()[_0x0924('0xe')](_0x0924('0xf'));}_0x5c58ba(null,_0xef0954);},'beforeUpdate':function(_0x46ae77,_0x42ee25,_0x750932){if(_0x46ae77[_0x0924('0x12')](_0x0924('0xc'))){_0x46ae77['substatusAt']=_0x46ae77[_0x0924('0xc')]?moment()[_0x0924('0xe')](_0x0924('0xf')):null;}if(_0x46ae77[_0x0924('0x12')](_0x0924('0x10'))){_0x46ae77[_0x0924('0x11')]=moment()[_0x0924('0xe')](_0x0924('0xf'));_0x46ae77['substatus']=null;_0x46ae77[_0x0924('0xd')]=null;}_0x750932(null,_0x46ae77);},'afterUpdate':function(_0x15d61d,_0x175f88,_0x3b92b8){var _0x170379=_0x4652a3[_0x0924('0x13')];var _0xd5c812=_0x15d61d[_0x0924('0x14')]({'plain':!![]});if(_0xd5c812[_0x0924('0x10')]){return _0x170379[_0x0924('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0xd5c812['id']}})[_0x0924('0x16')](function(){_0x3b92b8();})['catch'](function(_0x2ee710){_0x3b92b8(_0x2ee710);});}else{_0x3b92b8();}}},'charset':_0x0924('0x17'),'collate':_0x0924('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 21ce6e4..0882cab 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 _0x1b03=['rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','MailInteraction','body','options','raw','attributes','limit','find','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x1b03,0x191));var _0x31b0=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x1b03[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x31b0('0x0'));var util=require(_0x31b0('0x1'));var moment=require(_0x31b0('0x2'));var BPromise=require(_0x31b0('0x3'));var rs=require(_0x31b0('0x4'));var fs=require('fs');var Redis=require(_0x31b0('0x5'));var db=require(_0x31b0('0x6'))['db'];var utils=require(_0x31b0('0x7'));var logger=require(_0x31b0('0x8'))(_0x31b0('0x9'));var config=require(_0x31b0('0xa'));var jayson=require(_0x31b0('0xb'));var client=jayson[_0x31b0('0xc')]['http']({'port':0x232a});config[_0x31b0('0xd')]=_['defaults'](config[_0x31b0('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x31b0('0xe'))(new Redis(config[_0x31b0('0xd')]));require(_0x31b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x52f473,_0x215d10,_0x5994e8){return new BPromise(function(_0x4176e6,_0x27949e){return client[_0x31b0('0x10')](_0x52f473,_0x5994e8)[_0x31b0('0x11')](function(_0x311144){logger[_0x31b0('0x12')](_0x31b0('0x13'),_0x215d10,_0x31b0('0x14'));logger[_0x31b0('0x15')](_0x31b0('0x16'),_0x215d10,_0x31b0('0x14'),JSON[_0x31b0('0x17')](_0x311144));if(_0x311144[_0x31b0('0x18')]){if(_0x311144['error'][_0x31b0('0x19')]===0x1f4){logger['error'](_0x31b0('0x13'),_0x215d10,_0x311144['error'][_0x31b0('0x1a')]);return _0x27949e(_0x311144[_0x31b0('0x18')][_0x31b0('0x1a')]);}logger[_0x31b0('0x18')](_0x31b0('0x13'),_0x215d10,_0x311144[_0x31b0('0x18')][_0x31b0('0x1a')]);return _0x4176e6(_0x311144[_0x31b0('0x18')][_0x31b0('0x1a')]);}else{logger[_0x31b0('0x12')](_0x31b0('0x13'),_0x215d10,_0x31b0('0x14'));_0x4176e6(_0x311144['result'][_0x31b0('0x1a')]);}})[_0x31b0('0x1b')](function(_0x35fed7){logger[_0x31b0('0x18')]('MailInteraction,\x20%s,\x20%s',_0x215d10,_0x35fed7);_0x27949e(_0x35fed7);});});}exports[_0x31b0('0x1c')]=function(_0x110f34){var _0x213dd2=this;return new Promise(function(_0x1329d7,_0x3f6b6c){return db[_0x31b0('0x1d')]['update'](_0x110f34[_0x31b0('0x1e')],{'raw':_0x110f34[_0x31b0('0x1f')]?_0x110f34[_0x31b0('0x1f')][_0x31b0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x110f34[_0x31b0('0x1f')]?_0x110f34[_0x31b0('0x1f')]['where']||null:null,'attributes':_0x110f34[_0x31b0('0x1f')]?_0x110f34[_0x31b0('0x1f')][_0x31b0('0x21')]||null:null,'limit':_0x110f34[_0x31b0('0x1f')]?_0x110f34['options'][_0x31b0('0x22')]||null:null})[_0x31b0('0x11')](function(_0x4eb8aa){logger[_0x31b0('0x12')]('UpdateMailInteraction',_0x110f34);logger[_0x31b0('0x15')](_0x31b0('0x1c'),_0x110f34,JSON[_0x31b0('0x17')](_0x4eb8aa));_0x1329d7(_0x4eb8aa);})[_0x31b0('0x1b')](function(_0x5aa126){logger[_0x31b0('0x18')](_0x31b0('0x1c'),_0x5aa126[_0x31b0('0x1a')],_0x110f34);_0x3f6b6c(_0x213dd2[_0x31b0('0x18')](0x1f4,_0x5aa126[_0x31b0('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x14c74b){return new Promise(function(_0x34b5b0,_0x4bc63d){return db['MailInteraction'][_0x31b0('0x23')]({'where':_0x14c74b['options']?_0x14c74b[_0x31b0('0x1f')][_0x31b0('0x24')]||null:null})['then'](function(_0x33aa70){if(_0x33aa70){return _0x33aa70[_0x31b0('0x25')](_0x14c74b[_0x31b0('0x1e')][_0x31b0('0x26')],_[_0x31b0('0x27')](_0x14c74b[_0x31b0('0x1e')],[_0x31b0('0x26'),'id'])||{});}})['spread'](function(_0x4868b8){logger['info'](_0x31b0('0x28'),_0x14c74b);logger[_0x31b0('0x15')](_0x31b0('0x28'),_0x14c74b,JSON['stringify'](_0x4868b8));_0x34b5b0(_0x4868b8);})['catch'](function(_0xe91562){logger[_0x31b0('0x18')](_0x31b0('0x28'),_0xe91562[_0x31b0('0x1a')],_0x14c74b);_0x4bc63d(_this[_0x31b0('0x18')](0x1f4,_0xe91562[_0x31b0('0x1a')]));});});}; \ No newline at end of file +var _0x7409=['register','then','info','error','MailInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','debug','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5abdd0,_0x380e6b){var _0x260276=function(_0x37a6d8){while(--_0x37a6d8){_0x5abdd0['push'](_0x5abdd0['shift']());}};_0x260276(++_0x380e6b);}(_0x7409,0x6e));var _0x9740=function(_0x4b0eab,_0x4862cb){_0x4b0eab=_0x4b0eab-0x0;var _0x373dd3=_0x7409[_0x4b0eab];return _0x373dd3;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require('moment');var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require(_0x9740('0xa'));var client=jayson['client'][_0x9740('0xb')]({'port':0x232a});config[_0x9740('0xc')]=_[_0x9740('0xd')](config['redis'],{'host':_0x9740('0xe'),'port':0x18eb});var socket=require(_0x9740('0xf'))(new Redis(config[_0x9740('0xc')]));require('./mailInteraction.socket')[_0x9740('0x10')](socket);function respondWithRpcPromise(_0x548bf8,_0x1a6ff9,_0xc27c18){return new BPromise(function(_0x4e39f9,_0x59dd44){return client['request'](_0x548bf8,_0xc27c18)[_0x9740('0x11')](function(_0x3bc357){logger[_0x9740('0x12')]('MailInteraction,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent',JSON['stringify'](_0x3bc357));if(_0x3bc357['error']){if(_0x3bc357[_0x9740('0x13')]['code']===0x1f4){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x3bc357['error'][_0x9740('0x15')]);return _0x59dd44(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}logger[_0x9740('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1a6ff9,_0x3bc357[_0x9740('0x13')]['message']);return _0x4e39f9(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}else{logger[_0x9740('0x12')](_0x9740('0x14'),_0x1a6ff9,_0x9740('0x16'));_0x4e39f9(_0x3bc357[_0x9740('0x17')][_0x9740('0x15')]);}})[_0x9740('0x18')](function(_0x206c4d){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x206c4d);_0x59dd44(_0x206c4d);});});}exports[_0x9740('0x19')]=function(_0x3fb57c){var _0x31d4f7=this;return new Promise(function(_0x3f9e9d,_0xdf62fc){return db[_0x9740('0x1a')][_0x9740('0x1b')](_0x3fb57c['body'],{'raw':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c['options'][_0x9740('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x1e')]||null:null,'attributes':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')]['attributes']||null:null,'limit':_0x3fb57c[_0x9740('0x1c')]?_0x3fb57c[_0x9740('0x1c')][_0x9740('0x1f')]||null:null})[_0x9740('0x11')](function(_0x2a6965){logger[_0x9740('0x12')](_0x9740('0x19'),_0x3fb57c);logger[_0x9740('0x20')](_0x9740('0x19'),_0x3fb57c,JSON['stringify'](_0x2a6965));_0x3f9e9d(_0x2a6965);})[_0x9740('0x18')](function(_0x577323){logger['error']('UpdateMailInteraction',_0x577323['message'],_0x3fb57c);_0xdf62fc(_0x31d4f7[_0x9740('0x13')](0x1f4,_0x577323[_0x9740('0x15')]));});});};exports[_0x9740('0x21')]=function(_0x4d6c88){return new Promise(function(_0x2bfce8,_0x353630){return db[_0x9740('0x1a')][_0x9740('0x22')]({'where':_0x4d6c88['options']?_0x4d6c88[_0x9740('0x1c')][_0x9740('0x1e')]||null:null})[_0x9740('0x11')](function(_0x5433ab){if(_0x5433ab){return _0x5433ab[_0x9740('0x23')](_0x4d6c88[_0x9740('0x24')][_0x9740('0x25')],_[_0x9740('0x26')](_0x4d6c88[_0x9740('0x24')],[_0x9740('0x25'),'id'])||{});}})[_0x9740('0x27')](function(_0x23ea2a){logger[_0x9740('0x12')](_0x9740('0x28'),_0x4d6c88);logger['debug'](_0x9740('0x28'),_0x4d6c88,JSON[_0x9740('0x29')](_0x23ea2a));_0x2bfce8(_0x23ea2a);})[_0x9740('0x18')](function(_0x7d4f8e){logger[_0x9740('0x13')](_0x9740('0x28'),_0x7d4f8e['message'],_0x4d6c88);_0x353630(_this[_0x9740('0x13')](0x1f4,_0x7d4f8e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8218206..4d5504a 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 _0x368f=['update','emit','removeListener','register','length','mailInteraction:','save'];(function(_0x3bfda8,_0x2f1eec){var _0x1086a3=function(_0x55d5c4){while(--_0x55d5c4){_0x3bfda8['push'](_0x3bfda8['shift']());}};_0x1086a3(++_0x2f1eec);}(_0x368f,0x13a));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xf368('0x0'),'remove',_0xf368('0x1')];function createListener(_0x580660,_0x41d373){return function(_0x51f04e){_0x41d373[_0xf368('0x2')](_0x580660,_0x51f04e);};}function removeListener(_0x1d2936,_0xba3b6){return function(){MailInteractionEvents[_0xf368('0x3')](_0x1d2936,_0xba3b6);};}exports[_0xf368('0x4')]=function(_0xd65627){for(var _0x450184=0x0,_0x989547=events[_0xf368('0x5')];_0x450184<_0x989547;_0x450184++){var _0x4bd227=events[_0x450184];var _0x4cbddc=createListener(_0xf368('0x6')+_0x4bd227,_0xd65627);MailInteractionEvents['on'](_0x4bd227,_0x4cbddc);}}; \ No newline at end of file +var _0x7aca=['remove','removeListener','length','save'];(function(_0x43f1a0,_0x5a5fc4){var _0x22650b=function(_0x43f826){while(--_0x43f826){_0x43f1a0['push'](_0x43f1a0['shift']());}};_0x22650b(++_0x5a5fc4);}(_0x7aca,0x18b));var _0xa7ac=function(_0x419ffd,_0x10bdfe){_0x419ffd=_0x419ffd-0x0;var _0xb0b19d=_0x7aca[_0x419ffd];return _0xb0b19d;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa7ac('0x0'),_0xa7ac('0x1'),'update'];function createListener(_0x2a817c,_0xc9b55e){return function(_0x4706a2){_0xc9b55e['emit'](_0x2a817c,_0x4706a2);};}function removeListener(_0x14ad28,_0x1a5011){return function(){MailInteractionEvents[_0xa7ac('0x2')](_0x14ad28,_0x1a5011);};}exports['register']=function(_0x5f461e){for(var _0x31d170=0x0,_0x41537d=events[_0xa7ac('0x3')];_0x31d170<_0x41537d;_0x31d170++){var _0x5b2f60=events[_0x31d170];var _0xede9de=createListener('mailInteraction:'+_0x5b2f60,_0x5f461e);MailInteractionEvents['on'](_0x5b2f60,_0xede9de);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b8e3a0d..e9060de 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 _0x4fc2=['post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/download','download'];(function(_0x372b9d,_0x547e8c){var _0x48cb9b=function(_0x5472c9){while(--_0x5472c9){_0x372b9d['push'](_0x372b9d['shift']());}};_0x48cb9b(++_0x547e8c);}(_0x4fc2,0x111));var _0x24fc=function(_0x3a6c58,_0xf360e2){_0x3a6c58=_0x3a6c58-0x0;var _0x3c9853=_0x4fc2[_0x3a6c58];return _0x3c9853;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')]('/',auth[_0x24fc('0x9')](),interaction[_0x24fc('0x12')](_0x24fc('0x13'),'mailmessage:create'),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')]('/:id',auth[_0x24fc('0x9')](),controller[_0x24fc('0x16')]);router[_0x24fc('0x15')](_0x24fc('0x17'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x18')]);router['put'](_0x24fc('0x19'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x1a')]);router[_0x24fc('0x1b')]('/:id',auth[_0x24fc('0x9')](),controller['destroy']);module[_0x24fc('0x1c')]=router; \ No newline at end of file +var _0x61a5=['create','put','/:id','update','accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','show','/:id/download','download','post','mail','mailmessage:create'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x61a5,0x19e));var _0x561a=function(_0x4dac30,_0x3b1e61){_0x4dac30=_0x4dac30-0x0;var _0x4ae741=_0x61a5[_0x4dac30];return _0x4ae741;};'use strict';var multer=require(_0x561a('0x0'));var util=require('util');var path=require(_0x561a('0x1'));var timeout=require(_0x561a('0x2'));var express=require('express');var router=express[_0x561a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x561a('0x4'));var interaction=require(_0x561a('0x5'));var config=require(_0x561a('0x6'));var controller=require(_0x561a('0x7'));router[_0x561a('0x8')]('/',auth[_0x561a('0x9')](),controller[_0x561a('0xa')]);router[_0x561a('0x8')]('/describe',auth[_0x561a('0x9')](),controller[_0x561a('0xb')]);router[_0x561a('0x8')]('/:id',auth[_0x561a('0x9')](),controller[_0x561a('0xc')]);router['get'](_0x561a('0xd'),auth[_0x561a('0x9')](),controller[_0x561a('0xe')]);router[_0x561a('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x561a('0x10'),_0x561a('0x11')),controller[_0x561a('0x12')]);router[_0x561a('0x13')](_0x561a('0x14'),auth[_0x561a('0x9')](),controller[_0x561a('0x15')]);router[_0x561a('0x13')]('/:id/accept',auth[_0x561a('0x9')](),controller[_0x561a('0x16')]);router[_0x561a('0x13')](_0x561a('0x17'),auth['isAuthenticated'](),controller[_0x561a('0x18')]);router['delete'](_0x561a('0x14'),auth[_0x561a('0x9')](),controller[_0x561a('0x19')]);module[_0x561a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 44bf766..0f992c4 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 _0x5089=['exports','TEXT','medium','BOOLEAN','out','STRING','long','DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash'];(function(_0x36fc47,_0x354b21){var _0x1867fc=function(_0x566509){while(--_0x566509){_0x36fc47['push'](_0x36fc47['shift']());}};_0x1867fc(++_0x354b21);}(_0x5089,0x1a2));var _0x9508=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x5089[_0x44454f];return _0x475150;};'use strict';var Sequelize=require(_0x9508('0x0'));var _=require(_0x9508('0x1'));module[_0x9508('0x2')]={'body':{'type':Sequelize[_0x9508('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x9508('0x3')](_0x9508('0x4'))},'read':{'type':Sequelize[_0x9508('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9508('0x6')),'defaultValue':_0x9508('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9508('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9508('0x3')](_0x9508('0x8'))},'cc':{'type':Sequelize[_0x9508('0x3')](_0x9508('0x8'))},'bcc':{'type':Sequelize[_0x9508('0x3')](_0x9508('0x8'))},'subject':{'type':Sequelize[_0x9508('0x3')]},'sentAt':{'type':Sequelize[_0x9508('0x9')]},'attach':{'type':Sequelize[_0x9508('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x9508('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x9508('0x8'))},'originCc':{'type':Sequelize[_0x9508('0x3')](_0x9508('0x8'))},'originChannel':{'type':Sequelize[_0x9508('0xb')](_0x9508('0xc'),_0x9508('0xd')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x3a6f=['exports','BOOLEAN','ENUM','out','STRING','TEXT','long','DATE','INTEGER','Email','sequelize','lodash'];(function(_0x1658e4,_0x1d738f){var _0x46aa80=function(_0x265b6d){while(--_0x265b6d){_0x1658e4['push'](_0x1658e4['shift']());}};_0x46aa80(++_0x1d738f);}(_0x3a6f,0x1a2));var _0xf3a6=function(_0xd5f997,_0xe7fadd){_0xd5f997=_0xd5f997-0x0;var _0x500a36=_0x3a6f[_0xd5f997];return _0x500a36;};'use strict';var Sequelize=require(_0xf3a6('0x0'));var _=require(_0xf3a6('0x1'));module[_0xf3a6('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xf3a6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf3a6('0x4')]('in',_0xf3a6('0x5')),'defaultValue':_0xf3a6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xf3a6('0x6')]},'to':{'type':Sequelize[_0xf3a6('0x7')](_0xf3a6('0x8'))},'cc':{'type':Sequelize[_0xf3a6('0x7')](_0xf3a6('0x8'))},'bcc':{'type':Sequelize[_0xf3a6('0x7')](_0xf3a6('0x8'))},'subject':{'type':Sequelize[_0xf3a6('0x7')]},'sentAt':{'type':Sequelize[_0xf3a6('0x9')]},'attach':{'type':Sequelize[_0xf3a6('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf3a6('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf3a6('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xf3a6('0x8'))},'originCc':{'type':Sequelize[_0xf3a6('0x7')](_0xf3a6('0x8'))},'originChannel':{'type':Sequelize[_0xf3a6('0x4')](_0xf3a6('0xb'),'Chat'),'defaultValue':_0xf3a6('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 9c3a842..2200e51 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 _0x298c=['files','from','bcc','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','writeFileSync','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','html-to-text','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','end','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','MailMessage','findAll','rows','params','body','find','destroy','describe','create','direction','out','secret','split','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','isNil','host','secure','authentication','auth','user','pass','service','attachments','root','server/files/attachments','ListId','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','contact','download','toString','join','server'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x298c,0xc4));var _0xc298=function(_0x55f6d8,_0x10e2ef){_0x55f6d8=_0x55f6d8-0x0;var _0x36b027=_0x298c[_0x55f6d8];return _0x36b027;};'use strict';var emlformat=require(_0xc298('0x0'));var rimraf=require(_0xc298('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc298('0x2'));var rp=require(_0xc298('0x3'));var moment=require('moment');var BPromise=require(_0xc298('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc298('0x5'));var sox=require(_0xc298('0x6'));var csv=require(_0xc298('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc298('0x8'));var _=require(_0xc298('0x9'));var squel=require(_0xc298('0xa'));var crypto=require(_0xc298('0xb'));var jsforce=require(_0xc298('0xc'));var deskjs=require(_0xc298('0xd'));var toCsv=require(_0xc298('0x7'));var querystring=require(_0xc298('0xe'));var Papa=require(_0xc298('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc298('0x10'));var as=require(_0xc298('0x11'));var hardwareService=require(_0xc298('0x12'));var logger=require(_0xc298('0x13'))(_0xc298('0x14'));var utils=require(_0xc298('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc298('0x16'));var htmlToText=require(_0xc298('0x17'));var db=require('../../mysqldb')['db'];config[_0xc298('0x18')]=_[_0xc298('0x19')](config[_0xc298('0x18')],{'host':_0xc298('0x1a'),'port':0x18eb});var socket=require(_0xc298('0x1b'))(new Redis(config['redis']));require(_0xc298('0x1c'))[_0xc298('0x1d')](socket);var jayson=require(_0xc298('0x1e'));var client=jayson['client'][_0xc298('0x1f')]({'port':0x232c});var client9003=jayson[_0xc298('0x20')][_0xc298('0x1f')]({'port':0x232b});var client9002=jayson[_0xc298('0x20')][_0xc298('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x295a8e,_0x478599,_0x6d3941,_0x545ae1){return new BPromise(function(_0x3fc461,_0x1725de){var _0xd1cca2=_0x545ae1||client;return _0xd1cca2[_0xc298('0x21')](_0x295a8e,_0x6d3941)[_0xc298('0x22')](function(_0x56e0b8){logger[_0xc298('0x23')](_0xc298('0x24'),_0x478599,_0xc298('0x25'));logger[_0xc298('0x26')](_0xc298('0x27'),_0x478599,_0xc298('0x25'),JSON['stringify'](_0x56e0b8));if(_0x56e0b8[_0xc298('0x28')]){if(_0x56e0b8[_0xc298('0x28')][_0xc298('0x29')]===0x1f4){logger[_0xc298('0x28')](_0xc298('0x24'),_0x478599,_0x56e0b8['error']['message']);return _0x1725de(_0x56e0b8[_0xc298('0x28')][_0xc298('0x2a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x478599,_0x56e0b8[_0xc298('0x28')][_0xc298('0x2a')]);return _0x3fc461(_0x56e0b8['error'][_0xc298('0x2a')]);}else{logger[_0xc298('0x23')](_0xc298('0x24'),_0x478599,_0xc298('0x25'));_0x3fc461(_0x56e0b8['result'][_0xc298('0x2a')]);}})[_0xc298('0x2b')](function(_0x2b5294){logger[_0xc298('0x28')](_0xc298('0x24'),_0x478599,_0x2b5294);_0x1725de(_0x2b5294);});});}function respondWithStatusCode(_0x34d65b,_0x33a706){_0x33a706=_0x33a706||0xcc;return function(_0x19de4c){if(_0x19de4c){return _0x34d65b[_0xc298('0x2c')](_0x33a706);}return _0x34d65b[_0xc298('0x2d')](_0x33a706)['end']();};}function respondWithResult(_0x1eba7a,_0x453027){_0x453027=_0x453027||0xc8;return function(_0x4eefd5){if(_0x4eefd5){return _0x1eba7a[_0xc298('0x2d')](_0x453027)[_0xc298('0x2e')](_0x4eefd5);}};}function respondWithFilteredResult(_0x16577c,_0x3ceeed){return function(_0x2872c2){if(_0x2872c2){var _0x41e205=typeof _0x3ceeed['offset']===_0xc298('0x2f')&&typeof _0x3ceeed['limit']==='undefined';var _0xbd787f=_0x2872c2[_0xc298('0x30')];var _0x1401e1=_0x41e205?0x0:_0x3ceeed['offset'];var _0x223155=_0x41e205?_0x2872c2['count']:_0x3ceeed[_0xc298('0x31')]+_0x3ceeed[_0xc298('0x32')];var _0x4bc259;if(_0x223155>=_0xbd787f){_0x223155=_0xbd787f;_0x4bc259=0xc8;}else{_0x4bc259=0xce;}_0x16577c[_0xc298('0x2d')](_0x4bc259);return _0x16577c['set'](_0xc298('0x33'),_0x1401e1+'-'+_0x223155+'/'+_0xbd787f)[_0xc298('0x2e')](_0x2872c2);}return null;};}function patchUpdates(_0x52bde6){return function(_0x417574){try{jsonpatch[_0xc298('0x34')](_0x417574,_0x52bde6,!![]);}catch(_0x1a7404){return BPromise[_0xc298('0x35')](_0x1a7404);}return _0x417574['save']();};}function saveUpdates(_0x434b05,_0x3baa8a){return function(_0x189ef5){if(_0x189ef5){return _0x189ef5[_0xc298('0x36')](_0x434b05)[_0xc298('0x22')](function(_0x264f65){return _0x264f65;});}return null;};}function removeEntity(_0xbb2c08,_0x384632){return function(_0x41eb38){if(_0x41eb38){return _0x41eb38['destroy']()[_0xc298('0x22')](function(){_0xbb2c08['status'](0xcc)[_0xc298('0x37')]();});}};}function handleEntityNotFound(_0x4bac8d,_0x4d49b0){return function(_0x4db4c2){if(!_0x4db4c2){_0x4bac8d[_0xc298('0x2c')](0x194);}return _0x4db4c2;};}function handleError(_0x51ce8d,_0x30561f){_0x30561f=_0x30561f||0x1f4;return function(_0xfa7269){logger[_0xc298('0x28')](_0xfa7269[_0xc298('0x38')]);if(_0xfa7269['name']){delete _0xfa7269[_0xc298('0x39')];}_0x51ce8d[_0xc298('0x2d')](_0x30561f)[_0xc298('0x3a')](_0xfa7269);};}exports[_0xc298('0x3b')]=function(_0x29ef7b,_0x269812){var _0x9d75f0={},_0x7b5546={},_0x1f6110={'count':0x0,'rows':[]};var _0x341460=_[_0xc298('0x3c')](db['MailMessage'][_0xc298('0x3d')],function(_0x1bf307){return{'name':_0x1bf307[_0xc298('0x3e')],'type':_0x1bf307['type']['key']};});_0x7b5546['model']=_[_0xc298('0x3c')](_0x341460,_0xc298('0x39'));_0x7b5546[_0xc298('0x3f')]=_[_0xc298('0x40')](_0x29ef7b[_0xc298('0x3f')]);_0x7b5546[_0xc298('0x41')]=_[_0xc298('0x42')](_0x7b5546[_0xc298('0x43')],_0x7b5546[_0xc298('0x3f')]);_0x9d75f0['attributes']=_['intersection'](_0x7b5546[_0xc298('0x43')],qs[_0xc298('0x44')](_0x29ef7b[_0xc298('0x3f')][_0xc298('0x44')]));_0x9d75f0['attributes']=_0x9d75f0[_0xc298('0x45')][_0xc298('0x46')]?_0x9d75f0[_0xc298('0x45')]:_0x7b5546[_0xc298('0x43')];if(!_0x29ef7b['query'][_0xc298('0x47')](_0xc298('0x48'))){_0x9d75f0[_0xc298('0x32')]=qs[_0xc298('0x32')](_0x29ef7b['query']['limit']);_0x9d75f0['offset']=qs[_0xc298('0x31')](_0x29ef7b['query']['offset']);}_0x9d75f0[_0xc298('0x49')]=qs[_0xc298('0x4a')](_0x29ef7b[_0xc298('0x3f')][_0xc298('0x4a')]);_0x9d75f0[_0xc298('0x4b')]=qs[_0xc298('0x41')](_[_0xc298('0x4c')](_0x29ef7b[_0xc298('0x3f')],_0x7b5546[_0xc298('0x41')]),_0x341460);if(_0x29ef7b[_0xc298('0x3f')][_0xc298('0x4d')]){_0x9d75f0[_0xc298('0x4b')]=_[_0xc298('0x4e')](_0x9d75f0[_0xc298('0x4b')],{'$or':_[_0xc298('0x3c')](_0x341460,function(_0x2716cd){if(_0x2716cd[_0xc298('0x4f')]!==_0xc298('0x50')){var _0xf1249b={};_0xf1249b[_0x2716cd[_0xc298('0x39')]]={'$like':'%'+_0x29ef7b[_0xc298('0x3f')]['filter']+'%'};return _0xf1249b;}})});}_0x9d75f0=_[_0xc298('0x4e')]({},_0x9d75f0,_0x29ef7b[_0xc298('0x51')]);var _0x451ee7={'where':_0x9d75f0[_0xc298('0x4b')]};return db['MailMessage'][_0xc298('0x30')](_0x451ee7)[_0xc298('0x22')](function(_0xd3f760){_0x1f6110[_0xc298('0x30')]=_0xd3f760;if(_0x29ef7b[_0xc298('0x3f')][_0xc298('0x52')]){_0x9d75f0[_0xc298('0x53')]=[{'all':!![]}];}return db[_0xc298('0x54')][_0xc298('0x55')](_0x9d75f0);})[_0xc298('0x22')](function(_0x24da16){_0x1f6110[_0xc298('0x56')]=_0x24da16;return _0x1f6110;})['then'](respondWithFilteredResult(_0x269812,_0x9d75f0))['catch'](handleError(_0x269812,null));};exports['show']=function(_0x202da9,_0x5ceb06){var _0x1501fa={'raw':!![],'where':{'id':_0x202da9[_0xc298('0x57')]['id']}},_0x2b2b73={};_0x2b2b73[_0xc298('0x43')]=_[_0xc298('0x40')](db[_0xc298('0x54')]['rawAttributes']);_0x2b2b73[_0xc298('0x3f')]=_['keys'](_0x202da9['query']);_0x2b2b73[_0xc298('0x41')]=_[_0xc298('0x42')](_0x2b2b73[_0xc298('0x43')],_0x2b2b73[_0xc298('0x3f')]);_0x1501fa[_0xc298('0x45')]=_[_0xc298('0x42')](_0x2b2b73[_0xc298('0x43')],qs[_0xc298('0x44')](_0x202da9[_0xc298('0x3f')][_0xc298('0x44')]));_0x1501fa['attributes']=_0x1501fa['attributes'][_0xc298('0x46')]?_0x1501fa[_0xc298('0x45')]:_0x2b2b73[_0xc298('0x43')];if(_0x202da9[_0xc298('0x3f')][_0xc298('0x52')]){_0x1501fa[_0xc298('0x53')]=[{'all':!![]}];}_0x1501fa=_[_0xc298('0x4e')]({},_0x1501fa,_0x202da9[_0xc298('0x51')]);return db[_0xc298('0x54')]['find'](_0x1501fa)['then'](handleEntityNotFound(_0x5ceb06,null))[_0xc298('0x22')](respondWithResult(_0x5ceb06,null))[_0xc298('0x2b')](handleError(_0x5ceb06,null));};exports['update']=function(_0x287b42,_0x335827){if(_0x287b42[_0xc298('0x58')]['id']){delete _0x287b42[_0xc298('0x58')]['id'];}return db['MailMessage'][_0xc298('0x59')]({'where':{'id':_0x287b42[_0xc298('0x57')]['id']}})[_0xc298('0x22')](handleEntityNotFound(_0x335827,null))[_0xc298('0x22')](saveUpdates(_0x287b42[_0xc298('0x58')],null))[_0xc298('0x22')](respondWithResult(_0x335827,null))[_0xc298('0x2b')](handleError(_0x335827,null));};exports[_0xc298('0x5a')]=function(_0x171a44,_0x495ca8){return db[_0xc298('0x54')][_0xc298('0x59')]({'where':{'id':_0x171a44[_0xc298('0x57')]['id']}})[_0xc298('0x22')](handleEntityNotFound(_0x495ca8,null))[_0xc298('0x22')](removeEntity(_0x495ca8,null))['catch'](handleError(_0x495ca8,null));};exports[_0xc298('0x5b')]=function(_0x318a1d,_0x5bd1f2){return db['MailMessage'][_0xc298('0x5b')]()['then'](respondWithResult(_0x5bd1f2,null))[_0xc298('0x2b')](handleError(_0x5bd1f2,null));};exports[_0xc298('0x5c')]=function(_0x9f4be7,_0xdc586){return db[_0xc298('0x54')]['create'](_0x9f4be7[_0xc298('0x58')])[_0xc298('0x22')](function(_0x2a03b8){if(_0x2a03b8){if(_0x2a03b8[_0xc298('0x5d')]===_0xc298('0x5e')&&!_0x2a03b8[_0xc298('0x5f')]){var _0x3f363f,_0x52666d,_0x4b9ca0;if(_0x9f4be7['body']['to']){_0x52666d=_0x9f4be7['body']['to'][_0xc298('0x60')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x2a03b8[_0xc298('0x61')]},'include':[{'model':db[_0xc298('0x62')],'as':_0xc298('0x63'),'include':[{'model':db[_0xc298('0x64')],'as':_0xc298('0x65'),'where':{'email':_0x52666d},'limit':0x1,'order':[[_0xc298('0x66'),'DESC']]}]},{'model':db[_0xc298('0x67')],'as':'Smtp','raw':!![]}]})[_0xc298('0x22')](function(_0x2b541b){_0x3f363f=_0x2b541b;if(_0x3f363f&&_0x3f363f[_0xc298('0x68')]){var _0xff7947={'tls':{'rejectUnauthorized':![]}};if(_[_0xc298('0x69')](_0x3f363f[_0xc298('0x68')]['service'])){_0xff7947[_0xc298('0x6a')]=_0x3f363f[_0xc298('0x68')][_0xc298('0x6a')];_0xff7947['port']=_0x3f363f[_0xc298('0x68')]['port'];_0xff7947[_0xc298('0x6b')]=_0x3f363f[_0xc298('0x68')]['secure'];if(_0x3f363f['Smtp'][_0xc298('0x6c')]){_0xff7947[_0xc298('0x6d')]={'user':_0x3f363f[_0xc298('0x68')][_0xc298('0x6e')],'pass':_0x3f363f[_0xc298('0x68')][_0xc298('0x6f')]};}}else{_0xff7947[_0xc298('0x70')]=_0x3f363f['Smtp'][_0xc298('0x70')];_0xff7947[_0xc298('0x6d')]={'user':_0x3f363f['Smtp'][_0xc298('0x6e')],'pass':_0x3f363f[_0xc298('0x68')][_0xc298('0x6f')]};_0xff7947['secure']=_0x3f363f[_0xc298('0x68')][_0xc298('0x6b')];}if(_0x9f4be7[_0xc298('0x58')][_0xc298('0x71')]&&_0x9f4be7['body'][_0xc298('0x71')][_0xc298('0x46')]){for(var _0x13e1f8=0x0;_0x13e1f8<_0x9f4be7[_0xc298('0x58')][_0xc298('0x71')][_0xc298('0x46')];_0x13e1f8+=0x1){_0x9f4be7[_0xc298('0x58')][_0xc298('0x71')][_0x13e1f8]={'filename':_0x9f4be7[_0xc298('0x58')]['attachments'][_0x13e1f8][_0xc298('0x39')],'path':path['join'](config[_0xc298('0x72')],_0xc298('0x73'),_0x9f4be7[_0xc298('0x58')][_0xc298('0x71')][_0x13e1f8]['basename'])};}}_0x4b9ca0={'account':_0xff7947,'message':_0x9f4be7[_0xc298('0x58')]};return;}})[_0xc298('0x22')](function(){if(_0x3f363f['List']){if(_0x3f363f[_0xc298('0x63')][_0xc298('0x65')]['length']){return _0x3f363f[_0xc298('0x63')][_0xc298('0x65')][0x0];}else{return db['CmContact']['create'](_[_0xc298('0x19')](_0x9f4be7[_0xc298('0x58')],{'firstName':_0x9f4be7['body']['to'],'email':_0x9f4be7[_0xc298('0x58')]['to'],'phone':_0x9f4be7['body']['to'],'ListId':_0x3f363f[_0xc298('0x74')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc298('0x22')](function(){if(_0x4b9ca0){return respondWithRpcPromise(_0xc298('0x75'),_0xc298('0x76'),_0x4b9ca0,client9003)[_0xc298('0x22')](function(_0x9a83c8){return _0x2a03b8['update']({'read':!![],'messageId':_0x9a83c8[_0xc298('0x77')],'sentAt':moment()['format'](_0xc298('0x78'))});})[_0xc298('0x2b')](function(_0x5f1a16){logger[_0xc298('0x28')]('%s',JSON['stringify'](_0x5f1a16));return _0x2a03b8;});}return _0x2a03b8;});}return _0x2a03b8;}})[_0xc298('0x22')](respondWithResult(_0xdc586,0xc9))[_0xc298('0x2b')](handleError(_0xdc586,null));};var interaction_log=require('../../config/logger')(_0xc298('0x79'));exports[_0xc298('0x7a')]=function(_0x4efa51,_0x422eb8,_0x4e7034){var _0x388b1d={'agent':{},'channel':'mail'};if(_0x4efa51[_0xc298('0x58')]['id']){delete _0x4efa51[_0xc298('0x58')]['id'];}_0x4efa51['body']['read']=!![];_0x4efa51[_0xc298('0x58')][_0xc298('0x7b')]=moment()[_0xc298('0x7c')](_0xc298('0x78'));_0x4efa51[_0xc298('0x58')][_0xc298('0x7d')]=_0x4efa51[_0xc298('0x58')][_0xc298('0x7d')]||_0x4efa51[_0xc298('0x6e')]['id'];_0x388b1d[_0xc298('0x7e')]['id']=_0x4efa51['body']['UserId'];return db[_0xc298('0x54')][_0xc298('0x59')]({'where':{'id':_0x4efa51[_0xc298('0x57')]['id'],'UserId':null}})[_0xc298('0x22')](handleEntityNotFound(_0x422eb8,null))[_0xc298('0x22')](saveUpdates(_0x4efa51[_0xc298('0x58')],null))[_0xc298('0x22')](function(_0x2591f9){if(_0x2591f9){_0x388b1d[_0xc298('0x2a')]=_0x2591f9[_0xc298('0x7f')]({'plain':!![]});return db[_0xc298('0x80')][_0xc298('0x59')]({'where':{'id':_0x2591f9[_0xc298('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x422eb8,null))['then'](function(_0x30325b){if(_0x30325b){return _0x30325b[_0xc298('0x36')]({'UserId':_0x4efa51['body']['UserId'],'read1stAt':_[_0xc298('0x69')](_0x30325b[_0xc298('0x82')])?moment()['format'](_0xc298('0x78')):undefined});}return null;})['then'](function(_0x3fbf0e){if(_0x3fbf0e){_0x388b1d[_0xc298('0x83')]=_0x3fbf0e[_0xc298('0x7f')]({'plain':!![]});interaction_log[_0xc298('0x23')](_0xc298('0x84'),_0x4efa51['user']['id'],_0x4efa51[_0xc298('0x6e')]['name'],_0x4efa51[_0xc298('0x6e')][_0xc298('0x85')],_0x388b1d[_0xc298('0x83')]['id'],_0x4efa51[_0xc298('0x58')]?JSON['stringify'](_0x4efa51[_0xc298('0x58')]):_0xc298('0x86'));return respondWithRpcPromise('AcceptMessage',_0xc298('0x87'),_0x388b1d);}return null;})[_0xc298('0x22')](function(_0x565af5){var _0x40f282=_0xc298('0x88')+_0x565af5['message'][_0xc298('0x89')];return db[_0xc298('0x8a')][_0xc298('0x3f')](_0x40f282,{'type':db['Sequelize'][_0xc298('0x8b')][_0xc298('0x8c')],'raw':!![]})[_0xc298('0x22')](function(_0xe24be1){return _0xe24be1;});})[_0xc298('0x22')](function(_0x2c79ab){if(_0x2c79ab){_0x388b1d[_0xc298('0x2a')]['contact']=_0x2c79ab[0x0];if(!_0x4efa51[_0xc298('0x58')][_0xc298('0x7d')])return;return db[_0xc298('0x8d')]['find']({'where':{'id':_0x4efa51['body'][_0xc298('0x7d')],'role':_0xc298('0x7e')},'attributes':['id','name',_0xc298('0x8e'),_0xc298('0x8f'),_0xc298('0x90')],'raw':!![]});}return null;})[_0xc298('0x22')](function(_0x3c2312){if(!_0x3c2312)return null;_0x388b1d[_0xc298('0x2a')]['agent']=_0x3c2312;return _0x388b1d;})[_0xc298('0x22')](function(_0x2fdf51){if(_0x2fdf51){if(_0x4efa51['body'][_0xc298('0x91')]){_0x388b1d[_0xc298('0x2a')][_0xc298('0x92')]=util['format'](_0xc298('0x93'),_0x4efa51[_0xc298('0x6e')][_0xc298('0x39')]);_0x388b1d[_0xc298('0x2a')][_0xc298('0x94')]=_0x388b1d['channel'];_0x388b1d[_0xc298('0x2a')][_0xc298('0x95')]=_0xc298('0x7a');_0x388b1d['message'][_0xc298('0x58')]=htmlToText[_0xc298('0x96')](_0x388b1d['message'][_0xc298('0x58')]);return respondWithRpcPromise(_0xc298('0x97'),_0xc298('0x97'),{'event':_0xc298('0x98'),'message':_0x388b1d['message']},client9002)[_0xc298('0x22')](function(){return _0x388b1d;});}return _0x388b1d;}return null;})['then'](respondWithResult(_0x422eb8,null))[_0xc298('0x2b')](handleError(_0x422eb8,null));};var interaction_log=require(_0xc298('0x13'))(_0xc298('0x79'));exports['reject']=function(_0x214f0f,_0x1356b8,_0x595b64){var _0x8f04f6={'agent':{},'channel':_0xc298('0x99')};if(_0x214f0f[_0xc298('0x58')]['id']){delete _0x214f0f[_0xc298('0x58')]['id'];}_0x214f0f[_0xc298('0x58')][_0xc298('0x7d')]=_0x214f0f[_0xc298('0x58')][_0xc298('0x7d')]||_0x214f0f[_0xc298('0x6e')]['id'];_0x8f04f6[_0xc298('0x7e')]['id']=_0x214f0f[_0xc298('0x58')][_0xc298('0x7d')];return db['MailMessage'][_0xc298('0x59')]({'where':{'id':_0x214f0f[_0xc298('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1356b8,null))['then'](function(_0x19b304){if(_0x19b304){_0x8f04f6[_0xc298('0x2a')]=_0x19b304[_0xc298('0x7f')]({'plain':!![]});return db[_0xc298('0x80')]['find']({'where':{'id':_0x19b304['MailInteractionId']}});}return null;})[_0xc298('0x22')](handleEntityNotFound(_0x1356b8,null))[_0xc298('0x22')](function(_0x495876){if(_0x495876){_0x8f04f6[_0xc298('0x83')]=_0x495876[_0xc298('0x7f')]({'plain':!![]});interaction_log[_0xc298('0x23')](_0xc298('0x9a'),_0x214f0f[_0xc298('0x6e')]['id'],_0x214f0f[_0xc298('0x6e')][_0xc298('0x39')],_0x214f0f[_0xc298('0x6e')][_0xc298('0x85')],_0x8f04f6[_0xc298('0x83')]['id'],_0x214f0f['body']?JSON[_0xc298('0x9b')](_0x214f0f[_0xc298('0x58')]):'null');return respondWithRpcPromise('RejectMessage',_0xc298('0x9c'),_0x8f04f6);}return null;})[_0xc298('0x22')](function(_0x56aee1){var _0x24fa68=_0xc298('0x88')+_0x56aee1[_0xc298('0x2a')][_0xc298('0x89')];return db[_0xc298('0x8a')][_0xc298('0x3f')](_0x24fa68,{'type':db['Sequelize'][_0xc298('0x8b')][_0xc298('0x8c')],'raw':!![]})[_0xc298('0x22')](function(_0x81df4){return _0x81df4;});})[_0xc298('0x22')](function(_0x4b47d2){if(_0x4b47d2){_0x8f04f6[_0xc298('0x2a')][_0xc298('0x9d')]=_0x4b47d2[0x0];if(!_0x214f0f[_0xc298('0x58')][_0xc298('0x7d')])return;return db[_0xc298('0x8d')]['find']({'where':{'id':_0x214f0f[_0xc298('0x58')][_0xc298('0x7d')],'role':_0xc298('0x7e')},'attributes':['id',_0xc298('0x39'),'fullname','email',_0xc298('0x90')],'raw':!![]});}return null;})['then'](function(_0x22c70d){if(!_0x22c70d)return null;_0x8f04f6['message'][_0xc298('0x7e')]=_0x22c70d;return _0x8f04f6;})[_0xc298('0x22')](function(_0x46c352){if(_0x46c352){_0x46c352['message'][_0xc298('0x92')]=util[_0xc298('0x7c')]('SIP/%s',_0x214f0f[_0xc298('0x6e')][_0xc298('0x39')]);_0x46c352[_0xc298('0x2a')][_0xc298('0x94')]=_0x8f04f6[_0xc298('0x94')];_0x46c352[_0xc298('0x2a')][_0xc298('0x95')]=_0xc298('0x35');_0x46c352[_0xc298('0x2a')]['body']=htmlToText[_0xc298('0x96')](_0x8f04f6[_0xc298('0x2a')][_0xc298('0x58')]);respondWithRpcPromise(_0xc298('0x97'),'EventManager',{'event':'rejectmessage','message':_0x46c352[_0xc298('0x2a')]},client9002);return _0x8f04f6;}return null;})[_0xc298('0x22')](respondWithResult(_0x1356b8,null))[_0xc298('0x2b')](handleError(_0x1356b8,null));};exports[_0xc298('0x9e')]=function(_0x488eb2,_0x52ba00){var _0x35d0b8=moment()['unix']()[_0xc298('0x9f')]();var _0x338a5a=path[_0xc298('0xa0')](config[_0xc298('0x72')],_0xc298('0xa1'),_0xc298('0xa2'),'tmp');var _0x5be395=path[_0xc298('0xa0')](config['root'],_0xc298('0xa1'),_0xc298('0xa2'),_0xc298('0x71'));var _0x1ebd7c=util['format']('message-%s.eml',_0x35d0b8);return db[_0xc298('0x54')][_0xc298('0x59')]({'where':{'id':_0x488eb2[_0xc298('0x57')]['id']},'attributes':['id','body',_0xc298('0xa3'),'to','cc',_0xc298('0xa4'),'subject',_0xc298('0xa5')],'include':_0x488eb2[_0xc298('0x3f')]['attachments']?[{'model':db[_0xc298('0xa6')],'as':_0xc298('0xa7')}]:undefined})[_0xc298('0x22')](handleEntityNotFound(_0x52ba00,null))[_0xc298('0x22')](function(_0x28c934){if(_0x28c934){var _0x5883e2=_0x28c934;var _0xd67e8e={'from':_0x5883e2[_0xc298('0xa3')],'to':_0x5883e2['to'],'subject':_0x5883e2['subject'],'html':_0x5883e2['body'],'headers':{'Date':moment(_0x5883e2[_0xc298('0xa5')])[_0xc298('0x7c')](_0xc298('0xa8'))},'attachments':[]};if(_0x28c934['cc']){_0xd67e8e[_0xc298('0xa9')]['Cc']=_0x28c934['cc'];}if(_0x28c934[_0xc298('0xa4')]){_0xd67e8e['headers'][_0xc298('0xaa')]=_0x28c934[_0xc298('0xa4')];}return new BPromise(function(_0x279f90,_0x10610f){if(_0x28c934[_0xc298('0xa7')]){for(var _0x180736=0x0;_0x180736<_0x28c934[_0xc298('0xa7')][_0xc298('0x46')];_0x180736++){var _0x11d875=_0x28c934['Attachments'][_0x180736];var _0x3abefc=path[_0xc298('0xa0')](_0x5be395,_0x11d875[_0xc298('0xab')]);if(fs[_0xc298('0xac')](_0x3abefc)){_0xd67e8e['attachments'][_0xc298('0xad')]({'name':_0x11d875[_0xc298('0x39')],'contentType':_0x11d875[_0xc298('0x4f')],'data':fs[_0xc298('0xae')](_0x3abefc)});}}}emlformat['build'](_0xd67e8e,function(_0x310173,_0x51bf9d){if(_0x310173)return _0x10610f(_0x310173);fs[_0xc298('0xaf')](path[_0xc298('0xa0')](_0x338a5a,_0x1ebd7c),_0x51bf9d);return _0x279f90(_0x51bf9d);});});}})[_0xc298('0x22')](function(_0x3e4e45){if(_0x3e4e45){return _0x52ba00[_0xc298('0x9e')](path['join'](_0x338a5a,_0x1ebd7c),_0x1ebd7c,function(_0x561b68){if(_0x561b68){console[_0xc298('0xb0')](_0xc298('0xb1'),_0x561b68);}else{fs[_0xc298('0xb2')](path['join'](_0x338a5a,_0x1ebd7c));}});}})['catch'](handleError(_0x52ba00,null));}; \ No newline at end of file +var _0x8b33=['from','bcc','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','build','writeFileSync','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','html-to-text','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','name','MailMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','sendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','mail-interactions','accept','mail','read','readAt','format','UserId','agent','read1stAt','get','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','manual','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','sequelize','SELECT','interface','rejectmessage','download','toString','join','server','files','message-%s.eml'];(function(_0x1b2b60,_0x1df6b9){var _0x57a997=function(_0x10fdb9){while(--_0x10fdb9){_0x1b2b60['push'](_0x1b2b60['shift']());}};_0x57a997(++_0x1df6b9);}(_0x8b33,0x17b));var _0x38b3=function(_0x17e389,_0x11c4b1){_0x17e389=_0x17e389-0x0;var _0x577ec6=_0x8b33[_0x17e389];return _0x577ec6;};'use strict';var emlformat=require(_0x38b3('0x0'));var rimraf=require(_0x38b3('0x1'));var zipdir=require(_0x38b3('0x2'));var jsonpatch=require(_0x38b3('0x3'));var rp=require(_0x38b3('0x4'));var moment=require('moment');var BPromise=require(_0x38b3('0x5'));var Mustache=require(_0x38b3('0x6'));var util=require('util');var path=require(_0x38b3('0x7'));var sox=require(_0x38b3('0x8'));var csv=require(_0x38b3('0x9'));var ejs=require(_0x38b3('0xa'));var fs=require('fs');var fs_extra=require(_0x38b3('0xb'));var _=require('lodash');var squel=require(_0x38b3('0xc'));var crypto=require(_0x38b3('0xd'));var jsforce=require(_0x38b3('0xe'));var deskjs=require(_0x38b3('0xf'));var toCsv=require(_0x38b3('0x9'));var querystring=require(_0x38b3('0x10'));var Papa=require(_0x38b3('0x11'));var Redis=require(_0x38b3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x38b3('0x13'));var as=require(_0x38b3('0x14'));var hardwareService=require(_0x38b3('0x15'));var logger=require(_0x38b3('0x16'))(_0x38b3('0x17'));var utils=require('../../config/utils');var config=require(_0x38b3('0x18'));var licenseUtil=require(_0x38b3('0x19'));var htmlToText=require(_0x38b3('0x1a'));var db=require(_0x38b3('0x1b'))['db'];config[_0x38b3('0x1c')]=_[_0x38b3('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x38b3('0x1e'))(new Redis(config[_0x38b3('0x1c')]));require(_0x38b3('0x1f'))['register'](socket);var jayson=require(_0x38b3('0x20'));var client=jayson[_0x38b3('0x21')]['http']({'port':0x232c});var client9003=jayson[_0x38b3('0x21')][_0x38b3('0x22')]({'port':0x232b});var client9002=jayson[_0x38b3('0x21')][_0x38b3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2fe0cd,_0x549a3d,_0xa5ed5c,_0x1248b2){return new BPromise(function(_0x1b1a15,_0x335132){var _0x5e3313=_0x1248b2||client;return _0x5e3313[_0x38b3('0x23')](_0x2fe0cd,_0xa5ed5c)[_0x38b3('0x24')](function(_0x9b518c){logger['info'](_0x38b3('0x25'),_0x549a3d,_0x38b3('0x26'));logger[_0x38b3('0x27')](_0x38b3('0x28'),_0x549a3d,_0x38b3('0x26'),JSON['stringify'](_0x9b518c));if(_0x9b518c[_0x38b3('0x29')]){if(_0x9b518c[_0x38b3('0x29')][_0x38b3('0x2a')]===0x1f4){logger['error'](_0x38b3('0x25'),_0x549a3d,_0x9b518c[_0x38b3('0x29')][_0x38b3('0x2b')]);return _0x335132(_0x9b518c['error'][_0x38b3('0x2b')]);}logger[_0x38b3('0x29')](_0x38b3('0x25'),_0x549a3d,_0x9b518c[_0x38b3('0x29')][_0x38b3('0x2b')]);return _0x1b1a15(_0x9b518c[_0x38b3('0x29')][_0x38b3('0x2b')]);}else{logger[_0x38b3('0x2c')](_0x38b3('0x25'),_0x549a3d,_0x38b3('0x26'));_0x1b1a15(_0x9b518c[_0x38b3('0x2d')][_0x38b3('0x2b')]);}})[_0x38b3('0x2e')](function(_0x308ec1){logger[_0x38b3('0x29')](_0x38b3('0x25'),_0x549a3d,_0x308ec1);_0x335132(_0x308ec1);});});}function respondWithStatusCode(_0x276f76,_0x270729){_0x270729=_0x270729||0xcc;return function(_0x5375a5){if(_0x5375a5){return _0x276f76['sendStatus'](_0x270729);}return _0x276f76[_0x38b3('0x2f')](_0x270729)[_0x38b3('0x30')]();};}function respondWithResult(_0x311ff8,_0x1bde2d){_0x1bde2d=_0x1bde2d||0xc8;return function(_0x1f9e08){if(_0x1f9e08){return _0x311ff8['status'](_0x1bde2d)[_0x38b3('0x31')](_0x1f9e08);}};}function respondWithFilteredResult(_0x5e91cc,_0x261c44){return function(_0x40f775){if(_0x40f775){var _0xc9c7b3=typeof _0x261c44[_0x38b3('0x32')]===_0x38b3('0x33')&&typeof _0x261c44['limit']===_0x38b3('0x33');var _0x1c0c49=_0x40f775[_0x38b3('0x34')];var _0x491241=_0xc9c7b3?0x0:_0x261c44[_0x38b3('0x32')];var _0xd70ffa=_0xc9c7b3?_0x40f775[_0x38b3('0x34')]:_0x261c44[_0x38b3('0x32')]+_0x261c44[_0x38b3('0x35')];var _0x4b7e4a;if(_0xd70ffa>=_0x1c0c49){_0xd70ffa=_0x1c0c49;_0x4b7e4a=0xc8;}else{_0x4b7e4a=0xce;}_0x5e91cc[_0x38b3('0x2f')](_0x4b7e4a);return _0x5e91cc[_0x38b3('0x36')](_0x38b3('0x37'),_0x491241+'-'+_0xd70ffa+'/'+_0x1c0c49)[_0x38b3('0x31')](_0x40f775);}return null;};}function patchUpdates(_0x5e2564){return function(_0x5accba){try{jsonpatch[_0x38b3('0x38')](_0x5accba,_0x5e2564,!![]);}catch(_0x6d0e41){return BPromise['reject'](_0x6d0e41);}return _0x5accba[_0x38b3('0x39')]();};}function saveUpdates(_0x445e40,_0x3bacb6){return function(_0x204d5f){if(_0x204d5f){return _0x204d5f[_0x38b3('0x3a')](_0x445e40)[_0x38b3('0x24')](function(_0x3523c3){return _0x3523c3;});}return null;};}function removeEntity(_0x4d811a,_0x34e27c){return function(_0x4dbd5b){if(_0x4dbd5b){return _0x4dbd5b[_0x38b3('0x3b')]()[_0x38b3('0x24')](function(){_0x4d811a[_0x38b3('0x2f')](0xcc)[_0x38b3('0x30')]();});}};}function handleEntityNotFound(_0x2c09c7,_0x916465){return function(_0x5834bc){if(!_0x5834bc){_0x2c09c7['sendStatus'](0x194);}return _0x5834bc;};}function handleError(_0x393d5c,_0x56eb1e){_0x56eb1e=_0x56eb1e||0x1f4;return function(_0x28322d){logger[_0x38b3('0x29')](_0x28322d['stack']);if(_0x28322d['name']){delete _0x28322d[_0x38b3('0x3c')];}_0x393d5c[_0x38b3('0x2f')](_0x56eb1e)['send'](_0x28322d);};}exports['index']=function(_0x471487,_0x234beb){var _0x19645d={},_0x457c74={},_0x3509b2={'count':0x0,'rows':[]};var _0x11b5cb=_['map'](db[_0x38b3('0x3d')][_0x38b3('0x3e')],function(_0x428be9){return{'name':_0x428be9[_0x38b3('0x3f')],'type':_0x428be9[_0x38b3('0x40')][_0x38b3('0x41')]};});_0x457c74[_0x38b3('0x42')]=_[_0x38b3('0x43')](_0x11b5cb,'name');_0x457c74[_0x38b3('0x44')]=_[_0x38b3('0x45')](_0x471487['query']);_0x457c74[_0x38b3('0x46')]=_[_0x38b3('0x47')](_0x457c74[_0x38b3('0x42')],_0x457c74[_0x38b3('0x44')]);_0x19645d[_0x38b3('0x48')]=_[_0x38b3('0x47')](_0x457c74['model'],qs[_0x38b3('0x49')](_0x471487[_0x38b3('0x44')][_0x38b3('0x49')]));_0x19645d[_0x38b3('0x48')]=_0x19645d[_0x38b3('0x48')]['length']?_0x19645d['attributes']:_0x457c74[_0x38b3('0x42')];if(!_0x471487[_0x38b3('0x44')]['hasOwnProperty']('nolimit')){_0x19645d[_0x38b3('0x35')]=qs['limit'](_0x471487[_0x38b3('0x44')]['limit']);_0x19645d['offset']=qs[_0x38b3('0x32')](_0x471487[_0x38b3('0x44')]['offset']);}_0x19645d[_0x38b3('0x4a')]=qs[_0x38b3('0x4b')](_0x471487[_0x38b3('0x44')][_0x38b3('0x4b')]);_0x19645d['where']=qs[_0x38b3('0x46')](_['pick'](_0x471487[_0x38b3('0x44')],_0x457c74['filters']),_0x11b5cb);if(_0x471487['query'][_0x38b3('0x4c')]){_0x19645d[_0x38b3('0x4d')]=_[_0x38b3('0x4e')](_0x19645d['where'],{'$or':_['map'](_0x11b5cb,function(_0x21702d){if(_0x21702d[_0x38b3('0x40')]!==_0x38b3('0x4f')){var _0x243bb1={};_0x243bb1[_0x21702d[_0x38b3('0x3c')]]={'$like':'%'+_0x471487[_0x38b3('0x44')][_0x38b3('0x4c')]+'%'};return _0x243bb1;}})});}_0x19645d=_[_0x38b3('0x4e')]({},_0x19645d,_0x471487[_0x38b3('0x50')]);var _0x1f04e5={'where':_0x19645d['where']};return db[_0x38b3('0x3d')][_0x38b3('0x34')](_0x1f04e5)['then'](function(_0x15dfc8){_0x3509b2['count']=_0x15dfc8;if(_0x471487['query'][_0x38b3('0x51')]){_0x19645d[_0x38b3('0x52')]=[{'all':!![]}];}return db[_0x38b3('0x3d')][_0x38b3('0x53')](_0x19645d);})[_0x38b3('0x24')](function(_0x24cece){_0x3509b2[_0x38b3('0x54')]=_0x24cece;return _0x3509b2;})[_0x38b3('0x24')](respondWithFilteredResult(_0x234beb,_0x19645d))[_0x38b3('0x2e')](handleError(_0x234beb,null));};exports[_0x38b3('0x55')]=function(_0x250a5a,_0x384217){var _0x4e1c95={'raw':!![],'where':{'id':_0x250a5a[_0x38b3('0x56')]['id']}},_0x650713={};_0x650713['model']=_['keys'](db[_0x38b3('0x3d')][_0x38b3('0x3e')]);_0x650713[_0x38b3('0x44')]=_['keys'](_0x250a5a['query']);_0x650713['filters']=_[_0x38b3('0x47')](_0x650713[_0x38b3('0x42')],_0x650713[_0x38b3('0x44')]);_0x4e1c95[_0x38b3('0x48')]=_['intersection'](_0x650713['model'],qs[_0x38b3('0x49')](_0x250a5a['query']['fields']));_0x4e1c95[_0x38b3('0x48')]=_0x4e1c95[_0x38b3('0x48')][_0x38b3('0x57')]?_0x4e1c95[_0x38b3('0x48')]:_0x650713[_0x38b3('0x42')];if(_0x250a5a[_0x38b3('0x44')][_0x38b3('0x51')]){_0x4e1c95['include']=[{'all':!![]}];}_0x4e1c95=_['merge']({},_0x4e1c95,_0x250a5a['options']);return db[_0x38b3('0x3d')][_0x38b3('0x58')](_0x4e1c95)[_0x38b3('0x24')](handleEntityNotFound(_0x384217,null))['then'](respondWithResult(_0x384217,null))['catch'](handleError(_0x384217,null));};exports[_0x38b3('0x3a')]=function(_0x3635a3,_0x4226d9){if(_0x3635a3[_0x38b3('0x59')]['id']){delete _0x3635a3[_0x38b3('0x59')]['id'];}return db[_0x38b3('0x3d')][_0x38b3('0x58')]({'where':{'id':_0x3635a3['params']['id']}})[_0x38b3('0x24')](handleEntityNotFound(_0x4226d9,null))[_0x38b3('0x24')](saveUpdates(_0x3635a3[_0x38b3('0x59')],null))[_0x38b3('0x24')](respondWithResult(_0x4226d9,null))[_0x38b3('0x2e')](handleError(_0x4226d9,null));};exports[_0x38b3('0x3b')]=function(_0x7891d8,_0x5269d1){return db[_0x38b3('0x3d')][_0x38b3('0x58')]({'where':{'id':_0x7891d8['params']['id']}})[_0x38b3('0x24')](handleEntityNotFound(_0x5269d1,null))[_0x38b3('0x24')](removeEntity(_0x5269d1,null))[_0x38b3('0x2e')](handleError(_0x5269d1,null));};exports['describe']=function(_0x4fee83,_0x2631dd){return db[_0x38b3('0x3d')][_0x38b3('0x5a')]()[_0x38b3('0x24')](respondWithResult(_0x2631dd,null))['catch'](handleError(_0x2631dd,null));};exports[_0x38b3('0x5b')]=function(_0xe74308,_0x31c749){return db['MailMessage'][_0x38b3('0x5b')](_0xe74308[_0x38b3('0x59')])[_0x38b3('0x24')](function(_0x1ffe5a){if(_0x1ffe5a){if(_0x1ffe5a[_0x38b3('0x5c')]===_0x38b3('0x5d')&&!_0x1ffe5a[_0x38b3('0x5e')]){var _0x2b3264,_0x901d0b,_0x187289;if(_0xe74308[_0x38b3('0x59')]['to']){_0x901d0b=_0xe74308[_0x38b3('0x59')]['to'][_0x38b3('0x5f')](',')[0x0];}return db['MailAccount'][_0x38b3('0x60')]({'where':{'id':_0x1ffe5a[_0x38b3('0x61')]},'include':[{'model':db[_0x38b3('0x62')],'as':_0x38b3('0x63'),'include':[{'model':db[_0x38b3('0x64')],'as':'Contacts','where':{'email':_0x901d0b},'limit':0x1,'order':[[_0x38b3('0x65'),_0x38b3('0x66')]]}]},{'model':db['MailServerOut'],'as':_0x38b3('0x67'),'raw':!![]}]})[_0x38b3('0x24')](function(_0x3a9e78){_0x2b3264=_0x3a9e78;if(_0x2b3264&&_0x2b3264[_0x38b3('0x67')]){var _0x37efc8={'tls':{'rejectUnauthorized':![]}};if(_[_0x38b3('0x68')](_0x2b3264[_0x38b3('0x67')][_0x38b3('0x69')])){_0x37efc8[_0x38b3('0x6a')]=_0x2b3264[_0x38b3('0x67')][_0x38b3('0x6a')];_0x37efc8[_0x38b3('0x6b')]=_0x2b3264[_0x38b3('0x67')]['port'];_0x37efc8[_0x38b3('0x6c')]=_0x2b3264[_0x38b3('0x67')][_0x38b3('0x6c')];if(_0x2b3264[_0x38b3('0x67')][_0x38b3('0x6d')]){_0x37efc8[_0x38b3('0x6e')]={'user':_0x2b3264[_0x38b3('0x67')][_0x38b3('0x6f')],'pass':_0x2b3264[_0x38b3('0x67')][_0x38b3('0x70')]};}}else{_0x37efc8[_0x38b3('0x69')]=_0x2b3264[_0x38b3('0x67')][_0x38b3('0x69')];_0x37efc8[_0x38b3('0x6e')]={'user':_0x2b3264['Smtp'][_0x38b3('0x6f')],'pass':_0x2b3264['Smtp'][_0x38b3('0x70')]};_0x37efc8[_0x38b3('0x6c')]=_0x2b3264[_0x38b3('0x67')][_0x38b3('0x6c')];}if(_0xe74308[_0x38b3('0x59')][_0x38b3('0x71')]&&_0xe74308[_0x38b3('0x59')][_0x38b3('0x71')][_0x38b3('0x57')]){for(var _0x4ea734=0x0;_0x4ea734<_0xe74308['body'][_0x38b3('0x71')][_0x38b3('0x57')];_0x4ea734+=0x1){_0xe74308['body'][_0x38b3('0x71')][_0x4ea734]={'filename':_0xe74308[_0x38b3('0x59')][_0x38b3('0x71')][_0x4ea734][_0x38b3('0x3c')],'path':path['join'](config[_0x38b3('0x72')],_0x38b3('0x73'),_0xe74308['body'][_0x38b3('0x71')][_0x4ea734][_0x38b3('0x74')])};}}_0x187289={'account':_0x37efc8,'message':_0xe74308[_0x38b3('0x59')]};return;}})[_0x38b3('0x24')](function(){if(_0x2b3264[_0x38b3('0x63')]){if(_0x2b3264[_0x38b3('0x63')]['Contacts'][_0x38b3('0x57')]){return _0x2b3264[_0x38b3('0x63')][_0x38b3('0x75')][0x0];}else{return db[_0x38b3('0x64')][_0x38b3('0x5b')](_[_0x38b3('0x1d')](_0xe74308['body'],{'firstName':_0xe74308[_0x38b3('0x59')]['to'],'email':_0xe74308['body']['to'],'phone':_0xe74308[_0x38b3('0x59')]['to'],'ListId':_0x2b3264[_0x38b3('0x76')]}));}}else{throw new Error(_0x38b3('0x77'));}})['then'](function(){if(_0x187289){return respondWithRpcPromise('SendMail',_0x38b3('0x78'),_0x187289,client9003)['then'](function(_0x266e09){return _0x1ffe5a['update']({'read':!![],'messageId':_0x266e09['messageId'],'sentAt':moment()['format'](_0x38b3('0x79'))});})[_0x38b3('0x2e')](function(_0x2a3645){logger[_0x38b3('0x29')]('%s',JSON[_0x38b3('0x7a')](_0x2a3645));return _0x1ffe5a;});}return _0x1ffe5a;});}return _0x1ffe5a;}})[_0x38b3('0x24')](respondWithResult(_0x31c749,0xc9))['catch'](handleError(_0x31c749,null));};var interaction_log=require(_0x38b3('0x16'))(_0x38b3('0x7b'));exports[_0x38b3('0x7c')]=function(_0x5485ae,_0x4ba1fe,_0x55301b){var _0x57dd4f={'agent':{},'channel':_0x38b3('0x7d')};if(_0x5485ae[_0x38b3('0x59')]['id']){delete _0x5485ae[_0x38b3('0x59')]['id'];}_0x5485ae[_0x38b3('0x59')][_0x38b3('0x7e')]=!![];_0x5485ae['body'][_0x38b3('0x7f')]=moment()[_0x38b3('0x80')](_0x38b3('0x79'));_0x5485ae['body'][_0x38b3('0x81')]=_0x5485ae[_0x38b3('0x59')][_0x38b3('0x81')]||_0x5485ae[_0x38b3('0x6f')]['id'];_0x57dd4f[_0x38b3('0x82')]['id']=_0x5485ae['body']['UserId'];return db['MailMessage'][_0x38b3('0x58')]({'where':{'id':_0x5485ae['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4ba1fe,null))[_0x38b3('0x24')](saveUpdates(_0x5485ae[_0x38b3('0x59')],null))[_0x38b3('0x24')](function(_0x226543){if(_0x226543){_0x57dd4f[_0x38b3('0x2b')]=_0x226543['get']({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x226543['MailInteractionId']}});}return null;})[_0x38b3('0x24')](handleEntityNotFound(_0x4ba1fe,null))[_0x38b3('0x24')](function(_0x3c3b08){if(_0x3c3b08){return _0x3c3b08[_0x38b3('0x3a')]({'UserId':_0x5485ae[_0x38b3('0x59')][_0x38b3('0x81')],'read1stAt':_[_0x38b3('0x68')](_0x3c3b08[_0x38b3('0x83')])?moment()[_0x38b3('0x80')](_0x38b3('0x79')):undefined});}return null;})[_0x38b3('0x24')](function(_0x2e2d66){if(_0x2e2d66){_0x57dd4f['interaction']=_0x2e2d66[_0x38b3('0x84')]({'plain':!![]});interaction_log[_0x38b3('0x2c')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5485ae['user']['id'],_0x5485ae[_0x38b3('0x6f')][_0x38b3('0x3c')],_0x5485ae[_0x38b3('0x6f')]['role'],_0x57dd4f[_0x38b3('0x85')]['id'],_0x5485ae[_0x38b3('0x59')]?JSON[_0x38b3('0x7a')](_0x5485ae[_0x38b3('0x59')]):'null');return respondWithRpcPromise(_0x38b3('0x86'),'acceptMessage',_0x57dd4f);}return null;})[_0x38b3('0x24')](function(_0x52c918){var _0x2c6b0b=_0x38b3('0x87')+_0x52c918[_0x38b3('0x2b')][_0x38b3('0x88')];return db['sequelize'][_0x38b3('0x44')](_0x2c6b0b,{'type':db[_0x38b3('0x89')][_0x38b3('0x8a')]['SELECT'],'raw':!![]})[_0x38b3('0x24')](function(_0x46b651){return _0x46b651;});})[_0x38b3('0x24')](function(_0x4f8b29){if(_0x4f8b29){_0x57dd4f[_0x38b3('0x2b')][_0x38b3('0x8b')]=_0x4f8b29[0x0];if(!_0x5485ae[_0x38b3('0x59')][_0x38b3('0x81')])return;return db[_0x38b3('0x8c')][_0x38b3('0x58')]({'where':{'id':_0x5485ae[_0x38b3('0x59')][_0x38b3('0x81')],'role':_0x38b3('0x82')},'attributes':['id',_0x38b3('0x3c'),_0x38b3('0x8d'),'email','internal'],'raw':!![]});}return null;})[_0x38b3('0x24')](function(_0xe9f428){if(!_0xe9f428)return null;_0x57dd4f[_0x38b3('0x2b')][_0x38b3('0x82')]=_0xe9f428;return _0x57dd4f;})[_0x38b3('0x24')](function(_0x434a16){if(_0x434a16){if(_0x5485ae[_0x38b3('0x59')][_0x38b3('0x8e')]){_0x57dd4f[_0x38b3('0x2b')]['interface']=util[_0x38b3('0x80')](_0x38b3('0x8f'),_0x5485ae['user'][_0x38b3('0x3c')]);_0x57dd4f[_0x38b3('0x2b')][_0x38b3('0x90')]=_0x57dd4f['channel'];_0x57dd4f[_0x38b3('0x2b')][_0x38b3('0x91')]=_0x38b3('0x7c');_0x57dd4f['message']['body']=htmlToText[_0x38b3('0x92')](_0x57dd4f['message']['body']);return respondWithRpcPromise(_0x38b3('0x93'),_0x38b3('0x93'),{'event':_0x38b3('0x94'),'message':_0x57dd4f[_0x38b3('0x2b')]},client9002)[_0x38b3('0x24')](function(){return _0x57dd4f;});}return _0x57dd4f;}return null;})[_0x38b3('0x24')](respondWithResult(_0x4ba1fe,null))['catch'](handleError(_0x4ba1fe,null));};var interaction_log=require(_0x38b3('0x16'))(_0x38b3('0x7b'));exports[_0x38b3('0x95')]=function(_0x49ff5d,_0x4de670,_0x3b4e0f){var _0x406c4b={'agent':{},'channel':'mail'};if(_0x49ff5d[_0x38b3('0x59')]['id']){delete _0x49ff5d[_0x38b3('0x59')]['id'];}_0x49ff5d[_0x38b3('0x59')][_0x38b3('0x81')]=_0x49ff5d['body'][_0x38b3('0x81')]||_0x49ff5d['user']['id'];_0x406c4b['agent']['id']=_0x49ff5d[_0x38b3('0x59')][_0x38b3('0x81')];return db[_0x38b3('0x3d')][_0x38b3('0x58')]({'where':{'id':_0x49ff5d[_0x38b3('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4de670,null))[_0x38b3('0x24')](function(_0x17dde1){if(_0x17dde1){_0x406c4b[_0x38b3('0x2b')]=_0x17dde1[_0x38b3('0x84')]({'plain':!![]});return db[_0x38b3('0x96')][_0x38b3('0x58')]({'where':{'id':_0x17dde1[_0x38b3('0x97')]}});}return null;})['then'](handleEntityNotFound(_0x4de670,null))['then'](function(_0x5cb5f3){if(_0x5cb5f3){_0x406c4b[_0x38b3('0x85')]=_0x5cb5f3[_0x38b3('0x84')]({'plain':!![]});interaction_log['info'](_0x38b3('0x98'),_0x49ff5d[_0x38b3('0x6f')]['id'],_0x49ff5d[_0x38b3('0x6f')][_0x38b3('0x3c')],_0x49ff5d['user'][_0x38b3('0x99')],_0x406c4b[_0x38b3('0x85')]['id'],_0x49ff5d[_0x38b3('0x59')]?JSON['stringify'](_0x49ff5d[_0x38b3('0x59')]):_0x38b3('0x9a'));return respondWithRpcPromise(_0x38b3('0x9b'),_0x38b3('0x9c'),_0x406c4b);}return null;})[_0x38b3('0x24')](function(_0x11e2c7){var _0xd048e=_0x38b3('0x87')+_0x11e2c7[_0x38b3('0x2b')][_0x38b3('0x88')];return db[_0x38b3('0x9d')][_0x38b3('0x44')](_0xd048e,{'type':db[_0x38b3('0x89')][_0x38b3('0x8a')][_0x38b3('0x9e')],'raw':!![]})[_0x38b3('0x24')](function(_0xbba3f6){return _0xbba3f6;});})[_0x38b3('0x24')](function(_0x3a8a3b){if(_0x3a8a3b){_0x406c4b[_0x38b3('0x2b')]['contact']=_0x3a8a3b[0x0];if(!_0x49ff5d['body'][_0x38b3('0x81')])return;return db[_0x38b3('0x8c')]['find']({'where':{'id':_0x49ff5d[_0x38b3('0x59')][_0x38b3('0x81')],'role':_0x38b3('0x82')},'attributes':['id',_0x38b3('0x3c'),_0x38b3('0x8d'),'email','internal'],'raw':!![]});}return null;})[_0x38b3('0x24')](function(_0x1d579f){if(!_0x1d579f)return null;_0x406c4b[_0x38b3('0x2b')]['agent']=_0x1d579f;return _0x406c4b;})[_0x38b3('0x24')](function(_0x3f72b1){if(_0x3f72b1){_0x3f72b1[_0x38b3('0x2b')][_0x38b3('0x9f')]=util[_0x38b3('0x80')](_0x38b3('0x8f'),_0x49ff5d[_0x38b3('0x6f')][_0x38b3('0x3c')]);_0x3f72b1['message']['channel']=_0x406c4b[_0x38b3('0x90')];_0x3f72b1[_0x38b3('0x2b')]['event']=_0x38b3('0x95');_0x3f72b1['message'][_0x38b3('0x59')]=htmlToText[_0x38b3('0x92')](_0x406c4b[_0x38b3('0x2b')][_0x38b3('0x59')]);respondWithRpcPromise(_0x38b3('0x93'),_0x38b3('0x93'),{'event':_0x38b3('0xa0'),'message':_0x3f72b1[_0x38b3('0x2b')]},client9002);return _0x406c4b;}return null;})[_0x38b3('0x24')](respondWithResult(_0x4de670,null))[_0x38b3('0x2e')](handleError(_0x4de670,null));};exports[_0x38b3('0xa1')]=function(_0x45ab16,_0x1b205a){var _0x32b3f4=moment()['unix']()[_0x38b3('0xa2')]();var _0x57ea73=path[_0x38b3('0xa3')](config['root'],_0x38b3('0xa4'),_0x38b3('0xa5'),'tmp');var _0x12e33a=path[_0x38b3('0xa3')](config[_0x38b3('0x72')],_0x38b3('0xa4'),_0x38b3('0xa5'),'attachments');var _0x1c5bf7=util[_0x38b3('0x80')](_0x38b3('0xa6'),_0x32b3f4);return db[_0x38b3('0x3d')][_0x38b3('0x58')]({'where':{'id':_0x45ab16[_0x38b3('0x56')]['id']},'attributes':['id',_0x38b3('0x59'),_0x38b3('0xa7'),'to','cc',_0x38b3('0xa8'),_0x38b3('0xa9'),_0x38b3('0xaa')],'include':_0x45ab16[_0x38b3('0x44')]['attachments']?[{'model':db['Attachment'],'as':_0x38b3('0xab')}]:undefined})['then'](handleEntityNotFound(_0x1b205a,null))[_0x38b3('0x24')](function(_0x4623c2){if(_0x4623c2){var _0x37e088=_0x4623c2;var _0x1bf1f8={'from':_0x37e088[_0x38b3('0xa7')],'to':_0x37e088['to'],'subject':_0x37e088[_0x38b3('0xa9')],'html':_0x37e088['body'],'headers':{'Date':moment(_0x37e088[_0x38b3('0xaa')])[_0x38b3('0x80')](_0x38b3('0xac'))},'attachments':[]};if(_0x4623c2['cc']){_0x1bf1f8['headers']['Cc']=_0x4623c2['cc'];}if(_0x4623c2[_0x38b3('0xa8')]){_0x1bf1f8[_0x38b3('0xad')][_0x38b3('0xae')]=_0x4623c2[_0x38b3('0xa8')];}return new BPromise(function(_0x2b0cd1,_0x56892c){if(_0x4623c2['Attachments']){for(var _0x33744f=0x0;_0x33744f<_0x4623c2[_0x38b3('0xab')][_0x38b3('0x57')];_0x33744f++){var _0x2db84a=_0x4623c2[_0x38b3('0xab')][_0x33744f];var _0x14a4d4=path[_0x38b3('0xa3')](_0x12e33a,_0x2db84a[_0x38b3('0x74')]);if(fs[_0x38b3('0xaf')](_0x14a4d4)){_0x1bf1f8[_0x38b3('0x71')][_0x38b3('0xb0')]({'name':_0x2db84a[_0x38b3('0x3c')],'contentType':_0x2db84a[_0x38b3('0x40')],'data':fs['readFileSync'](_0x14a4d4)});}}}emlformat[_0x38b3('0xb1')](_0x1bf1f8,function(_0x2365a4,_0x31b0a5){if(_0x2365a4)return _0x56892c(_0x2365a4);fs[_0x38b3('0xb2')](path[_0x38b3('0xa3')](_0x57ea73,_0x1c5bf7),_0x31b0a5);return _0x2b0cd1(_0x31b0a5);});});}})[_0x38b3('0x24')](function(_0x59ed86){if(_0x59ed86){return _0x1b205a[_0x38b3('0xa1')](path['join'](_0x57ea73,_0x1c5bf7),_0x1c5bf7,function(_0x29c9b6){if(_0x29c9b6){console[_0x38b3('0xb3')](_0x38b3('0xb4'),_0x29c9b6);}else{fs[_0x38b3('0xb5')](path[_0x38b3('0xa3')](_0x57ea73,_0x1c5bf7));}});}})[_0x38b3('0x2e')](handleError(_0x1b205a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 7c8ef3d..e7e92ad 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 _0xd251=['save','update','remove','emit','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x5b1873,_0x14441e){var _0x22a214=function(_0x47cc99){while(--_0x47cc99){_0x5b1873['push'](_0x5b1873['shift']());}};_0x22a214(++_0x14441e);}(_0xd251,0x1ec));var _0x1d25=function(_0x4ac6c5,_0x232988){_0x4ac6c5=_0x4ac6c5-0x0;var _0x410f9c=_0xd251[_0x4ac6c5];return _0x410f9c;};'use strict';var EventEmitter=require(_0x1d25('0x0'));var MailMessage=require(_0x1d25('0x1'))['db'][_0x1d25('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d25('0x3'),'afterUpdate':_0x1d25('0x4'),'afterDestroy':_0x1d25('0x5')};function emitEvent(_0x51b462){return function(_0xc77ae2,_0x8984a2,_0x26060f){MailMessageEvents[_0x1d25('0x6')](_0x51b462+':'+_0xc77ae2['id'],_0xc77ae2);MailMessageEvents[_0x1d25('0x6')](_0x51b462,_0xc77ae2);_0x26060f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x1d25('0x7')](e,emitEvent(event));}}module[_0x1d25('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xb07c=['hook','exports','events','../../mysqldb','MailMessage','save','update','emit','hasOwnProperty'];(function(_0x26bafe,_0x13e506){var _0x307879=function(_0x5a1548){while(--_0x5a1548){_0x26bafe['push'](_0x26bafe['shift']());}};_0x307879(++_0x13e506);}(_0xb07c,0x18e));var _0xcb07=function(_0x22206d,_0x4a4db8){_0x22206d=_0x22206d-0x0;var _0x4be8b=_0xb07c[_0x22206d];return _0x4be8b;};'use strict';var EventEmitter=require(_0xcb07('0x0'));var MailMessage=require(_0xcb07('0x1'))['db'][_0xcb07('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb07('0x3'),'afterUpdate':_0xcb07('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46d356){return function(_0x21e2d8,_0x5bb4d2,_0x364507){MailMessageEvents[_0xcb07('0x5')](_0x46d356+':'+_0x21e2d8['id'],_0x21e2d8);MailMessageEvents[_0xcb07('0x5')](_0x46d356,_0x21e2d8);_0x364507(null);};}for(var e in events){if(events[_0xcb07('0x6')](e)){var event=events[e];MailMessage[_0xcb07('0x7')](e,emitEvent(event));}}module[_0xcb07('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 9546db8..b90182a 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 _0x6681=['define','MailMessage','mail_messages','messageId','plainBody','subject','body','get','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x2492e4,_0x3e7c56){var _0x2c5aef=function(_0x3f9404){while(--_0x3f9404){_0x2492e4['push'](_0x2492e4['shift']());}};_0x2c5aef(++_0x3e7c56);}(_0x6681,0x104));var _0x1668=function(_0x3fb2f3,_0x3352de){_0x3fb2f3=_0x3fb2f3-0x0;var _0x17edda=_0x6681[_0x3fb2f3];return _0x17edda;};'use strict';var _=require(_0x1668('0x0'));var util=require(_0x1668('0x1'));var logger=require(_0x1668('0x2'))(_0x1668('0x3'));var moment=require(_0x1668('0x4'));var BPromise=require(_0x1668('0x5'));var rp=require(_0x1668('0x6'));var htmlToText=require(_0x1668('0x7'));var fs=require('fs');var path=require(_0x1668('0x8'));var rimraf=require(_0x1668('0x9'));var config=require(_0x1668('0xa'));var attributes=require(_0x1668('0xb'));module['exports']=function(_0x2d576a,_0x458fa2){return _0x2d576a[_0x1668('0xc')](_0x1668('0xd'),attributes,{'tableName':_0x1668('0xe'),'paranoid':![],'indexes':[{'name':_0x1668('0xf'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x1668('0x10'),_0x1668('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x129c59,_0x5c8e1a,_0xb569b8){if(_0x129c59[_0x1668('0x12')]){_0x129c59[_0x1668('0x10')]=htmlToText['fromString'](_0x129c59[_0x1668('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xb569b8(null,_0x5c8e1a);},'afterCreate':function(_0x1f1271,_0x22823f,_0x507e49){var _0x56d78e=_0x2d576a['models'];var _0x33f856=_0x1f1271[_0x1668('0x13')]({'plain':!![]});if(_0x33f856[_0x1668('0x14')][_0x1668('0x15')]()==='in'||_0x33f856['direction'][_0x1668('0x15')]()===_0x1668('0x16')&&!_0x33f856[_0x1668('0x17')]&&!_[_0x1668('0x18')](_0x33f856['UserId'])){_0x56d78e[_0x1668('0x19')]['findOne']({'where':{'id':_0x33f856[_0x1668('0x1a')]}})[_0x1668('0x1b')](function(_0x277caf){if(_0x277caf){_0x277caf[_0x1668('0x1c')]({'lastMsgAt':_0x33f856[_0x1668('0x1d')],'lastMsgDirection':_0x33f856[_0x1668('0x14')]['toLowerCase']()});}})[_0x1668('0x1e')](function(_0x1c8abc){console[_0x1668('0x1f')](_0x1c8abc);});}_0x507e49();}},'charset':_0x1668('0x20'),'collate':_0x1668('0x21')});}; \ No newline at end of file +var _0x264a=['html-to-text','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x739b82,_0x5cbf46){var _0x56748b=function(_0x5d49b0){while(--_0x5d49b0){_0x739b82['push'](_0x739b82['shift']());}};_0x56748b(++_0x5cbf46);}(_0x264a,0x11a));var _0xa264=function(_0x11ad32,_0x279ebc){_0x11ad32=_0x11ad32-0x0;var _0x53afbf=_0x264a[_0x11ad32];return _0x53afbf;};'use strict';var _=require(_0xa264('0x0'));var util=require(_0xa264('0x1'));var logger=require(_0xa264('0x2'))('api');var moment=require(_0xa264('0x3'));var BPromise=require(_0xa264('0x4'));var rp=require(_0xa264('0x5'));var htmlToText=require(_0xa264('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa264('0x7'));var attributes=require(_0xa264('0x8'));module[_0xa264('0x9')]=function(_0x2ea495,_0x149628){return _0x2ea495[_0xa264('0xa')]('MailMessage',attributes,{'tableName':_0xa264('0xb'),'paranoid':![],'indexes':[{'name':_0xa264('0xc'),'fields':[_0xa264('0xc')]},{'name':_0xa264('0xd'),'fields':[_0xa264('0xe'),_0xa264('0xf')],'type':_0xa264('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x199d9f,_0x14d7c7,_0x4c2311){if(_0x199d9f[_0xa264('0x11')]){_0x199d9f[_0xa264('0xe')]=htmlToText[_0xa264('0x12')](_0x199d9f['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c2311(null,_0x14d7c7);},'afterCreate':function(_0x3348aa,_0xa86af5,_0x8f029a){var _0x4c2764=_0x2ea495[_0xa264('0x13')];var _0x44726c=_0x3348aa['get']({'plain':!![]});if(_0x44726c['direction'][_0xa264('0x14')]()==='in'||_0x44726c[_0xa264('0x15')][_0xa264('0x14')]()===_0xa264('0x16')&&!_0x44726c[_0xa264('0x17')]&&!_[_0xa264('0x18')](_0x44726c[_0xa264('0x19')])){_0x4c2764[_0xa264('0x1a')]['findOne']({'where':{'id':_0x44726c[_0xa264('0x1b')]}})['then'](function(_0x2f1627){if(_0x2f1627){_0x2f1627[_0xa264('0x1c')]({'lastMsgAt':_0x44726c['createdAt'],'lastMsgDirection':_0x44726c['direction'][_0xa264('0x14')]()});}})[_0xa264('0x1d')](function(_0x5f0d57){console['error'](_0x5f0d57);});}_0x8f029a();}},'charset':_0xa264('0x1e'),'collate':_0xa264('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a168693..b20eddd 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 _0x8952=['error','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','stringify','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8952,0x17e));var _0x2895=function(_0x3a3d43,_0x29416e){_0x3a3d43=_0x3a3d43-0x0;var _0x173874=_0x8952[_0x3a3d43];return _0x173874;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}exports['CreateMailMessage']=function(_0x493851){var _0x442cfa=this;return new Promise(function(_0x12c2fb,_0x3ec4da){return db['MailMessage'][_0x2895('0x1a')](_0x493851[_0x2895('0x1b')],{'raw':_0x493851[_0x2895('0x1c')]?_0x493851[_0x2895('0x1c')][_0x2895('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x30c6c3){logger[_0x2895('0x10')]('CreateMailMessage',_0x493851);logger[_0x2895('0x12')](_0x2895('0x1e'),_0x493851,JSON[_0x2895('0x13')](_0x30c6c3));_0x12c2fb(_0x30c6c3);})['catch'](function(_0x4e884f){logger[_0x2895('0x15')](_0x2895('0x1e'),_0x4e884f[_0x2895('0x16')],_0x493851);_0x3ec4da(_0x442cfa['error'](0x1f4,_0x4e884f[_0x2895('0x16')]));});});}; \ No newline at end of file +var _0x351d=['rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x36c568,_0xce2d20){var _0x1a7fc8=function(_0x49e476){while(--_0x49e476){_0x36c568['push'](_0x36c568['shift']());}};_0x1a7fc8(++_0xce2d20);}(_0x351d,0x90));var _0xd351=function(_0x595c30,_0x311a5f){_0x595c30=_0x595c30-0x0;var _0x4793d9=_0x351d[_0x595c30];return _0x4793d9;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});config['redis']=_[_0xd351('0xa')](config[_0xd351('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd351('0xc'))(new Redis(config[_0xd351('0xb')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x44bf81,_0x4904b4,_0x34cfc7){return new BPromise(function(_0x39b8c8,_0x5949a4){return client[_0xd351('0xd')](_0x44bf81,_0x34cfc7)[_0xd351('0xe')](function(_0x4ebca1){logger[_0xd351('0xf')]('MailMessage,\x20%s,\x20%s',_0x4904b4,'request\x20sent');logger[_0xd351('0x10')](_0xd351('0x11'),_0x4904b4,_0xd351('0x12'),JSON[_0xd351('0x13')](_0x4ebca1));if(_0x4ebca1['error']){if(_0x4ebca1[_0xd351('0x14')][_0xd351('0x15')]===0x1f4){logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);return _0x5949a4(_0x4ebca1[_0xd351('0x14')][_0xd351('0x17')]);}logger['error'](_0xd351('0x16'),_0x4904b4,_0x4ebca1['error']['message']);return _0x39b8c8(_0x4ebca1[_0xd351('0x14')]['message']);}else{logger[_0xd351('0xf')](_0xd351('0x16'),_0x4904b4,_0xd351('0x12'));_0x39b8c8(_0x4ebca1['result'][_0xd351('0x17')]);}})[_0xd351('0x18')](function(_0x77985a){logger[_0xd351('0x14')]('MailMessage,\x20%s,\x20%s',_0x4904b4,_0x77985a);_0x5949a4(_0x77985a);});});}exports[_0xd351('0x19')]=function(_0x4abbed){var _0x48fa9b=this;return new Promise(function(_0x37d3ac,_0x4a427b){return db[_0xd351('0x1a')][_0xd351('0x1b')](_0x4abbed[_0xd351('0x1c')],{'raw':_0x4abbed[_0xd351('0x1d')]?_0x4abbed[_0xd351('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xd351('0xe')](function(_0xbbc58){logger[_0xd351('0xf')]('CreateMailMessage',_0x4abbed);logger[_0xd351('0x10')](_0xd351('0x19'),_0x4abbed,JSON[_0xd351('0x13')](_0xbbc58));_0x37d3ac(_0xbbc58);})['catch'](function(_0x1ce279){logger[_0xd351('0x14')](_0xd351('0x19'),_0x1ce279[_0xd351('0x17')],_0x4abbed);_0x4a427b(_0x48fa9b['error'](0x1f4,_0x1ce279[_0xd351('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f9d95e5..4f99f95 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 _0xe233=['update','emit','removeListener','length','mailMessage:','./mailMessage.events'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xe233,0x15b));var _0x3e23=function(_0x1d3b8b,_0x17afa1){_0x1d3b8b=_0x1d3b8b-0x0;var _0x1fbfbe=_0xe233[_0x1d3b8b];return _0x1fbfbe;};'use strict';var MailMessageEvents=require(_0x3e23('0x0'));var events=['save','remove',_0x3e23('0x1')];function createListener(_0x4a6d67,_0x553d8f){return function(_0x17723c){_0x553d8f[_0x3e23('0x2')](_0x4a6d67,_0x17723c);};}function removeListener(_0xc5dc74,_0x31c424){return function(){MailMessageEvents[_0x3e23('0x3')](_0xc5dc74,_0x31c424);};}exports['register']=function(_0x45ac90){for(var _0x37f31d=0x0,_0x391d80=events[_0x3e23('0x4')];_0x37f31d<_0x391d80;_0x37f31d++){var _0x3d0631=events[_0x37f31d];var _0xec43a3=createListener(_0x3e23('0x5')+_0x3d0631,_0x45ac90);MailMessageEvents['on'](_0x3d0631,_0xec43a3);}}; \ No newline at end of file +var _0xc459=['emit','register','length','save','update'];(function(_0x54d718,_0x3c3419){var _0x28def1=function(_0x3d0cf7){while(--_0x3d0cf7){_0x54d718['push'](_0x54d718['shift']());}};_0x28def1(++_0x3c3419);}(_0xc459,0x1d9));var _0x9c45=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc459[_0x14add3];return _0x4a174f;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x9c45('0x0'),'remove',_0x9c45('0x1')];function createListener(_0x48c580,_0x343072){return function(_0x11fa4d){_0x343072[_0x9c45('0x2')](_0x48c580,_0x11fa4d);};}function removeListener(_0x112caf,_0x191979){return function(){MailMessageEvents['removeListener'](_0x112caf,_0x191979);};}exports[_0x9c45('0x3')]=function(_0x3fcb9f){for(var _0x4ae79d=0x0,_0x7189fc=events[_0x9c45('0x4')];_0x4ae79d<_0x7189fc;_0x4ae79d++){var _0x587b23=events[_0x4ae79d];var _0x2dd755=createListener('mailMessage:'+_0x587b23,_0x3fcb9f);MailMessageEvents['on'](_0x587b23,_0x2dd755);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 605babd..d37c438 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 _0xbab5=['../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x556bc5,_0x99f9ad){var _0x3c70e7=function(_0x599bf7){while(--_0x599bf7){_0x556bc5['push'](_0x556bc5['shift']());}};_0x3c70e7(++_0x99f9ad);}(_0xbab5,0x1c8));var _0x5bab=function(_0x2a9f4f,_0x464211){_0x2a9f4f=_0x2a9f4f-0x0;var _0x5ee769=_0xbab5[_0x2a9f4f];return _0x5ee769;};'use strict';var multer=require(_0x5bab('0x0'));var util=require(_0x5bab('0x1'));var path=require(_0x5bab('0x2'));var timeout=require('connect-timeout');var express=require(_0x5bab('0x3'));var router=express[_0x5bab('0x4')]();var fs_extra=require(_0x5bab('0x5'));var auth=require(_0x5bab('0x6'));var interaction=require(_0x5bab('0x7'));var config=require(_0x5bab('0x8'));var controller=require(_0x5bab('0x9'));router[_0x5bab('0xa')]('/',auth[_0x5bab('0xb')](),controller['index']);router['get'](_0x5bab('0xc'),auth[_0x5bab('0xb')](),controller[_0x5bab('0xd')]);router[_0x5bab('0xa')]('/:id',auth[_0x5bab('0xb')](),controller[_0x5bab('0xe')]);router[_0x5bab('0xa')](_0x5bab('0xf'),auth['isAuthenticated'](),controller[_0x5bab('0x10')]);router[_0x5bab('0xa')](_0x5bab('0x11'),auth['isAuthenticated'](),controller[_0x5bab('0x12')]);router[_0x5bab('0xa')](_0x5bab('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5bab('0x14')]('/',auth[_0x5bab('0xb')](),controller['create']);router[_0x5bab('0x14')](_0x5bab('0x11'),auth[_0x5bab('0xb')](),controller[_0x5bab('0x15')]);router['post'](_0x5bab('0x13'),auth['isAuthenticated'](),controller[_0x5bab('0x16')]);router[_0x5bab('0x17')](_0x5bab('0x18'),auth['isAuthenticated'](),controller[_0x5bab('0x19')]);router[_0x5bab('0x1a')](_0x5bab('0x18'),auth['isAuthenticated'](),controller[_0x5bab('0x1b')]);router['delete'](_0x5bab('0x11'),auth[_0x5bab('0xb')](),controller['removeTeams']);router[_0x5bab('0x1a')](_0x5bab('0x13'),auth['isAuthenticated'](),controller[_0x5bab('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x0ca8=['../../components/interaction/service','../../config/environment','./mailQueue.controller','get','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x36cd9d,_0xa1d2f3){var _0x2d8717=function(_0x520a1a){while(--_0x520a1a){_0x36cd9d['push'](_0x36cd9d['shift']());}};_0x2d8717(++_0xa1d2f3);}(_0x0ca8,0xcc));var _0x80ca=function(_0x3402de,_0x250088){_0x3402de=_0x3402de-0x0;var _0x229140=_0x0ca8[_0x3402de];return _0x229140;};'use strict';var multer=require(_0x80ca('0x0'));var util=require('util');var path=require(_0x80ca('0x1'));var timeout=require('connect-timeout');var express=require(_0x80ca('0x2'));var router=express[_0x80ca('0x3')]();var fs_extra=require(_0x80ca('0x4'));var auth=require(_0x80ca('0x5'));var interaction=require(_0x80ca('0x6'));var config=require(_0x80ca('0x7'));var controller=require(_0x80ca('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x80ca('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x80ca('0xa')]);router[_0x80ca('0x9')](_0x80ca('0xb'),auth[_0x80ca('0xc')](),controller[_0x80ca('0xd')]);router[_0x80ca('0x9')](_0x80ca('0xe'),auth[_0x80ca('0xc')](),controller[_0x80ca('0xf')]);router['get'](_0x80ca('0x10'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x11')]);router['get'](_0x80ca('0x12'),auth[_0x80ca('0xc')](),controller['getAgents']);router[_0x80ca('0x13')]('/',auth['isAuthenticated'](),controller[_0x80ca('0x14')]);router[_0x80ca('0x13')](_0x80ca('0x10'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x15')]);router['post'](_0x80ca('0x12'),auth['isAuthenticated'](),controller[_0x80ca('0x16')]);router[_0x80ca('0x17')]('/:id',auth[_0x80ca('0xc')](),controller[_0x80ca('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x80ca('0x19')]);router[_0x80ca('0x1a')]('/:id/teams',auth[_0x80ca('0xc')](),controller[_0x80ca('0x1b')]);router['delete'](_0x80ca('0x12'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x1c')]);module[_0x80ca('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8beccfd..ddbdf64 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 _0x5662=['name','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x1fc735,_0x11db60){var _0x574095=function(_0x421590){while(--_0x421590){_0x1fc735['push'](_0x1fc735['shift']());}};_0x574095(++_0x11db60);}(_0x5662,0x184));var _0x2566=function(_0x52c3e8,_0x3b2ed3){_0x52c3e8=_0x52c3e8-0x0;var _0x2bb2c4=_0x5662[_0x52c3e8];return _0x2bb2c4;};'use strict';var Sequelize=require(_0x2566('0x0'));module['exports']={'name':{'type':Sequelize[_0x2566('0x1')],'unique':_0x2566('0x2'),'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'](_0x2566('0x3'),_0x2566('0x4'),_0x2566('0x5'))}}; \ No newline at end of file +var _0xf24b=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0xf24b,0x1bc));var _0xbf24=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0xf24b[_0x5ec453];return _0x25548f;};'use strict';var Sequelize=require(_0xbf24('0x0'));module['exports']={'name':{'type':Sequelize[_0xbf24('0x1')],'unique':_0xbf24('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbf24('0x1')]},'timeout':{'type':Sequelize[_0xbf24('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbf24('0x4')](_0xbf24('0x5'),_0xbf24('0x6'),_0xbf24('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index a56941a..68bb386 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 _0x68f9=['getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','each','forEach','emit','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','length','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe'];(function(_0x2b55d4,_0x1ed1b2){var _0x304574=function(_0x3bdaa5){while(--_0x3bdaa5){_0x2b55d4['push'](_0x2b55d4['shift']());}};_0x304574(++_0x1ed1b2);}(_0x68f9,0xca));var _0x968f=function(_0xdc67c4,_0x1d9081){_0xdc67c4=_0xdc67c4-0x0;var _0x537e53=_0x68f9[_0xdc67c4];return _0x537e53;};'use strict';var emlformat=require(_0x968f('0x0'));var rimraf=require(_0x968f('0x1'));var zipdir=require(_0x968f('0x2'));var jsonpatch=require(_0x968f('0x3'));var rp=require(_0x968f('0x4'));var moment=require(_0x968f('0x5'));var BPromise=require(_0x968f('0x6'));var Mustache=require('mustache');var util=require(_0x968f('0x7'));var path=require(_0x968f('0x8'));var sox=require(_0x968f('0x9'));var csv=require(_0x968f('0xa'));var ejs=require(_0x968f('0xb'));var fs=require('fs');var fs_extra=require(_0x968f('0xc'));var _=require('lodash');var squel=require(_0x968f('0xd'));var crypto=require('crypto');var jsforce=require(_0x968f('0xe'));var deskjs=require(_0x968f('0xf'));var toCsv=require(_0x968f('0xa'));var querystring=require('querystring');var Papa=require(_0x968f('0x10'));var Redis=require(_0x968f('0x11'));var authService=require(_0x968f('0x12'));var qs=require(_0x968f('0x13'));var as=require(_0x968f('0x14'));var hardwareService=require(_0x968f('0x15'));var logger=require(_0x968f('0x16'))('api');var utils=require(_0x968f('0x17'));var config=require(_0x968f('0x18'));var licenseUtil=require(_0x968f('0x19'));var db=require('../../mysqldb')['db'];config[_0x968f('0x1a')]=_[_0x968f('0x1b')](config[_0x968f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x968f('0x1c'))(new Redis(config[_0x968f('0x1a')]));require(_0x968f('0x1d'))[_0x968f('0x1e')](socket);function respondWithStatusCode(_0x10ed20,_0x918542){_0x918542=_0x918542||0xcc;return function(_0x5a9f55){if(_0x5a9f55){return _0x10ed20[_0x968f('0x1f')](_0x918542);}return _0x10ed20[_0x968f('0x20')](_0x918542)[_0x968f('0x21')]();};}function respondWithResult(_0xfe4d2d,_0x559d2e){_0x559d2e=_0x559d2e||0xc8;return function(_0x10566a){if(_0x10566a){return _0xfe4d2d[_0x968f('0x20')](_0x559d2e)[_0x968f('0x22')](_0x10566a);}};}function respondWithFilteredResult(_0x53da1d,_0x5bcbab){return function(_0x47fd5d){if(_0x47fd5d){var _0x47621e=typeof _0x5bcbab[_0x968f('0x23')]===_0x968f('0x24')&&typeof _0x5bcbab[_0x968f('0x25')]===_0x968f('0x24');var _0x17f72a=_0x47fd5d[_0x968f('0x26')];var _0x26502d=_0x47621e?0x0:_0x5bcbab['offset'];var _0x22130a=_0x47621e?_0x47fd5d[_0x968f('0x26')]:_0x5bcbab[_0x968f('0x23')]+_0x5bcbab[_0x968f('0x25')];var _0x57c792;if(_0x22130a>=_0x17f72a){_0x22130a=_0x17f72a;_0x57c792=0xc8;}else{_0x57c792=0xce;}_0x53da1d[_0x968f('0x20')](_0x57c792);return _0x53da1d[_0x968f('0x27')](_0x968f('0x28'),_0x26502d+'-'+_0x22130a+'/'+_0x17f72a)[_0x968f('0x22')](_0x47fd5d);}return null;};}function patchUpdates(_0x1d4815){return function(_0x2c99d7){try{jsonpatch[_0x968f('0x29')](_0x2c99d7,_0x1d4815,!![]);}catch(_0x4baa10){return BPromise['reject'](_0x4baa10);}return _0x2c99d7['save']();};}function saveUpdates(_0x15e474,_0x5f6060){return function(_0x306dd5){if(_0x306dd5){return _0x306dd5[_0x968f('0x2a')](_0x15e474)[_0x968f('0x2b')](function(_0x53b5b5){return _0x53b5b5;});}return null;};}function removeEntity(_0x487380,_0x584ed6){return function(_0x223246){if(_0x223246){return _0x223246[_0x968f('0x2c')]()[_0x968f('0x2b')](function(){var _0x36546f=_0x223246[_0x968f('0x2d')]({'plain':!![]});var _0x4543e3=_0x968f('0x2e');return db[_0x968f('0x2f')][_0x968f('0x2c')]({'where':{'type':_0x4543e3,'resourceId':_0x36546f['id']}})[_0x968f('0x2b')](function(){return _0x223246;});})[_0x968f('0x2b')](function(){_0x487380[_0x968f('0x20')](0xcc)[_0x968f('0x21')]();});}};}function handleEntityNotFound(_0x1089b2,_0x236b04){return function(_0x75da85){if(!_0x75da85){_0x1089b2['sendStatus'](0x194);}return _0x75da85;};}function handleError(_0x509dc5,_0x4b26ab){_0x4b26ab=_0x4b26ab||0x1f4;return function(_0x5ee8a9){logger[_0x968f('0x30')](_0x5ee8a9[_0x968f('0x31')]);if(_0x5ee8a9[_0x968f('0x32')]){delete _0x5ee8a9[_0x968f('0x32')];}_0x509dc5[_0x968f('0x20')](_0x4b26ab)[_0x968f('0x33')](_0x5ee8a9);};}exports[_0x968f('0x34')]=function(_0x5b63b5,_0x472a06){var _0x10e2c2={},_0x4641e5={},_0x401e19={'count':0x0,'rows':[]};var _0x2fba1c=_[_0x968f('0x35')](db[_0x968f('0x36')]['rawAttributes'],function(_0x2f2eb1){return{'name':_0x2f2eb1['fieldName'],'type':_0x2f2eb1['type'][_0x968f('0x37')]};});_0x4641e5[_0x968f('0x38')]=_[_0x968f('0x35')](_0x2fba1c,_0x968f('0x32'));_0x4641e5[_0x968f('0x39')]=_['keys'](_0x5b63b5['query']);_0x4641e5[_0x968f('0x3a')]=_[_0x968f('0x3b')](_0x4641e5[_0x968f('0x38')],_0x4641e5[_0x968f('0x39')]);_0x10e2c2[_0x968f('0x3c')]=_['intersection'](_0x4641e5[_0x968f('0x38')],qs['fields'](_0x5b63b5[_0x968f('0x39')][_0x968f('0x3d')]));_0x10e2c2[_0x968f('0x3c')]=_0x10e2c2[_0x968f('0x3c')]['length']?_0x10e2c2[_0x968f('0x3c')]:_0x4641e5['model'];if(!_0x5b63b5[_0x968f('0x39')][_0x968f('0x3e')]('nolimit')){_0x10e2c2[_0x968f('0x25')]=qs['limit'](_0x5b63b5[_0x968f('0x39')][_0x968f('0x25')]);_0x10e2c2['offset']=qs['offset'](_0x5b63b5['query']['offset']);}_0x10e2c2[_0x968f('0x3f')]=qs[_0x968f('0x40')](_0x5b63b5['query']['sort']);_0x10e2c2[_0x968f('0x41')]=qs[_0x968f('0x3a')](_[_0x968f('0x42')](_0x5b63b5[_0x968f('0x39')],_0x4641e5[_0x968f('0x3a')]),_0x2fba1c);if(_0x5b63b5['query'][_0x968f('0x43')]){_0x10e2c2[_0x968f('0x41')]=_[_0x968f('0x44')](_0x10e2c2[_0x968f('0x41')],{'$or':_[_0x968f('0x35')](_0x2fba1c,function(_0x279f0d){if(_0x279f0d['type']!==_0x968f('0x45')){var _0x5aa649={};_0x5aa649[_0x279f0d[_0x968f('0x32')]]={'$like':'%'+_0x5b63b5[_0x968f('0x39')][_0x968f('0x43')]+'%'};return _0x5aa649;}})});}_0x10e2c2=_['merge']({},_0x10e2c2,_0x5b63b5['options']);var _0x1347e1={'where':_0x10e2c2[_0x968f('0x41')]};return db[_0x968f('0x36')]['count'](_0x1347e1)[_0x968f('0x2b')](function(_0x30e50c){_0x401e19['count']=_0x30e50c;if(_0x5b63b5[_0x968f('0x39')][_0x968f('0x46')]){_0x10e2c2[_0x968f('0x47')]=[{'all':!![]}];}return db[_0x968f('0x36')][_0x968f('0x48')](_0x10e2c2);})[_0x968f('0x2b')](function(_0x3ecb08){_0x401e19[_0x968f('0x49')]=_0x3ecb08;return _0x401e19;})[_0x968f('0x2b')](respondWithFilteredResult(_0x472a06,_0x10e2c2))['catch'](handleError(_0x472a06,null));};exports['show']=function(_0x17db81,_0x104348){var _0x4a07c3={'raw':!![],'where':{'id':_0x17db81[_0x968f('0x4a')]['id']}},_0x32e9f0={};_0x32e9f0[_0x968f('0x38')]=_[_0x968f('0x4b')](db[_0x968f('0x36')][_0x968f('0x4c')]);_0x32e9f0[_0x968f('0x39')]=_['keys'](_0x17db81[_0x968f('0x39')]);_0x32e9f0[_0x968f('0x3a')]=_[_0x968f('0x3b')](_0x32e9f0[_0x968f('0x38')],_0x32e9f0[_0x968f('0x39')]);_0x4a07c3[_0x968f('0x3c')]=_['intersection'](_0x32e9f0[_0x968f('0x38')],qs[_0x968f('0x3d')](_0x17db81[_0x968f('0x39')][_0x968f('0x3d')]));_0x4a07c3[_0x968f('0x3c')]=_0x4a07c3[_0x968f('0x3c')][_0x968f('0x4d')]?_0x4a07c3[_0x968f('0x3c')]:_0x32e9f0[_0x968f('0x38')];if(_0x17db81['query']['includeAll']){_0x4a07c3['include']=[{'all':!![]}];}_0x4a07c3=_[_0x968f('0x44')]({},_0x4a07c3,_0x17db81[_0x968f('0x4e')]);return db[_0x968f('0x36')][_0x968f('0x4f')](_0x4a07c3)['then'](handleEntityNotFound(_0x104348,null))[_0x968f('0x2b')](respondWithResult(_0x104348,null))[_0x968f('0x50')](handleError(_0x104348,null));};exports['create']=function(_0xfa85c1,_0x4e0d7){return db[_0x968f('0x36')]['create'](_0xfa85c1[_0x968f('0x51')],{})[_0x968f('0x2b')](function(_0x9fe264){var _0x46057d=_0xfa85c1[_0x968f('0x52')][_0x968f('0x2d')]({'plain':!![]});if(!_0x46057d)throw new Error(_0x968f('0x53'));if(_0x46057d[_0x968f('0x54')]===_0x968f('0x52')){var _0x156de8=_0x9fe264['get']({'plain':!![]});var _0x47ed4c=_0x968f('0x2e');return db['UserProfileSection'][_0x968f('0x4f')]({'where':{'name':_0x47ed4c,'userProfileId':_0x46057d[_0x968f('0x55')]},'raw':!![]})[_0x968f('0x2b')](function(_0x5819e8){if(_0x5819e8&&_0x5819e8[_0x968f('0x56')]===0x0){return db[_0x968f('0x2f')]['create']({'name':_0x156de8['name'],'resourceId':_0x156de8['id'],'type':_0x5819e8['name'],'sectionId':_0x5819e8['id']},{})['then'](function(){return _0x9fe264;});}else{return _0x9fe264;}})[_0x968f('0x50')](function(_0x46fa70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46fa70);throw _0x46fa70;});}return _0x9fe264;})[_0x968f('0x2b')](respondWithResult(_0x4e0d7,0xc9))[_0x968f('0x50')](handleError(_0x4e0d7,null));};exports[_0x968f('0x2a')]=function(_0x2918e2,_0x3f4d12){if(_0x2918e2[_0x968f('0x51')]['id']){delete _0x2918e2[_0x968f('0x51')]['id'];}return db[_0x968f('0x36')][_0x968f('0x4f')]({'where':{'id':_0x2918e2[_0x968f('0x4a')]['id']}})[_0x968f('0x2b')](handleEntityNotFound(_0x3f4d12,null))['then'](saveUpdates(_0x2918e2['body'],null))['then'](respondWithResult(_0x3f4d12,null))[_0x968f('0x50')](handleError(_0x3f4d12,null));};exports['destroy']=function(_0x59ae92,_0x9f3a1){return db[_0x968f('0x36')][_0x968f('0x4f')]({'where':{'id':_0x59ae92[_0x968f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9f3a1,null))['then'](removeEntity(_0x9f3a1,null))[_0x968f('0x50')](handleError(_0x9f3a1,null));};exports[_0x968f('0x57')]=function(_0x51e5d7,_0x143e3b){return db['MailQueue'][_0x968f('0x57')]()['then'](respondWithResult(_0x143e3b,null))['catch'](handleError(_0x143e3b,null));};exports[_0x968f('0x58')]=function(_0x3807f7,_0x1ca414,_0x1e4c92){var _0xea5f7={'raw':!![],'where':{}},_0x46ca48={},_0x2af6c4;return db[_0x968f('0x36')][_0x968f('0x59')]({'where':{'id':_0x3807f7[_0x968f('0x4a')]['id']}})[_0x968f('0x2b')](handleEntityNotFound(_0x1ca414,null))[_0x968f('0x2b')](function(_0x58db5c){if(_0x58db5c){_0x2af6c4=_0x58db5c['get']({'plain':!![]});_0x46ca48['model']=_[_0x968f('0x4b')](db[_0x968f('0x5a')][_0x968f('0x4c')]);_0x46ca48[_0x968f('0x39')]=_[_0x968f('0x4b')](_0x3807f7[_0x968f('0x39')]);_0x46ca48[_0x968f('0x3a')]=_[_0x968f('0x3b')](_0x46ca48[_0x968f('0x38')],_0x46ca48[_0x968f('0x39')]);_0xea5f7[_0x968f('0x3c')]=_[_0x968f('0x3b')](_0x46ca48[_0x968f('0x38')],qs[_0x968f('0x3d')](_0x3807f7[_0x968f('0x39')][_0x968f('0x3d')]));_0xea5f7['attributes']=_0xea5f7[_0x968f('0x3c')][_0x968f('0x4d')]?_0xea5f7[_0x968f('0x3c')]:_0x46ca48[_0x968f('0x38')];if(!_0x3807f7[_0x968f('0x39')][_0x968f('0x3e')](_0x968f('0x5b'))){_0xea5f7['limit']=qs['limit'](_0x3807f7[_0x968f('0x39')][_0x968f('0x25')]);_0xea5f7[_0x968f('0x23')]=qs['offset'](_0x3807f7['query'][_0x968f('0x23')]);}_0xea5f7[_0x968f('0x3f')]=qs['sort'](_0x3807f7[_0x968f('0x39')][_0x968f('0x40')]);_0xea5f7[_0x968f('0x41')]=qs[_0x968f('0x3a')](_[_0x968f('0x42')](_0x3807f7[_0x968f('0x39')],_0x46ca48[_0x968f('0x3a')]));_0xea5f7[_0x968f('0x41')][_0x968f('0x5c')]=_0x58db5c['id'];if(_0x3807f7[_0x968f('0x39')]['filter']){_0xea5f7[_0x968f('0x41')]=_[_0x968f('0x44')](_0xea5f7['where'],{'$or':_['map'](_0xea5f7[_0x968f('0x3c')],function(_0x5a6c3c){var _0x4164bb={};_0x4164bb[_0x5a6c3c]={'$like':'%'+_0x3807f7[_0x968f('0x39')]['filter']+'%'};return _0x4164bb;})});}_0xea5f7=_['merge']({},_0xea5f7,_0x3807f7[_0x968f('0x4e')]);return db[_0x968f('0x5a')]['findAll'](_0xea5f7);}})[_0x968f('0x2b')](function(_0x24aece){if(_0x24aece){return db[_0x968f('0x5d')][_0x968f('0x5e')]({'where':{'id':_['map'](_0x24aece,_0x968f('0x5f')),'role':_0x968f('0x60')},'attributes':['id',_0x968f('0x32'),_0x968f('0x61'),_0x968f('0x62'),_0x968f('0x63')]});}})['then'](function(_0x542c35){if(_0x542c35){return{'count':_0x542c35['count'],'rows':_[_0x968f('0x35')](_0x542c35[_0x968f('0x49')],function(_0x298f81){return{'membername':_0x298f81[_0x968f('0x32')],'UserId':_0x298f81['id'],'queue_name':_0x2af6c4[_0x968f('0x32')],'MailQueueId':_0x2af6c4['id'],'interface':util[_0x968f('0x64')](_0x968f('0x65'),'SIP',_0x298f81[_0x968f('0x32')]),'penalty':0x0,'paused':_0x298f81[_0x968f('0x61')],'createdAt':_0x298f81[_0x968f('0x63')],'updatedAt':_0x298f81[_0x968f('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x968f('0x2b')](respondWithFilteredResult(_0x1ca414,_0xea5f7))[_0x968f('0x50')](handleError(_0x1ca414,null));};exports[_0x968f('0x66')]=function(_0x5f3dc7,_0xa1d66f,_0x333eca){var _0x155a05={};var _0x30ffaf={};var _0x243dd9;var _0x53dd68;return db[_0x968f('0x36')][_0x968f('0x59')]({'where':{'id':_0x5f3dc7[_0x968f('0x4a')]['id']}})[_0x968f('0x2b')](handleEntityNotFound(_0xa1d66f,null))[_0x968f('0x2b')](function(_0x2c31d9){if(_0x2c31d9){_0x243dd9=_0x2c31d9;_0x30ffaf[_0x968f('0x38')]=_['keys'](db['Team'][_0x968f('0x4c')]);_0x30ffaf['query']=_[_0x968f('0x4b')](_0x5f3dc7[_0x968f('0x39')]);_0x30ffaf['filters']=_[_0x968f('0x3b')](_0x30ffaf[_0x968f('0x38')],_0x30ffaf[_0x968f('0x39')]);_0x155a05['attributes']=_['intersection'](_0x30ffaf[_0x968f('0x38')],qs[_0x968f('0x3d')](_0x5f3dc7[_0x968f('0x39')][_0x968f('0x3d')]));_0x155a05[_0x968f('0x3c')]=_0x155a05[_0x968f('0x3c')][_0x968f('0x4d')]?_0x155a05[_0x968f('0x3c')]:_0x30ffaf[_0x968f('0x38')];_0x155a05['order']=qs[_0x968f('0x40')](_0x5f3dc7[_0x968f('0x39')][_0x968f('0x40')]);_0x155a05[_0x968f('0x41')]=qs[_0x968f('0x3a')](_[_0x968f('0x42')](_0x5f3dc7['query'],_0x30ffaf[_0x968f('0x3a')]));if(_0x5f3dc7[_0x968f('0x39')][_0x968f('0x43')]){_0x155a05[_0x968f('0x41')]=_[_0x968f('0x44')](_0x155a05['where'],{'$or':_[_0x968f('0x35')](_0x155a05[_0x968f('0x3c')],function(_0x4a6dce){var _0x580c9f={};_0x580c9f[_0x4a6dce]={'$like':'%'+_0x5f3dc7[_0x968f('0x39')][_0x968f('0x43')]+'%'};return _0x580c9f;})});}_0x155a05=_['merge']({},_0x155a05,_0x5f3dc7['options']);return _0x243dd9['getTeams'](_0x155a05);}})['then'](function(_0x1d5d3e){if(_0x1d5d3e){_0x53dd68=_0x1d5d3e[_0x968f('0x4d')];if(!_0x5f3dc7['query']['hasOwnProperty'](_0x968f('0x5b'))){_0x155a05[_0x968f('0x25')]=qs[_0x968f('0x25')](_0x5f3dc7[_0x968f('0x39')][_0x968f('0x25')]);_0x155a05[_0x968f('0x23')]=qs[_0x968f('0x23')](_0x5f3dc7[_0x968f('0x39')][_0x968f('0x23')]);}return _0x243dd9[_0x968f('0x66')](_0x155a05);}})[_0x968f('0x2b')](function(_0x2225e9){if(_0x2225e9){return _0x2225e9?{'count':_0x53dd68,'rows':_0x2225e9}:null;}})['then'](respondWithResult(_0xa1d66f,null))['catch'](handleError(_0xa1d66f,null));};exports[_0x968f('0x67')]=function(_0x21ee29,_0x3a48ab,_0x4b6b99){var _0x5d7ff1=_0x21ee29[_0x968f('0x51')][_0x968f('0x68')];return db[_0x968f('0x69')][_0x968f('0x48')]({'where':{'id':_0x5d7ff1},'attributes':['id'],'include':[{'model':db[_0x968f('0x5d')],'as':_0x968f('0x6a'),'attributes':['id',_0x968f('0x32'),_0x968f('0x6b'),_0x968f('0x6c'),_0x968f('0x6d')],'raw':!![]}]})[_0x968f('0x2b')](function(_0x53e886){if(_0x53e886){var _0x4c272a=_[_0x968f('0x6e')](_0x53e886,function(_0x59722f){var _0x3aa554=_0x59722f[_0x968f('0x2d')]({'plain':!![]});return _0x3aa554[_0x968f('0x6a')];});return db[_0x968f('0x36')][_0x968f('0x4f')]({'where':{'id':_0x21ee29[_0x968f('0x4a')]['id']}})[_0x968f('0x2b')](function(_0x551921){return db['sequelize'][_0x968f('0x6f')](function(_0x2f962c){return _0x551921[_0x968f('0x67')](_0x5d7ff1,{'transaction':_0x2f962c})['then'](function(){return BPromise[_0x968f('0x70')](_0x4c272a,function(_0x4dab54){return db[_0x968f('0x5a')]['findOrCreate']({'where':{'UserId':_0x4dab54['id'],'MailQueueId':_0x21ee29[_0x968f('0x4a')]['id']},'transaction':_0x2f962c});});})[_0x968f('0x2b')](function(){_0x4c272a[_0x968f('0x71')](function(_0x1d040d){socket[_0x968f('0x72')]('userMailQueue:save',{'UserId':_0x1d040d['id'],'MailQueueId':_0x551921['id']});});});});});}})[_0x968f('0x2b')](respondWithStatusCode(_0x3a48ab,null))[_0x968f('0x50')](handleError(_0x3a48ab,null));};exports[_0x968f('0x73')]=function(_0x3bfaf5,_0x1003ef,_0x2be1f4){return db[_0x968f('0x69')][_0x968f('0x48')]({'where':{'id':_0x3bfaf5['query'][_0x968f('0x68')]},'attributes':['id'],'include':[{'model':db[_0x968f('0x5d')],'as':_0x968f('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1003ef,null))[_0x968f('0x2b')](function(_0xe52494){var _0x348ba1=_[_0x968f('0x35')](_0xe52494,'id');var _0x110119=[];var _0x5c1c09=[];var _0x1e7e9b=squel['select']();_0x1e7e9b[_0x968f('0x74')](_0x968f('0x75'))[_0x968f('0x76')]('team_has_mail_queues','tq')[_0x968f('0x77')](_0x968f('0x78'),'ut',_0x968f('0x79'))[_0x968f('0x41')](_0x968f('0x7a'),_0x3bfaf5['params']['id']);for(var _0x2b13fd=0x0;_0x2b13fd<_0xe52494[_0x968f('0x4d')];_0x2b13fd+=0x1){let _0x2faaa6=_0xe52494[_0x2b13fd];for(var _0x1b7103=0x0;_0x1b7103<_0x2faaa6[_0x968f('0x6a')][_0x968f('0x4d')];_0x1b7103+=0x1){let _0x20d60b=_0x2faaa6[_0x968f('0x6a')][_0x1b7103];var _0x4beb54=_0x1e7e9b[_0x968f('0x7b')]();_0x4beb54[_0x968f('0x41')](_0x968f('0x7c'),_0x20d60b['id']);_0x5c1c09[_0x968f('0x7d')](db['sequelize']['query'](_0x4beb54[_0x968f('0x7e')](),{'type':db['sequelize'][_0x968f('0x7f')][_0x968f('0x80')]})[_0x968f('0x2b')](function(_0x14725c){if(_0x14725c[_0x968f('0x4d')]===0x1){return _0x20d60b['id'];}else{var _0x2d1bf0=_[_0x968f('0x81')](_[_0x968f('0x35')](_0x14725c,_0x968f('0x82')),function(_0x1458c1){return _['includes'](_0x348ba1,_0x1458c1);});if(_0x2d1bf0){return _0x20d60b['id'];}}}));}}return BPromise[_0x968f('0x83')](_0x5c1c09)[_0x968f('0x2b')](function(_0x20d3eb){_0x110119=_(_0x110119)[_0x968f('0x84')](_0x20d3eb)[_0x968f('0x85')]()[_0x968f('0x86')]();return db['MailQueue'][_0x968f('0x4f')]({'where':{'id':_0x3bfaf5['params']['id']}})[_0x968f('0x2b')](function(_0xc66cd1){return db[_0x968f('0x87')]['transaction'](function(_0x46b7d4){return _0xc66cd1['removeTeams'](_0x3bfaf5['query']['ids'],{'transaction':_0x46b7d4})[_0x968f('0x2b')](function(){if(!_[_0x968f('0x88')](_0x110119)){return _0xc66cd1[_0x968f('0x89')](_0x110119,{'transaction':_0x46b7d4});}})['then'](function(){_0x110119[_0x968f('0x71')](function(_0x34b74f){socket['emit'](_0x968f('0x8a'),{'UserId':_0x34b74f,'MailQueueId':_0xc66cd1['id']});});});});});});})[_0x968f('0x2b')](respondWithStatusCode(_0x1003ef,null))[_0x968f('0x50')](handleError(_0x1003ef,null));};exports[_0x968f('0x8b')]=function(_0x438ced,_0x205185,_0x653f58){return db[_0x968f('0x36')][_0x968f('0x4f')]({'where':{'id':_0x438ced['params']['id']}})[_0x968f('0x2b')](handleEntityNotFound(_0x205185,null))['then'](function(_0x4df3cf){if(_0x4df3cf){return _0x4df3cf['addAgents'](_0x438ced[_0x968f('0x51')][_0x968f('0x68')],_[_0x968f('0x8c')](_0x438ced[_0x968f('0x51')],[_0x968f('0x68'),'id'])||{})[_0x968f('0x8d')](function(_0x78c349){for(var _0x19ce07=0x0;_0x19ce07<_0x438ced['body'][_0x968f('0x68')][_0x968f('0x4d')];_0x19ce07+=0x1){socket['emit'](_0x968f('0x8e'),{'UserId':Number(_0x438ced[_0x968f('0x51')][_0x968f('0x68')][_0x19ce07]),'MailQueueId':Number(_0x438ced['params']['id'])});}return _0x78c349;});}})[_0x968f('0x2b')](respondWithResult(_0x205185,null))[_0x968f('0x50')](handleError(_0x205185,null));};exports[_0x968f('0x89')]=function(_0x4296ad,_0x3123df,_0x42e83c){return db[_0x968f('0x36')][_0x968f('0x4f')]({'where':{'id':_0x4296ad[_0x968f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3123df,null))['then'](function(_0x1e2f9f){if(_0x1e2f9f){return _0x1e2f9f[_0x968f('0x89')](_0x4296ad[_0x968f('0x39')][_0x968f('0x68')])['then'](function(){if(_[_0x968f('0x8f')](_0x4296ad[_0x968f('0x39')][_0x968f('0x68')])){for(var _0x121f15=0x0;_0x121f15<_0x4296ad[_0x968f('0x39')][_0x968f('0x68')][_0x968f('0x4d')];_0x121f15+=0x1){socket[_0x968f('0x72')](_0x968f('0x8a'),{'UserId':Number(_0x4296ad[_0x968f('0x39')]['ids'][_0x121f15]),'MailQueueId':Number(_0x4296ad['params']['id'])});}}else{socket[_0x968f('0x72')](_0x968f('0x8a'),{'UserId':Number(_0x4296ad[_0x968f('0x39')]['ids']),'MailQueueId':Number(_0x4296ad[_0x968f('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3123df,null))['catch'](handleError(_0x3123df,null));};exports[_0x968f('0x90')]=function(_0x2eb9da,_0x54d5a5,_0x269c67){var _0x17ef44={};var _0x13d834={};var _0x357f42;var _0x36b917;return db[_0x968f('0x36')][_0x968f('0x59')]({'where':{'id':_0x2eb9da['params']['id']}})[_0x968f('0x2b')](handleEntityNotFound(_0x54d5a5,null))[_0x968f('0x2b')](function(_0x5e886b){if(_0x5e886b){_0x357f42=_0x5e886b;_0x13d834[_0x968f('0x38')]=_[_0x968f('0x4b')](db[_0x968f('0x5d')][_0x968f('0x4c')]);_0x13d834[_0x968f('0x39')]=_[_0x968f('0x4b')](_0x2eb9da[_0x968f('0x39')]);_0x13d834[_0x968f('0x3a')]=_[_0x968f('0x3b')](_0x13d834[_0x968f('0x38')],_0x13d834['query']);_0x17ef44[_0x968f('0x3c')]=_[_0x968f('0x3b')](_0x13d834[_0x968f('0x38')],qs[_0x968f('0x3d')](_0x2eb9da[_0x968f('0x39')]['fields']));_0x17ef44[_0x968f('0x3c')]=_0x17ef44[_0x968f('0x3c')][_0x968f('0x4d')]?_0x17ef44[_0x968f('0x3c')]:_0x13d834[_0x968f('0x38')];_0x17ef44[_0x968f('0x3f')]=qs[_0x968f('0x40')](_0x2eb9da[_0x968f('0x39')][_0x968f('0x40')]);_0x17ef44[_0x968f('0x41')]=qs[_0x968f('0x3a')](_['pick'](_0x2eb9da['query'],_0x13d834[_0x968f('0x3a')]));if(_0x2eb9da[_0x968f('0x39')][_0x968f('0x43')]){_0x17ef44['where']=_[_0x968f('0x44')](_0x17ef44['where'],{'$or':_['map'](_0x17ef44[_0x968f('0x3c')],function(_0x17b5a8){var _0x4dace1={};_0x4dace1[_0x17b5a8]={'$like':'%'+_0x2eb9da[_0x968f('0x39')][_0x968f('0x43')]+'%'};return _0x4dace1;})});}_0x17ef44=_[_0x968f('0x44')]({},_0x17ef44,_0x2eb9da[_0x968f('0x4e')]);return _0x357f42[_0x968f('0x90')](_0x17ef44);}})[_0x968f('0x2b')](function(_0x3066f4){if(_0x3066f4){_0x36b917=_0x3066f4['length'];if(!_0x2eb9da[_0x968f('0x39')][_0x968f('0x3e')](_0x968f('0x5b'))){_0x17ef44[_0x968f('0x25')]=qs[_0x968f('0x25')](_0x2eb9da['query']['limit']);_0x17ef44[_0x968f('0x23')]=qs[_0x968f('0x23')](_0x2eb9da['query'][_0x968f('0x23')]);}return _0x357f42[_0x968f('0x90')](_0x17ef44);}})[_0x968f('0x2b')](function(_0x12bcfd){if(_0x12bcfd){return _0x12bcfd?{'count':_0x36b917,'rows':_0x12bcfd}:null;}})['then'](respondWithResult(_0x54d5a5,null))[_0x968f('0x50')](handleError(_0x54d5a5,null));}; \ No newline at end of file +var _0x6916=['describe','getMembers','hasOwnProperty','order','sort','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','mailPause','getTeams','findOne','Team','addTeams','ids','online','voicePause','flatMap','Agents','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','includeAll','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x3a3de0,_0x2d0c53){var _0x4dfa8b=function(_0x58ecac){while(--_0x58ecac){_0x3a3de0['push'](_0x3a3de0['shift']());}};_0x4dfa8b(++_0x2d0c53);}(_0x6916,0x1ed));var _0x6691=function(_0x502ce,_0xd64df3){_0x502ce=_0x502ce-0x0;var _0x5741e9=_0x6916[_0x502ce];return _0x5741e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6691('0x0'));var zipdir=require(_0x6691('0x1'));var jsonpatch=require(_0x6691('0x2'));var rp=require(_0x6691('0x3'));var moment=require('moment');var BPromise=require(_0x6691('0x4'));var Mustache=require(_0x6691('0x5'));var util=require(_0x6691('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6691('0x7'));var ejs=require(_0x6691('0x8'));var fs=require('fs');var fs_extra=require(_0x6691('0x9'));var _=require(_0x6691('0xa'));var squel=require(_0x6691('0xb'));var crypto=require(_0x6691('0xc'));var jsforce=require(_0x6691('0xd'));var deskjs=require(_0x6691('0xe'));var toCsv=require(_0x6691('0x7'));var querystring=require('querystring');var Papa=require(_0x6691('0xf'));var Redis=require('ioredis');var authService=require(_0x6691('0x10'));var qs=require(_0x6691('0x11'));var as=require(_0x6691('0x12'));var hardwareService=require(_0x6691('0x13'));var logger=require('../../config/logger')(_0x6691('0x14'));var utils=require(_0x6691('0x15'));var config=require(_0x6691('0x16'));var licenseUtil=require(_0x6691('0x17'));var db=require(_0x6691('0x18'))['db'];config[_0x6691('0x19')]=_[_0x6691('0x1a')](config['redis'],{'host':_0x6691('0x1b'),'port':0x18eb});var socket=require(_0x6691('0x1c'))(new Redis(config[_0x6691('0x19')]));require(_0x6691('0x1d'))[_0x6691('0x1e')](socket);function respondWithStatusCode(_0x146a4f,_0x57fe05){_0x57fe05=_0x57fe05||0xcc;return function(_0x4a5d9c){if(_0x4a5d9c){return _0x146a4f[_0x6691('0x1f')](_0x57fe05);}return _0x146a4f[_0x6691('0x20')](_0x57fe05)[_0x6691('0x21')]();};}function respondWithResult(_0xc28007,_0x239599){_0x239599=_0x239599||0xc8;return function(_0x5b3b5e){if(_0x5b3b5e){return _0xc28007[_0x6691('0x20')](_0x239599)[_0x6691('0x22')](_0x5b3b5e);}};}function respondWithFilteredResult(_0x48c770,_0x139a52){return function(_0x2d0bcb){if(_0x2d0bcb){var _0x56483c=typeof _0x139a52['offset']===_0x6691('0x23')&&typeof _0x139a52[_0x6691('0x24')]===_0x6691('0x23');var _0x2299c6=_0x2d0bcb[_0x6691('0x25')];var _0x56ced2=_0x56483c?0x0:_0x139a52[_0x6691('0x26')];var _0x343725=_0x56483c?_0x2d0bcb['count']:_0x139a52[_0x6691('0x26')]+_0x139a52[_0x6691('0x24')];var _0x38f8fb;if(_0x343725>=_0x2299c6){_0x343725=_0x2299c6;_0x38f8fb=0xc8;}else{_0x38f8fb=0xce;}_0x48c770[_0x6691('0x20')](_0x38f8fb);return _0x48c770[_0x6691('0x27')]('Content-Range',_0x56ced2+'-'+_0x343725+'/'+_0x2299c6)[_0x6691('0x22')](_0x2d0bcb);}return null;};}function patchUpdates(_0x818b61){return function(_0x11b4f2){try{jsonpatch[_0x6691('0x28')](_0x11b4f2,_0x818b61,!![]);}catch(_0x14a418){return BPromise[_0x6691('0x29')](_0x14a418);}return _0x11b4f2[_0x6691('0x2a')]();};}function saveUpdates(_0x193b76,_0x16d8f8){return function(_0x54a4c3){if(_0x54a4c3){return _0x54a4c3['update'](_0x193b76)[_0x6691('0x2b')](function(_0x48b21c){return _0x48b21c;});}return null;};}function removeEntity(_0x4b7405,_0x43484e){return function(_0xed2744){if(_0xed2744){return _0xed2744['destroy']()[_0x6691('0x2b')](function(){var _0x3684d3=_0xed2744[_0x6691('0x2c')]({'plain':!![]});var _0x3f92bd=_0x6691('0x2d');return db[_0x6691('0x2e')][_0x6691('0x2f')]({'where':{'type':_0x3f92bd,'resourceId':_0x3684d3['id']}})[_0x6691('0x2b')](function(){return _0xed2744;});})[_0x6691('0x2b')](function(){_0x4b7405['status'](0xcc)[_0x6691('0x21')]();});}};}function handleEntityNotFound(_0x14df44,_0x33370c){return function(_0x27c60c){if(!_0x27c60c){_0x14df44[_0x6691('0x1f')](0x194);}return _0x27c60c;};}function handleError(_0x3be485,_0x1bcaa5){_0x1bcaa5=_0x1bcaa5||0x1f4;return function(_0xea3e97){logger[_0x6691('0x30')](_0xea3e97[_0x6691('0x31')]);if(_0xea3e97['name']){delete _0xea3e97[_0x6691('0x32')];}_0x3be485[_0x6691('0x20')](_0x1bcaa5)[_0x6691('0x33')](_0xea3e97);};}exports[_0x6691('0x34')]=function(_0x4516af,_0x48d0e1){var _0x55a197={},_0x1264e8={},_0x1e5f39={'count':0x0,'rows':[]};var _0x338394=_[_0x6691('0x35')](db[_0x6691('0x36')][_0x6691('0x37')],function(_0x2c05b5){return{'name':_0x2c05b5[_0x6691('0x38')],'type':_0x2c05b5[_0x6691('0x39')][_0x6691('0x3a')]};});_0x1264e8[_0x6691('0x3b')]=_[_0x6691('0x35')](_0x338394,_0x6691('0x32'));_0x1264e8[_0x6691('0x3c')]=_[_0x6691('0x3d')](_0x4516af['query']);_0x1264e8[_0x6691('0x3e')]=_[_0x6691('0x3f')](_0x1264e8['model'],_0x1264e8['query']);_0x55a197[_0x6691('0x40')]=_[_0x6691('0x3f')](_0x1264e8[_0x6691('0x3b')],qs[_0x6691('0x41')](_0x4516af[_0x6691('0x3c')]['fields']));_0x55a197[_0x6691('0x40')]=_0x55a197['attributes'][_0x6691('0x42')]?_0x55a197[_0x6691('0x40')]:_0x1264e8['model'];if(!_0x4516af['query']['hasOwnProperty'](_0x6691('0x43'))){_0x55a197[_0x6691('0x24')]=qs['limit'](_0x4516af[_0x6691('0x3c')][_0x6691('0x24')]);_0x55a197[_0x6691('0x26')]=qs[_0x6691('0x26')](_0x4516af['query'][_0x6691('0x26')]);}_0x55a197['order']=qs['sort'](_0x4516af[_0x6691('0x3c')]['sort']);_0x55a197[_0x6691('0x44')]=qs[_0x6691('0x3e')](_[_0x6691('0x45')](_0x4516af[_0x6691('0x3c')],_0x1264e8[_0x6691('0x3e')]),_0x338394);if(_0x4516af[_0x6691('0x3c')][_0x6691('0x46')]){_0x55a197['where']=_[_0x6691('0x47')](_0x55a197['where'],{'$or':_[_0x6691('0x35')](_0x338394,function(_0x3c7344){if(_0x3c7344[_0x6691('0x39')]!=='VIRTUAL'){var _0x42ffb8={};_0x42ffb8[_0x3c7344['name']]={'$like':'%'+_0x4516af[_0x6691('0x3c')][_0x6691('0x46')]+'%'};return _0x42ffb8;}})});}_0x55a197=_['merge']({},_0x55a197,_0x4516af['options']);var _0x5cfe4e={'where':_0x55a197[_0x6691('0x44')]};return db[_0x6691('0x36')][_0x6691('0x25')](_0x5cfe4e)['then'](function(_0x44e846){_0x1e5f39['count']=_0x44e846;if(_0x4516af[_0x6691('0x3c')][_0x6691('0x48')]){_0x55a197['include']=[{'all':!![]}];}return db[_0x6691('0x36')]['findAll'](_0x55a197);})[_0x6691('0x2b')](function(_0x375556){_0x1e5f39['rows']=_0x375556;return _0x1e5f39;})[_0x6691('0x2b')](respondWithFilteredResult(_0x48d0e1,_0x55a197))[_0x6691('0x49')](handleError(_0x48d0e1,null));};exports['show']=function(_0x2dfd64,_0x3607b8){var _0xbe7ac5={'raw':!![],'where':{'id':_0x2dfd64[_0x6691('0x4a')]['id']}},_0x20f768={};_0x20f768[_0x6691('0x3b')]=_['keys'](db[_0x6691('0x36')]['rawAttributes']);_0x20f768[_0x6691('0x3c')]=_['keys'](_0x2dfd64['query']);_0x20f768[_0x6691('0x3e')]=_[_0x6691('0x3f')](_0x20f768['model'],_0x20f768[_0x6691('0x3c')]);_0xbe7ac5[_0x6691('0x40')]=_['intersection'](_0x20f768['model'],qs[_0x6691('0x41')](_0x2dfd64[_0x6691('0x3c')][_0x6691('0x41')]));_0xbe7ac5['attributes']=_0xbe7ac5[_0x6691('0x40')][_0x6691('0x42')]?_0xbe7ac5[_0x6691('0x40')]:_0x20f768[_0x6691('0x3b')];if(_0x2dfd64['query'][_0x6691('0x48')]){_0xbe7ac5['include']=[{'all':!![]}];}_0xbe7ac5=_['merge']({},_0xbe7ac5,_0x2dfd64[_0x6691('0x4b')]);return db[_0x6691('0x36')][_0x6691('0x4c')](_0xbe7ac5)[_0x6691('0x2b')](handleEntityNotFound(_0x3607b8,null))['then'](respondWithResult(_0x3607b8,null))['catch'](handleError(_0x3607b8,null));};exports[_0x6691('0x4d')]=function(_0x5683df,_0x16b359){return db[_0x6691('0x36')][_0x6691('0x4d')](_0x5683df[_0x6691('0x4e')],{})[_0x6691('0x2b')](function(_0x5d6daf){var _0x229e94=_0x5683df[_0x6691('0x4f')][_0x6691('0x2c')]({'plain':!![]});if(!_0x229e94)throw new Error(_0x6691('0x50'));if(_0x229e94[_0x6691('0x51')]==='user'){var _0x4d425d=_0x5d6daf[_0x6691('0x2c')]({'plain':!![]});var _0x18fda9=_0x6691('0x2d');return db[_0x6691('0x52')]['find']({'where':{'name':_0x18fda9,'userProfileId':_0x229e94[_0x6691('0x53')]},'raw':!![]})[_0x6691('0x2b')](function(_0x148c16){if(_0x148c16&&_0x148c16[_0x6691('0x54')]===0x0){return db['UserProfileResource'][_0x6691('0x4d')]({'name':_0x4d425d[_0x6691('0x32')],'resourceId':_0x4d425d['id'],'type':_0x148c16[_0x6691('0x32')],'sectionId':_0x148c16['id']},{})['then'](function(){return _0x5d6daf;});}else{return _0x5d6daf;}})[_0x6691('0x49')](function(_0x1436d0){logger['error'](_0x6691('0x55'),_0x1436d0);throw _0x1436d0;});}return _0x5d6daf;})['then'](respondWithResult(_0x16b359,0xc9))['catch'](handleError(_0x16b359,null));};exports[_0x6691('0x56')]=function(_0x2c7bb9,_0x5d3069){if(_0x2c7bb9[_0x6691('0x4e')]['id']){delete _0x2c7bb9[_0x6691('0x4e')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x2c7bb9[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0x5d3069,null))['then'](saveUpdates(_0x2c7bb9[_0x6691('0x4e')],null))[_0x6691('0x2b')](respondWithResult(_0x5d3069,null))['catch'](handleError(_0x5d3069,null));};exports[_0x6691('0x2f')]=function(_0x1fee6f,_0x13f8a4){return db[_0x6691('0x36')][_0x6691('0x4c')]({'where':{'id':_0x1fee6f['params']['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0x13f8a4,null))[_0x6691('0x2b')](removeEntity(_0x13f8a4,null))[_0x6691('0x49')](handleError(_0x13f8a4,null));};exports[_0x6691('0x57')]=function(_0x2239e0,_0x313156){return db[_0x6691('0x36')][_0x6691('0x57')]()[_0x6691('0x2b')](respondWithResult(_0x313156,null))[_0x6691('0x49')](handleError(_0x313156,null));};exports[_0x6691('0x58')]=function(_0x4b612a,_0x2e7ab5,_0x1909b4){var _0x1035bb={'raw':!![],'where':{}},_0x27a47d={},_0x4c132b;return db['MailQueue']['findOne']({'where':{'id':_0x4b612a['params']['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0x2e7ab5,null))[_0x6691('0x2b')](function(_0x70ee28){if(_0x70ee28){_0x4c132b=_0x70ee28[_0x6691('0x2c')]({'plain':!![]});_0x27a47d[_0x6691('0x3b')]=_['keys'](db['UserMailQueue'][_0x6691('0x37')]);_0x27a47d['query']=_[_0x6691('0x3d')](_0x4b612a[_0x6691('0x3c')]);_0x27a47d[_0x6691('0x3e')]=_[_0x6691('0x3f')](_0x27a47d[_0x6691('0x3b')],_0x27a47d[_0x6691('0x3c')]);_0x1035bb[_0x6691('0x40')]=_[_0x6691('0x3f')](_0x27a47d[_0x6691('0x3b')],qs[_0x6691('0x41')](_0x4b612a['query'][_0x6691('0x41')]));_0x1035bb['attributes']=_0x1035bb[_0x6691('0x40')][_0x6691('0x42')]?_0x1035bb[_0x6691('0x40')]:_0x27a47d['model'];if(!_0x4b612a[_0x6691('0x3c')][_0x6691('0x59')](_0x6691('0x43'))){_0x1035bb['limit']=qs[_0x6691('0x24')](_0x4b612a[_0x6691('0x3c')][_0x6691('0x24')]);_0x1035bb[_0x6691('0x26')]=qs['offset'](_0x4b612a[_0x6691('0x3c')][_0x6691('0x26')]);}_0x1035bb[_0x6691('0x5a')]=qs[_0x6691('0x5b')](_0x4b612a['query'][_0x6691('0x5b')]);_0x1035bb['where']=qs['filters'](_[_0x6691('0x45')](_0x4b612a[_0x6691('0x3c')],_0x27a47d[_0x6691('0x3e')]));_0x1035bb[_0x6691('0x44')][_0x6691('0x5c')]=_0x70ee28['id'];if(_0x4b612a[_0x6691('0x3c')][_0x6691('0x46')]){_0x1035bb[_0x6691('0x44')]=_['merge'](_0x1035bb[_0x6691('0x44')],{'$or':_[_0x6691('0x35')](_0x1035bb[_0x6691('0x40')],function(_0xf5b447){var _0x202e8f={};_0x202e8f[_0xf5b447]={'$like':'%'+_0x4b612a['query']['filter']+'%'};return _0x202e8f;})});}_0x1035bb=_['merge']({},_0x1035bb,_0x4b612a[_0x6691('0x4b')]);return db[_0x6691('0x5d')][_0x6691('0x5e')](_0x1035bb);}})[_0x6691('0x2b')](function(_0x5984aa){if(_0x5984aa){return db[_0x6691('0x5f')][_0x6691('0x60')]({'where':{'id':_['map'](_0x5984aa,_0x6691('0x61')),'role':_0x6691('0x62')},'attributes':['id',_0x6691('0x32'),'mailPause',_0x6691('0x63'),_0x6691('0x64')]});}})[_0x6691('0x2b')](function(_0x3f7c3b){if(_0x3f7c3b){return{'count':_0x3f7c3b[_0x6691('0x25')],'rows':_[_0x6691('0x35')](_0x3f7c3b[_0x6691('0x65')],function(_0x5572eb){return{'membername':_0x5572eb[_0x6691('0x32')],'UserId':_0x5572eb['id'],'queue_name':_0x4c132b['name'],'MailQueueId':_0x4c132b['id'],'interface':util['format'](_0x6691('0x66'),_0x6691('0x67'),_0x5572eb[_0x6691('0x32')]),'penalty':0x0,'paused':_0x5572eb[_0x6691('0x68')],'createdAt':_0x5572eb['createdAt'],'updatedAt':_0x5572eb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6691('0x2b')](respondWithFilteredResult(_0x2e7ab5,_0x1035bb))['catch'](handleError(_0x2e7ab5,null));};exports[_0x6691('0x69')]=function(_0x317bc5,_0x166c63,_0x558e46){var _0x101571={};var _0x1d7f98={};var _0x507aac;var _0x2dfb97;return db[_0x6691('0x36')][_0x6691('0x6a')]({'where':{'id':_0x317bc5[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0x166c63,null))[_0x6691('0x2b')](function(_0x3daa00){if(_0x3daa00){_0x507aac=_0x3daa00;_0x1d7f98[_0x6691('0x3b')]=_[_0x6691('0x3d')](db[_0x6691('0x6b')][_0x6691('0x37')]);_0x1d7f98[_0x6691('0x3c')]=_[_0x6691('0x3d')](_0x317bc5[_0x6691('0x3c')]);_0x1d7f98['filters']=_[_0x6691('0x3f')](_0x1d7f98['model'],_0x1d7f98['query']);_0x101571[_0x6691('0x40')]=_[_0x6691('0x3f')](_0x1d7f98[_0x6691('0x3b')],qs['fields'](_0x317bc5['query'][_0x6691('0x41')]));_0x101571[_0x6691('0x40')]=_0x101571['attributes'][_0x6691('0x42')]?_0x101571[_0x6691('0x40')]:_0x1d7f98[_0x6691('0x3b')];_0x101571['order']=qs[_0x6691('0x5b')](_0x317bc5[_0x6691('0x3c')]['sort']);_0x101571[_0x6691('0x44')]=qs[_0x6691('0x3e')](_[_0x6691('0x45')](_0x317bc5[_0x6691('0x3c')],_0x1d7f98[_0x6691('0x3e')]));if(_0x317bc5[_0x6691('0x3c')][_0x6691('0x46')]){_0x101571['where']=_['merge'](_0x101571[_0x6691('0x44')],{'$or':_[_0x6691('0x35')](_0x101571[_0x6691('0x40')],function(_0x18200d){var _0x2927dd={};_0x2927dd[_0x18200d]={'$like':'%'+_0x317bc5[_0x6691('0x3c')]['filter']+'%'};return _0x2927dd;})});}_0x101571=_['merge']({},_0x101571,_0x317bc5[_0x6691('0x4b')]);return _0x507aac[_0x6691('0x69')](_0x101571);}})[_0x6691('0x2b')](function(_0x759814){if(_0x759814){_0x2dfb97=_0x759814['length'];if(!_0x317bc5['query'][_0x6691('0x59')](_0x6691('0x43'))){_0x101571[_0x6691('0x24')]=qs[_0x6691('0x24')](_0x317bc5[_0x6691('0x3c')][_0x6691('0x24')]);_0x101571[_0x6691('0x26')]=qs[_0x6691('0x26')](_0x317bc5[_0x6691('0x3c')][_0x6691('0x26')]);}return _0x507aac[_0x6691('0x69')](_0x101571);}})['then'](function(_0x21e7fb){if(_0x21e7fb){return _0x21e7fb?{'count':_0x2dfb97,'rows':_0x21e7fb}:null;}})[_0x6691('0x2b')](respondWithResult(_0x166c63,null))['catch'](handleError(_0x166c63,null));};exports[_0x6691('0x6c')]=function(_0x4beb3d,_0x4c893a,_0x961d0a){var _0x50e224=_0x4beb3d[_0x6691('0x4e')][_0x6691('0x6d')];return db[_0x6691('0x6b')][_0x6691('0x5e')]({'where':{'id':_0x50e224},'attributes':['id'],'include':[{'model':db[_0x6691('0x5f')],'as':'Agents','attributes':['id',_0x6691('0x32'),_0x6691('0x6e'),_0x6691('0x6f'),'interface'],'raw':!![]}]})['then'](function(_0x5d16cd){if(_0x5d16cd){var _0x2282a1=_[_0x6691('0x70')](_0x5d16cd,function(_0x3b7038){var _0x828246=_0x3b7038[_0x6691('0x2c')]({'plain':!![]});return _0x828246[_0x6691('0x71')];});return db[_0x6691('0x36')][_0x6691('0x4c')]({'where':{'id':_0x4beb3d[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](function(_0x4faa32){return db['sequelize']['transaction'](function(_0x1d4b56){return _0x4faa32['addTeams'](_0x50e224,{'transaction':_0x1d4b56})[_0x6691('0x2b')](function(){return BPromise[_0x6691('0x72')](_0x2282a1,function(_0xb3df1e){return db[_0x6691('0x5d')][_0x6691('0x73')]({'where':{'UserId':_0xb3df1e['id'],'MailQueueId':_0x4beb3d['params']['id']},'transaction':_0x1d4b56});});})[_0x6691('0x2b')](function(){_0x2282a1[_0x6691('0x74')](function(_0x4cb146){socket[_0x6691('0x75')]('userMailQueue:save',{'UserId':_0x4cb146['id'],'MailQueueId':_0x4faa32['id']});});});});});}})[_0x6691('0x2b')](respondWithStatusCode(_0x4c893a,null))['catch'](handleError(_0x4c893a,null));};exports[_0x6691('0x76')]=function(_0x2957f4,_0x220ffa,_0x3bd040){return db[_0x6691('0x6b')][_0x6691('0x5e')]({'where':{'id':_0x2957f4[_0x6691('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6691('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6691('0x2b')](handleEntityNotFound(_0x220ffa,null))[_0x6691('0x2b')](function(_0x3f803f){var _0x2e99d7=_[_0x6691('0x35')](_0x3f803f,'id');var _0x13f808=[];var _0x5e686e=[];var _0x36be1c=squel['select']();_0x36be1c[_0x6691('0x77')](_0x6691('0x78'))[_0x6691('0x79')](_0x6691('0x7a'),'tq')[_0x6691('0x7b')](_0x6691('0x7c'),'ut',_0x6691('0x7d'))[_0x6691('0x44')](_0x6691('0x7e'),_0x2957f4[_0x6691('0x4a')]['id']);for(var _0x21c0cb=0x0;_0x21c0cb<_0x3f803f[_0x6691('0x42')];_0x21c0cb+=0x1){let _0x3003b0=_0x3f803f[_0x21c0cb];for(var _0x423985=0x0;_0x423985<_0x3003b0[_0x6691('0x71')][_0x6691('0x42')];_0x423985+=0x1){let _0x845dd5=_0x3003b0[_0x6691('0x71')][_0x423985];var _0x6b5630=_0x36be1c[_0x6691('0x7f')]();_0x6b5630[_0x6691('0x44')](_0x6691('0x80'),_0x845dd5['id']);_0x5e686e['push'](db[_0x6691('0x81')][_0x6691('0x3c')](_0x6b5630['toString'](),{'type':db[_0x6691('0x81')][_0x6691('0x82')]['SELECT']})[_0x6691('0x2b')](function(_0x58f1e6){if(_0x58f1e6[_0x6691('0x42')]===0x1){return _0x845dd5['id'];}else{var _0x30c5a4=_[_0x6691('0x83')](_[_0x6691('0x35')](_0x58f1e6,_0x6691('0x84')),function(_0x1270cd){return _[_0x6691('0x85')](_0x2e99d7,_0x1270cd);});if(_0x30c5a4){return _0x845dd5['id'];}}}));}}return BPromise['all'](_0x5e686e)[_0x6691('0x2b')](function(_0x46bff8){_0x13f808=_(_0x13f808)[_0x6691('0x86')](_0x46bff8)[_0x6691('0x87')]()[_0x6691('0x88')]();return db[_0x6691('0x36')][_0x6691('0x4c')]({'where':{'id':_0x2957f4[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](function(_0x3a6c22){return db['sequelize'][_0x6691('0x89')](function(_0x43fe06){return _0x3a6c22[_0x6691('0x76')](_0x2957f4['query']['ids'],{'transaction':_0x43fe06})[_0x6691('0x2b')](function(){if(!_[_0x6691('0x8a')](_0x13f808)){return _0x3a6c22[_0x6691('0x8b')](_0x13f808,{'transaction':_0x43fe06});}})[_0x6691('0x2b')](function(){_0x13f808[_0x6691('0x74')](function(_0x42bd38){socket[_0x6691('0x75')](_0x6691('0x8c'),{'UserId':_0x42bd38,'MailQueueId':_0x3a6c22['id']});});});});});});})[_0x6691('0x2b')](respondWithStatusCode(_0x220ffa,null))[_0x6691('0x49')](handleError(_0x220ffa,null));};exports[_0x6691('0x8d')]=function(_0x531174,_0xa14b5,_0x3fd555){return db[_0x6691('0x36')][_0x6691('0x4c')]({'where':{'id':_0x531174[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0xa14b5,null))[_0x6691('0x2b')](function(_0x4a75be){if(_0x4a75be){return _0x4a75be[_0x6691('0x8d')](_0x531174[_0x6691('0x4e')][_0x6691('0x6d')],_['omit'](_0x531174['body'],[_0x6691('0x6d'),'id'])||{})[_0x6691('0x8e')](function(_0x4b67aa){for(var _0x4e3f96=0x0;_0x4e3f96<_0x531174['body'][_0x6691('0x6d')]['length'];_0x4e3f96+=0x1){socket[_0x6691('0x75')](_0x6691('0x8f'),{'UserId':Number(_0x531174[_0x6691('0x4e')][_0x6691('0x6d')][_0x4e3f96]),'MailQueueId':Number(_0x531174[_0x6691('0x4a')]['id'])});}return _0x4b67aa;});}})['then'](respondWithResult(_0xa14b5,null))['catch'](handleError(_0xa14b5,null));};exports[_0x6691('0x8b')]=function(_0x537112,_0x3756e3,_0x1b5ae4){return db['MailQueue'][_0x6691('0x4c')]({'where':{'id':_0x537112[_0x6691('0x4a')]['id']}})[_0x6691('0x2b')](handleEntityNotFound(_0x3756e3,null))[_0x6691('0x2b')](function(_0x479324){if(_0x479324){return _0x479324[_0x6691('0x8b')](_0x537112[_0x6691('0x3c')]['ids'])['then'](function(){if(_['isArray'](_0x537112[_0x6691('0x3c')][_0x6691('0x6d')])){for(var _0x146e9b=0x0;_0x146e9b<_0x537112[_0x6691('0x3c')]['ids'][_0x6691('0x42')];_0x146e9b+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x537112['query'][_0x6691('0x6d')][_0x146e9b]),'MailQueueId':Number(_0x537112['params']['id'])});}}else{socket[_0x6691('0x75')](_0x6691('0x8c'),{'UserId':Number(_0x537112['query'][_0x6691('0x6d')]),'MailQueueId':Number(_0x537112[_0x6691('0x4a')]['id'])});}});}})[_0x6691('0x2b')](respondWithStatusCode(_0x3756e3,null))['catch'](handleError(_0x3756e3,null));};exports[_0x6691('0x90')]=function(_0x236e90,_0x4b9bcc,_0x105012){var _0x4372f7={};var _0x5ad3a5={};var _0x3fa65c;var _0x5ed476;return db[_0x6691('0x36')][_0x6691('0x6a')]({'where':{'id':_0x236e90[_0x6691('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b9bcc,null))[_0x6691('0x2b')](function(_0x574aae){if(_0x574aae){_0x3fa65c=_0x574aae;_0x5ad3a5['model']=_[_0x6691('0x3d')](db[_0x6691('0x5f')][_0x6691('0x37')]);_0x5ad3a5['query']=_['keys'](_0x236e90[_0x6691('0x3c')]);_0x5ad3a5[_0x6691('0x3e')]=_[_0x6691('0x3f')](_0x5ad3a5[_0x6691('0x3b')],_0x5ad3a5[_0x6691('0x3c')]);_0x4372f7[_0x6691('0x40')]=_[_0x6691('0x3f')](_0x5ad3a5[_0x6691('0x3b')],qs[_0x6691('0x41')](_0x236e90[_0x6691('0x3c')][_0x6691('0x41')]));_0x4372f7['attributes']=_0x4372f7[_0x6691('0x40')][_0x6691('0x42')]?_0x4372f7[_0x6691('0x40')]:_0x5ad3a5['model'];_0x4372f7[_0x6691('0x5a')]=qs[_0x6691('0x5b')](_0x236e90[_0x6691('0x3c')][_0x6691('0x5b')]);_0x4372f7[_0x6691('0x44')]=qs['filters'](_[_0x6691('0x45')](_0x236e90['query'],_0x5ad3a5[_0x6691('0x3e')]));if(_0x236e90[_0x6691('0x3c')][_0x6691('0x46')]){_0x4372f7[_0x6691('0x44')]=_[_0x6691('0x47')](_0x4372f7[_0x6691('0x44')],{'$or':_[_0x6691('0x35')](_0x4372f7['attributes'],function(_0x1c6f7d){var _0xdb0a5d={};_0xdb0a5d[_0x1c6f7d]={'$like':'%'+_0x236e90[_0x6691('0x3c')][_0x6691('0x46')]+'%'};return _0xdb0a5d;})});}_0x4372f7=_[_0x6691('0x47')]({},_0x4372f7,_0x236e90['options']);return _0x3fa65c[_0x6691('0x90')](_0x4372f7);}})[_0x6691('0x2b')](function(_0x3bdf97){if(_0x3bdf97){_0x5ed476=_0x3bdf97[_0x6691('0x42')];if(!_0x236e90[_0x6691('0x3c')][_0x6691('0x59')](_0x6691('0x43'))){_0x4372f7[_0x6691('0x24')]=qs[_0x6691('0x24')](_0x236e90[_0x6691('0x3c')][_0x6691('0x24')]);_0x4372f7[_0x6691('0x26')]=qs[_0x6691('0x26')](_0x236e90[_0x6691('0x3c')][_0x6691('0x26')]);}return _0x3fa65c[_0x6691('0x90')](_0x4372f7);}})[_0x6691('0x2b')](function(_0x39b76c){if(_0x39b76c){return _0x39b76c?{'count':_0x5ed476,'rows':_0x39b76c}:null;}})[_0x6691('0x2b')](respondWithResult(_0x4b9bcc,null))[_0x6691('0x49')](handleError(_0x4b9bcc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 2f31b35..a56a3c0 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 _0xc87a=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x480e04,_0x4ff2aa){var _0x13da9b=function(_0x2c33d3){while(--_0x2c33d3){_0x480e04['push'](_0x480e04['shift']());}};_0x13da9b(++_0x4ff2aa);}(_0xc87a,0xa2));var _0xac87=function(_0x3a3e0c,_0x5eaf12){_0x3a3e0c=_0x3a3e0c-0x0;var _0x2ce2e8=_0xc87a[_0x3a3e0c];return _0x2ce2e8;};'use strict';var EventEmitter=require(_0xac87('0x0'));var MailQueue=require(_0xac87('0x1'))['db'][_0xac87('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xac87('0x3')](0x0);var events={'afterCreate':_0xac87('0x4'),'afterUpdate':_0xac87('0x5'),'afterDestroy':'remove'};function emitEvent(_0x340a73){return function(_0x355941,_0x52f200,_0x249dea){MailQueueEvents[_0xac87('0x6')](_0x340a73+':'+_0x355941['id'],_0x355941);MailQueueEvents[_0xac87('0x6')](_0x340a73,_0x355941);_0x249dea(null);};}for(var e in events){if(events[_0xac87('0x7')](e)){var event=events[e];MailQueue[_0xac87('0x8')](e,emitEvent(event));}}module[_0xac87('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x28f2=['hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0x28f2,0xcb));var _0x228f=function(_0x5a8241,_0x20eb20){_0x5a8241=_0x5a8241-0x0;var _0x36a241=_0x28f2[_0x5a8241];return _0x36a241;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x228f('0x0'))['db'][_0x228f('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x228f('0x2')](0x0);var events={'afterCreate':_0x228f('0x3'),'afterUpdate':_0x228f('0x4'),'afterDestroy':_0x228f('0x5')};function emitEvent(_0x2dc6b0){return function(_0xbc4464,_0x2e4d27,_0x158031){MailQueueEvents[_0x228f('0x6')](_0x2dc6b0+':'+_0xbc4464['id'],_0xbc4464);MailQueueEvents[_0x228f('0x6')](_0x2dc6b0,_0xbc4464);_0x158031(null);};}for(var e in events){if(events[_0x228f('0x7')](e)){var event=events[e];MailQueue[_0x228f('0x8')](e,emitEvent(event));}}module[_0x228f('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 46daaef..c8ca085 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 _0xaaa1=['../../config/environment','./mailQueue.attributes','exports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xaaa1,0x157));var _0x1aaa=function(_0x25f6bd,_0x3ad04f){_0x25f6bd=_0x25f6bd-0x0;var _0x117754=_0xaaa1[_0x25f6bd];return _0x117754;};'use strict';var _=require(_0x1aaa('0x0'));var util=require('util');var logger=require(_0x1aaa('0x1'))(_0x1aaa('0x2'));var moment=require('moment');var BPromise=require(_0x1aaa('0x3'));var rp=require(_0x1aaa('0x4'));var fs=require('fs');var path=require(_0x1aaa('0x5'));var rimraf=require(_0x1aaa('0x6'));var config=require(_0x1aaa('0x7'));var attributes=require(_0x1aaa('0x8'));module[_0x1aaa('0x9')]=function(_0x58f493,_0x4b1858){return _0x58f493['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd44d=['MailQueue','mail_queues','lodash','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','define'];(function(_0x75d119,_0x39b0e6){var _0x58409d=function(_0x2c7d4b){while(--_0x2c7d4b){_0x75d119['push'](_0x75d119['shift']());}};_0x58409d(++_0x39b0e6);}(_0xd44d,0x1af));var _0xdd44=function(_0x4ea540,_0xd5a8c6){_0x4ea540=_0x4ea540-0x0;var _0x5380ac=_0xd44d[_0x4ea540];return _0x5380ac;};'use strict';var _=require(_0xdd44('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdd44('0x1'));var BPromise=require(_0xdd44('0x2'));var rp=require(_0xdd44('0x3'));var fs=require('fs');var path=require(_0xdd44('0x4'));var rimraf=require(_0xdd44('0x5'));var config=require('../../config/environment');var attributes=require(_0xdd44('0x6'));module[_0xdd44('0x7')]=function(_0x5218f3,_0x157b05){return _0x5218f3[_0xdd44('0x8')](_0xdd44('0x9'),attributes,{'tableName':_0xdd44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 2e2ae7c..2eb95f0 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 _0x86c4=['code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x86c4,0x64));var _0x486c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86c4[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x486c('0x0'));var util=require('util');var moment=require(_0x486c('0x1'));var BPromise=require(_0x486c('0x2'));var rs=require(_0x486c('0x3'));var fs=require('fs');var Redis=require(_0x486c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x486c('0x5'))(_0x486c('0x6'));var config=require(_0x486c('0x7'));var jayson=require(_0x486c('0x8'));var client=jayson['client'][_0x486c('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x486c('0xa')],{'host':_0x486c('0xb'),'port':0x18eb});var socket=require(_0x486c('0xc'))(new Redis(config[_0x486c('0xa')]));require(_0x486c('0xd'))[_0x486c('0xe')](socket);function respondWithRpcPromise(_0x29cca0,_0x6e5a34,_0x1098f3){return new BPromise(function(_0x54877e,_0x53c3d1){return client[_0x486c('0xf')](_0x29cca0,_0x1098f3)[_0x486c('0x10')](function(_0x151c83){logger['info'](_0x486c('0x11'),_0x6e5a34,'request\x20sent');logger[_0x486c('0x12')](_0x486c('0x13'),_0x6e5a34,_0x486c('0x14'),JSON[_0x486c('0x15')](_0x151c83));if(_0x151c83[_0x486c('0x16')]){if(_0x151c83[_0x486c('0x16')][_0x486c('0x17')]===0x1f4){logger[_0x486c('0x16')](_0x486c('0x11'),_0x6e5a34,_0x151c83[_0x486c('0x16')][_0x486c('0x18')]);return _0x53c3d1(_0x151c83[_0x486c('0x16')][_0x486c('0x18')]);}logger[_0x486c('0x16')](_0x486c('0x11'),_0x6e5a34,_0x151c83['error'][_0x486c('0x18')]);return _0x54877e(_0x151c83[_0x486c('0x16')][_0x486c('0x18')]);}else{logger[_0x486c('0x19')]('MailQueue,\x20%s,\x20%s',_0x6e5a34,_0x486c('0x14'));_0x54877e(_0x151c83[_0x486c('0x1a')]['message']);}})[_0x486c('0x1b')](function(_0x5b6760){logger[_0x486c('0x16')]('MailQueue,\x20%s,\x20%s',_0x6e5a34,_0x5b6760);_0x53c3d1(_0x5b6760);});});}exports[_0x486c('0x1c')]=function(_0x172905){var _0x4fec1a=this;return new Promise(function(_0x5bc508,_0x326f70){return db[_0x486c('0x1d')][_0x486c('0x1e')]({'raw':_0x172905[_0x486c('0x1f')]?_0x172905[_0x486c('0x1f')][_0x486c('0x20')]===undefined?!![]:![]:!![],'where':_0x172905['options']?_0x172905[_0x486c('0x1f')][_0x486c('0x21')]||null:null,'attributes':_0x172905[_0x486c('0x1f')]?_0x172905[_0x486c('0x1f')][_0x486c('0x22')]||null:null,'limit':_0x172905['options']?_0x172905['options'][_0x486c('0x23')]||null:null,'include':_0x172905['options']?_0x172905[_0x486c('0x1f')][_0x486c('0x24')]?_['map'](_0x172905[_0x486c('0x1f')][_0x486c('0x24')],function(_0x34c558){return{'model':db[_0x34c558[_0x486c('0x25')]],'as':_0x34c558['as'],'attributes':_0x34c558[_0x486c('0x22')],'include':_0x34c558[_0x486c('0x24')]?_[_0x486c('0x26')](_0x34c558[_0x486c('0x24')],function(_0x4a5f9c){return{'model':db[_0x4a5f9c[_0x486c('0x25')]],'as':_0x4a5f9c['as'],'attributes':_0x4a5f9c[_0x486c('0x22')],'include':_0x4a5f9c[_0x486c('0x24')]?_[_0x486c('0x26')](_0x4a5f9c['include'],function(_0x151824){return{'model':db[_0x151824[_0x486c('0x25')]],'as':_0x151824['as'],'attributes':_0x151824['attributes']};}):[]};}):[]};}):[]:[]})[_0x486c('0x10')](function(_0x357949){logger['info']('GetMailQueue',_0x172905);logger[_0x486c('0x12')](_0x486c('0x1c'),_0x172905,JSON['stringify'](_0x357949));_0x5bc508(_0x357949);})[_0x486c('0x1b')](function(_0x81a181){logger[_0x486c('0x16')]('GetMailQueue',_0x81a181[_0x486c('0x18')],_0x172905);_0x326f70(_0x4fec1a[_0x486c('0x16')](0x1f4,_0x81a181['message']));});});};exports[_0x486c('0x27')]=function(_0x2b6038){var _0x543433=this;return new Promise(function(_0x284f85,_0x2049e1){return db['MailQueue'][_0x486c('0x28')]({'raw':_0x2b6038[_0x486c('0x1f')]?_0x2b6038['options'][_0x486c('0x20')]===undefined?!![]:![]:!![],'where':_0x2b6038['options']?_0x2b6038[_0x486c('0x1f')][_0x486c('0x21')]||null:null,'attributes':_0x2b6038[_0x486c('0x1f')]?_0x2b6038['options']['attributes']||null:null,'include':_0x2b6038[_0x486c('0x1f')]?_0x2b6038['options'][_0x486c('0x24')]?_[_0x486c('0x26')](_0x2b6038[_0x486c('0x1f')][_0x486c('0x24')],function(_0x3fd226){return{'model':db[_0x3fd226[_0x486c('0x25')]],'as':_0x3fd226['as'],'attributes':_0x3fd226['attributes'],'include':_0x3fd226[_0x486c('0x24')]?_['map'](_0x3fd226[_0x486c('0x24')],function(_0x46d322){return{'model':db[_0x46d322[_0x486c('0x25')]],'as':_0x46d322['as'],'attributes':_0x46d322[_0x486c('0x22')],'include':_0x46d322[_0x486c('0x24')]?_[_0x486c('0x26')](_0x46d322['include'],function(_0x48bc3c){return{'model':db[_0x48bc3c[_0x486c('0x25')]],'as':_0x48bc3c['as'],'attributes':_0x48bc3c[_0x486c('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dee31){logger['info'](_0x486c('0x27'),_0x2b6038);logger[_0x486c('0x12')](_0x486c('0x27'),_0x2b6038,JSON[_0x486c('0x15')](_0x1dee31));_0x284f85(_0x1dee31);})[_0x486c('0x1b')](function(_0x3d9a77){logger[_0x486c('0x16')]('ShowMailQueue',_0x3d9a77[_0x486c('0x18')],_0x2b6038);_0x2049e1(_0x543433['error'](0x1f4,_0x3d9a77[_0x486c('0x18')]));});});}; \ No newline at end of file +var _0x78c2=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowMailQueue','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3ff6f2,_0xec9633){var _0x2cbc1d=function(_0x3c1b26){while(--_0x3c1b26){_0x3ff6f2['push'](_0x3ff6f2['shift']());}};_0x2cbc1d(++_0xec9633);}(_0x78c2,0x1b6));var _0x278c=function(_0x16d1ee,_0x35a031){_0x16d1ee=_0x16d1ee-0x0;var _0x9d3ba6=_0x78c2[_0x16d1ee];return _0x9d3ba6;};'use strict';var _=require(_0x278c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x278c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x278c('0x2'));var db=require(_0x278c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x278c('0x4'))(_0x278c('0x5'));var config=require(_0x278c('0x6'));var jayson=require(_0x278c('0x7'));var client=jayson[_0x278c('0x8')][_0x278c('0x9')]({'port':0x232a});config[_0x278c('0xa')]=_[_0x278c('0xb')](config[_0x278c('0xa')],{'host':_0x278c('0xc'),'port':0x18eb});var socket=require(_0x278c('0xd'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x278c('0xe')](socket);function respondWithRpcPromise(_0xe03a0f,_0x58c7cb,_0x4842fa){return new BPromise(function(_0x4efe3b,_0x2ce986){return client['request'](_0xe03a0f,_0x4842fa)[_0x278c('0xf')](function(_0x74d839){logger[_0x278c('0x10')](_0x278c('0x11'),_0x58c7cb,_0x278c('0x12'));logger[_0x278c('0x13')](_0x278c('0x14'),_0x58c7cb,_0x278c('0x12'),JSON['stringify'](_0x74d839));if(_0x74d839[_0x278c('0x15')]){if(_0x74d839[_0x278c('0x15')][_0x278c('0x16')]===0x1f4){logger[_0x278c('0x15')](_0x278c('0x11'),_0x58c7cb,_0x74d839[_0x278c('0x15')][_0x278c('0x17')]);return _0x2ce986(_0x74d839['error'][_0x278c('0x17')]);}logger[_0x278c('0x15')](_0x278c('0x11'),_0x58c7cb,_0x74d839[_0x278c('0x15')][_0x278c('0x17')]);return _0x4efe3b(_0x74d839[_0x278c('0x15')][_0x278c('0x17')]);}else{logger[_0x278c('0x10')](_0x278c('0x11'),_0x58c7cb,'request\x20sent');_0x4efe3b(_0x74d839[_0x278c('0x18')][_0x278c('0x17')]);}})['catch'](function(_0x18f81b){logger['error'](_0x278c('0x11'),_0x58c7cb,_0x18f81b);_0x2ce986(_0x18f81b);});});}exports[_0x278c('0x19')]=function(_0x48732e){var _0x59b750=this;return new Promise(function(_0x3490e8,_0x434253){return db['MailQueue']['findAll']({'raw':_0x48732e[_0x278c('0x1a')]?_0x48732e[_0x278c('0x1a')][_0x278c('0x1b')]===undefined?!![]:![]:!![],'where':_0x48732e[_0x278c('0x1a')]?_0x48732e['options'][_0x278c('0x1c')]||null:null,'attributes':_0x48732e[_0x278c('0x1a')]?_0x48732e[_0x278c('0x1a')][_0x278c('0x1d')]||null:null,'limit':_0x48732e[_0x278c('0x1a')]?_0x48732e[_0x278c('0x1a')][_0x278c('0x1e')]||null:null,'include':_0x48732e[_0x278c('0x1a')]?_0x48732e['options'][_0x278c('0x1f')]?_[_0x278c('0x20')](_0x48732e[_0x278c('0x1a')][_0x278c('0x1f')],function(_0x36c8dd){return{'model':db[_0x36c8dd[_0x278c('0x21')]],'as':_0x36c8dd['as'],'attributes':_0x36c8dd[_0x278c('0x1d')],'include':_0x36c8dd[_0x278c('0x1f')]?_['map'](_0x36c8dd[_0x278c('0x1f')],function(_0x3613e0){return{'model':db[_0x3613e0[_0x278c('0x21')]],'as':_0x3613e0['as'],'attributes':_0x3613e0[_0x278c('0x1d')],'include':_0x3613e0[_0x278c('0x1f')]?_[_0x278c('0x20')](_0x3613e0[_0x278c('0x1f')],function(_0x13970e){return{'model':db[_0x13970e[_0x278c('0x21')]],'as':_0x13970e['as'],'attributes':_0x13970e['attributes']};}):[]};}):[]};}):[]:[]})[_0x278c('0xf')](function(_0x4c4b0f){logger['info'](_0x278c('0x19'),_0x48732e);logger['debug'](_0x278c('0x19'),_0x48732e,JSON[_0x278c('0x22')](_0x4c4b0f));_0x3490e8(_0x4c4b0f);})['catch'](function(_0x152d11){logger[_0x278c('0x15')]('GetMailQueue',_0x152d11[_0x278c('0x17')],_0x48732e);_0x434253(_0x59b750[_0x278c('0x15')](0x1f4,_0x152d11['message']));});});};exports['ShowMailQueue']=function(_0x211ccc){var _0x30b2c1=this;return new Promise(function(_0x593070,_0x54f17c){return db['MailQueue'][_0x278c('0x23')]({'raw':_0x211ccc[_0x278c('0x1a')]?_0x211ccc[_0x278c('0x1a')][_0x278c('0x1b')]===undefined?!![]:![]:!![],'where':_0x211ccc[_0x278c('0x1a')]?_0x211ccc[_0x278c('0x1a')][_0x278c('0x1c')]||null:null,'attributes':_0x211ccc[_0x278c('0x1a')]?_0x211ccc[_0x278c('0x1a')][_0x278c('0x1d')]||null:null,'include':_0x211ccc[_0x278c('0x1a')]?_0x211ccc[_0x278c('0x1a')]['include']?_['map'](_0x211ccc[_0x278c('0x1a')][_0x278c('0x1f')],function(_0x51ca8d){return{'model':db[_0x51ca8d[_0x278c('0x21')]],'as':_0x51ca8d['as'],'attributes':_0x51ca8d[_0x278c('0x1d')],'include':_0x51ca8d['include']?_[_0x278c('0x20')](_0x51ca8d[_0x278c('0x1f')],function(_0x29c230){return{'model':db[_0x29c230['model']],'as':_0x29c230['as'],'attributes':_0x29c230[_0x278c('0x1d')],'include':_0x29c230[_0x278c('0x1f')]?_['map'](_0x29c230[_0x278c('0x1f')],function(_0x46d38e){return{'model':db[_0x46d38e['model']],'as':_0x46d38e['as'],'attributes':_0x46d38e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed9f2){logger['info'](_0x278c('0x24'),_0x211ccc);logger[_0x278c('0x13')](_0x278c('0x24'),_0x211ccc,JSON['stringify'](_0x1ed9f2));_0x593070(_0x1ed9f2);})['catch'](function(_0x1d254b){logger[_0x278c('0x15')](_0x278c('0x24'),_0x1d254b['message'],_0x211ccc);_0x54f17c(_0x30b2c1[_0x278c('0x15')](0x1f4,_0x1d254b[_0x278c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d0e4728..79c71c4 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 _0xea17=['removeListener','register','length','./mailQueue.events','save','remove','update','emit'];(function(_0x2fdbcb,_0x58777d){var _0x5d40e0=function(_0x3ef77d){while(--_0x3ef77d){_0x2fdbcb['push'](_0x2fdbcb['shift']());}};_0x5d40e0(++_0x58777d);}(_0xea17,0xa3));var _0x7ea1=function(_0x5e3579,_0x2ada9b){_0x5e3579=_0x5e3579-0x0;var _0x4ea801=_0xea17[_0x5e3579];return _0x4ea801;};'use strict';var MailQueueEvents=require(_0x7ea1('0x0'));var events=[_0x7ea1('0x1'),_0x7ea1('0x2'),_0x7ea1('0x3')];function createListener(_0x5e7401,_0x5573d9){return function(_0x22b00c){_0x5573d9[_0x7ea1('0x4')](_0x5e7401,_0x22b00c);};}function removeListener(_0x1c4721,_0x53794a){return function(){MailQueueEvents[_0x7ea1('0x5')](_0x1c4721,_0x53794a);};}exports[_0x7ea1('0x6')]=function(_0xb6ece1){for(var _0x2521dd=0x0,_0x944a71=events[_0x7ea1('0x7')];_0x2521dd<_0x944a71;_0x2521dd++){var _0x239741=events[_0x2521dd];var _0x406d9c=createListener('mailQueue:'+_0x239741,_0xb6ece1);MailQueueEvents['on'](_0x239741,_0x406d9c);}}; \ No newline at end of file +var _0x5610=['./mailQueue.events','save','remove','update','emit','register','length','mailQueue:'];(function(_0x20d02d,_0x458b40){var _0x172078=function(_0x1b33d6){while(--_0x1b33d6){_0x20d02d['push'](_0x20d02d['shift']());}};_0x172078(++_0x458b40);}(_0x5610,0x100));var _0x0561=function(_0x5a9755,_0x2859ce){_0x5a9755=_0x5a9755-0x0;var _0xd1a676=_0x5610[_0x5a9755];return _0xd1a676;};'use strict';var MailQueueEvents=require(_0x0561('0x0'));var events=[_0x0561('0x1'),_0x0561('0x2'),_0x0561('0x3')];function createListener(_0x38928d,_0x4ef95d){return function(_0x47ac5d){_0x4ef95d[_0x0561('0x4')](_0x38928d,_0x47ac5d);};}function removeListener(_0x125194,_0x546455){return function(){MailQueueEvents['removeListener'](_0x125194,_0x546455);};}exports[_0x0561('0x5')]=function(_0x1eeab8){for(var _0x6c47ce=0x0,_0xe6b8b2=events[_0x0561('0x6')];_0x6c47ce<_0xe6b8b2;_0x6c47ce++){var _0x4556ac=events[_0x6c47ce];var _0x109cad=createListener(_0x0561('0x7')+_0x4556ac,_0x1eeab8);MailQueueEvents['on'](_0x4556ac,_0x109cad);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 46a3557..5d506cf 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 _0x991a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/:id','post','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x39095c,_0x543d7c){var _0x3695b6=function(_0x40097f){while(--_0x40097f){_0x39095c['push'](_0x39095c['shift']());}};_0x3695b6(++_0x543d7c);}(_0x991a,0xf9));var _0xa991=function(_0x103fe0,_0x2867aa){_0x103fe0=_0x103fe0-0x0;var _0x5adccc=_0x991a[_0x103fe0];return _0x5adccc;};'use strict';var multer=require(_0xa991('0x0'));var util=require('util');var path=require(_0xa991('0x1'));var timeout=require(_0xa991('0x2'));var express=require(_0xa991('0x3'));var router=express[_0xa991('0x4')]();var fs_extra=require(_0xa991('0x5'));var auth=require(_0xa991('0x6'));var interaction=require(_0xa991('0x7'));var config=require(_0xa991('0x8'));var controller=require(_0xa991('0x9'));router[_0xa991('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa991('0xa')]('/describe',auth[_0xa991('0xb')](),controller['describe']);router[_0xa991('0xa')](_0xa991('0xc'),auth[_0xa991('0xb')](),controller['show']);router[_0xa991('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa991('0xe')](_0xa991('0xc'),auth[_0xa991('0xb')](),controller['update']);router[_0xa991('0xf')](_0xa991('0xc'),auth[_0xa991('0xb')](),controller['destroy']);module[_0xa991('0x10')]=router; \ No newline at end of file +var _0xb999=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','get','/:id','post','create'];(function(_0x2a1a14,_0x11d8bc){var _0x296811=function(_0x165c53){while(--_0x165c53){_0x2a1a14['push'](_0x2a1a14['shift']());}};_0x296811(++_0x11d8bc);}(_0xb999,0xcd));var _0x9b99=function(_0x36d069,_0x321dad){_0x36d069=_0x36d069-0x0;var _0x2e8421=_0xb999[_0x36d069];return _0x2e8421;};'use strict';var multer=require(_0x9b99('0x0'));var util=require('util');var path=require(_0x9b99('0x1'));var timeout=require(_0x9b99('0x2'));var express=require(_0x9b99('0x3'));var router=express[_0x9b99('0x4')]();var fs_extra=require(_0x9b99('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9b99('0x6'));var controller=require(_0x9b99('0x7'));router['get']('/',auth[_0x9b99('0x8')](),controller[_0x9b99('0x9')]);router['get'](_0x9b99('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x9b99('0xb')](_0x9b99('0xc'),auth[_0x9b99('0x8')](),controller['show']);router[_0x9b99('0xd')]('/',auth[_0x9b99('0x8')](),controller[_0x9b99('0xe')]);router[_0x9b99('0xf')](_0x9b99('0xc'),auth[_0x9b99('0x8')](),controller[_0x9b99('0x10')]);router[_0x9b99('0x11')](_0x9b99('0xc'),auth[_0x9b99('0x8')](),controller[_0x9b99('0x12')]);module[_0x9b99('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f5ddea0..c8d585c 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 _0xb45e=['moment','exports','STRING','DATE'];(function(_0x48ffee,_0x1da42e){var _0x214164=function(_0x2329dd){while(--_0x2329dd){_0x48ffee['push'](_0x48ffee['shift']());}};_0x214164(++_0x1da42e);}(_0xb45e,0x90));var _0xeb45=function(_0x26ce01,_0x2046b2){_0x26ce01=_0x26ce01-0x0;var _0x15b336=_0xb45e[_0x26ce01];return _0x15b336;};'use strict';var moment=require(_0xeb45('0x0'));var Sequelize=require('sequelize');module[_0xeb45('0x1')]={'uniqueid':{'type':Sequelize[_0xeb45('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xeb45('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xeb45('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xeb45('0x3')]},'reason':{'type':Sequelize[_0xeb45('0x2')]}}; \ No newline at end of file +var _0x0813=['moment','sequelize','exports','STRING','DATE'];(function(_0x344d08,_0x73abbb){var _0x30a4dc=function(_0x26cf31){while(--_0x26cf31){_0x344d08['push'](_0x344d08['shift']());}};_0x30a4dc(++_0x73abbb);}(_0x0813,0x1b3));var _0x3081=function(_0x4ca3cd,_0x50275c){_0x4ca3cd=_0x4ca3cd-0x0;var _0x4e49be=_0x0813[_0x4ca3cd];return _0x4e49be;};'use strict';var moment=require(_0x3081('0x0'));var Sequelize=require(_0x3081('0x1'));module[_0x3081('0x2')]={'uniqueid':{'type':Sequelize[_0x3081('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3081('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3081('0x4')]},'exitAt':{'type':Sequelize[_0x3081('0x4')]},'reason':{'type':Sequelize[_0x3081('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 85ae6ea..b96bf52 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 _0x5204=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','error','stack','name','send','map','MailQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','then','rows','params','keys','rawAttributes','catch','create','body','find','describe','eml-format','rimraf'];(function(_0x57bd47,_0x321b35){var _0x2c1ce3=function(_0x172238){while(--_0x172238){_0x57bd47['push'](_0x57bd47['shift']());}};_0x2c1ce3(++_0x321b35);}(_0x5204,0xdf));var _0x4520=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x5204[_0x5d6e35];return _0x5d7ada;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4520('0x2'));var rp=require(_0x4520('0x3'));var moment=require(_0x4520('0x4'));var BPromise=require(_0x4520('0x5'));var Mustache=require(_0x4520('0x6'));var util=require('util');var path=require(_0x4520('0x7'));var sox=require('sox');var csv=require(_0x4520('0x8'));var ejs=require(_0x4520('0x9'));var fs=require('fs');var fs_extra=require(_0x4520('0xa'));var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x8'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var licenseUtil=require(_0x4520('0x19'));var db=require(_0x4520('0x1a'))['db'];function respondWithStatusCode(_0x3c7a5d,_0x508ea6){_0x508ea6=_0x508ea6||0xcc;return function(_0x2e3c64){if(_0x2e3c64){return _0x3c7a5d[_0x4520('0x1b')](_0x508ea6);}return _0x3c7a5d[_0x4520('0x1c')](_0x508ea6)[_0x4520('0x1d')]();};}function respondWithResult(_0x426836,_0x34d383){_0x34d383=_0x34d383||0xc8;return function(_0x32950a){if(_0x32950a){return _0x426836['status'](_0x34d383)[_0x4520('0x1e')](_0x32950a);}};}function respondWithFilteredResult(_0x20de6b,_0x1ab841){return function(_0x15a31f){if(_0x15a31f){var _0x32d8aa=typeof _0x1ab841['offset']===_0x4520('0x1f')&&typeof _0x1ab841[_0x4520('0x20')]===_0x4520('0x1f');var _0x283ad4=_0x15a31f[_0x4520('0x21')];var _0x2e00f4=_0x32d8aa?0x0:_0x1ab841[_0x4520('0x22')];var _0x4ba69f=_0x32d8aa?_0x15a31f[_0x4520('0x21')]:_0x1ab841[_0x4520('0x22')]+_0x1ab841[_0x4520('0x20')];var _0x460521;if(_0x4ba69f>=_0x283ad4){_0x4ba69f=_0x283ad4;_0x460521=0xc8;}else{_0x460521=0xce;}_0x20de6b['status'](_0x460521);return _0x20de6b[_0x4520('0x23')]('Content-Range',_0x2e00f4+'-'+_0x4ba69f+'/'+_0x283ad4)['json'](_0x15a31f);}return null;};}function patchUpdates(_0x4c46c5){return function(_0x2b9456){try{jsonpatch['apply'](_0x2b9456,_0x4c46c5,!![]);}catch(_0x39e196){return BPromise[_0x4520('0x24')](_0x39e196);}return _0x2b9456[_0x4520('0x25')]();};}function saveUpdates(_0x534b15,_0x3199a9){return function(_0x4000d4){if(_0x4000d4){return _0x4000d4[_0x4520('0x26')](_0x534b15)['then'](function(_0x198c34){return _0x198c34;});}return null;};}function removeEntity(_0x847d15,_0x24eacd){return function(_0x3a4680){if(_0x3a4680){return _0x3a4680[_0x4520('0x27')]()['then'](function(){_0x847d15[_0x4520('0x1c')](0xcc)[_0x4520('0x1d')]();});}};}function handleEntityNotFound(_0x3532aa,_0x3e2906){return function(_0x57306b){if(!_0x57306b){_0x3532aa[_0x4520('0x1b')](0x194);}return _0x57306b;};}function handleError(_0x4602a4,_0x92168b){_0x92168b=_0x92168b||0x1f4;return function(_0x21e1f3){logger[_0x4520('0x28')](_0x21e1f3[_0x4520('0x29')]);if(_0x21e1f3[_0x4520('0x2a')]){delete _0x21e1f3[_0x4520('0x2a')];}_0x4602a4[_0x4520('0x1c')](_0x92168b)[_0x4520('0x2b')](_0x21e1f3);};}exports['index']=function(_0x222dbd,_0x5c1a0b){var _0x7ce8d2={},_0x14778a={},_0x43b4a2={'count':0x0,'rows':[]};var _0x157293=_[_0x4520('0x2c')](db[_0x4520('0x2d')]['rawAttributes'],function(_0x2c32ce){return{'name':_0x2c32ce['fieldName'],'type':_0x2c32ce[_0x4520('0x2e')]['key']};});_0x14778a[_0x4520('0x2f')]=_['map'](_0x157293,_0x4520('0x2a'));_0x14778a['query']=_['keys'](_0x222dbd[_0x4520('0x30')]);_0x14778a[_0x4520('0x31')]=_[_0x4520('0x32')](_0x14778a['model'],_0x14778a[_0x4520('0x30')]);_0x7ce8d2[_0x4520('0x33')]=_[_0x4520('0x32')](_0x14778a[_0x4520('0x2f')],qs['fields'](_0x222dbd['query'][_0x4520('0x34')]));_0x7ce8d2[_0x4520('0x33')]=_0x7ce8d2['attributes'][_0x4520('0x35')]?_0x7ce8d2[_0x4520('0x33')]:_0x14778a[_0x4520('0x2f')];if(!_0x222dbd[_0x4520('0x30')][_0x4520('0x36')](_0x4520('0x37'))){_0x7ce8d2['limit']=qs[_0x4520('0x20')](_0x222dbd[_0x4520('0x30')]['limit']);_0x7ce8d2[_0x4520('0x22')]=qs['offset'](_0x222dbd[_0x4520('0x30')][_0x4520('0x22')]);}_0x7ce8d2['order']=qs['sort'](_0x222dbd['query'][_0x4520('0x38')]);_0x7ce8d2[_0x4520('0x39')]=qs[_0x4520('0x31')](_[_0x4520('0x3a')](_0x222dbd[_0x4520('0x30')],_0x14778a[_0x4520('0x31')]),_0x157293);if(_0x222dbd[_0x4520('0x30')]['filter']){_0x7ce8d2[_0x4520('0x39')]=_[_0x4520('0x3b')](_0x7ce8d2[_0x4520('0x39')],{'$or':_['map'](_0x157293,function(_0x16d489){if(_0x16d489[_0x4520('0x2e')]!=='VIRTUAL'){var _0x57b155={};_0x57b155[_0x16d489[_0x4520('0x2a')]]={'$like':'%'+_0x222dbd[_0x4520('0x30')][_0x4520('0x3c')]+'%'};return _0x57b155;}})});}_0x7ce8d2=_[_0x4520('0x3b')]({},_0x7ce8d2,_0x222dbd[_0x4520('0x3d')]);var _0x5ca832={'where':_0x7ce8d2['where']};return db['MailQueueReport'][_0x4520('0x21')](_0x5ca832)['then'](function(_0x43dc36){_0x43b4a2['count']=_0x43dc36;if(_0x222dbd['query'][_0x4520('0x3e')]){_0x7ce8d2[_0x4520('0x3f')]=[{'all':!![]}];}return db[_0x4520('0x2d')][_0x4520('0x40')](_0x7ce8d2);})[_0x4520('0x41')](function(_0x59d646){_0x43b4a2[_0x4520('0x42')]=_0x59d646;return _0x43b4a2;})[_0x4520('0x41')](respondWithFilteredResult(_0x5c1a0b,_0x7ce8d2))['catch'](handleError(_0x5c1a0b,null));};exports['show']=function(_0x3780e4,_0x2ff306){var _0x500c45={'raw':!![],'where':{'id':_0x3780e4[_0x4520('0x43')]['id']}},_0x2978d5={};_0x2978d5[_0x4520('0x2f')]=_[_0x4520('0x44')](db['MailQueueReport'][_0x4520('0x45')]);_0x2978d5[_0x4520('0x30')]=_[_0x4520('0x44')](_0x3780e4[_0x4520('0x30')]);_0x2978d5[_0x4520('0x31')]=_[_0x4520('0x32')](_0x2978d5[_0x4520('0x2f')],_0x2978d5[_0x4520('0x30')]);_0x500c45[_0x4520('0x33')]=_[_0x4520('0x32')](_0x2978d5[_0x4520('0x2f')],qs[_0x4520('0x34')](_0x3780e4[_0x4520('0x30')][_0x4520('0x34')]));_0x500c45[_0x4520('0x33')]=_0x500c45[_0x4520('0x33')][_0x4520('0x35')]?_0x500c45['attributes']:_0x2978d5[_0x4520('0x2f')];if(_0x3780e4[_0x4520('0x30')]['includeAll']){_0x500c45['include']=[{'all':!![]}];}_0x500c45=_['merge']({},_0x500c45,_0x3780e4['options']);return db[_0x4520('0x2d')]['find'](_0x500c45)[_0x4520('0x41')](handleEntityNotFound(_0x2ff306,null))[_0x4520('0x41')](respondWithResult(_0x2ff306,null))[_0x4520('0x46')](handleError(_0x2ff306,null));};exports[_0x4520('0x47')]=function(_0x177c4e,_0x5e3eef){return db[_0x4520('0x2d')][_0x4520('0x47')](_0x177c4e[_0x4520('0x48')],{})[_0x4520('0x41')](respondWithResult(_0x5e3eef,0xc9))[_0x4520('0x46')](handleError(_0x5e3eef,null));};exports[_0x4520('0x26')]=function(_0x737ba4,_0x1e4821){if(_0x737ba4[_0x4520('0x48')]['id']){delete _0x737ba4[_0x4520('0x48')]['id'];}return db[_0x4520('0x2d')][_0x4520('0x49')]({'where':{'id':_0x737ba4['params']['id']}})['then'](handleEntityNotFound(_0x1e4821,null))[_0x4520('0x41')](saveUpdates(_0x737ba4[_0x4520('0x48')],null))[_0x4520('0x41')](respondWithResult(_0x1e4821,null))['catch'](handleError(_0x1e4821,null));};exports[_0x4520('0x27')]=function(_0x2288a7,_0x3f9a4c){return db['MailQueueReport'][_0x4520('0x49')]({'where':{'id':_0x2288a7[_0x4520('0x43')]['id']}})[_0x4520('0x41')](handleEntityNotFound(_0x3f9a4c,null))['then'](removeEntity(_0x3f9a4c,null))['catch'](handleError(_0x3f9a4c,null));};exports[_0x4520('0x4a')]=function(_0x24a6a4,_0x24269e){return db[_0x4520('0x2d')][_0x4520('0x4a')]()[_0x4520('0x41')](respondWithResult(_0x24269e,null))[_0x4520('0x46')](handleError(_0x24269e,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x430c,0x1a1));var _0xc430=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x430c[_0x43444b];return _0x392fe5;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 2f83eff..2bafc46 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 _0xe6ff=['rimraf','../../config/environment','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','bluebird','request-promise'];(function(_0xf09db3,_0x2a3d58){var _0xfa8444=function(_0x274323){while(--_0x274323){_0xf09db3['push'](_0xf09db3['shift']());}};_0xfa8444(++_0x2a3d58);}(_0xe6ff,0xe2));var _0xfe6f=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe6ff[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require('lodash');var util=require(_0xfe6f('0x0'));var logger=require(_0xfe6f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfe6f('0x2'));var rp=require(_0xfe6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe6f('0x4'));var config=require(_0xfe6f('0x5'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0xe12293,_0x1ddb29){return _0xe12293[_0xfe6f('0x6')](_0xfe6f('0x7'),attributes,{'tableName':_0xfe6f('0x8'),'paranoid':![],'indexes':[{'name':_0xfe6f('0x9'),'fields':[_0xfe6f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb350=['./mailQueueReport.attributes','exports','define','MailQueueReport','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x145e9e,_0x2e6dd4){var _0x2264c2=function(_0x57d209){while(--_0x57d209){_0x145e9e['push'](_0x145e9e['shift']());}};_0x2264c2(++_0x2e6dd4);}(_0xb350,0x143));var _0x0b35=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xb350[_0x934425];return _0x31d596;};'use strict';var _=require(_0x0b35('0x0'));var util=require(_0x0b35('0x1'));var logger=require(_0x0b35('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0b35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b35('0x4'));var rimraf=require(_0x0b35('0x5'));var config=require(_0x0b35('0x6'));var attributes=require(_0x0b35('0x7'));module[_0x0b35('0x8')]=function(_0xace33,_0x2e8fdc){return _0xace33[_0x0b35('0x9')](_0x0b35('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index a2c3fb4..478fcd6 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x35f853,_0x29a4ca){var _0x470eed=function(_0x4800ac){while(--_0x4800ac){_0x35f853['push'](_0x35f853['shift']());}};_0x470eed(++_0x29a4ca);}(_0x1261,0x144));var _0x1126=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x1261[_0x39c734];return _0xb2a2f9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x7b544a,_0x33c45a){var _0x33dcb4=function(_0x5ebc7f){while(--_0x5ebc7f){_0x7b544a['push'](_0x7b544a['shift']());}};_0x33dcb4(++_0x33c45a);}(_0x2ef3,0xba));var _0x32ef=function(_0x2ca34a,_0x36c4f3){_0x2ca34a=_0x2ca34a-0x0;var _0x56b1f6=_0x2ef3[_0x2ca34a];return _0x56b1f6;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 88ba0c2..0ff71ba 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x25b958,_0x34a6cb){var _0x2c5475=function(_0x336eee){while(--_0x336eee){_0x25b958['push'](_0x25b958['shift']());}};_0x2c5475(++_0x34a6cb);}(_0x70e0,0x17b));var _0x070e=function(_0x224d78,_0x1247ab){_0x224d78=_0x224d78-0x0;var _0x1433bd=_0x70e0[_0x224d78];return _0x1433bd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x7b656a,_0x580d40){var _0x3bf374=function(_0x33f964){while(--_0x33f964){_0x7b656a['push'](_0x7b656a['shift']());}};_0x3bf374(++_0x580d40);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ca7e40e..bdf77c1 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 _0x1b32=['BOOLEAN','INTEGER','INBOX','exports','STRING'];(function(_0x3c8073,_0x23a0b6){var _0xc7e0b8=function(_0x451e1e){while(--_0x451e1e){_0x3c8073['push'](_0x3c8073['shift']());}};_0xc7e0b8(++_0x23a0b6);}(_0x1b32,0x85));var _0x21b3=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x1b32[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require('sequelize');module[_0x21b3('0x0')]={'description':{'type':Sequelize[_0x21b3('0x1')]},'host':{'type':Sequelize[_0x21b3('0x1')]},'authentication':{'type':Sequelize[_0x21b3('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x21b3('0x1')]},'password':{'type':Sequelize[_0x21b3('0x1')]},'port':{'type':Sequelize[_0x21b3('0x3')]},'tls':{'type':Sequelize[_0x21b3('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x21b3('0x1')],'defaultValue':_0x21b3('0x4')},'connTimeout':{'type':Sequelize[_0x21b3('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x21b3('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x21b3('0x1')]}}; \ No newline at end of file +var _0x24cf=['INTEGER','STRING','BOOLEAN','INBOX'];(function(_0x37512d,_0x2da3d9){var _0x2c356f=function(_0x5914ae){while(--_0x5914ae){_0x37512d['push'](_0x37512d['shift']());}};_0x2c356f(++_0x2da3d9);}(_0x24cf,0x1d5));var _0xf24c=function(_0x53c8ba,_0x121727){_0x53c8ba=_0x53c8ba-0x0;var _0x5850e7=_0x24cf[_0x53c8ba];return _0x5850e7;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xf24c('0x0')]},'host':{'type':Sequelize[_0xf24c('0x0')]},'authentication':{'type':Sequelize[_0xf24c('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf24c('0x0')]},'password':{'type':Sequelize[_0xf24c('0x0')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xf24c('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf24c('0x0')],'defaultValue':_0xf24c('0x2')},'connTimeout':{'type':Sequelize[_0xf24c('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index b4ea3a9..439dbcc 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 _0x3b5a=['MailServerIn','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x3b5a,0x7a));var _0xa3b5=function(_0x34227d,_0x229d43){_0x34227d=_0x34227d-0x0;var _0x168cd2=_0x3b5a[_0x34227d];return _0x168cd2;};'use strict';var _=require(_0xa3b5('0x0'));var util=require('util');var logger=require(_0xa3b5('0x1'))(_0xa3b5('0x2'));var moment=require(_0xa3b5('0x3'));var BPromise=require('bluebird');var rp=require(_0xa3b5('0x4'));var fs=require('fs');var path=require(_0xa3b5('0x5'));var rimraf=require(_0xa3b5('0x6'));var config=require(_0xa3b5('0x7'));var attributes=require(_0xa3b5('0x8'));module[_0xa3b5('0x9')]=function(_0x2e1b56,_0x3b6c3f){return _0x2e1b56['define'](_0xa3b5('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4783=['exports','define','MailServerIn','lodash','util','api','moment','rimraf','./mailServerIn.attributes'];(function(_0x1b1bf3,_0x2c813a){var _0x5d22f1=function(_0x1b9ce5){while(--_0x1b9ce5){_0x1b1bf3['push'](_0x1b1bf3['shift']());}};_0x5d22f1(++_0x2c813a);}(_0x4783,0x1e0));var _0x3478=function(_0x1316dc,_0x1a6fc0){_0x1316dc=_0x1316dc-0x0;var _0x22e627=_0x4783[_0x1316dc];return _0x22e627;};'use strict';var _=require(_0x3478('0x0'));var util=require(_0x3478('0x1'));var logger=require('../../config/logger')(_0x3478('0x2'));var moment=require(_0x3478('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3478('0x4'));var config=require('../../config/environment');var attributes=require(_0x3478('0x5'));module[_0x3478('0x6')]=function(_0x3536a0,_0x10618d){return _0x3536a0[_0x3478('0x7')](_0x3478('0x8'),attributes,{'tableName':'mail_servers_in','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 b99812c..39f9571 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 _0x6085=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','model','map','lodash','util','bluebird'];(function(_0x208215,_0x52e308){var _0x174c6d=function(_0x1575fd){while(--_0x1575fd){_0x208215['push'](_0x208215['shift']());}};_0x174c6d(++_0x52e308);}(_0x6085,0x15d));var _0x5608=function(_0x38fe7f,_0x1ee2f2){_0x38fe7f=_0x38fe7f-0x0;var _0x20d2ff=_0x6085[_0x38fe7f];return _0x20d2ff;};'use strict';var _=require(_0x5608('0x0'));var util=require(_0x5608('0x1'));var moment=require('moment');var BPromise=require(_0x5608('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5608('0x3'));var logger=require(_0x5608('0x4'))('rpc');var config=require(_0x5608('0x5'));var jayson=require(_0x5608('0x6'));var client=jayson[_0x5608('0x7')][_0x5608('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e5a94,_0x545e78,_0x1a25f2){return new BPromise(function(_0x322c9b,_0x5c177a){return client[_0x5608('0x9')](_0x3e5a94,_0x1a25f2)[_0x5608('0xa')](function(_0x57c27b){logger[_0x5608('0xb')]('MailServerIn,\x20%s,\x20%s',_0x545e78,'request\x20sent');logger[_0x5608('0xc')](_0x5608('0xd'),_0x545e78,_0x5608('0xe'),JSON[_0x5608('0xf')](_0x57c27b));if(_0x57c27b[_0x5608('0x10')]){if(_0x57c27b[_0x5608('0x10')][_0x5608('0x11')]===0x1f4){logger[_0x5608('0x10')](_0x5608('0x12'),_0x545e78,_0x57c27b['error'][_0x5608('0x13')]);return _0x5c177a(_0x57c27b[_0x5608('0x10')]['message']);}logger[_0x5608('0x10')](_0x5608('0x12'),_0x545e78,_0x57c27b[_0x5608('0x10')]['message']);return _0x322c9b(_0x57c27b[_0x5608('0x10')][_0x5608('0x13')]);}else{logger[_0x5608('0xb')](_0x5608('0x12'),_0x545e78,'request\x20sent');_0x322c9b(_0x57c27b[_0x5608('0x14')]['message']);}})[_0x5608('0x15')](function(_0x2b6abb){logger[_0x5608('0x10')]('MailServerIn,\x20%s,\x20%s',_0x545e78,_0x2b6abb);_0x5c177a(_0x2b6abb);});});}exports[_0x5608('0x16')]=function(_0x80f1dc){var _0x428cb9=this;return new Promise(function(_0x228ae2,_0x503fdc){return db[_0x5608('0x17')]['findAll']({'raw':_0x80f1dc[_0x5608('0x18')]?_0x80f1dc[_0x5608('0x18')][_0x5608('0x19')]===undefined?!![]:![]:!![],'where':_0x80f1dc[_0x5608('0x18')]?_0x80f1dc[_0x5608('0x18')][_0x5608('0x1a')]||null:null,'attributes':_0x80f1dc[_0x5608('0x18')]?_0x80f1dc['options'][_0x5608('0x1b')]||null:null,'limit':_0x80f1dc[_0x5608('0x18')]?_0x80f1dc[_0x5608('0x18')][_0x5608('0x1c')]||null:null,'include':_0x80f1dc[_0x5608('0x18')]?_0x80f1dc[_0x5608('0x18')][_0x5608('0x1d')]?_['map'](_0x80f1dc['options']['include'],function(_0x15146b){return{'model':db[_0x15146b[_0x5608('0x1e')]],'as':_0x15146b['as'],'attributes':_0x15146b[_0x5608('0x1b')],'include':_0x15146b['include']?_[_0x5608('0x1f')](_0x15146b[_0x5608('0x1d')],function(_0x3779ca){return{'model':db[_0x3779ca[_0x5608('0x1e')]],'as':_0x3779ca['as'],'attributes':_0x3779ca[_0x5608('0x1b')],'include':_0x3779ca['include']?_['map'](_0x3779ca[_0x5608('0x1d')],function(_0x15a55f){return{'model':db[_0x15a55f[_0x5608('0x1e')]],'as':_0x15a55f['as'],'attributes':_0x15a55f[_0x5608('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1953ef){logger['info'](_0x5608('0x16'),_0x80f1dc);logger['debug']('GetMailServerIn',_0x80f1dc,JSON['stringify'](_0x1953ef));_0x228ae2(_0x1953ef);})[_0x5608('0x15')](function(_0x1b34f7){logger[_0x5608('0x10')]('GetMailServerIn',_0x1b34f7['message'],_0x80f1dc);_0x503fdc(_0x428cb9[_0x5608('0x10')](0x1f4,_0x1b34f7[_0x5608('0x13')]));});});}; \ No newline at end of file +var _0xa508=['info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes','include','map','model','GetMailServerIn','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1676d9,_0x3cdfd0){var _0x3892d0=function(_0x532e6a){while(--_0x532e6a){_0x1676d9['push'](_0x1676d9['shift']());}};_0x3892d0(++_0x3cdfd0);}(_0xa508,0x187));var _0x8a50=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xa508[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x8a50('0x0'));var util=require(_0x8a50('0x1'));var moment=require('moment');var BPromise=require(_0x8a50('0x2'));var rs=require(_0x8a50('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a50('0x4'));var logger=require(_0x8a50('0x5'))(_0x8a50('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a50('0x7'));var client=jayson[_0x8a50('0x8')][_0x8a50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57164d,_0x17b466,_0x7c6390){return new BPromise(function(_0x3b6fe8,_0x550bb7){return client[_0x8a50('0xa')](_0x57164d,_0x7c6390)[_0x8a50('0xb')](function(_0x21ef6f){logger[_0x8a50('0xc')](_0x8a50('0xd'),_0x17b466,'request\x20sent');logger[_0x8a50('0xe')](_0x8a50('0xf'),_0x17b466,_0x8a50('0x10'),JSON[_0x8a50('0x11')](_0x21ef6f));if(_0x21ef6f[_0x8a50('0x12')]){if(_0x21ef6f['error'][_0x8a50('0x13')]===0x1f4){logger['error'](_0x8a50('0xd'),_0x17b466,_0x21ef6f[_0x8a50('0x12')][_0x8a50('0x14')]);return _0x550bb7(_0x21ef6f[_0x8a50('0x12')]['message']);}logger[_0x8a50('0x12')](_0x8a50('0xd'),_0x17b466,_0x21ef6f[_0x8a50('0x12')]['message']);return _0x3b6fe8(_0x21ef6f[_0x8a50('0x12')][_0x8a50('0x14')]);}else{logger[_0x8a50('0xc')](_0x8a50('0xd'),_0x17b466,_0x8a50('0x10'));_0x3b6fe8(_0x21ef6f[_0x8a50('0x15')][_0x8a50('0x14')]);}})[_0x8a50('0x16')](function(_0x18afad){logger['error'](_0x8a50('0xd'),_0x17b466,_0x18afad);_0x550bb7(_0x18afad);});});}exports['GetMailServerIn']=function(_0x35ccf3){var _0x44a802=this;return new Promise(function(_0x23db0c,_0x30364e){return db['MailServerIn']['findAll']({'raw':_0x35ccf3[_0x8a50('0x17')]?_0x35ccf3[_0x8a50('0x17')][_0x8a50('0x18')]===undefined?!![]:![]:!![],'where':_0x35ccf3[_0x8a50('0x17')]?_0x35ccf3[_0x8a50('0x17')][_0x8a50('0x19')]||null:null,'attributes':_0x35ccf3['options']?_0x35ccf3['options'][_0x8a50('0x1a')]||null:null,'limit':_0x35ccf3[_0x8a50('0x17')]?_0x35ccf3[_0x8a50('0x17')]['limit']||null:null,'include':_0x35ccf3[_0x8a50('0x17')]?_0x35ccf3['options'][_0x8a50('0x1b')]?_['map'](_0x35ccf3[_0x8a50('0x17')][_0x8a50('0x1b')],function(_0x14c02b){return{'model':db[_0x14c02b['model']],'as':_0x14c02b['as'],'attributes':_0x14c02b[_0x8a50('0x1a')],'include':_0x14c02b['include']?_[_0x8a50('0x1c')](_0x14c02b['include'],function(_0x59a23c){return{'model':db[_0x59a23c[_0x8a50('0x1d')]],'as':_0x59a23c['as'],'attributes':_0x59a23c[_0x8a50('0x1a')],'include':_0x59a23c['include']?_[_0x8a50('0x1c')](_0x59a23c[_0x8a50('0x1b')],function(_0x8ed841){return{'model':db[_0x8ed841[_0x8a50('0x1d')]],'as':_0x8ed841['as'],'attributes':_0x8ed841[_0x8a50('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8a50('0xb')](function(_0x41fade){logger[_0x8a50('0xc')](_0x8a50('0x1e'),_0x35ccf3);logger['debug'](_0x8a50('0x1e'),_0x35ccf3,JSON[_0x8a50('0x11')](_0x41fade));_0x23db0c(_0x41fade);})[_0x8a50('0x16')](function(_0xd0785e){logger[_0x8a50('0x12')]('GetMailServerIn',_0xd0785e[_0x8a50('0x14')],_0x35ccf3);_0x30364e(_0x44a802['error'](0x1f4,_0xd0785e[_0x8a50('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ed195fa..a79466c 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x7a0085,_0x9c470){_0x7a0085=_0x7a0085-0x0;var _0x75bce4=_0x7a54[_0x7a0085];return _0x75bce4;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x3ecc74,_0x410769){_0x3ecc74=_0x3ecc74-0x0;var _0x17a13c=_0x7a54[_0x3ecc74];return _0x17a13c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 7111faa..a872479 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 _0x1612=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x2b6189,_0x30c2d4){var _0x1fc239=function(_0x5bceb6){while(--_0x5bceb6){_0x2b6189['push'](_0x2b6189['shift']());}};_0x1fc239(++_0x30c2d4);}(_0x1612,0x8b));var _0x2161=function(_0xa940b7,_0x59344a){_0xa940b7=_0xa940b7-0x0;var _0x352428=_0x1612[_0xa940b7];return _0x352428;};'use strict';var Sequelize=require(_0x2161('0x0'));module[_0x2161('0x1')]={'description':{'type':Sequelize[_0x2161('0x2')]},'host':{'type':Sequelize[_0x2161('0x2')]},'user':{'type':Sequelize[_0x2161('0x2')]},'pass':{'type':Sequelize[_0x2161('0x2')]},'port':{'type':Sequelize[_0x2161('0x3')]},'secure':{'type':Sequelize[_0x2161('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x2161('0x2')]},'authentication':{'type':Sequelize[_0x2161('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8a87=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0x8a87,0x6b));var _0x78a8=function(_0x119b4b,_0x322a87){_0x119b4b=_0x119b4b-0x0;var _0x2ca4d5=_0x8a87[_0x119b4b];return _0x2ca4d5;};'use strict';var Sequelize=require(_0x78a8('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x78a8('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x78a8('0x1')]},'port':{'type':Sequelize[_0x78a8('0x2')]},'secure':{'type':Sequelize[_0x78a8('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x78a8('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 eb44d62..681547b 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 _0x6336=['hasOwnProperty','order','where','pick','filter','merge','options','MailServerOut','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x6336,0x94));var _0x6633=function(_0x5f3373,_0x4e8c2e){_0x5f3373=_0x5f3373-0x0;var _0x4370b0=_0x6336[_0x5f3373];return _0x4370b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6633('0x0'));var zipdir=require(_0x6633('0x1'));var jsonpatch=require(_0x6633('0x2'));var rp=require('request-promise');var moment=require(_0x6633('0x3'));var BPromise=require(_0x6633('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6633('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6633('0x6'));var _=require(_0x6633('0x7'));var squel=require(_0x6633('0x8'));var crypto=require(_0x6633('0x9'));var jsforce=require(_0x6633('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6633('0x5'));var querystring=require(_0x6633('0xb'));var Papa=require('papaparse');var Redis=require(_0x6633('0xc'));var authService=require(_0x6633('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6633('0xe'))(_0x6633('0xf'));var utils=require(_0x6633('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x6633('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b160a,_0x3299b3){_0x3299b3=_0x3299b3||0xcc;return function(_0x5c2552){if(_0x5c2552){return _0x1b160a['sendStatus'](_0x3299b3);}return _0x1b160a[_0x6633('0x12')](_0x3299b3)[_0x6633('0x13')]();};}function respondWithResult(_0x259f0a,_0x48ef0b){_0x48ef0b=_0x48ef0b||0xc8;return function(_0xef041a){if(_0xef041a){return _0x259f0a[_0x6633('0x12')](_0x48ef0b)[_0x6633('0x14')](_0xef041a);}};}function respondWithFilteredResult(_0x1f0a4c,_0xb1671d){return function(_0x53054b){if(_0x53054b){var _0x11d2e1=typeof _0xb1671d[_0x6633('0x15')]===_0x6633('0x16')&&typeof _0xb1671d[_0x6633('0x17')]===_0x6633('0x16');var _0x8ad91=_0x53054b[_0x6633('0x18')];var _0x16ea1b=_0x11d2e1?0x0:_0xb1671d[_0x6633('0x15')];var _0x56e8e8=_0x11d2e1?_0x53054b[_0x6633('0x18')]:_0xb1671d[_0x6633('0x15')]+_0xb1671d[_0x6633('0x17')];var _0x4c4ec7;if(_0x56e8e8>=_0x8ad91){_0x56e8e8=_0x8ad91;_0x4c4ec7=0xc8;}else{_0x4c4ec7=0xce;}_0x1f0a4c['status'](_0x4c4ec7);return _0x1f0a4c[_0x6633('0x19')](_0x6633('0x1a'),_0x16ea1b+'-'+_0x56e8e8+'/'+_0x8ad91)[_0x6633('0x14')](_0x53054b);}return null;};}function patchUpdates(_0x440943){return function(_0xbdf7a8){try{jsonpatch[_0x6633('0x1b')](_0xbdf7a8,_0x440943,!![]);}catch(_0x512165){return BPromise[_0x6633('0x1c')](_0x512165);}return _0xbdf7a8[_0x6633('0x1d')]();};}function saveUpdates(_0x38757c,_0x344a49){return function(_0x1b870e){if(_0x1b870e){return _0x1b870e[_0x6633('0x1e')](_0x38757c)[_0x6633('0x1f')](function(_0x36e041){return _0x36e041;});}return null;};}function removeEntity(_0x438608,_0xccc612){return function(_0x3c084c){if(_0x3c084c){return _0x3c084c[_0x6633('0x20')]()[_0x6633('0x1f')](function(){_0x438608[_0x6633('0x12')](0xcc)[_0x6633('0x13')]();});}};}function handleEntityNotFound(_0x489137,_0x2d4b17){return function(_0x349944){if(!_0x349944){_0x489137[_0x6633('0x21')](0x194);}return _0x349944;};}function handleError(_0x564bbf,_0x500a8a){_0x500a8a=_0x500a8a||0x1f4;return function(_0x1b96c3){logger[_0x6633('0x22')](_0x1b96c3['stack']);if(_0x1b96c3['name']){delete _0x1b96c3['name'];}_0x564bbf[_0x6633('0x12')](_0x500a8a)[_0x6633('0x23')](_0x1b96c3);};}exports[_0x6633('0x24')]=function(_0x3aa0ba,_0x113d4b){var _0x50e5c2={},_0x5cbe64={},_0x15c4c5={'count':0x0,'rows':[]};var _0x186cbc=_[_0x6633('0x25')](db['MailServerOut'][_0x6633('0x26')],function(_0x5c39ef){return{'name':_0x5c39ef[_0x6633('0x27')],'type':_0x5c39ef[_0x6633('0x28')]['key']};});_0x5cbe64[_0x6633('0x29')]=_[_0x6633('0x25')](_0x186cbc,_0x6633('0x2a'));_0x5cbe64[_0x6633('0x2b')]=_[_0x6633('0x2c')](_0x3aa0ba['query']);_0x5cbe64[_0x6633('0x2d')]=_[_0x6633('0x2e')](_0x5cbe64[_0x6633('0x29')],_0x5cbe64[_0x6633('0x2b')]);_0x50e5c2[_0x6633('0x2f')]=_[_0x6633('0x2e')](_0x5cbe64[_0x6633('0x29')],qs[_0x6633('0x30')](_0x3aa0ba['query']['fields']));_0x50e5c2['attributes']=_0x50e5c2[_0x6633('0x2f')][_0x6633('0x31')]?_0x50e5c2['attributes']:_0x5cbe64[_0x6633('0x29')];if(!_0x3aa0ba[_0x6633('0x2b')][_0x6633('0x32')]('nolimit')){_0x50e5c2[_0x6633('0x17')]=qs[_0x6633('0x17')](_0x3aa0ba[_0x6633('0x2b')][_0x6633('0x17')]);_0x50e5c2[_0x6633('0x15')]=qs[_0x6633('0x15')](_0x3aa0ba[_0x6633('0x2b')]['offset']);}_0x50e5c2[_0x6633('0x33')]=qs['sort'](_0x3aa0ba[_0x6633('0x2b')]['sort']);_0x50e5c2[_0x6633('0x34')]=qs[_0x6633('0x2d')](_[_0x6633('0x35')](_0x3aa0ba['query'],_0x5cbe64[_0x6633('0x2d')]),_0x186cbc);if(_0x3aa0ba[_0x6633('0x2b')][_0x6633('0x36')]){_0x50e5c2[_0x6633('0x34')]=_[_0x6633('0x37')](_0x50e5c2['where'],{'$or':_[_0x6633('0x25')](_0x186cbc,function(_0x10d367){if(_0x10d367['type']!=='VIRTUAL'){var _0x223987={};_0x223987[_0x10d367[_0x6633('0x2a')]]={'$like':'%'+_0x3aa0ba[_0x6633('0x2b')][_0x6633('0x36')]+'%'};return _0x223987;}})});}_0x50e5c2=_[_0x6633('0x37')]({},_0x50e5c2,_0x3aa0ba[_0x6633('0x38')]);var _0x25aca4={'where':_0x50e5c2['where']};return db[_0x6633('0x39')][_0x6633('0x18')](_0x25aca4)[_0x6633('0x1f')](function(_0x359cf9){_0x15c4c5[_0x6633('0x18')]=_0x359cf9;if(_0x3aa0ba['query']['includeAll']){_0x50e5c2[_0x6633('0x3a')]=[{'all':!![]}];}return db['MailServerOut'][_0x6633('0x3b')](_0x50e5c2);})[_0x6633('0x1f')](function(_0x4fa2f0){_0x15c4c5[_0x6633('0x3c')]=_0x4fa2f0;return _0x15c4c5;})['then'](respondWithFilteredResult(_0x113d4b,_0x50e5c2))[_0x6633('0x3d')](handleError(_0x113d4b,null));};exports['show']=function(_0x2cbb14,_0xbed10c){var _0x521ca5={'raw':!![],'where':{'id':_0x2cbb14[_0x6633('0x3e')]['id']}},_0x550c26={};_0x550c26[_0x6633('0x29')]=_[_0x6633('0x2c')](db[_0x6633('0x39')][_0x6633('0x26')]);_0x550c26[_0x6633('0x2b')]=_[_0x6633('0x2c')](_0x2cbb14[_0x6633('0x2b')]);_0x550c26[_0x6633('0x2d')]=_[_0x6633('0x2e')](_0x550c26[_0x6633('0x29')],_0x550c26[_0x6633('0x2b')]);_0x521ca5['attributes']=_[_0x6633('0x2e')](_0x550c26[_0x6633('0x29')],qs[_0x6633('0x30')](_0x2cbb14[_0x6633('0x2b')][_0x6633('0x30')]));_0x521ca5[_0x6633('0x2f')]=_0x521ca5[_0x6633('0x2f')]['length']?_0x521ca5['attributes']:_0x550c26[_0x6633('0x29')];if(_0x2cbb14['query']['includeAll']){_0x521ca5[_0x6633('0x3a')]=[{'all':!![]}];}_0x521ca5=_[_0x6633('0x37')]({},_0x521ca5,_0x2cbb14['options']);return db[_0x6633('0x39')][_0x6633('0x3f')](_0x521ca5)[_0x6633('0x1f')](handleEntityNotFound(_0xbed10c,null))['then'](respondWithResult(_0xbed10c,null))['catch'](handleError(_0xbed10c,null));};exports[_0x6633('0x40')]=function(_0x32007f,_0x1dce9f){return db[_0x6633('0x39')]['create'](_0x32007f[_0x6633('0x41')],{})[_0x6633('0x1f')](respondWithResult(_0x1dce9f,0xc9))[_0x6633('0x3d')](handleError(_0x1dce9f,null));};exports[_0x6633('0x1e')]=function(_0x2710f3,_0x47b9b1){if(_0x2710f3[_0x6633('0x41')]['id']){delete _0x2710f3[_0x6633('0x41')]['id'];}return db[_0x6633('0x39')][_0x6633('0x3f')]({'where':{'id':_0x2710f3[_0x6633('0x3e')]['id']}})['then'](handleEntityNotFound(_0x47b9b1,null))[_0x6633('0x1f')](saveUpdates(_0x2710f3[_0x6633('0x41')],null))[_0x6633('0x1f')](respondWithResult(_0x47b9b1,null))[_0x6633('0x3d')](handleError(_0x47b9b1,null));};exports[_0x6633('0x20')]=function(_0x16a814,_0x48d7fd){return db[_0x6633('0x39')][_0x6633('0x3f')]({'where':{'id':_0x16a814[_0x6633('0x3e')]['id']}})[_0x6633('0x1f')](handleEntityNotFound(_0x48d7fd,null))['then'](removeEntity(_0x48d7fd,null))[_0x6633('0x3d')](handleError(_0x48d7fd,null));}; \ No newline at end of file +var _0x72dc=['moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','query','fields','hasOwnProperty','nolimit','sort','filter','where','options','includeAll','findAll','then','rows','catch','params','keys','length','include','create','update','body','find','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x187fe5,_0x2ef008){var _0x221be0=function(_0x1d71bf){while(--_0x1d71bf){_0x187fe5['push'](_0x187fe5['shift']());}};_0x221be0(++_0x2ef008);}(_0x72dc,0x1b2));var _0xc72d=function(_0x53a0ce,_0x5eaa86){_0x53a0ce=_0x53a0ce-0x0;var _0x491112=_0x72dc[_0x53a0ce];return _0x491112;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc72d('0x0'));var zipdir=require(_0xc72d('0x1'));var jsonpatch=require(_0xc72d('0x2'));var rp=require(_0xc72d('0x3'));var moment=require(_0xc72d('0x4'));var BPromise=require(_0xc72d('0x5'));var Mustache=require(_0xc72d('0x6'));var util=require(_0xc72d('0x7'));var path=require(_0xc72d('0x8'));var sox=require('sox');var csv=require(_0xc72d('0x9'));var ejs=require(_0xc72d('0xa'));var fs=require('fs');var fs_extra=require(_0xc72d('0xb'));var _=require(_0xc72d('0xc'));var squel=require(_0xc72d('0xd'));var crypto=require('crypto');var jsforce=require(_0xc72d('0xe'));var deskjs=require(_0xc72d('0xf'));var toCsv=require(_0xc72d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc72d('0x10'));var authService=require(_0xc72d('0x11'));var qs=require(_0xc72d('0x12'));var as=require(_0xc72d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc72d('0x14'))(_0xc72d('0x15'));var utils=require('../../config/utils');var config=require(_0xc72d('0x16'));var licenseUtil=require(_0xc72d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24911c,_0x5f58e9){_0x5f58e9=_0x5f58e9||0xcc;return function(_0x51f963){if(_0x51f963){return _0x24911c[_0xc72d('0x18')](_0x5f58e9);}return _0x24911c[_0xc72d('0x19')](_0x5f58e9)[_0xc72d('0x1a')]();};}function respondWithResult(_0x24bfb7,_0x2a606c){_0x2a606c=_0x2a606c||0xc8;return function(_0x34dbf4){if(_0x34dbf4){return _0x24bfb7[_0xc72d('0x19')](_0x2a606c)[_0xc72d('0x1b')](_0x34dbf4);}};}function respondWithFilteredResult(_0xf11a6f,_0x22f6d2){return function(_0x46423e){if(_0x46423e){var _0x1f6594=typeof _0x22f6d2[_0xc72d('0x1c')]===_0xc72d('0x1d')&&typeof _0x22f6d2['limit']===_0xc72d('0x1d');var _0x33b52a=_0x46423e[_0xc72d('0x1e')];var _0x23c50d=_0x1f6594?0x0:_0x22f6d2[_0xc72d('0x1c')];var _0x576e50=_0x1f6594?_0x46423e['count']:_0x22f6d2[_0xc72d('0x1c')]+_0x22f6d2[_0xc72d('0x1f')];var _0xa51219;if(_0x576e50>=_0x33b52a){_0x576e50=_0x33b52a;_0xa51219=0xc8;}else{_0xa51219=0xce;}_0xf11a6f[_0xc72d('0x19')](_0xa51219);return _0xf11a6f[_0xc72d('0x20')](_0xc72d('0x21'),_0x23c50d+'-'+_0x576e50+'/'+_0x33b52a)[_0xc72d('0x1b')](_0x46423e);}return null;};}function patchUpdates(_0x8b4aaf){return function(_0x1e9cad){try{jsonpatch[_0xc72d('0x22')](_0x1e9cad,_0x8b4aaf,!![]);}catch(_0x1c88e8){return BPromise[_0xc72d('0x23')](_0x1c88e8);}return _0x1e9cad[_0xc72d('0x24')]();};}function saveUpdates(_0x568de1,_0x54ad1c){return function(_0x4334e1){if(_0x4334e1){return _0x4334e1['update'](_0x568de1)['then'](function(_0x4f4de3){return _0x4f4de3;});}return null;};}function removeEntity(_0x4afa22,_0x38f631){return function(_0x1e05c5){if(_0x1e05c5){return _0x1e05c5[_0xc72d('0x25')]()['then'](function(){_0x4afa22[_0xc72d('0x19')](0xcc)[_0xc72d('0x1a')]();});}};}function handleEntityNotFound(_0x101b0f,_0x417ae0){return function(_0x561841){if(!_0x561841){_0x101b0f[_0xc72d('0x18')](0x194);}return _0x561841;};}function handleError(_0x24b44c,_0x54dc11){_0x54dc11=_0x54dc11||0x1f4;return function(_0x48f785){logger[_0xc72d('0x26')](_0x48f785[_0xc72d('0x27')]);if(_0x48f785[_0xc72d('0x28')]){delete _0x48f785[_0xc72d('0x28')];}_0x24b44c[_0xc72d('0x19')](_0x54dc11)[_0xc72d('0x29')](_0x48f785);};}exports['index']=function(_0x5bdf3b,_0x3c38c9){var _0x6c22c1={},_0x3596e4={},_0x288c3a={'count':0x0,'rows':[]};var _0x1fe3fc=_[_0xc72d('0x2a')](db[_0xc72d('0x2b')][_0xc72d('0x2c')],function(_0x2fc2b7){return{'name':_0x2fc2b7[_0xc72d('0x2d')],'type':_0x2fc2b7[_0xc72d('0x2e')][_0xc72d('0x2f')]};});_0x3596e4[_0xc72d('0x30')]=_[_0xc72d('0x2a')](_0x1fe3fc,_0xc72d('0x28'));_0x3596e4['query']=_['keys'](_0x5bdf3b['query']);_0x3596e4[_0xc72d('0x31')]=_[_0xc72d('0x32')](_0x3596e4[_0xc72d('0x30')],_0x3596e4['query']);_0x6c22c1[_0xc72d('0x33')]=_['intersection'](_0x3596e4[_0xc72d('0x30')],qs['fields'](_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x35')]));_0x6c22c1['attributes']=_0x6c22c1[_0xc72d('0x33')]['length']?_0x6c22c1[_0xc72d('0x33')]:_0x3596e4['model'];if(!_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x36')](_0xc72d('0x37'))){_0x6c22c1[_0xc72d('0x1f')]=qs['limit'](_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x1f')]);_0x6c22c1['offset']=qs[_0xc72d('0x1c')](_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x1c')]);}_0x6c22c1['order']=qs['sort'](_0x5bdf3b['query'][_0xc72d('0x38')]);_0x6c22c1['where']=qs[_0xc72d('0x31')](_['pick'](_0x5bdf3b['query'],_0x3596e4[_0xc72d('0x31')]),_0x1fe3fc);if(_0x5bdf3b['query'][_0xc72d('0x39')]){_0x6c22c1[_0xc72d('0x3a')]=_['merge'](_0x6c22c1[_0xc72d('0x3a')],{'$or':_[_0xc72d('0x2a')](_0x1fe3fc,function(_0x503c3c){if(_0x503c3c[_0xc72d('0x2e')]!=='VIRTUAL'){var _0x21d6b7={};_0x21d6b7[_0x503c3c[_0xc72d('0x28')]]={'$like':'%'+_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x39')]+'%'};return _0x21d6b7;}})});}_0x6c22c1=_['merge']({},_0x6c22c1,_0x5bdf3b[_0xc72d('0x3b')]);var _0x366ed5={'where':_0x6c22c1[_0xc72d('0x3a')]};return db['MailServerOut'][_0xc72d('0x1e')](_0x366ed5)['then'](function(_0xd2dda9){_0x288c3a[_0xc72d('0x1e')]=_0xd2dda9;if(_0x5bdf3b[_0xc72d('0x34')][_0xc72d('0x3c')]){_0x6c22c1['include']=[{'all':!![]}];}return db[_0xc72d('0x2b')][_0xc72d('0x3d')](_0x6c22c1);})[_0xc72d('0x3e')](function(_0xccb93c){_0x288c3a[_0xc72d('0x3f')]=_0xccb93c;return _0x288c3a;})[_0xc72d('0x3e')](respondWithFilteredResult(_0x3c38c9,_0x6c22c1))[_0xc72d('0x40')](handleError(_0x3c38c9,null));};exports['show']=function(_0x2c44e9,_0x5ee94d){var _0x3a06ee={'raw':!![],'where':{'id':_0x2c44e9[_0xc72d('0x41')]['id']}},_0x466373={};_0x466373['model']=_[_0xc72d('0x42')](db[_0xc72d('0x2b')]['rawAttributes']);_0x466373['query']=_[_0xc72d('0x42')](_0x2c44e9[_0xc72d('0x34')]);_0x466373[_0xc72d('0x31')]=_[_0xc72d('0x32')](_0x466373['model'],_0x466373[_0xc72d('0x34')]);_0x3a06ee[_0xc72d('0x33')]=_[_0xc72d('0x32')](_0x466373[_0xc72d('0x30')],qs['fields'](_0x2c44e9[_0xc72d('0x34')]['fields']));_0x3a06ee[_0xc72d('0x33')]=_0x3a06ee[_0xc72d('0x33')][_0xc72d('0x43')]?_0x3a06ee[_0xc72d('0x33')]:_0x466373[_0xc72d('0x30')];if(_0x2c44e9[_0xc72d('0x34')]['includeAll']){_0x3a06ee[_0xc72d('0x44')]=[{'all':!![]}];}_0x3a06ee=_['merge']({},_0x3a06ee,_0x2c44e9['options']);return db['MailServerOut']['find'](_0x3a06ee)[_0xc72d('0x3e')](handleEntityNotFound(_0x5ee94d,null))[_0xc72d('0x3e')](respondWithResult(_0x5ee94d,null))['catch'](handleError(_0x5ee94d,null));};exports[_0xc72d('0x45')]=function(_0x5697d5,_0x387e0d){return db['MailServerOut'][_0xc72d('0x45')](_0x5697d5['body'],{})[_0xc72d('0x3e')](respondWithResult(_0x387e0d,0xc9))[_0xc72d('0x40')](handleError(_0x387e0d,null));};exports[_0xc72d('0x46')]=function(_0x2599d9,_0x4ba316){if(_0x2599d9[_0xc72d('0x47')]['id']){delete _0x2599d9['body']['id'];}return db[_0xc72d('0x2b')][_0xc72d('0x48')]({'where':{'id':_0x2599d9[_0xc72d('0x41')]['id']}})[_0xc72d('0x3e')](handleEntityNotFound(_0x4ba316,null))[_0xc72d('0x3e')](saveUpdates(_0x2599d9[_0xc72d('0x47')],null))[_0xc72d('0x3e')](respondWithResult(_0x4ba316,null))[_0xc72d('0x40')](handleError(_0x4ba316,null));};exports['destroy']=function(_0x4401d0,_0x445cd3){return db[_0xc72d('0x2b')]['find']({'where':{'id':_0x4401d0[_0xc72d('0x41')]['id']}})[_0xc72d('0x3e')](handleEntityNotFound(_0x445cd3,null))[_0xc72d('0x3e')](removeEntity(_0x445cd3,null))[_0xc72d('0x40')](handleError(_0x445cd3,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9e19c39..7bea9d6 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 _0xd212=['../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b56e7,_0x3291e3){var _0x2347d4=function(_0x2f88f7){while(--_0x2f88f7){_0x1b56e7['push'](_0x1b56e7['shift']());}};_0x2347d4(++_0x3291e3);}(_0xd212,0xc0));var _0x2d21=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0xd212[_0x318256];return _0xb1e352;};'use strict';var _=require('lodash');var util=require(_0x2d21('0x0'));var logger=require(_0x2d21('0x1'))(_0x2d21('0x2'));var moment=require(_0x2d21('0x3'));var BPromise=require(_0x2d21('0x4'));var rp=require(_0x2d21('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2d21('0x6'));var attributes=require(_0x2d21('0x7'));module['exports']=function(_0x1e071b,_0x1954bd){return _0x1e071b[_0x2d21('0x8')](_0x2d21('0x9'),attributes,{'tableName':_0x2d21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x711c=['rimraf','../../config/environment','./mailServerOut.attributes','define','mail_servers_out','util','../../config/logger','api','moment','request-promise'];(function(_0x579121,_0x27e9e2){var _0x38a4ae=function(_0x53e154){while(--_0x53e154){_0x579121['push'](_0x579121['shift']());}};_0x38a4ae(++_0x27e9e2);}(_0x711c,0x145));var _0xc711=function(_0x3d64d4,_0x362a8f){_0x3d64d4=_0x3d64d4-0x0;var _0x25d446=_0x711c[_0x3d64d4];return _0x25d446;};'use strict';var _=require('lodash');var util=require(_0xc711('0x0'));var logger=require(_0xc711('0x1'))(_0xc711('0x2'));var moment=require(_0xc711('0x3'));var BPromise=require('bluebird');var rp=require(_0xc711('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc711('0x5'));var config=require(_0xc711('0x6'));var attributes=require(_0xc711('0x7'));module['exports']=function(_0x13df1c,_0x256d87){return _0x13df1c[_0xc711('0x8')]('MailServerOut',attributes,{'tableName':_0xc711('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 ff0ff13..136cbd6 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5498c9,_0x483523){var _0x2ad308=function(_0x5ae33f){while(--_0x5ae33f){_0x5498c9['push'](_0x5498c9['shift']());}};_0x2ad308(++_0x483523);}(_0x1261,0x144));var _0x1126=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x1261[_0x4eb6ec];return _0x58881b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x402ca6,_0x4535dc){var _0x49cf3a=function(_0x1f0561){while(--_0x1f0561){_0x402ca6['push'](_0x402ca6['shift']());}};_0x49cf3a(++_0x4535dc);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18b430,_0x18e100){_0x18b430=_0x18b430-0x0;var _0x4be816=_0x5f2f[_0x18b430];return _0x4be816;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c8cb1c7..4530718 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 _0x6874=['get','isAuthenticated','/describe','describe','create','put','/:id','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0xbf2d95,_0x1adb10){var _0x2ff197=function(_0xb78bb6){while(--_0xb78bb6){_0xbf2d95['push'](_0xbf2d95['shift']());}};_0x2ff197(++_0x1adb10);}(_0x6874,0x87));var _0x4687=function(_0x2fd6ce,_0x5d47a8){_0x2fd6ce=_0x2fd6ce-0x0;var _0x50c911=_0x6874[_0x2fd6ce];return _0x50c911;};'use strict';var multer=require(_0x4687('0x0'));var util=require(_0x4687('0x1'));var path=require('path');var timeout=require(_0x4687('0x2'));var express=require('express');var router=express[_0x4687('0x3')]();var fs_extra=require(_0x4687('0x4'));var auth=require(_0x4687('0x5'));var interaction=require(_0x4687('0x6'));var config=require(_0x4687('0x7'));var controller=require(_0x4687('0x8'));router[_0x4687('0x9')]('/',auth[_0x4687('0xa')](),controller['index']);router['get'](_0x4687('0xb'),auth['isAuthenticated'](),controller[_0x4687('0xc')]);router[_0x4687('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4687('0xd')]);router[_0x4687('0xe')](_0x4687('0xf'),auth[_0x4687('0xa')](),controller[_0x4687('0x10')]);router['delete'](_0x4687('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x4687('0x11')]=router; \ No newline at end of file +var _0x4d08=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','describe','/:id','show','post','create','put','delete','exports'];(function(_0x3b94e1,_0x223512){var _0x283eae=function(_0x50adee){while(--_0x50adee){_0x3b94e1['push'](_0x3b94e1['shift']());}};_0x283eae(++_0x223512);}(_0x4d08,0x6c));var _0x84d0=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0x4d08[_0x3b3a82];return _0x267063;};'use strict';var multer=require('multer');var util=require(_0x84d0('0x0'));var path=require(_0x84d0('0x1'));var timeout=require(_0x84d0('0x2'));var express=require('express');var router=express[_0x84d0('0x3')]();var fs_extra=require(_0x84d0('0x4'));var auth=require(_0x84d0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x84d0('0x6'));var controller=require(_0x84d0('0x7'));router['get']('/',auth[_0x84d0('0x8')](),controller[_0x84d0('0x9')]);router['get']('/describe',auth[_0x84d0('0x8')](),controller[_0x84d0('0xa')]);router['get'](_0x84d0('0xb'),auth['isAuthenticated'](),controller[_0x84d0('0xc')]);router[_0x84d0('0xd')]('/',auth[_0x84d0('0x8')](),controller[_0x84d0('0xe')]);router[_0x84d0('0xf')](_0x84d0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x84d0('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x84d0('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 995d34f..7f41b8e 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 _0x8cad=['STRING','name','sequelize','exports'];(function(_0x1bd896,_0x428ac4){var _0x16088d=function(_0x39134c){while(--_0x39134c){_0x1bd896['push'](_0x1bd896['shift']());}};_0x16088d(++_0x428ac4);}(_0x8cad,0xfe));var _0xd8ca=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8cad[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xd8ca('0x0'));module[_0xd8ca('0x1')]={'name':{'type':Sequelize[_0xd8ca('0x2')],'unique':_0xd8ca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd8ca('0x2')]}}; \ No newline at end of file +var _0x444e=['sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x444e,0xe8));var _0xe444=function(_0x24a791,_0x51b76d){_0x24a791=_0x24a791-0x0;var _0x3bfe63=_0x444e[_0x24a791];return _0x3bfe63;};'use strict';var Sequelize=require(_0xe444('0x0'));module['exports']={'name':{'type':Sequelize[_0xe444('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe444('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 294110e..afd0f74 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 _0x78e9=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','MailSubstatus','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x11d694,_0x59cf76){var _0x3ba8d4=function(_0x5eadae){while(--_0x5eadae){_0x11d694['push'](_0x11d694['shift']());}};_0x3ba8d4(++_0x59cf76);}(_0x78e9,0x8c));var _0x978e=function(_0x4fa624,_0x534883){_0x4fa624=_0x4fa624-0x0;var _0x1d5d9b=_0x78e9[_0x4fa624];return _0x1d5d9b;};'use strict';var emlformat=require(_0x978e('0x0'));var rimraf=require(_0x978e('0x1'));var zipdir=require(_0x978e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x978e('0x3'));var moment=require(_0x978e('0x4'));var BPromise=require(_0x978e('0x5'));var Mustache=require(_0x978e('0x6'));var util=require(_0x978e('0x7'));var path=require(_0x978e('0x8'));var sox=require(_0x978e('0x9'));var csv=require('to-csv');var ejs=require(_0x978e('0xa'));var fs=require('fs');var fs_extra=require(_0x978e('0xb'));var _=require(_0x978e('0xc'));var squel=require(_0x978e('0xd'));var crypto=require(_0x978e('0xe'));var jsforce=require(_0x978e('0xf'));var deskjs=require(_0x978e('0x10'));var toCsv=require(_0x978e('0x11'));var querystring=require('querystring');var Papa=require(_0x978e('0x12'));var Redis=require(_0x978e('0x13'));var authService=require(_0x978e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x978e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x978e('0x16'))('api');var utils=require(_0x978e('0x17'));var config=require(_0x978e('0x18'));var licenseUtil=require(_0x978e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x434dda,_0x3d4498){_0x3d4498=_0x3d4498||0xcc;return function(_0x45f7a5){if(_0x45f7a5){return _0x434dda[_0x978e('0x1a')](_0x3d4498);}return _0x434dda[_0x978e('0x1b')](_0x3d4498)['end']();};}function respondWithResult(_0x44c6e7,_0x23b640){_0x23b640=_0x23b640||0xc8;return function(_0xd5a80e){if(_0xd5a80e){return _0x44c6e7[_0x978e('0x1b')](_0x23b640)[_0x978e('0x1c')](_0xd5a80e);}};}function respondWithFilteredResult(_0x2698ae,_0x5c35c4){return function(_0x53f2db){if(_0x53f2db){var _0x5ed7fd=typeof _0x5c35c4['offset']===_0x978e('0x1d')&&typeof _0x5c35c4['limit']===_0x978e('0x1d');var _0x1b46d3=_0x53f2db[_0x978e('0x1e')];var _0x3ef6b5=_0x5ed7fd?0x0:_0x5c35c4[_0x978e('0x1f')];var _0x18212d=_0x5ed7fd?_0x53f2db['count']:_0x5c35c4[_0x978e('0x1f')]+_0x5c35c4[_0x978e('0x20')];var _0x271234;if(_0x18212d>=_0x1b46d3){_0x18212d=_0x1b46d3;_0x271234=0xc8;}else{_0x271234=0xce;}_0x2698ae[_0x978e('0x1b')](_0x271234);return _0x2698ae['set'](_0x978e('0x21'),_0x3ef6b5+'-'+_0x18212d+'/'+_0x1b46d3)['json'](_0x53f2db);}return null;};}function patchUpdates(_0x1e2aa3){return function(_0x3161d0){try{jsonpatch[_0x978e('0x22')](_0x3161d0,_0x1e2aa3,!![]);}catch(_0x3d276e){return BPromise[_0x978e('0x23')](_0x3d276e);}return _0x3161d0[_0x978e('0x24')]();};}function saveUpdates(_0x383527,_0x6b7bec){return function(_0x20ef1a){if(_0x20ef1a){return _0x20ef1a[_0x978e('0x25')](_0x383527)[_0x978e('0x26')](function(_0x2b8323){return _0x2b8323;});}return null;};}function removeEntity(_0xd8d431,_0x497c01){return function(_0x2b2063){if(_0x2b2063){return _0x2b2063['destroy']()['then'](function(){_0xd8d431[_0x978e('0x1b')](0xcc)[_0x978e('0x27')]();});}};}function handleEntityNotFound(_0x43c983,_0x5f05ed){return function(_0x1d0a9c){if(!_0x1d0a9c){_0x43c983[_0x978e('0x1a')](0x194);}return _0x1d0a9c;};}function handleError(_0x546e73,_0x26c338){_0x26c338=_0x26c338||0x1f4;return function(_0x4310f4){logger[_0x978e('0x28')](_0x4310f4[_0x978e('0x29')]);if(_0x4310f4['name']){delete _0x4310f4[_0x978e('0x2a')];}_0x546e73[_0x978e('0x1b')](_0x26c338)[_0x978e('0x2b')](_0x4310f4);};}exports['index']=function(_0x1e8e82,_0x15b494){var _0x2ce77a={},_0x1caa82={},_0x42f8cb={'count':0x0,'rows':[]};var _0x412158=_['map'](db[_0x978e('0x2c')][_0x978e('0x2d')],function(_0x1ebc31){return{'name':_0x1ebc31['fieldName'],'type':_0x1ebc31[_0x978e('0x2e')][_0x978e('0x2f')]};});_0x1caa82[_0x978e('0x30')]=_['map'](_0x412158,'name');_0x1caa82['query']=_[_0x978e('0x31')](_0x1e8e82[_0x978e('0x32')]);_0x1caa82[_0x978e('0x33')]=_[_0x978e('0x34')](_0x1caa82[_0x978e('0x30')],_0x1caa82[_0x978e('0x32')]);_0x2ce77a[_0x978e('0x35')]=_[_0x978e('0x34')](_0x1caa82[_0x978e('0x30')],qs[_0x978e('0x36')](_0x1e8e82[_0x978e('0x32')][_0x978e('0x36')]));_0x2ce77a[_0x978e('0x35')]=_0x2ce77a['attributes'][_0x978e('0x37')]?_0x2ce77a['attributes']:_0x1caa82[_0x978e('0x30')];if(!_0x1e8e82['query']['hasOwnProperty']('nolimit')){_0x2ce77a[_0x978e('0x20')]=qs[_0x978e('0x20')](_0x1e8e82['query']['limit']);_0x2ce77a['offset']=qs[_0x978e('0x1f')](_0x1e8e82[_0x978e('0x32')][_0x978e('0x1f')]);}_0x2ce77a[_0x978e('0x38')]=qs[_0x978e('0x39')](_0x1e8e82[_0x978e('0x32')][_0x978e('0x39')]);_0x2ce77a[_0x978e('0x3a')]=qs[_0x978e('0x33')](_[_0x978e('0x3b')](_0x1e8e82[_0x978e('0x32')],_0x1caa82[_0x978e('0x33')]),_0x412158);if(_0x1e8e82['query'][_0x978e('0x3c')]){_0x2ce77a[_0x978e('0x3a')]=_['merge'](_0x2ce77a[_0x978e('0x3a')],{'$or':_['map'](_0x412158,function(_0x22272b){if(_0x22272b[_0x978e('0x2e')]!==_0x978e('0x3d')){var _0x2249b4={};_0x2249b4[_0x22272b[_0x978e('0x2a')]]={'$like':'%'+_0x1e8e82[_0x978e('0x32')][_0x978e('0x3c')]+'%'};return _0x2249b4;}})});}_0x2ce77a=_[_0x978e('0x3e')]({},_0x2ce77a,_0x1e8e82[_0x978e('0x3f')]);var _0x3af33e={'where':_0x2ce77a[_0x978e('0x3a')]};return db['MailSubstatus'][_0x978e('0x1e')](_0x3af33e)['then'](function(_0x3ebf8f){_0x42f8cb['count']=_0x3ebf8f;if(_0x1e8e82[_0x978e('0x32')][_0x978e('0x40')]){_0x2ce77a[_0x978e('0x41')]=[{'all':!![]}];}return db[_0x978e('0x2c')]['findAll'](_0x2ce77a);})[_0x978e('0x26')](function(_0x4bd5fe){_0x42f8cb[_0x978e('0x42')]=_0x4bd5fe;return _0x42f8cb;})[_0x978e('0x26')](respondWithFilteredResult(_0x15b494,_0x2ce77a))[_0x978e('0x43')](handleError(_0x15b494,null));};exports[_0x978e('0x44')]=function(_0x3b240f,_0x344a57){var _0x2ba2f0={'raw':!![],'where':{'id':_0x3b240f['params']['id']}},_0x5b5aa9={};_0x5b5aa9[_0x978e('0x30')]=_['keys'](db['MailSubstatus'][_0x978e('0x2d')]);_0x5b5aa9[_0x978e('0x32')]=_[_0x978e('0x31')](_0x3b240f[_0x978e('0x32')]);_0x5b5aa9[_0x978e('0x33')]=_['intersection'](_0x5b5aa9['model'],_0x5b5aa9[_0x978e('0x32')]);_0x2ba2f0[_0x978e('0x35')]=_[_0x978e('0x34')](_0x5b5aa9['model'],qs[_0x978e('0x36')](_0x3b240f['query'][_0x978e('0x36')]));_0x2ba2f0[_0x978e('0x35')]=_0x2ba2f0[_0x978e('0x35')][_0x978e('0x37')]?_0x2ba2f0[_0x978e('0x35')]:_0x5b5aa9[_0x978e('0x30')];if(_0x3b240f['query'][_0x978e('0x40')]){_0x2ba2f0['include']=[{'all':!![]}];}_0x2ba2f0=_[_0x978e('0x3e')]({},_0x2ba2f0,_0x3b240f[_0x978e('0x3f')]);return db[_0x978e('0x2c')][_0x978e('0x45')](_0x2ba2f0)[_0x978e('0x26')](handleEntityNotFound(_0x344a57,null))[_0x978e('0x26')](respondWithResult(_0x344a57,null))[_0x978e('0x43')](handleError(_0x344a57,null));};exports['create']=function(_0x1de786,_0x4526c8){return db[_0x978e('0x2c')][_0x978e('0x46')](_0x1de786[_0x978e('0x47')],{})[_0x978e('0x26')](respondWithResult(_0x4526c8,0xc9))[_0x978e('0x43')](handleError(_0x4526c8,null));};exports[_0x978e('0x25')]=function(_0x47e415,_0x276bd8){if(_0x47e415[_0x978e('0x47')]['id']){delete _0x47e415[_0x978e('0x47')]['id'];}return db['MailSubstatus'][_0x978e('0x45')]({'where':{'id':_0x47e415[_0x978e('0x48')]['id']}})['then'](handleEntityNotFound(_0x276bd8,null))['then'](saveUpdates(_0x47e415[_0x978e('0x47')],null))['then'](respondWithResult(_0x276bd8,null))[_0x978e('0x43')](handleError(_0x276bd8,null));};exports[_0x978e('0x49')]=function(_0x36acf9,_0x26bed4){return db['MailSubstatus'][_0x978e('0x45')]({'where':{'id':_0x36acf9[_0x978e('0x48')]['id']}})[_0x978e('0x26')](handleEntityNotFound(_0x26bed4,null))['then'](removeEntity(_0x26bed4,null))[_0x978e('0x43')](handleError(_0x26bed4,null));};exports['describe']=function(_0x110525,_0x558049){return db['MailSubstatus'][_0x978e('0x4a')]()[_0x978e('0x26')](respondWithResult(_0x558049,null))[_0x978e('0x43')](handleError(_0x558049,null));}; \ No newline at end of file +var _0x5b48=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','error','stack','name','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','MailSubstatus','findAll','catch','show','params','length','include','find','create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5d00ca,_0x4927b1){var _0x27ceb4=function(_0x2ae2fa){while(--_0x2ae2fa){_0x5d00ca['push'](_0x5d00ca['shift']());}};_0x27ceb4(++_0x4927b1);}(_0x5b48,0x84));var _0x85b4=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x5b48[_0x580b15];return _0x1adb1b;};'use strict';var emlformat=require(_0x85b4('0x0'));var rimraf=require(_0x85b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85b4('0x2'));var rp=require(_0x85b4('0x3'));var moment=require(_0x85b4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x85b4('0x5'));var util=require(_0x85b4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x85b4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85b4('0x8'));var _=require(_0x85b4('0x9'));var squel=require(_0x85b4('0xa'));var crypto=require(_0x85b4('0xb'));var jsforce=require(_0x85b4('0xc'));var deskjs=require(_0x85b4('0xd'));var toCsv=require(_0x85b4('0x7'));var querystring=require(_0x85b4('0xe'));var Papa=require(_0x85b4('0xf'));var Redis=require(_0x85b4('0x10'));var authService=require(_0x85b4('0x11'));var qs=require(_0x85b4('0x12'));var as=require(_0x85b4('0x13'));var hardwareService=require(_0x85b4('0x14'));var logger=require(_0x85b4('0x15'))(_0x85b4('0x16'));var utils=require('../../config/utils');var config=require(_0x85b4('0x17'));var licenseUtil=require(_0x85b4('0x18'));var db=require(_0x85b4('0x19'))['db'];function respondWithStatusCode(_0x113438,_0x7957d){_0x7957d=_0x7957d||0xcc;return function(_0x47cd6e){if(_0x47cd6e){return _0x113438[_0x85b4('0x1a')](_0x7957d);}return _0x113438['status'](_0x7957d)[_0x85b4('0x1b')]();};}function respondWithResult(_0xb9fb84,_0x3332e8){_0x3332e8=_0x3332e8||0xc8;return function(_0xa56c6a){if(_0xa56c6a){return _0xb9fb84[_0x85b4('0x1c')](_0x3332e8)[_0x85b4('0x1d')](_0xa56c6a);}};}function respondWithFilteredResult(_0x172ec4,_0x5314da){return function(_0x578ab6){if(_0x578ab6){var _0x2b41d8=typeof _0x5314da['offset']===_0x85b4('0x1e')&&typeof _0x5314da[_0x85b4('0x1f')]===_0x85b4('0x1e');var _0x15e83f=_0x578ab6[_0x85b4('0x20')];var _0x2cb836=_0x2b41d8?0x0:_0x5314da[_0x85b4('0x21')];var _0x30835a=_0x2b41d8?_0x578ab6['count']:_0x5314da['offset']+_0x5314da['limit'];var _0x2ec786;if(_0x30835a>=_0x15e83f){_0x30835a=_0x15e83f;_0x2ec786=0xc8;}else{_0x2ec786=0xce;}_0x172ec4[_0x85b4('0x1c')](_0x2ec786);return _0x172ec4[_0x85b4('0x22')](_0x85b4('0x23'),_0x2cb836+'-'+_0x30835a+'/'+_0x15e83f)[_0x85b4('0x1d')](_0x578ab6);}return null;};}function patchUpdates(_0x424d6d){return function(_0x4b7b0c){try{jsonpatch[_0x85b4('0x24')](_0x4b7b0c,_0x424d6d,!![]);}catch(_0x4a253c){return BPromise['reject'](_0x4a253c);}return _0x4b7b0c[_0x85b4('0x25')]();};}function saveUpdates(_0x130b91,_0x58da6c){return function(_0x2bd6bd){if(_0x2bd6bd){return _0x2bd6bd['update'](_0x130b91)[_0x85b4('0x26')](function(_0x32d345){return _0x32d345;});}return null;};}function removeEntity(_0x4954c9,_0x19fab6){return function(_0x232d34){if(_0x232d34){return _0x232d34['destroy']()['then'](function(){_0x4954c9[_0x85b4('0x1c')](0xcc)[_0x85b4('0x1b')]();});}};}function handleEntityNotFound(_0x183391,_0x11502d){return function(_0x34b0f8){if(!_0x34b0f8){_0x183391[_0x85b4('0x1a')](0x194);}return _0x34b0f8;};}function handleError(_0x365fa9,_0x1a3fd7){_0x1a3fd7=_0x1a3fd7||0x1f4;return function(_0x60836f){logger[_0x85b4('0x27')](_0x60836f[_0x85b4('0x28')]);if(_0x60836f[_0x85b4('0x29')]){delete _0x60836f[_0x85b4('0x29')];}_0x365fa9['status'](_0x1a3fd7)[_0x85b4('0x2a')](_0x60836f);};}exports['index']=function(_0xb74bb9,_0x20164d){var _0x4de2ec={},_0x411b7e={},_0x1f9bfe={'count':0x0,'rows':[]};var _0x3f1339=_[_0x85b4('0x2b')](db['MailSubstatus']['rawAttributes'],function(_0x391711){return{'name':_0x391711[_0x85b4('0x2c')],'type':_0x391711[_0x85b4('0x2d')][_0x85b4('0x2e')]};});_0x411b7e['model']=_[_0x85b4('0x2b')](_0x3f1339,_0x85b4('0x29'));_0x411b7e[_0x85b4('0x2f')]=_[_0x85b4('0x30')](_0xb74bb9[_0x85b4('0x2f')]);_0x411b7e[_0x85b4('0x31')]=_[_0x85b4('0x32')](_0x411b7e[_0x85b4('0x33')],_0x411b7e[_0x85b4('0x2f')]);_0x4de2ec[_0x85b4('0x34')]=_[_0x85b4('0x32')](_0x411b7e['model'],qs['fields'](_0xb74bb9['query'][_0x85b4('0x35')]));_0x4de2ec['attributes']=_0x4de2ec['attributes']['length']?_0x4de2ec['attributes']:_0x411b7e[_0x85b4('0x33')];if(!_0xb74bb9[_0x85b4('0x2f')][_0x85b4('0x36')]('nolimit')){_0x4de2ec[_0x85b4('0x1f')]=qs[_0x85b4('0x1f')](_0xb74bb9[_0x85b4('0x2f')][_0x85b4('0x1f')]);_0x4de2ec[_0x85b4('0x21')]=qs[_0x85b4('0x21')](_0xb74bb9[_0x85b4('0x2f')]['offset']);}_0x4de2ec[_0x85b4('0x37')]=qs['sort'](_0xb74bb9['query'][_0x85b4('0x38')]);_0x4de2ec[_0x85b4('0x39')]=qs[_0x85b4('0x31')](_[_0x85b4('0x3a')](_0xb74bb9[_0x85b4('0x2f')],_0x411b7e['filters']),_0x3f1339);if(_0xb74bb9[_0x85b4('0x2f')][_0x85b4('0x3b')]){_0x4de2ec[_0x85b4('0x39')]=_[_0x85b4('0x3c')](_0x4de2ec[_0x85b4('0x39')],{'$or':_[_0x85b4('0x2b')](_0x3f1339,function(_0xae4cfa){if(_0xae4cfa[_0x85b4('0x2d')]!==_0x85b4('0x3d')){var _0x37a0fa={};_0x37a0fa[_0xae4cfa[_0x85b4('0x29')]]={'$like':'%'+_0xb74bb9[_0x85b4('0x2f')][_0x85b4('0x3b')]+'%'};return _0x37a0fa;}})});}_0x4de2ec=_[_0x85b4('0x3c')]({},_0x4de2ec,_0xb74bb9[_0x85b4('0x3e')]);var _0x5a6e5f={'where':_0x4de2ec[_0x85b4('0x39')]};return db['MailSubstatus'][_0x85b4('0x20')](_0x5a6e5f)[_0x85b4('0x26')](function(_0x1927db){_0x1f9bfe[_0x85b4('0x20')]=_0x1927db;if(_0xb74bb9[_0x85b4('0x2f')][_0x85b4('0x3f')]){_0x4de2ec['include']=[{'all':!![]}];}return db[_0x85b4('0x40')][_0x85b4('0x41')](_0x4de2ec);})[_0x85b4('0x26')](function(_0x4cf944){_0x1f9bfe['rows']=_0x4cf944;return _0x1f9bfe;})['then'](respondWithFilteredResult(_0x20164d,_0x4de2ec))[_0x85b4('0x42')](handleError(_0x20164d,null));};exports[_0x85b4('0x43')]=function(_0x12d419,_0x558cd3){var _0x552a62={'raw':!![],'where':{'id':_0x12d419[_0x85b4('0x44')]['id']}},_0x3591c1={};_0x3591c1[_0x85b4('0x33')]=_['keys'](db[_0x85b4('0x40')]['rawAttributes']);_0x3591c1[_0x85b4('0x2f')]=_[_0x85b4('0x30')](_0x12d419[_0x85b4('0x2f')]);_0x3591c1[_0x85b4('0x31')]=_[_0x85b4('0x32')](_0x3591c1['model'],_0x3591c1['query']);_0x552a62[_0x85b4('0x34')]=_['intersection'](_0x3591c1['model'],qs[_0x85b4('0x35')](_0x12d419[_0x85b4('0x2f')][_0x85b4('0x35')]));_0x552a62['attributes']=_0x552a62[_0x85b4('0x34')][_0x85b4('0x45')]?_0x552a62[_0x85b4('0x34')]:_0x3591c1['model'];if(_0x12d419[_0x85b4('0x2f')][_0x85b4('0x3f')]){_0x552a62[_0x85b4('0x46')]=[{'all':!![]}];}_0x552a62=_[_0x85b4('0x3c')]({},_0x552a62,_0x12d419[_0x85b4('0x3e')]);return db[_0x85b4('0x40')][_0x85b4('0x47')](_0x552a62)['then'](handleEntityNotFound(_0x558cd3,null))[_0x85b4('0x26')](respondWithResult(_0x558cd3,null))[_0x85b4('0x42')](handleError(_0x558cd3,null));};exports['create']=function(_0x9d3cf4,_0x1c4082){return db[_0x85b4('0x40')][_0x85b4('0x48')](_0x9d3cf4[_0x85b4('0x49')],{})[_0x85b4('0x26')](respondWithResult(_0x1c4082,0xc9))['catch'](handleError(_0x1c4082,null));};exports[_0x85b4('0x4a')]=function(_0x4f0ac1,_0x110d0a){if(_0x4f0ac1[_0x85b4('0x49')]['id']){delete _0x4f0ac1[_0x85b4('0x49')]['id'];}return db[_0x85b4('0x40')][_0x85b4('0x47')]({'where':{'id':_0x4f0ac1['params']['id']}})[_0x85b4('0x26')](handleEntityNotFound(_0x110d0a,null))[_0x85b4('0x26')](saveUpdates(_0x4f0ac1[_0x85b4('0x49')],null))[_0x85b4('0x26')](respondWithResult(_0x110d0a,null))[_0x85b4('0x42')](handleError(_0x110d0a,null));};exports[_0x85b4('0x4b')]=function(_0x1562e8,_0x449d1c){return db[_0x85b4('0x40')][_0x85b4('0x47')]({'where':{'id':_0x1562e8[_0x85b4('0x44')]['id']}})[_0x85b4('0x26')](handleEntityNotFound(_0x449d1c,null))[_0x85b4('0x26')](removeEntity(_0x449d1c,null))['catch'](handleError(_0x449d1c,null));};exports['describe']=function(_0x39aa14,_0x2c6ec4){return db[_0x85b4('0x40')][_0x85b4('0x4c')]()['then'](respondWithResult(_0x2c6ec4,null))['catch'](handleError(_0x2c6ec4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index eacea2d..4445117 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 _0x1da4=['api','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','../../config/logger'];(function(_0x2be909,_0x43aa7e){var _0x20fed5=function(_0x27e692){while(--_0x27e692){_0x2be909['push'](_0x2be909['shift']());}};_0x20fed5(++_0x43aa7e);}(_0x1da4,0x14d));var _0x41da=function(_0x25ab8d,_0x13e003){_0x25ab8d=_0x25ab8d-0x0;var _0x6c0ef4=_0x1da4[_0x25ab8d];return _0x6c0ef4;};'use strict';var _=require(_0x41da('0x0'));var util=require(_0x41da('0x1'));var logger=require(_0x41da('0x2'))(_0x41da('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x41da('0x4'));var fs=require('fs');var path=require(_0x41da('0x5'));var rimraf=require(_0x41da('0x6'));var config=require(_0x41da('0x7'));var attributes=require(_0x41da('0x8'));module[_0x41da('0x9')]=function(_0x291c21,_0x22c2b1){return _0x291c21[_0x41da('0xa')]('MailSubstatus',attributes,{'tableName':_0x41da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1295=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util'];(function(_0x575da4,_0x3d2562){var _0x5dde34=function(_0x3af2c4){while(--_0x3af2c4){_0x575da4['push'](_0x575da4['shift']());}};_0x5dde34(++_0x3d2562);}(_0x1295,0x66));var _0x5129=function(_0x26e6f2,_0x360fb2){_0x26e6f2=_0x26e6f2-0x0;var _0x349ef5=_0x1295[_0x26e6f2];return _0x349ef5;};'use strict';var _=require(_0x5129('0x0'));var util=require(_0x5129('0x1'));var logger=require(_0x5129('0x2'))(_0x5129('0x3'));var moment=require('moment');var BPromise=require(_0x5129('0x4'));var rp=require(_0x5129('0x5'));var fs=require('fs');var path=require(_0x5129('0x6'));var rimraf=require(_0x5129('0x7'));var config=require(_0x5129('0x8'));var attributes=require(_0x5129('0x9'));module['exports']=function(_0x16898e,_0x59c8df){return _0x16898e[_0x5129('0xa')](_0x5129('0xb'),attributes,{'tableName':_0x5129('0xc'),'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 27940c2..143201c 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 _0x902d=['http','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x3cedc7,_0x32f5d3){var _0x603ceb=function(_0x4ad544){while(--_0x4ad544){_0x3cedc7['push'](_0x3cedc7['shift']());}};_0x603ceb(++_0x32f5d3);}(_0x902d,0x83));var _0xd902=function(_0x3d54db,_0x586e54){_0x3d54db=_0x3d54db-0x0;var _0x5ddc9a=_0x902d[_0x3d54db];return _0x5ddc9a;};'use strict';var _=require(_0xd902('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd902('0x1'));var rs=require(_0xd902('0x2'));var fs=require('fs');var Redis=require(_0xd902('0x3'));var db=require(_0xd902('0x4'))['db'];var utils=require(_0xd902('0x5'));var logger=require(_0xd902('0x6'))('rpc');var config=require(_0xd902('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd902('0x8')][_0xd902('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bfc19,_0x28439d,_0x1d8a1f){return new BPromise(function(_0x499f16,_0xd599e4){return client[_0xd902('0xa')](_0x5bfc19,_0x1d8a1f)['then'](function(_0x405fe9){logger['info'](_0xd902('0xb'),_0x28439d,_0xd902('0xc'));logger[_0xd902('0xd')](_0xd902('0xe'),_0x28439d,_0xd902('0xc'),JSON['stringify'](_0x405fe9));if(_0x405fe9[_0xd902('0xf')]){if(_0x405fe9[_0xd902('0xf')][_0xd902('0x10')]===0x1f4){logger[_0xd902('0xf')](_0xd902('0xb'),_0x28439d,_0x405fe9[_0xd902('0xf')]['message']);return _0xd599e4(_0x405fe9['error']['message']);}logger[_0xd902('0xf')](_0xd902('0xb'),_0x28439d,_0x405fe9[_0xd902('0xf')][_0xd902('0x11')]);return _0x499f16(_0x405fe9[_0xd902('0xf')][_0xd902('0x11')]);}else{logger['info'](_0xd902('0xb'),_0x28439d,_0xd902('0xc'));_0x499f16(_0x405fe9[_0xd902('0x12')][_0xd902('0x11')]);}})[_0xd902('0x13')](function(_0x2db8b2){logger[_0xd902('0xf')](_0xd902('0xb'),_0x28439d,_0x2db8b2);_0xd599e4(_0x2db8b2);});});} \ No newline at end of file +var _0x3b2a=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x6e5869,_0x435c7d){var _0x47f4f2=function(_0x1a38db){while(--_0x1a38db){_0x6e5869['push'](_0x6e5869['shift']());}};_0x47f4f2(++_0x435c7d);}(_0x3b2a,0x90));var _0xa3b2=function(_0x25d63b,_0x522f06){_0x25d63b=_0x25d63b-0x0;var _0x44a4c1=_0x3b2a[_0x25d63b];return _0x44a4c1;};'use strict';var _=require('lodash');var util=require(_0xa3b2('0x0'));var moment=require('moment');var BPromise=require(_0xa3b2('0x1'));var rs=require(_0xa3b2('0x2'));var fs=require('fs');var Redis=require(_0xa3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa3b2('0x4'))(_0xa3b2('0x5'));var config=require(_0xa3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3b2('0x7')][_0xa3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59dc01,_0xc01ac1,_0x42a74c){return new BPromise(function(_0xa63d94,_0xe1ef79){return client[_0xa3b2('0x9')](_0x59dc01,_0x42a74c)[_0xa3b2('0xa')](function(_0x198b5a){logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));logger[_0xa3b2('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0xc01ac1,_0xa3b2('0xd'),JSON[_0xa3b2('0xf')](_0x198b5a));if(_0x198b5a[_0xa3b2('0x10')]){if(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x11')]===0x1f4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a['error']['message']);return _0xe1ef79(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}logger[_0xa3b2('0x10')](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);return _0xa63d94(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}else{logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));_0xa63d94(_0x198b5a[_0xa3b2('0x13')][_0xa3b2('0x12')]);}})[_0xa3b2('0x14')](function(_0x5132e4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x5132e4);_0xe1ef79(_0x5132e4);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 8e350db..656f425 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 _0x995a=['delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update'];(function(_0x495313,_0x19a244){var _0x166cf5=function(_0x5260db){while(--_0x5260db){_0x495313['push'](_0x495313['shift']());}};_0x166cf5(++_0x19a244);}(_0x995a,0x17e));var _0xa995=function(_0x5a76bb,_0x1c207d){_0x5a76bb=_0x5a76bb-0x0;var _0x242a0c=_0x995a[_0x5a76bb];return _0x242a0c;};'use strict';var multer=require(_0xa995('0x0'));var util=require(_0xa995('0x1'));var path=require('path');var timeout=require(_0xa995('0x2'));var express=require(_0xa995('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa995('0x4'));var interaction=require(_0xa995('0x5'));var config=require(_0xa995('0x6'));var controller=require(_0xa995('0x7'));router[_0xa995('0x8')]('/',auth[_0xa995('0x9')](),controller['index']);router[_0xa995('0x8')](_0xa995('0xa'),auth[_0xa995('0x9')](),controller[_0xa995('0xb')]);router[_0xa995('0x8')](_0xa995('0xc'),auth['isAuthenticated'](),controller[_0xa995('0xd')]);router[_0xa995('0xe')]('/',auth[_0xa995('0x9')](),controller['create']);router[_0xa995('0xf')](_0xa995('0xc'),auth[_0xa995('0x9')](),controller[_0xa995('0x10')]);router[_0xa995('0x11')](_0xa995('0xc'),auth[_0xa995('0x9')](),controller['destroy']);module[_0xa995('0x12')]=router; \ No newline at end of file +var _0x45bc=['./mailTransferReport.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x446da6,_0x98dedf){var _0x19d756=function(_0xa330c8){while(--_0xa330c8){_0x446da6['push'](_0x446da6['shift']());}};_0x19d756(++_0x98dedf);}(_0x45bc,0xe4));var _0xc45b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc45b('0x0'));var timeout=require(_0xc45b('0x1'));var express=require('express');var router=express[_0xc45b('0x2')]();var fs_extra=require(_0xc45b('0x3'));var auth=require(_0xc45b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc45b('0x5'));var controller=require(_0xc45b('0x6'));router[_0xc45b('0x7')]('/',auth[_0xc45b('0x8')](),controller[_0xc45b('0x9')]);router[_0xc45b('0x7')]('/describe',auth[_0xc45b('0x8')](),controller['describe']);router[_0xc45b('0x7')]('/:id',auth[_0xc45b('0x8')](),controller[_0xc45b('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc45b('0xb')]);router[_0xc45b('0xc')](_0xc45b('0xd'),auth[_0xc45b('0x8')](),controller[_0xc45b('0xe')]);router[_0xc45b('0xf')](_0xc45b('0xd'),auth[_0xc45b('0x8')](),controller[_0xc45b('0x10')]);module[_0xc45b('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 f97bf3d..5204362 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x31b73a,_0x2fe7c6){var _0x571fbb=function(_0x43720c){while(--_0x43720c){_0x31b73a['push'](_0x31b73a['shift']());}};_0x571fbb(++_0x2fe7c6);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xf3cd[_0x3818c0];return _0x55ec33;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x215f09,_0x164a19){var _0x5ea98e=function(_0xfb618b){while(--_0xfb618b){_0x215f09['push'](_0x215f09['shift']());}};_0x5ea98e(++_0x164a19);}(_0x008c,0x188));var _0xc008=function(_0x37b2ce,_0x5a6096){_0x37b2ce=_0x37b2ce-0x0;var _0x18e96a=_0x008c[_0x37b2ce];return _0x18e96a;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 129d898..06f8a04 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 _0x9f03=['count','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','sort','filters','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x478bd5,_0xd13338){var _0x540a9c=function(_0x55bc1e){while(--_0x55bc1e){_0x478bd5['push'](_0x478bd5['shift']());}};_0x540a9c(++_0xd13338);}(_0x9f03,0x73));var _0x39f0=function(_0x15fd73,_0x12e3a6){_0x15fd73=_0x15fd73-0x0;var _0x1a5168=_0x9f03[_0x15fd73];return _0x1a5168;};'use strict';var emlformat=require(_0x39f0('0x0'));var rimraf=require(_0x39f0('0x1'));var zipdir=require(_0x39f0('0x2'));var jsonpatch=require(_0x39f0('0x3'));var rp=require(_0x39f0('0x4'));var moment=require(_0x39f0('0x5'));var BPromise=require(_0x39f0('0x6'));var Mustache=require(_0x39f0('0x7'));var util=require(_0x39f0('0x8'));var path=require(_0x39f0('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x39f0('0xa'));var fs=require('fs');var fs_extra=require(_0x39f0('0xb'));var _=require(_0x39f0('0xc'));var squel=require(_0x39f0('0xd'));var crypto=require(_0x39f0('0xe'));var jsforce=require(_0x39f0('0xf'));var deskjs=require(_0x39f0('0x10'));var toCsv=require(_0x39f0('0x11'));var querystring=require(_0x39f0('0x12'));var Papa=require('papaparse');var Redis=require(_0x39f0('0x13'));var authService=require(_0x39f0('0x14'));var qs=require(_0x39f0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39f0('0x16'));var logger=require(_0x39f0('0x17'))(_0x39f0('0x18'));var utils=require('../../config/utils');var config=require(_0x39f0('0x19'));var licenseUtil=require(_0x39f0('0x1a'));var db=require(_0x39f0('0x1b'))['db'];function respondWithStatusCode(_0x45c1c8,_0x5a30cf){_0x5a30cf=_0x5a30cf||0xcc;return function(_0x1e3372){if(_0x1e3372){return _0x45c1c8[_0x39f0('0x1c')](_0x5a30cf);}return _0x45c1c8[_0x39f0('0x1d')](_0x5a30cf)[_0x39f0('0x1e')]();};}function respondWithResult(_0xdfe703,_0x48a412){_0x48a412=_0x48a412||0xc8;return function(_0x20e19a){if(_0x20e19a){return _0xdfe703['status'](_0x48a412)[_0x39f0('0x1f')](_0x20e19a);}};}function respondWithFilteredResult(_0x2652e,_0x17cb07){return function(_0x817334){if(_0x817334){var _0x2c2717=typeof _0x17cb07[_0x39f0('0x20')]===_0x39f0('0x21')&&typeof _0x17cb07[_0x39f0('0x22')]===_0x39f0('0x21');var _0x51622b=_0x817334[_0x39f0('0x23')];var _0x33143a=_0x2c2717?0x0:_0x17cb07[_0x39f0('0x20')];var _0x5e61cd=_0x2c2717?_0x817334[_0x39f0('0x23')]:_0x17cb07[_0x39f0('0x20')]+_0x17cb07['limit'];var _0x119947;if(_0x5e61cd>=_0x51622b){_0x5e61cd=_0x51622b;_0x119947=0xc8;}else{_0x119947=0xce;}_0x2652e[_0x39f0('0x1d')](_0x119947);return _0x2652e['set']('Content-Range',_0x33143a+'-'+_0x5e61cd+'/'+_0x51622b)[_0x39f0('0x1f')](_0x817334);}return null;};}function patchUpdates(_0x702ea1){return function(_0x1f4d09){try{jsonpatch[_0x39f0('0x24')](_0x1f4d09,_0x702ea1,!![]);}catch(_0x28c992){return BPromise[_0x39f0('0x25')](_0x28c992);}return _0x1f4d09[_0x39f0('0x26')]();};}function saveUpdates(_0x10cd17,_0x2e052b){return function(_0x3862c5){if(_0x3862c5){return _0x3862c5[_0x39f0('0x27')](_0x10cd17)[_0x39f0('0x28')](function(_0x509d40){return _0x509d40;});}return null;};}function removeEntity(_0x52261d,_0x381283){return function(_0x2d7371){if(_0x2d7371){return _0x2d7371[_0x39f0('0x29')]()[_0x39f0('0x28')](function(){_0x52261d[_0x39f0('0x1d')](0xcc)[_0x39f0('0x1e')]();});}};}function handleEntityNotFound(_0x348828,_0x20c4c3){return function(_0x302d2c){if(!_0x302d2c){_0x348828[_0x39f0('0x1c')](0x194);}return _0x302d2c;};}function handleError(_0x3b2450,_0x3f5adc){_0x3f5adc=_0x3f5adc||0x1f4;return function(_0x391110){logger[_0x39f0('0x2a')](_0x391110[_0x39f0('0x2b')]);if(_0x391110[_0x39f0('0x2c')]){delete _0x391110[_0x39f0('0x2c')];}_0x3b2450[_0x39f0('0x1d')](_0x3f5adc)[_0x39f0('0x2d')](_0x391110);};}exports[_0x39f0('0x2e')]=function(_0x429831,_0x245168){var _0x544725={},_0x3bfabb={},_0x2c1852={'count':0x0,'rows':[]};var _0x4b3a7e=_['map'](db[_0x39f0('0x2f')][_0x39f0('0x30')],function(_0x347920){return{'name':_0x347920['fieldName'],'type':_0x347920[_0x39f0('0x31')][_0x39f0('0x32')]};});_0x3bfabb[_0x39f0('0x33')]=_[_0x39f0('0x34')](_0x4b3a7e,'name');_0x3bfabb[_0x39f0('0x35')]=_[_0x39f0('0x36')](_0x429831[_0x39f0('0x35')]);_0x3bfabb['filters']=_[_0x39f0('0x37')](_0x3bfabb[_0x39f0('0x33')],_0x3bfabb[_0x39f0('0x35')]);_0x544725[_0x39f0('0x38')]=_[_0x39f0('0x37')](_0x3bfabb['model'],qs[_0x39f0('0x39')](_0x429831[_0x39f0('0x35')][_0x39f0('0x39')]));_0x544725['attributes']=_0x544725['attributes']['length']?_0x544725[_0x39f0('0x38')]:_0x3bfabb['model'];if(!_0x429831[_0x39f0('0x35')]['hasOwnProperty'](_0x39f0('0x3a'))){_0x544725[_0x39f0('0x22')]=qs[_0x39f0('0x22')](_0x429831['query'][_0x39f0('0x22')]);_0x544725['offset']=qs[_0x39f0('0x20')](_0x429831['query']['offset']);}_0x544725['order']=qs[_0x39f0('0x3b')](_0x429831[_0x39f0('0x35')][_0x39f0('0x3b')]);_0x544725['where']=qs['filters'](_['pick'](_0x429831[_0x39f0('0x35')],_0x3bfabb[_0x39f0('0x3c')]),_0x4b3a7e);if(_0x429831[_0x39f0('0x35')][_0x39f0('0x3d')]){_0x544725[_0x39f0('0x3e')]=_[_0x39f0('0x3f')](_0x544725[_0x39f0('0x3e')],{'$or':_[_0x39f0('0x34')](_0x4b3a7e,function(_0x5e74b4){if(_0x5e74b4['type']!==_0x39f0('0x40')){var _0x2fed5e={};_0x2fed5e[_0x5e74b4[_0x39f0('0x2c')]]={'$like':'%'+_0x429831['query']['filter']+'%'};return _0x2fed5e;}})});}_0x544725=_[_0x39f0('0x3f')]({},_0x544725,_0x429831['options']);var _0x19838c={'where':_0x544725['where']};return db[_0x39f0('0x2f')][_0x39f0('0x23')](_0x19838c)['then'](function(_0x312964){_0x2c1852[_0x39f0('0x23')]=_0x312964;if(_0x429831[_0x39f0('0x35')][_0x39f0('0x41')]){_0x544725['include']=[{'all':!![]}];}return db[_0x39f0('0x2f')][_0x39f0('0x42')](_0x544725);})[_0x39f0('0x28')](function(_0x5b1995){_0x2c1852[_0x39f0('0x43')]=_0x5b1995;return _0x2c1852;})['then'](respondWithFilteredResult(_0x245168,_0x544725))[_0x39f0('0x44')](handleError(_0x245168,null));};exports[_0x39f0('0x45')]=function(_0x25b559,_0x74345e){var _0x4f63f5={'raw':!![],'where':{'id':_0x25b559['params']['id']}},_0x3efa8b={};_0x3efa8b['model']=_[_0x39f0('0x36')](db[_0x39f0('0x2f')][_0x39f0('0x30')]);_0x3efa8b['query']=_[_0x39f0('0x36')](_0x25b559[_0x39f0('0x35')]);_0x3efa8b[_0x39f0('0x3c')]=_[_0x39f0('0x37')](_0x3efa8b[_0x39f0('0x33')],_0x3efa8b['query']);_0x4f63f5['attributes']=_[_0x39f0('0x37')](_0x3efa8b['model'],qs[_0x39f0('0x39')](_0x25b559[_0x39f0('0x35')][_0x39f0('0x39')]));_0x4f63f5[_0x39f0('0x38')]=_0x4f63f5[_0x39f0('0x38')]['length']?_0x4f63f5[_0x39f0('0x38')]:_0x3efa8b[_0x39f0('0x33')];if(_0x25b559[_0x39f0('0x35')][_0x39f0('0x41')]){_0x4f63f5['include']=[{'all':!![]}];}_0x4f63f5=_['merge']({},_0x4f63f5,_0x25b559['options']);return db[_0x39f0('0x2f')][_0x39f0('0x46')](_0x4f63f5)[_0x39f0('0x28')](handleEntityNotFound(_0x74345e,null))[_0x39f0('0x28')](respondWithResult(_0x74345e,null))[_0x39f0('0x44')](handleError(_0x74345e,null));};exports[_0x39f0('0x47')]=function(_0x50ba9f,_0x599524){return db['MailTransferReport'][_0x39f0('0x47')](_0x50ba9f[_0x39f0('0x48')],{})[_0x39f0('0x28')](respondWithResult(_0x599524,0xc9))[_0x39f0('0x44')](handleError(_0x599524,null));};exports[_0x39f0('0x27')]=function(_0x2f9890,_0x102c0d){if(_0x2f9890[_0x39f0('0x48')]['id']){delete _0x2f9890['body']['id'];}return db[_0x39f0('0x2f')][_0x39f0('0x46')]({'where':{'id':_0x2f9890[_0x39f0('0x49')]['id']}})[_0x39f0('0x28')](handleEntityNotFound(_0x102c0d,null))['then'](saveUpdates(_0x2f9890[_0x39f0('0x48')],null))[_0x39f0('0x28')](respondWithResult(_0x102c0d,null))[_0x39f0('0x44')](handleError(_0x102c0d,null));};exports['destroy']=function(_0x3d05a5,_0x41589e){return db[_0x39f0('0x2f')][_0x39f0('0x46')]({'where':{'id':_0x3d05a5[_0x39f0('0x49')]['id']}})['then'](handleEntityNotFound(_0x41589e,null))[_0x39f0('0x28')](removeEntity(_0x41589e,null))[_0x39f0('0x44')](handleError(_0x41589e,null));};exports[_0x39f0('0x4a')]=function(_0x56c213,_0x4a80bb){return db[_0x39f0('0x2f')][_0x39f0('0x4a')]()[_0x39f0('0x28')](respondWithResult(_0x4a80bb,null))[_0x39f0('0x44')](handleError(_0x4a80bb,null));}; \ No newline at end of file +var _0x647c=['find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','catch','params','include','options'];(function(_0x188c3f,_0x79d857){var _0x4ecefa=function(_0x19a615){while(--_0x19a615){_0x188c3f['push'](_0x188c3f['shift']());}};_0x4ecefa(++_0x79d857);}(_0x647c,0xe0));var _0xc647=function(_0x455161,_0x520f10){_0x455161=_0x455161-0x0;var _0x3e7c03=_0x647c[_0x455161];return _0x3e7c03;};'use strict';var emlformat=require(_0xc647('0x0'));var rimraf=require(_0xc647('0x1'));var zipdir=require(_0xc647('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc647('0x3'));var moment=require(_0xc647('0x4'));var BPromise=require(_0xc647('0x5'));var Mustache=require(_0xc647('0x6'));var util=require(_0xc647('0x7'));var path=require(_0xc647('0x8'));var sox=require(_0xc647('0x9'));var csv=require(_0xc647('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc647('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc647('0xa'));var querystring=require(_0xc647('0xc'));var Papa=require(_0xc647('0xd'));var Redis=require(_0xc647('0xe'));var authService=require(_0xc647('0xf'));var qs=require(_0xc647('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc647('0x11'));var logger=require(_0xc647('0x12'))('api');var utils=require(_0xc647('0x13'));var config=require(_0xc647('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2158df,_0x1ad210){_0x1ad210=_0x1ad210||0xcc;return function(_0x2a1145){if(_0x2a1145){return _0x2158df[_0xc647('0x15')](_0x1ad210);}return _0x2158df[_0xc647('0x16')](_0x1ad210)[_0xc647('0x17')]();};}function respondWithResult(_0x56a4e2,_0x16cbc3){_0x16cbc3=_0x16cbc3||0xc8;return function(_0x4f6e2c){if(_0x4f6e2c){return _0x56a4e2[_0xc647('0x16')](_0x16cbc3)['json'](_0x4f6e2c);}};}function respondWithFilteredResult(_0x253220,_0x20e2f9){return function(_0xb9c51b){if(_0xb9c51b){var _0x4f754f=typeof _0x20e2f9[_0xc647('0x18')]===_0xc647('0x19')&&typeof _0x20e2f9[_0xc647('0x1a')]===_0xc647('0x19');var _0x425872=_0xb9c51b[_0xc647('0x1b')];var _0x164032=_0x4f754f?0x0:_0x20e2f9['offset'];var _0x522d7b=_0x4f754f?_0xb9c51b[_0xc647('0x1b')]:_0x20e2f9[_0xc647('0x18')]+_0x20e2f9[_0xc647('0x1a')];var _0x589b91;if(_0x522d7b>=_0x425872){_0x522d7b=_0x425872;_0x589b91=0xc8;}else{_0x589b91=0xce;}_0x253220[_0xc647('0x16')](_0x589b91);return _0x253220['set'](_0xc647('0x1c'),_0x164032+'-'+_0x522d7b+'/'+_0x425872)['json'](_0xb9c51b);}return null;};}function patchUpdates(_0x150dd4){return function(_0x3266cb){try{jsonpatch[_0xc647('0x1d')](_0x3266cb,_0x150dd4,!![]);}catch(_0x293de3){return BPromise[_0xc647('0x1e')](_0x293de3);}return _0x3266cb[_0xc647('0x1f')]();};}function saveUpdates(_0x7a6d37,_0x51c275){return function(_0x4fc1f9){if(_0x4fc1f9){return _0x4fc1f9['update'](_0x7a6d37)['then'](function(_0x3af837){return _0x3af837;});}return null;};}function removeEntity(_0x186ca7,_0x5d3910){return function(_0x1df71c){if(_0x1df71c){return _0x1df71c[_0xc647('0x20')]()[_0xc647('0x21')](function(){_0x186ca7[_0xc647('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x241b17,_0x454c17){return function(_0x199bc2){if(!_0x199bc2){_0x241b17[_0xc647('0x15')](0x194);}return _0x199bc2;};}function handleError(_0x1ede66,_0x10624f){_0x10624f=_0x10624f||0x1f4;return function(_0x1b5807){logger[_0xc647('0x22')](_0x1b5807[_0xc647('0x23')]);if(_0x1b5807[_0xc647('0x24')]){delete _0x1b5807['name'];}_0x1ede66[_0xc647('0x16')](_0x10624f)[_0xc647('0x25')](_0x1b5807);};}exports[_0xc647('0x26')]=function(_0x4a89e1,_0x26f9cc){var _0x1b5829={},_0x249592={},_0x179156={'count':0x0,'rows':[]};var _0x45b253=_[_0xc647('0x27')](db[_0xc647('0x28')][_0xc647('0x29')],function(_0xeefaa2){return{'name':_0xeefaa2[_0xc647('0x2a')],'type':_0xeefaa2[_0xc647('0x2b')]['key']};});_0x249592['model']=_[_0xc647('0x27')](_0x45b253,_0xc647('0x24'));_0x249592[_0xc647('0x2c')]=_[_0xc647('0x2d')](_0x4a89e1[_0xc647('0x2c')]);_0x249592[_0xc647('0x2e')]=_[_0xc647('0x2f')](_0x249592[_0xc647('0x30')],_0x249592[_0xc647('0x2c')]);_0x1b5829[_0xc647('0x31')]=_[_0xc647('0x2f')](_0x249592[_0xc647('0x30')],qs[_0xc647('0x32')](_0x4a89e1['query'][_0xc647('0x32')]));_0x1b5829[_0xc647('0x31')]=_0x1b5829[_0xc647('0x31')][_0xc647('0x33')]?_0x1b5829['attributes']:_0x249592[_0xc647('0x30')];if(!_0x4a89e1[_0xc647('0x2c')][_0xc647('0x34')](_0xc647('0x35'))){_0x1b5829[_0xc647('0x1a')]=qs['limit'](_0x4a89e1[_0xc647('0x2c')][_0xc647('0x1a')]);_0x1b5829[_0xc647('0x18')]=qs['offset'](_0x4a89e1[_0xc647('0x2c')][_0xc647('0x18')]);}_0x1b5829[_0xc647('0x36')]=qs[_0xc647('0x37')](_0x4a89e1['query']['sort']);_0x1b5829['where']=qs[_0xc647('0x2e')](_[_0xc647('0x38')](_0x4a89e1['query'],_0x249592[_0xc647('0x2e')]),_0x45b253);if(_0x4a89e1['query'][_0xc647('0x39')]){_0x1b5829[_0xc647('0x3a')]=_['merge'](_0x1b5829[_0xc647('0x3a')],{'$or':_[_0xc647('0x27')](_0x45b253,function(_0x17e045){if(_0x17e045[_0xc647('0x2b')]!==_0xc647('0x3b')){var _0x17e845={};_0x17e845[_0x17e045[_0xc647('0x24')]]={'$like':'%'+_0x4a89e1['query'][_0xc647('0x39')]+'%'};return _0x17e845;}})});}_0x1b5829=_[_0xc647('0x3c')]({},_0x1b5829,_0x4a89e1['options']);var _0x7a84a8={'where':_0x1b5829['where']};return db[_0xc647('0x28')][_0xc647('0x1b')](_0x7a84a8)[_0xc647('0x21')](function(_0x4edad5){_0x179156[_0xc647('0x1b')]=_0x4edad5;if(_0x4a89e1[_0xc647('0x2c')][_0xc647('0x3d')]){_0x1b5829['include']=[{'all':!![]}];}return db['MailTransferReport'][_0xc647('0x3e')](_0x1b5829);})[_0xc647('0x21')](function(_0x2dfef9){_0x179156[_0xc647('0x3f')]=_0x2dfef9;return _0x179156;})[_0xc647('0x21')](respondWithFilteredResult(_0x26f9cc,_0x1b5829))[_0xc647('0x40')](handleError(_0x26f9cc,null));};exports['show']=function(_0x2ff62e,_0x4b1b07){var _0x5b2027={'raw':!![],'where':{'id':_0x2ff62e[_0xc647('0x41')]['id']}},_0x10591f={};_0x10591f[_0xc647('0x30')]=_[_0xc647('0x2d')](db['MailTransferReport'][_0xc647('0x29')]);_0x10591f[_0xc647('0x2c')]=_[_0xc647('0x2d')](_0x2ff62e[_0xc647('0x2c')]);_0x10591f['filters']=_['intersection'](_0x10591f[_0xc647('0x30')],_0x10591f[_0xc647('0x2c')]);_0x5b2027['attributes']=_['intersection'](_0x10591f[_0xc647('0x30')],qs[_0xc647('0x32')](_0x2ff62e[_0xc647('0x2c')][_0xc647('0x32')]));_0x5b2027['attributes']=_0x5b2027[_0xc647('0x31')][_0xc647('0x33')]?_0x5b2027['attributes']:_0x10591f['model'];if(_0x2ff62e['query'][_0xc647('0x3d')]){_0x5b2027[_0xc647('0x42')]=[{'all':!![]}];}_0x5b2027=_['merge']({},_0x5b2027,_0x2ff62e[_0xc647('0x43')]);return db[_0xc647('0x28')][_0xc647('0x44')](_0x5b2027)[_0xc647('0x21')](handleEntityNotFound(_0x4b1b07,null))[_0xc647('0x21')](respondWithResult(_0x4b1b07,null))[_0xc647('0x40')](handleError(_0x4b1b07,null));};exports[_0xc647('0x45')]=function(_0x4fc213,_0x4d9a71){return db[_0xc647('0x28')][_0xc647('0x45')](_0x4fc213[_0xc647('0x46')],{})[_0xc647('0x21')](respondWithResult(_0x4d9a71,0xc9))[_0xc647('0x40')](handleError(_0x4d9a71,null));};exports[_0xc647('0x47')]=function(_0xb98b2a,_0x2dd4e3){if(_0xb98b2a[_0xc647('0x46')]['id']){delete _0xb98b2a['body']['id'];}return db[_0xc647('0x28')]['find']({'where':{'id':_0xb98b2a['params']['id']}})['then'](handleEntityNotFound(_0x2dd4e3,null))[_0xc647('0x21')](saveUpdates(_0xb98b2a[_0xc647('0x46')],null))[_0xc647('0x21')](respondWithResult(_0x2dd4e3,null))[_0xc647('0x40')](handleError(_0x2dd4e3,null));};exports[_0xc647('0x20')]=function(_0x5e47b7,_0x2c01c2){return db[_0xc647('0x28')]['find']({'where':{'id':_0x5e47b7[_0xc647('0x41')]['id']}})[_0xc647('0x21')](handleEntityNotFound(_0x2c01c2,null))[_0xc647('0x21')](removeEntity(_0x2c01c2,null))[_0xc647('0x40')](handleError(_0x2c01c2,null));};exports[_0xc647('0x48')]=function(_0xd7c26,_0x3f0053){return db[_0xc647('0x28')][_0xc647('0x48')]()[_0xc647('0x21')](respondWithResult(_0x3f0053,null))[_0xc647('0x40')](handleError(_0x3f0053,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4e2d572..b04c17c 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 _0xf181=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailTransferReport','uniqueid'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0xf181,0x6c));var _0x1f18=function(_0x29f03a,_0x18e529){_0x29f03a=_0x29f03a-0x0;var _0x3b60bf=_0xf181[_0x29f03a];return _0x3b60bf;};'use strict';var _=require(_0x1f18('0x0'));var util=require(_0x1f18('0x1'));var logger=require(_0x1f18('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1f18('0x3'));var rp=require(_0x1f18('0x4'));var fs=require('fs');var path=require(_0x1f18('0x5'));var rimraf=require(_0x1f18('0x6'));var config=require(_0x1f18('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x1f18('0x8')]=function(_0x446163,_0x4b7ca6){return _0x446163[_0x1f18('0x9')](_0x1f18('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x1f18('0xb'),'fields':[_0x1f18('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51f2=['api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x55bcb7,_0x5cd6d6){var _0x2092cf=function(_0xe2a54a){while(--_0xe2a54a){_0x55bcb7['push'](_0x55bcb7['shift']());}};_0x2092cf(++_0x5cd6d6);}(_0x51f2,0xeb));var _0x251f=function(_0xf623cd,_0x1fc2b3){_0xf623cd=_0xf623cd-0x0;var _0x87ff3c=_0x51f2[_0xf623cd];return _0x87ff3c;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))(_0x251f('0x3'));var moment=require(_0x251f('0x4'));var BPromise=require(_0x251f('0x5'));var rp=require(_0x251f('0x6'));var fs=require('fs');var path=require(_0x251f('0x7'));var rimraf=require(_0x251f('0x8'));var config=require('../../config/environment');var attributes=require(_0x251f('0x9'));module[_0x251f('0xa')]=function(_0x145630,_0xd9d8e1){return _0x145630[_0x251f('0xb')]('MailTransferReport',attributes,{'tableName':_0x251f('0xc'),'paranoid':![],'indexes':[{'name':_0x251f('0xd'),'fields':[_0x251f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 51fa9ac..04168f2 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 _0xba55=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x31490c,_0x3a51c6){var _0x4c7410=function(_0x563f0f){while(--_0x563f0f){_0x31490c['push'](_0x31490c['shift']());}};_0x4c7410(++_0x3a51c6);}(_0xba55,0x1f3));var _0x5ba5=function(_0x22cb2f,_0x2e7067){_0x22cb2f=_0x22cb2f-0x0;var _0x2626f5=_0xba55[_0x22cb2f];return _0x2626f5;};'use strict';var _=require(_0x5ba5('0x0'));var util=require(_0x5ba5('0x1'));var moment=require(_0x5ba5('0x2'));var BPromise=require(_0x5ba5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ba5('0x4'));var db=require(_0x5ba5('0x5'))['db'];var utils=require(_0x5ba5('0x6'));var logger=require(_0x5ba5('0x7'))(_0x5ba5('0x8'));var config=require(_0x5ba5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5ba5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5bea,_0x166aec,_0x401282){return new BPromise(function(_0x29b210,_0x2744e8){return client[_0x5ba5('0xb')](_0x2d5bea,_0x401282)[_0x5ba5('0xc')](function(_0x384989){logger['info'](_0x5ba5('0xd'),_0x166aec,_0x5ba5('0xe'));logger['debug'](_0x5ba5('0xf'),_0x166aec,'request\x20sent',JSON[_0x5ba5('0x10')](_0x384989));if(_0x384989[_0x5ba5('0x11')]){if(_0x384989[_0x5ba5('0x11')][_0x5ba5('0x12')]===0x1f4){logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);return _0x2744e8(_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);}logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x384989[_0x5ba5('0x11')][_0x5ba5('0x13')]);return _0x29b210(_0x384989[_0x5ba5('0x11')]['message']);}else{logger['info'](_0x5ba5('0xd'),_0x166aec,'request\x20sent');_0x29b210(_0x384989['result']['message']);}})[_0x5ba5('0x14')](function(_0x51cbf2){logger[_0x5ba5('0x11')](_0x5ba5('0xd'),_0x166aec,_0x51cbf2);_0x2744e8(_0x51cbf2);});});} \ No newline at end of file +var _0x378d=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x378d,0x1a7));var _0xd378=function(_0x3fb5f9,_0xa4c2d9){_0x3fb5f9=_0x3fb5f9-0x0;var _0x541745=_0x378d[_0x3fb5f9];return _0x541745;};'use strict';var _=require(_0xd378('0x0'));var util=require(_0xd378('0x1'));var moment=require(_0xd378('0x2'));var BPromise=require(_0xd378('0x3'));var rs=require(_0xd378('0x4'));var fs=require('fs');var Redis=require(_0xd378('0x5'));var db=require(_0xd378('0x6'))['db'];var utils=require(_0xd378('0x7'));var logger=require(_0xd378('0x8'))(_0xd378('0x9'));var config=require(_0xd378('0xa'));var jayson=require(_0xd378('0xb'));var client=jayson[_0xd378('0xc')][_0xd378('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x917326,_0x4a35c1,_0x24179d){return new BPromise(function(_0x50e602,_0xa5e751){return client[_0xd378('0xe')](_0x917326,_0x24179d)[_0xd378('0xf')](function(_0x4d4876){logger[_0xd378('0x10')](_0xd378('0x11'),_0x4a35c1,_0xd378('0x12'));logger['debug'](_0xd378('0x13'),_0x4a35c1,'request\x20sent',JSON['stringify'](_0x4d4876));if(_0x4d4876[_0xd378('0x14')]){if(_0x4d4876[_0xd378('0x14')][_0xd378('0x15')]===0x1f4){logger[_0xd378('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x4a35c1,_0x4d4876['error'][_0xd378('0x16')]);return _0xa5e751(_0x4d4876[_0xd378('0x14')][_0xd378('0x16')]);}logger[_0xd378('0x14')](_0xd378('0x11'),_0x4a35c1,_0x4d4876[_0xd378('0x14')][_0xd378('0x16')]);return _0x50e602(_0x4d4876['error'][_0xd378('0x16')]);}else{logger[_0xd378('0x10')](_0xd378('0x11'),_0x4a35c1,_0xd378('0x12'));_0x50e602(_0x4d4876['result']['message']);}})['catch'](function(_0x321d6f){logger['error'](_0xd378('0x11'),_0x4a35c1,_0x321d6f);_0xa5e751(_0x321d6f);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index e941ae2..d2c9b40 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 _0x9723=['/describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x9723,0x78));var _0x3972=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x9723[_0x3d1244];return _0x5d6372;};'use strict';var multer=require('multer');var util=require(_0x3972('0x0'));var path=require(_0x3972('0x1'));var timeout=require(_0x3972('0x2'));var express=require(_0x3972('0x3'));var router=express[_0x3972('0x4')]();var fs_extra=require(_0x3972('0x5'));var auth=require(_0x3972('0x6'));var interaction=require(_0x3972('0x7'));var config=require(_0x3972('0x8'));var controller=require(_0x3972('0x9'));router[_0x3972('0xa')]('/',auth[_0x3972('0xb')](),controller['index']);router[_0x3972('0xa')](_0x3972('0xc'),auth[_0x3972('0xb')](),controller['describe']);router[_0x3972('0xa')](_0x3972('0xd'),auth[_0x3972('0xb')](),controller[_0x3972('0xe')]);router[_0x3972('0xf')]('/',auth['isAuthenticated'](),controller[_0x3972('0x10')]);router[_0x3972('0x11')](_0x3972('0xd'),auth[_0x3972('0xb')](),controller[_0x3972('0x12')]);router[_0x3972('0x13')](_0x3972('0xd'),auth['isAuthenticated'](),controller[_0x3972('0x14')]);module[_0x3972('0x15')]=router; \ No newline at end of file +var _0x2c2b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2c2b,0x12e));var _0xb2c2=function(_0x5d6482,_0x1c9b00){_0x5d6482=_0x5d6482-0x0;var _0x32e681=_0x2c2b[_0x5d6482];return _0x32e681;};'use strict';var multer=require(_0xb2c2('0x0'));var util=require(_0xb2c2('0x1'));var path=require(_0xb2c2('0x2'));var timeout=require(_0xb2c2('0x3'));var express=require(_0xb2c2('0x4'));var router=express[_0xb2c2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb2c2('0x6'));var interaction=require(_0xb2c2('0x7'));var config=require(_0xb2c2('0x8'));var controller=require('./memberReport.controller');router[_0xb2c2('0x9')]('/',auth[_0xb2c2('0xa')](),controller[_0xb2c2('0xb')]);router['get'](_0xb2c2('0xc'),auth['isAuthenticated'](),controller[_0xb2c2('0xd')]);router[_0xb2c2('0x9')](_0xb2c2('0xe'),auth[_0xb2c2('0xa')](),controller[_0xb2c2('0xf')]);router[_0xb2c2('0x10')]('/',auth['isAuthenticated'](),controller[_0xb2c2('0x11')]);router[_0xb2c2('0x12')](_0xb2c2('0xe'),auth[_0xb2c2('0xa')](),controller[_0xb2c2('0x13')]);router[_0xb2c2('0x14')]('/:id',auth[_0xb2c2('0xa')](),controller[_0xb2c2('0x15')]);module[_0xb2c2('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index df9f91c..308c972 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 _0x8ebf=['enterAt','diff','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8ebf[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xf8eb('0x0'));var moment=require(_0xf8eb('0x1'));module[_0xf8eb('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf8eb('0x3')]},'interface':{'type':Sequelize[_0xf8eb('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xf8eb('0x4'),'comment':_0xf8eb('0x5')},'duration':{'type':Sequelize[_0xf8eb('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf8eb('0x7')],'set':function(_0x36fde3){var _0x4cbeaa=moment(_0x36fde3);var _0x30c91c=moment(this[_0xf8eb('0x8')](_0xf8eb('0x9')));var _0x4c628d=_0x4cbeaa[_0xf8eb('0xa')](_0x30c91c,'seconds');this[_0xf8eb('0xb')]('exitAt',_0x36fde3);this[_0xf8eb('0xb')](_0xf8eb('0xc'),_0x4c628d||null);}},'data1':{'type':Sequelize[_0xf8eb('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xf8eb('0x3')],'comment':_0xf8eb('0xd')},'data3':{'type':Sequelize[_0xf8eb('0x3')],'comment':_0xf8eb('0xe')},'data4':{'type':Sequelize[_0xf8eb('0x3')],'comment':_0xf8eb('0xf')},'data5':{'type':Sequelize[_0xf8eb('0x3')],'comment':_0xf8eb('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xf8eb('0x6')]},'uniqueid':{'type':Sequelize[_0xf8eb('0x3')]}}; \ No newline at end of file +var _0xfa12=['talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]'];(function(_0x403e57,_0x52950b){var _0x554520=function(_0x39cdd3){while(--_0x39cdd3){_0x403e57['push'](_0x403e57['shift']());}};_0x554520(++_0x52950b);}(_0xfa12,0x1b2));var _0x2fa1=function(_0x4c8f89,_0x318d19){_0x4c8f89=_0x4c8f89-0x0;var _0x5c5685=_0xfa12[_0x4c8f89];return _0x5c5685;};'use strict';var Sequelize=require(_0x2fa1('0x0'));var moment=require(_0x2fa1('0x1'));module['exports']={'channel':{'type':Sequelize[_0x2fa1('0x2')]},'membername':{'type':Sequelize[_0x2fa1('0x2')]},'interface':{'type':Sequelize[_0x2fa1('0x2')]},'type':{'type':Sequelize[_0x2fa1('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2fa1('0x3')},'duration':{'type':Sequelize[_0x2fa1('0x4')]},'enterAt':{'type':Sequelize[_0x2fa1('0x5')]},'exitAt':{'type':Sequelize[_0x2fa1('0x5')],'set':function(_0x4d61b0){var _0x166949=moment(_0x4d61b0);var _0x25b233=moment(this['getDataValue'](_0x2fa1('0x6')));var _0x30a897=_0x166949[_0x2fa1('0x7')](_0x25b233,_0x2fa1('0x8'));this['setDataValue'](_0x2fa1('0x9'),_0x4d61b0);this[_0x2fa1('0xa')]('duration',_0x30a897||null);}},'data1':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xb')},'data2':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xc')},'data3':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xd')},'data4':{'type':Sequelize[_0x2fa1('0x2')],'comment':_0x2fa1('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x2fa1('0xf')},'role':{'type':Sequelize[_0x2fa1('0x2')]},'internal':{'type':Sequelize[_0x2fa1('0x4')]},'uniqueid':{'type':Sequelize[_0x2fa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 742a472..8f6d879 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xedd9,0xfc));var _0x9edd=function(_0x213180,_0x563e68){_0x213180=_0x213180-0x0;var _0x274663=_0xedd9[_0x213180];return _0x274663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x118093,_0x348e37){var _0x56500c=function(_0x4a3f4c){while(--_0x4a3f4c){_0x118093['push'](_0x118093['shift']());}};_0x56500c(++_0x348e37);}(_0x7217,0x19e));var _0x7721=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7217[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 317ffe3..6796526 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 _0xeda8=['report_member','membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define'];(function(_0x24f357,_0x4e264a){var _0x140f10=function(_0x10ff2c){while(--_0x10ff2c){_0x24f357['push'](_0x24f357['shift']());}};_0x140f10(++_0x4e264a);}(_0xeda8,0x104));var _0x8eda=function(_0x441466,_0x1ec733){_0x441466=_0x441466-0x0;var _0x41eb52=_0xeda8[_0x441466];return _0x41eb52;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('MemberReport',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xe'),_0x8eda('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25a5=['request-promise','rimraf','./memberReport.attributes','define','MemberReport','report_member','membername','interface','lodash','util','api'];(function(_0x625751,_0x2dc77b){var _0x426d0a=function(_0x1df54f){while(--_0x1df54f){_0x625751['push'](_0x625751['shift']());}};_0x426d0a(++_0x2dc77b);}(_0x25a5,0x1e1));var _0x525a=function(_0x2ffbdd,_0xcfc416){_0x2ffbdd=_0x2ffbdd-0x0;var _0x227117=_0x25a5[_0x2ffbdd];return _0x227117;};'use strict';var _=require(_0x525a('0x0'));var util=require(_0x525a('0x1'));var logger=require('../../config/logger')(_0x525a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x525a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x525a('0x4'));var config=require('../../config/environment');var attributes=require(_0x525a('0x5'));module['exports']=function(_0x4d16a1,_0x56b131){return _0x4d16a1[_0x525a('0x6')](_0x525a('0x7'),attributes,{'tableName':_0x525a('0x8'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x525a('0x9'),_0x525a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index fcd03b2..9cdfa97 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 _0xcfef=['options','where','include','map','attributes','model','info','CreateMemberReport','create','body','raw','UpdateMemberReport','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll'];(function(_0x270abe,_0x439965){var _0x1f14ad=function(_0x406447){while(--_0x406447){_0x270abe['push'](_0x270abe['shift']());}};_0x1f14ad(++_0x439965);}(_0xcfef,0x1cc));var _0xfcfe=function(_0x7e55a4,_0x10ff38){_0x7e55a4=_0x7e55a4-0x0;var _0x1e152b=_0xcfef[_0x7e55a4];return _0x1e152b;};'use strict';var _=require('lodash');var util=require(_0xfcfe('0x0'));var moment=require(_0xfcfe('0x1'));var BPromise=require(_0xfcfe('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(_0xfcfe('0x3'))(_0xfcfe('0x4'));var config=require(_0xfcfe('0x5'));var jayson=require(_0xfcfe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2aecec,_0x584f29,_0x28fe66){return new BPromise(function(_0x1d7307,_0x39d07c){return client['request'](_0x2aecec,_0x28fe66)[_0xfcfe('0x7')](function(_0x5c6211){logger['info'](_0xfcfe('0x8'),_0x584f29,'request\x20sent');logger[_0xfcfe('0x9')](_0xfcfe('0xa'),_0x584f29,_0xfcfe('0xb'),JSON[_0xfcfe('0xc')](_0x5c6211));if(_0x5c6211[_0xfcfe('0xd')]){if(_0x5c6211[_0xfcfe('0xd')]['code']===0x1f4){logger[_0xfcfe('0xd')]('MemberReport,\x20%s,\x20%s',_0x584f29,_0x5c6211['error'][_0xfcfe('0xe')]);return _0x39d07c(_0x5c6211['error'][_0xfcfe('0xe')]);}logger[_0xfcfe('0xd')](_0xfcfe('0x8'),_0x584f29,_0x5c6211[_0xfcfe('0xd')][_0xfcfe('0xe')]);return _0x1d7307(_0x5c6211[_0xfcfe('0xd')][_0xfcfe('0xe')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x584f29,_0xfcfe('0xb'));_0x1d7307(_0x5c6211[_0xfcfe('0xf')][_0xfcfe('0xe')]);}})[_0xfcfe('0x10')](function(_0x5414b1){logger['error'](_0xfcfe('0x8'),_0x584f29,_0x5414b1);_0x39d07c(_0x5414b1);});});}exports[_0xfcfe('0x11')]=function(_0x4393e4){var _0x58dc99=this;return new Promise(function(_0x386a5d,_0x4c36b9){return db[_0xfcfe('0x12')][_0xfcfe('0x13')]({'raw':_0x4393e4['options']?_0x4393e4[_0xfcfe('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')][_0xfcfe('0x15')]||null:null,'attributes':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')]['attributes']||null:null,'limit':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4['options']['limit']||null:null,'include':_0x4393e4[_0xfcfe('0x14')]?_0x4393e4[_0xfcfe('0x14')][_0xfcfe('0x16')]?_[_0xfcfe('0x17')](_0x4393e4[_0xfcfe('0x14')]['include'],function(_0x131384){return{'model':db[_0x131384['model']],'as':_0x131384['as'],'attributes':_0x131384[_0xfcfe('0x18')],'include':_0x131384[_0xfcfe('0x16')]?_[_0xfcfe('0x17')](_0x131384['include'],function(_0x3ebd99){return{'model':db[_0x3ebd99[_0xfcfe('0x19')]],'as':_0x3ebd99['as'],'attributes':_0x3ebd99[_0xfcfe('0x18')],'include':_0x3ebd99[_0xfcfe('0x16')]?_['map'](_0x3ebd99[_0xfcfe('0x16')],function(_0x24f3a7){return{'model':db[_0x24f3a7[_0xfcfe('0x19')]],'as':_0x24f3a7['as'],'attributes':_0x24f3a7[_0xfcfe('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfcfe('0x7')](function(_0x41e60d){logger[_0xfcfe('0x1a')](_0xfcfe('0x11'),_0x4393e4);logger[_0xfcfe('0x9')](_0xfcfe('0x11'),_0x4393e4,JSON[_0xfcfe('0xc')](_0x41e60d));_0x386a5d(_0x41e60d);})[_0xfcfe('0x10')](function(_0x12a91b){logger[_0xfcfe('0xd')](_0xfcfe('0x11'),_0x12a91b[_0xfcfe('0xe')],_0x4393e4);_0x4c36b9(_0x58dc99['error'](0x1f4,_0x12a91b[_0xfcfe('0xe')]));});});};exports[_0xfcfe('0x1b')]=function(_0x2c0998){var _0xa2c262=this;return new Promise(function(_0x1a7f54,_0x1d7134){return db[_0xfcfe('0x12')][_0xfcfe('0x1c')](_0x2c0998[_0xfcfe('0x1d')],{'raw':_0x2c0998[_0xfcfe('0x14')]?_0x2c0998['options'][_0xfcfe('0x1e')]===undefined?!![]:![]:!![]})[_0xfcfe('0x7')](function(_0x58e2e5){logger[_0xfcfe('0x1a')](_0xfcfe('0x1b'),_0x2c0998);logger[_0xfcfe('0x9')](_0xfcfe('0x1b'),_0x2c0998,JSON[_0xfcfe('0xc')](_0x58e2e5));_0x1a7f54(_0x58e2e5);})['catch'](function(_0x2ebb88){logger['error'](_0xfcfe('0x1b'),_0x2ebb88[_0xfcfe('0xe')],_0x2c0998);_0x1d7134(_0xa2c262[_0xfcfe('0xd')](0x1f4,_0x2ebb88[_0xfcfe('0xe')]));});});};exports[_0xfcfe('0x1f')]=function(_0x415996){var _0x46a7dc=this;return new Promise(function(_0x489709,_0x200109){return db['MemberReport']['update'](_0x415996[_0xfcfe('0x1d')],{'raw':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x15')]||null:null,'attributes':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')][_0xfcfe('0x18')]||null:null,'limit':_0x415996[_0xfcfe('0x14')]?_0x415996[_0xfcfe('0x14')]['limit']||null:null})[_0xfcfe('0x7')](function(_0x321f42){logger[_0xfcfe('0x1a')](_0xfcfe('0x1f'),_0x415996);logger[_0xfcfe('0x9')](_0xfcfe('0x1f'),_0x415996,JSON['stringify'](_0x321f42));_0x489709(_0x321f42);})[_0xfcfe('0x10')](function(_0x33b884){logger[_0xfcfe('0xd')](_0xfcfe('0x1f'),_0x33b884[_0xfcfe('0xe')],_0x415996);_0x200109(_0x46a7dc[_0xfcfe('0xd')](0x1f4,_0x33b884['message']));});});}; \ No newline at end of file +var _0xa786=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetMemberReport','MemberReport','options','raw','attributes','include','map','model','create','body','CreateMemberReport','limit','UpdateMemberReport','moment','bluebird'];(function(_0x610f42,_0x1d06ac){var _0x458e75=function(_0x16a318){while(--_0x16a318){_0x610f42['push'](_0x610f42['shift']());}};_0x458e75(++_0x1d06ac);}(_0xa786,0x1d2));var _0x6a78=function(_0x5cb675,_0x116fdc){_0x5cb675=_0x5cb675-0x0;var _0x9a1e91=_0xa786[_0x5cb675];return _0x9a1e91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a78('0x0'));var BPromise=require(_0x6a78('0x1'));var rs=require(_0x6a78('0x2'));var fs=require('fs');var Redis=require(_0x6a78('0x3'));var db=require(_0x6a78('0x4'))['db'];var utils=require(_0x6a78('0x5'));var logger=require(_0x6a78('0x6'))('rpc');var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d286,_0x2f8387,_0x2b8c4c){return new BPromise(function(_0x2a6de6,_0x25db5e){return client[_0x6a78('0xb')](_0x28d286,_0x2b8c4c)[_0x6a78('0xc')](function(_0x33e71c){logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x2f8387,_0x6a78('0xf'));logger[_0x6a78('0x10')](_0x6a78('0x11'),_0x2f8387,_0x6a78('0xf'),JSON[_0x6a78('0x12')](_0x33e71c));if(_0x33e71c['error']){if(_0x33e71c['error'][_0x6a78('0x13')]===0x1f4){logger[_0x6a78('0x14')]('MemberReport,\x20%s,\x20%s',_0x2f8387,_0x33e71c[_0x6a78('0x14')][_0x6a78('0x15')]);return _0x25db5e(_0x33e71c[_0x6a78('0x14')][_0x6a78('0x15')]);}logger[_0x6a78('0x14')](_0x6a78('0xe'),_0x2f8387,_0x33e71c[_0x6a78('0x14')]['message']);return _0x2a6de6(_0x33e71c['error']['message']);}else{logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x2f8387,_0x6a78('0xf'));_0x2a6de6(_0x33e71c['result'][_0x6a78('0x15')]);}})[_0x6a78('0x16')](function(_0x5b5a5d){logger[_0x6a78('0x14')](_0x6a78('0xe'),_0x2f8387,_0x5b5a5d);_0x25db5e(_0x5b5a5d);});});}exports[_0x6a78('0x17')]=function(_0x44f646){var _0x3f24ac=this;return new Promise(function(_0xe0e5e6,_0x28b91f){return db[_0x6a78('0x18')]['findAll']({'raw':_0x44f646[_0x6a78('0x19')]?_0x44f646['options'][_0x6a78('0x1a')]===undefined?!![]:![]:!![],'where':_0x44f646[_0x6a78('0x19')]?_0x44f646[_0x6a78('0x19')]['where']||null:null,'attributes':_0x44f646[_0x6a78('0x19')]?_0x44f646['options'][_0x6a78('0x1b')]||null:null,'limit':_0x44f646['options']?_0x44f646[_0x6a78('0x19')]['limit']||null:null,'include':_0x44f646[_0x6a78('0x19')]?_0x44f646['options']['include']?_['map'](_0x44f646[_0x6a78('0x19')][_0x6a78('0x1c')],function(_0x677af6){return{'model':db[_0x677af6['model']],'as':_0x677af6['as'],'attributes':_0x677af6[_0x6a78('0x1b')],'include':_0x677af6[_0x6a78('0x1c')]?_[_0x6a78('0x1d')](_0x677af6[_0x6a78('0x1c')],function(_0x56b7c2){return{'model':db[_0x56b7c2[_0x6a78('0x1e')]],'as':_0x56b7c2['as'],'attributes':_0x56b7c2['attributes'],'include':_0x56b7c2[_0x6a78('0x1c')]?_[_0x6a78('0x1d')](_0x56b7c2[_0x6a78('0x1c')],function(_0x20db54){return{'model':db[_0x20db54['model']],'as':_0x20db54['as'],'attributes':_0x20db54[_0x6a78('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a78('0xc')](function(_0x4ce883){logger[_0x6a78('0xd')]('GetMemberReport',_0x44f646);logger[_0x6a78('0x10')]('GetMemberReport',_0x44f646,JSON[_0x6a78('0x12')](_0x4ce883));_0xe0e5e6(_0x4ce883);})[_0x6a78('0x16')](function(_0x573903){logger[_0x6a78('0x14')](_0x6a78('0x17'),_0x573903['message'],_0x44f646);_0x28b91f(_0x3f24ac[_0x6a78('0x14')](0x1f4,_0x573903[_0x6a78('0x15')]));});});};exports['CreateMemberReport']=function(_0x1e5cd4){var _0x86d08f=this;return new Promise(function(_0x470ab2,_0xa40d44){return db[_0x6a78('0x18')][_0x6a78('0x1f')](_0x1e5cd4[_0x6a78('0x20')],{'raw':_0x1e5cd4['options']?_0x1e5cd4[_0x6a78('0x19')][_0x6a78('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x14837f){logger['info'](_0x6a78('0x21'),_0x1e5cd4);logger[_0x6a78('0x10')]('CreateMemberReport',_0x1e5cd4,JSON[_0x6a78('0x12')](_0x14837f));_0x470ab2(_0x14837f);})[_0x6a78('0x16')](function(_0x4fb400){logger[_0x6a78('0x14')]('CreateMemberReport',_0x4fb400[_0x6a78('0x15')],_0x1e5cd4);_0xa40d44(_0x86d08f[_0x6a78('0x14')](0x1f4,_0x4fb400['message']));});});};exports['UpdateMemberReport']=function(_0x314775){var _0x6d1a66=this;return new Promise(function(_0x39dd29,_0x725b9f){return db['MemberReport']['update'](_0x314775[_0x6a78('0x20')],{'raw':_0x314775['options']?_0x314775[_0x6a78('0x19')][_0x6a78('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x314775['options']?_0x314775[_0x6a78('0x19')]['where']||null:null,'attributes':_0x314775[_0x6a78('0x19')]?_0x314775[_0x6a78('0x19')]['attributes']||null:null,'limit':_0x314775[_0x6a78('0x19')]?_0x314775['options'][_0x6a78('0x22')]||null:null})[_0x6a78('0xc')](function(_0xa2ea41){logger[_0x6a78('0xd')](_0x6a78('0x23'),_0x314775);logger[_0x6a78('0x10')](_0x6a78('0x23'),_0x314775,JSON[_0x6a78('0x12')](_0xa2ea41));_0x39dd29(_0xa2ea41);})[_0x6a78('0x16')](function(_0x5ab9aa){logger[_0x6a78('0x14')](_0x6a78('0x23'),_0x5ab9aa[_0x6a78('0x15')],_0x314775);_0x725b9f(_0x6d1a66[_0x6a78('0x14')](0x1f4,_0x5ab9aa[_0x6a78('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index ef2d97d..bfab619 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 _0xb0ec=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x204c54,_0x27da6f){var _0x331f2c=function(_0x51c4b5){while(--_0x51c4b5){_0x204c54['push'](_0x204c54['shift']());}};_0x331f2c(++_0x27da6f);}(_0xb0ec,0x10e));var _0xcb0e=function(_0x45f175,_0x5e076a){_0x45f175=_0x45f175-0x0;var _0x23adf0=_0xb0ec[_0x45f175];return _0x23adf0;};'use strict';var multer=require(_0xcb0e('0x0'));var util=require(_0xcb0e('0x1'));var path=require(_0xcb0e('0x2'));var timeout=require(_0xcb0e('0x3'));var express=require(_0xcb0e('0x4'));var router=express['Router']();var fs_extra=require(_0xcb0e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb0e('0x6'));var config=require(_0xcb0e('0x7'));var controller=require('./migration.controller');router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0xb2c5=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','exports','multer','util','path','Router'];(function(_0x137d82,_0x196e37){var _0x1f1d4f=function(_0xeca09d){while(--_0xeca09d){_0x137d82['push'](_0x137d82['shift']());}};_0x1f1d4f(++_0x196e37);}(_0xb2c5,0x114));var _0x5b2c=function(_0x41e2af,_0x3662f8){_0x41e2af=_0x41e2af-0x0;var _0x41df19=_0xb2c5[_0x41e2af];return _0x41df19;};'use strict';var multer=require(_0x5b2c('0x0'));var util=require(_0x5b2c('0x1'));var path=require(_0x5b2c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5b2c('0x3')]();var fs_extra=require(_0x5b2c('0x4'));var auth=require(_0x5b2c('0x5'));var interaction=require(_0x5b2c('0x6'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x5b2c('0x7')]('/',controller[_0x5b2c('0x8')]);module[_0x5b2c('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 13b22bb..e6cb9df 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 _0xb51d=['exports','STRING','version'];(function(_0x23bbab,_0x37e309){var _0x51ca75=function(_0x2fae08){while(--_0x2fae08){_0x23bbab['push'](_0x23bbab['shift']());}};_0x51ca75(++_0x37e309);}(_0xb51d,0x153));var _0xdb51=function(_0x36430f,_0x132969){_0x36430f=_0x36430f-0x0;var _0x4c41db=_0xb51d[_0x36430f];return _0x4c41db;};'use strict';var Sequelize=require('sequelize');module[_0xdb51('0x0')]={'version':{'type':Sequelize[_0xdb51('0x1')],'unique':_0xdb51('0x2')}}; \ No newline at end of file +var _0x9226=['sequelize','exports','STRING','version'];(function(_0x36910c,_0x5a3928){var _0x23d22a=function(_0x4ca99f){while(--_0x4ca99f){_0x36910c['push'](_0x36910c['shift']());}};_0x23d22a(++_0x5a3928);}(_0x9226,0x188));var _0x6922=function(_0x4fdac8,_0x537a98){_0x4fdac8=_0x4fdac8-0x0;var _0x2dbafd=_0x9226[_0x4fdac8];return _0x2dbafd;};'use strict';var Sequelize=require(_0x6922('0x0'));module[_0x6922('0x1')]={'version':{'type':Sequelize[_0x6922('0x2')],'unique':_0x6922('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0198552..20f4e4a 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 _0x9ba9=['apply','save','update','then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filters','filter','where','type','merge','options','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range'];(function(_0x1bc49,_0x2521a6){var _0x3eafb1=function(_0x4e2691){while(--_0x4e2691){_0x1bc49['push'](_0x1bc49['shift']());}};_0x3eafb1(++_0x2521a6);}(_0x9ba9,0x141));var _0x99ba=function(_0x1c44d7,_0x24a347){_0x1c44d7=_0x1c44d7-0x0;var _0x43ecbb=_0x9ba9[_0x1c44d7];return _0x43ecbb;};'use strict';var emlformat=require(_0x99ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99ba('0x1'));var jsonpatch=require(_0x99ba('0x2'));var rp=require('request-promise');var moment=require(_0x99ba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x99ba('0x4'));var util=require(_0x99ba('0x5'));var path=require(_0x99ba('0x6'));var sox=require(_0x99ba('0x7'));var csv=require('to-csv');var ejs=require(_0x99ba('0x8'));var fs=require('fs');var fs_extra=require(_0x99ba('0x9'));var _=require(_0x99ba('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99ba('0xb'));var deskjs=require(_0x99ba('0xc'));var toCsv=require(_0x99ba('0xd'));var querystring=require(_0x99ba('0xe'));var Papa=require(_0x99ba('0xf'));var Redis=require(_0x99ba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x99ba('0x11'));var as=require(_0x99ba('0x12'));var hardwareService=require(_0x99ba('0x13'));var logger=require('../../config/logger')(_0x99ba('0x14'));var utils=require(_0x99ba('0x15'));var config=require(_0x99ba('0x16'));var licenseUtil=require(_0x99ba('0x17'));var db=require(_0x99ba('0x18'))['db'];function respondWithStatusCode(_0x66b0c,_0x22a612){_0x22a612=_0x22a612||0xcc;return function(_0x54f8b1){if(_0x54f8b1){return _0x66b0c[_0x99ba('0x19')](_0x22a612);}return _0x66b0c[_0x99ba('0x1a')](_0x22a612)[_0x99ba('0x1b')]();};}function respondWithResult(_0x2af936,_0x5b68e8){_0x5b68e8=_0x5b68e8||0xc8;return function(_0x39de48){if(_0x39de48){return _0x2af936[_0x99ba('0x1a')](_0x5b68e8)[_0x99ba('0x1c')](_0x39de48);}};}function respondWithFilteredResult(_0x51cd03,_0xb7fe42){return function(_0x2e2d82){if(_0x2e2d82){var _0x7ec64f=typeof _0xb7fe42['offset']===_0x99ba('0x1d')&&typeof _0xb7fe42['limit']===_0x99ba('0x1d');var _0x544a15=_0x2e2d82[_0x99ba('0x1e')];var _0x2f07a3=_0x7ec64f?0x0:_0xb7fe42['offset'];var _0x36c0dd=_0x7ec64f?_0x2e2d82[_0x99ba('0x1e')]:_0xb7fe42[_0x99ba('0x1f')]+_0xb7fe42['limit'];var _0x31d333;if(_0x36c0dd>=_0x544a15){_0x36c0dd=_0x544a15;_0x31d333=0xc8;}else{_0x31d333=0xce;}_0x51cd03['status'](_0x31d333);return _0x51cd03[_0x99ba('0x20')](_0x99ba('0x21'),_0x2f07a3+'-'+_0x36c0dd+'/'+_0x544a15)[_0x99ba('0x1c')](_0x2e2d82);}return null;};}function patchUpdates(_0x34078b){return function(_0x3cd1ab){try{jsonpatch[_0x99ba('0x22')](_0x3cd1ab,_0x34078b,!![]);}catch(_0x38999f){return BPromise['reject'](_0x38999f);}return _0x3cd1ab[_0x99ba('0x23')]();};}function saveUpdates(_0x23b64d,_0x19d919){return function(_0x467ece){if(_0x467ece){return _0x467ece[_0x99ba('0x24')](_0x23b64d)[_0x99ba('0x25')](function(_0x23730b){return _0x23730b;});}return null;};}function removeEntity(_0xe8a51e,_0x218e34){return function(_0x5d1f82){if(_0x5d1f82){return _0x5d1f82[_0x99ba('0x26')]()[_0x99ba('0x25')](function(){_0xe8a51e['status'](0xcc)[_0x99ba('0x1b')]();});}};}function handleEntityNotFound(_0x6c499c,_0x5da3b0){return function(_0x4fd9cb){if(!_0x4fd9cb){_0x6c499c[_0x99ba('0x19')](0x194);}return _0x4fd9cb;};}function handleError(_0x2f5066,_0x4b6cee){_0x4b6cee=_0x4b6cee||0x1f4;return function(_0xf99ac){logger[_0x99ba('0x27')](_0xf99ac['stack']);if(_0xf99ac['name']){delete _0xf99ac[_0x99ba('0x28')];}_0x2f5066[_0x99ba('0x1a')](_0x4b6cee)[_0x99ba('0x29')](_0xf99ac);};}exports[_0x99ba('0x2a')]=function(_0x4d5182,_0x1e189b){var _0x550f59={},_0x15a3b1={},_0x12fe38={'count':0x0,'rows':[]};var _0x290083=_[_0x99ba('0x2b')](db[_0x99ba('0x2c')][_0x99ba('0x2d')],function(_0x193d9a){return{'name':_0x193d9a[_0x99ba('0x2e')],'type':_0x193d9a['type'][_0x99ba('0x2f')]};});_0x15a3b1[_0x99ba('0x30')]=_[_0x99ba('0x2b')](_0x290083,_0x99ba('0x28'));_0x15a3b1[_0x99ba('0x31')]=_[_0x99ba('0x32')](_0x4d5182['query']);_0x15a3b1['filters']=_[_0x99ba('0x33')](_0x15a3b1['model'],_0x15a3b1[_0x99ba('0x31')]);_0x550f59[_0x99ba('0x34')]=_[_0x99ba('0x33')](_0x15a3b1[_0x99ba('0x30')],qs[_0x99ba('0x35')](_0x4d5182[_0x99ba('0x31')][_0x99ba('0x35')]));_0x550f59[_0x99ba('0x34')]=_0x550f59[_0x99ba('0x34')][_0x99ba('0x36')]?_0x550f59[_0x99ba('0x34')]:_0x15a3b1[_0x99ba('0x30')];if(!_0x4d5182[_0x99ba('0x31')]['hasOwnProperty'](_0x99ba('0x37'))){_0x550f59[_0x99ba('0x38')]=qs[_0x99ba('0x38')](_0x4d5182[_0x99ba('0x31')][_0x99ba('0x38')]);_0x550f59[_0x99ba('0x1f')]=qs[_0x99ba('0x1f')](_0x4d5182['query'][_0x99ba('0x1f')]);}_0x550f59[_0x99ba('0x39')]=qs[_0x99ba('0x3a')](_0x4d5182[_0x99ba('0x31')][_0x99ba('0x3a')]);_0x550f59['where']=qs['filters'](_[_0x99ba('0x3b')](_0x4d5182[_0x99ba('0x31')],_0x15a3b1[_0x99ba('0x3c')]),_0x290083);if(_0x4d5182[_0x99ba('0x31')][_0x99ba('0x3d')]){_0x550f59[_0x99ba('0x3e')]=_['merge'](_0x550f59[_0x99ba('0x3e')],{'$or':_[_0x99ba('0x2b')](_0x290083,function(_0x2007af){if(_0x2007af[_0x99ba('0x3f')]!=='VIRTUAL'){var _0x3d6b2b={};_0x3d6b2b[_0x2007af[_0x99ba('0x28')]]={'$like':'%'+_0x4d5182[_0x99ba('0x31')][_0x99ba('0x3d')]+'%'};return _0x3d6b2b;}})});}_0x550f59=_[_0x99ba('0x40')]({},_0x550f59,_0x4d5182[_0x99ba('0x41')]);var _0x14bd37={'where':_0x550f59['where']};return db[_0x99ba('0x2c')][_0x99ba('0x1e')](_0x14bd37)['then'](function(_0x476848){_0x12fe38['count']=_0x476848;if(_0x4d5182[_0x99ba('0x31')][_0x99ba('0x42')]){_0x550f59[_0x99ba('0x43')]=[{'all':!![]}];}return db[_0x99ba('0x2c')][_0x99ba('0x44')](_0x550f59);})[_0x99ba('0x25')](function(_0x30f6b5){_0x12fe38[_0x99ba('0x45')]=_0x30f6b5;return _0x12fe38;})[_0x99ba('0x25')](respondWithFilteredResult(_0x1e189b,_0x550f59))[_0x99ba('0x46')](handleError(_0x1e189b,null));}; \ No newline at end of file +var _0xac26=['json','apply','save','update','destroy','error','stack','name','send','map','Migration','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','then','includeAll','include','rows','catch','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xac26,0xee));var _0x6ac2=function(_0x26401b,_0x108f8d){_0x26401b=_0x26401b-0x0;var _0x4d32b1=_0xac26[_0x26401b];return _0x4d32b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ac2('0x0'));var jsonpatch=require(_0x6ac2('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ac2('0x2'));var Mustache=require(_0x6ac2('0x3'));var util=require(_0x6ac2('0x4'));var path=require(_0x6ac2('0x5'));var sox=require(_0x6ac2('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ac2('0x7'));var _=require(_0x6ac2('0x8'));var squel=require(_0x6ac2('0x9'));var crypto=require(_0x6ac2('0xa'));var jsforce=require(_0x6ac2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6ac2('0xc'));var querystring=require('querystring');var Papa=require(_0x6ac2('0xd'));var Redis=require(_0x6ac2('0xe'));var authService=require(_0x6ac2('0xf'));var qs=require(_0x6ac2('0x10'));var as=require(_0x6ac2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ac2('0x12'))('api');var utils=require(_0x6ac2('0x13'));var config=require(_0x6ac2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ac2('0x15'))['db'];function respondWithStatusCode(_0x1f6c73,_0x755b2d){_0x755b2d=_0x755b2d||0xcc;return function(_0xbb3cdd){if(_0xbb3cdd){return _0x1f6c73[_0x6ac2('0x16')](_0x755b2d);}return _0x1f6c73[_0x6ac2('0x17')](_0x755b2d)[_0x6ac2('0x18')]();};}function respondWithResult(_0x26ff5d,_0x546d06){_0x546d06=_0x546d06||0xc8;return function(_0x31de6d){if(_0x31de6d){return _0x26ff5d[_0x6ac2('0x17')](_0x546d06)['json'](_0x31de6d);}};}function respondWithFilteredResult(_0x2ad5f8,_0x59e646){return function(_0x41d47d){if(_0x41d47d){var _0x44ce4f=typeof _0x59e646[_0x6ac2('0x19')]==='undefined'&&typeof _0x59e646['limit']===_0x6ac2('0x1a');var _0x4babc0=_0x41d47d['count'];var _0x22aa74=_0x44ce4f?0x0:_0x59e646[_0x6ac2('0x19')];var _0x518b2a=_0x44ce4f?_0x41d47d[_0x6ac2('0x1b')]:_0x59e646[_0x6ac2('0x19')]+_0x59e646['limit'];var _0x58e96f;if(_0x518b2a>=_0x4babc0){_0x518b2a=_0x4babc0;_0x58e96f=0xc8;}else{_0x58e96f=0xce;}_0x2ad5f8['status'](_0x58e96f);return _0x2ad5f8[_0x6ac2('0x1c')](_0x6ac2('0x1d'),_0x22aa74+'-'+_0x518b2a+'/'+_0x4babc0)[_0x6ac2('0x1e')](_0x41d47d);}return null;};}function patchUpdates(_0x1b6ff5){return function(_0x3a3254){try{jsonpatch[_0x6ac2('0x1f')](_0x3a3254,_0x1b6ff5,!![]);}catch(_0x573caa){return BPromise['reject'](_0x573caa);}return _0x3a3254[_0x6ac2('0x20')]();};}function saveUpdates(_0x21b0c1,_0x41e90f){return function(_0x5c957d){if(_0x5c957d){return _0x5c957d[_0x6ac2('0x21')](_0x21b0c1)['then'](function(_0x3d74a6){return _0x3d74a6;});}return null;};}function removeEntity(_0xe82a39,_0x2b3213){return function(_0x5df195){if(_0x5df195){return _0x5df195[_0x6ac2('0x22')]()['then'](function(){_0xe82a39[_0x6ac2('0x17')](0xcc)[_0x6ac2('0x18')]();});}};}function handleEntityNotFound(_0x5201ea,_0x28f1a9){return function(_0x5e2baf){if(!_0x5e2baf){_0x5201ea['sendStatus'](0x194);}return _0x5e2baf;};}function handleError(_0x314e72,_0x4875e1){_0x4875e1=_0x4875e1||0x1f4;return function(_0x8cf6bb){logger[_0x6ac2('0x23')](_0x8cf6bb[_0x6ac2('0x24')]);if(_0x8cf6bb[_0x6ac2('0x25')]){delete _0x8cf6bb[_0x6ac2('0x25')];}_0x314e72[_0x6ac2('0x17')](_0x4875e1)[_0x6ac2('0x26')](_0x8cf6bb);};}exports['index']=function(_0x4fdcc9,_0x271043){var _0x5a0ab9={},_0x54d70d={},_0x16aea6={'count':0x0,'rows':[]};var _0x531be7=_[_0x6ac2('0x27')](db[_0x6ac2('0x28')]['rawAttributes'],function(_0x16f2d8){return{'name':_0x16f2d8[_0x6ac2('0x29')],'type':_0x16f2d8['type'][_0x6ac2('0x2a')]};});_0x54d70d[_0x6ac2('0x2b')]=_[_0x6ac2('0x27')](_0x531be7,_0x6ac2('0x25'));_0x54d70d['query']=_[_0x6ac2('0x2c')](_0x4fdcc9[_0x6ac2('0x2d')]);_0x54d70d['filters']=_[_0x6ac2('0x2e')](_0x54d70d[_0x6ac2('0x2b')],_0x54d70d[_0x6ac2('0x2d')]);_0x5a0ab9[_0x6ac2('0x2f')]=_[_0x6ac2('0x2e')](_0x54d70d[_0x6ac2('0x2b')],qs[_0x6ac2('0x30')](_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x30')]));_0x5a0ab9[_0x6ac2('0x2f')]=_0x5a0ab9[_0x6ac2('0x2f')][_0x6ac2('0x31')]?_0x5a0ab9[_0x6ac2('0x2f')]:_0x54d70d[_0x6ac2('0x2b')];if(!_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x32')](_0x6ac2('0x33'))){_0x5a0ab9[_0x6ac2('0x34')]=qs['limit'](_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x34')]);_0x5a0ab9['offset']=qs[_0x6ac2('0x19')](_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x19')]);}_0x5a0ab9[_0x6ac2('0x35')]=qs[_0x6ac2('0x36')](_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x36')]);_0x5a0ab9['where']=qs[_0x6ac2('0x37')](_[_0x6ac2('0x38')](_0x4fdcc9['query'],_0x54d70d[_0x6ac2('0x37')]),_0x531be7);if(_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x39')]){_0x5a0ab9['where']=_[_0x6ac2('0x3a')](_0x5a0ab9[_0x6ac2('0x3b')],{'$or':_[_0x6ac2('0x27')](_0x531be7,function(_0x42d7cb){if(_0x42d7cb[_0x6ac2('0x3c')]!==_0x6ac2('0x3d')){var _0x2f8d4e={};_0x2f8d4e[_0x42d7cb[_0x6ac2('0x25')]]={'$like':'%'+_0x4fdcc9['query'][_0x6ac2('0x39')]+'%'};return _0x2f8d4e;}})});}_0x5a0ab9=_['merge']({},_0x5a0ab9,_0x4fdcc9['options']);var _0x97c2={'where':_0x5a0ab9['where']};return db[_0x6ac2('0x28')][_0x6ac2('0x1b')](_0x97c2)[_0x6ac2('0x3e')](function(_0x3cee2a){_0x16aea6[_0x6ac2('0x1b')]=_0x3cee2a;if(_0x4fdcc9[_0x6ac2('0x2d')][_0x6ac2('0x3f')]){_0x5a0ab9[_0x6ac2('0x40')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x5a0ab9);})[_0x6ac2('0x3e')](function(_0x5bfbb6){_0x16aea6[_0x6ac2('0x41')]=_0x5bfbb6;return _0x16aea6;})['then'](respondWithFilteredResult(_0x271043,_0x5a0ab9))[_0x6ac2('0x42')](handleError(_0x271043,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8827329..468ba81 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 _0xb6c4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Migration','lodash'];(function(_0x5a905e,_0x31aa4a){var _0x4124d6=function(_0x37c28a){while(--_0x37c28a){_0x5a905e['push'](_0x5a905e['shift']());}};_0x4124d6(++_0x31aa4a);}(_0xb6c4,0x16a));var _0x4b6c=function(_0x4fc394,_0x5ef070){_0x4fc394=_0x4fc394-0x0;var _0xeb1a43=_0xb6c4[_0x4fc394];return _0xeb1a43;};'use strict';var _=require(_0x4b6c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4b6c('0x1'));var moment=require(_0x4b6c('0x2'));var BPromise=require(_0x4b6c('0x3'));var rp=require(_0x4b6c('0x4'));var fs=require('fs');var path=require(_0x4b6c('0x5'));var rimraf=require(_0x4b6c('0x6'));var config=require(_0x4b6c('0x7'));var attributes=require('./migration.attributes');module[_0x4b6c('0x8')]=function(_0x247b60,_0x3f2e33){return _0x247b60[_0x4b6c('0x9')](_0x4b6c('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36c9=['rimraf','../../config/environment','exports','Migration','util','../../config/logger','api','request-promise','path'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x36c9,0xe5));var _0x936c=function(_0x1158de,_0x29435c){_0x1158de=_0x1158de-0x0;var _0x21f764=_0x36c9[_0x1158de];return _0x21f764;};'use strict';var _=require('lodash');var util=require(_0x936c('0x0'));var logger=require(_0x936c('0x1'))(_0x936c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x936c('0x3'));var fs=require('fs');var path=require(_0x936c('0x4'));var rimraf=require(_0x936c('0x5'));var config=require(_0x936c('0x6'));var attributes=require('./migration.attributes');module[_0x936c('0x7')]=function(_0x302c02,_0x2e1d85){return _0x302c02['define'](_0x936c('0x8'),attributes,{'tableName':'migrations','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 cf2fb53..fe7275d 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 _0x8d08=['message','Migration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code'];(function(_0x454351,_0x399d77){var _0x36bde5=function(_0x1c8208){while(--_0x1c8208){_0x454351['push'](_0x454351['shift']());}};_0x36bde5(++_0x399d77);}(_0x8d08,0x118));var _0x88d0=function(_0xc45596,_0x5c410e){_0xc45596=_0xc45596-0x0;var _0x425ffe=_0x8d08[_0xc45596];return _0x425ffe;};'use strict';var _=require(_0x88d0('0x0'));var util=require(_0x88d0('0x1'));var moment=require(_0x88d0('0x2'));var BPromise=require(_0x88d0('0x3'));var rs=require(_0x88d0('0x4'));var fs=require('fs');var Redis=require(_0x88d0('0x5'));var db=require(_0x88d0('0x6'))['db'];var utils=require(_0x88d0('0x7'));var logger=require(_0x88d0('0x8'))(_0x88d0('0x9'));var config=require(_0x88d0('0xa'));var jayson=require(_0x88d0('0xb'));var client=jayson['client'][_0x88d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14eafb,_0x584b6a,_0x42ceda){return new BPromise(function(_0x511c4a,_0x473151){return client['request'](_0x14eafb,_0x42ceda)[_0x88d0('0xd')](function(_0x2fb116){logger[_0x88d0('0xe')]('Migration,\x20%s,\x20%s',_0x584b6a,_0x88d0('0xf'));logger[_0x88d0('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x584b6a,_0x88d0('0xf'),JSON['stringify'](_0x2fb116));if(_0x2fb116[_0x88d0('0x11')]){if(_0x2fb116[_0x88d0('0x11')][_0x88d0('0x12')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x584b6a,_0x2fb116['error'][_0x88d0('0x13')]);return _0x473151(_0x2fb116[_0x88d0('0x11')][_0x88d0('0x13')]);}logger['error']('Migration,\x20%s,\x20%s',_0x584b6a,_0x2fb116['error'][_0x88d0('0x13')]);return _0x511c4a(_0x2fb116[_0x88d0('0x11')]['message']);}else{logger[_0x88d0('0xe')](_0x88d0('0x14'),_0x584b6a,_0x88d0('0xf'));_0x511c4a(_0x2fb116[_0x88d0('0x15')]['message']);}})[_0x88d0('0x16')](function(_0x371744){logger[_0x88d0('0x11')](_0x88d0('0x14'),_0x584b6a,_0x371744);_0x473151(_0x371744);});});} \ No newline at end of file +var _0x3e5c=['info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x1304ac,_0x416cdd){var _0x19e0ad=function(_0x350b70){while(--_0x350b70){_0x1304ac['push'](_0x1304ac['shift']());}};_0x19e0ad(++_0x416cdd);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x5d5696,_0x3a86ca){_0x5d5696=_0x5d5696-0x0;var _0x16c7ce=_0x3e5c[_0x5d5696];return _0x16c7ce;};'use strict';var _=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var moment=require(_0xc3e5('0x2'));var BPromise=require(_0xc3e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3e5('0x4'));var db=require(_0xc3e5('0x5'))['db'];var utils=require(_0xc3e5('0x6'));var logger=require(_0xc3e5('0x7'))(_0xc3e5('0x8'));var config=require(_0xc3e5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3e5('0xa')][_0xc3e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6089,_0xcbbec0,_0x2d580e){return new BPromise(function(_0x4864a2,_0x196f3a){return client[_0xc3e5('0xc')](_0x2d6089,_0x2d580e)[_0xc3e5('0xd')](function(_0x19813b){logger[_0xc3e5('0xe')](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));logger['debug'](_0xc3e5('0x11'),_0xcbbec0,_0xc3e5('0x10'),JSON[_0xc3e5('0x12')](_0x19813b));if(_0x19813b[_0xc3e5('0x13')]){if(_0x19813b['error'][_0xc3e5('0x14')]===0x1f4){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);return _0x196f3a(_0x19813b[_0xc3e5('0x13')]['message']);}logger['error']('Migration,\x20%s,\x20%s',_0xcbbec0,_0x19813b[_0xc3e5('0x13')]['message']);return _0x4864a2(_0x19813b[_0xc3e5('0x13')][_0xc3e5('0x15')]);}else{logger['info'](_0xc3e5('0xf'),_0xcbbec0,_0xc3e5('0x10'));_0x4864a2(_0x19813b[_0xc3e5('0x16')][_0xc3e5('0x15')]);}})[_0xc3e5('0x17')](function(_0x47cfd8){logger[_0xc3e5('0x13')](_0xc3e5('0xf'),_0xcbbec0,_0x47cfd8);_0x196f3a(_0x47cfd8);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 449a902..9990082 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 _0xe0dc=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5004c4,_0x54c1b4){var _0xca218d=function(_0x59585f){while(--_0x59585f){_0x5004c4['push'](_0x5004c4['shift']());}};_0xca218d(++_0x54c1b4);}(_0xe0dc,0x190));var _0xce0d=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xe0dc[_0x269ee8];return _0x4d98bd;};'use strict';var multer=require(_0xce0d('0x0'));var util=require('util');var path=require(_0xce0d('0x1'));var timeout=require(_0xce0d('0x2'));var express=require('express');var router=express[_0xce0d('0x3')]();var fs_extra=require(_0xce0d('0x4'));var auth=require(_0xce0d('0x5'));var interaction=require(_0xce0d('0x6'));var config=require('../../config/environment');var controller=require(_0xce0d('0x7'));router['get']('/',auth[_0xce0d('0x8')](),controller[_0xce0d('0x9')]);router[_0xce0d('0xa')](_0xce0d('0xb'),auth[_0xce0d('0x8')](),controller[_0xce0d('0xc')]);router[_0xce0d('0xd')]('/',auth[_0xce0d('0x8')](),controller[_0xce0d('0xe')]);router[_0xce0d('0xf')](_0xce0d('0xb'),auth[_0xce0d('0x8')](),controller[_0xce0d('0x10')]);router[_0xce0d('0x11')](_0xce0d('0xb'),auth[_0xce0d('0x8')](),controller[_0xce0d('0x12')]);module[_0xce0d('0x13')]=router; \ No newline at end of file +var _0x3b90=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x3b90,0x143));var _0x03b9=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x3b90[_0x55abd9];return _0x3e5669;};'use strict';var multer=require('multer');var util=require(_0x03b9('0x0'));var path=require(_0x03b9('0x1'));var timeout=require(_0x03b9('0x2'));var express=require(_0x03b9('0x3'));var router=express[_0x03b9('0x4')]();var fs_extra=require(_0x03b9('0x5'));var auth=require(_0x03b9('0x6'));var interaction=require(_0x03b9('0x7'));var config=require('../../config/environment');var controller=require(_0x03b9('0x8'));router['get']('/',auth[_0x03b9('0x9')](),controller[_0x03b9('0xa')]);router[_0x03b9('0xb')](_0x03b9('0xc'),auth[_0x03b9('0x9')](),controller[_0x03b9('0xd')]);router[_0x03b9('0xe')]('/',auth[_0x03b9('0x9')](),controller['create']);router['put']('/:id',auth[_0x03b9('0x9')](),controller[_0x03b9('0xf')]);router[_0x03b9('0x10')](_0x03b9('0xc'),auth['isAuthenticated'](),controller[_0x03b9('0x11')]);module[_0x03b9('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 2c85a76..4822e07 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 _0xfd3e=['externip','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x1c29f3,_0x6b24e5){var _0xf4f57c=function(_0x1cceba){while(--_0x1cceba){_0x1c29f3['push'](_0x1c29f3['shift']());}};_0xf4f57c(++_0x6b24e5);}(_0xfd3e,0x123));var _0xefd3=function(_0x1c4d73,_0x52cff1){_0x1c4d73=_0x1c4d73-0x0;var _0x3176ce=_0xfd3e[_0x1c4d73];return _0x3176ce;};'use strict';var Sequelize=require(_0xefd3('0x0'));module[_0xefd3('0x1')]={'type':{'type':Sequelize[_0xefd3('0x2')]('localnet',_0xefd3('0x3'),_0xefd3('0x4'),_0xefd3('0x5'))},'value':{'type':Sequelize[_0xefd3('0x6')]},'username':{'type':Sequelize[_0xefd3('0x6')]},'password':{'type':Sequelize[_0xefd3('0x6')]}}; \ No newline at end of file +var _0x30d9=['turn','sequelize','ENUM','localnet','externip','stun'];(function(_0xe83d4c,_0x278a37){var _0x35455e=function(_0x341cf1){while(--_0x341cf1){_0xe83d4c['push'](_0xe83d4c['shift']());}};_0x35455e(++_0x278a37);}(_0x30d9,0x187));var _0x930d=function(_0x24dd5a,_0x24f02c){_0x24dd5a=_0x24dd5a-0x0;var _0x24592e=_0x30d9[_0x24dd5a];return _0x24592e;};'use strict';var Sequelize=require(_0x930d('0x0'));module['exports']={'type':{'type':Sequelize[_0x930d('0x1')](_0x930d('0x2'),_0x930d('0x3'),_0x930d('0x4'),_0x930d('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 900c225..1f0c631 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 _0x6c15=['VIRTUAL','filter','options','include','show','params','create','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','server/files/templates/turn_multiple.ejs','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','Network','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge'];(function(_0x12ed37,_0x488b5c){var _0x4c1821=function(_0x47c026){while(--_0x47c026){_0x12ed37['push'](_0x12ed37['shift']());}};_0x4c1821(++_0x488b5c);}(_0x6c15,0xf8));var _0x56c1=function(_0x404a02,_0x3ee3cb){_0x404a02=_0x404a02-0x0;var _0x53b57d=_0x6c15[_0x404a02];return _0x53b57d;};'use strict';var emlformat=require(_0x56c1('0x0'));var rimraf=require(_0x56c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56c1('0x2'));var rp=require(_0x56c1('0x3'));var moment=require(_0x56c1('0x4'));var BPromise=require(_0x56c1('0x5'));var Mustache=require(_0x56c1('0x6'));var util=require(_0x56c1('0x7'));var path=require(_0x56c1('0x8'));var sox=require('sox');var csv=require(_0x56c1('0x9'));var ejs=require(_0x56c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x56c1('0xb'));var crypto=require(_0x56c1('0xc'));var jsforce=require(_0x56c1('0xd'));var deskjs=require(_0x56c1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x56c1('0xf'));var Papa=require(_0x56c1('0x10'));var Redis=require(_0x56c1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x56c1('0x12'));var as=require(_0x56c1('0x13'));var hardwareService=require(_0x56c1('0x14'));var logger=require(_0x56c1('0x15'))(_0x56c1('0x16'));var utils=require(_0x56c1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x56c1('0x18'));var db=require(_0x56c1('0x19'))['db'];var jayson=require(_0x56c1('0x1a'));var client=jayson[_0x56c1('0x1b')][_0x56c1('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1ea5f9,_0xe5d1a1,_0x4c912e,_0x256b64){return new BPromise(function(_0x3804e8,_0x58976a){var _0x3ebe83=_0x256b64||client;return _0x3ebe83[_0x56c1('0x1d')](_0x1ea5f9,_0x4c912e)[_0x56c1('0x1e')](function(_0x496f7d){logger[_0x56c1('0x1f')](_0x56c1('0x20'),_0xe5d1a1,'request\x20sent');logger[_0x56c1('0x21')](_0x56c1('0x22'),_0xe5d1a1,'request\x20sent',JSON[_0x56c1('0x23')](_0x496f7d));if(_0x496f7d[_0x56c1('0x24')]){if(_0x496f7d[_0x56c1('0x24')][_0x56c1('0x25')]===0x1f4){logger[_0x56c1('0x24')]('Network,\x20%s,\x20%s',_0xe5d1a1,_0x496f7d[_0x56c1('0x24')][_0x56c1('0x26')]);return _0x58976a(_0x496f7d[_0x56c1('0x24')][_0x56c1('0x26')]);}logger[_0x56c1('0x24')](_0x56c1('0x20'),_0xe5d1a1,_0x496f7d[_0x56c1('0x24')][_0x56c1('0x26')]);return _0x3804e8(_0x496f7d[_0x56c1('0x24')][_0x56c1('0x26')]);}else{logger[_0x56c1('0x1f')](_0x56c1('0x20'),_0xe5d1a1,_0x56c1('0x27'));_0x3804e8(_0x496f7d['result'][_0x56c1('0x26')]);}})[_0x56c1('0x28')](function(_0x390068){logger[_0x56c1('0x24')](_0x56c1('0x20'),_0xe5d1a1,_0x390068);_0x58976a(_0x390068);});});}function respondWithStatusCode(_0x3668b1,_0x73c392){_0x73c392=_0x73c392||0xcc;return function(_0x3a1130){if(_0x3a1130){return _0x3668b1[_0x56c1('0x29')](_0x73c392);}return _0x3668b1['status'](_0x73c392)[_0x56c1('0x2a')]();};}function respondWithResult(_0x136124,_0x1a0abd){_0x1a0abd=_0x1a0abd||0xc8;return function(_0x231aa1){if(_0x231aa1){return _0x136124[_0x56c1('0x2b')](_0x1a0abd)[_0x56c1('0x2c')](_0x231aa1);}};}function respondWithFilteredResult(_0x1d7376,_0x1a801d){return function(_0x443179){if(_0x443179){var _0x2642ec=typeof _0x1a801d[_0x56c1('0x2d')]===_0x56c1('0x2e')&&typeof _0x1a801d[_0x56c1('0x2f')]===_0x56c1('0x2e');var _0x1608a5=_0x443179['count'];var _0x4efc43=_0x2642ec?0x0:_0x1a801d[_0x56c1('0x2d')];var _0x17b39e=_0x2642ec?_0x443179[_0x56c1('0x30')]:_0x1a801d[_0x56c1('0x2d')]+_0x1a801d[_0x56c1('0x2f')];var _0x142e64;if(_0x17b39e>=_0x1608a5){_0x17b39e=_0x1608a5;_0x142e64=0xc8;}else{_0x142e64=0xce;}_0x1d7376[_0x56c1('0x2b')](_0x142e64);return _0x1d7376[_0x56c1('0x31')](_0x56c1('0x32'),_0x4efc43+'-'+_0x17b39e+'/'+_0x1608a5)[_0x56c1('0x2c')](_0x443179);}return null;};}function patchUpdates(_0x38d34a){return function(_0x2c3699){try{jsonpatch[_0x56c1('0x33')](_0x2c3699,_0x38d34a,!![]);}catch(_0x2c33f6){return BPromise['reject'](_0x2c33f6);}return _0x2c3699[_0x56c1('0x34')]();};}function saveUpdates(_0x470dca,_0x13d847){return function(_0x1f20d4){if(_0x1f20d4){return _0x1f20d4[_0x56c1('0x35')](_0x470dca)[_0x56c1('0x1e')](function(_0x282db2){return _0x282db2;});}return null;};}function removeEntity(_0x21bd64,_0x36f8da){return function(_0x2798a9){if(_0x2798a9){return _0x2798a9[_0x56c1('0x36')]()[_0x56c1('0x1e')](function(){_0x21bd64[_0x56c1('0x2b')](0xcc)[_0x56c1('0x2a')]();});}};}function handleEntityNotFound(_0x43debb,_0x13c275){return function(_0x27784a){if(!_0x27784a){_0x43debb[_0x56c1('0x29')](0x194);}return _0x27784a;};}function handleError(_0x403c83,_0x24ff7a){_0x24ff7a=_0x24ff7a||0x1f4;return function(_0x12635){logger[_0x56c1('0x24')](_0x12635[_0x56c1('0x37')]);if(_0x12635['name']){delete _0x12635[_0x56c1('0x38')];}_0x403c83[_0x56c1('0x2b')](_0x24ff7a)[_0x56c1('0x39')](_0x12635);};}exports['index']=function(_0x5d9296,_0x598ab8){var _0x6cc3a7={},_0x1f8441={},_0x5a169c={'count':0x0,'rows':[]};var _0x25517e=_[_0x56c1('0x3a')](db[_0x56c1('0x3b')]['rawAttributes'],function(_0x1ad616){return{'name':_0x1ad616[_0x56c1('0x3c')],'type':_0x1ad616[_0x56c1('0x3d')][_0x56c1('0x3e')]};});_0x1f8441[_0x56c1('0x3f')]=_[_0x56c1('0x3a')](_0x25517e,_0x56c1('0x38'));_0x1f8441[_0x56c1('0x40')]=_[_0x56c1('0x41')](_0x5d9296[_0x56c1('0x40')]);_0x1f8441[_0x56c1('0x42')]=_['intersection'](_0x1f8441[_0x56c1('0x3f')],_0x1f8441['query']);_0x6cc3a7[_0x56c1('0x43')]=_[_0x56c1('0x44')](_0x1f8441[_0x56c1('0x3f')],qs[_0x56c1('0x45')](_0x5d9296[_0x56c1('0x40')]['fields']));_0x6cc3a7[_0x56c1('0x43')]=_0x6cc3a7[_0x56c1('0x43')][_0x56c1('0x46')]?_0x6cc3a7['attributes']:_0x1f8441[_0x56c1('0x3f')];if(!_0x5d9296[_0x56c1('0x40')]['hasOwnProperty'](_0x56c1('0x47'))){_0x6cc3a7[_0x56c1('0x2f')]=qs[_0x56c1('0x2f')](_0x5d9296['query'][_0x56c1('0x2f')]);_0x6cc3a7[_0x56c1('0x2d')]=qs[_0x56c1('0x2d')](_0x5d9296[_0x56c1('0x40')][_0x56c1('0x2d')]);}_0x6cc3a7[_0x56c1('0x48')]=qs['sort'](_0x5d9296[_0x56c1('0x40')][_0x56c1('0x49')]);_0x6cc3a7['where']=qs[_0x56c1('0x42')](_['pick'](_0x5d9296[_0x56c1('0x40')],_0x1f8441[_0x56c1('0x42')]),_0x25517e);if(_0x5d9296[_0x56c1('0x40')]['filter']){_0x6cc3a7[_0x56c1('0x4a')]=_[_0x56c1('0x4b')](_0x6cc3a7[_0x56c1('0x4a')],{'$or':_[_0x56c1('0x3a')](_0x25517e,function(_0x1a3dd4){if(_0x1a3dd4[_0x56c1('0x3d')]!==_0x56c1('0x4c')){var _0x45d321={};_0x45d321[_0x1a3dd4[_0x56c1('0x38')]]={'$like':'%'+_0x5d9296['query'][_0x56c1('0x4d')]+'%'};return _0x45d321;}})});}_0x6cc3a7=_[_0x56c1('0x4b')]({},_0x6cc3a7,_0x5d9296[_0x56c1('0x4e')]);var _0x2fada1={'where':_0x6cc3a7[_0x56c1('0x4a')]};return db[_0x56c1('0x3b')][_0x56c1('0x30')](_0x2fada1)['then'](function(_0x3b2007){_0x5a169c[_0x56c1('0x30')]=_0x3b2007;if(_0x5d9296[_0x56c1('0x40')]['includeAll']){_0x6cc3a7[_0x56c1('0x4f')]=[{'all':!![]}];}return db['Network']['findAll'](_0x6cc3a7);})[_0x56c1('0x1e')](function(_0x8150ba){_0x5a169c['rows']=_0x8150ba;return _0x5a169c;})[_0x56c1('0x1e')](respondWithFilteredResult(_0x598ab8,_0x6cc3a7))[_0x56c1('0x28')](handleError(_0x598ab8,null));};exports[_0x56c1('0x50')]=function(_0x482110,_0x3bfd00){var _0x3c73de={'raw':!![],'where':{'id':_0x482110[_0x56c1('0x51')]['id']}},_0x50525f={};_0x50525f[_0x56c1('0x3f')]=_[_0x56c1('0x41')](db[_0x56c1('0x3b')]['rawAttributes']);_0x50525f['query']=_[_0x56c1('0x41')](_0x482110[_0x56c1('0x40')]);_0x50525f[_0x56c1('0x42')]=_[_0x56c1('0x44')](_0x50525f[_0x56c1('0x3f')],_0x50525f[_0x56c1('0x40')]);_0x3c73de[_0x56c1('0x43')]=_[_0x56c1('0x44')](_0x50525f[_0x56c1('0x3f')],qs[_0x56c1('0x45')](_0x482110['query'][_0x56c1('0x45')]));_0x3c73de[_0x56c1('0x43')]=_0x3c73de[_0x56c1('0x43')][_0x56c1('0x46')]?_0x3c73de['attributes']:_0x50525f[_0x56c1('0x3f')];if(_0x482110['query']['includeAll']){_0x3c73de[_0x56c1('0x4f')]=[{'all':!![]}];}_0x3c73de=_[_0x56c1('0x4b')]({},_0x3c73de,_0x482110[_0x56c1('0x4e')]);return db[_0x56c1('0x3b')]['find'](_0x3c73de)[_0x56c1('0x1e')](handleEntityNotFound(_0x3bfd00,null))[_0x56c1('0x1e')](respondWithResult(_0x3bfd00,null))[_0x56c1('0x28')](handleError(_0x3bfd00,null));};exports[_0x56c1('0x52')]=function(_0x37c5d2,_0x413b45,_0x4516ef){var _0x52060a;return db[_0x56c1('0x53')][_0x56c1('0x54')](function(_0x16f67a){return db[_0x56c1('0x3b')][_0x56c1('0x52')](_0x37c5d2[_0x56c1('0x55')],{'raw':!![]})[_0x56c1('0x1e')](function(_0x3ea227){_0x52060a=_0x3ea227;return db[_0x56c1('0x3b')][_0x56c1('0x56')]({'where':{'type':_0x37c5d2[_0x56c1('0x55')][_0x56c1('0x3d')]},'raw':!![]});})['then'](function(_0x562dae){if(_0x52060a[_0x56c1('0x3d')][_0x56c1('0x57')]()==_0x56c1('0x58')){var _0x295182=fs[_0x56c1('0x59')](path[_0x56c1('0x5a')](config[_0x56c1('0x5b')],_0x56c1('0x5c')),_0x56c1('0x5d'));var _0x23a6d4=ejs[_0x56c1('0x5e')](_0x295182,{'networks':_0x562dae||[]});fs['writeFileSync'](_0x56c1('0x5f'),_0x23a6d4);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x52'),{'module':_0x56c1('0x61')});}else if(_0x52060a[_0x56c1('0x3d')]['toUpperCase']()==_0x56c1('0x62')){var _0x461f10=fs[_0x56c1('0x59')](path[_0x56c1('0x5a')](config[_0x56c1('0x5b')],'server/files/templates/turn_multiple.ejs'),_0x56c1('0x5d'));var _0x2ece25=ejs['render'](_0x461f10,{'networks':_0x562dae||[]});fs['writeFileSync'](_0x56c1('0x63'),_0x2ece25);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x52'),{'module':'res_stun_monitor.so'});}else{var _0x32cbdd=fs[_0x56c1('0x59')](path[_0x56c1('0x5a')](config['root'],_0x56c1('0x64')),_0x56c1('0x5d'));var _0x2d47c5=ejs[_0x56c1('0x5e')](_0x32cbdd,{'networks':_0x562dae||[]});fs[_0x56c1('0x65')](util[_0x56c1('0x66')](_0x56c1('0x67'),_0x37c5d2[_0x56c1('0x55')][_0x56c1('0x3d')]['toLowerCase']()),_0x2d47c5);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x52'),{'module':_0x56c1('0x68')});}return null;})[_0x56c1('0x1e')](function(){return _0x52060a;});})['then'](respondWithResult(_0x413b45,0xc9))[_0x56c1('0x28')](handleError(_0x413b45,null));};exports[_0x56c1('0x35')]=function(_0x4eaa4b,_0x4da3fc,_0x250030){var _0x14c2fd;return db['sequelize'][_0x56c1('0x54')](function(_0x435a96){return db[_0x56c1('0x3b')][_0x56c1('0x69')]({'where':{'id':_0x4eaa4b[_0x56c1('0x51')]['id']}})[_0x56c1('0x1e')](handleEntityNotFound(_0x4da3fc,null))[_0x56c1('0x1e')](saveUpdates(_0x4eaa4b['body'],null))[_0x56c1('0x1e')](function(_0x5115d9){if(_0x5115d9){_0x14c2fd=_0x5115d9;return db[_0x56c1('0x3b')][_0x56c1('0x56')]({'where':{'type':_0x14c2fd[_0x56c1('0x3d')]},'raw':!![]});}return null;})[_0x56c1('0x1e')](function(_0x39c639){if(_0x14c2fd['type'][_0x56c1('0x57')]()==_0x56c1('0x58')){var _0x14a39e=fs[_0x56c1('0x59')](path['join'](config[_0x56c1('0x5b')],_0x56c1('0x5c')),_0x56c1('0x5d'));var _0x5815e2=ejs[_0x56c1('0x5e')](_0x14a39e,{'networks':_0x39c639||[]});fs['writeFileSync'](_0x56c1('0x5f'),_0x5815e2);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x35'),{'module':_0x56c1('0x61')});}else if(_0x14c2fd[_0x56c1('0x3d')][_0x56c1('0x57')]()==_0x56c1('0x62')){var _0x599fa8=fs[_0x56c1('0x59')](path['join'](config[_0x56c1('0x5b')],_0x56c1('0x6a')),_0x56c1('0x5d'));var _0x160124=ejs[_0x56c1('0x5e')](_0x599fa8,{'networks':_0x39c639||[]});fs[_0x56c1('0x65')](_0x56c1('0x63'),_0x160124);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x35'),{'module':_0x56c1('0x61')});}else{var _0x45c77a=fs[_0x56c1('0x59')](path[_0x56c1('0x5a')](config[_0x56c1('0x5b')],_0x56c1('0x64')),_0x56c1('0x5d'));var _0x1de0de=ejs[_0x56c1('0x5e')](_0x45c77a,{'networks':_0x39c639||[]});fs['writeFileSync'](util['format'](_0x56c1('0x67'),_0x4eaa4b[_0x56c1('0x55')]['type'][_0x56c1('0x6b')]()),_0x1de0de);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x35'),{'module':_0x56c1('0x68')});}return null;})[_0x56c1('0x1e')](function(_0x1e9445){if(_0x1e9445){return _0x14c2fd;}return null;});})[_0x56c1('0x1e')](respondWithResult(_0x4da3fc,null))[_0x56c1('0x28')](handleError(_0x4da3fc,null));};exports[_0x56c1('0x36')]=function(_0x25da1b,_0xad8c8e,_0x3888c5){var _0x6884e2;return db['Network'][_0x56c1('0x69')]({'where':{'id':_0x25da1b[_0x56c1('0x51')]['id']}})['then'](function(_0x4e4cd6){_0x6884e2=_0x4e4cd6;return _0x4e4cd6;})[_0x56c1('0x1e')](handleEntityNotFound(_0xad8c8e,null))[_0x56c1('0x1e')](removeEntity(_0xad8c8e,null))[_0x56c1('0x1e')](function(){if(_0x6884e2){return db['Network']['findAll']({'where':{'type':_0x6884e2['type']},'raw':!![]});}})[_0x56c1('0x1e')](function(_0x3630cc){if(_0x6884e2['type'][_0x56c1('0x57')]()==_0x56c1('0x58')){var _0x18c9a0=fs[_0x56c1('0x59')](path[_0x56c1('0x5a')](config['root'],_0x56c1('0x5c')),'utf8');var _0xb03b20=ejs['render'](_0x18c9a0,{'networks':_0x3630cc||[]});fs['writeFileSync'](_0x56c1('0x5f'),_0xb03b20);return respondWithRpcPromise(_0x56c1('0x60'),_0x56c1('0x36'),{'module':'res_stun_monitor.so'});}else if(_0x6884e2[_0x56c1('0x3d')][_0x56c1('0x57')]()==_0x56c1('0x62')){var _0x3cf3a1=fs['readFileSync'](path[_0x56c1('0x5a')](config[_0x56c1('0x5b')],_0x56c1('0x6a')),_0x56c1('0x5d'));var _0x11fca7=ejs[_0x56c1('0x5e')](_0x3cf3a1,{'networks':_0x3630cc||[]});fs[_0x56c1('0x65')](_0x56c1('0x63'),_0x11fca7);return respondWithRpcPromise('Reload',_0x56c1('0x36'),{'module':_0x56c1('0x61')});}else{var _0x5167f0=fs['readFileSync'](path[_0x56c1('0x5a')](config[_0x56c1('0x5b')],_0x56c1('0x64')),_0x56c1('0x5d'));var _0x489b5b=ejs['render'](_0x5167f0,{'networks':_0x3630cc||[]});fs[_0x56c1('0x65')](util[_0x56c1('0x66')](_0x56c1('0x67'),_0x25da1b[_0x56c1('0x55')][_0x56c1('0x3d')][_0x56c1('0x6b')]()),_0x489b5b);return respondWithRpcPromise('Reload','destroy',{'module':_0x56c1('0x68')});}return null;})[_0x56c1('0x28')](handleError(_0xad8c8e,null));}; \ No newline at end of file +var _0x25ad=['/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','create','chan_sip.so','find','params','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','Network','rawAttributes','key','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','type','merge','options','includeAll','include','findAll','catch','show','keys','sequelize','transaction','body','toUpperCase','STUN','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format'];(function(_0x4ea25a,_0x2866d6){var _0x4defc7=function(_0x3414ff){while(--_0x3414ff){_0x4ea25a['push'](_0x4ea25a['shift']());}};_0x4defc7(++_0x2866d6);}(_0x25ad,0x1b1));var _0xd25a=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x25ad[_0x421196];return _0x2738af;};'use strict';var emlformat=require(_0xd25a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd25a('0x1'));var jsonpatch=require(_0xd25a('0x2'));var rp=require(_0xd25a('0x3'));var moment=require('moment');var BPromise=require(_0xd25a('0x4'));var Mustache=require(_0xd25a('0x5'));var util=require(_0xd25a('0x6'));var path=require(_0xd25a('0x7'));var sox=require(_0xd25a('0x8'));var csv=require(_0xd25a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd25a('0xa'));var squel=require(_0xd25a('0xb'));var crypto=require('crypto');var jsforce=require(_0xd25a('0xc'));var deskjs=require(_0xd25a('0xd'));var toCsv=require(_0xd25a('0x9'));var querystring=require(_0xd25a('0xe'));var Papa=require(_0xd25a('0xf'));var Redis=require(_0xd25a('0x10'));var authService=require(_0xd25a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd25a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd25a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd25a('0x14'));var db=require(_0xd25a('0x15'))['db'];var jayson=require(_0xd25a('0x16'));var client=jayson[_0xd25a('0x17')][_0xd25a('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3a9286,_0x525e82,_0x320f41,_0x1acb3d){return new BPromise(function(_0xf0e768,_0x503611){var _0x13ac69=_0x1acb3d||client;return _0x13ac69['request'](_0x3a9286,_0x320f41)[_0xd25a('0x19')](function(_0x18c903){logger[_0xd25a('0x1a')](_0xd25a('0x1b'),_0x525e82,'request\x20sent');logger[_0xd25a('0x1c')](_0xd25a('0x1d'),_0x525e82,'request\x20sent',JSON[_0xd25a('0x1e')](_0x18c903));if(_0x18c903[_0xd25a('0x1f')]){if(_0x18c903[_0xd25a('0x1f')][_0xd25a('0x20')]===0x1f4){logger[_0xd25a('0x1f')](_0xd25a('0x1b'),_0x525e82,_0x18c903['error'][_0xd25a('0x21')]);return _0x503611(_0x18c903['error'][_0xd25a('0x21')]);}logger[_0xd25a('0x1f')]('Network,\x20%s,\x20%s',_0x525e82,_0x18c903[_0xd25a('0x1f')]['message']);return _0xf0e768(_0x18c903[_0xd25a('0x1f')]['message']);}else{logger[_0xd25a('0x1a')](_0xd25a('0x1b'),_0x525e82,_0xd25a('0x22'));_0xf0e768(_0x18c903[_0xd25a('0x23')][_0xd25a('0x21')]);}})['catch'](function(_0x32a400){logger[_0xd25a('0x1f')](_0xd25a('0x1b'),_0x525e82,_0x32a400);_0x503611(_0x32a400);});});}function respondWithStatusCode(_0x4b5622,_0x40362d){_0x40362d=_0x40362d||0xcc;return function(_0xeaa46f){if(_0xeaa46f){return _0x4b5622['sendStatus'](_0x40362d);}return _0x4b5622[_0xd25a('0x24')](_0x40362d)[_0xd25a('0x25')]();};}function respondWithResult(_0x131831,_0x54cb89){_0x54cb89=_0x54cb89||0xc8;return function(_0x1ae9e3){if(_0x1ae9e3){return _0x131831[_0xd25a('0x24')](_0x54cb89)[_0xd25a('0x26')](_0x1ae9e3);}};}function respondWithFilteredResult(_0x1dc950,_0x1d10c5){return function(_0x11979b){if(_0x11979b){var _0x1b1b02=typeof _0x1d10c5[_0xd25a('0x27')]==='undefined'&&typeof _0x1d10c5['limit']===_0xd25a('0x28');var _0x153687=_0x11979b['count'];var _0x41999e=_0x1b1b02?0x0:_0x1d10c5[_0xd25a('0x27')];var _0x173ff2=_0x1b1b02?_0x11979b[_0xd25a('0x29')]:_0x1d10c5[_0xd25a('0x27')]+_0x1d10c5[_0xd25a('0x2a')];var _0x3e1334;if(_0x173ff2>=_0x153687){_0x173ff2=_0x153687;_0x3e1334=0xc8;}else{_0x3e1334=0xce;}_0x1dc950[_0xd25a('0x24')](_0x3e1334);return _0x1dc950[_0xd25a('0x2b')]('Content-Range',_0x41999e+'-'+_0x173ff2+'/'+_0x153687)['json'](_0x11979b);}return null;};}function patchUpdates(_0x41de41){return function(_0x4c6ad8){try{jsonpatch[_0xd25a('0x2c')](_0x4c6ad8,_0x41de41,!![]);}catch(_0x442dff){return BPromise[_0xd25a('0x2d')](_0x442dff);}return _0x4c6ad8[_0xd25a('0x2e')]();};}function saveUpdates(_0x268e18,_0x34ac50){return function(_0x59f8e3){if(_0x59f8e3){return _0x59f8e3[_0xd25a('0x2f')](_0x268e18)[_0xd25a('0x19')](function(_0x263fa7){return _0x263fa7;});}return null;};}function removeEntity(_0x303417,_0x51d1bb){return function(_0x1c0dd4){if(_0x1c0dd4){return _0x1c0dd4[_0xd25a('0x30')]()[_0xd25a('0x19')](function(){_0x303417[_0xd25a('0x24')](0xcc)[_0xd25a('0x25')]();});}};}function handleEntityNotFound(_0x5ab89d,_0x4f4383){return function(_0x79251c){if(!_0x79251c){_0x5ab89d[_0xd25a('0x31')](0x194);}return _0x79251c;};}function handleError(_0x90a58a,_0x59e641){_0x59e641=_0x59e641||0x1f4;return function(_0x2abbe0){logger['error'](_0x2abbe0[_0xd25a('0x32')]);if(_0x2abbe0[_0xd25a('0x33')]){delete _0x2abbe0['name'];}_0x90a58a[_0xd25a('0x24')](_0x59e641)[_0xd25a('0x34')](_0x2abbe0);};}exports[_0xd25a('0x35')]=function(_0x37835b,_0x25d800){var _0xf272b4={},_0x5a49ec={},_0x10d1cc={'count':0x0,'rows':[]};var _0x545b23=_[_0xd25a('0x36')](db[_0xd25a('0x37')][_0xd25a('0x38')],function(_0x48a12f){return{'name':_0x48a12f['fieldName'],'type':_0x48a12f['type'][_0xd25a('0x39')]};});_0x5a49ec['model']=_[_0xd25a('0x36')](_0x545b23,_0xd25a('0x33'));_0x5a49ec[_0xd25a('0x3a')]=_['keys'](_0x37835b[_0xd25a('0x3a')]);_0x5a49ec['filters']=_['intersection'](_0x5a49ec[_0xd25a('0x3b')],_0x5a49ec[_0xd25a('0x3a')]);_0xf272b4['attributes']=_[_0xd25a('0x3c')](_0x5a49ec['model'],qs[_0xd25a('0x3d')](_0x37835b[_0xd25a('0x3a')][_0xd25a('0x3d')]));_0xf272b4['attributes']=_0xf272b4[_0xd25a('0x3e')][_0xd25a('0x3f')]?_0xf272b4[_0xd25a('0x3e')]:_0x5a49ec['model'];if(!_0x37835b['query'][_0xd25a('0x40')](_0xd25a('0x41'))){_0xf272b4[_0xd25a('0x2a')]=qs['limit'](_0x37835b['query'][_0xd25a('0x2a')]);_0xf272b4[_0xd25a('0x27')]=qs['offset'](_0x37835b[_0xd25a('0x3a')][_0xd25a('0x27')]);}_0xf272b4['order']=qs[_0xd25a('0x42')](_0x37835b[_0xd25a('0x3a')][_0xd25a('0x42')]);_0xf272b4['where']=qs[_0xd25a('0x43')](_[_0xd25a('0x44')](_0x37835b['query'],_0x5a49ec['filters']),_0x545b23);if(_0x37835b[_0xd25a('0x3a')][_0xd25a('0x45')]){_0xf272b4[_0xd25a('0x46')]=_['merge'](_0xf272b4[_0xd25a('0x46')],{'$or':_['map'](_0x545b23,function(_0x392ec0){if(_0x392ec0[_0xd25a('0x47')]!=='VIRTUAL'){var _0x56ed80={};_0x56ed80[_0x392ec0[_0xd25a('0x33')]]={'$like':'%'+_0x37835b['query'][_0xd25a('0x45')]+'%'};return _0x56ed80;}})});}_0xf272b4=_[_0xd25a('0x48')]({},_0xf272b4,_0x37835b[_0xd25a('0x49')]);var _0x5c2fd3={'where':_0xf272b4['where']};return db[_0xd25a('0x37')][_0xd25a('0x29')](_0x5c2fd3)[_0xd25a('0x19')](function(_0x466204){_0x10d1cc['count']=_0x466204;if(_0x37835b['query'][_0xd25a('0x4a')]){_0xf272b4[_0xd25a('0x4b')]=[{'all':!![]}];}return db[_0xd25a('0x37')][_0xd25a('0x4c')](_0xf272b4);})[_0xd25a('0x19')](function(_0x3390e7){_0x10d1cc['rows']=_0x3390e7;return _0x10d1cc;})[_0xd25a('0x19')](respondWithFilteredResult(_0x25d800,_0xf272b4))[_0xd25a('0x4d')](handleError(_0x25d800,null));};exports[_0xd25a('0x4e')]=function(_0x7c5e02,_0x1e54ec){var _0x572ac2={'raw':!![],'where':{'id':_0x7c5e02['params']['id']}},_0x16bf7f={};_0x16bf7f[_0xd25a('0x3b')]=_[_0xd25a('0x4f')](db[_0xd25a('0x37')]['rawAttributes']);_0x16bf7f[_0xd25a('0x3a')]=_[_0xd25a('0x4f')](_0x7c5e02[_0xd25a('0x3a')]);_0x16bf7f[_0xd25a('0x43')]=_['intersection'](_0x16bf7f[_0xd25a('0x3b')],_0x16bf7f[_0xd25a('0x3a')]);_0x572ac2[_0xd25a('0x3e')]=_[_0xd25a('0x3c')](_0x16bf7f['model'],qs[_0xd25a('0x3d')](_0x7c5e02[_0xd25a('0x3a')][_0xd25a('0x3d')]));_0x572ac2[_0xd25a('0x3e')]=_0x572ac2[_0xd25a('0x3e')][_0xd25a('0x3f')]?_0x572ac2[_0xd25a('0x3e')]:_0x16bf7f['model'];if(_0x7c5e02['query']['includeAll']){_0x572ac2[_0xd25a('0x4b')]=[{'all':!![]}];}_0x572ac2=_['merge']({},_0x572ac2,_0x7c5e02[_0xd25a('0x49')]);return db[_0xd25a('0x37')]['find'](_0x572ac2)[_0xd25a('0x19')](handleEntityNotFound(_0x1e54ec,null))[_0xd25a('0x19')](respondWithResult(_0x1e54ec,null))[_0xd25a('0x4d')](handleError(_0x1e54ec,null));};exports['create']=function(_0x54c637,_0x3bd3d4,_0x334be6){var _0x4b9616;return db[_0xd25a('0x50')][_0xd25a('0x51')](function(_0x11b1b9){return db[_0xd25a('0x37')]['create'](_0x54c637[_0xd25a('0x52')],{'raw':!![]})[_0xd25a('0x19')](function(_0x1117ad){_0x4b9616=_0x1117ad;return db['Network'][_0xd25a('0x4c')]({'where':{'type':_0x54c637[_0xd25a('0x52')][_0xd25a('0x47')]},'raw':!![]});})[_0xd25a('0x19')](function(_0x4bf7b0){if(_0x4b9616[_0xd25a('0x47')][_0xd25a('0x53')]()==_0xd25a('0x54')){var _0x2e5c69=fs['readFileSync'](path[_0xd25a('0x55')](config[_0xd25a('0x56')],'server/files/templates/stun_multiple.ejs'),_0xd25a('0x57'));var _0x304c67=ejs[_0xd25a('0x58')](_0x2e5c69,{'networks':_0x4bf7b0||[]});fs[_0xd25a('0x59')](_0xd25a('0x5a'),_0x304c67);return respondWithRpcPromise('Reload','create',{'module':_0xd25a('0x5b')});}else if(_0x4b9616[_0xd25a('0x47')][_0xd25a('0x53')]()==_0xd25a('0x5c')){var _0xbd9d1e=fs[_0xd25a('0x5d')](path['join'](config[_0xd25a('0x56')],_0xd25a('0x5e')),_0xd25a('0x57'));var _0x2fca17=ejs[_0xd25a('0x58')](_0xbd9d1e,{'networks':_0x4bf7b0||[]});fs[_0xd25a('0x59')](_0xd25a('0x5f'),_0x2fca17);return respondWithRpcPromise('Reload','create',{'module':_0xd25a('0x5b')});}else{var _0xe96bb5=fs[_0xd25a('0x5d')](path[_0xd25a('0x55')](config['root'],'server/files/templates/network.ejs'),_0xd25a('0x57'));var _0x5368c9=ejs[_0xd25a('0x58')](_0xe96bb5,{'networks':_0x4bf7b0||[]});fs['writeFileSync'](util[_0xd25a('0x60')](_0xd25a('0x61'),_0x54c637['body'][_0xd25a('0x47')][_0xd25a('0x62')]()),_0x5368c9);return respondWithRpcPromise(_0xd25a('0x63'),_0xd25a('0x64'),{'module':_0xd25a('0x65')});}return null;})[_0xd25a('0x19')](function(){return _0x4b9616;});})[_0xd25a('0x19')](respondWithResult(_0x3bd3d4,0xc9))[_0xd25a('0x4d')](handleError(_0x3bd3d4,null));};exports[_0xd25a('0x2f')]=function(_0x37df7e,_0x1ae57a,_0x25d933){var _0x54530a;return db['sequelize'][_0xd25a('0x51')](function(_0x176281){return db[_0xd25a('0x37')][_0xd25a('0x66')]({'where':{'id':_0x37df7e[_0xd25a('0x67')]['id']}})['then'](handleEntityNotFound(_0x1ae57a,null))[_0xd25a('0x19')](saveUpdates(_0x37df7e[_0xd25a('0x52')],null))[_0xd25a('0x19')](function(_0x31e2de){if(_0x31e2de){_0x54530a=_0x31e2de;return db[_0xd25a('0x37')][_0xd25a('0x4c')]({'where':{'type':_0x54530a[_0xd25a('0x47')]},'raw':!![]});}return null;})[_0xd25a('0x19')](function(_0x2577ab){if(_0x54530a[_0xd25a('0x47')][_0xd25a('0x53')]()=='STUN'){var _0x5d63c2=fs[_0xd25a('0x5d')](path[_0xd25a('0x55')](config['root'],_0xd25a('0x68')),_0xd25a('0x57'));var _0x51a23a=ejs[_0xd25a('0x58')](_0x5d63c2,{'networks':_0x2577ab||[]});fs[_0xd25a('0x59')]('/etc/asterisk/stun_xcally.conf',_0x51a23a);return respondWithRpcPromise(_0xd25a('0x63'),_0xd25a('0x2f'),{'module':_0xd25a('0x5b')});}else if(_0x54530a['type'][_0xd25a('0x53')]()=='TURN'){var _0x56320e=fs[_0xd25a('0x5d')](path[_0xd25a('0x55')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xd25a('0x57'));var _0x57d6ac=ejs['render'](_0x56320e,{'networks':_0x2577ab||[]});fs[_0xd25a('0x59')]('/etc/asterisk/turn_xcally.conf',_0x57d6ac);return respondWithRpcPromise(_0xd25a('0x63'),_0xd25a('0x2f'),{'module':'res_stun_monitor.so'});}else{var _0x5d0bc8=fs['readFileSync'](path[_0xd25a('0x55')](config['root'],_0xd25a('0x69')),_0xd25a('0x57'));var _0x4e7d17=ejs[_0xd25a('0x58')](_0x5d0bc8,{'networks':_0x2577ab||[]});fs[_0xd25a('0x59')](util[_0xd25a('0x60')](_0xd25a('0x61'),_0x37df7e[_0xd25a('0x52')][_0xd25a('0x47')][_0xd25a('0x62')]()),_0x4e7d17);return respondWithRpcPromise(_0xd25a('0x63'),_0xd25a('0x2f'),{'module':'chan_sip.so'});}return null;})[_0xd25a('0x19')](function(_0x49b6e7){if(_0x49b6e7){return _0x54530a;}return null;});})[_0xd25a('0x19')](respondWithResult(_0x1ae57a,null))['catch'](handleError(_0x1ae57a,null));};exports[_0xd25a('0x30')]=function(_0x3f6135,_0xc16d9a,_0x422289){var _0x4e5bdd;return db[_0xd25a('0x37')]['find']({'where':{'id':_0x3f6135[_0xd25a('0x67')]['id']}})['then'](function(_0xe44392){_0x4e5bdd=_0xe44392;return _0xe44392;})[_0xd25a('0x19')](handleEntityNotFound(_0xc16d9a,null))[_0xd25a('0x19')](removeEntity(_0xc16d9a,null))['then'](function(){if(_0x4e5bdd){return db[_0xd25a('0x37')][_0xd25a('0x4c')]({'where':{'type':_0x4e5bdd[_0xd25a('0x47')]},'raw':!![]});}})['then'](function(_0x497409){if(_0x4e5bdd['type']['toUpperCase']()==_0xd25a('0x54')){var _0x25334b=fs[_0xd25a('0x5d')](path['join'](config[_0xd25a('0x56')],_0xd25a('0x68')),_0xd25a('0x57'));var _0x5f0af8=ejs[_0xd25a('0x58')](_0x25334b,{'networks':_0x497409||[]});fs['writeFileSync'](_0xd25a('0x5a'),_0x5f0af8);return respondWithRpcPromise('Reload',_0xd25a('0x30'),{'module':_0xd25a('0x5b')});}else if(_0x4e5bdd[_0xd25a('0x47')][_0xd25a('0x53')]()=='TURN'){var _0x4606ed=fs[_0xd25a('0x5d')](path[_0xd25a('0x55')](config[_0xd25a('0x56')],_0xd25a('0x5e')),_0xd25a('0x57'));var _0x50710b=ejs[_0xd25a('0x58')](_0x4606ed,{'networks':_0x497409||[]});fs['writeFileSync'](_0xd25a('0x5f'),_0x50710b);return respondWithRpcPromise(_0xd25a('0x63'),_0xd25a('0x30'),{'module':_0xd25a('0x5b')});}else{var _0x52b06e=fs[_0xd25a('0x5d')](path[_0xd25a('0x55')](config[_0xd25a('0x56')],_0xd25a('0x69')),'utf8');var _0x5eaf9f=ejs[_0xd25a('0x58')](_0x52b06e,{'networks':_0x497409||[]});fs[_0xd25a('0x59')](util[_0xd25a('0x60')](_0xd25a('0x61'),_0x3f6135[_0xd25a('0x52')][_0xd25a('0x47')][_0xd25a('0x62')]()),_0x5eaf9f);return respondWithRpcPromise('Reload','destroy',{'module':_0xd25a('0x65')});}return null;})[_0xd25a('0x4d')](handleError(_0xc16d9a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 47f17fa..6932338 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 _0xd757=['./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd757,0x1e5));var _0x7d75=function(_0x3455cf,_0x79c370){_0x3455cf=_0x3455cf-0x0;var _0x365d64=_0xd757[_0x3455cf];return _0x365d64;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3d4=['api','bluebird','request-promise','rimraf','./network.attributes','exports','define','network','util','../../config/logger'];(function(_0x523f95,_0x514116){var _0x391dbf=function(_0x6b0d73){while(--_0x6b0d73){_0x523f95['push'](_0x523f95['shift']());}};_0x391dbf(++_0x514116);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x560d2a,_0x4a9f54){_0x560d2a=_0x560d2a-0x0;var _0x3df62d=_0xe3d4[_0x560d2a];return _0x3df62d;};'use strict';var _=require('lodash');var util=require(_0x4e3d('0x0'));var logger=require(_0x4e3d('0x1'))(_0x4e3d('0x2'));var moment=require('moment');var BPromise=require(_0x4e3d('0x3'));var rp=require(_0x4e3d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e3d('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e3d('0x6'));module[_0x4e3d('0x7')]=function(_0x4fd5ff,_0x3eaf60){return _0x4fd5ff[_0x4e3d('0x8')]('Network',attributes,{'tableName':_0x4e3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index d0168aa..deee3d2 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x37312f,_0x1be31e){var _0x45c1e5=function(_0x2fc8bb){while(--_0x2fc8bb){_0x37312f['push'](_0x37312f['shift']());}};_0x45c1e5(++_0x1be31e);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c9656,_0x2188b4){var _0x11dc71=function(_0x554901){while(--_0x554901){_0x4c9656['push'](_0x4c9656['shift']());}};_0x11dc71(++_0x2188b4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 5634d40..e8ceca9 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 _0x9a19=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','/describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports'];(function(_0x234682,_0x29165a){var _0x3efb45=function(_0x2bf7f5){while(--_0x2bf7f5){_0x234682['push'](_0x234682['shift']());}};_0x3efb45(++_0x29165a);}(_0x9a19,0x186));var _0x99a1=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x9a19[_0x152fe3];return _0xc5bb39;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require(_0x99a1('0x3'));var express=require(_0x99a1('0x4'));var router=express[_0x99a1('0x5')]();var fs_extra=require(_0x99a1('0x6'));var auth=require(_0x99a1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router['get']('/',auth[_0x99a1('0xa')](),controller['index']);router['get'](_0x99a1('0xb'),auth[_0x99a1('0xa')](),controller['describe']);router[_0x99a1('0xc')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0xe')]);router[_0x99a1('0xc')](_0x99a1('0xf'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x10')]);router['get'](_0x99a1('0x11'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x12')]);router[_0x99a1('0xc')](_0x99a1('0x13'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x14')]);router[_0x99a1('0xc')]('/:id/interactions',auth[_0x99a1('0xa')](),controller['getInteractions']);router[_0x99a1('0xc')](_0x99a1('0x15'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x16')]);router['post']('/',auth[_0x99a1('0xa')](),controller[_0x99a1('0x17')]);router[_0x99a1('0x18')](_0x99a1('0xf'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x19')]);router[_0x99a1('0x18')](_0x99a1('0x11'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x1a')]);router[_0x99a1('0x18')]('/:id/notify',controller[_0x99a1('0x1b')]);router['post'](_0x99a1('0x13'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x1c')]);router[_0x99a1('0x18')](_0x99a1('0x15'),auth[_0x99a1('0xa')](),controller['addAgents']);router[_0x99a1('0x18')](_0x99a1('0x1d'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x1e')]);router[_0x99a1('0x1f')](_0x99a1('0xd'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x20')]);router[_0x99a1('0x21')]('/:id',auth[_0x99a1('0xa')](),controller[_0x99a1('0x22')]);router[_0x99a1('0x21')]('/:id/dispositions',auth[_0x99a1('0xa')](),controller[_0x99a1('0x23')]);router['delete'](_0x99a1('0x11'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x24')]);router[_0x99a1('0x21')](_0x99a1('0x15'),auth[_0x99a1('0xa')](),controller[_0x99a1('0x25')]);module[_0x99a1('0x26')]=router; \ No newline at end of file +var _0x24a4=['removeAnswers','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','get','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x24a4,0xe6));var _0x424a=function(_0x147900,_0x6c6754){_0x147900=_0x147900-0x0;var _0x49148b=_0x24a4[_0x147900];return _0x49148b;};'use strict';var multer=require(_0x424a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x424a('0x1'));var express=require(_0x424a('0x2'));var router=express[_0x424a('0x3')]();var fs_extra=require(_0x424a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x424a('0x5'));var config=require('../../config/environment');var controller=require(_0x424a('0x6'));router['get']('/',auth[_0x424a('0x7')](),controller[_0x424a('0x8')]);router['get'](_0x424a('0x9'),auth[_0x424a('0x7')](),controller[_0x424a('0xa')]);router['get'](_0x424a('0xb'),auth[_0x424a('0x7')](),controller['show']);router['get'](_0x424a('0xc'),auth[_0x424a('0x7')](),controller[_0x424a('0xd')]);router[_0x424a('0xe')](_0x424a('0xf'),auth[_0x424a('0x7')](),controller[_0x424a('0x10')]);router[_0x424a('0xe')](_0x424a('0x11'),auth[_0x424a('0x7')](),controller[_0x424a('0x12')]);router[_0x424a('0xe')](_0x424a('0x13'),auth[_0x424a('0x7')](),controller[_0x424a('0x14')]);router[_0x424a('0xe')](_0x424a('0x15'),auth[_0x424a('0x7')](),controller[_0x424a('0x16')]);router['post']('/',auth[_0x424a('0x7')](),controller[_0x424a('0x17')]);router['post'](_0x424a('0xc'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x424a('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x424a('0x19')]);router[_0x424a('0x18')](_0x424a('0x1a'),controller[_0x424a('0x1b')]);router['post'](_0x424a('0x11'),auth[_0x424a('0x7')](),controller[_0x424a('0x1c')]);router[_0x424a('0x18')](_0x424a('0x15'),auth[_0x424a('0x7')](),controller['addAgents']);router[_0x424a('0x18')](_0x424a('0x1d'),auth[_0x424a('0x7')](),controller[_0x424a('0x1e')]);router[_0x424a('0x1f')](_0x424a('0xb'),auth['isAuthenticated'](),controller[_0x424a('0x20')]);router[_0x424a('0x21')](_0x424a('0xb'),auth[_0x424a('0x7')](),controller[_0x424a('0x22')]);router[_0x424a('0x21')](_0x424a('0xc'),auth[_0x424a('0x7')](),controller[_0x424a('0x23')]);router[_0x424a('0x21')]('/:id/canned_answers',auth[_0x424a('0x7')](),controller[_0x424a('0x24')]);router[_0x424a('0x21')]('/:id/users',auth[_0x424a('0x7')](),controller[_0x424a('0x25')]);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 3541dc2..3ebcbf0 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 _0xa067=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x346df0,_0x475c3e){var _0x2b0187=function(_0x210c5c){while(--_0x210c5c){_0x346df0['push'](_0x346df0['shift']());}};_0x2b0187(++_0x475c3e);}(_0xa067,0x1a5));var _0x7a06=function(_0x16bb54,_0x37e270){_0x16bb54=_0x16bb54-0x0;var _0x4b943a=_0xa067[_0x16bb54];return _0x4b943a;};'use strict';var Sequelize=require(_0x7a06('0x0'));var rs=require(_0x7a06('0x1'));module[_0x7a06('0x2')]={'name':{'type':Sequelize[_0x7a06('0x3')],'unique':_0x7a06('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7a06('0x3')]},'token':{'type':Sequelize[_0x7a06('0x3')],'defaultValue':function(){return rs[_0x7a06('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7a06('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7a06('0x6');}},'notificationSound':{'type':Sequelize[_0x7a06('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7a06('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7a06('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x7a06('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7a06('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a06('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x7a06('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x7a06('0x7')],'defaultValue':![],'comment':_0x7a06('0xa'),'set':function(_0x50926b){if(!_0x50926b)this[_0x7a06('0xb')](_0x7a06('0xc'),null);this[_0x7a06('0xb')](_0x7a06('0xd'),_0x50926b);}}}; \ No newline at end of file +var _0xe9d7=['STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x55320c,_0x130a6f){var _0x3e2c1c=function(_0x1db21b){while(--_0x1db21b){_0x55320c['push'](_0x55320c['shift']());}};_0x3e2c1c(++_0x130a6f);}(_0xe9d7,0x1ed));var _0x7e9d=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0xe9d7[_0x383158];return _0x507985;};'use strict';var Sequelize=require(_0x7e9d('0x0'));var rs=require('randomstring');module[_0x7e9d('0x1')]={'name':{'type':Sequelize[_0x7e9d('0x2')],'unique':_0x7e9d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7e9d('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7e9d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7e9d('0x4')],'defaultValue':function(){return _0x7e9d('0x5');}},'notificationSound':{'type':Sequelize[_0x7e9d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7e9d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7e9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7e9d('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7e9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7e9d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7e9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7e9d('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x7e9d('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a0d5e){if(!_0x2a0d5e)this[_0x7e9d('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x7e9d('0xa'),_0x2a0d5e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8a5d67c..d398714 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 _0xf227=['threadId','OpenchannelInteraction','externalUrl','spread','firstName','messageId','created','interaction','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','sequelize','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','Messages','dataValues','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','options','OpenchannelAccount','includeAll','findAll','rows','show','params','include','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filter','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','Applications','List','account','applications','list','priority','asc','contact','lastName'];(function(_0x5b25dd,_0x1b73c9){var _0x287097=function(_0x1f14df){while(--_0x1f14df){_0x5b25dd['push'](_0x5b25dd['shift']());}};_0x287097(++_0x1b73c9);}(_0xf227,0x198));var _0x7f22=function(_0x4da482,_0xc6ac23){_0x4da482=_0x4da482-0x0;var _0x267b34=_0xf227[_0x4da482];return _0x267b34;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7f22('0x0'));var rp=require('request-promise');var moment=require(_0x7f22('0x1'));var BPromise=require(_0x7f22('0x2'));var Mustache=require(_0x7f22('0x3'));var util=require(_0x7f22('0x4'));var path=require(_0x7f22('0x5'));var sox=require(_0x7f22('0x6'));var csv=require(_0x7f22('0x7'));var ejs=require(_0x7f22('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f22('0x9'));var squel=require(_0x7f22('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7f22('0xb'));var toCsv=require(_0x7f22('0x7'));var querystring=require('querystring');var Papa=require(_0x7f22('0xc'));var Redis=require(_0x7f22('0xd'));var authService=require(_0x7f22('0xe'));var qs=require(_0x7f22('0xf'));var as=require(_0x7f22('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f22('0x11'))(_0x7f22('0x12'));var utils=require(_0x7f22('0x13'));var config=require(_0x7f22('0x14'));var licenseUtil=require(_0x7f22('0x15'));var db=require(_0x7f22('0x16'))['db'];config[_0x7f22('0x17')]=_[_0x7f22('0x18')](config[_0x7f22('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f22('0x19'))(new Redis(config[_0x7f22('0x17')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x7f22('0x1a'));var client=jayson[_0x7f22('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x7f22('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468697,_0x4f7c58,_0x243bef,_0x89fcc7){return new BPromise(function(_0x529bc5,_0x17efc5){var _0x127660=_0x89fcc7||client;return _0x127660[_0x7f22('0x1c')](_0x468697,_0x243bef)[_0x7f22('0x1d')](function(_0x3724a5){logger[_0x7f22('0x1e')](_0x7f22('0x1f'),_0x4f7c58,_0x7f22('0x20'));logger['debug'](_0x7f22('0x21'),_0x4f7c58,'request\x20sent',JSON[_0x7f22('0x22')](_0x3724a5));if(_0x3724a5[_0x7f22('0x23')]){if(_0x3724a5['error']['code']===0x1f4){logger['error'](_0x7f22('0x1f'),_0x4f7c58,_0x3724a5[_0x7f22('0x23')]['message']);return _0x17efc5(_0x3724a5['error'][_0x7f22('0x24')]);}logger[_0x7f22('0x23')](_0x7f22('0x1f'),_0x4f7c58,_0x3724a5[_0x7f22('0x23')][_0x7f22('0x24')]);return _0x529bc5(_0x3724a5['error'][_0x7f22('0x24')]);}else{logger[_0x7f22('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f7c58,_0x7f22('0x20'));_0x529bc5(_0x3724a5[_0x7f22('0x25')][_0x7f22('0x24')]);}})[_0x7f22('0x26')](function(_0x9631ba){logger[_0x7f22('0x23')](_0x7f22('0x1f'),_0x4f7c58,_0x9631ba);_0x17efc5(_0x9631ba);});});}function respondWithStatusCode(_0x498c3f,_0x41a409){_0x41a409=_0x41a409||0xcc;return function(_0x1753bc){if(_0x1753bc){return _0x498c3f['sendStatus'](_0x41a409);}return _0x498c3f['status'](_0x41a409)[_0x7f22('0x27')]();};}function respondWithResult(_0x4fb6b0,_0x38cb20){_0x38cb20=_0x38cb20||0xc8;return function(_0x10ee19){if(_0x10ee19){return _0x4fb6b0['status'](_0x38cb20)[_0x7f22('0x28')](_0x10ee19);}};}function respondWithFilteredResult(_0x3a753f,_0x41b403){return function(_0x31c49e){if(_0x31c49e){var _0x29612c=typeof _0x41b403[_0x7f22('0x29')]===_0x7f22('0x2a')&&typeof _0x41b403['limit']===_0x7f22('0x2a');var _0x4a5322=_0x31c49e[_0x7f22('0x2b')];var _0x57d867=_0x29612c?0x0:_0x41b403[_0x7f22('0x29')];var _0x38bae8=_0x29612c?_0x31c49e[_0x7f22('0x2b')]:_0x41b403['offset']+_0x41b403[_0x7f22('0x2c')];var _0x14c39a;if(_0x38bae8>=_0x4a5322){_0x38bae8=_0x4a5322;_0x14c39a=0xc8;}else{_0x14c39a=0xce;}_0x3a753f[_0x7f22('0x2d')](_0x14c39a);return _0x3a753f[_0x7f22('0x2e')](_0x7f22('0x2f'),_0x57d867+'-'+_0x38bae8+'/'+_0x4a5322)[_0x7f22('0x28')](_0x31c49e);}return null;};}function patchUpdates(_0x5906b5){return function(_0x41999b){try{jsonpatch[_0x7f22('0x30')](_0x41999b,_0x5906b5,!![]);}catch(_0x35191d){return BPromise[_0x7f22('0x31')](_0x35191d);}return _0x41999b[_0x7f22('0x32')]();};}function saveUpdates(_0x345300,_0x10a068){return function(_0xf23735){if(_0xf23735){return _0xf23735[_0x7f22('0x33')](_0x345300)[_0x7f22('0x1d')](function(_0x208bfc){return _0x208bfc;});}return null;};}function removeEntity(_0x3224e5,_0x13c68d){return function(_0x466bf5){if(_0x466bf5){return _0x466bf5[_0x7f22('0x34')]()[_0x7f22('0x1d')](function(){var _0x4e3872=_0x466bf5[_0x7f22('0x35')]({'plain':!![]});var _0x418f1b=_0x7f22('0x36');return db[_0x7f22('0x37')]['destroy']({'where':{'type':_0x418f1b,'resourceId':_0x4e3872['id']}})[_0x7f22('0x1d')](function(){return _0x466bf5;});})[_0x7f22('0x1d')](function(){_0x3224e5[_0x7f22('0x2d')](0xcc)[_0x7f22('0x27')]();});}};}function handleEntityNotFound(_0x29aa09,_0x31c906){return function(_0x4097a5){if(!_0x4097a5){_0x29aa09[_0x7f22('0x38')](0x194);}return _0x4097a5;};}function handleError(_0x586fef,_0x227f76){_0x227f76=_0x227f76||0x1f4;return function(_0x228e4b){logger[_0x7f22('0x23')](_0x228e4b[_0x7f22('0x39')]);if(_0x228e4b[_0x7f22('0x3a')]){delete _0x228e4b[_0x7f22('0x3a')];}_0x586fef[_0x7f22('0x2d')](_0x227f76)[_0x7f22('0x3b')](_0x228e4b);};}exports[_0x7f22('0x3c')]=function(_0x427c3c,_0x33b13c){var _0x4a3fb6={'include':[{'model':db[_0x7f22('0x3d')],'as':_0x7f22('0x3e')}]},_0x48756c={},_0x306bfc={'count':0x0,'rows':[]};var _0x36d60a=_[_0x7f22('0x3f')](db['OpenchannelAccount'][_0x7f22('0x40')],function(_0x4ac8c9){return{'name':_0x4ac8c9['fieldName'],'type':_0x4ac8c9['type'][_0x7f22('0x41')]};});_0x48756c[_0x7f22('0x42')]=_[_0x7f22('0x3f')](_0x36d60a,'name');_0x48756c[_0x7f22('0x43')]=_[_0x7f22('0x44')](_0x427c3c[_0x7f22('0x43')]);_0x48756c['filters']=_[_0x7f22('0x45')](_0x48756c['model'],_0x48756c['query']);_0x4a3fb6[_0x7f22('0x46')]=_[_0x7f22('0x45')](_0x48756c[_0x7f22('0x42')],qs['fields'](_0x427c3c[_0x7f22('0x43')][_0x7f22('0x47')]));_0x4a3fb6['attributes']=_0x4a3fb6['attributes'][_0x7f22('0x48')]?_0x4a3fb6[_0x7f22('0x46')]:_0x48756c[_0x7f22('0x42')];if(!_0x427c3c[_0x7f22('0x43')][_0x7f22('0x49')](_0x7f22('0x4a'))){_0x4a3fb6['limit']=qs['limit'](_0x427c3c[_0x7f22('0x43')][_0x7f22('0x2c')]);_0x4a3fb6[_0x7f22('0x29')]=qs['offset'](_0x427c3c[_0x7f22('0x43')]['offset']);}_0x4a3fb6[_0x7f22('0x4b')]=qs[_0x7f22('0x4c')](_0x427c3c['query'][_0x7f22('0x4c')]);_0x4a3fb6['where']=qs[_0x7f22('0x4d')](_[_0x7f22('0x4e')](_0x427c3c[_0x7f22('0x43')],_0x48756c['filters']),_0x36d60a);if(_0x427c3c[_0x7f22('0x43')]['filter']){_0x4a3fb6['where']=_['merge'](_0x4a3fb6[_0x7f22('0x4f')],{'$or':_[_0x7f22('0x3f')](_0x36d60a,function(_0x332c07){if(_0x332c07[_0x7f22('0x50')]!=='VIRTUAL'){var _0xe43bb2={};_0xe43bb2[_0x332c07['name']]={'$like':'%'+_0x427c3c['query']['filter']+'%'};return _0xe43bb2;}})});}_0x4a3fb6=_['merge']({},_0x4a3fb6,_0x427c3c[_0x7f22('0x51')]);var _0x112760={'where':_0x4a3fb6['where']};return db[_0x7f22('0x52')][_0x7f22('0x2b')](_0x112760)[_0x7f22('0x1d')](function(_0x345804){_0x306bfc[_0x7f22('0x2b')]=_0x345804;if(_0x427c3c['query'][_0x7f22('0x53')]){_0x4a3fb6['include']=[{'all':!![]}];}return db[_0x7f22('0x52')][_0x7f22('0x54')](_0x4a3fb6);})['then'](function(_0x16769c){_0x306bfc[_0x7f22('0x55')]=_0x16769c;return _0x306bfc;})[_0x7f22('0x1d')](respondWithFilteredResult(_0x33b13c,_0x4a3fb6))['catch'](handleError(_0x33b13c,null));};exports[_0x7f22('0x56')]=function(_0x49bae2,_0x565885){var _0x12f664={'raw':![],'where':{'id':_0x49bae2[_0x7f22('0x57')]['id']},'include':[{'model':db[_0x7f22('0x3d')],'as':'mandatoryDispositionPause'}]},_0x4f9ce8={};_0x4f9ce8[_0x7f22('0x42')]=_[_0x7f22('0x44')](db[_0x7f22('0x52')][_0x7f22('0x40')]);_0x4f9ce8['query']=_['keys'](_0x49bae2[_0x7f22('0x43')]);_0x4f9ce8[_0x7f22('0x4d')]=_['intersection'](_0x4f9ce8[_0x7f22('0x42')],_0x4f9ce8['query']);_0x12f664['attributes']=_['intersection'](_0x4f9ce8[_0x7f22('0x42')],qs[_0x7f22('0x47')](_0x49bae2['query'][_0x7f22('0x47')]));_0x12f664['attributes']=_0x12f664[_0x7f22('0x46')][_0x7f22('0x48')]?_0x12f664[_0x7f22('0x46')]:_0x4f9ce8[_0x7f22('0x42')];if(_0x49bae2[_0x7f22('0x43')][_0x7f22('0x53')]){_0x12f664[_0x7f22('0x58')]=[{'all':!![]}];}_0x12f664=_[_0x7f22('0x59')]({},_0x12f664,_0x49bae2[_0x7f22('0x51')]);return db['OpenchannelAccount'][_0x7f22('0x5a')](_0x12f664)[_0x7f22('0x1d')](handleEntityNotFound(_0x565885,null))[_0x7f22('0x1d')](respondWithResult(_0x565885,null))[_0x7f22('0x26')](handleError(_0x565885,null));};exports[_0x7f22('0x5b')]=function(_0xa039c9,_0x16b1d8){return db['OpenchannelAccount']['create'](_0xa039c9['body'],{})[_0x7f22('0x1d')](function(_0x24f73b){var _0x102151=_0xa039c9[_0x7f22('0x5c')][_0x7f22('0x35')]({'plain':!![]});if(!_0x102151)throw new Error(_0x7f22('0x5d'));if(_0x102151[_0x7f22('0x5e')]===_0x7f22('0x5c')){var _0x34deb9=_0x24f73b['get']({'plain':!![]});var _0x27c6f0=_0x7f22('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x27c6f0,'userProfileId':_0x102151[_0x7f22('0x5f')]},'raw':!![]})[_0x7f22('0x1d')](function(_0x5ab8e0){if(_0x5ab8e0&&_0x5ab8e0['autoAssociation']===0x0){return db['UserProfileResource'][_0x7f22('0x5b')]({'name':_0x34deb9[_0x7f22('0x3a')],'resourceId':_0x34deb9['id'],'type':_0x5ab8e0[_0x7f22('0x3a')],'sectionId':_0x5ab8e0['id']},{})[_0x7f22('0x1d')](function(){return _0x24f73b;});}else{return _0x24f73b;}})[_0x7f22('0x26')](function(_0x4c668f){logger['error'](_0x7f22('0x60'),_0x4c668f);throw _0x4c668f;});}return _0x24f73b;})[_0x7f22('0x1d')](respondWithResult(_0x16b1d8,0xc9))[_0x7f22('0x26')](handleError(_0x16b1d8,null));};exports['update']=function(_0x402d63,_0x344d97){if(_0x402d63[_0x7f22('0x61')]['id']){delete _0x402d63[_0x7f22('0x61')]['id'];}return db[_0x7f22('0x52')][_0x7f22('0x5a')]({'where':{'id':_0x402d63['params']['id']},'include':[{'model':db['Pause'],'as':_0x7f22('0x3e')}]})[_0x7f22('0x1d')](handleEntityNotFound(_0x344d97,null))[_0x7f22('0x1d')](saveUpdates(_0x402d63[_0x7f22('0x61')],null))[_0x7f22('0x1d')](respondWithResult(_0x344d97,null))[_0x7f22('0x26')](handleError(_0x344d97,null));};exports[_0x7f22('0x34')]=function(_0x4b2d66,_0x3ff6c3){return db[_0x7f22('0x52')][_0x7f22('0x5a')]({'where':{'id':_0x4b2d66[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x3ff6c3,null))[_0x7f22('0x1d')](removeEntity(_0x3ff6c3,null))[_0x7f22('0x26')](handleError(_0x3ff6c3,null));};exports['describe']=function(_0x34cf10,_0x457582){return db[_0x7f22('0x52')][_0x7f22('0x62')]()['then'](respondWithResult(_0x457582,null))[_0x7f22('0x26')](handleError(_0x457582,null));};exports[_0x7f22('0x63')]=function(_0x455404,_0x25dcb3,_0x2e3702){if(_0x455404[_0x7f22('0x61')]['id']){delete _0x455404[_0x7f22('0x61')]['id'];}return db[_0x7f22('0x52')][_0x7f22('0x5a')]({'where':{'id':_0x455404[_0x7f22('0x57')]['id']}})['then'](handleEntityNotFound(_0x25dcb3,null))['then'](function(_0x362fe6){if(_0x362fe6){_0x455404[_0x7f22('0x61')][_0x7f22('0x64')]=_0x362fe6['id'];return db[_0x7f22('0x65')][_0x7f22('0x5b')](_0x455404[_0x7f22('0x61')]);}})[_0x7f22('0x1d')](respondWithResult(_0x25dcb3,null))[_0x7f22('0x26')](handleError(_0x25dcb3,null));};exports[_0x7f22('0x66')]=function(_0x22855,_0x2e7170,_0x5e1086){var _0x184d83={'raw':![],'where':{}};var _0x646dd={};var _0x49da50={'count':0x0,'rows':[]};return db[_0x7f22('0x52')][_0x7f22('0x67')]({'where':{'id':_0x22855[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x2e7170,null))[_0x7f22('0x1d')](function(_0x5dd118){if(_0x5dd118){_0x646dd[_0x7f22('0x42')]=_[_0x7f22('0x44')](db[_0x7f22('0x65')]['rawAttributes']);_0x646dd[_0x7f22('0x43')]=_[_0x7f22('0x44')](_0x22855[_0x7f22('0x43')]);_0x646dd['filters']=_[_0x7f22('0x45')](_0x646dd['model'],_0x646dd[_0x7f22('0x43')]);_0x184d83[_0x7f22('0x46')]=_[_0x7f22('0x45')](_0x646dd['model'],qs['fields'](_0x22855[_0x7f22('0x43')][_0x7f22('0x47')]));_0x184d83['attributes']=_0x184d83[_0x7f22('0x46')][_0x7f22('0x48')]?_0x184d83['attributes']:_0x646dd[_0x7f22('0x42')];if(!_0x22855[_0x7f22('0x43')][_0x7f22('0x49')](_0x7f22('0x4a'))){_0x184d83[_0x7f22('0x2c')]=qs[_0x7f22('0x2c')](_0x22855[_0x7f22('0x43')]['limit']);_0x184d83['offset']=qs[_0x7f22('0x29')](_0x22855[_0x7f22('0x43')][_0x7f22('0x29')]);}_0x184d83[_0x7f22('0x4b')]=qs[_0x7f22('0x4c')](_0x22855[_0x7f22('0x43')][_0x7f22('0x4c')]);_0x184d83[_0x7f22('0x4f')]=qs[_0x7f22('0x4d')](_[_0x7f22('0x4e')](_0x22855['query'],_0x646dd[_0x7f22('0x4d')]));_0x184d83['where'][_0x7f22('0x64')]=_0x5dd118['id'];if(_0x22855[_0x7f22('0x43')]['filter']){_0x184d83[_0x7f22('0x4f')]=_[_0x7f22('0x59')](_0x184d83['where'],{'$or':_[_0x7f22('0x3f')](_0x184d83[_0x7f22('0x46')],function(_0x1719df){var _0x2e18c1={};_0x2e18c1[_0x1719df]={'$like':'%'+_0x22855[_0x7f22('0x43')][_0x7f22('0x68')]+'%'};return _0x2e18c1;})});}_0x184d83=_[_0x7f22('0x59')]({},_0x184d83,_0x22855[_0x7f22('0x51')]);return db[_0x7f22('0x65')][_0x7f22('0x2b')]({'where':_0x184d83[_0x7f22('0x4f')]})['then'](function(_0x852382){_0x49da50[_0x7f22('0x2b')]=_0x852382;if(_0x22855[_0x7f22('0x43')][_0x7f22('0x53')]){_0x184d83[_0x7f22('0x58')]=[{'all':!![]}];}return db[_0x7f22('0x65')][_0x7f22('0x54')](_0x184d83);})[_0x7f22('0x1d')](function(_0x46efc3){_0x49da50[_0x7f22('0x55')]=_0x46efc3;return _0x49da50;});}})[_0x7f22('0x1d')](respondWithFilteredResult(_0x2e7170,_0x184d83))[_0x7f22('0x26')](handleError(_0x2e7170,null));};exports['removeDispositions']=function(_0x55952c,_0x2216db,_0x27c8ae){return db[_0x7f22('0x52')]['find']({'where':{'id':_0x55952c[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x2216db,null))['then'](function(_0x425fff){if(_0x425fff){return _0x425fff['removeDispositions'](_0x55952c[_0x7f22('0x43')][_0x7f22('0x69')]);}})['then'](respondWithStatusCode(_0x2216db,null))[_0x7f22('0x26')](handleError(_0x2216db,null));};exports['addAnswer']=function(_0x4c920d,_0x4a71d7,_0x412b4f){if(_0x4c920d[_0x7f22('0x61')]['id']){delete _0x4c920d[_0x7f22('0x61')]['id'];}return db[_0x7f22('0x52')][_0x7f22('0x5a')]({'where':{'id':_0x4c920d[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x4a71d7,null))[_0x7f22('0x1d')](function(_0x5b088a){if(_0x5b088a){_0x4c920d[_0x7f22('0x61')][_0x7f22('0x64')]=_0x5b088a['id'];return db[_0x7f22('0x6a')]['create'](_0x4c920d[_0x7f22('0x61')]);}})['then'](respondWithResult(_0x4a71d7,null))['catch'](handleError(_0x4a71d7,null));};exports[_0x7f22('0x6b')]=function(_0x5ce6a4,_0x37b552,_0x204105){var _0x129573={'raw':![],'where':{}};var _0x224126={};var _0x4ef63c={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x5ce6a4[_0x7f22('0x57')]['id']}})['then'](handleEntityNotFound(_0x37b552,null))[_0x7f22('0x1d')](function(_0x12d677){if(_0x12d677){_0x224126['model']=_['keys'](db[_0x7f22('0x6a')][_0x7f22('0x40')]);_0x224126[_0x7f22('0x43')]=_[_0x7f22('0x44')](_0x5ce6a4['query']);_0x224126[_0x7f22('0x4d')]=_[_0x7f22('0x45')](_0x224126[_0x7f22('0x42')],_0x224126[_0x7f22('0x43')]);_0x129573[_0x7f22('0x46')]=_[_0x7f22('0x45')](_0x224126[_0x7f22('0x42')],qs[_0x7f22('0x47')](_0x5ce6a4[_0x7f22('0x43')][_0x7f22('0x47')]));_0x129573['attributes']=_0x129573[_0x7f22('0x46')][_0x7f22('0x48')]?_0x129573[_0x7f22('0x46')]:_0x224126['model'];if(!_0x5ce6a4[_0x7f22('0x43')][_0x7f22('0x49')]('nolimit')){_0x129573['limit']=qs[_0x7f22('0x2c')](_0x5ce6a4[_0x7f22('0x43')]['limit']);_0x129573[_0x7f22('0x29')]=qs[_0x7f22('0x29')](_0x5ce6a4['query'][_0x7f22('0x29')]);}_0x129573[_0x7f22('0x4b')]=qs[_0x7f22('0x4c')](_0x5ce6a4[_0x7f22('0x43')][_0x7f22('0x4c')]);_0x129573[_0x7f22('0x4f')]=qs['filters'](_[_0x7f22('0x4e')](_0x5ce6a4[_0x7f22('0x43')],_0x224126[_0x7f22('0x4d')]));_0x129573['where'][_0x7f22('0x64')]=_0x12d677['id'];if(_0x5ce6a4[_0x7f22('0x43')]['filter']){_0x129573['where']=_[_0x7f22('0x59')](_0x129573[_0x7f22('0x4f')],{'$or':_[_0x7f22('0x3f')](_0x129573[_0x7f22('0x46')],function(_0x31a82f){var _0x2375da={};_0x2375da[_0x31a82f]={'$like':'%'+_0x5ce6a4[_0x7f22('0x43')]['filter']+'%'};return _0x2375da;})});}_0x129573=_[_0x7f22('0x59')]({},_0x129573,_0x5ce6a4[_0x7f22('0x51')]);return db[_0x7f22('0x6a')][_0x7f22('0x2b')]({'where':_0x129573[_0x7f22('0x4f')]})[_0x7f22('0x1d')](function(_0x5776f8){_0x4ef63c[_0x7f22('0x2b')]=_0x5776f8;if(_0x5ce6a4[_0x7f22('0x43')]['includeAll']){_0x129573[_0x7f22('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x7f22('0x54')](_0x129573);})[_0x7f22('0x1d')](function(_0x2edd11){_0x4ef63c[_0x7f22('0x55')]=_0x2edd11;return _0x4ef63c;});}})['then'](respondWithFilteredResult(_0x37b552,_0x129573))['catch'](handleError(_0x37b552,null));};exports[_0x7f22('0x6c')]=function(_0x5aad80,_0x168537,_0x5e9014){return db[_0x7f22('0x52')][_0x7f22('0x5a')]({'where':{'id':_0x5aad80[_0x7f22('0x57')]['id']}})['then'](handleEntityNotFound(_0x168537,null))[_0x7f22('0x1d')](function(_0x36937b){if(_0x36937b){return _0x36937b[_0x7f22('0x6c')](_0x5aad80[_0x7f22('0x43')]['ids']);}})[_0x7f22('0x1d')](respondWithStatusCode(_0x168537,null))[_0x7f22('0x26')](handleError(_0x168537,null));};exports[_0x7f22('0x6d')]=function(_0x4f3138,_0x85ee74,_0x45352f){var _0x5952e9={'body':_0x4f3138[_0x7f22('0x61')],'channel':_0x7f22('0x6e')};var _0x567a74=[];var _0x5d4b04=[];var _0x47533c={};var _0x3f6d1d=![];return db[_0x7f22('0x6f')][_0x7f22('0x62')]()[_0x7f22('0x1d')](function(_0x66d429){if(!_0x66d429){throw new db[(_0x7f22('0x70'))][(_0x7f22('0x71'))]('no\x20available\x20attributes');}_0x567a74=_['difference'](_[_0x7f22('0x44')](_0x66d429),[_0x7f22('0x72'),_0x7f22('0x73')]);_0x5d4b04=_['difference'](_[_0x7f22('0x44')](_0x66d429),['createdAt','updatedAt',_0x7f22('0x74'),_0x7f22('0x75')]);if(_0x4f3138[_0x7f22('0x61')]['id']){delete _0x4f3138[_0x7f22('0x61')]['id'];}if(_[_0x7f22('0x76')](_0x4f3138[_0x7f22('0x61')][_0x7f22('0x77')])){throw new db[(_0x7f22('0x70'))][(_0x7f22('0x71'))](_0x7f22('0x78'));}if(_[_0x7f22('0x76')](_0x4f3138[_0x7f22('0x61')][_0x7f22('0x61')])||_0x4f3138[_0x7f22('0x61')][_0x7f22('0x61')]===''){throw new db[(_0x7f22('0x70'))]['ValidationError'](_0x7f22('0x79'));}if(_[_0x7f22('0x76')](_0x4f3138[_0x7f22('0x61')]['mapKey'])){throw new db[(_0x7f22('0x70'))][(_0x7f22('0x71'))](_0x7f22('0x7a')+_0x5d4b04);}if(!_[_0x7f22('0x7b')](_0x5d4b04,_0x4f3138[_0x7f22('0x61')]['mapKey'])){throw new db[(_0x7f22('0x70'))][(_0x7f22('0x71'))](_0x7f22('0x7c')+_0x5d4b04);}_0x47533c[_0x4f3138[_0x7f22('0x61')][_0x7f22('0x7d')]]=_0x4f3138[_0x7f22('0x61')][_0x7f22('0x77')];})[_0x7f22('0x1d')](function(){return db[_0x7f22('0x52')]['find']({'where':{'id':_0x4f3138[_0x7f22('0x57')]['id']},'include':[{'model':db[_0x7f22('0x7e')],'as':'List','include':[{'model':db[_0x7f22('0x6f')],'as':_0x7f22('0x7f'),'where':_0x47533c,'limit':0x1,'order':[['updatedAt',_0x7f22('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x7f22('0x81')}]});})[_0x7f22('0x1d')](handleEntityNotFound(_0x85ee74,null))['then'](function(_0x32544d){if(_0x32544d&&_0x32544d[_0x7f22('0x82')]){_0x5952e9[_0x7f22('0x83')]=_0x32544d;_0x5952e9[_0x7f22('0x84')]=_0x32544d[_0x7f22('0x81')];_0x5952e9[_0x7f22('0x85')]=_0x32544d[_0x7f22('0x82')];_0x5952e9[_0x7f22('0x84')]=_['orderBy'](_0x5952e9['applications'],[_0x7f22('0x86')],[_0x7f22('0x87')]);if(_0x5952e9[_0x7f22('0x83')]['Applications']){delete _0x5952e9['account']['Applications'];}if(_0x5952e9[_0x7f22('0x83')][_0x7f22('0x82')]&&_0x5952e9[_0x7f22('0x83')][_0x7f22('0x82')]['Contacts']['length']){return _0x5952e9[_0x7f22('0x83')]['List'][_0x7f22('0x7f')][0x0];}var _0x5dbb3d=_['defaults'](_0x4f3138[_0x7f22('0x61')],{'firstName':_0x4f3138[_0x7f22('0x61')][_0x7f22('0x77')],'ListId':_0x32544d['ListId']});_0x5dbb3d[_0x4f3138[_0x7f22('0x61')][_0x7f22('0x7d')]]=_0x4f3138[_0x7f22('0x61')][_0x7f22('0x77')];return db[_0x7f22('0x6f')][_0x7f22('0x5b')](_0x5dbb3d,{'fields':_0x567a74,'raw':!![]});}})[_0x7f22('0x1d')](handleEntityNotFound(_0x85ee74,null))[_0x7f22('0x1d')](function(_0x395df2){_0x5952e9[_0x7f22('0x88')]=_0x395df2;if(_0x395df2){var _0x4c2585={'ContactId':_0x395df2['id'],'OpenchannelAccountId':_0x4f3138[_0x7f22('0x57')]['id'],'from':(_0x395df2['firstName']||'')+'\x20'+(_0x395df2[_0x7f22('0x89')]||'')};var _0x1c887c={'OpenchannelAccountId':_0x4f3138[_0x7f22('0x57')]['id'],'closed':![]};if(_0x4f3138['body'][_0x7f22('0x8a')]){_0x1c887c['threadId']=_0x4f3138[_0x7f22('0x61')][_0x7f22('0x8a')];return db[_0x7f22('0x8b')][_0x7f22('0x5a')]({'where':_0x1c887c})[_0x7f22('0x1d')](function(_0x21e40b){if(_0x21e40b){return[_0x21e40b,![]];}_0x4c2585[_0x7f22('0x8a')]=_0x4f3138[_0x7f22('0x61')]['threadId'];_0x4c2585[_0x7f22('0x8c')]=_0x4f3138[_0x7f22('0x61')][_0x7f22('0x8c')];return db['OpenchannelInteraction'][_0x7f22('0x5b')](_0x4c2585)['then'](function(_0x2a5299){return[_0x2a5299,!![]];});});}else{_0x1c887c['threadId']=null;}_0x1c887c['ContactId']=_0x395df2['id'];return db[_0x7f22('0x8b')]['find']({'where':_0x1c887c})[_0x7f22('0x1d')](function(_0x298379){if(_0x298379){return[_0x298379,![]];}return db['OpenchannelInteraction'][_0x7f22('0x5b')](_0x4c2585)[_0x7f22('0x1d')](function(_0x39767d){return[_0x39767d,!![]];});});}})[_0x7f22('0x8d')](function(_0x276963,_0x5b98d9){if(_0x276963){_0x3f6d1d=_0x5b98d9;if(!_0x5b98d9){var _0x5b076c={'from':(_0x5952e9[_0x7f22('0x88')][_0x7f22('0x8e')]||'')+'\x20'+(_0x5952e9[_0x7f22('0x88')][_0x7f22('0x89')]||'')};if(_0x4f3138[_0x7f22('0x61')]['threadId']&&_0x4f3138[_0x7f22('0x61')][_0x7f22('0x8f')]&&_0x4f3138['body'][_0x7f22('0x8a')]!=_0x4f3138[_0x7f22('0x61')][_0x7f22('0x8f')]){_0x5b076c[_0x7f22('0x8a')]=_0x4f3138[_0x7f22('0x61')]['messageId'];}return _0x276963['update'](_0x5b076c);}else{return _0x276963;}}})['then'](function(_0x2a6a42){_0x5952e9['interaction']=_0x2a6a42[_0x7f22('0x35')]({'plain':!![]});_0x5952e9['interaction'][_0x7f22('0x90')]=_0x3f6d1d;if(_0x5952e9[_0x7f22('0x91')][_0x7f22('0x90')]){if(_0x5952e9[_0x7f22('0x83')][_0x7f22('0x92')]){_0x5952e9[_0x7f22('0x84')][_0x7f22('0x93')]({'id':0x0,'priority':_0x5952e9[_0x7f22('0x84')][_0x7f22('0x48')]+0x1,'app':_0x7f22('0x94'),'appdata':_0x7f22('0x95'),'interval':_0x7f22('0x96')});}}return db['OpenchannelMessage'][_0x7f22('0x5b')]({'body':_0x4f3138[_0x7f22('0x61')][_0x7f22('0x61')],'OpenchannelAccountId':_0x4f3138[_0x7f22('0x57')]['id'],'OpenchannelInteractionId':_0x2a6a42['id'],'direction':'in','ContactId':_0x5952e9[_0x7f22('0x88')]['id'],'AttachmentId':_0x4f3138[_0x7f22('0x61')][_0x7f22('0x97')]});})[_0x7f22('0x1d')](function(_0x1a79c6){_0x5952e9[_0x7f22('0x24')]=_0x1a79c6;if(_0x5952e9['interaction'][_0x7f22('0x98')]){return db[_0x7f22('0x99')][_0x7f22('0x5a')]({'attributes':['id',_0x7f22('0x3a')],'where':{'id':_0x5952e9[_0x7f22('0x91')]['UserId']}})[_0x7f22('0x1d')](function(_0xe918b9){if(_0xe918b9){_0x5952e9[_0x7f22('0x84')][_0x7f22('0x9a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xe918b9[_0x7f22('0x3a')]+','+(_0x5952e9[_0x7f22('0x83')]['waitForTheAssignedAgent']||0xa),'interval':_0x7f22('0x96')});_0x5952e9[_0x7f22('0x9b')]=![];}return respondWithRpcPromise(_0x7f22('0x9c'),_0x7f22('0x9d'),_0x5952e9);});}return respondWithRpcPromise(_0x7f22('0x9c'),_0x7f22('0x9d'),_0x5952e9);})[_0x7f22('0x1d')](function(_0xbf4da9){respondWithRpcPromise(_0x7f22('0x9e'),'EventManager',{'event':_0x7f22('0x6d'),'message':_0xbf4da9},client9002);return _0xbf4da9;})[_0x7f22('0x1d')](respondWithResult(_0x85ee74,null))[_0x7f22('0x26')](handleError(_0x85ee74,null));};exports['addApplications']=function(_0x245c0c,_0xd826ee,_0x29ec32){return db['OpenchannelAccount'][_0x7f22('0x67')]({'where':{'id':_0x245c0c[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0xd826ee,null))[_0x7f22('0x1d')](function(_0x5055af){if(_0x5055af){return db[_0x7f22('0x9f')]['transaction'](function(_0x42838f){return db[_0x7f22('0xa0')]['destroy']({'where':{'OpenchannelAccountId':_0x245c0c['params']['id']},'transaction':_0x42838f})[_0x7f22('0x1d')](function(_0x50a06e){var _0x8c0eca=_[_0x7f22('0x3f')](_0x245c0c['body'],function(_0x52f2ef){_0x52f2ef[_0x7f22('0x64')]=_0x245c0c[_0x7f22('0x57')]['id'];return _0x52f2ef;});return db['OpenchannelApplication'][_0x7f22('0xa1')](_0x8c0eca,{'transaction':_0x42838f});});})['then'](function(){return db[_0x7f22('0xa0')][_0x7f22('0xa2')]({'where':{'OpenchannelAccountId':_0x245c0c[_0x7f22('0x57')]['id']},'order':_0x7f22('0x86')});});}})['then'](respondWithResult(_0xd826ee,null))['catch'](handleError(_0xd826ee,null));};exports['getApplications']=function(_0x587daa,_0x19d38f,_0x4a7581){var _0x1dc3bd={};var _0x119c6e={};var _0x2a833d;var _0x58ccc4;return db[_0x7f22('0x52')][_0x7f22('0x67')]({'where':{'id':_0x587daa['params']['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x19d38f,null))[_0x7f22('0x1d')](function(_0x5c8ad7){if(_0x5c8ad7){_0x2a833d=_0x5c8ad7;_0x119c6e[_0x7f22('0x42')]=_['keys'](db[_0x7f22('0xa0')][_0x7f22('0x40')]);_0x119c6e[_0x7f22('0x43')]=_[_0x7f22('0x44')](_0x587daa['query']);_0x119c6e[_0x7f22('0x4d')]=_['intersection'](_0x119c6e[_0x7f22('0x42')],_0x119c6e[_0x7f22('0x43')]);_0x1dc3bd[_0x7f22('0x46')]=_[_0x7f22('0x45')](_0x119c6e[_0x7f22('0x42')],qs['fields'](_0x587daa[_0x7f22('0x43')][_0x7f22('0x47')]));_0x1dc3bd[_0x7f22('0x46')]=_0x1dc3bd[_0x7f22('0x46')][_0x7f22('0x48')]?_0x1dc3bd[_0x7f22('0x46')]:_0x119c6e[_0x7f22('0x42')];_0x1dc3bd[_0x7f22('0x4b')]=qs[_0x7f22('0x4c')](_0x587daa[_0x7f22('0x43')][_0x7f22('0x4c')]);_0x1dc3bd['where']=qs['filters'](_[_0x7f22('0x4e')](_0x587daa[_0x7f22('0x43')],_0x119c6e['filters']));if(_0x587daa['query'][_0x7f22('0x68')]){_0x1dc3bd[_0x7f22('0x4f')]=_[_0x7f22('0x59')](_0x1dc3bd[_0x7f22('0x4f')],{'$or':_[_0x7f22('0x3f')](_0x1dc3bd[_0x7f22('0x46')],function(_0x3700cc){var _0x292f6d={};_0x292f6d[_0x3700cc]={'$like':'%'+_0x587daa['query'][_0x7f22('0x68')]+'%'};return _0x292f6d;})});}_0x1dc3bd=_['merge']({},_0x1dc3bd,_0x587daa[_0x7f22('0x51')]);return _0x2a833d[_0x7f22('0xa3')](_0x1dc3bd);}})[_0x7f22('0x1d')](function(_0x100b8f){if(_0x100b8f){_0x58ccc4=_0x100b8f['length'];if(!_0x587daa[_0x7f22('0x43')]['hasOwnProperty']('nolimit')){_0x1dc3bd['limit']=qs['limit'](_0x587daa[_0x7f22('0x43')][_0x7f22('0x2c')]);_0x1dc3bd[_0x7f22('0x29')]=qs['offset'](_0x587daa[_0x7f22('0x43')]['offset']);}return _0x2a833d[_0x7f22('0xa3')](_0x1dc3bd);}})['then'](function(_0x32951b){if(_0x32951b){return _0x32951b?{'count':_0x58ccc4,'rows':_0x32951b}:null;}})[_0x7f22('0x1d')](respondWithResult(_0x19d38f,null))[_0x7f22('0x26')](handleError(_0x19d38f,null));};exports['getInteractions']=function(_0x1a29fa,_0x419b8f,_0x4dfc8a){var _0x5c6a16={'raw':![],'where':{}};var _0xc1e7d8={};var _0x29fc55={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x7f22('0x67')]({'where':{'id':_0x1a29fa[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x419b8f,null))['then'](function(_0x2949b9){if(_0x2949b9){_0xc1e7d8[_0x7f22('0x42')]=_[_0x7f22('0x44')](db[_0x7f22('0x8b')][_0x7f22('0x40')]);_0xc1e7d8[_0x7f22('0x43')]=_[_0x7f22('0x44')](_0x1a29fa[_0x7f22('0x43')]);_0xc1e7d8[_0x7f22('0x4d')]=_['intersection'](_0xc1e7d8[_0x7f22('0x42')],_0xc1e7d8[_0x7f22('0x43')]);_0x5c6a16['attributes']=_['intersection'](_0xc1e7d8[_0x7f22('0x42')],qs['fields'](_0x1a29fa[_0x7f22('0x43')][_0x7f22('0x47')]));_0x5c6a16[_0x7f22('0x46')]=_0x5c6a16[_0x7f22('0x46')]['length']?_0x5c6a16['attributes']:_0xc1e7d8[_0x7f22('0x42')];if(!_0x1a29fa[_0x7f22('0x43')]['hasOwnProperty'](_0x7f22('0x4a'))){_0x5c6a16[_0x7f22('0x2c')]=qs[_0x7f22('0x2c')](_0x1a29fa['query'][_0x7f22('0x2c')]);_0x5c6a16[_0x7f22('0x29')]=qs[_0x7f22('0x29')](_0x1a29fa[_0x7f22('0x43')][_0x7f22('0x29')]);}_0x5c6a16[_0x7f22('0x4b')]=qs[_0x7f22('0x4c')](_0x1a29fa[_0x7f22('0x43')]['sort']);_0x5c6a16[_0x7f22('0x4f')]=qs[_0x7f22('0x4d')](_[_0x7f22('0x4e')](_0x1a29fa['query'],_0xc1e7d8[_0x7f22('0x4d')]));_0x5c6a16[_0x7f22('0x4f')][_0x7f22('0x64')]=_0x2949b9['id'];if(_0x1a29fa['query'][_0x7f22('0x68')]){_0x5c6a16[_0x7f22('0x4f')]=_['merge'](_0x5c6a16[_0x7f22('0x4f')],{'$or':_['map'](_0x5c6a16[_0x7f22('0x46')],function(_0x508f5b){var _0x11e01c={};_0x11e01c[_0x508f5b]={'$like':'%'+_0x1a29fa[_0x7f22('0x43')][_0x7f22('0x68')]+'%'};return _0x11e01c;})});}_0x5c6a16=_[_0x7f22('0x59')]({},_0x5c6a16,_0x1a29fa['options']);return db[_0x7f22('0x8b')][_0x7f22('0x2b')]({'where':_0x5c6a16[_0x7f22('0x4f')]})[_0x7f22('0x1d')](function(_0x18761e){_0x29fc55[_0x7f22('0x2b')]=_0x18761e;if(_0x1a29fa[_0x7f22('0x43')][_0x7f22('0x53')]){_0x5c6a16[_0x7f22('0x58')]=[{'model':db[_0x7f22('0x6f')],'as':_0x7f22('0xa4'),'required':![]},{'model':db[_0x7f22('0x99')],'as':_0x7f22('0xa5'),'attributes':[_0x7f22('0x3a'),_0x7f22('0xa6'),'internal'],'required':![]},{'model':db[_0x7f22('0xa7')],'as':_0x7f22('0xa8'),'attributes':['id',_0x7f22('0x3a'),_0x7f22('0xa9')],'where':_0x1a29fa[_0x7f22('0x43')][_0x7f22('0xaa')]?{'id':_0x1a29fa['query'][_0x7f22('0xaa')]}:undefined,'required':_0x1a29fa['query']['tag']?!![]:![]}];}return db[_0x7f22('0x8b')][_0x7f22('0x54')](_0x5c6a16);})[_0x7f22('0x1d')](function(_0x385975){_0x29fc55[_0x7f22('0x55')]=_0x385975;return _0x29fc55;});}})[_0x7f22('0x1d')](respondWithFilteredResult(_0x419b8f,_0x5c6a16))[_0x7f22('0x26')](handleError(_0x419b8f,null));};exports['addAgents']=function(_0x28fd03,_0x3e71b7,_0x5899b7){return db['OpenchannelAccount'][_0x7f22('0x5a')]({'where':{'id':_0x28fd03[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x3e71b7,null))['then'](function(_0x32ce65){if(_0x32ce65){return _0x32ce65[_0x7f22('0xab')](_0x28fd03[_0x7f22('0x61')][_0x7f22('0x69')],_[_0x7f22('0xac')](_0x28fd03[_0x7f22('0x61')],[_0x7f22('0x69'),'id'])||{})[_0x7f22('0x8d')](function(_0x788eb0){for(var _0x430bed=0x0;_0x430bed<_0x28fd03[_0x7f22('0x61')][_0x7f22('0x69')][_0x7f22('0x48')];_0x430bed+=0x1){socket['emit'](_0x7f22('0xad'),{'UserId':Number(_0x28fd03['body']['ids'][_0x430bed]),'OpenchannelAccountId':Number(_0x28fd03['params']['id'])});}return _0x788eb0;});}})[_0x7f22('0x1d')](respondWithResult(_0x3e71b7,null))[_0x7f22('0x26')](handleError(_0x3e71b7,null));};exports[_0x7f22('0xae')]=function(_0x5d262e,_0x510d54,_0x57ef38){return db['OpenchannelAccount'][_0x7f22('0x5a')]({'where':{'id':_0x5d262e[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x510d54,null))[_0x7f22('0x1d')](function(_0x448677){if(_0x448677){return _0x448677['removeAgents'](_0x5d262e[_0x7f22('0x43')][_0x7f22('0x69')])[_0x7f22('0x1d')](function(){if(_[_0x7f22('0xaf')](_0x5d262e[_0x7f22('0x43')][_0x7f22('0x69')])){for(var _0x2c8e9d=0x0;_0x2c8e9d<_0x5d262e[_0x7f22('0x43')][_0x7f22('0x69')]['length'];_0x2c8e9d+=0x1){socket[_0x7f22('0xb0')](_0x7f22('0xb1'),{'UserId':Number(_0x5d262e['query'][_0x7f22('0x69')][_0x2c8e9d]),'OpenchannelAccountId':Number(_0x5d262e[_0x7f22('0x57')]['id'])});}}else{socket[_0x7f22('0xb0')](_0x7f22('0xb1'),{'UserId':Number(_0x5d262e[_0x7f22('0x43')][_0x7f22('0x69')]),'OpenchannelAccountId':Number(_0x5d262e['params']['id'])});}});}})[_0x7f22('0x1d')](respondWithStatusCode(_0x510d54,null))[_0x7f22('0x26')](handleError(_0x510d54,null));};exports[_0x7f22('0xb2')]=function(_0x538f0a,_0x3cdd25,_0x18ea4a){var _0x12b4f1={};var _0x7e3b30={};var _0x4e5fe0;var _0x43f70a;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x538f0a[_0x7f22('0x57')]['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0x3cdd25,null))[_0x7f22('0x1d')](function(_0x2c1cba){if(_0x2c1cba){_0x4e5fe0=_0x2c1cba;_0x7e3b30['model']=_[_0x7f22('0x44')](db['User'][_0x7f22('0x40')]);_0x7e3b30['query']=_[_0x7f22('0x44')](_0x538f0a[_0x7f22('0x43')]);_0x7e3b30[_0x7f22('0x4d')]=_['intersection'](_0x7e3b30[_0x7f22('0x42')],_0x7e3b30[_0x7f22('0x43')]);_0x12b4f1[_0x7f22('0x46')]=_[_0x7f22('0x45')](_0x7e3b30[_0x7f22('0x42')],qs[_0x7f22('0x47')](_0x538f0a[_0x7f22('0x43')][_0x7f22('0x47')]));_0x12b4f1[_0x7f22('0x46')]=_0x12b4f1['attributes'][_0x7f22('0x48')]?_0x12b4f1[_0x7f22('0x46')]:_0x7e3b30[_0x7f22('0x42')];_0x12b4f1[_0x7f22('0x4b')]=qs['sort'](_0x538f0a[_0x7f22('0x43')][_0x7f22('0x4c')]);_0x12b4f1[_0x7f22('0x4f')]=qs['filters'](_[_0x7f22('0x4e')](_0x538f0a['query'],_0x7e3b30['filters']));if(_0x538f0a['query'][_0x7f22('0x68')]){_0x12b4f1['where']=_[_0x7f22('0x59')](_0x12b4f1['where'],{'$or':_[_0x7f22('0x3f')](_0x12b4f1[_0x7f22('0x46')],function(_0x59f181){var _0x376dd3={};_0x376dd3[_0x59f181]={'$like':'%'+_0x538f0a[_0x7f22('0x43')][_0x7f22('0x68')]+'%'};return _0x376dd3;})});}_0x12b4f1=_['merge']({},_0x12b4f1,_0x538f0a[_0x7f22('0x51')]);return _0x4e5fe0[_0x7f22('0xb2')](_0x12b4f1);}})[_0x7f22('0x1d')](function(_0x4c9f16){if(_0x4c9f16){_0x43f70a=_0x4c9f16['length'];if(!_0x538f0a[_0x7f22('0x43')]['hasOwnProperty'](_0x7f22('0x4a'))){_0x12b4f1['limit']=qs[_0x7f22('0x2c')](_0x538f0a[_0x7f22('0x43')][_0x7f22('0x2c')]);_0x12b4f1[_0x7f22('0x29')]=qs['offset'](_0x538f0a[_0x7f22('0x43')]['offset']);}return _0x4e5fe0[_0x7f22('0xb2')](_0x12b4f1);}})[_0x7f22('0x1d')](function(_0x45550f){if(_0x45550f){return _0x45550f?{'count':_0x43f70a,'rows':_0x45550f}:null;}})[_0x7f22('0x1d')](respondWithResult(_0x3cdd25,null))['catch'](handleError(_0x3cdd25,null));};exports[_0x7f22('0x3b')]=function(_0x4609e9,_0xc5bd75,_0xcc9086){var _0x269359,_0x5f2903,_0x376e1a;if(_['isNil'](_0x4609e9['body'][_0x7f22('0x61')])||_0x4609e9[_0x7f22('0x61')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x7f22('0x79'));}if(_['isNil'](_0x4609e9[_0x7f22('0x61')]['to'])){}_0x269359=_0x4609e9['body']['to'];return db[_0x7f22('0x52')][_0x7f22('0x67')]({'where':{'id':_0x4609e9['params']['id']}})[_0x7f22('0x1d')](handleEntityNotFound(_0xc5bd75,null))[_0x7f22('0x1d')](function(_0x18f46d){if(_0x18f46d){return db[_0x7f22('0x52')]['find']({'where':{'id':_0x18f46d['id']},'include':[{'model':db[_0x7f22('0x7e')],'as':_0x7f22('0x82'),'include':[{'model':db[_0x7f22('0x6f')],'as':_0x7f22('0x7f'),'where':{[_0x18f46d[_0x7f22('0x7d')]]:_0x269359},'limit':0x1,'order':[['updatedAt',_0x7f22('0x80')]]}]}]})[_0x7f22('0x1d')](handleEntityNotFound(_0xc5bd75,null))['then'](function(_0x2c6f30){if(_0x2c6f30&&_0x2c6f30[_0x7f22('0x82')]){_0x5f2903=_0x2c6f30['get']({'plain':!![]});if(_0x5f2903[_0x7f22('0x82')]&&_0x5f2903['List'][_0x7f22('0x7f')][_0x7f22('0x48')]){return _0x5f2903[_0x7f22('0x82')][_0x7f22('0x7f')][0x0];}return db[_0x7f22('0x6f')][_0x7f22('0x5b')](_[_0x7f22('0x18')](_0x4609e9[_0x7f22('0x61')],{'firstName':_0x269359,[_0x2c6f30[_0x7f22('0x7d')]]:_0x269359,'phone':_0x269359,'ListId':_0x5f2903[_0x7f22('0x75')]}));}})[_0x7f22('0x1d')](handleEntityNotFound(_0xc5bd75,null))[_0x7f22('0x1d')](function(_0x5acc60){if(_0x5acc60){_0x376e1a=_0x5acc60;return db[_0x7f22('0x8b')][_0x7f22('0x5a')]({'where':{'ContactId':_0x376e1a['id'],'closed':![],'OpenchannelAccountId':_0x5f2903['id']}})[_0x7f22('0x1d')](function(_0x5e834a){if(_0x5e834a){return[_0x5e834a,![]];}return db[_0x7f22('0x8b')]['create']({'UserId':_0x4609e9[_0x7f22('0x5c')]['id'],'ContactId':_0x376e1a['id'],'OpenchannelAccountId':_0x5f2903['id'],'lastMsgDirection':'out','Messages':[_[_0x7f22('0x59')](_0x4609e9[_0x7f22('0x61')],{'read':![],'body':_0x4609e9[_0x7f22('0x61')][_0x7f22('0x61')],'OpenchannelAccountId':_0x5f2903['id'],'UserId':_0x4609e9['user']['id'],'ContactId':_0x376e1a['id']})]},{'include':[{'model':db[_0x7f22('0xb3')],'as':_0x7f22('0xb4')}]})[_0x7f22('0x1d')](function(_0x1244f5){return[_0x1244f5,!![]];});});}})[_0x7f22('0x8d')](function(_0x5d03a3,_0x46838a){if(_0x46838a){return _0x5d03a3;}return db[_0x7f22('0xb3')][_0x7f22('0x5b')](_[_0x7f22('0x59')](_0x4609e9[_0x7f22('0x61')],{'read':![],'body':_0x4609e9[_0x7f22('0x61')][_0x7f22('0x61')],'OpenchannelAccountId':_0x5f2903['id'],'OpenchannelInteractionId':_0x5d03a3['id'],'UserId':_0x4609e9[_0x7f22('0x5c')]['id'],'ContactId':_0x376e1a['id']}))[_0x7f22('0x1d')](function(_0x5ca621){_0x5d03a3[_0x7f22('0xb5')][_0x7f22('0xb4')]=[];_0x5d03a3['dataValues']['Messages'][_0x7f22('0x93')](_0x5ca621[_0x7f22('0xb5')]);return _0x5d03a3;});});}})[_0x7f22('0x1d')](respondWithResult(_0xc5bd75,null))[_0x7f22('0x26')](handleError(_0xc5bd75,null));}; \ No newline at end of file +var _0x5f51=['orderBy','priority','asc','defaults','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','getApplications','getInteractions','Contact','Owner','fullname','internal','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','from','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x5f51,0xf0));var _0x15f5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f51[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x15f5('0x0'));var rimraf=require(_0x15f5('0x1'));var zipdir=require(_0x15f5('0x2'));var jsonpatch=require(_0x15f5('0x3'));var rp=require(_0x15f5('0x4'));var moment=require(_0x15f5('0x5'));var BPromise=require(_0x15f5('0x6'));var Mustache=require(_0x15f5('0x7'));var util=require(_0x15f5('0x8'));var path=require('path');var sox=require(_0x15f5('0x9'));var csv=require(_0x15f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15f5('0xb'));var _=require(_0x15f5('0xc'));var squel=require(_0x15f5('0xd'));var crypto=require(_0x15f5('0xe'));var jsforce=require(_0x15f5('0xf'));var deskjs=require(_0x15f5('0x10'));var toCsv=require(_0x15f5('0xa'));var querystring=require(_0x15f5('0x11'));var Papa=require(_0x15f5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15f5('0x13'));var as=require(_0x15f5('0x14'));var hardwareService=require(_0x15f5('0x15'));var logger=require('../../config/logger')(_0x15f5('0x16'));var utils=require(_0x15f5('0x17'));var config=require(_0x15f5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x15f5('0x19'))['db'];config['redis']=_['defaults'](config[_0x15f5('0x1a')],{'host':_0x15f5('0x1b'),'port':0x18eb});var socket=require(_0x15f5('0x1c'))(new Redis(config[_0x15f5('0x1a')]));require(_0x15f5('0x1d'))[_0x15f5('0x1e')](socket);var jayson=require(_0x15f5('0x1f'));var client=jayson[_0x15f5('0x20')][_0x15f5('0x21')]({'port':0x232c});var client9002=jayson[_0x15f5('0x20')][_0x15f5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x552699,_0x397391,_0x40e1e8,_0x35f41b){return new BPromise(function(_0x5c52af,_0x57acb7){var _0x39bea7=_0x35f41b||client;return _0x39bea7[_0x15f5('0x22')](_0x552699,_0x40e1e8)['then'](function(_0x61b81c){logger[_0x15f5('0x23')](_0x15f5('0x24'),_0x397391,_0x15f5('0x25'));logger['debug'](_0x15f5('0x26'),_0x397391,_0x15f5('0x25'),JSON[_0x15f5('0x27')](_0x61b81c));if(_0x61b81c[_0x15f5('0x28')]){if(_0x61b81c[_0x15f5('0x28')]['code']===0x1f4){logger[_0x15f5('0x28')](_0x15f5('0x24'),_0x397391,_0x61b81c[_0x15f5('0x28')][_0x15f5('0x29')]);return _0x57acb7(_0x61b81c[_0x15f5('0x28')][_0x15f5('0x29')]);}logger[_0x15f5('0x28')](_0x15f5('0x24'),_0x397391,_0x61b81c[_0x15f5('0x28')][_0x15f5('0x29')]);return _0x5c52af(_0x61b81c['error']['message']);}else{logger[_0x15f5('0x23')](_0x15f5('0x24'),_0x397391,_0x15f5('0x25'));_0x5c52af(_0x61b81c[_0x15f5('0x2a')][_0x15f5('0x29')]);}})['catch'](function(_0x5af3de){logger[_0x15f5('0x28')](_0x15f5('0x24'),_0x397391,_0x5af3de);_0x57acb7(_0x5af3de);});});}function respondWithStatusCode(_0x29906b,_0x3ef00f){_0x3ef00f=_0x3ef00f||0xcc;return function(_0x3fee3d){if(_0x3fee3d){return _0x29906b['sendStatus'](_0x3ef00f);}return _0x29906b[_0x15f5('0x2b')](_0x3ef00f)['end']();};}function respondWithResult(_0x2b369f,_0x3fd7a6){_0x3fd7a6=_0x3fd7a6||0xc8;return function(_0x36e826){if(_0x36e826){return _0x2b369f[_0x15f5('0x2b')](_0x3fd7a6)['json'](_0x36e826);}};}function respondWithFilteredResult(_0x3905b1,_0x1175ca){return function(_0x2fdeb6){if(_0x2fdeb6){var _0x59d854=typeof _0x1175ca[_0x15f5('0x2c')]===_0x15f5('0x2d')&&typeof _0x1175ca[_0x15f5('0x2e')]===_0x15f5('0x2d');var _0x184850=_0x2fdeb6[_0x15f5('0x2f')];var _0x38888c=_0x59d854?0x0:_0x1175ca[_0x15f5('0x2c')];var _0x44cfb6=_0x59d854?_0x2fdeb6[_0x15f5('0x2f')]:_0x1175ca[_0x15f5('0x2c')]+_0x1175ca[_0x15f5('0x2e')];var _0x3ed9bd;if(_0x44cfb6>=_0x184850){_0x44cfb6=_0x184850;_0x3ed9bd=0xc8;}else{_0x3ed9bd=0xce;}_0x3905b1[_0x15f5('0x2b')](_0x3ed9bd);return _0x3905b1['set'](_0x15f5('0x30'),_0x38888c+'-'+_0x44cfb6+'/'+_0x184850)[_0x15f5('0x31')](_0x2fdeb6);}return null;};}function patchUpdates(_0x4fe2ae){return function(_0x47c1bb){try{jsonpatch[_0x15f5('0x32')](_0x47c1bb,_0x4fe2ae,!![]);}catch(_0x2b01fb){return BPromise[_0x15f5('0x33')](_0x2b01fb);}return _0x47c1bb[_0x15f5('0x34')]();};}function saveUpdates(_0x592660,_0x38c704){return function(_0x5d5cb6){if(_0x5d5cb6){return _0x5d5cb6[_0x15f5('0x35')](_0x592660)[_0x15f5('0x36')](function(_0x359863){return _0x359863;});}return null;};}function removeEntity(_0x39fc92,_0x4984f0){return function(_0x34e8eb){if(_0x34e8eb){return _0x34e8eb['destroy']()['then'](function(){var _0x59fc43=_0x34e8eb[_0x15f5('0x37')]({'plain':!![]});var _0x110ad2=_0x15f5('0x38');return db[_0x15f5('0x39')][_0x15f5('0x3a')]({'where':{'type':_0x110ad2,'resourceId':_0x59fc43['id']}})[_0x15f5('0x36')](function(){return _0x34e8eb;});})[_0x15f5('0x36')](function(){_0x39fc92[_0x15f5('0x2b')](0xcc)[_0x15f5('0x3b')]();});}};}function handleEntityNotFound(_0x149b4f,_0x51437f){return function(_0x2c8e46){if(!_0x2c8e46){_0x149b4f[_0x15f5('0x3c')](0x194);}return _0x2c8e46;};}function handleError(_0x5a76ee,_0x48d32e){_0x48d32e=_0x48d32e||0x1f4;return function(_0x3e1a7c){logger[_0x15f5('0x28')](_0x3e1a7c[_0x15f5('0x3d')]);if(_0x3e1a7c[_0x15f5('0x3e')]){delete _0x3e1a7c['name'];}_0x5a76ee[_0x15f5('0x2b')](_0x48d32e)[_0x15f5('0x3f')](_0x3e1a7c);};}exports[_0x15f5('0x40')]=function(_0x46f7ea,_0x453606){var _0x4f644f={'include':[{'model':db['Pause'],'as':_0x15f5('0x41')}]},_0x5b809f={},_0x471a8c={'count':0x0,'rows':[]};var _0x1ca59e=_[_0x15f5('0x42')](db[_0x15f5('0x43')][_0x15f5('0x44')],function(_0x356bed){return{'name':_0x356bed[_0x15f5('0x45')],'type':_0x356bed[_0x15f5('0x46')][_0x15f5('0x47')]};});_0x5b809f[_0x15f5('0x48')]=_[_0x15f5('0x42')](_0x1ca59e,_0x15f5('0x3e'));_0x5b809f['query']=_['keys'](_0x46f7ea[_0x15f5('0x49')]);_0x5b809f[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x5b809f[_0x15f5('0x48')],_0x5b809f['query']);_0x4f644f[_0x15f5('0x4c')]=_[_0x15f5('0x4b')](_0x5b809f['model'],qs[_0x15f5('0x4d')](_0x46f7ea['query'][_0x15f5('0x4d')]));_0x4f644f[_0x15f5('0x4c')]=_0x4f644f[_0x15f5('0x4c')][_0x15f5('0x4e')]?_0x4f644f[_0x15f5('0x4c')]:_0x5b809f[_0x15f5('0x48')];if(!_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x4f')](_0x15f5('0x50'))){_0x4f644f['limit']=qs[_0x15f5('0x2e')](_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x2e')]);_0x4f644f[_0x15f5('0x2c')]=qs[_0x15f5('0x2c')](_0x46f7ea['query'][_0x15f5('0x2c')]);}_0x4f644f['order']=qs[_0x15f5('0x51')](_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x51')]);_0x4f644f['where']=qs['filters'](_[_0x15f5('0x52')](_0x46f7ea[_0x15f5('0x49')],_0x5b809f['filters']),_0x1ca59e);if(_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x53')]){_0x4f644f[_0x15f5('0x54')]=_[_0x15f5('0x55')](_0x4f644f[_0x15f5('0x54')],{'$or':_['map'](_0x1ca59e,function(_0x23b1d8){if(_0x23b1d8['type']!==_0x15f5('0x56')){var _0xd594dc={};_0xd594dc[_0x23b1d8[_0x15f5('0x3e')]]={'$like':'%'+_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x53')]+'%'};return _0xd594dc;}})});}_0x4f644f=_[_0x15f5('0x55')]({},_0x4f644f,_0x46f7ea[_0x15f5('0x57')]);var _0x4b68c6={'where':_0x4f644f[_0x15f5('0x54')]};return db[_0x15f5('0x43')][_0x15f5('0x2f')](_0x4b68c6)[_0x15f5('0x36')](function(_0x3c7064){_0x471a8c['count']=_0x3c7064;if(_0x46f7ea[_0x15f5('0x49')][_0x15f5('0x58')]){_0x4f644f[_0x15f5('0x59')]=[{'all':!![]}];}return db[_0x15f5('0x43')][_0x15f5('0x5a')](_0x4f644f);})[_0x15f5('0x36')](function(_0x4d946c){_0x471a8c[_0x15f5('0x5b')]=_0x4d946c;return _0x471a8c;})['then'](respondWithFilteredResult(_0x453606,_0x4f644f))[_0x15f5('0x5c')](handleError(_0x453606,null));};exports[_0x15f5('0x5d')]=function(_0x4580fe,_0xa99d6c){var _0x5a9ce5={'raw':![],'where':{'id':_0x4580fe[_0x15f5('0x5e')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x289161={};_0x289161[_0x15f5('0x48')]=_[_0x15f5('0x5f')](db[_0x15f5('0x43')][_0x15f5('0x44')]);_0x289161[_0x15f5('0x49')]=_[_0x15f5('0x5f')](_0x4580fe[_0x15f5('0x49')]);_0x289161[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x289161['model'],_0x289161[_0x15f5('0x49')]);_0x5a9ce5[_0x15f5('0x4c')]=_[_0x15f5('0x4b')](_0x289161[_0x15f5('0x48')],qs[_0x15f5('0x4d')](_0x4580fe['query']['fields']));_0x5a9ce5[_0x15f5('0x4c')]=_0x5a9ce5[_0x15f5('0x4c')][_0x15f5('0x4e')]?_0x5a9ce5[_0x15f5('0x4c')]:_0x289161[_0x15f5('0x48')];if(_0x4580fe[_0x15f5('0x49')][_0x15f5('0x58')]){_0x5a9ce5[_0x15f5('0x59')]=[{'all':!![]}];}_0x5a9ce5=_[_0x15f5('0x55')]({},_0x5a9ce5,_0x4580fe[_0x15f5('0x57')]);return db[_0x15f5('0x43')][_0x15f5('0x60')](_0x5a9ce5)['then'](handleEntityNotFound(_0xa99d6c,null))[_0x15f5('0x36')](respondWithResult(_0xa99d6c,null))[_0x15f5('0x5c')](handleError(_0xa99d6c,null));};exports[_0x15f5('0x61')]=function(_0x1258cd,_0x596bb6){return db['OpenchannelAccount'][_0x15f5('0x61')](_0x1258cd[_0x15f5('0x62')],{})['then'](function(_0x33130b){var _0x2aa6e7=_0x1258cd['user'][_0x15f5('0x37')]({'plain':!![]});if(!_0x2aa6e7)throw new Error(_0x15f5('0x63'));if(_0x2aa6e7[_0x15f5('0x64')]===_0x15f5('0x65')){var _0x260acd=_0x33130b[_0x15f5('0x37')]({'plain':!![]});var _0x3fed42='OpenchannelAccounts';return db['UserProfileSection'][_0x15f5('0x60')]({'where':{'name':_0x3fed42,'userProfileId':_0x2aa6e7[_0x15f5('0x66')]},'raw':!![]})[_0x15f5('0x36')](function(_0x552a5a){if(_0x552a5a&&_0x552a5a[_0x15f5('0x67')]===0x0){return db[_0x15f5('0x39')][_0x15f5('0x61')]({'name':_0x260acd[_0x15f5('0x3e')],'resourceId':_0x260acd['id'],'type':_0x552a5a[_0x15f5('0x3e')],'sectionId':_0x552a5a['id']},{})['then'](function(){return _0x33130b;});}else{return _0x33130b;}})[_0x15f5('0x5c')](function(_0x1e9b85){logger[_0x15f5('0x28')](_0x15f5('0x68'),_0x1e9b85);throw _0x1e9b85;});}return _0x33130b;})[_0x15f5('0x36')](respondWithResult(_0x596bb6,0xc9))[_0x15f5('0x5c')](handleError(_0x596bb6,null));};exports[_0x15f5('0x35')]=function(_0x30d408,_0x435939){if(_0x30d408[_0x15f5('0x62')]['id']){delete _0x30d408[_0x15f5('0x62')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x30d408[_0x15f5('0x5e')]['id']},'include':[{'model':db[_0x15f5('0x69')],'as':_0x15f5('0x41')}]})[_0x15f5('0x36')](handleEntityNotFound(_0x435939,null))[_0x15f5('0x36')](saveUpdates(_0x30d408[_0x15f5('0x62')],null))[_0x15f5('0x36')](respondWithResult(_0x435939,null))['catch'](handleError(_0x435939,null));};exports['destroy']=function(_0x1d66be,_0x1198d9){return db[_0x15f5('0x43')][_0x15f5('0x60')]({'where':{'id':_0x1d66be[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x1198d9,null))[_0x15f5('0x36')](removeEntity(_0x1198d9,null))['catch'](handleError(_0x1198d9,null));};exports[_0x15f5('0x6a')]=function(_0x9bbf8f,_0x45de5b){return db[_0x15f5('0x43')][_0x15f5('0x6a')]()[_0x15f5('0x36')](respondWithResult(_0x45de5b,null))[_0x15f5('0x5c')](handleError(_0x45de5b,null));};exports[_0x15f5('0x6b')]=function(_0x411aac,_0x2fe2ed,_0x2bb9e5){if(_0x411aac[_0x15f5('0x62')]['id']){delete _0x411aac[_0x15f5('0x62')]['id'];}return db[_0x15f5('0x43')][_0x15f5('0x60')]({'where':{'id':_0x411aac[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x2fe2ed,null))[_0x15f5('0x36')](function(_0x31149e){if(_0x31149e){_0x411aac[_0x15f5('0x62')][_0x15f5('0x6c')]=_0x31149e['id'];return db[_0x15f5('0x6d')][_0x15f5('0x61')](_0x411aac[_0x15f5('0x62')]);}})['then'](respondWithResult(_0x2fe2ed,null))['catch'](handleError(_0x2fe2ed,null));};exports[_0x15f5('0x6e')]=function(_0x5e94dd,_0x37ae54,_0x3fbf00){var _0x1b6f28={'raw':![],'where':{}};var _0x21c36b={};var _0x2990c3={'count':0x0,'rows':[]};return db[_0x15f5('0x43')][_0x15f5('0x6f')]({'where':{'id':_0x5e94dd['params']['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x37ae54,null))[_0x15f5('0x36')](function(_0x321190){if(_0x321190){_0x21c36b[_0x15f5('0x48')]=_[_0x15f5('0x5f')](db[_0x15f5('0x6d')][_0x15f5('0x44')]);_0x21c36b[_0x15f5('0x49')]=_[_0x15f5('0x5f')](_0x5e94dd[_0x15f5('0x49')]);_0x21c36b[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x21c36b['model'],_0x21c36b['query']);_0x1b6f28[_0x15f5('0x4c')]=_['intersection'](_0x21c36b[_0x15f5('0x48')],qs[_0x15f5('0x4d')](_0x5e94dd[_0x15f5('0x49')]['fields']));_0x1b6f28['attributes']=_0x1b6f28[_0x15f5('0x4c')]['length']?_0x1b6f28[_0x15f5('0x4c')]:_0x21c36b[_0x15f5('0x48')];if(!_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x4f')]('nolimit')){_0x1b6f28[_0x15f5('0x2e')]=qs[_0x15f5('0x2e')](_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x2e')]);_0x1b6f28[_0x15f5('0x2c')]=qs[_0x15f5('0x2c')](_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x2c')]);}_0x1b6f28[_0x15f5('0x70')]=qs[_0x15f5('0x51')](_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x51')]);_0x1b6f28[_0x15f5('0x54')]=qs[_0x15f5('0x4a')](_[_0x15f5('0x52')](_0x5e94dd['query'],_0x21c36b[_0x15f5('0x4a')]));_0x1b6f28[_0x15f5('0x54')]['OpenchannelAccountId']=_0x321190['id'];if(_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x53')]){_0x1b6f28[_0x15f5('0x54')]=_[_0x15f5('0x55')](_0x1b6f28[_0x15f5('0x54')],{'$or':_[_0x15f5('0x42')](_0x1b6f28[_0x15f5('0x4c')],function(_0x5dea8d){var _0x2bfbd9={};_0x2bfbd9[_0x5dea8d]={'$like':'%'+_0x5e94dd['query']['filter']+'%'};return _0x2bfbd9;})});}_0x1b6f28=_[_0x15f5('0x55')]({},_0x1b6f28,_0x5e94dd['options']);return db['Disposition'][_0x15f5('0x2f')]({'where':_0x1b6f28[_0x15f5('0x54')]})[_0x15f5('0x36')](function(_0x4eec08){_0x2990c3[_0x15f5('0x2f')]=_0x4eec08;if(_0x5e94dd[_0x15f5('0x49')][_0x15f5('0x58')]){_0x1b6f28[_0x15f5('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x15f5('0x5a')](_0x1b6f28);})[_0x15f5('0x36')](function(_0x580caa){_0x2990c3['rows']=_0x580caa;return _0x2990c3;});}})['then'](respondWithFilteredResult(_0x37ae54,_0x1b6f28))[_0x15f5('0x5c')](handleError(_0x37ae54,null));};exports[_0x15f5('0x71')]=function(_0x5d267c,_0x9afa7a,_0x45cd79){return db[_0x15f5('0x43')]['find']({'where':{'id':_0x5d267c[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x9afa7a,null))[_0x15f5('0x36')](function(_0x418bc2){if(_0x418bc2){return _0x418bc2[_0x15f5('0x71')](_0x5d267c['query']['ids']);}})[_0x15f5('0x36')](respondWithStatusCode(_0x9afa7a,null))[_0x15f5('0x5c')](handleError(_0x9afa7a,null));};exports[_0x15f5('0x72')]=function(_0x33810d,_0x246a70,_0x44bfd0){if(_0x33810d[_0x15f5('0x62')]['id']){delete _0x33810d['body']['id'];}return db[_0x15f5('0x43')][_0x15f5('0x60')]({'where':{'id':_0x33810d['params']['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x246a70,null))['then'](function(_0x3b2991){if(_0x3b2991){_0x33810d[_0x15f5('0x62')]['OpenchannelAccountId']=_0x3b2991['id'];return db[_0x15f5('0x73')][_0x15f5('0x61')](_0x33810d[_0x15f5('0x62')]);}})['then'](respondWithResult(_0x246a70,null))[_0x15f5('0x5c')](handleError(_0x246a70,null));};exports[_0x15f5('0x74')]=function(_0x334af4,_0x417995,_0x4a0990){var _0x1de2f7={'raw':![],'where':{}};var _0x208b54={};var _0x5e0ebe={'count':0x0,'rows':[]};return db[_0x15f5('0x43')][_0x15f5('0x6f')]({'where':{'id':_0x334af4[_0x15f5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x417995,null))['then'](function(_0x31dbad){if(_0x31dbad){_0x208b54[_0x15f5('0x48')]=_[_0x15f5('0x5f')](db[_0x15f5('0x73')][_0x15f5('0x44')]);_0x208b54[_0x15f5('0x49')]=_[_0x15f5('0x5f')](_0x334af4[_0x15f5('0x49')]);_0x208b54[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x208b54['model'],_0x208b54[_0x15f5('0x49')]);_0x1de2f7['attributes']=_['intersection'](_0x208b54['model'],qs['fields'](_0x334af4[_0x15f5('0x49')]['fields']));_0x1de2f7[_0x15f5('0x4c')]=_0x1de2f7[_0x15f5('0x4c')][_0x15f5('0x4e')]?_0x1de2f7[_0x15f5('0x4c')]:_0x208b54[_0x15f5('0x48')];if(!_0x334af4[_0x15f5('0x49')][_0x15f5('0x4f')](_0x15f5('0x50'))){_0x1de2f7[_0x15f5('0x2e')]=qs[_0x15f5('0x2e')](_0x334af4[_0x15f5('0x49')]['limit']);_0x1de2f7[_0x15f5('0x2c')]=qs[_0x15f5('0x2c')](_0x334af4[_0x15f5('0x49')][_0x15f5('0x2c')]);}_0x1de2f7['order']=qs[_0x15f5('0x51')](_0x334af4[_0x15f5('0x49')][_0x15f5('0x51')]);_0x1de2f7[_0x15f5('0x54')]=qs[_0x15f5('0x4a')](_[_0x15f5('0x52')](_0x334af4[_0x15f5('0x49')],_0x208b54[_0x15f5('0x4a')]));_0x1de2f7[_0x15f5('0x54')][_0x15f5('0x6c')]=_0x31dbad['id'];if(_0x334af4['query']['filter']){_0x1de2f7[_0x15f5('0x54')]=_['merge'](_0x1de2f7[_0x15f5('0x54')],{'$or':_[_0x15f5('0x42')](_0x1de2f7[_0x15f5('0x4c')],function(_0x2555cf){var _0x1e8df4={};_0x1e8df4[_0x2555cf]={'$like':'%'+_0x334af4[_0x15f5('0x49')][_0x15f5('0x53')]+'%'};return _0x1e8df4;})});}_0x1de2f7=_['merge']({},_0x1de2f7,_0x334af4[_0x15f5('0x57')]);return db[_0x15f5('0x73')][_0x15f5('0x2f')]({'where':_0x1de2f7[_0x15f5('0x54')]})['then'](function(_0xc47b0){_0x5e0ebe[_0x15f5('0x2f')]=_0xc47b0;if(_0x334af4['query'][_0x15f5('0x58')]){_0x1de2f7['include']=[{'all':!![]}];}return db[_0x15f5('0x73')]['findAll'](_0x1de2f7);})[_0x15f5('0x36')](function(_0x1f5aa6){_0x5e0ebe[_0x15f5('0x5b')]=_0x1f5aa6;return _0x5e0ebe;});}})[_0x15f5('0x36')](respondWithFilteredResult(_0x417995,_0x1de2f7))[_0x15f5('0x5c')](handleError(_0x417995,null));};exports[_0x15f5('0x75')]=function(_0x19e30d,_0x15a15a,_0x36e58d){return db[_0x15f5('0x43')]['find']({'where':{'id':_0x19e30d[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x15a15a,null))[_0x15f5('0x36')](function(_0xf69dcb){if(_0xf69dcb){return _0xf69dcb[_0x15f5('0x75')](_0x19e30d[_0x15f5('0x49')][_0x15f5('0x76')]);}})[_0x15f5('0x36')](respondWithStatusCode(_0x15a15a,null))['catch'](handleError(_0x15a15a,null));};exports[_0x15f5('0x77')]=function(_0xdc5fac,_0x50c6d1,_0x3c69ee){var _0x303dae={'body':_0xdc5fac[_0x15f5('0x62')],'channel':'openchannel'};var _0x13cbce=[];var _0x57fa9d=[];var _0x4f2c6b={};var _0x661cb3=![];return db[_0x15f5('0x78')][_0x15f5('0x6a')]()[_0x15f5('0x36')](function(_0x3148a9){if(!_0x3148a9){throw new db[(_0x15f5('0x79'))]['ValidationError'](_0x15f5('0x7a'));}_0x13cbce=_['difference'](_[_0x15f5('0x5f')](_0x3148a9),[_0x15f5('0x7b'),_0x15f5('0x7c')]);_0x57fa9d=_[_0x15f5('0x7d')](_['keys'](_0x3148a9),[_0x15f5('0x7b'),_0x15f5('0x7c'),_0x15f5('0x7e'),'ListId']);if(_0xdc5fac[_0x15f5('0x62')]['id']){delete _0xdc5fac[_0x15f5('0x62')]['id'];}if(_['isNil'](_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x7f')])){throw new db[(_0x15f5('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x15f5('0x80')](_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x62')])||_0xdc5fac[_0x15f5('0x62')]['body']===''){throw new db[(_0x15f5('0x79'))][(_0x15f5('0x81'))](_0x15f5('0x82'));}if(_[_0x15f5('0x80')](_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x83')])){throw new db['Sequelize'][(_0x15f5('0x81'))](_0x15f5('0x84')+_0x57fa9d);}if(!_[_0x15f5('0x85')](_0x57fa9d,_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x83')])){throw new db[(_0x15f5('0x79'))][(_0x15f5('0x81'))](_0x15f5('0x86')+_0x57fa9d);}_0x4f2c6b[_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x83')]]=_0xdc5fac[_0x15f5('0x62')]['from'];})[_0x15f5('0x36')](function(){return db[_0x15f5('0x43')]['find']({'where':{'id':_0xdc5fac['params']['id']},'include':[{'model':db[_0x15f5('0x87')],'as':_0x15f5('0x88'),'include':[{'model':db['CmContact'],'as':_0x15f5('0x89'),'where':_0x4f2c6b,'limit':0x1,'order':[[_0x15f5('0x7c'),_0x15f5('0x8a')]]}]},{'model':db[_0x15f5('0x8b')],'as':_0x15f5('0x8c')}]});})[_0x15f5('0x36')](handleEntityNotFound(_0x50c6d1,null))[_0x15f5('0x36')](function(_0xa29e17){if(_0xa29e17&&_0xa29e17[_0x15f5('0x88')]){_0x303dae[_0x15f5('0x8d')]=_0xa29e17;_0x303dae[_0x15f5('0x8e')]=_0xa29e17[_0x15f5('0x8c')];_0x303dae[_0x15f5('0x8f')]=_0xa29e17[_0x15f5('0x88')];_0x303dae[_0x15f5('0x8e')]=_[_0x15f5('0x90')](_0x303dae[_0x15f5('0x8e')],[_0x15f5('0x91')],[_0x15f5('0x92')]);if(_0x303dae['account'][_0x15f5('0x8c')]){delete _0x303dae[_0x15f5('0x8d')][_0x15f5('0x8c')];}if(_0x303dae[_0x15f5('0x8d')][_0x15f5('0x88')]&&_0x303dae['account'][_0x15f5('0x88')]['Contacts'][_0x15f5('0x4e')]){return _0x303dae[_0x15f5('0x8d')][_0x15f5('0x88')][_0x15f5('0x89')][0x0];}var _0x363b99=_[_0x15f5('0x93')](_0xdc5fac[_0x15f5('0x62')],{'firstName':_0xdc5fac['body'][_0x15f5('0x7f')],'ListId':_0xa29e17[_0x15f5('0x94')]});_0x363b99[_0xdc5fac[_0x15f5('0x62')]['mapKey']]=_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x7f')];return db['CmContact']['create'](_0x363b99,{'fields':_0x13cbce,'raw':!![]});}})[_0x15f5('0x36')](handleEntityNotFound(_0x50c6d1,null))[_0x15f5('0x36')](function(_0x3a67e2){_0x303dae[_0x15f5('0x95')]=_0x3a67e2;if(_0x3a67e2){var _0x1df6b7={'ContactId':_0x3a67e2['id'],'OpenchannelAccountId':_0xdc5fac[_0x15f5('0x5e')]['id'],'from':(_0x3a67e2[_0x15f5('0x96')]||'')+'\x20'+(_0x3a67e2['lastName']||'')};var _0x1e5337={'OpenchannelAccountId':_0xdc5fac['params']['id'],'closed':![]};if(_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x97')]){_0x1e5337[_0x15f5('0x97')]=_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x97')];return db[_0x15f5('0x98')][_0x15f5('0x60')]({'where':_0x1e5337})[_0x15f5('0x36')](function(_0x1415f5){if(_0x1415f5){return[_0x1415f5,![]];}_0x1df6b7['threadId']=_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x97')];_0x1df6b7['externalUrl']=_0xdc5fac['body'][_0x15f5('0x99')];return db[_0x15f5('0x98')]['create'](_0x1df6b7)[_0x15f5('0x36')](function(_0x2be2f6){return[_0x2be2f6,!![]];});});}else{_0x1e5337[_0x15f5('0x97')]=null;}_0x1e5337[_0x15f5('0x9a')]=_0x3a67e2['id'];return db[_0x15f5('0x98')][_0x15f5('0x60')]({'where':_0x1e5337})[_0x15f5('0x36')](function(_0x60d0de){if(_0x60d0de){return[_0x60d0de,![]];}return db[_0x15f5('0x98')][_0x15f5('0x61')](_0x1df6b7)[_0x15f5('0x36')](function(_0x3d2351){return[_0x3d2351,!![]];});});}})['spread'](function(_0x244639,_0x2c591a){if(_0x244639){_0x661cb3=_0x2c591a;if(!_0x2c591a){var _0x49fa24={'from':(_0x303dae[_0x15f5('0x95')]['firstName']||'')+'\x20'+(_0x303dae[_0x15f5('0x95')]['lastName']||'')};if(_0xdc5fac['body'][_0x15f5('0x97')]&&_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x9b')]&&_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x97')]!=_0xdc5fac['body'][_0x15f5('0x9b')]){_0x49fa24[_0x15f5('0x97')]=_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x9b')];}return _0x244639[_0x15f5('0x35')](_0x49fa24);}else{return _0x244639;}}})[_0x15f5('0x36')](function(_0x579269){_0x303dae['interaction']=_0x579269[_0x15f5('0x37')]({'plain':!![]});_0x303dae[_0x15f5('0x9c')][_0x15f5('0x9d')]=_0x661cb3;if(_0x303dae[_0x15f5('0x9c')][_0x15f5('0x9d')]){if(_0x303dae[_0x15f5('0x8d')][_0x15f5('0x9e')]){_0x303dae[_0x15f5('0x8e')]['push']({'id':0x0,'priority':_0x303dae['applications'][_0x15f5('0x4e')]+0x1,'app':'close','appdata':_0x15f5('0x9f'),'interval':_0x15f5('0xa0')});}}return db['OpenchannelMessage'][_0x15f5('0x61')]({'body':_0xdc5fac[_0x15f5('0x62')][_0x15f5('0x62')],'OpenchannelAccountId':_0xdc5fac[_0x15f5('0x5e')]['id'],'OpenchannelInteractionId':_0x579269['id'],'direction':'in','ContactId':_0x303dae[_0x15f5('0x95')]['id'],'AttachmentId':_0xdc5fac[_0x15f5('0x62')][_0x15f5('0xa1')]});})[_0x15f5('0x36')](function(_0x5d66ef){_0x303dae[_0x15f5('0x29')]=_0x5d66ef;if(_0x303dae[_0x15f5('0x9c')]['UserId']){return db[_0x15f5('0xa2')][_0x15f5('0x60')]({'attributes':['id',_0x15f5('0x3e')],'where':{'id':_0x303dae[_0x15f5('0x9c')]['UserId']}})[_0x15f5('0x36')](function(_0x28754a){if(_0x28754a){_0x303dae[_0x15f5('0x8e')][_0x15f5('0xa3')]({'id':0x0,'priority':0x0,'app':_0x15f5('0xa4'),'appdata':_0x28754a[_0x15f5('0x3e')]+','+(_0x303dae['account'][_0x15f5('0xa5')]||0xa),'interval':'*,*,*,*'});_0x303dae[_0x15f5('0xa6')]=![];}return respondWithRpcPromise(_0x15f5('0xa7'),_0x15f5('0xa8'),_0x303dae);});}return respondWithRpcPromise('Start',_0x15f5('0xa8'),_0x303dae);})['then'](function(_0x3b6670){respondWithRpcPromise(_0x15f5('0xa9'),_0x15f5('0xa9'),{'event':_0x15f5('0x77'),'message':_0x3b6670},client9002);return _0x3b6670;})[_0x15f5('0x36')](respondWithResult(_0x50c6d1,null))['catch'](handleError(_0x50c6d1,null));};exports[_0x15f5('0xaa')]=function(_0x402580,_0x5c5cff,_0x17a634){return db['OpenchannelAccount'][_0x15f5('0x6f')]({'where':{'id':_0x402580[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x5c5cff,null))['then'](function(_0x26aede){if(_0x26aede){return db[_0x15f5('0xab')]['transaction'](function(_0x4d95f8){return db[_0x15f5('0x8b')]['destroy']({'where':{'OpenchannelAccountId':_0x402580[_0x15f5('0x5e')]['id']},'transaction':_0x4d95f8})['then'](function(_0x324487){var _0x21f1ec=_[_0x15f5('0x42')](_0x402580[_0x15f5('0x62')],function(_0x1d194){_0x1d194[_0x15f5('0x6c')]=_0x402580['params']['id'];return _0x1d194;});return db[_0x15f5('0x8b')]['bulkCreate'](_0x21f1ec,{'transaction':_0x4d95f8});});})[_0x15f5('0x36')](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x402580[_0x15f5('0x5e')]['id']},'order':_0x15f5('0x91')});});}})[_0x15f5('0x36')](respondWithResult(_0x5c5cff,null))[_0x15f5('0x5c')](handleError(_0x5c5cff,null));};exports[_0x15f5('0xac')]=function(_0x5b20f8,_0x367f72,_0x1b33e3){var _0x23b384={};var _0x50588b={};var _0x1911f6;var _0x538578;return db[_0x15f5('0x43')][_0x15f5('0x6f')]({'where':{'id':_0x5b20f8[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x367f72,null))['then'](function(_0x277058){if(_0x277058){_0x1911f6=_0x277058;_0x50588b[_0x15f5('0x48')]=_['keys'](db['OpenchannelApplication'][_0x15f5('0x44')]);_0x50588b[_0x15f5('0x49')]=_['keys'](_0x5b20f8['query']);_0x50588b[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x50588b[_0x15f5('0x48')],_0x50588b[_0x15f5('0x49')]);_0x23b384[_0x15f5('0x4c')]=_[_0x15f5('0x4b')](_0x50588b[_0x15f5('0x48')],qs[_0x15f5('0x4d')](_0x5b20f8[_0x15f5('0x49')][_0x15f5('0x4d')]));_0x23b384[_0x15f5('0x4c')]=_0x23b384[_0x15f5('0x4c')][_0x15f5('0x4e')]?_0x23b384[_0x15f5('0x4c')]:_0x50588b[_0x15f5('0x48')];_0x23b384[_0x15f5('0x70')]=qs[_0x15f5('0x51')](_0x5b20f8['query']['sort']);_0x23b384['where']=qs[_0x15f5('0x4a')](_[_0x15f5('0x52')](_0x5b20f8[_0x15f5('0x49')],_0x50588b['filters']));if(_0x5b20f8[_0x15f5('0x49')][_0x15f5('0x53')]){_0x23b384[_0x15f5('0x54')]=_[_0x15f5('0x55')](_0x23b384['where'],{'$or':_['map'](_0x23b384['attributes'],function(_0x2178ff){var _0x246e4e={};_0x246e4e[_0x2178ff]={'$like':'%'+_0x5b20f8[_0x15f5('0x49')]['filter']+'%'};return _0x246e4e;})});}_0x23b384=_[_0x15f5('0x55')]({},_0x23b384,_0x5b20f8['options']);return _0x1911f6[_0x15f5('0xac')](_0x23b384);}})[_0x15f5('0x36')](function(_0x55d8da){if(_0x55d8da){_0x538578=_0x55d8da[_0x15f5('0x4e')];if(!_0x5b20f8['query'][_0x15f5('0x4f')](_0x15f5('0x50'))){_0x23b384[_0x15f5('0x2e')]=qs[_0x15f5('0x2e')](_0x5b20f8['query'][_0x15f5('0x2e')]);_0x23b384['offset']=qs[_0x15f5('0x2c')](_0x5b20f8[_0x15f5('0x49')][_0x15f5('0x2c')]);}return _0x1911f6[_0x15f5('0xac')](_0x23b384);}})['then'](function(_0x562482){if(_0x562482){return _0x562482?{'count':_0x538578,'rows':_0x562482}:null;}})[_0x15f5('0x36')](respondWithResult(_0x367f72,null))['catch'](handleError(_0x367f72,null));};exports[_0x15f5('0xad')]=function(_0x48b802,_0xfc21e9,_0x2e2f81){var _0x305e79={'raw':![],'where':{}};var _0x540477={};var _0x401239={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x48b802[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0xfc21e9,null))[_0x15f5('0x36')](function(_0x23773e){if(_0x23773e){_0x540477[_0x15f5('0x48')]=_[_0x15f5('0x5f')](db[_0x15f5('0x98')][_0x15f5('0x44')]);_0x540477[_0x15f5('0x49')]=_[_0x15f5('0x5f')](_0x48b802[_0x15f5('0x49')]);_0x540477['filters']=_[_0x15f5('0x4b')](_0x540477['model'],_0x540477[_0x15f5('0x49')]);_0x305e79[_0x15f5('0x4c')]=_[_0x15f5('0x4b')](_0x540477['model'],qs[_0x15f5('0x4d')](_0x48b802['query'][_0x15f5('0x4d')]));_0x305e79[_0x15f5('0x4c')]=_0x305e79[_0x15f5('0x4c')][_0x15f5('0x4e')]?_0x305e79[_0x15f5('0x4c')]:_0x540477['model'];if(!_0x48b802[_0x15f5('0x49')][_0x15f5('0x4f')](_0x15f5('0x50'))){_0x305e79[_0x15f5('0x2e')]=qs[_0x15f5('0x2e')](_0x48b802[_0x15f5('0x49')][_0x15f5('0x2e')]);_0x305e79[_0x15f5('0x2c')]=qs['offset'](_0x48b802[_0x15f5('0x49')][_0x15f5('0x2c')]);}_0x305e79['order']=qs[_0x15f5('0x51')](_0x48b802[_0x15f5('0x49')][_0x15f5('0x51')]);_0x305e79['where']=qs[_0x15f5('0x4a')](_[_0x15f5('0x52')](_0x48b802[_0x15f5('0x49')],_0x540477[_0x15f5('0x4a')]));_0x305e79['where']['OpenchannelAccountId']=_0x23773e['id'];if(_0x48b802['query'][_0x15f5('0x53')]){_0x305e79['where']=_['merge'](_0x305e79['where'],{'$or':_[_0x15f5('0x42')](_0x305e79[_0x15f5('0x4c')],function(_0x4187ac){var _0x4f36fc={};_0x4f36fc[_0x4187ac]={'$like':'%'+_0x48b802['query'][_0x15f5('0x53')]+'%'};return _0x4f36fc;})});}_0x305e79=_[_0x15f5('0x55')]({},_0x305e79,_0x48b802[_0x15f5('0x57')]);return db[_0x15f5('0x98')][_0x15f5('0x2f')]({'where':_0x305e79[_0x15f5('0x54')]})[_0x15f5('0x36')](function(_0x2d915a){_0x401239[_0x15f5('0x2f')]=_0x2d915a;if(_0x48b802[_0x15f5('0x49')][_0x15f5('0x58')]){_0x305e79[_0x15f5('0x59')]=[{'model':db['CmContact'],'as':_0x15f5('0xae'),'required':![]},{'model':db[_0x15f5('0xa2')],'as':_0x15f5('0xaf'),'attributes':[_0x15f5('0x3e'),_0x15f5('0xb0'),_0x15f5('0xb1')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x15f5('0x3e'),'color'],'where':_0x48b802[_0x15f5('0x49')][_0x15f5('0xb2')]?{'id':_0x48b802[_0x15f5('0x49')]['tag']}:undefined,'required':_0x48b802[_0x15f5('0x49')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x15f5('0x5a')](_0x305e79);})[_0x15f5('0x36')](function(_0x14de42){_0x401239[_0x15f5('0x5b')]=_0x14de42;return _0x401239;});}})[_0x15f5('0x36')](respondWithFilteredResult(_0xfc21e9,_0x305e79))[_0x15f5('0x5c')](handleError(_0xfc21e9,null));};exports[_0x15f5('0xb3')]=function(_0x2d3aa2,_0x19685b,_0x26cfda){return db[_0x15f5('0x43')][_0x15f5('0x60')]({'where':{'id':_0x2d3aa2['params']['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x19685b,null))[_0x15f5('0x36')](function(_0x54a91c){if(_0x54a91c){return _0x54a91c[_0x15f5('0xb3')](_0x2d3aa2['body'][_0x15f5('0x76')],_[_0x15f5('0xb4')](_0x2d3aa2[_0x15f5('0x62')],['ids','id'])||{})['spread'](function(_0x1f3b79){for(var _0x2fc9ac=0x0;_0x2fc9ac<_0x2d3aa2[_0x15f5('0x62')][_0x15f5('0x76')][_0x15f5('0x4e')];_0x2fc9ac+=0x1){socket[_0x15f5('0xb5')](_0x15f5('0xb6'),{'UserId':Number(_0x2d3aa2[_0x15f5('0x62')][_0x15f5('0x76')][_0x2fc9ac]),'OpenchannelAccountId':Number(_0x2d3aa2[_0x15f5('0x5e')]['id'])});}return _0x1f3b79;});}})[_0x15f5('0x36')](respondWithResult(_0x19685b,null))['catch'](handleError(_0x19685b,null));};exports[_0x15f5('0xb7')]=function(_0x1d7d99,_0x5519af,_0x272309){return db[_0x15f5('0x43')][_0x15f5('0x60')]({'where':{'id':_0x1d7d99[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x5519af,null))[_0x15f5('0x36')](function(_0x305189){if(_0x305189){return _0x305189['removeAgents'](_0x1d7d99['query'][_0x15f5('0x76')])[_0x15f5('0x36')](function(){if(_['isArray'](_0x1d7d99[_0x15f5('0x49')][_0x15f5('0x76')])){for(var _0x3d0449=0x0;_0x3d0449<_0x1d7d99[_0x15f5('0x49')][_0x15f5('0x76')][_0x15f5('0x4e')];_0x3d0449+=0x1){socket[_0x15f5('0xb5')](_0x15f5('0xb8'),{'UserId':Number(_0x1d7d99[_0x15f5('0x49')][_0x15f5('0x76')][_0x3d0449]),'OpenchannelAccountId':Number(_0x1d7d99[_0x15f5('0x5e')]['id'])});}}else{socket[_0x15f5('0xb5')](_0x15f5('0xb8'),{'UserId':Number(_0x1d7d99['query'][_0x15f5('0x76')]),'OpenchannelAccountId':Number(_0x1d7d99[_0x15f5('0x5e')]['id'])});}});}})[_0x15f5('0x36')](respondWithStatusCode(_0x5519af,null))['catch'](handleError(_0x5519af,null));};exports[_0x15f5('0xb9')]=function(_0x5012df,_0x184b24,_0x2315c8){var _0xd54fa6={};var _0x452bd9={};var _0x2b2a22;var _0x157652;return db[_0x15f5('0x43')]['findOne']({'where':{'id':_0x5012df[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x184b24,null))[_0x15f5('0x36')](function(_0x388a38){if(_0x388a38){_0x2b2a22=_0x388a38;_0x452bd9[_0x15f5('0x48')]=_[_0x15f5('0x5f')](db[_0x15f5('0xa2')][_0x15f5('0x44')]);_0x452bd9[_0x15f5('0x49')]=_[_0x15f5('0x5f')](_0x5012df[_0x15f5('0x49')]);_0x452bd9[_0x15f5('0x4a')]=_[_0x15f5('0x4b')](_0x452bd9[_0x15f5('0x48')],_0x452bd9[_0x15f5('0x49')]);_0xd54fa6[_0x15f5('0x4c')]=_[_0x15f5('0x4b')](_0x452bd9[_0x15f5('0x48')],qs[_0x15f5('0x4d')](_0x5012df[_0x15f5('0x49')][_0x15f5('0x4d')]));_0xd54fa6[_0x15f5('0x4c')]=_0xd54fa6['attributes']['length']?_0xd54fa6['attributes']:_0x452bd9[_0x15f5('0x48')];_0xd54fa6[_0x15f5('0x70')]=qs[_0x15f5('0x51')](_0x5012df[_0x15f5('0x49')][_0x15f5('0x51')]);_0xd54fa6[_0x15f5('0x54')]=qs[_0x15f5('0x4a')](_[_0x15f5('0x52')](_0x5012df[_0x15f5('0x49')],_0x452bd9[_0x15f5('0x4a')]));if(_0x5012df['query']['filter']){_0xd54fa6[_0x15f5('0x54')]=_['merge'](_0xd54fa6[_0x15f5('0x54')],{'$or':_['map'](_0xd54fa6['attributes'],function(_0x2bb8cb){var _0x5ea61f={};_0x5ea61f[_0x2bb8cb]={'$like':'%'+_0x5012df['query'][_0x15f5('0x53')]+'%'};return _0x5ea61f;})});}_0xd54fa6=_['merge']({},_0xd54fa6,_0x5012df[_0x15f5('0x57')]);return _0x2b2a22[_0x15f5('0xb9')](_0xd54fa6);}})[_0x15f5('0x36')](function(_0x1737f5){if(_0x1737f5){_0x157652=_0x1737f5['length'];if(!_0x5012df[_0x15f5('0x49')][_0x15f5('0x4f')](_0x15f5('0x50'))){_0xd54fa6[_0x15f5('0x2e')]=qs['limit'](_0x5012df[_0x15f5('0x49')]['limit']);_0xd54fa6[_0x15f5('0x2c')]=qs[_0x15f5('0x2c')](_0x5012df[_0x15f5('0x49')][_0x15f5('0x2c')]);}return _0x2b2a22[_0x15f5('0xb9')](_0xd54fa6);}})['then'](function(_0x5b1d4d){if(_0x5b1d4d){return _0x5b1d4d?{'count':_0x157652,'rows':_0x5b1d4d}:null;}})[_0x15f5('0x36')](respondWithResult(_0x184b24,null))[_0x15f5('0x5c')](handleError(_0x184b24,null));};exports[_0x15f5('0x3f')]=function(_0x4aab07,_0x5b2efa,_0x4e2257){var _0x2c6c13,_0x7c1150,_0x54668a;if(_[_0x15f5('0x80')](_0x4aab07[_0x15f5('0x62')][_0x15f5('0x62')])||_0x4aab07[_0x15f5('0x62')][_0x15f5('0x62')]===''){throw new db[(_0x15f5('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4aab07[_0x15f5('0x62')]['to'])){}_0x2c6c13=_0x4aab07[_0x15f5('0x62')]['to'];return db[_0x15f5('0x43')][_0x15f5('0x6f')]({'where':{'id':_0x4aab07[_0x15f5('0x5e')]['id']}})[_0x15f5('0x36')](handleEntityNotFound(_0x5b2efa,null))[_0x15f5('0x36')](function(_0x10922f){if(_0x10922f){return db[_0x15f5('0x43')]['find']({'where':{'id':_0x10922f['id']},'include':[{'model':db[_0x15f5('0x87')],'as':_0x15f5('0x88'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x10922f[_0x15f5('0x83')]]:_0x2c6c13},'limit':0x1,'order':[[_0x15f5('0x7c'),_0x15f5('0x8a')]]}]}]})[_0x15f5('0x36')](handleEntityNotFound(_0x5b2efa,null))[_0x15f5('0x36')](function(_0x103a14){if(_0x103a14&&_0x103a14[_0x15f5('0x88')]){_0x7c1150=_0x103a14[_0x15f5('0x37')]({'plain':!![]});if(_0x7c1150[_0x15f5('0x88')]&&_0x7c1150[_0x15f5('0x88')]['Contacts'][_0x15f5('0x4e')]){return _0x7c1150[_0x15f5('0x88')][_0x15f5('0x89')][0x0];}return db[_0x15f5('0x78')]['create'](_[_0x15f5('0x93')](_0x4aab07[_0x15f5('0x62')],{'firstName':_0x2c6c13,[_0x103a14[_0x15f5('0x83')]]:_0x2c6c13,'phone':_0x2c6c13,'ListId':_0x7c1150[_0x15f5('0x94')]}));}})[_0x15f5('0x36')](handleEntityNotFound(_0x5b2efa,null))[_0x15f5('0x36')](function(_0x47272e){if(_0x47272e){_0x54668a=_0x47272e;return db[_0x15f5('0x98')][_0x15f5('0x60')]({'where':{'ContactId':_0x54668a['id'],'closed':![],'OpenchannelAccountId':_0x7c1150['id']}})[_0x15f5('0x36')](function(_0x8714fe){if(_0x8714fe){return[_0x8714fe,![]];}return db[_0x15f5('0x98')][_0x15f5('0x61')]({'UserId':_0x4aab07[_0x15f5('0x65')]['id'],'ContactId':_0x54668a['id'],'OpenchannelAccountId':_0x7c1150['id'],'lastMsgDirection':_0x15f5('0xba'),'Messages':[_[_0x15f5('0x55')](_0x4aab07['body'],{'read':![],'body':_0x4aab07[_0x15f5('0x62')][_0x15f5('0x62')],'OpenchannelAccountId':_0x7c1150['id'],'UserId':_0x4aab07[_0x15f5('0x65')]['id'],'ContactId':_0x54668a['id']})]},{'include':[{'model':db[_0x15f5('0xbb')],'as':_0x15f5('0xbc')}]})['then'](function(_0x19d1aa){return[_0x19d1aa,!![]];});});}})[_0x15f5('0xbd')](function(_0x58521c,_0x265186){if(_0x265186){return _0x58521c;}return db[_0x15f5('0xbb')][_0x15f5('0x61')](_[_0x15f5('0x55')](_0x4aab07[_0x15f5('0x62')],{'read':![],'body':_0x4aab07[_0x15f5('0x62')][_0x15f5('0x62')],'OpenchannelAccountId':_0x7c1150['id'],'OpenchannelInteractionId':_0x58521c['id'],'UserId':_0x4aab07[_0x15f5('0x65')]['id'],'ContactId':_0x54668a['id']}))[_0x15f5('0x36')](function(_0x2e9632){_0x58521c['dataValues'][_0x15f5('0xbc')]=[];_0x58521c[_0x15f5('0xbe')]['Messages'][_0x15f5('0xbf')](_0x2e9632[_0x15f5('0xbe')]);return _0x58521c;});});}})[_0x15f5('0x36')](respondWithResult(_0x5b2efa,null))['catch'](handleError(_0x5b2efa,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index caff8b2..0e6c2a6 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 _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update'];(function(_0x5b1b52,_0x5d2b9b){var _0x2bbab2=function(_0x5ad358){while(--_0x5ad358){_0x5b1b52['push'](_0x5b1b52['shift']());}};_0x2bbab2(++_0x5d2b9b);}(_0x54ef,0x112));var _0xf54e=function(_0x4adbf4,_0x260655){_0x4adbf4=_0x4adbf4-0x0;var _0x4d4015=_0x54ef[_0x4adbf4];return _0x4d4015;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var OpenchannelAccount=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){OpenchannelAccountEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);OpenchannelAccountEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];OpenchannelAccount[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6c76=['update','emit','hook','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x4166c9,_0x449b5e){var _0x2aac27=function(_0x31820d){while(--_0x31820d){_0x4166c9['push'](_0x4166c9['shift']());}};_0x2aac27(++_0x449b5e);}(_0x6c76,0x184));var _0x66c7=function(_0x47352e,_0x21e7ea){_0x47352e=_0x47352e-0x0;var _0x5012dc=_0x6c76[_0x47352e];return _0x5012dc;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var OpenchannelAccount=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 912e5ed..441df3f 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x40b81,_0x4a27ca){var _0x588e75=function(_0x3ad5c0){while(--_0x3ad5c0){_0x40b81['push'](_0x40b81['shift']());}};_0x588e75(++_0x4a27ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x54f314,_0x6c1fb6){var _0x3ea939=function(_0x2e2ac8){while(--_0x2e2ac8){_0x54f314['push'](_0x54f314['shift']());}};_0x3ea939(++_0x6c1fb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 342911d..e37ae66 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 _0x4b0f=['http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x441eee,_0x5e5963){var _0x17198c=function(_0x19c8ae){while(--_0x19c8ae){_0x441eee['push'](_0x441eee['shift']());}};_0x17198c(++_0x5e5963);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x298374,_0x4d34c4){_0x298374=_0x298374-0x0;var _0x42ada1=_0x4b0f[_0x298374];return _0x42ada1;};'use strict';var _=require('lodash');var util=require(_0xf4b0('0x0'));var moment=require(_0xf4b0('0x1'));var BPromise=require(_0xf4b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4b0('0x3'));var db=require(_0xf4b0('0x4'))['db'];var utils=require(_0xf4b0('0x5'));var logger=require(_0xf4b0('0x6'))(_0xf4b0('0x7'));var config=require(_0xf4b0('0x8'));var jayson=require(_0xf4b0('0x9'));var client=jayson[_0xf4b0('0xa')][_0xf4b0('0xb')]({'port':0x232a});config[_0xf4b0('0xc')]=_[_0xf4b0('0xd')](config[_0xf4b0('0xc')],{'host':_0xf4b0('0xe'),'port':0x18eb});var socket=require(_0xf4b0('0xf'))(new Redis(config[_0xf4b0('0xc')]));require(_0xf4b0('0x10'))['register'](socket);function respondWithRpcPromise(_0x22b65c,_0x996ea8,_0x25ad2c){return new BPromise(function(_0x21db22,_0x35e838){return client[_0xf4b0('0x11')](_0x22b65c,_0x25ad2c)[_0xf4b0('0x12')](function(_0x10d7a7){logger[_0xf4b0('0x13')](_0xf4b0('0x14'),_0x996ea8,_0xf4b0('0x15'));logger[_0xf4b0('0x16')](_0xf4b0('0x17'),_0x996ea8,_0xf4b0('0x15'),JSON[_0xf4b0('0x18')](_0x10d7a7));if(_0x10d7a7[_0xf4b0('0x19')]){if(_0x10d7a7[_0xf4b0('0x19')][_0xf4b0('0x1a')]===0x1f4){logger[_0xf4b0('0x19')](_0xf4b0('0x14'),_0x996ea8,_0x10d7a7[_0xf4b0('0x19')][_0xf4b0('0x1b')]);return _0x35e838(_0x10d7a7['error'][_0xf4b0('0x1b')]);}logger[_0xf4b0('0x19')](_0xf4b0('0x14'),_0x996ea8,_0x10d7a7['error'][_0xf4b0('0x1b')]);return _0x21db22(_0x10d7a7[_0xf4b0('0x19')][_0xf4b0('0x1b')]);}else{logger['info'](_0xf4b0('0x14'),_0x996ea8,_0xf4b0('0x15'));_0x21db22(_0x10d7a7[_0xf4b0('0x1c')]['message']);}})['catch'](function(_0x1ec2b0){logger[_0xf4b0('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x996ea8,_0x1ec2b0);_0x35e838(_0x1ec2b0);});});} \ No newline at end of file +var _0xaa5e=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x47b7eb,_0x372a44){_0x47b7eb=_0x47b7eb-0x0;var _0x17f5d6=_0xaa5e[_0x47b7eb];return _0x17f5d6;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});config['redis']=_[_0xeaa5('0xb')](config[_0xeaa5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xeaa5('0xd'))(new Redis(config[_0xeaa5('0xc')]));require('./openchannelAccount.socket')[_0xeaa5('0xe')](socket);function respondWithRpcPromise(_0x49682b,_0x2f5750,_0x3552ac){return new BPromise(function(_0x503237,_0x3e1c2e){return client[_0xeaa5('0xf')](_0x49682b,_0x3552ac)[_0xeaa5('0x10')](function(_0x46806d){logger[_0xeaa5('0x11')](_0xeaa5('0x12'),_0x2f5750,_0xeaa5('0x13'));logger[_0xeaa5('0x14')](_0xeaa5('0x15'),_0x2f5750,'request\x20sent',JSON[_0xeaa5('0x16')](_0x46806d));if(_0x46806d[_0xeaa5('0x17')]){if(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x18')]===0x1f4){logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x46806d[_0xeaa5('0x17')]['message']);return _0x3e1c2e(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x19')]);}logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x46806d[_0xeaa5('0x17')]['message']);return _0x503237(_0x46806d[_0xeaa5('0x17')][_0xeaa5('0x19')]);}else{logger[_0xeaa5('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0xeaa5('0x13'));_0x503237(_0x46806d['result'][_0xeaa5('0x19')]);}})[_0xeaa5('0x1a')](function(_0x22f4d3){logger[_0xeaa5('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f5750,_0x22f4d3);_0x3e1c2e(_0x22f4d3);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index f6c053f..0e4ea28 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 _0x1cc7=['remove','emit','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x269cde,_0x45f0c7){var _0x31692b=function(_0x2f1ef9){while(--_0x2f1ef9){_0x269cde['push'](_0x269cde['shift']());}};_0x31692b(++_0x45f0c7);}(_0x1cc7,0x15a));var _0x71cc=function(_0x1f4692,_0x5aad41){_0x1f4692=_0x1f4692-0x0;var _0x8c16c8=_0x1cc7[_0x1f4692];return _0x8c16c8;};'use strict';var OpenchannelAccountEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){OpenchannelAccountEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);OpenchannelAccountEvents['on'](_0x4039ce,_0x2e70f0);}}; \ No newline at end of file +var _0x2bb0=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener'];(function(_0x3ad319,_0x3f3242){var _0x4c07e9=function(_0x2a1bc7){while(--_0x2a1bc7){_0x3ad319['push'](_0x3ad319['shift']());}};_0x4c07e9(++_0x3f3242);}(_0x2bb0,0xf3));var _0x02bb=function(_0x1f2f94,_0x5d5976){_0x1f2f94=_0x1f2f94-0x0;var _0x12b301=_0x2bb0[_0x1f2f94];return _0x12b301;};'use strict';var OpenchannelAccountEvents=require(_0x02bb('0x0'));var events=[_0x02bb('0x1'),_0x02bb('0x2'),'update'];function createListener(_0xc43ce8,_0x59a1ed){return function(_0x4a22b7){_0x59a1ed[_0x02bb('0x3')](_0xc43ce8,_0x4a22b7);};}function removeListener(_0x500cd1,_0x1dff97){return function(){OpenchannelAccountEvents[_0x02bb('0x4')](_0x500cd1,_0x1dff97);};}exports[_0x02bb('0x5')]=function(_0x390ff7){for(var _0x43dbb7=0x0,_0x16bb7c=events[_0x02bb('0x6')];_0x43dbb7<_0x16bb7c;_0x43dbb7++){var _0x47d7ae=events[_0x43dbb7];var _0x6d064a=createListener(_0x02bb('0x7')+_0x47d7ae,_0x390ff7);OpenchannelAccountEvents['on'](_0x47d7ae,_0x6d064a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4437d9a..a4cf302 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 _0x9e71=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb8f65,_0x5b3d4f){var _0x537221=function(_0x157d70){while(--_0x157d70){_0xb8f65['push'](_0xb8f65['shift']());}};_0x537221(++_0x5b3d4f);}(_0x9e71,0x1f0));var _0x19e7=function(_0x5d41a5,_0x2e53df){_0x5d41a5=_0x5d41a5-0x0;var _0x4608e8=_0x9e71[_0x5d41a5];return _0x4608e8;};'use strict';var multer=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var path=require(_0x19e7('0x2'));var timeout=require(_0x19e7('0x3'));var express=require(_0x19e7('0x4'));var router=express[_0x19e7('0x5')]();var fs_extra=require(_0x19e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x19e7('0x7'));var config=require(_0x19e7('0x8'));var controller=require(_0x19e7('0x9'));router[_0x19e7('0xa')]('/',auth[_0x19e7('0xb')](),controller[_0x19e7('0xc')]);router[_0x19e7('0xa')](_0x19e7('0xd'),auth[_0x19e7('0xb')](),controller['show']);router['post']('/',auth[_0x19e7('0xb')](),controller[_0x19e7('0xe')]);router['put'](_0x19e7('0xd'),auth[_0x19e7('0xb')](),controller['update']);router[_0x19e7('0xf')](_0x19e7('0xd'),auth[_0x19e7('0xb')](),controller[_0x19e7('0x10')]);module[_0x19e7('0x11')]=router; \ No newline at end of file +var _0xeea5=['./openchannelApplication.controller','/:id','isAuthenticated','show','create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xcbb856,_0x8d2300){var _0x5f88f9=function(_0x577411){while(--_0x577411){_0xcbb856['push'](_0xcbb856['shift']());}};_0x5f88f9(++_0x8d2300);}(_0xeea5,0x1c9));var _0x5eea=function(_0x14f7b7,_0x384246){_0x14f7b7=_0x14f7b7-0x0;var _0x207bc1=_0xeea5[_0x14f7b7];return _0x207bc1;};'use strict';var multer=require('multer');var util=require(_0x5eea('0x0'));var path=require(_0x5eea('0x1'));var timeout=require('connect-timeout');var express=require(_0x5eea('0x2'));var router=express[_0x5eea('0x3')]();var fs_extra=require(_0x5eea('0x4'));var auth=require(_0x5eea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5eea('0x6'));var controller=require(_0x5eea('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5eea('0x8'),auth[_0x5eea('0x9')](),controller[_0x5eea('0xa')]);router['post']('/',auth[_0x5eea('0x9')](),controller[_0x5eea('0xb')]);router[_0x5eea('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x5eea('0xd')]);router['delete'](_0x5eea('0x8'),auth[_0x5eea('0x9')](),controller[_0x5eea('0xe')]);module[_0x5eea('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 4fc3de1..bdb8f89 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 _0x7e57=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x7e57,0xe9));var _0x77e5=function(_0x1f0ed,_0x44cbed){_0x1f0ed=_0x1f0ed-0x0;var _0x3f5a25=_0x7e57[_0x1f0ed];return _0x3f5a25;};'use strict';var Sequelize=require('sequelize');module[_0x77e5('0x0')]={'priority':{'type':Sequelize[_0x77e5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x77e5('0x2')],'allowNull':![],'defaultValue':_0x77e5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x77e5('0x4')}}; \ No newline at end of file +var _0x6138=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x2ae728,_0x13d8b5){var _0x2cff88=function(_0x11f1b9){while(--_0x11f1b9){_0x2ae728['push'](_0x2ae728['shift']());}};_0x2cff88(++_0x13d8b5);}(_0x6138,0x18c));var _0x8613=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6138[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0x8613('0x0'));module[_0x8613('0x1')]={'priority':{'type':Sequelize[_0x8613('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8613('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8613('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8613('0x3')],'defaultValue':_0x8613('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9829f13..852df1f 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 _0x36f0=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','Content-Range','json','apply','reject','save','destroy','then','stack','name','send','index','OpenchannelApplication','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36f0,0xb6));var _0x036f=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x36f0[_0x529f1c];return _0x4d57ab;};'use strict';var emlformat=require(_0x036f('0x0'));var rimraf=require(_0x036f('0x1'));var zipdir=require(_0x036f('0x2'));var jsonpatch=require(_0x036f('0x3'));var rp=require(_0x036f('0x4'));var moment=require(_0x036f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x036f('0x6'));var util=require(_0x036f('0x7'));var path=require('path');var sox=require(_0x036f('0x8'));var csv=require('to-csv');var ejs=require(_0x036f('0x9'));var fs=require('fs');var fs_extra=require(_0x036f('0xa'));var _=require(_0x036f('0xb'));var squel=require('squel');var crypto=require(_0x036f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x036f('0xd'));var toCsv=require(_0x036f('0xe'));var querystring=require(_0x036f('0xf'));var Papa=require(_0x036f('0x10'));var Redis=require('ioredis');var authService=require(_0x036f('0x11'));var qs=require(_0x036f('0x12'));var as=require(_0x036f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x036f('0x14'))(_0x036f('0x15'));var utils=require(_0x036f('0x16'));var config=require(_0x036f('0x17'));var licenseUtil=require(_0x036f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x202715,_0xd38bc9){_0xd38bc9=_0xd38bc9||0xcc;return function(_0x4bd70a){if(_0x4bd70a){return _0x202715[_0x036f('0x19')](_0xd38bc9);}return _0x202715['status'](_0xd38bc9)[_0x036f('0x1a')]();};}function respondWithResult(_0x219efd,_0x2225b9){_0x2225b9=_0x2225b9||0xc8;return function(_0x2a6a){if(_0x2a6a){return _0x219efd[_0x036f('0x1b')](_0x2225b9)['json'](_0x2a6a);}};}function respondWithFilteredResult(_0x345703,_0x5d5e53){return function(_0x1dbc3c){if(_0x1dbc3c){var _0x3673fe=typeof _0x5d5e53[_0x036f('0x1c')]===_0x036f('0x1d')&&typeof _0x5d5e53[_0x036f('0x1e')]===_0x036f('0x1d');var _0x24b29f=_0x1dbc3c['count'];var _0x451091=_0x3673fe?0x0:_0x5d5e53[_0x036f('0x1c')];var _0x516bfe=_0x3673fe?_0x1dbc3c['count']:_0x5d5e53[_0x036f('0x1c')]+_0x5d5e53[_0x036f('0x1e')];var _0x194db3;if(_0x516bfe>=_0x24b29f){_0x516bfe=_0x24b29f;_0x194db3=0xc8;}else{_0x194db3=0xce;}_0x345703[_0x036f('0x1b')](_0x194db3);return _0x345703['set'](_0x036f('0x1f'),_0x451091+'-'+_0x516bfe+'/'+_0x24b29f)[_0x036f('0x20')](_0x1dbc3c);}return null;};}function patchUpdates(_0xf4aa23){return function(_0xb6392d){try{jsonpatch[_0x036f('0x21')](_0xb6392d,_0xf4aa23,!![]);}catch(_0x4b24ce){return BPromise[_0x036f('0x22')](_0x4b24ce);}return _0xb6392d[_0x036f('0x23')]();};}function saveUpdates(_0x4a8cc1,_0x503c23){return function(_0x2a18b5){if(_0x2a18b5){return _0x2a18b5['update'](_0x4a8cc1)['then'](function(_0x37e657){return _0x37e657;});}return null;};}function removeEntity(_0x16e80f,_0x11f10d){return function(_0x1285f2){if(_0x1285f2){return _0x1285f2[_0x036f('0x24')]()[_0x036f('0x25')](function(){_0x16e80f[_0x036f('0x1b')](0xcc)[_0x036f('0x1a')]();});}};}function handleEntityNotFound(_0x7cfa5,_0x5e2508){return function(_0xba6ae6){if(!_0xba6ae6){_0x7cfa5[_0x036f('0x19')](0x194);}return _0xba6ae6;};}function handleError(_0x4ca115,_0x5b085b){_0x5b085b=_0x5b085b||0x1f4;return function(_0x142cca){logger['error'](_0x142cca[_0x036f('0x26')]);if(_0x142cca[_0x036f('0x27')]){delete _0x142cca['name'];}_0x4ca115[_0x036f('0x1b')](_0x5b085b)[_0x036f('0x28')](_0x142cca);};}exports[_0x036f('0x29')]=function(_0x1c6333,_0x4b88bd){var _0x2a40bd={},_0x42e42a={},_0x1d7c5e={'count':0x0,'rows':[]};var _0x445efc=_['map'](db[_0x036f('0x2a')]['rawAttributes'],function(_0x603125){return{'name':_0x603125['fieldName'],'type':_0x603125[_0x036f('0x2b')][_0x036f('0x2c')]};});_0x42e42a[_0x036f('0x2d')]=_['map'](_0x445efc,_0x036f('0x27'));_0x42e42a[_0x036f('0x2e')]=_[_0x036f('0x2f')](_0x1c6333[_0x036f('0x2e')]);_0x42e42a[_0x036f('0x30')]=_[_0x036f('0x31')](_0x42e42a[_0x036f('0x2d')],_0x42e42a['query']);_0x2a40bd[_0x036f('0x32')]=_['intersection'](_0x42e42a[_0x036f('0x2d')],qs[_0x036f('0x33')](_0x1c6333[_0x036f('0x2e')]['fields']));_0x2a40bd[_0x036f('0x32')]=_0x2a40bd['attributes'][_0x036f('0x34')]?_0x2a40bd['attributes']:_0x42e42a[_0x036f('0x2d')];if(!_0x1c6333['query'][_0x036f('0x35')](_0x036f('0x36'))){_0x2a40bd[_0x036f('0x1e')]=qs[_0x036f('0x1e')](_0x1c6333['query'][_0x036f('0x1e')]);_0x2a40bd[_0x036f('0x1c')]=qs[_0x036f('0x1c')](_0x1c6333[_0x036f('0x2e')][_0x036f('0x1c')]);}_0x2a40bd[_0x036f('0x37')]=qs[_0x036f('0x38')](_0x1c6333[_0x036f('0x2e')][_0x036f('0x38')]);_0x2a40bd[_0x036f('0x39')]=qs[_0x036f('0x30')](_[_0x036f('0x3a')](_0x1c6333[_0x036f('0x2e')],_0x42e42a[_0x036f('0x30')]),_0x445efc);if(_0x1c6333['query'][_0x036f('0x3b')]){_0x2a40bd['where']=_[_0x036f('0x3c')](_0x2a40bd[_0x036f('0x39')],{'$or':_[_0x036f('0x3d')](_0x445efc,function(_0x4888fb){if(_0x4888fb[_0x036f('0x2b')]!==_0x036f('0x3e')){var _0x4ead11={};_0x4ead11[_0x4888fb[_0x036f('0x27')]]={'$like':'%'+_0x1c6333[_0x036f('0x2e')]['filter']+'%'};return _0x4ead11;}})});}_0x2a40bd=_['merge']({},_0x2a40bd,_0x1c6333['options']);var _0xc75b71={'where':_0x2a40bd[_0x036f('0x39')]};return db[_0x036f('0x2a')][_0x036f('0x3f')](_0xc75b71)[_0x036f('0x25')](function(_0x47d4ab){_0x1d7c5e['count']=_0x47d4ab;if(_0x1c6333[_0x036f('0x2e')][_0x036f('0x40')]){_0x2a40bd[_0x036f('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x036f('0x42')](_0x2a40bd);})[_0x036f('0x25')](function(_0x3361f5){_0x1d7c5e[_0x036f('0x43')]=_0x3361f5;return _0x1d7c5e;})[_0x036f('0x25')](respondWithFilteredResult(_0x4b88bd,_0x2a40bd))[_0x036f('0x44')](handleError(_0x4b88bd,null));};exports[_0x036f('0x45')]=function(_0x51947d,_0x149e82){var _0x5f0985={'raw':!![],'where':{'id':_0x51947d['params']['id']}},_0x1909ed={};_0x1909ed['model']=_[_0x036f('0x2f')](db['OpenchannelApplication'][_0x036f('0x46')]);_0x1909ed['query']=_['keys'](_0x51947d[_0x036f('0x2e')]);_0x1909ed[_0x036f('0x30')]=_[_0x036f('0x31')](_0x1909ed['model'],_0x1909ed[_0x036f('0x2e')]);_0x5f0985[_0x036f('0x32')]=_[_0x036f('0x31')](_0x1909ed[_0x036f('0x2d')],qs[_0x036f('0x33')](_0x51947d[_0x036f('0x2e')][_0x036f('0x33')]));_0x5f0985['attributes']=_0x5f0985['attributes'][_0x036f('0x34')]?_0x5f0985[_0x036f('0x32')]:_0x1909ed[_0x036f('0x2d')];if(_0x51947d[_0x036f('0x2e')][_0x036f('0x40')]){_0x5f0985[_0x036f('0x41')]=[{'all':!![]}];}_0x5f0985=_[_0x036f('0x3c')]({},_0x5f0985,_0x51947d['options']);return db[_0x036f('0x2a')][_0x036f('0x47')](_0x5f0985)['then'](handleEntityNotFound(_0x149e82,null))['then'](respondWithResult(_0x149e82,null))[_0x036f('0x44')](handleError(_0x149e82,null));};exports['create']=function(_0x3191c2,_0x3a0efe){return db[_0x036f('0x2a')][_0x036f('0x48')](_0x3191c2['body'],{})[_0x036f('0x25')](respondWithResult(_0x3a0efe,0xc9))[_0x036f('0x44')](handleError(_0x3a0efe,null));};exports[_0x036f('0x49')]=function(_0x28c290,_0x56e740){if(_0x28c290[_0x036f('0x4a')]['id']){delete _0x28c290[_0x036f('0x4a')]['id'];}return db[_0x036f('0x2a')][_0x036f('0x47')]({'where':{'id':_0x28c290[_0x036f('0x4b')]['id']}})[_0x036f('0x25')](handleEntityNotFound(_0x56e740,null))[_0x036f('0x25')](saveUpdates(_0x28c290[_0x036f('0x4a')],null))['then'](respondWithResult(_0x56e740,null))[_0x036f('0x44')](handleError(_0x56e740,null));};exports[_0x036f('0x24')]=function(_0x1c798e,_0xeec415){return db[_0x036f('0x2a')][_0x036f('0x47')]({'where':{'id':_0x1c798e['params']['id']}})['then'](handleEntityNotFound(_0xeec415,null))[_0x036f('0x25')](removeEntity(_0xeec415,null))['catch'](handleError(_0xeec415,null));}; \ No newline at end of file +var _0x8df6=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x165067,_0x37d90c){var _0x5521d1=function(_0x5297aa){while(--_0x5297aa){_0x165067['push'](_0x165067['shift']());}};_0x5521d1(++_0x37d90c);}(_0x8df6,0x1be));var _0x68df=function(_0x19d771,_0x16b6c8){_0x19d771=_0x19d771-0x0;var _0x44ef53=_0x8df6[_0x19d771];return _0x44ef53;};'use strict';var emlformat=require(_0x68df('0x0'));var rimraf=require(_0x68df('0x1'));var zipdir=require(_0x68df('0x2'));var jsonpatch=require(_0x68df('0x3'));var rp=require(_0x68df('0x4'));var moment=require(_0x68df('0x5'));var BPromise=require(_0x68df('0x6'));var Mustache=require(_0x68df('0x7'));var util=require(_0x68df('0x8'));var path=require(_0x68df('0x9'));var sox=require('sox');var csv=require(_0x68df('0xa'));var ejs=require(_0x68df('0xb'));var fs=require('fs');var fs_extra=require(_0x68df('0xc'));var _=require(_0x68df('0xd'));var squel=require(_0x68df('0xe'));var crypto=require('crypto');var jsforce=require(_0x68df('0xf'));var deskjs=require(_0x68df('0x10'));var toCsv=require(_0x68df('0xa'));var querystring=require(_0x68df('0x11'));var Papa=require(_0x68df('0x12'));var Redis=require('ioredis');var authService=require(_0x68df('0x13'));var qs=require(_0x68df('0x14'));var as=require(_0x68df('0x15'));var hardwareService=require(_0x68df('0x16'));var logger=require(_0x68df('0x17'))(_0x68df('0x18'));var utils=require(_0x68df('0x19'));var config=require(_0x68df('0x1a'));var licenseUtil=require(_0x68df('0x1b'));var db=require(_0x68df('0x1c'))['db'];function respondWithStatusCode(_0x53f478,_0x3a2687){_0x3a2687=_0x3a2687||0xcc;return function(_0x50435f){if(_0x50435f){return _0x53f478[_0x68df('0x1d')](_0x3a2687);}return _0x53f478[_0x68df('0x1e')](_0x3a2687)['end']();};}function respondWithResult(_0x328005,_0xa284e4){_0xa284e4=_0xa284e4||0xc8;return function(_0x269d0e){if(_0x269d0e){return _0x328005['status'](_0xa284e4)[_0x68df('0x1f')](_0x269d0e);}};}function respondWithFilteredResult(_0xea4da9,_0x5a284d){return function(_0x1528d4){if(_0x1528d4){var _0x3eed5a=typeof _0x5a284d[_0x68df('0x20')]===_0x68df('0x21')&&typeof _0x5a284d[_0x68df('0x22')]===_0x68df('0x21');var _0x73fb73=_0x1528d4[_0x68df('0x23')];var _0x5b3c73=_0x3eed5a?0x0:_0x5a284d[_0x68df('0x20')];var _0x49d03c=_0x3eed5a?_0x1528d4[_0x68df('0x23')]:_0x5a284d['offset']+_0x5a284d['limit'];var _0xfb82f8;if(_0x49d03c>=_0x73fb73){_0x49d03c=_0x73fb73;_0xfb82f8=0xc8;}else{_0xfb82f8=0xce;}_0xea4da9[_0x68df('0x1e')](_0xfb82f8);return _0xea4da9[_0x68df('0x24')](_0x68df('0x25'),_0x5b3c73+'-'+_0x49d03c+'/'+_0x73fb73)[_0x68df('0x1f')](_0x1528d4);}return null;};}function patchUpdates(_0x1deb7a){return function(_0x5880e3){try{jsonpatch['apply'](_0x5880e3,_0x1deb7a,!![]);}catch(_0x5f2b99){return BPromise[_0x68df('0x26')](_0x5f2b99);}return _0x5880e3[_0x68df('0x27')]();};}function saveUpdates(_0x57a232,_0xdb08ed){return function(_0x202d41){if(_0x202d41){return _0x202d41[_0x68df('0x28')](_0x57a232)[_0x68df('0x29')](function(_0x5ef747){return _0x5ef747;});}return null;};}function removeEntity(_0xb312,_0x12ac5d){return function(_0x5029a8){if(_0x5029a8){return _0x5029a8[_0x68df('0x2a')]()[_0x68df('0x29')](function(){_0xb312[_0x68df('0x1e')](0xcc)[_0x68df('0x2b')]();});}};}function handleEntityNotFound(_0x5bc041,_0x1f0843){return function(_0x1141eb){if(!_0x1141eb){_0x5bc041[_0x68df('0x1d')](0x194);}return _0x1141eb;};}function handleError(_0x38fabb,_0x30dd7d){_0x30dd7d=_0x30dd7d||0x1f4;return function(_0x4028c3){logger[_0x68df('0x2c')](_0x4028c3['stack']);if(_0x4028c3[_0x68df('0x2d')]){delete _0x4028c3[_0x68df('0x2d')];}_0x38fabb[_0x68df('0x1e')](_0x30dd7d)[_0x68df('0x2e')](_0x4028c3);};}exports[_0x68df('0x2f')]=function(_0x48818c,_0x516eda){var _0x591fb8={},_0x74c889={},_0x26f882={'count':0x0,'rows':[]};var _0x4c616e=_[_0x68df('0x30')](db[_0x68df('0x31')][_0x68df('0x32')],function(_0x48b5b9){return{'name':_0x48b5b9[_0x68df('0x33')],'type':_0x48b5b9['type'][_0x68df('0x34')]};});_0x74c889[_0x68df('0x35')]=_[_0x68df('0x30')](_0x4c616e,_0x68df('0x2d'));_0x74c889[_0x68df('0x36')]=_[_0x68df('0x37')](_0x48818c[_0x68df('0x36')]);_0x74c889[_0x68df('0x38')]=_[_0x68df('0x39')](_0x74c889[_0x68df('0x35')],_0x74c889[_0x68df('0x36')]);_0x591fb8['attributes']=_[_0x68df('0x39')](_0x74c889[_0x68df('0x35')],qs[_0x68df('0x3a')](_0x48818c[_0x68df('0x36')][_0x68df('0x3a')]));_0x591fb8[_0x68df('0x3b')]=_0x591fb8[_0x68df('0x3b')]['length']?_0x591fb8[_0x68df('0x3b')]:_0x74c889['model'];if(!_0x48818c[_0x68df('0x36')][_0x68df('0x3c')](_0x68df('0x3d'))){_0x591fb8[_0x68df('0x22')]=qs['limit'](_0x48818c['query'][_0x68df('0x22')]);_0x591fb8['offset']=qs[_0x68df('0x20')](_0x48818c[_0x68df('0x36')][_0x68df('0x20')]);}_0x591fb8['order']=qs[_0x68df('0x3e')](_0x48818c[_0x68df('0x36')]['sort']);_0x591fb8[_0x68df('0x3f')]=qs[_0x68df('0x38')](_[_0x68df('0x40')](_0x48818c[_0x68df('0x36')],_0x74c889[_0x68df('0x38')]),_0x4c616e);if(_0x48818c[_0x68df('0x36')][_0x68df('0x41')]){_0x591fb8[_0x68df('0x3f')]=_[_0x68df('0x42')](_0x591fb8['where'],{'$or':_[_0x68df('0x30')](_0x4c616e,function(_0x337ed8){if(_0x337ed8[_0x68df('0x43')]!=='VIRTUAL'){var _0x3963cd={};_0x3963cd[_0x337ed8[_0x68df('0x2d')]]={'$like':'%'+_0x48818c['query'][_0x68df('0x41')]+'%'};return _0x3963cd;}})});}_0x591fb8=_[_0x68df('0x42')]({},_0x591fb8,_0x48818c['options']);var _0x2c3f14={'where':_0x591fb8[_0x68df('0x3f')]};return db['OpenchannelApplication'][_0x68df('0x23')](_0x2c3f14)[_0x68df('0x29')](function(_0x18cc4f){_0x26f882['count']=_0x18cc4f;if(_0x48818c['query'][_0x68df('0x44')]){_0x591fb8[_0x68df('0x45')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x591fb8);})[_0x68df('0x29')](function(_0x3d2525){_0x26f882[_0x68df('0x46')]=_0x3d2525;return _0x26f882;})[_0x68df('0x29')](respondWithFilteredResult(_0x516eda,_0x591fb8))[_0x68df('0x47')](handleError(_0x516eda,null));};exports[_0x68df('0x48')]=function(_0x451741,_0x340ad4){var _0x4525f1={'raw':!![],'where':{'id':_0x451741[_0x68df('0x49')]['id']}},_0x463db5={};_0x463db5[_0x68df('0x35')]=_[_0x68df('0x37')](db[_0x68df('0x31')][_0x68df('0x32')]);_0x463db5[_0x68df('0x36')]=_[_0x68df('0x37')](_0x451741[_0x68df('0x36')]);_0x463db5[_0x68df('0x38')]=_['intersection'](_0x463db5[_0x68df('0x35')],_0x463db5[_0x68df('0x36')]);_0x4525f1['attributes']=_['intersection'](_0x463db5[_0x68df('0x35')],qs['fields'](_0x451741[_0x68df('0x36')][_0x68df('0x3a')]));_0x4525f1['attributes']=_0x4525f1['attributes'][_0x68df('0x4a')]?_0x4525f1[_0x68df('0x3b')]:_0x463db5[_0x68df('0x35')];if(_0x451741[_0x68df('0x36')][_0x68df('0x44')]){_0x4525f1[_0x68df('0x45')]=[{'all':!![]}];}_0x4525f1=_[_0x68df('0x42')]({},_0x4525f1,_0x451741[_0x68df('0x4b')]);return db[_0x68df('0x31')][_0x68df('0x4c')](_0x4525f1)['then'](handleEntityNotFound(_0x340ad4,null))['then'](respondWithResult(_0x340ad4,null))[_0x68df('0x47')](handleError(_0x340ad4,null));};exports[_0x68df('0x4d')]=function(_0x1efb92,_0x3a6eb8){return db['OpenchannelApplication'][_0x68df('0x4d')](_0x1efb92[_0x68df('0x4e')],{})['then'](respondWithResult(_0x3a6eb8,0xc9))[_0x68df('0x47')](handleError(_0x3a6eb8,null));};exports['update']=function(_0x4546c8,_0x1282f9){if(_0x4546c8[_0x68df('0x4e')]['id']){delete _0x4546c8[_0x68df('0x4e')]['id'];}return db[_0x68df('0x31')][_0x68df('0x4c')]({'where':{'id':_0x4546c8['params']['id']}})['then'](handleEntityNotFound(_0x1282f9,null))[_0x68df('0x29')](saveUpdates(_0x4546c8['body'],null))['then'](respondWithResult(_0x1282f9,null))[_0x68df('0x47')](handleError(_0x1282f9,null));};exports['destroy']=function(_0x469788,_0x3f7525){return db[_0x68df('0x31')]['find']({'where':{'id':_0x469788[_0x68df('0x49')]['id']}})[_0x68df('0x29')](handleEntityNotFound(_0x3f7525,null))[_0x68df('0x29')](removeEntity(_0x3f7525,null))[_0x68df('0x47')](handleError(_0x3f7525,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index d193e01..6135360 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 _0x092b=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x092b,0x1d4));var _0xb092=function(_0x5d0648,_0xb10948){_0x5d0648=_0x5d0648-0x0;var _0x4df2b9=_0x092b[_0x5d0648];return _0x4df2b9;};'use strict';var _=require('lodash');var util=require(_0xb092('0x0'));var logger=require(_0xb092('0x1'))(_0xb092('0x2'));var moment=require(_0xb092('0x3'));var BPromise=require('bluebird');var rp=require(_0xb092('0x4'));var fs=require('fs');var path=require(_0xb092('0x5'));var rimraf=require('rimraf');var config=require(_0xb092('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xb092('0x7')]=function(_0x39a905,_0x1a488b){return _0x39a905[_0xb092('0x8')](_0xb092('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb092('0xa'),'collate':_0xb092('0xb')});}; \ No newline at end of file +var _0xbb14=['bluebird','path','../../config/environment','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x291c1b,_0x5216a6){var _0x2109c9=function(_0x498cbf){while(--_0x498cbf){_0x291c1b['push'](_0x291c1b['shift']());}};_0x2109c9(++_0x5216a6);}(_0xbb14,0xc5));var _0x4bb1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbb14[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4bb1('0x0'))(_0x4bb1('0x1'));var moment=require(_0x4bb1('0x2'));var BPromise=require(_0x4bb1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bb1('0x4'));var rimraf=require('rimraf');var config=require(_0x4bb1('0x5'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x30f144,_0x4678ee){return _0x30f144['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bb1('0x6'),'collate':_0x4bb1('0x7')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fd539c0..0f5d8e7 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 _0xba4c=['message','result','catch','OpenchannelApplication','body','options','raw','where','limit','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2dda86,_0x229d6c){var _0x26d993=function(_0xdce6d0){while(--_0xdce6d0){_0x2dda86['push'](_0x2dda86['shift']());}};_0x26d993(++_0x229d6c);}(_0xba4c,0x118));var _0xcba4=function(_0x108940,_0x151100){_0x108940=_0x108940-0x0;var _0x153051=_0xba4c[_0x108940];return _0x153051;};'use strict';var _=require('lodash');var util=require(_0xcba4('0x0'));var moment=require(_0xcba4('0x1'));var BPromise=require(_0xcba4('0x2'));var rs=require(_0xcba4('0x3'));var fs=require('fs');var Redis=require(_0xcba4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcba4('0x5'));var logger=require(_0xcba4('0x6'))(_0xcba4('0x7'));var config=require(_0xcba4('0x8'));var jayson=require(_0xcba4('0x9'));var client=jayson[_0xcba4('0xa')][_0xcba4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a8b42,_0x510fe2,_0x4b11a9){return new BPromise(function(_0x15de15,_0x2c99ff){return client[_0xcba4('0xc')](_0x2a8b42,_0x4b11a9)[_0xcba4('0xd')](function(_0x1893d3){logger[_0xcba4('0xe')](_0xcba4('0xf'),_0x510fe2,_0xcba4('0x10'));logger['debug'](_0xcba4('0x11'),_0x510fe2,'request\x20sent',JSON['stringify'](_0x1893d3));if(_0x1893d3[_0xcba4('0x12')]){if(_0x1893d3[_0xcba4('0x12')][_0xcba4('0x13')]===0x1f4){logger[_0xcba4('0x12')](_0xcba4('0xf'),_0x510fe2,_0x1893d3[_0xcba4('0x12')]['message']);return _0x2c99ff(_0x1893d3[_0xcba4('0x12')][_0xcba4('0x14')]);}logger[_0xcba4('0x12')](_0xcba4('0xf'),_0x510fe2,_0x1893d3[_0xcba4('0x12')][_0xcba4('0x14')]);return _0x15de15(_0x1893d3[_0xcba4('0x12')][_0xcba4('0x14')]);}else{logger[_0xcba4('0xe')](_0xcba4('0xf'),_0x510fe2,_0xcba4('0x10'));_0x15de15(_0x1893d3[_0xcba4('0x15')][_0xcba4('0x14')]);}})[_0xcba4('0x16')](function(_0x2c93cf){logger[_0xcba4('0x12')](_0xcba4('0xf'),_0x510fe2,_0x2c93cf);_0x2c99ff(_0x2c93cf);});});}exports['UpdateOpenchannelApplication']=function(_0x3bb2c9){var _0x5384ae=this;return new Promise(function(_0x5c3acb,_0x5e21b4){return db[_0xcba4('0x17')]['update'](_0x3bb2c9[_0xcba4('0x18')],{'raw':_0x3bb2c9['options']?_0x3bb2c9[_0xcba4('0x19')][_0xcba4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb2c9[_0xcba4('0x19')]?_0x3bb2c9[_0xcba4('0x19')][_0xcba4('0x1b')]||null:null,'attributes':_0x3bb2c9['options']?_0x3bb2c9[_0xcba4('0x19')]['attributes']||null:null,'limit':_0x3bb2c9['options']?_0x3bb2c9[_0xcba4('0x19')][_0xcba4('0x1c')]||null:null})[_0xcba4('0xd')](function(_0x5e6a30){logger[_0xcba4('0xe')](_0xcba4('0x1d'),_0x3bb2c9);logger['debug'](_0xcba4('0x1d'),_0x3bb2c9,JSON['stringify'](_0x5e6a30));_0x5c3acb(_0x5e6a30);})[_0xcba4('0x16')](function(_0x2680d3){logger[_0xcba4('0x12')]('UpdateOpenchannelApplication',_0x2680d3[_0xcba4('0x14')],_0x3bb2c9);_0x5e21b4(_0x5384ae[_0xcba4('0x12')](0x1f4,_0x2680d3[_0xcba4('0x14')]));});});}; \ No newline at end of file +var _0xba73=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','OpenchannelApplication','body','options','where','attributes','limit','debug','UpdateOpenchannelApplication','stringify'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xba73,0x1dc));var _0x3ba7=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xba73[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x3ba7('0x0'));var util=require('util');var moment=require(_0x3ba7('0x1'));var BPromise=require(_0x3ba7('0x2'));var rs=require(_0x3ba7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ba7('0x4'))['db'];var utils=require(_0x3ba7('0x5'));var logger=require(_0x3ba7('0x6'))('rpc');var config=require(_0x3ba7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3ba7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd6501,_0x639887,_0xc2f8f){return new BPromise(function(_0x2a505d,_0x34d010){return client[_0x3ba7('0x9')](_0xfd6501,_0xc2f8f)[_0x3ba7('0xa')](function(_0x4232d0){logger['info'](_0x3ba7('0xb'),_0x639887,_0x3ba7('0xc'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x639887,_0x3ba7('0xc'),JSON['stringify'](_0x4232d0));if(_0x4232d0[_0x3ba7('0xd')]){if(_0x4232d0['error'][_0x3ba7('0xe')]===0x1f4){logger['error'](_0x3ba7('0xb'),_0x639887,_0x4232d0['error'][_0x3ba7('0xf')]);return _0x34d010(_0x4232d0['error']['message']);}logger[_0x3ba7('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x639887,_0x4232d0[_0x3ba7('0xd')]['message']);return _0x2a505d(_0x4232d0[_0x3ba7('0xd')][_0x3ba7('0xf')]);}else{logger[_0x3ba7('0x10')](_0x3ba7('0xb'),_0x639887,_0x3ba7('0xc'));_0x2a505d(_0x4232d0[_0x3ba7('0x11')]['message']);}})[_0x3ba7('0x12')](function(_0x52d2fb){logger[_0x3ba7('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x639887,_0x52d2fb);_0x34d010(_0x52d2fb);});});}exports['UpdateOpenchannelApplication']=function(_0x2a04bb){var _0x5644b3=this;return new Promise(function(_0x3c6aff,_0x2885eb){return db[_0x3ba7('0x13')]['update'](_0x2a04bb[_0x3ba7('0x14')],{'raw':_0x2a04bb[_0x3ba7('0x15')]?_0x2a04bb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a04bb[_0x3ba7('0x15')]?_0x2a04bb[_0x3ba7('0x15')][_0x3ba7('0x16')]||null:null,'attributes':_0x2a04bb[_0x3ba7('0x15')]?_0x2a04bb['options'][_0x3ba7('0x17')]||null:null,'limit':_0x2a04bb[_0x3ba7('0x15')]?_0x2a04bb['options'][_0x3ba7('0x18')]||null:null})['then'](function(_0x4d590a){logger[_0x3ba7('0x10')]('UpdateOpenchannelApplication',_0x2a04bb);logger[_0x3ba7('0x19')](_0x3ba7('0x1a'),_0x2a04bb,JSON[_0x3ba7('0x1b')](_0x4d590a));_0x3c6aff(_0x4d590a);})[_0x3ba7('0x12')](function(_0x151fd0){logger['error']('UpdateOpenchannelApplication',_0x151fd0['message'],_0x2a04bb);_0x2885eb(_0x5644b3[_0x3ba7('0xd')](0x1f4,_0x151fd0[_0x3ba7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 48d6810..c0cca1b 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 _0x17d5=['/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','getMessages'];(function(_0x44caf2,_0x8ffb16){var _0x25978d=function(_0x1a2e61){while(--_0x1a2e61){_0x44caf2['push'](_0x44caf2['shift']());}};_0x25978d(++_0x8ffb16);}(_0x17d5,0x1f1));var _0x517d=function(_0x4aa654,_0x5098ac){_0x4aa654=_0x4aa654-0x0;var _0xca2dde=_0x17d5[_0x4aa654];return _0xca2dde;};'use strict';var multer=require(_0x517d('0x0'));var util=require(_0x517d('0x1'));var path=require('path');var timeout=require(_0x517d('0x2'));var express=require(_0x517d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x517d('0x4'));var interaction=require(_0x517d('0x5'));var config=require(_0x517d('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x517d('0x7')]('/',auth['isAuthenticated'](),controller[_0x517d('0x8')]);router['get'](_0x517d('0x9'),auth['isAuthenticated'](),controller[_0x517d('0xa')]);router['get'](_0x517d('0xb'),auth[_0x517d('0xc')](),controller[_0x517d('0xd')]);router[_0x517d('0x7')]('/:id/messages',auth[_0x517d('0xc')](),controller[_0x517d('0xe')]);router[_0x517d('0x7')](_0x517d('0xf'),auth['isAuthenticated'](),controller[_0x517d('0x10')]);router[_0x517d('0x11')]('/',auth[_0x517d('0xc')](),controller[_0x517d('0x12')]);router[_0x517d('0x11')](_0x517d('0x13'),auth[_0x517d('0xc')](),controller[_0x517d('0x14')]);router[_0x517d('0x11')](_0x517d('0x15'),auth[_0x517d('0xc')](),interaction[_0x517d('0x16')](_0x517d('0x17'),'openchannelinteraction:addtags'),controller[_0x517d('0x18')]);router[_0x517d('0x19')](_0x517d('0xb'),auth[_0x517d('0xc')](),interaction['tracked']('openchannel',_0x517d('0x1a')),controller[_0x517d('0x1b')]);router[_0x517d('0x1c')](_0x517d('0xb'),auth[_0x517d('0xc')](),interaction[_0x517d('0x16')]('openchannel',_0x517d('0x1d')),controller['destroy']);router[_0x517d('0x1c')](_0x517d('0x15'),auth[_0x517d('0xc')](),controller[_0x517d('0x1e')]);module[_0x517d('0x1f')]=router; \ No newline at end of file +var _0x171e=['openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put'];(function(_0x386739,_0x3940e0){var _0x31480c=function(_0x4e8ea8){while(--_0x4e8ea8){_0x386739['push'](_0x386739['shift']());}};_0x31480c(++_0x3940e0);}(_0x171e,0x79));var _0xe171=function(_0x5c7e8d,_0x1452cf){_0x5c7e8d=_0x5c7e8d-0x0;var _0x21ca1b=_0x171e[_0x5c7e8d];return _0x21ca1b;};'use strict';var multer=require(_0xe171('0x0'));var util=require(_0xe171('0x1'));var path=require(_0xe171('0x2'));var timeout=require(_0xe171('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe171('0x4'));var auth=require(_0xe171('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe171('0x6'));var controller=require(_0xe171('0x7'));router[_0xe171('0x8')]('/',auth[_0xe171('0x9')](),controller['index']);router[_0xe171('0x8')]('/describe',auth[_0xe171('0x9')](),controller[_0xe171('0xa')]);router['get'](_0xe171('0xb'),auth['isAuthenticated'](),controller[_0xe171('0xc')]);router[_0xe171('0x8')](_0xe171('0xd'),auth['isAuthenticated'](),controller[_0xe171('0xe')]);router[_0xe171('0x8')]('/:id/download',auth[_0xe171('0x9')](),controller['download']);router[_0xe171('0xf')]('/',auth[_0xe171('0x9')](),controller[_0xe171('0x10')]);router[_0xe171('0xf')](_0xe171('0xd'),auth[_0xe171('0x9')](),controller[_0xe171('0x11')]);router['post'](_0xe171('0x12'),auth[_0xe171('0x9')](),interaction[_0xe171('0x13')](_0xe171('0x14'),_0xe171('0x15')),controller[_0xe171('0x16')]);router[_0xe171('0x17')](_0xe171('0xb'),auth[_0xe171('0x9')](),interaction['tracked'](_0xe171('0x14'),_0xe171('0x18')),controller[_0xe171('0x19')]);router[_0xe171('0x1a')](_0xe171('0xb'),auth[_0xe171('0x9')](),interaction[_0xe171('0x13')](_0xe171('0x14'),_0xe171('0x1b')),controller[_0xe171('0x1c')]);router[_0xe171('0x1a')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index bb4bc14..706449f 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 _0x3a42=['BOOLEAN','DATE','STRING','out','sequelize','exports'];(function(_0x22fa84,_0xb10495){var _0x3ccb1e=function(_0xfbcd88){while(--_0xfbcd88){_0x22fa84['push'](_0x22fa84['shift']());}};_0x3ccb1e(++_0xb10495);}(_0x3a42,0x19c));var _0x23a4=function(_0x305542,_0x4b921a){_0x305542=_0x305542-0x0;var _0x413821=_0x3a42[_0x305542];return _0x413821;};'use strict';var Sequelize=require(_0x23a4('0x0'));module[_0x23a4('0x1')]={'closed':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x23a4('0x3')]},'disposition':{'type':Sequelize[_0x23a4('0x4')]},'secondDisposition':{'type':Sequelize[_0x23a4('0x4')]},'thirdDisposition':{'type':Sequelize[_0x23a4('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x23a4('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x23a4('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x23a4('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x23a4('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x23a4('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x2dab=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4bc428,_0xf56dd9){var _0x3ca37f=function(_0x39db20){while(--_0x39db20){_0x4bc428['push'](_0x4bc428['shift']());}};_0x3ca37f(++_0xf56dd9);}(_0x2dab,0x120));var _0xb2da=function(_0x5122b3,_0xf855d0){_0x5122b3=_0x5122b3-0x0;var _0x54dcf7=_0x2dab[_0x5122b3];return _0x54dcf7;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'closed':{'type':Sequelize[_0xb2da('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2da('0x3')]},'disposition':{'type':Sequelize[_0xb2da('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb2da('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb2da('0x3')]},'threadId':{'type':Sequelize[_0xb2da('0x4')]},'externalUrl':{'type':Sequelize[_0xb2da('0x4')]},'lastMsgAt':{'type':Sequelize[_0xb2da('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb2da('0x5')]('in',_0xb2da('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb2da('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3d01497..1e81cd5 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 _0x6e1c=['set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','forEach','push','then','catch','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','field','color','from','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','type','some','compact','isEmpty','OpenchannelAccountId','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','OpenchannelInteraction','unreadMessages','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','keys','includeAll','merge','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','sort','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','User','firstName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','disposition','threadId','Public','Private','createReadStream','pipe','createWriteStream','basename','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelInteraction.socket','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x43c0ff,_0x45f0f2){var _0x295b68=function(_0x1dd0cd){while(--_0x1dd0cd){_0x43c0ff['push'](_0x43c0ff['shift']());}};_0x295b68(++_0x45f0f2);}(_0x6e1c,0x1d2));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc6e1('0x0'));var rimraf=require(_0xc6e1('0x1'));var zipdir=require(_0xc6e1('0x2'));var jsonpatch=require(_0xc6e1('0x3'));var rp=require(_0xc6e1('0x4'));var moment=require(_0xc6e1('0x5'));var BPromise=require(_0xc6e1('0x6'));var Mustache=require('mustache');var util=require(_0xc6e1('0x7'));var path=require(_0xc6e1('0x8'));var sox=require(_0xc6e1('0x9'));var csv=require(_0xc6e1('0xa'));var ejs=require(_0xc6e1('0xb'));var fs=require('fs');var fs_extra=require(_0xc6e1('0xc'));var _=require(_0xc6e1('0xd'));var squel=require(_0xc6e1('0xe'));var crypto=require(_0xc6e1('0xf'));var jsforce=require(_0xc6e1('0x10'));var deskjs=require(_0xc6e1('0x11'));var toCsv=require(_0xc6e1('0xa'));var querystring=require(_0xc6e1('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc6e1('0x13'));var as=require(_0xc6e1('0x14'));var pdf=require(_0xc6e1('0x15'));var hardwareService=require(_0xc6e1('0x16'));var logger=require(_0xc6e1('0x17'))('api');var utils=require(_0xc6e1('0x18'));var config=require(_0xc6e1('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc6e1('0x1a')]=_[_0xc6e1('0x1b')](config[_0xc6e1('0x1a')],{'host':_0xc6e1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6e1('0x1a')]));require(_0xc6e1('0x1d'))['register'](socket);function respondWithStatusCode(_0x490245,_0x14a8eb){_0x14a8eb=_0x14a8eb||0xcc;return function(_0x2cddfe){if(_0x2cddfe){return _0x490245[_0xc6e1('0x1e')](_0x14a8eb);}return _0x490245['status'](_0x14a8eb)[_0xc6e1('0x1f')]();};}function respondWithResult(_0x4fd7df,_0x4f5d0a){_0x4f5d0a=_0x4f5d0a||0xc8;return function(_0x292cc3){if(_0x292cc3){return _0x4fd7df['status'](_0x4f5d0a)[_0xc6e1('0x20')](_0x292cc3);}};}function respondWithFilteredResult(_0xdaae18,_0x21c0be){return function(_0x53f995){if(_0x53f995){var _0x4ebbff=typeof _0x21c0be[_0xc6e1('0x21')]===_0xc6e1('0x22')&&typeof _0x21c0be[_0xc6e1('0x23')]===_0xc6e1('0x22');var _0x44bb39=_0x53f995[_0xc6e1('0x24')];var _0xb2bfff=_0x4ebbff?0x0:_0x21c0be[_0xc6e1('0x21')];var _0x50368f=_0x4ebbff?_0x53f995['count']:_0x21c0be[_0xc6e1('0x21')]+_0x21c0be[_0xc6e1('0x23')];var _0x783055;if(_0x50368f>=_0x44bb39){_0x50368f=_0x44bb39;_0x783055=0xc8;}else{_0x783055=0xce;}_0xdaae18[_0xc6e1('0x25')](_0x783055);return _0xdaae18[_0xc6e1('0x26')](_0xc6e1('0x27'),_0xb2bfff+'-'+_0x50368f+'/'+_0x44bb39)['json'](_0x53f995);}return null;};}function patchUpdates(_0x18279d){return function(_0x3714bc){try{jsonpatch[_0xc6e1('0x28')](_0x3714bc,_0x18279d,!![]);}catch(_0x1c9842){return BPromise[_0xc6e1('0x29')](_0x1c9842);}return _0x3714bc[_0xc6e1('0x2a')]();};}function saveUpdates(_0x49d651,_0x3ef9fd){return function(_0x11f4d0){if(_0x11f4d0){return _0x11f4d0[_0xc6e1('0x2b')](_0x49d651)['then'](function(_0x5a8621){return _0x5a8621;});}return null;};}function removeEntity(_0x48fb91,_0x38cad9){return function(_0x175240){if(_0x175240){return _0x175240[_0xc6e1('0x2c')]()['then'](function(){_0x48fb91[_0xc6e1('0x25')](0xcc)[_0xc6e1('0x1f')]();});}};}function handleEntityNotFound(_0x28c7ff,_0x2dd3db){return function(_0x2063ba){if(!_0x2063ba){_0x28c7ff['sendStatus'](0x194);}return _0x2063ba;};}function handleError(_0x3dfc3a,_0x1d57c1){_0x1d57c1=_0x1d57c1||0x1f4;return function(_0x564ffc){logger[_0xc6e1('0x2d')](_0x564ffc[_0xc6e1('0x2e')]);if(_0x564ffc[_0xc6e1('0x2f')]){delete _0x564ffc['name'];}_0x3dfc3a[_0xc6e1('0x25')](_0x1d57c1)[_0xc6e1('0x30')](_0x564ffc);};}function getInteractionUsers(_0x55e4b5,_0x23ce4e){return new BPromise(function(_0x544b31,_0x18de83){try{if(_0x23ce4e[_0x55e4b5['id']]){_0x55e4b5[_0xc6e1('0x31')]=_['map'](_0x23ce4e[_0x55e4b5['id']],function(_0x2f6779){return{'id':_0x2f6779['id'],'fullname':_0x2f6779[_0xc6e1('0x32')]};});}}catch(_0x538c90){_0x18de83(_0x538c90);}_0x544b31(_0x55e4b5);});}function getInteractionTags(_0x58084a,_0x16bc04){return new BPromise(function(_0x536275,_0x590b74){try{if(_0x58084a[_0xc6e1('0x33')]){_0x58084a[_0xc6e1('0x34')]=[];_0x58084a['TagIds']['split'](',')[_0xc6e1('0x35')](function(_0xea5993){_0x58084a['Tags'][_0xc6e1('0x36')](_0x16bc04[_0xea5993]);});}delete _0x58084a[_0xc6e1('0x33')];}catch(_0x1874fe){_0x590b74(_0x1874fe);}_0x536275(_0x58084a);});}function updateOpenchannelInteraction(_0x26eb0e,_0x5c1688,_0x185482){return new BPromise(function(_0x5b07e6,_0x288809){return getInteractionUsers(_0x26eb0e,_0x185482)[_0xc6e1('0x37')](function(_0x3eace7){return getInteractionTags(_0x3eace7,_0x5c1688);})[_0xc6e1('0x37')](function(_0xb319ed){_0x5b07e6(_0xb319ed);})[_0xc6e1('0x38')](function(_0x59da6d){_0x288809(_0x59da6d);});});}exports[_0xc6e1('0x39')]=function(_0x572595,_0x2a611a){var _0x586d8b={},_0x2c5343={},_0x1d64a2={'count':0x0,'rows':[]};var _0x5f3723=_[_0xc6e1('0x3a')](db['OpenchannelInteraction'][_0xc6e1('0x3b')],function(_0x1ecd48){return{'name':_0x1ecd48[_0xc6e1('0x3c')],'type':_0x1ecd48['type'][_0xc6e1('0x3d')]};});_0x2c5343['model']=_[_0xc6e1('0x3a')](_0x5f3723,_0xc6e1('0x2f'));_0x2c5343[_0xc6e1('0x3e')]=_['keys'](_0x572595[_0xc6e1('0x3e')]);_0x2c5343[_0xc6e1('0x3f')]=_[_0xc6e1('0x40')](_0x2c5343[_0xc6e1('0x41')],_0x2c5343[_0xc6e1('0x3e')]);_0x586d8b[_0xc6e1('0x42')]=_[_0xc6e1('0x40')](_0x2c5343['model'],qs[_0xc6e1('0x43')](_0x572595[_0xc6e1('0x3e')]['fields']));_0x586d8b[_0xc6e1('0x42')]=_0x586d8b[_0xc6e1('0x42')][_0xc6e1('0x44')]?_0x586d8b[_0xc6e1('0x42')]:_0x2c5343['model'];if(!_0x572595['query'][_0xc6e1('0x45')](_0xc6e1('0x46'))){_0x586d8b[_0xc6e1('0x23')]=qs['limit'](_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x23')]);_0x586d8b[_0xc6e1('0x21')]=qs['offset'](_0x572595['query']['offset']);}_0x586d8b[_0xc6e1('0x47')]=qs['sort'](_0x572595[_0xc6e1('0x3e')]['sort']);_0x586d8b[_0xc6e1('0x48')]=qs['filters'](_[_0xc6e1('0x49')](_0x572595[_0xc6e1('0x3e')],_0x2c5343['filters']),_0x5f3723);var _0x78fb33=[];var _0x4c4038=squel['select']()[_0xc6e1('0x4a')]('id')[_0xc6e1('0x4a')]('name')[_0xc6e1('0x4a')](_0xc6e1('0x4b'))[_0xc6e1('0x4c')]('tools_tags');var _0x526285=squel[_0xc6e1('0x4d')]()[_0xc6e1('0x4a')]('u.id')['field'](_0xc6e1('0x4e'))[_0xc6e1('0x4a')](_0xc6e1('0x4f'))[_0xc6e1('0x4c')](_0xc6e1('0x50'),'ui')[_0xc6e1('0x51')](_0xc6e1('0x52'),'u',_0xc6e1('0x53'));var _0x543eec=squel[_0xc6e1('0x4d')]()[_0xc6e1('0x4c')]('openchannel_interactions','i')[_0xc6e1('0x51')](_0xc6e1('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc6e1('0x51')](_0xc6e1('0x52'),'o',_0xc6e1('0x55'))['left_join'](_0xc6e1('0x56'),'a',_0xc6e1('0x57'))[_0xc6e1('0x51')](_0xc6e1('0x58'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xc6e1('0x59'),'it',_0xc6e1('0x5a'))[_0xc6e1('0x51')](_0xc6e1('0x5b'),'t',_0xc6e1('0x5c'));var _0x1669c0=squel[_0xc6e1('0x5d')]();var _0x2d6752=[];var _0x11fb18=squel[_0xc6e1('0x5d')]();var _0x58e9b7;if(_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x5e')]){_0x58e9b7=as[_0xc6e1('0x5f')](_0x572595['query'][_0xc6e1('0x5e')]);var _0x4d1328=_0x58e9b7[_0xc6e1('0x60')];for(var _0x143900=0x0;_0x143900<_0x58e9b7['conditions'][_0xc6e1('0x44')];_0x143900++){var _0x4db32e=_0x58e9b7[_0xc6e1('0x61')][_0x143900];var _0x4676c6='i';var _0x1ec7b6=_[_0xc6e1('0x62')](_0x5f3723,[_0xc6e1('0x2f'),_0x4db32e[_0xc6e1('0x4a')]]);if(!_0x1ec7b6){switch(_0x4db32e[_0xc6e1('0x4a')]){case'unreadMessages':if(_0x4db32e[_0xc6e1('0x63')]==0x1){_0x543eec[_0xc6e1('0x64')]('`'+_0x4db32e['field']+_0xc6e1('0x65'));}else{_0x543eec[_0xc6e1('0x64')]('`'+_0x4db32e['field']+_0xc6e1('0x66'));}break;case _0xc6e1('0x67'):if(_0x4db32e[_0xc6e1('0x68')]===_0xc6e1('0x69')){if(_0x4db32e[_0xc6e1('0x63')][_0xc6e1('0x6a')]('\x20')[_0xc6e1('0x44')]>0x1){_0x1669c0[_0x4d1328](_0xc6e1('0x6b'),qs['getFullTextValue'](_0x4db32e[_0xc6e1('0x63')]),null);}else{var _0x280482='%'+_0x4db32e[_0xc6e1('0x63')]+'%';_0x1669c0[_0x4d1328]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x280482,_0x280482,_0x280482);}}else{_0x1ec7b6=_[_0xc6e1('0x62')](_0x5f3723,[_0xc6e1('0x2f'),'ContactId']);_0x4db32e['field']=_0xc6e1('0x6c');_0x107011=as[_0xc6e1('0x6d')](_0x4676c6,_0x1ec7b6['type'],_0x4db32e);_0x1669c0[_0x4d1328](_0x107011['text'],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x6e')],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x1f')]);}break;case _0xc6e1('0x6f'):var _0x306a1b=_0x4db32e[_0xc6e1('0x63')][_0xc6e1('0x6a')](',')[_0xc6e1('0x3a')](function(_0x7ee8a8){return Number(_0x7ee8a8);});_0x306a1b['forEach'](function(_0x36fbd4){_0x11fb18['or'](_0xc6e1('0x70'),'%,'+_0x36fbd4+',%');});_0x2d6752=_[_0xc6e1('0x71')](_0x2d6752,_0x306a1b);break;case'User':if(_0x4db32e[_0xc6e1('0x68')]===_0xc6e1('0x69')){_0x1669c0[_0x4d1328](_0xc6e1('0x72'),'%'+_0x4db32e[_0xc6e1('0x63')]+'%',null);}else{_0x1ec7b6=_['find'](_0x5f3723,[_0xc6e1('0x2f'),_0xc6e1('0x73')]);_0x4db32e['field']=_0xc6e1('0x73');_0x107011=as[_0xc6e1('0x6d')](_0x4676c6,_0x1ec7b6['type'],_0x4db32e);_0x1669c0[_0x4d1328](_0x107011[_0xc6e1('0x74')],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x6e')],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x1f')]);}break;case'body':_0x107011=as[_0xc6e1('0x6d')]('me',null,_0x4db32e);_0x1669c0[_0x4d1328](_0x107011[_0xc6e1('0x74')],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x6e')],_0x107011['value']['end']);break;}}else{var _0x107011=as[_0xc6e1('0x6d')](_0x4676c6,_0x1ec7b6[_0xc6e1('0x75')],_0x4db32e);_0x1669c0[_0x4d1328](_0x107011['text'],_0x107011[_0xc6e1('0x63')]['start'],_0x107011[_0xc6e1('0x63')][_0xc6e1('0x1f')]);}}}else{var _0x42380f=_(_0x572595[_0xc6e1('0x3e')])['keys']()[_0xc6e1('0x3a')](function(_0xc94c6b){return _[_0xc6e1('0x76')](_0x5f3723,['name',_0xc94c6b])?_0xc94c6b:undefined;})[_0xc6e1('0x77')]()[_0xc6e1('0x63')]();if(!_[_0xc6e1('0x78')](_0x42380f)){_0x42380f[_0xc6e1('0x35')](function(_0x447d2b){if(_0x447d2b===_0xc6e1('0x79')){_0x543eec[_0xc6e1('0x48')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x572595['query'][_0x447d2b]));}else if(_0x447d2b===_0xc6e1('0x7a')){var _0x5805a8=JSON['parse'](_0x572595[_0xc6e1('0x3e')][_0x447d2b])[_0xc6e1('0x7b')];var _0x2af837=JSON[_0xc6e1('0x7c')](_0x572595[_0xc6e1('0x3e')][_0x447d2b])['$lte'];_0x543eec[_0xc6e1('0x48')](_0xc6e1('0x7d'),_0x5805a8,_0x2af837);}else{if(_0x572595['query'][_0x447d2b]===_0xc6e1('0x7e')){_0x543eec[_0xc6e1('0x48')]('i.'+_0x447d2b+_0xc6e1('0x7f'));}else{_0x543eec[_0xc6e1('0x48')]('i.'+_0x447d2b+_0xc6e1('0x80'),_0x572595[_0xc6e1('0x3e')][_0x447d2b]);}}});}if(_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x81')]){if(_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x81')]==0x1){_0x543eec[_0xc6e1('0x64')](_0xc6e1('0x82'));}else{_0x543eec['having'](_0xc6e1('0x83'));}}if(_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x84')]){_0x2d6752=_['isArray'](_0x572595[_0xc6e1('0x3e')]['tag'])?_0x572595[_0xc6e1('0x3e')]['tag']:new Array(_0x572595[_0xc6e1('0x3e')]['tag']);_0x2d6752[_0xc6e1('0x35')](function(_0x7198f3){_0x11fb18['or'](_0xc6e1('0x70'),'%,'+_0x7198f3+',%');});}if(_0x572595['query'][_0xc6e1('0x85')]){var _0x109ae9=_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x85')][_0xc6e1('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc6e1('0x87')](_0x109ae9)){_0x1669c0['or'](_0xc6e1('0x88'),_0x109ae9+'%');}else{_0x1669c0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x109ae9))['or'](_0xc6e1('0x89'),_0x109ae9+'%')['or'](_0xc6e1('0x8a'),_0x109ae9+'%');}}}_0x543eec['where'](_0x1669c0);_0x543eec[_0xc6e1('0x8b')](_0xc6e1('0x8c'));var _0x989ce3={'type':db[_0xc6e1('0x8d')][_0xc6e1('0x8e')][_0xc6e1('0x8f')],'raw':!![]};var _0x53ad44=_0x543eec[_0xc6e1('0x90')]();_0x53ad44[_0xc6e1('0x4a')]('i.id');_0x53ad44['field'](_0xc6e1('0x91'),'unreadMessages');if(_0x586d8b['order']){_0x586d8b[_0xc6e1('0x47')][_0xc6e1('0x35')](function(_0x2d3943){var _0x288757=_0x2d3943[0x0]===_0xc6e1('0x92')?_0x2d3943[0x0]:'i.'+_0x2d3943[0x0];_0x543eec[_0xc6e1('0x47')](_0x288757,_0x2d3943[0x1]===_0xc6e1('0x93')?![]:!![]);});}if(!_[_0xc6e1('0x78')](_0x2d6752)){_0x543eec[_0xc6e1('0x64')](_0x11fb18);_0x53ad44[_0xc6e1('0x48')](_0xc6e1('0x94'),_0x2d6752);}BPromise[_0xc6e1('0x95')]()[_0xc6e1('0x37')](function(){if(!_0x58e9b7){if(_0x572595[_0xc6e1('0x3e')]['OpenchannelAccountId'])return;_0x53ad44[_0xc6e1('0x48')](_0xc6e1('0x96'));_0x543eec[_0xc6e1('0x48')](_0xc6e1('0x96'));return;}if(_0x572595[_0xc6e1('0x97')][_0xc6e1('0x98')]!==_0xc6e1('0x99'))return;return _0x572595[_0xc6e1('0x97')][_0xc6e1('0x9a')]({'attributes':['id'],'raw':!![]})[_0xc6e1('0x37')](function(_0x12f1a9){if(_[_0xc6e1('0x78')](_0x12f1a9)){_0x53ad44[_0xc6e1('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x543eec[_0xc6e1('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x53ad44[_0xc6e1('0x48')](_0xc6e1('0x9b'),_[_0xc6e1('0x3a')](_0x12f1a9,'id'));_0x543eec[_0xc6e1('0x48')](_0xc6e1('0x9b'),_[_0xc6e1('0x3a')](_0x12f1a9,'id'));}});})[_0xc6e1('0x37')](function(){if(_0x572595['user'][_0xc6e1('0x98')]===_0xc6e1('0x99')&&!_0x58e9b7&&!_0x572595[_0xc6e1('0x3e')]['OpenchannelAccountId'])return[];return db[_0xc6e1('0x9c')][_0xc6e1('0x3e')](_0x53ad44[_0xc6e1('0x9d')](),_0x989ce3);})['then'](function(_0x2d7337){_0x1d64a2[_0xc6e1('0x24')]=_0x2d7337[_0xc6e1('0x44')];if(_0x1d64a2['count']===0x0)return[];return db[_0xc6e1('0x9c')][_0xc6e1('0x3e')](_0x4c4038[_0xc6e1('0x9d')](),_0x989ce3)['then'](function(_0x36f7f7){_0x78fb33=_[_0xc6e1('0x9e')](_0x36f7f7,'id');_0x989ce3=_['merge'](_0x989ce3,{'model':db[_0xc6e1('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x572595[_0xc6e1('0x3e')][_0xc6e1('0x43')]){_0x586d8b[_0xc6e1('0x42')][_0xc6e1('0x35')](function(_0x1ad70b){_0x543eec[_0xc6e1('0x4a')]('i.'+_0x1ad70b);});}else{_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0x91'),_0xc6e1('0xa0'));_0x543eec['field']('a.key',_0xc6e1('0xa1'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xa2'),'Account.mandatoryDisposition');_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xa3'),_0xc6e1('0x92'));_0x543eec['field'](_0xc6e1('0xa4'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xa5'),_0xc6e1('0xa6'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xa7'),_0xc6e1('0xa8'));_0x543eec['field'](_0xc6e1('0xa9'),_0xc6e1('0xaa'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xab'),_0xc6e1('0xac'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xad'),_0xc6e1('0xae'));_0x543eec['field'](_0xc6e1('0xaf'),_0xc6e1('0xb0'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xb1'),_0xc6e1('0xb2'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xb3'),_0xc6e1('0xb4'));_0x543eec[_0xc6e1('0x4a')](_0xc6e1('0xb5'),_0xc6e1('0x33'));}if(_0x586d8b[_0xc6e1('0x23')])_0x543eec[_0xc6e1('0x23')](_0x586d8b[_0xc6e1('0x23')]);if(_0x586d8b[_0xc6e1('0x21')])_0x543eec[_0xc6e1('0x21')](_0x586d8b[_0xc6e1('0x21')]);return db[_0xc6e1('0x9c')]['query'](_0x543eec['toString'](),_0x989ce3);})['then'](function(_0x49b680){if(_0x49b680[_0xc6e1('0x44')]>0x0)_0x526285[_0xc6e1('0x48')](_0xc6e1('0xb6'),_[_0xc6e1('0x3a')](_0x49b680,'id'));return db[_0xc6e1('0x9c')]['query'](_0x526285[_0xc6e1('0x9d')](),_0x989ce3)[_0xc6e1('0x37')](function(_0x1ca7c7){var _0x5318f4=_[_0xc6e1('0xb7')](_0x1ca7c7,_0xc6e1('0xb8'));var _0xc2a9d1=[];_0x49b680[_0xc6e1('0x35')](function(_0x259e3c){_0xc2a9d1[_0xc6e1('0x36')](updateOpenchannelInteraction(_0x259e3c,_0x78fb33,_0x5318f4));});return BPromise[_0xc6e1('0xb9')](_0xc2a9d1);});});})[_0xc6e1('0x37')](function(_0xce0819){_0x1d64a2[_0xc6e1('0xba')]=_0xce0819;return _0x1d64a2;})[_0xc6e1('0x37')](respondWithFilteredResult(_0x2a611a,_0x586d8b))[_0xc6e1('0x38')](handleError(_0x2a611a,null));};exports[_0xc6e1('0xbb')]=function(_0x365901,_0x4865c8){var _0x158a36={};if(_0x365901['query'][_0xc6e1('0x75')]&&_0x365901[_0xc6e1('0x3e')][_0xc6e1('0x75')]===_0xc6e1('0x4c')){_0x158a36[_0xc6e1('0x4c')]=_0x365901[_0xc6e1('0xbc')]['id'];}else{_0x158a36['id']=_0x365901[_0xc6e1('0xbc')]['id'];}var _0x285ba1={'raw':![],'where':_0x158a36},_0x3e1a6f={};_0x3e1a6f[_0xc6e1('0x41')]=_['keys'](db[_0xc6e1('0x9f')]['rawAttributes']);_0x3e1a6f[_0xc6e1('0x3e')]=_[_0xc6e1('0xbd')](_0x365901[_0xc6e1('0x3e')]);_0x3e1a6f[_0xc6e1('0x3f')]=_[_0xc6e1('0x40')](_0x3e1a6f[_0xc6e1('0x41')],_0x3e1a6f[_0xc6e1('0x3e')]);_0x285ba1[_0xc6e1('0x42')]=_['intersection'](_0x3e1a6f[_0xc6e1('0x41')],qs[_0xc6e1('0x43')](_0x365901[_0xc6e1('0x3e')]['fields']));_0x285ba1[_0xc6e1('0x42')]=_0x285ba1['attributes']['length']?_0x285ba1[_0xc6e1('0x42')]:_0x3e1a6f['model'];if(_0x365901[_0xc6e1('0x3e')][_0xc6e1('0xbe')]){_0x285ba1['include']=[{'all':!![]}];}_0x285ba1=_[_0xc6e1('0xbf')]({},_0x285ba1,_0x365901[_0xc6e1('0xc0')]);return db['OpenchannelInteraction']['find'](_0x285ba1)[_0xc6e1('0x37')](handleEntityNotFound(_0x4865c8,null))[_0xc6e1('0x37')](respondWithResult(_0x4865c8,null))['catch'](handleError(_0x4865c8,null));};exports[_0xc6e1('0xc1')]=function(_0x227363,_0x4847b7){return db[_0xc6e1('0x9f')][_0xc6e1('0xc1')](_0x227363[_0xc6e1('0xc2')],{})[_0xc6e1('0x37')](respondWithResult(_0x4847b7,0xc9))[_0xc6e1('0x38')](handleError(_0x4847b7,null));};exports[_0xc6e1('0x2b')]=function(_0x506f04,_0x26b808){if(_0x506f04[_0xc6e1('0xc2')]['id']){delete _0x506f04['body']['id'];}return db[_0xc6e1('0x9f')][_0xc6e1('0x62')]({'where':{'id':_0x506f04[_0xc6e1('0xbc')]['id']}})[_0xc6e1('0x37')](handleEntityNotFound(_0x26b808,null))[_0xc6e1('0x37')](saveUpdates(_0x506f04['body'],null))['then'](respondWithResult(_0x26b808,null))[_0xc6e1('0x38')](handleError(_0x26b808,null));};exports['destroy']=function(_0x4ec3c0,_0x183a13){return db[_0xc6e1('0x9f')][_0xc6e1('0x62')]({'where':{'id':_0x4ec3c0['params']['id']}})[_0xc6e1('0x37')](handleEntityNotFound(_0x183a13,null))['then'](removeEntity(_0x183a13,null))[_0xc6e1('0x38')](handleError(_0x183a13,null));};exports['describe']=function(_0x53b2a7,_0x126ab0){return db['OpenchannelInteraction'][_0xc6e1('0xc3')]()['then'](respondWithResult(_0x126ab0,null))[_0xc6e1('0x38')](handleError(_0x126ab0,null));};exports[_0xc6e1('0xc4')]=function(_0x17b2bc,_0x436706,_0x1cddf4){return db['OpenchannelMessage'][_0xc6e1('0x62')]({'where':{'id':_0x17b2bc[_0xc6e1('0xbc')]['id']}})['then'](handleEntityNotFound(_0x436706,null))[_0xc6e1('0x37')](function(_0x401f83){if(_0x401f83){return _0x401f83[_0xc6e1('0xc4')](_0x17b2bc[_0xc6e1('0xc2')][_0xc6e1('0xc5')],_[_0xc6e1('0xc6')](_0x17b2bc[_0xc6e1('0xc2')],[_0xc6e1('0xc5'),'id'])||{});}})[_0xc6e1('0x37')](respondWithResult(_0x436706,null))[_0xc6e1('0x38')](handleError(_0x436706,null));};exports[_0xc6e1('0xc7')]=function(_0x2c7a3f,_0x53b9b2,_0x5e170c){var _0x175897={'raw':![],'where':{}};var _0x2518ea={};var _0x2bc556={'count':0x0,'rows':[]};return db[_0xc6e1('0x9f')][_0xc6e1('0xc8')]({'where':{'id':_0x2c7a3f['params']['id']}})[_0xc6e1('0x37')](handleEntityNotFound(_0x53b9b2,null))[_0xc6e1('0x37')](function(_0x2a3633){if(_0x2a3633){_0x2518ea['model']=_[_0xc6e1('0xbd')](db[_0xc6e1('0xc9')]['rawAttributes']);_0x2518ea[_0xc6e1('0x3e')]=_['keys'](_0x2c7a3f['query']);_0x2518ea[_0xc6e1('0x3f')]=_[_0xc6e1('0x40')](_0x2518ea['model'],_0x2518ea[_0xc6e1('0x3e')]);_0x175897[_0xc6e1('0x42')]=_['intersection'](_0x2518ea['model'],qs[_0xc6e1('0x43')](_0x2c7a3f['query'][_0xc6e1('0x43')]));_0x175897[_0xc6e1('0x42')]=_0x175897[_0xc6e1('0x42')][_0xc6e1('0x44')]?_0x175897[_0xc6e1('0x42')]:_0x2518ea[_0xc6e1('0x41')];if(!_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x45')]('nolimit')){_0x175897['limit']=qs['limit'](_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x23')]);_0x175897[_0xc6e1('0x21')]=qs[_0xc6e1('0x21')](_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x21')]);}_0x175897[_0xc6e1('0x47')]=qs[_0xc6e1('0xca')](_0x2c7a3f['query']['sort']);_0x175897[_0xc6e1('0x48')]=qs[_0xc6e1('0x3f')](_['pick'](_0x2c7a3f['query'],_0x2518ea[_0xc6e1('0x3f')]));_0x175897[_0xc6e1('0x48')]['OpenchannelInteractionId']=_0x2a3633['id'];if(_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x85')]){_0x175897[_0xc6e1('0x48')]=_['merge'](_0x175897[_0xc6e1('0x48')],{'$or':_[_0xc6e1('0x3a')](_0x175897[_0xc6e1('0x42')],function(_0x1e8471){var _0x10612f={};_0x10612f[_0x1e8471]={'$like':'%'+_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x85')]+'%'};return _0x10612f;})});}if(_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0x7b')]){var _0x8dfc32=_0x2c7a3f['query'][_0xc6e1('0x7b')][_0xc6e1('0x6a')](',');var _0x2160b0={};_0x2160b0[_0x8dfc32[0x0]]={'$gte':moment(_0x8dfc32[0x1])[_0xc6e1('0xcb')](_0xc6e1('0xcc'))};_0x175897[_0xc6e1('0x48')]=_[_0xc6e1('0xbf')](_0x175897[_0xc6e1('0x48')],_0x2160b0);}_0x175897=_[_0xc6e1('0xbf')]({},_0x175897,_0x2c7a3f[_0xc6e1('0xc0')]);return db[_0xc6e1('0xc9')][_0xc6e1('0x24')]({'where':_0x175897[_0xc6e1('0x48')]})[_0xc6e1('0x37')](function(_0x2f8178){_0x2bc556[_0xc6e1('0x24')]=_0x2f8178;if(_0x2c7a3f[_0xc6e1('0x3e')][_0xc6e1('0xbe')]){_0x175897[_0xc6e1('0xcd')]=[{'all':!![]}];}return db[_0xc6e1('0xc9')][_0xc6e1('0xce')](_0x175897);})[_0xc6e1('0x37')](function(_0x533815){_0x2bc556[_0xc6e1('0xba')]=_0x533815;return _0x2bc556;});}})[_0xc6e1('0x37')](respondWithFilteredResult(_0x53b9b2,_0x175897))[_0xc6e1('0x38')](handleError(_0x53b9b2,null));};exports[_0xc6e1('0xcf')]=function(_0x141945,_0x2281da,_0x28fb64){return db[_0xc6e1('0x9f')][_0xc6e1('0x62')]({'where':{'id':_0x141945['params']['id']}})[_0xc6e1('0x37')](handleEntityNotFound(_0x2281da,null))[_0xc6e1('0x37')](function(_0x1638ba){if(_0x1638ba){return _0x1638ba['setTags'](_0x141945['body']['ids'],_[_0xc6e1('0xc6')](_0x141945[_0xc6e1('0xc2')],[_0xc6e1('0xc5'),'id'])||{})['spread'](function(){return db[_0xc6e1('0x6f')][_0xc6e1('0xce')]({'attributes':['id','name','color'],'where':{'id':_0x141945[_0xc6e1('0xc2')][_0xc6e1('0xc5')]}});})[_0xc6e1('0x37')](function(_0x46781d){socket[_0xc6e1('0xd0')](_0xc6e1('0xd1'),{'id':Number(_0x141945[_0xc6e1('0xbc')]['id']),'tags':_0x46781d||[]});return{'id':Number(_0x141945[_0xc6e1('0xbc')]['id']),'tags':_0x46781d||[]};});}})[_0xc6e1('0x37')](respondWithResult(_0x2281da,null))[_0xc6e1('0x38')](handleError(_0x2281da,null));};exports['removeTags']=function(_0x228f27,_0x591ca6,_0x39934a){return db[_0xc6e1('0x9f')]['find']({'where':{'id':_0x228f27[_0xc6e1('0xbc')]['id']}})[_0xc6e1('0x37')](handleEntityNotFound(_0x591ca6,null))[_0xc6e1('0x37')](function(_0x32743a){if(_0x32743a){return _0x32743a[_0xc6e1('0xd2')](_0x228f27[_0xc6e1('0x3e')][_0xc6e1('0xc5')]);}})[_0xc6e1('0x37')](respondWithStatusCode(_0x591ca6,null))[_0xc6e1('0x38')](handleError(_0x591ca6,null));};exports[_0xc6e1('0xd3')]=function(_0x203203,_0xba3d60){var _0x197a1b=moment()[_0xc6e1('0xd4')]()[_0xc6e1('0x9d')]();var _0x5d1ef8=path[_0xc6e1('0xd5')](config['root'],_0xc6e1('0xd6'),_0xc6e1('0xd7'),_0xc6e1('0xd8'));var _0x5a8419=path['join'](config[_0xc6e1('0xd9')],_0xc6e1('0xd6'),_0xc6e1('0xd7'),_0xc6e1('0xda'));var _0x2321bc=path['join'](_0x5d1ef8,_0x197a1b);var _0x52bedd=util[_0xc6e1('0xcb')](_0xc6e1('0xdb'),_0x203203['params']['id'],_0x197a1b);var _0x225b29=path[_0xc6e1('0xd5')](_0x5d1ef8,_0x52bedd);var _0x6415d9=[];_0x6415d9[_0xc6e1('0x36')]({'model':db[_0xc6e1('0xdc')],'as':_0xc6e1('0xdc'),'attributes':['id',_0xc6e1('0x32')],'raw':!![]});_0x6415d9['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xc6e1('0xdd'),'lastName'],'raw':!![]});if(_0x203203[_0xc6e1('0x3e')][_0xc6e1('0xda')]){_0x6415d9[_0xc6e1('0x36')]({'model':db[_0xc6e1('0xde')],'as':_0xc6e1('0xde'),'raw':!![]});}var _0x1b53eb=[{'model':db[_0xc6e1('0xc9')],'as':_0xc6e1('0xdf'),'attributes':['id','body','createdAt',_0xc6e1('0xe0'),_0xc6e1('0xe1'),_0xc6e1('0x81')],'include':_0x6415d9}];_0x1b53eb[_0xc6e1('0x36')]({'model':db[_0xc6e1('0xe2')],'as':_0xc6e1('0xe3'),'attributes':['id',_0xc6e1('0x2f')]});_0x1b53eb[_0xc6e1('0x36')]({'model':db['User'],'as':_0xc6e1('0xe4'),'attributes':['id',_0xc6e1('0x32')]});return db[_0xc6e1('0x9f')][_0xc6e1('0x62')]({'where':{'id':_0x203203[_0xc6e1('0xbc')]['id']},'include':_0x1b53eb})[_0xc6e1('0x37')](handleEntityNotFound(_0xba3d60,null))[_0xc6e1('0x37')](function(_0x282e32){if(_0x282e32){var _0xd9ab48=_0x282e32['get']({'plain':!![]});fs[_0xc6e1('0xe5')](_0x2321bc);var _0x56ca19={'channel':_0xc6e1('0xe6'),'account':_0xd9ab48[_0xc6e1('0xe3')][_0xc6e1('0x2f')],'agent':_0xd9ab48[_0xc6e1('0xe4')]?_0xd9ab48[_0xc6e1('0xe4')][_0xc6e1('0x32')]:_0xc6e1('0xe7'),'createdAt':moment(_0xd9ab48['createdAt'])[_0xc6e1('0xcb')](_0xc6e1('0xcc'))[_0xc6e1('0x9d')](),'closedAt':_0xd9ab48[_0xc6e1('0xe8')]?moment(_0xd9ab48['closedAt'])[_0xc6e1('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc6e1('0x9d')]():'','disposition':_0xd9ab48[_0xc6e1('0xe9')],'visibility':_0xd9ab48[_0xc6e1('0xea')]?_0xc6e1('0xeb'):_0xc6e1('0xec'),'messages':_(_0xd9ab48['Messages'])[_0xc6e1('0x85')]({'secret':![]})[_0xc6e1('0x3a')](function(_0x5baf2e){if(_0x5baf2e[_0xc6e1('0xde')]){var _0x4d3496=path[_0xc6e1('0xd5')](_0x5a8419,_0x5baf2e[_0xc6e1('0xde')]['basename']);if(fs['existsSync'](_0x4d3496)){fs[_0xc6e1('0xed')](_0x4d3496)[_0xc6e1('0xee')](fs[_0xc6e1('0xef')](path[_0xc6e1('0xd5')](_0x2321bc,_0x5baf2e[_0xc6e1('0xde')][_0xc6e1('0xf0')])));}}return{'date':moment(_0x5baf2e[_0xc6e1('0x7a')])[_0xc6e1('0xcb')](_0xc6e1('0xcc'))[_0xc6e1('0x9d')](),'sender':_0x5baf2e[_0xc6e1('0xe0')]===_0xc6e1('0xf1')?_0x5baf2e[_0xc6e1('0xdc')]?_0x5baf2e[_0xc6e1('0xdc')][_0xc6e1('0x32')]:'System':_0x5baf2e[_0xc6e1('0x67')][_0xc6e1('0xdd')]+(_0x5baf2e[_0xc6e1('0x67')]['lastName']?'\x20'+_0x5baf2e[_0xc6e1('0x67')][_0xc6e1('0xf2')]:''),'body':_0x5baf2e[_0xc6e1('0xde')]?_0x5baf2e[_0xc6e1('0xde')][_0xc6e1('0xf0')]:_0x5baf2e['body'],'direction':_0x5baf2e[_0xc6e1('0xe0')]===_0xc6e1('0xf1')?'A':'C','secret':_0x5baf2e[_0xc6e1('0xe1')],'read':_0x5baf2e[_0xc6e1('0x81')],'attachment':_0x5baf2e[_0xc6e1('0xde')]};})['value']()};return ejs[_0xc6e1('0xf3')](path['join'](config[_0xc6e1('0xd9')],_0xc6e1('0xd6'),_0xc6e1('0xf4'),_0xc6e1('0xf5')),{'interaction':_0x56ca19})[_0xc6e1('0x37')](function(_0x4432f4){var _0x5b484e=path[_0xc6e1('0xd5')](_0x2321bc,_0xc6e1('0xf6')+_0xd9ab48['id']+'-'+_0x197a1b+_0xc6e1('0xf7'));var _0x295966={'path':_0x5b484e,'channel':_0xc6e1('0xe6'),'interactionId':_0xd9ab48['id']};return pdf[_0xc6e1('0xf8')](_0x4432f4,_0x295966);})[_0xc6e1('0x37')](function(){return new BPromise(function(_0x3ad9f8,_0x151bc6){zipdir(_0x2321bc,{'saveTo':_0x225b29},function(_0x50f075,_0x163ddc){if(_0x50f075)return _0x151bc6(_0x50f075);return _0x3ad9f8(_0x163ddc);});})[_0xc6e1('0x37')](function(){return new BPromise(function(_0x3a5be5,_0x36d670){rimraf(_0x2321bc,function(_0x246164){if(_0x246164)_0x36d670(_0x246164);return _0x3a5be5();});});})['then'](function(){return _0xba3d60[_0xc6e1('0xd3')](_0x225b29,_0x52bedd,function(_0x1191a7){if(_0x1191a7){console[_0xc6e1('0xf9')](_0xc6e1('0xfa'),_0x1191a7);}else{fs[_0xc6e1('0xfb')](_0x225b29);}});});});}else{return _0xba3d60[_0xc6e1('0x1e')](0xc8);}})['catch'](handleError(_0xba3d60,null));}; \ No newline at end of file +var _0x9c8e=['undefined','limit','count','apply','save','update','then','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','some','compact','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','include','options','create','destroy','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','pick','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','omit','spread','findAll','emit','openchannelInteractionTags:save','removeTags','download','server','files','tmp','join','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','basename','existsSync','createReadStream','out','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset'];(function(_0xe74668,_0xb26509){var _0x4399ee=function(_0x205d6b){while(--_0x205d6b){_0xe74668['push'](_0xe74668['shift']());}};_0x4399ee(++_0xb26509);}(_0x9c8e,0xc5));var _0xe9c8=function(_0x147fbf,_0x16bb3b){_0x147fbf=_0x147fbf-0x0;var _0x303a7b=_0x9c8e[_0x147fbf];return _0x303a7b;};'use strict';var emlformat=require(_0xe9c8('0x0'));var rimraf=require(_0xe9c8('0x1'));var zipdir=require(_0xe9c8('0x2'));var jsonpatch=require(_0xe9c8('0x3'));var rp=require(_0xe9c8('0x4'));var moment=require(_0xe9c8('0x5'));var BPromise=require(_0xe9c8('0x6'));var Mustache=require(_0xe9c8('0x7'));var util=require(_0xe9c8('0x8'));var path=require(_0xe9c8('0x9'));var sox=require(_0xe9c8('0xa'));var csv=require(_0xe9c8('0xb'));var ejs=require(_0xe9c8('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9c8('0xd'));var squel=require('squel');var crypto=require(_0xe9c8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe9c8('0xf'));var toCsv=require(_0xe9c8('0xb'));var querystring=require(_0xe9c8('0x10'));var Papa=require(_0xe9c8('0x11'));var Redis=require(_0xe9c8('0x12'));var authService=require(_0xe9c8('0x13'));var qs=require(_0xe9c8('0x14'));var as=require(_0xe9c8('0x15'));var pdf=require(_0xe9c8('0x16'));var hardwareService=require(_0xe9c8('0x17'));var logger=require(_0xe9c8('0x18'))(_0xe9c8('0x19'));var utils=require('../../config/utils');var config=require(_0xe9c8('0x1a'));var licenseUtil=require(_0xe9c8('0x1b'));var db=require(_0xe9c8('0x1c'))['db'];config['redis']=_[_0xe9c8('0x1d')](config[_0xe9c8('0x1e')],{'host':_0xe9c8('0x1f'),'port':0x18eb});var socket=require(_0xe9c8('0x20'))(new Redis(config[_0xe9c8('0x1e')]));require(_0xe9c8('0x21'))['register'](socket);function respondWithStatusCode(_0x5c29b3,_0x2dc306){_0x2dc306=_0x2dc306||0xcc;return function(_0x47302c){if(_0x47302c){return _0x5c29b3[_0xe9c8('0x22')](_0x2dc306);}return _0x5c29b3[_0xe9c8('0x23')](_0x2dc306)[_0xe9c8('0x24')]();};}function respondWithResult(_0x45d573,_0x8ae972){_0x8ae972=_0x8ae972||0xc8;return function(_0x45691f){if(_0x45691f){return _0x45d573[_0xe9c8('0x23')](_0x8ae972)[_0xe9c8('0x25')](_0x45691f);}};}function respondWithFilteredResult(_0x517f7c,_0x567b1d){return function(_0x45fcae){if(_0x45fcae){var _0x1633c0=typeof _0x567b1d[_0xe9c8('0x26')]===_0xe9c8('0x27')&&typeof _0x567b1d[_0xe9c8('0x28')]==='undefined';var _0x1bf2ee=_0x45fcae[_0xe9c8('0x29')];var _0x1f42ef=_0x1633c0?0x0:_0x567b1d['offset'];var _0x5e083d=_0x1633c0?_0x45fcae['count']:_0x567b1d[_0xe9c8('0x26')]+_0x567b1d[_0xe9c8('0x28')];var _0x18f779;if(_0x5e083d>=_0x1bf2ee){_0x5e083d=_0x1bf2ee;_0x18f779=0xc8;}else{_0x18f779=0xce;}_0x517f7c['status'](_0x18f779);return _0x517f7c['set']('Content-Range',_0x1f42ef+'-'+_0x5e083d+'/'+_0x1bf2ee)[_0xe9c8('0x25')](_0x45fcae);}return null;};}function patchUpdates(_0x35cb3f){return function(_0x5b8fd5){try{jsonpatch[_0xe9c8('0x2a')](_0x5b8fd5,_0x35cb3f,!![]);}catch(_0x2b52d7){return BPromise['reject'](_0x2b52d7);}return _0x5b8fd5[_0xe9c8('0x2b')]();};}function saveUpdates(_0x364bd3,_0x51ccba){return function(_0x35e6ed){if(_0x35e6ed){return _0x35e6ed[_0xe9c8('0x2c')](_0x364bd3)[_0xe9c8('0x2d')](function(_0x465099){return _0x465099;});}return null;};}function removeEntity(_0x556437,_0xcfae53){return function(_0x268eb3){if(_0x268eb3){return _0x268eb3['destroy']()[_0xe9c8('0x2d')](function(){_0x556437['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x576ad9,_0x53ce88){return function(_0x3209e4){if(!_0x3209e4){_0x576ad9[_0xe9c8('0x22')](0x194);}return _0x3209e4;};}function handleError(_0x4c988f,_0x5ef69){_0x5ef69=_0x5ef69||0x1f4;return function(_0x53a66d){logger['error'](_0x53a66d[_0xe9c8('0x2e')]);if(_0x53a66d[_0xe9c8('0x2f')]){delete _0x53a66d[_0xe9c8('0x2f')];}_0x4c988f[_0xe9c8('0x23')](_0x5ef69)[_0xe9c8('0x30')](_0x53a66d);};}function getInteractionUsers(_0x3f19a6,_0x47b827){return new BPromise(function(_0x5888d2,_0x1f675a){try{if(_0x47b827[_0x3f19a6['id']]){_0x3f19a6['Users']=_[_0xe9c8('0x31')](_0x47b827[_0x3f19a6['id']],function(_0x3fb7d5){return{'id':_0x3fb7d5['id'],'fullname':_0x3fb7d5['fullname']};});}}catch(_0x241b9e){_0x1f675a(_0x241b9e);}_0x5888d2(_0x3f19a6);});}function getInteractionTags(_0x5e417f,_0xb0dbee){return new BPromise(function(_0x423dfb,_0x4218f8){try{if(_0x5e417f[_0xe9c8('0x32')]){_0x5e417f[_0xe9c8('0x33')]=[];_0x5e417f[_0xe9c8('0x32')][_0xe9c8('0x34')](',')[_0xe9c8('0x35')](function(_0x382faa){_0x5e417f[_0xe9c8('0x33')][_0xe9c8('0x36')](_0xb0dbee[_0x382faa]);});}delete _0x5e417f['TagIds'];}catch(_0x44087d){_0x4218f8(_0x44087d);}_0x423dfb(_0x5e417f);});}function updateOpenchannelInteraction(_0x3bc1d9,_0x2906d9,_0x3f0a71){return new BPromise(function(_0x5a5f13,_0x56421b){return getInteractionUsers(_0x3bc1d9,_0x3f0a71)[_0xe9c8('0x2d')](function(_0x4a2b7e){return getInteractionTags(_0x4a2b7e,_0x2906d9);})[_0xe9c8('0x2d')](function(_0x4c2e2c){_0x5a5f13(_0x4c2e2c);})[_0xe9c8('0x37')](function(_0x19ac1d){_0x56421b(_0x19ac1d);});});}exports['index']=function(_0x39da95,_0x173c70){var _0x9dde24={},_0x16791b={},_0x45f802={'count':0x0,'rows':[]};var _0x46e15b=_['map'](db[_0xe9c8('0x38')][_0xe9c8('0x39')],function(_0x58b649){return{'name':_0x58b649[_0xe9c8('0x3a')],'type':_0x58b649[_0xe9c8('0x3b')][_0xe9c8('0x3c')]};});_0x16791b[_0xe9c8('0x3d')]=_['map'](_0x46e15b,_0xe9c8('0x2f'));_0x16791b[_0xe9c8('0x3e')]=_[_0xe9c8('0x3f')](_0x39da95[_0xe9c8('0x3e')]);_0x16791b[_0xe9c8('0x40')]=_['intersection'](_0x16791b['model'],_0x16791b[_0xe9c8('0x3e')]);_0x9dde24[_0xe9c8('0x41')]=_[_0xe9c8('0x42')](_0x16791b[_0xe9c8('0x3d')],qs[_0xe9c8('0x43')](_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x43')]));_0x9dde24[_0xe9c8('0x41')]=_0x9dde24[_0xe9c8('0x41')][_0xe9c8('0x44')]?_0x9dde24['attributes']:_0x16791b['model'];if(!_0x39da95[_0xe9c8('0x3e')]['hasOwnProperty'](_0xe9c8('0x45'))){_0x9dde24[_0xe9c8('0x28')]=qs[_0xe9c8('0x28')](_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x28')]);_0x9dde24[_0xe9c8('0x26')]=qs[_0xe9c8('0x26')](_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x26')]);}_0x9dde24[_0xe9c8('0x46')]=qs['sort'](_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x47')]);_0x9dde24['where']=qs['filters'](_['pick'](_0x39da95['query'],_0x16791b['filters']),_0x46e15b);var _0x5b185c=[];var _0x45dde3=squel['select']()['field']('id')['field'](_0xe9c8('0x2f'))[_0xe9c8('0x48')](_0xe9c8('0x49'))['from'](_0xe9c8('0x4a'));var _0x15ad5b=squel['select']()[_0xe9c8('0x48')](_0xe9c8('0x4b'))[_0xe9c8('0x48')](_0xe9c8('0x4c'))['field'](_0xe9c8('0x4d'))[_0xe9c8('0x4e')](_0xe9c8('0x4f'),'ui')[_0xe9c8('0x50')](_0xe9c8('0x51'),'u',_0xe9c8('0x52'));var _0x559aa5=squel[_0xe9c8('0x53')]()[_0xe9c8('0x4e')](_0xe9c8('0x54'),'i')[_0xe9c8('0x50')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe9c8('0x50')]('users','o',_0xe9c8('0x55'))[_0xe9c8('0x50')](_0xe9c8('0x56'),'a',_0xe9c8('0x57'))['left_join']('openchannel_messages','me',_0xe9c8('0x58'))['left_join']('openchannel_interaction_has_tags','it',_0xe9c8('0x59'))[_0xe9c8('0x50')](_0xe9c8('0x4a'),'t',_0xe9c8('0x5a'));var _0x371a75=squel[_0xe9c8('0x5b')]();var _0x453659=[];var _0xeca443=squel['expr']();var _0x130f26;if(_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x5c')]){_0x130f26=as[_0xe9c8('0x5d')](_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x5c')]);var _0x2e1f4e=_0x130f26[_0xe9c8('0x5e')];for(var _0x526806=0x0;_0x526806<_0x130f26[_0xe9c8('0x5f')][_0xe9c8('0x44')];_0x526806++){var _0x14d263=_0x130f26[_0xe9c8('0x5f')][_0x526806];var _0x2106f6='i';var _0x1489a8=_['find'](_0x46e15b,['name',_0x14d263[_0xe9c8('0x48')]]);if(!_0x1489a8){switch(_0x14d263[_0xe9c8('0x48')]){case _0xe9c8('0x60'):if(_0x14d263[_0xe9c8('0x61')]==0x1){_0x559aa5['having']('`'+_0x14d263[_0xe9c8('0x48')]+_0xe9c8('0x62'));}else{_0x559aa5[_0xe9c8('0x63')]('`'+_0x14d263[_0xe9c8('0x48')]+_0xe9c8('0x64'));}break;case _0xe9c8('0x65'):if(_0x14d263['operator']===_0xe9c8('0x66')){if(_0x14d263[_0xe9c8('0x61')]['split']('\x20')[_0xe9c8('0x44')]>0x1){_0x371a75[_0x2e1f4e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x14d263[_0xe9c8('0x61')]),null);}else{var _0x1810fe='%'+_0x14d263['value']+'%';_0x371a75[_0x2e1f4e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1810fe,_0x1810fe,_0x1810fe);}}else{_0x1489a8=_['find'](_0x46e15b,[_0xe9c8('0x2f'),'ContactId']);_0x14d263[_0xe9c8('0x48')]='ContactId';_0x4b416a=as[_0xe9c8('0x67')](_0x2106f6,_0x1489a8[_0xe9c8('0x3b')],_0x14d263);_0x371a75[_0x2e1f4e](_0x4b416a[_0xe9c8('0x68')],_0x4b416a['value'][_0xe9c8('0x69')],_0x4b416a[_0xe9c8('0x61')][_0xe9c8('0x24')]);}break;case _0xe9c8('0x6a'):var _0xe8c47b=_0x14d263['value'][_0xe9c8('0x34')](',')[_0xe9c8('0x31')](function(_0x1f6a96){return Number(_0x1f6a96);});_0xe8c47b[_0xe9c8('0x35')](function(_0x5eb5bf){_0xeca443['or'](_0xe9c8('0x6b'),'%,'+_0x5eb5bf+',%');});_0x453659=_['union'](_0x453659,_0xe8c47b);break;case _0xe9c8('0x6c'):if(_0x14d263[_0xe9c8('0x6d')]===_0xe9c8('0x66')){_0x371a75[_0x2e1f4e](_0xe9c8('0x6e'),'%'+_0x14d263[_0xe9c8('0x61')]+'%',null);}else{_0x1489a8=_[_0xe9c8('0x6f')](_0x46e15b,[_0xe9c8('0x2f'),_0xe9c8('0x70')]);_0x14d263[_0xe9c8('0x48')]=_0xe9c8('0x70');_0x4b416a=as[_0xe9c8('0x67')](_0x2106f6,_0x1489a8['type'],_0x14d263);_0x371a75[_0x2e1f4e](_0x4b416a['text'],_0x4b416a[_0xe9c8('0x61')][_0xe9c8('0x69')],_0x4b416a[_0xe9c8('0x61')]['end']);}break;case _0xe9c8('0x71'):_0x4b416a=as[_0xe9c8('0x67')]('me',null,_0x14d263);_0x371a75[_0x2e1f4e](_0x4b416a['text'],_0x4b416a[_0xe9c8('0x61')][_0xe9c8('0x69')],_0x4b416a[_0xe9c8('0x61')][_0xe9c8('0x24')]);break;}}else{var _0x4b416a=as[_0xe9c8('0x67')](_0x2106f6,_0x1489a8[_0xe9c8('0x3b')],_0x14d263);_0x371a75[_0x2e1f4e](_0x4b416a['text'],_0x4b416a['value'][_0xe9c8('0x69')],_0x4b416a['value'][_0xe9c8('0x24')]);}}}else{var _0x5c494b=_(_0x39da95[_0xe9c8('0x3e')])[_0xe9c8('0x3f')]()['map'](function(_0x15d314){return _[_0xe9c8('0x72')](_0x46e15b,[_0xe9c8('0x2f'),_0x15d314])?_0x15d314:undefined;})[_0xe9c8('0x73')]()[_0xe9c8('0x61')]();if(!_['isEmpty'](_0x5c494b)){_0x5c494b[_0xe9c8('0x35')](function(_0x3d9784){if(_0x3d9784===_0xe9c8('0x74')){_0x559aa5[_0xe9c8('0x75')](_0xe9c8('0x76'),[][_0xe9c8('0x77')](_0x39da95[_0xe9c8('0x3e')][_0x3d9784]));}else if(_0x3d9784===_0xe9c8('0x78')){var _0x1bd0c9=JSON['parse'](_0x39da95[_0xe9c8('0x3e')][_0x3d9784])[_0xe9c8('0x79')];var _0x3f9e63=JSON[_0xe9c8('0x7a')](_0x39da95[_0xe9c8('0x3e')][_0x3d9784])[_0xe9c8('0x7b')];_0x559aa5[_0xe9c8('0x75')](_0xe9c8('0x7c'),_0x1bd0c9,_0x3f9e63);}else{if(_0x39da95[_0xe9c8('0x3e')][_0x3d9784]===_0xe9c8('0x7d')){_0x559aa5['where']('i.'+_0x3d9784+_0xe9c8('0x7e'));}else{_0x559aa5['where']('i.'+_0x3d9784+_0xe9c8('0x7f'),_0x39da95[_0xe9c8('0x3e')][_0x3d9784]);}}});}if(_0x39da95['query'][_0xe9c8('0x80')]){if(_0x39da95['query'][_0xe9c8('0x80')]==0x1){_0x559aa5[_0xe9c8('0x63')]('`unreadMessages`\x20=\x200');}else{_0x559aa5[_0xe9c8('0x63')]('`unreadMessages`\x20>\x200');}}if(_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x81')]){_0x453659=_[_0xe9c8('0x82')](_0x39da95['query'][_0xe9c8('0x81')])?_0x39da95['query'][_0xe9c8('0x81')]:new Array(_0x39da95['query'][_0xe9c8('0x81')]);_0x453659[_0xe9c8('0x35')](function(_0x433792){_0xeca443['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x433792+',%');});}if(_0x39da95['query'][_0xe9c8('0x83')]){var _0x17fdd9=_0x39da95['query'][_0xe9c8('0x83')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe9c8('0x84')](_0x17fdd9)){_0x371a75['or'](_0xe9c8('0x85'),_0x17fdd9+'%');}else{_0x371a75['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe9c8('0x86')](_0x17fdd9))['or'](_0xe9c8('0x87'),_0x17fdd9+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x17fdd9+'%');}}}_0x559aa5[_0xe9c8('0x75')](_0x371a75);_0x559aa5[_0xe9c8('0x88')](_0xe9c8('0x89'));var _0x27f3ce={'type':db[_0xe9c8('0x8a')][_0xe9c8('0x8b')][_0xe9c8('0x8c')],'raw':!![]};var _0x200e06=_0x559aa5[_0xe9c8('0x8d')]();_0x200e06['field']('i.id');_0x200e06[_0xe9c8('0x48')](_0xe9c8('0x8e'),'unreadMessages');if(_0x9dde24[_0xe9c8('0x46')]){_0x9dde24[_0xe9c8('0x46')]['forEach'](function(_0xae2e04){var _0x2a0207=_0xae2e04[0x0]==='contactName'?_0xae2e04[0x0]:'i.'+_0xae2e04[0x0];_0x559aa5[_0xe9c8('0x46')](_0x2a0207,_0xae2e04[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe9c8('0x8f')](_0x453659)){_0x559aa5[_0xe9c8('0x63')](_0xeca443);_0x200e06[_0xe9c8('0x75')](_0xe9c8('0x90'),_0x453659);}BPromise[_0xe9c8('0x91')]()[_0xe9c8('0x2d')](function(){if(!_0x130f26){if(_0x39da95[_0xe9c8('0x3e')][_0xe9c8('0x74')])return;_0x200e06[_0xe9c8('0x75')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x559aa5[_0xe9c8('0x75')](_0xe9c8('0x92'));return;}if(_0x39da95[_0xe9c8('0x93')]['role']!==_0xe9c8('0x94'))return;return _0x39da95[_0xe9c8('0x93')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xe9c8('0x2d')](function(_0x108db4){if(_[_0xe9c8('0x8f')](_0x108db4)){_0x200e06[_0xe9c8('0x75')](_0xe9c8('0x95'));_0x559aa5[_0xe9c8('0x75')](_0xe9c8('0x95'));}else{_0x200e06[_0xe9c8('0x75')](_0xe9c8('0x76'),_[_0xe9c8('0x31')](_0x108db4,'id'));_0x559aa5[_0xe9c8('0x75')](_0xe9c8('0x76'),_[_0xe9c8('0x31')](_0x108db4,'id'));}});})[_0xe9c8('0x2d')](function(){if(_0x39da95[_0xe9c8('0x93')][_0xe9c8('0x96')]===_0xe9c8('0x94')&&!_0x130f26&&!_0x39da95[_0xe9c8('0x3e')]['OpenchannelAccountId'])return[];return db[_0xe9c8('0x97')][_0xe9c8('0x3e')](_0x200e06[_0xe9c8('0x98')](),_0x27f3ce);})[_0xe9c8('0x2d')](function(_0x338dd6){_0x45f802['count']=_0x338dd6[_0xe9c8('0x44')];if(_0x45f802[_0xe9c8('0x29')]===0x0)return[];return db[_0xe9c8('0x97')][_0xe9c8('0x3e')](_0x45dde3[_0xe9c8('0x98')](),_0x27f3ce)[_0xe9c8('0x2d')](function(_0x43e955){_0x5b185c=_[_0xe9c8('0x99')](_0x43e955,'id');_0x27f3ce=_[_0xe9c8('0x9a')](_0x27f3ce,{'model':db[_0xe9c8('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39da95['query'][_0xe9c8('0x43')]){_0x9dde24['attributes']['forEach'](function(_0x167f1f){_0x559aa5[_0xe9c8('0x48')]('i.'+_0x167f1f);});}else{_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0x8e'),'unreadMessages');_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0x9b'),_0xe9c8('0x9c'));_0x559aa5['field']('a.mandatoryDisposition',_0xe9c8('0x9d'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0x9e'),'contactName');_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0x9f'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xa0'),'Contact.firstName');_0x559aa5['field'](_0xe9c8('0xa1'),'Contact.lastName');_0x559aa5['field'](_0xe9c8('0xa2'),_0xe9c8('0xa3'));_0x559aa5[_0xe9c8('0x48')]('c.phone',_0xe9c8('0xa4'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xa5'),_0xe9c8('0xa6'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xa7'),_0xe9c8('0xa8'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xa9'),_0xe9c8('0xaa'));_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xab'),'Owner.internal');_0x559aa5[_0xe9c8('0x48')](_0xe9c8('0xac'),'TagIds');}if(_0x9dde24[_0xe9c8('0x28')])_0x559aa5[_0xe9c8('0x28')](_0x9dde24[_0xe9c8('0x28')]);if(_0x9dde24[_0xe9c8('0x26')])_0x559aa5[_0xe9c8('0x26')](_0x9dde24[_0xe9c8('0x26')]);return db[_0xe9c8('0x97')][_0xe9c8('0x3e')](_0x559aa5[_0xe9c8('0x98')](),_0x27f3ce);})[_0xe9c8('0x2d')](function(_0x2ca692){if(_0x2ca692[_0xe9c8('0x44')]>0x0)_0x15ad5b['where'](_0xe9c8('0xad'),_['map'](_0x2ca692,'id'));return db[_0xe9c8('0x97')][_0xe9c8('0x3e')](_0x15ad5b[_0xe9c8('0x98')](),_0x27f3ce)[_0xe9c8('0x2d')](function(_0xdeaa25){var _0x286d1f=_[_0xe9c8('0xae')](_0xdeaa25,_0xe9c8('0xaf'));var _0x374767=[];_0x2ca692[_0xe9c8('0x35')](function(_0x5a4f9e){_0x374767['push'](updateOpenchannelInteraction(_0x5a4f9e,_0x5b185c,_0x286d1f));});return BPromise[_0xe9c8('0xb0')](_0x374767);});});})[_0xe9c8('0x2d')](function(_0x274e26){_0x45f802[_0xe9c8('0xb1')]=_0x274e26;return _0x45f802;})['then'](respondWithFilteredResult(_0x173c70,_0x9dde24))['catch'](handleError(_0x173c70,null));};exports['show']=function(_0x14e123,_0xba0cf0){var _0x3c5113={};if(_0x14e123[_0xe9c8('0x3e')][_0xe9c8('0x3b')]&&_0x14e123[_0xe9c8('0x3e')][_0xe9c8('0x3b')]===_0xe9c8('0x4e')){_0x3c5113[_0xe9c8('0x4e')]=_0x14e123[_0xe9c8('0xb2')]['id'];}else{_0x3c5113['id']=_0x14e123[_0xe9c8('0xb2')]['id'];}var _0x176b7a={'raw':![],'where':_0x3c5113},_0x4d74eb={};_0x4d74eb[_0xe9c8('0x3d')]=_[_0xe9c8('0x3f')](db[_0xe9c8('0x38')][_0xe9c8('0x39')]);_0x4d74eb[_0xe9c8('0x3e')]=_['keys'](_0x14e123[_0xe9c8('0x3e')]);_0x4d74eb['filters']=_['intersection'](_0x4d74eb[_0xe9c8('0x3d')],_0x4d74eb['query']);_0x176b7a['attributes']=_[_0xe9c8('0x42')](_0x4d74eb['model'],qs[_0xe9c8('0x43')](_0x14e123[_0xe9c8('0x3e')][_0xe9c8('0x43')]));_0x176b7a[_0xe9c8('0x41')]=_0x176b7a[_0xe9c8('0x41')][_0xe9c8('0x44')]?_0x176b7a[_0xe9c8('0x41')]:_0x4d74eb['model'];if(_0x14e123['query'][_0xe9c8('0xb3')]){_0x176b7a[_0xe9c8('0xb4')]=[{'all':!![]}];}_0x176b7a=_[_0xe9c8('0x9a')]({},_0x176b7a,_0x14e123[_0xe9c8('0xb5')]);return db['OpenchannelInteraction'][_0xe9c8('0x6f')](_0x176b7a)[_0xe9c8('0x2d')](handleEntityNotFound(_0xba0cf0,null))[_0xe9c8('0x2d')](respondWithResult(_0xba0cf0,null))['catch'](handleError(_0xba0cf0,null));};exports[_0xe9c8('0xb6')]=function(_0x57e379,_0x3a50a8){return db[_0xe9c8('0x38')]['create'](_0x57e379[_0xe9c8('0x71')],{})[_0xe9c8('0x2d')](respondWithResult(_0x3a50a8,0xc9))[_0xe9c8('0x37')](handleError(_0x3a50a8,null));};exports[_0xe9c8('0x2c')]=function(_0x35d37c,_0x58f050){if(_0x35d37c['body']['id']){delete _0x35d37c[_0xe9c8('0x71')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x35d37c[_0xe9c8('0xb2')]['id']}})[_0xe9c8('0x2d')](handleEntityNotFound(_0x58f050,null))['then'](saveUpdates(_0x35d37c[_0xe9c8('0x71')],null))[_0xe9c8('0x2d')](respondWithResult(_0x58f050,null))['catch'](handleError(_0x58f050,null));};exports[_0xe9c8('0xb7')]=function(_0x439d38,_0x235126){return db[_0xe9c8('0x38')][_0xe9c8('0x6f')]({'where':{'id':_0x439d38[_0xe9c8('0xb2')]['id']}})['then'](handleEntityNotFound(_0x235126,null))[_0xe9c8('0x2d')](removeEntity(_0x235126,null))['catch'](handleError(_0x235126,null));};exports[_0xe9c8('0xb8')]=function(_0x60e5eb,_0x30d39b){return db['OpenchannelInteraction'][_0xe9c8('0xb8')]()[_0xe9c8('0x2d')](respondWithResult(_0x30d39b,null))[_0xe9c8('0x37')](handleError(_0x30d39b,null));};exports[_0xe9c8('0xb9')]=function(_0x42c844,_0x33f167,_0x3c9f61){return db['OpenchannelMessage'][_0xe9c8('0x6f')]({'where':{'id':_0x42c844[_0xe9c8('0xb2')]['id']}})[_0xe9c8('0x2d')](handleEntityNotFound(_0x33f167,null))[_0xe9c8('0x2d')](function(_0x405ee4){if(_0x405ee4){return _0x405ee4[_0xe9c8('0xb9')](_0x42c844[_0xe9c8('0x71')][_0xe9c8('0xba')],_['omit'](_0x42c844[_0xe9c8('0x71')],[_0xe9c8('0xba'),'id'])||{});}})[_0xe9c8('0x2d')](respondWithResult(_0x33f167,null))['catch'](handleError(_0x33f167,null));};exports[_0xe9c8('0xbb')]=function(_0x3ef98b,_0x13ee02,_0x2cfbf4){var _0x128f93={'raw':![],'where':{}};var _0x190941={};var _0x178969={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xe9c8('0xbc')]({'where':{'id':_0x3ef98b[_0xe9c8('0xb2')]['id']}})['then'](handleEntityNotFound(_0x13ee02,null))[_0xe9c8('0x2d')](function(_0x3482ef){if(_0x3482ef){_0x190941[_0xe9c8('0x3d')]=_[_0xe9c8('0x3f')](db[_0xe9c8('0xbd')][_0xe9c8('0x39')]);_0x190941['query']=_[_0xe9c8('0x3f')](_0x3ef98b['query']);_0x190941['filters']=_[_0xe9c8('0x42')](_0x190941[_0xe9c8('0x3d')],_0x190941[_0xe9c8('0x3e')]);_0x128f93['attributes']=_[_0xe9c8('0x42')](_0x190941[_0xe9c8('0x3d')],qs[_0xe9c8('0x43')](_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x43')]));_0x128f93[_0xe9c8('0x41')]=_0x128f93[_0xe9c8('0x41')][_0xe9c8('0x44')]?_0x128f93[_0xe9c8('0x41')]:_0x190941[_0xe9c8('0x3d')];if(!_0x3ef98b[_0xe9c8('0x3e')]['hasOwnProperty'](_0xe9c8('0x45'))){_0x128f93[_0xe9c8('0x28')]=qs['limit'](_0x3ef98b['query'][_0xe9c8('0x28')]);_0x128f93[_0xe9c8('0x26')]=qs[_0xe9c8('0x26')](_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x26')]);}_0x128f93[_0xe9c8('0x46')]=qs[_0xe9c8('0x47')](_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x47')]);_0x128f93[_0xe9c8('0x75')]=qs[_0xe9c8('0x40')](_[_0xe9c8('0xbe')](_0x3ef98b[_0xe9c8('0x3e')],_0x190941[_0xe9c8('0x40')]));_0x128f93[_0xe9c8('0x75')]['OpenchannelInteractionId']=_0x3482ef['id'];if(_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x83')]){_0x128f93['where']=_[_0xe9c8('0x9a')](_0x128f93[_0xe9c8('0x75')],{'$or':_[_0xe9c8('0x31')](_0x128f93[_0xe9c8('0x41')],function(_0x20d7eb){var _0x4d5823={};_0x4d5823[_0x20d7eb]={'$like':'%'+_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x83')]+'%'};return _0x4d5823;})});}if(_0x3ef98b[_0xe9c8('0x3e')][_0xe9c8('0x79')]){var _0x1cbf76=_0x3ef98b['query'][_0xe9c8('0x79')][_0xe9c8('0x34')](',');var _0x4f8e6b={};_0x4f8e6b[_0x1cbf76[0x0]]={'$gte':moment(_0x1cbf76[0x1])[_0xe9c8('0xbf')](_0xe9c8('0xc0'))};_0x128f93[_0xe9c8('0x75')]=_[_0xe9c8('0x9a')](_0x128f93[_0xe9c8('0x75')],_0x4f8e6b);}_0x128f93=_['merge']({},_0x128f93,_0x3ef98b[_0xe9c8('0xb5')]);return db[_0xe9c8('0xbd')][_0xe9c8('0x29')]({'where':_0x128f93[_0xe9c8('0x75')]})[_0xe9c8('0x2d')](function(_0x414322){_0x178969[_0xe9c8('0x29')]=_0x414322;if(_0x3ef98b['query'][_0xe9c8('0xb3')]){_0x128f93['include']=[{'all':!![]}];}return db[_0xe9c8('0xbd')]['findAll'](_0x128f93);})[_0xe9c8('0x2d')](function(_0x11ee4b){_0x178969[_0xe9c8('0xb1')]=_0x11ee4b;return _0x178969;});}})[_0xe9c8('0x2d')](respondWithFilteredResult(_0x13ee02,_0x128f93))[_0xe9c8('0x37')](handleError(_0x13ee02,null));};exports[_0xe9c8('0xc1')]=function(_0x1c57f5,_0x368d75,_0x39c869){return db[_0xe9c8('0x38')][_0xe9c8('0x6f')]({'where':{'id':_0x1c57f5[_0xe9c8('0xb2')]['id']}})[_0xe9c8('0x2d')](handleEntityNotFound(_0x368d75,null))[_0xe9c8('0x2d')](function(_0x280bf1){if(_0x280bf1){return _0x280bf1[_0xe9c8('0xc2')](_0x1c57f5[_0xe9c8('0x71')][_0xe9c8('0xba')],_[_0xe9c8('0xc3')](_0x1c57f5['body'],[_0xe9c8('0xba'),'id'])||{})[_0xe9c8('0xc4')](function(){return db[_0xe9c8('0x6a')][_0xe9c8('0xc5')]({'attributes':['id','name',_0xe9c8('0x49')],'where':{'id':_0x1c57f5[_0xe9c8('0x71')]['ids']}});})[_0xe9c8('0x2d')](function(_0x55cbc5){socket[_0xe9c8('0xc6')](_0xe9c8('0xc7'),{'id':Number(_0x1c57f5[_0xe9c8('0xb2')]['id']),'tags':_0x55cbc5||[]});return{'id':Number(_0x1c57f5['params']['id']),'tags':_0x55cbc5||[]};});}})[_0xe9c8('0x2d')](respondWithResult(_0x368d75,null))[_0xe9c8('0x37')](handleError(_0x368d75,null));};exports[_0xe9c8('0xc8')]=function(_0x2d9d4b,_0x2c9489,_0x1e3094){return db[_0xe9c8('0x38')][_0xe9c8('0x6f')]({'where':{'id':_0x2d9d4b[_0xe9c8('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2c9489,null))[_0xe9c8('0x2d')](function(_0x37b49c){if(_0x37b49c){return _0x37b49c[_0xe9c8('0xc8')](_0x2d9d4b[_0xe9c8('0x3e')][_0xe9c8('0xba')]);}})[_0xe9c8('0x2d')](respondWithStatusCode(_0x2c9489,null))[_0xe9c8('0x37')](handleError(_0x2c9489,null));};exports[_0xe9c8('0xc9')]=function(_0x56c77f,_0x26fc82){var _0x5aad92=moment()['unix']()[_0xe9c8('0x98')]();var _0x1362e5=path['join'](config['root'],_0xe9c8('0xca'),_0xe9c8('0xcb'),_0xe9c8('0xcc'));var _0x19d27b=path[_0xe9c8('0xcd')](config['root'],_0xe9c8('0xca'),'files','attachments');var _0x3e2bdf=path[_0xe9c8('0xcd')](_0x1362e5,_0x5aad92);var _0x904bee=util[_0xe9c8('0xbf')](_0xe9c8('0xce'),_0x56c77f[_0xe9c8('0xb2')]['id'],_0x5aad92);var _0x2a1993=path[_0xe9c8('0xcd')](_0x1362e5,_0x904bee);var _0x1a2cb9=[];_0x1a2cb9[_0xe9c8('0x36')]({'model':db[_0xe9c8('0x6c')],'as':_0xe9c8('0x6c'),'attributes':['id',_0xe9c8('0xcf')],'raw':!![]});_0x1a2cb9[_0xe9c8('0x36')]({'model':db[_0xe9c8('0xd0')],'as':'Contact','attributes':['id',_0xe9c8('0xd1'),_0xe9c8('0xd2')],'raw':!![]});if(_0x56c77f[_0xe9c8('0x3e')][_0xe9c8('0xd3')]){_0x1a2cb9[_0xe9c8('0x36')]({'model':db[_0xe9c8('0xd4')],'as':'Attachment','raw':!![]});}var _0x346362=[{'model':db[_0xe9c8('0xbd')],'as':_0xe9c8('0xd5'),'attributes':['id','body','createdAt',_0xe9c8('0xd6'),_0xe9c8('0xd7'),'read'],'include':_0x1a2cb9}];_0x346362['push']({'model':db['OpenchannelAccount'],'as':_0xe9c8('0xd8'),'attributes':['id',_0xe9c8('0x2f')]});_0x346362[_0xe9c8('0x36')]({'model':db[_0xe9c8('0x6c')],'as':_0xe9c8('0xd9'),'attributes':['id',_0xe9c8('0xcf')]});return db[_0xe9c8('0x38')][_0xe9c8('0x6f')]({'where':{'id':_0x56c77f[_0xe9c8('0xb2')]['id']},'include':_0x346362})[_0xe9c8('0x2d')](handleEntityNotFound(_0x26fc82,null))[_0xe9c8('0x2d')](function(_0x24c9e1){if(_0x24c9e1){var _0x2730fa=_0x24c9e1['get']({'plain':!![]});fs[_0xe9c8('0xda')](_0x3e2bdf);var _0xb8cb63={'channel':_0xe9c8('0xdb'),'account':_0x2730fa[_0xe9c8('0xd8')][_0xe9c8('0x2f')],'agent':_0x2730fa[_0xe9c8('0xd9')]?_0x2730fa['Owner'][_0xe9c8('0xcf')]:_0xe9c8('0xdc'),'createdAt':moment(_0x2730fa[_0xe9c8('0x78')])[_0xe9c8('0xbf')](_0xe9c8('0xc0'))[_0xe9c8('0x98')](),'closedAt':_0x2730fa['closed']?moment(_0x2730fa[_0xe9c8('0xdd')])[_0xe9c8('0xbf')](_0xe9c8('0xc0'))[_0xe9c8('0x98')]():'','disposition':_0x2730fa[_0xe9c8('0xde')],'visibility':_0x2730fa[_0xe9c8('0xdf')]?_0xe9c8('0xe0'):'Private','messages':_(_0x2730fa[_0xe9c8('0xd5')])[_0xe9c8('0x83')]({'secret':![]})[_0xe9c8('0x31')](function(_0x198f93){if(_0x198f93[_0xe9c8('0xd4')]){var _0x6eb929=path[_0xe9c8('0xcd')](_0x19d27b,_0x198f93[_0xe9c8('0xd4')][_0xe9c8('0xe1')]);if(fs[_0xe9c8('0xe2')](_0x6eb929)){fs[_0xe9c8('0xe3')](_0x6eb929)['pipe'](fs['createWriteStream'](path[_0xe9c8('0xcd')](_0x3e2bdf,_0x198f93[_0xe9c8('0xd4')][_0xe9c8('0xe1')])));}}return{'date':moment(_0x198f93[_0xe9c8('0x78')])[_0xe9c8('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe9c8('0x98')](),'sender':_0x198f93[_0xe9c8('0xd6')]===_0xe9c8('0xe4')?_0x198f93[_0xe9c8('0x6c')]?_0x198f93[_0xe9c8('0x6c')][_0xe9c8('0xcf')]:'System':_0x198f93['Contact']['firstName']+(_0x198f93[_0xe9c8('0x65')][_0xe9c8('0xd2')]?'\x20'+_0x198f93[_0xe9c8('0x65')][_0xe9c8('0xd2')]:''),'body':_0x198f93[_0xe9c8('0xd4')]?_0x198f93[_0xe9c8('0xd4')][_0xe9c8('0xe1')]:_0x198f93['body'],'direction':_0x198f93[_0xe9c8('0xd6')]==='out'?'A':'C','secret':_0x198f93[_0xe9c8('0xd7')],'read':_0x198f93[_0xe9c8('0x80')],'attachment':_0x198f93[_0xe9c8('0xd4')]};})[_0xe9c8('0x61')]()};return ejs['renderFile'](path[_0xe9c8('0xcd')](config['root'],_0xe9c8('0xca'),_0xe9c8('0xe5'),_0xe9c8('0xe6')),{'interaction':_0xb8cb63})[_0xe9c8('0x2d')](function(_0xeaaa55){var _0xa50b70=path[_0xe9c8('0xcd')](_0x3e2bdf,_0xe9c8('0xe7')+_0x2730fa['id']+'-'+_0x5aad92+_0xe9c8('0xe8'));var _0x337fec={'path':_0xa50b70,'channel':_0xe9c8('0xdb'),'interactionId':_0x2730fa['id']};return pdf[_0xe9c8('0xe9')](_0xeaaa55,_0x337fec);})['then'](function(){return new BPromise(function(_0x65690,_0x429a09){zipdir(_0x3e2bdf,{'saveTo':_0x2a1993},function(_0x5a7695,_0x3020c4){if(_0x5a7695)return _0x429a09(_0x5a7695);return _0x65690(_0x3020c4);});})[_0xe9c8('0x2d')](function(){return new BPromise(function(_0x1e5293,_0x4a9f20){rimraf(_0x3e2bdf,function(_0x5caff3){if(_0x5caff3)_0x4a9f20(_0x5caff3);return _0x1e5293();});});})[_0xe9c8('0x2d')](function(){return _0x26fc82[_0xe9c8('0xc9')](_0x2a1993,_0x904bee,function(_0x152a7a){if(_0x152a7a){console[_0xe9c8('0xea')]('err',_0x152a7a);}else{fs[_0xe9c8('0xeb')](_0x2a1993);}});});});}else{return _0x26fc82[_0xe9c8('0x22')](0xc8);}})[_0xe9c8('0x37')](handleError(_0x26fc82,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 40ce22f..a80f71a 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 _0x8b9c=['remove','getUsers','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update'];(function(_0x203744,_0xeee44e){var _0x10c2de=function(_0x408c11){while(--_0x408c11){_0x203744['push'](_0x203744['shift']());}};_0x10c2de(++_0xeee44e);}(_0x8b9c,0x64));var _0xc8b9=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b9c[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xc8b9('0x0'))['db'][_0xc8b9('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xc8b9('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8b9('0x3'),'afterUpdate':_0xc8b9('0x4'),'afterDestroy':_0xc8b9('0x5')};function emitEvent(_0x14f8c5){return function(_0x318e37,_0x2494d0,_0x9b3ef1){_0x318e37[_0xc8b9('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5c4ff3){_0x318e37[_0xc8b9('0x7')](_0xc8b9('0x8'),_0x5c4ff3['map'](function(_0x27babc){return{'id':_0x27babc['id']};}));return OpenchannelMessage[_0xc8b9('0x9')]({'where':{'OpenchannelInteractionId':_0x318e37['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f066c){_0x318e37[_0xc8b9('0x7')]('unreadMessages',_0x3f066c[_0xc8b9('0xa')]);OpenchannelInteractionEvents[_0xc8b9('0xb')](_0x14f8c5+':'+_0x318e37['id'],_0x318e37);OpenchannelInteractionEvents['emit'](_0x14f8c5,_0x318e37);_0x9b3ef1(null);})[_0xc8b9('0xc')](_0x9b3ef1(null));};}for(var e in events){if(events[_0xc8b9('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xc8b9('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x41e8=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','then','setDataValue','Users','map'];(function(_0xf589fa,_0x3679ab){var _0x5476a2=function(_0x18fdc0){while(--_0x18fdc0){_0xf589fa['push'](_0xf589fa['shift']());}};_0x5476a2(++_0x3679ab);}(_0x41e8,0x7f));var _0x841e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x41e8[_0xf50820];return _0x2a9b10;};'use strict';var EventEmitter=require(_0x841e('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x841e('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x841e('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x841e('0x3')](0x0);var events={'afterCreate':_0x841e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12903e){return function(_0x352d91,_0x203880,_0x52a026){_0x352d91['getUsers']({'attributes':['id'],'raw':!![]})[_0x841e('0x5')](function(_0x4965ed){_0x352d91[_0x841e('0x6')](_0x841e('0x7'),_0x4965ed[_0x841e('0x8')](function(_0x16ff36){return{'id':_0x16ff36['id']};}));return OpenchannelMessage[_0x841e('0x9')]({'where':{'OpenchannelInteractionId':_0x352d91['id'],'direction':'in','read':![]},'raw':!![]});})[_0x841e('0x5')](function(_0xd8892e){_0x352d91[_0x841e('0x6')](_0x841e('0xa'),_0xd8892e[_0x841e('0xb')]);OpenchannelInteractionEvents[_0x841e('0xc')](_0x12903e+':'+_0x352d91['id'],_0x352d91);OpenchannelInteractionEvents[_0x841e('0xc')](_0x12903e,_0x352d91);_0x52a026(null);})[_0x841e('0xd')](_0x52a026(null));};}for(var e in events){if(events[_0x841e('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x841e('0xf')](e,emitEvent(event));}}module[_0x841e('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 986176f..48fe6b7 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 _0x7bce=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelInteraction'];(function(_0x483234,_0x8abfc6){var _0x488339=function(_0x46ec76){while(--_0x46ec76){_0x483234['push'](_0x483234['shift']());}};_0x488339(++_0x8abfc6);}(_0x7bce,0x1c4));var _0xe7bc=function(_0x1201c6,_0x2fa118){_0x1201c6=_0x1201c6-0x0;var _0x1f8aeb=_0x7bce[_0x1201c6];return _0x1f8aeb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7bc('0x0'))(_0xe7bc('0x1'));var moment=require(_0xe7bc('0x2'));var BPromise=require(_0xe7bc('0x3'));var rp=require(_0xe7bc('0x4'));var fs=require('fs');var path=require(_0xe7bc('0x5'));var rimraf=require(_0xe7bc('0x6'));var config=require(_0xe7bc('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xe7bc('0x8')]=function(_0x3c8746,_0x38a686){return _0x3c8746['define'](_0xe7bc('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x446865,_0x48462a,_0x3bfd05){if(_0x446865['changed'](_0xe7bc('0xa'))){_0x446865[_0xe7bc('0xb')]=moment()[_0xe7bc('0xc')](_0xe7bc('0xd'));}_0x3bfd05(null,_0x446865);}}});}; \ No newline at end of file +var _0x9e6c=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','path'];(function(_0x5ed4d6,_0x382098){var _0x280996=function(_0x422817){while(--_0x422817){_0x5ed4d6['push'](_0x5ed4d6['shift']());}};_0x280996(++_0x382098);}(_0x9e6c,0xc7));var _0xc9e6=function(_0x3e951a,_0x535776){_0x3e951a=_0x3e951a-0x0;var _0x3f6aad=_0x9e6c[_0x3e951a];return _0x3f6aad;};'use strict';var _=require('lodash');var util=require(_0xc9e6('0x0'));var logger=require(_0xc9e6('0x1'))(_0xc9e6('0x2'));var moment=require('moment');var BPromise=require(_0xc9e6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9e6('0x4'));var rimraf=require(_0xc9e6('0x5'));var config=require(_0xc9e6('0x6'));var attributes=require(_0xc9e6('0x7'));module[_0xc9e6('0x8')]=function(_0x4ccdd7,_0x3c1ef0){return _0x4ccdd7[_0xc9e6('0x9')](_0xc9e6('0xa'),attributes,{'tableName':_0xc9e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b1b98,_0x23d58e,_0xf7ca5e){if(_0x4b1b98[_0xc9e6('0xc')](_0xc9e6('0xd'))){_0x4b1b98[_0xc9e6('0xe')]=moment()[_0xc9e6('0xf')](_0xc9e6('0x10'));}_0xf7ca5e(null,_0x4b1b98);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 4455543..6e18fc5 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 _0x14cb=['then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','limit','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x14cb,0x75));var _0xb14c=function(_0x5e1930,_0x444535){_0x5e1930=_0x5e1930-0x0;var _0x15f766=_0x14cb[_0x5e1930];return _0x15f766;};'use strict';var _=require(_0xb14c('0x0'));var util=require(_0xb14c('0x1'));var moment=require('moment');var BPromise=require(_0xb14c('0x2'));var rs=require(_0xb14c('0x3'));var fs=require('fs');var Redis=require(_0xb14c('0x4'));var db=require(_0xb14c('0x5'))['db'];var utils=require(_0xb14c('0x6'));var logger=require('../../config/logger')(_0xb14c('0x7'));var config=require(_0xb14c('0x8'));var jayson=require(_0xb14c('0x9'));var client=jayson[_0xb14c('0xa')][_0xb14c('0xb')]({'port':0x232a});config['redis']=_[_0xb14c('0xc')](config[_0xb14c('0xd')],{'host':_0xb14c('0xe'),'port':0x18eb});var socket=require(_0xb14c('0xf'))(new Redis(config[_0xb14c('0xd')]));require('./openchannelInteraction.socket')[_0xb14c('0x10')](socket);function respondWithRpcPromise(_0x1d007,_0x5592e3,_0xc93bb3){return new BPromise(function(_0x395e2b,_0x33cf11){return client[_0xb14c('0x11')](_0x1d007,_0xc93bb3)[_0xb14c('0x12')](function(_0x119681){logger[_0xb14c('0x13')](_0xb14c('0x14'),_0x5592e3,_0xb14c('0x15'));logger[_0xb14c('0x16')](_0xb14c('0x17'),_0x5592e3,_0xb14c('0x15'),JSON[_0xb14c('0x18')](_0x119681));if(_0x119681['error']){if(_0x119681['error'][_0xb14c('0x19')]===0x1f4){logger[_0xb14c('0x1a')](_0xb14c('0x14'),_0x5592e3,_0x119681[_0xb14c('0x1a')][_0xb14c('0x1b')]);return _0x33cf11(_0x119681['error']['message']);}logger[_0xb14c('0x1a')](_0xb14c('0x14'),_0x5592e3,_0x119681[_0xb14c('0x1a')]['message']);return _0x395e2b(_0x119681['error'][_0xb14c('0x1b')]);}else{logger[_0xb14c('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5592e3,_0xb14c('0x15'));_0x395e2b(_0x119681[_0xb14c('0x1c')][_0xb14c('0x1b')]);}})[_0xb14c('0x1d')](function(_0x4b37da){logger[_0xb14c('0x1a')](_0xb14c('0x14'),_0x5592e3,_0x4b37da);_0x33cf11(_0x4b37da);});});}exports[_0xb14c('0x1e')]=function(_0x45fbd3){var _0x3fd8d3=this;return new Promise(function(_0x27c109,_0x301cd3){return db[_0xb14c('0x1f')][_0xb14c('0x20')](_0x45fbd3[_0xb14c('0x21')],{'raw':_0x45fbd3[_0xb14c('0x22')]?_0x45fbd3[_0xb14c('0x22')][_0xb14c('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45fbd3[_0xb14c('0x22')]?_0x45fbd3[_0xb14c('0x22')]['where']||null:null,'attributes':_0x45fbd3[_0xb14c('0x22')]?_0x45fbd3[_0xb14c('0x22')][_0xb14c('0x24')]||null:null,'limit':_0x45fbd3[_0xb14c('0x22')]?_0x45fbd3[_0xb14c('0x22')][_0xb14c('0x25')]||null:null})['then'](function(_0x2d2ac5){logger[_0xb14c('0x13')]('UpdateOpenchannelInteraction',_0x45fbd3);logger[_0xb14c('0x16')](_0xb14c('0x1e'),_0x45fbd3,JSON['stringify'](_0x2d2ac5));_0x27c109(_0x2d2ac5);})[_0xb14c('0x1d')](function(_0x2be2f3){logger[_0xb14c('0x1a')]('UpdateOpenchannelInteraction',_0x2be2f3[_0xb14c('0x1b')],_0x45fbd3);_0x301cd3(_0x3fd8d3[_0xb14c('0x1a')](0x1f4,_0x2be2f3['message']));});});};exports[_0xb14c('0x26')]=function(_0x326f10){return new Promise(function(_0x45ebae,_0x1a89cb){return db[_0xb14c('0x1f')][_0xb14c('0x27')]({'where':_0x326f10[_0xb14c('0x22')]?_0x326f10[_0xb14c('0x22')][_0xb14c('0x28')]||null:null})[_0xb14c('0x12')](function(_0x5be604){if(_0x5be604){return _0x5be604[_0xb14c('0x29')](_0x326f10['body'][_0xb14c('0x2a')],_[_0xb14c('0x2b')](_0x326f10['body'],['ids','id'])||{});}})['spread'](function(_0x208162){logger[_0xb14c('0x13')]('AddTags',_0x326f10);logger[_0xb14c('0x16')](_0xb14c('0x2c'),_0x326f10,JSON[_0xb14c('0x18')](_0x208162));_0x45ebae(_0x208162);})[_0xb14c('0x1d')](function(_0x37864b){logger[_0xb14c('0x1a')]('AddTags',_0x37864b['message'],_0x326f10);_0x1a89cb(_this[_0xb14c('0x1a')](0x1f4,_0x37864b[_0xb14c('0x1b')]));});});}; \ No newline at end of file +var _0xcbcc=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction','debug','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x1d4760,_0x5a58e7){var _0x233074=function(_0x5846fb){while(--_0x5846fb){_0x1d4760['push'](_0x1d4760['shift']());}};_0x233074(++_0x5a58e7);}(_0xcbcc,0x64));var _0xccbc=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xcbcc[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xccbc('0x0'));var util=require(_0xccbc('0x1'));var moment=require(_0xccbc('0x2'));var BPromise=require('bluebird');var rs=require(_0xccbc('0x3'));var fs=require('fs');var Redis=require(_0xccbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xccbc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xccbc('0x6'));var jayson=require(_0xccbc('0x7'));var client=jayson[_0xccbc('0x8')]['http']({'port':0x232a});config[_0xccbc('0x9')]=_['defaults'](config[_0xccbc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xccbc('0xa'))(new Redis(config['redis']));require(_0xccbc('0xb'))['register'](socket);function respondWithRpcPromise(_0x12791d,_0x118b3d,_0x474b8c){return new BPromise(function(_0xef3f60,_0x502277){return client[_0xccbc('0xc')](_0x12791d,_0x474b8c)[_0xccbc('0xd')](function(_0x5d91a8){logger[_0xccbc('0xe')](_0xccbc('0xf'),_0x118b3d,_0xccbc('0x10'));logger['debug'](_0xccbc('0x11'),_0x118b3d,_0xccbc('0x10'),JSON['stringify'](_0x5d91a8));if(_0x5d91a8[_0xccbc('0x12')]){if(_0x5d91a8[_0xccbc('0x12')][_0xccbc('0x13')]===0x1f4){logger[_0xccbc('0x12')](_0xccbc('0xf'),_0x118b3d,_0x5d91a8['error']['message']);return _0x502277(_0x5d91a8['error'][_0xccbc('0x14')]);}logger[_0xccbc('0x12')](_0xccbc('0xf'),_0x118b3d,_0x5d91a8['error'][_0xccbc('0x14')]);return _0xef3f60(_0x5d91a8[_0xccbc('0x12')][_0xccbc('0x14')]);}else{logger[_0xccbc('0xe')](_0xccbc('0xf'),_0x118b3d,_0xccbc('0x10'));_0xef3f60(_0x5d91a8[_0xccbc('0x15')][_0xccbc('0x14')]);}})[_0xccbc('0x16')](function(_0x30ba65){logger[_0xccbc('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x118b3d,_0x30ba65);_0x502277(_0x30ba65);});});}exports['UpdateOpenchannelInteraction']=function(_0x31768e){var _0x573d38=this;return new Promise(function(_0x33d78d,_0x556819){return db[_0xccbc('0x17')][_0xccbc('0x18')](_0x31768e[_0xccbc('0x19')],{'raw':_0x31768e[_0xccbc('0x1a')]?_0x31768e[_0xccbc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31768e[_0xccbc('0x1a')]?_0x31768e[_0xccbc('0x1a')][_0xccbc('0x1b')]||null:null,'attributes':_0x31768e['options']?_0x31768e['options'][_0xccbc('0x1c')]||null:null,'limit':_0x31768e[_0xccbc('0x1a')]?_0x31768e[_0xccbc('0x1a')][_0xccbc('0x1d')]||null:null})[_0xccbc('0xd')](function(_0x549907){logger['info'](_0xccbc('0x1e'),_0x31768e);logger[_0xccbc('0x1f')](_0xccbc('0x1e'),_0x31768e,JSON[_0xccbc('0x20')](_0x549907));_0x33d78d(_0x549907);})[_0xccbc('0x16')](function(_0x35a67a){logger[_0xccbc('0x12')](_0xccbc('0x1e'),_0x35a67a['message'],_0x31768e);_0x556819(_0x573d38[_0xccbc('0x12')](0x1f4,_0x35a67a['message']));});});};exports[_0xccbc('0x21')]=function(_0x551ce8){return new Promise(function(_0x12d976,_0x2eef8a){return db[_0xccbc('0x17')][_0xccbc('0x22')]({'where':_0x551ce8[_0xccbc('0x1a')]?_0x551ce8[_0xccbc('0x1a')][_0xccbc('0x1b')]||null:null})[_0xccbc('0xd')](function(_0x86304d){if(_0x86304d){return _0x86304d['addTags'](_0x551ce8[_0xccbc('0x19')][_0xccbc('0x23')],_[_0xccbc('0x24')](_0x551ce8[_0xccbc('0x19')],[_0xccbc('0x23'),'id'])||{});}})[_0xccbc('0x25')](function(_0x31304a){logger['info'](_0xccbc('0x26'),_0x551ce8);logger['debug']('AddTags',_0x551ce8,JSON[_0xccbc('0x20')](_0x31304a));_0x12d976(_0x31304a);})[_0xccbc('0x16')](function(_0x59d18e){logger[_0xccbc('0x12')]('AddTags',_0x59d18e[_0xccbc('0x14')],_0x551ce8);_0x2eef8a(_this[_0xccbc('0x12')](0x1f4,_0x59d18e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index d8b0b3b..acd5782 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 _0xf91c=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','remove','update'];(function(_0x2594bd,_0x5ec659){var _0x51d92f=function(_0x12d9b5){while(--_0x12d9b5){_0x2594bd['push'](_0x2594bd['shift']());}};_0x51d92f(++_0x5ec659);}(_0xf91c,0xe5));var _0xcf91=function(_0x4845bc,_0x25e144){_0x4845bc=_0x4845bc-0x0;var _0x82713d=_0xf91c[_0x4845bc];return _0x82713d;};'use strict';var OpenchannelInteractionEvents=require(_0xcf91('0x0'));var events=['save',_0xcf91('0x1'),_0xcf91('0x2')];function createListener(_0x3a363e,_0x3f28fa){return function(_0x2175e2){_0x3f28fa[_0xcf91('0x3')](_0x3a363e,_0x2175e2);};}function removeListener(_0x240ab5,_0x268b0e){return function(){OpenchannelInteractionEvents[_0xcf91('0x4')](_0x240ab5,_0x268b0e);};}exports[_0xcf91('0x5')]=function(_0x50f7e2){for(var _0x23e27c=0x0,_0x7be6c4=events[_0xcf91('0x6')];_0x23e27c<_0x7be6c4;_0x23e27c++){var _0x2bce5e=events[_0x23e27c];var _0x5d950c=createListener(_0xcf91('0x7')+_0x2bce5e,_0x50f7e2);OpenchannelInteractionEvents['on'](_0x2bce5e,_0x5d950c);}}; \ No newline at end of file +var _0xcb4c=['length','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x3c2863,_0x1b2cee){var _0x2c3d27=function(_0x4f831b){while(--_0x4f831b){_0x3c2863['push'](_0x3c2863['shift']());}};_0x2c3d27(++_0x1b2cee);}(_0xcb4c,0x190));var _0xccb4=function(_0x4e8972,_0x17179a){_0x4e8972=_0x4e8972-0x0;var _0x521cb5=_0xcb4c[_0x4e8972];return _0x521cb5;};'use strict';var OpenchannelInteractionEvents=require(_0xccb4('0x0'));var events=['save',_0xccb4('0x1'),_0xccb4('0x2')];function createListener(_0x5af41f,_0xc34e9d){return function(_0x529e39){_0xc34e9d[_0xccb4('0x3')](_0x5af41f,_0x529e39);};}function removeListener(_0x2f9090,_0x2a71ae){return function(){OpenchannelInteractionEvents[_0xccb4('0x4')](_0x2f9090,_0x2a71ae);};}exports[_0xccb4('0x5')]=function(_0x4d8b83){for(var _0x450d8f=0x0,_0x4201f8=events[_0xccb4('0x6')];_0x450d8f<_0x4201f8;_0x450d8f++){var _0x2fcd83=events[_0x450d8f];var _0x38310a=createListener('openchannelInteraction:'+_0x2fcd83,_0x4d8b83);OpenchannelInteractionEvents['on'](_0x2fcd83,_0x38310a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 675e340..9060fc6 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0xbc73a4,_0x5394a0){_0xbc73a4=_0xbc73a4-0x0;var _0x2da626=_0x70e0[_0xbc73a4];return _0x2da626;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x1b1aee,_0x57c8ed){var _0x276aa2=function(_0x3c01b2){while(--_0x3c01b2){_0x1b1aee['push'](_0x1b1aee['shift']());}};_0x276aa2(++_0x57c8ed);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xcb91[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5911ef5..781a668 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 _0xed3c=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x2473f4,_0x4a22e5){var _0x1940f3=function(_0x441dbe){while(--_0x441dbe){_0x2473f4['push'](_0x2473f4['shift']());}};_0x1940f3(++_0x4a22e5);}(_0xed3c,0x1a6));var _0xced3=function(_0x39cc09,_0x500de7){_0x39cc09=_0x39cc09-0x0;var _0x10eadd=_0xed3c[_0x39cc09];return _0x10eadd;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'body':{'type':Sequelize[_0xced3('0x2')](_0xced3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xced3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xced3('0x5')]('in',_0xced3('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xced3('0x7')]},'providerResponse':{'type':Sequelize[_0xced3('0x2')]}}; \ No newline at end of file +var _0x43c8=['exports','medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x43c8,0xaf));var _0x843c=function(_0x310464,_0x4641e8){_0x310464=_0x310464-0x0;var _0x356909=_0x43c8[_0x310464];return _0x356909;};'use strict';var Sequelize=require('sequelize');module[_0x843c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x843c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x843c('0x3')]('in',_0x843c('0x4')),'defaultValue':_0x843c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x843c('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x843c('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 0e90245..d108290 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 _0xbe04=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','name','index','map','OpenchannelMessage','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','show','params','length','create','body','find','openchannel-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x437f5c,_0x5b060e){var _0x1820b3=function(_0x30269d){while(--_0x30269d){_0x437f5c['push'](_0x437f5c['shift']());}};_0x1820b3(++_0x5b060e);}(_0xbe04,0x16b));var _0x4be0=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xbe04[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0x4be0('0x0'));var rimraf=require(_0x4be0('0x1'));var zipdir=require(_0x4be0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4be0('0x3'));var moment=require(_0x4be0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4be0('0x5'));var util=require(_0x4be0('0x6'));var path=require(_0x4be0('0x7'));var sox=require(_0x4be0('0x8'));var csv=require(_0x4be0('0x9'));var ejs=require(_0x4be0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4be0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4be0('0xc'));var deskjs=require(_0x4be0('0xd'));var toCsv=require(_0x4be0('0x9'));var querystring=require('querystring');var Papa=require(_0x4be0('0xe'));var Redis=require(_0x4be0('0xf'));var authService=require(_0x4be0('0x10'));var qs=require(_0x4be0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4be0('0x12'))(_0x4be0('0x13'));var utils=require(_0x4be0('0x14'));var config=require(_0x4be0('0x15'));var licenseUtil=require(_0x4be0('0x16'));var db=require(_0x4be0('0x17'))['db'];config[_0x4be0('0x18')]=_[_0x4be0('0x19')](config[_0x4be0('0x18')],{'host':_0x4be0('0x1a'),'port':0x18eb});var socket=require(_0x4be0('0x1b'))(new Redis(config[_0x4be0('0x18')]));require(_0x4be0('0x1c'))['register'](socket);var jayson=require(_0x4be0('0x1d'));var client=jayson[_0x4be0('0x1e')][_0x4be0('0x1f')]({'port':0x232c});var client9002=jayson[_0x4be0('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29968d,_0x8225b2,_0x49815d,_0x2cca0c){return new BPromise(function(_0x4073c9,_0x495cdd){var _0x4433b9=_0x2cca0c||client;return _0x4433b9[_0x4be0('0x20')](_0x29968d,_0x49815d)['then'](function(_0xd184d4){logger[_0x4be0('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x8225b2,'request\x20sent');logger[_0x4be0('0x22')](_0x4be0('0x23'),_0x8225b2,_0x4be0('0x24'),JSON[_0x4be0('0x25')](_0xd184d4));if(_0xd184d4[_0x4be0('0x26')]){if(_0xd184d4[_0x4be0('0x26')][_0x4be0('0x27')]===0x1f4){logger[_0x4be0('0x26')](_0x4be0('0x28'),_0x8225b2,_0xd184d4['error'][_0x4be0('0x29')]);return _0x495cdd(_0xd184d4['error']['message']);}logger[_0x4be0('0x26')](_0x4be0('0x28'),_0x8225b2,_0xd184d4[_0x4be0('0x26')][_0x4be0('0x29')]);return _0x4073c9(_0xd184d4['error']['message']);}else{logger[_0x4be0('0x21')](_0x4be0('0x28'),_0x8225b2,'request\x20sent');_0x4073c9(_0xd184d4['result']['message']);}})[_0x4be0('0x2a')](function(_0x5c2475){logger[_0x4be0('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x8225b2,_0x5c2475);_0x495cdd(_0x5c2475);});});}function respondWithStatusCode(_0xdf6c12,_0x3c7130){_0x3c7130=_0x3c7130||0xcc;return function(_0x3c74ac){if(_0x3c74ac){return _0xdf6c12[_0x4be0('0x2b')](_0x3c7130);}return _0xdf6c12[_0x4be0('0x2c')](_0x3c7130)[_0x4be0('0x2d')]();};}function respondWithResult(_0xb12a4f,_0x3e2969){_0x3e2969=_0x3e2969||0xc8;return function(_0x18f160){if(_0x18f160){return _0xb12a4f[_0x4be0('0x2c')](_0x3e2969)[_0x4be0('0x2e')](_0x18f160);}};}function respondWithFilteredResult(_0x154f6a,_0x5d714c){return function(_0x444af1){if(_0x444af1){var _0x41787c=typeof _0x5d714c[_0x4be0('0x2f')]===_0x4be0('0x30')&&typeof _0x5d714c['limit']==='undefined';var _0x78c4a1=_0x444af1[_0x4be0('0x31')];var _0x47926d=_0x41787c?0x0:_0x5d714c[_0x4be0('0x2f')];var _0x413a9a=_0x41787c?_0x444af1[_0x4be0('0x31')]:_0x5d714c[_0x4be0('0x2f')]+_0x5d714c[_0x4be0('0x32')];var _0x34f250;if(_0x413a9a>=_0x78c4a1){_0x413a9a=_0x78c4a1;_0x34f250=0xc8;}else{_0x34f250=0xce;}_0x154f6a[_0x4be0('0x2c')](_0x34f250);return _0x154f6a[_0x4be0('0x33')](_0x4be0('0x34'),_0x47926d+'-'+_0x413a9a+'/'+_0x78c4a1)[_0x4be0('0x2e')](_0x444af1);}return null;};}function patchUpdates(_0x4d454a){return function(_0xbff88e){try{jsonpatch[_0x4be0('0x35')](_0xbff88e,_0x4d454a,!![]);}catch(_0x494259){return BPromise['reject'](_0x494259);}return _0xbff88e[_0x4be0('0x36')]();};}function saveUpdates(_0x4ea019,_0x2bbb6c){return function(_0x3db46c){if(_0x3db46c){return _0x3db46c[_0x4be0('0x37')](_0x4ea019)[_0x4be0('0x38')](function(_0x41406d){return _0x41406d;});}return null;};}function removeEntity(_0x9c9c76,_0x17d476){return function(_0x32d974){if(_0x32d974){return _0x32d974[_0x4be0('0x39')]()['then'](function(){_0x9c9c76[_0x4be0('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aa8b7,_0x1bc759){return function(_0x49c53a){if(!_0x49c53a){_0x3aa8b7[_0x4be0('0x2b')](0x194);}return _0x49c53a;};}function handleError(_0xda2c4c,_0x27888e){_0x27888e=_0x27888e||0x1f4;return function(_0x1adac2){logger[_0x4be0('0x26')](_0x1adac2['stack']);if(_0x1adac2[_0x4be0('0x3a')]){delete _0x1adac2[_0x4be0('0x3a')];}_0xda2c4c[_0x4be0('0x2c')](_0x27888e)['send'](_0x1adac2);};}exports[_0x4be0('0x3b')]=function(_0x355d47,_0x13677e){var _0x89c81c={},_0x341d6e={},_0x2b0913={'count':0x0,'rows':[]};var _0x261fd5=_[_0x4be0('0x3c')](db[_0x4be0('0x3d')][_0x4be0('0x3e')],function(_0x12463f){return{'name':_0x12463f[_0x4be0('0x3f')],'type':_0x12463f['type']['key']};});_0x341d6e[_0x4be0('0x40')]=_['map'](_0x261fd5,'name');_0x341d6e[_0x4be0('0x41')]=_['keys'](_0x355d47['query']);_0x341d6e[_0x4be0('0x42')]=_[_0x4be0('0x43')](_0x341d6e[_0x4be0('0x40')],_0x341d6e[_0x4be0('0x41')]);_0x89c81c[_0x4be0('0x44')]=_[_0x4be0('0x43')](_0x341d6e[_0x4be0('0x40')],qs[_0x4be0('0x45')](_0x355d47[_0x4be0('0x41')]['fields']));_0x89c81c[_0x4be0('0x44')]=_0x89c81c['attributes']['length']?_0x89c81c['attributes']:_0x341d6e[_0x4be0('0x40')];if(!_0x355d47[_0x4be0('0x41')]['hasOwnProperty'](_0x4be0('0x46'))){_0x89c81c[_0x4be0('0x32')]=qs['limit'](_0x355d47[_0x4be0('0x41')][_0x4be0('0x32')]);_0x89c81c[_0x4be0('0x2f')]=qs['offset'](_0x355d47[_0x4be0('0x41')][_0x4be0('0x2f')]);}_0x89c81c[_0x4be0('0x47')]=qs['sort'](_0x355d47[_0x4be0('0x41')][_0x4be0('0x48')]);_0x89c81c['where']=qs[_0x4be0('0x42')](_[_0x4be0('0x49')](_0x355d47[_0x4be0('0x41')],_0x341d6e[_0x4be0('0x42')]),_0x261fd5);if(_0x355d47[_0x4be0('0x41')][_0x4be0('0x4a')]){_0x89c81c[_0x4be0('0x4b')]=_[_0x4be0('0x4c')](_0x89c81c[_0x4be0('0x4b')],{'$or':_['map'](_0x261fd5,function(_0x18fc9e){if(_0x18fc9e[_0x4be0('0x4d')]!=='VIRTUAL'){var _0x1b889a={};_0x1b889a[_0x18fc9e[_0x4be0('0x3a')]]={'$like':'%'+_0x355d47['query'][_0x4be0('0x4a')]+'%'};return _0x1b889a;}})});}_0x89c81c=_['merge']({},_0x89c81c,_0x355d47['options']);var _0xde2f93={'where':_0x89c81c[_0x4be0('0x4b')]};return db[_0x4be0('0x3d')]['count'](_0xde2f93)[_0x4be0('0x38')](function(_0x53fb26){_0x2b0913[_0x4be0('0x31')]=_0x53fb26;if(_0x355d47[_0x4be0('0x41')]['includeAll']){_0x89c81c[_0x4be0('0x4e')]=[{'all':!![]}];}return db[_0x4be0('0x3d')][_0x4be0('0x4f')](_0x89c81c);})['then'](function(_0x2bfc0d){_0x2b0913[_0x4be0('0x50')]=_0x2bfc0d;return _0x2b0913;})[_0x4be0('0x38')](respondWithFilteredResult(_0x13677e,_0x89c81c))['catch'](handleError(_0x13677e,null));};exports[_0x4be0('0x51')]=function(_0x15db48,_0x40e3b9){var _0x416aca={'raw':!![],'where':{'id':_0x15db48[_0x4be0('0x52')]['id']}},_0x5a04a2={};_0x5a04a2[_0x4be0('0x40')]=_['keys'](db[_0x4be0('0x3d')][_0x4be0('0x3e')]);_0x5a04a2[_0x4be0('0x41')]=_['keys'](_0x15db48['query']);_0x5a04a2[_0x4be0('0x42')]=_[_0x4be0('0x43')](_0x5a04a2['model'],_0x5a04a2[_0x4be0('0x41')]);_0x416aca[_0x4be0('0x44')]=_['intersection'](_0x5a04a2[_0x4be0('0x40')],qs[_0x4be0('0x45')](_0x15db48['query'][_0x4be0('0x45')]));_0x416aca[_0x4be0('0x44')]=_0x416aca['attributes'][_0x4be0('0x53')]?_0x416aca[_0x4be0('0x44')]:_0x5a04a2['model'];if(_0x15db48[_0x4be0('0x41')]['includeAll']){_0x416aca[_0x4be0('0x4e')]=[{'all':!![]}];}_0x416aca=_[_0x4be0('0x4c')]({},_0x416aca,_0x15db48['options']);return db[_0x4be0('0x3d')]['find'](_0x416aca)[_0x4be0('0x38')](handleEntityNotFound(_0x40e3b9,null))[_0x4be0('0x38')](respondWithResult(_0x40e3b9,null))[_0x4be0('0x2a')](handleError(_0x40e3b9,null));};exports[_0x4be0('0x54')]=function(_0x16ba2f,_0x56ad90){return db[_0x4be0('0x3d')][_0x4be0('0x54')](_0x16ba2f[_0x4be0('0x55')],{})[_0x4be0('0x38')](respondWithResult(_0x56ad90,0xc9))[_0x4be0('0x2a')](handleError(_0x56ad90,null));};exports[_0x4be0('0x37')]=function(_0x475aec,_0x2e8fb4){if(_0x475aec[_0x4be0('0x55')]['id']){delete _0x475aec[_0x4be0('0x55')]['id'];}return db[_0x4be0('0x3d')]['find']({'where':{'id':_0x475aec[_0x4be0('0x52')]['id']}})[_0x4be0('0x38')](handleEntityNotFound(_0x2e8fb4,null))[_0x4be0('0x38')](saveUpdates(_0x475aec['body'],null))['then'](respondWithResult(_0x2e8fb4,null))[_0x4be0('0x2a')](handleError(_0x2e8fb4,null));};exports[_0x4be0('0x39')]=function(_0x3f5dea,_0xa70396){return db[_0x4be0('0x3d')][_0x4be0('0x56')]({'where':{'id':_0x3f5dea[_0x4be0('0x52')]['id']}})['then'](handleEntityNotFound(_0xa70396,null))['then'](removeEntity(_0xa70396,null))[_0x4be0('0x2a')](handleError(_0xa70396,null));};exports['describe']=function(_0x33b98d,_0xe0ee5d){return db[_0x4be0('0x3d')]['describe']()['then'](respondWithResult(_0xe0ee5d,null))['catch'](handleError(_0xe0ee5d,null));};var interaction_log=require('../../config/logger')(_0x4be0('0x57'));exports[_0x4be0('0x58')]=function(_0x4fd8ec,_0x21044a,_0x679645){var _0x460b56={'agent':{},'channel':'openchannel'};if(_0x4fd8ec[_0x4be0('0x55')]['id']){delete _0x4fd8ec[_0x4be0('0x55')]['id'];}_0x4fd8ec['body'][_0x4be0('0x59')]=!![];_0x4fd8ec[_0x4be0('0x55')][_0x4be0('0x5a')]=moment()['format'](_0x4be0('0x5b'));_0x4fd8ec[_0x4be0('0x55')][_0x4be0('0x5c')]=_0x4fd8ec[_0x4be0('0x55')][_0x4be0('0x5c')]||_0x4fd8ec[_0x4be0('0x5d')]['id'];_0x460b56[_0x4be0('0x5e')]['id']=_0x4fd8ec['body']['UserId'];return db['OpenchannelMessage'][_0x4be0('0x56')]({'where':{'id':_0x4fd8ec[_0x4be0('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21044a,null))['then'](saveUpdates(_0x4fd8ec[_0x4be0('0x55')],null))[_0x4be0('0x38')](function(_0x533f51){if(_0x533f51){_0x460b56[_0x4be0('0x29')]=_0x533f51[_0x4be0('0x5f')]({'plain':!![]});return db[_0x4be0('0x60')][_0x4be0('0x56')]({'where':{'id':_0x533f51['OpenchannelInteractionId']}});}return null;})[_0x4be0('0x38')](handleEntityNotFound(_0x21044a,null))[_0x4be0('0x38')](function(_0x3f4b57){if(_0x3f4b57){return _0x3f4b57[_0x4be0('0x37')]({'UserId':_0x4fd8ec['body']['UserId'],'read1stAt':_['isNil'](_0x3f4b57[_0x4be0('0x61')])?moment()['format'](_0x4be0('0x5b')):undefined});}return null;})[_0x4be0('0x38')](function(_0x33d4b6){if(_0x33d4b6){_0x460b56['interaction']=_0x33d4b6[_0x4be0('0x5f')]({'plain':!![]});interaction_log['info'](_0x4be0('0x62'),_0x4fd8ec['user']['id'],_0x4fd8ec[_0x4be0('0x5d')][_0x4be0('0x3a')],_0x4fd8ec[_0x4be0('0x5d')][_0x4be0('0x63')],_0x460b56[_0x4be0('0x64')]['id'],_0x4fd8ec[_0x4be0('0x55')]?JSON[_0x4be0('0x25')](_0x4fd8ec[_0x4be0('0x55')]):_0x4be0('0x65'));return respondWithRpcPromise(_0x4be0('0x66'),_0x4be0('0x67'),_0x460b56);}return null;})[_0x4be0('0x38')](function(_0x545dc3){var _0x24e3e6=_0x4be0('0x68')+_0x545dc3[_0x4be0('0x29')][_0x4be0('0x69')];return db[_0x4be0('0x6a')][_0x4be0('0x41')](_0x24e3e6,{'type':db[_0x4be0('0x6b')][_0x4be0('0x6c')][_0x4be0('0x6d')],'raw':!![]})[_0x4be0('0x38')](function(_0x20c780){return _0x20c780;});})['then'](function(_0x2cd2d2){if(_0x2cd2d2){_0x460b56[_0x4be0('0x29')][_0x4be0('0x6e')]=_0x2cd2d2[0x0];if(!_0x4fd8ec[_0x4be0('0x55')][_0x4be0('0x5c')])return;return db['User'][_0x4be0('0x56')]({'where':{'id':_0x4fd8ec['body'][_0x4be0('0x5c')],'role':_0x4be0('0x5e')},'attributes':['id',_0x4be0('0x3a'),_0x4be0('0x6f'),_0x4be0('0x70'),_0x4be0('0x71')],'raw':!![]});}return null;})['then'](function(_0x2873fd){if(!_0x2873fd)return null;_0x460b56['message'][_0x4be0('0x5e')]=_0x2873fd;return _0x460b56;})[_0x4be0('0x38')](function(_0x4050f0){if(_0x4050f0){if(_0x4fd8ec[_0x4be0('0x55')][_0x4be0('0x72')]){_0x460b56[_0x4be0('0x29')][_0x4be0('0x73')]=util[_0x4be0('0x74')](_0x4be0('0x75'),_0x4fd8ec[_0x4be0('0x5d')][_0x4be0('0x3a')]);_0x460b56[_0x4be0('0x29')]['channel']=_0x460b56[_0x4be0('0x76')];_0x460b56['message'][_0x4be0('0x77')]='accept';return respondWithRpcPromise('EventManager',_0x4be0('0x78'),{'event':_0x4be0('0x79'),'message':_0x460b56[_0x4be0('0x29')]},client9002)[_0x4be0('0x38')](function(){return _0x460b56;});}return _0x460b56;}return null;})[_0x4be0('0x38')](respondWithResult(_0x21044a,null))['catch'](handleError(_0x21044a,null));};var interaction_log=require(_0x4be0('0x12'))(_0x4be0('0x57'));exports[_0x4be0('0x7a')]=function(_0x18c30e,_0x506b7b,_0x20f65d){var _0x3c00b2={'agent':{},'channel':'openchannel'};if(_0x18c30e[_0x4be0('0x55')]['id']){delete _0x18c30e[_0x4be0('0x55')]['id'];}_0x18c30e[_0x4be0('0x55')]['UserId']=_0x18c30e[_0x4be0('0x55')][_0x4be0('0x5c')]||_0x18c30e[_0x4be0('0x5d')]['id'];_0x3c00b2[_0x4be0('0x5e')]['id']=_0x18c30e['body'][_0x4be0('0x5c')];return db[_0x4be0('0x3d')][_0x4be0('0x56')]({'where':{'id':_0x18c30e['params']['id'],'UserId':null}})[_0x4be0('0x38')](handleEntityNotFound(_0x506b7b,null))[_0x4be0('0x38')](function(_0x54de5f){if(_0x54de5f){_0x3c00b2[_0x4be0('0x29')]=_0x54de5f[_0x4be0('0x5f')]({'plain':!![]});return db[_0x4be0('0x60')][_0x4be0('0x56')]({'where':{'id':_0x54de5f[_0x4be0('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x506b7b,null))[_0x4be0('0x38')](function(_0x51352c){if(_0x51352c){_0x3c00b2[_0x4be0('0x64')]=_0x51352c['get']({'plain':!![]});interaction_log[_0x4be0('0x21')](_0x4be0('0x7c'),_0x18c30e[_0x4be0('0x5d')]['id'],_0x18c30e[_0x4be0('0x5d')][_0x4be0('0x3a')],_0x18c30e[_0x4be0('0x5d')]['role'],_0x3c00b2['interaction']['id'],_0x18c30e[_0x4be0('0x55')]?JSON['stringify'](_0x18c30e[_0x4be0('0x55')]):_0x4be0('0x65'));return respondWithRpcPromise(_0x4be0('0x7d'),'rejectMessage',_0x3c00b2);}return null;})['then'](function(_0xe7c8b1){var _0x137d85=_0x4be0('0x68')+_0xe7c8b1[_0x4be0('0x29')][_0x4be0('0x69')];return db['sequelize'][_0x4be0('0x41')](_0x137d85,{'type':db[_0x4be0('0x6b')][_0x4be0('0x6c')][_0x4be0('0x6d')],'raw':!![]})['then'](function(_0x57e808){return _0x57e808;});})[_0x4be0('0x38')](function(_0x10008a){if(_0x10008a){_0x3c00b2['message'][_0x4be0('0x6e')]=_0x10008a[0x0];if(!_0x18c30e[_0x4be0('0x55')][_0x4be0('0x5c')])return;return db[_0x4be0('0x7e')][_0x4be0('0x56')]({'where':{'id':_0x18c30e['body'][_0x4be0('0x5c')],'role':_0x4be0('0x5e')},'attributes':['id',_0x4be0('0x3a'),'fullname',_0x4be0('0x70'),_0x4be0('0x71')],'raw':!![]});}return null;})[_0x4be0('0x38')](function(_0x4103a1){if(!_0x4103a1)return null;_0x3c00b2[_0x4be0('0x29')][_0x4be0('0x5e')]=_0x4103a1;return _0x3c00b2;})[_0x4be0('0x38')](function(_0x1a28cc){if(_0x1a28cc){_0x1a28cc[_0x4be0('0x29')][_0x4be0('0x73')]=util[_0x4be0('0x74')](_0x4be0('0x75'),_0x18c30e[_0x4be0('0x5d')]['name']);_0x1a28cc[_0x4be0('0x29')][_0x4be0('0x76')]=_0x3c00b2[_0x4be0('0x76')];_0x1a28cc[_0x4be0('0x29')][_0x4be0('0x77')]=_0x4be0('0x7a');respondWithRpcPromise(_0x4be0('0x78'),_0x4be0('0x78'),{'event':'rejectmessage','message':_0x1a28cc['message']},client9002);return _0x3c00b2;}return null;})[_0x4be0('0x38')](respondWithResult(_0x506b7b,null))[_0x4be0('0x2a')](handleError(_0x506b7b,null));}; \ No newline at end of file +var _0xb05b=['sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','key','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','fields','options','find','create','body','describe','openchannel-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','fullname','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel','rejectMessage','QueryTypes','SELECT','email','internal','rejectmessage','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4f042f,_0x4e834a){var _0x5e9a2c=function(_0x528143){while(--_0x528143){_0x4f042f['push'](_0x4f042f['shift']());}};_0x5e9a2c(++_0x4e834a);}(_0xb05b,0xd1));var _0xbb05=function(_0x2aae2d,_0x257260){_0x2aae2d=_0x2aae2d-0x0;var _0x420302=_0xb05b[_0x2aae2d];return _0x420302;};'use strict';var emlformat=require(_0xbb05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbb05('0x2'));var BPromise=require(_0xbb05('0x3'));var Mustache=require(_0xbb05('0x4'));var util=require('util');var path=require(_0xbb05('0x5'));var sox=require(_0xbb05('0x6'));var csv=require(_0xbb05('0x7'));var ejs=require(_0xbb05('0x8'));var fs=require('fs');var fs_extra=require(_0xbb05('0x9'));var _=require(_0xbb05('0xa'));var squel=require('squel');var crypto=require(_0xbb05('0xb'));var jsforce=require(_0xbb05('0xc'));var deskjs=require(_0xbb05('0xd'));var toCsv=require(_0xbb05('0x7'));var querystring=require(_0xbb05('0xe'));var Papa=require('papaparse');var Redis=require(_0xbb05('0xf'));var authService=require(_0xbb05('0x10'));var qs=require(_0xbb05('0x11'));var as=require(_0xbb05('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb05('0x13'))(_0xbb05('0x14'));var utils=require(_0xbb05('0x15'));var config=require(_0xbb05('0x16'));var licenseUtil=require(_0xbb05('0x17'));var db=require(_0xbb05('0x18'))['db'];config['redis']=_[_0xbb05('0x19')](config[_0xbb05('0x1a')],{'host':_0xbb05('0x1b'),'port':0x18eb});var socket=require(_0xbb05('0x1c'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xbb05('0x1d'));var client=jayson[_0xbb05('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xbb05('0x1e')][_0xbb05('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x166d54,_0x2f4258,_0x5366c8,_0x286a3a){return new BPromise(function(_0x4843df,_0x5681e6){var _0x43450b=_0x286a3a||client;return _0x43450b[_0xbb05('0x20')](_0x166d54,_0x5366c8)[_0xbb05('0x21')](function(_0x4f471f){logger[_0xbb05('0x22')](_0xbb05('0x23'),_0x2f4258,'request\x20sent');logger[_0xbb05('0x24')](_0xbb05('0x25'),_0x2f4258,_0xbb05('0x26'),JSON[_0xbb05('0x27')](_0x4f471f));if(_0x4f471f[_0xbb05('0x28')]){if(_0x4f471f[_0xbb05('0x28')][_0xbb05('0x29')]===0x1f4){logger[_0xbb05('0x28')](_0xbb05('0x23'),_0x2f4258,_0x4f471f['error'][_0xbb05('0x2a')]);return _0x5681e6(_0x4f471f[_0xbb05('0x28')][_0xbb05('0x2a')]);}logger[_0xbb05('0x28')](_0xbb05('0x23'),_0x2f4258,_0x4f471f[_0xbb05('0x28')][_0xbb05('0x2a')]);return _0x4843df(_0x4f471f[_0xbb05('0x28')]['message']);}else{logger[_0xbb05('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f4258,_0xbb05('0x26'));_0x4843df(_0x4f471f['result']['message']);}})['catch'](function(_0x5385d3){logger[_0xbb05('0x28')](_0xbb05('0x23'),_0x2f4258,_0x5385d3);_0x5681e6(_0x5385d3);});});}function respondWithStatusCode(_0x311b14,_0x1d4c37){_0x1d4c37=_0x1d4c37||0xcc;return function(_0x36c4db){if(_0x36c4db){return _0x311b14[_0xbb05('0x2b')](_0x1d4c37);}return _0x311b14[_0xbb05('0x2c')](_0x1d4c37)['end']();};}function respondWithResult(_0x414707,_0x29d58a){_0x29d58a=_0x29d58a||0xc8;return function(_0x4e4c2c){if(_0x4e4c2c){return _0x414707[_0xbb05('0x2c')](_0x29d58a)['json'](_0x4e4c2c);}};}function respondWithFilteredResult(_0x3387f6,_0x4b2a03){return function(_0x26ceb6){if(_0x26ceb6){var _0x47c156=typeof _0x4b2a03[_0xbb05('0x2d')]===_0xbb05('0x2e')&&typeof _0x4b2a03[_0xbb05('0x2f')]===_0xbb05('0x2e');var _0x403443=_0x26ceb6[_0xbb05('0x30')];var _0x17ec86=_0x47c156?0x0:_0x4b2a03[_0xbb05('0x2d')];var _0x2b25a5=_0x47c156?_0x26ceb6[_0xbb05('0x30')]:_0x4b2a03['offset']+_0x4b2a03['limit'];var _0x305755;if(_0x2b25a5>=_0x403443){_0x2b25a5=_0x403443;_0x305755=0xc8;}else{_0x305755=0xce;}_0x3387f6['status'](_0x305755);return _0x3387f6[_0xbb05('0x31')](_0xbb05('0x32'),_0x17ec86+'-'+_0x2b25a5+'/'+_0x403443)['json'](_0x26ceb6);}return null;};}function patchUpdates(_0x4a6dd7){return function(_0x41791d){try{jsonpatch[_0xbb05('0x33')](_0x41791d,_0x4a6dd7,!![]);}catch(_0x4a5a15){return BPromise[_0xbb05('0x34')](_0x4a5a15);}return _0x41791d[_0xbb05('0x35')]();};}function saveUpdates(_0x25e023,_0x9d4bd){return function(_0x5c6d66){if(_0x5c6d66){return _0x5c6d66[_0xbb05('0x36')](_0x25e023)[_0xbb05('0x21')](function(_0x7dd079){return _0x7dd079;});}return null;};}function removeEntity(_0x15b82c,_0x27f0f8){return function(_0x5dd1fd){if(_0x5dd1fd){return _0x5dd1fd[_0xbb05('0x37')]()[_0xbb05('0x21')](function(){_0x15b82c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfeebda,_0x16ea4d){return function(_0x5f2ffc){if(!_0x5f2ffc){_0xfeebda[_0xbb05('0x2b')](0x194);}return _0x5f2ffc;};}function handleError(_0x350e51,_0x82cd71){_0x82cd71=_0x82cd71||0x1f4;return function(_0x168b42){logger[_0xbb05('0x28')](_0x168b42[_0xbb05('0x38')]);if(_0x168b42[_0xbb05('0x39')]){delete _0x168b42['name'];}_0x350e51[_0xbb05('0x2c')](_0x82cd71)[_0xbb05('0x3a')](_0x168b42);};}exports[_0xbb05('0x3b')]=function(_0x267ec6,_0x20e622){var _0x4038ec={},_0x2a9de3={},_0x66cab2={'count':0x0,'rows':[]};var _0x5c39e3=_['map'](db[_0xbb05('0x3c')][_0xbb05('0x3d')],function(_0x5ee6cf){return{'name':_0x5ee6cf['fieldName'],'type':_0x5ee6cf['type'][_0xbb05('0x3e')]};});_0x2a9de3[_0xbb05('0x3f')]=_['map'](_0x5c39e3,_0xbb05('0x39'));_0x2a9de3[_0xbb05('0x40')]=_['keys'](_0x267ec6[_0xbb05('0x40')]);_0x2a9de3['filters']=_['intersection'](_0x2a9de3['model'],_0x2a9de3['query']);_0x4038ec['attributes']=_['intersection'](_0x2a9de3[_0xbb05('0x3f')],qs['fields'](_0x267ec6[_0xbb05('0x40')]['fields']));_0x4038ec[_0xbb05('0x41')]=_0x4038ec['attributes']['length']?_0x4038ec[_0xbb05('0x41')]:_0x2a9de3[_0xbb05('0x3f')];if(!_0x267ec6['query'][_0xbb05('0x42')](_0xbb05('0x43'))){_0x4038ec[_0xbb05('0x2f')]=qs[_0xbb05('0x2f')](_0x267ec6['query'][_0xbb05('0x2f')]);_0x4038ec['offset']=qs[_0xbb05('0x2d')](_0x267ec6[_0xbb05('0x40')][_0xbb05('0x2d')]);}_0x4038ec[_0xbb05('0x44')]=qs[_0xbb05('0x45')](_0x267ec6['query']['sort']);_0x4038ec[_0xbb05('0x46')]=qs[_0xbb05('0x47')](_[_0xbb05('0x48')](_0x267ec6[_0xbb05('0x40')],_0x2a9de3[_0xbb05('0x47')]),_0x5c39e3);if(_0x267ec6[_0xbb05('0x40')][_0xbb05('0x49')]){_0x4038ec['where']=_[_0xbb05('0x4a')](_0x4038ec[_0xbb05('0x46')],{'$or':_['map'](_0x5c39e3,function(_0xadddf2){if(_0xadddf2[_0xbb05('0x4b')]!==_0xbb05('0x4c')){var _0x4428a7={};_0x4428a7[_0xadddf2[_0xbb05('0x39')]]={'$like':'%'+_0x267ec6[_0xbb05('0x40')][_0xbb05('0x49')]+'%'};return _0x4428a7;}})});}_0x4038ec=_[_0xbb05('0x4a')]({},_0x4038ec,_0x267ec6['options']);var _0x156345={'where':_0x4038ec[_0xbb05('0x46')]};return db[_0xbb05('0x3c')][_0xbb05('0x30')](_0x156345)[_0xbb05('0x21')](function(_0x71101e){_0x66cab2[_0xbb05('0x30')]=_0x71101e;if(_0x267ec6['query'][_0xbb05('0x4d')]){_0x4038ec[_0xbb05('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xbb05('0x4f')](_0x4038ec);})['then'](function(_0x18cde1){_0x66cab2['rows']=_0x18cde1;return _0x66cab2;})[_0xbb05('0x21')](respondWithFilteredResult(_0x20e622,_0x4038ec))[_0xbb05('0x50')](handleError(_0x20e622,null));};exports[_0xbb05('0x51')]=function(_0x4425db,_0x153486){var _0x52694d={'raw':!![],'where':{'id':_0x4425db[_0xbb05('0x52')]['id']}},_0x4b1e10={};_0x4b1e10['model']=_[_0xbb05('0x53')](db['OpenchannelMessage']['rawAttributes']);_0x4b1e10[_0xbb05('0x40')]=_[_0xbb05('0x53')](_0x4425db['query']);_0x4b1e10[_0xbb05('0x47')]=_['intersection'](_0x4b1e10['model'],_0x4b1e10[_0xbb05('0x40')]);_0x52694d[_0xbb05('0x41')]=_['intersection'](_0x4b1e10[_0xbb05('0x3f')],qs['fields'](_0x4425db[_0xbb05('0x40')][_0xbb05('0x54')]));_0x52694d['attributes']=_0x52694d[_0xbb05('0x41')]['length']?_0x52694d[_0xbb05('0x41')]:_0x4b1e10[_0xbb05('0x3f')];if(_0x4425db[_0xbb05('0x40')][_0xbb05('0x4d')]){_0x52694d[_0xbb05('0x4e')]=[{'all':!![]}];}_0x52694d=_[_0xbb05('0x4a')]({},_0x52694d,_0x4425db[_0xbb05('0x55')]);return db[_0xbb05('0x3c')][_0xbb05('0x56')](_0x52694d)[_0xbb05('0x21')](handleEntityNotFound(_0x153486,null))['then'](respondWithResult(_0x153486,null))[_0xbb05('0x50')](handleError(_0x153486,null));};exports[_0xbb05('0x57')]=function(_0x58f564,_0x30b422){return db['OpenchannelMessage'][_0xbb05('0x57')](_0x58f564['body'],{})[_0xbb05('0x21')](respondWithResult(_0x30b422,0xc9))[_0xbb05('0x50')](handleError(_0x30b422,null));};exports[_0xbb05('0x36')]=function(_0x1bbebf,_0x1f3208){if(_0x1bbebf[_0xbb05('0x58')]['id']){delete _0x1bbebf['body']['id'];}return db[_0xbb05('0x3c')]['find']({'where':{'id':_0x1bbebf[_0xbb05('0x52')]['id']}})['then'](handleEntityNotFound(_0x1f3208,null))['then'](saveUpdates(_0x1bbebf[_0xbb05('0x58')],null))[_0xbb05('0x21')](respondWithResult(_0x1f3208,null))[_0xbb05('0x50')](handleError(_0x1f3208,null));};exports[_0xbb05('0x37')]=function(_0x5c63b5,_0x425527){return db[_0xbb05('0x3c')]['find']({'where':{'id':_0x5c63b5[_0xbb05('0x52')]['id']}})['then'](handleEntityNotFound(_0x425527,null))[_0xbb05('0x21')](removeEntity(_0x425527,null))[_0xbb05('0x50')](handleError(_0x425527,null));};exports[_0xbb05('0x59')]=function(_0x4ed075,_0x949895){return db[_0xbb05('0x3c')][_0xbb05('0x59')]()[_0xbb05('0x21')](respondWithResult(_0x949895,null))[_0xbb05('0x50')](handleError(_0x949895,null));};var interaction_log=require('../../config/logger')(_0xbb05('0x5a'));exports[_0xbb05('0x5b')]=function(_0x490f95,_0x207a41,_0x415426){var _0x30d30b={'agent':{},'channel':'openchannel'};if(_0x490f95[_0xbb05('0x58')]['id']){delete _0x490f95[_0xbb05('0x58')]['id'];}_0x490f95[_0xbb05('0x58')][_0xbb05('0x5c')]=!![];_0x490f95[_0xbb05('0x58')]['readAt']=moment()['format'](_0xbb05('0x5d'));_0x490f95['body'][_0xbb05('0x5e')]=_0x490f95[_0xbb05('0x58')][_0xbb05('0x5e')]||_0x490f95[_0xbb05('0x5f')]['id'];_0x30d30b[_0xbb05('0x60')]['id']=_0x490f95[_0xbb05('0x58')][_0xbb05('0x5e')];return db[_0xbb05('0x3c')][_0xbb05('0x56')]({'where':{'id':_0x490f95[_0xbb05('0x52')]['id'],'UserId':null}})[_0xbb05('0x21')](handleEntityNotFound(_0x207a41,null))['then'](saveUpdates(_0x490f95[_0xbb05('0x58')],null))[_0xbb05('0x21')](function(_0x93a873){if(_0x93a873){_0x30d30b[_0xbb05('0x2a')]=_0x93a873[_0xbb05('0x61')]({'plain':!![]});return db[_0xbb05('0x62')][_0xbb05('0x56')]({'where':{'id':_0x93a873[_0xbb05('0x63')]}});}return null;})[_0xbb05('0x21')](handleEntityNotFound(_0x207a41,null))[_0xbb05('0x21')](function(_0x58786f){if(_0x58786f){return _0x58786f['update']({'UserId':_0x490f95[_0xbb05('0x58')][_0xbb05('0x5e')],'read1stAt':_[_0xbb05('0x64')](_0x58786f['read1stAt'])?moment()[_0xbb05('0x65')](_0xbb05('0x5d')):undefined});}return null;})[_0xbb05('0x21')](function(_0x287b95){if(_0x287b95){_0x30d30b[_0xbb05('0x66')]=_0x287b95[_0xbb05('0x61')]({'plain':!![]});interaction_log[_0xbb05('0x22')](_0xbb05('0x67'),_0x490f95[_0xbb05('0x5f')]['id'],_0x490f95['user'][_0xbb05('0x39')],_0x490f95[_0xbb05('0x5f')][_0xbb05('0x68')],_0x30d30b[_0xbb05('0x66')]['id'],_0x490f95[_0xbb05('0x58')]?JSON[_0xbb05('0x27')](_0x490f95[_0xbb05('0x58')]):_0xbb05('0x69'));return respondWithRpcPromise(_0xbb05('0x6a'),'acceptMessage',_0x30d30b);}return null;})[_0xbb05('0x21')](function(_0x591755){var _0xd985fa=_0xbb05('0x6b')+_0x591755[_0xbb05('0x2a')]['ContactId'];return db[_0xbb05('0x6c')][_0xbb05('0x40')](_0xd985fa,{'type':db[_0xbb05('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbb05('0x21')](function(_0x149b41){return _0x149b41;});})[_0xbb05('0x21')](function(_0x4ae502){if(_0x4ae502){_0x30d30b[_0xbb05('0x2a')][_0xbb05('0x6e')]=_0x4ae502[0x0];if(!_0x490f95['body'][_0xbb05('0x5e')])return;return db['User'][_0xbb05('0x56')]({'where':{'id':_0x490f95[_0xbb05('0x58')][_0xbb05('0x5e')],'role':'agent'},'attributes':['id',_0xbb05('0x39'),_0xbb05('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0xbb05('0x21')](function(_0x2c378a){if(!_0x2c378a)return null;_0x30d30b[_0xbb05('0x2a')][_0xbb05('0x60')]=_0x2c378a;return _0x30d30b;})['then'](function(_0x175c3c){if(_0x175c3c){if(_0x490f95[_0xbb05('0x58')][_0xbb05('0x70')]){_0x30d30b[_0xbb05('0x2a')][_0xbb05('0x71')]=util[_0xbb05('0x65')](_0xbb05('0x72'),_0x490f95[_0xbb05('0x5f')][_0xbb05('0x39')]);_0x30d30b[_0xbb05('0x2a')][_0xbb05('0x73')]=_0x30d30b[_0xbb05('0x73')];_0x30d30b['message'][_0xbb05('0x74')]=_0xbb05('0x5b');return respondWithRpcPromise('EventManager',_0xbb05('0x75'),{'event':_0xbb05('0x76'),'message':_0x30d30b[_0xbb05('0x2a')]},client9002)['then'](function(){return _0x30d30b;});}return _0x30d30b;}return null;})[_0xbb05('0x21')](respondWithResult(_0x207a41,null))[_0xbb05('0x50')](handleError(_0x207a41,null));};var interaction_log=require(_0xbb05('0x13'))(_0xbb05('0x5a'));exports[_0xbb05('0x34')]=function(_0x18e958,_0x568e15,_0x589ea7){var _0x1f52e8={'agent':{},'channel':_0xbb05('0x77')};if(_0x18e958[_0xbb05('0x58')]['id']){delete _0x18e958['body']['id'];}_0x18e958[_0xbb05('0x58')][_0xbb05('0x5e')]=_0x18e958[_0xbb05('0x58')][_0xbb05('0x5e')]||_0x18e958[_0xbb05('0x5f')]['id'];_0x1f52e8['agent']['id']=_0x18e958[_0xbb05('0x58')][_0xbb05('0x5e')];return db[_0xbb05('0x3c')][_0xbb05('0x56')]({'where':{'id':_0x18e958[_0xbb05('0x52')]['id'],'UserId':null}})[_0xbb05('0x21')](handleEntityNotFound(_0x568e15,null))[_0xbb05('0x21')](function(_0x294b08){if(_0x294b08){_0x1f52e8[_0xbb05('0x2a')]=_0x294b08[_0xbb05('0x61')]({'plain':!![]});return db['OpenchannelInteraction'][_0xbb05('0x56')]({'where':{'id':_0x294b08[_0xbb05('0x63')]}});}return null;})[_0xbb05('0x21')](handleEntityNotFound(_0x568e15,null))[_0xbb05('0x21')](function(_0x35daa6){if(_0x35daa6){_0x1f52e8[_0xbb05('0x66')]=_0x35daa6[_0xbb05('0x61')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x18e958[_0xbb05('0x5f')]['id'],_0x18e958[_0xbb05('0x5f')][_0xbb05('0x39')],_0x18e958[_0xbb05('0x5f')][_0xbb05('0x68')],_0x1f52e8[_0xbb05('0x66')]['id'],_0x18e958['body']?JSON[_0xbb05('0x27')](_0x18e958['body']):_0xbb05('0x69'));return respondWithRpcPromise('RejectMessage',_0xbb05('0x78'),_0x1f52e8);}return null;})[_0xbb05('0x21')](function(_0x59192b){var _0x1a42b0=_0xbb05('0x6b')+_0x59192b[_0xbb05('0x2a')]['ContactId'];return db['sequelize'][_0xbb05('0x40')](_0x1a42b0,{'type':db[_0xbb05('0x6d')][_0xbb05('0x79')][_0xbb05('0x7a')],'raw':!![]})[_0xbb05('0x21')](function(_0x475ada){return _0x475ada;});})[_0xbb05('0x21')](function(_0x3c8fbb){if(_0x3c8fbb){_0x1f52e8[_0xbb05('0x2a')][_0xbb05('0x6e')]=_0x3c8fbb[0x0];if(!_0x18e958[_0xbb05('0x58')][_0xbb05('0x5e')])return;return db['User'][_0xbb05('0x56')]({'where':{'id':_0x18e958[_0xbb05('0x58')][_0xbb05('0x5e')],'role':_0xbb05('0x60')},'attributes':['id',_0xbb05('0x39'),_0xbb05('0x6f'),_0xbb05('0x7b'),_0xbb05('0x7c')],'raw':!![]});}return null;})[_0xbb05('0x21')](function(_0x58f9f4){if(!_0x58f9f4)return null;_0x1f52e8[_0xbb05('0x2a')][_0xbb05('0x60')]=_0x58f9f4;return _0x1f52e8;})[_0xbb05('0x21')](function(_0x5d59b2){if(_0x5d59b2){_0x5d59b2[_0xbb05('0x2a')]['interface']=util['format'](_0xbb05('0x72'),_0x18e958['user'][_0xbb05('0x39')]);_0x5d59b2[_0xbb05('0x2a')]['channel']=_0x1f52e8['channel'];_0x5d59b2['message'][_0xbb05('0x74')]=_0xbb05('0x34');respondWithRpcPromise(_0xbb05('0x75'),_0xbb05('0x75'),{'event':_0xbb05('0x7d'),'message':_0x5d59b2[_0xbb05('0x2a')]},client9002);return _0x1f52e8;}return null;})[_0xbb05('0x21')](respondWithResult(_0x568e15,null))['catch'](handleError(_0x568e15,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9b01d6c..534314f 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 _0x8fab=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x4cabe9,_0x4db822){var _0x3a233b=function(_0x5a2cdb){while(--_0x5a2cdb){_0x4cabe9['push'](_0x4cabe9['shift']());}};_0x3a233b(++_0x4db822);}(_0x8fab,0x10a));var _0xb8fa=function(_0x13f23b,_0x3537a6){_0x13f23b=_0x13f23b-0x0;var _0x41fb99=_0x8fab[_0x13f23b];return _0x41fb99;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xb8fa('0x0'))['db'][_0xb8fa('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb8fa('0x2')](0x0);var events={'afterCreate':_0xb8fa('0x3'),'afterUpdate':_0xb8fa('0x4'),'afterDestroy':_0xb8fa('0x5')};function emitEvent(_0x2bf358){return function(_0x251021,_0x5c8840,_0x1d4fdf){OpenchannelMessageEvents['emit'](_0x2bf358+':'+_0x251021['id'],_0x251021);OpenchannelMessageEvents[_0xb8fa('0x6')](_0x2bf358,_0x251021);_0x1d4fdf(null);};}for(var e in events){if(events[_0xb8fa('0x7')](e)){var event=events[e];OpenchannelMessage[_0xb8fa('0x8')](e,emitEvent(event));}}module[_0xb8fa('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xcf77=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xcf77,0x1f0));var _0x7cf7=function(_0x13c84a,_0x574103){_0x13c84a=_0x13c84a-0x0;var _0x2e7586=_0xcf77[_0x13c84a];return _0x2e7586;};'use strict';var EventEmitter=require(_0x7cf7('0x0'));var OpenchannelMessage=require(_0x7cf7('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7cf7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7cf7('0x3'),'afterDestroy':'remove'};function emitEvent(_0x598831){return function(_0xb5b1d1,_0x363b34,_0x2a26a3){OpenchannelMessageEvents[_0x7cf7('0x4')](_0x598831+':'+_0xb5b1d1['id'],_0xb5b1d1);OpenchannelMessageEvents[_0x7cf7('0x4')](_0x598831,_0xb5b1d1);_0x2a26a3(null);};}for(var e in events){if(events[_0x7cf7('0x5')](e)){var event=events[e];OpenchannelMessage[_0x7cf7('0x6')](e,emitEvent(event));}}module[_0x7cf7('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index cb4659f..fd0f1ac 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 _0xd7d1=['OpenchannelMessage,\x20%s,\x20%s','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','OpenchannelInteractionId','update','createdAt','catch','error','secret','CmContact','describe','then','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','afterCreate','format','length','omit','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','Interaction'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x5d9c95,_0xe76118){_0x5d9c95=_0x5d9c95-0x0;var _0x263251=_0xd7d1[_0x5d9c95];return _0x263251;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0x10')],'type':_0x1d7d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x155bfb,_0xa44223,_0x1ad06f){var _0x8b258b=_0x14b2b9[_0x1d7d('0x12')];var _0x547f7b=_0x155bfb[_0x1d7d('0x13')]({'plain':!![]});if(_0x547f7b['direction'][_0x1d7d('0x14')]()==='in'||_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()===_0x1d7d('0x16')&&!_0x547f7b['secret']&&!_[_0x1d7d('0x17')](_0x547f7b['UserId'])){_0x8b258b['OpenchannelInteraction'][_0x1d7d('0x18')]({'where':{'id':_0x547f7b[_0x1d7d('0x19')]}})['then'](function(_0x55dba7){if(_0x55dba7){_0x55dba7[_0x1d7d('0x1a')]({'lastMsgAt':_0x547f7b[_0x1d7d('0x1b')],'lastMsgDirection':_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()});}})[_0x1d7d('0x1c')](function(_0x53423f){console[_0x1d7d('0x1d')](_0x53423f);});}if(_0x547f7b[_0x1d7d('0x15')]==='out'&&!_0x547f7b[_0x1d7d('0x1e')]){var _0x162c3a;_0x8b258b[_0x1d7d('0x1f')][_0x1d7d('0x20')]()[_0x1d7d('0x21')](function(_0x4db4f2){return _0x8b258b[_0x1d7d('0x22')][_0x1d7d('0x23')]({'where':{'id':_0x547f7b['OpenchannelAccountId']},'include':[{'model':_0x8b258b['OpenchannelInteraction'],'as':_0x1d7d('0x24'),'where':{'id':_0x547f7b[_0x1d7d('0x19')]},'limit':0x1,'include':[{'model':_0x8b258b[_0x1d7d('0x1f')],'as':_0x1d7d('0x25'),'attributes':_[_0x1d7d('0x26')](_0x4db4f2)}]}]});})[_0x1d7d('0x21')](function(_0x54d401){_0x162c3a=_0x54d401[_0x1d7d('0x13')]({'plain':!![]});if(_0x162c3a&&_0x162c3a[_0x1d7d('0x27')]){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x162c3a[_0x1d7d('0x24')]&&_0x162c3a[_0x1d7d('0x24')][_0x1d7d('0x2b')]){_0x547f7b['Interaction']=_[_0x1d7d('0x2c')](_0x162c3a[_0x1d7d('0x24')][0x0],_0x1d7d('0x25'));_0x547f7b[_0x1d7d('0x25')]=_0x162c3a['Interactions'][0x0][_0x1d7d('0x25')];}var _0xa44223={'method':'POST','uri':encodeURI(_0x162c3a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa44223[_0x1d7d('0x2d')]){case'GET':_0xa44223['qs']=_0x547f7b;break;case _0x1d7d('0x2e'):_0xa44223[_0x1d7d('0x10')]=_0x547f7b;break;}return rp(_0xa44223)[_0x1d7d('0x21')](function(_0x22c40d){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')](_0x1d7d('0x2f'),_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x22c40d[_0x1d7d('0x10')][_0x1d7d('0x30')]&&_0x22c40d[_0x1d7d('0x10')]['threadId']!=_0x547f7b['Interaction']['threadId']){return _0x8b258b[_0x1d7d('0x31')][_0x1d7d('0x1a')]({'threadId':_0x22c40d['body'][_0x1d7d('0x30')]},{'logging':!![],'where':{'id':_0x547f7b[_0x1d7d('0x32')]['id']}});}else{return;}})[_0x1d7d('0x21')](function(){return _0x155bfb[_0x1d7d('0x1a')]({'read':!![]});})[_0x1d7d('0x1c')](function(_0x22fec9){logger[_0x1d7d('0x1d')](_0x1d7d('0x33'),_0x1d7d('0x29'),util[_0x1d7d('0x34')](_0x22fec9,{'showHidden':![],'depth':null}));_0x1ad06f();});}else{_0x1ad06f();}})['finally'](function(){_0x1ad06f();});}else{_0x1ad06f();}}},'charset':'utf8mb4','collate':_0x1d7d('0x35')});}; \ No newline at end of file +var _0x4cf8=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','format','body','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','get','replyUri','info'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x4cf8[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var logger=require(_0x84cf('0x2'))(_0x84cf('0x3'));var moment=require(_0x84cf('0x4'));var BPromise=require(_0x84cf('0x5'));var rp=require(_0x84cf('0x6'));var fs=require('fs');var path=require(_0x84cf('0x7'));var rimraf=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var attributes=require(_0x84cf('0xa'));module[_0x84cf('0xb')]=function(_0x50ade2,_0x4af3f1){return _0x50ade2[_0x84cf('0xc')]('OpenchannelMessage',attributes,{'tableName':_0x84cf('0xd'),'paranoid':![],'indexes':[{'name':_0x84cf('0xe'),'fields':['body'],'type':_0x84cf('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39c6bc,_0x489063,_0xfb5398){var _0x1b223d=_0x50ade2[_0x84cf('0x10')];var _0x369ce6=_0x39c6bc['get']({'plain':!![]});if(_0x369ce6[_0x84cf('0x11')][_0x84cf('0x12')]()==='in'||_0x369ce6['direction']['toLowerCase']()===_0x84cf('0x13')&&!_0x369ce6[_0x84cf('0x14')]&&!_[_0x84cf('0x15')](_0x369ce6[_0x84cf('0x16')])){_0x1b223d[_0x84cf('0x17')][_0x84cf('0x18')]({'where':{'id':_0x369ce6[_0x84cf('0x19')]}})[_0x84cf('0x1a')](function(_0xced48){if(_0xced48){_0xced48[_0x84cf('0x1b')]({'lastMsgAt':_0x369ce6[_0x84cf('0x1c')],'lastMsgDirection':_0x369ce6[_0x84cf('0x11')][_0x84cf('0x12')]()});}})[_0x84cf('0x1d')](function(_0x27261b){console[_0x84cf('0x1e')](_0x27261b);});}if(_0x369ce6[_0x84cf('0x11')]===_0x84cf('0x13')&&!_0x369ce6[_0x84cf('0x14')]){var _0x5b8ac8;_0x1b223d[_0x84cf('0x1f')][_0x84cf('0x20')]()[_0x84cf('0x1a')](function(_0x1abe2d){return _0x1b223d[_0x84cf('0x21')][_0x84cf('0x22')]({'where':{'id':_0x369ce6[_0x84cf('0x23')]},'include':[{'model':_0x1b223d['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x369ce6[_0x84cf('0x19')]},'limit':0x1,'include':[{'model':_0x1b223d[_0x84cf('0x1f')],'as':_0x84cf('0x24'),'attributes':_[_0x84cf('0x25')](_0x1abe2d)}]}]});})[_0x84cf('0x1a')](function(_0x5dda3f){_0x5b8ac8=_0x5dda3f[_0x84cf('0x26')]({'plain':!![]});if(_0x5b8ac8&&_0x5b8ac8[_0x84cf('0x27')]){logger[_0x84cf('0x28')](_0x84cf('0x29'),_0x84cf('0x2a'),util['format'](_0x84cf('0x2b'),_0x369ce6['id'],_0x5b8ac8[_0x84cf('0x27')]));if(_0x5b8ac8[_0x84cf('0x2c')]&&_0x5b8ac8[_0x84cf('0x2c')][_0x84cf('0x2d')]){_0x369ce6[_0x84cf('0x2e')]=_[_0x84cf('0x2f')](_0x5b8ac8['Interactions'][0x0],_0x84cf('0x24'));_0x369ce6[_0x84cf('0x24')]=_0x5b8ac8[_0x84cf('0x2c')][0x0][_0x84cf('0x24')];}var _0x489063={'method':_0x84cf('0x30'),'uri':encodeURI(_0x5b8ac8[_0x84cf('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x489063[_0x84cf('0x31')]){case _0x84cf('0x32'):_0x489063['qs']=_0x369ce6;break;case _0x84cf('0x30'):_0x489063['body']=_0x369ce6;break;}return rp(_0x489063)[_0x84cf('0x1a')](function(_0x17bc92){logger[_0x84cf('0x28')](_0x84cf('0x29'),'afterCreate',util[_0x84cf('0x33')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x369ce6['id'],_0x5b8ac8[_0x84cf('0x27')]));if(_0x17bc92[_0x84cf('0x34')][_0x84cf('0x35')]&&_0x17bc92[_0x84cf('0x34')][_0x84cf('0x35')]!=_0x369ce6[_0x84cf('0x2e')][_0x84cf('0x35')]){return _0x1b223d[_0x84cf('0x17')][_0x84cf('0x1b')]({'threadId':_0x17bc92[_0x84cf('0x34')][_0x84cf('0x35')]},{'logging':!![],'where':{'id':_0x369ce6[_0x84cf('0x2e')]['id']}});}else{return;}})[_0x84cf('0x1a')](function(){return _0x39c6bc[_0x84cf('0x1b')]({'read':!![]});})['catch'](function(_0x4852ff){logger[_0x84cf('0x1e')](_0x84cf('0x29'),_0x84cf('0x2a'),util[_0x84cf('0x36')](_0x4852ff,{'showHidden':![],'depth':null}));_0xfb5398();});}else{_0xfb5398();}})[_0x84cf('0x37')](function(){_0xfb5398();});}else{_0xfb5398();}}},'charset':_0x84cf('0x38'),'collate':_0x84cf('0x39')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 74f8b6d..5dc560b 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x59aecc,_0x255014){var _0x46b112=function(_0x285bc3){while(--_0x285bc3){_0x59aecc['push'](_0x59aecc['shift']());}};_0x46b112(++_0x255014);}(_0xdb28,0x106));var _0x8db2=function(_0x19fda2,_0x3b45dc){_0x19fda2=_0x19fda2-0x0;var _0x4115c8=_0xdb28[_0x19fda2];return _0x4115c8;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x15c48d,_0x42a5e3){var _0x130100=function(_0x197210){while(--_0x197210){_0x15c48d['push'](_0x15c48d['shift']());}};_0x130100(++_0x42a5e3);}(_0xadb5,0xad));var _0x5adb=function(_0x3e5646,_0x56a7cc){_0x3e5646=_0x3e5646-0x0;var _0x17a18e=_0xadb5[_0x3e5646];return _0x17a18e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d37b831..f9551b0 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 _0xc020=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0xc52492,_0x3f92da){var _0xe49455=function(_0x58ca57){while(--_0x58ca57){_0xc52492['push'](_0xc52492['shift']());}};_0xe49455(++_0x3f92da);}(_0xc020,0x15c));var _0x0c02=function(_0x1e1b18,_0x5d471b){_0x1e1b18=_0x1e1b18-0x0;var _0x3da8f2=_0xc020[_0x1e1b18];return _0x3da8f2;};'use strict';var OpenchannelMessageEvents=require(_0x0c02('0x0'));var events=[_0x0c02('0x1'),_0x0c02('0x2'),_0x0c02('0x3')];function createListener(_0xe1ceaa,_0x3ed7b3){return function(_0x54b3a4){_0x3ed7b3['emit'](_0xe1ceaa,_0x54b3a4);};}function removeListener(_0x5f4978,_0x3edc7b){return function(){OpenchannelMessageEvents[_0x0c02('0x4')](_0x5f4978,_0x3edc7b);};}exports[_0x0c02('0x5')]=function(_0xd2d929){for(var _0x4cf93a=0x0,_0x17fb3e=events[_0x0c02('0x6')];_0x4cf93a<_0x17fb3e;_0x4cf93a++){var _0x24ef08=events[_0x4cf93a];var _0x3d902d=createListener(_0x0c02('0x7')+_0x24ef08,_0xd2d929);OpenchannelMessageEvents['on'](_0x24ef08,_0x3d902d);}}; \ No newline at end of file +var _0x12b7=['emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0x3dcb33,_0x31d75a){var _0x54bf79=function(_0x35cce3){while(--_0x35cce3){_0x3dcb33['push'](_0x3dcb33['shift']());}};_0x54bf79(++_0x31d75a);}(_0x12b7,0x194));var _0x712b=function(_0x130abd,_0x38fc96){_0x130abd=_0x130abd-0x0;var _0x2c874a=_0x12b7[_0x130abd];return _0x2c874a;};'use strict';var OpenchannelMessageEvents=require(_0x712b('0x0'));var events=[_0x712b('0x1'),_0x712b('0x2'),_0x712b('0x3')];function createListener(_0x16b466,_0x5832dd){return function(_0x456bda){_0x5832dd[_0x712b('0x4')](_0x16b466,_0x456bda);};}function removeListener(_0x445346,_0x167685){return function(){OpenchannelMessageEvents[_0x712b('0x5')](_0x445346,_0x167685);};}exports[_0x712b('0x6')]=function(_0x5006f3){for(var _0x437de7=0x0,_0x3089a8=events['length'];_0x437de7<_0x3089a8;_0x437de7++){var _0x2051c5=events[_0x437de7];var _0x3aaea7=createListener(_0x712b('0x7')+_0x2051c5,_0x5006f3);OpenchannelMessageEvents['on'](_0x2051c5,_0x3aaea7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 34c453d..33eb1d6 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 _0x618d=['delete','destroy','removeTeams','/:id/users','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x618d,0x164));var _0xd618=function(_0x47e7a2,_0x1ffe44){_0x47e7a2=_0x47e7a2-0x0;var _0x73c23f=_0x618d[_0x47e7a2];return _0x73c23f;};'use strict';var multer=require('multer');var util=require(_0xd618('0x0'));var path=require('path');var timeout=require(_0xd618('0x1'));var express=require(_0xd618('0x2'));var router=express[_0xd618('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd618('0x4'));var interaction=require(_0xd618('0x5'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0xd618('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd618('0x6')](_0xd618('0x7'),auth['isAuthenticated'](),controller[_0xd618('0x8')]);router[_0xd618('0x6')](_0xd618('0x9'),auth[_0xd618('0xa')](),controller[_0xd618('0xb')]);router['get'](_0xd618('0xc'),auth[_0xd618('0xa')](),controller[_0xd618('0xd')]);router[_0xd618('0x6')](_0xd618('0xe'),auth['isAuthenticated'](),controller[_0xd618('0xf')]);router[_0xd618('0x6')]('/:id/users',auth[_0xd618('0xa')](),controller[_0xd618('0x10')]);router[_0xd618('0x11')]('/',auth[_0xd618('0xa')](),controller[_0xd618('0x12')]);router[_0xd618('0x11')]('/:id/teams',auth[_0xd618('0xa')](),controller[_0xd618('0x13')]);router[_0xd618('0x11')]('/:id/users',auth[_0xd618('0xa')](),controller[_0xd618('0x14')]);router[_0xd618('0x15')](_0xd618('0x9'),auth[_0xd618('0xa')](),controller['update']);router[_0xd618('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd618('0x17')]);router[_0xd618('0x16')]('/:id/teams',auth[_0xd618('0xa')](),controller[_0xd618('0x18')]);router['delete'](_0xd618('0x19'),auth[_0xd618('0xa')](),controller[_0xd618('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xcfd0=['put','update','destroy','delete','removeAgents','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x20020f,_0x53eca6){var _0x5c1fa2=function(_0x369777){while(--_0x369777){_0x20020f['push'](_0x20020f['shift']());}};_0x5c1fa2(++_0x53eca6);}(_0xcfd0,0xde));var _0x0cfd=function(_0x579642,_0x11e83f){_0x579642=_0x579642-0x0;var _0x50f417=_0xcfd0[_0x579642];return _0x50f417;};'use strict';var multer=require(_0x0cfd('0x0'));var util=require(_0x0cfd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0cfd('0x2'));var router=express[_0x0cfd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0cfd('0x4'));var config=require(_0x0cfd('0x5'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0cfd('0x6')]);router[_0x0cfd('0x7')](_0x0cfd('0x8'),auth[_0x0cfd('0x9')](),controller[_0x0cfd('0xa')]);router[_0x0cfd('0x7')](_0x0cfd('0xb'),auth[_0x0cfd('0x9')](),controller['show']);router[_0x0cfd('0x7')](_0x0cfd('0xc'),auth['isAuthenticated'](),controller[_0x0cfd('0xd')]);router['get'](_0x0cfd('0xe'),auth[_0x0cfd('0x9')](),controller[_0x0cfd('0xf')]);router[_0x0cfd('0x7')](_0x0cfd('0x10'),auth[_0x0cfd('0x9')](),controller[_0x0cfd('0x11')]);router[_0x0cfd('0x12')]('/',auth['isAuthenticated'](),controller[_0x0cfd('0x13')]);router[_0x0cfd('0x12')](_0x0cfd('0xe'),auth[_0x0cfd('0x9')](),controller[_0x0cfd('0x14')]);router[_0x0cfd('0x12')](_0x0cfd('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0x0cfd('0x15')]('/:id',auth[_0x0cfd('0x9')](),controller[_0x0cfd('0x16')]);router['delete']('/:id',auth[_0x0cfd('0x9')](),controller[_0x0cfd('0x17')]);router[_0x0cfd('0x18')](_0x0cfd('0xe'),auth[_0x0cfd('0x9')](),controller['removeTeams']);router['delete'](_0x0cfd('0x10'),auth[_0x0cfd('0x9')](),controller[_0x0cfd('0x19')]);module[_0x0cfd('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 cdfd897..6b35f98 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 _0x3267=['rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER','ENUM'];(function(_0x551e3b,_0x5e5cc5){var _0x1bc4fe=function(_0x44c966){while(--_0x44c966){_0x551e3b['push'](_0x551e3b['shift']());}};_0x1bc4fe(++_0x5e5cc5);}(_0x3267,0x168));var _0x7326=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x3267[_0x4a45b4];return _0x1a99c9;};'use strict';var Sequelize=require(_0x7326('0x0'));module['exports']={'name':{'type':Sequelize[_0x7326('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7326('0x1')]},'timeout':{'type':Sequelize[_0x7326('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7326('0x3')](_0x7326('0x4'),_0x7326('0x5'),_0x7326('0x6'))}}; \ No newline at end of file +var _0xe56b=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x19c64a,_0x5de14e){var _0x1b1a06=function(_0x5dd104){while(--_0x5dd104){_0x19c64a['push'](_0x19c64a['shift']());}};_0x1b1a06(++_0x5de14e);}(_0xe56b,0xb9));var _0xbe56=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe56b[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xbe56('0x0'));module[_0xbe56('0x1')]={'name':{'type':Sequelize[_0xbe56('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbe56('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe56('0x3')](_0xbe56('0x4'),_0xbe56('0x5'),_0xbe56('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index b55876d..825f2f2 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 _0x2272=['clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','User','rimraf','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','keys','filters','query','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','params','intersection','includeAll','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','pick','OpenchannelQueueId','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','UserOpenchannelQueue','forEach','emit','userOpenchannelQueue:save','removeTeams','select','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?'];(function(_0x15a634,_0x4feb86){var _0xf4f7a0=function(_0x31d9fe){while(--_0x31d9fe){_0x15a634['push'](_0x15a634['shift']());}};_0xf4f7a0(++_0x4feb86);}(_0x2272,0x9d));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2227('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2227('0x1'));var Mustache=require(_0x2227('0x2'));var util=require(_0x2227('0x3'));var path=require(_0x2227('0x4'));var sox=require(_0x2227('0x5'));var csv=require(_0x2227('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2227('0x7'));var squel=require(_0x2227('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2227('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2227('0xa'));var Papa=require(_0x2227('0xb'));var Redis=require(_0x2227('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2227('0xd'));var hardwareService=require(_0x2227('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x2227('0xf'));var config=require(_0x2227('0x10'));var licenseUtil=require(_0x2227('0x11'));var db=require('../../mysqldb')['db'];config[_0x2227('0x12')]=_['defaults'](config[_0x2227('0x12')],{'host':_0x2227('0x13'),'port':0x18eb});var socket=require(_0x2227('0x14'))(new Redis(config[_0x2227('0x12')]));require(_0x2227('0x15'))[_0x2227('0x16')](socket);function respondWithStatusCode(_0x1feba5,_0x20e093){_0x20e093=_0x20e093||0xcc;return function(_0x590ac3){if(_0x590ac3){return _0x1feba5[_0x2227('0x17')](_0x20e093);}return _0x1feba5[_0x2227('0x18')](_0x20e093)[_0x2227('0x19')]();};}function respondWithResult(_0x538a98,_0x521be3){_0x521be3=_0x521be3||0xc8;return function(_0x5d1c76){if(_0x5d1c76){return _0x538a98[_0x2227('0x18')](_0x521be3)[_0x2227('0x1a')](_0x5d1c76);}};}function respondWithFilteredResult(_0x4dbae2,_0x4c0443){return function(_0x2ec388){if(_0x2ec388){var _0x11e636=typeof _0x4c0443['offset']===_0x2227('0x1b')&&typeof _0x4c0443['limit']===_0x2227('0x1b');var _0x30b3a4=_0x2ec388['count'];var _0x521bc0=_0x11e636?0x0:_0x4c0443['offset'];var _0x915840=_0x11e636?_0x2ec388[_0x2227('0x1c')]:_0x4c0443[_0x2227('0x1d')]+_0x4c0443['limit'];var _0x565fcf;if(_0x915840>=_0x30b3a4){_0x915840=_0x30b3a4;_0x565fcf=0xc8;}else{_0x565fcf=0xce;}_0x4dbae2[_0x2227('0x18')](_0x565fcf);return _0x4dbae2[_0x2227('0x1e')](_0x2227('0x1f'),_0x521bc0+'-'+_0x915840+'/'+_0x30b3a4)['json'](_0x2ec388);}return null;};}function patchUpdates(_0x54c232){return function(_0x4988e3){try{jsonpatch[_0x2227('0x20')](_0x4988e3,_0x54c232,!![]);}catch(_0x244f50){return BPromise[_0x2227('0x21')](_0x244f50);}return _0x4988e3['save']();};}function saveUpdates(_0x1b82bb,_0x1ee31c){return function(_0x3b96dc){if(_0x3b96dc){return _0x3b96dc[_0x2227('0x22')](_0x1b82bb)[_0x2227('0x23')](function(_0x860e9b){return _0x860e9b;});}return null;};}function removeEntity(_0x3031a9,_0x4b7aaf){return function(_0x590c46){if(_0x590c46){return _0x590c46['destroy']()[_0x2227('0x23')](function(){var _0x2e66b1=_0x590c46['get']({'plain':!![]});var _0x113c35=_0x2227('0x24');return db[_0x2227('0x25')]['destroy']({'where':{'type':_0x113c35,'resourceId':_0x2e66b1['id']}})[_0x2227('0x23')](function(){return _0x590c46;});})['then'](function(){_0x3031a9[_0x2227('0x18')](0xcc)[_0x2227('0x19')]();});}};}function handleEntityNotFound(_0x56982b,_0x2a1923){return function(_0x19b0a0){if(!_0x19b0a0){_0x56982b[_0x2227('0x17')](0x194);}return _0x19b0a0;};}function handleError(_0x176215,_0x5a5150){_0x5a5150=_0x5a5150||0x1f4;return function(_0x2a0185){logger[_0x2227('0x26')](_0x2a0185['stack']);if(_0x2a0185[_0x2227('0x27')]){delete _0x2a0185[_0x2227('0x27')];}_0x176215['status'](_0x5a5150)[_0x2227('0x28')](_0x2a0185);};}exports[_0x2227('0x29')]=function(_0x5e25b9,_0x9df93){var _0x29f674={},_0x16baf9={},_0x3f1068={'count':0x0,'rows':[]};var _0x1e9843=_[_0x2227('0x2a')](db[_0x2227('0x2b')][_0x2227('0x2c')],function(_0x1072ef){return{'name':_0x1072ef[_0x2227('0x2d')],'type':_0x1072ef[_0x2227('0x2e')][_0x2227('0x2f')]};});_0x16baf9['model']=_['map'](_0x1e9843,_0x2227('0x27'));_0x16baf9['query']=_[_0x2227('0x30')](_0x5e25b9['query']);_0x16baf9[_0x2227('0x31')]=_['intersection'](_0x16baf9['model'],_0x16baf9[_0x2227('0x32')]);_0x29f674[_0x2227('0x33')]=_['intersection'](_0x16baf9[_0x2227('0x34')],qs[_0x2227('0x35')](_0x5e25b9[_0x2227('0x32')][_0x2227('0x35')]));_0x29f674['attributes']=_0x29f674[_0x2227('0x33')][_0x2227('0x36')]?_0x29f674[_0x2227('0x33')]:_0x16baf9['model'];if(!_0x5e25b9[_0x2227('0x32')][_0x2227('0x37')](_0x2227('0x38'))){_0x29f674[_0x2227('0x39')]=qs[_0x2227('0x39')](_0x5e25b9[_0x2227('0x32')][_0x2227('0x39')]);_0x29f674[_0x2227('0x1d')]=qs[_0x2227('0x1d')](_0x5e25b9[_0x2227('0x32')][_0x2227('0x1d')]);}_0x29f674[_0x2227('0x3a')]=qs[_0x2227('0x3b')](_0x5e25b9[_0x2227('0x32')][_0x2227('0x3b')]);_0x29f674[_0x2227('0x3c')]=qs['filters'](_['pick'](_0x5e25b9[_0x2227('0x32')],_0x16baf9['filters']),_0x1e9843);if(_0x5e25b9[_0x2227('0x32')][_0x2227('0x3d')]){_0x29f674[_0x2227('0x3c')]=_[_0x2227('0x3e')](_0x29f674[_0x2227('0x3c')],{'$or':_['map'](_0x1e9843,function(_0x54ea71){if(_0x54ea71[_0x2227('0x2e')]!==_0x2227('0x3f')){var _0x20bda0={};_0x20bda0[_0x54ea71[_0x2227('0x27')]]={'$like':'%'+_0x5e25b9[_0x2227('0x32')][_0x2227('0x3d')]+'%'};return _0x20bda0;}})});}_0x29f674=_[_0x2227('0x3e')]({},_0x29f674,_0x5e25b9['options']);var _0x4047d5={'where':_0x29f674[_0x2227('0x3c')]};return db[_0x2227('0x2b')]['count'](_0x4047d5)[_0x2227('0x23')](function(_0x566e93){_0x3f1068[_0x2227('0x1c')]=_0x566e93;if(_0x5e25b9[_0x2227('0x32')]['includeAll']){_0x29f674['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x2227('0x40')](_0x29f674);})[_0x2227('0x23')](function(_0x32ffc0){_0x3f1068[_0x2227('0x41')]=_0x32ffc0;return _0x3f1068;})[_0x2227('0x23')](respondWithFilteredResult(_0x9df93,_0x29f674))[_0x2227('0x42')](handleError(_0x9df93,null));};exports['show']=function(_0x5d43f3,_0x4eeeb5){var _0x54bfcb={'raw':!![],'where':{'id':_0x5d43f3[_0x2227('0x43')]['id']}},_0x3251d4={};_0x3251d4[_0x2227('0x34')]=_[_0x2227('0x30')](db[_0x2227('0x2b')][_0x2227('0x2c')]);_0x3251d4['query']=_[_0x2227('0x30')](_0x5d43f3['query']);_0x3251d4[_0x2227('0x31')]=_[_0x2227('0x44')](_0x3251d4[_0x2227('0x34')],_0x3251d4[_0x2227('0x32')]);_0x54bfcb[_0x2227('0x33')]=_[_0x2227('0x44')](_0x3251d4[_0x2227('0x34')],qs[_0x2227('0x35')](_0x5d43f3[_0x2227('0x32')][_0x2227('0x35')]));_0x54bfcb[_0x2227('0x33')]=_0x54bfcb[_0x2227('0x33')][_0x2227('0x36')]?_0x54bfcb[_0x2227('0x33')]:_0x3251d4[_0x2227('0x34')];if(_0x5d43f3[_0x2227('0x32')][_0x2227('0x45')]){_0x54bfcb[_0x2227('0x46')]=[{'all':!![]}];}_0x54bfcb=_['merge']({},_0x54bfcb,_0x5d43f3[_0x2227('0x47')]);return db[_0x2227('0x2b')][_0x2227('0x48')](_0x54bfcb)['then'](handleEntityNotFound(_0x4eeeb5,null))[_0x2227('0x23')](respondWithResult(_0x4eeeb5,null))[_0x2227('0x42')](handleError(_0x4eeeb5,null));};exports[_0x2227('0x49')]=function(_0x4c1d3d,_0xd120ae){return db[_0x2227('0x2b')][_0x2227('0x49')](_0x4c1d3d[_0x2227('0x4a')],{})[_0x2227('0x23')](function(_0x3cbf07){var _0x4746da=_0x4c1d3d[_0x2227('0x4b')]['get']({'plain':!![]});if(!_0x4746da)throw new Error(_0x2227('0x4c'));if(_0x4746da[_0x2227('0x4d')]===_0x2227('0x4b')){var _0x1acdd4=_0x3cbf07[_0x2227('0x4e')]({'plain':!![]});var _0x519051=_0x2227('0x24');return db[_0x2227('0x4f')][_0x2227('0x48')]({'where':{'name':_0x519051,'userProfileId':_0x4746da['userProfileId']},'raw':!![]})[_0x2227('0x23')](function(_0x1d866d){if(_0x1d866d&&_0x1d866d[_0x2227('0x50')]===0x0){return db[_0x2227('0x25')]['create']({'name':_0x1acdd4[_0x2227('0x27')],'resourceId':_0x1acdd4['id'],'type':_0x1d866d['name'],'sectionId':_0x1d866d['id']},{})[_0x2227('0x23')](function(){return _0x3cbf07;});}else{return _0x3cbf07;}})[_0x2227('0x42')](function(_0x59a353){logger[_0x2227('0x26')](_0x2227('0x51'),_0x59a353);throw _0x59a353;});}return _0x3cbf07;})[_0x2227('0x23')](respondWithResult(_0xd120ae,0xc9))['catch'](handleError(_0xd120ae,null));};exports[_0x2227('0x22')]=function(_0x95c122,_0x95230f){if(_0x95c122[_0x2227('0x4a')]['id']){delete _0x95c122[_0x2227('0x4a')]['id'];}return db[_0x2227('0x2b')]['find']({'where':{'id':_0x95c122[_0x2227('0x43')]['id']}})['then'](handleEntityNotFound(_0x95230f,null))[_0x2227('0x23')](saveUpdates(_0x95c122[_0x2227('0x4a')],null))[_0x2227('0x23')](respondWithResult(_0x95230f,null))[_0x2227('0x42')](handleError(_0x95230f,null));};exports['destroy']=function(_0x14b496,_0x413c19){return db[_0x2227('0x2b')][_0x2227('0x48')]({'where':{'id':_0x14b496['params']['id']}})['then'](handleEntityNotFound(_0x413c19,null))[_0x2227('0x23')](removeEntity(_0x413c19,null))['catch'](handleError(_0x413c19,null));};exports[_0x2227('0x52')]=function(_0x2f993f,_0x48db98){return db[_0x2227('0x2b')][_0x2227('0x52')]()['then'](respondWithResult(_0x48db98,null))[_0x2227('0x42')](handleError(_0x48db98,null));};exports[_0x2227('0x53')]=function(_0x4dd47b,_0x3ae852,_0x157174){var _0x24116f={'raw':!![],'where':{}},_0x84e5ee={},_0xe3ebc1;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4dd47b['params']['id']}})['then'](handleEntityNotFound(_0x3ae852,null))['then'](function(_0x5d29ad){if(_0x5d29ad){_0xe3ebc1=_0x5d29ad['get']({'plain':!![]});_0x84e5ee[_0x2227('0x34')]=_[_0x2227('0x30')](db['UserOpenchannelQueue']['rawAttributes']);_0x84e5ee[_0x2227('0x32')]=_[_0x2227('0x30')](_0x4dd47b['query']);_0x84e5ee['filters']=_[_0x2227('0x44')](_0x84e5ee['model'],_0x84e5ee[_0x2227('0x32')]);_0x24116f[_0x2227('0x33')]=_['intersection'](_0x84e5ee[_0x2227('0x34')],qs[_0x2227('0x35')](_0x4dd47b[_0x2227('0x32')][_0x2227('0x35')]));_0x24116f[_0x2227('0x33')]=_0x24116f[_0x2227('0x33')][_0x2227('0x36')]?_0x24116f[_0x2227('0x33')]:_0x84e5ee['model'];if(!_0x4dd47b[_0x2227('0x32')][_0x2227('0x37')](_0x2227('0x38'))){_0x24116f['limit']=qs[_0x2227('0x39')](_0x4dd47b[_0x2227('0x32')][_0x2227('0x39')]);_0x24116f[_0x2227('0x1d')]=qs['offset'](_0x4dd47b[_0x2227('0x32')]['offset']);}_0x24116f[_0x2227('0x3a')]=qs[_0x2227('0x3b')](_0x4dd47b[_0x2227('0x32')]['sort']);_0x24116f[_0x2227('0x3c')]=qs[_0x2227('0x31')](_[_0x2227('0x54')](_0x4dd47b[_0x2227('0x32')],_0x84e5ee[_0x2227('0x31')]));_0x24116f[_0x2227('0x3c')][_0x2227('0x55')]=_0x5d29ad['id'];if(_0x4dd47b[_0x2227('0x32')][_0x2227('0x3d')]){_0x24116f[_0x2227('0x3c')]=_[_0x2227('0x3e')](_0x24116f[_0x2227('0x3c')],{'$or':_[_0x2227('0x2a')](_0x24116f[_0x2227('0x33')],function(_0x1bdeb4){var _0x37770c={};_0x37770c[_0x1bdeb4]={'$like':'%'+_0x4dd47b[_0x2227('0x32')][_0x2227('0x3d')]+'%'};return _0x37770c;})});}_0x24116f=_['merge']({},_0x24116f,_0x4dd47b[_0x2227('0x47')]);return db['UserOpenchannelQueue']['findAll'](_0x24116f);}})[_0x2227('0x23')](function(_0x103589){if(_0x103589){return db['User']['findAndCountAll']({'where':{'id':_[_0x2227('0x2a')](_0x103589,_0x2227('0x56')),'role':_0x2227('0x57')},'attributes':['id',_0x2227('0x27'),_0x2227('0x58'),_0x2227('0x59'),_0x2227('0x5a')]});}})['then'](function(_0x2754c2){if(_0x2754c2){return{'count':_0x2754c2['count'],'rows':_['map'](_0x2754c2[_0x2227('0x41')],function(_0x5db1e5){return{'membername':_0x5db1e5[_0x2227('0x27')],'UserId':_0x5db1e5['id'],'queue_name':_0xe3ebc1[_0x2227('0x27')],'OpenchannelQueueId':_0xe3ebc1['id'],'interface':util[_0x2227('0x5b')](_0x2227('0x5c'),_0x2227('0x5d'),_0x5db1e5[_0x2227('0x27')]),'penalty':0x0,'paused':_0x5db1e5[_0x2227('0x58')],'createdAt':_0x5db1e5['createdAt'],'updatedAt':_0x5db1e5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3ae852,_0x24116f))[_0x2227('0x42')](handleError(_0x3ae852,null));};exports[_0x2227('0x5e')]=function(_0x8bafee,_0x405cfd,_0x3bc337){var _0x4f8161={};var _0x1c3218={};var _0x36eaed;var _0x2def44;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x8bafee['params']['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x405cfd,null))[_0x2227('0x23')](function(_0x984ca2){if(_0x984ca2){_0x36eaed=_0x984ca2;_0x1c3218[_0x2227('0x34')]=_[_0x2227('0x30')](db[_0x2227('0x5f')][_0x2227('0x2c')]);_0x1c3218[_0x2227('0x32')]=_[_0x2227('0x30')](_0x8bafee[_0x2227('0x32')]);_0x1c3218[_0x2227('0x31')]=_[_0x2227('0x44')](_0x1c3218[_0x2227('0x34')],_0x1c3218[_0x2227('0x32')]);_0x4f8161['attributes']=_['intersection'](_0x1c3218['model'],qs[_0x2227('0x35')](_0x8bafee[_0x2227('0x32')][_0x2227('0x35')]));_0x4f8161[_0x2227('0x33')]=_0x4f8161[_0x2227('0x33')]['length']?_0x4f8161[_0x2227('0x33')]:_0x1c3218[_0x2227('0x34')];_0x4f8161[_0x2227('0x3a')]=qs[_0x2227('0x3b')](_0x8bafee[_0x2227('0x32')][_0x2227('0x3b')]);_0x4f8161[_0x2227('0x3c')]=qs['filters'](_[_0x2227('0x54')](_0x8bafee[_0x2227('0x32')],_0x1c3218['filters']));if(_0x8bafee[_0x2227('0x32')][_0x2227('0x3d')]){_0x4f8161[_0x2227('0x3c')]=_[_0x2227('0x3e')](_0x4f8161[_0x2227('0x3c')],{'$or':_[_0x2227('0x2a')](_0x4f8161[_0x2227('0x33')],function(_0x148751){var _0x19c7e2={};_0x19c7e2[_0x148751]={'$like':'%'+_0x8bafee[_0x2227('0x32')][_0x2227('0x3d')]+'%'};return _0x19c7e2;})});}_0x4f8161=_[_0x2227('0x3e')]({},_0x4f8161,_0x8bafee['options']);return _0x36eaed['getTeams'](_0x4f8161);}})[_0x2227('0x23')](function(_0x5e7a8f){if(_0x5e7a8f){_0x2def44=_0x5e7a8f['length'];if(!_0x8bafee[_0x2227('0x32')][_0x2227('0x37')](_0x2227('0x38'))){_0x4f8161[_0x2227('0x39')]=qs[_0x2227('0x39')](_0x8bafee[_0x2227('0x32')][_0x2227('0x39')]);_0x4f8161['offset']=qs[_0x2227('0x1d')](_0x8bafee[_0x2227('0x32')][_0x2227('0x1d')]);}return _0x36eaed[_0x2227('0x5e')](_0x4f8161);}})[_0x2227('0x23')](function(_0x47e755){if(_0x47e755){return _0x47e755?{'count':_0x2def44,'rows':_0x47e755}:null;}})[_0x2227('0x23')](respondWithResult(_0x405cfd,null))['catch'](handleError(_0x405cfd,null));};exports['addTeams']=function(_0x3e4f1e,_0x24c1e6,_0x1939f1){var _0x210b3b=_0x3e4f1e['body'][_0x2227('0x60')];return db[_0x2227('0x5f')]['findAll']({'where':{'id':_0x210b3b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2227('0x61'),'attributes':['id',_0x2227('0x27'),'online',_0x2227('0x62'),_0x2227('0x63')],'raw':!![]}]})[_0x2227('0x23')](function(_0x5c99c2){if(_0x5c99c2){var _0x1ff39e=_[_0x2227('0x64')](_0x5c99c2,function(_0x5f2c37){var _0x2ec11b=_0x5f2c37[_0x2227('0x4e')]({'plain':!![]});return _0x2ec11b['Agents'];});return db['OpenchannelQueue'][_0x2227('0x48')]({'where':{'id':_0x3e4f1e[_0x2227('0x43')]['id']}})[_0x2227('0x23')](function(_0x346234){return db[_0x2227('0x65')][_0x2227('0x66')](function(_0x15eaa1){return _0x346234[_0x2227('0x67')](_0x210b3b,{'transaction':_0x15eaa1})[_0x2227('0x23')](function(){return BPromise['each'](_0x1ff39e,function(_0x251680){return db[_0x2227('0x68')]['findOrCreate']({'where':{'UserId':_0x251680['id'],'OpenchannelQueueId':_0x3e4f1e[_0x2227('0x43')]['id']},'transaction':_0x15eaa1});});})[_0x2227('0x23')](function(){_0x1ff39e[_0x2227('0x69')](function(_0x22a68d){socket[_0x2227('0x6a')](_0x2227('0x6b'),{'UserId':_0x22a68d['id'],'OpenchannelQueueId':_0x346234['id']});});});});});}})[_0x2227('0x23')](respondWithStatusCode(_0x24c1e6,null))[_0x2227('0x42')](handleError(_0x24c1e6,null));};exports[_0x2227('0x6c')]=function(_0x3a9820,_0x46f8f6,_0x3cc656){return db[_0x2227('0x5f')][_0x2227('0x40')]({'where':{'id':_0x3a9820[_0x2227('0x32')][_0x2227('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2227('0x61'),'attributes':['id'],'raw':!![]}]})[_0x2227('0x23')](handleEntityNotFound(_0x46f8f6,null))[_0x2227('0x23')](function(_0x14c524){var _0x2eadd4=_['map'](_0x14c524,'id');var _0x4bbe74=[];var _0xfd55f7=[];var _0x55a8bc=squel[_0x2227('0x6d')]();_0x55a8bc['field']('tq.TeamId')[_0x2227('0x6e')](_0x2227('0x6f'),'tq')[_0x2227('0x70')]('user_has_teams','ut',_0x2227('0x71'))[_0x2227('0x3c')](_0x2227('0x72'),_0x3a9820[_0x2227('0x43')]['id']);for(var _0xdf44=0x0;_0xdf44<_0x14c524[_0x2227('0x36')];_0xdf44+=0x1){let _0x1f9749=_0x14c524[_0xdf44];for(var _0x5c2bd8=0x0;_0x5c2bd8<_0x1f9749[_0x2227('0x61')][_0x2227('0x36')];_0x5c2bd8+=0x1){let _0x57bf4b=_0x1f9749[_0x2227('0x61')][_0x5c2bd8];var _0x12f0a5=_0x55a8bc[_0x2227('0x73')]();_0x12f0a5[_0x2227('0x3c')](_0x2227('0x74'),_0x57bf4b['id']);_0xfd55f7['push'](db[_0x2227('0x65')][_0x2227('0x32')](_0x12f0a5[_0x2227('0x75')](),{'type':db['sequelize'][_0x2227('0x76')][_0x2227('0x77')]})[_0x2227('0x23')](function(_0x1354f2){if(_0x1354f2[_0x2227('0x36')]===0x1){return _0x57bf4b['id'];}else{var _0x3224b7=_[_0x2227('0x78')](_[_0x2227('0x2a')](_0x1354f2,'TeamId'),function(_0x47ad63){return _[_0x2227('0x79')](_0x2eadd4,_0x47ad63);});if(_0x3224b7){return _0x57bf4b['id'];}}}));}}return BPromise[_0x2227('0x7a')](_0xfd55f7)[_0x2227('0x23')](function(_0x546c99){_0x4bbe74=_(_0x4bbe74)[_0x2227('0x7b')](_0x546c99)[_0x2227('0x7c')]()[_0x2227('0x7d')]();return db[_0x2227('0x2b')][_0x2227('0x48')]({'where':{'id':_0x3a9820['params']['id']}})[_0x2227('0x23')](function(_0x5551ae){return db['sequelize'][_0x2227('0x66')](function(_0xf4e4c5){return _0x5551ae[_0x2227('0x6c')](_0x3a9820[_0x2227('0x32')]['ids'],{'transaction':_0xf4e4c5})[_0x2227('0x23')](function(){if(!_[_0x2227('0x7e')](_0x4bbe74)){return _0x5551ae[_0x2227('0x7f')](_0x4bbe74,{'transaction':_0xf4e4c5});}})[_0x2227('0x23')](function(){_0x4bbe74[_0x2227('0x69')](function(_0xd52922){socket['emit'](_0x2227('0x80'),{'UserId':_0xd52922,'OpenchannelQueueId':_0x5551ae['id']});});});});});});})[_0x2227('0x23')](respondWithStatusCode(_0x46f8f6,null))[_0x2227('0x42')](handleError(_0x46f8f6,null));};exports[_0x2227('0x81')]=function(_0x1c761e,_0x3f3b1a,_0x10421b){return db['OpenchannelQueue'][_0x2227('0x48')]({'where':{'id':_0x1c761e['params']['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x3f3b1a,null))['then'](function(_0x706bc4){if(_0x706bc4){return _0x706bc4['addAgents'](_0x1c761e[_0x2227('0x4a')][_0x2227('0x60')],_[_0x2227('0x82')](_0x1c761e[_0x2227('0x4a')],['ids','id'])||{})[_0x2227('0x83')](function(_0x4c9fa5){for(var _0x1f4cd7=0x0;_0x1f4cd7<_0x1c761e['body']['ids']['length'];_0x1f4cd7+=0x1){socket[_0x2227('0x6a')](_0x2227('0x6b'),{'UserId':Number(_0x1c761e['body'][_0x2227('0x60')][_0x1f4cd7]),'OpenchannelQueueId':Number(_0x1c761e[_0x2227('0x43')]['id'])});}return _0x4c9fa5;});}})['then'](respondWithResult(_0x3f3b1a,null))['catch'](handleError(_0x3f3b1a,null));};exports[_0x2227('0x7f')]=function(_0x4c4cae,_0x2e7e49,_0x1f9f24){return db[_0x2227('0x2b')][_0x2227('0x48')]({'where':{'id':_0x4c4cae['params']['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x2e7e49,null))[_0x2227('0x23')](function(_0x14782c){if(_0x14782c){return _0x14782c['removeAgents'](_0x4c4cae[_0x2227('0x32')][_0x2227('0x60')])[_0x2227('0x23')](function(){if(_[_0x2227('0x84')](_0x4c4cae[_0x2227('0x32')][_0x2227('0x60')])){for(var _0x2441ec=0x0;_0x2441ec<_0x4c4cae['query'][_0x2227('0x60')]['length'];_0x2441ec+=0x1){socket[_0x2227('0x6a')](_0x2227('0x80'),{'UserId':Number(_0x4c4cae[_0x2227('0x32')][_0x2227('0x60')][_0x2441ec]),'OpenchannelQueueId':Number(_0x4c4cae[_0x2227('0x43')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x4c4cae[_0x2227('0x32')][_0x2227('0x60')]),'OpenchannelQueueId':Number(_0x4c4cae['params']['id'])});}});}})[_0x2227('0x23')](respondWithStatusCode(_0x2e7e49,null))['catch'](handleError(_0x2e7e49,null));};exports[_0x2227('0x85')]=function(_0x408f5b,_0x34c05a,_0x39ceb7){var _0x2532ab={};var _0x3b9bf9={};var _0x4f4e61;var _0x45888e;return db[_0x2227('0x2b')][_0x2227('0x86')]({'where':{'id':_0x408f5b['params']['id']}})[_0x2227('0x23')](handleEntityNotFound(_0x34c05a,null))[_0x2227('0x23')](function(_0x176a42){if(_0x176a42){_0x4f4e61=_0x176a42;_0x3b9bf9[_0x2227('0x34')]=_[_0x2227('0x30')](db[_0x2227('0x87')][_0x2227('0x2c')]);_0x3b9bf9['query']=_[_0x2227('0x30')](_0x408f5b[_0x2227('0x32')]);_0x3b9bf9[_0x2227('0x31')]=_[_0x2227('0x44')](_0x3b9bf9['model'],_0x3b9bf9[_0x2227('0x32')]);_0x2532ab[_0x2227('0x33')]=_[_0x2227('0x44')](_0x3b9bf9['model'],qs[_0x2227('0x35')](_0x408f5b['query'][_0x2227('0x35')]));_0x2532ab[_0x2227('0x33')]=_0x2532ab[_0x2227('0x33')][_0x2227('0x36')]?_0x2532ab[_0x2227('0x33')]:_0x3b9bf9[_0x2227('0x34')];_0x2532ab[_0x2227('0x3a')]=qs[_0x2227('0x3b')](_0x408f5b[_0x2227('0x32')][_0x2227('0x3b')]);_0x2532ab['where']=qs[_0x2227('0x31')](_[_0x2227('0x54')](_0x408f5b[_0x2227('0x32')],_0x3b9bf9[_0x2227('0x31')]));if(_0x408f5b[_0x2227('0x32')][_0x2227('0x3d')]){_0x2532ab['where']=_['merge'](_0x2532ab['where'],{'$or':_['map'](_0x2532ab['attributes'],function(_0x29ed74){var _0x378fc2={};_0x378fc2[_0x29ed74]={'$like':'%'+_0x408f5b[_0x2227('0x32')][_0x2227('0x3d')]+'%'};return _0x378fc2;})});}_0x2532ab=_[_0x2227('0x3e')]({},_0x2532ab,_0x408f5b[_0x2227('0x47')]);return _0x4f4e61[_0x2227('0x85')](_0x2532ab);}})[_0x2227('0x23')](function(_0x12a842){if(_0x12a842){_0x45888e=_0x12a842['length'];if(!_0x408f5b[_0x2227('0x32')][_0x2227('0x37')](_0x2227('0x38'))){_0x2532ab[_0x2227('0x39')]=qs['limit'](_0x408f5b['query'][_0x2227('0x39')]);_0x2532ab[_0x2227('0x1d')]=qs[_0x2227('0x1d')](_0x408f5b[_0x2227('0x32')][_0x2227('0x1d')]);}return _0x4f4e61[_0x2227('0x85')](_0x2532ab);}})[_0x2227('0x23')](function(_0x2b24d2){if(_0x2b24d2){return _0x2b24d2?{'count':_0x45888e,'rows':_0x2b24d2}:null;}})[_0x2227('0x23')](respondWithResult(_0x34c05a,null))[_0x2227('0x42')](handleError(_0x34c05a,null));}; \ No newline at end of file +var _0xcbfe=['apply','update','then','get','UserProfileResource','destroy','end','sendStatus','error','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','role','user','OpenchannelQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','offset','order','OpenchannelQueueId','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','every','TeamId','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./openchannelQueue.socket','register','status','undefined','limit','count','Content-Range'];(function(_0x1ee8c8,_0x54ba7e){var _0x240ef3=function(_0x34fe1e){while(--_0x34fe1e){_0x1ee8c8['push'](_0x1ee8c8['shift']());}};_0x240ef3(++_0x54ba7e);}(_0xcbfe,0x1e1));var _0xecbf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcbfe[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xecbf('0x0'));var rimraf=require(_0xecbf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xecbf('0x2'));var rp=require(_0xecbf('0x3'));var moment=require(_0xecbf('0x4'));var BPromise=require(_0xecbf('0x5'));var Mustache=require(_0xecbf('0x6'));var util=require(_0xecbf('0x7'));var path=require(_0xecbf('0x8'));var sox=require(_0xecbf('0x9'));var csv=require('to-csv');var ejs=require(_0xecbf('0xa'));var fs=require('fs');var fs_extra=require(_0xecbf('0xb'));var _=require('lodash');var squel=require(_0xecbf('0xc'));var crypto=require('crypto');var jsforce=require(_0xecbf('0xd'));var deskjs=require(_0xecbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xecbf('0xf'));var Papa=require(_0xecbf('0x10'));var Redis=require(_0xecbf('0x11'));var authService=require(_0xecbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xecbf('0x13'));var hardwareService=require(_0xecbf('0x14'));var logger=require(_0xecbf('0x15'))(_0xecbf('0x16'));var utils=require(_0xecbf('0x17'));var config=require(_0xecbf('0x18'));var licenseUtil=require(_0xecbf('0x19'));var db=require('../../mysqldb')['db'];config[_0xecbf('0x1a')]=_['defaults'](config[_0xecbf('0x1a')],{'host':_0xecbf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecbf('0x1a')]));require(_0xecbf('0x1c'))[_0xecbf('0x1d')](socket);function respondWithStatusCode(_0x224321,_0x1602ba){_0x1602ba=_0x1602ba||0xcc;return function(_0x534c4f){if(_0x534c4f){return _0x224321['sendStatus'](_0x1602ba);}return _0x224321[_0xecbf('0x1e')](_0x1602ba)['end']();};}function respondWithResult(_0x26feee,_0x8e923c){_0x8e923c=_0x8e923c||0xc8;return function(_0x144ad6){if(_0x144ad6){return _0x26feee[_0xecbf('0x1e')](_0x8e923c)['json'](_0x144ad6);}};}function respondWithFilteredResult(_0x446c61,_0x56e542){return function(_0x1455a4){if(_0x1455a4){var _0x40584f=typeof _0x56e542['offset']===_0xecbf('0x1f')&&typeof _0x56e542[_0xecbf('0x20')]===_0xecbf('0x1f');var _0x26d8c1=_0x1455a4[_0xecbf('0x21')];var _0x417f66=_0x40584f?0x0:_0x56e542['offset'];var _0x589c4b=_0x40584f?_0x1455a4['count']:_0x56e542['offset']+_0x56e542[_0xecbf('0x20')];var _0x5af58e;if(_0x589c4b>=_0x26d8c1){_0x589c4b=_0x26d8c1;_0x5af58e=0xc8;}else{_0x5af58e=0xce;}_0x446c61[_0xecbf('0x1e')](_0x5af58e);return _0x446c61['set'](_0xecbf('0x22'),_0x417f66+'-'+_0x589c4b+'/'+_0x26d8c1)['json'](_0x1455a4);}return null;};}function patchUpdates(_0x27276f){return function(_0x103a2e){try{jsonpatch[_0xecbf('0x23')](_0x103a2e,_0x27276f,!![]);}catch(_0x43d796){return BPromise['reject'](_0x43d796);}return _0x103a2e['save']();};}function saveUpdates(_0x506201,_0x5af681){return function(_0x4fc2fc){if(_0x4fc2fc){return _0x4fc2fc[_0xecbf('0x24')](_0x506201)['then'](function(_0x51b757){return _0x51b757;});}return null;};}function removeEntity(_0x260478,_0x3a5ecd){return function(_0x5d2360){if(_0x5d2360){return _0x5d2360['destroy']()[_0xecbf('0x25')](function(){var _0x5d1bb4=_0x5d2360[_0xecbf('0x26')]({'plain':!![]});var _0x3038dc='OpenchannelQueues';return db[_0xecbf('0x27')][_0xecbf('0x28')]({'where':{'type':_0x3038dc,'resourceId':_0x5d1bb4['id']}})['then'](function(){return _0x5d2360;});})[_0xecbf('0x25')](function(){_0x260478[_0xecbf('0x1e')](0xcc)[_0xecbf('0x29')]();});}};}function handleEntityNotFound(_0x539546,_0x3ebffd){return function(_0x513900){if(!_0x513900){_0x539546[_0xecbf('0x2a')](0x194);}return _0x513900;};}function handleError(_0x380bcf,_0x3a07d6){_0x3a07d6=_0x3a07d6||0x1f4;return function(_0x5dadce){logger[_0xecbf('0x2b')](_0x5dadce['stack']);if(_0x5dadce[_0xecbf('0x2c')]){delete _0x5dadce[_0xecbf('0x2c')];}_0x380bcf['status'](_0x3a07d6)['send'](_0x5dadce);};}exports[_0xecbf('0x2d')]=function(_0x16c6e0,_0x6f69e2){var _0x50377e={},_0x1e1be1={},_0x58de15={'count':0x0,'rows':[]};var _0x12bbea=_[_0xecbf('0x2e')](db[_0xecbf('0x2f')][_0xecbf('0x30')],function(_0x378506){return{'name':_0x378506[_0xecbf('0x31')],'type':_0x378506[_0xecbf('0x32')][_0xecbf('0x33')]};});_0x1e1be1[_0xecbf('0x34')]=_[_0xecbf('0x2e')](_0x12bbea,_0xecbf('0x2c'));_0x1e1be1[_0xecbf('0x35')]=_[_0xecbf('0x36')](_0x16c6e0[_0xecbf('0x35')]);_0x1e1be1[_0xecbf('0x37')]=_[_0xecbf('0x38')](_0x1e1be1[_0xecbf('0x34')],_0x1e1be1[_0xecbf('0x35')]);_0x50377e['attributes']=_[_0xecbf('0x38')](_0x1e1be1[_0xecbf('0x34')],qs[_0xecbf('0x39')](_0x16c6e0[_0xecbf('0x35')][_0xecbf('0x39')]));_0x50377e['attributes']=_0x50377e[_0xecbf('0x3a')][_0xecbf('0x3b')]?_0x50377e['attributes']:_0x1e1be1['model'];if(!_0x16c6e0[_0xecbf('0x35')][_0xecbf('0x3c')](_0xecbf('0x3d'))){_0x50377e[_0xecbf('0x20')]=qs[_0xecbf('0x20')](_0x16c6e0['query']['limit']);_0x50377e['offset']=qs['offset'](_0x16c6e0[_0xecbf('0x35')]['offset']);}_0x50377e['order']=qs['sort'](_0x16c6e0[_0xecbf('0x35')][_0xecbf('0x3e')]);_0x50377e[_0xecbf('0x3f')]=qs[_0xecbf('0x37')](_[_0xecbf('0x40')](_0x16c6e0[_0xecbf('0x35')],_0x1e1be1[_0xecbf('0x37')]),_0x12bbea);if(_0x16c6e0[_0xecbf('0x35')]['filter']){_0x50377e[_0xecbf('0x3f')]=_[_0xecbf('0x41')](_0x50377e[_0xecbf('0x3f')],{'$or':_['map'](_0x12bbea,function(_0x3d2a53){if(_0x3d2a53['type']!=='VIRTUAL'){var _0x5abc86={};_0x5abc86[_0x3d2a53[_0xecbf('0x2c')]]={'$like':'%'+_0x16c6e0[_0xecbf('0x35')][_0xecbf('0x42')]+'%'};return _0x5abc86;}})});}_0x50377e=_['merge']({},_0x50377e,_0x16c6e0[_0xecbf('0x43')]);var _0xac486c={'where':_0x50377e['where']};return db[_0xecbf('0x2f')][_0xecbf('0x21')](_0xac486c)[_0xecbf('0x25')](function(_0xb222a4){_0x58de15[_0xecbf('0x21')]=_0xb222a4;if(_0x16c6e0['query'][_0xecbf('0x44')]){_0x50377e[_0xecbf('0x45')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xecbf('0x46')](_0x50377e);})[_0xecbf('0x25')](function(_0x252d75){_0x58de15[_0xecbf('0x47')]=_0x252d75;return _0x58de15;})[_0xecbf('0x25')](respondWithFilteredResult(_0x6f69e2,_0x50377e))[_0xecbf('0x48')](handleError(_0x6f69e2,null));};exports[_0xecbf('0x49')]=function(_0x49f342,_0x5c857b){var _0x3aacd0={'raw':!![],'where':{'id':_0x49f342[_0xecbf('0x4a')]['id']}},_0x34e4a5={};_0x34e4a5[_0xecbf('0x34')]=_[_0xecbf('0x36')](db[_0xecbf('0x2f')][_0xecbf('0x30')]);_0x34e4a5[_0xecbf('0x35')]=_[_0xecbf('0x36')](_0x49f342[_0xecbf('0x35')]);_0x34e4a5[_0xecbf('0x37')]=_[_0xecbf('0x38')](_0x34e4a5[_0xecbf('0x34')],_0x34e4a5[_0xecbf('0x35')]);_0x3aacd0[_0xecbf('0x3a')]=_['intersection'](_0x34e4a5[_0xecbf('0x34')],qs[_0xecbf('0x39')](_0x49f342[_0xecbf('0x35')][_0xecbf('0x39')]));_0x3aacd0['attributes']=_0x3aacd0[_0xecbf('0x3a')][_0xecbf('0x3b')]?_0x3aacd0['attributes']:_0x34e4a5[_0xecbf('0x34')];if(_0x49f342[_0xecbf('0x35')][_0xecbf('0x44')]){_0x3aacd0[_0xecbf('0x45')]=[{'all':!![]}];}_0x3aacd0=_[_0xecbf('0x41')]({},_0x3aacd0,_0x49f342[_0xecbf('0x43')]);return db[_0xecbf('0x2f')][_0xecbf('0x4b')](_0x3aacd0)[_0xecbf('0x25')](handleEntityNotFound(_0x5c857b,null))['then'](respondWithResult(_0x5c857b,null))[_0xecbf('0x48')](handleError(_0x5c857b,null));};exports[_0xecbf('0x4c')]=function(_0x2c9f0d,_0x1db3f7){return db[_0xecbf('0x2f')][_0xecbf('0x4c')](_0x2c9f0d[_0xecbf('0x4d')],{})[_0xecbf('0x25')](function(_0x3e14ac){var _0x26f3cb=_0x2c9f0d['user'][_0xecbf('0x26')]({'plain':!![]});if(!_0x26f3cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26f3cb[_0xecbf('0x4e')]===_0xecbf('0x4f')){var _0x59b1b8=_0x3e14ac[_0xecbf('0x26')]({'plain':!![]});var _0x3bb6db=_0xecbf('0x50');return db['UserProfileSection'][_0xecbf('0x4b')]({'where':{'name':_0x3bb6db,'userProfileId':_0x26f3cb['userProfileId']},'raw':!![]})[_0xecbf('0x25')](function(_0x524900){if(_0x524900&&_0x524900[_0xecbf('0x51')]===0x0){return db['UserProfileResource'][_0xecbf('0x4c')]({'name':_0x59b1b8[_0xecbf('0x2c')],'resourceId':_0x59b1b8['id'],'type':_0x524900[_0xecbf('0x2c')],'sectionId':_0x524900['id']},{})['then'](function(){return _0x3e14ac;});}else{return _0x3e14ac;}})[_0xecbf('0x48')](function(_0x4676ef){logger[_0xecbf('0x2b')](_0xecbf('0x52'),_0x4676ef);throw _0x4676ef;});}return _0x3e14ac;})['then'](respondWithResult(_0x1db3f7,0xc9))[_0xecbf('0x48')](handleError(_0x1db3f7,null));};exports[_0xecbf('0x24')]=function(_0x507262,_0x57dc55){if(_0x507262['body']['id']){delete _0x507262[_0xecbf('0x4d')]['id'];}return db[_0xecbf('0x2f')]['find']({'where':{'id':_0x507262[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](handleEntityNotFound(_0x57dc55,null))[_0xecbf('0x25')](saveUpdates(_0x507262['body'],null))[_0xecbf('0x25')](respondWithResult(_0x57dc55,null))[_0xecbf('0x48')](handleError(_0x57dc55,null));};exports[_0xecbf('0x28')]=function(_0x5cb779,_0x1ccf34){return db[_0xecbf('0x2f')][_0xecbf('0x4b')]({'where':{'id':_0x5cb779[_0xecbf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ccf34,null))[_0xecbf('0x25')](removeEntity(_0x1ccf34,null))[_0xecbf('0x48')](handleError(_0x1ccf34,null));};exports['describe']=function(_0x4f8b54,_0x3c28f5){return db[_0xecbf('0x2f')][_0xecbf('0x53')]()[_0xecbf('0x25')](respondWithResult(_0x3c28f5,null))[_0xecbf('0x48')](handleError(_0x3c28f5,null));};exports[_0xecbf('0x54')]=function(_0x4dc4d9,_0x5dc553,_0x22b232){var _0x52eeae={'raw':!![],'where':{}},_0xc1728f={},_0x5964ec;return db[_0xecbf('0x2f')][_0xecbf('0x55')]({'where':{'id':_0x4dc4d9[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](handleEntityNotFound(_0x5dc553,null))[_0xecbf('0x25')](function(_0x49faf8){if(_0x49faf8){_0x5964ec=_0x49faf8['get']({'plain':!![]});_0xc1728f[_0xecbf('0x34')]=_[_0xecbf('0x36')](db[_0xecbf('0x56')][_0xecbf('0x30')]);_0xc1728f['query']=_[_0xecbf('0x36')](_0x4dc4d9[_0xecbf('0x35')]);_0xc1728f[_0xecbf('0x37')]=_['intersection'](_0xc1728f['model'],_0xc1728f[_0xecbf('0x35')]);_0x52eeae['attributes']=_[_0xecbf('0x38')](_0xc1728f[_0xecbf('0x34')],qs[_0xecbf('0x39')](_0x4dc4d9['query'][_0xecbf('0x39')]));_0x52eeae[_0xecbf('0x3a')]=_0x52eeae[_0xecbf('0x3a')][_0xecbf('0x3b')]?_0x52eeae['attributes']:_0xc1728f[_0xecbf('0x34')];if(!_0x4dc4d9[_0xecbf('0x35')][_0xecbf('0x3c')](_0xecbf('0x3d'))){_0x52eeae[_0xecbf('0x20')]=qs[_0xecbf('0x20')](_0x4dc4d9[_0xecbf('0x35')]['limit']);_0x52eeae[_0xecbf('0x57')]=qs['offset'](_0x4dc4d9[_0xecbf('0x35')][_0xecbf('0x57')]);}_0x52eeae[_0xecbf('0x58')]=qs['sort'](_0x4dc4d9[_0xecbf('0x35')]['sort']);_0x52eeae['where']=qs['filters'](_[_0xecbf('0x40')](_0x4dc4d9[_0xecbf('0x35')],_0xc1728f[_0xecbf('0x37')]));_0x52eeae[_0xecbf('0x3f')][_0xecbf('0x59')]=_0x49faf8['id'];if(_0x4dc4d9['query'][_0xecbf('0x42')]){_0x52eeae[_0xecbf('0x3f')]=_[_0xecbf('0x41')](_0x52eeae[_0xecbf('0x3f')],{'$or':_[_0xecbf('0x2e')](_0x52eeae['attributes'],function(_0x22609d){var _0x45fac5={};_0x45fac5[_0x22609d]={'$like':'%'+_0x4dc4d9[_0xecbf('0x35')][_0xecbf('0x42')]+'%'};return _0x45fac5;})});}_0x52eeae=_[_0xecbf('0x41')]({},_0x52eeae,_0x4dc4d9[_0xecbf('0x43')]);return db[_0xecbf('0x56')][_0xecbf('0x46')](_0x52eeae);}})[_0xecbf('0x25')](function(_0x415205){if(_0x415205){return db[_0xecbf('0x5a')]['findAndCountAll']({'where':{'id':_[_0xecbf('0x2e')](_0x415205,'UserId'),'role':_0xecbf('0x5b')},'attributes':['id',_0xecbf('0x2c'),_0xecbf('0x5c'),_0xecbf('0x5d'),_0xecbf('0x5e')]});}})['then'](function(_0x2e879f){if(_0x2e879f){return{'count':_0x2e879f[_0xecbf('0x21')],'rows':_[_0xecbf('0x2e')](_0x2e879f[_0xecbf('0x47')],function(_0x58a356){return{'membername':_0x58a356[_0xecbf('0x2c')],'UserId':_0x58a356['id'],'queue_name':_0x5964ec[_0xecbf('0x2c')],'OpenchannelQueueId':_0x5964ec['id'],'interface':util[_0xecbf('0x5f')](_0xecbf('0x60'),'SIP',_0x58a356[_0xecbf('0x2c')]),'penalty':0x0,'paused':_0x58a356[_0xecbf('0x5c')],'createdAt':_0x58a356[_0xecbf('0x5e')],'updatedAt':_0x58a356[_0xecbf('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xecbf('0x25')](respondWithFilteredResult(_0x5dc553,_0x52eeae))[_0xecbf('0x48')](handleError(_0x5dc553,null));};exports[_0xecbf('0x61')]=function(_0x3cca68,_0x48691c,_0x4b91f5){var _0x356e5a={};var _0x534493={};var _0x3a02b8;var _0x2b1706;return db[_0xecbf('0x2f')]['findOne']({'where':{'id':_0x3cca68['params']['id']}})['then'](handleEntityNotFound(_0x48691c,null))['then'](function(_0x31b3cb){if(_0x31b3cb){_0x3a02b8=_0x31b3cb;_0x534493[_0xecbf('0x34')]=_[_0xecbf('0x36')](db[_0xecbf('0x62')][_0xecbf('0x30')]);_0x534493['query']=_[_0xecbf('0x36')](_0x3cca68[_0xecbf('0x35')]);_0x534493['filters']=_[_0xecbf('0x38')](_0x534493[_0xecbf('0x34')],_0x534493[_0xecbf('0x35')]);_0x356e5a['attributes']=_[_0xecbf('0x38')](_0x534493[_0xecbf('0x34')],qs[_0xecbf('0x39')](_0x3cca68[_0xecbf('0x35')]['fields']));_0x356e5a['attributes']=_0x356e5a['attributes']['length']?_0x356e5a['attributes']:_0x534493['model'];_0x356e5a['order']=qs[_0xecbf('0x3e')](_0x3cca68[_0xecbf('0x35')][_0xecbf('0x3e')]);_0x356e5a['where']=qs[_0xecbf('0x37')](_[_0xecbf('0x40')](_0x3cca68['query'],_0x534493[_0xecbf('0x37')]));if(_0x3cca68[_0xecbf('0x35')][_0xecbf('0x42')]){_0x356e5a[_0xecbf('0x3f')]=_[_0xecbf('0x41')](_0x356e5a[_0xecbf('0x3f')],{'$or':_[_0xecbf('0x2e')](_0x356e5a[_0xecbf('0x3a')],function(_0x21a9a8){var _0xff4851={};_0xff4851[_0x21a9a8]={'$like':'%'+_0x3cca68[_0xecbf('0x35')][_0xecbf('0x42')]+'%'};return _0xff4851;})});}_0x356e5a=_[_0xecbf('0x41')]({},_0x356e5a,_0x3cca68['options']);return _0x3a02b8['getTeams'](_0x356e5a);}})['then'](function(_0x48324f){if(_0x48324f){_0x2b1706=_0x48324f[_0xecbf('0x3b')];if(!_0x3cca68[_0xecbf('0x35')][_0xecbf('0x3c')]('nolimit')){_0x356e5a[_0xecbf('0x20')]=qs[_0xecbf('0x20')](_0x3cca68[_0xecbf('0x35')]['limit']);_0x356e5a[_0xecbf('0x57')]=qs['offset'](_0x3cca68[_0xecbf('0x35')]['offset']);}return _0x3a02b8[_0xecbf('0x61')](_0x356e5a);}})[_0xecbf('0x25')](function(_0x3b6d71){if(_0x3b6d71){return _0x3b6d71?{'count':_0x2b1706,'rows':_0x3b6d71}:null;}})[_0xecbf('0x25')](respondWithResult(_0x48691c,null))[_0xecbf('0x48')](handleError(_0x48691c,null));};exports[_0xecbf('0x63')]=function(_0x5c94d3,_0x2acac1,_0x3c4f6f){var _0x3ae919=_0x5c94d3[_0xecbf('0x4d')][_0xecbf('0x64')];return db[_0xecbf('0x62')][_0xecbf('0x46')]({'where':{'id':_0x3ae919},'attributes':['id'],'include':[{'model':db['User'],'as':_0xecbf('0x65'),'attributes':['id',_0xecbf('0x2c'),_0xecbf('0x66'),_0xecbf('0x67'),_0xecbf('0x68')],'raw':!![]}]})[_0xecbf('0x25')](function(_0x4d4828){if(_0x4d4828){var _0x5dc33b=_[_0xecbf('0x69')](_0x4d4828,function(_0x149c0d){var _0x17ee41=_0x149c0d[_0xecbf('0x26')]({'plain':!![]});return _0x17ee41[_0xecbf('0x65')];});return db[_0xecbf('0x2f')]['find']({'where':{'id':_0x5c94d3[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](function(_0x5c4ebf){return db[_0xecbf('0x6a')][_0xecbf('0x6b')](function(_0x3418cf){return _0x5c4ebf['addTeams'](_0x3ae919,{'transaction':_0x3418cf})[_0xecbf('0x25')](function(){return BPromise['each'](_0x5dc33b,function(_0x58689e){return db[_0xecbf('0x56')]['findOrCreate']({'where':{'UserId':_0x58689e['id'],'OpenchannelQueueId':_0x5c94d3['params']['id']},'transaction':_0x3418cf});});})['then'](function(){_0x5dc33b[_0xecbf('0x6c')](function(_0x366900){socket[_0xecbf('0x6d')](_0xecbf('0x6e'),{'UserId':_0x366900['id'],'OpenchannelQueueId':_0x5c4ebf['id']});});});});});}})['then'](respondWithStatusCode(_0x2acac1,null))[_0xecbf('0x48')](handleError(_0x2acac1,null));};exports[_0xecbf('0x6f')]=function(_0x13afa2,_0x428576,_0x1edea0){return db[_0xecbf('0x62')][_0xecbf('0x46')]({'where':{'id':_0x13afa2[_0xecbf('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xecbf('0x25')](handleEntityNotFound(_0x428576,null))[_0xecbf('0x25')](function(_0x261c56){var _0x177477=_[_0xecbf('0x2e')](_0x261c56,'id');var _0x76f870=[];var _0x58b1b2=[];var _0x6b4a47=squel[_0xecbf('0x70')]();_0x6b4a47[_0xecbf('0x71')](_0xecbf('0x72'))['from'](_0xecbf('0x73'),'tq')[_0xecbf('0x74')](_0xecbf('0x75'),'ut',_0xecbf('0x76'))[_0xecbf('0x3f')](_0xecbf('0x77'),_0x13afa2[_0xecbf('0x4a')]['id']);for(var _0x2c36f9=0x0;_0x2c36f9<_0x261c56[_0xecbf('0x3b')];_0x2c36f9+=0x1){let _0x35fbe7=_0x261c56[_0x2c36f9];for(var _0x4bd287=0x0;_0x4bd287<_0x35fbe7[_0xecbf('0x65')][_0xecbf('0x3b')];_0x4bd287+=0x1){let _0x56aacc=_0x35fbe7[_0xecbf('0x65')][_0x4bd287];var _0x573c64=_0x6b4a47['clone']();_0x573c64['where'](_0xecbf('0x78'),_0x56aacc['id']);_0x58b1b2['push'](db['sequelize']['query'](_0x573c64['toString'](),{'type':db[_0xecbf('0x6a')]['QueryTypes']['SELECT']})[_0xecbf('0x25')](function(_0x25a449){if(_0x25a449['length']===0x1){return _0x56aacc['id'];}else{var _0x46f22f=_[_0xecbf('0x79')](_['map'](_0x25a449,_0xecbf('0x7a')),function(_0x293ca7){return _['includes'](_0x177477,_0x293ca7);});if(_0x46f22f){return _0x56aacc['id'];}}}));}}return BPromise['all'](_0x58b1b2)[_0xecbf('0x25')](function(_0x5827c7){_0x76f870=_(_0x76f870)['union'](_0x5827c7)['compact']()['value']();return db[_0xecbf('0x2f')][_0xecbf('0x4b')]({'where':{'id':_0x13afa2[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](function(_0x485b64){return db['sequelize']['transaction'](function(_0x195113){return _0x485b64[_0xecbf('0x6f')](_0x13afa2['query'][_0xecbf('0x64')],{'transaction':_0x195113})[_0xecbf('0x25')](function(){if(!_['isEmpty'](_0x76f870)){return _0x485b64[_0xecbf('0x7b')](_0x76f870,{'transaction':_0x195113});}})[_0xecbf('0x25')](function(){_0x76f870['forEach'](function(_0x2e5d34){socket[_0xecbf('0x6d')](_0xecbf('0x7c'),{'UserId':_0x2e5d34,'OpenchannelQueueId':_0x485b64['id']});});});});});});})[_0xecbf('0x25')](respondWithStatusCode(_0x428576,null))[_0xecbf('0x48')](handleError(_0x428576,null));};exports['addAgents']=function(_0x1c0295,_0x6d7bfa,_0x5efbb2){return db[_0xecbf('0x2f')][_0xecbf('0x4b')]({'where':{'id':_0x1c0295[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](handleEntityNotFound(_0x6d7bfa,null))[_0xecbf('0x25')](function(_0x14a9b2){if(_0x14a9b2){return _0x14a9b2[_0xecbf('0x7d')](_0x1c0295[_0xecbf('0x4d')][_0xecbf('0x64')],_[_0xecbf('0x7e')](_0x1c0295[_0xecbf('0x4d')],[_0xecbf('0x64'),'id'])||{})['spread'](function(_0x2c0929){for(var _0x47c87b=0x0;_0x47c87b<_0x1c0295[_0xecbf('0x4d')][_0xecbf('0x64')][_0xecbf('0x3b')];_0x47c87b+=0x1){socket['emit'](_0xecbf('0x6e'),{'UserId':Number(_0x1c0295[_0xecbf('0x4d')][_0xecbf('0x64')][_0x47c87b]),'OpenchannelQueueId':Number(_0x1c0295[_0xecbf('0x4a')]['id'])});}return _0x2c0929;});}})[_0xecbf('0x25')](respondWithResult(_0x6d7bfa,null))[_0xecbf('0x48')](handleError(_0x6d7bfa,null));};exports[_0xecbf('0x7b')]=function(_0x95b7,_0x3f254d,_0x37b937){return db[_0xecbf('0x2f')][_0xecbf('0x4b')]({'where':{'id':_0x95b7[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](handleEntityNotFound(_0x3f254d,null))[_0xecbf('0x25')](function(_0x4a23de){if(_0x4a23de){return _0x4a23de[_0xecbf('0x7b')](_0x95b7['query'][_0xecbf('0x64')])[_0xecbf('0x25')](function(){if(_[_0xecbf('0x7f')](_0x95b7['query']['ids'])){for(var _0x20dca1=0x0;_0x20dca1<_0x95b7[_0xecbf('0x35')][_0xecbf('0x64')][_0xecbf('0x3b')];_0x20dca1+=0x1){socket[_0xecbf('0x6d')](_0xecbf('0x7c'),{'UserId':Number(_0x95b7[_0xecbf('0x35')]['ids'][_0x20dca1]),'OpenchannelQueueId':Number(_0x95b7[_0xecbf('0x4a')]['id'])});}}else{socket[_0xecbf('0x6d')](_0xecbf('0x7c'),{'UserId':Number(_0x95b7[_0xecbf('0x35')][_0xecbf('0x64')]),'OpenchannelQueueId':Number(_0x95b7['params']['id'])});}});}})[_0xecbf('0x25')](respondWithStatusCode(_0x3f254d,null))[_0xecbf('0x48')](handleError(_0x3f254d,null));};exports[_0xecbf('0x80')]=function(_0x18836a,_0x35e667,_0x671e10){var _0x5bf926={};var _0x2b1237={};var _0x2029e5;var _0x445998;return db[_0xecbf('0x2f')][_0xecbf('0x55')]({'where':{'id':_0x18836a[_0xecbf('0x4a')]['id']}})[_0xecbf('0x25')](handleEntityNotFound(_0x35e667,null))[_0xecbf('0x25')](function(_0x261b46){if(_0x261b46){_0x2029e5=_0x261b46;_0x2b1237[_0xecbf('0x34')]=_[_0xecbf('0x36')](db[_0xecbf('0x5a')][_0xecbf('0x30')]);_0x2b1237[_0xecbf('0x35')]=_[_0xecbf('0x36')](_0x18836a[_0xecbf('0x35')]);_0x2b1237[_0xecbf('0x37')]=_[_0xecbf('0x38')](_0x2b1237[_0xecbf('0x34')],_0x2b1237['query']);_0x5bf926['attributes']=_['intersection'](_0x2b1237[_0xecbf('0x34')],qs[_0xecbf('0x39')](_0x18836a[_0xecbf('0x35')][_0xecbf('0x39')]));_0x5bf926[_0xecbf('0x3a')]=_0x5bf926['attributes'][_0xecbf('0x3b')]?_0x5bf926[_0xecbf('0x3a')]:_0x2b1237[_0xecbf('0x34')];_0x5bf926[_0xecbf('0x58')]=qs['sort'](_0x18836a[_0xecbf('0x35')]['sort']);_0x5bf926['where']=qs[_0xecbf('0x37')](_[_0xecbf('0x40')](_0x18836a[_0xecbf('0x35')],_0x2b1237['filters']));if(_0x18836a[_0xecbf('0x35')][_0xecbf('0x42')]){_0x5bf926[_0xecbf('0x3f')]=_[_0xecbf('0x41')](_0x5bf926[_0xecbf('0x3f')],{'$or':_[_0xecbf('0x2e')](_0x5bf926[_0xecbf('0x3a')],function(_0x45633c){var _0x25f6c7={};_0x25f6c7[_0x45633c]={'$like':'%'+_0x18836a[_0xecbf('0x35')][_0xecbf('0x42')]+'%'};return _0x25f6c7;})});}_0x5bf926=_['merge']({},_0x5bf926,_0x18836a[_0xecbf('0x43')]);return _0x2029e5['getAgents'](_0x5bf926);}})[_0xecbf('0x25')](function(_0x41822a){if(_0x41822a){_0x445998=_0x41822a[_0xecbf('0x3b')];if(!_0x18836a['query'][_0xecbf('0x3c')](_0xecbf('0x3d'))){_0x5bf926[_0xecbf('0x20')]=qs[_0xecbf('0x20')](_0x18836a[_0xecbf('0x35')][_0xecbf('0x20')]);_0x5bf926[_0xecbf('0x57')]=qs[_0xecbf('0x57')](_0x18836a['query'][_0xecbf('0x57')]);}return _0x2029e5['getAgents'](_0x5bf926);}})[_0xecbf('0x25')](function(_0x170556){if(_0x170556){return _0x170556?{'count':_0x445998,'rows':_0x170556}:null;}})[_0xecbf('0x25')](respondWithResult(_0x35e667,null))[_0xecbf('0x48')](handleError(_0x35e667,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 9864663..4a7a89f 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 _0xc9e1=['../../mysqldb','OpenchannelQueue','setMaxListeners','remove','emit','hasOwnProperty','exports','events'];(function(_0x15b9ee,_0x158775){var _0x2d9e34=function(_0xb4432f){while(--_0xb4432f){_0x15b9ee['push'](_0x15b9ee['shift']());}};_0x2d9e34(++_0x158775);}(_0xc9e1,0x97));var _0x1c9e=function(_0x16e1a0,_0x1f97e4){_0x16e1a0=_0x16e1a0-0x0;var _0x4635d8=_0xc9e1[_0x16e1a0];return _0x4635d8;};'use strict';var EventEmitter=require(_0x1c9e('0x0'));var OpenchannelQueue=require(_0x1c9e('0x1'))['db'][_0x1c9e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1c9e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1c9e('0x4')};function emitEvent(_0x112efc){return function(_0x53dfdc,_0x2ce593,_0x9080a3){OpenchannelQueueEvents['emit'](_0x112efc+':'+_0x53dfdc['id'],_0x53dfdc);OpenchannelQueueEvents[_0x1c9e('0x5')](_0x112efc,_0x53dfdc);_0x9080a3(null);};}for(var e in events){if(events[_0x1c9e('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x1c9e('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x5f35=['remove','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f35,0x15c));var _0x55f3=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x5f35[_0x1e6659];return _0x4d16e4;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x55f3('0x0'))['db'][_0x55f3('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x55f3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x55f3('0x3'),'afterDestroy':_0x55f3('0x4')};function emitEvent(_0x5bada6){return function(_0x4f5551,_0x459837,_0x32be4e){OpenchannelQueueEvents['emit'](_0x5bada6+':'+_0x4f5551['id'],_0x4f5551);OpenchannelQueueEvents['emit'](_0x5bada6,_0x4f5551);_0x32be4e(null);};}for(var e in events){if(events[_0x55f3('0x5')](e)){var event=events[e];OpenchannelQueue[_0x55f3('0x6')](e,emitEvent(event));}}module[_0x55f3('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 49a23dc..2788476 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 _0x5658=['openchannel_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x5d9245,_0x341cf9){var _0x401070=function(_0x1202b3){while(--_0x1202b3){_0x5d9245['push'](_0x5d9245['shift']());}};_0x401070(++_0x341cf9);}(_0x5658,0x1e1));var _0x8565=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5658[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x8565('0x0'));var logger=require(_0x8565('0x1'))(_0x8565('0x2'));var moment=require(_0x8565('0x3'));var BPromise=require('bluebird');var rp=require(_0x8565('0x4'));var fs=require('fs');var path=require(_0x8565('0x5'));var rimraf=require(_0x8565('0x6'));var config=require('../../config/environment');var attributes=require(_0x8565('0x7'));module[_0x8565('0x8')]=function(_0x2450e7,_0x365341){return _0x2450e7[_0x8565('0x9')](_0x8565('0xa'),attributes,{'tableName':_0x8565('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc321=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0xc321,0xa4));var _0x1c32=function(_0x348c94,_0x51dd89){_0x348c94=_0x348c94-0x0;var _0x182df2=_0xc321[_0x348c94];return _0x182df2;};'use strict';var _=require(_0x1c32('0x0'));var util=require(_0x1c32('0x1'));var logger=require(_0x1c32('0x2'))(_0x1c32('0x3'));var moment=require('moment');var BPromise=require(_0x1c32('0x4'));var rp=require(_0x1c32('0x5'));var fs=require('fs');var path=require(_0x1c32('0x6'));var rimraf=require(_0x1c32('0x7'));var config=require(_0x1c32('0x8'));var attributes=require(_0x1c32('0x9'));module[_0x1c32('0xa')]=function(_0x441810,_0x33fff1){return _0x441810[_0x1c32('0xb')]('OpenchannelQueue',attributes,{'tableName':_0x1c32('0xc'),'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 41a2f1d..32f9909 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 _0x11dd=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./openchannelQueue.socket','register','request','then','info','debug'];(function(_0x252c67,_0xa1a5c2){var _0x217827=function(_0x552209){while(--_0x552209){_0x252c67['push'](_0x252c67['shift']());}};_0x217827(++_0xa1a5c2);}(_0x11dd,0x162));var _0xd11d=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x11dd[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0xd11d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd11d('0x1'));var db=require(_0xd11d('0x2'))['db'];var utils=require(_0xd11d('0x3'));var logger=require('../../config/logger')(_0xd11d('0x4'));var config=require(_0xd11d('0x5'));var jayson=require(_0xd11d('0x6'));var client=jayson[_0xd11d('0x7')][_0xd11d('0x8')]({'port':0x232a});config[_0xd11d('0x9')]=_['defaults'](config[_0xd11d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd11d('0x9')]));require(_0xd11d('0xa'))[_0xd11d('0xb')](socket);function respondWithRpcPromise(_0x318662,_0x3da8ab,_0x11c983){return new BPromise(function(_0x53f662,_0x5993c5){return client[_0xd11d('0xc')](_0x318662,_0x11c983)[_0xd11d('0xd')](function(_0x1c1999){logger[_0xd11d('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x3da8ab,'request\x20sent');logger[_0xd11d('0xf')](_0xd11d('0x10'),_0x3da8ab,_0xd11d('0x11'),JSON[_0xd11d('0x12')](_0x1c1999));if(_0x1c1999[_0xd11d('0x13')]){if(_0x1c1999[_0xd11d('0x13')][_0xd11d('0x14')]===0x1f4){logger[_0xd11d('0x13')](_0xd11d('0x15'),_0x3da8ab,_0x1c1999['error'][_0xd11d('0x16')]);return _0x5993c5(_0x1c1999[_0xd11d('0x13')][_0xd11d('0x16')]);}logger[_0xd11d('0x13')](_0xd11d('0x15'),_0x3da8ab,_0x1c1999['error'][_0xd11d('0x16')]);return _0x53f662(_0x1c1999[_0xd11d('0x13')]['message']);}else{logger[_0xd11d('0xe')](_0xd11d('0x15'),_0x3da8ab,_0xd11d('0x11'));_0x53f662(_0x1c1999['result'][_0xd11d('0x16')]);}})['catch'](function(_0x75ca8d){logger[_0xd11d('0x13')](_0xd11d('0x15'),_0x3da8ab,_0x75ca8d);_0x5993c5(_0x75ca8d);});});}exports['GetOpenchannelQueue']=function(_0x5e1c30){var _0x557fd1=this;return new Promise(function(_0x5b4ac2,_0x3e966b){return db[_0xd11d('0x17')][_0xd11d('0x18')]({'raw':_0x5e1c30[_0xd11d('0x19')]?_0x5e1c30[_0xd11d('0x19')][_0xd11d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e1c30[_0xd11d('0x19')]?_0x5e1c30['options'][_0xd11d('0x1b')]||null:null,'attributes':_0x5e1c30[_0xd11d('0x19')]?_0x5e1c30['options'][_0xd11d('0x1c')]||null:null,'limit':_0x5e1c30[_0xd11d('0x19')]?_0x5e1c30[_0xd11d('0x19')][_0xd11d('0x1d')]||null:null,'include':_0x5e1c30[_0xd11d('0x19')]?_0x5e1c30[_0xd11d('0x19')][_0xd11d('0x1e')]?_[_0xd11d('0x1f')](_0x5e1c30['options'][_0xd11d('0x1e')],function(_0x514900){return{'model':db[_0x514900[_0xd11d('0x20')]],'as':_0x514900['as'],'attributes':_0x514900['attributes'],'include':_0x514900[_0xd11d('0x1e')]?_[_0xd11d('0x1f')](_0x514900[_0xd11d('0x1e')],function(_0x1dd411){return{'model':db[_0x1dd411[_0xd11d('0x20')]],'as':_0x1dd411['as'],'attributes':_0x1dd411[_0xd11d('0x1c')],'include':_0x1dd411[_0xd11d('0x1e')]?_[_0xd11d('0x1f')](_0x1dd411[_0xd11d('0x1e')],function(_0x23b86f){return{'model':db[_0x23b86f[_0xd11d('0x20')]],'as':_0x23b86f['as'],'attributes':_0x23b86f[_0xd11d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd11d('0xd')](function(_0x264c95){logger[_0xd11d('0xe')](_0xd11d('0x21'),_0x5e1c30);logger[_0xd11d('0xf')](_0xd11d('0x21'),_0x5e1c30,JSON[_0xd11d('0x12')](_0x264c95));_0x5b4ac2(_0x264c95);})[_0xd11d('0x22')](function(_0x124f04){logger[_0xd11d('0x13')](_0xd11d('0x21'),_0x124f04[_0xd11d('0x16')],_0x5e1c30);_0x3e966b(_0x557fd1[_0xd11d('0x13')](0x1f4,_0x124f04[_0xd11d('0x16')]));});});};exports[_0xd11d('0x23')]=function(_0x184186){var _0x5ee378=this;return new Promise(function(_0x24633d,_0x3c8a53){return db[_0xd11d('0x17')][_0xd11d('0x24')]({'raw':_0x184186[_0xd11d('0x19')]?_0x184186[_0xd11d('0x19')][_0xd11d('0x1a')]===undefined?!![]:![]:!![],'where':_0x184186[_0xd11d('0x19')]?_0x184186[_0xd11d('0x19')][_0xd11d('0x1b')]||null:null,'attributes':_0x184186['options']?_0x184186[_0xd11d('0x19')][_0xd11d('0x1c')]||null:null,'include':_0x184186[_0xd11d('0x19')]?_0x184186[_0xd11d('0x19')]['include']?_[_0xd11d('0x1f')](_0x184186[_0xd11d('0x19')]['include'],function(_0x523bdf){return{'model':db[_0x523bdf[_0xd11d('0x20')]],'as':_0x523bdf['as'],'attributes':_0x523bdf[_0xd11d('0x1c')],'include':_0x523bdf[_0xd11d('0x1e')]?_['map'](_0x523bdf[_0xd11d('0x1e')],function(_0x319cfb){return{'model':db[_0x319cfb[_0xd11d('0x20')]],'as':_0x319cfb['as'],'attributes':_0x319cfb[_0xd11d('0x1c')],'include':_0x319cfb[_0xd11d('0x1e')]?_['map'](_0x319cfb['include'],function(_0x5ba20d){return{'model':db[_0x5ba20d['model']],'as':_0x5ba20d['as'],'attributes':_0x5ba20d[_0xd11d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x470976){logger[_0xd11d('0xe')](_0xd11d('0x23'),_0x184186);logger[_0xd11d('0xf')](_0xd11d('0x23'),_0x184186,JSON[_0xd11d('0x12')](_0x470976));_0x24633d(_0x470976);})['catch'](function(_0x175036){logger[_0xd11d('0x13')]('ShowOpenchannelQueue',_0x175036[_0xd11d('0x16')],_0x184186);_0x3c8a53(_0x5ee378['error'](0x1f4,_0x175036[_0xd11d('0x16')]));});});}; \ No newline at end of file +var _0x32fc=['redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','code','message','GetOpenchannelQueue','findAll','options','limit','include','model','attributes','map','catch','ShowOpenchannelQueue','OpenchannelQueue','raw','where','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x32fc,0x1d8));var _0xc32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc32f('0x0'));var moment=require('moment');var BPromise=require(_0xc32f('0x1'));var rs=require(_0xc32f('0x2'));var fs=require('fs');var Redis=require(_0xc32f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc32f('0x4'));var logger=require(_0xc32f('0x5'))(_0xc32f('0x6'));var config=require('../../config/environment');var jayson=require(_0xc32f('0x7'));var client=jayson[_0xc32f('0x8')]['http']({'port':0x232a});config[_0xc32f('0x9')]=_[_0xc32f('0xa')](config[_0xc32f('0x9')],{'host':_0xc32f('0xb'),'port':0x18eb});var socket=require(_0xc32f('0xc'))(new Redis(config['redis']));require(_0xc32f('0xd'))[_0xc32f('0xe')](socket);function respondWithRpcPromise(_0x353e74,_0x1da16b,_0x3422dd){return new BPromise(function(_0x1d09e2,_0x1185d9){return client[_0xc32f('0xf')](_0x353e74,_0x3422dd)[_0xc32f('0x10')](function(_0xc82726){logger[_0xc32f('0x11')](_0xc32f('0x12'),_0x1da16b,'request\x20sent');logger[_0xc32f('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1da16b,'request\x20sent',JSON[_0xc32f('0x14')](_0xc82726));if(_0xc82726['error']){if(_0xc82726[_0xc32f('0x15')][_0xc32f('0x16')]===0x1f4){logger[_0xc32f('0x15')](_0xc32f('0x12'),_0x1da16b,_0xc82726['error'][_0xc32f('0x17')]);return _0x1185d9(_0xc82726[_0xc32f('0x15')][_0xc32f('0x17')]);}logger['error'](_0xc32f('0x12'),_0x1da16b,_0xc82726[_0xc32f('0x15')]['message']);return _0x1d09e2(_0xc82726['error'][_0xc32f('0x17')]);}else{logger[_0xc32f('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x1da16b,'request\x20sent');_0x1d09e2(_0xc82726['result']['message']);}})['catch'](function(_0xb607bc){logger[_0xc32f('0x15')](_0xc32f('0x12'),_0x1da16b,_0xb607bc);_0x1185d9(_0xb607bc);});});}exports[_0xc32f('0x18')]=function(_0x48d74a){var _0x580f89=this;return new Promise(function(_0x2c30f4,_0x5eec8f){return db['OpenchannelQueue'][_0xc32f('0x19')]({'raw':_0x48d74a[_0xc32f('0x1a')]?_0x48d74a[_0xc32f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x48d74a[_0xc32f('0x1a')]?_0x48d74a[_0xc32f('0x1a')]['where']||null:null,'attributes':_0x48d74a[_0xc32f('0x1a')]?_0x48d74a[_0xc32f('0x1a')]['attributes']||null:null,'limit':_0x48d74a[_0xc32f('0x1a')]?_0x48d74a['options'][_0xc32f('0x1b')]||null:null,'include':_0x48d74a[_0xc32f('0x1a')]?_0x48d74a[_0xc32f('0x1a')][_0xc32f('0x1c')]?_['map'](_0x48d74a['options'][_0xc32f('0x1c')],function(_0x31f3cc){return{'model':db[_0x31f3cc[_0xc32f('0x1d')]],'as':_0x31f3cc['as'],'attributes':_0x31f3cc[_0xc32f('0x1e')],'include':_0x31f3cc[_0xc32f('0x1c')]?_[_0xc32f('0x1f')](_0x31f3cc[_0xc32f('0x1c')],function(_0x590149){return{'model':db[_0x590149[_0xc32f('0x1d')]],'as':_0x590149['as'],'attributes':_0x590149['attributes'],'include':_0x590149['include']?_['map'](_0x590149[_0xc32f('0x1c')],function(_0x138117){return{'model':db[_0x138117['model']],'as':_0x138117['as'],'attributes':_0x138117[_0xc32f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35ef02){logger[_0xc32f('0x11')](_0xc32f('0x18'),_0x48d74a);logger['debug']('GetOpenchannelQueue',_0x48d74a,JSON[_0xc32f('0x14')](_0x35ef02));_0x2c30f4(_0x35ef02);})[_0xc32f('0x20')](function(_0x2d0dc0){logger['error'](_0xc32f('0x18'),_0x2d0dc0[_0xc32f('0x17')],_0x48d74a);_0x5eec8f(_0x580f89[_0xc32f('0x15')](0x1f4,_0x2d0dc0[_0xc32f('0x17')]));});});};exports[_0xc32f('0x21')]=function(_0x1fd1b9){var _0x35db43=this;return new Promise(function(_0x47fdc3,_0x2c53a4){return db[_0xc32f('0x22')]['find']({'raw':_0x1fd1b9[_0xc32f('0x1a')]?_0x1fd1b9[_0xc32f('0x1a')][_0xc32f('0x23')]===undefined?!![]:![]:!![],'where':_0x1fd1b9[_0xc32f('0x1a')]?_0x1fd1b9['options'][_0xc32f('0x24')]||null:null,'attributes':_0x1fd1b9['options']?_0x1fd1b9[_0xc32f('0x1a')]['attributes']||null:null,'include':_0x1fd1b9[_0xc32f('0x1a')]?_0x1fd1b9[_0xc32f('0x1a')][_0xc32f('0x1c')]?_[_0xc32f('0x1f')](_0x1fd1b9[_0xc32f('0x1a')][_0xc32f('0x1c')],function(_0x252ee1){return{'model':db[_0x252ee1[_0xc32f('0x1d')]],'as':_0x252ee1['as'],'attributes':_0x252ee1[_0xc32f('0x1e')],'include':_0x252ee1['include']?_[_0xc32f('0x1f')](_0x252ee1[_0xc32f('0x1c')],function(_0x351915){return{'model':db[_0x351915[_0xc32f('0x1d')]],'as':_0x351915['as'],'attributes':_0x351915[_0xc32f('0x1e')],'include':_0x351915['include']?_[_0xc32f('0x1f')](_0x351915['include'],function(_0x5b122b){return{'model':db[_0x5b122b[_0xc32f('0x1d')]],'as':_0x5b122b['as'],'attributes':_0x5b122b[_0xc32f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc32f('0x10')](function(_0x4e17a5){logger[_0xc32f('0x11')](_0xc32f('0x21'),_0x1fd1b9);logger[_0xc32f('0x13')](_0xc32f('0x21'),_0x1fd1b9,JSON[_0xc32f('0x14')](_0x4e17a5));_0x47fdc3(_0x4e17a5);})['catch'](function(_0x24e295){logger[_0xc32f('0x15')](_0xc32f('0x21'),_0x24e295[_0xc32f('0x17')],_0x1fd1b9);_0x2c53a4(_0x35db43[_0xc32f('0x15')](0x1f4,_0x24e295[_0xc32f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index c23b8e1..9f22ef1 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 _0xb2e1=['register','length','remove','update','emit'];(function(_0x3acea8,_0x374891){var _0x372dc7=function(_0x1b12a7){while(--_0x1b12a7){_0x3acea8['push'](_0x3acea8['shift']());}};_0x372dc7(++_0x374891);}(_0xb2e1,0x1a6));var _0x1b2e=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0xb2e1[_0x43c8b8];return _0x413be3;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x1b2e('0x0'),_0x1b2e('0x1')];function createListener(_0x5d4c40,_0x46b0f3){return function(_0x34b17d){_0x46b0f3[_0x1b2e('0x2')](_0x5d4c40,_0x34b17d);};}function removeListener(_0xac45cb,_0x42da29){return function(){OpenchannelQueueEvents['removeListener'](_0xac45cb,_0x42da29);};}exports[_0x1b2e('0x3')]=function(_0x29bdb7){for(var _0x558885=0x0,_0x16301b=events[_0x1b2e('0x4')];_0x558885<_0x16301b;_0x558885++){var _0x87cdb7=events[_0x558885];var _0x35ae4b=createListener('openchannelQueue:'+_0x87cdb7,_0x29bdb7);OpenchannelQueueEvents['on'](_0x87cdb7,_0x35ae4b);}}; \ No newline at end of file +var _0xa953=['register','length','./openchannelQueue.events','save','remove','update','emit'];(function(_0x1d3c09,_0x31a7ab){var _0x1f2793=function(_0x5e9718){while(--_0x5e9718){_0x1d3c09['push'](_0x1d3c09['shift']());}};_0x1f2793(++_0x31a7ab);}(_0xa953,0x1d0));var _0x3a95=function(_0x446a9b,_0x48468a){_0x446a9b=_0x446a9b-0x0;var _0x371972=_0xa953[_0x446a9b];return _0x371972;};'use strict';var OpenchannelQueueEvents=require(_0x3a95('0x0'));var events=[_0x3a95('0x1'),_0x3a95('0x2'),_0x3a95('0x3')];function createListener(_0x4e61eb,_0x498fea){return function(_0x305524){_0x498fea[_0x3a95('0x4')](_0x4e61eb,_0x305524);};}function removeListener(_0x5877da,_0x5cee0b){return function(){OpenchannelQueueEvents['removeListener'](_0x5877da,_0x5cee0b);};}exports[_0x3a95('0x5')]=function(_0x1ffe5f){for(var _0x29613f=0x0,_0xb8a831=events[_0x3a95('0x6')];_0x29613f<_0xb8a831;_0x29613f++){var _0x43bc1a=events[_0x29613f];var _0x185867=createListener('openchannelQueue:'+_0x43bc1a,_0x1ffe5f);OpenchannelQueueEvents['on'](_0x43bc1a,_0x185867);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5e4cfd8..e744873 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 _0x7763=['show','create','/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7763,0xd1));var _0x3776=function(_0xc1789c,_0x713be5){_0xc1789c=_0xc1789c-0x0;var _0x11bc48=_0x7763[_0xc1789c];return _0x11bc48;};'use strict';var multer=require(_0x3776('0x0'));var util=require('util');var path=require(_0x3776('0x1'));var timeout=require(_0x3776('0x2'));var express=require(_0x3776('0x3'));var router=express[_0x3776('0x4')]();var fs_extra=require(_0x3776('0x5'));var auth=require(_0x3776('0x6'));var interaction=require(_0x3776('0x7'));var config=require('../../config/environment');var controller=require(_0x3776('0x8'));router[_0x3776('0x9')]('/',auth[_0x3776('0xa')](),controller[_0x3776('0xb')]);router[_0x3776('0x9')]('/describe',auth[_0x3776('0xa')](),controller['describe']);router['get']('/:id',auth[_0x3776('0xa')](),controller[_0x3776('0xc')]);router['post']('/',auth[_0x3776('0xa')](),controller[_0x3776('0xd')]);router['put'](_0x3776('0xe'),auth[_0x3776('0xa')](),controller[_0x3776('0xf')]);router['delete'](_0x3776('0xe'),auth[_0x3776('0xa')](),controller[_0x3776('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8d7d=['get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x8d7d,0x82));var _0xd8d7=function(_0x40de77,_0x1d18f1){_0x40de77=_0x40de77-0x0;var _0x675b7f=_0x8d7d[_0x40de77];return _0x675b7f;};'use strict';var multer=require('multer');var util=require(_0xd8d7('0x0'));var path=require('path');var timeout=require(_0xd8d7('0x1'));var express=require('express');var router=express[_0xd8d7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd8d7('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd8d7('0x4'));var controller=require(_0xd8d7('0x5'));router[_0xd8d7('0x6')]('/',auth[_0xd8d7('0x7')](),controller['index']);router[_0xd8d7('0x6')]('/describe',auth[_0xd8d7('0x7')](),controller['describe']);router[_0xd8d7('0x6')](_0xd8d7('0x8'),auth[_0xd8d7('0x7')](),controller[_0xd8d7('0x9')]);router[_0xd8d7('0xa')]('/',auth[_0xd8d7('0x7')](),controller[_0xd8d7('0xb')]);router[_0xd8d7('0xc')](_0xd8d7('0x8'),auth['isAuthenticated'](),controller[_0xd8d7('0xd')]);router[_0xd8d7('0xe')]('/:id',auth[_0xd8d7('0x7')](),controller[_0xd8d7('0xf')]);module[_0xd8d7('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 26ae49b..31ebd82 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 _0x5945=['moment','sequelize','STRING','DATE'];(function(_0x44176c,_0x150427){var _0x15f4bb=function(_0x11c3ef){while(--_0x11c3ef){_0x44176c['push'](_0x44176c['shift']());}};_0x15f4bb(++_0x150427);}(_0x5945,0x160));var _0x5594=function(_0x1c2f21,_0x2d0eb2){_0x1c2f21=_0x1c2f21-0x0;var _0x3c6704=_0x5945[_0x1c2f21];return _0x3c6704;};'use strict';var moment=require(_0x5594('0x0'));var Sequelize=require(_0x5594('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5594('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5594('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5594('0x3')]},'acceptAt':{'type':Sequelize[_0x5594('0x3')]},'exitAt':{'type':Sequelize[_0x5594('0x3')]},'reason':{'type':Sequelize[_0x5594('0x2')]}}; \ No newline at end of file +var _0x045c=['STRING','DATE','moment','sequelize','exports'];(function(_0x5bb7ed,_0x483669){var _0x4a7404=function(_0x51221e){while(--_0x51221e){_0x5bb7ed['push'](_0x5bb7ed['shift']());}};_0x4a7404(++_0x483669);}(_0x045c,0x75));var _0xc045=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x045c[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0xc045('0x0'));var Sequelize=require(_0xc045('0x1'));module[_0xc045('0x2')]={'uniqueid':{'type':Sequelize[_0xc045('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc045('0x3')]},'joinAt':{'type':Sequelize[_0xc045('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xc045('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a633c52..0d37d2a 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 _0x3f71=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','map','OpenchannelQueueReport','rawAttributes','type','key','model','query'];(function(_0x5acca0,_0x203a90){var _0x4b7061=function(_0x282676){while(--_0x282676){_0x5acca0['push'](_0x5acca0['shift']());}};_0x4b7061(++_0x203a90);}(_0x3f71,0x66));var _0x13f7=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x3f71[_0x4de586];return _0x46baf5;};'use strict';var emlformat=require(_0x13f7('0x0'));var rimraf=require(_0x13f7('0x1'));var zipdir=require(_0x13f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x13f7('0x3'));var moment=require(_0x13f7('0x4'));var BPromise=require(_0x13f7('0x5'));var Mustache=require(_0x13f7('0x6'));var util=require(_0x13f7('0x7'));var path=require(_0x13f7('0x8'));var sox=require('sox');var csv=require(_0x13f7('0x9'));var ejs=require(_0x13f7('0xa'));var fs=require('fs');var fs_extra=require(_0x13f7('0xb'));var _=require(_0x13f7('0xc'));var squel=require('squel');var crypto=require(_0x13f7('0xd'));var jsforce=require(_0x13f7('0xe'));var deskjs=require(_0x13f7('0xf'));var toCsv=require(_0x13f7('0x9'));var querystring=require(_0x13f7('0x10'));var Papa=require(_0x13f7('0x11'));var Redis=require(_0x13f7('0x12'));var authService=require(_0x13f7('0x13'));var qs=require(_0x13f7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13f7('0x15'));var logger=require('../../config/logger')(_0x13f7('0x16'));var utils=require('../../config/utils');var config=require(_0x13f7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x13f7('0x18'))['db'];function respondWithStatusCode(_0x281e9b,_0x558032){_0x558032=_0x558032||0xcc;return function(_0x45b9ba){if(_0x45b9ba){return _0x281e9b[_0x13f7('0x19')](_0x558032);}return _0x281e9b[_0x13f7('0x1a')](_0x558032)[_0x13f7('0x1b')]();};}function respondWithResult(_0x514603,_0xfeadf2){_0xfeadf2=_0xfeadf2||0xc8;return function(_0x488f33){if(_0x488f33){return _0x514603[_0x13f7('0x1a')](_0xfeadf2)['json'](_0x488f33);}};}function respondWithFilteredResult(_0x45ffd2,_0x323546){return function(_0x2f4029){if(_0x2f4029){var _0x10f0e6=typeof _0x323546[_0x13f7('0x1c')]===_0x13f7('0x1d')&&typeof _0x323546[_0x13f7('0x1e')]===_0x13f7('0x1d');var _0x48802b=_0x2f4029['count'];var _0x41da2b=_0x10f0e6?0x0:_0x323546[_0x13f7('0x1c')];var _0x1fa0db=_0x10f0e6?_0x2f4029['count']:_0x323546['offset']+_0x323546[_0x13f7('0x1e')];var _0x5247cf;if(_0x1fa0db>=_0x48802b){_0x1fa0db=_0x48802b;_0x5247cf=0xc8;}else{_0x5247cf=0xce;}_0x45ffd2[_0x13f7('0x1a')](_0x5247cf);return _0x45ffd2[_0x13f7('0x1f')](_0x13f7('0x20'),_0x41da2b+'-'+_0x1fa0db+'/'+_0x48802b)[_0x13f7('0x21')](_0x2f4029);}return null;};}function patchUpdates(_0x4c3792){return function(_0x1801d3){try{jsonpatch[_0x13f7('0x22')](_0x1801d3,_0x4c3792,!![]);}catch(_0x29275d){return BPromise[_0x13f7('0x23')](_0x29275d);}return _0x1801d3[_0x13f7('0x24')]();};}function saveUpdates(_0x31a572,_0x470386){return function(_0x53d666){if(_0x53d666){return _0x53d666[_0x13f7('0x25')](_0x31a572)[_0x13f7('0x26')](function(_0x517bd7){return _0x517bd7;});}return null;};}function removeEntity(_0x5ac0d2,_0x24b219){return function(_0x18733a){if(_0x18733a){return _0x18733a[_0x13f7('0x27')]()[_0x13f7('0x26')](function(){_0x5ac0d2[_0x13f7('0x1a')](0xcc)[_0x13f7('0x1b')]();});}};}function handleEntityNotFound(_0x5d9052,_0x5f3a05){return function(_0x485828){if(!_0x485828){_0x5d9052[_0x13f7('0x19')](0x194);}return _0x485828;};}function handleError(_0x11d3cf,_0x59a61b){_0x59a61b=_0x59a61b||0x1f4;return function(_0x4670d9){logger[_0x13f7('0x28')](_0x4670d9[_0x13f7('0x29')]);if(_0x4670d9['name']){delete _0x4670d9['name'];}_0x11d3cf[_0x13f7('0x1a')](_0x59a61b)[_0x13f7('0x2a')](_0x4670d9);};}exports['index']=function(_0x27b161,_0x448415){var _0x197e2d={},_0x1b241a={},_0x4b0261={'count':0x0,'rows':[]};var _0x3d7404=_[_0x13f7('0x2b')](db[_0x13f7('0x2c')][_0x13f7('0x2d')],function(_0xd95437){return{'name':_0xd95437['fieldName'],'type':_0xd95437[_0x13f7('0x2e')][_0x13f7('0x2f')]};});_0x1b241a[_0x13f7('0x30')]=_[_0x13f7('0x2b')](_0x3d7404,'name');_0x1b241a[_0x13f7('0x31')]=_[_0x13f7('0x32')](_0x27b161[_0x13f7('0x31')]);_0x1b241a[_0x13f7('0x33')]=_[_0x13f7('0x34')](_0x1b241a[_0x13f7('0x30')],_0x1b241a[_0x13f7('0x31')]);_0x197e2d[_0x13f7('0x35')]=_[_0x13f7('0x34')](_0x1b241a['model'],qs[_0x13f7('0x36')](_0x27b161[_0x13f7('0x31')][_0x13f7('0x36')]));_0x197e2d[_0x13f7('0x35')]=_0x197e2d['attributes'][_0x13f7('0x37')]?_0x197e2d[_0x13f7('0x35')]:_0x1b241a[_0x13f7('0x30')];if(!_0x27b161[_0x13f7('0x31')][_0x13f7('0x38')]('nolimit')){_0x197e2d[_0x13f7('0x1e')]=qs['limit'](_0x27b161[_0x13f7('0x31')][_0x13f7('0x1e')]);_0x197e2d['offset']=qs[_0x13f7('0x1c')](_0x27b161[_0x13f7('0x31')]['offset']);}_0x197e2d[_0x13f7('0x39')]=qs[_0x13f7('0x3a')](_0x27b161[_0x13f7('0x31')][_0x13f7('0x3a')]);_0x197e2d[_0x13f7('0x3b')]=qs[_0x13f7('0x33')](_['pick'](_0x27b161[_0x13f7('0x31')],_0x1b241a[_0x13f7('0x33')]),_0x3d7404);if(_0x27b161[_0x13f7('0x31')]['filter']){_0x197e2d[_0x13f7('0x3b')]=_[_0x13f7('0x3c')](_0x197e2d[_0x13f7('0x3b')],{'$or':_[_0x13f7('0x2b')](_0x3d7404,function(_0x594b5e){if(_0x594b5e['type']!==_0x13f7('0x3d')){var _0x2c42ae={};_0x2c42ae[_0x594b5e[_0x13f7('0x3e')]]={'$like':'%'+_0x27b161[_0x13f7('0x31')]['filter']+'%'};return _0x2c42ae;}})});}_0x197e2d=_['merge']({},_0x197e2d,_0x27b161[_0x13f7('0x3f')]);var _0x4a72fd={'where':_0x197e2d[_0x13f7('0x3b')]};return db[_0x13f7('0x2c')][_0x13f7('0x40')](_0x4a72fd)[_0x13f7('0x26')](function(_0x4ac11e){_0x4b0261[_0x13f7('0x40')]=_0x4ac11e;if(_0x27b161[_0x13f7('0x31')][_0x13f7('0x41')]){_0x197e2d[_0x13f7('0x42')]=[{'all':!![]}];}return db[_0x13f7('0x2c')][_0x13f7('0x43')](_0x197e2d);})[_0x13f7('0x26')](function(_0x13ca82){_0x4b0261[_0x13f7('0x44')]=_0x13ca82;return _0x4b0261;})[_0x13f7('0x26')](respondWithFilteredResult(_0x448415,_0x197e2d))[_0x13f7('0x45')](handleError(_0x448415,null));};exports[_0x13f7('0x46')]=function(_0x25132f,_0x4aed48){var _0x1bc6a8={'raw':!![],'where':{'id':_0x25132f[_0x13f7('0x47')]['id']}},_0x3834f7={};_0x3834f7['model']=_[_0x13f7('0x32')](db[_0x13f7('0x2c')][_0x13f7('0x2d')]);_0x3834f7[_0x13f7('0x31')]=_['keys'](_0x25132f[_0x13f7('0x31')]);_0x3834f7[_0x13f7('0x33')]=_['intersection'](_0x3834f7[_0x13f7('0x30')],_0x3834f7[_0x13f7('0x31')]);_0x1bc6a8['attributes']=_[_0x13f7('0x34')](_0x3834f7[_0x13f7('0x30')],qs[_0x13f7('0x36')](_0x25132f[_0x13f7('0x31')][_0x13f7('0x36')]));_0x1bc6a8[_0x13f7('0x35')]=_0x1bc6a8['attributes'][_0x13f7('0x37')]?_0x1bc6a8[_0x13f7('0x35')]:_0x3834f7['model'];if(_0x25132f['query'][_0x13f7('0x41')]){_0x1bc6a8['include']=[{'all':!![]}];}_0x1bc6a8=_[_0x13f7('0x3c')]({},_0x1bc6a8,_0x25132f['options']);return db[_0x13f7('0x2c')][_0x13f7('0x48')](_0x1bc6a8)[_0x13f7('0x26')](handleEntityNotFound(_0x4aed48,null))[_0x13f7('0x26')](respondWithResult(_0x4aed48,null))[_0x13f7('0x45')](handleError(_0x4aed48,null));};exports['create']=function(_0x5c5601,_0x16b947){return db[_0x13f7('0x2c')][_0x13f7('0x49')](_0x5c5601[_0x13f7('0x4a')],{})[_0x13f7('0x26')](respondWithResult(_0x16b947,0xc9))[_0x13f7('0x45')](handleError(_0x16b947,null));};exports[_0x13f7('0x25')]=function(_0x3c380a,_0x36d40e){if(_0x3c380a[_0x13f7('0x4a')]['id']){delete _0x3c380a[_0x13f7('0x4a')]['id'];}return db[_0x13f7('0x2c')][_0x13f7('0x48')]({'where':{'id':_0x3c380a[_0x13f7('0x47')]['id']}})['then'](handleEntityNotFound(_0x36d40e,null))['then'](saveUpdates(_0x3c380a['body'],null))[_0x13f7('0x26')](respondWithResult(_0x36d40e,null))['catch'](handleError(_0x36d40e,null));};exports['destroy']=function(_0x968dc3,_0x96ab14){return db[_0x13f7('0x2c')][_0x13f7('0x48')]({'where':{'id':_0x968dc3[_0x13f7('0x47')]['id']}})[_0x13f7('0x26')](handleEntityNotFound(_0x96ab14,null))[_0x13f7('0x26')](removeEntity(_0x96ab14,null))[_0x13f7('0x45')](handleError(_0x96ab14,null));};exports['describe']=function(_0x431b8c,_0x32db34){return db['OpenchannelQueueReport'][_0x13f7('0x4b')]()[_0x13f7('0x26')](respondWithResult(_0x32db34,null))[_0x13f7('0x45')](handleError(_0x32db34,null));}; \ No newline at end of file +var _0x361f=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','update','error','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','name','query','keys','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','then','include','findAll','rows','catch','show','params','intersection','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x361f,0x157));var _0xf361=function(_0x4d460a,_0xe8de38){_0x4d460a=_0x4d460a-0x0;var _0x4bad60=_0x361f[_0x4d460a];return _0x4bad60;};'use strict';var emlformat=require(_0xf361('0x0'));var rimraf=require(_0xf361('0x1'));var zipdir=require(_0xf361('0x2'));var jsonpatch=require(_0xf361('0x3'));var rp=require('request-promise');var moment=require(_0xf361('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf361('0x5'));var util=require(_0xf361('0x6'));var path=require(_0xf361('0x7'));var sox=require(_0xf361('0x8'));var csv=require(_0xf361('0x9'));var ejs=require(_0xf361('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf361('0xb'));var squel=require(_0xf361('0xc'));var crypto=require('crypto');var jsforce=require(_0xf361('0xd'));var deskjs=require(_0xf361('0xe'));var toCsv=require(_0xf361('0x9'));var querystring=require(_0xf361('0xf'));var Papa=require(_0xf361('0x10'));var Redis=require('ioredis');var authService=require(_0xf361('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf361('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf361('0x13'))(_0xf361('0x14'));var utils=require(_0xf361('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf361('0x16'));var db=require(_0xf361('0x17'))['db'];function respondWithStatusCode(_0x47e55f,_0x2160f3){_0x2160f3=_0x2160f3||0xcc;return function(_0x4f03cb){if(_0x4f03cb){return _0x47e55f['sendStatus'](_0x2160f3);}return _0x47e55f[_0xf361('0x18')](_0x2160f3)[_0xf361('0x19')]();};}function respondWithResult(_0x14e08a,_0x387c65){_0x387c65=_0x387c65||0xc8;return function(_0x4563f9){if(_0x4563f9){return _0x14e08a['status'](_0x387c65)[_0xf361('0x1a')](_0x4563f9);}};}function respondWithFilteredResult(_0xc2cdb3,_0x350172){return function(_0x717689){if(_0x717689){var _0x1bc4fa=typeof _0x350172[_0xf361('0x1b')]===_0xf361('0x1c')&&typeof _0x350172[_0xf361('0x1d')]===_0xf361('0x1c');var _0x4d1d59=_0x717689[_0xf361('0x1e')];var _0x42c8fb=_0x1bc4fa?0x0:_0x350172[_0xf361('0x1b')];var _0x27751e=_0x1bc4fa?_0x717689['count']:_0x350172[_0xf361('0x1b')]+_0x350172[_0xf361('0x1d')];var _0x4b207b;if(_0x27751e>=_0x4d1d59){_0x27751e=_0x4d1d59;_0x4b207b=0xc8;}else{_0x4b207b=0xce;}_0xc2cdb3[_0xf361('0x18')](_0x4b207b);return _0xc2cdb3['set']('Content-Range',_0x42c8fb+'-'+_0x27751e+'/'+_0x4d1d59)[_0xf361('0x1a')](_0x717689);}return null;};}function patchUpdates(_0x56c201){return function(_0x21ac4e){try{jsonpatch[_0xf361('0x1f')](_0x21ac4e,_0x56c201,!![]);}catch(_0x478e24){return BPromise['reject'](_0x478e24);}return _0x21ac4e['save']();};}function saveUpdates(_0x44543c,_0xb0130b){return function(_0x3bdb9d){if(_0x3bdb9d){return _0x3bdb9d[_0xf361('0x20')](_0x44543c)['then'](function(_0x1e753f){return _0x1e753f;});}return null;};}function removeEntity(_0x4f3097,_0x934bfb){return function(_0x1a6c0a){if(_0x1a6c0a){return _0x1a6c0a['destroy']()['then'](function(){_0x4f3097[_0xf361('0x18')](0xcc)[_0xf361('0x19')]();});}};}function handleEntityNotFound(_0x5c390e,_0x2aca43){return function(_0x584ee6){if(!_0x584ee6){_0x5c390e['sendStatus'](0x194);}return _0x584ee6;};}function handleError(_0x3d5200,_0xddd083){_0xddd083=_0xddd083||0x1f4;return function(_0x188369){logger[_0xf361('0x21')](_0x188369['stack']);if(_0x188369['name']){delete _0x188369['name'];}_0x3d5200[_0xf361('0x18')](_0xddd083)[_0xf361('0x22')](_0x188369);};}exports[_0xf361('0x23')]=function(_0x10fdd7,_0x18fff0){var _0x5a456d={},_0x17e8c1={},_0x960f70={'count':0x0,'rows':[]};var _0x8b6447=_[_0xf361('0x24')](db[_0xf361('0x25')][_0xf361('0x26')],function(_0x657fa){return{'name':_0x657fa[_0xf361('0x27')],'type':_0x657fa[_0xf361('0x28')][_0xf361('0x29')]};});_0x17e8c1['model']=_[_0xf361('0x24')](_0x8b6447,_0xf361('0x2a'));_0x17e8c1[_0xf361('0x2b')]=_[_0xf361('0x2c')](_0x10fdd7['query']);_0x17e8c1['filters']=_['intersection'](_0x17e8c1['model'],_0x17e8c1[_0xf361('0x2b')]);_0x5a456d['attributes']=_['intersection'](_0x17e8c1[_0xf361('0x2d')],qs['fields'](_0x10fdd7[_0xf361('0x2b')][_0xf361('0x2e')]));_0x5a456d[_0xf361('0x2f')]=_0x5a456d[_0xf361('0x2f')][_0xf361('0x30')]?_0x5a456d['attributes']:_0x17e8c1[_0xf361('0x2d')];if(!_0x10fdd7[_0xf361('0x2b')][_0xf361('0x31')]('nolimit')){_0x5a456d['limit']=qs[_0xf361('0x1d')](_0x10fdd7[_0xf361('0x2b')]['limit']);_0x5a456d['offset']=qs['offset'](_0x10fdd7[_0xf361('0x2b')]['offset']);}_0x5a456d[_0xf361('0x32')]=qs[_0xf361('0x33')](_0x10fdd7[_0xf361('0x2b')][_0xf361('0x33')]);_0x5a456d[_0xf361('0x34')]=qs['filters'](_['pick'](_0x10fdd7[_0xf361('0x2b')],_0x17e8c1[_0xf361('0x35')]),_0x8b6447);if(_0x10fdd7[_0xf361('0x2b')]['filter']){_0x5a456d['where']=_[_0xf361('0x36')](_0x5a456d[_0xf361('0x34')],{'$or':_[_0xf361('0x24')](_0x8b6447,function(_0x1c2186){if(_0x1c2186[_0xf361('0x28')]!==_0xf361('0x37')){var _0x317d={};_0x317d[_0x1c2186['name']]={'$like':'%'+_0x10fdd7['query'][_0xf361('0x38')]+'%'};return _0x317d;}})});}_0x5a456d=_[_0xf361('0x36')]({},_0x5a456d,_0x10fdd7[_0xf361('0x39')]);var _0x3627ea={'where':_0x5a456d[_0xf361('0x34')]};return db['OpenchannelQueueReport']['count'](_0x3627ea)[_0xf361('0x3a')](function(_0x3672d6){_0x960f70['count']=_0x3672d6;if(_0x10fdd7[_0xf361('0x2b')]['includeAll']){_0x5a456d[_0xf361('0x3b')]=[{'all':!![]}];}return db[_0xf361('0x25')][_0xf361('0x3c')](_0x5a456d);})['then'](function(_0x59f8b8){_0x960f70[_0xf361('0x3d')]=_0x59f8b8;return _0x960f70;})[_0xf361('0x3a')](respondWithFilteredResult(_0x18fff0,_0x5a456d))[_0xf361('0x3e')](handleError(_0x18fff0,null));};exports[_0xf361('0x3f')]=function(_0x45d3d2,_0x58bdef){var _0x11b34c={'raw':!![],'where':{'id':_0x45d3d2[_0xf361('0x40')]['id']}},_0x1c2834={};_0x1c2834['model']=_[_0xf361('0x2c')](db[_0xf361('0x25')][_0xf361('0x26')]);_0x1c2834[_0xf361('0x2b')]=_['keys'](_0x45d3d2[_0xf361('0x2b')]);_0x1c2834[_0xf361('0x35')]=_[_0xf361('0x41')](_0x1c2834[_0xf361('0x2d')],_0x1c2834[_0xf361('0x2b')]);_0x11b34c[_0xf361('0x2f')]=_['intersection'](_0x1c2834[_0xf361('0x2d')],qs['fields'](_0x45d3d2[_0xf361('0x2b')]['fields']));_0x11b34c[_0xf361('0x2f')]=_0x11b34c[_0xf361('0x2f')][_0xf361('0x30')]?_0x11b34c[_0xf361('0x2f')]:_0x1c2834[_0xf361('0x2d')];if(_0x45d3d2[_0xf361('0x2b')][_0xf361('0x42')]){_0x11b34c[_0xf361('0x3b')]=[{'all':!![]}];}_0x11b34c=_[_0xf361('0x36')]({},_0x11b34c,_0x45d3d2[_0xf361('0x39')]);return db['OpenchannelQueueReport']['find'](_0x11b34c)[_0xf361('0x3a')](handleEntityNotFound(_0x58bdef,null))[_0xf361('0x3a')](respondWithResult(_0x58bdef,null))[_0xf361('0x3e')](handleError(_0x58bdef,null));};exports[_0xf361('0x43')]=function(_0x100c07,_0x195ea1){return db[_0xf361('0x25')][_0xf361('0x43')](_0x100c07[_0xf361('0x44')],{})[_0xf361('0x3a')](respondWithResult(_0x195ea1,0xc9))[_0xf361('0x3e')](handleError(_0x195ea1,null));};exports[_0xf361('0x20')]=function(_0x1ddd8c,_0x53d865){if(_0x1ddd8c['body']['id']){delete _0x1ddd8c['body']['id'];}return db[_0xf361('0x25')][_0xf361('0x45')]({'where':{'id':_0x1ddd8c[_0xf361('0x40')]['id']}})[_0xf361('0x3a')](handleEntityNotFound(_0x53d865,null))['then'](saveUpdates(_0x1ddd8c[_0xf361('0x44')],null))[_0xf361('0x3a')](respondWithResult(_0x53d865,null))[_0xf361('0x3e')](handleError(_0x53d865,null));};exports[_0xf361('0x46')]=function(_0x3e79ac,_0x49d0c9){return db[_0xf361('0x25')][_0xf361('0x45')]({'where':{'id':_0x3e79ac['params']['id']}})[_0xf361('0x3a')](handleEntityNotFound(_0x49d0c9,null))['then'](removeEntity(_0x49d0c9,null))[_0xf361('0x3e')](handleError(_0x49d0c9,null));};exports['describe']=function(_0x5ad581,_0x4bcb10){return db[_0xf361('0x25')][_0xf361('0x47')]()['then'](respondWithResult(_0x4bcb10,null))[_0xf361('0x3e')](handleError(_0x4bcb10,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 65a0106..b628eb4 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0xb9fcf0,_0x487e6a){var _0x50a596=function(_0x548047){while(--_0x548047){_0xb9fcf0['push'](_0xb9fcf0['shift']());}};_0x50a596(++_0x487e6a);}(_0x326f,0xd1));var _0xf326=function(_0x1ad044,_0x58bd67){_0x1ad044=_0x1ad044-0x0;var _0x3d4b5a=_0x326f[_0x1ad044];return _0x3d4b5a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x245f50,_0x2c8b2d){var _0x37f31e=function(_0x20c990){while(--_0x20c990){_0x245f50['push'](_0x245f50['shift']());}};_0x37f31e(++_0x2c8b2d);}(_0x326f,0xd1));var _0xf326=function(_0x1ff757,_0x42314d){_0x1ff757=_0x1ff757-0x0;var _0x384dd3=_0x326f[_0x1ff757];return _0x384dd3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9f97e49..6db57a3 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 _0xf4f4=['body','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','stringify','UpdateOpenchannelQueueReport','update'];(function(_0x392286,_0x13fce3){var _0x144791=function(_0x545186){while(--_0x545186){_0x392286['push'](_0x392286['shift']());}};_0x144791(++_0x13fce3);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1a570d,_0x2288af){_0x1a570d=_0x1a570d-0x0;var _0x18fbd9=_0xf4f4[_0x1a570d];return _0x18fbd9;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}exports[_0x4f4f('0x15')]=function(_0x1245c4){var _0x60ce2=this;return new Promise(function(_0x929a0b,_0x2f9397){return db[_0x4f4f('0x16')][_0x4f4f('0x17')](_0x1245c4['body'],{'raw':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x19')]===undefined?!![]:![]:!![]})[_0x4f4f('0xb')](function(_0x302a79){logger[_0x4f4f('0xc')](_0x4f4f('0x15'),_0x1245c4);logger[_0x4f4f('0xf')](_0x4f4f('0x15'),_0x1245c4,JSON[_0x4f4f('0x1a')](_0x302a79));_0x929a0b(_0x302a79);})[_0x4f4f('0x14')](function(_0x17832f){logger[_0x4f4f('0x11')](_0x4f4f('0x15'),_0x17832f['message'],_0x1245c4);_0x2f9397(_0x60ce2['error'](0x1f4,_0x17832f['message']));});});};exports[_0x4f4f('0x1b')]=function(_0x43e661){var _0x5186ac=this;return new Promise(function(_0x3960ae,_0x15859c){return db[_0x4f4f('0x16')][_0x4f4f('0x1c')](_0x43e661[_0x4f4f('0x1d')],{'raw':_0x43e661[_0x4f4f('0x18')]?_0x43e661[_0x4f4f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e661[_0x4f4f('0x18')]?_0x43e661[_0x4f4f('0x18')][_0x4f4f('0x1e')]||null:null,'attributes':_0x43e661[_0x4f4f('0x18')]?_0x43e661[_0x4f4f('0x18')]['attributes']||null:null,'limit':_0x43e661[_0x4f4f('0x18')]?_0x43e661[_0x4f4f('0x18')][_0x4f4f('0x1f')]||null:null})['then'](function(_0x534075){logger['info'](_0x4f4f('0x1b'),_0x43e661);logger['debug'](_0x4f4f('0x1b'),_0x43e661,JSON[_0x4f4f('0x1a')](_0x534075));_0x3960ae(_0x534075);})[_0x4f4f('0x14')](function(_0x5eb7c9){logger[_0x4f4f('0x11')](_0x4f4f('0x1b'),_0x5eb7c9['message'],_0x43e661);_0x15859c(_0x5186ac[_0x4f4f('0x11')](0x1f4,_0x5eb7c9[_0x4f4f('0x13')]));});});}; \ No newline at end of file +var _0xa866=['catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result'];(function(_0x549448,_0x12586f){var _0x3e1626=function(_0x4b8102){while(--_0x4b8102){_0x549448['push'](_0x549448['shift']());}};_0x3e1626(++_0x12586f);}(_0xa866,0x6a));var _0x6a86=function(_0x3b8238,_0x40edf9){_0x3b8238=_0x3b8238-0x0;var _0x124cf0=_0xa866[_0x3b8238];return _0x124cf0;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateOpenchannelQueueReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateOpenchannelQueueReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};exports[_0x6a86('0x1d')]=function(_0x3f2b70){var _0x19382d=this;return new Promise(function(_0x1c41a7,_0x46f6c7){return db[_0x6a86('0x17')][_0x6a86('0x1e')](_0x3f2b70['body'],{'raw':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')]['where']||null:null,'attributes':_0x3f2b70[_0x6a86('0x1a')]?_0x3f2b70[_0x6a86('0x1a')][_0x6a86('0x1f')]||null:null,'limit':_0x3f2b70['options']?_0x3f2b70[_0x6a86('0x1a')]['limit']||null:null})['then'](function(_0x4d8bf0){logger[_0x6a86('0xd')](_0x6a86('0x1d'),_0x3f2b70);logger[_0x6a86('0xf')]('UpdateOpenchannelQueueReport',_0x3f2b70,JSON[_0x6a86('0x11')](_0x4d8bf0));_0x1c41a7(_0x4d8bf0);})[_0x6a86('0x16')](function(_0x1bb745){logger[_0x6a86('0x12')]('UpdateOpenchannelQueueReport',_0x1bb745[_0x6a86('0x14')],_0x3f2b70);_0x46f6c7(_0x19382d['error'](0x1f4,_0x1bb745[_0x6a86('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index aeb42b3..e0097bc 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 _0xc96e=['index','/describe','describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x41f3c9,_0x322ad9){var _0x3fd476=function(_0x2d8648){while(--_0x2d8648){_0x41f3c9['push'](_0x41f3c9['shift']());}};_0x3fd476(++_0x322ad9);}(_0xc96e,0x1d6));var _0xec96=function(_0x449add,_0x46e023){_0x449add=_0x449add-0x0;var _0x4cd8ef=_0xc96e[_0x449add];return _0x4cd8ef;};'use strict';var multer=require(_0xec96('0x0'));var util=require(_0xec96('0x1'));var path=require(_0xec96('0x2'));var timeout=require('connect-timeout');var express=require(_0xec96('0x3'));var router=express[_0xec96('0x4')]();var fs_extra=require(_0xec96('0x5'));var auth=require(_0xec96('0x6'));var interaction=require(_0xec96('0x7'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xec96('0x8')]('/',auth[_0xec96('0x9')](),controller[_0xec96('0xa')]);router[_0xec96('0x8')](_0xec96('0xb'),auth[_0xec96('0x9')](),controller[_0xec96('0xc')]);router[_0xec96('0x8')]('/:id',auth[_0xec96('0x9')](),controller['show']);router[_0xec96('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xec96('0xe')](_0xec96('0xf'),auth[_0xec96('0x9')](),controller[_0xec96('0x10')]);router[_0xec96('0x11')](_0xec96('0xf'),auth['isAuthenticated'](),controller[_0xec96('0x12')]);module[_0xec96('0x13')]=router; \ No newline at end of file +var _0x23c9=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','util'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x23c9,0x164));var _0x923c=function(_0x5a7ed0,_0x27aae9){_0x5a7ed0=_0x5a7ed0-0x0;var _0x4a8cae=_0x23c9[_0x5a7ed0];return _0x4a8cae;};'use strict';var multer=require('multer');var util=require(_0x923c('0x0'));var path=require('path');var timeout=require(_0x923c('0x1'));var express=require('express');var router=express[_0x923c('0x2')]();var fs_extra=require(_0x923c('0x3'));var auth=require(_0x923c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x923c('0x5'));var controller=require(_0x923c('0x6'));router[_0x923c('0x7')]('/',auth[_0x923c('0x8')](),controller[_0x923c('0x9')]);router[_0x923c('0x7')](_0x923c('0xa'),auth[_0x923c('0x8')](),controller[_0x923c('0xb')]);router[_0x923c('0x7')](_0x923c('0xc'),auth[_0x923c('0x8')](),controller[_0x923c('0xd')]);router[_0x923c('0xe')]('/',auth[_0x923c('0x8')](),controller[_0x923c('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x923c('0x10')]);router['delete'](_0x923c('0xc'),auth[_0x923c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index d1eef3f..f6e9e6d 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x47f5e0,_0x3b9100){var _0x1da036=function(_0x47fd95){while(--_0x47fd95){_0x47f5e0['push'](_0x47f5e0['shift']());}};_0x1da036(++_0x3b9100);}(_0xe706,0xa3));var _0x6e70=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xe706[_0x1cbcf1];return _0x3a06f0;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4f905e,_0x30a685){var _0x1cbce8=function(_0x329c5c){while(--_0x329c5c){_0x4f905e['push'](_0x4f905e['shift']());}};_0x1cbce8(++_0x30a685);}(_0xedd9,0xfc));var _0x9edd=function(_0xdeb519,_0x3ad354){_0xdeb519=_0xdeb519-0x0;var _0x182dc3=_0xedd9[_0xdeb519];return _0x182dc3;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6b95f2d..4c4870c 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 _0x2945=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x3fa164,_0x17a9b4){var _0x2a7eef=function(_0x270f30){while(--_0x270f30){_0x3fa164['push'](_0x3fa164['shift']());}};_0x2a7eef(++_0x17a9b4);}(_0x2945,0x1b6));var _0x5294=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x2945[_0x1f5a63];return _0x30bb7a;};'use strict';var emlformat=require(_0x5294('0x0'));var rimraf=require(_0x5294('0x1'));var zipdir=require(_0x5294('0x2'));var jsonpatch=require(_0x5294('0x3'));var rp=require('request-promise');var moment=require(_0x5294('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5294('0x5'));var util=require('util');var path=require(_0x5294('0x6'));var sox=require(_0x5294('0x7'));var csv=require('to-csv');var ejs=require(_0x5294('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5294('0x9'));var squel=require(_0x5294('0xa'));var crypto=require(_0x5294('0xb'));var jsforce=require(_0x5294('0xc'));var deskjs=require(_0x5294('0xd'));var toCsv=require(_0x5294('0xe'));var querystring=require(_0x5294('0xf'));var Papa=require(_0x5294('0x10'));var Redis=require(_0x5294('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5294('0x12'));var as=require(_0x5294('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5294('0x14'))(_0x5294('0x15'));var utils=require(_0x5294('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5294('0x17'));var db=require(_0x5294('0x18'))['db'];function respondWithStatusCode(_0x5dcb7d,_0x823940){_0x823940=_0x823940||0xcc;return function(_0x4cdb26){if(_0x4cdb26){return _0x5dcb7d[_0x5294('0x19')](_0x823940);}return _0x5dcb7d[_0x5294('0x1a')](_0x823940)[_0x5294('0x1b')]();};}function respondWithResult(_0x5448e6,_0x45492f){_0x45492f=_0x45492f||0xc8;return function(_0x4e51d4){if(_0x4e51d4){return _0x5448e6[_0x5294('0x1a')](_0x45492f)['json'](_0x4e51d4);}};}function respondWithFilteredResult(_0x34523b,_0xa410db){return function(_0x2df072){if(_0x2df072){var _0xd9fae9=typeof _0xa410db[_0x5294('0x1c')]==='undefined'&&typeof _0xa410db['limit']===_0x5294('0x1d');var _0x4bf55b=_0x2df072[_0x5294('0x1e')];var _0x1f31ba=_0xd9fae9?0x0:_0xa410db['offset'];var _0xcf7ee6=_0xd9fae9?_0x2df072[_0x5294('0x1e')]:_0xa410db[_0x5294('0x1c')]+_0xa410db[_0x5294('0x1f')];var _0x544de5;if(_0xcf7ee6>=_0x4bf55b){_0xcf7ee6=_0x4bf55b;_0x544de5=0xc8;}else{_0x544de5=0xce;}_0x34523b[_0x5294('0x1a')](_0x544de5);return _0x34523b['set']('Content-Range',_0x1f31ba+'-'+_0xcf7ee6+'/'+_0x4bf55b)[_0x5294('0x20')](_0x2df072);}return null;};}function patchUpdates(_0x40116e){return function(_0x46ea4b){try{jsonpatch[_0x5294('0x21')](_0x46ea4b,_0x40116e,!![]);}catch(_0x5aaa26){return BPromise[_0x5294('0x22')](_0x5aaa26);}return _0x46ea4b[_0x5294('0x23')]();};}function saveUpdates(_0x29e45d,_0x37f0ae){return function(_0x23f662){if(_0x23f662){return _0x23f662[_0x5294('0x24')](_0x29e45d)[_0x5294('0x25')](function(_0x4ed680){return _0x4ed680;});}return null;};}function removeEntity(_0x3a431d,_0x2e0ba2){return function(_0x5a5e7d){if(_0x5a5e7d){return _0x5a5e7d[_0x5294('0x26')]()['then'](function(){_0x3a431d['status'](0xcc)[_0x5294('0x1b')]();});}};}function handleEntityNotFound(_0x5f1c04,_0x16e6f5){return function(_0xd48eba){if(!_0xd48eba){_0x5f1c04[_0x5294('0x19')](0x194);}return _0xd48eba;};}function handleError(_0x277d30,_0x95c4fc){_0x95c4fc=_0x95c4fc||0x1f4;return function(_0x4f100f){logger[_0x5294('0x27')](_0x4f100f[_0x5294('0x28')]);if(_0x4f100f[_0x5294('0x29')]){delete _0x4f100f['name'];}_0x277d30[_0x5294('0x1a')](_0x95c4fc)[_0x5294('0x2a')](_0x4f100f);};}exports[_0x5294('0x2b')]=function(_0x2db119,_0x894eb9){var _0x50e247={},_0x444c05={},_0x9525cf={'count':0x0,'rows':[]};var _0x359db4=_['map'](db[_0x5294('0x2c')]['rawAttributes'],function(_0x2f900c){return{'name':_0x2f900c[_0x5294('0x2d')],'type':_0x2f900c[_0x5294('0x2e')]['key']};});_0x444c05[_0x5294('0x2f')]=_[_0x5294('0x30')](_0x359db4,_0x5294('0x29'));_0x444c05[_0x5294('0x31')]=_['keys'](_0x2db119[_0x5294('0x31')]);_0x444c05[_0x5294('0x32')]=_[_0x5294('0x33')](_0x444c05['model'],_0x444c05[_0x5294('0x31')]);_0x50e247['attributes']=_['intersection'](_0x444c05[_0x5294('0x2f')],qs[_0x5294('0x34')](_0x2db119[_0x5294('0x31')][_0x5294('0x34')]));_0x50e247[_0x5294('0x35')]=_0x50e247[_0x5294('0x35')][_0x5294('0x36')]?_0x50e247['attributes']:_0x444c05[_0x5294('0x2f')];if(!_0x2db119[_0x5294('0x31')][_0x5294('0x37')](_0x5294('0x38'))){_0x50e247[_0x5294('0x1f')]=qs[_0x5294('0x1f')](_0x2db119[_0x5294('0x31')][_0x5294('0x1f')]);_0x50e247[_0x5294('0x1c')]=qs[_0x5294('0x1c')](_0x2db119['query']['offset']);}_0x50e247[_0x5294('0x39')]=qs[_0x5294('0x3a')](_0x2db119['query']['sort']);_0x50e247[_0x5294('0x3b')]=qs[_0x5294('0x32')](_['pick'](_0x2db119[_0x5294('0x31')],_0x444c05[_0x5294('0x32')]),_0x359db4);if(_0x2db119['query'][_0x5294('0x3c')]){_0x50e247[_0x5294('0x3b')]=_[_0x5294('0x3d')](_0x50e247['where'],{'$or':_['map'](_0x359db4,function(_0xd88641){if(_0xd88641['type']!=='VIRTUAL'){var _0x454376={};_0x454376[_0xd88641[_0x5294('0x29')]]={'$like':'%'+_0x2db119['query']['filter']+'%'};return _0x454376;}})});}_0x50e247=_[_0x5294('0x3d')]({},_0x50e247,_0x2db119[_0x5294('0x3e')]);var _0x51965f={'where':_0x50e247['where']};return db[_0x5294('0x2c')]['count'](_0x51965f)[_0x5294('0x25')](function(_0x5c4a23){_0x9525cf[_0x5294('0x1e')]=_0x5c4a23;if(_0x2db119[_0x5294('0x31')][_0x5294('0x3f')]){_0x50e247[_0x5294('0x40')]=[{'all':!![]}];}return db[_0x5294('0x2c')][_0x5294('0x41')](_0x50e247);})[_0x5294('0x25')](function(_0x2e3448){_0x9525cf[_0x5294('0x42')]=_0x2e3448;return _0x9525cf;})[_0x5294('0x25')](respondWithFilteredResult(_0x894eb9,_0x50e247))[_0x5294('0x43')](handleError(_0x894eb9,null));};exports[_0x5294('0x44')]=function(_0x164ed7,_0x46a3d7){var _0x46944a={'raw':!![],'where':{'id':_0x164ed7[_0x5294('0x45')]['id']}},_0xec0008={};_0xec0008[_0x5294('0x2f')]=_['keys'](db[_0x5294('0x2c')][_0x5294('0x46')]);_0xec0008['query']=_[_0x5294('0x47')](_0x164ed7[_0x5294('0x31')]);_0xec0008[_0x5294('0x32')]=_[_0x5294('0x33')](_0xec0008[_0x5294('0x2f')],_0xec0008['query']);_0x46944a[_0x5294('0x35')]=_[_0x5294('0x33')](_0xec0008[_0x5294('0x2f')],qs[_0x5294('0x34')](_0x164ed7[_0x5294('0x31')][_0x5294('0x34')]));_0x46944a['attributes']=_0x46944a[_0x5294('0x35')][_0x5294('0x36')]?_0x46944a['attributes']:_0xec0008[_0x5294('0x2f')];if(_0x164ed7[_0x5294('0x31')]['includeAll']){_0x46944a[_0x5294('0x40')]=[{'all':!![]}];}_0x46944a=_[_0x5294('0x3d')]({},_0x46944a,_0x164ed7[_0x5294('0x3e')]);return db[_0x5294('0x2c')]['find'](_0x46944a)['then'](handleEntityNotFound(_0x46a3d7,null))[_0x5294('0x25')](respondWithResult(_0x46a3d7,null))[_0x5294('0x43')](handleError(_0x46a3d7,null));};exports[_0x5294('0x48')]=function(_0x18dc6b,_0x2a5c55){return db[_0x5294('0x2c')]['create'](_0x18dc6b[_0x5294('0x49')],{})[_0x5294('0x25')](respondWithResult(_0x2a5c55,0xc9))[_0x5294('0x43')](handleError(_0x2a5c55,null));};exports[_0x5294('0x24')]=function(_0x54bd20,_0x265008){if(_0x54bd20[_0x5294('0x49')]['id']){delete _0x54bd20['body']['id'];}return db[_0x5294('0x2c')][_0x5294('0x4a')]({'where':{'id':_0x54bd20[_0x5294('0x45')]['id']}})['then'](handleEntityNotFound(_0x265008,null))[_0x5294('0x25')](saveUpdates(_0x54bd20[_0x5294('0x49')],null))[_0x5294('0x25')](respondWithResult(_0x265008,null))[_0x5294('0x43')](handleError(_0x265008,null));};exports[_0x5294('0x26')]=function(_0x223865,_0x59dfbb){return db['OpenchannelTransferReport'][_0x5294('0x4a')]({'where':{'id':_0x223865[_0x5294('0x45')]['id']}})[_0x5294('0x25')](handleEntityNotFound(_0x59dfbb,null))['then'](removeEntity(_0x59dfbb,null))[_0x5294('0x43')](handleError(_0x59dfbb,null));};exports['describe']=function(_0x59c467,_0x4963d2){return db[_0x5294('0x2c')][_0x5294('0x4b')]()[_0x5294('0x25')](respondWithResult(_0x4963d2,null))[_0x5294('0x43')](handleError(_0x4963d2,null));}; \ No newline at end of file +var _0xd21f=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','find','describe','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','limit','count','offset','status','set','Content-Range','apply','update','then','destroy','end','name','send','index','map','fieldName'];(function(_0x4d3d50,_0x50f156){var _0x175e6d=function(_0x41fc26){while(--_0x41fc26){_0x4d3d50['push'](_0x4d3d50['shift']());}};_0x175e6d(++_0x50f156);}(_0xd21f,0xf7));var _0xfd21=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0xd21f[_0x58d8d7];return _0x339d20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfd21('0x0'));var jsonpatch=require(_0xfd21('0x1'));var rp=require('request-promise');var moment=require(_0xfd21('0x2'));var BPromise=require(_0xfd21('0x3'));var Mustache=require('mustache');var util=require(_0xfd21('0x4'));var path=require(_0xfd21('0x5'));var sox=require(_0xfd21('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd21('0x7'));var _=require(_0xfd21('0x8'));var squel=require(_0xfd21('0x9'));var crypto=require(_0xfd21('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfd21('0xb'));var toCsv=require(_0xfd21('0xc'));var querystring=require(_0xfd21('0xd'));var Papa=require(_0xfd21('0xe'));var Redis=require(_0xfd21('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfd21('0x10'));var as=require(_0xfd21('0x11'));var hardwareService=require(_0xfd21('0x12'));var logger=require(_0xfd21('0x13'))(_0xfd21('0x14'));var utils=require(_0xfd21('0x15'));var config=require(_0xfd21('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd21('0x17'))['db'];function respondWithStatusCode(_0x5239c9,_0x3ef607){_0x3ef607=_0x3ef607||0xcc;return function(_0x557560){if(_0x557560){return _0x5239c9['sendStatus'](_0x3ef607);}return _0x5239c9['status'](_0x3ef607)['end']();};}function respondWithResult(_0x484f54,_0x4caf4b){_0x4caf4b=_0x4caf4b||0xc8;return function(_0x3f6fe6){if(_0x3f6fe6){return _0x484f54['status'](_0x4caf4b)[_0xfd21('0x18')](_0x3f6fe6);}};}function respondWithFilteredResult(_0x510332,_0x16d64b){return function(_0x5681f8){if(_0x5681f8){var _0x2c98b7=typeof _0x16d64b['offset']==='undefined'&&typeof _0x16d64b[_0xfd21('0x19')]==='undefined';var _0x54e3f7=_0x5681f8[_0xfd21('0x1a')];var _0x375c2d=_0x2c98b7?0x0:_0x16d64b['offset'];var _0x2e8e67=_0x2c98b7?_0x5681f8[_0xfd21('0x1a')]:_0x16d64b[_0xfd21('0x1b')]+_0x16d64b[_0xfd21('0x19')];var _0x1a5598;if(_0x2e8e67>=_0x54e3f7){_0x2e8e67=_0x54e3f7;_0x1a5598=0xc8;}else{_0x1a5598=0xce;}_0x510332[_0xfd21('0x1c')](_0x1a5598);return _0x510332[_0xfd21('0x1d')](_0xfd21('0x1e'),_0x375c2d+'-'+_0x2e8e67+'/'+_0x54e3f7)[_0xfd21('0x18')](_0x5681f8);}return null;};}function patchUpdates(_0x344694){return function(_0x391d72){try{jsonpatch[_0xfd21('0x1f')](_0x391d72,_0x344694,!![]);}catch(_0xec368d){return BPromise['reject'](_0xec368d);}return _0x391d72['save']();};}function saveUpdates(_0x4a107e,_0x5d0ffe){return function(_0x3906ab){if(_0x3906ab){return _0x3906ab[_0xfd21('0x20')](_0x4a107e)[_0xfd21('0x21')](function(_0x5c9f35){return _0x5c9f35;});}return null;};}function removeEntity(_0x3f7817,_0x570a23){return function(_0xb14ce3){if(_0xb14ce3){return _0xb14ce3[_0xfd21('0x22')]()[_0xfd21('0x21')](function(){_0x3f7817[_0xfd21('0x1c')](0xcc)[_0xfd21('0x23')]();});}};}function handleEntityNotFound(_0x1a3a4a,_0x4dd373){return function(_0xdc4dbb){if(!_0xdc4dbb){_0x1a3a4a['sendStatus'](0x194);}return _0xdc4dbb;};}function handleError(_0x26024b,_0x1d9200){_0x1d9200=_0x1d9200||0x1f4;return function(_0x593d65){logger['error'](_0x593d65['stack']);if(_0x593d65[_0xfd21('0x24')]){delete _0x593d65[_0xfd21('0x24')];}_0x26024b[_0xfd21('0x1c')](_0x1d9200)[_0xfd21('0x25')](_0x593d65);};}exports[_0xfd21('0x26')]=function(_0x5fedd1,_0x20c26d){var _0x520d3a={},_0x59f669={},_0x52b5fb={'count':0x0,'rows':[]};var _0x2a6158=_[_0xfd21('0x27')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x454364){return{'name':_0x454364[_0xfd21('0x28')],'type':_0x454364[_0xfd21('0x29')][_0xfd21('0x2a')]};});_0x59f669[_0xfd21('0x2b')]=_['map'](_0x2a6158,_0xfd21('0x24'));_0x59f669[_0xfd21('0x2c')]=_['keys'](_0x5fedd1[_0xfd21('0x2c')]);_0x59f669[_0xfd21('0x2d')]=_[_0xfd21('0x2e')](_0x59f669[_0xfd21('0x2b')],_0x59f669[_0xfd21('0x2c')]);_0x520d3a[_0xfd21('0x2f')]=_['intersection'](_0x59f669[_0xfd21('0x2b')],qs['fields'](_0x5fedd1[_0xfd21('0x2c')][_0xfd21('0x30')]));_0x520d3a[_0xfd21('0x2f')]=_0x520d3a[_0xfd21('0x2f')][_0xfd21('0x31')]?_0x520d3a[_0xfd21('0x2f')]:_0x59f669[_0xfd21('0x2b')];if(!_0x5fedd1['query'][_0xfd21('0x32')]('nolimit')){_0x520d3a[_0xfd21('0x19')]=qs[_0xfd21('0x19')](_0x5fedd1[_0xfd21('0x2c')]['limit']);_0x520d3a[_0xfd21('0x1b')]=qs[_0xfd21('0x1b')](_0x5fedd1[_0xfd21('0x2c')][_0xfd21('0x1b')]);}_0x520d3a[_0xfd21('0x33')]=qs[_0xfd21('0x34')](_0x5fedd1['query'][_0xfd21('0x34')]);_0x520d3a['where']=qs[_0xfd21('0x2d')](_[_0xfd21('0x35')](_0x5fedd1['query'],_0x59f669[_0xfd21('0x2d')]),_0x2a6158);if(_0x5fedd1[_0xfd21('0x2c')][_0xfd21('0x36')]){_0x520d3a['where']=_[_0xfd21('0x37')](_0x520d3a[_0xfd21('0x38')],{'$or':_[_0xfd21('0x27')](_0x2a6158,function(_0x212273){if(_0x212273['type']!==_0xfd21('0x39')){var _0x523cce={};_0x523cce[_0x212273['name']]={'$like':'%'+_0x5fedd1[_0xfd21('0x2c')][_0xfd21('0x36')]+'%'};return _0x523cce;}})});}_0x520d3a=_[_0xfd21('0x37')]({},_0x520d3a,_0x5fedd1[_0xfd21('0x3a')]);var _0x5b473c={'where':_0x520d3a['where']};return db[_0xfd21('0x3b')][_0xfd21('0x1a')](_0x5b473c)['then'](function(_0x5d356d){_0x52b5fb[_0xfd21('0x1a')]=_0x5d356d;if(_0x5fedd1[_0xfd21('0x2c')][_0xfd21('0x3c')]){_0x520d3a[_0xfd21('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xfd21('0x3e')](_0x520d3a);})['then'](function(_0x26b021){_0x52b5fb['rows']=_0x26b021;return _0x52b5fb;})[_0xfd21('0x21')](respondWithFilteredResult(_0x20c26d,_0x520d3a))[_0xfd21('0x3f')](handleError(_0x20c26d,null));};exports[_0xfd21('0x40')]=function(_0x25f187,_0x5403ed){var _0x38eece={'raw':!![],'where':{'id':_0x25f187[_0xfd21('0x41')]['id']}},_0x412976={};_0x412976[_0xfd21('0x2b')]=_[_0xfd21('0x42')](db[_0xfd21('0x3b')][_0xfd21('0x43')]);_0x412976[_0xfd21('0x2c')]=_[_0xfd21('0x42')](_0x25f187[_0xfd21('0x2c')]);_0x412976['filters']=_[_0xfd21('0x2e')](_0x412976[_0xfd21('0x2b')],_0x412976[_0xfd21('0x2c')]);_0x38eece[_0xfd21('0x2f')]=_[_0xfd21('0x2e')](_0x412976[_0xfd21('0x2b')],qs[_0xfd21('0x30')](_0x25f187['query'][_0xfd21('0x30')]));_0x38eece[_0xfd21('0x2f')]=_0x38eece[_0xfd21('0x2f')][_0xfd21('0x31')]?_0x38eece[_0xfd21('0x2f')]:_0x412976[_0xfd21('0x2b')];if(_0x25f187['query'][_0xfd21('0x3c')]){_0x38eece[_0xfd21('0x3d')]=[{'all':!![]}];}_0x38eece=_[_0xfd21('0x37')]({},_0x38eece,_0x25f187['options']);return db[_0xfd21('0x3b')]['find'](_0x38eece)['then'](handleEntityNotFound(_0x5403ed,null))['then'](respondWithResult(_0x5403ed,null))[_0xfd21('0x3f')](handleError(_0x5403ed,null));};exports[_0xfd21('0x44')]=function(_0x491150,_0x5a81de){return db[_0xfd21('0x3b')]['create'](_0x491150[_0xfd21('0x45')],{})[_0xfd21('0x21')](respondWithResult(_0x5a81de,0xc9))[_0xfd21('0x3f')](handleError(_0x5a81de,null));};exports[_0xfd21('0x20')]=function(_0x28343b,_0x593387){if(_0x28343b[_0xfd21('0x45')]['id']){delete _0x28343b[_0xfd21('0x45')]['id'];}return db[_0xfd21('0x3b')][_0xfd21('0x46')]({'where':{'id':_0x28343b[_0xfd21('0x41')]['id']}})['then'](handleEntityNotFound(_0x593387,null))['then'](saveUpdates(_0x28343b[_0xfd21('0x45')],null))[_0xfd21('0x21')](respondWithResult(_0x593387,null))[_0xfd21('0x3f')](handleError(_0x593387,null));};exports[_0xfd21('0x22')]=function(_0x5bd05a,_0x29b3b5){return db['OpenchannelTransferReport'][_0xfd21('0x46')]({'where':{'id':_0x5bd05a[_0xfd21('0x41')]['id']}})[_0xfd21('0x21')](handleEntityNotFound(_0x29b3b5,null))[_0xfd21('0x21')](removeEntity(_0x29b3b5,null))['catch'](handleError(_0x29b3b5,null));};exports['describe']=function(_0x54e7d4,_0xf9ff4e){return db[_0xfd21('0x3b')][_0xfd21('0x47')]()[_0xfd21('0x21')](respondWithResult(_0xf9ff4e,null))[_0xfd21('0x3f')](handleError(_0xf9ff4e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 9b4c560..d7e6b49 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 _0x8225=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','api','moment','bluebird','request-promise'];(function(_0x13f4fb,_0x407670){var _0x5f3552=function(_0x32a558){while(--_0x32a558){_0x13f4fb['push'](_0x13f4fb['shift']());}};_0x5f3552(++_0x407670);}(_0x8225,0x1b5));var _0x5822=function(_0x285159,_0x434500){_0x285159=_0x285159-0x0;var _0x3ade27=_0x8225[_0x285159];return _0x3ade27;};'use strict';var _=require(_0x5822('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5822('0x1'));var moment=require(_0x5822('0x2'));var BPromise=require(_0x5822('0x3'));var rp=require(_0x5822('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5822('0x5'));var config=require(_0x5822('0x6'));var attributes=require(_0x5822('0x7'));module[_0x5822('0x8')]=function(_0x53aa9a,_0x3afa06){return _0x53aa9a[_0x5822('0x9')](_0x5822('0xa'),attributes,{'tableName':_0x5822('0xb'),'paranoid':![],'indexes':[{'name':_0x5822('0xc'),'fields':[_0x5822('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea2=['../../config/logger','moment','path','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x1c9817,_0x4d55e0){var _0x4a33ff=function(_0x5a685f){while(--_0x5a685f){_0x1c9817['push'](_0x1c9817['shift']());}};_0x4a33ff(++_0x4d55e0);}(_0x4ea2,0x116));var _0x24ea=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x4ea2[_0x45c48f];return _0xaf5037;};'use strict';var _=require(_0x24ea('0x0'));var util=require('util');var logger=require(_0x24ea('0x1'))('api');var moment=require(_0x24ea('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x24ea('0x3'));var rimraf=require('rimraf');var config=require(_0x24ea('0x4'));var attributes=require(_0x24ea('0x5'));module['exports']=function(_0x4e28a4,_0x373aab){return _0x4e28a4['define'](_0x24ea('0x6'),attributes,{'tableName':_0x24ea('0x7'),'paranoid':![],'indexes':[{'name':_0x24ea('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 53dc91f..e64c8c7 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 _0x9ab0=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x9ab0,0x195));var _0x09ab=function(_0x4f9c57,_0x56c364){_0x4f9c57=_0x4f9c57-0x0;var _0x19ad28=_0x9ab0[_0x4f9c57];return _0x19ad28;};'use strict';var _=require(_0x09ab('0x0'));var util=require(_0x09ab('0x1'));var moment=require(_0x09ab('0x2'));var BPromise=require(_0x09ab('0x3'));var rs=require(_0x09ab('0x4'));var fs=require('fs');var Redis=require(_0x09ab('0x5'));var db=require(_0x09ab('0x6'))['db'];var utils=require(_0x09ab('0x7'));var logger=require(_0x09ab('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x09ab('0x9')][_0x09ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x241bd1,_0x233f2a,_0x610663){return new BPromise(function(_0x464d64,_0x174a54){return client[_0x09ab('0xb')](_0x241bd1,_0x610663)[_0x09ab('0xc')](function(_0x58c23b){logger[_0x09ab('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x233f2a,_0x09ab('0xe'));logger[_0x09ab('0xf')](_0x09ab('0x10'),_0x233f2a,'request\x20sent',JSON['stringify'](_0x58c23b));if(_0x58c23b[_0x09ab('0x11')]){if(_0x58c23b[_0x09ab('0x11')]['code']===0x1f4){logger['error'](_0x09ab('0x12'),_0x233f2a,_0x58c23b[_0x09ab('0x11')][_0x09ab('0x13')]);return _0x174a54(_0x58c23b[_0x09ab('0x11')][_0x09ab('0x13')]);}logger[_0x09ab('0x11')](_0x09ab('0x12'),_0x233f2a,_0x58c23b[_0x09ab('0x11')][_0x09ab('0x13')]);return _0x464d64(_0x58c23b[_0x09ab('0x11')][_0x09ab('0x13')]);}else{logger[_0x09ab('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x233f2a,_0x09ab('0xe'));_0x464d64(_0x58c23b[_0x09ab('0x14')][_0x09ab('0x13')]);}})['catch'](function(_0x21db00){logger[_0x09ab('0x11')](_0x09ab('0x12'),_0x233f2a,_0x21db00);_0x174a54(_0x21db00);});});} \ No newline at end of file +var _0xae1c=['message','info','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xae1c,0xff));var _0xcae1=function(_0x4b6531,_0x53831e){_0x4b6531=_0x4b6531-0x0;var _0x15cec=_0xae1c[_0x4b6531];return _0x15cec;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcae1('0x0'));var fs=require('fs');var Redis=require(_0xcae1('0x1'));var db=require(_0xcae1('0x2'))['db'];var utils=require(_0xcae1('0x3'));var logger=require(_0xcae1('0x4'))(_0xcae1('0x5'));var config=require(_0xcae1('0x6'));var jayson=require(_0xcae1('0x7'));var client=jayson[_0xcae1('0x8')][_0xcae1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c35c7,_0x38099e,_0x7a27b8){return new BPromise(function(_0x50d451,_0x4e419d){return client[_0xcae1('0xa')](_0x3c35c7,_0x7a27b8)[_0xcae1('0xb')](function(_0x3284aa){logger['info'](_0xcae1('0xc'),_0x38099e,_0xcae1('0xd'));logger[_0xcae1('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x38099e,_0xcae1('0xd'),JSON[_0xcae1('0xf')](_0x3284aa));if(_0x3284aa['error']){if(_0x3284aa['error'][_0xcae1('0x10')]===0x1f4){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x4e419d(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);return _0x50d451(_0x3284aa[_0xcae1('0x11')][_0xcae1('0x12')]);}else{logger[_0xcae1('0x13')](_0xcae1('0xc'),_0x38099e,'request\x20sent');_0x50d451(_0x3284aa[_0xcae1('0x14')][_0xcae1('0x12')]);}})['catch'](function(_0x4a7ef7){logger[_0xcae1('0x11')](_0xcae1('0xc'),_0x38099e,_0x4a7ef7);_0x4e419d(_0x4a7ef7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2eb381a..09993b3 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 _0x4c7e=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update','exports','multer'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0x4c7e,0x142));var _0xe4c7=function(_0xc033f3,_0x4edd5c){_0xc033f3=_0xc033f3-0x0;var _0x57eb11=_0x4c7e[_0xc033f3];return _0x57eb11;};'use strict';var multer=require(_0xe4c7('0x0'));var util=require(_0xe4c7('0x1'));var path=require(_0xe4c7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4c7('0x3'));var router=express[_0xe4c7('0x4')]();var fs_extra=require(_0xe4c7('0x5'));var auth=require(_0xe4c7('0x6'));var interaction=require(_0xe4c7('0x7'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0xe4c7('0x8')]('/',auth[_0xe4c7('0x9')](),controller[_0xe4c7('0xa')]);router['get'](_0xe4c7('0xb'),auth[_0xe4c7('0x9')](),controller[_0xe4c7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe4c7('0xd')]);router[_0xe4c7('0xe')]('/:id',auth[_0xe4c7('0x9')](),controller[_0xe4c7('0xf')]);router['delete'](_0xe4c7('0xb'),auth[_0xe4c7('0x9')](),controller['destroy']);module[_0xe4c7('0x10')]=router; \ No newline at end of file +var _0xd84e=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x21ccfc,_0x48834e){var _0x279454=function(_0x12b780){while(--_0x12b780){_0x21ccfc['push'](_0x21ccfc['shift']());}};_0x279454(++_0x48834e);}(_0xd84e,0xf8));var _0xed84=function(_0x477317,_0x579051){_0x477317=_0x477317-0x0;var _0x1d842a=_0xd84e[_0x477317];return _0x1d842a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed84('0x0'));var timeout=require(_0xed84('0x1'));var express=require(_0xed84('0x2'));var router=express[_0xed84('0x3')]();var fs_extra=require(_0xed84('0x4'));var auth=require(_0xed84('0x5'));var interaction=require(_0xed84('0x6'));var config=require(_0xed84('0x7'));var controller=require('./pause.controller');router[_0xed84('0x8')]('/',auth[_0xed84('0x9')](),controller[_0xed84('0xa')]);router[_0xed84('0x8')](_0xed84('0xb'),auth[_0xed84('0x9')](),controller[_0xed84('0xc')]);router[_0xed84('0xd')]('/',auth[_0xed84('0x9')](),controller[_0xed84('0xe')]);router[_0xed84('0xf')]('/:id',auth[_0xed84('0x9')](),controller[_0xed84('0x10')]);router[_0xed84('0x11')](_0xed84('0xb'),auth['isAuthenticated'](),controller[_0xed84('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 a5d1d71..12153ce 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 _0xf197=['STRING','name','sequelize','exports'];(function(_0x4d115b,_0x3556aa){var _0x32d075=function(_0x52e6b8){while(--_0x52e6b8){_0x4d115b['push'](_0x4d115b['shift']());}};_0x32d075(++_0x3556aa);}(_0xf197,0x1e2));var _0x7f19=function(_0x188a62,_0x4b38e3){_0x188a62=_0x188a62-0x0;var _0x5228d8=_0xf197[_0x188a62];return _0x5228d8;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'name':{'type':Sequelize[_0x7f19('0x2')],'unique':_0x7f19('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7f19('0x2')]}}; \ No newline at end of file +var _0x8247=['name','sequelize','STRING'];(function(_0x95b585,_0x282d1b){var _0x4c3d88=function(_0xa69ec4){while(--_0xa69ec4){_0x95b585['push'](_0x95b585['shift']());}};_0x4c3d88(++_0x282d1b);}(_0x8247,0x130));var _0x7824=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8247[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0x7824('0x0'));module['exports']={'name':{'type':Sequelize[_0x7824('0x1')],'unique':_0x7824('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7824('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 43fa90a..890db03 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 _0xa572=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','name','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2e9343,_0x366cb6){var _0x3d29ed=function(_0x5161e2){while(--_0x5161e2){_0x2e9343['push'](_0x2e9343['shift']());}};_0x3d29ed(++_0x366cb6);}(_0xa572,0x13d));var _0x2a57=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0xa572[_0x313df3];return _0x241d59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a57('0x0'));var zipdir=require(_0x2a57('0x1'));var jsonpatch=require(_0x2a57('0x2'));var rp=require('request-promise');var moment=require(_0x2a57('0x3'));var BPromise=require(_0x2a57('0x4'));var Mustache=require(_0x2a57('0x5'));var util=require(_0x2a57('0x6'));var path=require(_0x2a57('0x7'));var sox=require(_0x2a57('0x8'));var csv=require(_0x2a57('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a57('0xa'));var _=require(_0x2a57('0xb'));var squel=require('squel');var crypto=require(_0x2a57('0xc'));var jsforce=require(_0x2a57('0xd'));var deskjs=require(_0x2a57('0xe'));var toCsv=require(_0x2a57('0x9'));var querystring=require(_0x2a57('0xf'));var Papa=require('papaparse');var Redis=require(_0x2a57('0x10'));var authService=require(_0x2a57('0x11'));var qs=require(_0x2a57('0x12'));var as=require(_0x2a57('0x13'));var hardwareService=require(_0x2a57('0x14'));var logger=require('../../config/logger')(_0x2a57('0x15'));var utils=require(_0x2a57('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2a57('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17a41f,_0x58b2d8){_0x58b2d8=_0x58b2d8||0xcc;return function(_0x48bfc3){if(_0x48bfc3){return _0x17a41f[_0x2a57('0x18')](_0x58b2d8);}return _0x17a41f[_0x2a57('0x19')](_0x58b2d8)[_0x2a57('0x1a')]();};}function respondWithResult(_0x12b47c,_0x4fda23){_0x4fda23=_0x4fda23||0xc8;return function(_0x1152bf){if(_0x1152bf){return _0x12b47c[_0x2a57('0x19')](_0x4fda23)[_0x2a57('0x1b')](_0x1152bf);}};}function respondWithFilteredResult(_0x185b09,_0x183807){return function(_0x4582f7){if(_0x4582f7){var _0x35d6cc=typeof _0x183807[_0x2a57('0x1c')]===_0x2a57('0x1d')&&typeof _0x183807['limit']==='undefined';var _0x346217=_0x4582f7['count'];var _0x51957e=_0x35d6cc?0x0:_0x183807[_0x2a57('0x1c')];var _0x49fba9=_0x35d6cc?_0x4582f7['count']:_0x183807[_0x2a57('0x1c')]+_0x183807[_0x2a57('0x1e')];var _0x4d5146;if(_0x49fba9>=_0x346217){_0x49fba9=_0x346217;_0x4d5146=0xc8;}else{_0x4d5146=0xce;}_0x185b09[_0x2a57('0x19')](_0x4d5146);return _0x185b09['set'](_0x2a57('0x1f'),_0x51957e+'-'+_0x49fba9+'/'+_0x346217)[_0x2a57('0x1b')](_0x4582f7);}return null;};}function patchUpdates(_0x477727){return function(_0x300f0a){try{jsonpatch[_0x2a57('0x20')](_0x300f0a,_0x477727,!![]);}catch(_0x476b23){return BPromise[_0x2a57('0x21')](_0x476b23);}return _0x300f0a[_0x2a57('0x22')]();};}function saveUpdates(_0x3f8c6b,_0x44a62d){return function(_0x37c862){if(_0x37c862){return _0x37c862[_0x2a57('0x23')](_0x3f8c6b)[_0x2a57('0x24')](function(_0x16d804){return _0x16d804;});}return null;};}function removeEntity(_0xc68e6b,_0x512b61){return function(_0x5980a9){if(_0x5980a9){return _0x5980a9[_0x2a57('0x25')]()[_0x2a57('0x24')](function(){var _0x20002d=_0x5980a9[_0x2a57('0x26')]({'plain':!![]});var _0x217c02='Pauses';return db[_0x2a57('0x27')][_0x2a57('0x25')]({'where':{'type':_0x217c02,'resourceId':_0x20002d['id']}})[_0x2a57('0x24')](function(){return _0x5980a9;});})[_0x2a57('0x24')](function(){_0xc68e6b[_0x2a57('0x19')](0xcc)[_0x2a57('0x1a')]();});}};}function handleEntityNotFound(_0x463caf,_0xfcb846){return function(_0x1ceba2){if(!_0x1ceba2){_0x463caf[_0x2a57('0x18')](0x194);}return _0x1ceba2;};}function handleError(_0x29c82e,_0x47ddd7){_0x47ddd7=_0x47ddd7||0x1f4;return function(_0x1dfaab){logger[_0x2a57('0x28')](_0x1dfaab[_0x2a57('0x29')]);if(_0x1dfaab['name']){delete _0x1dfaab['name'];}_0x29c82e[_0x2a57('0x19')](_0x47ddd7)[_0x2a57('0x2a')](_0x1dfaab);};}exports[_0x2a57('0x2b')]=function(_0x32f583,_0x443f4e){var _0x183128={},_0x571633={},_0x4aa444={'count':0x0,'rows':[]};var _0x587943=_['map'](db[_0x2a57('0x2c')][_0x2a57('0x2d')],function(_0x2f6731){return{'name':_0x2f6731[_0x2a57('0x2e')],'type':_0x2f6731[_0x2a57('0x2f')][_0x2a57('0x30')]};});_0x571633[_0x2a57('0x31')]=_[_0x2a57('0x32')](_0x587943,'name');_0x571633[_0x2a57('0x33')]=_[_0x2a57('0x34')](_0x32f583[_0x2a57('0x33')]);_0x571633['filters']=_[_0x2a57('0x35')](_0x571633['model'],_0x571633['query']);_0x183128[_0x2a57('0x36')]=_[_0x2a57('0x35')](_0x571633[_0x2a57('0x31')],qs[_0x2a57('0x37')](_0x32f583['query'][_0x2a57('0x37')]));_0x183128[_0x2a57('0x36')]=_0x183128['attributes'][_0x2a57('0x38')]?_0x183128['attributes']:_0x571633[_0x2a57('0x31')];if(!_0x32f583[_0x2a57('0x33')]['hasOwnProperty'](_0x2a57('0x39'))){_0x183128['limit']=qs[_0x2a57('0x1e')](_0x32f583[_0x2a57('0x33')]['limit']);_0x183128[_0x2a57('0x1c')]=qs[_0x2a57('0x1c')](_0x32f583[_0x2a57('0x33')]['offset']);}_0x183128['order']=qs[_0x2a57('0x3a')](_0x32f583['query'][_0x2a57('0x3a')]);_0x183128[_0x2a57('0x3b')]=qs[_0x2a57('0x3c')](_['pick'](_0x32f583[_0x2a57('0x33')],_0x571633[_0x2a57('0x3c')]),_0x587943);if(_0x32f583[_0x2a57('0x33')][_0x2a57('0x3d')]){_0x183128['where']=_[_0x2a57('0x3e')](_0x183128['where'],{'$or':_[_0x2a57('0x32')](_0x587943,function(_0x29684a){if(_0x29684a[_0x2a57('0x2f')]!==_0x2a57('0x3f')){var _0x377ee7={};_0x377ee7[_0x29684a[_0x2a57('0x40')]]={'$like':'%'+_0x32f583[_0x2a57('0x33')][_0x2a57('0x3d')]+'%'};return _0x377ee7;}})});}_0x183128=_[_0x2a57('0x3e')]({},_0x183128,_0x32f583[_0x2a57('0x41')]);var _0x35bae6={'where':_0x183128['where']};return db[_0x2a57('0x2c')][_0x2a57('0x42')](_0x35bae6)[_0x2a57('0x24')](function(_0x3263c8){_0x4aa444[_0x2a57('0x42')]=_0x3263c8;if(_0x32f583['query'][_0x2a57('0x43')]){_0x183128['include']=[{'all':!![]}];}return db[_0x2a57('0x2c')][_0x2a57('0x44')](_0x183128);})[_0x2a57('0x24')](function(_0x2e89f1){_0x4aa444[_0x2a57('0x45')]=_0x2e89f1;return _0x4aa444;})['then'](respondWithFilteredResult(_0x443f4e,_0x183128))[_0x2a57('0x46')](handleError(_0x443f4e,null));};exports[_0x2a57('0x47')]=function(_0x33b99f,_0x45c895){var _0x110472={'raw':!![],'where':{'id':_0x33b99f[_0x2a57('0x48')]['id']}},_0xd1d4c6={};_0xd1d4c6[_0x2a57('0x31')]=_[_0x2a57('0x34')](db[_0x2a57('0x2c')][_0x2a57('0x2d')]);_0xd1d4c6[_0x2a57('0x33')]=_[_0x2a57('0x34')](_0x33b99f[_0x2a57('0x33')]);_0xd1d4c6[_0x2a57('0x3c')]=_[_0x2a57('0x35')](_0xd1d4c6[_0x2a57('0x31')],_0xd1d4c6[_0x2a57('0x33')]);_0x110472['attributes']=_[_0x2a57('0x35')](_0xd1d4c6[_0x2a57('0x31')],qs[_0x2a57('0x37')](_0x33b99f['query'][_0x2a57('0x37')]));_0x110472[_0x2a57('0x36')]=_0x110472[_0x2a57('0x36')][_0x2a57('0x38')]?_0x110472['attributes']:_0xd1d4c6[_0x2a57('0x31')];if(_0x33b99f[_0x2a57('0x33')][_0x2a57('0x43')]){_0x110472[_0x2a57('0x49')]=[{'all':!![]}];}_0x110472=_[_0x2a57('0x3e')]({},_0x110472,_0x33b99f['options']);return db['Pause'][_0x2a57('0x4a')](_0x110472)[_0x2a57('0x24')](handleEntityNotFound(_0x45c895,null))['then'](respondWithResult(_0x45c895,null))['catch'](handleError(_0x45c895,null));};exports[_0x2a57('0x4b')]=function(_0x2760c8,_0x14d388){return db['Pause'][_0x2a57('0x4b')](_0x2760c8[_0x2a57('0x4c')],{})['then'](function(_0x305365){var _0x26c96f=_0x2760c8[_0x2a57('0x4d')][_0x2a57('0x26')]({'plain':!![]});if(!_0x26c96f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26c96f[_0x2a57('0x4e')]==='user'){var _0x42b38b=_0x305365['get']({'plain':!![]});var _0x3a8374='Pauses';return db['UserProfileSection']['find']({'where':{'name':_0x3a8374,'userProfileId':_0x26c96f[_0x2a57('0x4f')]},'raw':!![]})[_0x2a57('0x24')](function(_0x432aa9){if(_0x432aa9&&_0x432aa9[_0x2a57('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x42b38b['name'],'resourceId':_0x42b38b['id'],'type':_0x432aa9[_0x2a57('0x40')],'sectionId':_0x432aa9['id']},{})[_0x2a57('0x24')](function(){return _0x305365;});}else{return _0x305365;}})[_0x2a57('0x46')](function(_0x4183bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4183bd);throw _0x4183bd;});}return _0x305365;})[_0x2a57('0x24')](respondWithResult(_0x14d388,0xc9))[_0x2a57('0x46')](handleError(_0x14d388,null));};exports['update']=function(_0x29b00b,_0x33673e){if(_0x29b00b[_0x2a57('0x4c')]['id']){delete _0x29b00b[_0x2a57('0x4c')]['id'];}return db[_0x2a57('0x2c')]['find']({'where':{'id':_0x29b00b[_0x2a57('0x48')]['id']}})[_0x2a57('0x24')](handleEntityNotFound(_0x33673e,null))[_0x2a57('0x24')](saveUpdates(_0x29b00b[_0x2a57('0x4c')],null))[_0x2a57('0x24')](respondWithResult(_0x33673e,null))['catch'](handleError(_0x33673e,null));};exports[_0x2a57('0x25')]=function(_0x3d636b,_0x782667){return db[_0x2a57('0x2c')][_0x2a57('0x4a')]({'where':{'id':_0x3d636b[_0x2a57('0x48')]['id']}})[_0x2a57('0x24')](handleEntityNotFound(_0x782667,null))[_0x2a57('0x24')](removeEntity(_0x782667,null))[_0x2a57('0x46')](handleError(_0x782667,null));}; \ No newline at end of file +var _0x38e7=['reject','save','then','destroy','get','Pauses','UserProfileResource','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','update','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38e7,0x86));var _0x738e=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x38e7[_0x21cb7f];return _0x5a079a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x738e('0x0'));var zipdir=require(_0x738e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x738e('0x2'));var moment=require('moment');var BPromise=require(_0x738e('0x3'));var Mustache=require('mustache');var util=require(_0x738e('0x4'));var path=require(_0x738e('0x5'));var sox=require(_0x738e('0x6'));var csv=require(_0x738e('0x7'));var ejs=require(_0x738e('0x8'));var fs=require('fs');var fs_extra=require(_0x738e('0x9'));var _=require(_0x738e('0xa'));var squel=require(_0x738e('0xb'));var crypto=require('crypto');var jsforce=require(_0x738e('0xc'));var deskjs=require(_0x738e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x738e('0xe'));var Papa=require(_0x738e('0xf'));var Redis=require(_0x738e('0x10'));var authService=require(_0x738e('0x11'));var qs=require(_0x738e('0x12'));var as=require(_0x738e('0x13'));var hardwareService=require(_0x738e('0x14'));var logger=require(_0x738e('0x15'))(_0x738e('0x16'));var utils=require('../../config/utils');var config=require(_0x738e('0x17'));var licenseUtil=require(_0x738e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa8567f,_0x4d063c){_0x4d063c=_0x4d063c||0xcc;return function(_0x4d2a6e){if(_0x4d2a6e){return _0xa8567f['sendStatus'](_0x4d063c);}return _0xa8567f[_0x738e('0x19')](_0x4d063c)[_0x738e('0x1a')]();};}function respondWithResult(_0x18f6c7,_0x545f65){_0x545f65=_0x545f65||0xc8;return function(_0x49871f){if(_0x49871f){return _0x18f6c7[_0x738e('0x19')](_0x545f65)[_0x738e('0x1b')](_0x49871f);}};}function respondWithFilteredResult(_0x2484ec,_0x275ab4){return function(_0x9a62ea){if(_0x9a62ea){var _0x1d1edb=typeof _0x275ab4[_0x738e('0x1c')]===_0x738e('0x1d')&&typeof _0x275ab4['limit']===_0x738e('0x1d');var _0x1ff6c1=_0x9a62ea[_0x738e('0x1e')];var _0x4ebfc9=_0x1d1edb?0x0:_0x275ab4[_0x738e('0x1c')];var _0x287d08=_0x1d1edb?_0x9a62ea[_0x738e('0x1e')]:_0x275ab4[_0x738e('0x1c')]+_0x275ab4['limit'];var _0xcd7f3b;if(_0x287d08>=_0x1ff6c1){_0x287d08=_0x1ff6c1;_0xcd7f3b=0xc8;}else{_0xcd7f3b=0xce;}_0x2484ec['status'](_0xcd7f3b);return _0x2484ec[_0x738e('0x1f')](_0x738e('0x20'),_0x4ebfc9+'-'+_0x287d08+'/'+_0x1ff6c1)[_0x738e('0x1b')](_0x9a62ea);}return null;};}function patchUpdates(_0x4f21ea){return function(_0x46a082){try{jsonpatch[_0x738e('0x21')](_0x46a082,_0x4f21ea,!![]);}catch(_0x1db08a){return BPromise[_0x738e('0x22')](_0x1db08a);}return _0x46a082[_0x738e('0x23')]();};}function saveUpdates(_0x50f8ab,_0x1e8ebd){return function(_0x218a5e){if(_0x218a5e){return _0x218a5e['update'](_0x50f8ab)[_0x738e('0x24')](function(_0x3f8e0e){return _0x3f8e0e;});}return null;};}function removeEntity(_0x4af56f,_0x4eee4c){return function(_0x2ee76d){if(_0x2ee76d){return _0x2ee76d[_0x738e('0x25')]()[_0x738e('0x24')](function(){var _0x55136f=_0x2ee76d[_0x738e('0x26')]({'plain':!![]});var _0x4bfae5=_0x738e('0x27');return db[_0x738e('0x28')][_0x738e('0x25')]({'where':{'type':_0x4bfae5,'resourceId':_0x55136f['id']}})[_0x738e('0x24')](function(){return _0x2ee76d;});})[_0x738e('0x24')](function(){_0x4af56f[_0x738e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x846fb0,_0x53b807){return function(_0x3eedae){if(!_0x3eedae){_0x846fb0['sendStatus'](0x194);}return _0x3eedae;};}function handleError(_0x2b7850,_0x2fbf4a){_0x2fbf4a=_0x2fbf4a||0x1f4;return function(_0xeeac46){logger['error'](_0xeeac46[_0x738e('0x29')]);if(_0xeeac46[_0x738e('0x2a')]){delete _0xeeac46['name'];}_0x2b7850[_0x738e('0x19')](_0x2fbf4a)[_0x738e('0x2b')](_0xeeac46);};}exports[_0x738e('0x2c')]=function(_0xb216fe,_0x2c0520){var _0x143a39={},_0x288a34={},_0x30c3c4={'count':0x0,'rows':[]};var _0x51543a=_[_0x738e('0x2d')](db[_0x738e('0x2e')][_0x738e('0x2f')],function(_0x27438e){return{'name':_0x27438e[_0x738e('0x30')],'type':_0x27438e[_0x738e('0x31')][_0x738e('0x32')]};});_0x288a34['model']=_[_0x738e('0x2d')](_0x51543a,'name');_0x288a34[_0x738e('0x33')]=_['keys'](_0xb216fe[_0x738e('0x33')]);_0x288a34[_0x738e('0x34')]=_[_0x738e('0x35')](_0x288a34[_0x738e('0x36')],_0x288a34[_0x738e('0x33')]);_0x143a39[_0x738e('0x37')]=_[_0x738e('0x35')](_0x288a34[_0x738e('0x36')],qs[_0x738e('0x38')](_0xb216fe[_0x738e('0x33')][_0x738e('0x38')]));_0x143a39[_0x738e('0x37')]=_0x143a39[_0x738e('0x37')][_0x738e('0x39')]?_0x143a39[_0x738e('0x37')]:_0x288a34['model'];if(!_0xb216fe[_0x738e('0x33')][_0x738e('0x3a')](_0x738e('0x3b'))){_0x143a39['limit']=qs[_0x738e('0x3c')](_0xb216fe[_0x738e('0x33')]['limit']);_0x143a39[_0x738e('0x1c')]=qs[_0x738e('0x1c')](_0xb216fe[_0x738e('0x33')][_0x738e('0x1c')]);}_0x143a39[_0x738e('0x3d')]=qs[_0x738e('0x3e')](_0xb216fe[_0x738e('0x33')]['sort']);_0x143a39[_0x738e('0x3f')]=qs[_0x738e('0x34')](_['pick'](_0xb216fe[_0x738e('0x33')],_0x288a34['filters']),_0x51543a);if(_0xb216fe[_0x738e('0x33')][_0x738e('0x40')]){_0x143a39[_0x738e('0x3f')]=_[_0x738e('0x41')](_0x143a39['where'],{'$or':_[_0x738e('0x2d')](_0x51543a,function(_0x178996){if(_0x178996[_0x738e('0x31')]!=='VIRTUAL'){var _0x5c0beb={};_0x5c0beb[_0x178996['name']]={'$like':'%'+_0xb216fe[_0x738e('0x33')]['filter']+'%'};return _0x5c0beb;}})});}_0x143a39=_[_0x738e('0x41')]({},_0x143a39,_0xb216fe[_0x738e('0x42')]);var _0xcd675={'where':_0x143a39[_0x738e('0x3f')]};return db['Pause'][_0x738e('0x1e')](_0xcd675)[_0x738e('0x24')](function(_0x43558b){_0x30c3c4[_0x738e('0x1e')]=_0x43558b;if(_0xb216fe[_0x738e('0x33')]['includeAll']){_0x143a39[_0x738e('0x43')]=[{'all':!![]}];}return db['Pause'][_0x738e('0x44')](_0x143a39);})[_0x738e('0x24')](function(_0x106674){_0x30c3c4['rows']=_0x106674;return _0x30c3c4;})[_0x738e('0x24')](respondWithFilteredResult(_0x2c0520,_0x143a39))[_0x738e('0x45')](handleError(_0x2c0520,null));};exports[_0x738e('0x46')]=function(_0x52876f,_0x36d7fd){var _0x55da05={'raw':!![],'where':{'id':_0x52876f[_0x738e('0x47')]['id']}},_0x3314e9={};_0x3314e9['model']=_[_0x738e('0x48')](db[_0x738e('0x2e')][_0x738e('0x2f')]);_0x3314e9['query']=_[_0x738e('0x48')](_0x52876f[_0x738e('0x33')]);_0x3314e9[_0x738e('0x34')]=_[_0x738e('0x35')](_0x3314e9[_0x738e('0x36')],_0x3314e9['query']);_0x55da05['attributes']=_[_0x738e('0x35')](_0x3314e9[_0x738e('0x36')],qs[_0x738e('0x38')](_0x52876f[_0x738e('0x33')][_0x738e('0x38')]));_0x55da05['attributes']=_0x55da05[_0x738e('0x37')][_0x738e('0x39')]?_0x55da05[_0x738e('0x37')]:_0x3314e9[_0x738e('0x36')];if(_0x52876f[_0x738e('0x33')][_0x738e('0x49')]){_0x55da05['include']=[{'all':!![]}];}_0x55da05=_['merge']({},_0x55da05,_0x52876f[_0x738e('0x42')]);return db['Pause'][_0x738e('0x4a')](_0x55da05)[_0x738e('0x24')](handleEntityNotFound(_0x36d7fd,null))[_0x738e('0x24')](respondWithResult(_0x36d7fd,null))[_0x738e('0x45')](handleError(_0x36d7fd,null));};exports[_0x738e('0x4b')]=function(_0x1c3868,_0x4fdd9e){return db[_0x738e('0x2e')][_0x738e('0x4b')](_0x1c3868[_0x738e('0x4c')],{})['then'](function(_0x46d47e){var _0x1c3a30=_0x1c3868[_0x738e('0x4d')][_0x738e('0x26')]({'plain':!![]});if(!_0x1c3a30)throw new Error(_0x738e('0x4e'));if(_0x1c3a30['role']===_0x738e('0x4d')){var _0x18b546=_0x46d47e['get']({'plain':!![]});var _0x37110c=_0x738e('0x27');return db[_0x738e('0x4f')][_0x738e('0x4a')]({'where':{'name':_0x37110c,'userProfileId':_0x1c3a30[_0x738e('0x50')]},'raw':!![]})['then'](function(_0x2e2629){if(_0x2e2629&&_0x2e2629[_0x738e('0x51')]===0x0){return db[_0x738e('0x28')]['create']({'name':_0x18b546[_0x738e('0x2a')],'resourceId':_0x18b546['id'],'type':_0x2e2629['name'],'sectionId':_0x2e2629['id']},{})[_0x738e('0x24')](function(){return _0x46d47e;});}else{return _0x46d47e;}})[_0x738e('0x45')](function(_0x3c1f86){logger[_0x738e('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1f86);throw _0x3c1f86;});}return _0x46d47e;})[_0x738e('0x24')](respondWithResult(_0x4fdd9e,0xc9))[_0x738e('0x45')](handleError(_0x4fdd9e,null));};exports[_0x738e('0x53')]=function(_0x303ac4,_0x1e0ad6){if(_0x303ac4[_0x738e('0x4c')]['id']){delete _0x303ac4['body']['id'];}return db[_0x738e('0x2e')]['find']({'where':{'id':_0x303ac4[_0x738e('0x47')]['id']}})[_0x738e('0x24')](handleEntityNotFound(_0x1e0ad6,null))[_0x738e('0x24')](saveUpdates(_0x303ac4[_0x738e('0x4c')],null))[_0x738e('0x24')](respondWithResult(_0x1e0ad6,null))[_0x738e('0x45')](handleError(_0x1e0ad6,null));};exports[_0x738e('0x25')]=function(_0x2e2790,_0x4fb9c0){return db[_0x738e('0x2e')][_0x738e('0x4a')]({'where':{'id':_0x2e2790[_0x738e('0x47')]['id']}})[_0x738e('0x24')](handleEntityNotFound(_0x4fb9c0,null))[_0x738e('0x24')](removeEntity(_0x4fb9c0,null))[_0x738e('0x45')](handleError(_0x4fb9c0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 16781b4..5cc6c3c 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x4223bf,_0x3a88b6){var _0x99ddd3=function(_0x24f6db){while(--_0x24f6db){_0x4223bf['push'](_0x4223bf['shift']());}};_0x99ddd3(++_0x3a88b6);}(_0xabce,0x103));var _0xeabc=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xabce[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6aa7,0x178));var _0x76aa=function(_0x2cfbef,_0x38007f){_0x2cfbef=_0x2cfbef-0x0;var _0x41fef1=_0x6aa7[_0x2cfbef];return _0x41fef1;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index bd0ff27..a9117f6 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x30c429,_0x5c1659){var _0x61b9ed=function(_0x4d90dc){while(--_0x4d90dc){_0x30c429['push'](_0x30c429['shift']());}};_0x61b9ed(++_0x5c1659);}(_0xb10b,0x12a));var _0xbb10=function(_0x91f539,_0x442a0c){_0x91f539=_0x91f539-0x0;var _0x2e3bdd=_0xb10b[_0x91f539];return _0x2e3bdd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x17f1c1,_0x2e1efa){var _0x59bd6b=function(_0x558374){while(--_0x558374){_0x17f1c1['push'](_0x17f1c1['shift']());}};_0x59bd6b(++_0x2e1efa);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xb10b[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8cd674f..286b5bd 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 _0xc3b5=['server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/webhook','webhookGet','show','/:id/download','download','diskStorage','root'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x5736cf,_0xf61937){_0x5736cf=_0x5736cf-0x0;var _0x593513=_0xc3b5[_0x5736cf];return _0x593513;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c3b('0x0'));var timeout=require(_0x5c3b('0x1'));var express=require(_0x5c3b('0x2'));var router=express[_0x5c3b('0x3')]();var fs_extra=require(_0x5c3b('0x4'));var auth=require(_0x5c3b('0x5'));var interaction=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var controller=require('./plugin.controller');router[_0x5c3b('0x8')]('/',auth[_0x5c3b('0x9')](),controller['index']);router[_0x5c3b('0x8')](_0x5c3b('0xa'),controller[_0x5c3b('0xb')]);router[_0x5c3b('0x8')]('/:id',auth[_0x5c3b('0x9')](),controller[_0x5c3b('0xc')]);router[_0x5c3b('0x8')](_0x5c3b('0xd'),auth['isAuthenticated'](),controller[_0x5c3b('0xe')]);var upload=multer({'storage':multer[_0x5c3b('0xf')]({'destination':function(_0x30ceca,_0x2e894a,_0x363c3d){_0x363c3d(null,path['join'](config[_0x5c3b('0x10')],_0x5c3b('0x11')));},'filename':function(_0x589c36,_0x1b2815,_0x3b953d){_0x1b2815['originalname']=_0x1b2815[_0x5c3b('0x12')][_0x5c3b('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b953d(null,util[_0x5c3b('0x14')](_0x5c3b('0x15'),path[_0x5c3b('0x16')](_0x1b2815[_0x5c3b('0x12')],path[_0x5c3b('0x17')](_0x1b2815['originalname'])),Date[_0x5c3b('0x18')](),path['extname'](_0x1b2815['originalname'])));}})});router[_0x5c3b('0x19')]('/',upload[_0x5c3b('0x1a')](_0x5c3b('0x1b')),controller['upload']);router[_0x5c3b('0x19')](_0x5c3b('0xa'),controller[_0x5c3b('0x1c')]);router['put'](_0x5c3b('0x1d'),auth[_0x5c3b('0x9')](),controller['update']);router[_0x5c3b('0x1e')](_0x5c3b('0x1d'),auth[_0x5c3b('0x9')](),controller[_0x5c3b('0x1e')]);module[_0x5c3b('0x1f')]=router; \ No newline at end of file +var _0x008c=['/:id','/:id/download','join','root','server/files/plugins','originalname','format','basename','extname','now','single','file','upload','post','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet'];(function(_0x3e1378,_0x29087a){var _0x1d56ee=function(_0xa97e1b){while(--_0xa97e1b){_0x3e1378['push'](_0x3e1378['shift']());}};_0x1d56ee(++_0x29087a);}(_0x008c,0x188));var _0xc008=function(_0x117f85,_0x5afa65){_0x117f85=_0x117f85-0x0;var _0x1c61a7=_0x008c[_0x117f85];return _0x1c61a7;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/webhook',controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc008('0xa')](_0xc008('0xf'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eacfa,_0xc881aa,_0x5b2004){_0x5b2004(null,path[_0xc008('0x10')](config[_0xc008('0x11')],_0xc008('0x12')));},'filename':function(_0x2a5b4e,_0x9ffa93,_0x1819c6){_0x9ffa93[_0xc008('0x13')]=_0x9ffa93['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1819c6(null,util[_0xc008('0x14')]('%s-%s%s',path[_0xc008('0x15')](_0x9ffa93[_0xc008('0x13')],path[_0xc008('0x16')](_0x9ffa93[_0xc008('0x13')])),Date[_0xc008('0x17')](),path['extname'](_0x9ffa93['originalname'])));}})});router['post']('/',upload[_0xc008('0x18')](_0xc008('0x19')),controller[_0xc008('0x1a')]);router[_0xc008('0x1b')]('/webhook',controller['webhookPost']);router['put']('/:id',auth[_0xc008('0xb')](),controller[_0xc008('0x1c')]);router['delete'](_0xc008('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 9cfcde6..b459093 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 _0x36f2=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','never','sequelize','exports','STRING','ENUM','html'];(function(_0x288a46,_0x1ab040){var _0x22be9e=function(_0x17c7d1){while(--_0x17c7d1){_0x288a46['push'](_0x288a46['shift']());}};_0x22be9e(++_0x1ab040);}(_0x36f2,0x8b));var _0x236f=function(_0x2e3d48,_0x13db86){_0x2e3d48=_0x2e3d48-0x0;var _0x2ca452=_0x36f2[_0x2e3d48];return _0x2ca452;};'use strict';var Sequelize=require(_0x236f('0x0'));module[_0x236f('0x1')]={'name':{'type':Sequelize[_0x236f('0x2')]},'type':{'type':Sequelize[_0x236f('0x3')](_0x236f('0x4'),_0x236f('0x5'))},'description':{'type':Sequelize[_0x236f('0x6')]},'version':{'type':Sequelize[_0x236f('0x6')]},'path':{'type':Sequelize[_0x236f('0x2')],'comment':_0x236f('0x7')},'active':{'type':Sequelize[_0x236f('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x236f('0x3')]('adminOnly',_0x236f('0x9'),_0x236f('0xa'),_0x236f('0xb')),'defaultValue':_0x236f('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x236f('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x236f('0x2')]}}; \ No newline at end of file +var _0x5bad=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always'];(function(_0x5a74e0,_0x22fcea){var _0x4c1030=function(_0x2f3059){while(--_0x2f3059){_0x5a74e0['push'](_0x5a74e0['shift']());}};_0x4c1030(++_0x22fcea);}(_0x5bad,0xfd));var _0xd5ba=function(_0x295441,_0x5c5b3a){_0x295441=_0x295441-0x0;var _0x17c98c=_0x5bad[_0x295441];return _0x17c98c;};'use strict';var Sequelize=require(_0xd5ba('0x0'));module[_0xd5ba('0x1')]={'name':{'type':Sequelize[_0xd5ba('0x2')]},'type':{'type':Sequelize[_0xd5ba('0x3')]('html','script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xd5ba('0x2')],'comment':_0xd5ba('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd5ba('0x5')},'sidebar':{'type':Sequelize[_0xd5ba('0x3')]('adminOnly',_0xd5ba('0x6'),_0xd5ba('0x7'),'never'),'defaultValue':_0xd5ba('0x7'),'comment':_0xd5ba('0x8')},'icon':{'type':Sequelize[_0xd5ba('0x2')]},'adminUrl':{'type':Sequelize[_0xd5ba('0x2')]},'agentUrl':{'type':Sequelize[_0xd5ba('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xd5ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 982ff1b..98070c4 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 _0x2f0d=['set','statusCode','sendStatus','webhookPost','method','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','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','download','find','join','root','format','%s.zip','basename','createWriteStream','code','Error','Sequelize','pipe','glob','**/*','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','admin','test','plugins','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x2f0d,0x167));var _0xd2f0=function(_0x51ab2b,_0x3b00d1){_0x51ab2b=_0x51ab2b-0x0;var _0x1b3d5f=_0x2f0d[_0x51ab2b];return _0x1b3d5f;};'use strict';var emlformat=require(_0xd2f0('0x0'));var rimraf=require(_0xd2f0('0x1'));var zipdir=require(_0xd2f0('0x2'));var jsonpatch=require(_0xd2f0('0x3'));var rp=require(_0xd2f0('0x4'));var moment=require(_0xd2f0('0x5'));var BPromise=require(_0xd2f0('0x6'));var Mustache=require(_0xd2f0('0x7'));var util=require(_0xd2f0('0x8'));var path=require(_0xd2f0('0x9'));var sox=require(_0xd2f0('0xa'));var csv=require(_0xd2f0('0xb'));var ejs=require(_0xd2f0('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd2f0('0xd'));var squel=require(_0xd2f0('0xe'));var crypto=require(_0xd2f0('0xf'));var jsforce=require(_0xd2f0('0x10'));var deskjs=require(_0xd2f0('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd2f0('0x12'));var Papa=require(_0xd2f0('0x13'));var extract=require(_0xd2f0('0x14'));var rimraf=require(_0xd2f0('0x1'));var archiver=require(_0xd2f0('0x15'));var Redis=require(_0xd2f0('0x16'));var authService=require(_0xd2f0('0x17'));var qs=require(_0xd2f0('0x18'));var as=require(_0xd2f0('0x19'));var hardwareService=require(_0xd2f0('0x1a'));var logger=require(_0xd2f0('0x1b'))('api');var utils=require(_0xd2f0('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0xd2f0('0x1d'));var db=require(_0xd2f0('0x1e'))['db'];config[_0xd2f0('0x1f')]=_[_0xd2f0('0x20')](config[_0xd2f0('0x1f')],{'host':_0xd2f0('0x21'),'port':0x18eb});var socket=require(_0xd2f0('0x22'))(new Redis(config[_0xd2f0('0x1f')]));require(_0xd2f0('0x23'))[_0xd2f0('0x24')](socket);function respondWithStatusCode(_0x305ab8,_0x288a85){_0x288a85=_0x288a85||0xcc;return function(_0x447107){if(_0x447107){return _0x305ab8['sendStatus'](_0x288a85);}return _0x305ab8[_0xd2f0('0x25')](_0x288a85)['end']();};}function respondWithResult(_0x48b7db,_0x245949){_0x245949=_0x245949||0xc8;return function(_0x47ab68){if(_0x47ab68){return _0x48b7db[_0xd2f0('0x25')](_0x245949)[_0xd2f0('0x26')](_0x47ab68);}};}function respondWithFilteredResult(_0x161dd5,_0x9ab5e1){return function(_0x3b5584){if(_0x3b5584){var _0x8eec31=typeof _0x9ab5e1[_0xd2f0('0x27')]===_0xd2f0('0x28')&&typeof _0x9ab5e1[_0xd2f0('0x29')]===_0xd2f0('0x28');var _0x565401=_0x3b5584[_0xd2f0('0x2a')];var _0x17e871=_0x8eec31?0x0:_0x9ab5e1[_0xd2f0('0x27')];var _0x4ae8a1=_0x8eec31?_0x3b5584[_0xd2f0('0x2a')]:_0x9ab5e1[_0xd2f0('0x27')]+_0x9ab5e1[_0xd2f0('0x29')];var _0x59ff1f;if(_0x4ae8a1>=_0x565401){_0x4ae8a1=_0x565401;_0x59ff1f=0xc8;}else{_0x59ff1f=0xce;}_0x161dd5[_0xd2f0('0x25')](_0x59ff1f);return _0x161dd5['set']('Content-Range',_0x17e871+'-'+_0x4ae8a1+'/'+_0x565401)[_0xd2f0('0x26')](_0x3b5584);}return null;};}function patchUpdates(_0x3a3371){return function(_0x50caf9){try{jsonpatch[_0xd2f0('0x2b')](_0x50caf9,_0x3a3371,!![]);}catch(_0x4054f2){return BPromise['reject'](_0x4054f2);}return _0x50caf9[_0xd2f0('0x2c')]();};}function saveUpdates(_0x40a634,_0x3e91ba){return function(_0x1f1de2){if(_0x1f1de2){return _0x1f1de2[_0xd2f0('0x2d')](_0x40a634)[_0xd2f0('0x2e')](function(_0x311cb0){return _0x311cb0;});}return null;};}function removeEntity(_0x7eb334,_0x527f30){return function(_0x41522f){if(_0x41522f){return _0x41522f[_0xd2f0('0x2f')]()[_0xd2f0('0x2e')](function(){var _0x262972=_0x41522f['get']({'plain':!![]});var _0x4b347e='Plugins';return db[_0xd2f0('0x30')][_0xd2f0('0x2f')]({'where':{'type':_0x4b347e,'resourceId':_0x262972['id']}})[_0xd2f0('0x2e')](function(){return _0x41522f;});})['then'](function(){_0x7eb334[_0xd2f0('0x25')](0xcc)[_0xd2f0('0x31')]();});}};}function handleEntityNotFound(_0x20d405,_0x1be07b){return function(_0x28881d){if(!_0x28881d){_0x20d405['sendStatus'](0x194);}return _0x28881d;};}function handleError(_0x2710a8,_0x23d186){_0x23d186=_0x23d186||0x1f4;return function(_0x4ca25b){logger[_0xd2f0('0x32')](_0x4ca25b[_0xd2f0('0x33')]);if(_0x4ca25b[_0xd2f0('0x34')]){delete _0x4ca25b[_0xd2f0('0x34')];}_0x2710a8['status'](_0x23d186)[_0xd2f0('0x35')](_0x4ca25b);};}exports[_0xd2f0('0x36')]=function(_0xe03b27,_0x583b39){var _0x3b0fe1={},_0x5903ae={},_0xa3d73c={'count':0x0,'rows':[]};var _0x18c403=_['map'](db[_0xd2f0('0x37')][_0xd2f0('0x38')],function(_0x5dd640){return{'name':_0x5dd640[_0xd2f0('0x39')],'type':_0x5dd640[_0xd2f0('0x3a')][_0xd2f0('0x3b')]};});_0x5903ae[_0xd2f0('0x3c')]=_[_0xd2f0('0x3d')](_0x18c403,'name');_0x5903ae[_0xd2f0('0x3e')]=_[_0xd2f0('0x3f')](_0xe03b27[_0xd2f0('0x3e')]);_0x5903ae[_0xd2f0('0x40')]=_[_0xd2f0('0x41')](_0x5903ae[_0xd2f0('0x3c')],_0x5903ae['query']);_0x3b0fe1[_0xd2f0('0x42')]=_[_0xd2f0('0x41')](_0x5903ae['model'],qs[_0xd2f0('0x43')](_0xe03b27[_0xd2f0('0x3e')][_0xd2f0('0x43')]));_0x3b0fe1[_0xd2f0('0x42')]=_0x3b0fe1[_0xd2f0('0x42')][_0xd2f0('0x44')]?_0x3b0fe1[_0xd2f0('0x42')]:_0x5903ae['model'];if(!_0xe03b27[_0xd2f0('0x3e')][_0xd2f0('0x45')](_0xd2f0('0x46'))){_0x3b0fe1[_0xd2f0('0x29')]=qs[_0xd2f0('0x29')](_0xe03b27['query']['limit']);_0x3b0fe1[_0xd2f0('0x27')]=qs['offset'](_0xe03b27[_0xd2f0('0x3e')][_0xd2f0('0x27')]);}_0x3b0fe1[_0xd2f0('0x47')]=qs[_0xd2f0('0x48')](_0xe03b27['query'][_0xd2f0('0x48')]);_0x3b0fe1['where']=qs[_0xd2f0('0x40')](_[_0xd2f0('0x49')](_0xe03b27['query'],_0x5903ae['filters']),_0x18c403);if(_0xe03b27[_0xd2f0('0x3e')]['filter']){_0x3b0fe1[_0xd2f0('0x4a')]=_['merge'](_0x3b0fe1[_0xd2f0('0x4a')],{'$or':_[_0xd2f0('0x3d')](_0x18c403,function(_0x50a86a){if(_0x50a86a['type']!==_0xd2f0('0x4b')){var _0x31d683={};_0x31d683[_0x50a86a[_0xd2f0('0x34')]]={'$like':'%'+_0xe03b27['query'][_0xd2f0('0x4c')]+'%'};return _0x31d683;}})});}_0x3b0fe1=_[_0xd2f0('0x4d')]({},_0x3b0fe1,_0xe03b27[_0xd2f0('0x4e')]);var _0x42c8ba={'where':_0x3b0fe1[_0xd2f0('0x4a')]};return db[_0xd2f0('0x37')][_0xd2f0('0x2a')](_0x42c8ba)[_0xd2f0('0x2e')](function(_0x46ca35){_0xa3d73c[_0xd2f0('0x2a')]=_0x46ca35;if(_0xe03b27[_0xd2f0('0x3e')][_0xd2f0('0x4f')]){_0x3b0fe1['include']=[{'all':!![]}];}return db['Plugin']['findAll'](_0x3b0fe1);})[_0xd2f0('0x2e')](function(_0x1619ae){_0xa3d73c[_0xd2f0('0x50')]=_0x1619ae;return _0xa3d73c;})[_0xd2f0('0x2e')](respondWithFilteredResult(_0x583b39,_0x3b0fe1))[_0xd2f0('0x51')](handleError(_0x583b39,null));};exports[_0xd2f0('0x52')]=function(_0x22faa5,_0x12cb31){var _0x578cd1={'raw':!![],'where':{'id':_0x22faa5[_0xd2f0('0x53')]['id']}},_0x5354ff={};_0x5354ff['model']=_[_0xd2f0('0x3f')](db[_0xd2f0('0x37')][_0xd2f0('0x38')]);_0x5354ff[_0xd2f0('0x3e')]=_['keys'](_0x22faa5['query']);_0x5354ff[_0xd2f0('0x40')]=_['intersection'](_0x5354ff[_0xd2f0('0x3c')],_0x5354ff[_0xd2f0('0x3e')]);_0x578cd1[_0xd2f0('0x42')]=_['intersection'](_0x5354ff[_0xd2f0('0x3c')],qs[_0xd2f0('0x43')](_0x22faa5[_0xd2f0('0x3e')]['fields']));_0x578cd1['attributes']=_0x578cd1[_0xd2f0('0x42')][_0xd2f0('0x44')]?_0x578cd1['attributes']:_0x5354ff[_0xd2f0('0x3c')];if(_0x22faa5[_0xd2f0('0x3e')]['includeAll']){_0x578cd1['include']=[{'all':!![]}];}_0x578cd1=_[_0xd2f0('0x4d')]({},_0x578cd1,_0x22faa5['options']);return db[_0xd2f0('0x37')]['find'](_0x578cd1)[_0xd2f0('0x2e')](handleEntityNotFound(_0x12cb31,null))['then'](respondWithResult(_0x12cb31,null))[_0xd2f0('0x51')](handleError(_0x12cb31,null));};exports[_0xd2f0('0x54')]=function(_0x1ebefa,_0x23bf03,_0x9d3e25){return db[_0xd2f0('0x37')][_0xd2f0('0x55')]({'where':{'id':_0x1ebefa[_0xd2f0('0x53')]['id']},'attributes':[_0xd2f0('0x34'),_0xd2f0('0x9')],'raw':!![]})['then'](handleEntityNotFound(_0x23bf03,null))[_0xd2f0('0x2e')](function(_0x4a281d){if(_0x4a281d){var _0x4756b1=path[_0xd2f0('0x56')](config[_0xd2f0('0x57')],'server/files/plugins',util[_0xd2f0('0x58')](_0xd2f0('0x59'),path[_0xd2f0('0x5a')](_0x4a281d['path'])));var _0x4f29ff=fs[_0xd2f0('0x5b')](_0x4756b1);var _0x39dbf3=archiver('zip',{'zlib':{'level':0x9}});_0x39dbf3['on']('warning',function(_0x255c79){if(_0x255c79[_0xd2f0('0x5c')]==='ENOENT'){logger['error'](_0x255c79);}else{throw new db['Sequelize'][(_0xd2f0('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x39dbf3['on']('error',function(_0x5b3b06){throw new db[(_0xd2f0('0x5e'))][(_0xd2f0('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x39dbf3[_0xd2f0('0x5f')](_0x4f29ff);_0x39dbf3[_0xd2f0('0x60')](_0xd2f0('0x61'),{'cwd':path['join'](config[_0xd2f0('0x57')],_0xd2f0('0x62'),path[_0xd2f0('0x63')](_0x4a281d['path'])),'ignore':[path[_0xd2f0('0x56')](path['basename'](_0x4a281d['path']),_0xd2f0('0x64')),path['join'](path[_0xd2f0('0x5a')](_0x4a281d[_0xd2f0('0x9')]),_0xd2f0('0x65'))],'nodir':!![]})[_0xd2f0('0x66')]();_0x4f29ff['on'](_0xd2f0('0x67'),function(){if(!fs['existsSync'](_0x4756b1)){throw new db['Sequelize'][(_0xd2f0('0x5d'))]('Plugin\x20not\x20found');}return _0x23bf03['download'](_0x4756b1,util[_0xd2f0('0x58')](_0xd2f0('0x59'),path[_0xd2f0('0x5a')](_0x4a281d[_0xd2f0('0x9')])),function(_0x418b5c){if(_0x418b5c){throw new db[(_0xd2f0('0x5e'))][(_0xd2f0('0x5d'))](_0xd2f0('0x68'));}fs['unlinkSync'](_0x4756b1);logger[_0xd2f0('0x69')]('Download\x20completed');logger[_0xd2f0('0x69')](_0xd2f0('0x6a'));});});}return null;})[_0xd2f0('0x51')](handleError(_0x23bf03,null));};exports[_0xd2f0('0x6b')]=function(_0x362d6f,_0x5819ef,_0x5e0215){var _0x1a3bc5=path[_0xd2f0('0x5a')](_0x362d6f[_0xd2f0('0x6c')][_0xd2f0('0x6d')],path[_0xd2f0('0x6e')](_0x362d6f['file']['filename']));var _0x4ff637=path[_0xd2f0('0x56')](config['root'],_0xd2f0('0x62'),_0x362d6f[_0xd2f0('0x6c')][_0xd2f0('0x6d')]);var _0x18f216=path['join'](config[_0xd2f0('0x57')],_0xd2f0('0x62'),_0x1a3bc5);logger[_0xd2f0('0x69')](_0xd2f0('0x6f'),_0x4ff637);logger['info'](_0xd2f0('0x70'),_0x18f216);try{fs[_0xd2f0('0x71')](_0x4ff637,parseInt(_0xd2f0('0x72'),0x8));extract(_0x4ff637,{'dir':_0x18f216},function(_0x404001){if(_0x404001){logger[_0xd2f0('0x32')](_0x404001);handleError(_0x404001,!![]);};var _0x5a0be1=fs[_0xd2f0('0x73')](_0x18f216);if(_0x5a0be1['length']>0x1){removeReferences(_0x4ff637,_0x18f216);logger['error']('Invalid\x20plugin\x20structure');return _0x5e0215(new Error(_0xd2f0('0x74')));}var _0x5205c3=fs[_0xd2f0('0x75')](path[_0xd2f0('0x56')](_0x18f216,_0x5a0be1[0x0]));if(_0x5205c3[_0xd2f0('0x76')]()){removeReferences(_0x4ff637,_0x18f216);logger[_0xd2f0('0x32')](_0xd2f0('0x74'));return _0x5e0215(new Error('Invalid\x20plugin\x20structure'));}if(_0x5205c3[_0xd2f0('0x77')]()){var _0x533067=fs[_0xd2f0('0x73')](path[_0xd2f0('0x56')](_0x18f216,_0x5a0be1[0x0]));if(_0x533067['length']===0x0){removeReferences(_0x4ff637,_0x18f216);logger[_0xd2f0('0x32')](_0xd2f0('0x74'));return _0x5e0215(new Error(_0xd2f0('0x74')));}var _0x509106=_0x533067[_0xd2f0('0x78')](function(_0x122250){return _0x122250===_0xd2f0('0x79');});if(!_0x509106){return _0x5e0215(new Error(_0xd2f0('0x7a')));}var _0x4810d5=fs[_0xd2f0('0x7b')](path[_0xd2f0('0x56')](_0x18f216,_0x5a0be1[0x0],_0xd2f0('0x79')));var _0x368c12=JSON['parse'](_0x4810d5);if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x34')]){return _0x5e0215(new Error(_0xd2f0('0x7c')));}if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x3a')]){return _0x5e0215(new Error(_0xd2f0('0x7d')));}if('undefined'==typeof _0x368c12[_0xd2f0('0x7e')]){return _0x5e0215(new Error(_0xd2f0('0x7f')));}if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x80')]){return _0x5e0215(new Error(_0xd2f0('0x81')));}if(_0x368c12[_0xd2f0('0x3a')]===_0xd2f0('0x82')){if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x80')]['views']){return _0x5e0215(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x368c12[_0xd2f0('0x80')]['views']['admin']&&_0xd2f0('0x28')==typeof _0x368c12['parameters'][_0xd2f0('0x83')][_0xd2f0('0x84')]){return _0x5e0215(new Error(_0xd2f0('0x85')));}}else if(_0x368c12['type']===_0xd2f0('0x86')){if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x87')]){return _0x5e0215(new Error(_0xd2f0('0x88')));}if(_0xd2f0('0x28')==typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x89')]){return _0x5e0215(new Error(_0xd2f0('0x8a')));}}else{return _0x5e0215(new Error(_0xd2f0('0x8b')));}var _0x2faf37=_0x368c12[_0xd2f0('0x34')];var _0x40db8e=_0x368c12[_0xd2f0('0x8c')];var _0x55dcc2=_0x368c12[_0xd2f0('0x3a')];var _0x2b05da=_0x368c12[_0xd2f0('0x8d')]?_0x368c12[_0xd2f0('0x8d')]:_0xd2f0('0x8e');var _0x32d6c4=_0x368c12['icon']?_0x368c12[_0xd2f0('0x8f')]:'icon-apps';var _0x3fd371='';var _0x204697='';var _0x3189a6='';var _0x67bc23='';var _0x172e29=_0x368c12[_0xd2f0('0x7e')];if(_0x55dcc2===_0xd2f0('0x82')){if(_0xd2f0('0x28')!=typeof _0x368c12[_0xd2f0('0x80')]['views'][_0xd2f0('0x90')]){var _0x43b444=_0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd2f0('0x91')](_0x43b444)){_0x3fd371=path[_0xd2f0('0x56')]('plugins',_0x1a3bc5,_0x5a0be1[0x0],_0x43b444);}else{_0x3fd371=_0x43b444;}}else{logger[_0xd2f0('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xd2f0('0x28')!=typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]['agent']){var _0x1bf085=_0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')][_0xd2f0('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xd2f0('0x91')](_0x1bf085)){_0x204697=path[_0xd2f0('0x56')](_0xd2f0('0x92'),_0x1a3bc5,_0x5a0be1[0x0],_0x1bf085);}else{_0x204697=_0x1bf085;}}else{logger[_0xd2f0('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x55dcc2===_0xd2f0('0x86')){_0x3189a6=_0x368c12['parameters']['scriptName'];_0x67bc23=_0x368c12[_0xd2f0('0x80')][_0xd2f0('0x89')];if('undefined'!=typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]){if(_0xd2f0('0x28')!=typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]['admin']){var _0x43b444=_0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd2f0('0x91')](_0x43b444)){_0x3fd371=path[_0xd2f0('0x56')](_0xd2f0('0x92'),_0x1a3bc5,_0x5a0be1[0x0],_0x43b444);}else{_0x3fd371=_0x43b444;}}if(_0xd2f0('0x28')!=typeof _0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')][_0xd2f0('0x84')]){var _0x1bf085=_0x368c12[_0xd2f0('0x80')][_0xd2f0('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd2f0('0x91')](_0x1bf085)){_0x204697=path[_0xd2f0('0x56')](_0xd2f0('0x92'),_0x1a3bc5,_0x5a0be1[0x0],_0x1bf085);}else{_0x204697=_0x1bf085;}}}}var _0x41e18d={'name':_0x2faf37,'description':_0x40db8e,'path':path[_0xd2f0('0x56')](_0x1a3bc5,_0x5a0be1[0x0]),'type':_0x55dcc2,'sidebar':_0x2b05da,'icon':_0x32d6c4,'adminUrl':_0x3fd371,'agentUrl':_0x204697,'scriptName':_0x3189a6,'scriptPath':_0x67bc23,'version':_0x172e29};removeReferences(_0x4ff637,null);return db[_0xd2f0('0x37')]['create'](_0x41e18d)[_0xd2f0('0x2e')](function(_0x1b9581){var _0x2363dc={'role':_0x362d6f[_0xd2f0('0x93')][_0xd2f0('0x94')],'userProfileId':_0x362d6f['body'][_0xd2f0('0x95')]};if(!_0x2363dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2363dc[_0xd2f0('0x94')]===_0xd2f0('0x96')){var _0x231d14=_0x1b9581[_0xd2f0('0x97')]({'plain':!![]});return db[_0xd2f0('0x98')][_0xd2f0('0x55')]({'where':{'name':'Plugins','userProfileId':_0x2363dc['userProfileId']},'raw':!![]})['then'](function(_0x32e224){if(_0x32e224&&_0x32e224[_0xd2f0('0x99')]===0x0){return db['UserProfileResource'][_0xd2f0('0x9a')]({'name':_0x231d14[_0xd2f0('0x34')],'resourceId':_0x231d14['id'],'type':_0x32e224[_0xd2f0('0x34')],'sectionId':_0x32e224['id']},{})['then'](function(){return _0x1b9581;});}else{return _0x1b9581;}})[_0xd2f0('0x51')](function(_0x50a3ff){logger[_0xd2f0('0x32')](_0xd2f0('0x9b'),_0x50a3ff);throw _0x50a3ff;});}return _0x1b9581;})[_0xd2f0('0x2e')](respondWithResult(_0x5819ef,null))['catch'](handleError(_0x5819ef,null));}});}catch(_0x3e3df8){_0x5819ef[_0xd2f0('0x25')](0x1f4)['send'](_0x3e3df8);}};function removeReferences(_0xdf9200,_0x2d9560){try{if(_0xdf9200){fs[_0xd2f0('0x9c')](_0xdf9200);logger[_0xd2f0('0x69')](_0xd2f0('0x9d'));}if(_0x2d9560){rimraf(_0x2d9560,function(){});logger[_0xd2f0('0x69')](_0xd2f0('0x9e'));}}catch(_0x2a9b63){logger[_0xd2f0('0x32')](_0x2a9b63);}}exports[_0xd2f0('0x2d')]=function(_0x490f38,_0x1d7607,_0x3df485){return db['Plugin'][_0xd2f0('0x55')]({'where':{'id':_0x490f38[_0xd2f0('0x53')]['id']}})[_0xd2f0('0x2e')](handleEntityNotFound(_0x1d7607,null))[_0xd2f0('0x2e')](saveUpdates(_0x490f38['body'],null))[_0xd2f0('0x2e')](respondWithResult(_0x1d7607,null))[_0xd2f0('0x51')](handleError(_0x1d7607,null));};exports[_0xd2f0('0x9f')]=function(_0x2ff898,_0x166a49,_0x53f0d3){return db['Plugin'][_0xd2f0('0x55')]({'where':{'id':_0x2ff898[_0xd2f0('0x53')]['id']}})['then'](function(_0x5759a6){if(_0x5759a6){return _0x5759a6[_0xd2f0('0x2f')]();}})['then'](function(_0x59aa59){rimraf(path[_0xd2f0('0x56')](config[_0xd2f0('0x57')],'server/files/plugins',path['dirname'](_0x59aa59[_0xd2f0('0x9')])),function(){});return _0x59aa59;})[_0xd2f0('0x2e')](handleEntityNotFound(_0x166a49,null))[_0xd2f0('0x2e')](respondWithStatusCode(_0x166a49,null))[_0xd2f0('0x51')](handleError(_0x166a49,null));};exports[_0xd2f0('0xa0')]=function(_0x59c882,_0x1f8785,_0x5eed50){return BPromise[_0xd2f0('0xa1')]()['then'](function(){if(!_0x59c882[_0xd2f0('0x3e')]['path']){throw new Error(_0xd2f0('0xa2'));}if(!_0x59c882[_0xd2f0('0x3e')][_0xd2f0('0xa3')]){throw new Error(_0xd2f0('0xa4'));}var _0xfccedf=_0x59c882['query'][_0xd2f0('0xa5')]?_0x59c882['query'][_0xd2f0('0xa5')]+':'+_0x59c882['query']['port']:_0xd2f0('0xa6')+_0x59c882[_0xd2f0('0x3e')][_0xd2f0('0xa3')];var _0x50d3e3=_0x59c882[_0xd2f0('0x3e')][_0xd2f0('0x26')]?_0x59c882[_0xd2f0('0x3e')][_0xd2f0('0x26')]:!![];var _0x499bf1=_0x59c882['query'][_0xd2f0('0xa7')]?_0x59c882[_0xd2f0('0x3e')]['encoding']:null;var _0x3aeca0={'method':_0x59c882['method'],'uri':util[_0xd2f0('0x58')](_0xd2f0('0xa8'),_0xfccedf,_0x59c882[_0xd2f0('0x3e')]['path']),'json':_0x50d3e3,'resolveWithFullResponse':!![],'encoding':_0x499bf1,'qs':_0x59c882['query']};if(_0x59c882[_0xd2f0('0xa9')]){_0x3aeca0['headers']=_0x59c882[_0xd2f0('0xa9')];if(_0x3aeca0['headers'][_0xd2f0('0xaa')]){delete _0x3aeca0[_0xd2f0('0xa9')][_0xd2f0('0xaa')];}}if(_0x3aeca0[_0xd2f0('0xa9')][_0xd2f0('0xab')]){delete _0x3aeca0['headers'][_0xd2f0('0xab')];}return rp(_0x3aeca0);})[_0xd2f0('0x2e')](function(_0x34521a){if(_0x34521a){_0x1f8785[_0xd2f0('0xac')](_0x34521a[_0xd2f0('0xa9')]);logger['info'](_0x34521a['body']);if(_['endsWith'](_0x59c882['query'][_0xd2f0('0x9')],_0xd2f0('0x54'))&&_0x34521a[_0xd2f0('0xad')]==0x1f4){return _0x1f8785[_0xd2f0('0xae')](_0x34521a[_0xd2f0('0xad')]);}else{return _0x1f8785[_0xd2f0('0x25')](_0x34521a['statusCode'])['send'](_0x34521a[_0xd2f0('0x93')]);}}else{return _0x1f8785[_0xd2f0('0xae')](0xc8);}})[_0xd2f0('0x51')](handleError(_0x1f8785,null));};exports[_0xd2f0('0xaf')]=function(_0x4dd47c,_0x33848a,_0x245448){return BPromise[_0xd2f0('0xa1')]()['then'](function(){if(!_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4dd47c['query'][_0xd2f0('0xa3')]){throw new Error(_0xd2f0('0xa4'));}var _0x4340a8=_0x4dd47c[_0xd2f0('0x3e')]['hostname']?_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0xa5')]+':'+_0x4dd47c[_0xd2f0('0x3e')]['port']:_0xd2f0('0xa6')+_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0xa3')];var _0x5b7594=_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0x26')]?_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0x26')]:!![];var _0x1705df=_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0xa7')]?_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0xa7')]:null;var _0x47ca54={'method':_0x4dd47c[_0xd2f0('0xb0')],'uri':util['format']('%s%s',_0x4340a8,_0x4dd47c[_0xd2f0('0x3e')][_0xd2f0('0x9')]),'json':_0x5b7594,'resolveWithFullResponse':!![],'encoding':_0x1705df,'body':_0x4dd47c[_0xd2f0('0x93')]};if(_0x4dd47c[_0xd2f0('0xa9')]){_0x47ca54[_0xd2f0('0xa9')]=_0x4dd47c[_0xd2f0('0xa9')];if(_0x47ca54[_0xd2f0('0xa9')][_0xd2f0('0xaa')]){delete _0x47ca54[_0xd2f0('0xa9')][_0xd2f0('0xaa')];}}if(_0x47ca54[_0xd2f0('0xa9')][_0xd2f0('0xab')]){delete _0x47ca54[_0xd2f0('0xa9')]['content-type'];}return rp(_0x47ca54);})[_0xd2f0('0x2e')](function(_0x39f4a3){if(_0x39f4a3){_0x33848a[_0xd2f0('0xac')](_0x39f4a3[_0xd2f0('0xa9')]);logger[_0xd2f0('0x69')](_0x39f4a3[_0xd2f0('0x93')]);return _0x33848a[_0xd2f0('0x25')](_0x39f4a3['statusCode'])['send'](_0x39f4a3[_0xd2f0('0x93')]);}else{return _0x33848a[_0xd2f0('0xae')](0xc8);}})[_0xd2f0('0x51')](handleError(_0x33848a,null));}; \ No newline at end of file +var _0xc3f7=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','Plugins','end','sendStatus','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','Plugin','findAll','rows','show','options','find','download','params','format','%s.zip','basename','path','zip','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','**/*','join','root','server/files/plugins','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','catch','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','user','UserProfileSection','userProfileId','UserProfileResource','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','extract-zip'];(function(_0x160f3c,_0x3c6257){var _0x2e2b78=function(_0x50bed8){while(--_0x50bed8){_0x160f3c['push'](_0x160f3c['shift']());}};_0x2e2b78(++_0x3c6257);}(_0xc3f7,0x9b));var _0x7c3f=function(_0x4a6ee7,_0x19ff8a){_0x4a6ee7=_0x4a6ee7-0x0;var _0x2a672b=_0xc3f7[_0x4a6ee7];return _0x2a672b;};'use strict';var emlformat=require(_0x7c3f('0x0'));var rimraf=require(_0x7c3f('0x1'));var zipdir=require(_0x7c3f('0x2'));var jsonpatch=require(_0x7c3f('0x3'));var rp=require('request-promise');var moment=require(_0x7c3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7c3f('0x5'));var util=require(_0x7c3f('0x6'));var path=require('path');var sox=require(_0x7c3f('0x7'));var csv=require(_0x7c3f('0x8'));var ejs=require(_0x7c3f('0x9'));var fs=require('fs');var fs_extra=require(_0x7c3f('0xa'));var _=require(_0x7c3f('0xb'));var squel=require(_0x7c3f('0xc'));var crypto=require(_0x7c3f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c3f('0xe'));var Papa=require('papaparse');var extract=require(_0x7c3f('0xf'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x7c3f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7c3f('0x11'));var as=require(_0x7c3f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c3f('0x13'))(_0x7c3f('0x14'));var utils=require(_0x7c3f('0x15'));var config=require(_0x7c3f('0x16'));var licenseUtil=require(_0x7c3f('0x17'));var db=require(_0x7c3f('0x18'))['db'];config[_0x7c3f('0x19')]=_[_0x7c3f('0x1a')](config[_0x7c3f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c3f('0x1b'))(new Redis(config[_0x7c3f('0x19')]));require(_0x7c3f('0x1c'))[_0x7c3f('0x1d')](socket);function respondWithStatusCode(_0x2259ed,_0x58c8af){_0x58c8af=_0x58c8af||0xcc;return function(_0x4d4e6e){if(_0x4d4e6e){return _0x2259ed['sendStatus'](_0x58c8af);}return _0x2259ed[_0x7c3f('0x1e')](_0x58c8af)['end']();};}function respondWithResult(_0x59ffd0,_0x5b8a41){_0x5b8a41=_0x5b8a41||0xc8;return function(_0xd5f35){if(_0xd5f35){return _0x59ffd0[_0x7c3f('0x1e')](_0x5b8a41)[_0x7c3f('0x1f')](_0xd5f35);}};}function respondWithFilteredResult(_0x1e36be,_0x5db217){return function(_0x319ac6){if(_0x319ac6){var _0x48b2ea=typeof _0x5db217['offset']===_0x7c3f('0x20')&&typeof _0x5db217[_0x7c3f('0x21')]===_0x7c3f('0x20');var _0x21c05a=_0x319ac6[_0x7c3f('0x22')];var _0x51bd8a=_0x48b2ea?0x0:_0x5db217[_0x7c3f('0x23')];var _0x45e127=_0x48b2ea?_0x319ac6['count']:_0x5db217[_0x7c3f('0x23')]+_0x5db217[_0x7c3f('0x21')];var _0x5c53d2;if(_0x45e127>=_0x21c05a){_0x45e127=_0x21c05a;_0x5c53d2=0xc8;}else{_0x5c53d2=0xce;}_0x1e36be[_0x7c3f('0x1e')](_0x5c53d2);return _0x1e36be[_0x7c3f('0x24')]('Content-Range',_0x51bd8a+'-'+_0x45e127+'/'+_0x21c05a)[_0x7c3f('0x1f')](_0x319ac6);}return null;};}function patchUpdates(_0x5aff55){return function(_0x5df574){try{jsonpatch[_0x7c3f('0x25')](_0x5df574,_0x5aff55,!![]);}catch(_0x1f573d){return BPromise['reject'](_0x1f573d);}return _0x5df574[_0x7c3f('0x26')]();};}function saveUpdates(_0x36c84a,_0x1978fa){return function(_0x33a765){if(_0x33a765){return _0x33a765[_0x7c3f('0x27')](_0x36c84a)[_0x7c3f('0x28')](function(_0x362659){return _0x362659;});}return null;};}function removeEntity(_0x2de6e4,_0x251d4f){return function(_0x2ad921){if(_0x2ad921){return _0x2ad921[_0x7c3f('0x29')]()['then'](function(){var _0x7026e7=_0x2ad921[_0x7c3f('0x2a')]({'plain':!![]});var _0x3496dc=_0x7c3f('0x2b');return db['UserProfileResource'][_0x7c3f('0x29')]({'where':{'type':_0x3496dc,'resourceId':_0x7026e7['id']}})['then'](function(){return _0x2ad921;});})[_0x7c3f('0x28')](function(){_0x2de6e4['status'](0xcc)[_0x7c3f('0x2c')]();});}};}function handleEntityNotFound(_0x5387a7,_0x23a33c){return function(_0x1931b1){if(!_0x1931b1){_0x5387a7[_0x7c3f('0x2d')](0x194);}return _0x1931b1;};}function handleError(_0x37c22f,_0x5bb927){_0x5bb927=_0x5bb927||0x1f4;return function(_0x30934d){logger[_0x7c3f('0x2e')](_0x30934d['stack']);if(_0x30934d[_0x7c3f('0x2f')]){delete _0x30934d[_0x7c3f('0x2f')];}_0x37c22f[_0x7c3f('0x1e')](_0x5bb927)[_0x7c3f('0x30')](_0x30934d);};}exports['index']=function(_0x45730a,_0x4e4d48){var _0x2d717f={},_0x1e620b={},_0x9203ee={'count':0x0,'rows':[]};var _0xde3b7a=_[_0x7c3f('0x31')](db['Plugin'][_0x7c3f('0x32')],function(_0x5ae309){return{'name':_0x5ae309[_0x7c3f('0x33')],'type':_0x5ae309['type'][_0x7c3f('0x34')]};});_0x1e620b[_0x7c3f('0x35')]=_[_0x7c3f('0x31')](_0xde3b7a,_0x7c3f('0x2f'));_0x1e620b[_0x7c3f('0x36')]=_[_0x7c3f('0x37')](_0x45730a[_0x7c3f('0x36')]);_0x1e620b['filters']=_[_0x7c3f('0x38')](_0x1e620b['model'],_0x1e620b[_0x7c3f('0x36')]);_0x2d717f[_0x7c3f('0x39')]=_['intersection'](_0x1e620b[_0x7c3f('0x35')],qs['fields'](_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x3a')]));_0x2d717f['attributes']=_0x2d717f['attributes'][_0x7c3f('0x3b')]?_0x2d717f[_0x7c3f('0x39')]:_0x1e620b[_0x7c3f('0x35')];if(!_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x3c')](_0x7c3f('0x3d'))){_0x2d717f[_0x7c3f('0x21')]=qs[_0x7c3f('0x21')](_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x21')]);_0x2d717f[_0x7c3f('0x23')]=qs[_0x7c3f('0x23')](_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x23')]);}_0x2d717f['order']=qs[_0x7c3f('0x3e')](_0x45730a['query'][_0x7c3f('0x3e')]);_0x2d717f[_0x7c3f('0x3f')]=qs['filters'](_[_0x7c3f('0x40')](_0x45730a[_0x7c3f('0x36')],_0x1e620b[_0x7c3f('0x41')]),_0xde3b7a);if(_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x42')]){_0x2d717f[_0x7c3f('0x3f')]=_[_0x7c3f('0x43')](_0x2d717f[_0x7c3f('0x3f')],{'$or':_[_0x7c3f('0x31')](_0xde3b7a,function(_0x28896e){if(_0x28896e[_0x7c3f('0x44')]!==_0x7c3f('0x45')){var _0x5e4a0d={};_0x5e4a0d[_0x28896e['name']]={'$like':'%'+_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x42')]+'%'};return _0x5e4a0d;}})});}_0x2d717f=_['merge']({},_0x2d717f,_0x45730a['options']);var _0x5b467a={'where':_0x2d717f[_0x7c3f('0x3f')]};return db['Plugin'][_0x7c3f('0x22')](_0x5b467a)[_0x7c3f('0x28')](function(_0x37c840){_0x9203ee[_0x7c3f('0x22')]=_0x37c840;if(_0x45730a[_0x7c3f('0x36')][_0x7c3f('0x46')]){_0x2d717f['include']=[{'all':!![]}];}return db[_0x7c3f('0x47')][_0x7c3f('0x48')](_0x2d717f);})[_0x7c3f('0x28')](function(_0x37c708){_0x9203ee[_0x7c3f('0x49')]=_0x37c708;return _0x9203ee;})[_0x7c3f('0x28')](respondWithFilteredResult(_0x4e4d48,_0x2d717f))['catch'](handleError(_0x4e4d48,null));};exports[_0x7c3f('0x4a')]=function(_0x2c070d,_0x5ab76e){var _0x109077={'raw':!![],'where':{'id':_0x2c070d['params']['id']}},_0x130056={};_0x130056[_0x7c3f('0x35')]=_[_0x7c3f('0x37')](db[_0x7c3f('0x47')]['rawAttributes']);_0x130056[_0x7c3f('0x36')]=_[_0x7c3f('0x37')](_0x2c070d[_0x7c3f('0x36')]);_0x130056[_0x7c3f('0x41')]=_[_0x7c3f('0x38')](_0x130056['model'],_0x130056['query']);_0x109077[_0x7c3f('0x39')]=_[_0x7c3f('0x38')](_0x130056['model'],qs[_0x7c3f('0x3a')](_0x2c070d[_0x7c3f('0x36')][_0x7c3f('0x3a')]));_0x109077[_0x7c3f('0x39')]=_0x109077[_0x7c3f('0x39')][_0x7c3f('0x3b')]?_0x109077[_0x7c3f('0x39')]:_0x130056[_0x7c3f('0x35')];if(_0x2c070d[_0x7c3f('0x36')][_0x7c3f('0x46')]){_0x109077['include']=[{'all':!![]}];}_0x109077=_[_0x7c3f('0x43')]({},_0x109077,_0x2c070d[_0x7c3f('0x4b')]);return db['Plugin'][_0x7c3f('0x4c')](_0x109077)[_0x7c3f('0x28')](handleEntityNotFound(_0x5ab76e,null))[_0x7c3f('0x28')](respondWithResult(_0x5ab76e,null))['catch'](handleError(_0x5ab76e,null));};exports[_0x7c3f('0x4d')]=function(_0x5cfb9d,_0x9a627,_0x1694d4){return db[_0x7c3f('0x47')][_0x7c3f('0x4c')]({'where':{'id':_0x5cfb9d[_0x7c3f('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x7c3f('0x28')](handleEntityNotFound(_0x9a627,null))[_0x7c3f('0x28')](function(_0x4b502d){if(_0x4b502d){var _0x37d84e=path['join'](config['root'],'server/files/plugins',util[_0x7c3f('0x4f')](_0x7c3f('0x50'),path[_0x7c3f('0x51')](_0x4b502d[_0x7c3f('0x52')])));var _0x5a6335=fs['createWriteStream'](_0x37d84e);var _0x391c40=archiver(_0x7c3f('0x53'),{'zlib':{'level':0x9}});_0x391c40['on'](_0x7c3f('0x54'),function(_0x409432){if(_0x409432['code']===_0x7c3f('0x55')){logger['error'](_0x409432);}else{throw new db['Sequelize'][(_0x7c3f('0x56'))](_0x7c3f('0x57'));}});_0x391c40['on'](_0x7c3f('0x2e'),function(_0x5b73a1){throw new db[(_0x7c3f('0x58'))][(_0x7c3f('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x391c40['pipe'](_0x5a6335);_0x391c40[_0x7c3f('0x59')](_0x7c3f('0x5a'),{'cwd':path[_0x7c3f('0x5b')](config[_0x7c3f('0x5c')],_0x7c3f('0x5d'),path['dirname'](_0x4b502d[_0x7c3f('0x52')])),'ignore':[path[_0x7c3f('0x5b')](path[_0x7c3f('0x51')](_0x4b502d[_0x7c3f('0x52')]),_0x7c3f('0x5e')),path[_0x7c3f('0x5b')](path[_0x7c3f('0x51')](_0x4b502d['path']),_0x7c3f('0x5f'))],'nodir':!![]})[_0x7c3f('0x60')]();_0x5a6335['on'](_0x7c3f('0x61'),function(){if(!fs[_0x7c3f('0x62')](_0x37d84e)){throw new db[(_0x7c3f('0x58'))][(_0x7c3f('0x56'))](_0x7c3f('0x63'));}return _0x9a627[_0x7c3f('0x4d')](_0x37d84e,util[_0x7c3f('0x4f')](_0x7c3f('0x50'),path[_0x7c3f('0x51')](_0x4b502d[_0x7c3f('0x52')])),function(_0x115f29){if(_0x115f29){throw new db[(_0x7c3f('0x58'))][(_0x7c3f('0x56'))](_0x7c3f('0x64'));}fs[_0x7c3f('0x65')](_0x37d84e);logger[_0x7c3f('0x66')](_0x7c3f('0x67'));logger[_0x7c3f('0x66')](_0x7c3f('0x68'));});});}return null;})[_0x7c3f('0x69')](handleError(_0x9a627,null));};exports['upload']=function(_0x27f161,_0x760f61,_0xa1d769){var _0x27655a=path['basename'](_0x27f161[_0x7c3f('0x6a')][_0x7c3f('0x6b')],path[_0x7c3f('0x6c')](_0x27f161[_0x7c3f('0x6a')][_0x7c3f('0x6b')]));var _0x58e81e=path[_0x7c3f('0x5b')](config[_0x7c3f('0x5c')],_0x7c3f('0x5d'),_0x27f161[_0x7c3f('0x6a')][_0x7c3f('0x6b')]);var _0x3a181d=path['join'](config[_0x7c3f('0x5c')],_0x7c3f('0x5d'),_0x27655a);logger[_0x7c3f('0x66')](_0x7c3f('0x6d'),_0x58e81e);logger[_0x7c3f('0x66')](_0x7c3f('0x6e'),_0x3a181d);try{fs[_0x7c3f('0x6f')](_0x58e81e,parseInt(_0x7c3f('0x70'),0x8));extract(_0x58e81e,{'dir':_0x3a181d},function(_0x5d2d5f){if(_0x5d2d5f){logger[_0x7c3f('0x2e')](_0x5d2d5f);handleError(_0x5d2d5f,!![]);};var _0x464c1f=fs[_0x7c3f('0x71')](_0x3a181d);if(_0x464c1f[_0x7c3f('0x3b')]>0x1){removeReferences(_0x58e81e,_0x3a181d);logger[_0x7c3f('0x2e')](_0x7c3f('0x72'));return _0xa1d769(new Error(_0x7c3f('0x72')));}var _0x53e3f8=fs[_0x7c3f('0x73')](path[_0x7c3f('0x5b')](_0x3a181d,_0x464c1f[0x0]));if(_0x53e3f8[_0x7c3f('0x74')]()){removeReferences(_0x58e81e,_0x3a181d);logger['error'](_0x7c3f('0x72'));return _0xa1d769(new Error('Invalid\x20plugin\x20structure'));}if(_0x53e3f8[_0x7c3f('0x75')]()){var _0xbf642a=fs['readdirSync'](path[_0x7c3f('0x5b')](_0x3a181d,_0x464c1f[0x0]));if(_0xbf642a[_0x7c3f('0x3b')]===0x0){removeReferences(_0x58e81e,_0x3a181d);logger['error'](_0x7c3f('0x72'));return _0xa1d769(new Error(_0x7c3f('0x72')));}var _0x3b25a5=_0xbf642a[_0x7c3f('0x76')](function(_0x590aa5){return _0x590aa5===_0x7c3f('0x77');});if(!_0x3b25a5){return _0xa1d769(new Error(_0x7c3f('0x78')));}var _0x428e22=fs[_0x7c3f('0x79')](path[_0x7c3f('0x5b')](_0x3a181d,_0x464c1f[0x0],_0x7c3f('0x77')));var _0x4b31ae=JSON['parse'](_0x428e22);if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x2f')]){return _0xa1d769(new Error(_0x7c3f('0x7a')));}if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x44')]){return _0xa1d769(new Error(_0x7c3f('0x7b')));}if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x7c')]){return _0xa1d769(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x7c3f('0x20')==typeof _0x4b31ae['parameters']){return _0xa1d769(new Error(_0x7c3f('0x7d')));}if(_0x4b31ae[_0x7c3f('0x44')]===_0x7c3f('0x7e')){if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')]){return _0xa1d769(new Error(_0x7c3f('0x81')));}if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')][_0x7c3f('0x82')]&&'undefined'==typeof _0x4b31ae['parameters']['views'][_0x7c3f('0x83')]){return _0xa1d769(new Error(_0x7c3f('0x84')));}}else if(_0x4b31ae[_0x7c3f('0x44')]==='script'){if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x7f')]['scriptName']){return _0xa1d769(new Error(_0x7c3f('0x85')));}if(_0x7c3f('0x20')==typeof _0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x86')]){return _0xa1d769(new Error(_0x7c3f('0x87')));}}else{return _0xa1d769(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x10ec22=_0x4b31ae['name'];var _0xeee618=_0x4b31ae[_0x7c3f('0x88')];var _0x5d5acd=_0x4b31ae[_0x7c3f('0x44')];var _0x6f69b5=_0x4b31ae[_0x7c3f('0x89')]?_0x4b31ae[_0x7c3f('0x89')]:_0x7c3f('0x8a');var _0x18601a=_0x4b31ae[_0x7c3f('0x8b')]?_0x4b31ae['icon']:_0x7c3f('0x8c');var _0x180193='';var _0xdc82cc='';var _0x5cac45='';var _0x3a6568='';var _0x1fed99=_0x4b31ae[_0x7c3f('0x7c')];if(_0x5d5acd==='html'){if(_0x7c3f('0x20')!=typeof _0x4b31ae[_0x7c3f('0x7f')]['views'][_0x7c3f('0x82')]){var _0x28542c=_0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7c3f('0x8d')](_0x28542c)){_0x180193=path[_0x7c3f('0x5b')](_0x7c3f('0x8e'),_0x27655a,_0x464c1f[0x0],_0x28542c);}else{_0x180193=_0x28542c;}}else{logger['info'](_0x7c3f('0x8f'));}if('undefined'!=typeof _0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')]['agent']){var _0x50461a=_0x4b31ae[_0x7c3f('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x50461a)){_0xdc82cc=path[_0x7c3f('0x5b')]('plugins',_0x27655a,_0x464c1f[0x0],_0x50461a);}else{_0xdc82cc=_0x50461a;}}else{logger['info'](_0x7c3f('0x90'));}}else if(_0x5d5acd==='script'){_0x5cac45=_0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x91')];_0x3a6568=_0x4b31ae['parameters'][_0x7c3f('0x86')];if(_0x7c3f('0x20')!=typeof _0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')]){if('undefined'!=typeof _0x4b31ae[_0x7c3f('0x7f')]['views'][_0x7c3f('0x82')]){var _0x28542c=_0x4b31ae[_0x7c3f('0x7f')][_0x7c3f('0x80')][_0x7c3f('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7c3f('0x8d')](_0x28542c)){_0x180193=path[_0x7c3f('0x5b')]('plugins',_0x27655a,_0x464c1f[0x0],_0x28542c);}else{_0x180193=_0x28542c;}}if(_0x7c3f('0x20')!=typeof _0x4b31ae['parameters'][_0x7c3f('0x80')]['agent']){var _0x50461a=_0x4b31ae[_0x7c3f('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7c3f('0x8d')](_0x50461a)){_0xdc82cc=path[_0x7c3f('0x5b')]('plugins',_0x27655a,_0x464c1f[0x0],_0x50461a);}else{_0xdc82cc=_0x50461a;}}}}var _0x4dde5b={'name':_0x10ec22,'description':_0xeee618,'path':path[_0x7c3f('0x5b')](_0x27655a,_0x464c1f[0x0]),'type':_0x5d5acd,'sidebar':_0x6f69b5,'icon':_0x18601a,'adminUrl':_0x180193,'agentUrl':_0xdc82cc,'scriptName':_0x5cac45,'scriptPath':_0x3a6568,'version':_0x1fed99};removeReferences(_0x58e81e,null);return db[_0x7c3f('0x47')][_0x7c3f('0x92')](_0x4dde5b)[_0x7c3f('0x28')](function(_0x2e3338){var _0x22f407={'role':_0x27f161[_0x7c3f('0x93')][_0x7c3f('0x94')],'userProfileId':_0x27f161[_0x7c3f('0x93')]['userProfileId']};if(!_0x22f407)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22f407['role']===_0x7c3f('0x95')){var _0x98b283=_0x2e3338[_0x7c3f('0x2a')]({'plain':!![]});return db[_0x7c3f('0x96')][_0x7c3f('0x4c')]({'where':{'name':'Plugins','userProfileId':_0x22f407[_0x7c3f('0x97')]},'raw':!![]})['then'](function(_0x39898e){if(_0x39898e&&_0x39898e['autoAssociation']===0x0){return db[_0x7c3f('0x98')][_0x7c3f('0x92')]({'name':_0x98b283['name'],'resourceId':_0x98b283['id'],'type':_0x39898e[_0x7c3f('0x2f')],'sectionId':_0x39898e['id']},{})[_0x7c3f('0x28')](function(){return _0x2e3338;});}else{return _0x2e3338;}})[_0x7c3f('0x69')](function(_0x3cc31d){logger[_0x7c3f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cc31d);throw _0x3cc31d;});}return _0x2e3338;})[_0x7c3f('0x28')](respondWithResult(_0x760f61,null))[_0x7c3f('0x69')](handleError(_0x760f61,null));}});}catch(_0x45e4e2){_0x760f61[_0x7c3f('0x1e')](0x1f4)[_0x7c3f('0x30')](_0x45e4e2);}};function removeReferences(_0x1eaad0,_0x264cc9){try{if(_0x1eaad0){fs[_0x7c3f('0x65')](_0x1eaad0);logger['info'](_0x7c3f('0x99'));}if(_0x264cc9){rimraf(_0x264cc9,function(){});logger['info'](_0x7c3f('0x9a'));}}catch(_0x5aa4e2){logger['error'](_0x5aa4e2);}}exports['update']=function(_0x6c28f0,_0x24ce52,_0x29be12){return db[_0x7c3f('0x47')][_0x7c3f('0x4c')]({'where':{'id':_0x6c28f0[_0x7c3f('0x4e')]['id']}})[_0x7c3f('0x28')](handleEntityNotFound(_0x24ce52,null))[_0x7c3f('0x28')](saveUpdates(_0x6c28f0[_0x7c3f('0x93')],null))[_0x7c3f('0x28')](respondWithResult(_0x24ce52,null))['catch'](handleError(_0x24ce52,null));};exports[_0x7c3f('0x9b')]=function(_0xa030f5,_0x13a377,_0xe41aa1){return db['Plugin'][_0x7c3f('0x4c')]({'where':{'id':_0xa030f5[_0x7c3f('0x4e')]['id']}})[_0x7c3f('0x28')](function(_0x2869ea){if(_0x2869ea){return _0x2869ea[_0x7c3f('0x29')]();}})[_0x7c3f('0x28')](function(_0x36c39b){rimraf(path[_0x7c3f('0x5b')](config[_0x7c3f('0x5c')],'server/files/plugins',path['dirname'](_0x36c39b['path'])),function(){});return _0x36c39b;})[_0x7c3f('0x28')](handleEntityNotFound(_0x13a377,null))[_0x7c3f('0x28')](respondWithStatusCode(_0x13a377,null))[_0x7c3f('0x69')](handleError(_0x13a377,null));};exports[_0x7c3f('0x9c')]=function(_0x528e46,_0x21a9f0,_0x29da25){return BPromise[_0x7c3f('0x9d')]()['then'](function(){if(!_0x528e46[_0x7c3f('0x36')][_0x7c3f('0x52')]){throw new Error(_0x7c3f('0x9e'));}if(!_0x528e46['query'][_0x7c3f('0x9f')]){throw new Error(_0x7c3f('0xa0'));}var _0x428fc7=_0x528e46['query'][_0x7c3f('0xa1')]?_0x528e46['query'][_0x7c3f('0xa1')]+':'+_0x528e46[_0x7c3f('0x36')][_0x7c3f('0x9f')]:_0x7c3f('0xa2')+_0x528e46[_0x7c3f('0x36')][_0x7c3f('0x9f')];var _0x1539d7=_0x528e46[_0x7c3f('0x36')]['json']?_0x528e46[_0x7c3f('0x36')]['json']:!![];var _0x367b0d=_0x528e46[_0x7c3f('0x36')][_0x7c3f('0xa3')]?_0x528e46[_0x7c3f('0x36')][_0x7c3f('0xa3')]:null;var _0x779e9={'method':_0x528e46[_0x7c3f('0xa4')],'uri':util[_0x7c3f('0x4f')](_0x7c3f('0xa5'),_0x428fc7,_0x528e46[_0x7c3f('0x36')][_0x7c3f('0x52')]),'json':_0x1539d7,'resolveWithFullResponse':!![],'encoding':_0x367b0d,'qs':_0x528e46[_0x7c3f('0x36')]};if(_0x528e46[_0x7c3f('0xa6')]){_0x779e9['headers']=_0x528e46[_0x7c3f('0xa6')];if(_0x779e9[_0x7c3f('0xa6')][_0x7c3f('0xa7')]){delete _0x779e9['headers'][_0x7c3f('0xa7')];}}if(_0x779e9['headers']['content-type']){delete _0x779e9[_0x7c3f('0xa6')][_0x7c3f('0xa8')];}return rp(_0x779e9);})['then'](function(_0x5cfba2){if(_0x5cfba2){_0x21a9f0[_0x7c3f('0x24')](_0x5cfba2[_0x7c3f('0xa6')]);logger[_0x7c3f('0x66')](_0x5cfba2[_0x7c3f('0x93')]);if(_['endsWith'](_0x528e46[_0x7c3f('0x36')]['path'],_0x7c3f('0x4d'))&&_0x5cfba2[_0x7c3f('0xa9')]==0x1f4){return _0x21a9f0[_0x7c3f('0x2d')](_0x5cfba2[_0x7c3f('0xa9')]);}else{return _0x21a9f0['status'](_0x5cfba2[_0x7c3f('0xa9')])[_0x7c3f('0x30')](_0x5cfba2[_0x7c3f('0x93')]);}}else{return _0x21a9f0['sendStatus'](0xc8);}})[_0x7c3f('0x69')](handleError(_0x21a9f0,null));};exports[_0x7c3f('0xaa')]=function(_0x57762,_0x2688bd,_0x4fba72){return BPromise[_0x7c3f('0x9d')]()[_0x7c3f('0x28')](function(){if(!_0x57762[_0x7c3f('0x36')][_0x7c3f('0x52')]){throw new Error(_0x7c3f('0x9e'));}if(!_0x57762[_0x7c3f('0x36')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4097aa=_0x57762[_0x7c3f('0x36')][_0x7c3f('0xa1')]?_0x57762[_0x7c3f('0x36')]['hostname']+':'+_0x57762[_0x7c3f('0x36')][_0x7c3f('0x9f')]:_0x7c3f('0xa2')+_0x57762[_0x7c3f('0x36')][_0x7c3f('0x9f')];var _0x382da5=_0x57762[_0x7c3f('0x36')][_0x7c3f('0x1f')]?_0x57762['query'][_0x7c3f('0x1f')]:!![];var _0x53f7f=_0x57762[_0x7c3f('0x36')][_0x7c3f('0xa3')]?_0x57762[_0x7c3f('0x36')][_0x7c3f('0xa3')]:null;var _0x29c23f={'method':_0x57762['method'],'uri':util['format'](_0x7c3f('0xa5'),_0x4097aa,_0x57762[_0x7c3f('0x36')][_0x7c3f('0x52')]),'json':_0x382da5,'resolveWithFullResponse':!![],'encoding':_0x53f7f,'body':_0x57762['body']};if(_0x57762['headers']){_0x29c23f[_0x7c3f('0xa6')]=_0x57762[_0x7c3f('0xa6')];if(_0x29c23f['headers'][_0x7c3f('0xa7')]){delete _0x29c23f['headers'][_0x7c3f('0xa7')];}}if(_0x29c23f['headers'][_0x7c3f('0xa8')]){delete _0x29c23f[_0x7c3f('0xa6')][_0x7c3f('0xa8')];}return rp(_0x29c23f);})[_0x7c3f('0x28')](function(_0x550a39){if(_0x550a39){_0x2688bd[_0x7c3f('0x24')](_0x550a39[_0x7c3f('0xa6')]);logger[_0x7c3f('0x66')](_0x550a39[_0x7c3f('0x93')]);return _0x2688bd[_0x7c3f('0x1e')](_0x550a39['statusCode'])['send'](_0x550a39['body']);}else{return _0x2688bd['sendStatus'](0xc8);}})[_0x7c3f('0x69')](handleError(_0x2688bd,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1862e2a..2282b43 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 _0x5e11=['exports','events','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ce646,_0x1a0de8){var _0x3b60c6=function(_0x27e98d){while(--_0x27e98d){_0x4ce646['push'](_0x4ce646['shift']());}};_0x3b60c6(++_0x1a0de8);}(_0x5e11,0x1c3));var _0x15e1=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x5e11[_0x35f83e];return _0x249b05;};'use strict';var EventEmitter=require(_0x15e1('0x0'));var Plugin=require('../../mysqldb')['db'][_0x15e1('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x15e1('0x2')](0x0);var events={'afterCreate':_0x15e1('0x3'),'afterUpdate':_0x15e1('0x4'),'afterDestroy':_0x15e1('0x5')};function emitEvent(_0x289592){return function(_0x598eda,_0x2409d8,_0x530c98){PluginEvents[_0x15e1('0x6')](_0x289592+':'+_0x598eda['id'],_0x598eda);PluginEvents[_0x15e1('0x6')](_0x289592,_0x598eda);_0x530c98(null);};}for(var e in events){if(events[_0x15e1('0x7')](e)){var event=events[e];Plugin[_0x15e1('0x8')](e,emitEvent(event));}}module[_0x15e1('0x9')]=PluginEvents; \ No newline at end of file +var _0x7676=['events','../../mysqldb','Plugin','save','emit','hasOwnProperty','hook','exports'];(function(_0x18b56f,_0x2d8823){var _0x4df0e0=function(_0x9315f2){while(--_0x9315f2){_0x18b56f['push'](_0x18b56f['shift']());}};_0x4df0e0(++_0x2d8823);}(_0x7676,0xb8));var _0x6767=function(_0x106b40,_0x4c36eb){_0x106b40=_0x106b40-0x0;var _0x1e2bbd=_0x7676[_0x106b40];return _0x1e2bbd;};'use strict';var EventEmitter=require(_0x6767('0x0'));var Plugin=require(_0x6767('0x1'))['db'][_0x6767('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6767('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e86fc){return function(_0x4bd37b,_0x4005ff,_0x10d505){PluginEvents[_0x6767('0x4')](_0x1e86fc+':'+_0x4bd37b['id'],_0x4bd37b);PluginEvents['emit'](_0x1e86fc,_0x4bd37b);_0x10d505(null);};}for(var e in events){if(events[_0x6767('0x5')](e)){var event=events[e];Plugin[_0x6767('0x6')](e,emitEvent(event));}}module[_0x6767('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a67cb10..f96b553 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 _0x2402=['./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x13e530,_0x347215){var _0x53a2ea=function(_0x908c33){while(--_0x908c33){_0x13e530['push'](_0x13e530['shift']());}};_0x53a2ea(++_0x347215);}(_0x2402,0xc9));var _0x2240=function(_0x2f279c,_0x62e591){_0x2f279c=_0x2f279c-0x0;var _0x2e9122=_0x2402[_0x2f279c];return _0x2e9122;};'use strict';var _=require(_0x2240('0x0'));var util=require(_0x2240('0x1'));var logger=require(_0x2240('0x2'))(_0x2240('0x3'));var moment=require('moment');var BPromise=require(_0x2240('0x4'));var rp=require(_0x2240('0x5'));var fs=require('fs');var path=require(_0x2240('0x6'));var rimraf=require(_0x2240('0x7'));var config=require(_0x2240('0x8'));var attributes=require(_0x2240('0x9'));module[_0x2240('0xa')]=function(_0x311e37,_0x1e588c){return _0x311e37[_0x2240('0xb')](_0x2240('0xc'),attributes,{'tableName':_0x2240('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6841=['path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x6841,0xc6));var _0x1684=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x6841[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x1684('0x0'));var util=require(_0x1684('0x1'));var logger=require(_0x1684('0x2'))(_0x1684('0x3'));var moment=require('moment');var BPromise=require(_0x1684('0x4'));var rp=require(_0x1684('0x5'));var fs=require('fs');var path=require(_0x1684('0x6'));var rimraf=require(_0x1684('0x7'));var config=require(_0x1684('0x8'));var attributes=require(_0x1684('0x9'));module['exports']=function(_0x3c013d,_0x4a03fd){return _0x3c013d[_0x1684('0xa')](_0x1684('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e9d2536..c26f817 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 _0x4bec=['body','options','CreatePlugin','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Plugin','create'];(function(_0x5efff3,_0x1d201c){var _0x6f810f=function(_0x54828e){while(--_0x54828e){_0x5efff3['push'](_0x5efff3['shift']());}};_0x6f810f(++_0x1d201c);}(_0x4bec,0xdc));var _0xc4be=function(_0x3e4e85,_0x181388){_0x3e4e85=_0x3e4e85-0x0;var _0x164d11=_0x4bec[_0x3e4e85];return _0x164d11;};'use strict';var _=require(_0xc4be('0x0'));var util=require(_0xc4be('0x1'));var moment=require('moment');var BPromise=require(_0xc4be('0x2'));var rs=require(_0xc4be('0x3'));var fs=require('fs');var Redis=require(_0xc4be('0x4'));var db=require(_0xc4be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4be('0x6'))(_0xc4be('0x7'));var config=require(_0xc4be('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc4be('0x9')]({'port':0x232a});config[_0xc4be('0xa')]=_['defaults'](config[_0xc4be('0xa')],{'host':_0xc4be('0xb'),'port':0x18eb});var socket=require(_0xc4be('0xc'))(new Redis(config[_0xc4be('0xa')]));require('./plugin.socket')[_0xc4be('0xd')](socket);function respondWithRpcPromise(_0x303766,_0x16e1ee,_0x1b2a8f){return new BPromise(function(_0x4bb30d,_0x2b60d1){return client[_0xc4be('0xe')](_0x303766,_0x1b2a8f)[_0xc4be('0xf')](function(_0x5978f7){logger[_0xc4be('0x10')](_0xc4be('0x11'),_0x16e1ee,_0xc4be('0x12'));logger[_0xc4be('0x13')](_0xc4be('0x14'),_0x16e1ee,_0xc4be('0x12'),JSON[_0xc4be('0x15')](_0x5978f7));if(_0x5978f7[_0xc4be('0x16')]){if(_0x5978f7['error']['code']===0x1f4){logger[_0xc4be('0x16')](_0xc4be('0x11'),_0x16e1ee,_0x5978f7[_0xc4be('0x16')][_0xc4be('0x17')]);return _0x2b60d1(_0x5978f7[_0xc4be('0x16')][_0xc4be('0x17')]);}logger['error'](_0xc4be('0x11'),_0x16e1ee,_0x5978f7[_0xc4be('0x16')][_0xc4be('0x17')]);return _0x4bb30d(_0x5978f7[_0xc4be('0x16')][_0xc4be('0x17')]);}else{logger['info'](_0xc4be('0x11'),_0x16e1ee,_0xc4be('0x12'));_0x4bb30d(_0x5978f7[_0xc4be('0x18')]['message']);}})[_0xc4be('0x19')](function(_0x549a35){logger['error'](_0xc4be('0x11'),_0x16e1ee,_0x549a35);_0x2b60d1(_0x549a35);});});}exports['CreatePlugin']=function(_0x5f3d7f){var _0x4908fc=this;return new Promise(function(_0x3825e2,_0x3a7993){return db[_0xc4be('0x1a')][_0xc4be('0x1b')](_0x5f3d7f[_0xc4be('0x1c')],{'raw':_0x5f3d7f[_0xc4be('0x1d')]?_0x5f3d7f[_0xc4be('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xc4be('0xf')](function(_0x1b55d8){logger[_0xc4be('0x10')](_0xc4be('0x1e'),_0x5f3d7f);logger[_0xc4be('0x13')]('CreatePlugin',_0x5f3d7f,JSON[_0xc4be('0x15')](_0x1b55d8));_0x3825e2(_0x1b55d8);})['catch'](function(_0x1443c6){logger[_0xc4be('0x16')]('CreatePlugin',_0x1443c6['message'],_0x5f3d7f);_0x3a7993(_0x4908fc[_0xc4be('0x16')](0x1f4,_0x1443c6[_0xc4be('0x17')]));});});}; \ No newline at end of file +var _0x5923=['request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','CreatePlugin','Plugin','create','body','options','raw','info','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then'];(function(_0x3a7a66,_0x2a5172){var _0x2b4a80=function(_0x1c988a){while(--_0x1c988a){_0x3a7a66['push'](_0x3a7a66['shift']());}};_0x2b4a80(++_0x2a5172);}(_0x5923,0x1d7));var _0x3592=function(_0x34ba29,_0x1958b2){_0x34ba29=_0x34ba29-0x0;var _0x592a30=_0x5923[_0x34ba29];return _0x592a30;};'use strict';var _=require(_0x3592('0x0'));var util=require(_0x3592('0x1'));var moment=require(_0x3592('0x2'));var BPromise=require(_0x3592('0x3'));var rs=require(_0x3592('0x4'));var fs=require('fs');var Redis=require(_0x3592('0x5'));var db=require(_0x3592('0x6'))['db'];var utils=require(_0x3592('0x7'));var logger=require('../../config/logger')(_0x3592('0x8'));var config=require(_0x3592('0x9'));var jayson=require(_0x3592('0xa'));var client=jayson[_0x3592('0xb')]['http']({'port':0x232a});config[_0x3592('0xc')]=_[_0x3592('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3592('0xe'))(new Redis(config['redis']));require(_0x3592('0xf'))[_0x3592('0x10')](socket);function respondWithRpcPromise(_0x6124d9,_0x192828,_0x271bb7){return new BPromise(function(_0x21688f,_0x3387f9){return client[_0x3592('0x11')](_0x6124d9,_0x271bb7)[_0x3592('0x12')](function(_0xbc1dd4){logger['info']('Plugin,\x20%s,\x20%s',_0x192828,_0x3592('0x13'));logger[_0x3592('0x14')](_0x3592('0x15'),_0x192828,_0x3592('0x13'),JSON['stringify'](_0xbc1dd4));if(_0xbc1dd4[_0x3592('0x16')]){if(_0xbc1dd4[_0x3592('0x16')][_0x3592('0x17')]===0x1f4){logger[_0x3592('0x16')](_0x3592('0x18'),_0x192828,_0xbc1dd4[_0x3592('0x16')]['message']);return _0x3387f9(_0xbc1dd4[_0x3592('0x16')][_0x3592('0x19')]);}logger[_0x3592('0x16')](_0x3592('0x18'),_0x192828,_0xbc1dd4['error'][_0x3592('0x19')]);return _0x21688f(_0xbc1dd4[_0x3592('0x16')]['message']);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x192828,_0x3592('0x13'));_0x21688f(_0xbc1dd4['result'][_0x3592('0x19')]);}})['catch'](function(_0x16c89b){logger[_0x3592('0x16')](_0x3592('0x18'),_0x192828,_0x16c89b);_0x3387f9(_0x16c89b);});});}exports[_0x3592('0x1a')]=function(_0x2ecd64){var _0x35703d=this;return new Promise(function(_0x4288b5,_0x580589){return db[_0x3592('0x1b')][_0x3592('0x1c')](_0x2ecd64[_0x3592('0x1d')],{'raw':_0x2ecd64[_0x3592('0x1e')]?_0x2ecd64[_0x3592('0x1e')][_0x3592('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x46c7e7){logger[_0x3592('0x20')](_0x3592('0x1a'),_0x2ecd64);logger[_0x3592('0x14')](_0x3592('0x1a'),_0x2ecd64,JSON[_0x3592('0x21')](_0x46c7e7));_0x4288b5(_0x46c7e7);})[_0x3592('0x22')](function(_0xf3bbb9){logger[_0x3592('0x16')]('CreatePlugin',_0xf3bbb9[_0x3592('0x19')],_0x2ecd64);_0x580589(_0x35703d[_0x3592('0x16')](0x1f4,_0xf3bbb9[_0x3592('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index facd299..62fa234 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 _0x8cbe=['emit','register','length','./plugin.events','save','remove','update'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0x8cbe,0x1ae));var _0xe8cb=function(_0x3769d7,_0x16661b){_0x3769d7=_0x3769d7-0x0;var _0x12583=_0x8cbe[_0x3769d7];return _0x12583;};'use strict';var PluginEvents=require(_0xe8cb('0x0'));var events=[_0xe8cb('0x1'),_0xe8cb('0x2'),_0xe8cb('0x3')];function createListener(_0x45fc21,_0x45862b){return function(_0x4c968c){_0x45862b[_0xe8cb('0x4')](_0x45fc21,_0x4c968c);};}function removeListener(_0x1027b3,_0x3551b4){return function(){PluginEvents['removeListener'](_0x1027b3,_0x3551b4);};}exports[_0xe8cb('0x5')]=function(_0x39f6d3){for(var _0x4f5c89=0x0,_0x3972b8=events[_0xe8cb('0x6')];_0x4f5c89<_0x3972b8;_0x4f5c89++){var _0x5210b8=events[_0x4f5c89];var _0x1f9995=createListener('plugin:'+_0x5210b8,_0x39f6d3);PluginEvents['on'](_0x5210b8,_0x1f9995);}}; \ No newline at end of file +var _0xb530=['./plugin.events','save','remove','update','removeListener','register','length','plugin:'];(function(_0x1fb7ec,_0x56db29){var _0x2a3008=function(_0x193b1c){while(--_0x193b1c){_0x1fb7ec['push'](_0x1fb7ec['shift']());}};_0x2a3008(++_0x56db29);}(_0xb530,0x130));var _0x0b53=function(_0x5394f9,_0x1855f6){_0x5394f9=_0x5394f9-0x0;var _0x32197b=_0xb530[_0x5394f9];return _0x32197b;};'use strict';var PluginEvents=require(_0x0b53('0x0'));var events=[_0x0b53('0x1'),_0x0b53('0x2'),_0x0b53('0x3')];function createListener(_0x482c58,_0x240125){return function(_0x45299e){_0x240125['emit'](_0x482c58,_0x45299e);};}function removeListener(_0x183d63,_0x5766e4){return function(){PluginEvents[_0x0b53('0x4')](_0x183d63,_0x5766e4);};}exports[_0x0b53('0x5')]=function(_0xb4debf){for(var _0x10631b=0x0,_0x574a8e=events[_0x0b53('0x6')];_0x10631b<_0x574a8e;_0x10631b++){var _0x32a7d6=events[_0x10631b];var _0xa69421=createListener(_0x0b53('0x7')+_0x32a7d6,_0xb4debf);PluginEvents['on'](_0x32a7d6,_0xa69421);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 018b805..a6ac307 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x407751,_0x5ceffd){var _0xd7450e=function(_0x4c01d6){while(--_0x4c01d6){_0x407751['push'](_0x407751['shift']());}};_0xd7450e(++_0x5ceffd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x3dc827,_0x1451e9){var _0x4167f3=function(_0x1ba09d){while(--_0x1ba09d){_0x3dc827['push'](_0x3dc827['shift']());}};_0x4167f3(++_0x1451e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 39a7061..b27a959 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 _0xc368=['update','restart','Unknown\x20status','destroy','delete','dump','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','npm\x20install','info','index','list','then','reject','name','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path'];(function(_0xedea4e,_0x39c50e){var _0xe2e16f=function(_0x59aa66){while(--_0x59aa66){_0xedea4e['push'](_0xedea4e['shift']());}};_0xe2e16f(++_0x39c50e);}(_0xc368,0x7b));var _0x8c36=function(_0x390ce4,_0x3ba1c2){_0x390ce4=_0x390ce4-0x0;var _0x1c868f=_0xc368[_0x390ce4];return _0x1c868f;};'use strict';var _=require('lodash');var pm2=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var exec=require(_0x8c36('0x3'))[_0x8c36('0x4')];var BPromise=require(_0x8c36('0x5'));function handleEntityNotFound(_0x5d3b27,_0x3e9034){return function(_0x3bb30e){if(!_0x3bb30e){_0x5d3b27[_0x8c36('0x6')](0x194);;}return _0x3bb30e;};}function respondWithResult(_0x1d3660,_0x5ebfc1){_0x5ebfc1=_0x5ebfc1||0xc8;return function(_0x554022){if(_0x554022){return _0x1d3660[_0x8c36('0x7')](_0x5ebfc1)[_0x8c36('0x8')](_0x554022);}return null;};}function handleError(_0x3e76be,_0x26bad1){_0x26bad1=_0x26bad1||0x1f4;return function(_0x3af839){logger[_0x8c36('0x9')](_0x3af839['stack']);if(_0x3af839['name']){delete _0x3af839['name'];}_0x3e76be[_0x8c36('0x7')](_0x26bad1)[_0x8c36('0xa')](_0x3af839);};}function execChildProcess(){return new BPromise(function(_0x5132f6,_0x36cb13){exec(_0x8c36('0xb'),function(_0x1d5c61,_0xe7857e,_0x2a8e73){logger[_0x8c36('0xc')](_0xe7857e);logger[_0x8c36('0xc')](_0x2a8e73);if(_0x1d5c61){logger[_0x8c36('0x9')](_0x1d5c61);return _0x36cb13(_0x1d5c61);}return _0x5132f6(_0xe7857e);});});}exports[_0x8c36('0xd')]=function(_0x11f8fa,_0x43736d){return pm2[_0x8c36('0xe')]()[_0x8c36('0xf')](function(_0x220f18){if(_0x220f18){var _0x5dfcd5=_[_0x8c36('0x10')](_0x220f18,function(_0x5e32ad){return _0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x12')||_0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x13');});return{'rows':_0x5dfcd5,'count':_0x5dfcd5[_0x8c36('0x14')]};}return null;})[_0x8c36('0xf')](respondWithResult(_0x43736d,null))[_0x8c36('0x15')](handleError(_0x43736d,null));};exports[_0x8c36('0x16')]=function(_0x30229e,_0x49cafe){return pm2[_0x8c36('0x17')](_0x30229e[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x49cafe,null))[_0x8c36('0xf')](handleEntityNotFound(_0x49cafe,null))[_0x8c36('0x15')](handleError(_0x49cafe,null));};exports['create']=function(_0x15100f,_0x409de0){if(_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')]&&_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]){var _0xfb9763=path[_0x8c36('0x1b')](__dirname,_0x8c36('0x1c'),_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]);var _0x14ee6b=process[_0x8c36('0x1d')]();process['chdir'](path['dirname'](_0xfb9763));return execChildProcess()['then'](function(_0x55b844){process[_0x8c36('0x1e')](_0x14ee6b);return pm2[_0x8c36('0x1f')]({'name':_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')],'script':_0xfb9763});})[_0x8c36('0xf')](function(_0x27c0df){pm2['dump']();return _0x27c0df[0x0];})[_0x8c36('0xf')](respondWithResult(_0x409de0,0xc9))['catch'](handleError(_0x409de0,null));}else{return _0x409de0[_0x8c36('0x7')](0x1f4)['send']({'message':_0x8c36('0x20')});}};exports[_0x8c36('0x21')]=function(_0x271ec4,_0x1010c8){if(_0x271ec4['body']['id']){delete _0x271ec4['body']['id'];}var _0x7e7e56={'online':_0x8c36('0x22'),'stopped':'stop'};if(_0x7e7e56['hasOwnProperty'](_0x271ec4[_0x8c36('0x19')][_0x8c36('0x7')])){return pm2[_0x7e7e56[_0x271ec4['body'][_0x8c36('0x7')]]](_0x271ec4[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x1010c8,0xc8))['catch'](handleError(_0x1010c8,null));}else{return _0x1010c8['status'](0x1f4)[_0x8c36('0xa')]({'message':_0x8c36('0x23')});}};exports[_0x8c36('0x24')]=function(_0x192ce3,_0x3ae970){if(_0x192ce3[_0x8c36('0x19')]['id']){delete _0x192ce3[_0x8c36('0x19')]['id'];}if(_0x192ce3[_0x8c36('0x18')]['id']){return pm2[_0x8c36('0x25')](_0x192ce3[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](function(_0x36648e){pm2[_0x8c36('0x26')]();return _0x36648e[0x0];})[_0x8c36('0xf')](respondWithResult(_0x3ae970,null))[_0x8c36('0x15')](handleError(_0x3ae970,null));}else{return _0x3ae970[_0x8c36('0x7')](0x1f4)[_0x8c36('0xa')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x22fb=['reject','motion2','length','catch','describe','params','create','body','script','join','cwd','chdir','dirname','dump','update','restart','stop','delete','../../config/logger','path','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','index','list','then'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x22fb,0x192));var _0xb22f=function(_0x13a8bd,_0x5a0df4){_0x13a8bd=_0x13a8bd-0x0;var _0x321f00=_0x22fb[_0x13a8bd];return _0x321f00;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0xb22f('0x0'))('api');var path=require(_0xb22f('0x1'));var exec=require(_0xb22f('0x2'))[_0xb22f('0x3')];var BPromise=require(_0xb22f('0x4'));function handleEntityNotFound(_0x201512,_0x50cdab){return function(_0x44717d){if(!_0x44717d){_0x201512[_0xb22f('0x5')](0x194);;}return _0x44717d;};}function respondWithResult(_0x2d1fb3,_0xc3ffcc){_0xc3ffcc=_0xc3ffcc||0xc8;return function(_0x412a95){if(_0x412a95){return _0x2d1fb3[_0xb22f('0x6')](_0xc3ffcc)['json'](_0x412a95);}return null;};}function handleError(_0x34433b,_0x22c509){_0x22c509=_0x22c509||0x1f4;return function(_0x36e238){logger[_0xb22f('0x7')](_0x36e238[_0xb22f('0x8')]);if(_0x36e238[_0xb22f('0x9')]){delete _0x36e238[_0xb22f('0x9')];}_0x34433b[_0xb22f('0x6')](_0x22c509)[_0xb22f('0xa')](_0x36e238);};}function execChildProcess(){return new BPromise(function(_0x2676f3,_0x3473d4){exec('npm\x20install',function(_0x4b9e56,_0x5b2399,_0x1caf67){logger['info'](_0x5b2399);logger['info'](_0x1caf67);if(_0x4b9e56){logger['error'](_0x4b9e56);return _0x3473d4(_0x4b9e56);}return _0x2676f3(_0x5b2399);});});}exports[_0xb22f('0xb')]=function(_0x40fcf8,_0x4ae6bb){return pm2[_0xb22f('0xc')]()[_0xb22f('0xd')](function(_0x32d796){if(_0x32d796){var _0x5c6ccf=_[_0xb22f('0xe')](_0x32d796,function(_0x5f1590){return _0x5f1590[_0xb22f('0x9')]==='express'||_0x5f1590[_0xb22f('0x9')]===_0xb22f('0xf');});return{'rows':_0x5c6ccf,'count':_0x5c6ccf[_0xb22f('0x10')]};}return null;})[_0xb22f('0xd')](respondWithResult(_0x4ae6bb,null))[_0xb22f('0x11')](handleError(_0x4ae6bb,null));};exports['show']=function(_0x1530f7,_0x53a59b){return pm2[_0xb22f('0x12')](_0x1530f7[_0xb22f('0x13')]['id'])[_0xb22f('0xd')](respondWithResult(_0x53a59b,null))[_0xb22f('0xd')](handleEntityNotFound(_0x53a59b,null))[_0xb22f('0x11')](handleError(_0x53a59b,null));};exports[_0xb22f('0x14')]=function(_0x5c843b,_0x72994){if(_0x5c843b['body'][_0xb22f('0x9')]&&_0x5c843b[_0xb22f('0x15')][_0xb22f('0x16')]){var _0x2239b8=path[_0xb22f('0x17')](__dirname,'../../files/plugins',_0x5c843b['body'][_0xb22f('0x16')]);var _0x19e480=process[_0xb22f('0x18')]();process[_0xb22f('0x19')](path[_0xb22f('0x1a')](_0x2239b8));return execChildProcess()[_0xb22f('0xd')](function(_0x201764){process[_0xb22f('0x19')](_0x19e480);return pm2['start']({'name':_0x5c843b['body'][_0xb22f('0x9')],'script':_0x2239b8});})[_0xb22f('0xd')](function(_0x5e1b8c){pm2[_0xb22f('0x1b')]();return _0x5e1b8c[0x0];})[_0xb22f('0xd')](respondWithResult(_0x72994,0xc9))['catch'](handleError(_0x72994,null));}else{return _0x72994[_0xb22f('0x6')](0x1f4)[_0xb22f('0xa')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xb22f('0x1c')]=function(_0x2c4a9e,_0xcddbca){if(_0x2c4a9e[_0xb22f('0x15')]['id']){delete _0x2c4a9e[_0xb22f('0x15')]['id'];}var _0x246a0c={'online':_0xb22f('0x1d'),'stopped':_0xb22f('0x1e')};if(_0x246a0c['hasOwnProperty'](_0x2c4a9e['body']['status'])){return pm2[_0x246a0c[_0x2c4a9e[_0xb22f('0x15')]['status']]](_0x2c4a9e[_0xb22f('0x13')]['id'])[_0xb22f('0xd')](respondWithResult(_0xcddbca,0xc8))[_0xb22f('0x11')](handleError(_0xcddbca,null));}else{return _0xcddbca[_0xb22f('0x6')](0x1f4)[_0xb22f('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x435690,_0x12c042){if(_0x435690[_0xb22f('0x15')]['id']){delete _0x435690[_0xb22f('0x15')]['id'];}if(_0x435690['params']['id']){return pm2[_0xb22f('0x1f')](_0x435690[_0xb22f('0x13')]['id'])['then'](function(_0x344c30){pm2[_0xb22f('0x1b')]();return _0x344c30[0x0];})[_0xb22f('0xd')](respondWithResult(_0x12c042,null))[_0xb22f('0x11')](handleError(_0x12c042,null));}else{return _0x12c042[_0xb22f('0x6')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index b1ae432..7d85a42 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc638=['../../components/interaction/service','../../config/environment','getQueues','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x13d812,_0x44b6ca){var _0x3ca750=function(_0x9a8301){while(--_0x9a8301){_0x13d812['push'](_0x13d812['shift']());}};_0x3ca750(++_0x44b6ca);}(_0xc638,0x112));var _0x8c63=function(_0x302996,_0x38eb8c){_0x302996=_0x302996-0x0;var _0x211c1c=_0xc638[_0x302996];return _0x211c1c;};'use strict';var multer=require(_0x8c63('0x0'));var util=require(_0x8c63('0x1'));var path=require('path');var timeout=require(_0x8c63('0x2'));var express=require('express');var router=express[_0x8c63('0x3')]();var fs_extra=require(_0x8c63('0x4'));var auth=require(_0x8c63('0x5'));var interaction=require(_0x8c63('0x6'));var config=require(_0x8c63('0x7'));var controller=require('./realtime.controller');router['get']('/queues',auth['isAuthenticated'](),controller[_0x8c63('0x8')]);module[_0x8c63('0x9')]=router; \ No newline at end of file +var _0xa7b5=['../../components/auth/service','../../components/interaction/service','get','/queues','getQueues','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x9fd347,_0x4e0949){var _0x2650e3=function(_0x418f3c){while(--_0x418f3c){_0x9fd347['push'](_0x9fd347['shift']());}};_0x2650e3(++_0x4e0949);}(_0xa7b5,0x162));var _0x5a7b=function(_0x18238c,_0x5454b2){_0x18238c=_0x18238c-0x0;var _0x46625a=_0xa7b5[_0x18238c];return _0x46625a;};'use strict';var multer=require(_0x5a7b('0x0'));var util=require(_0x5a7b('0x1'));var path=require(_0x5a7b('0x2'));var timeout=require(_0x5a7b('0x3'));var express=require(_0x5a7b('0x4'));var router=express['Router']();var fs_extra=require(_0x5a7b('0x5'));var auth=require(_0x5a7b('0x6'));var interaction=require(_0x5a7b('0x7'));var config=require('../../config/environment');var controller=require('./realtime.controller');router[_0x5a7b('0x8')](_0x5a7b('0x9'),auth['isAuthenticated'](),controller[_0x5a7b('0xa')]);module[_0x5a7b('0xb')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 830013a..668ae10 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf479=['sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','info','request\x20sent','debug','Realtime,\x20%s,\x20%s,\x20%s','stringify','code','error','Realtime,\x20%s,\x20%s','message','result','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','chat','sms','whatsapp','channel','includes','toLowerCase','query','startCase','Queue','map','rawAttributes','fieldName','type','getOptions','user','role','userProfileId','voice','filter','findAndCountAll','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','talking','paused','push','originated','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','loggedInDb','outbound','pTalking','agents','find','rows','merge','pick','getAgents','online','getMembers','length','UserId','User','QueueId','Pause','findAll','all','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0xf479,0xe9));var _0x9f47=function(_0x5baa35,_0x6c437e){_0x5baa35=_0x5baa35-0x0;var _0x1cdbc6=_0xf479[_0x5baa35];return _0x1cdbc6;};'use strict';var emlformat=require(_0x9f47('0x0'));var rimraf=require(_0x9f47('0x1'));var zipdir=require(_0x9f47('0x2'));var jsonpatch=require(_0x9f47('0x3'));var rp=require(_0x9f47('0x4'));var moment=require(_0x9f47('0x5'));var BPromise=require(_0x9f47('0x6'));var Mustache=require(_0x9f47('0x7'));var util=require('util');var path=require(_0x9f47('0x8'));var sox=require(_0x9f47('0x9'));var csv=require(_0x9f47('0xa'));var ejs=require(_0x9f47('0xb'));var fs=require('fs');var fs_extra=require(_0x9f47('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f47('0xd'));var deskjs=require(_0x9f47('0xe'));var toCsv=require(_0x9f47('0xa'));var querystring=require(_0x9f47('0xf'));var Papa=require(_0x9f47('0x10'));var Redis=require(_0x9f47('0x11'));var authService=require(_0x9f47('0x12'));var qs=require(_0x9f47('0x13'));var as=require(_0x9f47('0x14'));var hardwareService=require(_0x9f47('0x15'));var logger=require(_0x9f47('0x16'))(_0x9f47('0x17'));var utils=require(_0x9f47('0x18'));var config=require(_0x9f47('0x19'));var licenseUtil=require(_0x9f47('0x1a'));var db=require(_0x9f47('0x1b'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9f47('0x1c')][_0x9f47('0x1d')]({'port':0x232a});var routingClient=jayson[_0x9f47('0x1c')][_0x9f47('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x46fb54,_0x30f7a4,_0x359457,_0x511697){return new BPromise(function(_0xc1db30,_0x3ae419){var _0xa29b95=_0x511697||client;return _0xa29b95[_0x9f47('0x1e')](_0x46fb54,_0x359457)['then'](function(_0x4de591){logger[_0x9f47('0x1f')]('Realtime,\x20%s,\x20%s',_0x30f7a4,_0x9f47('0x20'));logger[_0x9f47('0x21')](_0x9f47('0x22'),_0x30f7a4,'request\x20sent',JSON[_0x9f47('0x23')](_0x4de591));if(_0x4de591['error']){if(_0x4de591['error'][_0x9f47('0x24')]===0x1f4){logger[_0x9f47('0x25')](_0x9f47('0x26'),_0x30f7a4,_0x4de591['error'][_0x9f47('0x27')]);return _0x3ae419(_0x4de591[_0x9f47('0x25')][_0x9f47('0x27')]);}logger[_0x9f47('0x25')](_0x9f47('0x26'),_0x30f7a4,_0x4de591[_0x9f47('0x25')][_0x9f47('0x27')]);return _0xc1db30(_0x4de591[_0x9f47('0x25')]['message']);}else{logger[_0x9f47('0x1f')](_0x9f47('0x26'),_0x30f7a4,_0x9f47('0x20'));_0xc1db30(_0x4de591[_0x9f47('0x28')][_0x9f47('0x27')]);}})['catch'](function(_0x58743a){logger[_0x9f47('0x25')]('Realtime,\x20%s,\x20%s',_0x30f7a4,_0x58743a);_0x3ae419(_0x58743a);});});}function respondWithStatusCode(_0x566712,_0x238d58){_0x238d58=_0x238d58||0xcc;return function(_0x5d236b){if(_0x5d236b){return _0x566712[_0x9f47('0x29')](_0x238d58);}return _0x566712['status'](_0x238d58)['end']();};}function respondWithResult(_0x2cc1a4,_0x546eab){_0x546eab=_0x546eab||0xc8;return function(_0x525b5e){if(_0x525b5e){return _0x2cc1a4[_0x9f47('0x2a')](_0x546eab)[_0x9f47('0x2b')](_0x525b5e);}};}function respondWithFilteredResult(_0x9b0125,_0x399f92){return function(_0x4b9132){if(_0x4b9132){var _0x574ec4=typeof _0x399f92['offset']===_0x9f47('0x2c')&&typeof _0x399f92[_0x9f47('0x2d')]===_0x9f47('0x2c');var _0xc65c80=_0x4b9132[_0x9f47('0x2e')];var _0x15986d=_0x574ec4?0x0:_0x399f92[_0x9f47('0x2f')];var _0x4fd4d6=_0x574ec4?_0x4b9132[_0x9f47('0x2e')]:_0x399f92['offset']+_0x399f92['limit'];var _0x3982cb;if(_0x4fd4d6>=_0xc65c80){_0x4fd4d6=_0xc65c80;_0x3982cb=0xc8;}else{_0x3982cb=0xce;}_0x9b0125['status'](_0x3982cb);return _0x9b0125['set'](_0x9f47('0x30'),_0x15986d+'-'+_0x4fd4d6+'/'+_0xc65c80)[_0x9f47('0x2b')](_0x4b9132);}return null;};}function patchUpdates(_0xf040e6){return function(_0x439967){try{jsonpatch[_0x9f47('0x31')](_0x439967,_0xf040e6,!![]);}catch(_0x263863){return BPromise[_0x9f47('0x32')](_0x263863);}return _0x439967[_0x9f47('0x33')]();};}function saveUpdates(_0xd8cd6,_0x3a1725){return function(_0x1d3c61){if(_0x1d3c61){return _0x1d3c61[_0x9f47('0x34')](_0xd8cd6)[_0x9f47('0x35')](function(_0x1f876){return _0x1f876;});}return null;};}function removeEntity(_0x5e7cf5,_0x369e8c){return function(_0x121350){if(_0x121350){return _0x121350['destroy']()[_0x9f47('0x35')](function(){_0x5e7cf5[_0x9f47('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bd746,_0x20a310){return function(_0x2215de){if(!_0x2215de){_0x5bd746[_0x9f47('0x29')](0x194);}return _0x2215de;};}function handleError(_0x499f12,_0x2d6636){_0x2d6636=_0x2d6636||0x1f4;return function(_0x54811c){logger['error'](_0x54811c[_0x9f47('0x36')]);if(_0x54811c[_0x9f47('0x37')]){delete _0x54811c['name'];}_0x499f12[_0x9f47('0x2a')](_0x2d6636)[_0x9f47('0x38')](_0x54811c);};}exports['getQueues']=function(_0x255a15,_0x20a3e8){var _0x5b6998=['mail',_0x9f47('0x39'),_0x9f47('0x3a'),'openchannel','fax',_0x9f47('0x3b'),'voice'];var _0x31b66e={'count':0x0,'rows':[]},_0x14be00={},_0x296e6f;Promise['resolve']()[_0x9f47('0x35')](function(){if(_0x255a15['query'][_0x9f47('0x3c')]){if(!_[_0x9f47('0x3d')](_0x5b6998,_0x255a15['query'][_0x9f47('0x3c')][_0x9f47('0x3e')]()))throw new Error('Invalid\x20channel');_0x296e6f=_0x255a15[_0x9f47('0x3f')]['channel']['toLowerCase']();}var _0x40a12f=_[_0x9f47('0x40')](_0x296e6f)+_0x9f47('0x41');var _0x513bee=_[_0x9f47('0x42')](db[_0x40a12f][_0x9f47('0x43')],function(_0x4de2f6){return{'name':_0x4de2f6[_0x9f47('0x44')],'type':_0x4de2f6[_0x9f47('0x45')]['key']};});_0x14be00=qs[_0x9f47('0x46')](_0x513bee,_0x255a15);if(_0x255a15[_0x9f47('0x47')][_0x9f47('0x48')]===_0x9f47('0x47')){var _0x2e4469={'params':{'id':_0x255a15[_0x9f47('0x47')][_0x9f47('0x49')]},'query':{'section':_0x296e6f===_0x9f47('0x4a')&&_0x255a15[_0x9f47('0x3f')]['type']==='outbound'?'QueueCampaigns':_[_0x9f47('0x40')](_0x296e6f)+'Queues','type':_0x255a15[_0x9f47('0x3f')]['type'],'nolimit':!![],'sort':_0x9f47('0x37'),'filter':_0x255a15[_0x9f47('0x3f')][_0x9f47('0x4b')]}};return db['UserProfile']['getResources'](_0x2e4469);}return db[_0x40a12f][_0x9f47('0x4c')](_0x14be00);})[_0x9f47('0x35')](function(_0x4787bd){_0x31b66e[_0x9f47('0x2e')]=_0x4787bd[_0x9f47('0x2e')];var _0x5404f2=_0x296e6f===_0x9f47('0x4a')?client:routingClient;return _0x5404f2[_0x9f47('0x1e')](_['startCase'](_0x296e6f)+_0x9f47('0x4d'),_0x255a15)[_0x9f47('0x35')](function(_0x2ac991){if(_0x2ac991[_0x9f47('0x25')])throw new Error(util['format'](_0x9f47('0x4e'),_0x296e6f));var _0x4b4ddb=_0x2ac991['result'];var _0x4a75c5=[_0x9f47('0x4f'),_0x9f47('0x50'),_0x9f47('0x51'),_0x9f47('0x52'),_0x9f47('0x53')];if(_0x296e6f==='voice'&&_0x255a15[_0x9f47('0x3f')][_0x9f47('0x45')]==='outbound'){_0x4a75c5[_0x9f47('0x54')]('pTalking',_0x9f47('0x55'),'message','dialActive','dialMethod',_0x9f47('0x56'),_0x9f47('0x57'),_0x9f47('0x58'),_0x9f47('0x59'),_0x9f47('0x5a'),_0x9f47('0x5b'),_0x9f47('0x5c'),_0x9f47('0x5d'),_0x9f47('0x5e'),'dialPredictiveIntervalMinThreshold',_0x9f47('0x5f'),'predictiveIntervalTotalCalls',_0x9f47('0x60'),_0x9f47('0x61'),_0x9f47('0x62'),_0x9f47('0x63'),_0x9f47('0x64'));}var _0xbb007b=_0x4787bd['rows'][_0x9f47('0x42')](function(_0x2daabd){var _0x5198a7=_0x2daabd[_0x9f47('0x65')]({'plain':!![]});_0x5198a7[_0x9f47('0x53')]=0x0;_0x5198a7[_0x9f47('0x66')]=0x0;_0x5198a7['loggedIn']=0x0;_0x5198a7['available']=0x0;_0x5198a7[_0x9f47('0x53')]=0x0;_0x5198a7['waiting']=0x0;if(_0x296e6f===_0x9f47('0x4a')){_0x5198a7[_0x9f47('0x52')]=0x0;if(_0x255a15[_0x9f47('0x3f')][_0x9f47('0x45')]===_0x9f47('0x67')){_0x5198a7[_0x9f47('0x68')]=0x0;_0x5198a7[_0x9f47('0x55')]=0x0;}}_0x5198a7[_0x9f47('0x69')]=[];var _0x159820=_[_0x9f47('0x6a')](_0x4b4ddb[_0x9f47('0x6b')],['id',_0x5198a7['id']]);if(_0x159820)_[_0x9f47('0x6c')](_0x5198a7,_[_0x9f47('0x6d')](_0x159820,_0x4a75c5));if(_0x296e6f===_0x9f47('0x4a')){return _0x2daabd[_0x9f47('0x6e')]({'attributes':['id',_0x9f47('0x37'),_0x9f47('0x6f')],'joinTableAttributes':[],'raw':!![]})[_0x9f47('0x35')](function(_0x251a49){return _0x2daabd[_0x9f47('0x70')]({'raw':!![]})[_0x9f47('0x35')](function(_0x1e2e73){for(var _0x4a0daa=0x0;_0x4a0daa<_0x251a49[_0x9f47('0x71')];_0x4a0daa++){var _0x5d7c7b=_[_0x9f47('0x6a')](_0x1e2e73,[_0x9f47('0x72'),_0x251a49[_0x4a0daa]['id']]);var _0x56d7ea={'id':_0x251a49[_0x4a0daa]['id'],'name':_0x251a49[_0x4a0daa][_0x9f47('0x37')],'online':Boolean(_0x251a49[_0x4a0daa]['online']),'paused':_0x5d7c7b?Boolean(_0x5d7c7b['paused']):![]};if(_0x56d7ea['online'])_0x5198a7[_0x9f47('0x66')]++;if(_0x56d7ea['paused'])_0x5198a7['paused']++;_0x5198a7['agents'][_0x9f47('0x54')](_0x56d7ea);}return _0x5198a7;});});}else{var _0x47d508=_0x9f47('0x73')+_[_0x9f47('0x40')](_0x296e6f)+_0x9f47('0x41');var _0x421e9f=_[_0x9f47('0x40')](_0x296e6f)+_0x9f47('0x74');var _0x5ea67d=_0x296e6f+_0x9f47('0x75');return db[_0x47d508][_0x9f47('0x76')]({'where':{['userQueueKey']:_0x2daabd['id']},'raw':!![]})['then'](function(_0x57d45f){return db[_0x9f47('0x73')]['findAll']({'attributes':['id',_0x9f47('0x37'),_0x9f47('0x6f'),_0x5ea67d],'where':{'id':_[_0x9f47('0x42')](_0x57d45f,'UserId'),'role':'agent'},'raw':!![]});})['then'](function(_0x55c00d){for(var _0x40dcf3=0x0;_0x40dcf3<_0x55c00d[_0x9f47('0x71')];_0x40dcf3++){var _0x544d62={'id':_0x55c00d[_0x40dcf3]['id'],'name':_0x55c00d[_0x40dcf3]['name'],'online':Boolean(_0x55c00d[_0x40dcf3]['online']),'paused':Boolean(_0x55c00d[_0x40dcf3][_0x5ea67d])};if(_0x544d62[_0x9f47('0x6f')])_0x5198a7[_0x9f47('0x66')]++;if(_0x544d62[_0x9f47('0x53')])_0x5198a7[_0x9f47('0x53')]++;_0x5198a7[_0x9f47('0x69')]['push'](_0x544d62);}return _0x5198a7;});}});return Promise[_0x9f47('0x77')](_0xbb007b);});})['then'](function(_0x495f41){_0x31b66e[_0x9f47('0x6b')]=_0x495f41;return _0x31b66e;})[_0x9f47('0x35')](respondWithFilteredResult(_0x20a3e8,_0x14be00))[_0x9f47('0x78')](handleError(_0x20a3e8,null));}; \ No newline at end of file +var _0x0b7e=['../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','Realtime,\x20%s,\x20%s','request\x20sent','debug','Realtime,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','name','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','channel','toLowerCase','Invalid\x20channel','startCase','map','rawAttributes','fieldName','type','key','user','role','userProfileId','outbound','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','format','waiting','talking','paused','push','pTalking','originated','dialActive','dialMethod','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','loggedIn','agents','rows','merge','pick','online','getMembers','length','find','UserId','loggedInDb','User','QueueId','Pause','findAll','all','catch','rimraf','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xae92e,_0x4f2b0b){var _0x1fe658=function(_0x4b5d9b){while(--_0x4b5d9b){_0xae92e['push'](_0xae92e['shift']());}};_0x1fe658(++_0x4f2b0b);}(_0x0b7e,0x65));var _0xe0b7=function(_0xf58288,_0x35333c){_0xf58288=_0xf58288-0x0;var _0x196e87=_0x0b7e[_0xf58288];return _0x196e87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b7('0x1'));var moment=require(_0xe0b7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe0b7('0x3'));var path=require(_0xe0b7('0x4'));var sox=require(_0xe0b7('0x5'));var csv=require(_0xe0b7('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0b7('0x7'));var _=require(_0xe0b7('0x8'));var squel=require('squel');var crypto=require(_0xe0b7('0x9'));var jsforce=require(_0xe0b7('0xa'));var deskjs=require(_0xe0b7('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe0b7('0xc'));var Papa=require(_0xe0b7('0xd'));var Redis=require(_0xe0b7('0xe'));var authService=require(_0xe0b7('0xf'));var qs=require(_0xe0b7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b7('0x11'))(_0xe0b7('0x12'));var utils=require('../../config/utils');var config=require(_0xe0b7('0x13'));var licenseUtil=require(_0xe0b7('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe0b7('0x15'));var client=jayson[_0xe0b7('0x16')]['http']({'port':0x232a});var routingClient=jayson[_0xe0b7('0x16')][_0xe0b7('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x57ff60,_0x2205aa,_0x2adaba,_0x2e84ed){return new BPromise(function(_0x293d93,_0x5c42ec){var _0x22c510=_0x2e84ed||client;return _0x22c510['request'](_0x57ff60,_0x2adaba)[_0xe0b7('0x18')](function(_0x424b05){logger[_0xe0b7('0x19')](_0xe0b7('0x1a'),_0x2205aa,_0xe0b7('0x1b'));logger[_0xe0b7('0x1c')](_0xe0b7('0x1d'),_0x2205aa,_0xe0b7('0x1b'),JSON[_0xe0b7('0x1e')](_0x424b05));if(_0x424b05[_0xe0b7('0x1f')]){if(_0x424b05[_0xe0b7('0x1f')][_0xe0b7('0x20')]===0x1f4){logger['error'](_0xe0b7('0x1a'),_0x2205aa,_0x424b05[_0xe0b7('0x1f')][_0xe0b7('0x21')]);return _0x5c42ec(_0x424b05[_0xe0b7('0x1f')][_0xe0b7('0x21')]);}logger[_0xe0b7('0x1f')]('Realtime,\x20%s,\x20%s',_0x2205aa,_0x424b05['error'][_0xe0b7('0x21')]);return _0x293d93(_0x424b05[_0xe0b7('0x1f')]['message']);}else{logger[_0xe0b7('0x19')](_0xe0b7('0x1a'),_0x2205aa,'request\x20sent');_0x293d93(_0x424b05[_0xe0b7('0x22')][_0xe0b7('0x21')]);}})['catch'](function(_0x113901){logger[_0xe0b7('0x1f')]('Realtime,\x20%s,\x20%s',_0x2205aa,_0x113901);_0x5c42ec(_0x113901);});});}function respondWithStatusCode(_0x11aa00,_0x1c2a6a){_0x1c2a6a=_0x1c2a6a||0xcc;return function(_0x2e1f95){if(_0x2e1f95){return _0x11aa00[_0xe0b7('0x23')](_0x1c2a6a);}return _0x11aa00[_0xe0b7('0x24')](_0x1c2a6a)[_0xe0b7('0x25')]();};}function respondWithResult(_0x495e85,_0x1e4e41){_0x1e4e41=_0x1e4e41||0xc8;return function(_0x5b650d){if(_0x5b650d){return _0x495e85[_0xe0b7('0x24')](_0x1e4e41)['json'](_0x5b650d);}};}function respondWithFilteredResult(_0x398361,_0x5762ed){return function(_0x57430c){if(_0x57430c){var _0x318a4e=typeof _0x5762ed[_0xe0b7('0x26')]===_0xe0b7('0x27')&&typeof _0x5762ed[_0xe0b7('0x28')]===_0xe0b7('0x27');var _0x40f050=_0x57430c[_0xe0b7('0x29')];var _0x5c482a=_0x318a4e?0x0:_0x5762ed['offset'];var _0x26772e=_0x318a4e?_0x57430c[_0xe0b7('0x29')]:_0x5762ed['offset']+_0x5762ed[_0xe0b7('0x28')];var _0x167f63;if(_0x26772e>=_0x40f050){_0x26772e=_0x40f050;_0x167f63=0xc8;}else{_0x167f63=0xce;}_0x398361[_0xe0b7('0x24')](_0x167f63);return _0x398361[_0xe0b7('0x2a')](_0xe0b7('0x2b'),_0x5c482a+'-'+_0x26772e+'/'+_0x40f050)[_0xe0b7('0x2c')](_0x57430c);}return null;};}function patchUpdates(_0x418c27){return function(_0x2dc598){try{jsonpatch[_0xe0b7('0x2d')](_0x2dc598,_0x418c27,!![]);}catch(_0x2b29da){return BPromise[_0xe0b7('0x2e')](_0x2b29da);}return _0x2dc598['save']();};}function saveUpdates(_0x3a8749,_0x5c3193){return function(_0x45a931){if(_0x45a931){return _0x45a931[_0xe0b7('0x2f')](_0x3a8749)[_0xe0b7('0x18')](function(_0xe8d14b){return _0xe8d14b;});}return null;};}function removeEntity(_0x368d58,_0x48c9fa){return function(_0x1d4d8e){if(_0x1d4d8e){return _0x1d4d8e[_0xe0b7('0x30')]()[_0xe0b7('0x18')](function(){_0x368d58[_0xe0b7('0x24')](0xcc)[_0xe0b7('0x25')]();});}};}function handleEntityNotFound(_0x2acb4a,_0x26e6df){return function(_0x352c87){if(!_0x352c87){_0x2acb4a['sendStatus'](0x194);}return _0x352c87;};}function handleError(_0x416604,_0x70af61){_0x70af61=_0x70af61||0x1f4;return function(_0x3e8f6d){logger[_0xe0b7('0x1f')](_0x3e8f6d['stack']);if(_0x3e8f6d['name']){delete _0x3e8f6d[_0xe0b7('0x31')];}_0x416604[_0xe0b7('0x24')](_0x70af61)['send'](_0x3e8f6d);};}exports[_0xe0b7('0x32')]=function(_0x1a295a,_0x1525b7){var _0x400dc4=[_0xe0b7('0x33'),_0xe0b7('0x34'),_0xe0b7('0x35'),_0xe0b7('0x36'),_0xe0b7('0x37'),_0xe0b7('0x38'),_0xe0b7('0x39')];var _0x27cf9a={'count':0x0,'rows':[]},_0x402e38={},_0x5dff9f;Promise[_0xe0b7('0x3a')]()['then'](function(){if(_0x1a295a[_0xe0b7('0x3b')][_0xe0b7('0x3c')]){if(!_['includes'](_0x400dc4,_0x1a295a[_0xe0b7('0x3b')][_0xe0b7('0x3c')][_0xe0b7('0x3d')]()))throw new Error(_0xe0b7('0x3e'));_0x5dff9f=_0x1a295a['query'][_0xe0b7('0x3c')][_0xe0b7('0x3d')]();}var _0x36ca5c=_[_0xe0b7('0x3f')](_0x5dff9f)+'Queue';var _0x86b01f=_[_0xe0b7('0x40')](db[_0x36ca5c][_0xe0b7('0x41')],function(_0x5543d1){return{'name':_0x5543d1[_0xe0b7('0x42')],'type':_0x5543d1[_0xe0b7('0x43')][_0xe0b7('0x44')]};});_0x402e38=qs['getOptions'](_0x86b01f,_0x1a295a);if(_0x1a295a[_0xe0b7('0x45')][_0xe0b7('0x46')]==='user'){var _0x10744f={'params':{'id':_0x1a295a['user'][_0xe0b7('0x47')]},'query':{'section':_0x5dff9f===_0xe0b7('0x39')&&_0x1a295a[_0xe0b7('0x3b')]['type']===_0xe0b7('0x48')?_0xe0b7('0x49'):_['startCase'](_0x5dff9f)+_0xe0b7('0x4a'),'type':_0x1a295a[_0xe0b7('0x3b')][_0xe0b7('0x43')],'nolimit':!![],'sort':'name','filter':_0x1a295a[_0xe0b7('0x3b')]['filter']}};return db[_0xe0b7('0x4b')][_0xe0b7('0x4c')](_0x10744f);}return db[_0x36ca5c][_0xe0b7('0x4d')](_0x402e38);})[_0xe0b7('0x18')](function(_0x415986){_0x27cf9a['count']=_0x415986['count'];var _0x21087f=_0x5dff9f==='voice'?client:routingClient;return _0x21087f[_0xe0b7('0x4e')](_[_0xe0b7('0x3f')](_0x5dff9f)+_0xe0b7('0x4a'),_0x1a295a)[_0xe0b7('0x18')](function(_0x588c3c){if(_0x588c3c['error'])throw new Error(util[_0xe0b7('0x4f')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x5dff9f));var _0x8805c5=_0x588c3c[_0xe0b7('0x22')];var _0x1a69f3=['loggedIn','available',_0xe0b7('0x50'),_0xe0b7('0x51'),_0xe0b7('0x52')];if(_0x5dff9f===_0xe0b7('0x39')&&_0x1a295a['query'][_0xe0b7('0x43')]===_0xe0b7('0x48')){_0x1a69f3[_0xe0b7('0x53')](_0xe0b7('0x54'),_0xe0b7('0x55'),'message',_0xe0b7('0x56'),_0xe0b7('0x57'),'Trunk',_0xe0b7('0x58'),'startProgressive',_0xe0b7('0x59'),_0xe0b7('0x5a'),_0xe0b7('0x5b'),_0xe0b7('0x5c'),_0xe0b7('0x5d'),'dialPredictiveIntervalMaxThreshold',_0xe0b7('0x5e'),_0xe0b7('0x5f'),_0xe0b7('0x60'),_0xe0b7('0x61'),'predictiveIntervalDroppedCallsTimeout',_0xe0b7('0x62'),'predictiveIntervalAvgHoldtime',_0xe0b7('0x63'));}var _0x3cfebe=_0x415986['rows'][_0xe0b7('0x40')](function(_0x375692){var _0x1992f9=_0x375692[_0xe0b7('0x64')]({'plain':!![]});_0x1992f9[_0xe0b7('0x52')]=0x0;_0x1992f9['loggedInDb']=0x0;_0x1992f9[_0xe0b7('0x65')]=0x0;_0x1992f9['available']=0x0;_0x1992f9[_0xe0b7('0x52')]=0x0;_0x1992f9['waiting']=0x0;if(_0x5dff9f==='voice'){_0x1992f9[_0xe0b7('0x51')]=0x0;if(_0x1a295a[_0xe0b7('0x3b')][_0xe0b7('0x43')]===_0xe0b7('0x48')){_0x1992f9[_0xe0b7('0x54')]=0x0;_0x1992f9['originated']=0x0;}}_0x1992f9[_0xe0b7('0x66')]=[];var _0x424de5=_['find'](_0x8805c5[_0xe0b7('0x67')],['id',_0x1992f9['id']]);if(_0x424de5)_[_0xe0b7('0x68')](_0x1992f9,_[_0xe0b7('0x69')](_0x424de5,_0x1a69f3));if(_0x5dff9f===_0xe0b7('0x39')){return _0x375692['getAgents']({'attributes':['id','name',_0xe0b7('0x6a')],'joinTableAttributes':[],'raw':!![]})[_0xe0b7('0x18')](function(_0x122bf2){return _0x375692[_0xe0b7('0x6b')]({'raw':!![]})[_0xe0b7('0x18')](function(_0x1d0f00){for(var _0x518416=0x0;_0x518416<_0x122bf2[_0xe0b7('0x6c')];_0x518416++){var _0x3802fd=_[_0xe0b7('0x6d')](_0x1d0f00,[_0xe0b7('0x6e'),_0x122bf2[_0x518416]['id']]);var _0x2d6bf6={'id':_0x122bf2[_0x518416]['id'],'name':_0x122bf2[_0x518416][_0xe0b7('0x31')],'online':Boolean(_0x122bf2[_0x518416][_0xe0b7('0x6a')]),'paused':_0x3802fd?Boolean(_0x3802fd[_0xe0b7('0x52')]):![]};if(_0x2d6bf6[_0xe0b7('0x6a')])_0x1992f9[_0xe0b7('0x6f')]++;if(_0x2d6bf6[_0xe0b7('0x52')])_0x1992f9[_0xe0b7('0x52')]++;_0x1992f9['agents'][_0xe0b7('0x53')](_0x2d6bf6);}return _0x1992f9;});});}else{var _0x563923=_0xe0b7('0x70')+_[_0xe0b7('0x3f')](_0x5dff9f)+'Queue';var _0x18449a=_[_0xe0b7('0x3f')](_0x5dff9f)+_0xe0b7('0x71');var _0x522b02=_0x5dff9f+_0xe0b7('0x72');return db[_0x563923][_0xe0b7('0x73')]({'where':{['userQueueKey']:_0x375692['id']},'raw':!![]})[_0xe0b7('0x18')](function(_0x23229c){return db['User'][_0xe0b7('0x73')]({'attributes':['id',_0xe0b7('0x31'),_0xe0b7('0x6a'),_0x522b02],'where':{'id':_[_0xe0b7('0x40')](_0x23229c,_0xe0b7('0x6e')),'role':'agent'},'raw':!![]});})[_0xe0b7('0x18')](function(_0x3612f0){for(var _0x540da0=0x0;_0x540da0<_0x3612f0[_0xe0b7('0x6c')];_0x540da0++){var _0x2ec861={'id':_0x3612f0[_0x540da0]['id'],'name':_0x3612f0[_0x540da0][_0xe0b7('0x31')],'online':Boolean(_0x3612f0[_0x540da0][_0xe0b7('0x6a')]),'paused':Boolean(_0x3612f0[_0x540da0][_0x522b02])};if(_0x2ec861[_0xe0b7('0x6a')])_0x1992f9[_0xe0b7('0x6f')]++;if(_0x2ec861['paused'])_0x1992f9[_0xe0b7('0x52')]++;_0x1992f9[_0xe0b7('0x66')]['push'](_0x2ec861);}return _0x1992f9;});}});return Promise[_0xe0b7('0x74')](_0x3cfebe);});})[_0xe0b7('0x18')](function(_0x2697ee){_0x27cf9a['rows']=_0x2697ee;return _0x27cf9a;})['then'](respondWithFilteredResult(_0x1525b7,_0x402e38))[_0xe0b7('0x75')](handleError(_0x1525b7,null));}; \ No newline at end of file diff --git a/server/api/realtime/realtime.model.js b/server/api/realtime/realtime.model.js index 59fab90..6053839 100644 --- a/server/api/realtime/realtime.model.js +++ b/server/api/realtime/realtime.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6775=['../../config/logger','moment','bluebird','exports','lodash','util'];(function(_0xa74e4c,_0x152094){var _0x5aceaa=function(_0x1ae205){while(--_0x1ae205){_0xa74e4c['push'](_0xa74e4c['shift']());}};_0x5aceaa(++_0x152094);}(_0x6775,0x1d8));var _0x5677=function(_0x368088,_0x16ecdb){_0x368088=_0x368088-0x0;var _0x35be6c=_0x6775[_0x368088];return _0x35be6c;};'use strict';var _=require(_0x5677('0x0'));var util=require(_0x5677('0x1'));var logger=require(_0x5677('0x2'))('api');var moment=require(_0x5677('0x3'));var BPromise=require(_0x5677('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');;module[_0x5677('0x5')]=function(_0x225370,_0xe8bba8){return _0x225370['define']('Realtime',[],{});}; \ No newline at end of file +var _0xc8c4=['request-promise','rimraf','exports','define','Realtime','lodash','../../config/logger','moment','bluebird'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0xc8c4,0x152));var _0x4c8c=function(_0x154c0e,_0x1390ca){_0x154c0e=_0x154c0e-0x0;var _0x2e57fe=_0xc8c4[_0x154c0e];return _0x2e57fe;};'use strict';var _=require(_0x4c8c('0x0'));var util=require('util');var logger=require(_0x4c8c('0x1'))('api');var moment=require(_0x4c8c('0x2'));var BPromise=require(_0x4c8c('0x3'));var rp=require(_0x4c8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c8c('0x5'));var config=require('../../config/environment');;module[_0x4c8c('0x6')]=function(_0x1cc159,_0x56c5f0){return _0x1cc159[_0x4c8c('0x7')](_0x4c8c('0x8'),[],{});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 702d539..75f31ae 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bcbc1,_0x593e3f){var _0x4cc437=function(_0x155238){while(--_0x155238){_0x3bcbc1['push'](_0x3bcbc1['shift']());}};_0x4cc437(++_0x593e3f);}(_0xe706,0xa3));var _0x6e70=function(_0x31e3e4,_0x5c795a){_0x31e3e4=_0x31e3e4-0x0;var _0x4ee39e=_0xe706[_0x31e3e4];return _0x4ee39e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x58321f,_0x5730b9){var _0x3728ea=function(_0x53e4ac){while(--_0x53e4ac){_0x58321f['push'](_0x58321f['shift']());}};_0x3728ea(++_0x5730b9);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 7f0d443..a63eef7 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 _0x16d8=['INTEGER','STRING','DATE','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16d8,0xa3));var _0x816d=function(_0x1195ed,_0xe5fff7){_0x1195ed=_0x1195ed-0x0;var _0x40bc89=_0x16d8[_0x1195ed];return _0x40bc89;};'use strict';var Sequelize=require('sequelize');module[_0x816d('0x0')]={'state':{'type':Sequelize[_0x816d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x816d('0x2')]},'scheduledat':{'type':Sequelize[_0x816d('0x3')]},'uniqueid':{'type':Sequelize[_0x816d('0x2')]},'starttime':{'type':Sequelize[_0x816d('0x3')]},'responsetime':{'type':Sequelize[_0x816d('0x3')]},'ringtime':{'type':Sequelize[_0x816d('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x816d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x816d('0x2')]}}; \ No newline at end of file +var _0x4989=['DATE','sequelize','STRING'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x4989,0x79));var _0x9498=function(_0x44fd6b,_0x338098){_0x44fd6b=_0x44fd6b-0x0;var _0x7cba12=_0x4989[_0x44fd6b];return _0x7cba12;};'use strict';var Sequelize=require(_0x9498('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9498('0x1')]},'scheduledat':{'type':Sequelize[_0x9498('0x2')]},'uniqueid':{'type':Sequelize[_0x9498('0x1')]},'starttime':{'type':Sequelize[_0x9498('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x9498('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9498('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index bc3a5c9..7151912 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 _0x0ee7=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x54f978,_0x3a6b7e){var _0x5d40b3=function(_0x44b545){while(--_0x44b545){_0x54f978['push'](_0x54f978['shift']());}};_0x5d40b3(++_0x3a6b7e);}(_0x0ee7,0x198));var _0x70ee=function(_0x21c69e,_0x210e70){_0x21c69e=_0x21c69e-0x0;var _0x795445=_0x0ee7[_0x21c69e];return _0x795445;};'use strict';var _=require(_0x70ee('0x0'));var util=require(_0x70ee('0x1'));var logger=require(_0x70ee('0x2'))(_0x70ee('0x3'));var moment=require(_0x70ee('0x4'));var BPromise=require(_0x70ee('0x5'));var rp=require(_0x70ee('0x6'));var fs=require('fs');var path=require(_0x70ee('0x7'));var rimraf=require(_0x70ee('0x8'));var config=require(_0x70ee('0x9'));var attributes=require(_0x70ee('0xa'));module[_0x70ee('0xb')]=function(_0x1329ac,_0x1c3eca){return _0x1329ac['define'](_0x70ee('0xc'),attributes,{'tableName':_0x70ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9ea=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x253475,_0x1fea10){var _0x16d219=function(_0x4382d6){while(--_0x4382d6){_0x253475['push'](_0x253475['shift']());}};_0x16d219(++_0x1fea10);}(_0xa9ea,0x1a2));var _0xaa9e=function(_0x350ec3,_0x1dcb41){_0x350ec3=_0x350ec3-0x0;var _0x1eef31=_0xa9ea[_0x350ec3];return _0x1eef31;};'use strict';var _=require(_0xaa9e('0x0'));var util=require(_0xaa9e('0x1'));var logger=require('../../config/logger')(_0xaa9e('0x2'));var moment=require(_0xaa9e('0x3'));var BPromise=require(_0xaa9e('0x4'));var rp=require(_0xaa9e('0x5'));var fs=require('fs');var path=require(_0xaa9e('0x6'));var rimraf=require(_0xaa9e('0x7'));var config=require(_0xaa9e('0x8'));var attributes=require(_0xaa9e('0x9'));module['exports']=function(_0x4afa10,_0x3c4c45){return _0x4afa10['define'](_0xaa9e('0xa'),attributes,{'tableName':_0xaa9e('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 7c4e981..4f4c042 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 _0x5738=['create','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','CreateReportAgentPreview'];(function(_0x6007c,_0x243099){var _0x597645=function(_0x12d5dc){while(--_0x12d5dc){_0x6007c['push'](_0x6007c['shift']());}};_0x597645(++_0x243099);}(_0x5738,0x149));var _0x8573=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x5738[_0x56756b];return _0xa3002;};'use strict';var _=require(_0x8573('0x0'));var util=require(_0x8573('0x1'));var moment=require(_0x8573('0x2'));var BPromise=require(_0x8573('0x3'));var rs=require(_0x8573('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8573('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8573('0x6'));var config=require(_0x8573('0x7'));var jayson=require(_0x8573('0x8'));var client=jayson[_0x8573('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11c863,_0x577574,_0x2ba004){return new BPromise(function(_0x195a47,_0x79da77){return client[_0x8573('0xa')](_0x11c863,_0x2ba004)[_0x8573('0xb')](function(_0x39373d){logger[_0x8573('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x577574,_0x8573('0xd'));logger[_0x8573('0xe')](_0x8573('0xf'),_0x577574,_0x8573('0xd'),JSON['stringify'](_0x39373d));if(_0x39373d[_0x8573('0x10')]){if(_0x39373d[_0x8573('0x10')][_0x8573('0x11')]===0x1f4){logger[_0x8573('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x577574,_0x39373d['error'][_0x8573('0x12')]);return _0x79da77(_0x39373d[_0x8573('0x10')][_0x8573('0x12')]);}logger['error'](_0x8573('0x13'),_0x577574,_0x39373d[_0x8573('0x10')][_0x8573('0x12')]);return _0x195a47(_0x39373d[_0x8573('0x10')]['message']);}else{logger[_0x8573('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x577574,_0x8573('0xd'));_0x195a47(_0x39373d[_0x8573('0x14')][_0x8573('0x12')]);}})['catch'](function(_0x3d6009){logger[_0x8573('0x10')](_0x8573('0x13'),_0x577574,_0x3d6009);_0x79da77(_0x3d6009);});});}exports[_0x8573('0x15')]=function(_0x1126ae){var _0xa686d=this;return new Promise(function(_0x437172,_0x2919d5){return db['ReportAgentPreview'][_0x8573('0x16')](_0x1126ae['body'],{'raw':_0x1126ae['options']?_0x1126ae[_0x8573('0x17')][_0x8573('0x18')]===undefined?!![]:![]:!![]})[_0x8573('0xb')](function(_0x22bbb0){logger[_0x8573('0xc')](_0x8573('0x15'),_0x1126ae);logger[_0x8573('0xe')](_0x8573('0x15'),_0x1126ae,JSON[_0x8573('0x19')](_0x22bbb0));_0x437172(_0x22bbb0);})[_0x8573('0x1a')](function(_0xc61bdc){logger[_0x8573('0x10')](_0x8573('0x15'),_0xc61bdc[_0x8573('0x12')],_0x1126ae);_0x2919d5(_0xa686d['error'](0x1f4,_0xc61bdc[_0x8573('0x12')]));});});}; \ No newline at end of file +var _0x4089=['request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x192dc9,_0x3db4bc){var _0x2a9299=function(_0xf856cc){while(--_0xf856cc){_0x192dc9['push'](_0x192dc9['shift']());}};_0x2a9299(++_0x3db4bc);}(_0x4089,0x10a));var _0x9408=function(_0x4d5e87,_0x3e62f8){_0x4d5e87=_0x4d5e87-0x0;var _0x111d98=_0x4089[_0x4d5e87];return _0x111d98;};'use strict';var _=require(_0x9408('0x0'));var util=require(_0x9408('0x1'));var moment=require(_0x9408('0x2'));var BPromise=require(_0x9408('0x3'));var rs=require(_0x9408('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9408('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9408('0x6'))(_0x9408('0x7'));var config=require(_0x9408('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9408('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31e1b2,_0x33fb8c,_0x360504){return new BPromise(function(_0x417667,_0x1cb67a){return client[_0x9408('0xa')](_0x31e1b2,_0x360504)[_0x9408('0xb')](function(_0x5dd7c2){logger[_0x9408('0xc')](_0x9408('0xd'),_0x33fb8c,_0x9408('0xe'));logger[_0x9408('0xf')](_0x9408('0x10'),_0x33fb8c,_0x9408('0xe'),JSON[_0x9408('0x11')](_0x5dd7c2));if(_0x5dd7c2[_0x9408('0x12')]){if(_0x5dd7c2[_0x9408('0x12')][_0x9408('0x13')]===0x1f4){logger[_0x9408('0x12')](_0x9408('0xd'),_0x33fb8c,_0x5dd7c2[_0x9408('0x12')][_0x9408('0x14')]);return _0x1cb67a(_0x5dd7c2[_0x9408('0x12')][_0x9408('0x14')]);}logger['error'](_0x9408('0xd'),_0x33fb8c,_0x5dd7c2['error']['message']);return _0x417667(_0x5dd7c2[_0x9408('0x12')][_0x9408('0x14')]);}else{logger[_0x9408('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x33fb8c,_0x9408('0xe'));_0x417667(_0x5dd7c2[_0x9408('0x15')][_0x9408('0x14')]);}})[_0x9408('0x16')](function(_0x77c423){logger[_0x9408('0x12')](_0x9408('0xd'),_0x33fb8c,_0x77c423);_0x1cb67a(_0x77c423);});});}exports['CreateReportAgentPreview']=function(_0x4348f4){var _0xc66f85=this;return new Promise(function(_0x191f02,_0x52c073){return db[_0x9408('0x17')]['create'](_0x4348f4[_0x9408('0x18')],{'raw':_0x4348f4[_0x9408('0x19')]?_0x4348f4['options'][_0x9408('0x1a')]===undefined?!![]:![]:!![]})[_0x9408('0xb')](function(_0x4424d7){logger[_0x9408('0xc')](_0x9408('0x1b'),_0x4348f4);logger['debug'](_0x9408('0x1b'),_0x4348f4,JSON['stringify'](_0x4424d7));_0x191f02(_0x4424d7);})[_0x9408('0x16')](function(_0x18334f){logger[_0x9408('0x12')]('CreateReportAgentPreview',_0x18334f[_0x9408('0x14')],_0x4348f4);_0x52c073(_0xc66f85[_0x9408('0x12')](0x1f4,_0x18334f[_0x9408('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 0097fb3..577f062 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 _0x0269=['/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','mail','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/whatsapp/queues/:id','showWhatsappQueues','exports','util','path','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','faxQueues','/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','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions'];(function(_0x1b717a,_0xee990f){var _0x4b0864=function(_0x53c296){while(--_0x53c296){_0x1b717a['push'](_0x1b717a['shift']());}};_0x4b0864(++_0xee990f);}(_0x0269,0x1d7));var _0x9026=function(_0x4e8c14,_0x38c5a2){_0x4e8c14=_0x4e8c14-0x0;var _0x2d4e94=_0x0269[_0x4e8c14];return _0x2d4e94;};'use strict';var multer=require('multer');var util=require(_0x9026('0x0'));var path=require(_0x9026('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x9026('0x2'));var controller=require(_0x9026('0x3'));router['get'](_0x9026('0x4'),auth[_0x9026('0x5')](),controller[_0x9026('0x6')]);router[_0x9026('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x9026('0x5')](),controller[_0x9026('0x8')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x9026('0x5')](),controller[_0x9026('0x9')]);router['get']('/voice/queues',auth[_0x9026('0x5')](),controller[_0x9026('0xa')]);router[_0x9026('0x7')](_0x9026('0xb'),auth[_0x9026('0x5')](),controller[_0x9026('0xc')]);router['get']('/mail/queues',auth[_0x9026('0x5')](),controller[_0x9026('0xd')]);router[_0x9026('0x7')](_0x9026('0xe'),auth['isAuthenticated'](),controller[_0x9026('0xf')]);router[_0x9026('0x7')](_0x9026('0x10'),auth[_0x9026('0x5')](),controller[_0x9026('0x11')]);router[_0x9026('0x7')](_0x9026('0x12'),auth[_0x9026('0x5')](),controller[_0x9026('0x13')]);router[_0x9026('0x7')]('/whatsapp/queues',auth[_0x9026('0x5')](),controller[_0x9026('0x14')]);router[_0x9026('0x7')]('/fax/queues',auth[_0x9026('0x5')](),controller[_0x9026('0x15')]);router['get'](_0x9026('0x16'),auth[_0x9026('0x5')](),controller[_0x9026('0x17')]);router[_0x9026('0x7')](_0x9026('0x18'),auth['isAuthenticated'](),controller[_0x9026('0x19')]);router['get'](_0x9026('0x1a'),auth[_0x9026('0x5')](),controller[_0x9026('0x1b')]);router['get'](_0x9026('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x9026('0x7')](_0x9026('0x1d'),auth[_0x9026('0x5')](),controller[_0x9026('0x1e')]);router[_0x9026('0x7')](_0x9026('0x1f'),auth[_0x9026('0x5')](),controller[_0x9026('0x20')]);router[_0x9026('0x21')](_0x9026('0x1f'),auth[_0x9026('0x5')](),controller['updateVoiceQueue']);router[_0x9026('0x7')](_0x9026('0x22'),auth[_0x9026('0x5')](),controller[_0x9026('0x23')]);router[_0x9026('0x7')](_0x9026('0x24'),auth[_0x9026('0x5')](),controller[_0x9026('0x25')]);router[_0x9026('0x7')]('/agents',auth[_0x9026('0x5')](),controller[_0x9026('0x26')]);router[_0x9026('0x21')]('/agents/:id/capacity',auth[_0x9026('0x5')](),controller['agentCapacity']);router['get'](_0x9026('0x27'),auth['isAuthenticated'](),controller[_0x9026('0x28')]);router[_0x9026('0x7')](_0x9026('0x29'),auth[_0x9026('0x5')](),controller[_0x9026('0x2a')]);router[_0x9026('0x7')](_0x9026('0x2b'),auth[_0x9026('0x5')](),controller['campaigns']);router[_0x9026('0x7')](_0x9026('0x2c'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x9026('0x7')](_0x9026('0x2d'),auth[_0x9026('0x5')](),controller[_0x9026('0x2e')]);router[_0x9026('0x7')](_0x9026('0x2f'),auth['isAuthenticated'](),controller[_0x9026('0x30')]);router[_0x9026('0x7')](_0x9026('0x31'),auth[_0x9026('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0x9026('0x7')](_0x9026('0x32'),auth[_0x9026('0x5')](),controller[_0x9026('0x33')]);router[_0x9026('0x7')](_0x9026('0x34'),auth[_0x9026('0x5')](),controller['smsQueuesWaitingInteractions']);router['get'](_0x9026('0x35'),auth[_0x9026('0x5')](),controller[_0x9026('0x36')]);router['get']('/fax/queues/waitinginteractions',auth[_0x9026('0x5')](),controller[_0x9026('0x37')]);router['post']('/mail/queues/:id/notify',auth[_0x9026('0x5')](),controller[_0x9026('0x38')](_0x9026('0x39')));router[_0x9026('0x7')]('/mail/queues/:id',auth['isAuthenticated'](),controller[_0x9026('0x3a')]);router[_0x9026('0x3b')](_0x9026('0x3c'),auth[_0x9026('0x5')](),controller['queueNotify'](_0x9026('0x3d')));router[_0x9026('0x7')](_0x9026('0x3e'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x9026('0x3b')](_0x9026('0x3f'),auth[_0x9026('0x5')](),controller['queueNotify'](_0x9026('0x40')));router[_0x9026('0x7')]('/fax/queues/:id',auth[_0x9026('0x5')](),controller['showFaxQueues']);router[_0x9026('0x3b')](_0x9026('0x41'),auth['isAuthenticated'](),controller[_0x9026('0x38')](_0x9026('0x42')));router['get'](_0x9026('0x43'),auth[_0x9026('0x5')](),controller['showOpenchannelQueues']);router[_0x9026('0x3b')](_0x9026('0x44'),auth[_0x9026('0x5')](),controller[_0x9026('0x38')](_0x9026('0x45')));router[_0x9026('0x3b')](_0x9026('0x46'),auth[_0x9026('0x5')](),controller[_0x9026('0x38')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0x9026('0x5')](),controller['showSmsQueues']);router[_0x9026('0x7')](_0x9026('0x47'),auth[_0x9026('0x5')](),controller[_0x9026('0x48')]);router[_0x9026('0x3b')]('/agents/:id/notify',auth['isAuthenticated'](),controller['agentNotify']);module[_0x9026('0x49')]=router; \ No newline at end of file +var _0xac40=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x1add4f,_0x4b29fe){var _0x57761a=function(_0x1c7d8f){while(--_0x1c7d8f){_0x1add4f['push'](_0x1add4f['shift']());}};_0x57761a(++_0x4b29fe);}(_0xac40,0x84));var _0x0ac4=function(_0x1286ac,_0x335d89){_0x1286ac=_0x1286ac-0x0;var _0x3903ab=_0xac40[_0x1286ac];return _0x3903ab;};'use strict';var multer=require(_0x0ac4('0x0'));var util=require(_0x0ac4('0x1'));var path=require(_0x0ac4('0x2'));var express=require(_0x0ac4('0x3'));var router=express[_0x0ac4('0x4')]();var auth=require(_0x0ac4('0x5'));var controller=require(_0x0ac4('0x6'));router[_0x0ac4('0x7')](_0x0ac4('0x8'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0xa')]);router[_0x0ac4('0x7')](_0x0ac4('0xb'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0xc')]);router[_0x0ac4('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x0ac4('0x9')](),controller[_0x0ac4('0xd')]);router[_0x0ac4('0x7')](_0x0ac4('0xe'),auth[_0x0ac4('0x9')](),controller['voiceQueues']);router[_0x0ac4('0x7')](_0x0ac4('0xf'),auth[_0x0ac4('0x9')](),controller['chatQueues']);router['get'](_0x0ac4('0x10'),auth[_0x0ac4('0x9')](),controller['mailQueues']);router[_0x0ac4('0x7')](_0x0ac4('0x11'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x12')]);router[_0x0ac4('0x7')]('/openchannel/queues',auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x13')]);router[_0x0ac4('0x7')]('/sms/queues',auth['isAuthenticated'](),controller[_0x0ac4('0x14')]);router['get'](_0x0ac4('0x15'),auth['isAuthenticated'](),controller[_0x0ac4('0x16')]);router['get'](_0x0ac4('0x17'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x18')]);router['get'](_0x0ac4('0x19'),auth[_0x0ac4('0x9')](),controller['voiceQueuesPreview']);router[_0x0ac4('0x7')](_0x0ac4('0x1a'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x1b')]);router[_0x0ac4('0x7')](_0x0ac4('0x1c'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x1d')]);router['get'](_0x0ac4('0x1e'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x1f')]);router[_0x0ac4('0x7')](_0x0ac4('0x20'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x21')]);router['get'](_0x0ac4('0x22'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x23')]);router[_0x0ac4('0x24')](_0x0ac4('0x22'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x25')]);router[_0x0ac4('0x7')](_0x0ac4('0x26'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x27')]);router['get']('/outbound/channels',auth['isAuthenticated'](),controller['outboundChannels']);router[_0x0ac4('0x7')](_0x0ac4('0x28'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x29')]);router[_0x0ac4('0x24')](_0x0ac4('0x2a'),auth['isAuthenticated'](),controller[_0x0ac4('0x2b')]);router[_0x0ac4('0x7')](_0x0ac4('0x2c'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x2d')]);router[_0x0ac4('0x7')](_0x0ac4('0x2e'),auth['isAuthenticated'](),controller['trunks']);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0x0ac4('0x2f')]);router['get'](_0x0ac4('0x30'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x31')]);router[_0x0ac4('0x7')](_0x0ac4('0x32'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x33')]);router['get'](_0x0ac4('0x34'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x35')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x0ac4('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0x0ac4('0x7')](_0x0ac4('0x36'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x37')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0ac4('0x38')]);router[_0x0ac4('0x7')]('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x0ac4('0x39')]);router[_0x0ac4('0x7')](_0x0ac4('0x3a'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x3b')]);router[_0x0ac4('0x3c')]('/mail/queues/:id/notify',auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x3d')](_0x0ac4('0x3e')));router[_0x0ac4('0x7')](_0x0ac4('0x3f'),auth[_0x0ac4('0x9')](),controller['showMailQueues']);router[_0x0ac4('0x3c')](_0x0ac4('0x40'),auth['isAuthenticated'](),controller['queueNotify'](_0x0ac4('0x41')));router[_0x0ac4('0x7')]('/chat/queues/:id',auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x42')]);router[_0x0ac4('0x3c')](_0x0ac4('0x43'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x3d')](_0x0ac4('0x44')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x0ac4('0x45')]);router[_0x0ac4('0x3c')](_0x0ac4('0x46'),auth['isAuthenticated'](),controller[_0x0ac4('0x3d')](_0x0ac4('0x47')));router[_0x0ac4('0x7')](_0x0ac4('0x48'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x49')]);router[_0x0ac4('0x3c')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x0ac4('0x3d')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth[_0x0ac4('0x9')](),controller['queueNotify'](_0x0ac4('0x4a')));router[_0x0ac4('0x7')](_0x0ac4('0x4b'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x4c')]);router[_0x0ac4('0x7')](_0x0ac4('0x4d'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x0ac4('0x3c')](_0x0ac4('0x4e'),auth[_0x0ac4('0x9')](),controller[_0x0ac4('0x4f')]);module[_0x0ac4('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a6ef79a..3348cc4 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 _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x5f1067,_0x426ce3){var _0x3f2e73=function(_0x56e7a3){while(--_0x56e7a3){_0x5f1067['push'](_0x5f1067['shift']());}};_0x3f2e73(++_0x426ce3);}(_0x7bae,0x13b));var _0xe7ba=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7bae[_0x55f8b4];return _0x2475f9;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));}; \ No newline at end of file +var _0xeec6=['YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','SIP/%s','interface'];(function(_0x46cc57,_0x313a05){var _0x39f101=function(_0x107706){while(--_0x107706){_0x46cc57['push'](_0x46cc57['shift']());}};_0x39f101(++_0x313a05);}(_0xeec6,0x1c2));var _0x6eec=function(_0x45ad09,_0x521ab1){_0x45ad09=_0x45ad09-0x0;var _0x2084fd=_0xeec6[_0x45ad09];return _0x2084fd;};'use strict';var BPromise=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var _=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var jayson=require(_0x6eec('0x6'));var amiClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232a});var mailClient=jayson[_0x6eec('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){var _0x56e849=_0x1c810e?_0x1c810e:amiClient;return _0x56e849[_0x6eec('0x9')](_0x48064a,_0x5a5e47)[_0x6eec('0xa')](function(_0x1c774d){if(_0x1c774d['error']){if(_0x1c774d['error']['code']===0x1f4){return _0x834c2(_0x1c774d[_0x6eec('0xb')][_0x6eec('0xc')]);}return _0x3443c2(_0x1c774d['error']['message']);}else{_0x3443c2(_0x1c774d[_0x6eec('0xd')]);}})['catch'](function(_0x3091d0){_0x834c2(_0x3091d0);});});}function respondWithResult(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xc8;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0xe')](_0x162db1)['json'](_0x3fe94b);}return _0x3387c2[_0x6eec('0xf')](0x194);};}function handleError(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0x1f4;return function(_0xc35914){logger[_0x6eec('0xb')](_0xc35914[_0x6eec('0x10')]);if(_0xc35914[_0x6eec('0x11')]){delete _0xc35914[_0x6eec('0x11')];}_0x3b2972[_0x6eec('0xe')](_0x462dbb)[_0x6eec('0x12')](_0xc35914);};}function findById(_0x5e2a9b){return function(_0x3c0c1b){if(!_['isNil'](_0x5e2a9b)&&!_[_0x6eec('0x13')](_0x3c0c1b)&&!_[_0x6eec('0x13')](_0x3c0c1b['rows'])){return _[_0x6eec('0x14')](_0x3c0c1b[_0x6eec('0x15')],function(_0xb1eab7){return _0xb1eab7['id']==_0x5e2a9b;});}return null;};}exports['voiceChannels']=function(_0x87f3be,_0x1ed94c){return respondWithRpcPromise(_0x6eec('0x16'),_0x87f3be[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1ed94c,null))[_0x6eec('0x18')](handleError(_0x1ed94c,null));};exports['voiceChannelMixMonitor']=function(_0x328693,_0x2f843e){return respondWithRpcPromise(_0x6eec('0x19'),_[_0x6eec('0x1a')](_0x328693[_0x6eec('0x17')],_0x328693[_0x6eec('0x1b')]))['then'](respondWithResult(_0x2f843e,null))[_0x6eec('0x18')](handleError(_0x2f843e,null));};exports[_0x6eec('0x1c')]=function(_0x285d41,_0x27785a){return respondWithRpcPromise(_0x6eec('0x1d'),_[_0x6eec('0x1a')](_0x285d41['query'],_0x285d41[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x27785a,null))[_0x6eec('0x18')](handleError(_0x27785a,null));};exports[_0x6eec('0x1e')]=function(_0x1d2be9,_0x1f386c){return respondWithRpcPromise(_0x6eec('0x1f'),_0x1d2be9[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1f386c,null))['catch'](handleError(_0x1f386c,null));};exports[_0x6eec('0x20')]=function(_0x44b31c,_0x30eb98){return respondWithRpcPromise(_0x6eec('0x1f'),_0x44b31c['query'])[_0x6eec('0xa')](findById(_0x44b31c[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0x30eb98,null))['catch'](handleError(_0x30eb98,null));};exports[_0x6eec('0x21')]=function(_0x47ed95,_0x20a130){return respondWithRpcPromise(_0x6eec('0x22'),_[_0x6eec('0x1a')](_0x47ed95[_0x6eec('0x23')],_0x47ed95[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x20a130,null))[_0x6eec('0x18')](handleError(_0x20a130,null));};exports[_0x6eec('0x24')]=function(_0x1abd19,_0x414f5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6eec('0x1a')](_0x1abd19['query'],_0x1abd19[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x414f5b,null))[_0x6eec('0x18')](handleError(_0x414f5b,null));};exports['voiceQueuesChannels']=function(_0x57b40b,_0x508735){return respondWithRpcPromise(_0x6eec('0x25'),_0x57b40b[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x508735,null))[_0x6eec('0x18')](handleError(_0x508735,null));};exports[_0x6eec('0x26')]=function(_0x23547d,_0x22e0cb){return respondWithRpcPromise(_0x6eec('0x27'),_[_0x6eec('0x1a')](_0x23547d[_0x6eec('0x17')],_0x23547d[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x22e0cb,null))['catch'](handleError(_0x22e0cb,null));};exports[_0x6eec('0x28')]=function(_0x361ab7,_0x2c83d1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x6eec('0x1a')](_0x361ab7[_0x6eec('0x17')],_0x361ab7[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x2c83d1,null))[_0x6eec('0x18')](handleError(_0x2c83d1,null));};exports[_0x6eec('0x29')]=function(_0x4a7699,_0x45cfb6){return respondWithRpcPromise(_0x6eec('0x2a'),_[_0x6eec('0x1a')](_0x4a7699['query'],_0x4a7699['params']))[_0x6eec('0xa')](respondWithResult(_0x45cfb6,null))[_0x6eec('0x18')](handleError(_0x45cfb6,null));};exports[_0x6eec('0x2b')]=function(_0x3f79d1,_0x402bac){return respondWithRpcPromise('Outbound',_0x3f79d1[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x402bac,null))[_0x6eec('0x18')](handleError(_0x402bac,null));};exports[_0x6eec('0x2c')]=function(_0x15918c,_0x2be999){return respondWithRpcPromise(_0x6eec('0x2d'),_0x15918c[_0x6eec('0x17')])['then'](respondWithResult(_0x2be999,null))[_0x6eec('0x18')](handleError(_0x2be999,null));};exports[_0x6eec('0x2e')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0;return respondWithRpcPromise(_0x6eec('0x2f'),_0x4d30c9[_0x6eec('0x17')])[_0x6eec('0xa')](function(_0x4cb50e){_0x160fc0=_0x4cb50e;return respondWithRpcPromise('Agents',_0x4d30c9[_0x6eec('0x17')],routingClient);})['then'](function(_0x5ac8b2){return _[_0x6eec('0x1a')]({},_0x5ac8b2,_0x160fc0);})[_0x6eec('0xa')](respondWithResult(_0x5b3283,null))[_0x6eec('0x18')](handleError(_0x5b3283,null));};exports[_0x6eec('0x30')]=function(_0x25d3f3,_0x58dfe7){if(_0x25d3f3[_0x6eec('0x23')]&&_0x25d3f3[_0x6eec('0x23')]['interaction']&&_0x25d3f3[_0x6eec('0x31')]&&_0x25d3f3[_0x6eec('0x31')]['name']){for(var _0x2d39bf in _0x25d3f3[_0x6eec('0x23')]['interaction']){if(_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x6eec('0x33')](_0x2d39bf)){db[_0x6eec('0x34')]['findAll']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'type':_0x6eec('0x35'),'exitAt':null,'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]&&_0x25d3f3['body']['interaction'][_0x2d39bf][_0x6eec('0x36')]?{'$notIn':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]}:{'$ne':null}}})[_0x6eec('0xa')](function(_0x44c7b8){var _0x59d7a7=moment()[_0x6eec('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20524a=0x0,_0x408295=_0x44c7b8[_0x6eec('0x36')];_0x20524a<_0x408295;_0x20524a+=0x1){_0x44c7b8[_0x20524a]['updateAttributes']({'exitAt':_0x59d7a7});}});for(var _0x2b83f2=0x0;_0x2b83f2<_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x6eec('0x36')];_0x2b83f2+=0x1){db[_0x6eec('0x34')]['findOrCreate']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')]['name'],'type':'INTERACTION','uniqueid':_0x25d3f3[_0x6eec('0x23')]['interaction'][_0x2d39bf][_0x2b83f2],'exitAt':null},'defaults':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'interface':_[_0x6eec('0x13')](_0x25d3f3['user']['interface'])?util[_0x6eec('0x37')](_0x6eec('0x38'),_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')]):_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x39')],'type':_0x6eec('0x35'),'enterAt':moment()[_0x6eec('0x37')](_0x6eec('0x3a')),'role':_0x6eec('0x3b'),'internal':_0x25d3f3['user']['internal'],'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x2b83f2]}});}}}}return respondWithRpcPromise(_0x6eec('0x3c'),{'id':_0x25d3f3['params']['id'],'capacity':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x3d')]},routingClient)[_0x6eec('0xa')](respondWithResult(_0x58dfe7,null))[_0x6eec('0x18')](handleError(_0x58dfe7,null));};exports[_0x6eec('0x3e')]=function(_0x43f77a,_0x10c10a){return respondWithRpcPromise(_0x6eec('0x3f'),_0x43f77a['query'])[_0x6eec('0xa')](respondWithResult(_0x10c10a,null))[_0x6eec('0x18')](handleError(_0x10c10a,null));};exports[_0x6eec('0x40')]=function(_0x3e77f3,_0x490d27){return respondWithRpcPromise('Trunks',_0x3e77f3['query'])[_0x6eec('0xa')](respondWithResult(_0x490d27,null))[_0x6eec('0x18')](handleError(_0x490d27,null));};exports[_0x6eec('0x41')]=function(_0x1de626,_0x5178f5){return respondWithRpcPromise('Campaigns',_0x1de626[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x5178f5,null))[_0x6eec('0x18')](handleError(_0x5178f5,null));};exports['chatQueues']=function(_0x238605,_0x35f411){return respondWithRpcPromise(_0x6eec('0x42'),_0x238605[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x35f411,null))[_0x6eec('0x18')](handleError(_0x35f411,null));};exports[_0x6eec('0x43')]=function(_0x19fe55,_0x45fed3){return respondWithRpcPromise('ChatQueues',_0x19fe55[_0x6eec('0x17')],routingClient)['then'](findById(_0x19fe55[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x45fed3,null))[_0x6eec('0x18')](handleError(_0x45fed3,null));};exports[_0x6eec('0x44')]=function(_0x248d76,_0x360176){return respondWithRpcPromise(_0x6eec('0x45'),_0x248d76['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x360176,null))['catch'](handleError(_0x360176,null));};exports[_0x6eec('0x46')]=function(_0x5c905f,_0x237324){return respondWithRpcPromise(_0x6eec('0x45'),_0x5c905f[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5c905f[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x237324,null))[_0x6eec('0x18')](handleError(_0x237324,null));};exports[_0x6eec('0x47')]=function(_0x130002,_0x4114d1){return respondWithRpcPromise('MailAccounts',_0x130002['query'],mailClient)[_0x6eec('0xa')](respondWithResult(_0x4114d1,null))[_0x6eec('0x18')](handleError(_0x4114d1,null));};exports[_0x6eec('0x48')]=function(_0x2c0644,_0x20b040){return respondWithRpcPromise('OpenchannelQueues',_0x2c0644[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x20b040,null))['catch'](handleError(_0x20b040,null));};exports['showOpenchannelQueues']=function(_0x5dc8b3,_0xaa2a15){return respondWithRpcPromise(_0x6eec('0x49'),_0x5dc8b3['query'],routingClient)[_0x6eec('0xa')](findById(_0x5dc8b3[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0xaa2a15,null))[_0x6eec('0x18')](handleError(_0xaa2a15,null));};exports[_0x6eec('0x4a')]=function(_0xc852b3,_0x3c1f77){return respondWithRpcPromise('SmsQueues',_0xc852b3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x3c1f77,null))[_0x6eec('0x18')](handleError(_0x3c1f77,null));};exports[_0x6eec('0x4b')]=function(_0x19ca46,_0x34c4b4){return respondWithRpcPromise(_0x6eec('0x4c'),_0x19ca46[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x19ca46[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x34c4b4,null))[_0x6eec('0x18')](handleError(_0x34c4b4,null));};exports[_0x6eec('0x4d')]=function(_0x2799ca,_0x386a67){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2799ca[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x386a67,null))['catch'](handleError(_0x386a67,null));};exports[_0x6eec('0x4f')]=function(_0x2236f7,_0x48bb52){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2236f7[_0x6eec('0x17')],routingClient)['then'](findById(_0x2236f7[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x48bb52,null))[_0x6eec('0x18')](handleError(_0x48bb52,null));};exports[_0x6eec('0x50')]=function(_0x4c73f2,_0x40a81a){return respondWithRpcPromise(_0x6eec('0x51'),_0x4c73f2[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x40a81a,null))[_0x6eec('0x18')](handleError(_0x40a81a,null));};exports[_0x6eec('0x52')]=function(_0x5ae0a0,_0x1ed47e){return respondWithRpcPromise('FaxQueues',_0x5ae0a0[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5ae0a0[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x1ed47e,null))[_0x6eec('0x18')](handleError(_0x1ed47e,null));};exports[_0x6eec('0x53')]=function(_0x404b64,_0x2ea7fe){return respondWithRpcPromise(_0x6eec('0x54'),_0x404b64['query'])[_0x6eec('0xa')](respondWithResult(_0x2ea7fe,null))[_0x6eec('0x18')](handleError(_0x2ea7fe,null));};exports[_0x6eec('0x55')]=function(_0x4eef6e,_0x19f8e2){return respondWithRpcPromise(_0x6eec('0x56'),_0x4eef6e['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x19f8e2,null))[_0x6eec('0x18')](handleError(_0x19f8e2,null));};exports[_0x6eec('0x57')]=function(_0x18e62b,_0x266689){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18e62b[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x266689,null))[_0x6eec('0x18')](handleError(_0x266689,null));};exports[_0x6eec('0x58')]=function(_0x3894dc,_0x56483b){return respondWithRpcPromise(_0x6eec('0x59'),_0x3894dc[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x56483b,null))[_0x6eec('0x18')](handleError(_0x56483b,null));};exports[_0x6eec('0x5a')]=function(_0x232b3a,_0x7dd5d1){return respondWithRpcPromise(_0x6eec('0x59'),_0x232b3a['query'],routingClient)[_0x6eec('0xa')](function(_0x59341a){if(_0x232b3a[_0x6eec('0x17')][_0x6eec('0x5b')]!==undefined){var _0x7a7288=_(_0x59341a[_0x6eec('0x15')])['filter']([_0x232b3a[_0x6eec('0x17')]['type'],_0x232b3a[_0x6eec('0x1b')]['id']])[_0x6eec('0x5c')](_0x6eec('0x5d'))[_0x6eec('0x5e')]()['value']();return _0x59341a['rows']['filter'](function(_0x1158b1){return _0x7a7288[_0x6eec('0x5f')](_0x1158b1[_0x6eec('0x5d')])>-0x1;});}else{return _0x59341a[_0x6eec('0x15')]['filter'](function(_0x44302a){return _0x44302a['queue_id']===parseInt(_0x232b3a[_0x6eec('0x1b')]['id']);});}})[_0x6eec('0xa')](respondWithResult(_0x7dd5d1,null))['catch'](handleError(_0x7dd5d1,null));};exports[_0x6eec('0x60')]=function(_0x2f9e8a,_0x333280){return respondWithRpcPromise(_0x6eec('0x61'),_0x2f9e8a[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x333280,null))['catch'](handleError(_0x333280,null));};exports[_0x6eec('0x62')]=function(_0x5aa2f3,_0x64c2ef){return respondWithRpcPromise(_0x6eec('0x63'),_0x5aa2f3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x64c2ef,null))['catch'](handleError(_0x64c2ef,null));};exports[_0x6eec('0x64')]=function(_0x1d1683,_0x8a4166){return respondWithRpcPromise(_0x6eec('0x65'),_0x1d1683['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x8a4166,null))['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x66')]=function(_0x2c0a85){return function(_0x51560c,_0x3dcf9d){var _0x435562,_0x3a90cd;var _0x328f28=_[_0x6eec('0x67')](_0x2c0a85);var _0x514e15=_0x2c0a85===_0x6eec('0x68')?_0x6eec('0x69'):_0x6eec('0x6a');return db[_0x328f28+_0x6eec('0x6b')][_0x6eec('0x6c')]({'raw':!![],'where':{'id':_0x51560c[_0x6eec('0x1b')]['id']}})['then'](function(_0x4a3af3){if(_[_0x6eec('0x13')](_0x4a3af3)){throw new Error(_0x328f28+_0x6eec('0x6d'));}_0x435562=_0x4a3af3;return db[_0x328f28+'Message']['findOne']({'where':{'id':_0x51560c[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0x328f28+'Interaction'],'as':_0x6eec('0x6f')},{'model':db[_0x328f28+_0x514e15],'as':_0x6eec('0x6a')}]});})[_0x6eec('0xa')](function(_0x5042a0){if(_[_0x6eec('0x13')](_0x5042a0)){throw new Error(_0x328f28+'\x20Message\x20not\x20found');}_0x3a90cd=_0x5042a0;return _0x5042a0[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6eec('0xa')](function(){var _0x585432={'uniqueid':_0x2c0a85+'.'+_0x3a90cd['id']+'.'+_0x3a90cd[_0x6eec('0x6f')]['id'],'FromUserId':_0x51560c[_0x6eec('0x31')]['id'],'type':_0x6eec('0x71')};_0x585432[_0x328f28+'MessageId']=_0x3a90cd['id'];_0x585432[_0x328f28+_0x6eec('0x72')]=_0x3a90cd[_0x6eec('0x6f')]['id'];_0x585432[_0x6eec('0x73')+_0x328f28+_0x514e15+'Id']=_0x3a90cd[_0x6eec('0x6a')]['id'];_0x585432['To'+_0x328f28+_0x6eec('0x74')]=_0x435562['id'];return db[_0x328f28+_0x6eec('0x75')]['create'](_0x585432);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0x2c0a85,'interaction':_0x3a90cd[_0x6eec('0x6f')],'message':_0x3a90cd,'account':_0x3a90cd[_0x6eec('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6eec('0x71'),'appdata':_0x435562[_0x6eec('0x11')]+','+(_0x3a90cd[_0x6eec('0x6a')][_0x6eec('0x77')]||0x12c),'interval':_0x6eec('0x78')}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x3dcf9d,null))[_0x6eec('0x18')](handleError(_0x3dcf9d,null));};};exports[_0x6eec('0x79')]=function(_0x56043a,_0x1419e0){var _0x1d6604,_0x10fad1;if(_[_0x6eec('0x13')](_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')])){throw new Error(_0x6eec('0x7b'));}var _0xa94ada=_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')];var _0xaddba4=_[_0x6eec('0x67')](_0xa94ada);var _0x89aace=_0xa94ada===_0x6eec('0x68')?_0x6eec('0x69'):'Account';return db[_0x6eec('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x56043a[_0x6eec('0x1b')]['id'],'role':_0x6eec('0x3b')}})[_0x6eec('0xa')](function(_0x2607ca){if(_['isNil'](_0x2607ca)){throw new Error(_0x6eec('0x7d'));}_0x1d6604=_0x2607ca;return db[_0xaddba4+'Message'][_0x6eec('0x6c')]({'where':{'id':_0x56043a[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0xaddba4+_0x6eec('0x6f')],'as':_0x6eec('0x6f')},{'model':db[_0xaddba4+_0x89aace],'as':_0x6eec('0x6a')}]});})['then'](function(_0x2888f4){if(_[_0x6eec('0x13')](_0x2888f4)){throw new Error(_0xaddba4+_0x6eec('0x7e'));}_0x10fad1=_0x2888f4;return _0x2888f4[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5229db={'uniqueid':_0xa94ada+'.'+_0x10fad1['id']+'.'+_0x10fad1[_0x6eec('0x6f')]['id'],'FromUserId':_0x56043a[_0x6eec('0x31')]['id'],'type':'queue','ToUserId':_0x1d6604['id']};_0x5229db[_0xaddba4+'MessageId']=_0x10fad1['id'];_0x5229db[_0xaddba4+_0x6eec('0x72')]=_0x10fad1[_0x6eec('0x6f')]['id'];_0x5229db['From'+_0xaddba4+_0x89aace+'Id']=_0x10fad1[_0x6eec('0x6a')]['id'];return db[_0xaddba4+_0x6eec('0x75')]['create'](_0x5229db);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0xa94ada,'interaction':_0x10fad1[_0x6eec('0x6f')],'message':_0x10fad1,'account':_0x10fad1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1d6604['name']+','+(_0x10fad1[_0x6eec('0x6a')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x1419e0,null))['catch'](handleError(_0x1419e0,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7b2e0c1..1fc4cbf 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 _0xa2f2=['../../components/interaction/service','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa2f2,0x1b1));var _0x2a2f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa2f2[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x2a2f('0x0'));var util=require(_0x2a2f('0x1'));var path=require(_0x2a2f('0x2'));var timeout=require(_0x2a2f('0x3'));var express=require(_0x2a2f('0x4'));var router=express[_0x2a2f('0x5')]();var fs_extra=require(_0x2a2f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2a2f('0x7'));var config=require('../../config/environment');var controller=require(_0x2a2f('0x8'));router[_0x2a2f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2a2f('0x9')](_0x2a2f('0xa'),auth[_0x2a2f('0xb')](),controller[_0x2a2f('0xc')]);router[_0x2a2f('0x9')](_0x2a2f('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x2a2f('0xe')]('/',auth[_0x2a2f('0xb')](),controller[_0x2a2f('0xf')]);router[_0x2a2f('0x10')](_0x2a2f('0xa'),auth['isAuthenticated'](),controller[_0x2a2f('0x11')]);router['delete'](_0x2a2f('0xa'),auth[_0x2a2f('0xb')](),controller[_0x2a2f('0x12')]);module[_0x2a2f('0x13')]=router; \ No newline at end of file +var _0xa3bc=['post','create','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','./schedule.controller','get','isAuthenticated','/:id','/:id/run'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa3bc,0x176));var _0xca3b=function(_0x3dee42,_0x91eeb2){_0x3dee42=_0x3dee42-0x0;var _0x3d19ce=_0xa3bc[_0x3dee42];return _0x3d19ce;};'use strict';var multer=require(_0xca3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xca3b('0x1'));var express=require('express');var router=express[_0xca3b('0x2')]();var fs_extra=require(_0xca3b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xca3b('0x4'));var config=require('../../config/environment');var controller=require(_0xca3b('0x5'));router[_0xca3b('0x6')]('/',auth[_0xca3b('0x7')](),controller['index']);router['get'](_0xca3b('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xca3b('0x6')](_0xca3b('0x9'),auth['isAuthenticated'](),controller['run']);router[_0xca3b('0xa')]('/',auth[_0xca3b('0x7')](),controller[_0xca3b('0xb')]);router[_0xca3b('0xc')]('/:id',auth[_0xca3b('0x7')](),controller[_0xca3b('0xd')]);router[_0xca3b('0xe')](_0xca3b('0x8'),auth[_0xca3b('0x7')](),controller[_0xca3b('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c377062..8bde2fa 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 _0xedaa=['csv','custom','TEXT','sequelize','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM'];(function(_0x40124e,_0x47920b){var _0x2e8dc2=function(_0x3a6674){while(--_0x3a6674){_0x40124e['push'](_0x40124e['shift']());}};_0x2e8dc2(++_0x47920b);}(_0xedaa,0x9c));var _0xaeda=function(_0x46c1a3,_0x30cf89){_0x46c1a3=_0x46c1a3-0x0;var _0xe8d0d=_0xedaa[_0x46c1a3];return _0xe8d0d;};'use strict';var Sequelize=require(_0xaeda('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xaeda('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xaeda('0x2')],'allowNull':![],'defaultValue':_0xaeda('0x3')},'startAt':{'type':Sequelize[_0xaeda('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xaeda('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xaeda('0x6'),_0xaeda('0x7'),_0xaeda('0x8'),_0xaeda('0x9'),_0xaeda('0xa'),_0xaeda('0xb'),_0xaeda('0xc')),'allowNull':![],'defaultValue':_0xaeda('0xa')},'output':{'type':Sequelize[_0xaeda('0xd')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0xaeda('0xe')},'type':{'type':Sequelize[_0xaeda('0xd')](_0xaeda('0xf'),'default'),'allowNull':![],'defaultValue':_0xaeda('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xaeda('0x2')]},'cc':{'type':Sequelize[_0xaeda('0x10')]},'bcc':{'type':Sequelize[_0xaeda('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xaeda('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x01f3=['INTEGER','ENUM','months','days','hours','minutes','csv','pdf','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x20bbc6,_0x20acb3){var _0x249abc=function(_0x5d0dc0){while(--_0x5d0dc0){_0x20bbc6['push'](_0x20bbc6['shift']());}};_0x249abc(++_0x20acb3);}(_0x01f3,0x145));var _0x301f=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0x01f3[_0x306106];return _0x4d6083;};'use strict';var Sequelize=require(_0x301f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x301f('0x1')]},'active':{'type':Sequelize[_0x301f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x301f('0x1')],'allowNull':![],'defaultValue':_0x301f('0x3')},'startAt':{'type':Sequelize[_0x301f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x301f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x301f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x301f('0x6')]('years','quarters',_0x301f('0x7'),'weeks',_0x301f('0x8'),_0x301f('0x9'),_0x301f('0xa')),'allowNull':![],'defaultValue':_0x301f('0x8')},'output':{'type':Sequelize[_0x301f('0x6')](_0x301f('0xb'),_0x301f('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x301f('0xb')},'type':{'type':Sequelize[_0x301f('0x6')](_0x301f('0xd'),'default'),'allowNull':![],'defaultValue':_0x301f('0xd')},'sendMail':{'type':Sequelize[_0x301f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x301f('0x1')]},'cc':{'type':Sequelize[_0x301f('0xe')]},'bcc':{'type':Sequelize[_0x301f('0xe')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6691b16..8912a18 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 _0x54e2=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','Schedule','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','limit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','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','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api'];(function(_0x18683e,_0x202408){var _0x54c644=function(_0x2c7f36){while(--_0x2c7f36){_0x18683e['push'](_0x18683e['shift']());}};_0x54c644(++_0x202408);}(_0x54e2,0x94));var _0x254e=function(_0x31c3a4,_0x2e1baa){_0x31c3a4=_0x31c3a4-0x0;var _0x3c838b=_0x54e2[_0x31c3a4];return _0x3c838b;};'use strict';var emlformat=require(_0x254e('0x0'));var rimraf=require(_0x254e('0x1'));var zipdir=require(_0x254e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x254e('0x3'));var moment=require(_0x254e('0x4'));var BPromise=require(_0x254e('0x5'));var Mustache=require('mustache');var util=require(_0x254e('0x6'));var path=require(_0x254e('0x7'));var sox=require(_0x254e('0x8'));var csv=require(_0x254e('0x9'));var ejs=require(_0x254e('0xa'));var fs=require('fs');var fs_extra=require(_0x254e('0xb'));var _=require(_0x254e('0xc'));var squel=require(_0x254e('0xd'));var crypto=require(_0x254e('0xe'));var jsforce=require(_0x254e('0xf'));var deskjs=require(_0x254e('0x10'));var toCsv=require(_0x254e('0x9'));var querystring=require(_0x254e('0x11'));var Papa=require('papaparse');var Redis=require(_0x254e('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x254e('0x13'));var logger=require(_0x254e('0x14'))(_0x254e('0x15'));var utils=require(_0x254e('0x16'));var config=require(_0x254e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x254e('0x18'))['db'];function respondWithStatusCode(_0x46353b,_0x3960a3){_0x3960a3=_0x3960a3||0xcc;return function(_0x1697eb){if(_0x1697eb){return _0x46353b[_0x254e('0x19')](_0x3960a3);}return _0x46353b[_0x254e('0x1a')](_0x3960a3)['end']();};}function respondWithResult(_0x450ea1,_0x386937){_0x386937=_0x386937||0xc8;return function(_0x1a2931){if(_0x1a2931){return _0x450ea1['status'](_0x386937)[_0x254e('0x1b')](_0x1a2931);}};}function respondWithFilteredResult(_0x4fe941,_0x907695){return function(_0x144740){if(_0x144740){var _0x3cc80d=typeof _0x907695[_0x254e('0x1c')]===_0x254e('0x1d')&&typeof _0x907695['limit']==='undefined';var _0xb3f317=_0x144740[_0x254e('0x1e')];var _0x34f859=_0x3cc80d?0x0:_0x907695[_0x254e('0x1c')];var _0x553f37=_0x3cc80d?_0x144740[_0x254e('0x1e')]:_0x907695['offset']+_0x907695['limit'];var _0xbe3c80;if(_0x553f37>=_0xb3f317){_0x553f37=_0xb3f317;_0xbe3c80=0xc8;}else{_0xbe3c80=0xce;}_0x4fe941['status'](_0xbe3c80);return _0x4fe941['set'](_0x254e('0x1f'),_0x34f859+'-'+_0x553f37+'/'+_0xb3f317)['json'](_0x144740);}return null;};}function patchUpdates(_0x28a2f1){return function(_0x162e98){try{jsonpatch[_0x254e('0x20')](_0x162e98,_0x28a2f1,!![]);}catch(_0x36ce3f){return BPromise[_0x254e('0x21')](_0x36ce3f);}return _0x162e98[_0x254e('0x22')]();};}function saveUpdates(_0x413fa6,_0x1c31bf){return function(_0x237a25){if(_0x237a25){return _0x237a25['update'](_0x413fa6)[_0x254e('0x23')](function(_0x33f707){return _0x33f707;});}return null;};}function removeEntity(_0x2e40b6,_0x15a3b8){return function(_0x25591d){if(_0x25591d){return _0x25591d[_0x254e('0x24')]()['then'](function(){var _0x4a22da=_0x25591d[_0x254e('0x25')]({'plain':!![]});var _0x4392bb=_0x254e('0x26');return db[_0x254e('0x27')][_0x254e('0x24')]({'where':{'type':_0x4392bb,'resourceId':_0x4a22da['id']}})[_0x254e('0x23')](function(){return _0x25591d;});})['then'](function(){_0x2e40b6[_0x254e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ad74,_0x4a255e){return function(_0x45d27f){if(!_0x45d27f){_0x55ad74[_0x254e('0x19')](0x194);}return _0x45d27f;};}function handleError(_0x1febdc,_0x4201db){_0x4201db=_0x4201db||0x1f4;return function(_0x5d050a){logger[_0x254e('0x28')](_0x5d050a[_0x254e('0x29')]);if(_0x5d050a[_0x254e('0x2a')]){delete _0x5d050a[_0x254e('0x2a')];}_0x1febdc['status'](_0x4201db)['send'](_0x5d050a);};}exports[_0x254e('0x2b')]=function(_0x5042ff,_0x5d9a08){var _0x4e8ded={},_0x258f9a={},_0x164941={'count':0x0,'rows':[]};var _0x45e32f=_['map'](db[_0x254e('0x2c')][_0x254e('0x2d')],function(_0x1a72d2){return{'name':_0x1a72d2[_0x254e('0x2e')],'type':_0x1a72d2[_0x254e('0x2f')][_0x254e('0x30')]};});_0x258f9a[_0x254e('0x31')]=_[_0x254e('0x32')](_0x45e32f,'name');_0x258f9a['query']=_[_0x254e('0x33')](_0x5042ff[_0x254e('0x34')]);_0x258f9a[_0x254e('0x35')]=_['intersection'](_0x258f9a[_0x254e('0x31')],_0x258f9a[_0x254e('0x34')]);_0x4e8ded[_0x254e('0x36')]=_[_0x254e('0x37')](_0x258f9a['model'],qs['fields'](_0x5042ff[_0x254e('0x34')][_0x254e('0x38')]));_0x4e8ded[_0x254e('0x36')]=_0x4e8ded['attributes']['length']?_0x4e8ded[_0x254e('0x36')]:_0x258f9a[_0x254e('0x31')];if(!_0x5042ff[_0x254e('0x34')]['hasOwnProperty']('nolimit')){_0x4e8ded[_0x254e('0x39')]=qs[_0x254e('0x39')](_0x5042ff['query'][_0x254e('0x39')]);_0x4e8ded[_0x254e('0x1c')]=qs[_0x254e('0x1c')](_0x5042ff[_0x254e('0x34')]['offset']);}_0x4e8ded['order']=qs[_0x254e('0x3a')](_0x5042ff[_0x254e('0x34')][_0x254e('0x3a')]);_0x4e8ded['where']=qs['filters'](_[_0x254e('0x3b')](_0x5042ff[_0x254e('0x34')],_0x258f9a['filters']),_0x45e32f);if(_0x5042ff[_0x254e('0x34')][_0x254e('0x3c')]){_0x4e8ded[_0x254e('0x3d')]=_[_0x254e('0x3e')](_0x4e8ded[_0x254e('0x3d')],{'$or':_[_0x254e('0x32')](_0x45e32f,function(_0x2df54a){if(_0x2df54a[_0x254e('0x2f')]!=='VIRTUAL'){var _0x394478={};_0x394478[_0x2df54a[_0x254e('0x2a')]]={'$like':'%'+_0x5042ff['query'][_0x254e('0x3c')]+'%'};return _0x394478;}})});}_0x4e8ded=_[_0x254e('0x3e')]({},_0x4e8ded,_0x5042ff[_0x254e('0x3f')]);var _0x1ff33f={'where':_0x4e8ded['where']};return db[_0x254e('0x2c')][_0x254e('0x1e')](_0x1ff33f)[_0x254e('0x23')](function(_0x3c9c87){_0x164941[_0x254e('0x1e')]=_0x3c9c87;if(_0x5042ff[_0x254e('0x34')][_0x254e('0x40')]){_0x4e8ded[_0x254e('0x41')]=[{'all':!![]}];}return db[_0x254e('0x2c')][_0x254e('0x42')](_0x4e8ded);})['then'](function(_0x334e5e){_0x164941[_0x254e('0x43')]=_0x334e5e;return _0x164941;})['then'](respondWithFilteredResult(_0x5d9a08,_0x4e8ded))['catch'](handleError(_0x5d9a08,null));};exports[_0x254e('0x44')]=function(_0x12d1f6,_0x300e2a){var _0x47600c={'raw':![],'where':{'id':_0x12d1f6[_0x254e('0x45')]['id']}},_0x7919a8={};_0x7919a8[_0x254e('0x31')]=_['keys'](db[_0x254e('0x2c')][_0x254e('0x2d')]);_0x7919a8['query']=_[_0x254e('0x33')](_0x12d1f6[_0x254e('0x34')]);_0x7919a8[_0x254e('0x35')]=_[_0x254e('0x37')](_0x7919a8[_0x254e('0x31')],_0x7919a8[_0x254e('0x34')]);_0x47600c[_0x254e('0x36')]=_[_0x254e('0x37')](_0x7919a8[_0x254e('0x31')],qs[_0x254e('0x38')](_0x12d1f6['query']['fields']));_0x47600c[_0x254e('0x36')]=_0x47600c[_0x254e('0x36')][_0x254e('0x46')]?_0x47600c[_0x254e('0x36')]:_0x7919a8[_0x254e('0x31')];if(_0x12d1f6[_0x254e('0x34')][_0x254e('0x40')]){_0x47600c[_0x254e('0x41')]=[{'all':!![]}];}_0x47600c=_['merge']({},_0x47600c,_0x12d1f6[_0x254e('0x3f')]);return db[_0x254e('0x2c')][_0x254e('0x47')](_0x47600c)[_0x254e('0x23')](handleEntityNotFound(_0x300e2a,null))['then'](respondWithResult(_0x300e2a,null))[_0x254e('0x48')](handleError(_0x300e2a,null));};exports[_0x254e('0x49')]=function(_0xf3cd64,_0x1cbbc4){return db[_0x254e('0x2c')][_0x254e('0x49')](_0xf3cd64[_0x254e('0x4a')],{})[_0x254e('0x23')](function(_0x183281){var _0x3b9842=_0xf3cd64[_0x254e('0x4b')][_0x254e('0x25')]({'plain':!![]});if(!_0x3b9842)throw new Error(_0x254e('0x4c'));if(_0x3b9842[_0x254e('0x4d')]===_0x254e('0x4b')){var _0x33f79d=_0x183281[_0x254e('0x25')]({'plain':!![]});var _0x2e99e7=_0x254e('0x26');return db[_0x254e('0x4e')][_0x254e('0x47')]({'where':{'name':_0x2e99e7,'userProfileId':_0x3b9842[_0x254e('0x4f')]},'raw':!![]})[_0x254e('0x23')](function(_0x1c96f8){if(_0x1c96f8&&_0x1c96f8[_0x254e('0x50')]===0x0){return db[_0x254e('0x27')][_0x254e('0x49')]({'name':_0x33f79d[_0x254e('0x2a')],'resourceId':_0x33f79d['id'],'type':_0x1c96f8[_0x254e('0x2a')],'sectionId':_0x1c96f8['id']},{})[_0x254e('0x23')](function(){return _0x183281;});}else{return _0x183281;}})[_0x254e('0x48')](function(_0x5f2de4){logger[_0x254e('0x28')](_0x254e('0x51'),_0x5f2de4);throw _0x5f2de4;});}return _0x183281;})[_0x254e('0x23')](respondWithResult(_0x1cbbc4,0xc9))[_0x254e('0x48')](handleError(_0x1cbbc4,null));};exports[_0x254e('0x52')]=function(_0x35aea3,_0x54bfc1){if(_0x35aea3[_0x254e('0x4a')]['id']){delete _0x35aea3[_0x254e('0x4a')]['id'];}return db[_0x254e('0x2c')][_0x254e('0x47')]({'where':{'id':_0x35aea3[_0x254e('0x45')]['id']}})[_0x254e('0x23')](handleEntityNotFound(_0x54bfc1,null))[_0x254e('0x23')](saveUpdates(_0x35aea3[_0x254e('0x4a')],null))['then'](respondWithResult(_0x54bfc1,null))['catch'](handleError(_0x54bfc1,null));};exports[_0x254e('0x24')]=function(_0x335d5a,_0x23f672){return db[_0x254e('0x2c')]['find']({'where':{'id':_0x335d5a[_0x254e('0x45')]['id']}})[_0x254e('0x23')](handleEntityNotFound(_0x23f672,null))[_0x254e('0x23')](removeEntity(_0x23f672,null))[_0x254e('0x48')](handleError(_0x23f672,null));};exports[_0x254e('0x53')]=function(_0x35ca49,_0x409b71,_0x2100fd){var _0x5e0046=require(_0x254e('0x54'));return db[_0x254e('0x2c')][_0x254e('0x47')]({'where':{'id':_0x35ca49[_0x254e('0x45')]['id']},'raw':!![]})[_0x254e('0x23')](handleEntityNotFound(_0x409b71,null))[_0x254e('0x23')](function(){_0x5e0046[_0x254e('0x53')](_0x35ca49[_0x254e('0x45')]['id']);})[_0x254e('0x23')](respondWithStatusCode(_0x409b71,null))[_0x254e('0x48')](handleError(_0x409b71,null));}; \ No newline at end of file +var _0x792f=['model','attributes','fields','length','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','query','keys','filters','intersection'];(function(_0x37d3e7,_0x278a78){var _0x495d47=function(_0x193181){while(--_0x193181){_0x37d3e7['push'](_0x37d3e7['shift']());}};_0x495d47(++_0x278a78);}(_0x792f,0x1b0));var _0xf792=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0x792f[_0x37a7c6];return _0x539905;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf792('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf792('0x1'));var rp=require(_0xf792('0x2'));var moment=require(_0xf792('0x3'));var BPromise=require(_0xf792('0x4'));var Mustache=require(_0xf792('0x5'));var util=require(_0xf792('0x6'));var path=require(_0xf792('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf792('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf792('0x9'));var crypto=require(_0xf792('0xa'));var jsforce=require(_0xf792('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf792('0xc'));var Papa=require(_0xf792('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf792('0xe'));var as=require(_0xf792('0xf'));var hardwareService=require(_0xf792('0x10'));var logger=require(_0xf792('0x11'))(_0xf792('0x12'));var utils=require(_0xf792('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf792('0x14'));var db=require(_0xf792('0x15'))['db'];function respondWithStatusCode(_0x1d2589,_0x34bce6){_0x34bce6=_0x34bce6||0xcc;return function(_0x3f1cfb){if(_0x3f1cfb){return _0x1d2589[_0xf792('0x16')](_0x34bce6);}return _0x1d2589[_0xf792('0x17')](_0x34bce6)[_0xf792('0x18')]();};}function respondWithResult(_0x297e98,_0x261f57){_0x261f57=_0x261f57||0xc8;return function(_0x55af28){if(_0x55af28){return _0x297e98[_0xf792('0x17')](_0x261f57)[_0xf792('0x19')](_0x55af28);}};}function respondWithFilteredResult(_0x4ea1f1,_0x219d5a){return function(_0x249a4e){if(_0x249a4e){var _0x29153d=typeof _0x219d5a[_0xf792('0x1a')]===_0xf792('0x1b')&&typeof _0x219d5a['limit']===_0xf792('0x1b');var _0x2d6b0f=_0x249a4e[_0xf792('0x1c')];var _0x493a81=_0x29153d?0x0:_0x219d5a['offset'];var _0x11208f=_0x29153d?_0x249a4e['count']:_0x219d5a[_0xf792('0x1a')]+_0x219d5a['limit'];var _0x504e8d;if(_0x11208f>=_0x2d6b0f){_0x11208f=_0x2d6b0f;_0x504e8d=0xc8;}else{_0x504e8d=0xce;}_0x4ea1f1[_0xf792('0x17')](_0x504e8d);return _0x4ea1f1[_0xf792('0x1d')](_0xf792('0x1e'),_0x493a81+'-'+_0x11208f+'/'+_0x2d6b0f)[_0xf792('0x19')](_0x249a4e);}return null;};}function patchUpdates(_0x3808c7){return function(_0x12ba2d){try{jsonpatch[_0xf792('0x1f')](_0x12ba2d,_0x3808c7,!![]);}catch(_0x290921){return BPromise[_0xf792('0x20')](_0x290921);}return _0x12ba2d[_0xf792('0x21')]();};}function saveUpdates(_0x6b564c,_0x16f955){return function(_0x5b6de4){if(_0x5b6de4){return _0x5b6de4[_0xf792('0x22')](_0x6b564c)[_0xf792('0x23')](function(_0x1d9952){return _0x1d9952;});}return null;};}function removeEntity(_0x29f267,_0x545688){return function(_0x852f2b){if(_0x852f2b){return _0x852f2b['destroy']()['then'](function(){var _0x296e83=_0x852f2b[_0xf792('0x24')]({'plain':!![]});var _0x2d628a=_0xf792('0x25');return db[_0xf792('0x26')][_0xf792('0x27')]({'where':{'type':_0x2d628a,'resourceId':_0x296e83['id']}})[_0xf792('0x23')](function(){return _0x852f2b;});})[_0xf792('0x23')](function(){_0x29f267[_0xf792('0x17')](0xcc)[_0xf792('0x18')]();});}};}function handleEntityNotFound(_0x93b926,_0x2d1efe){return function(_0x2e8fb2){if(!_0x2e8fb2){_0x93b926[_0xf792('0x16')](0x194);}return _0x2e8fb2;};}function handleError(_0x2859fd,_0x49d791){_0x49d791=_0x49d791||0x1f4;return function(_0x1c28c5){logger[_0xf792('0x28')](_0x1c28c5[_0xf792('0x29')]);if(_0x1c28c5[_0xf792('0x2a')]){delete _0x1c28c5[_0xf792('0x2a')];}_0x2859fd[_0xf792('0x17')](_0x49d791)[_0xf792('0x2b')](_0x1c28c5);};}exports[_0xf792('0x2c')]=function(_0x367f78,_0x139125){var _0x3c9dd0={},_0x454f59={},_0x24838d={'count':0x0,'rows':[]};var _0x4226fc=_[_0xf792('0x2d')](db[_0xf792('0x2e')][_0xf792('0x2f')],function(_0x558f6e){return{'name':_0x558f6e[_0xf792('0x30')],'type':_0x558f6e[_0xf792('0x31')]['key']};});_0x454f59['model']=_['map'](_0x4226fc,'name');_0x454f59[_0xf792('0x32')]=_[_0xf792('0x33')](_0x367f78[_0xf792('0x32')]);_0x454f59[_0xf792('0x34')]=_[_0xf792('0x35')](_0x454f59[_0xf792('0x36')],_0x454f59['query']);_0x3c9dd0[_0xf792('0x37')]=_['intersection'](_0x454f59[_0xf792('0x36')],qs[_0xf792('0x38')](_0x367f78['query']['fields']));_0x3c9dd0[_0xf792('0x37')]=_0x3c9dd0[_0xf792('0x37')][_0xf792('0x39')]?_0x3c9dd0[_0xf792('0x37')]:_0x454f59[_0xf792('0x36')];if(!_0x367f78[_0xf792('0x32')]['hasOwnProperty'](_0xf792('0x3a'))){_0x3c9dd0[_0xf792('0x3b')]=qs[_0xf792('0x3b')](_0x367f78[_0xf792('0x32')]['limit']);_0x3c9dd0[_0xf792('0x1a')]=qs[_0xf792('0x1a')](_0x367f78['query'][_0xf792('0x1a')]);}_0x3c9dd0['order']=qs[_0xf792('0x3c')](_0x367f78[_0xf792('0x32')][_0xf792('0x3c')]);_0x3c9dd0['where']=qs[_0xf792('0x34')](_['pick'](_0x367f78[_0xf792('0x32')],_0x454f59[_0xf792('0x34')]),_0x4226fc);if(_0x367f78[_0xf792('0x32')][_0xf792('0x3d')]){_0x3c9dd0[_0xf792('0x3e')]=_[_0xf792('0x3f')](_0x3c9dd0['where'],{'$or':_['map'](_0x4226fc,function(_0x43efe9){if(_0x43efe9[_0xf792('0x31')]!==_0xf792('0x40')){var _0x33f841={};_0x33f841[_0x43efe9[_0xf792('0x2a')]]={'$like':'%'+_0x367f78['query'][_0xf792('0x3d')]+'%'};return _0x33f841;}})});}_0x3c9dd0=_[_0xf792('0x3f')]({},_0x3c9dd0,_0x367f78[_0xf792('0x41')]);var _0x32c9f7={'where':_0x3c9dd0[_0xf792('0x3e')]};return db[_0xf792('0x2e')]['count'](_0x32c9f7)[_0xf792('0x23')](function(_0x31e4fd){_0x24838d[_0xf792('0x1c')]=_0x31e4fd;if(_0x367f78[_0xf792('0x32')][_0xf792('0x42')]){_0x3c9dd0[_0xf792('0x43')]=[{'all':!![]}];}return db['Schedule'][_0xf792('0x44')](_0x3c9dd0);})[_0xf792('0x23')](function(_0x510bf9){_0x24838d['rows']=_0x510bf9;return _0x24838d;})[_0xf792('0x23')](respondWithFilteredResult(_0x139125,_0x3c9dd0))['catch'](handleError(_0x139125,null));};exports['show']=function(_0x4e2853,_0x19c23b){var _0x34551c={'raw':![],'where':{'id':_0x4e2853['params']['id']}},_0x55da22={};_0x55da22[_0xf792('0x36')]=_['keys'](db[_0xf792('0x2e')][_0xf792('0x2f')]);_0x55da22[_0xf792('0x32')]=_['keys'](_0x4e2853[_0xf792('0x32')]);_0x55da22['filters']=_[_0xf792('0x35')](_0x55da22[_0xf792('0x36')],_0x55da22[_0xf792('0x32')]);_0x34551c['attributes']=_[_0xf792('0x35')](_0x55da22[_0xf792('0x36')],qs[_0xf792('0x38')](_0x4e2853[_0xf792('0x32')][_0xf792('0x38')]));_0x34551c['attributes']=_0x34551c[_0xf792('0x37')][_0xf792('0x39')]?_0x34551c[_0xf792('0x37')]:_0x55da22[_0xf792('0x36')];if(_0x4e2853[_0xf792('0x32')][_0xf792('0x42')]){_0x34551c['include']=[{'all':!![]}];}_0x34551c=_[_0xf792('0x3f')]({},_0x34551c,_0x4e2853['options']);return db['Schedule']['find'](_0x34551c)['then'](handleEntityNotFound(_0x19c23b,null))[_0xf792('0x23')](respondWithResult(_0x19c23b,null))[_0xf792('0x45')](handleError(_0x19c23b,null));};exports[_0xf792('0x46')]=function(_0xea0ee5,_0x398580){return db[_0xf792('0x2e')][_0xf792('0x46')](_0xea0ee5['body'],{})['then'](function(_0x19ecb2){var _0x78a35=_0xea0ee5[_0xf792('0x47')][_0xf792('0x24')]({'plain':!![]});if(!_0x78a35)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x78a35[_0xf792('0x48')]===_0xf792('0x47')){var _0x36ead7=_0x19ecb2[_0xf792('0x24')]({'plain':!![]});var _0x2e56ae=_0xf792('0x25');return db[_0xf792('0x49')][_0xf792('0x4a')]({'where':{'name':_0x2e56ae,'userProfileId':_0x78a35[_0xf792('0x4b')]},'raw':!![]})[_0xf792('0x23')](function(_0x53efb4){if(_0x53efb4&&_0x53efb4[_0xf792('0x4c')]===0x0){return db[_0xf792('0x26')][_0xf792('0x46')]({'name':_0x36ead7[_0xf792('0x2a')],'resourceId':_0x36ead7['id'],'type':_0x53efb4[_0xf792('0x2a')],'sectionId':_0x53efb4['id']},{})[_0xf792('0x23')](function(){return _0x19ecb2;});}else{return _0x19ecb2;}})[_0xf792('0x45')](function(_0xf46f3b){logger['error'](_0xf792('0x4d'),_0xf46f3b);throw _0xf46f3b;});}return _0x19ecb2;})['then'](respondWithResult(_0x398580,0xc9))[_0xf792('0x45')](handleError(_0x398580,null));};exports[_0xf792('0x22')]=function(_0x25676c,_0x30bcae){if(_0x25676c[_0xf792('0x4e')]['id']){delete _0x25676c[_0xf792('0x4e')]['id'];}return db[_0xf792('0x2e')][_0xf792('0x4a')]({'where':{'id':_0x25676c[_0xf792('0x4f')]['id']}})[_0xf792('0x23')](handleEntityNotFound(_0x30bcae,null))[_0xf792('0x23')](saveUpdates(_0x25676c[_0xf792('0x4e')],null))['then'](respondWithResult(_0x30bcae,null))[_0xf792('0x45')](handleError(_0x30bcae,null));};exports['destroy']=function(_0x536514,_0x3a08d7){return db['Schedule'][_0xf792('0x4a')]({'where':{'id':_0x536514[_0xf792('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3a08d7,null))[_0xf792('0x23')](removeEntity(_0x3a08d7,null))[_0xf792('0x45')](handleError(_0x3a08d7,null));};exports[_0xf792('0x50')]=function(_0x55e19f,_0x43c9c1,_0x5dd9c2){var _0x65fcb7=require('../../config/schedule');return db[_0xf792('0x2e')][_0xf792('0x4a')]({'where':{'id':_0x55e19f[_0xf792('0x4f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43c9c1,null))[_0xf792('0x23')](function(){_0x65fcb7[_0xf792('0x50')](_0x55e19f['params']['id']);})[_0xf792('0x23')](respondWithStatusCode(_0x43c9c1,null))[_0xf792('0x45')](handleError(_0x43c9c1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index a830642..e2eedb5 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 _0x3634=['moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x16114c,_0xca56dd){var _0x2f4225=function(_0x5a0119){while(--_0x5a0119){_0x16114c['push'](_0x16114c['shift']());}};_0x2f4225(++_0xca56dd);}(_0x3634,0x195));var _0x4363=function(_0x5cd30a,_0x3fd915){_0x5cd30a=_0x5cd30a-0x0;var _0x4c1a08=_0x3634[_0x5cd30a];return _0x4c1a08;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4363('0x0'));var BPromise=require('bluebird');var rp=require(_0x4363('0x1'));var fs=require('fs');var path=require(_0x4363('0x2'));var rimraf=require(_0x4363('0x3'));var config=require(_0x4363('0x4'));var attributes=require(_0x4363('0x5'));module['exports']=function(_0x5e2e93,_0x380028){return _0x5e2e93[_0x4363('0x6')](_0x4363('0x7'),attributes,{'tableName':_0x4363('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe026=['bluebird','request-promise','path','../../config/environment','./schedule.attributes','exports','define','Schedule','util','../../config/logger'];(function(_0x1efff7,_0x4981cb){var _0x1a88c4=function(_0x5adcc0){while(--_0x5adcc0){_0x1efff7['push'](_0x1efff7['shift']());}};_0x1a88c4(++_0x4981cb);}(_0xe026,0x80));var _0x6e02=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xe026[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require('lodash');var util=require(_0x6e02('0x0'));var logger=require(_0x6e02('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6e02('0x2'));var rp=require(_0x6e02('0x3'));var fs=require('fs');var path=require(_0x6e02('0x4'));var rimraf=require('rimraf');var config=require(_0x6e02('0x5'));var attributes=require(_0x6e02('0x6'));module[_0x6e02('0x7')]=function(_0x2f9859,_0x2e1c4c){return _0x2f9859[_0x6e02('0x8')](_0x6e02('0x9'),attributes,{'tableName':'tools_schedules','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 91fb9ec..ed7b0a1 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 _0x9c90=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Schedule,\x20%s,\x20%s'];(function(_0x65c6fc,_0x56fcaf){var _0x20e1d9=function(_0x5cb964){while(--_0x5cb964){_0x65c6fc['push'](_0x65c6fc['shift']());}};_0x20e1d9(++_0x56fcaf);}(_0x9c90,0x1ac));var _0x09c9=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x9c90[_0x31a37b];return _0x49ae16;};'use strict';var _=require('lodash');var util=require(_0x09c9('0x0'));var moment=require(_0x09c9('0x1'));var BPromise=require(_0x09c9('0x2'));var rs=require(_0x09c9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09c9('0x4'))['db'];var utils=require(_0x09c9('0x5'));var logger=require(_0x09c9('0x6'))(_0x09c9('0x7'));var config=require(_0x09c9('0x8'));var jayson=require(_0x09c9('0x9'));var client=jayson[_0x09c9('0xa')][_0x09c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3710d6,_0x427dbc,_0x1b6f27){return new BPromise(function(_0x3930ac,_0x5389dc){return client[_0x09c9('0xc')](_0x3710d6,_0x1b6f27)[_0x09c9('0xd')](function(_0x285396){logger[_0x09c9('0xe')]('Schedule,\x20%s,\x20%s',_0x427dbc,'request\x20sent');logger[_0x09c9('0xf')](_0x09c9('0x10'),_0x427dbc,_0x09c9('0x11'),JSON[_0x09c9('0x12')](_0x285396));if(_0x285396[_0x09c9('0x13')]){if(_0x285396[_0x09c9('0x13')][_0x09c9('0x14')]===0x1f4){logger[_0x09c9('0x13')](_0x09c9('0x15'),_0x427dbc,_0x285396[_0x09c9('0x13')][_0x09c9('0x16')]);return _0x5389dc(_0x285396[_0x09c9('0x13')][_0x09c9('0x16')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x427dbc,_0x285396[_0x09c9('0x13')][_0x09c9('0x16')]);return _0x3930ac(_0x285396[_0x09c9('0x13')][_0x09c9('0x16')]);}else{logger[_0x09c9('0xe')](_0x09c9('0x15'),_0x427dbc,_0x09c9('0x11'));_0x3930ac(_0x285396[_0x09c9('0x17')]['message']);}})[_0x09c9('0x18')](function(_0x4b51e7){logger[_0x09c9('0x13')](_0x09c9('0x15'),_0x427dbc,_0x4b51e7);_0x5389dc(_0x4b51e7);});});} \ No newline at end of file +var _0xd41a=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb'];(function(_0xd212a8,_0x131d6c){var _0x3a7145=function(_0x21dcd4){while(--_0x21dcd4){_0xd212a8['push'](_0xd212a8['shift']());}};_0x3a7145(++_0x131d6c);}(_0xd41a,0x177));var _0xad41=function(_0x23ef1f,_0x127dd2){_0x23ef1f=_0x23ef1f-0x0;var _0x234192=_0xd41a[_0x23ef1f];return _0x234192;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xad41('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad41('0x1'));var db=require(_0xad41('0x2'))['db'];var utils=require(_0xad41('0x3'));var logger=require(_0xad41('0x4'))('rpc');var config=require(_0xad41('0x5'));var jayson=require(_0xad41('0x6'));var client=jayson['client'][_0xad41('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x556a22,_0x468ef9,_0x526af3){return new BPromise(function(_0x1b48b5,_0x4132ae){return client[_0xad41('0x8')](_0x556a22,_0x526af3)[_0xad41('0x9')](function(_0x203de1){logger[_0xad41('0xa')](_0xad41('0xb'),_0x468ef9,_0xad41('0xc'));logger[_0xad41('0xd')](_0xad41('0xe'),_0x468ef9,_0xad41('0xc'),JSON[_0xad41('0xf')](_0x203de1));if(_0x203de1[_0xad41('0x10')]){if(_0x203de1[_0xad41('0x10')][_0xad41('0x11')]===0x1f4){logger[_0xad41('0x10')](_0xad41('0xb'),_0x468ef9,_0x203de1[_0xad41('0x10')][_0xad41('0x12')]);return _0x4132ae(_0x203de1[_0xad41('0x10')]['message']);}logger[_0xad41('0x10')]('Schedule,\x20%s,\x20%s',_0x468ef9,_0x203de1[_0xad41('0x10')][_0xad41('0x12')]);return _0x1b48b5(_0x203de1[_0xad41('0x10')][_0xad41('0x12')]);}else{logger[_0xad41('0xa')](_0xad41('0xb'),_0x468ef9,_0xad41('0xc'));_0x1b48b5(_0x203de1[_0xad41('0x13')][_0xad41('0x12')]);}})[_0xad41('0x14')](function(_0x2b54cc){logger[_0xad41('0x10')]('Schedule,\x20%s,\x20%s',_0x468ef9,_0x2b54cc);_0x4132ae(_0x2b54cc);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 370da22..ae727c9 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 _0x0961=['put','update','delete','destroy','exports','util','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create'];(function(_0x25ec5f,_0x400929){var _0x1cb878=function(_0x487d63){while(--_0x487d63){_0x25ec5f['push'](_0x25ec5f['shift']());}};_0x1cb878(++_0x400929);}(_0x0961,0x71));var _0x1096=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x0961[_0x292f93];return _0x5a94b1;};'use strict';var multer=require('multer');var util=require(_0x1096('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1096('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x1096('0x2'));var controller=require('./screenRecording.controller');router[_0x1096('0x3')]('/',auth[_0x1096('0x4')](),controller[_0x1096('0x5')]);router[_0x1096('0x3')](_0x1096('0x6'),auth[_0x1096('0x4')](),controller[_0x1096('0x7')]);router[_0x1096('0x3')](_0x1096('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1096('0x9'),auth[_0x1096('0x4')](),controller[_0x1096('0xa')]);router[_0x1096('0xb')]('/',auth[_0x1096('0x4')](),controller[_0x1096('0xc')]);router[_0x1096('0xd')](_0x1096('0x8'),auth[_0x1096('0x4')](),controller[_0x1096('0xe')]);router[_0x1096('0xf')]('/:id',auth[_0x1096('0x4')](),controller[_0x1096('0x10')]);module[_0x1096('0x11')]=router; \ No newline at end of file +var _0xa900=['./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0xa900,0x101));var _0x0a90=function(_0x506b51,_0x2d2b6d){_0x506b51=_0x506b51-0x0;var _0xca5779=_0xa900[_0x506b51];return _0xca5779;};'use strict';var multer=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var path=require(_0x0a90('0x2'));var timeout=require(_0x0a90('0x3'));var express=require(_0x0a90('0x4'));var router=express[_0x0a90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a90('0x7'));router[_0x0a90('0x8')]('/',auth[_0x0a90('0x9')](),controller[_0x0a90('0xa')]);router['get'](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xc')]);router['get'](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xe')]);router['get'](_0x0a90('0xf'),auth['isAuthenticated'](),controller[_0x0a90('0x10')]);router[_0x0a90('0x11')]('/',auth['isAuthenticated'](),controller[_0x0a90('0x12')]);router[_0x0a90('0x13')](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x14')]);router[_0x0a90('0x15')](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x16')]);module[_0x0a90('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d5ed620..7db6022 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 _0x1241=['sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','format','DATE','MM-DD-YYYY\x20HH:mm','toString','updatedAt'];(function(_0xf1b0ea,_0x4b13ef){var _0x385bfc=function(_0x520766){while(--_0x520766){_0xf1b0ea['push'](_0xf1b0ea['shift']());}};_0x385bfc(++_0x4b13ef);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1124('0x0'));var moment=require('moment');var path=require(_0x1124('0x1'));var config=require(_0x1124('0x2'));module[_0x1124('0x3')]={'format':{'type':Sequelize[_0x1124('0x4')],'get':function(){return this[_0x1124('0x5')]('value')?path[_0x1124('0x6')](this[_0x1124('0x5')](_0x1124('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1124('0x8')]},'value':{'type':Sequelize[_0x1124('0x8')],'set':function(_0x45200c){var _0x3fe52a=_0x45200c['replace'](/\\/g,'/');this['setDataValue']('value',_0x3fe52a);}},'rating':{'type':Sequelize[_0x1124('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x159c1c){this[_0x1124('0xa')](_0x1124('0xb'),moment()[_0x1124('0xc')](_0x159c1c,'ms'));this[_0x1124('0xa')](_0x1124('0xd'),moment());this['setDataValue'](_0x1124('0xe'),_0x159c1c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x1124('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')](_0x1124('0xd')))['format'](_0x1124('0x11'))[_0x1124('0x12')]();}},'createdAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')]('createdAt'))[_0x1124('0xf')](_0x1124('0x11'))[_0x1124('0x12')]();}},'updatedAt':{'type':Sequelize[_0x1124('0x10')],'get':function(){return moment(this[_0x1124('0x5')](_0x1124('0x13')))[_0x1124('0xf')](_0x1124('0x11'))[_0x1124('0x12')]();}}}; \ No newline at end of file +var _0xb19a=['MM-DD-YYYY\x20HH:mm','format','toString','createdAt','sequelize','../../config/environment','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE'];(function(_0x369af3,_0xfb2079){var _0x3b835b=function(_0x21224c){while(--_0x21224c){_0x369af3['push'](_0x369af3['shift']());}};_0x3b835b(++_0xfb2079);}(_0xb19a,0xd0));var _0xab19=function(_0x154a40,_0x3e89cd){_0x154a40=_0x154a40-0x0;var _0x14498f=_0xb19a[_0x154a40];return _0x14498f;};'use strict';var Sequelize=require(_0xab19('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xab19('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xab19('0x2')](_0xab19('0x3'))?path[_0xab19('0x4')](this[_0xab19('0x2')](_0xab19('0x3'))):undefined;}},'interactionid':{'type':Sequelize[_0xab19('0x5')]},'channel':{'type':Sequelize[_0xab19('0x5')]},'value':{'type':Sequelize['STRING'],'set':function(_0x9d5c1d){var _0x131291=_0x9d5c1d['replace'](/\\/g,'/');this[_0xab19('0x6')]('value',_0x131291);}},'rating':{'type':Sequelize[_0xab19('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xab19('0x7')],'set':function(_0x2c6a67){this[_0xab19('0x6')](_0xab19('0x8'),moment()[_0xab19('0x9')](_0x2c6a67,'ms'));this[_0xab19('0x6')](_0xab19('0xa'),moment());this[_0xab19('0x6')](_0xab19('0xb'),_0x2c6a67);}},'startedAt':{'type':Sequelize[_0xab19('0xc')],'get':function(){return moment(this[_0xab19('0x2')]('startedAt'))['format'](_0xab19('0xd'))['toString']();}},'closedAt':{'type':Sequelize[_0xab19('0xc')],'get':function(){return moment(this[_0xab19('0x2')](_0xab19('0xa')))[_0xab19('0xe')](_0xab19('0xd'))[_0xab19('0xf')]();}},'createdAt':{'type':Sequelize[_0xab19('0xc')],'get':function(){return moment(this['getDataValue'](_0xab19('0x10')))[_0xab19('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xab19('0xf')]();}},'updatedAt':{'type':Sequelize[_0xab19('0xc')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xab19('0xe')](_0xab19('0xd'))[_0xab19('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4e22697..d6415ee 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 _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x3a3510,_0x555905){var _0x278dc1=function(_0x2dd56f){while(--_0x2dd56f){_0x3a3510['push'](_0x3a3510['shift']());}};_0x278dc1(++_0x555905);}(_0xbd50,0x196));var _0x0bd5=function(_0x3a8f41,_0x1c6d83){_0x3a8f41=_0x3a8f41-0x0;var _0x628177=_0xbd50[_0x3a8f41];return _0x628177;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file +var _0x24ca=['server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','ScreenRecording','include','findAll','rows','catch','show','model','includeAll','find','create','body','duration','createdAt','closedAt','params','describe','download','uniqueid','value','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','join'];(function(_0x3f1cea,_0xcd60bd){var _0x5d761a=function(_0x3f79c4){while(--_0x3f79c4){_0x3f1cea['push'](_0x3f1cea['shift']());}};_0x5d761a(++_0xcd60bd);}(_0x24ca,0x1bc));var _0xa24c=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x24ca[_0x585d09];return _0x7d9a14;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['ScreenRecording'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x32')](_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c')),['format']);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x28675f[_0xa24c('0x33')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x33')]);_0x12dbdc[_0xa24c('0x36')]=_['intersection'](_0x5e491e['model'],qs[_0xa24c('0x37')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x37')]));_0x12dbdc[_0xa24c('0x36')]=_0x12dbdc[_0xa24c('0x36')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x36')]:_0x5e491e['model'];if(!_0x28675f[_0xa24c('0x33')][_0xa24c('0x39')](_0xa24c('0x3a'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x33')]['offset']);}_0x12dbdc[_0xa24c('0x3b')]=qs[_0xa24c('0x3c')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x3c')]);_0x12dbdc['where']=qs['filters'](_[_0xa24c('0x3d')](_0x28675f['query'],_0x5e491e[_0xa24c('0x3e')]),_0xc96ce7);if(_0x28675f[_0xa24c('0x33')][_0xa24c('0x3f')]){_0x12dbdc[_0xa24c('0x40')]=_[_0xa24c('0x41')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x3121e){if(_0x3121e[_0xa24c('0x42')]!==_0xa24c('0x43')){var _0x213dc3={};_0x213dc3[_0x3121e[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x33')]['filter']+'%'};return _0x213dc3;}})});}_0x12dbdc=_['merge']({},_0x12dbdc,_0x28675f[_0xa24c('0x44')]);var _0x1ce83e={'where':_0x12dbdc[_0xa24c('0x40')]};return db[_0xa24c('0x45')][_0xa24c('0x20')](_0x1ce83e)['then'](function(_0x171c51){_0x21d2a8[_0xa24c('0x20')]=_0x171c51;if(_0x28675f['query']['includeAll']){_0x12dbdc[_0xa24c('0x46')]=[{'all':!![]}];}return db[_0xa24c('0x45')][_0xa24c('0x47')](_0x12dbdc);})['then'](function(_0x58ac8b){_0x21d2a8[_0xa24c('0x48')]=_0x58ac8b;return _0x21d2a8;})[_0xa24c('0x27')](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x49')](handleError(_0x152120,null));};exports[_0xa24c('0x4a')]=function(_0x3f640e,_0x1b7faf){var _0x23d1e0={'raw':![],'where':{'id':_0x3f640e['params']['id']}},_0x394d19={};_0x394d19['model']=_[_0xa24c('0x34')](db[_0xa24c('0x45')][_0xa24c('0x2f')]);_0x394d19['query']=_[_0xa24c('0x34')](_0x3f640e[_0xa24c('0x33')]);_0x394d19[_0xa24c('0x3e')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],_0x394d19[_0xa24c('0x33')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],qs[_0xa24c('0x37')](_0x3f640e['query'][_0xa24c('0x37')]));_0x23d1e0[_0xa24c('0x36')]=_0x23d1e0[_0xa24c('0x36')]['length']?_0x23d1e0[_0xa24c('0x36')]:_0x394d19[_0xa24c('0x4b')];if(_0x3f640e[_0xa24c('0x33')][_0xa24c('0x4c')]){_0x23d1e0[_0xa24c('0x46')]=[{'all':!![]}];}_0x23d1e0=_[_0xa24c('0x41')]({},_0x23d1e0,_0x3f640e[_0xa24c('0x44')]);return db[_0xa24c('0x45')][_0xa24c('0x4d')](_0x23d1e0)[_0xa24c('0x27')](handleEntityNotFound(_0x1b7faf,null))[_0xa24c('0x27')](respondWithResult(_0x1b7faf,null))['catch'](handleError(_0x1b7faf,null));};exports[_0xa24c('0x4e')]=function(_0x96b977,_0x42028b){return db[_0xa24c('0x45')][_0xa24c('0x4e')](_0x96b977[_0xa24c('0x4f')],{})[_0xa24c('0x27')](respondWithResult(_0x42028b,0xc9))[_0xa24c('0x49')](handleError(_0x42028b,null));};exports[_0xa24c('0x26')]=function(_0x4f56ae,_0x540da8){if(_0x4f56ae[_0xa24c('0x4f')]['id']){delete _0x4f56ae['body']['id'];}delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x50')];delete _0x4f56ae['body'][_0xa24c('0x51')];delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x52')];delete _0x4f56ae['body']['value'];return db[_0xa24c('0x45')]['find']({'where':{'id':_0x4f56ae[_0xa24c('0x53')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x540da8,null))[_0xa24c('0x27')](saveUpdates(_0x4f56ae[_0xa24c('0x4f')],null))[_0xa24c('0x27')](respondWithResult(_0x540da8,null))[_0xa24c('0x49')](handleError(_0x540da8,null));};exports[_0xa24c('0x54')]=function(_0x286d57,_0x22a0db){return db[_0xa24c('0x45')]['describe']()[_0xa24c('0x27')](respondWithResult(_0x22a0db,null))[_0xa24c('0x49')](handleError(_0x22a0db,null));};exports[_0xa24c('0x55')]=function(_0x513271,_0x5bde94,_0x487cc9){var _0x2da4f0=require('../../components/encryptor');var _0x4757ff=![];var _0x21d0fc={};if(_0x513271['query'][_0xa24c('0x42')]&&_0x513271[_0xa24c('0x33')][_0xa24c('0x42')]===_0xa24c('0x56')){_0x21d0fc[_0xa24c('0x56')]=_0x513271[_0xa24c('0x53')]['id'];}else{_0x21d0fc['id']=_0x513271[_0xa24c('0x53')]['id'];}return db[_0xa24c('0x45')]['find']({'where':_0x21d0fc,'attributes':['id',_0xa24c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x5bde94,null))['then'](function(_0x565f0a){if(_0x565f0a){var _0x5bd2af=path['join'](config[_0xa24c('0x58')],'server/files/screen_recordings',_0x565f0a[_0xa24c('0x57')]);var _0x3fd3f9=util[_0xa24c('0x59')](_0xa24c('0x5a'),_0x5bd2af);if(fs[_0xa24c('0x5b')](_0x3fd3f9)){_0x4757ff=!![];return _0x2da4f0[_0xa24c('0x5c')](_0x3fd3f9,_0x5bd2af,config[_0xa24c('0x5d')][_0xa24c('0x5e')])[_0xa24c('0x27')](function(){return _0x565f0a;});}return _0x565f0a;}})[_0xa24c('0x27')](function(_0x303b7d){if(_0x303b7d){var _0x37dbbd=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x303b7d['value']);if(!fs[_0xa24c('0x5b')](_0x37dbbd)){throw new db[(_0xa24c('0x61'))]['ValidationError'](_0xa24c('0x62'));}if(_0x303b7d[_0xa24c('0x63')]){return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,_0x303b7d[_0xa24c('0x63')]+path['extname'](_0x37dbbd),function(){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}else{return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,function(_0x5e9631){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}}})[_0xa24c('0x49')](function(_0x2515b1){if(_0x2515b1[_0xa24c('0x64')]===_0xa24c('0x62')){_0x5bde94['status'](0x194)['send'](_0xa24c('0x65'));}else{return handleError(_0x5bde94,null);}});};exports['destroy']=function(_0x52a895,_0xfcc193){return db[_0xa24c('0x45')][_0xa24c('0x4d')]({'where':{'id':_0x52a895['params']['id']}})[_0xa24c('0x27')](function(_0x128e5b){if(_['isNil'](_0x128e5b)){throw new ReferenceError(_0xa24c('0x66'));}return _0x128e5b;})[_0xa24c('0x27')](function(_0x3096bf){var _0x4bee5c=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x3096bf[_0xa24c('0x57')]);logger[_0xa24c('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x4bee5c);if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs[_0xa24c('0x5b')](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}_0x4bee5c=_0x4bee5c+'.cypher';if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs['existsSync'](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}return _0x3096bf;})[_0xa24c('0x27')](function(_0x3a241a){if(!_0x3a241a)throw new InternalError();return _0x3a241a[_0xa24c('0x28')]();})[_0xa24c('0x27')](function(){_0xfcc193[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})['catch'](handleError(_0xfcc193,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index a9f720c..72d1b20 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 _0xd327=['util','../../config/logger','moment','path','rimraf','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash'];(function(_0x58fbb5,_0x1638e6){var _0x2ef45f=function(_0x6540b8){while(--_0x6540b8){_0x58fbb5['push'](_0x58fbb5['shift']());}};_0x2ef45f(++_0x1638e6);}(_0xd327,0x1ee));var _0x7d32=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd327[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x7d32('0x0'));var util=require(_0x7d32('0x1'));var logger=require(_0x7d32('0x2'))('api');var moment=require(_0x7d32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d32('0x4'));var rimraf=require(_0x7d32('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d32('0x6'));module[_0x7d32('0x7')]=function(_0x4024f1,_0x379f5b){return _0x4024f1[_0x7d32('0x8')]('ScreenRecording',attributes,{'tableName':_0x7d32('0x9'),'paranoid':![],'indexes':[{'name':_0x7d32('0xa'),'fields':[_0x7d32('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x975d=['bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','../../config/logger','moment'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x975d,0x19e));var _0xd975=function(_0x582d9c,_0x28986a){_0x582d9c=_0x582d9c-0x0;var _0x1d1fbf=_0x975d[_0x582d9c];return _0x1d1fbf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd975('0x0'))('api');var moment=require(_0xd975('0x1'));var BPromise=require(_0xd975('0x2'));var rp=require(_0xd975('0x3'));var fs=require('fs');var path=require(_0xd975('0x4'));var rimraf=require(_0xd975('0x5'));var config=require(_0xd975('0x6'));var attributes=require(_0xd975('0x7'));module[_0xd975('0x8')]=function(_0x138403,_0xbe7bc){return _0x138403[_0xd975('0x9')](_0xd975('0xa'),attributes,{'tableName':_0xd975('0xb'),'paranoid':![],'indexes':[{'name':_0xd975('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 46321b5..6eb23c4 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 _0x03d4=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27549a,_0x483fde){var _0x21db6f=function(_0x4d98df){while(--_0x4d98df){_0x27549a['push'](_0x27549a['shift']());}};_0x21db6f(++_0x483fde);}(_0x03d4,0x136));var _0x403d=function(_0x1494c3,_0x29a127){_0x1494c3=_0x1494c3-0x0;var _0x3ce905=_0x03d4[_0x1494c3];return _0x3ce905;};'use strict';var _=require(_0x403d('0x0'));var util=require(_0x403d('0x1'));var moment=require(_0x403d('0x2'));var BPromise=require(_0x403d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x403d('0x4'));var db=require(_0x403d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x403d('0x6'))(_0x403d('0x7'));var config=require(_0x403d('0x8'));var jayson=require(_0x403d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x237322,_0x30f492,_0x30aa6c){return new BPromise(function(_0x2edd4a,_0x490bdc){return client[_0x403d('0xa')](_0x237322,_0x30aa6c)[_0x403d('0xb')](function(_0x484330){logger['info'](_0x403d('0xc'),_0x30f492,_0x403d('0xd'));logger[_0x403d('0xe')](_0x403d('0xf'),_0x30f492,_0x403d('0xd'),JSON[_0x403d('0x10')](_0x484330));if(_0x484330[_0x403d('0x11')]){if(_0x484330['error'][_0x403d('0x12')]===0x1f4){logger[_0x403d('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x30f492,_0x484330['error'][_0x403d('0x13')]);return _0x490bdc(_0x484330[_0x403d('0x11')][_0x403d('0x13')]);}logger[_0x403d('0x11')](_0x403d('0xc'),_0x30f492,_0x484330['error']['message']);return _0x2edd4a(_0x484330['error'][_0x403d('0x13')]);}else{logger['info'](_0x403d('0xc'),_0x30f492,_0x403d('0xd'));_0x2edd4a(_0x484330[_0x403d('0x14')][_0x403d('0x13')]);}})[_0x403d('0x15')](function(_0x43f999){logger[_0x403d('0x11')](_0x403d('0xc'),_0x30f492,_0x43f999);_0x490bdc(_0x43f999);});});} \ No newline at end of file +var _0x3c53=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x590de0,_0x1c9c98){var _0x553ba2=function(_0x2bd9b4){while(--_0x2bd9b4){_0x590de0['push'](_0x590de0['shift']());}};_0x553ba2(++_0x1c9c98);}(_0x3c53,0x17b));var _0x33c5=function(_0x5abb8e,_0x41268f){_0x5abb8e=_0x5abb8e-0x0;var _0x409e33=_0x3c53[_0x5abb8e];return _0x409e33;};'use strict';var _=require('lodash');var util=require(_0x33c5('0x0'));var moment=require('moment');var BPromise=require(_0x33c5('0x1'));var rs=require(_0x33c5('0x2'));var fs=require('fs');var Redis=require(_0x33c5('0x3'));var db=require(_0x33c5('0x4'))['db'];var utils=require(_0x33c5('0x5'));var logger=require(_0x33c5('0x6'))(_0x33c5('0x7'));var config=require('../../config/environment');var jayson=require(_0x33c5('0x8'));var client=jayson[_0x33c5('0x9')][_0x33c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45b2be,_0x778a44,_0x3c7ae2){return new BPromise(function(_0x4e8d84,_0x18d377){return client[_0x33c5('0xb')](_0x45b2be,_0x3c7ae2)['then'](function(_0x497f0e){logger[_0x33c5('0xc')](_0x33c5('0xd'),_0x778a44,'request\x20sent');logger[_0x33c5('0xe')](_0x33c5('0xf'),_0x778a44,_0x33c5('0x10'),JSON[_0x33c5('0x11')](_0x497f0e));if(_0x497f0e['error']){if(_0x497f0e[_0x33c5('0x12')]['code']===0x1f4){logger[_0x33c5('0x12')](_0x33c5('0xd'),_0x778a44,_0x497f0e[_0x33c5('0x12')][_0x33c5('0x13')]);return _0x18d377(_0x497f0e[_0x33c5('0x12')][_0x33c5('0x13')]);}logger[_0x33c5('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x778a44,_0x497f0e[_0x33c5('0x12')][_0x33c5('0x13')]);return _0x4e8d84(_0x497f0e[_0x33c5('0x12')][_0x33c5('0x13')]);}else{logger[_0x33c5('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x778a44,'request\x20sent');_0x4e8d84(_0x497f0e['result'][_0x33c5('0x13')]);}})[_0x33c5('0x14')](function(_0xf0a530){logger['error'](_0x33c5('0xd'),_0x778a44,_0xf0a530);_0x18d377(_0xf0a530);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d7d5243..2cd9de3 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 _0x2ccc=['join','root','server/files/images/logos/','format','logo','extname','originalname','post','single','file','addLogo','%s%s','logologin','addLogoLogin','/:id/preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','util','path','connect-timeout','express','Router','fs-extra','get','index','/now','/:id','/:id/logo','/:id/logo_login','getLogoLogin','getPreferred','/:id/favicon','getFavicon','diskStorage'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x2ccc,0x13c));var _0xc2cc=function(_0x1eac5e,_0x2699e3){_0x1eac5e=_0x1eac5e-0x0;var _0xc6d2c1=_0x2ccc[_0x1eac5e];return _0xc6d2c1;};'use strict';var multer=require('multer');var util=require(_0xc2cc('0x0'));var path=require(_0xc2cc('0x1'));var timeout=require(_0xc2cc('0x2'));var express=require(_0xc2cc('0x3'));var router=express[_0xc2cc('0x4')]();var fs_extra=require(_0xc2cc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xc2cc('0x6')]('/',auth['isAuthenticated'](),controller[_0xc2cc('0x7')]);router[_0xc2cc('0x6')](_0xc2cc('0x8'),controller['getDate']);router[_0xc2cc('0x6')](_0xc2cc('0x9'),controller['show']);router[_0xc2cc('0x6')](_0xc2cc('0xa'),controller['getLogo']);router[_0xc2cc('0x6')](_0xc2cc('0xb'),controller[_0xc2cc('0xc')]);router[_0xc2cc('0x6')]('/:id/gdpr',controller['gdpr']);router[_0xc2cc('0x6')]('/:id/preferred',controller[_0xc2cc('0xd')]);router[_0xc2cc('0x6')](_0xc2cc('0xe'),controller[_0xc2cc('0xf')]);var upload=multer({'storage':multer[_0xc2cc('0x10')]({'destination':function(_0x378f6a,_0x542cf0,_0x7d6bcc){_0x7d6bcc(null,path[_0xc2cc('0x11')](config[_0xc2cc('0x12')],_0xc2cc('0x13')));},'filename':function(_0x1fde47,_0x91115f,_0x23c37b){_0x23c37b(null,util[_0xc2cc('0x14')]('%s%s',_0xc2cc('0x15'),path[_0xc2cc('0x16')](_0x91115f[_0xc2cc('0x17')])));}})});router[_0xc2cc('0x18')]('/:id/logo',upload[_0xc2cc('0x19')](_0xc2cc('0x1a')),controller[_0xc2cc('0x1b')]);var upload=multer({'storage':multer[_0xc2cc('0x10')]({'destination':function(_0x23dc74,_0x4ba055,_0x4175fb){_0x4175fb(null,path[_0xc2cc('0x11')](config[_0xc2cc('0x12')],_0xc2cc('0x13')));},'filename':function(_0x21cfd2,_0x13c55f,_0x18f159){_0x18f159(null,util[_0xc2cc('0x14')](_0xc2cc('0x1c'),_0xc2cc('0x1d'),path['extname'](_0x13c55f['originalname'])));}})});router['post'](_0xc2cc('0xb'),upload[_0xc2cc('0x19')]('file'),controller[_0xc2cc('0x1e')]);var upload=multer({'storage':multer[_0xc2cc('0x10')]({'destination':function(_0x595075,_0x2077e3,_0x13d089){_0x13d089(null,path[_0xc2cc('0x11')](config['root'],_0xc2cc('0x13')));},'filename':function(_0x265366,_0x545fc3,_0x35fbfa){_0x35fbfa(null,util['format'](_0xc2cc('0x1c'),'preferred',path['extname'](_0x545fc3[_0xc2cc('0x17')])));}})});router[_0xc2cc('0x18')](_0xc2cc('0x1f'),upload['single']('file'),controller[_0xc2cc('0x20')]);var upload=multer({'storage':multer[_0xc2cc('0x10')]({'destination':function(_0xd1225a,_0xee2d58,_0x67dbb4){_0x67dbb4(null,path[_0xc2cc('0x11')](config[_0xc2cc('0x12')],_0xc2cc('0x13')));},'filename':function(_0x5027e8,_0x2eb354,_0x2572bf){_0x2572bf(null,util[_0xc2cc('0x14')]('%s%s',_0xc2cc('0x21'),path['extname'](_0x2eb354['originalname'])));}})});router[_0xc2cc('0x18')](_0xc2cc('0xe'),upload['single'](_0xc2cc('0x1a')),controller[_0xc2cc('0x22')]);router[_0xc2cc('0x23')](_0xc2cc('0x9'),auth[_0xc2cc('0x24')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x5c69=['getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','addLogoLogin','preferred','addPreferred','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id','show','/:id/logo'];(function(_0x72e877,_0x11a079){var _0x3bbfda=function(_0x39a18e){while(--_0x39a18e){_0x72e877['push'](_0x72e877['shift']());}};_0x3bbfda(++_0x11a079);}(_0x5c69,0xd1));var _0x95c6=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x5c69[_0xe73080];return _0x12cbc4;};'use strict';var multer=require(_0x95c6('0x0'));var util=require(_0x95c6('0x1'));var path=require(_0x95c6('0x2'));var timeout=require(_0x95c6('0x3'));var express=require('express');var router=express[_0x95c6('0x4')]();var fs_extra=require(_0x95c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x95c6('0x6'));var config=require(_0x95c6('0x7'));var controller=require(_0x95c6('0x8'));router[_0x95c6('0x9')]('/',auth[_0x95c6('0xa')](),controller['index']);router['get'](_0x95c6('0xb'),controller[_0x95c6('0xc')]);router[_0x95c6('0x9')](_0x95c6('0xd'),controller[_0x95c6('0xe')]);router[_0x95c6('0x9')](_0x95c6('0xf'),controller[_0x95c6('0x10')]);router[_0x95c6('0x9')](_0x95c6('0x11'),controller[_0x95c6('0x12')]);router['get'](_0x95c6('0x13'),controller[_0x95c6('0x14')]);router[_0x95c6('0x9')](_0x95c6('0x15'),controller[_0x95c6('0x16')]);router[_0x95c6('0x9')](_0x95c6('0x17'),controller[_0x95c6('0x18')]);var upload=multer({'storage':multer[_0x95c6('0x19')]({'destination':function(_0x489d34,_0xe419c3,_0x22738d){_0x22738d(null,path[_0x95c6('0x1a')](config[_0x95c6('0x1b')],_0x95c6('0x1c')));},'filename':function(_0x38364,_0x19bbe5,_0x336d09){_0x336d09(null,util[_0x95c6('0x1d')](_0x95c6('0x1e'),_0x95c6('0x1f'),path[_0x95c6('0x20')](_0x19bbe5[_0x95c6('0x21')])));}})});router[_0x95c6('0x22')]('/:id/logo',upload[_0x95c6('0x23')](_0x95c6('0x24')),controller[_0x95c6('0x25')]);var upload=multer({'storage':multer[_0x95c6('0x19')]({'destination':function(_0x289ed8,_0x3284cf,_0x947a8c){_0x947a8c(null,path[_0x95c6('0x1a')](config[_0x95c6('0x1b')],_0x95c6('0x1c')));},'filename':function(_0x5092ef,_0x253ffa,_0x2e85ba){_0x2e85ba(null,util[_0x95c6('0x1d')](_0x95c6('0x1e'),'logologin',path[_0x95c6('0x20')](_0x253ffa[_0x95c6('0x21')])));}})});router[_0x95c6('0x22')](_0x95c6('0x11'),upload[_0x95c6('0x23')](_0x95c6('0x24')),controller[_0x95c6('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1c234f,_0x593042,_0x10fa71){_0x10fa71(null,path[_0x95c6('0x1a')](config['root'],_0x95c6('0x1c')));},'filename':function(_0x2cb254,_0x4c90c4,_0x21d582){_0x21d582(null,util[_0x95c6('0x1d')](_0x95c6('0x1e'),_0x95c6('0x27'),path[_0x95c6('0x20')](_0x4c90c4[_0x95c6('0x21')])));}})});router['post'](_0x95c6('0x15'),upload['single']('file'),controller[_0x95c6('0x28')]);var upload=multer({'storage':multer[_0x95c6('0x19')]({'destination':function(_0x44e393,_0x1b9da4,_0x4902ec){_0x4902ec(null,path[_0x95c6('0x1a')](config[_0x95c6('0x1b')],_0x95c6('0x1c')));},'filename':function(_0x4dd010,_0x1f5391,_0x532513){_0x532513(null,util[_0x95c6('0x1d')](_0x95c6('0x1e'),'favicon',path[_0x95c6('0x20')](_0x1f5391[_0x95c6('0x21')])));}})});router[_0x95c6('0x22')](_0x95c6('0x17'),upload[_0x95c6('0x23')](_0x95c6('0x24')),controller[_0x95c6('0x29')]);router[_0x95c6('0x2a')](_0x95c6('0xd'),auth[_0x95c6('0xa')](),controller[_0x95c6('0x2b')]);module[_0x95c6('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 969b362..667f6c8 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 _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xadb5,0xad));var _0x5adb=function(_0x17c084,_0x5d1956){_0x17c084=_0x17c084-0x0;var _0x25d601=_0xadb5[_0x17c084];return _0x25d601;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x5884cd,_0x315e50){var _0x42c37d=function(_0x52ddc2){while(--_0x52ddc2){_0x5884cd['push'](_0x5884cd['shift']());}};_0x42c37d(++_0x315e50);}(_0x2ef3,0xba));var _0x32ef=function(_0x5e2e49,_0x4ff7a6){_0x5e2e49=_0x5e2e49-0x0;var _0x4896a1=_0x2ef3[_0x5e2e49];return _0x4896a1;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 32777f2..82b2764 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 _0x1cde=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','request','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','then','end','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','filter','where','merge','options','Setting','includeAll','include','findAll','rows','show','keys','find','update','body','addLogo','file','filename','logo','params','addLogoLogin','server/files/images/logos','getLicense','loginLogo','favicon','defaultLogo','existsSync','toLower','root','join','default_logo.svg','custom','upperFirst','\x20not\x20found','download','getLogoLogin','preferred','defaultLoginLogo','defaultPreferred','default_loginLogo.svg','default','Sequelize','ValidationError','gdpr','securePassword','addPreferred','defaultFavicon','default_preferred.png','addFavicon','default_favicon.ico','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x40634a,_0x595de8){var _0xd09314=function(_0x283fd3){while(--_0x283fd3){_0x40634a['push'](_0x40634a['shift']());}};_0xd09314(++_0x595de8);}(_0x1cde,0x1e7));var _0xe1cd=function(_0xa7284e,_0x81e54e){_0xa7284e=_0xa7284e-0x0;var _0x5439fe=_0x1cde[_0xa7284e];return _0x5439fe;};'use strict';var emlformat=require(_0xe1cd('0x0'));var rimraf=require(_0xe1cd('0x1'));var zipdir=require(_0xe1cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1cd('0x3'));var moment=require(_0xe1cd('0x4'));var BPromise=require(_0xe1cd('0x5'));var Mustache=require(_0xe1cd('0x6'));var util=require(_0xe1cd('0x7'));var path=require(_0xe1cd('0x8'));var sox=require(_0xe1cd('0x9'));var csv=require(_0xe1cd('0xa'));var ejs=require(_0xe1cd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe1cd('0xc'));var crypto=require(_0xe1cd('0xd'));var jsforce=require(_0xe1cd('0xe'));var deskjs=require(_0xe1cd('0xf'));var toCsv=require(_0xe1cd('0xa'));var querystring=require(_0xe1cd('0x10'));var Papa=require(_0xe1cd('0x11'));var Redis=require(_0xe1cd('0x12'));var authService=require(_0xe1cd('0x13'));var qs=require(_0xe1cd('0x14'));var as=require(_0xe1cd('0x15'));var hardwareService=require(_0xe1cd('0x16'));var logger=require(_0xe1cd('0x17'))(_0xe1cd('0x18'));var utils=require(_0xe1cd('0x19'));var config=require(_0xe1cd('0x1a'));var licenseUtil=require(_0xe1cd('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xe1cd('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54d2e2,_0xb15877,_0x1c3ace,_0x54146b){return new BPromise(function(_0x13c9b2,_0x1e01b1){var _0x5b01f1=_0x54146b||client;return _0x5b01f1[_0xe1cd('0x1d')](_0x54d2e2,_0x1c3ace)['then'](function(_0x32ebdc){logger[_0xe1cd('0x1e')](_0xe1cd('0x1f'),_0xb15877,'request\x20sent');logger[_0xe1cd('0x20')](_0xe1cd('0x21'),_0xb15877,'request\x20sent',JSON[_0xe1cd('0x22')](_0x32ebdc));if(_0x32ebdc[_0xe1cd('0x23')]){if(_0x32ebdc['error'][_0xe1cd('0x24')]===0x1f4){logger[_0xe1cd('0x23')](_0xe1cd('0x1f'),_0xb15877,_0x32ebdc['error'][_0xe1cd('0x25')]);return _0x1e01b1(_0x32ebdc[_0xe1cd('0x23')][_0xe1cd('0x25')]);}logger[_0xe1cd('0x23')]('Setting,\x20%s,\x20%s',_0xb15877,_0x32ebdc[_0xe1cd('0x23')][_0xe1cd('0x25')]);return _0x13c9b2(_0x32ebdc['error'][_0xe1cd('0x25')]);}else{logger[_0xe1cd('0x1e')](_0xe1cd('0x1f'),_0xb15877,_0xe1cd('0x26'));_0x13c9b2(_0x32ebdc[_0xe1cd('0x27')]['message']);}})[_0xe1cd('0x28')](function(_0x3b5a6f){logger['error'](_0xe1cd('0x1f'),_0xb15877,_0x3b5a6f);_0x1e01b1(_0x3b5a6f);});});}function respondWithStatusCode(_0x3ff70c,_0x3018ba){_0x3018ba=_0x3018ba||0xcc;return function(_0x4a05c3){if(_0x4a05c3){return _0x3ff70c[_0xe1cd('0x29')](_0x3018ba);}return _0x3ff70c['status'](_0x3018ba)['end']();};}function respondWithResult(_0x139037,_0x2c4dbf){_0x2c4dbf=_0x2c4dbf||0xc8;return function(_0x5d76ff){if(_0x5d76ff){return _0x139037['status'](_0x2c4dbf)[_0xe1cd('0x2a')](_0x5d76ff);}};}function respondWithFilteredResult(_0x3b9128,_0x3e4c63){return function(_0x49cfc3){if(_0x49cfc3){var _0x4a54d8=typeof _0x3e4c63[_0xe1cd('0x2b')]==='undefined'&&typeof _0x3e4c63[_0xe1cd('0x2c')]===_0xe1cd('0x2d');var _0x289f42=_0x49cfc3['count'];var _0x321fff=_0x4a54d8?0x0:_0x3e4c63[_0xe1cd('0x2b')];var _0x436720=_0x4a54d8?_0x49cfc3[_0xe1cd('0x2e')]:_0x3e4c63['offset']+_0x3e4c63[_0xe1cd('0x2c')];var _0x53bc31;if(_0x436720>=_0x289f42){_0x436720=_0x289f42;_0x53bc31=0xc8;}else{_0x53bc31=0xce;}_0x3b9128[_0xe1cd('0x2f')](_0x53bc31);return _0x3b9128['set'](_0xe1cd('0x30'),_0x321fff+'-'+_0x436720+'/'+_0x289f42)[_0xe1cd('0x2a')](_0x49cfc3);}return null;};}function patchUpdates(_0xe7d106){return function(_0x4366e1){try{jsonpatch[_0xe1cd('0x31')](_0x4366e1,_0xe7d106,!![]);}catch(_0x5c974c){return BPromise[_0xe1cd('0x32')](_0x5c974c);}return _0x4366e1[_0xe1cd('0x33')]();};}function saveUpdates(_0x55765,_0x341240){return function(_0x23bd04){if(_0x23bd04){return _0x23bd04['update'](_0x55765)[_0xe1cd('0x34')](function(_0x52d63b){return _0x52d63b;});}return null;};}function removeEntity(_0x9545e8,_0x40b69c){return function(_0x8ffa7d){if(_0x8ffa7d){return _0x8ffa7d['destroy']()[_0xe1cd('0x34')](function(){_0x9545e8[_0xe1cd('0x2f')](0xcc)[_0xe1cd('0x35')]();});}};}function handleEntityNotFound(_0x43f2f2,_0x193e0d){return function(_0x534d5c){if(!_0x534d5c){_0x43f2f2[_0xe1cd('0x29')](0x194);}return _0x534d5c;};}function handleError(_0x19a4b4,_0x4790e9){_0x4790e9=_0x4790e9||0x1f4;return function(_0x99e514){logger[_0xe1cd('0x23')](_0x99e514['stack']);if(_0x99e514[_0xe1cd('0x36')]){delete _0x99e514[_0xe1cd('0x36')];}_0x19a4b4[_0xe1cd('0x2f')](_0x4790e9)[_0xe1cd('0x37')](_0x99e514);};}exports[_0xe1cd('0x38')]=function(_0x583bbf,_0x2b83b0){var _0x5e0a23={},_0x363589={},_0x208c06={'count':0x0,'rows':[]};var _0xa4585d=_[_0xe1cd('0x39')](db['Setting'][_0xe1cd('0x3a')],function(_0x392a4f){return{'name':_0x392a4f[_0xe1cd('0x3b')],'type':_0x392a4f[_0xe1cd('0x3c')][_0xe1cd('0x3d')]};});_0x363589['model']=_[_0xe1cd('0x39')](_0xa4585d,'name');_0x363589['query']=_['keys'](_0x583bbf[_0xe1cd('0x3e')]);_0x363589[_0xe1cd('0x3f')]=_['intersection'](_0x363589[_0xe1cd('0x40')],_0x363589[_0xe1cd('0x3e')]);_0x5e0a23[_0xe1cd('0x41')]=_[_0xe1cd('0x42')](_0x363589[_0xe1cd('0x40')],qs['fields'](_0x583bbf[_0xe1cd('0x3e')][_0xe1cd('0x43')]));_0x5e0a23[_0xe1cd('0x41')]=_0x5e0a23[_0xe1cd('0x41')][_0xe1cd('0x44')]?_0x5e0a23['attributes']:_0x363589[_0xe1cd('0x40')];if(!_0x583bbf['query']['hasOwnProperty'](_0xe1cd('0x45'))){_0x5e0a23[_0xe1cd('0x2c')]=qs[_0xe1cd('0x2c')](_0x583bbf['query'][_0xe1cd('0x2c')]);_0x5e0a23['offset']=qs['offset'](_0x583bbf[_0xe1cd('0x3e')][_0xe1cd('0x2b')]);}_0x5e0a23[_0xe1cd('0x46')]=qs['sort'](_0x583bbf[_0xe1cd('0x3e')]['sort']);_0x5e0a23['where']=qs['filters'](_['pick'](_0x583bbf['query'],_0x363589['filters']),_0xa4585d);if(_0x583bbf[_0xe1cd('0x3e')][_0xe1cd('0x47')]){_0x5e0a23[_0xe1cd('0x48')]=_[_0xe1cd('0x49')](_0x5e0a23[_0xe1cd('0x48')],{'$or':_['map'](_0xa4585d,function(_0x9656c5){if(_0x9656c5[_0xe1cd('0x3c')]!=='VIRTUAL'){var _0x432eac={};_0x432eac[_0x9656c5[_0xe1cd('0x36')]]={'$like':'%'+_0x583bbf[_0xe1cd('0x3e')][_0xe1cd('0x47')]+'%'};return _0x432eac;}})});}_0x5e0a23=_['merge']({},_0x5e0a23,_0x583bbf[_0xe1cd('0x4a')]);var _0x5ebe69={'where':_0x5e0a23['where']};return db[_0xe1cd('0x4b')][_0xe1cd('0x2e')](_0x5ebe69)['then'](function(_0x35aef4){_0x208c06['count']=_0x35aef4;if(_0x583bbf['query'][_0xe1cd('0x4c')]){_0x5e0a23[_0xe1cd('0x4d')]=[{'all':!![]}];}return db[_0xe1cd('0x4b')][_0xe1cd('0x4e')](_0x5e0a23);})['then'](function(_0x1cad8b){_0x208c06[_0xe1cd('0x4f')]=_0x1cad8b;return _0x208c06;})['then'](respondWithFilteredResult(_0x2b83b0,_0x5e0a23))[_0xe1cd('0x28')](handleError(_0x2b83b0,null));};exports[_0xe1cd('0x50')]=function(_0x4d1c73,_0x5a5fa8){var _0x3539a2={'raw':![],'where':{'id':_0x4d1c73['params']['id']}},_0xdb6037={};_0xdb6037[_0xe1cd('0x40')]=_[_0xe1cd('0x51')](db['Setting'][_0xe1cd('0x3a')]);_0xdb6037[_0xe1cd('0x3e')]=_[_0xe1cd('0x51')](_0x4d1c73[_0xe1cd('0x3e')]);_0xdb6037[_0xe1cd('0x3f')]=_[_0xe1cd('0x42')](_0xdb6037['model'],_0xdb6037[_0xe1cd('0x3e')]);_0x3539a2['attributes']=_[_0xe1cd('0x42')](_0xdb6037['model'],qs['fields'](_0x4d1c73[_0xe1cd('0x3e')][_0xe1cd('0x43')]));_0x3539a2[_0xe1cd('0x41')]=_0x3539a2[_0xe1cd('0x41')][_0xe1cd('0x44')]?_0x3539a2[_0xe1cd('0x41')]:_0xdb6037[_0xe1cd('0x40')];if(_0x4d1c73[_0xe1cd('0x3e')][_0xe1cd('0x4c')]){_0x3539a2[_0xe1cd('0x4d')]=[{'all':!![]}];}_0x3539a2=_[_0xe1cd('0x49')]({},_0x3539a2,_0x4d1c73[_0xe1cd('0x4a')]);return db[_0xe1cd('0x4b')][_0xe1cd('0x52')](_0x3539a2)[_0xe1cd('0x34')](handleEntityNotFound(_0x5a5fa8,null))['then'](respondWithResult(_0x5a5fa8,null))[_0xe1cd('0x28')](handleError(_0x5a5fa8,null));};exports[_0xe1cd('0x53')]=function(_0x40c366,_0x2ed24a){if(_0x40c366[_0xe1cd('0x54')]['id']){delete _0x40c366[_0xe1cd('0x54')]['id'];}return db[_0xe1cd('0x4b')][_0xe1cd('0x52')]({'where':{'id':_0x40c366['params']['id']}})[_0xe1cd('0x34')](handleEntityNotFound(_0x2ed24a,null))[_0xe1cd('0x34')](saveUpdates(_0x40c366[_0xe1cd('0x54')],null))[_0xe1cd('0x34')](respondWithResult(_0x2ed24a,null))[_0xe1cd('0x28')](handleError(_0x2ed24a,null));};exports[_0xe1cd('0x55')]=function(_0x38fa74,_0x20c0ab,_0x4eff35){if(_0x38fa74['file']&&_0x38fa74[_0xe1cd('0x56')][_0xe1cd('0x57')]){_0x38fa74['body'][_0xe1cd('0x58')]=_0x38fa74[_0xe1cd('0x56')]['filename'];}return db[_0xe1cd('0x4b')][_0xe1cd('0x52')]({'where':{'id':_0x38fa74[_0xe1cd('0x59')]['id']}})[_0xe1cd('0x34')](handleEntityNotFound(_0x20c0ab,null))['then'](saveUpdates(_0x38fa74['body'],null))['then'](respondWithResult(_0x20c0ab,null))[_0xe1cd('0x28')](handleError(_0x20c0ab,null));};exports[_0xe1cd('0x5a')]=function(_0x26142e,_0x478aba,_0x42f8e4){if(_0x26142e['file']&&_0x26142e[_0xe1cd('0x56')][_0xe1cd('0x57')]){_0x26142e['body']['loginLogo']=_0x26142e[_0xe1cd('0x56')][_0xe1cd('0x57')];}return db['Setting'][_0xe1cd('0x52')]({'where':{'id':_0x26142e[_0xe1cd('0x59')]['id']}})['then'](handleEntityNotFound(_0x478aba,null))[_0xe1cd('0x34')](saveUpdates(_0x26142e[_0xe1cd('0x54')],null))[_0xe1cd('0x34')](respondWithResult(_0x478aba,null))[_0xe1cd('0x28')](handleError(_0x478aba,null));};var utilLicense=require(_0xe1cd('0x1b'));exports['getLogo']=function(_0xea9892,_0x6f18fe,_0x45bec1){var _0x5da391=_0xe1cd('0x5b');var _0x42ff46={'custom':![]};return utilLicense[_0xe1cd('0x5c')]()[_0xe1cd('0x34')](function(_0xf3ebda){if(_0xf3ebda){_0x42ff46=_0xf3ebda;}return db[_0xe1cd('0x4b')][_0xe1cd('0x52')]({'where':{'id':_0xea9892[_0xe1cd('0x59')]['id']},'attributes':[_0xe1cd('0x58'),_0xe1cd('0x5d'),'preferred',_0xe1cd('0x5e'),_0xe1cd('0x5f'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xe1cd('0x34')](handleEntityNotFound(_0x6f18fe,null))[_0xe1cd('0x34')](function(_0x5009f4){if(_0x5009f4){var _0x60a93f=_0x5009f4[_0xe1cd('0x58')]&&fs[_0xe1cd('0x60')](path['join'](config['root'],_0x5da391,_[_0xe1cd('0x61')](_0x5009f4[_0xe1cd('0x58')])))?path['join'](config[_0xe1cd('0x62')],_0x5da391,_[_0xe1cd('0x61')](_0x5009f4[_0xe1cd('0x58')])):path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x5da391,_[_0xe1cd('0x61')](_0xe1cd('0x64')));var _0x389854='default'+_['upperFirst']('logo');if(_0x5009f4[_0x389854]||!_0x42ff46[_0xe1cd('0x65')]){_0x60a93f=path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x5da391,_[_0xe1cd('0x61')](_0xe1cd('0x64')));}if(!fs['existsSync'](_0x60a93f)){throw new db['Sequelize']['ValidationError'](_[_0xe1cd('0x66')]('logo')+_0xe1cd('0x67'));}return _0x6f18fe[_0xe1cd('0x68')](_0x60a93f);}})[_0xe1cd('0x28')](handleError(_0x6f18fe,null));};var utilLicense=require('../../config/license/util');exports[_0xe1cd('0x69')]=function(_0x33d7d3,_0x510762,_0x392269){var _0x2ceb22=_0xe1cd('0x5b');var _0x4b6801={'custom':![]};return utilLicense[_0xe1cd('0x5c')]()[_0xe1cd('0x34')](function(_0x306c4b){if(_0x306c4b){_0x4b6801=_0x306c4b;}return db['Setting'][_0xe1cd('0x52')]({'where':{'id':_0x33d7d3[_0xe1cd('0x59')]['id']},'attributes':[_0xe1cd('0x58'),_0xe1cd('0x5d'),_0xe1cd('0x6a'),_0xe1cd('0x5e'),_0xe1cd('0x5f'),_0xe1cd('0x6b'),_0xe1cd('0x6c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x510762,null))[_0xe1cd('0x34')](function(_0x464033){if(_0x464033){var _0x1a8883=_0x464033[_0xe1cd('0x5d')]&&fs['existsSync'](path[_0xe1cd('0x63')](config['root'],_0x2ceb22,_['toLower'](_0x464033['loginLogo'])))?path['join'](config['root'],_0x2ceb22,_[_0xe1cd('0x61')](_0x464033['loginLogo'])):path['join'](config[_0xe1cd('0x62')],_0x2ceb22,_['toLower'](_0xe1cd('0x6d')));var _0x14f56e=_0xe1cd('0x6e')+_['upperFirst'](_0xe1cd('0x5d'));if(_0x464033[_0x14f56e]||!_0x4b6801[_0xe1cd('0x65')]){_0x1a8883=path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x2ceb22,_['toLower'](_0xe1cd('0x6d')));}if(!fs[_0xe1cd('0x60')](_0x1a8883)){throw new db[(_0xe1cd('0x6f'))][(_0xe1cd('0x70'))](_[_0xe1cd('0x66')](_0xe1cd('0x5d'))+_0xe1cd('0x67'));}return _0x510762[_0xe1cd('0x68')](_0x1a8883);}})[_0xe1cd('0x28')](handleError(_0x510762,null));};exports[_0xe1cd('0x71')]=function(_0x427e0b,_0x4f95a4){return db[_0xe1cd('0x4b')]['find']({'where':{'id':_0x427e0b[_0xe1cd('0x59')]['id']},'attributes':[_0xe1cd('0x72')]})['then'](respondWithResult(_0x4f95a4,null))[_0xe1cd('0x28')](handleError(_0x4f95a4,null));};exports[_0xe1cd('0x73')]=function(_0x3fb88e,_0x4ba0f9,_0x3d8a4a){if(_0x3fb88e[_0xe1cd('0x56')]&&_0x3fb88e[_0xe1cd('0x56')][_0xe1cd('0x57')]){_0x3fb88e[_0xe1cd('0x54')][_0xe1cd('0x6a')]=_0x3fb88e[_0xe1cd('0x56')][_0xe1cd('0x57')];}return db[_0xe1cd('0x4b')][_0xe1cd('0x52')]({'where':{'id':_0x3fb88e[_0xe1cd('0x59')]['id']}})[_0xe1cd('0x34')](handleEntityNotFound(_0x4ba0f9,null))[_0xe1cd('0x34')](saveUpdates(_0x3fb88e[_0xe1cd('0x54')],null))[_0xe1cd('0x34')](respondWithResult(_0x4ba0f9,null))['catch'](handleError(_0x4ba0f9,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x48bacf,_0x41a971,_0x384f54){var _0xc8db7a='server/files/images/logos';var _0x11fc00={'custom':![]};return utilLicense[_0xe1cd('0x5c')]()[_0xe1cd('0x34')](function(_0x9fc035){if(_0x9fc035){_0x11fc00=_0x9fc035;}return db['Setting'][_0xe1cd('0x52')]({'where':{'id':_0x48bacf[_0xe1cd('0x59')]['id']},'attributes':['logo',_0xe1cd('0x5d'),_0xe1cd('0x6a'),'favicon',_0xe1cd('0x5f'),_0xe1cd('0x6b'),_0xe1cd('0x6c'),_0xe1cd('0x74')],'raw':!![]});})[_0xe1cd('0x34')](handleEntityNotFound(_0x41a971,null))[_0xe1cd('0x34')](function(_0x55ac46){if(_0x55ac46){var _0x9454d9=_0x55ac46[_0xe1cd('0x6a')]&&fs[_0xe1cd('0x60')](path['join'](config[_0xe1cd('0x62')],_0xc8db7a,_['toLower'](_0x55ac46['preferred'])))?path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0xc8db7a,_[_0xe1cd('0x61')](_0x55ac46[_0xe1cd('0x6a')])):path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0xc8db7a,_[_0xe1cd('0x61')](_0xe1cd('0x75')));var _0x2fde44=_0xe1cd('0x6e')+_[_0xe1cd('0x66')](_0xe1cd('0x6a'));if(_0x55ac46[_0x2fde44]||!_0x11fc00[_0xe1cd('0x65')]||!_0x11fc00[_0xe1cd('0x6a')]){_0x9454d9=path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0xc8db7a,_['toLower'](_0xe1cd('0x75')));}if(!fs[_0xe1cd('0x60')](_0x9454d9)){throw new db[(_0xe1cd('0x6f'))]['ValidationError'](_[_0xe1cd('0x66')](_0xe1cd('0x6a'))+_0xe1cd('0x67'));}return _0x41a971[_0xe1cd('0x68')](_0x9454d9);}})[_0xe1cd('0x28')](handleError(_0x41a971,null));};exports[_0xe1cd('0x76')]=function(_0x317ffa,_0x4ae725,_0x421de9){if(_0x317ffa[_0xe1cd('0x56')]&&_0x317ffa[_0xe1cd('0x56')][_0xe1cd('0x57')]){_0x317ffa[_0xe1cd('0x54')]['favicon']=_0x317ffa[_0xe1cd('0x56')][_0xe1cd('0x57')];}return db[_0xe1cd('0x4b')]['find']({'where':{'id':_0x317ffa[_0xe1cd('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ae725,null))[_0xe1cd('0x34')](saveUpdates(_0x317ffa['body'],null))[_0xe1cd('0x34')](respondWithResult(_0x4ae725,null))['catch'](handleError(_0x4ae725,null));};var utilLicense=require(_0xe1cd('0x1b'));exports['getFavicon']=function(_0x20b65d,_0x2d1d8d,_0x52eb5d){var _0x58031e=_0xe1cd('0x5b');var _0x3b3c9c={'custom':![]};return utilLicense[_0xe1cd('0x5c')]()[_0xe1cd('0x34')](function(_0xa9f5b4){if(_0xa9f5b4){_0x3b3c9c=_0xa9f5b4;}return db[_0xe1cd('0x4b')][_0xe1cd('0x52')]({'where':{'id':_0x20b65d[_0xe1cd('0x59')]['id']},'attributes':[_0xe1cd('0x58'),_0xe1cd('0x5d'),'preferred',_0xe1cd('0x5e'),_0xe1cd('0x5f'),_0xe1cd('0x6b'),_0xe1cd('0x6c'),_0xe1cd('0x74')],'raw':!![]});})[_0xe1cd('0x34')](handleEntityNotFound(_0x2d1d8d,null))[_0xe1cd('0x34')](function(_0x46ef3c){if(_0x46ef3c){var _0x582320=_0x46ef3c[_0xe1cd('0x5e')]&&fs[_0xe1cd('0x60')](path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x58031e,_[_0xe1cd('0x61')](_0x46ef3c[_0xe1cd('0x5e')])))?path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x58031e,_[_0xe1cd('0x61')](_0x46ef3c[_0xe1cd('0x5e')])):path['join'](config[_0xe1cd('0x62')],_0x58031e,_[_0xe1cd('0x61')](_0xe1cd('0x77')));var _0x48505e='default'+_[_0xe1cd('0x66')](_0xe1cd('0x5e'));if(_0x46ef3c[_0x48505e]||!_0x3b3c9c[_0xe1cd('0x65')]){_0x582320=path[_0xe1cd('0x63')](config[_0xe1cd('0x62')],_0x58031e,_[_0xe1cd('0x61')]('default_favicon.ico'));}if(!fs[_0xe1cd('0x60')](_0x582320)){throw new db[(_0xe1cd('0x6f'))][(_0xe1cd('0x70'))](_[_0xe1cd('0x66')](_0xe1cd('0x5e'))+'\x20not\x20found');}return _0x2d1d8d['download'](_0x582320);}})['catch'](handleError(_0x2d1d8d,null));};exports['getDate']=function(_0x4c6802,_0x4fbe1e){var _0x124796={'offset':moment()['utcOffset']()};_0x124796[_0xe1cd('0x78')]=moment()['utcOffset'](_0x124796[_0xe1cd('0x2b')])[_0xe1cd('0x79')](_0xe1cd('0x7a'));return _0x4fbe1e[_0xe1cd('0x2f')](0xc8)['send'](_0x124796);}; \ No newline at end of file +var _0x758e=['../../config/environment','../../config/license/util','jayson/promise','http','request','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','info','catch','status','undefined','limit','offset','count','set','Content-Range','json','reject','then','end','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Setting','includeAll','include','rows','params','update','body','find','addLogo','file','filename','addLogoLogin','getLogo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','server/files/images/logos','getLicense','custom','default_loginLogo.svg','securePassword','addPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x27a3cb,_0x4af597){var _0x54ff38=function(_0x3a82d2){while(--_0x3a82d2){_0x27a3cb['push'](_0x27a3cb['shift']());}};_0x54ff38(++_0x4af597);}(_0x758e,0x1af));var _0xe758=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x758e[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xe758('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe758('0x1'));var rp=require(_0xe758('0x2'));var moment=require(_0xe758('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe758('0x4'));var path=require(_0xe758('0x5'));var sox=require(_0xe758('0x6'));var csv=require(_0xe758('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe758('0x8'));var _=require(_0xe758('0x9'));var squel=require(_0xe758('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe758('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe758('0xc'));var qs=require(_0xe758('0xd'));var as=require(_0xe758('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe758('0xf'))('api');var utils=require(_0xe758('0x10'));var config=require(_0xe758('0x11'));var licenseUtil=require(_0xe758('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0xe758('0x13'));var client=jayson['client'][_0xe758('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x279b93,_0x423d30,_0x289c33,_0x26dfcd){return new BPromise(function(_0x27517f,_0xea5ea3){var _0x26a6ba=_0x26dfcd||client;return _0x26a6ba[_0xe758('0x15')](_0x279b93,_0x289c33)['then'](function(_0x3c617a){logger['info']('Setting,\x20%s,\x20%s',_0x423d30,_0xe758('0x16'));logger[_0xe758('0x17')]('Setting,\x20%s,\x20%s,\x20%s',_0x423d30,'request\x20sent',JSON[_0xe758('0x18')](_0x3c617a));if(_0x3c617a[_0xe758('0x19')]){if(_0x3c617a[_0xe758('0x19')][_0xe758('0x1a')]===0x1f4){logger[_0xe758('0x19')](_0xe758('0x1b'),_0x423d30,_0x3c617a['error']['message']);return _0xea5ea3(_0x3c617a[_0xe758('0x19')][_0xe758('0x1c')]);}logger[_0xe758('0x19')](_0xe758('0x1b'),_0x423d30,_0x3c617a[_0xe758('0x19')]['message']);return _0x27517f(_0x3c617a['error'][_0xe758('0x1c')]);}else{logger[_0xe758('0x1d')](_0xe758('0x1b'),_0x423d30,_0xe758('0x16'));_0x27517f(_0x3c617a['result'][_0xe758('0x1c')]);}})[_0xe758('0x1e')](function(_0x19373a){logger[_0xe758('0x19')](_0xe758('0x1b'),_0x423d30,_0x19373a);_0xea5ea3(_0x19373a);});});}function respondWithStatusCode(_0x992bb5,_0x108bfe){_0x108bfe=_0x108bfe||0xcc;return function(_0x4b147b){if(_0x4b147b){return _0x992bb5['sendStatus'](_0x108bfe);}return _0x992bb5['status'](_0x108bfe)['end']();};}function respondWithResult(_0x3efeb9,_0x145beb){_0x145beb=_0x145beb||0xc8;return function(_0x1cd620){if(_0x1cd620){return _0x3efeb9[_0xe758('0x1f')](_0x145beb)['json'](_0x1cd620);}};}function respondWithFilteredResult(_0x374223,_0x5c0e38){return function(_0x3bcdac){if(_0x3bcdac){var _0x4ec498=typeof _0x5c0e38['offset']===_0xe758('0x20')&&typeof _0x5c0e38[_0xe758('0x21')]===_0xe758('0x20');var _0xfe2be2=_0x3bcdac['count'];var _0xf00ed6=_0x4ec498?0x0:_0x5c0e38[_0xe758('0x22')];var _0x258d5f=_0x4ec498?_0x3bcdac[_0xe758('0x23')]:_0x5c0e38['offset']+_0x5c0e38[_0xe758('0x21')];var _0x596835;if(_0x258d5f>=_0xfe2be2){_0x258d5f=_0xfe2be2;_0x596835=0xc8;}else{_0x596835=0xce;}_0x374223[_0xe758('0x1f')](_0x596835);return _0x374223[_0xe758('0x24')](_0xe758('0x25'),_0xf00ed6+'-'+_0x258d5f+'/'+_0xfe2be2)[_0xe758('0x26')](_0x3bcdac);}return null;};}function patchUpdates(_0x148e94){return function(_0x5be009){try{jsonpatch['apply'](_0x5be009,_0x148e94,!![]);}catch(_0x4a7d52){return BPromise[_0xe758('0x27')](_0x4a7d52);}return _0x5be009['save']();};}function saveUpdates(_0x44f767,_0x1ee099){return function(_0x5e306f){if(_0x5e306f){return _0x5e306f['update'](_0x44f767)[_0xe758('0x28')](function(_0x5d6e34){return _0x5d6e34;});}return null;};}function removeEntity(_0xcd9e89,_0x1d853c){return function(_0x11cb74){if(_0x11cb74){return _0x11cb74['destroy']()[_0xe758('0x28')](function(){_0xcd9e89['status'](0xcc)[_0xe758('0x29')]();});}};}function handleEntityNotFound(_0x36e77f,_0x5a01e1){return function(_0x3b6d1a){if(!_0x3b6d1a){_0x36e77f[_0xe758('0x2a')](0x194);}return _0x3b6d1a;};}function handleError(_0x3245c6,_0x56c8ff){_0x56c8ff=_0x56c8ff||0x1f4;return function(_0x5063e1){logger[_0xe758('0x19')](_0x5063e1['stack']);if(_0x5063e1[_0xe758('0x2b')]){delete _0x5063e1[_0xe758('0x2b')];}_0x3245c6[_0xe758('0x1f')](_0x56c8ff)[_0xe758('0x2c')](_0x5063e1);};}exports[_0xe758('0x2d')]=function(_0x3218b8,_0x59454d){var _0x3c0065={},_0x4a0705={},_0x4b17ad={'count':0x0,'rows':[]};var _0x179daf=_[_0xe758('0x2e')](db['Setting'][_0xe758('0x2f')],function(_0x2744f5){return{'name':_0x2744f5[_0xe758('0x30')],'type':_0x2744f5['type'][_0xe758('0x31')]};});_0x4a0705[_0xe758('0x32')]=_[_0xe758('0x2e')](_0x179daf,_0xe758('0x2b'));_0x4a0705['query']=_[_0xe758('0x33')](_0x3218b8[_0xe758('0x34')]);_0x4a0705[_0xe758('0x35')]=_[_0xe758('0x36')](_0x4a0705['model'],_0x4a0705[_0xe758('0x34')]);_0x3c0065['attributes']=_['intersection'](_0x4a0705[_0xe758('0x32')],qs[_0xe758('0x37')](_0x3218b8[_0xe758('0x34')]['fields']));_0x3c0065[_0xe758('0x38')]=_0x3c0065[_0xe758('0x38')][_0xe758('0x39')]?_0x3c0065[_0xe758('0x38')]:_0x4a0705['model'];if(!_0x3218b8[_0xe758('0x34')][_0xe758('0x3a')](_0xe758('0x3b'))){_0x3c0065[_0xe758('0x21')]=qs['limit'](_0x3218b8[_0xe758('0x34')]['limit']);_0x3c0065[_0xe758('0x22')]=qs[_0xe758('0x22')](_0x3218b8['query'][_0xe758('0x22')]);}_0x3c0065[_0xe758('0x3c')]=qs['sort'](_0x3218b8[_0xe758('0x34')][_0xe758('0x3d')]);_0x3c0065[_0xe758('0x3e')]=qs[_0xe758('0x35')](_[_0xe758('0x3f')](_0x3218b8[_0xe758('0x34')],_0x4a0705[_0xe758('0x35')]),_0x179daf);if(_0x3218b8[_0xe758('0x34')][_0xe758('0x40')]){_0x3c0065['where']=_['merge'](_0x3c0065['where'],{'$or':_['map'](_0x179daf,function(_0xe70256){if(_0xe70256[_0xe758('0x41')]!==_0xe758('0x42')){var _0xb18ce1={};_0xb18ce1[_0xe70256[_0xe758('0x2b')]]={'$like':'%'+_0x3218b8[_0xe758('0x34')]['filter']+'%'};return _0xb18ce1;}})});}_0x3c0065=_[_0xe758('0x43')]({},_0x3c0065,_0x3218b8[_0xe758('0x44')]);var _0x550903={'where':_0x3c0065['where']};return db[_0xe758('0x45')][_0xe758('0x23')](_0x550903)[_0xe758('0x28')](function(_0x2a8842){_0x4b17ad['count']=_0x2a8842;if(_0x3218b8[_0xe758('0x34')][_0xe758('0x46')]){_0x3c0065[_0xe758('0x47')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x3c0065);})[_0xe758('0x28')](function(_0x2272b5){_0x4b17ad[_0xe758('0x48')]=_0x2272b5;return _0x4b17ad;})[_0xe758('0x28')](respondWithFilteredResult(_0x59454d,_0x3c0065))[_0xe758('0x1e')](handleError(_0x59454d,null));};exports['show']=function(_0x3e61cb,_0x29412a){var _0x58ebcc={'raw':![],'where':{'id':_0x3e61cb[_0xe758('0x49')]['id']}},_0x4ab7c6={};_0x4ab7c6[_0xe758('0x32')]=_['keys'](db[_0xe758('0x45')][_0xe758('0x2f')]);_0x4ab7c6[_0xe758('0x34')]=_['keys'](_0x3e61cb[_0xe758('0x34')]);_0x4ab7c6[_0xe758('0x35')]=_['intersection'](_0x4ab7c6[_0xe758('0x32')],_0x4ab7c6[_0xe758('0x34')]);_0x58ebcc['attributes']=_['intersection'](_0x4ab7c6[_0xe758('0x32')],qs[_0xe758('0x37')](_0x3e61cb[_0xe758('0x34')][_0xe758('0x37')]));_0x58ebcc[_0xe758('0x38')]=_0x58ebcc[_0xe758('0x38')][_0xe758('0x39')]?_0x58ebcc[_0xe758('0x38')]:_0x4ab7c6['model'];if(_0x3e61cb[_0xe758('0x34')][_0xe758('0x46')]){_0x58ebcc[_0xe758('0x47')]=[{'all':!![]}];}_0x58ebcc=_['merge']({},_0x58ebcc,_0x3e61cb['options']);return db[_0xe758('0x45')]['find'](_0x58ebcc)[_0xe758('0x28')](handleEntityNotFound(_0x29412a,null))[_0xe758('0x28')](respondWithResult(_0x29412a,null))['catch'](handleError(_0x29412a,null));};exports[_0xe758('0x4a')]=function(_0xbd8d26,_0x423441){if(_0xbd8d26[_0xe758('0x4b')]['id']){delete _0xbd8d26['body']['id'];}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0xbd8d26['params']['id']}})[_0xe758('0x28')](handleEntityNotFound(_0x423441,null))['then'](saveUpdates(_0xbd8d26['body'],null))[_0xe758('0x28')](respondWithResult(_0x423441,null))[_0xe758('0x1e')](handleError(_0x423441,null));};exports[_0xe758('0x4d')]=function(_0x74ffb8,_0xf8b045,_0x27d7cd){if(_0x74ffb8['file']&&_0x74ffb8[_0xe758('0x4e')]['filename']){_0x74ffb8[_0xe758('0x4b')]['logo']=_0x74ffb8[_0xe758('0x4e')][_0xe758('0x4f')];}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0x74ffb8['params']['id']}})[_0xe758('0x28')](handleEntityNotFound(_0xf8b045,null))['then'](saveUpdates(_0x74ffb8[_0xe758('0x4b')],null))['then'](respondWithResult(_0xf8b045,null))[_0xe758('0x1e')](handleError(_0xf8b045,null));};exports[_0xe758('0x50')]=function(_0x4c16cb,_0x26a16d,_0x4b8a17){if(_0x4c16cb[_0xe758('0x4e')]&&_0x4c16cb[_0xe758('0x4e')]['filename']){_0x4c16cb[_0xe758('0x4b')]['loginLogo']=_0x4c16cb[_0xe758('0x4e')][_0xe758('0x4f')];}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0x4c16cb['params']['id']}})[_0xe758('0x28')](handleEntityNotFound(_0x26a16d,null))['then'](saveUpdates(_0x4c16cb[_0xe758('0x4b')],null))[_0xe758('0x28')](respondWithResult(_0x26a16d,null))[_0xe758('0x1e')](handleError(_0x26a16d,null));};var utilLicense=require(_0xe758('0x12'));exports[_0xe758('0x51')]=function(_0x59fd17,_0x305838,_0x1a17d8){var _0x374034='server/files/images/logos';var _0x397908={'custom':![]};return utilLicense['getLicense']()[_0xe758('0x28')](function(_0x6d0032){if(_0x6d0032){_0x397908=_0x6d0032;}return db[_0xe758('0x45')]['find']({'where':{'id':_0x59fd17[_0xe758('0x49')]['id']},'attributes':['logo',_0xe758('0x52'),_0xe758('0x53'),_0xe758('0x54'),_0xe758('0x55'),_0xe758('0x56'),_0xe758('0x57'),_0xe758('0x58')],'raw':!![]});})[_0xe758('0x28')](handleEntityNotFound(_0x305838,null))[_0xe758('0x28')](function(_0x6d1c49){if(_0x6d1c49){var _0x15d6cf=_0x6d1c49[_0xe758('0x59')]&&fs[_0xe758('0x5a')](path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x374034,_[_0xe758('0x5d')](_0x6d1c49['logo'])))?path['join'](config['root'],_0x374034,_[_0xe758('0x5d')](_0x6d1c49[_0xe758('0x59')])):path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x374034,_[_0xe758('0x5d')](_0xe758('0x5e')));var _0x688798=_0xe758('0x5f')+_[_0xe758('0x60')](_0xe758('0x59'));if(_0x6d1c49[_0x688798]||!_0x397908['custom']){_0x15d6cf=path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x374034,_[_0xe758('0x5d')](_0xe758('0x5e')));}if(!fs[_0xe758('0x5a')](_0x15d6cf)){throw new db[(_0xe758('0x61'))][(_0xe758('0x62'))](_[_0xe758('0x60')]('logo')+_0xe758('0x63'));}return _0x305838[_0xe758('0x64')](_0x15d6cf);}})['catch'](handleError(_0x305838,null));};var utilLicense=require(_0xe758('0x12'));exports['getLogoLogin']=function(_0xe95ad0,_0x486dee,_0x12954e){var _0x2c2d11=_0xe758('0x65');var _0x259a78={'custom':![]};return utilLicense[_0xe758('0x66')]()[_0xe758('0x28')](function(_0x4e61e5){if(_0x4e61e5){_0x259a78=_0x4e61e5;}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0xe95ad0[_0xe758('0x49')]['id']},'attributes':[_0xe758('0x59'),_0xe758('0x52'),_0xe758('0x53'),_0xe758('0x54'),_0xe758('0x55'),_0xe758('0x56'),_0xe758('0x57'),'defaultFavicon'],'raw':!![]});})[_0xe758('0x28')](handleEntityNotFound(_0x486dee,null))['then'](function(_0x35e708){if(_0x35e708){var _0x1da8ad=_0x35e708['loginLogo']&&fs[_0xe758('0x5a')](path['join'](config[_0xe758('0x5c')],_0x2c2d11,_[_0xe758('0x5d')](_0x35e708[_0xe758('0x52')])))?path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x2c2d11,_[_0xe758('0x5d')](_0x35e708[_0xe758('0x52')])):path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x2c2d11,_[_0xe758('0x5d')]('default_loginLogo.svg'));var _0x14c7d7=_0xe758('0x5f')+_[_0xe758('0x60')](_0xe758('0x52'));if(_0x35e708[_0x14c7d7]||!_0x259a78[_0xe758('0x67')]){_0x1da8ad=path[_0xe758('0x5b')](config['root'],_0x2c2d11,_[_0xe758('0x5d')](_0xe758('0x68')));}if(!fs[_0xe758('0x5a')](_0x1da8ad)){throw new db[(_0xe758('0x61'))][(_0xe758('0x62'))](_[_0xe758('0x60')](_0xe758('0x52'))+_0xe758('0x63'));}return _0x486dee[_0xe758('0x64')](_0x1da8ad);}})[_0xe758('0x1e')](handleError(_0x486dee,null));};exports['gdpr']=function(_0x518092,_0x444146){return db['Setting'][_0xe758('0x4c')]({'where':{'id':_0x518092[_0xe758('0x49')]['id']},'attributes':[_0xe758('0x69')]})[_0xe758('0x28')](respondWithResult(_0x444146,null))[_0xe758('0x1e')](handleError(_0x444146,null));};exports[_0xe758('0x6a')]=function(_0x35c548,_0x2f03d6,_0x269610){if(_0x35c548[_0xe758('0x4e')]&&_0x35c548[_0xe758('0x4e')][_0xe758('0x4f')]){_0x35c548[_0xe758('0x4b')][_0xe758('0x53')]=_0x35c548[_0xe758('0x4e')]['filename'];}return db['Setting'][_0xe758('0x4c')]({'where':{'id':_0x35c548[_0xe758('0x49')]['id']}})[_0xe758('0x28')](handleEntityNotFound(_0x2f03d6,null))[_0xe758('0x28')](saveUpdates(_0x35c548[_0xe758('0x4b')],null))[_0xe758('0x28')](respondWithResult(_0x2f03d6,null))['catch'](handleError(_0x2f03d6,null));};var utilLicense=require(_0xe758('0x12'));exports['getPreferred']=function(_0x161eaa,_0x2820d9,_0x31b886){var _0x1da9a4=_0xe758('0x65');var _0x2036af={'custom':![]};return utilLicense[_0xe758('0x66')]()['then'](function(_0x1796a8){if(_0x1796a8){_0x2036af=_0x1796a8;}return db[_0xe758('0x45')]['find']({'where':{'id':_0x161eaa[_0xe758('0x49')]['id']},'attributes':['logo',_0xe758('0x52'),_0xe758('0x53'),_0xe758('0x54'),_0xe758('0x55'),_0xe758('0x56'),'defaultPreferred',_0xe758('0x58')],'raw':!![]});})['then'](handleEntityNotFound(_0x2820d9,null))[_0xe758('0x28')](function(_0x43b339){if(_0x43b339){var _0x16a134=_0x43b339[_0xe758('0x53')]&&fs[_0xe758('0x5a')](path['join'](config['root'],_0x1da9a4,_[_0xe758('0x5d')](_0x43b339[_0xe758('0x53')])))?path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0x1da9a4,_[_0xe758('0x5d')](_0x43b339[_0xe758('0x53')])):path[_0xe758('0x5b')](config['root'],_0x1da9a4,_[_0xe758('0x5d')]('default_preferred.png'));var _0x57640f=_0xe758('0x5f')+_['upperFirst'](_0xe758('0x53'));if(_0x43b339[_0x57640f]||!_0x2036af[_0xe758('0x67')]||!_0x2036af[_0xe758('0x53')]){_0x16a134=path[_0xe758('0x5b')](config['root'],_0x1da9a4,_[_0xe758('0x5d')](_0xe758('0x6b')));}if(!fs['existsSync'](_0x16a134)){throw new db[(_0xe758('0x61'))][(_0xe758('0x62'))](_[_0xe758('0x60')]('preferred')+_0xe758('0x63'));}return _0x2820d9[_0xe758('0x64')](_0x16a134);}})['catch'](handleError(_0x2820d9,null));};exports[_0xe758('0x6c')]=function(_0x58f18b,_0x493342,_0x314abf){if(_0x58f18b[_0xe758('0x4e')]&&_0x58f18b[_0xe758('0x4e')][_0xe758('0x4f')]){_0x58f18b[_0xe758('0x4b')][_0xe758('0x54')]=_0x58f18b[_0xe758('0x4e')][_0xe758('0x4f')];}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0x58f18b[_0xe758('0x49')]['id']}})[_0xe758('0x28')](handleEntityNotFound(_0x493342,null))[_0xe758('0x28')](saveUpdates(_0x58f18b['body'],null))['then'](respondWithResult(_0x493342,null))[_0xe758('0x1e')](handleError(_0x493342,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x401caa,_0x1cc928,_0x5127fa){var _0xb5662a=_0xe758('0x65');var _0x3a736c={'custom':![]};return utilLicense['getLicense']()[_0xe758('0x28')](function(_0x3ce595){if(_0x3ce595){_0x3a736c=_0x3ce595;}return db[_0xe758('0x45')][_0xe758('0x4c')]({'where':{'id':_0x401caa[_0xe758('0x49')]['id']},'attributes':['logo',_0xe758('0x52'),_0xe758('0x53'),_0xe758('0x54'),_0xe758('0x55'),_0xe758('0x56'),_0xe758('0x57'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x1cc928,null))[_0xe758('0x28')](function(_0x5f5837){if(_0x5f5837){var _0x2b051f=_0x5f5837[_0xe758('0x54')]&&fs[_0xe758('0x5a')](path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0xb5662a,_['toLower'](_0x5f5837[_0xe758('0x54')])))?path[_0xe758('0x5b')](config[_0xe758('0x5c')],_0xb5662a,_[_0xe758('0x5d')](_0x5f5837['favicon'])):path[_0xe758('0x5b')](config['root'],_0xb5662a,_[_0xe758('0x5d')](_0xe758('0x6d')));var _0x5074e9=_0xe758('0x5f')+_[_0xe758('0x60')](_0xe758('0x54'));if(_0x5f5837[_0x5074e9]||!_0x3a736c['custom']){_0x2b051f=path['join'](config[_0xe758('0x5c')],_0xb5662a,_['toLower'](_0xe758('0x6d')));}if(!fs[_0xe758('0x5a')](_0x2b051f)){throw new db[(_0xe758('0x61'))][(_0xe758('0x62'))](_['upperFirst'](_0xe758('0x54'))+_0xe758('0x63'));}return _0x1cc928[_0xe758('0x64')](_0x2b051f);}})['catch'](handleError(_0x1cc928,null));};exports[_0xe758('0x6e')]=function(_0x4b03b9,_0x2cba7c){var _0x331081={'offset':moment()['utcOffset']()};_0x331081[_0xe758('0x6f')]=moment()['utcOffset'](_0x331081['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2cba7c[_0xe758('0x1f')](0xc8)[_0xe758('0x2c')](_0x331081);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 360887e..688ecee 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0x008c,0x188));var _0xc008=function(_0x4f2ee2,_0x1828cd){_0x4f2ee2=_0x4f2ee2-0x0;var _0x3b87d9=_0x008c[_0x4f2ee2];return _0x3b87d9;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x4471b3,_0x511a9f){var _0x386593=function(_0x1057e2){while(--_0x1057e2){_0x4471b3['push'](_0x4471b3['shift']());}};_0x386593(++_0x511a9f);}(_0x008c,0x188));var _0xc008=function(_0xeb254a,_0x1c1fc9){_0xeb254a=_0xeb254a-0x0;var _0x78e431=_0x008c[_0xeb254a];return _0x78e431;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 1da3a2b..a958399 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 _0xb211=['result','ShowSetting','Setting','options','raw','where','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','request\x20sent'];(function(_0x34def0,_0x554b5b){var _0x2be1c9=function(_0x45b895){while(--_0x45b895){_0x34def0['push'](_0x34def0['shift']());}};_0x2be1c9(++_0x554b5b);}(_0xb211,0xfb));var _0x1b21=function(_0x407fb3,_0x550c7d){_0x407fb3=_0x407fb3-0x0;var _0x378ad1=_0xb211[_0x407fb3];return _0x378ad1;};'use strict';var _=require(_0x1b21('0x0'));var util=require(_0x1b21('0x1'));var moment=require(_0x1b21('0x2'));var BPromise=require(_0x1b21('0x3'));var rs=require(_0x1b21('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b21('0x5'))['db'];var utils=require(_0x1b21('0x6'));var logger=require(_0x1b21('0x7'))('rpc');var config=require(_0x1b21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1b21('0x9')][_0x1b21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54d019,_0x49825a,_0x63835a){return new BPromise(function(_0xbe2c6e,_0x5a9dfb){return client[_0x1b21('0xb')](_0x54d019,_0x63835a)[_0x1b21('0xc')](function(_0x93f34d){logger[_0x1b21('0xd')]('Setting,\x20%s,\x20%s',_0x49825a,'request\x20sent');logger['debug'](_0x1b21('0xe'),_0x49825a,'request\x20sent',JSON['stringify'](_0x93f34d));if(_0x93f34d['error']){if(_0x93f34d[_0x1b21('0xf')]['code']===0x1f4){logger[_0x1b21('0xf')](_0x1b21('0x10'),_0x49825a,_0x93f34d[_0x1b21('0xf')][_0x1b21('0x11')]);return _0x5a9dfb(_0x93f34d[_0x1b21('0xf')]['message']);}logger[_0x1b21('0xf')]('Setting,\x20%s,\x20%s',_0x49825a,_0x93f34d['error'][_0x1b21('0x11')]);return _0xbe2c6e(_0x93f34d[_0x1b21('0xf')][_0x1b21('0x11')]);}else{logger[_0x1b21('0xd')](_0x1b21('0x10'),_0x49825a,_0x1b21('0x12'));_0xbe2c6e(_0x93f34d[_0x1b21('0x13')][_0x1b21('0x11')]);}})['catch'](function(_0x2d98a8){logger[_0x1b21('0xf')](_0x1b21('0x10'),_0x49825a,_0x2d98a8);_0x5a9dfb(_0x2d98a8);});});}exports[_0x1b21('0x14')]=function(_0x2bd4e1){var _0xdefc32=this;return new Promise(function(_0x5befdc,_0xc51e4a){return db[_0x1b21('0x15')]['find']({'raw':_0x2bd4e1[_0x1b21('0x16')]?_0x2bd4e1[_0x1b21('0x16')][_0x1b21('0x17')]===undefined?!![]:![]:!![],'where':_0x2bd4e1[_0x1b21('0x16')]?_0x2bd4e1['options'][_0x1b21('0x18')]||null:null,'attributes':_0x2bd4e1[_0x1b21('0x16')]?_0x2bd4e1[_0x1b21('0x16')]['attributes']||null:null,'include':_0x2bd4e1[_0x1b21('0x16')]?_0x2bd4e1[_0x1b21('0x16')][_0x1b21('0x19')]?_[_0x1b21('0x1a')](_0x2bd4e1[_0x1b21('0x16')][_0x1b21('0x19')],function(_0x5bf318){return{'model':db[_0x5bf318[_0x1b21('0x1b')]],'as':_0x5bf318['as'],'attributes':_0x5bf318['attributes'],'include':_0x5bf318['include']?_[_0x1b21('0x1a')](_0x5bf318['include'],function(_0x3a0e1e){return{'model':db[_0x3a0e1e[_0x1b21('0x1b')]],'as':_0x3a0e1e['as'],'attributes':_0x3a0e1e['attributes'],'include':_0x3a0e1e['include']?_[_0x1b21('0x1a')](_0x3a0e1e[_0x1b21('0x19')],function(_0xa36a32){return{'model':db[_0xa36a32[_0x1b21('0x1b')]],'as':_0xa36a32['as'],'attributes':_0xa36a32['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b21('0xc')](function(_0x13da9){logger[_0x1b21('0xd')](_0x1b21('0x14'),_0x2bd4e1);logger['debug']('ShowSetting',_0x2bd4e1,JSON[_0x1b21('0x1c')](_0x13da9));_0x5befdc(_0x13da9);})[_0x1b21('0x1d')](function(_0x3f6e16){logger[_0x1b21('0xf')](_0x1b21('0x14'),_0x3f6e16[_0x1b21('0x11')],_0x2bd4e1);_0xc51e4a(_0xdefc32[_0x1b21('0xf')](0x1f4,_0x3f6e16[_0x1b21('0x11')]));});});}; \ No newline at end of file +var _0xf6c3=['util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','find','options','raw','where','attributes','include','map','model','lodash'];(function(_0x267576,_0x3ee0c0){var _0x36527f=function(_0x101e65){while(--_0x101e65){_0x267576['push'](_0x267576['shift']());}};_0x36527f(++_0x3ee0c0);}(_0xf6c3,0x154));var _0x3f6c=function(_0x3e5c8b,_0x35e45c){_0x3e5c8b=_0x3e5c8b-0x0;var _0x90698d=_0xf6c3[_0x3e5c8b];return _0x90698d;};'use strict';var _=require(_0x3f6c('0x0'));var util=require(_0x3f6c('0x1'));var moment=require(_0x3f6c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f6c('0x3'));var db=require(_0x3f6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f6c('0x5'));var config=require(_0x3f6c('0x6'));var jayson=require(_0x3f6c('0x7'));var client=jayson[_0x3f6c('0x8')][_0x3f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22b653,_0x4593d8,_0x19000c){return new BPromise(function(_0x1b11f0,_0x1a4ea9){return client['request'](_0x22b653,_0x19000c)[_0x3f6c('0xa')](function(_0x12210c){logger[_0x3f6c('0xb')]('Setting,\x20%s,\x20%s',_0x4593d8,'request\x20sent');logger[_0x3f6c('0xc')](_0x3f6c('0xd'),_0x4593d8,_0x3f6c('0xe'),JSON[_0x3f6c('0xf')](_0x12210c));if(_0x12210c['error']){if(_0x12210c[_0x3f6c('0x10')][_0x3f6c('0x11')]===0x1f4){logger[_0x3f6c('0x10')](_0x3f6c('0x12'),_0x4593d8,_0x12210c[_0x3f6c('0x10')]['message']);return _0x1a4ea9(_0x12210c['error'][_0x3f6c('0x13')]);}logger[_0x3f6c('0x10')](_0x3f6c('0x12'),_0x4593d8,_0x12210c[_0x3f6c('0x10')]['message']);return _0x1b11f0(_0x12210c[_0x3f6c('0x10')]['message']);}else{logger[_0x3f6c('0xb')](_0x3f6c('0x12'),_0x4593d8,_0x3f6c('0xe'));_0x1b11f0(_0x12210c[_0x3f6c('0x14')][_0x3f6c('0x13')]);}})[_0x3f6c('0x15')](function(_0x308a90){logger['error'](_0x3f6c('0x12'),_0x4593d8,_0x308a90);_0x1a4ea9(_0x308a90);});});}exports[_0x3f6c('0x16')]=function(_0xa945fb){var _0x3e1609=this;return new Promise(function(_0x1acdc0,_0x4142ba){return db['Setting'][_0x3f6c('0x17')]({'raw':_0xa945fb[_0x3f6c('0x18')]?_0xa945fb[_0x3f6c('0x18')][_0x3f6c('0x19')]===undefined?!![]:![]:!![],'where':_0xa945fb['options']?_0xa945fb['options'][_0x3f6c('0x1a')]||null:null,'attributes':_0xa945fb[_0x3f6c('0x18')]?_0xa945fb['options'][_0x3f6c('0x1b')]||null:null,'include':_0xa945fb[_0x3f6c('0x18')]?_0xa945fb['options'][_0x3f6c('0x1c')]?_[_0x3f6c('0x1d')](_0xa945fb[_0x3f6c('0x18')][_0x3f6c('0x1c')],function(_0x7717c3){return{'model':db[_0x7717c3[_0x3f6c('0x1e')]],'as':_0x7717c3['as'],'attributes':_0x7717c3[_0x3f6c('0x1b')],'include':_0x7717c3[_0x3f6c('0x1c')]?_[_0x3f6c('0x1d')](_0x7717c3[_0x3f6c('0x1c')],function(_0x12cc82){return{'model':db[_0x12cc82[_0x3f6c('0x1e')]],'as':_0x12cc82['as'],'attributes':_0x12cc82[_0x3f6c('0x1b')],'include':_0x12cc82['include']?_[_0x3f6c('0x1d')](_0x12cc82[_0x3f6c('0x1c')],function(_0x867aed){return{'model':db[_0x867aed['model']],'as':_0x867aed['as'],'attributes':_0x867aed[_0x3f6c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f6c('0xa')](function(_0x9044a8){logger[_0x3f6c('0xb')](_0x3f6c('0x16'),_0xa945fb);logger[_0x3f6c('0xc')]('ShowSetting',_0xa945fb,JSON['stringify'](_0x9044a8));_0x1acdc0(_0x9044a8);})[_0x3f6c('0x15')](function(_0x5e52c3){logger['error'](_0x3f6c('0x16'),_0x5e52c3['message'],_0xa945fb);_0x4142ba(_0x3e1609[_0x3f6c('0x10')](0x1f4,_0x5e52c3[_0x3f6c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c2f0863..1dafbae 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2fe263,_0x11c4d5){var _0x245ce5=function(_0x5c16e6){while(--_0x5c16e6){_0x2fe263['push'](_0x2fe263['shift']());}};_0x245ce5(++_0x11c4d5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x4a8ce2,_0x4cd94e){var _0x38c265=function(_0x1fb277){while(--_0x1fb277){_0x4a8ce2['push'](_0x4a8ce2['shift']());}};_0x38c265(++_0x4cd94e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 4740339..0bcd5f8 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 _0xbb14=['name','STRING','generate','twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x545290,_0x4d17c0){var _0x29cef5=function(_0x3b4d70){while(--_0x3b4d70){_0x545290['push'](_0x545290['shift']());}};_0x29cef5(++_0x4d17c0);}(_0xbb14,0x98));var _0x4bb1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xbb14[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x4bb1('0x0'));var rs=require(_0x4bb1('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bb1('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x4bb1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x4bb1('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4bb1('0x3')],'defaultValue':function(){return rs[_0x4bb1('0x4')]();}},'phone':{'type':Sequelize[_0x4bb1('0x3')]},'type':{'type':Sequelize['ENUM'](_0x4bb1('0x5'),_0x4bb1('0x6'),_0x4bb1('0x7'),'clicksend',_0x4bb1('0x8'),_0x4bb1('0x9'),_0x4bb1('0xa'),_0x4bb1('0xb'),'infobip',_0x4bb1('0xc'))},'accountSid':{'type':Sequelize[_0x4bb1('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x4bb1('0xd')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4bb1('0x3')]},'apiKey':{'type':Sequelize[_0x4bb1('0x3')]},'applicationId':{'type':Sequelize[_0x4bb1('0x3')]},'accountId':{'type':Sequelize[_0x4bb1('0x3')]},'senderString':{'type':Sequelize[_0x4bb1('0x3')]},'deliveryReport':{'type':Sequelize[_0x4bb1('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x4bb1('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4bb1('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4bb1('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4bb1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4bb1('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4bb1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4bb1('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4bb1('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4bb1('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4bb1('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x4bb1('0xe')],'defaultValue':![],'comment':_0x4bb1('0x12'),'set':function(_0x5409de){if(!_0x5409de)this['setDataValue'](_0x4bb1('0x13'),null);this[_0x4bb1('0x14')](_0x4bb1('0x15'),_0x5409de);}}}; \ No newline at end of file +var _0xb7b9=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x8d9a6,_0x1f3fdb){var _0x230702=function(_0x2e3011){while(--_0x2e3011){_0x8d9a6['push'](_0x8d9a6['shift']());}};_0x230702(++_0x1f3fdb);}(_0xb7b9,0x1e5));var _0x9b7b=function(_0x266fc9,_0x42779b){_0x266fc9=_0x266fc9-0x0;var _0x434212=_0xb7b9[_0x266fc9];return _0x434212;};'use strict';var Sequelize=require(_0x9b7b('0x0'));var rs=require('randomstring');module[_0x9b7b('0x1')]={'name':{'type':Sequelize[_0x9b7b('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x9b7b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x9b7b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x9b7b('0x2')],'defaultValue':function(){return rs[_0x9b7b('0x3')]();}},'phone':{'type':Sequelize[_0x9b7b('0x2')]},'type':{'type':Sequelize[_0x9b7b('0x4')](_0x9b7b('0x5'),_0x9b7b('0x6'),'connectel',_0x9b7b('0x7'),_0x9b7b('0x8'),'clickatell',_0x9b7b('0x9'),'csc',_0x9b7b('0xa'),_0x9b7b('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x9b7b('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x9b7b('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x9b7b('0x2')]},'applicationId':{'type':Sequelize[_0x9b7b('0x2')]},'accountId':{'type':Sequelize[_0x9b7b('0x2')]},'senderString':{'type':Sequelize[_0x9b7b('0x2')]},'deliveryReport':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x9b7b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9b7b('0xd')],'defaultValue':function(){return _0x9b7b('0xe');}},'notificationSound':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b7b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b7b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9b7b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9b7b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b7b('0xf')],'comment':_0x9b7b('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x9b7b('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x57c79e){if(!_0x57c79e)this[_0x9b7b('0x11')](_0x9b7b('0x12'),null);this[_0x9b7b('0x11')](_0x9b7b('0x13'),_0x57c79e);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 080bc12..97e2146 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 _0x9a94=['query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','findAll','removeAnswers','notify','sms','SmsApplication','Applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','clicksend','message_id','plivo','MessageUUID','infobip','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','color','tag','to\x20is\x20mandatory','CmList','List','user','out','dataValues','Messages','push','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','connectel','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','squel','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','count','set','apply','save','destroy','get','SmsAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model'];(function(_0x32a005,_0x27d7f2){var _0x41ccf4=function(_0x20bf67){while(--_0x20bf67){_0x32a005['push'](_0x32a005['shift']());}};_0x41ccf4(++_0x27d7f2);}(_0x9a94,0x182));var _0x49a9=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x9a94[_0x1fb4e1];return _0x22d1b0;};'use strict';var emlformat=require(_0x49a9('0x0'));var rimraf=require(_0x49a9('0x1'));var zipdir=require(_0x49a9('0x2'));var jsonpatch=require(_0x49a9('0x3'));var rp=require('request-promise');var moment=require(_0x49a9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x49a9('0x5'));var sox=require(_0x49a9('0x6'));var csv=require(_0x49a9('0x7'));var ejs=require(_0x49a9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49a9('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49a9('0x7'));var querystring=require(_0x49a9('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x49a9('0xb'));var hardwareService=require(_0x49a9('0xc'));var logger=require(_0x49a9('0xd'))('api');var utils=require(_0x49a9('0xe'));var config=require(_0x49a9('0xf'));var licenseUtil=require(_0x49a9('0x10'));var db=require(_0x49a9('0x11'))['db'];config[_0x49a9('0x12')]=_[_0x49a9('0x13')](config['redis'],{'host':_0x49a9('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49a9('0x12')]));require(_0x49a9('0x15'))[_0x49a9('0x16')](socket);var jayson=require(_0x49a9('0x17'));var client=jayson[_0x49a9('0x18')][_0x49a9('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x48f73c,_0x15e283,_0x4984ca,_0x37de3e){return new BPromise(function(_0x9ac7fb,_0x24fa87){var _0x1aaec4=_0x37de3e||client;return _0x1aaec4[_0x49a9('0x1a')](_0x48f73c,_0x4984ca)[_0x49a9('0x1b')](function(_0x187beb){logger[_0x49a9('0x1c')]('SmsAccount,\x20%s,\x20%s',_0x15e283,'request\x20sent');logger[_0x49a9('0x1d')](_0x49a9('0x1e'),_0x15e283,'request\x20sent',JSON[_0x49a9('0x1f')](_0x187beb));if(_0x187beb['error']){if(_0x187beb[_0x49a9('0x20')]['code']===0x1f4){logger[_0x49a9('0x20')](_0x49a9('0x21'),_0x15e283,_0x187beb[_0x49a9('0x20')][_0x49a9('0x22')]);return _0x24fa87(_0x187beb['error'][_0x49a9('0x22')]);}logger[_0x49a9('0x20')](_0x49a9('0x21'),_0x15e283,_0x187beb[_0x49a9('0x20')][_0x49a9('0x22')]);return _0x9ac7fb(_0x187beb['error'][_0x49a9('0x22')]);}else{logger[_0x49a9('0x1c')]('SmsAccount,\x20%s,\x20%s',_0x15e283,_0x49a9('0x23'));_0x9ac7fb(_0x187beb[_0x49a9('0x24')][_0x49a9('0x22')]);}})[_0x49a9('0x25')](function(_0x5c676c){logger[_0x49a9('0x20')](_0x49a9('0x21'),_0x15e283,_0x5c676c);_0x24fa87(_0x5c676c);});});}function respondWithStatusCode(_0x11a187,_0x56840a){_0x56840a=_0x56840a||0xcc;return function(_0xf24214){if(_0xf24214){return _0x11a187[_0x49a9('0x26')](_0x56840a);}return _0x11a187[_0x49a9('0x27')](_0x56840a)[_0x49a9('0x28')]();};}function respondWithResult(_0x4baff1,_0x115dd0){_0x115dd0=_0x115dd0||0xc8;return function(_0x26aab1){if(_0x26aab1){return _0x4baff1['status'](_0x115dd0)['json'](_0x26aab1);}};}function respondWithFilteredResult(_0x43d8cc,_0x5a357a){return function(_0x2b921d){if(_0x2b921d){var _0x284f65=typeof _0x5a357a[_0x49a9('0x29')]==='undefined'&&typeof _0x5a357a['limit']===_0x49a9('0x2a');var _0x3d8273=_0x2b921d[_0x49a9('0x2b')];var _0x13c1a6=_0x284f65?0x0:_0x5a357a[_0x49a9('0x29')];var _0x40bec3=_0x284f65?_0x2b921d[_0x49a9('0x2b')]:_0x5a357a[_0x49a9('0x29')]+_0x5a357a['limit'];var _0x7b5594;if(_0x40bec3>=_0x3d8273){_0x40bec3=_0x3d8273;_0x7b5594=0xc8;}else{_0x7b5594=0xce;}_0x43d8cc[_0x49a9('0x27')](_0x7b5594);return _0x43d8cc[_0x49a9('0x2c')]('Content-Range',_0x13c1a6+'-'+_0x40bec3+'/'+_0x3d8273)['json'](_0x2b921d);}return null;};}function patchUpdates(_0x13b40f){return function(_0x3c16f8){try{jsonpatch[_0x49a9('0x2d')](_0x3c16f8,_0x13b40f,!![]);}catch(_0x25f716){return BPromise['reject'](_0x25f716);}return _0x3c16f8[_0x49a9('0x2e')]();};}function saveUpdates(_0x20e7b4,_0x238016){return function(_0x2ddfb7){if(_0x2ddfb7){return _0x2ddfb7['update'](_0x20e7b4)[_0x49a9('0x1b')](function(_0x60fbe4){return _0x60fbe4;});}return null;};}function removeEntity(_0x45c114,_0x5941c7){return function(_0x533e90){if(_0x533e90){return _0x533e90[_0x49a9('0x2f')]()['then'](function(){var _0x275ffd=_0x533e90[_0x49a9('0x30')]({'plain':!![]});var _0x1e7fe2=_0x49a9('0x31');return db[_0x49a9('0x32')][_0x49a9('0x2f')]({'where':{'type':_0x1e7fe2,'resourceId':_0x275ffd['id']}})[_0x49a9('0x1b')](function(){return _0x533e90;});})[_0x49a9('0x1b')](function(){_0x45c114[_0x49a9('0x27')](0xcc)[_0x49a9('0x28')]();});}};}function handleEntityNotFound(_0x19e275,_0x22199e){return function(_0x57c5ae){if(!_0x57c5ae){_0x19e275[_0x49a9('0x26')](0x194);}return _0x57c5ae;};}function handleError(_0x493a9d,_0x1812fc){_0x1812fc=_0x1812fc||0x1f4;return function(_0x3e0c5){logger[_0x49a9('0x20')](_0x3e0c5['stack']);if(_0x3e0c5['name']){delete _0x3e0c5[_0x49a9('0x33')];}_0x493a9d[_0x49a9('0x27')](_0x1812fc)[_0x49a9('0x34')](_0x3e0c5);};}exports[_0x49a9('0x35')]=function(_0x43b9b2,_0x527dae){var _0x43b175={'include':[{'model':db['Pause'],'as':_0x49a9('0x36')}]},_0x3a71a0={},_0x3f8560={'count':0x0,'rows':[]};var _0x55eb50=_[_0x49a9('0x37')](db[_0x49a9('0x38')][_0x49a9('0x39')],function(_0x31cdb3){return{'name':_0x31cdb3[_0x49a9('0x3a')],'type':_0x31cdb3[_0x49a9('0x3b')][_0x49a9('0x3c')]};});_0x3a71a0[_0x49a9('0x3d')]=_[_0x49a9('0x37')](_0x55eb50,_0x49a9('0x33'));_0x3a71a0[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x43b9b2['query']);_0x3a71a0[_0x49a9('0x40')]=_['intersection'](_0x3a71a0['model'],_0x3a71a0[_0x49a9('0x3e')]);_0x43b175[_0x49a9('0x41')]=_[_0x49a9('0x42')](_0x3a71a0[_0x49a9('0x3d')],qs['fields'](_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x43')]));_0x43b175['attributes']=_0x43b175['attributes'][_0x49a9('0x44')]?_0x43b175['attributes']:_0x3a71a0[_0x49a9('0x3d')];if(!_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x45')]('nolimit')){_0x43b175[_0x49a9('0x46')]=qs[_0x49a9('0x46')](_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x46')]);_0x43b175[_0x49a9('0x29')]=qs[_0x49a9('0x29')](_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x29')]);}_0x43b175['order']=qs[_0x49a9('0x47')](_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x47')]);_0x43b175['where']=qs[_0x49a9('0x40')](_[_0x49a9('0x48')](_0x43b9b2[_0x49a9('0x3e')],_0x3a71a0[_0x49a9('0x40')]),_0x55eb50);if(_0x43b9b2[_0x49a9('0x3e')][_0x49a9('0x49')]){_0x43b175[_0x49a9('0x4a')]=_[_0x49a9('0x4b')](_0x43b175[_0x49a9('0x4a')],{'$or':_['map'](_0x55eb50,function(_0x11629c){if(_0x11629c[_0x49a9('0x3b')]!==_0x49a9('0x4c')){var _0x1f15bc={};_0x1f15bc[_0x11629c['name']]={'$like':'%'+_0x43b9b2['query'][_0x49a9('0x49')]+'%'};return _0x1f15bc;}})});}_0x43b175=_[_0x49a9('0x4b')]({},_0x43b175,_0x43b9b2[_0x49a9('0x4d')]);var _0x39f59b={'where':_0x43b175[_0x49a9('0x4a')]};return db[_0x49a9('0x38')]['count'](_0x39f59b)[_0x49a9('0x1b')](function(_0x5cc975){_0x3f8560[_0x49a9('0x2b')]=_0x5cc975;if(_0x43b9b2['query'][_0x49a9('0x4e')]){_0x43b175[_0x49a9('0x4f')]=[{'all':!![]}];}return db[_0x49a9('0x38')]['findAll'](_0x43b175);})[_0x49a9('0x1b')](function(_0x165a05){_0x3f8560[_0x49a9('0x50')]=_0x165a05;return _0x3f8560;})['then'](respondWithFilteredResult(_0x527dae,_0x43b175))['catch'](handleError(_0x527dae,null));};exports[_0x49a9('0x51')]=function(_0x59bd9a,_0x3fc897){var _0xd7cf19={'raw':![],'where':{'id':_0x59bd9a[_0x49a9('0x52')]['id']},'include':[{'model':db[_0x49a9('0x53')],'as':'mandatoryDispositionPause'}]},_0x50654d={};_0x50654d['model']=_[_0x49a9('0x3f')](db[_0x49a9('0x38')][_0x49a9('0x39')]);_0x50654d[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x59bd9a['query']);_0x50654d['filters']=_[_0x49a9('0x42')](_0x50654d[_0x49a9('0x3d')],_0x50654d[_0x49a9('0x3e')]);_0xd7cf19['attributes']=_[_0x49a9('0x42')](_0x50654d[_0x49a9('0x3d')],qs[_0x49a9('0x43')](_0x59bd9a[_0x49a9('0x3e')]['fields']));_0xd7cf19['attributes']=_0xd7cf19['attributes'][_0x49a9('0x44')]?_0xd7cf19[_0x49a9('0x41')]:_0x50654d[_0x49a9('0x3d')];if(_0x59bd9a[_0x49a9('0x3e')][_0x49a9('0x4e')]){_0xd7cf19[_0x49a9('0x4f')]=[{'all':!![]}];}_0xd7cf19=_[_0x49a9('0x4b')]({},_0xd7cf19,_0x59bd9a[_0x49a9('0x4d')]);return db['SmsAccount']['find'](_0xd7cf19)['then'](handleEntityNotFound(_0x3fc897,null))[_0x49a9('0x1b')](respondWithResult(_0x3fc897,null))['catch'](handleError(_0x3fc897,null));};exports[_0x49a9('0x54')]=function(_0x9909a4,_0xa8a708){return db[_0x49a9('0x38')][_0x49a9('0x54')](_0x9909a4[_0x49a9('0x55')],{})['then'](function(_0x1985d4){var _0x40a3e4=_0x9909a4['user'][_0x49a9('0x30')]({'plain':!![]});if(!_0x40a3e4)throw new Error(_0x49a9('0x56'));if(_0x40a3e4[_0x49a9('0x57')]==='user'){var _0x1babcb=_0x1985d4[_0x49a9('0x30')]({'plain':!![]});var _0x1e0ce4=_0x49a9('0x31');return db[_0x49a9('0x58')][_0x49a9('0x59')]({'where':{'name':_0x1e0ce4,'userProfileId':_0x40a3e4[_0x49a9('0x5a')]},'raw':!![]})[_0x49a9('0x1b')](function(_0x44c2a6){if(_0x44c2a6&&_0x44c2a6[_0x49a9('0x5b')]===0x0){return db[_0x49a9('0x32')][_0x49a9('0x54')]({'name':_0x1babcb[_0x49a9('0x33')],'resourceId':_0x1babcb['id'],'type':_0x44c2a6[_0x49a9('0x33')],'sectionId':_0x44c2a6['id']},{})[_0x49a9('0x1b')](function(){return _0x1985d4;});}else{return _0x1985d4;}})[_0x49a9('0x25')](function(_0x49ede1){logger['error'](_0x49a9('0x5c'),_0x49ede1);throw _0x49ede1;});}return _0x1985d4;})['then'](respondWithResult(_0xa8a708,0xc9))['catch'](handleError(_0xa8a708,null));};exports[_0x49a9('0x5d')]=function(_0x2e9c58,_0x29cf3e){if(_0x2e9c58[_0x49a9('0x55')]['id']){delete _0x2e9c58[_0x49a9('0x55')]['id'];}return db[_0x49a9('0x38')]['find']({'where':{'id':_0x2e9c58[_0x49a9('0x52')]['id']},'include':[{'model':db[_0x49a9('0x53')],'as':_0x49a9('0x36')}]})[_0x49a9('0x1b')](handleEntityNotFound(_0x29cf3e,null))[_0x49a9('0x1b')](saveUpdates(_0x2e9c58['body'],null))[_0x49a9('0x1b')](respondWithResult(_0x29cf3e,null))[_0x49a9('0x25')](handleError(_0x29cf3e,null));};exports['destroy']=function(_0x35890d,_0x14ee3b){return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x35890d[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x14ee3b,null))[_0x49a9('0x1b')](removeEntity(_0x14ee3b,null))[_0x49a9('0x25')](handleError(_0x14ee3b,null));};exports[_0x49a9('0x5e')]=function(_0x51ce3d,_0x5ecd1a){return db[_0x49a9('0x38')][_0x49a9('0x5e')]()[_0x49a9('0x1b')](respondWithResult(_0x5ecd1a,null))['catch'](handleError(_0x5ecd1a,null));};exports[_0x49a9('0x5f')]=function(_0x39f3c2,_0x3637b2,_0x31d449){if(_0x39f3c2[_0x49a9('0x55')]['id']){delete _0x39f3c2[_0x49a9('0x55')]['id'];}return db['SmsAccount'][_0x49a9('0x59')]({'where':{'id':_0x39f3c2['params']['id']}})['then'](handleEntityNotFound(_0x3637b2,null))[_0x49a9('0x1b')](function(_0x214dd6){if(_0x214dd6){_0x39f3c2[_0x49a9('0x55')][_0x49a9('0x60')]=_0x214dd6['id'];return db[_0x49a9('0x61')][_0x49a9('0x54')](_0x39f3c2[_0x49a9('0x55')]);}})[_0x49a9('0x1b')](respondWithResult(_0x3637b2,null))['catch'](handleError(_0x3637b2,null));};exports['getDispositions']=function(_0x368bba,_0x420ccc,_0x1a942d){var _0x4628d3={'raw':![],'where':{}};var _0x4fd2c7={};var _0xd1b535={'count':0x0,'rows':[]};return db['SmsAccount'][_0x49a9('0x62')]({'where':{'id':_0x368bba[_0x49a9('0x52')]['id']}})['then'](handleEntityNotFound(_0x420ccc,null))[_0x49a9('0x1b')](function(_0x3ac524){if(_0x3ac524){_0x4fd2c7['model']=_[_0x49a9('0x3f')](db[_0x49a9('0x61')][_0x49a9('0x39')]);_0x4fd2c7[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x368bba[_0x49a9('0x3e')]);_0x4fd2c7['filters']=_[_0x49a9('0x42')](_0x4fd2c7[_0x49a9('0x3d')],_0x4fd2c7['query']);_0x4628d3[_0x49a9('0x41')]=_[_0x49a9('0x42')](_0x4fd2c7[_0x49a9('0x3d')],qs['fields'](_0x368bba[_0x49a9('0x3e')][_0x49a9('0x43')]));_0x4628d3[_0x49a9('0x41')]=_0x4628d3[_0x49a9('0x41')]['length']?_0x4628d3[_0x49a9('0x41')]:_0x4fd2c7[_0x49a9('0x3d')];if(!_0x368bba[_0x49a9('0x3e')]['hasOwnProperty'](_0x49a9('0x63'))){_0x4628d3[_0x49a9('0x46')]=qs[_0x49a9('0x46')](_0x368bba[_0x49a9('0x3e')][_0x49a9('0x46')]);_0x4628d3[_0x49a9('0x29')]=qs['offset'](_0x368bba[_0x49a9('0x3e')][_0x49a9('0x29')]);}_0x4628d3['order']=qs[_0x49a9('0x47')](_0x368bba['query'][_0x49a9('0x47')]);_0x4628d3['where']=qs[_0x49a9('0x40')](_[_0x49a9('0x48')](_0x368bba['query'],_0x4fd2c7[_0x49a9('0x40')]));_0x4628d3[_0x49a9('0x4a')][_0x49a9('0x60')]=_0x3ac524['id'];if(_0x368bba['query']['filter']){_0x4628d3[_0x49a9('0x4a')]=_[_0x49a9('0x4b')](_0x4628d3[_0x49a9('0x4a')],{'$or':_[_0x49a9('0x37')](_0x4628d3[_0x49a9('0x41')],function(_0x2fe0f3){var _0xfe50a7={};_0xfe50a7[_0x2fe0f3]={'$like':'%'+_0x368bba[_0x49a9('0x3e')][_0x49a9('0x49')]+'%'};return _0xfe50a7;})});}_0x4628d3=_[_0x49a9('0x4b')]({},_0x4628d3,_0x368bba[_0x49a9('0x4d')]);return db['Disposition'][_0x49a9('0x2b')]({'where':_0x4628d3['where']})[_0x49a9('0x1b')](function(_0x441cd4){_0xd1b535[_0x49a9('0x2b')]=_0x441cd4;if(_0x368bba[_0x49a9('0x3e')]['includeAll']){_0x4628d3['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4628d3);})[_0x49a9('0x1b')](function(_0x32a3d4){_0xd1b535[_0x49a9('0x50')]=_0x32a3d4;return _0xd1b535;});}})[_0x49a9('0x1b')](respondWithFilteredResult(_0x420ccc,_0x4628d3))[_0x49a9('0x25')](handleError(_0x420ccc,null));};exports['removeDispositions']=function(_0x4fd7c1,_0x45f1c0,_0x16fd08){return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x4fd7c1[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x45f1c0,null))[_0x49a9('0x1b')](function(_0x42b881){if(_0x42b881){return _0x42b881[_0x49a9('0x64')](_0x4fd7c1['query'][_0x49a9('0x65')]);}})[_0x49a9('0x1b')](respondWithStatusCode(_0x45f1c0,null))[_0x49a9('0x25')](handleError(_0x45f1c0,null));};exports['addAnswer']=function(_0x2c307d,_0x5cbb59,_0x18f163){if(_0x2c307d[_0x49a9('0x55')]['id']){delete _0x2c307d[_0x49a9('0x55')]['id'];}return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x2c307d['params']['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x5cbb59,null))[_0x49a9('0x1b')](function(_0x1c70d8){if(_0x1c70d8){_0x2c307d[_0x49a9('0x55')][_0x49a9('0x60')]=_0x1c70d8['id'];return db[_0x49a9('0x66')][_0x49a9('0x54')](_0x2c307d[_0x49a9('0x55')]);}})[_0x49a9('0x1b')](respondWithResult(_0x5cbb59,null))['catch'](handleError(_0x5cbb59,null));};exports[_0x49a9('0x67')]=function(_0x87f95a,_0x3745df,_0x407703){var _0x21f24c={'raw':![],'where':{}};var _0x1a09a4={};var _0x830bb3={'count':0x0,'rows':[]};return db['SmsAccount'][_0x49a9('0x62')]({'where':{'id':_0x87f95a[_0x49a9('0x52')]['id']}})['then'](handleEntityNotFound(_0x3745df,null))[_0x49a9('0x1b')](function(_0x315863){if(_0x315863){_0x1a09a4[_0x49a9('0x3d')]=_[_0x49a9('0x3f')](db['CannedAnswer'][_0x49a9('0x39')]);_0x1a09a4[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x87f95a[_0x49a9('0x3e')]);_0x1a09a4['filters']=_[_0x49a9('0x42')](_0x1a09a4[_0x49a9('0x3d')],_0x1a09a4['query']);_0x21f24c[_0x49a9('0x41')]=_[_0x49a9('0x42')](_0x1a09a4[_0x49a9('0x3d')],qs['fields'](_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x43')]));_0x21f24c[_0x49a9('0x41')]=_0x21f24c[_0x49a9('0x41')][_0x49a9('0x44')]?_0x21f24c[_0x49a9('0x41')]:_0x1a09a4[_0x49a9('0x3d')];if(!_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x45')](_0x49a9('0x63'))){_0x21f24c[_0x49a9('0x46')]=qs['limit'](_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x46')]);_0x21f24c[_0x49a9('0x29')]=qs[_0x49a9('0x29')](_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x29')]);}_0x21f24c[_0x49a9('0x68')]=qs['sort'](_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x47')]);_0x21f24c[_0x49a9('0x4a')]=qs[_0x49a9('0x40')](_[_0x49a9('0x48')](_0x87f95a[_0x49a9('0x3e')],_0x1a09a4[_0x49a9('0x40')]));_0x21f24c[_0x49a9('0x4a')][_0x49a9('0x60')]=_0x315863['id'];if(_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x49')]){_0x21f24c[_0x49a9('0x4a')]=_['merge'](_0x21f24c[_0x49a9('0x4a')],{'$or':_[_0x49a9('0x37')](_0x21f24c['attributes'],function(_0x4d11a3){var _0x6c6c0c={};_0x6c6c0c[_0x4d11a3]={'$like':'%'+_0x87f95a[_0x49a9('0x3e')][_0x49a9('0x49')]+'%'};return _0x6c6c0c;})});}_0x21f24c=_[_0x49a9('0x4b')]({},_0x21f24c,_0x87f95a[_0x49a9('0x4d')]);return db[_0x49a9('0x66')][_0x49a9('0x2b')]({'where':_0x21f24c[_0x49a9('0x4a')]})['then'](function(_0x211aea){_0x830bb3['count']=_0x211aea;if(_0x87f95a['query']['includeAll']){_0x21f24c['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x49a9('0x69')](_0x21f24c);})[_0x49a9('0x1b')](function(_0x556632){_0x830bb3[_0x49a9('0x50')]=_0x556632;return _0x830bb3;});}})[_0x49a9('0x1b')](respondWithFilteredResult(_0x3745df,_0x21f24c))[_0x49a9('0x25')](handleError(_0x3745df,null));};exports[_0x49a9('0x6a')]=function(_0x3a9ad0,_0xb9cdee,_0x459a70){return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x3a9ad0[_0x49a9('0x52')]['id']}})['then'](handleEntityNotFound(_0xb9cdee,null))[_0x49a9('0x1b')](function(_0x39c8fc){if(_0x39c8fc){return _0x39c8fc[_0x49a9('0x6a')](_0x3a9ad0[_0x49a9('0x3e')][_0x49a9('0x65')]);}})[_0x49a9('0x1b')](respondWithStatusCode(_0xb9cdee,null))[_0x49a9('0x25')](handleError(_0xb9cdee,null));};exports[_0x49a9('0x6b')]=function(_0x529f55,_0x5a345a,_0x34f326){var _0x185231={'channel':_0x49a9('0x6c')};var _0x580f4e=[];var _0x17f5c9=[];var _0x53ad10={};return db[_0x49a9('0x38')]['find']({'where':{'id':_0x529f55[_0x49a9('0x52')]['id']},'include':[{'model':db[_0x49a9('0x6d')],'as':_0x49a9('0x6e')}]})[_0x49a9('0x1b')](handleEntityNotFound(_0x5a345a,null))[_0x49a9('0x1b')](function(_0x313dfd){_0x185231['account']=_0x313dfd;_0x185231['applications']=_[_0x49a9('0x6f')](_0x313dfd[_0x49a9('0x6e')],[_0x49a9('0x70')],[_0x49a9('0x71')]);if(_0x185231[_0x49a9('0x72')][_0x49a9('0x6e')]){delete _0x185231[_0x49a9('0x72')][_0x49a9('0x6e')];}return db[_0x49a9('0x73')][_0x49a9('0x5e')]();})[_0x49a9('0x1b')](function(_0x53d517){if(!_0x53d517){throw new db[(_0x49a9('0x74'))][(_0x49a9('0x75'))](_0x49a9('0x76'));}_0x580f4e=_[_0x49a9('0x77')](_['keys'](_0x53d517),[_0x49a9('0x78'),'updatedAt']);_0x17f5c9=_[_0x49a9('0x77')](_[_0x49a9('0x3f')](_0x53d517),[_0x49a9('0x78'),_0x49a9('0x79'),_0x49a9('0x7a'),'ListId']);_0x185231['body']={'mapKey':_0x49a9('0x7b')};if(_0x185231[_0x49a9('0x72')][_0x49a9('0x3b')]){switch(_0x185231[_0x49a9('0x72')][_0x49a9('0x3b')]){case _0x49a9('0x7c'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x7e')];_0x185231[_0x49a9('0x55')]['body']=_0x529f55[_0x49a9('0x55')]['Body'];_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x80')];break;case _0x49a9('0x81'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')]='+'+_0x529f55[_0x49a9('0x55')][_0x49a9('0x82')];_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]=_0x529f55[_0x49a9('0x55')]['text'];break;case'connectel':_0x185231[_0x49a9('0x55')]['from']=_0x529f55['body'][_0x49a9('0x7d')];_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]=_0x529f55['body'][_0x49a9('0x22')];break;case _0x49a9('0x83'):_0x185231[_0x49a9('0x55')]['from']=_0x529f55[_0x49a9('0x55')]['from'];_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x55')];_0x185231['body'][_0x49a9('0x7f')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x84')];break;case _0x49a9('0x85'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')]=_0x529f55['body'][_0x49a9('0x7e')];_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]=_0x529f55[_0x49a9('0x55')]['Text'];_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x86')];break;case _0x49a9('0x87'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')]='+'+_0x529f55[_0x49a9('0x55')][_0x49a9('0x88')][0x0][_0x49a9('0x7d')];_0x185231[_0x49a9('0x55')]['body']=_0x529f55[_0x49a9('0x55')][_0x49a9('0x88')][0x0][_0x49a9('0x89')];_0x185231['body']['messageId']=_0x529f55[_0x49a9('0x55')][_0x49a9('0x88')][0x0][_0x49a9('0x7f')];break;case _0x49a9('0x8a'):_0x185231['body'][_0x49a9('0x7d')]=_0x529f55[_0x49a9('0x55')]['originatingAddress'];_0x185231['body'][_0x49a9('0x55')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x8b')]['message'];break;case _0x49a9('0x8c'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x8d')];_0x185231[_0x49a9('0x55')]['body']=_0x529f55[_0x49a9('0x55')][_0x49a9('0x89')];_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x8e')];break;case _0x49a9('0x8f'):_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')]=_0x529f55['body'][0x0][_0x49a9('0x22')]['id'];_0x185231['body'][_0x49a9('0x7d')]=_0x529f55[_0x49a9('0x55')][0x0][_0x49a9('0x22')][_0x49a9('0x7d')];_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]=_0x529f55[_0x49a9('0x55')][0x0][_0x49a9('0x22')][_0x49a9('0x89')];break;case _0x49a9('0x90'):_0x185231['body'][_0x49a9('0x7d')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x7d')];_0x185231['body'][_0x49a9('0x55')]=_0x529f55['body'][_0x49a9('0x22')];_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')]=_0x529f55[_0x49a9('0x55')][_0x49a9('0x91')];break;}}if(_0x185231[_0x49a9('0x55')]['id']){delete _0x185231[_0x49a9('0x55')]['id'];}if(_[_0x49a9('0x92')](_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')])){throw new db[(_0x49a9('0x74'))][(_0x49a9('0x75'))]('from\x20is\x20mandatory');}if(_[_0x49a9('0x92')](_0x185231[_0x49a9('0x55')]['body'])||_0x185231[_0x49a9('0x55')][_0x49a9('0x55')]===''){throw new db[(_0x49a9('0x74'))][(_0x49a9('0x75'))](_0x49a9('0x93'));}if(_[_0x49a9('0x92')](_0x185231[_0x49a9('0x55')][_0x49a9('0x94')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17f5c9);}if(!_[_0x49a9('0x95')](_0x17f5c9,_0x185231[_0x49a9('0x55')][_0x49a9('0x94')])){throw new db[(_0x49a9('0x74'))]['ValidationError'](_0x49a9('0x96')+_0x17f5c9);}_0x53ad10[_0x185231[_0x49a9('0x55')][_0x49a9('0x94')]]=_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')];return db['CmList'][_0x49a9('0x59')]({'where':{'id':_0x185231[_0x49a9('0x72')]['ListId']},'include':[{'model':db[_0x49a9('0x73')],'as':_0x49a9('0x97'),'where':_0x53ad10,'limit':0x1,'order':[[_0x49a9('0x79'),_0x49a9('0x98')]]}]});})[_0x49a9('0x1b')](handleEntityNotFound(_0x5a345a,null))['then'](function(_0x5eff5b){if(_0x5eff5b){_0x185231[_0x49a9('0x99')]=_[_0x49a9('0x9a')](_0x5eff5b,[_0x49a9('0x97')]);if(_0x5eff5b[_0x49a9('0x97')][_0x49a9('0x44')]){return _0x5eff5b[_0x49a9('0x97')][0x0];}var _0x580cba=_[_0x49a9('0x13')](_0x185231[_0x49a9('0x55')],{'firstName':_0x185231['body'][_0x49a9('0x7d')],'ListId':_0x5eff5b['id']});_0x580cba[_0x185231[_0x49a9('0x55')][_0x49a9('0x94')]]=_0x185231['body']['from'];return db[_0x49a9('0x73')]['create'](_0x580cba,{'fields':_0x580f4e,'raw':!![]});}})['then'](handleEntityNotFound(_0x5a345a,null))[_0x49a9('0x1b')](function(_0x385ab7){if(_0x385ab7){_0x185231[_0x49a9('0x9b')]=_0x385ab7;var _0x3d1163={'ContactId':_0x385ab7['id'],'phone':_0x185231[_0x49a9('0x55')][_0x49a9('0x7d')],'SmsAccountId':_0x529f55[_0x49a9('0x52')]['id']};var _0x235d94={'ContactId':_0x385ab7['id'],'SmsAccountId':_0x529f55[_0x49a9('0x52')]['id'],'closed':![]};return db[_0x49a9('0x9c')][_0x49a9('0x59')]({'where':_0x235d94})[_0x49a9('0x1b')](function(_0x2d901e){if(_0x2d901e){return[_0x2d901e,![]];}return db[_0x49a9('0x9c')][_0x49a9('0x54')](_0x3d1163)[_0x49a9('0x1b')](function(_0x56e7e0){return[_0x56e7e0,!![]];});});}})[_0x49a9('0x9d')](function(_0x5ed60f,_0x47e57b){_0x185231[_0x49a9('0x9e')]=_0x5ed60f[_0x49a9('0x30')]({'plain':!![]});_0x185231[_0x49a9('0x9e')][_0x49a9('0x9f')]=![];if(_0x47e57b){if(_0x185231[_0x49a9('0x72')][_0x49a9('0xa0')]){_0x185231[_0x49a9('0xa1')]['push']({'id':0x0,'priority':_0x185231['applications']['length']+0x1,'app':_0x49a9('0xa2'),'appdata':_0x49a9('0xa3'),'interval':_0x49a9('0xa4')});}_0x185231['interaction'][_0x49a9('0x9f')]=!![];}return db[_0x49a9('0xa5')][_0x49a9('0x54')]({'phone':_0x185231[_0x49a9('0x55')]['from'],'messageId':_0x185231[_0x49a9('0x55')][_0x49a9('0x7f')],'body':_0x185231[_0x49a9('0x55')][_0x49a9('0x55')],'SmsAccountId':_0x529f55['params']['id'],'SmsInteractionId':_0x5ed60f['id'],'direction':'in','ContactId':_0x5ed60f[_0x49a9('0xa6')],'AttachmentId':_0x185231['body'][_0x49a9('0xa7')]});})[_0x49a9('0x1b')](function(_0x2145e7){_0x185231[_0x49a9('0x22')]=_0x2145e7;if(_0x185231['interaction'][_0x49a9('0xa8')]){return db['User'][_0x49a9('0x59')]({'attributes':['id',_0x49a9('0x33')],'where':{'id':_0x185231[_0x49a9('0x9e')][_0x49a9('0xa8')]}})['then'](function(_0x32d033){if(_0x32d033){_0x185231[_0x49a9('0xa1')][_0x49a9('0xa9')]({'id':0x0,'priority':0x0,'app':_0x49a9('0xaa'),'appdata':_0x32d033[_0x49a9('0x33')]+','+(_0x185231['account'][_0x49a9('0xab')]||0xa),'interval':_0x49a9('0xa4')});}return respondWithRpcPromise(_0x49a9('0xac'),'startRouting',_0x185231);});}return respondWithRpcPromise(_0x49a9('0xac'),_0x49a9('0xad'),_0x185231);})['then'](function(_0x539f15){if(_0x539f15){var _0x1d59eb=0xc8;var _0x29030b=_0x49a9('0xae');logger[_0x49a9('0x1c')](_0x49a9('0x1e'),_0x29030b,_0x1d59eb,'entity\x20found');logger['debug'](_0x49a9('0xaf'),_0x29030b,_0x1d59eb,_0x49a9('0xb0'),JSON[_0x49a9('0x1f')](_0x539f15));if(_0x185231[_0x49a9('0x72')][_0x49a9('0x3b')]===_0x49a9('0x7c')){return _0x5a345a['status'](_0x1d59eb)[_0x49a9('0x2c')](_0x49a9('0xb1'),_0x49a9('0xb2'))[_0x49a9('0x34')](_0x49a9('0xb3'));}else{return _0x5a345a[_0x49a9('0x27')](_0x1d59eb)['json'](_0x539f15);}}})[_0x49a9('0x25')](handleError(_0x5a345a,null));};exports[_0x49a9('0xb4')]=function(_0x28d61f,_0x3003fc,_0xd6546c){return db[_0x49a9('0x38')][_0x49a9('0x62')]({'where':{'id':_0x28d61f[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x3003fc,null))[_0x49a9('0x1b')](function(_0x2e4592){if(_0x2e4592){return db[_0x49a9('0xb5')]['transaction'](function(_0x6d7f15){return db[_0x49a9('0x6d')][_0x49a9('0x2f')]({'where':{'SmsAccountId':_0x28d61f[_0x49a9('0x52')]['id']},'transaction':_0x6d7f15})['then'](function(_0x4504ae){var _0x23ff07=_[_0x49a9('0x37')](_0x28d61f['body'],function(_0x4f3d79){_0x4f3d79[_0x49a9('0x60')]=_0x28d61f['params']['id'];return _0x4f3d79;});return db[_0x49a9('0x6d')][_0x49a9('0xb6')](_0x23ff07,{'transaction':_0x6d7f15});});})['then'](function(){return db[_0x49a9('0x6d')][_0x49a9('0xb7')]({'where':{'SmsAccountId':_0x28d61f['params']['id']},'order':_0x49a9('0x70')});});}})[_0x49a9('0x1b')](respondWithResult(_0x3003fc,null))[_0x49a9('0x25')](handleError(_0x3003fc,null));};exports['getApplications']=function(_0x1cc561,_0x58df46,_0x412e4c){var _0x741286={};var _0x4c94f5={};var _0x2ff610;var _0x49635d;return db['SmsAccount'][_0x49a9('0x62')]({'where':{'id':_0x1cc561[_0x49a9('0x52')]['id']}})['then'](handleEntityNotFound(_0x58df46,null))[_0x49a9('0x1b')](function(_0x2568b0){if(_0x2568b0){_0x2ff610=_0x2568b0;_0x4c94f5['model']=_[_0x49a9('0x3f')](db[_0x49a9('0x6d')]['rawAttributes']);_0x4c94f5[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x1cc561[_0x49a9('0x3e')]);_0x4c94f5[_0x49a9('0x40')]=_['intersection'](_0x4c94f5['model'],_0x4c94f5[_0x49a9('0x3e')]);_0x741286['attributes']=_[_0x49a9('0x42')](_0x4c94f5[_0x49a9('0x3d')],qs[_0x49a9('0x43')](_0x1cc561[_0x49a9('0x3e')]['fields']));_0x741286['attributes']=_0x741286['attributes'][_0x49a9('0x44')]?_0x741286[_0x49a9('0x41')]:_0x4c94f5['model'];_0x741286[_0x49a9('0x68')]=qs[_0x49a9('0x47')](_0x1cc561[_0x49a9('0x3e')][_0x49a9('0x47')]);_0x741286['where']=qs[_0x49a9('0x40')](_['pick'](_0x1cc561['query'],_0x4c94f5['filters']));if(_0x1cc561['query']['filter']){_0x741286[_0x49a9('0x4a')]=_[_0x49a9('0x4b')](_0x741286[_0x49a9('0x4a')],{'$or':_[_0x49a9('0x37')](_0x741286['attributes'],function(_0x3922e6){var _0x188745={};_0x188745[_0x3922e6]={'$like':'%'+_0x1cc561[_0x49a9('0x3e')][_0x49a9('0x49')]+'%'};return _0x188745;})});}_0x741286=_[_0x49a9('0x4b')]({},_0x741286,_0x1cc561[_0x49a9('0x4d')]);return _0x2ff610['getApplications'](_0x741286);}})[_0x49a9('0x1b')](function(_0xa30223){if(_0xa30223){_0x49635d=_0xa30223[_0x49a9('0x44')];if(!_0x1cc561[_0x49a9('0x3e')][_0x49a9('0x45')](_0x49a9('0x63'))){_0x741286[_0x49a9('0x46')]=qs['limit'](_0x1cc561[_0x49a9('0x3e')][_0x49a9('0x46')]);_0x741286[_0x49a9('0x29')]=qs['offset'](_0x1cc561[_0x49a9('0x3e')][_0x49a9('0x29')]);}return _0x2ff610[_0x49a9('0xb8')](_0x741286);}})[_0x49a9('0x1b')](function(_0xcf7d3e){if(_0xcf7d3e){return _0xcf7d3e?{'count':_0x49635d,'rows':_0xcf7d3e}:null;}})[_0x49a9('0x1b')](respondWithResult(_0x58df46,null))[_0x49a9('0x25')](handleError(_0x58df46,null));};exports[_0x49a9('0xb9')]=function(_0x2b840d,_0x4be2f9,_0x1295d3){var _0x5801cb={'raw':![],'where':{}};var _0xe981f6={};var _0x2371ed={'count':0x0,'rows':[]};return db[_0x49a9('0x38')][_0x49a9('0x62')]({'where':{'id':_0x2b840d[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x4be2f9,null))['then'](function(_0x2b2211){if(_0x2b2211){_0xe981f6[_0x49a9('0x3d')]=_[_0x49a9('0x3f')](db['SmsInteraction'][_0x49a9('0x39')]);_0xe981f6[_0x49a9('0x3e')]=_['keys'](_0x2b840d['query']);_0xe981f6[_0x49a9('0x40')]=_[_0x49a9('0x42')](_0xe981f6[_0x49a9('0x3d')],_0xe981f6[_0x49a9('0x3e')]);_0x5801cb['attributes']=_[_0x49a9('0x42')](_0xe981f6['model'],qs[_0x49a9('0x43')](_0x2b840d[_0x49a9('0x3e')][_0x49a9('0x43')]));_0x5801cb[_0x49a9('0x41')]=_0x5801cb['attributes']['length']?_0x5801cb['attributes']:_0xe981f6[_0x49a9('0x3d')];if(!_0x2b840d[_0x49a9('0x3e')][_0x49a9('0x45')](_0x49a9('0x63'))){_0x5801cb[_0x49a9('0x46')]=qs[_0x49a9('0x46')](_0x2b840d['query'][_0x49a9('0x46')]);_0x5801cb['offset']=qs['offset'](_0x2b840d[_0x49a9('0x3e')]['offset']);}_0x5801cb[_0x49a9('0x68')]=qs[_0x49a9('0x47')](_0x2b840d[_0x49a9('0x3e')]['sort']);_0x5801cb[_0x49a9('0x4a')]=qs[_0x49a9('0x40')](_['pick'](_0x2b840d[_0x49a9('0x3e')],_0xe981f6['filters']));_0x5801cb[_0x49a9('0x4a')][_0x49a9('0x60')]=_0x2b2211['id'];if(_0x2b840d[_0x49a9('0x3e')][_0x49a9('0x49')]){_0x5801cb[_0x49a9('0x4a')]=_[_0x49a9('0x4b')](_0x5801cb[_0x49a9('0x4a')],{'$or':_[_0x49a9('0x37')](_0x5801cb[_0x49a9('0x41')],function(_0x532114){var _0x42c1e6={};_0x42c1e6[_0x532114]={'$like':'%'+_0x2b840d[_0x49a9('0x3e')][_0x49a9('0x49')]+'%'};return _0x42c1e6;})});}_0x5801cb=_[_0x49a9('0x4b')]({},_0x5801cb,_0x2b840d[_0x49a9('0x4d')]);return db[_0x49a9('0x9c')][_0x49a9('0x2b')]({'where':_0x5801cb[_0x49a9('0x4a')]})[_0x49a9('0x1b')](function(_0x4b6174){_0x2371ed[_0x49a9('0x2b')]=_0x4b6174;if(_0x2b840d[_0x49a9('0x3e')]['includeAll']){_0x5801cb['include']=[{'model':db[_0x49a9('0x73')],'as':_0x49a9('0xba'),'required':![]},{'model':db[_0x49a9('0xbb')],'as':_0x49a9('0xbc'),'attributes':[_0x49a9('0x33'),_0x49a9('0xbd'),_0x49a9('0xbe')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x49a9('0x33'),_0x49a9('0xbf')],'where':_0x2b840d[_0x49a9('0x3e')][_0x49a9('0xc0')]?{'id':_0x2b840d[_0x49a9('0x3e')][_0x49a9('0xc0')]}:undefined,'required':_0x2b840d[_0x49a9('0x3e')]['tag']?!![]:![]}];}return db[_0x49a9('0x9c')][_0x49a9('0x69')](_0x5801cb);})['then'](function(_0x11b279){_0x2371ed[_0x49a9('0x50')]=_0x11b279;return _0x2371ed;});}})[_0x49a9('0x1b')](respondWithFilteredResult(_0x4be2f9,_0x5801cb))[_0x49a9('0x25')](handleError(_0x4be2f9,null));};exports['send']=function(_0x1067f5,_0x411bdb,_0x313146){var _0x5eb8d5,_0x3e4acd,_0x57fe57;if(_['isNil'](_0x1067f5[_0x49a9('0x55')][_0x49a9('0x55')])||_0x1067f5[_0x49a9('0x55')][_0x49a9('0x55')]===''){throw new db[(_0x49a9('0x74'))][(_0x49a9('0x75'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x49a9('0x92')](_0x1067f5[_0x49a9('0x55')]['to'])){throw new db[(_0x49a9('0x74'))][(_0x49a9('0x75'))](_0x49a9('0xc1'));}_0x5eb8d5=_0x1067f5['body']['to'];return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x1067f5[_0x49a9('0x52')]['id']},'include':[{'model':db[_0x49a9('0xc2')],'as':_0x49a9('0xc3'),'include':[{'model':db[_0x49a9('0x73')],'as':_0x49a9('0x97'),'where':{'mobile':_0x5eb8d5},'limit':0x1,'order':[[_0x49a9('0x79'),_0x49a9('0x98')]]}]}]})[_0x49a9('0x1b')](handleEntityNotFound(_0x411bdb,null))[_0x49a9('0x1b')](function(_0x35e61d){if(_0x35e61d&&_0x35e61d[_0x49a9('0xc3')]){_0x3e4acd=_0x35e61d[_0x49a9('0x30')]({'plain':!![]});if(_0x3e4acd['List']&&_0x3e4acd[_0x49a9('0xc3')][_0x49a9('0x97')][_0x49a9('0x44')]){return _0x3e4acd['List'][_0x49a9('0x97')][0x0];}return db[_0x49a9('0x73')]['create'](_[_0x49a9('0x13')](_0x1067f5[_0x49a9('0x55')],{'firstName':_0x5eb8d5,'mobile':_0x5eb8d5,'phone':_0x5eb8d5,'ListId':_0x3e4acd['ListId']}));}})[_0x49a9('0x1b')](handleEntityNotFound(_0x411bdb,null))['then'](function(_0x44f61b){if(_0x44f61b){_0x57fe57=_0x44f61b;return db[_0x49a9('0x9c')][_0x49a9('0x59')]({'where':{'ContactId':_0x57fe57['id'],'closed':![],'SmsAccountId':_0x3e4acd['id']}})[_0x49a9('0x1b')](function(_0x4111b8){if(_0x4111b8){return[_0x4111b8,![]];}return db[_0x49a9('0x9c')][_0x49a9('0x54')]({'UserId':_0x1067f5[_0x49a9('0xc4')]['id'],'ContactId':_0x57fe57['id'],'SmsAccountId':_0x3e4acd['id'],'phone':_0x5eb8d5,'firstMsgDirection':_0x49a9('0xc5'),'Messages':[_[_0x49a9('0x4b')](_0x1067f5[_0x49a9('0x55')],{'read':![],'body':_0x1067f5[_0x49a9('0x55')][_0x49a9('0x55')],'phone':_0x5eb8d5,'SmsAccountId':_0x3e4acd['id'],'UserId':_0x1067f5[_0x49a9('0xc4')]['id'],'ContactId':_0x57fe57['id']})]},{'include':[{'model':db[_0x49a9('0xa5')],'as':'Messages'}]})[_0x49a9('0x1b')](function(_0x28a5f5){return[_0x28a5f5,!![]];});});}})[_0x49a9('0x9d')](function(_0x4116b4,_0x3c9b09){if(_0x3c9b09){return _0x4116b4;}return db[_0x49a9('0xa5')][_0x49a9('0x54')](_['merge'](_0x1067f5['body'],{'read':![],'body':_0x1067f5[_0x49a9('0x55')]['body'],'phone':_0x5eb8d5,'SmsAccountId':_0x3e4acd['id'],'SmsInteractionId':_0x4116b4['id'],'UserId':_0x1067f5['user']['id'],'ContactId':_0x57fe57['id']}))[_0x49a9('0x1b')](function(_0x38e820){_0x4116b4[_0x49a9('0xc6')][_0x49a9('0xc7')]=[];_0x4116b4[_0x49a9('0xc6')][_0x49a9('0xc7')][_0x49a9('0xc8')](_0x38e820['dataValues']);return _0x4116b4;});})[_0x49a9('0x1b')](respondWithResult(_0x411bdb,null))[_0x49a9('0x25')](handleError(_0x411bdb,null));};exports[_0x49a9('0x27')]=function(_0x36078a,_0x5fd7e2,_0x1bc851){if(_0x36078a[_0x49a9('0x55')]['id']){delete _0x36078a[_0x49a9('0x55')]['id'];}var _0x3335b7,_0x15e3ff,_0x2f6579;return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x36078a[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x5fd7e2,null))[_0x49a9('0x1b')](function(_0xecfc46){if(_0xecfc46){_0x2f6579=_0xecfc46;logger[_0x49a9('0x1d')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0xecfc46[_0x49a9('0x3b')],util['inspect'](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));switch(_0xecfc46['type']){case _0x49a9('0x81'):if(_0x36078a[_0x49a9('0x55')][_0x49a9('0xc9')]&&_0x36078a['body'][_0x49a9('0x27')]){_0x15e3ff=_0x36078a['body'][_0x49a9('0x27')];return db['SmsMessage'][_0x49a9('0x59')]({'where':{'messageId':_0x36078a[_0x49a9('0x55')][_0x49a9('0xc9')]}});}break;case'connectel':if(_0x36078a[_0x49a9('0x55')][_0x49a9('0xca')]&&_0x36078a[_0x49a9('0x55')][_0x49a9('0xcb')]){_0x15e3ff=_0x36078a['body'][_0x49a9('0xcb')];return db[_0x49a9('0xa5')]['find']({'where':{'messageId':_0x36078a[_0x49a9('0x55')][_0x49a9('0xca')]}});}break;case _0x49a9('0x83'):if(_0x36078a[_0x49a9('0x55')][_0x49a9('0x84')]&&_0x36078a[_0x49a9('0x55')][_0x49a9('0xcc')]){_0x15e3ff=_0x36078a['body'][_0x49a9('0xcc')];return db[_0x49a9('0xa5')]['find']({'where':{'messageId':_0x36078a[_0x49a9('0x55')][_0x49a9('0x84')]}});}break;case _0x49a9('0x87'):var _0x3906a1=_0x36078a['body'][_0x49a9('0x88')][0x0];if(_0x3906a1[_0x49a9('0x7f')]&&_0x3906a1[_0x49a9('0x27')][_0x49a9('0xcd')]===_0x49a9('0xce')){_0x15e3ff=_0x3906a1[_0x49a9('0x27')][_0x49a9('0xcd')];return db[_0x49a9('0xa5')][_0x49a9('0x59')]({'where':{'messageId':_0x3906a1[_0x49a9('0x7f')]}});}break;case'clickatell':if(_0x36078a[_0x49a9('0x55')][_0x49a9('0x7f')]&&_0x36078a[_0x49a9('0x55')][_0x49a9('0x27')]){_0x15e3ff=_0x36078a[_0x49a9('0x55')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x36078a[_0x49a9('0x55')][_0x49a9('0x7f')]}});}break;case _0x49a9('0x8f'):if(_0x36078a[_0x49a9('0x55')][0x0][_0x49a9('0x22')]['id']){_0x15e3ff=_0x36078a[_0x49a9('0x55')][0x0][_0x49a9('0x3b')];return db[_0x49a9('0xa5')]['find']({'where':{'messageId':_0x36078a[_0x49a9('0x55')][0x0][_0x49a9('0x22')]['id']}});}break;case _0x49a9('0x90'):if(_0x36078a[_0x49a9('0x55')][_0x49a9('0xcf')]&&_0x36078a[_0x49a9('0x55')][_0x49a9('0x27')]){_0x15e3ff=_0x36078a['body'][_0x49a9('0x27')];return db[_0x49a9('0xa5')][_0x49a9('0x59')]({'where':{'messageId':_0x36078a[_0x49a9('0x55')][_0x49a9('0xcf')]}});}break;}}})[_0x49a9('0x1b')](handleEntityNotFound(_0x5fd7e2,null))['then'](function(_0x5d24a2){if(_0x5d24a2){_0x3335b7=_0x5d24a2;switch(_0x2f6579['type']){case _0x49a9('0x81'):if(_0x15e3ff===_0x49a9('0xce')){return _0x3335b7[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')](_0x49a9('0x1e'),'status',_0x49a9('0x81'),util[_0x49a9('0xd0')](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49a9('0xd1'):if(_0x15e3ff==='1'){return _0x3335b7[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')](_0x49a9('0x1e'),_0x49a9('0x27'),_0x49a9('0x81'),util['inspect'](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49a9('0x83'):if(!_0x36078a[_0x49a9('0x55')][_0x49a9('0xd2')]&&_0x15e3ff>=0xc8&&_0x15e3ff<=0xce){return _0x3335b7['update']({'read':!![]});}else{logger[_0x49a9('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util['inspect'](_0x36078a['body'],{'showHidden':![],'depth':null}));}break;case _0x49a9('0x87'):var _0x564b54=_0x36078a[_0x49a9('0x55')][_0x49a9('0x88')][0x0];if(_0x564b54[_0x49a9('0x27')][_0x49a9('0xcd')]===_0x49a9('0xce')){return _0x3335b7[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x49a9('0xd0')](_0x36078a['body'],{'showHidden':![],'depth':null}));}break;case _0x49a9('0x8c'):if(_0x15e3ff==_0x49a9('0xd3')||_0x15e3ff=='RECEIVED_BY_RECIPIENT'){return _0x3335b7[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')](_0x49a9('0x1e'),_0x49a9('0x27'),_0x49a9('0x8c'),util['inspect'](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));}break;case _0x49a9('0x8f'):if(_0x15e3ff=='message-delivered'){return _0x3335b7['update']({'read':!![]});}else{logger[_0x49a9('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x49a9('0x8f'),util[_0x49a9('0xd0')](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x15e3ff===_0x49a9('0xd4')||_0x15e3ff===_0x49a9('0xd5')){return _0x3335b7[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')](_0x49a9('0x1e'),'status',_0x49a9('0x90'),util[_0x49a9('0xd0')](_0x36078a[_0x49a9('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x3335b7;}})[_0x49a9('0x1b')](respondWithResult(_0x5fd7e2,null))[_0x49a9('0x25')](handleError(_0x5fd7e2,null));};exports[_0x49a9('0xd6')]=function(_0x8e7c00,_0x3a694b,_0x54bbf1){var _0xd9749,_0x3a1903,_0x775668;return db[_0x49a9('0x38')]['find']({'where':{'id':_0x8e7c00[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x3a694b,null))[_0x49a9('0x1b')](function(_0xb3ba0c){if(_0xb3ba0c){_0x775668=_0xb3ba0c;logger[_0x49a9('0x1d')](_0x49a9('0x1e'),_0x49a9('0x27'),_0x49a9('0xd7'),_0xb3ba0c[_0x49a9('0x3b')],util[_0x49a9('0xd0')](_0x8e7c00[_0x49a9('0x3e')],{'showHidden':![],'depth':null}));switch(_0xb3ba0c[_0x49a9('0x3b')]){case'csc':if(_0x8e7c00[_0x49a9('0x3e')][_0x49a9('0xd8')]&&_0x8e7c00[_0x49a9('0x3e')]['state']){_0x3a1903=_0x8e7c00[_0x49a9('0x3e')][_0x49a9('0xd9')];return db['SmsMessage'][_0x49a9('0x59')]({'where':{'messageId':_0x8e7c00[_0x49a9('0x3e')][_0x49a9('0xd8')]}});}break;}}})[_0x49a9('0x1b')](handleEntityNotFound(_0x3a694b,null))['then'](function(_0x2c83d4){if(_0x2c83d4){_0xd9749=_0x2c83d4;switch(_0x775668['type']){case _0x49a9('0x8a'):if(_0x3a1903==='2'||_0x3a1903==='6'){return _0xd9749[_0x49a9('0x5d')]({'read':!![]});}else{logger[_0x49a9('0x20')](_0x49a9('0x1e'),_0x49a9('0x27'),_0x49a9('0x8a'),util[_0x49a9('0xd0')](_0x8e7c00[_0x49a9('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0xd9749;}})[_0x49a9('0x1b')](respondWithResult(_0x3a694b,null))[_0x49a9('0x25')](handleError(_0x3a694b,null));};exports[_0x49a9('0xda')]=function(_0x199a52,_0x5f0419,_0x588a2d){return db['SmsAccount']['find']({'where':{'id':_0x199a52[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x5f0419,null))[_0x49a9('0x1b')](function(_0xeac922){if(_0xeac922){return _0xeac922[_0x49a9('0xda')](_0x199a52['body']['ids'],_[_0x49a9('0x9a')](_0x199a52[_0x49a9('0x55')],[_0x49a9('0x65'),'id'])||{})[_0x49a9('0x9d')](function(_0x41a9f6){for(var _0x2a7e6f=0x0;_0x2a7e6f<_0x199a52[_0x49a9('0x55')][_0x49a9('0x65')]['length'];_0x2a7e6f+=0x1){socket[_0x49a9('0xdb')](_0x49a9('0xdc'),{'UserId':Number(_0x199a52[_0x49a9('0x55')]['ids'][_0x2a7e6f]),'SmsAccountId':Number(_0x199a52[_0x49a9('0x52')]['id'])});}return _0x41a9f6;});}})[_0x49a9('0x1b')](respondWithResult(_0x5f0419,null))[_0x49a9('0x25')](handleError(_0x5f0419,null));};exports['removeAgents']=function(_0x4ed986,_0x5c4194,_0x115ea0){return db[_0x49a9('0x38')][_0x49a9('0x59')]({'where':{'id':_0x4ed986['params']['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x5c4194,null))['then'](function(_0x3e5d09){if(_0x3e5d09){return _0x3e5d09[_0x49a9('0xdd')](_0x4ed986[_0x49a9('0x3e')][_0x49a9('0x65')])['then'](function(){if(_['isArray'](_0x4ed986['query']['ids'])){for(var _0x3ae103=0x0;_0x3ae103<_0x4ed986['query'][_0x49a9('0x65')]['length'];_0x3ae103+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x4ed986[_0x49a9('0x3e')]['ids'][_0x3ae103]),'SmsAccountId':Number(_0x4ed986[_0x49a9('0x52')]['id'])});}}else{socket[_0x49a9('0xdb')](_0x49a9('0xde'),{'UserId':Number(_0x4ed986[_0x49a9('0x3e')][_0x49a9('0x65')]),'SmsAccountId':Number(_0x4ed986['params']['id'])});}});}})[_0x49a9('0x1b')](respondWithStatusCode(_0x5c4194,null))[_0x49a9('0x25')](handleError(_0x5c4194,null));};exports[_0x49a9('0xdf')]=function(_0x410075,_0x1b0bd6,_0x417eee){var _0x3a7f87={};var _0x151a7a={};var _0xd7a69a;var _0x3f1d95;return db[_0x49a9('0x38')][_0x49a9('0x62')]({'where':{'id':_0x410075[_0x49a9('0x52')]['id']}})[_0x49a9('0x1b')](handleEntityNotFound(_0x1b0bd6,null))['then'](function(_0x26f415){if(_0x26f415){_0xd7a69a=_0x26f415;_0x151a7a[_0x49a9('0x3d')]=_[_0x49a9('0x3f')](db[_0x49a9('0xbb')][_0x49a9('0x39')]);_0x151a7a[_0x49a9('0x3e')]=_[_0x49a9('0x3f')](_0x410075['query']);_0x151a7a[_0x49a9('0x40')]=_[_0x49a9('0x42')](_0x151a7a[_0x49a9('0x3d')],_0x151a7a['query']);_0x3a7f87[_0x49a9('0x41')]=_[_0x49a9('0x42')](_0x151a7a[_0x49a9('0x3d')],qs[_0x49a9('0x43')](_0x410075[_0x49a9('0x3e')][_0x49a9('0x43')]));_0x3a7f87[_0x49a9('0x41')]=_0x3a7f87[_0x49a9('0x41')]['length']?_0x3a7f87[_0x49a9('0x41')]:_0x151a7a['model'];_0x3a7f87[_0x49a9('0x68')]=qs[_0x49a9('0x47')](_0x410075[_0x49a9('0x3e')][_0x49a9('0x47')]);_0x3a7f87[_0x49a9('0x4a')]=qs[_0x49a9('0x40')](_[_0x49a9('0x48')](_0x410075[_0x49a9('0x3e')],_0x151a7a[_0x49a9('0x40')]));if(_0x410075[_0x49a9('0x3e')]['filter']){_0x3a7f87[_0x49a9('0x4a')]=_[_0x49a9('0x4b')](_0x3a7f87[_0x49a9('0x4a')],{'$or':_[_0x49a9('0x37')](_0x3a7f87['attributes'],function(_0x5c79dd){var _0x264816={};_0x264816[_0x5c79dd]={'$like':'%'+_0x410075[_0x49a9('0x3e')]['filter']+'%'};return _0x264816;})});}_0x3a7f87=_[_0x49a9('0x4b')]({},_0x3a7f87,_0x410075['options']);return _0xd7a69a[_0x49a9('0xdf')](_0x3a7f87);}})['then'](function(_0x35fd5f){if(_0x35fd5f){_0x3f1d95=_0x35fd5f[_0x49a9('0x44')];if(!_0x410075[_0x49a9('0x3e')][_0x49a9('0x45')](_0x49a9('0x63'))){_0x3a7f87['limit']=qs[_0x49a9('0x46')](_0x410075[_0x49a9('0x3e')]['limit']);_0x3a7f87['offset']=qs['offset'](_0x410075[_0x49a9('0x3e')][_0x49a9('0x29')]);}return _0xd7a69a[_0x49a9('0xdf')](_0x3a7f87);}})[_0x49a9('0x1b')](function(_0x5193e1){if(_0x5193e1){return _0x5193e1?{'count':_0x3f1d95,'rows':_0x5193e1}:null;}})['then'](respondWithResult(_0x1b0bd6,null))[_0x49a9('0x25')](handleError(_0x1b0bd6,null));}; \ No newline at end of file +var _0x5c45=['to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','clicksend','message_id','status_code','groupName','DELIVERED','intelepeer','redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','jayson/promise','client','http','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','include','findAll','rows','show','params','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','sms','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','Body','MessageSid','skebby','from','sender','text','connectel','messageId','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','entity\x20found','twilio','Content-Type','text/xml','addApplications','transaction','SmsApplication','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag'];(function(_0x1d76bd,_0x43afc6){var _0x583451=function(_0xe504d2){while(--_0xe504d2){_0x1d76bd['push'](_0x1d76bd['shift']());}};_0x583451(++_0x43afc6);}(_0x5c45,0x1de));var _0x55c4=function(_0x5b3bee,_0x59d77e){_0x5b3bee=_0x5b3bee-0x0;var _0x4b5239=_0x5c45[_0x5b3bee];return _0x4b5239;};'use strict';var emlformat=require(_0x55c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x55c4('0x2'));var BPromise=require(_0x55c4('0x3'));var Mustache=require(_0x55c4('0x4'));var util=require(_0x55c4('0x5'));var path=require('path');var sox=require(_0x55c4('0x6'));var csv=require(_0x55c4('0x7'));var ejs=require(_0x55c4('0x8'));var fs=require('fs');var fs_extra=require(_0x55c4('0x9'));var _=require(_0x55c4('0xa'));var squel=require(_0x55c4('0xb'));var crypto=require(_0x55c4('0xc'));var jsforce=require(_0x55c4('0xd'));var deskjs=require(_0x55c4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x55c4('0xf'));var Papa=require(_0x55c4('0x10'));var Redis=require(_0x55c4('0x11'));var authService=require(_0x55c4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x55c4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55c4('0x14'))('api');var utils=require(_0x55c4('0x15'));var config=require(_0x55c4('0x16'));var licenseUtil=require(_0x55c4('0x17'));var db=require(_0x55c4('0x18'))['db'];config['redis']=_['defaults'](config[_0x55c4('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x55c4('0x1a'))(new Redis(config[_0x55c4('0x19')]));require(_0x55c4('0x1b'))['register'](socket);var jayson=require(_0x55c4('0x1c'));var client=jayson[_0x55c4('0x1d')][_0x55c4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x34cbc4,_0x110c13,_0x56a5fe,_0x5135a5){return new BPromise(function(_0x3eb23d,_0xe6664c){var _0x7b6dcd=_0x5135a5||client;return _0x7b6dcd[_0x55c4('0x1f')](_0x34cbc4,_0x56a5fe)[_0x55c4('0x20')](function(_0x12939d){logger['info']('SmsAccount,\x20%s,\x20%s',_0x110c13,_0x55c4('0x21'));logger[_0x55c4('0x22')](_0x55c4('0x23'),_0x110c13,_0x55c4('0x21'),JSON[_0x55c4('0x24')](_0x12939d));if(_0x12939d[_0x55c4('0x25')]){if(_0x12939d[_0x55c4('0x25')][_0x55c4('0x26')]===0x1f4){logger[_0x55c4('0x25')](_0x55c4('0x27'),_0x110c13,_0x12939d[_0x55c4('0x25')][_0x55c4('0x28')]);return _0xe6664c(_0x12939d['error'][_0x55c4('0x28')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x110c13,_0x12939d[_0x55c4('0x25')][_0x55c4('0x28')]);return _0x3eb23d(_0x12939d[_0x55c4('0x25')]['message']);}else{logger[_0x55c4('0x29')](_0x55c4('0x27'),_0x110c13,_0x55c4('0x21'));_0x3eb23d(_0x12939d['result'][_0x55c4('0x28')]);}})[_0x55c4('0x2a')](function(_0x389ebc){logger[_0x55c4('0x25')](_0x55c4('0x27'),_0x110c13,_0x389ebc);_0xe6664c(_0x389ebc);});});}function respondWithStatusCode(_0x2d4c48,_0x1efeea){_0x1efeea=_0x1efeea||0xcc;return function(_0x3fa975){if(_0x3fa975){return _0x2d4c48[_0x55c4('0x2b')](_0x1efeea);}return _0x2d4c48['status'](_0x1efeea)['end']();};}function respondWithResult(_0x2f4c91,_0x492e0a){_0x492e0a=_0x492e0a||0xc8;return function(_0xd53b16){if(_0xd53b16){return _0x2f4c91[_0x55c4('0x2c')](_0x492e0a)[_0x55c4('0x2d')](_0xd53b16);}};}function respondWithFilteredResult(_0x344b29,_0x23eac3){return function(_0x12838f){if(_0x12838f){var _0x103924=typeof _0x23eac3[_0x55c4('0x2e')]===_0x55c4('0x2f')&&typeof _0x23eac3[_0x55c4('0x30')]===_0x55c4('0x2f');var _0x1856e5=_0x12838f['count'];var _0x5989bd=_0x103924?0x0:_0x23eac3['offset'];var _0x1b849c=_0x103924?_0x12838f[_0x55c4('0x31')]:_0x23eac3[_0x55c4('0x2e')]+_0x23eac3['limit'];var _0x577f54;if(_0x1b849c>=_0x1856e5){_0x1b849c=_0x1856e5;_0x577f54=0xc8;}else{_0x577f54=0xce;}_0x344b29['status'](_0x577f54);return _0x344b29['set'](_0x55c4('0x32'),_0x5989bd+'-'+_0x1b849c+'/'+_0x1856e5)['json'](_0x12838f);}return null;};}function patchUpdates(_0xa69966){return function(_0x47a0cb){try{jsonpatch[_0x55c4('0x33')](_0x47a0cb,_0xa69966,!![]);}catch(_0x596a91){return BPromise[_0x55c4('0x34')](_0x596a91);}return _0x47a0cb[_0x55c4('0x35')]();};}function saveUpdates(_0x347330,_0x4923ce){return function(_0x39eaba){if(_0x39eaba){return _0x39eaba[_0x55c4('0x36')](_0x347330)[_0x55c4('0x20')](function(_0x448111){return _0x448111;});}return null;};}function removeEntity(_0x9f3b59,_0x307e1f){return function(_0x18236d){if(_0x18236d){return _0x18236d[_0x55c4('0x37')]()['then'](function(){var _0x4806ed=_0x18236d[_0x55c4('0x38')]({'plain':!![]});var _0x5422f4=_0x55c4('0x39');return db[_0x55c4('0x3a')][_0x55c4('0x37')]({'where':{'type':_0x5422f4,'resourceId':_0x4806ed['id']}})[_0x55c4('0x20')](function(){return _0x18236d;});})[_0x55c4('0x20')](function(){_0x9f3b59[_0x55c4('0x2c')](0xcc)[_0x55c4('0x3b')]();});}};}function handleEntityNotFound(_0x5d75f1,_0xfe1c16){return function(_0x404c09){if(!_0x404c09){_0x5d75f1[_0x55c4('0x2b')](0x194);}return _0x404c09;};}function handleError(_0x1f0ddb,_0x401f10){_0x401f10=_0x401f10||0x1f4;return function(_0x379316){logger['error'](_0x379316['stack']);if(_0x379316[_0x55c4('0x3c')]){delete _0x379316['name'];}_0x1f0ddb[_0x55c4('0x2c')](_0x401f10)[_0x55c4('0x3d')](_0x379316);};}exports[_0x55c4('0x3e')]=function(_0x4b04ca,_0x12766){var _0x57dd85={'include':[{'model':db[_0x55c4('0x3f')],'as':_0x55c4('0x40')}]},_0x38c7c4={},_0x317a74={'count':0x0,'rows':[]};var _0x5918e1=_[_0x55c4('0x41')](db[_0x55c4('0x42')][_0x55c4('0x43')],function(_0x5b032d){return{'name':_0x5b032d[_0x55c4('0x44')],'type':_0x5b032d[_0x55c4('0x45')][_0x55c4('0x46')]};});_0x38c7c4['model']=_[_0x55c4('0x41')](_0x5918e1,_0x55c4('0x3c'));_0x38c7c4['query']=_[_0x55c4('0x47')](_0x4b04ca['query']);_0x38c7c4[_0x55c4('0x48')]=_[_0x55c4('0x49')](_0x38c7c4['model'],_0x38c7c4[_0x55c4('0x4a')]);_0x57dd85[_0x55c4('0x4b')]=_[_0x55c4('0x49')](_0x38c7c4[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x4b04ca[_0x55c4('0x4a')]['fields']));_0x57dd85[_0x55c4('0x4b')]=_0x57dd85[_0x55c4('0x4b')][_0x55c4('0x4e')]?_0x57dd85[_0x55c4('0x4b')]:_0x38c7c4[_0x55c4('0x4c')];if(!_0x4b04ca[_0x55c4('0x4a')][_0x55c4('0x4f')]('nolimit')){_0x57dd85[_0x55c4('0x30')]=qs['limit'](_0x4b04ca[_0x55c4('0x4a')][_0x55c4('0x30')]);_0x57dd85[_0x55c4('0x2e')]=qs[_0x55c4('0x2e')](_0x4b04ca['query'][_0x55c4('0x2e')]);}_0x57dd85[_0x55c4('0x50')]=qs[_0x55c4('0x51')](_0x4b04ca[_0x55c4('0x4a')]['sort']);_0x57dd85[_0x55c4('0x52')]=qs[_0x55c4('0x48')](_[_0x55c4('0x53')](_0x4b04ca[_0x55c4('0x4a')],_0x38c7c4[_0x55c4('0x48')]),_0x5918e1);if(_0x4b04ca[_0x55c4('0x4a')][_0x55c4('0x54')]){_0x57dd85[_0x55c4('0x52')]=_['merge'](_0x57dd85[_0x55c4('0x52')],{'$or':_[_0x55c4('0x41')](_0x5918e1,function(_0x3b078f){if(_0x3b078f[_0x55c4('0x45')]!=='VIRTUAL'){var _0x231898={};_0x231898[_0x3b078f[_0x55c4('0x3c')]]={'$like':'%'+_0x4b04ca[_0x55c4('0x4a')]['filter']+'%'};return _0x231898;}})});}_0x57dd85=_['merge']({},_0x57dd85,_0x4b04ca['options']);var _0x569562={'where':_0x57dd85[_0x55c4('0x52')]};return db['SmsAccount'][_0x55c4('0x31')](_0x569562)[_0x55c4('0x20')](function(_0x18afaf){_0x317a74['count']=_0x18afaf;if(_0x4b04ca['query']['includeAll']){_0x57dd85[_0x55c4('0x55')]=[{'all':!![]}];}return db['SmsAccount'][_0x55c4('0x56')](_0x57dd85);})[_0x55c4('0x20')](function(_0x586f1d){_0x317a74[_0x55c4('0x57')]=_0x586f1d;return _0x317a74;})[_0x55c4('0x20')](respondWithFilteredResult(_0x12766,_0x57dd85))['catch'](handleError(_0x12766,null));};exports[_0x55c4('0x58')]=function(_0x12e2f0,_0x13917a){var _0x134066={'raw':![],'where':{'id':_0x12e2f0[_0x55c4('0x59')]['id']},'include':[{'model':db[_0x55c4('0x3f')],'as':_0x55c4('0x40')}]},_0x7471b3={};_0x7471b3[_0x55c4('0x4c')]=_[_0x55c4('0x47')](db[_0x55c4('0x42')][_0x55c4('0x43')]);_0x7471b3[_0x55c4('0x4a')]=_[_0x55c4('0x47')](_0x12e2f0['query']);_0x7471b3[_0x55c4('0x48')]=_[_0x55c4('0x49')](_0x7471b3[_0x55c4('0x4c')],_0x7471b3['query']);_0x134066[_0x55c4('0x4b')]=_[_0x55c4('0x49')](_0x7471b3[_0x55c4('0x4c')],qs['fields'](_0x12e2f0[_0x55c4('0x4a')][_0x55c4('0x4d')]));_0x134066[_0x55c4('0x4b')]=_0x134066[_0x55c4('0x4b')][_0x55c4('0x4e')]?_0x134066[_0x55c4('0x4b')]:_0x7471b3[_0x55c4('0x4c')];if(_0x12e2f0[_0x55c4('0x4a')]['includeAll']){_0x134066[_0x55c4('0x55')]=[{'all':!![]}];}_0x134066=_[_0x55c4('0x5a')]({},_0x134066,_0x12e2f0[_0x55c4('0x5b')]);return db[_0x55c4('0x42')][_0x55c4('0x5c')](_0x134066)[_0x55c4('0x20')](handleEntityNotFound(_0x13917a,null))['then'](respondWithResult(_0x13917a,null))[_0x55c4('0x2a')](handleError(_0x13917a,null));};exports[_0x55c4('0x5d')]=function(_0xf9559d,_0x545aca){return db['SmsAccount'][_0x55c4('0x5d')](_0xf9559d[_0x55c4('0x5e')],{})[_0x55c4('0x20')](function(_0x58b7fc){var _0x444aee=_0xf9559d[_0x55c4('0x5f')]['get']({'plain':!![]});if(!_0x444aee)throw new Error(_0x55c4('0x60'));if(_0x444aee[_0x55c4('0x61')]===_0x55c4('0x5f')){var _0x4109e3=_0x58b7fc[_0x55c4('0x38')]({'plain':!![]});var _0x229537=_0x55c4('0x39');return db[_0x55c4('0x62')]['find']({'where':{'name':_0x229537,'userProfileId':_0x444aee['userProfileId']},'raw':!![]})[_0x55c4('0x20')](function(_0x4488b9){if(_0x4488b9&&_0x4488b9[_0x55c4('0x63')]===0x0){return db['UserProfileResource'][_0x55c4('0x5d')]({'name':_0x4109e3[_0x55c4('0x3c')],'resourceId':_0x4109e3['id'],'type':_0x4488b9[_0x55c4('0x3c')],'sectionId':_0x4488b9['id']},{})[_0x55c4('0x20')](function(){return _0x58b7fc;});}else{return _0x58b7fc;}})['catch'](function(_0x49365f){logger[_0x55c4('0x25')](_0x55c4('0x64'),_0x49365f);throw _0x49365f;});}return _0x58b7fc;})['then'](respondWithResult(_0x545aca,0xc9))[_0x55c4('0x2a')](handleError(_0x545aca,null));};exports[_0x55c4('0x36')]=function(_0x5c9f90,_0x47c885){if(_0x5c9f90[_0x55c4('0x5e')]['id']){delete _0x5c9f90[_0x55c4('0x5e')]['id'];}return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x5c9f90[_0x55c4('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x55c4('0x40')}]})[_0x55c4('0x20')](handleEntityNotFound(_0x47c885,null))['then'](saveUpdates(_0x5c9f90[_0x55c4('0x5e')],null))[_0x55c4('0x20')](respondWithResult(_0x47c885,null))[_0x55c4('0x2a')](handleError(_0x47c885,null));};exports[_0x55c4('0x37')]=function(_0x516513,_0x1e8299){return db['SmsAccount']['find']({'where':{'id':_0x516513['params']['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x1e8299,null))[_0x55c4('0x20')](removeEntity(_0x1e8299,null))[_0x55c4('0x2a')](handleError(_0x1e8299,null));};exports[_0x55c4('0x65')]=function(_0x4d7a91,_0x1a638a){return db[_0x55c4('0x42')]['describe']()[_0x55c4('0x20')](respondWithResult(_0x1a638a,null))[_0x55c4('0x2a')](handleError(_0x1a638a,null));};exports[_0x55c4('0x66')]=function(_0x33f26e,_0x1145cb,_0x572bb3){if(_0x33f26e[_0x55c4('0x5e')]['id']){delete _0x33f26e[_0x55c4('0x5e')]['id'];}return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x33f26e[_0x55c4('0x59')]['id']}})['then'](handleEntityNotFound(_0x1145cb,null))[_0x55c4('0x20')](function(_0x268e95){if(_0x268e95){_0x33f26e[_0x55c4('0x5e')][_0x55c4('0x67')]=_0x268e95['id'];return db[_0x55c4('0x68')]['create'](_0x33f26e[_0x55c4('0x5e')]);}})[_0x55c4('0x20')](respondWithResult(_0x1145cb,null))['catch'](handleError(_0x1145cb,null));};exports['getDispositions']=function(_0x582b53,_0x1f8a05,_0x4c90a7){var _0x133bcf={'raw':![],'where':{}};var _0x11fa36={};var _0x2544f6={'count':0x0,'rows':[]};return db[_0x55c4('0x42')]['findOne']({'where':{'id':_0x582b53['params']['id']}})['then'](handleEntityNotFound(_0x1f8a05,null))[_0x55c4('0x20')](function(_0x4074a5){if(_0x4074a5){_0x11fa36['model']=_[_0x55c4('0x47')](db['Disposition'][_0x55c4('0x43')]);_0x11fa36['query']=_[_0x55c4('0x47')](_0x582b53[_0x55c4('0x4a')]);_0x11fa36['filters']=_[_0x55c4('0x49')](_0x11fa36[_0x55c4('0x4c')],_0x11fa36[_0x55c4('0x4a')]);_0x133bcf[_0x55c4('0x4b')]=_[_0x55c4('0x49')](_0x11fa36[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x582b53['query'][_0x55c4('0x4d')]));_0x133bcf[_0x55c4('0x4b')]=_0x133bcf['attributes'][_0x55c4('0x4e')]?_0x133bcf[_0x55c4('0x4b')]:_0x11fa36['model'];if(!_0x582b53[_0x55c4('0x4a')][_0x55c4('0x4f')]('nolimit')){_0x133bcf[_0x55c4('0x30')]=qs[_0x55c4('0x30')](_0x582b53[_0x55c4('0x4a')][_0x55c4('0x30')]);_0x133bcf[_0x55c4('0x2e')]=qs[_0x55c4('0x2e')](_0x582b53[_0x55c4('0x4a')][_0x55c4('0x2e')]);}_0x133bcf[_0x55c4('0x50')]=qs[_0x55c4('0x51')](_0x582b53[_0x55c4('0x4a')][_0x55c4('0x51')]);_0x133bcf[_0x55c4('0x52')]=qs[_0x55c4('0x48')](_[_0x55c4('0x53')](_0x582b53[_0x55c4('0x4a')],_0x11fa36[_0x55c4('0x48')]));_0x133bcf[_0x55c4('0x52')][_0x55c4('0x67')]=_0x4074a5['id'];if(_0x582b53[_0x55c4('0x4a')][_0x55c4('0x54')]){_0x133bcf[_0x55c4('0x52')]=_[_0x55c4('0x5a')](_0x133bcf['where'],{'$or':_[_0x55c4('0x41')](_0x133bcf['attributes'],function(_0x4d263d){var _0x1d15c1={};_0x1d15c1[_0x4d263d]={'$like':'%'+_0x582b53[_0x55c4('0x4a')][_0x55c4('0x54')]+'%'};return _0x1d15c1;})});}_0x133bcf=_[_0x55c4('0x5a')]({},_0x133bcf,_0x582b53[_0x55c4('0x5b')]);return db['Disposition'][_0x55c4('0x31')]({'where':_0x133bcf[_0x55c4('0x52')]})[_0x55c4('0x20')](function(_0x61cb61){_0x2544f6[_0x55c4('0x31')]=_0x61cb61;if(_0x582b53['query'][_0x55c4('0x69')]){_0x133bcf[_0x55c4('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x133bcf);})['then'](function(_0xb549){_0x2544f6[_0x55c4('0x57')]=_0xb549;return _0x2544f6;});}})[_0x55c4('0x20')](respondWithFilteredResult(_0x1f8a05,_0x133bcf))[_0x55c4('0x2a')](handleError(_0x1f8a05,null));};exports['removeDispositions']=function(_0x2b3a19,_0x13a7b5,_0x33bbb2){return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x2b3a19['params']['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x13a7b5,null))[_0x55c4('0x20')](function(_0x3f3b96){if(_0x3f3b96){return _0x3f3b96[_0x55c4('0x6a')](_0x2b3a19[_0x55c4('0x4a')][_0x55c4('0x6b')]);}})[_0x55c4('0x20')](respondWithStatusCode(_0x13a7b5,null))['catch'](handleError(_0x13a7b5,null));};exports['addAnswer']=function(_0xf44002,_0x5d1179,_0x1a37a9){if(_0xf44002[_0x55c4('0x5e')]['id']){delete _0xf44002[_0x55c4('0x5e')]['id'];}return db[_0x55c4('0x42')]['find']({'where':{'id':_0xf44002['params']['id']}})['then'](handleEntityNotFound(_0x5d1179,null))[_0x55c4('0x20')](function(_0x2b2b07){if(_0x2b2b07){_0xf44002[_0x55c4('0x5e')][_0x55c4('0x67')]=_0x2b2b07['id'];return db[_0x55c4('0x6c')][_0x55c4('0x5d')](_0xf44002[_0x55c4('0x5e')]);}})[_0x55c4('0x20')](respondWithResult(_0x5d1179,null))[_0x55c4('0x2a')](handleError(_0x5d1179,null));};exports[_0x55c4('0x6d')]=function(_0x2081a9,_0x4f8d31,_0x5ede52){var _0x47d46e={'raw':![],'where':{}};var _0x54edac={};var _0x1e557e={'count':0x0,'rows':[]};return db[_0x55c4('0x42')][_0x55c4('0x6e')]({'where':{'id':_0x2081a9[_0x55c4('0x59')]['id']}})['then'](handleEntityNotFound(_0x4f8d31,null))[_0x55c4('0x20')](function(_0x5da257){if(_0x5da257){_0x54edac[_0x55c4('0x4c')]=_[_0x55c4('0x47')](db['CannedAnswer'][_0x55c4('0x43')]);_0x54edac['query']=_[_0x55c4('0x47')](_0x2081a9[_0x55c4('0x4a')]);_0x54edac[_0x55c4('0x48')]=_['intersection'](_0x54edac[_0x55c4('0x4c')],_0x54edac[_0x55c4('0x4a')]);_0x47d46e['attributes']=_[_0x55c4('0x49')](_0x54edac[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x2081a9[_0x55c4('0x4a')][_0x55c4('0x4d')]));_0x47d46e[_0x55c4('0x4b')]=_0x47d46e['attributes'][_0x55c4('0x4e')]?_0x47d46e[_0x55c4('0x4b')]:_0x54edac[_0x55c4('0x4c')];if(!_0x2081a9[_0x55c4('0x4a')][_0x55c4('0x4f')](_0x55c4('0x6f'))){_0x47d46e[_0x55c4('0x30')]=qs[_0x55c4('0x30')](_0x2081a9[_0x55c4('0x4a')]['limit']);_0x47d46e['offset']=qs[_0x55c4('0x2e')](_0x2081a9[_0x55c4('0x4a')]['offset']);}_0x47d46e[_0x55c4('0x50')]=qs[_0x55c4('0x51')](_0x2081a9[_0x55c4('0x4a')][_0x55c4('0x51')]);_0x47d46e[_0x55c4('0x52')]=qs[_0x55c4('0x48')](_[_0x55c4('0x53')](_0x2081a9[_0x55c4('0x4a')],_0x54edac[_0x55c4('0x48')]));_0x47d46e[_0x55c4('0x52')][_0x55c4('0x67')]=_0x5da257['id'];if(_0x2081a9[_0x55c4('0x4a')][_0x55c4('0x54')]){_0x47d46e['where']=_['merge'](_0x47d46e[_0x55c4('0x52')],{'$or':_[_0x55c4('0x41')](_0x47d46e['attributes'],function(_0x2b5c84){var _0x267f6a={};_0x267f6a[_0x2b5c84]={'$like':'%'+_0x2081a9[_0x55c4('0x4a')][_0x55c4('0x54')]+'%'};return _0x267f6a;})});}_0x47d46e=_[_0x55c4('0x5a')]({},_0x47d46e,_0x2081a9['options']);return db[_0x55c4('0x6c')]['count']({'where':_0x47d46e[_0x55c4('0x52')]})[_0x55c4('0x20')](function(_0x2658dc){_0x1e557e[_0x55c4('0x31')]=_0x2658dc;if(_0x2081a9[_0x55c4('0x4a')]['includeAll']){_0x47d46e[_0x55c4('0x55')]=[{'all':!![]}];}return db[_0x55c4('0x6c')][_0x55c4('0x56')](_0x47d46e);})[_0x55c4('0x20')](function(_0x5f098e){_0x1e557e[_0x55c4('0x57')]=_0x5f098e;return _0x1e557e;});}})[_0x55c4('0x20')](respondWithFilteredResult(_0x4f8d31,_0x47d46e))['catch'](handleError(_0x4f8d31,null));};exports[_0x55c4('0x70')]=function(_0x1249b6,_0x4053df,_0x566a94){return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x1249b6[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x4053df,null))['then'](function(_0x44a477){if(_0x44a477){return _0x44a477[_0x55c4('0x70')](_0x1249b6['query'][_0x55c4('0x6b')]);}})[_0x55c4('0x20')](respondWithStatusCode(_0x4053df,null))[_0x55c4('0x2a')](handleError(_0x4053df,null));};exports['notify']=function(_0x2d7c5d,_0x55fb4d,_0x1c4de7){var _0x1263d6={'channel':_0x55c4('0x71')};var _0x4a93ad=[];var _0x20bb95=[];var _0x49a397={};return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x2d7c5d[_0x55c4('0x59')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x55c4('0x20')](handleEntityNotFound(_0x55fb4d,null))['then'](function(_0x24956c){_0x1263d6[_0x55c4('0x72')]=_0x24956c;_0x1263d6[_0x55c4('0x73')]=_[_0x55c4('0x74')](_0x24956c[_0x55c4('0x75')],[_0x55c4('0x76')],[_0x55c4('0x77')]);if(_0x1263d6[_0x55c4('0x72')][_0x55c4('0x75')]){delete _0x1263d6['account'][_0x55c4('0x75')];}return db[_0x55c4('0x78')][_0x55c4('0x65')]();})[_0x55c4('0x20')](function(_0x143bbe){if(!_0x143bbe){throw new db[(_0x55c4('0x79'))][(_0x55c4('0x7a'))](_0x55c4('0x7b'));}_0x4a93ad=_['difference'](_[_0x55c4('0x47')](_0x143bbe),[_0x55c4('0x7c'),'updatedAt']);_0x20bb95=_[_0x55c4('0x7d')](_['keys'](_0x143bbe),[_0x55c4('0x7c'),_0x55c4('0x7e'),_0x55c4('0x7f'),_0x55c4('0x80')]);_0x1263d6[_0x55c4('0x5e')]={'mapKey':_0x55c4('0x81')};if(_0x1263d6[_0x55c4('0x72')][_0x55c4('0x45')]){switch(_0x1263d6[_0x55c4('0x72')][_0x55c4('0x45')]){case'twilio':_0x1263d6['body']['from']=_0x2d7c5d['body']['From'];_0x1263d6['body'][_0x55c4('0x5e')]=_0x2d7c5d['body'][_0x55c4('0x82')];_0x1263d6['body']['messageId']=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x83')];break;case _0x55c4('0x84'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]='+'+_0x2d7c5d['body'][_0x55c4('0x86')];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x87')];break;case _0x55c4('0x88'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x85')];_0x1263d6['body'][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x28')];break;case'clicksend':_0x1263d6[_0x55c4('0x5e')]['from']=_0x2d7c5d['body'][_0x55c4('0x85')];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')]['body'];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x89')]=_0x2d7c5d[_0x55c4('0x5e')]['message_id'];break;case _0x55c4('0x8a'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x8b')];_0x1263d6['body'][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x8c')];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x89')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x8d')];break;case _0x55c4('0x8e'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]='+'+_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x8f')][0x0]['from'];_0x1263d6['body']['body']=_0x2d7c5d[_0x55c4('0x5e')]['results'][0x0][_0x55c4('0x87')];_0x1263d6[_0x55c4('0x5e')]['messageId']=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x8f')][0x0]['messageId'];break;case _0x55c4('0x90'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]=_0x2d7c5d['body'][_0x55c4('0x91')];_0x1263d6['body'][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x92')][_0x55c4('0x28')];break;case _0x55c4('0x93'):_0x1263d6['body'][_0x55c4('0x85')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x94')];_0x1263d6[_0x55c4('0x5e')]['body']=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x87')];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x89')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x95')];break;case _0x55c4('0x96'):_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x89')]=_0x2d7c5d[_0x55c4('0x5e')][0x0]['message']['id'];_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]=_0x2d7c5d['body'][0x0][_0x55c4('0x28')][_0x55c4('0x85')];_0x1263d6['body'][_0x55c4('0x5e')]=_0x2d7c5d[_0x55c4('0x5e')][0x0][_0x55c4('0x28')][_0x55c4('0x87')];break;case'intelepeer':_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')]=_0x2d7c5d[_0x55c4('0x5e')][_0x55c4('0x85')];_0x1263d6[_0x55c4('0x5e')]['body']=_0x2d7c5d[_0x55c4('0x5e')]['message'];_0x1263d6[_0x55c4('0x5e')]['messageId']=_0x2d7c5d['body'][_0x55c4('0x97')];break;}}if(_0x1263d6[_0x55c4('0x5e')]['id']){delete _0x1263d6[_0x55c4('0x5e')]['id'];}if(_['isNil'](_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')])){throw new db['Sequelize']['ValidationError'](_0x55c4('0x98'));}if(_[_0x55c4('0x99')](_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x5e')])||_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x5e')]===''){throw new db[(_0x55c4('0x79'))][(_0x55c4('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x55c4('0x99')](_0x1263d6['body'][_0x55c4('0x9a')])){throw new db['Sequelize'][(_0x55c4('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20bb95);}if(!_['includes'](_0x20bb95,_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x9a')])){throw new db['Sequelize'][(_0x55c4('0x7a'))](_0x55c4('0x9b')+_0x20bb95);}_0x49a397[_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x9a')]]=_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')];return db[_0x55c4('0x9c')][_0x55c4('0x5c')]({'where':{'id':_0x1263d6[_0x55c4('0x72')][_0x55c4('0x80')]},'include':[{'model':db[_0x55c4('0x78')],'as':_0x55c4('0x9d'),'where':_0x49a397,'limit':0x1,'order':[[_0x55c4('0x7e'),_0x55c4('0x9e')]]}]});})['then'](handleEntityNotFound(_0x55fb4d,null))[_0x55c4('0x20')](function(_0x28cef5){if(_0x28cef5){_0x1263d6[_0x55c4('0x9f')]=_[_0x55c4('0xa0')](_0x28cef5,[_0x55c4('0x9d')]);if(_0x28cef5[_0x55c4('0x9d')][_0x55c4('0x4e')]){return _0x28cef5[_0x55c4('0x9d')][0x0];}var _0x4d5b9c=_[_0x55c4('0xa1')](_0x1263d6[_0x55c4('0x5e')],{'firstName':_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')],'ListId':_0x28cef5['id']});_0x4d5b9c[_0x1263d6[_0x55c4('0x5e')]['mapKey']]=_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')];return db['CmContact'][_0x55c4('0x5d')](_0x4d5b9c,{'fields':_0x4a93ad,'raw':!![]});}})[_0x55c4('0x20')](handleEntityNotFound(_0x55fb4d,null))[_0x55c4('0x20')](function(_0x42c0d4){if(_0x42c0d4){_0x1263d6[_0x55c4('0xa2')]=_0x42c0d4;var _0x4f1b2b={'ContactId':_0x42c0d4['id'],'phone':_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')],'SmsAccountId':_0x2d7c5d[_0x55c4('0x59')]['id']};var _0x144cc3={'ContactId':_0x42c0d4['id'],'SmsAccountId':_0x2d7c5d[_0x55c4('0x59')]['id'],'closed':![]};return db[_0x55c4('0xa3')][_0x55c4('0x5c')]({'where':_0x144cc3})[_0x55c4('0x20')](function(_0x462cc1){if(_0x462cc1){return[_0x462cc1,![]];}return db[_0x55c4('0xa3')][_0x55c4('0x5d')](_0x4f1b2b)[_0x55c4('0x20')](function(_0x3234c9){return[_0x3234c9,!![]];});});}})[_0x55c4('0xa4')](function(_0x38ae98,_0x430dba){_0x1263d6[_0x55c4('0xa5')]=_0x38ae98[_0x55c4('0x38')]({'plain':!![]});_0x1263d6['interaction'][_0x55c4('0xa6')]=![];if(_0x430dba){if(_0x1263d6[_0x55c4('0x72')]['autoclose']){_0x1263d6[_0x55c4('0x73')][_0x55c4('0xa7')]({'id':0x0,'priority':_0x1263d6[_0x55c4('0x73')]['length']+0x1,'app':_0x55c4('0xa8'),'appdata':_0x55c4('0xa9'),'interval':_0x55c4('0xaa')});}_0x1263d6['interaction'][_0x55c4('0xa6')]=!![];}return db[_0x55c4('0xab')][_0x55c4('0x5d')]({'phone':_0x1263d6[_0x55c4('0x5e')][_0x55c4('0x85')],'messageId':_0x1263d6[_0x55c4('0x5e')]['messageId'],'body':_0x1263d6[_0x55c4('0x5e')]['body'],'SmsAccountId':_0x2d7c5d[_0x55c4('0x59')]['id'],'SmsInteractionId':_0x38ae98['id'],'direction':'in','ContactId':_0x38ae98[_0x55c4('0xac')],'AttachmentId':_0x1263d6[_0x55c4('0x5e')][_0x55c4('0xad')]});})[_0x55c4('0x20')](function(_0x423938){_0x1263d6['message']=_0x423938;if(_0x1263d6['interaction'][_0x55c4('0xae')]){return db[_0x55c4('0xaf')][_0x55c4('0x5c')]({'attributes':['id',_0x55c4('0x3c')],'where':{'id':_0x1263d6[_0x55c4('0xa5')]['UserId']}})[_0x55c4('0x20')](function(_0x78c07f){if(_0x78c07f){_0x1263d6[_0x55c4('0x73')][_0x55c4('0xb0')]({'id':0x0,'priority':0x0,'app':_0x55c4('0xb1'),'appdata':_0x78c07f[_0x55c4('0x3c')]+','+(_0x1263d6[_0x55c4('0x72')][_0x55c4('0xb2')]||0xa),'interval':_0x55c4('0xaa')});}return respondWithRpcPromise('Start',_0x55c4('0xb3'),_0x1263d6);});}return respondWithRpcPromise('Start',_0x55c4('0xb3'),_0x1263d6);})['then'](function(_0x3d5be3){if(_0x3d5be3){var _0x44b4e1=0xc8;var _0x21d00f='receiveMessage';logger['info'](_0x55c4('0x23'),_0x21d00f,_0x44b4e1,_0x55c4('0xb4'));logger[_0x55c4('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x21d00f,_0x44b4e1,'entity\x20found',JSON[_0x55c4('0x24')](_0x3d5be3));if(_0x1263d6['account']['type']===_0x55c4('0xb5')){return _0x55fb4d[_0x55c4('0x2c')](_0x44b4e1)['set'](_0x55c4('0xb6'),_0x55c4('0xb7'))[_0x55c4('0x3d')]('\x0a');}else{return _0x55fb4d['status'](_0x44b4e1)[_0x55c4('0x2d')](_0x3d5be3);}}})[_0x55c4('0x2a')](handleError(_0x55fb4d,null));};exports[_0x55c4('0xb8')]=function(_0x490c4a,_0x1ec664,_0x3fc959){return db['SmsAccount'][_0x55c4('0x6e')]({'where':{'id':_0x490c4a[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x1ec664,null))[_0x55c4('0x20')](function(_0x3a1d8b){if(_0x3a1d8b){return db['sequelize'][_0x55c4('0xb9')](function(_0x1c09e3){return db[_0x55c4('0xba')][_0x55c4('0x37')]({'where':{'SmsAccountId':_0x490c4a[_0x55c4('0x59')]['id']},'transaction':_0x1c09e3})[_0x55c4('0x20')](function(_0x3140a6){var _0x2a1d2b=_[_0x55c4('0x41')](_0x490c4a[_0x55c4('0x5e')],function(_0x4f2535){_0x4f2535[_0x55c4('0x67')]=_0x490c4a[_0x55c4('0x59')]['id'];return _0x4f2535;});return db[_0x55c4('0xba')]['bulkCreate'](_0x2a1d2b,{'transaction':_0x1c09e3});});})[_0x55c4('0x20')](function(){return db[_0x55c4('0xba')][_0x55c4('0xbb')]({'where':{'SmsAccountId':_0x490c4a['params']['id']},'order':'priority'});});}})[_0x55c4('0x20')](respondWithResult(_0x1ec664,null))[_0x55c4('0x2a')](handleError(_0x1ec664,null));};exports[_0x55c4('0xbc')]=function(_0x1a2225,_0xdcff65,_0x1a3024){var _0x4fe9ba={};var _0x29a13e={};var _0x36c07d;var _0x250b30;return db[_0x55c4('0x42')][_0x55c4('0x6e')]({'where':{'id':_0x1a2225[_0x55c4('0x59')]['id']}})['then'](handleEntityNotFound(_0xdcff65,null))[_0x55c4('0x20')](function(_0x5d40ca){if(_0x5d40ca){_0x36c07d=_0x5d40ca;_0x29a13e['model']=_[_0x55c4('0x47')](db['SmsApplication'][_0x55c4('0x43')]);_0x29a13e[_0x55c4('0x4a')]=_[_0x55c4('0x47')](_0x1a2225[_0x55c4('0x4a')]);_0x29a13e[_0x55c4('0x48')]=_[_0x55c4('0x49')](_0x29a13e[_0x55c4('0x4c')],_0x29a13e[_0x55c4('0x4a')]);_0x4fe9ba[_0x55c4('0x4b')]=_[_0x55c4('0x49')](_0x29a13e[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x1a2225['query'][_0x55c4('0x4d')]));_0x4fe9ba[_0x55c4('0x4b')]=_0x4fe9ba[_0x55c4('0x4b')][_0x55c4('0x4e')]?_0x4fe9ba[_0x55c4('0x4b')]:_0x29a13e['model'];_0x4fe9ba[_0x55c4('0x50')]=qs['sort'](_0x1a2225['query'][_0x55c4('0x51')]);_0x4fe9ba[_0x55c4('0x52')]=qs[_0x55c4('0x48')](_[_0x55c4('0x53')](_0x1a2225[_0x55c4('0x4a')],_0x29a13e[_0x55c4('0x48')]));if(_0x1a2225['query'][_0x55c4('0x54')]){_0x4fe9ba[_0x55c4('0x52')]=_[_0x55c4('0x5a')](_0x4fe9ba[_0x55c4('0x52')],{'$or':_[_0x55c4('0x41')](_0x4fe9ba['attributes'],function(_0x4161c5){var _0x5e115f={};_0x5e115f[_0x4161c5]={'$like':'%'+_0x1a2225[_0x55c4('0x4a')]['filter']+'%'};return _0x5e115f;})});}_0x4fe9ba=_[_0x55c4('0x5a')]({},_0x4fe9ba,_0x1a2225[_0x55c4('0x5b')]);return _0x36c07d['getApplications'](_0x4fe9ba);}})[_0x55c4('0x20')](function(_0x6d7b00){if(_0x6d7b00){_0x250b30=_0x6d7b00['length'];if(!_0x1a2225[_0x55c4('0x4a')][_0x55c4('0x4f')](_0x55c4('0x6f'))){_0x4fe9ba[_0x55c4('0x30')]=qs[_0x55c4('0x30')](_0x1a2225[_0x55c4('0x4a')][_0x55c4('0x30')]);_0x4fe9ba[_0x55c4('0x2e')]=qs[_0x55c4('0x2e')](_0x1a2225['query']['offset']);}return _0x36c07d[_0x55c4('0xbc')](_0x4fe9ba);}})[_0x55c4('0x20')](function(_0x2a3e07){if(_0x2a3e07){return _0x2a3e07?{'count':_0x250b30,'rows':_0x2a3e07}:null;}})[_0x55c4('0x20')](respondWithResult(_0xdcff65,null))[_0x55c4('0x2a')](handleError(_0xdcff65,null));};exports[_0x55c4('0xbd')]=function(_0x481886,_0x421540,_0x3477fa){var _0x173c5c={'raw':![],'where':{}};var _0x39356e={};var _0x585b38={'count':0x0,'rows':[]};return db[_0x55c4('0x42')][_0x55c4('0x6e')]({'where':{'id':_0x481886[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x421540,null))[_0x55c4('0x20')](function(_0x45faa5){if(_0x45faa5){_0x39356e[_0x55c4('0x4c')]=_[_0x55c4('0x47')](db[_0x55c4('0xa3')][_0x55c4('0x43')]);_0x39356e[_0x55c4('0x4a')]=_[_0x55c4('0x47')](_0x481886['query']);_0x39356e[_0x55c4('0x48')]=_[_0x55c4('0x49')](_0x39356e[_0x55c4('0x4c')],_0x39356e[_0x55c4('0x4a')]);_0x173c5c['attributes']=_[_0x55c4('0x49')](_0x39356e[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x481886['query']['fields']));_0x173c5c[_0x55c4('0x4b')]=_0x173c5c[_0x55c4('0x4b')][_0x55c4('0x4e')]?_0x173c5c[_0x55c4('0x4b')]:_0x39356e[_0x55c4('0x4c')];if(!_0x481886[_0x55c4('0x4a')]['hasOwnProperty']('nolimit')){_0x173c5c['limit']=qs['limit'](_0x481886[_0x55c4('0x4a')][_0x55c4('0x30')]);_0x173c5c[_0x55c4('0x2e')]=qs[_0x55c4('0x2e')](_0x481886[_0x55c4('0x4a')][_0x55c4('0x2e')]);}_0x173c5c[_0x55c4('0x50')]=qs[_0x55c4('0x51')](_0x481886[_0x55c4('0x4a')][_0x55c4('0x51')]);_0x173c5c['where']=qs[_0x55c4('0x48')](_[_0x55c4('0x53')](_0x481886[_0x55c4('0x4a')],_0x39356e[_0x55c4('0x48')]));_0x173c5c[_0x55c4('0x52')][_0x55c4('0x67')]=_0x45faa5['id'];if(_0x481886[_0x55c4('0x4a')][_0x55c4('0x54')]){_0x173c5c[_0x55c4('0x52')]=_[_0x55c4('0x5a')](_0x173c5c[_0x55c4('0x52')],{'$or':_[_0x55c4('0x41')](_0x173c5c['attributes'],function(_0x23c942){var _0x2f03fd={};_0x2f03fd[_0x23c942]={'$like':'%'+_0x481886[_0x55c4('0x4a')][_0x55c4('0x54')]+'%'};return _0x2f03fd;})});}_0x173c5c=_[_0x55c4('0x5a')]({},_0x173c5c,_0x481886[_0x55c4('0x5b')]);return db[_0x55c4('0xa3')][_0x55c4('0x31')]({'where':_0x173c5c['where']})[_0x55c4('0x20')](function(_0x21b3f1){_0x585b38[_0x55c4('0x31')]=_0x21b3f1;if(_0x481886[_0x55c4('0x4a')][_0x55c4('0x69')]){_0x173c5c['include']=[{'model':db[_0x55c4('0x78')],'as':_0x55c4('0xbe'),'required':![]},{'model':db['User'],'as':_0x55c4('0xbf'),'attributes':['name',_0x55c4('0xc0'),_0x55c4('0xc1')],'required':![]},{'model':db['Tag'],'as':_0x55c4('0xc2'),'attributes':['id','name',_0x55c4('0xc3')],'where':_0x481886[_0x55c4('0x4a')][_0x55c4('0xc4')]?{'id':_0x481886[_0x55c4('0x4a')][_0x55c4('0xc4')]}:undefined,'required':_0x481886[_0x55c4('0x4a')][_0x55c4('0xc4')]?!![]:![]}];}return db['SmsInteraction'][_0x55c4('0x56')](_0x173c5c);})[_0x55c4('0x20')](function(_0x23d15f){_0x585b38['rows']=_0x23d15f;return _0x585b38;});}})[_0x55c4('0x20')](respondWithFilteredResult(_0x421540,_0x173c5c))[_0x55c4('0x2a')](handleError(_0x421540,null));};exports[_0x55c4('0x3d')]=function(_0x5e18f7,_0x2f284e,_0x305f7b){var _0xd47a17,_0x9a26b5,_0x31100e;if(_['isNil'](_0x5e18f7[_0x55c4('0x5e')][_0x55c4('0x5e')])||_0x5e18f7[_0x55c4('0x5e')][_0x55c4('0x5e')]===''){throw new db[(_0x55c4('0x79'))][(_0x55c4('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x55c4('0x99')](_0x5e18f7[_0x55c4('0x5e')]['to'])){throw new db[(_0x55c4('0x79'))]['ValidationError'](_0x55c4('0xc5'));}_0xd47a17=_0x5e18f7[_0x55c4('0x5e')]['to'];return db[_0x55c4('0x42')]['find']({'where':{'id':_0x5e18f7[_0x55c4('0x59')]['id']},'include':[{'model':db[_0x55c4('0x9c')],'as':_0x55c4('0xc6'),'include':[{'model':db[_0x55c4('0x78')],'as':'Contacts','where':{'mobile':_0xd47a17},'limit':0x1,'order':[[_0x55c4('0x7e'),_0x55c4('0x9e')]]}]}]})[_0x55c4('0x20')](handleEntityNotFound(_0x2f284e,null))[_0x55c4('0x20')](function(_0x4b4575){if(_0x4b4575&&_0x4b4575['List']){_0x9a26b5=_0x4b4575['get']({'plain':!![]});if(_0x9a26b5[_0x55c4('0xc6')]&&_0x9a26b5[_0x55c4('0xc6')][_0x55c4('0x9d')][_0x55c4('0x4e')]){return _0x9a26b5[_0x55c4('0xc6')][_0x55c4('0x9d')][0x0];}return db[_0x55c4('0x78')][_0x55c4('0x5d')](_[_0x55c4('0xa1')](_0x5e18f7[_0x55c4('0x5e')],{'firstName':_0xd47a17,'mobile':_0xd47a17,'phone':_0xd47a17,'ListId':_0x9a26b5[_0x55c4('0x80')]}));}})[_0x55c4('0x20')](handleEntityNotFound(_0x2f284e,null))['then'](function(_0x167f5c){if(_0x167f5c){_0x31100e=_0x167f5c;return db[_0x55c4('0xa3')][_0x55c4('0x5c')]({'where':{'ContactId':_0x31100e['id'],'closed':![],'SmsAccountId':_0x9a26b5['id']}})[_0x55c4('0x20')](function(_0x10c528){if(_0x10c528){return[_0x10c528,![]];}return db[_0x55c4('0xa3')]['create']({'UserId':_0x5e18f7[_0x55c4('0x5f')]['id'],'ContactId':_0x31100e['id'],'SmsAccountId':_0x9a26b5['id'],'phone':_0xd47a17,'firstMsgDirection':'out','Messages':[_['merge'](_0x5e18f7['body'],{'read':![],'body':_0x5e18f7[_0x55c4('0x5e')][_0x55c4('0x5e')],'phone':_0xd47a17,'SmsAccountId':_0x9a26b5['id'],'UserId':_0x5e18f7[_0x55c4('0x5f')]['id'],'ContactId':_0x31100e['id']})]},{'include':[{'model':db[_0x55c4('0xab')],'as':_0x55c4('0xc7')}]})['then'](function(_0x3871b3){return[_0x3871b3,!![]];});});}})[_0x55c4('0xa4')](function(_0x9f70b5,_0x327d7a){if(_0x327d7a){return _0x9f70b5;}return db[_0x55c4('0xab')][_0x55c4('0x5d')](_[_0x55c4('0x5a')](_0x5e18f7[_0x55c4('0x5e')],{'read':![],'body':_0x5e18f7[_0x55c4('0x5e')][_0x55c4('0x5e')],'phone':_0xd47a17,'SmsAccountId':_0x9a26b5['id'],'SmsInteractionId':_0x9f70b5['id'],'UserId':_0x5e18f7[_0x55c4('0x5f')]['id'],'ContactId':_0x31100e['id']}))[_0x55c4('0x20')](function(_0x466b93){_0x9f70b5['dataValues']['Messages']=[];_0x9f70b5[_0x55c4('0xc8')][_0x55c4('0xc7')][_0x55c4('0xa7')](_0x466b93['dataValues']);return _0x9f70b5;});})[_0x55c4('0x20')](respondWithResult(_0x2f284e,null))[_0x55c4('0x2a')](handleError(_0x2f284e,null));};exports['status']=function(_0x163cb9,_0x437a37,_0x4c23a8){if(_0x163cb9['body']['id']){delete _0x163cb9[_0x55c4('0x5e')]['id'];}var _0x1c4d93,_0x249011,_0x2abba1;return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x163cb9['params']['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x437a37,null))[_0x55c4('0x20')](function(_0x39388c){if(_0x39388c){_0x2abba1=_0x39388c;logger[_0x55c4('0x22')](_0x55c4('0x23'),_0x55c4('0x2c'),_0x55c4('0xc9'),_0x39388c[_0x55c4('0x45')],util['inspect'](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));switch(_0x39388c[_0x55c4('0x45')]){case'skebby':if(_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xca')]&&_0x163cb9[_0x55c4('0x5e')]['status']){_0x249011=_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x2c')];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xca')]}});}break;case _0x55c4('0x88'):if(_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xcb')]&&_0x163cb9[_0x55c4('0x5e')]['statusInt']){_0x249011=_0x163cb9['body']['statusInt'];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9['body'][_0x55c4('0xcb')]}});}break;case _0x55c4('0xcc'):if(_0x163cb9['body'][_0x55c4('0xcd')]&&_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xce')]){_0x249011=_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xce')];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xcd')]}});}break;case _0x55c4('0x8e'):var _0x30dd94=_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x8f')][0x0];if(_0x30dd94['messageId']&&_0x30dd94['status'][_0x55c4('0xcf')]===_0x55c4('0xd0')){_0x249011=_0x30dd94['status']['groupName'];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x30dd94[_0x55c4('0x89')]}});}break;case'clickatell':if(_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x89')]&&_0x163cb9['body'][_0x55c4('0x2c')]){_0x249011=_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x2c')];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x89')]}});}break;case'bandwidth':if(_0x163cb9['body'][0x0][_0x55c4('0x28')]['id']){_0x249011=_0x163cb9[_0x55c4('0x5e')][0x0]['type'];return db[_0x55c4('0xab')][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9[_0x55c4('0x5e')][0x0][_0x55c4('0x28')]['id']}});}break;case _0x55c4('0xd1'):if(_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xd2')]&&_0x163cb9['body']['status']){_0x249011=_0x163cb9[_0x55c4('0x5e')][_0x55c4('0x2c')];return db[_0x55c4('0xab')][_0x55c4('0x5c')]({'where':{'messageId':_0x163cb9[_0x55c4('0x5e')][_0x55c4('0xd2')]}});}break;}}})[_0x55c4('0x20')](handleEntityNotFound(_0x437a37,null))[_0x55c4('0x20')](function(_0x239b3f){if(_0x239b3f){_0x1c4d93=_0x239b3f;switch(_0x2abba1[_0x55c4('0x45')]){case _0x55c4('0x84'):if(_0x249011===_0x55c4('0xd0')){return _0x1c4d93[_0x55c4('0x36')]({'read':!![]});}else{logger['error'](_0x55c4('0x23'),_0x55c4('0x2c'),'skebby',util[_0x55c4('0xd3')](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x55c4('0x88'):if(_0x249011==='1'){return _0x1c4d93['update']({'read':!![]});}else{logger[_0x55c4('0x25')](_0x55c4('0x23'),'status',_0x55c4('0x84'),util[_0x55c4('0xd3')](_0x163cb9['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x163cb9[_0x55c4('0x5e')]['error_code']&&_0x249011>=0xc8&&_0x249011<=0xce){return _0x1c4d93['update']({'read':!![]});}else{logger[_0x55c4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x55c4('0x2c'),'clicksend',util[_0x55c4('0xd3')](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x55c4('0x8e'):var _0x34a5ba=_0x163cb9['body'][_0x55c4('0x8f')][0x0];if(_0x34a5ba['status'][_0x55c4('0xcf')]==='DELIVERED'){return _0x1c4d93[_0x55c4('0x36')]({'read':!![]});}else{logger['error'](_0x55c4('0x23'),_0x55c4('0x2c'),_0x55c4('0x8e'),util['inspect'](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x249011==_0x55c4('0xd4')||_0x249011==_0x55c4('0xd5')){return _0x1c4d93['update']({'read':!![]});}else{logger[_0x55c4('0x25')](_0x55c4('0x23'),_0x55c4('0x2c'),_0x55c4('0x93'),util['inspect'](_0x163cb9['body'],{'showHidden':![],'depth':null}));}break;case _0x55c4('0x96'):if(_0x249011==_0x55c4('0xd6')){return _0x1c4d93[_0x55c4('0x36')]({'read':!![]});}else{logger[_0x55c4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x55c4('0x2c'),_0x55c4('0x96'),util[_0x55c4('0xd3')](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x55c4('0xd1'):if(_0x249011==='DELIVRD'||_0x249011==='ACCEPTD'){return _0x1c4d93[_0x55c4('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x55c4('0xd1'),util[_0x55c4('0xd3')](_0x163cb9[_0x55c4('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1c4d93;}})[_0x55c4('0x20')](respondWithResult(_0x437a37,null))['catch'](handleError(_0x437a37,null));};exports[_0x55c4('0xd7')]=function(_0x2a4184,_0x430d2c,_0x32fc44){var _0xd69b0,_0x4e74c8,_0x53a4db;return db[_0x55c4('0x42')]['find']({'where':{'id':_0x2a4184['params']['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x430d2c,null))['then'](function(_0x405b51){if(_0x405b51){_0x53a4db=_0x405b51;logger['debug'](_0x55c4('0x23'),_0x55c4('0x2c'),_0x55c4('0xc9'),_0x405b51['type'],util[_0x55c4('0xd3')](_0x2a4184['query'],{'showHidden':![],'depth':null}));switch(_0x405b51[_0x55c4('0x45')]){case _0x55c4('0x90'):if(_0x2a4184['query'][_0x55c4('0xd8')]&&_0x2a4184[_0x55c4('0x4a')][_0x55c4('0xd9')]){_0x4e74c8=_0x2a4184[_0x55c4('0x4a')][_0x55c4('0xd9')];return db['SmsMessage'][_0x55c4('0x5c')]({'where':{'messageId':_0x2a4184[_0x55c4('0x4a')][_0x55c4('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x430d2c,null))[_0x55c4('0x20')](function(_0x5aa9f3){if(_0x5aa9f3){_0xd69b0=_0x5aa9f3;switch(_0x53a4db[_0x55c4('0x45')]){case _0x55c4('0x90'):if(_0x4e74c8==='2'||_0x4e74c8==='6'){return _0xd69b0[_0x55c4('0x36')]({'read':!![]});}else{logger[_0x55c4('0x25')](_0x55c4('0x23'),_0x55c4('0x2c'),_0x55c4('0x90'),util[_0x55c4('0xd3')](_0x2a4184['query'],{'showHidden':![],'depth':null}));};break;}return _0xd69b0;}})[_0x55c4('0x20')](respondWithResult(_0x430d2c,null))[_0x55c4('0x2a')](handleError(_0x430d2c,null));};exports[_0x55c4('0xda')]=function(_0x4e4d80,_0x3df963,_0x4a5ef0){return db['SmsAccount'][_0x55c4('0x5c')]({'where':{'id':_0x4e4d80[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x3df963,null))['then'](function(_0x81ac3){if(_0x81ac3){return _0x81ac3[_0x55c4('0xda')](_0x4e4d80['body'][_0x55c4('0x6b')],_['omit'](_0x4e4d80[_0x55c4('0x5e')],[_0x55c4('0x6b'),'id'])||{})[_0x55c4('0xa4')](function(_0x3de8ac){for(var _0x32affe=0x0;_0x32affe<_0x4e4d80['body'][_0x55c4('0x6b')][_0x55c4('0x4e')];_0x32affe+=0x1){socket[_0x55c4('0xdb')](_0x55c4('0xdc'),{'UserId':Number(_0x4e4d80[_0x55c4('0x5e')]['ids'][_0x32affe]),'SmsAccountId':Number(_0x4e4d80[_0x55c4('0x59')]['id'])});}return _0x3de8ac;});}})[_0x55c4('0x20')](respondWithResult(_0x3df963,null))['catch'](handleError(_0x3df963,null));};exports[_0x55c4('0xdd')]=function(_0x31c933,_0x300173,_0x50c80b){return db[_0x55c4('0x42')][_0x55c4('0x5c')]({'where':{'id':_0x31c933[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x300173,null))[_0x55c4('0x20')](function(_0x3a08df){if(_0x3a08df){return _0x3a08df[_0x55c4('0xdd')](_0x31c933[_0x55c4('0x4a')][_0x55c4('0x6b')])[_0x55c4('0x20')](function(){if(_[_0x55c4('0xde')](_0x31c933[_0x55c4('0x4a')]['ids'])){for(var _0x22ea0f=0x0;_0x22ea0f<_0x31c933[_0x55c4('0x4a')][_0x55c4('0x6b')][_0x55c4('0x4e')];_0x22ea0f+=0x1){socket[_0x55c4('0xdb')](_0x55c4('0xdf'),{'UserId':Number(_0x31c933[_0x55c4('0x4a')]['ids'][_0x22ea0f]),'SmsAccountId':Number(_0x31c933['params']['id'])});}}else{socket[_0x55c4('0xdb')](_0x55c4('0xdf'),{'UserId':Number(_0x31c933[_0x55c4('0x4a')][_0x55c4('0x6b')]),'SmsAccountId':Number(_0x31c933[_0x55c4('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x300173,null))[_0x55c4('0x2a')](handleError(_0x300173,null));};exports[_0x55c4('0xe0')]=function(_0x4cf7b6,_0x4d5b3a,_0x4ebcf2){var _0x3bef6c={};var _0x45c0dc={};var _0x172c92;var _0x52ba20;return db[_0x55c4('0x42')][_0x55c4('0x6e')]({'where':{'id':_0x4cf7b6[_0x55c4('0x59')]['id']}})[_0x55c4('0x20')](handleEntityNotFound(_0x4d5b3a,null))['then'](function(_0x1ab6af){if(_0x1ab6af){_0x172c92=_0x1ab6af;_0x45c0dc[_0x55c4('0x4c')]=_['keys'](db['User'][_0x55c4('0x43')]);_0x45c0dc[_0x55c4('0x4a')]=_['keys'](_0x4cf7b6[_0x55c4('0x4a')]);_0x45c0dc['filters']=_['intersection'](_0x45c0dc[_0x55c4('0x4c')],_0x45c0dc[_0x55c4('0x4a')]);_0x3bef6c[_0x55c4('0x4b')]=_[_0x55c4('0x49')](_0x45c0dc[_0x55c4('0x4c')],qs[_0x55c4('0x4d')](_0x4cf7b6[_0x55c4('0x4a')][_0x55c4('0x4d')]));_0x3bef6c[_0x55c4('0x4b')]=_0x3bef6c[_0x55c4('0x4b')]['length']?_0x3bef6c[_0x55c4('0x4b')]:_0x45c0dc[_0x55c4('0x4c')];_0x3bef6c[_0x55c4('0x50')]=qs[_0x55c4('0x51')](_0x4cf7b6[_0x55c4('0x4a')][_0x55c4('0x51')]);_0x3bef6c[_0x55c4('0x52')]=qs[_0x55c4('0x48')](_['pick'](_0x4cf7b6[_0x55c4('0x4a')],_0x45c0dc[_0x55c4('0x48')]));if(_0x4cf7b6['query'][_0x55c4('0x54')]){_0x3bef6c[_0x55c4('0x52')]=_[_0x55c4('0x5a')](_0x3bef6c['where'],{'$or':_['map'](_0x3bef6c[_0x55c4('0x4b')],function(_0x2fa62d){var _0x392f64={};_0x392f64[_0x2fa62d]={'$like':'%'+_0x4cf7b6['query'][_0x55c4('0x54')]+'%'};return _0x392f64;})});}_0x3bef6c=_['merge']({},_0x3bef6c,_0x4cf7b6[_0x55c4('0x5b')]);return _0x172c92[_0x55c4('0xe0')](_0x3bef6c);}})[_0x55c4('0x20')](function(_0x4b687e){if(_0x4b687e){_0x52ba20=_0x4b687e[_0x55c4('0x4e')];if(!_0x4cf7b6[_0x55c4('0x4a')][_0x55c4('0x4f')](_0x55c4('0x6f'))){_0x3bef6c[_0x55c4('0x30')]=qs[_0x55c4('0x30')](_0x4cf7b6['query'][_0x55c4('0x30')]);_0x3bef6c[_0x55c4('0x2e')]=qs[_0x55c4('0x2e')](_0x4cf7b6[_0x55c4('0x4a')][_0x55c4('0x2e')]);}return _0x172c92[_0x55c4('0xe0')](_0x3bef6c);}})[_0x55c4('0x20')](function(_0x14090b){if(_0x14090b){return _0x14090b?{'count':_0x52ba20,'rows':_0x14090b}:null;}})[_0x55c4('0x20')](respondWithResult(_0x4d5b3a,null))['catch'](handleError(_0x4d5b3a,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index e9ace80..e7b7caf 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 _0xed53=['hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xed53,0x16a));var _0x3ed5=function(_0x3c018a,_0x2e7c73){_0x3c018a=_0x3c018a-0x0;var _0xaf5e6d=_0xed53[_0x3c018a];return _0xaf5e6d;};'use strict';var EventEmitter=require(_0x3ed5('0x0'));var SmsAccount=require(_0x3ed5('0x1'))['db'][_0x3ed5('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3ed5('0x3')](0x0);var events={'afterCreate':_0x3ed5('0x4'),'afterUpdate':'update','afterDestroy':_0x3ed5('0x5')};function emitEvent(_0x215b05){return function(_0x1e611d,_0x4a52d6,_0x19a2b3){SmsAccountEvents[_0x3ed5('0x6')](_0x215b05+':'+_0x1e611d['id'],_0x1e611d);SmsAccountEvents['emit'](_0x215b05,_0x1e611d);_0x19a2b3(null);};}for(var e in events){if(events[_0x3ed5('0x7')](e)){var event=events[e];SmsAccount[_0x3ed5('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xc782=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x27804f,_0x17d1ad){var _0x3a8dea=function(_0x324b5d){while(--_0x324b5d){_0x27804f['push'](_0x27804f['shift']());}};_0x3a8dea(++_0x17d1ad);}(_0xc782,0x1a4));var _0x2c78=function(_0x2d9f8f,_0x40bc79){_0x2d9f8f=_0x2d9f8f-0x0;var _0x240df4=_0xc782[_0x2d9f8f];return _0x240df4;};'use strict';var EventEmitter=require(_0x2c78('0x0'));var SmsAccount=require(_0x2c78('0x1'))['db'][_0x2c78('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c78('0x3'),'afterDestroy':_0x2c78('0x4')};function emitEvent(_0x5f1539){return function(_0x19463b,_0x456758,_0x427cc1){SmsAccountEvents[_0x2c78('0x5')](_0x5f1539+':'+_0x19463b['id'],_0x19463b);SmsAccountEvents[_0x2c78('0x5')](_0x5f1539,_0x19463b);_0x427cc1(null);};}for(var e in events){if(events[_0x2c78('0x6')](e)){var event=events[e];SmsAccount[_0x2c78('0x7')](e,emitEvent(event));}}module[_0x2c78('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index d4ff418..1a3879e 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 _0xc2bd=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_accounts','lodash'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xc2bd,0xb3));var _0xdc2b=function(_0x2db29f,_0x156c89){_0x2db29f=_0x2db29f-0x0;var _0x1b1ed5=_0xc2bd[_0x2db29f];return _0x1b1ed5;};'use strict';var _=require(_0xdc2b('0x0'));var util=require(_0xdc2b('0x1'));var logger=require(_0xdc2b('0x2'))(_0xdc2b('0x3'));var moment=require('moment');var BPromise=require(_0xdc2b('0x4'));var rp=require(_0xdc2b('0x5'));var fs=require('fs');var path=require(_0xdc2b('0x6'));var rimraf=require(_0xdc2b('0x7'));var config=require(_0xdc2b('0x8'));var attributes=require('./smsAccount.attributes');module[_0xdc2b('0x9')]=function(_0x4d3770,_0x41a6dd){return _0x4d3770[_0xdc2b('0xa')]('SmsAccount',attributes,{'tableName':_0xdc2b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x227a=['bluebird','request-promise','../../config/environment','exports','define','SmsAccount','sms_accounts','lodash','../../config/logger','api'];(function(_0x4bdd56,_0xcc5fca){var _0xcda53e=function(_0x3634e4){while(--_0x3634e4){_0x4bdd56['push'](_0x4bdd56['shift']());}};_0xcda53e(++_0xcc5fca);}(_0x227a,0xbb));var _0xa227=function(_0x5e10c7,_0x4fd215){_0x5e10c7=_0x5e10c7-0x0;var _0x378f7c=_0x227a[_0x5e10c7];return _0x378f7c;};'use strict';var _=require(_0xa227('0x0'));var util=require('util');var logger=require(_0xa227('0x1'))(_0xa227('0x2'));var moment=require('moment');var BPromise=require(_0xa227('0x3'));var rp=require(_0xa227('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa227('0x5'));var attributes=require('./smsAccount.attributes');module[_0xa227('0x6')]=function(_0x5779da,_0x704a99){return _0x5779da[_0xa227('0x7')](_0xa227('0x8'),attributes,{'tableName':_0xa227('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index d5347a3..e52f0ee 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 _0xf672=['error','code','message','result','ShowSmsAccount','options','raw','where','attributes','include','map','model','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x193db6,_0x3775a8){var _0xbf6ef0=function(_0x419878){while(--_0x419878){_0x193db6['push'](_0x193db6['shift']());}};_0xbf6ef0(++_0x3775a8);}(_0xf672,0xc6));var _0x2f67=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xf672[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x2f67('0x0'));var util=require(_0x2f67('0x1'));var moment=require('moment');var BPromise=require(_0x2f67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f67('0x3'))['db'];var utils=require(_0x2f67('0x4'));var logger=require(_0x2f67('0x5'))(_0x2f67('0x6'));var config=require(_0x2f67('0x7'));var jayson=require(_0x2f67('0x8'));var client=jayson['client'][_0x2f67('0x9')]({'port':0x232a});config[_0x2f67('0xa')]=_[_0x2f67('0xb')](config[_0x2f67('0xa')],{'host':_0x2f67('0xc'),'port':0x18eb});var socket=require(_0x2f67('0xd'))(new Redis(config[_0x2f67('0xa')]));require(_0x2f67('0xe'))[_0x2f67('0xf')](socket);function respondWithRpcPromise(_0x4ad4be,_0x2ae0e3,_0x3f3351){return new BPromise(function(_0x5dd40c,_0x44bb13){return client[_0x2f67('0x10')](_0x4ad4be,_0x3f3351)[_0x2f67('0x11')](function(_0x56fca7){logger[_0x2f67('0x12')](_0x2f67('0x13'),_0x2ae0e3,_0x2f67('0x14'));logger[_0x2f67('0x15')](_0x2f67('0x16'),_0x2ae0e3,'request\x20sent',JSON[_0x2f67('0x17')](_0x56fca7));if(_0x56fca7[_0x2f67('0x18')]){if(_0x56fca7[_0x2f67('0x18')][_0x2f67('0x19')]===0x1f4){logger[_0x2f67('0x18')](_0x2f67('0x13'),_0x2ae0e3,_0x56fca7['error'][_0x2f67('0x1a')]);return _0x44bb13(_0x56fca7['error'][_0x2f67('0x1a')]);}logger['error'](_0x2f67('0x13'),_0x2ae0e3,_0x56fca7[_0x2f67('0x18')]['message']);return _0x5dd40c(_0x56fca7[_0x2f67('0x18')]['message']);}else{logger[_0x2f67('0x12')](_0x2f67('0x13'),_0x2ae0e3,_0x2f67('0x14'));_0x5dd40c(_0x56fca7[_0x2f67('0x1b')][_0x2f67('0x1a')]);}})['catch'](function(_0xf4a80e){logger[_0x2f67('0x18')]('SmsAccount,\x20%s,\x20%s',_0x2ae0e3,_0xf4a80e);_0x44bb13(_0xf4a80e);});});}exports[_0x2f67('0x1c')]=function(_0xb6a184){var _0x1719df=this;return new Promise(function(_0x459cba,_0x2012f2){return db['SmsAccount']['find']({'raw':_0xb6a184[_0x2f67('0x1d')]?_0xb6a184['options'][_0x2f67('0x1e')]===undefined?!![]:![]:!![],'where':_0xb6a184[_0x2f67('0x1d')]?_0xb6a184[_0x2f67('0x1d')][_0x2f67('0x1f')]||null:null,'attributes':_0xb6a184[_0x2f67('0x1d')]?_0xb6a184['options'][_0x2f67('0x20')]||null:null,'include':_0xb6a184[_0x2f67('0x1d')]?_0xb6a184[_0x2f67('0x1d')][_0x2f67('0x21')]?_[_0x2f67('0x22')](_0xb6a184[_0x2f67('0x1d')][_0x2f67('0x21')],function(_0x2bbec1){return{'model':db[_0x2bbec1['model']],'as':_0x2bbec1['as'],'attributes':_0x2bbec1[_0x2f67('0x20')],'include':_0x2bbec1[_0x2f67('0x21')]?_[_0x2f67('0x22')](_0x2bbec1[_0x2f67('0x21')],function(_0x408134){return{'model':db[_0x408134[_0x2f67('0x23')]],'as':_0x408134['as'],'attributes':_0x408134['attributes'],'include':_0x408134[_0x2f67('0x21')]?_[_0x2f67('0x22')](_0x408134['include'],function(_0xd902a9){return{'model':db[_0xd902a9['model']],'as':_0xd902a9['as'],'attributes':_0xd902a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f67('0x11')](function(_0x283784){logger['info'](_0x2f67('0x1c'),_0xb6a184);logger[_0x2f67('0x15')](_0x2f67('0x1c'),_0xb6a184,JSON[_0x2f67('0x17')](_0x283784));_0x459cba(_0x283784);})[_0x2f67('0x24')](function(_0x50b426){logger[_0x2f67('0x18')](_0x2f67('0x1c'),_0x50b426[_0x2f67('0x1a')],_0xb6a184);_0x2012f2(_0x1719df[_0x2f67('0x18')](0x1f4,_0x50b426[_0x2f67('0x1a')]));});});}; \ No newline at end of file +var _0x887b=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','map','model','include','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','request'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x887b,0x134));var _0xb887=function(_0x5ba11e,_0x142d34){_0x5ba11e=_0x5ba11e-0x0;var _0x383d51=_0x887b[_0x5ba11e];return _0x383d51;};'use strict';var _=require('lodash');var util=require(_0xb887('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb887('0x1'));var db=require(_0xb887('0x2'))['db'];var utils=require(_0xb887('0x3'));var logger=require(_0xb887('0x4'))(_0xb887('0x5'));var config=require(_0xb887('0x6'));var jayson=require(_0xb887('0x7'));var client=jayson[_0xb887('0x8')][_0xb887('0x9')]({'port':0x232a});config['redis']=_[_0xb887('0xa')](config[_0xb887('0xb')],{'host':_0xb887('0xc'),'port':0x18eb});var socket=require(_0xb887('0xd'))(new Redis(config[_0xb887('0xb')]));require(_0xb887('0xe'))['register'](socket);function respondWithRpcPromise(_0x544d0b,_0xc36958,_0x527445){return new BPromise(function(_0x3403aa,_0x4c9f1d){return client[_0xb887('0xf')](_0x544d0b,_0x527445)[_0xb887('0x10')](function(_0x3ab9f3){logger[_0xb887('0x11')](_0xb887('0x12'),_0xc36958,_0xb887('0x13'));logger[_0xb887('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc36958,_0xb887('0x13'),JSON[_0xb887('0x15')](_0x3ab9f3));if(_0x3ab9f3[_0xb887('0x16')]){if(_0x3ab9f3['error'][_0xb887('0x17')]===0x1f4){logger['error'](_0xb887('0x12'),_0xc36958,_0x3ab9f3[_0xb887('0x16')][_0xb887('0x18')]);return _0x4c9f1d(_0x3ab9f3[_0xb887('0x16')][_0xb887('0x18')]);}logger[_0xb887('0x16')](_0xb887('0x12'),_0xc36958,_0x3ab9f3[_0xb887('0x16')][_0xb887('0x18')]);return _0x3403aa(_0x3ab9f3[_0xb887('0x16')][_0xb887('0x18')]);}else{logger[_0xb887('0x11')](_0xb887('0x12'),_0xc36958,_0xb887('0x13'));_0x3403aa(_0x3ab9f3['result']['message']);}})[_0xb887('0x19')](function(_0x2dcfda){logger[_0xb887('0x16')](_0xb887('0x12'),_0xc36958,_0x2dcfda);_0x4c9f1d(_0x2dcfda);});});}exports[_0xb887('0x1a')]=function(_0xe137a){var _0x1b6250=this;return new Promise(function(_0x575913,_0x4b66b7){return db[_0xb887('0x1b')][_0xb887('0x1c')]({'raw':_0xe137a['options']?_0xe137a['options'][_0xb887('0x1d')]===undefined?!![]:![]:!![],'where':_0xe137a[_0xb887('0x1e')]?_0xe137a[_0xb887('0x1e')][_0xb887('0x1f')]||null:null,'attributes':_0xe137a['options']?_0xe137a[_0xb887('0x1e')][_0xb887('0x20')]||null:null,'include':_0xe137a[_0xb887('0x1e')]?_0xe137a[_0xb887('0x1e')]['include']?_[_0xb887('0x21')](_0xe137a[_0xb887('0x1e')]['include'],function(_0x192333){return{'model':db[_0x192333[_0xb887('0x22')]],'as':_0x192333['as'],'attributes':_0x192333['attributes'],'include':_0x192333[_0xb887('0x23')]?_[_0xb887('0x21')](_0x192333[_0xb887('0x23')],function(_0xe4eacf){return{'model':db[_0xe4eacf['model']],'as':_0xe4eacf['as'],'attributes':_0xe4eacf[_0xb887('0x20')],'include':_0xe4eacf['include']?_[_0xb887('0x21')](_0xe4eacf[_0xb887('0x23')],function(_0x299ea3){return{'model':db[_0x299ea3[_0xb887('0x22')]],'as':_0x299ea3['as'],'attributes':_0x299ea3[_0xb887('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb887('0x10')](function(_0x1e6fa2){logger[_0xb887('0x11')]('ShowSmsAccount',_0xe137a);logger[_0xb887('0x14')](_0xb887('0x1a'),_0xe137a,JSON[_0xb887('0x15')](_0x1e6fa2));_0x575913(_0x1e6fa2);})[_0xb887('0x19')](function(_0x2b37f9){logger['error'](_0xb887('0x1a'),_0x2b37f9[_0xb887('0x18')],_0xe137a);_0x4b66b7(_0x1b6250[_0xb887('0x16')](0x1f4,_0x2b37f9[_0xb887('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8d877eb..252529e 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index a0db348..7072416 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x243778,_0x5ca326){var _0x45a8b2=function(_0x31abe7){while(--_0x31abe7){_0x243778['push'](_0x243778['shift']());}};_0x45a8b2(++_0x5ca326);}(_0xedd9,0xfc));var _0x9edd=function(_0x10a18e,_0x24447c){_0x10a18e=_0x10a18e-0x0;var _0x65a58f=_0xedd9[_0x10a18e];return _0x65a58f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e1f24,_0x442000){var _0x53823d=function(_0x44f343){while(--_0x44f343){_0x5e1f24['push'](_0x5e1f24['shift']());}};_0x53823d(++_0x442000);}(_0x34e8,0x12c));var _0x834e=function(_0x2bb038,_0x156484){_0x2bb038=_0x2bb038-0x0;var _0x4b371f=_0x34e8[_0x2bb038];return _0x4b371f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 02cea5a..380fa7c 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 _0x334f=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x334f,0x196));var _0xf334=function(_0x44d566,_0x1f4d95){_0x44d566=_0x44d566-0x0;var _0x57fc90=_0x334f[_0x44d566];return _0x57fc90;};'use strict';var Sequelize=require(_0xf334('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf334('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf334('0x2')],'allowNull':![],'defaultValue':_0xf334('0x3')},'appdata':{'type':Sequelize[_0xf334('0x4')]()},'description':{'type':Sequelize[_0xf334('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf334('0x5')}}; \ No newline at end of file +var _0xc41d=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x287676,_0x2c0509){var _0x3d9fe5=function(_0x4c49b7){while(--_0x4c49b7){_0x287676['push'](_0x287676['shift']());}};_0x3d9fe5(++_0x2c0509);}(_0xc41d,0x1a4));var _0xdc41=function(_0x3d9fcd,_0x5bd8f0){_0x3d9fcd=_0x3d9fcd-0x0;var _0xfd5e6b=_0xc41d[_0x3d9fcd];return _0xfd5e6b;};'use strict';var Sequelize=require('sequelize');module[_0xdc41('0x0')]={'priority':{'type':Sequelize[_0xdc41('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdc41('0x2')},'appdata':{'type':Sequelize[_0xdc41('0x3')]()},'description':{'type':Sequelize[_0xdc41('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdc41('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f909f53..35e1363 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 _0x865b=['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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','keys','length','includeAll','options','find','create','body','params','destroy','eml-format','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x2edb2f,_0x2cd92f){var _0x460785=function(_0x2355fc){while(--_0x2355fc){_0x2edb2f['push'](_0x2edb2f['shift']());}};_0x460785(++_0x2cd92f);}(_0x865b,0x93));var _0xb865=function(_0x4060b4,_0x82eb25){_0x4060b4=_0x4060b4-0x0;var _0x32aaa1=_0x865b[_0x4060b4];return _0x32aaa1;};'use strict';var emlformat=require(_0xb865('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb865('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb865('0x2'));var BPromise=require(_0xb865('0x3'));var Mustache=require(_0xb865('0x4'));var util=require(_0xb865('0x5'));var path=require(_0xb865('0x6'));var sox=require(_0xb865('0x7'));var csv=require(_0xb865('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb865('0x9'));var squel=require(_0xb865('0xa'));var crypto=require(_0xb865('0xb'));var jsforce=require(_0xb865('0xc'));var deskjs=require(_0xb865('0xd'));var toCsv=require(_0xb865('0x8'));var querystring=require(_0xb865('0xe'));var Papa=require(_0xb865('0xf'));var Redis=require(_0xb865('0x10'));var authService=require(_0xb865('0x11'));var qs=require(_0xb865('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb865('0x13'));var logger=require(_0xb865('0x14'))(_0xb865('0x15'));var utils=require('../../config/utils');var config=require(_0xb865('0x16'));var licenseUtil=require(_0xb865('0x17'));var db=require(_0xb865('0x18'))['db'];function respondWithStatusCode(_0x747074,_0x4ded40){_0x4ded40=_0x4ded40||0xcc;return function(_0x493251){if(_0x493251){return _0x747074['sendStatus'](_0x4ded40);}return _0x747074[_0xb865('0x19')](_0x4ded40)[_0xb865('0x1a')]();};}function respondWithResult(_0x3b844e,_0x17ce0e){_0x17ce0e=_0x17ce0e||0xc8;return function(_0x2de608){if(_0x2de608){return _0x3b844e['status'](_0x17ce0e)[_0xb865('0x1b')](_0x2de608);}};}function respondWithFilteredResult(_0x31171c,_0x5186cc){return function(_0x4a1096){if(_0x4a1096){var _0x609632=typeof _0x5186cc[_0xb865('0x1c')]===_0xb865('0x1d')&&typeof _0x5186cc[_0xb865('0x1e')]===_0xb865('0x1d');var _0x22e1ce=_0x4a1096[_0xb865('0x1f')];var _0x11ca70=_0x609632?0x0:_0x5186cc[_0xb865('0x1c')];var _0x1c731e=_0x609632?_0x4a1096[_0xb865('0x1f')]:_0x5186cc[_0xb865('0x1c')]+_0x5186cc[_0xb865('0x1e')];var _0x2f65ab;if(_0x1c731e>=_0x22e1ce){_0x1c731e=_0x22e1ce;_0x2f65ab=0xc8;}else{_0x2f65ab=0xce;}_0x31171c[_0xb865('0x19')](_0x2f65ab);return _0x31171c['set'](_0xb865('0x20'),_0x11ca70+'-'+_0x1c731e+'/'+_0x22e1ce)[_0xb865('0x1b')](_0x4a1096);}return null;};}function patchUpdates(_0x192c96){return function(_0x4b4b1e){try{jsonpatch[_0xb865('0x21')](_0x4b4b1e,_0x192c96,!![]);}catch(_0x2d1978){return BPromise[_0xb865('0x22')](_0x2d1978);}return _0x4b4b1e[_0xb865('0x23')]();};}function saveUpdates(_0x4ed93a,_0x32f34f){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384[_0xb865('0x24')](_0x4ed93a)[_0xb865('0x25')](function(_0x5b64c5){return _0x5b64c5;});}return null;};}function removeEntity(_0x4627a2,_0x4328d8){return function(_0x5619d6){if(_0x5619d6){return _0x5619d6['destroy']()['then'](function(){_0x4627a2[_0xb865('0x19')](0xcc)[_0xb865('0x1a')]();});}};}function handleEntityNotFound(_0x3cab6c,_0x3114c4){return function(_0x26c3f8){if(!_0x26c3f8){_0x3cab6c[_0xb865('0x26')](0x194);}return _0x26c3f8;};}function handleError(_0x2a1ea1,_0xc41857){_0xc41857=_0xc41857||0x1f4;return function(_0x1afb56){logger[_0xb865('0x27')](_0x1afb56[_0xb865('0x28')]);if(_0x1afb56[_0xb865('0x29')]){delete _0x1afb56[_0xb865('0x29')];}_0x2a1ea1['status'](_0xc41857)[_0xb865('0x2a')](_0x1afb56);};}exports[_0xb865('0x2b')]=function(_0x3f6342,_0x3ccfaa){var _0x584e99={},_0x1a5d2d={},_0xede933={'count':0x0,'rows':[]};var _0x462de2=_[_0xb865('0x2c')](db[_0xb865('0x2d')][_0xb865('0x2e')],function(_0x2c4501){return{'name':_0x2c4501['fieldName'],'type':_0x2c4501[_0xb865('0x2f')][_0xb865('0x30')]};});_0x1a5d2d[_0xb865('0x31')]=_[_0xb865('0x2c')](_0x462de2,_0xb865('0x29'));_0x1a5d2d[_0xb865('0x32')]=_['keys'](_0x3f6342[_0xb865('0x32')]);_0x1a5d2d[_0xb865('0x33')]=_[_0xb865('0x34')](_0x1a5d2d[_0xb865('0x31')],_0x1a5d2d[_0xb865('0x32')]);_0x584e99[_0xb865('0x35')]=_['intersection'](_0x1a5d2d[_0xb865('0x31')],qs[_0xb865('0x36')](_0x3f6342[_0xb865('0x32')][_0xb865('0x36')]));_0x584e99['attributes']=_0x584e99[_0xb865('0x35')]['length']?_0x584e99[_0xb865('0x35')]:_0x1a5d2d['model'];if(!_0x3f6342[_0xb865('0x32')][_0xb865('0x37')](_0xb865('0x38'))){_0x584e99[_0xb865('0x1e')]=qs['limit'](_0x3f6342[_0xb865('0x32')][_0xb865('0x1e')]);_0x584e99['offset']=qs[_0xb865('0x1c')](_0x3f6342[_0xb865('0x32')]['offset']);}_0x584e99[_0xb865('0x39')]=qs['sort'](_0x3f6342[_0xb865('0x32')][_0xb865('0x3a')]);_0x584e99[_0xb865('0x3b')]=qs[_0xb865('0x33')](_[_0xb865('0x3c')](_0x3f6342['query'],_0x1a5d2d[_0xb865('0x33')]),_0x462de2);if(_0x3f6342[_0xb865('0x32')]['filter']){_0x584e99[_0xb865('0x3b')]=_[_0xb865('0x3d')](_0x584e99[_0xb865('0x3b')],{'$or':_[_0xb865('0x2c')](_0x462de2,function(_0x574908){if(_0x574908[_0xb865('0x2f')]!==_0xb865('0x3e')){var _0x25b7a5={};_0x25b7a5[_0x574908[_0xb865('0x29')]]={'$like':'%'+_0x3f6342['query'][_0xb865('0x3f')]+'%'};return _0x25b7a5;}})});}_0x584e99=_[_0xb865('0x3d')]({},_0x584e99,_0x3f6342['options']);var _0x2e2f49={'where':_0x584e99[_0xb865('0x3b')]};return db[_0xb865('0x2d')][_0xb865('0x1f')](_0x2e2f49)['then'](function(_0x50ce11){_0xede933[_0xb865('0x1f')]=_0x50ce11;if(_0x3f6342[_0xb865('0x32')]['includeAll']){_0x584e99[_0xb865('0x40')]=[{'all':!![]}];}return db[_0xb865('0x2d')][_0xb865('0x41')](_0x584e99);})[_0xb865('0x25')](function(_0x2844bc){_0xede933[_0xb865('0x42')]=_0x2844bc;return _0xede933;})['then'](respondWithFilteredResult(_0x3ccfaa,_0x584e99))[_0xb865('0x43')](handleError(_0x3ccfaa,null));};exports['show']=function(_0x28dc76,_0x5cd6d8){var _0x23f744={'raw':!![],'where':{'id':_0x28dc76['params']['id']}},_0x417185={};_0x417185[_0xb865('0x31')]=_[_0xb865('0x44')](db['SmsApplication'][_0xb865('0x2e')]);_0x417185[_0xb865('0x32')]=_['keys'](_0x28dc76['query']);_0x417185[_0xb865('0x33')]=_[_0xb865('0x34')](_0x417185['model'],_0x417185['query']);_0x23f744['attributes']=_[_0xb865('0x34')](_0x417185[_0xb865('0x31')],qs[_0xb865('0x36')](_0x28dc76[_0xb865('0x32')][_0xb865('0x36')]));_0x23f744[_0xb865('0x35')]=_0x23f744[_0xb865('0x35')][_0xb865('0x45')]?_0x23f744[_0xb865('0x35')]:_0x417185[_0xb865('0x31')];if(_0x28dc76[_0xb865('0x32')][_0xb865('0x46')]){_0x23f744[_0xb865('0x40')]=[{'all':!![]}];}_0x23f744=_['merge']({},_0x23f744,_0x28dc76[_0xb865('0x47')]);return db['SmsApplication'][_0xb865('0x48')](_0x23f744)[_0xb865('0x25')](handleEntityNotFound(_0x5cd6d8,null))[_0xb865('0x25')](respondWithResult(_0x5cd6d8,null))[_0xb865('0x43')](handleError(_0x5cd6d8,null));};exports[_0xb865('0x49')]=function(_0x3eadc5,_0x395e6b){return db[_0xb865('0x2d')]['create'](_0x3eadc5[_0xb865('0x4a')],{})[_0xb865('0x25')](respondWithResult(_0x395e6b,0xc9))[_0xb865('0x43')](handleError(_0x395e6b,null));};exports[_0xb865('0x24')]=function(_0x21eea4,_0x5bfe45){if(_0x21eea4[_0xb865('0x4a')]['id']){delete _0x21eea4[_0xb865('0x4a')]['id'];}return db[_0xb865('0x2d')][_0xb865('0x48')]({'where':{'id':_0x21eea4[_0xb865('0x4b')]['id']}})[_0xb865('0x25')](handleEntityNotFound(_0x5bfe45,null))[_0xb865('0x25')](saveUpdates(_0x21eea4[_0xb865('0x4a')],null))[_0xb865('0x25')](respondWithResult(_0x5bfe45,null))[_0xb865('0x43')](handleError(_0x5bfe45,null));};exports[_0xb865('0x4c')]=function(_0x208224,_0x44992d){return db[_0xb865('0x2d')]['find']({'where':{'id':_0x208224['params']['id']}})['then'](handleEntityNotFound(_0x44992d,null))[_0xb865('0x25')](removeEntity(_0x44992d,null))[_0xb865('0x43')](handleError(_0x44992d,null));}; \ No newline at end of file +var _0x4962=['rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','include','rows','catch','show','includeAll','find','create','body','eml-format'];(function(_0x579982,_0x4efe5b){var _0x1e6345=function(_0x495f5c){while(--_0x495f5c){_0x579982['push'](_0x579982['shift']());}};_0x1e6345(++_0x4efe5b);}(_0x4962,0xda));var _0x2496=function(_0x3d237a,_0x140c2a){_0x3d237a=_0x3d237a-0x0;var _0x24e44f=_0x4962[_0x3d237a];return _0x24e44f;};'use strict';var emlformat=require(_0x2496('0x0'));var rimraf=require(_0x2496('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2496('0x2'));var rp=require('request-promise');var moment=require(_0x2496('0x3'));var BPromise=require(_0x2496('0x4'));var Mustache=require(_0x2496('0x5'));var util=require(_0x2496('0x6'));var path=require('path');var sox=require(_0x2496('0x7'));var csv=require(_0x2496('0x8'));var ejs=require(_0x2496('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2496('0xa'));var squel=require(_0x2496('0xb'));var crypto=require(_0x2496('0xc'));var jsforce=require(_0x2496('0xd'));var deskjs=require(_0x2496('0xe'));var toCsv=require(_0x2496('0x8'));var querystring=require(_0x2496('0xf'));var Papa=require(_0x2496('0x10'));var Redis=require(_0x2496('0x11'));var authService=require(_0x2496('0x12'));var qs=require(_0x2496('0x13'));var as=require(_0x2496('0x14'));var hardwareService=require(_0x2496('0x15'));var logger=require(_0x2496('0x16'))('api');var utils=require(_0x2496('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2496('0x18'));var db=require(_0x2496('0x19'))['db'];function respondWithStatusCode(_0x46fdf4,_0x4423dd){_0x4423dd=_0x4423dd||0xcc;return function(_0x23e733){if(_0x23e733){return _0x46fdf4['sendStatus'](_0x4423dd);}return _0x46fdf4[_0x2496('0x1a')](_0x4423dd)[_0x2496('0x1b')]();};}function respondWithResult(_0x22cb6f,_0x419b1a){_0x419b1a=_0x419b1a||0xc8;return function(_0x53d0da){if(_0x53d0da){return _0x22cb6f[_0x2496('0x1a')](_0x419b1a)[_0x2496('0x1c')](_0x53d0da);}};}function respondWithFilteredResult(_0xced68e,_0x18a6ae){return function(_0x457e59){if(_0x457e59){var _0x307d39=typeof _0x18a6ae[_0x2496('0x1d')]===_0x2496('0x1e')&&typeof _0x18a6ae[_0x2496('0x1f')]===_0x2496('0x1e');var _0x1ac3e9=_0x457e59['count'];var _0x341ab3=_0x307d39?0x0:_0x18a6ae[_0x2496('0x1d')];var _0x26fe80=_0x307d39?_0x457e59[_0x2496('0x20')]:_0x18a6ae[_0x2496('0x1d')]+_0x18a6ae[_0x2496('0x1f')];var _0x1d3267;if(_0x26fe80>=_0x1ac3e9){_0x26fe80=_0x1ac3e9;_0x1d3267=0xc8;}else{_0x1d3267=0xce;}_0xced68e['status'](_0x1d3267);return _0xced68e[_0x2496('0x21')]('Content-Range',_0x341ab3+'-'+_0x26fe80+'/'+_0x1ac3e9)['json'](_0x457e59);}return null;};}function patchUpdates(_0x5e25b){return function(_0x5d608b){try{jsonpatch['apply'](_0x5d608b,_0x5e25b,!![]);}catch(_0x3536dd){return BPromise[_0x2496('0x22')](_0x3536dd);}return _0x5d608b[_0x2496('0x23')]();};}function saveUpdates(_0x1f30e5,_0x2ee6a3){return function(_0x21e0e4){if(_0x21e0e4){return _0x21e0e4[_0x2496('0x24')](_0x1f30e5)['then'](function(_0x148179){return _0x148179;});}return null;};}function removeEntity(_0x44905b,_0x42ff27){return function(_0x98c59b){if(_0x98c59b){return _0x98c59b[_0x2496('0x25')]()[_0x2496('0x26')](function(){_0x44905b[_0x2496('0x1a')](0xcc)[_0x2496('0x1b')]();});}};}function handleEntityNotFound(_0x3dd60b,_0x3ad61a){return function(_0x484de6){if(!_0x484de6){_0x3dd60b[_0x2496('0x27')](0x194);}return _0x484de6;};}function handleError(_0x2bfeee,_0x5895aa){_0x5895aa=_0x5895aa||0x1f4;return function(_0x32598f){logger['error'](_0x32598f[_0x2496('0x28')]);if(_0x32598f[_0x2496('0x29')]){delete _0x32598f['name'];}_0x2bfeee[_0x2496('0x1a')](_0x5895aa)[_0x2496('0x2a')](_0x32598f);};}exports[_0x2496('0x2b')]=function(_0x5e9997,_0x217199){var _0x2b6703={},_0x3b0987={},_0x156614={'count':0x0,'rows':[]};var _0x455834=_[_0x2496('0x2c')](db[_0x2496('0x2d')][_0x2496('0x2e')],function(_0x5cda49){return{'name':_0x5cda49[_0x2496('0x2f')],'type':_0x5cda49[_0x2496('0x30')][_0x2496('0x31')]};});_0x3b0987['model']=_[_0x2496('0x2c')](_0x455834,_0x2496('0x29'));_0x3b0987['query']=_[_0x2496('0x32')](_0x5e9997[_0x2496('0x33')]);_0x3b0987[_0x2496('0x34')]=_[_0x2496('0x35')](_0x3b0987[_0x2496('0x36')],_0x3b0987['query']);_0x2b6703[_0x2496('0x37')]=_[_0x2496('0x35')](_0x3b0987[_0x2496('0x36')],qs[_0x2496('0x38')](_0x5e9997[_0x2496('0x33')][_0x2496('0x38')]));_0x2b6703[_0x2496('0x37')]=_0x2b6703[_0x2496('0x37')][_0x2496('0x39')]?_0x2b6703[_0x2496('0x37')]:_0x3b0987[_0x2496('0x36')];if(!_0x5e9997[_0x2496('0x33')][_0x2496('0x3a')]('nolimit')){_0x2b6703[_0x2496('0x1f')]=qs[_0x2496('0x1f')](_0x5e9997[_0x2496('0x33')][_0x2496('0x1f')]);_0x2b6703['offset']=qs['offset'](_0x5e9997[_0x2496('0x33')]['offset']);}_0x2b6703['order']=qs[_0x2496('0x3b')](_0x5e9997['query'][_0x2496('0x3b')]);_0x2b6703[_0x2496('0x3c')]=qs[_0x2496('0x34')](_[_0x2496('0x3d')](_0x5e9997[_0x2496('0x33')],_0x3b0987[_0x2496('0x34')]),_0x455834);if(_0x5e9997[_0x2496('0x33')]['filter']){_0x2b6703['where']=_[_0x2496('0x3e')](_0x2b6703[_0x2496('0x3c')],{'$or':_[_0x2496('0x2c')](_0x455834,function(_0x8375d2){if(_0x8375d2[_0x2496('0x30')]!=='VIRTUAL'){var _0x7887e3={};_0x7887e3[_0x8375d2[_0x2496('0x29')]]={'$like':'%'+_0x5e9997[_0x2496('0x33')][_0x2496('0x3f')]+'%'};return _0x7887e3;}})});}_0x2b6703=_[_0x2496('0x3e')]({},_0x2b6703,_0x5e9997[_0x2496('0x40')]);var _0x2a0255={'where':_0x2b6703[_0x2496('0x3c')]};return db['SmsApplication']['count'](_0x2a0255)['then'](function(_0x27a649){_0x156614[_0x2496('0x20')]=_0x27a649;if(_0x5e9997[_0x2496('0x33')]['includeAll']){_0x2b6703[_0x2496('0x41')]=[{'all':!![]}];}return db[_0x2496('0x2d')]['findAll'](_0x2b6703);})['then'](function(_0x1bc2b8){_0x156614[_0x2496('0x42')]=_0x1bc2b8;return _0x156614;})[_0x2496('0x26')](respondWithFilteredResult(_0x217199,_0x2b6703))[_0x2496('0x43')](handleError(_0x217199,null));};exports[_0x2496('0x44')]=function(_0x4fc13b,_0x200ba2){var _0x2241ce={'raw':!![],'where':{'id':_0x4fc13b['params']['id']}},_0x3e57dc={};_0x3e57dc['model']=_[_0x2496('0x32')](db[_0x2496('0x2d')][_0x2496('0x2e')]);_0x3e57dc[_0x2496('0x33')]=_[_0x2496('0x32')](_0x4fc13b['query']);_0x3e57dc[_0x2496('0x34')]=_[_0x2496('0x35')](_0x3e57dc[_0x2496('0x36')],_0x3e57dc[_0x2496('0x33')]);_0x2241ce[_0x2496('0x37')]=_[_0x2496('0x35')](_0x3e57dc['model'],qs[_0x2496('0x38')](_0x4fc13b[_0x2496('0x33')]['fields']));_0x2241ce[_0x2496('0x37')]=_0x2241ce[_0x2496('0x37')]['length']?_0x2241ce['attributes']:_0x3e57dc['model'];if(_0x4fc13b[_0x2496('0x33')][_0x2496('0x45')]){_0x2241ce[_0x2496('0x41')]=[{'all':!![]}];}_0x2241ce=_[_0x2496('0x3e')]({},_0x2241ce,_0x4fc13b[_0x2496('0x40')]);return db[_0x2496('0x2d')][_0x2496('0x46')](_0x2241ce)[_0x2496('0x26')](handleEntityNotFound(_0x200ba2,null))['then'](respondWithResult(_0x200ba2,null))[_0x2496('0x43')](handleError(_0x200ba2,null));};exports['create']=function(_0x1d30f3,_0x13a4b1){return db[_0x2496('0x2d')][_0x2496('0x47')](_0x1d30f3[_0x2496('0x48')],{})['then'](respondWithResult(_0x13a4b1,0xc9))[_0x2496('0x43')](handleError(_0x13a4b1,null));};exports[_0x2496('0x24')]=function(_0x2d4016,_0x2e6642){if(_0x2d4016['body']['id']){delete _0x2d4016['body']['id'];}return db[_0x2496('0x2d')][_0x2496('0x46')]({'where':{'id':_0x2d4016['params']['id']}})[_0x2496('0x26')](handleEntityNotFound(_0x2e6642,null))[_0x2496('0x26')](saveUpdates(_0x2d4016[_0x2496('0x48')],null))[_0x2496('0x26')](respondWithResult(_0x2e6642,null))['catch'](handleError(_0x2e6642,null));};exports[_0x2496('0x25')]=function(_0x34e57e,_0x76497b){return db[_0x2496('0x2d')]['find']({'where':{'id':_0x34e57e['params']['id']}})[_0x2496('0x26')](handleEntityNotFound(_0x76497b,null))['then'](removeEntity(_0x76497b,null))[_0x2496('0x43')](handleError(_0x76497b,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a74dff1..2c2e2b7 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 _0xbd7f=['SmsApplication','sms_applications','utf8mb4','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x2e0b45,_0x5199ee){var _0x39957f=function(_0x25f336){while(--_0x25f336){_0x2e0b45['push'](_0x2e0b45['shift']());}};_0x39957f(++_0x5199ee);}(_0xbd7f,0x78));var _0xfbd7=function(_0x58edc6,_0x5232ec){_0x58edc6=_0x58edc6-0x0;var _0x139e6c=_0xbd7f[_0x58edc6];return _0x139e6c;};'use strict';var _=require(_0xfbd7('0x0'));var util=require(_0xfbd7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfbd7('0x2'));var BPromise=require('bluebird');var rp=require(_0xfbd7('0x3'));var fs=require('fs');var path=require(_0xfbd7('0x4'));var rimraf=require(_0xfbd7('0x5'));var config=require(_0xfbd7('0x6'));var attributes=require(_0xfbd7('0x7'));module[_0xfbd7('0x8')]=function(_0x5b5b67,_0x29054c){return _0x5b5b67[_0xfbd7('0x9')](_0xfbd7('0xa'),attributes,{'tableName':_0xfbd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfbd7('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe59a=['../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x31688a,_0x588c7d){var _0xc7b088=function(_0x3ed4c8){while(--_0x3ed4c8){_0x31688a['push'](_0x31688a['shift']());}};_0xc7b088(++_0x588c7d);}(_0xe59a,0x19f));var _0xae59=function(_0x23ef7c,_0x4d1d34){_0x23ef7c=_0x23ef7c-0x0;var _0x59cc85=_0xe59a[_0x23ef7c];return _0x59cc85;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae59('0x0'))('api');var moment=require(_0xae59('0x1'));var BPromise=require(_0xae59('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae59('0x3'));var rimraf=require(_0xae59('0x4'));var config=require(_0xae59('0x5'));var attributes=require('./smsApplication.attributes');module[_0xae59('0x6')]=function(_0x30f18b,_0x5a763c){return _0x30f18b[_0xae59('0x7')](_0xae59('0x8'),attributes,{'tableName':_0xae59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae59('0xa'),'collate':_0xae59('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2508bb6..8697d0d 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 _0xe98f=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x217f25,_0x19fc66){var _0x5f241e=function(_0x2322ec){while(--_0x2322ec){_0x217f25['push'](_0x217f25['shift']());}};_0x5f241e(++_0x19fc66);}(_0xe98f,0xde));var _0xfe98=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe98f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xfe98('0x0'));var util=require('util');var moment=require(_0xfe98('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe98('0x2'));var fs=require('fs');var Redis=require(_0xfe98('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfe98('0x4'))('rpc');var config=require(_0xfe98('0x5'));var jayson=require(_0xfe98('0x6'));var client=jayson['client'][_0xfe98('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x585363,_0x39bc9f,_0x2721d1){return new BPromise(function(_0x3cbc45,_0x502d20){return client[_0xfe98('0x8')](_0x585363,_0x2721d1)[_0xfe98('0x9')](function(_0x57fc24){logger[_0xfe98('0xa')](_0xfe98('0xb'),_0x39bc9f,_0xfe98('0xc'));logger[_0xfe98('0xd')](_0xfe98('0xe'),_0x39bc9f,_0xfe98('0xc'),JSON['stringify'](_0x57fc24));if(_0x57fc24[_0xfe98('0xf')]){if(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x10')]===0x1f4){logger[_0xfe98('0xf')](_0xfe98('0xb'),_0x39bc9f,_0x57fc24['error'][_0xfe98('0x11')]);return _0x502d20(_0x57fc24[_0xfe98('0xf')]['message']);}logger[_0xfe98('0xf')]('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);return _0x3cbc45(_0x57fc24[_0xfe98('0xf')][_0xfe98('0x11')]);}else{logger['info'](_0xfe98('0xb'),_0x39bc9f,'request\x20sent');_0x3cbc45(_0x57fc24[_0xfe98('0x12')][_0xfe98('0x11')]);}})[_0xfe98('0x13')](function(_0x476932){logger['error']('SmsApplication,\x20%s,\x20%s',_0x39bc9f,_0x476932);_0x502d20(_0x476932);});});} \ No newline at end of file +var _0xa0a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis'];(function(_0x498090,_0x19dc87){var _0x5a5e73=function(_0x58ca47){while(--_0x58ca47){_0x498090['push'](_0x498090['shift']());}};_0x5a5e73(++_0x19dc87);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x57cfe0,_0x21da11){_0x57cfe0=_0x57cfe0-0x0;var _0x3c7056=_0xa0a3[_0x57cfe0];return _0x3c7056;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4719d,_0x451873,_0x1766c1){return new BPromise(function(_0x5d98d3,_0x56ee1b){return client[_0x3a0a('0xc')](_0x4719d,_0x1766c1)[_0x3a0a('0xd')](function(_0x29207e){logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));logger[_0x3a0a('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x451873,'request\x20sent',JSON[_0x3a0a('0x12')](_0x29207e));if(_0x29207e[_0x3a0a('0x13')]){if(_0x29207e['error']['code']===0x1f4){logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e['error'][_0x3a0a('0x14')]);return _0x56ee1b(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);return _0x5d98d3(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}else{logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));_0x5d98d3(_0x29207e[_0x3a0a('0x15')][_0x3a0a('0x14')]);}})['catch'](function(_0x41a6b0){logger['error'](_0x3a0a('0xf'),_0x451873,_0x41a6b0);_0x56ee1b(_0x41a6b0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index bba645e..48bd456 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 _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2a8da3,_0x4afcef){_0x2a8da3=_0x2a8da3-0x0;var _0x243236=_0xd7d1[_0x2a8da3];return _0x243236;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file +var _0xe605=['./smsInteraction.controller','get','isAuthenticated','index','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','/:id','update','delete','smsinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3127ab,_0xb61a40){var _0x17023d=function(_0x265530){while(--_0x265530){_0x3127ab['push'](_0x3127ab['shift']());}};_0x17023d(++_0xb61a40);}(_0xe605,0x92));var _0x5e60=function(_0x326863,_0x4aec5c){_0x326863=_0x326863-0x0;var _0x13d60a=_0xe605[_0x326863];return _0x13d60a;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x12')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);router[_0x5e60('0x12')](_0x5e60('0x14'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),_0x5e60('0x17')),controller[_0x5e60('0x18')]);router['put'](_0x5e60('0x19'),auth['isAuthenticated'](),interaction[_0x5e60('0x15')](_0x5e60('0x16'),'smsinteraction:update'),controller[_0x5e60('0x1a')]);router[_0x5e60('0x1b')](_0x5e60('0x19'),auth[_0x5e60('0xb')](),interaction['tracked'](_0x5e60('0x16'),_0x5e60('0x1c')),controller['destroy']);router[_0x5e60('0x1b')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x1d')]);module[_0x5e60('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index eb01064..ac28564 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 _0x4677=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x20156c,_0x12e1ff){var _0x4cb19a=function(_0x1e6a2c){while(--_0x1e6a2c){_0x20156c['push'](_0x20156c['shift']());}};_0x4cb19a(++_0x12e1ff);}(_0x4677,0x155));var _0x7467=function(_0x2e7cba,_0x316ae0){_0x2e7cba=_0x2e7cba-0x0;var _0x6f0809=_0x4677[_0x2e7cba];return _0x6f0809;};'use strict';var Sequelize=require(_0x7467('0x0'));var moment=require('moment');module[_0x7467('0x1')]={'closed':{'type':Sequelize[_0x7467('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7467('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7467('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7467('0x4')]},'note':{'type':Sequelize[_0x7467('0x4')]},'phone':{'type':Sequelize[_0x7467('0x4')]},'read1stAt':{'type':Sequelize[_0x7467('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in',_0x7467('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7467('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xcde7=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x4c080e,_0x1c1adb){var _0x2e731d=function(_0x237ee5){while(--_0x237ee5){_0x4c080e['push'](_0x4c080e['shift']());}};_0x2e731d(++_0x1c1adb);}(_0xcde7,0x65));var _0x7cde=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcde7[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x7cde('0x0')]={'closed':{'type':Sequelize[_0x7cde('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7cde('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7cde('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7cde('0x3')]},'read1stAt':{'type':Sequelize[_0x7cde('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x7cde('0x4')]('in',_0x7cde('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7cde('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7cde('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7cde('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 305bd38..ddc22e8 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 _0x854f=['search','sqlOperator','conditions','find','value','having','`\x20>\x200','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','type','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','all','rows','show','params','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','nolimit','$gte','format','findAll','addTags','setTags','spread','Tag','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','fullname','CmContact','Contact','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','mkdirSync','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','System','firstName','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','Tags','TagIds','split','forEach','catch','index','map','SmsInteraction','rawAttributes','key','name','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','pick','field','color','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','select','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','parseSearch'];(function(_0x1ee8f6,_0x1f9e2d){var _0x14b2e3=function(_0x4d4ee1){while(--_0x4d4ee1){_0x1ee8f6['push'](_0x1ee8f6['shift']());}};_0x14b2e3(++_0x1f9e2d);}(_0x854f,0x8d));var _0xf854=function(_0x507c18,_0x42008b){_0x507c18=_0x507c18-0x0;var _0x457781=_0x854f[_0x507c18];return _0x457781;};'use strict';var emlformat=require(_0xf854('0x0'));var rimraf=require(_0xf854('0x1'));var zipdir=require(_0xf854('0x2'));var jsonpatch=require(_0xf854('0x3'));var rp=require(_0xf854('0x4'));var moment=require(_0xf854('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf854('0x6'));var util=require(_0xf854('0x7'));var path=require(_0xf854('0x8'));var sox=require(_0xf854('0x9'));var csv=require(_0xf854('0xa'));var ejs=require(_0xf854('0xb'));var fs=require('fs');var fs_extra=require(_0xf854('0xc'));var _=require(_0xf854('0xd'));var squel=require(_0xf854('0xe'));var crypto=require(_0xf854('0xf'));var jsforce=require(_0xf854('0x10'));var deskjs=require(_0xf854('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf854('0x12'));var Papa=require(_0xf854('0x13'));var Redis=require(_0xf854('0x14'));var authService=require(_0xf854('0x15'));var qs=require(_0xf854('0x16'));var as=require(_0xf854('0x17'));var pdf=require(_0xf854('0x18'));var hardwareService=require(_0xf854('0x19'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf854('0x1a'));var licenseUtil=require(_0xf854('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf854('0x1c')](config[_0xf854('0x1d')],{'host':_0xf854('0x1e'),'port':0x18eb});var socket=require(_0xf854('0x1f'))(new Redis(config['redis']));require(_0xf854('0x20'))[_0xf854('0x21')](socket);function respondWithStatusCode(_0x1d4c5b,_0x3eb6b4){_0x3eb6b4=_0x3eb6b4||0xcc;return function(_0x8ebefa){if(_0x8ebefa){return _0x1d4c5b[_0xf854('0x22')](_0x3eb6b4);}return _0x1d4c5b['status'](_0x3eb6b4)[_0xf854('0x23')]();};}function respondWithResult(_0x467847,_0x4e9977){_0x4e9977=_0x4e9977||0xc8;return function(_0x141471){if(_0x141471){return _0x467847[_0xf854('0x24')](_0x4e9977)['json'](_0x141471);}};}function respondWithFilteredResult(_0x436f49,_0x4c1d21){return function(_0x4890cf){if(_0x4890cf){var _0x59cb48=typeof _0x4c1d21['offset']===_0xf854('0x25')&&typeof _0x4c1d21[_0xf854('0x26')]===_0xf854('0x25');var _0x700ec0=_0x4890cf[_0xf854('0x27')];var _0x23b9d6=_0x59cb48?0x0:_0x4c1d21['offset'];var _0x439163=_0x59cb48?_0x4890cf[_0xf854('0x27')]:_0x4c1d21[_0xf854('0x28')]+_0x4c1d21[_0xf854('0x26')];var _0x288f67;if(_0x439163>=_0x700ec0){_0x439163=_0x700ec0;_0x288f67=0xc8;}else{_0x288f67=0xce;}_0x436f49['status'](_0x288f67);return _0x436f49[_0xf854('0x29')](_0xf854('0x2a'),_0x23b9d6+'-'+_0x439163+'/'+_0x700ec0)[_0xf854('0x2b')](_0x4890cf);}return null;};}function patchUpdates(_0x3fb6ca){return function(_0x208a8b){try{jsonpatch[_0xf854('0x2c')](_0x208a8b,_0x3fb6ca,!![]);}catch(_0x4f98cd){return BPromise[_0xf854('0x2d')](_0x4f98cd);}return _0x208a8b[_0xf854('0x2e')]();};}function saveUpdates(_0x78b5e1,_0x2f5269){return function(_0xd84430){if(_0xd84430){return _0xd84430[_0xf854('0x2f')](_0x78b5e1)[_0xf854('0x30')](function(_0x469f5e){return _0x469f5e;});}return null;};}function removeEntity(_0x426e46,_0x2256ef){return function(_0x2bc010){if(_0x2bc010){return _0x2bc010[_0xf854('0x31')]()[_0xf854('0x30')](function(){_0x426e46['status'](0xcc)[_0xf854('0x23')]();});}};}function handleEntityNotFound(_0x22a54a,_0x437a8f){return function(_0x197119){if(!_0x197119){_0x22a54a['sendStatus'](0x194);}return _0x197119;};}function handleError(_0x264c92,_0x9876f1){_0x9876f1=_0x9876f1||0x1f4;return function(_0x50a7bb){logger[_0xf854('0x32')](_0x50a7bb[_0xf854('0x33')]);if(_0x50a7bb['name']){delete _0x50a7bb['name'];}_0x264c92[_0xf854('0x24')](_0x9876f1)[_0xf854('0x34')](_0x50a7bb);};}function getInteractionUsers(_0x14d3d2,_0xd4fee3){return new BPromise(function(_0x390284,_0x3f1a73){try{if(_0xd4fee3[_0x14d3d2['id']]){_0x14d3d2['Users']=_['map'](_0xd4fee3[_0x14d3d2['id']],function(_0x497c1f){return{'id':_0x497c1f['id'],'fullname':_0x497c1f['fullname']};});}}catch(_0x5d7be9){_0x3f1a73(_0x5d7be9);}_0x390284(_0x14d3d2);});}function getInteractionTags(_0x115102,_0x301bc5){return new BPromise(function(_0x4432af,_0x108395){try{if(_0x115102['TagIds']){_0x115102[_0xf854('0x35')]=[];_0x115102[_0xf854('0x36')][_0xf854('0x37')](',')[_0xf854('0x38')](function(_0xe76702){_0x115102[_0xf854('0x35')]['push'](_0x301bc5[_0xe76702]);});}delete _0x115102[_0xf854('0x36')];}catch(_0x453303){_0x108395(_0x453303);}_0x4432af(_0x115102);});}function updateSmsInteraction(_0x1b4a49,_0x1758e9,_0x37d283){return new BPromise(function(_0x109d1f,_0x17337f){return getInteractionUsers(_0x1b4a49,_0x37d283)[_0xf854('0x30')](function(_0x505430){return getInteractionTags(_0x505430,_0x1758e9);})[_0xf854('0x30')](function(_0x227f35){_0x109d1f(_0x227f35);})[_0xf854('0x39')](function(_0x3fc499){_0x17337f(_0x3fc499);});});}exports[_0xf854('0x3a')]=function(_0x2e8068,_0x2e23f4){var _0x183974={},_0x4fd685={},_0x10283e={'count':0x0,'rows':[]};var _0x31a043=_[_0xf854('0x3b')](db[_0xf854('0x3c')][_0xf854('0x3d')],function(_0x43b58c){return{'name':_0x43b58c['fieldName'],'type':_0x43b58c['type'][_0xf854('0x3e')]};});_0x4fd685['model']=_[_0xf854('0x3b')](_0x31a043,_0xf854('0x3f'));_0x4fd685['query']=_[_0xf854('0x40')](_0x2e8068[_0xf854('0x41')]);_0x4fd685[_0xf854('0x42')]=_[_0xf854('0x43')](_0x4fd685['model'],_0x4fd685['query']);_0x183974[_0xf854('0x44')]=_[_0xf854('0x43')](_0x4fd685[_0xf854('0x45')],qs['fields'](_0x2e8068[_0xf854('0x41')][_0xf854('0x46')]));_0x183974['attributes']=_0x183974['attributes'][_0xf854('0x47')]?_0x183974[_0xf854('0x44')]:_0x4fd685['model'];if(!_0x2e8068[_0xf854('0x41')][_0xf854('0x48')]('nolimit')){_0x183974['limit']=qs[_0xf854('0x26')](_0x2e8068[_0xf854('0x41')]['limit']);_0x183974['offset']=qs[_0xf854('0x28')](_0x2e8068['query'][_0xf854('0x28')]);}_0x183974['order']=qs[_0xf854('0x49')](_0x2e8068[_0xf854('0x41')]['sort']);_0x183974['where']=qs[_0xf854('0x42')](_[_0xf854('0x4a')](_0x2e8068[_0xf854('0x41')],_0x4fd685['filters']),_0x31a043);var _0x39b9ae=[];var _0x274201=squel['select']()[_0xf854('0x4b')]('id')[_0xf854('0x4b')](_0xf854('0x3f'))[_0xf854('0x4b')](_0xf854('0x4c'))[_0xf854('0x4d')]('tools_tags');var _0x4576ed=squel['select']()[_0xf854('0x4b')](_0xf854('0x4e'))[_0xf854('0x4b')](_0xf854('0x4f'))['field'](_0xf854('0x50'))[_0xf854('0x4d')](_0xf854('0x51'),'ui')[_0xf854('0x52')]('users','u',_0xf854('0x53'));var _0x57ecb5=squel[_0xf854('0x54')]()[_0xf854('0x4d')]('sms_interactions','i')[_0xf854('0x52')](_0xf854('0x55'),'c',_0xf854('0x56'))[_0xf854('0x52')](_0xf854('0x57'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xf854('0x58'),'a',_0xf854('0x59'))[_0xf854('0x52')](_0xf854('0x5a'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xf854('0x52')](_0xf854('0x5b'),'it',_0xf854('0x5c'))[_0xf854('0x52')](_0xf854('0x5d'),'t','t.id\x20=\x20it.TagId');var _0x5204b8=squel[_0xf854('0x5e')]();var _0x5bf69e=[];var _0x33effd=squel[_0xf854('0x5e')]();var _0xe5bd0b;if(_0x2e8068[_0xf854('0x41')]['search']){_0xe5bd0b=as[_0xf854('0x5f')](_0x2e8068[_0xf854('0x41')][_0xf854('0x60')]);var _0x51258c=_0xe5bd0b[_0xf854('0x61')];for(var _0x131807=0x0;_0x131807<_0xe5bd0b['conditions'][_0xf854('0x47')];_0x131807++){var _0x27dd2b=_0xe5bd0b[_0xf854('0x62')][_0x131807];var _0x2c38e9='i';var _0x5f108b=_[_0xf854('0x63')](_0x31a043,[_0xf854('0x3f'),_0x27dd2b[_0xf854('0x4b')]]);if(!_0x5f108b){switch(_0x27dd2b[_0xf854('0x4b')]){case'unreadMessages':if(_0x27dd2b[_0xf854('0x64')]==0x1){_0x57ecb5[_0xf854('0x65')]('`'+_0x27dd2b[_0xf854('0x4b')]+'`\x20=\x200');}else{_0x57ecb5['having']('`'+_0x27dd2b['field']+_0xf854('0x66'));}break;case'Contact':if(_0x27dd2b['operator']==='$substring'){if(_0x27dd2b[_0xf854('0x64')]['split']('\x20')['length']>0x1){_0x5204b8[_0x51258c](_0xf854('0x67'),qs[_0xf854('0x68')](_0x27dd2b[_0xf854('0x64')]),null);}else{var _0x2d7ea1='%'+_0x27dd2b['value']+'%';_0x5204b8[_0x51258c](_0xf854('0x69'),_0x2d7ea1,_0x2d7ea1,_0x2d7ea1);}}else{_0x5f108b=_[_0xf854('0x63')](_0x31a043,[_0xf854('0x3f'),_0xf854('0x6a')]);_0x27dd2b[_0xf854('0x4b')]=_0xf854('0x6a');_0x11a196=as[_0xf854('0x6b')](_0x2c38e9,_0x5f108b[_0xf854('0x6c')],_0x27dd2b);_0x5204b8[_0x51258c](_0x11a196['text'],_0x11a196[_0xf854('0x64')]['start'],_0x11a196[_0xf854('0x64')][_0xf854('0x23')]);}break;case'Tag':var _0x116d4e=_0x27dd2b[_0xf854('0x64')]['split'](',')['map'](function(_0x5af10f){return Number(_0x5af10f);});_0x116d4e[_0xf854('0x38')](function(_0x6325b){_0x33effd['or'](_0xf854('0x6d'),'%,'+_0x6325b+',%');});_0x5bf69e=_[_0xf854('0x6e')](_0x5bf69e,_0x116d4e);break;case _0xf854('0x6f'):if(_0x27dd2b[_0xf854('0x70')]===_0xf854('0x71')){_0x5204b8[_0x51258c](_0xf854('0x72'),'%'+_0x27dd2b[_0xf854('0x64')]+'%',null);}else{_0x5f108b=_[_0xf854('0x63')](_0x31a043,['name','UserId']);_0x27dd2b['field']='UserId';_0x11a196=as[_0xf854('0x6b')](_0x2c38e9,_0x5f108b[_0xf854('0x6c')],_0x27dd2b);_0x5204b8[_0x51258c](_0x11a196[_0xf854('0x73')],_0x11a196[_0xf854('0x64')][_0xf854('0x74')],_0x11a196[_0xf854('0x64')][_0xf854('0x23')]);}break;case _0xf854('0x75'):_0x11a196=as[_0xf854('0x6b')]('me',null,_0x27dd2b);_0x5204b8[_0x51258c](_0x11a196['text'],_0x11a196[_0xf854('0x64')]['start'],_0x11a196[_0xf854('0x64')][_0xf854('0x23')]);break;}}else{var _0x11a196=as[_0xf854('0x6b')](_0x2c38e9,_0x5f108b[_0xf854('0x6c')],_0x27dd2b);_0x5204b8[_0x51258c](_0x11a196[_0xf854('0x73')],_0x11a196[_0xf854('0x64')]['start'],_0x11a196[_0xf854('0x64')][_0xf854('0x23')]);}}}else{var _0x3342a1=_(_0x2e8068[_0xf854('0x41')])[_0xf854('0x40')]()[_0xf854('0x3b')](function(_0x5b321f){return _[_0xf854('0x76')](_0x31a043,[_0xf854('0x3f'),_0x5b321f])?_0x5b321f:undefined;})[_0xf854('0x77')]()[_0xf854('0x64')]();if(!_[_0xf854('0x78')](_0x3342a1)){_0x3342a1[_0xf854('0x38')](function(_0x2fcd4d){if(_0x2fcd4d===_0xf854('0x79')){_0x57ecb5['where'](_0xf854('0x7a'),[]['concat'](_0x2e8068[_0xf854('0x41')][_0x2fcd4d]));}else if(_0x2fcd4d==='createdAt'){var _0x3b3c67=JSON[_0xf854('0x7b')](_0x2e8068[_0xf854('0x41')][_0x2fcd4d])['$gte'];var _0xe28e0d=JSON[_0xf854('0x7b')](_0x2e8068['query'][_0x2fcd4d])['$lte'];_0x57ecb5[_0xf854('0x7c')](_0xf854('0x7d'),_0x3b3c67,_0xe28e0d);}else{if(_0x2e8068[_0xf854('0x41')][_0x2fcd4d]===_0xf854('0x7e')){_0x57ecb5[_0xf854('0x7c')]('i.'+_0x2fcd4d+_0xf854('0x7f'));}else{_0x57ecb5[_0xf854('0x7c')]('i.'+_0x2fcd4d+_0xf854('0x80'),_0x2e8068['query'][_0x2fcd4d]);}}});}if(_0x2e8068[_0xf854('0x41')][_0xf854('0x81')]){if(_0x2e8068[_0xf854('0x41')][_0xf854('0x81')]==0x1){_0x57ecb5['having'](_0xf854('0x82'));}else{_0x57ecb5[_0xf854('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x2e8068[_0xf854('0x41')][_0xf854('0x83')]){_0x5bf69e=_[_0xf854('0x84')](_0x2e8068[_0xf854('0x41')][_0xf854('0x83')])?_0x2e8068['query'][_0xf854('0x83')]:new Array(_0x2e8068[_0xf854('0x41')][_0xf854('0x83')]);_0x5bf69e[_0xf854('0x38')](function(_0x3f249e){_0x33effd['or'](_0xf854('0x6d'),'%,'+_0x3f249e+',%');});}if(_0x2e8068[_0xf854('0x41')]['filter']){var _0x5aba1c=_0x2e8068['query'][_0xf854('0x85')]['replace']('\x5c','\x5c\x5c')[_0xf854('0x86')](/'/g,'\x27\x27');if(qs[_0xf854('0x87')](_0x5aba1c)){_0x5204b8['or'](_0xf854('0x88'),_0x5aba1c+'%')['or'](_0xf854('0x89'),_0x5aba1c+'%');}else{_0x5204b8['or'](_0xf854('0x8a'),qs['getFullTextValue'](_0x5aba1c))['or'](_0xf854('0x8b'),_0x5aba1c+'%');}}}_0x57ecb5[_0xf854('0x7c')](_0x5204b8);_0x57ecb5[_0xf854('0x8c')](_0xf854('0x8d'));var _0x9041a1={'type':db[_0xf854('0x8e')]['QueryTypes'][_0xf854('0x8f')],'raw':!![]};var _0x1c708f=_0x57ecb5[_0xf854('0x90')]();_0x1c708f[_0xf854('0x4b')](_0xf854('0x8d'));_0x1c708f[_0xf854('0x4b')](_0xf854('0x91'),_0xf854('0x92'));if(_0x183974['order']){_0x183974[_0xf854('0x93')][_0xf854('0x38')](function(_0x304e59){var _0x19b652=_0x304e59[0x0]===_0xf854('0x94')?_0x304e59[0x0]:'i.'+_0x304e59[0x0];_0x57ecb5[_0xf854('0x93')](_0x19b652,_0x304e59[0x1]===_0xf854('0x95')?![]:!![]);});}if(!_[_0xf854('0x78')](_0x5bf69e)){_0x57ecb5[_0xf854('0x65')](_0x33effd);_0x1c708f[_0xf854('0x7c')]('t.id\x20IN\x20?',_0x5bf69e);}BPromise[_0xf854('0x96')]()[_0xf854('0x30')](function(){if(!_0xe5bd0b){if(_0x2e8068[_0xf854('0x41')][_0xf854('0x79')])return;_0x1c708f['where'](_0xf854('0x97'));_0x57ecb5['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2e8068[_0xf854('0x98')][_0xf854('0x99')]!==_0xf854('0x9a'))return;return _0x2e8068['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x26925a){if(_[_0xf854('0x78')](_0x26925a)){_0x1c708f[_0xf854('0x7c')](_0xf854('0x9b'));_0x57ecb5[_0xf854('0x7c')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x1c708f[_0xf854('0x7c')]('i.SmsAccountId\x20IN\x20?',_[_0xf854('0x3b')](_0x26925a,'id'));_0x57ecb5['where']('i.SmsAccountId\x20IN\x20?',_[_0xf854('0x3b')](_0x26925a,'id'));}});})['then'](function(){if(_0x2e8068[_0xf854('0x98')][_0xf854('0x99')]===_0xf854('0x9a')&&!_0xe5bd0b&&!_0x2e8068['query'][_0xf854('0x79')])return[];return db[_0xf854('0x9c')]['query'](_0x1c708f[_0xf854('0x9d')](),_0x9041a1);})['then'](function(_0x22c512){_0x10283e[_0xf854('0x27')]=_0x22c512[_0xf854('0x47')];if(_0x10283e[_0xf854('0x27')]===0x0)return[];return db[_0xf854('0x9c')][_0xf854('0x41')](_0x274201[_0xf854('0x9d')](),_0x9041a1)[_0xf854('0x30')](function(_0x3a9856){_0x39b9ae=_['keyBy'](_0x3a9856,'id');_0x9041a1=_[_0xf854('0x9e')](_0x9041a1,{'model':db[_0xf854('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e8068['query'][_0xf854('0x46')]){_0x183974['attributes'][_0xf854('0x38')](function(_0x3a844b){_0x57ecb5[_0xf854('0x4b')]('i.'+_0x3a844b);});}else{_0x57ecb5[_0xf854('0x4b')](_0xf854('0x91'),_0xf854('0x92'));_0x57ecb5['field'](_0xf854('0x9f'),'Account.key');_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa0'),_0xf854('0xa1'));_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa2'),'contactName');_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa3'));_0x57ecb5['field'](_0xf854('0xa4'),'Contact.firstName');_0x57ecb5[_0xf854('0x4b')]('c.lastName',_0xf854('0xa5'));_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa6'),'Contact.email');_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa7'),_0xf854('0xa8'));_0x57ecb5[_0xf854('0x4b')]('c.mobile','Contact.mobile');_0x57ecb5[_0xf854('0x4b')](_0xf854('0xa9'),'Contact.fax');_0x57ecb5[_0xf854('0x4b')](_0xf854('0xaa'),_0xf854('0xab'));_0x57ecb5[_0xf854('0x4b')](_0xf854('0xac'),_0xf854('0xad'));_0x57ecb5[_0xf854('0x4b')](_0xf854('0xae'),_0xf854('0x36'));}if(_0x183974[_0xf854('0x26')])_0x57ecb5['limit'](_0x183974[_0xf854('0x26')]);if(_0x183974[_0xf854('0x28')])_0x57ecb5[_0xf854('0x28')](_0x183974[_0xf854('0x28')]);return db[_0xf854('0x9c')][_0xf854('0x41')](_0x57ecb5[_0xf854('0x9d')](),_0x9041a1);})[_0xf854('0x30')](function(_0x45a91d){if(_0x45a91d[_0xf854('0x47')]>0x0)_0x4576ed[_0xf854('0x7c')](_0xf854('0xaf'),_['map'](_0x45a91d,'id'));return db['sequelize']['query'](_0x4576ed[_0xf854('0x9d')](),_0x9041a1)[_0xf854('0x30')](function(_0x1fd249){var _0x2d63ec=_['groupBy'](_0x1fd249,_0xf854('0xb0'));var _0x350899=[];_0x45a91d[_0xf854('0x38')](function(_0x1c833a){_0x350899[_0xf854('0xb1')](updateSmsInteraction(_0x1c833a,_0x39b9ae,_0x2d63ec));});return BPromise[_0xf854('0xb2')](_0x350899);});});})[_0xf854('0x30')](function(_0x26b4da){_0x10283e[_0xf854('0xb3')]=_0x26b4da;return _0x10283e;})[_0xf854('0x30')](respondWithFilteredResult(_0x2e23f4,_0x183974))[_0xf854('0x39')](handleError(_0x2e23f4,null));};exports[_0xf854('0xb4')]=function(_0x29baa5,_0x53ad88){var _0x34412e={'raw':![],'where':{'id':_0x29baa5[_0xf854('0xb5')]['id']}},_0x542ed2={};_0x542ed2['model']=_['keys'](db['SmsInteraction'][_0xf854('0x3d')]);_0x542ed2[_0xf854('0x41')]=_[_0xf854('0x40')](_0x29baa5['query']);_0x542ed2[_0xf854('0x42')]=_[_0xf854('0x43')](_0x542ed2['model'],_0x542ed2['query']);_0x34412e[_0xf854('0x44')]=_[_0xf854('0x43')](_0x542ed2[_0xf854('0x45')],qs['fields'](_0x29baa5[_0xf854('0x41')][_0xf854('0x46')]));_0x34412e['attributes']=_0x34412e[_0xf854('0x44')][_0xf854('0x47')]?_0x34412e['attributes']:_0x542ed2[_0xf854('0x45')];if(_0x29baa5['query']['includeAll']){_0x34412e[_0xf854('0xb6')]=[{'all':!![]}];}_0x34412e=_['merge']({},_0x34412e,_0x29baa5[_0xf854('0xb7')]);return db['SmsInteraction'][_0xf854('0x63')](_0x34412e)['then'](handleEntityNotFound(_0x53ad88,null))[_0xf854('0x30')](respondWithResult(_0x53ad88,null))[_0xf854('0x39')](handleError(_0x53ad88,null));};exports[_0xf854('0xb8')]=function(_0x214a54,_0xd26659){return db[_0xf854('0x3c')][_0xf854('0xb8')](_0x214a54[_0xf854('0x75')],{})[_0xf854('0x30')](respondWithResult(_0xd26659,0xc9))[_0xf854('0x39')](handleError(_0xd26659,null));};exports[_0xf854('0x2f')]=function(_0x40125b,_0x3613a2){if(_0x40125b[_0xf854('0x75')]['id']){delete _0x40125b['body']['id'];}return db[_0xf854('0x3c')][_0xf854('0x63')]({'where':{'id':_0x40125b[_0xf854('0xb5')]['id']}})['then'](handleEntityNotFound(_0x3613a2,null))[_0xf854('0x30')](saveUpdates(_0x40125b[_0xf854('0x75')],null))[_0xf854('0x30')](respondWithResult(_0x3613a2,null))[_0xf854('0x39')](handleError(_0x3613a2,null));};exports[_0xf854('0x31')]=function(_0x38214c,_0x18cb48){return db[_0xf854('0x3c')][_0xf854('0x63')]({'where':{'id':_0x38214c[_0xf854('0xb5')]['id']}})[_0xf854('0x30')](handleEntityNotFound(_0x18cb48,null))[_0xf854('0x30')](removeEntity(_0x18cb48,null))['catch'](handleError(_0x18cb48,null));};exports[_0xf854('0xb9')]=function(_0x5efeb5,_0x24ffcc){return db['SmsInteraction'][_0xf854('0xb9')]()[_0xf854('0x30')](respondWithResult(_0x24ffcc,null))['catch'](handleError(_0x24ffcc,null));};exports[_0xf854('0xba')]=function(_0x52dccb,_0x5120d5,_0x1c226e){return db['SmsMessage'][_0xf854('0x63')]({'where':{'id':_0x52dccb[_0xf854('0xb5')]['id']}})[_0xf854('0x30')](handleEntityNotFound(_0x5120d5,null))[_0xf854('0x30')](function(_0x5ee043){if(_0x5ee043){return _0x5ee043[_0xf854('0xba')](_0x52dccb[_0xf854('0x75')][_0xf854('0xbb')],_[_0xf854('0xbc')](_0x52dccb[_0xf854('0x75')],[_0xf854('0xbb'),'id'])||{});}})[_0xf854('0x30')](respondWithResult(_0x5120d5,null))['catch'](handleError(_0x5120d5,null));};exports[_0xf854('0xbd')]=function(_0x4cf486,_0x594cf5,_0x2ece0f){var _0x24b9e7={'raw':![],'where':{}};var _0x5ce798={};var _0x1d56a6={'count':0x0,'rows':[]};return db[_0xf854('0x3c')][_0xf854('0xbe')]({'where':{'id':_0x4cf486[_0xf854('0xb5')]['id']}})[_0xf854('0x30')](handleEntityNotFound(_0x594cf5,null))['then'](function(_0x207cdd){if(_0x207cdd){_0x5ce798[_0xf854('0x45')]=_[_0xf854('0x40')](db[_0xf854('0xbf')][_0xf854('0x3d')]);_0x5ce798[_0xf854('0x41')]=_[_0xf854('0x40')](_0x4cf486[_0xf854('0x41')]);_0x5ce798['filters']=_[_0xf854('0x43')](_0x5ce798['model'],_0x5ce798['query']);_0x24b9e7[_0xf854('0x44')]=_[_0xf854('0x43')](_0x5ce798['model'],qs[_0xf854('0x46')](_0x4cf486[_0xf854('0x41')][_0xf854('0x46')]));_0x24b9e7[_0xf854('0x44')]=_0x24b9e7[_0xf854('0x44')][_0xf854('0x47')]?_0x24b9e7[_0xf854('0x44')]:_0x5ce798[_0xf854('0x45')];if(!_0x4cf486[_0xf854('0x41')][_0xf854('0x48')](_0xf854('0xc0'))){_0x24b9e7[_0xf854('0x26')]=qs[_0xf854('0x26')](_0x4cf486['query'][_0xf854('0x26')]);_0x24b9e7[_0xf854('0x28')]=qs[_0xf854('0x28')](_0x4cf486['query'][_0xf854('0x28')]);}_0x24b9e7[_0xf854('0x93')]=qs['sort'](_0x4cf486['query'][_0xf854('0x49')]);_0x24b9e7[_0xf854('0x7c')]=qs['filters'](_['pick'](_0x4cf486['query'],_0x5ce798[_0xf854('0x42')]));_0x24b9e7['where']['SmsInteractionId']=_0x207cdd['id'];if(_0x4cf486['query'][_0xf854('0x85')]){_0x24b9e7[_0xf854('0x7c')]=_[_0xf854('0x9e')](_0x24b9e7['where'],{'$or':_['map'](_0x24b9e7[_0xf854('0x44')],function(_0x27237e){var _0x4db8f8={};_0x4db8f8[_0x27237e]={'$like':'%'+_0x4cf486[_0xf854('0x41')]['filter']+'%'};return _0x4db8f8;})});}if(_0x4cf486['query'][_0xf854('0xc1')]){var _0x2b636c=_0x4cf486[_0xf854('0x41')][_0xf854('0xc1')][_0xf854('0x37')](',');var _0x3e7def={};_0x3e7def[_0x2b636c[0x0]]={'$gte':moment(_0x2b636c[0x1])[_0xf854('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x24b9e7[_0xf854('0x7c')]=_[_0xf854('0x9e')](_0x24b9e7[_0xf854('0x7c')],_0x3e7def);}_0x24b9e7=_[_0xf854('0x9e')]({},_0x24b9e7,_0x4cf486[_0xf854('0xb7')]);return db[_0xf854('0xbf')]['count']({'where':_0x24b9e7[_0xf854('0x7c')]})['then'](function(_0x437107){_0x1d56a6[_0xf854('0x27')]=_0x437107;if(_0x4cf486[_0xf854('0x41')]['includeAll']){_0x24b9e7[_0xf854('0xb6')]=[{'all':!![]}];}return db['SmsMessage'][_0xf854('0xc3')](_0x24b9e7);})[_0xf854('0x30')](function(_0x39aca7){_0x1d56a6['rows']=_0x39aca7;return _0x1d56a6;});}})[_0xf854('0x30')](respondWithFilteredResult(_0x594cf5,_0x24b9e7))[_0xf854('0x39')](handleError(_0x594cf5,null));};exports[_0xf854('0xc4')]=function(_0x446b8f,_0xd0357b,_0x127fa1){return db[_0xf854('0x3c')]['find']({'where':{'id':_0x446b8f[_0xf854('0xb5')]['id']}})[_0xf854('0x30')](handleEntityNotFound(_0xd0357b,null))[_0xf854('0x30')](function(_0x4d8840){if(_0x4d8840){return _0x4d8840[_0xf854('0xc5')](_0x446b8f[_0xf854('0x75')][_0xf854('0xbb')],_[_0xf854('0xbc')](_0x446b8f[_0xf854('0x75')],['ids','id'])||{})[_0xf854('0xc6')](function(){return db[_0xf854('0xc7')][_0xf854('0xc3')]({'attributes':['id',_0xf854('0x3f'),_0xf854('0x4c')],'where':{'id':_0x446b8f['body'][_0xf854('0xbb')]}});})[_0xf854('0x30')](function(_0x12d4bb){socket['emit']('smsInteractionTags:save',{'id':Number(_0x446b8f[_0xf854('0xb5')]['id']),'tags':_0x12d4bb||[]});return{'id':Number(_0x446b8f[_0xf854('0xb5')]['id']),'tags':_0x12d4bb||[]};});}})['then'](respondWithResult(_0xd0357b,null))['catch'](handleError(_0xd0357b,null));};exports['removeTags']=function(_0x47caa4,_0x4dc60b,_0x2cbc1f){return db[_0xf854('0x3c')][_0xf854('0x63')]({'where':{'id':_0x47caa4[_0xf854('0xb5')]['id']}})[_0xf854('0x30')](handleEntityNotFound(_0x4dc60b,null))[_0xf854('0x30')](function(_0x159c40){if(_0x159c40){return _0x159c40[_0xf854('0xc8')](_0x47caa4['query'][_0xf854('0xbb')]);}})[_0xf854('0x30')](respondWithStatusCode(_0x4dc60b,null))[_0xf854('0x39')](handleError(_0x4dc60b,null));};exports[_0xf854('0xc9')]=function(_0x3f3077,_0xe21e2d){var _0x5bf498=moment()[_0xf854('0xca')]()['toString']();var _0x3d931e=path[_0xf854('0xcb')](config[_0xf854('0xcc')],_0xf854('0xcd'),_0xf854('0xce'),'tmp');var _0x14ad8d=path[_0xf854('0xcb')](config['root'],'server',_0xf854('0xce'),'attachments');var _0x26fc84=path['join'](_0x3d931e,_0x5bf498);var _0x47d64b=util[_0xf854('0xc2')](_0xf854('0xcf'),_0x3f3077['params']['id'],_0x5bf498);var _0xea46d6=path[_0xf854('0xcb')](_0x3d931e,_0x47d64b);var _0x34dbb5=[];_0x34dbb5['push']({'model':db['User'],'as':'User','attributes':['id',_0xf854('0xd0')],'raw':!![]});_0x34dbb5['push']({'model':db[_0xf854('0xd1')],'as':_0xf854('0xd2'),'attributes':['id','firstName',_0xf854('0xd3')],'raw':!![]});var _0xf7adcb=[{'model':db['SmsMessage'],'as':_0xf854('0xd4'),'attributes':['id',_0xf854('0x75'),_0xf854('0xd5'),_0xf854('0xd6'),_0xf854('0xd7'),_0xf854('0x81')],'include':_0x34dbb5}];_0xf7adcb[_0xf854('0xb1')]({'model':db[_0xf854('0xd8')],'as':_0xf854('0xd9'),'attributes':['id',_0xf854('0x3f')]});_0xf7adcb['push']({'model':db[_0xf854('0x6f')],'as':_0xf854('0xda'),'attributes':['id',_0xf854('0xd0')]});return db['SmsInteraction']['find']({'where':{'id':_0x3f3077[_0xf854('0xb5')]['id']},'include':_0xf7adcb})[_0xf854('0x30')](handleEntityNotFound(_0xe21e2d,null))[_0xf854('0x30')](function(_0x484bc3){if(_0x484bc3){var _0x1791b6=_0x484bc3['get']({'plain':!![]});fs[_0xf854('0xdb')](_0x26fc84);var _0xf81789={'channel':_0xf854('0xdc'),'account':_0x1791b6['Account'][_0xf854('0x3f')],'agent':_0x1791b6[_0xf854('0xda')]?_0x1791b6[_0xf854('0xda')][_0xf854('0xd0')]:'N.A.','createdAt':moment(_0x1791b6[_0xf854('0xd5')])[_0xf854('0xc2')](_0xf854('0xdd'))['toString'](),'closedAt':_0x1791b6[_0xf854('0xde')]?moment(_0x1791b6[_0xf854('0xdf')])[_0xf854('0xc2')](_0xf854('0xdd'))[_0xf854('0x9d')]():'','disposition':_0x1791b6[_0xf854('0xe0')],'messages':_(_0x1791b6[_0xf854('0xd4')])['filter']({'secret':![]})['map'](function(_0x1a9bd9){return{'date':moment(_0x1a9bd9[_0xf854('0xd5')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf854('0x9d')](),'sender':_0x1a9bd9[_0xf854('0xd6')]==='out'?_0x1a9bd9[_0xf854('0x6f')]?_0x1a9bd9[_0xf854('0x6f')][_0xf854('0xd0')]:_0xf854('0xe1'):_0x1a9bd9[_0xf854('0xd2')][_0xf854('0xe2')]+(_0x1a9bd9['Contact'][_0xf854('0xd3')]?'\x20'+_0x1a9bd9[_0xf854('0xd2')]['lastName']:''),'body':_0x1a9bd9[_0xf854('0x75')],'direction':_0x1a9bd9[_0xf854('0xd6')]===_0xf854('0xe3')?'A':'C','secret':_0x1a9bd9[_0xf854('0xd7')],'read':_0x1a9bd9[_0xf854('0x81')]};})['value']()};return ejs[_0xf854('0xe4')](path[_0xf854('0xcb')](config[_0xf854('0xcc')],_0xf854('0xcd'),_0xf854('0xe5'),_0xf854('0xe6')),{'interaction':_0xf81789})[_0xf854('0x30')](function(_0x514bfc){var _0x3220fe=path[_0xf854('0xcb')](_0x26fc84,_0xf854('0xe7')+_0x1791b6['id']+'-'+_0x5bf498+_0xf854('0xe8'));var _0x223493={'path':_0x3220fe,'channel':'Sms','interactionId':_0x1791b6['id']};return pdf[_0xf854('0xe9')](_0x514bfc,_0x223493);})[_0xf854('0x30')](function(){return new BPromise(function(_0x43e620,_0xbe2b9a){zipdir(_0x26fc84,{'saveTo':_0xea46d6},function(_0x596a41,_0x4f873d){if(_0x596a41)return _0xbe2b9a(_0x596a41);return _0x43e620(_0x4f873d);});})[_0xf854('0x30')](function(){return new BPromise(function(_0x3f8886,_0x438f2d){rimraf(_0x26fc84,function(_0x450248){if(_0x450248)_0x438f2d(_0x450248);return _0x3f8886();});});})['then'](function(){return _0xe21e2d[_0xf854('0xc9')](_0xea46d6,_0x47d64b,function(_0x1d176d){if(_0x1d176d){console[_0xf854('0xea')](_0xf854('0xeb'),_0x1d176d);}else{fs[_0xf854('0xec')](_0xea46d6);}});});});}else{return _0xe21e2d[_0xf854('0x22')](0xc8);}})[_0xf854('0x39')](handleError(_0xe21e2d,null));}; \ No newline at end of file +var _0x0536=['then','error','stack','name','Users','map','TagIds','Tags','split','forEach','push','catch','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','length','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','t.id\x20IN\x20?','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','show','params','keys','includeAll','include','merge','options','create','update','body','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','SmsInteractionId','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','User','Contact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','Sms','fullname','closed','closedAt','disposition','System','out','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x2fcd6e,_0xc2f135){var _0x7789a3=function(_0x2ea41b){while(--_0x2ea41b){_0x2fcd6e['push'](_0x2fcd6e['shift']());}};_0x7789a3(++_0xc2f135);}(_0x0536,0xc6));var _0x6053=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0536[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x6053('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6053('0x1'));var rp=require(_0x6053('0x2'));var moment=require('moment');var BPromise=require(_0x6053('0x3'));var Mustache=require(_0x6053('0x4'));var util=require('util');var path=require(_0x6053('0x5'));var sox=require(_0x6053('0x6'));var csv=require(_0x6053('0x7'));var ejs=require(_0x6053('0x8'));var fs=require('fs');var fs_extra=require(_0x6053('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6053('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6053('0xb'));var toCsv=require(_0x6053('0x7'));var querystring=require(_0x6053('0xc'));var Papa=require('papaparse');var Redis=require(_0x6053('0xd'));var authService=require(_0x6053('0xe'));var qs=require(_0x6053('0xf'));var as=require(_0x6053('0x10'));var pdf=require(_0x6053('0x11'));var hardwareService=require(_0x6053('0x12'));var logger=require(_0x6053('0x13'))(_0x6053('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6053('0x15'));var db=require(_0x6053('0x16'))['db'];config[_0x6053('0x17')]=_[_0x6053('0x18')](config[_0x6053('0x17')],{'host':_0x6053('0x19'),'port':0x18eb});var socket=require(_0x6053('0x1a'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5c1af6,_0x4b7076){_0x4b7076=_0x4b7076||0xcc;return function(_0x2715cc){if(_0x2715cc){return _0x5c1af6[_0x6053('0x1b')](_0x4b7076);}return _0x5c1af6[_0x6053('0x1c')](_0x4b7076)[_0x6053('0x1d')]();};}function respondWithResult(_0x57c5be,_0x2bd932){_0x2bd932=_0x2bd932||0xc8;return function(_0x32dcd8){if(_0x32dcd8){return _0x57c5be[_0x6053('0x1c')](_0x2bd932)[_0x6053('0x1e')](_0x32dcd8);}};}function respondWithFilteredResult(_0x52a36d,_0x10400d){return function(_0x50f10d){if(_0x50f10d){var _0x40022d=typeof _0x10400d[_0x6053('0x1f')]===_0x6053('0x20')&&typeof _0x10400d['limit']==='undefined';var _0x1f2859=_0x50f10d[_0x6053('0x21')];var _0x5afa01=_0x40022d?0x0:_0x10400d[_0x6053('0x1f')];var _0x3e720c=_0x40022d?_0x50f10d['count']:_0x10400d['offset']+_0x10400d['limit'];var _0x165878;if(_0x3e720c>=_0x1f2859){_0x3e720c=_0x1f2859;_0x165878=0xc8;}else{_0x165878=0xce;}_0x52a36d[_0x6053('0x1c')](_0x165878);return _0x52a36d[_0x6053('0x22')](_0x6053('0x23'),_0x5afa01+'-'+_0x3e720c+'/'+_0x1f2859)[_0x6053('0x1e')](_0x50f10d);}return null;};}function patchUpdates(_0x1fe51b){return function(_0xd49906){try{jsonpatch[_0x6053('0x24')](_0xd49906,_0x1fe51b,!![]);}catch(_0x73460){return BPromise[_0x6053('0x25')](_0x73460);}return _0xd49906['save']();};}function saveUpdates(_0xc7fd39,_0x3e2f84){return function(_0x1ef5be){if(_0x1ef5be){return _0x1ef5be['update'](_0xc7fd39)[_0x6053('0x26')](function(_0x1eff9d){return _0x1eff9d;});}return null;};}function removeEntity(_0x3c054b,_0xb491c9){return function(_0x33de6a){if(_0x33de6a){return _0x33de6a['destroy']()[_0x6053('0x26')](function(){_0x3c054b['status'](0xcc)[_0x6053('0x1d')]();});}};}function handleEntityNotFound(_0x1ce70f,_0x59e3b7){return function(_0x20d1bb){if(!_0x20d1bb){_0x1ce70f[_0x6053('0x1b')](0x194);}return _0x20d1bb;};}function handleError(_0x188d84,_0x3c2aa2){_0x3c2aa2=_0x3c2aa2||0x1f4;return function(_0x3ddb4f){logger[_0x6053('0x27')](_0x3ddb4f[_0x6053('0x28')]);if(_0x3ddb4f[_0x6053('0x29')]){delete _0x3ddb4f['name'];}_0x188d84['status'](_0x3c2aa2)['send'](_0x3ddb4f);};}function getInteractionUsers(_0x5d18d1,_0x4cd8bf){return new BPromise(function(_0x1631bd,_0xb8856e){try{if(_0x4cd8bf[_0x5d18d1['id']]){_0x5d18d1[_0x6053('0x2a')]=_[_0x6053('0x2b')](_0x4cd8bf[_0x5d18d1['id']],function(_0x2b7c03){return{'id':_0x2b7c03['id'],'fullname':_0x2b7c03['fullname']};});}}catch(_0x31dad8){_0xb8856e(_0x31dad8);}_0x1631bd(_0x5d18d1);});}function getInteractionTags(_0x58ad84,_0x2d771f){return new BPromise(function(_0x4d88a6,_0x17c3fc){try{if(_0x58ad84[_0x6053('0x2c')]){_0x58ad84[_0x6053('0x2d')]=[];_0x58ad84[_0x6053('0x2c')][_0x6053('0x2e')](',')[_0x6053('0x2f')](function(_0x2b18e0){_0x58ad84['Tags'][_0x6053('0x30')](_0x2d771f[_0x2b18e0]);});}delete _0x58ad84[_0x6053('0x2c')];}catch(_0xaad78c){_0x17c3fc(_0xaad78c);}_0x4d88a6(_0x58ad84);});}function updateSmsInteraction(_0x5773ac,_0x143b75,_0x5f20b0){return new BPromise(function(_0x265afb,_0x3aa744){return getInteractionUsers(_0x5773ac,_0x5f20b0)[_0x6053('0x26')](function(_0x3de439){return getInteractionTags(_0x3de439,_0x143b75);})[_0x6053('0x26')](function(_0x52c9c4){_0x265afb(_0x52c9c4);})[_0x6053('0x31')](function(_0x39ab24){_0x3aa744(_0x39ab24);});});}exports['index']=function(_0x422178,_0x4cba6e){var _0x32de17={},_0x43f35f={},_0x5081d6={'count':0x0,'rows':[]};var _0x168464=_[_0x6053('0x2b')](db['SmsInteraction'][_0x6053('0x32')],function(_0x583d7c){return{'name':_0x583d7c[_0x6053('0x33')],'type':_0x583d7c['type'][_0x6053('0x34')]};});_0x43f35f[_0x6053('0x35')]=_['map'](_0x168464,'name');_0x43f35f[_0x6053('0x36')]=_['keys'](_0x422178[_0x6053('0x36')]);_0x43f35f['filters']=_[_0x6053('0x37')](_0x43f35f[_0x6053('0x35')],_0x43f35f['query']);_0x32de17['attributes']=_[_0x6053('0x37')](_0x43f35f[_0x6053('0x35')],qs[_0x6053('0x38')](_0x422178[_0x6053('0x36')]['fields']));_0x32de17[_0x6053('0x39')]=_0x32de17[_0x6053('0x39')]['length']?_0x32de17[_0x6053('0x39')]:_0x43f35f['model'];if(!_0x422178['query'][_0x6053('0x3a')](_0x6053('0x3b'))){_0x32de17[_0x6053('0x3c')]=qs[_0x6053('0x3c')](_0x422178['query'][_0x6053('0x3c')]);_0x32de17[_0x6053('0x1f')]=qs[_0x6053('0x1f')](_0x422178[_0x6053('0x36')][_0x6053('0x1f')]);}_0x32de17['order']=qs[_0x6053('0x3d')](_0x422178['query']['sort']);_0x32de17[_0x6053('0x3e')]=qs[_0x6053('0x3f')](_[_0x6053('0x40')](_0x422178[_0x6053('0x36')],_0x43f35f[_0x6053('0x3f')]),_0x168464);var _0x4d1103=[];var _0x4519f6=squel[_0x6053('0x41')]()[_0x6053('0x42')]('id')[_0x6053('0x42')](_0x6053('0x29'))[_0x6053('0x42')](_0x6053('0x43'))[_0x6053('0x44')](_0x6053('0x45'));var _0x1c0ebf=squel['select']()[_0x6053('0x42')](_0x6053('0x46'))['field'](_0x6053('0x47'))['field'](_0x6053('0x48'))[_0x6053('0x44')](_0x6053('0x49'),'ui')[_0x6053('0x4a')](_0x6053('0x4b'),'u',_0x6053('0x4c'));var _0xe06d7c=squel['select']()[_0x6053('0x44')](_0x6053('0x4d'),'i')['left_join']('cm_contacts','c',_0x6053('0x4e'))[_0x6053('0x4a')](_0x6053('0x4b'),'o','o.id\x20=\x20i.UserId')[_0x6053('0x4a')](_0x6053('0x4f'),'a',_0x6053('0x50'))[_0x6053('0x4a')]('sms_messages','me',_0x6053('0x51'))[_0x6053('0x4a')](_0x6053('0x52'),'it',_0x6053('0x53'))['left_join'](_0x6053('0x45'),'t','t.id\x20=\x20it.TagId');var _0x31cb4d=squel[_0x6053('0x54')]();var _0x4b3298=[];var _0x36487b=squel[_0x6053('0x54')]();var _0x1b370c;if(_0x422178['query']['search']){_0x1b370c=as[_0x6053('0x55')](_0x422178[_0x6053('0x36')][_0x6053('0x56')]);var _0x595eb2=_0x1b370c[_0x6053('0x57')];for(var _0x3a75dc=0x0;_0x3a75dc<_0x1b370c[_0x6053('0x58')][_0x6053('0x59')];_0x3a75dc++){var _0x73c87=_0x1b370c[_0x6053('0x58')][_0x3a75dc];var _0x1fd7b8='i';var _0x20bbdf=_['find'](_0x168464,[_0x6053('0x29'),_0x73c87[_0x6053('0x42')]]);if(!_0x20bbdf){switch(_0x73c87[_0x6053('0x42')]){case'unreadMessages':if(_0x73c87[_0x6053('0x5a')]==0x1){_0xe06d7c[_0x6053('0x5b')]('`'+_0x73c87[_0x6053('0x42')]+_0x6053('0x5c'));}else{_0xe06d7c[_0x6053('0x5b')]('`'+_0x73c87[_0x6053('0x42')]+_0x6053('0x5d'));}break;case'Contact':if(_0x73c87[_0x6053('0x5e')]===_0x6053('0x5f')){if(_0x73c87[_0x6053('0x5a')][_0x6053('0x2e')]('\x20')['length']>0x1){_0x31cb4d[_0x595eb2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6053('0x60')](_0x73c87[_0x6053('0x5a')]),null);}else{var _0x29fbac='%'+_0x73c87['value']+'%';_0x31cb4d[_0x595eb2](_0x6053('0x61'),_0x29fbac,_0x29fbac,_0x29fbac);}}else{_0x20bbdf=_[_0x6053('0x62')](_0x168464,[_0x6053('0x29'),_0x6053('0x63')]);_0x73c87[_0x6053('0x42')]=_0x6053('0x63');_0x1dd430=as[_0x6053('0x64')](_0x1fd7b8,_0x20bbdf[_0x6053('0x65')],_0x73c87);_0x31cb4d[_0x595eb2](_0x1dd430[_0x6053('0x66')],_0x1dd430[_0x6053('0x5a')]['start'],_0x1dd430[_0x6053('0x5a')]['end']);}break;case'Tag':var _0x4bc1c8=_0x73c87[_0x6053('0x5a')][_0x6053('0x2e')](',')[_0x6053('0x2b')](function(_0x12b55d){return Number(_0x12b55d);});_0x4bc1c8[_0x6053('0x2f')](function(_0x53bfb7){_0x36487b['or'](_0x6053('0x67'),'%,'+_0x53bfb7+',%');});_0x4b3298=_[_0x6053('0x68')](_0x4b3298,_0x4bc1c8);break;case'User':if(_0x73c87[_0x6053('0x5e')]==='$substring'){_0x31cb4d[_0x595eb2](_0x6053('0x69'),'%'+_0x73c87[_0x6053('0x5a')]+'%',null);}else{_0x20bbdf=_['find'](_0x168464,[_0x6053('0x29'),_0x6053('0x6a')]);_0x73c87[_0x6053('0x42')]=_0x6053('0x6a');_0x1dd430=as[_0x6053('0x64')](_0x1fd7b8,_0x20bbdf[_0x6053('0x65')],_0x73c87);_0x31cb4d[_0x595eb2](_0x1dd430[_0x6053('0x66')],_0x1dd430[_0x6053('0x5a')]['start'],_0x1dd430[_0x6053('0x5a')][_0x6053('0x1d')]);}break;case'body':_0x1dd430=as[_0x6053('0x64')]('me',null,_0x73c87);_0x31cb4d[_0x595eb2](_0x1dd430[_0x6053('0x66')],_0x1dd430['value'][_0x6053('0x6b')],_0x1dd430[_0x6053('0x5a')]['end']);break;}}else{var _0x1dd430=as[_0x6053('0x64')](_0x1fd7b8,_0x20bbdf[_0x6053('0x65')],_0x73c87);_0x31cb4d[_0x595eb2](_0x1dd430[_0x6053('0x66')],_0x1dd430[_0x6053('0x5a')][_0x6053('0x6b')],_0x1dd430[_0x6053('0x5a')][_0x6053('0x1d')]);}}}else{var _0x191487=_(_0x422178['query'])['keys']()[_0x6053('0x2b')](function(_0x5e3d7c){return _['some'](_0x168464,[_0x6053('0x29'),_0x5e3d7c])?_0x5e3d7c:undefined;})[_0x6053('0x6c')]()[_0x6053('0x5a')]();if(!_[_0x6053('0x6d')](_0x191487)){_0x191487['forEach'](function(_0xba0f02){if(_0xba0f02==='SmsAccountId'){_0xe06d7c[_0x6053('0x3e')](_0x6053('0x6e'),[][_0x6053('0x6f')](_0x422178[_0x6053('0x36')][_0xba0f02]));}else if(_0xba0f02==='createdAt'){var _0x2627e8=JSON[_0x6053('0x70')](_0x422178['query'][_0xba0f02])[_0x6053('0x71')];var _0x5ac5ff=JSON[_0x6053('0x70')](_0x422178[_0x6053('0x36')][_0xba0f02])['$lte'];_0xe06d7c[_0x6053('0x3e')](_0x6053('0x72'),_0x2627e8,_0x5ac5ff);}else{if(_0x422178[_0x6053('0x36')][_0xba0f02]===_0x6053('0x73')){_0xe06d7c[_0x6053('0x3e')]('i.'+_0xba0f02+_0x6053('0x74'));}else{_0xe06d7c[_0x6053('0x3e')]('i.'+_0xba0f02+_0x6053('0x75'),_0x422178[_0x6053('0x36')][_0xba0f02]);}}});}if(_0x422178[_0x6053('0x36')][_0x6053('0x76')]){if(_0x422178[_0x6053('0x36')][_0x6053('0x76')]==0x1){_0xe06d7c[_0x6053('0x5b')](_0x6053('0x77'));}else{_0xe06d7c[_0x6053('0x5b')](_0x6053('0x78'));}}if(_0x422178[_0x6053('0x36')][_0x6053('0x79')]){_0x4b3298=_['isArray'](_0x422178[_0x6053('0x36')][_0x6053('0x79')])?_0x422178[_0x6053('0x36')][_0x6053('0x79')]:new Array(_0x422178[_0x6053('0x36')][_0x6053('0x79')]);_0x4b3298['forEach'](function(_0x3a1a30){_0x36487b['or'](_0x6053('0x67'),'%,'+_0x3a1a30+',%');});}if(_0x422178[_0x6053('0x36')]['filter']){var _0x2ec01f=_0x422178[_0x6053('0x36')]['filter'][_0x6053('0x7a')]('\x5c','\x5c\x5c')[_0x6053('0x7a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x2ec01f)){_0x31cb4d['or'](_0x6053('0x7b'),_0x2ec01f+'%')['or'](_0x6053('0x7c'),_0x2ec01f+'%');}else{_0x31cb4d['or'](_0x6053('0x7d'),qs['getFullTextValue'](_0x2ec01f))['or'](_0x6053('0x7e'),_0x2ec01f+'%');}}}_0xe06d7c[_0x6053('0x3e')](_0x31cb4d);_0xe06d7c['group'](_0x6053('0x7f'));var _0x181d58={'type':db[_0x6053('0x80')][_0x6053('0x81')][_0x6053('0x82')],'raw':!![]};var _0x26f8f3=_0xe06d7c[_0x6053('0x83')]();_0x26f8f3[_0x6053('0x42')]('i.id');_0x26f8f3[_0x6053('0x42')](_0x6053('0x84'),_0x6053('0x85'));if(_0x32de17['order']){_0x32de17[_0x6053('0x86')]['forEach'](function(_0x362d84){var _0x2cff14=_0x362d84[0x0]===_0x6053('0x87')?_0x362d84[0x0]:'i.'+_0x362d84[0x0];_0xe06d7c[_0x6053('0x86')](_0x2cff14,_0x362d84[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6053('0x6d')](_0x4b3298)){_0xe06d7c[_0x6053('0x5b')](_0x36487b);_0x26f8f3[_0x6053('0x3e')](_0x6053('0x88'),_0x4b3298);}BPromise['resolve']()[_0x6053('0x26')](function(){if(!_0x1b370c){if(_0x422178['query'][_0x6053('0x89')])return;_0x26f8f3['where'](_0x6053('0x8a'));_0xe06d7c['where'](_0x6053('0x8a'));return;}if(_0x422178[_0x6053('0x8b')][_0x6053('0x8c')]!==_0x6053('0x8d'))return;return _0x422178[_0x6053('0x8b')][_0x6053('0x8e')]({'attributes':['id'],'raw':!![]})[_0x6053('0x26')](function(_0xa2b5a8){if(_['isEmpty'](_0xa2b5a8)){_0x26f8f3['where']('i.SmsAccountId\x20IS\x20NULL');_0xe06d7c[_0x6053('0x3e')](_0x6053('0x8f'));}else{_0x26f8f3[_0x6053('0x3e')](_0x6053('0x6e'),_[_0x6053('0x2b')](_0xa2b5a8,'id'));_0xe06d7c[_0x6053('0x3e')](_0x6053('0x6e'),_[_0x6053('0x2b')](_0xa2b5a8,'id'));}});})['then'](function(){if(_0x422178[_0x6053('0x8b')][_0x6053('0x8c')]===_0x6053('0x8d')&&!_0x1b370c&&!_0x422178[_0x6053('0x36')][_0x6053('0x89')])return[];return db[_0x6053('0x90')]['query'](_0x26f8f3[_0x6053('0x91')](),_0x181d58);})[_0x6053('0x26')](function(_0x5ca4f0){_0x5081d6[_0x6053('0x21')]=_0x5ca4f0[_0x6053('0x59')];if(_0x5081d6[_0x6053('0x21')]===0x0)return[];return db[_0x6053('0x90')][_0x6053('0x36')](_0x4519f6['toString'](),_0x181d58)[_0x6053('0x26')](function(_0x4564f6){_0x4d1103=_[_0x6053('0x92')](_0x4564f6,'id');_0x181d58=_['merge'](_0x181d58,{'model':db[_0x6053('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x422178[_0x6053('0x36')][_0x6053('0x38')]){_0x32de17[_0x6053('0x39')][_0x6053('0x2f')](function(_0x365982){_0xe06d7c['field']('i.'+_0x365982);});}else{_0xe06d7c[_0x6053('0x42')](_0x6053('0x84'),_0x6053('0x85'));_0xe06d7c[_0x6053('0x42')](_0x6053('0x94'),_0x6053('0x95'));_0xe06d7c[_0x6053('0x42')](_0x6053('0x96'),_0x6053('0x97'));_0xe06d7c[_0x6053('0x42')](_0x6053('0x98'),'contactName');_0xe06d7c[_0x6053('0x42')](_0x6053('0x99'));_0xe06d7c['field']('c.firstName',_0x6053('0x9a'));_0xe06d7c[_0x6053('0x42')]('c.lastName',_0x6053('0x9b'));_0xe06d7c[_0x6053('0x42')](_0x6053('0x9c'),'Contact.email');_0xe06d7c['field'](_0x6053('0x9d'),_0x6053('0x9e'));_0xe06d7c[_0x6053('0x42')]('c.mobile',_0x6053('0x9f'));_0xe06d7c[_0x6053('0x42')](_0x6053('0xa0'),_0x6053('0xa1'));_0xe06d7c[_0x6053('0x42')](_0x6053('0xa2'),_0x6053('0xa3'));_0xe06d7c[_0x6053('0x42')](_0x6053('0xa4'),_0x6053('0xa5'));_0xe06d7c[_0x6053('0x42')](_0x6053('0xa6'),_0x6053('0x2c'));}if(_0x32de17['limit'])_0xe06d7c[_0x6053('0x3c')](_0x32de17['limit']);if(_0x32de17[_0x6053('0x1f')])_0xe06d7c[_0x6053('0x1f')](_0x32de17[_0x6053('0x1f')]);return db['sequelize'][_0x6053('0x36')](_0xe06d7c['toString'](),_0x181d58);})[_0x6053('0x26')](function(_0x3111fc){if(_0x3111fc['length']>0x0)_0x1c0ebf['where'](_0x6053('0xa7'),_['map'](_0x3111fc,'id'));return db[_0x6053('0x90')][_0x6053('0x36')](_0x1c0ebf[_0x6053('0x91')](),_0x181d58)['then'](function(_0x2e52e4){var _0x446f1c=_[_0x6053('0xa8')](_0x2e52e4,'SmsInteractionId');var _0x4de5b5=[];_0x3111fc['forEach'](function(_0x251f30){_0x4de5b5[_0x6053('0x30')](updateSmsInteraction(_0x251f30,_0x4d1103,_0x446f1c));});return BPromise[_0x6053('0xa9')](_0x4de5b5);});});})[_0x6053('0x26')](function(_0x561740){_0x5081d6['rows']=_0x561740;return _0x5081d6;})[_0x6053('0x26')](respondWithFilteredResult(_0x4cba6e,_0x32de17))[_0x6053('0x31')](handleError(_0x4cba6e,null));};exports[_0x6053('0xaa')]=function(_0x29c8bd,_0x4771c0){var _0x4baac8={'raw':![],'where':{'id':_0x29c8bd[_0x6053('0xab')]['id']}},_0x35d1d7={};_0x35d1d7[_0x6053('0x35')]=_[_0x6053('0xac')](db[_0x6053('0x93')][_0x6053('0x32')]);_0x35d1d7[_0x6053('0x36')]=_[_0x6053('0xac')](_0x29c8bd[_0x6053('0x36')]);_0x35d1d7[_0x6053('0x3f')]=_[_0x6053('0x37')](_0x35d1d7[_0x6053('0x35')],_0x35d1d7[_0x6053('0x36')]);_0x4baac8[_0x6053('0x39')]=_[_0x6053('0x37')](_0x35d1d7[_0x6053('0x35')],qs[_0x6053('0x38')](_0x29c8bd[_0x6053('0x36')][_0x6053('0x38')]));_0x4baac8['attributes']=_0x4baac8[_0x6053('0x39')][_0x6053('0x59')]?_0x4baac8['attributes']:_0x35d1d7['model'];if(_0x29c8bd[_0x6053('0x36')][_0x6053('0xad')]){_0x4baac8[_0x6053('0xae')]=[{'all':!![]}];}_0x4baac8=_[_0x6053('0xaf')]({},_0x4baac8,_0x29c8bd[_0x6053('0xb0')]);return db['SmsInteraction']['find'](_0x4baac8)[_0x6053('0x26')](handleEntityNotFound(_0x4771c0,null))[_0x6053('0x26')](respondWithResult(_0x4771c0,null))[_0x6053('0x31')](handleError(_0x4771c0,null));};exports['create']=function(_0x4ca3bd,_0xca2777){return db[_0x6053('0x93')][_0x6053('0xb1')](_0x4ca3bd['body'],{})[_0x6053('0x26')](respondWithResult(_0xca2777,0xc9))[_0x6053('0x31')](handleError(_0xca2777,null));};exports[_0x6053('0xb2')]=function(_0x3325a2,_0x38728a){if(_0x3325a2[_0x6053('0xb3')]['id']){delete _0x3325a2[_0x6053('0xb3')]['id'];}return db[_0x6053('0x93')]['find']({'where':{'id':_0x3325a2[_0x6053('0xab')]['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x38728a,null))[_0x6053('0x26')](saveUpdates(_0x3325a2[_0x6053('0xb3')],null))['then'](respondWithResult(_0x38728a,null))[_0x6053('0x31')](handleError(_0x38728a,null));};exports[_0x6053('0xb4')]=function(_0x22f09e,_0x3a3259){return db['SmsInteraction'][_0x6053('0x62')]({'where':{'id':_0x22f09e[_0x6053('0xab')]['id']}})['then'](handleEntityNotFound(_0x3a3259,null))[_0x6053('0x26')](removeEntity(_0x3a3259,null))[_0x6053('0x31')](handleError(_0x3a3259,null));};exports[_0x6053('0xb5')]=function(_0x437204,_0x39bd1e){return db[_0x6053('0x93')][_0x6053('0xb5')]()[_0x6053('0x26')](respondWithResult(_0x39bd1e,null))['catch'](handleError(_0x39bd1e,null));};exports[_0x6053('0xb6')]=function(_0x54b918,_0x143d89,_0x50c78e){return db[_0x6053('0xb7')][_0x6053('0x62')]({'where':{'id':_0x54b918[_0x6053('0xab')]['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x143d89,null))[_0x6053('0x26')](function(_0x135fb5){if(_0x135fb5){return _0x135fb5[_0x6053('0xb6')](_0x54b918[_0x6053('0xb3')][_0x6053('0xb8')],_['omit'](_0x54b918['body'],['ids','id'])||{});}})[_0x6053('0x26')](respondWithResult(_0x143d89,null))['catch'](handleError(_0x143d89,null));};exports[_0x6053('0xb9')]=function(_0x3e327a,_0x984b03,_0x2f29f1){var _0x16b16b={'raw':![],'where':{}};var _0x50f3f5={};var _0x3e5443={'count':0x0,'rows':[]};return db[_0x6053('0x93')][_0x6053('0xba')]({'where':{'id':_0x3e327a[_0x6053('0xab')]['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x984b03,null))[_0x6053('0x26')](function(_0x28e8b5){if(_0x28e8b5){_0x50f3f5[_0x6053('0x35')]=_[_0x6053('0xac')](db[_0x6053('0xb7')][_0x6053('0x32')]);_0x50f3f5[_0x6053('0x36')]=_[_0x6053('0xac')](_0x3e327a[_0x6053('0x36')]);_0x50f3f5['filters']=_['intersection'](_0x50f3f5['model'],_0x50f3f5['query']);_0x16b16b[_0x6053('0x39')]=_[_0x6053('0x37')](_0x50f3f5[_0x6053('0x35')],qs[_0x6053('0x38')](_0x3e327a[_0x6053('0x36')][_0x6053('0x38')]));_0x16b16b['attributes']=_0x16b16b[_0x6053('0x39')][_0x6053('0x59')]?_0x16b16b[_0x6053('0x39')]:_0x50f3f5[_0x6053('0x35')];if(!_0x3e327a[_0x6053('0x36')]['hasOwnProperty'](_0x6053('0x3b'))){_0x16b16b['limit']=qs[_0x6053('0x3c')](_0x3e327a['query']['limit']);_0x16b16b[_0x6053('0x1f')]=qs['offset'](_0x3e327a[_0x6053('0x36')]['offset']);}_0x16b16b[_0x6053('0x86')]=qs['sort'](_0x3e327a['query'][_0x6053('0x3d')]);_0x16b16b['where']=qs[_0x6053('0x3f')](_[_0x6053('0x40')](_0x3e327a[_0x6053('0x36')],_0x50f3f5[_0x6053('0x3f')]));_0x16b16b[_0x6053('0x3e')][_0x6053('0xbb')]=_0x28e8b5['id'];if(_0x3e327a[_0x6053('0x36')]['filter']){_0x16b16b[_0x6053('0x3e')]=_['merge'](_0x16b16b[_0x6053('0x3e')],{'$or':_['map'](_0x16b16b[_0x6053('0x39')],function(_0x529276){var _0x4d5f38={};_0x4d5f38[_0x529276]={'$like':'%'+_0x3e327a[_0x6053('0x36')][_0x6053('0xbc')]+'%'};return _0x4d5f38;})});}if(_0x3e327a[_0x6053('0x36')]['$gte']){var _0x1a1c87=_0x3e327a['query'][_0x6053('0x71')]['split'](',');var _0x4ae1c8={};_0x4ae1c8[_0x1a1c87[0x0]]={'$gte':moment(_0x1a1c87[0x1])[_0x6053('0xbd')](_0x6053('0xbe'))};_0x16b16b[_0x6053('0x3e')]=_[_0x6053('0xaf')](_0x16b16b['where'],_0x4ae1c8);}_0x16b16b=_[_0x6053('0xaf')]({},_0x16b16b,_0x3e327a[_0x6053('0xb0')]);return db[_0x6053('0xb7')]['count']({'where':_0x16b16b[_0x6053('0x3e')]})[_0x6053('0x26')](function(_0x44e8f7){_0x3e5443['count']=_0x44e8f7;if(_0x3e327a[_0x6053('0x36')][_0x6053('0xad')]){_0x16b16b[_0x6053('0xae')]=[{'all':!![]}];}return db[_0x6053('0xb7')][_0x6053('0xbf')](_0x16b16b);})['then'](function(_0x3d4a2d){_0x3e5443[_0x6053('0xc0')]=_0x3d4a2d;return _0x3e5443;});}})[_0x6053('0x26')](respondWithFilteredResult(_0x984b03,_0x16b16b))[_0x6053('0x31')](handleError(_0x984b03,null));};exports[_0x6053('0xc1')]=function(_0x4c1124,_0x8670b0,_0x7cb8f0){return db['SmsInteraction'][_0x6053('0x62')]({'where':{'id':_0x4c1124[_0x6053('0xab')]['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x8670b0,null))['then'](function(_0x2fd124){if(_0x2fd124){return _0x2fd124['setTags'](_0x4c1124[_0x6053('0xb3')]['ids'],_[_0x6053('0xc2')](_0x4c1124[_0x6053('0xb3')],[_0x6053('0xb8'),'id'])||{})[_0x6053('0xc3')](function(){return db[_0x6053('0xc4')][_0x6053('0xbf')]({'attributes':['id',_0x6053('0x29'),_0x6053('0x43')],'where':{'id':_0x4c1124[_0x6053('0xb3')][_0x6053('0xb8')]}});})[_0x6053('0x26')](function(_0x416dfd){socket[_0x6053('0xc5')](_0x6053('0xc6'),{'id':Number(_0x4c1124[_0x6053('0xab')]['id']),'tags':_0x416dfd||[]});return{'id':Number(_0x4c1124[_0x6053('0xab')]['id']),'tags':_0x416dfd||[]};});}})[_0x6053('0x26')](respondWithResult(_0x8670b0,null))[_0x6053('0x31')](handleError(_0x8670b0,null));};exports[_0x6053('0xc7')]=function(_0x1f9246,_0x2e1a3b,_0x21d20e){return db[_0x6053('0x93')][_0x6053('0x62')]({'where':{'id':_0x1f9246[_0x6053('0xab')]['id']}})[_0x6053('0x26')](handleEntityNotFound(_0x2e1a3b,null))[_0x6053('0x26')](function(_0x19ae3b){if(_0x19ae3b){return _0x19ae3b[_0x6053('0xc7')](_0x1f9246[_0x6053('0x36')][_0x6053('0xb8')]);}})[_0x6053('0x26')](respondWithStatusCode(_0x2e1a3b,null))[_0x6053('0x31')](handleError(_0x2e1a3b,null));};exports[_0x6053('0xc8')]=function(_0x31e4ad,_0x3d094e){var _0x46713e=moment()[_0x6053('0xc9')]()[_0x6053('0x91')]();var _0x17df68=path[_0x6053('0xca')](config['root'],_0x6053('0xcb'),_0x6053('0xcc'),_0x6053('0xcd'));var _0x577f58=path[_0x6053('0xca')](config[_0x6053('0xce')],_0x6053('0xcb'),_0x6053('0xcc'),_0x6053('0xcf'));var _0x359473=path[_0x6053('0xca')](_0x17df68,_0x46713e);var _0x439b0a=util[_0x6053('0xbd')](_0x6053('0xd0'),_0x31e4ad[_0x6053('0xab')]['id'],_0x46713e);var _0xb86c31=path['join'](_0x17df68,_0x439b0a);var _0x9f74f4=[];_0x9f74f4[_0x6053('0x30')]({'model':db[_0x6053('0xd1')],'as':_0x6053('0xd1'),'attributes':['id','fullname'],'raw':!![]});_0x9f74f4[_0x6053('0x30')]({'model':db['CmContact'],'as':_0x6053('0xd2'),'attributes':['id',_0x6053('0xd3'),_0x6053('0xd4')],'raw':!![]});var _0x3cfb75=[{'model':db[_0x6053('0xb7')],'as':_0x6053('0xd5'),'attributes':['id',_0x6053('0xb3'),_0x6053('0xd6'),_0x6053('0xd7'),_0x6053('0xd8'),_0x6053('0x76')],'include':_0x9f74f4}];_0x3cfb75[_0x6053('0x30')]({'model':db[_0x6053('0xd9')],'as':_0x6053('0xda'),'attributes':['id','name']});_0x3cfb75[_0x6053('0x30')]({'model':db[_0x6053('0xd1')],'as':_0x6053('0xdb'),'attributes':['id','fullname']});return db[_0x6053('0x93')][_0x6053('0x62')]({'where':{'id':_0x31e4ad['params']['id']},'include':_0x3cfb75})['then'](handleEntityNotFound(_0x3d094e,null))[_0x6053('0x26')](function(_0x1ecd87){if(_0x1ecd87){var _0x1bf991=_0x1ecd87[_0x6053('0xdc')]({'plain':!![]});fs[_0x6053('0xdd')](_0x359473);var _0x44c6a5={'channel':_0x6053('0xde'),'account':_0x1bf991['Account'][_0x6053('0x29')],'agent':_0x1bf991['Owner']?_0x1bf991[_0x6053('0xdb')][_0x6053('0xdf')]:'N.A.','createdAt':moment(_0x1bf991['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6053('0x91')](),'closedAt':_0x1bf991[_0x6053('0xe0')]?moment(_0x1bf991[_0x6053('0xe1')])[_0x6053('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6053('0x91')]():'','disposition':_0x1bf991[_0x6053('0xe2')],'messages':_(_0x1bf991[_0x6053('0xd5')])[_0x6053('0xbc')]({'secret':![]})[_0x6053('0x2b')](function(_0x396dfa){return{'date':moment(_0x396dfa[_0x6053('0xd6')])[_0x6053('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6053('0x91')](),'sender':_0x396dfa['direction']==='out'?_0x396dfa['User']?_0x396dfa[_0x6053('0xd1')][_0x6053('0xdf')]:_0x6053('0xe3'):_0x396dfa[_0x6053('0xd2')]['firstName']+(_0x396dfa['Contact'][_0x6053('0xd4')]?'\x20'+_0x396dfa[_0x6053('0xd2')]['lastName']:''),'body':_0x396dfa['body'],'direction':_0x396dfa['direction']===_0x6053('0xe4')?'A':'C','secret':_0x396dfa['secret'],'read':_0x396dfa[_0x6053('0x76')]};})['value']()};return ejs['renderFile'](path[_0x6053('0xca')](config[_0x6053('0xce')],_0x6053('0xcb'),'views',_0x6053('0xe5')),{'interaction':_0x44c6a5})[_0x6053('0x26')](function(_0x276698){var _0x688515=path[_0x6053('0xca')](_0x359473,_0x6053('0xe6')+_0x1bf991['id']+'-'+_0x46713e+_0x6053('0xe7'));var _0x4478ec={'path':_0x688515,'channel':_0x6053('0xde'),'interactionId':_0x1bf991['id']};return pdf[_0x6053('0xe8')](_0x276698,_0x4478ec);})[_0x6053('0x26')](function(){return new BPromise(function(_0x1fd969,_0x1210aa){zipdir(_0x359473,{'saveTo':_0xb86c31},function(_0x21ae4f,_0x40fc5a){if(_0x21ae4f)return _0x1210aa(_0x21ae4f);return _0x1fd969(_0x40fc5a);});})[_0x6053('0x26')](function(){return new BPromise(function(_0x13d124,_0x4c077b){rimraf(_0x359473,function(_0x18d492){if(_0x18d492)_0x4c077b(_0x18d492);return _0x13d124();});});})[_0x6053('0x26')](function(){return _0x3d094e[_0x6053('0xc8')](_0xb86c31,_0x439b0a,function(_0x2cada2){if(_0x2cada2){console[_0x6053('0xe9')](_0x6053('0xea'),_0x2cada2);}else{fs[_0x6053('0xeb')](_0xb86c31);}});});});}else{return _0x3d094e['sendStatus'](0xc8);}})['catch'](handleError(_0x3d094e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 128f5ae..00b9058 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 _0x4137=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x265d6a,_0x33c1d1){var _0x30a1ef=function(_0x46233d){while(--_0x46233d){_0x265d6a['push'](_0x265d6a['shift']());}};_0x30a1ef(++_0x33c1d1);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require(_0x7413('0x0'));var SmsInteraction=require(_0x7413('0x1'))['db'][_0x7413('0x2')];var SmsMessage=require(_0x7413('0x1'))['db'][_0x7413('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7413('0x4')](0x0);var events={'afterCreate':_0x7413('0x5'),'afterUpdate':_0x7413('0x6'),'afterDestroy':_0x7413('0x7')};function emitEvent(_0x3dc48a){return function(_0x451a96,_0x3bb181,_0x4fbade){_0x451a96[_0x7413('0x8')]({'attributes':['id'],'raw':!![]})[_0x7413('0x9')](function(_0x5b39ac){_0x451a96[_0x7413('0xa')]('Users',_0x5b39ac[_0x7413('0xb')](function(_0x120dc2){return{'id':_0x120dc2['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x451a96['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7413('0x9')](function(_0x2f4b54){_0x451a96['setDataValue'](_0x7413('0xc'),_0x2f4b54[_0x7413('0xd')]);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a+':'+_0x451a96['id'],_0x451a96);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a,_0x451a96);_0x4fbade(null);})[_0x7413('0xf')](_0x4fbade(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x7413('0x10')](e,emitEvent(event));}}module[_0x7413('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x77e6=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','then','Users','map'];(function(_0x86a8fa,_0x323e96){var _0x551384=function(_0x434c2b){while(--_0x434c2b){_0x86a8fa['push'](_0x86a8fa['shift']());}};_0x551384(++_0x323e96);}(_0x77e6,0x1a6));var _0x677e=function(_0x3d5580,_0x2d2982){_0x3d5580=_0x3d5580-0x0;var _0x3a5729=_0x77e6[_0x3d5580];return _0x3a5729;};'use strict';var EventEmitter=require(_0x677e('0x0'));var SmsInteraction=require(_0x677e('0x1'))['db'][_0x677e('0x2')];var SmsMessage=require(_0x677e('0x1'))['db'][_0x677e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x677e('0x4')](0x0);var events={'afterCreate':_0x677e('0x5'),'afterUpdate':_0x677e('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2f0307){return function(_0x2560a6,_0x52e3f9,_0x18c5e1){_0x2560a6['getUsers']({'attributes':['id'],'raw':!![]})[_0x677e('0x7')](function(_0x4d1a57){_0x2560a6['setDataValue'](_0x677e('0x8'),_0x4d1a57[_0x677e('0x9')](function(_0x28d41e){return{'id':_0x28d41e['id']};}));return SmsMessage[_0x677e('0xa')]({'where':{'SmsInteractionId':_0x2560a6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x206305){_0x2560a6['setDataValue'](_0x677e('0xb'),_0x206305[_0x677e('0xc')]);SmsInteractionEvents[_0x677e('0xd')](_0x2f0307+':'+_0x2560a6['id'],_0x2560a6);SmsInteractionEvents[_0x677e('0xd')](_0x2f0307,_0x2560a6);_0x18c5e1(null);})[_0x677e('0xe')](_0x18c5e1(null));};}for(var e in events){if(events[_0x677e('0xf')](e)){var event=events[e];SmsInteraction[_0x677e('0x10')](e,emitEvent(event));}}module[_0x677e('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a3a8534..9834478 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 _0xd453=['changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x107018,_0xd51f10){var _0x491649=function(_0x3e40f9){while(--_0x3e40f9){_0x107018['push'](_0x107018['shift']());}};_0x491649(++_0xd51f10);}(_0xd453,0x199));var _0x3d45=function(_0x355a02,_0x4834c2){_0x355a02=_0x355a02-0x0;var _0x121cc5=_0xd453[_0x355a02];return _0x121cc5;};'use strict';var _=require(_0x3d45('0x0'));var util=require(_0x3d45('0x1'));var logger=require(_0x3d45('0x2'))(_0x3d45('0x3'));var moment=require(_0x3d45('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d45('0x5'));var config=require('../../config/environment');var attributes=require(_0x3d45('0x6'));module[_0x3d45('0x7')]=function(_0x31714b,_0x442157){return _0x31714b[_0x3d45('0x8')](_0x3d45('0x9'),attributes,{'tableName':_0x3d45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56c76d,_0x282624,_0x45ca2b){if(_0x56c76d[_0x3d45('0xb')](_0x3d45('0xc'))){_0x56c76d[_0x3d45('0xd')]=moment()[_0x3d45('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x45ca2b(null,_0x56c76d);}}});}; \ No newline at end of file +var _0x0268=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','changed'];(function(_0x2e2720,_0x1ae995){var _0x3f9d2d=function(_0x5067a2){while(--_0x5067a2){_0x2e2720['push'](_0x2e2720['shift']());}};_0x3f9d2d(++_0x1ae995);}(_0x0268,0x111));var _0x8026=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x0268[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x8026('0x0'));var util=require(_0x8026('0x1'));var logger=require('../../config/logger')(_0x8026('0x2'));var moment=require('moment');var BPromise=require(_0x8026('0x3'));var rp=require(_0x8026('0x4'));var fs=require('fs');var path=require(_0x8026('0x5'));var rimraf=require(_0x8026('0x6'));var config=require(_0x8026('0x7'));var attributes=require(_0x8026('0x8'));module['exports']=function(_0x549f50,_0x4f0ea7){return _0x549f50[_0x8026('0x9')](_0x8026('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x357748,_0x402be6,_0x1a7233){if(_0x357748[_0x8026('0xb')]('closed')){_0x357748[_0x8026('0xc')]=moment()[_0x8026('0xd')](_0x8026('0xe'));}_0x1a7233(null,_0x357748);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index b3a6d0b..5b2c8f9 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 _0x4c2f=['attributes','limit','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','SmsInteraction','body','options','raw','where'];(function(_0x463e1d,_0x4e4702){var _0x27a066=function(_0x2ff7dd){while(--_0x2ff7dd){_0x463e1d['push'](_0x463e1d['shift']());}};_0x27a066(++_0x4e4702);}(_0x4c2f,0x100));var _0xf4c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c2f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf4c2('0x0'));var moment=require(_0xf4c2('0x1'));var BPromise=require(_0xf4c2('0x2'));var rs=require(_0xf4c2('0x3'));var fs=require('fs');var Redis=require(_0xf4c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4c2('0x5'));var logger=require(_0xf4c2('0x6'))('rpc');var config=require(_0xf4c2('0x7'));var jayson=require(_0xf4c2('0x8'));var client=jayson['client'][_0xf4c2('0x9')]({'port':0x232a});config['redis']=_[_0xf4c2('0xa')](config[_0xf4c2('0xb')],{'host':_0xf4c2('0xc'),'port':0x18eb});var socket=require(_0xf4c2('0xd'))(new Redis(config[_0xf4c2('0xb')]));require(_0xf4c2('0xe'))['register'](socket);function respondWithRpcPromise(_0x2210e9,_0xa8d551,_0x35ac28){return new BPromise(function(_0x35bc75,_0x45cf74){return client[_0xf4c2('0xf')](_0x2210e9,_0x35ac28)[_0xf4c2('0x10')](function(_0x8688b2){logger[_0xf4c2('0x11')](_0xf4c2('0x12'),_0xa8d551,'request\x20sent');logger[_0xf4c2('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xa8d551,'request\x20sent',JSON['stringify'](_0x8688b2));if(_0x8688b2['error']){if(_0x8688b2[_0xf4c2('0x14')][_0xf4c2('0x15')]===0x1f4){logger[_0xf4c2('0x14')](_0xf4c2('0x12'),_0xa8d551,_0x8688b2[_0xf4c2('0x14')]['message']);return _0x45cf74(_0x8688b2[_0xf4c2('0x14')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0xa8d551,_0x8688b2[_0xf4c2('0x14')]['message']);return _0x35bc75(_0x8688b2[_0xf4c2('0x14')][_0xf4c2('0x16')]);}else{logger['info'](_0xf4c2('0x12'),_0xa8d551,_0xf4c2('0x17'));_0x35bc75(_0x8688b2[_0xf4c2('0x18')][_0xf4c2('0x16')]);}})[_0xf4c2('0x19')](function(_0x4b44e5){logger['error']('SmsInteraction,\x20%s,\x20%s',_0xa8d551,_0x4b44e5);_0x45cf74(_0x4b44e5);});});}exports['UpdateSmsInteraction']=function(_0x45dbfd){var _0x64ae06=this;return new Promise(function(_0x1c239f,_0x4afbc6){return db[_0xf4c2('0x1a')]['update'](_0x45dbfd[_0xf4c2('0x1b')],{'raw':_0x45dbfd[_0xf4c2('0x1c')]?_0x45dbfd['options'][_0xf4c2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45dbfd[_0xf4c2('0x1c')]?_0x45dbfd[_0xf4c2('0x1c')][_0xf4c2('0x1e')]||null:null,'attributes':_0x45dbfd[_0xf4c2('0x1c')]?_0x45dbfd[_0xf4c2('0x1c')][_0xf4c2('0x1f')]||null:null,'limit':_0x45dbfd[_0xf4c2('0x1c')]?_0x45dbfd['options'][_0xf4c2('0x20')]||null:null})[_0xf4c2('0x10')](function(_0xe3384e){logger[_0xf4c2('0x11')](_0xf4c2('0x21'),_0x45dbfd);logger[_0xf4c2('0x13')](_0xf4c2('0x21'),_0x45dbfd,JSON[_0xf4c2('0x22')](_0xe3384e));_0x1c239f(_0xe3384e);})[_0xf4c2('0x19')](function(_0x5ba7d4){logger[_0xf4c2('0x14')](_0xf4c2('0x21'),_0x5ba7d4[_0xf4c2('0x16')],_0x45dbfd);_0x4afbc6(_0x64ae06[_0xf4c2('0x14')](0x1f4,_0x5ba7d4[_0xf4c2('0x16')]));});});};exports[_0xf4c2('0x23')]=function(_0x445c63){return new Promise(function(_0x50c498,_0x15340b){return db[_0xf4c2('0x1a')][_0xf4c2('0x24')]({'where':_0x445c63[_0xf4c2('0x1c')]?_0x445c63['options']['where']||null:null})[_0xf4c2('0x10')](function(_0xb16e07){if(_0xb16e07){return _0xb16e07[_0xf4c2('0x25')](_0x445c63[_0xf4c2('0x1b')][_0xf4c2('0x26')],_[_0xf4c2('0x27')](_0x445c63[_0xf4c2('0x1b')],[_0xf4c2('0x26'),'id'])||{});}})['spread'](function(_0x531090){logger[_0xf4c2('0x11')]('AddTags',_0x445c63);logger[_0xf4c2('0x13')](_0xf4c2('0x28'),_0x445c63,JSON[_0xf4c2('0x22')](_0x531090));_0x50c498(_0x531090);})['catch'](function(_0x268956){logger[_0xf4c2('0x14')](_0xf4c2('0x28'),_0x268956[_0xf4c2('0x16')],_0x445c63);_0x15340b(_this[_0xf4c2('0x14')](0x1f4,_0x268956[_0xf4c2('0x16')]));});});}; \ No newline at end of file +var _0xf40d=['where','limit','debug','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw'];(function(_0x405aeb,_0x5ee732){var _0x50e76a=function(_0x2cded1){while(--_0x2cded1){_0x405aeb['push'](_0x405aeb['shift']());}};_0x50e76a(++_0x5ee732);}(_0xf40d,0x15f));var _0xdf40=function(_0x255c61,_0x5cc787){_0x255c61=_0x255c61-0x0;var _0x49ebba=_0xf40d[_0x255c61];return _0x49ebba;};'use strict';var _=require('lodash');var util=require(_0xdf40('0x0'));var moment=require(_0xdf40('0x1'));var BPromise=require(_0xdf40('0x2'));var rs=require(_0xdf40('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf40('0x4'))['db'];var utils=require(_0xdf40('0x5'));var logger=require(_0xdf40('0x6'))(_0xdf40('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf40('0x8')]['http']({'port':0x232a});config[_0xdf40('0x9')]=_['defaults'](config['redis'],{'host':_0xdf40('0xa'),'port':0x18eb});var socket=require(_0xdf40('0xb'))(new Redis(config[_0xdf40('0x9')]));require(_0xdf40('0xc'))['register'](socket);function respondWithRpcPromise(_0x1e41e1,_0x1d0282,_0x544e65){return new BPromise(function(_0x28d9f7,_0x56e0bc){return client['request'](_0x1e41e1,_0x544e65)[_0xdf40('0xd')](function(_0x4de2be){logger[_0xdf40('0xe')](_0xdf40('0xf'),_0x1d0282,_0xdf40('0x10'));logger['debug'](_0xdf40('0x11'),_0x1d0282,_0xdf40('0x10'),JSON[_0xdf40('0x12')](_0x4de2be));if(_0x4de2be[_0xdf40('0x13')]){if(_0x4de2be['error'][_0xdf40('0x14')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1d0282,_0x4de2be[_0xdf40('0x13')][_0xdf40('0x15')]);return _0x56e0bc(_0x4de2be[_0xdf40('0x13')]['message']);}logger[_0xdf40('0x13')](_0xdf40('0xf'),_0x1d0282,_0x4de2be[_0xdf40('0x13')]['message']);return _0x28d9f7(_0x4de2be['error'][_0xdf40('0x15')]);}else{logger[_0xdf40('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x1d0282,_0xdf40('0x10'));_0x28d9f7(_0x4de2be[_0xdf40('0x16')]['message']);}})[_0xdf40('0x17')](function(_0x45b60b){logger[_0xdf40('0x13')](_0xdf40('0xf'),_0x1d0282,_0x45b60b);_0x56e0bc(_0x45b60b);});});}exports[_0xdf40('0x18')]=function(_0x570ba4){var _0xb6e92b=this;return new Promise(function(_0x1c84a9,_0x4973d2){return db[_0xdf40('0x19')]['update'](_0x570ba4[_0xdf40('0x1a')],{'raw':_0x570ba4['options']?_0x570ba4[_0xdf40('0x1b')][_0xdf40('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x570ba4[_0xdf40('0x1b')]?_0x570ba4['options'][_0xdf40('0x1d')]||null:null,'attributes':_0x570ba4[_0xdf40('0x1b')]?_0x570ba4[_0xdf40('0x1b')]['attributes']||null:null,'limit':_0x570ba4[_0xdf40('0x1b')]?_0x570ba4[_0xdf40('0x1b')][_0xdf40('0x1e')]||null:null})['then'](function(_0x526679){logger['info'](_0xdf40('0x18'),_0x570ba4);logger[_0xdf40('0x1f')]('UpdateSmsInteraction',_0x570ba4,JSON['stringify'](_0x526679));_0x1c84a9(_0x526679);})[_0xdf40('0x17')](function(_0x510d24){logger[_0xdf40('0x13')]('UpdateSmsInteraction',_0x510d24['message'],_0x570ba4);_0x4973d2(_0xb6e92b[_0xdf40('0x13')](0x1f4,_0x510d24['message']));});});};exports[_0xdf40('0x20')]=function(_0x5c574c){return new Promise(function(_0x155ed1,_0x433d44){return db[_0xdf40('0x19')][_0xdf40('0x21')]({'where':_0x5c574c['options']?_0x5c574c[_0xdf40('0x1b')][_0xdf40('0x1d')]||null:null})[_0xdf40('0xd')](function(_0x3c8fcc){if(_0x3c8fcc){return _0x3c8fcc[_0xdf40('0x22')](_0x5c574c[_0xdf40('0x1a')][_0xdf40('0x23')],_['omit'](_0x5c574c[_0xdf40('0x1a')],[_0xdf40('0x23'),'id'])||{});}})[_0xdf40('0x24')](function(_0x3ef3a4){logger[_0xdf40('0xe')]('AddTags',_0x5c574c);logger[_0xdf40('0x1f')](_0xdf40('0x25'),_0x5c574c,JSON[_0xdf40('0x12')](_0x3ef3a4));_0x155ed1(_0x3ef3a4);})[_0xdf40('0x17')](function(_0x2d8ecc){logger[_0xdf40('0x13')](_0xdf40('0x25'),_0x2d8ecc[_0xdf40('0x15')],_0x5c574c);_0x433d44(_this['error'](0x1f4,_0x2d8ecc[_0xdf40('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a18f212..6275c64 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 _0x2f3b=['save','remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2f3b,0xc5));var _0xb2f3=function(_0x204527,_0x59a320){_0x204527=_0x204527-0x0;var _0x22b15c=_0x2f3b[_0x204527];return _0x22b15c;};'use strict';var SmsInteractionEvents=require(_0xb2f3('0x0'));var events=[_0xb2f3('0x1'),_0xb2f3('0x2'),_0xb2f3('0x3')];function createListener(_0x3554af,_0x353372){return function(_0x37a864){_0x353372[_0xb2f3('0x4')](_0x3554af,_0x37a864);};}function removeListener(_0x298cd6,_0x5abfa0){return function(){SmsInteractionEvents[_0xb2f3('0x5')](_0x298cd6,_0x5abfa0);};}exports[_0xb2f3('0x6')]=function(_0x4b3111){for(var _0x22709c=0x0,_0x333803=events[_0xb2f3('0x7')];_0x22709c<_0x333803;_0x22709c++){var _0x2a44d5=events[_0x22709c];var _0x54fa62=createListener(_0xb2f3('0x8')+_0x2a44d5,_0x4b3111);SmsInteractionEvents['on'](_0x2a44d5,_0x54fa62);}}; \ No newline at end of file +var _0x76ea=['register','save','remove','emit','removeListener'];(function(_0x37953c,_0x5f5a8d){var _0x233d77=function(_0x26668b){while(--_0x26668b){_0x37953c['push'](_0x37953c['shift']());}};_0x233d77(++_0x5f5a8d);}(_0x76ea,0x1af));var _0xa76e=function(_0x120dbe,_0x32d8f7){_0x120dbe=_0x120dbe-0x0;var _0x37a2e8=_0x76ea[_0x120dbe];return _0x37a2e8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa76e('0x0'),_0xa76e('0x1'),'update'];function createListener(_0x7ccc2c,_0x2ff4c0){return function(_0x54f4ae){_0x2ff4c0[_0xa76e('0x2')](_0x7ccc2c,_0x54f4ae);};}function removeListener(_0x5a8fef,_0x42a161){return function(){SmsInteractionEvents[_0xa76e('0x3')](_0x5a8fef,_0x42a161);};}exports[_0xa76e('0x4')]=function(_0x41820e){for(var _0x533b53=0x0,_0x3e444b=events['length'];_0x533b53<_0x3e444b;_0x533b53++){var _0x3e3ba3=events[_0x533b53];var _0x17dab6=createListener('smsInteraction:'+_0x3e3ba3,_0x41820e);SmsInteractionEvents['on'](_0x3e3ba3,_0x17dab6);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 7f92335..dea379d 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 _0x315b=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','create','/:id/status','put','/:id/accept'];(function(_0x560836,_0x1c795b){var _0x3785be=function(_0xeecb57){while(--_0xeecb57){_0x560836['push'](_0x560836['shift']());}};_0x3785be(++_0x1c795b);}(_0x315b,0x162));var _0xb315=function(_0x1c5491,_0x267db1){_0x1c5491=_0x1c5491-0x0;var _0x167780=_0x315b[_0x1c5491];return _0x167780;};'use strict';var multer=require(_0xb315('0x0'));var util=require(_0xb315('0x1'));var path=require(_0xb315('0x2'));var timeout=require(_0xb315('0x3'));var express=require(_0xb315('0x4'));var router=express['Router']();var fs_extra=require(_0xb315('0x5'));var auth=require(_0xb315('0x6'));var interaction=require(_0xb315('0x7'));var config=require(_0xb315('0x8'));var controller=require(_0xb315('0x9'));router[_0xb315('0xa')]('/',auth[_0xb315('0xb')](),controller[_0xb315('0xc')]);router['get'](_0xb315('0xd'),auth[_0xb315('0xb')](),controller['describe']);router[_0xb315('0xa')](_0xb315('0xe'),auth[_0xb315('0xb')](),controller[_0xb315('0xf')]);router[_0xb315('0x10')]('/',auth[_0xb315('0xb')](),interaction[_0xb315('0x11')](_0xb315('0x12'),'smsmessage:create'),controller[_0xb315('0x13')]);router[_0xb315('0x10')](_0xb315('0x14'),controller['status']);router[_0xb315('0x15')](_0xb315('0xe'),auth[_0xb315('0xb')](),controller['update']);router[_0xb315('0x15')](_0xb315('0x16'),auth['isAuthenticated'](),controller[_0xb315('0x17')]);router[_0xb315('0x15')](_0xb315('0x18'),auth[_0xb315('0xb')](),controller[_0xb315('0x19')]);router[_0xb315('0x1a')](_0xb315('0xe'),auth[_0xb315('0xb')](),controller[_0xb315('0x1b')]);module[_0xb315('0x1c')]=router; \ No newline at end of file +var _0x3495=['isAuthenticated','show','post','tracked','sms','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','describe','/:id'];(function(_0x2123cf,_0x2963d5){var _0x14ceae=function(_0x5b3bd9){while(--_0x5b3bd9){_0x2123cf['push'](_0x2123cf['shift']());}};_0x14ceae(++_0x2963d5);}(_0x3495,0x1de));var _0x5349=function(_0x2f0e2e,_0x237153){_0x2f0e2e=_0x2f0e2e-0x0;var _0x1f7714=_0x3495[_0x2f0e2e];return _0x1f7714;};'use strict';var multer=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var path=require(_0x5349('0x2'));var timeout=require(_0x5349('0x3'));var express=require(_0x5349('0x4'));var router=express[_0x5349('0x5')]();var fs_extra=require(_0x5349('0x6'));var auth=require(_0x5349('0x7'));var interaction=require(_0x5349('0x8'));var config=require('../../config/environment');var controller=require(_0x5349('0x9'));router[_0x5349('0xa')]('/',auth['isAuthenticated'](),controller[_0x5349('0xb')]);router['get'](_0x5349('0xc'),auth['isAuthenticated'](),controller[_0x5349('0xd')]);router['get'](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x10')]);router[_0x5349('0x11')]('/',auth[_0x5349('0xf')](),interaction[_0x5349('0x12')](_0x5349('0x13'),'smsmessage:create'),controller[_0x5349('0x14')]);router['post'](_0x5349('0x15'),controller[_0x5349('0x16')]);router[_0x5349('0x17')](_0x5349('0xe'),auth[_0x5349('0xf')](),controller[_0x5349('0x18')]);router[_0x5349('0x17')](_0x5349('0x19'),auth[_0x5349('0xf')](),controller[_0x5349('0x1a')]);router['put'](_0x5349('0x1b'),auth[_0x5349('0xf')](),controller['reject']);router[_0x5349('0x1c')](_0x5349('0xe'),auth[_0x5349('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a3bb690..1f10450 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 _0xc3d5=['STRING','DATE','sequelize','exports','TEXT','ENUM','out'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xc3d5,0xc6));var _0x5c3d=function(_0x6e445b,_0xb9681b){_0x6e445b=_0x6e445b-0x0;var _0x1714b8=_0xc3d5[_0x6e445b];return _0x1714b8;};'use strict';var Sequelize=require(_0x5c3d('0x0'));module[_0x5c3d('0x1')]={'body':{'type':Sequelize[_0x5c3d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c3d('0x3')]('in',_0x5c3d('0x4')),'defaultValue':_0x5c3d('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5c3d('0x5')](0xbe)},'phone':{'type':Sequelize[_0x5c3d('0x5')]},'readAt':{'type':Sequelize[_0x5c3d('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5c3d('0x2')]}}; \ No newline at end of file +var _0xf505=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x16311e,_0x4784f8){var _0x3ff726=function(_0x5ea484){while(--_0x5ea484){_0x16311e['push'](_0x16311e['shift']());}};_0x3ff726(++_0x4784f8);}(_0xf505,0x1e7));var _0x5f50=function(_0x28258a,_0x22f398){_0x28258a=_0x28258a-0x0;var _0x4e968e=_0xf505[_0x28258a];return _0x4e968e;};'use strict';var Sequelize=require(_0x5f50('0x0'));module[_0x5f50('0x1')]={'body':{'type':Sequelize[_0x5f50('0x2')](_0x5f50('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5f50('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5f50('0x5')]('in',_0x5f50('0x6')),'defaultValue':_0x5f50('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5f50('0x7')](0xbe)},'phone':{'type':Sequelize[_0x5f50('0x7')]},'readAt':{'type':Sequelize[_0x5f50('0x8')]},'secret':{'type':Sequelize[_0x5f50('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5f50('0x7')]},'providerResponse':{'type':Sequelize[_0x5f50('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6f01713..f2f2c4a 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 _0x507d=['../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','request','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','include','findAll','catch','show','params','length','includeAll','options','find','create','body','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','accept','EventManager','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','QueryTypes','SmsAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x507d,0x197));var _0xd507=function(_0x376920,_0x194976){_0x376920=_0x376920-0x0;var _0x5d7019=_0x507d[_0x376920];return _0x5d7019;};'use strict';var emlformat=require(_0xd507('0x0'));var rimraf=require(_0xd507('0x1'));var zipdir=require(_0xd507('0x2'));var jsonpatch=require(_0xd507('0x3'));var rp=require('request-promise');var moment=require(_0xd507('0x4'));var BPromise=require(_0xd507('0x5'));var Mustache=require(_0xd507('0x6'));var util=require(_0xd507('0x7'));var path=require('path');var sox=require(_0xd507('0x8'));var csv=require(_0xd507('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd507('0xa'));var _=require(_0xd507('0xb'));var squel=require(_0xd507('0xc'));var crypto=require(_0xd507('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd507('0x9'));var querystring=require(_0xd507('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd507('0xf'));var qs=require(_0xd507('0x10'));var as=require(_0xd507('0x11'));var hardwareService=require(_0xd507('0x12'));var logger=require(_0xd507('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd507('0x14'));var db=require(_0xd507('0x15'))['db'];config[_0xd507('0x16')]=_[_0xd507('0x17')](config[_0xd507('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd507('0x16')]));require(_0xd507('0x18'))[_0xd507('0x19')](socket);var jayson=require(_0xd507('0x1a'));var client=jayson[_0xd507('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xd507('0x1b')][_0xd507('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x21924e,_0x4b8278,_0x42e379,_0xfae656){return new BPromise(function(_0xff1748,_0x370018){var _0x8967d2=_0xfae656||client;return _0x8967d2[_0xd507('0x1d')](_0x21924e,_0x42e379)['then'](function(_0x46493e){logger[_0xd507('0x1e')]('SmsMessage,\x20%s,\x20%s',_0x4b8278,'request\x20sent');logger[_0xd507('0x1f')](_0xd507('0x20'),_0x4b8278,_0xd507('0x21'),JSON[_0xd507('0x22')](_0x46493e));if(_0x46493e[_0xd507('0x23')]){if(_0x46493e[_0xd507('0x23')][_0xd507('0x24')]===0x1f4){logger[_0xd507('0x23')](_0xd507('0x25'),_0x4b8278,_0x46493e['error']['message']);return _0x370018(_0x46493e['error']['message']);}logger[_0xd507('0x23')]('SmsMessage,\x20%s,\x20%s',_0x4b8278,_0x46493e[_0xd507('0x23')][_0xd507('0x26')]);return _0xff1748(_0x46493e[_0xd507('0x23')][_0xd507('0x26')]);}else{logger[_0xd507('0x1e')](_0xd507('0x25'),_0x4b8278,'request\x20sent');_0xff1748(_0x46493e['result'][_0xd507('0x26')]);}})['catch'](function(_0x2e902e){logger[_0xd507('0x23')](_0xd507('0x25'),_0x4b8278,_0x2e902e);_0x370018(_0x2e902e);});});}function respondWithStatusCode(_0x444d7b,_0x447106){_0x447106=_0x447106||0xcc;return function(_0x5cb6d4){if(_0x5cb6d4){return _0x444d7b[_0xd507('0x27')](_0x447106);}return _0x444d7b[_0xd507('0x28')](_0x447106)[_0xd507('0x29')]();};}function respondWithResult(_0x35e1f8,_0x40c238){_0x40c238=_0x40c238||0xc8;return function(_0x232454){if(_0x232454){return _0x35e1f8['status'](_0x40c238)[_0xd507('0x2a')](_0x232454);}};}function respondWithFilteredResult(_0x35b3f8,_0x83ed26){return function(_0x18ae10){if(_0x18ae10){var _0x1539c2=typeof _0x83ed26['offset']===_0xd507('0x2b')&&typeof _0x83ed26[_0xd507('0x2c')]===_0xd507('0x2b');var _0x35addb=_0x18ae10[_0xd507('0x2d')];var _0x4b037f=_0x1539c2?0x0:_0x83ed26['offset'];var _0x165c38=_0x1539c2?_0x18ae10[_0xd507('0x2d')]:_0x83ed26[_0xd507('0x2e')]+_0x83ed26['limit'];var _0x4322df;if(_0x165c38>=_0x35addb){_0x165c38=_0x35addb;_0x4322df=0xc8;}else{_0x4322df=0xce;}_0x35b3f8['status'](_0x4322df);return _0x35b3f8[_0xd507('0x2f')](_0xd507('0x30'),_0x4b037f+'-'+_0x165c38+'/'+_0x35addb)[_0xd507('0x2a')](_0x18ae10);}return null;};}function patchUpdates(_0xcbf7bb){return function(_0x277230){try{jsonpatch[_0xd507('0x31')](_0x277230,_0xcbf7bb,!![]);}catch(_0x37bc60){return BPromise['reject'](_0x37bc60);}return _0x277230['save']();};}function saveUpdates(_0x1731a3,_0x2783be){return function(_0x33cb70){if(_0x33cb70){return _0x33cb70[_0xd507('0x32')](_0x1731a3)[_0xd507('0x33')](function(_0x2e1be0){return _0x2e1be0;});}return null;};}function removeEntity(_0x372d10,_0x47083b){return function(_0x42543f){if(_0x42543f){return _0x42543f[_0xd507('0x34')]()[_0xd507('0x33')](function(){_0x372d10[_0xd507('0x28')](0xcc)[_0xd507('0x29')]();});}};}function handleEntityNotFound(_0x3970ed,_0x3c98c0){return function(_0x443bb9){if(!_0x443bb9){_0x3970ed[_0xd507('0x27')](0x194);}return _0x443bb9;};}function handleError(_0x11583,_0x64b11){_0x64b11=_0x64b11||0x1f4;return function(_0x4520f4){logger['error'](_0x4520f4[_0xd507('0x35')]);if(_0x4520f4[_0xd507('0x36')]){delete _0x4520f4['name'];}_0x11583[_0xd507('0x28')](_0x64b11)[_0xd507('0x37')](_0x4520f4);};}exports[_0xd507('0x38')]=function(_0x209af3,_0x485507){var _0x237653={},_0x3ae645={},_0x38f1ea={'count':0x0,'rows':[]};var _0x334f24=_[_0xd507('0x39')](db[_0xd507('0x3a')][_0xd507('0x3b')],function(_0x29d12a){return{'name':_0x29d12a['fieldName'],'type':_0x29d12a[_0xd507('0x3c')][_0xd507('0x3d')]};});_0x3ae645[_0xd507('0x3e')]=_[_0xd507('0x39')](_0x334f24,'name');_0x3ae645[_0xd507('0x3f')]=_[_0xd507('0x40')](_0x209af3[_0xd507('0x3f')]);_0x3ae645[_0xd507('0x41')]=_['intersection'](_0x3ae645['model'],_0x3ae645[_0xd507('0x3f')]);_0x237653[_0xd507('0x42')]=_[_0xd507('0x43')](_0x3ae645['model'],qs[_0xd507('0x44')](_0x209af3[_0xd507('0x3f')][_0xd507('0x44')]));_0x237653[_0xd507('0x42')]=_0x237653[_0xd507('0x42')]['length']?_0x237653['attributes']:_0x3ae645[_0xd507('0x3e')];if(!_0x209af3[_0xd507('0x3f')][_0xd507('0x45')](_0xd507('0x46'))){_0x237653[_0xd507('0x2c')]=qs['limit'](_0x209af3[_0xd507('0x3f')][_0xd507('0x2c')]);_0x237653[_0xd507('0x2e')]=qs['offset'](_0x209af3[_0xd507('0x3f')]['offset']);}_0x237653[_0xd507('0x47')]=qs[_0xd507('0x48')](_0x209af3['query'][_0xd507('0x48')]);_0x237653['where']=qs[_0xd507('0x41')](_[_0xd507('0x49')](_0x209af3[_0xd507('0x3f')],_0x3ae645[_0xd507('0x41')]),_0x334f24);if(_0x209af3[_0xd507('0x3f')]['filter']){_0x237653['where']=_[_0xd507('0x4a')](_0x237653[_0xd507('0x4b')],{'$or':_['map'](_0x334f24,function(_0x3b048d){if(_0x3b048d['type']!==_0xd507('0x4c')){var _0x5f9496={};_0x5f9496[_0x3b048d[_0xd507('0x36')]]={'$like':'%'+_0x209af3[_0xd507('0x3f')][_0xd507('0x4d')]+'%'};return _0x5f9496;}})});}_0x237653=_[_0xd507('0x4a')]({},_0x237653,_0x209af3['options']);var _0x433b0b={'where':_0x237653['where']};return db['SmsMessage'][_0xd507('0x2d')](_0x433b0b)[_0xd507('0x33')](function(_0x45bbb4){_0x38f1ea[_0xd507('0x2d')]=_0x45bbb4;if(_0x209af3[_0xd507('0x3f')]['includeAll']){_0x237653[_0xd507('0x4e')]=[{'all':!![]}];}return db[_0xd507('0x3a')][_0xd507('0x4f')](_0x237653);})['then'](function(_0x427b26){_0x38f1ea['rows']=_0x427b26;return _0x38f1ea;})[_0xd507('0x33')](respondWithFilteredResult(_0x485507,_0x237653))[_0xd507('0x50')](handleError(_0x485507,null));};exports[_0xd507('0x51')]=function(_0x5ed1b7,_0xa8863b){var _0x368dca={'raw':!![],'where':{'id':_0x5ed1b7[_0xd507('0x52')]['id']}},_0x3c2e0f={};_0x3c2e0f[_0xd507('0x3e')]=_[_0xd507('0x40')](db[_0xd507('0x3a')][_0xd507('0x3b')]);_0x3c2e0f[_0xd507('0x3f')]=_[_0xd507('0x40')](_0x5ed1b7[_0xd507('0x3f')]);_0x3c2e0f[_0xd507('0x41')]=_[_0xd507('0x43')](_0x3c2e0f['model'],_0x3c2e0f[_0xd507('0x3f')]);_0x368dca[_0xd507('0x42')]=_[_0xd507('0x43')](_0x3c2e0f[_0xd507('0x3e')],qs[_0xd507('0x44')](_0x5ed1b7[_0xd507('0x3f')][_0xd507('0x44')]));_0x368dca['attributes']=_0x368dca[_0xd507('0x42')][_0xd507('0x53')]?_0x368dca['attributes']:_0x3c2e0f[_0xd507('0x3e')];if(_0x5ed1b7[_0xd507('0x3f')][_0xd507('0x54')]){_0x368dca[_0xd507('0x4e')]=[{'all':!![]}];}_0x368dca=_['merge']({},_0x368dca,_0x5ed1b7[_0xd507('0x55')]);return db[_0xd507('0x3a')][_0xd507('0x56')](_0x368dca)['then'](handleEntityNotFound(_0xa8863b,null))[_0xd507('0x33')](respondWithResult(_0xa8863b,null))[_0xd507('0x50')](handleError(_0xa8863b,null));};exports[_0xd507('0x57')]=function(_0x1bc371,_0x46a1b0){return db[_0xd507('0x3a')]['create'](_0x1bc371['body'],{})[_0xd507('0x33')](respondWithResult(_0x46a1b0,0xc9))['catch'](handleError(_0x46a1b0,null));};exports[_0xd507('0x32')]=function(_0x24949b,_0x5be58d){if(_0x24949b[_0xd507('0x58')]['id']){delete _0x24949b[_0xd507('0x58')]['id'];}return db[_0xd507('0x3a')][_0xd507('0x56')]({'where':{'id':_0x24949b[_0xd507('0x52')]['id']}})['then'](handleEntityNotFound(_0x5be58d,null))[_0xd507('0x33')](saveUpdates(_0x24949b['body'],null))['then'](respondWithResult(_0x5be58d,null))[_0xd507('0x50')](handleError(_0x5be58d,null));};exports[_0xd507('0x34')]=function(_0x203bf6,_0x1ebd9e){return db[_0xd507('0x3a')]['find']({'where':{'id':_0x203bf6['params']['id']}})[_0xd507('0x33')](handleEntityNotFound(_0x1ebd9e,null))[_0xd507('0x33')](removeEntity(_0x1ebd9e,null))['catch'](handleError(_0x1ebd9e,null));};exports[_0xd507('0x59')]=function(_0x27502f,_0x416c9c){return db[_0xd507('0x3a')][_0xd507('0x59')]()[_0xd507('0x33')](respondWithResult(_0x416c9c,null))[_0xd507('0x50')](handleError(_0x416c9c,null));};var interaction_log=require(_0xd507('0x13'))(_0xd507('0x5a'));exports['accept']=function(_0x2258b8,_0x504461,_0x57f0a6){var _0x2bcb67={'agent':{},'channel':_0xd507('0x5b')};if(_0x2258b8[_0xd507('0x58')]['id']){delete _0x2258b8['body']['id'];}_0x2258b8['body'][_0xd507('0x5c')]=!![];_0x2258b8[_0xd507('0x58')][_0xd507('0x5d')]=moment()[_0xd507('0x5e')](_0xd507('0x5f'));_0x2258b8['body']['UserId']=_0x2258b8[_0xd507('0x58')][_0xd507('0x60')]||_0x2258b8[_0xd507('0x61')]['id'];_0x2bcb67[_0xd507('0x62')]['id']=_0x2258b8[_0xd507('0x58')][_0xd507('0x60')];return db[_0xd507('0x3a')][_0xd507('0x56')]({'where':{'id':_0x2258b8[_0xd507('0x52')]['id'],'UserId':null}})[_0xd507('0x33')](handleEntityNotFound(_0x504461,null))[_0xd507('0x33')](saveUpdates(_0x2258b8[_0xd507('0x58')],null))['then'](function(_0x1c503f){if(_0x1c503f){_0x2bcb67['message']=_0x1c503f[_0xd507('0x63')]({'plain':!![]});return db[_0xd507('0x64')][_0xd507('0x56')]({'where':{'id':_0x1c503f[_0xd507('0x65')]}});}return null;})[_0xd507('0x33')](handleEntityNotFound(_0x504461,null))[_0xd507('0x33')](function(_0x30bdff){if(_0x30bdff){return _0x30bdff['update']({'UserId':_0x2258b8[_0xd507('0x58')][_0xd507('0x60')],'read1stAt':_['isNil'](_0x30bdff[_0xd507('0x66')])?moment()[_0xd507('0x5e')](_0xd507('0x5f')):undefined});}return null;})[_0xd507('0x33')](function(_0x5ce3a4){if(_0x5ce3a4){_0x2bcb67[_0xd507('0x67')]=_0x5ce3a4[_0xd507('0x63')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2258b8['user']['id'],_0x2258b8[_0xd507('0x61')][_0xd507('0x36')],_0x2258b8[_0xd507('0x61')]['role'],_0x2bcb67[_0xd507('0x67')]['id'],_0x2258b8[_0xd507('0x58')]?JSON['stringify'](_0x2258b8['body']):_0xd507('0x68'));return respondWithRpcPromise(_0xd507('0x69'),_0xd507('0x6a'),_0x2bcb67);}return null;})[_0xd507('0x33')](function(_0x70688d){var _0x189f8a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x70688d[_0xd507('0x26')]['ContactId'];return db[_0xd507('0x6b')][_0xd507('0x3f')](_0x189f8a,{'type':db[_0xd507('0x6c')]['QueryTypes'][_0xd507('0x6d')],'raw':!![]})[_0xd507('0x33')](function(_0x438ed1){return _0x438ed1;});})[_0xd507('0x33')](function(_0x4cde5f){if(_0x4cde5f){_0x2bcb67[_0xd507('0x26')][_0xd507('0x6e')]=_0x4cde5f[0x0];if(!_0x2258b8['body'][_0xd507('0x60')])return;return db[_0xd507('0x6f')][_0xd507('0x56')]({'where':{'id':_0x2258b8[_0xd507('0x58')][_0xd507('0x60')],'role':'agent'},'attributes':['id',_0xd507('0x36'),_0xd507('0x70'),_0xd507('0x71'),_0xd507('0x72')],'raw':!![]});}return null;})[_0xd507('0x33')](function(_0x3866cb){if(!_0x3866cb)return null;_0x2bcb67[_0xd507('0x26')][_0xd507('0x62')]=_0x3866cb;return _0x2bcb67;})[_0xd507('0x33')](function(_0x50c7b2){if(_0x50c7b2){if(_0x2258b8['body'][_0xd507('0x73')]){_0x2bcb67['message']['interface']=util[_0xd507('0x5e')](_0xd507('0x74'),_0x2258b8[_0xd507('0x61')][_0xd507('0x36')]);_0x2bcb67['message'][_0xd507('0x75')]=_0x2bcb67[_0xd507('0x75')];_0x2bcb67[_0xd507('0x26')][_0xd507('0x76')]=_0xd507('0x77');return respondWithRpcPromise(_0xd507('0x78'),_0xd507('0x78'),{'event':'acceptmessage','message':_0x2bcb67[_0xd507('0x26')]},client9002)[_0xd507('0x33')](function(){return _0x2bcb67;});}return _0x2bcb67;}return null;})['then'](respondWithResult(_0x504461,null))[_0xd507('0x50')](handleError(_0x504461,null));};var interaction_log=require(_0xd507('0x13'))(_0xd507('0x5a'));exports[_0xd507('0x79')]=function(_0x11365a,_0x5881c1,_0x2ed10a){var _0x18403b={'agent':{},'channel':_0xd507('0x5b')};if(_0x11365a[_0xd507('0x58')]['id']){delete _0x11365a[_0xd507('0x58')]['id'];}_0x11365a[_0xd507('0x58')][_0xd507('0x60')]=_0x11365a['body'][_0xd507('0x60')]||_0x11365a['user']['id'];_0x18403b[_0xd507('0x62')]['id']=_0x11365a['body'][_0xd507('0x60')];return db[_0xd507('0x3a')][_0xd507('0x56')]({'where':{'id':_0x11365a['params']['id'],'UserId':null}})[_0xd507('0x33')](handleEntityNotFound(_0x5881c1,null))[_0xd507('0x33')](function(_0x5ad9a7){if(_0x5ad9a7){_0x18403b['message']=_0x5ad9a7[_0xd507('0x63')]({'plain':!![]});return db[_0xd507('0x64')]['find']({'where':{'id':_0x5ad9a7['SmsInteractionId']}});}return null;})[_0xd507('0x33')](handleEntityNotFound(_0x5881c1,null))[_0xd507('0x33')](function(_0x5a8778){if(_0x5a8778){_0x18403b['interaction']=_0x5a8778[_0xd507('0x63')]({'plain':!![]});interaction_log[_0xd507('0x1e')](_0xd507('0x7a'),_0x11365a[_0xd507('0x61')]['id'],_0x11365a[_0xd507('0x61')][_0xd507('0x36')],_0x11365a[_0xd507('0x61')][_0xd507('0x7b')],_0x18403b[_0xd507('0x67')]['id'],_0x11365a[_0xd507('0x58')]?JSON[_0xd507('0x22')](_0x11365a['body']):_0xd507('0x68'));return respondWithRpcPromise('RejectMessage',_0xd507('0x7c'),_0x18403b);}return null;})['then'](function(_0x3adfd8){var _0x51b303='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3adfd8[_0xd507('0x26')]['ContactId'];return db[_0xd507('0x6b')][_0xd507('0x3f')](_0x51b303,{'type':db[_0xd507('0x6c')][_0xd507('0x7d')][_0xd507('0x6d')],'raw':!![]})[_0xd507('0x33')](function(_0xb64690){return _0xb64690;});})[_0xd507('0x33')](function(_0x270d9d){if(_0x270d9d){_0x18403b['message']['contact']=_0x270d9d[0x0];if(!_0x11365a[_0xd507('0x58')]['UserId'])return;return db[_0xd507('0x6f')][_0xd507('0x56')]({'where':{'id':_0x11365a[_0xd507('0x58')][_0xd507('0x60')],'role':_0xd507('0x62')},'attributes':['id',_0xd507('0x36'),'fullname',_0xd507('0x71'),_0xd507('0x72')],'raw':!![]});}return null;})[_0xd507('0x33')](function(_0x2679f0){if(!_0x2679f0)return null;_0x18403b[_0xd507('0x26')][_0xd507('0x62')]=_0x2679f0;return _0x18403b;})[_0xd507('0x33')](function(_0x3ee1df){if(_0x3ee1df){_0x3ee1df[_0xd507('0x26')]['interface']=util[_0xd507('0x5e')](_0xd507('0x74'),_0x11365a[_0xd507('0x61')][_0xd507('0x36')]);_0x3ee1df[_0xd507('0x26')][_0xd507('0x75')]=_0x18403b['channel'];_0x3ee1df[_0xd507('0x26')]['event']='reject';respondWithRpcPromise('EventManager',_0xd507('0x78'),{'event':'rejectmessage','message':_0x3ee1df['message']},client9002);return _0x18403b;}return null;})[_0xd507('0x33')](respondWithResult(_0x5881c1,null))[_0xd507('0x50')](handleError(_0x5881c1,null));};exports[_0xd507('0x28')]=function(_0x5c71b4,_0x45bc4f,_0x37a4ea){if(_0x5c71b4[_0xd507('0x58')]['id']){delete _0x5c71b4[_0xd507('0x58')]['id'];}var _0x2c9d51;return db[_0xd507('0x3a')][_0xd507('0x56')]({'where':{'id':_0x5c71b4[_0xd507('0x52')]['id']}})['then'](handleEntityNotFound(_0x45bc4f,null))['then'](function(_0x1565aa){if(_0x1565aa){_0x2c9d51=_0x1565aa;return db[_0xd507('0x7e')][_0xd507('0x56')]({'where':{'id':_0x1565aa['SmsAccountId']}});}})[_0xd507('0x33')](handleEntityNotFound(_0x45bc4f,null))[_0xd507('0x33')](function(_0x32fa02){if(_0x32fa02){logger[_0xd507('0x1f')](_0xd507('0x20'),'status',_0xd507('0x7f'),_0x32fa02['type'],util[_0xd507('0x80')](_0x5c71b4[_0xd507('0x58')],{'showHidden':![],'depth':null}));switch(_0x32fa02[_0xd507('0x3c')]){case'twilio':if(_0x5c71b4[_0xd507('0x58')][_0xd507('0x81')]&&_0x5c71b4[_0xd507('0x58')][_0xd507('0x81')]===_0x2c9d51[_0xd507('0x82')]){return _0x2c9d51['update']({'read':!![]});}else{logger['error'](_0xd507('0x83'),_0xd507('0x28'),_0xd507('0x84'),util[_0xd507('0x80')](_0x5c71b4[_0xd507('0x58')],{'showHidden':![],'depth':null}));}break;case _0xd507('0x85'):if(_0x5c71b4[_0xd507('0x58')][_0xd507('0x86')]&&_0x5c71b4[_0xd507('0x58')][_0xd507('0x86')]===_0x2c9d51['messageId']&&_[_0xd507('0x87')]([_0xd507('0x88'),_0xd507('0x89')],_0x5c71b4[_0xd507('0x58')]['Status'])>=0x0){return _0x2c9d51[_0xd507('0x32')]({'read':!![]});}else{logger['error'](_0xd507('0x83'),'status','plivio',util[_0xd507('0x80')](_0x5c71b4[_0xd507('0x58')],{'showHidden':![],'depth':null}));}break;case _0xd507('0x8a'):var _0x5be9f6=_0x5c71b4[_0xd507('0x58')][_0xd507('0x8b')][0x0];if(_0x5be9f6['status'][_0xd507('0x8c')]===_0xd507('0x8d')){return _0x2c9d51['update']({'read':!![]});}else{logger[_0xd507('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd507('0x28'),_0xd507('0x8a'),util[_0xd507('0x80')](_0x5c71b4[_0xd507('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x2c9d51;}})['then'](respondWithResult(_0x45bc4f,null))[_0xd507('0x50')](handleError(_0x45bc4f,null));}; \ No newline at end of file +var _0x4cac=['User','fullname','email','internal','SIP/%s','channel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','interface','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','options','include','findAll','rows','params','SmsMessage','rawAttributes','includeAll','find','create','body','describe','sms-interactions','accept','read','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','contact'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x4cac,0x139));var _0xc4ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4cac[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc4ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc4ca('0x1'));var rp=require(_0xc4ca('0x2'));var moment=require(_0xc4ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc4ca('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc4ca('0x5'));var ejs=require(_0xc4ca('0x6'));var fs=require('fs');var fs_extra=require(_0xc4ca('0x7'));var _=require(_0xc4ca('0x8'));var squel=require(_0xc4ca('0x9'));var crypto=require(_0xc4ca('0xa'));var jsforce=require(_0xc4ca('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc4ca('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc4ca('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xc4ca('0xd'));var as=require(_0xc4ca('0xe'));var hardwareService=require(_0xc4ca('0xf'));var logger=require(_0xc4ca('0x10'))(_0xc4ca('0x11'));var utils=require(_0xc4ca('0x12'));var config=require(_0xc4ca('0x13'));var licenseUtil=require(_0xc4ca('0x14'));var db=require(_0xc4ca('0x15'))['db'];config[_0xc4ca('0x16')]=_['defaults'](config[_0xc4ca('0x16')],{'host':_0xc4ca('0x17'),'port':0x18eb});var socket=require(_0xc4ca('0x18'))(new Redis(config[_0xc4ca('0x16')]));require(_0xc4ca('0x19'))[_0xc4ca('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc4ca('0x1b')][_0xc4ca('0x1c')]({'port':0x232c});var client9002=jayson[_0xc4ca('0x1b')][_0xc4ca('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x499ee6,_0x1b49ff,_0x7f5952,_0x5e669f){return new BPromise(function(_0x53b14b,_0x9dfec1){var _0x50c230=_0x5e669f||client;return _0x50c230[_0xc4ca('0x1d')](_0x499ee6,_0x7f5952)[_0xc4ca('0x1e')](function(_0x559445){logger[_0xc4ca('0x1f')](_0xc4ca('0x20'),_0x1b49ff,_0xc4ca('0x21'));logger[_0xc4ca('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1b49ff,_0xc4ca('0x21'),JSON[_0xc4ca('0x23')](_0x559445));if(_0x559445['error']){if(_0x559445['error']['code']===0x1f4){logger[_0xc4ca('0x24')](_0xc4ca('0x20'),_0x1b49ff,_0x559445[_0xc4ca('0x24')]['message']);return _0x9dfec1(_0x559445['error'][_0xc4ca('0x25')]);}logger[_0xc4ca('0x24')](_0xc4ca('0x20'),_0x1b49ff,_0x559445[_0xc4ca('0x24')]['message']);return _0x53b14b(_0x559445[_0xc4ca('0x24')]['message']);}else{logger[_0xc4ca('0x1f')](_0xc4ca('0x20'),_0x1b49ff,_0xc4ca('0x21'));_0x53b14b(_0x559445[_0xc4ca('0x26')][_0xc4ca('0x25')]);}})[_0xc4ca('0x27')](function(_0x320fd8){logger[_0xc4ca('0x24')](_0xc4ca('0x20'),_0x1b49ff,_0x320fd8);_0x9dfec1(_0x320fd8);});});}function respondWithStatusCode(_0x55430b,_0x399318){_0x399318=_0x399318||0xcc;return function(_0x58458d){if(_0x58458d){return _0x55430b['sendStatus'](_0x399318);}return _0x55430b[_0xc4ca('0x28')](_0x399318)[_0xc4ca('0x29')]();};}function respondWithResult(_0x5ae833,_0x266619){_0x266619=_0x266619||0xc8;return function(_0x59fe91){if(_0x59fe91){return _0x5ae833[_0xc4ca('0x28')](_0x266619)[_0xc4ca('0x2a')](_0x59fe91);}};}function respondWithFilteredResult(_0x333278,_0x1341f3){return function(_0x29f5be){if(_0x29f5be){var _0x1e4742=typeof _0x1341f3[_0xc4ca('0x2b')]===_0xc4ca('0x2c')&&typeof _0x1341f3[_0xc4ca('0x2d')]===_0xc4ca('0x2c');var _0x1238a9=_0x29f5be[_0xc4ca('0x2e')];var _0x2b8162=_0x1e4742?0x0:_0x1341f3[_0xc4ca('0x2b')];var _0x1e4e19=_0x1e4742?_0x29f5be[_0xc4ca('0x2e')]:_0x1341f3[_0xc4ca('0x2b')]+_0x1341f3[_0xc4ca('0x2d')];var _0x35726b;if(_0x1e4e19>=_0x1238a9){_0x1e4e19=_0x1238a9;_0x35726b=0xc8;}else{_0x35726b=0xce;}_0x333278[_0xc4ca('0x28')](_0x35726b);return _0x333278[_0xc4ca('0x2f')](_0xc4ca('0x30'),_0x2b8162+'-'+_0x1e4e19+'/'+_0x1238a9)[_0xc4ca('0x2a')](_0x29f5be);}return null;};}function patchUpdates(_0x49f000){return function(_0xd022a0){try{jsonpatch['apply'](_0xd022a0,_0x49f000,!![]);}catch(_0xc531cb){return BPromise[_0xc4ca('0x31')](_0xc531cb);}return _0xd022a0[_0xc4ca('0x32')]();};}function saveUpdates(_0x3500b1,_0xc24ed3){return function(_0x1783e3){if(_0x1783e3){return _0x1783e3[_0xc4ca('0x33')](_0x3500b1)[_0xc4ca('0x1e')](function(_0x4b5449){return _0x4b5449;});}return null;};}function removeEntity(_0x370678,_0x323a67){return function(_0x2092e5){if(_0x2092e5){return _0x2092e5[_0xc4ca('0x34')]()[_0xc4ca('0x1e')](function(){_0x370678['status'](0xcc)[_0xc4ca('0x29')]();});}};}function handleEntityNotFound(_0x24feae,_0xa91aee){return function(_0x25138a){if(!_0x25138a){_0x24feae['sendStatus'](0x194);}return _0x25138a;};}function handleError(_0x398daa,_0xc83fc7){_0xc83fc7=_0xc83fc7||0x1f4;return function(_0xb53a7b){logger[_0xc4ca('0x24')](_0xb53a7b[_0xc4ca('0x35')]);if(_0xb53a7b[_0xc4ca('0x36')]){delete _0xb53a7b[_0xc4ca('0x36')];}_0x398daa['status'](_0xc83fc7)[_0xc4ca('0x37')](_0xb53a7b);};}exports[_0xc4ca('0x38')]=function(_0x696763,_0x3724a0){var _0x58c93b={},_0x262ccc={},_0x25f40e={'count':0x0,'rows':[]};var _0x490c54=_[_0xc4ca('0x39')](db['SmsMessage']['rawAttributes'],function(_0xfb0e95){return{'name':_0xfb0e95['fieldName'],'type':_0xfb0e95['type'][_0xc4ca('0x3a')]};});_0x262ccc[_0xc4ca('0x3b')]=_['map'](_0x490c54,_0xc4ca('0x36'));_0x262ccc[_0xc4ca('0x3c')]=_[_0xc4ca('0x3d')](_0x696763[_0xc4ca('0x3c')]);_0x262ccc[_0xc4ca('0x3e')]=_[_0xc4ca('0x3f')](_0x262ccc['model'],_0x262ccc['query']);_0x58c93b[_0xc4ca('0x40')]=_['intersection'](_0x262ccc[_0xc4ca('0x3b')],qs[_0xc4ca('0x41')](_0x696763[_0xc4ca('0x3c')][_0xc4ca('0x41')]));_0x58c93b[_0xc4ca('0x40')]=_0x58c93b[_0xc4ca('0x40')][_0xc4ca('0x42')]?_0x58c93b[_0xc4ca('0x40')]:_0x262ccc['model'];if(!_0x696763[_0xc4ca('0x3c')][_0xc4ca('0x43')]('nolimit')){_0x58c93b[_0xc4ca('0x2d')]=qs[_0xc4ca('0x2d')](_0x696763[_0xc4ca('0x3c')][_0xc4ca('0x2d')]);_0x58c93b[_0xc4ca('0x2b')]=qs[_0xc4ca('0x2b')](_0x696763['query'][_0xc4ca('0x2b')]);}_0x58c93b[_0xc4ca('0x44')]=qs[_0xc4ca('0x45')](_0x696763[_0xc4ca('0x3c')]['sort']);_0x58c93b['where']=qs[_0xc4ca('0x3e')](_['pick'](_0x696763[_0xc4ca('0x3c')],_0x262ccc['filters']),_0x490c54);if(_0x696763[_0xc4ca('0x3c')][_0xc4ca('0x46')]){_0x58c93b[_0xc4ca('0x47')]=_[_0xc4ca('0x48')](_0x58c93b['where'],{'$or':_[_0xc4ca('0x39')](_0x490c54,function(_0x38d485){if(_0x38d485[_0xc4ca('0x49')]!=='VIRTUAL'){var _0x4f47a6={};_0x4f47a6[_0x38d485[_0xc4ca('0x36')]]={'$like':'%'+_0x696763[_0xc4ca('0x3c')][_0xc4ca('0x46')]+'%'};return _0x4f47a6;}})});}_0x58c93b=_['merge']({},_0x58c93b,_0x696763[_0xc4ca('0x4a')]);var _0x105943={'where':_0x58c93b['where']};return db['SmsMessage'][_0xc4ca('0x2e')](_0x105943)[_0xc4ca('0x1e')](function(_0x41d397){_0x25f40e[_0xc4ca('0x2e')]=_0x41d397;if(_0x696763[_0xc4ca('0x3c')]['includeAll']){_0x58c93b[_0xc4ca('0x4b')]=[{'all':!![]}];}return db['SmsMessage'][_0xc4ca('0x4c')](_0x58c93b);})[_0xc4ca('0x1e')](function(_0x5cf6d0){_0x25f40e[_0xc4ca('0x4d')]=_0x5cf6d0;return _0x25f40e;})[_0xc4ca('0x1e')](respondWithFilteredResult(_0x3724a0,_0x58c93b))[_0xc4ca('0x27')](handleError(_0x3724a0,null));};exports['show']=function(_0x16cd64,_0x67972b){var _0x5d718c={'raw':!![],'where':{'id':_0x16cd64[_0xc4ca('0x4e')]['id']}},_0x135a23={};_0x135a23['model']=_[_0xc4ca('0x3d')](db[_0xc4ca('0x4f')][_0xc4ca('0x50')]);_0x135a23[_0xc4ca('0x3c')]=_['keys'](_0x16cd64['query']);_0x135a23[_0xc4ca('0x3e')]=_[_0xc4ca('0x3f')](_0x135a23['model'],_0x135a23[_0xc4ca('0x3c')]);_0x5d718c[_0xc4ca('0x40')]=_[_0xc4ca('0x3f')](_0x135a23['model'],qs['fields'](_0x16cd64[_0xc4ca('0x3c')][_0xc4ca('0x41')]));_0x5d718c[_0xc4ca('0x40')]=_0x5d718c[_0xc4ca('0x40')][_0xc4ca('0x42')]?_0x5d718c['attributes']:_0x135a23[_0xc4ca('0x3b')];if(_0x16cd64[_0xc4ca('0x3c')][_0xc4ca('0x51')]){_0x5d718c['include']=[{'all':!![]}];}_0x5d718c=_[_0xc4ca('0x48')]({},_0x5d718c,_0x16cd64[_0xc4ca('0x4a')]);return db[_0xc4ca('0x4f')][_0xc4ca('0x52')](_0x5d718c)['then'](handleEntityNotFound(_0x67972b,null))[_0xc4ca('0x1e')](respondWithResult(_0x67972b,null))[_0xc4ca('0x27')](handleError(_0x67972b,null));};exports['create']=function(_0x11e9c4,_0x1358bd){return db[_0xc4ca('0x4f')][_0xc4ca('0x53')](_0x11e9c4[_0xc4ca('0x54')],{})[_0xc4ca('0x1e')](respondWithResult(_0x1358bd,0xc9))[_0xc4ca('0x27')](handleError(_0x1358bd,null));};exports[_0xc4ca('0x33')]=function(_0x2447a0,_0x16a91a){if(_0x2447a0[_0xc4ca('0x54')]['id']){delete _0x2447a0[_0xc4ca('0x54')]['id'];}return db['SmsMessage'][_0xc4ca('0x52')]({'where':{'id':_0x2447a0['params']['id']}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x16a91a,null))['then'](saveUpdates(_0x2447a0[_0xc4ca('0x54')],null))[_0xc4ca('0x1e')](respondWithResult(_0x16a91a,null))[_0xc4ca('0x27')](handleError(_0x16a91a,null));};exports[_0xc4ca('0x34')]=function(_0xd149f1,_0x2bb24d){return db[_0xc4ca('0x4f')][_0xc4ca('0x52')]({'where':{'id':_0xd149f1[_0xc4ca('0x4e')]['id']}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x2bb24d,null))['then'](removeEntity(_0x2bb24d,null))[_0xc4ca('0x27')](handleError(_0x2bb24d,null));};exports[_0xc4ca('0x55')]=function(_0x1c84a3,_0x167f67){return db[_0xc4ca('0x4f')]['describe']()[_0xc4ca('0x1e')](respondWithResult(_0x167f67,null))[_0xc4ca('0x27')](handleError(_0x167f67,null));};var interaction_log=require(_0xc4ca('0x10'))(_0xc4ca('0x56'));exports[_0xc4ca('0x57')]=function(_0x3981c8,_0x337e82,_0x58d01d){var _0x5f148e={'agent':{},'channel':'sms'};if(_0x3981c8[_0xc4ca('0x54')]['id']){delete _0x3981c8['body']['id'];}_0x3981c8[_0xc4ca('0x54')][_0xc4ca('0x58')]=!![];_0x3981c8['body'][_0xc4ca('0x59')]=moment()[_0xc4ca('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x3981c8['body'][_0xc4ca('0x5b')]=_0x3981c8[_0xc4ca('0x54')]['UserId']||_0x3981c8['user']['id'];_0x5f148e[_0xc4ca('0x5c')]['id']=_0x3981c8[_0xc4ca('0x54')][_0xc4ca('0x5b')];return db['SmsMessage'][_0xc4ca('0x52')]({'where':{'id':_0x3981c8[_0xc4ca('0x4e')]['id'],'UserId':null}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x337e82,null))[_0xc4ca('0x1e')](saveUpdates(_0x3981c8[_0xc4ca('0x54')],null))[_0xc4ca('0x1e')](function(_0x3d82b7){if(_0x3d82b7){_0x5f148e['message']=_0x3d82b7[_0xc4ca('0x5d')]({'plain':!![]});return db[_0xc4ca('0x5e')][_0xc4ca('0x52')]({'where':{'id':_0x3d82b7[_0xc4ca('0x5f')]}});}return null;})[_0xc4ca('0x1e')](handleEntityNotFound(_0x337e82,null))[_0xc4ca('0x1e')](function(_0x468f98){if(_0x468f98){return _0x468f98[_0xc4ca('0x33')]({'UserId':_0x3981c8[_0xc4ca('0x54')]['UserId'],'read1stAt':_[_0xc4ca('0x60')](_0x468f98['read1stAt'])?moment()[_0xc4ca('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc4ca('0x1e')](function(_0x3befe1){if(_0x3befe1){_0x5f148e[_0xc4ca('0x61')]=_0x3befe1['get']({'plain':!![]});interaction_log[_0xc4ca('0x1f')](_0xc4ca('0x62'),_0x3981c8[_0xc4ca('0x63')]['id'],_0x3981c8[_0xc4ca('0x63')][_0xc4ca('0x36')],_0x3981c8[_0xc4ca('0x63')]['role'],_0x5f148e[_0xc4ca('0x61')]['id'],_0x3981c8[_0xc4ca('0x54')]?JSON[_0xc4ca('0x23')](_0x3981c8[_0xc4ca('0x54')]):_0xc4ca('0x64'));return respondWithRpcPromise(_0xc4ca('0x65'),_0xc4ca('0x66'),_0x5f148e);}return null;})[_0xc4ca('0x1e')](function(_0x4b10e9){var _0x2d508b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b10e9[_0xc4ca('0x25')]['ContactId'];return db[_0xc4ca('0x67')]['query'](_0x2d508b,{'type':db['Sequelize'][_0xc4ca('0x68')][_0xc4ca('0x69')],'raw':!![]})[_0xc4ca('0x1e')](function(_0x4b40e6){return _0x4b40e6;});})['then'](function(_0x26c6bc){if(_0x26c6bc){_0x5f148e[_0xc4ca('0x25')][_0xc4ca('0x6a')]=_0x26c6bc[0x0];if(!_0x3981c8['body'][_0xc4ca('0x5b')])return;return db[_0xc4ca('0x6b')][_0xc4ca('0x52')]({'where':{'id':_0x3981c8[_0xc4ca('0x54')][_0xc4ca('0x5b')],'role':_0xc4ca('0x5c')},'attributes':['id','name',_0xc4ca('0x6c'),_0xc4ca('0x6d'),_0xc4ca('0x6e')],'raw':!![]});}return null;})['then'](function(_0x24f718){if(!_0x24f718)return null;_0x5f148e['message'][_0xc4ca('0x5c')]=_0x24f718;return _0x5f148e;})[_0xc4ca('0x1e')](function(_0x881e73){if(_0x881e73){if(_0x3981c8[_0xc4ca('0x54')]['manual']){_0x5f148e[_0xc4ca('0x25')]['interface']=util[_0xc4ca('0x5a')](_0xc4ca('0x6f'),_0x3981c8['user']['name']);_0x5f148e['message'][_0xc4ca('0x70')]=_0x5f148e[_0xc4ca('0x70')];_0x5f148e[_0xc4ca('0x25')][_0xc4ca('0x71')]='accept';return respondWithRpcPromise(_0xc4ca('0x72'),_0xc4ca('0x72'),{'event':'acceptmessage','message':_0x5f148e[_0xc4ca('0x25')]},client9002)[_0xc4ca('0x1e')](function(){return _0x5f148e;});}return _0x5f148e;}return null;})[_0xc4ca('0x1e')](respondWithResult(_0x337e82,null))['catch'](handleError(_0x337e82,null));};var interaction_log=require(_0xc4ca('0x10'))(_0xc4ca('0x56'));exports['reject']=function(_0x4f377f,_0x42310b,_0x1ab558){var _0x6c3d50={'agent':{},'channel':'sms'};if(_0x4f377f['body']['id']){delete _0x4f377f[_0xc4ca('0x54')]['id'];}_0x4f377f[_0xc4ca('0x54')][_0xc4ca('0x5b')]=_0x4f377f['body'][_0xc4ca('0x5b')]||_0x4f377f[_0xc4ca('0x63')]['id'];_0x6c3d50[_0xc4ca('0x5c')]['id']=_0x4f377f[_0xc4ca('0x54')]['UserId'];return db[_0xc4ca('0x4f')]['find']({'where':{'id':_0x4f377f[_0xc4ca('0x4e')]['id'],'UserId':null}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x42310b,null))[_0xc4ca('0x1e')](function(_0x2efcae){if(_0x2efcae){_0x6c3d50[_0xc4ca('0x25')]=_0x2efcae[_0xc4ca('0x5d')]({'plain':!![]});return db[_0xc4ca('0x5e')][_0xc4ca('0x52')]({'where':{'id':_0x2efcae['SmsInteractionId']}});}return null;})[_0xc4ca('0x1e')](handleEntityNotFound(_0x42310b,null))[_0xc4ca('0x1e')](function(_0x51bb98){if(_0x51bb98){_0x6c3d50[_0xc4ca('0x61')]=_0x51bb98[_0xc4ca('0x5d')]({'plain':!![]});interaction_log['info'](_0xc4ca('0x73'),_0x4f377f[_0xc4ca('0x63')]['id'],_0x4f377f[_0xc4ca('0x63')][_0xc4ca('0x36')],_0x4f377f[_0xc4ca('0x63')][_0xc4ca('0x74')],_0x6c3d50[_0xc4ca('0x61')]['id'],_0x4f377f[_0xc4ca('0x54')]?JSON['stringify'](_0x4f377f[_0xc4ca('0x54')]):_0xc4ca('0x64'));return respondWithRpcPromise(_0xc4ca('0x75'),_0xc4ca('0x76'),_0x6c3d50);}return null;})[_0xc4ca('0x1e')](function(_0x2610e4){var _0x11530b=_0xc4ca('0x77')+_0x2610e4['message'][_0xc4ca('0x78')];return db['sequelize'][_0xc4ca('0x3c')](_0x11530b,{'type':db[_0xc4ca('0x79')][_0xc4ca('0x68')][_0xc4ca('0x69')],'raw':!![]})[_0xc4ca('0x1e')](function(_0xfa6f61){return _0xfa6f61;});})[_0xc4ca('0x1e')](function(_0x4e9b84){if(_0x4e9b84){_0x6c3d50[_0xc4ca('0x25')]['contact']=_0x4e9b84[0x0];if(!_0x4f377f['body']['UserId'])return;return db[_0xc4ca('0x6b')][_0xc4ca('0x52')]({'where':{'id':_0x4f377f[_0xc4ca('0x54')][_0xc4ca('0x5b')],'role':_0xc4ca('0x5c')},'attributes':['id',_0xc4ca('0x36'),'fullname',_0xc4ca('0x6d'),_0xc4ca('0x6e')],'raw':!![]});}return null;})[_0xc4ca('0x1e')](function(_0x57e68e){if(!_0x57e68e)return null;_0x6c3d50[_0xc4ca('0x25')][_0xc4ca('0x5c')]=_0x57e68e;return _0x6c3d50;})[_0xc4ca('0x1e')](function(_0x470f1e){if(_0x470f1e){_0x470f1e['message'][_0xc4ca('0x7a')]=util[_0xc4ca('0x5a')]('SIP/%s',_0x4f377f[_0xc4ca('0x63')][_0xc4ca('0x36')]);_0x470f1e[_0xc4ca('0x25')][_0xc4ca('0x70')]=_0x6c3d50[_0xc4ca('0x70')];_0x470f1e[_0xc4ca('0x25')]['event']=_0xc4ca('0x31');respondWithRpcPromise(_0xc4ca('0x72'),_0xc4ca('0x72'),{'event':_0xc4ca('0x7b'),'message':_0x470f1e['message']},client9002);return _0x6c3d50;}return null;})[_0xc4ca('0x1e')](respondWithResult(_0x42310b,null))[_0xc4ca('0x27')](handleError(_0x42310b,null));};exports[_0xc4ca('0x28')]=function(_0x2f8eb3,_0x4b95f3,_0x11c902){if(_0x2f8eb3['body']['id']){delete _0x2f8eb3['body']['id'];}var _0xc1bb39;return db['SmsMessage']['find']({'where':{'id':_0x2f8eb3['params']['id']}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x4b95f3,null))[_0xc4ca('0x1e')](function(_0x3da067){if(_0x3da067){_0xc1bb39=_0x3da067;return db[_0xc4ca('0x7c')][_0xc4ca('0x52')]({'where':{'id':_0x3da067['SmsAccountId']}});}})[_0xc4ca('0x1e')](handleEntityNotFound(_0x4b95f3,null))['then'](function(_0x1e00d2){if(_0x1e00d2){logger[_0xc4ca('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc4ca('0x28'),_0xc4ca('0x7d'),_0x1e00d2[_0xc4ca('0x49')],util['inspect'](_0x2f8eb3['body'],{'showHidden':![],'depth':null}));switch(_0x1e00d2[_0xc4ca('0x49')]){case _0xc4ca('0x7e'):if(_0x2f8eb3[_0xc4ca('0x54')][_0xc4ca('0x7f')]&&_0x2f8eb3[_0xc4ca('0x54')][_0xc4ca('0x7f')]===_0xc1bb39[_0xc4ca('0x80')]){return _0xc1bb39[_0xc4ca('0x33')]({'read':!![]});}else{logger[_0xc4ca('0x24')](_0xc4ca('0x81'),_0xc4ca('0x28'),_0xc4ca('0x7e'),util[_0xc4ca('0x82')](_0x2f8eb3['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2f8eb3['body'][_0xc4ca('0x83')]&&_0x2f8eb3[_0xc4ca('0x54')][_0xc4ca('0x83')]===_0xc1bb39[_0xc4ca('0x80')]&&_[_0xc4ca('0x84')]([_0xc4ca('0x85'),_0xc4ca('0x86')],_0x2f8eb3[_0xc4ca('0x54')][_0xc4ca('0x87')])>=0x0){return _0xc1bb39['update']({'read':!![]});}else{logger[_0xc4ca('0x24')](_0xc4ca('0x81'),'status',_0xc4ca('0x88'),util[_0xc4ca('0x82')](_0x2f8eb3['body'],{'showHidden':![],'depth':null}));}break;case _0xc4ca('0x89'):var _0x52dd75=_0x2f8eb3['body'][_0xc4ca('0x8a')][0x0];if(_0x52dd75[_0xc4ca('0x28')]['groupName']===_0xc4ca('0x8b')){return _0xc1bb39[_0xc4ca('0x33')]({'read':!![]});}else{logger[_0xc4ca('0x24')](_0xc4ca('0x81'),_0xc4ca('0x28'),_0xc4ca('0x89'),util[_0xc4ca('0x82')](_0x2f8eb3[_0xc4ca('0x54')],{'showHidden':![],'depth':null}));}break;}return _0xc1bb39;}})[_0xc4ca('0x1e')](respondWithResult(_0x4b95f3,null))[_0xc4ca('0x27')](handleError(_0x4b95f3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c82d7a4..001616c 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 _0x6124=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1b18d7,_0x5161b1){var _0x41ca2d=function(_0x1e7097){while(--_0x1e7097){_0x1b18d7['push'](_0x1b18d7['shift']());}};_0x41ca2d(++_0x5161b1);}(_0x6124,0x1d7));var _0x4612=function(_0x3766e3,_0x232039){_0x3766e3=_0x3766e3-0x0;var _0x36e09e=_0x6124[_0x3766e3];return _0x36e09e;};'use strict';var EventEmitter=require(_0x4612('0x0'));var SmsMessage=require(_0x4612('0x1'))['db'][_0x4612('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4612('0x3')](0x0);var events={'afterCreate':_0x4612('0x4'),'afterUpdate':_0x4612('0x5'),'afterDestroy':_0x4612('0x6')};function emitEvent(_0x188f22){return function(_0x1304d3,_0x2c35aa,_0x3f9111){SmsMessageEvents['emit'](_0x188f22+':'+_0x1304d3['id'],_0x1304d3);SmsMessageEvents[_0x4612('0x7')](_0x188f22,_0x1304d3);_0x3f9111(null);};}for(var e in events){if(events[_0x4612('0x8')](e)){var event=events[e];SmsMessage[_0x4612('0x9')](e,emitEvent(event));}}module[_0x4612('0xa')]=SmsMessageEvents; \ No newline at end of file +var _0xa946=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xa946,0x127));var _0x6a94=function(_0x41bd33,_0x8dd533){_0x41bd33=_0x41bd33-0x0;var _0x1ef83a=_0xa946[_0x41bd33];return _0x1ef83a;};'use strict';var EventEmitter=require(_0x6a94('0x0'));var SmsMessage=require(_0x6a94('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6a94('0x2')](0x0);var events={'afterCreate':_0x6a94('0x3'),'afterUpdate':'update','afterDestroy':_0x6a94('0x4')};function emitEvent(_0x1825a3){return function(_0x221d96,_0x592a98,_0x38f5e3){SmsMessageEvents[_0x6a94('0x5')](_0x1825a3+':'+_0x221d96['id'],_0x221d96);SmsMessageEvents[_0x6a94('0x5')](_0x1825a3,_0x221d96);_0x38f5e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x6a94('0x6')](e,emitEvent(event));}}module[_0x6a94('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 895f308..ceb92f6 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 _0x09dd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteraction','update','createdAt','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','create','remote','/api/sms/messages/','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','phone','smsMethod','sender','login?username=','password','GET','split','user_key','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','POST','format','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','read','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','/auth/1/session','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','token','infobip','Missing\x20parameters:\x20base_url','crypto','text','timestamp','sort','length','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally'];(function(_0x18c2d3,_0x2f350b){var _0x225064=function(_0x43c33f){while(--_0x43c33f){_0x18c2d3['push'](_0x18c2d3['shift']());}};_0x225064(++_0x2f350b);}(_0x09dd,0x81));var _0xd09d=function(_0x2a1dc3,_0x2bcbcc){_0x2a1dc3=_0x2a1dc3-0x0;var _0x4f0d17=_0x09dd[_0x2a1dc3];return _0x4f0d17;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require(_0xd09d('0x9'));var attributes=require(_0xd09d('0xa'));module[_0xd09d('0xb')]=function(_0x3410c4,_0x2034af){return _0x3410c4['define'](_0xd09d('0xc'),attributes,{'tableName':_0xd09d('0xd'),'paranoid':![],'indexes':[{'name':_0xd09d('0xe'),'fields':[_0xd09d('0xe')]},{'name':_0xd09d('0xf'),'fields':[_0xd09d('0x10')],'type':_0xd09d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47d9d8,_0x442411,_0x235b0d){var _0x22572f=_0x3410c4[_0xd09d('0x12')];var _0x1a03ec=_0x47d9d8['get']({'plain':!![]});if(_0x1a03ec[_0xd09d('0x13')][_0xd09d('0x14')]()==='in'||_0x1a03ec[_0xd09d('0x13')][_0xd09d('0x14')]()===_0xd09d('0x15')&&!_0x1a03ec[_0xd09d('0x16')]&&!_[_0xd09d('0x17')](_0x1a03ec['UserId'])){_0x22572f[_0xd09d('0x18')]['findOne']({'where':{'id':_0x1a03ec['SmsInteractionId']}})['then'](function(_0x24aae0){if(_0x24aae0){_0x24aae0[_0xd09d('0x19')]({'lastMsgAt':_0x1a03ec[_0xd09d('0x1a')],'lastMsgDirection':_0x1a03ec[_0xd09d('0x13')][_0xd09d('0x14')]()});}})['catch'](function(_0x435cff){console[_0xd09d('0x1b')](_0x435cff);});}if(_0x1a03ec['direction']===_0xd09d('0x15')&&!_0x1a03ec['secret']){var _0x1a1b40;_0x22572f[_0xd09d('0x1c')]['find']({'where':{'id':_0x1a03ec[_0xd09d('0x1d')]},'raw':!![]})[_0xd09d('0x1e')](function(_0x23bea4){_0x1a1b40=_0x23bea4;if(_0x1a1b40&&_0x1a1b40[_0xd09d('0x1f')]){switch(_0x1a1b40['type']){case _0xd09d('0x20'):var _0x5a26b1=require(_0xd09d('0x20'));if(_0x1a1b40[_0xd09d('0x21')]&&_0x1a1b40['authToken']&&_0x1a1b40['phone']){var _0x549b19=new _0x5a26b1(_0x1a1b40[_0xd09d('0x21')],_0x1a1b40[_0xd09d('0x22')]);_0x549b19['messages'][_0xd09d('0x23')]({'body':_0x1a03ec['body'],'to':_0x1a03ec['phone'],'from':_0x1a1b40['phone'],'statusCallback':_0x1a1b40[_0xd09d('0x24')]+_0xd09d('0x25')+_0x1a03ec['id']+'/status?token='+_0x1a1b40['token']})[_0xd09d('0x1e')](function(_0x2e9bbe){if(_0x2e9bbe[_0xd09d('0x26')]){return _0x47d9d8[_0xd09d('0x19')]({'messageId':_0x2e9bbe[_0xd09d('0x26')]});}})[_0xd09d('0x27')](function(_0x5dc0e6){logger[_0xd09d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),_0xd09d('0x20'),util[_0xd09d('0x29')](_0x5dc0e6,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x20'),_0xd09d('0x2b'));}break;case _0xd09d('0x2c'):var _0x35977e=_0xd09d('0x2d');if(_0x1a1b40[_0xd09d('0x2e')]&&_0x1a1b40['password']){var _0x2628cc={'recipient':[_0x1a03ec[_0xd09d('0x2f')]],'message':_0x1a03ec[_0xd09d('0x10')],'message_type':_0x1a1b40[_0xd09d('0x30')]};if(_0x1a1b40[_0xd09d('0x30')]&&_0x1a1b40[_0xd09d('0x30')]!=='SI'){_0x2628cc[_0xd09d('0x31')]=_0x1a1b40['phone'];}var _0x16a97a={'url':_0x35977e+_0xd09d('0x32')+_0x1a1b40['username']+'&password='+_0x1a1b40[_0xd09d('0x33')],'method':_0xd09d('0x34')};rp(_0x16a97a)[_0xd09d('0x1e')](function(_0xd68323){var _0x3ce1e=_0xd68323[_0xd09d('0x35')](';');var _0x3d05de={'user_key':_0x3ce1e[0x0],'session_key':_0x3ce1e[0x1]};_0x16a97a={'url':_0x35977e+'sms','method':'POST','headers':{'user_key':_0x3d05de[_0xd09d('0x36')],'Session_key':_0x3d05de[_0xd09d('0x37')]},'json':!![],'body':_0x2628cc};return rp(_0x16a97a);})[_0xd09d('0x1e')](function(_0x3547c3){if(_0x3547c3[_0xd09d('0x38')]>=0x1){var _0x529f8d={'messageId':_0x3547c3['internal_order_id']};if(_0x1a1b40['smsMethod']!=='GP'||!_0x1a1b40[_0xd09d('0x39')]){_0x529f8d['read']=!![];}return _0x47d9d8['update'](_0x529f8d);}else{return logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x2c'),util[_0xd09d('0x29')](_0x3547c3,{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x4e81d6){return logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x2c'),util['inspect'](_0x4e81d6,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x2c'),_0xd09d('0x3a'));}break;case _0xd09d('0x3b'):if(_0x1a1b40[_0xd09d('0x22')]){var _0x4880f3={'recipient':_0x1a03ec[_0xd09d('0x2f')],'message':_0x1a03ec[_0xd09d('0x10')],'sender':_0x1a1b40[_0xd09d('0x3c')]||_0x1a1b40[_0xd09d('0x2f')],'authorization':_0x1a1b40[_0xd09d('0x22')]};var _0x442411={'method':'POST','uri':_0xd09d('0x3d'),'body':_0x4880f3,'json':!![]};rp(_0x442411)[_0xd09d('0x1e')](function(_0x21a627){var _0x1757f6={'messageId':_0x21a627[_0xd09d('0x3e')]};if(!_0x1a1b40['deliveryReport']){_0x1757f6['read']=!![];}return _0x47d9d8[_0xd09d('0x19')](_0x1757f6);})['catch'](function(_0x6ce455){logger['error'](_0xd09d('0x2a'),'afterCreate','connectel',util[_0xd09d('0x29')](_0x6ce455,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),'connectel',_0xd09d('0x3f'));}break;case _0xd09d('0x40'):if(_0x1a1b40[_0xd09d('0x2e')]&&_0x1a1b40[_0xd09d('0x33')]){var _0x4880f3={'messages':[{'source':_0xd09d('0x41'),'to':_0x1a03ec[_0xd09d('0x2f')],'body':_0x1a03ec[_0xd09d('0x10')],'from':_0x1a1b40[_0xd09d('0x3c')]||_0x1a1b40[_0xd09d('0x2f')]}]};var _0x5624e3=util['format']('%s:%s',_0x1a1b40[_0xd09d('0x2e')],_0x1a1b40[_0xd09d('0x33')]);var _0x442411={'method':_0xd09d('0x42'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x4880f3,'headers':{'Authorization':util[_0xd09d('0x43')](_0xd09d('0x44'),new Buffer(_0x5624e3)[_0xd09d('0x45')]('base64'))},'json':!![]};rp(_0x442411)[_0xd09d('0x1e')](function(_0xffa17b){if(_0xffa17b[_0xd09d('0x46')]>=0xc8&&_0xffa17b[_0xd09d('0x46')]<=0xce){if(_0xffa17b[_0xd09d('0x47')]&&_0xffa17b['data'][_0xd09d('0x48')]>0x0){var _0x285c90=_[_0xd09d('0x49')](_0xffa17b['data'][_0xd09d('0x4a')]);var _0xffd8d4={'messageId':_0x285c90[_0xd09d('0x4b')]};if(!_0x1a1b40[_0xd09d('0x39')]){_0xffd8d4[_0xd09d('0x4c')]=!![];}return _0x47d9d8[_0xd09d('0x19')](_0xffd8d4);}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x4d'),util['inspect'](_0xffa17b,{'showHidden':![],'depth':null}));}}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),'clickSend',util[_0xd09d('0x29')](_0xffa17b,{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x5afe62){logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x4d'),util[_0xd09d('0x29')](_0x5afe62,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd09d('0x4e'):if(_0x1a1b40[_0xd09d('0x4f')]&&_0x1a1b40[_0xd09d('0x22')]){var _0x4880f3={'dst':_0x1a03ec['phone'],'text':_0x1a03ec['body'],'src':_0x1a1b40[_0xd09d('0x3c')]||_0x1a1b40[_0xd09d('0x2f')],'url':_0x1a1b40[_0xd09d('0x24')]+_0xd09d('0x25')+_0x1a03ec['id']+'/status?token='+_0x1a1b40['token']};var _0x5624e3=util[_0xd09d('0x43')](_0xd09d('0x50'),_0x1a1b40[_0xd09d('0x4f')],_0x1a1b40[_0xd09d('0x22')]);var _0x442411={'method':'POST','uri':util[_0xd09d('0x43')](_0xd09d('0x51'),_0x1a1b40['authId']),'body':_0x4880f3,'headers':{'Authorization':util[_0xd09d('0x43')](_0xd09d('0x44'),new Buffer(_0x5624e3)[_0xd09d('0x45')](_0xd09d('0x52')))},'json':!![]};rp(_0x442411)['then'](function(_0x2b6677){var _0x423885={'messageId':_0x2b6677[_0xd09d('0x53')][0x0]};return _0x47d9d8[_0xd09d('0x19')](_0x423885);})['catch'](function(_0x3b6a3b){logger[_0xd09d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),_0xd09d('0x4e'),util[_0xd09d('0x29')](_0x3b6a3b,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),'plivo',_0xd09d('0x54'));}break;case'infobip':if(_0x1a1b40['username']&&_0x1a1b40['password']){if(_0x1a1b40['baseUrl']){var _0xf782c4={'method':'POST','uri':_0x1a1b40['baseUrl']+_0xd09d('0x55'),'body':{'username':_0x1a1b40['username'],'password':_0x1a1b40['password']},'json':!![]};return rp(_0xf782c4)[_0xd09d('0x1e')](function(_0x2c1abb){var _0x18e497={'method':_0xd09d('0x42'),'uri':_0x1a1b40[_0xd09d('0x56')]+_0xd09d('0x57'),'body':{'messages':[{'from':_0x1a1b40[_0xd09d('0x2f')],'destinations':[{'to':_0x1a03ec[_0xd09d('0x2f')]}],'text':_0x1a03ec[_0xd09d('0x10')],'notifyUrl':_0x1a1b40['remote']+_0xd09d('0x25')+_0x1a03ec['id']+'/status?token='+_0x1a1b40['token'],'notifyContentType':_0xd09d('0x58'),'callbackData':_0x1a1b40[_0xd09d('0x2f')]+';'+_0x1a03ec['body']}]},'headers':{'Authorization':_0xd09d('0x59')+_0x2c1abb[_0xd09d('0x5a')]},'json':!![]};return rp(_0x18e497)[_0xd09d('0x1e')](function(_0x2107ad){if(_0x2107ad[_0xd09d('0x4a')]){var _0x1bfddb={'messageId':_0x2107ad[_0xd09d('0x4a')][0x0][_0xd09d('0xe')]};if(!_0x1a1b40[_0xd09d('0x39')]){_0x1bfddb['read']=!![];}return _0x47d9d8[_0xd09d('0x19')](_0x1bfddb);}else{return logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x5b'),util['inspect'](_0x2107ad,{'showHidden':![],'depth':null}));}});})[_0xd09d('0x27')](function(_0x18bad0){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),_0xd09d('0x5b'),util[_0xd09d('0x29')](_0x18bad0,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd09d('0x5b'),_0xd09d('0x5c'));}}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),'afterCreate',_0xd09d('0x5b'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x506708=require(_0xd09d('0x5d'));if(_0x1a1b40['apiKey']){var _0xdb8e37={};_0xdb8e37['login']=_0x1a1b40[_0xd09d('0x2e')];_0xdb8e37['phone']=_0x1a03ec[_0xd09d('0x2f')];_0xdb8e37['sender']=_0x1a1b40['phone'];_0xdb8e37[_0xd09d('0x5e')]=_0x1a03ec[_0xd09d('0x10')];_0xdb8e37[_0xd09d('0x5f')]=+new Date();var _0x554a8e='';var _0x132790='';var _0x154f29=Object['keys'](_0xdb8e37);_0x154f29[_0xd09d('0x60')]();for(var _0x3ff12a=0x0;_0x3ff12a<_0x154f29[_0xd09d('0x61')];_0x3ff12a++){if(_0x554a8e!=''){_0x554a8e+='&';}_0x554a8e+=_0x154f29[_0x3ff12a]+'='+encodeURIComponent(_0xdb8e37[_0x154f29[_0x3ff12a]]);_0x132790+=_0xdb8e37[_0x154f29[_0x3ff12a]];}_0x132790+=_0x1a1b40[_0xd09d('0x62')];_0x132790=_0x506708[_0xd09d('0x63')]('md5')['update'](_0x132790)[_0xd09d('0x64')](_0xd09d('0x65'));if(_0x554a8e!==''){_0x554a8e+='&';}_0x554a8e+=_0xd09d('0x66')+_0x132790;var _0x16a97a={'method':'GET','uri':_0x1a1b40[_0xd09d('0x56')]+_0xd09d('0x67')+_0x554a8e,'json':!![]};return rp(_0x16a97a)[_0xd09d('0x1e')](function(_0x5f3cbe){var _0x46dc55=Object[_0xd09d('0x68')](_0x5f3cbe);if(_0x5f3cbe[_0x46dc55[0x0]][_0xd09d('0x1b')]&&parseInt(_0x5f3cbe[_0x46dc55[0x0]][_0xd09d('0x1b')])===0x0){var _0x55af56={'messageId':_0x5f3cbe[_0x46dc55[0x0]][_0xd09d('0x69')]};if(!_0x1a1b40[_0xd09d('0x39')]){_0x55af56[_0xd09d('0x4c')]=!![];}return _0x47d9d8[_0xd09d('0x19')](_0x55af56);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd09d('0x6a'),util['inspect'](_0x5f3cbe[_0xd09d('0x1b')],{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x3aa26c){return logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),'csc',util[_0xd09d('0x29')](_0x3aa26c,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),_0xd09d('0x6a'),_0xd09d('0x6b'));}break;case'clickatell':if(_0x1a1b40['apiKey']){var _0x2cbb3b={'method':_0xd09d('0x42'),'uri':_0xd09d('0x6c'),'headers':{'Authorization':_0x1a1b40[_0xd09d('0x62')]},'body':{'content':_0x1a03ec[_0xd09d('0x10')],'to':[_0x1a03ec['phone']],'from':_0x1a1b40[_0xd09d('0x2f')],'binary':![],'clientMessageId':_0xd09d('0x6d'),'charset':_0xd09d('0x6e')},'json':!![]};rp(_0x2cbb3b)['then'](function(_0x215606){if(!_0x215606['error']){var _0x286e78={'messageId':_0x215606[_0xd09d('0x4a')][0x0][_0xd09d('0x6f')]};if(!_0x1a1b40['deliveryReport']){_0x286e78[_0xd09d('0x4c')]=!![];}return _0x47d9d8[_0xd09d('0x19')](_0x286e78);}else{return logger['error'](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x70'),util[_0xd09d('0x29')](_0x215606[_0xd09d('0x1b')],{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x5cdde2){return logger['error'](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x70'),util[_0xd09d('0x29')](_0x5cdde2,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0xd09d('0x71'):if(_0x1a1b40[_0xd09d('0x2e')]&&_0x1a1b40['password']){var _0x5624e3=util['format'](_0xd09d('0x50'),_0x1a1b40[_0xd09d('0x2e')],_0x1a1b40[_0xd09d('0x33')]);var _0x442411={'method':_0xd09d('0x42'),'uri':_0xd09d('0x72')+_0x1a1b40[_0xd09d('0x73')]+'/messages','body':{'to':[_0x1a03ec[_0xd09d('0x2f')]],'text':_0x1a03ec[_0xd09d('0x10')],'from':_0x1a1b40['phone'],'applicationId':_0x1a1b40['applicationId']},'headers':{'Authorization':util['format'](_0xd09d('0x44'),new Buffer(_0x5624e3)[_0xd09d('0x45')]('base64'))},'json':!![]};rp(_0x442411)['then'](function(_0x480a09){if(_0x480a09['id']){var _0x15f95a={'messageId':_0x480a09['id']};return _0x47d9d8['update'](_0x15f95a);}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x71'),util[_0xd09d('0x29')](_0x480a09,{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x31a49f){logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x71'),util[_0xd09d('0x29')](_0x31a49f,{'showHidden':![],'depth':null}));});}else{logger[_0xd09d('0x1b')](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x71'),_0xd09d('0x3a'));}break;case _0xd09d('0x74'):if(_0x1a1b40['apiKey']){var _0x40bdfd={};var _0x16a97a={'method':_0xd09d('0x42'),'uri':_0xd09d('0x75'),'headers':{'Authorization':_0xd09d('0x76')+_0x1a1b40[_0xd09d('0x62')],'Content-Type':_0xd09d('0x58')},'body':{'from':_0x1a1b40[_0xd09d('0x2f')],'to':_0x1a03ec['phone'],'text':_0x1a03ec[_0xd09d('0x10')]},'json':!![]};return rp(_0x16a97a)['then'](function(_0x3925f0){if(_0x3925f0[_0xd09d('0x77')]==0xca){_0x40bdfd[_0xd09d('0x78')]=_0x3925f0;var _0x595d99={'method':_0xd09d('0x42'),'uri':_0xd09d('0x79'),'headers':{'Authorization':_0xd09d('0x76')+_0x1a1b40[_0xd09d('0x62')],'Content-Type':_0xd09d('0x58')},'body':{'refid':_0x40bdfd[_0xd09d('0x78')]['refid']},'json':!![]};return rp(_0x595d99)[_0xd09d('0x1e')](function(_0x2d4871){_0x40bdfd[_0xd09d('0x7a')]=_0x2d4871;var _0x13193b={'messageId':_0x40bdfd[_0xd09d('0x78')][_0xd09d('0x7b')],'read':!![]};return _0x47d9d8[_0xd09d('0x19')](_0x13193b);});}else{return logger[_0xd09d('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd09d('0x28'),_0xd09d('0x74'),util['inspect'](_0x3925f0,{'showHidden':![],'depth':null}));}})[_0xd09d('0x27')](function(_0x5eab07){return logger['error'](_0xd09d('0x2a'),_0xd09d('0x28'),_0xd09d('0x74'),util[_0xd09d('0x29')](_0x5eab07,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd09d('0x2a'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0xd09d('0x7c')](function(){_0x235b0d();});}else{_0x235b0d();}}},'charset':_0xd09d('0x7d'),'collate':_0xd09d('0x7e')});}; \ No newline at end of file +var _0x4fef=['/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','apiKey','login','sender','text','timestamp','keys','sort','length','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','uuid','UTF-8','clickatell','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','error','SmsAccount','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','&password=','password','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','requestid','deliveryReport','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','remote'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x4fef,0x10f));var _0xf4fe=function(_0x43f9eb,_0x37683c){_0x43f9eb=_0x43f9eb-0x0;var _0xcf5df7=_0x4fef[_0x43f9eb];return _0xcf5df7;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var logger=require('../../config/logger')(_0xf4fe('0x2'));var moment=require('moment');var BPromise=require(_0xf4fe('0x3'));var rp=require(_0xf4fe('0x4'));var fs=require('fs');var path=require(_0xf4fe('0x5'));var rimraf=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var attributes=require(_0xf4fe('0x8'));module[_0xf4fe('0x9')]=function(_0x27c6c9,_0x522427){return _0x27c6c9[_0xf4fe('0xa')](_0xf4fe('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xf4fe('0xc'),'fields':[_0xf4fe('0xc')]},{'name':_0xf4fe('0xd'),'fields':[_0xf4fe('0xe')],'type':_0xf4fe('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x354ee3,_0x42da04,_0xf12b53){var _0x5936af=_0x27c6c9[_0xf4fe('0x10')];var _0x49d480=_0x354ee3[_0xf4fe('0x11')]({'plain':!![]});if(_0x49d480[_0xf4fe('0x12')][_0xf4fe('0x13')]()==='in'||_0x49d480[_0xf4fe('0x12')][_0xf4fe('0x13')]()==='out'&&!_0x49d480[_0xf4fe('0x14')]&&!_[_0xf4fe('0x15')](_0x49d480[_0xf4fe('0x16')])){_0x5936af['SmsInteraction'][_0xf4fe('0x17')]({'where':{'id':_0x49d480['SmsInteractionId']}})[_0xf4fe('0x18')](function(_0x457a14){if(_0x457a14){_0x457a14[_0xf4fe('0x19')]({'lastMsgAt':_0x49d480['createdAt'],'lastMsgDirection':_0x49d480[_0xf4fe('0x12')][_0xf4fe('0x13')]()});}})['catch'](function(_0x2a00ea){console[_0xf4fe('0x1a')](_0x2a00ea);});}if(_0x49d480[_0xf4fe('0x12')]==='out'&&!_0x49d480['secret']){var _0x10cf15;_0x5936af[_0xf4fe('0x1b')]['find']({'where':{'id':_0x49d480['SmsAccountId']},'raw':!![]})[_0xf4fe('0x18')](function(_0x2b58dd){_0x10cf15=_0x2b58dd;if(_0x10cf15&&_0x10cf15[_0xf4fe('0x1c')]){switch(_0x10cf15[_0xf4fe('0x1c')]){case _0xf4fe('0x1d'):var _0xdb2fcf=require(_0xf4fe('0x1d'));if(_0x10cf15[_0xf4fe('0x1e')]&&_0x10cf15[_0xf4fe('0x1f')]&&_0x10cf15[_0xf4fe('0x20')]){var _0x2eb45e=new _0xdb2fcf(_0x10cf15[_0xf4fe('0x1e')],_0x10cf15[_0xf4fe('0x1f')]);_0x2eb45e[_0xf4fe('0x21')]['create']({'body':_0x49d480[_0xf4fe('0xe')],'to':_0x49d480['phone'],'from':_0x10cf15['phone'],'statusCallback':_0x10cf15['remote']+_0xf4fe('0x22')+_0x49d480['id']+'/status?token='+_0x10cf15['token']})[_0xf4fe('0x18')](function(_0x1ba32a){if(_0x1ba32a[_0xf4fe('0x23')]){return _0x354ee3[_0xf4fe('0x19')]({'messageId':_0x1ba32a[_0xf4fe('0x23')]});}})[_0xf4fe('0x24')](function(_0x51dc14){logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x1d'),util[_0xf4fe('0x27')](_0x51dc14,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),'afterCreate',_0xf4fe('0x1d'),_0xf4fe('0x28'));}break;case _0xf4fe('0x29'):var _0x5c3f68='https://api.skebby.it/API/v1.0/REST/';if(_0x10cf15[_0xf4fe('0x2a')]&&_0x10cf15['password']){var _0x5b74b9={'recipient':[_0x49d480[_0xf4fe('0x20')]],'message':_0x49d480[_0xf4fe('0xe')],'message_type':_0x10cf15[_0xf4fe('0x2b')]};if(_0x10cf15[_0xf4fe('0x2b')]&&_0x10cf15['smsMethod']!=='SI'){_0x5b74b9['sender']=_0x10cf15[_0xf4fe('0x20')];}var _0x33b681={'url':_0x5c3f68+'login?username='+_0x10cf15[_0xf4fe('0x2a')]+_0xf4fe('0x2c')+_0x10cf15[_0xf4fe('0x2d')],'method':_0xf4fe('0x2e')};rp(_0x33b681)[_0xf4fe('0x18')](function(_0x3a0109){var _0x16d3f7=_0x3a0109[_0xf4fe('0x2f')](';');var _0x109393={'user_key':_0x16d3f7[0x0],'session_key':_0x16d3f7[0x1]};_0x33b681={'url':_0x5c3f68+_0xf4fe('0x30'),'method':_0xf4fe('0x31'),'headers':{'user_key':_0x109393[_0xf4fe('0x32')],'Session_key':_0x109393[_0xf4fe('0x33')]},'json':!![],'body':_0x5b74b9};return rp(_0x33b681);})['then'](function(_0x39d6e1){if(_0x39d6e1[_0xf4fe('0x34')]>=0x1){var _0x527fae={'messageId':_0x39d6e1[_0xf4fe('0x35')]};if(_0x10cf15[_0xf4fe('0x2b')]!=='GP'||!_0x10cf15['deliveryReport']){_0x527fae[_0xf4fe('0x36')]=!![];}return _0x354ee3[_0xf4fe('0x19')](_0x527fae);}else{return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x29'),util['inspect'](_0x39d6e1,{'showHidden':![],'depth':null}));}})[_0xf4fe('0x24')](function(_0x10f729){return logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x29'),util[_0xf4fe('0x27')](_0x10f729,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),_0xf4fe('0x29'),_0xf4fe('0x37'));}break;case'connectel':if(_0x10cf15[_0xf4fe('0x1f')]){var _0x2e491a={'recipient':_0x49d480['phone'],'message':_0x49d480[_0xf4fe('0xe')],'sender':_0x10cf15['senderString']||_0x10cf15['phone'],'authorization':_0x10cf15[_0xf4fe('0x1f')]};var _0x42da04={'method':_0xf4fe('0x31'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x2e491a,'json':!![]};rp(_0x42da04)[_0xf4fe('0x18')](function(_0x3ffbe5){var _0x29396a={'messageId':_0x3ffbe5[_0xf4fe('0x38')]};if(!_0x10cf15[_0xf4fe('0x39')]){_0x29396a['read']=!![];}return _0x354ee3[_0xf4fe('0x19')](_0x29396a);})['catch'](function(_0x5e4c6c){logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x3a'),util['inspect'](_0x5e4c6c,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),'afterCreate',_0xf4fe('0x3a'),_0xf4fe('0x3b'));}break;case _0xf4fe('0x3c'):if(_0x10cf15[_0xf4fe('0x2a')]&&_0x10cf15['password']){var _0x2e491a={'messages':[{'source':_0xf4fe('0x3d'),'to':_0x49d480[_0xf4fe('0x20')],'body':_0x49d480['body'],'from':_0x10cf15[_0xf4fe('0x3e')]||_0x10cf15[_0xf4fe('0x20')]}]};var _0x39583c=util[_0xf4fe('0x3f')]('%s:%s',_0x10cf15[_0xf4fe('0x2a')],_0x10cf15[_0xf4fe('0x2d')]);var _0x42da04={'method':_0xf4fe('0x31'),'uri':_0xf4fe('0x40'),'body':_0x2e491a,'headers':{'Authorization':util['format'](_0xf4fe('0x41'),new Buffer(_0x39583c)[_0xf4fe('0x42')](_0xf4fe('0x43')))},'json':!![]};rp(_0x42da04)[_0xf4fe('0x18')](function(_0x3e7abc){if(_0x3e7abc[_0xf4fe('0x44')]>=0xc8&&_0x3e7abc[_0xf4fe('0x44')]<=0xce){if(_0x3e7abc[_0xf4fe('0x45')]&&_0x3e7abc['data'][_0xf4fe('0x46')]>0x0){var _0x4bd0e2=_[_0xf4fe('0x47')](_0x3e7abc[_0xf4fe('0x45')][_0xf4fe('0x21')]);var _0x542d34={'messageId':_0x4bd0e2[_0xf4fe('0x48')]};if(!_0x10cf15[_0xf4fe('0x39')]){_0x542d34[_0xf4fe('0x36')]=!![];}return _0x354ee3[_0xf4fe('0x19')](_0x542d34);}else{logger['error'](_0xf4fe('0x25'),'afterCreate',_0xf4fe('0x49'),util[_0xf4fe('0x27')](_0x3e7abc,{'showHidden':![],'depth':null}));}}else{logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),'clickSend',util[_0xf4fe('0x27')](_0x3e7abc,{'showHidden':![],'depth':null}));}})['catch'](function(_0x6c5690){logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),'afterCreate','clickSend',util['inspect'](_0x6c5690,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x49'),_0xf4fe('0x37'));}break;case _0xf4fe('0x4a'):if(_0x10cf15[_0xf4fe('0x4b')]&&_0x10cf15['authToken']){var _0x2e491a={'dst':_0x49d480[_0xf4fe('0x20')],'text':_0x49d480[_0xf4fe('0xe')],'src':_0x10cf15['senderString']||_0x10cf15[_0xf4fe('0x20')],'url':_0x10cf15[_0xf4fe('0x4c')]+'/api/sms/messages/'+_0x49d480['id']+_0xf4fe('0x4d')+_0x10cf15[_0xf4fe('0x4e')]};var _0x39583c=util['format']('%s:%s',_0x10cf15[_0xf4fe('0x4b')],_0x10cf15[_0xf4fe('0x1f')]);var _0x42da04={'method':_0xf4fe('0x31'),'uri':util['format'](_0xf4fe('0x4f'),_0x10cf15[_0xf4fe('0x4b')]),'body':_0x2e491a,'headers':{'Authorization':util[_0xf4fe('0x3f')](_0xf4fe('0x41'),new Buffer(_0x39583c)[_0xf4fe('0x42')](_0xf4fe('0x43')))},'json':!![]};rp(_0x42da04)['then'](function(_0x179b2c){var _0x8e8876={'messageId':_0x179b2c['message_uuid'][0x0]};return _0x354ee3[_0xf4fe('0x19')](_0x8e8876);})[_0xf4fe('0x24')](function(_0x3d10e1){logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util[_0xf4fe('0x27')](_0x3d10e1,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),_0xf4fe('0x4a'),_0xf4fe('0x50'));}break;case _0xf4fe('0x51'):if(_0x10cf15[_0xf4fe('0x2a')]&&_0x10cf15[_0xf4fe('0x2d')]){if(_0x10cf15[_0xf4fe('0x52')]){var _0x5d1268={'method':_0xf4fe('0x31'),'uri':_0x10cf15[_0xf4fe('0x52')]+'/auth/1/session','body':{'username':_0x10cf15[_0xf4fe('0x2a')],'password':_0x10cf15['password']},'json':!![]};return rp(_0x5d1268)[_0xf4fe('0x18')](function(_0x492983){var _0x234fbd={'method':_0xf4fe('0x31'),'uri':_0x10cf15[_0xf4fe('0x52')]+_0xf4fe('0x53'),'body':{'messages':[{'from':_0x10cf15[_0xf4fe('0x20')],'destinations':[{'to':_0x49d480[_0xf4fe('0x20')]}],'text':_0x49d480[_0xf4fe('0xe')],'notifyUrl':_0x10cf15[_0xf4fe('0x4c')]+_0xf4fe('0x22')+_0x49d480['id']+'/status?token='+_0x10cf15['token'],'notifyContentType':_0xf4fe('0x54'),'callbackData':_0x10cf15[_0xf4fe('0x20')]+';'+_0x49d480[_0xf4fe('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x492983[_0xf4fe('0x4e')]},'json':!![]};return rp(_0x234fbd)[_0xf4fe('0x18')](function(_0x2b7ff1){if(_0x2b7ff1[_0xf4fe('0x21')]){var _0x4e345d={'messageId':_0x2b7ff1[_0xf4fe('0x21')][0x0][_0xf4fe('0xc')]};if(!_0x10cf15[_0xf4fe('0x39')]){_0x4e345d['read']=!![];}return _0x354ee3['update'](_0x4e345d);}else{return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),'infobip',util['inspect'](_0x2b7ff1,{'showHidden':![],'depth':null}));}});})[_0xf4fe('0x24')](function(_0x15d68a){return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x51'),util[_0xf4fe('0x27')](_0x15d68a,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),_0xf4fe('0x51'),'Missing\x20parameters:\x20base_url');}}else{logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x51'),_0xf4fe('0x37'));}break;case'csc':var _0x37c740=require('crypto');if(_0x10cf15[_0xf4fe('0x55')]){var _0x3f5deb={};_0x3f5deb[_0xf4fe('0x56')]=_0x10cf15[_0xf4fe('0x2a')];_0x3f5deb['phone']=_0x49d480['phone'];_0x3f5deb[_0xf4fe('0x57')]=_0x10cf15[_0xf4fe('0x20')];_0x3f5deb[_0xf4fe('0x58')]=_0x49d480['body'];_0x3f5deb[_0xf4fe('0x59')]=+new Date();var _0x1a65a7='';var _0x213bf7='';var _0x3cb883=Object[_0xf4fe('0x5a')](_0x3f5deb);_0x3cb883[_0xf4fe('0x5b')]();for(var _0x5e5b59=0x0;_0x5e5b59<_0x3cb883[_0xf4fe('0x5c')];_0x5e5b59++){if(_0x1a65a7!=''){_0x1a65a7+='&';}_0x1a65a7+=_0x3cb883[_0x5e5b59]+'='+encodeURIComponent(_0x3f5deb[_0x3cb883[_0x5e5b59]]);_0x213bf7+=_0x3f5deb[_0x3cb883[_0x5e5b59]];}_0x213bf7+=_0x10cf15[_0xf4fe('0x55')];_0x213bf7=_0x37c740['createHash']('md5')['update'](_0x213bf7)[_0xf4fe('0x5d')](_0xf4fe('0x5e'));if(_0x1a65a7!==''){_0x1a65a7+='&';}_0x1a65a7+=_0xf4fe('0x5f')+_0x213bf7;var _0x33b681={'method':_0xf4fe('0x2e'),'uri':_0x10cf15[_0xf4fe('0x52')]+_0xf4fe('0x60')+_0x1a65a7,'json':!![]};return rp(_0x33b681)['then'](function(_0x13751a){var _0x16969d=Object[_0xf4fe('0x5a')](_0x13751a);if(_0x13751a[_0x16969d[0x0]][_0xf4fe('0x1a')]&&parseInt(_0x13751a[_0x16969d[0x0]][_0xf4fe('0x1a')])===0x0){var _0xed4eb1={'messageId':_0x13751a[_0x16969d[0x0]][_0xf4fe('0x61')]};if(!_0x10cf15['deliveryReport']){_0xed4eb1[_0xf4fe('0x36')]=!![];}return _0x354ee3['update'](_0xed4eb1);}else{return logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),_0xf4fe('0x62'),util[_0xf4fe('0x27')](_0x13751a[_0xf4fe('0x1a')],{'showHidden':![],'depth':null}));}})[_0xf4fe('0x24')](function(_0x5c5280){return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),'afterCreate',_0xf4fe('0x62'),util['inspect'](_0x5c5280,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x62'),_0xf4fe('0x63'));}break;case'clickatell':if(_0x10cf15[_0xf4fe('0x55')]){var _0x9746de={'method':_0xf4fe('0x31'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x10cf15[_0xf4fe('0x55')]},'body':{'content':_0x49d480[_0xf4fe('0xe')],'to':[_0x49d480[_0xf4fe('0x20')]],'from':_0x10cf15[_0xf4fe('0x20')],'binary':![],'clientMessageId':_0xf4fe('0x64'),'charset':_0xf4fe('0x65')},'json':!![]};rp(_0x9746de)[_0xf4fe('0x18')](function(_0x476835){if(!_0x476835[_0xf4fe('0x1a')]){var _0x45708d={'messageId':_0x476835[_0xf4fe('0x21')][0x0]['apiMessageId']};if(!_0x10cf15[_0xf4fe('0x39')]){_0x45708d[_0xf4fe('0x36')]=!![];}return _0x354ee3['update'](_0x45708d);}else{return logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x66'),util['inspect'](_0x476835[_0xf4fe('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a9b01){return logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),'clickatell',util['inspect'](_0x1a9b01,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf4fe('0x26'),'clickatell',_0xf4fe('0x63'));}break;case _0xf4fe('0x67'):if(_0x10cf15[_0xf4fe('0x2a')]&&_0x10cf15[_0xf4fe('0x2d')]){var _0x39583c=util[_0xf4fe('0x3f')](_0xf4fe('0x68'),_0x10cf15[_0xf4fe('0x2a')],_0x10cf15['password']);var _0x42da04={'method':'POST','uri':_0xf4fe('0x69')+_0x10cf15['accountId']+_0xf4fe('0x6a'),'body':{'to':[_0x49d480[_0xf4fe('0x20')]],'text':_0x49d480[_0xf4fe('0xe')],'from':_0x10cf15[_0xf4fe('0x20')],'applicationId':_0x10cf15['applicationId']},'headers':{'Authorization':util[_0xf4fe('0x3f')](_0xf4fe('0x41'),new Buffer(_0x39583c)['toString'](_0xf4fe('0x43')))},'json':!![]};rp(_0x42da04)[_0xf4fe('0x18')](function(_0x181e51){if(_0x181e51['id']){var _0x5b423c={'messageId':_0x181e51['id']};return _0x354ee3[_0xf4fe('0x19')](_0x5b423c);}else{logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x67'),util[_0xf4fe('0x27')](_0x181e51,{'showHidden':![],'depth':null}));}})[_0xf4fe('0x24')](function(_0x23fbaa){logger['error'](_0xf4fe('0x25'),_0xf4fe('0x26'),'bandwidth',util[_0xf4fe('0x27')](_0x23fbaa,{'showHidden':![],'depth':null}));});}else{logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x67'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf4fe('0x6b'):if(_0x10cf15[_0xf4fe('0x55')]){var _0x1cd0fe={};var _0x33b681={'method':_0xf4fe('0x31'),'uri':_0xf4fe('0x6c'),'headers':{'Authorization':_0xf4fe('0x6d')+_0x10cf15[_0xf4fe('0x55')],'Content-Type':_0xf4fe('0x54')},'body':{'from':_0x10cf15[_0xf4fe('0x20')],'to':_0x49d480[_0xf4fe('0x20')],'text':_0x49d480['body']},'json':!![]};return rp(_0x33b681)[_0xf4fe('0x18')](function(_0x3198d3){if(_0x3198d3[_0xf4fe('0x6e')]==0xca){_0x1cd0fe[_0xf4fe('0x6f')]=_0x3198d3;var _0xdc2c6a={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x10cf15[_0xf4fe('0x55')],'Content-Type':_0xf4fe('0x54')},'body':{'refid':_0x1cd0fe[_0xf4fe('0x6f')][_0xf4fe('0x70')]},'json':!![]};return rp(_0xdc2c6a)[_0xf4fe('0x18')](function(_0x3bb995){_0x1cd0fe['status']=_0x3bb995;var _0x1febc1={'messageId':_0x1cd0fe['message'][_0xf4fe('0x70')],'read':!![]};return _0x354ee3[_0xf4fe('0x19')](_0x1febc1);});}else{return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x6b'),util[_0xf4fe('0x27')](_0x3198d3,{'showHidden':![],'depth':null}));}})[_0xf4fe('0x24')](function(_0xaaec4){return logger[_0xf4fe('0x1a')](_0xf4fe('0x25'),_0xf4fe('0x26'),_0xf4fe('0x6b'),util['inspect'](_0xaaec4,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf4fe('0x6b'),'Token\x20not\x20received');}break;}}})[_0xf4fe('0x71')](function(){_0xf12b53();});}else{_0xf12b53();}}},'charset':_0xf4fe('0x72'),'collate':_0xf4fe('0x73')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 08a4435..9d842cc 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 _0x8b02=['create','body','options','raw','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','localhost','./smsMessage.socket','request','then','info','debug','request\x20sent','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b02,0x9b));var _0x28b0=function(_0x24ffa5,_0x119b94){_0x24ffa5=_0x24ffa5-0x0;var _0x1f0a5f=_0x8b02[_0x24ffa5];return _0x1f0a5f;};'use strict';var _=require(_0x28b0('0x0'));var util=require(_0x28b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x28b0('0x2'));var fs=require('fs');var Redis=require(_0x28b0('0x3'));var db=require(_0x28b0('0x4'))['db'];var utils=require(_0x28b0('0x5'));var logger=require(_0x28b0('0x6'))(_0x28b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x28b0('0x8'));var client=jayson[_0x28b0('0x9')][_0x28b0('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x28b0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x28b0('0xc'))['register'](socket);function respondWithRpcPromise(_0x32476b,_0x2b1427,_0x3d3b79){return new BPromise(function(_0x36af89,_0xdb7942){return client[_0x28b0('0xd')](_0x32476b,_0x3d3b79)[_0x28b0('0xe')](function(_0x15f7c0){logger[_0x28b0('0xf')]('SmsMessage,\x20%s,\x20%s',_0x2b1427,'request\x20sent');logger[_0x28b0('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2b1427,_0x28b0('0x11'),JSON['stringify'](_0x15f7c0));if(_0x15f7c0[_0x28b0('0x12')]){if(_0x15f7c0[_0x28b0('0x12')][_0x28b0('0x13')]===0x1f4){logger[_0x28b0('0x12')](_0x28b0('0x14'),_0x2b1427,_0x15f7c0[_0x28b0('0x12')][_0x28b0('0x15')]);return _0xdb7942(_0x15f7c0[_0x28b0('0x12')]['message']);}logger[_0x28b0('0x12')]('SmsMessage,\x20%s,\x20%s',_0x2b1427,_0x15f7c0[_0x28b0('0x12')][_0x28b0('0x15')]);return _0x36af89(_0x15f7c0[_0x28b0('0x12')][_0x28b0('0x15')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x2b1427,_0x28b0('0x11'));_0x36af89(_0x15f7c0[_0x28b0('0x16')][_0x28b0('0x15')]);}})[_0x28b0('0x17')](function(_0x5d80ab){logger[_0x28b0('0x12')](_0x28b0('0x14'),_0x2b1427,_0x5d80ab);_0xdb7942(_0x5d80ab);});});}exports[_0x28b0('0x18')]=function(_0x3f9a69){var _0x32c8bc=this;return new Promise(function(_0xfbcfd9,_0x15b0f6){return db['SmsMessage'][_0x28b0('0x19')](_0x3f9a69[_0x28b0('0x1a')],{'raw':_0x3f9a69['options']?_0x3f9a69[_0x28b0('0x1b')][_0x28b0('0x1c')]===undefined?!![]:![]:!![]})[_0x28b0('0xe')](function(_0x482053){logger['info'](_0x28b0('0x18'),_0x3f9a69);logger[_0x28b0('0x10')](_0x28b0('0x18'),_0x3f9a69,JSON[_0x28b0('0x1d')](_0x482053));_0xfbcfd9(_0x482053);})[_0x28b0('0x17')](function(_0xae17b2){logger[_0x28b0('0x12')](_0x28b0('0x18'),_0xae17b2[_0x28b0('0x15')],_0x3f9a69);_0x15b0f6(_0x32c8bc[_0x28b0('0x12')](0x1f4,_0xae17b2[_0x28b0('0x15')]));});});}; \ No newline at end of file +var _0x1eba=['raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','./smsMessage.socket','register','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage','create','options'];(function(_0x12bff0,_0x11b277){var _0x155713=function(_0x2ef08c){while(--_0x2ef08c){_0x12bff0['push'](_0x12bff0['shift']());}};_0x155713(++_0x11b277);}(_0x1eba,0x195));var _0xa1eb=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x1eba[_0x4fbb15];return _0x436338;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require(_0xa1eb('0x5'));var db=require(_0xa1eb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson['client'][_0xa1eb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa1eb('0xb')],{'host':_0xa1eb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa1eb('0xd'))[_0xa1eb('0xe')](socket);function respondWithRpcPromise(_0x7fc8e,_0x5e637c,_0x50d3b0){return new BPromise(function(_0x387e39,_0x5ad89b){return client['request'](_0x7fc8e,_0x50d3b0)['then'](function(_0x4b2cfe){logger[_0xa1eb('0xf')]('SmsMessage,\x20%s,\x20%s',_0x5e637c,_0xa1eb('0x10'));logger[_0xa1eb('0x11')](_0xa1eb('0x12'),_0x5e637c,_0xa1eb('0x10'),JSON[_0xa1eb('0x13')](_0x4b2cfe));if(_0x4b2cfe[_0xa1eb('0x14')]){if(_0x4b2cfe[_0xa1eb('0x14')]['code']===0x1f4){logger[_0xa1eb('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5e637c,_0x4b2cfe['error']['message']);return _0x5ad89b(_0x4b2cfe['error'][_0xa1eb('0x15')]);}logger[_0xa1eb('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5e637c,_0x4b2cfe[_0xa1eb('0x14')][_0xa1eb('0x15')]);return _0x387e39(_0x4b2cfe['error'][_0xa1eb('0x15')]);}else{logger[_0xa1eb('0xf')](_0xa1eb('0x16'),_0x5e637c,_0xa1eb('0x10'));_0x387e39(_0x4b2cfe[_0xa1eb('0x17')][_0xa1eb('0x15')]);}})[_0xa1eb('0x18')](function(_0xc6f67a){logger[_0xa1eb('0x14')](_0xa1eb('0x16'),_0x5e637c,_0xc6f67a);_0x5ad89b(_0xc6f67a);});});}exports[_0xa1eb('0x19')]=function(_0x5adb8f){var _0x6b059a=this;return new Promise(function(_0x3ffdd1,_0x345e5f){return db[_0xa1eb('0x1a')][_0xa1eb('0x1b')](_0x5adb8f['body'],{'raw':_0x5adb8f[_0xa1eb('0x1c')]?_0x5adb8f[_0xa1eb('0x1c')][_0xa1eb('0x1d')]===undefined?!![]:![]:!![]})[_0xa1eb('0x1e')](function(_0x445d3c){logger[_0xa1eb('0xf')](_0xa1eb('0x19'),_0x5adb8f);logger['debug'](_0xa1eb('0x19'),_0x5adb8f,JSON[_0xa1eb('0x13')](_0x445d3c));_0x3ffdd1(_0x445d3c);})[_0xa1eb('0x18')](function(_0x23c2d9){logger[_0xa1eb('0x14')](_0xa1eb('0x19'),_0x23c2d9[_0xa1eb('0x15')],_0x5adb8f);_0x345e5f(_0x6b059a[_0xa1eb('0x14')](0x1f4,_0x23c2d9[_0xa1eb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f84da5a..70d8e53 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 _0x7a92=['register','length','smsMessage:','./smsMessage.events','save','remove','emit'];(function(_0x18c9ab,_0x6ba7e7){var _0x17fc37=function(_0x57783c){while(--_0x57783c){_0x18c9ab['push'](_0x18c9ab['shift']());}};_0x17fc37(++_0x6ba7e7);}(_0x7a92,0x1b5));var _0x27a9=function(_0x39a3ad,_0x473084){_0x39a3ad=_0x39a3ad-0x0;var _0x2ffa37=_0x7a92[_0x39a3ad];return _0x2ffa37;};'use strict';var SmsMessageEvents=require(_0x27a9('0x0'));var events=[_0x27a9('0x1'),_0x27a9('0x2'),'update'];function createListener(_0x5e0397,_0x1d501e){return function(_0x54413d){_0x1d501e[_0x27a9('0x3')](_0x5e0397,_0x54413d);};}function removeListener(_0x38e53f,_0x361b77){return function(){SmsMessageEvents['removeListener'](_0x38e53f,_0x361b77);};}exports[_0x27a9('0x4')]=function(_0x29c9de){for(var _0x267863=0x0,_0x31af62=events[_0x27a9('0x5')];_0x267863<_0x31af62;_0x267863++){var _0x5d6ba2=events[_0x267863];var _0x483f93=createListener(_0x27a9('0x6')+_0x5d6ba2,_0x29c9de);SmsMessageEvents['on'](_0x5d6ba2,_0x483f93);}}; \ No newline at end of file +var _0xb269=['./smsMessage.events','save','update','emit','removeListener','register','length','smsMessage:'];(function(_0x4dc4e4,_0x52b95b){var _0x239ff7=function(_0x24387d){while(--_0x24387d){_0x4dc4e4['push'](_0x4dc4e4['shift']());}};_0x239ff7(++_0x52b95b);}(_0xb269,0x1b0));var _0x9b26=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb269[_0x5b644e];return _0x49c6bf;};'use strict';var SmsMessageEvents=require(_0x9b26('0x0'));var events=[_0x9b26('0x1'),'remove',_0x9b26('0x2')];function createListener(_0x1e21c7,_0x3d5b30){return function(_0x2d4bb8){_0x3d5b30[_0x9b26('0x3')](_0x1e21c7,_0x2d4bb8);};}function removeListener(_0xd0f10b,_0x276c94){return function(){SmsMessageEvents[_0x9b26('0x4')](_0xd0f10b,_0x276c94);};}exports[_0x9b26('0x5')]=function(_0x11ebcc){for(var _0x3e9580=0x0,_0x520fb0=events[_0x9b26('0x6')];_0x3e9580<_0x520fb0;_0x3e9580++){var _0x591b85=events[_0x3e9580];var _0x4e21d1=createListener(_0x9b26('0x7')+_0x591b85,_0x11ebcc);SmsMessageEvents['on'](_0x591b85,_0x4e21d1);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 17e87d9..d70754f 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 _0x9fb1=['/:id','update','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put'];(function(_0x3c73bc,_0x50b095){var _0x53ce43=function(_0x4d6178){while(--_0x4d6178){_0x3c73bc['push'](_0x3c73bc['shift']());}};_0x53ce43(++_0x50b095);}(_0x9fb1,0xd7));var _0x19fb=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x9fb1[_0x2aec52];return _0x3b8835;};'use strict';var multer=require(_0x19fb('0x0'));var util=require(_0x19fb('0x1'));var path=require(_0x19fb('0x2'));var timeout=require(_0x19fb('0x3'));var express=require(_0x19fb('0x4'));var router=express[_0x19fb('0x5')]();var fs_extra=require(_0x19fb('0x6'));var auth=require(_0x19fb('0x7'));var interaction=require(_0x19fb('0x8'));var config=require(_0x19fb('0x9'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x19fb('0xa')](),controller['index']);router[_0x19fb('0xb')]('/describe',auth[_0x19fb('0xa')](),controller[_0x19fb('0xc')]);router['get']('/:id',auth[_0x19fb('0xa')](),controller[_0x19fb('0xd')]);router['get'](_0x19fb('0xe'),auth[_0x19fb('0xa')](),controller[_0x19fb('0xf')]);router[_0x19fb('0xb')](_0x19fb('0x10'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x11')]);router[_0x19fb('0xb')](_0x19fb('0x12'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x13')]);router[_0x19fb('0x14')]('/',auth['isAuthenticated'](),controller[_0x19fb('0x15')]);router[_0x19fb('0x14')](_0x19fb('0x10'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x16')]);router[_0x19fb('0x14')](_0x19fb('0x12'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x17')]);router[_0x19fb('0x18')](_0x19fb('0x19'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x1a')]);router[_0x19fb('0x1b')](_0x19fb('0x19'),auth['isAuthenticated'](),controller['destroy']);router[_0x19fb('0x1b')](_0x19fb('0x10'),auth[_0x19fb('0xa')](),controller[_0x19fb('0x1c')]);router[_0x19fb('0x1b')](_0x19fb('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x19fb('0x1d')]=router; \ No newline at end of file +var _0x5f7e=['describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated'];(function(_0x245d17,_0x173d03){var _0x43ec2c=function(_0x59bff2){while(--_0x59bff2){_0x245d17['push'](_0x245d17['shift']());}};_0x43ec2c(++_0x173d03);}(_0x5f7e,0x13c));var _0xe5f7=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x5f7e[_0x2d9c6a];return _0xf3c918;};'use strict';var multer=require(_0xe5f7('0x0'));var util=require(_0xe5f7('0x1'));var path=require('path');var timeout=require(_0xe5f7('0x2'));var express=require(_0xe5f7('0x3'));var router=express[_0xe5f7('0x4')]();var fs_extra=require(_0xe5f7('0x5'));var auth=require(_0xe5f7('0x6'));var interaction=require(_0xe5f7('0x7'));var config=require(_0xe5f7('0x8'));var controller=require(_0xe5f7('0x9'));router[_0xe5f7('0xa')]('/',auth['isAuthenticated'](),controller[_0xe5f7('0xb')]);router[_0xe5f7('0xa')](_0xe5f7('0xc'),auth[_0xe5f7('0xd')](),controller[_0xe5f7('0xe')]);router[_0xe5f7('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe5f7('0xf')]);router[_0xe5f7('0xa')](_0xe5f7('0x10'),auth[_0xe5f7('0xd')](),controller[_0xe5f7('0x11')]);router['get'](_0xe5f7('0x12'),auth['isAuthenticated'](),controller[_0xe5f7('0x13')]);router[_0xe5f7('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xe5f7('0x14')]);router[_0xe5f7('0x15')]('/',auth[_0xe5f7('0xd')](),controller['create']);router['post'](_0xe5f7('0x12'),auth['isAuthenticated'](),controller[_0xe5f7('0x16')]);router['post'](_0xe5f7('0x17'),auth[_0xe5f7('0xd')](),controller[_0xe5f7('0x18')]);router[_0xe5f7('0x19')](_0xe5f7('0x1a'),auth['isAuthenticated'](),controller[_0xe5f7('0x1b')]);router[_0xe5f7('0x1c')](_0xe5f7('0x1a'),auth[_0xe5f7('0xd')](),controller[_0xe5f7('0x1d')]);router['delete']('/:id/teams',auth[_0xe5f7('0xd')](),controller[_0xe5f7('0x1e')]);router[_0xe5f7('0x1c')](_0xe5f7('0x17'),auth[_0xe5f7('0xd')](),controller[_0xe5f7('0x1f')]);module[_0xe5f7('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index f74a8e7..8834f1f 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 _0x46a3=['beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x1d7283,_0x24554e){var _0x4511d7=function(_0x1116d1){while(--_0x1116d1){_0x1d7283['push'](_0x1d7283['shift']());}};_0x4511d7(++_0x24554e);}(_0x46a3,0x11f));var _0x346a=function(_0x38000e,_0xb94a34){_0x38000e=_0x38000e-0x0;var _0x1b61a9=_0x46a3[_0x38000e];return _0x1b61a9;};'use strict';var Sequelize=require(_0x346a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x346a('0x1')]},'timeout':{'type':Sequelize[_0x346a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x346a('0x3'),_0x346a('0x4'))}}; \ No newline at end of file +var _0xeee5=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xffe606,_0x4d477b){var _0x18ef24=function(_0x175ca0){while(--_0x175ca0){_0xffe606['push'](_0xffe606['shift']());}};_0x18ef24(++_0x4d477b);}(_0xeee5,0x112));var _0x5eee=function(_0x36565d,_0x37395c){_0x36565d=_0x36565d-0x0;var _0x2032ed=_0xeee5[_0x36565d];return _0x2032ed;};'use strict';var Sequelize=require(_0x5eee('0x0'));module[_0x5eee('0x1')]={'name':{'type':Sequelize[_0x5eee('0x2')],'unique':_0x5eee('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5eee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5eee('0x5')]('rrmemory',_0x5eee('0x6'),_0x5eee('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e183341..a0c6832 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 _0x3696=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','show','params','length','options','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','create','update','describe','getMembers','findOne','order','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','rows','%s/%s','SIP','getTeams','Team','pick','addTeams','body','ids','findAll','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','fs-extra','lodash','squel','jsforce'];(function(_0x5ee911,_0x55ac30){var _0x2b1004=function(_0x3e5651){while(--_0x3e5651){_0x5ee911['push'](_0x5ee911['shift']());}};_0x2b1004(++_0x55ac30);}(_0x3696,0x7e));var _0x6369=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3696[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x6369('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6369('0x1'));var jsonpatch=require(_0x6369('0x2'));var rp=require(_0x6369('0x3'));var moment=require(_0x6369('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6369('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6369('0x6'));var _=require(_0x6369('0x7'));var squel=require(_0x6369('0x8'));var crypto=require('crypto');var jsforce=require(_0x6369('0x9'));var deskjs=require(_0x6369('0xa'));var toCsv=require(_0x6369('0xb'));var querystring=require('querystring');var Papa=require(_0x6369('0xc'));var Redis=require(_0x6369('0xd'));var authService=require(_0x6369('0xe'));var qs=require(_0x6369('0xf'));var as=require(_0x6369('0x10'));var hardwareService=require(_0x6369('0x11'));var logger=require(_0x6369('0x12'))(_0x6369('0x13'));var utils=require('../../config/utils');var config=require(_0x6369('0x14'));var licenseUtil=require(_0x6369('0x15'));var db=require(_0x6369('0x16'))['db'];config[_0x6369('0x17')]=_['defaults'](config[_0x6369('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6369('0x18'))(new Redis(config[_0x6369('0x17')]));require(_0x6369('0x19'))[_0x6369('0x1a')](socket);function respondWithStatusCode(_0x4449eb,_0x3dcb5a){_0x3dcb5a=_0x3dcb5a||0xcc;return function(_0x1a3d88){if(_0x1a3d88){return _0x4449eb[_0x6369('0x1b')](_0x3dcb5a);}return _0x4449eb[_0x6369('0x1c')](_0x3dcb5a)[_0x6369('0x1d')]();};}function respondWithResult(_0x13cfab,_0x4129e4){_0x4129e4=_0x4129e4||0xc8;return function(_0x5935ce){if(_0x5935ce){return _0x13cfab[_0x6369('0x1c')](_0x4129e4)['json'](_0x5935ce);}};}function respondWithFilteredResult(_0x5cbbb6,_0x1ca116){return function(_0x51bd63){if(_0x51bd63){var _0x21ba7c=typeof _0x1ca116[_0x6369('0x1e')]===_0x6369('0x1f')&&typeof _0x1ca116[_0x6369('0x20')]===_0x6369('0x1f');var _0x25606a=_0x51bd63[_0x6369('0x21')];var _0x327499=_0x21ba7c?0x0:_0x1ca116['offset'];var _0x37d992=_0x21ba7c?_0x51bd63[_0x6369('0x21')]:_0x1ca116[_0x6369('0x1e')]+_0x1ca116['limit'];var _0x3ce2e7;if(_0x37d992>=_0x25606a){_0x37d992=_0x25606a;_0x3ce2e7=0xc8;}else{_0x3ce2e7=0xce;}_0x5cbbb6[_0x6369('0x1c')](_0x3ce2e7);return _0x5cbbb6['set'](_0x6369('0x22'),_0x327499+'-'+_0x37d992+'/'+_0x25606a)[_0x6369('0x23')](_0x51bd63);}return null;};}function patchUpdates(_0x1a571a){return function(_0xe169b7){try{jsonpatch['apply'](_0xe169b7,_0x1a571a,!![]);}catch(_0x41a59a){return BPromise[_0x6369('0x24')](_0x41a59a);}return _0xe169b7[_0x6369('0x25')]();};}function saveUpdates(_0x504d58,_0x1d83b3){return function(_0xad9029){if(_0xad9029){return _0xad9029['update'](_0x504d58)['then'](function(_0x205f73){return _0x205f73;});}return null;};}function removeEntity(_0x237a3a,_0x40687a){return function(_0x1a4753){if(_0x1a4753){return _0x1a4753[_0x6369('0x26')]()[_0x6369('0x27')](function(){var _0x2b57f8=_0x1a4753[_0x6369('0x28')]({'plain':!![]});var _0x3f4537=_0x6369('0x29');return db[_0x6369('0x2a')]['destroy']({'where':{'type':_0x3f4537,'resourceId':_0x2b57f8['id']}})['then'](function(){return _0x1a4753;});})['then'](function(){_0x237a3a['status'](0xcc)[_0x6369('0x1d')]();});}};}function handleEntityNotFound(_0x5eb26a,_0x1b04b4){return function(_0x278533){if(!_0x278533){_0x5eb26a[_0x6369('0x1b')](0x194);}return _0x278533;};}function handleError(_0x1b1651,_0x3d4756){_0x3d4756=_0x3d4756||0x1f4;return function(_0x318a8b){logger[_0x6369('0x2b')](_0x318a8b[_0x6369('0x2c')]);if(_0x318a8b[_0x6369('0x2d')]){delete _0x318a8b[_0x6369('0x2d')];}_0x1b1651['status'](_0x3d4756)[_0x6369('0x2e')](_0x318a8b);};}exports[_0x6369('0x2f')]=function(_0x11889d,_0x3fe8a4){var _0x478169={},_0x2c3882={},_0x36a555={'count':0x0,'rows':[]};var _0x4e8db6=_[_0x6369('0x30')](db[_0x6369('0x31')][_0x6369('0x32')],function(_0x4bc534){return{'name':_0x4bc534[_0x6369('0x33')],'type':_0x4bc534[_0x6369('0x34')][_0x6369('0x35')]};});_0x2c3882[_0x6369('0x36')]=_[_0x6369('0x30')](_0x4e8db6,_0x6369('0x2d'));_0x2c3882[_0x6369('0x37')]=_[_0x6369('0x38')](_0x11889d['query']);_0x2c3882['filters']=_['intersection'](_0x2c3882['model'],_0x2c3882[_0x6369('0x37')]);_0x478169[_0x6369('0x39')]=_[_0x6369('0x3a')](_0x2c3882[_0x6369('0x36')],qs[_0x6369('0x3b')](_0x11889d[_0x6369('0x37')][_0x6369('0x3b')]));_0x478169[_0x6369('0x39')]=_0x478169[_0x6369('0x39')]['length']?_0x478169[_0x6369('0x39')]:_0x2c3882[_0x6369('0x36')];if(!_0x11889d['query'][_0x6369('0x3c')](_0x6369('0x3d'))){_0x478169[_0x6369('0x20')]=qs[_0x6369('0x20')](_0x11889d[_0x6369('0x37')]['limit']);_0x478169['offset']=qs['offset'](_0x11889d[_0x6369('0x37')][_0x6369('0x1e')]);}_0x478169['order']=qs[_0x6369('0x3e')](_0x11889d[_0x6369('0x37')][_0x6369('0x3e')]);_0x478169[_0x6369('0x3f')]=qs[_0x6369('0x40')](_['pick'](_0x11889d[_0x6369('0x37')],_0x2c3882[_0x6369('0x40')]),_0x4e8db6);if(_0x11889d[_0x6369('0x37')][_0x6369('0x41')]){_0x478169[_0x6369('0x3f')]=_[_0x6369('0x42')](_0x478169['where'],{'$or':_[_0x6369('0x30')](_0x4e8db6,function(_0xd6e607){if(_0xd6e607[_0x6369('0x34')]!==_0x6369('0x43')){var _0x5d1c05={};_0x5d1c05[_0xd6e607[_0x6369('0x2d')]]={'$like':'%'+_0x11889d[_0x6369('0x37')][_0x6369('0x41')]+'%'};return _0x5d1c05;}})});}_0x478169=_[_0x6369('0x42')]({},_0x478169,_0x11889d['options']);var _0x16fa38={'where':_0x478169[_0x6369('0x3f')]};return db[_0x6369('0x31')][_0x6369('0x21')](_0x16fa38)['then'](function(_0x5acffe){_0x36a555[_0x6369('0x21')]=_0x5acffe;if(_0x11889d[_0x6369('0x37')][_0x6369('0x44')]){_0x478169[_0x6369('0x45')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x478169);})[_0x6369('0x27')](function(_0x5ccdd0){_0x36a555['rows']=_0x5ccdd0;return _0x36a555;})[_0x6369('0x27')](respondWithFilteredResult(_0x3fe8a4,_0x478169))['catch'](handleError(_0x3fe8a4,null));};exports[_0x6369('0x46')]=function(_0xd0f212,_0x33b739){var _0x5c5ca3={'raw':!![],'where':{'id':_0xd0f212[_0x6369('0x47')]['id']}},_0xee48d4={};_0xee48d4[_0x6369('0x36')]=_[_0x6369('0x38')](db[_0x6369('0x31')][_0x6369('0x32')]);_0xee48d4['query']=_[_0x6369('0x38')](_0xd0f212[_0x6369('0x37')]);_0xee48d4['filters']=_[_0x6369('0x3a')](_0xee48d4[_0x6369('0x36')],_0xee48d4[_0x6369('0x37')]);_0x5c5ca3[_0x6369('0x39')]=_[_0x6369('0x3a')](_0xee48d4[_0x6369('0x36')],qs[_0x6369('0x3b')](_0xd0f212[_0x6369('0x37')][_0x6369('0x3b')]));_0x5c5ca3['attributes']=_0x5c5ca3['attributes'][_0x6369('0x48')]?_0x5c5ca3[_0x6369('0x39')]:_0xee48d4[_0x6369('0x36')];if(_0xd0f212['query'][_0x6369('0x44')]){_0x5c5ca3[_0x6369('0x45')]=[{'all':!![]}];}_0x5c5ca3=_[_0x6369('0x42')]({},_0x5c5ca3,_0xd0f212[_0x6369('0x49')]);return db[_0x6369('0x31')]['find'](_0x5c5ca3)[_0x6369('0x27')](handleEntityNotFound(_0x33b739,null))[_0x6369('0x27')](respondWithResult(_0x33b739,null))[_0x6369('0x4a')](handleError(_0x33b739,null));};exports['create']=function(_0x3a6b3d,_0xcd6ef7){return db[_0x6369('0x31')]['create'](_0x3a6b3d['body'],{})[_0x6369('0x27')](function(_0x330dc4){var _0x24d52=_0x3a6b3d['user'][_0x6369('0x28')]({'plain':!![]});if(!_0x24d52)throw new Error(_0x6369('0x4b'));if(_0x24d52[_0x6369('0x4c')]===_0x6369('0x4d')){var _0x3a9003=_0x330dc4[_0x6369('0x28')]({'plain':!![]});var _0x18041f=_0x6369('0x29');return db[_0x6369('0x4e')][_0x6369('0x4f')]({'where':{'name':_0x18041f,'userProfileId':_0x24d52['userProfileId']},'raw':!![]})[_0x6369('0x27')](function(_0x5180fc){if(_0x5180fc&&_0x5180fc[_0x6369('0x50')]===0x0){return db['UserProfileResource'][_0x6369('0x51')]({'name':_0x3a9003[_0x6369('0x2d')],'resourceId':_0x3a9003['id'],'type':_0x5180fc[_0x6369('0x2d')],'sectionId':_0x5180fc['id']},{})[_0x6369('0x27')](function(){return _0x330dc4;});}else{return _0x330dc4;}})[_0x6369('0x4a')](function(_0x5d0ff5){logger[_0x6369('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d0ff5);throw _0x5d0ff5;});}return _0x330dc4;})[_0x6369('0x27')](respondWithResult(_0xcd6ef7,0xc9))[_0x6369('0x4a')](handleError(_0xcd6ef7,null));};exports[_0x6369('0x52')]=function(_0x23a785,_0x32284b){if(_0x23a785['body']['id']){delete _0x23a785['body']['id'];}return db[_0x6369('0x31')][_0x6369('0x4f')]({'where':{'id':_0x23a785[_0x6369('0x47')]['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x32284b,null))[_0x6369('0x27')](saveUpdates(_0x23a785['body'],null))['then'](respondWithResult(_0x32284b,null))[_0x6369('0x4a')](handleError(_0x32284b,null));};exports[_0x6369('0x26')]=function(_0x5f52e0,_0x472769){return db[_0x6369('0x31')]['find']({'where':{'id':_0x5f52e0['params']['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x472769,null))[_0x6369('0x27')](removeEntity(_0x472769,null))[_0x6369('0x4a')](handleError(_0x472769,null));};exports[_0x6369('0x53')]=function(_0x11e3ff,_0x42ebc9){return db['SmsQueue'][_0x6369('0x53')]()[_0x6369('0x27')](respondWithResult(_0x42ebc9,null))[_0x6369('0x4a')](handleError(_0x42ebc9,null));};exports[_0x6369('0x54')]=function(_0x25fecf,_0x2c9969,_0xda892a){var _0xceb309={'raw':!![],'where':{}},_0x2e116a={},_0x3defe3;return db[_0x6369('0x31')][_0x6369('0x55')]({'where':{'id':_0x25fecf[_0x6369('0x47')]['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x2c9969,null))['then'](function(_0x4b307a){if(_0x4b307a){_0x3defe3=_0x4b307a[_0x6369('0x28')]({'plain':!![]});_0x2e116a[_0x6369('0x36')]=_[_0x6369('0x38')](db['UserSmsQueue'][_0x6369('0x32')]);_0x2e116a['query']=_[_0x6369('0x38')](_0x25fecf[_0x6369('0x37')]);_0x2e116a[_0x6369('0x40')]=_[_0x6369('0x3a')](_0x2e116a[_0x6369('0x36')],_0x2e116a[_0x6369('0x37')]);_0xceb309['attributes']=_[_0x6369('0x3a')](_0x2e116a[_0x6369('0x36')],qs[_0x6369('0x3b')](_0x25fecf[_0x6369('0x37')][_0x6369('0x3b')]));_0xceb309[_0x6369('0x39')]=_0xceb309[_0x6369('0x39')][_0x6369('0x48')]?_0xceb309['attributes']:_0x2e116a['model'];if(!_0x25fecf['query'][_0x6369('0x3c')](_0x6369('0x3d'))){_0xceb309[_0x6369('0x20')]=qs[_0x6369('0x20')](_0x25fecf[_0x6369('0x37')]['limit']);_0xceb309[_0x6369('0x1e')]=qs['offset'](_0x25fecf[_0x6369('0x37')][_0x6369('0x1e')]);}_0xceb309[_0x6369('0x56')]=qs['sort'](_0x25fecf[_0x6369('0x37')][_0x6369('0x3e')]);_0xceb309[_0x6369('0x3f')]=qs['filters'](_['pick'](_0x25fecf[_0x6369('0x37')],_0x2e116a[_0x6369('0x40')]));_0xceb309[_0x6369('0x3f')]['SmsQueueId']=_0x4b307a['id'];if(_0x25fecf[_0x6369('0x37')][_0x6369('0x41')]){_0xceb309['where']=_[_0x6369('0x42')](_0xceb309[_0x6369('0x3f')],{'$or':_['map'](_0xceb309[_0x6369('0x39')],function(_0x40ce51){var _0x21dae4={};_0x21dae4[_0x40ce51]={'$like':'%'+_0x25fecf[_0x6369('0x37')]['filter']+'%'};return _0x21dae4;})});}_0xceb309=_['merge']({},_0xceb309,_0x25fecf['options']);return db[_0x6369('0x57')]['findAll'](_0xceb309);}})['then'](function(_0x44fa64){if(_0x44fa64){return db[_0x6369('0x58')][_0x6369('0x59')]({'where':{'id':_[_0x6369('0x30')](_0x44fa64,_0x6369('0x5a')),'role':_0x6369('0x5b')},'attributes':['id','name',_0x6369('0x5c'),_0x6369('0x5d'),'createdAt']});}})['then'](function(_0x2f3f2e){if(_0x2f3f2e){return{'count':_0x2f3f2e[_0x6369('0x21')],'rows':_['map'](_0x2f3f2e[_0x6369('0x5e')],function(_0x592c3c){return{'membername':_0x592c3c[_0x6369('0x2d')],'UserId':_0x592c3c['id'],'queue_name':_0x3defe3[_0x6369('0x2d')],'SmsQueueId':_0x3defe3['id'],'interface':util['format'](_0x6369('0x5f'),_0x6369('0x60'),_0x592c3c[_0x6369('0x2d')]),'penalty':0x0,'paused':_0x592c3c['smsPause'],'createdAt':_0x592c3c['createdAt'],'updatedAt':_0x592c3c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6369('0x27')](respondWithFilteredResult(_0x2c9969,_0xceb309))[_0x6369('0x4a')](handleError(_0x2c9969,null));};exports[_0x6369('0x61')]=function(_0x57ad97,_0x69baed,_0x599c55){var _0x48554d={};var _0x2b4dfd={};var _0x4e2d49;var _0x5f292e;return db[_0x6369('0x31')][_0x6369('0x55')]({'where':{'id':_0x57ad97['params']['id']}})['then'](handleEntityNotFound(_0x69baed,null))['then'](function(_0x26f902){if(_0x26f902){_0x4e2d49=_0x26f902;_0x2b4dfd[_0x6369('0x36')]=_[_0x6369('0x38')](db[_0x6369('0x62')][_0x6369('0x32')]);_0x2b4dfd[_0x6369('0x37')]=_[_0x6369('0x38')](_0x57ad97[_0x6369('0x37')]);_0x2b4dfd['filters']=_['intersection'](_0x2b4dfd[_0x6369('0x36')],_0x2b4dfd[_0x6369('0x37')]);_0x48554d[_0x6369('0x39')]=_[_0x6369('0x3a')](_0x2b4dfd[_0x6369('0x36')],qs[_0x6369('0x3b')](_0x57ad97[_0x6369('0x37')][_0x6369('0x3b')]));_0x48554d[_0x6369('0x39')]=_0x48554d[_0x6369('0x39')]['length']?_0x48554d[_0x6369('0x39')]:_0x2b4dfd['model'];_0x48554d[_0x6369('0x56')]=qs[_0x6369('0x3e')](_0x57ad97['query'][_0x6369('0x3e')]);_0x48554d[_0x6369('0x3f')]=qs['filters'](_[_0x6369('0x63')](_0x57ad97['query'],_0x2b4dfd[_0x6369('0x40')]));if(_0x57ad97[_0x6369('0x37')][_0x6369('0x41')]){_0x48554d[_0x6369('0x3f')]=_[_0x6369('0x42')](_0x48554d[_0x6369('0x3f')],{'$or':_['map'](_0x48554d[_0x6369('0x39')],function(_0x40af99){var _0x4e46dc={};_0x4e46dc[_0x40af99]={'$like':'%'+_0x57ad97[_0x6369('0x37')]['filter']+'%'};return _0x4e46dc;})});}_0x48554d=_['merge']({},_0x48554d,_0x57ad97['options']);return _0x4e2d49[_0x6369('0x61')](_0x48554d);}})['then'](function(_0x5915d8){if(_0x5915d8){_0x5f292e=_0x5915d8['length'];if(!_0x57ad97[_0x6369('0x37')]['hasOwnProperty'](_0x6369('0x3d'))){_0x48554d[_0x6369('0x20')]=qs[_0x6369('0x20')](_0x57ad97[_0x6369('0x37')]['limit']);_0x48554d[_0x6369('0x1e')]=qs[_0x6369('0x1e')](_0x57ad97[_0x6369('0x37')][_0x6369('0x1e')]);}return _0x4e2d49[_0x6369('0x61')](_0x48554d);}})[_0x6369('0x27')](function(_0x297143){if(_0x297143){return _0x297143?{'count':_0x5f292e,'rows':_0x297143}:null;}})[_0x6369('0x27')](respondWithResult(_0x69baed,null))[_0x6369('0x4a')](handleError(_0x69baed,null));};exports[_0x6369('0x64')]=function(_0x47be21,_0x4c5559,_0x3a5c05){var _0x1e4ee8=_0x47be21[_0x6369('0x65')][_0x6369('0x66')];return db[_0x6369('0x62')][_0x6369('0x67')]({'where':{'id':_0x1e4ee8},'attributes':['id'],'include':[{'model':db[_0x6369('0x58')],'as':_0x6369('0x68'),'attributes':['id',_0x6369('0x2d'),_0x6369('0x69'),_0x6369('0x6a'),_0x6369('0x6b')],'raw':!![]}]})[_0x6369('0x27')](function(_0x2f0007){if(_0x2f0007){var _0x263a23=_['flatMap'](_0x2f0007,function(_0x19efe0){var _0x1040ff=_0x19efe0[_0x6369('0x28')]({'plain':!![]});return _0x1040ff[_0x6369('0x68')];});return db[_0x6369('0x31')][_0x6369('0x4f')]({'where':{'id':_0x47be21[_0x6369('0x47')]['id']}})[_0x6369('0x27')](function(_0x321a82){return db[_0x6369('0x6c')][_0x6369('0x6d')](function(_0x383cb1){return _0x321a82[_0x6369('0x64')](_0x1e4ee8,{'transaction':_0x383cb1})[_0x6369('0x27')](function(){return BPromise['each'](_0x263a23,function(_0x48514b){return db[_0x6369('0x57')][_0x6369('0x6e')]({'where':{'UserId':_0x48514b['id'],'SmsQueueId':_0x47be21[_0x6369('0x47')]['id']},'transaction':_0x383cb1});});})['then'](function(){_0x263a23[_0x6369('0x6f')](function(_0x166c36){socket[_0x6369('0x70')](_0x6369('0x71'),{'UserId':_0x166c36['id'],'SmsQueueId':_0x321a82['id']});});});});});}})[_0x6369('0x27')](respondWithStatusCode(_0x4c5559,null))['catch'](handleError(_0x4c5559,null));};exports[_0x6369('0x72')]=function(_0xdf7098,_0x4442d1,_0x313e13){return db[_0x6369('0x62')][_0x6369('0x67')]({'where':{'id':_0xdf7098[_0x6369('0x37')][_0x6369('0x66')]},'attributes':['id'],'include':[{'model':db[_0x6369('0x58')],'as':_0x6369('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4442d1,null))['then'](function(_0x3af6fd){var _0x21fb39=_['map'](_0x3af6fd,'id');var _0x8896bf=[];var _0x3bd54d=[];var _0x28c978=squel['select']();_0x28c978['field'](_0x6369('0x73'))[_0x6369('0x74')]('team_has_sms_queues','tq')[_0x6369('0x75')](_0x6369('0x76'),'ut',_0x6369('0x77'))[_0x6369('0x3f')]('SmsQueueId\x20=\x20?',_0xdf7098[_0x6369('0x47')]['id']);for(var _0x3a0328=0x0;_0x3a0328<_0x3af6fd['length'];_0x3a0328+=0x1){let _0x37d2d1=_0x3af6fd[_0x3a0328];for(var _0x218f41=0x0;_0x218f41<_0x37d2d1['Agents']['length'];_0x218f41+=0x1){let _0x17aade=_0x37d2d1[_0x6369('0x68')][_0x218f41];var _0x486817=_0x28c978['clone']();_0x486817['where'](_0x6369('0x78'),_0x17aade['id']);_0x3bd54d[_0x6369('0x79')](db[_0x6369('0x6c')][_0x6369('0x37')](_0x486817[_0x6369('0x7a')](),{'type':db[_0x6369('0x6c')][_0x6369('0x7b')][_0x6369('0x7c')]})[_0x6369('0x27')](function(_0x2644dc){if(_0x2644dc[_0x6369('0x48')]===0x1){return _0x17aade['id'];}else{var _0x34f437=_[_0x6369('0x7d')](_[_0x6369('0x30')](_0x2644dc,'TeamId'),function(_0x2300eb){return _[_0x6369('0x7e')](_0x21fb39,_0x2300eb);});if(_0x34f437){return _0x17aade['id'];}}}));}}return BPromise[_0x6369('0x7f')](_0x3bd54d)[_0x6369('0x27')](function(_0xa29491){_0x8896bf=_(_0x8896bf)[_0x6369('0x80')](_0xa29491)['compact']()['value']();return db['SmsQueue'][_0x6369('0x4f')]({'where':{'id':_0xdf7098[_0x6369('0x47')]['id']}})[_0x6369('0x27')](function(_0x2ea80d){return db[_0x6369('0x6c')][_0x6369('0x6d')](function(_0x515b25){return _0x2ea80d['removeTeams'](_0xdf7098['query'][_0x6369('0x66')],{'transaction':_0x515b25})[_0x6369('0x27')](function(){if(!_[_0x6369('0x81')](_0x8896bf)){return _0x2ea80d[_0x6369('0x82')](_0x8896bf,{'transaction':_0x515b25});}})[_0x6369('0x27')](function(){_0x8896bf['forEach'](function(_0x180e97){socket[_0x6369('0x70')](_0x6369('0x83'),{'UserId':_0x180e97,'SmsQueueId':_0x2ea80d['id']});});});});});});})[_0x6369('0x27')](respondWithStatusCode(_0x4442d1,null))[_0x6369('0x4a')](handleError(_0x4442d1,null));};exports[_0x6369('0x84')]=function(_0x1b7bd5,_0x23447d,_0xa1a3f){return db[_0x6369('0x31')][_0x6369('0x4f')]({'where':{'id':_0x1b7bd5[_0x6369('0x47')]['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x23447d,null))[_0x6369('0x27')](function(_0x31b000){if(_0x31b000){return _0x31b000[_0x6369('0x84')](_0x1b7bd5[_0x6369('0x65')][_0x6369('0x66')],_[_0x6369('0x85')](_0x1b7bd5['body'],[_0x6369('0x66'),'id'])||{})[_0x6369('0x86')](function(_0x107d62){for(var _0x1d8e5b=0x0;_0x1d8e5b<_0x1b7bd5['body']['ids'][_0x6369('0x48')];_0x1d8e5b+=0x1){socket[_0x6369('0x70')]('userSmsQueue:save',{'UserId':Number(_0x1b7bd5[_0x6369('0x65')][_0x6369('0x66')][_0x1d8e5b]),'SmsQueueId':Number(_0x1b7bd5[_0x6369('0x47')]['id'])});}return _0x107d62;});}})['then'](respondWithResult(_0x23447d,null))[_0x6369('0x4a')](handleError(_0x23447d,null));};exports[_0x6369('0x82')]=function(_0x1f475d,_0x3020e8,_0xae5f5f){return db[_0x6369('0x31')]['find']({'where':{'id':_0x1f475d[_0x6369('0x47')]['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x3020e8,null))[_0x6369('0x27')](function(_0x457a06){if(_0x457a06){return _0x457a06[_0x6369('0x82')](_0x1f475d[_0x6369('0x37')]['ids'])[_0x6369('0x27')](function(){if(_['isArray'](_0x1f475d[_0x6369('0x37')][_0x6369('0x66')])){for(var _0x1321e6=0x0;_0x1321e6<_0x1f475d[_0x6369('0x37')]['ids'][_0x6369('0x48')];_0x1321e6+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x1f475d['query'][_0x6369('0x66')][_0x1321e6]),'SmsQueueId':Number(_0x1f475d[_0x6369('0x47')]['id'])});}}else{socket['emit'](_0x6369('0x83'),{'UserId':Number(_0x1f475d[_0x6369('0x37')][_0x6369('0x66')]),'SmsQueueId':Number(_0x1f475d[_0x6369('0x47')]['id'])});}});}})[_0x6369('0x27')](respondWithStatusCode(_0x3020e8,null))[_0x6369('0x4a')](handleError(_0x3020e8,null));};exports[_0x6369('0x87')]=function(_0x52aaeb,_0x10a880,_0x41f4b2){var _0x40569d={};var _0x41be64={};var _0x48dceb;var _0x51f74d;return db[_0x6369('0x31')][_0x6369('0x55')]({'where':{'id':_0x52aaeb[_0x6369('0x47')]['id']}})[_0x6369('0x27')](handleEntityNotFound(_0x10a880,null))[_0x6369('0x27')](function(_0x127432){if(_0x127432){_0x48dceb=_0x127432;_0x41be64[_0x6369('0x36')]=_['keys'](db[_0x6369('0x58')]['rawAttributes']);_0x41be64[_0x6369('0x37')]=_[_0x6369('0x38')](_0x52aaeb['query']);_0x41be64['filters']=_['intersection'](_0x41be64[_0x6369('0x36')],_0x41be64[_0x6369('0x37')]);_0x40569d[_0x6369('0x39')]=_[_0x6369('0x3a')](_0x41be64[_0x6369('0x36')],qs[_0x6369('0x3b')](_0x52aaeb[_0x6369('0x37')][_0x6369('0x3b')]));_0x40569d['attributes']=_0x40569d[_0x6369('0x39')][_0x6369('0x48')]?_0x40569d[_0x6369('0x39')]:_0x41be64[_0x6369('0x36')];_0x40569d[_0x6369('0x56')]=qs['sort'](_0x52aaeb[_0x6369('0x37')][_0x6369('0x3e')]);_0x40569d[_0x6369('0x3f')]=qs[_0x6369('0x40')](_[_0x6369('0x63')](_0x52aaeb[_0x6369('0x37')],_0x41be64[_0x6369('0x40')]));if(_0x52aaeb[_0x6369('0x37')][_0x6369('0x41')]){_0x40569d['where']=_[_0x6369('0x42')](_0x40569d[_0x6369('0x3f')],{'$or':_[_0x6369('0x30')](_0x40569d[_0x6369('0x39')],function(_0x50353d){var _0x24e00d={};_0x24e00d[_0x50353d]={'$like':'%'+_0x52aaeb['query'][_0x6369('0x41')]+'%'};return _0x24e00d;})});}_0x40569d=_[_0x6369('0x42')]({},_0x40569d,_0x52aaeb['options']);return _0x48dceb['getAgents'](_0x40569d);}})[_0x6369('0x27')](function(_0x555f5a){if(_0x555f5a){_0x51f74d=_0x555f5a['length'];if(!_0x52aaeb[_0x6369('0x37')][_0x6369('0x3c')](_0x6369('0x3d'))){_0x40569d[_0x6369('0x20')]=qs[_0x6369('0x20')](_0x52aaeb[_0x6369('0x37')][_0x6369('0x20')]);_0x40569d[_0x6369('0x1e')]=qs[_0x6369('0x1e')](_0x52aaeb[_0x6369('0x37')][_0x6369('0x1e')]);}return _0x48dceb[_0x6369('0x87')](_0x40569d);}})[_0x6369('0x27')](function(_0x5eda1b){if(_0x5eda1b){return _0x5eda1b?{'count':_0x51f74d,'rows':_0x5eda1b}:null;}})[_0x6369('0x27')](respondWithResult(_0x10a880,null))[_0x6369('0x4a')](handleError(_0x10a880,null));}; \ No newline at end of file +var _0x2256=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueue','includeAll','include','findAll','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','describe','findOne','UserSmsQueue','nolimit','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','addTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','emit','removeTeams','Team','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','union','compact','value','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','register','status','end','undefined','limit','count','offset','set','apply','reject','update','then','get','SmsQueues','UserProfileResource','destroy','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x3f7154,_0x57def0){var _0x2baa0=function(_0x20b9ce){while(--_0x20b9ce){_0x3f7154['push'](_0x3f7154['shift']());}};_0x2baa0(++_0x57def0);}(_0x2256,0x166));var _0x6225=function(_0x6555ff,_0x5d4cb8){_0x6555ff=_0x6555ff-0x0;var _0xe6fab2=_0x2256[_0x6555ff];return _0xe6fab2;};'use strict';var emlformat=require(_0x6225('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6225('0x1'));var jsonpatch=require(_0x6225('0x2'));var rp=require(_0x6225('0x3'));var moment=require('moment');var BPromise=require(_0x6225('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6225('0x5'));var sox=require(_0x6225('0x6'));var csv=require(_0x6225('0x7'));var ejs=require(_0x6225('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6225('0x9'));var jsforce=require(_0x6225('0xa'));var deskjs=require(_0x6225('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6225('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6225('0xd'));var as=require(_0x6225('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6225('0xf'))(_0x6225('0x10'));var utils=require(_0x6225('0x11'));var config=require(_0x6225('0x12'));var licenseUtil=require(_0x6225('0x13'));var db=require('../../mysqldb')['db'];config[_0x6225('0x14')]=_[_0x6225('0x15')](config[_0x6225('0x14')],{'host':_0x6225('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6225('0x14')]));require(_0x6225('0x17'))[_0x6225('0x18')](socket);function respondWithStatusCode(_0x1795d3,_0x3d386f){_0x3d386f=_0x3d386f||0xcc;return function(_0x3214c0){if(_0x3214c0){return _0x1795d3['sendStatus'](_0x3d386f);}return _0x1795d3[_0x6225('0x19')](_0x3d386f)[_0x6225('0x1a')]();};}function respondWithResult(_0x230593,_0x33d11b){_0x33d11b=_0x33d11b||0xc8;return function(_0x2f1389){if(_0x2f1389){return _0x230593[_0x6225('0x19')](_0x33d11b)['json'](_0x2f1389);}};}function respondWithFilteredResult(_0x550882,_0x14875c){return function(_0x3a53ba){if(_0x3a53ba){var _0x1518a9=typeof _0x14875c['offset']===_0x6225('0x1b')&&typeof _0x14875c[_0x6225('0x1c')]===_0x6225('0x1b');var _0x1dae64=_0x3a53ba[_0x6225('0x1d')];var _0x17aebb=_0x1518a9?0x0:_0x14875c[_0x6225('0x1e')];var _0x47f831=_0x1518a9?_0x3a53ba[_0x6225('0x1d')]:_0x14875c[_0x6225('0x1e')]+_0x14875c['limit'];var _0x181cb0;if(_0x47f831>=_0x1dae64){_0x47f831=_0x1dae64;_0x181cb0=0xc8;}else{_0x181cb0=0xce;}_0x550882[_0x6225('0x19')](_0x181cb0);return _0x550882[_0x6225('0x1f')]('Content-Range',_0x17aebb+'-'+_0x47f831+'/'+_0x1dae64)['json'](_0x3a53ba);}return null;};}function patchUpdates(_0x1d214a){return function(_0x4b3760){try{jsonpatch[_0x6225('0x20')](_0x4b3760,_0x1d214a,!![]);}catch(_0x5069d6){return BPromise[_0x6225('0x21')](_0x5069d6);}return _0x4b3760['save']();};}function saveUpdates(_0x5a5137,_0x4d3eef){return function(_0x33d71a){if(_0x33d71a){return _0x33d71a[_0x6225('0x22')](_0x5a5137)[_0x6225('0x23')](function(_0x4568c1){return _0x4568c1;});}return null;};}function removeEntity(_0x382194,_0x47abf2){return function(_0x7a4001){if(_0x7a4001){return _0x7a4001['destroy']()[_0x6225('0x23')](function(){var _0x2e1c0e=_0x7a4001[_0x6225('0x24')]({'plain':!![]});var _0xcbaebd=_0x6225('0x25');return db[_0x6225('0x26')][_0x6225('0x27')]({'where':{'type':_0xcbaebd,'resourceId':_0x2e1c0e['id']}})['then'](function(){return _0x7a4001;});})[_0x6225('0x23')](function(){_0x382194[_0x6225('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3277d9,_0x28ea8c){return function(_0x558c10){if(!_0x558c10){_0x3277d9['sendStatus'](0x194);}return _0x558c10;};}function handleError(_0x308c93,_0x21b172){_0x21b172=_0x21b172||0x1f4;return function(_0x4a8a4b){logger['error'](_0x4a8a4b['stack']);if(_0x4a8a4b[_0x6225('0x28')]){delete _0x4a8a4b[_0x6225('0x28')];}_0x308c93[_0x6225('0x19')](_0x21b172)[_0x6225('0x29')](_0x4a8a4b);};}exports[_0x6225('0x2a')]=function(_0x37e035,_0x14db3c){var _0x48304e={},_0x88b929={},_0x1e5cf6={'count':0x0,'rows':[]};var _0x28d9a4=_[_0x6225('0x2b')](db['SmsQueue'][_0x6225('0x2c')],function(_0x51738c){return{'name':_0x51738c[_0x6225('0x2d')],'type':_0x51738c[_0x6225('0x2e')][_0x6225('0x2f')]};});_0x88b929[_0x6225('0x30')]=_[_0x6225('0x2b')](_0x28d9a4,_0x6225('0x28'));_0x88b929[_0x6225('0x31')]=_[_0x6225('0x32')](_0x37e035[_0x6225('0x31')]);_0x88b929[_0x6225('0x33')]=_[_0x6225('0x34')](_0x88b929['model'],_0x88b929[_0x6225('0x31')]);_0x48304e[_0x6225('0x35')]=_['intersection'](_0x88b929[_0x6225('0x30')],qs['fields'](_0x37e035['query'][_0x6225('0x36')]));_0x48304e[_0x6225('0x35')]=_0x48304e[_0x6225('0x35')]['length']?_0x48304e['attributes']:_0x88b929['model'];if(!_0x37e035[_0x6225('0x31')][_0x6225('0x37')]('nolimit')){_0x48304e[_0x6225('0x1c')]=qs[_0x6225('0x1c')](_0x37e035[_0x6225('0x31')][_0x6225('0x1c')]);_0x48304e[_0x6225('0x1e')]=qs[_0x6225('0x1e')](_0x37e035['query']['offset']);}_0x48304e[_0x6225('0x38')]=qs['sort'](_0x37e035['query'][_0x6225('0x39')]);_0x48304e[_0x6225('0x3a')]=qs[_0x6225('0x33')](_[_0x6225('0x3b')](_0x37e035[_0x6225('0x31')],_0x88b929[_0x6225('0x33')]),_0x28d9a4);if(_0x37e035[_0x6225('0x31')][_0x6225('0x3c')]){_0x48304e['where']=_[_0x6225('0x3d')](_0x48304e[_0x6225('0x3a')],{'$or':_[_0x6225('0x2b')](_0x28d9a4,function(_0xbbd262){if(_0xbbd262[_0x6225('0x2e')]!==_0x6225('0x3e')){var _0x20e4b7={};_0x20e4b7[_0xbbd262[_0x6225('0x28')]]={'$like':'%'+_0x37e035['query'][_0x6225('0x3c')]+'%'};return _0x20e4b7;}})});}_0x48304e=_[_0x6225('0x3d')]({},_0x48304e,_0x37e035[_0x6225('0x3f')]);var _0x3ad0db={'where':_0x48304e[_0x6225('0x3a')]};return db[_0x6225('0x40')][_0x6225('0x1d')](_0x3ad0db)[_0x6225('0x23')](function(_0x43d28e){_0x1e5cf6[_0x6225('0x1d')]=_0x43d28e;if(_0x37e035[_0x6225('0x31')][_0x6225('0x41')]){_0x48304e[_0x6225('0x42')]=[{'all':!![]}];}return db['SmsQueue'][_0x6225('0x43')](_0x48304e);})[_0x6225('0x23')](function(_0x5afd87){_0x1e5cf6['rows']=_0x5afd87;return _0x1e5cf6;})[_0x6225('0x23')](respondWithFilteredResult(_0x14db3c,_0x48304e))[_0x6225('0x44')](handleError(_0x14db3c,null));};exports[_0x6225('0x45')]=function(_0x4b4cc3,_0x5abc35){var _0x40e239={'raw':!![],'where':{'id':_0x4b4cc3[_0x6225('0x46')]['id']}},_0xd3d77={};_0xd3d77[_0x6225('0x30')]=_[_0x6225('0x32')](db[_0x6225('0x40')]['rawAttributes']);_0xd3d77[_0x6225('0x31')]=_[_0x6225('0x32')](_0x4b4cc3[_0x6225('0x31')]);_0xd3d77[_0x6225('0x33')]=_['intersection'](_0xd3d77[_0x6225('0x30')],_0xd3d77[_0x6225('0x31')]);_0x40e239[_0x6225('0x35')]=_[_0x6225('0x34')](_0xd3d77[_0x6225('0x30')],qs[_0x6225('0x36')](_0x4b4cc3[_0x6225('0x31')]['fields']));_0x40e239[_0x6225('0x35')]=_0x40e239[_0x6225('0x35')][_0x6225('0x47')]?_0x40e239[_0x6225('0x35')]:_0xd3d77[_0x6225('0x30')];if(_0x4b4cc3[_0x6225('0x31')][_0x6225('0x41')]){_0x40e239[_0x6225('0x42')]=[{'all':!![]}];}_0x40e239=_[_0x6225('0x3d')]({},_0x40e239,_0x4b4cc3[_0x6225('0x3f')]);return db['SmsQueue']['find'](_0x40e239)[_0x6225('0x23')](handleEntityNotFound(_0x5abc35,null))['then'](respondWithResult(_0x5abc35,null))['catch'](handleError(_0x5abc35,null));};exports[_0x6225('0x48')]=function(_0x763bd1,_0x152165){return db['SmsQueue'][_0x6225('0x48')](_0x763bd1[_0x6225('0x49')],{})[_0x6225('0x23')](function(_0x18bf48){var _0x54e213=_0x763bd1[_0x6225('0x4a')][_0x6225('0x24')]({'plain':!![]});if(!_0x54e213)throw new Error(_0x6225('0x4b'));if(_0x54e213['role']===_0x6225('0x4a')){var _0x568a52=_0x18bf48['get']({'plain':!![]});var _0x37ed42=_0x6225('0x25');return db[_0x6225('0x4c')][_0x6225('0x4d')]({'where':{'name':_0x37ed42,'userProfileId':_0x54e213[_0x6225('0x4e')]},'raw':!![]})[_0x6225('0x23')](function(_0x4a29c6){if(_0x4a29c6&&_0x4a29c6[_0x6225('0x4f')]===0x0){return db['UserProfileResource'][_0x6225('0x48')]({'name':_0x568a52[_0x6225('0x28')],'resourceId':_0x568a52['id'],'type':_0x4a29c6[_0x6225('0x28')],'sectionId':_0x4a29c6['id']},{})[_0x6225('0x23')](function(){return _0x18bf48;});}else{return _0x18bf48;}})['catch'](function(_0x3d6a8f){logger[_0x6225('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d6a8f);throw _0x3d6a8f;});}return _0x18bf48;})[_0x6225('0x23')](respondWithResult(_0x152165,0xc9))[_0x6225('0x44')](handleError(_0x152165,null));};exports[_0x6225('0x22')]=function(_0x8b2df3,_0x42d653){if(_0x8b2df3[_0x6225('0x49')]['id']){delete _0x8b2df3[_0x6225('0x49')]['id'];}return db[_0x6225('0x40')]['find']({'where':{'id':_0x8b2df3['params']['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x42d653,null))[_0x6225('0x23')](saveUpdates(_0x8b2df3[_0x6225('0x49')],null))['then'](respondWithResult(_0x42d653,null))[_0x6225('0x44')](handleError(_0x42d653,null));};exports[_0x6225('0x27')]=function(_0x3071f9,_0x697b7d){return db[_0x6225('0x40')]['find']({'where':{'id':_0x3071f9['params']['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x697b7d,null))[_0x6225('0x23')](removeEntity(_0x697b7d,null))['catch'](handleError(_0x697b7d,null));};exports[_0x6225('0x51')]=function(_0x315dee,_0xeb98a0){return db[_0x6225('0x40')][_0x6225('0x51')]()[_0x6225('0x23')](respondWithResult(_0xeb98a0,null))[_0x6225('0x44')](handleError(_0xeb98a0,null));};exports['getMembers']=function(_0x1d4ba2,_0x3e75c6,_0x54ae89){var _0x27882a={'raw':!![],'where':{}},_0x285bcc={},_0x17cfcc;return db[_0x6225('0x40')][_0x6225('0x52')]({'where':{'id':_0x1d4ba2[_0x6225('0x46')]['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x3e75c6,null))[_0x6225('0x23')](function(_0x50b5b8){if(_0x50b5b8){_0x17cfcc=_0x50b5b8[_0x6225('0x24')]({'plain':!![]});_0x285bcc['model']=_['keys'](db[_0x6225('0x53')][_0x6225('0x2c')]);_0x285bcc['query']=_[_0x6225('0x32')](_0x1d4ba2[_0x6225('0x31')]);_0x285bcc['filters']=_[_0x6225('0x34')](_0x285bcc['model'],_0x285bcc['query']);_0x27882a[_0x6225('0x35')]=_[_0x6225('0x34')](_0x285bcc[_0x6225('0x30')],qs['fields'](_0x1d4ba2[_0x6225('0x31')]['fields']));_0x27882a[_0x6225('0x35')]=_0x27882a[_0x6225('0x35')][_0x6225('0x47')]?_0x27882a['attributes']:_0x285bcc['model'];if(!_0x1d4ba2[_0x6225('0x31')][_0x6225('0x37')](_0x6225('0x54'))){_0x27882a[_0x6225('0x1c')]=qs['limit'](_0x1d4ba2[_0x6225('0x31')][_0x6225('0x1c')]);_0x27882a[_0x6225('0x1e')]=qs[_0x6225('0x1e')](_0x1d4ba2[_0x6225('0x31')]['offset']);}_0x27882a[_0x6225('0x38')]=qs[_0x6225('0x39')](_0x1d4ba2[_0x6225('0x31')][_0x6225('0x39')]);_0x27882a[_0x6225('0x3a')]=qs['filters'](_['pick'](_0x1d4ba2[_0x6225('0x31')],_0x285bcc[_0x6225('0x33')]));_0x27882a['where'][_0x6225('0x55')]=_0x50b5b8['id'];if(_0x1d4ba2[_0x6225('0x31')][_0x6225('0x3c')]){_0x27882a[_0x6225('0x3a')]=_[_0x6225('0x3d')](_0x27882a[_0x6225('0x3a')],{'$or':_[_0x6225('0x2b')](_0x27882a[_0x6225('0x35')],function(_0x55b7fa){var _0x3dc077={};_0x3dc077[_0x55b7fa]={'$like':'%'+_0x1d4ba2[_0x6225('0x31')][_0x6225('0x3c')]+'%'};return _0x3dc077;})});}_0x27882a=_[_0x6225('0x3d')]({},_0x27882a,_0x1d4ba2[_0x6225('0x3f')]);return db[_0x6225('0x53')][_0x6225('0x43')](_0x27882a);}})[_0x6225('0x23')](function(_0x423701){if(_0x423701){return db[_0x6225('0x56')]['findAndCountAll']({'where':{'id':_[_0x6225('0x2b')](_0x423701,_0x6225('0x57')),'role':'agent'},'attributes':['id',_0x6225('0x28'),_0x6225('0x58'),_0x6225('0x59'),_0x6225('0x5a')]});}})['then'](function(_0x199e2c){if(_0x199e2c){return{'count':_0x199e2c['count'],'rows':_[_0x6225('0x2b')](_0x199e2c[_0x6225('0x5b')],function(_0x5a57c8){return{'membername':_0x5a57c8['name'],'UserId':_0x5a57c8['id'],'queue_name':_0x17cfcc[_0x6225('0x28')],'SmsQueueId':_0x17cfcc['id'],'interface':util[_0x6225('0x5c')](_0x6225('0x5d'),'SIP',_0x5a57c8[_0x6225('0x28')]),'penalty':0x0,'paused':_0x5a57c8[_0x6225('0x58')],'createdAt':_0x5a57c8['createdAt'],'updatedAt':_0x5a57c8[_0x6225('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3e75c6,_0x27882a))[_0x6225('0x44')](handleError(_0x3e75c6,null));};exports[_0x6225('0x5e')]=function(_0x16a0db,_0x14c8b2,_0x335ed8){var _0xddd86e={};var _0x156b09={};var _0x323b1b;var _0x11339c;return db[_0x6225('0x40')][_0x6225('0x52')]({'where':{'id':_0x16a0db[_0x6225('0x46')]['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x14c8b2,null))[_0x6225('0x23')](function(_0x472a55){if(_0x472a55){_0x323b1b=_0x472a55;_0x156b09[_0x6225('0x30')]=_[_0x6225('0x32')](db['Team']['rawAttributes']);_0x156b09[_0x6225('0x31')]=_['keys'](_0x16a0db[_0x6225('0x31')]);_0x156b09[_0x6225('0x33')]=_['intersection'](_0x156b09[_0x6225('0x30')],_0x156b09['query']);_0xddd86e[_0x6225('0x35')]=_[_0x6225('0x34')](_0x156b09[_0x6225('0x30')],qs['fields'](_0x16a0db['query']['fields']));_0xddd86e['attributes']=_0xddd86e[_0x6225('0x35')][_0x6225('0x47')]?_0xddd86e[_0x6225('0x35')]:_0x156b09[_0x6225('0x30')];_0xddd86e['order']=qs[_0x6225('0x39')](_0x16a0db[_0x6225('0x31')][_0x6225('0x39')]);_0xddd86e[_0x6225('0x3a')]=qs[_0x6225('0x33')](_[_0x6225('0x3b')](_0x16a0db[_0x6225('0x31')],_0x156b09['filters']));if(_0x16a0db[_0x6225('0x31')][_0x6225('0x3c')]){_0xddd86e[_0x6225('0x3a')]=_['merge'](_0xddd86e['where'],{'$or':_[_0x6225('0x2b')](_0xddd86e[_0x6225('0x35')],function(_0x1c9f38){var _0x1f05fe={};_0x1f05fe[_0x1c9f38]={'$like':'%'+_0x16a0db[_0x6225('0x31')][_0x6225('0x3c')]+'%'};return _0x1f05fe;})});}_0xddd86e=_[_0x6225('0x3d')]({},_0xddd86e,_0x16a0db['options']);return _0x323b1b[_0x6225('0x5e')](_0xddd86e);}})[_0x6225('0x23')](function(_0x4019dc){if(_0x4019dc){_0x11339c=_0x4019dc['length'];if(!_0x16a0db[_0x6225('0x31')][_0x6225('0x37')]('nolimit')){_0xddd86e[_0x6225('0x1c')]=qs[_0x6225('0x1c')](_0x16a0db[_0x6225('0x31')][_0x6225('0x1c')]);_0xddd86e[_0x6225('0x1e')]=qs[_0x6225('0x1e')](_0x16a0db[_0x6225('0x31')][_0x6225('0x1e')]);}return _0x323b1b[_0x6225('0x5e')](_0xddd86e);}})[_0x6225('0x23')](function(_0x5e7025){if(_0x5e7025){return _0x5e7025?{'count':_0x11339c,'rows':_0x5e7025}:null;}})[_0x6225('0x23')](respondWithResult(_0x14c8b2,null))[_0x6225('0x44')](handleError(_0x14c8b2,null));};exports[_0x6225('0x5f')]=function(_0x45fa44,_0x440ccf,_0x3765e7){var _0x7a7d58=_0x45fa44[_0x6225('0x49')][_0x6225('0x60')];return db['Team'][_0x6225('0x43')]({'where':{'id':_0x7a7d58},'attributes':['id'],'include':[{'model':db[_0x6225('0x56')],'as':_0x6225('0x61'),'attributes':['id',_0x6225('0x28'),_0x6225('0x62'),'voicePause',_0x6225('0x63')],'raw':!![]}]})[_0x6225('0x23')](function(_0x729dd8){if(_0x729dd8){var _0x58d0bc=_['flatMap'](_0x729dd8,function(_0x2a9b38){var _0x546828=_0x2a9b38[_0x6225('0x24')]({'plain':!![]});return _0x546828['Agents'];});return db[_0x6225('0x40')][_0x6225('0x4d')]({'where':{'id':_0x45fa44['params']['id']}})[_0x6225('0x23')](function(_0x5d5525){return db[_0x6225('0x64')][_0x6225('0x65')](function(_0x10f09c){return _0x5d5525[_0x6225('0x5f')](_0x7a7d58,{'transaction':_0x10f09c})[_0x6225('0x23')](function(){return BPromise[_0x6225('0x66')](_0x58d0bc,function(_0x1e7a33){return db[_0x6225('0x53')][_0x6225('0x67')]({'where':{'UserId':_0x1e7a33['id'],'SmsQueueId':_0x45fa44['params']['id']},'transaction':_0x10f09c});});})[_0x6225('0x23')](function(){_0x58d0bc['forEach'](function(_0x2a4ce4){socket[_0x6225('0x68')]('userSmsQueue:save',{'UserId':_0x2a4ce4['id'],'SmsQueueId':_0x5d5525['id']});});});});});}})['then'](respondWithStatusCode(_0x440ccf,null))[_0x6225('0x44')](handleError(_0x440ccf,null));};exports[_0x6225('0x69')]=function(_0x4a575a,_0x1084cf,_0x35bdd8){return db[_0x6225('0x6a')][_0x6225('0x43')]({'where':{'id':_0x4a575a[_0x6225('0x31')][_0x6225('0x60')]},'attributes':['id'],'include':[{'model':db[_0x6225('0x56')],'as':_0x6225('0x61'),'attributes':['id'],'raw':!![]}]})[_0x6225('0x23')](handleEntityNotFound(_0x1084cf,null))[_0x6225('0x23')](function(_0x254bca){var _0x38b05a=_[_0x6225('0x2b')](_0x254bca,'id');var _0x116f72=[];var _0x555911=[];var _0x47d45f=squel[_0x6225('0x6b')]();_0x47d45f[_0x6225('0x6c')]('tq.TeamId')[_0x6225('0x6d')](_0x6225('0x6e'),'tq')[_0x6225('0x6f')](_0x6225('0x70'),'ut',_0x6225('0x71'))[_0x6225('0x3a')](_0x6225('0x72'),_0x4a575a[_0x6225('0x46')]['id']);for(var _0x4b3f06=0x0;_0x4b3f06<_0x254bca[_0x6225('0x47')];_0x4b3f06+=0x1){let _0x41e50c=_0x254bca[_0x4b3f06];for(var _0x4b4732=0x0;_0x4b4732<_0x41e50c[_0x6225('0x61')]['length'];_0x4b4732+=0x1){let _0xc40712=_0x41e50c[_0x6225('0x61')][_0x4b4732];var _0x26f14e=_0x47d45f[_0x6225('0x73')]();_0x26f14e[_0x6225('0x3a')](_0x6225('0x74'),_0xc40712['id']);_0x555911[_0x6225('0x75')](db[_0x6225('0x64')][_0x6225('0x31')](_0x26f14e[_0x6225('0x76')](),{'type':db[_0x6225('0x64')][_0x6225('0x77')][_0x6225('0x78')]})['then'](function(_0x1e2c7){if(_0x1e2c7['length']===0x1){return _0xc40712['id'];}else{var _0xd6a811=_['every'](_[_0x6225('0x2b')](_0x1e2c7,'TeamId'),function(_0x5aaf6a){return _[_0x6225('0x79')](_0x38b05a,_0x5aaf6a);});if(_0xd6a811){return _0xc40712['id'];}}}));}}return BPromise[_0x6225('0x7a')](_0x555911)[_0x6225('0x23')](function(_0x2022b0){_0x116f72=_(_0x116f72)[_0x6225('0x7b')](_0x2022b0)[_0x6225('0x7c')]()[_0x6225('0x7d')]();return db[_0x6225('0x40')][_0x6225('0x4d')]({'where':{'id':_0x4a575a[_0x6225('0x46')]['id']}})[_0x6225('0x23')](function(_0x10b07d){return db[_0x6225('0x64')][_0x6225('0x65')](function(_0x37ab2f){return _0x10b07d['removeTeams'](_0x4a575a[_0x6225('0x31')][_0x6225('0x60')],{'transaction':_0x37ab2f})['then'](function(){if(!_[_0x6225('0x7e')](_0x116f72)){return _0x10b07d['removeAgents'](_0x116f72,{'transaction':_0x37ab2f});}})[_0x6225('0x23')](function(){_0x116f72[_0x6225('0x7f')](function(_0x2ccbab){socket[_0x6225('0x68')](_0x6225('0x80'),{'UserId':_0x2ccbab,'SmsQueueId':_0x10b07d['id']});});});});});});})['then'](respondWithStatusCode(_0x1084cf,null))[_0x6225('0x44')](handleError(_0x1084cf,null));};exports[_0x6225('0x81')]=function(_0x2b9c85,_0x600e16,_0xe21787){return db['SmsQueue']['find']({'where':{'id':_0x2b9c85[_0x6225('0x46')]['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x600e16,null))[_0x6225('0x23')](function(_0x2f37a5){if(_0x2f37a5){return _0x2f37a5['addAgents'](_0x2b9c85[_0x6225('0x49')][_0x6225('0x60')],_[_0x6225('0x82')](_0x2b9c85[_0x6225('0x49')],['ids','id'])||{})[_0x6225('0x83')](function(_0xfba5ab){for(var _0x455a3e=0x0;_0x455a3e<_0x2b9c85['body']['ids']['length'];_0x455a3e+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x2b9c85[_0x6225('0x49')]['ids'][_0x455a3e]),'SmsQueueId':Number(_0x2b9c85[_0x6225('0x46')]['id'])});}return _0xfba5ab;});}})[_0x6225('0x23')](respondWithResult(_0x600e16,null))[_0x6225('0x44')](handleError(_0x600e16,null));};exports[_0x6225('0x84')]=function(_0x1ccbf2,_0x27a483,_0xddd533){return db['SmsQueue'][_0x6225('0x4d')]({'where':{'id':_0x1ccbf2[_0x6225('0x46')]['id']}})[_0x6225('0x23')](handleEntityNotFound(_0x27a483,null))[_0x6225('0x23')](function(_0x5c840d){if(_0x5c840d){return _0x5c840d[_0x6225('0x84')](_0x1ccbf2[_0x6225('0x31')][_0x6225('0x60')])[_0x6225('0x23')](function(){if(_[_0x6225('0x85')](_0x1ccbf2[_0x6225('0x31')]['ids'])){for(var _0x2a62a2=0x0;_0x2a62a2<_0x1ccbf2['query'][_0x6225('0x60')][_0x6225('0x47')];_0x2a62a2+=0x1){socket[_0x6225('0x68')](_0x6225('0x80'),{'UserId':Number(_0x1ccbf2[_0x6225('0x31')]['ids'][_0x2a62a2]),'SmsQueueId':Number(_0x1ccbf2['params']['id'])});}}else{socket['emit'](_0x6225('0x80'),{'UserId':Number(_0x1ccbf2[_0x6225('0x31')][_0x6225('0x60')]),'SmsQueueId':Number(_0x1ccbf2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x27a483,null))[_0x6225('0x44')](handleError(_0x27a483,null));};exports[_0x6225('0x86')]=function(_0x355a2c,_0x9dfbff,_0x298bf3){var _0x1c4291={};var _0x3e9efe={};var _0x4bb385;var _0x365563;return db[_0x6225('0x40')][_0x6225('0x52')]({'where':{'id':_0x355a2c['params']['id']}})['then'](handleEntityNotFound(_0x9dfbff,null))[_0x6225('0x23')](function(_0x1c6fd8){if(_0x1c6fd8){_0x4bb385=_0x1c6fd8;_0x3e9efe['model']=_[_0x6225('0x32')](db[_0x6225('0x56')][_0x6225('0x2c')]);_0x3e9efe[_0x6225('0x31')]=_[_0x6225('0x32')](_0x355a2c[_0x6225('0x31')]);_0x3e9efe['filters']=_[_0x6225('0x34')](_0x3e9efe[_0x6225('0x30')],_0x3e9efe[_0x6225('0x31')]);_0x1c4291[_0x6225('0x35')]=_['intersection'](_0x3e9efe['model'],qs[_0x6225('0x36')](_0x355a2c[_0x6225('0x31')][_0x6225('0x36')]));_0x1c4291[_0x6225('0x35')]=_0x1c4291[_0x6225('0x35')][_0x6225('0x47')]?_0x1c4291[_0x6225('0x35')]:_0x3e9efe[_0x6225('0x30')];_0x1c4291[_0x6225('0x38')]=qs[_0x6225('0x39')](_0x355a2c[_0x6225('0x31')][_0x6225('0x39')]);_0x1c4291[_0x6225('0x3a')]=qs[_0x6225('0x33')](_['pick'](_0x355a2c[_0x6225('0x31')],_0x3e9efe[_0x6225('0x33')]));if(_0x355a2c[_0x6225('0x31')][_0x6225('0x3c')]){_0x1c4291[_0x6225('0x3a')]=_[_0x6225('0x3d')](_0x1c4291[_0x6225('0x3a')],{'$or':_[_0x6225('0x2b')](_0x1c4291[_0x6225('0x35')],function(_0x1b7e13){var _0xb3e92c={};_0xb3e92c[_0x1b7e13]={'$like':'%'+_0x355a2c[_0x6225('0x31')][_0x6225('0x3c')]+'%'};return _0xb3e92c;})});}_0x1c4291=_[_0x6225('0x3d')]({},_0x1c4291,_0x355a2c['options']);return _0x4bb385['getAgents'](_0x1c4291);}})[_0x6225('0x23')](function(_0x10adf0){if(_0x10adf0){_0x365563=_0x10adf0[_0x6225('0x47')];if(!_0x355a2c['query'][_0x6225('0x37')](_0x6225('0x54'))){_0x1c4291['limit']=qs[_0x6225('0x1c')](_0x355a2c['query'][_0x6225('0x1c')]);_0x1c4291['offset']=qs[_0x6225('0x1e')](_0x355a2c[_0x6225('0x31')][_0x6225('0x1e')]);}return _0x4bb385[_0x6225('0x86')](_0x1c4291);}})['then'](function(_0x49541a){if(_0x49541a){return _0x49541a?{'count':_0x365563,'rows':_0x49541a}:null;}})['then'](respondWithResult(_0x9dfbff,null))[_0x6225('0x44')](handleError(_0x9dfbff,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 819a3ac..6540559 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 _0xeea7=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x1b5c18,_0x20decb){var _0x44051f=function(_0x505bed){while(--_0x505bed){_0x1b5c18['push'](_0x1b5c18['shift']());}};_0x44051f(++_0x20decb);}(_0xeea7,0x1e2));var _0x7eea=function(_0x23f515,_0x1fdd13){_0x23f515=_0x23f515-0x0;var _0x585108=_0xeea7[_0x23f515];return _0x585108;};'use strict';var EventEmitter=require(_0x7eea('0x0'));var SmsQueue=require(_0x7eea('0x1'))['db'][_0x7eea('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7eea('0x3')](0x0);var events={'afterCreate':_0x7eea('0x4'),'afterUpdate':'update','afterDestroy':_0x7eea('0x5')};function emitEvent(_0x485f16){return function(_0x1b799b,_0x584802,_0x56eb68){SmsQueueEvents[_0x7eea('0x6')](_0x485f16+':'+_0x1b799b['id'],_0x1b799b);SmsQueueEvents['emit'](_0x485f16,_0x1b799b);_0x56eb68(null);};}for(var e in events){if(events[_0x7eea('0x7')](e)){var event=events[e];SmsQueue[_0x7eea('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xcffd=['events','../../mysqldb','SmsQueue','update','emit','hasOwnProperty','hook','exports'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0xcffd,0x188));var _0xdcff=function(_0x4864d8,_0x1712ce){_0x4864d8=_0x4864d8-0x0;var _0x11d959=_0xcffd[_0x4864d8];return _0x11d959;};'use strict';var EventEmitter=require(_0xdcff('0x0'));var SmsQueue=require(_0xdcff('0x1'))['db'][_0xdcff('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdcff('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e5af2){return function(_0x597b19,_0x32b8f7,_0x463dcd){SmsQueueEvents[_0xdcff('0x4')](_0x3e5af2+':'+_0x597b19['id'],_0x597b19);SmsQueueEvents['emit'](_0x3e5af2,_0x597b19);_0x463dcd(null);};}for(var e in events){if(events[_0xdcff('0x5')](e)){var event=events[e];SmsQueue[_0xdcff('0x6')](e,emitEvent(event));}}module[_0xdcff('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index afd4da6..5ec8d22 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 _0xbed5=['./smsQueue.attributes','exports','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1900ec,_0xa28139){var _0x243e7a=function(_0x54e976){while(--_0x54e976){_0x1900ec['push'](_0x1900ec['shift']());}};_0x243e7a(++_0xa28139);}(_0xbed5,0x1ef));var _0x5bed=function(_0x5ee60a,_0x58afd2){_0x5ee60a=_0x5ee60a-0x0;var _0x284323=_0xbed5[_0x5ee60a];return _0x284323;};'use strict';var _=require(_0x5bed('0x0'));var util=require(_0x5bed('0x1'));var logger=require(_0x5bed('0x2'))('api');var moment=require(_0x5bed('0x3'));var BPromise=require(_0x5bed('0x4'));var rp=require(_0x5bed('0x5'));var fs=require('fs');var path=require(_0x5bed('0x6'));var rimraf=require(_0x5bed('0x7'));var config=require(_0x5bed('0x8'));var attributes=require(_0x5bed('0x9'));module[_0x5bed('0xa')]=function(_0x5df3fd,_0x8f03c9){return _0x5df3fd['define']('SmsQueue',attributes,{'tableName':_0x5bed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9267=['sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue'];(function(_0x2fa16a,_0x5c2e84){var _0x12fe33=function(_0xe09191){while(--_0xe09191){_0x2fa16a['push'](_0x2fa16a['shift']());}};_0x12fe33(++_0x5c2e84);}(_0x9267,0x11f));var _0x7926=function(_0x4c2426,_0x5b05ac){_0x4c2426=_0x4c2426-0x0;var _0x10577b=_0x9267[_0x4c2426];return _0x10577b;};'use strict';var _=require(_0x7926('0x0'));var util=require(_0x7926('0x1'));var logger=require(_0x7926('0x2'))('api');var moment=require(_0x7926('0x3'));var BPromise=require(_0x7926('0x4'));var rp=require(_0x7926('0x5'));var fs=require('fs');var path=require(_0x7926('0x6'));var rimraf=require(_0x7926('0x7'));var config=require(_0x7926('0x8'));var attributes=require(_0x7926('0x9'));module[_0x7926('0xa')]=function(_0x10c8f2,_0x3e6843){return _0x10c8f2['define'](_0x7926('0xb'),attributes,{'tableName':_0x7926('0xc'),'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 3d10b1e..d086524 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 _0xfbdd=['where','attributes','include','map','model','catch','ShowSmsQueue','find','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbdd,0x19f));var _0xdfbd=function(_0x5d9783,_0xbcc684){_0x5d9783=_0x5d9783-0x0;var _0x20aa29=_0xfbdd[_0x5d9783];return _0x20aa29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdfbd('0x0'));var BPromise=require('bluebird');var rs=require(_0xdfbd('0x1'));var fs=require('fs');var Redis=require(_0xdfbd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfbd('0x3'));var logger=require(_0xdfbd('0x4'))(_0xdfbd('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdfbd('0x6')][_0xdfbd('0x7')]({'port':0x232a});config[_0xdfbd('0x8')]=_[_0xdfbd('0x9')](config[_0xdfbd('0x8')],{'host':_0xdfbd('0xa'),'port':0x18eb});var socket=require(_0xdfbd('0xb'))(new Redis(config[_0xdfbd('0x8')]));require(_0xdfbd('0xc'))['register'](socket);function respondWithRpcPromise(_0x5762c0,_0x33d520,_0x4343cc){return new BPromise(function(_0x527f29,_0x22cf99){return client[_0xdfbd('0xd')](_0x5762c0,_0x4343cc)[_0xdfbd('0xe')](function(_0x5a3ba4){logger[_0xdfbd('0xf')]('SmsQueue,\x20%s,\x20%s',_0x33d520,'request\x20sent');logger[_0xdfbd('0x10')](_0xdfbd('0x11'),_0x33d520,_0xdfbd('0x12'),JSON[_0xdfbd('0x13')](_0x5a3ba4));if(_0x5a3ba4['error']){if(_0x5a3ba4[_0xdfbd('0x14')][_0xdfbd('0x15')]===0x1f4){logger[_0xdfbd('0x14')](_0xdfbd('0x16'),_0x33d520,_0x5a3ba4[_0xdfbd('0x14')][_0xdfbd('0x17')]);return _0x22cf99(_0x5a3ba4[_0xdfbd('0x14')]['message']);}logger[_0xdfbd('0x14')](_0xdfbd('0x16'),_0x33d520,_0x5a3ba4[_0xdfbd('0x14')][_0xdfbd('0x17')]);return _0x527f29(_0x5a3ba4[_0xdfbd('0x14')][_0xdfbd('0x17')]);}else{logger[_0xdfbd('0xf')](_0xdfbd('0x16'),_0x33d520,_0xdfbd('0x12'));_0x527f29(_0x5a3ba4[_0xdfbd('0x18')][_0xdfbd('0x17')]);}})['catch'](function(_0x309e47){logger[_0xdfbd('0x14')](_0xdfbd('0x16'),_0x33d520,_0x309e47);_0x22cf99(_0x309e47);});});}exports[_0xdfbd('0x19')]=function(_0x21f10f){var _0x39fcf0=this;return new Promise(function(_0x26f962,_0x61ca17){return db[_0xdfbd('0x1a')][_0xdfbd('0x1b')]({'raw':_0x21f10f[_0xdfbd('0x1c')]?_0x21f10f[_0xdfbd('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x21f10f['options']?_0x21f10f['options'][_0xdfbd('0x1d')]||null:null,'attributes':_0x21f10f['options']?_0x21f10f['options'][_0xdfbd('0x1e')]||null:null,'limit':_0x21f10f[_0xdfbd('0x1c')]?_0x21f10f[_0xdfbd('0x1c')]['limit']||null:null,'include':_0x21f10f[_0xdfbd('0x1c')]?_0x21f10f['options'][_0xdfbd('0x1f')]?_[_0xdfbd('0x20')](_0x21f10f['options'][_0xdfbd('0x1f')],function(_0x1e478f){return{'model':db[_0x1e478f['model']],'as':_0x1e478f['as'],'attributes':_0x1e478f['attributes'],'include':_0x1e478f['include']?_[_0xdfbd('0x20')](_0x1e478f['include'],function(_0x33690c){return{'model':db[_0x33690c[_0xdfbd('0x21')]],'as':_0x33690c['as'],'attributes':_0x33690c[_0xdfbd('0x1e')],'include':_0x33690c['include']?_[_0xdfbd('0x20')](_0x33690c[_0xdfbd('0x1f')],function(_0x2b1f72){return{'model':db[_0x2b1f72[_0xdfbd('0x21')]],'as':_0x2b1f72['as'],'attributes':_0x2b1f72[_0xdfbd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdfbd('0xe')](function(_0x27f341){logger[_0xdfbd('0xf')](_0xdfbd('0x19'),_0x21f10f);logger[_0xdfbd('0x10')]('GetSmsQueue',_0x21f10f,JSON[_0xdfbd('0x13')](_0x27f341));_0x26f962(_0x27f341);})[_0xdfbd('0x22')](function(_0x701bc8){logger['error'](_0xdfbd('0x19'),_0x701bc8['message'],_0x21f10f);_0x61ca17(_0x39fcf0[_0xdfbd('0x14')](0x1f4,_0x701bc8['message']));});});};exports[_0xdfbd('0x23')]=function(_0x34ba6e){var _0x5ec335=this;return new Promise(function(_0x4e08a6,_0x168056){return db[_0xdfbd('0x1a')][_0xdfbd('0x24')]({'raw':_0x34ba6e['options']?_0x34ba6e[_0xdfbd('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x34ba6e[_0xdfbd('0x1c')]?_0x34ba6e[_0xdfbd('0x1c')][_0xdfbd('0x1d')]||null:null,'attributes':_0x34ba6e[_0xdfbd('0x1c')]?_0x34ba6e[_0xdfbd('0x1c')][_0xdfbd('0x1e')]||null:null,'include':_0x34ba6e[_0xdfbd('0x1c')]?_0x34ba6e[_0xdfbd('0x1c')][_0xdfbd('0x1f')]?_[_0xdfbd('0x20')](_0x34ba6e['options'][_0xdfbd('0x1f')],function(_0x2e164f){return{'model':db[_0x2e164f[_0xdfbd('0x21')]],'as':_0x2e164f['as'],'attributes':_0x2e164f[_0xdfbd('0x1e')],'include':_0x2e164f[_0xdfbd('0x1f')]?_['map'](_0x2e164f[_0xdfbd('0x1f')],function(_0x2547ac){return{'model':db[_0x2547ac[_0xdfbd('0x21')]],'as':_0x2547ac['as'],'attributes':_0x2547ac[_0xdfbd('0x1e')],'include':_0x2547ac['include']?_[_0xdfbd('0x20')](_0x2547ac['include'],function(_0xbc12f2){return{'model':db[_0xbc12f2['model']],'as':_0xbc12f2['as'],'attributes':_0xbc12f2[_0xdfbd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3757){logger[_0xdfbd('0xf')](_0xdfbd('0x23'),_0x34ba6e);logger[_0xdfbd('0x10')](_0xdfbd('0x23'),_0x34ba6e,JSON[_0xdfbd('0x13')](_0x2b3757));_0x4e08a6(_0x2b3757);})[_0xdfbd('0x22')](function(_0x4c20db){logger[_0xdfbd('0x14')](_0xdfbd('0x23'),_0x4c20db[_0xdfbd('0x17')],_0x34ba6e);_0x168056(_0x5ec335['error'](0x1f4,_0x4c20db[_0xdfbd('0x17')]));});});}; \ No newline at end of file +var _0x65bb=['SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','map','attributes','include','model','stringify','find','then','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49488f,_0x2629b8){var _0x4da9a6=function(_0x195969){while(--_0x195969){_0x49488f['push'](_0x49488f['shift']());}};_0x4da9a6(++_0x2629b8);}(_0x65bb,0x1b7));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb65b('0x0'));var util=require(_0xb65b('0x1'));var moment=require(_0xb65b('0x2'));var BPromise=require(_0xb65b('0x3'));var rs=require(_0xb65b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65b('0x5'))['db'];var utils=require(_0xb65b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xb65b('0x7'));var jayson=require(_0xb65b('0x8'));var client=jayson[_0xb65b('0x9')][_0xb65b('0xa')]({'port':0x232a});config['redis']=_[_0xb65b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb65b('0xc')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x44e09e,_0x24b03f,_0xcf0258){return new BPromise(function(_0x597cda,_0x51ef10){return client['request'](_0x44e09e,_0xcf0258)['then'](function(_0x4f07d0){logger[_0xb65b('0xd')](_0xb65b('0xe'),_0x24b03f,_0xb65b('0xf'));logger[_0xb65b('0x10')](_0xb65b('0x11'),_0x24b03f,_0xb65b('0xf'),JSON['stringify'](_0x4f07d0));if(_0x4f07d0[_0xb65b('0x12')]){if(_0x4f07d0[_0xb65b('0x12')][_0xb65b('0x13')]===0x1f4){logger[_0xb65b('0x12')](_0xb65b('0xe'),_0x24b03f,_0x4f07d0[_0xb65b('0x12')][_0xb65b('0x14')]);return _0x51ef10(_0x4f07d0[_0xb65b('0x12')][_0xb65b('0x14')]);}logger[_0xb65b('0x12')](_0xb65b('0xe'),_0x24b03f,_0x4f07d0[_0xb65b('0x12')][_0xb65b('0x14')]);return _0x597cda(_0x4f07d0[_0xb65b('0x12')]['message']);}else{logger[_0xb65b('0xd')](_0xb65b('0xe'),_0x24b03f,_0xb65b('0xf'));_0x597cda(_0x4f07d0[_0xb65b('0x15')][_0xb65b('0x14')]);}})[_0xb65b('0x16')](function(_0x297dc2){logger[_0xb65b('0x12')](_0xb65b('0xe'),_0x24b03f,_0x297dc2);_0x51ef10(_0x297dc2);});});}exports[_0xb65b('0x17')]=function(_0x1f2e3f){var _0x526c5b=this;return new Promise(function(_0x129db6,_0x23a6f7){return db[_0xb65b('0x18')][_0xb65b('0x19')]({'raw':_0x1f2e3f[_0xb65b('0x1a')]?_0x1f2e3f[_0xb65b('0x1a')][_0xb65b('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f2e3f[_0xb65b('0x1a')]?_0x1f2e3f[_0xb65b('0x1a')][_0xb65b('0x1c')]||null:null,'attributes':_0x1f2e3f[_0xb65b('0x1a')]?_0x1f2e3f['options']['attributes']||null:null,'limit':_0x1f2e3f[_0xb65b('0x1a')]?_0x1f2e3f[_0xb65b('0x1a')][_0xb65b('0x1d')]||null:null,'include':_0x1f2e3f[_0xb65b('0x1a')]?_0x1f2e3f[_0xb65b('0x1a')]['include']?_[_0xb65b('0x1e')](_0x1f2e3f[_0xb65b('0x1a')]['include'],function(_0x381212){return{'model':db[_0x381212['model']],'as':_0x381212['as'],'attributes':_0x381212[_0xb65b('0x1f')],'include':_0x381212[_0xb65b('0x20')]?_['map'](_0x381212[_0xb65b('0x20')],function(_0x25fa74){return{'model':db[_0x25fa74[_0xb65b('0x21')]],'as':_0x25fa74['as'],'attributes':_0x25fa74['attributes'],'include':_0x25fa74['include']?_[_0xb65b('0x1e')](_0x25fa74[_0xb65b('0x20')],function(_0x4f1115){return{'model':db[_0x4f1115[_0xb65b('0x21')]],'as':_0x4f1115['as'],'attributes':_0x4f1115[_0xb65b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4651b0){logger['info'](_0xb65b('0x17'),_0x1f2e3f);logger['debug']('GetSmsQueue',_0x1f2e3f,JSON[_0xb65b('0x22')](_0x4651b0));_0x129db6(_0x4651b0);})['catch'](function(_0x15c3cb){logger[_0xb65b('0x12')](_0xb65b('0x17'),_0x15c3cb[_0xb65b('0x14')],_0x1f2e3f);_0x23a6f7(_0x526c5b[_0xb65b('0x12')](0x1f4,_0x15c3cb[_0xb65b('0x14')]));});});};exports['ShowSmsQueue']=function(_0x559608){var _0xfd3806=this;return new Promise(function(_0x2ec806,_0x5126b6){return db[_0xb65b('0x18')][_0xb65b('0x23')]({'raw':_0x559608[_0xb65b('0x1a')]?_0x559608[_0xb65b('0x1a')][_0xb65b('0x1b')]===undefined?!![]:![]:!![],'where':_0x559608[_0xb65b('0x1a')]?_0x559608[_0xb65b('0x1a')]['where']||null:null,'attributes':_0x559608['options']?_0x559608['options']['attributes']||null:null,'include':_0x559608[_0xb65b('0x1a')]?_0x559608[_0xb65b('0x1a')][_0xb65b('0x20')]?_[_0xb65b('0x1e')](_0x559608[_0xb65b('0x1a')][_0xb65b('0x20')],function(_0x16836b){return{'model':db[_0x16836b[_0xb65b('0x21')]],'as':_0x16836b['as'],'attributes':_0x16836b['attributes'],'include':_0x16836b[_0xb65b('0x20')]?_[_0xb65b('0x1e')](_0x16836b['include'],function(_0x4038ad){return{'model':db[_0x4038ad[_0xb65b('0x21')]],'as':_0x4038ad['as'],'attributes':_0x4038ad[_0xb65b('0x1f')],'include':_0x4038ad[_0xb65b('0x20')]?_[_0xb65b('0x1e')](_0x4038ad[_0xb65b('0x20')],function(_0x6cdee9){return{'model':db[_0x6cdee9[_0xb65b('0x21')]],'as':_0x6cdee9['as'],'attributes':_0x6cdee9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb65b('0x24')](function(_0x5d9222){logger[_0xb65b('0xd')](_0xb65b('0x25'),_0x559608);logger['debug'](_0xb65b('0x25'),_0x559608,JSON['stringify'](_0x5d9222));_0x2ec806(_0x5d9222);})[_0xb65b('0x16')](function(_0x91a0bb){logger[_0xb65b('0x12')](_0xb65b('0x25'),_0x91a0bb['message'],_0x559608);_0x5126b6(_0xfd3806['error'](0x1f4,_0x91a0bb[_0xb65b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 2c418d2..b180b2d 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 _0x2226=['./smsQueue.events','save','update','emit','length','smsQueue:'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x2226,0x1f2));var _0x6222=function(_0x8343ba,_0x217a01){_0x8343ba=_0x8343ba-0x0;var _0x3b10ff=_0x2226[_0x8343ba];return _0x3b10ff;};'use strict';var SmsQueueEvents=require(_0x6222('0x0'));var events=[_0x6222('0x1'),'remove',_0x6222('0x2')];function createListener(_0x250326,_0x18ec5e){return function(_0x27d12d){_0x18ec5e[_0x6222('0x3')](_0x250326,_0x27d12d);};}function removeListener(_0x33e62a,_0x54f575){return function(){SmsQueueEvents['removeListener'](_0x33e62a,_0x54f575);};}exports['register']=function(_0x52487a){for(var _0x3d3521=0x0,_0x4a5c47=events[_0x6222('0x4')];_0x3d3521<_0x4a5c47;_0x3d3521++){var _0x12fa19=events[_0x3d3521];var _0x3f3cbb=createListener(_0x6222('0x5')+_0x12fa19,_0x52487a);SmsQueueEvents['on'](_0x12fa19,_0x3f3cbb);}}; \ No newline at end of file +var _0x0f7e=['remove','update','length','smsQueue:','./smsQueue.events','save'];(function(_0x1eb131,_0x1b69c9){var _0x2b3794=function(_0x421dfa){while(--_0x421dfa){_0x1eb131['push'](_0x1eb131['shift']());}};_0x2b3794(++_0x1b69c9);}(_0x0f7e,0x1ea));var _0xe0f7=function(_0x3a9c1c,_0x4c1ef3){_0x3a9c1c=_0x3a9c1c-0x0;var _0x3467e8=_0x0f7e[_0x3a9c1c];return _0x3467e8;};'use strict';var SmsQueueEvents=require(_0xe0f7('0x0'));var events=[_0xe0f7('0x1'),_0xe0f7('0x2'),_0xe0f7('0x3')];function createListener(_0x11be49,_0x237b21){return function(_0x5cac5e){_0x237b21['emit'](_0x11be49,_0x5cac5e);};}function removeListener(_0x30317d,_0x3f8b36){return function(){SmsQueueEvents['removeListener'](_0x30317d,_0x3f8b36);};}exports['register']=function(_0x40507c){for(var _0x5492b7=0x0,_0x1486a6=events[_0xe0f7('0x4')];_0x5492b7<_0x1486a6;_0x5492b7++){var _0x46d892=events[_0x5492b7];var _0x267d73=createListener(_0xe0f7('0x5')+_0x46d892,_0x40507c);SmsQueueEvents['on'](_0x46d892,_0x267d73);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 4f63978..f8bf693 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 _0xdbb3=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x2be240,_0x1e119d){var _0x123543=function(_0x580bf4){while(--_0x580bf4){_0x2be240['push'](_0x2be240['shift']());}};_0x123543(++_0x1e119d);}(_0xdbb3,0x1c2));var _0x3dbb=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xdbb3[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var path=require(_0x3dbb('0x2'));var timeout=require(_0x3dbb('0x3'));var express=require(_0x3dbb('0x4'));var router=express['Router']();var fs_extra=require(_0x3dbb('0x5'));var auth=require(_0x3dbb('0x6'));var interaction=require(_0x3dbb('0x7'));var config=require('../../config/environment');var controller=require(_0x3dbb('0x8'));router[_0x3dbb('0x9')]('/',auth[_0x3dbb('0xa')](),controller['index']);router[_0x3dbb('0x9')](_0x3dbb('0xb'),auth['isAuthenticated'](),controller[_0x3dbb('0xc')]);router['get'](_0x3dbb('0xd'),auth[_0x3dbb('0xa')](),controller[_0x3dbb('0xe')]);router[_0x3dbb('0xf')]('/',auth['isAuthenticated'](),controller[_0x3dbb('0x10')]);router[_0x3dbb('0x11')](_0x3dbb('0xd'),auth[_0x3dbb('0xa')](),controller[_0x3dbb('0x12')]);router['delete'](_0x3dbb('0xd'),auth[_0x3dbb('0xa')](),controller['destroy']);module[_0x3dbb('0x13')]=router; \ No newline at end of file +var _0x41f2=['../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5d8987,_0x14d054){var _0x2997eb=function(_0x56f92a){while(--_0x56f92a){_0x5d8987['push'](_0x5d8987['shift']());}};_0x2997eb(++_0x14d054);}(_0x41f2,0x14f));var _0x241f=function(_0xbd8fd,_0x32147f){_0xbd8fd=_0xbd8fd-0x0;var _0x41e5a5=_0x41f2[_0xbd8fd];return _0x41e5a5;};'use strict';var multer=require(_0x241f('0x0'));var util=require(_0x241f('0x1'));var path=require('path');var timeout=require(_0x241f('0x2'));var express=require(_0x241f('0x3'));var router=express[_0x241f('0x4')]();var fs_extra=require(_0x241f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x241f('0x6'));var config=require(_0x241f('0x7'));var controller=require('./smsQueueReport.controller');router[_0x241f('0x8')]('/',auth[_0x241f('0x9')](),controller[_0x241f('0xa')]);router[_0x241f('0x8')](_0x241f('0xb'),auth['isAuthenticated'](),controller[_0x241f('0xc')]);router[_0x241f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x241f('0xd')]('/',auth['isAuthenticated'](),controller[_0x241f('0xe')]);router[_0x241f('0xf')](_0x241f('0x10'),auth['isAuthenticated'](),controller[_0x241f('0x11')]);router['delete'](_0x241f('0x10'),auth[_0x241f('0x9')](),controller[_0x241f('0x12')]);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 1b4771e..07a2c73 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 _0x9ff9=['DATE','sequelize','STRING'];(function(_0x439633,_0x25eee7){var _0x1c4d83=function(_0x399b06){while(--_0x399b06){_0x439633['push'](_0x439633['shift']());}};_0x1c4d83(++_0x25eee7);}(_0x9ff9,0x1c3));var _0x99ff=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x9ff9[_0x3b5250];return _0xc844a1;};'use strict';var moment=require('moment');var Sequelize=require(_0x99ff('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x99ff('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x99ff('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x99ff('0x2')]},'acceptAt':{'type':Sequelize[_0x99ff('0x2')]},'exitAt':{'type':Sequelize[_0x99ff('0x2')]},'reason':{'type':Sequelize[_0x99ff('0x1')]}}; \ No newline at end of file +var _0x6817=['DATE','moment','exports','STRING'];(function(_0x941d46,_0x4bfe5f){var _0x1f11f9=function(_0x3062ca){while(--_0x3062ca){_0x941d46['push'](_0x941d46['shift']());}};_0x1f11f9(++_0x4bfe5f);}(_0x6817,0x1f1));var _0x7681=function(_0x214ec4,_0xcb79a2){_0x214ec4=_0x214ec4-0x0;var _0x2b0b5e=_0x6817[_0x214ec4];return _0x2b0b5e;};'use strict';var moment=require(_0x7681('0x0'));var Sequelize=require('sequelize');module[_0x7681('0x1')]={'uniqueid':{'type':Sequelize[_0x7681('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7681('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7681('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7681('0x3')]},'reason':{'type':Sequelize[_0x7681('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 95881a9..29b451a 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 _0x458d=['../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x340923,_0x5fc3f5){var _0x50a222=function(_0x5354e1){while(--_0x5354e1){_0x340923['push'](_0x340923['shift']());}};_0x50a222(++_0x5fc3f5);}(_0x458d,0xc3));var _0xd458=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x458d[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd458('0x0'));var jsonpatch=require(_0xd458('0x1'));var rp=require(_0xd458('0x2'));var moment=require('moment');var BPromise=require(_0xd458('0x3'));var Mustache=require(_0xd458('0x4'));var util=require('util');var path=require(_0xd458('0x5'));var sox=require(_0xd458('0x6'));var csv=require(_0xd458('0x7'));var ejs=require(_0xd458('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd458('0x9'));var squel=require(_0xd458('0xa'));var crypto=require(_0xd458('0xb'));var jsforce=require(_0xd458('0xc'));var deskjs=require(_0xd458('0xd'));var toCsv=require(_0xd458('0x7'));var querystring=require(_0xd458('0xe'));var Papa=require('papaparse');var Redis=require(_0xd458('0xf'));var authService=require(_0xd458('0x10'));var qs=require(_0xd458('0x11'));var as=require(_0xd458('0x12'));var hardwareService=require(_0xd458('0x13'));var logger=require(_0xd458('0x14'))(_0xd458('0x15'));var utils=require(_0xd458('0x16'));var config=require(_0xd458('0x17'));var licenseUtil=require(_0xd458('0x18'));var db=require(_0xd458('0x19'))['db'];function respondWithStatusCode(_0x46ee07,_0xd0f1ff){_0xd0f1ff=_0xd0f1ff||0xcc;return function(_0x18938c){if(_0x18938c){return _0x46ee07['sendStatus'](_0xd0f1ff);}return _0x46ee07[_0xd458('0x1a')](_0xd0f1ff)[_0xd458('0x1b')]();};}function respondWithResult(_0x32f0e6,_0x4aa466){_0x4aa466=_0x4aa466||0xc8;return function(_0x49ddc7){if(_0x49ddc7){return _0x32f0e6[_0xd458('0x1a')](_0x4aa466)['json'](_0x49ddc7);}};}function respondWithFilteredResult(_0x2fedd6,_0x4987e7){return function(_0x37cf87){if(_0x37cf87){var _0x4386cb=typeof _0x4987e7[_0xd458('0x1c')]===_0xd458('0x1d')&&typeof _0x4987e7[_0xd458('0x1e')]===_0xd458('0x1d');var _0x390721=_0x37cf87[_0xd458('0x1f')];var _0x3a0c96=_0x4386cb?0x0:_0x4987e7[_0xd458('0x1c')];var _0x3904c4=_0x4386cb?_0x37cf87[_0xd458('0x1f')]:_0x4987e7[_0xd458('0x1c')]+_0x4987e7[_0xd458('0x1e')];var _0x291f51;if(_0x3904c4>=_0x390721){_0x3904c4=_0x390721;_0x291f51=0xc8;}else{_0x291f51=0xce;}_0x2fedd6[_0xd458('0x1a')](_0x291f51);return _0x2fedd6['set'](_0xd458('0x20'),_0x3a0c96+'-'+_0x3904c4+'/'+_0x390721)[_0xd458('0x21')](_0x37cf87);}return null;};}function patchUpdates(_0x265583){return function(_0x5413ab){try{jsonpatch[_0xd458('0x22')](_0x5413ab,_0x265583,!![]);}catch(_0x2e6371){return BPromise[_0xd458('0x23')](_0x2e6371);}return _0x5413ab['save']();};}function saveUpdates(_0x3490ab,_0x581efe){return function(_0x25db60){if(_0x25db60){return _0x25db60[_0xd458('0x24')](_0x3490ab)[_0xd458('0x25')](function(_0x358101){return _0x358101;});}return null;};}function removeEntity(_0x34cb12,_0x41ede5){return function(_0x3e91ea){if(_0x3e91ea){return _0x3e91ea['destroy']()[_0xd458('0x25')](function(){_0x34cb12[_0xd458('0x1a')](0xcc)[_0xd458('0x1b')]();});}};}function handleEntityNotFound(_0x3e40fd,_0x2307c4){return function(_0x5d0ccd){if(!_0x5d0ccd){_0x3e40fd[_0xd458('0x26')](0x194);}return _0x5d0ccd;};}function handleError(_0x15e4ac,_0x582ccc){_0x582ccc=_0x582ccc||0x1f4;return function(_0x237fdb){logger[_0xd458('0x27')](_0x237fdb[_0xd458('0x28')]);if(_0x237fdb[_0xd458('0x29')]){delete _0x237fdb[_0xd458('0x29')];}_0x15e4ac[_0xd458('0x1a')](_0x582ccc)[_0xd458('0x2a')](_0x237fdb);};}exports[_0xd458('0x2b')]=function(_0xd69ba9,_0x4737b1){var _0x28d30e={},_0x21f32c={},_0x4871e9={'count':0x0,'rows':[]};var _0x351019=_[_0xd458('0x2c')](db[_0xd458('0x2d')][_0xd458('0x2e')],function(_0x266b9b){return{'name':_0x266b9b['fieldName'],'type':_0x266b9b['type'][_0xd458('0x2f')]};});_0x21f32c[_0xd458('0x30')]=_['map'](_0x351019,_0xd458('0x29'));_0x21f32c['query']=_['keys'](_0xd69ba9[_0xd458('0x31')]);_0x21f32c[_0xd458('0x32')]=_[_0xd458('0x33')](_0x21f32c[_0xd458('0x30')],_0x21f32c['query']);_0x28d30e[_0xd458('0x34')]=_['intersection'](_0x21f32c[_0xd458('0x30')],qs[_0xd458('0x35')](_0xd69ba9[_0xd458('0x31')][_0xd458('0x35')]));_0x28d30e['attributes']=_0x28d30e[_0xd458('0x34')][_0xd458('0x36')]?_0x28d30e['attributes']:_0x21f32c['model'];if(!_0xd69ba9[_0xd458('0x31')]['hasOwnProperty']('nolimit')){_0x28d30e[_0xd458('0x1e')]=qs[_0xd458('0x1e')](_0xd69ba9[_0xd458('0x31')]['limit']);_0x28d30e[_0xd458('0x1c')]=qs[_0xd458('0x1c')](_0xd69ba9[_0xd458('0x31')][_0xd458('0x1c')]);}_0x28d30e[_0xd458('0x37')]=qs[_0xd458('0x38')](_0xd69ba9[_0xd458('0x31')][_0xd458('0x38')]);_0x28d30e[_0xd458('0x39')]=qs[_0xd458('0x32')](_[_0xd458('0x3a')](_0xd69ba9[_0xd458('0x31')],_0x21f32c[_0xd458('0x32')]),_0x351019);if(_0xd69ba9[_0xd458('0x31')][_0xd458('0x3b')]){_0x28d30e[_0xd458('0x39')]=_[_0xd458('0x3c')](_0x28d30e['where'],{'$or':_[_0xd458('0x2c')](_0x351019,function(_0x16b00d){if(_0x16b00d['type']!==_0xd458('0x3d')){var _0x454fc0={};_0x454fc0[_0x16b00d[_0xd458('0x29')]]={'$like':'%'+_0xd69ba9['query'][_0xd458('0x3b')]+'%'};return _0x454fc0;}})});}_0x28d30e=_[_0xd458('0x3c')]({},_0x28d30e,_0xd69ba9[_0xd458('0x3e')]);var _0x5c319a={'where':_0x28d30e['where']};return db[_0xd458('0x2d')][_0xd458('0x1f')](_0x5c319a)[_0xd458('0x25')](function(_0x155d90){_0x4871e9[_0xd458('0x1f')]=_0x155d90;if(_0xd69ba9[_0xd458('0x31')][_0xd458('0x3f')]){_0x28d30e[_0xd458('0x40')]=[{'all':!![]}];}return db[_0xd458('0x2d')]['findAll'](_0x28d30e);})[_0xd458('0x25')](function(_0x27b351){_0x4871e9[_0xd458('0x41')]=_0x27b351;return _0x4871e9;})['then'](respondWithFilteredResult(_0x4737b1,_0x28d30e))[_0xd458('0x42')](handleError(_0x4737b1,null));};exports['show']=function(_0xe8ef92,_0x5930de){var _0x3fea88={'raw':!![],'where':{'id':_0xe8ef92['params']['id']}},_0x2791a1={};_0x2791a1[_0xd458('0x30')]=_[_0xd458('0x43')](db['SmsQueueReport'][_0xd458('0x2e')]);_0x2791a1[_0xd458('0x31')]=_[_0xd458('0x43')](_0xe8ef92[_0xd458('0x31')]);_0x2791a1['filters']=_['intersection'](_0x2791a1[_0xd458('0x30')],_0x2791a1[_0xd458('0x31')]);_0x3fea88['attributes']=_[_0xd458('0x33')](_0x2791a1[_0xd458('0x30')],qs[_0xd458('0x35')](_0xe8ef92[_0xd458('0x31')][_0xd458('0x35')]));_0x3fea88[_0xd458('0x34')]=_0x3fea88['attributes']['length']?_0x3fea88['attributes']:_0x2791a1[_0xd458('0x30')];if(_0xe8ef92[_0xd458('0x31')]['includeAll']){_0x3fea88['include']=[{'all':!![]}];}_0x3fea88=_[_0xd458('0x3c')]({},_0x3fea88,_0xe8ef92[_0xd458('0x3e')]);return db[_0xd458('0x2d')][_0xd458('0x44')](_0x3fea88)[_0xd458('0x25')](handleEntityNotFound(_0x5930de,null))['then'](respondWithResult(_0x5930de,null))[_0xd458('0x42')](handleError(_0x5930de,null));};exports[_0xd458('0x45')]=function(_0x596558,_0x2cd540){return db['SmsQueueReport'][_0xd458('0x45')](_0x596558['body'],{})['then'](respondWithResult(_0x2cd540,0xc9))[_0xd458('0x42')](handleError(_0x2cd540,null));};exports['update']=function(_0x426323,_0x1c5704){if(_0x426323['body']['id']){delete _0x426323[_0xd458('0x46')]['id'];}return db[_0xd458('0x2d')][_0xd458('0x44')]({'where':{'id':_0x426323[_0xd458('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c5704,null))[_0xd458('0x25')](saveUpdates(_0x426323['body'],null))[_0xd458('0x25')](respondWithResult(_0x1c5704,null))[_0xd458('0x42')](handleError(_0x1c5704,null));};exports['destroy']=function(_0x42dafd,_0x1474fe){return db['SmsQueueReport'][_0xd458('0x44')]({'where':{'id':_0x42dafd[_0xd458('0x47')]['id']}})[_0xd458('0x25')](handleEntityNotFound(_0x1474fe,null))[_0xd458('0x25')](removeEntity(_0x1474fe,null))[_0xd458('0x42')](handleError(_0x1474fe,null));};exports['describe']=function(_0x5a9f4c,_0x327267){return db['SmsQueueReport'][_0xd458('0x48')]()[_0xd458('0x25')](respondWithResult(_0x327267,null))[_0xd458('0x42')](handleError(_0x327267,null));}; \ No newline at end of file +var _0xc738=['sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x25eaa9,_0x1f7109){var _0x4d7c19=function(_0x3b7910){while(--_0x3b7910){_0x25eaa9['push'](_0x25eaa9['shift']());}};_0x4d7c19(++_0x1f7109);}(_0xc738,0x11e));var _0x8c73=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0xc738[_0xa9a245];return _0x2d0eaa;};'use strict';var emlformat=require(_0x8c73('0x0'));var rimraf=require(_0x8c73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c73('0x2'));var moment=require(_0x8c73('0x3'));var BPromise=require(_0x8c73('0x4'));var Mustache=require(_0x8c73('0x5'));var util=require(_0x8c73('0x6'));var path=require(_0x8c73('0x7'));var sox=require(_0x8c73('0x8'));var csv=require('to-csv');var ejs=require(_0x8c73('0x9'));var fs=require('fs');var fs_extra=require(_0x8c73('0xa'));var _=require(_0x8c73('0xb'));var squel=require(_0x8c73('0xc'));var crypto=require(_0x8c73('0xd'));var jsforce=require(_0x8c73('0xe'));var deskjs=require(_0x8c73('0xf'));var toCsv=require(_0x8c73('0x10'));var querystring=require(_0x8c73('0x11'));var Papa=require(_0x8c73('0x12'));var Redis=require(_0x8c73('0x13'));var authService=require(_0x8c73('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8c73('0x15'));var hardwareService=require(_0x8c73('0x16'));var logger=require(_0x8c73('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x8c73('0x18'));var licenseUtil=require(_0x8c73('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b97ad,_0x47dbff){_0x47dbff=_0x47dbff||0xcc;return function(_0x3aa5ae){if(_0x3aa5ae){return _0x1b97ad[_0x8c73('0x1a')](_0x47dbff);}return _0x1b97ad[_0x8c73('0x1b')](_0x47dbff)['end']();};}function respondWithResult(_0x2fcae7,_0x5e5386){_0x5e5386=_0x5e5386||0xc8;return function(_0x3869dc){if(_0x3869dc){return _0x2fcae7[_0x8c73('0x1b')](_0x5e5386)['json'](_0x3869dc);}};}function respondWithFilteredResult(_0x4b6431,_0xcf1712){return function(_0x4c5461){if(_0x4c5461){var _0x1e4e4c=typeof _0xcf1712[_0x8c73('0x1c')]===_0x8c73('0x1d')&&typeof _0xcf1712[_0x8c73('0x1e')]===_0x8c73('0x1d');var _0x49652a=_0x4c5461[_0x8c73('0x1f')];var _0x3a3c33=_0x1e4e4c?0x0:_0xcf1712[_0x8c73('0x1c')];var _0x1db35a=_0x1e4e4c?_0x4c5461['count']:_0xcf1712[_0x8c73('0x1c')]+_0xcf1712[_0x8c73('0x1e')];var _0x3e455d;if(_0x1db35a>=_0x49652a){_0x1db35a=_0x49652a;_0x3e455d=0xc8;}else{_0x3e455d=0xce;}_0x4b6431[_0x8c73('0x1b')](_0x3e455d);return _0x4b6431[_0x8c73('0x20')](_0x8c73('0x21'),_0x3a3c33+'-'+_0x1db35a+'/'+_0x49652a)['json'](_0x4c5461);}return null;};}function patchUpdates(_0x520229){return function(_0x3f514b){try{jsonpatch[_0x8c73('0x22')](_0x3f514b,_0x520229,!![]);}catch(_0x1806bb){return BPromise[_0x8c73('0x23')](_0x1806bb);}return _0x3f514b['save']();};}function saveUpdates(_0x2060a3,_0x291523){return function(_0x1f0944){if(_0x1f0944){return _0x1f0944['update'](_0x2060a3)[_0x8c73('0x24')](function(_0x50d3a6){return _0x50d3a6;});}return null;};}function removeEntity(_0x34335e,_0x4102c4){return function(_0x715322){if(_0x715322){return _0x715322[_0x8c73('0x25')]()[_0x8c73('0x24')](function(){_0x34335e[_0x8c73('0x1b')](0xcc)[_0x8c73('0x26')]();});}};}function handleEntityNotFound(_0x5c7126,_0x3ce9a7){return function(_0x3cf586){if(!_0x3cf586){_0x5c7126[_0x8c73('0x1a')](0x194);}return _0x3cf586;};}function handleError(_0x4696e0,_0x29a2e7){_0x29a2e7=_0x29a2e7||0x1f4;return function(_0x3f2641){logger[_0x8c73('0x27')](_0x3f2641[_0x8c73('0x28')]);if(_0x3f2641[_0x8c73('0x29')]){delete _0x3f2641[_0x8c73('0x29')];}_0x4696e0['status'](_0x29a2e7)[_0x8c73('0x2a')](_0x3f2641);};}exports[_0x8c73('0x2b')]=function(_0xa67429,_0x2df099){var _0x3c18d6={},_0x3b8836={},_0x53ad6c={'count':0x0,'rows':[]};var _0x5d696d=_[_0x8c73('0x2c')](db['SmsQueueReport'][_0x8c73('0x2d')],function(_0x2d0ab7){return{'name':_0x2d0ab7[_0x8c73('0x2e')],'type':_0x2d0ab7[_0x8c73('0x2f')][_0x8c73('0x30')]};});_0x3b8836[_0x8c73('0x31')]=_[_0x8c73('0x2c')](_0x5d696d,_0x8c73('0x29'));_0x3b8836['query']=_[_0x8c73('0x32')](_0xa67429['query']);_0x3b8836['filters']=_['intersection'](_0x3b8836[_0x8c73('0x31')],_0x3b8836[_0x8c73('0x33')]);_0x3c18d6[_0x8c73('0x34')]=_[_0x8c73('0x35')](_0x3b8836['model'],qs[_0x8c73('0x36')](_0xa67429[_0x8c73('0x33')][_0x8c73('0x36')]));_0x3c18d6[_0x8c73('0x34')]=_0x3c18d6[_0x8c73('0x34')][_0x8c73('0x37')]?_0x3c18d6['attributes']:_0x3b8836[_0x8c73('0x31')];if(!_0xa67429[_0x8c73('0x33')][_0x8c73('0x38')](_0x8c73('0x39'))){_0x3c18d6[_0x8c73('0x1e')]=qs[_0x8c73('0x1e')](_0xa67429[_0x8c73('0x33')][_0x8c73('0x1e')]);_0x3c18d6['offset']=qs['offset'](_0xa67429[_0x8c73('0x33')]['offset']);}_0x3c18d6[_0x8c73('0x3a')]=qs[_0x8c73('0x3b')](_0xa67429[_0x8c73('0x33')][_0x8c73('0x3b')]);_0x3c18d6[_0x8c73('0x3c')]=qs[_0x8c73('0x3d')](_['pick'](_0xa67429[_0x8c73('0x33')],_0x3b8836['filters']),_0x5d696d);if(_0xa67429[_0x8c73('0x33')][_0x8c73('0x3e')]){_0x3c18d6['where']=_[_0x8c73('0x3f')](_0x3c18d6[_0x8c73('0x3c')],{'$or':_[_0x8c73('0x2c')](_0x5d696d,function(_0x468dde){if(_0x468dde[_0x8c73('0x2f')]!==_0x8c73('0x40')){var _0x327957={};_0x327957[_0x468dde['name']]={'$like':'%'+_0xa67429['query'][_0x8c73('0x3e')]+'%'};return _0x327957;}})});}_0x3c18d6=_[_0x8c73('0x3f')]({},_0x3c18d6,_0xa67429[_0x8c73('0x41')]);var _0x196d96={'where':_0x3c18d6['where']};return db[_0x8c73('0x42')][_0x8c73('0x1f')](_0x196d96)[_0x8c73('0x24')](function(_0x1990c9){_0x53ad6c[_0x8c73('0x1f')]=_0x1990c9;if(_0xa67429[_0x8c73('0x33')][_0x8c73('0x43')]){_0x3c18d6[_0x8c73('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x8c73('0x45')](_0x3c18d6);})[_0x8c73('0x24')](function(_0x1639fa){_0x53ad6c[_0x8c73('0x46')]=_0x1639fa;return _0x53ad6c;})[_0x8c73('0x24')](respondWithFilteredResult(_0x2df099,_0x3c18d6))[_0x8c73('0x47')](handleError(_0x2df099,null));};exports[_0x8c73('0x48')]=function(_0x3bec5d,_0x19fdcd){var _0x8472={'raw':!![],'where':{'id':_0x3bec5d[_0x8c73('0x49')]['id']}},_0x51ccbc={};_0x51ccbc[_0x8c73('0x31')]=_[_0x8c73('0x32')](db[_0x8c73('0x42')][_0x8c73('0x2d')]);_0x51ccbc[_0x8c73('0x33')]=_[_0x8c73('0x32')](_0x3bec5d[_0x8c73('0x33')]);_0x51ccbc[_0x8c73('0x3d')]=_['intersection'](_0x51ccbc[_0x8c73('0x31')],_0x51ccbc[_0x8c73('0x33')]);_0x8472[_0x8c73('0x34')]=_[_0x8c73('0x35')](_0x51ccbc[_0x8c73('0x31')],qs[_0x8c73('0x36')](_0x3bec5d[_0x8c73('0x33')][_0x8c73('0x36')]));_0x8472[_0x8c73('0x34')]=_0x8472[_0x8c73('0x34')][_0x8c73('0x37')]?_0x8472[_0x8c73('0x34')]:_0x51ccbc[_0x8c73('0x31')];if(_0x3bec5d['query'][_0x8c73('0x43')]){_0x8472[_0x8c73('0x44')]=[{'all':!![]}];}_0x8472=_[_0x8c73('0x3f')]({},_0x8472,_0x3bec5d[_0x8c73('0x41')]);return db[_0x8c73('0x42')][_0x8c73('0x4a')](_0x8472)[_0x8c73('0x24')](handleEntityNotFound(_0x19fdcd,null))[_0x8c73('0x24')](respondWithResult(_0x19fdcd,null))[_0x8c73('0x47')](handleError(_0x19fdcd,null));};exports[_0x8c73('0x4b')]=function(_0x3854a1,_0x31ec8b){return db[_0x8c73('0x42')][_0x8c73('0x4b')](_0x3854a1[_0x8c73('0x4c')],{})[_0x8c73('0x24')](respondWithResult(_0x31ec8b,0xc9))[_0x8c73('0x47')](handleError(_0x31ec8b,null));};exports['update']=function(_0x4ef54d,_0x1ff4a0){if(_0x4ef54d[_0x8c73('0x4c')]['id']){delete _0x4ef54d[_0x8c73('0x4c')]['id'];}return db[_0x8c73('0x42')][_0x8c73('0x4a')]({'where':{'id':_0x4ef54d[_0x8c73('0x49')]['id']}})[_0x8c73('0x24')](handleEntityNotFound(_0x1ff4a0,null))[_0x8c73('0x24')](saveUpdates(_0x4ef54d[_0x8c73('0x4c')],null))[_0x8c73('0x24')](respondWithResult(_0x1ff4a0,null))['catch'](handleError(_0x1ff4a0,null));};exports[_0x8c73('0x25')]=function(_0x2cf8b8,_0x3829cc){return db[_0x8c73('0x42')][_0x8c73('0x4a')]({'where':{'id':_0x2cf8b8[_0x8c73('0x49')]['id']}})[_0x8c73('0x24')](handleEntityNotFound(_0x3829cc,null))[_0x8c73('0x24')](removeEntity(_0x3829cc,null))[_0x8c73('0x47')](handleError(_0x3829cc,null));};exports[_0x8c73('0x4d')]=function(_0x147179,_0x1af242){return db[_0x8c73('0x42')][_0x8c73('0x4d')]()[_0x8c73('0x24')](respondWithResult(_0x1af242,null))[_0x8c73('0x47')](handleError(_0x1af242,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 62e460d..8c214e4 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 5aa31e8..84c64f9 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 _0xc06d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','create','body','options','debug','UpdateSmsQueueReport','SmsQueueReport','update','raw','where','attributes','limit','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc06d,0x17f));var _0xdc06=function(_0x1cd1e8,_0x1dc36a){_0x1cd1e8=_0x1cd1e8-0x0;var _0x5223ef=_0xc06d[_0x1cd1e8];return _0x5223ef;};'use strict';var _=require(_0xdc06('0x0'));var util=require(_0xdc06('0x1'));var moment=require(_0xdc06('0x2'));var BPromise=require(_0xdc06('0x3'));var rs=require(_0xdc06('0x4'));var fs=require('fs');var Redis=require(_0xdc06('0x5'));var db=require(_0xdc06('0x6'))['db'];var utils=require(_0xdc06('0x7'));var logger=require(_0xdc06('0x8'))(_0xdc06('0x9'));var config=require(_0xdc06('0xa'));var jayson=require(_0xdc06('0xb'));var client=jayson['client'][_0xdc06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b9e67,_0x5bd37e,_0x26c3cc){return new BPromise(function(_0x480c4d,_0x1d77b1){return client['request'](_0x3b9e67,_0x26c3cc)[_0xdc06('0xd')](function(_0x2b2771){logger[_0xdc06('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x5bd37e,_0xdc06('0xf'));logger['debug'](_0xdc06('0x10'),_0x5bd37e,'request\x20sent',JSON[_0xdc06('0x11')](_0x2b2771));if(_0x2b2771[_0xdc06('0x12')]){if(_0x2b2771[_0xdc06('0x12')][_0xdc06('0x13')]===0x1f4){logger[_0xdc06('0x12')](_0xdc06('0x14'),_0x5bd37e,_0x2b2771[_0xdc06('0x12')][_0xdc06('0x15')]);return _0x1d77b1(_0x2b2771[_0xdc06('0x12')][_0xdc06('0x15')]);}logger[_0xdc06('0x12')](_0xdc06('0x14'),_0x5bd37e,_0x2b2771['error'][_0xdc06('0x15')]);return _0x480c4d(_0x2b2771[_0xdc06('0x12')][_0xdc06('0x15')]);}else{logger[_0xdc06('0xe')](_0xdc06('0x14'),_0x5bd37e,_0xdc06('0xf'));_0x480c4d(_0x2b2771['result'][_0xdc06('0x15')]);}})[_0xdc06('0x16')](function(_0x1e77f7){logger[_0xdc06('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x5bd37e,_0x1e77f7);_0x1d77b1(_0x1e77f7);});});}exports[_0xdc06('0x17')]=function(_0x46f5b3){var _0x112cf9=this;return new Promise(function(_0x229c83,_0x141cf2){return db['SmsQueueReport'][_0xdc06('0x18')](_0x46f5b3[_0xdc06('0x19')],{'raw':_0x46f5b3[_0xdc06('0x1a')]?_0x46f5b3[_0xdc06('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xdc06('0xd')](function(_0x5dc9d9){logger[_0xdc06('0xe')]('CreateSmsQueueReport',_0x46f5b3);logger[_0xdc06('0x1b')]('CreateSmsQueueReport',_0x46f5b3,JSON[_0xdc06('0x11')](_0x5dc9d9));_0x229c83(_0x5dc9d9);})[_0xdc06('0x16')](function(_0x29bab4){logger['error'](_0xdc06('0x17'),_0x29bab4[_0xdc06('0x15')],_0x46f5b3);_0x141cf2(_0x112cf9[_0xdc06('0x12')](0x1f4,_0x29bab4['message']));});});};exports[_0xdc06('0x1c')]=function(_0x54ddcb){var _0xc6bc66=this;return new Promise(function(_0x1ebb5e,_0x17b4bf){return db[_0xdc06('0x1d')][_0xdc06('0x1e')](_0x54ddcb[_0xdc06('0x19')],{'raw':_0x54ddcb[_0xdc06('0x1a')]?_0x54ddcb[_0xdc06('0x1a')][_0xdc06('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54ddcb[_0xdc06('0x1a')]?_0x54ddcb[_0xdc06('0x1a')][_0xdc06('0x20')]||null:null,'attributes':_0x54ddcb[_0xdc06('0x1a')]?_0x54ddcb[_0xdc06('0x1a')][_0xdc06('0x21')]||null:null,'limit':_0x54ddcb[_0xdc06('0x1a')]?_0x54ddcb['options'][_0xdc06('0x22')]||null:null})[_0xdc06('0xd')](function(_0x54958e){logger[_0xdc06('0xe')](_0xdc06('0x1c'),_0x54ddcb);logger[_0xdc06('0x1b')](_0xdc06('0x1c'),_0x54ddcb,JSON['stringify'](_0x54958e));_0x1ebb5e(_0x54958e);})[_0xdc06('0x16')](function(_0x1b5409){logger[_0xdc06('0x12')](_0xdc06('0x1c'),_0x1b5409[_0xdc06('0x15')],_0x54ddcb);_0x17b4bf(_0xc6bc66['error'](0x1f4,_0x1b5409[_0xdc06('0x15')]));});});}; \ No newline at end of file +var _0xb391=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','then','UpdateSmsQueueReport','update','body','where','attributes','stringify','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x22e513,_0x53d375){var _0x55d29b=function(_0x2ccff5){while(--_0x2ccff5){_0x22e513['push'](_0x22e513['shift']());}};_0x55d29b(++_0x53d375);}(_0xb391,0xc2));var _0x1b39=function(_0x47a768,_0x3357cc){_0x47a768=_0x47a768-0x0;var _0x5d756d=_0xb391[_0x47a768];return _0x5d756d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1b39('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b39('0x1'))['db'];var utils=require(_0x1b39('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b39('0x3'));var jayson=require(_0x1b39('0x4'));var client=jayson['client'][_0x1b39('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3abfdf,_0x21b929,_0x566c14){return new BPromise(function(_0xeaeb1c,_0x3b040d){return client[_0x1b39('0x6')](_0x3abfdf,_0x566c14)['then'](function(_0x5a83d5){logger['info'](_0x1b39('0x7'),_0x21b929,_0x1b39('0x8'));logger[_0x1b39('0x9')](_0x1b39('0xa'),_0x21b929,'request\x20sent',JSON['stringify'](_0x5a83d5));if(_0x5a83d5['error']){if(_0x5a83d5['error'][_0x1b39('0xb')]===0x1f4){logger[_0x1b39('0xc')](_0x1b39('0x7'),_0x21b929,_0x5a83d5[_0x1b39('0xc')][_0x1b39('0xd')]);return _0x3b040d(_0x5a83d5[_0x1b39('0xc')][_0x1b39('0xd')]);}logger[_0x1b39('0xc')](_0x1b39('0x7'),_0x21b929,_0x5a83d5[_0x1b39('0xc')][_0x1b39('0xd')]);return _0xeaeb1c(_0x5a83d5['error'][_0x1b39('0xd')]);}else{logger[_0x1b39('0xe')](_0x1b39('0x7'),_0x21b929,_0x1b39('0x8'));_0xeaeb1c(_0x5a83d5[_0x1b39('0xf')][_0x1b39('0xd')]);}})[_0x1b39('0x10')](function(_0x31dd35){logger['error'](_0x1b39('0x7'),_0x21b929,_0x31dd35);_0x3b040d(_0x31dd35);});});}exports[_0x1b39('0x11')]=function(_0x2ae2d6){var _0x49eff1=this;return new Promise(function(_0x3a6869,_0x1466d5){return db[_0x1b39('0x12')][_0x1b39('0x13')](_0x2ae2d6['body'],{'raw':_0x2ae2d6[_0x1b39('0x14')]?_0x2ae2d6['options'][_0x1b39('0x15')]===undefined?!![]:![]:!![]})[_0x1b39('0x16')](function(_0x282cd2){logger[_0x1b39('0xe')](_0x1b39('0x11'),_0x2ae2d6);logger[_0x1b39('0x9')](_0x1b39('0x11'),_0x2ae2d6,JSON['stringify'](_0x282cd2));_0x3a6869(_0x282cd2);})[_0x1b39('0x10')](function(_0x5e901f){logger[_0x1b39('0xc')](_0x1b39('0x11'),_0x5e901f[_0x1b39('0xd')],_0x2ae2d6);_0x1466d5(_0x49eff1['error'](0x1f4,_0x5e901f[_0x1b39('0xd')]));});});};exports[_0x1b39('0x17')]=function(_0x672790){var _0x42ffc3=this;return new Promise(function(_0x461265,_0x188196){return db[_0x1b39('0x12')][_0x1b39('0x18')](_0x672790[_0x1b39('0x19')],{'raw':_0x672790[_0x1b39('0x14')]?_0x672790['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x672790[_0x1b39('0x14')]?_0x672790[_0x1b39('0x14')][_0x1b39('0x1a')]||null:null,'attributes':_0x672790[_0x1b39('0x14')]?_0x672790['options'][_0x1b39('0x1b')]||null:null,'limit':_0x672790['options']?_0x672790[_0x1b39('0x14')]['limit']||null:null})[_0x1b39('0x16')](function(_0x16e33e){logger[_0x1b39('0xe')](_0x1b39('0x17'),_0x672790);logger[_0x1b39('0x9')](_0x1b39('0x17'),_0x672790,JSON[_0x1b39('0x1c')](_0x16e33e));_0x461265(_0x16e33e);})['catch'](function(_0x1c1b4f){logger[_0x1b39('0xc')](_0x1b39('0x17'),_0x1c1b4f[_0x1b39('0xd')],_0x672790);_0x188196(_0x42ffc3[_0x1b39('0xc')](0x1f4,_0x1c1b4f[_0x1b39('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index cc0f132..957e752 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 _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x1ea983,_0x2d1cfc){var _0x4bc1b4=function(_0x43fb7e){while(--_0x43fb7e){_0x1ea983['push'](_0x1ea983['shift']());}};_0x4bc1b4(++_0x2d1cfc);}(_0xaba6,0xe2));var _0x6aba=function(_0x5f13c7,_0x4b0f7b){_0x5f13c7=_0x5f13c7-0x0;var _0x348082=_0xaba6[_0x5f13c7];return _0x348082;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file +var _0x723e=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put'];(function(_0x5e61fe,_0x4ec70b){var _0x13ff2b=function(_0x300006){while(--_0x300006){_0x5e61fe['push'](_0x5e61fe['shift']());}};_0x13ff2b(++_0x4ec70b);}(_0x723e,0x179));var _0xe723=function(_0x38495b,_0x11e1e2){_0x38495b=_0x38495b-0x0;var _0x529cd6=_0x723e[_0x38495b];return _0x529cd6;};'use strict';var multer=require('multer');var util=require(_0xe723('0x0'));var path=require(_0xe723('0x1'));var timeout=require(_0xe723('0x2'));var express=require(_0xe723('0x3'));var router=express[_0xe723('0x4')]();var fs_extra=require(_0xe723('0x5'));var auth=require(_0xe723('0x6'));var interaction=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var controller=require(_0xe723('0x9'));router['get']('/',auth[_0xe723('0xa')](),controller[_0xe723('0xb')]);router[_0xe723('0xc')](_0xe723('0xd'),auth[_0xe723('0xa')](),controller[_0xe723('0xe')]);router[_0xe723('0xc')](_0xe723('0xf'),auth['isAuthenticated'](),controller[_0xe723('0x10')]);router[_0xe723('0x11')]('/',auth[_0xe723('0xa')](),controller['create']);router[_0xe723('0x12')](_0xe723('0xf'),auth[_0xe723('0xa')](),controller['update']);router[_0xe723('0x13')](_0xe723('0xf'),auth[_0xe723('0xa')](),controller[_0xe723('0x14')]);module[_0xe723('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0c7bb2a..1ad7a06 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5c81b2,_0x46590a){var _0x4cbed6=function(_0x221f19){while(--_0x221f19){_0x5c81b2['push'](_0x5c81b2['shift']());}};_0x4cbed6(++_0x46590a);}(_0x008c,0x188));var _0xc008=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x008c[_0x12c34e];return _0x244e88;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x39ff9c,_0x35d13a){var _0x4ff2d2=function(_0x4017d4){while(--_0x4017d4){_0x39ff9c['push'](_0x39ff9c['shift']());}};_0x4ff2d2(++_0x35d13a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index fba1304..c440c4f 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 _0x0db4=['options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','error','name','send','index','map','SmsTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0db4,0x9f));var _0x40db=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0db4[_0x4b73a2];return _0x383c66;};'use strict';var emlformat=require(_0x40db('0x0'));var rimraf=require(_0x40db('0x1'));var zipdir=require(_0x40db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40db('0x3'));var moment=require(_0x40db('0x4'));var BPromise=require(_0x40db('0x5'));var Mustache=require(_0x40db('0x6'));var util=require(_0x40db('0x7'));var path=require('path');var sox=require(_0x40db('0x8'));var csv=require(_0x40db('0x9'));var ejs=require(_0x40db('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40db('0xb'));var squel=require(_0x40db('0xc'));var crypto=require('crypto');var jsforce=require(_0x40db('0xd'));var deskjs=require(_0x40db('0xe'));var toCsv=require(_0x40db('0x9'));var querystring=require('querystring');var Papa=require(_0x40db('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x40db('0x10'));var as=require(_0x40db('0x11'));var hardwareService=require(_0x40db('0x12'));var logger=require(_0x40db('0x13'))(_0x40db('0x14'));var utils=require(_0x40db('0x15'));var config=require(_0x40db('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x40db('0x17'))['db'];function respondWithStatusCode(_0x48b001,_0x150a57){_0x150a57=_0x150a57||0xcc;return function(_0x303d87){if(_0x303d87){return _0x48b001[_0x40db('0x18')](_0x150a57);}return _0x48b001[_0x40db('0x19')](_0x150a57)['end']();};}function respondWithResult(_0xfddf36,_0x3d8ad0){_0x3d8ad0=_0x3d8ad0||0xc8;return function(_0x3a2a2e){if(_0x3a2a2e){return _0xfddf36[_0x40db('0x19')](_0x3d8ad0)[_0x40db('0x1a')](_0x3a2a2e);}};}function respondWithFilteredResult(_0x8ad533,_0x7df493){return function(_0x55aa0f){if(_0x55aa0f){var _0x310775=typeof _0x7df493[_0x40db('0x1b')]===_0x40db('0x1c')&&typeof _0x7df493[_0x40db('0x1d')]===_0x40db('0x1c');var _0x22f3f2=_0x55aa0f[_0x40db('0x1e')];var _0x21ae54=_0x310775?0x0:_0x7df493[_0x40db('0x1b')];var _0x2f8010=_0x310775?_0x55aa0f[_0x40db('0x1e')]:_0x7df493[_0x40db('0x1b')]+_0x7df493[_0x40db('0x1d')];var _0x3b8979;if(_0x2f8010>=_0x22f3f2){_0x2f8010=_0x22f3f2;_0x3b8979=0xc8;}else{_0x3b8979=0xce;}_0x8ad533['status'](_0x3b8979);return _0x8ad533[_0x40db('0x1f')](_0x40db('0x20'),_0x21ae54+'-'+_0x2f8010+'/'+_0x22f3f2)[_0x40db('0x1a')](_0x55aa0f);}return null;};}function patchUpdates(_0x455f80){return function(_0x245549){try{jsonpatch[_0x40db('0x21')](_0x245549,_0x455f80,!![]);}catch(_0x3ed24c){return BPromise['reject'](_0x3ed24c);}return _0x245549['save']();};}function saveUpdates(_0x1a4996,_0xf4fc4d){return function(_0x5c6f17){if(_0x5c6f17){return _0x5c6f17[_0x40db('0x22')](_0x1a4996)[_0x40db('0x23')](function(_0x2e92f2){return _0x2e92f2;});}return null;};}function removeEntity(_0x578fdb,_0x13f065){return function(_0x5a16a9){if(_0x5a16a9){return _0x5a16a9['destroy']()[_0x40db('0x23')](function(){_0x578fdb[_0x40db('0x19')](0xcc)[_0x40db('0x24')]();});}};}function handleEntityNotFound(_0x3546d2,_0x4e59db){return function(_0x49a869){if(!_0x49a869){_0x3546d2[_0x40db('0x18')](0x194);}return _0x49a869;};}function handleError(_0x1ed839,_0x30d9bf){_0x30d9bf=_0x30d9bf||0x1f4;return function(_0x292416){logger[_0x40db('0x25')](_0x292416['stack']);if(_0x292416[_0x40db('0x26')]){delete _0x292416['name'];}_0x1ed839[_0x40db('0x19')](_0x30d9bf)[_0x40db('0x27')](_0x292416);};}exports[_0x40db('0x28')]=function(_0x4f3052,_0x305303){var _0xcd0238={},_0xb52b81={},_0x22582a={'count':0x0,'rows':[]};var _0x1ec0de=_[_0x40db('0x29')](db[_0x40db('0x2a')]['rawAttributes'],function(_0x24bf6d){return{'name':_0x24bf6d[_0x40db('0x2b')],'type':_0x24bf6d[_0x40db('0x2c')]['key']};});_0xb52b81[_0x40db('0x2d')]=_[_0x40db('0x29')](_0x1ec0de,'name');_0xb52b81[_0x40db('0x2e')]=_[_0x40db('0x2f')](_0x4f3052[_0x40db('0x2e')]);_0xb52b81[_0x40db('0x30')]=_[_0x40db('0x31')](_0xb52b81['model'],_0xb52b81[_0x40db('0x2e')]);_0xcd0238[_0x40db('0x32')]=_['intersection'](_0xb52b81['model'],qs[_0x40db('0x33')](_0x4f3052[_0x40db('0x2e')][_0x40db('0x33')]));_0xcd0238[_0x40db('0x32')]=_0xcd0238[_0x40db('0x32')][_0x40db('0x34')]?_0xcd0238[_0x40db('0x32')]:_0xb52b81[_0x40db('0x2d')];if(!_0x4f3052[_0x40db('0x2e')][_0x40db('0x35')](_0x40db('0x36'))){_0xcd0238[_0x40db('0x1d')]=qs[_0x40db('0x1d')](_0x4f3052['query'][_0x40db('0x1d')]);_0xcd0238[_0x40db('0x1b')]=qs['offset'](_0x4f3052[_0x40db('0x2e')]['offset']);}_0xcd0238[_0x40db('0x37')]=qs[_0x40db('0x38')](_0x4f3052[_0x40db('0x2e')][_0x40db('0x38')]);_0xcd0238[_0x40db('0x39')]=qs[_0x40db('0x30')](_[_0x40db('0x3a')](_0x4f3052[_0x40db('0x2e')],_0xb52b81[_0x40db('0x30')]),_0x1ec0de);if(_0x4f3052[_0x40db('0x2e')]['filter']){_0xcd0238['where']=_[_0x40db('0x3b')](_0xcd0238[_0x40db('0x39')],{'$or':_['map'](_0x1ec0de,function(_0xba944b){if(_0xba944b['type']!=='VIRTUAL'){var _0x211e23={};_0x211e23[_0xba944b[_0x40db('0x26')]]={'$like':'%'+_0x4f3052[_0x40db('0x2e')]['filter']+'%'};return _0x211e23;}})});}_0xcd0238=_[_0x40db('0x3b')]({},_0xcd0238,_0x4f3052[_0x40db('0x3c')]);var _0x42a6a6={'where':_0xcd0238[_0x40db('0x39')]};return db[_0x40db('0x2a')][_0x40db('0x1e')](_0x42a6a6)[_0x40db('0x23')](function(_0x4a7236){_0x22582a[_0x40db('0x1e')]=_0x4a7236;if(_0x4f3052[_0x40db('0x2e')]['includeAll']){_0xcd0238[_0x40db('0x3d')]=[{'all':!![]}];}return db[_0x40db('0x2a')][_0x40db('0x3e')](_0xcd0238);})['then'](function(_0x2e1d86){_0x22582a['rows']=_0x2e1d86;return _0x22582a;})[_0x40db('0x23')](respondWithFilteredResult(_0x305303,_0xcd0238))[_0x40db('0x3f')](handleError(_0x305303,null));};exports[_0x40db('0x40')]=function(_0x2b9fe1,_0x5d973c){var _0x9f18d0={'raw':!![],'where':{'id':_0x2b9fe1[_0x40db('0x41')]['id']}},_0x402877={};_0x402877[_0x40db('0x2d')]=_[_0x40db('0x2f')](db[_0x40db('0x2a')][_0x40db('0x42')]);_0x402877[_0x40db('0x2e')]=_['keys'](_0x2b9fe1[_0x40db('0x2e')]);_0x402877[_0x40db('0x30')]=_[_0x40db('0x31')](_0x402877[_0x40db('0x2d')],_0x402877[_0x40db('0x2e')]);_0x9f18d0[_0x40db('0x32')]=_[_0x40db('0x31')](_0x402877['model'],qs['fields'](_0x2b9fe1[_0x40db('0x2e')][_0x40db('0x33')]));_0x9f18d0[_0x40db('0x32')]=_0x9f18d0[_0x40db('0x32')]['length']?_0x9f18d0[_0x40db('0x32')]:_0x402877['model'];if(_0x2b9fe1[_0x40db('0x2e')][_0x40db('0x43')]){_0x9f18d0[_0x40db('0x3d')]=[{'all':!![]}];}_0x9f18d0=_['merge']({},_0x9f18d0,_0x2b9fe1[_0x40db('0x3c')]);return db[_0x40db('0x2a')]['find'](_0x9f18d0)[_0x40db('0x23')](handleEntityNotFound(_0x5d973c,null))['then'](respondWithResult(_0x5d973c,null))[_0x40db('0x3f')](handleError(_0x5d973c,null));};exports[_0x40db('0x44')]=function(_0x4e5660,_0x5310f3){return db[_0x40db('0x2a')][_0x40db('0x44')](_0x4e5660[_0x40db('0x45')],{})['then'](respondWithResult(_0x5310f3,0xc9))['catch'](handleError(_0x5310f3,null));};exports['update']=function(_0x3730ba,_0x44f2b6){if(_0x3730ba['body']['id']){delete _0x3730ba[_0x40db('0x45')]['id'];}return db[_0x40db('0x2a')]['find']({'where':{'id':_0x3730ba['params']['id']}})[_0x40db('0x23')](handleEntityNotFound(_0x44f2b6,null))['then'](saveUpdates(_0x3730ba['body'],null))['then'](respondWithResult(_0x44f2b6,null))[_0x40db('0x3f')](handleError(_0x44f2b6,null));};exports[_0x40db('0x46')]=function(_0x7c071a,_0xdb39b7){return db[_0x40db('0x2a')][_0x40db('0x47')]({'where':{'id':_0x7c071a[_0x40db('0x41')]['id']}})[_0x40db('0x23')](handleEntityNotFound(_0xdb39b7,null))[_0x40db('0x23')](removeEntity(_0xdb39b7,null))[_0x40db('0x3f')](handleError(_0xdb39b7,null));};exports[_0x40db('0x48')]=function(_0x1c9556,_0x3865a9){return db[_0x40db('0x2a')]['describe']()[_0x40db('0x23')](respondWithResult(_0x3865a9,null))[_0x40db('0x3f')](handleError(_0x3865a9,null));}; \ No newline at end of file +var _0x2a3c=['sort','where','filters','merge','filter','options','include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','SmsTransferReport','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x2ca148,_0x6f2b38){var _0x4a6404=function(_0x1594f1){while(--_0x1594f1){_0x2ca148['push'](_0x2ca148['shift']());}};_0x4a6404(++_0x6f2b38);}(_0x2a3c,0xa0));var _0xc2a3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2a3c[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xc2a3('0x0'));var rimraf=require(_0xc2a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc2a3('0x2'));var moment=require(_0xc2a3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc2a3('0x4'));var util=require(_0xc2a3('0x5'));var path=require(_0xc2a3('0x6'));var sox=require('sox');var csv=require(_0xc2a3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2a3('0x8'));var squel=require('squel');var crypto=require(_0xc2a3('0x9'));var jsforce=require(_0xc2a3('0xa'));var deskjs=require(_0xc2a3('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc2a3('0xc'));var Papa=require(_0xc2a3('0xd'));var Redis=require(_0xc2a3('0xe'));var authService=require(_0xc2a3('0xf'));var qs=require(_0xc2a3('0x10'));var as=require(_0xc2a3('0x11'));var hardwareService=require(_0xc2a3('0x12'));var logger=require(_0xc2a3('0x13'))(_0xc2a3('0x14'));var utils=require('../../config/utils');var config=require(_0xc2a3('0x15'));var licenseUtil=require(_0xc2a3('0x16'));var db=require(_0xc2a3('0x17'))['db'];function respondWithStatusCode(_0x28362f,_0x5fdc38){_0x5fdc38=_0x5fdc38||0xcc;return function(_0x49cee0){if(_0x49cee0){return _0x28362f[_0xc2a3('0x18')](_0x5fdc38);}return _0x28362f[_0xc2a3('0x19')](_0x5fdc38)[_0xc2a3('0x1a')]();};}function respondWithResult(_0x346893,_0x397ebb){_0x397ebb=_0x397ebb||0xc8;return function(_0x12f053){if(_0x12f053){return _0x346893[_0xc2a3('0x19')](_0x397ebb)[_0xc2a3('0x1b')](_0x12f053);}};}function respondWithFilteredResult(_0x297ab4,_0x182697){return function(_0x36c3dc){if(_0x36c3dc){var _0x8fa74a=typeof _0x182697['offset']==='undefined'&&typeof _0x182697[_0xc2a3('0x1c')]==='undefined';var _0x119f19=_0x36c3dc[_0xc2a3('0x1d')];var _0x2e6565=_0x8fa74a?0x0:_0x182697['offset'];var _0x5077a3=_0x8fa74a?_0x36c3dc[_0xc2a3('0x1d')]:_0x182697[_0xc2a3('0x1e')]+_0x182697[_0xc2a3('0x1c')];var _0xd303bc;if(_0x5077a3>=_0x119f19){_0x5077a3=_0x119f19;_0xd303bc=0xc8;}else{_0xd303bc=0xce;}_0x297ab4[_0xc2a3('0x19')](_0xd303bc);return _0x297ab4[_0xc2a3('0x1f')](_0xc2a3('0x20'),_0x2e6565+'-'+_0x5077a3+'/'+_0x119f19)[_0xc2a3('0x1b')](_0x36c3dc);}return null;};}function patchUpdates(_0x3e51d2){return function(_0x5f3e54){try{jsonpatch[_0xc2a3('0x21')](_0x5f3e54,_0x3e51d2,!![]);}catch(_0x485c18){return BPromise[_0xc2a3('0x22')](_0x485c18);}return _0x5f3e54['save']();};}function saveUpdates(_0x3affcc,_0x51ce86){return function(_0x12d1e4){if(_0x12d1e4){return _0x12d1e4[_0xc2a3('0x23')](_0x3affcc)['then'](function(_0x13fab3){return _0x13fab3;});}return null;};}function removeEntity(_0x34ac93,_0x12bffb){return function(_0x234d2f){if(_0x234d2f){return _0x234d2f[_0xc2a3('0x24')]()[_0xc2a3('0x25')](function(){_0x34ac93[_0xc2a3('0x19')](0xcc)[_0xc2a3('0x1a')]();});}};}function handleEntityNotFound(_0x58f6af,_0x15a376){return function(_0x1c1ab6){if(!_0x1c1ab6){_0x58f6af[_0xc2a3('0x18')](0x194);}return _0x1c1ab6;};}function handleError(_0x16224f,_0x5bd2de){_0x5bd2de=_0x5bd2de||0x1f4;return function(_0x2680ec){logger[_0xc2a3('0x26')](_0x2680ec[_0xc2a3('0x27')]);if(_0x2680ec[_0xc2a3('0x28')]){delete _0x2680ec['name'];}_0x16224f[_0xc2a3('0x19')](_0x5bd2de)[_0xc2a3('0x29')](_0x2680ec);};}exports['index']=function(_0x49dbc1,_0x49c653){var _0x407d96={},_0x1b22f1={},_0x83b66d={'count':0x0,'rows':[]};var _0x1daa80=_[_0xc2a3('0x2a')](db[_0xc2a3('0x2b')]['rawAttributes'],function(_0x364ea2){return{'name':_0x364ea2['fieldName'],'type':_0x364ea2[_0xc2a3('0x2c')]['key']};});_0x1b22f1[_0xc2a3('0x2d')]=_[_0xc2a3('0x2a')](_0x1daa80,_0xc2a3('0x28'));_0x1b22f1[_0xc2a3('0x2e')]=_[_0xc2a3('0x2f')](_0x49dbc1[_0xc2a3('0x2e')]);_0x1b22f1['filters']=_[_0xc2a3('0x30')](_0x1b22f1[_0xc2a3('0x2d')],_0x1b22f1[_0xc2a3('0x2e')]);_0x407d96[_0xc2a3('0x31')]=_[_0xc2a3('0x30')](_0x1b22f1['model'],qs['fields'](_0x49dbc1['query'][_0xc2a3('0x32')]));_0x407d96[_0xc2a3('0x31')]=_0x407d96['attributes']['length']?_0x407d96[_0xc2a3('0x31')]:_0x1b22f1[_0xc2a3('0x2d')];if(!_0x49dbc1['query'][_0xc2a3('0x33')](_0xc2a3('0x34'))){_0x407d96[_0xc2a3('0x1c')]=qs[_0xc2a3('0x1c')](_0x49dbc1['query'][_0xc2a3('0x1c')]);_0x407d96[_0xc2a3('0x1e')]=qs[_0xc2a3('0x1e')](_0x49dbc1[_0xc2a3('0x2e')]['offset']);}_0x407d96['order']=qs[_0xc2a3('0x35')](_0x49dbc1[_0xc2a3('0x2e')][_0xc2a3('0x35')]);_0x407d96[_0xc2a3('0x36')]=qs[_0xc2a3('0x37')](_['pick'](_0x49dbc1['query'],_0x1b22f1[_0xc2a3('0x37')]),_0x1daa80);if(_0x49dbc1[_0xc2a3('0x2e')]['filter']){_0x407d96[_0xc2a3('0x36')]=_[_0xc2a3('0x38')](_0x407d96[_0xc2a3('0x36')],{'$or':_[_0xc2a3('0x2a')](_0x1daa80,function(_0x1f61eb){if(_0x1f61eb[_0xc2a3('0x2c')]!=='VIRTUAL'){var _0x6ee286={};_0x6ee286[_0x1f61eb['name']]={'$like':'%'+_0x49dbc1[_0xc2a3('0x2e')][_0xc2a3('0x39')]+'%'};return _0x6ee286;}})});}_0x407d96=_['merge']({},_0x407d96,_0x49dbc1[_0xc2a3('0x3a')]);var _0x31ef57={'where':_0x407d96['where']};return db[_0xc2a3('0x2b')][_0xc2a3('0x1d')](_0x31ef57)['then'](function(_0x179c36){_0x83b66d['count']=_0x179c36;if(_0x49dbc1[_0xc2a3('0x2e')]['includeAll']){_0x407d96[_0xc2a3('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x407d96);})[_0xc2a3('0x25')](function(_0x530e48){_0x83b66d[_0xc2a3('0x3c')]=_0x530e48;return _0x83b66d;})[_0xc2a3('0x25')](respondWithFilteredResult(_0x49c653,_0x407d96))[_0xc2a3('0x3d')](handleError(_0x49c653,null));};exports[_0xc2a3('0x3e')]=function(_0x3769fd,_0x175867){var _0x3f00a={'raw':!![],'where':{'id':_0x3769fd[_0xc2a3('0x3f')]['id']}},_0x51bef4={};_0x51bef4[_0xc2a3('0x2d')]=_[_0xc2a3('0x2f')](db[_0xc2a3('0x2b')][_0xc2a3('0x40')]);_0x51bef4[_0xc2a3('0x2e')]=_['keys'](_0x3769fd['query']);_0x51bef4[_0xc2a3('0x37')]=_[_0xc2a3('0x30')](_0x51bef4[_0xc2a3('0x2d')],_0x51bef4[_0xc2a3('0x2e')]);_0x3f00a[_0xc2a3('0x31')]=_[_0xc2a3('0x30')](_0x51bef4[_0xc2a3('0x2d')],qs[_0xc2a3('0x32')](_0x3769fd[_0xc2a3('0x2e')][_0xc2a3('0x32')]));_0x3f00a[_0xc2a3('0x31')]=_0x3f00a['attributes'][_0xc2a3('0x41')]?_0x3f00a[_0xc2a3('0x31')]:_0x51bef4[_0xc2a3('0x2d')];if(_0x3769fd['query'][_0xc2a3('0x42')]){_0x3f00a[_0xc2a3('0x3b')]=[{'all':!![]}];}_0x3f00a=_[_0xc2a3('0x38')]({},_0x3f00a,_0x3769fd[_0xc2a3('0x3a')]);return db[_0xc2a3('0x2b')][_0xc2a3('0x43')](_0x3f00a)[_0xc2a3('0x25')](handleEntityNotFound(_0x175867,null))[_0xc2a3('0x25')](respondWithResult(_0x175867,null))[_0xc2a3('0x3d')](handleError(_0x175867,null));};exports[_0xc2a3('0x44')]=function(_0x52f3a4,_0x31c08f){return db['SmsTransferReport'][_0xc2a3('0x44')](_0x52f3a4['body'],{})['then'](respondWithResult(_0x31c08f,0xc9))[_0xc2a3('0x3d')](handleError(_0x31c08f,null));};exports[_0xc2a3('0x23')]=function(_0x2ba8f4,_0x1fe148){if(_0x2ba8f4[_0xc2a3('0x45')]['id']){delete _0x2ba8f4[_0xc2a3('0x45')]['id'];}return db[_0xc2a3('0x2b')][_0xc2a3('0x43')]({'where':{'id':_0x2ba8f4[_0xc2a3('0x3f')]['id']}})[_0xc2a3('0x25')](handleEntityNotFound(_0x1fe148,null))['then'](saveUpdates(_0x2ba8f4[_0xc2a3('0x45')],null))[_0xc2a3('0x25')](respondWithResult(_0x1fe148,null))[_0xc2a3('0x3d')](handleError(_0x1fe148,null));};exports[_0xc2a3('0x24')]=function(_0x2a9f16,_0x29edcc){return db['SmsTransferReport'][_0xc2a3('0x43')]({'where':{'id':_0x2a9f16[_0xc2a3('0x3f')]['id']}})[_0xc2a3('0x25')](handleEntityNotFound(_0x29edcc,null))[_0xc2a3('0x25')](removeEntity(_0x29edcc,null))[_0xc2a3('0x3d')](handleError(_0x29edcc,null));};exports[_0xc2a3('0x46')]=function(_0x4f4879,_0x171f2a){return db[_0xc2a3('0x2b')][_0xc2a3('0x46')]()[_0xc2a3('0x25')](respondWithResult(_0x171f2a,null))['catch'](handleError(_0x171f2a,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 8274991..ea24576 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 _0xde0f=['../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','api','bluebird','request-promise','path'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xde0f,0x1ab));var _0xfde0=function(_0x274032,_0x434d6e){_0x274032=_0x274032-0x0;var _0x14566f=_0xde0f[_0x274032];return _0x14566f;};'use strict';var _=require(_0xfde0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde0('0x1'));var moment=require('moment');var BPromise=require(_0xfde0('0x2'));var rp=require(_0xfde0('0x3'));var fs=require('fs');var path=require(_0xfde0('0x4'));var rimraf=require('rimraf');var config=require(_0xfde0('0x5'));var attributes=require(_0xfde0('0x6'));module[_0xfde0('0x7')]=function(_0x2a049b,_0x26549d){return _0x2a049b[_0xfde0('0x8')](_0xfde0('0x9'),attributes,{'tableName':_0xfde0('0xa'),'paranoid':![],'indexes':[{'name':_0xfde0('0xb'),'fields':[_0xfde0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xad9b=['request-promise','path','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x415260,_0x135fcb){var _0x490f21=function(_0x28d91c){while(--_0x28d91c){_0x415260['push'](_0x415260['shift']());}};_0x490f21(++_0x135fcb);}(_0xad9b,0x10e));var _0xbad9=function(_0x189373,_0x476207){_0x189373=_0x189373-0x0;var _0x130c41=_0xad9b[_0x189373];return _0x130c41;};'use strict';var _=require(_0xbad9('0x0'));var util=require('util');var logger=require(_0xbad9('0x1'))(_0xbad9('0x2'));var moment=require(_0xbad9('0x3'));var BPromise=require(_0xbad9('0x4'));var rp=require(_0xbad9('0x5'));var fs=require('fs');var path=require(_0xbad9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbad9('0x7'));module['exports']=function(_0xbca672,_0x4a77f1){return _0xbca672['define'](_0xbad9('0x8'),attributes,{'tableName':_0xbad9('0x9'),'paranoid':![],'indexes':[{'name':_0xbad9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 01f3e14..0c23dc6 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 _0xc0a4=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xc0a4,0x147));var _0x4c0a=function(_0xe1336b,_0x3f3130){_0xe1336b=_0xe1336b-0x0;var _0x1cf4b2=_0xc0a4[_0xe1336b];return _0x1cf4b2;};'use strict';var _=require('lodash');var util=require(_0x4c0a('0x0'));var moment=require(_0x4c0a('0x1'));var BPromise=require(_0x4c0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c0a('0x3'));var db=require(_0x4c0a('0x4'))['db'];var utils=require(_0x4c0a('0x5'));var logger=require(_0x4c0a('0x6'))(_0x4c0a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4c0a('0x8'));var client=jayson[_0x4c0a('0x9')][_0x4c0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457ef9,_0x7ca892,_0x1a64e7){return new BPromise(function(_0x4093d5,_0x33aedb){return client[_0x4c0a('0xb')](_0x457ef9,_0x1a64e7)['then'](function(_0x3bfa91){logger[_0x4c0a('0xc')](_0x4c0a('0xd'),_0x7ca892,_0x4c0a('0xe'));logger[_0x4c0a('0xf')](_0x4c0a('0x10'),_0x7ca892,_0x4c0a('0xe'),JSON[_0x4c0a('0x11')](_0x3bfa91));if(_0x3bfa91[_0x4c0a('0x12')]){if(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x13')]===0x1f4){logger[_0x4c0a('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x7ca892,_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);return _0x33aedb(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);}logger['error'](_0x4c0a('0xd'),_0x7ca892,_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);return _0x4093d5(_0x3bfa91[_0x4c0a('0x12')][_0x4c0a('0x14')]);}else{logger[_0x4c0a('0xc')](_0x4c0a('0xd'),_0x7ca892,_0x4c0a('0xe'));_0x4093d5(_0x3bfa91[_0x4c0a('0x15')][_0x4c0a('0x14')]);}})[_0x4c0a('0x16')](function(_0x4637a8){logger[_0x4c0a('0x12')](_0x4c0a('0xd'),_0x7ca892,_0x4637a8);_0x33aedb(_0x4637a8);});});} \ No newline at end of file +var _0x20d6=['request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x20d6,0x9d));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var moment=require(_0x620d('0x2'));var BPromise=require(_0x620d('0x3'));var rs=require(_0x620d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x620d('0x5'))['db'];var utils=require(_0x620d('0x6'));var logger=require(_0x620d('0x7'))(_0x620d('0x8'));var config=require('../../config/environment');var jayson=require(_0x620d('0x9'));var client=jayson[_0x620d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c4941,_0x33267f,_0x25927d){return new BPromise(function(_0x237d37,_0x2adec9){return client[_0x620d('0xb')](_0x1c4941,_0x25927d)[_0x620d('0xc')](function(_0x2d0be1){logger[_0x620d('0xd')](_0x620d('0xe'),_0x33267f,_0x620d('0xf'));logger[_0x620d('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x33267f,_0x620d('0xf'),JSON['stringify'](_0x2d0be1));if(_0x2d0be1[_0x620d('0x11')]){if(_0x2d0be1[_0x620d('0x11')][_0x620d('0x12')]===0x1f4){logger[_0x620d('0x11')](_0x620d('0xe'),_0x33267f,_0x2d0be1[_0x620d('0x11')][_0x620d('0x13')]);return _0x2adec9(_0x2d0be1[_0x620d('0x11')][_0x620d('0x13')]);}logger['error'](_0x620d('0xe'),_0x33267f,_0x2d0be1[_0x620d('0x11')][_0x620d('0x13')]);return _0x237d37(_0x2d0be1[_0x620d('0x11')][_0x620d('0x13')]);}else{logger['info'](_0x620d('0xe'),_0x33267f,_0x620d('0xf'));_0x237d37(_0x2d0be1[_0x620d('0x14')][_0x620d('0x13')]);}})['catch'](function(_0x11f4ea){logger[_0x620d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x33267f,_0x11f4ea);_0x2adec9(_0x11f4ea);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 651cbae..45c5aa9 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 _0x2127=['%s-%s%s','extname','now','post','single','file','create','put','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x2127,0x94));var _0x7212=function(_0x278601,_0x1f7a4c){_0x278601=_0x278601-0x0;var _0x4f22b5=_0x2127[_0x278601];return _0x4f22b5;};'use strict';var multer=require(_0x7212('0x0'));var util=require(_0x7212('0x1'));var path=require(_0x7212('0x2'));var timeout=require(_0x7212('0x3'));var express=require(_0x7212('0x4'));var router=express[_0x7212('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7212('0x6'));var config=require(_0x7212('0x7'));var controller=require(_0x7212('0x8'));router[_0x7212('0x9')]('/',auth[_0x7212('0xa')](),controller[_0x7212('0xb')]);router[_0x7212('0x9')](_0x7212('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7212('0x9')](_0x7212('0xd'),auth['isAuthenticated'](),controller[_0x7212('0xe')]);var upload=multer({'storage':multer[_0x7212('0xf')]({'destination':function(_0x43d164,_0x5ef8f9,_0x35de9c){_0x35de9c(null,path[_0x7212('0x10')](config[_0x7212('0x11')],_0x7212('0x12')));},'filename':function(_0x1b5be7,_0x52588b,_0x56a37d){_0x52588b[_0x7212('0x13')]=_0x52588b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x56a37d(null,util['format'](_0x7212('0x14'),path['basename'](_0x52588b[_0x7212('0x13')],path[_0x7212('0x15')](_0x52588b[_0x7212('0x13')])),Date[_0x7212('0x16')](),path[_0x7212('0x15')](_0x52588b[_0x7212('0x13')])));}})});router[_0x7212('0x17')]('/',upload[_0x7212('0x18')](_0x7212('0x19')),controller[_0x7212('0x1a')]);router[_0x7212('0x1b')]('/:id',auth[_0x7212('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x246a=['basename','extname','now','post','single','file','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','get','index','/:id','isAuthenticated','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s'];(function(_0x5043a0,_0x16a63d){var _0x235105=function(_0x32a47e){while(--_0x32a47e){_0x5043a0['push'](_0x5043a0['shift']());}};_0x235105(++_0x16a63d);}(_0x246a,0xf1));var _0xa246=function(_0x46592a,_0x55dfed){_0x46592a=_0x46592a-0x0;var _0x409918=_0x246a[_0x46592a];return _0x409918;};'use strict';var multer=require(_0xa246('0x0'));var util=require(_0xa246('0x1'));var path=require(_0xa246('0x2'));var timeout=require(_0xa246('0x3'));var express=require(_0xa246('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa246('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xa246('0x6')]('/',auth['isAuthenticated'](),controller[_0xa246('0x7')]);router[_0xa246('0x6')](_0xa246('0x8'),auth[_0xa246('0x9')](),controller[_0xa246('0xa')]);router[_0xa246('0x6')]('/:id/download',auth[_0xa246('0x9')](),controller[_0xa246('0xb')]);var upload=multer({'storage':multer[_0xa246('0xc')]({'destination':function(_0x119289,_0x5338ac,_0xb4702d){_0xb4702d(null,path[_0xa246('0xd')](config[_0xa246('0xe')],_0xa246('0xf')));},'filename':function(_0x10c989,_0x3e20c9,_0x28f857){_0x3e20c9[_0xa246('0x10')]=_0x3e20c9[_0xa246('0x10')][_0xa246('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x28f857(null,util[_0xa246('0x12')](_0xa246('0x13'),path[_0xa246('0x14')](_0x3e20c9[_0xa246('0x10')],path[_0xa246('0x15')](_0x3e20c9[_0xa246('0x10')])),Date[_0xa246('0x16')](),path[_0xa246('0x15')](_0x3e20c9[_0xa246('0x10')])));}})});router[_0xa246('0x17')]('/',upload[_0xa246('0x18')](_0xa246('0x19')),controller['create']);router[_0xa246('0x1a')](_0xa246('0x8'),auth[_0xa246('0x9')](),controller[_0xa246('0x1b')]);router[_0xa246('0x1c')](_0xa246('0x8'),auth[_0xa246('0x9')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index ef88d53..119d953 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 _0x032b=['BIGINT','INTEGER','exports','STRING','FLOAT'];(function(_0x390f4a,_0x2d1f06){var _0x53c938=function(_0xa5c60b){while(--_0xa5c60b){_0x390f4a['push'](_0x390f4a['shift']());}};_0x53c938(++_0x2d1f06);}(_0x032b,0x183));var _0xb032=function(_0x55107e,_0x210c83){_0x55107e=_0x55107e-0x0;var _0x118ef9=_0x032b[_0x55107e];return _0x118ef9;};'use strict';var Sequelize=require('sequelize');module[_0xb032('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb032('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xb032('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xb032('0x2')]},'original_sampleCount':{'type':Sequelize[_0xb032('0x3')]},'original_channelCount':{'type':Sequelize[_0xb032('0x4')]},'original_bitRate':{'type':Sequelize[_0xb032('0x3')]},'original_sampleRate':{'type':Sequelize[_0xb032('0x4')]},'converted_format':{'type':Sequelize[_0xb032('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xb032('0x3')]},'converted_channelCount':{'type':Sequelize[_0xb032('0x4')]},'converted_bitRate':{'type':Sequelize[_0xb032('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xb032('0x4')]}}; \ No newline at end of file +var _0x67b4=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x67b4,0x190));var _0x467b=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x67b4[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0x467b('0x0'));module[_0x467b('0x1')]={'name':{'type':Sequelize[_0x467b('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x467b('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x467b('0x2')]},'original_format':{'type':Sequelize[_0x467b('0x2')]},'original_duration':{'type':Sequelize[_0x467b('0x3')]},'original_sampleCount':{'type':Sequelize[_0x467b('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x467b('0x4')]},'original_sampleRate':{'type':Sequelize[_0x467b('0x5')]},'converted_format':{'type':Sequelize[_0x467b('0x2')]},'converted_duration':{'type':Sequelize[_0x467b('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x467b('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x467b('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x467b('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e1be049..e4bb526 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 _0x98c1=['attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','converted_format','existsSync','save_name','Sequelize','ValidationError','Sound\x20not\x20found','root','server/files/sounds/converted','%s.%s','format','create','file','originalname','extname','basename','filename','substring','join','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','body','role','user','UserProfileSection','userProfileId','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','Sounds','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields'];(function(_0x31a4ae,_0x441a83){var _0x24561a=function(_0x352cf9){while(--_0x352cf9){_0x31a4ae['push'](_0x31a4ae['shift']());}};_0x24561a(++_0x441a83);}(_0x98c1,0xc0));var _0x198c=function(_0x2c63ac,_0x1df97a){_0x2c63ac=_0x2c63ac-0x0;var _0xdf3040=_0x98c1[_0x2c63ac];return _0xdf3040;};'use strict';var emlformat=require(_0x198c('0x0'));var rimraf=require(_0x198c('0x1'));var zipdir=require(_0x198c('0x2'));var jsonpatch=require(_0x198c('0x3'));var rp=require(_0x198c('0x4'));var moment=require(_0x198c('0x5'));var BPromise=require(_0x198c('0x6'));var Mustache=require('mustache');var util=require(_0x198c('0x7'));var path=require('path');var sox=require(_0x198c('0x8'));var csv=require('to-csv');var ejs=require(_0x198c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x198c('0xa'));var crypto=require('crypto');var jsforce=require(_0x198c('0xb'));var deskjs=require(_0x198c('0xc'));var toCsv=require(_0x198c('0xd'));var querystring=require(_0x198c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x198c('0xf'));var as=require(_0x198c('0x10'));var hardwareService=require(_0x198c('0x11'));var logger=require(_0x198c('0x12'))(_0x198c('0x13'));var utils=require(_0x198c('0x14'));var config=require(_0x198c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x198c('0x16'))['db'];function respondWithStatusCode(_0x14c271,_0x372c2b){_0x372c2b=_0x372c2b||0xcc;return function(_0xa83c40){if(_0xa83c40){return _0x14c271['sendStatus'](_0x372c2b);}return _0x14c271[_0x198c('0x17')](_0x372c2b)[_0x198c('0x18')]();};}function respondWithResult(_0x229618,_0x35d72b){_0x35d72b=_0x35d72b||0xc8;return function(_0x2c5499){if(_0x2c5499){return _0x229618[_0x198c('0x17')](_0x35d72b)[_0x198c('0x19')](_0x2c5499);}};}function respondWithFilteredResult(_0x26d491,_0x5222c7){return function(_0x2a1a46){if(_0x2a1a46){var _0x21d946=typeof _0x5222c7[_0x198c('0x1a')]===_0x198c('0x1b')&&typeof _0x5222c7[_0x198c('0x1c')]===_0x198c('0x1b');var _0x13432a=_0x2a1a46['count'];var _0x3ce077=_0x21d946?0x0:_0x5222c7[_0x198c('0x1a')];var _0xfec499=_0x21d946?_0x2a1a46[_0x198c('0x1d')]:_0x5222c7['offset']+_0x5222c7[_0x198c('0x1c')];var _0x36b205;if(_0xfec499>=_0x13432a){_0xfec499=_0x13432a;_0x36b205=0xc8;}else{_0x36b205=0xce;}_0x26d491[_0x198c('0x17')](_0x36b205);return _0x26d491['set'](_0x198c('0x1e'),_0x3ce077+'-'+_0xfec499+'/'+_0x13432a)[_0x198c('0x19')](_0x2a1a46);}return null;};}function patchUpdates(_0x1e5a91){return function(_0x167266){try{jsonpatch[_0x198c('0x1f')](_0x167266,_0x1e5a91,!![]);}catch(_0x1bf646){return BPromise[_0x198c('0x20')](_0x1bf646);}return _0x167266[_0x198c('0x21')]();};}function saveUpdates(_0x359b49,_0x48e745){return function(_0x195be7){if(_0x195be7){return _0x195be7[_0x198c('0x22')](_0x359b49)['then'](function(_0x2eb651){return _0x2eb651;});}return null;};}function removeEntity(_0x16510b,_0x22e1b3){return function(_0x3f6c3f){if(_0x3f6c3f){return _0x3f6c3f[_0x198c('0x23')]()['then'](function(){var _0x24a152=_0x3f6c3f[_0x198c('0x24')]({'plain':!![]});var _0x4b6c04=_0x198c('0x25');return db[_0x198c('0x26')][_0x198c('0x23')]({'where':{'type':_0x4b6c04,'resourceId':_0x24a152['id']}})[_0x198c('0x27')](function(){return _0x3f6c3f;});})['then'](function(){_0x16510b[_0x198c('0x17')](0xcc)[_0x198c('0x18')]();});}};}function handleEntityNotFound(_0x4b9ed4,_0x4ade51){return function(_0x5c22b9){if(!_0x5c22b9){_0x4b9ed4[_0x198c('0x28')](0x194);}return _0x5c22b9;};}function handleError(_0x3efd7d,_0x42c281){_0x42c281=_0x42c281||0x1f4;return function(_0x1b7ee8){logger[_0x198c('0x29')](_0x1b7ee8[_0x198c('0x2a')]);if(_0x1b7ee8[_0x198c('0x2b')]){delete _0x1b7ee8[_0x198c('0x2b')];}_0x3efd7d[_0x198c('0x17')](_0x42c281)[_0x198c('0x2c')](_0x1b7ee8);};}exports[_0x198c('0x2d')]=function(_0x56bc25,_0x11115c){var _0x321aab={},_0x31afcc={},_0x292e2a={'count':0x0,'rows':[]};var _0x3a331d=_[_0x198c('0x2e')](db[_0x198c('0x2f')][_0x198c('0x30')],function(_0xff5fcd){return{'name':_0xff5fcd[_0x198c('0x31')],'type':_0xff5fcd[_0x198c('0x32')][_0x198c('0x33')]};});_0x31afcc[_0x198c('0x34')]=_[_0x198c('0x2e')](_0x3a331d,'name');_0x31afcc['query']=_[_0x198c('0x35')](_0x56bc25['query']);_0x31afcc[_0x198c('0x36')]=_['intersection'](_0x31afcc[_0x198c('0x34')],_0x31afcc[_0x198c('0x37')]);_0x321aab['attributes']=_[_0x198c('0x38')](_0x31afcc[_0x198c('0x34')],qs[_0x198c('0x39')](_0x56bc25[_0x198c('0x37')][_0x198c('0x39')]));_0x321aab[_0x198c('0x3a')]=_0x321aab[_0x198c('0x3a')][_0x198c('0x3b')]?_0x321aab[_0x198c('0x3a')]:_0x31afcc[_0x198c('0x34')];if(!_0x56bc25[_0x198c('0x37')][_0x198c('0x3c')](_0x198c('0x3d'))){_0x321aab['limit']=qs[_0x198c('0x1c')](_0x56bc25[_0x198c('0x37')][_0x198c('0x1c')]);_0x321aab[_0x198c('0x1a')]=qs[_0x198c('0x1a')](_0x56bc25[_0x198c('0x37')][_0x198c('0x1a')]);}_0x321aab[_0x198c('0x3e')]=qs['sort'](_0x56bc25[_0x198c('0x37')][_0x198c('0x3f')]);_0x321aab['where']=qs[_0x198c('0x36')](_[_0x198c('0x40')](_0x56bc25[_0x198c('0x37')],_0x31afcc[_0x198c('0x36')]),_0x3a331d);if(_0x56bc25[_0x198c('0x37')][_0x198c('0x41')]){_0x321aab['where']=_[_0x198c('0x42')](_0x321aab[_0x198c('0x43')],{'$or':_[_0x198c('0x2e')](_0x3a331d,function(_0x420a1b){if(_0x420a1b[_0x198c('0x32')]!==_0x198c('0x44')){var _0x3e0d7f={};_0x3e0d7f[_0x420a1b[_0x198c('0x2b')]]={'$like':'%'+_0x56bc25[_0x198c('0x37')]['filter']+'%'};return _0x3e0d7f;}})});}_0x321aab=_['merge']({},_0x321aab,_0x56bc25['options']);var _0x138b98={'where':_0x321aab[_0x198c('0x43')]};return db[_0x198c('0x2f')][_0x198c('0x1d')](_0x138b98)[_0x198c('0x27')](function(_0x53282d){_0x292e2a[_0x198c('0x1d')]=_0x53282d;if(_0x56bc25[_0x198c('0x37')][_0x198c('0x45')]){_0x321aab[_0x198c('0x46')]=[{'all':!![]}];}return db['Sound'][_0x198c('0x47')](_0x321aab);})[_0x198c('0x27')](function(_0x1b2b02){_0x292e2a[_0x198c('0x48')]=_0x1b2b02;return _0x292e2a;})[_0x198c('0x27')](respondWithFilteredResult(_0x11115c,_0x321aab))[_0x198c('0x49')](handleError(_0x11115c,null));};exports[_0x198c('0x4a')]=function(_0x170a34,_0x38f862){var _0x44b4dc={'raw':!![],'where':{'id':_0x170a34[_0x198c('0x4b')]['id']}},_0x14e5fa={};_0x14e5fa[_0x198c('0x34')]=_[_0x198c('0x35')](db[_0x198c('0x2f')]['rawAttributes']);_0x14e5fa[_0x198c('0x37')]=_[_0x198c('0x35')](_0x170a34[_0x198c('0x37')]);_0x14e5fa[_0x198c('0x36')]=_['intersection'](_0x14e5fa[_0x198c('0x34')],_0x14e5fa[_0x198c('0x37')]);_0x44b4dc[_0x198c('0x3a')]=_[_0x198c('0x38')](_0x14e5fa[_0x198c('0x34')],qs[_0x198c('0x39')](_0x170a34[_0x198c('0x37')][_0x198c('0x39')]));_0x44b4dc[_0x198c('0x3a')]=_0x44b4dc['attributes'][_0x198c('0x3b')]?_0x44b4dc[_0x198c('0x3a')]:_0x14e5fa[_0x198c('0x34')];if(_0x170a34[_0x198c('0x37')][_0x198c('0x45')]){_0x44b4dc[_0x198c('0x46')]=[{'all':!![]}];}_0x44b4dc=_[_0x198c('0x42')]({},_0x44b4dc,_0x170a34[_0x198c('0x4c')]);return db[_0x198c('0x2f')][_0x198c('0x4d')](_0x44b4dc)['then'](handleEntityNotFound(_0x38f862,null))[_0x198c('0x27')](respondWithResult(_0x38f862,null))['catch'](handleError(_0x38f862,null));};exports['download']=function(_0x3dcb8a,_0x4e8520,_0x1e0bc9){return db['Sound'][_0x198c('0x4d')]({'where':{'id':_0x3dcb8a[_0x198c('0x4b')]['id']},'attributes':[_0x198c('0x2b'),'save_name',_0x198c('0x4e')],'raw':!![]})[_0x198c('0x27')](handleEntityNotFound(_0x4e8520,null))[_0x198c('0x27')](function(_0x4dc70f){if(_0x4dc70f){if(!fs[_0x198c('0x4f')](path['join'](config['root'],'server/files/sounds/converted',_0x4dc70f[_0x198c('0x50')]+'.'+_0x4dc70f['converted_format']))){throw new db[(_0x198c('0x51'))][(_0x198c('0x52'))](_0x198c('0x53'));}return _0x4e8520['download'](path['join'](config[_0x198c('0x54')],_0x198c('0x55'),util['format'](_0x198c('0x56'),_0x4dc70f[_0x198c('0x50')],_0x4dc70f[_0x198c('0x4e')])),util[_0x198c('0x57')]('%s.%s',_0x4dc70f[_0x198c('0x2b')],_0x4dc70f[_0x198c('0x4e')]));}return null;})[_0x198c('0x49')](handleError(_0x4e8520,null));};exports[_0x198c('0x58')]=function(_0x21b48f,_0x54db38,_0x4c3d20){var _0x12ca23={'name':path['basename'](_0x21b48f[_0x198c('0x59')][_0x198c('0x5a')],path[_0x198c('0x5b')](_0x21b48f['file']['originalname'])),'save_name':path[_0x198c('0x5c')](_0x21b48f['file'][_0x198c('0x5d')],path[_0x198c('0x5b')](_0x21b48f[_0x198c('0x59')][_0x198c('0x5d')])),'original_format':path[_0x198c('0x5b')](_0x21b48f[_0x198c('0x59')][_0x198c('0x5a')])[_0x198c('0x5e')](0x1),'converted_format':'wav'};var _0x22f7c5=path[_0x198c('0x5f')](config[_0x198c('0x54')],_0x198c('0x60'),_0x21b48f[_0x198c('0x59')][_0x198c('0x5d')]);var _0x3542c0=path['join'](config[_0x198c('0x54')],_0x198c('0x55'),util[_0x198c('0x57')](_0x198c('0x56'),path['basename'](_0x21b48f[_0x198c('0x59')][_0x198c('0x5d')],path['extname'](_0x21b48f['file'][_0x198c('0x5d')])),_0x12ca23[_0x198c('0x4e')]));logger[_0x198c('0x61')](_0x198c('0x62'),_0x22f7c5);logger['info'](_0x198c('0x63'),_0x3542c0);try{fs['chmodSync'](_0x22f7c5,parseInt('0777',0x8));var _0xe8ae43=sox[_0x198c('0x64')](_0x22f7c5,_0x3542c0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xe8ae43['on'](_0x198c('0x29'),function(_0x575d23){fs[_0x198c('0x65')](_0x22f7c5);_0x54db38[_0x198c('0x17')](0x1f4)[_0x198c('0x2c')](_0x575d23);});_0xe8ae43['on'](_0x198c('0x66'),function(_0x2f54e3){_0x12ca23[_0x198c('0x67')]=isNaN(_0x2f54e3[_0x198c('0x68')])?null:_0x2f54e3[_0x198c('0x68')]*0x3e8;_0x12ca23[_0x198c('0x69')]=isNaN(_0x2f54e3[_0x198c('0x6a')])?null:_0x2f54e3[_0x198c('0x6a')];_0x12ca23[_0x198c('0x6b')]=isNaN(_0x2f54e3['channelCount'])?null:_0x2f54e3[_0x198c('0x6c')];_0x12ca23['original_bitRate']=isNaN(_0x2f54e3[_0x198c('0x6d')])?null:_0x2f54e3['bitRate'];_0x12ca23[_0x198c('0x6e')]=isNaN(_0x2f54e3[_0x198c('0x6f')])?null:_0x2f54e3[_0x198c('0x6f')];});_0xe8ae43['on']('dest',function(_0x36a2e5){_0x12ca23[_0x198c('0x70')]=isNaN(_0x36a2e5[_0x198c('0x68')])?null:_0x36a2e5[_0x198c('0x68')]*0x3e8;_0x12ca23[_0x198c('0x71')]=isNaN(_0x36a2e5['sampleCount'])?null:_0x36a2e5[_0x198c('0x6a')];_0x12ca23[_0x198c('0x72')]=isNaN(_0x36a2e5['channelCount'])?null:_0x36a2e5[_0x198c('0x6c')];_0x12ca23[_0x198c('0x73')]=isNaN(_0x36a2e5['bitRate'])?null:_0x36a2e5[_0x198c('0x6d')];_0x12ca23['converted_sampleRate']=isNaN(_0x36a2e5['sampleRate'])?null:_0x36a2e5[_0x198c('0x6f')];});_0xe8ae43['on'](_0x198c('0x18'),function(){fs[_0x198c('0x74')](_0x3542c0,parseInt('0777',0x8));return db[_0x198c('0x2f')]['create'](_0x12ca23)[_0x198c('0x27')](function(_0x2800ee){var _0x22b0c5={'role':_0x21b48f[_0x198c('0x75')]['role'],'userProfileId':_0x21b48f[_0x198c('0x75')]['userProfileId']};if(!_0x22b0c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22b0c5[_0x198c('0x76')]===_0x198c('0x77')){var _0x596e05=_0x2800ee[_0x198c('0x24')]({'plain':!![]});return db[_0x198c('0x78')]['find']({'where':{'name':_0x198c('0x25'),'userProfileId':_0x22b0c5[_0x198c('0x79')]},'raw':!![]})[_0x198c('0x27')](function(_0x22504b){if(_0x22504b&&_0x22504b['autoAssociation']===0x0){return db[_0x198c('0x26')][_0x198c('0x58')]({'name':_0x596e05[_0x198c('0x2b')],'resourceId':_0x596e05['id'],'type':_0x22504b['name'],'sectionId':_0x22504b['id']},{})[_0x198c('0x27')](function(){return _0x2800ee;});}else{return _0x2800ee;}})[_0x198c('0x49')](function(_0x318b59){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x318b59);throw _0x318b59;});}return _0x2800ee;})[_0x198c('0x27')](respondWithResult(_0x54db38,null))[_0x198c('0x49')](handleError(_0x54db38,null));});_0xe8ae43['start']();}catch(_0x4b4f51){_0x54db38['status'](0x1f4)[_0x198c('0x2c')](_0x4b4f51);}};exports[_0x198c('0x22')]=function(_0x35714c,_0x85dbf8,_0x2f3730){return db[_0x198c('0x2f')][_0x198c('0x4d')]({'where':{'id':_0x35714c['params']['id']}})[_0x198c('0x27')](handleEntityNotFound(_0x85dbf8,null))[_0x198c('0x27')](saveUpdates(_[_0x198c('0x40')](_0x35714c[_0x198c('0x75')],[_0x198c('0x2b'),_0x198c('0x7a')]),null))['then'](respondWithResult(_0x85dbf8,null))[_0x198c('0x49')](handleError(_0x85dbf8,null));};exports[_0x198c('0x7b')]=function(_0x48b678,_0x5c7ea3,_0x4f0c1d){return db[_0x198c('0x2f')][_0x198c('0x4d')]({'where':{'id':_0x48b678[_0x198c('0x4b')]['id']}})['then'](function(_0x9b2c89){if(_0x9b2c89){return _0x9b2c89[_0x198c('0x23')]();}})[_0x198c('0x27')](function(_0x237659){var _0x30f486=path[_0x198c('0x5f')](config[_0x198c('0x54')],_0x198c('0x60'),util[_0x198c('0x57')]('%s.%s',_0x237659['save_name'],_0x237659[_0x198c('0x7c')]));var _0x208d77=path[_0x198c('0x5f')](config[_0x198c('0x54')],_0x198c('0x55'),util['format'](_0x198c('0x56'),_0x237659['save_name'],_0x237659['converted_format']));fs[_0x198c('0x65')](_0x30f486);fs['unlinkSync'](_0x208d77);return _0x237659;})[_0x198c('0x27')](function(_0x1bfaa8){if(_0x1bfaa8){return _0x5c7ea3[_0x198c('0x17')](0xcc)[_0x198c('0x18')]();}})[_0x198c('0x27')](handleEntityNotFound(_0x5c7ea3,null))[_0x198c('0x49')](handleError(_0x5c7ea3,null));}; \ No newline at end of file +var _0x9893=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','save_name','converted_format','existsSync','root','Sequelize','ValidationError','download','server/files/sounds/converted','format','%s.%s','create','basename','originalname','file','filename','extname','wav','join','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','user','autoAssociation','error','start','delete','original_format','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','Sounds','UserProfileResource','name','send','map','Sound','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x5aaa4a,_0x2d9a37){var _0x493e2a=function(_0x5bae48){while(--_0x5bae48){_0x5aaa4a['push'](_0x5aaa4a['shift']());}};_0x493e2a(++_0x2d9a37);}(_0x9893,0xbd));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3989('0x0'));var zipdir=require(_0x3989('0x1'));var jsonpatch=require(_0x3989('0x2'));var rp=require(_0x3989('0x3'));var moment=require('moment');var BPromise=require(_0x3989('0x4'));var Mustache=require(_0x3989('0x5'));var util=require(_0x3989('0x6'));var path=require(_0x3989('0x7'));var sox=require(_0x3989('0x8'));var csv=require(_0x3989('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3989('0xa'));var _=require(_0x3989('0xb'));var squel=require(_0x3989('0xc'));var crypto=require(_0x3989('0xd'));var jsforce=require(_0x3989('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3989('0xf'));var Papa=require(_0x3989('0x10'));var Redis=require(_0x3989('0x11'));var authService=require(_0x3989('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3989('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3989('0x14'))(_0x3989('0x15'));var utils=require(_0x3989('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3989('0x17'));var db=require(_0x3989('0x18'))['db'];function respondWithStatusCode(_0x5632a4,_0x1ed12a){_0x1ed12a=_0x1ed12a||0xcc;return function(_0x5920d6){if(_0x5920d6){return _0x5632a4[_0x3989('0x19')](_0x1ed12a);}return _0x5632a4[_0x3989('0x1a')](_0x1ed12a)[_0x3989('0x1b')]();};}function respondWithResult(_0x37a185,_0x3d7c68){_0x3d7c68=_0x3d7c68||0xc8;return function(_0x3be748){if(_0x3be748){return _0x37a185[_0x3989('0x1a')](_0x3d7c68)['json'](_0x3be748);}};}function respondWithFilteredResult(_0x37ea11,_0x504510){return function(_0x214d1a){if(_0x214d1a){var _0x767bb=typeof _0x504510[_0x3989('0x1c')]===_0x3989('0x1d')&&typeof _0x504510[_0x3989('0x1e')]===_0x3989('0x1d');var _0x3c449b=_0x214d1a[_0x3989('0x1f')];var _0x2e0100=_0x767bb?0x0:_0x504510[_0x3989('0x1c')];var _0x5838cc=_0x767bb?_0x214d1a[_0x3989('0x1f')]:_0x504510[_0x3989('0x1c')]+_0x504510[_0x3989('0x1e')];var _0x47d014;if(_0x5838cc>=_0x3c449b){_0x5838cc=_0x3c449b;_0x47d014=0xc8;}else{_0x47d014=0xce;}_0x37ea11[_0x3989('0x1a')](_0x47d014);return _0x37ea11[_0x3989('0x20')](_0x3989('0x21'),_0x2e0100+'-'+_0x5838cc+'/'+_0x3c449b)[_0x3989('0x22')](_0x214d1a);}return null;};}function patchUpdates(_0x108bdb){return function(_0x3851a7){try{jsonpatch[_0x3989('0x23')](_0x3851a7,_0x108bdb,!![]);}catch(_0x2a07cc){return BPromise[_0x3989('0x24')](_0x2a07cc);}return _0x3851a7[_0x3989('0x25')]();};}function saveUpdates(_0x4bad02,_0x3a83d6){return function(_0x18e39c){if(_0x18e39c){return _0x18e39c[_0x3989('0x26')](_0x4bad02)['then'](function(_0x51c96c){return _0x51c96c;});}return null;};}function removeEntity(_0x59a836,_0x1544a3){return function(_0xad96af){if(_0xad96af){return _0xad96af[_0x3989('0x27')]()[_0x3989('0x28')](function(){var _0x5528e1=_0xad96af['get']({'plain':!![]});var _0x4ad582=_0x3989('0x29');return db[_0x3989('0x2a')][_0x3989('0x27')]({'where':{'type':_0x4ad582,'resourceId':_0x5528e1['id']}})[_0x3989('0x28')](function(){return _0xad96af;});})[_0x3989('0x28')](function(){_0x59a836['status'](0xcc)[_0x3989('0x1b')]();});}};}function handleEntityNotFound(_0x3409ec,_0xcfe91a){return function(_0xd6e788){if(!_0xd6e788){_0x3409ec[_0x3989('0x19')](0x194);}return _0xd6e788;};}function handleError(_0x404fa0,_0x4e9661){_0x4e9661=_0x4e9661||0x1f4;return function(_0x2d45bf){logger['error'](_0x2d45bf['stack']);if(_0x2d45bf[_0x3989('0x2b')]){delete _0x2d45bf[_0x3989('0x2b')];}_0x404fa0['status'](_0x4e9661)[_0x3989('0x2c')](_0x2d45bf);};}exports['index']=function(_0x424443,_0x1cf1b4){var _0x26ac5e={},_0x2b10d7={},_0x2f5013={'count':0x0,'rows':[]};var _0x234053=_[_0x3989('0x2d')](db[_0x3989('0x2e')]['rawAttributes'],function(_0xdba624){return{'name':_0xdba624[_0x3989('0x2f')],'type':_0xdba624[_0x3989('0x30')]['key']};});_0x2b10d7[_0x3989('0x31')]=_['map'](_0x234053,_0x3989('0x2b'));_0x2b10d7[_0x3989('0x32')]=_[_0x3989('0x33')](_0x424443['query']);_0x2b10d7[_0x3989('0x34')]=_['intersection'](_0x2b10d7['model'],_0x2b10d7[_0x3989('0x32')]);_0x26ac5e[_0x3989('0x35')]=_[_0x3989('0x36')](_0x2b10d7['model'],qs['fields'](_0x424443[_0x3989('0x32')][_0x3989('0x37')]));_0x26ac5e[_0x3989('0x35')]=_0x26ac5e[_0x3989('0x35')][_0x3989('0x38')]?_0x26ac5e[_0x3989('0x35')]:_0x2b10d7['model'];if(!_0x424443[_0x3989('0x32')][_0x3989('0x39')](_0x3989('0x3a'))){_0x26ac5e['limit']=qs[_0x3989('0x1e')](_0x424443[_0x3989('0x32')][_0x3989('0x1e')]);_0x26ac5e[_0x3989('0x1c')]=qs['offset'](_0x424443[_0x3989('0x32')][_0x3989('0x1c')]);}_0x26ac5e[_0x3989('0x3b')]=qs[_0x3989('0x3c')](_0x424443[_0x3989('0x32')][_0x3989('0x3c')]);_0x26ac5e[_0x3989('0x3d')]=qs['filters'](_[_0x3989('0x3e')](_0x424443[_0x3989('0x32')],_0x2b10d7[_0x3989('0x34')]),_0x234053);if(_0x424443['query'][_0x3989('0x3f')]){_0x26ac5e[_0x3989('0x3d')]=_[_0x3989('0x40')](_0x26ac5e['where'],{'$or':_['map'](_0x234053,function(_0x26e8fa){if(_0x26e8fa[_0x3989('0x30')]!==_0x3989('0x41')){var _0x9903d5={};_0x9903d5[_0x26e8fa['name']]={'$like':'%'+_0x424443[_0x3989('0x32')]['filter']+'%'};return _0x9903d5;}})});}_0x26ac5e=_[_0x3989('0x40')]({},_0x26ac5e,_0x424443[_0x3989('0x42')]);var _0x5f46d9={'where':_0x26ac5e[_0x3989('0x3d')]};return db['Sound'][_0x3989('0x1f')](_0x5f46d9)[_0x3989('0x28')](function(_0x44023f){_0x2f5013[_0x3989('0x1f')]=_0x44023f;if(_0x424443[_0x3989('0x32')][_0x3989('0x43')]){_0x26ac5e['include']=[{'all':!![]}];}return db[_0x3989('0x2e')][_0x3989('0x44')](_0x26ac5e);})['then'](function(_0x267fa3){_0x2f5013[_0x3989('0x45')]=_0x267fa3;return _0x2f5013;})[_0x3989('0x28')](respondWithFilteredResult(_0x1cf1b4,_0x26ac5e))[_0x3989('0x46')](handleError(_0x1cf1b4,null));};exports[_0x3989('0x47')]=function(_0xddcf48,_0x53ec1b){var _0x223564={'raw':!![],'where':{'id':_0xddcf48[_0x3989('0x48')]['id']}},_0x15b774={};_0x15b774[_0x3989('0x31')]=_[_0x3989('0x33')](db[_0x3989('0x2e')][_0x3989('0x49')]);_0x15b774['query']=_[_0x3989('0x33')](_0xddcf48[_0x3989('0x32')]);_0x15b774[_0x3989('0x34')]=_['intersection'](_0x15b774[_0x3989('0x31')],_0x15b774['query']);_0x223564[_0x3989('0x35')]=_[_0x3989('0x36')](_0x15b774['model'],qs[_0x3989('0x37')](_0xddcf48[_0x3989('0x32')][_0x3989('0x37')]));_0x223564[_0x3989('0x35')]=_0x223564['attributes']['length']?_0x223564[_0x3989('0x35')]:_0x15b774['model'];if(_0xddcf48[_0x3989('0x32')][_0x3989('0x43')]){_0x223564[_0x3989('0x4a')]=[{'all':!![]}];}_0x223564=_['merge']({},_0x223564,_0xddcf48[_0x3989('0x42')]);return db[_0x3989('0x2e')][_0x3989('0x4b')](_0x223564)[_0x3989('0x28')](handleEntityNotFound(_0x53ec1b,null))[_0x3989('0x28')](respondWithResult(_0x53ec1b,null))[_0x3989('0x46')](handleError(_0x53ec1b,null));};exports['download']=function(_0x4020c8,_0x5146a4,_0x2b5586){return db[_0x3989('0x2e')][_0x3989('0x4b')]({'where':{'id':_0x4020c8['params']['id']},'attributes':[_0x3989('0x2b'),_0x3989('0x4c'),_0x3989('0x4d')],'raw':!![]})[_0x3989('0x28')](handleEntityNotFound(_0x5146a4,null))[_0x3989('0x28')](function(_0x579a9b){if(_0x579a9b){if(!fs[_0x3989('0x4e')](path['join'](config[_0x3989('0x4f')],'server/files/sounds/converted',_0x579a9b['save_name']+'.'+_0x579a9b[_0x3989('0x4d')]))){throw new db[(_0x3989('0x50'))][(_0x3989('0x51'))]('Sound\x20not\x20found');}return _0x5146a4[_0x3989('0x52')](path['join'](config[_0x3989('0x4f')],_0x3989('0x53'),util[_0x3989('0x54')]('%s.%s',_0x579a9b[_0x3989('0x4c')],_0x579a9b[_0x3989('0x4d')])),util['format'](_0x3989('0x55'),_0x579a9b[_0x3989('0x2b')],_0x579a9b[_0x3989('0x4d')]));}return null;})['catch'](handleError(_0x5146a4,null));};exports[_0x3989('0x56')]=function(_0x10e8dd,_0x22b932,_0x540f73){var _0x36689c={'name':path[_0x3989('0x57')](_0x10e8dd['file'][_0x3989('0x58')],path['extname'](_0x10e8dd[_0x3989('0x59')][_0x3989('0x58')])),'save_name':path[_0x3989('0x57')](_0x10e8dd[_0x3989('0x59')][_0x3989('0x5a')],path[_0x3989('0x5b')](_0x10e8dd['file'][_0x3989('0x5a')])),'original_format':path[_0x3989('0x5b')](_0x10e8dd[_0x3989('0x59')][_0x3989('0x58')])['substring'](0x1),'converted_format':_0x3989('0x5c')};var _0x78129c=path[_0x3989('0x5d')](config['root'],_0x3989('0x5e'),_0x10e8dd[_0x3989('0x59')][_0x3989('0x5a')]);var _0x2db6fe=path[_0x3989('0x5d')](config['root'],'server/files/sounds/converted',util[_0x3989('0x54')](_0x3989('0x55'),path[_0x3989('0x57')](_0x10e8dd[_0x3989('0x59')][_0x3989('0x5a')],path[_0x3989('0x5b')](_0x10e8dd['file'][_0x3989('0x5a')])),_0x36689c[_0x3989('0x4d')]));logger['info'](_0x3989('0x5f'),_0x78129c);logger[_0x3989('0x60')](_0x3989('0x61'),_0x2db6fe);try{fs[_0x3989('0x62')](_0x78129c,parseInt(_0x3989('0x63'),0x8));var _0x411e03=sox[_0x3989('0x64')](_0x78129c,_0x2db6fe,{'sampleRate':0x1f40,'format':_0x3989('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x411e03['on']('error',function(_0x3e298f){fs['unlinkSync'](_0x78129c);_0x22b932['status'](0x1f4)[_0x3989('0x2c')](_0x3e298f);});_0x411e03['on'](_0x3989('0x65'),function(_0x4651cc){_0x36689c['original_duration']=isNaN(_0x4651cc['duration'])?null:_0x4651cc[_0x3989('0x66')]*0x3e8;_0x36689c['original_sampleCount']=isNaN(_0x4651cc['sampleCount'])?null:_0x4651cc[_0x3989('0x67')];_0x36689c['original_channelCount']=isNaN(_0x4651cc['channelCount'])?null:_0x4651cc[_0x3989('0x68')];_0x36689c[_0x3989('0x69')]=isNaN(_0x4651cc['bitRate'])?null:_0x4651cc[_0x3989('0x6a')];_0x36689c[_0x3989('0x6b')]=isNaN(_0x4651cc[_0x3989('0x6c')])?null:_0x4651cc[_0x3989('0x6c')];});_0x411e03['on'](_0x3989('0x6d'),function(_0x4671ff){_0x36689c[_0x3989('0x6e')]=isNaN(_0x4671ff[_0x3989('0x66')])?null:_0x4671ff[_0x3989('0x66')]*0x3e8;_0x36689c['converted_sampleCount']=isNaN(_0x4671ff[_0x3989('0x67')])?null:_0x4671ff[_0x3989('0x67')];_0x36689c[_0x3989('0x6f')]=isNaN(_0x4671ff['channelCount'])?null:_0x4671ff[_0x3989('0x68')];_0x36689c[_0x3989('0x70')]=isNaN(_0x4671ff[_0x3989('0x6a')])?null:_0x4671ff['bitRate'];_0x36689c[_0x3989('0x71')]=isNaN(_0x4671ff['sampleRate'])?null:_0x4671ff[_0x3989('0x6c')];});_0x411e03['on'](_0x3989('0x1b'),function(){fs[_0x3989('0x62')](_0x2db6fe,parseInt(_0x3989('0x63'),0x8));return db[_0x3989('0x2e')][_0x3989('0x56')](_0x36689c)[_0x3989('0x28')](function(_0x272852){var _0x4e0746={'role':_0x10e8dd[_0x3989('0x72')][_0x3989('0x73')],'userProfileId':_0x10e8dd[_0x3989('0x72')][_0x3989('0x74')]};if(!_0x4e0746)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e0746[_0x3989('0x73')]===_0x3989('0x75')){var _0x1413a9=_0x272852['get']({'plain':!![]});return db['UserProfileSection'][_0x3989('0x4b')]({'where':{'name':'Sounds','userProfileId':_0x4e0746[_0x3989('0x74')]},'raw':!![]})[_0x3989('0x28')](function(_0x57c87e){if(_0x57c87e&&_0x57c87e[_0x3989('0x76')]===0x0){return db[_0x3989('0x2a')][_0x3989('0x56')]({'name':_0x1413a9['name'],'resourceId':_0x1413a9['id'],'type':_0x57c87e['name'],'sectionId':_0x57c87e['id']},{})[_0x3989('0x28')](function(){return _0x272852;});}else{return _0x272852;}})[_0x3989('0x46')](function(_0x5ac292){logger[_0x3989('0x77')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ac292);throw _0x5ac292;});}return _0x272852;})[_0x3989('0x28')](respondWithResult(_0x22b932,null))[_0x3989('0x46')](handleError(_0x22b932,null));});_0x411e03[_0x3989('0x78')]();}catch(_0xd30dfc){_0x22b932[_0x3989('0x1a')](0x1f4)['send'](_0xd30dfc);}};exports[_0x3989('0x26')]=function(_0x29738e,_0x1124c4,_0x42a89c){return db['Sound'][_0x3989('0x4b')]({'where':{'id':_0x29738e[_0x3989('0x48')]['id']}})['then'](handleEntityNotFound(_0x1124c4,null))[_0x3989('0x28')](saveUpdates(_[_0x3989('0x3e')](_0x29738e['body'],['name','description']),null))[_0x3989('0x28')](respondWithResult(_0x1124c4,null))[_0x3989('0x46')](handleError(_0x1124c4,null));};exports[_0x3989('0x79')]=function(_0x34bd7e,_0x4bce9c,_0x4840e1){return db[_0x3989('0x2e')][_0x3989('0x4b')]({'where':{'id':_0x34bd7e[_0x3989('0x48')]['id']}})[_0x3989('0x28')](function(_0x19f9bf){if(_0x19f9bf){return _0x19f9bf[_0x3989('0x27')]();}})[_0x3989('0x28')](function(_0x2fb650){var _0x183b29=path[_0x3989('0x5d')](config['root'],_0x3989('0x5e'),util[_0x3989('0x54')](_0x3989('0x55'),_0x2fb650['save_name'],_0x2fb650[_0x3989('0x7a')]));var _0x4735e3=path[_0x3989('0x5d')](config[_0x3989('0x4f')],_0x3989('0x53'),util[_0x3989('0x54')](_0x3989('0x55'),_0x2fb650[_0x3989('0x4c')],_0x2fb650[_0x3989('0x4d')]));fs[_0x3989('0x7b')](_0x183b29);fs[_0x3989('0x7b')](_0x4735e3);return _0x2fb650;})[_0x3989('0x28')](function(_0x107aac){if(_0x107aac){return _0x4bce9c[_0x3989('0x1a')](0xcc)[_0x3989('0x1b')]();}})[_0x3989('0x28')](handleEntityNotFound(_0x4bce9c,null))['catch'](handleError(_0x4bce9c,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a8107e2..54fd382 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 _0xf595=['bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','moment'];(function(_0x166b37,_0xa7013d){var _0x151f5b=function(_0x390125){while(--_0x390125){_0x166b37['push'](_0x166b37['shift']());}};_0x151f5b(++_0xa7013d);}(_0xf595,0x15a));var _0x5f59=function(_0x185d4d,_0x476164){_0x185d4d=_0x185d4d-0x0;var _0x437e20=_0xf595[_0x185d4d];return _0x437e20;};'use strict';var _=require(_0x5f59('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5f59('0x1'));var BPromise=require(_0x5f59('0x2'));var rp=require(_0x5f59('0x3'));var fs=require('fs');var path=require(_0x5f59('0x4'));var rimraf=require(_0x5f59('0x5'));var config=require(_0x5f59('0x6'));var attributes=require(_0x5f59('0x7'));module[_0x5f59('0x8')]=function(_0x236ff2,_0x5bf055){return _0x236ff2[_0x5f59('0x9')](_0x5f59('0xa'),attributes,{'tableName':_0x5f59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ec9=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0xb2881e,_0x49ef92){var _0x3abeda=function(_0x423bfa){while(--_0x423bfa){_0xb2881e['push'](_0xb2881e['shift']());}};_0x3abeda(++_0x49ef92);}(_0x9ec9,0x15f));var _0x99ec=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0x9ec9[_0x5c84a6];return _0xb8c5f0;};'use strict';var _=require(_0x99ec('0x0'));var util=require('util');var logger=require(_0x99ec('0x1'))(_0x99ec('0x2'));var moment=require('moment');var BPromise=require(_0x99ec('0x3'));var rp=require(_0x99ec('0x4'));var fs=require('fs');var path=require(_0x99ec('0x5'));var rimraf=require(_0x99ec('0x6'));var config=require(_0x99ec('0x7'));var attributes=require(_0x99ec('0x8'));module[_0x99ec('0x9')]=function(_0x1488b9,_0x1fca67){return _0x1488b9[_0x99ec('0xa')](_0x99ec('0xb'),attributes,{'tableName':_0x99ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 85ffe5d..8a9d7fe 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 _0xb697=['attributes','include','map','model','ShowSound','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','raw','options','where'];(function(_0x3b3198,_0x391311){var _0x51f1e5=function(_0x29611c){while(--_0x29611c){_0x3b3198['push'](_0x3b3198['shift']());}};_0x51f1e5(++_0x391311);}(_0xb697,0x19d));var _0x7b69=function(_0x15b093,_0x599a2e){_0x15b093=_0x15b093-0x0;var _0x35001f=_0xb697[_0x15b093];return _0x35001f;};'use strict';var _=require(_0x7b69('0x0'));var util=require('util');var moment=require(_0x7b69('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b69('0x2'));var fs=require('fs');var Redis=require(_0x7b69('0x3'));var db=require(_0x7b69('0x4'))['db'];var utils=require(_0x7b69('0x5'));var logger=require(_0x7b69('0x6'))(_0x7b69('0x7'));var config=require(_0x7b69('0x8'));var jayson=require(_0x7b69('0x9'));var client=jayson[_0x7b69('0xa')][_0x7b69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab00e4,_0x29c3aa,_0x1fd07f){return new BPromise(function(_0x1888ac,_0x5097f5){return client[_0x7b69('0xc')](_0xab00e4,_0x1fd07f)[_0x7b69('0xd')](function(_0x271b49){logger[_0x7b69('0xe')](_0x7b69('0xf'),_0x29c3aa,_0x7b69('0x10'));logger[_0x7b69('0x11')](_0x7b69('0x12'),_0x29c3aa,'request\x20sent',JSON[_0x7b69('0x13')](_0x271b49));if(_0x271b49[_0x7b69('0x14')]){if(_0x271b49['error'][_0x7b69('0x15')]===0x1f4){logger[_0x7b69('0x14')](_0x7b69('0xf'),_0x29c3aa,_0x271b49['error'][_0x7b69('0x16')]);return _0x5097f5(_0x271b49[_0x7b69('0x14')][_0x7b69('0x16')]);}logger[_0x7b69('0x14')](_0x7b69('0xf'),_0x29c3aa,_0x271b49['error']['message']);return _0x1888ac(_0x271b49['error'][_0x7b69('0x16')]);}else{logger[_0x7b69('0xe')](_0x7b69('0xf'),_0x29c3aa,'request\x20sent');_0x1888ac(_0x271b49[_0x7b69('0x17')][_0x7b69('0x16')]);}})[_0x7b69('0x18')](function(_0xf4866f){logger[_0x7b69('0x14')](_0x7b69('0xf'),_0x29c3aa,_0xf4866f);_0x5097f5(_0xf4866f);});});}exports['ShowSound']=function(_0x5c42ed){var _0x435dda=this;return new Promise(function(_0x7fdcc2,_0x4e6b59){return db[_0x7b69('0x19')]['find']({'raw':_0x5c42ed['options']?_0x5c42ed['options'][_0x7b69('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c42ed[_0x7b69('0x1b')]?_0x5c42ed['options'][_0x7b69('0x1c')]||null:null,'attributes':_0x5c42ed[_0x7b69('0x1b')]?_0x5c42ed[_0x7b69('0x1b')][_0x7b69('0x1d')]||null:null,'include':_0x5c42ed[_0x7b69('0x1b')]?_0x5c42ed['options'][_0x7b69('0x1e')]?_[_0x7b69('0x1f')](_0x5c42ed[_0x7b69('0x1b')][_0x7b69('0x1e')],function(_0x4ace8e){return{'model':db[_0x4ace8e[_0x7b69('0x20')]],'as':_0x4ace8e['as'],'attributes':_0x4ace8e[_0x7b69('0x1d')],'include':_0x4ace8e[_0x7b69('0x1e')]?_[_0x7b69('0x1f')](_0x4ace8e[_0x7b69('0x1e')],function(_0x52de8c){return{'model':db[_0x52de8c['model']],'as':_0x52de8c['as'],'attributes':_0x52de8c[_0x7b69('0x1d')],'include':_0x52de8c[_0x7b69('0x1e')]?_[_0x7b69('0x1f')](_0x52de8c[_0x7b69('0x1e')],function(_0x484e82){return{'model':db[_0x484e82[_0x7b69('0x20')]],'as':_0x484e82['as'],'attributes':_0x484e82['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b69('0xd')](function(_0x54f01b){logger[_0x7b69('0xe')](_0x7b69('0x21'),_0x5c42ed);logger[_0x7b69('0x11')](_0x7b69('0x21'),_0x5c42ed,JSON[_0x7b69('0x13')](_0x54f01b));_0x7fdcc2(_0x54f01b);})[_0x7b69('0x18')](function(_0x17d3ea){logger[_0x7b69('0x14')](_0x7b69('0x21'),_0x17d3ea[_0x7b69('0x16')],_0x5c42ed);_0x4e6b59(_0x435dda['error'](0x1f4,_0x17d3ea[_0x7b69('0x16')]));});});}; \ No newline at end of file +var _0x6bd9=['include','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','options','raw','attributes','map'];(function(_0x40f26c,_0x44ff27){var _0x226fa9=function(_0x47f9e6){while(--_0x47f9e6){_0x40f26c['push'](_0x40f26c['shift']());}};_0x226fa9(++_0x44ff27);}(_0x6bd9,0xa3));var _0x96bd=function(_0x2f69c5,_0x5016f9){_0x2f69c5=_0x2f69c5-0x0;var _0x5a1c05=_0x6bd9[_0x2f69c5];return _0x5a1c05;};'use strict';var _=require('lodash');var util=require(_0x96bd('0x0'));var moment=require(_0x96bd('0x1'));var BPromise=require(_0x96bd('0x2'));var rs=require(_0x96bd('0x3'));var fs=require('fs');var Redis=require(_0x96bd('0x4'));var db=require(_0x96bd('0x5'))['db'];var utils=require(_0x96bd('0x6'));var logger=require(_0x96bd('0x7'))(_0x96bd('0x8'));var config=require(_0x96bd('0x9'));var jayson=require(_0x96bd('0xa'));var client=jayson['client'][_0x96bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3c39,_0x225639,_0x26fe51){return new BPromise(function(_0x5530f9,_0x49fa11){return client[_0x96bd('0xc')](_0x5d3c39,_0x26fe51)[_0x96bd('0xd')](function(_0x3d75c8){logger[_0x96bd('0xe')](_0x96bd('0xf'),_0x225639,_0x96bd('0x10'));logger[_0x96bd('0x11')](_0x96bd('0x12'),_0x225639,_0x96bd('0x10'),JSON['stringify'](_0x3d75c8));if(_0x3d75c8[_0x96bd('0x13')]){if(_0x3d75c8[_0x96bd('0x13')][_0x96bd('0x14')]===0x1f4){logger['error'](_0x96bd('0xf'),_0x225639,_0x3d75c8[_0x96bd('0x13')][_0x96bd('0x15')]);return _0x49fa11(_0x3d75c8[_0x96bd('0x13')]['message']);}logger[_0x96bd('0x13')]('Sound,\x20%s,\x20%s',_0x225639,_0x3d75c8[_0x96bd('0x13')]['message']);return _0x5530f9(_0x3d75c8['error']['message']);}else{logger[_0x96bd('0xe')](_0x96bd('0xf'),_0x225639,_0x96bd('0x10'));_0x5530f9(_0x3d75c8[_0x96bd('0x16')][_0x96bd('0x15')]);}})[_0x96bd('0x17')](function(_0x585414){logger[_0x96bd('0x13')]('Sound,\x20%s,\x20%s',_0x225639,_0x585414);_0x49fa11(_0x585414);});});}exports[_0x96bd('0x18')]=function(_0x11dadf){var _0x2a4cf7=this;return new Promise(function(_0x9622c4,_0x1842b3){return db['Sound']['find']({'raw':_0x11dadf[_0x96bd('0x19')]?_0x11dadf['options'][_0x96bd('0x1a')]===undefined?!![]:![]:!![],'where':_0x11dadf[_0x96bd('0x19')]?_0x11dadf[_0x96bd('0x19')]['where']||null:null,'attributes':_0x11dadf[_0x96bd('0x19')]?_0x11dadf[_0x96bd('0x19')][_0x96bd('0x1b')]||null:null,'include':_0x11dadf[_0x96bd('0x19')]?_0x11dadf[_0x96bd('0x19')]['include']?_[_0x96bd('0x1c')](_0x11dadf[_0x96bd('0x19')][_0x96bd('0x1d')],function(_0xaa634e){return{'model':db[_0xaa634e[_0x96bd('0x1e')]],'as':_0xaa634e['as'],'attributes':_0xaa634e[_0x96bd('0x1b')],'include':_0xaa634e[_0x96bd('0x1d')]?_[_0x96bd('0x1c')](_0xaa634e[_0x96bd('0x1d')],function(_0x2b03fd){return{'model':db[_0x2b03fd[_0x96bd('0x1e')]],'as':_0x2b03fd['as'],'attributes':_0x2b03fd['attributes'],'include':_0x2b03fd[_0x96bd('0x1d')]?_[_0x96bd('0x1c')](_0x2b03fd[_0x96bd('0x1d')],function(_0x5ad69a){return{'model':db[_0x5ad69a[_0x96bd('0x1e')]],'as':_0x5ad69a['as'],'attributes':_0x5ad69a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x341cb5){logger[_0x96bd('0xe')](_0x96bd('0x18'),_0x11dadf);logger[_0x96bd('0x11')](_0x96bd('0x18'),_0x11dadf,JSON[_0x96bd('0x1f')](_0x341cb5));_0x9622c4(_0x341cb5);})[_0x96bd('0x17')](function(_0x5337e6){logger['error'](_0x96bd('0x18'),_0x5337e6[_0x96bd('0x15')],_0x11dadf);_0x1842b3(_0x2a4cf7[_0x96bd('0x13')](0x1f4,_0x5337e6[_0x96bd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 25f13cd..bafafe8 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x5958d2,_0x550300){var _0x2a4809=function(_0x48048b){while(--_0x48048b){_0x5958d2['push'](_0x5958d2['shift']());}};_0x2a4809(++_0x550300);}(_0xda3f,0xec));var _0xfda3=function(_0x461761,_0x4720fe){_0x461761=_0x461761-0x0;var _0x261e1c=_0xda3f[_0x461761];return _0x261e1c;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x1643cb,_0x8af3cc){var _0x2d1147=function(_0x556e53){while(--_0x556e53){_0x1643cb['push'](_0x1643cb['shift']());}};_0x2d1147(++_0x8af3cc);}(_0xda3f,0xec));var _0xfda3=function(_0x1f17f6,_0x4a06c2){_0x1f17f6=_0x1f17f6-0x0;var _0x47d221=_0xda3f[_0x1f17f6];return _0x47d221;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index b3c5655..6e4a5c3 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 _0x17ea=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x4e846e,_0x15bf7a){var _0xc10996=function(_0xdee6e1){while(--_0xdee6e1){_0x4e846e['push'](_0x4e846e['shift']());}};_0xc10996(++_0x15bf7a);}(_0x17ea,0xe5));var _0xa17e=function(_0x434e16,_0x345f6c){_0x434e16=_0x434e16-0x0;var _0x4c6e8d=_0x17ea[_0x434e16];return _0x4c6e8d;};'use strict';var Sequelize=require(_0xa17e('0x0'));module[_0xa17e('0x1')]={'uniqueid':{'type':Sequelize[_0xa17e('0x2')]},'body':{'type':Sequelize[_0xa17e('0x3')](_0xa17e('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa17e('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xa17e('0x2')]},'providerResponse':{'type':Sequelize[_0xa17e('0x3')]}}; \ No newline at end of file +var _0x5b37=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x5b37,0x1cb));var _0x75b3=function(_0x1c9b46,_0x507d41){_0x1c9b46=_0x1c9b46-0x0;var _0x2d199c=_0x5b37[_0x1c9b46];return _0x2d199c;};'use strict';var Sequelize=require(_0x75b3('0x0'));module[_0x75b3('0x1')]={'uniqueid':{'type':Sequelize[_0x75b3('0x2')]},'body':{'type':Sequelize[_0x75b3('0x3')](_0x75b3('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x75b3('0x5')]('in',_0x75b3('0x6')),'defaultValue':_0x75b3('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0x75b3('0x2')]},'providerResponse':{'type':Sequelize[_0x75b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 5ed21c0..878459e 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 _0xb9d9=['undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset'];(function(_0x24b385,_0x18ca19){var _0x530ece=function(_0x56c610){while(--_0x56c610){_0x24b385['push'](_0x24b385['shift']());}};_0x530ece(++_0x18ca19);}(_0xb9d9,0x104));var _0x9b9d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb9d9[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x9b9d('0x0'));var rimraf=require(_0x9b9d('0x1'));var zipdir=require(_0x9b9d('0x2'));var jsonpatch=require(_0x9b9d('0x3'));var rp=require(_0x9b9d('0x4'));var moment=require(_0x9b9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b9d('0x6'));var util=require(_0x9b9d('0x7'));var path=require(_0x9b9d('0x8'));var sox=require(_0x9b9d('0x9'));var csv=require('to-csv');var ejs=require(_0x9b9d('0xa'));var fs=require('fs');var fs_extra=require(_0x9b9d('0xb'));var _=require('lodash');var squel=require(_0x9b9d('0xc'));var crypto=require(_0x9b9d('0xd'));var jsforce=require(_0x9b9d('0xe'));var deskjs=require(_0x9b9d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9b9d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9b9d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b9d('0x12'));var logger=require(_0x9b9d('0x13'))(_0x9b9d('0x14'));var utils=require(_0x9b9d('0x15'));var config=require(_0x9b9d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22bdc9,_0x7ed29){_0x7ed29=_0x7ed29||0xcc;return function(_0x53e6ef){if(_0x53e6ef){return _0x22bdc9[_0x9b9d('0x17')](_0x7ed29);}return _0x22bdc9[_0x9b9d('0x18')](_0x7ed29)[_0x9b9d('0x19')]();};}function respondWithResult(_0x4a1ebf,_0x106539){_0x106539=_0x106539||0xc8;return function(_0x1635c0){if(_0x1635c0){return _0x4a1ebf[_0x9b9d('0x18')](_0x106539)[_0x9b9d('0x1a')](_0x1635c0);}};}function respondWithFilteredResult(_0x44c1e6,_0x1b988e){return function(_0x5b8320){if(_0x5b8320){var _0x5f462d=typeof _0x1b988e[_0x9b9d('0x1b')]===_0x9b9d('0x1c')&&typeof _0x1b988e[_0x9b9d('0x1d')]===_0x9b9d('0x1c');var _0x46395a=_0x5b8320[_0x9b9d('0x1e')];var _0x255c0a=_0x5f462d?0x0:_0x1b988e[_0x9b9d('0x1b')];var _0x4872a8=_0x5f462d?_0x5b8320[_0x9b9d('0x1e')]:_0x1b988e[_0x9b9d('0x1b')]+_0x1b988e[_0x9b9d('0x1d')];var _0x4cd4b7;if(_0x4872a8>=_0x46395a){_0x4872a8=_0x46395a;_0x4cd4b7=0xc8;}else{_0x4cd4b7=0xce;}_0x44c1e6[_0x9b9d('0x18')](_0x4cd4b7);return _0x44c1e6[_0x9b9d('0x1f')](_0x9b9d('0x20'),_0x255c0a+'-'+_0x4872a8+'/'+_0x46395a)[_0x9b9d('0x1a')](_0x5b8320);}return null;};}function patchUpdates(_0x30817e){return function(_0x326728){try{jsonpatch['apply'](_0x326728,_0x30817e,!![]);}catch(_0xd9152a){return BPromise['reject'](_0xd9152a);}return _0x326728['save']();};}function saveUpdates(_0x3a46b3,_0x2c3425){return function(_0x39c407){if(_0x39c407){return _0x39c407[_0x9b9d('0x21')](_0x3a46b3)[_0x9b9d('0x22')](function(_0x2b952c){return _0x2b952c;});}return null;};}function removeEntity(_0x4ea7cf,_0x1bcb99){return function(_0x4ba3d6){if(_0x4ba3d6){return _0x4ba3d6[_0x9b9d('0x23')]()[_0x9b9d('0x22')](function(){_0x4ea7cf[_0x9b9d('0x18')](0xcc)[_0x9b9d('0x19')]();});}};}function handleEntityNotFound(_0x3e543f,_0x2a0852){return function(_0x1e52bb){if(!_0x1e52bb){_0x3e543f[_0x9b9d('0x17')](0x194);}return _0x1e52bb;};}function handleError(_0x38e0b8,_0x1393c9){_0x1393c9=_0x1393c9||0x1f4;return function(_0x3e3497){logger[_0x9b9d('0x24')](_0x3e3497['stack']);if(_0x3e3497[_0x9b9d('0x25')]){delete _0x3e3497[_0x9b9d('0x25')];}_0x38e0b8[_0x9b9d('0x18')](_0x1393c9)[_0x9b9d('0x26')](_0x3e3497);};}exports['index']=function(_0x32146a,_0x3440ae){var _0x20df61={},_0x404abd={},_0x34a6d2={'count':0x0,'rows':[]};var _0x5d483d=_[_0x9b9d('0x27')](db[_0x9b9d('0x28')][_0x9b9d('0x29')],function(_0x5cb8e0){return{'name':_0x5cb8e0[_0x9b9d('0x2a')],'type':_0x5cb8e0['type'][_0x9b9d('0x2b')]};});_0x404abd[_0x9b9d('0x2c')]=_[_0x9b9d('0x27')](_0x5d483d,_0x9b9d('0x25'));_0x404abd[_0x9b9d('0x2d')]=_[_0x9b9d('0x2e')](_0x32146a[_0x9b9d('0x2d')]);_0x404abd[_0x9b9d('0x2f')]=_[_0x9b9d('0x30')](_0x404abd[_0x9b9d('0x2c')],_0x404abd[_0x9b9d('0x2d')]);_0x20df61[_0x9b9d('0x31')]=_[_0x9b9d('0x30')](_0x404abd['model'],qs[_0x9b9d('0x32')](_0x32146a[_0x9b9d('0x2d')]['fields']));_0x20df61[_0x9b9d('0x31')]=_0x20df61['attributes'][_0x9b9d('0x33')]?_0x20df61['attributes']:_0x404abd[_0x9b9d('0x2c')];if(!_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x34')](_0x9b9d('0x35'))){_0x20df61[_0x9b9d('0x1d')]=qs[_0x9b9d('0x1d')](_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x1d')]);_0x20df61['offset']=qs[_0x9b9d('0x1b')](_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x1b')]);}_0x20df61[_0x9b9d('0x36')]=qs[_0x9b9d('0x37')](_0x32146a['query']['sort']);_0x20df61[_0x9b9d('0x38')]=qs[_0x9b9d('0x2f')](_[_0x9b9d('0x39')](_0x32146a[_0x9b9d('0x2d')],_0x404abd[_0x9b9d('0x2f')]),_0x5d483d);if(_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x3a')]){_0x20df61[_0x9b9d('0x38')]=_['merge'](_0x20df61['where'],{'$or':_[_0x9b9d('0x27')](_0x5d483d,function(_0x267b25){if(_0x267b25[_0x9b9d('0x3b')]!==_0x9b9d('0x3c')){var _0x45f132={};_0x45f132[_0x267b25[_0x9b9d('0x25')]]={'$like':'%'+_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x3a')]+'%'};return _0x45f132;}})});}_0x20df61=_[_0x9b9d('0x3d')]({},_0x20df61,_0x32146a[_0x9b9d('0x3e')]);var _0x5d2d1d={'where':_0x20df61[_0x9b9d('0x38')]};return db[_0x9b9d('0x28')][_0x9b9d('0x1e')](_0x5d2d1d)[_0x9b9d('0x22')](function(_0x248610){_0x34a6d2[_0x9b9d('0x1e')]=_0x248610;if(_0x32146a[_0x9b9d('0x2d')][_0x9b9d('0x3f')]){_0x20df61['include']=[{'all':!![]}];}return db['SquareMessage'][_0x9b9d('0x40')](_0x20df61);})[_0x9b9d('0x22')](function(_0x14f0f6){_0x34a6d2['rows']=_0x14f0f6;return _0x34a6d2;})[_0x9b9d('0x22')](respondWithFilteredResult(_0x3440ae,_0x20df61))[_0x9b9d('0x41')](handleError(_0x3440ae,null));};exports[_0x9b9d('0x42')]=function(_0x3ecdb1,_0x427076){var _0xc271be={'raw':!![],'where':{'id':_0x3ecdb1[_0x9b9d('0x43')]['id']}},_0x510eb9={};_0x510eb9[_0x9b9d('0x2c')]=_[_0x9b9d('0x2e')](db[_0x9b9d('0x28')]['rawAttributes']);_0x510eb9[_0x9b9d('0x2d')]=_[_0x9b9d('0x2e')](_0x3ecdb1[_0x9b9d('0x2d')]);_0x510eb9[_0x9b9d('0x2f')]=_['intersection'](_0x510eb9[_0x9b9d('0x2c')],_0x510eb9['query']);_0xc271be[_0x9b9d('0x31')]=_[_0x9b9d('0x30')](_0x510eb9[_0x9b9d('0x2c')],qs[_0x9b9d('0x32')](_0x3ecdb1['query'][_0x9b9d('0x32')]));_0xc271be[_0x9b9d('0x31')]=_0xc271be['attributes']['length']?_0xc271be[_0x9b9d('0x31')]:_0x510eb9[_0x9b9d('0x2c')];if(_0x3ecdb1['query'][_0x9b9d('0x3f')]){_0xc271be[_0x9b9d('0x44')]=[{'all':!![]}];}_0xc271be=_[_0x9b9d('0x3d')]({},_0xc271be,_0x3ecdb1['options']);return db[_0x9b9d('0x28')][_0x9b9d('0x45')](_0xc271be)[_0x9b9d('0x22')](handleEntityNotFound(_0x427076,null))[_0x9b9d('0x22')](respondWithResult(_0x427076,null))[_0x9b9d('0x41')](handleError(_0x427076,null));};exports[_0x9b9d('0x46')]=function(_0x352827,_0x467dc1){return db[_0x9b9d('0x28')][_0x9b9d('0x46')](_0x352827[_0x9b9d('0x47')],{})['then'](respondWithResult(_0x467dc1,0xc9))[_0x9b9d('0x41')](handleError(_0x467dc1,null));};exports[_0x9b9d('0x21')]=function(_0x1804b5,_0x531bed){if(_0x1804b5[_0x9b9d('0x47')]['id']){delete _0x1804b5[_0x9b9d('0x47')]['id'];}return db[_0x9b9d('0x28')][_0x9b9d('0x45')]({'where':{'id':_0x1804b5[_0x9b9d('0x43')]['id']}})[_0x9b9d('0x22')](handleEntityNotFound(_0x531bed,null))[_0x9b9d('0x22')](saveUpdates(_0x1804b5[_0x9b9d('0x47')],null))[_0x9b9d('0x22')](respondWithResult(_0x531bed,null))[_0x9b9d('0x41')](handleError(_0x531bed,null));};exports[_0x9b9d('0x23')]=function(_0x3ba416,_0x27af66){return db[_0x9b9d('0x28')]['find']({'where':{'id':_0x3ba416['params']['id']}})['then'](handleEntityNotFound(_0x27af66,null))[_0x9b9d('0x22')](removeEntity(_0x27af66,null))[_0x9b9d('0x41')](handleError(_0x27af66,null));}; \ No newline at end of file +var _0x6582=['destroy','then','end','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6582,0x108));var _0x2658=function(_0x56e6c6,_0x4486ce){_0x56e6c6=_0x56e6c6-0x0;var _0x21547e=_0x6582[_0x56e6c6];return _0x21547e;};'use strict';var emlformat=require(_0x2658('0x0'));var rimraf=require(_0x2658('0x1'));var zipdir=require(_0x2658('0x2'));var jsonpatch=require(_0x2658('0x3'));var rp=require(_0x2658('0x4'));var moment=require('moment');var BPromise=require(_0x2658('0x5'));var Mustache=require(_0x2658('0x6'));var util=require(_0x2658('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2658('0x8'));var fs=require('fs');var fs_extra=require(_0x2658('0x9'));var _=require(_0x2658('0xa'));var squel=require(_0x2658('0xb'));var crypto=require(_0x2658('0xc'));var jsforce=require(_0x2658('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2658('0xe'));var querystring=require(_0x2658('0xf'));var Papa=require(_0x2658('0x10'));var Redis=require(_0x2658('0x11'));var authService=require(_0x2658('0x12'));var qs=require(_0x2658('0x13'));var as=require(_0x2658('0x14'));var hardwareService=require(_0x2658('0x15'));var logger=require(_0x2658('0x16'))('api');var utils=require(_0x2658('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2658('0x18'));var db=require(_0x2658('0x19'))['db'];function respondWithStatusCode(_0x263852,_0x40d73a){_0x40d73a=_0x40d73a||0xcc;return function(_0x3f4bd0){if(_0x3f4bd0){return _0x263852[_0x2658('0x1a')](_0x40d73a);}return _0x263852[_0x2658('0x1b')](_0x40d73a)['end']();};}function respondWithResult(_0x201d2d,_0x38469c){_0x38469c=_0x38469c||0xc8;return function(_0x2187bd){if(_0x2187bd){return _0x201d2d[_0x2658('0x1b')](_0x38469c)[_0x2658('0x1c')](_0x2187bd);}};}function respondWithFilteredResult(_0x59013b,_0x2fc995){return function(_0x5d8ed5){if(_0x5d8ed5){var _0x15bd54=typeof _0x2fc995['offset']===_0x2658('0x1d')&&typeof _0x2fc995[_0x2658('0x1e')]===_0x2658('0x1d');var _0x215211=_0x5d8ed5['count'];var _0x4eb90d=_0x15bd54?0x0:_0x2fc995['offset'];var _0xf4193a=_0x15bd54?_0x5d8ed5[_0x2658('0x1f')]:_0x2fc995[_0x2658('0x20')]+_0x2fc995[_0x2658('0x1e')];var _0x5f4aa9;if(_0xf4193a>=_0x215211){_0xf4193a=_0x215211;_0x5f4aa9=0xc8;}else{_0x5f4aa9=0xce;}_0x59013b[_0x2658('0x1b')](_0x5f4aa9);return _0x59013b[_0x2658('0x21')](_0x2658('0x22'),_0x4eb90d+'-'+_0xf4193a+'/'+_0x215211)[_0x2658('0x1c')](_0x5d8ed5);}return null;};}function patchUpdates(_0x23cf70){return function(_0x386294){try{jsonpatch['apply'](_0x386294,_0x23cf70,!![]);}catch(_0x29ccc0){return BPromise['reject'](_0x29ccc0);}return _0x386294['save']();};}function saveUpdates(_0xf71c18,_0x132000){return function(_0x499ca6){if(_0x499ca6){return _0x499ca6[_0x2658('0x23')](_0xf71c18)['then'](function(_0x19e89b){return _0x19e89b;});}return null;};}function removeEntity(_0x137e9a,_0x44642e){return function(_0x2e6d6a){if(_0x2e6d6a){return _0x2e6d6a[_0x2658('0x24')]()[_0x2658('0x25')](function(){_0x137e9a[_0x2658('0x1b')](0xcc)[_0x2658('0x26')]();});}};}function handleEntityNotFound(_0x2496bf,_0x43b6c0){return function(_0x566cec){if(!_0x566cec){_0x2496bf[_0x2658('0x1a')](0x194);}return _0x566cec;};}function handleError(_0x4676a4,_0x338f06){_0x338f06=_0x338f06||0x1f4;return function(_0x3d251e){logger[_0x2658('0x27')](_0x3d251e[_0x2658('0x28')]);if(_0x3d251e['name']){delete _0x3d251e[_0x2658('0x29')];}_0x4676a4[_0x2658('0x1b')](_0x338f06)[_0x2658('0x2a')](_0x3d251e);};}exports[_0x2658('0x2b')]=function(_0x27e0f5,_0x1492cb){var _0x256172={},_0xb8d245={},_0xd891fe={'count':0x0,'rows':[]};var _0x14784=_[_0x2658('0x2c')](db[_0x2658('0x2d')][_0x2658('0x2e')],function(_0x3e0322){return{'name':_0x3e0322[_0x2658('0x2f')],'type':_0x3e0322[_0x2658('0x30')][_0x2658('0x31')]};});_0xb8d245[_0x2658('0x32')]=_['map'](_0x14784,_0x2658('0x29'));_0xb8d245[_0x2658('0x33')]=_[_0x2658('0x34')](_0x27e0f5['query']);_0xb8d245[_0x2658('0x35')]=_[_0x2658('0x36')](_0xb8d245[_0x2658('0x32')],_0xb8d245['query']);_0x256172[_0x2658('0x37')]=_[_0x2658('0x36')](_0xb8d245[_0x2658('0x32')],qs[_0x2658('0x38')](_0x27e0f5[_0x2658('0x33')][_0x2658('0x38')]));_0x256172[_0x2658('0x37')]=_0x256172[_0x2658('0x37')][_0x2658('0x39')]?_0x256172['attributes']:_0xb8d245[_0x2658('0x32')];if(!_0x27e0f5[_0x2658('0x33')][_0x2658('0x3a')]('nolimit')){_0x256172['limit']=qs['limit'](_0x27e0f5[_0x2658('0x33')][_0x2658('0x1e')]);_0x256172[_0x2658('0x20')]=qs[_0x2658('0x20')](_0x27e0f5[_0x2658('0x33')][_0x2658('0x20')]);}_0x256172['order']=qs[_0x2658('0x3b')](_0x27e0f5[_0x2658('0x33')][_0x2658('0x3b')]);_0x256172['where']=qs[_0x2658('0x35')](_[_0x2658('0x3c')](_0x27e0f5[_0x2658('0x33')],_0xb8d245[_0x2658('0x35')]),_0x14784);if(_0x27e0f5['query'][_0x2658('0x3d')]){_0x256172[_0x2658('0x3e')]=_['merge'](_0x256172['where'],{'$or':_['map'](_0x14784,function(_0x4fb397){if(_0x4fb397[_0x2658('0x30')]!==_0x2658('0x3f')){var _0x370026={};_0x370026[_0x4fb397['name']]={'$like':'%'+_0x27e0f5[_0x2658('0x33')]['filter']+'%'};return _0x370026;}})});}_0x256172=_['merge']({},_0x256172,_0x27e0f5[_0x2658('0x40')]);var _0x433762={'where':_0x256172[_0x2658('0x3e')]};return db['SquareMessage']['count'](_0x433762)['then'](function(_0x5e5c59){_0xd891fe[_0x2658('0x1f')]=_0x5e5c59;if(_0x27e0f5[_0x2658('0x33')][_0x2658('0x41')]){_0x256172[_0x2658('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x2658('0x43')](_0x256172);})[_0x2658('0x25')](function(_0x2b0dad){_0xd891fe[_0x2658('0x44')]=_0x2b0dad;return _0xd891fe;})[_0x2658('0x25')](respondWithFilteredResult(_0x1492cb,_0x256172))['catch'](handleError(_0x1492cb,null));};exports[_0x2658('0x45')]=function(_0x3152c0,_0x3eec7f){var _0x24e8dc={'raw':!![],'where':{'id':_0x3152c0[_0x2658('0x46')]['id']}},_0x120b41={};_0x120b41[_0x2658('0x32')]=_[_0x2658('0x34')](db[_0x2658('0x2d')][_0x2658('0x2e')]);_0x120b41[_0x2658('0x33')]=_[_0x2658('0x34')](_0x3152c0['query']);_0x120b41['filters']=_[_0x2658('0x36')](_0x120b41[_0x2658('0x32')],_0x120b41[_0x2658('0x33')]);_0x24e8dc['attributes']=_[_0x2658('0x36')](_0x120b41[_0x2658('0x32')],qs[_0x2658('0x38')](_0x3152c0[_0x2658('0x33')]['fields']));_0x24e8dc[_0x2658('0x37')]=_0x24e8dc[_0x2658('0x37')][_0x2658('0x39')]?_0x24e8dc[_0x2658('0x37')]:_0x120b41[_0x2658('0x32')];if(_0x3152c0[_0x2658('0x33')]['includeAll']){_0x24e8dc[_0x2658('0x42')]=[{'all':!![]}];}_0x24e8dc=_['merge']({},_0x24e8dc,_0x3152c0[_0x2658('0x40')]);return db[_0x2658('0x2d')]['find'](_0x24e8dc)[_0x2658('0x25')](handleEntityNotFound(_0x3eec7f,null))[_0x2658('0x25')](respondWithResult(_0x3eec7f,null))['catch'](handleError(_0x3eec7f,null));};exports[_0x2658('0x47')]=function(_0x14f5ac,_0xa41595){return db[_0x2658('0x2d')][_0x2658('0x47')](_0x14f5ac['body'],{})[_0x2658('0x25')](respondWithResult(_0xa41595,0xc9))[_0x2658('0x48')](handleError(_0xa41595,null));};exports['update']=function(_0x1fc2dd,_0x415586){if(_0x1fc2dd[_0x2658('0x49')]['id']){delete _0x1fc2dd[_0x2658('0x49')]['id'];}return db['SquareMessage'][_0x2658('0x4a')]({'where':{'id':_0x1fc2dd[_0x2658('0x46')]['id']}})[_0x2658('0x25')](handleEntityNotFound(_0x415586,null))[_0x2658('0x25')](saveUpdates(_0x1fc2dd[_0x2658('0x49')],null))[_0x2658('0x25')](respondWithResult(_0x415586,null))[_0x2658('0x48')](handleError(_0x415586,null));};exports['destroy']=function(_0xa61cf1,_0x4cd936){return db[_0x2658('0x2d')]['find']({'where':{'id':_0xa61cf1[_0x2658('0x46')]['id']}})[_0x2658('0x25')](handleEntityNotFound(_0x4cd936,null))[_0x2658('0x25')](removeEntity(_0x4cd936,null))[_0x2658('0x48')](handleError(_0x4cd936,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index ae086f8..2450e05 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 _0x6aa9=['api','moment','bluebird','request-promise','rimraf','define','SquareMessage','square_messages','lodash'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x6aa9,0xd7));var _0x96aa=function(_0x5ae729,_0x1a677e){_0x5ae729=_0x5ae729-0x0;var _0x55cce5=_0x6aa9[_0x5ae729];return _0x55cce5;};'use strict';var _=require(_0x96aa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x96aa('0x1'));var moment=require(_0x96aa('0x2'));var BPromise=require(_0x96aa('0x3'));var rp=require(_0x96aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x96aa('0x5'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module['exports']=function(_0x306a0a,_0x56aeb7){return _0x306a0a[_0x96aa('0x6')](_0x96aa('0x7'),attributes,{'tableName':_0x96aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd2=['util','../../config/logger','api','moment','../../config/environment','define','SquareMessage','lodash'];(function(_0x3f167a,_0xae2540){var _0x2cb155=function(_0x5b4a2b){while(--_0x5b4a2b){_0x3f167a['push'](_0x3f167a['shift']());}};_0x2cb155(++_0xae2540);}(_0xcdd2,0x1bf));var _0x2cdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cdd('0x0'));var util=require(_0x2cdd('0x1'));var logger=require(_0x2cdd('0x2'))(_0x2cdd('0x3'));var moment=require(_0x2cdd('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(_0x2cdd('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1f429b,_0x224729){return _0x1f429b[_0x2cdd('0x6')](_0x2cdd('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 0d6f19d..0b29801 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 _0x9c75=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','options','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x46ce98,_0x52d764){var _0x172f46=function(_0x10ccee){while(--_0x10ccee){_0x46ce98['push'](_0x46ce98['shift']());}};_0x172f46(++_0x52d764);}(_0x9c75,0xa1));var _0x59c7=function(_0x2c8718,_0x2b52da){_0x2c8718=_0x2c8718-0x0;var _0x1af3c1=_0x9c75[_0x2c8718];return _0x1af3c1;};'use strict';var _=require(_0x59c7('0x0'));var util=require('util');var moment=require(_0x59c7('0x1'));var BPromise=require(_0x59c7('0x2'));var rs=require(_0x59c7('0x3'));var fs=require('fs');var Redis=require(_0x59c7('0x4'));var db=require(_0x59c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x59c7('0x6'))(_0x59c7('0x7'));var config=require(_0x59c7('0x8'));var jayson=require(_0x59c7('0x9'));var client=jayson['client'][_0x59c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa8d548,_0x698cc8,_0x55a158){return new BPromise(function(_0x7d0e21,_0x24351f){return client['request'](_0xa8d548,_0x55a158)[_0x59c7('0xb')](function(_0x162dbe){logger[_0x59c7('0xc')]('SquareMessage,\x20%s,\x20%s',_0x698cc8,_0x59c7('0xd'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x698cc8,'request\x20sent',JSON[_0x59c7('0xe')](_0x162dbe));if(_0x162dbe[_0x59c7('0xf')]){if(_0x162dbe[_0x59c7('0xf')]['code']===0x1f4){logger[_0x59c7('0xf')](_0x59c7('0x10'),_0x698cc8,_0x162dbe[_0x59c7('0xf')]['message']);return _0x24351f(_0x162dbe[_0x59c7('0xf')][_0x59c7('0x11')]);}logger[_0x59c7('0xf')]('SquareMessage,\x20%s,\x20%s',_0x698cc8,_0x162dbe[_0x59c7('0xf')][_0x59c7('0x11')]);return _0x7d0e21(_0x162dbe[_0x59c7('0xf')][_0x59c7('0x11')]);}else{logger['info'](_0x59c7('0x10'),_0x698cc8,_0x59c7('0xd'));_0x7d0e21(_0x162dbe[_0x59c7('0x12')][_0x59c7('0x11')]);}})['catch'](function(_0xa9b29d){logger[_0x59c7('0xf')](_0x59c7('0x10'),_0x698cc8,_0xa9b29d);_0x24351f(_0xa9b29d);});});}exports[_0x59c7('0x13')]=function(_0x3efdc1){var _0xf8518=this;return new Promise(function(_0x17eea3,_0x5295f1){return db[_0x59c7('0x14')]['create'](_0x3efdc1['body'],{'raw':_0x3efdc1[_0x59c7('0x15')]?_0x3efdc1[_0x59c7('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x59c7('0xb')](function(_0x1f214b){logger[_0x59c7('0xc')](_0x59c7('0x13'),_0x3efdc1);logger[_0x59c7('0x16')](_0x59c7('0x13'),_0x3efdc1,JSON[_0x59c7('0xe')](_0x1f214b));_0x17eea3(_0x1f214b);})[_0x59c7('0x17')](function(_0x58e139){logger[_0x59c7('0xf')](_0x59c7('0x13'),_0x58e139[_0x59c7('0x11')],_0x3efdc1);_0x5295f1(_0xf8518[_0x59c7('0xf')](0x1f4,_0x58e139['message']));});});}; \ No newline at end of file +var _0xc76b=['then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','options','raw','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3bad26,_0x1cf013){var _0x42e1ff=function(_0xb53d84){while(--_0xb53d84){_0x3bad26['push'](_0x3bad26['shift']());}};_0x42e1ff(++_0x1cf013);}(_0xc76b,0x16f));var _0xbc76=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc76b[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc76('0x0'));var BPromise=require('bluebird');var rs=require(_0xbc76('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc76('0x2'))['db'];var utils=require(_0xbc76('0x3'));var logger=require(_0xbc76('0x4'))(_0xbc76('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc76('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x477836,_0x1cf2ea,_0x108fbe){return new BPromise(function(_0x3d0364,_0x315fd3){return client['request'](_0x477836,_0x108fbe)[_0xbc76('0x7')](function(_0x2b15b3){logger[_0xbc76('0x8')](_0xbc76('0x9'),_0x1cf2ea,_0xbc76('0xa'));logger[_0xbc76('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x1cf2ea,'request\x20sent',JSON[_0xbc76('0xc')](_0x2b15b3));if(_0x2b15b3[_0xbc76('0xd')]){if(_0x2b15b3[_0xbc76('0xd')][_0xbc76('0xe')]===0x1f4){logger[_0xbc76('0xd')]('SquareMessage,\x20%s,\x20%s',_0x1cf2ea,_0x2b15b3['error'][_0xbc76('0xf')]);return _0x315fd3(_0x2b15b3['error'][_0xbc76('0xf')]);}logger['error'](_0xbc76('0x9'),_0x1cf2ea,_0x2b15b3[_0xbc76('0xd')][_0xbc76('0xf')]);return _0x3d0364(_0x2b15b3[_0xbc76('0xd')]['message']);}else{logger[_0xbc76('0x8')](_0xbc76('0x9'),_0x1cf2ea,_0xbc76('0xa'));_0x3d0364(_0x2b15b3[_0xbc76('0x10')]['message']);}})[_0xbc76('0x11')](function(_0x3b27e4){logger[_0xbc76('0xd')](_0xbc76('0x9'),_0x1cf2ea,_0x3b27e4);_0x315fd3(_0x3b27e4);});});}exports[_0xbc76('0x12')]=function(_0x2c898d){var _0x5cc297=this;return new Promise(function(_0x30604c,_0x45f8a9){return db[_0xbc76('0x13')]['create'](_0x2c898d['body'],{'raw':_0x2c898d[_0xbc76('0x14')]?_0x2c898d['options'][_0xbc76('0x15')]===undefined?!![]:![]:!![]})[_0xbc76('0x7')](function(_0x36a6a4){logger[_0xbc76('0x8')](_0xbc76('0x12'),_0x2c898d);logger[_0xbc76('0xb')]('CreateSquareMessage',_0x2c898d,JSON[_0xbc76('0xc')](_0x36a6a4));_0x30604c(_0x36a6a4);})['catch'](function(_0x17d8a8){logger[_0xbc76('0xd')](_0xbc76('0x12'),_0x17d8a8['message'],_0x2c898d);_0x45f8a9(_0x5cc297[_0xbc76('0xd')](0x1f4,_0x17d8a8[_0xbc76('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 28a63b3..131e041 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 _0x3eb4=['delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','isAuthenticated','index','get','/:id','15s','test','post','create','put','update'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x3eb4,0x11e));var _0x43eb=function(_0x247f56,_0x588835){_0x247f56=_0x247f56-0x0;var _0x5715a0=_0x3eb4[_0x247f56];return _0x5715a0;};'use strict';var multer=require(_0x43eb('0x0'));var util=require(_0x43eb('0x1'));var path=require(_0x43eb('0x2'));var timeout=require('connect-timeout');var express=require(_0x43eb('0x3'));var router=express['Router']();var fs_extra=require(_0x43eb('0x4'));var auth=require(_0x43eb('0x5'));var interaction=require(_0x43eb('0x6'));var config=require('../../config/environment');var controller=require(_0x43eb('0x7'));router['get']('/',auth[_0x43eb('0x8')](),controller[_0x43eb('0x9')]);router[_0x43eb('0xa')](_0x43eb('0xb'),auth[_0x43eb('0x8')](),controller['show']);router['get']('/:id/test',auth['isAuthenticated'](),timeout(_0x43eb('0xc')),controller[_0x43eb('0xd')]);router[_0x43eb('0xe')]('/',auth[_0x43eb('0x8')](),controller[_0x43eb('0xf')]);router[_0x43eb('0x10')](_0x43eb('0xb'),auth['isAuthenticated'](),controller[_0x43eb('0x11')]);router[_0x43eb('0x12')](_0x43eb('0xb'),auth[_0x43eb('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc6c8=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create'];(function(_0x4aa4af,_0x210cde){var _0x3bf44a=function(_0x4a8126){while(--_0x4a8126){_0x4aa4af['push'](_0x4aa4af['shift']());}};_0x3bf44a(++_0x210cde);}(_0xc6c8,0x1cc));var _0x8c6c=function(_0x523715,_0x237db2){_0x523715=_0x523715-0x0;var _0x2317ec=_0xc6c8[_0x523715];return _0x2317ec;};'use strict';var multer=require(_0x8c6c('0x0'));var util=require(_0x8c6c('0x1'));var path=require(_0x8c6c('0x2'));var timeout=require(_0x8c6c('0x3'));var express=require(_0x8c6c('0x4'));var router=express[_0x8c6c('0x5')]();var fs_extra=require(_0x8c6c('0x6'));var auth=require(_0x8c6c('0x7'));var interaction=require(_0x8c6c('0x8'));var config=require(_0x8c6c('0x9'));var controller=require(_0x8c6c('0xa'));router[_0x8c6c('0xb')]('/',auth[_0x8c6c('0xc')](),controller[_0x8c6c('0xd')]);router['get'](_0x8c6c('0xe'),auth['isAuthenticated'](),controller[_0x8c6c('0xf')]);router[_0x8c6c('0xb')]('/:id/test',auth['isAuthenticated'](),timeout(_0x8c6c('0x10')),controller[_0x8c6c('0x11')]);router[_0x8c6c('0x12')]('/',auth[_0x8c6c('0xc')](),controller[_0x8c6c('0x13')]);router[_0x8c6c('0x14')](_0x8c6c('0xe'),auth['isAuthenticated'](),controller[_0x8c6c('0x15')]);router[_0x8c6c('0x16')](_0x8c6c('0xe'),auth[_0x8c6c('0xc')](),controller['destroy']);module[_0x8c6c('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 991257e..0e1a92b 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 _0xd5dc=['STRING','name','exports'];(function(_0x4489e8,_0x10e7d6){var _0x2faf09=function(_0x80fd93){while(--_0x80fd93){_0x4489e8['push'](_0x4489e8['shift']());}};_0x2faf09(++_0x10e7d6);}(_0xd5dc,0x149));var _0xcd5d=function(_0x50cb51,_0x30487b){_0x50cb51=_0x50cb51-0x0;var _0x31e435=_0xd5dc[_0x50cb51];return _0x31e435;};'use strict';var Sequelize=require('sequelize');module[_0xcd5d('0x0')]={'name':{'type':Sequelize[_0xcd5d('0x1')],'unique':_0xcd5d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xcd5d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6d6e=['exports','name','STRING','sequelize'];(function(_0x1e3dae,_0x13e381){var _0xdc7cc6=function(_0x188357){while(--_0x188357){_0x1e3dae['push'](_0x1e3dae['shift']());}};_0xdc7cc6(++_0x13e381);}(_0x6d6e,0xab));var _0xe6d6=function(_0x283076,_0x504e31){_0x283076=_0x283076-0x0;var _0x4486e4=_0x6d6e[_0x283076];return _0x4486e4;};'use strict';var Sequelize=require(_0xe6d6('0x0'));module[_0xe6d6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe6d6('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe6d6('0x3')]},'description':{'type':Sequelize[_0xe6d6('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index de87ed2..3854a34 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 _0xccaf=['VIRTUAL','options','includeAll','include','SquareOdbc','findAll','show','params','catch','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','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0xb0370d,_0xc9985d){var _0x24a14b=function(_0x4b45e6){while(--_0x4b45e6){_0xb0370d['push'](_0xb0370d['shift']());}};_0x24a14b(++_0xc9985d);}(_0xccaf,0x16b));var _0xfcca=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xccaf[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0xfcca('0x0'));var rimraf=require(_0xfcca('0x1'));var zipdir=require(_0xfcca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcca('0x3'));var moment=require(_0xfcca('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfcca('0x5'));var path=require(_0xfcca('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfcca('0x7'));var fs=require('fs');var fs_extra=require(_0xfcca('0x8'));var _=require(_0xfcca('0x9'));var squel=require(_0xfcca('0xa'));var crypto=require('crypto');var jsforce=require(_0xfcca('0xb'));var deskjs=require(_0xfcca('0xc'));var toCsv=require(_0xfcca('0xd'));var querystring=require(_0xfcca('0xe'));var Papa=require('papaparse');var Redis=require(_0xfcca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfcca('0x10'));var as=require(_0xfcca('0x11'));var hardwareService=require(_0xfcca('0x12'));var logger=require('../../config/logger')(_0xfcca('0x13'));var utils=require(_0xfcca('0x14'));var config=require(_0xfcca('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2de6a5,_0x2102ef){_0x2102ef=_0x2102ef||0xcc;return function(_0x6fe7f1){if(_0x6fe7f1){return _0x2de6a5[_0xfcca('0x16')](_0x2102ef);}return _0x2de6a5[_0xfcca('0x17')](_0x2102ef)[_0xfcca('0x18')]();};}function respondWithResult(_0x14cbb4,_0x45bc28){_0x45bc28=_0x45bc28||0xc8;return function(_0x407683){if(_0x407683){return _0x14cbb4[_0xfcca('0x17')](_0x45bc28)['json'](_0x407683);}};}function respondWithFilteredResult(_0x29270d,_0x2b109f){return function(_0x4806bf){if(_0x4806bf){var _0x46e536=typeof _0x2b109f[_0xfcca('0x19')]===_0xfcca('0x1a')&&typeof _0x2b109f[_0xfcca('0x1b')]===_0xfcca('0x1a');var _0x20525f=_0x4806bf['count'];var _0x50c827=_0x46e536?0x0:_0x2b109f[_0xfcca('0x19')];var _0x3e5e59=_0x46e536?_0x4806bf['count']:_0x2b109f[_0xfcca('0x19')]+_0x2b109f[_0xfcca('0x1b')];var _0x5cebb7;if(_0x3e5e59>=_0x20525f){_0x3e5e59=_0x20525f;_0x5cebb7=0xc8;}else{_0x5cebb7=0xce;}_0x29270d[_0xfcca('0x17')](_0x5cebb7);return _0x29270d[_0xfcca('0x1c')]('Content-Range',_0x50c827+'-'+_0x3e5e59+'/'+_0x20525f)[_0xfcca('0x1d')](_0x4806bf);}return null;};}function patchUpdates(_0x20a3f8){return function(_0x1c0c9c){try{jsonpatch[_0xfcca('0x1e')](_0x1c0c9c,_0x20a3f8,!![]);}catch(_0x538255){return BPromise[_0xfcca('0x1f')](_0x538255);}return _0x1c0c9c[_0xfcca('0x20')]();};}function saveUpdates(_0x3f0105,_0x374c2d){return function(_0x378a1d){if(_0x378a1d){return _0x378a1d[_0xfcca('0x21')](_0x3f0105)[_0xfcca('0x22')](function(_0x244274){return _0x244274;});}return null;};}function removeEntity(_0x2cfda5,_0x53ce8c){return function(_0x104bc6){if(_0x104bc6){return _0x104bc6[_0xfcca('0x23')]()[_0xfcca('0x22')](function(){var _0xb7b4ab=_0x104bc6[_0xfcca('0x24')]({'plain':!![]});var _0x1f7603=_0xfcca('0x25');return db[_0xfcca('0x26')][_0xfcca('0x23')]({'where':{'type':_0x1f7603,'resourceId':_0xb7b4ab['id']}})[_0xfcca('0x22')](function(){return _0x104bc6;});})[_0xfcca('0x22')](function(){_0x2cfda5[_0xfcca('0x17')](0xcc)[_0xfcca('0x18')]();});}};}function handleEntityNotFound(_0x255ca8,_0x47e7ef){return function(_0x306e86){if(!_0x306e86){_0x255ca8[_0xfcca('0x16')](0x194);}return _0x306e86;};}function handleError(_0x2e58af,_0x3cd53f){_0x3cd53f=_0x3cd53f||0x1f4;return function(_0x47bdb8){logger['error'](_0x47bdb8['stack']);if(_0x47bdb8[_0xfcca('0x27')]){delete _0x47bdb8[_0xfcca('0x27')];}_0x2e58af['status'](_0x3cd53f)[_0xfcca('0x28')](_0x47bdb8);};}exports[_0xfcca('0x29')]=function(_0x3f3b1a,_0x4e60d8){var _0x393356={},_0x4cebcf={},_0x558f2b={'count':0x0,'rows':[]};var _0x2ec611=_['map'](db['SquareOdbc'][_0xfcca('0x2a')],function(_0xf69d5c){return{'name':_0xf69d5c[_0xfcca('0x2b')],'type':_0xf69d5c[_0xfcca('0x2c')][_0xfcca('0x2d')]};});_0x4cebcf[_0xfcca('0x2e')]=_[_0xfcca('0x2f')](_0x2ec611,_0xfcca('0x27'));_0x4cebcf['query']=_[_0xfcca('0x30')](_0x3f3b1a[_0xfcca('0x31')]);_0x4cebcf[_0xfcca('0x32')]=_[_0xfcca('0x33')](_0x4cebcf['model'],_0x4cebcf[_0xfcca('0x31')]);_0x393356[_0xfcca('0x34')]=_['intersection'](_0x4cebcf[_0xfcca('0x2e')],qs['fields'](_0x3f3b1a['query'][_0xfcca('0x35')]));_0x393356[_0xfcca('0x34')]=_0x393356['attributes'][_0xfcca('0x36')]?_0x393356[_0xfcca('0x34')]:_0x4cebcf['model'];if(!_0x3f3b1a['query'][_0xfcca('0x37')](_0xfcca('0x38'))){_0x393356[_0xfcca('0x1b')]=qs['limit'](_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x1b')]);_0x393356[_0xfcca('0x19')]=qs[_0xfcca('0x19')](_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x19')]);}_0x393356['order']=qs[_0xfcca('0x39')](_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x39')]);_0x393356[_0xfcca('0x3a')]=qs[_0xfcca('0x32')](_[_0xfcca('0x3b')](_0x3f3b1a[_0xfcca('0x31')],_0x4cebcf[_0xfcca('0x32')]),_0x2ec611);if(_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x3c')]){_0x393356[_0xfcca('0x3a')]=_[_0xfcca('0x3d')](_0x393356[_0xfcca('0x3a')],{'$or':_[_0xfcca('0x2f')](_0x2ec611,function(_0x48eae6){if(_0x48eae6['type']!==_0xfcca('0x3e')){var _0x254e56={};_0x254e56[_0x48eae6[_0xfcca('0x27')]]={'$like':'%'+_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x3c')]+'%'};return _0x254e56;}})});}_0x393356=_[_0xfcca('0x3d')]({},_0x393356,_0x3f3b1a[_0xfcca('0x3f')]);var _0x568185={'where':_0x393356['where']};return db['SquareOdbc']['count'](_0x568185)[_0xfcca('0x22')](function(_0x2af157){_0x558f2b['count']=_0x2af157;if(_0x3f3b1a[_0xfcca('0x31')][_0xfcca('0x40')]){_0x393356[_0xfcca('0x41')]=[{'all':!![]}];}return db[_0xfcca('0x42')][_0xfcca('0x43')](_0x393356);})[_0xfcca('0x22')](function(_0x49a8d7){_0x558f2b['rows']=_0x49a8d7;return _0x558f2b;})['then'](respondWithFilteredResult(_0x4e60d8,_0x393356))['catch'](handleError(_0x4e60d8,null));};exports[_0xfcca('0x44')]=function(_0x54856f,_0x392ed6){var _0x39f146={'raw':!![],'where':{'id':_0x54856f[_0xfcca('0x45')]['id']}},_0x810aee={};_0x810aee[_0xfcca('0x2e')]=_['keys'](db['SquareOdbc'][_0xfcca('0x2a')]);_0x810aee[_0xfcca('0x31')]=_['keys'](_0x54856f[_0xfcca('0x31')]);_0x810aee['filters']=_['intersection'](_0x810aee[_0xfcca('0x2e')],_0x810aee[_0xfcca('0x31')]);_0x39f146['attributes']=_[_0xfcca('0x33')](_0x810aee[_0xfcca('0x2e')],qs[_0xfcca('0x35')](_0x54856f[_0xfcca('0x31')][_0xfcca('0x35')]));_0x39f146[_0xfcca('0x34')]=_0x39f146[_0xfcca('0x34')]['length']?_0x39f146[_0xfcca('0x34')]:_0x810aee[_0xfcca('0x2e')];if(_0x54856f[_0xfcca('0x31')][_0xfcca('0x40')]){_0x39f146[_0xfcca('0x41')]=[{'all':!![]}];}_0x39f146=_[_0xfcca('0x3d')]({},_0x39f146,_0x54856f['options']);return db['SquareOdbc']['find'](_0x39f146)[_0xfcca('0x22')](handleEntityNotFound(_0x392ed6,null))[_0xfcca('0x22')](respondWithResult(_0x392ed6,null))[_0xfcca('0x46')](handleError(_0x392ed6,null));};exports[_0xfcca('0x47')]=function(_0x1d4db5,_0x470ea4){return db[_0xfcca('0x42')][_0xfcca('0x47')](_0x1d4db5[_0xfcca('0x48')],{})[_0xfcca('0x22')](function(_0x306766){var _0x2b7334=_0x1d4db5[_0xfcca('0x49')][_0xfcca('0x24')]({'plain':!![]});if(!_0x2b7334)throw new Error(_0xfcca('0x4a'));if(_0x2b7334['role']===_0xfcca('0x49')){var _0xb1a638=_0x306766[_0xfcca('0x24')]({'plain':!![]});var _0x2fe9e5=_0xfcca('0x25');return db[_0xfcca('0x4b')][_0xfcca('0x4c')]({'where':{'name':_0x2fe9e5,'userProfileId':_0x2b7334[_0xfcca('0x4d')]},'raw':!![]})[_0xfcca('0x22')](function(_0x5461f1){if(_0x5461f1&&_0x5461f1[_0xfcca('0x4e')]===0x0){return db[_0xfcca('0x26')][_0xfcca('0x47')]({'name':_0xb1a638[_0xfcca('0x27')],'resourceId':_0xb1a638['id'],'type':_0x5461f1[_0xfcca('0x27')],'sectionId':_0x5461f1['id']},{})[_0xfcca('0x22')](function(){return _0x306766;});}else{return _0x306766;}})[_0xfcca('0x46')](function(_0x33f73a){logger[_0xfcca('0x4f')](_0xfcca('0x50'),_0x33f73a);throw _0x33f73a;});}return _0x306766;})[_0xfcca('0x22')](respondWithResult(_0x470ea4,0xc9))['catch'](handleError(_0x470ea4,null));};exports[_0xfcca('0x21')]=function(_0x3d627f,_0xd3816f){if(_0x3d627f['body']['id']){delete _0x3d627f['body']['id'];}return db[_0xfcca('0x42')][_0xfcca('0x4c')]({'where':{'id':_0x3d627f[_0xfcca('0x45')]['id']}})[_0xfcca('0x22')](handleEntityNotFound(_0xd3816f,null))[_0xfcca('0x22')](saveUpdates(_0x3d627f['body'],null))[_0xfcca('0x22')](respondWithResult(_0xd3816f,null))[_0xfcca('0x46')](handleError(_0xd3816f,null));};exports[_0xfcca('0x23')]=function(_0x259d7f,_0x9fa806){return db['SquareOdbc'][_0xfcca('0x4c')]({'where':{'id':_0x259d7f[_0xfcca('0x45')]['id']}})[_0xfcca('0x22')](handleEntityNotFound(_0x9fa806,null))[_0xfcca('0x22')](removeEntity(_0x9fa806,null))[_0xfcca('0x46')](handleError(_0x9fa806,null));};exports[_0xfcca('0x51')]=function(_0x495760,_0x160f4d,_0x3e3f7c){var _0x3a6624;return db['SquareOdbc']['find']({'where':{'id':_0x495760['params']['id']},'attributes':['id',_0xfcca('0x52')]})[_0xfcca('0x22')](handleEntityNotFound(_0x160f4d,null))[_0xfcca('0x22')](function(_0x3356c1){if(_0x3356c1){var _0x4fdb42=require(_0xfcca('0x53'))();_0x4fdb42['openSync'](_0x3356c1[_0xfcca('0x52')]);_0x4fdb42[_0xfcca('0x54')]();return _0x3356c1;}})[_0xfcca('0x22')](respondWithResult(_0x160f4d,null))[_0xfcca('0x46')](handleError(_0x160f4d,null));}; \ No newline at end of file +var _0xcb96=['rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','odbc','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll'];(function(_0x343adc,_0x2e1ad9){var _0x349c6b=function(_0x7e6362){while(--_0x7e6362){_0x343adc['push'](_0x343adc['shift']());}};_0x349c6b(++_0x2e1ad9);}(_0xcb96,0x16d));var _0x6cb9=function(_0x1c83fe,_0x38e39f){_0x1c83fe=_0x1c83fe-0x0;var _0x7652aa=_0xcb96[_0x1c83fe];return _0x7652aa;};'use strict';var emlformat=require(_0x6cb9('0x0'));var rimraf=require(_0x6cb9('0x1'));var zipdir=require(_0x6cb9('0x2'));var jsonpatch=require(_0x6cb9('0x3'));var rp=require(_0x6cb9('0x4'));var moment=require('moment');var BPromise=require(_0x6cb9('0x5'));var Mustache=require(_0x6cb9('0x6'));var util=require('util');var path=require(_0x6cb9('0x7'));var sox=require(_0x6cb9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cb9('0x9'));var _=require('lodash');var squel=require(_0x6cb9('0xa'));var crypto=require(_0x6cb9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6cb9('0xc'));var toCsv=require(_0x6cb9('0xd'));var querystring=require('querystring');var Papa=require(_0x6cb9('0xe'));var Redis=require(_0x6cb9('0xf'));var authService=require(_0x6cb9('0x10'));var qs=require(_0x6cb9('0x11'));var as=require(_0x6cb9('0x12'));var hardwareService=require(_0x6cb9('0x13'));var logger=require(_0x6cb9('0x14'))(_0x6cb9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6cb9('0x16'));var db=require(_0x6cb9('0x17'))['db'];function respondWithStatusCode(_0xb948cf,_0xca369){_0xca369=_0xca369||0xcc;return function(_0x50177b){if(_0x50177b){return _0xb948cf[_0x6cb9('0x18')](_0xca369);}return _0xb948cf[_0x6cb9('0x19')](_0xca369)[_0x6cb9('0x1a')]();};}function respondWithResult(_0x57628c,_0x54536c){_0x54536c=_0x54536c||0xc8;return function(_0x302500){if(_0x302500){return _0x57628c[_0x6cb9('0x19')](_0x54536c)['json'](_0x302500);}};}function respondWithFilteredResult(_0x55ee1d,_0x4f7612){return function(_0x312518){if(_0x312518){var _0x1f5584=typeof _0x4f7612[_0x6cb9('0x1b')]===_0x6cb9('0x1c')&&typeof _0x4f7612[_0x6cb9('0x1d')]==='undefined';var _0x152027=_0x312518[_0x6cb9('0x1e')];var _0x507ed8=_0x1f5584?0x0:_0x4f7612[_0x6cb9('0x1b')];var _0x3c488f=_0x1f5584?_0x312518[_0x6cb9('0x1e')]:_0x4f7612['offset']+_0x4f7612['limit'];var _0x116fe3;if(_0x3c488f>=_0x152027){_0x3c488f=_0x152027;_0x116fe3=0xc8;}else{_0x116fe3=0xce;}_0x55ee1d[_0x6cb9('0x19')](_0x116fe3);return _0x55ee1d[_0x6cb9('0x1f')](_0x6cb9('0x20'),_0x507ed8+'-'+_0x3c488f+'/'+_0x152027)[_0x6cb9('0x21')](_0x312518);}return null;};}function patchUpdates(_0x320a6f){return function(_0x4357f6){try{jsonpatch['apply'](_0x4357f6,_0x320a6f,!![]);}catch(_0x10f61a){return BPromise[_0x6cb9('0x22')](_0x10f61a);}return _0x4357f6[_0x6cb9('0x23')]();};}function saveUpdates(_0x38c981,_0x5510da){return function(_0x1f4290){if(_0x1f4290){return _0x1f4290[_0x6cb9('0x24')](_0x38c981)[_0x6cb9('0x25')](function(_0x29fe2a){return _0x29fe2a;});}return null;};}function removeEntity(_0x14bae5,_0x30c139){return function(_0x230bc1){if(_0x230bc1){return _0x230bc1[_0x6cb9('0x26')]()['then'](function(){var _0x1c226f=_0x230bc1[_0x6cb9('0x27')]({'plain':!![]});var _0x3e6965='ODBC';return db[_0x6cb9('0x28')]['destroy']({'where':{'type':_0x3e6965,'resourceId':_0x1c226f['id']}})['then'](function(){return _0x230bc1;});})['then'](function(){_0x14bae5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf8d7e1,_0x1e3835){return function(_0x47506a){if(!_0x47506a){_0xf8d7e1[_0x6cb9('0x18')](0x194);}return _0x47506a;};}function handleError(_0x34a6b3,_0x178794){_0x178794=_0x178794||0x1f4;return function(_0x184d19){logger[_0x6cb9('0x29')](_0x184d19[_0x6cb9('0x2a')]);if(_0x184d19[_0x6cb9('0x2b')]){delete _0x184d19[_0x6cb9('0x2b')];}_0x34a6b3['status'](_0x178794)[_0x6cb9('0x2c')](_0x184d19);};}exports[_0x6cb9('0x2d')]=function(_0x39f912,_0x2e8270){var _0x33c046={},_0x349a1d={},_0x328800={'count':0x0,'rows':[]};var _0x27daca=_[_0x6cb9('0x2e')](db[_0x6cb9('0x2f')]['rawAttributes'],function(_0x301698){return{'name':_0x301698[_0x6cb9('0x30')],'type':_0x301698[_0x6cb9('0x31')]['key']};});_0x349a1d[_0x6cb9('0x32')]=_['map'](_0x27daca,_0x6cb9('0x2b'));_0x349a1d[_0x6cb9('0x33')]=_[_0x6cb9('0x34')](_0x39f912['query']);_0x349a1d[_0x6cb9('0x35')]=_['intersection'](_0x349a1d['model'],_0x349a1d[_0x6cb9('0x33')]);_0x33c046['attributes']=_[_0x6cb9('0x36')](_0x349a1d[_0x6cb9('0x32')],qs['fields'](_0x39f912[_0x6cb9('0x33')][_0x6cb9('0x37')]));_0x33c046[_0x6cb9('0x38')]=_0x33c046[_0x6cb9('0x38')][_0x6cb9('0x39')]?_0x33c046[_0x6cb9('0x38')]:_0x349a1d['model'];if(!_0x39f912[_0x6cb9('0x33')][_0x6cb9('0x3a')](_0x6cb9('0x3b'))){_0x33c046[_0x6cb9('0x1d')]=qs[_0x6cb9('0x1d')](_0x39f912[_0x6cb9('0x33')][_0x6cb9('0x1d')]);_0x33c046[_0x6cb9('0x1b')]=qs[_0x6cb9('0x1b')](_0x39f912['query']['offset']);}_0x33c046[_0x6cb9('0x3c')]=qs[_0x6cb9('0x3d')](_0x39f912['query'][_0x6cb9('0x3d')]);_0x33c046[_0x6cb9('0x3e')]=qs[_0x6cb9('0x35')](_[_0x6cb9('0x3f')](_0x39f912[_0x6cb9('0x33')],_0x349a1d['filters']),_0x27daca);if(_0x39f912[_0x6cb9('0x33')]['filter']){_0x33c046[_0x6cb9('0x3e')]=_[_0x6cb9('0x40')](_0x33c046[_0x6cb9('0x3e')],{'$or':_['map'](_0x27daca,function(_0x225aa0){if(_0x225aa0['type']!==_0x6cb9('0x41')){var _0x5db27c={};_0x5db27c[_0x225aa0['name']]={'$like':'%'+_0x39f912[_0x6cb9('0x33')][_0x6cb9('0x42')]+'%'};return _0x5db27c;}})});}_0x33c046=_[_0x6cb9('0x40')]({},_0x33c046,_0x39f912[_0x6cb9('0x43')]);var _0x2c784a={'where':_0x33c046['where']};return db[_0x6cb9('0x2f')][_0x6cb9('0x1e')](_0x2c784a)[_0x6cb9('0x25')](function(_0x5980dd){_0x328800[_0x6cb9('0x1e')]=_0x5980dd;if(_0x39f912['query'][_0x6cb9('0x44')]){_0x33c046['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x6cb9('0x45')](_0x33c046);})[_0x6cb9('0x25')](function(_0x57d947){_0x328800[_0x6cb9('0x46')]=_0x57d947;return _0x328800;})[_0x6cb9('0x25')](respondWithFilteredResult(_0x2e8270,_0x33c046))[_0x6cb9('0x47')](handleError(_0x2e8270,null));};exports[_0x6cb9('0x48')]=function(_0xfc3547,_0x1dc9f7){var _0x376cf8={'raw':!![],'where':{'id':_0xfc3547[_0x6cb9('0x49')]['id']}},_0x3bc9fd={};_0x3bc9fd['model']=_[_0x6cb9('0x34')](db[_0x6cb9('0x2f')]['rawAttributes']);_0x3bc9fd[_0x6cb9('0x33')]=_[_0x6cb9('0x34')](_0xfc3547['query']);_0x3bc9fd[_0x6cb9('0x35')]=_[_0x6cb9('0x36')](_0x3bc9fd[_0x6cb9('0x32')],_0x3bc9fd[_0x6cb9('0x33')]);_0x376cf8[_0x6cb9('0x38')]=_['intersection'](_0x3bc9fd[_0x6cb9('0x32')],qs[_0x6cb9('0x37')](_0xfc3547[_0x6cb9('0x33')][_0x6cb9('0x37')]));_0x376cf8[_0x6cb9('0x38')]=_0x376cf8[_0x6cb9('0x38')]['length']?_0x376cf8['attributes']:_0x3bc9fd[_0x6cb9('0x32')];if(_0xfc3547[_0x6cb9('0x33')]['includeAll']){_0x376cf8['include']=[{'all':!![]}];}_0x376cf8=_[_0x6cb9('0x40')]({},_0x376cf8,_0xfc3547[_0x6cb9('0x43')]);return db['SquareOdbc']['find'](_0x376cf8)[_0x6cb9('0x25')](handleEntityNotFound(_0x1dc9f7,null))[_0x6cb9('0x25')](respondWithResult(_0x1dc9f7,null))['catch'](handleError(_0x1dc9f7,null));};exports['create']=function(_0x3477f9,_0x2e5d05){return db[_0x6cb9('0x2f')]['create'](_0x3477f9[_0x6cb9('0x4a')],{})[_0x6cb9('0x25')](function(_0x1b4380){var _0x5bf061=_0x3477f9[_0x6cb9('0x4b')][_0x6cb9('0x27')]({'plain':!![]});if(!_0x5bf061)throw new Error(_0x6cb9('0x4c'));if(_0x5bf061['role']===_0x6cb9('0x4b')){var _0x2fdc98=_0x1b4380[_0x6cb9('0x27')]({'plain':!![]});var _0x59a97e=_0x6cb9('0x4d');return db[_0x6cb9('0x4e')][_0x6cb9('0x4f')]({'where':{'name':_0x59a97e,'userProfileId':_0x5bf061[_0x6cb9('0x50')]},'raw':!![]})['then'](function(_0x3b4cde){if(_0x3b4cde&&_0x3b4cde[_0x6cb9('0x51')]===0x0){return db[_0x6cb9('0x28')][_0x6cb9('0x52')]({'name':_0x2fdc98[_0x6cb9('0x2b')],'resourceId':_0x2fdc98['id'],'type':_0x3b4cde['name'],'sectionId':_0x3b4cde['id']},{})[_0x6cb9('0x25')](function(){return _0x1b4380;});}else{return _0x1b4380;}})[_0x6cb9('0x47')](function(_0x40c18f){logger[_0x6cb9('0x29')](_0x6cb9('0x53'),_0x40c18f);throw _0x40c18f;});}return _0x1b4380;})[_0x6cb9('0x25')](respondWithResult(_0x2e5d05,0xc9))['catch'](handleError(_0x2e5d05,null));};exports[_0x6cb9('0x24')]=function(_0x2c48bd,_0x7139c2){if(_0x2c48bd[_0x6cb9('0x4a')]['id']){delete _0x2c48bd[_0x6cb9('0x4a')]['id'];}return db['SquareOdbc'][_0x6cb9('0x4f')]({'where':{'id':_0x2c48bd[_0x6cb9('0x49')]['id']}})['then'](handleEntityNotFound(_0x7139c2,null))[_0x6cb9('0x25')](saveUpdates(_0x2c48bd[_0x6cb9('0x4a')],null))[_0x6cb9('0x25')](respondWithResult(_0x7139c2,null))[_0x6cb9('0x47')](handleError(_0x7139c2,null));};exports[_0x6cb9('0x26')]=function(_0x4807d0,_0x2c2250){return db[_0x6cb9('0x2f')][_0x6cb9('0x4f')]({'where':{'id':_0x4807d0['params']['id']}})[_0x6cb9('0x25')](handleEntityNotFound(_0x2c2250,null))[_0x6cb9('0x25')](removeEntity(_0x2c2250,null))['catch'](handleError(_0x2c2250,null));};exports['test']=function(_0x39f82d,_0x8a0763,_0x33c426){var _0x59e482;return db[_0x6cb9('0x2f')][_0x6cb9('0x4f')]({'where':{'id':_0x39f82d[_0x6cb9('0x49')]['id']},'attributes':['id','dsn']})[_0x6cb9('0x25')](handleEntityNotFound(_0x8a0763,null))[_0x6cb9('0x25')](function(_0x100127){if(_0x100127){var _0x389a62=require(_0x6cb9('0x54'))();_0x389a62['openSync'](_0x100127[_0x6cb9('0x55')]);_0x389a62[_0x6cb9('0x56')]();return _0x100127;}})[_0x6cb9('0x25')](respondWithResult(_0x8a0763,null))[_0x6cb9('0x47')](handleError(_0x8a0763,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8d0e459..943e8b5 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 _0x14ed=['exports','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x383bd7,_0x45829a){var _0x3f83eb=function(_0x3183dd){while(--_0x3183dd){_0x383bd7['push'](_0x383bd7['shift']());}};_0x3f83eb(++_0x45829a);}(_0x14ed,0x65));var _0xd14e=function(_0x2405b6,_0x5be88c){_0x2405b6=_0x2405b6-0x0;var _0x5eaa81=_0x14ed[_0x2405b6];return _0x5eaa81;};'use strict';var _=require(_0xd14e('0x0'));var util=require(_0xd14e('0x1'));var logger=require(_0xd14e('0x2'))(_0xd14e('0x3'));var moment=require(_0xd14e('0x4'));var BPromise=require(_0xd14e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd14e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0xd14e('0x7')]=function(_0x335c1c,_0xac0f47){return _0x335c1c['define'](_0xd14e('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d09=['request-promise','path','../../config/environment','exports','square_odbc','lodash','util','api','moment','bluebird'];(function(_0x2803a7,_0x2888cf){var _0x14e0ed=function(_0x5727a9){while(--_0x5727a9){_0x2803a7['push'](_0x2803a7['shift']());}};_0x14e0ed(++_0x2888cf);}(_0x0d09,0x109));var _0x90d0=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x0d09[_0x210718];return _0x541bfc;};'use strict';var _=require(_0x90d0('0x0'));var util=require(_0x90d0('0x1'));var logger=require('../../config/logger')(_0x90d0('0x2'));var moment=require(_0x90d0('0x3'));var BPromise=require(_0x90d0('0x4'));var rp=require(_0x90d0('0x5'));var fs=require('fs');var path=require(_0x90d0('0x6'));var rimraf=require('rimraf');var config=require(_0x90d0('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x90d0('0x8')]=function(_0x5760dc,_0x7a9ba8){return _0x5760dc['define']('SquareOdbc',attributes,{'tableName':_0x90d0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index e00a272..8865620 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 _0xf5c6=['model','attributes','ShowSquareOdbc','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareOdbc','options','raw','where','include','map'];(function(_0x457834,_0x383f8a){var _0x3f0de6=function(_0x59b6f4){while(--_0x59b6f4){_0x457834['push'](_0x457834['shift']());}};_0x3f0de6(++_0x383f8a);}(_0xf5c6,0x8b));var _0x6f5c=function(_0x120802,_0x144dfd){_0x120802=_0x120802-0x0;var _0xd1e47f=_0xf5c6[_0x120802];return _0xd1e47f;};'use strict';var _=require(_0x6f5c('0x0'));var util=require(_0x6f5c('0x1'));var moment=require(_0x6f5c('0x2'));var BPromise=require(_0x6f5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f5c('0x4'));var db=require(_0x6f5c('0x5'))['db'];var utils=require(_0x6f5c('0x6'));var logger=require(_0x6f5c('0x7'))(_0x6f5c('0x8'));var config=require(_0x6f5c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6f5c('0xa')][_0x6f5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b75c2,_0x25c8ca,_0x31890e){return new BPromise(function(_0x4963e1,_0x9248bb){return client[_0x6f5c('0xc')](_0x4b75c2,_0x31890e)[_0x6f5c('0xd')](function(_0x33c86c){logger[_0x6f5c('0xe')](_0x6f5c('0xf'),_0x25c8ca,_0x6f5c('0x10'));logger[_0x6f5c('0x11')](_0x6f5c('0x12'),_0x25c8ca,_0x6f5c('0x10'),JSON[_0x6f5c('0x13')](_0x33c86c));if(_0x33c86c[_0x6f5c('0x14')]){if(_0x33c86c[_0x6f5c('0x14')][_0x6f5c('0x15')]===0x1f4){logger[_0x6f5c('0x14')](_0x6f5c('0xf'),_0x25c8ca,_0x33c86c[_0x6f5c('0x14')][_0x6f5c('0x16')]);return _0x9248bb(_0x33c86c[_0x6f5c('0x14')][_0x6f5c('0x16')]);}logger[_0x6f5c('0x14')](_0x6f5c('0xf'),_0x25c8ca,_0x33c86c[_0x6f5c('0x14')][_0x6f5c('0x16')]);return _0x4963e1(_0x33c86c['error'][_0x6f5c('0x16')]);}else{logger[_0x6f5c('0xe')](_0x6f5c('0xf'),_0x25c8ca,'request\x20sent');_0x4963e1(_0x33c86c[_0x6f5c('0x17')]['message']);}})[_0x6f5c('0x18')](function(_0x488819){logger[_0x6f5c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x25c8ca,_0x488819);_0x9248bb(_0x488819);});});}exports['ShowSquareOdbc']=function(_0x5a2e99){var _0x5f0d9a=this;return new Promise(function(_0x2109e8,_0x2815f9){return db[_0x6f5c('0x19')]['find']({'raw':_0x5a2e99[_0x6f5c('0x1a')]?_0x5a2e99[_0x6f5c('0x1a')][_0x6f5c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a2e99[_0x6f5c('0x1a')]?_0x5a2e99[_0x6f5c('0x1a')][_0x6f5c('0x1c')]||null:null,'attributes':_0x5a2e99[_0x6f5c('0x1a')]?_0x5a2e99[_0x6f5c('0x1a')]['attributes']||null:null,'include':_0x5a2e99[_0x6f5c('0x1a')]?_0x5a2e99[_0x6f5c('0x1a')][_0x6f5c('0x1d')]?_[_0x6f5c('0x1e')](_0x5a2e99['options'][_0x6f5c('0x1d')],function(_0x21ff9c){return{'model':db[_0x21ff9c[_0x6f5c('0x1f')]],'as':_0x21ff9c['as'],'attributes':_0x21ff9c[_0x6f5c('0x20')],'include':_0x21ff9c[_0x6f5c('0x1d')]?_[_0x6f5c('0x1e')](_0x21ff9c['include'],function(_0x22c634){return{'model':db[_0x22c634[_0x6f5c('0x1f')]],'as':_0x22c634['as'],'attributes':_0x22c634[_0x6f5c('0x20')],'include':_0x22c634[_0x6f5c('0x1d')]?_['map'](_0x22c634[_0x6f5c('0x1d')],function(_0x8c9e6c){return{'model':db[_0x8c9e6c[_0x6f5c('0x1f')]],'as':_0x8c9e6c['as'],'attributes':_0x8c9e6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x55e146){logger[_0x6f5c('0xe')](_0x6f5c('0x21'),_0x5a2e99);logger['debug'](_0x6f5c('0x21'),_0x5a2e99,JSON['stringify'](_0x55e146));_0x2109e8(_0x55e146);})[_0x6f5c('0x18')](function(_0x3062ab){logger['error']('ShowSquareOdbc',_0x3062ab[_0x6f5c('0x16')],_0x5a2e99);_0x2815f9(_0x5f0d9a[_0x6f5c('0x14')](0x1f4,_0x3062ab[_0x6f5c('0x16')]));});});}; \ No newline at end of file +var _0x7129=['jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSquareOdbc','SquareOdbc','options','where','attributes','include','map','model','debug','stringify','catch','util','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7129,0x8c));var _0x9712=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7129[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9712('0x0'));var moment=require(_0x9712('0x1'));var BPromise=require(_0x9712('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9712('0x3'));var logger=require(_0x9712('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9712('0x5'));var client=jayson[_0x9712('0x6')][_0x9712('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d0883,_0x1db586,_0x34fce5){return new BPromise(function(_0x342548,_0x10b431){return client[_0x9712('0x8')](_0x1d0883,_0x34fce5)[_0x9712('0x9')](function(_0x5706bb){logger[_0x9712('0xa')](_0x9712('0xb'),_0x1db586,_0x9712('0xc'));logger['debug'](_0x9712('0xd'),_0x1db586,'request\x20sent',JSON['stringify'](_0x5706bb));if(_0x5706bb[_0x9712('0xe')]){if(_0x5706bb[_0x9712('0xe')][_0x9712('0xf')]===0x1f4){logger[_0x9712('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x1db586,_0x5706bb[_0x9712('0xe')][_0x9712('0x10')]);return _0x10b431(_0x5706bb['error']['message']);}logger[_0x9712('0xe')](_0x9712('0xb'),_0x1db586,_0x5706bb[_0x9712('0xe')][_0x9712('0x10')]);return _0x342548(_0x5706bb[_0x9712('0xe')]['message']);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x1db586,_0x9712('0xc'));_0x342548(_0x5706bb[_0x9712('0x11')][_0x9712('0x10')]);}})['catch'](function(_0x19930c){logger[_0x9712('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x1db586,_0x19930c);_0x10b431(_0x19930c);});});}exports[_0x9712('0x12')]=function(_0x33a936){var _0x48ce64=this;return new Promise(function(_0x37ec09,_0x27b1a1){return db[_0x9712('0x13')]['find']({'raw':_0x33a936[_0x9712('0x14')]?_0x33a936[_0x9712('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x33a936[_0x9712('0x14')]?_0x33a936['options'][_0x9712('0x15')]||null:null,'attributes':_0x33a936[_0x9712('0x14')]?_0x33a936[_0x9712('0x14')][_0x9712('0x16')]||null:null,'include':_0x33a936[_0x9712('0x14')]?_0x33a936[_0x9712('0x14')][_0x9712('0x17')]?_[_0x9712('0x18')](_0x33a936[_0x9712('0x14')][_0x9712('0x17')],function(_0x44f892){return{'model':db[_0x44f892[_0x9712('0x19')]],'as':_0x44f892['as'],'attributes':_0x44f892[_0x9712('0x16')],'include':_0x44f892[_0x9712('0x17')]?_['map'](_0x44f892[_0x9712('0x17')],function(_0x3a1057){return{'model':db[_0x3a1057[_0x9712('0x19')]],'as':_0x3a1057['as'],'attributes':_0x3a1057[_0x9712('0x16')],'include':_0x3a1057[_0x9712('0x17')]?_[_0x9712('0x18')](_0x3a1057[_0x9712('0x17')],function(_0x597a69){return{'model':db[_0x597a69['model']],'as':_0x597a69['as'],'attributes':_0x597a69[_0x9712('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9712('0x9')](function(_0x3308b7){logger[_0x9712('0xa')](_0x9712('0x12'),_0x33a936);logger[_0x9712('0x1a')](_0x9712('0x12'),_0x33a936,JSON[_0x9712('0x1b')](_0x3308b7));_0x37ec09(_0x3308b7);})[_0x9712('0x1c')](function(_0x493a71){logger[_0x9712('0xe')](_0x9712('0x12'),_0x493a71[_0x9712('0x10')],_0x33a936);_0x27b1a1(_0x48ce64['error'](0x1f4,_0x493a71[_0x9712('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 4412075..0ed91d4 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 _0xa775=['./squareProject.controller','get','isAuthenticated','index','/:id/users','getUsers','post','create','put','update','delete','/:id','destroy','removeUsers','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0xa775,0xf6));var _0x5a77=function(_0x34b67b,_0x902225){_0x34b67b=_0x34b67b-0x0;var _0x40774b=_0xa775[_0x34b67b];return _0x40774b;};'use strict';var multer=require(_0x5a77('0x0'));var util=require('util');var path=require(_0x5a77('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a77('0x2')]();var fs_extra=require(_0x5a77('0x3'));var auth=require(_0x5a77('0x4'));var interaction=require(_0x5a77('0x5'));var config=require('../../config/environment');var controller=require(_0x5a77('0x6'));router[_0x5a77('0x7')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0x9')]);router[_0x5a77('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xb')]);router[_0x5a77('0xc')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0xd')]);router['post'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller['addUsers']);router[_0x5a77('0xe')]('/:id',auth[_0x5a77('0x8')](),controller[_0x5a77('0xf')]);router[_0x5a77('0x10')](_0x5a77('0x11'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x12')]);router['delete'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x13')]);module[_0x5a77('0x14')]=router; \ No newline at end of file +var _0x7ace=['/:id/users','addUsers','put','update','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers','post','create'];(function(_0x286279,_0x1e63f1){var _0x187344=function(_0x29a693){while(--_0x29a693){_0x286279['push'](_0x286279['shift']());}};_0x187344(++_0x1e63f1);}(_0x7ace,0xd6));var _0xe7ac=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7ace[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xe7ac('0x0'));var util=require(_0xe7ac('0x1'));var path=require(_0xe7ac('0x2'));var timeout=require(_0xe7ac('0x3'));var express=require(_0xe7ac('0x4'));var router=express[_0xe7ac('0x5')]();var fs_extra=require(_0xe7ac('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe7ac('0x7'));router[_0xe7ac('0x8')]('/',auth[_0xe7ac('0x9')](),controller[_0xe7ac('0xa')]);router[_0xe7ac('0x8')](_0xe7ac('0xb'),auth[_0xe7ac('0x9')](),controller[_0xe7ac('0xc')]);router[_0xe7ac('0x8')]('/:id/users',auth[_0xe7ac('0x9')](),controller[_0xe7ac('0xd')]);router[_0xe7ac('0xe')]('/',auth[_0xe7ac('0x9')](),controller[_0xe7ac('0xf')]);router['post'](_0xe7ac('0x10'),auth['isAuthenticated'](),controller[_0xe7ac('0x11')]);router[_0xe7ac('0x12')](_0xe7ac('0xb'),auth['isAuthenticated'](),controller[_0xe7ac('0x13')]);router[_0xe7ac('0x14')](_0xe7ac('0xb'),auth[_0xe7ac('0x9')](),controller['destroy']);router[_0xe7ac('0x14')](_0xe7ac('0x10'),auth['isAuthenticated'](),controller[_0xe7ac('0x15')]);module[_0xe7ac('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 0b15fcb..095c558 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 _0x682b=['TEXT','long','preproduction','getDataValue','toString','BLOB','production','DATE','sequelize','exports','name'];(function(_0x414584,_0x1a1da6){var _0x50b255=function(_0x3ae5ce){while(--_0x3ae5ce){_0x414584['push'](_0x414584['shift']());}};_0x50b255(++_0x1a1da6);}(_0x682b,0x1e1));var _0xb682=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x682b[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0xb682('0x0'));module[_0xb682('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb682('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xb682('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xb682('0x4')),'get':function(){if(this['getDataValue'](_0xb682('0x5'))){return this[_0xb682('0x6')](_0xb682('0x5'))[_0xb682('0x7')]('utf8');}}},'production':{'type':Sequelize[_0xb682('0x8')](_0xb682('0x4')),'get':function(){if(this[_0xb682('0x6')]('production')){return this[_0xb682('0x6')](_0xb682('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xb682('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x3274=['BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','STRING','name','TEXT'];(function(_0x1356b9,_0x2dadd2){var _0x4b97fd=function(_0x4ef1e3){while(--_0x4ef1e3){_0x1356b9['push'](_0x1356b9['shift']());}};_0x4b97fd(++_0x2dadd2);}(_0x3274,0x134));var _0x4327=function(_0x124840,_0x2e7a74){_0x124840=_0x124840-0x0;var _0x15f3e3=_0x3274[_0x124840];return _0x15f3e3;};'use strict';var Sequelize=require(_0x4327('0x0'));module['exports']={'name':{'type':Sequelize[_0x4327('0x1')],'unique':_0x4327('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x4327('0x3')]},'preproduction':{'type':Sequelize[_0x4327('0x4')](_0x4327('0x5')),'get':function(){if(this[_0x4327('0x6')](_0x4327('0x7'))){return this[_0x4327('0x6')]('preproduction')[_0x4327('0x8')](_0x4327('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0x4327('0x5')),'get':function(){if(this[_0x4327('0x6')]('production')){return this[_0x4327('0x6')](_0x4327('0xa'))['toString'](_0x4327('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x4327('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0a49eaf..e286322 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 _0x1643=['body','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','send','index','map','rawAttributes','fieldName','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','SquareProject','rows','catch','show','params','create','user','role','UserProfileSection','find','userProfileId','update'];(function(_0x5e3ffe,_0x4e670a){var _0x2c0c27=function(_0x173d30){while(--_0x173d30){_0x5e3ffe['push'](_0x5e3ffe['shift']());}};_0x2c0c27(++_0x4e670a);}(_0x1643,0x130));var _0x3164=function(_0x45a7be,_0x32c127){_0x45a7be=_0x45a7be-0x0;var _0x3c37e5=_0x1643[_0x45a7be];return _0x3c37e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3164('0x0'));var zipdir=require(_0x3164('0x1'));var jsonpatch=require(_0x3164('0x2'));var rp=require('request-promise');var moment=require(_0x3164('0x3'));var BPromise=require(_0x3164('0x4'));var Mustache=require(_0x3164('0x5'));var util=require(_0x3164('0x6'));var path=require(_0x3164('0x7'));var sox=require('sox');var csv=require(_0x3164('0x8'));var ejs=require(_0x3164('0x9'));var fs=require('fs');var fs_extra=require(_0x3164('0xa'));var _=require(_0x3164('0xb'));var squel=require(_0x3164('0xc'));var crypto=require('crypto');var jsforce=require(_0x3164('0xd'));var deskjs=require(_0x3164('0xe'));var toCsv=require(_0x3164('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3164('0xf'));var authService=require(_0x3164('0x10'));var qs=require(_0x3164('0x11'));var as=require(_0x3164('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3164('0x13'))(_0x3164('0x14'));var utils=require(_0x3164('0x15'));var config=require(_0x3164('0x16'));var licenseUtil=require(_0x3164('0x17'));var db=require(_0x3164('0x18'))['db'];config[_0x3164('0x19')]=_[_0x3164('0x1a')](config[_0x3164('0x19')],{'host':_0x3164('0x1b'),'port':0x18eb});var socket=require(_0x3164('0x1c'))(new Redis(config[_0x3164('0x19')]));require(_0x3164('0x1d'))['register'](socket);function respondWithStatusCode(_0x3d529f,_0x290235){_0x290235=_0x290235||0xcc;return function(_0x35d539){if(_0x35d539){return _0x3d529f[_0x3164('0x1e')](_0x290235);}return _0x3d529f['status'](_0x290235)[_0x3164('0x1f')]();};}function respondWithResult(_0x32cca6,_0x189035){_0x189035=_0x189035||0xc8;return function(_0x5dc47a){if(_0x5dc47a){return _0x32cca6['status'](_0x189035)['json'](_0x5dc47a);}};}function respondWithFilteredResult(_0x485e35,_0x459e55){return function(_0x5a9bf8){if(_0x5a9bf8){var _0x4d4a09=typeof _0x459e55[_0x3164('0x20')]===_0x3164('0x21')&&typeof _0x459e55[_0x3164('0x22')]===_0x3164('0x21');var _0x11fab8=_0x5a9bf8[_0x3164('0x23')];var _0x4f6a0b=_0x4d4a09?0x0:_0x459e55[_0x3164('0x20')];var _0xe290db=_0x4d4a09?_0x5a9bf8['count']:_0x459e55['offset']+_0x459e55['limit'];var _0x59225b;if(_0xe290db>=_0x11fab8){_0xe290db=_0x11fab8;_0x59225b=0xc8;}else{_0x59225b=0xce;}_0x485e35[_0x3164('0x24')](_0x59225b);return _0x485e35[_0x3164('0x25')](_0x3164('0x26'),_0x4f6a0b+'-'+_0xe290db+'/'+_0x11fab8)[_0x3164('0x27')](_0x5a9bf8);}return null;};}function patchUpdates(_0x5cad91){return function(_0x2c21b4){try{jsonpatch[_0x3164('0x28')](_0x2c21b4,_0x5cad91,!![]);}catch(_0x2f86ea){return BPromise[_0x3164('0x29')](_0x2f86ea);}return _0x2c21b4[_0x3164('0x2a')]();};}function saveUpdates(_0x216cac,_0x3c1d1f){return function(_0x2ade88){if(_0x2ade88){return _0x2ade88['update'](_0x216cac)[_0x3164('0x2b')](function(_0x44ef87){return _0x44ef87;});}return null;};}function removeEntity(_0x18eb56,_0x4d6458){return function(_0x547732){if(_0x547732){return _0x547732[_0x3164('0x2c')]()[_0x3164('0x2b')](function(){var _0xbfa273=_0x547732[_0x3164('0x2d')]({'plain':!![]});var _0xb842f3=_0x3164('0x2e');return db[_0x3164('0x2f')][_0x3164('0x2c')]({'where':{'type':_0xb842f3,'resourceId':_0xbfa273['id']}})['then'](function(){return _0x547732;});})[_0x3164('0x2b')](function(){_0x18eb56[_0x3164('0x24')](0xcc)[_0x3164('0x1f')]();});}};}function handleEntityNotFound(_0xdcc1d2,_0x197d9a){return function(_0x36c538){if(!_0x36c538){_0xdcc1d2[_0x3164('0x1e')](0x194);}return _0x36c538;};}function handleError(_0x4f8263,_0x403f61){_0x403f61=_0x403f61||0x1f4;return function(_0x2f19a1){logger['error'](_0x2f19a1['stack']);if(_0x2f19a1['name']){delete _0x2f19a1['name'];}_0x4f8263[_0x3164('0x24')](_0x403f61)[_0x3164('0x30')](_0x2f19a1);};}exports[_0x3164('0x31')]=function(_0x2eb9d8,_0x3a3b75){var _0x3dcdcb={},_0x1d4e07={},_0xe2dac5={'count':0x0,'rows':[]};var _0x5a7fcb=_[_0x3164('0x32')](db['SquareProject'][_0x3164('0x33')],function(_0xb0d306){return{'name':_0xb0d306[_0x3164('0x34')],'type':_0xb0d306['type'][_0x3164('0x35')]};});_0x1d4e07[_0x3164('0x36')]=_[_0x3164('0x32')](_0x5a7fcb,_0x3164('0x37'));_0x1d4e07['query']=_[_0x3164('0x38')](_0x2eb9d8[_0x3164('0x39')]);_0x1d4e07[_0x3164('0x3a')]=_[_0x3164('0x3b')](_0x1d4e07[_0x3164('0x36')],_0x1d4e07['query']);_0x3dcdcb['attributes']=_[_0x3164('0x3b')](_0x1d4e07[_0x3164('0x36')],qs[_0x3164('0x3c')](_0x2eb9d8[_0x3164('0x39')][_0x3164('0x3c')]));_0x3dcdcb[_0x3164('0x3d')]=_0x3dcdcb[_0x3164('0x3d')][_0x3164('0x3e')]?_0x3dcdcb[_0x3164('0x3d')]:_0x1d4e07[_0x3164('0x36')];if(!_0x2eb9d8[_0x3164('0x39')][_0x3164('0x3f')](_0x3164('0x40'))){_0x3dcdcb[_0x3164('0x22')]=qs['limit'](_0x2eb9d8[_0x3164('0x39')]['limit']);_0x3dcdcb[_0x3164('0x20')]=qs['offset'](_0x2eb9d8[_0x3164('0x39')][_0x3164('0x20')]);}_0x3dcdcb[_0x3164('0x41')]=qs[_0x3164('0x42')](_0x2eb9d8['query'][_0x3164('0x42')]);_0x3dcdcb[_0x3164('0x43')]=qs[_0x3164('0x3a')](_[_0x3164('0x44')](_0x2eb9d8[_0x3164('0x39')],_0x1d4e07[_0x3164('0x3a')]),_0x5a7fcb);if(_0x2eb9d8['query']['filter']){_0x3dcdcb[_0x3164('0x43')]=_['merge'](_0x3dcdcb['where'],{'$or':_['map'](_0x5a7fcb,function(_0x2bfb46){if(_0x2bfb46[_0x3164('0x45')]!==_0x3164('0x46')){var _0x1eeaed={};_0x1eeaed[_0x2bfb46[_0x3164('0x37')]]={'$like':'%'+_0x2eb9d8['query'][_0x3164('0x47')]+'%'};return _0x1eeaed;}})});}_0x3dcdcb=_[_0x3164('0x48')]({},_0x3dcdcb,_0x2eb9d8[_0x3164('0x49')]);var _0x54b0e1={'where':_0x3dcdcb[_0x3164('0x43')]};return db['SquareProject']['count'](_0x54b0e1)[_0x3164('0x2b')](function(_0x441621){_0xe2dac5['count']=_0x441621;if(_0x2eb9d8['query'][_0x3164('0x4a')]){_0x3dcdcb[_0x3164('0x4b')]=[{'all':!![]}];}return db[_0x3164('0x4c')]['findAll'](_0x3dcdcb);})['then'](function(_0x1afe2b){_0xe2dac5[_0x3164('0x4d')]=_0x1afe2b;return _0xe2dac5;})[_0x3164('0x2b')](respondWithFilteredResult(_0x3a3b75,_0x3dcdcb))[_0x3164('0x4e')](handleError(_0x3a3b75,null));};exports[_0x3164('0x4f')]=function(_0x2b4f0a,_0x25983c){var _0x31db33={'raw':![],'where':{'id':_0x2b4f0a[_0x3164('0x50')]['id']}},_0x10e746={};_0x10e746[_0x3164('0x36')]=_[_0x3164('0x38')](db[_0x3164('0x4c')]['rawAttributes']);_0x10e746['query']=_['keys'](_0x2b4f0a[_0x3164('0x39')]);_0x10e746[_0x3164('0x3a')]=_[_0x3164('0x3b')](_0x10e746[_0x3164('0x36')],_0x10e746[_0x3164('0x39')]);_0x31db33[_0x3164('0x3d')]=_[_0x3164('0x3b')](_0x10e746[_0x3164('0x36')],qs[_0x3164('0x3c')](_0x2b4f0a[_0x3164('0x39')][_0x3164('0x3c')]));_0x31db33[_0x3164('0x3d')]=_0x31db33[_0x3164('0x3d')][_0x3164('0x3e')]?_0x31db33[_0x3164('0x3d')]:_0x10e746['model'];if(_0x2b4f0a['query']['includeAll']){_0x31db33[_0x3164('0x4b')]=[{'all':!![]}];}_0x31db33=_[_0x3164('0x48')]({},_0x31db33,_0x2b4f0a[_0x3164('0x49')]);return db['SquareProject']['find'](_0x31db33)[_0x3164('0x2b')](handleEntityNotFound(_0x25983c,null))[_0x3164('0x2b')](respondWithResult(_0x25983c,null))[_0x3164('0x4e')](handleError(_0x25983c,null));};exports[_0x3164('0x51')]=function(_0x46f157,_0x2f96c3){return db[_0x3164('0x4c')][_0x3164('0x51')](_0x46f157['body'],{})['then'](function(_0x4a4838){var _0x39edd3=_0x46f157[_0x3164('0x52')][_0x3164('0x2d')]({'plain':!![]});if(!_0x39edd3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39edd3[_0x3164('0x53')]==='user'){var _0x3e4ca3=_0x4a4838[_0x3164('0x2d')]({'plain':!![]});var _0x2059ec=_0x3164('0x2e');return db[_0x3164('0x54')][_0x3164('0x55')]({'where':{'name':_0x2059ec,'userProfileId':_0x39edd3[_0x3164('0x56')]},'raw':!![]})[_0x3164('0x2b')](function(_0x5e3843){if(_0x5e3843&&_0x5e3843['autoAssociation']===0x0){return db[_0x3164('0x2f')]['create']({'name':_0x3e4ca3[_0x3164('0x37')],'resourceId':_0x3e4ca3['id'],'type':_0x5e3843[_0x3164('0x37')],'sectionId':_0x5e3843['id']},{})[_0x3164('0x2b')](function(){return _0x4a4838;});}else{return _0x4a4838;}})[_0x3164('0x4e')](function(_0x5ef345){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ef345);throw _0x5ef345;});}return _0x4a4838;})[_0x3164('0x2b')](respondWithResult(_0x2f96c3,0xc9))[_0x3164('0x4e')](handleError(_0x2f96c3,null));};exports[_0x3164('0x57')]=function(_0x382ca0,_0x5cf38b){if(_0x382ca0[_0x3164('0x58')]['id']){delete _0x382ca0[_0x3164('0x58')]['id'];}return db['SquareProject'][_0x3164('0x55')]({'where':{'id':_0x382ca0[_0x3164('0x50')]['id']}})[_0x3164('0x2b')](handleEntityNotFound(_0x5cf38b,null))[_0x3164('0x2b')](saveUpdates(_0x382ca0[_0x3164('0x58')],null))[_0x3164('0x2b')](respondWithResult(_0x5cf38b,null))['catch'](handleError(_0x5cf38b,null));};exports[_0x3164('0x2c')]=function(_0x33b5ff,_0x48661c){return db[_0x3164('0x4c')][_0x3164('0x55')]({'where':{'id':_0x33b5ff[_0x3164('0x50')]['id']}})[_0x3164('0x2b')](handleEntityNotFound(_0x48661c,null))[_0x3164('0x2b')](removeEntity(_0x48661c,null))[_0x3164('0x4e')](handleError(_0x48661c,null));};exports[_0x3164('0x59')]=function(_0x55bac3,_0x1dbc2,_0x1b1431){return db[_0x3164('0x4c')][_0x3164('0x55')]({'where':{'id':_0x55bac3[_0x3164('0x50')]['id']}})[_0x3164('0x2b')](handleEntityNotFound(_0x1dbc2,null))['then'](function(_0x51c5fe){if(_0x51c5fe){return _0x51c5fe[_0x3164('0x59')](_0x55bac3[_0x3164('0x58')]['ids'],_[_0x3164('0x5a')](_0x55bac3['body'],[_0x3164('0x5b'),'id'])||{});}})[_0x3164('0x2b')](respondWithResult(_0x1dbc2,null))[_0x3164('0x4e')](handleError(_0x1dbc2,null));};exports[_0x3164('0x5c')]=function(_0x538e4a,_0x74c64d,_0x489465){return db[_0x3164('0x4c')][_0x3164('0x55')]({'where':{'id':_0x538e4a['params']['id']}})[_0x3164('0x2b')](handleEntityNotFound(_0x74c64d,null))['then'](function(_0x12beaa){if(_0x12beaa){return _0x12beaa[_0x3164('0x5c')](_0x538e4a['query'][_0x3164('0x5b')])[_0x3164('0x2b')](function(){if(_[_0x3164('0x5d')](_0x538e4a[_0x3164('0x39')][_0x3164('0x5b')])){for(var _0x474e5c=0x0;_0x474e5c<_0x538e4a[_0x3164('0x39')][_0x3164('0x5b')][_0x3164('0x3e')];_0x474e5c+=0x1){socket[_0x3164('0x5e')](_0x3164('0x5f'),{'UserId':Number(_0x538e4a[_0x3164('0x39')][_0x3164('0x5b')][_0x474e5c]),'SquareProjectId':Number(_0x538e4a[_0x3164('0x50')]['id'])});}}else{socket['emit'](_0x3164('0x5f'),{'UserId':Number(_0x538e4a['query'][_0x3164('0x5b')]),'SquareProjectId':Number(_0x538e4a[_0x3164('0x50')]['id'])});}});}})[_0x3164('0x2b')](respondWithStatusCode(_0x74c64d,null))[_0x3164('0x4e')](handleError(_0x74c64d,null));};exports[_0x3164('0x60')]=function(_0x36ff54,_0xae3e5e,_0xe6d659){var _0x319c7e={};var _0x1b91d2={};var _0x4f330e;var _0x6dca54;return db[_0x3164('0x4c')]['findOne']({'where':{'id':_0x36ff54[_0x3164('0x50')]['id']}})['then'](handleEntityNotFound(_0xae3e5e,null))[_0x3164('0x2b')](function(_0x1ca2dd){if(_0x1ca2dd){_0x4f330e=_0x1ca2dd;_0x1b91d2[_0x3164('0x36')]=_['keys'](db[_0x3164('0x61')][_0x3164('0x33')]);_0x1b91d2[_0x3164('0x39')]=_[_0x3164('0x38')](_0x36ff54[_0x3164('0x39')]);_0x1b91d2[_0x3164('0x3a')]=_[_0x3164('0x3b')](_0x1b91d2['model'],_0x1b91d2['query']);_0x319c7e[_0x3164('0x3d')]=_[_0x3164('0x3b')](_0x1b91d2[_0x3164('0x36')],qs[_0x3164('0x3c')](_0x36ff54[_0x3164('0x39')]['fields']));_0x319c7e['attributes']=_0x319c7e[_0x3164('0x3d')]['length']?_0x319c7e[_0x3164('0x3d')]:_0x1b91d2[_0x3164('0x36')];_0x319c7e['order']=qs[_0x3164('0x42')](_0x36ff54['query'][_0x3164('0x42')]);_0x319c7e[_0x3164('0x43')]=qs[_0x3164('0x3a')](_[_0x3164('0x44')](_0x36ff54[_0x3164('0x39')],_0x1b91d2[_0x3164('0x3a')]));if(_0x36ff54[_0x3164('0x39')][_0x3164('0x47')]){_0x319c7e[_0x3164('0x43')]=_[_0x3164('0x48')](_0x319c7e['where'],{'$or':_[_0x3164('0x32')](_0x319c7e[_0x3164('0x3d')],function(_0x57d335){var _0x215048={};_0x215048[_0x57d335]={'$like':'%'+_0x36ff54[_0x3164('0x39')][_0x3164('0x47')]+'%'};return _0x215048;})});}_0x319c7e=_[_0x3164('0x48')]({},_0x319c7e,_0x36ff54[_0x3164('0x49')]);return _0x4f330e[_0x3164('0x60')](_0x319c7e);}})['then'](function(_0xe666bf){if(_0xe666bf){_0x6dca54=_0xe666bf[_0x3164('0x3e')];if(!_0x36ff54[_0x3164('0x39')][_0x3164('0x3f')]('nolimit')){_0x319c7e[_0x3164('0x22')]=qs['limit'](_0x36ff54['query']['limit']);_0x319c7e[_0x3164('0x20')]=qs[_0x3164('0x20')](_0x36ff54[_0x3164('0x39')]['offset']);}return _0x4f330e[_0x3164('0x60')](_0x319c7e);}})['then'](function(_0x38e7b8){if(_0x38e7b8){return _0x38e7b8?{'count':_0x6dca54,'rows':_0x38e7b8}:null;}})[_0x3164('0x2b')](respondWithResult(_0xae3e5e,null))[_0x3164('0x4e')](handleError(_0xae3e5e,null));}; \ No newline at end of file +var _0xd5a0=['where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','order','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','SquareProjects','UserProfileResource','destroy','error','stack','name','send','index','SquareProject','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2170e2,_0x3cfed3){var _0xc5c2b8=function(_0x1afe44){while(--_0x1afe44){_0x2170e2['push'](_0x2170e2['shift']());}};_0xc5c2b8(++_0x3cfed3);}(_0xd5a0,0x1a9));var _0x0d5a=function(_0xe1784f,_0x4a4d3e){_0xe1784f=_0xe1784f-0x0;var _0x25e8e2=_0xd5a0[_0xe1784f];return _0x25e8e2;};'use strict';var emlformat=require(_0x0d5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d5a('0x1'));var jsonpatch=require(_0x0d5a('0x2'));var rp=require('request-promise');var moment=require(_0x0d5a('0x3'));var BPromise=require(_0x0d5a('0x4'));var Mustache=require(_0x0d5a('0x5'));var util=require(_0x0d5a('0x6'));var path=require(_0x0d5a('0x7'));var sox=require('sox');var csv=require(_0x0d5a('0x8'));var ejs=require(_0x0d5a('0x9'));var fs=require('fs');var fs_extra=require(_0x0d5a('0xa'));var _=require(_0x0d5a('0xb'));var squel=require('squel');var crypto=require(_0x0d5a('0xc'));var jsforce=require(_0x0d5a('0xd'));var deskjs=require(_0x0d5a('0xe'));var toCsv=require(_0x0d5a('0x8'));var querystring=require(_0x0d5a('0xf'));var Papa=require(_0x0d5a('0x10'));var Redis=require(_0x0d5a('0x11'));var authService=require(_0x0d5a('0x12'));var qs=require(_0x0d5a('0x13'));var as=require(_0x0d5a('0x14'));var hardwareService=require(_0x0d5a('0x15'));var logger=require(_0x0d5a('0x16'))(_0x0d5a('0x17'));var utils=require(_0x0d5a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0d5a('0x19'));var db=require(_0x0d5a('0x1a'))['db'];config[_0x0d5a('0x1b')]=_[_0x0d5a('0x1c')](config[_0x0d5a('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d5a('0x1d'))(new Redis(config[_0x0d5a('0x1b')]));require(_0x0d5a('0x1e'))['register'](socket);function respondWithStatusCode(_0x3560a7,_0x1f4be9){_0x1f4be9=_0x1f4be9||0xcc;return function(_0x52e4fb){if(_0x52e4fb){return _0x3560a7[_0x0d5a('0x1f')](_0x1f4be9);}return _0x3560a7[_0x0d5a('0x20')](_0x1f4be9)[_0x0d5a('0x21')]();};}function respondWithResult(_0x4213ed,_0x4a8346){_0x4a8346=_0x4a8346||0xc8;return function(_0x26d6ce){if(_0x26d6ce){return _0x4213ed['status'](_0x4a8346)['json'](_0x26d6ce);}};}function respondWithFilteredResult(_0x1ae785,_0x4016b9){return function(_0x101ec4){if(_0x101ec4){var _0xed4ab=typeof _0x4016b9[_0x0d5a('0x22')]===_0x0d5a('0x23')&&typeof _0x4016b9[_0x0d5a('0x24')]===_0x0d5a('0x23');var _0x262a9a=_0x101ec4[_0x0d5a('0x25')];var _0x24bf15=_0xed4ab?0x0:_0x4016b9['offset'];var _0x1748b6=_0xed4ab?_0x101ec4[_0x0d5a('0x25')]:_0x4016b9[_0x0d5a('0x22')]+_0x4016b9[_0x0d5a('0x24')];var _0x1a942f;if(_0x1748b6>=_0x262a9a){_0x1748b6=_0x262a9a;_0x1a942f=0xc8;}else{_0x1a942f=0xce;}_0x1ae785[_0x0d5a('0x20')](_0x1a942f);return _0x1ae785[_0x0d5a('0x26')]('Content-Range',_0x24bf15+'-'+_0x1748b6+'/'+_0x262a9a)[_0x0d5a('0x27')](_0x101ec4);}return null;};}function patchUpdates(_0x1f8827){return function(_0x4f1fa8){try{jsonpatch['apply'](_0x4f1fa8,_0x1f8827,!![]);}catch(_0x15dfe1){return BPromise[_0x0d5a('0x28')](_0x15dfe1);}return _0x4f1fa8['save']();};}function saveUpdates(_0x9a7332,_0x5ed922){return function(_0x457ea4){if(_0x457ea4){return _0x457ea4[_0x0d5a('0x29')](_0x9a7332)['then'](function(_0x15b1e0){return _0x15b1e0;});}return null;};}function removeEntity(_0x4e323e,_0x1420c1){return function(_0x3d7a61){if(_0x3d7a61){return _0x3d7a61['destroy']()[_0x0d5a('0x2a')](function(){var _0x1b1e18=_0x3d7a61['get']({'plain':!![]});var _0x3253a1=_0x0d5a('0x2b');return db[_0x0d5a('0x2c')][_0x0d5a('0x2d')]({'where':{'type':_0x3253a1,'resourceId':_0x1b1e18['id']}})[_0x0d5a('0x2a')](function(){return _0x3d7a61;});})[_0x0d5a('0x2a')](function(){_0x4e323e[_0x0d5a('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7ae3,_0x661bb1){return function(_0x39d708){if(!_0x39d708){_0x4b7ae3[_0x0d5a('0x1f')](0x194);}return _0x39d708;};}function handleError(_0x145440,_0x10e17d){_0x10e17d=_0x10e17d||0x1f4;return function(_0x21aea8){logger[_0x0d5a('0x2e')](_0x21aea8[_0x0d5a('0x2f')]);if(_0x21aea8[_0x0d5a('0x30')]){delete _0x21aea8[_0x0d5a('0x30')];}_0x145440[_0x0d5a('0x20')](_0x10e17d)[_0x0d5a('0x31')](_0x21aea8);};}exports[_0x0d5a('0x32')]=function(_0x435bb6,_0x597a33){var _0x334492={},_0x367c19={},_0x432c2f={'count':0x0,'rows':[]};var _0x1c5c33=_['map'](db[_0x0d5a('0x33')]['rawAttributes'],function(_0x4645e1){return{'name':_0x4645e1[_0x0d5a('0x34')],'type':_0x4645e1[_0x0d5a('0x35')]['key']};});_0x367c19[_0x0d5a('0x36')]=_[_0x0d5a('0x37')](_0x1c5c33,'name');_0x367c19[_0x0d5a('0x38')]=_['keys'](_0x435bb6[_0x0d5a('0x38')]);_0x367c19[_0x0d5a('0x39')]=_['intersection'](_0x367c19[_0x0d5a('0x36')],_0x367c19['query']);_0x334492[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x367c19['model'],qs[_0x0d5a('0x3c')](_0x435bb6[_0x0d5a('0x38')][_0x0d5a('0x3c')]));_0x334492[_0x0d5a('0x3a')]=_0x334492[_0x0d5a('0x3a')][_0x0d5a('0x3d')]?_0x334492[_0x0d5a('0x3a')]:_0x367c19[_0x0d5a('0x36')];if(!_0x435bb6[_0x0d5a('0x38')][_0x0d5a('0x3e')](_0x0d5a('0x3f'))){_0x334492[_0x0d5a('0x24')]=qs[_0x0d5a('0x24')](_0x435bb6[_0x0d5a('0x38')][_0x0d5a('0x24')]);_0x334492['offset']=qs[_0x0d5a('0x22')](_0x435bb6[_0x0d5a('0x38')][_0x0d5a('0x22')]);}_0x334492['order']=qs[_0x0d5a('0x40')](_0x435bb6[_0x0d5a('0x38')]['sort']);_0x334492[_0x0d5a('0x41')]=qs[_0x0d5a('0x39')](_[_0x0d5a('0x42')](_0x435bb6[_0x0d5a('0x38')],_0x367c19[_0x0d5a('0x39')]),_0x1c5c33);if(_0x435bb6['query'][_0x0d5a('0x43')]){_0x334492['where']=_['merge'](_0x334492[_0x0d5a('0x41')],{'$or':_[_0x0d5a('0x37')](_0x1c5c33,function(_0x101721){if(_0x101721[_0x0d5a('0x35')]!=='VIRTUAL'){var _0x4b57c7={};_0x4b57c7[_0x101721['name']]={'$like':'%'+_0x435bb6[_0x0d5a('0x38')]['filter']+'%'};return _0x4b57c7;}})});}_0x334492=_[_0x0d5a('0x44')]({},_0x334492,_0x435bb6['options']);var _0x478b99={'where':_0x334492[_0x0d5a('0x41')]};return db[_0x0d5a('0x33')]['count'](_0x478b99)['then'](function(_0x41dfb8){_0x432c2f['count']=_0x41dfb8;if(_0x435bb6[_0x0d5a('0x38')][_0x0d5a('0x45')]){_0x334492['include']=[{'all':!![]}];}return db[_0x0d5a('0x33')][_0x0d5a('0x46')](_0x334492);})[_0x0d5a('0x2a')](function(_0x427cba){_0x432c2f[_0x0d5a('0x47')]=_0x427cba;return _0x432c2f;})[_0x0d5a('0x2a')](respondWithFilteredResult(_0x597a33,_0x334492))[_0x0d5a('0x48')](handleError(_0x597a33,null));};exports[_0x0d5a('0x49')]=function(_0x314354,_0xe88681){var _0x517aff={'raw':![],'where':{'id':_0x314354[_0x0d5a('0x4a')]['id']}},_0x3cf188={};_0x3cf188[_0x0d5a('0x36')]=_['keys'](db[_0x0d5a('0x33')][_0x0d5a('0x4b')]);_0x3cf188[_0x0d5a('0x38')]=_[_0x0d5a('0x4c')](_0x314354[_0x0d5a('0x38')]);_0x3cf188['filters']=_[_0x0d5a('0x3b')](_0x3cf188[_0x0d5a('0x36')],_0x3cf188[_0x0d5a('0x38')]);_0x517aff[_0x0d5a('0x3a')]=_[_0x0d5a('0x3b')](_0x3cf188[_0x0d5a('0x36')],qs[_0x0d5a('0x3c')](_0x314354[_0x0d5a('0x38')][_0x0d5a('0x3c')]));_0x517aff[_0x0d5a('0x3a')]=_0x517aff[_0x0d5a('0x3a')][_0x0d5a('0x3d')]?_0x517aff[_0x0d5a('0x3a')]:_0x3cf188[_0x0d5a('0x36')];if(_0x314354[_0x0d5a('0x38')][_0x0d5a('0x45')]){_0x517aff['include']=[{'all':!![]}];}_0x517aff=_[_0x0d5a('0x44')]({},_0x517aff,_0x314354[_0x0d5a('0x4d')]);return db[_0x0d5a('0x33')]['find'](_0x517aff)[_0x0d5a('0x2a')](handleEntityNotFound(_0xe88681,null))['then'](respondWithResult(_0xe88681,null))[_0x0d5a('0x48')](handleError(_0xe88681,null));};exports[_0x0d5a('0x4e')]=function(_0x5c2943,_0x2f1b40){return db['SquareProject'][_0x0d5a('0x4e')](_0x5c2943[_0x0d5a('0x4f')],{})[_0x0d5a('0x2a')](function(_0x430e58){var _0x1bfee3=_0x5c2943['user'][_0x0d5a('0x50')]({'plain':!![]});if(!_0x1bfee3)throw new Error(_0x0d5a('0x51'));if(_0x1bfee3['role']===_0x0d5a('0x52')){var _0x23889e=_0x430e58[_0x0d5a('0x50')]({'plain':!![]});var _0x400cc9=_0x0d5a('0x2b');return db[_0x0d5a('0x53')]['find']({'where':{'name':_0x400cc9,'userProfileId':_0x1bfee3[_0x0d5a('0x54')]},'raw':!![]})[_0x0d5a('0x2a')](function(_0x399874){if(_0x399874&&_0x399874[_0x0d5a('0x55')]===0x0){return db[_0x0d5a('0x2c')][_0x0d5a('0x4e')]({'name':_0x23889e[_0x0d5a('0x30')],'resourceId':_0x23889e['id'],'type':_0x399874[_0x0d5a('0x30')],'sectionId':_0x399874['id']},{})[_0x0d5a('0x2a')](function(){return _0x430e58;});}else{return _0x430e58;}})['catch'](function(_0x3c028c){logger[_0x0d5a('0x2e')](_0x0d5a('0x56'),_0x3c028c);throw _0x3c028c;});}return _0x430e58;})[_0x0d5a('0x2a')](respondWithResult(_0x2f1b40,0xc9))[_0x0d5a('0x48')](handleError(_0x2f1b40,null));};exports[_0x0d5a('0x29')]=function(_0x17e19c,_0x8883ef){if(_0x17e19c[_0x0d5a('0x4f')]['id']){delete _0x17e19c[_0x0d5a('0x4f')]['id'];}return db[_0x0d5a('0x33')][_0x0d5a('0x57')]({'where':{'id':_0x17e19c[_0x0d5a('0x4a')]['id']}})[_0x0d5a('0x2a')](handleEntityNotFound(_0x8883ef,null))['then'](saveUpdates(_0x17e19c['body'],null))[_0x0d5a('0x2a')](respondWithResult(_0x8883ef,null))[_0x0d5a('0x48')](handleError(_0x8883ef,null));};exports[_0x0d5a('0x2d')]=function(_0x4308ff,_0xe3f1e1){return db['SquareProject']['find']({'where':{'id':_0x4308ff['params']['id']}})['then'](handleEntityNotFound(_0xe3f1e1,null))[_0x0d5a('0x2a')](removeEntity(_0xe3f1e1,null))[_0x0d5a('0x48')](handleError(_0xe3f1e1,null));};exports[_0x0d5a('0x58')]=function(_0x4df30a,_0x522160,_0x57d757){return db['SquareProject']['find']({'where':{'id':_0x4df30a['params']['id']}})[_0x0d5a('0x2a')](handleEntityNotFound(_0x522160,null))[_0x0d5a('0x2a')](function(_0x36734c){if(_0x36734c){return _0x36734c[_0x0d5a('0x58')](_0x4df30a[_0x0d5a('0x4f')][_0x0d5a('0x59')],_[_0x0d5a('0x5a')](_0x4df30a[_0x0d5a('0x4f')],[_0x0d5a('0x59'),'id'])||{});}})[_0x0d5a('0x2a')](respondWithResult(_0x522160,null))['catch'](handleError(_0x522160,null));};exports[_0x0d5a('0x5b')]=function(_0x3644a0,_0x4566c5,_0x2822f3){return db[_0x0d5a('0x33')][_0x0d5a('0x57')]({'where':{'id':_0x3644a0[_0x0d5a('0x4a')]['id']}})[_0x0d5a('0x2a')](handleEntityNotFound(_0x4566c5,null))[_0x0d5a('0x2a')](function(_0x16721e){if(_0x16721e){return _0x16721e[_0x0d5a('0x5b')](_0x3644a0[_0x0d5a('0x38')][_0x0d5a('0x59')])[_0x0d5a('0x2a')](function(){if(_[_0x0d5a('0x5c')](_0x3644a0[_0x0d5a('0x38')][_0x0d5a('0x59')])){for(var _0x1fcaaa=0x0;_0x1fcaaa<_0x3644a0[_0x0d5a('0x38')][_0x0d5a('0x59')][_0x0d5a('0x3d')];_0x1fcaaa+=0x1){socket['emit'](_0x0d5a('0x5d'),{'UserId':Number(_0x3644a0[_0x0d5a('0x38')]['ids'][_0x1fcaaa]),'SquareProjectId':Number(_0x3644a0[_0x0d5a('0x4a')]['id'])});}}else{socket[_0x0d5a('0x5e')](_0x0d5a('0x5d'),{'UserId':Number(_0x3644a0['query'][_0x0d5a('0x59')]),'SquareProjectId':Number(_0x3644a0[_0x0d5a('0x4a')]['id'])});}});}})[_0x0d5a('0x2a')](respondWithStatusCode(_0x4566c5,null))['catch'](handleError(_0x4566c5,null));};exports[_0x0d5a('0x5f')]=function(_0x4597be,_0xa7c7f0,_0x5706ca){var _0x43d10b={};var _0x172346={};var _0x3907a9;var _0x273da5;return db[_0x0d5a('0x33')][_0x0d5a('0x60')]({'where':{'id':_0x4597be[_0x0d5a('0x4a')]['id']}})[_0x0d5a('0x2a')](handleEntityNotFound(_0xa7c7f0,null))[_0x0d5a('0x2a')](function(_0x4fa93f){if(_0x4fa93f){_0x3907a9=_0x4fa93f;_0x172346[_0x0d5a('0x36')]=_[_0x0d5a('0x4c')](db['User']['rawAttributes']);_0x172346[_0x0d5a('0x38')]=_[_0x0d5a('0x4c')](_0x4597be[_0x0d5a('0x38')]);_0x172346[_0x0d5a('0x39')]=_['intersection'](_0x172346[_0x0d5a('0x36')],_0x172346['query']);_0x43d10b[_0x0d5a('0x3a')]=_['intersection'](_0x172346[_0x0d5a('0x36')],qs[_0x0d5a('0x3c')](_0x4597be[_0x0d5a('0x38')][_0x0d5a('0x3c')]));_0x43d10b[_0x0d5a('0x3a')]=_0x43d10b['attributes']['length']?_0x43d10b[_0x0d5a('0x3a')]:_0x172346['model'];_0x43d10b[_0x0d5a('0x61')]=qs['sort'](_0x4597be[_0x0d5a('0x38')][_0x0d5a('0x40')]);_0x43d10b[_0x0d5a('0x41')]=qs[_0x0d5a('0x39')](_[_0x0d5a('0x42')](_0x4597be['query'],_0x172346['filters']));if(_0x4597be['query'][_0x0d5a('0x43')]){_0x43d10b[_0x0d5a('0x41')]=_['merge'](_0x43d10b['where'],{'$or':_[_0x0d5a('0x37')](_0x43d10b['attributes'],function(_0x5a8ce6){var _0x489b0a={};_0x489b0a[_0x5a8ce6]={'$like':'%'+_0x4597be[_0x0d5a('0x38')][_0x0d5a('0x43')]+'%'};return _0x489b0a;})});}_0x43d10b=_[_0x0d5a('0x44')]({},_0x43d10b,_0x4597be[_0x0d5a('0x4d')]);return _0x3907a9['getUsers'](_0x43d10b);}})[_0x0d5a('0x2a')](function(_0x2ea5c8){if(_0x2ea5c8){_0x273da5=_0x2ea5c8[_0x0d5a('0x3d')];if(!_0x4597be[_0x0d5a('0x38')]['hasOwnProperty']('nolimit')){_0x43d10b[_0x0d5a('0x24')]=qs[_0x0d5a('0x24')](_0x4597be['query'][_0x0d5a('0x24')]);_0x43d10b[_0x0d5a('0x22')]=qs['offset'](_0x4597be[_0x0d5a('0x38')][_0x0d5a('0x22')]);}return _0x3907a9[_0x0d5a('0x5f')](_0x43d10b);}})[_0x0d5a('0x2a')](function(_0x32f9d4){if(_0x32f9d4){return _0x32f9d4?{'count':_0x273da5,'rows':_0x32f9d4}:null;}})[_0x0d5a('0x2a')](respondWithResult(_0xa7c7f0,null))['catch'](handleError(_0xa7c7f0,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 51bec10..3e78b9f 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 _0x2bd2=['events','SquareProject','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x56a591,_0xac9071){var _0x3f9775=function(_0x476cb0){while(--_0x476cb0){_0x56a591['push'](_0x56a591['shift']());}};_0x3f9775(++_0xac9071);}(_0x2bd2,0xf0));var _0x22bd=function(_0x79a856,_0x20b948){_0x79a856=_0x79a856-0x0;var _0x2d2093=_0x2bd2[_0x79a856];return _0x2d2093;};'use strict';var EventEmitter=require(_0x22bd('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x22bd('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22bd('0x2'),'afterUpdate':_0x22bd('0x3'),'afterDestroy':_0x22bd('0x4')};function emitEvent(_0x167ee7){return function(_0x2a2862,_0x1d1841,_0x2c6a1c){SquareProjectEvents[_0x22bd('0x5')](_0x167ee7+':'+_0x2a2862['id'],_0x2a2862);SquareProjectEvents[_0x22bd('0x5')](_0x167ee7,_0x2a2862);_0x2c6a1c(null);};}for(var e in events){if(events[_0x22bd('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x22bd('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xccd5=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x482fcc,_0x448923){var _0x16ab21=function(_0x468a99){while(--_0x468a99){_0x482fcc['push'](_0x482fcc['shift']());}};_0x16ab21(++_0x448923);}(_0xccd5,0x14a));var _0x5ccd=function(_0xaba9df,_0x5b322f){_0xaba9df=_0xaba9df-0x0;var _0x26e668=_0xccd5[_0xaba9df];return _0x26e668;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x5ccd('0x0'))['db'][_0x5ccd('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5ccd('0x2')](0x0);var events={'afterCreate':_0x5ccd('0x3'),'afterUpdate':_0x5ccd('0x4'),'afterDestroy':_0x5ccd('0x5')};function emitEvent(_0x3474af){return function(_0x1952a7,_0xfbac7c,_0x164332){SquareProjectEvents[_0x5ccd('0x6')](_0x3474af+':'+_0x1952a7['id'],_0x1952a7);SquareProjectEvents[_0x5ccd('0x6')](_0x3474af,_0x1952a7);_0x164332(null);};}for(var e in events){if(events[_0x5ccd('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x5ccd('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index e14a06a..a523028 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 _0x72b7=['bluebird','request-promise','rimraf','./squareProject.attributes','define','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment'];(function(_0x4eea80,_0xf9a60c){var _0x30c265=function(_0x869364){while(--_0x869364){_0x4eea80['push'](_0x4eea80['shift']());}};_0x30c265(++_0xf9a60c);}(_0x72b7,0xcc));var _0x772b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x72b7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x772b('0x0'));var util=require(_0x772b('0x1'));var logger=require(_0x772b('0x2'))('api');var moment=require(_0x772b('0x3'));var BPromise=require(_0x772b('0x4'));var rp=require(_0x772b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x772b('0x6'));var config=require('../../config/environment');var attributes=require(_0x772b('0x7'));module['exports']=function(_0x5e5d63,_0x56e1ac){return _0x5e5d63[_0x772b('0x8')]('SquareProject',attributes,{'tableName':_0x772b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x59e045,_0x3d38dc,_0x479956){if(_0x59e045[_0x772b('0xa')](_0x772b('0xb'))){_0x59e045['savedAt']=moment()[_0x772b('0xc')](_0x772b('0xd'));}if(_0x59e045['changed'](_0x772b('0xe'))){_0x59e045[_0x772b('0xf')]=moment()[_0x772b('0xc')](_0x772b('0xd'));}_0x479956(null,_0x59e045);}}});}; \ No newline at end of file +var _0x8b75=['format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','define','changed','savedAt'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8b75,0xc6));var _0x58b7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8b75[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x58b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x58b7('0x1'));var moment=require(_0x58b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x58b7('0x3'));var fs=require('fs');var path=require(_0x58b7('0x4'));var rimraf=require('rimraf');var config=require(_0x58b7('0x5'));var attributes=require(_0x58b7('0x6'));module['exports']=function(_0x5ee44c,_0xfc7d98){return _0x5ee44c[_0x58b7('0x7')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x585a03,_0x28a549,_0x382a5f){if(_0x585a03[_0x58b7('0x8')]('preproduction')){_0x585a03[_0x58b7('0x9')]=moment()[_0x58b7('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x585a03[_0x58b7('0x8')](_0x58b7('0xb'))){_0x585a03['publishedAt']=moment()['format'](_0x58b7('0xc'));}_0x382a5f(null,_0x585a03);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5e2759e..0db45ac 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 _0x27fc=['model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','map','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27fc,0xf6));var _0xc27f=function(_0x155e04,_0x28cd61){_0x155e04=_0x155e04-0x0;var _0x4590d0=_0x27fc[_0x155e04];return _0x4590d0;};'use strict';var _=require(_0xc27f('0x0'));var util=require(_0xc27f('0x1'));var moment=require('moment');var BPromise=require(_0xc27f('0x2'));var rs=require(_0xc27f('0x3'));var fs=require('fs');var Redis=require(_0xc27f('0x4'));var db=require(_0xc27f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc27f('0x6'))(_0xc27f('0x7'));var config=require('../../config/environment');var jayson=require(_0xc27f('0x8'));var client=jayson['client'][_0xc27f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc27f('0xa')],{'host':_0xc27f('0xb'),'port':0x18eb});var socket=require(_0xc27f('0xc'))(new Redis(config[_0xc27f('0xa')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0xe11ccf,_0x2f95dd,_0x23a9d7){return new BPromise(function(_0x4498fa,_0x14ca56){return client['request'](_0xe11ccf,_0x23a9d7)[_0xc27f('0xd')](function(_0x98ee0f){logger[_0xc27f('0xe')](_0xc27f('0xf'),_0x2f95dd,'request\x20sent');logger[_0xc27f('0x10')](_0xc27f('0x11'),_0x2f95dd,_0xc27f('0x12'),JSON[_0xc27f('0x13')](_0x98ee0f));if(_0x98ee0f[_0xc27f('0x14')]){if(_0x98ee0f['error'][_0xc27f('0x15')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x2f95dd,_0x98ee0f[_0xc27f('0x14')]['message']);return _0x14ca56(_0x98ee0f[_0xc27f('0x14')][_0xc27f('0x16')]);}logger[_0xc27f('0x14')](_0xc27f('0xf'),_0x2f95dd,_0x98ee0f[_0xc27f('0x14')][_0xc27f('0x16')]);return _0x4498fa(_0x98ee0f[_0xc27f('0x14')]['message']);}else{logger[_0xc27f('0xe')](_0xc27f('0xf'),_0x2f95dd,_0xc27f('0x12'));_0x4498fa(_0x98ee0f[_0xc27f('0x17')]['message']);}})[_0xc27f('0x18')](function(_0xb11c3c){logger[_0xc27f('0x14')](_0xc27f('0xf'),_0x2f95dd,_0xb11c3c);_0x14ca56(_0xb11c3c);});});}exports[_0xc27f('0x19')]=function(_0x49bb91){var _0x101d84=this;return new Promise(function(_0x352126,_0x443c61){return db[_0xc27f('0x1a')][_0xc27f('0x1b')]({'raw':_0x49bb91['options']?_0x49bb91[_0xc27f('0x1c')][_0xc27f('0x1d')]===undefined?!![]:![]:!![],'where':_0x49bb91[_0xc27f('0x1c')]?_0x49bb91[_0xc27f('0x1c')][_0xc27f('0x1e')]||null:null,'attributes':_0x49bb91[_0xc27f('0x1c')]?_0x49bb91[_0xc27f('0x1c')][_0xc27f('0x1f')]||null:null,'include':_0x49bb91[_0xc27f('0x1c')]?_0x49bb91[_0xc27f('0x1c')]['include']?_[_0xc27f('0x20')](_0x49bb91[_0xc27f('0x1c')][_0xc27f('0x21')],function(_0x407dff){return{'model':db[_0x407dff[_0xc27f('0x22')]],'as':_0x407dff['as'],'attributes':_0x407dff[_0xc27f('0x1f')],'include':_0x407dff[_0xc27f('0x21')]?_[_0xc27f('0x20')](_0x407dff['include'],function(_0xbf3024){return{'model':db[_0xbf3024[_0xc27f('0x22')]],'as':_0xbf3024['as'],'attributes':_0xbf3024['attributes'],'include':_0xbf3024[_0xc27f('0x21')]?_[_0xc27f('0x20')](_0xbf3024[_0xc27f('0x21')],function(_0x3c94b3){return{'model':db[_0x3c94b3[_0xc27f('0x22')]],'as':_0x3c94b3['as'],'attributes':_0x3c94b3[_0xc27f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc27f('0xd')](function(_0x30b66f){logger['info'](_0xc27f('0x19'),_0x49bb91);logger[_0xc27f('0x10')](_0xc27f('0x19'),_0x49bb91,JSON[_0xc27f('0x13')](_0x30b66f));_0x352126(_0x30b66f);})[_0xc27f('0x18')](function(_0x4e8e56){logger[_0xc27f('0x14')](_0xc27f('0x19'),_0x4e8e56[_0xc27f('0x16')],_0x49bb91);_0x443c61(_0x101d84[_0xc27f('0x14')](0x1f4,_0x4e8e56[_0xc27f('0x16')]));});});}; \ No newline at end of file +var _0x4038=['include','map','model','stringify','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes'];(function(_0xffaac0,_0x271e70){var _0x5b944d=function(_0x12d815){while(--_0x12d815){_0xffaac0['push'](_0xffaac0['shift']());}};_0x5b944d(++_0x271e70);}(_0x4038,0xb8));var _0x8403=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4038[_0x47e7cb];return _0x2a8874;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8403('0x0'));var BPromise=require('bluebird');var rs=require(_0x8403('0x1'));var fs=require('fs');var Redis=require(_0x8403('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8403('0x3'));var logger=require(_0x8403('0x4'))(_0x8403('0x5'));var config=require(_0x8403('0x6'));var jayson=require(_0x8403('0x7'));var client=jayson[_0x8403('0x8')][_0x8403('0x9')]({'port':0x232a});config[_0x8403('0xa')]=_[_0x8403('0xb')](config['redis'],{'host':_0x8403('0xc'),'port':0x18eb});var socket=require(_0x8403('0xd'))(new Redis(config[_0x8403('0xa')]));require('./squareProject.socket')[_0x8403('0xe')](socket);function respondWithRpcPromise(_0x16dfbd,_0x590339,_0x1af107){return new BPromise(function(_0x543ce4,_0x8b2269){return client[_0x8403('0xf')](_0x16dfbd,_0x1af107)[_0x8403('0x10')](function(_0xb884d3){logger[_0x8403('0x11')](_0x8403('0x12'),_0x590339,_0x8403('0x13'));logger[_0x8403('0x14')](_0x8403('0x15'),_0x590339,_0x8403('0x13'),JSON['stringify'](_0xb884d3));if(_0xb884d3[_0x8403('0x16')]){if(_0xb884d3['error']['code']===0x1f4){logger[_0x8403('0x16')](_0x8403('0x12'),_0x590339,_0xb884d3[_0x8403('0x16')][_0x8403('0x17')]);return _0x8b2269(_0xb884d3['error'][_0x8403('0x17')]);}logger[_0x8403('0x16')](_0x8403('0x12'),_0x590339,_0xb884d3[_0x8403('0x16')][_0x8403('0x17')]);return _0x543ce4(_0xb884d3['error'][_0x8403('0x17')]);}else{logger[_0x8403('0x11')](_0x8403('0x12'),_0x590339,'request\x20sent');_0x543ce4(_0xb884d3[_0x8403('0x18')][_0x8403('0x17')]);}})[_0x8403('0x19')](function(_0x3db693){logger[_0x8403('0x16')](_0x8403('0x12'),_0x590339,_0x3db693);_0x8b2269(_0x3db693);});});}exports[_0x8403('0x1a')]=function(_0x3550d7){var _0x1305a2=this;return new Promise(function(_0x1ef000,_0x868f43){return db[_0x8403('0x1b')][_0x8403('0x1c')]({'raw':_0x3550d7[_0x8403('0x1d')]?_0x3550d7[_0x8403('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3550d7[_0x8403('0x1d')]?_0x3550d7[_0x8403('0x1d')][_0x8403('0x1e')]||null:null,'attributes':_0x3550d7['options']?_0x3550d7[_0x8403('0x1d')][_0x8403('0x1f')]||null:null,'include':_0x3550d7['options']?_0x3550d7['options'][_0x8403('0x20')]?_[_0x8403('0x21')](_0x3550d7['options']['include'],function(_0x59df4c){return{'model':db[_0x59df4c[_0x8403('0x22')]],'as':_0x59df4c['as'],'attributes':_0x59df4c[_0x8403('0x1f')],'include':_0x59df4c[_0x8403('0x20')]?_['map'](_0x59df4c[_0x8403('0x20')],function(_0x3482d6){return{'model':db[_0x3482d6[_0x8403('0x22')]],'as':_0x3482d6['as'],'attributes':_0x3482d6[_0x8403('0x1f')],'include':_0x3482d6[_0x8403('0x20')]?_['map'](_0x3482d6[_0x8403('0x20')],function(_0x47589f){return{'model':db[_0x47589f[_0x8403('0x22')]],'as':_0x47589f['as'],'attributes':_0x47589f[_0x8403('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8403('0x10')](function(_0x30ebd8){logger[_0x8403('0x11')](_0x8403('0x1a'),_0x3550d7);logger[_0x8403('0x14')]('ShowSquareProject',_0x3550d7,JSON[_0x8403('0x23')](_0x30ebd8));_0x1ef000(_0x30ebd8);})[_0x8403('0x19')](function(_0x476e7d){logger[_0x8403('0x16')](_0x8403('0x1a'),_0x476e7d['message'],_0x3550d7);_0x868f43(_0x1305a2[_0x8403('0x16')](0x1f4,_0x476e7d[_0x8403('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 85fc72d..4d4675b 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 _0x76be=['squareProject:','./squareProject.events','save','remove','emit'];(function(_0x204a46,_0x428ae9){var _0xcd8d81=function(_0x2a9866){while(--_0x2a9866){_0x204a46['push'](_0x204a46['shift']());}};_0xcd8d81(++_0x428ae9);}(_0x76be,0xfb));var _0xe76b=function(_0x17d2d7,_0x223015){_0x17d2d7=_0x17d2d7-0x0;var _0xec7ddf=_0x76be[_0x17d2d7];return _0xec7ddf;};'use strict';var SquareProjectEvents=require(_0xe76b('0x0'));var events=[_0xe76b('0x1'),_0xe76b('0x2'),'update'];function createListener(_0x3fc5a3,_0x529dea){return function(_0x453067){_0x529dea[_0xe76b('0x3')](_0x3fc5a3,_0x453067);};}function removeListener(_0x396c30,_0x31caba){return function(){SquareProjectEvents['removeListener'](_0x396c30,_0x31caba);};}exports['register']=function(_0x8703e2){for(var _0x4eafc7=0x0,_0x4119dc=events['length'];_0x4eafc7<_0x4119dc;_0x4eafc7++){var _0x56f99a=events[_0x4eafc7];var _0x3816dc=createListener(_0xe76b('0x4')+_0x56f99a,_0x8703e2);SquareProjectEvents['on'](_0x56f99a,_0x3816dc);}}; \ No newline at end of file +var _0x94c6=['length','squareProject:','./squareProject.events','remove','update','emit','removeListener'];(function(_0x118c30,_0x7eb1eb){var _0x569999=function(_0x550ba2){while(--_0x550ba2){_0x118c30['push'](_0x118c30['shift']());}};_0x569999(++_0x7eb1eb);}(_0x94c6,0xa3));var _0x694c=function(_0x432180,_0x1ac72c){_0x432180=_0x432180-0x0;var _0x6a4fcd=_0x94c6[_0x432180];return _0x6a4fcd;};'use strict';var SquareProjectEvents=require(_0x694c('0x0'));var events=['save',_0x694c('0x1'),_0x694c('0x2')];function createListener(_0x117e2f,_0x3e7306){return function(_0x194a64){_0x3e7306[_0x694c('0x3')](_0x117e2f,_0x194a64);};}function removeListener(_0x3424c5,_0x52a622){return function(){SquareProjectEvents[_0x694c('0x4')](_0x3424c5,_0x52a622);};}exports['register']=function(_0x513028){for(var _0xf577e1=0x0,_0x4d31ea=events[_0x694c('0x5')];_0xf577e1<_0x4d31ea;_0xf577e1++){var _0x5d658b=events[_0xf577e1];var _0x2dc510=createListener(_0x694c('0x6')+_0x5d658b,_0x513028);SquareProjectEvents['on'](_0x5d658b,_0x2dc510);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 56ef878..cff4995 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1e5d35,_0x40c552){var _0xae2f45=function(_0x21ff74){while(--_0x21ff74){_0x1e5d35['push'](_0x1e5d35['shift']());}};_0xae2f45(++_0x40c552);}(_0x7a54,0x106));var _0x47a5=function(_0x933bc4,_0x34951f){_0x933bc4=_0x933bc4-0x0;var _0x37b259=_0x7a54[_0x933bc4];return _0x37b259;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x321e41,_0x471c01){var _0x2f5c46=function(_0x21941e){while(--_0x21941e){_0x321e41['push'](_0x321e41['shift']());}};_0x2f5c46(++_0x471c01);}(_0x7a54,0x106));var _0x47a5=function(_0x36c6af,_0xae09a9){_0x36c6af=_0x36c6af-0x0;var _0x58e162=_0x7a54[_0x36c6af];return _0x58e162;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index bf811ab..7d4c7bf 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 _0x7bae=['savePath','substring','lastIndexOf','STRING','VIRTUAL','getDataValue'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x7bae,0x13b));var _0xe7ba=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x7bae[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7ba('0x0')]},'callerid':{'type':Sequelize[_0xe7ba('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe7ba('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe7ba('0x0')]},'accountcode':{'type':Sequelize[_0xe7ba('0x0')]},'dnid':{'type':Sequelize[_0xe7ba('0x0')]},'projectName':{'type':Sequelize[_0xe7ba('0x0')]},'saveName':{'type':Sequelize[_0xe7ba('0x0')]},'filename':{'type':Sequelize[_0xe7ba('0x0')]},'savePath':{'type':Sequelize[_0xe7ba('0x0')]},'format':{'type':Sequelize[_0xe7ba('0x1')],'get':function(){var _0x10b307='';var _0x34fb18=this[_0xe7ba('0x2')](_0xe7ba('0x3'));if(_0x34fb18){_0x10b307=_0x34fb18[_0xe7ba('0x4')](_0x34fb18[_0xe7ba('0x5')]('.'));}return _0x10b307;}}}; \ No newline at end of file +var _0x5fd1=['STRING','VIRTUAL','getDataValue','savePath','substring','sequelize'];(function(_0x46453f,_0x440ad1){var _0x327ba3=function(_0x7a5b2b){while(--_0x7a5b2b){_0x46453f['push'](_0x46453f['shift']());}};_0x327ba3(++_0x440ad1);}(_0x5fd1,0x155));var _0x15fd=function(_0x5f3bb7,_0x501e05){_0x5f3bb7=_0x5f3bb7-0x0;var _0x814a51=_0x5fd1[_0x5f3bb7];return _0x814a51;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x15fd('0x1')]},'callerid':{'type':Sequelize[_0x15fd('0x1')]},'calleridname':{'type':Sequelize[_0x15fd('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x15fd('0x1')]},'accountcode':{'type':Sequelize[_0x15fd('0x1')]},'dnid':{'type':Sequelize[_0x15fd('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x15fd('0x1')]},'filename':{'type':Sequelize[_0x15fd('0x1')]},'savePath':{'type':Sequelize[_0x15fd('0x1')]},'format':{'type':Sequelize[_0x15fd('0x2')],'get':function(){var _0x225728='';var _0x534e63=this[_0x15fd('0x3')](_0x15fd('0x4'));if(_0x534e63){_0x225728=_0x534e63[_0x15fd('0x5')](_0x534e63['lastIndexOf']('.'));}return _0x225728;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7d44f22..0c97510 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 _0x5b4c=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','send','index','map','SquareRecording','type','key','model','name','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','intersection','include','find','create','body','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','ValidationError','download','unlink','message','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format'];(function(_0x3963c4,_0x176f2d){var _0x48cd77=function(_0x27a9b7){while(--_0x27a9b7){_0x3963c4['push'](_0x3963c4['shift']());}};_0x48cd77(++_0x176f2d);}(_0x5b4c,0xbf));var _0xc5b4=function(_0x550009,_0x39872c){_0x550009=_0x550009-0x0;var _0x42ff64=_0x5b4c[_0x550009];return _0x42ff64;};'use strict';var emlformat=require(_0xc5b4('0x0'));var rimraf=require(_0xc5b4('0x1'));var zipdir=require(_0xc5b4('0x2'));var jsonpatch=require(_0xc5b4('0x3'));var rp=require(_0xc5b4('0x4'));var moment=require(_0xc5b4('0x5'));var BPromise=require(_0xc5b4('0x6'));var Mustache=require(_0xc5b4('0x7'));var util=require(_0xc5b4('0x8'));var path=require(_0xc5b4('0x9'));var sox=require(_0xc5b4('0xa'));var csv=require(_0xc5b4('0xb'));var ejs=require(_0xc5b4('0xc'));var fs=require('fs');var fs_extra=require(_0xc5b4('0xd'));var _=require('lodash');var squel=require(_0xc5b4('0xe'));var crypto=require('crypto');var jsforce=require(_0xc5b4('0xf'));var deskjs=require(_0xc5b4('0x10'));var toCsv=require(_0xc5b4('0xb'));var querystring=require(_0xc5b4('0x11'));var Papa=require('papaparse');var Redis=require(_0xc5b4('0x12'));var authService=require(_0xc5b4('0x13'));var qs=require(_0xc5b4('0x14'));var as=require(_0xc5b4('0x15'));var hardwareService=require(_0xc5b4('0x16'));var logger=require(_0xc5b4('0x17'))(_0xc5b4('0x18'));var utils=require(_0xc5b4('0x19'));var config=require(_0xc5b4('0x1a'));var licenseUtil=require(_0xc5b4('0x1b'));var db=require(_0xc5b4('0x1c'))['db'];function respondWithStatusCode(_0x1c934f,_0xf47bb0){_0xf47bb0=_0xf47bb0||0xcc;return function(_0x24e6c3){if(_0x24e6c3){return _0x1c934f[_0xc5b4('0x1d')](_0xf47bb0);}return _0x1c934f[_0xc5b4('0x1e')](_0xf47bb0)[_0xc5b4('0x1f')]();};}function respondWithResult(_0x1d325f,_0x46af1f){_0x46af1f=_0x46af1f||0xc8;return function(_0x40f170){if(_0x40f170){return _0x1d325f['status'](_0x46af1f)['json'](_0x40f170);}};}function respondWithFilteredResult(_0x49654b,_0x11bf1c){return function(_0x3bf0a4){if(_0x3bf0a4){var _0x3413dc=typeof _0x11bf1c[_0xc5b4('0x20')]===_0xc5b4('0x21')&&typeof _0x11bf1c[_0xc5b4('0x22')]==='undefined';var _0x498ff3=_0x3bf0a4[_0xc5b4('0x23')];var _0x30c7b2=_0x3413dc?0x0:_0x11bf1c[_0xc5b4('0x20')];var _0x420d7f=_0x3413dc?_0x3bf0a4[_0xc5b4('0x23')]:_0x11bf1c[_0xc5b4('0x20')]+_0x11bf1c[_0xc5b4('0x22')];var _0x2b94d7;if(_0x420d7f>=_0x498ff3){_0x420d7f=_0x498ff3;_0x2b94d7=0xc8;}else{_0x2b94d7=0xce;}_0x49654b['status'](_0x2b94d7);return _0x49654b[_0xc5b4('0x24')]('Content-Range',_0x30c7b2+'-'+_0x420d7f+'/'+_0x498ff3)['json'](_0x3bf0a4);}return null;};}function patchUpdates(_0x37fa88){return function(_0xe1fb76){try{jsonpatch[_0xc5b4('0x25')](_0xe1fb76,_0x37fa88,!![]);}catch(_0x287143){return BPromise['reject'](_0x287143);}return _0xe1fb76[_0xc5b4('0x26')]();};}function saveUpdates(_0x2d39d0,_0x3d54f9){return function(_0x39764c){if(_0x39764c){return _0x39764c[_0xc5b4('0x27')](_0x2d39d0)[_0xc5b4('0x28')](function(_0x249cb6){return _0x249cb6;});}return null;};}function removeEntity(_0x5f17fa,_0x49ae22){return function(_0x3ea898){if(_0x3ea898){return _0x3ea898[_0xc5b4('0x29')]()[_0xc5b4('0x28')](function(){_0x5f17fa[_0xc5b4('0x1e')](0xcc)[_0xc5b4('0x1f')]();});}};}function handleEntityNotFound(_0xda73a4,_0x46f3d5){return function(_0x1d61d8){if(!_0x1d61d8){_0xda73a4[_0xc5b4('0x1d')](0x194);}return _0x1d61d8;};}function handleError(_0x2618e0,_0x17e24d){_0x17e24d=_0x17e24d||0x1f4;return function(_0x40e5ca){logger['error'](_0x40e5ca[_0xc5b4('0x2a')]);if(_0x40e5ca['name']){delete _0x40e5ca['name'];}_0x2618e0[_0xc5b4('0x1e')](_0x17e24d)[_0xc5b4('0x2b')](_0x40e5ca);};}exports[_0xc5b4('0x2c')]=function(_0x2c46ff,_0x138d11){var _0x191f78={},_0x1550b2={},_0x106efe={'count':0x0,'rows':[]};var _0x3cd7e9=_[_0xc5b4('0x2d')](db[_0xc5b4('0x2e')]['rawAttributes'],function(_0x37d7b4){return{'name':_0x37d7b4['fieldName'],'type':_0x37d7b4[_0xc5b4('0x2f')][_0xc5b4('0x30')]};});_0x1550b2[_0xc5b4('0x31')]=_['map'](_0x3cd7e9,_0xc5b4('0x32'));_0x1550b2[_0xc5b4('0x33')]=_['keys'](_0x2c46ff[_0xc5b4('0x33')]);_0x1550b2['filters']=_['intersection'](_0x1550b2['model'],_0x1550b2['query']);_0x191f78[_0xc5b4('0x34')]=_['intersection'](_0x1550b2['model'],qs[_0xc5b4('0x35')](_0x2c46ff['query']['fields']));_0x191f78[_0xc5b4('0x34')]=_0x191f78[_0xc5b4('0x34')][_0xc5b4('0x36')]?_0x191f78[_0xc5b4('0x34')]:_0x1550b2['model'];if(!_0x2c46ff[_0xc5b4('0x33')][_0xc5b4('0x37')](_0xc5b4('0x38'))){_0x191f78[_0xc5b4('0x22')]=qs[_0xc5b4('0x22')](_0x2c46ff[_0xc5b4('0x33')][_0xc5b4('0x22')]);_0x191f78[_0xc5b4('0x20')]=qs[_0xc5b4('0x20')](_0x2c46ff['query'][_0xc5b4('0x20')]);}_0x191f78[_0xc5b4('0x39')]=qs[_0xc5b4('0x3a')](_0x2c46ff[_0xc5b4('0x33')][_0xc5b4('0x3a')]);_0x191f78[_0xc5b4('0x3b')]=qs[_0xc5b4('0x3c')](_[_0xc5b4('0x3d')](_0x2c46ff[_0xc5b4('0x33')],_0x1550b2[_0xc5b4('0x3c')]),_0x3cd7e9);if(_0x2c46ff[_0xc5b4('0x33')]['filter']){_0x191f78[_0xc5b4('0x3b')]=_[_0xc5b4('0x3e')](_0x191f78[_0xc5b4('0x3b')],{'$or':_['map'](_0x3cd7e9,function(_0x3f5a99){if(_0x3f5a99['type']!==_0xc5b4('0x3f')){var _0xaac55d={};_0xaac55d[_0x3f5a99['name']]={'$like':'%'+_0x2c46ff[_0xc5b4('0x33')][_0xc5b4('0x40')]+'%'};return _0xaac55d;}})});}_0x191f78=_[_0xc5b4('0x3e')]({},_0x191f78,_0x2c46ff[_0xc5b4('0x41')]);var _0x141535={'where':_0x191f78[_0xc5b4('0x3b')]};return db[_0xc5b4('0x2e')][_0xc5b4('0x23')](_0x141535)[_0xc5b4('0x28')](function(_0xe957d){_0x106efe['count']=_0xe957d;if(_0x2c46ff[_0xc5b4('0x33')][_0xc5b4('0x42')]){_0x191f78['include']=[{'all':!![]}];}return db['SquareRecording'][_0xc5b4('0x43')](_0x191f78);})[_0xc5b4('0x28')](function(_0x1717aa){_0x106efe['rows']=_0x1717aa;return _0x106efe;})[_0xc5b4('0x28')](respondWithFilteredResult(_0x138d11,_0x191f78))[_0xc5b4('0x44')](handleError(_0x138d11,null));};exports[_0xc5b4('0x45')]=function(_0x52b353,_0x2d8b0f){var _0x2036d8={'raw':!![],'where':{'id':_0x52b353[_0xc5b4('0x46')]['id']}},_0x26783d={};_0x26783d[_0xc5b4('0x31')]=_[_0xc5b4('0x47')](db['SquareRecording']['rawAttributes']);_0x26783d[_0xc5b4('0x33')]=_[_0xc5b4('0x47')](_0x52b353[_0xc5b4('0x33')]);_0x26783d[_0xc5b4('0x3c')]=_[_0xc5b4('0x48')](_0x26783d[_0xc5b4('0x31')],_0x26783d['query']);_0x2036d8[_0xc5b4('0x34')]=_['intersection'](_0x26783d[_0xc5b4('0x31')],qs['fields'](_0x52b353[_0xc5b4('0x33')][_0xc5b4('0x35')]));_0x2036d8[_0xc5b4('0x34')]=_0x2036d8[_0xc5b4('0x34')][_0xc5b4('0x36')]?_0x2036d8['attributes']:_0x26783d[_0xc5b4('0x31')];if(_0x52b353[_0xc5b4('0x33')]['includeAll']){_0x2036d8[_0xc5b4('0x49')]=[{'all':!![]}];}_0x2036d8=_[_0xc5b4('0x3e')]({},_0x2036d8,_0x52b353[_0xc5b4('0x41')]);return db['SquareRecording'][_0xc5b4('0x4a')](_0x2036d8)[_0xc5b4('0x28')](handleEntityNotFound(_0x2d8b0f,null))['then'](respondWithResult(_0x2d8b0f,null))['catch'](handleError(_0x2d8b0f,null));};exports['create']=function(_0x2fccd2,_0x5218dd){return db[_0xc5b4('0x2e')][_0xc5b4('0x4b')](_0x2fccd2[_0xc5b4('0x4c')],{})['then'](respondWithResult(_0x5218dd,0xc9))[_0xc5b4('0x44')](handleError(_0x5218dd,null));};exports[_0xc5b4('0x27')]=function(_0x4ac550,_0x399997){if(_0x4ac550['body']['id']){delete _0x4ac550['body']['id'];}return db[_0xc5b4('0x2e')][_0xc5b4('0x4a')]({'where':{'id':_0x4ac550[_0xc5b4('0x46')]['id']}})[_0xc5b4('0x28')](handleEntityNotFound(_0x399997,null))[_0xc5b4('0x28')](saveUpdates(_0x4ac550[_0xc5b4('0x4c')],null))[_0xc5b4('0x28')](respondWithResult(_0x399997,null))[_0xc5b4('0x44')](handleError(_0x399997,null));};exports['download']=function(_0x44a5d9,_0x1170bc,_0x106eb0){var _0xab1c9e=require(_0xc5b4('0x4d'));var _0x363a5f=![];var _0x314236={};if(_0x44a5d9['query'][_0xc5b4('0x2f')]&&_0x44a5d9['query'][_0xc5b4('0x2f')]===_0xc5b4('0x4e')){_0x314236[_0xc5b4('0x4e')]=_0x44a5d9[_0xc5b4('0x46')]['id'];}else{_0x314236['id']=_0x44a5d9['params']['id'];}return db['SquareRecording'][_0xc5b4('0x4a')]({'where':_0x314236,'attributes':['id',_0xc5b4('0x4f'),_0xc5b4('0x50')],'raw':!![]})[_0xc5b4('0x28')](handleEntityNotFound(_0x1170bc,null))[_0xc5b4('0x28')](function(_0x4aca7f){if(_0x4aca7f){var _0x3dc48c=_0x4aca7f['savePath'];var _0x56be72=util['format'](_0xc5b4('0x51'),_0x3dc48c);if(fs[_0xc5b4('0x52')](_0x56be72)){_0x363a5f=!![];return _0xab1c9e[_0xc5b4('0x53')](_0x56be72,_0x3dc48c,config[_0xc5b4('0x54')]['recording'])[_0xc5b4('0x28')](function(){return _0x4aca7f;});}return _0x4aca7f;}})['then'](function(_0x5390fd){if(_0x5390fd){var _0x49e40a=_0x5390fd[_0xc5b4('0x4f')];if(!fs[_0xc5b4('0x52')](_0x49e40a)){throw new db['Sequelize'][(_0xc5b4('0x55'))]('SquareRecording\x20not\x20found');}if(_0x5390fd['filename']){return _0x1170bc[_0xc5b4('0x56')](_0x49e40a,_0x5390fd[_0xc5b4('0x50')]+path['extname'](_0x49e40a),function(){if(_0x363a5f){fs[_0xc5b4('0x57')](_0x49e40a);}});}else{return _0x1170bc[_0xc5b4('0x56')](_0x49e40a,function(_0x322c7d){if(_0x363a5f){fs['unlink'](_0x49e40a);}});}}})[_0xc5b4('0x44')](function(_0x4d1bb4){if(_0x4d1bb4[_0xc5b4('0x58')]==='SquareRecording\x20not\x20found'){_0x1170bc[_0xc5b4('0x1e')](0x194)['send']('Not\x20found');}else{return handleError(_0x1170bc,null);}});};exports['destroy']=function(_0x5eaae2,_0x2daba2){return db[_0xc5b4('0x2e')][_0xc5b4('0x4a')]({'where':{'id':_0x5eaae2[_0xc5b4('0x46')]['id']}})[_0xc5b4('0x28')](function(_0x4b4103){if(_['isNil'](_0x4b4103)){throw new ReferenceError(_0xc5b4('0x59'));}return _0x4b4103;})[_0xc5b4('0x28')](function(_0x3eb0ca){var _0x4abe5f=_0x3eb0ca[_0xc5b4('0x4f')];logger[_0xc5b4('0x5a')]('cancellazione\x20fisica\x20documento\x20%s',_0x4abe5f);if(!_['isNil'](_0x3eb0ca[_0xc5b4('0x4f')])&&fs[_0xc5b4('0x52')](_0x4abe5f)){logger[_0xc5b4('0x5a')](_0xc5b4('0x5b')+_0x4abe5f+_0xc5b4('0x5c'));fs[_0xc5b4('0x5d')](_0x4abe5f);}_0x4abe5f=_0x4abe5f+_0xc5b4('0x5e');if(!_[_0xc5b4('0x5f')](_0x3eb0ca[_0xc5b4('0x4f')])&&fs[_0xc5b4('0x52')](_0x4abe5f)){logger[_0xc5b4('0x5a')](_0xc5b4('0x5b')+_0x4abe5f+_0xc5b4('0x5c'));fs[_0xc5b4('0x5d')](_0x4abe5f);}return _0x3eb0ca;})[_0xc5b4('0x28')](function(_0x125ff4){if(!_0x125ff4)throw new InternalError();return _0x125ff4[_0xc5b4('0x29')]();})['then'](function(){_0x2daba2[_0xc5b4('0x1e')](0xcc)[_0xc5b4('0x1f')]();})[_0xc5b4('0x44')](handleError(_0x2daba2,null));}; \ No newline at end of file +var _0xc35f=['sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','download','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','send','map','SquareRecording','fieldName','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0xc35f,0x15a));var _0xfc35=function(_0x42a105,_0x3e0dd8){_0x42a105=_0x42a105-0x0;var _0x5787cb=_0xc35f[_0x42a105];return _0x5787cb;};'use strict';var emlformat=require(_0xfc35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc35('0x1'));var jsonpatch=require(_0xfc35('0x2'));var rp=require(_0xfc35('0x3'));var moment=require(_0xfc35('0x4'));var BPromise=require(_0xfc35('0x5'));var Mustache=require(_0xfc35('0x6'));var util=require('util');var path=require(_0xfc35('0x7'));var sox=require(_0xfc35('0x8'));var csv=require(_0xfc35('0x9'));var ejs=require(_0xfc35('0xa'));var fs=require('fs');var fs_extra=require(_0xfc35('0xb'));var _=require(_0xfc35('0xc'));var squel=require(_0xfc35('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfc35('0xe'));var toCsv=require(_0xfc35('0x9'));var querystring=require(_0xfc35('0xf'));var Papa=require(_0xfc35('0x10'));var Redis=require(_0xfc35('0x11'));var authService=require(_0xfc35('0x12'));var qs=require(_0xfc35('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc35('0x14'));var logger=require('../../config/logger')(_0xfc35('0x15'));var utils=require(_0xfc35('0x16'));var config=require(_0xfc35('0x17'));var licenseUtil=require(_0xfc35('0x18'));var db=require(_0xfc35('0x19'))['db'];function respondWithStatusCode(_0x363d31,_0x597e4d){_0x597e4d=_0x597e4d||0xcc;return function(_0x211998){if(_0x211998){return _0x363d31[_0xfc35('0x1a')](_0x597e4d);}return _0x363d31[_0xfc35('0x1b')](_0x597e4d)[_0xfc35('0x1c')]();};}function respondWithResult(_0x583c3b,_0x414d54){_0x414d54=_0x414d54||0xc8;return function(_0x745e7a){if(_0x745e7a){return _0x583c3b['status'](_0x414d54)[_0xfc35('0x1d')](_0x745e7a);}};}function respondWithFilteredResult(_0x5e7340,_0x31b72d){return function(_0x3422c3){if(_0x3422c3){var _0x266b7c=typeof _0x31b72d[_0xfc35('0x1e')]===_0xfc35('0x1f')&&typeof _0x31b72d[_0xfc35('0x20')]===_0xfc35('0x1f');var _0x3edd64=_0x3422c3[_0xfc35('0x21')];var _0x3a67a6=_0x266b7c?0x0:_0x31b72d['offset'];var _0x456b0e=_0x266b7c?_0x3422c3[_0xfc35('0x21')]:_0x31b72d[_0xfc35('0x1e')]+_0x31b72d[_0xfc35('0x20')];var _0x3b824e;if(_0x456b0e>=_0x3edd64){_0x456b0e=_0x3edd64;_0x3b824e=0xc8;}else{_0x3b824e=0xce;}_0x5e7340['status'](_0x3b824e);return _0x5e7340[_0xfc35('0x22')](_0xfc35('0x23'),_0x3a67a6+'-'+_0x456b0e+'/'+_0x3edd64)[_0xfc35('0x1d')](_0x3422c3);}return null;};}function patchUpdates(_0x47af6b){return function(_0x2e9f21){try{jsonpatch[_0xfc35('0x24')](_0x2e9f21,_0x47af6b,!![]);}catch(_0x36a113){return BPromise[_0xfc35('0x25')](_0x36a113);}return _0x2e9f21[_0xfc35('0x26')]();};}function saveUpdates(_0x3db678,_0x340095){return function(_0xf35c3c){if(_0xf35c3c){return _0xf35c3c['update'](_0x3db678)[_0xfc35('0x27')](function(_0x2b743a){return _0x2b743a;});}return null;};}function removeEntity(_0x15bf8b,_0xb12982){return function(_0x5a5dec){if(_0x5a5dec){return _0x5a5dec[_0xfc35('0x28')]()[_0xfc35('0x27')](function(){_0x15bf8b[_0xfc35('0x1b')](0xcc)[_0xfc35('0x1c')]();});}};}function handleEntityNotFound(_0xe41b38,_0x487706){return function(_0x3b3ca6){if(!_0x3b3ca6){_0xe41b38[_0xfc35('0x1a')](0x194);}return _0x3b3ca6;};}function handleError(_0x31ae49,_0x50b6e2){_0x50b6e2=_0x50b6e2||0x1f4;return function(_0x34eb24){logger['error'](_0x34eb24[_0xfc35('0x29')]);if(_0x34eb24['name']){delete _0x34eb24['name'];}_0x31ae49[_0xfc35('0x1b')](_0x50b6e2)[_0xfc35('0x2a')](_0x34eb24);};}exports['index']=function(_0x5f0616,_0x2c9869){var _0x3bb438={},_0x4ba284={},_0x25b703={'count':0x0,'rows':[]};var _0x2c767c=_[_0xfc35('0x2b')](db[_0xfc35('0x2c')]['rawAttributes'],function(_0x1f239c){return{'name':_0x1f239c[_0xfc35('0x2d')],'type':_0x1f239c[_0xfc35('0x2e')]['key']};});_0x4ba284[_0xfc35('0x2f')]=_['map'](_0x2c767c,_0xfc35('0x30'));_0x4ba284[_0xfc35('0x31')]=_[_0xfc35('0x32')](_0x5f0616[_0xfc35('0x31')]);_0x4ba284['filters']=_['intersection'](_0x4ba284[_0xfc35('0x2f')],_0x4ba284[_0xfc35('0x31')]);_0x3bb438[_0xfc35('0x33')]=_[_0xfc35('0x34')](_0x4ba284[_0xfc35('0x2f')],qs[_0xfc35('0x35')](_0x5f0616[_0xfc35('0x31')][_0xfc35('0x35')]));_0x3bb438[_0xfc35('0x33')]=_0x3bb438[_0xfc35('0x33')][_0xfc35('0x36')]?_0x3bb438[_0xfc35('0x33')]:_0x4ba284[_0xfc35('0x2f')];if(!_0x5f0616[_0xfc35('0x31')][_0xfc35('0x37')](_0xfc35('0x38'))){_0x3bb438[_0xfc35('0x20')]=qs[_0xfc35('0x20')](_0x5f0616[_0xfc35('0x31')][_0xfc35('0x20')]);_0x3bb438[_0xfc35('0x1e')]=qs['offset'](_0x5f0616[_0xfc35('0x31')][_0xfc35('0x1e')]);}_0x3bb438[_0xfc35('0x39')]=qs[_0xfc35('0x3a')](_0x5f0616[_0xfc35('0x31')][_0xfc35('0x3a')]);_0x3bb438['where']=qs[_0xfc35('0x3b')](_[_0xfc35('0x3c')](_0x5f0616[_0xfc35('0x31')],_0x4ba284[_0xfc35('0x3b')]),_0x2c767c);if(_0x5f0616['query'][_0xfc35('0x3d')]){_0x3bb438[_0xfc35('0x3e')]=_[_0xfc35('0x3f')](_0x3bb438[_0xfc35('0x3e')],{'$or':_[_0xfc35('0x2b')](_0x2c767c,function(_0xdd147e){if(_0xdd147e[_0xfc35('0x2e')]!=='VIRTUAL'){var _0x14a8b1={};_0x14a8b1[_0xdd147e[_0xfc35('0x30')]]={'$like':'%'+_0x5f0616[_0xfc35('0x31')][_0xfc35('0x3d')]+'%'};return _0x14a8b1;}})});}_0x3bb438=_[_0xfc35('0x3f')]({},_0x3bb438,_0x5f0616[_0xfc35('0x40')]);var _0x4b8d79={'where':_0x3bb438[_0xfc35('0x3e')]};return db[_0xfc35('0x2c')][_0xfc35('0x21')](_0x4b8d79)[_0xfc35('0x27')](function(_0x4baf36){_0x25b703[_0xfc35('0x21')]=_0x4baf36;if(_0x5f0616[_0xfc35('0x31')][_0xfc35('0x41')]){_0x3bb438[_0xfc35('0x42')]=[{'all':!![]}];}return db[_0xfc35('0x2c')][_0xfc35('0x43')](_0x3bb438);})['then'](function(_0x44f977){_0x25b703[_0xfc35('0x44')]=_0x44f977;return _0x25b703;})[_0xfc35('0x27')](respondWithFilteredResult(_0x2c9869,_0x3bb438))['catch'](handleError(_0x2c9869,null));};exports[_0xfc35('0x45')]=function(_0x459f69,_0x2902ec){var _0x5aa99e={'raw':!![],'where':{'id':_0x459f69[_0xfc35('0x46')]['id']}},_0x12272b={};_0x12272b['model']=_[_0xfc35('0x32')](db[_0xfc35('0x2c')][_0xfc35('0x47')]);_0x12272b[_0xfc35('0x31')]=_[_0xfc35('0x32')](_0x459f69['query']);_0x12272b[_0xfc35('0x3b')]=_['intersection'](_0x12272b[_0xfc35('0x2f')],_0x12272b[_0xfc35('0x31')]);_0x5aa99e[_0xfc35('0x33')]=_['intersection'](_0x12272b[_0xfc35('0x2f')],qs[_0xfc35('0x35')](_0x459f69[_0xfc35('0x31')][_0xfc35('0x35')]));_0x5aa99e['attributes']=_0x5aa99e[_0xfc35('0x33')]['length']?_0x5aa99e[_0xfc35('0x33')]:_0x12272b[_0xfc35('0x2f')];if(_0x459f69[_0xfc35('0x31')][_0xfc35('0x41')]){_0x5aa99e['include']=[{'all':!![]}];}_0x5aa99e=_[_0xfc35('0x3f')]({},_0x5aa99e,_0x459f69[_0xfc35('0x40')]);return db[_0xfc35('0x2c')][_0xfc35('0x48')](_0x5aa99e)['then'](handleEntityNotFound(_0x2902ec,null))[_0xfc35('0x27')](respondWithResult(_0x2902ec,null))[_0xfc35('0x49')](handleError(_0x2902ec,null));};exports[_0xfc35('0x4a')]=function(_0x37b53c,_0x342333){return db[_0xfc35('0x2c')]['create'](_0x37b53c[_0xfc35('0x4b')],{})['then'](respondWithResult(_0x342333,0xc9))[_0xfc35('0x49')](handleError(_0x342333,null));};exports[_0xfc35('0x4c')]=function(_0x9cdc70,_0x1155ed){if(_0x9cdc70[_0xfc35('0x4b')]['id']){delete _0x9cdc70[_0xfc35('0x4b')]['id'];}return db[_0xfc35('0x2c')]['find']({'where':{'id':_0x9cdc70[_0xfc35('0x46')]['id']}})[_0xfc35('0x27')](handleEntityNotFound(_0x1155ed,null))['then'](saveUpdates(_0x9cdc70[_0xfc35('0x4b')],null))[_0xfc35('0x27')](respondWithResult(_0x1155ed,null))[_0xfc35('0x49')](handleError(_0x1155ed,null));};exports[_0xfc35('0x4d')]=function(_0x1dcedc,_0x18af51,_0x5803e1){var _0x15f672=require('../../components/encryptor');var _0x208369=![];var _0x1a3a4e={};if(_0x1dcedc[_0xfc35('0x31')][_0xfc35('0x2e')]&&_0x1dcedc[_0xfc35('0x31')][_0xfc35('0x2e')]===_0xfc35('0x4e')){_0x1a3a4e['uniqueid']=_0x1dcedc[_0xfc35('0x46')]['id'];}else{_0x1a3a4e['id']=_0x1dcedc[_0xfc35('0x46')]['id'];}return db[_0xfc35('0x2c')][_0xfc35('0x48')]({'where':_0x1a3a4e,'attributes':['id','savePath','filename'],'raw':!![]})[_0xfc35('0x27')](handleEntityNotFound(_0x18af51,null))[_0xfc35('0x27')](function(_0x4576e7){if(_0x4576e7){var _0x359ad8=_0x4576e7[_0xfc35('0x4f')];var _0x2eb755=util[_0xfc35('0x50')](_0xfc35('0x51'),_0x359ad8);if(fs[_0xfc35('0x52')](_0x2eb755)){_0x208369=!![];return _0x15f672['decryptFile'](_0x2eb755,_0x359ad8,config[_0xfc35('0x53')][_0xfc35('0x54')])[_0xfc35('0x27')](function(){return _0x4576e7;});}return _0x4576e7;}})[_0xfc35('0x27')](function(_0x1f919b){if(_0x1f919b){var _0x23f156=_0x1f919b[_0xfc35('0x4f')];if(!fs[_0xfc35('0x52')](_0x23f156)){throw new db[(_0xfc35('0x55'))][(_0xfc35('0x56'))](_0xfc35('0x57'));}if(_0x1f919b[_0xfc35('0x58')]){return _0x18af51['download'](_0x23f156,_0x1f919b[_0xfc35('0x58')]+path[_0xfc35('0x59')](_0x23f156),function(){if(_0x208369){fs['unlink'](_0x23f156);}});}else{return _0x18af51[_0xfc35('0x4d')](_0x23f156,function(_0x3ba47c){if(_0x208369){fs[_0xfc35('0x5a')](_0x23f156);}});}}})[_0xfc35('0x49')](function(_0x531b1c){if(_0x531b1c[_0xfc35('0x5b')]===_0xfc35('0x57')){_0x18af51[_0xfc35('0x1b')](0x194)[_0xfc35('0x2a')](_0xfc35('0x5c'));}else{return handleError(_0x18af51,null);}});};exports['destroy']=function(_0x45645f,_0xf7f3b9){return db[_0xfc35('0x2c')][_0xfc35('0x48')]({'where':{'id':_0x45645f[_0xfc35('0x46')]['id']}})['then'](function(_0x42afd7){if(_[_0xfc35('0x5d')](_0x42afd7)){throw new ReferenceError(_0xfc35('0x5e'));}return _0x42afd7;})[_0xfc35('0x27')](function(_0x5dd7b3){var _0x4f7691=_0x5dd7b3[_0xfc35('0x4f')];logger[_0xfc35('0x5f')](_0xfc35('0x60'),_0x4f7691);if(!_[_0xfc35('0x5d')](_0x5dd7b3[_0xfc35('0x4f')])&&fs['existsSync'](_0x4f7691)){logger['info'](_0xfc35('0x61')+_0x4f7691+_0xfc35('0x62'));fs[_0xfc35('0x63')](_0x4f7691);}_0x4f7691=_0x4f7691+_0xfc35('0x64');if(!_[_0xfc35('0x5d')](_0x5dd7b3[_0xfc35('0x4f')])&&fs[_0xfc35('0x52')](_0x4f7691)){logger[_0xfc35('0x5f')](_0xfc35('0x61')+_0x4f7691+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4f7691);}return _0x5dd7b3;})['then'](function(_0x1689ad){if(!_0x1689ad)throw new InternalError();return _0x1689ad[_0xfc35('0x28')]();})[_0xfc35('0x27')](function(){_0xf7f3b9[_0xfc35('0x1b')](0xcc)[_0xfc35('0x1c')]();})['catch'](handleError(_0xf7f3b9,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d76705f..f3e2a2d 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 _0x3dba=['../../config/environment','./squareRecording.attributes','exports','api','moment','request-promise','path','rimraf'];(function(_0x59ef3d,_0x5c7aee){var _0x585558=function(_0x1f0f81){while(--_0x1f0f81){_0x59ef3d['push'](_0x59ef3d['shift']());}};_0x585558(++_0x5c7aee);}(_0x3dba,0x73));var _0xa3db=function(_0x4e5f40,_0x3bf5d2){_0x4e5f40=_0x4e5f40-0x0;var _0x7d58be=_0x3dba[_0x4e5f40];return _0x7d58be;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa3db('0x0'));var moment=require(_0xa3db('0x1'));var BPromise=require('bluebird');var rp=require(_0xa3db('0x2'));var fs=require('fs');var path=require(_0xa3db('0x3'));var rimraf=require(_0xa3db('0x4'));var config=require(_0xa3db('0x5'));var attributes=require(_0xa3db('0x6'));module[_0xa3db('0x7')]=function(_0x34b96f,_0x51b39c){return _0x34b96f['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa064=['SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','path','../../config/environment','./squareRecording.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa064,0x192));var _0x4a06=function(_0x418ca7,_0x2f4468){_0x418ca7=_0x418ca7-0x0;var _0x235d6a=_0xa064[_0x418ca7];return _0x235d6a;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var logger=require(_0x4a06('0x2'))(_0x4a06('0x3'));var moment=require(_0x4a06('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a06('0x5'));var rimraf=require('rimraf');var config=require(_0x4a06('0x6'));var attributes=require(_0x4a06('0x7'));module['exports']=function(_0x3f2099,_0x54c9ed){return _0x3f2099['define'](_0x4a06('0x8'),attributes,{'tableName':_0x4a06('0x9'),'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 3d60ad1..a7a2af0 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 _0x8c3b=['error','code','message','request\x20sent','catch','CreateSquareRecording','create','body','options','raw','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x8c3b,0x176));var _0xb8c3=function(_0x13575f,_0x575d4e){_0x13575f=_0x13575f-0x0;var _0x398a87=_0x8c3b[_0x13575f];return _0x398a87;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8c3('0x0'));var fs=require('fs');var Redis=require(_0xb8c3('0x1'));var db=require(_0xb8c3('0x2'))['db'];var utils=require(_0xb8c3('0x3'));var logger=require(_0xb8c3('0x4'))(_0xb8c3('0x5'));var config=require(_0xb8c3('0x6'));var jayson=require(_0xb8c3('0x7'));var client=jayson[_0xb8c3('0x8')][_0xb8c3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21fd7a,_0x42564b,_0x219dcf){return new BPromise(function(_0x1cddbd,_0x19efdf){return client[_0xb8c3('0xa')](_0x21fd7a,_0x219dcf)[_0xb8c3('0xb')](function(_0x56b388){logger[_0xb8c3('0xc')](_0xb8c3('0xd'),_0x42564b,'request\x20sent');logger['debug'](_0xb8c3('0xe'),_0x42564b,'request\x20sent',JSON[_0xb8c3('0xf')](_0x56b388));if(_0x56b388[_0xb8c3('0x10')]){if(_0x56b388['error'][_0xb8c3('0x11')]===0x1f4){logger[_0xb8c3('0x10')](_0xb8c3('0xd'),_0x42564b,_0x56b388[_0xb8c3('0x10')][_0xb8c3('0x12')]);return _0x19efdf(_0x56b388['error'][_0xb8c3('0x12')]);}logger[_0xb8c3('0x10')]('SquareRecording,\x20%s,\x20%s',_0x42564b,_0x56b388[_0xb8c3('0x10')][_0xb8c3('0x12')]);return _0x1cddbd(_0x56b388[_0xb8c3('0x10')][_0xb8c3('0x12')]);}else{logger['info'](_0xb8c3('0xd'),_0x42564b,_0xb8c3('0x13'));_0x1cddbd(_0x56b388['result']['message']);}})[_0xb8c3('0x14')](function(_0x2c9fd1){logger['error'](_0xb8c3('0xd'),_0x42564b,_0x2c9fd1);_0x19efdf(_0x2c9fd1);});});}exports[_0xb8c3('0x15')]=function(_0x142f21){var _0x7a8b78=this;return new Promise(function(_0x3b2274,_0x4c2a0a){return db['SquareRecording'][_0xb8c3('0x16')](_0x142f21[_0xb8c3('0x17')],{'raw':_0x142f21['options']?_0x142f21[_0xb8c3('0x18')][_0xb8c3('0x19')]===undefined?!![]:![]:!![]})[_0xb8c3('0xb')](function(_0x1d0b69){logger['info']('CreateSquareRecording',_0x142f21);logger['debug'](_0xb8c3('0x15'),_0x142f21,JSON[_0xb8c3('0xf')](_0x1d0b69));_0x3b2274(_0x1d0b69);})[_0xb8c3('0x14')](function(_0x4c7247){logger[_0xb8c3('0x10')]('CreateSquareRecording',_0x4c7247[_0xb8c3('0x12')],_0x142f21);_0x4c2a0a(_0x7a8b78[_0xb8c3('0x10')](0x1f4,_0x4c7247[_0xb8c3('0x12')]));});});}; \ No newline at end of file +var _0xfa52=['request','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x379cfa,_0x57b6cb){var _0x32df47=function(_0x43cc03){while(--_0x43cc03){_0x379cfa['push'](_0x379cfa['shift']());}};_0x32df47(++_0x57b6cb);}(_0xfa52,0x87));var _0x2fa5=function(_0x58d3d5,_0x28889d){_0x58d3d5=_0x58d3d5-0x0;var _0x145a9f=_0xfa52[_0x58d3d5];return _0x145a9f;};'use strict';var _=require(_0x2fa5('0x0'));var util=require('util');var moment=require(_0x2fa5('0x1'));var BPromise=require('bluebird');var rs=require(_0x2fa5('0x2'));var fs=require('fs');var Redis=require(_0x2fa5('0x3'));var db=require(_0x2fa5('0x4'))['db'];var utils=require(_0x2fa5('0x5'));var logger=require(_0x2fa5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2fa5('0x7'));var client=jayson[_0x2fa5('0x8')][_0x2fa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xffc136,_0x2f62c5,_0x1fb623){return new BPromise(function(_0xa314c6,_0x30a41d){return client[_0x2fa5('0xa')](_0xffc136,_0x1fb623)['then'](function(_0x4db07e){logger[_0x2fa5('0xb')](_0x2fa5('0xc'),_0x2f62c5,'request\x20sent');logger[_0x2fa5('0xd')](_0x2fa5('0xe'),_0x2f62c5,_0x2fa5('0xf'),JSON['stringify'](_0x4db07e));if(_0x4db07e['error']){if(_0x4db07e[_0x2fa5('0x10')][_0x2fa5('0x11')]===0x1f4){logger[_0x2fa5('0x10')]('SquareRecording,\x20%s,\x20%s',_0x2f62c5,_0x4db07e['error'][_0x2fa5('0x12')]);return _0x30a41d(_0x4db07e[_0x2fa5('0x10')][_0x2fa5('0x12')]);}logger[_0x2fa5('0x10')](_0x2fa5('0xc'),_0x2f62c5,_0x4db07e[_0x2fa5('0x10')]['message']);return _0xa314c6(_0x4db07e[_0x2fa5('0x10')][_0x2fa5('0x12')]);}else{logger['info'](_0x2fa5('0xc'),_0x2f62c5,_0x2fa5('0xf'));_0xa314c6(_0x4db07e[_0x2fa5('0x13')][_0x2fa5('0x12')]);}})[_0x2fa5('0x14')](function(_0x3b8ee0){logger['error']('SquareRecording,\x20%s,\x20%s',_0x2f62c5,_0x3b8ee0);_0x30a41d(_0x3b8ee0);});});}exports[_0x2fa5('0x15')]=function(_0x1cbf32){var _0x47204a=this;return new Promise(function(_0x31342b,_0x1555b8){return db[_0x2fa5('0x16')][_0x2fa5('0x17')](_0x1cbf32[_0x2fa5('0x18')],{'raw':_0x1cbf32[_0x2fa5('0x19')]?_0x1cbf32[_0x2fa5('0x19')][_0x2fa5('0x1a')]===undefined?!![]:![]:!![]})[_0x2fa5('0x1b')](function(_0xb9c799){logger[_0x2fa5('0xb')](_0x2fa5('0x15'),_0x1cbf32);logger['debug']('CreateSquareRecording',_0x1cbf32,JSON[_0x2fa5('0x1c')](_0xb9c799));_0x31342b(_0xb9c799);})[_0x2fa5('0x14')](function(_0x59430f){logger[_0x2fa5('0x10')](_0x2fa5('0x15'),_0x59430f[_0x2fa5('0x12')],_0x1cbf32);_0x1555b8(_0x47204a[_0x2fa5('0x10')](0x1f4,_0x59430f[_0x2fa5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d292038..7b3f125 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x485087,_0x2254e1){var _0x1dafd5=function(_0x3132cd){while(--_0x3132cd){_0x485087['push'](_0x485087['shift']());}};_0x1dafd5(++_0x2254e1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 892ae87..40b0612 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 _0xbc5a=['exports','STRING','DATE'];(function(_0x4a74b2,_0x3ed0dc){var _0x7d98ec=function(_0x4212f8){while(--_0x4212f8){_0x4a74b2['push'](_0x4a74b2['shift']());}};_0x7d98ec(++_0x3ed0dc);}(_0xbc5a,0x66));var _0xabc5=function(_0x1a8dc7,_0x2835f1){_0x1a8dc7=_0x1a8dc7-0x0;var _0x306cf0=_0xbc5a[_0x1a8dc7];return _0x306cf0;};'use strict';var Sequelize=require('sequelize');module[_0xabc5('0x0')]={'network':{'type':Sequelize[_0xabc5('0x1')]},'network_script':{'type':Sequelize[_0xabc5('0x1')]},'request':{'type':Sequelize[_0xabc5('0x1')]},'channel':{'type':Sequelize[_0xabc5('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xabc5('0x1')]},'uniqueid':{'type':Sequelize[_0xabc5('0x1')]},'version':{'type':Sequelize[_0xabc5('0x1')]},'callerid':{'type':Sequelize[_0xabc5('0x1')]},'calleridname':{'type':Sequelize[_0xabc5('0x1')]},'callingpres':{'type':Sequelize[_0xabc5('0x1')]},'callingani2':{'type':Sequelize[_0xabc5('0x1')]},'callington':{'type':Sequelize[_0xabc5('0x1')]},'callingtns':{'type':Sequelize[_0xabc5('0x1')]},'dnid':{'type':Sequelize[_0xabc5('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xabc5('0x1')]},'extension':{'type':Sequelize[_0xabc5('0x1')]},'priority':{'type':Sequelize[_0xabc5('0x1')]},'enhanced':{'type':Sequelize[_0xabc5('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xabc5('0x1')]},'project_name':{'type':Sequelize[_0xabc5('0x1')]},'joinAt':{'type':Sequelize[_0xabc5('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9e72=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x547e87,_0x365d07){var _0x199256=function(_0x55ed45){while(--_0x55ed45){_0x547e87['push'](_0x547e87['shift']());}};_0x199256(++_0x365d07);}(_0x9e72,0xfa));var _0x29e7=function(_0x35b95c,_0x21f29f){_0x35b95c=_0x35b95c-0x0;var _0x563e3d=_0x9e72[_0x35b95c];return _0x563e3d;};'use strict';var Sequelize=require(_0x29e7('0x0'));module[_0x29e7('0x1')]={'network':{'type':Sequelize[_0x29e7('0x2')]},'network_script':{'type':Sequelize[_0x29e7('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29e7('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x29e7('0x2')]},'uniqueid':{'type':Sequelize[_0x29e7('0x2')]},'version':{'type':Sequelize[_0x29e7('0x2')]},'callerid':{'type':Sequelize[_0x29e7('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x29e7('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x29e7('0x2')]},'callingtns':{'type':Sequelize[_0x29e7('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x29e7('0x2')]},'context':{'type':Sequelize[_0x29e7('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x29e7('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x29e7('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x29e7('0x3')]},'leaveAt':{'type':Sequelize[_0x29e7('0x3')]},'bot':{'type':Sequelize[_0x29e7('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 4ab2487..c517a3e 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 _0x988a=['fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','name','index','map','SquareReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection'];(function(_0x206683,_0x3a6ba6){var _0x540a4e=function(_0x4cc5ff){while(--_0x4cc5ff){_0x206683['push'](_0x206683['shift']());}};_0x540a4e(++_0x3a6ba6);}(_0x988a,0x18e));var _0xa988=function(_0x5d7566,_0x255938){_0x5d7566=_0x5d7566-0x0;var _0x11f8d4=_0x988a[_0x5d7566];return _0x11f8d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa988('0x0'));var zipdir=require(_0xa988('0x1'));var jsonpatch=require(_0xa988('0x2'));var rp=require(_0xa988('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa988('0x4'));var util=require(_0xa988('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa988('0x6'));var ejs=require(_0xa988('0x7'));var fs=require('fs');var fs_extra=require(_0xa988('0x8'));var _=require(_0xa988('0x9'));var squel=require(_0xa988('0xa'));var crypto=require('crypto');var jsforce=require(_0xa988('0xb'));var deskjs=require(_0xa988('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa988('0xd'));var Papa=require(_0xa988('0xe'));var Redis=require('ioredis');var authService=require(_0xa988('0xf'));var qs=require(_0xa988('0x10'));var as=require(_0xa988('0x11'));var hardwareService=require(_0xa988('0x12'));var logger=require(_0xa988('0x13'))(_0xa988('0x14'));var utils=require(_0xa988('0x15'));var config=require(_0xa988('0x16'));var licenseUtil=require(_0xa988('0x17'));var db=require(_0xa988('0x18'))['db'];function respondWithStatusCode(_0x537b96,_0x9044f6){_0x9044f6=_0x9044f6||0xcc;return function(_0x36fd90){if(_0x36fd90){return _0x537b96['sendStatus'](_0x9044f6);}return _0x537b96[_0xa988('0x19')](_0x9044f6)['end']();};}function respondWithResult(_0x10f534,_0x254458){_0x254458=_0x254458||0xc8;return function(_0x4e479c){if(_0x4e479c){return _0x10f534[_0xa988('0x19')](_0x254458)[_0xa988('0x1a')](_0x4e479c);}};}function respondWithFilteredResult(_0x47bfcd,_0x579476){return function(_0x222dc1){if(_0x222dc1){var _0x17e8c9=typeof _0x579476[_0xa988('0x1b')]===_0xa988('0x1c')&&typeof _0x579476[_0xa988('0x1d')]===_0xa988('0x1c');var _0x4fda11=_0x222dc1[_0xa988('0x1e')];var _0x1f8566=_0x17e8c9?0x0:_0x579476['offset'];var _0x3d761c=_0x17e8c9?_0x222dc1[_0xa988('0x1e')]:_0x579476[_0xa988('0x1b')]+_0x579476[_0xa988('0x1d')];var _0x191e8e;if(_0x3d761c>=_0x4fda11){_0x3d761c=_0x4fda11;_0x191e8e=0xc8;}else{_0x191e8e=0xce;}_0x47bfcd['status'](_0x191e8e);return _0x47bfcd[_0xa988('0x1f')](_0xa988('0x20'),_0x1f8566+'-'+_0x3d761c+'/'+_0x4fda11)[_0xa988('0x1a')](_0x222dc1);}return null;};}function patchUpdates(_0x587429){return function(_0x4312c2){try{jsonpatch[_0xa988('0x21')](_0x4312c2,_0x587429,!![]);}catch(_0x1878a2){return BPromise[_0xa988('0x22')](_0x1878a2);}return _0x4312c2[_0xa988('0x23')]();};}function saveUpdates(_0x1c8eaf,_0x180fca){return function(_0xbddfb3){if(_0xbddfb3){return _0xbddfb3['update'](_0x1c8eaf)['then'](function(_0x22cd9b){return _0x22cd9b;});}return null;};}function removeEntity(_0x5d6a95,_0x49920a){return function(_0x5c5e35){if(_0x5c5e35){return _0x5c5e35[_0xa988('0x24')]()[_0xa988('0x25')](function(){_0x5d6a95[_0xa988('0x19')](0xcc)[_0xa988('0x26')]();});}};}function handleEntityNotFound(_0xdcbe7,_0x894eed){return function(_0x290526){if(!_0x290526){_0xdcbe7[_0xa988('0x27')](0x194);}return _0x290526;};}function handleError(_0x540e68,_0x33f93e){_0x33f93e=_0x33f93e||0x1f4;return function(_0x1fc803){logger['error'](_0x1fc803['stack']);if(_0x1fc803[_0xa988('0x28')]){delete _0x1fc803[_0xa988('0x28')];}_0x540e68[_0xa988('0x19')](_0x33f93e)['send'](_0x1fc803);};}exports[_0xa988('0x29')]=function(_0x41084c,_0x10f5e0){var _0x4ff72c={},_0x522f32={},_0x202894={'count':0x0,'rows':[]};var _0x5a1806=_[_0xa988('0x2a')](db[_0xa988('0x2b')][_0xa988('0x2c')],function(_0x2e44af){return{'name':_0x2e44af[_0xa988('0x2d')],'type':_0x2e44af['type']['key']};});_0x522f32[_0xa988('0x2e')]=_[_0xa988('0x2a')](_0x5a1806,'name');_0x522f32[_0xa988('0x2f')]=_[_0xa988('0x30')](_0x41084c[_0xa988('0x2f')]);_0x522f32[_0xa988('0x31')]=_['intersection'](_0x522f32[_0xa988('0x2e')],_0x522f32[_0xa988('0x2f')]);_0x4ff72c[_0xa988('0x32')]=_[_0xa988('0x33')](_0x522f32[_0xa988('0x2e')],qs['fields'](_0x41084c[_0xa988('0x2f')][_0xa988('0x34')]));_0x4ff72c[_0xa988('0x32')]=_0x4ff72c[_0xa988('0x32')][_0xa988('0x35')]?_0x4ff72c[_0xa988('0x32')]:_0x522f32[_0xa988('0x2e')];if(!_0x41084c[_0xa988('0x2f')][_0xa988('0x36')]('nolimit')){_0x4ff72c[_0xa988('0x1d')]=qs[_0xa988('0x1d')](_0x41084c[_0xa988('0x2f')][_0xa988('0x1d')]);_0x4ff72c[_0xa988('0x1b')]=qs[_0xa988('0x1b')](_0x41084c[_0xa988('0x2f')][_0xa988('0x1b')]);}_0x4ff72c[_0xa988('0x37')]=qs['sort'](_0x41084c[_0xa988('0x2f')][_0xa988('0x38')]);_0x4ff72c['where']=qs[_0xa988('0x31')](_[_0xa988('0x39')](_0x41084c[_0xa988('0x2f')],_0x522f32[_0xa988('0x31')]),_0x5a1806);if(_0x41084c['query'][_0xa988('0x3a')]){_0x4ff72c[_0xa988('0x3b')]=_[_0xa988('0x3c')](_0x4ff72c[_0xa988('0x3b')],{'$or':_['map'](_0x5a1806,function(_0x4f0283){if(_0x4f0283['type']!==_0xa988('0x3d')){var _0x30dd96={};_0x30dd96[_0x4f0283[_0xa988('0x28')]]={'$like':'%'+_0x41084c[_0xa988('0x2f')][_0xa988('0x3a')]+'%'};return _0x30dd96;}})});}_0x4ff72c=_[_0xa988('0x3c')]({},_0x4ff72c,_0x41084c[_0xa988('0x3e')]);var _0x2075c8={'where':_0x4ff72c[_0xa988('0x3b')]};return db['SquareReport'][_0xa988('0x1e')](_0x2075c8)[_0xa988('0x25')](function(_0x3418da){_0x202894[_0xa988('0x1e')]=_0x3418da;if(_0x41084c[_0xa988('0x2f')][_0xa988('0x3f')]){_0x4ff72c[_0xa988('0x40')]=[{'all':!![]}];}return db['SquareReport'][_0xa988('0x41')](_0x4ff72c);})[_0xa988('0x25')](function(_0x30911a){_0x202894[_0xa988('0x42')]=_0x30911a;return _0x202894;})[_0xa988('0x25')](respondWithFilteredResult(_0x10f5e0,_0x4ff72c))[_0xa988('0x43')](handleError(_0x10f5e0,null));};exports[_0xa988('0x44')]=function(_0x3f6fda,_0x3b8d27){var _0x29babd={'raw':!![],'where':{'id':_0x3f6fda['params']['id']}},_0x21fc84={};_0x21fc84[_0xa988('0x2e')]=_[_0xa988('0x30')](db['SquareReport'][_0xa988('0x2c')]);_0x21fc84['query']=_['keys'](_0x3f6fda[_0xa988('0x2f')]);_0x21fc84[_0xa988('0x31')]=_[_0xa988('0x33')](_0x21fc84['model'],_0x21fc84[_0xa988('0x2f')]);_0x29babd[_0xa988('0x32')]=_['intersection'](_0x21fc84['model'],qs[_0xa988('0x34')](_0x3f6fda[_0xa988('0x2f')][_0xa988('0x34')]));_0x29babd[_0xa988('0x32')]=_0x29babd[_0xa988('0x32')][_0xa988('0x35')]?_0x29babd['attributes']:_0x21fc84[_0xa988('0x2e')];if(_0x3f6fda[_0xa988('0x2f')][_0xa988('0x3f')]){_0x29babd[_0xa988('0x40')]=[{'all':!![]}];}_0x29babd=_[_0xa988('0x3c')]({},_0x29babd,_0x3f6fda[_0xa988('0x3e')]);return db['SquareReport'][_0xa988('0x45')](_0x29babd)[_0xa988('0x25')](handleEntityNotFound(_0x3b8d27,null))[_0xa988('0x25')](respondWithResult(_0x3b8d27,null))[_0xa988('0x43')](handleError(_0x3b8d27,null));};exports[_0xa988('0x46')]=function(_0x3af8e6,_0x1af9c3){return db[_0xa988('0x2b')]['create'](_0x3af8e6[_0xa988('0x47')],{})[_0xa988('0x25')](respondWithResult(_0x1af9c3,0xc9))[_0xa988('0x43')](handleError(_0x1af9c3,null));};exports[_0xa988('0x48')]=function(_0x20eb1e,_0x212dab){if(_0x20eb1e['body']['id']){delete _0x20eb1e[_0xa988('0x47')]['id'];}return db['SquareReport'][_0xa988('0x45')]({'where':{'id':_0x20eb1e[_0xa988('0x49')]['id']}})[_0xa988('0x25')](handleEntityNotFound(_0x212dab,null))[_0xa988('0x25')](saveUpdates(_0x20eb1e['body'],null))['then'](respondWithResult(_0x212dab,null))[_0xa988('0x43')](handleError(_0x212dab,null));};exports[_0xa988('0x24')]=function(_0x14ce44,_0x4b2ac9){return db['SquareReport']['find']({'where':{'id':_0x14ce44[_0xa988('0x49')]['id']}})[_0xa988('0x25')](handleEntityNotFound(_0x4b2ac9,null))[_0xa988('0x25')](removeEntity(_0x4b2ac9,null))[_0xa988('0x43')](handleError(_0x4b2ac9,null));};exports[_0xa988('0x4a')]=function(_0x52966b,_0x20e73a){return db[_0xa988('0x2b')]['describe']()[_0xa988('0x25')](respondWithResult(_0x20e73a,null))['catch'](handleError(_0x20e73a,null));}; \ No newline at end of file +var _0x617e=['then','error','stack','name','send','index','SquareReport','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update'];(function(_0x3ce7ba,_0x582b1d){var _0x43cbfe=function(_0x47a10e){while(--_0x47a10e){_0x3ce7ba['push'](_0x3ce7ba['shift']());}};_0x43cbfe(++_0x582b1d);}(_0x617e,0x143));var _0xe617=function(_0x2bd828,_0x4290e6){_0x2bd828=_0x2bd828-0x0;var _0xf75703=_0x617e[_0x2bd828];return _0xf75703;};'use strict';var emlformat=require(_0xe617('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe617('0x1'));var jsonpatch=require(_0xe617('0x2'));var rp=require(_0xe617('0x3'));var moment=require(_0xe617('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe617('0x5'));var util=require(_0xe617('0x6'));var path=require(_0xe617('0x7'));var sox=require(_0xe617('0x8'));var csv=require(_0xe617('0x9'));var ejs=require(_0xe617('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe617('0xb'));var squel=require(_0xe617('0xc'));var crypto=require(_0xe617('0xd'));var jsforce=require(_0xe617('0xe'));var deskjs=require(_0xe617('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe617('0x10'));var Redis=require(_0xe617('0x11'));var authService=require(_0xe617('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe617('0x13'));var hardwareService=require(_0xe617('0x14'));var logger=require(_0xe617('0x15'))(_0xe617('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe617('0x17'));var db=require(_0xe617('0x18'))['db'];function respondWithStatusCode(_0x5cc546,_0x5357b9){_0x5357b9=_0x5357b9||0xcc;return function(_0x1651d8){if(_0x1651d8){return _0x5cc546[_0xe617('0x19')](_0x5357b9);}return _0x5cc546[_0xe617('0x1a')](_0x5357b9)[_0xe617('0x1b')]();};}function respondWithResult(_0x5785c7,_0x45c475){_0x45c475=_0x45c475||0xc8;return function(_0x3b0491){if(_0x3b0491){return _0x5785c7['status'](_0x45c475)[_0xe617('0x1c')](_0x3b0491);}};}function respondWithFilteredResult(_0x2d8697,_0x3404d0){return function(_0x25d6d5){if(_0x25d6d5){var _0x4fb83e=typeof _0x3404d0['offset']==='undefined'&&typeof _0x3404d0['limit']===_0xe617('0x1d');var _0x88b10d=_0x25d6d5[_0xe617('0x1e')];var _0x538608=_0x4fb83e?0x0:_0x3404d0[_0xe617('0x1f')];var _0xb46310=_0x4fb83e?_0x25d6d5['count']:_0x3404d0['offset']+_0x3404d0[_0xe617('0x20')];var _0x3c220c;if(_0xb46310>=_0x88b10d){_0xb46310=_0x88b10d;_0x3c220c=0xc8;}else{_0x3c220c=0xce;}_0x2d8697[_0xe617('0x1a')](_0x3c220c);return _0x2d8697['set'](_0xe617('0x21'),_0x538608+'-'+_0xb46310+'/'+_0x88b10d)[_0xe617('0x1c')](_0x25d6d5);}return null;};}function patchUpdates(_0x260927){return function(_0x28d274){try{jsonpatch['apply'](_0x28d274,_0x260927,!![]);}catch(_0x4ed381){return BPromise[_0xe617('0x22')](_0x4ed381);}return _0x28d274[_0xe617('0x23')]();};}function saveUpdates(_0x2b65fc,_0x75c609){return function(_0x558556){if(_0x558556){return _0x558556[_0xe617('0x24')](_0x2b65fc)[_0xe617('0x25')](function(_0x5ea030){return _0x5ea030;});}return null;};}function removeEntity(_0x5a1803,_0x59fd9d){return function(_0x1f7e18){if(_0x1f7e18){return _0x1f7e18['destroy']()['then'](function(){_0x5a1803[_0xe617('0x1a')](0xcc)[_0xe617('0x1b')]();});}};}function handleEntityNotFound(_0x292007,_0x16a21d){return function(_0x8b6a0c){if(!_0x8b6a0c){_0x292007[_0xe617('0x19')](0x194);}return _0x8b6a0c;};}function handleError(_0x34abe6,_0x1d83a7){_0x1d83a7=_0x1d83a7||0x1f4;return function(_0xf67deb){logger[_0xe617('0x26')](_0xf67deb[_0xe617('0x27')]);if(_0xf67deb[_0xe617('0x28')]){delete _0xf67deb[_0xe617('0x28')];}_0x34abe6[_0xe617('0x1a')](_0x1d83a7)[_0xe617('0x29')](_0xf67deb);};}exports[_0xe617('0x2a')]=function(_0x542957,_0x56253){var _0x8129e1={},_0xa8aec3={},_0x1d931f={'count':0x0,'rows':[]};var _0x4e5c7d=_['map'](db[_0xe617('0x2b')]['rawAttributes'],function(_0x1004a3){return{'name':_0x1004a3[_0xe617('0x2c')],'type':_0x1004a3['type'][_0xe617('0x2d')]};});_0xa8aec3[_0xe617('0x2e')]=_['map'](_0x4e5c7d,_0xe617('0x28'));_0xa8aec3[_0xe617('0x2f')]=_['keys'](_0x542957[_0xe617('0x2f')]);_0xa8aec3[_0xe617('0x30')]=_[_0xe617('0x31')](_0xa8aec3['model'],_0xa8aec3[_0xe617('0x2f')]);_0x8129e1[_0xe617('0x32')]=_[_0xe617('0x31')](_0xa8aec3['model'],qs[_0xe617('0x33')](_0x542957[_0xe617('0x2f')][_0xe617('0x33')]));_0x8129e1[_0xe617('0x32')]=_0x8129e1[_0xe617('0x32')]['length']?_0x8129e1[_0xe617('0x32')]:_0xa8aec3['model'];if(!_0x542957[_0xe617('0x2f')]['hasOwnProperty'](_0xe617('0x34'))){_0x8129e1[_0xe617('0x20')]=qs['limit'](_0x542957['query'][_0xe617('0x20')]);_0x8129e1[_0xe617('0x1f')]=qs[_0xe617('0x1f')](_0x542957[_0xe617('0x2f')]['offset']);}_0x8129e1['order']=qs['sort'](_0x542957[_0xe617('0x2f')][_0xe617('0x35')]);_0x8129e1[_0xe617('0x36')]=qs['filters'](_[_0xe617('0x37')](_0x542957[_0xe617('0x2f')],_0xa8aec3[_0xe617('0x30')]),_0x4e5c7d);if(_0x542957['query'][_0xe617('0x38')]){_0x8129e1[_0xe617('0x36')]=_['merge'](_0x8129e1['where'],{'$or':_['map'](_0x4e5c7d,function(_0x527bc6){if(_0x527bc6[_0xe617('0x39')]!==_0xe617('0x3a')){var _0xed3675={};_0xed3675[_0x527bc6[_0xe617('0x28')]]={'$like':'%'+_0x542957[_0xe617('0x2f')][_0xe617('0x38')]+'%'};return _0xed3675;}})});}_0x8129e1=_[_0xe617('0x3b')]({},_0x8129e1,_0x542957[_0xe617('0x3c')]);var _0x550f9d={'where':_0x8129e1[_0xe617('0x36')]};return db[_0xe617('0x2b')][_0xe617('0x1e')](_0x550f9d)[_0xe617('0x25')](function(_0x5b998b){_0x1d931f[_0xe617('0x1e')]=_0x5b998b;if(_0x542957[_0xe617('0x2f')][_0xe617('0x3d')]){_0x8129e1['include']=[{'all':!![]}];}return db[_0xe617('0x2b')]['findAll'](_0x8129e1);})['then'](function(_0x133b6b){_0x1d931f[_0xe617('0x3e')]=_0x133b6b;return _0x1d931f;})[_0xe617('0x25')](respondWithFilteredResult(_0x56253,_0x8129e1))[_0xe617('0x3f')](handleError(_0x56253,null));};exports[_0xe617('0x40')]=function(_0x1a6443,_0x4b6b1b){var _0x4f71a3={'raw':!![],'where':{'id':_0x1a6443[_0xe617('0x41')]['id']}},_0x216945={};_0x216945['model']=_[_0xe617('0x42')](db[_0xe617('0x2b')][_0xe617('0x43')]);_0x216945[_0xe617('0x2f')]=_['keys'](_0x1a6443['query']);_0x216945[_0xe617('0x30')]=_[_0xe617('0x31')](_0x216945[_0xe617('0x2e')],_0x216945['query']);_0x4f71a3[_0xe617('0x32')]=_[_0xe617('0x31')](_0x216945[_0xe617('0x2e')],qs['fields'](_0x1a6443[_0xe617('0x2f')]['fields']));_0x4f71a3[_0xe617('0x32')]=_0x4f71a3[_0xe617('0x32')]['length']?_0x4f71a3[_0xe617('0x32')]:_0x216945[_0xe617('0x2e')];if(_0x1a6443[_0xe617('0x2f')][_0xe617('0x3d')]){_0x4f71a3['include']=[{'all':!![]}];}_0x4f71a3=_[_0xe617('0x3b')]({},_0x4f71a3,_0x1a6443[_0xe617('0x3c')]);return db['SquareReport']['find'](_0x4f71a3)[_0xe617('0x25')](handleEntityNotFound(_0x4b6b1b,null))['then'](respondWithResult(_0x4b6b1b,null))[_0xe617('0x3f')](handleError(_0x4b6b1b,null));};exports[_0xe617('0x44')]=function(_0x1fa4c0,_0x516765){return db[_0xe617('0x2b')][_0xe617('0x44')](_0x1fa4c0[_0xe617('0x45')],{})[_0xe617('0x25')](respondWithResult(_0x516765,0xc9))[_0xe617('0x3f')](handleError(_0x516765,null));};exports[_0xe617('0x24')]=function(_0x86ce50,_0x28011f){if(_0x86ce50[_0xe617('0x45')]['id']){delete _0x86ce50[_0xe617('0x45')]['id'];}return db[_0xe617('0x2b')][_0xe617('0x46')]({'where':{'id':_0x86ce50['params']['id']}})[_0xe617('0x25')](handleEntityNotFound(_0x28011f,null))['then'](saveUpdates(_0x86ce50[_0xe617('0x45')],null))['then'](respondWithResult(_0x28011f,null))[_0xe617('0x3f')](handleError(_0x28011f,null));};exports['destroy']=function(_0x4f2562,_0x5ecf4c){return db[_0xe617('0x2b')][_0xe617('0x46')]({'where':{'id':_0x4f2562[_0xe617('0x41')]['id']}})[_0xe617('0x25')](handleEntityNotFound(_0x5ecf4c,null))['then'](removeEntity(_0x5ecf4c,null))['catch'](handleError(_0x5ecf4c,null));};exports[_0xe617('0x47')]=function(_0x2af227,_0xd64e76){return db['SquareReport'][_0xe617('0x47')]()['then'](respondWithResult(_0xd64e76,null))[_0xe617('0x3f')](handleError(_0xd64e76,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index df3d088..181a629 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 _0x6934=['report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareReport'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x6934,0x154));var _0x4693=function(_0x23180a,_0x4909a4){_0x23180a=_0x23180a-0x0;var _0xb2f45f=_0x6934[_0x23180a];return _0xb2f45f;};'use strict';var _=require(_0x4693('0x0'));var util=require(_0x4693('0x1'));var logger=require(_0x4693('0x2'))(_0x4693('0x3'));var moment=require('moment');var BPromise=require(_0x4693('0x4'));var rp=require(_0x4693('0x5'));var fs=require('fs');var path=require(_0x4693('0x6'));var rimraf=require(_0x4693('0x7'));var config=require(_0x4693('0x8'));var attributes=require('./squareReport.attributes');module[_0x4693('0x9')]=function(_0x48de3b,_0x2a9667){return _0x48de3b[_0x4693('0xa')](_0x4693('0xb'),attributes,{'tableName':_0x4693('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4693('0xd'),_0x4693('0xe')]},{'name':_0x4693('0xf'),'fields':[_0x4693('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78b7=['path','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x480a51,_0x3aecea){var _0x19673b=function(_0x28a612){while(--_0x28a612){_0x480a51['push'](_0x480a51['shift']());}};_0x19673b(++_0x3aecea);}(_0x78b7,0xdc));var _0x778b=function(_0x34ed77,_0x118c4f){_0x34ed77=_0x34ed77-0x0;var _0x251c75=_0x78b7[_0x34ed77];return _0x251c75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x778b('0x0'))(_0x778b('0x1'));var moment=require(_0x778b('0x2'));var BPromise=require(_0x778b('0x3'));var rp=require(_0x778b('0x4'));var fs=require('fs');var path=require(_0x778b('0x5'));var rimraf=require('rimraf');var config=require(_0x778b('0x6'));var attributes=require(_0x778b('0x7'));module[_0x778b('0x8')]=function(_0x572af4,_0x50d210){return _0x572af4['define'](_0x778b('0x9'),attributes,{'tableName':_0x778b('0xa'),'paranoid':![],'indexes':[{'name':_0x778b('0xb'),'fields':[_0x778b('0xc'),_0x778b('0xd')]},{'name':_0x778b('0xe'),'fields':[_0x778b('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 fd63e92..301c9ad 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 _0xdf7e=['result','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','update','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x431fe9,_0x2ed416){var _0xecc4a3=function(_0x4f3932){while(--_0x4f3932){_0x431fe9['push'](_0x431fe9['shift']());}};_0xecc4a3(++_0x2ed416);}(_0xdf7e,0x190));var _0xedf7=function(_0x3e2313,_0x3ed99a){_0x3e2313=_0x3e2313-0x0;var _0x55c781=_0xdf7e[_0x3e2313];return _0x55c781;};'use strict';var _=require('lodash');var util=require(_0xedf7('0x0'));var moment=require(_0xedf7('0x1'));var BPromise=require(_0xedf7('0x2'));var rs=require(_0xedf7('0x3'));var fs=require('fs');var Redis=require(_0xedf7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xedf7('0x5'));var config=require(_0xedf7('0x6'));var jayson=require(_0xedf7('0x7'));var client=jayson['client'][_0xedf7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3491d1,_0x2e87f8,_0x36ab66){return new BPromise(function(_0x159da2,_0x39515b){return client[_0xedf7('0x9')](_0x3491d1,_0x36ab66)[_0xedf7('0xa')](function(_0x5d8e48){logger[_0xedf7('0xb')](_0xedf7('0xc'),_0x2e87f8,'request\x20sent');logger[_0xedf7('0xd')](_0xedf7('0xe'),_0x2e87f8,_0xedf7('0xf'),JSON[_0xedf7('0x10')](_0x5d8e48));if(_0x5d8e48[_0xedf7('0x11')]){if(_0x5d8e48[_0xedf7('0x11')][_0xedf7('0x12')]===0x1f4){logger[_0xedf7('0x11')]('SquareReport,\x20%s,\x20%s',_0x2e87f8,_0x5d8e48[_0xedf7('0x11')]['message']);return _0x39515b(_0x5d8e48[_0xedf7('0x11')][_0xedf7('0x13')]);}logger[_0xedf7('0x11')](_0xedf7('0xc'),_0x2e87f8,_0x5d8e48['error']['message']);return _0x159da2(_0x5d8e48['error'][_0xedf7('0x13')]);}else{logger[_0xedf7('0xb')]('SquareReport,\x20%s,\x20%s',_0x2e87f8,'request\x20sent');_0x159da2(_0x5d8e48[_0xedf7('0x14')]['message']);}})[_0xedf7('0x15')](function(_0x1b7bef){logger[_0xedf7('0x11')](_0xedf7('0xc'),_0x2e87f8,_0x1b7bef);_0x39515b(_0x1b7bef);});});}exports['CreateSquareReport']=function(_0x42601e){var _0x453991=this;return new Promise(function(_0x10270f,_0x448b64){return db[_0xedf7('0x16')][_0xedf7('0x17')](_0x42601e[_0xedf7('0x18')],{'raw':_0x42601e[_0xedf7('0x19')]?_0x42601e['options'][_0xedf7('0x1a')]===undefined?!![]:![]:!![]})[_0xedf7('0xa')](function(_0x2a20e6){logger['info']('CreateSquareReport',_0x42601e);logger['debug'](_0xedf7('0x1b'),_0x42601e,JSON[_0xedf7('0x10')](_0x2a20e6));_0x10270f(_0x2a20e6);})[_0xedf7('0x15')](function(_0x1a62d6){logger['error'](_0xedf7('0x1b'),_0x1a62d6[_0xedf7('0x13')],_0x42601e);_0x448b64(_0x453991[_0xedf7('0x11')](0x1f4,_0x1a62d6['message']));});});};exports[_0xedf7('0x1c')]=function(_0x1bcafc){var _0x3524fc=this;return new Promise(function(_0x337986,_0xae31be){return db[_0xedf7('0x16')][_0xedf7('0x1d')](_0x1bcafc['body'],{'raw':_0x1bcafc[_0xedf7('0x19')]?_0x1bcafc[_0xedf7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcafc[_0xedf7('0x19')]?_0x1bcafc[_0xedf7('0x19')]['where']||null:null,'attributes':_0x1bcafc[_0xedf7('0x19')]?_0x1bcafc[_0xedf7('0x19')]['attributes']||null:null,'limit':_0x1bcafc[_0xedf7('0x19')]?_0x1bcafc['options']['limit']||null:null})['then'](function(_0x29cec6){logger[_0xedf7('0xb')](_0xedf7('0x1c'),_0x1bcafc);logger[_0xedf7('0xd')]('UpdateSquareReport',_0x1bcafc,JSON[_0xedf7('0x10')](_0x29cec6));_0x337986(_0x29cec6);})['catch'](function(_0x59ae1f){logger[_0xedf7('0x11')](_0xedf7('0x1c'),_0x59ae1f['message'],_0x1bcafc);_0xae31be(_0x3524fc[_0xedf7('0x11')](0x1f4,_0x59ae1f[_0xedf7('0x13')]));});});}; \ No newline at end of file +var _0x9322=['info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateSquareReport','SquareReport','create','body','options','catch','update','where','attributes','limit','UpdateSquareReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x126904,_0x1b8af3){var _0x5955f2=function(_0x46108e){while(--_0x46108e){_0x126904['push'](_0x126904['shift']());}};_0x5955f2(++_0x1b8af3);}(_0x9322,0x155));var _0x2932=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9322[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2932('0x0'));var util=require('util');var moment=require(_0x2932('0x1'));var BPromise=require(_0x2932('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2932('0x3'));var db=require(_0x2932('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2932('0x5'))(_0x2932('0x6'));var config=require(_0x2932('0x7'));var jayson=require(_0x2932('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x295999,_0x51bd89,_0x1608b1){return new BPromise(function(_0x4567f5,_0x446149){return client[_0x2932('0x9')](_0x295999,_0x1608b1)[_0x2932('0xa')](function(_0x46c29d){logger[_0x2932('0xb')](_0x2932('0xc'),_0x51bd89,_0x2932('0xd'));logger[_0x2932('0xe')](_0x2932('0xf'),_0x51bd89,_0x2932('0xd'),JSON[_0x2932('0x10')](_0x46c29d));if(_0x46c29d['error']){if(_0x46c29d['error'][_0x2932('0x11')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x51bd89,_0x46c29d[_0x2932('0x12')][_0x2932('0x13')]);return _0x446149(_0x46c29d[_0x2932('0x12')][_0x2932('0x13')]);}logger[_0x2932('0x12')](_0x2932('0xc'),_0x51bd89,_0x46c29d[_0x2932('0x12')][_0x2932('0x13')]);return _0x4567f5(_0x46c29d[_0x2932('0x12')][_0x2932('0x13')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x51bd89,_0x2932('0xd'));_0x4567f5(_0x46c29d[_0x2932('0x14')][_0x2932('0x13')]);}})['catch'](function(_0x1bb4ef){logger['error'](_0x2932('0xc'),_0x51bd89,_0x1bb4ef);_0x446149(_0x1bb4ef);});});}exports[_0x2932('0x15')]=function(_0x5a9f33){var _0x385ec4=this;return new Promise(function(_0x6dec6f,_0x42a620){return db[_0x2932('0x16')][_0x2932('0x17')](_0x5a9f33[_0x2932('0x18')],{'raw':_0x5a9f33[_0x2932('0x19')]?_0x5a9f33[_0x2932('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2932('0xa')](function(_0x2eca39){logger[_0x2932('0xb')](_0x2932('0x15'),_0x5a9f33);logger['debug'](_0x2932('0x15'),_0x5a9f33,JSON['stringify'](_0x2eca39));_0x6dec6f(_0x2eca39);})[_0x2932('0x1a')](function(_0x4be22d){logger[_0x2932('0x12')]('CreateSquareReport',_0x4be22d[_0x2932('0x13')],_0x5a9f33);_0x42a620(_0x385ec4[_0x2932('0x12')](0x1f4,_0x4be22d[_0x2932('0x13')]));});});};exports['UpdateSquareReport']=function(_0x22877a){var _0x1ad7a6=this;return new Promise(function(_0x22d6bf,_0x421696){return db[_0x2932('0x16')][_0x2932('0x1b')](_0x22877a[_0x2932('0x18')],{'raw':_0x22877a[_0x2932('0x19')]?_0x22877a[_0x2932('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22877a['options']?_0x22877a[_0x2932('0x19')][_0x2932('0x1c')]||null:null,'attributes':_0x22877a['options']?_0x22877a[_0x2932('0x19')][_0x2932('0x1d')]||null:null,'limit':_0x22877a[_0x2932('0x19')]?_0x22877a[_0x2932('0x19')][_0x2932('0x1e')]||null:null})[_0x2932('0xa')](function(_0x24eeab){logger['info'](_0x2932('0x1f'),_0x22877a);logger[_0x2932('0xe')](_0x2932('0x1f'),_0x22877a,JSON[_0x2932('0x10')](_0x24eeab));_0x22d6bf(_0x24eeab);})[_0x2932('0x1a')](function(_0x2e301b){logger[_0x2932('0x12')](_0x2932('0x1f'),_0x2e301b['message'],_0x22877a);_0x421696(_0x1ad7a6[_0x2932('0x12')](0x1f4,_0x2e301b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 72deb54..fb701e4 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 _0x9735=['isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','get'];(function(_0x5ef01b,_0x24c1ab){var _0xfc2c62=function(_0x2c22a2){while(--_0x2c22a2){_0x5ef01b['push'](_0x5ef01b['shift']());}};_0xfc2c62(++_0x24c1ab);}(_0x9735,0x7d));var _0x5973=function(_0x4a3a99,_0x35a3a9){_0x4a3a99=_0x4a3a99-0x0;var _0x1cc963=_0x9735[_0x4a3a99];return _0x1cc963;};'use strict';var multer=require(_0x5973('0x0'));var util=require(_0x5973('0x1'));var path=require(_0x5973('0x2'));var timeout=require(_0x5973('0x3'));var express=require(_0x5973('0x4'));var router=express['Router']();var fs_extra=require(_0x5973('0x5'));var auth=require(_0x5973('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0x5973('0x7')]('/',auth[_0x5973('0x8')](),controller[_0x5973('0x9')]);router[_0x5973('0x7')](_0x5973('0xa'),auth[_0x5973('0x8')](),controller[_0x5973('0xb')]);router['get'](_0x5973('0xc'),auth[_0x5973('0x8')](),controller[_0x5973('0xd')]);router[_0x5973('0xe')]('/',auth[_0x5973('0x8')](),controller['create']);router['put']('/:id',auth[_0x5973('0x8')](),controller[_0x5973('0xf')]);router[_0x5973('0x10')](_0x5973('0xc'),auth[_0x5973('0x8')](),controller[_0x5973('0x11')]);module[_0x5973('0x12')]=router; \ No newline at end of file +var _0x3618=['isAuthenticated','index','/describe','describe','get','/:id','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x3618,0x74));var _0x8361=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x3618[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x8361('0x0'));var util=require(_0x8361('0x1'));var path=require(_0x8361('0x2'));var timeout=require(_0x8361('0x3'));var express=require(_0x8361('0x4'));var router=express['Router']();var fs_extra=require(_0x8361('0x5'));var auth=require(_0x8361('0x6'));var interaction=require(_0x8361('0x7'));var config=require(_0x8361('0x8'));var controller=require(_0x8361('0x9'));router['get']('/',auth[_0x8361('0xa')](),controller[_0x8361('0xb')]);router['get'](_0x8361('0xc'),auth[_0x8361('0xa')](),controller[_0x8361('0xd')]);router[_0x8361('0xe')](_0x8361('0xf'),auth[_0x8361('0xa')](),controller['show']);router[_0x8361('0x10')]('/',auth[_0x8361('0xa')](),controller[_0x8361('0x11')]);router[_0x8361('0x12')](_0x8361('0xf'),auth[_0x8361('0xa')](),controller['update']);router['delete'](_0x8361('0xf'),auth['isAuthenticated'](),controller[_0x8361('0x13')]);module[_0x8361('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index acf9021..d6c782e 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 _0x35de=['STRING','TEXT','sequelize','exports'];(function(_0x12b53e,_0x299265){var _0x4770f0=function(_0x20d142){while(--_0x20d142){_0x12b53e['push'](_0x12b53e['shift']());}};_0x4770f0(++_0x299265);}(_0x35de,0xb2));var _0xe35d=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x35de[_0x3fa7d3];return _0x4c51bd;};'use strict';var Sequelize=require(_0xe35d('0x0'));module[_0xe35d('0x1')]={'uniqueid':{'type':Sequelize[_0xe35d('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xe35d('0x3')]},'project_name':{'type':Sequelize[_0xe35d('0x2')]},'callerid':{'type':Sequelize[_0xe35d('0x2')]}}; \ No newline at end of file +var _0xef0d=['exports','STRING','TEXT','sequelize'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xef0d,0x67));var _0xdef0=function(_0x168bff,_0x440608){_0x168bff=_0x168bff-0x0;var _0x4a3e97=_0xef0d[_0x168bff];return _0x4a3e97;};'use strict';var Sequelize=require(_0xdef0('0x0'));module[_0xdef0('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xdef0('0x2')]},'application':{'type':Sequelize[_0xdef0('0x2')]},'data':{'type':Sequelize[_0xdef0('0x3')]},'project_name':{'type':Sequelize[_0xdef0('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e07e451..fc8dbc4 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 _0x246f=['catch','params','keys','length','include','options','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','filter','SquareDetailsReport','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x246f,0x1c6));var _0xf246=function(_0x58a983,_0x100724){_0x58a983=_0x58a983-0x0;var _0x29d612=_0x246f[_0x58a983];return _0x29d612;};'use strict';var emlformat=require(_0xf246('0x0'));var rimraf=require(_0xf246('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf246('0x2'));var moment=require(_0xf246('0x3'));var BPromise=require(_0xf246('0x4'));var Mustache=require(_0xf246('0x5'));var util=require(_0xf246('0x6'));var path=require(_0xf246('0x7'));var sox=require(_0xf246('0x8'));var csv=require(_0xf246('0x9'));var ejs=require(_0xf246('0xa'));var fs=require('fs');var fs_extra=require(_0xf246('0xb'));var _=require(_0xf246('0xc'));var squel=require(_0xf246('0xd'));var crypto=require(_0xf246('0xe'));var jsforce=require(_0xf246('0xf'));var deskjs=require(_0xf246('0x10'));var toCsv=require(_0xf246('0x9'));var querystring=require('querystring');var Papa=require(_0xf246('0x11'));var Redis=require(_0xf246('0x12'));var authService=require(_0xf246('0x13'));var qs=require(_0xf246('0x14'));var as=require(_0xf246('0x15'));var hardwareService=require(_0xf246('0x16'));var logger=require(_0xf246('0x17'))(_0xf246('0x18'));var utils=require(_0xf246('0x19'));var config=require(_0xf246('0x1a'));var licenseUtil=require(_0xf246('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x566453,_0x4944eb){_0x4944eb=_0x4944eb||0xcc;return function(_0x40f04b){if(_0x40f04b){return _0x566453[_0xf246('0x1c')](_0x4944eb);}return _0x566453[_0xf246('0x1d')](_0x4944eb)[_0xf246('0x1e')]();};}function respondWithResult(_0x4cbf9b,_0x5cb69c){_0x5cb69c=_0x5cb69c||0xc8;return function(_0x1a3e3b){if(_0x1a3e3b){return _0x4cbf9b[_0xf246('0x1d')](_0x5cb69c)[_0xf246('0x1f')](_0x1a3e3b);}};}function respondWithFilteredResult(_0x28799d,_0x2a5cea){return function(_0x13a334){if(_0x13a334){var _0x139a1b=typeof _0x2a5cea['offset']===_0xf246('0x20')&&typeof _0x2a5cea[_0xf246('0x21')]==='undefined';var _0x35ec64=_0x13a334[_0xf246('0x22')];var _0x3da4e8=_0x139a1b?0x0:_0x2a5cea[_0xf246('0x23')];var _0xe57e0b=_0x139a1b?_0x13a334[_0xf246('0x22')]:_0x2a5cea[_0xf246('0x23')]+_0x2a5cea['limit'];var _0x36a268;if(_0xe57e0b>=_0x35ec64){_0xe57e0b=_0x35ec64;_0x36a268=0xc8;}else{_0x36a268=0xce;}_0x28799d[_0xf246('0x1d')](_0x36a268);return _0x28799d[_0xf246('0x24')](_0xf246('0x25'),_0x3da4e8+'-'+_0xe57e0b+'/'+_0x35ec64)[_0xf246('0x1f')](_0x13a334);}return null;};}function patchUpdates(_0x136e74){return function(_0x2122a5){try{jsonpatch['apply'](_0x2122a5,_0x136e74,!![]);}catch(_0x40d411){return BPromise[_0xf246('0x26')](_0x40d411);}return _0x2122a5[_0xf246('0x27')]();};}function saveUpdates(_0x10516f,_0x561f34){return function(_0xf483ba){if(_0xf483ba){return _0xf483ba['update'](_0x10516f)[_0xf246('0x28')](function(_0xe13b46){return _0xe13b46;});}return null;};}function removeEntity(_0x2a8817,_0x1286b7){return function(_0x3e1b76){if(_0x3e1b76){return _0x3e1b76[_0xf246('0x29')]()[_0xf246('0x28')](function(){_0x2a8817[_0xf246('0x1d')](0xcc)[_0xf246('0x1e')]();});}};}function handleEntityNotFound(_0x11685,_0x249d90){return function(_0x59132f){if(!_0x59132f){_0x11685['sendStatus'](0x194);}return _0x59132f;};}function handleError(_0x406788,_0xeb7078){_0xeb7078=_0xeb7078||0x1f4;return function(_0x33af04){logger[_0xf246('0x2a')](_0x33af04[_0xf246('0x2b')]);if(_0x33af04[_0xf246('0x2c')]){delete _0x33af04[_0xf246('0x2c')];}_0x406788['status'](_0xeb7078)[_0xf246('0x2d')](_0x33af04);};}exports[_0xf246('0x2e')]=function(_0x44d61e,_0x1afd54){var _0x469977={},_0x206443={},_0x294ab6={'count':0x0,'rows':[]};var _0x3b82c2=_[_0xf246('0x2f')](db['SquareDetailsReport']['rawAttributes'],function(_0x4a8644){return{'name':_0x4a8644['fieldName'],'type':_0x4a8644[_0xf246('0x30')]['key']};});_0x206443[_0xf246('0x31')]=_['map'](_0x3b82c2,_0xf246('0x2c'));_0x206443['query']=_['keys'](_0x44d61e['query']);_0x206443[_0xf246('0x32')]=_[_0xf246('0x33')](_0x206443['model'],_0x206443[_0xf246('0x34')]);_0x469977[_0xf246('0x35')]=_['intersection'](_0x206443['model'],qs[_0xf246('0x36')](_0x44d61e[_0xf246('0x34')][_0xf246('0x36')]));_0x469977[_0xf246('0x35')]=_0x469977[_0xf246('0x35')]['length']?_0x469977['attributes']:_0x206443[_0xf246('0x31')];if(!_0x44d61e['query'][_0xf246('0x37')](_0xf246('0x38'))){_0x469977[_0xf246('0x21')]=qs[_0xf246('0x21')](_0x44d61e[_0xf246('0x34')]['limit']);_0x469977[_0xf246('0x23')]=qs['offset'](_0x44d61e['query'][_0xf246('0x23')]);}_0x469977['order']=qs[_0xf246('0x39')](_0x44d61e[_0xf246('0x34')][_0xf246('0x39')]);_0x469977['where']=qs['filters'](_[_0xf246('0x3a')](_0x44d61e[_0xf246('0x34')],_0x206443[_0xf246('0x32')]),_0x3b82c2);if(_0x44d61e[_0xf246('0x34')]['filter']){_0x469977['where']=_[_0xf246('0x3b')](_0x469977['where'],{'$or':_[_0xf246('0x2f')](_0x3b82c2,function(_0x14073f){if(_0x14073f[_0xf246('0x30')]!==_0xf246('0x3c')){var _0x2c080c={};_0x2c080c[_0x14073f[_0xf246('0x2c')]]={'$like':'%'+_0x44d61e['query'][_0xf246('0x3d')]+'%'};return _0x2c080c;}})});}_0x469977=_[_0xf246('0x3b')]({},_0x469977,_0x44d61e['options']);var _0x4b58de={'where':_0x469977['where']};return db[_0xf246('0x3e')]['count'](_0x4b58de)[_0xf246('0x28')](function(_0x4731e8){_0x294ab6[_0xf246('0x22')]=_0x4731e8;if(_0x44d61e[_0xf246('0x34')][_0xf246('0x3f')]){_0x469977['include']=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x469977);})[_0xf246('0x28')](function(_0x120252){_0x294ab6['rows']=_0x120252;return _0x294ab6;})['then'](respondWithFilteredResult(_0x1afd54,_0x469977))[_0xf246('0x40')](handleError(_0x1afd54,null));};exports['show']=function(_0xdedc6a,_0x7d5d5f){var _0x3296e7={'raw':!![],'where':{'id':_0xdedc6a[_0xf246('0x41')]['id']}},_0x501634={};_0x501634['model']=_[_0xf246('0x42')](db[_0xf246('0x3e')]['rawAttributes']);_0x501634[_0xf246('0x34')]=_['keys'](_0xdedc6a[_0xf246('0x34')]);_0x501634[_0xf246('0x32')]=_[_0xf246('0x33')](_0x501634[_0xf246('0x31')],_0x501634['query']);_0x3296e7[_0xf246('0x35')]=_[_0xf246('0x33')](_0x501634[_0xf246('0x31')],qs[_0xf246('0x36')](_0xdedc6a['query'][_0xf246('0x36')]));_0x3296e7[_0xf246('0x35')]=_0x3296e7[_0xf246('0x35')][_0xf246('0x43')]?_0x3296e7['attributes']:_0x501634[_0xf246('0x31')];if(_0xdedc6a[_0xf246('0x34')][_0xf246('0x3f')]){_0x3296e7[_0xf246('0x44')]=[{'all':!![]}];}_0x3296e7=_[_0xf246('0x3b')]({},_0x3296e7,_0xdedc6a[_0xf246('0x45')]);return db[_0xf246('0x3e')][_0xf246('0x46')](_0x3296e7)[_0xf246('0x28')](handleEntityNotFound(_0x7d5d5f,null))[_0xf246('0x28')](respondWithResult(_0x7d5d5f,null))[_0xf246('0x40')](handleError(_0x7d5d5f,null));};exports['create']=function(_0x3850aa,_0x2bfa16){return db[_0xf246('0x3e')][_0xf246('0x47')](_0x3850aa[_0xf246('0x48')],{})[_0xf246('0x28')](respondWithResult(_0x2bfa16,0xc9))['catch'](handleError(_0x2bfa16,null));};exports['update']=function(_0x1d24c6,_0x48ebb6){if(_0x1d24c6[_0xf246('0x48')]['id']){delete _0x1d24c6[_0xf246('0x48')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x1d24c6[_0xf246('0x41')]['id']}})[_0xf246('0x28')](handleEntityNotFound(_0x48ebb6,null))['then'](saveUpdates(_0x1d24c6['body'],null))[_0xf246('0x28')](respondWithResult(_0x48ebb6,null))[_0xf246('0x40')](handleError(_0x48ebb6,null));};exports[_0xf246('0x29')]=function(_0x237b84,_0x34f27c){return db[_0xf246('0x3e')]['find']({'where':{'id':_0x237b84[_0xf246('0x41')]['id']}})['then'](handleEntityNotFound(_0x34f27c,null))['then'](removeEntity(_0x34f27c,null))['catch'](handleError(_0x34f27c,null));};exports['describe']=function(_0x1c0355,_0x347eef){return db['SquareDetailsReport'][_0xf246('0x49')]()[_0xf246('0x28')](respondWithResult(_0x347eef,null))[_0xf246('0x40')](handleError(_0x347eef,null));}; \ No newline at end of file +var _0xdffc=['then','destroy','end','error','stack','name','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x16e3c1,_0x3e5ad9){var _0x4b17e6=function(_0x437da2){while(--_0x437da2){_0x16e3c1['push'](_0x16e3c1['shift']());}};_0x4b17e6(++_0x3e5ad9);}(_0xdffc,0x72));var _0xcdff=function(_0x3dbb33,_0x3a0462){_0x3dbb33=_0x3dbb33-0x0;var _0x1c5e34=_0xdffc[_0x3dbb33];return _0x1c5e34;};'use strict';var emlformat=require(_0xcdff('0x0'));var rimraf=require(_0xcdff('0x1'));var zipdir=require(_0xcdff('0x2'));var jsonpatch=require(_0xcdff('0x3'));var rp=require(_0xcdff('0x4'));var moment=require('moment');var BPromise=require(_0xcdff('0x5'));var Mustache=require(_0xcdff('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcdff('0x7'));var csv=require(_0xcdff('0x8'));var ejs=require(_0xcdff('0x9'));var fs=require('fs');var fs_extra=require(_0xcdff('0xa'));var _=require(_0xcdff('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcdff('0xc'));var toCsv=require(_0xcdff('0x8'));var querystring=require(_0xcdff('0xd'));var Papa=require(_0xcdff('0xe'));var Redis=require(_0xcdff('0xf'));var authService=require(_0xcdff('0x10'));var qs=require(_0xcdff('0x11'));var as=require(_0xcdff('0x12'));var hardwareService=require(_0xcdff('0x13'));var logger=require('../../config/logger')(_0xcdff('0x14'));var utils=require('../../config/utils');var config=require(_0xcdff('0x15'));var licenseUtil=require(_0xcdff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34208c,_0x12229f){_0x12229f=_0x12229f||0xcc;return function(_0x192d5e){if(_0x192d5e){return _0x34208c[_0xcdff('0x17')](_0x12229f);}return _0x34208c[_0xcdff('0x18')](_0x12229f)['end']();};}function respondWithResult(_0x56ca0a,_0x1766c4){_0x1766c4=_0x1766c4||0xc8;return function(_0x4a361c){if(_0x4a361c){return _0x56ca0a[_0xcdff('0x18')](_0x1766c4)['json'](_0x4a361c);}};}function respondWithFilteredResult(_0x26aa2c,_0x344887){return function(_0x1f17ab){if(_0x1f17ab){var _0x4e78ff=typeof _0x344887[_0xcdff('0x19')]===_0xcdff('0x1a')&&typeof _0x344887[_0xcdff('0x1b')]==='undefined';var _0x2c073c=_0x1f17ab[_0xcdff('0x1c')];var _0x1191da=_0x4e78ff?0x0:_0x344887[_0xcdff('0x19')];var _0x388411=_0x4e78ff?_0x1f17ab['count']:_0x344887['offset']+_0x344887[_0xcdff('0x1b')];var _0x14a811;if(_0x388411>=_0x2c073c){_0x388411=_0x2c073c;_0x14a811=0xc8;}else{_0x14a811=0xce;}_0x26aa2c[_0xcdff('0x18')](_0x14a811);return _0x26aa2c[_0xcdff('0x1d')](_0xcdff('0x1e'),_0x1191da+'-'+_0x388411+'/'+_0x2c073c)[_0xcdff('0x1f')](_0x1f17ab);}return null;};}function patchUpdates(_0x270cd8){return function(_0x2956e6){try{jsonpatch[_0xcdff('0x20')](_0x2956e6,_0x270cd8,!![]);}catch(_0x2ab7b1){return BPromise[_0xcdff('0x21')](_0x2ab7b1);}return _0x2956e6[_0xcdff('0x22')]();};}function saveUpdates(_0x3ce90b,_0x1c5fdb){return function(_0x20cbdf){if(_0x20cbdf){return _0x20cbdf[_0xcdff('0x23')](_0x3ce90b)[_0xcdff('0x24')](function(_0x1e37fb){return _0x1e37fb;});}return null;};}function removeEntity(_0x1b6774,_0x278031){return function(_0x57bf85){if(_0x57bf85){return _0x57bf85[_0xcdff('0x25')]()[_0xcdff('0x24')](function(){_0x1b6774[_0xcdff('0x18')](0xcc)[_0xcdff('0x26')]();});}};}function handleEntityNotFound(_0x2bb293,_0x37f3ed){return function(_0xa2137a){if(!_0xa2137a){_0x2bb293[_0xcdff('0x17')](0x194);}return _0xa2137a;};}function handleError(_0x545e6b,_0x284271){_0x284271=_0x284271||0x1f4;return function(_0x2ea58e){logger[_0xcdff('0x27')](_0x2ea58e[_0xcdff('0x28')]);if(_0x2ea58e['name']){delete _0x2ea58e[_0xcdff('0x29')];}_0x545e6b['status'](_0x284271)['send'](_0x2ea58e);};}exports[_0xcdff('0x2a')]=function(_0x1dd386,_0x25a4c7){var _0x2ceffd={},_0x4c1ab8={},_0x1642a9={'count':0x0,'rows':[]};var _0x57eb8f=_['map'](db['SquareDetailsReport']['rawAttributes'],function(_0x5d5051){return{'name':_0x5d5051[_0xcdff('0x2b')],'type':_0x5d5051[_0xcdff('0x2c')][_0xcdff('0x2d')]};});_0x4c1ab8[_0xcdff('0x2e')]=_[_0xcdff('0x2f')](_0x57eb8f,'name');_0x4c1ab8['query']=_[_0xcdff('0x30')](_0x1dd386[_0xcdff('0x31')]);_0x4c1ab8[_0xcdff('0x32')]=_[_0xcdff('0x33')](_0x4c1ab8[_0xcdff('0x2e')],_0x4c1ab8['query']);_0x2ceffd[_0xcdff('0x34')]=_[_0xcdff('0x33')](_0x4c1ab8['model'],qs['fields'](_0x1dd386[_0xcdff('0x31')]['fields']));_0x2ceffd[_0xcdff('0x34')]=_0x2ceffd[_0xcdff('0x34')][_0xcdff('0x35')]?_0x2ceffd['attributes']:_0x4c1ab8[_0xcdff('0x2e')];if(!_0x1dd386[_0xcdff('0x31')][_0xcdff('0x36')](_0xcdff('0x37'))){_0x2ceffd[_0xcdff('0x1b')]=qs[_0xcdff('0x1b')](_0x1dd386['query'][_0xcdff('0x1b')]);_0x2ceffd['offset']=qs['offset'](_0x1dd386[_0xcdff('0x31')]['offset']);}_0x2ceffd[_0xcdff('0x38')]=qs[_0xcdff('0x39')](_0x1dd386[_0xcdff('0x31')][_0xcdff('0x39')]);_0x2ceffd['where']=qs[_0xcdff('0x32')](_['pick'](_0x1dd386[_0xcdff('0x31')],_0x4c1ab8[_0xcdff('0x32')]),_0x57eb8f);if(_0x1dd386[_0xcdff('0x31')][_0xcdff('0x3a')]){_0x2ceffd[_0xcdff('0x3b')]=_[_0xcdff('0x3c')](_0x2ceffd[_0xcdff('0x3b')],{'$or':_[_0xcdff('0x2f')](_0x57eb8f,function(_0x1399f2){if(_0x1399f2[_0xcdff('0x2c')]!=='VIRTUAL'){var _0x845131={};_0x845131[_0x1399f2[_0xcdff('0x29')]]={'$like':'%'+_0x1dd386[_0xcdff('0x31')]['filter']+'%'};return _0x845131;}})});}_0x2ceffd=_['merge']({},_0x2ceffd,_0x1dd386[_0xcdff('0x3d')]);var _0xbbcdd7={'where':_0x2ceffd['where']};return db[_0xcdff('0x3e')][_0xcdff('0x1c')](_0xbbcdd7)[_0xcdff('0x24')](function(_0x23f374){_0x1642a9[_0xcdff('0x1c')]=_0x23f374;if(_0x1dd386[_0xcdff('0x31')][_0xcdff('0x3f')]){_0x2ceffd[_0xcdff('0x40')]=[{'all':!![]}];}return db[_0xcdff('0x3e')][_0xcdff('0x41')](_0x2ceffd);})['then'](function(_0x58cd04){_0x1642a9[_0xcdff('0x42')]=_0x58cd04;return _0x1642a9;})['then'](respondWithFilteredResult(_0x25a4c7,_0x2ceffd))['catch'](handleError(_0x25a4c7,null));};exports[_0xcdff('0x43')]=function(_0x218a16,_0x100c5d){var _0x4554fc={'raw':!![],'where':{'id':_0x218a16[_0xcdff('0x44')]['id']}},_0x21d869={};_0x21d869[_0xcdff('0x2e')]=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x21d869[_0xcdff('0x31')]=_[_0xcdff('0x30')](_0x218a16['query']);_0x21d869[_0xcdff('0x32')]=_[_0xcdff('0x33')](_0x21d869[_0xcdff('0x2e')],_0x21d869['query']);_0x4554fc['attributes']=_['intersection'](_0x21d869[_0xcdff('0x2e')],qs[_0xcdff('0x45')](_0x218a16[_0xcdff('0x31')][_0xcdff('0x45')]));_0x4554fc[_0xcdff('0x34')]=_0x4554fc[_0xcdff('0x34')][_0xcdff('0x35')]?_0x4554fc['attributes']:_0x21d869[_0xcdff('0x2e')];if(_0x218a16[_0xcdff('0x31')][_0xcdff('0x3f')]){_0x4554fc[_0xcdff('0x40')]=[{'all':!![]}];}_0x4554fc=_[_0xcdff('0x3c')]({},_0x4554fc,_0x218a16[_0xcdff('0x3d')]);return db[_0xcdff('0x3e')][_0xcdff('0x46')](_0x4554fc)[_0xcdff('0x24')](handleEntityNotFound(_0x100c5d,null))[_0xcdff('0x24')](respondWithResult(_0x100c5d,null))[_0xcdff('0x47')](handleError(_0x100c5d,null));};exports[_0xcdff('0x48')]=function(_0x466ef3,_0x12545a){return db[_0xcdff('0x3e')][_0xcdff('0x48')](_0x466ef3[_0xcdff('0x49')],{})[_0xcdff('0x24')](respondWithResult(_0x12545a,0xc9))[_0xcdff('0x47')](handleError(_0x12545a,null));};exports['update']=function(_0x4bb1ca,_0x4b3ed4){if(_0x4bb1ca[_0xcdff('0x49')]['id']){delete _0x4bb1ca[_0xcdff('0x49')]['id'];}return db['SquareDetailsReport'][_0xcdff('0x46')]({'where':{'id':_0x4bb1ca['params']['id']}})[_0xcdff('0x24')](handleEntityNotFound(_0x4b3ed4,null))[_0xcdff('0x24')](saveUpdates(_0x4bb1ca[_0xcdff('0x49')],null))[_0xcdff('0x24')](respondWithResult(_0x4b3ed4,null))[_0xcdff('0x47')](handleError(_0x4b3ed4,null));};exports[_0xcdff('0x25')]=function(_0x155d14,_0x346eec){return db['SquareDetailsReport']['find']({'where':{'id':_0x155d14[_0xcdff('0x44')]['id']}})['then'](handleEntityNotFound(_0x346eec,null))[_0xcdff('0x24')](removeEntity(_0x346eec,null))['catch'](handleError(_0x346eec,null));};exports[_0xcdff('0x4a')]=function(_0xbb786a,_0x3becab){return db['SquareDetailsReport'][_0xcdff('0x4a')]()[_0xcdff('0x24')](respondWithResult(_0x3becab,null))[_0xcdff('0x47')](handleError(_0x3becab,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 00ec899..654a731 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 _0x3f03=['moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger'];(function(_0x6e19c0,_0x1471ac){var _0x48e694=function(_0x40ddd8){while(--_0x40ddd8){_0x6e19c0['push'](_0x6e19c0['shift']());}};_0x48e694(++_0x1471ac);}(_0x3f03,0x129));var _0x33f0=function(_0x38562b,_0x459ee6){_0x38562b=_0x38562b-0x0;var _0x26a8c3=_0x3f03[_0x38562b];return _0x26a8c3;};'use strict';var _=require(_0x33f0('0x0'));var util=require(_0x33f0('0x1'));var logger=require(_0x33f0('0x2'))('api');var moment=require(_0x33f0('0x3'));var BPromise=require(_0x33f0('0x4'));var rp=require(_0x33f0('0x5'));var fs=require('fs');var path=require(_0x33f0('0x6'));var rimraf=require('rimraf');var config=require(_0x33f0('0x7'));var attributes=require(_0x33f0('0x8'));module[_0x33f0('0x9')]=function(_0x299628,_0x48c626){return _0x299628[_0x33f0('0xa')]('SquareDetailsReport',attributes,{'tableName':_0x33f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd74a=['report_square_details','lodash','util','../../config/logger','api','moment','bluebird','path','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x24eac1,_0x1335c0){var _0x163b2b=function(_0x2ae951){while(--_0x2ae951){_0x24eac1['push'](_0x24eac1['shift']());}};_0x163b2b(++_0x1335c0);}(_0xd74a,0x1e5));var _0xad74=function(_0x11ed4b,_0x1ba234){_0x11ed4b=_0x11ed4b-0x0;var _0x16f2e0=_0xd74a[_0x11ed4b];return _0x16f2e0;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var logger=require(_0xad74('0x2'))(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require(_0xad74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad74('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad74('0x7'));module[_0xad74('0x8')]=function(_0x4253e1,_0x363a7a){return _0x4253e1['define'](_0xad74('0x9'),attributes,{'tableName':_0xad74('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7d27f4d..3001184 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 _0xdd6e=['options','raw','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body'];(function(_0x5a6bc1,_0x5b5c06){var _0x2a1bb4=function(_0x4a420a){while(--_0x4a420a){_0x5a6bc1['push'](_0x5a6bc1['shift']());}};_0x2a1bb4(++_0x5b5c06);}(_0xdd6e,0xa5));var _0xedd6=function(_0x11c650,_0x954fd9){_0x11c650=_0x11c650-0x0;var _0xa5d84b=_0xdd6e[_0x11c650];return _0xa5d84b;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var moment=require(_0xedd6('0x2'));var BPromise=require(_0xedd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedd6('0x4'));var db=require(_0xedd6('0x5'))['db'];var utils=require(_0xedd6('0x6'));var logger=require(_0xedd6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xedd6('0x8')][_0xedd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5300a5,_0x135950,_0x30d933){return new BPromise(function(_0x15f317,_0x29743a){return client[_0xedd6('0xa')](_0x5300a5,_0x30d933)['then'](function(_0x4c282c){logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,'request\x20sent');logger[_0xedd6('0xd')](_0xedd6('0xe'),_0x135950,_0xedd6('0xf'),JSON[_0xedd6('0x10')](_0x4c282c));if(_0x4c282c['error']){if(_0x4c282c[_0xedd6('0x11')]['code']===0x1f4){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x29743a(_0x4c282c['error'][_0xedd6('0x12')]);}logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x15f317(_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);}else{logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,_0xedd6('0xf'));_0x15f317(_0x4c282c[_0xedd6('0x13')][_0xedd6('0x12')]);}})['catch'](function(_0x278c18){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x278c18);_0x29743a(_0x278c18);});});}exports[_0xedd6('0x14')]=function(_0x4c0411){var _0x57f7d9=this;return new Promise(function(_0x129e82,_0x48e054){return db[_0xedd6('0x15')][_0xedd6('0x16')](_0x4c0411[_0xedd6('0x17')],{'raw':_0x4c0411[_0xedd6('0x18')]?_0x4c0411[_0xedd6('0x18')][_0xedd6('0x19')]===undefined?!![]:![]:!![]})[_0xedd6('0x1a')](function(_0x3440c4){logger['info'](_0xedd6('0x14'),_0x4c0411);logger[_0xedd6('0xd')]('CreateSquareDetailsReport',_0x4c0411,JSON[_0xedd6('0x10')](_0x3440c4));_0x129e82(_0x3440c4);})['catch'](function(_0x22073a){logger[_0xedd6('0x11')](_0xedd6('0x14'),_0x22073a['message'],_0x4c0411);_0x48e054(_0x57f7d9[_0xedd6('0x11')](0x1f4,_0x22073a[_0xedd6('0x12')]));});});}; \ No newline at end of file +var _0x9354=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport','create','body','options','then','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x320f78,_0x16294f){var _0x5eead7=function(_0x26fb3c){while(--_0x26fb3c){_0x320f78['push'](_0x320f78['shift']());}};_0x5eead7(++_0x16294f);}(_0x9354,0x96));var _0x4935=function(_0x5a585b,_0x3e0674){_0x5a585b=_0x5a585b-0x0;var _0x4cd398=_0x9354[_0x5a585b];return _0x4cd398;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e47bd,_0x118d36,_0x2d735e){return new BPromise(function(_0x10793e,_0x4c9902){return client[_0x4935('0xb')](_0x2e47bd,_0x2d735e)['then'](function(_0x2aac9a){logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));logger[_0x4935('0xf')](_0x4935('0x10'),_0x118d36,'request\x20sent',JSON['stringify'](_0x2aac9a));if(_0x2aac9a[_0x4935('0x11')]){if(_0x2aac9a['error']['code']===0x1f4){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x4c9902(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);return _0x10793e(_0x2aac9a[_0x4935('0x11')][_0x4935('0x12')]);}else{logger[_0x4935('0xc')](_0x4935('0xd'),_0x118d36,_0x4935('0xe'));_0x10793e(_0x2aac9a[_0x4935('0x13')]['message']);}})[_0x4935('0x14')](function(_0x46526a){logger[_0x4935('0x11')](_0x4935('0xd'),_0x118d36,_0x46526a);_0x4c9902(_0x46526a);});});}exports[_0x4935('0x15')]=function(_0x429ef3){var _0x4ebc63=this;return new Promise(function(_0xd70eff,_0x145277){return db['SquareDetailsReport'][_0x4935('0x16')](_0x429ef3[_0x4935('0x17')],{'raw':_0x429ef3[_0x4935('0x18')]?_0x429ef3['options']['raw']===undefined?!![]:![]:!![]})[_0x4935('0x19')](function(_0x6b849f){logger[_0x4935('0xc')](_0x4935('0x15'),_0x429ef3);logger[_0x4935('0xf')](_0x4935('0x15'),_0x429ef3,JSON[_0x4935('0x1a')](_0x6b849f));_0xd70eff(_0x6b849f);})[_0x4935('0x14')](function(_0x58b2f3){logger[_0x4935('0x11')](_0x4935('0x15'),_0x58b2f3[_0x4935('0x12')],_0x429ef3);_0x145277(_0x4ebc63[_0x4935('0x11')](0x1f4,_0x58b2f3[_0x4935('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 84aeca9..50adb46 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 _0xb2cd=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','express','Router','../../components/auth/service'];(function(_0x1cd34e,_0x1b9ac1){var _0x18d377=function(_0x5194a7){while(--_0x5194a7){_0x1cd34e['push'](_0x1cd34e['shift']());}};_0x18d377(++_0x1b9ac1);}(_0xb2cd,0x1ad));var _0xdb2c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xb2cd[_0x29d915];return _0x160f86;};'use strict';var express=require(_0xdb2c('0x0'));var router=express[_0xdb2c('0x1')]();var auth=require(_0xdb2c('0x2'));var controller=require(_0xdb2c('0x3'));router[_0xdb2c('0x4')]('/',auth[_0xdb2c('0x5')](),controller[_0xdb2c('0x6')]);router[_0xdb2c('0x4')](_0xdb2c('0x7'),auth[_0xdb2c('0x5')](),controller[_0xdb2c('0x8')]);module['exports']=router; \ No newline at end of file +var _0xeb93=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb93,0x10d));var _0x3eb9=function(_0x13d577,_0x54156b){_0x13d577=_0x13d577-0x0;var _0x54304e=_0xeb93[_0x13d577];return _0x54304e;};'use strict';var express=require(_0x3eb9('0x0'));var router=express[_0x3eb9('0x1')]();var auth=require(_0x3eb9('0x2'));var controller=require(_0x3eb9('0x3'));router[_0x3eb9('0x4')]('/',auth[_0x3eb9('0x5')](),controller['index']);router['get'](_0x3eb9('0x6'),auth[_0x3eb9('0x5')](),controller[_0x3eb9('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 2c80c73..e15e4e3 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 _0xa384=['SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','then','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill'];(function(_0x1c3065,_0x4a3b38){var _0x58aeb8=function(_0x145261){while(--_0x145261){_0x1c3065['push'](_0x1c3065['shift']());}};_0x58aeb8(++_0x4a3b38);}(_0xa384,0x146));var _0x4a38=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xa384[_0x556927];return _0x5f1235;};'use strict';var info=require(_0x4a38('0x0'));var exec=require(_0x4a38('0x1'))[_0x4a38('0x2')];var logger=require(_0x4a38('0x3'))(_0x4a38('0x4'));var util=require(_0x4a38('0x5'));var BPromise=require('bluebird');var _=require(_0x4a38('0x6'));function handleError(_0x189cd3,_0xffb1da,_0x2a2087){_0xffb1da=_0xffb1da||0x1f4;return function(_0x473612){logger[_0x4a38('0x7')](_0x4a38('0x8'),_0x2a2087,_0xffb1da,util[_0x4a38('0x9')](_0x473612,{'showHidden':![],'depth':null}));delete _0x473612[_0x4a38('0xa')];_0x189cd3[_0x4a38('0xb')](_0xffb1da)['send'](_0x473612);};}exports['index']=function(_0x39f158,_0x2c825e){return info['getAllData']()[_0x4a38('0xc')](function(_0x90985d){return _0x2c825e[_0x4a38('0xb')](0xc8)[_0x4a38('0xd')](_0x90985d);})['catch'](function(_0x21bfd0){return _0x2c825e[_0x4a38('0xb')](0x1f4)['json'](_0x21bfd0);});};exports[_0x4a38('0xe')]=function(_0xd5bcaa,_0x53457b){var _0x502403=['components/import/cm'];return new BPromise(function(_0x3575ee,_0x4b90ab){return exec(util[_0x4a38('0xf')](_0x4a38('0x10'),_0xd5bcaa[_0x4a38('0x11')][_0x4a38('0x12')]),function(_0x460406,_0x18ab37,_0x2dcd78){if(_0x460406){return _0x4b90ab(_0x460406);}return _0x3575ee(_0x18ab37);});})[_0x4a38('0xc')](function(_0x101c7c){var _0x341ba9=![];var _0x4b3f0e=_0x101c7c[_0x4a38('0x13')](/\n/);for(var _0x48be34=0x0,_0xb4d510=_0x502403[_0x4a38('0x14')];_0x48be34<_0xb4d510,_0x341ba9===![];_0x48be34+=0x1){if(_0x101c7c[_0x4a38('0x15')](_0x502403[_0x48be34])>=0x0){_0x341ba9=!![];}}if(!_0x341ba9){throw new Error(util[_0x4a38('0xf')](_0x4a38('0x16'),_0xd5bcaa[_0x4a38('0x11')]['pid']));}process[_0x4a38('0x17')](_0xd5bcaa['params']['pid'],_0x4a38('0x18'));return _0x53457b[_0x4a38('0xb')](0xc8)[_0x4a38('0xd')]({'message':util[_0x4a38('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xd5bcaa[_0x4a38('0x11')]['pid'])});})['catch'](handleError(_0x53457b,null,_0x4a38('0xe')));}; \ No newline at end of file +var _0x2647=['child_process','exec','api','bluebird','error','inspect','name','status','send','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation'];(function(_0x47d62c,_0x226883){var _0x155fc0=function(_0x581da0){while(--_0x581da0){_0x47d62c['push'](_0x47d62c['shift']());}};_0x155fc0(++_0x226883);}(_0x2647,0x86));var _0x7264=function(_0x192331,_0x535ca2){_0x192331=_0x192331-0x0;var _0x403fb4=_0x2647[_0x192331];return _0x403fb4;};'use strict';var info=require(_0x7264('0x0'));var exec=require(_0x7264('0x1'))[_0x7264('0x2')];var logger=require('../../config/logger')(_0x7264('0x3'));var util=require('util');var BPromise=require(_0x7264('0x4'));var _=require('lodash');function handleError(_0x151128,_0x1c99d1,_0xc4782f){_0x1c99d1=_0x1c99d1||0x1f4;return function(_0x4bdb89){logger[_0x7264('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0xc4782f,_0x1c99d1,util[_0x7264('0x6')](_0x4bdb89,{'showHidden':![],'depth':null}));delete _0x4bdb89[_0x7264('0x7')];_0x151128[_0x7264('0x8')](_0x1c99d1)[_0x7264('0x9')](_0x4bdb89);};}exports[_0x7264('0xa')]=function(_0x3d14be,_0x9ffff7){return info[_0x7264('0xb')]()['then'](function(_0x2b38f6){return _0x9ffff7[_0x7264('0x8')](0xc8)[_0x7264('0xc')](_0x2b38f6);})[_0x7264('0xd')](function(_0x1a2cea){return _0x9ffff7[_0x7264('0x8')](0x1f4)[_0x7264('0xc')](_0x1a2cea);});};exports[_0x7264('0xe')]=function(_0x4b5cbe,_0x1f2c34){var _0x18e0e6=[_0x7264('0xf')];return new BPromise(function(_0x170b50,_0x51da2b){return exec(util[_0x7264('0x10')](_0x7264('0x11'),_0x4b5cbe[_0x7264('0x12')]['pid']),function(_0x1c1cc5,_0x4b270d,_0x5d69a7){if(_0x1c1cc5){return _0x51da2b(_0x1c1cc5);}return _0x170b50(_0x4b270d);});})['then'](function(_0x150e66){var _0x37c5bd=![];var _0x5bca8e=_0x150e66[_0x7264('0x13')](/\n/);for(var _0xec3d7b=0x0,_0x3c8721=_0x18e0e6[_0x7264('0x14')];_0xec3d7b<_0x3c8721,_0x37c5bd===![];_0xec3d7b+=0x1){if(_0x150e66[_0x7264('0x15')](_0x18e0e6[_0xec3d7b])>=0x0){_0x37c5bd=!![];}}if(!_0x37c5bd){throw new Error(util[_0x7264('0x10')](_0x7264('0x16'),_0x4b5cbe[_0x7264('0x12')]['pid']));}process[_0x7264('0x17')](_0x4b5cbe[_0x7264('0x12')][_0x7264('0x18')],_0x7264('0x19'));return _0x1f2c34[_0x7264('0x8')](0xc8)['json']({'message':util[_0x7264('0x10')](_0x7264('0x1a'),_0x4b5cbe[_0x7264('0x12')][_0x7264('0x18')])});})[_0x7264('0xd')](handleError(_0x1f2c34,null,_0x7264('0xe')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index bdae646..4ea297c 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 _0x5990=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3f3bb0,_0x5b00eb){var _0x434fae=function(_0x170db2){while(--_0x170db2){_0x3f3bb0['push'](_0x3f3bb0['shift']());}};_0x434fae(++_0x5b00eb);}(_0x5990,0x1a1));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x0599('0x0'));var util=require(_0x0599('0x1'));var path=require(_0x0599('0x2'));var timeout=require(_0x0599('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0599('0x4'));var interaction=require(_0x0599('0x5'));var config=require(_0x0599('0x6'));var controller=require('./tag.controller');router[_0x0599('0x7')]('/',auth[_0x0599('0x8')](),controller[_0x0599('0x9')]);router[_0x0599('0x7')](_0x0599('0xa'),auth[_0x0599('0x8')](),controller['show']);router[_0x0599('0xb')]('/',auth['isAuthenticated'](),controller[_0x0599('0xc')]);router[_0x0599('0xd')]('/:id',auth[_0x0599('0x8')](),controller[_0x0599('0xe')]);router[_0x0599('0xf')](_0x0599('0xa'),auth[_0x0599('0x8')](),controller[_0x0599('0x10')]);module['exports']=router; \ No newline at end of file +var _0x397b=['create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x320020,_0x91b49){var _0xeb1ef1=function(_0x4d2ca6){while(--_0x4d2ca6){_0x320020['push'](_0x320020['shift']());}};_0xeb1ef1(++_0x91b49);}(_0x397b,0x15b));var _0xb397=function(_0x2faf1c,_0x530cfe){_0x2faf1c=_0x2faf1c-0x0;var _0x5e7429=_0x397b[_0x2faf1c];return _0x5e7429;};'use strict';var multer=require('multer');var util=require(_0xb397('0x0'));var path=require(_0xb397('0x1'));var timeout=require(_0xb397('0x2'));var express=require(_0xb397('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb397('0x4'));var interaction=require(_0xb397('0x5'));var config=require(_0xb397('0x6'));var controller=require(_0xb397('0x7'));router[_0xb397('0x8')]('/',auth[_0xb397('0x9')](),controller[_0xb397('0xa')]);router[_0xb397('0x8')](_0xb397('0xb'),auth['isAuthenticated'](),controller[_0xb397('0xc')]);router[_0xb397('0xd')]('/',auth['isAuthenticated'](),controller[_0xb397('0xe')]);router[_0xb397('0xf')](_0xb397('0xb'),auth[_0xb397('0x9')](),controller[_0xb397('0x10')]);router['delete'](_0xb397('0xb'),auth['isAuthenticated'](),controller[_0xb397('0x11')]);module[_0xb397('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a435c49..b034bfc 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 _0x2b65=['sequelize','exports','STRING','name','#0091EA'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2b65,0x131));var _0x52b6=function(_0x52f975,_0x305404){_0x52f975=_0x52f975-0x0;var _0x1b15a3=_0x2b65[_0x52f975];return _0x1b15a3;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'name':{'type':Sequelize[_0x52b6('0x2')],'unique':_0x52b6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':_0x52b6('0x4')},'description':{'type':Sequelize[_0x52b6('0x2')]}}; \ No newline at end of file +var _0xa0a3=['exports','STRING','#0091EA'];(function(_0x14871a,_0x4c473c){var _0x3fc524=function(_0x2e8292){while(--_0x2e8292){_0x14871a['push'](_0x14871a['shift']());}};_0x3fc524(++_0x4c473c);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x1d1a68,_0x3a2c6c){_0x1d1a68=_0x1d1a68-0x0;var _0x20c948=_0xa0a3[_0x1d1a68];return _0x20c948;};'use strict';var Sequelize=require('sequelize');module[_0x3a0a('0x0')]={'name':{'type':Sequelize[_0x3a0a('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3a0a('0x1')],'defaultValue':_0x3a0a('0x2')},'description':{'type':Sequelize[_0x3a0a('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 32cc82d..b59d2b6 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 _0x0506=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Tag','includeAll','include','findAll','rows','params','keys','intersection','length','find','catch','create','body','user','get','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x1bfb56,_0x22ebfa){var _0x1858dd=function(_0x3b9510){while(--_0x3b9510){_0x1bfb56['push'](_0x1bfb56['shift']());}};_0x1858dd(++_0x22ebfa);}(_0x0506,0x1d1));var _0x6050=function(_0x3134c8,_0x238589){_0x3134c8=_0x3134c8-0x0;var _0x4f30e0=_0x0506[_0x3134c8];return _0x4f30e0;};'use strict';var emlformat=require(_0x6050('0x0'));var rimraf=require(_0x6050('0x1'));var zipdir=require(_0x6050('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6050('0x3'));var util=require('util');var path=require(_0x6050('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6050('0x5'));var fs=require('fs');var fs_extra=require(_0x6050('0x6'));var _=require(_0x6050('0x7'));var squel=require(_0x6050('0x8'));var crypto=require(_0x6050('0x9'));var jsforce=require(_0x6050('0xa'));var deskjs=require(_0x6050('0xb'));var toCsv=require(_0x6050('0xc'));var querystring=require('querystring');var Papa=require(_0x6050('0xd'));var Redis=require('ioredis');var authService=require(_0x6050('0xe'));var qs=require(_0x6050('0xf'));var as=require(_0x6050('0x10'));var hardwareService=require(_0x6050('0x11'));var logger=require(_0x6050('0x12'))(_0x6050('0x13'));var utils=require(_0x6050('0x14'));var config=require(_0x6050('0x15'));var licenseUtil=require(_0x6050('0x16'));var db=require(_0x6050('0x17'))['db'];function respondWithStatusCode(_0x4de24c,_0x1e44ab){_0x1e44ab=_0x1e44ab||0xcc;return function(_0x5b304a){if(_0x5b304a){return _0x4de24c[_0x6050('0x18')](_0x1e44ab);}return _0x4de24c[_0x6050('0x19')](_0x1e44ab)[_0x6050('0x1a')]();};}function respondWithResult(_0x248431,_0x4b5503){_0x4b5503=_0x4b5503||0xc8;return function(_0x223a06){if(_0x223a06){return _0x248431['status'](_0x4b5503)[_0x6050('0x1b')](_0x223a06);}};}function respondWithFilteredResult(_0x2229f5,_0x465e2b){return function(_0x3876e6){if(_0x3876e6){var _0x4e33d1=typeof _0x465e2b[_0x6050('0x1c')]===_0x6050('0x1d')&&typeof _0x465e2b[_0x6050('0x1e')]===_0x6050('0x1d');var _0x1d1bfa=_0x3876e6[_0x6050('0x1f')];var _0x347899=_0x4e33d1?0x0:_0x465e2b['offset'];var _0x1dd507=_0x4e33d1?_0x3876e6[_0x6050('0x1f')]:_0x465e2b[_0x6050('0x1c')]+_0x465e2b['limit'];var _0x4ed245;if(_0x1dd507>=_0x1d1bfa){_0x1dd507=_0x1d1bfa;_0x4ed245=0xc8;}else{_0x4ed245=0xce;}_0x2229f5['status'](_0x4ed245);return _0x2229f5['set'](_0x6050('0x20'),_0x347899+'-'+_0x1dd507+'/'+_0x1d1bfa)[_0x6050('0x1b')](_0x3876e6);}return null;};}function patchUpdates(_0x4c0270){return function(_0x160d17){try{jsonpatch[_0x6050('0x21')](_0x160d17,_0x4c0270,!![]);}catch(_0x354ced){return BPromise[_0x6050('0x22')](_0x354ced);}return _0x160d17[_0x6050('0x23')]();};}function saveUpdates(_0x295b97,_0x50d6f6){return function(_0x3b6e2f){if(_0x3b6e2f){return _0x3b6e2f[_0x6050('0x24')](_0x295b97)[_0x6050('0x25')](function(_0x33d403){return _0x33d403;});}return null;};}function removeEntity(_0x19602f,_0x178d58){return function(_0x2c76ba){if(_0x2c76ba){return _0x2c76ba[_0x6050('0x26')]()['then'](function(){var _0x453869=_0x2c76ba['get']({'plain':!![]});var _0x2a991b=_0x6050('0x27');return db[_0x6050('0x28')][_0x6050('0x26')]({'where':{'type':_0x2a991b,'resourceId':_0x453869['id']}})[_0x6050('0x25')](function(){return _0x2c76ba;});})[_0x6050('0x25')](function(){_0x19602f['status'](0xcc)[_0x6050('0x1a')]();});}};}function handleEntityNotFound(_0x436d39,_0x38be9f){return function(_0x38d135){if(!_0x38d135){_0x436d39['sendStatus'](0x194);}return _0x38d135;};}function handleError(_0x1527ea,_0xaf9ebe){_0xaf9ebe=_0xaf9ebe||0x1f4;return function(_0x1698fa){logger[_0x6050('0x29')](_0x1698fa[_0x6050('0x2a')]);if(_0x1698fa[_0x6050('0x2b')]){delete _0x1698fa[_0x6050('0x2b')];}_0x1527ea['status'](_0xaf9ebe)[_0x6050('0x2c')](_0x1698fa);};}exports[_0x6050('0x2d')]=function(_0x231947,_0x189e1b){var _0x3f6865={},_0x182137={},_0x2a5313={'count':0x0,'rows':[]};var _0x412279=_[_0x6050('0x2e')](db['Tag'][_0x6050('0x2f')],function(_0x5c6e90){return{'name':_0x5c6e90['fieldName'],'type':_0x5c6e90[_0x6050('0x30')][_0x6050('0x31')]};});_0x182137[_0x6050('0x32')]=_['map'](_0x412279,_0x6050('0x2b'));_0x182137['query']=_['keys'](_0x231947[_0x6050('0x33')]);_0x182137[_0x6050('0x34')]=_['intersection'](_0x182137['model'],_0x182137[_0x6050('0x33')]);_0x3f6865[_0x6050('0x35')]=_['intersection'](_0x182137[_0x6050('0x32')],qs[_0x6050('0x36')](_0x231947[_0x6050('0x33')][_0x6050('0x36')]));_0x3f6865['attributes']=_0x3f6865[_0x6050('0x35')]['length']?_0x3f6865[_0x6050('0x35')]:_0x182137['model'];if(!_0x231947[_0x6050('0x33')][_0x6050('0x37')](_0x6050('0x38'))){_0x3f6865['limit']=qs[_0x6050('0x1e')](_0x231947['query'][_0x6050('0x1e')]);_0x3f6865['offset']=qs[_0x6050('0x1c')](_0x231947[_0x6050('0x33')][_0x6050('0x1c')]);}_0x3f6865[_0x6050('0x39')]=qs['sort'](_0x231947[_0x6050('0x33')][_0x6050('0x3a')]);_0x3f6865['where']=qs[_0x6050('0x34')](_[_0x6050('0x3b')](_0x231947[_0x6050('0x33')],_0x182137['filters']),_0x412279);if(_0x231947[_0x6050('0x33')][_0x6050('0x3c')]){_0x3f6865[_0x6050('0x3d')]=_['merge'](_0x3f6865[_0x6050('0x3d')],{'$or':_[_0x6050('0x2e')](_0x412279,function(_0x4d1f95){if(_0x4d1f95[_0x6050('0x30')]!==_0x6050('0x3e')){var _0xb53d7c={};_0xb53d7c[_0x4d1f95[_0x6050('0x2b')]]={'$like':'%'+_0x231947[_0x6050('0x33')][_0x6050('0x3c')]+'%'};return _0xb53d7c;}})});}_0x3f6865=_[_0x6050('0x3f')]({},_0x3f6865,_0x231947[_0x6050('0x40')]);var _0x539f31={'where':_0x3f6865['where']};return db[_0x6050('0x41')][_0x6050('0x1f')](_0x539f31)['then'](function(_0x335f89){_0x2a5313['count']=_0x335f89;if(_0x231947[_0x6050('0x33')][_0x6050('0x42')]){_0x3f6865[_0x6050('0x43')]=[{'all':!![]}];}return db[_0x6050('0x41')][_0x6050('0x44')](_0x3f6865);})[_0x6050('0x25')](function(_0xeab046){_0x2a5313[_0x6050('0x45')]=_0xeab046;return _0x2a5313;})['then'](respondWithFilteredResult(_0x189e1b,_0x3f6865))['catch'](handleError(_0x189e1b,null));};exports['show']=function(_0x42ec64,_0x39d256){var _0x169eb4={'raw':!![],'where':{'id':_0x42ec64[_0x6050('0x46')]['id']}},_0x416e16={};_0x416e16[_0x6050('0x32')]=_[_0x6050('0x47')](db[_0x6050('0x41')][_0x6050('0x2f')]);_0x416e16[_0x6050('0x33')]=_[_0x6050('0x47')](_0x42ec64[_0x6050('0x33')]);_0x416e16['filters']=_['intersection'](_0x416e16[_0x6050('0x32')],_0x416e16[_0x6050('0x33')]);_0x169eb4[_0x6050('0x35')]=_[_0x6050('0x48')](_0x416e16[_0x6050('0x32')],qs['fields'](_0x42ec64[_0x6050('0x33')][_0x6050('0x36')]));_0x169eb4['attributes']=_0x169eb4[_0x6050('0x35')][_0x6050('0x49')]?_0x169eb4[_0x6050('0x35')]:_0x416e16['model'];if(_0x42ec64['query']['includeAll']){_0x169eb4['include']=[{'all':!![]}];}_0x169eb4=_[_0x6050('0x3f')]({},_0x169eb4,_0x42ec64[_0x6050('0x40')]);return db[_0x6050('0x41')][_0x6050('0x4a')](_0x169eb4)[_0x6050('0x25')](handleEntityNotFound(_0x39d256,null))[_0x6050('0x25')](respondWithResult(_0x39d256,null))[_0x6050('0x4b')](handleError(_0x39d256,null));};exports[_0x6050('0x4c')]=function(_0x42471f,_0x52580d){return db[_0x6050('0x41')][_0x6050('0x4c')](_0x42471f[_0x6050('0x4d')],{})[_0x6050('0x25')](function(_0x2f8402){var _0x2bf6ff=_0x42471f[_0x6050('0x4e')][_0x6050('0x4f')]({'plain':!![]});if(!_0x2bf6ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bf6ff['role']==='user'){var _0x3754c6=_0x2f8402[_0x6050('0x4f')]({'plain':!![]});var _0x4230c4=_0x6050('0x27');return db[_0x6050('0x50')]['find']({'where':{'name':_0x4230c4,'userProfileId':_0x2bf6ff[_0x6050('0x51')]},'raw':!![]})[_0x6050('0x25')](function(_0x7d9ab0){if(_0x7d9ab0&&_0x7d9ab0['autoAssociation']===0x0){return db[_0x6050('0x28')][_0x6050('0x4c')]({'name':_0x3754c6[_0x6050('0x2b')],'resourceId':_0x3754c6['id'],'type':_0x7d9ab0[_0x6050('0x2b')],'sectionId':_0x7d9ab0['id']},{})[_0x6050('0x25')](function(){return _0x2f8402;});}else{return _0x2f8402;}})['catch'](function(_0x46b5e0){logger[_0x6050('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46b5e0);throw _0x46b5e0;});}return _0x2f8402;})[_0x6050('0x25')](respondWithResult(_0x52580d,0xc9))[_0x6050('0x4b')](handleError(_0x52580d,null));};exports['update']=function(_0x18e782,_0x135a9d){if(_0x18e782[_0x6050('0x4d')]['id']){delete _0x18e782[_0x6050('0x4d')]['id'];}return db['Tag']['find']({'where':{'id':_0x18e782[_0x6050('0x46')]['id']}})[_0x6050('0x25')](handleEntityNotFound(_0x135a9d,null))[_0x6050('0x25')](saveUpdates(_0x18e782[_0x6050('0x4d')],null))[_0x6050('0x25')](respondWithResult(_0x135a9d,null))[_0x6050('0x4b')](handleError(_0x135a9d,null));};exports[_0x6050('0x26')]=function(_0x412f73,_0xe4df85){return db[_0x6050('0x41')][_0x6050('0x4a')]({'where':{'id':_0x412f73[_0x6050('0x46')]['id']}})[_0x6050('0x25')](handleEntityNotFound(_0xe4df85,null))['then'](removeEntity(_0xe4df85,null))['catch'](handleError(_0xe4df85,null));}; \ No newline at end of file +var _0xfc03=['Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','create','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map'];(function(_0x2bfdd3,_0x5d4db9){var _0x23c3d2=function(_0x3bb659){while(--_0x3bb659){_0x2bfdd3['push'](_0x2bfdd3['shift']());}};_0x23c3d2(++_0x5d4db9);}(_0xfc03,0x16f));var _0x3fc0=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xfc03[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0x3fc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fc0('0x1'));var jsonpatch=require(_0x3fc0('0x2'));var rp=require('request-promise');var moment=require(_0x3fc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fc0('0x4'));var util=require(_0x3fc0('0x5'));var path=require(_0x3fc0('0x6'));var sox=require(_0x3fc0('0x7'));var csv=require(_0x3fc0('0x8'));var ejs=require(_0x3fc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3fc0('0xa'));var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x8'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var as=require(_0x3fc0('0x12'));var hardwareService=require(_0x3fc0('0x13'));var logger=require(_0x3fc0('0x14'))('api');var utils=require(_0x3fc0('0x15'));var config=require(_0x3fc0('0x16'));var licenseUtil=require(_0x3fc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1011b7,_0x582e22){_0x582e22=_0x582e22||0xcc;return function(_0x3a4cc0){if(_0x3a4cc0){return _0x1011b7[_0x3fc0('0x18')](_0x582e22);}return _0x1011b7['status'](_0x582e22)[_0x3fc0('0x19')]();};}function respondWithResult(_0x422926,_0x392c46){_0x392c46=_0x392c46||0xc8;return function(_0x4eb69a){if(_0x4eb69a){return _0x422926[_0x3fc0('0x1a')](_0x392c46)[_0x3fc0('0x1b')](_0x4eb69a);}};}function respondWithFilteredResult(_0x367ce1,_0x27619a){return function(_0x562ecc){if(_0x562ecc){var _0x277dbf=typeof _0x27619a[_0x3fc0('0x1c')]===_0x3fc0('0x1d')&&typeof _0x27619a['limit']===_0x3fc0('0x1d');var _0x491446=_0x562ecc[_0x3fc0('0x1e')];var _0x3c5026=_0x277dbf?0x0:_0x27619a['offset'];var _0x3bb388=_0x277dbf?_0x562ecc[_0x3fc0('0x1e')]:_0x27619a[_0x3fc0('0x1c')]+_0x27619a[_0x3fc0('0x1f')];var _0x1bd575;if(_0x3bb388>=_0x491446){_0x3bb388=_0x491446;_0x1bd575=0xc8;}else{_0x1bd575=0xce;}_0x367ce1[_0x3fc0('0x1a')](_0x1bd575);return _0x367ce1[_0x3fc0('0x20')](_0x3fc0('0x21'),_0x3c5026+'-'+_0x3bb388+'/'+_0x491446)[_0x3fc0('0x1b')](_0x562ecc);}return null;};}function patchUpdates(_0x5c859e){return function(_0xf13744){try{jsonpatch[_0x3fc0('0x22')](_0xf13744,_0x5c859e,!![]);}catch(_0x34ffa7){return BPromise[_0x3fc0('0x23')](_0x34ffa7);}return _0xf13744[_0x3fc0('0x24')]();};}function saveUpdates(_0x448293,_0x47c770){return function(_0x477674){if(_0x477674){return _0x477674[_0x3fc0('0x25')](_0x448293)[_0x3fc0('0x26')](function(_0x28fc65){return _0x28fc65;});}return null;};}function removeEntity(_0x46c213,_0x303dd2){return function(_0x2f423e){if(_0x2f423e){return _0x2f423e[_0x3fc0('0x27')]()[_0x3fc0('0x26')](function(){var _0x35a3e2=_0x2f423e[_0x3fc0('0x28')]({'plain':!![]});var _0x1abe10=_0x3fc0('0x29');return db[_0x3fc0('0x2a')][_0x3fc0('0x27')]({'where':{'type':_0x1abe10,'resourceId':_0x35a3e2['id']}})[_0x3fc0('0x26')](function(){return _0x2f423e;});})['then'](function(){_0x46c213[_0x3fc0('0x1a')](0xcc)[_0x3fc0('0x19')]();});}};}function handleEntityNotFound(_0x1d9932,_0x35c34c){return function(_0x5a9179){if(!_0x5a9179){_0x1d9932[_0x3fc0('0x18')](0x194);}return _0x5a9179;};}function handleError(_0x197dfa,_0x126515){_0x126515=_0x126515||0x1f4;return function(_0x2645b4){logger['error'](_0x2645b4[_0x3fc0('0x2b')]);if(_0x2645b4[_0x3fc0('0x2c')]){delete _0x2645b4[_0x3fc0('0x2c')];}_0x197dfa[_0x3fc0('0x1a')](_0x126515)[_0x3fc0('0x2d')](_0x2645b4);};}exports[_0x3fc0('0x2e')]=function(_0x485f0c,_0xd9ecae){var _0x2351c8={},_0x181948={},_0x21a074={'count':0x0,'rows':[]};var _0x3f1a75=_[_0x3fc0('0x2f')](db[_0x3fc0('0x30')][_0x3fc0('0x31')],function(_0x4d6551){return{'name':_0x4d6551['fieldName'],'type':_0x4d6551[_0x3fc0('0x32')]['key']};});_0x181948[_0x3fc0('0x33')]=_[_0x3fc0('0x2f')](_0x3f1a75,_0x3fc0('0x2c'));_0x181948[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x485f0c['query']);_0x181948['filters']=_[_0x3fc0('0x36')](_0x181948[_0x3fc0('0x33')],_0x181948[_0x3fc0('0x34')]);_0x2351c8[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x181948['model'],qs[_0x3fc0('0x38')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x38')]));_0x2351c8['attributes']=_0x2351c8[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x2351c8[_0x3fc0('0x37')]:_0x181948[_0x3fc0('0x33')];if(!_0x485f0c['query'][_0x3fc0('0x3a')](_0x3fc0('0x3b'))){_0x2351c8['limit']=qs[_0x3fc0('0x1f')](_0x485f0c['query'][_0x3fc0('0x1f')]);_0x2351c8[_0x3fc0('0x1c')]=qs[_0x3fc0('0x1c')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x1c')]);}_0x2351c8[_0x3fc0('0x3c')]=qs[_0x3fc0('0x3d')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x3d')]);_0x2351c8[_0x3fc0('0x3e')]=qs[_0x3fc0('0x3f')](_['pick'](_0x485f0c[_0x3fc0('0x34')],_0x181948[_0x3fc0('0x3f')]),_0x3f1a75);if(_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x40')]){_0x2351c8[_0x3fc0('0x3e')]=_[_0x3fc0('0x41')](_0x2351c8['where'],{'$or':_['map'](_0x3f1a75,function(_0x3af7ed){if(_0x3af7ed[_0x3fc0('0x32')]!==_0x3fc0('0x42')){var _0x3e285f={};_0x3e285f[_0x3af7ed[_0x3fc0('0x2c')]]={'$like':'%'+_0x485f0c['query']['filter']+'%'};return _0x3e285f;}})});}_0x2351c8=_['merge']({},_0x2351c8,_0x485f0c[_0x3fc0('0x43')]);var _0x39d65c={'where':_0x2351c8[_0x3fc0('0x3e')]};return db['Tag']['count'](_0x39d65c)[_0x3fc0('0x26')](function(_0x239dc5){_0x21a074[_0x3fc0('0x1e')]=_0x239dc5;if(_0x485f0c[_0x3fc0('0x34')]['includeAll']){_0x2351c8['include']=[{'all':!![]}];}return db[_0x3fc0('0x30')][_0x3fc0('0x44')](_0x2351c8);})['then'](function(_0x32768f){_0x21a074['rows']=_0x32768f;return _0x21a074;})[_0x3fc0('0x26')](respondWithFilteredResult(_0xd9ecae,_0x2351c8))[_0x3fc0('0x45')](handleError(_0xd9ecae,null));};exports[_0x3fc0('0x46')]=function(_0x90120f,_0x2d01e9){var _0x38e449={'raw':!![],'where':{'id':_0x90120f[_0x3fc0('0x47')]['id']}},_0x80dfee={};_0x80dfee['model']=_[_0x3fc0('0x35')](db['Tag'][_0x3fc0('0x31')]);_0x80dfee[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x90120f[_0x3fc0('0x34')]);_0x80dfee[_0x3fc0('0x3f')]=_['intersection'](_0x80dfee[_0x3fc0('0x33')],_0x80dfee[_0x3fc0('0x34')]);_0x38e449[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x80dfee['model'],qs[_0x3fc0('0x38')](_0x90120f['query'][_0x3fc0('0x38')]));_0x38e449[_0x3fc0('0x37')]=_0x38e449[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x38e449[_0x3fc0('0x37')]:_0x80dfee['model'];if(_0x90120f[_0x3fc0('0x34')][_0x3fc0('0x48')]){_0x38e449[_0x3fc0('0x49')]=[{'all':!![]}];}_0x38e449=_['merge']({},_0x38e449,_0x90120f[_0x3fc0('0x43')]);return db[_0x3fc0('0x30')]['find'](_0x38e449)[_0x3fc0('0x26')](handleEntityNotFound(_0x2d01e9,null))[_0x3fc0('0x26')](respondWithResult(_0x2d01e9,null))[_0x3fc0('0x45')](handleError(_0x2d01e9,null));};exports['create']=function(_0x5e5c73,_0x3a35ac){return db[_0x3fc0('0x30')][_0x3fc0('0x4a')](_0x5e5c73['body'],{})[_0x3fc0('0x26')](function(_0x527569){var _0x40dbf3=_0x5e5c73['user']['get']({'plain':!![]});if(!_0x40dbf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dbf3[_0x3fc0('0x4b')]===_0x3fc0('0x4c')){var _0x141b4c=_0x527569[_0x3fc0('0x28')]({'plain':!![]});var _0x1e0c43=_0x3fc0('0x29');return db['UserProfileSection'][_0x3fc0('0x4d')]({'where':{'name':_0x1e0c43,'userProfileId':_0x40dbf3[_0x3fc0('0x4e')]},'raw':!![]})['then'](function(_0x550463){if(_0x550463&&_0x550463[_0x3fc0('0x4f')]===0x0){return db[_0x3fc0('0x2a')][_0x3fc0('0x4a')]({'name':_0x141b4c[_0x3fc0('0x2c')],'resourceId':_0x141b4c['id'],'type':_0x550463[_0x3fc0('0x2c')],'sectionId':_0x550463['id']},{})[_0x3fc0('0x26')](function(){return _0x527569;});}else{return _0x527569;}})[_0x3fc0('0x45')](function(_0x2da185){logger[_0x3fc0('0x50')](_0x3fc0('0x51'),_0x2da185);throw _0x2da185;});}return _0x527569;})[_0x3fc0('0x26')](respondWithResult(_0x3a35ac,0xc9))[_0x3fc0('0x45')](handleError(_0x3a35ac,null));};exports['update']=function(_0x24be72,_0xda5d3e){if(_0x24be72[_0x3fc0('0x52')]['id']){delete _0x24be72[_0x3fc0('0x52')]['id'];}return db[_0x3fc0('0x30')]['find']({'where':{'id':_0x24be72[_0x3fc0('0x47')]['id']}})['then'](handleEntityNotFound(_0xda5d3e,null))[_0x3fc0('0x26')](saveUpdates(_0x24be72[_0x3fc0('0x52')],null))[_0x3fc0('0x26')](respondWithResult(_0xda5d3e,null))[_0x3fc0('0x45')](handleError(_0xda5d3e,null));};exports['destroy']=function(_0x1656c7,_0xd903e3){return db[_0x3fc0('0x30')][_0x3fc0('0x4d')]({'where':{'id':_0x1656c7[_0x3fc0('0x47')]['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0xd903e3,null))['then'](removeEntity(_0xd903e3,null))[_0x3fc0('0x45')](handleError(_0xd903e3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index abd1ba0..707d030 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 _0xb2b4=['path','rimraf','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb2b4,0x1b4));var _0x4b2b=function(_0x57b3df,_0x445081){_0x57b3df=_0x57b3df-0x0;var _0x206656=_0xb2b4[_0x57b3df];return _0x206656;};'use strict';var _=require(_0x4b2b('0x0'));var util=require(_0x4b2b('0x1'));var logger=require(_0x4b2b('0x2'))(_0x4b2b('0x3'));var moment=require('moment');var BPromise=require(_0x4b2b('0x4'));var rp=require(_0x4b2b('0x5'));var fs=require('fs');var path=require(_0x4b2b('0x6'));var rimraf=require(_0x4b2b('0x7'));var config=require('../../config/environment');var attributes=require(_0x4b2b('0x8'));module[_0x4b2b('0x9')]=function(_0x348af0,_0x40f881){return _0x348af0[_0x4b2b('0xa')](_0x4b2b('0xb'),attributes,{'tableName':_0x4b2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8ea=['define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./tag.attributes'];(function(_0xfc2e0,_0x21fa15){var _0x31fc71=function(_0x3fba2a){while(--_0x3fba2a){_0xfc2e0['push'](_0xfc2e0['shift']());}};_0x31fc71(++_0x21fa15);}(_0xd8ea,0xb7));var _0xad8e=function(_0x584f0d,_0xf1893a){_0x584f0d=_0x584f0d-0x0;var _0x25ad89=_0xd8ea[_0x584f0d];return _0x25ad89;};'use strict';var _=require(_0xad8e('0x0'));var util=require(_0xad8e('0x1'));var logger=require(_0xad8e('0x2'))(_0xad8e('0x3'));var moment=require(_0xad8e('0x4'));var BPromise=require(_0xad8e('0x5'));var rp=require(_0xad8e('0x6'));var fs=require('fs');var path=require(_0xad8e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad8e('0x8'));module['exports']=function(_0x57f633,_0x4f05d1){return _0x57f633[_0xad8e('0x9')](_0xad8e('0xa'),attributes,{'tableName':_0xad8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index d8bee9e..c0cef0d 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3c0ea2,_0x1c635d){var _0x2b6aa6=function(_0x33014d){while(--_0x33014d){_0x3c0ea2['push'](_0x3c0ea2['shift']());}};_0x2b6aa6(++_0x1c635d);}(_0x4c4e,0x152));var _0xe4c4=function(_0x209923,_0x1a6d1f){_0x209923=_0x209923-0x0;var _0x36a1b2=_0x4c4e[_0x209923];return _0x36a1b2;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Tag,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Tag,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file +var _0x3561=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','Tag,\x20%s,\x20%s','message','result'];(function(_0x2cea58,_0x153c15){var _0x192933=function(_0x4f1e9b){while(--_0x4f1e9b){_0x2cea58['push'](_0x2cea58['shift']());}};_0x192933(++_0x153c15);}(_0x3561,0x94));var _0x1356=function(_0x5d908f,_0x348774){_0x5d908f=_0x5d908f-0x0;var _0x44ec0a=_0x3561[_0x5d908f];return _0x44ec0a;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var moment=require(_0x1356('0x1'));var BPromise=require(_0x1356('0x2'));var rs=require(_0x1356('0x3'));var fs=require('fs');var Redis=require(_0x1356('0x4'));var db=require(_0x1356('0x5'))['db'];var utils=require(_0x1356('0x6'));var logger=require(_0x1356('0x7'))(_0x1356('0x8'));var config=require(_0x1356('0x9'));var jayson=require(_0x1356('0xa'));var client=jayson[_0x1356('0xb')][_0x1356('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ac56,_0x4b4527,_0x105aaf){return new BPromise(function(_0x33529f,_0x1e98ae){return client['request'](_0x45ac56,_0x105aaf)['then'](function(_0x4e1adb){logger[_0x1356('0xd')]('Tag,\x20%s,\x20%s',_0x4b4527,_0x1356('0xe'));logger['debug'](_0x1356('0xf'),_0x4b4527,_0x1356('0xe'),JSON['stringify'](_0x4e1adb));if(_0x4e1adb[_0x1356('0x10')]){if(_0x4e1adb[_0x1356('0x10')]['code']===0x1f4){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x1e98ae(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x33529f(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}else{logger[_0x1356('0xd')]('Tag,\x20%s,\x20%s',_0x4b4527,'request\x20sent');_0x33529f(_0x4e1adb[_0x1356('0x13')][_0x1356('0x12')]);}})[_0x1356('0x14')](function(_0x5cecb2){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x5cecb2);_0x1e98ae(_0x5cecb2);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index e4e13df..6908693 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 558dc43..6c87d21 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x7b634,_0xf39c63){var _0x3ab248=function(_0x2e1355){while(--_0x2e1355){_0x7b634['push'](_0x7b634['shift']());}};_0x3ab248(++_0xf39c63);}(_0xb10b,0x12a));var _0xbb10=function(_0x57fa0b,_0x5df1ce){_0x57fa0b=_0x57fa0b-0x0;var _0x18669f=_0xb10b[_0x57fa0b];return _0x18669f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xb08942,_0x58ea2d){var _0x395ff7=function(_0x2ca60a){while(--_0x2ca60a){_0xb08942['push'](_0xb08942['shift']());}};_0x395ff7(++_0x58ea2d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2965ca8..aed9a30 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 _0xac4f=['findAll','rows','catch','show','params','rawAttributes','create','body','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','toLowerCase','Queue','order','capitalize','Queues','addQueues','add','ids','removeQueues','ValidationError','remove','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','sequelize','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','all','addAgents','spread','removeAgents','Fax','parse','UserVoiceQueueRt','getAgents','filter','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','Teams','end','error','stack','name','send','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','Team','includeAll','include'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4f,0x136));var _0xfac4=function(_0x5e6f73,_0x3f27d8){_0x5e6f73=_0x5e6f73-0x0;var _0x432614=_0xac4f[_0x5e6f73];return _0x432614;};'use strict';var emlformat=require(_0xfac4('0x0'));var rimraf=require(_0xfac4('0x1'));var zipdir=require(_0xfac4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfac4('0x3'));var moment=require(_0xfac4('0x4'));var BPromise=require(_0xfac4('0x5'));var Mustache=require(_0xfac4('0x6'));var util=require(_0xfac4('0x7'));var path=require(_0xfac4('0x8'));var sox=require(_0xfac4('0x9'));var csv=require(_0xfac4('0xa'));var ejs=require(_0xfac4('0xb'));var fs=require('fs');var fs_extra=require(_0xfac4('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfac4('0xd'));var jsforce=require(_0xfac4('0xe'));var deskjs=require(_0xfac4('0xf'));var toCsv=require(_0xfac4('0xa'));var querystring=require(_0xfac4('0x10'));var Papa=require(_0xfac4('0x11'));var Redis=require(_0xfac4('0x12'));var authService=require(_0xfac4('0x13'));var qs=require(_0xfac4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfac4('0x15'));var logger=require(_0xfac4('0x16'))('api');var utils=require(_0xfac4('0x17'));var config=require(_0xfac4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfac4('0x19'))['db'];config['redis']=_[_0xfac4('0x1a')](config['redis'],{'host':_0xfac4('0x1b'),'port':0x18eb});var socket=require(_0xfac4('0x1c'))(new Redis(config[_0xfac4('0x1d')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x76c553,_0x3b77cb){_0x3b77cb=_0x3b77cb||0xcc;return function(_0x1d72ae){if(_0x1d72ae){return _0x76c553[_0xfac4('0x1e')](_0x3b77cb);}return _0x76c553['status'](_0x3b77cb)['end']();};}function respondWithResult(_0x440a39,_0x3278b3){_0x3278b3=_0x3278b3||0xc8;return function(_0x3e83b6){if(_0x3e83b6){return _0x440a39[_0xfac4('0x1f')](_0x3278b3)['json'](_0x3e83b6);}};}function respondWithFilteredResult(_0x58e135,_0x34af9c){return function(_0x42bb6f){if(_0x42bb6f){var _0x536b37=typeof _0x34af9c[_0xfac4('0x20')]===_0xfac4('0x21')&&typeof _0x34af9c['limit']===_0xfac4('0x21');var _0x51a814=_0x42bb6f[_0xfac4('0x22')];var _0x576f06=_0x536b37?0x0:_0x34af9c[_0xfac4('0x20')];var _0x39acec=_0x536b37?_0x42bb6f['count']:_0x34af9c[_0xfac4('0x20')]+_0x34af9c[_0xfac4('0x23')];var _0x403fb5;if(_0x39acec>=_0x51a814){_0x39acec=_0x51a814;_0x403fb5=0xc8;}else{_0x403fb5=0xce;}_0x58e135[_0xfac4('0x1f')](_0x403fb5);return _0x58e135[_0xfac4('0x24')]('Content-Range',_0x576f06+'-'+_0x39acec+'/'+_0x51a814)['json'](_0x42bb6f);}return null;};}function patchUpdates(_0xf37b20){return function(_0x129c9c){try{jsonpatch[_0xfac4('0x25')](_0x129c9c,_0xf37b20,!![]);}catch(_0x50d3a0){return BPromise[_0xfac4('0x26')](_0x50d3a0);}return _0x129c9c[_0xfac4('0x27')]();};}function saveUpdates(_0x49de30,_0x2b8760){return function(_0x2c5906){if(_0x2c5906){return _0x2c5906[_0xfac4('0x28')](_0x49de30)[_0xfac4('0x29')](function(_0x1cdb0a){return _0x1cdb0a;});}return null;};}function removeEntity(_0xadad8,_0x5ad52e){return function(_0x273d8c){if(_0x273d8c){return _0x273d8c[_0xfac4('0x2a')]()[_0xfac4('0x29')](function(){var _0x242afb=_0x273d8c[_0xfac4('0x2b')]({'plain':!![]});var _0x5b4aa8=_0xfac4('0x2c');return db['UserProfileResource'][_0xfac4('0x2a')]({'where':{'type':_0x5b4aa8,'resourceId':_0x242afb['id']}})[_0xfac4('0x29')](function(){return _0x273d8c;});})['then'](function(){_0xadad8[_0xfac4('0x1f')](0xcc)[_0xfac4('0x2d')]();});}};}function handleEntityNotFound(_0x2d911c,_0x5596ae){return function(_0x342676){if(!_0x342676){_0x2d911c[_0xfac4('0x1e')](0x194);}return _0x342676;};}function handleError(_0x2fee7d,_0x368b4a){_0x368b4a=_0x368b4a||0x1f4;return function(_0x2f20eb){logger[_0xfac4('0x2e')](_0x2f20eb[_0xfac4('0x2f')]);if(_0x2f20eb['name']){delete _0x2f20eb[_0xfac4('0x30')];}_0x2fee7d[_0xfac4('0x1f')](_0x368b4a)[_0xfac4('0x31')](_0x2f20eb);};}exports['index']=function(_0x58996f,_0xcf34ec){var _0x296477={},_0x29dbbf={},_0x51311a={'count':0x0,'rows':[]};var _0x373bcc=_[_0xfac4('0x32')](db['Team']['rawAttributes'],function(_0x2c7577){return{'name':_0x2c7577[_0xfac4('0x33')],'type':_0x2c7577['type'][_0xfac4('0x34')]};});_0x29dbbf[_0xfac4('0x35')]=_[_0xfac4('0x32')](_0x373bcc,_0xfac4('0x30'));_0x29dbbf[_0xfac4('0x36')]=_[_0xfac4('0x37')](_0x58996f[_0xfac4('0x36')]);_0x29dbbf['filters']=_[_0xfac4('0x38')](_0x29dbbf[_0xfac4('0x35')],_0x29dbbf[_0xfac4('0x36')]);_0x296477[_0xfac4('0x39')]=_['intersection'](_0x29dbbf[_0xfac4('0x35')],qs[_0xfac4('0x3a')](_0x58996f['query'][_0xfac4('0x3a')]));_0x296477[_0xfac4('0x39')]=_0x296477['attributes'][_0xfac4('0x3b')]?_0x296477[_0xfac4('0x39')]:_0x29dbbf[_0xfac4('0x35')];if(!_0x58996f['query']['hasOwnProperty'](_0xfac4('0x3c'))){_0x296477[_0xfac4('0x23')]=qs[_0xfac4('0x23')](_0x58996f['query'][_0xfac4('0x23')]);_0x296477[_0xfac4('0x20')]=qs[_0xfac4('0x20')](_0x58996f[_0xfac4('0x36')][_0xfac4('0x20')]);}_0x296477['order']=qs[_0xfac4('0x3d')](_0x58996f['query']['sort']);_0x296477[_0xfac4('0x3e')]=qs[_0xfac4('0x3f')](_[_0xfac4('0x40')](_0x58996f['query'],_0x29dbbf[_0xfac4('0x3f')]),_0x373bcc);if(_0x58996f['query']['filter']){_0x296477['where']=_[_0xfac4('0x41')](_0x296477[_0xfac4('0x3e')],{'$or':_[_0xfac4('0x32')](_0x373bcc,function(_0x21604a){if(_0x21604a['type']!==_0xfac4('0x42')){var _0x423161={};_0x423161[_0x21604a[_0xfac4('0x30')]]={'$like':'%'+_0x58996f[_0xfac4('0x36')]['filter']+'%'};return _0x423161;}})});}_0x296477=_[_0xfac4('0x41')]({},_0x296477,_0x58996f[_0xfac4('0x43')]);var _0x4df18b={'where':_0x296477[_0xfac4('0x3e')]};return db[_0xfac4('0x44')][_0xfac4('0x22')](_0x4df18b)[_0xfac4('0x29')](function(_0x2490a3){_0x51311a[_0xfac4('0x22')]=_0x2490a3;if(_0x58996f[_0xfac4('0x36')][_0xfac4('0x45')]){_0x296477[_0xfac4('0x46')]=[{'all':!![]}];}return db[_0xfac4('0x44')][_0xfac4('0x47')](_0x296477);})[_0xfac4('0x29')](function(_0x5dd46b){_0x51311a[_0xfac4('0x48')]=_0x5dd46b;return _0x51311a;})[_0xfac4('0x29')](respondWithFilteredResult(_0xcf34ec,_0x296477))[_0xfac4('0x49')](handleError(_0xcf34ec,null));};exports[_0xfac4('0x4a')]=function(_0x74dfbc,_0x4f0674){var _0x189446={'raw':![],'where':{'id':_0x74dfbc[_0xfac4('0x4b')]['id']}},_0x2516b7={};_0x2516b7[_0xfac4('0x35')]=_[_0xfac4('0x37')](db[_0xfac4('0x44')][_0xfac4('0x4c')]);_0x2516b7[_0xfac4('0x36')]=_[_0xfac4('0x37')](_0x74dfbc[_0xfac4('0x36')]);_0x2516b7[_0xfac4('0x3f')]=_['intersection'](_0x2516b7[_0xfac4('0x35')],_0x2516b7[_0xfac4('0x36')]);_0x189446[_0xfac4('0x39')]=_[_0xfac4('0x38')](_0x2516b7[_0xfac4('0x35')],qs[_0xfac4('0x3a')](_0x74dfbc['query']['fields']));_0x189446[_0xfac4('0x39')]=_0x189446[_0xfac4('0x39')][_0xfac4('0x3b')]?_0x189446['attributes']:_0x2516b7[_0xfac4('0x35')];if(_0x74dfbc[_0xfac4('0x36')][_0xfac4('0x45')]){_0x189446['include']=[{'all':!![]}];}_0x189446=_[_0xfac4('0x41')]({},_0x189446,_0x74dfbc[_0xfac4('0x43')]);return db['Team']['find'](_0x189446)[_0xfac4('0x29')](handleEntityNotFound(_0x4f0674,null))[_0xfac4('0x29')](respondWithResult(_0x4f0674,null))[_0xfac4('0x49')](handleError(_0x4f0674,null));};exports['create']=function(_0x279ca6,_0x3b9dc5){return db[_0xfac4('0x44')][_0xfac4('0x4d')](_0x279ca6[_0xfac4('0x4e')],{})[_0xfac4('0x29')](function(_0x308f4b){var _0x1c3008=_0x279ca6[_0xfac4('0x4f')][_0xfac4('0x2b')]({'plain':!![]});if(!_0x1c3008)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c3008['role']===_0xfac4('0x4f')){var _0x1dee14=_0x308f4b[_0xfac4('0x2b')]({'plain':!![]});var _0x5de16c=_0xfac4('0x2c');return db['UserProfileSection'][_0xfac4('0x50')]({'where':{'name':_0x5de16c,'userProfileId':_0x1c3008['userProfileId']},'raw':!![]})['then'](function(_0x549016){if(_0x549016&&_0x549016[_0xfac4('0x51')]===0x0){return db['UserProfileResource'][_0xfac4('0x4d')]({'name':_0x1dee14[_0xfac4('0x30')],'resourceId':_0x1dee14['id'],'type':_0x549016['name'],'sectionId':_0x549016['id']},{})[_0xfac4('0x29')](function(){return _0x308f4b;});}else{return _0x308f4b;}})[_0xfac4('0x49')](function(_0x3c2d5a){logger[_0xfac4('0x2e')](_0xfac4('0x52'),_0x3c2d5a);throw _0x3c2d5a;});}return _0x308f4b;})[_0xfac4('0x29')](respondWithResult(_0x3b9dc5,0xc9))[_0xfac4('0x49')](handleError(_0x3b9dc5,null));};exports[_0xfac4('0x28')]=function(_0x94679a,_0x22e27c){if(_0x94679a[_0xfac4('0x4e')]['id']){delete _0x94679a[_0xfac4('0x4e')]['id'];}return db[_0xfac4('0x44')][_0xfac4('0x50')]({'where':{'id':_0x94679a[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x22e27c,null))['then'](saveUpdates(_0x94679a['body'],null))[_0xfac4('0x29')](respondWithResult(_0x22e27c,null))[_0xfac4('0x49')](handleError(_0x22e27c,null));};exports[_0xfac4('0x2a')]=function(_0x3513d9,_0x1a4293){return db[_0xfac4('0x44')][_0xfac4('0x50')]({'where':{'id':_0x3513d9[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x1a4293,null))[_0xfac4('0x29')](removeEntity(_0x1a4293,null))['catch'](handleError(_0x1a4293,null));};exports['getQueues']=function(_0x32f2da,_0x49df4b,_0x266219){return db[_0xfac4('0x44')][_0xfac4('0x53')]({'where':{'id':_0x32f2da[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x49df4b,null))[_0xfac4('0x29')](function(_0x1ce8b5){if(!_0x32f2da['query'][_0xfac4('0x54')]||!utils[_0xfac4('0x55')](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x54')])){throw new db[(_0xfac4('0x56'))]['ValidationError'](_0xfac4('0x57'));}var _0x5c477b={};var _0x3b41aa={};_0x3b41aa[_0xfac4('0x35')]=_['keys'](db[_['capitalize'](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x54')][_0xfac4('0x58')]())+_0xfac4('0x59')][_0xfac4('0x4c')]);_0x3b41aa['query']=_[_0xfac4('0x37')](_0x32f2da[_0xfac4('0x36')]);_0x3b41aa[_0xfac4('0x3f')]=_[_0xfac4('0x38')](_0x3b41aa[_0xfac4('0x35')],_0x3b41aa[_0xfac4('0x36')]);_0x5c477b['attributes']=_[_0xfac4('0x38')](_0x3b41aa[_0xfac4('0x35')],qs[_0xfac4('0x3a')](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x3a')]));_0x5c477b[_0xfac4('0x39')]=_0x5c477b[_0xfac4('0x39')][_0xfac4('0x3b')]?_0x5c477b[_0xfac4('0x39')]:_0x3b41aa[_0xfac4('0x35')];_0x5c477b[_0xfac4('0x23')]=qs[_0xfac4('0x23')](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x23')]);_0x5c477b[_0xfac4('0x20')]=qs[_0xfac4('0x20')](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x20')]);_0x5c477b[_0xfac4('0x5a')]=qs[_0xfac4('0x3d')](_0x32f2da['query'][_0xfac4('0x3d')]);_0x5c477b[_0xfac4('0x3e')]=qs[_0xfac4('0x3f')](_[_0xfac4('0x40')](_0x32f2da[_0xfac4('0x36')],_0x3b41aa[_0xfac4('0x3f')]));_0x5c477b=_[_0xfac4('0x41')]({},_0x5c477b,_0x32f2da[_0xfac4('0x43')]);return _0x1ce8b5[_0xfac4('0x2b')+_[_0xfac4('0x5b')](_0x32f2da[_0xfac4('0x36')][_0xfac4('0x54')][_0xfac4('0x58')]())+_0xfac4('0x5c')](_0x5c477b);})[_0xfac4('0x29')](respondWithResult(_0x49df4b,null))[_0xfac4('0x49')](handleError(_0x49df4b,null));};exports[_0xfac4('0x5d')]=function(_0x14d6d6,_0x2989bf,_0x5710dc){return db[_0xfac4('0x44')]['findOne']({'where':{'id':_0x14d6d6[_0xfac4('0x4b')]['id']}})['then'](function(_0x4b3ae5){if(_0x4b3ae5){if(!_0x14d6d6[_0xfac4('0x4e')][_0xfac4('0x54')]||!utils[_0xfac4('0x55')](_0x14d6d6[_0xfac4('0x4e')][_0xfac4('0x54')])){throw new db[(_0xfac4('0x56'))]['ValidationError']('Unknown\x20channel');}return _0x4b3ae5[_0xfac4('0x5e')+_[_0xfac4('0x5b')](_0x14d6d6[_0xfac4('0x4e')][_0xfac4('0x54')][_0xfac4('0x58')]())+_0xfac4('0x5c')](_0x14d6d6[_0xfac4('0x4e')][_0xfac4('0x5f')]);}return null;})[_0xfac4('0x29')](handleEntityNotFound(_0x2989bf,null))['then'](respondWithStatusCode(_0x2989bf,null))[_0xfac4('0x49')](handleError(_0x2989bf,null));};exports[_0xfac4('0x60')]=function(_0x1e21b2,_0xa5c426,_0x5a813f){return db[_0xfac4('0x44')][_0xfac4('0x53')]({'where':{'id':_0x1e21b2[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](function(_0x3ec0b4){if(_0x3ec0b4){if(!_0x1e21b2[_0xfac4('0x36')][_0xfac4('0x54')]||!utils[_0xfac4('0x55')](_0x1e21b2[_0xfac4('0x36')][_0xfac4('0x54')])){throw new db['Sequelize'][(_0xfac4('0x61'))](_0xfac4('0x57'));}return _0x3ec0b4[_0xfac4('0x62')+_[_0xfac4('0x5b')](_0x1e21b2[_0xfac4('0x36')][_0xfac4('0x54')][_0xfac4('0x58')]())+_0xfac4('0x5c')](_0x1e21b2['query'][_0xfac4('0x5f')]);}return null;})[_0xfac4('0x29')](handleEntityNotFound(_0xa5c426,null))[_0xfac4('0x29')](respondWithStatusCode(_0xa5c426,null))[_0xfac4('0x49')](handleError(_0xa5c426,null));};exports['addAgents']=function(_0xcb48e0,_0x3dad1b){return db[_0xfac4('0x44')]['find']({'where':{'id':_0xcb48e0[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x3dad1b,null))['then'](function(_0x545f64){if(_0x545f64){var _0x502fd0=[_0xfac4('0x63'),_0xfac4('0x64'),_0xfac4('0x65'),_0xfac4('0x66'),'Fax',_0xfac4('0x67'),_0xfac4('0x68')];return db[_0xfac4('0x69')][_0xfac4('0x6a')](function(_0x26c506){var _0x57a718=_[_0xfac4('0x32')](_0x502fd0,function(_0x60e469){var _0x166437={'attributes':['id',_0xfac4('0x30')]};if(_0x60e469===_0xfac4('0x63')){_0x166437[_0xfac4('0x6b')]={'attributes':['penalty']};}return _0x545f64[_0xfac4('0x2b')+_0x60e469+_0xfac4('0x5c')](_0x166437)[_0xfac4('0x29')](function(_0x243f8f){var _0x2c9cfb=_[_0xfac4('0x32')](_0x243f8f,function(_0x51bcc9){var _0x17d814=_['map'](_0xcb48e0[_0xfac4('0x4e')]['ids'],function(_0x3335f4){var _0x3fc5e7={'where':{'UserId':_0x3335f4,[_0x60e469+_0xfac4('0x6c')]:_0x51bcc9['id']},'transaction':_0x26c506};if(_0x60e469===_0xfac4('0x63')){_0x3fc5e7['defaults']={'penalty':_0x51bcc9[_0xfac4('0x6d')][_0xfac4('0x6e')]};}return db[_0xfac4('0x6f')+_0x60e469+_0xfac4('0x59')][_0xfac4('0x70')](_0x3fc5e7)[_0xfac4('0x29')](function(){socket[_0xfac4('0x71')](_0xfac4('0x4f')+_0x60e469+_0xfac4('0x72'),{'UserId':_0x3335f4,[_0x60e469+_0xfac4('0x6c')]:_0x51bcc9['id']});if(_0x60e469!==_0xfac4('0x63'))return;return db[_0xfac4('0x6f')][_0xfac4('0x47')]({'where':{'id':_0xcb48e0[_0xfac4('0x4e')][_0xfac4('0x5f')],'online':0x1},'attributes':['id','name',_0xfac4('0x73'),_0xfac4('0x74'),_0xfac4('0x75')],'raw':!![]})[_0xfac4('0x29')](function(_0x3f47d4){var _0xf4d6fe=_['map'](_0x3f47d4,function(_0x5d23ed){return db['UserVoiceQueueRt']['upsert']({'membername':_0x5d23ed[_0xfac4('0x30')],'UserId':_0x5d23ed['id'],'queue_name':_0x51bcc9[_0xfac4('0x30')],'VoiceQueueId':_0x51bcc9['id'],'interface':_['isNil'](_0x5d23ed['interface'])?util['format']('SIP/%s',_0x5d23ed[_0xfac4('0x30')]):_0x5d23ed[_0xfac4('0x75')],'paused':_0x5d23ed[_0xfac4('0x74')]||![],'penalty':_0x51bcc9[_0xfac4('0x6d')][_0xfac4('0x6e')]},{'transaction':_0x26c506});});return Promise['all'](_0xf4d6fe);});});});return Promise[_0xfac4('0x76')](_0x17d814);});return Promise[_0xfac4('0x76')](_0x2c9cfb);});});return Promise[_0xfac4('0x76')](_0x57a718)[_0xfac4('0x29')](function(){return _0x545f64[_0xfac4('0x77')](_0xcb48e0['body'][_0xfac4('0x5f')],{'transaction':_0x26c506})[_0xfac4('0x78')](function(_0x1f4e11){return _0x1f4e11;});});});}})[_0xfac4('0x29')](respondWithResult(_0x3dad1b,null))[_0xfac4('0x49')](handleError(_0x3dad1b,null));};exports[_0xfac4('0x79')]=function(_0x3dd1c0,_0x40e6b2){return db[_0xfac4('0x44')]['find']({'where':{'id':_0x3dd1c0[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x40e6b2,null))['then'](function(_0x5a18e4){if(_0x5a18e4){var _0x2877db=['Voice','Chat',_0xfac4('0x65'),_0xfac4('0x66'),_0xfac4('0x7a'),_0xfac4('0x67'),_0xfac4('0x68')];return db[_0xfac4('0x69')]['transaction'](function(_0x5a7b7c){var _0x4c516a=_[_0xfac4('0x32')](_0x2877db,function(_0x406cd5){var _0x425a72={'attributes':['id',_0xfac4('0x30')]};return _0x5a18e4[_0xfac4('0x2b')+_0x406cd5+_0xfac4('0x5c')](_0x425a72)[_0xfac4('0x29')](function(_0x170e78){var _0x5a2fe=_[_0xfac4('0x32')](_0x170e78,function(_0x1c8df7){return _0x1c8df7[_0xfac4('0x79')](_0x3dd1c0[_0xfac4('0x36')][_0xfac4('0x5f')],{'transaction':_0x5a7b7c})[_0xfac4('0x29')](function(){var _0x4c1ffa=JSON[_0xfac4('0x7b')]('['+_0x3dd1c0[_0xfac4('0x36')]['ids']+']');var _0x616419=_[_0xfac4('0x32')](_0x4c1ffa,function(_0x37a430){socket[_0xfac4('0x71')](_0xfac4('0x4f')+_0x406cd5+'Queue:remove',{'UserId':Number(_0x37a430),[_0x406cd5+_0xfac4('0x6c')]:_0x1c8df7['id']});if(_0x406cd5!==_0xfac4('0x63'))return;return db[_0xfac4('0x7c')][_0xfac4('0x2a')]({'where':{'VoiceQueueId':_0x1c8df7['id'],'UserId':_0x37a430},'transaction':_0x5a7b7c});});return Promise[_0xfac4('0x76')](_0x616419);});});return Promise[_0xfac4('0x76')](_0x5a2fe);});});return Promise[_0xfac4('0x76')](_0x4c516a)['then'](function(){return _0x5a18e4[_0xfac4('0x79')](_0x3dd1c0[_0xfac4('0x36')][_0xfac4('0x5f')],{'transaction':_0x5a7b7c});});});}})[_0xfac4('0x29')](respondWithStatusCode(_0x40e6b2,null))[_0xfac4('0x49')](handleError(_0x40e6b2,null));};exports[_0xfac4('0x7d')]=function(_0x17895e,_0x3ce2b9,_0x15cb5e){var _0x3d82e7={};var _0x5eda26={};var _0x4b26e8;var _0x4ccdce;return db['Team'][_0xfac4('0x53')]({'where':{'id':_0x17895e[_0xfac4('0x4b')]['id']}})[_0xfac4('0x29')](handleEntityNotFound(_0x3ce2b9,null))[_0xfac4('0x29')](function(_0x32c242){if(_0x32c242){_0x4b26e8=_0x32c242;_0x5eda26[_0xfac4('0x35')]=_[_0xfac4('0x37')](db['User'][_0xfac4('0x4c')]);_0x5eda26[_0xfac4('0x36')]=_[_0xfac4('0x37')](_0x17895e[_0xfac4('0x36')]);_0x5eda26[_0xfac4('0x3f')]=_['intersection'](_0x5eda26[_0xfac4('0x35')],_0x5eda26[_0xfac4('0x36')]);_0x3d82e7[_0xfac4('0x39')]=_[_0xfac4('0x38')](_0x5eda26[_0xfac4('0x35')],qs[_0xfac4('0x3a')](_0x17895e[_0xfac4('0x36')][_0xfac4('0x3a')]));_0x3d82e7[_0xfac4('0x39')]=_0x3d82e7[_0xfac4('0x39')][_0xfac4('0x3b')]?_0x3d82e7['attributes']:_0x5eda26[_0xfac4('0x35')];_0x3d82e7[_0xfac4('0x5a')]=qs[_0xfac4('0x3d')](_0x17895e[_0xfac4('0x36')][_0xfac4('0x3d')]);_0x3d82e7[_0xfac4('0x3e')]=qs[_0xfac4('0x3f')](_[_0xfac4('0x40')](_0x17895e[_0xfac4('0x36')],_0x5eda26[_0xfac4('0x3f')]));if(_0x17895e['query']['filter']){_0x3d82e7[_0xfac4('0x3e')]=_[_0xfac4('0x41')](_0x3d82e7[_0xfac4('0x3e')],{'$or':_[_0xfac4('0x32')](_0x3d82e7['attributes'],function(_0x3ea2c9){var _0x25321e={};_0x25321e[_0x3ea2c9]={'$like':'%'+_0x17895e[_0xfac4('0x36')][_0xfac4('0x7e')]+'%'};return _0x25321e;})});}_0x3d82e7=_[_0xfac4('0x41')]({},_0x3d82e7,_0x17895e[_0xfac4('0x43')]);return _0x4b26e8[_0xfac4('0x7d')](_0x3d82e7);}})['then'](function(_0x581b53){if(_0x581b53){_0x4ccdce=_0x581b53[_0xfac4('0x3b')];if(!_0x17895e[_0xfac4('0x36')]['hasOwnProperty'](_0xfac4('0x3c'))){_0x3d82e7['limit']=qs[_0xfac4('0x23')](_0x17895e[_0xfac4('0x36')][_0xfac4('0x23')]);_0x3d82e7['offset']=qs[_0xfac4('0x20')](_0x17895e[_0xfac4('0x36')][_0xfac4('0x20')]);}return _0x4b26e8[_0xfac4('0x7d')](_0x3d82e7);}})[_0xfac4('0x29')](function(_0x3c5805){if(_0x3c5805){return _0x3c5805?{'count':_0x4ccdce,'rows':_0x3c5805}:null;}})[_0xfac4('0x29')](respondWithResult(_0x3ce2b9,null))[_0xfac4('0x49')](handleError(_0x3ce2b9,null));}; \ No newline at end of file +var _0xd0cd=['sendStatus','status','end','json','offset','undefined','limit','count','apply','update','then','destroy','get','Teams','UserProfileResource','stack','name','send','index','map','Team','rawAttributes','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','fields','channel','Queues','addQueues','add','ids','removeQueues','isValidChannel','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','online','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','removeAgents','parse','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x452450,_0x40b419){_0x452450=_0x452450-0x0;var _0x448b19=_0xd0cd[_0x452450];return _0x448b19;};'use strict';var emlformat=require(_0xdd0c('0x0'));var rimraf=require(_0xdd0c('0x1'));var zipdir=require(_0xdd0c('0x2'));var jsonpatch=require(_0xdd0c('0x3'));var rp=require('request-promise');var moment=require(_0xdd0c('0x4'));var BPromise=require(_0xdd0c('0x5'));var Mustache=require(_0xdd0c('0x6'));var util=require(_0xdd0c('0x7'));var path=require(_0xdd0c('0x8'));var sox=require(_0xdd0c('0x9'));var csv=require(_0xdd0c('0xa'));var ejs=require(_0xdd0c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdd0c('0xc'));var crypto=require(_0xdd0c('0xd'));var jsforce=require(_0xdd0c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd0c('0xf'));var Papa=require(_0xdd0c('0x10'));var Redis=require(_0xdd0c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd0c('0x12'));var as=require(_0xdd0c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd0c('0x14'))(_0xdd0c('0x15'));var utils=require(_0xdd0c('0x16'));var config=require(_0xdd0c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd0c('0x18'))['db'];config[_0xdd0c('0x19')]=_[_0xdd0c('0x1a')](config[_0xdd0c('0x19')],{'host':_0xdd0c('0x1b'),'port':0x18eb});var socket=require(_0xdd0c('0x1c'))(new Redis(config[_0xdd0c('0x19')]));require(_0xdd0c('0x1d'))[_0xdd0c('0x1e')](socket);function respondWithStatusCode(_0x4da50c,_0x390edf){_0x390edf=_0x390edf||0xcc;return function(_0x5b3ae6){if(_0x5b3ae6){return _0x4da50c[_0xdd0c('0x1f')](_0x390edf);}return _0x4da50c[_0xdd0c('0x20')](_0x390edf)[_0xdd0c('0x21')]();};}function respondWithResult(_0x5c05e1,_0x55855a){_0x55855a=_0x55855a||0xc8;return function(_0x5785ce){if(_0x5785ce){return _0x5c05e1[_0xdd0c('0x20')](_0x55855a)[_0xdd0c('0x22')](_0x5785ce);}};}function respondWithFilteredResult(_0x331b92,_0x551dc2){return function(_0x233360){if(_0x233360){var _0x156479=typeof _0x551dc2[_0xdd0c('0x23')]===_0xdd0c('0x24')&&typeof _0x551dc2[_0xdd0c('0x25')]===_0xdd0c('0x24');var _0x1362a0=_0x233360[_0xdd0c('0x26')];var _0x3a9997=_0x156479?0x0:_0x551dc2[_0xdd0c('0x23')];var _0x6171e4=_0x156479?_0x233360[_0xdd0c('0x26')]:_0x551dc2[_0xdd0c('0x23')]+_0x551dc2['limit'];var _0x3b5de9;if(_0x6171e4>=_0x1362a0){_0x6171e4=_0x1362a0;_0x3b5de9=0xc8;}else{_0x3b5de9=0xce;}_0x331b92[_0xdd0c('0x20')](_0x3b5de9);return _0x331b92['set']('Content-Range',_0x3a9997+'-'+_0x6171e4+'/'+_0x1362a0)[_0xdd0c('0x22')](_0x233360);}return null;};}function patchUpdates(_0x5a5471){return function(_0x2dcc11){try{jsonpatch[_0xdd0c('0x27')](_0x2dcc11,_0x5a5471,!![]);}catch(_0x3c1194){return BPromise['reject'](_0x3c1194);}return _0x2dcc11['save']();};}function saveUpdates(_0x14ef79,_0x3eff30){return function(_0x568b0f){if(_0x568b0f){return _0x568b0f[_0xdd0c('0x28')](_0x14ef79)[_0xdd0c('0x29')](function(_0x551745){return _0x551745;});}return null;};}function removeEntity(_0x18a6c8,_0x38a5c9){return function(_0x4bf380){if(_0x4bf380){return _0x4bf380[_0xdd0c('0x2a')]()[_0xdd0c('0x29')](function(){var _0x2d4084=_0x4bf380[_0xdd0c('0x2b')]({'plain':!![]});var _0x1ad3da=_0xdd0c('0x2c');return db[_0xdd0c('0x2d')][_0xdd0c('0x2a')]({'where':{'type':_0x1ad3da,'resourceId':_0x2d4084['id']}})[_0xdd0c('0x29')](function(){return _0x4bf380;});})['then'](function(){_0x18a6c8['status'](0xcc)[_0xdd0c('0x21')]();});}};}function handleEntityNotFound(_0x49e480,_0x13b18f){return function(_0x13d80e){if(!_0x13d80e){_0x49e480['sendStatus'](0x194);}return _0x13d80e;};}function handleError(_0x1c935c,_0x492a76){_0x492a76=_0x492a76||0x1f4;return function(_0x4cd420){logger['error'](_0x4cd420[_0xdd0c('0x2e')]);if(_0x4cd420[_0xdd0c('0x2f')]){delete _0x4cd420[_0xdd0c('0x2f')];}_0x1c935c[_0xdd0c('0x20')](_0x492a76)[_0xdd0c('0x30')](_0x4cd420);};}exports[_0xdd0c('0x31')]=function(_0xff70bc,_0xac331){var _0x1973ef={},_0x41bbc8={},_0x25cac1={'count':0x0,'rows':[]};var _0x43c03d=_[_0xdd0c('0x32')](db[_0xdd0c('0x33')][_0xdd0c('0x34')],function(_0x2bf3b4){return{'name':_0x2bf3b4['fieldName'],'type':_0x2bf3b4['type'][_0xdd0c('0x35')]};});_0x41bbc8[_0xdd0c('0x36')]=_[_0xdd0c('0x32')](_0x43c03d,_0xdd0c('0x2f'));_0x41bbc8[_0xdd0c('0x37')]=_['keys'](_0xff70bc[_0xdd0c('0x37')]);_0x41bbc8[_0xdd0c('0x38')]=_[_0xdd0c('0x39')](_0x41bbc8['model'],_0x41bbc8[_0xdd0c('0x37')]);_0x1973ef[_0xdd0c('0x3a')]=_[_0xdd0c('0x39')](_0x41bbc8['model'],qs['fields'](_0xff70bc[_0xdd0c('0x37')]['fields']));_0x1973ef[_0xdd0c('0x3a')]=_0x1973ef[_0xdd0c('0x3a')]['length']?_0x1973ef[_0xdd0c('0x3a')]:_0x41bbc8[_0xdd0c('0x36')];if(!_0xff70bc['query'][_0xdd0c('0x3b')](_0xdd0c('0x3c'))){_0x1973ef['limit']=qs[_0xdd0c('0x25')](_0xff70bc[_0xdd0c('0x37')]['limit']);_0x1973ef[_0xdd0c('0x23')]=qs[_0xdd0c('0x23')](_0xff70bc[_0xdd0c('0x37')][_0xdd0c('0x23')]);}_0x1973ef[_0xdd0c('0x3d')]=qs[_0xdd0c('0x3e')](_0xff70bc[_0xdd0c('0x37')]['sort']);_0x1973ef[_0xdd0c('0x3f')]=qs['filters'](_[_0xdd0c('0x40')](_0xff70bc[_0xdd0c('0x37')],_0x41bbc8[_0xdd0c('0x38')]),_0x43c03d);if(_0xff70bc[_0xdd0c('0x37')][_0xdd0c('0x41')]){_0x1973ef[_0xdd0c('0x3f')]=_[_0xdd0c('0x42')](_0x1973ef[_0xdd0c('0x3f')],{'$or':_[_0xdd0c('0x32')](_0x43c03d,function(_0x3d806e){if(_0x3d806e[_0xdd0c('0x43')]!==_0xdd0c('0x44')){var _0x57b89a={};_0x57b89a[_0x3d806e[_0xdd0c('0x2f')]]={'$like':'%'+_0xff70bc[_0xdd0c('0x37')]['filter']+'%'};return _0x57b89a;}})});}_0x1973ef=_['merge']({},_0x1973ef,_0xff70bc[_0xdd0c('0x45')]);var _0x329c61={'where':_0x1973ef[_0xdd0c('0x3f')]};return db[_0xdd0c('0x33')][_0xdd0c('0x26')](_0x329c61)[_0xdd0c('0x29')](function(_0x11d05e){_0x25cac1[_0xdd0c('0x26')]=_0x11d05e;if(_0xff70bc['query'][_0xdd0c('0x46')]){_0x1973ef[_0xdd0c('0x47')]=[{'all':!![]}];}return db[_0xdd0c('0x33')][_0xdd0c('0x48')](_0x1973ef);})[_0xdd0c('0x29')](function(_0x3b377f){_0x25cac1['rows']=_0x3b377f;return _0x25cac1;})[_0xdd0c('0x29')](respondWithFilteredResult(_0xac331,_0x1973ef))[_0xdd0c('0x49')](handleError(_0xac331,null));};exports[_0xdd0c('0x4a')]=function(_0x5e84d2,_0x33bcd4){var _0x318da8={'raw':![],'where':{'id':_0x5e84d2[_0xdd0c('0x4b')]['id']}},_0x1790ee={};_0x1790ee[_0xdd0c('0x36')]=_[_0xdd0c('0x4c')](db['Team'][_0xdd0c('0x34')]);_0x1790ee['query']=_[_0xdd0c('0x4c')](_0x5e84d2['query']);_0x1790ee[_0xdd0c('0x38')]=_[_0xdd0c('0x39')](_0x1790ee[_0xdd0c('0x36')],_0x1790ee[_0xdd0c('0x37')]);_0x318da8[_0xdd0c('0x3a')]=_['intersection'](_0x1790ee[_0xdd0c('0x36')],qs['fields'](_0x5e84d2[_0xdd0c('0x37')]['fields']));_0x318da8[_0xdd0c('0x3a')]=_0x318da8[_0xdd0c('0x3a')][_0xdd0c('0x4d')]?_0x318da8[_0xdd0c('0x3a')]:_0x1790ee['model'];if(_0x5e84d2['query'][_0xdd0c('0x46')]){_0x318da8[_0xdd0c('0x47')]=[{'all':!![]}];}_0x318da8=_[_0xdd0c('0x42')]({},_0x318da8,_0x5e84d2[_0xdd0c('0x45')]);return db['Team'][_0xdd0c('0x4e')](_0x318da8)[_0xdd0c('0x29')](handleEntityNotFound(_0x33bcd4,null))['then'](respondWithResult(_0x33bcd4,null))['catch'](handleError(_0x33bcd4,null));};exports[_0xdd0c('0x4f')]=function(_0x2bdec3,_0x386b97){return db['Team'][_0xdd0c('0x4f')](_0x2bdec3[_0xdd0c('0x50')],{})['then'](function(_0x195132){var _0x1eeb45=_0x2bdec3[_0xdd0c('0x51')][_0xdd0c('0x2b')]({'plain':!![]});if(!_0x1eeb45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1eeb45[_0xdd0c('0x52')]==='user'){var _0x44b595=_0x195132[_0xdd0c('0x2b')]({'plain':!![]});var _0x1a01f7='Teams';return db[_0xdd0c('0x53')]['find']({'where':{'name':_0x1a01f7,'userProfileId':_0x1eeb45[_0xdd0c('0x54')]},'raw':!![]})[_0xdd0c('0x29')](function(_0x28fa03){if(_0x28fa03&&_0x28fa03[_0xdd0c('0x55')]===0x0){return db[_0xdd0c('0x2d')][_0xdd0c('0x4f')]({'name':_0x44b595['name'],'resourceId':_0x44b595['id'],'type':_0x28fa03['name'],'sectionId':_0x28fa03['id']},{})['then'](function(){return _0x195132;});}else{return _0x195132;}})[_0xdd0c('0x49')](function(_0x3727fa){logger['error'](_0xdd0c('0x56'),_0x3727fa);throw _0x3727fa;});}return _0x195132;})['then'](respondWithResult(_0x386b97,0xc9))[_0xdd0c('0x49')](handleError(_0x386b97,null));};exports[_0xdd0c('0x28')]=function(_0x449f69,_0x3e8a10){if(_0x449f69[_0xdd0c('0x50')]['id']){delete _0x449f69[_0xdd0c('0x50')]['id'];}return db[_0xdd0c('0x33')]['find']({'where':{'id':_0x449f69[_0xdd0c('0x4b')]['id']}})[_0xdd0c('0x29')](handleEntityNotFound(_0x3e8a10,null))['then'](saveUpdates(_0x449f69[_0xdd0c('0x50')],null))[_0xdd0c('0x29')](respondWithResult(_0x3e8a10,null))[_0xdd0c('0x49')](handleError(_0x3e8a10,null));};exports[_0xdd0c('0x2a')]=function(_0x3b4811,_0x4c3423){return db[_0xdd0c('0x33')][_0xdd0c('0x4e')]({'where':{'id':_0x3b4811[_0xdd0c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c3423,null))[_0xdd0c('0x29')](removeEntity(_0x4c3423,null))['catch'](handleError(_0x4c3423,null));};exports[_0xdd0c('0x57')]=function(_0x46d38f,_0x3b723d,_0x3f9338){return db[_0xdd0c('0x33')][_0xdd0c('0x58')]({'where':{'id':_0x46d38f[_0xdd0c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b723d,null))[_0xdd0c('0x29')](function(_0x33f68e){if(!_0x46d38f['query']['channel']||!utils['isValidChannel'](_0x46d38f['query']['channel'])){throw new db[(_0xdd0c('0x59'))][(_0xdd0c('0x5a'))](_0xdd0c('0x5b'));}var _0x53fd5f={};var _0x41d1e4={};_0x41d1e4[_0xdd0c('0x36')]=_[_0xdd0c('0x4c')](db[_[_0xdd0c('0x5c')](_0x46d38f[_0xdd0c('0x37')]['channel'][_0xdd0c('0x5d')]())+_0xdd0c('0x5e')][_0xdd0c('0x34')]);_0x41d1e4[_0xdd0c('0x37')]=_[_0xdd0c('0x4c')](_0x46d38f['query']);_0x41d1e4[_0xdd0c('0x38')]=_[_0xdd0c('0x39')](_0x41d1e4[_0xdd0c('0x36')],_0x41d1e4[_0xdd0c('0x37')]);_0x53fd5f[_0xdd0c('0x3a')]=_['intersection'](_0x41d1e4['model'],qs[_0xdd0c('0x5f')](_0x46d38f[_0xdd0c('0x37')][_0xdd0c('0x5f')]));_0x53fd5f['attributes']=_0x53fd5f[_0xdd0c('0x3a')][_0xdd0c('0x4d')]?_0x53fd5f[_0xdd0c('0x3a')]:_0x41d1e4[_0xdd0c('0x36')];_0x53fd5f['limit']=qs[_0xdd0c('0x25')](_0x46d38f[_0xdd0c('0x37')][_0xdd0c('0x25')]);_0x53fd5f['offset']=qs[_0xdd0c('0x23')](_0x46d38f[_0xdd0c('0x37')][_0xdd0c('0x23')]);_0x53fd5f['order']=qs[_0xdd0c('0x3e')](_0x46d38f[_0xdd0c('0x37')][_0xdd0c('0x3e')]);_0x53fd5f['where']=qs[_0xdd0c('0x38')](_[_0xdd0c('0x40')](_0x46d38f[_0xdd0c('0x37')],_0x41d1e4['filters']));_0x53fd5f=_[_0xdd0c('0x42')]({},_0x53fd5f,_0x46d38f[_0xdd0c('0x45')]);return _0x33f68e[_0xdd0c('0x2b')+_[_0xdd0c('0x5c')](_0x46d38f['query'][_0xdd0c('0x60')][_0xdd0c('0x5d')]())+_0xdd0c('0x61')](_0x53fd5f);})[_0xdd0c('0x29')](respondWithResult(_0x3b723d,null))[_0xdd0c('0x49')](handleError(_0x3b723d,null));};exports[_0xdd0c('0x62')]=function(_0x38d62b,_0x1dcfcf,_0x152678){return db[_0xdd0c('0x33')][_0xdd0c('0x58')]({'where':{'id':_0x38d62b[_0xdd0c('0x4b')]['id']}})[_0xdd0c('0x29')](function(_0x49cfa9){if(_0x49cfa9){if(!_0x38d62b['body'][_0xdd0c('0x60')]||!utils['isValidChannel'](_0x38d62b[_0xdd0c('0x50')]['channel'])){throw new db['Sequelize'][(_0xdd0c('0x5a'))](_0xdd0c('0x5b'));}return _0x49cfa9[_0xdd0c('0x63')+_[_0xdd0c('0x5c')](_0x38d62b[_0xdd0c('0x50')][_0xdd0c('0x60')][_0xdd0c('0x5d')]())+_0xdd0c('0x61')](_0x38d62b['body'][_0xdd0c('0x64')]);}return null;})[_0xdd0c('0x29')](handleEntityNotFound(_0x1dcfcf,null))['then'](respondWithStatusCode(_0x1dcfcf,null))[_0xdd0c('0x49')](handleError(_0x1dcfcf,null));};exports[_0xdd0c('0x65')]=function(_0x21131a,_0x15617c,_0x31c485){return db[_0xdd0c('0x33')]['findOne']({'where':{'id':_0x21131a[_0xdd0c('0x4b')]['id']}})['then'](function(_0x2937d6){if(_0x2937d6){if(!_0x21131a[_0xdd0c('0x37')]['channel']||!utils[_0xdd0c('0x66')](_0x21131a['query']['channel'])){throw new db[(_0xdd0c('0x59'))][(_0xdd0c('0x5a'))]('Unknown\x20channel');}return _0x2937d6[_0xdd0c('0x67')+_[_0xdd0c('0x5c')](_0x21131a[_0xdd0c('0x37')][_0xdd0c('0x60')]['toLowerCase']())+'Queues'](_0x21131a[_0xdd0c('0x37')]['ids']);}return null;})[_0xdd0c('0x29')](handleEntityNotFound(_0x15617c,null))[_0xdd0c('0x29')](respondWithStatusCode(_0x15617c,null))['catch'](handleError(_0x15617c,null));};exports[_0xdd0c('0x68')]=function(_0x2ee5f5,_0x520acf){return db[_0xdd0c('0x33')][_0xdd0c('0x4e')]({'where':{'id':_0x2ee5f5[_0xdd0c('0x4b')]['id']}})[_0xdd0c('0x29')](handleEntityNotFound(_0x520acf,null))['then'](function(_0xe8f415){if(_0xe8f415){var _0x4158a8=[_0xdd0c('0x69'),_0xdd0c('0x6a'),_0xdd0c('0x6b'),_0xdd0c('0x6c'),_0xdd0c('0x6d'),_0xdd0c('0x6e'),_0xdd0c('0x6f')];return db[_0xdd0c('0x70')][_0xdd0c('0x71')](function(_0x143c1e){var _0xf9fe56=_[_0xdd0c('0x32')](_0x4158a8,function(_0x288176){var _0x533397={'attributes':['id',_0xdd0c('0x2f')]};if(_0x288176===_0xdd0c('0x69')){_0x533397['through']={'attributes':['penalty']};}return _0xe8f415[_0xdd0c('0x2b')+_0x288176+'Queues'](_0x533397)[_0xdd0c('0x29')](function(_0x4c3a3b){var _0x1eb7b8=_['map'](_0x4c3a3b,function(_0xf75b50){var _0x3f3875=_[_0xdd0c('0x32')](_0x2ee5f5[_0xdd0c('0x50')]['ids'],function(_0x488e5a){var _0xbe0809={'where':{'UserId':_0x488e5a,[_0x288176+_0xdd0c('0x72')]:_0xf75b50['id']},'transaction':_0x143c1e};if(_0x288176===_0xdd0c('0x69')){_0xbe0809[_0xdd0c('0x1a')]={'penalty':_0xf75b50[_0xdd0c('0x73')][_0xdd0c('0x74')]};}return db[_0xdd0c('0x75')+_0x288176+_0xdd0c('0x5e')][_0xdd0c('0x76')](_0xbe0809)[_0xdd0c('0x29')](function(){socket['emit'](_0xdd0c('0x51')+_0x288176+'Queue:save',{'UserId':_0x488e5a,[_0x288176+_0xdd0c('0x72')]:_0xf75b50['id']});if(_0x288176!==_0xdd0c('0x69'))return;return db[_0xdd0c('0x75')]['findAll']({'where':{'id':_0x2ee5f5['body'][_0xdd0c('0x64')],'online':0x1},'attributes':['id',_0xdd0c('0x2f'),_0xdd0c('0x77'),_0xdd0c('0x78'),_0xdd0c('0x79')],'raw':!![]})[_0xdd0c('0x29')](function(_0x5c7d31){var _0x197b0d=_[_0xdd0c('0x32')](_0x5c7d31,function(_0xce7d7b){return db[_0xdd0c('0x7a')][_0xdd0c('0x7b')]({'membername':_0xce7d7b[_0xdd0c('0x2f')],'UserId':_0xce7d7b['id'],'queue_name':_0xf75b50[_0xdd0c('0x2f')],'VoiceQueueId':_0xf75b50['id'],'interface':_['isNil'](_0xce7d7b['interface'])?util[_0xdd0c('0x7c')](_0xdd0c('0x7d'),_0xce7d7b['name']):_0xce7d7b['interface'],'paused':_0xce7d7b[_0xdd0c('0x78')]||![],'penalty':_0xf75b50[_0xdd0c('0x73')][_0xdd0c('0x74')]},{'transaction':_0x143c1e});});return Promise[_0xdd0c('0x7e')](_0x197b0d);});});});return Promise[_0xdd0c('0x7e')](_0x3f3875);});return Promise['all'](_0x1eb7b8);});});return Promise[_0xdd0c('0x7e')](_0xf9fe56)[_0xdd0c('0x29')](function(){return _0xe8f415[_0xdd0c('0x68')](_0x2ee5f5['body'][_0xdd0c('0x64')],{'transaction':_0x143c1e})['spread'](function(_0x13a3bc){return _0x13a3bc;});});});}})[_0xdd0c('0x29')](respondWithResult(_0x520acf,null))[_0xdd0c('0x49')](handleError(_0x520acf,null));};exports[_0xdd0c('0x7f')]=function(_0x3abcdb,_0x3dd868){return db[_0xdd0c('0x33')]['find']({'where':{'id':_0x3abcdb[_0xdd0c('0x4b')]['id']}})[_0xdd0c('0x29')](handleEntityNotFound(_0x3dd868,null))[_0xdd0c('0x29')](function(_0x4fe3eb){if(_0x4fe3eb){var _0xc4e601=[_0xdd0c('0x69'),_0xdd0c('0x6a'),_0xdd0c('0x6b'),_0xdd0c('0x6c'),_0xdd0c('0x6d'),_0xdd0c('0x6e'),_0xdd0c('0x6f')];return db[_0xdd0c('0x70')][_0xdd0c('0x71')](function(_0x45a3d8){var _0x10ffe0=_[_0xdd0c('0x32')](_0xc4e601,function(_0x541f22){var _0x2914c0={'attributes':['id',_0xdd0c('0x2f')]};return _0x4fe3eb[_0xdd0c('0x2b')+_0x541f22+'Queues'](_0x2914c0)[_0xdd0c('0x29')](function(_0xba72ba){var _0x27f8a3=_[_0xdd0c('0x32')](_0xba72ba,function(_0x4254e3){return _0x4254e3[_0xdd0c('0x7f')](_0x3abcdb[_0xdd0c('0x37')][_0xdd0c('0x64')],{'transaction':_0x45a3d8})[_0xdd0c('0x29')](function(){var _0x3e097c=JSON[_0xdd0c('0x80')]('['+_0x3abcdb['query']['ids']+']');var _0x1f2fb2=_[_0xdd0c('0x32')](_0x3e097c,function(_0x444c93){socket[_0xdd0c('0x81')](_0xdd0c('0x51')+_0x541f22+'Queue:remove',{'UserId':Number(_0x444c93),[_0x541f22+_0xdd0c('0x72')]:_0x4254e3['id']});if(_0x541f22!==_0xdd0c('0x69'))return;return db[_0xdd0c('0x7a')][_0xdd0c('0x2a')]({'where':{'VoiceQueueId':_0x4254e3['id'],'UserId':_0x444c93},'transaction':_0x45a3d8});});return Promise[_0xdd0c('0x7e')](_0x1f2fb2);});});return Promise['all'](_0x27f8a3);});});return Promise[_0xdd0c('0x7e')](_0x10ffe0)[_0xdd0c('0x29')](function(){return _0x4fe3eb[_0xdd0c('0x7f')](_0x3abcdb['query']['ids'],{'transaction':_0x45a3d8});});});}})[_0xdd0c('0x29')](respondWithStatusCode(_0x3dd868,null))['catch'](handleError(_0x3dd868,null));};exports[_0xdd0c('0x82')]=function(_0x12180a,_0x5e9e71,_0x182765){var _0x468145={};var _0x696304={};var _0x1a98b3;var _0x2e9fe3;return db[_0xdd0c('0x33')][_0xdd0c('0x58')]({'where':{'id':_0x12180a[_0xdd0c('0x4b')]['id']}})[_0xdd0c('0x29')](handleEntityNotFound(_0x5e9e71,null))[_0xdd0c('0x29')](function(_0x491474){if(_0x491474){_0x1a98b3=_0x491474;_0x696304[_0xdd0c('0x36')]=_['keys'](db['User'][_0xdd0c('0x34')]);_0x696304['query']=_[_0xdd0c('0x4c')](_0x12180a['query']);_0x696304[_0xdd0c('0x38')]=_[_0xdd0c('0x39')](_0x696304[_0xdd0c('0x36')],_0x696304[_0xdd0c('0x37')]);_0x468145[_0xdd0c('0x3a')]=_[_0xdd0c('0x39')](_0x696304[_0xdd0c('0x36')],qs[_0xdd0c('0x5f')](_0x12180a['query'][_0xdd0c('0x5f')]));_0x468145['attributes']=_0x468145[_0xdd0c('0x3a')][_0xdd0c('0x4d')]?_0x468145['attributes']:_0x696304[_0xdd0c('0x36')];_0x468145[_0xdd0c('0x3d')]=qs[_0xdd0c('0x3e')](_0x12180a['query']['sort']);_0x468145[_0xdd0c('0x3f')]=qs['filters'](_['pick'](_0x12180a[_0xdd0c('0x37')],_0x696304['filters']));if(_0x12180a[_0xdd0c('0x37')][_0xdd0c('0x41')]){_0x468145[_0xdd0c('0x3f')]=_[_0xdd0c('0x42')](_0x468145['where'],{'$or':_[_0xdd0c('0x32')](_0x468145[_0xdd0c('0x3a')],function(_0x196470){var _0xfca0d7={};_0xfca0d7[_0x196470]={'$like':'%'+_0x12180a[_0xdd0c('0x37')][_0xdd0c('0x41')]+'%'};return _0xfca0d7;})});}_0x468145=_[_0xdd0c('0x42')]({},_0x468145,_0x12180a['options']);return _0x1a98b3[_0xdd0c('0x82')](_0x468145);}})[_0xdd0c('0x29')](function(_0x124865){if(_0x124865){_0x2e9fe3=_0x124865[_0xdd0c('0x4d')];if(!_0x12180a['query'][_0xdd0c('0x3b')](_0xdd0c('0x3c'))){_0x468145[_0xdd0c('0x25')]=qs[_0xdd0c('0x25')](_0x12180a[_0xdd0c('0x37')]['limit']);_0x468145['offset']=qs[_0xdd0c('0x23')](_0x12180a['query']['offset']);}return _0x1a98b3[_0xdd0c('0x82')](_0x468145);}})['then'](function(_0x471e7f){if(_0x471e7f){return _0x471e7f?{'count':_0x2e9fe3,'rows':_0x471e7f}:null;}})[_0xdd0c('0x29')](respondWithResult(_0x5e9e71,null))[_0xdd0c('0x49')](handleError(_0x5e9e71,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a7a99d9..11efae8 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 _0xeb35=['Team','update','remove','emit','exports','events','../../mysqldb'];(function(_0x597598,_0x598284){var _0x52b2a2=function(_0x3d8b3c){while(--_0x3d8b3c){_0x597598['push'](_0x597598['shift']());}};_0x52b2a2(++_0x598284);}(_0xeb35,0x16a));var _0x5eb3=function(_0x33c4b4,_0xa5b55b){_0x33c4b4=_0x33c4b4-0x0;var _0xd09d29=_0xeb35[_0x33c4b4];return _0xd09d29;};'use strict';var EventEmitter=require(_0x5eb3('0x0'));var Team=require(_0x5eb3('0x1'))['db'][_0x5eb3('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5eb3('0x3'),'afterDestroy':_0x5eb3('0x4')};function emitEvent(_0x194cf5){return function(_0x4a5b3f,_0x93301a,_0x16e546){TeamEvents[_0x5eb3('0x5')](_0x194cf5+':'+_0x4a5b3f['id'],_0x4a5b3f);TeamEvents[_0x5eb3('0x5')](_0x194cf5,_0x4a5b3f);_0x16e546(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x5eb3('0x6')]=TeamEvents; \ No newline at end of file +var _0x2432=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Team'];(function(_0x1b9b74,_0xd2ba13){var _0x33a515=function(_0x1b4d6b){while(--_0x1b4d6b){_0x1b9b74['push'](_0x1b9b74['shift']());}};_0x33a515(++_0xd2ba13);}(_0x2432,0x98));var _0x2243=function(_0x3e424c,_0x49df09){_0x3e424c=_0x3e424c-0x0;var _0x152154=_0x2432[_0x3e424c];return _0x152154;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0x2243('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0x2243('0x1')](0x0);var events={'afterCreate':_0x2243('0x2'),'afterUpdate':_0x2243('0x3'),'afterDestroy':_0x2243('0x4')};function emitEvent(_0x31b6d0){return function(_0x22b4b6,_0x543d5d,_0x1317ec){TeamEvents[_0x2243('0x5')](_0x31b6d0+':'+_0x22b4b6['id'],_0x22b4b6);TeamEvents[_0x2243('0x5')](_0x31b6d0,_0x22b4b6);_0x1317ec(null);};}for(var e in events){if(events[_0x2243('0x6')](e)){var event=events[e];Team[_0x2243('0x7')](e,emitEvent(event));}}module[_0x2243('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6afd201..92a9a89 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 _0x7e46=['./team.attributes','teams','api','moment','bluebird','request-promise','path'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7e46,0x1e5));var _0x67e4=function(_0x1a7db2,_0x5eb030){_0x1a7db2=_0x1a7db2-0x0;var _0x34d597=_0x7e46[_0x1a7db2];return _0x34d597;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x67e4('0x0'));var moment=require(_0x67e4('0x1'));var BPromise=require(_0x67e4('0x2'));var rp=require(_0x67e4('0x3'));var fs=require('fs');var path=require(_0x67e4('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x67e4('0x5'));module['exports']=function(_0xe13121,_0x5a8bbb){return _0xe13121['define']('Team',attributes,{'tableName':_0x67e4('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0bb=['define','Team','teams','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports'];(function(_0x239394,_0x55e733){var _0x596491=function(_0x6aaa17){while(--_0x6aaa17){_0x239394['push'](_0x239394['shift']());}};_0x596491(++_0x55e733);}(_0xb0bb,0x11b));var _0xbb0b=function(_0x19ec3c,_0x56ac02){_0x19ec3c=_0x19ec3c-0x0;var _0x52d6fe=_0xb0bb[_0x19ec3c];return _0x52d6fe;};'use strict';var _=require(_0xbb0b('0x0'));var util=require(_0xbb0b('0x1'));var logger=require(_0xbb0b('0x2'))(_0xbb0b('0x3'));var moment=require('moment');var BPromise=require(_0xbb0b('0x4'));var rp=require(_0xbb0b('0x5'));var fs=require('fs');var path=require(_0xbb0b('0x6'));var rimraf=require(_0xbb0b('0x7'));var config=require(_0xbb0b('0x8'));var attributes=require(_0xbb0b('0x9'));module[_0xbb0b('0xa')]=function(_0x5d6186,_0x521c72){return _0x5d6186[_0xbb0b('0xb')](_0xbb0b('0xc'),attributes,{'tableName':_0xbb0b('0xd'),'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 e28ca9a..3120c43 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 _0x2b9e=['then','info','Team,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x1fabc9,_0x2651c8){var _0xea4f28=function(_0x5d0154){while(--_0x5d0154){_0x1fabc9['push'](_0x1fabc9['shift']());}};_0xea4f28(++_0x2651c8);}(_0x2b9e,0x10e));var _0xe2b9=function(_0x3a9188,_0x39ad38){_0x3a9188=_0x3a9188-0x0;var _0x5c2937=_0x2b9e[_0x3a9188];return _0x5c2937;};'use strict';var _=require(_0xe2b9('0x0'));var util=require('util');var moment=require(_0xe2b9('0x1'));var BPromise=require(_0xe2b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2b9('0x3'))['db'];var utils=require(_0xe2b9('0x4'));var logger=require(_0xe2b9('0x5'))('rpc');var config=require(_0xe2b9('0x6'));var jayson=require(_0xe2b9('0x7'));var client=jayson[_0xe2b9('0x8')][_0xe2b9('0x9')]({'port':0x232a});config[_0xe2b9('0xa')]=_['defaults'](config['redis'],{'host':_0xe2b9('0xb'),'port':0x18eb});var socket=require(_0xe2b9('0xc'))(new Redis(config[_0xe2b9('0xa')]));require(_0xe2b9('0xd'))[_0xe2b9('0xe')](socket);function respondWithRpcPromise(_0x4f3cec,_0x250d68,_0x4895e9){return new BPromise(function(_0x1ea8d5,_0x14db8a){return client[_0xe2b9('0xf')](_0x4f3cec,_0x4895e9)[_0xe2b9('0x10')](function(_0x317ed6){logger[_0xe2b9('0x11')](_0xe2b9('0x12'),_0x250d68,'request\x20sent');logger[_0xe2b9('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x250d68,'request\x20sent',JSON[_0xe2b9('0x14')](_0x317ed6));if(_0x317ed6[_0xe2b9('0x15')]){if(_0x317ed6[_0xe2b9('0x15')][_0xe2b9('0x16')]===0x1f4){logger[_0xe2b9('0x15')]('Team,\x20%s,\x20%s',_0x250d68,_0x317ed6[_0xe2b9('0x15')]['message']);return _0x14db8a(_0x317ed6['error']['message']);}logger['error'](_0xe2b9('0x12'),_0x250d68,_0x317ed6['error']['message']);return _0x1ea8d5(_0x317ed6['error'][_0xe2b9('0x17')]);}else{logger[_0xe2b9('0x11')](_0xe2b9('0x12'),_0x250d68,_0xe2b9('0x18'));_0x1ea8d5(_0x317ed6[_0xe2b9('0x19')][_0xe2b9('0x17')]);}})['catch'](function(_0x237af4){logger[_0xe2b9('0x15')](_0xe2b9('0x12'),_0x250d68,_0x237af4);_0x14db8a(_0x237af4);});});} \ No newline at end of file +var _0x50d8=['moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x194232,_0x200fff){var _0x3434e4=function(_0x317b3e){while(--_0x317b3e){_0x194232['push'](_0x194232['shift']());}};_0x3434e4(++_0x200fff);}(_0x50d8,0x12b));var _0x850d=function(_0x16b53e,_0x525de2){_0x16b53e=_0x16b53e-0x0;var _0x1be0e7=_0x50d8[_0x16b53e];return _0x1be0e7;};'use strict';var _=require(_0x850d('0x0'));var util=require('util');var moment=require(_0x850d('0x1'));var BPromise=require(_0x850d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x850d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x850d('0x4'))(_0x850d('0x5'));var config=require(_0x850d('0x6'));var jayson=require(_0x850d('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x850d('0x8')]=_[_0x850d('0x9')](config[_0x850d('0x8')],{'host':_0x850d('0xa'),'port':0x18eb});var socket=require(_0x850d('0xb'))(new Redis(config[_0x850d('0x8')]));require(_0x850d('0xc'))[_0x850d('0xd')](socket);function respondWithRpcPromise(_0x5652ba,_0x57f84b,_0x5c4832){return new BPromise(function(_0x2ed526,_0x4dfeff){return client['request'](_0x5652ba,_0x5c4832)[_0x850d('0xe')](function(_0xb43df6){logger['info']('Team,\x20%s,\x20%s',_0x57f84b,_0x850d('0xf'));logger['debug'](_0x850d('0x10'),_0x57f84b,'request\x20sent',JSON[_0x850d('0x11')](_0xb43df6));if(_0xb43df6[_0x850d('0x12')]){if(_0xb43df6[_0x850d('0x12')][_0x850d('0x13')]===0x1f4){logger[_0x850d('0x12')](_0x850d('0x14'),_0x57f84b,_0xb43df6[_0x850d('0x12')][_0x850d('0x15')]);return _0x4dfeff(_0xb43df6[_0x850d('0x12')][_0x850d('0x15')]);}logger['error'](_0x850d('0x14'),_0x57f84b,_0xb43df6[_0x850d('0x12')][_0x850d('0x15')]);return _0x2ed526(_0xb43df6[_0x850d('0x12')][_0x850d('0x15')]);}else{logger[_0x850d('0x16')]('Team,\x20%s,\x20%s',_0x57f84b,_0x850d('0xf'));_0x2ed526(_0xb43df6[_0x850d('0x17')]['message']);}})[_0x850d('0x18')](function(_0x35305f){logger[_0x850d('0x12')](_0x850d('0x14'),_0x57f84b,_0x35305f);_0x4dfeff(_0x35305f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 71532dc..a6b2f64 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 _0x90b2=['./team.events','removeListener','register','team:'];(function(_0x1ce1e2,_0x50159c){var _0x233fb7=function(_0x270030){while(--_0x270030){_0x1ce1e2['push'](_0x1ce1e2['shift']());}};_0x233fb7(++_0x50159c);}(_0x90b2,0x14c));var _0x290b=function(_0x573c19,_0x5525bd){_0x573c19=_0x573c19-0x0;var _0x26df1d=_0x90b2[_0x573c19];return _0x26df1d;};'use strict';var TeamEvents=require(_0x290b('0x0'));var events=['save','remove','update'];function createListener(_0xb5866c,_0x19a310){return function(_0x24e0a6){_0x19a310['emit'](_0xb5866c,_0x24e0a6);};}function removeListener(_0x587fdb,_0x97a432){return function(){TeamEvents[_0x290b('0x1')](_0x587fdb,_0x97a432);};}exports[_0x290b('0x2')]=function(_0x41cfa4){for(var _0xc2eb63=0x0,_0x2d78d=events['length'];_0xc2eb63<_0x2d78d;_0xc2eb63++){var _0x139247=events[_0xc2eb63];var _0x10e25e=createListener(_0x290b('0x3')+_0x139247,_0x41cfa4);TeamEvents['on'](_0x139247,_0x10e25e);}}; \ No newline at end of file +var _0x838f=['emit','removeListener','register','length','team:','./team.events','save','remove','update'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0x838f,0x101));var _0xf838=function(_0x15f44c,_0x431b3d){_0x15f44c=_0x15f44c-0x0;var _0xf10bb7=_0x838f[_0x15f44c];return _0xf10bb7;};'use strict';var TeamEvents=require(_0xf838('0x0'));var events=[_0xf838('0x1'),_0xf838('0x2'),_0xf838('0x3')];function createListener(_0x3569ac,_0xe3172f){return function(_0x110530){_0xe3172f[_0xf838('0x4')](_0x3569ac,_0x110530);};}function removeListener(_0x397247,_0x285cb4){return function(){TeamEvents[_0xf838('0x5')](_0x397247,_0x285cb4);};}exports[_0xf838('0x6')]=function(_0x5e1437){for(var _0x4a556f=0x0,_0x3c2c80=events[_0xf838('0x7')];_0x4a556f<_0x3c2c80;_0x4a556f++){var _0x31688b=events[_0x4a556f];var _0x5c534a=createListener(_0xf838('0x8')+_0x31688b,_0x5e1437);TeamEvents['on'](_0x31688b,_0x5c534a);}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 0953b6b..6bb4509 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xf6159,_0x1989db){var _0x50bc77=function(_0x78e6b8){while(--_0x78e6b8){_0xf6159['push'](_0xf6159['shift']());}};_0x50bc77(++_0x1989db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xcb91[_0x28aea5];return _0x6a55f9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x59bb17,_0x2a1cc5){var _0x57fda3=function(_0x475844){while(--_0x475844){_0x59bb17['push'](_0x59bb17['shift']());}};_0x57fda3(++_0x2a1cc5);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 9174f43..75df879 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x809e=['INTEGER','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x809e,0x1b4));var _0xe809=function(_0x4fe9a3,_0xc55c29){_0x4fe9a3=_0x4fe9a3-0x0;var _0x197883=_0x809e[_0x4fe9a3];return _0x197883;};'use strict';var Sequelize=require(_0xe809('0x0'));module[_0xe809('0x1')]={'penalty':{'type':Sequelize[_0xe809('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1156=['sequelize','INTEGER'];(function(_0x1a8a79,_0x57182d){var _0x436f4c=function(_0x4cc5c2){while(--_0x4cc5c2){_0x1a8a79['push'](_0x1a8a79['shift']());}};_0x436f4c(++_0x57182d);}(_0x1156,0x1a8));var _0x6115=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x1156[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require(_0x6115('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6115('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 23672c2..8952dc9 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc737=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','TeamVoiceQueue','lodash'];(function(_0x2c921c,_0x3c6a85){var _0x440bf2=function(_0x4db0df){while(--_0x4db0df){_0x2c921c['push'](_0x2c921c['shift']());}};_0x440bf2(++_0x3c6a85);}(_0xc737,0x8e));var _0x7c73=function(_0xdbccf0,_0x3dba4d){_0xdbccf0=_0xdbccf0-0x0;var _0x162a01=_0xc737[_0xdbccf0];return _0x162a01;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var logger=require('../../config/logger')(_0x7c73('0x2'));var moment=require(_0x7c73('0x3'));var BPromise=require(_0x7c73('0x4'));var rp=require(_0x7c73('0x5'));var fs=require('fs');var path=require(_0x7c73('0x6'));var rimraf=require(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x1eb29f,_0x2f09f7){return _0x1eb29f[_0x7c73('0x9')](_0x7c73('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x177a=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x177a,0xdd));var _0xa177=function(_0x28815b,_0x3b00eb){_0x28815b=_0x28815b-0x0;var _0x2410e9=_0x177a[_0x28815b];return _0x2410e9;};'use strict';var _=require(_0xa177('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa177('0x1'));var moment=require(_0xa177('0x2'));var BPromise=require(_0xa177('0x3'));var rp=require(_0xa177('0x4'));var fs=require('fs');var path=require(_0xa177('0x5'));var rimraf=require(_0xa177('0x6'));var config=require('../../config/environment');var attributes=require(_0xa177('0x7'));module[_0xa177('0x8')]=function(_0x1f37b0,_0x455737){return _0x1f37b0[_0xa177('0x9')](_0xa177('0xa'),attributes,{'tableName':_0xa177('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 0cfa480..c04e0bb 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d1f=['code','message','info','result','catch','util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x8d1f,0x137));var _0xf8d1=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x8d1f[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xf8d1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8d1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8d1('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8d1('0x3'))('rpc');var config=require(_0xf8d1('0x4'));var jayson=require(_0xf8d1('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a4125,_0xeab5b1,_0x117924){return new BPromise(function(_0x1fab63,_0x423f1){return client[_0xf8d1('0x6')](_0x1a4125,_0x117924)[_0xf8d1('0x7')](function(_0x143a50){logger['info'](_0xf8d1('0x8'),_0xeab5b1,_0xf8d1('0x9'));logger[_0xf8d1('0xa')](_0xf8d1('0xb'),_0xeab5b1,_0xf8d1('0x9'),JSON['stringify'](_0x143a50));if(_0x143a50[_0xf8d1('0xc')]){if(_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xd')]===0x1f4){logger[_0xf8d1('0xc')](_0xf8d1('0x8'),_0xeab5b1,_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xe')]);return _0x423f1(_0x143a50[_0xf8d1('0xc')]['message']);}logger[_0xf8d1('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0xeab5b1,_0x143a50['error']['message']);return _0x1fab63(_0x143a50[_0xf8d1('0xc')][_0xf8d1('0xe')]);}else{logger[_0xf8d1('0xf')](_0xf8d1('0x8'),_0xeab5b1,_0xf8d1('0x9'));_0x1fab63(_0x143a50[_0xf8d1('0x10')]['message']);}})[_0xf8d1('0x11')](function(_0x320a3f){logger[_0xf8d1('0xc')](_0xf8d1('0x8'),_0xeab5b1,_0x320a3f);_0x423f1(_0x320a3f);});});} \ No newline at end of file +var _0x7533=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x53db83,_0x10e021){var _0x5ac3fe=function(_0x4a1358){while(--_0x4a1358){_0x53db83['push'](_0x53db83['shift']());}};_0x5ac3fe(++_0x10e021);}(_0x7533,0x7e));var _0x3753=function(_0x54ab1c,_0x16ad11){_0x54ab1c=_0x54ab1c-0x0;var _0x5517b6=_0x7533[_0x54ab1c];return _0x5517b6;};'use strict';var _=require(_0x3753('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3753('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3753('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3753('0x3'));var logger=require(_0x3753('0x4'))('rpc');var config=require(_0x3753('0x5'));var jayson=require(_0x3753('0x6'));var client=jayson[_0x3753('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x139364,_0x201da9,_0x4208ea){return new BPromise(function(_0xbec7ee,_0x48068c){return client[_0x3753('0x8')](_0x139364,_0x4208ea)[_0x3753('0x9')](function(_0x1dec8f){logger['info'](_0x3753('0xa'),_0x201da9,_0x3753('0xb'));logger[_0x3753('0xc')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x201da9,_0x3753('0xb'),JSON['stringify'](_0x1dec8f));if(_0x1dec8f['error']){if(_0x1dec8f[_0x3753('0xd')][_0x3753('0xe')]===0x1f4){logger['error'](_0x3753('0xa'),_0x201da9,_0x1dec8f['error'][_0x3753('0xf')]);return _0x48068c(_0x1dec8f[_0x3753('0xd')]['message']);}logger['error'](_0x3753('0xa'),_0x201da9,_0x1dec8f[_0x3753('0xd')]['message']);return _0xbec7ee(_0x1dec8f[_0x3753('0xd')]['message']);}else{logger['info'](_0x3753('0xa'),_0x201da9,'request\x20sent');_0xbec7ee(_0x1dec8f['result'][_0x3753('0xf')]);}})[_0x3753('0x10')](function(_0x330005){logger[_0x3753('0xd')](_0x3753('0xa'),_0x201da9,_0x330005);_0x48068c(_0x330005);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index fdf7a70..4b49543 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 _0xc17d=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','index','/:id','isAuthenticated'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xc17d,0x96));var _0xdc17=function(_0x5f2bf8,_0x539e55){_0x5f2bf8=_0x5f2bf8-0x0;var _0x39bbc7=_0xc17d[_0x5f2bf8];return _0x39bbc7;};'use strict';var multer=require(_0xdc17('0x0'));var util=require(_0xdc17('0x1'));var path=require(_0xdc17('0x2'));var timeout=require(_0xdc17('0x3'));var express=require('express');var router=express[_0xdc17('0x4')]();var fs_extra=require(_0xdc17('0x5'));var auth=require(_0xdc17('0x6'));var interaction=require(_0xdc17('0x7'));var config=require('../../config/environment');var controller=require(_0xdc17('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdc17('0x9')]);router['get'](_0xdc17('0xa'),auth[_0xdc17('0xb')](),controller['show']);router['post']('/',auth[_0xdc17('0xb')](),controller[_0xdc17('0xc')]);router[_0xdc17('0xd')](_0xdc17('0xa'),auth[_0xdc17('0xb')](),controller[_0xdc17('0xe')]);router[_0xdc17('0xf')](_0xdc17('0xa'),auth['isAuthenticated'](),controller[_0xdc17('0x10')]);module[_0xdc17('0x11')]=router; \ No newline at end of file +var _0xe785=['get','isAuthenticated','/:id','show','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./template.controller'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe785,0x128));var _0x5e78=function(_0x218cd7,_0x18fe6d){_0x218cd7=_0x218cd7-0x0;var _0xb5a5fb=_0xe785[_0x218cd7];return _0xb5a5fb;};'use strict';var multer=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var path=require('path');var timeout=require(_0x5e78('0x2'));var express=require(_0x5e78('0x3'));var router=express[_0x5e78('0x4')]();var fs_extra=require(_0x5e78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e78('0x6'));var controller=require(_0x5e78('0x7'));router[_0x5e78('0x8')]('/',auth[_0x5e78('0x9')](),controller['index']);router['get'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xb')]);router['post']('/',auth[_0x5e78('0x9')](),controller['create']);router[_0x5e78('0xc')]('/:id',auth[_0x5e78('0x9')](),controller[_0x5e78('0xd')]);router['delete'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xe')]);module[_0x5e78('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 513cd1e..7c96b5d 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 _0x2241=['STRING','TEXT','exports'];(function(_0x5cd4b6,_0xed678d){var _0x5c04df=function(_0x15fe90){while(--_0x15fe90){_0x5cd4b6['push'](_0x5cd4b6['shift']());}};_0x5c04df(++_0xed678d);}(_0x2241,0x131));var _0x1224=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2241[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x1224('0x0')]={'name':{'type':Sequelize[_0x1224('0x1')]},'description':{'type':Sequelize[_0x1224('0x1')]},'html':{'type':Sequelize[_0x1224('0x2')]}}; \ No newline at end of file +var _0x926b=['STRING','TEXT','exports'];(function(_0x1bd92d,_0x5a3707){var _0x628149=function(_0x74e0ef){while(--_0x74e0ef){_0x1bd92d['push'](_0x1bd92d['shift']());}};_0x628149(++_0x5a3707);}(_0x926b,0x13d));var _0xb926=function(_0x217050,_0x32caee){_0x217050=_0x217050-0x0;var _0x88361=_0x926b[_0x217050];return _0x88361;};'use strict';var Sequelize=require('sequelize');module[_0xb926('0x0')]={'name':{'type':Sequelize[_0xb926('0x1')]},'description':{'type':Sequelize[_0xb926('0x1')]},'html':{'type':Sequelize[_0xb926('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b663859..3be268f 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 _0x4741=['limit','undefined','count','set','apply','reject','update','then','destroy','get','Templates','UserProfileResource','error','name','send','map','Template','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','catch','params','length','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset'];(function(_0x197065,_0x2e79d0){var _0x3d9404=function(_0xf582a7){while(--_0xf582a7){_0x197065['push'](_0x197065['shift']());}};_0x3d9404(++_0x2e79d0);}(_0x4741,0x171));var _0x1474=function(_0x50daba,_0x6feeda){_0x50daba=_0x50daba-0x0;var _0x470f1b=_0x4741[_0x50daba];return _0x470f1b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1474('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1474('0x1'));var rp=require(_0x1474('0x2'));var moment=require(_0x1474('0x3'));var BPromise=require(_0x1474('0x4'));var Mustache=require(_0x1474('0x5'));var util=require(_0x1474('0x6'));var path=require(_0x1474('0x7'));var sox=require(_0x1474('0x8'));var csv=require(_0x1474('0x9'));var ejs=require(_0x1474('0xa'));var fs=require('fs');var fs_extra=require(_0x1474('0xb'));var _=require(_0x1474('0xc'));var squel=require(_0x1474('0xd'));var crypto=require(_0x1474('0xe'));var jsforce=require(_0x1474('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1474('0x9'));var querystring=require(_0x1474('0x10'));var Papa=require('papaparse');var Redis=require(_0x1474('0x11'));var authService=require(_0x1474('0x12'));var qs=require(_0x1474('0x13'));var as=require(_0x1474('0x14'));var hardwareService=require(_0x1474('0x15'));var logger=require(_0x1474('0x16'))(_0x1474('0x17'));var utils=require(_0x1474('0x18'));var config=require(_0x1474('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1474('0x1a'))['db'];function respondWithStatusCode(_0x170913,_0x1a2d3f){_0x1a2d3f=_0x1a2d3f||0xcc;return function(_0x3e75b3){if(_0x3e75b3){return _0x170913[_0x1474('0x1b')](_0x1a2d3f);}return _0x170913['status'](_0x1a2d3f)['end']();};}function respondWithResult(_0x279363,_0x9bb0be){_0x9bb0be=_0x9bb0be||0xc8;return function(_0x19f447){if(_0x19f447){return _0x279363[_0x1474('0x1c')](_0x9bb0be)[_0x1474('0x1d')](_0x19f447);}};}function respondWithFilteredResult(_0x299ae0,_0x503fd0){return function(_0x112913){if(_0x112913){var _0x4caac0=typeof _0x503fd0[_0x1474('0x1e')]==='undefined'&&typeof _0x503fd0[_0x1474('0x1f')]===_0x1474('0x20');var _0x965f9c=_0x112913['count'];var _0x17b5c4=_0x4caac0?0x0:_0x503fd0[_0x1474('0x1e')];var _0x22f481=_0x4caac0?_0x112913[_0x1474('0x21')]:_0x503fd0[_0x1474('0x1e')]+_0x503fd0[_0x1474('0x1f')];var _0x4cb2b4;if(_0x22f481>=_0x965f9c){_0x22f481=_0x965f9c;_0x4cb2b4=0xc8;}else{_0x4cb2b4=0xce;}_0x299ae0[_0x1474('0x1c')](_0x4cb2b4);return _0x299ae0[_0x1474('0x22')]('Content-Range',_0x17b5c4+'-'+_0x22f481+'/'+_0x965f9c)[_0x1474('0x1d')](_0x112913);}return null;};}function patchUpdates(_0x4f530e){return function(_0x1ed49c){try{jsonpatch[_0x1474('0x23')](_0x1ed49c,_0x4f530e,!![]);}catch(_0x105a50){return BPromise[_0x1474('0x24')](_0x105a50);}return _0x1ed49c['save']();};}function saveUpdates(_0x471d7e,_0x63783e){return function(_0x1034e9){if(_0x1034e9){return _0x1034e9[_0x1474('0x25')](_0x471d7e)[_0x1474('0x26')](function(_0x37a696){return _0x37a696;});}return null;};}function removeEntity(_0x3be52e,_0x5d3df6){return function(_0x499c64){if(_0x499c64){return _0x499c64[_0x1474('0x27')]()[_0x1474('0x26')](function(){var _0x3786b0=_0x499c64[_0x1474('0x28')]({'plain':!![]});var _0x475857=_0x1474('0x29');return db[_0x1474('0x2a')][_0x1474('0x27')]({'where':{'type':_0x475857,'resourceId':_0x3786b0['id']}})[_0x1474('0x26')](function(){return _0x499c64;});})[_0x1474('0x26')](function(){_0x3be52e[_0x1474('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ebe5,_0x1b3f21){return function(_0x269877){if(!_0x269877){_0x57ebe5[_0x1474('0x1b')](0x194);}return _0x269877;};}function handleError(_0x10c4ae,_0x4c3d55){_0x4c3d55=_0x4c3d55||0x1f4;return function(_0x2fa2e1){logger[_0x1474('0x2b')](_0x2fa2e1['stack']);if(_0x2fa2e1[_0x1474('0x2c')]){delete _0x2fa2e1[_0x1474('0x2c')];}_0x10c4ae[_0x1474('0x1c')](_0x4c3d55)[_0x1474('0x2d')](_0x2fa2e1);};}exports['index']=function(_0x4a4c80,_0x471b5e){var _0x5e811b={},_0x24dcb0={},_0x4503a={'count':0x0,'rows':[]};var _0x40ec69=_[_0x1474('0x2e')](db[_0x1474('0x2f')][_0x1474('0x30')],function(_0x2df714){return{'name':_0x2df714[_0x1474('0x31')],'type':_0x2df714['type'][_0x1474('0x32')]};});_0x24dcb0[_0x1474('0x33')]=_['map'](_0x40ec69,'name');_0x24dcb0['query']=_[_0x1474('0x34')](_0x4a4c80[_0x1474('0x35')]);_0x24dcb0[_0x1474('0x36')]=_[_0x1474('0x37')](_0x24dcb0[_0x1474('0x33')],_0x24dcb0[_0x1474('0x35')]);_0x5e811b['attributes']=_[_0x1474('0x37')](_0x24dcb0[_0x1474('0x33')],qs[_0x1474('0x38')](_0x4a4c80[_0x1474('0x35')]['fields']));_0x5e811b[_0x1474('0x39')]=_0x5e811b[_0x1474('0x39')]['length']?_0x5e811b['attributes']:_0x24dcb0[_0x1474('0x33')];if(!_0x4a4c80[_0x1474('0x35')][_0x1474('0x3a')]('nolimit')){_0x5e811b[_0x1474('0x1f')]=qs['limit'](_0x4a4c80[_0x1474('0x35')][_0x1474('0x1f')]);_0x5e811b[_0x1474('0x1e')]=qs[_0x1474('0x1e')](_0x4a4c80[_0x1474('0x35')][_0x1474('0x1e')]);}_0x5e811b[_0x1474('0x3b')]=qs[_0x1474('0x3c')](_0x4a4c80[_0x1474('0x35')][_0x1474('0x3c')]);_0x5e811b['where']=qs[_0x1474('0x36')](_['pick'](_0x4a4c80[_0x1474('0x35')],_0x24dcb0['filters']),_0x40ec69);if(_0x4a4c80[_0x1474('0x35')][_0x1474('0x3d')]){_0x5e811b[_0x1474('0x3e')]=_['merge'](_0x5e811b[_0x1474('0x3e')],{'$or':_['map'](_0x40ec69,function(_0x127848){if(_0x127848[_0x1474('0x3f')]!==_0x1474('0x40')){var _0x4c1f07={};_0x4c1f07[_0x127848[_0x1474('0x2c')]]={'$like':'%'+_0x4a4c80['query'][_0x1474('0x3d')]+'%'};return _0x4c1f07;}})});}_0x5e811b=_[_0x1474('0x41')]({},_0x5e811b,_0x4a4c80['options']);var _0x46fc4d={'where':_0x5e811b[_0x1474('0x3e')]};return db[_0x1474('0x2f')]['count'](_0x46fc4d)['then'](function(_0x3b0abd){_0x4503a[_0x1474('0x21')]=_0x3b0abd;if(_0x4a4c80[_0x1474('0x35')][_0x1474('0x42')]){_0x5e811b[_0x1474('0x43')]=[{'all':!![]}];}return db[_0x1474('0x2f')][_0x1474('0x44')](_0x5e811b);})['then'](function(_0x1f1a70){_0x4503a['rows']=_0x1f1a70;return _0x4503a;})[_0x1474('0x26')](respondWithFilteredResult(_0x471b5e,_0x5e811b))[_0x1474('0x45')](handleError(_0x471b5e,null));};exports['show']=function(_0x149ed2,_0x118726){var _0x465604={'raw':!![],'where':{'id':_0x149ed2[_0x1474('0x46')]['id']}},_0x98d117={};_0x98d117[_0x1474('0x33')]=_[_0x1474('0x34')](db[_0x1474('0x2f')]['rawAttributes']);_0x98d117[_0x1474('0x35')]=_[_0x1474('0x34')](_0x149ed2['query']);_0x98d117[_0x1474('0x36')]=_[_0x1474('0x37')](_0x98d117[_0x1474('0x33')],_0x98d117[_0x1474('0x35')]);_0x465604['attributes']=_[_0x1474('0x37')](_0x98d117[_0x1474('0x33')],qs['fields'](_0x149ed2['query'][_0x1474('0x38')]));_0x465604[_0x1474('0x39')]=_0x465604[_0x1474('0x39')][_0x1474('0x47')]?_0x465604[_0x1474('0x39')]:_0x98d117['model'];if(_0x149ed2[_0x1474('0x35')][_0x1474('0x42')]){_0x465604[_0x1474('0x43')]=[{'all':!![]}];}_0x465604=_['merge']({},_0x465604,_0x149ed2['options']);return db[_0x1474('0x2f')][_0x1474('0x48')](_0x465604)[_0x1474('0x26')](handleEntityNotFound(_0x118726,null))[_0x1474('0x26')](respondWithResult(_0x118726,null))[_0x1474('0x45')](handleError(_0x118726,null));};exports['create']=function(_0x426c29,_0x5c4a59){return db['Template']['create'](_0x426c29['body'],{})[_0x1474('0x26')](function(_0x5422ff){var _0x51a8cd=_0x426c29[_0x1474('0x49')][_0x1474('0x28')]({'plain':!![]});if(!_0x51a8cd)throw new Error(_0x1474('0x4a'));if(_0x51a8cd['role']===_0x1474('0x49')){var _0x289281=_0x5422ff[_0x1474('0x28')]({'plain':!![]});var _0x2d9e96=_0x1474('0x29');return db[_0x1474('0x4b')][_0x1474('0x48')]({'where':{'name':_0x2d9e96,'userProfileId':_0x51a8cd[_0x1474('0x4c')]},'raw':!![]})[_0x1474('0x26')](function(_0x17fe7d){if(_0x17fe7d&&_0x17fe7d[_0x1474('0x4d')]===0x0){return db[_0x1474('0x2a')][_0x1474('0x4e')]({'name':_0x289281[_0x1474('0x2c')],'resourceId':_0x289281['id'],'type':_0x17fe7d['name'],'sectionId':_0x17fe7d['id']},{})[_0x1474('0x26')](function(){return _0x5422ff;});}else{return _0x5422ff;}})[_0x1474('0x45')](function(_0x575d58){logger[_0x1474('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x575d58);throw _0x575d58;});}return _0x5422ff;})[_0x1474('0x26')](respondWithResult(_0x5c4a59,0xc9))[_0x1474('0x45')](handleError(_0x5c4a59,null));};exports[_0x1474('0x25')]=function(_0x3b3c1b,_0x2d55dd){if(_0x3b3c1b[_0x1474('0x4f')]['id']){delete _0x3b3c1b['body']['id'];}return db['Template']['find']({'where':{'id':_0x3b3c1b[_0x1474('0x46')]['id']}})[_0x1474('0x26')](handleEntityNotFound(_0x2d55dd,null))[_0x1474('0x26')](saveUpdates(_0x3b3c1b['body'],null))['then'](respondWithResult(_0x2d55dd,null))['catch'](handleError(_0x2d55dd,null));};exports[_0x1474('0x27')]=function(_0x575dc6,_0x13c65e){return db[_0x1474('0x2f')][_0x1474('0x48')]({'where':{'id':_0x575dc6[_0x1474('0x46')]['id']}})[_0x1474('0x26')](handleEntityNotFound(_0x13c65e,null))['then'](removeEntity(_0x13c65e,null))[_0x1474('0x45')](handleError(_0x13c65e,null));}; \ No newline at end of file +var _0x8c93=['create','body','user','role','userProfileId','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Templates','UserProfileResource','error','stack','name','send','index','Template','rawAttributes','fieldName','key','query','intersection','attributes','fields','nolimit','order','where','filters','pick','merge','map','filter','options','include','findAll','rows','params','model','keys','length','includeAll','find','catch'];(function(_0x22b42a,_0x38763a){var _0x5b52ae=function(_0x10d745){while(--_0x10d745){_0x22b42a['push'](_0x22b42a['shift']());}};_0x5b52ae(++_0x38763a);}(_0x8c93,0xa1));var _0x38c9=function(_0xe08877,_0x312dc4){_0xe08877=_0xe08877-0x0;var _0x24153c=_0x8c93[_0xe08877];return _0x24153c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38c9('0x0'));var zipdir=require(_0x38c9('0x1'));var jsonpatch=require(_0x38c9('0x2'));var rp=require(_0x38c9('0x3'));var moment=require(_0x38c9('0x4'));var BPromise=require(_0x38c9('0x5'));var Mustache=require('mustache');var util=require(_0x38c9('0x6'));var path=require(_0x38c9('0x7'));var sox=require(_0x38c9('0x8'));var csv=require(_0x38c9('0x9'));var ejs=require(_0x38c9('0xa'));var fs=require('fs');var fs_extra=require(_0x38c9('0xb'));var _=require(_0x38c9('0xc'));var squel=require('squel');var crypto=require(_0x38c9('0xd'));var jsforce=require(_0x38c9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38c9('0x9'));var querystring=require(_0x38c9('0xf'));var Papa=require(_0x38c9('0x10'));var Redis=require(_0x38c9('0x11'));var authService=require(_0x38c9('0x12'));var qs=require(_0x38c9('0x13'));var as=require(_0x38c9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x38c9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x38c9('0x16'));var db=require(_0x38c9('0x17'))['db'];function respondWithStatusCode(_0x1608c1,_0x299315){_0x299315=_0x299315||0xcc;return function(_0x305170){if(_0x305170){return _0x1608c1[_0x38c9('0x18')](_0x299315);}return _0x1608c1['status'](_0x299315)[_0x38c9('0x19')]();};}function respondWithResult(_0x44926b,_0x97e12){_0x97e12=_0x97e12||0xc8;return function(_0xe1e563){if(_0xe1e563){return _0x44926b[_0x38c9('0x1a')](_0x97e12)[_0x38c9('0x1b')](_0xe1e563);}};}function respondWithFilteredResult(_0x171fc4,_0xa1fc26){return function(_0x1c667f){if(_0x1c667f){var _0x21e004=typeof _0xa1fc26[_0x38c9('0x1c')]===_0x38c9('0x1d')&&typeof _0xa1fc26[_0x38c9('0x1e')]===_0x38c9('0x1d');var _0x5be385=_0x1c667f[_0x38c9('0x1f')];var _0x5bec63=_0x21e004?0x0:_0xa1fc26[_0x38c9('0x1c')];var _0x3a84fb=_0x21e004?_0x1c667f[_0x38c9('0x1f')]:_0xa1fc26[_0x38c9('0x1c')]+_0xa1fc26[_0x38c9('0x1e')];var _0x4caca3;if(_0x3a84fb>=_0x5be385){_0x3a84fb=_0x5be385;_0x4caca3=0xc8;}else{_0x4caca3=0xce;}_0x171fc4[_0x38c9('0x1a')](_0x4caca3);return _0x171fc4[_0x38c9('0x20')](_0x38c9('0x21'),_0x5bec63+'-'+_0x3a84fb+'/'+_0x5be385)[_0x38c9('0x1b')](_0x1c667f);}return null;};}function patchUpdates(_0x361e7f){return function(_0x64ee3d){try{jsonpatch[_0x38c9('0x22')](_0x64ee3d,_0x361e7f,!![]);}catch(_0x25c0ad){return BPromise[_0x38c9('0x23')](_0x25c0ad);}return _0x64ee3d['save']();};}function saveUpdates(_0x20167e,_0x262b77){return function(_0x10315e){if(_0x10315e){return _0x10315e[_0x38c9('0x24')](_0x20167e)[_0x38c9('0x25')](function(_0x3e8d44){return _0x3e8d44;});}return null;};}function removeEntity(_0xd38d43,_0x53fa14){return function(_0xd77399){if(_0xd77399){return _0xd77399['destroy']()[_0x38c9('0x25')](function(){var _0x23a6da=_0xd77399[_0x38c9('0x26')]({'plain':!![]});var _0x347408=_0x38c9('0x27');return db[_0x38c9('0x28')]['destroy']({'where':{'type':_0x347408,'resourceId':_0x23a6da['id']}})[_0x38c9('0x25')](function(){return _0xd77399;});})['then'](function(){_0xd38d43[_0x38c9('0x1a')](0xcc)[_0x38c9('0x19')]();});}};}function handleEntityNotFound(_0x21fee7,_0x26d610){return function(_0x104828){if(!_0x104828){_0x21fee7['sendStatus'](0x194);}return _0x104828;};}function handleError(_0x118119,_0x196352){_0x196352=_0x196352||0x1f4;return function(_0x5ccc66){logger[_0x38c9('0x29')](_0x5ccc66[_0x38c9('0x2a')]);if(_0x5ccc66[_0x38c9('0x2b')]){delete _0x5ccc66['name'];}_0x118119['status'](_0x196352)[_0x38c9('0x2c')](_0x5ccc66);};}exports[_0x38c9('0x2d')]=function(_0x53abcc,_0xd59dfd){var _0x30ab53={},_0xe52f24={},_0x52257d={'count':0x0,'rows':[]};var _0x4593bf=_['map'](db[_0x38c9('0x2e')][_0x38c9('0x2f')],function(_0x1574af){return{'name':_0x1574af[_0x38c9('0x30')],'type':_0x1574af['type'][_0x38c9('0x31')]};});_0xe52f24['model']=_['map'](_0x4593bf,_0x38c9('0x2b'));_0xe52f24[_0x38c9('0x32')]=_['keys'](_0x53abcc['query']);_0xe52f24['filters']=_[_0x38c9('0x33')](_0xe52f24['model'],_0xe52f24[_0x38c9('0x32')]);_0x30ab53[_0x38c9('0x34')]=_[_0x38c9('0x33')](_0xe52f24['model'],qs[_0x38c9('0x35')](_0x53abcc['query']['fields']));_0x30ab53[_0x38c9('0x34')]=_0x30ab53[_0x38c9('0x34')]['length']?_0x30ab53[_0x38c9('0x34')]:_0xe52f24['model'];if(!_0x53abcc[_0x38c9('0x32')]['hasOwnProperty'](_0x38c9('0x36'))){_0x30ab53[_0x38c9('0x1e')]=qs[_0x38c9('0x1e')](_0x53abcc[_0x38c9('0x32')][_0x38c9('0x1e')]);_0x30ab53[_0x38c9('0x1c')]=qs[_0x38c9('0x1c')](_0x53abcc['query'][_0x38c9('0x1c')]);}_0x30ab53[_0x38c9('0x37')]=qs['sort'](_0x53abcc['query']['sort']);_0x30ab53[_0x38c9('0x38')]=qs[_0x38c9('0x39')](_[_0x38c9('0x3a')](_0x53abcc['query'],_0xe52f24[_0x38c9('0x39')]),_0x4593bf);if(_0x53abcc['query']['filter']){_0x30ab53[_0x38c9('0x38')]=_[_0x38c9('0x3b')](_0x30ab53[_0x38c9('0x38')],{'$or':_[_0x38c9('0x3c')](_0x4593bf,function(_0x453207){if(_0x453207['type']!=='VIRTUAL'){var _0x1db145={};_0x1db145[_0x453207[_0x38c9('0x2b')]]={'$like':'%'+_0x53abcc[_0x38c9('0x32')][_0x38c9('0x3d')]+'%'};return _0x1db145;}})});}_0x30ab53=_[_0x38c9('0x3b')]({},_0x30ab53,_0x53abcc[_0x38c9('0x3e')]);var _0x448298={'where':_0x30ab53[_0x38c9('0x38')]};return db['Template'][_0x38c9('0x1f')](_0x448298)['then'](function(_0x273f1b){_0x52257d[_0x38c9('0x1f')]=_0x273f1b;if(_0x53abcc[_0x38c9('0x32')]['includeAll']){_0x30ab53[_0x38c9('0x3f')]=[{'all':!![]}];}return db[_0x38c9('0x2e')][_0x38c9('0x40')](_0x30ab53);})[_0x38c9('0x25')](function(_0x14e1fc){_0x52257d[_0x38c9('0x41')]=_0x14e1fc;return _0x52257d;})[_0x38c9('0x25')](respondWithFilteredResult(_0xd59dfd,_0x30ab53))['catch'](handleError(_0xd59dfd,null));};exports['show']=function(_0x54ae20,_0x5610d0){var _0x3f9d43={'raw':!![],'where':{'id':_0x54ae20[_0x38c9('0x42')]['id']}},_0x59a078={};_0x59a078[_0x38c9('0x43')]=_['keys'](db['Template']['rawAttributes']);_0x59a078['query']=_[_0x38c9('0x44')](_0x54ae20[_0x38c9('0x32')]);_0x59a078[_0x38c9('0x39')]=_['intersection'](_0x59a078[_0x38c9('0x43')],_0x59a078[_0x38c9('0x32')]);_0x3f9d43['attributes']=_['intersection'](_0x59a078[_0x38c9('0x43')],qs[_0x38c9('0x35')](_0x54ae20['query'][_0x38c9('0x35')]));_0x3f9d43[_0x38c9('0x34')]=_0x3f9d43[_0x38c9('0x34')][_0x38c9('0x45')]?_0x3f9d43[_0x38c9('0x34')]:_0x59a078[_0x38c9('0x43')];if(_0x54ae20[_0x38c9('0x32')][_0x38c9('0x46')]){_0x3f9d43[_0x38c9('0x3f')]=[{'all':!![]}];}_0x3f9d43=_[_0x38c9('0x3b')]({},_0x3f9d43,_0x54ae20[_0x38c9('0x3e')]);return db[_0x38c9('0x2e')][_0x38c9('0x47')](_0x3f9d43)[_0x38c9('0x25')](handleEntityNotFound(_0x5610d0,null))[_0x38c9('0x25')](respondWithResult(_0x5610d0,null))[_0x38c9('0x48')](handleError(_0x5610d0,null));};exports[_0x38c9('0x49')]=function(_0x25bb3b,_0x4bb956){return db[_0x38c9('0x2e')][_0x38c9('0x49')](_0x25bb3b[_0x38c9('0x4a')],{})['then'](function(_0x40fe62){var _0x239a36=_0x25bb3b[_0x38c9('0x4b')]['get']({'plain':!![]});if(!_0x239a36)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x239a36[_0x38c9('0x4c')]===_0x38c9('0x4b')){var _0x22c881=_0x40fe62[_0x38c9('0x26')]({'plain':!![]});var _0x4f20e9=_0x38c9('0x27');return db['UserProfileSection'][_0x38c9('0x47')]({'where':{'name':_0x4f20e9,'userProfileId':_0x239a36[_0x38c9('0x4d')]},'raw':!![]})['then'](function(_0x1882c2){if(_0x1882c2&&_0x1882c2['autoAssociation']===0x0){return db[_0x38c9('0x28')][_0x38c9('0x49')]({'name':_0x22c881[_0x38c9('0x2b')],'resourceId':_0x22c881['id'],'type':_0x1882c2[_0x38c9('0x2b')],'sectionId':_0x1882c2['id']},{})[_0x38c9('0x25')](function(){return _0x40fe62;});}else{return _0x40fe62;}})[_0x38c9('0x48')](function(_0x181cbe){logger[_0x38c9('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x181cbe);throw _0x181cbe;});}return _0x40fe62;})[_0x38c9('0x25')](respondWithResult(_0x4bb956,0xc9))[_0x38c9('0x48')](handleError(_0x4bb956,null));};exports[_0x38c9('0x24')]=function(_0x4ad780,_0x106c82){if(_0x4ad780[_0x38c9('0x4a')]['id']){delete _0x4ad780[_0x38c9('0x4a')]['id'];}return db[_0x38c9('0x2e')][_0x38c9('0x47')]({'where':{'id':_0x4ad780['params']['id']}})[_0x38c9('0x25')](handleEntityNotFound(_0x106c82,null))[_0x38c9('0x25')](saveUpdates(_0x4ad780[_0x38c9('0x4a')],null))[_0x38c9('0x25')](respondWithResult(_0x106c82,null))[_0x38c9('0x48')](handleError(_0x106c82,null));};exports['destroy']=function(_0x4ada87,_0x306411){return db[_0x38c9('0x2e')][_0x38c9('0x47')]({'where':{'id':_0x4ada87[_0x38c9('0x42')]['id']}})['then'](handleEntityNotFound(_0x306411,null))[_0x38c9('0x25')](removeEntity(_0x306411,null))[_0x38c9('0x48')](handleError(_0x306411,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5739118..55f3c48 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 _0x6dfd=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x30b8d6,_0x469a87){var _0x8774a8=function(_0x3d1d5f){while(--_0x3d1d5f){_0x30b8d6['push'](_0x30b8d6['shift']());}};_0x8774a8(++_0x469a87);}(_0x6dfd,0x111));var _0xd6df=function(_0x2cd3d8,_0x5ddfb0){_0x2cd3d8=_0x2cd3d8-0x0;var _0x1ee6e1=_0x6dfd[_0x2cd3d8];return _0x1ee6e1;};'use strict';var _=require(_0xd6df('0x0'));var util=require(_0xd6df('0x1'));var logger=require(_0xd6df('0x2'))(_0xd6df('0x3'));var moment=require(_0xd6df('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6df('0x5'));var rimraf=require(_0xd6df('0x6'));var config=require(_0xd6df('0x7'));var attributes=require(_0xd6df('0x8'));module[_0xd6df('0x9')]=function(_0x402a1c,_0x569ee6){return _0x402a1c[_0xd6df('0xa')](_0xd6df('0xb'),attributes,{'tableName':_0xd6df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f4d=['api','moment','request-promise','path','../../config/environment','./template.attributes','exports','define','Template','../../config/logger'];(function(_0x3053ad,_0x5000bf){var _0x98f3e2=function(_0x429f1a){while(--_0x429f1a){_0x3053ad['push'](_0x3053ad['shift']());}};_0x98f3e2(++_0x5000bf);}(_0x1f4d,0x1d5));var _0xd1f4=function(_0x69305f,_0x55b1fd){_0x69305f=_0x69305f-0x0;var _0x2b5726=_0x1f4d[_0x69305f];return _0x2b5726;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd1f4('0x0'))(_0xd1f4('0x1'));var moment=require(_0xd1f4('0x2'));var BPromise=require('bluebird');var rp=require(_0xd1f4('0x3'));var fs=require('fs');var path=require(_0xd1f4('0x4'));var rimraf=require('rimraf');var config=require(_0xd1f4('0x5'));var attributes=require(_0xd1f4('0x6'));module[_0xd1f4('0x7')]=function(_0x41d0db,_0x298c2a){return _0x41d0db[_0xd1f4('0x8')](_0xd1f4('0x9'),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 d9f0444..80afd99 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 _0x2995=['Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes','include','map','model','GetTemplate','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x49e68d,_0x529bff){var _0x39d745=function(_0x4e37bf){while(--_0x4e37bf){_0x49e68d['push'](_0x49e68d['shift']());}};_0x39d745(++_0x529bff);}(_0x2995,0x197));var _0x5299=function(_0x31ec50,_0x51e118){_0x31ec50=_0x31ec50-0x0;var _0x1d62c2=_0x2995[_0x31ec50];return _0x1d62c2;};'use strict';var _=require(_0x5299('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5299('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5299('0x2'));var db=require(_0x5299('0x3'))['db'];var utils=require(_0x5299('0x4'));var logger=require(_0x5299('0x5'))(_0x5299('0x6'));var config=require(_0x5299('0x7'));var jayson=require(_0x5299('0x8'));var client=jayson['client'][_0x5299('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x223d25,_0x286d38,_0x688d18){return new BPromise(function(_0x67b13d,_0x2dc1f7){return client[_0x5299('0xa')](_0x223d25,_0x688d18)[_0x5299('0xb')](function(_0xcb5700){logger[_0x5299('0xc')](_0x5299('0xd'),_0x286d38,'request\x20sent');logger[_0x5299('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x286d38,_0x5299('0xf'),JSON[_0x5299('0x10')](_0xcb5700));if(_0xcb5700[_0x5299('0x11')]){if(_0xcb5700[_0x5299('0x11')][_0x5299('0x12')]===0x1f4){logger[_0x5299('0x11')](_0x5299('0xd'),_0x286d38,_0xcb5700[_0x5299('0x11')][_0x5299('0x13')]);return _0x2dc1f7(_0xcb5700['error']['message']);}logger[_0x5299('0x11')](_0x5299('0xd'),_0x286d38,_0xcb5700[_0x5299('0x11')][_0x5299('0x13')]);return _0x67b13d(_0xcb5700[_0x5299('0x11')][_0x5299('0x13')]);}else{logger[_0x5299('0xc')](_0x5299('0xd'),_0x286d38,_0x5299('0xf'));_0x67b13d(_0xcb5700[_0x5299('0x14')]['message']);}})[_0x5299('0x15')](function(_0x458a20){logger[_0x5299('0x11')]('Template,\x20%s,\x20%s',_0x286d38,_0x458a20);_0x2dc1f7(_0x458a20);});});}exports['GetTemplate']=function(_0x2d2836){var _0x41805c=this;return new Promise(function(_0x2682ac,_0x15a58f){return db['Template']['findAll']({'raw':_0x2d2836['options']?_0x2d2836[_0x5299('0x16')][_0x5299('0x17')]===undefined?!![]:![]:!![],'where':_0x2d2836['options']?_0x2d2836[_0x5299('0x16')][_0x5299('0x18')]||null:null,'attributes':_0x2d2836[_0x5299('0x16')]?_0x2d2836[_0x5299('0x16')][_0x5299('0x19')]||null:null,'limit':_0x2d2836[_0x5299('0x16')]?_0x2d2836[_0x5299('0x16')]['limit']||null:null,'include':_0x2d2836[_0x5299('0x16')]?_0x2d2836[_0x5299('0x16')][_0x5299('0x1a')]?_[_0x5299('0x1b')](_0x2d2836['options'][_0x5299('0x1a')],function(_0xc4e484){return{'model':db[_0xc4e484[_0x5299('0x1c')]],'as':_0xc4e484['as'],'attributes':_0xc4e484[_0x5299('0x19')],'include':_0xc4e484[_0x5299('0x1a')]?_[_0x5299('0x1b')](_0xc4e484[_0x5299('0x1a')],function(_0x39ac55){return{'model':db[_0x39ac55['model']],'as':_0x39ac55['as'],'attributes':_0x39ac55['attributes'],'include':_0x39ac55['include']?_['map'](_0x39ac55[_0x5299('0x1a')],function(_0x2b5a02){return{'model':db[_0x2b5a02[_0x5299('0x1c')]],'as':_0x2b5a02['as'],'attributes':_0x2b5a02['attributes']};}):[]};}):[]};}):[]:[]})[_0x5299('0xb')](function(_0x1b2b67){logger[_0x5299('0xc')](_0x5299('0x1d'),_0x2d2836);logger['debug'](_0x5299('0x1d'),_0x2d2836,JSON['stringify'](_0x1b2b67));_0x2682ac(_0x1b2b67);})[_0x5299('0x15')](function(_0x4e2937){logger[_0x5299('0x11')](_0x5299('0x1d'),_0x4e2937[_0x5299('0x13')],_0x2d2836);_0x15a58f(_0x41805c[_0x5299('0x11')](0x1f4,_0x4e2937[_0x5299('0x13')]));});});}; \ No newline at end of file +var _0x437d=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','attributes','limit','include','map','model','then','info','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x437d,0xe1));var _0xd437=function(_0x23a60a,_0x1dc6eb){_0x23a60a=_0x23a60a-0x0;var _0x3b69f6=_0x437d[_0x23a60a];return _0x3b69f6;};'use strict';var _=require(_0xd437('0x0'));var util=require(_0xd437('0x1'));var moment=require(_0xd437('0x2'));var BPromise=require('bluebird');var rs=require(_0xd437('0x3'));var fs=require('fs');var Redis=require(_0xd437('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd437('0x5'));var logger=require(_0xd437('0x6'))(_0xd437('0x7'));var config=require(_0xd437('0x8'));var jayson=require(_0xd437('0x9'));var client=jayson[_0xd437('0xa')][_0xd437('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x526c30,_0x23d0d6,_0x46379a){return new BPromise(function(_0x1d2341,_0x308880){return client[_0xd437('0xc')](_0x526c30,_0x46379a)['then'](function(_0x2167c6){logger['info'](_0xd437('0xd'),_0x23d0d6,_0xd437('0xe'));logger[_0xd437('0xf')](_0xd437('0x10'),_0x23d0d6,_0xd437('0xe'),JSON[_0xd437('0x11')](_0x2167c6));if(_0x2167c6[_0xd437('0x12')]){if(_0x2167c6[_0xd437('0x12')][_0xd437('0x13')]===0x1f4){logger[_0xd437('0x12')]('Template,\x20%s,\x20%s',_0x23d0d6,_0x2167c6[_0xd437('0x12')]['message']);return _0x308880(_0x2167c6[_0xd437('0x12')][_0xd437('0x14')]);}logger[_0xd437('0x12')](_0xd437('0xd'),_0x23d0d6,_0x2167c6[_0xd437('0x12')][_0xd437('0x14')]);return _0x1d2341(_0x2167c6['error'][_0xd437('0x14')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x23d0d6,_0xd437('0xe'));_0x1d2341(_0x2167c6[_0xd437('0x15')][_0xd437('0x14')]);}})[_0xd437('0x16')](function(_0x14cc48){logger[_0xd437('0x12')]('Template,\x20%s,\x20%s',_0x23d0d6,_0x14cc48);_0x308880(_0x14cc48);});});}exports[_0xd437('0x17')]=function(_0x3b29b7){var _0x2f4d06=this;return new Promise(function(_0x4fa5bf,_0x1b6c9a){return db['Template'][_0xd437('0x18')]({'raw':_0x3b29b7['options']?_0x3b29b7[_0xd437('0x19')][_0xd437('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b29b7[_0xd437('0x19')]?_0x3b29b7[_0xd437('0x19')]['where']||null:null,'attributes':_0x3b29b7[_0xd437('0x19')]?_0x3b29b7['options'][_0xd437('0x1b')]||null:null,'limit':_0x3b29b7[_0xd437('0x19')]?_0x3b29b7[_0xd437('0x19')][_0xd437('0x1c')]||null:null,'include':_0x3b29b7[_0xd437('0x19')]?_0x3b29b7[_0xd437('0x19')][_0xd437('0x1d')]?_[_0xd437('0x1e')](_0x3b29b7[_0xd437('0x19')][_0xd437('0x1d')],function(_0x2abc63){return{'model':db[_0x2abc63[_0xd437('0x1f')]],'as':_0x2abc63['as'],'attributes':_0x2abc63['attributes'],'include':_0x2abc63[_0xd437('0x1d')]?_['map'](_0x2abc63[_0xd437('0x1d')],function(_0x5a365e){return{'model':db[_0x5a365e[_0xd437('0x1f')]],'as':_0x5a365e['as'],'attributes':_0x5a365e['attributes'],'include':_0x5a365e[_0xd437('0x1d')]?_[_0xd437('0x1e')](_0x5a365e[_0xd437('0x1d')],function(_0x21cb60){return{'model':db[_0x21cb60[_0xd437('0x1f')]],'as':_0x21cb60['as'],'attributes':_0x21cb60[_0xd437('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd437('0x20')](function(_0x1cb501){logger[_0xd437('0x21')]('GetTemplate',_0x3b29b7);logger[_0xd437('0xf')](_0xd437('0x17'),_0x3b29b7,JSON[_0xd437('0x11')](_0x1cb501));_0x4fa5bf(_0x1cb501);})[_0xd437('0x16')](function(_0x20c4ec){logger[_0xd437('0x12')]('GetTemplate',_0x20c4ec[_0xd437('0x14')],_0x3b29b7);_0x1b6c9a(_0x2f4d06[_0xd437('0x12')](0x1f4,_0x20c4ec[_0xd437('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ecaf428..137e833 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 _0xbaaa=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAction','put','update','delete','exports','multer'];(function(_0xdeaebe,_0x5974ac){var _0x3e53b4=function(_0x5803c5){while(--_0x5803c5){_0xdeaebe['push'](_0xdeaebe['shift']());}};_0x3e53b4(++_0x5974ac);}(_0xbaaa,0x137));var _0xabaa=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xbaaa[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0xabaa('0x0'));var util=require('util');var path=require(_0xabaa('0x1'));var timeout=require(_0xabaa('0x2'));var express=require(_0xabaa('0x3'));var router=express['Router']();var fs_extra=require(_0xabaa('0x4'));var auth=require(_0xabaa('0x5'));var interaction=require(_0xabaa('0x6'));var config=require('../../config/environment');var controller=require(_0xabaa('0x7'));router[_0xabaa('0x8')]('/',auth['isAuthenticated'](),controller[_0xabaa('0x9')]);router['get'](_0xabaa('0xa'),auth[_0xabaa('0xb')](),controller[_0xabaa('0xc')]);router[_0xabaa('0x8')](_0xabaa('0xd'),auth[_0xabaa('0xb')](),controller[_0xabaa('0xe')]);router[_0xabaa('0x8')](_0xabaa('0xf'),auth[_0xabaa('0xb')](),controller[_0xabaa('0x10')]);router['get'](_0xabaa('0x11'),auth[_0xabaa('0xb')](),controller[_0xabaa('0x12')]);router[_0xabaa('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xabaa('0x13')](_0xabaa('0xd'),auth['isAuthenticated'](),controller[_0xabaa('0x14')]);router['post'](_0xabaa('0xf'),auth[_0xabaa('0xb')](),controller['addAnyCondition']);router[_0xabaa('0x13')]('/:id/actions',auth[_0xabaa('0xb')](),controller[_0xabaa('0x15')]);router[_0xabaa('0x16')](_0xabaa('0xa'),auth['isAuthenticated'](),controller[_0xabaa('0x17')]);router[_0xabaa('0x18')]('/:id',auth[_0xabaa('0xb')](),controller['destroy']);module[_0xabaa('0x19')]=router; \ No newline at end of file +var _0xbe33=['delete','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','/:id/all_conditions','addAllCondition','addAnyCondition','put','update'];(function(_0x574dea,_0x4cf209){var _0x3ed444=function(_0x3423a2){while(--_0x3423a2){_0x574dea['push'](_0x574dea['shift']());}};_0x3ed444(++_0x4cf209);}(_0xbe33,0x183));var _0x3be3=function(_0x347826,_0x57f63c){_0x347826=_0x347826-0x0;var _0x1696de=_0xbe33[_0x347826];return _0x1696de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3be3('0x0'));var timeout=require('connect-timeout');var express=require(_0x3be3('0x1'));var router=express['Router']();var fs_extra=require(_0x3be3('0x2'));var auth=require(_0x3be3('0x3'));var interaction=require(_0x3be3('0x4'));var config=require('../../config/environment');var controller=require(_0x3be3('0x5'));router[_0x3be3('0x6')]('/',auth[_0x3be3('0x7')](),controller[_0x3be3('0x8')]);router[_0x3be3('0x6')](_0x3be3('0x9'),auth[_0x3be3('0x7')](),controller[_0x3be3('0xa')]);router[_0x3be3('0x6')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x3be3('0xb')]);router[_0x3be3('0x6')](_0x3be3('0xc'),auth[_0x3be3('0x7')](),controller[_0x3be3('0xd')]);router[_0x3be3('0x6')](_0x3be3('0xe'),auth[_0x3be3('0x7')](),controller['getActions']);router[_0x3be3('0xf')]('/',auth[_0x3be3('0x7')](),controller['create']);router[_0x3be3('0xf')](_0x3be3('0x10'),auth[_0x3be3('0x7')](),controller[_0x3be3('0x11')]);router[_0x3be3('0xf')](_0x3be3('0xc'),auth['isAuthenticated'](),controller[_0x3be3('0x12')]);router[_0x3be3('0xf')](_0x3be3('0xe'),auth[_0x3be3('0x7')](),controller['addAction']);router[_0x3be3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3be3('0x14')]);router[_0x3be3('0x15')]('/:id',auth[_0x3be3('0x7')](),controller[_0x3be3('0x16')]);module[_0x3be3('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index e72a6db..4c91541 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 _0xf755=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e62eb,_0x2b864e){var _0x4b46a3=function(_0x5d62f5){while(--_0x5d62f5){_0x2e62eb['push'](_0x2e62eb['shift']());}};_0x4b46a3(++_0x2b864e);}(_0xf755,0x1a0));var _0x5f75=function(_0x3620ca,_0xf8144f){_0x3620ca=_0x3620ca-0x0;var _0x4dcf76=_0xf755[_0x3620ca];return _0x4dcf76;};'use strict';var Sequelize=require(_0x5f75('0x0'));module[_0x5f75('0x1')]={'name':{'type':Sequelize[_0x5f75('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5f75('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5633=['sequelize','STRING'];(function(_0xe364e3,_0x2091be){var _0x4c3bb2=function(_0x2eec07){while(--_0x2eec07){_0xe364e3['push'](_0xe364e3['shift']());}};_0x4c3bb2(++_0x2091be);}(_0x5633,0x190));var _0x3563=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x5633[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require(_0x3563('0x0'));module['exports']={'name':{'type':Sequelize[_0x3563('0x1')]},'channel':{'type':Sequelize[_0x3563('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index d244231..190314c 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 _0xaa9e=['apply','reject','save','update','then','destroy','get','Triggers','sendStatus','error','stack','send','index','map','Trigger','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','TriggerAnyId','Condition','getAllConditions','findOne','nolimit','getAnyConditions','pick','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range'];(function(_0xc64320,_0x5cf44e){var _0x4cb305=function(_0x2d8715){while(--_0x2d8715){_0xc64320['push'](_0xc64320['shift']());}};_0x4cb305(++_0x5cf44e);}(_0xaa9e,0x1b2));var _0xeaa9=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xaa9e[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require(_0xeaa9('0x0'));var rimraf=require(_0xeaa9('0x1'));var zipdir=require(_0xeaa9('0x2'));var jsonpatch=require(_0xeaa9('0x3'));var rp=require(_0xeaa9('0x4'));var moment=require(_0xeaa9('0x5'));var BPromise=require(_0xeaa9('0x6'));var Mustache=require(_0xeaa9('0x7'));var util=require(_0xeaa9('0x8'));var path=require(_0xeaa9('0x9'));var sox=require('sox');var csv=require(_0xeaa9('0xa'));var ejs=require(_0xeaa9('0xb'));var fs=require('fs');var fs_extra=require(_0xeaa9('0xc'));var _=require(_0xeaa9('0xd'));var squel=require(_0xeaa9('0xe'));var crypto=require(_0xeaa9('0xf'));var jsforce=require(_0xeaa9('0x10'));var deskjs=require(_0xeaa9('0x11'));var toCsv=require(_0xeaa9('0xa'));var querystring=require(_0xeaa9('0x12'));var Papa=require(_0xeaa9('0x13'));var Redis=require(_0xeaa9('0x14'));var authService=require(_0xeaa9('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xeaa9('0x16'));var hardwareService=require(_0xeaa9('0x17'));var logger=require(_0xeaa9('0x18'))('api');var utils=require(_0xeaa9('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeaa9('0x1a'))['db'];function respondWithStatusCode(_0x16e060,_0x101634){_0x101634=_0x101634||0xcc;return function(_0x45c482){if(_0x45c482){return _0x16e060['sendStatus'](_0x101634);}return _0x16e060['status'](_0x101634)[_0xeaa9('0x1b')]();};}function respondWithResult(_0x92badd,_0x301655){_0x301655=_0x301655||0xc8;return function(_0x106f57){if(_0x106f57){return _0x92badd['status'](_0x301655)[_0xeaa9('0x1c')](_0x106f57);}};}function respondWithFilteredResult(_0x4cf404,_0x41dd0d){return function(_0x36a4d5){if(_0x36a4d5){var _0x393e80=typeof _0x41dd0d[_0xeaa9('0x1d')]===_0xeaa9('0x1e')&&typeof _0x41dd0d['limit']===_0xeaa9('0x1e');var _0x131cb4=_0x36a4d5[_0xeaa9('0x1f')];var _0x37156b=_0x393e80?0x0:_0x41dd0d[_0xeaa9('0x1d')];var _0x2c9dbf=_0x393e80?_0x36a4d5[_0xeaa9('0x1f')]:_0x41dd0d[_0xeaa9('0x1d')]+_0x41dd0d[_0xeaa9('0x20')];var _0x38fd5f;if(_0x2c9dbf>=_0x131cb4){_0x2c9dbf=_0x131cb4;_0x38fd5f=0xc8;}else{_0x38fd5f=0xce;}_0x4cf404[_0xeaa9('0x21')](_0x38fd5f);return _0x4cf404[_0xeaa9('0x22')](_0xeaa9('0x23'),_0x37156b+'-'+_0x2c9dbf+'/'+_0x131cb4)[_0xeaa9('0x1c')](_0x36a4d5);}return null;};}function patchUpdates(_0x15fa11){return function(_0x3757dc){try{jsonpatch[_0xeaa9('0x24')](_0x3757dc,_0x15fa11,!![]);}catch(_0x4c5a15){return BPromise[_0xeaa9('0x25')](_0x4c5a15);}return _0x3757dc[_0xeaa9('0x26')]();};}function saveUpdates(_0xc9f8ac,_0x1bbc08){return function(_0x49f844){if(_0x49f844){return _0x49f844[_0xeaa9('0x27')](_0xc9f8ac)[_0xeaa9('0x28')](function(_0xae7fa){return _0xae7fa;});}return null;};}function removeEntity(_0x28a199,_0x58ba56){return function(_0x229e14){if(_0x229e14){return _0x229e14[_0xeaa9('0x29')]()[_0xeaa9('0x28')](function(){var _0x15aaf5=_0x229e14[_0xeaa9('0x2a')]({'plain':!![]});var _0x2a15c0=_0xeaa9('0x2b');return db['UserProfileResource'][_0xeaa9('0x29')]({'where':{'type':_0x2a15c0,'resourceId':_0x15aaf5['id']}})['then'](function(){return _0x229e14;});})[_0xeaa9('0x28')](function(){_0x28a199[_0xeaa9('0x21')](0xcc)[_0xeaa9('0x1b')]();});}};}function handleEntityNotFound(_0x5149d6,_0x354740){return function(_0x413a67){if(!_0x413a67){_0x5149d6[_0xeaa9('0x2c')](0x194);}return _0x413a67;};}function handleError(_0x315e1c,_0x15db99){_0x15db99=_0x15db99||0x1f4;return function(_0x44233e){logger[_0xeaa9('0x2d')](_0x44233e[_0xeaa9('0x2e')]);if(_0x44233e['name']){delete _0x44233e['name'];}_0x315e1c[_0xeaa9('0x21')](_0x15db99)[_0xeaa9('0x2f')](_0x44233e);};}exports[_0xeaa9('0x30')]=function(_0x417430,_0x44171e){var _0x4649b1={},_0x4ad12c={},_0x334a24={'count':0x0,'rows':[]};var _0x1388b0=_[_0xeaa9('0x31')](db[_0xeaa9('0x32')][_0xeaa9('0x33')],function(_0x5db2a0){return{'name':_0x5db2a0['fieldName'],'type':_0x5db2a0[_0xeaa9('0x34')][_0xeaa9('0x35')]};});_0x4ad12c[_0xeaa9('0x36')]=_[_0xeaa9('0x31')](_0x1388b0,_0xeaa9('0x37'));_0x4ad12c[_0xeaa9('0x38')]=_[_0xeaa9('0x39')](_0x417430[_0xeaa9('0x38')]);_0x4ad12c[_0xeaa9('0x3a')]=_[_0xeaa9('0x3b')](_0x4ad12c['model'],_0x4ad12c['query']);_0x4649b1[_0xeaa9('0x3c')]=_['intersection'](_0x4ad12c['model'],qs['fields'](_0x417430['query'][_0xeaa9('0x3d')]));_0x4649b1[_0xeaa9('0x3c')]=_0x4649b1[_0xeaa9('0x3c')][_0xeaa9('0x3e')]?_0x4649b1[_0xeaa9('0x3c')]:_0x4ad12c[_0xeaa9('0x36')];if(!_0x417430[_0xeaa9('0x38')][_0xeaa9('0x3f')]('nolimit')){_0x4649b1[_0xeaa9('0x20')]=qs[_0xeaa9('0x20')](_0x417430['query']['limit']);_0x4649b1[_0xeaa9('0x1d')]=qs[_0xeaa9('0x1d')](_0x417430[_0xeaa9('0x38')][_0xeaa9('0x1d')]);}_0x4649b1[_0xeaa9('0x40')]=qs[_0xeaa9('0x41')](_0x417430[_0xeaa9('0x38')][_0xeaa9('0x41')]);_0x4649b1[_0xeaa9('0x42')]=qs[_0xeaa9('0x3a')](_['pick'](_0x417430[_0xeaa9('0x38')],_0x4ad12c[_0xeaa9('0x3a')]),_0x1388b0);if(_0x417430['query']['filter']){_0x4649b1['where']=_[_0xeaa9('0x43')](_0x4649b1[_0xeaa9('0x42')],{'$or':_[_0xeaa9('0x31')](_0x1388b0,function(_0x5abcd0){if(_0x5abcd0[_0xeaa9('0x34')]!=='VIRTUAL'){var _0x5f5142={};_0x5f5142[_0x5abcd0[_0xeaa9('0x37')]]={'$like':'%'+_0x417430[_0xeaa9('0x38')][_0xeaa9('0x44')]+'%'};return _0x5f5142;}})});}_0x4649b1=_[_0xeaa9('0x43')]({},_0x4649b1,_0x417430[_0xeaa9('0x45')]);var _0xbbe91={'where':_0x4649b1[_0xeaa9('0x42')]};return db[_0xeaa9('0x32')]['count'](_0xbbe91)[_0xeaa9('0x28')](function(_0x1e62b5){_0x334a24[_0xeaa9('0x1f')]=_0x1e62b5;if(_0x417430[_0xeaa9('0x38')]['includeAll']){_0x4649b1[_0xeaa9('0x46')]=[{'all':!![]}];}return db[_0xeaa9('0x32')][_0xeaa9('0x47')](_0x4649b1);})['then'](function(_0x1605f3){_0x334a24['rows']=_0x1605f3;return _0x334a24;})[_0xeaa9('0x28')](respondWithFilteredResult(_0x44171e,_0x4649b1))[_0xeaa9('0x48')](handleError(_0x44171e,null));};exports[_0xeaa9('0x49')]=function(_0xecdf3d,_0x4cba23){var _0x388d7e={'raw':![],'where':{'id':_0xecdf3d[_0xeaa9('0x4a')]['id']}},_0x2de7f5={};_0x2de7f5['model']=_[_0xeaa9('0x39')](db[_0xeaa9('0x32')][_0xeaa9('0x33')]);_0x2de7f5[_0xeaa9('0x38')]=_[_0xeaa9('0x39')](_0xecdf3d[_0xeaa9('0x38')]);_0x2de7f5['filters']=_[_0xeaa9('0x3b')](_0x2de7f5[_0xeaa9('0x36')],_0x2de7f5[_0xeaa9('0x38')]);_0x388d7e[_0xeaa9('0x3c')]=_[_0xeaa9('0x3b')](_0x2de7f5[_0xeaa9('0x36')],qs[_0xeaa9('0x3d')](_0xecdf3d[_0xeaa9('0x38')]['fields']));_0x388d7e[_0xeaa9('0x3c')]=_0x388d7e['attributes'][_0xeaa9('0x3e')]?_0x388d7e[_0xeaa9('0x3c')]:_0x2de7f5['model'];if(_0xecdf3d[_0xeaa9('0x38')][_0xeaa9('0x4b')]){_0x388d7e[_0xeaa9('0x46')]=[{'all':!![]}];}_0x388d7e=_[_0xeaa9('0x43')]({},_0x388d7e,_0xecdf3d['options']);return db['Trigger'][_0xeaa9('0x4c')](_0x388d7e)['then'](handleEntityNotFound(_0x4cba23,null))[_0xeaa9('0x28')](respondWithResult(_0x4cba23,null))['catch'](handleError(_0x4cba23,null));};exports[_0xeaa9('0x4d')]=function(_0x3e2a43,_0x1d55f0){return db[_0xeaa9('0x32')][_0xeaa9('0x4d')](_0x3e2a43[_0xeaa9('0x4e')],{})[_0xeaa9('0x28')](function(_0x3bb7a1){var _0x3b7a25=_0x3e2a43[_0xeaa9('0x4f')][_0xeaa9('0x2a')]({'plain':!![]});if(!_0x3b7a25)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b7a25[_0xeaa9('0x50')]==='user'){var _0x1ea7aa=_0x3bb7a1[_0xeaa9('0x2a')]({'plain':!![]});var _0x64fcf0='Triggers';return db['UserProfileSection'][_0xeaa9('0x4c')]({'where':{'name':_0x64fcf0,'userProfileId':_0x3b7a25[_0xeaa9('0x51')]},'raw':!![]})[_0xeaa9('0x28')](function(_0x27bafd){if(_0x27bafd&&_0x27bafd[_0xeaa9('0x52')]===0x0){return db[_0xeaa9('0x53')][_0xeaa9('0x4d')]({'name':_0x1ea7aa[_0xeaa9('0x37')],'resourceId':_0x1ea7aa['id'],'type':_0x27bafd[_0xeaa9('0x37')],'sectionId':_0x27bafd['id']},{})[_0xeaa9('0x28')](function(){return _0x3bb7a1;});}else{return _0x3bb7a1;}})[_0xeaa9('0x48')](function(_0x1cdf17){logger[_0xeaa9('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cdf17);throw _0x1cdf17;});}return _0x3bb7a1;})[_0xeaa9('0x28')](respondWithResult(_0x1d55f0,0xc9))[_0xeaa9('0x48')](handleError(_0x1d55f0,null));};exports['update']=function(_0x2c0fad,_0x426df6){if(_0x2c0fad[_0xeaa9('0x4e')]['id']){delete _0x2c0fad[_0xeaa9('0x4e')]['id'];}return db[_0xeaa9('0x32')][_0xeaa9('0x4c')]({'where':{'id':_0x2c0fad[_0xeaa9('0x4a')]['id']}})[_0xeaa9('0x28')](handleEntityNotFound(_0x426df6,null))[_0xeaa9('0x28')](saveUpdates(_0x2c0fad['body'],null))[_0xeaa9('0x28')](respondWithResult(_0x426df6,null))[_0xeaa9('0x48')](handleError(_0x426df6,null));};exports[_0xeaa9('0x29')]=function(_0x5a4c1f,_0x21e558){return db[_0xeaa9('0x32')][_0xeaa9('0x4c')]({'where':{'id':_0x5a4c1f[_0xeaa9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21e558,null))[_0xeaa9('0x28')](removeEntity(_0x21e558,null))[_0xeaa9('0x48')](handleError(_0x21e558,null));};exports['addAllCondition']=function(_0x85d078,_0x2a04a5,_0x1c75e8){if(_0x85d078['body']['id']){delete _0x85d078[_0xeaa9('0x4e')]['id'];}return db[_0xeaa9('0x32')][_0xeaa9('0x4c')]({'where':{'id':_0x85d078[_0xeaa9('0x4a')]['id']}})[_0xeaa9('0x28')](handleEntityNotFound(_0x2a04a5,null))[_0xeaa9('0x28')](function(_0xd9fa36){if(_0xd9fa36){_0x85d078['body']['TriggerAllId']=_0xd9fa36['id'];return db['Condition'][_0xeaa9('0x4d')](_0x85d078[_0xeaa9('0x4e')]);}})['then'](respondWithResult(_0x2a04a5,null))['catch'](handleError(_0x2a04a5,null));};exports['addAnyCondition']=function(_0x2732b3,_0x55c88e,_0x574fad){if(_0x2732b3['body']['id']){delete _0x2732b3['body']['id'];}return db[_0xeaa9('0x32')]['find']({'where':{'id':_0x2732b3[_0xeaa9('0x4a')]['id']}})[_0xeaa9('0x28')](handleEntityNotFound(_0x55c88e,null))[_0xeaa9('0x28')](function(_0x16314e){if(_0x16314e){_0x2732b3['body'][_0xeaa9('0x54')]=_0x16314e['id'];return db[_0xeaa9('0x55')][_0xeaa9('0x4d')](_0x2732b3[_0xeaa9('0x4e')]);}})[_0xeaa9('0x28')](respondWithResult(_0x55c88e,null))[_0xeaa9('0x48')](handleError(_0x55c88e,null));};exports[_0xeaa9('0x56')]=function(_0x1ab247,_0x15d4be,_0x3d4632){var _0x1ab04d={};var _0x3082cd={};var _0x496d09;var _0x225457;return db[_0xeaa9('0x32')][_0xeaa9('0x57')]({'where':{'id':_0x1ab247['params']['id']}})['then'](handleEntityNotFound(_0x15d4be,null))[_0xeaa9('0x28')](function(_0x195289){if(_0x195289){_0x496d09=_0x195289;_0x3082cd['model']=_['keys'](db['Condition'][_0xeaa9('0x33')]);_0x3082cd[_0xeaa9('0x38')]=_[_0xeaa9('0x39')](_0x1ab247['query']);_0x3082cd[_0xeaa9('0x3a')]=_[_0xeaa9('0x3b')](_0x3082cd['model'],_0x3082cd[_0xeaa9('0x38')]);_0x1ab04d[_0xeaa9('0x3c')]=_['intersection'](_0x3082cd[_0xeaa9('0x36')],qs['fields'](_0x1ab247['query'][_0xeaa9('0x3d')]));_0x1ab04d[_0xeaa9('0x3c')]=_0x1ab04d['attributes'][_0xeaa9('0x3e')]?_0x1ab04d['attributes']:_0x3082cd[_0xeaa9('0x36')];_0x1ab04d[_0xeaa9('0x40')]=qs[_0xeaa9('0x41')](_0x1ab247[_0xeaa9('0x38')][_0xeaa9('0x41')]);_0x1ab04d[_0xeaa9('0x42')]=qs[_0xeaa9('0x3a')](_['pick'](_0x1ab247[_0xeaa9('0x38')],_0x3082cd[_0xeaa9('0x3a')]));if(_0x1ab247['query'][_0xeaa9('0x44')]){_0x1ab04d[_0xeaa9('0x42')]=_[_0xeaa9('0x43')](_0x1ab04d[_0xeaa9('0x42')],{'$or':_[_0xeaa9('0x31')](_0x1ab04d[_0xeaa9('0x3c')],function(_0xbeb5de){var _0xa9d0c2={};_0xa9d0c2[_0xbeb5de]={'$like':'%'+_0x1ab247['query'][_0xeaa9('0x44')]+'%'};return _0xa9d0c2;})});}_0x1ab04d=_[_0xeaa9('0x43')]({},_0x1ab04d,_0x1ab247[_0xeaa9('0x45')]);return _0x496d09['getAllConditions'](_0x1ab04d);}})['then'](function(_0x7b653e){if(_0x7b653e){_0x225457=_0x7b653e[_0xeaa9('0x3e')];if(!_0x1ab247[_0xeaa9('0x38')]['hasOwnProperty'](_0xeaa9('0x58'))){_0x1ab04d[_0xeaa9('0x20')]=qs[_0xeaa9('0x20')](_0x1ab247[_0xeaa9('0x38')][_0xeaa9('0x20')]);_0x1ab04d['offset']=qs[_0xeaa9('0x1d')](_0x1ab247['query'][_0xeaa9('0x1d')]);}return _0x496d09[_0xeaa9('0x56')](_0x1ab04d);}})['then'](function(_0x2b0deb){if(_0x2b0deb){return _0x2b0deb?{'count':_0x225457,'rows':_0x2b0deb}:null;}})[_0xeaa9('0x28')](respondWithResult(_0x15d4be,null))[_0xeaa9('0x48')](handleError(_0x15d4be,null));};exports[_0xeaa9('0x59')]=function(_0x3175e0,_0x2aeeba,_0x4c9a19){var _0x3f41ab={};var _0x3b3889={};var _0x52423c;var _0x41375c;return db[_0xeaa9('0x32')][_0xeaa9('0x57')]({'where':{'id':_0x3175e0[_0xeaa9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2aeeba,null))[_0xeaa9('0x28')](function(_0x10d423){if(_0x10d423){_0x52423c=_0x10d423;_0x3b3889[_0xeaa9('0x36')]=_[_0xeaa9('0x39')](db['Condition']['rawAttributes']);_0x3b3889[_0xeaa9('0x38')]=_[_0xeaa9('0x39')](_0x3175e0['query']);_0x3b3889[_0xeaa9('0x3a')]=_[_0xeaa9('0x3b')](_0x3b3889['model'],_0x3b3889[_0xeaa9('0x38')]);_0x3f41ab[_0xeaa9('0x3c')]=_['intersection'](_0x3b3889['model'],qs['fields'](_0x3175e0[_0xeaa9('0x38')][_0xeaa9('0x3d')]));_0x3f41ab[_0xeaa9('0x3c')]=_0x3f41ab['attributes'][_0xeaa9('0x3e')]?_0x3f41ab[_0xeaa9('0x3c')]:_0x3b3889[_0xeaa9('0x36')];_0x3f41ab[_0xeaa9('0x40')]=qs[_0xeaa9('0x41')](_0x3175e0[_0xeaa9('0x38')][_0xeaa9('0x41')]);_0x3f41ab[_0xeaa9('0x42')]=qs['filters'](_[_0xeaa9('0x5a')](_0x3175e0[_0xeaa9('0x38')],_0x3b3889['filters']));if(_0x3175e0['query'][_0xeaa9('0x44')]){_0x3f41ab['where']=_[_0xeaa9('0x43')](_0x3f41ab['where'],{'$or':_[_0xeaa9('0x31')](_0x3f41ab[_0xeaa9('0x3c')],function(_0x4344f2){var _0x1634a2={};_0x1634a2[_0x4344f2]={'$like':'%'+_0x3175e0['query'][_0xeaa9('0x44')]+'%'};return _0x1634a2;})});}_0x3f41ab=_[_0xeaa9('0x43')]({},_0x3f41ab,_0x3175e0[_0xeaa9('0x45')]);return _0x52423c[_0xeaa9('0x59')](_0x3f41ab);}})[_0xeaa9('0x28')](function(_0x4b5ac8){if(_0x4b5ac8){_0x41375c=_0x4b5ac8[_0xeaa9('0x3e')];if(!_0x3175e0['query'][_0xeaa9('0x3f')](_0xeaa9('0x58'))){_0x3f41ab[_0xeaa9('0x20')]=qs[_0xeaa9('0x20')](_0x3175e0[_0xeaa9('0x38')][_0xeaa9('0x20')]);_0x3f41ab[_0xeaa9('0x1d')]=qs['offset'](_0x3175e0[_0xeaa9('0x38')]['offset']);}return _0x52423c[_0xeaa9('0x59')](_0x3f41ab);}})[_0xeaa9('0x28')](function(_0x1ba8db){if(_0x1ba8db){return _0x1ba8db?{'count':_0x41375c,'rows':_0x1ba8db}:null;}})['then'](respondWithResult(_0x2aeeba,null))[_0xeaa9('0x48')](handleError(_0x2aeeba,null));};exports['addAction']=function(_0x2f2b73,_0x2edca9,_0x10fce2){if(_0x2f2b73[_0xeaa9('0x4e')]['id']){delete _0x2f2b73[_0xeaa9('0x4e')]['id'];}return db['Trigger'][_0xeaa9('0x4c')]({'where':{'id':_0x2f2b73[_0xeaa9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2edca9,null))['then'](function(_0x1a1fe9){if(_0x1a1fe9){_0x2f2b73['body'][_0xeaa9('0x5b')]=_0x1a1fe9['id'];return db[_0xeaa9('0x5c')][_0xeaa9('0x4d')](_0x2f2b73[_0xeaa9('0x4e')]);}})['then'](respondWithResult(_0x2edca9,null))[_0xeaa9('0x48')](handleError(_0x2edca9,null));};exports[_0xeaa9('0x5d')]=function(_0x282845,_0xa5b6d5,_0x1a0804){var _0x3bbd83={};var _0x9599bc={};var _0xdedae2;var _0x2e670d;return db['Trigger'][_0xeaa9('0x57')]({'where':{'id':_0x282845[_0xeaa9('0x4a')]['id']}})[_0xeaa9('0x28')](handleEntityNotFound(_0xa5b6d5,null))['then'](function(_0x2a04c3){if(_0x2a04c3){_0xdedae2=_0x2a04c3;_0x9599bc['model']=_[_0xeaa9('0x39')](db[_0xeaa9('0x5c')][_0xeaa9('0x33')]);_0x9599bc['query']=_[_0xeaa9('0x39')](_0x282845[_0xeaa9('0x38')]);_0x9599bc[_0xeaa9('0x3a')]=_[_0xeaa9('0x3b')](_0x9599bc[_0xeaa9('0x36')],_0x9599bc[_0xeaa9('0x38')]);_0x3bbd83[_0xeaa9('0x3c')]=_[_0xeaa9('0x3b')](_0x9599bc['model'],qs[_0xeaa9('0x3d')](_0x282845[_0xeaa9('0x38')][_0xeaa9('0x3d')]));_0x3bbd83['attributes']=_0x3bbd83['attributes'][_0xeaa9('0x3e')]?_0x3bbd83[_0xeaa9('0x3c')]:_0x9599bc[_0xeaa9('0x36')];_0x3bbd83[_0xeaa9('0x40')]=qs[_0xeaa9('0x41')](_0x282845[_0xeaa9('0x38')][_0xeaa9('0x41')]);_0x3bbd83['where']=qs[_0xeaa9('0x3a')](_[_0xeaa9('0x5a')](_0x282845[_0xeaa9('0x38')],_0x9599bc[_0xeaa9('0x3a')]));if(_0x282845['query']['filter']){_0x3bbd83[_0xeaa9('0x42')]=_['merge'](_0x3bbd83[_0xeaa9('0x42')],{'$or':_[_0xeaa9('0x31')](_0x3bbd83['attributes'],function(_0x5ca025){var _0x4930e6={};_0x4930e6[_0x5ca025]={'$like':'%'+_0x282845[_0xeaa9('0x38')][_0xeaa9('0x44')]+'%'};return _0x4930e6;})});}_0x3bbd83=_[_0xeaa9('0x43')]({},_0x3bbd83,_0x282845[_0xeaa9('0x45')]);return _0xdedae2[_0xeaa9('0x5d')](_0x3bbd83);}})['then'](function(_0x3251d7){if(_0x3251d7){_0x2e670d=_0x3251d7[_0xeaa9('0x3e')];if(!_0x282845[_0xeaa9('0x38')][_0xeaa9('0x3f')]('nolimit')){_0x3bbd83[_0xeaa9('0x20')]=qs[_0xeaa9('0x20')](_0x282845[_0xeaa9('0x38')]['limit']);_0x3bbd83[_0xeaa9('0x1d')]=qs[_0xeaa9('0x1d')](_0x282845['query']['offset']);}return _0xdedae2[_0xeaa9('0x5d')](_0x3bbd83);}})[_0xeaa9('0x28')](function(_0x455009){if(_0x455009){return _0x455009?{'count':_0x2e670d,'rows':_0x455009}:null;}})[_0xeaa9('0x28')](respondWithResult(_0xa5b6d5,null))[_0xeaa9('0x48')](handleError(_0xa5b6d5,null));}; \ No newline at end of file +var _0x11cb=['destroy','get','UserProfileResource','then','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','rows','params','keys','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','length','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x4f0d4d,_0x3f99ae){var _0x1b5e1e=function(_0x3d2c8a){while(--_0x3d2c8a){_0x4f0d4d['push'](_0x4f0d4d['shift']());}};_0x1b5e1e(++_0x3f99ae);}(_0x11cb,0xfc));var _0xb11c=function(_0x3d02e0,_0x28dec7){_0x3d02e0=_0x3d02e0-0x0;var _0x382af5=_0x11cb[_0x3d02e0];return _0x382af5;};'use strict';var emlformat=require(_0xb11c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb11c('0x1'));var jsonpatch=require(_0xb11c('0x2'));var rp=require('request-promise');var moment=require(_0xb11c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb11c('0x4'));var util=require(_0xb11c('0x5'));var path=require(_0xb11c('0x6'));var sox=require(_0xb11c('0x7'));var csv=require(_0xb11c('0x8'));var ejs=require(_0xb11c('0x9'));var fs=require('fs');var fs_extra=require(_0xb11c('0xa'));var _=require(_0xb11c('0xb'));var squel=require(_0xb11c('0xc'));var crypto=require(_0xb11c('0xd'));var jsforce=require(_0xb11c('0xe'));var deskjs=require(_0xb11c('0xf'));var toCsv=require(_0xb11c('0x8'));var querystring=require(_0xb11c('0x10'));var Papa=require(_0xb11c('0x11'));var Redis=require(_0xb11c('0x12'));var authService=require(_0xb11c('0x13'));var qs=require(_0xb11c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb11c('0x15'));var logger=require(_0xb11c('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb11c('0x17'))['db'];function respondWithStatusCode(_0xd6bdd2,_0x3a4259){_0x3a4259=_0x3a4259||0xcc;return function(_0x263762){if(_0x263762){return _0xd6bdd2[_0xb11c('0x18')](_0x3a4259);}return _0xd6bdd2[_0xb11c('0x19')](_0x3a4259)[_0xb11c('0x1a')]();};}function respondWithResult(_0xa30130,_0x2635a9){_0x2635a9=_0x2635a9||0xc8;return function(_0x2dd42b){if(_0x2dd42b){return _0xa30130[_0xb11c('0x19')](_0x2635a9)['json'](_0x2dd42b);}};}function respondWithFilteredResult(_0x10e988,_0x410abf){return function(_0x37148d){if(_0x37148d){var _0x4b0e5d=typeof _0x410abf[_0xb11c('0x1b')]===_0xb11c('0x1c')&&typeof _0x410abf[_0xb11c('0x1d')]==='undefined';var _0x179d1b=_0x37148d[_0xb11c('0x1e')];var _0x17feb8=_0x4b0e5d?0x0:_0x410abf[_0xb11c('0x1b')];var _0x9565dc=_0x4b0e5d?_0x37148d[_0xb11c('0x1e')]:_0x410abf['offset']+_0x410abf[_0xb11c('0x1d')];var _0xcf35c5;if(_0x9565dc>=_0x179d1b){_0x9565dc=_0x179d1b;_0xcf35c5=0xc8;}else{_0xcf35c5=0xce;}_0x10e988[_0xb11c('0x19')](_0xcf35c5);return _0x10e988[_0xb11c('0x1f')](_0xb11c('0x20'),_0x17feb8+'-'+_0x9565dc+'/'+_0x179d1b)['json'](_0x37148d);}return null;};}function patchUpdates(_0x22de1f){return function(_0x4ae7a0){try{jsonpatch[_0xb11c('0x21')](_0x4ae7a0,_0x22de1f,!![]);}catch(_0x37b4df){return BPromise[_0xb11c('0x22')](_0x37b4df);}return _0x4ae7a0['save']();};}function saveUpdates(_0x4cb905,_0x5b3b3e){return function(_0x3ad9c4){if(_0x3ad9c4){return _0x3ad9c4[_0xb11c('0x23')](_0x4cb905)['then'](function(_0x4b9983){return _0x4b9983;});}return null;};}function removeEntity(_0x6f39a1,_0x542902){return function(_0x50d9d6){if(_0x50d9d6){return _0x50d9d6[_0xb11c('0x24')]()['then'](function(){var _0xd91e62=_0x50d9d6[_0xb11c('0x25')]({'plain':!![]});var _0x14b1a8='Triggers';return db[_0xb11c('0x26')][_0xb11c('0x24')]({'where':{'type':_0x14b1a8,'resourceId':_0xd91e62['id']}})[_0xb11c('0x27')](function(){return _0x50d9d6;});})[_0xb11c('0x27')](function(){_0x6f39a1[_0xb11c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bc947,_0x342512){return function(_0x34075b){if(!_0x34075b){_0x3bc947[_0xb11c('0x18')](0x194);}return _0x34075b;};}function handleError(_0x5e67fb,_0x498073){_0x498073=_0x498073||0x1f4;return function(_0x23757a){logger[_0xb11c('0x28')](_0x23757a[_0xb11c('0x29')]);if(_0x23757a['name']){delete _0x23757a[_0xb11c('0x2a')];}_0x5e67fb[_0xb11c('0x19')](_0x498073)[_0xb11c('0x2b')](_0x23757a);};}exports[_0xb11c('0x2c')]=function(_0xcdfa3,_0x35e389){var _0x4b21c9={},_0x2c9095={},_0x29cee9={'count':0x0,'rows':[]};var _0x299ab0=_[_0xb11c('0x2d')](db[_0xb11c('0x2e')][_0xb11c('0x2f')],function(_0x53d812){return{'name':_0x53d812[_0xb11c('0x30')],'type':_0x53d812[_0xb11c('0x31')][_0xb11c('0x32')]};});_0x2c9095[_0xb11c('0x33')]=_['map'](_0x299ab0,'name');_0x2c9095[_0xb11c('0x34')]=_['keys'](_0xcdfa3[_0xb11c('0x34')]);_0x2c9095[_0xb11c('0x35')]=_[_0xb11c('0x36')](_0x2c9095[_0xb11c('0x33')],_0x2c9095[_0xb11c('0x34')]);_0x4b21c9[_0xb11c('0x37')]=_[_0xb11c('0x36')](_0x2c9095['model'],qs[_0xb11c('0x38')](_0xcdfa3[_0xb11c('0x34')]['fields']));_0x4b21c9['attributes']=_0x4b21c9[_0xb11c('0x37')]['length']?_0x4b21c9[_0xb11c('0x37')]:_0x2c9095[_0xb11c('0x33')];if(!_0xcdfa3[_0xb11c('0x34')][_0xb11c('0x39')](_0xb11c('0x3a'))){_0x4b21c9[_0xb11c('0x1d')]=qs[_0xb11c('0x1d')](_0xcdfa3[_0xb11c('0x34')][_0xb11c('0x1d')]);_0x4b21c9[_0xb11c('0x1b')]=qs['offset'](_0xcdfa3[_0xb11c('0x34')][_0xb11c('0x1b')]);}_0x4b21c9[_0xb11c('0x3b')]=qs[_0xb11c('0x3c')](_0xcdfa3[_0xb11c('0x34')][_0xb11c('0x3c')]);_0x4b21c9['where']=qs[_0xb11c('0x35')](_[_0xb11c('0x3d')](_0xcdfa3[_0xb11c('0x34')],_0x2c9095['filters']),_0x299ab0);if(_0xcdfa3[_0xb11c('0x34')]['filter']){_0x4b21c9['where']=_[_0xb11c('0x3e')](_0x4b21c9[_0xb11c('0x3f')],{'$or':_[_0xb11c('0x2d')](_0x299ab0,function(_0x3d5f39){if(_0x3d5f39[_0xb11c('0x31')]!==_0xb11c('0x40')){var _0x5c1ff2={};_0x5c1ff2[_0x3d5f39['name']]={'$like':'%'+_0xcdfa3[_0xb11c('0x34')][_0xb11c('0x41')]+'%'};return _0x5c1ff2;}})});}_0x4b21c9=_['merge']({},_0x4b21c9,_0xcdfa3[_0xb11c('0x42')]);var _0x2a6b57={'where':_0x4b21c9[_0xb11c('0x3f')]};return db['Trigger'][_0xb11c('0x1e')](_0x2a6b57)[_0xb11c('0x27')](function(_0xd529c6){_0x29cee9['count']=_0xd529c6;if(_0xcdfa3[_0xb11c('0x34')]['includeAll']){_0x4b21c9['include']=[{'all':!![]}];}return db[_0xb11c('0x2e')]['findAll'](_0x4b21c9);})[_0xb11c('0x27')](function(_0x405e4a){_0x29cee9[_0xb11c('0x43')]=_0x405e4a;return _0x29cee9;})[_0xb11c('0x27')](respondWithFilteredResult(_0x35e389,_0x4b21c9))['catch'](handleError(_0x35e389,null));};exports['show']=function(_0x359a98,_0x16e6b6){var _0x4bcc8d={'raw':![],'where':{'id':_0x359a98[_0xb11c('0x44')]['id']}},_0x2c641f={};_0x2c641f[_0xb11c('0x33')]=_['keys'](db[_0xb11c('0x2e')][_0xb11c('0x2f')]);_0x2c641f[_0xb11c('0x34')]=_[_0xb11c('0x45')](_0x359a98['query']);_0x2c641f[_0xb11c('0x35')]=_[_0xb11c('0x36')](_0x2c641f[_0xb11c('0x33')],_0x2c641f[_0xb11c('0x34')]);_0x4bcc8d[_0xb11c('0x37')]=_[_0xb11c('0x36')](_0x2c641f[_0xb11c('0x33')],qs[_0xb11c('0x38')](_0x359a98[_0xb11c('0x34')][_0xb11c('0x38')]));_0x4bcc8d['attributes']=_0x4bcc8d[_0xb11c('0x37')]['length']?_0x4bcc8d[_0xb11c('0x37')]:_0x2c641f[_0xb11c('0x33')];if(_0x359a98[_0xb11c('0x34')][_0xb11c('0x46')]){_0x4bcc8d[_0xb11c('0x47')]=[{'all':!![]}];}_0x4bcc8d=_[_0xb11c('0x3e')]({},_0x4bcc8d,_0x359a98[_0xb11c('0x42')]);return db[_0xb11c('0x2e')][_0xb11c('0x48')](_0x4bcc8d)[_0xb11c('0x27')](handleEntityNotFound(_0x16e6b6,null))[_0xb11c('0x27')](respondWithResult(_0x16e6b6,null))[_0xb11c('0x49')](handleError(_0x16e6b6,null));};exports[_0xb11c('0x4a')]=function(_0x55cd57,_0x3c879c){return db[_0xb11c('0x2e')]['create'](_0x55cd57[_0xb11c('0x4b')],{})[_0xb11c('0x27')](function(_0x51b065){var _0xde8053=_0x55cd57[_0xb11c('0x4c')]['get']({'plain':!![]});if(!_0xde8053)throw new Error(_0xb11c('0x4d'));if(_0xde8053[_0xb11c('0x4e')]===_0xb11c('0x4c')){var _0x4b0fcf=_0x51b065[_0xb11c('0x25')]({'plain':!![]});var _0x249344=_0xb11c('0x4f');return db[_0xb11c('0x50')][_0xb11c('0x48')]({'where':{'name':_0x249344,'userProfileId':_0xde8053[_0xb11c('0x51')]},'raw':!![]})[_0xb11c('0x27')](function(_0x55edd3){if(_0x55edd3&&_0x55edd3[_0xb11c('0x52')]===0x0){return db[_0xb11c('0x26')][_0xb11c('0x4a')]({'name':_0x4b0fcf[_0xb11c('0x2a')],'resourceId':_0x4b0fcf['id'],'type':_0x55edd3[_0xb11c('0x2a')],'sectionId':_0x55edd3['id']},{})[_0xb11c('0x27')](function(){return _0x51b065;});}else{return _0x51b065;}})[_0xb11c('0x49')](function(_0x3d1f91){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d1f91);throw _0x3d1f91;});}return _0x51b065;})[_0xb11c('0x27')](respondWithResult(_0x3c879c,0xc9))['catch'](handleError(_0x3c879c,null));};exports[_0xb11c('0x23')]=function(_0x2bd64b,_0x4f201a){if(_0x2bd64b[_0xb11c('0x4b')]['id']){delete _0x2bd64b['body']['id'];}return db[_0xb11c('0x2e')]['find']({'where':{'id':_0x2bd64b[_0xb11c('0x44')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x4f201a,null))[_0xb11c('0x27')](saveUpdates(_0x2bd64b['body'],null))[_0xb11c('0x27')](respondWithResult(_0x4f201a,null))['catch'](handleError(_0x4f201a,null));};exports[_0xb11c('0x24')]=function(_0x27a44a,_0x10ccf7){return db['Trigger'][_0xb11c('0x48')]({'where':{'id':_0x27a44a['params']['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x10ccf7,null))[_0xb11c('0x27')](removeEntity(_0x10ccf7,null))[_0xb11c('0x49')](handleError(_0x10ccf7,null));};exports[_0xb11c('0x53')]=function(_0x10685b,_0x57f045,_0x2a7843){if(_0x10685b[_0xb11c('0x4b')]['id']){delete _0x10685b['body']['id'];}return db['Trigger'][_0xb11c('0x48')]({'where':{'id':_0x10685b[_0xb11c('0x44')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x57f045,null))[_0xb11c('0x27')](function(_0x48495d){if(_0x48495d){_0x10685b['body'][_0xb11c('0x54')]=_0x48495d['id'];return db[_0xb11c('0x55')]['create'](_0x10685b[_0xb11c('0x4b')]);}})[_0xb11c('0x27')](respondWithResult(_0x57f045,null))[_0xb11c('0x49')](handleError(_0x57f045,null));};exports[_0xb11c('0x56')]=function(_0x594d9a,_0x147a33,_0x14a72e){if(_0x594d9a[_0xb11c('0x4b')]['id']){delete _0x594d9a['body']['id'];}return db[_0xb11c('0x2e')]['find']({'where':{'id':_0x594d9a[_0xb11c('0x44')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x147a33,null))[_0xb11c('0x27')](function(_0x5cd144){if(_0x5cd144){_0x594d9a[_0xb11c('0x4b')][_0xb11c('0x57')]=_0x5cd144['id'];return db['Condition'][_0xb11c('0x4a')](_0x594d9a['body']);}})[_0xb11c('0x27')](respondWithResult(_0x147a33,null))[_0xb11c('0x49')](handleError(_0x147a33,null));};exports[_0xb11c('0x58')]=function(_0x170dbd,_0x1e08eb,_0x9d67c5){var _0x47be8c={};var _0x5e11c5={};var _0x5f1004;var _0xb302df;return db[_0xb11c('0x2e')]['findOne']({'where':{'id':_0x170dbd['params']['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x1e08eb,null))[_0xb11c('0x27')](function(_0x18b920){if(_0x18b920){_0x5f1004=_0x18b920;_0x5e11c5[_0xb11c('0x33')]=_[_0xb11c('0x45')](db[_0xb11c('0x55')]['rawAttributes']);_0x5e11c5['query']=_[_0xb11c('0x45')](_0x170dbd[_0xb11c('0x34')]);_0x5e11c5[_0xb11c('0x35')]=_[_0xb11c('0x36')](_0x5e11c5[_0xb11c('0x33')],_0x5e11c5[_0xb11c('0x34')]);_0x47be8c['attributes']=_[_0xb11c('0x36')](_0x5e11c5[_0xb11c('0x33')],qs[_0xb11c('0x38')](_0x170dbd[_0xb11c('0x34')]['fields']));_0x47be8c[_0xb11c('0x37')]=_0x47be8c[_0xb11c('0x37')]['length']?_0x47be8c[_0xb11c('0x37')]:_0x5e11c5['model'];_0x47be8c[_0xb11c('0x3b')]=qs[_0xb11c('0x3c')](_0x170dbd[_0xb11c('0x34')][_0xb11c('0x3c')]);_0x47be8c[_0xb11c('0x3f')]=qs[_0xb11c('0x35')](_[_0xb11c('0x3d')](_0x170dbd[_0xb11c('0x34')],_0x5e11c5['filters']));if(_0x170dbd[_0xb11c('0x34')]['filter']){_0x47be8c[_0xb11c('0x3f')]=_[_0xb11c('0x3e')](_0x47be8c[_0xb11c('0x3f')],{'$or':_[_0xb11c('0x2d')](_0x47be8c[_0xb11c('0x37')],function(_0x409174){var _0x2cdaa7={};_0x2cdaa7[_0x409174]={'$like':'%'+_0x170dbd[_0xb11c('0x34')][_0xb11c('0x41')]+'%'};return _0x2cdaa7;})});}_0x47be8c=_['merge']({},_0x47be8c,_0x170dbd[_0xb11c('0x42')]);return _0x5f1004['getAllConditions'](_0x47be8c);}})[_0xb11c('0x27')](function(_0x5acb12){if(_0x5acb12){_0xb302df=_0x5acb12[_0xb11c('0x59')];if(!_0x170dbd[_0xb11c('0x34')]['hasOwnProperty']('nolimit')){_0x47be8c['limit']=qs[_0xb11c('0x1d')](_0x170dbd['query']['limit']);_0x47be8c[_0xb11c('0x1b')]=qs['offset'](_0x170dbd[_0xb11c('0x34')][_0xb11c('0x1b')]);}return _0x5f1004['getAllConditions'](_0x47be8c);}})[_0xb11c('0x27')](function(_0x38606a){if(_0x38606a){return _0x38606a?{'count':_0xb302df,'rows':_0x38606a}:null;}})[_0xb11c('0x27')](respondWithResult(_0x1e08eb,null))[_0xb11c('0x49')](handleError(_0x1e08eb,null));};exports[_0xb11c('0x5a')]=function(_0x5c36f6,_0x315754,_0x4c2dea){var _0x84d214={};var _0x38d576={};var _0x84fa3;var _0x68f9fb;return db[_0xb11c('0x2e')][_0xb11c('0x5b')]({'where':{'id':_0x5c36f6[_0xb11c('0x44')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x315754,null))[_0xb11c('0x27')](function(_0x153495){if(_0x153495){_0x84fa3=_0x153495;_0x38d576[_0xb11c('0x33')]=_['keys'](db[_0xb11c('0x55')][_0xb11c('0x2f')]);_0x38d576[_0xb11c('0x34')]=_['keys'](_0x5c36f6[_0xb11c('0x34')]);_0x38d576[_0xb11c('0x35')]=_['intersection'](_0x38d576[_0xb11c('0x33')],_0x38d576[_0xb11c('0x34')]);_0x84d214[_0xb11c('0x37')]=_[_0xb11c('0x36')](_0x38d576[_0xb11c('0x33')],qs[_0xb11c('0x38')](_0x5c36f6['query'][_0xb11c('0x38')]));_0x84d214[_0xb11c('0x37')]=_0x84d214[_0xb11c('0x37')][_0xb11c('0x59')]?_0x84d214[_0xb11c('0x37')]:_0x38d576[_0xb11c('0x33')];_0x84d214[_0xb11c('0x3b')]=qs[_0xb11c('0x3c')](_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x3c')]);_0x84d214[_0xb11c('0x3f')]=qs[_0xb11c('0x35')](_['pick'](_0x5c36f6['query'],_0x38d576[_0xb11c('0x35')]));if(_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x41')]){_0x84d214[_0xb11c('0x3f')]=_[_0xb11c('0x3e')](_0x84d214[_0xb11c('0x3f')],{'$or':_[_0xb11c('0x2d')](_0x84d214[_0xb11c('0x37')],function(_0x3740ef){var _0xf9060d={};_0xf9060d[_0x3740ef]={'$like':'%'+_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x41')]+'%'};return _0xf9060d;})});}_0x84d214=_[_0xb11c('0x3e')]({},_0x84d214,_0x5c36f6[_0xb11c('0x42')]);return _0x84fa3[_0xb11c('0x5a')](_0x84d214);}})[_0xb11c('0x27')](function(_0x48ab37){if(_0x48ab37){_0x68f9fb=_0x48ab37[_0xb11c('0x59')];if(!_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x39')](_0xb11c('0x3a'))){_0x84d214[_0xb11c('0x1d')]=qs[_0xb11c('0x1d')](_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x1d')]);_0x84d214['offset']=qs[_0xb11c('0x1b')](_0x5c36f6[_0xb11c('0x34')][_0xb11c('0x1b')]);}return _0x84fa3[_0xb11c('0x5a')](_0x84d214);}})[_0xb11c('0x27')](function(_0x3c8b8d){if(_0x3c8b8d){return _0x3c8b8d?{'count':_0x68f9fb,'rows':_0x3c8b8d}:null;}})[_0xb11c('0x27')](respondWithResult(_0x315754,null))[_0xb11c('0x49')](handleError(_0x315754,null));};exports[_0xb11c('0x5c')]=function(_0x156d89,_0x3a3e24,_0x37a1db){if(_0x156d89[_0xb11c('0x4b')]['id']){delete _0x156d89[_0xb11c('0x4b')]['id'];}return db[_0xb11c('0x2e')]['find']({'where':{'id':_0x156d89['params']['id']}})['then'](handleEntityNotFound(_0x3a3e24,null))[_0xb11c('0x27')](function(_0x18c56f){if(_0x18c56f){_0x156d89[_0xb11c('0x4b')][_0xb11c('0x5d')]=_0x18c56f['id'];return db[_0xb11c('0x5e')][_0xb11c('0x4a')](_0x156d89[_0xb11c('0x4b')]);}})[_0xb11c('0x27')](respondWithResult(_0x3a3e24,null))[_0xb11c('0x49')](handleError(_0x3a3e24,null));};exports[_0xb11c('0x5f')]=function(_0x1dad95,_0x591b82,_0x1ac548){var _0x9408e7={};var _0x1595c2={};var _0x19b211;var _0x496195;return db['Trigger'][_0xb11c('0x5b')]({'where':{'id':_0x1dad95['params']['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x591b82,null))[_0xb11c('0x27')](function(_0xff18d8){if(_0xff18d8){_0x19b211=_0xff18d8;_0x1595c2[_0xb11c('0x33')]=_[_0xb11c('0x45')](db[_0xb11c('0x5e')][_0xb11c('0x2f')]);_0x1595c2[_0xb11c('0x34')]=_[_0xb11c('0x45')](_0x1dad95[_0xb11c('0x34')]);_0x1595c2[_0xb11c('0x35')]=_[_0xb11c('0x36')](_0x1595c2[_0xb11c('0x33')],_0x1595c2['query']);_0x9408e7[_0xb11c('0x37')]=_[_0xb11c('0x36')](_0x1595c2[_0xb11c('0x33')],qs[_0xb11c('0x38')](_0x1dad95[_0xb11c('0x34')][_0xb11c('0x38')]));_0x9408e7['attributes']=_0x9408e7['attributes']['length']?_0x9408e7[_0xb11c('0x37')]:_0x1595c2[_0xb11c('0x33')];_0x9408e7[_0xb11c('0x3b')]=qs[_0xb11c('0x3c')](_0x1dad95[_0xb11c('0x34')][_0xb11c('0x3c')]);_0x9408e7[_0xb11c('0x3f')]=qs[_0xb11c('0x35')](_['pick'](_0x1dad95[_0xb11c('0x34')],_0x1595c2[_0xb11c('0x35')]));if(_0x1dad95[_0xb11c('0x34')][_0xb11c('0x41')]){_0x9408e7[_0xb11c('0x3f')]=_[_0xb11c('0x3e')](_0x9408e7[_0xb11c('0x3f')],{'$or':_[_0xb11c('0x2d')](_0x9408e7[_0xb11c('0x37')],function(_0xed4e0e){var _0x3c35cb={};_0x3c35cb[_0xed4e0e]={'$like':'%'+_0x1dad95[_0xb11c('0x34')][_0xb11c('0x41')]+'%'};return _0x3c35cb;})});}_0x9408e7=_[_0xb11c('0x3e')]({},_0x9408e7,_0x1dad95[_0xb11c('0x42')]);return _0x19b211[_0xb11c('0x5f')](_0x9408e7);}})['then'](function(_0xd3e84b){if(_0xd3e84b){_0x496195=_0xd3e84b['length'];if(!_0x1dad95[_0xb11c('0x34')][_0xb11c('0x39')](_0xb11c('0x3a'))){_0x9408e7[_0xb11c('0x1d')]=qs[_0xb11c('0x1d')](_0x1dad95[_0xb11c('0x34')][_0xb11c('0x1d')]);_0x9408e7[_0xb11c('0x1b')]=qs[_0xb11c('0x1b')](_0x1dad95[_0xb11c('0x34')][_0xb11c('0x1b')]);}return _0x19b211[_0xb11c('0x5f')](_0x9408e7);}})[_0xb11c('0x27')](function(_0x2740c6){if(_0x2740c6){return _0x2740c6?{'count':_0x496195,'rows':_0x2740c6}:null;}})[_0xb11c('0x27')](respondWithResult(_0x591b82,null))[_0xb11c('0x49')](handleError(_0x591b82,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 9551387..6a2294b 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 _0x2caf=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','api','bluebird','request-promise','path'];(function(_0x1918d6,_0x1ecc2b){var _0x110675=function(_0x2f4dfb){while(--_0x2f4dfb){_0x1918d6['push'](_0x1918d6['shift']());}};_0x110675(++_0x1ecc2b);}(_0x2caf,0x6a));var _0xf2ca=function(_0x3b5ee2,_0x589fbe){_0x3b5ee2=_0x3b5ee2-0x0;var _0x14ead7=_0x2caf[_0x3b5ee2];return _0x14ead7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf2ca('0x0'));var moment=require('moment');var BPromise=require(_0xf2ca('0x1'));var rp=require(_0xf2ca('0x2'));var fs=require('fs');var path=require(_0xf2ca('0x3'));var rimraf=require(_0xf2ca('0x4'));var config=require(_0xf2ca('0x5'));var attributes=require(_0xf2ca('0x6'));module[_0xf2ca('0x7')]=function(_0x51372a,_0x8ce770){return _0x51372a[_0xf2ca('0x8')](_0xf2ca('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd0=['api','bluebird','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger'];(function(_0x28b1a0,_0x1beae2){var _0x124f35=function(_0x954f75){while(--_0x954f75){_0x28b1a0['push'](_0x28b1a0['shift']());}};_0x124f35(++_0x1beae2);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xcdd0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0cdd('0x0'));var util=require(_0x0cdd('0x1'));var logger=require(_0x0cdd('0x2'))(_0x0cdd('0x3'));var moment=require('moment');var BPromise=require(_0x0cdd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cdd('0x5'));var config=require('../../config/environment');var attributes=require(_0x0cdd('0x6'));module[_0x0cdd('0x7')]=function(_0xe80a73,_0x5ca0f9){return _0xe80a73[_0x0cdd('0x8')](_0x0cdd('0x9'),attributes,{'tableName':_0x0cdd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index c7ba3ce..d774a61 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 _0x5fbc=['debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','include','map','model','then','info','Trigger','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x256863,_0x2f39da){var _0x4b54e5=function(_0x191b2f){while(--_0x191b2f){_0x256863['push'](_0x256863['shift']());}};_0x4b54e5(++_0x2f39da);}(_0x5fbc,0x1ad));var _0xc5fb=function(_0x30ed5a,_0xb935b7){_0x30ed5a=_0x30ed5a-0x0;var _0x5c8a60=_0x5fbc[_0x30ed5a];return _0x5c8a60;};'use strict';var _=require(_0xc5fb('0x0'));var util=require(_0xc5fb('0x1'));var moment=require(_0xc5fb('0x2'));var BPromise=require(_0xc5fb('0x3'));var rs=require(_0xc5fb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5fb('0x5'))['db'];var utils=require(_0xc5fb('0x6'));var logger=require(_0xc5fb('0x7'))(_0xc5fb('0x8'));var config=require(_0xc5fb('0x9'));var jayson=require(_0xc5fb('0xa'));var client=jayson[_0xc5fb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a5405,_0x11f7d3,_0x641092){return new BPromise(function(_0xbb3206,_0x5db566){return client[_0xc5fb('0xc')](_0x7a5405,_0x641092)['then'](function(_0x154895){logger['info'](_0xc5fb('0xd'),_0x11f7d3,_0xc5fb('0xe'));logger[_0xc5fb('0xf')](_0xc5fb('0x10'),_0x11f7d3,_0xc5fb('0xe'),JSON[_0xc5fb('0x11')](_0x154895));if(_0x154895[_0xc5fb('0x12')]){if(_0x154895[_0xc5fb('0x12')]['code']===0x1f4){logger[_0xc5fb('0x12')](_0xc5fb('0xd'),_0x11f7d3,_0x154895['error'][_0xc5fb('0x13')]);return _0x5db566(_0x154895['error'][_0xc5fb('0x13')]);}logger['error'](_0xc5fb('0xd'),_0x11f7d3,_0x154895[_0xc5fb('0x12')][_0xc5fb('0x13')]);return _0xbb3206(_0x154895['error'][_0xc5fb('0x13')]);}else{logger['info'](_0xc5fb('0xd'),_0x11f7d3,_0xc5fb('0xe'));_0xbb3206(_0x154895[_0xc5fb('0x14')][_0xc5fb('0x13')]);}})[_0xc5fb('0x15')](function(_0x5e4480){logger[_0xc5fb('0x12')](_0xc5fb('0xd'),_0x11f7d3,_0x5e4480);_0x5db566(_0x5e4480);});});}exports[_0xc5fb('0x16')]=function(_0x25d0c9){var _0x1a0aa6=this;return new Promise(function(_0x3eaf65,_0x2bb6fd){return db['Trigger'][_0xc5fb('0x17')]({'raw':_0x25d0c9[_0xc5fb('0x18')]?_0x25d0c9[_0xc5fb('0x18')][_0xc5fb('0x19')]===undefined?!![]:![]:!![],'where':_0x25d0c9[_0xc5fb('0x18')]?_0x25d0c9[_0xc5fb('0x18')][_0xc5fb('0x1a')]||null:null,'attributes':_0x25d0c9['options']?_0x25d0c9[_0xc5fb('0x18')][_0xc5fb('0x1b')]||null:null,'limit':_0x25d0c9['options']?_0x25d0c9[_0xc5fb('0x18')][_0xc5fb('0x1c')]||null:null,'include':_0x25d0c9[_0xc5fb('0x18')]?_0x25d0c9[_0xc5fb('0x18')][_0xc5fb('0x1d')]?_[_0xc5fb('0x1e')](_0x25d0c9[_0xc5fb('0x18')]['include'],function(_0x3d7f18){return{'model':db[_0x3d7f18['model']],'as':_0x3d7f18['as'],'attributes':_0x3d7f18[_0xc5fb('0x1b')],'include':_0x3d7f18['include']?_[_0xc5fb('0x1e')](_0x3d7f18[_0xc5fb('0x1d')],function(_0x394a32){return{'model':db[_0x394a32[_0xc5fb('0x1f')]],'as':_0x394a32['as'],'attributes':_0x394a32[_0xc5fb('0x1b')],'include':_0x394a32[_0xc5fb('0x1d')]?_['map'](_0x394a32[_0xc5fb('0x1d')],function(_0x83a970){return{'model':db[_0x83a970[_0xc5fb('0x1f')]],'as':_0x83a970['as'],'attributes':_0x83a970['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5fb('0x20')](function(_0x25201d){logger[_0xc5fb('0x21')](_0xc5fb('0x16'),_0x25d0c9);logger[_0xc5fb('0xf')](_0xc5fb('0x16'),_0x25d0c9,JSON[_0xc5fb('0x11')](_0x25201d));_0x3eaf65(_0x25201d);})[_0xc5fb('0x15')](function(_0x5595ae){logger[_0xc5fb('0x12')](_0xc5fb('0x16'),_0x5595ae['message'],_0x25d0c9);_0x2bb6fd(_0x1a0aa6[_0xc5fb('0x12')](0x1f4,_0x5595ae[_0xc5fb('0x13')]));});});};exports['ShowTrigger']=function(_0x1504f4){var _0x5ae054=this;return new Promise(function(_0x3017a6,_0x358541){return db[_0xc5fb('0x22')][_0xc5fb('0x23')]({'raw':_0x1504f4[_0xc5fb('0x18')]?_0x1504f4[_0xc5fb('0x18')][_0xc5fb('0x19')]===undefined?!![]:![]:!![],'where':_0x1504f4[_0xc5fb('0x18')]?_0x1504f4[_0xc5fb('0x18')][_0xc5fb('0x1a')]||null:null,'attributes':_0x1504f4[_0xc5fb('0x18')]?_0x1504f4[_0xc5fb('0x18')][_0xc5fb('0x1b')]||null:null,'include':_0x1504f4[_0xc5fb('0x18')]?_0x1504f4[_0xc5fb('0x18')][_0xc5fb('0x1d')]?_[_0xc5fb('0x1e')](_0x1504f4[_0xc5fb('0x18')]['include'],function(_0x4ec853){return{'model':db[_0x4ec853['model']],'as':_0x4ec853['as'],'attributes':_0x4ec853[_0xc5fb('0x1b')],'include':_0x4ec853[_0xc5fb('0x1d')]?_[_0xc5fb('0x1e')](_0x4ec853[_0xc5fb('0x1d')],function(_0x163006){return{'model':db[_0x163006['model']],'as':_0x163006['as'],'attributes':_0x163006['attributes'],'include':_0x163006[_0xc5fb('0x1d')]?_[_0xc5fb('0x1e')](_0x163006[_0xc5fb('0x1d')],function(_0x1e9693){return{'model':db[_0x1e9693[_0xc5fb('0x1f')]],'as':_0x1e9693['as'],'attributes':_0x1e9693[_0xc5fb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc5fb('0x20')](function(_0x471e4a){logger['info']('ShowTrigger',_0x1504f4);logger[_0xc5fb('0xf')](_0xc5fb('0x24'),_0x1504f4,JSON[_0xc5fb('0x11')](_0x471e4a));_0x3017a6(_0x471e4a);})['catch'](function(_0x199087){logger[_0xc5fb('0x12')](_0xc5fb('0x24'),_0x199087[_0xc5fb('0x13')],_0x1504f4);_0x358541(_0x5ae054[_0xc5fb('0x12')](0x1f4,_0x199087[_0xc5fb('0x13')]));});});}; \ No newline at end of file +var _0x35e9=['info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Trigger','findAll','options','where','attributes','include','map','model','then','GetTrigger','stringify','ShowTrigger','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3beec1,_0x1a3885){var _0x4e2a87=function(_0x4de8cf){while(--_0x4de8cf){_0x3beec1['push'](_0x3beec1['shift']());}};_0x4e2a87(++_0x1a3885);}(_0x35e9,0x1ba));var _0x935e=function(_0x1ea757,_0x586298){_0x1ea757=_0x1ea757-0x0;var _0x313a6f=_0x35e9[_0x1ea757];return _0x313a6f;};'use strict';var _=require('lodash');var util=require(_0x935e('0x0'));var moment=require(_0x935e('0x1'));var BPromise=require(_0x935e('0x2'));var rs=require(_0x935e('0x3'));var fs=require('fs');var Redis=require(_0x935e('0x4'));var db=require(_0x935e('0x5'))['db'];var utils=require(_0x935e('0x6'));var logger=require(_0x935e('0x7'))(_0x935e('0x8'));var config=require(_0x935e('0x9'));var jayson=require(_0x935e('0xa'));var client=jayson[_0x935e('0xb')][_0x935e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45fa3d,_0x17230d,_0x1b023f){return new BPromise(function(_0x34b25d,_0x444da7){return client[_0x935e('0xd')](_0x45fa3d,_0x1b023f)['then'](function(_0x225a53){logger[_0x935e('0xe')](_0x935e('0xf'),_0x17230d,_0x935e('0x10'));logger[_0x935e('0x11')](_0x935e('0x12'),_0x17230d,_0x935e('0x10'),JSON['stringify'](_0x225a53));if(_0x225a53['error']){if(_0x225a53[_0x935e('0x13')][_0x935e('0x14')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x17230d,_0x225a53[_0x935e('0x13')][_0x935e('0x15')]);return _0x444da7(_0x225a53[_0x935e('0x13')][_0x935e('0x15')]);}logger[_0x935e('0x13')](_0x935e('0xf'),_0x17230d,_0x225a53['error']['message']);return _0x34b25d(_0x225a53[_0x935e('0x13')]['message']);}else{logger[_0x935e('0xe')](_0x935e('0xf'),_0x17230d,_0x935e('0x10'));_0x34b25d(_0x225a53[_0x935e('0x16')][_0x935e('0x15')]);}})[_0x935e('0x17')](function(_0x368a63){logger[_0x935e('0x13')](_0x935e('0xf'),_0x17230d,_0x368a63);_0x444da7(_0x368a63);});});}exports['GetTrigger']=function(_0x55ae68){var _0x2f79eb=this;return new Promise(function(_0x121b0d,_0x261bdc){return db[_0x935e('0x18')][_0x935e('0x19')]({'raw':_0x55ae68['options']?_0x55ae68['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ae68[_0x935e('0x1a')]?_0x55ae68['options'][_0x935e('0x1b')]||null:null,'attributes':_0x55ae68['options']?_0x55ae68[_0x935e('0x1a')][_0x935e('0x1c')]||null:null,'limit':_0x55ae68[_0x935e('0x1a')]?_0x55ae68['options']['limit']||null:null,'include':_0x55ae68[_0x935e('0x1a')]?_0x55ae68[_0x935e('0x1a')][_0x935e('0x1d')]?_[_0x935e('0x1e')](_0x55ae68['options'][_0x935e('0x1d')],function(_0x742404){return{'model':db[_0x742404[_0x935e('0x1f')]],'as':_0x742404['as'],'attributes':_0x742404['attributes'],'include':_0x742404[_0x935e('0x1d')]?_[_0x935e('0x1e')](_0x742404[_0x935e('0x1d')],function(_0x1098bd){return{'model':db[_0x1098bd['model']],'as':_0x1098bd['as'],'attributes':_0x1098bd['attributes'],'include':_0x1098bd[_0x935e('0x1d')]?_[_0x935e('0x1e')](_0x1098bd[_0x935e('0x1d')],function(_0x226028){return{'model':db[_0x226028['model']],'as':_0x226028['as'],'attributes':_0x226028['attributes']};}):[]};}):[]};}):[]:[]})[_0x935e('0x20')](function(_0x380b53){logger[_0x935e('0xe')](_0x935e('0x21'),_0x55ae68);logger['debug']('GetTrigger',_0x55ae68,JSON[_0x935e('0x22')](_0x380b53));_0x121b0d(_0x380b53);})[_0x935e('0x17')](function(_0x353cff){logger[_0x935e('0x13')](_0x935e('0x21'),_0x353cff[_0x935e('0x15')],_0x55ae68);_0x261bdc(_0x2f79eb['error'](0x1f4,_0x353cff['message']));});});};exports[_0x935e('0x23')]=function(_0x4ff4e5){var _0x33bcbe=this;return new Promise(function(_0x3189df,_0x4c72e8){return db['Trigger'][_0x935e('0x24')]({'raw':_0x4ff4e5['options']?_0x4ff4e5[_0x935e('0x1a')][_0x935e('0x25')]===undefined?!![]:![]:!![],'where':_0x4ff4e5[_0x935e('0x1a')]?_0x4ff4e5[_0x935e('0x1a')][_0x935e('0x1b')]||null:null,'attributes':_0x4ff4e5[_0x935e('0x1a')]?_0x4ff4e5[_0x935e('0x1a')]['attributes']||null:null,'include':_0x4ff4e5[_0x935e('0x1a')]?_0x4ff4e5['options'][_0x935e('0x1d')]?_[_0x935e('0x1e')](_0x4ff4e5[_0x935e('0x1a')][_0x935e('0x1d')],function(_0x4c8f5f){return{'model':db[_0x4c8f5f[_0x935e('0x1f')]],'as':_0x4c8f5f['as'],'attributes':_0x4c8f5f[_0x935e('0x1c')],'include':_0x4c8f5f['include']?_['map'](_0x4c8f5f[_0x935e('0x1d')],function(_0x322cfe){return{'model':db[_0x322cfe[_0x935e('0x1f')]],'as':_0x322cfe['as'],'attributes':_0x322cfe[_0x935e('0x1c')],'include':_0x322cfe[_0x935e('0x1d')]?_[_0x935e('0x1e')](_0x322cfe[_0x935e('0x1d')],function(_0x41d3ed){return{'model':db[_0x41d3ed[_0x935e('0x1f')]],'as':_0x41d3ed['as'],'attributes':_0x41d3ed[_0x935e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x935e('0x20')](function(_0x44a1df){logger[_0x935e('0xe')](_0x935e('0x23'),_0x4ff4e5);logger[_0x935e('0x11')]('ShowTrigger',_0x4ff4e5,JSON['stringify'](_0x44a1df));_0x3189df(_0x44a1df);})[_0x935e('0x17')](function(_0x39bb60){logger[_0x935e('0x13')](_0x935e('0x23'),_0x39bb60[_0x935e('0x15')],_0x4ff4e5);_0x4c72e8(_0x33bcbe[_0x935e('0x13')](0x1f4,_0x39bb60[_0x935e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8d5d52c..f18fda7 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 _0x81f8=['/:id','show','post','/:id/clone','clone','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index'];(function(_0x34a9ea,_0x6a8cc4){var _0xde7703=function(_0x50e5c8){while(--_0x50e5c8){_0x34a9ea['push'](_0x34a9ea['shift']());}};_0xde7703(++_0x6a8cc4);}(_0x81f8,0x1d8));var _0x881f=function(_0x3bd792,_0x171a3e){_0x3bd792=_0x3bd792-0x0;var _0x405c0f=_0x81f8[_0x3bd792];return _0x405c0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x881f('0x0'));var timeout=require(_0x881f('0x1'));var express=require(_0x881f('0x2'));var router=express[_0x881f('0x3')]();var fs_extra=require(_0x881f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x881f('0x5'));var config=require(_0x881f('0x6'));var controller=require(_0x881f('0x7'));router[_0x881f('0x8')]('/',auth[_0x881f('0x9')](),controller[_0x881f('0xa')]);router[_0x881f('0x8')](_0x881f('0xb'),auth['isAuthenticated'](),controller[_0x881f('0xc')]);router[_0x881f('0xd')](_0x881f('0xe'),auth[_0x881f('0x9')](),controller[_0x881f('0xf')]);router[_0x881f('0xd')]('/',auth[_0x881f('0x9')](),controller[_0x881f('0x10')]);router[_0x881f('0x11')](_0x881f('0xb'),auth['isAuthenticated'](),controller[_0x881f('0x12')]);router['delete']('/:id',auth[_0x881f('0x9')](),controller[_0x881f('0x13')]);module[_0x881f('0x14')]=router; \ No newline at end of file +var _0x0145=['/:id/clone','clone','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x0145,0x16c));var _0x5014=function(_0x261339,_0x3c5395){_0x261339=_0x261339-0x0;var _0x4fe339=_0x0145[_0x261339];return _0x4fe339;};'use strict';var multer=require(_0x5014('0x0'));var util=require(_0x5014('0x1'));var path=require(_0x5014('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5014('0x3')]();var fs_extra=require(_0x5014('0x4'));var auth=require(_0x5014('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5014('0x6'));var controller=require(_0x5014('0x7'));router[_0x5014('0x8')]('/',auth['isAuthenticated'](),controller[_0x5014('0x9')]);router[_0x5014('0x8')](_0x5014('0xa'),auth[_0x5014('0xb')](),controller[_0x5014('0xc')]);router[_0x5014('0xd')](_0x5014('0xe'),auth[_0x5014('0xb')](),controller[_0x5014('0xf')]);router[_0x5014('0xd')]('/',auth[_0x5014('0xb')](),controller[_0x5014('0x10')]);router[_0x5014('0x11')](_0x5014('0xa'),auth[_0x5014('0xb')](),controller[_0x5014('0x12')]);router[_0x5014('0x13')](_0x5014('0xa'),auth[_0x5014('0xb')](),controller['destroy']);module[_0x5014('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 9ce4d95..95c546f 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 _0x1830=['originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse'];(function(_0x5b71a9,_0x19c3d0){var _0x4b5110=function(_0x3cc81c){while(--_0x3cc81c){_0x5b71a9['push'](_0x5b71a9['shift']());}};_0x4b5110(++_0x19c3d0);}(_0x1830,0xe2));var _0x0183=function(_0x3ced90,_0xf1aad1){_0x3ced90=_0x3ced90-0x0;var _0x5b9d75=_0x1830[_0x3ced90];return _0x5b9d75;};'use strict';var Sequelize=require(_0x0183('0x0'));module[_0x0183('0x1')]={'name':{'type':Sequelize[_0x0183('0x2')],'allowNull':![],'unique':_0x0183('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0183('0x4')]('friend','user',_0x0183('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x0183('0x2')],'allowNull':![],'defaultValue':_0x0183('0x6')},'callingpres':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x7'),_0x0183('0x8'),'ALLOWED_FAILED_SCREEN',_0x0183('0x9'),'PROHIB_NOT_SCREENED',_0x0183('0xa'),_0x0183('0xb'),_0x0183('0xc'))},'deny':{'type':Sequelize[_0x0183('0x2')]},'permit':{'type':Sequelize[_0x0183('0x2')]},'secret':{'type':Sequelize[_0x0183('0x2')]},'md5secret':{'type':Sequelize[_0x0183('0x2')]},'remotesecret':{'type':Sequelize[_0x0183('0x2')]},'transport':{'type':Sequelize[_0x0183('0x2')],'defaultValue':_0x0183('0xd'),'set':function(_0x41d58d){this['setDataValue'](_0x0183('0xe'),_0x41d58d?_0x41d58d[_0x0183('0xf')](','):null);},'get':function(){return this[_0x0183('0x10')](_0x0183('0xe'))?this[_0x0183('0x10')](_0x0183('0xe'))['split'](','):null;},'comment':_0x0183('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0183('0x12'),_0x0183('0x13'),_0x0183('0x14'),_0x0183('0x15'),_0x0183('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0183('0x4')]('yes','no',_0x0183('0x17'),_0x0183('0x18'),_0x0183('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0183('0x2')]},'directmediadeny':{'type':Sequelize[_0x0183('0x2')]},'nat':{'type':Sequelize[_0x0183('0x2')],'defaultValue':_0x0183('0x1b'),'set':function(_0x3b5455){this[_0x0183('0x1c')](_0x0183('0x1d'),_0x3b5455?_0x3b5455[_0x0183('0xf')](','):null);},'get':function(){return this[_0x0183('0x10')](_0x0183('0x1d'))?this[_0x0183('0x10')](_0x0183('0x1d'))[_0x0183('0x1e')](','):null;},'comment':_0x0183('0x1f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0183('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x0183('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0183('0x2')],'defaultValue':_0x0183('0x20')},'allow':{'type':Sequelize[_0x0183('0x2')],'allowNull':![],'defaultValue':_0x0183('0x21'),'set':function(_0x54633e){this[_0x0183('0x1c')]('allow',_0x54633e?_0x54633e[_0x0183('0xf')](';'):_0x0183('0x21'));},'get':function(){return this[_0x0183('0x10')](_0x0183('0x22'))?this[_0x0183('0x10')](_0x0183('0x22'))['split'](';'):null;},'comment':_0x0183('0x23')},'autoframing':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'insecure':{'type':Sequelize[_0x0183('0x2')],'defaultValue':'port,invite','set':function(_0xdf6c29){this[_0x0183('0x1c')]('insecure',_0xdf6c29?_0xdf6c29[_0x0183('0xf')](','):null);},'get':function(){return this[_0x0183('0x10')]('insecure')?this['getDataValue'](_0x0183('0x24'))['split'](','):null;},'comment':_0x0183('0x25')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no',_0x0183('0x26'))},'promiscredir':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x0183('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0183('0x2')],'defaultValue':_0x0183('0x28')},'amaflags':{'type':Sequelize[_0x0183('0x2')]},'callcounter':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no'),'defaultValue':_0x0183('0x1a')},'busylevel':{'type':Sequelize[_0x0183('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x0183('0x2')]},'template':{'type':Sequelize[_0x0183('0x2')]},'videosupport':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no',_0x0183('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0183('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x0183('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x0183('0x2a'),_0x0183('0x2b'),_0x0183('0x2c'))},'session_expires':{'type':Sequelize[_0x0183('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x0183('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x0183('0x2d'),_0x0183('0x2e')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x0183('0x2')]},'fromdomain':{'type':Sequelize[_0x0183('0x2')]},'fromuser':{'type':Sequelize[_0x0183('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x0183('0x4')]('yes','no'),'defaultValue':_0x0183('0x1a')},'keepalive':{'type':Sequelize[_0x0183('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x0183('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0183('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0183('0x27')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no',_0x0183('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0183('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x0183('0x27')](0xb)},'timerb':{'type':Sequelize[_0x0183('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0183('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x0183('0x2')]},'contactacl':{'type':Sequelize[_0x0183('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x0183('0x2')]},'use_q850_reason':{'type':Sequelize[_0x0183('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0183('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no',_0x0183('0x30'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0183('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0183('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x0183('0x2')]},'dtlscipher':{'type':Sequelize[_0x0183('0x2')]},'dtlscafile':{'type':Sequelize[_0x0183('0x2')]},'dtlscapath':{'type':Sequelize[_0x0183('0x2')]},'dtlssetup':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x31'),_0x0183('0x32'),_0x0183('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0183('0x2')]},'usereqphone':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0183('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x0183('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0183('0x4')](_0x0183('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x0183('0x2')]},'mohinterpret':{'type':Sequelize[_0x0183('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0183('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x0183('0x34')},'canreinvite':{'type':Sequelize['ENUM'](_0x0183('0x1a'),'no',_0x0183('0x17'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0183('0x2')]},'otherFields':{'type':Sequelize[_0x0183('0x2')]},'active':{'type':Sequelize[_0x0183('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0183('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x5c07=['active','passive','actpass','dynamic','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','udp','getDataValue','transport','split','rfc2833','info','inband','auto','yes','nonat','update','outgoing','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate'];(function(_0x5bf369,_0xe484c3){var _0x13ec9e=function(_0x482582){while(--_0x482582){_0x5bf369['push'](_0x5bf369['shift']());}};_0x13ec9e(++_0xe484c3);}(_0x5c07,0xfa));var _0x75c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c07[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x75c0('0x0'));module[_0x75c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x75c0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x4'),'user',_0x75c0('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x75c0('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x75c0('0x3')]('ALLOWED_NOT_SCREENED',_0x75c0('0x7'),_0x75c0('0x8'),_0x75c0('0x9'),_0x75c0('0xa'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x75c0('0xb'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x75c0('0x6')]},'md5secret':{'type':Sequelize[_0x75c0('0x6')]},'remotesecret':{'type':Sequelize[_0x75c0('0x6')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x75c0('0xc'),'set':function(_0x11870d){this['setDataValue']('transport',_0x11870d?_0x11870d['join'](','):null);},'get':function(){return this[_0x75c0('0xd')](_0x75c0('0xe'))?this[_0x75c0('0xd')](_0x75c0('0xe'))[_0x75c0('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x75c0('0x10'),_0x75c0('0x11'),'shortinfo',_0x75c0('0x12'),_0x75c0('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x75c0('0x14'),'no',_0x75c0('0x15'),_0x75c0('0x16'),_0x75c0('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x75c0('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x75c0('0x6')]},'directmediadeny':{'type':Sequelize[_0x75c0('0x6')]},'nat':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':'force_rport,comedia','set':function(_0x4aad4b){this[_0x75c0('0x18')](_0x75c0('0x19'),_0x4aad4b?_0x4aad4b[_0x75c0('0x1a')](','):null);},'get':function(){return this[_0x75c0('0xd')]('nat')?this[_0x75c0('0xd')](_0x75c0('0x19'))[_0x75c0('0xf')](','):null;},'comment':_0x75c0('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x75c0('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x75c0('0x6')]},'language':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x75c0('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':_0x75c0('0x1c')},'allow':{'type':Sequelize[_0x75c0('0x6')],'allowNull':![],'defaultValue':_0x75c0('0x1d'),'set':function(_0x221831){this[_0x75c0('0x18')](_0x75c0('0x1e'),_0x221831?_0x221831[_0x75c0('0x1a')](';'):_0x75c0('0x1d'));},'get':function(){return this[_0x75c0('0xd')](_0x75c0('0x1e'))?this['getDataValue'](_0x75c0('0x1e'))[_0x75c0('0xf')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x75c0('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':_0x75c0('0x1f'),'set':function(_0x239fdd){this['setDataValue'](_0x75c0('0x20'),_0x239fdd?_0x239fdd[_0x75c0('0x1a')](','):null);},'get':function(){return this['getDataValue'](_0x75c0('0x20'))?this[_0x75c0('0xd')](_0x75c0('0x20'))[_0x75c0('0xf')](','):null;},'comment':_0x75c0('0x21')},'trustrpid':{'type':Sequelize[_0x75c0('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no',_0x75c0('0x22'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x75c0('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x75c0('0x23')](0xb)},'setvar':{'type':Sequelize[_0x75c0('0x6')]},'callerid':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x75c0('0x6')]},'callcounter':{'type':Sequelize['ENUM'](_0x75c0('0x14'),'no'),'defaultValue':_0x75c0('0x14')},'busylevel':{'type':Sequelize[_0x75c0('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x75c0('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x75c0('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x75c0('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0x75c0('0x6')]},'template':{'type':Sequelize[_0x75c0('0x6')]},'videosupport':{'type':Sequelize[_0x75c0('0x3')]('yes','no',_0x75c0('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x75c0('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'mailbox':{'type':Sequelize[_0x75c0('0x6')]},'session_timers':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x25'),_0x75c0('0x26'),'originate')},'session_expires':{'type':Sequelize[_0x75c0('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x75c0('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x27'),'uas'),'defaultValue':_0x75c0('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x75c0('0x6')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x75c0('0x6')]},'fromuser':{'type':Sequelize[_0x75c0('0x6')]},'port':{'type':Sequelize[_0x75c0('0x23')](0x5)},'qualify':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x75c0('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x75c0('0x6')]},'defaultuser':{'type':Sequelize[_0x75c0('0x6')]},'rtptimeout':{'type':Sequelize[_0x75c0('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x75c0('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no',_0x75c0('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x75c0('0x6')]},'timert1':{'type':Sequelize[_0x75c0('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x75c0('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x75c0('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x75c0('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x75c0('0x6')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'force_avp':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'icesupport':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x75c0('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x75c0('0x3')]('yes','no',_0x75c0('0x2a'),_0x75c0('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x75c0('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x75c0('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x75c0('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x75c0('0x6')]},'dtlscapath':{'type':Sequelize[_0x75c0('0x6')]},'dtlssetup':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x2c'),_0x75c0('0x2d'),_0x75c0('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x75c0('0x6')]},'usereqphone':{'type':Sequelize[_0x75c0('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x75c0('0x6')]},'recordofffeature':{'type':Sequelize[_0x75c0('0x6')]},'call_limit':{'type':Sequelize[_0x75c0('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no')},'vmexten':{'type':Sequelize[_0x75c0('0x6')]},'mohinterpret':{'type':Sequelize[_0x75c0('0x6')]},'mohsuggest':{'type':Sequelize[_0x75c0('0x6')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x75c0('0x6')]},'host':{'type':Sequelize[_0x75c0('0x6')],'defaultValue':_0x75c0('0x2f')},'canreinvite':{'type':Sequelize[_0x75c0('0x3')](_0x75c0('0x14'),'no',_0x75c0('0x15'),_0x75c0('0x16'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x75c0('0x6')]},'otherFields':{'type':Sequelize[_0x75c0('0x6')]},'active':{'type':Sequelize[_0x75c0('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x75c0('0x6')],'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 c91c0e0..3260a05 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 _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x3da43b,_0x1e0a4f){var _0x832325=function(_0x2c9fe5){while(--_0x2c9fe5){_0x3da43b['push'](_0x3da43b['shift']());}};_0x832325(++_0x1e0a4f);}(_0xe14d,0x1ee));var _0xde14=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xe14d[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file +var _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x22a914,_0x594e59){var _0x35ceba=function(_0x2eb1ca){while(--_0x2eb1ca){_0x22a914['push'](_0x22a914['shift']());}};_0x35ceba(++_0x594e59);}(_0xb821,0xa7));var _0x1b82=function(_0x5864ea,_0x1c1cde){_0x5864ea=_0x5864ea-0x0;var _0x3c7726=_0xb821[_0x5864ea];return _0x3c7726;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index cb22a17..f1fe0da 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 _0x0fc2=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','Trunk','tools_trunks'];(function(_0x12de61,_0x4b56a4){var _0xb3684f=function(_0x27fa50){while(--_0x27fa50){_0x12de61['push'](_0x12de61['shift']());}};_0xb3684f(++_0x4b56a4);}(_0x0fc2,0xf0));var _0x20fc=function(_0x23ee2d,_0x1a4346){_0x23ee2d=_0x23ee2d-0x0;var _0x87f5bc=_0x0fc2[_0x23ee2d];return _0x87f5bc;};'use strict';var _=require(_0x20fc('0x0'));var util=require(_0x20fc('0x1'));var logger=require(_0x20fc('0x2'))(_0x20fc('0x3'));var moment=require(_0x20fc('0x4'));var BPromise=require(_0x20fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20fc('0x6'));var config=require(_0x20fc('0x7'));var attributes=require('./trunk.attributes');module[_0x20fc('0x8')]=function(_0x1f2b77,_0x2cfc84){return _0x1f2b77[_0x20fc('0x9')](_0x20fc('0xa'),attributes,{'tableName':_0x20fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8b3=['define','Trunk','tools_trunks','../../config/logger','bluebird','rimraf','./trunk.attributes'];(function(_0x5ede1f,_0x561c2e){var _0x873fbb=function(_0xaaabfd){while(--_0xaaabfd){_0x5ede1f['push'](_0x5ede1f['shift']());}};_0x873fbb(++_0x561c2e);}(_0xe8b3,0x73));var _0x3e8b=function(_0x4d2d32,_0x136c35){_0x4d2d32=_0x4d2d32-0x0;var _0x90788=_0xe8b3[_0x4d2d32];return _0x90788;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e8b('0x0'))('api');var moment=require('moment');var BPromise=require(_0x3e8b('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e8b('0x2'));var config=require('../../config/environment');var attributes=require(_0x3e8b('0x3'));module['exports']=function(_0x5374e4,_0x4e915e){return _0x5374e4[_0x3e8b('0x4')](_0x3e8b('0x5'),attributes,{'tableName':_0x3e8b('0x6'),'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 1cdeed2..762da6e 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 _0xb410=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','include','map','model','then','debug','ShowTrunk','find','raw','lodash'];(function(_0x58c0ab,_0x59a50b){var _0x4facdb=function(_0x1ae887){while(--_0x1ae887){_0x58c0ab['push'](_0x58c0ab['shift']());}};_0x4facdb(++_0x59a50b);}(_0xb410,0x8f));var _0x0b41=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb410[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0b41('0x0'));var util=require(_0x0b41('0x1'));var moment=require(_0x0b41('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b41('0x3'));var db=require(_0x0b41('0x4'))['db'];var utils=require(_0x0b41('0x5'));var logger=require(_0x0b41('0x6'))(_0x0b41('0x7'));var config=require(_0x0b41('0x8'));var jayson=require(_0x0b41('0x9'));var client=jayson['client'][_0x0b41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6380df,_0x51e023,_0x251a1d){return new BPromise(function(_0x289759,_0x15c6f4){return client[_0x0b41('0xb')](_0x6380df,_0x251a1d)['then'](function(_0x495f9b){logger['info'](_0x0b41('0xc'),_0x51e023,_0x0b41('0xd'));logger['debug'](_0x0b41('0xe'),_0x51e023,'request\x20sent',JSON[_0x0b41('0xf')](_0x495f9b));if(_0x495f9b['error']){if(_0x495f9b[_0x0b41('0x10')][_0x0b41('0x11')]===0x1f4){logger[_0x0b41('0x10')](_0x0b41('0xc'),_0x51e023,_0x495f9b[_0x0b41('0x10')][_0x0b41('0x12')]);return _0x15c6f4(_0x495f9b[_0x0b41('0x10')][_0x0b41('0x12')]);}logger[_0x0b41('0x10')](_0x0b41('0xc'),_0x51e023,_0x495f9b[_0x0b41('0x10')][_0x0b41('0x12')]);return _0x289759(_0x495f9b['error'][_0x0b41('0x12')]);}else{logger[_0x0b41('0x13')]('Trunk,\x20%s,\x20%s',_0x51e023,_0x0b41('0xd'));_0x289759(_0x495f9b[_0x0b41('0x14')][_0x0b41('0x12')]);}})[_0x0b41('0x15')](function(_0x397e44){logger['error'](_0x0b41('0xc'),_0x51e023,_0x397e44);_0x15c6f4(_0x397e44);});});}exports[_0x0b41('0x16')]=function(_0x4198ff){var _0x39a4f6=this;return new Promise(function(_0x5ad5e6,_0x3cb993){return db[_0x0b41('0x17')][_0x0b41('0x18')]({'raw':_0x4198ff['options']?_0x4198ff[_0x0b41('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4198ff['options']?_0x4198ff[_0x0b41('0x19')][_0x0b41('0x1a')]||null:null,'attributes':_0x4198ff[_0x0b41('0x19')]?_0x4198ff[_0x0b41('0x19')][_0x0b41('0x1b')]||null:null,'limit':_0x4198ff['options']?_0x4198ff[_0x0b41('0x19')]['limit']||null:null,'include':_0x4198ff['options']?_0x4198ff[_0x0b41('0x19')][_0x0b41('0x1c')]?_[_0x0b41('0x1d')](_0x4198ff[_0x0b41('0x19')][_0x0b41('0x1c')],function(_0x2cdcf0){return{'model':db[_0x2cdcf0['model']],'as':_0x2cdcf0['as'],'attributes':_0x2cdcf0['attributes'],'include':_0x2cdcf0[_0x0b41('0x1c')]?_[_0x0b41('0x1d')](_0x2cdcf0['include'],function(_0x5dc58f){return{'model':db[_0x5dc58f[_0x0b41('0x1e')]],'as':_0x5dc58f['as'],'attributes':_0x5dc58f[_0x0b41('0x1b')],'include':_0x5dc58f['include']?_['map'](_0x5dc58f[_0x0b41('0x1c')],function(_0x48429f){return{'model':db[_0x48429f['model']],'as':_0x48429f['as'],'attributes':_0x48429f[_0x0b41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b41('0x1f')](function(_0x2564a8){logger[_0x0b41('0x13')]('GetTrunk',_0x4198ff);logger[_0x0b41('0x20')](_0x0b41('0x16'),_0x4198ff,JSON[_0x0b41('0xf')](_0x2564a8));_0x5ad5e6(_0x2564a8);})['catch'](function(_0x63ed58){logger[_0x0b41('0x10')](_0x0b41('0x16'),_0x63ed58['message'],_0x4198ff);_0x3cb993(_0x39a4f6['error'](0x1f4,_0x63ed58[_0x0b41('0x12')]));});});};exports[_0x0b41('0x21')]=function(_0x18ff72){var _0x4e6bce=this;return new Promise(function(_0x77b108,_0x55b99e){return db[_0x0b41('0x17')][_0x0b41('0x22')]({'raw':_0x18ff72[_0x0b41('0x19')]?_0x18ff72['options'][_0x0b41('0x23')]===undefined?!![]:![]:!![],'where':_0x18ff72['options']?_0x18ff72[_0x0b41('0x19')][_0x0b41('0x1a')]||null:null,'attributes':_0x18ff72[_0x0b41('0x19')]?_0x18ff72[_0x0b41('0x19')][_0x0b41('0x1b')]||null:null,'include':_0x18ff72[_0x0b41('0x19')]?_0x18ff72['options']['include']?_[_0x0b41('0x1d')](_0x18ff72[_0x0b41('0x19')][_0x0b41('0x1c')],function(_0x3155de){return{'model':db[_0x3155de[_0x0b41('0x1e')]],'as':_0x3155de['as'],'attributes':_0x3155de['attributes'],'include':_0x3155de[_0x0b41('0x1c')]?_[_0x0b41('0x1d')](_0x3155de[_0x0b41('0x1c')],function(_0x10ab0d){return{'model':db[_0x10ab0d[_0x0b41('0x1e')]],'as':_0x10ab0d['as'],'attributes':_0x10ab0d['attributes'],'include':_0x10ab0d[_0x0b41('0x1c')]?_[_0x0b41('0x1d')](_0x10ab0d['include'],function(_0xe0f5b9){return{'model':db[_0xe0f5b9[_0x0b41('0x1e')]],'as':_0xe0f5b9['as'],'attributes':_0xe0f5b9[_0x0b41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b41('0x1f')](function(_0x31eb87){logger[_0x0b41('0x13')](_0x0b41('0x21'),_0x18ff72);logger[_0x0b41('0x20')](_0x0b41('0x21'),_0x18ff72,JSON[_0x0b41('0xf')](_0x31eb87));_0x77b108(_0x31eb87);})['catch'](function(_0x2dfe54){logger[_0x0b41('0x10')]('ShowTrunk',_0x2dfe54[_0x0b41('0x12')],_0x18ff72);_0x55b99e(_0x4e6bce[_0x0b41('0x10')](0x1f4,_0x2dfe54[_0x0b41('0x12')]));});});}; \ No newline at end of file +var _0x7e81=['ShowTrunk','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x248f76,_0x35779f){var _0x16341b=function(_0x1927f6){while(--_0x1927f6){_0x248f76['push'](_0x248f76['shift']());}};_0x16341b(++_0x35779f);}(_0x7e81,0x1a7));var _0x17e8=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x7e81[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x17e8('0x0'));var moment=require(_0x17e8('0x1'));var BPromise=require(_0x17e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17e8('0x3'));var db=require(_0x17e8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17e8('0x5'))('rpc');var config=require(_0x17e8('0x6'));var jayson=require(_0x17e8('0x7'));var client=jayson[_0x17e8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b1009,_0x1ce316,_0x1a226f){return new BPromise(function(_0x420f53,_0x345ece){return client[_0x17e8('0x9')](_0x5b1009,_0x1a226f)[_0x17e8('0xa')](function(_0x5b35cb){logger[_0x17e8('0xb')](_0x17e8('0xc'),_0x1ce316,_0x17e8('0xd'));logger[_0x17e8('0xe')](_0x17e8('0xf'),_0x1ce316,_0x17e8('0xd'),JSON[_0x17e8('0x10')](_0x5b35cb));if(_0x5b35cb['error']){if(_0x5b35cb[_0x17e8('0x11')][_0x17e8('0x12')]===0x1f4){logger[_0x17e8('0x11')]('Trunk,\x20%s,\x20%s',_0x1ce316,_0x5b35cb[_0x17e8('0x11')][_0x17e8('0x13')]);return _0x345ece(_0x5b35cb[_0x17e8('0x11')][_0x17e8('0x13')]);}logger[_0x17e8('0x11')](_0x17e8('0xc'),_0x1ce316,_0x5b35cb[_0x17e8('0x11')][_0x17e8('0x13')]);return _0x420f53(_0x5b35cb[_0x17e8('0x11')][_0x17e8('0x13')]);}else{logger['info'](_0x17e8('0xc'),_0x1ce316,_0x17e8('0xd'));_0x420f53(_0x5b35cb[_0x17e8('0x14')][_0x17e8('0x13')]);}})[_0x17e8('0x15')](function(_0x3cb1c3){logger[_0x17e8('0x11')]('Trunk,\x20%s,\x20%s',_0x1ce316,_0x3cb1c3);_0x345ece(_0x3cb1c3);});});}exports[_0x17e8('0x16')]=function(_0x5e8ccf){var _0x3ec88f=this;return new Promise(function(_0x476a35,_0x46436c){return db[_0x17e8('0x17')][_0x17e8('0x18')]({'raw':_0x5e8ccf[_0x17e8('0x19')]?_0x5e8ccf[_0x17e8('0x19')][_0x17e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e8ccf[_0x17e8('0x19')]?_0x5e8ccf[_0x17e8('0x19')]['where']||null:null,'attributes':_0x5e8ccf[_0x17e8('0x19')]?_0x5e8ccf[_0x17e8('0x19')][_0x17e8('0x1b')]||null:null,'limit':_0x5e8ccf[_0x17e8('0x19')]?_0x5e8ccf[_0x17e8('0x19')][_0x17e8('0x1c')]||null:null,'include':_0x5e8ccf[_0x17e8('0x19')]?_0x5e8ccf['options'][_0x17e8('0x1d')]?_[_0x17e8('0x1e')](_0x5e8ccf[_0x17e8('0x19')]['include'],function(_0x559a07){return{'model':db[_0x559a07[_0x17e8('0x1f')]],'as':_0x559a07['as'],'attributes':_0x559a07[_0x17e8('0x1b')],'include':_0x559a07['include']?_[_0x17e8('0x1e')](_0x559a07[_0x17e8('0x1d')],function(_0x3cb975){return{'model':db[_0x3cb975[_0x17e8('0x1f')]],'as':_0x3cb975['as'],'attributes':_0x3cb975[_0x17e8('0x1b')],'include':_0x3cb975[_0x17e8('0x1d')]?_[_0x17e8('0x1e')](_0x3cb975['include'],function(_0x412205){return{'model':db[_0x412205[_0x17e8('0x1f')]],'as':_0x412205['as'],'attributes':_0x412205[_0x17e8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47373e){logger[_0x17e8('0xb')](_0x17e8('0x16'),_0x5e8ccf);logger[_0x17e8('0xe')](_0x17e8('0x16'),_0x5e8ccf,JSON[_0x17e8('0x10')](_0x47373e));_0x476a35(_0x47373e);})['catch'](function(_0x16e4db){logger[_0x17e8('0x11')](_0x17e8('0x16'),_0x16e4db['message'],_0x5e8ccf);_0x46436c(_0x3ec88f[_0x17e8('0x11')](0x1f4,_0x16e4db[_0x17e8('0x13')]));});});};exports[_0x17e8('0x20')]=function(_0x19d257){var _0x1d68a4=this;return new Promise(function(_0x717439,_0x3a8dca){return db[_0x17e8('0x17')][_0x17e8('0x21')]({'raw':_0x19d257[_0x17e8('0x19')]?_0x19d257[_0x17e8('0x19')][_0x17e8('0x1a')]===undefined?!![]:![]:!![],'where':_0x19d257[_0x17e8('0x19')]?_0x19d257[_0x17e8('0x19')][_0x17e8('0x22')]||null:null,'attributes':_0x19d257[_0x17e8('0x19')]?_0x19d257['options'][_0x17e8('0x1b')]||null:null,'include':_0x19d257['options']?_0x19d257[_0x17e8('0x19')]['include']?_['map'](_0x19d257[_0x17e8('0x19')][_0x17e8('0x1d')],function(_0x487f35){return{'model':db[_0x487f35[_0x17e8('0x1f')]],'as':_0x487f35['as'],'attributes':_0x487f35[_0x17e8('0x1b')],'include':_0x487f35[_0x17e8('0x1d')]?_[_0x17e8('0x1e')](_0x487f35[_0x17e8('0x1d')],function(_0x3b519e){return{'model':db[_0x3b519e[_0x17e8('0x1f')]],'as':_0x3b519e['as'],'attributes':_0x3b519e[_0x17e8('0x1b')],'include':_0x3b519e[_0x17e8('0x1d')]?_['map'](_0x3b519e[_0x17e8('0x1d')],function(_0x4fd2b5){return{'model':db[_0x4fd2b5[_0x17e8('0x1f')]],'as':_0x4fd2b5['as'],'attributes':_0x4fd2b5[_0x17e8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c7d0d){logger[_0x17e8('0xb')](_0x17e8('0x20'),_0x19d257);logger[_0x17e8('0xe')]('ShowTrunk',_0x19d257,JSON[_0x17e8('0x10')](_0x1c7d0d));_0x717439(_0x1c7d0d);})[_0x17e8('0x15')](function(_0x31e142){logger[_0x17e8('0x11')](_0x17e8('0x20'),_0x31e142[_0x17e8('0x13')],_0x19d257);_0x3a8dca(_0x1d68a4['error'](0x1f4,_0x31e142[_0x17e8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 43ef82d..4e552fa 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 _0x4c28=['getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/pause','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','update','put','/:id/password','changePassword','delete','removeChatInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','/:id/queues','/:id/queues_rt'];(function(_0x34f4e3,_0x5ea27d){var _0x4abd77=function(_0x34ba45){while(--_0x34ba45){_0x34f4e3['push'](_0x34f4e3['shift']());}};_0x4abd77(++_0x5ea27d);}(_0x4c28,0x195));var _0x84c2=function(_0x54cfaa,_0x1875de){_0x54cfaa=_0x54cfaa-0x0;var _0x27f8b4=_0x4c28[_0x54cfaa];return _0x27f8b4;};'use strict';var multer=require(_0x84c2('0x0'));var util=require(_0x84c2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x84c2('0x2'));var router=express[_0x84c2('0x3')]();var fs_extra=require(_0x84c2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x84c2('0x5'));var config=require(_0x84c2('0x6'));var controller=require(_0x84c2('0x7'));router[_0x84c2('0x8')]('/',auth[_0x84c2('0x9')](),controller[_0x84c2('0xa')]);router[_0x84c2('0x8')](_0x84c2('0xb'),auth['isAuthenticated'](),controller[_0x84c2('0xc')]);router['get'](_0x84c2('0xd'),auth[_0x84c2('0x9')](),controller[_0x84c2('0xe')]);router[_0x84c2('0x8')](_0x84c2('0xf'),auth['isAuthenticated'](),controller[_0x84c2('0x10')]);router['get'](_0x84c2('0x11'),auth['isAuthenticated'](),controller[_0x84c2('0x12')]);router['get'](_0x84c2('0x13'),controller['getAvatar']);router[_0x84c2('0x8')](_0x84c2('0x14'),auth[_0x84c2('0x9')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x84c2('0x9')](),controller['getContacts']);router[_0x84c2('0x8')](_0x84c2('0x15'),auth[_0x84c2('0x9')](),controller['getQueues']);router[_0x84c2('0x8')](_0x84c2('0x16'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x17')]);router[_0x84c2('0x8')](_0x84c2('0x18'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x19')]);router[_0x84c2('0x8')]('/:id/recordings',auth[_0x84c2('0x9')](),controller[_0x84c2('0x1a')]);router['get'](_0x84c2('0x1b'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x1c')]);router[_0x84c2('0x8')]('/:id/chat/interactions',auth[_0x84c2('0x9')](),controller[_0x84c2('0x1d')]);router['get']('/:id/openchannel/interactions',auth[_0x84c2('0x9')](),controller[_0x84c2('0x1e')]);router[_0x84c2('0x8')](_0x84c2('0x1f'),auth[_0x84c2('0x9')](),controller['getMailInteractions']);router[_0x84c2('0x8')](_0x84c2('0x20'),auth['isAuthenticated'](),controller['getSmsInteractions']);router['get'](_0x84c2('0x21'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x84c2('0x8')](_0x84c2('0x22'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x23')]);router['get'](_0x84c2('0x24'),auth['isAuthenticated'](),controller['getTeams']);router[_0x84c2('0x8')](_0x84c2('0x25'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x26')]);router[_0x84c2('0x8')](_0x84c2('0x27'),auth[_0x84c2('0x9')](),controller['getAgents']);router[_0x84c2('0x8')]('/:id/prefixes',auth[_0x84c2('0x9')](),controller[_0x84c2('0x28')]);router[_0x84c2('0x8')](_0x84c2('0x29'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x2a')]);router[_0x84c2('0x8')](_0x84c2('0x2b'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x2c')]);router[_0x84c2('0x8')](_0x84c2('0x2d'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x2e')]);router['get'](_0x84c2('0x2f'),auth[_0x84c2('0x9')](),controller['getSmsAccounts']);router[_0x84c2('0x8')]('/:id/chat_websites',auth[_0x84c2('0x9')](),controller[_0x84c2('0x30')]);router['get'](_0x84c2('0x31'),auth[_0x84c2('0x9')](),controller['getWhatsappAccounts']);router[_0x84c2('0x8')](_0x84c2('0x32'),auth['isAuthenticated'](),controller[_0x84c2('0x33')]);router['get'](_0x84c2('0x34'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x35')]);router[_0x84c2('0x8')](_0x84c2('0x36'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x37')]);router['post']('/:id/contacts',auth[_0x84c2('0x9')](),controller['addContacts']);router[_0x84c2('0x38')]('/',auth[_0x84c2('0x9')](),controller[_0x84c2('0x39')]);router['post'](_0x84c2('0x3a'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x84c2('0x38')](_0x84c2('0x15'),auth['isAuthenticated'](),controller[_0x84c2('0x3b')]);var upload=multer({'storage':multer[_0x84c2('0x3c')]({'destination':function(_0x46f77f,_0x31c79d,_0x4ef797){_0x4ef797(null,path[_0x84c2('0x3d')](config[_0x84c2('0x3e')],_0x84c2('0x3f')));},'filename':function(_0x2fb9fc,_0x4543ed,_0x286528){_0x286528(null,util['format'](_0x84c2('0x40'),Date[_0x84c2('0x41')](),_0x4543ed['originalname']));}})});router[_0x84c2('0x38')](_0x84c2('0x13'),upload[_0x84c2('0x42')](_0x84c2('0x43')),controller[_0x84c2('0x44')]);router[_0x84c2('0x38')](_0x84c2('0x45'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x46')]);router['post']('/:id/logout',auth[_0x84c2('0x9')](),controller['logout']);router['post'](_0x84c2('0x47'),auth['isAuthenticated'](),controller[_0x84c2('0x48')]);router[_0x84c2('0x38')]('/:id/unpause',auth[_0x84c2('0x9')](),controller[_0x84c2('0x49')]);router[_0x84c2('0x38')](_0x84c2('0x24'),auth[_0x84c2('0x9')](),controller['addTeams']);router['post'](_0x84c2('0x4a'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x4b')]);router[_0x84c2('0x38')](_0x84c2('0x4c'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x4d')]);router['post'](_0x84c2('0x4e'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x4f')]);router[_0x84c2('0x38')](_0x84c2('0x50'),auth['isAuthenticated'](),controller[_0x84c2('0x51')]);router[_0x84c2('0x38')](_0x84c2('0x52'),auth['isAuthenticated'](),controller[_0x84c2('0x53')]);router['post'](_0x84c2('0x54'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x55')]);router[_0x84c2('0x38')]('/:id/fax_accounts',auth[_0x84c2('0x9')](),controller[_0x84c2('0x56')]);router[_0x84c2('0x38')](_0x84c2('0x2b'),auth['isAuthenticated'](),controller[_0x84c2('0x57')]);router[_0x84c2('0x38')](_0x84c2('0x2d'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x58')]);router[_0x84c2('0x38')](_0x84c2('0x2f'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x59')]);router['post']('/:id/chat_websites',auth[_0x84c2('0x9')](),controller[_0x84c2('0x5a')]);router[_0x84c2('0x38')](_0x84c2('0x31'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x5b')]);router[_0x84c2('0x38')]('/:id/square_projects',auth[_0x84c2('0x9')](),controller[_0x84c2('0x5c')]);router[_0x84c2('0x38')](_0x84c2('0x36'),auth[_0x84c2('0x9')](),controller['createApiKey']);router['put'](_0x84c2('0x11'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x5d')]);router[_0x84c2('0x5e')](_0x84c2('0x5f'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x60')]);router[_0x84c2('0x61')](_0x84c2('0x15'),auth['isAuthenticated'](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x84c2('0x9')](),controller['removeTeams']);router[_0x84c2('0x61')]('/:id',auth[_0x84c2('0x9')](),controller['destroy']);router[_0x84c2('0x61')]('/:id/chat_interactions',auth[_0x84c2('0x9')](),controller[_0x84c2('0x62')]);router[_0x84c2('0x61')]('/:id/mail_interactions',auth[_0x84c2('0x9')](),controller['removeMailInteractions']);router[_0x84c2('0x61')](_0x84c2('0x4e'),auth[_0x84c2('0x9')](),controller['removeFaxInteractions']);router[_0x84c2('0x61')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x84c2('0x63')]);router[_0x84c2('0x61')](_0x84c2('0x52'),auth[_0x84c2('0x9')](),controller['removeOpenchannelInteractions']);router[_0x84c2('0x61')](_0x84c2('0x54'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x64')]);router[_0x84c2('0x61')](_0x84c2('0x29'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x65')]);router[_0x84c2('0x61')]('/:id/mail_accounts',auth[_0x84c2('0x9')](),controller[_0x84c2('0x66')]);router[_0x84c2('0x61')](_0x84c2('0x2d'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x84c2('0x61')](_0x84c2('0x2f'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x67')]);router['delete']('/:id/chat_websites',auth[_0x84c2('0x9')](),controller['removeChatWebsites']);router[_0x84c2('0x61')](_0x84c2('0x31'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x68')]);router['delete'](_0x84c2('0x32'),auth[_0x84c2('0x9')](),controller[_0x84c2('0x69')]);router['delete'](_0x84c2('0x36'),auth['isAuthenticated'](),controller[_0x84c2('0x6a')]);module['exports']=router; \ No newline at end of file +var _0xce1a=['describe','/whoami','whoami','/presence','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','bulkCreate','addQueues','join','server/files/images/','%s-%s','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','createApiKey','/:id','update','put','changePassword','delete','/:id/queues','removeQueues','removeTeams','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe'];(function(_0x339974,_0x318f2f){var _0x56dc65=function(_0x30fe5a){while(--_0x30fe5a){_0x339974['push'](_0x339974['shift']());}};_0x56dc65(++_0x318f2f);}(_0xce1a,0x1b3));var _0xace1=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0xce1a[_0xb6a965];return _0x51d37d;};'use strict';var multer=require('multer');var util=require(_0xace1('0x0'));var path=require(_0xace1('0x1'));var timeout=require(_0xace1('0x2'));var express=require(_0xace1('0x3'));var router=express[_0xace1('0x4')]();var fs_extra=require(_0xace1('0x5'));var auth=require(_0xace1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xace1('0x7'));var controller=require(_0xace1('0x8'));router['get']('/',auth[_0xace1('0x9')](),controller[_0xace1('0xa')]);router[_0xace1('0xb')](_0xace1('0xc'),auth['isAuthenticated'](),controller[_0xace1('0xd')]);router[_0xace1('0xb')](_0xace1('0xe'),auth['isAuthenticated'](),controller[_0xace1('0xf')]);router[_0xace1('0xb')](_0xace1('0x10'),auth[_0xace1('0x9')](),controller['getPresence']);router[_0xace1('0xb')]('/:id',auth[_0xace1('0x9')](),controller[_0xace1('0x11')]);router[_0xace1('0xb')](_0xace1('0x12'),controller[_0xace1('0x13')]);router['get']('/:id/open_tabs',auth[_0xace1('0x9')](),controller[_0xace1('0x14')]);router[_0xace1('0xb')](_0xace1('0x15'),auth[_0xace1('0x9')](),controller[_0xace1('0x16')]);router[_0xace1('0xb')]('/:id/queues',auth['isAuthenticated'](),controller[_0xace1('0x17')]);router[_0xace1('0xb')](_0xace1('0x18'),auth[_0xace1('0x9')](),controller[_0xace1('0x19')]);router[_0xace1('0xb')](_0xace1('0x1a'),auth['isAuthenticated'](),controller[_0xace1('0x1b')]);router[_0xace1('0xb')](_0xace1('0x1c'),auth[_0xace1('0x9')](),controller[_0xace1('0x1d')]);router[_0xace1('0xb')]('/:id/screen_recordings',auth[_0xace1('0x9')](),controller[_0xace1('0x1e')]);router[_0xace1('0xb')]('/:id/chat/interactions',auth[_0xace1('0x9')](),controller['getChatInteractions']);router['get'](_0xace1('0x1f'),auth[_0xace1('0x9')](),controller[_0xace1('0x20')]);router[_0xace1('0xb')]('/:id/mail/interactions',auth[_0xace1('0x9')](),controller['getMailInteractions']);router[_0xace1('0xb')](_0xace1('0x21'),auth['isAuthenticated'](),controller[_0xace1('0x22')]);router[_0xace1('0xb')]('/:id/fax/interactions',auth[_0xace1('0x9')](),controller['getFaxInteractions']);router[_0xace1('0xb')](_0xace1('0x23'),auth[_0xace1('0x9')](),controller[_0xace1('0x24')]);router[_0xace1('0xb')](_0xace1('0x25'),auth[_0xace1('0x9')](),controller[_0xace1('0x26')]);router[_0xace1('0xb')](_0xace1('0x27'),auth[_0xace1('0x9')](),controller[_0xace1('0x28')]);router[_0xace1('0xb')](_0xace1('0x29'),auth[_0xace1('0x9')](),controller[_0xace1('0x2a')]);router[_0xace1('0xb')](_0xace1('0x2b'),auth[_0xace1('0x9')](),controller[_0xace1('0x2c')]);router[_0xace1('0xb')](_0xace1('0x2d'),auth[_0xace1('0x9')](),controller['getFaxAccounts']);router[_0xace1('0xb')](_0xace1('0x2e'),auth['isAuthenticated'](),controller[_0xace1('0x2f')]);router[_0xace1('0xb')](_0xace1('0x30'),auth[_0xace1('0x9')](),controller[_0xace1('0x31')]);router[_0xace1('0xb')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xace1('0x32')]);router[_0xace1('0xb')](_0xace1('0x33'),auth[_0xace1('0x9')](),controller[_0xace1('0x34')]);router['get'](_0xace1('0x35'),auth[_0xace1('0x9')](),controller[_0xace1('0x36')]);router[_0xace1('0xb')](_0xace1('0x37'),auth[_0xace1('0x9')](),controller[_0xace1('0x38')]);router['get'](_0xace1('0x39'),auth[_0xace1('0x9')](),controller[_0xace1('0x3a')]);router['get'](_0xace1('0x3b'),auth[_0xace1('0x9')](),controller[_0xace1('0x3c')]);router[_0xace1('0x3d')](_0xace1('0x15'),auth[_0xace1('0x9')](),controller['addContacts']);router['post']('/',auth[_0xace1('0x9')](),controller[_0xace1('0x3e')]);router[_0xace1('0x3d')]('/create_many',auth[_0xace1('0x9')](),controller[_0xace1('0x3f')]);router[_0xace1('0x3d')]('/:id/queues',auth[_0xace1('0x9')](),controller[_0xace1('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x192eba,_0x17acdb,_0x3c90a2){_0x3c90a2(null,path[_0xace1('0x41')](config['root'],_0xace1('0x42')));},'filename':function(_0x33f95b,_0x5a877c,_0x4bae5b){_0x4bae5b(null,util['format'](_0xace1('0x43'),Date['now'](),_0x5a877c['originalname']));}})});router[_0xace1('0x3d')]('/:id/avatar',upload[_0xace1('0x44')]('file'),controller[_0xace1('0x45')]);router[_0xace1('0x3d')](_0xace1('0x46'),auth['isAuthenticated'](),controller['login']);router[_0xace1('0x3d')](_0xace1('0x47'),auth[_0xace1('0x9')](),controller[_0xace1('0x48')]);router[_0xace1('0x3d')](_0xace1('0x49'),auth['isAuthenticated'](),controller[_0xace1('0x4a')]);router[_0xace1('0x3d')](_0xace1('0x4b'),auth[_0xace1('0x9')](),controller[_0xace1('0x4c')]);router[_0xace1('0x3d')]('/:id/teams',auth[_0xace1('0x9')](),controller['addTeams']);router[_0xace1('0x3d')](_0xace1('0x4d'),auth[_0xace1('0x9')](),controller['addChatInteractions']);router[_0xace1('0x3d')](_0xace1('0x4e'),auth[_0xace1('0x9')](),controller[_0xace1('0x4f')]);router[_0xace1('0x3d')](_0xace1('0x50'),auth['isAuthenticated'](),controller[_0xace1('0x51')]);router[_0xace1('0x3d')](_0xace1('0x52'),auth[_0xace1('0x9')](),controller[_0xace1('0x53')]);router[_0xace1('0x3d')](_0xace1('0x54'),auth[_0xace1('0x9')](),controller['addOpenchannelInteractions']);router[_0xace1('0x3d')]('/:id/whatsapp_interactions',auth[_0xace1('0x9')](),controller['addWhatsappInteractions']);router[_0xace1('0x3d')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xace1('0x55')]);router[_0xace1('0x3d')](_0xace1('0x2e'),auth['isAuthenticated'](),controller[_0xace1('0x56')]);router['post']('/:id/openchannel_accounts',auth[_0xace1('0x9')](),controller[_0xace1('0x57')]);router[_0xace1('0x3d')](_0xace1('0x58'),auth[_0xace1('0x9')](),controller[_0xace1('0x59')]);router['post'](_0xace1('0x33'),auth[_0xace1('0x9')](),controller[_0xace1('0x5a')]);router[_0xace1('0x3d')]('/:id/whatsapp_accounts',auth[_0xace1('0x9')](),controller['addWhatsappAccounts']);router['post'](_0xace1('0x37'),auth[_0xace1('0x9')](),controller['addSquareProjects']);router[_0xace1('0x3d')](_0xace1('0x3b'),auth[_0xace1('0x9')](),controller[_0xace1('0x5b')]);router['put'](_0xace1('0x5c'),auth[_0xace1('0x9')](),controller[_0xace1('0x5d')]);router[_0xace1('0x5e')]('/:id/password',auth[_0xace1('0x9')](),controller[_0xace1('0x5f')]);router[_0xace1('0x60')](_0xace1('0x61'),auth[_0xace1('0x9')](),controller[_0xace1('0x62')]);router[_0xace1('0x60')](_0xace1('0x25'),auth[_0xace1('0x9')](),controller[_0xace1('0x63')]);router[_0xace1('0x60')](_0xace1('0x5c'),auth[_0xace1('0x9')](),controller['destroy']);router['delete'](_0xace1('0x4d'),auth['isAuthenticated'](),controller[_0xace1('0x64')]);router[_0xace1('0x60')](_0xace1('0x4e'),auth[_0xace1('0x9')](),controller['removeMailInteractions']);router[_0xace1('0x60')](_0xace1('0x50'),auth[_0xace1('0x9')](),controller[_0xace1('0x65')]);router[_0xace1('0x60')](_0xace1('0x52'),auth[_0xace1('0x9')](),controller[_0xace1('0x66')]);router[_0xace1('0x60')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xace1('0x67')]);router[_0xace1('0x60')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0xace1('0x68')]);router[_0xace1('0x60')](_0xace1('0x2d'),auth[_0xace1('0x9')](),controller[_0xace1('0x69')]);router[_0xace1('0x60')]('/:id/mail_accounts',auth[_0xace1('0x9')](),controller[_0xace1('0x6a')]);router[_0xace1('0x60')](_0xace1('0x30'),auth[_0xace1('0x9')](),controller['removeOpenchannelAccounts']);router[_0xace1('0x60')](_0xace1('0x58'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0xace1('0x60')](_0xace1('0x33'),auth['isAuthenticated'](),controller[_0xace1('0x6b')]);router[_0xace1('0x60')]('/:id/whatsapp_accounts',auth[_0xace1('0x9')](),controller[_0xace1('0x6c')]);router[_0xace1('0x60')](_0xace1('0x37'),auth['isAuthenticated'](),controller[_0xace1('0x6d')]);router[_0xace1('0x60')](_0xace1('0x3b'),auth[_0xace1('0x9')](),controller[_0xace1('0x6e')]);module[_0xace1('0x6f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 6904fd4..dfd6a71 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 _0xfcf0=['certificate','active','passive','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsverify','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','internal','email','toLowerCase','user','agent','local','INTEGER','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint'];(function(_0x443611,_0x47f4f9){var _0x569e4a=function(_0x58972c){while(--_0x58972c){_0x443611['push'](_0x443611['shift']());}};_0x569e4a(++_0x47f4f9);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0xfcf0[_0x2468b5];return _0x1056e4;};'use strict';var Sequelize=require(_0x0fcf('0x0'));var moment=require(_0x0fcf('0x1'));var util=require('util');var _=require(_0x0fcf('0x2'));module[_0x0fcf('0x3')]={'name':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':![],'unique':_0x0fcf('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5c865e){this[_0x0fcf('0x6')](_0x0fcf('0x5'),_0x5c865e);this[_0x0fcf('0x6')](_0x0fcf('0x7'),_0x5c865e);},'comment':_0x0fcf('0x8')},'fullname':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':![],'set':function(_0x61bbb9){this[_0x0fcf('0x6')]('fullname',_0x61bbb9);this[_0x0fcf('0x6')](_0x0fcf('0x9'),util[_0x0fcf('0xa')]('\x22%s\x22\x20<%s>',_0x61bbb9,this[_0x0fcf('0xb')](_0x0fcf('0xc'))));}},'alias':{'type':Sequelize[_0x0fcf('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0fcf('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5c29ed){if(_0x5c29ed){this[_0x0fcf('0x6')](_0x0fcf('0xd'),_0x5c29ed[_0x0fcf('0xe')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x0fcf('0xf'),_0x0fcf('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0fcf('0x4')],'defaultValue':_0x0fcf('0x11')},'internal':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':![],'unique':_0x0fcf('0xc'),'set':function(_0x48bba6){this[_0x0fcf('0x6')](_0x0fcf('0xc'),_0x48bba6);this[_0x0fcf('0x6')]('accountcode',_0x48bba6);this[_0x0fcf('0x6')](_0x0fcf('0x9'),util[_0x0fcf('0xa')](_0x0fcf('0x13'),this['getDataValue'](_0x0fcf('0x14')),_0x48bba6));}},'salt':{'type':Sequelize[_0x0fcf('0x4')]},'phone':{'type':Sequelize[_0x0fcf('0x4')]},'mobile':{'type':Sequelize[_0x0fcf('0x4')]},'address':{'type':Sequelize[_0x0fcf('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x0fcf('0x4')]},'city':{'type':Sequelize[_0x0fcf('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0fcf('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0fcf('0x4')],'defaultValue':_0x0fcf('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0fcf('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0fcf('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0fcf('0x18')},'ipaddr':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x0fcf('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x1a'),_0x0fcf('0xf'),_0x0fcf('0x1b')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x0fcf('0x19')]('ALLOWED_NOT_SCREENED',_0x0fcf('0x1c'),_0x0fcf('0x1d'),'ALLOWED',_0x0fcf('0x1e'),_0x0fcf('0x1f'),_0x0fcf('0x20'),_0x0fcf('0x21')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![],'defaultValue':_0x0fcf('0x22'),'set':function(_0x19488a){this[_0x0fcf('0x6')]('transport',_0x19488a?_0x19488a[_0x0fcf('0x23')](','):null);},'get':function(){return this[_0x0fcf('0xb')](_0x0fcf('0x24'))?this[_0x0fcf('0xb')](_0x0fcf('0x24'))[_0x0fcf('0x25')](','):null;},'comment':_0x0fcf('0x26')},'dtmfmode':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x27'),_0x0fcf('0x28'),_0x0fcf('0x29'),_0x0fcf('0x2a'),_0x0fcf('0x2b')),'allowNull':!![],'defaultValue':_0x0fcf('0x27')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x0fcf('0x2c'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0fcf('0x2e'),'set':function(_0x15db0d){this[_0x0fcf('0x6')]('nat',_0x15db0d?_0x15db0d[_0x0fcf('0x23')](','):null);},'get':function(){return this[_0x0fcf('0xb')](_0x0fcf('0x2f'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x0fcf('0x30')},'callgroup':{'type':Sequelize[_0x0fcf('0x4')]},'namedcallgroup':{'type':Sequelize[_0x0fcf('0x4')]},'pickupgroup':{'type':Sequelize[_0x0fcf('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x0fcf('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0fcf('0x4')]},'disallow':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':![],'defaultValue':_0x0fcf('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x13e4b2){this[_0x0fcf('0x6')](_0x0fcf('0x32'),_0x13e4b2?_0x13e4b2[_0x0fcf('0x23')](';'):_0x0fcf('0x33'));},'get':function(){return this['getDataValue'](_0x0fcf('0x32'))?this[_0x0fcf('0xb')](_0x0fcf('0x32'))[_0x0fcf('0x25')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![],'set':function(_0x5544e3){this[_0x0fcf('0x6')](_0x0fcf('0x34'),_0x5544e3?_0x5544e3['join'](','):null);},'get':function(){return this[_0x0fcf('0xb')](_0x0fcf('0x34'))?this[_0x0fcf('0xb')](_0x0fcf('0x34'))[_0x0fcf('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0fcf('0x19')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![],'defaultValue':_0x0fcf('0x35')},'amaflags':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0fcf('0x19')]('yes','no'),'allowNull':!![],'defaultValue':_0x0fcf('0x2d')},'busylevel':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0fcf('0x19')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0fcf('0x19')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no',_0x0fcf('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x0fcf('0x37'),_0x0fcf('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x0fcf('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0fcf('0x19')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0fcf('0x19')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0fcf('0x19')]('yes','no',_0x0fcf('0x3b'),_0x0fcf('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x0fcf('0x3d'),_0x0fcf('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0fcf('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0fcf('0x19')](_0x0fcf('0x2d'),'no',_0x0fcf('0x2c'),_0x0fcf('0x3f'),_0x0fcf('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0fcf('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x0fcf('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0fcf('0x41')]},'showWebBar':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0,'set':function(_0x6af0f5){this[_0x0fcf('0x6')](_0x0fcf('0x42'),_0x6af0f5);var _0x1b6028=this[_0x0fcf('0x43')]({'plain':!![]});switch(_0x6af0f5){case 0x0:case 0x1:var _0x5e97b9=_0x1b6028['transport']?_[_0x0fcf('0x44')](_0x1b6028[_0x0fcf('0x24')])?_0x1b6028['transport'][_0x0fcf('0x23')]():_0x1b6028[_0x0fcf('0x24')]:_0x0fcf('0x22');if(_0x5e97b9===_0x0fcf('0x45')){_0x5e97b9='udp';}this[_0x0fcf('0x6')](_0x0fcf('0x24'),_0x5e97b9);this[_0x0fcf('0x6')](_0x0fcf('0x46'),'no');this[_0x0fcf('0x6')](_0x0fcf('0x47'),null);this['setDataValue'](_0x0fcf('0x48'),null);this[_0x0fcf('0x6')](_0x0fcf('0x49'),null);this[_0x0fcf('0x6')](_0x0fcf('0x4a'),null);this['setDataValue']('dtlsverify',null);this[_0x0fcf('0x6')](_0x0fcf('0x4b'),null);this[_0x0fcf('0x6')](_0x0fcf('0x4c'),null);this[_0x0fcf('0x6')](_0x0fcf('0x4d'),null);this[_0x0fcf('0x6')](_0x0fcf('0x4e'),'no');break;case 0x2:this[_0x0fcf('0x6')](_0x0fcf('0x24'),'wss');this[_0x0fcf('0x6')](_0x0fcf('0x46'),_0x0fcf('0x2d'));this[_0x0fcf('0x6')](_0x0fcf('0x47'),_0x0fcf('0x2d'));this[_0x0fcf('0x6')](_0x0fcf('0x48'),_0x0fcf('0x2d'));this['setDataValue']('icesupport','yes');this['setDataValue'](_0x0fcf('0x4a'),'yes');this[_0x0fcf('0x6')](_0x0fcf('0x4f'),'no');this[_0x0fcf('0x6')]('dtlssetup','actpass');this[_0x0fcf('0x6')](_0x0fcf('0x4c'),_0x1b6028['dtlscertfile']||_0x0fcf('0x50'));this[_0x0fcf('0x6')]('dtlsprivatekey',_0x1b6028[_0x0fcf('0x4d')]||_0x0fcf('0x51'));this[_0x0fcf('0x6')](_0x0fcf('0x4e'),_0x0fcf('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x0fcf('0x41')],'set':function(_0x4704c9){this['setDataValue'](_0x0fcf('0x52'),_0x4704c9?_0x4704c9[_0x0fcf('0x23')](','):[]);},'get':function(){return this[_0x0fcf('0xb')](_0x0fcf('0x52'))?_[_0x0fcf('0x53')](this[_0x0fcf('0xb')]('permissions')['split'](','),function(_0x39b8da){return parseInt(_0x39b8da,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0fcf('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0fcf('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0fcf('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0fcf('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0fcf('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0fcf('0x54')],'get':function(){return this[_0x0fcf('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0fcf('0xb')](_0x0fcf('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0fcf('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0fcf('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![],'set':function(_0x395410){if(typeof _0x395410==='string'){var _0x1c3825=_0x395410==='1'?!![]:_0x395410==='0'?![]:_0x395410===_0x0fcf('0x56')?!![]:_0x395410===_0x0fcf('0x57')?![]:![];this['setDataValue']('screenrecording',_0x1c3825);}else{this['setDataValue'](_0x0fcf('0x58'),_0x395410);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3525e0){this[_0x0fcf('0x6')](_0x0fcf('0x59'),_0x3525e0);if(_0x3525e0===!![]){this[_0x0fcf('0x6')](_0x0fcf('0x5a'),moment());this[_0x0fcf('0x6')](_0x0fcf('0x5b'),0x0);}else{this[_0x0fcf('0x6')](_0x0fcf('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0fcf('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0fcf('0x12')](0x5)[_0x0fcf('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0fcf('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdc86=['accept','originate','uas','certificate','active','passive','actpass','showWebBar','get','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','dtlsenable','permissions','true','false','blocked','blockedAt','loginAttempts','UNSIGNED','moment','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','telephone','local','INTEGER','accountcode','format','getDataValue','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','split','rfc2833','info','shortinfo','inband','nonat','update','yes','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc86,0x118));var _0x6dc8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdc86[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6dc8('0x0'));var util=require('util');var _=require(_0x6dc8('0x1'));module['exports']={'name':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':![],'unique':_0x6dc8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x36fe6a){this[_0x6dc8('0x4')](_0x6dc8('0x3'),_0x36fe6a);this['setDataValue'](_0x6dc8('0x5'),_0x36fe6a);},'comment':_0x6dc8('0x6')},'fullname':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':![],'set':function(_0x9b1bcc){this[_0x6dc8('0x4')](_0x6dc8('0x7'),_0x9b1bcc);this[_0x6dc8('0x4')](_0x6dc8('0x8'),util['format'](_0x6dc8('0x9'),_0x9b1bcc,this['getDataValue'](_0x6dc8('0xa'))));}},'alias':{'type':Sequelize[_0x6dc8('0x2')]},'email':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':![],'unique':_0x6dc8('0xb'),'validate':{'isEmail':!![]},'set':function(_0x504a47){if(_0x504a47){this[_0x6dc8('0x4')](_0x6dc8('0xb'),_0x504a47[_0x6dc8('0xc')]());}}},'role':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0xe'),_0x6dc8('0xf'),'agent',_0x6dc8('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x6dc8('0x11')},'internal':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':![],'unique':_0x6dc8('0xa'),'set':function(_0x58c295){this[_0x6dc8('0x4')](_0x6dc8('0xa'),_0x58c295);this[_0x6dc8('0x4')](_0x6dc8('0x13'),_0x58c295);this[_0x6dc8('0x4')](_0x6dc8('0x8'),util[_0x6dc8('0x14')](_0x6dc8('0x9'),this[_0x6dc8('0x15')]('fullname'),_0x58c295));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6dc8('0x2')]},'mobile':{'type':Sequelize[_0x6dc8('0x2')]},'address':{'type':Sequelize[_0x6dc8('0x2')]},'zipcode':{'type':Sequelize[_0x6dc8('0x2')]},'userpic':{'type':Sequelize[_0x6dc8('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6dc8('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6dc8('0x2')],'defaultValue':_0x6dc8('0x18')},'lastPauseAt':{'type':Sequelize[_0x6dc8('0x16')]},'chatCapacity':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6dc8('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6dc8('0x19')},'ipaddr':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x6dc8('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6dc8('0xd')]('friend','user','peer'),'allowNull':!![],'defaultValue':_0x6dc8('0x1a')},'context':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![],'defaultValue':_0x6dc8('0x1b')},'callingpres':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x1c'),_0x6dc8('0x1d'),_0x6dc8('0x1e'),_0x6dc8('0x1f'),_0x6dc8('0x20'),_0x6dc8('0x21'),'PROHIB_FAILED_SCREEN',_0x6dc8('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3f1f07){this['setDataValue'](_0x6dc8('0x23'),_0x3f1f07?_0x3f1f07['join'](','):null);},'get':function(){return this[_0x6dc8('0x15')](_0x6dc8('0x23'))?this['getDataValue'](_0x6dc8('0x23'))[_0x6dc8('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x25'),_0x6dc8('0x26'),_0x6dc8('0x27'),_0x6dc8('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x6dc8('0xd')]('yes','no',_0x6dc8('0x29'),_0x6dc8('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![],'defaultValue':_0x6dc8('0x2c'),'set':function(_0x41f5c1){this[_0x6dc8('0x4')](_0x6dc8('0x2d'),_0x41f5c1?_0x41f5c1[_0x6dc8('0x2e')](','):null);},'get':function(){return this['getDataValue'](_0x6dc8('0x2d'))?this[_0x6dc8('0x15')](_0x6dc8('0x2d'))[_0x6dc8('0x24')](','):null;},'comment':_0x6dc8('0x2f')},'callgroup':{'type':Sequelize[_0x6dc8('0x2')]},'namedcallgroup':{'type':Sequelize[_0x6dc8('0x2')]},'pickupgroup':{'type':Sequelize[_0x6dc8('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6dc8('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':![],'defaultValue':_0x6dc8('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6dc8('0x31'),'set':function(_0x2f4078){this[_0x6dc8('0x4')](_0x6dc8('0x32'),_0x2f4078?_0x2f4078[_0x6dc8('0x2e')](';'):_0x6dc8('0x31'));},'get':function(){return this[_0x6dc8('0x15')](_0x6dc8('0x32'))?this[_0x6dc8('0x15')](_0x6dc8('0x32'))[_0x6dc8('0x24')](';'):null;},'comment':_0x6dc8('0x33')},'autoframing':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![],'set':function(_0x17a139){this[_0x6dc8('0x4')](_0x6dc8('0x34'),_0x17a139?_0x17a139['join'](','):null);},'get':function(){return this['getDataValue'](_0x6dc8('0x34'))?this[_0x6dc8('0x15')](_0x6dc8('0x34'))[_0x6dc8('0x24')](','):null;},'comment':_0x6dc8('0x35')},'trustrpid':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6dc8('0x2b'),'no',_0x6dc8('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6dc8('0xd')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x6dc8('0x2b')},'busylevel':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no',_0x6dc8('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x38'),'refuse',_0x6dc8('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6dc8('0xd')]('uac','uas'),'allowNull':!![],'defaultValue':_0x6dc8('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x6dc8('0x2b')},'keepalive':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6dc8('0xd')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6dc8('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no','fingerprint',_0x6dc8('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x6dc8('0x3c'),_0x6dc8('0x3d'),_0x6dc8('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6dc8('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no',_0x6dc8('0x29'),_0x6dc8('0x2a'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x6dc8('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0,'set':function(_0x287689){this[_0x6dc8('0x4')](_0x6dc8('0x3f'),_0x287689);var _0x5da4b2=this[_0x6dc8('0x40')]({'plain':!![]});switch(_0x287689){case 0x0:case 0x1:var _0x1ef1f7=_0x5da4b2['transport']?_[_0x6dc8('0x41')](_0x5da4b2['transport'])?_0x5da4b2[_0x6dc8('0x23')][_0x6dc8('0x2e')]():_0x5da4b2[_0x6dc8('0x23')]:_0x6dc8('0x42');if(_0x1ef1f7==='wss'){_0x1ef1f7=_0x6dc8('0x42');}this['setDataValue'](_0x6dc8('0x23'),_0x1ef1f7);this[_0x6dc8('0x4')](_0x6dc8('0x43'),'no');this['setDataValue'](_0x6dc8('0x44'),null);this[_0x6dc8('0x4')](_0x6dc8('0x45'),null);this['setDataValue'](_0x6dc8('0x46'),null);this['setDataValue']('dtlsenable',null);this['setDataValue'](_0x6dc8('0x47'),null);this[_0x6dc8('0x4')]('dtlssetup',null);this[_0x6dc8('0x4')](_0x6dc8('0x48'),null);this['setDataValue'](_0x6dc8('0x49'),null);this['setDataValue'](_0x6dc8('0x4a'),'no');break;case 0x2:this[_0x6dc8('0x4')](_0x6dc8('0x23'),_0x6dc8('0x4b'));this[_0x6dc8('0x4')](_0x6dc8('0x43'),_0x6dc8('0x2b'));this[_0x6dc8('0x4')]('avpf',_0x6dc8('0x2b'));this[_0x6dc8('0x4')](_0x6dc8('0x45'),_0x6dc8('0x2b'));this[_0x6dc8('0x4')]('icesupport','yes');this[_0x6dc8('0x4')](_0x6dc8('0x4c'),_0x6dc8('0x2b'));this[_0x6dc8('0x4')]('dtlsverify','no');this[_0x6dc8('0x4')]('dtlssetup','actpass');this[_0x6dc8('0x4')]('dtlscertfile',_0x5da4b2[_0x6dc8('0x48')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x6dc8('0x49'),_0x5da4b2['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x6dc8('0x4')](_0x6dc8('0x4a'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x490e54){this[_0x6dc8('0x4')]('permissions',_0x490e54?_0x490e54[_0x6dc8('0x2e')](','):[]);},'get':function(){return this[_0x6dc8('0x15')](_0x6dc8('0x4d'))?_['map'](this['getDataValue']('permissions')[_0x6dc8('0x24')](','),function(_0x420c3b){return parseInt(_0x420c3b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6dc8('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6dc8('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6dc8('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6dc8('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6dc8('0xd')](_0x6dc8('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6dc8('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6dc8('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0x6dc8('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6dc8('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':![],'set':function(_0x2dcfc7){if(typeof _0x2dcfc7==='string'){var _0x37814b=_0x2dcfc7==='1'?!![]:_0x2dcfc7==='0'?![]:_0x2dcfc7===_0x6dc8('0x4e')?!![]:_0x2dcfc7===_0x6dc8('0x4f')?![]:![];this[_0x6dc8('0x4')]('screenrecording',_0x37814b);}else{this[_0x6dc8('0x4')]('screenrecording',_0x2dcfc7);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x49e1c1){this[_0x6dc8('0x4')](_0x6dc8('0x50'),_0x49e1c1);if(_0x49e1c1===!![]){this[_0x6dc8('0x4')](_0x6dc8('0x51'),moment());this[_0x6dc8('0x4')](_0x6dc8('0x52'),0x0);}else{this[_0x6dc8('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x6dc8('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6dc8('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6dc8('0x12')](0x5)[_0x6dc8('0x53')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6dc8('0x17')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 25786bf..77dad66 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 _0x809f=['user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$eq','$between','$in','$notIn','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','CmContact','Contact','dialActive','getApiKey','token','generateApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','isEmpty','queues','inbound','toString','desc','uniqBy','orderBy','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','toUpperCase','select','field','ui.','ui.createdAt','ui.UserId\x20=\x20?','OpenTabs','rimraf','request-promise','moment','bluebird','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','jayson/promise','http','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','destroy','get','role','Users','user','agent','telephone','filter','ignore','map','value','includes','find','UserProfileResource','name','send','index','rawAttributes','type','model','differenceBy','salt','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','sequelize','lower','col','merge','options','User','include','push','findAll','rows','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','all','show','params','password','update','body','describe','addContacts','omit','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','email','permissions','102','103','113','110','105','107','108','109','111','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','Agents','Telephones','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','each','userProfileId','autoAssociation','compact','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','channel','online','voicePause','interface','Unknown\x20channel','add','capitalize','Queues','ids','spread','toLowerCase','QueueId','Queue:save','VoiceQueue','SIP/%s','penalty','UserVoiceQueueRt','upsert','remove','emit','Queue:remove','voice','addAvatar','userpic','file','filename','root','server/files/images/logos/default_profile.png','download','join','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','includeAll','CmList','List','Tag','Tags','color','tag','getQueues','isValidChannel','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','getVoiceQueues','loginInPause','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','bulkCreate','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','flatten','transaction','addAgent','getDataValue','removeTeams','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions'];(function(_0x18cebc,_0x51bb41){var _0x5d9079=function(_0x3c6d2e){while(--_0x3c6d2e){_0x18cebc['push'](_0x18cebc['shift']());}};_0x5d9079(++_0x51bb41);}(_0x809f,0x1f4));var _0xf809=function(_0x3290aa,_0x341233){_0x3290aa=_0x3290aa-0x0;var _0x185ba5=_0x809f[_0x3290aa];return _0x185ba5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf809('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf809('0x1'));var moment=require(_0xf809('0x2'));var BPromise=require(_0xf809('0x3'));var Mustache=require('mustache');var util=require(_0xf809('0x4'));var path=require(_0xf809('0x5'));var sox=require('sox');var csv=require(_0xf809('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf809('0x7'));var jsforce=require(_0xf809('0x8'));var deskjs=require(_0xf809('0x9'));var toCsv=require(_0xf809('0x6'));var querystring=require(_0xf809('0xa'));var Papa=require(_0xf809('0xb'));var Redis=require(_0xf809('0xc'));var values;var authService=require(_0xf809('0xd'));var qs=require(_0xf809('0xe'));var as=require(_0xf809('0xf'));var hardwareService=require(_0xf809('0x10'));var logger=require(_0xf809('0x11'))(_0xf809('0x12'));var utils=require(_0xf809('0x13'));var config=require(_0xf809('0x14'));var licenseUtil=require(_0xf809('0x15'));var db=require(_0xf809('0x16'))['db'];config[_0xf809('0x17')]=_[_0xf809('0x18')](config[_0xf809('0x17')],{'host':_0xf809('0x19'),'port':0x18eb});var socket=require(_0xf809('0x1a'))(new Redis(config[_0xf809('0x17')]));require(_0xf809('0x1b'))['register'](socket);var jayson=require(_0xf809('0x1c'));var client=jayson['client'][_0xf809('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5251a5,_0x1a50a1,_0xc18300,_0x2e8354){return new BPromise(function(_0x6533a4,_0xea18e0){var _0xf967c8=_0x2e8354||client;return _0xf967c8[_0xf809('0x1e')](_0x5251a5,_0xc18300)[_0xf809('0x1f')](function(_0x24f75d){logger['info'](_0xf809('0x20'),_0x1a50a1,_0xf809('0x21'));logger[_0xf809('0x22')](_0xf809('0x23'),_0x1a50a1,_0xf809('0x21'),JSON[_0xf809('0x24')](_0x24f75d));if(_0x24f75d[_0xf809('0x25')]){if(_0x24f75d[_0xf809('0x25')][_0xf809('0x26')]===0x1f4){logger[_0xf809('0x25')](_0xf809('0x20'),_0x1a50a1,_0x24f75d[_0xf809('0x25')]['message']);return _0xea18e0(_0x24f75d[_0xf809('0x25')][_0xf809('0x27')]);}logger[_0xf809('0x25')](_0xf809('0x20'),_0x1a50a1,_0x24f75d[_0xf809('0x25')]['message']);return _0x6533a4(_0x24f75d[_0xf809('0x25')]['message']);}else{logger[_0xf809('0x28')]('User,\x20%s,\x20%s',_0x1a50a1,_0xf809('0x21'));_0x6533a4(_0x24f75d[_0xf809('0x29')][_0xf809('0x27')]);}})[_0xf809('0x2a')](function(_0x4a2ed3){logger[_0xf809('0x25')](_0xf809('0x20'),_0x1a50a1,_0x4a2ed3);_0xea18e0(_0x4a2ed3);});});}function respondWithStatusCode(_0x2e49b5,_0x3a4bf5){_0x3a4bf5=_0x3a4bf5||0xcc;return function(_0x15dc06){if(_0x15dc06){return _0x2e49b5[_0xf809('0x2b')](_0x3a4bf5);}return _0x2e49b5[_0xf809('0x2c')](_0x3a4bf5)[_0xf809('0x2d')]();};}function respondWithResult(_0x205bde,_0x234683){_0x234683=_0x234683||0xc8;return function(_0x57298e){if(_0x57298e){return _0x205bde[_0xf809('0x2c')](_0x234683)[_0xf809('0x2e')](_0x57298e);}};}function respondWithFilteredResult(_0x5b6ee0,_0x4ecc6e){return function(_0x2da471){if(_0x2da471){var _0x47ca00=typeof _0x4ecc6e[_0xf809('0x2f')]===_0xf809('0x30')&&typeof _0x4ecc6e[_0xf809('0x31')]===_0xf809('0x30');var _0x208f03=_0x2da471[_0xf809('0x32')];var _0x42eb35=_0x47ca00?0x0:_0x4ecc6e[_0xf809('0x2f')];var _0x1380f3=_0x47ca00?_0x2da471['count']:_0x4ecc6e[_0xf809('0x2f')]+_0x4ecc6e[_0xf809('0x31')];var _0x7fb6fc;if(_0x1380f3>=_0x208f03){_0x1380f3=_0x208f03;_0x7fb6fc=0xc8;}else{_0x7fb6fc=0xce;}_0x5b6ee0[_0xf809('0x2c')](_0x7fb6fc);return _0x5b6ee0[_0xf809('0x33')]('Content-Range',_0x42eb35+'-'+_0x1380f3+'/'+_0x208f03)['json'](_0x2da471);}return null;};}function patchUpdates(_0x7bf61d){return function(_0x261a7){try{jsonpatch[_0xf809('0x34')](_0x261a7,_0x7bf61d,!![]);}catch(_0x131223){return BPromise['reject'](_0x131223);}return _0x261a7[_0xf809('0x35')]();};}function saveUpdates(_0x31b26a,_0x23458c){return function(_0xdb52a3){if(_0xdb52a3){return _0xdb52a3['update'](_0x31b26a)[_0xf809('0x1f')](function(_0x3211d2){return _0x3211d2;});}return null;};}function removeEntity(_0x1ccfe0,_0x54cfcb){return function(_0x5d9d92){if(_0x5d9d92){return _0x5d9d92[_0xf809('0x36')]()[_0xf809('0x1f')](function(){var _0x2ea7d0=_0x5d9d92[_0xf809('0x37')]({'plain':!![]});if(_0x2ea7d0[_0xf809('0x38')]==='admin')return;var _0x3eda52=[{'name':_0xf809('0x39'),'value':_0xf809('0x3a'),'ignore':!![]},{'name':'Agents','value':_0xf809('0x3b'),'ignore':![]},{'name':'Telephones','value':_0xf809('0x3c'),'ignore':![]}];var _0x1ed9be=_(_0x3eda52)[_0xf809('0x3d')](_0xf809('0x3e'))[_0xf809('0x3f')](_0xf809('0x40'))[_0xf809('0x40')]();if(_[_0xf809('0x41')](_0x1ed9be,_0x2ea7d0[_0xf809('0x38')])){return;}var _0x322642=_[_0xf809('0x42')](_0x3eda52,[_0xf809('0x40'),_0x2ea7d0[_0xf809('0x38')]])['name'];return db[_0xf809('0x43')][_0xf809('0x36')]({'where':{'type':_0x322642,'resourceId':_0x2ea7d0['id']}})[_0xf809('0x1f')](function(){return _0x5d9d92;});})[_0xf809('0x1f')](function(){_0x1ccfe0['status'](0xcc)[_0xf809('0x2d')]();});}};}function handleEntityNotFound(_0x12947f,_0x33c49b){return function(_0x3d5083){if(!_0x3d5083){_0x12947f['sendStatus'](0x194);}return _0x3d5083;};}function handleError(_0x3dcc12,_0x8e40b0){_0x8e40b0=_0x8e40b0||0x1f4;return function(_0x59f77b){logger['error'](_0x59f77b['stack']);if(_0x59f77b[_0xf809('0x44')]){delete _0x59f77b['name'];}_0x3dcc12[_0xf809('0x2c')](_0x8e40b0)[_0xf809('0x45')](_0x59f77b);};}exports[_0xf809('0x46')]=function(_0x41392f,_0x597528){var _0x4e8214={},_0x2489ed={},_0x4fd6c3={'count':0x0,'rows':[]};var _0x3fd390=_[_0xf809('0x3f')](db['User'][_0xf809('0x47')],function(_0x4fd5c3){return{'name':_0x4fd5c3['fieldName'],'type':_0x4fd5c3[_0xf809('0x48')]['key']};});_0x2489ed[_0xf809('0x49')]=_[_0xf809('0x4a')](_[_0xf809('0x3f')](_0x3fd390,_0xf809('0x44')),['password',_0xf809('0x4b')]);_0x2489ed[_0xf809('0x4c')]=_[_0xf809('0x4d')](_0x41392f[_0xf809('0x4c')]);_0x2489ed[_0xf809('0x4e')]=_[_0xf809('0x4f')](_0x2489ed[_0xf809('0x49')],_0x2489ed[_0xf809('0x4c')]);_0x4e8214[_0xf809('0x50')]=_[_0xf809('0x4f')](_0x2489ed[_0xf809('0x49')],qs[_0xf809('0x51')](_0x41392f[_0xf809('0x4c')][_0xf809('0x51')]));_0x4e8214[_0xf809('0x50')]=_0x4e8214['attributes'][_0xf809('0x52')]?_0x4e8214[_0xf809('0x50')]:_0x2489ed['model'];if(!_0x41392f['query'][_0xf809('0x53')](_0xf809('0x54'))){_0x4e8214[_0xf809('0x31')]=qs['limit'](_0x41392f[_0xf809('0x4c')]['limit']);_0x4e8214[_0xf809('0x2f')]=qs[_0xf809('0x2f')](_0x41392f['query']['offset']);}_0x4e8214[_0xf809('0x55')]=qs[_0xf809('0x56')](_0x41392f['query']['sort']);_0x4e8214[_0xf809('0x57')]=qs['filters'](_[_0xf809('0x58')](_0x41392f[_0xf809('0x4c')],_0x2489ed[_0xf809('0x4e')]),_0x3fd390);if(_0x41392f[_0xf809('0x4c')][_0xf809('0x3d')]){_0x4e8214[_0xf809('0x57')]=_['merge'](_0x4e8214['where'],{'$or':_['map'](_0x3fd390,function(_0x31257d){if(_0x31257d[_0xf809('0x48')]!==_0xf809('0x59')){return db[_0xf809('0x5a')][_0xf809('0x57')](db[_0xf809('0x5a')]['fn'](_0xf809('0x5b'),db[_0xf809('0x5a')][_0xf809('0x5c')](_0x31257d[_0xf809('0x44')])),{'$like':db['sequelize']['fn']('lower','%'+_0x41392f[_0xf809('0x4c')][_0xf809('0x3d')]+'%')});}})});}_0x4e8214=_[_0xf809('0x5d')]({},_0x4e8214,_0x41392f[_0xf809('0x5e')]);var _0x13ca33={'where':_0x4e8214['where']};return db[_0xf809('0x5f')][_0xf809('0x32')](_0x13ca33)['then'](function(_0x295f6f){_0x4fd6c3[_0xf809('0x32')]=_0x295f6f;if(_0x41392f[_0xf809('0x4c')]['includeAll']){_0x4e8214[_0xf809('0x60')]=[{'all':!![]}];}if(!_[_0xf809('0x41')](_0x4e8214[_0xf809('0x50')],'id')){_0x4e8214[_0xf809('0x50')][_0xf809('0x61')]('id');}return db['User'][_0xf809('0x62')](_0x4e8214);})[_0xf809('0x1f')](function(_0x44ccdd){_0x4fd6c3[_0xf809('0x63')]=_0x44ccdd;if(_0x41392f[_0xf809('0x4c')][_0xf809('0x64')]===_0xf809('0x65')){var _0x2d305c=[];for(var _0x21f577=0x0;_0x21f577<_0x4fd6c3[_0xf809('0x63')][_0xf809('0x52')];_0x21f577++){_0x2d305c[_0xf809('0x61')](get_open_tabs(_0xf809('0x66'),_0x4fd6c3[_0xf809('0x63')][_0x21f577][_0xf809('0x67')]));_0x2d305c[_0xf809('0x61')](get_open_tabs(_0xf809('0x68'),_0x4fd6c3[_0xf809('0x63')][_0x21f577]['dataValues']));_0x2d305c[_0xf809('0x61')](get_open_tabs(_0xf809('0x69'),_0x4fd6c3[_0xf809('0x63')][_0x21f577]['dataValues']));_0x2d305c['push'](get_open_tabs(_0xf809('0x6a'),_0x4fd6c3[_0xf809('0x63')][_0x21f577]['dataValues']));_0x2d305c[_0xf809('0x61')](get_open_tabs(_0xf809('0x6b'),_0x4fd6c3['rows'][_0x21f577][_0xf809('0x67')]));_0x2d305c['push'](get_open_tabs('whatsapp',_0x4fd6c3[_0xf809('0x63')][_0x21f577][_0xf809('0x67')]));}return BPromise[_0xf809('0x6c')](_0x2d305c)[_0xf809('0x1f')](function(_0x3cf818){return _0x4fd6c3;});}else{return _0x4fd6c3;}})[_0xf809('0x1f')](respondWithFilteredResult(_0x597528,_0x4e8214))['catch'](handleError(_0x597528,null));};exports[_0xf809('0x6d')]=function(_0x476322,_0x32481d){var _0x1683c1={'raw':![],'where':{'id':_0x476322[_0xf809('0x6e')]['id']}},_0x7f4b90={};_0x7f4b90[_0xf809('0x49')]=_[_0xf809('0x4a')](_[_0xf809('0x4d')](db[_0xf809('0x5f')][_0xf809('0x47')]),[_0xf809('0x6f'),_0xf809('0x4b')]);_0x7f4b90[_0xf809('0x4c')]=_[_0xf809('0x4d')](_0x476322[_0xf809('0x4c')]);_0x7f4b90[_0xf809('0x4e')]=_[_0xf809('0x4f')](_0x7f4b90[_0xf809('0x49')],_0x7f4b90[_0xf809('0x4c')]);_0x1683c1[_0xf809('0x50')]=_[_0xf809('0x4f')](_0x7f4b90['model'],qs[_0xf809('0x51')](_0x476322[_0xf809('0x4c')][_0xf809('0x51')]));_0x1683c1[_0xf809('0x50')]=_0x1683c1[_0xf809('0x50')][_0xf809('0x52')]?_0x1683c1[_0xf809('0x50')]:_0x7f4b90[_0xf809('0x49')];if(_0x476322[_0xf809('0x4c')]['includeAll']){_0x1683c1[_0xf809('0x60')]=[{'all':!![]}];}_0x1683c1=_[_0xf809('0x5d')]({},_0x1683c1,_0x476322[_0xf809('0x5e')]);if(!_[_0xf809('0x41')](_0x1683c1[_0xf809('0x50')],'id')){_0x1683c1['attributes'][_0xf809('0x61')]('id');}return db['User']['find'](_0x1683c1)[_0xf809('0x1f')](handleEntityNotFound(_0x32481d,null))[_0xf809('0x1f')](function(_0x2ae93a){var _0x4982ea=[];values=_0x2ae93a;if(_0x476322[_0xf809('0x4c')][_0xf809('0x64')]==='true'){_0x4982ea[_0xf809('0x61')](get_open_tabs('chat',_0x2ae93a['dataValues']));_0x4982ea[_0xf809('0x61')](get_open_tabs(_0xf809('0x68'),_0x2ae93a[_0xf809('0x67')]));_0x4982ea['push'](get_open_tabs(_0xf809('0x6b'),_0x2ae93a['dataValues']));_0x4982ea['push'](get_open_tabs('whatsapp',_0x2ae93a[_0xf809('0x67')]));_0x4982ea['push'](get_open_tabs(_0xf809('0x69'),_0x2ae93a[_0xf809('0x67')]));_0x4982ea[_0xf809('0x61')](get_open_tabs(_0xf809('0x6a'),_0x2ae93a[_0xf809('0x67')]));return BPromise[_0xf809('0x6c')](_0x4982ea);}else{return values;}})[_0xf809('0x1f')](function(_0x716bc){return values;})[_0xf809('0x1f')](respondWithResult(_0x32481d,null))[_0xf809('0x2a')](handleError(_0x32481d,null));};exports[_0xf809('0x70')]=function(_0x5e84bf,_0x17d777){if(_0x5e84bf['body']['id']){delete _0x5e84bf['body']['id'];}delete _0x5e84bf['body'][_0xf809('0x38')];return db[_0xf809('0x5f')][_0xf809('0x42')]({'where':{'id':_0x5e84bf['params']['id']}})[_0xf809('0x1f')](handleEntityNotFound(_0x17d777,null))[_0xf809('0x1f')](saveUpdates(_0x5e84bf[_0xf809('0x71')],null))['then'](respondWithResult(_0x17d777,null))[_0xf809('0x2a')](handleError(_0x17d777,null));};exports[_0xf809('0x72')]=function(_0x3a0dcb,_0x26bd22){return db[_0xf809('0x5f')][_0xf809('0x72')]()[_0xf809('0x1f')](respondWithResult(_0x26bd22,null))['catch'](handleError(_0x26bd22,null));};exports[_0xf809('0x73')]=function(_0x1b8285,_0x15f853,_0x58973e){return db['User'][_0xf809('0x42')]({'where':{'id':_0x1b8285['params']['id']}})['then'](handleEntityNotFound(_0x15f853,null))[_0xf809('0x1f')](function(_0x2f9a01){if(_0x2f9a01){return _0x2f9a01[_0xf809('0x73')](_0x1b8285[_0xf809('0x71')]['ids'],_[_0xf809('0x74')](_0x1b8285['body'],['ids','id'])||{});}})[_0xf809('0x1f')](respondWithResult(_0x15f853,null))[_0xf809('0x2a')](handleError(_0x15f853,null));};function validateUser(_0x2b80b1){return new BPromise(function(_0x29ee0c,_0x516470){if(_0x2b80b1['internal'])return _0x29ee0c(_0x2b80b1);return db['Setting'][_0xf809('0x75')](0x1)['then'](function(_0x1a4644){if(_0x1a4644[_0xf809('0x76')])authService[_0xf809('0x77')](_0x2b80b1[_0xf809('0x6f')]);db[_0xf809('0x5f')][_0xf809('0x78')](_0xf809('0x79'))[_0xf809('0x1f')](function(_0x37071a){if(_[_0xf809('0x7a')](_0x37071a)){_0x2b80b1[_0xf809('0x79')]=_0x1a4644[_0xf809('0x7b')]||0x1;return;}if(_['isNil'](_0x1a4644[_0xf809('0x7b')])||_0x1a4644['min_internal']===_0x37071a){_0x2b80b1['internal']=_0x37071a+0x1;return;}if(_0x1a4644[_0xf809('0x7b')]>_0x37071a){_0x2b80b1[_0xf809('0x79')]=_0x1a4644[_0xf809('0x7b')];return;}return db['sequelize'][_0xf809('0x4c')](_0xf809('0x7c'),{'type':db[_0xf809('0x5a')][_0xf809('0x7d')][_0xf809('0x7e')]})[_0xf809('0x1f')](function(_0x31a13b){if(_0x31a13b&&_0x31a13b[_0xf809('0x52')]){for(var _0x42bc39=0x0,_0x14a34a=_0x31a13b[_0xf809('0x52')];_0x42bc39<_0x14a34a&&_[_0xf809('0x7a')](_0x2b80b1[_0xf809('0x79')]);_0x42bc39++){if(_0x1a4644[_0xf809('0x7b')]<=_0x31a13b[_0x42bc39][_0xf809('0x7f')]){_0x2b80b1['internal']=_0x31a13b[_0x42bc39][_0xf809('0x7f')];}else if(_0x1a4644['min_internal']>_0x31a13b[_0x42bc39][_0xf809('0x7f')]&&_0x1a4644['min_internal']<=_0x31a13b[_0x42bc39]['to']){_0x2b80b1[_0xf809('0x79')]=_0x1a4644['min_internal'];}}}if(_[_0xf809('0x7a')](_0x2b80b1[_0xf809('0x79')])){_0x2b80b1[_0xf809('0x79')]=_0x37071a+0x1;}return _0x29ee0c(_0x2b80b1);});});})[_0xf809('0x2a')](function(_0x3d2d31){_0x516470(_0x3d2d31);});});}function updateUser(_0x2da526){return new BPromise(function(_0x431d2d,_0x5b120f){try{if(_0x2da526['voicemail']){_0x2da526[_0xf809('0x80')]=_0x2da526[_0xf809('0x79')];_0x2da526[_0xf809('0x81')]={'mailbox':_0x2da526['internal'],'password':_0x2da526[_0xf809('0x6f')],'fullname':_0x2da526['fullname'],'email':_0x2da526[_0xf809('0x82')]};}if(_0x2da526[_0xf809('0x38')]==='agent'){if(!_0x2da526[_0xf809('0x83')])_0x2da526[_0xf809('0x83')]=['101',_0xf809('0x84'),_0xf809('0x85'),_0xf809('0x86'),_0xf809('0x87'),'104',_0xf809('0x88'),'106',_0xf809('0x89'),_0xf809('0x8a'),_0xf809('0x8b'),'100',_0xf809('0x8c'),'114','115'];}_0x431d2d(_0x2da526);}catch(_0x140776){_0x5b120f(_0x140776);}});}exports[_0xf809('0x8d')]=function(_0x592deb,_0xcf9f97){if(_0x592deb[_0xf809('0x3a')][_0xf809('0x38')]===_0xf809('0x3b'))throw new Error(_0xf809('0x8e'));if(_0x592deb[_0xf809('0x71')][_0xf809('0x38')]===_0xf809('0x3a')&&_0x592deb[_0xf809('0x3a')][_0xf809('0x38')]!==_0xf809('0x8f')){throw new Error(_0xf809('0x90'));}if(_0x592deb[_0xf809('0x71')][_0xf809('0x38')]===_0xf809('0x8f')&&_0x592deb[_0xf809('0x3a')][_0xf809('0x38')]!==_0xf809('0x8f')){throw new Error(_0xf809('0x91'));}return licenseUtil[_0xf809('0x92')]([_0x592deb[_0xf809('0x71')]])[_0xf809('0x1f')](function(){return validateUser(_0x592deb[_0xf809('0x71')]);})[_0xf809('0x1f')](function(_0x169124){return updateUser(_0x169124)[_0xf809('0x1f')](function(_0xd86d30){if(_0xd86d30[_0xf809('0x38')]==='admin'){_0xd86d30[_0xf809('0x93')]=_0x592deb['user'][_0xf809('0x93')];delete _0xd86d30['userProfileId'];}return _0xd86d30;});})[_0xf809('0x1f')](function(_0x5c3cd3){return db[_0xf809('0x5f')][_0xf809('0x8d')](_0x5c3cd3,{'include':[{'model':db['VoiceMail'],'as':_0xf809('0x81')}]});})[_0xf809('0x1f')](function(_0xb8d08a){if(_0x592deb[_0xf809('0x71')][_0xf809('0x38')]===_0xf809('0x3a'))return _0xb8d08a;if(_0x592deb[_0xf809('0x3a')]['role']!==_0xf809('0x3a'))return _0xb8d08a;return db[_0xf809('0x94')][_0xf809('0x42')]({'where':{'name':_0xb8d08a['role']==='agent'?_0xf809('0x95'):_0xf809('0x96'),'userProfileId':_0x592deb[_0xf809('0x3a')]['userProfileId']},'raw':!![]})[_0xf809('0x1f')](function(_0x5ec741){if(!_0x5ec741||_0x5ec741['autoAssociation']!=0x0)return _0xb8d08a;return db[_0xf809('0x43')][_0xf809('0x8d')]({'name':_0xb8d08a[_0xf809('0x44')],'resourceId':_0xb8d08a['id'],'type':_0x5ec741['name'],'sectionId':_0x5ec741['id']},{})[_0xf809('0x1f')](function(){return _0xb8d08a;});})['catch'](function(_0x3ebe85){logger[_0xf809('0x25')](_0xf809('0x97'),_0x3ebe85);throw _0x3ebe85;});})[_0xf809('0x1f')](respondWithResult(_0xcf9f97,0xc9))['catch'](handleError(_0xcf9f97,null));};exports['bulkCreate']=function(_0x4ecfca,_0x1a2a88){var _0x4fd7d6=_0x4ecfca[_0xf809('0x71')];var _0x5a391c=[];if(_0x4ecfca[_0xf809('0x3a')][_0xf809('0x38')]==='agent')throw new Error(_0xf809('0x8e'));if(_[_0xf809('0x98')](_0x4fd7d6,[_0xf809('0x38'),_0xf809('0x3a')])&&_0x4ecfca[_0xf809('0x3a')][_0xf809('0x38')]!==_0xf809('0x8f')){throw new Error(_0xf809('0x90'));}if(_[_0xf809('0x98')](_0x4fd7d6,['role',_0xf809('0x8f')])&&_0x4ecfca[_0xf809('0x3a')][_0xf809('0x38')]!==_0xf809('0x8f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xf809('0x92')](_0x4fd7d6)[_0xf809('0x1f')](function(){return validateUser(_0x4fd7d6[0x0]);})[_0xf809('0x1f')](function(){for(var _0x30bb1f=0x1;_0x30bb1f<_0x4fd7d6[_0xf809('0x52')];_0x30bb1f++){var _0x40c560=_0x4fd7d6[_0x30bb1f-0x1][_0xf809('0x79')];if(!_0x4fd7d6[_0x30bb1f]['internal'])_0x4fd7d6[_0x30bb1f][_0xf809('0x79')]=_0x40c560+0x1;_0x5a391c[_0xf809('0x61')](validateUser(_0x4fd7d6[_0x30bb1f]));}return BPromise['all'](_0x5a391c);})[_0xf809('0x1f')](function(){_0x5a391c=[];for(var _0x59a369=0x0;_0x59a369<_0x4fd7d6[_0xf809('0x52')];_0x59a369++){_0x5a391c[_0xf809('0x61')](updateUser(_0x4fd7d6[_0x59a369]));}return BPromise[_0xf809('0x6c')](_0x5a391c);})[_0xf809('0x1f')](function(){return BPromise[_0xf809('0x99')](_0x4fd7d6,function(_0x31df78){return db[_0xf809('0x5f')][_0xf809('0x8d')](_0x31df78,{'include':[{'model':db[_0xf809('0x81')],'as':_0xf809('0x81')}]})[_0xf809('0x1f')](function(_0x1594c8){_0x31df78['id']=_0x1594c8['id'];return _0x31df78;});});})[_0xf809('0x1f')](function(_0x50d188){if(_0x4ecfca['body']['role']===_0xf809('0x3a'))return _0x50d188;if(_0x4ecfca[_0xf809('0x3a')]['role']!==_0xf809('0x3a'))return _0x50d188;var _0x30153d=_[_0xf809('0x98')](_0x50d188,function(_0x49f732){return _0x49f732['role']===_0xf809('0x3b')||_0x49f732[_0xf809('0x38')]==='telephone';});if(!_0x30153d)return _0x50d188;return db[_0xf809('0x94')][_0xf809('0x62')]({'where':{'name':{'$or':[_0xf809('0x95'),_0xf809('0x96')]},'userProfileId':_0x4ecfca['user'][_0xf809('0x9a')]},'raw':!![]})[_0xf809('0x1f')](function(_0x24b5e4){if(_['isEmpty'](_0x24b5e4)||!_[_0xf809('0x98')](_0x24b5e4,[_0xf809('0x9b'),0x0]))return _0x50d188;_0x5a391c=[];var _0x5a1a5e=_(_0x24b5e4)[_0xf809('0x3f')](function(_0x240f13){if(_0x240f13[_0xf809('0x9b')]===0x1)return;return _0x240f13[_0xf809('0x44')]==='Agents'?_0xf809('0x3b'):_0xf809('0x3c');})[_0xf809('0x9c')]()['value']();for(var _0x27a6c9=0x0;_0x27a6c9<_0x50d188[_0xf809('0x52')];_0x27a6c9++){if(!_[_0xf809('0x41')](_0x5a1a5e,_0x50d188[_0x27a6c9]['role']))return;var _0x5d2361=_0x50d188[_0x27a6c9][_0xf809('0x38')]===_0xf809('0x3b')?_0xf809('0x95'):_0xf809('0x96');_0x5a391c['push'](db[_0xf809('0x43')]['create']({'name':_0x50d188[_0x27a6c9][_0xf809('0x44')],'resourceId':_0x50d188[_0x27a6c9]['id'],'type':_0x5d2361,'sectionId':_[_0xf809('0x42')](_0x24b5e4,[_0xf809('0x44'),_0x5d2361])['id']},{}));}return BPromise[_0xf809('0x6c')](_0x5a391c);});})[_0xf809('0x1f')](respondWithResult(_0x1a2a88,0xc9))[_0xf809('0x2a')](handleError(_0x1a2a88,null));};exports[_0xf809('0x9d')]=function(_0x58f909,_0x5b387b,_0x28c1ed){if(_0x58f909['body']['id']){delete _0x58f909[_0xf809('0x71')]['id'];}return db[_0xf809('0x5f')][_0xf809('0x42')]({'where':{'id':_0x58f909[_0xf809('0x6e')]['id']}})[_0xf809('0x1f')](function(_0x31288b){if(!_0x31288b)return null;if(_0x31288b['id']===_0x58f909[_0xf809('0x3a')]['id']){if(!_0x58f909[_0xf809('0x71')][_0xf809('0x9e')]||!_0x58f909[_0xf809('0x71')]['newPassword']){throw new db[(_0xf809('0x9f'))]['ValidationError'](_0xf809('0xa0'));}if(!_0x31288b[_0xf809('0xa1')](_0x58f909[_0xf809('0x71')][_0xf809('0x9e')])){throw new db[(_0xf809('0x9f'))][(_0xf809('0xa2'))](_0xf809('0xa3'));}if(_0x58f909[_0xf809('0x71')][_0xf809('0x9e')]===_0x58f909[_0xf809('0x71')][_0xf809('0xa4')]){throw new db[(_0xf809('0x9f'))]['ValidationError'](_0xf809('0xa5'));}}else if(_0x58f909[_0xf809('0x3a')][_0xf809('0x38')]===_0xf809('0x8f')){if(!_0x58f909['body']['newPassword']){throw new db[(_0xf809('0x9f'))][(_0xf809('0xa2'))](_0xf809('0xa6'));}}else if(_0x58f909[_0xf809('0x3a')][_0xf809('0x38')]===_0xf809('0x3a')){if(!_0x58f909[_0xf809('0x71')][_0xf809('0xa4')]){throw new db[(_0xf809('0x9f'))]['ValidationError'](_0xf809('0xa6'));}if(_0x31288b[_0xf809('0x38')]!=='agent'){throw new db[(_0xf809('0x9f'))]['ValidationError'](_0xf809('0x8e'));}}else{throw new db[(_0xf809('0x9f'))][(_0xf809('0xa2'))]('Unauthorized');}return _0x31288b;})[_0xf809('0x1f')](handleEntityNotFound(_0x5b387b,null))[_0xf809('0x1f')](function(_0x5ccae2){return db[_0xf809('0xa7')][_0xf809('0xa8')]({'attributes':['id',_0xf809('0x76'),_0xf809('0xa9'),_0xf809('0xaa')]})[_0xf809('0x1f')](function(_0x1abd1c){if(_0x1abd1c['securePassword'])authService['validatePasswordPattern'](_0x58f909[_0xf809('0x71')][_0xf809('0xa4')]);if(!_0x1abd1c['enforcePasswordHistory']||!_0x5ccae2[_0xf809('0xab')])return _0x5ccae2;authService['validatePasswordHistory'](_0x58f909[_0xf809('0x71')]['newPassword'],_0x5ccae2[_0xf809('0xab')],_0x1abd1c[_0xf809('0xaa')]);return _0x5ccae2;})['then'](saveUpdates({'password':_0x58f909['body'][_0xf809('0xa4')],'passwordResetAt':_0x58f909['user']['id']==_0x58f909[_0xf809('0x6e')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x58f909[_0xf809('0x71')][_0xf809('0xa4')],_0x5ccae2[_0xf809('0xab')])},null));})[_0xf809('0x1f')](respondWithResult(_0x5b387b,null))[_0xf809('0x2a')](handleError(_0x5b387b,null));};exports[_0xf809('0xac')]=function(_0x194f6c,_0x37a66d,_0x1e9599){var _0x2acad0=_0x194f6c[_0xf809('0x71')][_0xf809('0xad')];return db['User'][_0xf809('0x42')]({'where':{'id':_0x194f6c[_0xf809('0x6e')]['id']},'attributes':['id',_0xf809('0x44'),'role',_0xf809('0xae'),'loginInPause',_0xf809('0xaf'),_0xf809('0xb0')]})[_0xf809('0x1f')](handleEntityNotFound(_0x37a66d,null))[_0xf809('0x1f')](function(_0x336ac3){if(_0x336ac3){if(!utils['isValidChannel'](_0x2acad0)){throw new db[(_0xf809('0x9f'))][(_0xf809('0xa2'))](_0xf809('0xb1'));}return _0x336ac3[_0xf809('0xb2')+_[_0xf809('0xb3')](_0x2acad0['toLowerCase']())+_0xf809('0xb4')](_0x194f6c['body'][_0xf809('0xb5')],{'penalty':_0x194f6c[_0xf809('0x71')]['penalty']||0x0})[_0xf809('0xb6')](function(_0x502ba6){for(var _0x4cc0e4=0x0;_0x4cc0e4<_0x194f6c[_0xf809('0x71')][_0xf809('0xb5')][_0xf809('0x52')];_0x4cc0e4+=0x1){var _0x3a0c12={'UserId':Number(_0x194f6c[_0xf809('0x6e')]['id'])};_0x3a0c12[_[_0xf809('0xb3')](_0x2acad0[_0xf809('0xb7')]())+_0xf809('0xb8')]=Number(_0x194f6c[_0xf809('0x71')][_0xf809('0xb5')][_0x4cc0e4]);socket['emit']('user'+_[_0xf809('0xb3')](_0x2acad0[_0xf809('0xb7')]())+_0xf809('0xb9'),_0x3a0c12);}return _0x502ba6;})[_0xf809('0x1f')](function(){if(_0x2acad0==='voice'){return db[_0xf809('0xba')]['findAll']({'where':{'id':_0x194f6c[_0xf809('0x71')]['ids']||[]},'raw':!![],'attributes':['id',_0xf809('0x44')]});}})[_0xf809('0x1f')](function(_0x206afc){var _0x55483b=_0x336ac3[_0xf809('0x37')]({'plain':!![]});var _0x2cd5e5=[];if(_0x2acad0==='voice'&&_0x55483b[_0xf809('0x38')]===_0xf809('0x3b')&&_0x55483b[_0xf809('0xae')]){for(var _0x2ca901=0x0;_0x2ca901<_0x206afc[_0xf809('0x52')];_0x2ca901+=0x1){_0x2cd5e5[_0xf809('0x61')]({'membername':_0x55483b[_0xf809('0x44')],'UserId':_0x55483b['id'],'queue_name':_0x206afc[_0x2ca901]['name'],'VoiceQueueId':_0x206afc[_0x2ca901]['id'],'interface':_[_0xf809('0x7a')](_0x55483b[_0xf809('0xb0')])?util['format'](_0xf809('0xbb'),_0x55483b['name']):_0x55483b['interface'],'paused':_0x55483b[_0xf809('0xaf')]||![],'penalty':_0x194f6c['body'][_0xf809('0xbc')]||0x0});}return BPromise[_0xf809('0x99')](_0x2cd5e5,function(_0x214950){return db[_0xf809('0xbd')][_0xf809('0xbe')](_0x214950);});}return _0x336ac3;});}})[_0xf809('0x1f')](respondWithStatusCode(_0x37a66d,null))[_0xf809('0x2a')](handleError(_0x37a66d,null));};exports['removeQueues']=function(_0x59243c,_0x1e8bb7,_0x25c9c4){var _0x3523af;return db[_0xf809('0x5f')]['find']({'where':{'id':_0x59243c[_0xf809('0x6e')]['id']},'attributes':['id',_0xf809('0x44'),_0xf809('0x38')]})[_0xf809('0x1f')](handleEntityNotFound(_0x1e8bb7,null))['then'](function(_0x29e98f){if(_0x29e98f){_0x3523af=_0x29e98f;if(!_0x59243c[_0xf809('0x4c')][_0xf809('0xad')]||!utils['isValidChannel'](_0x59243c[_0xf809('0x4c')][_0xf809('0xad')])){throw new db[(_0xf809('0x9f'))]['ValidationError'](_0xf809('0xb1'));}return _0x29e98f[_0xf809('0xbf')+_[_0xf809('0xb3')](_0x59243c['query'][_0xf809('0xad')][_0xf809('0xb7')]())+_0xf809('0xb4')](_0x59243c[_0xf809('0x4c')][_0xf809('0xb5')]);}})['then'](function(_0x22c9e8){for(var _0x1cf128=0x0;_0x1cf128<_0x59243c[_0xf809('0x4c')][_0xf809('0xb5')][_0xf809('0x52')];_0x1cf128+=0x1){var _0x5c6446={'UserId':Number(_0x59243c[_0xf809('0x6e')]['id'])};_0x5c6446[_[_0xf809('0xb3')](_0x59243c['query'][_0xf809('0xad')][_0xf809('0xb7')]())+_0xf809('0xb8')]=Number(_0x59243c[_0xf809('0x4c')][_0xf809('0xb5')][_0x1cf128]);socket[_0xf809('0xc0')](_0xf809('0x3a')+_['capitalize'](_0x59243c[_0xf809('0x4c')][_0xf809('0xad')][_0xf809('0xb7')]())+_0xf809('0xc1'),_0x5c6446);}return _0x22c9e8;})['then'](function(){if(_0x59243c['query'][_0xf809('0xad')]===_0xf809('0xc2')){return db[_0xf809('0xbd')]['destroy']({'where':{'UserId':_0x59243c[_0xf809('0x6e')]['id'],'VoiceQueueId':_0x59243c['query'][_0xf809('0xb5')]},'individualHooks':!![]})[_0xf809('0x1f')](function(){return _0x3523af;});}return _0x3523af;})[_0xf809('0x1f')](respondWithStatusCode(_0x1e8bb7,null))['catch'](handleError(_0x1e8bb7,null));};exports[_0xf809('0xc3')]=function(_0xd94152,_0xaab74f,_0x36716c){_0xd94152['body'][_0xf809('0xc4')]=_0xd94152[_0xf809('0xc5')][_0xf809('0xc6')];return db[_0xf809('0x5f')][_0xf809('0x42')]({'where':{'id':_0xd94152[_0xf809('0x6e')]['id']}})[_0xf809('0x1f')](handleEntityNotFound(_0xaab74f,null))['then'](saveUpdates(_0xd94152[_0xf809('0x71')],null))['then'](respondWithResult(_0xaab74f,null))[_0xf809('0x2a')](handleError(_0xaab74f,null));};exports['getAvatar']=function(_0x45ebcd,_0x3d02ed,_0x25e25d){var _0xe6692e=path['join'](config[_0xf809('0xc7')],_0xf809('0xc8'));return db['User'][_0xf809('0x42')]({'where':{'id':_0x45ebcd[_0xf809('0x6e')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xf809('0x1f')](handleEntityNotFound(_0x3d02ed,null))[_0xf809('0x1f')](function(_0x35b214){if(_0x35b214){if(_['isNil'](_0x35b214['userpic'])){return _0x3d02ed[_0xf809('0xc9')](_0xe6692e);}else{if(!fs['existsSync'](path[_0xf809('0xca')](config['root'],_0xf809('0xcb'),_0x35b214[_0xf809('0xc4')]))){return _0x3d02ed[_0xf809('0xc9')](_0xe6692e);}return _0x3d02ed[_0xf809('0xc9')](path[_0xf809('0xca')](config[_0xf809('0xc7')],_0xf809('0xcb'),_0x35b214[_0xf809('0xc4')]));}}})[_0xf809('0x2a')](handleError(_0x3d02ed,null));};exports[_0xf809('0xcc')]=function(_0x48bc4f,_0x1d35cd,_0x579b1e){return db['User']['find']({'where':{'id':_0x48bc4f[_0xf809('0x6e')]['id']},'attributes':['id']})[_0xf809('0x1f')](handleEntityNotFound(_0x1d35cd,null))[_0xf809('0x1f')](function(_0x7bcdd4){var _0x1cd194=[];values=_0x7bcdd4[_0xf809('0x67')];_0x1cd194['push'](get_open_tabs(_0xf809('0x66'),_0x7bcdd4[_0xf809('0x67')]));_0x1cd194[_0xf809('0x61')](get_open_tabs(_0xf809('0x68'),_0x7bcdd4[_0xf809('0x67')]));_0x1cd194[_0xf809('0x61')](get_open_tabs(_0xf809('0x6b'),_0x7bcdd4[_0xf809('0x67')]));_0x1cd194['push'](get_open_tabs('whatsapp',_0x7bcdd4[_0xf809('0x67')]));_0x1cd194[_0xf809('0x61')](get_open_tabs(_0xf809('0x69'),_0x7bcdd4[_0xf809('0x67')]));_0x1cd194[_0xf809('0x61')](get_open_tabs(_0xf809('0x6a'),_0x7bcdd4[_0xf809('0x67')]));return BPromise['all'](_0x1cd194);})[_0xf809('0x1f')](function(_0x1b5ba1){var _0x2b2377=[];if(_0x1b5ba1){for(var _0x38770b=0x0;_0x38770b=_0x1b4de6){_0x66c297=_0x1b4de6;_0x4e9f5d=0xc8;}else{_0x4e9f5d=0xce;}_0x271b13[_0xdfe0('0x2e')](_0x4e9f5d);return _0x271b13['set'](_0xdfe0('0x33'),_0x989ac4+'-'+_0x66c297+'/'+_0x1b4de6)['json'](_0x1fe3b3);}return null;};}function patchUpdates(_0x3ef42b){return function(_0x2c40a7){try{jsonpatch[_0xdfe0('0x34')](_0x2c40a7,_0x3ef42b,!![]);}catch(_0x25c4dc){return BPromise[_0xdfe0('0x35')](_0x25c4dc);}return _0x2c40a7[_0xdfe0('0x36')]();};}function saveUpdates(_0x15d1ca,_0x40a15d){return function(_0x17aceb){if(_0x17aceb){return _0x17aceb['update'](_0x15d1ca)[_0xdfe0('0x22')](function(_0x4a19f0){return _0x4a19f0;});}return null;};}function removeEntity(_0x298b4a,_0x374e4d){return function(_0x4f040c){if(_0x4f040c){return _0x4f040c['destroy']()[_0xdfe0('0x22')](function(){var _0x27d701=_0x4f040c['get']({'plain':!![]});if(_0x27d701[_0xdfe0('0x37')]===_0xdfe0('0x38'))return;var _0x1296f3=[{'name':_0xdfe0('0x39'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xdfe0('0x3a'),'ignore':![]},{'name':_0xdfe0('0x3b'),'value':'telephone','ignore':![]}];var _0x31fac7=_(_0x1296f3)['filter'](_0xdfe0('0x3c'))[_0xdfe0('0x3d')](_0xdfe0('0x3e'))['value']();if(_[_0xdfe0('0x3f')](_0x31fac7,_0x27d701['role'])){return;}var _0x16cca8=_[_0xdfe0('0x40')](_0x1296f3,[_0xdfe0('0x3e'),_0x27d701[_0xdfe0('0x37')]])[_0xdfe0('0x41')];return db['UserProfileResource'][_0xdfe0('0x42')]({'where':{'type':_0x16cca8,'resourceId':_0x27d701['id']}})[_0xdfe0('0x22')](function(){return _0x4f040c;});})[_0xdfe0('0x22')](function(){_0x298b4a[_0xdfe0('0x2e')](0xcc)[_0xdfe0('0x2f')]();});}};}function handleEntityNotFound(_0x37a1a4,_0x284ad3){return function(_0x23d3a3){if(!_0x23d3a3){_0x37a1a4['sendStatus'](0x194);}return _0x23d3a3;};}function handleError(_0xce29f0,_0x357e84){_0x357e84=_0x357e84||0x1f4;return function(_0x43c455){logger['error'](_0x43c455[_0xdfe0('0x43')]);if(_0x43c455['name']){delete _0x43c455[_0xdfe0('0x41')];}_0xce29f0[_0xdfe0('0x2e')](_0x357e84)[_0xdfe0('0x44')](_0x43c455);};}exports['index']=function(_0x968bfa,_0x5de1e6){var _0x12814d={},_0x1829e6={},_0x238a23={'count':0x0,'rows':[]};var _0x419d72=_[_0xdfe0('0x3d')](db[_0xdfe0('0x45')][_0xdfe0('0x46')],function(_0x4158e2){return{'name':_0x4158e2[_0xdfe0('0x47')],'type':_0x4158e2['type'][_0xdfe0('0x48')]};});_0x1829e6[_0xdfe0('0x49')]=_[_0xdfe0('0x4a')](_[_0xdfe0('0x3d')](_0x419d72,'name'),[_0xdfe0('0x4b'),_0xdfe0('0x4c')]);_0x1829e6[_0xdfe0('0x4d')]=_['keys'](_0x968bfa[_0xdfe0('0x4d')]);_0x1829e6[_0xdfe0('0x4e')]=_[_0xdfe0('0x4f')](_0x1829e6[_0xdfe0('0x49')],_0x1829e6[_0xdfe0('0x4d')]);_0x12814d[_0xdfe0('0x50')]=_[_0xdfe0('0x4f')](_0x1829e6[_0xdfe0('0x49')],qs['fields'](_0x968bfa[_0xdfe0('0x4d')][_0xdfe0('0x51')]));_0x12814d[_0xdfe0('0x50')]=_0x12814d['attributes'][_0xdfe0('0x52')]?_0x12814d[_0xdfe0('0x50')]:_0x1829e6['model'];if(!_0x968bfa[_0xdfe0('0x4d')][_0xdfe0('0x53')](_0xdfe0('0x54'))){_0x12814d[_0xdfe0('0x30')]=qs[_0xdfe0('0x30')](_0x968bfa[_0xdfe0('0x4d')]['limit']);_0x12814d['offset']=qs[_0xdfe0('0x31')](_0x968bfa[_0xdfe0('0x4d')]['offset']);}_0x12814d[_0xdfe0('0x55')]=qs['sort'](_0x968bfa['query'][_0xdfe0('0x56')]);_0x12814d[_0xdfe0('0x57')]=qs[_0xdfe0('0x4e')](_[_0xdfe0('0x58')](_0x968bfa[_0xdfe0('0x4d')],_0x1829e6[_0xdfe0('0x4e')]),_0x419d72);if(_0x968bfa['query'][_0xdfe0('0x59')]){_0x12814d[_0xdfe0('0x57')]=_['merge'](_0x12814d[_0xdfe0('0x57')],{'$or':_[_0xdfe0('0x3d')](_0x419d72,function(_0x43dcec){if(_0x43dcec[_0xdfe0('0x5a')]!=='VIRTUAL'){return db[_0xdfe0('0x5b')][_0xdfe0('0x57')](db['sequelize']['fn'](_0xdfe0('0x5c'),db[_0xdfe0('0x5b')][_0xdfe0('0x5d')](_0x43dcec[_0xdfe0('0x41')])),{'$like':db['sequelize']['fn'](_0xdfe0('0x5c'),'%'+_0x968bfa[_0xdfe0('0x4d')][_0xdfe0('0x59')]+'%')});}})});}_0x12814d=_[_0xdfe0('0x5e')]({},_0x12814d,_0x968bfa[_0xdfe0('0x5f')]);var _0x572ac1={'where':_0x12814d[_0xdfe0('0x57')]};return db[_0xdfe0('0x45')]['count'](_0x572ac1)[_0xdfe0('0x22')](function(_0x160b7a){_0x238a23[_0xdfe0('0x32')]=_0x160b7a;if(_0x968bfa[_0xdfe0('0x4d')]['includeAll']){_0x12814d[_0xdfe0('0x60')]=[{'all':!![]}];}if(!_['includes'](_0x12814d[_0xdfe0('0x50')],'id')){_0x12814d[_0xdfe0('0x50')][_0xdfe0('0x61')]('id');}return db['User'][_0xdfe0('0x62')](_0x12814d);})[_0xdfe0('0x22')](function(_0x1a397b){_0x238a23[_0xdfe0('0x63')]=_0x1a397b;if(_0x968bfa[_0xdfe0('0x4d')][_0xdfe0('0x64')]===_0xdfe0('0x65')){var _0xdef7b5=[];for(var _0x5d4d89=0x0;_0x5d4d89<_0x238a23['rows'][_0xdfe0('0x52')];_0x5d4d89++){_0xdef7b5[_0xdfe0('0x61')](get_open_tabs('chat',_0x238a23[_0xdfe0('0x63')][_0x5d4d89][_0xdfe0('0x66')]));_0xdef7b5[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x67'),_0x238a23[_0xdfe0('0x63')][_0x5d4d89][_0xdfe0('0x66')]));_0xdef7b5[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x68'),_0x238a23[_0xdfe0('0x63')][_0x5d4d89][_0xdfe0('0x66')]));_0xdef7b5[_0xdfe0('0x61')](get_open_tabs('mail',_0x238a23[_0xdfe0('0x63')][_0x5d4d89][_0xdfe0('0x66')]));_0xdef7b5['push'](get_open_tabs(_0xdfe0('0x69'),_0x238a23[_0xdfe0('0x63')][_0x5d4d89][_0xdfe0('0x66')]));_0xdef7b5[_0xdfe0('0x61')](get_open_tabs('whatsapp',_0x238a23['rows'][_0x5d4d89][_0xdfe0('0x66')]));}return BPromise[_0xdfe0('0x6a')](_0xdef7b5)[_0xdfe0('0x22')](function(_0x3edf58){return _0x238a23;});}else{return _0x238a23;}})['then'](respondWithFilteredResult(_0x5de1e6,_0x12814d))[_0xdfe0('0x6b')](handleError(_0x5de1e6,null));};exports[_0xdfe0('0x6c')]=function(_0x55515e,_0xa37c8f){var _0xd0cb22={'raw':![],'where':{'id':_0x55515e['params']['id']}},_0x3b6f30={};_0x3b6f30[_0xdfe0('0x49')]=_[_0xdfe0('0x4a')](_[_0xdfe0('0x6d')](db['User'][_0xdfe0('0x46')]),['password',_0xdfe0('0x4c')]);_0x3b6f30[_0xdfe0('0x4d')]=_[_0xdfe0('0x6d')](_0x55515e[_0xdfe0('0x4d')]);_0x3b6f30[_0xdfe0('0x4e')]=_['intersection'](_0x3b6f30['model'],_0x3b6f30[_0xdfe0('0x4d')]);_0xd0cb22[_0xdfe0('0x50')]=_[_0xdfe0('0x4f')](_0x3b6f30[_0xdfe0('0x49')],qs[_0xdfe0('0x51')](_0x55515e['query']['fields']));_0xd0cb22[_0xdfe0('0x50')]=_0xd0cb22['attributes'][_0xdfe0('0x52')]?_0xd0cb22['attributes']:_0x3b6f30['model'];if(_0x55515e[_0xdfe0('0x4d')][_0xdfe0('0x6e')]){_0xd0cb22[_0xdfe0('0x60')]=[{'all':!![]}];}_0xd0cb22=_[_0xdfe0('0x5e')]({},_0xd0cb22,_0x55515e[_0xdfe0('0x5f')]);if(!_['includes'](_0xd0cb22[_0xdfe0('0x50')],'id')){_0xd0cb22[_0xdfe0('0x50')]['push']('id');}return db[_0xdfe0('0x45')]['find'](_0xd0cb22)['then'](handleEntityNotFound(_0xa37c8f,null))[_0xdfe0('0x22')](function(_0x410b2c){var _0x8cea9=[];values=_0x410b2c;if(_0x55515e['query'][_0xdfe0('0x64')]===_0xdfe0('0x65')){_0x8cea9[_0xdfe0('0x61')](get_open_tabs('chat',_0x410b2c[_0xdfe0('0x66')]));_0x8cea9[_0xdfe0('0x61')](get_open_tabs('sms',_0x410b2c[_0xdfe0('0x66')]));_0x8cea9[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x69'),_0x410b2c['dataValues']));_0x8cea9[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x6f'),_0x410b2c[_0xdfe0('0x66')]));_0x8cea9[_0xdfe0('0x61')](get_open_tabs('fax',_0x410b2c['dataValues']));_0x8cea9['push'](get_open_tabs('mail',_0x410b2c[_0xdfe0('0x66')]));return BPromise[_0xdfe0('0x6a')](_0x8cea9);}else{return values;}})[_0xdfe0('0x22')](function(_0x3a467b){return values;})[_0xdfe0('0x22')](respondWithResult(_0xa37c8f,null))['catch'](handleError(_0xa37c8f,null));};exports[_0xdfe0('0x70')]=function(_0x4e8a36,_0x412e26){if(_0x4e8a36[_0xdfe0('0x71')]['id']){delete _0x4e8a36[_0xdfe0('0x71')]['id'];}delete _0x4e8a36[_0xdfe0('0x71')][_0xdfe0('0x37')];return db[_0xdfe0('0x45')][_0xdfe0('0x40')]({'where':{'id':_0x4e8a36[_0xdfe0('0x72')]['id']}})['then'](handleEntityNotFound(_0x412e26,null))[_0xdfe0('0x22')](saveUpdates(_0x4e8a36[_0xdfe0('0x71')],null))['then'](respondWithResult(_0x412e26,null))[_0xdfe0('0x6b')](handleError(_0x412e26,null));};exports[_0xdfe0('0x73')]=function(_0x4c5f5d,_0xf5b983){return db['User'][_0xdfe0('0x73')]()[_0xdfe0('0x22')](respondWithResult(_0xf5b983,null))[_0xdfe0('0x6b')](handleError(_0xf5b983,null));};exports['addContacts']=function(_0x269da0,_0x27c5e8,_0x431011){return db[_0xdfe0('0x45')][_0xdfe0('0x40')]({'where':{'id':_0x269da0[_0xdfe0('0x72')]['id']}})['then'](handleEntityNotFound(_0x27c5e8,null))['then'](function(_0x42a196){if(_0x42a196){return _0x42a196['addContacts'](_0x269da0[_0xdfe0('0x71')][_0xdfe0('0x74')],_[_0xdfe0('0x75')](_0x269da0['body'],[_0xdfe0('0x74'),'id'])||{});}})[_0xdfe0('0x22')](respondWithResult(_0x27c5e8,null))['catch'](handleError(_0x27c5e8,null));};function validateUser(_0x118a4a){return new BPromise(function(_0x487e8c,_0x3d9877){if(_0x118a4a[_0xdfe0('0x76')])return _0x487e8c(_0x118a4a);return db[_0xdfe0('0x77')][_0xdfe0('0x78')](0x1)['then'](function(_0x1c0e47){if(_0x1c0e47[_0xdfe0('0x79')])authService[_0xdfe0('0x7a')](_0x118a4a['password']);db['User']['max'](_0xdfe0('0x76'))[_0xdfe0('0x22')](function(_0x4ca834){if(_[_0xdfe0('0x7b')](_0x4ca834)){_0x118a4a[_0xdfe0('0x76')]=_0x1c0e47[_0xdfe0('0x7c')]||0x1;return;}if(_['isNil'](_0x1c0e47[_0xdfe0('0x7c')])||_0x1c0e47[_0xdfe0('0x7c')]===_0x4ca834){_0x118a4a[_0xdfe0('0x76')]=_0x4ca834+0x1;return;}if(_0x1c0e47[_0xdfe0('0x7c')]>_0x4ca834){_0x118a4a[_0xdfe0('0x76')]=_0x1c0e47[_0xdfe0('0x7c')];return;}return db['sequelize'][_0xdfe0('0x4d')](_0xdfe0('0x7d'),{'type':db['sequelize']['QueryTypes'][_0xdfe0('0x7e')]})[_0xdfe0('0x22')](function(_0x119327){if(_0x119327&&_0x119327['length']){for(var _0x233695=0x0,_0xdded65=_0x119327[_0xdfe0('0x52')];_0x233695<_0xdded65&&_['isNil'](_0x118a4a[_0xdfe0('0x76')]);_0x233695++){if(_0x1c0e47[_0xdfe0('0x7c')]<=_0x119327[_0x233695][_0xdfe0('0x7f')]){_0x118a4a['internal']=_0x119327[_0x233695][_0xdfe0('0x7f')];}else if(_0x1c0e47['min_internal']>_0x119327[_0x233695]['from']&&_0x1c0e47[_0xdfe0('0x7c')]<=_0x119327[_0x233695]['to']){_0x118a4a[_0xdfe0('0x76')]=_0x1c0e47['min_internal'];}}}if(_[_0xdfe0('0x7b')](_0x118a4a[_0xdfe0('0x76')])){_0x118a4a['internal']=_0x4ca834+0x1;}return _0x487e8c(_0x118a4a);});});})[_0xdfe0('0x6b')](function(_0x2d62ec){_0x3d9877(_0x2d62ec);});});}function updateUser(_0x1d69de){return new BPromise(function(_0x353797,_0x5bbd9d){try{if(_0x1d69de[_0xdfe0('0x80')]){_0x1d69de['mailbox']=_0x1d69de[_0xdfe0('0x76')];_0x1d69de[_0xdfe0('0x81')]={'mailbox':_0x1d69de['internal'],'password':_0x1d69de[_0xdfe0('0x4b')],'fullname':_0x1d69de['fullname'],'email':_0x1d69de[_0xdfe0('0x82')]};}if(_0x1d69de[_0xdfe0('0x37')]===_0xdfe0('0x3a')){if(!_0x1d69de[_0xdfe0('0x83')])_0x1d69de[_0xdfe0('0x83')]=[_0xdfe0('0x84'),_0xdfe0('0x85'),_0xdfe0('0x86'),_0xdfe0('0x87'),'110',_0xdfe0('0x88'),_0xdfe0('0x89'),_0xdfe0('0x8a'),_0xdfe0('0x8b'),'108',_0xdfe0('0x8c'),'100',_0xdfe0('0x8d'),_0xdfe0('0x8e'),_0xdfe0('0x8f')];}_0x353797(_0x1d69de);}catch(_0x4ca55a){_0x5bbd9d(_0x4ca55a);}});}exports[_0xdfe0('0x90')]=function(_0x41c789,_0x51c7d4){if(_0x41c789[_0xdfe0('0x91')][_0xdfe0('0x37')]===_0xdfe0('0x3a'))throw new Error('Unauthorized');if(_0x41c789[_0xdfe0('0x71')][_0xdfe0('0x37')]===_0xdfe0('0x91')&&_0x41c789['user'][_0xdfe0('0x37')]!=='admin'){throw new Error(_0xdfe0('0x92'));}if(_0x41c789[_0xdfe0('0x71')]['role']==='admin'&&_0x41c789[_0xdfe0('0x91')][_0xdfe0('0x37')]!==_0xdfe0('0x38')){throw new Error(_0xdfe0('0x93'));}return licenseUtil[_0xdfe0('0x94')]([_0x41c789[_0xdfe0('0x71')]])['then'](function(){return validateUser(_0x41c789['body']);})[_0xdfe0('0x22')](function(_0xfd3730){return updateUser(_0xfd3730)[_0xdfe0('0x22')](function(_0x483f77){if(_0x483f77[_0xdfe0('0x37')]===_0xdfe0('0x38')){_0x483f77[_0xdfe0('0x95')]=_0x41c789[_0xdfe0('0x91')]['settingsEnabled'];delete _0x483f77[_0xdfe0('0x96')];}return _0x483f77;});})[_0xdfe0('0x22')](function(_0x2972a0){return db[_0xdfe0('0x45')][_0xdfe0('0x90')](_0x2972a0,{'include':[{'model':db[_0xdfe0('0x81')],'as':_0xdfe0('0x81')}]});})['then'](function(_0x2832ca){if(_0x41c789['body']['role']===_0xdfe0('0x91'))return _0x2832ca;if(_0x41c789[_0xdfe0('0x91')]['role']!==_0xdfe0('0x91'))return _0x2832ca;return db[_0xdfe0('0x97')][_0xdfe0('0x40')]({'where':{'name':_0x2832ca[_0xdfe0('0x37')]==='agent'?_0xdfe0('0x98'):_0xdfe0('0x3b'),'userProfileId':_0x41c789[_0xdfe0('0x91')][_0xdfe0('0x96')]},'raw':!![]})[_0xdfe0('0x22')](function(_0x179f8c){if(!_0x179f8c||_0x179f8c[_0xdfe0('0x99')]!=0x0)return _0x2832ca;return db[_0xdfe0('0x9a')][_0xdfe0('0x90')]({'name':_0x2832ca[_0xdfe0('0x41')],'resourceId':_0x2832ca['id'],'type':_0x179f8c[_0xdfe0('0x41')],'sectionId':_0x179f8c['id']},{})['then'](function(){return _0x2832ca;});})['catch'](function(_0x4ef6ab){logger[_0xdfe0('0x29')](_0xdfe0('0x9b'),_0x4ef6ab);throw _0x4ef6ab;});})[_0xdfe0('0x22')](respondWithResult(_0x51c7d4,0xc9))[_0xdfe0('0x6b')](handleError(_0x51c7d4,null));};exports[_0xdfe0('0x9c')]=function(_0x88f1a0,_0x24cd38){var _0x34eb74=_0x88f1a0[_0xdfe0('0x71')];var _0x1d483d=[];if(_0x88f1a0[_0xdfe0('0x91')]['role']===_0xdfe0('0x3a'))throw new Error(_0xdfe0('0x9d'));if(_['some'](_0x34eb74,['role',_0xdfe0('0x91')])&&_0x88f1a0[_0xdfe0('0x91')][_0xdfe0('0x37')]!==_0xdfe0('0x38')){throw new Error(_0xdfe0('0x92'));}if(_[_0xdfe0('0x9e')](_0x34eb74,[_0xdfe0('0x37'),_0xdfe0('0x38')])&&_0x88f1a0[_0xdfe0('0x91')][_0xdfe0('0x37')]!==_0xdfe0('0x38')){throw new Error(_0xdfe0('0x9f'));}return licenseUtil[_0xdfe0('0x94')](_0x34eb74)['then'](function(){return validateUser(_0x34eb74[0x0]);})[_0xdfe0('0x22')](function(){for(var _0x26d810=0x1;_0x26d810<_0x34eb74[_0xdfe0('0x52')];_0x26d810++){var _0x342fb0=_0x34eb74[_0x26d810-0x1][_0xdfe0('0x76')];if(!_0x34eb74[_0x26d810][_0xdfe0('0x76')])_0x34eb74[_0x26d810][_0xdfe0('0x76')]=_0x342fb0+0x1;_0x1d483d['push'](validateUser(_0x34eb74[_0x26d810]));}return BPromise[_0xdfe0('0x6a')](_0x1d483d);})[_0xdfe0('0x22')](function(){_0x1d483d=[];for(var _0x2b70a5=0x0;_0x2b70a5<_0x34eb74[_0xdfe0('0x52')];_0x2b70a5++){_0x1d483d[_0xdfe0('0x61')](updateUser(_0x34eb74[_0x2b70a5]));}return BPromise['all'](_0x1d483d);})[_0xdfe0('0x22')](function(){return BPromise['each'](_0x34eb74,function(_0x5a16cf){return db[_0xdfe0('0x45')]['create'](_0x5a16cf,{'include':[{'model':db[_0xdfe0('0x81')],'as':_0xdfe0('0x81')}]})[_0xdfe0('0x22')](function(_0x451474){_0x5a16cf['id']=_0x451474['id'];return _0x5a16cf;});});})[_0xdfe0('0x22')](function(_0x11203d){if(_0x88f1a0[_0xdfe0('0x71')][_0xdfe0('0x37')]===_0xdfe0('0x91'))return _0x11203d;if(_0x88f1a0[_0xdfe0('0x91')][_0xdfe0('0x37')]!==_0xdfe0('0x91'))return _0x11203d;var _0x4b0450=_[_0xdfe0('0x9e')](_0x11203d,function(_0x2dd05f){return _0x2dd05f[_0xdfe0('0x37')]===_0xdfe0('0x3a')||_0x2dd05f[_0xdfe0('0x37')]===_0xdfe0('0xa0');});if(!_0x4b0450)return _0x11203d;return db[_0xdfe0('0x97')][_0xdfe0('0x62')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x88f1a0[_0xdfe0('0x91')][_0xdfe0('0x96')]},'raw':!![]})[_0xdfe0('0x22')](function(_0x6ad48f){if(_['isEmpty'](_0x6ad48f)||!_[_0xdfe0('0x9e')](_0x6ad48f,[_0xdfe0('0x99'),0x0]))return _0x11203d;_0x1d483d=[];var _0x1d597e=_(_0x6ad48f)['map'](function(_0x588528){if(_0x588528[_0xdfe0('0x99')]===0x1)return;return _0x588528[_0xdfe0('0x41')]===_0xdfe0('0x98')?_0xdfe0('0x3a'):_0xdfe0('0xa0');})[_0xdfe0('0xa1')]()['value']();for(var _0x57699c=0x0;_0x57699c<_0x11203d['length'];_0x57699c++){if(!_[_0xdfe0('0x3f')](_0x1d597e,_0x11203d[_0x57699c]['role']))return;var _0x211622=_0x11203d[_0x57699c][_0xdfe0('0x37')]===_0xdfe0('0x3a')?_0xdfe0('0x98'):_0xdfe0('0x3b');_0x1d483d[_0xdfe0('0x61')](db[_0xdfe0('0x9a')][_0xdfe0('0x90')]({'name':_0x11203d[_0x57699c][_0xdfe0('0x41')],'resourceId':_0x11203d[_0x57699c]['id'],'type':_0x211622,'sectionId':_[_0xdfe0('0x40')](_0x6ad48f,[_0xdfe0('0x41'),_0x211622])['id']},{}));}return BPromise[_0xdfe0('0x6a')](_0x1d483d);});})[_0xdfe0('0x22')](respondWithResult(_0x24cd38,0xc9))[_0xdfe0('0x6b')](handleError(_0x24cd38,null));};exports[_0xdfe0('0xa2')]=function(_0x1d2535,_0x5d5f5a,_0x40dfa2){if(_0x1d2535[_0xdfe0('0x71')]['id']){delete _0x1d2535[_0xdfe0('0x71')]['id'];}return db['User'][_0xdfe0('0x40')]({'where':{'id':_0x1d2535[_0xdfe0('0x72')]['id']}})[_0xdfe0('0x22')](function(_0x37d1ce){if(!_0x37d1ce)return null;if(_0x37d1ce['id']===_0x1d2535[_0xdfe0('0x91')]['id']){if(!_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa3')]||!_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')]){throw new db[(_0xdfe0('0xa5'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x37d1ce[_0xdfe0('0xa6')](_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa3')])){throw new db[(_0xdfe0('0xa5'))][(_0xdfe0('0xa7'))](_0xdfe0('0xa8'));}if(_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa3')]===_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')]){throw new db[(_0xdfe0('0xa5'))][(_0xdfe0('0xa7'))](_0xdfe0('0xa9'));}}else if(_0x1d2535[_0xdfe0('0x91')][_0xdfe0('0x37')]===_0xdfe0('0x38')){if(!_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')]){throw new db[(_0xdfe0('0xa5'))][(_0xdfe0('0xa7'))](_0xdfe0('0xaa'));}}else if(_0x1d2535['user']['role']===_0xdfe0('0x91')){if(!_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')]){throw new db['Sequelize'][(_0xdfe0('0xa7'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x37d1ce[_0xdfe0('0x37')]!==_0xdfe0('0x3a')){throw new db['Sequelize'][(_0xdfe0('0xa7'))](_0xdfe0('0x9d'));}}else{throw new db[(_0xdfe0('0xa5'))]['ValidationError'](_0xdfe0('0x9d'));}return _0x37d1ce;})[_0xdfe0('0x22')](handleEntityNotFound(_0x5d5f5a,null))[_0xdfe0('0x22')](function(_0x24a363){return db['Setting'][_0xdfe0('0xab')]({'attributes':['id',_0xdfe0('0x79'),'enforcePasswordHistory',_0xdfe0('0xac')]})[_0xdfe0('0x22')](function(_0xc1d642){if(_0xc1d642[_0xdfe0('0x79')])authService[_0xdfe0('0x7a')](_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')]);if(!_0xc1d642[_0xdfe0('0xad')]||!_0x24a363[_0xdfe0('0xae')])return _0x24a363;authService[_0xdfe0('0xaf')](_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')],_0x24a363[_0xdfe0('0xae')],_0xc1d642[_0xdfe0('0xac')]);return _0x24a363;})[_0xdfe0('0x22')](saveUpdates({'password':_0x1d2535[_0xdfe0('0x71')]['newPassword'],'passwordResetAt':_0x1d2535['user']['id']==_0x1d2535['params']['id']?moment():null,'previousPasswords':authService[_0xdfe0('0xb0')](_0x1d2535[_0xdfe0('0x71')][_0xdfe0('0xa4')],_0x24a363['previousPasswords'])},null));})['then'](respondWithResult(_0x5d5f5a,null))[_0xdfe0('0x6b')](handleError(_0x5d5f5a,null));};exports[_0xdfe0('0xb1')]=function(_0x25596e,_0x5301a4,_0x57f382){var _0x53216f=_0x25596e[_0xdfe0('0x71')]['channel'];return db[_0xdfe0('0x45')][_0xdfe0('0x40')]({'where':{'id':_0x25596e[_0xdfe0('0x72')]['id']},'attributes':['id',_0xdfe0('0x41'),_0xdfe0('0x37'),_0xdfe0('0xb2'),'loginInPause',_0xdfe0('0xb3'),_0xdfe0('0xb4')]})[_0xdfe0('0x22')](handleEntityNotFound(_0x5301a4,null))['then'](function(_0x347f24){if(_0x347f24){if(!utils[_0xdfe0('0xb5')](_0x53216f)){throw new db[(_0xdfe0('0xa5'))]['ValidationError'](_0xdfe0('0xb6'));}return _0x347f24[_0xdfe0('0xb7')+_['capitalize'](_0x53216f[_0xdfe0('0xb8')]())+'Queues'](_0x25596e[_0xdfe0('0x71')][_0xdfe0('0x74')],{'penalty':_0x25596e[_0xdfe0('0x71')][_0xdfe0('0xb9')]||0x0})['spread'](function(_0x4c47b8){for(var _0x5ab38e=0x0;_0x5ab38e<_0x25596e['body'][_0xdfe0('0x74')][_0xdfe0('0x52')];_0x5ab38e+=0x1){var _0xa36667={'UserId':Number(_0x25596e[_0xdfe0('0x72')]['id'])};_0xa36667[_[_0xdfe0('0xba')](_0x53216f[_0xdfe0('0xb8')]())+_0xdfe0('0xbb')]=Number(_0x25596e[_0xdfe0('0x71')][_0xdfe0('0x74')][_0x5ab38e]);socket[_0xdfe0('0xbc')]('user'+_[_0xdfe0('0xba')](_0x53216f['toLowerCase']())+'Queue:save',_0xa36667);}return _0x4c47b8;})[_0xdfe0('0x22')](function(){if(_0x53216f==='voice'){return db[_0xdfe0('0xbd')][_0xdfe0('0x62')]({'where':{'id':_0x25596e['body'][_0xdfe0('0x74')]||[]},'raw':!![],'attributes':['id',_0xdfe0('0x41')]});}})[_0xdfe0('0x22')](function(_0x1bb07a){var _0x505dc2=_0x347f24['get']({'plain':!![]});var _0x22d74f=[];if(_0x53216f==='voice'&&_0x505dc2[_0xdfe0('0x37')]===_0xdfe0('0x3a')&&_0x505dc2['online']){for(var _0x21592c=0x0;_0x21592c<_0x1bb07a[_0xdfe0('0x52')];_0x21592c+=0x1){_0x22d74f[_0xdfe0('0x61')]({'membername':_0x505dc2['name'],'UserId':_0x505dc2['id'],'queue_name':_0x1bb07a[_0x21592c][_0xdfe0('0x41')],'VoiceQueueId':_0x1bb07a[_0x21592c]['id'],'interface':_[_0xdfe0('0x7b')](_0x505dc2['interface'])?util['format'](_0xdfe0('0xbe'),_0x505dc2[_0xdfe0('0x41')]):_0x505dc2['interface'],'paused':_0x505dc2[_0xdfe0('0xb3')]||![],'penalty':_0x25596e[_0xdfe0('0x71')][_0xdfe0('0xb9')]||0x0});}return BPromise['each'](_0x22d74f,function(_0x1b03c0){return db[_0xdfe0('0xbf')]['upsert'](_0x1b03c0);});}return _0x347f24;});}})[_0xdfe0('0x22')](respondWithStatusCode(_0x5301a4,null))[_0xdfe0('0x6b')](handleError(_0x5301a4,null));};exports['removeQueues']=function(_0x417fe1,_0x37038d,_0x49c257){var _0x430059;return db[_0xdfe0('0x45')]['find']({'where':{'id':_0x417fe1['params']['id']},'attributes':['id',_0xdfe0('0x41'),'role']})[_0xdfe0('0x22')](handleEntityNotFound(_0x37038d,null))[_0xdfe0('0x22')](function(_0x12e54c){if(_0x12e54c){_0x430059=_0x12e54c;if(!_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0xc0')]||!utils['isValidChannel'](_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0xc0')])){throw new db['Sequelize'][(_0xdfe0('0xa7'))]('Unknown\x20channel');}return _0x12e54c[_0xdfe0('0xc1')+_['capitalize'](_0x417fe1['query'][_0xdfe0('0xc0')][_0xdfe0('0xb8')]())+_0xdfe0('0xc2')](_0x417fe1['query'][_0xdfe0('0x74')]);}})[_0xdfe0('0x22')](function(_0x37f8e2){for(var _0xbbc0da=0x0;_0xbbc0da<_0x417fe1[_0xdfe0('0x4d')]['ids'][_0xdfe0('0x52')];_0xbbc0da+=0x1){var _0x1b01ff={'UserId':Number(_0x417fe1[_0xdfe0('0x72')]['id'])};_0x1b01ff[_[_0xdfe0('0xba')](_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0xc0')][_0xdfe0('0xb8')]())+_0xdfe0('0xbb')]=Number(_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0x74')][_0xbbc0da]);socket['emit'](_0xdfe0('0x91')+_[_0xdfe0('0xba')](_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0xc0')][_0xdfe0('0xb8')]())+_0xdfe0('0xc3'),_0x1b01ff);}return _0x37f8e2;})['then'](function(){if(_0x417fe1['query'][_0xdfe0('0xc0')]===_0xdfe0('0xc4')){return db[_0xdfe0('0xbf')]['destroy']({'where':{'UserId':_0x417fe1[_0xdfe0('0x72')]['id'],'VoiceQueueId':_0x417fe1[_0xdfe0('0x4d')][_0xdfe0('0x74')]},'individualHooks':!![]})[_0xdfe0('0x22')](function(){return _0x430059;});}return _0x430059;})[_0xdfe0('0x22')](respondWithStatusCode(_0x37038d,null))[_0xdfe0('0x6b')](handleError(_0x37038d,null));};exports[_0xdfe0('0xc5')]=function(_0x412783,_0x4634b1,_0x4b6aa8){_0x412783[_0xdfe0('0x71')]['userpic']=_0x412783[_0xdfe0('0xc6')][_0xdfe0('0xc7')];return db[_0xdfe0('0x45')]['find']({'where':{'id':_0x412783[_0xdfe0('0x72')]['id']}})[_0xdfe0('0x22')](handleEntityNotFound(_0x4634b1,null))['then'](saveUpdates(_0x412783[_0xdfe0('0x71')],null))['then'](respondWithResult(_0x4634b1,null))['catch'](handleError(_0x4634b1,null));};exports['getAvatar']=function(_0x5edf34,_0x21dd79,_0x5a138e){var _0x49ae9d=path[_0xdfe0('0xc8')](config[_0xdfe0('0xc9')],'server/files/images/logos/default_profile.png');return db[_0xdfe0('0x45')][_0xdfe0('0x40')]({'where':{'id':_0x5edf34[_0xdfe0('0x72')]['id']},'attributes':['id',_0xdfe0('0xca')],'raw':!![]})['then'](handleEntityNotFound(_0x21dd79,null))[_0xdfe0('0x22')](function(_0x5d3d73){if(_0x5d3d73){if(_[_0xdfe0('0x7b')](_0x5d3d73[_0xdfe0('0xca')])){return _0x21dd79[_0xdfe0('0xcb')](_0x49ae9d);}else{if(!fs[_0xdfe0('0xcc')](path[_0xdfe0('0xc8')](config['root'],_0xdfe0('0xcd'),_0x5d3d73[_0xdfe0('0xca')]))){return _0x21dd79[_0xdfe0('0xcb')](_0x49ae9d);}return _0x21dd79[_0xdfe0('0xcb')](path['join'](config[_0xdfe0('0xc9')],_0xdfe0('0xcd'),_0x5d3d73[_0xdfe0('0xca')]));}}})[_0xdfe0('0x6b')](handleError(_0x21dd79,null));};exports[_0xdfe0('0xce')]=function(_0x47f1ad,_0x609afd,_0x356ce4){return db['User']['find']({'where':{'id':_0x47f1ad[_0xdfe0('0x72')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x609afd,null))[_0xdfe0('0x22')](function(_0x4e8a3d){var _0x580d77=[];values=_0x4e8a3d[_0xdfe0('0x66')];_0x580d77[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0xcf'),_0x4e8a3d[_0xdfe0('0x66')]));_0x580d77[_0xdfe0('0x61')](get_open_tabs('sms',_0x4e8a3d[_0xdfe0('0x66')]));_0x580d77[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x69'),_0x4e8a3d[_0xdfe0('0x66')]));_0x580d77[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x6f'),_0x4e8a3d[_0xdfe0('0x66')]));_0x580d77[_0xdfe0('0x61')](get_open_tabs(_0xdfe0('0x68'),_0x4e8a3d[_0xdfe0('0x66')]));_0x580d77[_0xdfe0('0x61')](get_open_tabs('mail',_0x4e8a3d['dataValues']));return BPromise['all'](_0x580d77);})['then'](function(_0x5a936b){var _0x354a6b=[];if(_0x5a936b){for(var _0x348d4d=0x0;_0x348d4d=_0x45366a[_0x1aa4('0x53')]){throw new Error(_0x1aa4('0x54'));}})['then'](function(){if(_0x103d41){return db[_0x1aa4('0x2b')][_0x1aa4('0x4a')]({'where':{'membername':_0x103d41[_0x1aa4('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x103d41){return _0x103d41[_0x1aa4('0x55')]({'raw':!![]});}})['then'](function(_0x3d4d98){if(_0x103d41){if(_0x3d4d98){var _0x46a1d3=[];_0x2f1e6f=_0x3d4d98;if(_0x2f1e6f['length']){for(var _0x3021cf=0x0;_0x3021cf<_0x2f1e6f[_0x1aa4('0x2d')];_0x3021cf++){_0x46a1d3['push'](db[_0x1aa4('0x2b')]['upsert']({'membername':_0x103d41[_0x1aa4('0x27')],'UserId':_0x103d41['id'],'queue_name':_0x2f1e6f[_0x3021cf]['name'],'VoiceQueueId':_0x2f1e6f[_0x3021cf]['id'],'interface':_0x38816a,'paused':_0x103d41['loginInPause']||![],'penalty':_0x2f1e6f[_0x3021cf][_0x1aa4('0x56')]||0x0}));}return BPromise[_0x1aa4('0x48')](_0x46a1d3);}}}})[_0x1aa4('0xd')](function(){if(_0x103d41){return db[_0x1aa4('0x36')][_0x1aa4('0x1b')]({'where':{'membername':_0x103d41['name'],'exitAt':null}});}})[_0x1aa4('0xd')](function(_0x1d7d5a){if(_0x103d41){if(_0x1d7d5a&&_0x1d7d5a[_0x1aa4('0x2d')]){var _0x59b41a=[];_0x1d7d5a[_0x1aa4('0x31')](function(_0x5f0473){_0x59b41a[_0x1aa4('0x47')](_0x5f0473['update']({'exitAt':moment()[_0x1aa4('0x2e')](_0x1aa4('0x2f'))}));});return BPromise[_0x1aa4('0x48')](_0x59b41a);}}})[_0x1aa4('0xd')](function(_0x418c8b){if(_0x103d41){var _0x295ac8=[];var _0x2bddaf=[];var _0x1899a2=utils['getChannels']();var _0x2d68ff={'membername':_0x103d41[_0x1aa4('0x27')],'interface':_0x38816a,'enterAt':moment()['format'](_0x1aa4('0x2f')),'role':_0x103d41['role'],'internal':_0x103d41['internal']};_0x1899a2[_0x1aa4('0x31')](function(_0x3f0954){_0x295ac8[_0x1aa4('0x47')](_[_0x1aa4('0x57')]({'channel':_0x3f0954,'type':_0x1aa4('0x58'),'data1':_0x1aa4('0x59'),'data2':_0x38816a},_0x2d68ff));if(_0x103d41[_0x1aa4('0x4e')]){_0x2bddaf['push'](_['merge']({'channel':_0x3f0954,'type':'PAUSE','data1':_0x1aa4('0x5a')},_0x2d68ff));}});return db['MemberReport'][_0x1aa4('0x37')](_0x295ac8[_0x1aa4('0x5b')](_0x2bddaf),{'individualHooks':!![]});}})[_0x1aa4('0xd')](function(){if(_0x103d41){return _0x103d41[_0x1aa4('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x1aa4('0x2e')](_0x1aa4('0x2f')),'voicePause':_0x103d41[_0x1aa4('0x4e')]||![],'mailPause':_0x103d41[_0x1aa4('0x4e')]||![],'chatPause':_0x103d41[_0x1aa4('0x4e')]||![],'faxPause':_0x103d41[_0x1aa4('0x4e')]||![],'smsPause':_0x103d41[_0x1aa4('0x4e')]||![],'openchannelPause':_0x103d41['loginInPause']||![],'pauseType':_0x103d41[_0x1aa4('0x4e')]?_0x1aa4('0x5a'):null,'lastPauseAt':moment()[_0x1aa4('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x38816a});}})[_0x1aa4('0xd')](function(_0x9b318d){_0x4c028b(_0x9b318d);})['catch'](function(_0x206765){_0x5803b3(_0x3b2c0e['error'](0x1f4,_0x206765[_0x1aa4('0x16')]));});});}; \ No newline at end of file +var _0x65fa=['type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','UnpauseUser','channel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','whatsapp','find','set','%s%s','Pause','forEach','push','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','getLicense','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./user.socket','request','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetUser','findAll','options','where','attributes','map','include','model','catch','User','raw','then','ShowUser','PauseUser','name','role','internal','interface','MemberReport','PAUSE','length','getChannels','isNil','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','body'];(function(_0x13a0d6,_0x9a1972){var _0x241df1=function(_0x44fd40){while(--_0x44fd40){_0x13a0d6['push'](_0x13a0d6['shift']());}};_0x241df1(++_0x9a1972);}(_0x65fa,0xe8));var _0xa65f=function(_0x3b4380,_0x431834){_0x3b4380=_0x3b4380-0x0;var _0x971c77=_0x65fa[_0x3b4380];return _0x971c77;};'use strict';var _=require(_0xa65f('0x0'));var util=require(_0xa65f('0x1'));var moment=require(_0xa65f('0x2'));var BPromise=require(_0xa65f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa65f('0x4'))['db'];var utils=require(_0xa65f('0x5'));var logger=require(_0xa65f('0x6'))(_0xa65f('0x7'));var config=require(_0xa65f('0x8'));var jayson=require(_0xa65f('0x9'));var client=jayson[_0xa65f('0xa')]['http']({'port':0x232a});config[_0xa65f('0xb')]=_['defaults'](config[_0xa65f('0xb')],{'host':_0xa65f('0xc'),'port':0x18eb});var socket=require(_0xa65f('0xd'))(new Redis(config[_0xa65f('0xb')]));require(_0xa65f('0xe'))['register'](socket);function respondWithRpcPromise(_0x43e52b,_0x196134,_0x5d1b62){return new BPromise(function(_0x15da63,_0x2529be){return client[_0xa65f('0xf')](_0x43e52b,_0x5d1b62)['then'](function(_0x5934fe){logger['info'](_0xa65f('0x10'),_0x196134,_0xa65f('0x11'));logger[_0xa65f('0x12')](_0xa65f('0x13'),_0x196134,_0xa65f('0x11'),JSON[_0xa65f('0x14')](_0x5934fe));if(_0x5934fe[_0xa65f('0x15')]){if(_0x5934fe['error'][_0xa65f('0x16')]===0x1f4){logger[_0xa65f('0x15')](_0xa65f('0x10'),_0x196134,_0x5934fe[_0xa65f('0x15')][_0xa65f('0x17')]);return _0x2529be(_0x5934fe['error']['message']);}logger[_0xa65f('0x15')](_0xa65f('0x10'),_0x196134,_0x5934fe[_0xa65f('0x15')][_0xa65f('0x17')]);return _0x15da63(_0x5934fe['error'][_0xa65f('0x17')]);}else{logger[_0xa65f('0x18')](_0xa65f('0x10'),_0x196134,_0xa65f('0x11'));_0x15da63(_0x5934fe[_0xa65f('0x19')]['message']);}})['catch'](function(_0x3f2065){logger[_0xa65f('0x15')](_0xa65f('0x10'),_0x196134,_0x3f2065);_0x2529be(_0x3f2065);});});}exports[_0xa65f('0x1a')]=function(_0xcb7ce3){var _0xb8d644=this;return new Promise(function(_0x335a9b,_0xf18e29){return db['User'][_0xa65f('0x1b')]({'raw':_0xcb7ce3[_0xa65f('0x1c')]?_0xcb7ce3['options']['raw']===undefined?!![]:![]:!![],'where':_0xcb7ce3[_0xa65f('0x1c')]?_0xcb7ce3[_0xa65f('0x1c')][_0xa65f('0x1d')]||null:null,'attributes':_0xcb7ce3['options']?_0xcb7ce3[_0xa65f('0x1c')][_0xa65f('0x1e')]||null:null,'limit':_0xcb7ce3[_0xa65f('0x1c')]?_0xcb7ce3['options']['limit']||null:null,'include':_0xcb7ce3[_0xa65f('0x1c')]?_0xcb7ce3['options']['include']?_[_0xa65f('0x1f')](_0xcb7ce3['options']['include'],function(_0x114ed1){return{'model':db[_0x114ed1['model']],'as':_0x114ed1['as'],'attributes':_0x114ed1[_0xa65f('0x1e')],'include':_0x114ed1[_0xa65f('0x20')]?_[_0xa65f('0x1f')](_0x114ed1['include'],function(_0x26ed26){return{'model':db[_0x26ed26[_0xa65f('0x21')]],'as':_0x26ed26['as'],'attributes':_0x26ed26['attributes'],'include':_0x26ed26['include']?_[_0xa65f('0x1f')](_0x26ed26[_0xa65f('0x20')],function(_0x3cc27a){return{'model':db[_0x3cc27a[_0xa65f('0x21')]],'as':_0x3cc27a['as'],'attributes':_0x3cc27a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d1159){logger['info'](_0xa65f('0x1a'),_0xcb7ce3);logger[_0xa65f('0x12')]('GetUser',_0xcb7ce3,JSON['stringify'](_0x3d1159));_0x335a9b(_0x3d1159);})[_0xa65f('0x22')](function(_0x336757){logger[_0xa65f('0x15')](_0xa65f('0x1a'),_0x336757[_0xa65f('0x17')],_0xcb7ce3);_0xf18e29(_0xb8d644['error'](0x1f4,_0x336757[_0xa65f('0x17')]));});});};exports['ShowUser']=function(_0x290030){var _0x461b0a=this;return new Promise(function(_0x28dd61,_0x1ddfba){return db[_0xa65f('0x23')]['find']({'raw':_0x290030['options']?_0x290030['options'][_0xa65f('0x24')]===undefined?!![]:![]:!![],'where':_0x290030[_0xa65f('0x1c')]?_0x290030['options'][_0xa65f('0x1d')]||null:null,'attributes':_0x290030[_0xa65f('0x1c')]?_0x290030['options']['attributes']||null:null,'include':_0x290030['options']?_0x290030[_0xa65f('0x1c')][_0xa65f('0x20')]?_['map'](_0x290030[_0xa65f('0x1c')]['include'],function(_0x41add2){return{'model':db[_0x41add2[_0xa65f('0x21')]],'as':_0x41add2['as'],'attributes':_0x41add2['attributes'],'include':_0x41add2[_0xa65f('0x20')]?_[_0xa65f('0x1f')](_0x41add2[_0xa65f('0x20')],function(_0x74fa2f){return{'model':db[_0x74fa2f['model']],'as':_0x74fa2f['as'],'attributes':_0x74fa2f['attributes'],'include':_0x74fa2f[_0xa65f('0x20')]?_[_0xa65f('0x1f')](_0x74fa2f[_0xa65f('0x20')],function(_0x1c638f){return{'model':db[_0x1c638f[_0xa65f('0x21')]],'as':_0x1c638f['as'],'attributes':_0x1c638f[_0xa65f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa65f('0x25')](function(_0x15f8cb){logger[_0xa65f('0x18')]('ShowUser',_0x290030);logger['debug'](_0xa65f('0x26'),_0x290030,JSON[_0xa65f('0x14')](_0x15f8cb));_0x28dd61(_0x15f8cb);})[_0xa65f('0x22')](function(_0x20690e){logger[_0xa65f('0x15')](_0xa65f('0x26'),_0x20690e[_0xa65f('0x17')],_0x290030);_0x1ddfba(_0x461b0a[_0xa65f('0x15')](0x1f4,_0x20690e[_0xa65f('0x17')]));});});};exports[_0xa65f('0x27')]=function(_0x4df559){var _0x50a727=this;return new Promise(function(_0x22eb36,_0x5a5ebe){var _0x208053;return db['User']['find']({'where':_0x4df559['options'][_0xa65f('0x1d')]||{},'attributes':['id',_0xa65f('0x28'),_0xa65f('0x29'),_0xa65f('0x2a'),_0xa65f('0x2b')]})[_0xa65f('0x25')](function(_0x15e8b7){if(_0x15e8b7){_0x208053=_0x15e8b7;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x208053['id']},'individualHooks':!![]});}})[_0xa65f('0x25')](function(){if(_0x208053){return db[_0xa65f('0x2c')][_0xa65f('0x1b')]({'where':{'membername':_0x208053[_0xa65f('0x28')],'type':_0xa65f('0x2d'),'exitAt':null}});}})['then'](function(_0x58b755){if(_0x208053){if(_0x58b755&&_0x58b755[_0xa65f('0x2e')]){var _0x4fe38a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x291677=0x0,_0x42ad8e=_0x58b755['length'];_0x291677<_0x42ad8e;_0x291677++){_0x58b755[_0x291677]['updateAttributes']({'exitAt':_0x4fe38a});}}}})[_0xa65f('0x25')](function(){if(_0x208053){var _0x2c9bae=[];var _0x3bcc80=utils[_0xa65f('0x2f')]();_0x3bcc80['forEach'](function(_0x1d96ec){_0x2c9bae['push']({'channel':_0x1d96ec,'membername':_0x208053['name'],'interface':_[_0xa65f('0x30')](_0x208053[_0xa65f('0x2b')])?util['format'](_0xa65f('0x31'),_0x208053[_0xa65f('0x28')]):_0x208053[_0xa65f('0x2b')],'type':'PAUSE','enterAt':moment()[_0xa65f('0x32')](_0xa65f('0x33')),'data1':_0x4df559[_0xa65f('0x34')][_0xa65f('0x35')]||_0xa65f('0x36'),'role':_0x208053['role'],'internal':_0x208053['internal'],'uniqueid':_0x4df559[_0xa65f('0x34')][_0xa65f('0x37')]||null});});return db[_0xa65f('0x2c')][_0xa65f('0x38')](_0x2c9bae,{'individualHooks':!![]});}})[_0xa65f('0x25')](function(){if(_0x208053){return _0x208053[_0xa65f('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4df559[_0xa65f('0x34')][_0xa65f('0x35')]||_0xa65f('0x36'),'lastPauseAt':moment()[_0xa65f('0x32')](_0xa65f('0x33'))});}})[_0xa65f('0x25')](function(_0x498788){_0x22eb36(_0x498788);})['catch'](function(_0x4199e){_0x5a5ebe(_0x50a727[_0xa65f('0x15')](0x1f4,_0x4199e[_0xa65f('0x17')]));});});};exports[_0xa65f('0x3a')]=function(_0x106891){var _0x128fca=this;return new Promise(function(_0x4312bd,_0x1eace1){var _0x1d419c;return db[_0xa65f('0x23')]['findOne']({'where':_0x106891['options']['where']||{},'attributes':['id',_0xa65f('0x28')]})[_0xa65f('0x25')](function(_0x2b3886){if(_0x2b3886){_0x1d419c=_0x2b3886;if(_0x106891[_0xa65f('0x34')][_0xa65f('0x3b')]&&!utils['isValidChannel'](_0x106891[_0xa65f('0x34')][_0xa65f('0x3b')])){throw new Error(_0xa65f('0x3c'));}switch(_0x106891[_0xa65f('0x34')][_0xa65f('0x3b')]){case _0xa65f('0x3d'):return db[_0xa65f('0x3e')][_0xa65f('0x39')]({'paused':0x0},{'where':{'UserId':_0x1d419c['id']}})['then'](function(){return db[_0xa65f('0x2c')]['find']({'where':{'channel':_0x106891['body']['channel'],'membername':_0x1d419c['name'],'type':'PAUSE','exitAt':null}});})[_0xa65f('0x25')](function(_0xd26375){if(_0xd26375){return _0xd26375[_0xa65f('0x39')]({'exitAt':moment()[_0xa65f('0x32')](_0xa65f('0x33')),'data2':_0xa65f('0x3f')},{'individualHooks':!![]});}return null;})[_0xa65f('0x25')](function(){return _0x1d419c[_0xa65f('0x39')]({'voicePause':![]});});case _0xa65f('0x40'):case _0xa65f('0x41'):case _0xa65f('0x42'):case _0xa65f('0x43'):case _0xa65f('0x44'):case _0xa65f('0x45'):return db[_0xa65f('0x2c')][_0xa65f('0x46')]({'where':{'channel':_0x106891[_0xa65f('0x34')][_0xa65f('0x3b')],'membername':_0x1d419c[_0xa65f('0x28')],'type':_0xa65f('0x2d'),'exitAt':null}})['then'](function(_0x3c62ba){return _0x3c62ba[_0xa65f('0x39')]({'exitAt':moment()['format'](_0xa65f('0x33')),'data2':_0xa65f('0x3f')},{'individualHooks':!![]});})['then'](function(){var _0x28618f={};_[_0xa65f('0x47')](_0x28618f,util['format'](_0xa65f('0x48'),_0x106891[_0xa65f('0x34')][_0xa65f('0x3b')],_0xa65f('0x49')),![]);return _0x1d419c[_0xa65f('0x39')](_0x28618f);});default:return db[_0xa65f('0x3e')][_0xa65f('0x39')]({'paused':0x0},{'where':{'UserId':_0x1d419c['id']}})['then'](function(){return db['MemberReport'][_0xa65f('0x1b')]({'where':{'membername':_0x1d419c['name'],'type':'PAUSE','exitAt':null}});})[_0xa65f('0x25')](function(_0x4fabf4){var _0x3f05ea=[];_0x4fabf4[_0xa65f('0x4a')](function(_0x45b60a){_0x3f05ea[_0xa65f('0x4b')](_0x45b60a[_0xa65f('0x39')]({'exitAt':moment()[_0xa65f('0x32')](_0xa65f('0x33')),'data2':_0xa65f('0x3f')}));});return BPromise[_0xa65f('0x4c')](_0x3f05ea);})[_0xa65f('0x25')](function(){return _0x1d419c[_0xa65f('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xa65f('0x25')](function(_0xb2e415){_0x4312bd(_0xb2e415);})['catch'](function(_0x334c5f){_0x1eace1(_0x128fca[_0xa65f('0x15')](0x1f4,_0x334c5f[_0xa65f('0x17')]));});});};exports[_0xa65f('0x4d')]=function(_0x27a20a){var _0x3eab35=this;return new Promise(function(_0x4d477d,_0x52fa10){var _0x1ce60f;return db[_0xa65f('0x23')]['findOne']({'where':_0x27a20a[_0xa65f('0x1c')][_0xa65f('0x1d')]||{},'attributes':['id',_0xa65f('0x28')]})[_0xa65f('0x25')](function(_0x187496){if(_0x187496){_0x1ce60f=_0x187496;return db[_0xa65f('0x3e')][_0xa65f('0x4e')]({'where':{'membername':_0x1ce60f[_0xa65f('0x28')]},'individualHooks':!![]});}})[_0xa65f('0x25')](function(){if(_0x1ce60f){return db['MemberReport']['findAll']({'where':{'membername':_0x1ce60f[_0xa65f('0x28')],'exitAt':null}});}})[_0xa65f('0x25')](function(_0x4bf49b){if(_0x1ce60f){if(_0x4bf49b&&_0x4bf49b[_0xa65f('0x2e')]){var _0x138550=[];_0x4bf49b[_0xa65f('0x4a')](function(_0x18e69d){_0x138550[_0xa65f('0x4b')](_0x18e69d[_0xa65f('0x39')]({'exitAt':moment()[_0xa65f('0x32')](_0xa65f('0x33'))}));});return BPromise[_0xa65f('0x4c')](_0x138550);}}})['then'](function(){if(_0x1ce60f){return _0x1ce60f['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xa65f('0x25')](function(_0x1b17c9){_0x4d477d(_0x1b17c9);})[_0xa65f('0x22')](function(_0x1c3bb5){_0x52fa10(_0x3eab35[_0xa65f('0x15')](0x1f4,_0x1c3bb5[_0xa65f('0x17')]));});});};exports[_0xa65f('0x4f')]=function(_0x9c1a9a){var _0x3fe799=this;return new Promise(function(_0x331376,_0x44b7d2){var _0x11f3f2;var _0x241b8e;var _0x1dc3cf;var _0x512aac;return db[_0xa65f('0x23')]['findOne']({'where':_0x9c1a9a[_0xa65f('0x1c')]['where']||{},'attributes':['id',_0xa65f('0x28'),_0xa65f('0x29'),_0xa65f('0x50'),_0xa65f('0x51'),'internal',_0xa65f('0x52'),_0xa65f('0x2b')]})[_0xa65f('0x25')](function(_0x3d4124){if(_0x3d4124){_0x11f3f2=_0x3d4124;_0x512aac=_0x9c1a9a[_0xa65f('0x34')]['interface']?_0x9c1a9a[_0xa65f('0x34')][_0xa65f('0x2b')]:util[_0xa65f('0x32')](_0xa65f('0x31'),_0x11f3f2[_0xa65f('0x28')]);return db['User'][_0xa65f('0x53')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x11f3f2['id']}}});}})[_0xa65f('0x25')](function(_0x4eba18){if(_0x4eba18){_0x1dc3cf=_0x4eba18;return require(_0xa65f('0x54'))[_0xa65f('0x55')]();}})[_0xa65f('0x25')](function(_0x3bc375){if(_0x3bc375&&_0x3bc375['agents']&&_0x1dc3cf>=_0x3bc375['agents']){throw new Error(_0xa65f('0x56'));}})[_0xa65f('0x25')](function(){if(_0x11f3f2){return db[_0xa65f('0x3e')][_0xa65f('0x4e')]({'where':{'membername':_0x11f3f2[_0xa65f('0x28')]},'individualHooks':!![]});}})[_0xa65f('0x25')](function(){if(_0x11f3f2){return _0x11f3f2[_0xa65f('0x57')]({'raw':!![]});}})['then'](function(_0x48aecd){if(_0x11f3f2){if(_0x48aecd){var _0x11b48c=[];_0x241b8e=_0x48aecd;if(_0x241b8e[_0xa65f('0x2e')]){for(var _0x5054e4=0x0;_0x5054e4<_0x241b8e[_0xa65f('0x2e')];_0x5054e4++){_0x11b48c[_0xa65f('0x4b')](db[_0xa65f('0x3e')][_0xa65f('0x58')]({'membername':_0x11f3f2[_0xa65f('0x28')],'UserId':_0x11f3f2['id'],'queue_name':_0x241b8e[_0x5054e4]['name'],'VoiceQueueId':_0x241b8e[_0x5054e4]['id'],'interface':_0x512aac,'paused':_0x11f3f2[_0xa65f('0x52')]||![],'penalty':_0x241b8e[_0x5054e4][_0xa65f('0x59')]||0x0}));}return BPromise[_0xa65f('0x4c')](_0x11b48c);}}}})['then'](function(){if(_0x11f3f2){return db['MemberReport'][_0xa65f('0x1b')]({'where':{'membername':_0x11f3f2[_0xa65f('0x28')],'exitAt':null}});}})[_0xa65f('0x25')](function(_0x913a5b){if(_0x11f3f2){if(_0x913a5b&&_0x913a5b['length']){var _0x1ce466=[];_0x913a5b['forEach'](function(_0x1191f8){_0x1ce466['push'](_0x1191f8['update']({'exitAt':moment()[_0xa65f('0x32')](_0xa65f('0x33'))}));});return BPromise[_0xa65f('0x4c')](_0x1ce466);}}})[_0xa65f('0x25')](function(_0x3aabdd){if(_0x11f3f2){var _0xf8aa25=[];var _0x5673fa=[];var _0x1bf734=utils['getChannels']();var _0x3a9283={'membername':_0x11f3f2['name'],'interface':_0x512aac,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x11f3f2['role'],'internal':_0x11f3f2[_0xa65f('0x2a')]};_0x1bf734[_0xa65f('0x4a')](function(_0x1b26be){_0xf8aa25[_0xa65f('0x4b')](_[_0xa65f('0x5a')]({'channel':_0x1b26be,'type':_0xa65f('0x5b'),'data1':_0xa65f('0x5c'),'data2':_0x512aac},_0x3a9283));if(_0x11f3f2[_0xa65f('0x52')]){_0x5673fa[_0xa65f('0x4b')](_[_0xa65f('0x5a')]({'channel':_0x1b26be,'type':_0xa65f('0x2d'),'data1':_0xa65f('0x5d')},_0x3a9283));}});return db['MemberReport'][_0xa65f('0x38')](_0xf8aa25[_0xa65f('0x5e')](_0x5673fa),{'individualHooks':!![]});}})[_0xa65f('0x25')](function(){if(_0x11f3f2){return _0x11f3f2[_0xa65f('0x39')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x11f3f2[_0xa65f('0x52')]||![],'mailPause':_0x11f3f2['loginInPause']||![],'chatPause':_0x11f3f2[_0xa65f('0x52')]||![],'faxPause':_0x11f3f2[_0xa65f('0x52')]||![],'smsPause':_0x11f3f2['loginInPause']||![],'openchannelPause':_0x11f3f2[_0xa65f('0x52')]||![],'pauseType':_0x11f3f2[_0xa65f('0x52')]?_0xa65f('0x5d'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x512aac});}})[_0xa65f('0x25')](function(_0x3ff0d9){_0x331376(_0x3ff0d9);})['catch'](function(_0x31f72a){_0x44b7d2(_0x3fe799[_0xa65f('0x15')](0x1f4,_0x31f72a['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 48a40ce..6784665 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 _0x8ec9=['save','remove','update','register','length','user:','./user.events'];(function(_0x310814,_0x3811fd){var _0x41287c=function(_0x17ac50){while(--_0x17ac50){_0x310814['push'](_0x310814['shift']());}};_0x41287c(++_0x3811fd);}(_0x8ec9,0x148));var _0x98ec=function(_0x396b3d,_0x33f17f){_0x396b3d=_0x396b3d-0x0;var _0x2a6c36=_0x8ec9[_0x396b3d];return _0x2a6c36;};'use strict';var UserEvents=require(_0x98ec('0x0'));var events=[_0x98ec('0x1'),_0x98ec('0x2'),_0x98ec('0x3')];function createListener(_0x512e6c,_0x5f3f0c){return function(_0x190078){_0x5f3f0c['emit'](_0x512e6c,_0x190078);};}function removeListener(_0x38f03e,_0x58c216){return function(){UserEvents['removeListener'](_0x38f03e,_0x58c216);};}exports[_0x98ec('0x4')]=function(_0x4b2183){for(var _0x44082c=0x0,_0x51343c=events[_0x98ec('0x5')];_0x44082c<_0x51343c;_0x44082c++){var _0xdd3aaa=events[_0x44082c];var _0x399d6b=createListener(_0x98ec('0x6')+_0xdd3aaa,_0x4b2183);UserEvents['on'](_0xdd3aaa,_0x399d6b);}}; \ No newline at end of file +var _0x3553=['emit','removeListener','length','update'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x3553,0xbb));var _0x3355=function(_0x4873b4,_0x5f2f35){_0x4873b4=_0x4873b4-0x0;var _0x86299c=_0x3553[_0x4873b4];return _0x86299c;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x3355('0x0')];function createListener(_0x5eca8c,_0x44edff){return function(_0x4dcfbe){_0x44edff[_0x3355('0x1')](_0x5eca8c,_0x4dcfbe);};}function removeListener(_0x3cd6a3,_0x3db9c0){return function(){UserEvents[_0x3355('0x2')](_0x3cd6a3,_0x3db9c0);};}exports['register']=function(_0x14fdb8){for(var _0x327f21=0x0,_0x15104f=events[_0x3355('0x3')];_0x327f21<_0x15104f;_0x327f21++){var _0x553b4b=events[_0x327f21];var _0x5e02c5=createListener('user:'+_0x553b4b,_0x14fdb8);UserEvents['on'](_0x553b4b,_0x5e02c5);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9f27b3a..ac80a89 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x542c00,_0x990d86){var _0x34ef64=function(_0x115a6b){while(--_0x115a6b){_0x542c00['push'](_0x542c00['shift']());}};_0x34ef64(++_0x990d86);}(_0xe706,0xa3));var _0x6e70=function(_0x1d3ece,_0x3fb359){_0x1d3ece=_0x1d3ece-0x0;var _0x1ba5d2=_0xe706[_0x1d3ece];return _0x1ba5d2;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x6d5b3d,_0x6c4e13){var _0x1796db=function(_0x5ac7d9){while(--_0x5ac7d9){_0x6d5b3d['push'](_0x6d5b3d['shift']());}};_0x1796db(++_0x6c4e13);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xcb91[_0x16e57d];return _0x40239c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f84de5c..d363826 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 _0x9175=['exports'];(function(_0x26f358,_0x342fa6){var _0x255513=function(_0x36b535){while(--_0x36b535){_0x26f358['push'](_0x26f358['shift']());}};_0x255513(++_0x342fa6);}(_0x9175,0x14f));var _0x5917=function(_0x17e7d7,_0x46d048){_0x17e7d7=_0x17e7d7-0x0;var _0x2acf13=_0x9175[_0x17e7d7];return _0x2acf13;};'use strict';var Sequelize=require('sequelize');module[_0x5917('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x444a=['sequelize','INTEGER'];(function(_0x25171a,_0x10d966){var _0x5a2e6e=function(_0x343758){while(--_0x343758){_0x25171a['push'](_0x25171a['shift']());}};_0x5a2e6e(++_0x10d966);}(_0x444a,0xa2));var _0xa444=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x444a[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xa444('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa444('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 1c1a7ba..b844013 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 _0xc772=['lodash','util','../../config/logger','api','bluebird','path','rimraf','./userChatQueue.attributes','user_has_chat_queues'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0xc772,0x183));var _0x2c77=function(_0x13cb7a,_0x2eb6bc){_0x13cb7a=_0x13cb7a-0x0;var _0x1a3587=_0xc772[_0x13cb7a];return _0x1a3587;};'use strict';var _=require(_0x2c77('0x0'));var util=require(_0x2c77('0x1'));var logger=require(_0x2c77('0x2'))(_0x2c77('0x3'));var moment=require('moment');var BPromise=require(_0x2c77('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c77('0x5'));var rimraf=require(_0x2c77('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c77('0x7'));module['exports']=function(_0x487a48,_0x11ca0a){return _0x487a48['define']('UserChatQueue',attributes,{'tableName':_0x2c77('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d48=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x390b72,_0x2cef44){var _0x3574b9=function(_0xa11e0d){while(--_0xa11e0d){_0x390b72['push'](_0x390b72['shift']());}};_0x3574b9(++_0x2cef44);}(_0x2d48,0x199));var _0x82d4=function(_0x1c9a9a,_0x30a12f){_0x1c9a9a=_0x1c9a9a-0x0;var _0xca3172=_0x2d48[_0x1c9a9a];return _0xca3172;};'use strict';var _=require(_0x82d4('0x0'));var util=require(_0x82d4('0x1'));var logger=require(_0x82d4('0x2'))(_0x82d4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82d4('0x4'));var fs=require('fs');var path=require(_0x82d4('0x5'));var rimraf=require(_0x82d4('0x6'));var config=require(_0x82d4('0x7'));var attributes=require(_0x82d4('0x8'));module[_0x82d4('0x9')]=function(_0x1028a7,_0xde69f3){return _0x1028a7[_0x82d4('0xa')](_0x82d4('0xb'),attributes,{'tableName':_0x82d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index d459171..e4b7a80 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 _0x34e5=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x103));var _0x534e=function(_0x122a10,_0x506e55){_0x122a10=_0x122a10-0x0;var _0x5c37c0=_0x34e5[_0x122a10];return _0x5c37c0;};'use strict';var _=require(_0x534e('0x0'));var util=require(_0x534e('0x1'));var moment=require(_0x534e('0x2'));var BPromise=require(_0x534e('0x3'));var rs=require(_0x534e('0x4'));var fs=require('fs');var Redis=require(_0x534e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x534e('0x6'));var logger=require('../../config/logger')(_0x534e('0x7'));var config=require(_0x534e('0x8'));var jayson=require(_0x534e('0x9'));var client=jayson['client'][_0x534e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a05c,_0x228daa,_0x12f278){return new BPromise(function(_0x34e12f,_0x3bf195){return client[_0x534e('0xb')](_0x56a05c,_0x12f278)[_0x534e('0xc')](function(_0x2958d5){logger[_0x534e('0xd')](_0x534e('0xe'),_0x228daa,_0x534e('0xf'));logger[_0x534e('0x10')](_0x534e('0x11'),_0x228daa,_0x534e('0xf'),JSON[_0x534e('0x12')](_0x2958d5));if(_0x2958d5[_0x534e('0x13')]){if(_0x2958d5[_0x534e('0x13')][_0x534e('0x14')]===0x1f4){logger[_0x534e('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x228daa,_0x2958d5[_0x534e('0x13')][_0x534e('0x15')]);return _0x3bf195(_0x2958d5[_0x534e('0x13')][_0x534e('0x15')]);}logger[_0x534e('0x13')](_0x534e('0xe'),_0x228daa,_0x2958d5['error'][_0x534e('0x15')]);return _0x34e12f(_0x2958d5[_0x534e('0x13')][_0x534e('0x15')]);}else{logger[_0x534e('0xd')](_0x534e('0xe'),_0x228daa,_0x534e('0xf'));_0x34e12f(_0x2958d5[_0x534e('0x16')][_0x534e('0x15')]);}})['catch'](function(_0x31f845){logger['error'](_0x534e('0xe'),_0x228daa,_0x31f845);_0x3bf195(_0x31f845);});});} \ No newline at end of file +var _0x9b12=['UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x40fae4,_0x26c2e1){var _0x469c75=function(_0x5d2fbe){while(--_0x5d2fbe){_0x40fae4['push'](_0x40fae4['shift']());}};_0x469c75(++_0x26c2e1);}(_0x9b12,0xd0));var _0x29b1=function(_0x36de4c,_0x34eae5){_0x36de4c=_0x36de4c-0x0;var _0x10795a=_0x9b12[_0x36de4c];return _0x10795a;};'use strict';var _=require(_0x29b1('0x0'));var util=require(_0x29b1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29b1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x29b1('0x4'))(_0x29b1('0x5'));var config=require(_0x29b1('0x6'));var jayson=require(_0x29b1('0x7'));var client=jayson[_0x29b1('0x8')][_0x29b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544701,_0x1f3391,_0xa6d533){return new BPromise(function(_0x2dd456,_0x16787c){return client[_0x29b1('0xa')](_0x544701,_0xa6d533)['then'](function(_0x15e48f){logger[_0x29b1('0xb')](_0x29b1('0xc'),_0x1f3391,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1f3391,_0x29b1('0xd'),JSON[_0x29b1('0xe')](_0x15e48f));if(_0x15e48f['error']){if(_0x15e48f[_0x29b1('0xf')][_0x29b1('0x10')]===0x1f4){logger[_0x29b1('0xf')](_0x29b1('0xc'),_0x1f3391,_0x15e48f[_0x29b1('0xf')][_0x29b1('0x11')]);return _0x16787c(_0x15e48f[_0x29b1('0xf')][_0x29b1('0x11')]);}logger[_0x29b1('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1f3391,_0x15e48f[_0x29b1('0xf')][_0x29b1('0x11')]);return _0x2dd456(_0x15e48f[_0x29b1('0xf')]['message']);}else{logger[_0x29b1('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x1f3391,'request\x20sent');_0x2dd456(_0x15e48f[_0x29b1('0x12')]['message']);}})[_0x29b1('0x13')](function(_0x119e98){logger[_0x29b1('0xf')](_0x29b1('0xc'),_0x1f3391,_0x119e98);_0x16787c(_0x119e98);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index d1e583a..10d1833 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4aa4d4,_0xb5680b){var _0x2b3152=function(_0x3c5711){while(--_0x3c5711){_0x4aa4d4['push'](_0x4aa4d4['shift']());}};_0x2b3152(++_0xb5680b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0xcb91[_0x556634];return _0x4429fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3f1115,_0x19fe67){var _0x7b35a4=function(_0x2af63a){while(--_0x2af63a){_0x3f1115['push'](_0x3f1115['shift']());}};_0x7b35a4(++_0x19fe67);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 32617a8..a17bd14 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 _0xbdbc=['STRING','sequelize','exports','INTEGER'];(function(_0x37851e,_0x13765c){var _0x5af6be=function(_0x2777a2){while(--_0x2777a2){_0x37851e['push'](_0x37851e['shift']());}};_0x5af6be(++_0x13765c);}(_0xbdbc,0x91));var _0xcbdb=function(_0x161430,_0x1070e4){_0x161430=_0x161430-0x0;var _0x3dc170=_0xbdbc[_0x161430];return _0x3dc170;};'use strict';var Sequelize=require(_0xcbdb('0x0'));module[_0xcbdb('0x1')]={'penalty':{'type':Sequelize[_0xcbdb('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcbdb('0x3')]}}; \ No newline at end of file +var _0x68a9=['INTEGER','sequelize'];(function(_0x169a8a,_0x3526b1){var _0x2e8502=function(_0x4c37f3){while(--_0x4c37f3){_0x169a8a['push'](_0x169a8a['shift']());}};_0x2e8502(++_0x3526b1);}(_0x68a9,0x1e5));var _0x968a=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x68a9[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x968a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x968a('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x968a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f79c9d2..2641f34 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 _0xb305=['exports','define','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb305,0xa2));var _0x5b30=function(_0x109f51,_0x5c905a){_0x109f51=_0x109f51-0x0;var _0x4082e1=_0xb305[_0x109f51];return _0x4082e1;};'use strict';var _=require('lodash');var util=require(_0x5b30('0x0'));var logger=require('../../config/logger')(_0x5b30('0x1'));var moment=require(_0x5b30('0x2'));var BPromise=require(_0x5b30('0x3'));var rp=require(_0x5b30('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b30('0x5'));var config=require(_0x5b30('0x6'));var attributes=require(_0x5b30('0x7'));module[_0x5b30('0x8')]=function(_0x276248,_0x4fa69d){return _0x276248[_0x5b30('0x9')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53c0=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_fax_queues'];(function(_0x574cd3,_0x540488){var _0x11204d=function(_0x163bfd){while(--_0x163bfd){_0x574cd3['push'](_0x574cd3['shift']());}};_0x11204d(++_0x540488);}(_0x53c0,0x144));var _0x053c=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x53c0[_0x4e783c];return _0x2fbd6d;};'use strict';var _=require(_0x053c('0x0'));var util=require(_0x053c('0x1'));var logger=require(_0x053c('0x2'))(_0x053c('0x3'));var moment=require('moment');var BPromise=require(_0x053c('0x4'));var rp=require(_0x053c('0x5'));var fs=require('fs');var path=require(_0x053c('0x6'));var rimraf=require(_0x053c('0x7'));var config=require(_0x053c('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x053c('0x9')]=function(_0x228ade,_0x196f9a){return _0x228ade[_0x053c('0xa')]('UserFaxQueue',attributes,{'tableName':_0x053c('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 3eb7028..e40e137 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 _0xfdf8=['debug','UserFaxQueue,\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','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xfdf8,0x158));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8fdf('0x0'));var util=require(_0x8fdf('0x1'));var moment=require(_0x8fdf('0x2'));var BPromise=require(_0x8fdf('0x3'));var rs=require(_0x8fdf('0x4'));var fs=require('fs');var Redis=require(_0x8fdf('0x5'));var db=require(_0x8fdf('0x6'))['db'];var utils=require(_0x8fdf('0x7'));var logger=require(_0x8fdf('0x8'))(_0x8fdf('0x9'));var config=require(_0x8fdf('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8fdf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x547cbb,_0x26c992,_0x2a07cd){return new BPromise(function(_0x5ec2b7,_0x5a0c85){return client[_0x8fdf('0xc')](_0x547cbb,_0x2a07cd)['then'](function(_0x3ea629){logger[_0x8fdf('0xd')](_0x8fdf('0xe'),_0x26c992,_0x8fdf('0xf'));logger[_0x8fdf('0x10')](_0x8fdf('0x11'),_0x26c992,_0x8fdf('0xf'),JSON[_0x8fdf('0x12')](_0x3ea629));if(_0x3ea629[_0x8fdf('0x13')]){if(_0x3ea629[_0x8fdf('0x13')][_0x8fdf('0x14')]===0x1f4){logger[_0x8fdf('0x13')](_0x8fdf('0xe'),_0x26c992,_0x3ea629[_0x8fdf('0x13')]['message']);return _0x5a0c85(_0x3ea629[_0x8fdf('0x13')][_0x8fdf('0x15')]);}logger[_0x8fdf('0x13')](_0x8fdf('0xe'),_0x26c992,_0x3ea629[_0x8fdf('0x13')][_0x8fdf('0x15')]);return _0x5ec2b7(_0x3ea629[_0x8fdf('0x13')][_0x8fdf('0x15')]);}else{logger[_0x8fdf('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x26c992,_0x8fdf('0xf'));_0x5ec2b7(_0x3ea629[_0x8fdf('0x16')][_0x8fdf('0x15')]);}})[_0x8fdf('0x17')](function(_0x8fcfe4){logger['error'](_0x8fdf('0xe'),_0x26c992,_0x8fcfe4);_0x5a0c85(_0x8fcfe4);});});} \ No newline at end of file +var _0x70c4=['../../config/logger','rpc','../../config/environment','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x173228,_0x5c1419){var _0x27b686=function(_0x23e143){while(--_0x23e143){_0x173228['push'](_0x173228['shift']());}};_0x27b686(++_0x5c1419);}(_0x70c4,0x93));var _0x470c=function(_0x1808b2,_0x35f5a6){_0x1808b2=_0x1808b2-0x0;var _0x498147=_0x70c4[_0x1808b2];return _0x498147;};'use strict';var _=require(_0x470c('0x0'));var util=require(_0x470c('0x1'));var moment=require(_0x470c('0x2'));var BPromise=require(_0x470c('0x3'));var rs=require(_0x470c('0x4'));var fs=require('fs');var Redis=require(_0x470c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x470c('0x6'));var logger=require(_0x470c('0x7'))(_0x470c('0x8'));var config=require(_0x470c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x470c('0xa')][_0x470c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe6ea9b,_0x15797a,_0x216b7f){return new BPromise(function(_0x4337b8,_0x1d7244){return client['request'](_0xe6ea9b,_0x216b7f)['then'](function(_0x1cfd91){logger[_0x470c('0xc')](_0x470c('0xd'),_0x15797a,_0x470c('0xe'));logger[_0x470c('0xf')](_0x470c('0x10'),_0x15797a,_0x470c('0xe'),JSON[_0x470c('0x11')](_0x1cfd91));if(_0x1cfd91[_0x470c('0x12')]){if(_0x1cfd91[_0x470c('0x12')][_0x470c('0x13')]===0x1f4){logger[_0x470c('0x12')](_0x470c('0xd'),_0x15797a,_0x1cfd91[_0x470c('0x12')][_0x470c('0x14')]);return _0x1d7244(_0x1cfd91[_0x470c('0x12')][_0x470c('0x14')]);}logger['error'](_0x470c('0xd'),_0x15797a,_0x1cfd91[_0x470c('0x12')]['message']);return _0x4337b8(_0x1cfd91[_0x470c('0x12')][_0x470c('0x14')]);}else{logger['info'](_0x470c('0xd'),_0x15797a,_0x470c('0xe'));_0x4337b8(_0x1cfd91['result'][_0x470c('0x14')]);}})[_0x470c('0x15')](function(_0xf9cfa5){logger['error'](_0x470c('0xd'),_0x15797a,_0xf9cfa5);_0x1d7244(_0xf9cfa5);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 9732c26..4d7de12 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x205fda,_0x105664){var _0x22919a=function(_0x39f9c7){while(--_0x39f9c7){_0x205fda['push'](_0x205fda['shift']());}};_0x22919a(++_0x105664);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3de3f5,_0x150587){var _0x2d3478=function(_0x2cd601){while(--_0x2cd601){_0x3de3f5['push'](_0x3de3f5['shift']());}};_0x2d3478(++_0x150587);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 2cfc1b4..cb8b3ff 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 _0x5294=['sequelize','exports','INTEGER'];(function(_0x277607,_0x345a06){var _0x15fe23=function(_0x336de7){while(--_0x336de7){_0x277607['push'](_0x277607['shift']());}};_0x15fe23(++_0x345a06);}(_0x5294,0x111));var _0x4529=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x5294[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x4529('0x0'));module[_0x4529('0x1')]={'penalty':{'type':Sequelize[_0x4529('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x18a0=['INTEGER','sequelize','exports'];(function(_0x151762,_0x17691f){var _0x27f596=function(_0x4ca750){while(--_0x4ca750){_0x151762['push'](_0x151762['shift']());}};_0x27f596(++_0x17691f);}(_0x18a0,0xa6));var _0x018a=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x18a0[_0x40015a];return _0x42f8a4;};'use strict';var Sequelize=require(_0x018a('0x0'));module[_0x018a('0x1')]={'penalty':{'type':Sequelize[_0x018a('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 38925b4..2b27247 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 _0xf964=['bluebird','request-promise','rimraf','exports','define','UserMailQueue','util','api'];(function(_0x176ead,_0x16318c){var _0x411fd3=function(_0x51fd1d){while(--_0x51fd1d){_0x176ead['push'](_0x176ead['shift']());}};_0x411fd3(++_0x16318c);}(_0xf964,0x14e));var _0x4f96=function(_0xb30f6f,_0xad2386){_0xb30f6f=_0xb30f6f-0x0;var _0x5c48e0=_0xf964[_0xb30f6f];return _0x5c48e0;};'use strict';var _=require('lodash');var util=require(_0x4f96('0x0'));var logger=require('../../config/logger')(_0x4f96('0x1'));var moment=require('moment');var BPromise=require(_0x4f96('0x2'));var rp=require(_0x4f96('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f96('0x4'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x4f96('0x5')]=function(_0x55e8f6,_0x28eb51){return _0x55e8f6[_0x4f96('0x6')](_0x4f96('0x7'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x185c=['user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x29b2d0,_0x73bf4b){var _0x4af937=function(_0x1b19c9){while(--_0x1b19c9){_0x29b2d0['push'](_0x29b2d0['shift']());}};_0x4af937(++_0x73bf4b);}(_0x185c,0x145));var _0xc185=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x185c[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0xc185('0x0'));var util=require(_0xc185('0x1'));var logger=require('../../config/logger')(_0xc185('0x2'));var moment=require(_0xc185('0x3'));var BPromise=require(_0xc185('0x4'));var rp=require(_0xc185('0x5'));var fs=require('fs');var path=require(_0xc185('0x6'));var rimraf=require(_0xc185('0x7'));var config=require('../../config/environment');var attributes=require(_0xc185('0x8'));module[_0xc185('0x9')]=function(_0x569147,_0x1015e9){return _0x569147[_0xc185('0xa')]('UserMailQueue',attributes,{'tableName':_0xc185('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 874f88b..a9948ce 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b87de,_0x228d86){var _0x394575=function(_0x1a2027){while(--_0x1a2027){_0x4b87de['push'](_0x4b87de['shift']());}};_0x394575(++_0x228d86);}(_0x34e8,0x12c));var _0x834e=function(_0x2d0810,_0x4143f9){_0x2d0810=_0x2d0810-0x0;var _0x4eec54=_0x34e8[_0x2d0810];return _0x4eec54;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x548cdf,_0x413d8a){var _0x39000b=function(_0x3d67d0){while(--_0x3d67d0){_0x548cdf['push'](_0x548cdf['shift']());}};_0x39000b(++_0x413d8a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0xf3cd[_0x3f4dd9];return _0x31c54a;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 44ffc29..7fdbaf4 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce45=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express','Router'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xce45,0x73));var _0x5ce4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xce45[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0x5ce4('0x0'));var path=require(_0x5ce4('0x1'));var timeout=require(_0x5ce4('0x2'));var express=require(_0x5ce4('0x3'));var router=express[_0x5ce4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5ce4('0x5'));var config=require(_0x5ce4('0x6'));var controller=require(_0x5ce4('0x7'));router[_0x5ce4('0x8')]('/',auth[_0x5ce4('0x9')](),controller[_0x5ce4('0xa')]);module[_0x5ce4('0xb')]=router; \ No newline at end of file +var _0xc570=['post','isAuthenticated','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc570,0x13b));var _0x0c57=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xc570[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0c57('0x0'));var util=require(_0x0c57('0x1'));var path=require(_0x0c57('0x2'));var timeout=require(_0x0c57('0x3'));var express=require('express');var router=express[_0x0c57('0x4')]();var fs_extra=require(_0x0c57('0x5'));var auth=require(_0x0c57('0x6'));var interaction=require(_0x0c57('0x7'));var config=require(_0x0c57('0x8'));var controller=require(_0x0c57('0x9'));router[_0x0c57('0xa')]('/',auth[_0x0c57('0xb')](),controller['sendUserNotification']);module[_0x0c57('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4ba2f10..d54666d 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6dd=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x53f608,_0x256def){var _0x495b7d=function(_0x467eab){while(--_0x467eab){_0x53f608['push'](_0x53f608['shift']());}};_0x495b7d(++_0x256def);}(_0xe6dd,0x1cf));var _0xde6d=function(_0x1b2351,_0x5b7ba2){_0x1b2351=_0x1b2351-0x0;var _0x1a908e=_0xe6dd[_0x1b2351];return _0x1a908e;};'use strict';var Sequelize=require(_0xde6d('0x0'));module[_0xde6d('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xde6d('0x2')]},'recipientsId':{'type':Sequelize[_0xde6d('0x3')]},'recipientsDescription':{'type':Sequelize[_0xde6d('0x2')]},'beep':{'type':Sequelize[_0xde6d('0x4')]}}; \ No newline at end of file +var _0x9579=['STRING','TEXT','sequelize'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9579,0x1c7));var _0x9957=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x9579[_0x49e584];return _0x58b1be;};'use strict';var Sequelize=require(_0x9957('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x9957('0x1')]},'recipientsId':{'type':Sequelize[_0x9957('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 17e4eff..961f8b0 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f2a=['request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','catch','startCase','model','User','queue','replace','Queue','ids','push','all','flatten','rimraf','zip-dir','fast-json-patch'];(function(_0xa91c8b,_0x178735){var _0x16cace=function(_0x3b4edf){while(--_0x3b4edf){_0xa91c8b['push'](_0xa91c8b['shift']());}};_0x16cace(++_0x178735);}(_0x3f2a,0xc1));var _0xa3f2=function(_0x485ea7,_0x2d3932){_0x485ea7=_0x485ea7-0x0;var _0x3d5b7a=_0x3f2a[_0x485ea7];return _0x3d5b7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3f2('0x0'));var zipdir=require(_0xa3f2('0x1'));var jsonpatch=require(_0xa3f2('0x2'));var rp=require(_0xa3f2('0x3'));var moment=require(_0xa3f2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa3f2('0x5'));var path=require(_0xa3f2('0x6'));var sox=require(_0xa3f2('0x7'));var csv=require('to-csv');var ejs=require(_0xa3f2('0x8'));var fs=require('fs');var fs_extra=require(_0xa3f2('0x9'));var _=require('lodash');var squel=require(_0xa3f2('0xa'));var crypto=require(_0xa3f2('0xb'));var jsforce=require(_0xa3f2('0xc'));var deskjs=require(_0xa3f2('0xd'));var toCsv=require(_0xa3f2('0xe'));var querystring=require(_0xa3f2('0xf'));var Papa=require(_0xa3f2('0x10'));var Redis=require(_0xa3f2('0x11'));var authService=require(_0xa3f2('0x12'));var qs=require(_0xa3f2('0x13'));var as=require(_0xa3f2('0x14'));var hardwareService=require(_0xa3f2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa3f2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa3f2('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa3f2('0x18'),'port':0x18eb});var socket=require(_0xa3f2('0x19'))(new Redis(config['redis']));require('./userNotification.socket')[_0xa3f2('0x1a')](socket);function respondWithStatusCode(_0x546ded,_0x298ddd){_0x298ddd=_0x298ddd||0xcc;return function(_0x1d21f9){if(_0x1d21f9){return _0x546ded[_0xa3f2('0x1b')](_0x298ddd);}return _0x546ded[_0xa3f2('0x1c')](_0x298ddd)[_0xa3f2('0x1d')]();};}function respondWithResult(_0x2762cd,_0x33a4dc){_0x33a4dc=_0x33a4dc||0xc8;return function(_0x4d50f2){if(_0x4d50f2){return _0x2762cd[_0xa3f2('0x1c')](_0x33a4dc)[_0xa3f2('0x1e')](_0x4d50f2);}};}function respondWithFilteredResult(_0x2a87ba,_0x3ddfc1){return function(_0x5666e5){if(_0x5666e5){var _0x9bc626=typeof _0x3ddfc1[_0xa3f2('0x1f')]===_0xa3f2('0x20')&&typeof _0x3ddfc1[_0xa3f2('0x21')]===_0xa3f2('0x20');var _0x1f1c4c=_0x5666e5[_0xa3f2('0x22')];var _0x29ed59=_0x9bc626?0x0:_0x3ddfc1[_0xa3f2('0x1f')];var _0x4a9779=_0x9bc626?_0x5666e5[_0xa3f2('0x22')]:_0x3ddfc1[_0xa3f2('0x1f')]+_0x3ddfc1[_0xa3f2('0x21')];var _0x2ca84b;if(_0x4a9779>=_0x1f1c4c){_0x4a9779=_0x1f1c4c;_0x2ca84b=0xc8;}else{_0x2ca84b=0xce;}_0x2a87ba[_0xa3f2('0x1c')](_0x2ca84b);return _0x2a87ba[_0xa3f2('0x23')](_0xa3f2('0x24'),_0x29ed59+'-'+_0x4a9779+'/'+_0x1f1c4c)[_0xa3f2('0x1e')](_0x5666e5);}return null;};}function patchUpdates(_0xd7d797){return function(_0x421e5b){try{jsonpatch[_0xa3f2('0x25')](_0x421e5b,_0xd7d797,!![]);}catch(_0x54e789){return BPromise[_0xa3f2('0x26')](_0x54e789);}return _0x421e5b[_0xa3f2('0x27')]();};}function saveUpdates(_0x656057,_0x1bd1cb){return function(_0x3353e9){if(_0x3353e9){return _0x3353e9[_0xa3f2('0x28')](_0x656057)['then'](function(_0x277de1){return _0x277de1;});}return null;};}function removeEntity(_0x35bc80,_0xcc1f95){return function(_0x396cb){if(_0x396cb){return _0x396cb['destroy']()[_0xa3f2('0x29')](function(){_0x35bc80[_0xa3f2('0x1c')](0xcc)[_0xa3f2('0x1d')]();});}};}function handleEntityNotFound(_0x40bcae,_0x59722a){return function(_0x49d9a4){if(!_0x49d9a4){_0x40bcae[_0xa3f2('0x1b')](0x194);}return _0x49d9a4;};}function handleError(_0x26b6cd,_0xb485d1){_0xb485d1=_0xb485d1||0x1f4;return function(_0x29753f){logger['error'](_0x29753f[_0xa3f2('0x2a')]);if(_0x29753f['name']){delete _0x29753f['name'];}_0x26b6cd[_0xa3f2('0x1c')](_0xb485d1)[_0xa3f2('0x2b')](_0x29753f);};}exports[_0xa3f2('0x2c')]=function(_0x64781d,_0x5d5032,_0x526c2d){if(!_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x2e')](_0xa3f2('0x2f'))&&!_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x2e')](_0xa3f2('0x30'))){throw new db[(_0xa3f2('0x31'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x2e')](_0xa3f2('0x30'))&&!_0x64781d['body'][_0xa3f2('0x2e')](_0xa3f2('0x32'))){throw new db[(_0xa3f2('0x31'))][(_0xa3f2('0x33'))](_0xa3f2('0x34'));}if(!_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x2e')](_0xa3f2('0x35'))){throw new db[(_0xa3f2('0x31'))]['ValidationError'](_0xa3f2('0x36'));}else{try{var _0x2ac853=JSON[_0xa3f2('0x37')](_0x64781d[_0xa3f2('0x2d')]['recipients']);}catch(_0x64e5c4){logger[_0xa3f2('0x38')](_0x64e5c4);throw new db[(_0xa3f2('0x31'))][(_0xa3f2('0x33'))](_0xa3f2('0x39'));}var _0x302cc2=[_0xa3f2('0x3a'),_0xa3f2('0x3b'),_0xa3f2('0x3c'),_0xa3f2('0x3d'),_0xa3f2('0x3e'),_0xa3f2('0x3f'),'whatsappqueue','team',_0xa3f2('0x40')];if(_['some'](_0x2ac853,function(_0x23f14a){return!_[_0xa3f2('0x41')](_0x302cc2,_0x23f14a['model'][_0xa3f2('0x42')]());})){throw new db[(_0xa3f2('0x31'))][(_0xa3f2('0x33'))](_0xa3f2('0x43'));}}}var _0x4e9c89={};_0x4e9c89[_0xa3f2('0x44')]=_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x2e')](_0xa3f2('0x44'))?_0x64781d['body'][_0xa3f2('0x44')]:_0x64781d[_0xa3f2('0x40')][_0xa3f2('0x45')];_0x4e9c89[_0xa3f2('0x46')]=_[_0xa3f2('0x47')](_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x46')])?null:_0x64781d['body']['recipientsDescription'];_0x4e9c89[_0xa3f2('0x48')]=_0x64781d[_0xa3f2('0x2d')][_0xa3f2('0x48')]||![];_0x4e9c89[_0xa3f2('0x49')]=_0x64781d['user']['id'];return getContent(_0x64781d[_0xa3f2('0x2d')])[_0xa3f2('0x29')](function(_0x4b656b){_0x4e9c89[_0xa3f2('0x2d')]=_0x4b656b;return getRecipients(_0x2ac853);})[_0xa3f2('0x29')](function(_0x34d67f){_0x4e9c89[_0xa3f2('0x4a')]=_['sortBy'](_0x34d67f)[_0xa3f2('0x4b')](',');return db[_0xa3f2('0x4c')]['transaction'](function(_0x5f0fdd){return db[_0xa3f2('0x4d')][_0xa3f2('0x4e')](_0x4e9c89,{'raw':!![],'transaction':_0x5f0fdd})[_0xa3f2('0x29')](function(_0xa41e0c){var _0x2b2e34={'sender':_0x4e9c89['senderName'],'description':_0x4e9c89[_0xa3f2('0x46')],'content':_0x4e9c89[_0xa3f2('0x2d')],'beep':_0x4e9c89[_0xa3f2('0x48')]};_0x34d67f[_0xa3f2('0x4f')](function(_0x498c43){_0x2b2e34[_0xa3f2('0x50')]=_0x498c43;socket[_0xa3f2('0x51')](_0xa3f2('0x52'),_0x2b2e34);});return _0xa41e0c;});});})[_0xa3f2('0x29')](respondWithResult(_0x5d5032,0xc9))['catch'](handleError(_0x5d5032,null));};function getContent(_0x53f464){return new BPromise(function(_0x34222c,_0x488f43){if(_0x53f464['text']){_0x34222c(_0x53f464[_0xa3f2('0x2f')]);return;}return db[_0xa3f2('0x53')][_0xa3f2('0x54')]({'attributes':[_0xa3f2('0x55')],'where':{'id':_0x53f464[_0xa3f2('0x30')]},'raw':!![]})['then'](function(_0x125d14){if(!_0x125d14)throw new db[(_0xa3f2('0x31'))][(_0xa3f2('0x33'))](_0xa3f2('0x56'));var _0x5904b7=Mustache['render'](_0x125d14[_0xa3f2('0x55')],_0x53f464[_0xa3f2('0x32')]);_0x34222c(_0x5904b7);})[_0xa3f2('0x57')](function(_0x43dfc7){_0x488f43(_0x43dfc7);});});}function getRecipients(_0x3040d1){return new BPromise(function(_0x52626a,_0x4425ca){var _0x395723=[];var _0x5ced17=[];_0x3040d1['forEach'](function(_0x74fcc7){var _0x5e2489=_[_0xa3f2('0x58')](_0x74fcc7[_0xa3f2('0x59')]['toLowerCase']());if(_0x5e2489===_0xa3f2('0x5a')){_0x395723=_['union'](_0x395723,_0x74fcc7['ids']);}else{if(_[_0xa3f2('0x41')](_0x5e2489,_0xa3f2('0x5b')))_0x5e2489=_0x5e2489[_0xa3f2('0x5c')](_0xa3f2('0x5b'),_0xa3f2('0x5d'));_0x74fcc7[_0xa3f2('0x5e')][_0xa3f2('0x4f')](function(_0x1bcc6f){_0x5ced17[_0xa3f2('0x5f')](getAgents(_0x5e2489,_0x1bcc6f));});}});return BPromise[_0xa3f2('0x60')](_0x5ced17)[_0xa3f2('0x29')](function(_0x46786e){_0x395723=_['union'](_0x395723,_[_0xa3f2('0x61')](_0x46786e));_0x52626a(_0x395723);})['catch'](function(_0x24284d){_0x4425ca(_0x24284d);});});}function getAgents(_0x45aad1,_0x5107b2){return new BPromise(function(_0x425bb5,_0x11951f){return db[_0x45aad1][_0xa3f2('0x54')]({'where':{'id':_0x5107b2}})[_0xa3f2('0x29')](function(_0x47a30e){return _0x47a30e['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x1e9b94){var _0xa63cc3=_['map'](_0x1e9b94,'id');_0x425bb5(_0xa63cc3);});})[_0xa3f2('0x57')](function(_0x220e58){_0x11951f(_0x220e58);});});} \ No newline at end of file +var _0x481c=['user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','toLowerCase','User','union','replace','queue','ids','push','all','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','mailqueue','voicequeue','whatsappqueue','team','some','includes','model','senderName'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0x481c,0x147));var _0xc481=function(_0x14f419,_0xfc11fb){_0x14f419=_0x14f419-0x0;var _0x1fd9b8=_0x481c[_0x14f419];return _0x1fd9b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc481('0x0'));var zipdir=require(_0xc481('0x1'));var jsonpatch=require(_0xc481('0x2'));var rp=require(_0xc481('0x3'));var moment=require('moment');var BPromise=require(_0xc481('0x4'));var Mustache=require(_0xc481('0x5'));var util=require(_0xc481('0x6'));var path=require(_0xc481('0x7'));var sox=require(_0xc481('0x8'));var csv=require('to-csv');var ejs=require(_0xc481('0x9'));var fs=require('fs');var fs_extra=require(_0xc481('0xa'));var _=require('lodash');var squel=require(_0xc481('0xb'));var crypto=require(_0xc481('0xc'));var jsforce=require(_0xc481('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc481('0xe'));var querystring=require('querystring');var Papa=require(_0xc481('0xf'));var Redis=require(_0xc481('0x10'));var authService=require(_0xc481('0x11'));var qs=require(_0xc481('0x12'));var as=require(_0xc481('0x13'));var hardwareService=require(_0xc481('0x14'));var logger=require('../../config/logger')(_0xc481('0x15'));var utils=require(_0xc481('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc481('0x17'));var db=require(_0xc481('0x18'))['db'];config[_0xc481('0x19')]=_[_0xc481('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc481('0x1b'))(new Redis(config['redis']));require(_0xc481('0x1c'))['register'](socket);function respondWithStatusCode(_0x312465,_0x541da1){_0x541da1=_0x541da1||0xcc;return function(_0x4cc2af){if(_0x4cc2af){return _0x312465[_0xc481('0x1d')](_0x541da1);}return _0x312465['status'](_0x541da1)[_0xc481('0x1e')]();};}function respondWithResult(_0x24c83d,_0x11b2a3){_0x11b2a3=_0x11b2a3||0xc8;return function(_0x44ddf0){if(_0x44ddf0){return _0x24c83d['status'](_0x11b2a3)[_0xc481('0x1f')](_0x44ddf0);}};}function respondWithFilteredResult(_0x56a5a1,_0x324879){return function(_0x5da9a8){if(_0x5da9a8){var _0x1e52f1=typeof _0x324879[_0xc481('0x20')]==='undefined'&&typeof _0x324879[_0xc481('0x21')]===_0xc481('0x22');var _0x54cef9=_0x5da9a8[_0xc481('0x23')];var _0x3a4d74=_0x1e52f1?0x0:_0x324879[_0xc481('0x20')];var _0x4e37f1=_0x1e52f1?_0x5da9a8[_0xc481('0x23')]:_0x324879[_0xc481('0x20')]+_0x324879[_0xc481('0x21')];var _0xf9613;if(_0x4e37f1>=_0x54cef9){_0x4e37f1=_0x54cef9;_0xf9613=0xc8;}else{_0xf9613=0xce;}_0x56a5a1[_0xc481('0x24')](_0xf9613);return _0x56a5a1[_0xc481('0x25')](_0xc481('0x26'),_0x3a4d74+'-'+_0x4e37f1+'/'+_0x54cef9)['json'](_0x5da9a8);}return null;};}function patchUpdates(_0x5e3590){return function(_0x1f6efd){try{jsonpatch['apply'](_0x1f6efd,_0x5e3590,!![]);}catch(_0x1306eb){return BPromise[_0xc481('0x27')](_0x1306eb);}return _0x1f6efd[_0xc481('0x28')]();};}function saveUpdates(_0x5a27ab,_0x28e184){return function(_0x4962d7){if(_0x4962d7){return _0x4962d7[_0xc481('0x29')](_0x5a27ab)[_0xc481('0x2a')](function(_0x151091){return _0x151091;});}return null;};}function removeEntity(_0x1162bf,_0x4d1344){return function(_0x1de4d2){if(_0x1de4d2){return _0x1de4d2[_0xc481('0x2b')]()[_0xc481('0x2a')](function(){_0x1162bf[_0xc481('0x24')](0xcc)[_0xc481('0x1e')]();});}};}function handleEntityNotFound(_0x42ac3c,_0x4a967f){return function(_0x20faae){if(!_0x20faae){_0x42ac3c[_0xc481('0x1d')](0x194);}return _0x20faae;};}function handleError(_0x12ac24,_0x144f93){_0x144f93=_0x144f93||0x1f4;return function(_0x76fae5){logger[_0xc481('0x2c')](_0x76fae5[_0xc481('0x2d')]);if(_0x76fae5[_0xc481('0x2e')]){delete _0x76fae5[_0xc481('0x2e')];}_0x12ac24['status'](_0x144f93)[_0xc481('0x2f')](_0x76fae5);};}exports[_0xc481('0x30')]=function(_0x1a0784,_0x258f71,_0x5afa31){if(!_0x1a0784[_0xc481('0x31')][_0xc481('0x32')](_0xc481('0x33'))&&!_0x1a0784['body'][_0xc481('0x32')](_0xc481('0x34'))){throw new db[(_0xc481('0x35'))]['ValidationError'](_0xc481('0x36'));}else{if(_0x1a0784['body'][_0xc481('0x32')](_0xc481('0x34'))&&!_0x1a0784['body']['hasOwnProperty'](_0xc481('0x37'))){throw new db['Sequelize']['ValidationError'](_0xc481('0x38'));}if(!_0x1a0784[_0xc481('0x31')][_0xc481('0x32')]('recipients')){throw new db[(_0xc481('0x35'))][(_0xc481('0x39'))](_0xc481('0x3a'));}else{try{var _0x42dbe9=JSON[_0xc481('0x3b')](_0x1a0784[_0xc481('0x31')][_0xc481('0x3c')]);}catch(_0x5bf7c3){logger[_0xc481('0x2c')](_0x5bf7c3);throw new db[(_0xc481('0x35'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x4fc59f=['chatqueue','faxqueue',_0xc481('0x3d'),'openchannelqueue','smsqueue',_0xc481('0x3e'),_0xc481('0x3f'),_0xc481('0x40'),'user'];if(_[_0xc481('0x41')](_0x42dbe9,function(_0x51b40e){return!_[_0xc481('0x42')](_0x4fc59f,_0x51b40e[_0xc481('0x43')]['toLowerCase']());})){throw new db[(_0xc481('0x35'))][(_0xc481('0x39'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x5a1d36={};_0x5a1d36[_0xc481('0x44')]=_0x1a0784[_0xc481('0x31')][_0xc481('0x32')](_0xc481('0x44'))?_0x1a0784['body'][_0xc481('0x44')]:_0x1a0784[_0xc481('0x45')][_0xc481('0x46')];_0x5a1d36[_0xc481('0x47')]=_[_0xc481('0x48')](_0x1a0784['body'][_0xc481('0x47')])?null:_0x1a0784[_0xc481('0x31')][_0xc481('0x47')];_0x5a1d36[_0xc481('0x49')]=_0x1a0784['body'][_0xc481('0x49')]||![];_0x5a1d36[_0xc481('0x4a')]=_0x1a0784[_0xc481('0x45')]['id'];return getContent(_0x1a0784['body'])[_0xc481('0x2a')](function(_0xa9197f){_0x5a1d36[_0xc481('0x31')]=_0xa9197f;return getRecipients(_0x42dbe9);})[_0xc481('0x2a')](function(_0xe1c9bd){_0x5a1d36[_0xc481('0x4b')]=_[_0xc481('0x4c')](_0xe1c9bd)[_0xc481('0x4d')](',');return db[_0xc481('0x4e')][_0xc481('0x4f')](function(_0x165f78){return db[_0xc481('0x50')][_0xc481('0x51')](_0x5a1d36,{'raw':!![],'transaction':_0x165f78})[_0xc481('0x2a')](function(_0x76e030){var _0x296fc5={'sender':_0x5a1d36[_0xc481('0x44')],'description':_0x5a1d36[_0xc481('0x47')],'content':_0x5a1d36[_0xc481('0x31')],'beep':_0x5a1d36[_0xc481('0x49')]};_0xe1c9bd[_0xc481('0x52')](function(_0x1570d9){_0x296fc5['recipient']=_0x1570d9;socket[_0xc481('0x53')](_0xc481('0x54'),_0x296fc5);});return _0x76e030;});});})[_0xc481('0x2a')](respondWithResult(_0x258f71,0xc9))[_0xc481('0x55')](handleError(_0x258f71,null));};function getContent(_0x1e6dce){return new BPromise(function(_0x198af8,_0x6178b4){if(_0x1e6dce[_0xc481('0x33')]){_0x198af8(_0x1e6dce[_0xc481('0x33')]);return;}return db[_0xc481('0x56')][_0xc481('0x57')]({'attributes':[_0xc481('0x58')],'where':{'id':_0x1e6dce[_0xc481('0x34')]},'raw':!![]})[_0xc481('0x2a')](function(_0x18f0da){if(!_0x18f0da)throw new db[(_0xc481('0x35'))]['ValidationError'](_0xc481('0x59'));var _0x8f06b1=Mustache['render'](_0x18f0da[_0xc481('0x58')],_0x1e6dce['view']);_0x198af8(_0x8f06b1);})[_0xc481('0x55')](function(_0x2cfd6c){_0x6178b4(_0x2cfd6c);});});}function getRecipients(_0x3a6354){return new BPromise(function(_0x5b6813,_0x46cbef){var _0x438ea3=[];var _0x5ccffb=[];_0x3a6354['forEach'](function(_0x5850dd){var _0xe2e155=_['startCase'](_0x5850dd[_0xc481('0x43')][_0xc481('0x5a')]());if(_0xe2e155===_0xc481('0x5b')){_0x438ea3=_[_0xc481('0x5c')](_0x438ea3,_0x5850dd['ids']);}else{if(_[_0xc481('0x42')](_0xe2e155,'queue'))_0xe2e155=_0xe2e155[_0xc481('0x5d')](_0xc481('0x5e'),'Queue');_0x5850dd[_0xc481('0x5f')][_0xc481('0x52')](function(_0x2221d6){_0x5ccffb[_0xc481('0x60')](getAgents(_0xe2e155,_0x2221d6));});}});return BPromise[_0xc481('0x61')](_0x5ccffb)['then'](function(_0xd474f6){_0x438ea3=_[_0xc481('0x5c')](_0x438ea3,_['flatten'](_0xd474f6));_0x5b6813(_0x438ea3);})[_0xc481('0x55')](function(_0x537577){_0x46cbef(_0x537577);});});}function getAgents(_0x4a04ec,_0x29a2fe){return new BPromise(function(_0x11d155,_0x37a58b){return db[_0x4a04ec][_0xc481('0x57')]({'where':{'id':_0x29a2fe}})[_0xc481('0x2a')](function(_0x17379c){return _0x17379c[_0xc481('0x62')]({'attributes':['id'],'raw':!![]})[_0xc481('0x2a')](function(_0x2761c2){var _0x471bb4=_['map'](_0x2761c2,'id');_0x11d155(_0x471bb4);});})['catch'](function(_0x1f5b76){_0x37a58b(_0x1f5b76);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 03f78b6..9d5d5e5 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fd4=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8fd4,0x1e3));var _0x48fd=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8fd4[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x48fd('0x0'))['db'][_0x48fd('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x48fd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x48fd('0x3'),'afterDestroy':_0x48fd('0x4')};function emitEvent(_0x5801aa){return function(_0x2836af,_0x222abd,_0x1ca71d){UserNotificationEvents[_0x48fd('0x5')](_0x5801aa+':'+_0x2836af['id'],_0x2836af);UserNotificationEvents['emit'](_0x5801aa,_0x2836af);_0x1ca71d(null);};}for(var e in events){if(events[_0x48fd('0x6')](e)){var event=events[e];UserNotification[_0x48fd('0x7')](e,emitEvent(event));}}module[_0x48fd('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x8ca4=['save','remove','emit','hook','exports','events','UserNotification'];(function(_0x35c382,_0x4b80cc){var _0x3dcf61=function(_0x429825){while(--_0x429825){_0x35c382['push'](_0x35c382['shift']());}};_0x3dcf61(++_0x4b80cc);}(_0x8ca4,0x19b));var _0x48ca=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0x8ca4[_0x503564];return _0x4be9fd;};'use strict';var EventEmitter=require(_0x48ca('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x48ca('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x48ca('0x2'),'afterUpdate':'update','afterDestroy':_0x48ca('0x3')};function emitEvent(_0x27c6d6){return function(_0x4dfafa,_0x445a0c,_0x2d04c1){UserNotificationEvents[_0x48ca('0x4')](_0x27c6d6+':'+_0x4dfafa['id'],_0x4dfafa);UserNotificationEvents[_0x48ca('0x4')](_0x27c6d6,_0x4dfafa);_0x2d04c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x48ca('0x5')](e,emitEvent(event));}}module[_0x48ca('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index fbdaeee..285c847 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad6a=['moment','bluebird','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x29379a,_0x16b64f){var _0x125b52=function(_0xea6150){while(--_0xea6150){_0x29379a['push'](_0x29379a['shift']());}};_0x125b52(++_0x16b64f);}(_0xad6a,0x131));var _0xaad6=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xad6a[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xaad6('0x0'));var util=require(_0xaad6('0x1'));var logger=require(_0xaad6('0x2'))('api');var moment=require(_0xaad6('0x3'));var BPromise=require(_0xaad6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaad6('0x5'));var rimraf=require(_0xaad6('0x6'));var config=require(_0xaad6('0x7'));var attributes=require('./userNotification.attributes');module[_0xaad6('0x8')]=function(_0x4f09a1,_0x59d7da){return _0x4f09a1[_0xaad6('0x9')](_0xaad6('0xa'),attributes,{'tableName':_0xaad6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaad6('0xc'),'collate':_0xaad6('0xd')});}; \ No newline at end of file +var _0x3fdc=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment','define','UserNotification','userNotifications','utf8mb4'];(function(_0x2abd9c,_0x4e3faa){var _0x2595db=function(_0x425b46){while(--_0x425b46){_0x2abd9c['push'](_0x2abd9c['shift']());}};_0x2595db(++_0x4e3faa);}(_0x3fdc,0xb5));var _0xc3fd=function(_0x4e30d2,_0x1bfc0f){_0x4e30d2=_0x4e30d2-0x0;var _0x336e48=_0x3fdc[_0x4e30d2];return _0x336e48;};'use strict';var _=require('lodash');var util=require(_0xc3fd('0x0'));var logger=require(_0xc3fd('0x1'))(_0xc3fd('0x2'));var moment=require(_0xc3fd('0x3'));var BPromise=require(_0xc3fd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3fd('0x5'));var rimraf=require('rimraf');var config=require(_0xc3fd('0x6'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x41986d,_0x2c66c9){return _0x41986d[_0xc3fd('0x7')](_0xc3fd('0x8'),attributes,{'tableName':_0xc3fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc3fd('0xa'),'collate':_0xc3fd('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index c48bc57..01bbec5 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa261=['then','info','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./userNotification.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa261,0x1e7));var _0x1a26=function(_0x3c4ef8,_0x499436){_0x3c4ef8=_0x3c4ef8-0x0;var _0x531874=_0xa261[_0x3c4ef8];return _0x531874;};'use strict';var _=require(_0x1a26('0x0'));var util=require('util');var moment=require(_0x1a26('0x1'));var BPromise=require(_0x1a26('0x2'));var rs=require(_0x1a26('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a26('0x4'))['db'];var utils=require(_0x1a26('0x5'));var logger=require(_0x1a26('0x6'))(_0x1a26('0x7'));var config=require(_0x1a26('0x8'));var jayson=require(_0x1a26('0x9'));var client=jayson['client'][_0x1a26('0xa')]({'port':0x232a});config[_0x1a26('0xb')]=_[_0x1a26('0xc')](config['redis'],{'host':_0x1a26('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a26('0xe'))[_0x1a26('0xf')](socket);function respondWithRpcPromise(_0x53fca5,_0x6cb77a,_0xfafa70){return new BPromise(function(_0x2cc9d5,_0x13eb83){return client[_0x1a26('0x10')](_0x53fca5,_0xfafa70)[_0x1a26('0x11')](function(_0x3cc699){logger[_0x1a26('0x12')]('UserNotification,\x20%s,\x20%s',_0x6cb77a,_0x1a26('0x13'));logger[_0x1a26('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x6cb77a,_0x1a26('0x13'),JSON[_0x1a26('0x15')](_0x3cc699));if(_0x3cc699[_0x1a26('0x16')]){if(_0x3cc699[_0x1a26('0x16')][_0x1a26('0x17')]===0x1f4){logger['error'](_0x1a26('0x18'),_0x6cb77a,_0x3cc699['error'][_0x1a26('0x19')]);return _0x13eb83(_0x3cc699[_0x1a26('0x16')]['message']);}logger['error'](_0x1a26('0x18'),_0x6cb77a,_0x3cc699[_0x1a26('0x16')]['message']);return _0x2cc9d5(_0x3cc699[_0x1a26('0x16')][_0x1a26('0x19')]);}else{logger[_0x1a26('0x12')]('UserNotification,\x20%s,\x20%s',_0x6cb77a,_0x1a26('0x13'));_0x2cc9d5(_0x3cc699[_0x1a26('0x1a')][_0x1a26('0x19')]);}})[_0x1a26('0x1b')](function(_0x52477d){logger[_0x1a26('0x16')]('UserNotification,\x20%s,\x20%s',_0x6cb77a,_0x52477d);_0x13eb83(_0x52477d);});});} \ No newline at end of file +var _0x14df=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14df,0x16a));var _0xf14d=function(_0x2f3782,_0x150f14){_0x2f3782=_0x2f3782-0x0;var _0x40a8c4=_0x14df[_0x2f3782];return _0x40a8c4;};'use strict';var _=require(_0xf14d('0x0'));var util=require(_0xf14d('0x1'));var moment=require(_0xf14d('0x2'));var BPromise=require(_0xf14d('0x3'));var rs=require(_0xf14d('0x4'));var fs=require('fs');var Redis=require(_0xf14d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf14d('0x6'))(_0xf14d('0x7'));var config=require(_0xf14d('0x8'));var jayson=require(_0xf14d('0x9'));var client=jayson[_0xf14d('0xa')][_0xf14d('0xb')]({'port':0x232a});config[_0xf14d('0xc')]=_[_0xf14d('0xd')](config[_0xf14d('0xc')],{'host':_0xf14d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf14d('0xc')]));require('./userNotification.socket')[_0xf14d('0xf')](socket);function respondWithRpcPromise(_0x5c3755,_0x40a1bb,_0x31b1a2){return new BPromise(function(_0x57727c,_0x624ad9){return client[_0xf14d('0x10')](_0x5c3755,_0x31b1a2)[_0xf14d('0x11')](function(_0x2cbc5a){logger['info'](_0xf14d('0x12'),_0x40a1bb,_0xf14d('0x13'));logger[_0xf14d('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x40a1bb,_0xf14d('0x13'),JSON[_0xf14d('0x15')](_0x2cbc5a));if(_0x2cbc5a[_0xf14d('0x16')]){if(_0x2cbc5a[_0xf14d('0x16')][_0xf14d('0x17')]===0x1f4){logger['error'](_0xf14d('0x12'),_0x40a1bb,_0x2cbc5a['error'][_0xf14d('0x18')]);return _0x624ad9(_0x2cbc5a[_0xf14d('0x16')][_0xf14d('0x18')]);}logger[_0xf14d('0x16')](_0xf14d('0x12'),_0x40a1bb,_0x2cbc5a[_0xf14d('0x16')]['message']);return _0x57727c(_0x2cbc5a['error'][_0xf14d('0x18')]);}else{logger[_0xf14d('0x19')](_0xf14d('0x12'),_0x40a1bb,_0xf14d('0x13'));_0x57727c(_0x2cbc5a[_0xf14d('0x1a')][_0xf14d('0x18')]);}})[_0xf14d('0x1b')](function(_0x347ae7){logger[_0xf14d('0x16')](_0xf14d('0x12'),_0x40a1bb,_0x347ae7);_0x624ad9(_0x347ae7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index cc186d4..e93f6e3 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc7ec=['update','emit','removeListener','length','userNotification:','./userNotification.events','save'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xc7ec,0x132));var _0xcc7e=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0xc7ec[_0x4d3924];return _0x844555;};'use strict';var UserNotificationEvents=require(_0xcc7e('0x0'));var events=[_0xcc7e('0x1'),'remove',_0xcc7e('0x2')];function createListener(_0x109441,_0x649373){return function(_0x1d47d9){_0x649373[_0xcc7e('0x3')](_0x109441,_0x1d47d9);};}function removeListener(_0x4e45d6,_0x4b067a){return function(){UserNotificationEvents[_0xcc7e('0x4')](_0x4e45d6,_0x4b067a);};}exports['register']=function(_0x3a67b3){for(var _0x4d2fc5=0x0,_0x5f1c63=events[_0xcc7e('0x5')];_0x4d2fc5<_0x5f1c63;_0x4d2fc5++){var _0xf1f27f=events[_0x4d2fc5];var _0x5f210b=createListener(_0xcc7e('0x6')+_0xf1f27f,_0x3a67b3);UserNotificationEvents['on'](_0xf1f27f,_0x5f210b);}}; \ No newline at end of file +var _0x7f83=['register','length','userNotification:','./userNotification.events','save','remove','emit','removeListener'];(function(_0x58a9da,_0x4e42ab){var _0x4225c8=function(_0x3914ff){while(--_0x3914ff){_0x58a9da['push'](_0x58a9da['shift']());}};_0x4225c8(++_0x4e42ab);}(_0x7f83,0xd3));var _0x37f8=function(_0x3151a1,_0x29998a){_0x3151a1=_0x3151a1-0x0;var _0xeb3650=_0x7f83[_0x3151a1];return _0xeb3650;};'use strict';var UserNotificationEvents=require(_0x37f8('0x0'));var events=[_0x37f8('0x1'),_0x37f8('0x2'),'update'];function createListener(_0x597e4c,_0xab435a){return function(_0x4b7094){_0xab435a[_0x37f8('0x3')](_0x597e4c,_0x4b7094);};}function removeListener(_0x11f28f,_0x4217db){return function(){UserNotificationEvents[_0x37f8('0x4')](_0x11f28f,_0x4217db);};}exports[_0x37f8('0x5')]=function(_0x52fc9d){for(var _0x41385e=0x0,_0x40c102=events[_0x37f8('0x6')];_0x41385e<_0x40c102;_0x41385e++){var _0x1a1cc3=events[_0x41385e];var _0x4b5be4=createListener(_0x37f8('0x7')+_0x1a1cc3,_0x52fc9d);UserNotificationEvents['on'](_0x1a1cc3,_0x4b5be4);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 6e37d57..fe18911 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3788af,_0x55a2ba){var _0x4228a1=function(_0x33bb49){while(--_0x33bb49){_0x3788af['push'](_0x3788af['shift']());}};_0x4228a1(++_0x55a2ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x47f7eb,_0xe899ac){var _0xfd8758=function(_0x3d7fa9){while(--_0x3d7fa9){_0x47f7eb['push'](_0x47f7eb['shift']());}};_0xfd8758(++_0xe899ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xcb91[_0x1f7413];return _0x2d2775;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index fcf2d4c..9f72c15 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 _0x5d95=['exports','sequelize'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x5d95,0x161));var _0x55d9=function(_0x29f439,_0x11466c){_0x29f439=_0x29f439-0x0;var _0x1f964a=_0x5d95[_0x29f439];return _0x1f964a;};'use strict';var Sequelize=require(_0x55d9('0x0'));module[_0x55d9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc172=['INTEGER','sequelize','exports'];(function(_0x10fbba,_0xfec17e){var _0x319bb1=function(_0x36317a){while(--_0x36317a){_0x10fbba['push'](_0x10fbba['shift']());}};_0x319bb1(++_0xfec17e);}(_0xc172,0x1bd));var _0x2c17=function(_0x493dc0,_0x211aab){_0x493dc0=_0x493dc0-0x0;var _0x4eb5b3=_0xc172[_0x493dc0];return _0x4eb5b3;};'use strict';var Sequelize=require(_0x2c17('0x0'));module[_0x2c17('0x1')]={'penalty':{'type':Sequelize[_0x2c17('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 0adedd4..99162f5 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 _0x9bd4=['../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x34ad43,_0xe4f359){var _0x450d9a=function(_0x168097){while(--_0x168097){_0x34ad43['push'](_0x34ad43['shift']());}};_0x450d9a(++_0xe4f359);}(_0x9bd4,0x88));var _0x49bd=function(_0x271571,_0x1389ca){_0x271571=_0x271571-0x0;var _0x5c6c55=_0x9bd4[_0x271571];return _0x5c6c55;};'use strict';var _=require(_0x49bd('0x0'));var util=require(_0x49bd('0x1'));var logger=require(_0x49bd('0x2'))(_0x49bd('0x3'));var moment=require(_0x49bd('0x4'));var BPromise=require(_0x49bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49bd('0x6'));var rimraf=require(_0x49bd('0x7'));var config=require(_0x49bd('0x8'));var attributes=require(_0x49bd('0x9'));module['exports']=function(_0x3561ed,_0x3ec7e9){return _0x3561ed['define'](_0x49bd('0xa'),attributes,{'tableName':_0x49bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb56=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcb56,0xd4));var _0x6cb5=function(_0x3b183e,_0x12e723){_0x3b183e=_0x3b183e-0x0;var _0x465ee3=_0xcb56[_0x3b183e];return _0x465ee3;};'use strict';var _=require(_0x6cb5('0x0'));var util=require('util');var logger=require(_0x6cb5('0x1'))(_0x6cb5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb5('0x3'));var rimraf=require(_0x6cb5('0x4'));var config=require(_0x6cb5('0x5'));var attributes=require(_0x6cb5('0x6'));module[_0x6cb5('0x7')]=function(_0x38b861,_0x306455){return _0x38b861[_0x6cb5('0x8')](_0x6cb5('0x9'),attributes,{'tableName':_0x6cb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index dedb1de..3c7880d 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 _0xab12=['request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5b4297,_0x1b8d9d){var _0x79268b=function(_0x43a793){while(--_0x43a793){_0x5b4297['push'](_0x5b4297['shift']());}};_0x79268b(++_0x1b8d9d);}(_0xab12,0x14a));var _0x2ab1=function(_0x2307d2,_0x53c28d){_0x2307d2=_0x2307d2-0x0;var _0x6c7298=_0xab12[_0x2307d2];return _0x6c7298;};'use strict';var _=require(_0x2ab1('0x0'));var util=require(_0x2ab1('0x1'));var moment=require(_0x2ab1('0x2'));var BPromise=require(_0x2ab1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ab1('0x4'));var db=require(_0x2ab1('0x5'))['db'];var utils=require(_0x2ab1('0x6'));var logger=require(_0x2ab1('0x7'))(_0x2ab1('0x8'));var config=require(_0x2ab1('0x9'));var jayson=require(_0x2ab1('0xa'));var client=jayson['client'][_0x2ab1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4af5e1,_0x284751,_0x25ae06){return new BPromise(function(_0x45fec6,_0x4ec7b6){return client[_0x2ab1('0xc')](_0x4af5e1,_0x25ae06)[_0x2ab1('0xd')](function(_0x66055a){logger[_0x2ab1('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x284751,_0x2ab1('0xf'));logger[_0x2ab1('0x10')](_0x2ab1('0x11'),_0x284751,_0x2ab1('0xf'),JSON['stringify'](_0x66055a));if(_0x66055a[_0x2ab1('0x12')]){if(_0x66055a[_0x2ab1('0x12')][_0x2ab1('0x13')]===0x1f4){logger[_0x2ab1('0x12')](_0x2ab1('0x14'),_0x284751,_0x66055a[_0x2ab1('0x12')][_0x2ab1('0x15')]);return _0x4ec7b6(_0x66055a[_0x2ab1('0x12')][_0x2ab1('0x15')]);}logger[_0x2ab1('0x12')](_0x2ab1('0x14'),_0x284751,_0x66055a[_0x2ab1('0x12')][_0x2ab1('0x15')]);return _0x45fec6(_0x66055a[_0x2ab1('0x12')][_0x2ab1('0x15')]);}else{logger[_0x2ab1('0xe')](_0x2ab1('0x14'),_0x284751,_0x2ab1('0xf'));_0x45fec6(_0x66055a['result']['message']);}})[_0x2ab1('0x16')](function(_0x37b8e0){logger['error'](_0x2ab1('0x14'),_0x284751,_0x37b8e0);_0x4ec7b6(_0x37b8e0);});});} \ No newline at end of file +var _0x94e1=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x11b6f5,_0x4789c9){var _0x455ec7=function(_0x3b494f){while(--_0x3b494f){_0x11b6f5['push'](_0x11b6f5['shift']());}};_0x455ec7(++_0x4789c9);}(_0x94e1,0x131));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x194e('0x0'));var util=require(_0x194e('0x1'));var moment=require('moment');var BPromise=require(_0x194e('0x2'));var rs=require(_0x194e('0x3'));var fs=require('fs');var Redis=require(_0x194e('0x4'));var db=require(_0x194e('0x5'))['db'];var utils=require(_0x194e('0x6'));var logger=require(_0x194e('0x7'))(_0x194e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x194e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6204,_0x11b876,_0x2e4d88){return new BPromise(function(_0x320a15,_0x53f584){return client['request'](_0x4b6204,_0x2e4d88)['then'](function(_0x542db5){logger[_0x194e('0xa')](_0x194e('0xb'),_0x11b876,_0x194e('0xc'));logger['debug'](_0x194e('0xd'),_0x11b876,_0x194e('0xc'),JSON[_0x194e('0xe')](_0x542db5));if(_0x542db5[_0x194e('0xf')]){if(_0x542db5[_0x194e('0xf')]['code']===0x1f4){logger[_0x194e('0xf')](_0x194e('0xb'),_0x11b876,_0x542db5[_0x194e('0xf')][_0x194e('0x10')]);return _0x53f584(_0x542db5[_0x194e('0xf')][_0x194e('0x10')]);}logger[_0x194e('0xf')](_0x194e('0xb'),_0x11b876,_0x542db5[_0x194e('0xf')][_0x194e('0x10')]);return _0x320a15(_0x542db5[_0x194e('0xf')][_0x194e('0x10')]);}else{logger[_0x194e('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x11b876,'request\x20sent');_0x320a15(_0x542db5[_0x194e('0x11')][_0x194e('0x10')]);}})[_0x194e('0x12')](function(_0x56df7e){logger[_0x194e('0xf')](_0x194e('0xb'),_0x11b876,_0x56df7e);_0x53f584(_0x56df7e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4361ff6..9261cb6 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 _0xecb7=['/:id/clone','clone','/:id/sections','addSections','addResources','put','/:id','update','delete','destroy','removeSections','removeResources','multer','util','path','express','./userProfile.controller','get','isAuthenticated','index','/describe','show','/:id/resources','getResources','post','create'];(function(_0x3acb17,_0x47096d){var _0x5bcac1=function(_0x12a3de){while(--_0x12a3de){_0x3acb17['push'](_0x3acb17['shift']());}};_0x5bcac1(++_0x47096d);}(_0xecb7,0x192));var _0x7ecb=function(_0x59efea,_0x3dd63c){_0x59efea=_0x59efea-0x0;var _0x52c0d4=_0xecb7[_0x59efea];return _0x52c0d4;};'use strict';var multer=require(_0x7ecb('0x0'));var util=require(_0x7ecb('0x1'));var path=require(_0x7ecb('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ecb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7ecb('0x4'));router[_0x7ecb('0x5')]('/',auth[_0x7ecb('0x6')](),controller[_0x7ecb('0x7')]);router['get'](_0x7ecb('0x8'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7ecb('0x9')]);router[_0x7ecb('0x5')]('/:id/sections',auth[_0x7ecb('0x6')](),controller['getSections']);router['get'](_0x7ecb('0xa'),auth[_0x7ecb('0x6')](),controller[_0x7ecb('0xb')]);router[_0x7ecb('0xc')]('/',auth[_0x7ecb('0x6')](),controller[_0x7ecb('0xd')]);router[_0x7ecb('0xc')](_0x7ecb('0xe'),auth['isAuthenticated'](),controller[_0x7ecb('0xf')]);router[_0x7ecb('0xc')](_0x7ecb('0x10'),auth[_0x7ecb('0x6')](),controller[_0x7ecb('0x11')]);router[_0x7ecb('0xc')](_0x7ecb('0xa'),auth['isAuthenticated'](),controller[_0x7ecb('0x12')]);router[_0x7ecb('0x13')](_0x7ecb('0x14'),auth['isAuthenticated'](),controller[_0x7ecb('0x15')]);router[_0x7ecb('0x16')](_0x7ecb('0x14'),auth[_0x7ecb('0x6')](),controller[_0x7ecb('0x17')]);router[_0x7ecb('0x16')](_0x7ecb('0x10'),auth[_0x7ecb('0x6')](),controller[_0x7ecb('0x18')]);router[_0x7ecb('0x16')](_0x7ecb('0xa'),auth['isAuthenticated'](),controller[_0x7ecb('0x19')]);module['exports']=router; \ No newline at end of file +var _0x1474=['/:id','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','show','/:id/sections','isAuthenticated','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put'];(function(_0x532092,_0x225518){var _0x5811fc=function(_0x18e3a8){while(--_0x18e3a8){_0x532092['push'](_0x532092['shift']());}};_0x5811fc(++_0x225518);}(_0x1474,0x7a));var _0x4147=function(_0xa35666,_0x19fb8a){_0xa35666=_0xa35666-0x0;var _0x4b2d2f=_0x1474[_0xa35666];return _0x4b2d2f;};'use strict';var multer=require(_0x4147('0x0'));var util=require(_0x4147('0x1'));var path=require(_0x4147('0x2'));var timeout=require('connect-timeout');var express=require(_0x4147('0x3'));var router=express[_0x4147('0x4')]();var fs_extra=require(_0x4147('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4147('0x6'));var config=require(_0x4147('0x7'));var controller=require(_0x4147('0x8'));router[_0x4147('0x9')]('/',auth['isAuthenticated'](),controller[_0x4147('0xa')]);router[_0x4147('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4147('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4147('0xb')]);router[_0x4147('0x9')](_0x4147('0xc'),auth[_0x4147('0xd')](),controller[_0x4147('0xe')]);router['get'](_0x4147('0xf'),auth['isAuthenticated'](),controller[_0x4147('0x10')]);router[_0x4147('0x11')]('/',auth[_0x4147('0xd')](),controller['create']);router['post'](_0x4147('0x12'),auth[_0x4147('0xd')](),controller[_0x4147('0x13')]);router[_0x4147('0x11')](_0x4147('0xc'),auth[_0x4147('0xd')](),controller[_0x4147('0x14')]);router[_0x4147('0x11')](_0x4147('0xf'),auth[_0x4147('0xd')](),controller[_0x4147('0x15')]);router[_0x4147('0x16')](_0x4147('0x17'),auth[_0x4147('0xd')](),controller['update']);router[_0x4147('0x18')](_0x4147('0x17'),auth['isAuthenticated'](),controller[_0x4147('0x19')]);router[_0x4147('0x18')](_0x4147('0xc'),auth[_0x4147('0xd')](),controller[_0x4147('0x1a')]);router[_0x4147('0x18')](_0x4147('0xf'),auth['isAuthenticated'](),controller[_0x4147('0x1b')]);module[_0x4147('0x1c')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index c3d6bf6..a3040cb 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 _0x97c8=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x97c8,0x17d));var _0x897c=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x97c8[_0x2bda14];return _0xb5dd49;};'use strict';var Sequelize=require(_0x897c('0x0'));module[_0x897c('0x1')]={'name':{'type':Sequelize[_0x897c('0x2')],'allowNull':![],'unique':_0x897c('0x3')},'crudPermissions':{'type':Sequelize[_0x897c('0x2')],'set':function(_0x1ab3df){this[_0x897c('0x4')](_0x897c('0x5'),_0x1ab3df?_0x1ab3df[_0x897c('0x6')](''):[]);},'get':function(){return this[_0x897c('0x7')]('crudPermissions')?this[_0x897c('0x7')]('crudPermissions')[_0x897c('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x897c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x897c('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x897c('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x897c('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x897c('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x897c('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x897c('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe287=['BOOLEAN','STRING','name','crudPermissions','join','getDataValue'];(function(_0x4f06df,_0x543057){var _0x5344cd=function(_0x53f154){while(--_0x53f154){_0x4f06df['push'](_0x4f06df['shift']());}};_0x5344cd(++_0x543057);}(_0xe287,0x1db));var _0x7e28=function(_0x934eed,_0x342d7b){_0x934eed=_0x934eed-0x0;var _0x1eb4d2=_0xe287[_0x934eed];return _0x1eb4d2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7e28('0x0')],'allowNull':![],'unique':_0x7e28('0x1')},'crudPermissions':{'type':Sequelize[_0x7e28('0x0')],'set':function(_0x47a3df){this['setDataValue'](_0x7e28('0x2'),_0x47a3df?_0x47a3df[_0x7e28('0x3')](''):[]);},'get':function(){return this[_0x7e28('0x4')](_0x7e28('0x2'))?this['getDataValue'](_0x7e28('0x2'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7e28('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7e28('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e7e17ed..97ce712 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 _0x4888=['filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfile','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','get','UserProfileSection','each','autoAssociation','userProfileId','Resources','UserProfileResource','update','describe','addSections','push','ids','getSections','includes','sectionId','isEmpty','enabled','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','map','rawAttributes','fieldName','type','key','keys','query'];(function(_0x4aaced,_0x3381ba){var _0x1e32b3=function(_0x1bfe46){while(--_0x1bfe46){_0x4aaced['push'](_0x4aaced['shift']());}};_0x1e32b3(++_0x3381ba);}(_0x4888,0x198));var _0x8488=function(_0x43eadd,_0x36ca50){_0x43eadd=_0x43eadd-0x0;var _0x125bde=_0x4888[_0x43eadd];return _0x125bde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];config[_0x8488('0x17')]=_[_0x8488('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8488('0x19'))(new Redis(config['redis']));require(_0x8488('0x1a'))['register'](socket);function respondWithStatusCode(_0x5161a3,_0x24d0a0){_0x24d0a0=_0x24d0a0||0xcc;return function(_0x3635da){if(_0x3635da){return _0x5161a3[_0x8488('0x1b')](_0x24d0a0);}return _0x5161a3[_0x8488('0x1c')](_0x24d0a0)[_0x8488('0x1d')]();};}function respondWithResult(_0x8d3b3d,_0x165139){_0x165139=_0x165139||0xc8;return function(_0x4e44af){if(_0x4e44af){return _0x8d3b3d[_0x8488('0x1c')](_0x165139)[_0x8488('0x1e')](_0x4e44af);}};}function respondWithFilteredResult(_0x3edfe4,_0x37361d){return function(_0x60ae2f){if(_0x60ae2f){var _0x39775f=typeof _0x37361d[_0x8488('0x1f')]===_0x8488('0x20')&&typeof _0x37361d[_0x8488('0x21')]===_0x8488('0x20');var _0x10bfd6=_0x60ae2f[_0x8488('0x22')];var _0x3dd93e=_0x39775f?0x0:_0x37361d['offset'];var _0x4a1b45=_0x39775f?_0x60ae2f[_0x8488('0x22')]:_0x37361d[_0x8488('0x1f')]+_0x37361d[_0x8488('0x21')];var _0x3c9fc2;if(_0x4a1b45>=_0x10bfd6){_0x4a1b45=_0x10bfd6;_0x3c9fc2=0xc8;}else{_0x3c9fc2=0xce;}_0x3edfe4[_0x8488('0x1c')](_0x3c9fc2);return _0x3edfe4[_0x8488('0x23')](_0x8488('0x24'),_0x3dd93e+'-'+_0x4a1b45+'/'+_0x10bfd6)[_0x8488('0x1e')](_0x60ae2f);}return null;};}function patchUpdates(_0x39dd43){return function(_0x5123d0){try{jsonpatch[_0x8488('0x25')](_0x5123d0,_0x39dd43,!![]);}catch(_0x4e07e1){return BPromise[_0x8488('0x26')](_0x4e07e1);}return _0x5123d0[_0x8488('0x27')]();};}function saveUpdates(_0x290b33,_0x54ecda){return function(_0x577234){if(_0x577234){return _0x577234['update'](_0x290b33)['then'](function(_0x472624){return _0x472624;});}return null;};}function removeEntity(_0x51fe30,_0x58057a){return function(_0x26bdbb){if(_0x26bdbb){return _0x26bdbb[_0x8488('0x28')]()[_0x8488('0x29')](function(){_0x51fe30[_0x8488('0x1c')](0xcc)[_0x8488('0x1d')]();});}};}function handleEntityNotFound(_0x503b83,_0x1b0519){return function(_0x38c137){if(!_0x38c137){_0x503b83[_0x8488('0x1b')](0x194);}return _0x38c137;};}function handleError(_0x3df1f9,_0x460001){_0x460001=_0x460001||0x1f4;return function(_0x27f5cf){logger[_0x8488('0x2a')](_0x27f5cf[_0x8488('0x2b')]);if(_0x27f5cf[_0x8488('0x2c')]){delete _0x27f5cf[_0x8488('0x2c')];}_0x3df1f9[_0x8488('0x1c')](_0x460001)['send'](_0x27f5cf);};}exports['index']=function(_0x4e3fe2,_0x292fe8){var _0x408c36={},_0x19cf42={},_0x121dcc={'count':0x0,'rows':[]};var _0x117321=_[_0x8488('0x2d')](db['UserProfile'][_0x8488('0x2e')],function(_0x14f378){return{'name':_0x14f378[_0x8488('0x2f')],'type':_0x14f378[_0x8488('0x30')][_0x8488('0x31')]};});_0x19cf42['model']=_[_0x8488('0x2d')](_0x117321,_0x8488('0x2c'));_0x19cf42['query']=_[_0x8488('0x32')](_0x4e3fe2[_0x8488('0x33')]);_0x19cf42[_0x8488('0x34')]=_[_0x8488('0x35')](_0x19cf42[_0x8488('0x36')],_0x19cf42['query']);_0x408c36[_0x8488('0x37')]=_[_0x8488('0x35')](_0x19cf42[_0x8488('0x36')],qs['fields'](_0x4e3fe2[_0x8488('0x33')]['fields']));_0x408c36[_0x8488('0x37')]=_0x408c36[_0x8488('0x37')][_0x8488('0x38')]?_0x408c36[_0x8488('0x37')]:_0x19cf42['model'];if(!_0x4e3fe2[_0x8488('0x33')][_0x8488('0x39')](_0x8488('0x3a'))){_0x408c36['limit']=qs[_0x8488('0x21')](_0x4e3fe2[_0x8488('0x33')][_0x8488('0x21')]);_0x408c36[_0x8488('0x1f')]=qs[_0x8488('0x1f')](_0x4e3fe2[_0x8488('0x33')][_0x8488('0x1f')]);}_0x408c36[_0x8488('0x3b')]=qs[_0x8488('0x3c')](_0x4e3fe2[_0x8488('0x33')][_0x8488('0x3c')]);_0x408c36['where']=qs['filters'](_[_0x8488('0x3d')](_0x4e3fe2[_0x8488('0x33')],_0x19cf42[_0x8488('0x34')]),_0x117321);if(_0x4e3fe2[_0x8488('0x33')][_0x8488('0x3e')]){_0x408c36[_0x8488('0x3f')]=_[_0x8488('0x40')](_0x408c36[_0x8488('0x3f')],{'$or':_[_0x8488('0x2d')](_0x117321,function(_0x5f561c){if(_0x5f561c[_0x8488('0x30')]!==_0x8488('0x41')){var _0x11a258={};_0x11a258[_0x5f561c['name']]={'$like':'%'+_0x4e3fe2[_0x8488('0x33')][_0x8488('0x3e')]+'%'};return _0x11a258;}})});}_0x408c36=_[_0x8488('0x40')]({},_0x408c36,_0x4e3fe2[_0x8488('0x42')]);var _0x44d5f2={'where':_0x408c36[_0x8488('0x3f')]};return db[_0x8488('0x43')]['count'](_0x44d5f2)[_0x8488('0x29')](function(_0x1c33a1){_0x121dcc[_0x8488('0x22')]=_0x1c33a1;if(_0x4e3fe2['query'][_0x8488('0x44')]){_0x408c36['include']=[{'all':!![]}];}return db[_0x8488('0x43')][_0x8488('0x45')](_0x408c36);})['then'](function(_0x22a3f3){_0x121dcc[_0x8488('0x46')]=_0x22a3f3;return _0x121dcc;})[_0x8488('0x29')](respondWithFilteredResult(_0x292fe8,_0x408c36))[_0x8488('0x47')](handleError(_0x292fe8,null));};exports[_0x8488('0x48')]=function(_0x4e5c83,_0x3724be){var _0x50c31d={'raw':![],'where':{'id':_0x4e5c83[_0x8488('0x49')]['id']}},_0x3440ae={};_0x3440ae[_0x8488('0x36')]=_[_0x8488('0x32')](db[_0x8488('0x43')][_0x8488('0x2e')]);_0x3440ae[_0x8488('0x33')]=_[_0x8488('0x32')](_0x4e5c83[_0x8488('0x33')]);_0x3440ae[_0x8488('0x34')]=_[_0x8488('0x35')](_0x3440ae[_0x8488('0x36')],_0x3440ae[_0x8488('0x33')]);_0x50c31d[_0x8488('0x37')]=_[_0x8488('0x35')](_0x3440ae[_0x8488('0x36')],qs[_0x8488('0x4a')](_0x4e5c83['query'][_0x8488('0x4a')]));_0x50c31d[_0x8488('0x37')]=_0x50c31d[_0x8488('0x37')][_0x8488('0x38')]?_0x50c31d['attributes']:_0x3440ae[_0x8488('0x36')];if(_0x4e5c83[_0x8488('0x33')][_0x8488('0x44')]){_0x50c31d[_0x8488('0x4b')]=[{'all':!![]}];}_0x50c31d=_['merge']({},_0x50c31d,_0x4e5c83[_0x8488('0x42')]);return db[_0x8488('0x43')][_0x8488('0x4c')](_0x50c31d)[_0x8488('0x29')](handleEntityNotFound(_0x3724be,null))[_0x8488('0x29')](respondWithResult(_0x3724be,null))[_0x8488('0x47')](handleError(_0x3724be,null));};exports[_0x8488('0x4d')]=function(_0x299d8e,_0x1bc2e1){return db[_0x8488('0x43')][_0x8488('0x4d')](_0x299d8e[_0x8488('0x4e')],{})[_0x8488('0x29')](respondWithResult(_0x1bc2e1,0xc9))['catch'](handleError(_0x1bc2e1,null));};exports['clone']=function(_0x8267e1,_0x1a66ff){var _0x3749da={'where':{'id':_0x8267e1[_0x8488('0x49')]['id']}},_0x45bd4b={};_0x45bd4b[_0x8488('0x36')]=_[_0x8488('0x32')](db[_0x8488('0x43')][_0x8488('0x2e')]);_0x3749da['attributes']=_[_0x8488('0x35')](_0x45bd4b[_0x8488('0x36')],qs['fields'](_0x8267e1[_0x8488('0x33')][_0x8488('0x4a')]));_0x3749da[_0x8488('0x37')]=_0x3749da[_0x8488('0x37')]['length']?_0x3749da[_0x8488('0x37')]:_0x45bd4b[_0x8488('0x36')];if(_0x8267e1[_0x8488('0x33')]['includeAll']){_0x3749da[_0x8488('0x4b')]=[{'all':!![]}];}_0x3749da=_[_0x8488('0x40')]({},_0x3749da,_0x8267e1[_0x8488('0x42')]);return db[_0x8488('0x43')]['find'](_0x3749da)[_0x8488('0x29')](handleEntityNotFound(_0x1a66ff,null))['then'](function(_0x4d4911){if(_0x4d4911){var _0x75faa8=_0x4d4911['get']({'plain':!![]});_0x75faa8=qs[_0x8488('0x4f')](_0x75faa8,['id',_0x8488('0x50'),_0x8488('0x51'),_0x8488('0x52')]);_0x8267e1[_0x8488('0x4e')]=_[_0x8488('0x4f')](_0x8267e1['body'],['id',_0x8488('0x50'),_0x8488('0x51')]);return db[_0x8488('0x53')][_0x8488('0x54')](function(_0x1e3737){return db['UserProfile'][_0x8488('0x4d')](_['merge'](_0x75faa8,_0x8267e1[_0x8488('0x4e')]),{'include':_0x8267e1[_0x8488('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x1e3737})[_0x8488('0x29')](function(_0x4382ad){var _0x304ceb=_0x4382ad[_0x8488('0x55')]({'plain':!![]});return db[_0x8488('0x56')][_0x8488('0x45')]({'where':{'userProfileId':_0x8267e1['params']['id']},'raw':!![]})[_0x8488('0x29')](function(_0x568da7){if(_0x568da7){return BPromise[_0x8488('0x57')](_0x568da7,function(_0x3fa6e2){return new BPromise(function(_0x3c06a4,_0x3fa288){if(_0x3fa6e2[_0x8488('0x58')]===null||_0x3fa6e2[_0x8488('0x58')]===0x1)_0x3c06a4(null);return db['UserProfileResource'][_0x8488('0x45')]({'where':{'sectionId':_0x3fa6e2['id']},'raw':!![]})['then'](function(_0x1598db){var _0x24b8d3=_[_0x8488('0x2d')](_0x1598db,function(_0x353013){return qs[_0x8488('0x4f')](_0x353013,['id',_0x8488('0x50'),'updatedAt','sectionId']);});_0x3c06a4(_0x24b8d3);})['catch'](function(_0x28ddb0){_0x3fa288(_0x28ddb0);});})[_0x8488('0x29')](function(_0x20855b){var _0x9e417d=qs[_0x8488('0x4f')](_0x3fa6e2,['id',_0x8488('0x50'),_0x8488('0x51')]);_0x9e417d[_0x8488('0x59')]=_0x304ceb['id'];if(_0x20855b)_0x9e417d[_0x8488('0x5a')]=_0x20855b;return _0x9e417d;})[_0x8488('0x29')](function(_0x57fdbb){return db[_0x8488('0x56')][_0x8488('0x4d')](_0x57fdbb,{'include':[{'model':db[_0x8488('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x1e3737});});})['then'](function(){return _0x304ceb;});}});});});}})[_0x8488('0x29')](respondWithResult(_0x1a66ff,0xc9))[_0x8488('0x47')](handleError(_0x1a66ff,null));};exports[_0x8488('0x5c')]=function(_0xf975a6,_0x52bc90){if(_0xf975a6['body']['id']){delete _0xf975a6[_0x8488('0x4e')]['id'];}return db[_0x8488('0x43')][_0x8488('0x4c')]({'where':{'id':_0xf975a6['params']['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x52bc90,null))[_0x8488('0x29')](saveUpdates(_0xf975a6[_0x8488('0x4e')],null))[_0x8488('0x29')](respondWithResult(_0x52bc90,null))[_0x8488('0x47')](handleError(_0x52bc90,null));};exports['destroy']=function(_0x37ceeb,_0x3babee){return db['UserProfile'][_0x8488('0x4c')]({'where':{'id':_0x37ceeb[_0x8488('0x49')]['id']}})['then'](handleEntityNotFound(_0x3babee,null))[_0x8488('0x29')](removeEntity(_0x3babee,null))[_0x8488('0x47')](handleError(_0x3babee,null));};exports[_0x8488('0x5d')]=function(_0x1d8c83,_0x493041){return db[_0x8488('0x43')][_0x8488('0x5d')]()['then'](respondWithResult(_0x493041,null))[_0x8488('0x47')](handleError(_0x493041,null));};exports[_0x8488('0x5e')]=function(_0x480666,_0x49ef10){var _0x397683=_0x480666[_0x8488('0x4e')];return db[_0x8488('0x43')]['find']({'where':{'id':_0x480666[_0x8488('0x49')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x49ef10,null))['then'](function(_0x42b5c5){if(_0x42b5c5){return db['sequelize'][_0x8488('0x54')](function(_0x1a3988){return db[_0x8488('0x56')]['destroy']({'where':{'userProfileId':_0x480666[_0x8488('0x49')]['id'],'sectionId':_[_0x8488('0x2d')](_0x397683,function(_0x57955d){return _0x57955d['sectionId'];})},'transaction':_0x1a3988})[_0x8488('0x29')](function(){var _0x21a42e=_[_0x8488('0x2d')](_0x397683,function(_0x3ab1b6){_0x3ab1b6[_0x8488('0x59')]=_0x480666[_0x8488('0x49')]['id'];return _0x3ab1b6;});var _0x20d7c3=[];return BPromise[_0x8488('0x57')](_0x21a42e,function(_0x1dee36){return db[_0x8488('0x56')]['create'](_0x1dee36,{'include':[{'model':db[_0x8488('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x1a3988})[_0x8488('0x29')](function(_0x250e9c){_0x20d7c3[_0x8488('0x5f')](_0x250e9c[_0x8488('0x55')]({'plain':!![]}));});})['then'](function(){return _0x20d7c3;});});});}})[_0x8488('0x29')](function(_0x15ee3a){return _0x15ee3a;})['then'](respondWithResult(_0x49ef10,null))[_0x8488('0x47')](handleError(_0x49ef10,null));};exports['removeSections']=function(_0x26241b,_0x15b919){var _0x429044;return db[_0x8488('0x43')][_0x8488('0x4c')]({'where':{'id':_0x26241b[_0x8488('0x49')]['id']},'attributes':['id',_0x8488('0x2c')]})[_0x8488('0x29')](handleEntityNotFound(_0x15b919,null))['then'](function(_0x1ce726){if(_0x1ce726){_0x429044=_0x1ce726;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x26241b[_0x8488('0x49')]['id'],'sectionId':_0x26241b[_0x8488('0x33')][_0x8488('0x60')]}});}})['then'](function(){return _0x429044;})['then'](respondWithStatusCode(_0x15b919,null))[_0x8488('0x47')](handleError(_0x15b919,null));};exports[_0x8488('0x61')]=function(_0x50aded,_0x1acaf7){var _0x688527=[];var _0x924138=[];return db[_0x8488('0x56')][_0x8488('0x45')]({'where':{'userProfileId':_0x50aded[_0x8488('0x49')]['id']},'raw':!![]})['then'](function(_0x2527ea){_0x688527=_[_0x8488('0x3e')](_0x2527ea,function(_0x829001){return _0x829001['enabled']===0x1||_[_0x8488('0x62')]([0x3eb,0x709],_0x829001[_0x8488('0x63')]);});if(!_[_0x8488('0x64')](_0x688527)){return _['map'](_0x688527,function(_0x28468b){return _0x28468b[_0x8488('0x63')];});}else{return;}})['then'](function(_0x48860c){if(_0x48860c)_0x924138=_0x48860c;if(_[_0x8488('0x62')](_0x924138,0x64)){var _0x18c724=_['find'](_0x688527,{'sectionId':0x64});return hasDefaultDashboard(_0x18c724)[_0x8488('0x29')](function(_0x249a32){return _['map'](_0x688527,function(_0x4a7047){if(_0x4a7047[_0x8488('0x63')]===0x64){_0x4a7047['subsections']=_0x249a32;}return _0x4a7047;});});}else{return;}})[_0x8488('0x29')](function(_0x202d16){if(_0x202d16)_0x688527=_0x202d16;if(_[_0x8488('0x62')](_0x924138,0x3eb)){var _0x42761b=_['find'](_0x688527,{'sectionId':0x3eb});return getCustomDashboards(_0x42761b)[_0x8488('0x29')](function(_0x506e4b){return _[_0x8488('0x2d')](_0x688527,function(_0x4d0d20){if(_0x42761b[_0x8488('0x65')]){if(_0x4d0d20[_0x8488('0x63')]===0x3eb){_0x4d0d20[_0x8488('0x66')]=_0x506e4b;}}else{if(_0x4d0d20[_0x8488('0x63')]===0x64){_0x4d0d20[_0x8488('0x66')]=_0x506e4b;}}return _0x4d0d20;});});}else{return;}})[_0x8488('0x29')](function(_0x784d23){if(_0x784d23)_0x688527=_0x784d23;if(_[_0x8488('0x62')](_0x924138,0x709)){var _0x15a0af=_[_0x8488('0x4c')](_0x688527,{'sectionId':0x709});return getPlugins(_0x15a0af)[_0x8488('0x29')](function(_0xc9c221){if(_0x15a0af[_0x8488('0x65')]){return _[_0x8488('0x2d')](_0x688527,function(_0x5079ea){if(_0x5079ea[_0x8488('0x63')]===0x709){_0x5079ea[_0x8488('0x66')]=_0xc9c221;}return _0x5079ea;});}else{var _0x55ddaf={'sectionId':0x76c,'enabled':0x1,'subsections':_0xc9c221};var _0x4c3331=_[_0x8488('0x2d')](_0x688527);_0x4c3331[_0x8488('0x5f')](_0x55ddaf);return _0x4c3331;}});}else{return;}})[_0x8488('0x29')](function(_0x11dc9a){if(_0x11dc9a)_0x688527=_0x11dc9a;return _[_0x8488('0x3e')](_0x688527,[_0x8488('0x65'),0x1]);})[_0x8488('0x29')](respondWithResult(_0x1acaf7,null))[_0x8488('0x47')](handleError(_0x1acaf7,null));};function hasDefaultDashboard(_0x1e9baf){var _0xfe2fbe=[0x65];return new BPromise(function(_0x5e022a,_0x2b3723){try{if(_0x1e9baf[_0x8488('0x58')]){_0x5e022a(_0xfe2fbe);}else{return db['UserProfileResource'][_0x8488('0x67')]({'where':{'sectionId':_0x1e9baf['id']},'raw':!![]})[_0x8488('0x29')](function(_0x76c3c){_0x76c3c?_0x5e022a(_0xfe2fbe):_0x5e022a();});}}catch(_0x1099ae){_0x2b3723(_0x1099ae);}});}function getCustomDashboards(_0x2df32b){var _0x5b19b9=[];return new BPromise(function(_0x57949a,_0x31138c){try{if(_0x2df32b[_0x8488('0x58')]){return db[_0x8488('0x68')][_0x8488('0x45')]({'raw':!![]})[_0x8488('0x29')](function(_0x476251){_0x476251[_0x8488('0x69')](function(_0x283824){_0x5b19b9[_0x8488('0x5f')](_0x283824['id']+0x1869f);});_0x57949a(_0x5b19b9);});}else{return db[_0x8488('0x5b')][_0x8488('0x45')]({'where':{'sectionId':_0x2df32b['id']},'raw':!![]})[_0x8488('0x29')](function(_0x2d27ef){_0x2d27ef[_0x8488('0x69')](function(_0x315354){_0x5b19b9['push'](_0x315354[_0x8488('0x6a')]+0x1869f);});_0x57949a(_0x5b19b9);});}}catch(_0x5d5234){_0x31138c(_0x5d5234);}});}function getPlugins(_0x5d3b85){var _0x1e25a3=[];return new BPromise(function(_0x215253,_0x2f2dbb){try{if(_0x5d3b85[_0x8488('0x58')]){return db[_0x8488('0x6b')][_0x8488('0x45')]({'raw':!![]})[_0x8488('0x29')](function(_0x366eab){_0x366eab[_0x8488('0x69')](function(_0x3c8469){_0x1e25a3['push'](_0x3c8469['id']+0x15b38);});_0x215253(_0x1e25a3);});}else{return db[_0x8488('0x5b')][_0x8488('0x45')]({'where':{'sectionId':_0x5d3b85['id']},'raw':!![]})[_0x8488('0x29')](function(_0x1f083f){_0x1f083f[_0x8488('0x69')](function(_0x184cd9){_0x1e25a3['push'](_0x184cd9[_0x8488('0x6a')]+0x15b38);});_0x215253(_0x1e25a3);});}}catch(_0x5b0d69){_0x2f2dbb(_0x5b0d69);}});}exports[_0x8488('0x6c')]=function(_0x3936b6,_0x4be018){return db['UserProfile'][_0x8488('0x4c')]({'where':{'id':_0x3936b6[_0x8488('0x49')]['id']}})[_0x8488('0x29')](handleEntityNotFound(_0x4be018,null))[_0x8488('0x29')](function(_0xbec8a6){if(_0xbec8a6){return db['sequelize'][_0x8488('0x54')](function(_0x19c5c6){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3936b6[_0x8488('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x8488('0x29')](function(_0x11a7e3){if(_0x11a7e3){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3936b6[_0x8488('0x49')]['id'],'id':_[_0x8488('0x2d')](_0x11a7e3,function(_0x27f439){return _0x27f439['id'];})},'transaction':_0x19c5c6});}})['then'](function(_0x337d0f){var _0x1e4e51=_[_0x8488('0x2d')](_0x3936b6[_0x8488('0x4e')],function(_0x7b2aa2){_0x7b2aa2[_0x8488('0x59')]=_0x3936b6[_0x8488('0x49')]['id'];return _0x7b2aa2;});return db[_0x8488('0x56')][_0x8488('0x6d')](_0x1e4e51,{'raw':!![],'transaction':_0x19c5c6});})[_0x8488('0x29')](function(_0x22faae){var _0x9f7604=_[_0x8488('0x3e')](_['map'](_0x22faae,function(_0x81255){return _0x81255[_0x8488('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x9f7604){return db[_0x8488('0x56')]['findAll']({'where':{'userProfileId':_0x3936b6[_0x8488('0x49')]['id'],'sectionId':_['map'](_0x9f7604,function(_0x2519b3){return _0x2519b3['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x8488('0x29')](function(_0x550eb2){var _0x42f36b=_[_0x8488('0x2d')](_0x3936b6[_0x8488('0x4e')],function(_0x4081fc){_0x4081fc['userProfileId']=_0x3936b6[_0x8488('0x49')]['id'];return _0x4081fc;});return db[_0x8488('0x5b')][_0x8488('0x6d')](_0x42f36b,{'raw':!![],'transaction':_0x19c5c6});});}})[_0x8488('0x47')](handleError(_0x4be018,null));});}})['then'](function(_0x242b57){var _0x432bce=_[_0x8488('0x2d')](_0x242b57,function(_0x3804ba){return _0x3804ba[_0x8488('0x55')]({'plain':!![]});});})['then'](respondWithResult(_0x4be018,null))['catch'](handleError(_0x4be018,null));};exports[_0x8488('0x6e')]=function(_0x1ad9f7,_0x42e1c0,_0x197ed0){return db[_0x8488('0x43')]['find']({'where':{'id':_0x1ad9f7['params']['id']}})['then'](handleEntityNotFound(_0x42e1c0,null))[_0x8488('0x29')](function(_0x2fe7e0){if(_0x2fe7e0){return _0x2fe7e0[_0x8488('0x6e')](_0x1ad9f7['query'][_0x8488('0x60')]);}})[_0x8488('0x29')](respondWithStatusCode(_0x42e1c0,null))['catch'](handleError(_0x42e1c0,null));};exports[_0x8488('0x6f')]=function(_0x20cdc8,_0x35b9e6){var _0xbb8f1f={};if(!_0x20cdc8[_0x8488('0x33')][_0x8488('0x70')])throw new Error(_0x8488('0x71'));if(!_0x20cdc8[_0x8488('0x33')][_0x8488('0x39')](_0x8488('0x3a'))){_0xbb8f1f[_0x8488('0x21')]=qs[_0x8488('0x21')](_0x20cdc8[_0x8488('0x33')]['limit']);_0xbb8f1f[_0x8488('0x1f')]=qs[_0x8488('0x1f')](_0x20cdc8['query']['offset']);}return db['UserProfile'][_0x8488('0x4c')]({'where':{'id':_0x20cdc8[_0x8488('0x49')]['id']}})[_0x8488('0x29')](function(_0x4ba801){if(!_0x4ba801)throw new Error(_0x8488('0x72')+_0x20cdc8['params']['id']);return db[_0x8488('0x43')][_0x8488('0x6f')](_0x20cdc8);})[_0x8488('0x29')](respondWithFilteredResult(_0x35b9e6,_0xbb8f1f))[_0x8488('0x47')](handleError(_0x35b9e6,null));}; \ No newline at end of file +var _0x2032=['removeResources','getResources','section','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','rawAttributes','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate'];(function(_0x1099f7,_0x18d288){var _0x5246f9=function(_0x4ac184){while(--_0x4ac184){_0x1099f7['push'](_0x1099f7['shift']());}};_0x5246f9(++_0x18d288);}(_0x2032,0xd9));var _0x2203=function(_0x354833,_0x4a2fee){_0x354833=_0x354833-0x0;var _0x2d1869=_0x2032[_0x354833];return _0x2d1869;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x21a3af,_0x472265){_0x472265=_0x472265||0xcc;return function(_0x1c1ead){if(_0x1c1ead){return _0x21a3af[_0x2203('0x19')](_0x472265);}return _0x21a3af[_0x2203('0x1a')](_0x472265)[_0x2203('0x1b')]();};}function respondWithResult(_0x2c36e6,_0x2c085c){_0x2c085c=_0x2c085c||0xc8;return function(_0xdf9d0b){if(_0xdf9d0b){return _0x2c36e6[_0x2203('0x1a')](_0x2c085c)['json'](_0xdf9d0b);}};}function respondWithFilteredResult(_0x280eda,_0x2ee127){return function(_0x4893ff){if(_0x4893ff){var _0x3f9ef6=typeof _0x2ee127[_0x2203('0x1c')]==='undefined'&&typeof _0x2ee127[_0x2203('0x1d')]==='undefined';var _0x2904ba=_0x4893ff[_0x2203('0x1e')];var _0x3c8c34=_0x3f9ef6?0x0:_0x2ee127[_0x2203('0x1c')];var _0x15cb1a=_0x3f9ef6?_0x4893ff[_0x2203('0x1e')]:_0x2ee127['offset']+_0x2ee127[_0x2203('0x1d')];var _0x50822b;if(_0x15cb1a>=_0x2904ba){_0x15cb1a=_0x2904ba;_0x50822b=0xc8;}else{_0x50822b=0xce;}_0x280eda['status'](_0x50822b);return _0x280eda[_0x2203('0x1f')]('Content-Range',_0x3c8c34+'-'+_0x15cb1a+'/'+_0x2904ba)[_0x2203('0x20')](_0x4893ff);}return null;};}function patchUpdates(_0x5bfe61){return function(_0x5d4c4e){try{jsonpatch[_0x2203('0x21')](_0x5d4c4e,_0x5bfe61,!![]);}catch(_0x5e29cd){return BPromise['reject'](_0x5e29cd);}return _0x5d4c4e[_0x2203('0x22')]();};}function saveUpdates(_0x2718f5,_0x21f930){return function(_0xfd0970){if(_0xfd0970){return _0xfd0970[_0x2203('0x23')](_0x2718f5)[_0x2203('0x24')](function(_0x49c12){return _0x49c12;});}return null;};}function removeEntity(_0x250349,_0x576378){return function(_0x143f41){if(_0x143f41){return _0x143f41[_0x2203('0x25')]()[_0x2203('0x24')](function(){_0x250349['status'](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x1cec17,_0x5c5fd3){return function(_0xd6e109){if(!_0xd6e109){_0x1cec17[_0x2203('0x19')](0x194);}return _0xd6e109;};}function handleError(_0x1c6a77,_0x46b8b9){_0x46b8b9=_0x46b8b9||0x1f4;return function(_0x28ae02){logger[_0x2203('0x26')](_0x28ae02[_0x2203('0x27')]);if(_0x28ae02['name']){delete _0x28ae02[_0x2203('0x28')];}_0x1c6a77[_0x2203('0x1a')](_0x46b8b9)[_0x2203('0x29')](_0x28ae02);};}exports[_0x2203('0x2a')]=function(_0x52a426,_0x3a8e23){var _0x21ff0d={},_0x287c95={},_0xf59954={'count':0x0,'rows':[]};var _0x520602=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x5c0157){return{'name':_0x5c0157[_0x2203('0x2d')],'type':_0x5c0157['type']['key']};});_0x287c95[_0x2203('0x2e')]=_[_0x2203('0x2b')](_0x520602,_0x2203('0x28'));_0x287c95[_0x2203('0x2f')]=_[_0x2203('0x30')](_0x52a426['query']);_0x287c95[_0x2203('0x31')]=_[_0x2203('0x32')](_0x287c95['model'],_0x287c95[_0x2203('0x2f')]);_0x21ff0d[_0x2203('0x33')]=_[_0x2203('0x32')](_0x287c95[_0x2203('0x2e')],qs[_0x2203('0x34')](_0x52a426[_0x2203('0x2f')][_0x2203('0x34')]));_0x21ff0d[_0x2203('0x33')]=_0x21ff0d[_0x2203('0x33')]['length']?_0x21ff0d[_0x2203('0x33')]:_0x287c95[_0x2203('0x2e')];if(!_0x52a426['query']['hasOwnProperty'](_0x2203('0x35'))){_0x21ff0d['limit']=qs[_0x2203('0x1d')](_0x52a426[_0x2203('0x2f')][_0x2203('0x1d')]);_0x21ff0d['offset']=qs['offset'](_0x52a426[_0x2203('0x2f')]['offset']);}_0x21ff0d[_0x2203('0x36')]=qs['sort'](_0x52a426[_0x2203('0x2f')]['sort']);_0x21ff0d[_0x2203('0x37')]=qs[_0x2203('0x31')](_[_0x2203('0x38')](_0x52a426[_0x2203('0x2f')],_0x287c95[_0x2203('0x31')]),_0x520602);if(_0x52a426['query']['filter']){_0x21ff0d['where']=_[_0x2203('0x39')](_0x21ff0d[_0x2203('0x37')],{'$or':_[_0x2203('0x2b')](_0x520602,function(_0x3b0c7a){if(_0x3b0c7a[_0x2203('0x3a')]!==_0x2203('0x3b')){var _0x1c7e3d={};_0x1c7e3d[_0x3b0c7a['name']]={'$like':'%'+_0x52a426[_0x2203('0x2f')][_0x2203('0x3c')]+'%'};return _0x1c7e3d;}})});}_0x21ff0d=_[_0x2203('0x39')]({},_0x21ff0d,_0x52a426[_0x2203('0x3d')]);var _0x493d12={'where':_0x21ff0d['where']};return db[_0x2203('0x2c')]['count'](_0x493d12)[_0x2203('0x24')](function(_0x446209){_0xf59954[_0x2203('0x1e')]=_0x446209;if(_0x52a426['query']['includeAll']){_0x21ff0d[_0x2203('0x3e')]=[{'all':!![]}];}return db[_0x2203('0x2c')][_0x2203('0x3f')](_0x21ff0d);})[_0x2203('0x24')](function(_0x372709){_0xf59954[_0x2203('0x40')]=_0x372709;return _0xf59954;})['then'](respondWithFilteredResult(_0x3a8e23,_0x21ff0d))[_0x2203('0x41')](handleError(_0x3a8e23,null));};exports[_0x2203('0x42')]=function(_0x3a866c,_0x266076){var _0x16b452={'raw':![],'where':{'id':_0x3a866c[_0x2203('0x43')]['id']}},_0x36b99f={};_0x36b99f[_0x2203('0x2e')]=_[_0x2203('0x30')](db[_0x2203('0x2c')]['rawAttributes']);_0x36b99f[_0x2203('0x2f')]=_[_0x2203('0x30')](_0x3a866c[_0x2203('0x2f')]);_0x36b99f[_0x2203('0x31')]=_['intersection'](_0x36b99f['model'],_0x36b99f[_0x2203('0x2f')]);_0x16b452['attributes']=_[_0x2203('0x32')](_0x36b99f[_0x2203('0x2e')],qs[_0x2203('0x34')](_0x3a866c[_0x2203('0x2f')]['fields']));_0x16b452[_0x2203('0x33')]=_0x16b452[_0x2203('0x33')]['length']?_0x16b452[_0x2203('0x33')]:_0x36b99f[_0x2203('0x2e')];if(_0x3a866c[_0x2203('0x2f')][_0x2203('0x44')]){_0x16b452['include']=[{'all':!![]}];}_0x16b452=_['merge']({},_0x16b452,_0x3a866c[_0x2203('0x3d')]);return db['UserProfile']['find'](_0x16b452)[_0x2203('0x24')](handleEntityNotFound(_0x266076,null))[_0x2203('0x24')](respondWithResult(_0x266076,null))[_0x2203('0x41')](handleError(_0x266076,null));};exports['create']=function(_0x4c1496,_0x131aec){return db[_0x2203('0x2c')][_0x2203('0x45')](_0x4c1496[_0x2203('0x46')],{})[_0x2203('0x24')](respondWithResult(_0x131aec,0xc9))[_0x2203('0x41')](handleError(_0x131aec,null));};exports['clone']=function(_0x747dce,_0x557659){var _0x3f7685={'where':{'id':_0x747dce[_0x2203('0x43')]['id']}},_0x39ff6f={};_0x39ff6f[_0x2203('0x2e')]=_['keys'](db['UserProfile'][_0x2203('0x47')]);_0x3f7685[_0x2203('0x33')]=_[_0x2203('0x32')](_0x39ff6f[_0x2203('0x2e')],qs['fields'](_0x747dce['query']['fields']));_0x3f7685[_0x2203('0x33')]=_0x3f7685[_0x2203('0x33')]['length']?_0x3f7685[_0x2203('0x33')]:_0x39ff6f[_0x2203('0x2e')];if(_0x747dce['query'][_0x2203('0x44')]){_0x3f7685[_0x2203('0x3e')]=[{'all':!![]}];}_0x3f7685=_[_0x2203('0x39')]({},_0x3f7685,_0x747dce[_0x2203('0x3d')]);return db['UserProfile'][_0x2203('0x48')](_0x3f7685)['then'](handleEntityNotFound(_0x557659,null))[_0x2203('0x24')](function(_0x1de713){if(_0x1de713){var _0x4ee8cf=_0x1de713[_0x2203('0x49')]({'plain':!![]});_0x4ee8cf=qs[_0x2203('0x4a')](_0x4ee8cf,['id',_0x2203('0x4b'),_0x2203('0x4c'),_0x2203('0x4d')]);_0x747dce[_0x2203('0x46')]=_['omit'](_0x747dce['body'],['id',_0x2203('0x4b'),'updatedAt']);return db['sequelize'][_0x2203('0x4e')](function(_0x33e5eb){return db[_0x2203('0x2c')]['create'](_[_0x2203('0x39')](_0x4ee8cf,_0x747dce['body']),{'include':_0x747dce['query'][_0x2203('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x33e5eb})['then'](function(_0x54ec71){var _0x5efc59=_0x54ec71[_0x2203('0x49')]({'plain':!![]});return db[_0x2203('0x4f')][_0x2203('0x3f')]({'where':{'userProfileId':_0x747dce[_0x2203('0x43')]['id']},'raw':!![]})[_0x2203('0x24')](function(_0x32f593){if(_0x32f593){return BPromise[_0x2203('0x50')](_0x32f593,function(_0x91f70c){return new BPromise(function(_0x36b5fb,_0x216641){if(_0x91f70c[_0x2203('0x51')]===null||_0x91f70c[_0x2203('0x51')]===0x1)_0x36b5fb(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x91f70c['id']},'raw':!![]})[_0x2203('0x24')](function(_0x43d8c0){var _0x2511bd=_[_0x2203('0x2b')](_0x43d8c0,function(_0x26382f){return qs[_0x2203('0x4a')](_0x26382f,['id','createdAt','updatedAt',_0x2203('0x52')]);});_0x36b5fb(_0x2511bd);})[_0x2203('0x41')](function(_0x21ee59){_0x216641(_0x21ee59);});})[_0x2203('0x24')](function(_0xcab922){var _0x7b0b9c=qs[_0x2203('0x4a')](_0x91f70c,['id',_0x2203('0x4b'),_0x2203('0x4c')]);_0x7b0b9c[_0x2203('0x53')]=_0x5efc59['id'];if(_0xcab922)_0x7b0b9c[_0x2203('0x54')]=_0xcab922;return _0x7b0b9c;})['then'](function(_0x1ea97a){return db[_0x2203('0x4f')][_0x2203('0x45')](_0x1ea97a,{'include':[{'model':db[_0x2203('0x55')],'as':_0x2203('0x54')}],'raw':!![],'transaction':_0x33e5eb});});})[_0x2203('0x24')](function(){return _0x5efc59;});}});});});}})[_0x2203('0x24')](respondWithResult(_0x557659,0xc9))[_0x2203('0x41')](handleError(_0x557659,null));};exports[_0x2203('0x23')]=function(_0x35b7b9,_0x49e795){if(_0x35b7b9[_0x2203('0x46')]['id']){delete _0x35b7b9[_0x2203('0x46')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x48')]({'where':{'id':_0x35b7b9[_0x2203('0x43')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x49e795,null))[_0x2203('0x24')](saveUpdates(_0x35b7b9[_0x2203('0x46')],null))[_0x2203('0x24')](respondWithResult(_0x49e795,null))['catch'](handleError(_0x49e795,null));};exports[_0x2203('0x25')]=function(_0x3d0285,_0x465898){return db['UserProfile'][_0x2203('0x48')]({'where':{'id':_0x3d0285[_0x2203('0x43')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x465898,null))[_0x2203('0x24')](removeEntity(_0x465898,null))[_0x2203('0x41')](handleError(_0x465898,null));};exports['describe']=function(_0x38b077,_0x11243d){return db[_0x2203('0x2c')]['describe']()['then'](respondWithResult(_0x11243d,null))['catch'](handleError(_0x11243d,null));};exports['addSections']=function(_0x595814,_0x418d48){var _0xbc9f88=_0x595814[_0x2203('0x46')];return db[_0x2203('0x2c')][_0x2203('0x48')]({'where':{'id':_0x595814[_0x2203('0x43')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x418d48,null))[_0x2203('0x24')](function(_0x56dcbe){if(_0x56dcbe){return db['sequelize'][_0x2203('0x4e')](function(_0x8f8648){return db[_0x2203('0x4f')][_0x2203('0x25')]({'where':{'userProfileId':_0x595814[_0x2203('0x43')]['id'],'sectionId':_[_0x2203('0x2b')](_0xbc9f88,function(_0x45cc3a){return _0x45cc3a[_0x2203('0x52')];})},'transaction':_0x8f8648})[_0x2203('0x24')](function(){var _0x231bf1=_[_0x2203('0x2b')](_0xbc9f88,function(_0xf16e1d){_0xf16e1d[_0x2203('0x53')]=_0x595814[_0x2203('0x43')]['id'];return _0xf16e1d;});var _0x288786=[];return BPromise[_0x2203('0x50')](_0x231bf1,function(_0x3fe739){return db[_0x2203('0x4f')][_0x2203('0x45')](_0x3fe739,{'include':[{'model':db['UserProfileResource'],'as':_0x2203('0x54')}],'raw':!![],'transaction':_0x8f8648})['then'](function(_0x3382b7){_0x288786['push'](_0x3382b7[_0x2203('0x49')]({'plain':!![]}));});})[_0x2203('0x24')](function(){return _0x288786;});});});}})[_0x2203('0x24')](function(_0x2f3522){return _0x2f3522;})[_0x2203('0x24')](respondWithResult(_0x418d48,null))[_0x2203('0x41')](handleError(_0x418d48,null));};exports[_0x2203('0x56')]=function(_0x2eab08,_0x4e9a01){var _0x4cd079;return db[_0x2203('0x2c')][_0x2203('0x48')]({'where':{'id':_0x2eab08[_0x2203('0x43')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x4e9a01,null))['then'](function(_0xdff006){if(_0xdff006){_0x4cd079=_0xdff006;return db[_0x2203('0x4f')][_0x2203('0x25')]({'where':{'userProfileId':_0x2eab08[_0x2203('0x43')]['id'],'sectionId':_0x2eab08['query'][_0x2203('0x57')]}});}})['then'](function(){return _0x4cd079;})[_0x2203('0x24')](respondWithStatusCode(_0x4e9a01,null))[_0x2203('0x41')](handleError(_0x4e9a01,null));};exports[_0x2203('0x58')]=function(_0x36106b,_0xf8584f){var _0x56c79a=[];var _0x4592fa=[];return db[_0x2203('0x4f')][_0x2203('0x3f')]({'where':{'userProfileId':_0x36106b['params']['id']},'raw':!![]})[_0x2203('0x24')](function(_0x45d235){_0x56c79a=_[_0x2203('0x3c')](_0x45d235,function(_0xd76624){return _0xd76624[_0x2203('0x59')]===0x1||_[_0x2203('0x5a')]([0x3eb,0x709],_0xd76624[_0x2203('0x52')]);});if(!_[_0x2203('0x5b')](_0x56c79a)){return _[_0x2203('0x2b')](_0x56c79a,function(_0xc05f28){return _0xc05f28[_0x2203('0x52')];});}else{return;}})['then'](function(_0x1adfa6){if(_0x1adfa6)_0x4592fa=_0x1adfa6;if(_[_0x2203('0x5a')](_0x4592fa,0x64)){var _0x21b755=_[_0x2203('0x48')](_0x56c79a,{'sectionId':0x64});return hasDefaultDashboard(_0x21b755)[_0x2203('0x24')](function(_0x52c35e){return _[_0x2203('0x2b')](_0x56c79a,function(_0x2a5a4b){if(_0x2a5a4b[_0x2203('0x52')]===0x64){_0x2a5a4b[_0x2203('0x5c')]=_0x52c35e;}return _0x2a5a4b;});});}else{return;}})[_0x2203('0x24')](function(_0x1cc668){if(_0x1cc668)_0x56c79a=_0x1cc668;if(_['includes'](_0x4592fa,0x3eb)){var _0x568722=_[_0x2203('0x48')](_0x56c79a,{'sectionId':0x3eb});return getCustomDashboards(_0x568722)[_0x2203('0x24')](function(_0x381fc8){return _[_0x2203('0x2b')](_0x56c79a,function(_0x42dce6){if(_0x568722['enabled']){if(_0x42dce6[_0x2203('0x52')]===0x3eb){_0x42dce6[_0x2203('0x5c')]=_0x381fc8;}}else{if(_0x42dce6['sectionId']===0x64){_0x42dce6['subsections']=_0x381fc8;}}return _0x42dce6;});});}else{return;}})['then'](function(_0x4fc51a){if(_0x4fc51a)_0x56c79a=_0x4fc51a;if(_['includes'](_0x4592fa,0x709)){var _0x2952fc=_[_0x2203('0x48')](_0x56c79a,{'sectionId':0x709});return getPlugins(_0x2952fc)[_0x2203('0x24')](function(_0x49fd02){if(_0x2952fc['enabled']){return _['map'](_0x56c79a,function(_0x1e1969){if(_0x1e1969[_0x2203('0x52')]===0x709){_0x1e1969[_0x2203('0x5c')]=_0x49fd02;}return _0x1e1969;});}else{var _0x2af54b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x49fd02};var _0x369728=_[_0x2203('0x2b')](_0x56c79a);_0x369728[_0x2203('0x5d')](_0x2af54b);return _0x369728;}});}else{return;}})['then'](function(_0x3bf2c9){if(_0x3bf2c9)_0x56c79a=_0x3bf2c9;return _[_0x2203('0x3c')](_0x56c79a,[_0x2203('0x59'),0x1]);})[_0x2203('0x24')](respondWithResult(_0xf8584f,null))[_0x2203('0x41')](handleError(_0xf8584f,null));};function hasDefaultDashboard(_0x35d508){var _0x13e11f=[0x65];return new BPromise(function(_0x57c409,_0x188722){try{if(_0x35d508['autoAssociation']){_0x57c409(_0x13e11f);}else{return db['UserProfileResource'][_0x2203('0x5e')]({'where':{'sectionId':_0x35d508['id']},'raw':!![]})['then'](function(_0xb9588e){_0xb9588e?_0x57c409(_0x13e11f):_0x57c409();});}}catch(_0x39e7b9){_0x188722(_0x39e7b9);}});}function getCustomDashboards(_0x4c7ea2){var _0x29d545=[];return new BPromise(function(_0x24fad2,_0x1337a4){try{if(_0x4c7ea2[_0x2203('0x51')]){return db[_0x2203('0x5f')][_0x2203('0x3f')]({'raw':!![]})['then'](function(_0x215638){_0x215638[_0x2203('0x60')](function(_0x524b43){_0x29d545['push'](_0x524b43['id']+0x1869f);});_0x24fad2(_0x29d545);});}else{return db[_0x2203('0x55')][_0x2203('0x3f')]({'where':{'sectionId':_0x4c7ea2['id']},'raw':!![]})[_0x2203('0x24')](function(_0xa88b4f){_0xa88b4f[_0x2203('0x60')](function(_0x29d9de){_0x29d545[_0x2203('0x5d')](_0x29d9de[_0x2203('0x61')]+0x1869f);});_0x24fad2(_0x29d545);});}}catch(_0x4749df){_0x1337a4(_0x4749df);}});}function getPlugins(_0x2bfa45){var _0x74d185=[];return new BPromise(function(_0x413729,_0xf21b3c){try{if(_0x2bfa45[_0x2203('0x51')]){return db[_0x2203('0x62')][_0x2203('0x3f')]({'raw':!![]})['then'](function(_0x4e2d30){_0x4e2d30[_0x2203('0x60')](function(_0x1295a3){_0x74d185['push'](_0x1295a3['id']+0x15b38);});_0x413729(_0x74d185);});}else{return db[_0x2203('0x55')][_0x2203('0x3f')]({'where':{'sectionId':_0x2bfa45['id']},'raw':!![]})['then'](function(_0x54014d){_0x54014d[_0x2203('0x60')](function(_0x57ccf8){_0x74d185[_0x2203('0x5d')](_0x57ccf8[_0x2203('0x61')]+0x15b38);});_0x413729(_0x74d185);});}}catch(_0x541639){_0xf21b3c(_0x541639);}});}exports[_0x2203('0x63')]=function(_0x1c4b57,_0x3cfe3f){return db[_0x2203('0x2c')]['find']({'where':{'id':_0x1c4b57['params']['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x3cfe3f,null))[_0x2203('0x24')](function(_0x288980){if(_0x288980){return db['sequelize']['transaction'](function(_0x8df62d){return db[_0x2203('0x4f')][_0x2203('0x3f')]({'where':{'userProfileId':_0x1c4b57['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xa19bb7){if(_0xa19bb7){return db[_0x2203('0x4f')]['destroy']({'where':{'userProfileId':_0x1c4b57[_0x2203('0x43')]['id'],'id':_[_0x2203('0x2b')](_0xa19bb7,function(_0x5988ba){return _0x5988ba['id'];})},'transaction':_0x8df62d});}})[_0x2203('0x24')](function(_0x5c0dc8){var _0x1feca9=_['map'](_0x1c4b57['body'],function(_0x56a4b1){_0x56a4b1[_0x2203('0x53')]=_0x1c4b57[_0x2203('0x43')]['id'];return _0x56a4b1;});return db['UserProfileSection'][_0x2203('0x64')](_0x1feca9,{'raw':!![],'transaction':_0x8df62d});})[_0x2203('0x24')](function(_0x47215d){var _0x560112=_[_0x2203('0x3c')](_['map'](_0x47215d,function(_0x3f31e0){return _0x3f31e0[_0x2203('0x49')]({'plain':!![]});}),{'includeAll':![]});if(_0x560112){return db['UserProfileSection'][_0x2203('0x3f')]({'where':{'userProfileId':_0x1c4b57[_0x2203('0x43')]['id'],'sectionId':_['map'](_0x560112,function(_0x2e4d03){return _0x2e4d03[_0x2203('0x52')];})},'attributes':['id',_0x2203('0x52')],'raw':!![]})[_0x2203('0x24')](function(_0x34c8aa){var _0x5d73a7=_[_0x2203('0x2b')](_0x1c4b57[_0x2203('0x46')],function(_0xbfb7ad){_0xbfb7ad[_0x2203('0x53')]=_0x1c4b57[_0x2203('0x43')]['id'];return _0xbfb7ad;});return db[_0x2203('0x55')]['bulkCreate'](_0x5d73a7,{'raw':!![],'transaction':_0x8df62d});});}})[_0x2203('0x41')](handleError(_0x3cfe3f,null));});}})[_0x2203('0x24')](function(_0x49ebb9){var _0x13fc7b=_['map'](_0x49ebb9,function(_0x1f8015){return _0x1f8015[_0x2203('0x49')]({'plain':!![]});});})[_0x2203('0x24')](respondWithResult(_0x3cfe3f,null))['catch'](handleError(_0x3cfe3f,null));};exports[_0x2203('0x65')]=function(_0x41cf86,_0x1113d0,_0x139156){return db[_0x2203('0x2c')][_0x2203('0x48')]({'where':{'id':_0x41cf86[_0x2203('0x43')]['id']}})['then'](handleEntityNotFound(_0x1113d0,null))['then'](function(_0x106534){if(_0x106534){return _0x106534[_0x2203('0x65')](_0x41cf86[_0x2203('0x2f')][_0x2203('0x57')]);}})[_0x2203('0x24')](respondWithStatusCode(_0x1113d0,null))[_0x2203('0x41')](handleError(_0x1113d0,null));};exports[_0x2203('0x66')]=function(_0x500604,_0x2c2890){var _0x7b699b={};if(!_0x500604['query'][_0x2203('0x67')])throw new Error('Missing\x20section\x20parameter');if(!_0x500604[_0x2203('0x2f')][_0x2203('0x68')]('nolimit')){_0x7b699b[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x500604[_0x2203('0x2f')][_0x2203('0x1d')]);_0x7b699b[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x500604[_0x2203('0x2f')][_0x2203('0x1c')]);}return db[_0x2203('0x2c')][_0x2203('0x48')]({'where':{'id':_0x500604[_0x2203('0x43')]['id']}})[_0x2203('0x24')](function(_0x4e7ba1){if(!_0x4e7ba1)throw new Error(_0x2203('0x69')+_0x500604['params']['id']);return db[_0x2203('0x2c')][_0x2203('0x66')](_0x500604);})[_0x2203('0x24')](respondWithFilteredResult(_0x2c2890,_0x7b699b))[_0x2203('0x41')](handleError(_0x2c2890,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index dc8fa30..44276d0 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 _0x32f4=['update','remove','emit','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x1b6d24,_0xbeac70){var _0x4ba12e=function(_0x1c4882){while(--_0x1c4882){_0x1b6d24['push'](_0x1b6d24['shift']());}};_0x4ba12e(++_0xbeac70);}(_0x32f4,0x154));var _0x432f=function(_0x3ef7f3,_0x31ed2f){_0x3ef7f3=_0x3ef7f3-0x0;var _0x3eca60=_0x32f4[_0x3ef7f3];return _0x3eca60;};'use strict';var EventEmitter=require(_0x432f('0x0'));var UserProfile=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x432f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x432f('0x4'),'afterDestroy':_0x432f('0x5')};function emitEvent(_0x51a71a){return function(_0x354293,_0x1eabac,_0x344a29){UserProfileEvents[_0x432f('0x6')](_0x51a71a+':'+_0x354293['id'],_0x354293);UserProfileEvents[_0x432f('0x6')](_0x51a71a,_0x354293);_0x344a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x432f('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x5464=['../../mysqldb','UserProfile','save','remove','emit','exports','events'];(function(_0x380b50,_0x1a1b84){var _0x484887=function(_0x197273){while(--_0x197273){_0x380b50['push'](_0x380b50['shift']());}};_0x484887(++_0x1a1b84);}(_0x5464,0x15d));var _0x4546=function(_0x375064,_0x569c46){_0x375064=_0x375064-0x0;var _0x20037a=_0x5464[_0x375064];return _0x20037a;};'use strict';var EventEmitter=require(_0x4546('0x0'));var UserProfile=require(_0x4546('0x1'))['db'][_0x4546('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4546('0x3'),'afterUpdate':'update','afterDestroy':_0x4546('0x4')};function emitEvent(_0x5a3f9d){return function(_0x320c4d,_0x396a1d,_0xcc9def){UserProfileEvents[_0x4546('0x5')](_0x5a3f9d+':'+_0x320c4d['id'],_0x320c4d);UserProfileEvents['emit'](_0x5a3f9d,_0x320c4d);_0xcc9def(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x4546('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 c4f134a..f84b924 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 _0x1cca=['openchannelaccounts','smsqueues','SmsQueue','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','queuecampaigns','users','agents','telephones','User','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','tags','Template','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','toString','OpenTabs','UserProfile','user_profiles','query','section','mergeResources','length','push','UserProfileSection','find','params','all','ignore','isEmpty','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','key','VIRTUAL','foreignKey','merge','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tag','Tags','color','ThroughTags','tag','openTabs','chat','dataValues','sms','fax','mail','openchannel','lodash','exports','filter','field','value','then','map','catch','model','findAll','associatedResources','UserProfileResource','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','name','projectName','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','FaxQueue','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x1cca,0x12d));var _0xa1cc=function(_0x3cf7f6,_0x34a4fc){_0x3cf7f6=_0x3cf7f6-0x0;var _0x1c2320=_0x1cca[_0x3cf7f6];return _0x1c2320;};'use strict';var _=require(_0xa1cc('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');module[_0xa1cc('0x1')]=function(_0xc6bbdd){var _0x5169f8=_0xc6bbdd['models'];function _0x1bab4a(_0x300197,_0x4a98da){return new Promise(function(_0x58535b,_0x59894a){if(!_0x4a98da)return _0x58535b(null);var _0x3e804d=_0x4a98da[_0xa1cc('0x2')]?{[_0x4a98da[_0xa1cc('0x2')][_0xa1cc('0x3')]]:_0x4a98da[_0xa1cc('0x2')][_0xa1cc('0x4')]}:undefined;return _0x5169f8[_0x300197]['findAll']({'where':_0x3e804d,'raw':!![]})[_0xa1cc('0x5')](function(_0x438bde){_0x4a98da['associatedResources']=_[_0xa1cc('0x6')](_0x438bde,'id');_0x58535b(_0x4a98da);})[_0xa1cc('0x7')](function(_0x4cbdfb){_0x59894a(_0x4cbdfb);});});}function _0x5ab829(_0x63efc0,_0x3e3b51){return new Promise(function(_0x2f2670,_0x33298f){var _0x4e079b=_0x63efc0[_0xa1cc('0x2')]?{[_0x63efc0[_0xa1cc('0x2')][_0xa1cc('0x3')]]:_0x63efc0['filter']['value']}:undefined;return _0x5169f8[_0x63efc0[_0xa1cc('0x8')]][_0xa1cc('0x9')]({'where':_0x4e079b,'raw':!![]})[_0xa1cc('0x5')](function(_0x51d575){_0x3e3b51[_0xa1cc('0xa')]=_[_0xa1cc('0x6')](_0x51d575,function(_0x5f925c){return _0x5f925c['name'];});_0x2f2670(_0x3e3b51);})[_0xa1cc('0x7')](function(_0x382352){_0x33298f(_0x382352);});});}function _0x1e8f73(_0x5e6764,_0x46c553,_0x12dde8){if(!_0x46c553)return resolve(null);return new Promise(function(_0x281e6f,_0x5512de){return _0x5169f8[_0xa1cc('0xb')][_0xa1cc('0x9')]({'where':{'sectionId':_0x46c553['id']},'raw':!![]})[_0xa1cc('0x5')](function(_0x5a6c9f){if(_0x5e6764[_0xa1cc('0x3')]&&_0x5e6764[_0xa1cc('0x3')]!=='id'){_0x46c553[_0xa1cc('0xa')]=_[_0xa1cc('0x6')](_0x5a6c9f,function(_0x4eb860){return _0x4eb860[_0x5e6764[_0xa1cc('0x3')]];});}else{if(_0x12dde8===_0xa1cc('0xc')){_0x46c553['associatedResources']=_[_0xa1cc('0x6')](_0x5a6c9f,function(_0x26c3f7){return{'id':_0x26c3f7['resourceId'],'type':_0x26c3f7[_0xa1cc('0xd')]};});}else{_0x46c553[_0xa1cc('0xa')]=_[_0xa1cc('0x6')](_0x5a6c9f,function(_0x532c8d){return _0x532c8d[_0xa1cc('0xe')];});}}_0x281e6f(_0x46c553);})[_0xa1cc('0x7')](function(_0xc7dd6c){_0x5512de(_0xc7dd6c);});});}function _0x32fa32(_0x318544,_0x213b32){var _0x51b90f={'parentSections':[]};switch(_0x318544['toLowerCase']()){case _0xa1cc('0xf'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x11');break;case _0xa1cc('0x12'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x13');break;case _0xa1cc('0x14'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x15');_0x51b90f['parentSections']=[{'name':_0xa1cc('0x16'),'field':_0xa1cc('0x17'),'foreignKey':_0xa1cc('0x18')}];break;case'projects':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x19');break;case _0xa1cc('0x1a'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x1b');_0x51b90f[_0xa1cc('0x1c')]=[{'name':_0xa1cc('0x1d'),'field':'id','foreignKey':_0xa1cc('0x1e')}];break;case _0xa1cc('0x1f'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x20');break;case'companies':_0x51b90f[_0xa1cc('0x10')]='CmCompany';break;case _0xa1cc('0x21'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x22');break;case _0xa1cc('0x23'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x24');break;case'chatwebsites':_0x51b90f[_0xa1cc('0x10')]='ChatWebsite';break;case _0xa1cc('0x25'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x26');break;case'faxaccounts':_0x51b90f[_0xa1cc('0x10')]='FaxAccount';break;case _0xa1cc('0x27'):case _0xa1cc('0x28'):case _0xa1cc('0x29'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x2a');break;case _0xa1cc('0x2b'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x2c');break;case _0xa1cc('0x2d'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x2e');break;case _0xa1cc('0x2f'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x30');_0x51b90f[_0xa1cc('0x1c')]=[{'name':_0xa1cc('0x31'),'field':_0xa1cc('0x17'),'foreignKey':_0xa1cc('0x32'),'model':'User','filter':{'field':_0xa1cc('0x33'),'value':[_0xa1cc('0x34')]}},{'name':_0xa1cc('0x35'),'field':_0xa1cc('0x17'),'foreignKey':_0xa1cc('0x32'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0xa1cc('0x36'),'field':_0xa1cc('0x17'),'foreignKey':_0xa1cc('0x37'),'model':_0xa1cc('0x38'),'filter':{'field':'type','value':[_0xa1cc('0x39')]}},{'name':'QueueCampaigns','field':_0xa1cc('0x17'),'foreignKey':_0xa1cc('0x37'),'model':_0xa1cc('0x38'),'filter':{'field':'type','value':[_0xa1cc('0x3a')]}}];break;case _0xa1cc('0x3b'):_0x51b90f[_0xa1cc('0x10')]='VoiceMusicOnHold';break;case _0xa1cc('0x3c'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x3d');break;case _0xa1cc('0x3e'):_0x51b90f[_0xa1cc('0x10')]='VoicePrefix';break;case _0xa1cc('0x3f'):_0x51b90f['childModel']='Campaign';break;case'mailqueues':_0x51b90f[_0xa1cc('0x10')]='MailQueue';break;case'mailaccounts':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x40');break;case _0xa1cc('0x41'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x42');break;case _0xa1cc('0x43'):_0x51b90f['childModel']=_0xa1cc('0x44');break;case _0xa1cc('0x45'):_0x51b90f[_0xa1cc('0x10')]='OpenchannelAccount';break;case _0xa1cc('0x46'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x47');break;case'smsaccounts':_0x51b90f[_0xa1cc('0x10')]='SmsAccount';break;case'whatsappqueues':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x48');break;case _0xa1cc('0x49'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x4a');break;case'teams':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x4b');break;case'voicequeues':case _0xa1cc('0x4c'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x38');if(_0x213b32){_0x51b90f[_0xa1cc('0x1c')]=[{'name':_0xa1cc('0x36')},{'name':'QueueCampaigns'}];}break;case _0xa1cc('0x4d'):case _0xa1cc('0x4e'):case _0xa1cc('0x4f'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x50');if(_0x213b32){_0x51b90f[_0xa1cc('0x1c')]=[{'name':_0xa1cc('0x51'),'filter':{'field':_0xa1cc('0x33'),'value':[_0xa1cc('0x52'),_0xa1cc('0x53')]},'ignore':!![]},{'name':_0xa1cc('0x31')},{'name':_0xa1cc('0x35')}];}break;case _0xa1cc('0x54'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x55');break;case _0xa1cc('0x56'):_0x51b90f[_0xa1cc('0x10')]='SalesforceAccount';break;case _0xa1cc('0x57'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x58');break;case _0xa1cc('0x59'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x5a');break;case _0xa1cc('0x5b'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x5c');break;case _0xa1cc('0x5d'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x5e');break;case _0xa1cc('0x5f'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x50');break;case _0xa1cc('0x60'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x61');break;case _0xa1cc('0x62'):_0x51b90f['childModel']=_0xa1cc('0x63');break;case'customdashboards':_0x51b90f['childModel']=_0xa1cc('0x64');break;case _0xa1cc('0x65'):_0x51b90f[_0xa1cc('0x10')]='Interval';break;case _0xa1cc('0x66'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x67');break;case'scheduler':_0x51b90f['childModel']=_0xa1cc('0x68');break;case _0xa1cc('0x69'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x6a');break;case _0xa1cc('0x6b'):_0x51b90f[_0xa1cc('0x10')]='Tag';break;case'templates':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x6c');break;case'triggers':_0x51b90f[_0xa1cc('0x10')]='Trigger';break;case _0xa1cc('0x6d'):_0x51b90f['childModel']=_0xa1cc('0x6e');break;case _0xa1cc('0x6f'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x70');break;case _0xa1cc('0x71'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x72');break;case'extractedreports':_0x51b90f[_0xa1cc('0x10')]='AnalyticExtractedReport';_0x51b90f[_0xa1cc('0x1c')]=[{'name':_0xa1cc('0x73'),'field':'id','foreignKey':_0xa1cc('0x74')}];break;case'metrics':_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x75');break;case _0xa1cc('0x49'):_0x51b90f[_0xa1cc('0x10')]=_0xa1cc('0x4a');break;}return _0x51b90f;}function _0x441ea2(_0x57d616,_0x1a8d59){var _0x2a39ab=_0x57d616[_0xa1cc('0x76')](0x0)[_0xa1cc('0x77')]()+_0x57d616[_0xa1cc('0x78')](0x1);var _0x5d2484={'type':_0x5169f8['Sequelize'][_0xa1cc('0x79')][_0xa1cc('0x7a')],'raw':!![]};return new BPromise(function(_0x55ff6f,_0x52b6ef){var _0x2d4651=squel[_0xa1cc('0x7b')]()[_0xa1cc('0x3')](_0xa1cc('0x7c')+_0x2a39ab+_0xa1cc('0x7d'),'id')['field'](_0xa1cc('0x7e'))[_0xa1cc('0x7f')](_0xa1cc('0x80')+_0x57d616+_0xa1cc('0x81'),'ui')[_0xa1cc('0x82')]('ui.UserId\x20=\x20?',_0x1a8d59['id']);return _0x5169f8['sequelize']['query'](_0x2d4651[_0xa1cc('0x83')](),_0x5d2484)[_0xa1cc('0x5')](function(_0x341c20){_0x1a8d59[_0x2a39ab+_0xa1cc('0x84')]=_0x341c20;_0x55ff6f(_0x341c20);})[_0xa1cc('0x7')](function(_0x25ad8a){_0x52b6ef(_0x25ad8a);});});}return _0xc6bbdd['define'](_0xa1cc('0x85'),attributes,{'tableName':_0xa1cc('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1e33a9){var _0x376e3b={'raw':![],'where':{}};var _0x5c220a={};var _0x1b8d56={'count':0x0,'rows':[]};var _0x39bea5=_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x88')];var _0x15d650=_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x89')]||![];var _0x2574c5=_0x32fa32(_0x39bea5,_0x15d650);if(!_0x2574c5[_0xa1cc('0x10')])throw new Error('Invalid\x20section\x20\x27'+_0x39bea5+'\x27');var _0x3cb8b0=[{'name':_0x39bea5}];if(!_['isEmpty'](_0x2574c5[_0xa1cc('0x1c')]))_0x3cb8b0=_0x2574c5[_0xa1cc('0x1c')];var _0x55866a=[];for(var _0x4adfb4=0x0;_0x4adfb4<_0x3cb8b0[_0xa1cc('0x8a')];_0x4adfb4++){_0x55866a[_0xa1cc('0x8b')](_0x5169f8[_0xa1cc('0x8c')][_0xa1cc('0x8d')]({'where':{'userProfileId':_0x1e33a9[_0xa1cc('0x8e')]['id'],'name':_0x3cb8b0[_0x4adfb4][_0xa1cc('0x17')]},'raw':!![]}));}return Promise[_0xa1cc('0x8f')](_0x55866a)['then'](function(_0x552ccd){var _0x2680cf=_['filter'](_0x552ccd,function(_0x26ae1b){return _0x26ae1b?_0x26ae1b:undefined;});var _0x228246=_['filter'](_0x3cb8b0,[_0xa1cc('0x90'),!![]]);var _0x449b65=_[_0xa1cc('0x91')](_0x2680cf)&&_[_0xa1cc('0x91')](_0x228246)?null:_['union'](_0x228246,_0x2680cf);if(!_0x449b65)return null;var _0x381d4b=[];for(var _0x1e49b7=0x0;_0x1e49b7<_0x449b65[_0xa1cc('0x8a')];_0x1e49b7++){var _0x479604=_[_0xa1cc('0x8d')](_0x3cb8b0,function(_0x19cf48){return _0x449b65[_0x1e49b7]?_0x19cf48['name']===_0x449b65[_0x1e49b7][_0xa1cc('0x17')]:null;});if(_0x479604){if(_0x449b65[_0x1e49b7][_0xa1cc('0x90')]){_0x381d4b[_0xa1cc('0x8b')](_0x1bab4a(_0x2574c5[_0xa1cc('0x10')],_0x449b65[_0x1e49b7]));}else{if(!_0x449b65[_0x1e49b7][_0xa1cc('0x92')]){_0x381d4b[_0xa1cc('0x8b')](_0x1e8f73(_0x479604,_0x449b65[_0x1e49b7],_0x2574c5[_0xa1cc('0x10')]));}else{if(_0x479604[_0xa1cc('0x8')]){_0x381d4b[_0xa1cc('0x8b')](_0x5ab829(_0x479604,_0x449b65[_0x1e49b7]));}}}}}return Promise[_0xa1cc('0x8f')](_0x381d4b);})['then'](function(_0x5efb11){var _0x5c36d9=_0x5efb11;var _0x165e22=null;if(_0x5c36d9){_0x165e22=_0x5c36d9[_0xa1cc('0x8a')]===0x1?_0x5c36d9[0x0]:null;}if(!_0x165e22&&!_0x5c36d9)return _0x1b8d56;var _0x5ca3f0=_0x5169f8[_0x2574c5[_0xa1cc('0x10')]][_0xa1cc('0x93')];_0x5c220a[_0xa1cc('0x8')]=_[_0xa1cc('0x94')](_0x5ca3f0);_0x5c220a[_0xa1cc('0x87')]=_[_0xa1cc('0x94')](_0x1e33a9[_0xa1cc('0x87')]);_0x5c220a[_0xa1cc('0x95')]=_[_0xa1cc('0x96')](_0x5c220a['model'],_0x5c220a[_0xa1cc('0x87')]);_0x376e3b[_0xa1cc('0x97')]=_[_0xa1cc('0x96')](_0x5c220a[_0xa1cc('0x8')],qs['fields'](_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x98')]));_0x376e3b[_0xa1cc('0x97')]=_0x376e3b['attributes'][_0xa1cc('0x8a')]?_0x376e3b[_0xa1cc('0x97')]:_0x5c220a[_0xa1cc('0x8')];if(!_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x99')](_0xa1cc('0x9a'))){_0x376e3b[_0xa1cc('0x9b')]=qs[_0xa1cc('0x9b')](_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x9b')]);_0x376e3b[_0xa1cc('0x9c')]=qs[_0xa1cc('0x9c')](_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x9c')]);}_0x376e3b['order']=qs[_0xa1cc('0x9d')](_0x1e33a9[_0xa1cc('0x87')]['sort']);_0x376e3b[_0xa1cc('0x82')]=qs[_0xa1cc('0x95')](_['pick'](_0x1e33a9[_0xa1cc('0x87')],_0x5c220a[_0xa1cc('0x95')]));if(_0x1e33a9[_0xa1cc('0x87')]['filter']){_0x376e3b[_0xa1cc('0x82')]=_['merge'](_0x376e3b[_0xa1cc('0x82')],{'$or':_['map'](_0x5ca3f0,function(_0x2024f1){if(_0x2024f1[_0xa1cc('0xd')][_0xa1cc('0x9e')]!==_0xa1cc('0x9f')){var _0x497acd={};_0x497acd[_0x2024f1[_0xa1cc('0x3')]]={'$like':'%'+_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0x2')]+'%'};return _0x497acd;}})});}var _0x305053=[];if(_0x165e22){var _0x33c8d8=_[_0xa1cc('0x8d')](_0x3cb8b0,['name',_0x165e22[_0xa1cc('0x17')]]);if(_0x33c8d8[_0xa1cc('0x3')]){var _0x2c087c={};if(_0x2574c5['childModel']==='AnalyticExtractedReport'){_0x2c087c[_0x33c8d8[_0xa1cc('0xa0')]]=_[_0xa1cc('0x6')](_0x165e22[_0xa1cc('0xa')],'id');}else{_0x2c087c[_0x33c8d8[_0xa1cc('0xa0')]]=_0x165e22[_0xa1cc('0xa')];}_0x305053[_0xa1cc('0x8b')](_0x2c087c);}else{_0x376e3b[_0xa1cc('0x82')]['id']=_0x165e22[_0xa1cc('0xa')];}}else{for(var _0x580a2d=0x0;_0x580a2d<_0x5c36d9[_0xa1cc('0x8a')];_0x580a2d++){var _0x33c8d8=_[_0xa1cc('0x8d')](_0x3cb8b0,[_0xa1cc('0x17'),_0x5c36d9[_0x580a2d][_0xa1cc('0x17')]]);if(_0x33c8d8[_0xa1cc('0x3')]){var _0x2c087c={};_0x2c087c[_0x33c8d8[_0xa1cc('0xa0')]]=_0x5c36d9[_0x580a2d][_0xa1cc('0xa')];_0x305053[_0xa1cc('0x8b')](_0x2c087c);}else{if(!_0x376e3b[_0xa1cc('0x82')]['id'])_0x376e3b[_0xa1cc('0x82')]['id']=[];_0x5c36d9[_0x580a2d][_0xa1cc('0xa')]['forEach'](function(_0x4d1abf){_0x376e3b[_0xa1cc('0x82')]['id'][_0xa1cc('0x8b')](_0x4d1abf);});}}}if(!_[_0xa1cc('0x91')](_0x305053)){_0x376e3b[_0xa1cc('0x82')]=_[_0xa1cc('0xa1')](_0x376e3b[_0xa1cc('0x82')],{'$and':{'$or':_0x305053}});}_0x376e3b=_['merge']({},_0x376e3b,_0x1e33a9[_0xa1cc('0xa2')]);if(_0x165e22&&!_0x165e22['autoAssociation']&&_0x2574c5['childModel']===_0xa1cc('0xc')){if(_0x1e33a9['query'][_0xa1cc('0xa3')]){_0x376e3b[_0xa1cc('0xa4')]=[{'all':!![]}];}return _0x5169f8[_0x2574c5[_0xa1cc('0x10')]][_0xa1cc('0x9')](_0x376e3b)[_0xa1cc('0x5')](function(_0x24e2f4){var _0x33e109=[];_0x24e2f4[_0xa1cc('0xa5')](function(_0x5ad61f){var _0x48705e;switch(_0x5ad61f[_0xa1cc('0xa6')]){case _0xa1cc('0xa7'):_0x48705e=_[_0xa1cc('0x8d')](_0x165e22[_0xa1cc('0xa')],function(_0x29c519){return _0x29c519['id']===_0x5ad61f['reportId']&&_0x29c519['type']===_0xa1cc('0xa8');});break;case _0xa1cc('0xa9'):_0x48705e=_[_0xa1cc('0x8d')](_0x165e22[_0xa1cc('0xa')],function(_0x580baa){return _0x580baa['id']===_0x5ad61f[_0xa1cc('0x74')]&&_0x580baa['type']===_0xa1cc('0xaa');});break;}if(_0x48705e)_0x33e109[_0xa1cc('0x8b')](_0x5ad61f);});_0x1b8d56[_0xa1cc('0xab')]=_0x33e109[_0xa1cc('0x8a')];_0x1b8d56[_0xa1cc('0xac')]=_0x33e109;return _0x1b8d56;});}else{return _0x5169f8[_0x2574c5[_0xa1cc('0x10')]][_0xa1cc('0xab')]({'where':_0x376e3b[_0xa1cc('0x82')]})[_0xa1cc('0x5')](function(_0x14f9ee){_0x1b8d56['count']=_0x14f9ee;if(_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0xa3')]){if(_0x2574c5[_0xa1cc('0x10')]==='CmContact'){_0x376e3b['include']=[{'model':_0x5169f8[_0xa1cc('0xad')],'as':_0xa1cc('0xae'),'attributes':['id',_0xa1cc('0x17'),_0xa1cc('0xaf')],'required':_0x1e33a9[_0xa1cc('0x87')]['tag']?!![]:![]},{'model':_0x5169f8['Tag'],'as':_0xa1cc('0xb0'),'attributes':['id','name',_0xa1cc('0xaf')],'through':_0x1e33a9['query'][_0xa1cc('0xb1')]?{'attributes':[],'where':{'TagId':_0x1e33a9[_0xa1cc('0x87')]['tag']||undefined}}:{},'required':_0x1e33a9[_0xa1cc('0x87')]['tag']?!![]:![]}];}else{_0x376e3b['include']=[{'all':!![]}];}}return _0x5169f8[_0x2574c5[_0xa1cc('0x10')]][_0xa1cc('0x9')](_0x376e3b);})['then'](function(_0xa10ada){_0x1b8d56[_0xa1cc('0xac')]=_0xa10ada;if(_0x39bea5===_0xa1cc('0x31')&&_0x1e33a9[_0xa1cc('0x87')][_0xa1cc('0xb2')]==='true'){var _0x46f39c=[];for(var _0x21d32f=0x0;_0x21d32f<_0x1b8d56['rows']['length'];_0x21d32f++){_0x46f39c['push'](_0x441ea2(_0xa1cc('0xb3'),_0x1b8d56[_0xa1cc('0xac')][_0x21d32f][_0xa1cc('0xb4')]));_0x46f39c[_0xa1cc('0x8b')](_0x441ea2(_0xa1cc('0xb5'),_0x1b8d56['rows'][_0x21d32f][_0xa1cc('0xb4')]));_0x46f39c[_0xa1cc('0x8b')](_0x441ea2(_0xa1cc('0xb6'),_0x1b8d56['rows'][_0x21d32f][_0xa1cc('0xb4')]));_0x46f39c[_0xa1cc('0x8b')](_0x441ea2(_0xa1cc('0xb7'),_0x1b8d56[_0xa1cc('0xac')][_0x21d32f][_0xa1cc('0xb4')]));_0x46f39c[_0xa1cc('0x8b')](_0x441ea2(_0xa1cc('0xb8'),_0x1b8d56[_0xa1cc('0xac')][_0x21d32f][_0xa1cc('0xb4')]));_0x46f39c[_0xa1cc('0x8b')](_0x441ea2('whatsapp',_0x1b8d56[_0xa1cc('0xac')][_0x21d32f]['dataValues']));}return Promise[_0xa1cc('0x8f')](_0x46f39c)[_0xa1cc('0x5')](function(){return _0x1b8d56;});}return _0x1b8d56;});}});}}});}; \ No newline at end of file +var _0x64eb=['Pause','scheduler','sounds','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','UserProfileSection','params','isEmpty','length','find','autoAssociation','all','rawAttributes','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','key','VIRTUAL','foreignKey','push','forEach','merge','options','includeAll','reportType','default','DefaultReports','custom','CustomReports','count','rows','include','Tags','color','tag','openTabs','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','UserProfileResource','AnalyticExtractedReport','type','resourceId','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','Agents','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses'];(function(_0x1812d2,_0x53aac7){var _0x1175a2=function(_0x28f464){while(--_0x28f464){_0x1812d2['push'](_0x1812d2['shift']());}};_0x1175a2(++_0x53aac7);}(_0x64eb,0x109));var _0xb64e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x64eb[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb64e('0x0'));var attributes=require(_0xb64e('0x1'));var qs=require(_0xb64e('0x2'));module[_0xb64e('0x3')]=function(_0x2f3986){var _0x35e7e0=_0x2f3986[_0xb64e('0x4')];function _0x208c2a(_0x1b4010,_0x164444){return new Promise(function(_0x14fcd0,_0xdbb9fb){if(!_0x164444)return _0x14fcd0(null);var _0x178dff=_0x164444['filter']?{[_0x164444[_0xb64e('0x5')][_0xb64e('0x6')]]:_0x164444['filter'][_0xb64e('0x7')]}:undefined;return _0x35e7e0[_0x1b4010][_0xb64e('0x8')]({'where':_0x178dff,'raw':!![]})[_0xb64e('0x9')](function(_0x29c3cd){_0x164444[_0xb64e('0xa')]=_[_0xb64e('0xb')](_0x29c3cd,'id');_0x14fcd0(_0x164444);})[_0xb64e('0xc')](function(_0x551184){_0xdbb9fb(_0x551184);});});}function _0x1e03ee(_0x5955c5,_0x5da5b8){return new Promise(function(_0x358aba,_0x37eb14){var _0x2c7e24=_0x5955c5[_0xb64e('0x5')]?{[_0x5955c5[_0xb64e('0x5')][_0xb64e('0x6')]]:_0x5955c5[_0xb64e('0x5')]['value']}:undefined;return _0x35e7e0[_0x5955c5[_0xb64e('0xd')]][_0xb64e('0x8')]({'where':_0x2c7e24,'raw':!![]})[_0xb64e('0x9')](function(_0x48d13b){_0x5da5b8['associatedResources']=_[_0xb64e('0xb')](_0x48d13b,function(_0x3475b4){return _0x3475b4[_0xb64e('0xe')];});_0x358aba(_0x5da5b8);})[_0xb64e('0xc')](function(_0x47627d){_0x37eb14(_0x47627d);});});}function _0x249cb0(_0x176062,_0x1f0948,_0xcb927e){if(!_0x1f0948)return resolve(null);return new Promise(function(_0xe00a28,_0x26426e){return _0x35e7e0[_0xb64e('0xf')][_0xb64e('0x8')]({'where':{'sectionId':_0x1f0948['id']},'raw':!![]})['then'](function(_0x4ea5de){if(_0x176062[_0xb64e('0x6')]&&_0x176062['field']!=='id'){_0x1f0948['associatedResources']=_[_0xb64e('0xb')](_0x4ea5de,function(_0x5c3935){return _0x5c3935[_0x176062[_0xb64e('0x6')]];});}else{if(_0xcb927e===_0xb64e('0x10')){_0x1f0948['associatedResources']=_[_0xb64e('0xb')](_0x4ea5de,function(_0x45c334){return{'id':_0x45c334['resourceId'],'type':_0x45c334[_0xb64e('0x11')]};});}else{_0x1f0948['associatedResources']=_[_0xb64e('0xb')](_0x4ea5de,function(_0x58c21f){return _0x58c21f[_0xb64e('0x12')];});}}_0xe00a28(_0x1f0948);})[_0xb64e('0xc')](function(_0x36d97f){_0x26426e(_0x36d97f);});});}function _0x59f359(_0xc1495c,_0x1b4b4e){var _0x21d49b={'parentSections':[]};switch(_0xc1495c['toLowerCase']()){case'squareprojects':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x14');break;case'odbc':_0x21d49b['childModel']=_0xb64e('0x15');break;case _0xb64e('0x16'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x17');_0x21d49b[_0xb64e('0x18')]=[{'name':_0xb64e('0x19'),'field':'name','foreignKey':_0xb64e('0x1a')}];break;case _0xb64e('0x1b'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x1c');break;case _0xb64e('0x1d'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x1e');_0x21d49b['parentSections']=[{'name':_0xb64e('0x1f'),'field':'id','foreignKey':_0xb64e('0x20')}];break;case'lists':_0x21d49b['childModel']='CmList';break;case _0xb64e('0x21'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x22');break;case _0xb64e('0x23'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x24');break;case _0xb64e('0x25'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x26');break;case _0xb64e('0x27'):_0x21d49b['childModel']='ChatWebsite';break;case'faxqueues':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x28');break;case _0xb64e('0x29'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x2a');break;case _0xb64e('0x2b'):case _0xb64e('0x2c'):case _0xb64e('0x2d'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x2e');break;case _0xb64e('0x2f'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x30');break;case _0xb64e('0x31'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x32');break;case'voicerecordings':_0x21d49b[_0xb64e('0x13')]='VoiceRecording';_0x21d49b[_0xb64e('0x18')]=[{'name':_0xb64e('0x33'),'field':'name','foreignKey':_0xb64e('0x34'),'model':_0xb64e('0x35'),'filter':{'field':_0xb64e('0x36'),'value':['agent']}},{'name':'Telephones','field':_0xb64e('0xe'),'foreignKey':_0xb64e('0x34'),'model':_0xb64e('0x35'),'filter':{'field':'role','value':[_0xb64e('0x37')]}},{'name':_0xb64e('0x38'),'field':_0xb64e('0xe'),'foreignKey':_0xb64e('0x39'),'model':_0xb64e('0x3a'),'filter':{'field':'type','value':[_0xb64e('0x3b')]}},{'name':_0xb64e('0x3c'),'field':_0xb64e('0xe'),'foreignKey':_0xb64e('0x39'),'model':'VoiceQueue','filter':{'field':'type','value':['outbound']}}];break;case _0xb64e('0x3d'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x3e');break;case _0xb64e('0x3f'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x40');break;case'voiceprefixes':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x41');break;case _0xb64e('0x42'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x43');break;case _0xb64e('0x44'):_0x21d49b['childModel']=_0xb64e('0x45');break;case'mailaccounts':_0x21d49b['childModel']='MailAccount';break;case _0xb64e('0x46'):_0x21d49b['childModel']=_0xb64e('0x47');break;case'openchannelqueues':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x48');break;case _0xb64e('0x49'):_0x21d49b[_0xb64e('0x13')]='OpenchannelAccount';break;case'smsqueues':_0x21d49b['childModel']=_0xb64e('0x4a');break;case _0xb64e('0x4b'):_0x21d49b[_0xb64e('0x13')]='SmsAccount';break;case _0xb64e('0x4c'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x4d');break;case _0xb64e('0x4e'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x4f');break;case'teams':_0x21d49b[_0xb64e('0x13')]='Team';break;case _0xb64e('0x50'):case _0xb64e('0x51'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x3a');if(_0x1b4b4e){_0x21d49b[_0xb64e('0x18')]=[{'name':_0xb64e('0x38')},{'name':_0xb64e('0x3c')}];}break;case _0xb64e('0x52'):case _0xb64e('0x53'):case _0xb64e('0x54'):_0x21d49b['childModel']=_0xb64e('0x35');if(_0x1b4b4e){_0x21d49b['parentSections']=[{'name':_0xb64e('0x55'),'filter':{'field':_0xb64e('0x36'),'value':[_0xb64e('0x56'),_0xb64e('0x57')]},'ignore':!![]},{'name':_0xb64e('0x33')},{'name':'Telephones'}];}break;case _0xb64e('0x58'):_0x21d49b['childModel']='ZendeskAccount';break;case _0xb64e('0x59'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x5a');break;case _0xb64e('0x5b'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x5c');break;case'sugarcrmaccounts':_0x21d49b[_0xb64e('0x13')]='SugarcrmAccount';break;case _0xb64e('0x5d'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x5e');break;case'zohoaccounts':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x5f');break;case _0xb64e('0x60'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x35');break;case'cannedanswers':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x61');break;case'dispositions':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x62');break;case _0xb64e('0x63'):_0x21d49b[_0xb64e('0x13')]='Dashboard';break;case _0xb64e('0x64'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x65');break;case _0xb64e('0x66'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x67');break;case _0xb64e('0x68'):_0x21d49b[_0xb64e('0x13')]='Schedule';break;case _0xb64e('0x69'):_0x21d49b[_0xb64e('0x13')]='Sound';break;case _0xb64e('0x6a'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x6b');break;case'templates':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x6c');break;case _0xb64e('0x6d'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x6e');break;case _0xb64e('0x6f'):_0x21d49b['childModel']=_0xb64e('0x70');break;case _0xb64e('0x71'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x72');break;case _0xb64e('0x73'):_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x74');break;case'extractedreports':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x10');_0x21d49b[_0xb64e('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xb64e('0x75')}];break;case'metrics':_0x21d49b[_0xb64e('0x13')]=_0xb64e('0x76');break;case _0xb64e('0x4e'):_0x21d49b['childModel']=_0xb64e('0x4f');break;}return _0x21d49b;}function _0x561988(_0x59498e,_0x120411){var _0x4a89d6=_0x59498e[_0xb64e('0x77')](0x0)[_0xb64e('0x78')]()+_0x59498e['slice'](0x1);var _0x1d4df4={'type':_0x35e7e0[_0xb64e('0x79')][_0xb64e('0x7a')][_0xb64e('0x7b')],'raw':!![]};return new BPromise(function(_0x99779f,_0x16c1b3){var _0x22709f=squel[_0xb64e('0x7c')]()[_0xb64e('0x6')](_0xb64e('0x7d')+_0x4a89d6+_0xb64e('0x7e'),'id')[_0xb64e('0x6')](_0xb64e('0x7f'))['from']('user_has_'+_0x59498e+_0xb64e('0x80'),'ui')['where'](_0xb64e('0x81'),_0x120411['id']);return _0x35e7e0[_0xb64e('0x82')][_0xb64e('0x83')](_0x22709f[_0xb64e('0x84')](),_0x1d4df4)['then'](function(_0xa0b7d0){_0x120411[_0x4a89d6+'OpenTabs']=_0xa0b7d0;_0x99779f(_0xa0b7d0);})[_0xb64e('0xc')](function(_0x4f7a65){_0x16c1b3(_0x4f7a65);});});}return _0x2f3986[_0xb64e('0x85')](_0xb64e('0x86'),attributes,{'tableName':_0xb64e('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3c6be6){var _0xb32084={'raw':![],'where':{}};var _0xcd11f3={};var _0x572db4={'count':0x0,'rows':[]};var _0x591c8d=_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x88')];var _0x4fef4d=_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x89')]||![];var _0x22bb79=_0x59f359(_0x591c8d,_0x4fef4d);if(!_0x22bb79['childModel'])throw new Error(_0xb64e('0x8a')+_0x591c8d+'\x27');var _0x57ce94=[{'name':_0x591c8d}];if(!_['isEmpty'](_0x22bb79[_0xb64e('0x18')]))_0x57ce94=_0x22bb79[_0xb64e('0x18')];var _0x5f3989=[];for(var _0x5e6703=0x0;_0x5e6703<_0x57ce94['length'];_0x5e6703++){_0x5f3989['push'](_0x35e7e0[_0xb64e('0x8b')]['find']({'where':{'userProfileId':_0x3c6be6[_0xb64e('0x8c')]['id'],'name':_0x57ce94[_0x5e6703][_0xb64e('0xe')]},'raw':!![]}));}return Promise['all'](_0x5f3989)['then'](function(_0x2e3a02){var _0x47104e=_['filter'](_0x2e3a02,function(_0x513168){return _0x513168?_0x513168:undefined;});var _0xa84c2d=_[_0xb64e('0x5')](_0x57ce94,['ignore',!![]]);var _0x39291b=_['isEmpty'](_0x47104e)&&_[_0xb64e('0x8d')](_0xa84c2d)?null:_['union'](_0xa84c2d,_0x47104e);if(!_0x39291b)return null;var _0x2fa8b9=[];for(var _0xc5581e=0x0;_0xc5581e<_0x39291b[_0xb64e('0x8e')];_0xc5581e++){var _0x8c5132=_[_0xb64e('0x8f')](_0x57ce94,function(_0x4c8e69){return _0x39291b[_0xc5581e]?_0x4c8e69['name']===_0x39291b[_0xc5581e][_0xb64e('0xe')]:null;});if(_0x8c5132){if(_0x39291b[_0xc5581e]['ignore']){_0x2fa8b9['push'](_0x208c2a(_0x22bb79[_0xb64e('0x13')],_0x39291b[_0xc5581e]));}else{if(!_0x39291b[_0xc5581e][_0xb64e('0x90')]){_0x2fa8b9['push'](_0x249cb0(_0x8c5132,_0x39291b[_0xc5581e],_0x22bb79[_0xb64e('0x13')]));}else{if(_0x8c5132[_0xb64e('0xd')]){_0x2fa8b9['push'](_0x1e03ee(_0x8c5132,_0x39291b[_0xc5581e]));}}}}}return Promise[_0xb64e('0x91')](_0x2fa8b9);})[_0xb64e('0x9')](function(_0x119d33){var _0x3295ba=_0x119d33;var _0x2a88f8=null;if(_0x3295ba){_0x2a88f8=_0x3295ba[_0xb64e('0x8e')]===0x1?_0x3295ba[0x0]:null;}if(!_0x2a88f8&&!_0x3295ba)return _0x572db4;var _0x45754b=_0x35e7e0[_0x22bb79[_0xb64e('0x13')]][_0xb64e('0x92')];_0xcd11f3[_0xb64e('0xd')]=_[_0xb64e('0x93')](_0x45754b);_0xcd11f3[_0xb64e('0x83')]=_[_0xb64e('0x93')](_0x3c6be6['query']);_0xcd11f3['filters']=_[_0xb64e('0x94')](_0xcd11f3['model'],_0xcd11f3[_0xb64e('0x83')]);_0xb32084['attributes']=_[_0xb64e('0x94')](_0xcd11f3[_0xb64e('0xd')],qs[_0xb64e('0x95')](_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x95')]));_0xb32084['attributes']=_0xb32084[_0xb64e('0x96')][_0xb64e('0x8e')]?_0xb32084[_0xb64e('0x96')]:_0xcd11f3[_0xb64e('0xd')];if(!_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x97')](_0xb64e('0x98'))){_0xb32084[_0xb64e('0x99')]=qs[_0xb64e('0x99')](_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x99')]);_0xb32084['offset']=qs[_0xb64e('0x9a')](_0x3c6be6[_0xb64e('0x83')]['offset']);}_0xb32084[_0xb64e('0x9b')]=qs[_0xb64e('0x9c')](_0x3c6be6[_0xb64e('0x83')][_0xb64e('0x9c')]);_0xb32084[_0xb64e('0x9d')]=qs['filters'](_['pick'](_0x3c6be6['query'],_0xcd11f3['filters']));if(_0x3c6be6['query'][_0xb64e('0x5')]){_0xb32084[_0xb64e('0x9d')]=_['merge'](_0xb32084[_0xb64e('0x9d')],{'$or':_[_0xb64e('0xb')](_0x45754b,function(_0x1d714a){if(_0x1d714a['type'][_0xb64e('0x9e')]!==_0xb64e('0x9f')){var _0x311580={};_0x311580[_0x1d714a[_0xb64e('0x6')]]={'$like':'%'+_0x3c6be6[_0xb64e('0x83')]['filter']+'%'};return _0x311580;}})});}var _0x509293=[];if(_0x2a88f8){var _0x57e6bb=_[_0xb64e('0x8f')](_0x57ce94,[_0xb64e('0xe'),_0x2a88f8[_0xb64e('0xe')]]);if(_0x57e6bb[_0xb64e('0x6')]){var _0x5a8bf8={};if(_0x22bb79[_0xb64e('0x13')]===_0xb64e('0x10')){_0x5a8bf8[_0x57e6bb[_0xb64e('0xa0')]]=_[_0xb64e('0xb')](_0x2a88f8[_0xb64e('0xa')],'id');}else{_0x5a8bf8[_0x57e6bb['foreignKey']]=_0x2a88f8['associatedResources'];}_0x509293[_0xb64e('0xa1')](_0x5a8bf8);}else{_0xb32084[_0xb64e('0x9d')]['id']=_0x2a88f8[_0xb64e('0xa')];}}else{for(var _0x1f5dd1=0x0;_0x1f5dd1<_0x3295ba[_0xb64e('0x8e')];_0x1f5dd1++){var _0x57e6bb=_[_0xb64e('0x8f')](_0x57ce94,[_0xb64e('0xe'),_0x3295ba[_0x1f5dd1]['name']]);if(_0x57e6bb[_0xb64e('0x6')]){var _0x5a8bf8={};_0x5a8bf8[_0x57e6bb[_0xb64e('0xa0')]]=_0x3295ba[_0x1f5dd1][_0xb64e('0xa')];_0x509293[_0xb64e('0xa1')](_0x5a8bf8);}else{if(!_0xb32084[_0xb64e('0x9d')]['id'])_0xb32084['where']['id']=[];_0x3295ba[_0x1f5dd1]['associatedResources'][_0xb64e('0xa2')](function(_0xe8c91f){_0xb32084[_0xb64e('0x9d')]['id'][_0xb64e('0xa1')](_0xe8c91f);});}}}if(!_[_0xb64e('0x8d')](_0x509293)){_0xb32084['where']=_[_0xb64e('0xa3')](_0xb32084[_0xb64e('0x9d')],{'$and':{'$or':_0x509293}});}_0xb32084=_[_0xb64e('0xa3')]({},_0xb32084,_0x3c6be6[_0xb64e('0xa4')]);if(_0x2a88f8&&!_0x2a88f8[_0xb64e('0x90')]&&_0x22bb79[_0xb64e('0x13')]===_0xb64e('0x10')){if(_0x3c6be6[_0xb64e('0x83')][_0xb64e('0xa5')]){_0xb32084['include']=[{'all':!![]}];}return _0x35e7e0[_0x22bb79[_0xb64e('0x13')]]['findAll'](_0xb32084)['then'](function(_0x14f4e3){var _0x198564=[];_0x14f4e3[_0xb64e('0xa2')](function(_0x2f0707){var _0x3a1ebc;switch(_0x2f0707[_0xb64e('0xa6')]){case _0xb64e('0xa7'):_0x3a1ebc=_[_0xb64e('0x8f')](_0x2a88f8[_0xb64e('0xa')],function(_0x2c568a){return _0x2c568a['id']===_0x2f0707['reportId']&&_0x2c568a[_0xb64e('0x11')]===_0xb64e('0xa8');});break;case _0xb64e('0xa9'):_0x3a1ebc=_[_0xb64e('0x8f')](_0x2a88f8[_0xb64e('0xa')],function(_0x1adffe){return _0x1adffe['id']===_0x2f0707['reportId']&&_0x1adffe[_0xb64e('0x11')]===_0xb64e('0xaa');});break;}if(_0x3a1ebc)_0x198564[_0xb64e('0xa1')](_0x2f0707);});_0x572db4[_0xb64e('0xab')]=_0x198564[_0xb64e('0x8e')];_0x572db4[_0xb64e('0xac')]=_0x198564;return _0x572db4;});}else{return _0x35e7e0[_0x22bb79[_0xb64e('0x13')]][_0xb64e('0xab')]({'where':_0xb32084[_0xb64e('0x9d')]})[_0xb64e('0x9')](function(_0xfb8c81){_0x572db4['count']=_0xfb8c81;if(_0x3c6be6[_0xb64e('0x83')][_0xb64e('0xa5')]){if(_0x22bb79[_0xb64e('0x13')]===_0xb64e('0x1e')){_0xb32084[_0xb64e('0xad')]=[{'model':_0x35e7e0[_0xb64e('0x6b')],'as':_0xb64e('0xae'),'attributes':['id',_0xb64e('0xe'),_0xb64e('0xaf')],'required':_0x3c6be6['query'][_0xb64e('0xb0')]?!![]:![]},{'model':_0x35e7e0['Tag'],'as':'ThroughTags','attributes':['id',_0xb64e('0xe'),_0xb64e('0xaf')],'through':_0x3c6be6[_0xb64e('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x3c6be6[_0xb64e('0x83')]['tag']||undefined}}:{},'required':_0x3c6be6[_0xb64e('0x83')]['tag']?!![]:![]}];}else{_0xb32084[_0xb64e('0xad')]=[{'all':!![]}];}}return _0x35e7e0[_0x22bb79[_0xb64e('0x13')]]['findAll'](_0xb32084);})[_0xb64e('0x9')](function(_0x49781b){_0x572db4[_0xb64e('0xac')]=_0x49781b;if(_0x591c8d===_0xb64e('0x33')&&_0x3c6be6[_0xb64e('0x83')][_0xb64e('0xb1')]==='true'){var _0x256bd8=[];for(var _0x25be1e=0x0;_0x25be1e<_0x572db4[_0xb64e('0xac')][_0xb64e('0x8e')];_0x25be1e++){_0x256bd8[_0xb64e('0xa1')](_0x561988(_0xb64e('0xb2'),_0x572db4[_0xb64e('0xac')][_0x25be1e][_0xb64e('0xb3')]));_0x256bd8[_0xb64e('0xa1')](_0x561988(_0xb64e('0xb4'),_0x572db4['rows'][_0x25be1e][_0xb64e('0xb3')]));_0x256bd8[_0xb64e('0xa1')](_0x561988(_0xb64e('0xb5'),_0x572db4[_0xb64e('0xac')][_0x25be1e][_0xb64e('0xb3')]));_0x256bd8[_0xb64e('0xa1')](_0x561988(_0xb64e('0xb6'),_0x572db4[_0xb64e('0xac')][_0x25be1e][_0xb64e('0xb3')]));_0x256bd8['push'](_0x561988('openchannel',_0x572db4[_0xb64e('0xac')][_0x25be1e][_0xb64e('0xb3')]));_0x256bd8[_0xb64e('0xa1')](_0x561988(_0xb64e('0xb7'),_0x572db4[_0xb64e('0xac')][_0x25be1e]['dataValues']));}return Promise[_0xb64e('0x91')](_0x256bd8)[_0xb64e('0x9')](function(){return _0x572db4;});}return _0x572db4;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index bab1af1..0bdf299 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 _0x5bc1=['register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x3cd133,_0x222fcb){var _0x2512c8=function(_0x484491){while(--_0x484491){_0x3cd133['push'](_0x3cd133['shift']());}};_0x2512c8(++_0x222fcb);}(_0x5bc1,0xb5));var _0x15bc=function(_0x137154,_0xa22631){_0x137154=_0x137154-0x0;var _0x36bfbb=_0x5bc1[_0x137154];return _0x36bfbb;};'use strict';var _=require('lodash');var util=require(_0x15bc('0x0'));var moment=require(_0x15bc('0x1'));var BPromise=require(_0x15bc('0x2'));var rs=require(_0x15bc('0x3'));var fs=require('fs');var Redis=require(_0x15bc('0x4'));var db=require(_0x15bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x15bc('0x6'));var config=require(_0x15bc('0x7'));var jayson=require(_0x15bc('0x8'));var client=jayson['client'][_0x15bc('0x9')]({'port':0x232a});config['redis']=_[_0x15bc('0xa')](config[_0x15bc('0xb')],{'host':_0x15bc('0xc'),'port':0x18eb});var socket=require(_0x15bc('0xd'))(new Redis(config[_0x15bc('0xb')]));require(_0x15bc('0xe'))[_0x15bc('0xf')](socket);function respondWithRpcPromise(_0x735271,_0x140fe5,_0x37302c){return new BPromise(function(_0x4c0eca,_0x18b502){return client[_0x15bc('0x10')](_0x735271,_0x37302c)[_0x15bc('0x11')](function(_0x4c24a7){logger[_0x15bc('0x12')](_0x15bc('0x13'),_0x140fe5,_0x15bc('0x14'));logger[_0x15bc('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x140fe5,_0x15bc('0x14'),JSON[_0x15bc('0x16')](_0x4c24a7));if(_0x4c24a7[_0x15bc('0x17')]){if(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x18')]===0x1f4){logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);return _0x18b502(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);}logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x4c24a7[_0x15bc('0x17')]['message']);return _0x4c0eca(_0x4c24a7[_0x15bc('0x17')][_0x15bc('0x19')]);}else{logger[_0x15bc('0x12')](_0x15bc('0x13'),_0x140fe5,_0x15bc('0x14'));_0x4c0eca(_0x4c24a7[_0x15bc('0x1a')][_0x15bc('0x19')]);}})[_0x15bc('0x1b')](function(_0x2cab32){logger[_0x15bc('0x17')](_0x15bc('0x13'),_0x140fe5,_0x2cab32);_0x18b502(_0x2cab32);});});} \ No newline at end of file +var _0x0954=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','lodash','moment','bluebird'];(function(_0x4ae683,_0x343b9e){var _0x537532=function(_0x62eded){while(--_0x62eded){_0x4ae683['push'](_0x4ae683['shift']());}};_0x537532(++_0x343b9e);}(_0x0954,0x135));var _0x4095=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x0954[_0xbc4659];return _0x5831f9;};'use strict';var _=require(_0x4095('0x0'));var util=require('util');var moment=require(_0x4095('0x1'));var BPromise=require(_0x4095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require(_0x4095('0x6'))(_0x4095('0x7'));var config=require(_0x4095('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4095('0x9')]=_[_0x4095('0xa')](config[_0x4095('0x9')],{'host':_0x4095('0xb'),'port':0x18eb});var socket=require(_0x4095('0xc'))(new Redis(config[_0x4095('0x9')]));require('./userProfile.socket')[_0x4095('0xd')](socket);function respondWithRpcPromise(_0xe32904,_0x9e1747,_0x5d3e09){return new BPromise(function(_0x296b6d,_0x33daa4){return client[_0x4095('0xe')](_0xe32904,_0x5d3e09)['then'](function(_0x1963eb){logger['info'](_0x4095('0xf'),_0x9e1747,'request\x20sent');logger[_0x4095('0x10')](_0x4095('0x11'),_0x9e1747,_0x4095('0x12'),JSON['stringify'](_0x1963eb));if(_0x1963eb['error']){if(_0x1963eb[_0x4095('0x13')][_0x4095('0x14')]===0x1f4){logger[_0x4095('0x13')](_0x4095('0xf'),_0x9e1747,_0x1963eb['error']['message']);return _0x33daa4(_0x1963eb[_0x4095('0x13')][_0x4095('0x15')]);}logger[_0x4095('0x13')](_0x4095('0xf'),_0x9e1747,_0x1963eb[_0x4095('0x13')][_0x4095('0x15')]);return _0x296b6d(_0x1963eb['error']['message']);}else{logger[_0x4095('0x16')](_0x4095('0xf'),_0x9e1747,'request\x20sent');_0x296b6d(_0x1963eb[_0x4095('0x17')]['message']);}})['catch'](function(_0x272010){logger['error'](_0x4095('0xf'),_0x9e1747,_0x272010);_0x33daa4(_0x272010);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index e237a5a..0f23a55 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 _0x128b=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x128b,0x84));var _0xb128=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x128b[_0x17d9e3];return _0x14192d;};'use strict';var UserProfileEvents=require(_0xb128('0x0'));var events=[_0xb128('0x1'),_0xb128('0x2'),_0xb128('0x3')];function createListener(_0x22e9f5,_0x472ff1){return function(_0x7ab116){_0x472ff1['emit'](_0x22e9f5,_0x7ab116);};}function removeListener(_0x3c8396,_0x3738ed){return function(){UserProfileEvents[_0xb128('0x4')](_0x3c8396,_0x3738ed);};}exports[_0xb128('0x5')]=function(_0x1dfca6){for(var _0x485790=0x0,_0x40eb16=events[_0xb128('0x6')];_0x485790<_0x40eb16;_0x485790++){var _0x475109=events[_0x485790];var _0x1e34a7=createListener(_0xb128('0x7')+_0x475109,_0x1dfca6);UserProfileEvents['on'](_0x475109,_0x1e34a7);}}; \ No newline at end of file +var _0xbc96=['length','userProfile:','emit','removeListener'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbc96,0x15a));var _0x6bc9=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbc96[_0x5b644e];return _0x49c6bf;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save','remove','update'];function createListener(_0x485eb5,_0x4eb063){return function(_0x22e548){_0x4eb063[_0x6bc9('0x0')](_0x485eb5,_0x22e548);};}function removeListener(_0x6998e2,_0x4365dd){return function(){UserProfileEvents[_0x6bc9('0x1')](_0x6998e2,_0x4365dd);};}exports['register']=function(_0x3051a6){for(var _0x197160=0x0,_0x1e1065=events[_0x6bc9('0x2')];_0x197160<_0x1e1065;_0x197160++){var _0x226636=events[_0x197160];var _0x149caa=createListener(_0x6bc9('0x3')+_0x226636,_0x3051a6);UserProfileEvents['on'](_0x226636,_0x149caa);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 8620e57..3757e26 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 _0xe32a=['post','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x499173,_0x47ba16){var _0x592b95=function(_0x29afb6){while(--_0x29afb6){_0x499173['push'](_0x499173['shift']());}};_0x592b95(++_0x47ba16);}(_0xe32a,0x149));var _0xae32=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0xe32a[_0x34aec4];return _0x51e1a7;};'use strict';var multer=require('multer');var util=require(_0xae32('0x0'));var path=require('path');var timeout=require(_0xae32('0x1'));var express=require(_0xae32('0x2'));var router=express[_0xae32('0x3')]();var fs_extra=require(_0xae32('0x4'));var auth=require(_0xae32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xae32('0x6'));var controller=require(_0xae32('0x7'));router['get']('/',auth[_0xae32('0x8')](),controller[_0xae32('0x9')]);router[_0xae32('0xa')]('/describe',auth[_0xae32('0x8')](),controller[_0xae32('0xb')]);router[_0xae32('0xa')](_0xae32('0xc'),auth[_0xae32('0x8')](),controller['show']);router[_0xae32('0xd')]('/',auth[_0xae32('0x8')](),controller['create']);router[_0xae32('0xe')](_0xae32('0xc'),auth['isAuthenticated'](),controller[_0xae32('0xf')]);router[_0xae32('0x10')](_0xae32('0xc'),auth[_0xae32('0x8')](),controller[_0xae32('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6b4d=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports'];(function(_0x2caae5,_0x23acda){var _0x5e1f96=function(_0x218bbf){while(--_0x218bbf){_0x2caae5['push'](_0x2caae5['shift']());}};_0x5e1f96(++_0x23acda);}(_0x6b4d,0x1db));var _0xd6b4=function(_0x5eb021,_0x3781dc){_0x5eb021=_0x5eb021-0x0;var _0x58d799=_0x6b4d[_0x5eb021];return _0x58d799;};'use strict';var multer=require(_0xd6b4('0x0'));var util=require(_0xd6b4('0x1'));var path=require('path');var timeout=require(_0xd6b4('0x2'));var express=require(_0xd6b4('0x3'));var router=express['Router']();var fs_extra=require(_0xd6b4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd6b4('0x5'));var config=require(_0xd6b4('0x6'));var controller=require(_0xd6b4('0x7'));router[_0xd6b4('0x8')]('/',auth[_0xd6b4('0x9')](),controller[_0xd6b4('0xa')]);router['get'](_0xd6b4('0xb'),auth[_0xd6b4('0x9')](),controller[_0xd6b4('0xc')]);router[_0xd6b4('0x8')](_0xd6b4('0xd'),auth[_0xd6b4('0x9')](),controller[_0xd6b4('0xe')]);router[_0xd6b4('0xf')]('/',auth[_0xd6b4('0x9')](),controller['create']);router[_0xd6b4('0x10')](_0xd6b4('0xd'),auth[_0xd6b4('0x9')](),controller['update']);router['delete'](_0xd6b4('0xd'),auth['isAuthenticated'](),controller[_0xd6b4('0x11')]);module[_0xd6b4('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d397f3c..641952b 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 _0xaf26=['exports','STRING','INTEGER'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0xaf26,0xa8));var _0x6af2=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0xaf26[_0x32b993];return _0x482780;};'use strict';var Sequelize=require('sequelize');module[_0x6af2('0x0')]={'name':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x6af2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xce08=['INTEGER','STRING','sequelize','exports'];(function(_0x3c5d37,_0x430bcb){var _0x176b3d=function(_0x2ec39f){while(--_0x2ec39f){_0x3c5d37['push'](_0x3c5d37['shift']());}};_0x176b3d(++_0x430bcb);}(_0xce08,0xf2));var _0x8ce0=function(_0x2a04cb,_0x4b5b65){_0x2a04cb=_0x2a04cb-0x0;var _0x2ae67a=_0xce08[_0x2a04cb];return _0x2ae67a;};'use strict';var Sequelize=require(_0x8ce0('0x0'));module[_0x8ce0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8ce0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8ce0('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 8a33631..7cbfeba 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 _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1d12ad,_0x2fa478){var _0x56f429=function(_0x5bd9ed){while(--_0x5bd9ed){_0x1d12ad['push'](_0x1d12ad['shift']());}};_0x56f429(++_0x2fa478);}(_0x1261,0x144));var _0x1126=function(_0x5d4db8,_0x4ad01b){_0x5d4db8=_0x5d4db8-0x0;var _0x415548=_0x1261[_0x5d4db8];return _0x415548;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['UserProfileResource'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['UserProfileResource']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file +var _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','UserProfileResource','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1623,0xab));var _0x3162=function(_0x52a4ab,_0x3b29e6){_0x52a4ab=_0x52a4ab-0x0;var _0x4bc532=_0x1623[_0x52a4ab];return _0x4bc532;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['UserProfileResource'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['UserProfileResource'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 17fe3c6..b2cda2a 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 _0x3201=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x3201,0x154));var _0x1320=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x3201[_0x510b98];return _0x45e775;};'use strict';var _=require(_0x1320('0x0'));var util=require(_0x1320('0x1'));var logger=require(_0x1320('0x2'))(_0x1320('0x3'));var moment=require('moment');var BPromise=require(_0x1320('0x4'));var rp=require(_0x1320('0x5'));var fs=require('fs');var path=require(_0x1320('0x6'));var rimraf=require(_0x1320('0x7'));var config=require('../../config/environment');var attributes=require(_0x1320('0x8'));module[_0x1320('0x9')]=function(_0x4ed26d,_0x332e70){return _0x4ed26d[_0x1320('0xa')](_0x1320('0xb'),attributes,{'tableName':_0x1320('0xc'),'paranoid':![],'indexes':[{'name':_0x1320('0xd'),'fields':[_0x1320('0xe'),_0x1320('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe7b6=['exports','define','UserProfileResource','compositeIndex','sectionId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x432f8b,_0x461c12){var _0xa81510=function(_0x2c6ee5){while(--_0x2c6ee5){_0x432f8b['push'](_0x432f8b['shift']());}};_0xa81510(++_0x461c12);}(_0xe7b6,0x7a));var _0x6e7b=function(_0x53121a,_0x4e7c3a){_0x53121a=_0x53121a-0x0;var _0xbd15f6=_0xe7b6[_0x53121a];return _0xbd15f6;};'use strict';var _=require(_0x6e7b('0x0'));var util=require(_0x6e7b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e7b('0x2'));var BPromise=require('bluebird');var rp=require(_0x6e7b('0x3'));var fs=require('fs');var path=require(_0x6e7b('0x4'));var rimraf=require(_0x6e7b('0x5'));var config=require(_0x6e7b('0x6'));var attributes=require(_0x6e7b('0x7'));module[_0x6e7b('0x8')]=function(_0x3bc7de,_0x2bfcfc){return _0x3bc7de[_0x6e7b('0x9')](_0x6e7b('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x6e7b('0xb'),'fields':['resourceId',_0x6e7b('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 c921054..e8b92ab 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 _0x7d87=['jayson/promise','request','then','info','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x333987,_0x637b06){var _0x319755=function(_0x442eb3){while(--_0x442eb3){_0x333987['push'](_0x333987['shift']());}};_0x319755(++_0x637b06);}(_0x7d87,0x9b));var _0x77d8=function(_0x364c22,_0x120c52){_0x364c22=_0x364c22-0x0;var _0x3c51e0=_0x7d87[_0x364c22];return _0x3c51e0;};'use strict';var _=require(_0x77d8('0x0'));var util=require(_0x77d8('0x1'));var moment=require(_0x77d8('0x2'));var BPromise=require(_0x77d8('0x3'));var rs=require(_0x77d8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x77d8('0x6'));var config=require('../../config/environment');var jayson=require(_0x77d8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51686d,_0x42e68e,_0x57e497){return new BPromise(function(_0x12bee7,_0x4cc28c){return client[_0x77d8('0x8')](_0x51686d,_0x57e497)[_0x77d8('0x9')](function(_0x2aab75){logger[_0x77d8('0xa')]('UserProfileResource,\x20%s,\x20%s',_0x42e68e,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x42e68e,_0x77d8('0xb'),JSON[_0x77d8('0xc')](_0x2aab75));if(_0x2aab75[_0x77d8('0xd')]){if(_0x2aab75[_0x77d8('0xd')][_0x77d8('0xe')]===0x1f4){logger['error'](_0x77d8('0xf'),_0x42e68e,_0x2aab75[_0x77d8('0xd')][_0x77d8('0x10')]);return _0x4cc28c(_0x2aab75['error'][_0x77d8('0x10')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x42e68e,_0x2aab75['error']['message']);return _0x12bee7(_0x2aab75[_0x77d8('0xd')][_0x77d8('0x10')]);}else{logger['info'](_0x77d8('0xf'),_0x42e68e,_0x77d8('0xb'));_0x12bee7(_0x2aab75['result']['message']);}})[_0x77d8('0x11')](function(_0x1f1d76){logger['error'](_0x77d8('0xf'),_0x42e68e,_0x1f1d76);_0x4cc28c(_0x1f1d76);});});} \ No newline at end of file +var _0xb38e=['UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ea812,_0x38b8d5){var _0x44656b=function(_0x342723){while(--_0x342723){_0x2ea812['push'](_0x2ea812['shift']());}};_0x44656b(++_0x38b8d5);}(_0xb38e,0x18d));var _0xeb38=function(_0x523927,_0x5b2606){_0x523927=_0x523927-0x0;var _0x25ae82=_0xb38e[_0x523927];return _0x25ae82;};'use strict';var _=require('lodash');var util=require(_0xeb38('0x0'));var moment=require(_0xeb38('0x1'));var BPromise=require(_0xeb38('0x2'));var rs=require(_0xeb38('0x3'));var fs=require('fs');var Redis=require(_0xeb38('0x4'));var db=require(_0xeb38('0x5'))['db'];var utils=require(_0xeb38('0x6'));var logger=require('../../config/logger')(_0xeb38('0x7'));var config=require(_0xeb38('0x8'));var jayson=require(_0xeb38('0x9'));var client=jayson[_0xeb38('0xa')][_0xeb38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50e51c,_0x209c8d,_0x3fd659){return new BPromise(function(_0xbdde2a,_0x4aec9b){return client[_0xeb38('0xc')](_0x50e51c,_0x3fd659)['then'](function(_0x5dd98f){logger[_0xeb38('0xd')](_0xeb38('0xe'),_0x209c8d,_0xeb38('0xf'));logger[_0xeb38('0x10')](_0xeb38('0x11'),_0x209c8d,_0xeb38('0xf'),JSON[_0xeb38('0x12')](_0x5dd98f));if(_0x5dd98f[_0xeb38('0x13')]){if(_0x5dd98f['error'][_0xeb38('0x14')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x209c8d,_0x5dd98f[_0xeb38('0x13')][_0xeb38('0x15')]);return _0x4aec9b(_0x5dd98f['error'][_0xeb38('0x15')]);}logger[_0xeb38('0x13')](_0xeb38('0xe'),_0x209c8d,_0x5dd98f[_0xeb38('0x13')][_0xeb38('0x15')]);return _0xbdde2a(_0x5dd98f[_0xeb38('0x13')][_0xeb38('0x15')]);}else{logger[_0xeb38('0xd')](_0xeb38('0xe'),_0x209c8d,_0xeb38('0xf'));_0xbdde2a(_0x5dd98f['result'][_0xeb38('0x15')]);}})[_0xeb38('0x16')](function(_0x54ebe1){logger['error'](_0xeb38('0xe'),_0x209c8d,_0x54ebe1);_0x4aec9b(_0x54ebe1);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c94400c..55f228f 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 _0x1f22=['isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','Router','../../config/environment','./userProfileSection.controller','get','index','/describe','describe','/:id','show','post'];(function(_0x376948,_0x58d4aa){var _0x1f8124=function(_0x853a8){while(--_0x853a8){_0x376948['push'](_0x376948['shift']());}};_0x1f8124(++_0x58d4aa);}(_0x1f22,0x1ab));var _0x21f2=function(_0x9f0648,_0x1893a2){_0x9f0648=_0x9f0648-0x0;var _0x5e4260=_0x1f22[_0x9f0648];return _0x5e4260;};'use strict';var multer=require(_0x21f2('0x0'));var util=require(_0x21f2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x21f2('0x2'));var router=express[_0x21f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x21f2('0x4'));var controller=require(_0x21f2('0x5'));router[_0x21f2('0x6')]('/',auth['isAuthenticated'](),controller[_0x21f2('0x7')]);router[_0x21f2('0x6')](_0x21f2('0x8'),auth['isAuthenticated'](),controller[_0x21f2('0x9')]);router['get'](_0x21f2('0xa'),auth['isAuthenticated'](),controller[_0x21f2('0xb')]);router[_0x21f2('0xc')]('/',auth[_0x21f2('0xd')](),controller[_0x21f2('0xe')]);router[_0x21f2('0xf')](_0x21f2('0xa'),auth[_0x21f2('0xd')](),controller[_0x21f2('0x10')]);router[_0x21f2('0x11')](_0x21f2('0xa'),auth[_0x21f2('0xd')](),controller[_0x21f2('0x12')]);module[_0x21f2('0x13')]=router; \ No newline at end of file +var _0x9eff=['index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated'];(function(_0x50a651,_0x276aaf){var _0x429c51=function(_0x41e3e9){while(--_0x41e3e9){_0x50a651['push'](_0x50a651['shift']());}};_0x429c51(++_0x276aaf);}(_0x9eff,0x114));var _0xf9ef=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9eff[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0xf9ef('0x0'));var util=require(_0xf9ef('0x1'));var path=require(_0xf9ef('0x2'));var timeout=require('connect-timeout');var express=require(_0xf9ef('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf9ef('0x4'));var interaction=require(_0xf9ef('0x5'));var config=require('../../config/environment');var controller=require(_0xf9ef('0x6'));router[_0xf9ef('0x7')]('/',auth[_0xf9ef('0x8')](),controller[_0xf9ef('0x9')]);router[_0xf9ef('0x7')](_0xf9ef('0xa'),auth[_0xf9ef('0x8')](),controller[_0xf9ef('0xb')]);router[_0xf9ef('0x7')](_0xf9ef('0xc'),auth[_0xf9ef('0x8')](),controller[_0xf9ef('0xd')]);router['post']('/',auth[_0xf9ef('0x8')](),controller[_0xf9ef('0xe')]);router[_0xf9ef('0xf')]('/:id',auth[_0xf9ef('0x8')](),controller[_0xf9ef('0x10')]);router[_0xf9ef('0x11')](_0xf9ef('0xc'),auth[_0xf9ef('0x8')](),controller[_0xf9ef('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 8e63725..8310f75 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 _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x451118,_0x330b6a){var _0x3d2a41=function(_0x1ccc71){while(--_0x1ccc71){_0x451118['push'](_0x451118['shift']());}};_0x3d2a41(++_0x330b6a);}(_0xe511,0x16f));var _0x1e51=function(_0x1ebe53,_0x35cc29){_0x1ebe53=_0x1ebe53-0x0;var _0x56cb47=_0xe511[_0x1ebe53];return _0x56cb47;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0x69d3=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','join','getDataValue'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x69d3,0xda));var _0x369d=function(_0x4498cf,_0x1d8a75){_0x4498cf=_0x4498cf-0x0;var _0x2f081e=_0x69d3[_0x4498cf];return _0x2f081e;};'use strict';var Sequelize=require(_0x369d('0x0'));module[_0x369d('0x1')]={'name':{'type':Sequelize[_0x369d('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x369d('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x369d('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xe38740){this['setDataValue']('crudPermissions',_0xe38740?_0xe38740[_0x369d('0x5')](''):[]);},'get':function(){return this[_0x369d('0x6')](_0x369d('0x7'))?this[_0x369d('0x6')](_0x369d('0x7'))[_0x369d('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 321de81..66db37c 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 _0xbd3c=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','then','destroy','error','stack','name','index','UserProfileSection','rawAttributes','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','intersection','length','options','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x258bd8,_0x3cf0b1){var _0x2f43a4=function(_0x57a5bf){while(--_0x57a5bf){_0x258bd8['push'](_0x258bd8['shift']());}};_0x2f43a4(++_0x3cf0b1);}(_0xbd3c,0x17d));var _0xcbd3=function(_0x2bd6f5,_0x1787a){_0x2bd6f5=_0x2bd6f5-0x0;var _0x306870=_0xbd3c[_0x2bd6f5];return _0x306870;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcbd3('0x0'));var jsonpatch=require(_0xcbd3('0x1'));var rp=require(_0xcbd3('0x2'));var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var Mustache=require(_0xcbd3('0x5'));var util=require(_0xcbd3('0x6'));var path=require(_0xcbd3('0x7'));var sox=require('sox');var csv=require(_0xcbd3('0x8'));var ejs=require(_0xcbd3('0x9'));var fs=require('fs');var fs_extra=require(_0xcbd3('0xa'));var _=require(_0xcbd3('0xb'));var squel=require('squel');var crypto=require(_0xcbd3('0xc'));var jsforce=require(_0xcbd3('0xd'));var deskjs=require(_0xcbd3('0xe'));var toCsv=require(_0xcbd3('0x8'));var querystring=require(_0xcbd3('0xf'));var Papa=require(_0xcbd3('0x10'));var Redis=require(_0xcbd3('0x11'));var authService=require(_0xcbd3('0x12'));var qs=require(_0xcbd3('0x13'));var as=require(_0xcbd3('0x14'));var hardwareService=require(_0xcbd3('0x15'));var logger=require(_0xcbd3('0x16'))(_0xcbd3('0x17'));var utils=require(_0xcbd3('0x18'));var config=require(_0xcbd3('0x19'));var licenseUtil=require(_0xcbd3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x203ae3,_0x2bcb84){_0x2bcb84=_0x2bcb84||0xcc;return function(_0x4c55ac){if(_0x4c55ac){return _0x203ae3[_0xcbd3('0x1b')](_0x2bcb84);}return _0x203ae3[_0xcbd3('0x1c')](_0x2bcb84)[_0xcbd3('0x1d')]();};}function respondWithResult(_0x311ad7,_0x39f151){_0x39f151=_0x39f151||0xc8;return function(_0x3ea1ba){if(_0x3ea1ba){return _0x311ad7[_0xcbd3('0x1c')](_0x39f151)[_0xcbd3('0x1e')](_0x3ea1ba);}};}function respondWithFilteredResult(_0x4dc371,_0x1cd331){return function(_0x3f5450){if(_0x3f5450){var _0x186133=typeof _0x1cd331['offset']===_0xcbd3('0x1f')&&typeof _0x1cd331['limit']==='undefined';var _0x252c7a=_0x3f5450[_0xcbd3('0x20')];var _0x1ec467=_0x186133?0x0:_0x1cd331[_0xcbd3('0x21')];var _0x43f213=_0x186133?_0x3f5450['count']:_0x1cd331[_0xcbd3('0x21')]+_0x1cd331[_0xcbd3('0x22')];var _0x26f294;if(_0x43f213>=_0x252c7a){_0x43f213=_0x252c7a;_0x26f294=0xc8;}else{_0x26f294=0xce;}_0x4dc371[_0xcbd3('0x1c')](_0x26f294);return _0x4dc371[_0xcbd3('0x23')]('Content-Range',_0x1ec467+'-'+_0x43f213+'/'+_0x252c7a)['json'](_0x3f5450);}return null;};}function patchUpdates(_0x273dad){return function(_0x4f17fc){try{jsonpatch[_0xcbd3('0x24')](_0x4f17fc,_0x273dad,!![]);}catch(_0x5cc2d4){return BPromise['reject'](_0x5cc2d4);}return _0x4f17fc[_0xcbd3('0x25')]();};}function saveUpdates(_0x1ed46e,_0x1f7463){return function(_0x2186ab){if(_0x2186ab){return _0x2186ab['update'](_0x1ed46e)[_0xcbd3('0x26')](function(_0x16ab73){return _0x16ab73;});}return null;};}function removeEntity(_0x36516d,_0x27e0f6){return function(_0x220071){if(_0x220071){return _0x220071[_0xcbd3('0x27')]()['then'](function(){_0x36516d['status'](0xcc)[_0xcbd3('0x1d')]();});}};}function handleEntityNotFound(_0x5088ce,_0x13568d){return function(_0x277ba3){if(!_0x277ba3){_0x5088ce['sendStatus'](0x194);}return _0x277ba3;};}function handleError(_0x358235,_0x49faaa){_0x49faaa=_0x49faaa||0x1f4;return function(_0x36cddc){logger[_0xcbd3('0x28')](_0x36cddc[_0xcbd3('0x29')]);if(_0x36cddc[_0xcbd3('0x2a')]){delete _0x36cddc['name'];}_0x358235[_0xcbd3('0x1c')](_0x49faaa)['send'](_0x36cddc);};}exports[_0xcbd3('0x2b')]=function(_0x5a7625,_0x15b732){var _0x175734={},_0x261671={},_0x4772a7={'count':0x0,'rows':[]};var _0x3e5d50=_['map'](db[_0xcbd3('0x2c')][_0xcbd3('0x2d')],function(_0x1987d6){return{'name':_0x1987d6['fieldName'],'type':_0x1987d6['type']['key']};});_0x261671[_0xcbd3('0x2e')]=_['map'](_0x3e5d50,'name');_0x261671['query']=_[_0xcbd3('0x2f')](_0x5a7625['query']);_0x261671[_0xcbd3('0x30')]=_['intersection'](_0x261671[_0xcbd3('0x2e')],_0x261671[_0xcbd3('0x31')]);_0x175734[_0xcbd3('0x32')]=_['intersection'](_0x261671['model'],qs[_0xcbd3('0x33')](_0x5a7625[_0xcbd3('0x31')][_0xcbd3('0x33')]));_0x175734[_0xcbd3('0x32')]=_0x175734[_0xcbd3('0x32')]['length']?_0x175734['attributes']:_0x261671[_0xcbd3('0x2e')];if(!_0x5a7625['query'][_0xcbd3('0x34')](_0xcbd3('0x35'))){_0x175734[_0xcbd3('0x22')]=qs['limit'](_0x5a7625[_0xcbd3('0x31')]['limit']);_0x175734['offset']=qs[_0xcbd3('0x21')](_0x5a7625[_0xcbd3('0x31')][_0xcbd3('0x21')]);}_0x175734[_0xcbd3('0x36')]=qs[_0xcbd3('0x37')](_0x5a7625['query'][_0xcbd3('0x37')]);_0x175734['where']=qs[_0xcbd3('0x30')](_[_0xcbd3('0x38')](_0x5a7625['query'],_0x261671['filters']),_0x3e5d50);if(_0x5a7625[_0xcbd3('0x31')][_0xcbd3('0x39')]){_0x175734[_0xcbd3('0x3a')]=_['merge'](_0x175734['where'],{'$or':_[_0xcbd3('0x3b')](_0x3e5d50,function(_0x58cb92){if(_0x58cb92[_0xcbd3('0x3c')]!==_0xcbd3('0x3d')){var _0x4c48d5={};_0x4c48d5[_0x58cb92[_0xcbd3('0x2a')]]={'$like':'%'+_0x5a7625[_0xcbd3('0x31')][_0xcbd3('0x39')]+'%'};return _0x4c48d5;}})});}_0x175734=_[_0xcbd3('0x3e')]({},_0x175734,_0x5a7625['options']);var _0x552508={'where':_0x175734[_0xcbd3('0x3a')]};return db[_0xcbd3('0x2c')][_0xcbd3('0x20')](_0x552508)[_0xcbd3('0x26')](function(_0x3fc660){_0x4772a7[_0xcbd3('0x20')]=_0x3fc660;if(_0x5a7625[_0xcbd3('0x31')][_0xcbd3('0x3f')]){_0x175734[_0xcbd3('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xcbd3('0x41')](_0x175734);})['then'](function(_0x4bbca3){_0x4772a7[_0xcbd3('0x42')]=_0x4bbca3;return _0x4772a7;})[_0xcbd3('0x26')](respondWithFilteredResult(_0x15b732,_0x175734))['catch'](handleError(_0x15b732,null));};exports[_0xcbd3('0x43')]=function(_0x136210,_0x1d0be8){var _0x370973={'raw':![],'where':{'id':_0x136210[_0xcbd3('0x44')]['id']}},_0x3ed2c9={};_0x3ed2c9[_0xcbd3('0x2e')]=_[_0xcbd3('0x2f')](db[_0xcbd3('0x2c')][_0xcbd3('0x2d')]);_0x3ed2c9['query']=_[_0xcbd3('0x2f')](_0x136210[_0xcbd3('0x31')]);_0x3ed2c9['filters']=_[_0xcbd3('0x45')](_0x3ed2c9[_0xcbd3('0x2e')],_0x3ed2c9[_0xcbd3('0x31')]);_0x370973[_0xcbd3('0x32')]=_[_0xcbd3('0x45')](_0x3ed2c9[_0xcbd3('0x2e')],qs['fields'](_0x136210[_0xcbd3('0x31')][_0xcbd3('0x33')]));_0x370973[_0xcbd3('0x32')]=_0x370973['attributes'][_0xcbd3('0x46')]?_0x370973[_0xcbd3('0x32')]:_0x3ed2c9[_0xcbd3('0x2e')];if(_0x136210['query'][_0xcbd3('0x3f')]){_0x370973['include']=[{'all':!![]}];}_0x370973=_['merge']({},_0x370973,_0x136210[_0xcbd3('0x47')]);return db[_0xcbd3('0x2c')][_0xcbd3('0x48')](_0x370973)[_0xcbd3('0x26')](handleEntityNotFound(_0x1d0be8,null))[_0xcbd3('0x26')](respondWithResult(_0x1d0be8,null))[_0xcbd3('0x49')](handleError(_0x1d0be8,null));};exports[_0xcbd3('0x4a')]=function(_0x4f8458,_0x33f25e){return db[_0xcbd3('0x2c')][_0xcbd3('0x4a')](_0x4f8458[_0xcbd3('0x4b')],{})[_0xcbd3('0x26')](respondWithResult(_0x33f25e,0xc9))[_0xcbd3('0x49')](handleError(_0x33f25e,null));};exports[_0xcbd3('0x4c')]=function(_0x17b0f3,_0x2068dc){if(_0x17b0f3[_0xcbd3('0x4b')]['id']){delete _0x17b0f3[_0xcbd3('0x4b')]['id'];}return db[_0xcbd3('0x2c')][_0xcbd3('0x48')]({'where':{'id':_0x17b0f3[_0xcbd3('0x44')]['id']}})['then'](handleEntityNotFound(_0x2068dc,null))['then'](saveUpdates(_0x17b0f3[_0xcbd3('0x4b')],null))[_0xcbd3('0x26')](respondWithResult(_0x2068dc,null))[_0xcbd3('0x49')](handleError(_0x2068dc,null));};exports[_0xcbd3('0x27')]=function(_0x31cac7,_0x397dba){return db[_0xcbd3('0x2c')][_0xcbd3('0x48')]({'where':{'id':_0x31cac7[_0xcbd3('0x44')]['id']}})[_0xcbd3('0x26')](handleEntityNotFound(_0x397dba,null))[_0xcbd3('0x26')](removeEntity(_0x397dba,null))[_0xcbd3('0x49')](handleError(_0x397dba,null));};exports['describe']=function(_0x4b330b,_0x464c99){return db['UserProfileSection']['describe']()[_0xcbd3('0x26')](respondWithResult(_0x464c99,null))[_0xcbd3('0x49')](handleError(_0x464c99,null));}; \ No newline at end of file +var _0x1b37=['create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','then','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','catch'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x1b37,0x1c8));var _0x71b3=function(_0x371d11,_0x3b7d7d){_0x371d11=_0x371d11-0x0;var _0x1d5b7e=_0x1b37[_0x371d11];return _0x1d5b7e;};'use strict';var emlformat=require(_0x71b3('0x0'));var rimraf=require(_0x71b3('0x1'));var zipdir=require(_0x71b3('0x2'));var jsonpatch=require(_0x71b3('0x3'));var rp=require(_0x71b3('0x4'));var moment=require(_0x71b3('0x5'));var BPromise=require(_0x71b3('0x6'));var Mustache=require('mustache');var util=require(_0x71b3('0x7'));var path=require(_0x71b3('0x8'));var sox=require(_0x71b3('0x9'));var csv=require(_0x71b3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71b3('0xb'));var _=require(_0x71b3('0xc'));var squel=require('squel');var crypto=require(_0x71b3('0xd'));var jsforce=require(_0x71b3('0xe'));var deskjs=require(_0x71b3('0xf'));var toCsv=require(_0x71b3('0xa'));var querystring=require(_0x71b3('0x10'));var Papa=require(_0x71b3('0x11'));var Redis=require(_0x71b3('0x12'));var authService=require(_0x71b3('0x13'));var qs=require(_0x71b3('0x14'));var as=require(_0x71b3('0x15'));var hardwareService=require(_0x71b3('0x16'));var logger=require('../../config/logger')(_0x71b3('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71b3('0x18'))['db'];function respondWithStatusCode(_0x36989a,_0x557fe8){_0x557fe8=_0x557fe8||0xcc;return function(_0x359fb0){if(_0x359fb0){return _0x36989a[_0x71b3('0x19')](_0x557fe8);}return _0x36989a[_0x71b3('0x1a')](_0x557fe8)[_0x71b3('0x1b')]();};}function respondWithResult(_0x101d2b,_0x4d6a09){_0x4d6a09=_0x4d6a09||0xc8;return function(_0x5aeb9a){if(_0x5aeb9a){return _0x101d2b[_0x71b3('0x1a')](_0x4d6a09)['json'](_0x5aeb9a);}};}function respondWithFilteredResult(_0x4b9d6d,_0x6ffdf0){return function(_0x56d06e){if(_0x56d06e){var _0x561fe3=typeof _0x6ffdf0['offset']===_0x71b3('0x1c')&&typeof _0x6ffdf0['limit']===_0x71b3('0x1c');var _0x1e2b47=_0x56d06e[_0x71b3('0x1d')];var _0x420544=_0x561fe3?0x0:_0x6ffdf0['offset'];var _0x2a6fe4=_0x561fe3?_0x56d06e[_0x71b3('0x1d')]:_0x6ffdf0[_0x71b3('0x1e')]+_0x6ffdf0[_0x71b3('0x1f')];var _0x348a9f;if(_0x2a6fe4>=_0x1e2b47){_0x2a6fe4=_0x1e2b47;_0x348a9f=0xc8;}else{_0x348a9f=0xce;}_0x4b9d6d['status'](_0x348a9f);return _0x4b9d6d[_0x71b3('0x20')](_0x71b3('0x21'),_0x420544+'-'+_0x2a6fe4+'/'+_0x1e2b47)[_0x71b3('0x22')](_0x56d06e);}return null;};}function patchUpdates(_0x186573){return function(_0xf7e70){try{jsonpatch[_0x71b3('0x23')](_0xf7e70,_0x186573,!![]);}catch(_0x461f28){return BPromise['reject'](_0x461f28);}return _0xf7e70['save']();};}function saveUpdates(_0x5501e1,_0xe75a38){return function(_0x399d5a){if(_0x399d5a){return _0x399d5a['update'](_0x5501e1)[_0x71b3('0x24')](function(_0x37d728){return _0x37d728;});}return null;};}function removeEntity(_0x172d4f,_0x120243){return function(_0x4af910){if(_0x4af910){return _0x4af910['destroy']()[_0x71b3('0x24')](function(){_0x172d4f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db337,_0x3d49b2){return function(_0x49aa32){if(!_0x49aa32){_0x1db337[_0x71b3('0x19')](0x194);}return _0x49aa32;};}function handleError(_0x2262eb,_0x1524c3){_0x1524c3=_0x1524c3||0x1f4;return function(_0x1be836){logger[_0x71b3('0x25')](_0x1be836['stack']);if(_0x1be836[_0x71b3('0x26')]){delete _0x1be836[_0x71b3('0x26')];}_0x2262eb[_0x71b3('0x1a')](_0x1524c3)[_0x71b3('0x27')](_0x1be836);};}exports[_0x71b3('0x28')]=function(_0x34a804,_0x37e0e4){var _0x30446d={},_0x53a7d9={},_0x20df1b={'count':0x0,'rows':[]};var _0x18f223=_[_0x71b3('0x29')](db[_0x71b3('0x2a')][_0x71b3('0x2b')],function(_0x29d159){return{'name':_0x29d159[_0x71b3('0x2c')],'type':_0x29d159[_0x71b3('0x2d')]['key']};});_0x53a7d9[_0x71b3('0x2e')]=_[_0x71b3('0x29')](_0x18f223,_0x71b3('0x26'));_0x53a7d9[_0x71b3('0x2f')]=_[_0x71b3('0x30')](_0x34a804['query']);_0x53a7d9['filters']=_[_0x71b3('0x31')](_0x53a7d9[_0x71b3('0x2e')],_0x53a7d9[_0x71b3('0x2f')]);_0x30446d[_0x71b3('0x32')]=_[_0x71b3('0x31')](_0x53a7d9[_0x71b3('0x2e')],qs[_0x71b3('0x33')](_0x34a804[_0x71b3('0x2f')][_0x71b3('0x33')]));_0x30446d[_0x71b3('0x32')]=_0x30446d[_0x71b3('0x32')]['length']?_0x30446d[_0x71b3('0x32')]:_0x53a7d9[_0x71b3('0x2e')];if(!_0x34a804[_0x71b3('0x2f')][_0x71b3('0x34')](_0x71b3('0x35'))){_0x30446d[_0x71b3('0x1f')]=qs[_0x71b3('0x1f')](_0x34a804[_0x71b3('0x2f')][_0x71b3('0x1f')]);_0x30446d[_0x71b3('0x1e')]=qs[_0x71b3('0x1e')](_0x34a804[_0x71b3('0x2f')]['offset']);}_0x30446d[_0x71b3('0x36')]=qs[_0x71b3('0x37')](_0x34a804[_0x71b3('0x2f')]['sort']);_0x30446d[_0x71b3('0x38')]=qs[_0x71b3('0x39')](_['pick'](_0x34a804[_0x71b3('0x2f')],_0x53a7d9['filters']),_0x18f223);if(_0x34a804[_0x71b3('0x2f')]['filter']){_0x30446d[_0x71b3('0x38')]=_['merge'](_0x30446d['where'],{'$or':_['map'](_0x18f223,function(_0xa4d0fb){if(_0xa4d0fb[_0x71b3('0x2d')]!==_0x71b3('0x3a')){var _0x170c13={};_0x170c13[_0xa4d0fb[_0x71b3('0x26')]]={'$like':'%'+_0x34a804[_0x71b3('0x2f')][_0x71b3('0x3b')]+'%'};return _0x170c13;}})});}_0x30446d=_[_0x71b3('0x3c')]({},_0x30446d,_0x34a804[_0x71b3('0x3d')]);var _0x2de8bf={'where':_0x30446d[_0x71b3('0x38')]};return db['UserProfileSection'][_0x71b3('0x1d')](_0x2de8bf)[_0x71b3('0x24')](function(_0x154c87){_0x20df1b[_0x71b3('0x1d')]=_0x154c87;if(_0x34a804[_0x71b3('0x2f')][_0x71b3('0x3e')]){_0x30446d[_0x71b3('0x3f')]=[{'all':!![]}];}return db[_0x71b3('0x2a')][_0x71b3('0x40')](_0x30446d);})['then'](function(_0xb4c7f3){_0x20df1b[_0x71b3('0x41')]=_0xb4c7f3;return _0x20df1b;})[_0x71b3('0x24')](respondWithFilteredResult(_0x37e0e4,_0x30446d))['catch'](handleError(_0x37e0e4,null));};exports[_0x71b3('0x42')]=function(_0x31af37,_0x24071c){var _0x4b56e1={'raw':![],'where':{'id':_0x31af37[_0x71b3('0x43')]['id']}},_0x2a2b21={};_0x2a2b21['model']=_[_0x71b3('0x30')](db[_0x71b3('0x2a')][_0x71b3('0x2b')]);_0x2a2b21[_0x71b3('0x2f')]=_[_0x71b3('0x30')](_0x31af37[_0x71b3('0x2f')]);_0x2a2b21[_0x71b3('0x39')]=_[_0x71b3('0x31')](_0x2a2b21[_0x71b3('0x2e')],_0x2a2b21['query']);_0x4b56e1[_0x71b3('0x32')]=_['intersection'](_0x2a2b21[_0x71b3('0x2e')],qs[_0x71b3('0x33')](_0x31af37['query'][_0x71b3('0x33')]));_0x4b56e1[_0x71b3('0x32')]=_0x4b56e1[_0x71b3('0x32')]['length']?_0x4b56e1[_0x71b3('0x32')]:_0x2a2b21[_0x71b3('0x2e')];if(_0x31af37['query']['includeAll']){_0x4b56e1[_0x71b3('0x3f')]=[{'all':!![]}];}_0x4b56e1=_[_0x71b3('0x3c')]({},_0x4b56e1,_0x31af37['options']);return db['UserProfileSection']['find'](_0x4b56e1)[_0x71b3('0x24')](handleEntityNotFound(_0x24071c,null))['then'](respondWithResult(_0x24071c,null))[_0x71b3('0x44')](handleError(_0x24071c,null));};exports['create']=function(_0x525ec8,_0x42e0ad){return db['UserProfileSection'][_0x71b3('0x45')](_0x525ec8[_0x71b3('0x46')],{})['then'](respondWithResult(_0x42e0ad,0xc9))['catch'](handleError(_0x42e0ad,null));};exports[_0x71b3('0x47')]=function(_0x101d91,_0xb4766d){if(_0x101d91[_0x71b3('0x46')]['id']){delete _0x101d91[_0x71b3('0x46')]['id'];}return db[_0x71b3('0x2a')][_0x71b3('0x48')]({'where':{'id':_0x101d91[_0x71b3('0x43')]['id']}})['then'](handleEntityNotFound(_0xb4766d,null))[_0x71b3('0x24')](saveUpdates(_0x101d91[_0x71b3('0x46')],null))[_0x71b3('0x24')](respondWithResult(_0xb4766d,null))[_0x71b3('0x44')](handleError(_0xb4766d,null));};exports[_0x71b3('0x49')]=function(_0x22bca9,_0x4adab4){return db['UserProfileSection'][_0x71b3('0x48')]({'where':{'id':_0x22bca9[_0x71b3('0x43')]['id']}})[_0x71b3('0x24')](handleEntityNotFound(_0x4adab4,null))['then'](removeEntity(_0x4adab4,null))[_0x71b3('0x44')](handleError(_0x4adab4,null));};exports[_0x71b3('0x4a')]=function(_0x40e163,_0x1f9176){return db[_0x71b3('0x2a')][_0x71b3('0x4a')]()[_0x71b3('0x24')](respondWithResult(_0x1f9176,null))[_0x71b3('0x44')](handleError(_0x1f9176,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index bb6b01c..3172f10 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 _0xe29b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x31a7a3,_0x49e48c){var _0x5e0494=function(_0x4a6b57){while(--_0x4a6b57){_0x31a7a3['push'](_0x31a7a3['shift']());}};_0x5e0494(++_0x49e48c);}(_0xe29b,0xd9));var _0xbe29=function(_0x423030,_0x6f9fd7){_0x423030=_0x423030-0x0;var _0x49257f=_0xe29b[_0x423030];return _0x49257f;};'use strict';var _=require(_0xbe29('0x0'));var util=require(_0xbe29('0x1'));var logger=require(_0xbe29('0x2'))(_0xbe29('0x3'));var moment=require(_0xbe29('0x4'));var BPromise=require(_0xbe29('0x5'));var rp=require(_0xbe29('0x6'));var fs=require('fs');var path=require(_0xbe29('0x7'));var rimraf=require(_0xbe29('0x8'));var config=require(_0xbe29('0x9'));var attributes=require(_0xbe29('0xa'));module[_0xbe29('0xb')]=function(_0x344a8e,_0x1a94d0){return _0x344a8e[_0xbe29('0xc')](_0xbe29('0xd'),attributes,{'tableName':_0xbe29('0xe'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xbe29('0xf'),_0xbe29('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x02a2=['sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','user_profile_has_sections','compositeIndex'];(function(_0x26b25d,_0x30969a){var _0x5b9b5e=function(_0x4fef11){while(--_0x4fef11){_0x26b25d['push'](_0x26b25d['shift']());}};_0x5b9b5e(++_0x30969a);}(_0x02a2,0x181));var _0x202a=function(_0x1e9bf5,_0x2b8466){_0x1e9bf5=_0x1e9bf5-0x0;var _0x3e43a0=_0x02a2[_0x1e9bf5];return _0x3e43a0;};'use strict';var _=require(_0x202a('0x0'));var util=require(_0x202a('0x1'));var logger=require(_0x202a('0x2'))(_0x202a('0x3'));var moment=require('moment');var BPromise=require(_0x202a('0x4'));var rp=require(_0x202a('0x5'));var fs=require('fs');var path=require(_0x202a('0x6'));var rimraf=require(_0x202a('0x7'));var config=require('../../config/environment');var attributes=require(_0x202a('0x8'));module['exports']=function(_0x58b3cc,_0x49b493){return _0x58b3cc['define']('UserProfileSection',attributes,{'tableName':_0x202a('0x9'),'paranoid':![],'indexes':[{'name':_0x202a('0xa'),'fields':[_0x202a('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fc82753..852b529 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 _0x757b=['UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug'];(function(_0x27ce89,_0x577311){var _0x4054dc=function(_0x14f867){while(--_0x14f867){_0x27ce89['push'](_0x27ce89['shift']());}};_0x4054dc(++_0x577311);}(_0x757b,0xa7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb757('0x0'));var util=require(_0xb757('0x1'));var moment=require('moment');var BPromise=require(_0xb757('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb757('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb757('0x4'));var logger=require(_0xb757('0x5'))(_0xb757('0x6'));var config=require(_0xb757('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x70113a,_0x870f45,_0x3f0da2){return new BPromise(function(_0x3c38cd,_0x229549){return client[_0xb757('0x8')](_0x70113a,_0x3f0da2)[_0xb757('0x9')](function(_0x353694){logger[_0xb757('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x870f45,_0xb757('0xb'));logger[_0xb757('0xc')](_0xb757('0xd'),_0x870f45,_0xb757('0xb'),JSON['stringify'](_0x353694));if(_0x353694[_0xb757('0xe')]){if(_0x353694['error'][_0xb757('0xf')]===0x1f4){logger[_0xb757('0xe')](_0xb757('0x10'),_0x870f45,_0x353694['error'][_0xb757('0x11')]);return _0x229549(_0x353694['error'][_0xb757('0x11')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x870f45,_0x353694[_0xb757('0xe')][_0xb757('0x11')]);return _0x3c38cd(_0x353694['error'][_0xb757('0x11')]);}else{logger[_0xb757('0xa')](_0xb757('0x10'),_0x870f45,_0xb757('0xb'));_0x3c38cd(_0x353694[_0xb757('0x12')][_0xb757('0x11')]);}})[_0xb757('0x13')](function(_0x3f1b4f){logger[_0xb757('0xe')](_0xb757('0x10'),_0x870f45,_0x3f1b4f);_0x229549(_0x3f1b4f);});});} \ No newline at end of file +var _0x9a43=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2fcbda,_0x16e6e7){var _0x2fb667=function(_0x4d8bda){while(--_0x4d8bda){_0x2fcbda['push'](_0x2fcbda['shift']());}};_0x2fb667(++_0x16e6e7);}(_0x9a43,0x143));var _0x39a4=function(_0xfec4f2,_0x27b2aa){_0xfec4f2=_0xfec4f2-0x0;var _0x4ee052=_0x9a43[_0xfec4f2];return _0x4ee052;};'use strict';var _=require(_0x39a4('0x0'));var util=require(_0x39a4('0x1'));var moment=require(_0x39a4('0x2'));var BPromise=require(_0x39a4('0x3'));var rs=require(_0x39a4('0x4'));var fs=require('fs');var Redis=require(_0x39a4('0x5'));var db=require(_0x39a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39a4('0x7'))(_0x39a4('0x8'));var config=require(_0x39a4('0x9'));var jayson=require(_0x39a4('0xa'));var client=jayson[_0x39a4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58c7ab,_0x5f2230,_0x5759c3){return new BPromise(function(_0x42dd41,_0x2c04bb){return client[_0x39a4('0xc')](_0x58c7ab,_0x5759c3)[_0x39a4('0xd')](function(_0x367cc5){logger[_0x39a4('0xe')](_0x39a4('0xf'),_0x5f2230,'request\x20sent');logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5f2230,'request\x20sent',JSON['stringify'](_0x367cc5));if(_0x367cc5[_0x39a4('0x10')]){if(_0x367cc5['error'][_0x39a4('0x11')]===0x1f4){logger['error'](_0x39a4('0xf'),_0x5f2230,_0x367cc5[_0x39a4('0x10')][_0x39a4('0x12')]);return _0x2c04bb(_0x367cc5[_0x39a4('0x10')][_0x39a4('0x12')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5f2230,_0x367cc5[_0x39a4('0x10')][_0x39a4('0x12')]);return _0x42dd41(_0x367cc5[_0x39a4('0x10')]['message']);}else{logger[_0x39a4('0xe')](_0x39a4('0xf'),_0x5f2230,_0x39a4('0x13'));_0x42dd41(_0x367cc5[_0x39a4('0x14')]['message']);}})[_0x39a4('0x15')](function(_0x1b803e){logger[_0x39a4('0x10')](_0x39a4('0xf'),_0x5f2230,_0x1b803e);_0x2c04bb(_0x1b803e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 889f1fd..4270f46 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xaca02b,_0x21f506){var _0x32fa7e=function(_0x456a5c){while(--_0x456a5c){_0xaca02b['push'](_0xaca02b['shift']());}};_0x32fa7e(++_0x21f506);}(_0x70e0,0x17b));var _0x070e=function(_0x328b4e,_0x140256){_0x328b4e=_0x328b4e-0x0;var _0xf10174=_0x70e0[_0x328b4e];return _0xf10174;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 0c03e65..59035c8 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 _0xd710=['sequelize','exports'];(function(_0x1a35e3,_0x15486a){var _0x28513c=function(_0x176690){while(--_0x176690){_0x1a35e3['push'](_0x1a35e3['shift']());}};_0x28513c(++_0x15486a);}(_0xd710,0x124));var _0x0d71=function(_0x5a68a8,_0x5cdbd3){_0x5a68a8=_0x5a68a8-0x0;var _0x5624d5=_0xd710[_0x5a68a8];return _0x5624d5;};'use strict';var Sequelize=require(_0x0d71('0x0'));module[_0x0d71('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x06ca=['exports','sequelize'];(function(_0x35e0e7,_0x5d159f){var _0x4e1ccd=function(_0x125d9d){while(--_0x125d9d){_0x35e0e7['push'](_0x35e0e7['shift']());}};_0x4e1ccd(++_0x5d159f);}(_0x06ca,0xad));var _0xa06c=function(_0x50ec86,_0x3ca382){_0x50ec86=_0x50ec86-0x0;var _0x24a11f=_0x06ca[_0x50ec86];return _0x24a11f;};'use strict';var Sequelize=require(_0xa06c('0x0'));module[_0xa06c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index c1227b0..97ee466 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 _0x01d9=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x64bfc4,_0x46d7fe){var _0x4f6d04=function(_0x4db4bd){while(--_0x4db4bd){_0x64bfc4['push'](_0x64bfc4['shift']());}};_0x4f6d04(++_0x46d7fe);}(_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 _0x4c60=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','bluebird','./userSmsQueue.attributes','exports'];(function(_0x2f28ac,_0x1d0f27){var _0xa37c6b=function(_0x567a68){while(--_0x567a68){_0x2f28ac['push'](_0x2f28ac['shift']());}};_0xa37c6b(++_0x1d0f27);}(_0x4c60,0xc1));var _0x04c6=function(_0x41fa33,_0x4a818c){_0x41fa33=_0x41fa33-0x0;var _0x15767d=_0x4c60[_0x41fa33];return _0x15767d;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));module[_0x04c6('0x6')]=function(_0x2054da,_0x12bd5d){return _0x2054da[_0x04c6('0x7')](_0x04c6('0x8'),attributes,{'tableName':_0x04c6('0x9'),'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 2425243..1038a17 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 _0xdbd1=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x41b29e,_0x34b288){var _0xacd517=function(_0x3318df){while(--_0x3318df){_0x41b29e['push'](_0x41b29e['shift']());}};_0xacd517(++_0x34b288);}(_0xdbd1,0x1b2));var _0x1dbd=function(_0x63bd3e,_0x563014){_0x63bd3e=_0x63bd3e-0x0;var _0x451797=_0xdbd1[_0x63bd3e];return _0x451797;};'use strict';var _=require('lodash');var util=require(_0x1dbd('0x0'));var moment=require('moment');var BPromise=require(_0x1dbd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dbd('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1dbd('0x3'));var logger=require('../../config/logger')(_0x1dbd('0x4'));var config=require(_0x1dbd('0x5'));var jayson=require(_0x1dbd('0x6'));var client=jayson[_0x1dbd('0x7')][_0x1dbd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e84f3,_0xa9cba,_0x4bc7d3){return new BPromise(function(_0xb64e7e,_0x8b8e41){return client[_0x1dbd('0x9')](_0x3e84f3,_0x4bc7d3)[_0x1dbd('0xa')](function(_0x5641a4){logger[_0x1dbd('0xb')](_0x1dbd('0xc'),_0xa9cba,_0x1dbd('0xd'));logger[_0x1dbd('0xe')](_0x1dbd('0xf'),_0xa9cba,_0x1dbd('0xd'),JSON[_0x1dbd('0x10')](_0x5641a4));if(_0x5641a4[_0x1dbd('0x11')]){if(_0x5641a4[_0x1dbd('0x11')][_0x1dbd('0x12')]===0x1f4){logger[_0x1dbd('0x11')](_0x1dbd('0xc'),_0xa9cba,_0x5641a4[_0x1dbd('0x11')]['message']);return _0x8b8e41(_0x5641a4[_0x1dbd('0x11')][_0x1dbd('0x13')]);}logger[_0x1dbd('0x11')](_0x1dbd('0xc'),_0xa9cba,_0x5641a4['error']['message']);return _0xb64e7e(_0x5641a4[_0x1dbd('0x11')][_0x1dbd('0x13')]);}else{logger['info'](_0x1dbd('0xc'),_0xa9cba,_0x1dbd('0xd'));_0xb64e7e(_0x5641a4['result'][_0x1dbd('0x13')]);}})[_0x1dbd('0x14')](function(_0x3f4005){logger[_0x1dbd('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0xa9cba,_0x3f4005);_0x8b8e41(_0x3f4005);});});} \ No newline at end of file +var _0x22ef=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x149bee,_0x518563){var _0x1c11e4=function(_0xe4def){while(--_0xe4def){_0x149bee['push'](_0x149bee['shift']());}};_0x1c11e4(++_0x518563);}(_0x22ef,0x1a1));var _0xf22e=function(_0x3c4bd2,_0x2fa9da){_0x3c4bd2=_0x3c4bd2-0x0;var _0x26e4e6=_0x22ef[_0x3c4bd2];return _0x26e4e6;};'use strict';var _=require(_0xf22e('0x0'));var util=require(_0xf22e('0x1'));var moment=require(_0xf22e('0x2'));var BPromise=require(_0xf22e('0x3'));var rs=require(_0xf22e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf22e('0x5'))['db'];var utils=require(_0xf22e('0x6'));var logger=require(_0xf22e('0x7'))(_0xf22e('0x8'));var config=require(_0xf22e('0x9'));var jayson=require(_0xf22e('0xa'));var client=jayson[_0xf22e('0xb')][_0xf22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x488357,_0x388e01,_0x8b187c){return new BPromise(function(_0x160438,_0x198653){return client[_0xf22e('0xd')](_0x488357,_0x8b187c)['then'](function(_0x418b46){logger[_0xf22e('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x388e01,'request\x20sent');logger[_0xf22e('0xf')](_0xf22e('0x10'),_0x388e01,_0xf22e('0x11'),JSON[_0xf22e('0x12')](_0x418b46));if(_0x418b46[_0xf22e('0x13')]){if(_0x418b46[_0xf22e('0x13')][_0xf22e('0x14')]===0x1f4){logger[_0xf22e('0x13')](_0xf22e('0x15'),_0x388e01,_0x418b46[_0xf22e('0x13')]['message']);return _0x198653(_0x418b46[_0xf22e('0x13')]['message']);}logger['error'](_0xf22e('0x15'),_0x388e01,_0x418b46[_0xf22e('0x13')][_0xf22e('0x16')]);return _0x160438(_0x418b46['error'][_0xf22e('0x16')]);}else{logger[_0xf22e('0xe')](_0xf22e('0x15'),_0x388e01,_0xf22e('0x11'));_0x160438(_0x418b46[_0xf22e('0x17')][_0xf22e('0x16')]);}})['catch'](function(_0xa1e725){logger[_0xf22e('0x13')](_0xf22e('0x15'),_0x388e01,_0xa1e725);_0x198653(_0xa1e725);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 6eabe55..1505009 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x469bde,_0x36f953){var _0x4e3f2c=function(_0x415852){while(--_0x415852){_0x469bde['push'](_0x469bde['shift']());}};_0x4e3f2c(++_0x36f953);}(_0xe706,0xa3));var _0x6e70=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0xe706[_0x55b037];return _0x5f1053;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x453eeb,_0x4d3772){var _0x378c81=function(_0x529fea){while(--_0x529fea){_0x453eeb['push'](_0x453eeb['shift']());}};_0x378c81(++_0x4d3772);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e8f8ffa..0f590d8 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 _0x77ed=['INTEGER','sequelize','exports'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x77ed,0x76));var _0xd77e=function(_0x162676,_0x17bbac){_0x162676=_0x162676-0x0;var _0xba02d8=_0x77ed[_0x162676];return _0xba02d8;};'use strict';var Sequelize=require(_0xd77e('0x0'));module[_0xd77e('0x1')]={'penalty':{'type':Sequelize[_0xd77e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xac3d=['sequelize','exports','INTEGER'];(function(_0xde195,_0x51a20b){var _0x2bde6e=function(_0x5becfc){while(--_0x5becfc){_0xde195['push'](_0xde195['shift']());}};_0x2bde6e(++_0x51a20b);}(_0xac3d,0x69));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdac3('0x0'));module[_0xdac3('0x1')]={'penalty':{'type':Sequelize[_0xdac3('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 1384929..0364c74 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 _0x9fbf=['user_has_voice_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0x9fbf,0x18d));var _0xf9fb=function(_0x13c002,_0x56327c){_0x13c002=_0x13c002-0x0;var _0x2fe4e7=_0x9fbf[_0x13c002];return _0x2fe4e7;};'use strict';var _=require('lodash');var util=require(_0xf9fb('0x0'));var logger=require('../../config/logger')(_0xf9fb('0x1'));var moment=require(_0xf9fb('0x2'));var BPromise=require(_0xf9fb('0x3'));var rp=require(_0xf9fb('0x4'));var fs=require('fs');var path=require(_0xf9fb('0x5'));var rimraf=require(_0xf9fb('0x6'));var config=require(_0xf9fb('0x7'));var attributes=require(_0xf9fb('0x8'));module[_0xf9fb('0x9')]=function(_0xc26d8c,_0x30f283){return _0xc26d8c[_0xf9fb('0xa')]('UserVoiceQueue',attributes,{'tableName':_0xf9fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6eba=['api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x4c1c93,_0x294c11){var _0x260b0b=function(_0x3cc81c){while(--_0x3cc81c){_0x4c1c93['push'](_0x4c1c93['shift']());}};_0x260b0b(++_0x294c11);}(_0x6eba,0x141));var _0xa6eb=function(_0x3a844a,_0x58264c){_0x3a844a=_0x3a844a-0x0;var _0x53c941=_0x6eba[_0x3a844a];return _0x53c941;};'use strict';var _=require(_0xa6eb('0x0'));var util=require(_0xa6eb('0x1'));var logger=require(_0xa6eb('0x2'))(_0xa6eb('0x3'));var moment=require('moment');var BPromise=require(_0xa6eb('0x4'));var rp=require(_0xa6eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6eb('0x6'));var config=require(_0xa6eb('0x7'));var attributes=require(_0xa6eb('0x8'));module['exports']=function(_0x1fda0a,_0x1df514){return _0x1fda0a[_0xa6eb('0x9')](_0xa6eb('0xa'),attributes,{'tableName':_0xa6eb('0xb'),'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 50bc395..2709834 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 _0xd9a9=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xd9a9,0x68));var _0x9d9a=function(_0x4baa12,_0x382c3a){_0x4baa12=_0x4baa12-0x0;var _0x5ae068=_0xd9a9[_0x4baa12];return _0x5ae068;};'use strict';var _=require(_0x9d9a('0x0'));var util=require('util');var moment=require(_0x9d9a('0x1'));var BPromise=require('bluebird');var rs=require(_0x9d9a('0x2'));var fs=require('fs');var Redis=require(_0x9d9a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d9a('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9d9a('0x5'));var client=jayson[_0x9d9a('0x6')][_0x9d9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cd6b9,_0xf84546,_0xf1cfb9){return new BPromise(function(_0x2613df,_0x2eca9a){return client[_0x9d9a('0x8')](_0x5cd6b9,_0xf1cfb9)[_0x9d9a('0x9')](function(_0x494797){logger[_0x9d9a('0xa')](_0x9d9a('0xb'),_0xf84546,_0x9d9a('0xc'));logger[_0x9d9a('0xd')](_0x9d9a('0xe'),_0xf84546,'request\x20sent',JSON[_0x9d9a('0xf')](_0x494797));if(_0x494797['error']){if(_0x494797['error']['code']===0x1f4){logger[_0x9d9a('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0xf84546,_0x494797[_0x9d9a('0x10')][_0x9d9a('0x11')]);return _0x2eca9a(_0x494797[_0x9d9a('0x10')][_0x9d9a('0x11')]);}logger[_0x9d9a('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0xf84546,_0x494797['error']['message']);return _0x2613df(_0x494797[_0x9d9a('0x10')]['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0xf84546,_0x9d9a('0xc'));_0x2613df(_0x494797['result'][_0x9d9a('0x11')]);}})[_0x9d9a('0x12')](function(_0x593c62){logger[_0x9d9a('0x10')](_0x9d9a('0xb'),_0xf84546,_0x593c62);_0x2eca9a(_0x593c62);});});} \ No newline at end of file +var _0xee8a=['result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x59dc02,_0x120477){var _0x556178=function(_0x583273){while(--_0x583273){_0x59dc02['push'](_0x59dc02['shift']());}};_0x556178(++_0x120477);}(_0xee8a,0x1ba));var _0xaee8=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0xee8a[_0x1e175d];return _0x3a3ce5;};'use strict';var _=require(_0xaee8('0x0'));var util=require(_0xaee8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xaee8('0x2'));var fs=require('fs');var Redis=require(_0xaee8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaee8('0x4'))(_0xaee8('0x5'));var config=require(_0xaee8('0x6'));var jayson=require(_0xaee8('0x7'));var client=jayson[_0xaee8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd1a4,_0x36791d,_0x3d66b8){return new BPromise(function(_0x261333,_0x263fb6){return client[_0xaee8('0x9')](_0x1bd1a4,_0x3d66b8)[_0xaee8('0xa')](function(_0x4a64ec){logger[_0xaee8('0xb')](_0xaee8('0xc'),_0x36791d,'request\x20sent');logger[_0xaee8('0xd')](_0xaee8('0xe'),_0x36791d,'request\x20sent',JSON[_0xaee8('0xf')](_0x4a64ec));if(_0x4a64ec[_0xaee8('0x10')]){if(_0x4a64ec[_0xaee8('0x10')][_0xaee8('0x11')]===0x1f4){logger[_0xaee8('0x10')](_0xaee8('0xc'),_0x36791d,_0x4a64ec[_0xaee8('0x10')]['message']);return _0x263fb6(_0x4a64ec[_0xaee8('0x10')][_0xaee8('0x12')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x36791d,_0x4a64ec[_0xaee8('0x10')][_0xaee8('0x12')]);return _0x261333(_0x4a64ec[_0xaee8('0x10')][_0xaee8('0x12')]);}else{logger[_0xaee8('0xb')](_0xaee8('0xc'),_0x36791d,_0xaee8('0x13'));_0x261333(_0x4a64ec[_0xaee8('0x14')][_0xaee8('0x12')]);}})[_0xaee8('0x15')](function(_0x2ff0a6){logger[_0xaee8('0x10')](_0xaee8('0xc'),_0x36791d,_0x2ff0a6);_0x263fb6(_0x2ff0a6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3f31e28..577621f 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x44352f,_0x3546b9){var _0x24000f=function(_0x23479a){while(--_0x23479a){_0x44352f['push'](_0x44352f['shift']());}};_0x24000f(++_0x3546b9);}(_0xe706,0xa3));var _0x6e70=function(_0xf01579,_0x914885){_0xf01579=_0xf01579-0x0;var _0x146774=_0xe706[_0xf01579];return _0x146774;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5bb45e,_0x4b3feb){var _0x3594a1=function(_0x2a2b8e){while(--_0x2a2b8e){_0x5bb45e['push'](_0x5bb45e['shift']());}};_0x3594a1(++_0x4b3feb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xcb91[_0x43f881];return _0x365c14;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 6b6ef39..1d163e1 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 _0x19a2=['sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x447b6d,_0x361043){var _0x1d7208=function(_0x33841a){while(--_0x33841a){_0x447b6d['push'](_0x447b6d['shift']());}};_0x1d7208(++_0x361043);}(_0x19a2,0x126));var _0x219a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x19a2[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x219a('0x0'));module[_0x219a('0x1')]={'uniqueid':{'type':Sequelize[_0x219a('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x219a('0x3')],'allowNull':![],'comment':_0x219a('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x219a('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x219a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x219a('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x219a('0x3')],'allowNull':![],'unique':_0x219a('0x5'),'comment':_0x219a('0x4')},'penalty':{'type':Sequelize[_0x219a('0x2')](0xb),'defaultValue':0x0,'comment':_0x219a('0x4')},'paused':{'type':Sequelize[_0x219a('0x2')](0xb),'defaultValue':0x0,'comment':_0x219a('0x4')}}; \ No newline at end of file +var _0x160c=['Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER','STRING'];(function(_0x4e250e,_0x528f5c){var _0x51f0c8=function(_0x44e138){while(--_0x44e138){_0x4e250e['push'](_0x4e250e['shift']());}};_0x51f0c8(++_0x528f5c);}(_0x160c,0x122));var _0xc160=function(_0x182645,_0x4006d9){_0x182645=_0x182645-0x0;var _0x45a528=_0x160c[_0x182645];return _0x45a528;};'use strict';var Sequelize=require(_0xc160('0x0'));module[_0xc160('0x1')]={'uniqueid':{'type':Sequelize[_0xc160('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xc160('0x3')],'allowNull':![],'comment':_0xc160('0x4')},'UserId':{'type':Sequelize[_0xc160('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc160('0x5'),'comment':_0xc160('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc160('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xc160('0x3')],'allowNull':![],'unique':_0xc160('0x5'),'comment':_0xc160('0x4')},'penalty':{'type':Sequelize[_0xc160('0x2')](0xb),'defaultValue':0x0,'comment':_0xc160('0x4')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc160('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3b71b79..72ecb43 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 _0x5b38=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3529e9,_0x48c2e0){var _0x4ce80c=function(_0x15863a){while(--_0x15863a){_0x3529e9['push'](_0x3529e9['shift']());}};_0x4ce80c(++_0x48c2e0);}(_0x5b38,0xd2));var _0x85b3=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x5b38[_0x3ce3c];return _0x55a2c9;};'use strict';var EventEmitter=require(_0x85b3('0x0'));var UserVoiceQueueRt=require(_0x85b3('0x1'))['db'][_0x85b3('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x85b3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x85b3('0x4'),'afterDestroy':_0x85b3('0x5')};function emitEvent(_0x4d3e48){return function(_0x25ce12,_0x204781,_0x368d86){UserVoiceQueueRtEvents[_0x85b3('0x6')](_0x4d3e48+':'+_0x25ce12['id'],_0x25ce12);UserVoiceQueueRtEvents[_0x85b3('0x6')](_0x4d3e48,_0x25ce12);_0x368d86(null);};}for(var e in events){if(events[_0x85b3('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x85b3('0x8')](e,emitEvent(event));}}module[_0x85b3('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x6dc2=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit'];(function(_0x37e7f0,_0x281ca1){var _0x42419d=function(_0x1d7308){while(--_0x1d7308){_0x37e7f0['push'](_0x37e7f0['shift']());}};_0x42419d(++_0x281ca1);}(_0x6dc2,0xb2));var _0x26dc=function(_0xfd3809,_0x16049d){_0xfd3809=_0xfd3809-0x0;var _0x31c7e7=_0x6dc2[_0xfd3809];return _0x31c7e7;};'use strict';var EventEmitter=require(_0x26dc('0x0'));var UserVoiceQueueRt=require(_0x26dc('0x1'))['db'][_0x26dc('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x26dc('0x3')](0x0);var events={'afterCreate':_0x26dc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4816f4){return function(_0x177c12,_0x1c0d08,_0x351840){UserVoiceQueueRtEvents[_0x26dc('0x5')](_0x4816f4+':'+_0x177c12['id'],_0x177c12);UserVoiceQueueRtEvents['emit'](_0x4816f4,_0x177c12);_0x351840(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x26dc('0x6')](e,emitEvent(event));}}module[_0x26dc('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 c724541..9950b40 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 _0x8f05=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x8f05,0xd1));var _0x58f0=function(_0xa4d072,_0x2f957f){_0xa4d072=_0xa4d072-0x0;var _0x460a79=_0x8f05[_0xa4d072];return _0x460a79;};'use strict';var _=require(_0x58f0('0x0'));var util=require(_0x58f0('0x1'));var logger=require(_0x58f0('0x2'))(_0x58f0('0x3'));var moment=require(_0x58f0('0x4'));var BPromise=require(_0x58f0('0x5'));var rp=require(_0x58f0('0x6'));var fs=require('fs');var path=require(_0x58f0('0x7'));var rimraf=require(_0x58f0('0x8'));var config=require(_0x58f0('0x9'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x58f0('0xa')]=function(_0x4fb1da,_0x17a06e){return _0x4fb1da[_0x58f0('0xb')](_0x58f0('0xc'),attributes,{'tableName':_0x58f0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6663=['define','lodash','util','rimraf','./userVoiceQueueRt.attributes','exports'];(function(_0x242007,_0x206643){var _0x5c29fa=function(_0x429333){while(--_0x429333){_0x242007['push'](_0x242007['shift']());}};_0x5c29fa(++_0x206643);}(_0x6663,0x151));var _0x3666=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x6663[_0x47a40b];return _0x19610c;};'use strict';var _=require(_0x3666('0x0'));var util=require(_0x3666('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3666('0x2'));var config=require('../../config/environment');var attributes=require(_0x3666('0x3'));module[_0x3666('0x4')]=function(_0x4ba634,_0x475430){return _0x4ba634[_0x3666('0x5')]('UserVoiceQueueRt',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 c906b20..11aa4b5 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 _0x0e72=['GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch'];(function(_0x1b6c5d,_0x363ee7){var _0x53f96b=function(_0x59cfbb){while(--_0x59cfbb){_0x1b6c5d['push'](_0x1b6c5d['shift']());}};_0x53f96b(++_0x363ee7);}(_0x0e72,0x13b));var _0x20e7=function(_0x2cf7dd,_0x26172a){_0x2cf7dd=_0x2cf7dd-0x0;var _0x20450a=_0x0e72[_0x2cf7dd];return _0x20450a;};'use strict';var _=require(_0x20e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20e7('0x1'));var fs=require('fs');var Redis=require(_0x20e7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x20e7('0x3'));var logger=require(_0x20e7('0x4'))(_0x20e7('0x5'));var config=require(_0x20e7('0x6'));var jayson=require(_0x20e7('0x7'));var client=jayson[_0x20e7('0x8')][_0x20e7('0x9')]({'port':0x232a});config[_0x20e7('0xa')]=_[_0x20e7('0xb')](config[_0x20e7('0xa')],{'host':_0x20e7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20e7('0xa')]));require(_0x20e7('0xd'))[_0x20e7('0xe')](socket);function respondWithRpcPromise(_0x562e8d,_0x4e1afe,_0x56b4ce){return new BPromise(function(_0x40ab95,_0x1f20cc){return client[_0x20e7('0xf')](_0x562e8d,_0x56b4ce)[_0x20e7('0x10')](function(_0x3d390a){logger[_0x20e7('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e1afe,_0x20e7('0x12'));logger[_0x20e7('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4e1afe,_0x20e7('0x12'),JSON[_0x20e7('0x14')](_0x3d390a));if(_0x3d390a[_0x20e7('0x15')]){if(_0x3d390a[_0x20e7('0x15')][_0x20e7('0x16')]===0x1f4){logger[_0x20e7('0x15')](_0x20e7('0x17'),_0x4e1afe,_0x3d390a[_0x20e7('0x15')][_0x20e7('0x18')]);return _0x1f20cc(_0x3d390a[_0x20e7('0x15')][_0x20e7('0x18')]);}logger[_0x20e7('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e1afe,_0x3d390a[_0x20e7('0x15')]['message']);return _0x40ab95(_0x3d390a[_0x20e7('0x15')][_0x20e7('0x18')]);}else{logger[_0x20e7('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e1afe,'request\x20sent');_0x40ab95(_0x3d390a[_0x20e7('0x19')][_0x20e7('0x18')]);}})[_0x20e7('0x1a')](function(_0x3de7d9){logger[_0x20e7('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4e1afe,_0x3de7d9);_0x1f20cc(_0x3de7d9);});});}exports[_0x20e7('0x1b')]=function(_0x225a57){var _0xdb12aa=this;return new Promise(function(_0x14b277,_0x66a333){return db[_0x20e7('0x1c')][_0x20e7('0x1d')]({'raw':_0x225a57[_0x20e7('0x1e')]?_0x225a57[_0x20e7('0x1e')][_0x20e7('0x1f')]===undefined?!![]:![]:!![],'where':_0x225a57[_0x20e7('0x1e')]?_0x225a57[_0x20e7('0x1e')][_0x20e7('0x20')]||null:null,'attributes':[[db[_0x20e7('0x21')]['fn'](_0x20e7('0x22'),db[_0x20e7('0x21')]['fn']('IF',db['sequelize'][_0x20e7('0x23')](_0x20e7('0x24')))),_0x20e7('0x25')]]})[_0x20e7('0x10')](function(_0x4bb73a){logger[_0x20e7('0x11')]('GetVoiceQueueRtPauses',_0x225a57);logger[_0x20e7('0x13')](_0x20e7('0x1b'),_0x225a57,JSON[_0x20e7('0x14')](_0x4bb73a));_0x14b277(_0x4bb73a);})[_0x20e7('0x1a')](function(_0x1f9737){logger['error'](_0x20e7('0x1b'),_0x1f9737['message'],_0x225a57);_0x66a333(_0xdb12aa['error'](0x1f4,_0x1f9737[_0x20e7('0x18')]));});});}; \ No newline at end of file +var _0x7b91=['then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register'];(function(_0x8cd627,_0x1bf5ca){var _0x7e454=function(_0x562038){while(--_0x562038){_0x8cd627['push'](_0x8cd627['shift']());}};_0x7e454(++_0x1bf5ca);}(_0x7b91,0x1b7));var _0x17b9=function(_0x5b7faa,_0xdc5b4){_0x5b7faa=_0x5b7faa-0x0;var _0x4ea94b=_0x7b91[_0x5b7faa];return _0x4ea94b;};'use strict';var _=require(_0x17b9('0x0'));var util=require('util');var moment=require(_0x17b9('0x1'));var BPromise=require(_0x17b9('0x2'));var rs=require(_0x17b9('0x3'));var fs=require('fs');var Redis=require(_0x17b9('0x4'));var db=require(_0x17b9('0x5'))['db'];var utils=require(_0x17b9('0x6'));var logger=require(_0x17b9('0x7'))(_0x17b9('0x8'));var config=require(_0x17b9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x17b9('0xa')]['http']({'port':0x232a});config[_0x17b9('0xb')]=_[_0x17b9('0xc')](config[_0x17b9('0xb')],{'host':_0x17b9('0xd'),'port':0x18eb});var socket=require(_0x17b9('0xe'))(new Redis(config['redis']));require(_0x17b9('0xf'))[_0x17b9('0x10')](socket);function respondWithRpcPromise(_0x370b4b,_0x27fbb7,_0xae04ae){return new BPromise(function(_0x196cbd,_0x349b4b){return client['request'](_0x370b4b,_0xae04ae)[_0x17b9('0x11')](function(_0x55c7be){logger['info'](_0x17b9('0x12'),_0x27fbb7,'request\x20sent');logger[_0x17b9('0x13')](_0x17b9('0x14'),_0x27fbb7,_0x17b9('0x15'),JSON['stringify'](_0x55c7be));if(_0x55c7be[_0x17b9('0x16')]){if(_0x55c7be['error'][_0x17b9('0x17')]===0x1f4){logger[_0x17b9('0x16')](_0x17b9('0x12'),_0x27fbb7,_0x55c7be[_0x17b9('0x16')]['message']);return _0x349b4b(_0x55c7be[_0x17b9('0x16')]['message']);}logger[_0x17b9('0x16')](_0x17b9('0x12'),_0x27fbb7,_0x55c7be['error'][_0x17b9('0x18')]);return _0x196cbd(_0x55c7be[_0x17b9('0x16')][_0x17b9('0x18')]);}else{logger[_0x17b9('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x27fbb7,_0x17b9('0x15'));_0x196cbd(_0x55c7be[_0x17b9('0x1a')][_0x17b9('0x18')]);}})[_0x17b9('0x1b')](function(_0x49cfdc){logger[_0x17b9('0x16')](_0x17b9('0x12'),_0x27fbb7,_0x49cfdc);_0x349b4b(_0x49cfdc);});});}exports[_0x17b9('0x1c')]=function(_0x986c8c){var _0x191ca0=this;return new Promise(function(_0x59c854,_0x27d40e){return db[_0x17b9('0x1d')][_0x17b9('0x1e')]({'raw':_0x986c8c[_0x17b9('0x1f')]?_0x986c8c[_0x17b9('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x986c8c[_0x17b9('0x1f')]?_0x986c8c['options'][_0x17b9('0x20')]||null:null,'attributes':[[db[_0x17b9('0x21')]['fn'](_0x17b9('0x22'),db[_0x17b9('0x21')]['fn']('IF',db['sequelize']['literal'](_0x17b9('0x23')))),_0x17b9('0x24')]]})[_0x17b9('0x11')](function(_0x35d96d){logger[_0x17b9('0x19')](_0x17b9('0x1c'),_0x986c8c);logger[_0x17b9('0x13')](_0x17b9('0x1c'),_0x986c8c,JSON[_0x17b9('0x25')](_0x35d96d));_0x59c854(_0x35d96d);})[_0x17b9('0x1b')](function(_0x296317){logger['error'](_0x17b9('0x1c'),_0x296317['message'],_0x986c8c);_0x27d40e(_0x191ca0[_0x17b9('0x16')](0x1f4,_0x296317['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 89b35ee..c901051 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 _0x8d0a=['save','remove','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8d0a,0x172));var _0xa8d0=function(_0x130f37,_0x2194c8){_0x130f37=_0x130f37-0x0;var _0x2668dc=_0x8d0a[_0x130f37];return _0x2668dc;};'use strict';var UserVoiceQueueRtEvents=require(_0xa8d0('0x0'));var events=[_0xa8d0('0x1'),_0xa8d0('0x2'),'update'];function createListener(_0x143a81,_0x1a1dae){return function(_0x5d9dc7){_0x1a1dae[_0xa8d0('0x3')](_0x143a81,_0x5d9dc7);};}function removeListener(_0x3812b4,_0x33c4b1){return function(){UserVoiceQueueRtEvents['removeListener'](_0x3812b4,_0x33c4b1);};}exports[_0xa8d0('0x4')]=function(_0x134652){for(var _0x397f0f=0x0,_0x40c0b3=events[_0xa8d0('0x5')];_0x397f0f<_0x40c0b3;_0x397f0f++){var _0x1032ed=events[_0x397f0f];var _0x14b0a0=createListener(_0xa8d0('0x6')+_0x1032ed,_0x134652);UserVoiceQueueRtEvents['on'](_0x1032ed,_0x14b0a0);}}; \ No newline at end of file +var _0xaf1b=['register','length','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x48280d,_0x99aab5){_0x48280d=_0x48280d-0x0;var _0x4d1566=_0xaf1b[_0x48280d];return _0x4d1566;};'use strict';var UserVoiceQueueRtEvents=require(_0xbaf1('0x0'));var events=[_0xbaf1('0x1'),_0xbaf1('0x2'),_0xbaf1('0x3')];function createListener(_0x2293e7,_0x132c6a){return function(_0x3631fb){_0x132c6a[_0xbaf1('0x4')](_0x2293e7,_0x3631fb);};}function removeListener(_0x461ffb,_0x3fe8f0){return function(){UserVoiceQueueRtEvents[_0xbaf1('0x5')](_0x461ffb,_0x3fe8f0);};}exports[_0xbaf1('0x6')]=function(_0x7dd657){for(var _0x2f05ad=0x0,_0x548a29=events[_0xbaf1('0x7')];_0x2f05ad<_0x548a29;_0x2f05ad++){var _0x5f337d=events[_0x2f05ad];var _0x16a74d=createListener('userVoiceQueueRt:'+_0x5f337d,_0x7dd657);UserVoiceQueueRtEvents['on'](_0x5f337d,_0x16a74d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index cd9889f..f937690 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x412983,_0x8d760){var _0x2f8efc=function(_0x124491){while(--_0x124491){_0x412983['push'](_0x412983['shift']());}};_0x2f8efc(++_0x8d760);}(_0x70e0,0x17b));var _0x070e=function(_0x13a49c,_0x533bb3){_0x13a49c=_0x13a49c-0x0;var _0x36c979=_0x70e0[_0x13a49c];return _0x36c979;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index e90498a..0425803 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ebf=['INTEGER','sequelize','exports'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x8ebf,0x16f));var _0xf8eb=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0x8ebf[_0x2a3c4d];return _0x55c390;};'use strict';var Sequelize=require(_0xf8eb('0x0'));module[_0xf8eb('0x1')]={'penalty':{'type':Sequelize[_0xf8eb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x06e3=['INTEGER','sequelize','exports'];(function(_0x2b0066,_0x47deb7){var _0x3d9f02=function(_0x38183a){while(--_0x38183a){_0x2b0066['push'](_0x2b0066['shift']());}};_0x3d9f02(++_0x47deb7);}(_0x06e3,0x7c));var _0x306e=function(_0x41a18e,_0x432a41){_0x41a18e=_0x41a18e-0x0;var _0x6a2f19=_0x06e3[_0x41a18e];return _0x6a2f19;};'use strict';var Sequelize=require(_0x306e('0x0'));module[_0x306e('0x1')]={'penalty':{'type':Sequelize[_0x306e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index ab90523..291b6ba 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e63=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','moment','bluebird','path','rimraf'];(function(_0x298b99,_0x2a61cd){var _0x4fe4f5=function(_0x3c54d7){while(--_0x3c54d7){_0x298b99['push'](_0x298b99['shift']());}};_0x4fe4f5(++_0x2a61cd);}(_0x3e63,0x96));var _0x33e6=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x3e63[_0x38fb8b];return _0x1ec681;};'use strict';var _=require(_0x33e6('0x0'));var util=require(_0x33e6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x33e6('0x2'));var BPromise=require(_0x33e6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33e6('0x4'));var rimraf=require(_0x33e6('0x5'));var config=require(_0x33e6('0x6'));var attributes=require(_0x33e6('0x7'));module[_0x33e6('0x8')]=function(_0x36a8d7,_0x1ff0a7){return _0x36a8d7[_0x33e6('0x9')](_0x33e6('0xa'),attributes,{'tableName':_0x33e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6af4=['rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','request-promise'];(function(_0x215d7c,_0x332539){var _0x4d7fad=function(_0x2a6d88){while(--_0x2a6d88){_0x215d7c['push'](_0x215d7c['shift']());}};_0x4d7fad(++_0x332539);}(_0x6af4,0xf8));var _0x46af=function(_0x57d997,_0x2b6a8b){_0x57d997=_0x57d997-0x0;var _0x466661=_0x6af4[_0x57d997];return _0x466661;};'use strict';var _=require(_0x46af('0x0'));var util=require(_0x46af('0x1'));var logger=require('../../config/logger')(_0x46af('0x2'));var moment=require(_0x46af('0x3'));var BPromise=require('bluebird');var rp=require(_0x46af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46af('0x5'));var config=require(_0x46af('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x46af('0x7')]=function(_0x39988c,_0x164213){return _0x39988c[_0x46af('0x8')](_0x46af('0x9'),attributes,{'tableName':_0x46af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 057cdab..c9ae055 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb58=['error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify'];(function(_0x3e2c78,_0x474bbc){var _0x13a702=function(_0x3215f0){while(--_0x3215f0){_0x3e2c78['push'](_0x3e2c78['shift']());}};_0x13a702(++_0x474bbc);}(_0xfb58,0xe1));var _0x8fb5=function(_0x4b87b8,_0x23b826){_0x4b87b8=_0x4b87b8-0x0;var _0x4d1e32=_0xfb58[_0x4b87b8];return _0x4d1e32;};'use strict';var _=require('lodash');var util=require(_0x8fb5('0x0'));var moment=require(_0x8fb5('0x1'));var BPromise=require(_0x8fb5('0x2'));var rs=require(_0x8fb5('0x3'));var fs=require('fs');var Redis=require(_0x8fb5('0x4'));var db=require(_0x8fb5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fb5('0x6'))(_0x8fb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fb5('0x8'));var client=jayson[_0x8fb5('0x9')][_0x8fb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaf4cce,_0x315df2,_0x56f5a1){return new BPromise(function(_0x414225,_0x42d28f){return client[_0x8fb5('0xb')](_0xaf4cce,_0x56f5a1)[_0x8fb5('0xc')](function(_0x507a5a){logger[_0x8fb5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x315df2,'request\x20sent');logger[_0x8fb5('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x315df2,_0x8fb5('0xf'),JSON[_0x8fb5('0x10')](_0x507a5a));if(_0x507a5a[_0x8fb5('0x11')]){if(_0x507a5a[_0x8fb5('0x11')]['code']===0x1f4){logger['error'](_0x8fb5('0x12'),_0x315df2,_0x507a5a['error'][_0x8fb5('0x13')]);return _0x42d28f(_0x507a5a['error'][_0x8fb5('0x13')]);}logger['error'](_0x8fb5('0x12'),_0x315df2,_0x507a5a[_0x8fb5('0x11')][_0x8fb5('0x13')]);return _0x414225(_0x507a5a[_0x8fb5('0x11')][_0x8fb5('0x13')]);}else{logger[_0x8fb5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x315df2,_0x8fb5('0xf'));_0x414225(_0x507a5a[_0x8fb5('0x14')]['message']);}})[_0x8fb5('0x15')](function(_0x44ff02){logger[_0x8fb5('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x315df2,_0x44ff02);_0x42d28f(_0x44ff02);});});} \ No newline at end of file +var _0xc329=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x545788,_0x1008b8){var _0x3c7de5=function(_0x3de549){while(--_0x3de549){_0x545788['push'](_0x545788['shift']());}};_0x3c7de5(++_0x1008b8);}(_0xc329,0x1c7));var _0x9c32=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0xc329[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x9c32('0x0'));var util=require(_0x9c32('0x1'));var moment=require(_0x9c32('0x2'));var BPromise=require(_0x9c32('0x3'));var rs=require(_0x9c32('0x4'));var fs=require('fs');var Redis=require(_0x9c32('0x5'));var db=require(_0x9c32('0x6'))['db'];var utils=require(_0x9c32('0x7'));var logger=require(_0x9c32('0x8'))('rpc');var config=require(_0x9c32('0x9'));var jayson=require(_0x9c32('0xa'));var client=jayson[_0x9c32('0xb')][_0x9c32('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e7aae,_0x156288,_0x5701e0){return new BPromise(function(_0x17ce0e,_0x29d606){return client['request'](_0x4e7aae,_0x5701e0)[_0x9c32('0xd')](function(_0x25389d){logger[_0x9c32('0xe')](_0x9c32('0xf'),_0x156288,_0x9c32('0x10'));logger[_0x9c32('0x11')](_0x9c32('0x12'),_0x156288,_0x9c32('0x10'),JSON['stringify'](_0x25389d));if(_0x25389d[_0x9c32('0x13')]){if(_0x25389d[_0x9c32('0x13')]['code']===0x1f4){logger['error'](_0x9c32('0xf'),_0x156288,_0x25389d[_0x9c32('0x13')][_0x9c32('0x14')]);return _0x29d606(_0x25389d[_0x9c32('0x13')][_0x9c32('0x14')]);}logger[_0x9c32('0x13')](_0x9c32('0xf'),_0x156288,_0x25389d[_0x9c32('0x13')][_0x9c32('0x14')]);return _0x17ce0e(_0x25389d['error'][_0x9c32('0x14')]);}else{logger[_0x9c32('0xe')](_0x9c32('0xf'),_0x156288,'request\x20sent');_0x17ce0e(_0x25389d[_0x9c32('0x15')][_0x9c32('0x14')]);}})[_0x9c32('0x16')](function(_0x1d692f){logger[_0x9c32('0x13')](_0x9c32('0xf'),_0x156288,_0x1d692f);_0x29d606(_0x1d692f);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5442deb..c1ae317 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 _0x5645=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x5645,0x19e));var _0x5564=function(_0x10113d,_0x13a861){_0x10113d=_0x10113d-0x0;var _0xf52f5d=_0x5645[_0x10113d];return _0xf52f5d;};'use strict';var multer=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var path=require(_0x5564('0x2'));var timeout=require(_0x5564('0x3'));var express=require(_0x5564('0x4'));var router=express['Router']();var fs_extra=require(_0x5564('0x5'));var auth=require(_0x5564('0x6'));var interaction=require(_0x5564('0x7'));var config=require(_0x5564('0x8'));var controller=require(_0x5564('0x9'));router[_0x5564('0xa')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xc')]);router[_0x5564('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5564('0xd')]);router[_0x5564('0xe')]('/',auth[_0x5564('0xb')](),controller[_0x5564('0xf')]);router[_0x5564('0x10')]('/:id',auth[_0x5564('0xb')](),controller[_0x5564('0x11')]);router['delete'](_0x5564('0x12'),auth[_0x5564('0xb')](),controller[_0x5564('0x13')]);module[_0x5564('0x14')]=router; \ No newline at end of file +var _0x40ca=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./variable.controller','isAuthenticated','get','/:id','show','post','create','put','update'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x40ca,0x1a1));var _0xa40c=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x40ca[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0xa40c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa40c('0x1'));var express=require(_0xa40c('0x2'));var router=express[_0xa40c('0x3')]();var fs_extra=require(_0xa40c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa40c('0x5'));var config=require('../../config/environment');var controller=require(_0xa40c('0x6'));router['get']('/',auth[_0xa40c('0x7')](),controller['index']);router[_0xa40c('0x8')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0xa')]);router[_0xa40c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa40c('0xc')]);router[_0xa40c('0xd')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0xe')]);router[_0xa40c('0xf')](_0xa40c('0x9'),auth[_0xa40c('0x7')](),controller[_0xa40c('0x10')]);module[_0xa40c('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8bc708c..cec7498 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 _0x60ac=['exports','STRING','name'];(function(_0x47cb25,_0x45ee82){var _0x136037=function(_0x4162a3){while(--_0x4162a3){_0x47cb25['push'](_0x47cb25['shift']());}};_0x136037(++_0x45ee82);}(_0x60ac,0xa2));var _0xc60a=function(_0x314084,_0x295b08){_0x314084=_0x314084-0x0;var _0x524e4d=_0x60ac[_0x314084];return _0x524e4d;};'use strict';var Sequelize=require('sequelize');module[_0xc60a('0x0')]={'name':{'type':Sequelize[_0xc60a('0x1')],'unique':_0xc60a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc60a('0x1')]}}; \ No newline at end of file +var _0x5fa1=['STRING','name','exports'];(function(_0x4bf991,_0x3601af){var _0x5aa517=function(_0x12c098){while(--_0x12c098){_0x4bf991['push'](_0x4bf991['shift']());}};_0x5aa517(++_0x3601af);}(_0x5fa1,0xbf));var _0x15fa=function(_0x214fdb,_0x13ab1f){_0x214fdb=_0x214fdb-0x0;var _0x57c7e4=_0x5fa1[_0x214fdb];return _0x57c7e4;};'use strict';var Sequelize=require('sequelize');module[_0x15fa('0x0')]={'name':{'type':Sequelize[_0x15fa('0x1')],'unique':_0x15fa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x15fa('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index b82df0c..cb94b3f 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 _0x423d=['includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Variables','UserProfileResource','destroy','error','stack','send','map','Variable','rawAttributes','fieldName','type','model','name','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options'];(function(_0x38b0c6,_0xa2a897){var _0x372462=function(_0x5ca218){while(--_0x5ca218){_0x38b0c6['push'](_0x38b0c6['shift']());}};_0x372462(++_0xa2a897);}(_0x423d,0x10c));var _0xd423=function(_0x5a93a5,_0x3f54a3){_0x5a93a5=_0x5a93a5-0x0;var _0x363186=_0x423d[_0x5a93a5];return _0x363186;};'use strict';var emlformat=require(_0xd423('0x0'));var rimraf=require(_0xd423('0x1'));var zipdir=require(_0xd423('0x2'));var jsonpatch=require(_0xd423('0x3'));var rp=require(_0xd423('0x4'));var moment=require('moment');var BPromise=require(_0xd423('0x5'));var Mustache=require(_0xd423('0x6'));var util=require(_0xd423('0x7'));var path=require(_0xd423('0x8'));var sox=require('sox');var csv=require(_0xd423('0x9'));var ejs=require(_0xd423('0xa'));var fs=require('fs');var fs_extra=require(_0xd423('0xb'));var _=require(_0xd423('0xc'));var squel=require(_0xd423('0xd'));var crypto=require(_0xd423('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd423('0x9'));var querystring=require(_0xd423('0xf'));var Papa=require(_0xd423('0x10'));var Redis=require(_0xd423('0x11'));var authService=require(_0xd423('0x12'));var qs=require(_0xd423('0x13'));var as=require(_0xd423('0x14'));var hardwareService=require(_0xd423('0x15'));var logger=require(_0xd423('0x16'))(_0xd423('0x17'));var utils=require(_0xd423('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd423('0x19'))['db'];function respondWithStatusCode(_0x4f35a2,_0x31ce7d){_0x31ce7d=_0x31ce7d||0xcc;return function(_0x34d43f){if(_0x34d43f){return _0x4f35a2[_0xd423('0x1a')](_0x31ce7d);}return _0x4f35a2[_0xd423('0x1b')](_0x31ce7d)[_0xd423('0x1c')]();};}function respondWithResult(_0x1e5575,_0x1806f6){_0x1806f6=_0x1806f6||0xc8;return function(_0x4a80e1){if(_0x4a80e1){return _0x1e5575[_0xd423('0x1b')](_0x1806f6)[_0xd423('0x1d')](_0x4a80e1);}};}function respondWithFilteredResult(_0x422204,_0x1c5afa){return function(_0x2b69a9){if(_0x2b69a9){var _0x4eb0e9=typeof _0x1c5afa[_0xd423('0x1e')]===_0xd423('0x1f')&&typeof _0x1c5afa[_0xd423('0x20')]==='undefined';var _0x2e5d33=_0x2b69a9['count'];var _0x29f1ba=_0x4eb0e9?0x0:_0x1c5afa[_0xd423('0x1e')];var _0x2ec6f8=_0x4eb0e9?_0x2b69a9[_0xd423('0x21')]:_0x1c5afa[_0xd423('0x1e')]+_0x1c5afa[_0xd423('0x20')];var _0x4350f6;if(_0x2ec6f8>=_0x2e5d33){_0x2ec6f8=_0x2e5d33;_0x4350f6=0xc8;}else{_0x4350f6=0xce;}_0x422204[_0xd423('0x1b')](_0x4350f6);return _0x422204[_0xd423('0x22')](_0xd423('0x23'),_0x29f1ba+'-'+_0x2ec6f8+'/'+_0x2e5d33)[_0xd423('0x1d')](_0x2b69a9);}return null;};}function patchUpdates(_0x397e89){return function(_0x3250a5){try{jsonpatch[_0xd423('0x24')](_0x3250a5,_0x397e89,!![]);}catch(_0x1d926c){return BPromise[_0xd423('0x25')](_0x1d926c);}return _0x3250a5['save']();};}function saveUpdates(_0x3b705f,_0x7a10b5){return function(_0x2beb49){if(_0x2beb49){return _0x2beb49[_0xd423('0x26')](_0x3b705f)[_0xd423('0x27')](function(_0x52ae58){return _0x52ae58;});}return null;};}function removeEntity(_0x393b0e,_0x3f8f31){return function(_0x59da46){if(_0x59da46){return _0x59da46['destroy']()[_0xd423('0x27')](function(){var _0x21d908=_0x59da46[_0xd423('0x28')]({'plain':!![]});var _0x3a7eaa=_0xd423('0x29');return db[_0xd423('0x2a')][_0xd423('0x2b')]({'where':{'type':_0x3a7eaa,'resourceId':_0x21d908['id']}})[_0xd423('0x27')](function(){return _0x59da46;});})[_0xd423('0x27')](function(){_0x393b0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b28e8,_0xa926a){return function(_0x1623f5){if(!_0x1623f5){_0x3b28e8[_0xd423('0x1a')](0x194);}return _0x1623f5;};}function handleError(_0x30a9e4,_0x120bc3){_0x120bc3=_0x120bc3||0x1f4;return function(_0x1e42be){logger[_0xd423('0x2c')](_0x1e42be[_0xd423('0x2d')]);if(_0x1e42be['name']){delete _0x1e42be['name'];}_0x30a9e4['status'](_0x120bc3)[_0xd423('0x2e')](_0x1e42be);};}exports['index']=function(_0x20ee56,_0x32e301){var _0x4974fd={},_0x2d29f4={},_0x201444={'count':0x0,'rows':[]};var _0x5038cd=_[_0xd423('0x2f')](db[_0xd423('0x30')][_0xd423('0x31')],function(_0x5bbf10){return{'name':_0x5bbf10[_0xd423('0x32')],'type':_0x5bbf10[_0xd423('0x33')]['key']};});_0x2d29f4[_0xd423('0x34')]=_[_0xd423('0x2f')](_0x5038cd,_0xd423('0x35'));_0x2d29f4['query']=_[_0xd423('0x36')](_0x20ee56[_0xd423('0x37')]);_0x2d29f4['filters']=_[_0xd423('0x38')](_0x2d29f4[_0xd423('0x34')],_0x2d29f4[_0xd423('0x37')]);_0x4974fd[_0xd423('0x39')]=_[_0xd423('0x38')](_0x2d29f4[_0xd423('0x34')],qs[_0xd423('0x3a')](_0x20ee56[_0xd423('0x37')][_0xd423('0x3a')]));_0x4974fd[_0xd423('0x39')]=_0x4974fd[_0xd423('0x39')]['length']?_0x4974fd[_0xd423('0x39')]:_0x2d29f4[_0xd423('0x34')];if(!_0x20ee56[_0xd423('0x37')]['hasOwnProperty'](_0xd423('0x3b'))){_0x4974fd[_0xd423('0x20')]=qs['limit'](_0x20ee56['query']['limit']);_0x4974fd[_0xd423('0x1e')]=qs[_0xd423('0x1e')](_0x20ee56['query'][_0xd423('0x1e')]);}_0x4974fd[_0xd423('0x3c')]=qs[_0xd423('0x3d')](_0x20ee56[_0xd423('0x37')][_0xd423('0x3d')]);_0x4974fd[_0xd423('0x3e')]=qs[_0xd423('0x3f')](_[_0xd423('0x40')](_0x20ee56[_0xd423('0x37')],_0x2d29f4['filters']),_0x5038cd);if(_0x20ee56[_0xd423('0x37')][_0xd423('0x41')]){_0x4974fd['where']=_[_0xd423('0x42')](_0x4974fd[_0xd423('0x3e')],{'$or':_[_0xd423('0x2f')](_0x5038cd,function(_0x50a7d7){if(_0x50a7d7[_0xd423('0x33')]!=='VIRTUAL'){var _0x53f401={};_0x53f401[_0x50a7d7[_0xd423('0x35')]]={'$like':'%'+_0x20ee56[_0xd423('0x37')][_0xd423('0x41')]+'%'};return _0x53f401;}})});}_0x4974fd=_[_0xd423('0x42')]({},_0x4974fd,_0x20ee56[_0xd423('0x43')]);var _0x1dfdae={'where':_0x4974fd[_0xd423('0x3e')]};return db[_0xd423('0x30')][_0xd423('0x21')](_0x1dfdae)[_0xd423('0x27')](function(_0xef2a31){_0x201444['count']=_0xef2a31;if(_0x20ee56[_0xd423('0x37')][_0xd423('0x44')]){_0x4974fd[_0xd423('0x45')]=[{'all':!![]}];}return db[_0xd423('0x30')][_0xd423('0x46')](_0x4974fd);})['then'](function(_0x50346b){_0x201444[_0xd423('0x47')]=_0x50346b;return _0x201444;})[_0xd423('0x27')](respondWithFilteredResult(_0x32e301,_0x4974fd))[_0xd423('0x48')](handleError(_0x32e301,null));};exports['show']=function(_0x1e85c9,_0x55d4b0){var _0x4e1666={'raw':!![],'where':{'id':_0x1e85c9[_0xd423('0x49')]['id']}},_0x1692f0={};_0x1692f0['model']=_['keys'](db['Variable'][_0xd423('0x31')]);_0x1692f0['query']=_['keys'](_0x1e85c9[_0xd423('0x37')]);_0x1692f0[_0xd423('0x3f')]=_[_0xd423('0x38')](_0x1692f0[_0xd423('0x34')],_0x1692f0[_0xd423('0x37')]);_0x4e1666[_0xd423('0x39')]=_[_0xd423('0x38')](_0x1692f0[_0xd423('0x34')],qs[_0xd423('0x3a')](_0x1e85c9[_0xd423('0x37')][_0xd423('0x3a')]));_0x4e1666['attributes']=_0x4e1666[_0xd423('0x39')][_0xd423('0x4a')]?_0x4e1666[_0xd423('0x39')]:_0x1692f0[_0xd423('0x34')];if(_0x1e85c9[_0xd423('0x37')][_0xd423('0x44')]){_0x4e1666[_0xd423('0x45')]=[{'all':!![]}];}_0x4e1666=_[_0xd423('0x42')]({},_0x4e1666,_0x1e85c9[_0xd423('0x43')]);return db[_0xd423('0x30')][_0xd423('0x4b')](_0x4e1666)[_0xd423('0x27')](handleEntityNotFound(_0x55d4b0,null))['then'](respondWithResult(_0x55d4b0,null))['catch'](handleError(_0x55d4b0,null));};exports[_0xd423('0x4c')]=function(_0x2ccb83,_0xcdfb85){return db['Variable']['create'](_0x2ccb83[_0xd423('0x4d')],{})['then'](function(_0x3f5dde){var _0xa1b0e6=_0x2ccb83[_0xd423('0x4e')][_0xd423('0x28')]({'plain':!![]});if(!_0xa1b0e6)throw new Error(_0xd423('0x4f'));if(_0xa1b0e6[_0xd423('0x50')]==='user'){var _0x1842fe=_0x3f5dde[_0xd423('0x28')]({'plain':!![]});var _0x403843='Variables';return db[_0xd423('0x51')][_0xd423('0x4b')]({'where':{'name':_0x403843,'userProfileId':_0xa1b0e6['userProfileId']},'raw':!![]})[_0xd423('0x27')](function(_0x4f36ee){if(_0x4f36ee&&_0x4f36ee[_0xd423('0x52')]===0x0){return db[_0xd423('0x2a')][_0xd423('0x4c')]({'name':_0x1842fe[_0xd423('0x35')],'resourceId':_0x1842fe['id'],'type':_0x4f36ee[_0xd423('0x35')],'sectionId':_0x4f36ee['id']},{})[_0xd423('0x27')](function(){return _0x3f5dde;});}else{return _0x3f5dde;}})[_0xd423('0x48')](function(_0xa800b9){logger[_0xd423('0x2c')](_0xd423('0x53'),_0xa800b9);throw _0xa800b9;});}return _0x3f5dde;})[_0xd423('0x27')](respondWithResult(_0xcdfb85,0xc9))[_0xd423('0x48')](handleError(_0xcdfb85,null));};exports[_0xd423('0x26')]=function(_0x1df472,_0x2a75c5){if(_0x1df472[_0xd423('0x4d')]['id']){delete _0x1df472[_0xd423('0x4d')]['id'];}return db[_0xd423('0x30')][_0xd423('0x4b')]({'where':{'id':_0x1df472[_0xd423('0x49')]['id']}})[_0xd423('0x27')](handleEntityNotFound(_0x2a75c5,null))[_0xd423('0x27')](saveUpdates(_0x1df472[_0xd423('0x4d')],null))['then'](respondWithResult(_0x2a75c5,null))['catch'](handleError(_0x2a75c5,null));};exports[_0xd423('0x2b')]=function(_0x571627,_0x5edeaf){return db[_0xd423('0x30')]['find']({'where':{'id':_0x571627[_0xd423('0x49')]['id']}})[_0xd423('0x27')](handleEntityNotFound(_0x5edeaf,null))['then'](removeEntity(_0x5edeaf,null))[_0xd423('0x48')](handleError(_0x5edeaf,null));}; \ No newline at end of file +var _0xe389=['UserProfileResource','end','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','then','get','Variables'];(function(_0x27d069,_0x7c417f){var _0x275fe8=function(_0x476b85){while(--_0x476b85){_0x27d069['push'](_0x27d069['shift']());}};_0x275fe8(++_0x7c417f);}(_0xe389,0x115));var _0x9e38=function(_0x38f957,_0x359ad0){_0x38f957=_0x38f957-0x0;var _0x444ae4=_0xe389[_0x38f957];return _0x444ae4;};'use strict';var emlformat=require(_0x9e38('0x0'));var rimraf=require(_0x9e38('0x1'));var zipdir=require(_0x9e38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e38('0x3'));var moment=require('moment');var BPromise=require(_0x9e38('0x4'));var Mustache=require(_0x9e38('0x5'));var util=require(_0x9e38('0x6'));var path=require(_0x9e38('0x7'));var sox=require(_0x9e38('0x8'));var csv=require(_0x9e38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e38('0xa'));var squel=require('squel');var crypto=require(_0x9e38('0xb'));var jsforce=require(_0x9e38('0xc'));var deskjs=require(_0x9e38('0xd'));var toCsv=require(_0x9e38('0x9'));var querystring=require(_0x9e38('0xe'));var Papa=require(_0x9e38('0xf'));var Redis=require('ioredis');var authService=require(_0x9e38('0x10'));var qs=require(_0x9e38('0x11'));var as=require(_0x9e38('0x12'));var hardwareService=require(_0x9e38('0x13'));var logger=require(_0x9e38('0x14'))('api');var utils=require(_0x9e38('0x15'));var config=require(_0x9e38('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e38('0x17'))['db'];function respondWithStatusCode(_0x192e5a,_0x3f06a4){_0x3f06a4=_0x3f06a4||0xcc;return function(_0x25d74c){if(_0x25d74c){return _0x192e5a[_0x9e38('0x18')](_0x3f06a4);}return _0x192e5a[_0x9e38('0x19')](_0x3f06a4)['end']();};}function respondWithResult(_0x2bd245,_0x444fd4){_0x444fd4=_0x444fd4||0xc8;return function(_0x4b096f){if(_0x4b096f){return _0x2bd245[_0x9e38('0x19')](_0x444fd4)[_0x9e38('0x1a')](_0x4b096f);}};}function respondWithFilteredResult(_0x48c603,_0x4606ae){return function(_0x1a66de){if(_0x1a66de){var _0x58b76c=typeof _0x4606ae[_0x9e38('0x1b')]==='undefined'&&typeof _0x4606ae[_0x9e38('0x1c')]===_0x9e38('0x1d');var _0x48744c=_0x1a66de[_0x9e38('0x1e')];var _0x1b0c78=_0x58b76c?0x0:_0x4606ae[_0x9e38('0x1b')];var _0x255318=_0x58b76c?_0x1a66de[_0x9e38('0x1e')]:_0x4606ae[_0x9e38('0x1b')]+_0x4606ae['limit'];var _0x238b0b;if(_0x255318>=_0x48744c){_0x255318=_0x48744c;_0x238b0b=0xc8;}else{_0x238b0b=0xce;}_0x48c603[_0x9e38('0x19')](_0x238b0b);return _0x48c603['set'](_0x9e38('0x1f'),_0x1b0c78+'-'+_0x255318+'/'+_0x48744c)['json'](_0x1a66de);}return null;};}function patchUpdates(_0x4ef119){return function(_0x3ffa18){try{jsonpatch[_0x9e38('0x20')](_0x3ffa18,_0x4ef119,!![]);}catch(_0x40c353){return BPromise['reject'](_0x40c353);}return _0x3ffa18[_0x9e38('0x21')]();};}function saveUpdates(_0x4714b4,_0x36ff57){return function(_0x5ea02c){if(_0x5ea02c){return _0x5ea02c[_0x9e38('0x22')](_0x4714b4)['then'](function(_0x8d7441){return _0x8d7441;});}return null;};}function removeEntity(_0x500606,_0x970ed8){return function(_0x5a462c){if(_0x5a462c){return _0x5a462c[_0x9e38('0x23')]()[_0x9e38('0x24')](function(){var _0x28c685=_0x5a462c[_0x9e38('0x25')]({'plain':!![]});var _0x5e0f30=_0x9e38('0x26');return db[_0x9e38('0x27')][_0x9e38('0x23')]({'where':{'type':_0x5e0f30,'resourceId':_0x28c685['id']}})['then'](function(){return _0x5a462c;});})[_0x9e38('0x24')](function(){_0x500606['status'](0xcc)[_0x9e38('0x28')]();});}};}function handleEntityNotFound(_0x18e2ae,_0x580465){return function(_0x15569c){if(!_0x15569c){_0x18e2ae[_0x9e38('0x18')](0x194);}return _0x15569c;};}function handleError(_0x89e450,_0x2b4434){_0x2b4434=_0x2b4434||0x1f4;return function(_0x7497c9){logger['error'](_0x7497c9[_0x9e38('0x29')]);if(_0x7497c9['name']){delete _0x7497c9[_0x9e38('0x2a')];}_0x89e450[_0x9e38('0x19')](_0x2b4434)[_0x9e38('0x2b')](_0x7497c9);};}exports[_0x9e38('0x2c')]=function(_0x12ff93,_0x26be86){var _0x3de78a={},_0x14b4ba={},_0xfa2ac0={'count':0x0,'rows':[]};var _0x1d9021=_[_0x9e38('0x2d')](db[_0x9e38('0x2e')][_0x9e38('0x2f')],function(_0x29405c){return{'name':_0x29405c['fieldName'],'type':_0x29405c[_0x9e38('0x30')][_0x9e38('0x31')]};});_0x14b4ba[_0x9e38('0x32')]=_[_0x9e38('0x2d')](_0x1d9021,'name');_0x14b4ba[_0x9e38('0x33')]=_[_0x9e38('0x34')](_0x12ff93[_0x9e38('0x33')]);_0x14b4ba[_0x9e38('0x35')]=_[_0x9e38('0x36')](_0x14b4ba[_0x9e38('0x32')],_0x14b4ba[_0x9e38('0x33')]);_0x3de78a[_0x9e38('0x37')]=_[_0x9e38('0x36')](_0x14b4ba[_0x9e38('0x32')],qs[_0x9e38('0x38')](_0x12ff93[_0x9e38('0x33')][_0x9e38('0x38')]));_0x3de78a[_0x9e38('0x37')]=_0x3de78a[_0x9e38('0x37')][_0x9e38('0x39')]?_0x3de78a['attributes']:_0x14b4ba[_0x9e38('0x32')];if(!_0x12ff93[_0x9e38('0x33')]['hasOwnProperty']('nolimit')){_0x3de78a['limit']=qs[_0x9e38('0x1c')](_0x12ff93[_0x9e38('0x33')]['limit']);_0x3de78a[_0x9e38('0x1b')]=qs[_0x9e38('0x1b')](_0x12ff93[_0x9e38('0x33')][_0x9e38('0x1b')]);}_0x3de78a[_0x9e38('0x3a')]=qs[_0x9e38('0x3b')](_0x12ff93[_0x9e38('0x33')][_0x9e38('0x3b')]);_0x3de78a[_0x9e38('0x3c')]=qs['filters'](_[_0x9e38('0x3d')](_0x12ff93['query'],_0x14b4ba['filters']),_0x1d9021);if(_0x12ff93[_0x9e38('0x33')][_0x9e38('0x3e')]){_0x3de78a[_0x9e38('0x3c')]=_[_0x9e38('0x3f')](_0x3de78a[_0x9e38('0x3c')],{'$or':_[_0x9e38('0x2d')](_0x1d9021,function(_0x470a80){if(_0x470a80[_0x9e38('0x30')]!=='VIRTUAL'){var _0x88acad={};_0x88acad[_0x470a80[_0x9e38('0x2a')]]={'$like':'%'+_0x12ff93['query'][_0x9e38('0x3e')]+'%'};return _0x88acad;}})});}_0x3de78a=_[_0x9e38('0x3f')]({},_0x3de78a,_0x12ff93[_0x9e38('0x40')]);var _0x2cd6b2={'where':_0x3de78a[_0x9e38('0x3c')]};return db[_0x9e38('0x2e')]['count'](_0x2cd6b2)[_0x9e38('0x24')](function(_0x357214){_0xfa2ac0[_0x9e38('0x1e')]=_0x357214;if(_0x12ff93[_0x9e38('0x33')][_0x9e38('0x41')]){_0x3de78a[_0x9e38('0x42')]=[{'all':!![]}];}return db[_0x9e38('0x2e')][_0x9e38('0x43')](_0x3de78a);})[_0x9e38('0x24')](function(_0x1ed532){_0xfa2ac0[_0x9e38('0x44')]=_0x1ed532;return _0xfa2ac0;})[_0x9e38('0x24')](respondWithFilteredResult(_0x26be86,_0x3de78a))[_0x9e38('0x45')](handleError(_0x26be86,null));};exports[_0x9e38('0x46')]=function(_0x13dec7,_0x78567d){var _0x468dad={'raw':!![],'where':{'id':_0x13dec7['params']['id']}},_0x244ef8={};_0x244ef8[_0x9e38('0x32')]=_[_0x9e38('0x34')](db[_0x9e38('0x2e')]['rawAttributes']);_0x244ef8[_0x9e38('0x33')]=_[_0x9e38('0x34')](_0x13dec7[_0x9e38('0x33')]);_0x244ef8[_0x9e38('0x35')]=_['intersection'](_0x244ef8[_0x9e38('0x32')],_0x244ef8[_0x9e38('0x33')]);_0x468dad[_0x9e38('0x37')]=_[_0x9e38('0x36')](_0x244ef8[_0x9e38('0x32')],qs[_0x9e38('0x38')](_0x13dec7[_0x9e38('0x33')][_0x9e38('0x38')]));_0x468dad[_0x9e38('0x37')]=_0x468dad[_0x9e38('0x37')]['length']?_0x468dad[_0x9e38('0x37')]:_0x244ef8[_0x9e38('0x32')];if(_0x13dec7[_0x9e38('0x33')][_0x9e38('0x41')]){_0x468dad[_0x9e38('0x42')]=[{'all':!![]}];}_0x468dad=_[_0x9e38('0x3f')]({},_0x468dad,_0x13dec7[_0x9e38('0x40')]);return db[_0x9e38('0x2e')][_0x9e38('0x47')](_0x468dad)[_0x9e38('0x24')](handleEntityNotFound(_0x78567d,null))[_0x9e38('0x24')](respondWithResult(_0x78567d,null))[_0x9e38('0x45')](handleError(_0x78567d,null));};exports['create']=function(_0x1d080e,_0x3056d3){return db[_0x9e38('0x2e')][_0x9e38('0x48')](_0x1d080e[_0x9e38('0x49')],{})[_0x9e38('0x24')](function(_0x266010){var _0x116a74=_0x1d080e[_0x9e38('0x4a')][_0x9e38('0x25')]({'plain':!![]});if(!_0x116a74)throw new Error(_0x9e38('0x4b'));if(_0x116a74['role']===_0x9e38('0x4a')){var _0x3b2510=_0x266010[_0x9e38('0x25')]({'plain':!![]});var _0x122976='Variables';return db['UserProfileSection'][_0x9e38('0x47')]({'where':{'name':_0x122976,'userProfileId':_0x116a74[_0x9e38('0x4c')]},'raw':!![]})[_0x9e38('0x24')](function(_0x3c318f){if(_0x3c318f&&_0x3c318f['autoAssociation']===0x0){return db[_0x9e38('0x27')][_0x9e38('0x48')]({'name':_0x3b2510['name'],'resourceId':_0x3b2510['id'],'type':_0x3c318f[_0x9e38('0x2a')],'sectionId':_0x3c318f['id']},{})[_0x9e38('0x24')](function(){return _0x266010;});}else{return _0x266010;}})[_0x9e38('0x45')](function(_0x583819){logger[_0x9e38('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x583819);throw _0x583819;});}return _0x266010;})['then'](respondWithResult(_0x3056d3,0xc9))['catch'](handleError(_0x3056d3,null));};exports[_0x9e38('0x22')]=function(_0x492a09,_0x797b1b){if(_0x492a09[_0x9e38('0x49')]['id']){delete _0x492a09['body']['id'];}return db[_0x9e38('0x2e')]['find']({'where':{'id':_0x492a09[_0x9e38('0x4e')]['id']}})['then'](handleEntityNotFound(_0x797b1b,null))[_0x9e38('0x24')](saveUpdates(_0x492a09[_0x9e38('0x49')],null))[_0x9e38('0x24')](respondWithResult(_0x797b1b,null))[_0x9e38('0x45')](handleError(_0x797b1b,null));};exports[_0x9e38('0x23')]=function(_0x80f186,_0x1d69ee){return db[_0x9e38('0x2e')][_0x9e38('0x47')]({'where':{'id':_0x80f186[_0x9e38('0x4e')]['id']}})[_0x9e38('0x24')](handleEntityNotFound(_0x1d69ee,null))['then'](removeEntity(_0x1d69ee,null))['catch'](handleError(_0x1d69ee,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4952279..6a8881f 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 _0xa76b=['util','../../config/logger','moment','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash'];(function(_0xc24f0b,_0x51e5aa){var _0x3b7ff0=function(_0x5b403c){while(--_0x5b403c){_0xc24f0b['push'](_0xc24f0b['shift']());}};_0x3b7ff0(++_0x51e5aa);}(_0xa76b,0x1d8));var _0xba76=function(_0x1f5e33,_0x10f720){_0x1f5e33=_0x1f5e33-0x0;var _0x28aadf=_0xa76b[_0x1f5e33];return _0x28aadf;};'use strict';var _=require(_0xba76('0x0'));var util=require(_0xba76('0x1'));var logger=require(_0xba76('0x2'))('api');var moment=require(_0xba76('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba76('0x4'));var rimraf=require(_0xba76('0x5'));var config=require(_0xba76('0x6'));var attributes=require(_0xba76('0x7'));module[_0xba76('0x8')]=function(_0x316224,_0x13c133){return _0x316224[_0xba76('0x9')]('Variable',attributes,{'tableName':_0xba76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x932d=['rimraf','./variable.attributes','exports','define','Variable','tools_variables','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4b7610,_0xc57b5f){var _0x4ffea1=function(_0x30d03e){while(--_0x30d03e){_0x4b7610['push'](_0x4b7610['shift']());}};_0x4ffea1(++_0xc57b5f);}(_0x932d,0x8a));var _0xd932=function(_0x44cc4f,_0x5deed4){_0x44cc4f=_0x44cc4f-0x0;var _0x1aebe2=_0x932d[_0x44cc4f];return _0x1aebe2;};'use strict';var _=require(_0xd932('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd932('0x1'));var moment=require(_0xd932('0x2'));var BPromise=require(_0xd932('0x3'));var rp=require(_0xd932('0x4'));var fs=require('fs');var path=require(_0xd932('0x5'));var rimraf=require(_0xd932('0x6'));var config=require('../../config/environment');var attributes=require(_0xd932('0x7'));module[_0xd932('0x8')]=function(_0x4fa96e,_0x23c5cf){return _0x4fa96e[_0xd932('0x9')](_0xd932('0xa'),attributes,{'tableName':_0xd932('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 33f047e..460de21 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x3cc026,_0x5455dd){var _0x34ec6b=function(_0x4fcf3b){while(--_0x4fcf3b){_0x3cc026['push'](_0x3cc026['shift']());}};_0x34ec6b(++_0x5455dd);}(_0x814b,0x1a2));var _0xb814=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x814b[_0x3cba93];return _0x4a2991;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x10a0ab,_0x37b227){var _0x35f4c3=function(_0x22d405){while(--_0x22d405){_0x10a0ab['push'](_0x10a0ab['shift']());}};_0x35f4c3(++_0x37b227);}(_0xe14b,0x93));var _0xbe14=function(_0x5aefdb,_0x426036){_0x5aefdb=_0x5aefdb-0x0;var _0x1d323c=_0xe14b[_0x5aefdb];return _0x1d323c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 916918e..3671eb6 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 _0xb624=['migrations','exports','Router','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','restart'];(function(_0x209cda,_0x69e33a){var _0x272b8c=function(_0x1cbe33){while(--_0x1cbe33){_0x209cda['push'](_0x209cda['shift']());}};_0x272b8c(++_0x69e33a);}(_0xb624,0x154));var _0x4b62=function(_0x38aa04,_0x2c8039){_0x38aa04=_0x38aa04-0x0;var _0x39bb22=_0xb624[_0x38aa04];return _0x39bb22;};'use strict';var express=require('express');var router=express[_0x4b62('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x4b62('0x1'));router[_0x4b62('0x2')]('/',controller[_0x4b62('0x3')]);router[_0x4b62('0x2')]('/fetch',auth[_0x4b62('0x4')](),auth[_0x4b62('0x5')](),controller[_0x4b62('0x6')]);router[_0x4b62('0x2')](_0x4b62('0x7'),auth['isAuthenticated'](),auth[_0x4b62('0x5')](),controller['reset']);router[_0x4b62('0x2')](_0x4b62('0x8'),auth[_0x4b62('0x4')](),auth[_0x4b62('0x5')](),controller[_0x4b62('0x9')]);router['get']('/restart',auth[_0x4b62('0x4')](),controller[_0x4b62('0xa')]);router[_0x4b62('0x2')]('/migrations',controller[_0x4b62('0xb')]);module[_0x4b62('0xc')]=router; \ No newline at end of file +var _0xfe55=['/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','/restart','restart','exports','express','Router','./version.controller','get','index'];(function(_0x5be892,_0x68238a){var _0x53fc35=function(_0x8626ac){while(--_0x8626ac){_0x5be892['push'](_0x5be892['shift']());}};_0x53fc35(++_0x68238a);}(_0xfe55,0x159));var _0x5fe5=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0xfe55[_0x3fe042];return _0x7d4a1f;};'use strict';var express=require(_0x5fe5('0x0'));var router=express[_0x5fe5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5fe5('0x2'));router[_0x5fe5('0x3')]('/',controller[_0x5fe5('0x4')]);router[_0x5fe5('0x3')](_0x5fe5('0x5'),auth[_0x5fe5('0x6')](),auth[_0x5fe5('0x7')](),controller[_0x5fe5('0x8')]);router[_0x5fe5('0x3')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x5fe5('0x9')]);router[_0x5fe5('0x3')](_0x5fe5('0xa'),auth[_0x5fe5('0x6')](),auth[_0x5fe5('0x7')](),controller['pull']);router[_0x5fe5('0x3')](_0x5fe5('0xb'),auth[_0x5fe5('0x6')](),controller[_0x5fe5('0xc')]);router['get']('/migrations',controller['migrations']);module[_0x5fe5('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 2eec830..2d0486b 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 _0x3a3f=['reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','then','pm2\x20restart\x20motion\x20%s','catch','join','server','migrations','length','.js','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','path','lodash','pkginfo','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','version','2.0.0','status','json','origin','master','error','info','git\x20fetch'];(function(_0x599f8a,_0x3915ef){var _0x40545f=function(_0x374110){while(--_0x374110){_0x599f8a['push'](_0x599f8a['shift']());}};_0x40545f(++_0x3915ef);}(_0x3a3f,0xb1));var _0xf3a3=function(_0x378348,_0x555f38){_0x378348=_0x378348-0x0;var _0x19677c=_0x3a3f[_0x378348];return _0x19677c;};'use strict';var Umzug=require(_0xf3a3('0x0'));var path=require(_0xf3a3('0x1'));var fs=require('fs');var _=require(_0xf3a3('0x2'));var pkginfo=require(_0xf3a3('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require('child_process')[_0xf3a3('0x4')];var db=require(_0xf3a3('0x5'))['db'];var config=require(_0xf3a3('0x6'));var pm2=require(_0xf3a3('0x7'));var logger=require(_0xf3a3('0x8'))(_0xf3a3('0x9'));var git=require(_0xf3a3('0xa'))(config[_0xf3a3('0xb')]);exports[_0xf3a3('0xc')]=function(_0x5d1406,_0x2e6ba4){var _0x4917a7={'current':module[_0xf3a3('0xd')]['version'],'phonebar':0x2};if(_0x5d1406[_0xf3a3('0xe')]&&_0x5d1406['query'][_0xf3a3('0xf')]){return git[_0xf3a3('0x10')]()[_0xf3a3('0x11')](function(_0x32868e,_0x444ed7){_0x4917a7[_0xf3a3('0xf')]=(_0x32868e?module['exports'][_0xf3a3('0x12')]:_0x444ed7[_0xf3a3('0xf')])||_0xf3a3('0x13');return _0x2e6ba4[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')](_0x4917a7);});}else{return _0x2e6ba4['status'](0xc8)[_0xf3a3('0x15')](_0x4917a7);}};exports['fetch']=function(_0x135ed8,_0x35aa2d){return git['fetch']([_0xf3a3('0x16'),_0xf3a3('0x17')],function(_0x1fca03){if(_0x1fca03){logger[_0xf3a3('0x18')](_0x1fca03);return _0x35aa2d[_0xf3a3('0x14')](0x1f4)[_0xf3a3('0x15')](_0x1fca03);}logger[_0xf3a3('0x19')](_0xf3a3('0x1a'));return _0x35aa2d[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xf3a3('0x1b')]=function(_0x5144c0,_0x1fba1c){return git['reset']([_0xf3a3('0x1c'),_0xf3a3('0x1d')],function(_0x171196){if(_0x171196){logger[_0xf3a3('0x18')](_0x171196);return _0x1fba1c[_0xf3a3('0x14')](0x1f4)[_0xf3a3('0x15')](_0x171196);}logger[_0xf3a3('0x19')](_0xf3a3('0x1e'));return _0x1fba1c[_0xf3a3('0x14')](0xc8)['json']({'output':_0xf3a3('0x1f')});});};exports['pull']=function(_0x360031,_0x56365c){exec(_0xf3a3('0x20'),function(_0x5e99f4,_0x424c4b,_0x363a19){logger[_0xf3a3('0x19')](_0x424c4b);logger[_0xf3a3('0x19')](_0x363a19);if(_0x5e99f4){logger['error'](_0x5e99f4);return _0x56365c[_0xf3a3('0x14')](0x1f4)[_0xf3a3('0x15')](_0x5e99f4);}return _0x56365c[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':_0x424c4b});});};exports['restart']=function(_0x5874de,_0x3f6486){return pm2['restart']('motion2')[_0xf3a3('0x21')](function(_0x331c60){logger[_0xf3a3('0x19')](_0xf3a3('0x22'),_0x331c60);return _0x3f6486[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xf3a3('0x23')](function(_0x3423a4){logger[_0xf3a3('0x18')](_0x3423a4);return _0x3f6486[_0xf3a3('0x14')](0x1f4)['json'](_0x3423a4);});};exports['migrations']=function(_0x2574d9,_0x538bc0){var _0xc8839f=fs['readdirSync'](path[_0xf3a3('0x24')](config[_0xf3a3('0xb')],_0xf3a3('0x25'),_0xf3a3('0x26')));var _0x38564f=[];for(var _0x5aa68e=0x0;_0x5aa68e<_0xc8839f[_0xf3a3('0x27')];_0x5aa68e++){var _0x2d67c1=_0xc8839f[_0x5aa68e]['replace'](_0xf3a3('0x28'),'');if(compareVersions(module['exports']['version'],_0x2d67c1)===-0x1){_0x38564f['push'](_0x2d67c1);}}if(_0x38564f['length']){var _0x1c7c65=_0x38564f['sort'](compareVersions);var _0x2d4790=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0xf3a3('0x29'),'columnName':_0xf3a3('0x12')},'migrations':{'params':[db[_0xf3a3('0x2a')][_0xf3a3('0x2b')](),db['sequelize'][_0xf3a3('0x2c')],function(){throw new Error(_0xf3a3('0x2d'));}],'path':path[_0xf3a3('0x24')](config[_0xf3a3('0xb')],'server',_0xf3a3('0x26')),'pattern':/\.js$/}});_0x2d4790['up']({'migrations':_[_0xf3a3('0x2e')](_0x1c7c65,function(_0x130c01){return _0x130c01+'.js';})})['then'](function(){return _0x538bc0[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':_0xf3a3('0x2f')+module[_0xf3a3('0xd')][_0xf3a3('0x12')]+_0xf3a3('0x30')+_[_0xf3a3('0x31')](_0x1c7c65),'migrations':_[_0xf3a3('0x24')](_0x1c7c65)});})[_0xf3a3('0x23')](function(_0x1e8795){if(_0x1e8795 instanceof db[_0xf3a3('0x2a')][_0xf3a3('0x32')]){return _0x538bc0[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x538bc0[_0xf3a3('0x14')](0x1f4)[_0xf3a3('0x15')](_0x1e8795);}});}else{return _0x538bc0[_0xf3a3('0x14')](0xc8)[_0xf3a3('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x308f=['lodash','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','root','server','map','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x5e3875,_0x3df06c){var _0x40a68a=function(_0x5a907b){while(--_0x5a907b){_0x5e3875['push'](_0x5e3875['shift']());}};_0x40a68a(++_0x3df06c);}(_0x308f,0x9e));var _0xf308=function(_0x466dbb,_0x4fee3f){_0x466dbb=_0x466dbb-0x0;var _0x780734=_0x308f[_0x466dbb];return _0x780734;};'use strict';var Umzug=require(_0xf308('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xf308('0x1'));var pkginfo=require('pkginfo')(module,_0xf308('0x2'));var compareVersions=require(_0xf308('0x3'));var exec=require(_0xf308('0x4'))[_0xf308('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xf308('0x6'));var pm2=require('../../config/pm2');var logger=require(_0xf308('0x7'))(_0xf308('0x8'));var git=require('simple-git')(config['root']);exports[_0xf308('0x9')]=function(_0x41b7ed,_0x5d96a1){var _0x4d9c4d={'current':module[_0xf308('0xa')][_0xf308('0x2')],'phonebar':0x2};if(_0x41b7ed[_0xf308('0xb')]&&_0x41b7ed[_0xf308('0xb')][_0xf308('0xc')]){return git[_0xf308('0xd')]()[_0xf308('0xe')](function(_0x5f1fc,_0x35f265){_0x4d9c4d['latest']=(_0x5f1fc?module[_0xf308('0xa')][_0xf308('0x2')]:_0x35f265['latest'])||_0xf308('0xf');return _0x5d96a1[_0xf308('0x10')](0xc8)[_0xf308('0x11')](_0x4d9c4d);});}else{return _0x5d96a1[_0xf308('0x10')](0xc8)[_0xf308('0x11')](_0x4d9c4d);}};exports[_0xf308('0xd')]=function(_0x2a5f22,_0x31c868){return git[_0xf308('0xd')]([_0xf308('0x12'),_0xf308('0x13')],function(_0x6baf6a){if(_0x6baf6a){logger[_0xf308('0x14')](_0x6baf6a);return _0x31c868[_0xf308('0x10')](0x1f4)[_0xf308('0x11')](_0x6baf6a);}logger[_0xf308('0x15')](_0xf308('0x16'));return _0x31c868[_0xf308('0x10')](0xc8)['json']({'output':_0xf308('0x17')});});};exports[_0xf308('0x18')]=function(_0x3e2a1d,_0x316216){return git[_0xf308('0x18')]([_0xf308('0x19'),_0xf308('0x1a')],function(_0x3b7e97){if(_0x3b7e97){logger[_0xf308('0x14')](_0x3b7e97);return _0x316216[_0xf308('0x10')](0x1f4)['json'](_0x3b7e97);}logger[_0xf308('0x15')](_0xf308('0x1b'));return _0x316216[_0xf308('0x10')](0xc8)[_0xf308('0x11')]({'output':_0xf308('0x1c')});});};exports['pull']=function(_0x513098,_0x323a42){exec(_0xf308('0x1d'),function(_0x4dd724,_0x3515ce,_0x177eb0){logger['info'](_0x3515ce);logger[_0xf308('0x15')](_0x177eb0);if(_0x4dd724){logger[_0xf308('0x14')](_0x4dd724);return _0x323a42[_0xf308('0x10')](0x1f4)[_0xf308('0x11')](_0x4dd724);}return _0x323a42[_0xf308('0x10')](0xc8)[_0xf308('0x11')]({'output':_0x3515ce});});};exports[_0xf308('0x1e')]=function(_0x7f7819,_0x53bdcc){return pm2['restart']('motion2')[_0xf308('0x1f')](function(_0x1d9ed5){logger[_0xf308('0x15')](_0xf308('0x20'),_0x1d9ed5);return _0x53bdcc[_0xf308('0x10')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x2a5bfd){logger[_0xf308('0x14')](_0x2a5bfd);return _0x53bdcc[_0xf308('0x10')](0x1f4)[_0xf308('0x11')](_0x2a5bfd);});};exports[_0xf308('0x21')]=function(_0x4053b4,_0x18f5fd){var _0x1b4447=fs[_0xf308('0x22')](path[_0xf308('0x23')](config['root'],'server',_0xf308('0x21')));var _0x676f24=[];for(var _0x4c50ef=0x0;_0x4c50ef<_0x1b4447[_0xf308('0x24')];_0x4c50ef++){var _0x596df6=_0x1b4447[_0x4c50ef][_0xf308('0x25')](_0xf308('0x26'),'');if(compareVersions(module[_0xf308('0xa')]['version'],_0x596df6)===-0x1){_0x676f24['push'](_0x596df6);}}if(_0x676f24[_0xf308('0x24')]){var _0x36b217=_0x676f24[_0xf308('0x27')](compareVersions);var _0x74061e=new Umzug({'storage':_0xf308('0x28'),'storageOptions':{'model':db[_0xf308('0x29')],'modelName':'Migration','columnName':_0xf308('0x2')},'migrations':{'params':[db[_0xf308('0x28')][_0xf308('0x2a')](),db[_0xf308('0x28')][_0xf308('0x2b')],function(){throw new Error(_0xf308('0x2c'));}],'path':path[_0xf308('0x23')](config[_0xf308('0x2d')],_0xf308('0x2e'),_0xf308('0x21')),'pattern':/\.js$/}});_0x74061e['up']({'migrations':_[_0xf308('0x2f')](_0x36b217,function(_0x588f9a){return _0x588f9a+_0xf308('0x26');})})[_0xf308('0x1f')](function(){return _0x18f5fd['status'](0xc8)[_0xf308('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf308('0xa')]['version']+_0xf308('0x30')+_[_0xf308('0x31')](_0x36b217),'migrations':_[_0xf308('0x23')](_0x36b217)});})[_0xf308('0x32')](function(_0x1f4915){if(_0x1f4915 instanceof db[_0xf308('0x28')][_0xf308('0x33')]){return _0x18f5fd[_0xf308('0x10')](0xc8)[_0xf308('0x11')]({'output':_0xf308('0x34')});}else{return _0x18f5fd['status'](0x1f4)[_0xf308('0x11')](_0x1f4915);}});}else{return _0x18f5fd['status'](0xc8)[_0xf308('0x11')]({'output':_0xf308('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 08172d9..c346050 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 _0x3979=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x595121,_0x443e4a){var _0x242e7f=function(_0x5013e9){while(--_0x5013e9){_0x595121['push'](_0x595121['shift']());}};_0x242e7f(++_0x443e4a);}(_0x3979,0x114));var _0x9397=function(_0x17ffe0,_0x3592e9){_0x17ffe0=_0x17ffe0-0x0;var _0x2630ff=_0x3979[_0x17ffe0];return _0x2630ff;};'use strict';var multer=require('multer');var util=require(_0x9397('0x0'));var path=require(_0x9397('0x1'));var timeout=require(_0x9397('0x2'));var express=require(_0x9397('0x3'));var router=express[_0x9397('0x4')]();var fs_extra=require(_0x9397('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9397('0x6'));var config=require(_0x9397('0x7'));var controller=require(_0x9397('0x8'));router['get']('/',auth[_0x9397('0x9')](),controller[_0x9397('0xa')]);router[_0x9397('0xb')](_0x9397('0xc'),auth[_0x9397('0x9')](),controller[_0x9397('0xd')]);router['get'](_0x9397('0xe'),auth['isAuthenticated'](),controller[_0x9397('0xf')]);router[_0x9397('0x10')]('/',auth[_0x9397('0x9')](),controller[_0x9397('0x11')]);router[_0x9397('0x12')](_0x9397('0xe'),auth[_0x9397('0x9')](),controller[_0x9397('0x13')]);router[_0x9397('0x14')](_0x9397('0xe'),auth['isAuthenticated'](),controller[_0x9397('0x15')]);module[_0x9397('0x16')]=router; \ No newline at end of file +var _0x7c88=['create','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','get','show','post'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x7c88,0x16e));var _0x87c8=function(_0xbfb529,_0x33d828){_0xbfb529=_0xbfb529-0x0;var _0x2c51b7=_0x7c88[_0xbfb529];return _0x2c51b7;};'use strict';var multer=require(_0x87c8('0x0'));var util=require(_0x87c8('0x1'));var path=require(_0x87c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x87c8('0x3'));var router=express[_0x87c8('0x4')]();var fs_extra=require(_0x87c8('0x5'));var auth=require(_0x87c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x87c8('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x87c8('0x8')](),controller[_0x87c8('0x9')]);router['get'](_0x87c8('0xa'),auth[_0x87c8('0x8')](),controller['describe']);router[_0x87c8('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x87c8('0xc')]);router[_0x87c8('0xd')]('/',auth[_0x87c8('0x8')](),controller[_0x87c8('0xe')]);router['put']('/:id',auth[_0x87c8('0x8')](),controller[_0x87c8('0xf')]);router[_0x87c8('0x10')](_0x87c8('0x11'),auth[_0x87c8('0x8')](),controller[_0x87c8('0x12')]);module[_0x87c8('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index e4977e1..1d30485 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 _0x8286=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x8286,0x66));var _0x6828=function(_0x2b4a2b,_0x3471ef){_0x2b4a2b=_0x2b4a2b-0x0;var _0x341f04=_0x8286[_0x2b4a2b];return _0x341f04;};'use strict';var Sequelize=require(_0x6828('0x0'));module[_0x6828('0x1')]={'type':{'type':Sequelize[_0x6828('0x2')]},'uniqueid':{'type':Sequelize[_0x6828('0x2')]},'calleridnum':{'type':Sequelize[_0x6828('0x2')]},'calleridname':{'type':Sequelize[_0x6828('0x2')]},'queue':{'type':Sequelize[_0x6828('0x2')]},'interface':{'type':Sequelize[_0x6828('0x2')]},'membername':{'type':Sequelize[_0x6828('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6828('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6828('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x6828('0x3')]},'agentdumpAt':{'type':Sequelize[_0x6828('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x6828('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6828('0x5')]},'reason':{'type':Sequelize[_0x6828('0x2')]},'lastevent':{'type':Sequelize[_0x6828('0x2')]},'channel':{'type':Sequelize[_0x6828('0x2')]},'channelstate':{'type':Sequelize[_0x6828('0x5')]},'channelstatedesc':{'type':Sequelize[_0x6828('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6828('0x2')]},'connectedlinename':{'type':Sequelize[_0x6828('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6828('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6828('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6828('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x6828('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6828('0x2')]},'destcalleridname':{'type':Sequelize[_0x6828('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6828('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6828('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6828('0x2')]},'destcontext':{'type':Sequelize[_0x6828('0x2')]},'destexten':{'type':Sequelize[_0x6828('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6828('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6828('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x6828('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6828('0x2')],'comment':_0x6828('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x6828('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f66=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x65f6('0x1')]},'calleridnum':{'type':Sequelize[_0x65f6('0x1')]},'calleridname':{'type':Sequelize[_0x65f6('0x1')]},'queue':{'type':Sequelize[_0x65f6('0x1')]},'interface':{'type':Sequelize[_0x65f6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x65f6('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x65f6('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x65f6('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x65f6('0x4')]},'agentacw':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x65f6('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x65f6('0x1')]},'channelstate':{'type':Sequelize[_0x65f6('0x4')]},'channelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x65f6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x65f6('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x65f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridnum':{'type':Sequelize[_0x65f6('0x1')]},'destcalleridname':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x65f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x65f6('0x1')]},'destlanguage':{'type':Sequelize[_0x65f6('0x1')]},'destaccountcode':{'type':Sequelize[_0x65f6('0x1')]},'destcontext':{'type':Sequelize[_0x65f6('0x1')]},'destexten':{'type':Sequelize[_0x65f6('0x1')]},'destpriority':{'type':Sequelize[_0x65f6('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x65f6('0x1')],'comment':_0x65f6('0x5')},'transferexten':{'type':Sequelize[_0x65f6('0x1')]},'transferuniqueid':{'type':Sequelize[_0x65f6('0x1')]},'agententerreason':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 2bd0865..f7c6d26 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 696d04a..bcbcaf8 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 _0x10af=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x472e18,_0x5c55f7){var _0x5b928d=function(_0x41669c){while(--_0x41669c){_0x472e18['push'](_0x472e18['shift']());}};_0x5b928d(++_0x5c55f7);}(_0x10af,0xfc));var _0xf10a=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x10af[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xf10a('0x0'));var util=require('util');var logger=require(_0xf10a('0x1'))(_0xf10a('0x2'));var moment=require(_0xf10a('0x3'));var BPromise=require(_0xf10a('0x4'));var rp=require(_0xf10a('0x5'));var fs=require('fs');var path=require(_0xf10a('0x6'));var rimraf=require(_0xf10a('0x7'));var config=require(_0xf10a('0x8'));var attributes=require('./voiceAgentReport.attributes');module[_0xf10a('0x9')]=function(_0xf86ea1,_0x5c9a4c){return _0xf86ea1['define'](_0xf10a('0xa'),attributes,{'tableName':_0xf10a('0xb'),'paranoid':![],'indexes':[{'fields':[_0xf10a('0xc'),_0xf10a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a93=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','api','moment','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a93,0xf6));var _0x35a9=function(_0x2033c6,_0x27015c){_0x2033c6=_0x2033c6-0x0;var _0x508b4c=_0x5a93[_0x2033c6];return _0x508b4c;};'use strict';var _=require('lodash');var util=require(_0x35a9('0x0'));var logger=require('../../config/logger')(_0x35a9('0x1'));var moment=require(_0x35a9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35a9('0x3'));var rimraf=require(_0x35a9('0x4'));var config=require(_0x35a9('0x5'));var attributes=require('./voiceAgentReport.attributes');module[_0x35a9('0x6')]=function(_0x27ed9f,_0x2e8a14){return _0x27ed9f[_0x35a9('0x7')](_0x35a9('0x8'),attributes,{'tableName':_0x35a9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x35a9('0xa'),_0x35a9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2550b51..4b2ddf3 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 _0x3f32=['request','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','VoiceAgentReport','create','body','options','then','CreateVoiceAgentReport','update','raw','UpdateVoiceAgentReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x23496e,_0x5c2620){var _0xd5128e=function(_0x503fdc){while(--_0x503fdc){_0x23496e['push'](_0x23496e['shift']());}};_0xd5128e(++_0x5c2620);}(_0x3f32,0xce));var _0x23f3=function(_0x461a30,_0x4366bc){_0x461a30=_0x461a30-0x0;var _0x2e4a01=_0x3f32[_0x461a30];return _0x2e4a01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23f3('0x0'));var BPromise=require(_0x23f3('0x1'));var rs=require(_0x23f3('0x2'));var fs=require('fs');var Redis=require(_0x23f3('0x3'));var db=require(_0x23f3('0x4'))['db'];var utils=require(_0x23f3('0x5'));var logger=require(_0x23f3('0x6'))(_0x23f3('0x7'));var config=require(_0x23f3('0x8'));var jayson=require(_0x23f3('0x9'));var client=jayson[_0x23f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c83c5,_0x8a2471,_0x5a805e){return new BPromise(function(_0xed2529,_0x25da85){return client[_0x23f3('0xb')](_0x5c83c5,_0x5a805e)['then'](function(_0x1a10a5){logger[_0x23f3('0xc')](_0x23f3('0xd'),_0x8a2471,'request\x20sent');logger[_0x23f3('0xe')](_0x23f3('0xf'),_0x8a2471,_0x23f3('0x10'),JSON[_0x23f3('0x11')](_0x1a10a5));if(_0x1a10a5['error']){if(_0x1a10a5['error'][_0x23f3('0x12')]===0x1f4){logger[_0x23f3('0x13')](_0x23f3('0xd'),_0x8a2471,_0x1a10a5[_0x23f3('0x13')]['message']);return _0x25da85(_0x1a10a5[_0x23f3('0x13')]['message']);}logger[_0x23f3('0x13')](_0x23f3('0xd'),_0x8a2471,_0x1a10a5[_0x23f3('0x13')]['message']);return _0xed2529(_0x1a10a5[_0x23f3('0x13')][_0x23f3('0x14')]);}else{logger[_0x23f3('0xc')](_0x23f3('0xd'),_0x8a2471,_0x23f3('0x10'));_0xed2529(_0x1a10a5['result'][_0x23f3('0x14')]);}})[_0x23f3('0x15')](function(_0x27fa1d){logger[_0x23f3('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x8a2471,_0x27fa1d);_0x25da85(_0x27fa1d);});});}exports['CreateVoiceAgentReport']=function(_0x12e915){var _0x12372d=this;return new Promise(function(_0x57396c,_0x596bf2){return db[_0x23f3('0x16')][_0x23f3('0x17')](_0x12e915[_0x23f3('0x18')],{'raw':_0x12e915[_0x23f3('0x19')]?_0x12e915[_0x23f3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x23f3('0x1a')](function(_0x2ee6d7){logger['info'](_0x23f3('0x1b'),_0x12e915);logger[_0x23f3('0xe')](_0x23f3('0x1b'),_0x12e915,JSON[_0x23f3('0x11')](_0x2ee6d7));_0x57396c(_0x2ee6d7);})[_0x23f3('0x15')](function(_0x21de0c){logger[_0x23f3('0x13')](_0x23f3('0x1b'),_0x21de0c[_0x23f3('0x14')],_0x12e915);_0x596bf2(_0x12372d[_0x23f3('0x13')](0x1f4,_0x21de0c[_0x23f3('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x549050){var _0x2fecfe=this;return new Promise(function(_0x17d4d4,_0x4dc913){return db[_0x23f3('0x16')][_0x23f3('0x1c')](_0x549050['body'],{'raw':_0x549050[_0x23f3('0x19')]?_0x549050[_0x23f3('0x19')][_0x23f3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x549050[_0x23f3('0x19')]?_0x549050[_0x23f3('0x19')]['where']||null:null,'attributes':_0x549050[_0x23f3('0x19')]?_0x549050['options']['attributes']||null:null,'limit':_0x549050[_0x23f3('0x19')]?_0x549050[_0x23f3('0x19')]['limit']||null:null})[_0x23f3('0x1a')](function(_0x24f48f){logger[_0x23f3('0xc')](_0x23f3('0x1e'),_0x549050);logger['debug'](_0x23f3('0x1e'),_0x549050,JSON[_0x23f3('0x11')](_0x24f48f));_0x17d4d4(_0x24f48f);})[_0x23f3('0x15')](function(_0x22e391){logger['error'](_0x23f3('0x1e'),_0x22e391[_0x23f3('0x14')],_0x549050);_0x4dc913(_0x2fecfe['error'](0x1f4,_0x22e391['message']));});});}; \ No newline at end of file +var _0x0803=['../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4efb28,_0x408a68){var _0x40f20c=function(_0x1eb584){while(--_0x1eb584){_0x4efb28['push'](_0x4efb28['shift']());}};_0x40f20c(++_0x408a68);}(_0x0803,0x1c7));var _0x3080=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0803[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3080('0x0'));var util=require(_0x3080('0x1'));var moment=require(_0x3080('0x2'));var BPromise=require(_0x3080('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3080('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3080('0x5'));var logger=require(_0x3080('0x6'))('rpc');var config=require(_0x3080('0x7'));var jayson=require(_0x3080('0x8'));var client=jayson['client'][_0x3080('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1da051,_0x48e4a2,_0x1b685a){return new BPromise(function(_0x15f8e0,_0x1d04c0){return client[_0x3080('0xa')](_0x1da051,_0x1b685a)[_0x3080('0xb')](function(_0x70d5e4){logger[_0x3080('0xc')](_0x3080('0xd'),_0x48e4a2,_0x3080('0xe'));logger[_0x3080('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x48e4a2,'request\x20sent',JSON['stringify'](_0x70d5e4));if(_0x70d5e4[_0x3080('0x10')]){if(_0x70d5e4[_0x3080('0x10')][_0x3080('0x11')]===0x1f4){logger[_0x3080('0x10')](_0x3080('0xd'),_0x48e4a2,_0x70d5e4[_0x3080('0x10')][_0x3080('0x12')]);return _0x1d04c0(_0x70d5e4[_0x3080('0x10')]['message']);}logger['error'](_0x3080('0xd'),_0x48e4a2,_0x70d5e4['error'][_0x3080('0x12')]);return _0x15f8e0(_0x70d5e4['error'][_0x3080('0x12')]);}else{logger[_0x3080('0xc')](_0x3080('0xd'),_0x48e4a2,_0x3080('0xe'));_0x15f8e0(_0x70d5e4[_0x3080('0x13')][_0x3080('0x12')]);}})[_0x3080('0x14')](function(_0x3d8b3e){logger[_0x3080('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x48e4a2,_0x3d8b3e);_0x1d04c0(_0x3d8b3e);});});}exports[_0x3080('0x15')]=function(_0xe90ee9){var _0x2552b9=this;return new Promise(function(_0x11eaa8,_0x30b239){return db[_0x3080('0x16')][_0x3080('0x17')](_0xe90ee9[_0x3080('0x18')],{'raw':_0xe90ee9[_0x3080('0x19')]?_0xe90ee9[_0x3080('0x19')][_0x3080('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x59fa72){logger[_0x3080('0xc')](_0x3080('0x15'),_0xe90ee9);logger['debug'](_0x3080('0x15'),_0xe90ee9,JSON[_0x3080('0x1b')](_0x59fa72));_0x11eaa8(_0x59fa72);})[_0x3080('0x14')](function(_0x36400f){logger['error'](_0x3080('0x15'),_0x36400f[_0x3080('0x12')],_0xe90ee9);_0x30b239(_0x2552b9[_0x3080('0x10')](0x1f4,_0x36400f[_0x3080('0x12')]));});});};exports[_0x3080('0x1c')]=function(_0x3ef6bb){var _0x2ed7ee=this;return new Promise(function(_0x3eba2f,_0x56fae3){return db[_0x3080('0x16')][_0x3080('0x1d')](_0x3ef6bb[_0x3080('0x18')],{'raw':_0x3ef6bb[_0x3080('0x19')]?_0x3ef6bb[_0x3080('0x19')][_0x3080('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ef6bb[_0x3080('0x19')]?_0x3ef6bb[_0x3080('0x19')][_0x3080('0x1e')]||null:null,'attributes':_0x3ef6bb[_0x3080('0x19')]?_0x3ef6bb['options'][_0x3080('0x1f')]||null:null,'limit':_0x3ef6bb[_0x3080('0x19')]?_0x3ef6bb[_0x3080('0x19')][_0x3080('0x20')]||null:null})[_0x3080('0xb')](function(_0x1540b9){logger[_0x3080('0xc')](_0x3080('0x1c'),_0x3ef6bb);logger[_0x3080('0xf')](_0x3080('0x1c'),_0x3ef6bb,JSON[_0x3080('0x1b')](_0x1540b9));_0x3eba2f(_0x1540b9);})[_0x3080('0x14')](function(_0xa02cf4){logger[_0x3080('0x10')](_0x3080('0x1c'),_0xa02cf4[_0x3080('0x12')],_0x3ef6bb);_0x56fae3(_0x2ed7ee[_0x3080('0x10')](0x1f4,_0xa02cf4[_0x3080('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index aaeca51..93fa4a0 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 _0xe5b3=['../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x230842,_0x370b27){var _0x148582=function(_0x209ec4){while(--_0x209ec4){_0x230842['push'](_0x230842['shift']());}};_0x148582(++_0x370b27);}(_0xe5b3,0x133));var _0x3e5b=function(_0xf4cfd6,_0x6ac85d){_0xf4cfd6=_0xf4cfd6-0x0;var _0x2f6a2c=_0xe5b3[_0xf4cfd6];return _0x2f6a2c;};'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 fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router; \ No newline at end of file +var _0xeec6=['isAuthenticated','index','/describe','describe','get','show','post','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xeec6,0x1c2));var _0x6eec=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0xeec6[_0x26d386];return _0x4ef9a8;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get']('/',auth[_0x6eec('0xa')](),controller[_0x6eec('0xb')]);router['get'](_0x6eec('0xc'),auth[_0x6eec('0xa')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xa')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6eec('0x11'),auth[_0x6eec('0xa')](),controller['update']);router['delete'](_0x6eec('0x11'),auth['isAuthenticated'](),controller[_0x6eec('0x12')]);module[_0x6eec('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 555af7a..79138c0 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 _0xa521=['outbound-fax','dialer','STRING','DATE','INTEGER','sequelize','exports','inbound','internal','inbound-fax'];(function(_0x1fe992,_0x2a362e){var _0x1f009d=function(_0x13e340){while(--_0x13e340){_0x1fe992['push'](_0x1fe992['shift']());}};_0x1f009d(++_0x2a362e);}(_0xa521,0xeb));var _0x1a52=function(_0x37ca84,_0x1cdef5){_0x37ca84=_0x37ca84-0x0;var _0x3aa295=_0xa521[_0x37ca84];return _0x3aa295;};'use strict';var Sequelize=require(_0x1a52('0x0'));module[_0x1a52('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1a52('0x2'),_0x1a52('0x3'),'outbound',_0x1a52('0x4'),_0x1a52('0x5'),_0x1a52('0x6'))},'tag':{'type':Sequelize[_0x1a52('0x7')]},'accountcode':{'type':Sequelize[_0x1a52('0x7')]},'source':{'type':Sequelize[_0x1a52('0x7')]},'destination':{'type':Sequelize[_0x1a52('0x7')]},'destinationcontext':{'type':Sequelize[_0x1a52('0x7')]},'callerid':{'type':Sequelize[_0x1a52('0x7')]},'channel':{'type':Sequelize[_0x1a52('0x7')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1a52('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x1a52('0x8')]},'duration':{'type':Sequelize[_0x1a52('0x9')]},'billableseconds':{'type':Sequelize[_0x1a52('0x9')]},'mohtime':{'type':Sequelize[_0x1a52('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1a52('0x7')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x1a52('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x1a52('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x1a52('0x7')]},'note':{'type':Sequelize[_0x1a52('0x7')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x1a52('0x9')]},'sipcallid':{'type':Sequelize[_0x1a52('0x7')]}}; \ No newline at end of file +var _0x4e6e=['dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x52eb89,_0x4cde74){var _0x28ff98=function(_0x5917f2){while(--_0x5917f2){_0x52eb89['push'](_0x52eb89['shift']());}};_0x28ff98(++_0x4cde74);}(_0x4e6e,0x70));var _0xe4e6=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x4e6e[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require('sequelize');module[_0xe4e6('0x0')]={'uniqueid':{'type':Sequelize[_0xe4e6('0x1')]},'type':{'type':Sequelize[_0xe4e6('0x2')](_0xe4e6('0x3'),_0xe4e6('0x4'),_0xe4e6('0x5'),_0xe4e6('0x6'),_0xe4e6('0x7'),_0xe4e6('0x8'))},'tag':{'type':Sequelize[_0xe4e6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xe4e6('0x1')]},'destinationcontext':{'type':Sequelize[_0xe4e6('0x1')]},'callerid':{'type':Sequelize[_0xe4e6('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe4e6('0x9')]},'starttime':{'type':Sequelize[_0xe4e6('0xa')]},'systemanswertime':{'type':Sequelize[_0xe4e6('0xa')]},'answertime':{'type':Sequelize[_0xe4e6('0xa')]},'endtime':{'type':Sequelize[_0xe4e6('0xa')]},'duration':{'type':Sequelize[_0xe4e6('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe4e6('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe4e6('0x1')]},'amaflags':{'type':Sequelize[_0xe4e6('0x1')]},'userfield':{'type':Sequelize[_0xe4e6('0x1')]},'userDisposition':{'type':Sequelize[_0xe4e6('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xe4e6('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xe4e6('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xe4e6('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 9f78683..0fa0cb8 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0xadb5,0xad));var _0x5adb=function(_0x1d9edd,_0x2102ff){_0x1d9edd=_0x1d9edd-0x0;var _0x361c86=_0xadb5[_0x1d9edd];return _0x361c86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 2d01ad7..43aa629 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 _0xd5fa=['uniqueid','lodash','util','api','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x26562c,_0x57a1f4){var _0x591a1a=function(_0x36226f){while(--_0x36226f){_0x26562c['push'](_0x26562c['shift']());}};_0x591a1a(++_0x57a1f4);}(_0xd5fa,0x1ae));var _0xad5f=function(_0x29ba39,_0x96bd47){_0x29ba39=_0x29ba39-0x0;var _0x2f1112=_0xd5fa[_0x29ba39];return _0x2f1112;};'use strict';var _=require(_0xad5f('0x0'));var util=require(_0xad5f('0x1'));var logger=require('../../config/logger')(_0xad5f('0x2'));var moment=require('moment');var BPromise=require(_0xad5f('0x3'));var rp=require(_0xad5f('0x4'));var fs=require('fs');var path=require(_0xad5f('0x5'));var rimraf=require(_0xad5f('0x6'));var config=require('../../config/environment');var attributes=require(_0xad5f('0x7'));module[_0xad5f('0x8')]=function(_0x32c1e1,_0x4b4cff){return _0x32c1e1[_0xad5f('0x9')](_0xad5f('0xa'),attributes,{'tableName':_0xad5f('0xb'),'paranoid':![],'indexes':[{'fields':[_0xad5f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3de8=['VoiceCallReport','report_call','lodash','util','api','moment','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x5d72c8,_0x85e2e1){var _0x3abc9e=function(_0x1311b){while(--_0x1311b){_0x5d72c8['push'](_0x5d72c8['shift']());}};_0x3abc9e(++_0x85e2e1);}(_0x3de8,0xe9));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83de('0x0'));var util=require(_0x83de('0x1'));var logger=require('../../config/logger')(_0x83de('0x2'));var moment=require(_0x83de('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x83de('0x4'));var config=require(_0x83de('0x5'));var attributes=require(_0x83de('0x6'));module[_0x83de('0x7')]=function(_0x3ce831,_0x55f12b){return _0x3ce831[_0x83de('0x8')](_0x83de('0x9'),attributes,{'tableName':_0x83de('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 941e429..1b2d193 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 _0xe6f0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','include','model','map','GetVoiceCallReport','debug','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10d95b,_0x3a0292){var _0x2a12b0=function(_0x1e7408){while(--_0x1e7408){_0x10d95b['push'](_0x10d95b['shift']());}};_0x2a12b0(++_0x3a0292);}(_0xe6f0,0xde));var _0x0e6f=function(_0x188e3b,_0x4b8e01){_0x188e3b=_0x188e3b-0x0;var _0x5137c9=_0xe6f0[_0x188e3b];return _0x5137c9;};'use strict';var _=require(_0x0e6f('0x0'));var util=require(_0x0e6f('0x1'));var moment=require('moment');var BPromise=require(_0x0e6f('0x2'));var rs=require(_0x0e6f('0x3'));var fs=require('fs');var Redis=require(_0x0e6f('0x4'));var db=require(_0x0e6f('0x5'))['db'];var utils=require(_0x0e6f('0x6'));var logger=require(_0x0e6f('0x7'))('rpc');var config=require(_0x0e6f('0x8'));var jayson=require(_0x0e6f('0x9'));var client=jayson[_0x0e6f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2b04,_0x36a17f,_0x395ec6){return new BPromise(function(_0x2773c3,_0x163078){return client['request'](_0x4e2b04,_0x395ec6)[_0x0e6f('0xb')](function(_0x265699){logger[_0x0e6f('0xc')](_0x0e6f('0xd'),_0x36a17f,_0x0e6f('0xe'));logger['debug'](_0x0e6f('0xf'),_0x36a17f,_0x0e6f('0xe'),JSON['stringify'](_0x265699));if(_0x265699['error']){if(_0x265699[_0x0e6f('0x10')]['code']===0x1f4){logger[_0x0e6f('0x10')](_0x0e6f('0xd'),_0x36a17f,_0x265699[_0x0e6f('0x10')][_0x0e6f('0x11')]);return _0x163078(_0x265699[_0x0e6f('0x10')]['message']);}logger['error'](_0x0e6f('0xd'),_0x36a17f,_0x265699[_0x0e6f('0x10')][_0x0e6f('0x11')]);return _0x2773c3(_0x265699[_0x0e6f('0x10')][_0x0e6f('0x11')]);}else{logger[_0x0e6f('0xc')](_0x0e6f('0xd'),_0x36a17f,_0x0e6f('0xe'));_0x2773c3(_0x265699[_0x0e6f('0x12')][_0x0e6f('0x11')]);}})[_0x0e6f('0x13')](function(_0x4ca3d8){logger[_0x0e6f('0x10')](_0x0e6f('0xd'),_0x36a17f,_0x4ca3d8);_0x163078(_0x4ca3d8);});});}exports['GetVoiceCallReport']=function(_0x13999b){var _0x1b380f=this;return new Promise(function(_0x233b2a,_0x1268fe){return db[_0x0e6f('0x14')][_0x0e6f('0x15')]({'raw':_0x13999b[_0x0e6f('0x16')]?_0x13999b[_0x0e6f('0x16')][_0x0e6f('0x17')]===undefined?!![]:![]:!![],'where':_0x13999b[_0x0e6f('0x16')]?_0x13999b[_0x0e6f('0x16')]['where']||null:null,'attributes':_0x13999b[_0x0e6f('0x16')]?_0x13999b[_0x0e6f('0x16')][_0x0e6f('0x18')]||null:null,'limit':_0x13999b[_0x0e6f('0x16')]?_0x13999b['options']['limit']||null:null,'include':_0x13999b[_0x0e6f('0x16')]?_0x13999b['options'][_0x0e6f('0x19')]?_['map'](_0x13999b[_0x0e6f('0x16')][_0x0e6f('0x19')],function(_0xa80b2f){return{'model':db[_0xa80b2f[_0x0e6f('0x1a')]],'as':_0xa80b2f['as'],'attributes':_0xa80b2f[_0x0e6f('0x18')],'include':_0xa80b2f['include']?_[_0x0e6f('0x1b')](_0xa80b2f[_0x0e6f('0x19')],function(_0x3facec){return{'model':db[_0x3facec[_0x0e6f('0x1a')]],'as':_0x3facec['as'],'attributes':_0x3facec[_0x0e6f('0x18')],'include':_0x3facec[_0x0e6f('0x19')]?_[_0x0e6f('0x1b')](_0x3facec['include'],function(_0x236e15){return{'model':db[_0x236e15[_0x0e6f('0x1a')]],'as':_0x236e15['as'],'attributes':_0x236e15['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e6f('0xb')](function(_0x52f193){logger[_0x0e6f('0xc')](_0x0e6f('0x1c'),_0x13999b);logger[_0x0e6f('0x1d')](_0x0e6f('0x1c'),_0x13999b,JSON[_0x0e6f('0x1e')](_0x52f193));_0x233b2a(_0x52f193);})[_0x0e6f('0x13')](function(_0x23ad89){logger[_0x0e6f('0x10')]('GetVoiceCallReport',_0x23ad89[_0x0e6f('0x11')],_0x13999b);_0x1268fe(_0x1b380f[_0x0e6f('0x10')](0x1f4,_0x23ad89[_0x0e6f('0x11')]));});});};exports[_0x0e6f('0x1f')]=function(_0x18657e){var _0x1d42ec=this;return new Promise(function(_0x1ceb70,_0x317cfe){return db[_0x0e6f('0x14')][_0x0e6f('0x20')](_0x18657e[_0x0e6f('0x21')],{'raw':_0x18657e[_0x0e6f('0x16')]?_0x18657e[_0x0e6f('0x16')][_0x0e6f('0x17')]===undefined?!![]:![]:!![]})[_0x0e6f('0xb')](function(_0x41bce4){logger[_0x0e6f('0xc')](_0x0e6f('0x1f'),_0x18657e);logger[_0x0e6f('0x1d')](_0x0e6f('0x1f'),_0x18657e,JSON[_0x0e6f('0x1e')](_0x41bce4));_0x1ceb70(_0x41bce4);})[_0x0e6f('0x13')](function(_0x5e1e09){logger[_0x0e6f('0x10')](_0x0e6f('0x1f'),_0x5e1e09[_0x0e6f('0x11')],_0x18657e);_0x317cfe(_0x1d42ec[_0x0e6f('0x10')](0x1f4,_0x5e1e09[_0x0e6f('0x11')]));});});};exports[_0x0e6f('0x22')]=function(_0x1fd3e5){var _0x3f3be2=this;return new Promise(function(_0x2969cf,_0x5912ba){return db[_0x0e6f('0x14')][_0x0e6f('0x23')](_0x1fd3e5['body'],{'raw':_0x1fd3e5[_0x0e6f('0x16')]?_0x1fd3e5[_0x0e6f('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd3e5['options']?_0x1fd3e5['options'][_0x0e6f('0x24')]||null:null,'attributes':_0x1fd3e5[_0x0e6f('0x16')]?_0x1fd3e5[_0x0e6f('0x16')]['attributes']||null:null,'limit':_0x1fd3e5[_0x0e6f('0x16')]?_0x1fd3e5['options'][_0x0e6f('0x25')]||null:null})[_0x0e6f('0xb')](function(_0x53b9f6){logger[_0x0e6f('0xc')](_0x0e6f('0x22'),_0x1fd3e5);logger[_0x0e6f('0x1d')]('UpdateVoiceCallReport',_0x1fd3e5,JSON[_0x0e6f('0x1e')](_0x53b9f6));_0x2969cf(_0x53b9f6);})[_0x0e6f('0x13')](function(_0x11403e){logger[_0x0e6f('0x10')]('UpdateVoiceCallReport',_0x11403e['message'],_0x1fd3e5);_0x5912ba(_0x3f3be2[_0x0e6f('0x10')](0x1f4,_0x11403e[_0x0e6f('0x11')]));});});}; \ No newline at end of file +var _0xbfca=['update','where','limit','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','include','model','map','then','CreateVoiceCallReport','create','body','stringify'];(function(_0xb5582e,_0x4ad804){var _0x7f5350=function(_0x59f6d9){while(--_0x59f6d9){_0xb5582e['push'](_0xb5582e['shift']());}};_0x7f5350(++_0x4ad804);}(_0xbfca,0x18a));var _0xabfc=function(_0x251961,_0x4a90c0){_0x251961=_0x251961-0x0;var _0x57e1f7=_0xbfca[_0x251961];return _0x57e1f7;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var moment=require(_0xabfc('0x2'));var BPromise=require(_0xabfc('0x3'));var rs=require(_0xabfc('0x4'));var fs=require('fs');var Redis=require(_0xabfc('0x5'));var db=require(_0xabfc('0x6'))['db'];var utils=require(_0xabfc('0x7'));var logger=require(_0xabfc('0x8'))(_0xabfc('0x9'));var config=require(_0xabfc('0xa'));var jayson=require(_0xabfc('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x232286,_0x107d2f,_0x3b3cf0){return new BPromise(function(_0xc87193,_0x27ebf4){return client[_0xabfc('0xc')](_0x232286,_0x3b3cf0)['then'](function(_0x4c28a4){logger[_0xabfc('0xd')](_0xabfc('0xe'),_0x107d2f,_0xabfc('0xf'));logger[_0xabfc('0x10')](_0xabfc('0x11'),_0x107d2f,_0xabfc('0xf'),JSON['stringify'](_0x4c28a4));if(_0x4c28a4['error']){if(_0x4c28a4['error']['code']===0x1f4){logger[_0xabfc('0x12')](_0xabfc('0xe'),_0x107d2f,_0x4c28a4[_0xabfc('0x12')][_0xabfc('0x13')]);return _0x27ebf4(_0x4c28a4[_0xabfc('0x12')]['message']);}logger[_0xabfc('0x12')](_0xabfc('0xe'),_0x107d2f,_0x4c28a4[_0xabfc('0x12')][_0xabfc('0x13')]);return _0xc87193(_0x4c28a4['error']['message']);}else{logger[_0xabfc('0xd')](_0xabfc('0xe'),_0x107d2f,_0xabfc('0xf'));_0xc87193(_0x4c28a4['result'][_0xabfc('0x13')]);}})[_0xabfc('0x14')](function(_0x1d6976){logger['error'](_0xabfc('0xe'),_0x107d2f,_0x1d6976);_0x27ebf4(_0x1d6976);});});}exports[_0xabfc('0x15')]=function(_0x276264){var _0x444a6d=this;return new Promise(function(_0x27653d,_0x206673){return db[_0xabfc('0x16')][_0xabfc('0x17')]({'raw':_0x276264[_0xabfc('0x18')]?_0x276264[_0xabfc('0x18')][_0xabfc('0x19')]===undefined?!![]:![]:!![],'where':_0x276264[_0xabfc('0x18')]?_0x276264[_0xabfc('0x18')]['where']||null:null,'attributes':_0x276264[_0xabfc('0x18')]?_0x276264[_0xabfc('0x18')][_0xabfc('0x1a')]||null:null,'limit':_0x276264[_0xabfc('0x18')]?_0x276264[_0xabfc('0x18')]['limit']||null:null,'include':_0x276264[_0xabfc('0x18')]?_0x276264[_0xabfc('0x18')][_0xabfc('0x1b')]?_['map'](_0x276264[_0xabfc('0x18')][_0xabfc('0x1b')],function(_0x41de2d){return{'model':db[_0x41de2d[_0xabfc('0x1c')]],'as':_0x41de2d['as'],'attributes':_0x41de2d[_0xabfc('0x1a')],'include':_0x41de2d[_0xabfc('0x1b')]?_[_0xabfc('0x1d')](_0x41de2d[_0xabfc('0x1b')],function(_0x257544){return{'model':db[_0x257544[_0xabfc('0x1c')]],'as':_0x257544['as'],'attributes':_0x257544['attributes'],'include':_0x257544[_0xabfc('0x1b')]?_[_0xabfc('0x1d')](_0x257544[_0xabfc('0x1b')],function(_0x22baeb){return{'model':db[_0x22baeb[_0xabfc('0x1c')]],'as':_0x22baeb['as'],'attributes':_0x22baeb[_0xabfc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xabfc('0x1e')](function(_0x577b72){logger[_0xabfc('0xd')](_0xabfc('0x15'),_0x276264);logger[_0xabfc('0x10')]('GetVoiceCallReport',_0x276264,JSON['stringify'](_0x577b72));_0x27653d(_0x577b72);})[_0xabfc('0x14')](function(_0x1d38fe){logger['error'](_0xabfc('0x15'),_0x1d38fe[_0xabfc('0x13')],_0x276264);_0x206673(_0x444a6d[_0xabfc('0x12')](0x1f4,_0x1d38fe['message']));});});};exports[_0xabfc('0x1f')]=function(_0xcd1508){var _0x6053b=this;return new Promise(function(_0x5b33a0,_0x55a5e0){return db[_0xabfc('0x16')][_0xabfc('0x20')](_0xcd1508[_0xabfc('0x21')],{'raw':_0xcd1508[_0xabfc('0x18')]?_0xcd1508[_0xabfc('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e897a){logger['info'](_0xabfc('0x1f'),_0xcd1508);logger[_0xabfc('0x10')]('CreateVoiceCallReport',_0xcd1508,JSON[_0xabfc('0x22')](_0x2e897a));_0x5b33a0(_0x2e897a);})[_0xabfc('0x14')](function(_0x5cc846){logger[_0xabfc('0x12')](_0xabfc('0x1f'),_0x5cc846[_0xabfc('0x13')],_0xcd1508);_0x55a5e0(_0x6053b[_0xabfc('0x12')](0x1f4,_0x5cc846['message']));});});};exports['UpdateVoiceCallReport']=function(_0x4defcc){var _0x49dcc7=this;return new Promise(function(_0x2163d7,_0x3c970e){return db['VoiceCallReport'][_0xabfc('0x23')](_0x4defcc[_0xabfc('0x21')],{'raw':_0x4defcc[_0xabfc('0x18')]?_0x4defcc['options'][_0xabfc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4defcc['options']?_0x4defcc[_0xabfc('0x18')][_0xabfc('0x24')]||null:null,'attributes':_0x4defcc[_0xabfc('0x18')]?_0x4defcc[_0xabfc('0x18')][_0xabfc('0x1a')]||null:null,'limit':_0x4defcc[_0xabfc('0x18')]?_0x4defcc[_0xabfc('0x18')][_0xabfc('0x25')]||null:null})[_0xabfc('0x1e')](function(_0x524e35){logger['info'](_0xabfc('0x26'),_0x4defcc);logger['debug'](_0xabfc('0x26'),_0x4defcc,JSON[_0xabfc('0x22')](_0x524e35));_0x2163d7(_0x524e35);})[_0xabfc('0x14')](function(_0x1c2bc9){logger[_0xabfc('0x12')](_0xabfc('0x26'),_0x1c2bc9[_0xabfc('0x13')],_0x4defcc);_0x3c970e(_0x49dcc7[_0xabfc('0x12')](0x1f4,_0x1c2bc9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 4fdb1b7..7325b45 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 _0x5c71=['../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x8a7c45,_0x50d6a5){var _0x2c61e6=function(_0x287e95){while(--_0x287e95){_0x8a7c45['push'](_0x8a7c45['shift']());}};_0x2c61e6(++_0x50d6a5);}(_0x5c71,0x1af));var _0x15c7=function(_0x38f70,_0x47a0f6){_0x38f70=_0x38f70-0x0;var _0x81fa37=_0x5c71[_0x38f70];return _0x81fa37;};'use strict';var multer=require(_0x15c7('0x0'));var util=require(_0x15c7('0x1'));var path=require(_0x15c7('0x2'));var timeout=require(_0x15c7('0x3'));var express=require(_0x15c7('0x4'));var router=express['Router']();var fs_extra=require(_0x15c7('0x5'));var auth=require(_0x15c7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x15c7('0x7'));var controller=require(_0x15c7('0x8'));router[_0x15c7('0x9')]('/',auth[_0x15c7('0xa')](),controller[_0x15c7('0xb')]);router[_0x15c7('0x9')](_0x15c7('0xc'),auth[_0x15c7('0xa')](),controller[_0x15c7('0xd')]);router['post']('/',auth[_0x15c7('0xa')](),controller[_0x15c7('0xe')]);router[_0x15c7('0xf')](_0x15c7('0xc'),auth['isAuthenticated'](),controller[_0x15c7('0x10')]);router[_0x15c7('0x11')](_0x15c7('0xc'),auth[_0x15c7('0xa')](),controller['destroy']);module[_0x15c7('0x12')]=router; \ No newline at end of file +var _0x3ee3=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','isAuthenticated','put','update','delete','exports','multer'];(function(_0x57f4de,_0x57c7ae){var _0x1edd7b=function(_0x249c96){while(--_0x249c96){_0x57f4de['push'](_0x57f4de['shift']());}};_0x1edd7b(++_0x57c7ae);}(_0x3ee3,0xa4));var _0x33ee=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x3ee3[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x33ee('0x0'));var util=require(_0x33ee('0x1'));var path=require(_0x33ee('0x2'));var timeout=require(_0x33ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33ee('0x4'));var interaction=require(_0x33ee('0x5'));var config=require(_0x33ee('0x6'));var controller=require(_0x33ee('0x7'));router[_0x33ee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x33ee('0x8')](_0x33ee('0x9'),auth[_0x33ee('0xa')](),controller['show']);router['post']('/',auth[_0x33ee('0xa')](),controller['create']);router[_0x33ee('0xb')](_0x33ee('0x9'),auth['isAuthenticated'](),controller[_0x33ee('0xc')]);router[_0x33ee('0xd')](_0x33ee('0x9'),auth[_0x33ee('0xa')](),controller['destroy']);module[_0x33ee('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index cc47b79..c3bbb05 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 _0x18f4=['join','getDataValue','split','BOOLEAN','sequelize','STRING','name','setDataValue','options'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x18f4,0x15a));var _0x418f=function(_0x454607,_0x54e146){_0x454607=_0x454607-0x0;var _0x2c82=_0x18f4[_0x454607];return _0x2c82;};'use strict';var Sequelize=require(_0x418f('0x0'));module['exports']={'name':{'type':Sequelize[_0x418f('0x1')]},'prefix':{'type':Sequelize[_0x418f('0x1')],'unique':_0x418f('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x418f('0x1')],'set':function(_0x4223f9){this[_0x418f('0x3')](_0x418f('0x4'),_0x4223f9?_0x4223f9[_0x418f('0x5')](''):[]);},'get':function(){return this[_0x418f('0x6')](_0x418f('0x4'))?this[_0x418f('0x6')](_0x418f('0x4'))[_0x418f('0x7')](''):[];}},'auth':{'type':Sequelize[_0x418f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x418f('0x1')]},'record':{'type':Sequelize[_0x418f('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x418f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0242=['BOOLEAN','exports','STRING','setDataValue','options','join','getDataValue','split'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0242,0x81));var _0x2024=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x0242[_0x210718];return _0x541bfc;};'use strict';var Sequelize=require('sequelize');module[_0x2024('0x0')]={'name':{'type':Sequelize[_0x2024('0x1')]},'prefix':{'type':Sequelize[_0x2024('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x2024('0x1')],'set':function(_0x5ce9ab){this[_0x2024('0x2')](_0x2024('0x3'),_0x5ce9ab?_0x5ce9ab[_0x2024('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x2024('0x3'))?this[_0x2024('0x5')]('options')[_0x2024('0x6')](''):[];}},'auth':{'type':Sequelize[_0x2024('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x2024('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2024('0x1')]},'description':{'type':Sequelize[_0x2024('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index bf1b3bd..3f3540f 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 _0x0531=['status','end','json','offset','undefined','count','set','apply','save','then','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChanSpies','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20ff68,_0x3d3472){var _0x586503=function(_0x4a8159){while(--_0x4a8159){_0x20ff68['push'](_0x20ff68['shift']());}};_0x586503(++_0x3d3472);}(_0x0531,0xde));var _0x1053=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x0531[_0x59eefb];return _0x1a49e8;};'use strict';var emlformat=require(_0x1053('0x0'));var rimraf=require(_0x1053('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1053('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1053('0x3'));var util=require(_0x1053('0x4'));var path=require(_0x1053('0x5'));var sox=require(_0x1053('0x6'));var csv=require(_0x1053('0x7'));var ejs=require(_0x1053('0x8'));var fs=require('fs');var fs_extra=require(_0x1053('0x9'));var _=require(_0x1053('0xa'));var squel=require(_0x1053('0xb'));var crypto=require(_0x1053('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1053('0xd'));var toCsv=require(_0x1053('0x7'));var querystring=require(_0x1053('0xe'));var Papa=require('papaparse');var Redis=require(_0x1053('0xf'));var authService=require(_0x1053('0x10'));var qs=require(_0x1053('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1053('0x12'))(_0x1053('0x13'));var utils=require('../../config/utils');var config=require(_0x1053('0x14'));var licenseUtil=require(_0x1053('0x15'));var db=require(_0x1053('0x16'))['db'];function respondWithStatusCode(_0x453a9c,_0x44b763){_0x44b763=_0x44b763||0xcc;return function(_0x28e0ae){if(_0x28e0ae){return _0x453a9c[_0x1053('0x17')](_0x44b763);}return _0x453a9c[_0x1053('0x18')](_0x44b763)[_0x1053('0x19')]();};}function respondWithResult(_0x2884b2,_0x5f477d){_0x5f477d=_0x5f477d||0xc8;return function(_0x4d6aa1){if(_0x4d6aa1){return _0x2884b2[_0x1053('0x18')](_0x5f477d)[_0x1053('0x1a')](_0x4d6aa1);}};}function respondWithFilteredResult(_0x41bf5c,_0x4db31d){return function(_0x5afba2){if(_0x5afba2){var _0x1f9067=typeof _0x4db31d[_0x1053('0x1b')]==='undefined'&&typeof _0x4db31d['limit']===_0x1053('0x1c');var _0x3c60a4=_0x5afba2[_0x1053('0x1d')];var _0x26c285=_0x1f9067?0x0:_0x4db31d['offset'];var _0x3523c0=_0x1f9067?_0x5afba2[_0x1053('0x1d')]:_0x4db31d[_0x1053('0x1b')]+_0x4db31d['limit'];var _0x259fb6;if(_0x3523c0>=_0x3c60a4){_0x3523c0=_0x3c60a4;_0x259fb6=0xc8;}else{_0x259fb6=0xce;}_0x41bf5c['status'](_0x259fb6);return _0x41bf5c[_0x1053('0x1e')]('Content-Range',_0x26c285+'-'+_0x3523c0+'/'+_0x3c60a4)['json'](_0x5afba2);}return null;};}function patchUpdates(_0x1b7f9e){return function(_0x448651){try{jsonpatch[_0x1053('0x1f')](_0x448651,_0x1b7f9e,!![]);}catch(_0x53a626){return BPromise['reject'](_0x53a626);}return _0x448651[_0x1053('0x20')]();};}function saveUpdates(_0x15204b,_0x203930){return function(_0x27371a){if(_0x27371a){return _0x27371a['update'](_0x15204b)[_0x1053('0x21')](function(_0x5c2710){return _0x5c2710;});}return null;};}function removeEntity(_0x2a13a7,_0x485f14){return function(_0x901db2){if(_0x901db2){return _0x901db2['destroy']()['then'](function(){var _0x4f3eb4=_0x901db2['get']({'plain':!![]});var _0x3dc2c0='ChanSpies';return db[_0x1053('0x22')][_0x1053('0x23')]({'where':{'type':_0x3dc2c0,'resourceId':_0x4f3eb4['id']}})[_0x1053('0x21')](function(){return _0x901db2;});})[_0x1053('0x21')](function(){_0x2a13a7[_0x1053('0x18')](0xcc)[_0x1053('0x19')]();});}};}function handleEntityNotFound(_0x2c7c39,_0x57c6e7){return function(_0x391194){if(!_0x391194){_0x2c7c39['sendStatus'](0x194);}return _0x391194;};}function handleError(_0x32c909,_0x2a4b4a){_0x2a4b4a=_0x2a4b4a||0x1f4;return function(_0x430601){logger[_0x1053('0x24')](_0x430601[_0x1053('0x25')]);if(_0x430601[_0x1053('0x26')]){delete _0x430601[_0x1053('0x26')];}_0x32c909[_0x1053('0x18')](_0x2a4b4a)[_0x1053('0x27')](_0x430601);};}exports[_0x1053('0x28')]=function(_0x20b27a,_0x27c11e){var _0x3ecd53={},_0x13c93b={},_0x4ff75d={'count':0x0,'rows':[]};var _0x363257=_[_0x1053('0x29')](db['VoiceChanSpy'][_0x1053('0x2a')],function(_0x3d75ca){return{'name':_0x3d75ca[_0x1053('0x2b')],'type':_0x3d75ca[_0x1053('0x2c')][_0x1053('0x2d')]};});_0x13c93b[_0x1053('0x2e')]=_[_0x1053('0x29')](_0x363257,_0x1053('0x26'));_0x13c93b[_0x1053('0x2f')]=_[_0x1053('0x30')](_0x20b27a[_0x1053('0x2f')]);_0x13c93b['filters']=_[_0x1053('0x31')](_0x13c93b[_0x1053('0x2e')],_0x13c93b[_0x1053('0x2f')]);_0x3ecd53[_0x1053('0x32')]=_['intersection'](_0x13c93b[_0x1053('0x2e')],qs[_0x1053('0x33')](_0x20b27a[_0x1053('0x2f')][_0x1053('0x33')]));_0x3ecd53[_0x1053('0x32')]=_0x3ecd53[_0x1053('0x32')][_0x1053('0x34')]?_0x3ecd53[_0x1053('0x32')]:_0x13c93b['model'];if(!_0x20b27a[_0x1053('0x2f')][_0x1053('0x35')]('nolimit')){_0x3ecd53[_0x1053('0x36')]=qs['limit'](_0x20b27a['query']['limit']);_0x3ecd53[_0x1053('0x1b')]=qs[_0x1053('0x1b')](_0x20b27a[_0x1053('0x2f')][_0x1053('0x1b')]);}_0x3ecd53[_0x1053('0x37')]=qs[_0x1053('0x38')](_0x20b27a['query'][_0x1053('0x38')]);_0x3ecd53[_0x1053('0x39')]=qs[_0x1053('0x3a')](_[_0x1053('0x3b')](_0x20b27a[_0x1053('0x2f')],_0x13c93b[_0x1053('0x3a')]),_0x363257);if(_0x20b27a[_0x1053('0x2f')][_0x1053('0x3c')]){_0x3ecd53[_0x1053('0x39')]=_[_0x1053('0x3d')](_0x3ecd53[_0x1053('0x39')],{'$or':_[_0x1053('0x29')](_0x363257,function(_0x5de715){if(_0x5de715[_0x1053('0x2c')]!==_0x1053('0x3e')){var _0x145394={};_0x145394[_0x5de715[_0x1053('0x26')]]={'$like':'%'+_0x20b27a[_0x1053('0x2f')]['filter']+'%'};return _0x145394;}})});}_0x3ecd53=_[_0x1053('0x3d')]({},_0x3ecd53,_0x20b27a[_0x1053('0x3f')]);var _0x426af4={'where':_0x3ecd53['where']};return db[_0x1053('0x40')][_0x1053('0x1d')](_0x426af4)[_0x1053('0x21')](function(_0x11cd06){_0x4ff75d[_0x1053('0x1d')]=_0x11cd06;if(_0x20b27a[_0x1053('0x2f')][_0x1053('0x41')]){_0x3ecd53[_0x1053('0x42')]=[{'all':!![]}];}return db[_0x1053('0x40')][_0x1053('0x43')](_0x3ecd53);})[_0x1053('0x21')](function(_0x44d267){_0x4ff75d[_0x1053('0x44')]=_0x44d267;return _0x4ff75d;})[_0x1053('0x21')](respondWithFilteredResult(_0x27c11e,_0x3ecd53))[_0x1053('0x45')](handleError(_0x27c11e,null));};exports[_0x1053('0x46')]=function(_0xed934f,_0x48c6ef){var _0x3087b7={'raw':![],'where':{'id':_0xed934f[_0x1053('0x47')]['id']}},_0x5d6db9={};_0x5d6db9[_0x1053('0x2e')]=_[_0x1053('0x30')](db[_0x1053('0x40')][_0x1053('0x2a')]);_0x5d6db9[_0x1053('0x2f')]=_[_0x1053('0x30')](_0xed934f[_0x1053('0x2f')]);_0x5d6db9[_0x1053('0x3a')]=_[_0x1053('0x31')](_0x5d6db9['model'],_0x5d6db9[_0x1053('0x2f')]);_0x3087b7[_0x1053('0x32')]=_['intersection'](_0x5d6db9[_0x1053('0x2e')],qs[_0x1053('0x33')](_0xed934f[_0x1053('0x2f')]['fields']));_0x3087b7[_0x1053('0x32')]=_0x3087b7[_0x1053('0x32')]['length']?_0x3087b7[_0x1053('0x32')]:_0x5d6db9[_0x1053('0x2e')];if(_0xed934f[_0x1053('0x2f')][_0x1053('0x41')]){_0x3087b7['include']=[{'all':!![]}];}_0x3087b7=_[_0x1053('0x3d')]({},_0x3087b7,_0xed934f[_0x1053('0x3f')]);return db[_0x1053('0x40')][_0x1053('0x48')](_0x3087b7)[_0x1053('0x21')](handleEntityNotFound(_0x48c6ef,null))[_0x1053('0x21')](respondWithResult(_0x48c6ef,null))[_0x1053('0x45')](handleError(_0x48c6ef,null));};exports['create']=function(_0x3b16c4,_0x1066e7){return db[_0x1053('0x40')][_0x1053('0x49')](_0x3b16c4[_0x1053('0x4a')],{})[_0x1053('0x21')](function(_0x1237e4){var _0x2bf362=_0x3b16c4['user']['get']({'plain':!![]});if(!_0x2bf362)throw new Error(_0x1053('0x4b'));if(_0x2bf362[_0x1053('0x4c')]==='user'){var _0x204ac8=_0x1237e4[_0x1053('0x4d')]({'plain':!![]});var _0x26e32=_0x1053('0x4e');return db[_0x1053('0x4f')]['find']({'where':{'name':_0x26e32,'userProfileId':_0x2bf362[_0x1053('0x50')]},'raw':!![]})[_0x1053('0x21')](function(_0x3d0a35){if(_0x3d0a35&&_0x3d0a35[_0x1053('0x51')]===0x0){return db[_0x1053('0x22')]['create']({'name':_0x204ac8[_0x1053('0x26')],'resourceId':_0x204ac8['id'],'type':_0x3d0a35[_0x1053('0x26')],'sectionId':_0x3d0a35['id']},{})['then'](function(){return _0x1237e4;});}else{return _0x1237e4;}})[_0x1053('0x45')](function(_0xc5e21d){logger[_0x1053('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc5e21d);throw _0xc5e21d;});}return _0x1237e4;})[_0x1053('0x21')](respondWithResult(_0x1066e7,0xc9))['catch'](handleError(_0x1066e7,null));};exports['update']=function(_0x358424,_0x11ee5a){if(_0x358424[_0x1053('0x4a')]['id']){delete _0x358424['body']['id'];}return db[_0x1053('0x40')]['find']({'where':{'id':_0x358424[_0x1053('0x47')]['id']}})['then'](handleEntityNotFound(_0x11ee5a,null))['then'](saveUpdates(_0x358424[_0x1053('0x4a')],null))[_0x1053('0x21')](respondWithResult(_0x11ee5a,null))[_0x1053('0x45')](handleError(_0x11ee5a,null));};exports['destroy']=function(_0x2fbc4,_0x3cc7cb){return db['VoiceChanSpy'][_0x1053('0x48')]({'where':{'id':_0x2fbc4[_0x1053('0x47')]['id']}})[_0x1053('0x21')](handleEntityNotFound(_0x3cc7cb,null))[_0x1053('0x21')](removeEntity(_0x3cc7cb,null))['catch'](handleError(_0x3cc7cb,null));}; \ No newline at end of file +var _0xb04a=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','VoiceChanSpy','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','count','includeAll','include','rows','catch','show','params','length','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2c53bc,_0x5edba0){var _0x37886c=function(_0x4cb3b7){while(--_0x4cb3b7){_0x2c53bc['push'](_0x2c53bc['shift']());}};_0x37886c(++_0x5edba0);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xab04('0x0'));var rimraf=require(_0xab04('0x1'));var zipdir=require(_0xab04('0x2'));var jsonpatch=require(_0xab04('0x3'));var rp=require('request-promise');var moment=require(_0xab04('0x4'));var BPromise=require(_0xab04('0x5'));var Mustache=require(_0xab04('0x6'));var util=require('util');var path=require(_0xab04('0x7'));var sox=require(_0xab04('0x8'));var csv=require(_0xab04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab04('0xa'));var _=require(_0xab04('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xab04('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab04('0xd'));var authService=require(_0xab04('0xe'));var qs=require(_0xab04('0xf'));var as=require(_0xab04('0x10'));var hardwareService=require(_0xab04('0x11'));var logger=require(_0xab04('0x12'))(_0xab04('0x13'));var utils=require(_0xab04('0x14'));var config=require(_0xab04('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38e003,_0x3cf546){_0x3cf546=_0x3cf546||0xcc;return function(_0x4160d5){if(_0x4160d5){return _0x38e003[_0xab04('0x16')](_0x3cf546);}return _0x38e003['status'](_0x3cf546)[_0xab04('0x17')]();};}function respondWithResult(_0x2934bd,_0x5e3471){_0x5e3471=_0x5e3471||0xc8;return function(_0x233a8d){if(_0x233a8d){return _0x2934bd[_0xab04('0x18')](_0x5e3471)[_0xab04('0x19')](_0x233a8d);}};}function respondWithFilteredResult(_0x1fb034,_0x2cff48){return function(_0x523c51){if(_0x523c51){var _0x3371ed=typeof _0x2cff48[_0xab04('0x1a')]===_0xab04('0x1b')&&typeof _0x2cff48[_0xab04('0x1c')]===_0xab04('0x1b');var _0x5d10f7=_0x523c51['count'];var _0x371c30=_0x3371ed?0x0:_0x2cff48[_0xab04('0x1a')];var _0x2c0b39=_0x3371ed?_0x523c51['count']:_0x2cff48['offset']+_0x2cff48[_0xab04('0x1c')];var _0x287011;if(_0x2c0b39>=_0x5d10f7){_0x2c0b39=_0x5d10f7;_0x287011=0xc8;}else{_0x287011=0xce;}_0x1fb034[_0xab04('0x18')](_0x287011);return _0x1fb034['set'](_0xab04('0x1d'),_0x371c30+'-'+_0x2c0b39+'/'+_0x5d10f7)['json'](_0x523c51);}return null;};}function patchUpdates(_0x395c6b){return function(_0x2ac32c){try{jsonpatch['apply'](_0x2ac32c,_0x395c6b,!![]);}catch(_0x4808ba){return BPromise[_0xab04('0x1e')](_0x4808ba);}return _0x2ac32c[_0xab04('0x1f')]();};}function saveUpdates(_0x5a204c,_0x3f0d72){return function(_0x19d9cb){if(_0x19d9cb){return _0x19d9cb[_0xab04('0x20')](_0x5a204c)[_0xab04('0x21')](function(_0x3667fd){return _0x3667fd;});}return null;};}function removeEntity(_0x4c7a19,_0x19fcab){return function(_0x4df287){if(_0x4df287){return _0x4df287[_0xab04('0x22')]()[_0xab04('0x21')](function(){var _0x561525=_0x4df287[_0xab04('0x23')]({'plain':!![]});var _0x49b9bf='ChanSpies';return db['UserProfileResource'][_0xab04('0x22')]({'where':{'type':_0x49b9bf,'resourceId':_0x561525['id']}})[_0xab04('0x21')](function(){return _0x4df287;});})[_0xab04('0x21')](function(){_0x4c7a19[_0xab04('0x18')](0xcc)[_0xab04('0x17')]();});}};}function handleEntityNotFound(_0x4a5124,_0x59546a){return function(_0x19f651){if(!_0x19f651){_0x4a5124['sendStatus'](0x194);}return _0x19f651;};}function handleError(_0xb8e7b,_0xdf0b96){_0xdf0b96=_0xdf0b96||0x1f4;return function(_0x15cae9){logger[_0xab04('0x24')](_0x15cae9[_0xab04('0x25')]);if(_0x15cae9[_0xab04('0x26')]){delete _0x15cae9['name'];}_0xb8e7b[_0xab04('0x18')](_0xdf0b96)[_0xab04('0x27')](_0x15cae9);};}exports['index']=function(_0x33ce1e,_0x1028c7){var _0x15e080={},_0x2b2b33={},_0x34f933={'count':0x0,'rows':[]};var _0x18cc80=_['map'](db[_0xab04('0x28')]['rawAttributes'],function(_0x1243f0){return{'name':_0x1243f0[_0xab04('0x29')],'type':_0x1243f0[_0xab04('0x2a')][_0xab04('0x2b')]};});_0x2b2b33['model']=_[_0xab04('0x2c')](_0x18cc80,'name');_0x2b2b33[_0xab04('0x2d')]=_[_0xab04('0x2e')](_0x33ce1e[_0xab04('0x2d')]);_0x2b2b33[_0xab04('0x2f')]=_[_0xab04('0x30')](_0x2b2b33[_0xab04('0x31')],_0x2b2b33[_0xab04('0x2d')]);_0x15e080['attributes']=_['intersection'](_0x2b2b33[_0xab04('0x31')],qs[_0xab04('0x32')](_0x33ce1e[_0xab04('0x2d')]['fields']));_0x15e080[_0xab04('0x33')]=_0x15e080[_0xab04('0x33')]['length']?_0x15e080[_0xab04('0x33')]:_0x2b2b33[_0xab04('0x31')];if(!_0x33ce1e[_0xab04('0x2d')][_0xab04('0x34')](_0xab04('0x35'))){_0x15e080['limit']=qs[_0xab04('0x1c')](_0x33ce1e['query']['limit']);_0x15e080[_0xab04('0x1a')]=qs[_0xab04('0x1a')](_0x33ce1e[_0xab04('0x2d')][_0xab04('0x1a')]);}_0x15e080['order']=qs[_0xab04('0x36')](_0x33ce1e[_0xab04('0x2d')]['sort']);_0x15e080[_0xab04('0x37')]=qs[_0xab04('0x2f')](_['pick'](_0x33ce1e[_0xab04('0x2d')],_0x2b2b33[_0xab04('0x2f')]),_0x18cc80);if(_0x33ce1e[_0xab04('0x2d')]['filter']){_0x15e080[_0xab04('0x37')]=_['merge'](_0x15e080[_0xab04('0x37')],{'$or':_[_0xab04('0x2c')](_0x18cc80,function(_0x2f43fb){if(_0x2f43fb[_0xab04('0x2a')]!==_0xab04('0x38')){var _0x4df5df={};_0x4df5df[_0x2f43fb[_0xab04('0x26')]]={'$like':'%'+_0x33ce1e['query'][_0xab04('0x39')]+'%'};return _0x4df5df;}})});}_0x15e080=_[_0xab04('0x3a')]({},_0x15e080,_0x33ce1e[_0xab04('0x3b')]);var _0x1b2a8e={'where':_0x15e080['where']};return db[_0xab04('0x28')][_0xab04('0x3c')](_0x1b2a8e)[_0xab04('0x21')](function(_0x5e915d){_0x34f933[_0xab04('0x3c')]=_0x5e915d;if(_0x33ce1e[_0xab04('0x2d')][_0xab04('0x3d')]){_0x15e080[_0xab04('0x3e')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x15e080);})['then'](function(_0xa72dd2){_0x34f933[_0xab04('0x3f')]=_0xa72dd2;return _0x34f933;})[_0xab04('0x21')](respondWithFilteredResult(_0x1028c7,_0x15e080))[_0xab04('0x40')](handleError(_0x1028c7,null));};exports[_0xab04('0x41')]=function(_0x20e779,_0x32f3ba){var _0x5171ee={'raw':![],'where':{'id':_0x20e779[_0xab04('0x42')]['id']}},_0x1aad7c={};_0x1aad7c[_0xab04('0x31')]=_['keys'](db[_0xab04('0x28')]['rawAttributes']);_0x1aad7c[_0xab04('0x2d')]=_['keys'](_0x20e779[_0xab04('0x2d')]);_0x1aad7c[_0xab04('0x2f')]=_[_0xab04('0x30')](_0x1aad7c[_0xab04('0x31')],_0x1aad7c[_0xab04('0x2d')]);_0x5171ee[_0xab04('0x33')]=_['intersection'](_0x1aad7c[_0xab04('0x31')],qs[_0xab04('0x32')](_0x20e779[_0xab04('0x2d')][_0xab04('0x32')]));_0x5171ee[_0xab04('0x33')]=_0x5171ee['attributes'][_0xab04('0x43')]?_0x5171ee[_0xab04('0x33')]:_0x1aad7c[_0xab04('0x31')];if(_0x20e779[_0xab04('0x2d')][_0xab04('0x3d')]){_0x5171ee[_0xab04('0x3e')]=[{'all':!![]}];}_0x5171ee=_[_0xab04('0x3a')]({},_0x5171ee,_0x20e779[_0xab04('0x3b')]);return db['VoiceChanSpy']['find'](_0x5171ee)['then'](handleEntityNotFound(_0x32f3ba,null))['then'](respondWithResult(_0x32f3ba,null))[_0xab04('0x40')](handleError(_0x32f3ba,null));};exports['create']=function(_0x51907d,_0x154c60){return db[_0xab04('0x28')]['create'](_0x51907d['body'],{})[_0xab04('0x21')](function(_0x3ea473){var _0x1080e2=_0x51907d[_0xab04('0x44')][_0xab04('0x23')]({'plain':!![]});if(!_0x1080e2)throw new Error(_0xab04('0x45'));if(_0x1080e2['role']===_0xab04('0x44')){var _0x3c33ef=_0x3ea473[_0xab04('0x23')]({'plain':!![]});var _0x2f18f0='ChanSpies';return db[_0xab04('0x46')][_0xab04('0x47')]({'where':{'name':_0x2f18f0,'userProfileId':_0x1080e2[_0xab04('0x48')]},'raw':!![]})[_0xab04('0x21')](function(_0x5d6340){if(_0x5d6340&&_0x5d6340[_0xab04('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x3c33ef[_0xab04('0x26')],'resourceId':_0x3c33ef['id'],'type':_0x5d6340[_0xab04('0x26')],'sectionId':_0x5d6340['id']},{})[_0xab04('0x21')](function(){return _0x3ea473;});}else{return _0x3ea473;}})[_0xab04('0x40')](function(_0x1aa5a0){logger[_0xab04('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1aa5a0);throw _0x1aa5a0;});}return _0x3ea473;})[_0xab04('0x21')](respondWithResult(_0x154c60,0xc9))['catch'](handleError(_0x154c60,null));};exports['update']=function(_0x4b84a1,_0x4217f6){if(_0x4b84a1[_0xab04('0x4a')]['id']){delete _0x4b84a1[_0xab04('0x4a')]['id'];}return db[_0xab04('0x28')][_0xab04('0x47')]({'where':{'id':_0x4b84a1[_0xab04('0x42')]['id']}})[_0xab04('0x21')](handleEntityNotFound(_0x4217f6,null))['then'](saveUpdates(_0x4b84a1[_0xab04('0x4a')],null))[_0xab04('0x21')](respondWithResult(_0x4217f6,null))['catch'](handleError(_0x4217f6,null));};exports[_0xab04('0x22')]=function(_0xd60a99,_0x76a90c){return db[_0xab04('0x28')]['find']({'where':{'id':_0xd60a99[_0xab04('0x42')]['id']}})['then'](handleEntityNotFound(_0x76a90c,null))['then'](removeEntity(_0x76a90c,null))['catch'](handleError(_0x76a90c,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 6cff96c..66b4001 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 _0x0e75=['name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','%s%s','system','push','Set','record','merge','format','recordingFormat','Authenticate','password','SIP/%s,%s'];(function(_0x4bff15,_0x7a3d20){var _0x1dc76d=function(_0x1602ee){while(--_0x1602ee){_0x4bff15['push'](_0x4bff15['shift']());}};_0x1dc76d(++_0x7a3d20);}(_0x0e75,0x19e));var _0x50e7=function(_0x45bc0b,_0x347d29){_0x45bc0b=_0x45bc0b-0x0;var _0x5f39c4=_0x0e75[_0x45bc0b];return _0x5f39c4;};'use strict';var _=require(_0x50e7('0x0'));var util=require(_0x50e7('0x1'));var BPromise=require(_0x50e7('0x2'));var attributes=require(_0x50e7('0x3'));var getUserApplications=function(_0x1f8666,_0x15ab14,_0x32c4dc){var _0xe9f7af=0x1;var _0x40e9b9=[];var _0x28d40a={'context':_0x15ab14['context']||'from-sip','exten':util['format'](_0x50e7('0x4'),_0x1f8666['prefix'],_0x32c4dc),'type':_0x50e7('0x5'),'isApp':![],'ChanSpyId':_0x1f8666['id'],'UserId':_0x15ab14['id']};_0x40e9b9[_0x50e7('0x6')](_['merge']({'app':_0x50e7('0x7'),'appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0xe9f7af++},_0x28d40a));if(_0x1f8666[_0x50e7('0x8')]){_0x40e9b9[_0x50e7('0x6')](_[_0x50e7('0x9')]({'app':'MixMonitor','appdata':util[_0x50e7('0xa')]('${UNIQUEID}.%s,a',_0x1f8666[_0x50e7('0xb')]),'priority':_0xe9f7af++},_0x28d40a));}if(_0x1f8666['auth']){_0x40e9b9[_0x50e7('0x6')](_['merge']({'app':_0x50e7('0xc'),'appdata':_0x1f8666[_0x50e7('0xd')],'priority':_0xe9f7af++},_0x28d40a));}_0x40e9b9['push'](_['merge']({'app':'ChanSpy','appdata':util[_0x50e7('0xa')](_0x50e7('0xe'),_0x15ab14[_0x50e7('0xf')],_0x1f8666[_0x50e7('0x10')]?_0x1f8666[_0x50e7('0x10')]['join'](''):''),'priority':_0xe9f7af++},_0x28d40a));if(_0x1f8666[_0x50e7('0x8')]){_0x40e9b9[_0x50e7('0x6')](_[_0x50e7('0x9')]({'app':_0x50e7('0x11'),'priority':_0xe9f7af++},_0x28d40a));}return _0x40e9b9;};var getChanSpyApplications=function(_0x1bf179,_0x23f90a){var _0x45c1cd=[];for(var _0x56a838=0x0,_0x50f585=0x1;_0x56a838<_0x23f90a[_0x50e7('0x12')];_0x56a838++,_0x50f585=0x1){_0x45c1cd=_0x45c1cd[_0x50e7('0x13')](getUserApplications(_0x1bf179,_0x23f90a[_0x56a838],_0x23f90a[_0x56a838][_0x50e7('0x14')]));if(_0x23f90a[_0x56a838]['internal']!=_0x23f90a[_0x56a838]['name']){_0x45c1cd=_0x45c1cd[_0x50e7('0x13')](getUserApplications(_0x1bf179,_0x23f90a[_0x56a838],_0x23f90a[_0x56a838][_0x50e7('0xf')]));}}return _0x45c1cd;};var getChanSpyPromise=function(_0x42cdd4,_0x33523c){return new BPromise(function(_0x4c8cc8,_0xe27595){return _0x42cdd4[_0x50e7('0x15')][_0x50e7('0x16')]({'attributes':['id','name',_0x50e7('0x14')],'where':{'role':_0x50e7('0x17'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5b6eae){if(_0x5b6eae){return _0x4c8cc8(getChanSpyApplications(_0x33523c,_0x5b6eae));}return _0x4c8cc8([]);})[_0x50e7('0x18')](function(_0x40a874){_0xe27595(_0x40a874);});});};module['exports']=function(_0x316601,_0x539b30){var _0xf65c48=_0x316601[_0x50e7('0x19')];return _0x316601[_0x50e7('0x1a')](_0x50e7('0x1b'),attributes,{'tableName':_0x50e7('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e98bf,_0x23f58d,_0x4aa74c){return getChanSpyPromise(_0xf65c48,_0x4e98bf)[_0x50e7('0x1d')](function(_0x795ebd){if(_0x795ebd&&_0x795ebd[_0x50e7('0x12')]){return _0xf65c48[_0x50e7('0x1e')][_0x50e7('0x1f')](_0x795ebd);}})[_0x50e7('0x1d')](function(){_0x4aa74c();})[_0x50e7('0x18')](function(_0x345b3a){_0x4aa74c(_0x345b3a);});},'afterUpdate':function(_0x4438ae,_0x35eae2,_0x4a70c0){return _0xf65c48[_0x50e7('0x1e')][_0x50e7('0x20')]({'where':{'ChanSpyId':_0x4438ae['id']}})[_0x50e7('0x1d')](function(){return getChanSpyPromise(_0xf65c48,_0x4438ae);})['then'](function(_0x4dcc01){if(_0x4dcc01&&_0x4dcc01[_0x50e7('0x12')]){return _0xf65c48['VoiceExtension'][_0x50e7('0x1f')](_0x4dcc01);}})[_0x50e7('0x1d')](function(){_0x4a70c0();})['catch'](function(_0x565efc){_0x4a70c0(_0x565efc);});},'afterDestroy':function(_0x26c75a,_0x577412,_0x5077a5){return _0xf65c48[_0x50e7('0x1e')][_0x50e7('0x20')]({'where':{'ChanSpyId':_0x26c75a['id']}})['then'](function(){_0x5077a5();})[_0x50e7('0x18')](function(_0x54cdac){_0x5077a5(_0x54cdac);});}}});}; \ No newline at end of file +var _0xf803=['context','from-sip','format','prefix','system','push','merge','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','StopMixMonitor','concat','name','internal','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','destroy','util','./voiceChanSpy.attributes'];(function(_0x4e1771,_0x44394a){var _0x5a15a5=function(_0x3d9331){while(--_0x3d9331){_0x4e1771['push'](_0x4e1771['shift']());}};_0x5a15a5(++_0x44394a);}(_0xf803,0x130));var _0x3f80=function(_0xc9a3e2,_0x431850){_0xc9a3e2=_0xc9a3e2-0x0;var _0x472d3c=_0xf803[_0xc9a3e2];return _0x472d3c;};'use strict';var _=require('lodash');var util=require(_0x3f80('0x0'));var BPromise=require('bluebird');var attributes=require(_0x3f80('0x1'));var getUserApplications=function(_0x22acc5,_0x33ca32,_0x3ae2a0){var _0x45311c=0x1;var _0x504905=[];var _0x5402da={'context':_0x33ca32[_0x3f80('0x2')]||_0x3f80('0x3'),'exten':util[_0x3f80('0x4')]('%s%s',_0x22acc5[_0x3f80('0x5')],_0x3ae2a0),'type':_0x3f80('0x6'),'isApp':![],'ChanSpyId':_0x22acc5['id'],'UserId':_0x33ca32['id']};_0x504905[_0x3f80('0x7')](_[_0x3f80('0x8')]({'app':'Set','appdata':util[_0x3f80('0x4')](_0x3f80('0x9'),'chanspy'),'priority':_0x45311c++},_0x5402da));if(_0x22acc5[_0x3f80('0xa')]){_0x504905[_0x3f80('0x7')](_[_0x3f80('0x8')]({'app':'MixMonitor','appdata':util[_0x3f80('0x4')](_0x3f80('0xb'),_0x22acc5[_0x3f80('0xc')]),'priority':_0x45311c++},_0x5402da));}if(_0x22acc5[_0x3f80('0xd')]){_0x504905[_0x3f80('0x7')](_[_0x3f80('0x8')]({'app':_0x3f80('0xe'),'appdata':_0x22acc5[_0x3f80('0xf')],'priority':_0x45311c++},_0x5402da));}_0x504905[_0x3f80('0x7')](_[_0x3f80('0x8')]({'app':_0x3f80('0x10'),'appdata':util[_0x3f80('0x4')]('SIP/%s,%s',_0x33ca32['name'],_0x22acc5[_0x3f80('0x11')]?_0x22acc5[_0x3f80('0x11')]['join'](''):''),'priority':_0x45311c++},_0x5402da));if(_0x22acc5[_0x3f80('0xa')]){_0x504905[_0x3f80('0x7')](_[_0x3f80('0x8')]({'app':_0x3f80('0x12'),'priority':_0x45311c++},_0x5402da));}return _0x504905;};var getChanSpyApplications=function(_0x366b6c,_0x2d48dd){var _0x15e751=[];for(var _0x1c4e8d=0x0,_0x436b32=0x1;_0x1c4e8d<_0x2d48dd['length'];_0x1c4e8d++,_0x436b32=0x1){_0x15e751=_0x15e751[_0x3f80('0x13')](getUserApplications(_0x366b6c,_0x2d48dd[_0x1c4e8d],_0x2d48dd[_0x1c4e8d]['internal']));if(_0x2d48dd[_0x1c4e8d]['internal']!=_0x2d48dd[_0x1c4e8d][_0x3f80('0x14')]){_0x15e751=_0x15e751[_0x3f80('0x13')](getUserApplications(_0x366b6c,_0x2d48dd[_0x1c4e8d],_0x2d48dd[_0x1c4e8d][_0x3f80('0x14')]));}}return _0x15e751;};var getChanSpyPromise=function(_0x20eb77,_0x394818){return new BPromise(function(_0xb9e23b,_0x322132){return _0x20eb77['User']['findAll']({'attributes':['id',_0x3f80('0x14'),_0x3f80('0x15')],'where':{'role':_0x3f80('0x16'),'chanspy':!![]},'raw':!![]})[_0x3f80('0x17')](function(_0x55b402){if(_0x55b402){return _0xb9e23b(getChanSpyApplications(_0x394818,_0x55b402));}return _0xb9e23b([]);})[_0x3f80('0x18')](function(_0x3601b6){_0x322132(_0x3601b6);});});};module[_0x3f80('0x19')]=function(_0x2219ec,_0xb55792){var _0x4cfd90=_0x2219ec[_0x3f80('0x1a')];return _0x2219ec[_0x3f80('0x1b')](_0x3f80('0x1c'),attributes,{'tableName':_0x3f80('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2213d7,_0x2dcd99,_0x406583){return getChanSpyPromise(_0x4cfd90,_0x2213d7)[_0x3f80('0x17')](function(_0x3b1a17){if(_0x3b1a17&&_0x3b1a17[_0x3f80('0x1e')]){return _0x4cfd90[_0x3f80('0x1f')][_0x3f80('0x20')](_0x3b1a17);}})['then'](function(){_0x406583();})[_0x3f80('0x18')](function(_0x3c24e9){_0x406583(_0x3c24e9);});},'afterUpdate':function(_0x55dfe0,_0x2643f1,_0x329f85){return _0x4cfd90[_0x3f80('0x1f')][_0x3f80('0x21')]({'where':{'ChanSpyId':_0x55dfe0['id']}})['then'](function(){return getChanSpyPromise(_0x4cfd90,_0x55dfe0);})[_0x3f80('0x17')](function(_0x29daf2){if(_0x29daf2&&_0x29daf2[_0x3f80('0x1e')]){return _0x4cfd90[_0x3f80('0x1f')][_0x3f80('0x20')](_0x29daf2);}})['then'](function(){_0x329f85();})[_0x3f80('0x18')](function(_0x52dfec){_0x329f85(_0x52dfec);});},'afterDestroy':function(_0x5c9c27,_0x48a60c,_0x224587){return _0x4cfd90[_0x3f80('0x1f')][_0x3f80('0x21')]({'where':{'ChanSpyId':_0x5c9c27['id']}})['then'](function(){_0x224587();})[_0x3f80('0x18')](function(_0x578e40){_0x224587(_0x578e40);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4c30f93..ef6d7d8 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 _0x2e54=['rpc','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0x2e54,0x1dd));var _0x42e5=function(_0x145be0,_0x3a2e30){_0x145be0=_0x145be0-0x0;var _0x43c15b=_0x2e54[_0x145be0];return _0x43c15b;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceChanSpy,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4db7cf,_0x2621ab){var _0x5b037a=function(_0x50551e){while(--_0x50551e){_0x4db7cf['push'](_0x4db7cf['shift']());}};_0x5b037a(++_0x2621ab);}(_0xb43b,0x1b2));var _0xbb43=function(_0x569453,_0x40536a){_0x569453=_0x569453-0x0;var _0x4e7a12=_0xb43b[_0x569453];return _0x4e7a12;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 982ebc4..21bde64 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 _0xe292=['../../config/environment','get','index','/:id','show','isAuthenticated','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x34def0,_0x554b5b){var _0x2be1c9=function(_0x45b895){while(--_0x45b895){_0x34def0['push'](_0x34def0['shift']());}};_0x2be1c9(++_0x554b5b);}(_0xe292,0x6f));var _0x2e29=function(_0x477bc8,_0x5cf040){_0x477bc8=_0x477bc8-0x0;var _0x59b5cb=_0xe292[_0x477bc8];return _0x59b5cb;};'use strict';var multer=require(_0x2e29('0x0'));var util=require(_0x2e29('0x1'));var path=require(_0x2e29('0x2'));var timeout=require(_0x2e29('0x3'));var express=require(_0x2e29('0x4'));var router=express['Router']();var fs_extra=require(_0x2e29('0x5'));var auth=require(_0x2e29('0x6'));var interaction=require(_0x2e29('0x7'));var config=require(_0x2e29('0x8'));var controller=require('./voiceContext.controller');router[_0x2e29('0x9')]('/',auth['isAuthenticated'](),controller[_0x2e29('0xa')]);router[_0x2e29('0x9')](_0x2e29('0xb'),auth['isAuthenticated'](),controller[_0x2e29('0xc')]);router['post']('/',auth[_0x2e29('0xd')](),controller['create']);router[_0x2e29('0xe')](_0x2e29('0xb'),auth[_0x2e29('0xd')](),controller[_0x2e29('0xf')]);router['delete'](_0x2e29('0xb'),auth[_0x2e29('0xd')](),controller['destroy']);module[_0x2e29('0x10')]=router; \ No newline at end of file +var _0x3a87=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','delete','destroy'];(function(_0x1182d2,_0x1832c1){var _0x30ce56=function(_0x25bba1){while(--_0x25bba1){_0x1182d2['push'](_0x1182d2['shift']());}};_0x30ce56(++_0x1832c1);}(_0x3a87,0x78));var _0x73a8=function(_0xf67f45,_0x36e087){_0xf67f45=_0xf67f45-0x0;var _0xd9ab5=_0x3a87[_0xf67f45];return _0xd9ab5;};'use strict';var multer=require(_0x73a8('0x0'));var util=require(_0x73a8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x73a8('0x2'));var router=express[_0x73a8('0x3')]();var fs_extra=require(_0x73a8('0x4'));var auth=require(_0x73a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73a8('0x6'));var controller=require('./voiceContext.controller');router[_0x73a8('0x7')]('/',auth[_0x73a8('0x8')](),controller[_0x73a8('0x9')]);router['get'](_0x73a8('0xa'),auth[_0x73a8('0x8')](),controller[_0x73a8('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x73a8('0xc')]);router['put'](_0x73a8('0xa'),auth[_0x73a8('0x8')](),controller[_0x73a8('0xd')]);router[_0x73a8('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x73a8('0xf')]);module[_0x73a8('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index c0f5468..943bf5b 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 _0xcf77=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x1eda18,_0x100bbd){var _0x45f39a=function(_0x5523b6){while(--_0x5523b6){_0x1eda18['push'](_0x1eda18['shift']());}};_0x45f39a(++_0x100bbd);}(_0xcf77,0x110));var _0x7cf7=function(_0xdeed0a,_0x44fca6){_0xdeed0a=_0xdeed0a-0x0;var _0x3d27fd=_0xcf77[_0xdeed0a];return _0x3d27fd;};'use strict';var Sequelize=require(_0x7cf7('0x0'));module[_0x7cf7('0x1')]={'name':{'type':Sequelize[_0x7cf7('0x2')],'unique':_0x7cf7('0x3')},'description':{'type':Sequelize[_0x7cf7('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7cf7('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7218=['exports','name','BOOLEAN','sequelize'];(function(_0x38e01e,_0x5800b8){var _0x2822d4=function(_0x5f2c57){while(--_0x5f2c57){_0x38e01e['push'](_0x38e01e['shift']());}};_0x2822d4(++_0x5800b8);}(_0x7218,0x1e3));var _0x8721=function(_0x366bc3,_0x732556){_0x366bc3=_0x366bc3-0x0;var _0x1683fc=_0x7218[_0x366bc3];return _0x1683fc;};'use strict';var Sequelize=require(_0x8721('0x0'));module[_0x8721('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8721('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8721('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index ae9d055..c6affb5 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 _0xfd09=['../../config/license/util','../../mysqldb','client','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','end','status','offset','undefined','limit','count','set','json','reject','save','get','Contexts','UserProfileResource','destroy','sendStatus','name','send','index','map','VoiceContext','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','show','params','create','body','readFileSync','root','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','server/files/templates/context.ejs','utf8','writeFileSync','join','render','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x4bd439,_0x17e990){var _0x260697=function(_0x46bceb){while(--_0x46bceb){_0x4bd439['push'](_0x4bd439['shift']());}};_0x260697(++_0x17e990);}(_0xfd09,0x117));var _0x9fd0=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xfd09[_0x432fca];return _0x3adba4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fd0('0x0'));var zipdir=require(_0x9fd0('0x1'));var jsonpatch=require(_0x9fd0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9fd0('0x3'));var path=require(_0x9fd0('0x4'));var sox=require(_0x9fd0('0x5'));var csv=require(_0x9fd0('0x6'));var ejs=require(_0x9fd0('0x7'));var fs=require('fs');var fs_extra=require(_0x9fd0('0x8'));var _=require('lodash');var squel=require(_0x9fd0('0x9'));var crypto=require(_0x9fd0('0xa'));var jsforce=require(_0x9fd0('0xb'));var deskjs=require(_0x9fd0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9fd0('0xd'));var Papa=require(_0x9fd0('0xe'));var Redis=require(_0x9fd0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9fd0('0x10'));var hardwareService=require(_0x9fd0('0x11'));var logger=require(_0x9fd0('0x12'))(_0x9fd0('0x13'));var utils=require('../../config/utils');var config=require(_0x9fd0('0x14'));var licenseUtil=require(_0x9fd0('0x15'));var db=require(_0x9fd0('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9fd0('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31d013,_0x2b828b,_0x5b65e0,_0x2862c4){return new BPromise(function(_0x430778,_0x4f381d){var _0x583528=_0x2862c4||client;return _0x583528[_0x9fd0('0x18')](_0x31d013,_0x5b65e0)[_0x9fd0('0x19')](function(_0x59845c){logger['info'](_0x9fd0('0x1a'),_0x2b828b,_0x9fd0('0x1b'));logger[_0x9fd0('0x1c')](_0x9fd0('0x1d'),_0x2b828b,_0x9fd0('0x1b'),JSON['stringify'](_0x59845c));if(_0x59845c[_0x9fd0('0x1e')]){if(_0x59845c[_0x9fd0('0x1e')][_0x9fd0('0x1f')]===0x1f4){logger[_0x9fd0('0x1e')](_0x9fd0('0x1a'),_0x2b828b,_0x59845c[_0x9fd0('0x1e')][_0x9fd0('0x20')]);return _0x4f381d(_0x59845c[_0x9fd0('0x1e')][_0x9fd0('0x20')]);}logger['error'](_0x9fd0('0x1a'),_0x2b828b,_0x59845c[_0x9fd0('0x1e')][_0x9fd0('0x20')]);return _0x430778(_0x59845c['error'][_0x9fd0('0x20')]);}else{logger[_0x9fd0('0x21')](_0x9fd0('0x1a'),_0x2b828b,_0x9fd0('0x1b'));_0x430778(_0x59845c[_0x9fd0('0x22')][_0x9fd0('0x20')]);}})[_0x9fd0('0x23')](function(_0x3573ee){logger[_0x9fd0('0x1e')](_0x9fd0('0x1a'),_0x2b828b,_0x3573ee);_0x4f381d(_0x3573ee);});});}function respondWithStatusCode(_0x3b440a,_0x42c693){_0x42c693=_0x42c693||0xcc;return function(_0x404163){if(_0x404163){return _0x3b440a['sendStatus'](_0x42c693);}return _0x3b440a['status'](_0x42c693)[_0x9fd0('0x24')]();};}function respondWithResult(_0x5824dd,_0x5b06e0){_0x5b06e0=_0x5b06e0||0xc8;return function(_0x168987){if(_0x168987){return _0x5824dd[_0x9fd0('0x25')](_0x5b06e0)['json'](_0x168987);}};}function respondWithFilteredResult(_0xceed4,_0x30500d){return function(_0x237e13){if(_0x237e13){var _0x55ae46=typeof _0x30500d[_0x9fd0('0x26')]===_0x9fd0('0x27')&&typeof _0x30500d[_0x9fd0('0x28')]===_0x9fd0('0x27');var _0x535930=_0x237e13['count'];var _0x599bc4=_0x55ae46?0x0:_0x30500d[_0x9fd0('0x26')];var _0x1e32fb=_0x55ae46?_0x237e13[_0x9fd0('0x29')]:_0x30500d[_0x9fd0('0x26')]+_0x30500d[_0x9fd0('0x28')];var _0x27044f;if(_0x1e32fb>=_0x535930){_0x1e32fb=_0x535930;_0x27044f=0xc8;}else{_0x27044f=0xce;}_0xceed4[_0x9fd0('0x25')](_0x27044f);return _0xceed4[_0x9fd0('0x2a')]('Content-Range',_0x599bc4+'-'+_0x1e32fb+'/'+_0x535930)[_0x9fd0('0x2b')](_0x237e13);}return null;};}function patchUpdates(_0x51a650){return function(_0x1e97e5){try{jsonpatch['apply'](_0x1e97e5,_0x51a650,!![]);}catch(_0x239bcf){return BPromise[_0x9fd0('0x2c')](_0x239bcf);}return _0x1e97e5[_0x9fd0('0x2d')]();};}function saveUpdates(_0x44c17d,_0x3d155d){return function(_0x562b1b){if(_0x562b1b){return _0x562b1b['update'](_0x44c17d)[_0x9fd0('0x19')](function(_0x501f3d){return _0x501f3d;});}return null;};}function removeEntity(_0x3f835a,_0x5caee6){return function(_0x30b00d){if(_0x30b00d){return _0x30b00d['destroy']()[_0x9fd0('0x19')](function(){var _0x5ea63c=_0x30b00d[_0x9fd0('0x2e')]({'plain':!![]});var _0x3bce3f=_0x9fd0('0x2f');return db[_0x9fd0('0x30')][_0x9fd0('0x31')]({'where':{'type':_0x3bce3f,'resourceId':_0x5ea63c['id']}})['then'](function(){return _0x30b00d;});})['then'](function(){_0x3f835a[_0x9fd0('0x25')](0xcc)[_0x9fd0('0x24')]();});}};}function handleEntityNotFound(_0x91b3a1,_0x18e53c){return function(_0x393654){if(!_0x393654){_0x91b3a1[_0x9fd0('0x32')](0x194);}return _0x393654;};}function handleError(_0x31857b,_0x523492){_0x523492=_0x523492||0x1f4;return function(_0x263cae){logger[_0x9fd0('0x1e')](_0x263cae['stack']);if(_0x263cae[_0x9fd0('0x33')]){delete _0x263cae['name'];}_0x31857b[_0x9fd0('0x25')](_0x523492)[_0x9fd0('0x34')](_0x263cae);};}exports[_0x9fd0('0x35')]=function(_0x2063c4,_0x42eb69){var _0x46ef44={},_0x2e90d4={},_0x80c3f5={'count':0x0,'rows':[]};var _0x211ab2=_[_0x9fd0('0x36')](db[_0x9fd0('0x37')][_0x9fd0('0x38')],function(_0x188f6b){return{'name':_0x188f6b['fieldName'],'type':_0x188f6b[_0x9fd0('0x39')][_0x9fd0('0x3a')]};});_0x2e90d4[_0x9fd0('0x3b')]=_['map'](_0x211ab2,_0x9fd0('0x33'));_0x2e90d4['query']=_[_0x9fd0('0x3c')](_0x2063c4[_0x9fd0('0x3d')]);_0x2e90d4['filters']=_[_0x9fd0('0x3e')](_0x2e90d4[_0x9fd0('0x3b')],_0x2e90d4[_0x9fd0('0x3d')]);_0x46ef44['attributes']=_['intersection'](_0x2e90d4[_0x9fd0('0x3b')],qs[_0x9fd0('0x3f')](_0x2063c4[_0x9fd0('0x3d')]['fields']));_0x46ef44[_0x9fd0('0x40')]=_0x46ef44[_0x9fd0('0x40')][_0x9fd0('0x41')]?_0x46ef44['attributes']:_0x2e90d4[_0x9fd0('0x3b')];if(!_0x2063c4[_0x9fd0('0x3d')]['hasOwnProperty'](_0x9fd0('0x42'))){_0x46ef44[_0x9fd0('0x28')]=qs[_0x9fd0('0x28')](_0x2063c4[_0x9fd0('0x3d')][_0x9fd0('0x28')]);_0x46ef44[_0x9fd0('0x26')]=qs[_0x9fd0('0x26')](_0x2063c4[_0x9fd0('0x3d')]['offset']);}_0x46ef44['order']=qs[_0x9fd0('0x43')](_0x2063c4[_0x9fd0('0x3d')][_0x9fd0('0x43')]);_0x46ef44['where']=qs['filters'](_[_0x9fd0('0x44')](_0x2063c4[_0x9fd0('0x3d')],_0x2e90d4[_0x9fd0('0x45')]),_0x211ab2);if(_0x2063c4[_0x9fd0('0x3d')][_0x9fd0('0x46')]){_0x46ef44[_0x9fd0('0x47')]=_[_0x9fd0('0x48')](_0x46ef44[_0x9fd0('0x47')],{'$or':_[_0x9fd0('0x36')](_0x211ab2,function(_0x573d49){if(_0x573d49[_0x9fd0('0x39')]!=='VIRTUAL'){var _0x259d50={};_0x259d50[_0x573d49[_0x9fd0('0x33')]]={'$like':'%'+_0x2063c4['query'][_0x9fd0('0x46')]+'%'};return _0x259d50;}})});}_0x46ef44=_[_0x9fd0('0x48')]({},_0x46ef44,_0x2063c4[_0x9fd0('0x49')]);var _0x1f9e27={'where':_0x46ef44[_0x9fd0('0x47')]};return db['VoiceContext'][_0x9fd0('0x29')](_0x1f9e27)[_0x9fd0('0x19')](function(_0x3309c7){_0x80c3f5['count']=_0x3309c7;if(_0x2063c4[_0x9fd0('0x3d')][_0x9fd0('0x4a')]){_0x46ef44[_0x9fd0('0x4b')]=[{'all':!![]}];}return db[_0x9fd0('0x37')][_0x9fd0('0x4c')](_0x46ef44);})[_0x9fd0('0x19')](function(_0x5506c2){_0x80c3f5['rows']=_0x5506c2;return _0x80c3f5;})['then'](respondWithFilteredResult(_0x42eb69,_0x46ef44))[_0x9fd0('0x23')](handleError(_0x42eb69,null));};exports[_0x9fd0('0x4d')]=function(_0x16d3a2,_0xfb0aaa){var _0x1d894e={'raw':![],'where':{'id':_0x16d3a2[_0x9fd0('0x4e')]['id']}},_0x5338f9={};_0x5338f9[_0x9fd0('0x3b')]=_[_0x9fd0('0x3c')](db[_0x9fd0('0x37')][_0x9fd0('0x38')]);_0x5338f9['query']=_[_0x9fd0('0x3c')](_0x16d3a2[_0x9fd0('0x3d')]);_0x5338f9['filters']=_['intersection'](_0x5338f9[_0x9fd0('0x3b')],_0x5338f9[_0x9fd0('0x3d')]);_0x1d894e[_0x9fd0('0x40')]=_['intersection'](_0x5338f9[_0x9fd0('0x3b')],qs[_0x9fd0('0x3f')](_0x16d3a2[_0x9fd0('0x3d')][_0x9fd0('0x3f')]));_0x1d894e[_0x9fd0('0x40')]=_0x1d894e[_0x9fd0('0x40')][_0x9fd0('0x41')]?_0x1d894e[_0x9fd0('0x40')]:_0x5338f9[_0x9fd0('0x3b')];if(_0x16d3a2[_0x9fd0('0x3d')]['includeAll']){_0x1d894e['include']=[{'all':!![]}];}_0x1d894e=_['merge']({},_0x1d894e,_0x16d3a2[_0x9fd0('0x49')]);return db[_0x9fd0('0x37')]['find'](_0x1d894e)['then'](handleEntityNotFound(_0xfb0aaa,null))['then'](respondWithResult(_0xfb0aaa,null))['catch'](handleError(_0xfb0aaa,null));};exports[_0x9fd0('0x4f')]=function(_0xe084a6,_0x154715,_0x3d17ed){var _0x50e58a;return db['VoiceContext'][_0x9fd0('0x4f')](_0xe084a6[_0x9fd0('0x50')],{'raw':!![]})[_0x9fd0('0x19')](function(_0x33e608){_0x50e58a=_0x33e608;return db['VoiceContext'][_0x9fd0('0x4c')]({'raw':!![]});})[_0x9fd0('0x19')](function(_0x4bea77){var _0x8bb4ed=fs[_0x9fd0('0x51')](path['join'](config[_0x9fd0('0x52')],'server/files/templates/context.ejs'),'utf8');var _0x29901b=ejs['render'](_0x8bb4ed,{'contexts':_0x4bea77||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x29901b);})[_0x9fd0('0x19')](function(){return respondWithRpcPromise(_0x9fd0('0x53'),_0x9fd0('0x4f'),{'module':_0x9fd0('0x54')});})[_0x9fd0('0x19')](function(){var _0x1f082c=_0xe084a6[_0x9fd0('0x55')][_0x9fd0('0x2e')]({'plain':!![]});if(!_0x1f082c)throw new Error(_0x9fd0('0x56'));if(_0x1f082c[_0x9fd0('0x57')]==='user'){var _0x502a2e=_0x50e58a['get']({'plain':!![]});return db[_0x9fd0('0x58')][_0x9fd0('0x59')]({'where':{'name':'Contexts','userProfileId':_0x1f082c[_0x9fd0('0x5a')]},'raw':!![]})[_0x9fd0('0x19')](function(_0x297cb3){if(_0x297cb3&&_0x297cb3[_0x9fd0('0x5b')]===0x0){return db[_0x9fd0('0x30')][_0x9fd0('0x4f')]({'name':_0x502a2e['name'],'resourceId':_0x502a2e['id'],'type':_0x297cb3[_0x9fd0('0x33')],'sectionId':_0x297cb3['id']},{})[_0x9fd0('0x19')](function(){return _0x50e58a;});}else{return _0x50e58a;}})['catch'](function(_0x1f13af){logger[_0x9fd0('0x1e')](_0x9fd0('0x5c'),_0x1f13af);throw _0x1f13af;});}return _0x50e58a;})[_0x9fd0('0x19')](respondWithResult(_0x154715,0xc9))[_0x9fd0('0x23')](handleError(_0x154715,null));};exports[_0x9fd0('0x5d')]=function(_0x3b17d1,_0x34172d,_0x53424f){var _0x4681d8;return db['VoiceContext']['find']({'where':{'id':_0x3b17d1['params']['id']}})['then'](handleEntityNotFound(_0x34172d,null))[_0x9fd0('0x19')](saveUpdates(_0x3b17d1[_0x9fd0('0x50')],null))[_0x9fd0('0x19')](function(_0x5fc300){if(_0x5fc300){_0x4681d8=_0x5fc300;return db['VoiceContext'][_0x9fd0('0x4c')]({'raw':!![]});}})[_0x9fd0('0x19')](function(_0x3c876b){var _0x3923d3=fs[_0x9fd0('0x51')](path['join'](config[_0x9fd0('0x52')],_0x9fd0('0x5e')),_0x9fd0('0x5f'));var _0x4618a8=ejs['render'](_0x3923d3,{'contexts':_0x3c876b||[]});fs[_0x9fd0('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4618a8);})[_0x9fd0('0x19')](function(){return respondWithRpcPromise('Reload',_0x9fd0('0x5d'),{'module':_0x9fd0('0x54')});})[_0x9fd0('0x19')](function(){return _0x4681d8;})[_0x9fd0('0x19')](respondWithResult(_0x34172d,null))[_0x9fd0('0x23')](handleError(_0x34172d,null));};exports[_0x9fd0('0x31')]=function(_0x2ee8c5,_0x405c15,_0x2a8c5a){var _0x4a87c3;return db[_0x9fd0('0x37')][_0x9fd0('0x59')]({'where':{'id':_0x2ee8c5[_0x9fd0('0x4e')]['id']}})[_0x9fd0('0x19')](handleEntityNotFound(_0x405c15,null))['then'](removeEntity(_0x405c15,null))[_0x9fd0('0x19')](function(){return db[_0x9fd0('0x37')][_0x9fd0('0x4c')]({'raw':!![]});})['then'](function(_0x5d971a){var _0x55645f=fs['readFileSync'](path[_0x9fd0('0x61')](config[_0x9fd0('0x52')],_0x9fd0('0x5e')),'utf8');var _0x196474=ejs[_0x9fd0('0x62')](_0x55645f,{'contexts':_0x5d971a});fs[_0x9fd0('0x60')](_0x9fd0('0x63'),_0x196474);return respondWithRpcPromise(_0x9fd0('0x53'),_0x9fd0('0x31'),{'module':_0x9fd0('0x54')});})[_0x9fd0('0x23')](handleError(_0x405c15,null));}; \ No newline at end of file +var _0x0d9a=['code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','name','send','index','map','VoiceContext','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','keys','rawAttributes','options','find','create','body','readFileSync','root','server/files/templates/context.ejs','render','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','request-promise','moment','bluebird','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0d9a,0xa8));var _0xa0d9=function(_0x36d6ef,_0x412c74){_0x36d6ef=_0x36d6ef-0x0;var _0x4fbda5=_0x0d9a[_0x36d6ef];return _0x4fbda5;};'use strict';var emlformat=require(_0xa0d9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa0d9('0x1'));var moment=require(_0xa0d9('0x2'));var BPromise=require(_0xa0d9('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0d9('0x4'));var sox=require('sox');var csv=require(_0xa0d9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa0d9('0x6'));var _=require('lodash');var squel=require(_0xa0d9('0x7'));var crypto=require(_0xa0d9('0x8'));var jsforce=require(_0xa0d9('0x9'));var deskjs=require(_0xa0d9('0xa'));var toCsv=require(_0xa0d9('0x5'));var querystring=require(_0xa0d9('0xb'));var Papa=require(_0xa0d9('0xc'));var Redis=require('ioredis');var authService=require(_0xa0d9('0xd'));var qs=require(_0xa0d9('0xe'));var as=require(_0xa0d9('0xf'));var hardwareService=require(_0xa0d9('0x10'));var logger=require(_0xa0d9('0x11'))(_0xa0d9('0x12'));var utils=require('../../config/utils');var config=require(_0xa0d9('0x13'));var licenseUtil=require(_0xa0d9('0x14'));var db=require(_0xa0d9('0x15'))['db'];var jayson=require(_0xa0d9('0x16'));var client=jayson[_0xa0d9('0x17')][_0xa0d9('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3d1420,_0x276165,_0x6bf5fc,_0x5e881b){return new BPromise(function(_0x304a93,_0x2882e8){var _0x19a395=_0x5e881b||client;return _0x19a395['request'](_0x3d1420,_0x6bf5fc)[_0xa0d9('0x19')](function(_0x4a6ae5){logger[_0xa0d9('0x1a')](_0xa0d9('0x1b'),_0x276165,_0xa0d9('0x1c'));logger[_0xa0d9('0x1d')](_0xa0d9('0x1e'),_0x276165,_0xa0d9('0x1c'),JSON['stringify'](_0x4a6ae5));if(_0x4a6ae5[_0xa0d9('0x1f')]){if(_0x4a6ae5['error'][_0xa0d9('0x20')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x276165,_0x4a6ae5[_0xa0d9('0x1f')]['message']);return _0x2882e8(_0x4a6ae5['error']['message']);}logger[_0xa0d9('0x1f')](_0xa0d9('0x1b'),_0x276165,_0x4a6ae5['error'][_0xa0d9('0x21')]);return _0x304a93(_0x4a6ae5['error'][_0xa0d9('0x21')]);}else{logger['info'](_0xa0d9('0x1b'),_0x276165,_0xa0d9('0x1c'));_0x304a93(_0x4a6ae5[_0xa0d9('0x22')][_0xa0d9('0x21')]);}})['catch'](function(_0x54b07f){logger[_0xa0d9('0x1f')](_0xa0d9('0x1b'),_0x276165,_0x54b07f);_0x2882e8(_0x54b07f);});});}function respondWithStatusCode(_0x571bdb,_0x4a3570){_0x4a3570=_0x4a3570||0xcc;return function(_0x19872f){if(_0x19872f){return _0x571bdb[_0xa0d9('0x23')](_0x4a3570);}return _0x571bdb[_0xa0d9('0x24')](_0x4a3570)[_0xa0d9('0x25')]();};}function respondWithResult(_0x19bf0e,_0x92a06b){_0x92a06b=_0x92a06b||0xc8;return function(_0x14f600){if(_0x14f600){return _0x19bf0e['status'](_0x92a06b)[_0xa0d9('0x26')](_0x14f600);}};}function respondWithFilteredResult(_0x4aac83,_0x5007b6){return function(_0x3f8e4a){if(_0x3f8e4a){var _0x6f8f3d=typeof _0x5007b6[_0xa0d9('0x27')]===_0xa0d9('0x28')&&typeof _0x5007b6[_0xa0d9('0x29')]==='undefined';var _0x3acb9d=_0x3f8e4a[_0xa0d9('0x2a')];var _0x49a051=_0x6f8f3d?0x0:_0x5007b6[_0xa0d9('0x27')];var _0x29eac8=_0x6f8f3d?_0x3f8e4a[_0xa0d9('0x2a')]:_0x5007b6[_0xa0d9('0x27')]+_0x5007b6['limit'];var _0x15c8b4;if(_0x29eac8>=_0x3acb9d){_0x29eac8=_0x3acb9d;_0x15c8b4=0xc8;}else{_0x15c8b4=0xce;}_0x4aac83[_0xa0d9('0x24')](_0x15c8b4);return _0x4aac83[_0xa0d9('0x2b')]('Content-Range',_0x49a051+'-'+_0x29eac8+'/'+_0x3acb9d)['json'](_0x3f8e4a);}return null;};}function patchUpdates(_0x3280ac){return function(_0x10ac96){try{jsonpatch[_0xa0d9('0x2c')](_0x10ac96,_0x3280ac,!![]);}catch(_0x5b5605){return BPromise[_0xa0d9('0x2d')](_0x5b5605);}return _0x10ac96[_0xa0d9('0x2e')]();};}function saveUpdates(_0x7ddc29,_0xfbba9a){return function(_0x25b27d){if(_0x25b27d){return _0x25b27d['update'](_0x7ddc29)[_0xa0d9('0x19')](function(_0x29e501){return _0x29e501;});}return null;};}function removeEntity(_0x44b8d9,_0x30d154){return function(_0x24a20b){if(_0x24a20b){return _0x24a20b[_0xa0d9('0x2f')]()[_0xa0d9('0x19')](function(){var _0x4764c=_0x24a20b[_0xa0d9('0x30')]({'plain':!![]});var _0x4414ab='Contexts';return db['UserProfileResource'][_0xa0d9('0x2f')]({'where':{'type':_0x4414ab,'resourceId':_0x4764c['id']}})['then'](function(){return _0x24a20b;});})[_0xa0d9('0x19')](function(){_0x44b8d9['status'](0xcc)[_0xa0d9('0x25')]();});}};}function handleEntityNotFound(_0x513aa8,_0x79474a){return function(_0x3a750e){if(!_0x3a750e){_0x513aa8[_0xa0d9('0x23')](0x194);}return _0x3a750e;};}function handleError(_0x510577,_0x97c759){_0x97c759=_0x97c759||0x1f4;return function(_0x1ab5c3){logger[_0xa0d9('0x1f')](_0x1ab5c3['stack']);if(_0x1ab5c3['name']){delete _0x1ab5c3[_0xa0d9('0x31')];}_0x510577['status'](_0x97c759)[_0xa0d9('0x32')](_0x1ab5c3);};}exports[_0xa0d9('0x33')]=function(_0x31d3d1,_0x3f06a8){var _0x1d06a1={},_0x14087d={},_0x5017a6={'count':0x0,'rows':[]};var _0x1faa1a=_[_0xa0d9('0x34')](db[_0xa0d9('0x35')]['rawAttributes'],function(_0x2858bf){return{'name':_0x2858bf['fieldName'],'type':_0x2858bf[_0xa0d9('0x36')][_0xa0d9('0x37')]};});_0x14087d['model']=_[_0xa0d9('0x34')](_0x1faa1a,_0xa0d9('0x31'));_0x14087d['query']=_['keys'](_0x31d3d1[_0xa0d9('0x38')]);_0x14087d[_0xa0d9('0x39')]=_[_0xa0d9('0x3a')](_0x14087d[_0xa0d9('0x3b')],_0x14087d[_0xa0d9('0x38')]);_0x1d06a1[_0xa0d9('0x3c')]=_[_0xa0d9('0x3a')](_0x14087d[_0xa0d9('0x3b')],qs[_0xa0d9('0x3d')](_0x31d3d1[_0xa0d9('0x38')][_0xa0d9('0x3d')]));_0x1d06a1[_0xa0d9('0x3c')]=_0x1d06a1[_0xa0d9('0x3c')][_0xa0d9('0x3e')]?_0x1d06a1[_0xa0d9('0x3c')]:_0x14087d[_0xa0d9('0x3b')];if(!_0x31d3d1['query'][_0xa0d9('0x3f')](_0xa0d9('0x40'))){_0x1d06a1['limit']=qs[_0xa0d9('0x29')](_0x31d3d1['query'][_0xa0d9('0x29')]);_0x1d06a1[_0xa0d9('0x27')]=qs['offset'](_0x31d3d1['query']['offset']);}_0x1d06a1[_0xa0d9('0x41')]=qs[_0xa0d9('0x42')](_0x31d3d1[_0xa0d9('0x38')][_0xa0d9('0x42')]);_0x1d06a1[_0xa0d9('0x43')]=qs['filters'](_[_0xa0d9('0x44')](_0x31d3d1[_0xa0d9('0x38')],_0x14087d['filters']),_0x1faa1a);if(_0x31d3d1[_0xa0d9('0x38')][_0xa0d9('0x45')]){_0x1d06a1[_0xa0d9('0x43')]=_['merge'](_0x1d06a1['where'],{'$or':_['map'](_0x1faa1a,function(_0x4398f3){if(_0x4398f3['type']!==_0xa0d9('0x46')){var _0x2b9fd0={};_0x2b9fd0[_0x4398f3[_0xa0d9('0x31')]]={'$like':'%'+_0x31d3d1[_0xa0d9('0x38')][_0xa0d9('0x45')]+'%'};return _0x2b9fd0;}})});}_0x1d06a1=_[_0xa0d9('0x47')]({},_0x1d06a1,_0x31d3d1['options']);var _0x21aa33={'where':_0x1d06a1[_0xa0d9('0x43')]};return db['VoiceContext'][_0xa0d9('0x2a')](_0x21aa33)[_0xa0d9('0x19')](function(_0x2e4c3b){_0x5017a6[_0xa0d9('0x2a')]=_0x2e4c3b;if(_0x31d3d1[_0xa0d9('0x38')]['includeAll']){_0x1d06a1[_0xa0d9('0x48')]=[{'all':!![]}];}return db['VoiceContext'][_0xa0d9('0x49')](_0x1d06a1);})[_0xa0d9('0x19')](function(_0x50697b){_0x5017a6[_0xa0d9('0x4a')]=_0x50697b;return _0x5017a6;})[_0xa0d9('0x19')](respondWithFilteredResult(_0x3f06a8,_0x1d06a1))[_0xa0d9('0x4b')](handleError(_0x3f06a8,null));};exports['show']=function(_0x2b79d3,_0x650f47){var _0x258123={'raw':![],'where':{'id':_0x2b79d3['params']['id']}},_0x307a69={};_0x307a69[_0xa0d9('0x3b')]=_[_0xa0d9('0x4c')](db[_0xa0d9('0x35')][_0xa0d9('0x4d')]);_0x307a69['query']=_['keys'](_0x2b79d3[_0xa0d9('0x38')]);_0x307a69[_0xa0d9('0x39')]=_[_0xa0d9('0x3a')](_0x307a69[_0xa0d9('0x3b')],_0x307a69['query']);_0x258123[_0xa0d9('0x3c')]=_['intersection'](_0x307a69[_0xa0d9('0x3b')],qs['fields'](_0x2b79d3[_0xa0d9('0x38')][_0xa0d9('0x3d')]));_0x258123[_0xa0d9('0x3c')]=_0x258123[_0xa0d9('0x3c')][_0xa0d9('0x3e')]?_0x258123[_0xa0d9('0x3c')]:_0x307a69[_0xa0d9('0x3b')];if(_0x2b79d3[_0xa0d9('0x38')]['includeAll']){_0x258123[_0xa0d9('0x48')]=[{'all':!![]}];}_0x258123=_[_0xa0d9('0x47')]({},_0x258123,_0x2b79d3[_0xa0d9('0x4e')]);return db[_0xa0d9('0x35')][_0xa0d9('0x4f')](_0x258123)['then'](handleEntityNotFound(_0x650f47,null))['then'](respondWithResult(_0x650f47,null))[_0xa0d9('0x4b')](handleError(_0x650f47,null));};exports[_0xa0d9('0x50')]=function(_0xc83f0c,_0x50d165,_0x1454a2){var _0x381af5;return db['VoiceContext'][_0xa0d9('0x50')](_0xc83f0c[_0xa0d9('0x51')],{'raw':!![]})[_0xa0d9('0x19')](function(_0x5499d9){_0x381af5=_0x5499d9;return db[_0xa0d9('0x35')][_0xa0d9('0x49')]({'raw':!![]});})[_0xa0d9('0x19')](function(_0x52fb07){var _0x2fcb12=fs[_0xa0d9('0x52')](path['join'](config[_0xa0d9('0x53')],_0xa0d9('0x54')),'utf8');var _0x439265=ejs[_0xa0d9('0x55')](_0x2fcb12,{'contexts':_0x52fb07||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x439265);})['then'](function(){return respondWithRpcPromise(_0xa0d9('0x56'),'create',{'module':'chan_sip.so'});})[_0xa0d9('0x19')](function(){var _0x5cc1ba=_0xc83f0c[_0xa0d9('0x57')][_0xa0d9('0x30')]({'plain':!![]});if(!_0x5cc1ba)throw new Error(_0xa0d9('0x58'));if(_0x5cc1ba[_0xa0d9('0x59')]===_0xa0d9('0x57')){var _0x2dd990=_0x381af5[_0xa0d9('0x30')]({'plain':!![]});return db[_0xa0d9('0x5a')][_0xa0d9('0x4f')]({'where':{'name':'Contexts','userProfileId':_0x5cc1ba[_0xa0d9('0x5b')]},'raw':!![]})[_0xa0d9('0x19')](function(_0x352069){if(_0x352069&&_0x352069['autoAssociation']===0x0){return db[_0xa0d9('0x5c')][_0xa0d9('0x50')]({'name':_0x2dd990['name'],'resourceId':_0x2dd990['id'],'type':_0x352069['name'],'sectionId':_0x352069['id']},{})[_0xa0d9('0x19')](function(){return _0x381af5;});}else{return _0x381af5;}})[_0xa0d9('0x4b')](function(_0x546da6){logger[_0xa0d9('0x1f')](_0xa0d9('0x5d'),_0x546da6);throw _0x546da6;});}return _0x381af5;})['then'](respondWithResult(_0x50d165,0xc9))[_0xa0d9('0x4b')](handleError(_0x50d165,null));};exports['update']=function(_0x4dda82,_0x1bd3e8,_0x89f935){var _0x5a617a;return db[_0xa0d9('0x35')]['find']({'where':{'id':_0x4dda82[_0xa0d9('0x5e')]['id']}})[_0xa0d9('0x19')](handleEntityNotFound(_0x1bd3e8,null))[_0xa0d9('0x19')](saveUpdates(_0x4dda82['body'],null))[_0xa0d9('0x19')](function(_0x34e614){if(_0x34e614){_0x5a617a=_0x34e614;return db[_0xa0d9('0x35')][_0xa0d9('0x49')]({'raw':!![]});}})[_0xa0d9('0x19')](function(_0x12d254){var _0x504683=fs[_0xa0d9('0x52')](path[_0xa0d9('0x5f')](config[_0xa0d9('0x53')],_0xa0d9('0x54')),_0xa0d9('0x60'));var _0x8a5073=ejs[_0xa0d9('0x55')](_0x504683,{'contexts':_0x12d254||[]});fs[_0xa0d9('0x61')](_0xa0d9('0x62'),_0x8a5073);})[_0xa0d9('0x19')](function(){return respondWithRpcPromise(_0xa0d9('0x56'),'update',{'module':_0xa0d9('0x63')});})[_0xa0d9('0x19')](function(){return _0x5a617a;})['then'](respondWithResult(_0x1bd3e8,null))[_0xa0d9('0x4b')](handleError(_0x1bd3e8,null));};exports['destroy']=function(_0x47fa57,_0x14787c,_0x1b6f77){var _0x3a7ae8;return db['VoiceContext'][_0xa0d9('0x4f')]({'where':{'id':_0x47fa57[_0xa0d9('0x5e')]['id']}})[_0xa0d9('0x19')](handleEntityNotFound(_0x14787c,null))[_0xa0d9('0x19')](removeEntity(_0x14787c,null))[_0xa0d9('0x19')](function(){return db[_0xa0d9('0x35')][_0xa0d9('0x49')]({'raw':!![]});})[_0xa0d9('0x19')](function(_0x322d9d){var _0x51850a=fs['readFileSync'](path['join'](config[_0xa0d9('0x53')],_0xa0d9('0x54')),_0xa0d9('0x60'));var _0x46d4ac=ejs[_0xa0d9('0x55')](_0x51850a,{'contexts':_0x322d9d});fs[_0xa0d9('0x61')](_0xa0d9('0x62'),_0x46d4ac);return respondWithRpcPromise(_0xa0d9('0x56'),_0xa0d9('0x2f'),{'module':_0xa0d9('0x63')});})[_0xa0d9('0x4b')](handleError(_0x14787c,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b2660d6..55ba22f 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 _0xf00a=['../../config/environment','./voiceContext.attributes','define','voice_contexts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x497fe7,_0x3c1808){var _0x3e2e55=function(_0xd434f8){while(--_0xd434f8){_0x497fe7['push'](_0x497fe7['shift']());}};_0x3e2e55(++_0x3c1808);}(_0xf00a,0x164));var _0xaf00=function(_0x470b24,_0x58a01e){_0x470b24=_0x470b24-0x0;var _0xde9b3d=_0xf00a[_0x470b24];return _0xde9b3d;};'use strict';var _=require(_0xaf00('0x0'));var util=require(_0xaf00('0x1'));var logger=require('../../config/logger')(_0xaf00('0x2'));var moment=require(_0xaf00('0x3'));var BPromise=require(_0xaf00('0x4'));var rp=require(_0xaf00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf00('0x6'));var config=require(_0xaf00('0x7'));var attributes=require(_0xaf00('0x8'));module['exports']=function(_0x2b21c3,_0x5535fe){return _0x2b21c3[_0xaf00('0x9')]('VoiceContext',attributes,{'tableName':_0xaf00('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1ae=['api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','voice_contexts','lodash','../../config/logger'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0xa1ae,0x134));var _0xea1a=function(_0x4685af,_0x2c1f0f){_0x4685af=_0x4685af-0x0;var _0x46df78=_0xa1ae[_0x4685af];return _0x46df78;};'use strict';var _=require(_0xea1a('0x0'));var util=require('util');var logger=require(_0xea1a('0x1'))(_0xea1a('0x2'));var moment=require(_0xea1a('0x3'));var BPromise=require(_0xea1a('0x4'));var rp=require(_0xea1a('0x5'));var fs=require('fs');var path=require(_0xea1a('0x6'));var rimraf=require(_0xea1a('0x7'));var config=require('../../config/environment');var attributes=require(_0xea1a('0x8'));module['exports']=function(_0x3aff0f,_0x4a863f){return _0x3aff0f['define']('VoiceContext',attributes,{'tableName':_0xea1a('0x9'),'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 386874a..917bdfb 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 _0x4ad3=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x532c55,_0x4dab9a){_0x532c55=_0x532c55-0x0;var _0x1eefe9=_0x4ad3[_0x532c55];return _0x1eefe9;};'use strict';var _=require(_0x34ad('0x0'));var util=require(_0x34ad('0x1'));var moment=require(_0x34ad('0x2'));var BPromise=require(_0x34ad('0x3'));var rs=require(_0x34ad('0x4'));var fs=require('fs');var Redis=require(_0x34ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ad('0x6'));var logger=require(_0x34ad('0x7'))(_0x34ad('0x8'));var config=require(_0x34ad('0x9'));var jayson=require(_0x34ad('0xa'));var client=jayson[_0x34ad('0xb')][_0x34ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b927b,_0x674cc7,_0x10d356){return new BPromise(function(_0x4b6c38,_0x582178){return client[_0x34ad('0xd')](_0x3b927b,_0x10d356)[_0x34ad('0xe')](function(_0xb6c4f5){logger[_0x34ad('0xf')]('VoiceContext,\x20%s,\x20%s',_0x674cc7,_0x34ad('0x10'));logger[_0x34ad('0x11')](_0x34ad('0x12'),_0x674cc7,_0x34ad('0x10'),JSON[_0x34ad('0x13')](_0xb6c4f5));if(_0xb6c4f5[_0x34ad('0x14')]){if(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x15')]===0x1f4){logger[_0x34ad('0x14')](_0x34ad('0x16'),_0x674cc7,_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);return _0x582178(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);}logger[_0x34ad('0x14')](_0x34ad('0x16'),_0x674cc7,_0xb6c4f5['error'][_0x34ad('0x17')]);return _0x4b6c38(_0xb6c4f5[_0x34ad('0x14')][_0x34ad('0x17')]);}else{logger['info'](_0x34ad('0x16'),_0x674cc7,_0x34ad('0x10'));_0x4b6c38(_0xb6c4f5[_0x34ad('0x18')][_0x34ad('0x17')]);}})[_0x34ad('0x19')](function(_0x48e90a){logger[_0x34ad('0x14')]('VoiceContext,\x20%s,\x20%s',_0x674cc7,_0x48e90a);_0x582178(_0x48e90a);});});} \ No newline at end of file +var _0x6739=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x12f38a,_0x38712c){var _0x12c46e=function(_0x3e4332){while(--_0x3e4332){_0x12f38a['push'](_0x12f38a['shift']());}};_0x12c46e(++_0x38712c);}(_0x6739,0xd3));var _0x9673=function(_0x114784,_0x2cc190){_0x114784=_0x114784-0x0;var _0x42a1de=_0x6739[_0x114784];return _0x42a1de;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var moment=require(_0x9673('0x2'));var BPromise=require(_0x9673('0x3'));var rs=require(_0x9673('0x4'));var fs=require('fs');var Redis=require(_0x9673('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9673('0x6'))('rpc');var config=require(_0x9673('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9673('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ad052,_0x3f82df,_0x4981d9){return new BPromise(function(_0x4e1dd5,_0x39b0f0){return client[_0x9673('0x9')](_0x3ad052,_0x4981d9)[_0x9673('0xa')](function(_0x509966){logger[_0x9673('0xb')](_0x9673('0xc'),_0x3f82df,_0x9673('0xd'));logger['debug'](_0x9673('0xe'),_0x3f82df,_0x9673('0xd'),JSON[_0x9673('0xf')](_0x509966));if(_0x509966[_0x9673('0x10')]){if(_0x509966['error'][_0x9673('0x11')]===0x1f4){logger[_0x9673('0x10')](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')]['message']);return _0x39b0f0(_0x509966[_0x9673('0x10')][_0x9673('0x12')]);}logger['error'](_0x9673('0xc'),_0x3f82df,_0x509966[_0x9673('0x10')][_0x9673('0x12')]);return _0x4e1dd5(_0x509966['error'][_0x9673('0x12')]);}else{logger['info'](_0x9673('0xc'),_0x3f82df,'request\x20sent');_0x4e1dd5(_0x509966['result'][_0x9673('0x12')]);}})['catch'](function(_0x3d5642){logger[_0x9673('0x10')]('VoiceContext,\x20%s,\x20%s',_0x3f82df,_0x3d5642);_0x39b0f0(_0x3d5642);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 8ef37b2..a09961f 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 _0x27c9=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update'];(function(_0x38943f,_0x241a0c){var _0x37fae9=function(_0x4a0c60){while(--_0x4a0c60){_0x38943f['push'](_0x38943f['shift']());}};_0x37fae9(++_0x241a0c);}(_0x27c9,0x12e));var _0x927c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x27c9[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var path=require('path');var timeout=require(_0x927c('0x2'));var express=require(_0x927c('0x3'));var router=express[_0x927c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x927c('0x5'));var interaction=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var controller=require(_0x927c('0x8'));router[_0x927c('0x9')]('/',auth['isAuthenticated'](),controller[_0x927c('0xa')]);router[_0x927c('0x9')](_0x927c('0xb'),auth[_0x927c('0xc')](),controller[_0x927c('0xd')]);router[_0x927c('0x9')]('/:id',auth[_0x927c('0xc')](),controller[_0x927c('0xe')]);router[_0x927c('0xf')]('/',auth[_0x927c('0xc')](),controller[_0x927c('0x10')]);router[_0x927c('0x11')](_0x927c('0x12'),auth['isAuthenticated'](),controller[_0x927c('0x13')]);router[_0x927c('0x14')](_0x927c('0x12'),auth[_0x927c('0xc')](),controller[_0x927c('0x15')]);module[_0x927c('0x16')]=router; \ No newline at end of file +var _0xc52f=['fs-extra','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','Router'];(function(_0x2e81f5,_0x32b45d){var _0x43db09=function(_0x5dc4bd){while(--_0x5dc4bd){_0x2e81f5['push'](_0x2e81f5['shift']());}};_0x43db09(++_0x32b45d);}(_0xc52f,0x1e3));var _0xfc52=function(_0x5175a5,_0x3698f1){_0x5175a5=_0x5175a5-0x0;var _0x376fd5=_0xc52f[_0x5175a5];return _0x376fd5;};'use strict';var multer=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc52('0x2')]();var fs_extra=require(_0xfc52('0x3'));var auth=require(_0xfc52('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfc52('0x5'));router[_0xfc52('0x6')]('/',auth[_0xfc52('0x7')](),controller['index']);router[_0xfc52('0x6')](_0xfc52('0x8'),auth[_0xfc52('0x7')](),controller[_0xfc52('0x9')]);router[_0xfc52('0x6')](_0xfc52('0xa'),auth[_0xfc52('0x7')](),controller[_0xfc52('0xb')]);router[_0xfc52('0xc')]('/',auth[_0xfc52('0x7')](),controller[_0xfc52('0xd')]);router[_0xfc52('0xe')]('/:id',auth[_0xfc52('0x7')](),controller['update']);router[_0xfc52('0xf')](_0xfc52('0xa'),auth[_0xfc52('0x7')](),controller[_0xfc52('0x10')]);module[_0xfc52('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8f800a5..7c2b6f6 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 _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x21b976,_0x251459){var _0x1e1f1b=function(_0x344e59){while(--_0x344e59){_0x21b976['push'](_0x21b976['shift']());}};_0x1e1f1b(++_0x251459);}(_0x6aa7,0x178));var _0x76aa=function(_0x50a07c,_0x416d7a){_0x50a07c=_0x50a07c-0x0;var _0xdf8e4c=_0x6aa7[_0x50a07c];return _0xdf8e4c;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x2fd5b6,_0x3e0213){var _0x1f2f6a=function(_0x2bf548){while(--_0x2bf548){_0x2fd5b6['push'](_0x2fd5b6['shift']());}};_0x1f2f6a(++_0x3e0213);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0xf3cd[_0x42b02c];return _0x105518;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9a92220..06ca7b0 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 _0x3166=['fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','end','stack','send','index','VoiceDialReport','fieldName','type','key','name','keys','filters','intersection','model','attributes'];(function(_0xbe1ea5,_0x156c36){var _0x5de72d=function(_0x431b07){while(--_0x431b07){_0xbe1ea5['push'](_0xbe1ea5['shift']());}};_0x5de72d(++_0x156c36);}(_0x3166,0x67));var _0x6316=function(_0x2f1c55,_0x183744){_0x2f1c55=_0x2f1c55-0x0;var _0x46aea8=_0x3166[_0x2f1c55];return _0x46aea8;};'use strict';var emlformat=require(_0x6316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6316('0x1'));var jsonpatch=require(_0x6316('0x2'));var rp=require('request-promise');var moment=require(_0x6316('0x3'));var BPromise=require(_0x6316('0x4'));var Mustache=require(_0x6316('0x5'));var util=require(_0x6316('0x6'));var path=require(_0x6316('0x7'));var sox=require(_0x6316('0x8'));var csv=require(_0x6316('0x9'));var ejs=require(_0x6316('0xa'));var fs=require('fs');var fs_extra=require(_0x6316('0xb'));var _=require(_0x6316('0xc'));var squel=require(_0x6316('0xd'));var crypto=require(_0x6316('0xe'));var jsforce=require(_0x6316('0xf'));var deskjs=require(_0x6316('0x10'));var toCsv=require(_0x6316('0x9'));var querystring=require('querystring');var Papa=require(_0x6316('0x11'));var Redis=require('ioredis');var authService=require(_0x6316('0x12'));var qs=require(_0x6316('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6316('0x14'));var logger=require(_0x6316('0x15'))(_0x6316('0x16'));var utils=require(_0x6316('0x17'));var config=require(_0x6316('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6316('0x19'))['db'];function respondWithStatusCode(_0x31cea3,_0x36bdc0){_0x36bdc0=_0x36bdc0||0xcc;return function(_0x5c082b){if(_0x5c082b){return _0x31cea3[_0x6316('0x1a')](_0x36bdc0);}return _0x31cea3['status'](_0x36bdc0)['end']();};}function respondWithResult(_0xbeacf0,_0x5891e0){_0x5891e0=_0x5891e0||0xc8;return function(_0x1648a2){if(_0x1648a2){return _0xbeacf0['status'](_0x5891e0)[_0x6316('0x1b')](_0x1648a2);}};}function respondWithFilteredResult(_0x1c2320,_0x97195a){return function(_0x5e01d8){if(_0x5e01d8){var _0x52b3b9=typeof _0x97195a[_0x6316('0x1c')]===_0x6316('0x1d')&&typeof _0x97195a[_0x6316('0x1e')]===_0x6316('0x1d');var _0xe0ec24=_0x5e01d8[_0x6316('0x1f')];var _0x54e9ce=_0x52b3b9?0x0:_0x97195a['offset'];var _0x4aa3a2=_0x52b3b9?_0x5e01d8['count']:_0x97195a[_0x6316('0x1c')]+_0x97195a['limit'];var _0xd82842;if(_0x4aa3a2>=_0xe0ec24){_0x4aa3a2=_0xe0ec24;_0xd82842=0xc8;}else{_0xd82842=0xce;}_0x1c2320[_0x6316('0x20')](_0xd82842);return _0x1c2320[_0x6316('0x21')](_0x6316('0x22'),_0x54e9ce+'-'+_0x4aa3a2+'/'+_0xe0ec24)[_0x6316('0x1b')](_0x5e01d8);}return null;};}function patchUpdates(_0x50b553){return function(_0x18f156){try{jsonpatch[_0x6316('0x23')](_0x18f156,_0x50b553,!![]);}catch(_0x76f07){return BPromise[_0x6316('0x24')](_0x76f07);}return _0x18f156['save']();};}function saveUpdates(_0x1a4f97,_0x29e060){return function(_0x53cbcb){if(_0x53cbcb){return _0x53cbcb['update'](_0x1a4f97)[_0x6316('0x25')](function(_0x24928a){return _0x24928a;});}return null;};}function removeEntity(_0x59112a,_0x7f7c49){return function(_0x1e0efc){if(_0x1e0efc){return _0x1e0efc[_0x6316('0x26')]()[_0x6316('0x25')](function(){_0x59112a[_0x6316('0x20')](0xcc)[_0x6316('0x27')]();});}};}function handleEntityNotFound(_0x45408d,_0x21b11c){return function(_0xad994c){if(!_0xad994c){_0x45408d[_0x6316('0x1a')](0x194);}return _0xad994c;};}function handleError(_0x2f99f0,_0x5a7a4b){_0x5a7a4b=_0x5a7a4b||0x1f4;return function(_0x3d769c){logger['error'](_0x3d769c[_0x6316('0x28')]);if(_0x3d769c['name']){delete _0x3d769c['name'];}_0x2f99f0[_0x6316('0x20')](_0x5a7a4b)[_0x6316('0x29')](_0x3d769c);};}exports[_0x6316('0x2a')]=function(_0x251b0b,_0x55db3a){var _0x5b465c={},_0x13a397={},_0xdbbb1f={'count':0x0,'rows':[]};var _0x21463f=_['map'](db[_0x6316('0x2b')]['rawAttributes'],function(_0x46309e){return{'name':_0x46309e[_0x6316('0x2c')],'type':_0x46309e[_0x6316('0x2d')][_0x6316('0x2e')]};});_0x13a397['model']=_['map'](_0x21463f,_0x6316('0x2f'));_0x13a397['query']=_[_0x6316('0x30')](_0x251b0b['query']);_0x13a397[_0x6316('0x31')]=_[_0x6316('0x32')](_0x13a397[_0x6316('0x33')],_0x13a397['query']);_0x5b465c[_0x6316('0x34')]=_[_0x6316('0x32')](_0x13a397[_0x6316('0x33')],qs[_0x6316('0x35')](_0x251b0b[_0x6316('0x36')][_0x6316('0x35')]));_0x5b465c[_0x6316('0x34')]=_0x5b465c[_0x6316('0x34')][_0x6316('0x37')]?_0x5b465c[_0x6316('0x34')]:_0x13a397['model'];if(!_0x251b0b[_0x6316('0x36')][_0x6316('0x38')](_0x6316('0x39'))){_0x5b465c[_0x6316('0x1e')]=qs['limit'](_0x251b0b[_0x6316('0x36')][_0x6316('0x1e')]);_0x5b465c[_0x6316('0x1c')]=qs[_0x6316('0x1c')](_0x251b0b[_0x6316('0x36')]['offset']);}_0x5b465c[_0x6316('0x3a')]=qs['sort'](_0x251b0b[_0x6316('0x36')][_0x6316('0x3b')]);_0x5b465c[_0x6316('0x3c')]=qs[_0x6316('0x31')](_[_0x6316('0x3d')](_0x251b0b[_0x6316('0x36')],_0x13a397[_0x6316('0x31')]),_0x21463f);if(_0x251b0b[_0x6316('0x36')][_0x6316('0x3e')]){_0x5b465c[_0x6316('0x3c')]=_[_0x6316('0x3f')](_0x5b465c[_0x6316('0x3c')],{'$or':_['map'](_0x21463f,function(_0x54a921){if(_0x54a921[_0x6316('0x2d')]!==_0x6316('0x40')){var _0x1fd977={};_0x1fd977[_0x54a921[_0x6316('0x2f')]]={'$like':'%'+_0x251b0b[_0x6316('0x36')][_0x6316('0x3e')]+'%'};return _0x1fd977;}})});}_0x5b465c=_[_0x6316('0x3f')]({},_0x5b465c,_0x251b0b[_0x6316('0x41')]);var _0x28fde7={'where':_0x5b465c[_0x6316('0x3c')]};return db[_0x6316('0x2b')][_0x6316('0x1f')](_0x28fde7)[_0x6316('0x25')](function(_0x2edb16){_0xdbbb1f[_0x6316('0x1f')]=_0x2edb16;if(_0x251b0b[_0x6316('0x36')][_0x6316('0x42')]){_0x5b465c[_0x6316('0x43')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x6316('0x44')](_0x5b465c);})[_0x6316('0x25')](function(_0x11a1ca){_0xdbbb1f['rows']=_0x11a1ca;return _0xdbbb1f;})[_0x6316('0x25')](respondWithFilteredResult(_0x55db3a,_0x5b465c))[_0x6316('0x45')](handleError(_0x55db3a,null));};exports[_0x6316('0x46')]=function(_0x935225,_0x74c673){var _0x1fb0a0={'raw':!![],'where':{'id':_0x935225[_0x6316('0x47')]['id']}},_0x228e6e={};_0x228e6e['model']=_[_0x6316('0x30')](db[_0x6316('0x2b')][_0x6316('0x48')]);_0x228e6e['query']=_['keys'](_0x935225[_0x6316('0x36')]);_0x228e6e[_0x6316('0x31')]=_['intersection'](_0x228e6e[_0x6316('0x33')],_0x228e6e['query']);_0x1fb0a0[_0x6316('0x34')]=_[_0x6316('0x32')](_0x228e6e['model'],qs['fields'](_0x935225[_0x6316('0x36')]['fields']));_0x1fb0a0[_0x6316('0x34')]=_0x1fb0a0['attributes']['length']?_0x1fb0a0[_0x6316('0x34')]:_0x228e6e[_0x6316('0x33')];if(_0x935225[_0x6316('0x36')][_0x6316('0x42')]){_0x1fb0a0[_0x6316('0x43')]=[{'all':!![]}];}_0x1fb0a0=_['merge']({},_0x1fb0a0,_0x935225['options']);return db[_0x6316('0x2b')]['find'](_0x1fb0a0)['then'](handleEntityNotFound(_0x74c673,null))[_0x6316('0x25')](respondWithResult(_0x74c673,null))[_0x6316('0x45')](handleError(_0x74c673,null));};exports[_0x6316('0x49')]=function(_0x59ab4f,_0x4209c1){return db['VoiceDialReport']['create'](_0x59ab4f[_0x6316('0x4a')],{})[_0x6316('0x25')](respondWithResult(_0x4209c1,0xc9))[_0x6316('0x45')](handleError(_0x4209c1,null));};exports[_0x6316('0x4b')]=function(_0x2510c8,_0x49dff2){if(_0x2510c8['body']['id']){delete _0x2510c8['body']['id'];}return db[_0x6316('0x2b')][_0x6316('0x4c')]({'where':{'id':_0x2510c8[_0x6316('0x47')]['id']}})['then'](handleEntityNotFound(_0x49dff2,null))[_0x6316('0x25')](saveUpdates(_0x2510c8[_0x6316('0x4a')],null))[_0x6316('0x25')](respondWithResult(_0x49dff2,null))[_0x6316('0x45')](handleError(_0x49dff2,null));};exports[_0x6316('0x26')]=function(_0xb20cc5,_0x5d294b){return db[_0x6316('0x2b')][_0x6316('0x4c')]({'where':{'id':_0xb20cc5[_0x6316('0x47')]['id']}})[_0x6316('0x25')](handleEntityNotFound(_0x5d294b,null))[_0x6316('0x25')](removeEntity(_0x5d294b,null))[_0x6316('0x45')](handleError(_0x5d294b,null));};exports[_0x6316('0x4d')]=function(_0x30eee8,_0x142d34){return db[_0x6316('0x2b')][_0x6316('0x4d')]()[_0x6316('0x25')](respondWithResult(_0x142d34,null))[_0x6316('0x45')](handleError(_0x142d34,null));}; \ No newline at end of file +var _0x39b6=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','body','describe','eml-format','zip-dir','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x2e7b0c,_0x182a1e){var _0x25126d=function(_0x419ace){while(--_0x419ace){_0x2e7b0c['push'](_0x2e7b0c['shift']());}};_0x25126d(++_0x182a1e);}(_0x39b6,0xc7));var _0x639b=function(_0x8f1237,_0xeac55a){_0x8f1237=_0x8f1237-0x0;var _0x4af1a5=_0x39b6[_0x8f1237];return _0x4af1a5;};'use strict';var emlformat=require(_0x639b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x639b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x639b('0x3'));var util=require(_0x639b('0x4'));var path=require('path');var sox=require(_0x639b('0x5'));var csv=require(_0x639b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x639b('0x7'));var _=require('lodash');var squel=require(_0x639b('0x8'));var crypto=require(_0x639b('0x9'));var jsforce=require(_0x639b('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x639b('0xb'));var Papa=require(_0x639b('0xc'));var Redis=require(_0x639b('0xd'));var authService=require(_0x639b('0xe'));var qs=require(_0x639b('0xf'));var as=require(_0x639b('0x10'));var hardwareService=require(_0x639b('0x11'));var logger=require(_0x639b('0x12'))('api');var utils=require(_0x639b('0x13'));var config=require(_0x639b('0x14'));var licenseUtil=require(_0x639b('0x15'));var db=require(_0x639b('0x16'))['db'];function respondWithStatusCode(_0x4686a0,_0x4a98e0){_0x4a98e0=_0x4a98e0||0xcc;return function(_0xcf2c58){if(_0xcf2c58){return _0x4686a0[_0x639b('0x17')](_0x4a98e0);}return _0x4686a0['status'](_0x4a98e0)[_0x639b('0x18')]();};}function respondWithResult(_0x1a329c,_0x5d72b2){_0x5d72b2=_0x5d72b2||0xc8;return function(_0x5e774a){if(_0x5e774a){return _0x1a329c[_0x639b('0x19')](_0x5d72b2)[_0x639b('0x1a')](_0x5e774a);}};}function respondWithFilteredResult(_0x25ea8e,_0x31bb60){return function(_0x461af4){if(_0x461af4){var _0x20c129=typeof _0x31bb60[_0x639b('0x1b')]==='undefined'&&typeof _0x31bb60[_0x639b('0x1c')]===_0x639b('0x1d');var _0x8ac698=_0x461af4[_0x639b('0x1e')];var _0x17e787=_0x20c129?0x0:_0x31bb60[_0x639b('0x1b')];var _0x2ff583=_0x20c129?_0x461af4[_0x639b('0x1e')]:_0x31bb60[_0x639b('0x1b')]+_0x31bb60[_0x639b('0x1c')];var _0x28420f;if(_0x2ff583>=_0x8ac698){_0x2ff583=_0x8ac698;_0x28420f=0xc8;}else{_0x28420f=0xce;}_0x25ea8e[_0x639b('0x19')](_0x28420f);return _0x25ea8e[_0x639b('0x1f')](_0x639b('0x20'),_0x17e787+'-'+_0x2ff583+'/'+_0x8ac698)[_0x639b('0x1a')](_0x461af4);}return null;};}function patchUpdates(_0xdbd51b){return function(_0x1ca0d6){try{jsonpatch[_0x639b('0x21')](_0x1ca0d6,_0xdbd51b,!![]);}catch(_0x506888){return BPromise['reject'](_0x506888);}return _0x1ca0d6[_0x639b('0x22')]();};}function saveUpdates(_0x424e0d,_0x3676e8){return function(_0x580d2d){if(_0x580d2d){return _0x580d2d[_0x639b('0x23')](_0x424e0d)[_0x639b('0x24')](function(_0x287b7a){return _0x287b7a;});}return null;};}function removeEntity(_0x512dae,_0x1fa9f6){return function(_0x2ddd38){if(_0x2ddd38){return _0x2ddd38[_0x639b('0x25')]()[_0x639b('0x24')](function(){_0x512dae[_0x639b('0x19')](0xcc)[_0x639b('0x18')]();});}};}function handleEntityNotFound(_0xdf4db0,_0x37c0e3){return function(_0x392410){if(!_0x392410){_0xdf4db0[_0x639b('0x17')](0x194);}return _0x392410;};}function handleError(_0xc7e427,_0x9dac06){_0x9dac06=_0x9dac06||0x1f4;return function(_0x920c21){logger['error'](_0x920c21['stack']);if(_0x920c21[_0x639b('0x26')]){delete _0x920c21['name'];}_0xc7e427[_0x639b('0x19')](_0x9dac06)[_0x639b('0x27')](_0x920c21);};}exports[_0x639b('0x28')]=function(_0x3b02f3,_0x5f0578){var _0x24a91e={},_0x47bd59={},_0x5b4549={'count':0x0,'rows':[]};var _0x4b8a19=_[_0x639b('0x29')](db[_0x639b('0x2a')][_0x639b('0x2b')],function(_0x573a1a){return{'name':_0x573a1a[_0x639b('0x2c')],'type':_0x573a1a[_0x639b('0x2d')]['key']};});_0x47bd59['model']=_['map'](_0x4b8a19,_0x639b('0x26'));_0x47bd59['query']=_[_0x639b('0x2e')](_0x3b02f3[_0x639b('0x2f')]);_0x47bd59['filters']=_[_0x639b('0x30')](_0x47bd59[_0x639b('0x31')],_0x47bd59[_0x639b('0x2f')]);_0x24a91e[_0x639b('0x32')]=_[_0x639b('0x30')](_0x47bd59[_0x639b('0x31')],qs[_0x639b('0x33')](_0x3b02f3[_0x639b('0x2f')][_0x639b('0x33')]));_0x24a91e[_0x639b('0x32')]=_0x24a91e[_0x639b('0x32')][_0x639b('0x34')]?_0x24a91e['attributes']:_0x47bd59[_0x639b('0x31')];if(!_0x3b02f3[_0x639b('0x2f')]['hasOwnProperty'](_0x639b('0x35'))){_0x24a91e[_0x639b('0x1c')]=qs[_0x639b('0x1c')](_0x3b02f3[_0x639b('0x2f')][_0x639b('0x1c')]);_0x24a91e[_0x639b('0x1b')]=qs[_0x639b('0x1b')](_0x3b02f3['query'][_0x639b('0x1b')]);}_0x24a91e[_0x639b('0x36')]=qs[_0x639b('0x37')](_0x3b02f3[_0x639b('0x2f')]['sort']);_0x24a91e[_0x639b('0x38')]=qs['filters'](_[_0x639b('0x39')](_0x3b02f3[_0x639b('0x2f')],_0x47bd59[_0x639b('0x3a')]),_0x4b8a19);if(_0x3b02f3[_0x639b('0x2f')][_0x639b('0x3b')]){_0x24a91e[_0x639b('0x38')]=_[_0x639b('0x3c')](_0x24a91e[_0x639b('0x38')],{'$or':_[_0x639b('0x29')](_0x4b8a19,function(_0x43553e){if(_0x43553e[_0x639b('0x2d')]!==_0x639b('0x3d')){var _0x1a5dc8={};_0x1a5dc8[_0x43553e[_0x639b('0x26')]]={'$like':'%'+_0x3b02f3[_0x639b('0x2f')]['filter']+'%'};return _0x1a5dc8;}})});}_0x24a91e=_[_0x639b('0x3c')]({},_0x24a91e,_0x3b02f3['options']);var _0x150a63={'where':_0x24a91e[_0x639b('0x38')]};return db[_0x639b('0x2a')][_0x639b('0x1e')](_0x150a63)[_0x639b('0x24')](function(_0x4e7ba3){_0x5b4549['count']=_0x4e7ba3;if(_0x3b02f3[_0x639b('0x2f')][_0x639b('0x3e')]){_0x24a91e[_0x639b('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x639b('0x40')](_0x24a91e);})[_0x639b('0x24')](function(_0x2cc7ee){_0x5b4549[_0x639b('0x41')]=_0x2cc7ee;return _0x5b4549;})[_0x639b('0x24')](respondWithFilteredResult(_0x5f0578,_0x24a91e))['catch'](handleError(_0x5f0578,null));};exports[_0x639b('0x42')]=function(_0x5e829d,_0x554a49){var _0x17b620={'raw':!![],'where':{'id':_0x5e829d[_0x639b('0x43')]['id']}},_0x1d6e37={};_0x1d6e37[_0x639b('0x31')]=_[_0x639b('0x2e')](db[_0x639b('0x2a')][_0x639b('0x2b')]);_0x1d6e37[_0x639b('0x2f')]=_[_0x639b('0x2e')](_0x5e829d[_0x639b('0x2f')]);_0x1d6e37[_0x639b('0x3a')]=_[_0x639b('0x30')](_0x1d6e37[_0x639b('0x31')],_0x1d6e37[_0x639b('0x2f')]);_0x17b620[_0x639b('0x32')]=_[_0x639b('0x30')](_0x1d6e37['model'],qs[_0x639b('0x33')](_0x5e829d['query']['fields']));_0x17b620[_0x639b('0x32')]=_0x17b620[_0x639b('0x32')]['length']?_0x17b620[_0x639b('0x32')]:_0x1d6e37['model'];if(_0x5e829d[_0x639b('0x2f')][_0x639b('0x3e')]){_0x17b620['include']=[{'all':!![]}];}_0x17b620=_['merge']({},_0x17b620,_0x5e829d[_0x639b('0x44')]);return db[_0x639b('0x2a')][_0x639b('0x45')](_0x17b620)[_0x639b('0x24')](handleEntityNotFound(_0x554a49,null))[_0x639b('0x24')](respondWithResult(_0x554a49,null))[_0x639b('0x46')](handleError(_0x554a49,null));};exports['create']=function(_0x4c1c82,_0x4343a4){return db['VoiceDialReport']['create'](_0x4c1c82['body'],{})[_0x639b('0x24')](respondWithResult(_0x4343a4,0xc9))[_0x639b('0x46')](handleError(_0x4343a4,null));};exports[_0x639b('0x23')]=function(_0x165a32,_0x6daf){if(_0x165a32[_0x639b('0x47')]['id']){delete _0x165a32[_0x639b('0x47')]['id'];}return db['VoiceDialReport'][_0x639b('0x45')]({'where':{'id':_0x165a32[_0x639b('0x43')]['id']}})[_0x639b('0x24')](handleEntityNotFound(_0x6daf,null))[_0x639b('0x24')](saveUpdates(_0x165a32['body'],null))[_0x639b('0x24')](respondWithResult(_0x6daf,null))['catch'](handleError(_0x6daf,null));};exports[_0x639b('0x25')]=function(_0x2edfee,_0x2899a6){return db[_0x639b('0x2a')][_0x639b('0x45')]({'where':{'id':_0x2edfee[_0x639b('0x43')]['id']}})[_0x639b('0x24')](handleEntityNotFound(_0x2899a6,null))[_0x639b('0x24')](removeEntity(_0x2899a6,null))[_0x639b('0x46')](handleError(_0x2899a6,null));};exports[_0x639b('0x48')]=function(_0x10867a,_0x4e10b3){return db['VoiceDialReport']['describe']()[_0x639b('0x24')](respondWithResult(_0x4e10b3,null))[_0x639b('0x46')](handleError(_0x4e10b3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0469525..07b51eb 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 _0xd77a=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x549e49,_0x94ee2f){var _0x53fdd3=function(_0x3a7710){while(--_0x3a7710){_0x549e49['push'](_0x549e49['shift']());}};_0x53fdd3(++_0x94ee2f);}(_0xd77a,0x104));var _0xad77=function(_0x25752c,_0x423c5f){_0x25752c=_0x25752c-0x0;var _0x56d40a=_0xd77a[_0x25752c];return _0x56d40a;};'use strict';var _=require(_0xad77('0x0'));var util=require(_0xad77('0x1'));var logger=require(_0xad77('0x2'))(_0xad77('0x3'));var moment=require('moment');var BPromise=require(_0xad77('0x4'));var rp=require(_0xad77('0x5'));var fs=require('fs');var path=require(_0xad77('0x6'));var rimraf=require(_0xad77('0x7'));var config=require('../../config/environment');var attributes=require(_0xad77('0x8'));module['exports']=function(_0x2ada15,_0x16817c){return _0x2ada15['define']('VoiceDialReport',attributes,{'tableName':_0xad77('0x9'),'paranoid':![],'indexes':[{'fields':[_0xad77('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01a3=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceDialReport.attributes','exports','define'];(function(_0x398681,_0x341680){var _0x199270=function(_0x53cfec){while(--_0x53cfec){_0x398681['push'](_0x398681['shift']());}};_0x199270(++_0x341680);}(_0x01a3,0x13a));var _0x301a=function(_0x3180ba,_0x37b377){_0x3180ba=_0x3180ba-0x0;var _0x1d104c=_0x01a3[_0x3180ba];return _0x1d104c;};'use strict';var _=require(_0x301a('0x0'));var util=require(_0x301a('0x1'));var logger=require(_0x301a('0x2'))(_0x301a('0x3'));var moment=require(_0x301a('0x4'));var BPromise=require(_0x301a('0x5'));var rp=require(_0x301a('0x6'));var fs=require('fs');var path=require(_0x301a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x301a('0x8'));module[_0x301a('0x9')]=function(_0x33c685,_0x506808){return _0x33c685[_0x301a('0xa')]('VoiceDialReport',attributes,{'tableName':_0x301a('0xb'),'paranoid':![],'indexes':[{'fields':[_0x301a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8e52ccd..0de505c 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 _0x5a28=['then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceDialReport','create','body','options','raw'];(function(_0x186b61,_0x13f0b6){var _0x2172db=function(_0x4ef615){while(--_0x4ef615){_0x186b61['push'](_0x186b61['shift']());}};_0x2172db(++_0x13f0b6);}(_0x5a28,0x1ac));var _0x85a2=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x5a28[_0x14a862];return _0x245eb5;};'use strict';var _=require(_0x85a2('0x0'));var util=require(_0x85a2('0x1'));var moment=require(_0x85a2('0x2'));var BPromise=require(_0x85a2('0x3'));var rs=require(_0x85a2('0x4'));var fs=require('fs');var Redis=require(_0x85a2('0x5'));var db=require(_0x85a2('0x6'))['db'];var utils=require(_0x85a2('0x7'));var logger=require(_0x85a2('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x85a2('0x9'));var client=jayson[_0x85a2('0xa')][_0x85a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b6252,_0x1d36f7,_0x59c8b1){return new BPromise(function(_0x3550ca,_0xfe10c5){return client[_0x85a2('0xc')](_0x5b6252,_0x59c8b1)['then'](function(_0x5d9fbf){logger[_0x85a2('0xd')](_0x85a2('0xe'),_0x1d36f7,'request\x20sent');logger['debug'](_0x85a2('0xf'),_0x1d36f7,_0x85a2('0x10'),JSON[_0x85a2('0x11')](_0x5d9fbf));if(_0x5d9fbf[_0x85a2('0x12')]){if(_0x5d9fbf[_0x85a2('0x12')][_0x85a2('0x13')]===0x1f4){logger[_0x85a2('0x12')](_0x85a2('0xe'),_0x1d36f7,_0x5d9fbf['error'][_0x85a2('0x14')]);return _0xfe10c5(_0x5d9fbf['error'][_0x85a2('0x14')]);}logger[_0x85a2('0x12')](_0x85a2('0xe'),_0x1d36f7,_0x5d9fbf[_0x85a2('0x12')]['message']);return _0x3550ca(_0x5d9fbf[_0x85a2('0x12')][_0x85a2('0x14')]);}else{logger[_0x85a2('0xd')](_0x85a2('0xe'),_0x1d36f7,'request\x20sent');_0x3550ca(_0x5d9fbf[_0x85a2('0x15')][_0x85a2('0x14')]);}})['catch'](function(_0x1ea1aa){logger[_0x85a2('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x1d36f7,_0x1ea1aa);_0xfe10c5(_0x1ea1aa);});});}exports['CreateVoiceDialReport']=function(_0x513912){var _0x48b7c1=this;return new Promise(function(_0x31a4f4,_0x458e63){return db[_0x85a2('0x16')][_0x85a2('0x17')](_0x513912[_0x85a2('0x18')],{'raw':_0x513912[_0x85a2('0x19')]?_0x513912['options'][_0x85a2('0x1a')]===undefined?!![]:![]:!![]})[_0x85a2('0x1b')](function(_0x335d4a){logger[_0x85a2('0xd')](_0x85a2('0x1c'),_0x513912);logger[_0x85a2('0x1d')](_0x85a2('0x1c'),_0x513912,JSON[_0x85a2('0x11')](_0x335d4a));_0x31a4f4(_0x335d4a);})['catch'](function(_0x3d2cf7){logger[_0x85a2('0x12')](_0x85a2('0x1c'),_0x3d2cf7[_0x85a2('0x14')],_0x513912);_0x458e63(_0x48b7c1['error'](0x1f4,_0x3d2cf7[_0x85a2('0x14')]));});});};exports[_0x85a2('0x1e')]=function(_0x7e10a5){var _0x3b5597=this;return new Promise(function(_0x596246,_0x562996){return db['VoiceDialReport']['update'](_0x7e10a5[_0x85a2('0x18')],{'raw':_0x7e10a5[_0x85a2('0x19')]?_0x7e10a5[_0x85a2('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7e10a5['options']?_0x7e10a5[_0x85a2('0x19')][_0x85a2('0x1f')]||null:null,'attributes':_0x7e10a5[_0x85a2('0x19')]?_0x7e10a5[_0x85a2('0x19')][_0x85a2('0x20')]||null:null,'limit':_0x7e10a5['options']?_0x7e10a5[_0x85a2('0x19')][_0x85a2('0x21')]||null:null})[_0x85a2('0x1b')](function(_0x4f83be){logger[_0x85a2('0xd')]('UpdateVoiceDialReport',_0x7e10a5);logger[_0x85a2('0x1d')]('UpdateVoiceDialReport',_0x7e10a5,JSON['stringify'](_0x4f83be));_0x596246(_0x4f83be);})[_0x85a2('0x22')](function(_0x28cda5){logger[_0x85a2('0x12')]('UpdateVoiceDialReport',_0x28cda5[_0x85a2('0x14')],_0x7e10a5);_0x562996(_0x3b5597['error'](0x1f4,_0x28cda5[_0x85a2('0x14')]));});});}; \ No newline at end of file +var _0x1118=['request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceDialReport','create','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','body','where','attributes','limit','lodash','bluebird','../../mysqldb','../../config/logger','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0x32b3a3,_0x2c9681){var _0x4ed9ac=function(_0x26c87d){while(--_0x26c87d){_0x32b3a3['push'](_0x32b3a3['shift']());}};_0x4ed9ac(++_0x2c9681);}(_0x1118,0xc8));var _0x8111=function(_0x1ac1b9,_0x2927b3){_0x1ac1b9=_0x1ac1b9-0x0;var _0x13cfe4=_0x1118[_0x1ac1b9];return _0x13cfe4;};'use strict';var _=require(_0x8111('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8111('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8111('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8111('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8111('0x4')][_0x8111('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x39b106,_0x38984d,_0x344a50){return new BPromise(function(_0x136fb5,_0x1b94ac){return client[_0x8111('0x6')](_0x39b106,_0x344a50)[_0x8111('0x7')](function(_0x3fde31){logger[_0x8111('0x8')](_0x8111('0x9'),_0x38984d,_0x8111('0xa'));logger[_0x8111('0xb')](_0x8111('0xc'),_0x38984d,_0x8111('0xa'),JSON[_0x8111('0xd')](_0x3fde31));if(_0x3fde31[_0x8111('0xe')]){if(_0x3fde31[_0x8111('0xe')][_0x8111('0xf')]===0x1f4){logger[_0x8111('0xe')](_0x8111('0x9'),_0x38984d,_0x3fde31['error']['message']);return _0x1b94ac(_0x3fde31[_0x8111('0xe')][_0x8111('0x10')]);}logger[_0x8111('0xe')](_0x8111('0x9'),_0x38984d,_0x3fde31['error']['message']);return _0x136fb5(_0x3fde31['error'][_0x8111('0x10')]);}else{logger[_0x8111('0x8')](_0x8111('0x9'),_0x38984d,'request\x20sent');_0x136fb5(_0x3fde31[_0x8111('0x11')][_0x8111('0x10')]);}})['catch'](function(_0x4fd492){logger['error'](_0x8111('0x9'),_0x38984d,_0x4fd492);_0x1b94ac(_0x4fd492);});});}exports['CreateVoiceDialReport']=function(_0x14dfe4){var _0x7f35f2=this;return new Promise(function(_0x29ce73,_0x58f8d9){return db[_0x8111('0x12')][_0x8111('0x13')](_0x14dfe4['body'],{'raw':_0x14dfe4[_0x8111('0x14')]?_0x14dfe4[_0x8111('0x14')][_0x8111('0x15')]===undefined?!![]:![]:!![]})[_0x8111('0x7')](function(_0xf757a8){logger[_0x8111('0x8')](_0x8111('0x16'),_0x14dfe4);logger[_0x8111('0xb')](_0x8111('0x16'),_0x14dfe4,JSON['stringify'](_0xf757a8));_0x29ce73(_0xf757a8);})[_0x8111('0x17')](function(_0x1633ed){logger[_0x8111('0xe')](_0x8111('0x16'),_0x1633ed[_0x8111('0x10')],_0x14dfe4);_0x58f8d9(_0x7f35f2['error'](0x1f4,_0x1633ed[_0x8111('0x10')]));});});};exports[_0x8111('0x18')]=function(_0xc919b1){var _0x1d1a41=this;return new Promise(function(_0x544bef,_0x3284bb){return db[_0x8111('0x12')][_0x8111('0x19')](_0xc919b1[_0x8111('0x1a')],{'raw':_0xc919b1[_0x8111('0x14')]?_0xc919b1[_0x8111('0x14')][_0x8111('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc919b1['options']?_0xc919b1['options'][_0x8111('0x1b')]||null:null,'attributes':_0xc919b1[_0x8111('0x14')]?_0xc919b1['options'][_0x8111('0x1c')]||null:null,'limit':_0xc919b1['options']?_0xc919b1[_0x8111('0x14')][_0x8111('0x1d')]||null:null})['then'](function(_0x3aa157){logger[_0x8111('0x8')](_0x8111('0x18'),_0xc919b1);logger[_0x8111('0xb')](_0x8111('0x18'),_0xc919b1,JSON[_0x8111('0xd')](_0x3aa157));_0x544bef(_0x3aa157);})['catch'](function(_0x1fff89){logger[_0x8111('0xe')](_0x8111('0x18'),_0x1fff89[_0x8111('0x10')],_0xc919b1);_0x3284bb(_0x1d1a41[_0x8111('0xe')](0x1f4,_0x1fff89[_0x8111('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 08919f4..7bd5d7f 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 _0xde24=['/:id/applications','addApplications','put','update','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','post','create'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xde24,0x17b));var _0x4de2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde24[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x4de2('0x0'));var util=require('util');var path=require(_0x4de2('0x1'));var timeout=require(_0x4de2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4de2('0x3'));var auth=require(_0x4de2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4de2('0x5'));var controller=require(_0x4de2('0x6'));router[_0x4de2('0x7')]('/',auth[_0x4de2('0x8')](),controller['index']);router[_0x4de2('0x7')](_0x4de2('0x9'),auth[_0x4de2('0x8')](),controller['show']);router[_0x4de2('0xa')]('/',auth[_0x4de2('0x8')](),controller[_0x4de2('0xb')]);router[_0x4de2('0xa')](_0x4de2('0xc'),auth['isAuthenticated'](),controller[_0x4de2('0xd')]);router[_0x4de2('0xe')](_0x4de2('0x9'),auth[_0x4de2('0x8')](),controller[_0x4de2('0xf')]);router['delete'](_0x4de2('0x9'),auth[_0x4de2('0x8')](),controller[_0x4de2('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5530=['/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5530,0x1d3));var _0x0553=function(_0x527837,_0x320ebe){_0x527837=_0x527837-0x0;var _0x4b7e36=_0x5530[_0x527837];return _0x4b7e36;};'use strict';var multer=require(_0x0553('0x0'));var util=require(_0x0553('0x1'));var path=require(_0x0553('0x2'));var timeout=require(_0x0553('0x3'));var express=require('express');var router=express[_0x0553('0x4')]();var fs_extra=require(_0x0553('0x5'));var auth=require(_0x0553('0x6'));var interaction=require(_0x0553('0x7'));var config=require(_0x0553('0x8'));var controller=require(_0x0553('0x9'));router[_0x0553('0xa')]('/',auth[_0x0553('0xb')](),controller[_0x0553('0xc')]);router['get'](_0x0553('0xd'),auth[_0x0553('0xb')](),controller[_0x0553('0xe')]);router[_0x0553('0xf')]('/',auth[_0x0553('0xb')](),controller[_0x0553('0x10')]);router[_0x0553('0xf')](_0x0553('0x11'),auth['isAuthenticated'](),controller[_0x0553('0x12')]);router[_0x0553('0x13')](_0x0553('0xd'),auth['isAuthenticated'](),controller[_0x0553('0x14')]);router[_0x0553('0x15')](_0x0553('0xd'),auth[_0x0553('0xb')](),controller[_0x0553('0x16')]);module[_0x0553('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d02cc8e..4a1ac0f 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 _0xb10b=['system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x17ab52,_0x829c8e){var _0x316d53=function(_0x5f467a){while(--_0x5f467a){_0x17ab52['push'](_0x17ab52['shift']());}};_0x316d53(++_0x829c8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d2e5e,_0x145ae6){_0x1d2e5e=_0x1d2e5e-0x0;var _0x4a1d68=_0xb10b[_0x1d2e5e];return _0x4a1d68;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'context':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xbb10('0x2')},'tag':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0x3')},'appdata':{'type':Sequelize[_0xbb10('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xbb10('0x4'),_0xbb10('0x5'),'internal',_0xbb10('0x6'),_0xbb10('0x7'),_0xbb10('0x8'),_0xbb10('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xbb10('0x1')]},'interval':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'defaultValue':_0xbb10('0xa')},'IntervalId':{'type':Sequelize[_0xbb10('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xbb10('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xbb10('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbb10('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xbb10('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xbb10('0xe')],'get':function(_0x916a32){return this[_0xbb10('0xf')](_0xbb10('0x10'));}}}; \ No newline at end of file +var _0xd8b0=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x407de5,_0x1d199f){var _0x36eba2=function(_0x39efb9){while(--_0x39efb9){_0x407de5['push'](_0x407de5['shift']());}};_0x36eba2(++_0x1d199f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d8b('0x2')},'priority':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x0d8b('0x2')},'tag':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x5'),_0x0d8b('0x6'),'internal',_0x0d8b('0x7'),_0x0d8b('0x8'),'system',_0x0d8b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x0d8b('0x3')]},'interval':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':_0x0d8b('0xa')},'IntervalId':{'type':Sequelize[_0x0d8b('0xb')]},'isApp':{'type':Sequelize[_0x0d8b('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0d8b('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0xd')},'answer':{'type':Sequelize[_0x0d8b('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(_0x92cdd8){return this[_0x0d8b('0xf')](_0x0d8b('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8b8e4f7..5844fd2 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 _0x8d0e=['nolimit','where','pick','merge','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','keys','create','startsWith','exten','concat','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','InternalRoutes','userProfileId','UserProfileResource','error','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','map','value','find','type','end','stack','name','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x13b95a,_0x25d025){_0x13b95a=_0x13b95a-0x0;var _0x13968f=_0x8d0e[_0x13b95a];return _0x13968f;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];config['redis']=_[_0xe8d0('0x1b')](config[_0xe8d0('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xe8d0('0x1d'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xe8d0('0x1e')](socket);function respondWithStatusCode(_0x2aa906,_0x1aa725){_0x1aa725=_0x1aa725||0xcc;return function(_0x291b49){if(_0x291b49){return _0x2aa906[_0xe8d0('0x1f')](_0x1aa725);}return _0x2aa906[_0xe8d0('0x20')](_0x1aa725)['end']();};}function respondWithResult(_0x6ccffa,_0x49554d){_0x49554d=_0x49554d||0xc8;return function(_0x6d932b){if(_0x6d932b){return _0x6ccffa[_0xe8d0('0x20')](_0x49554d)[_0xe8d0('0x21')](_0x6d932b);}};}function respondWithFilteredResult(_0x4d1db4,_0x4d0ddb){return function(_0x47c67a){if(_0x47c67a){var _0x1bdd94=typeof _0x4d0ddb[_0xe8d0('0x22')]===_0xe8d0('0x23')&&typeof _0x4d0ddb[_0xe8d0('0x24')]===_0xe8d0('0x23');var _0x588133=_0x47c67a[_0xe8d0('0x25')];var _0x12ebf4=_0x1bdd94?0x0:_0x4d0ddb['offset'];var _0x5ce284=_0x1bdd94?_0x47c67a['count']:_0x4d0ddb[_0xe8d0('0x22')]+_0x4d0ddb[_0xe8d0('0x24')];var _0x25363b;if(_0x5ce284>=_0x588133){_0x5ce284=_0x588133;_0x25363b=0xc8;}else{_0x25363b=0xce;}_0x4d1db4[_0xe8d0('0x20')](_0x25363b);return _0x4d1db4[_0xe8d0('0x26')](_0xe8d0('0x27'),_0x12ebf4+'-'+_0x5ce284+'/'+_0x588133)[_0xe8d0('0x21')](_0x47c67a);}return null;};}function patchUpdates(_0x28a6b5){return function(_0x32e39a){try{jsonpatch['apply'](_0x32e39a,_0x28a6b5,!![]);}catch(_0xed8f2e){return BPromise[_0xe8d0('0x28')](_0xed8f2e);}return _0x32e39a['save']();};}function saveUpdates(_0x106614,_0x2e69d1){return function(_0x274cac){if(_0x274cac){return _0x274cac[_0xe8d0('0x29')](_0x106614)[_0xe8d0('0x2a')](function(_0x149dfd){return _0x149dfd;});}return null;};}function removeEntity(_0x31519b,_0x32f0c1){return function(_0xfa3527){if(_0xfa3527){return _0xfa3527[_0xe8d0('0x2b')]()[_0xe8d0('0x2a')](function(){var _0x539548=_0xfa3527[_0xe8d0('0x2c')]({'plain':!![]});var _0x26dd52=[{'name':_0xe8d0('0x2d'),'value':'inbound','ignore':![]},{'name':_0xe8d0('0x2e'),'value':_0xe8d0('0x2f'),'ignore':![]},{'name':'InternalRoutes','value':_0xe8d0('0x30'),'ignore':![]}];var _0x3ffcb7=_(_0x26dd52)[_0xe8d0('0x31')](_0xe8d0('0x32'))[_0xe8d0('0x33')]('value')[_0xe8d0('0x34')]();if(_['includes'](_0x3ffcb7,_0x539548['type'])){return;}var _0x50ad3c=_[_0xe8d0('0x35')](_0x26dd52,[_0xe8d0('0x34'),_0x539548[_0xe8d0('0x36')]])['name'];return db['UserProfileResource'][_0xe8d0('0x2b')]({'where':{'type':_0x50ad3c,'resourceId':_0x539548['id']}})['then'](function(){return _0xfa3527;});})[_0xe8d0('0x2a')](function(){_0x31519b[_0xe8d0('0x20')](0xcc)[_0xe8d0('0x37')]();});}};}function handleEntityNotFound(_0x1b2b0a,_0x2277cf){return function(_0x5bbc9e){if(!_0x5bbc9e){_0x1b2b0a[_0xe8d0('0x1f')](0x194);}return _0x5bbc9e;};}function handleError(_0x4db53c,_0x402e90){_0x402e90=_0x402e90||0x1f4;return function(_0x145ddb){logger['error'](_0x145ddb[_0xe8d0('0x38')]);if(_0x145ddb[_0xe8d0('0x39')]){delete _0x145ddb['name'];}_0x4db53c[_0xe8d0('0x20')](_0x402e90)['send'](_0x145ddb);};}exports[_0xe8d0('0x3a')]=function(_0x5dc4ca,_0x197e01){var _0x531835={},_0x3a0f03={},_0xb2cdbf={'count':0x0,'rows':[]};var _0x1e2430=_[_0xe8d0('0x33')](db['VoiceExtension'][_0xe8d0('0x3b')],function(_0x354e19){return{'name':_0x354e19[_0xe8d0('0x3c')],'type':_0x354e19['type'][_0xe8d0('0x3d')]};});_0x3a0f03[_0xe8d0('0x3e')]=_[_0xe8d0('0x33')](_0x1e2430,_0xe8d0('0x39'));_0x3a0f03[_0xe8d0('0x3f')]=_['keys'](_0x5dc4ca[_0xe8d0('0x3f')]);_0x3a0f03[_0xe8d0('0x40')]=_[_0xe8d0('0x41')](_0x3a0f03[_0xe8d0('0x3e')],_0x3a0f03[_0xe8d0('0x3f')]);_0x531835[_0xe8d0('0x42')]=_[_0xe8d0('0x41')](_0x3a0f03[_0xe8d0('0x3e')],qs['fields'](_0x5dc4ca['query'][_0xe8d0('0x43')]));_0x531835[_0xe8d0('0x42')]=_0x531835[_0xe8d0('0x42')][_0xe8d0('0x44')]?_0x531835[_0xe8d0('0x42')]:_0x3a0f03['model'];if(!_0x5dc4ca[_0xe8d0('0x3f')]['hasOwnProperty'](_0xe8d0('0x45'))){_0x531835[_0xe8d0('0x24')]=qs[_0xe8d0('0x24')](_0x5dc4ca['query'][_0xe8d0('0x24')]);_0x531835[_0xe8d0('0x22')]=qs[_0xe8d0('0x22')](_0x5dc4ca[_0xe8d0('0x3f')][_0xe8d0('0x22')]);}_0x531835['order']=qs['sort'](_0x5dc4ca['query']['sort']);_0x531835[_0xe8d0('0x46')]=qs['filters'](_[_0xe8d0('0x47')](_0x5dc4ca[_0xe8d0('0x3f')],_0x3a0f03[_0xe8d0('0x40')]),_0x1e2430);if(_0x5dc4ca[_0xe8d0('0x3f')][_0xe8d0('0x31')]){_0x531835[_0xe8d0('0x46')]=_[_0xe8d0('0x48')](_0x531835[_0xe8d0('0x46')],{'$or':_['map'](_0x1e2430,function(_0x1e4481){if(_0x1e4481[_0xe8d0('0x36')]!=='VIRTUAL'){var _0x4bcdff={};_0x4bcdff[_0x1e4481[_0xe8d0('0x39')]]={'$like':'%'+_0x5dc4ca[_0xe8d0('0x3f')][_0xe8d0('0x31')]+'%'};return _0x4bcdff;}})});}_0x531835=_['merge']({},_0x531835,_0x5dc4ca[_0xe8d0('0x49')]);var _0x305289={'where':_0x531835['where']};return db[_0xe8d0('0x4a')][_0xe8d0('0x25')](_0x305289)['then'](function(_0x473e9a){_0xb2cdbf[_0xe8d0('0x25')]=_0x473e9a;if(_0x5dc4ca[_0xe8d0('0x3f')][_0xe8d0('0x4b')]){_0x531835[_0xe8d0('0x4c')]=[{'all':!![]}];}return db[_0xe8d0('0x4a')][_0xe8d0('0x4d')](_0x531835);})[_0xe8d0('0x2a')](function(_0x510f62){_0xb2cdbf[_0xe8d0('0x4e')]=_0x510f62;return _0xb2cdbf;})[_0xe8d0('0x2a')](respondWithFilteredResult(_0x197e01,_0x531835))[_0xe8d0('0x4f')](handleError(_0x197e01,null));};exports[_0xe8d0('0x50')]=function(_0x28d38b,_0x330688){var _0x1d0875={'raw':![],'where':{'id':_0x28d38b[_0xe8d0('0x51')]['id']}},_0x41b8af={};_0x41b8af[_0xe8d0('0x3e')]=_[_0xe8d0('0x52')](db[_0xe8d0('0x4a')]['rawAttributes']);_0x41b8af[_0xe8d0('0x3f')]=_[_0xe8d0('0x52')](_0x28d38b[_0xe8d0('0x3f')]);_0x41b8af[_0xe8d0('0x40')]=_[_0xe8d0('0x41')](_0x41b8af[_0xe8d0('0x3e')],_0x41b8af[_0xe8d0('0x3f')]);_0x1d0875['attributes']=_[_0xe8d0('0x41')](_0x41b8af[_0xe8d0('0x3e')],qs[_0xe8d0('0x43')](_0x28d38b[_0xe8d0('0x3f')]['fields']));_0x1d0875[_0xe8d0('0x42')]=_0x1d0875['attributes'][_0xe8d0('0x44')]?_0x1d0875[_0xe8d0('0x42')]:_0x41b8af[_0xe8d0('0x3e')];if(_0x28d38b[_0xe8d0('0x3f')][_0xe8d0('0x4b')]){_0x1d0875[_0xe8d0('0x4c')]=[{'all':!![]}];}_0x1d0875=_[_0xe8d0('0x48')]({},_0x1d0875,_0x28d38b['options']);return db[_0xe8d0('0x4a')]['find'](_0x1d0875)['then'](handleEntityNotFound(_0x330688,null))[_0xe8d0('0x2a')](respondWithResult(_0x330688,null))['catch'](handleError(_0x330688,null));};exports[_0xe8d0('0x2b')]=function(_0x521d8d,_0x1f8fcc){return db[_0xe8d0('0x4a')][_0xe8d0('0x35')]({'where':{'id':_0x521d8d[_0xe8d0('0x51')]['id']}})['then'](handleEntityNotFound(_0x1f8fcc,null))[_0xe8d0('0x2a')](removeEntity(_0x1f8fcc,null))[_0xe8d0('0x4f')](handleError(_0x1f8fcc,null));};exports[_0xe8d0('0x53')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body'][_0xe8d0('0x36')]===_0xe8d0('0x2f')&&!_[_0xe8d0('0x54')](_0x2e3f1d['body'][_0xe8d0('0x55')],'_')){_0x2e3f1d['body']['exten']='_'[_0xe8d0('0x56')](_0x2e3f1d[_0xe8d0('0x57')]['exten']);}return db[_0xe8d0('0x4a')][_0xe8d0('0x53')](_0x2e3f1d['body'],{'raw':![]})[_0xe8d0('0x2a')](function(_0xe67928){var _0x37a626=_0x2e3f1d[_0xe8d0('0x58')]['get']({'plain':!![]});if(!_0x37a626)throw new Error(_0xe8d0('0x59'));if(_0x37a626[_0xe8d0('0x5a')]===_0xe8d0('0x58')){var _0x76316a=_0xe67928['get']({'plain':!![]});var _0x4125aa=[{'name':_0xe8d0('0x2d'),'value':_0xe8d0('0x5b')},{'name':_0xe8d0('0x2e'),'value':_0xe8d0('0x2f')},{'name':_0xe8d0('0x5c'),'value':'internal'}];var _0x4fdca4=_[_0xe8d0('0x35')](_0x4125aa,['value',_0x76316a[_0xe8d0('0x36')]])[_0xe8d0('0x39')];return db['UserProfileSection']['find']({'where':{'name':_0x4fdca4,'userProfileId':_0x37a626[_0xe8d0('0x5d')]},'raw':!![]})['then'](function(_0x26af63){if(_0x26af63&&_0x26af63['autoAssociation']===0x0){return db[_0xe8d0('0x5e')][_0xe8d0('0x53')]({'name':_0x76316a[_0xe8d0('0x39')],'resourceId':_0x76316a['id'],'type':_0x26af63['name'],'sectionId':_0x26af63['id']},{})[_0xe8d0('0x2a')](function(){return _0xe67928;});}else{return _0xe67928;}})[_0xe8d0('0x4f')](function(_0x5b87a7){logger[_0xe8d0('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b87a7);throw _0x5b87a7;});}return _0xe67928;})[_0xe8d0('0x2a')](respondWithResult(_0x18cc14,0xc9))['catch'](handleError(_0x18cc14,null));};exports[_0xe8d0('0x29')]=function(_0x17afc2,_0x29467d){if(_0x17afc2[_0xe8d0('0x57')]['id']){delete _0x17afc2[_0xe8d0('0x57')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x17afc2[_0xe8d0('0x51')]['id']}})['then'](handleEntityNotFound(_0x29467d,null))[_0xe8d0('0x2a')](function(_0x18b655){if(_0x18b655){return db[_0xe8d0('0x4a')][_0xe8d0('0x29')](_[_0xe8d0('0x47')](_0x17afc2[_0xe8d0('0x57')],[_0xe8d0('0x55'),_0xe8d0('0x60'),_0xe8d0('0x61'),_0xe8d0('0x62'),_0xe8d0('0x63'),_0xe8d0('0x64')]),{'where':{'context':_0x18b655[_0xe8d0('0x60')],'exten':_0x18b655[_0xe8d0('0x55')]},'individualHooks':!![]})[_0xe8d0('0x2a')](function(_0x4a68d5){return _0x4a68d5;});}return null;})[_0xe8d0('0x2a')](respondWithStatusCode(_0x29467d,null))[_0xe8d0('0x4f')](handleError(_0x29467d,null));};exports[_0xe8d0('0x65')]=function(_0x41bca5,_0x3fb20a,_0x4848d4){return db[_0xe8d0('0x4a')][_0xe8d0('0x66')]({'where':{'id':_0x41bca5[_0xe8d0('0x51')]['id']}})[_0xe8d0('0x2a')](handleEntityNotFound(_0x3fb20a,null))[_0xe8d0('0x2a')](function(_0xa215f){if(_0xa215f){return db[_0xe8d0('0x67')][_0xe8d0('0x68')](function(_0x40cb5c){return db[_0xe8d0('0x4a')][_0xe8d0('0x2b')]({'where':{'VoiceExtensionId':_0x41bca5[_0xe8d0('0x51')]['id']},'transaction':_0x40cb5c})['then'](function(_0x4c4019){var _0x3148a4=_['map'](_0x41bca5[_0xe8d0('0x57')],function(_0x209263){_0x209263['VoiceExtensionId']=_0x41bca5[_0xe8d0('0x51')]['id'];return _0x209263;});return db[_0xe8d0('0x4a')][_0xe8d0('0x69')](_0x3148a4,{'transaction':_0x40cb5c});});})[_0xe8d0('0x2a')](function(){return db[_0xe8d0('0x4a')][_0xe8d0('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x41bca5[_0xe8d0('0x51')]['id']},'order':_0xe8d0('0x6b')});});}})[_0xe8d0('0x2a')](respondWithResult(_0x3fb20a,null))[_0xe8d0('0x4f')](handleError(_0x3fb20a,null));}; \ No newline at end of file +var _0x303a=['context','cutdigits','addApplications','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','get','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','rows','show','params','include','catch','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5d2adc,_0x38fc19){var _0x4299a6=function(_0x4f4de2){while(--_0x4f4de2){_0x5d2adc['push'](_0x5d2adc['shift']());}};_0x4299a6(++_0x38fc19);}(_0x303a,0x1a0));var _0xa303=function(_0x495984,_0x20ff45){_0x495984=_0x495984-0x0;var _0x93c24c=_0x303a[_0x495984];return _0x93c24c;};'use strict';var emlformat=require(_0xa303('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa303('0x1'));var jsonpatch=require(_0xa303('0x2'));var rp=require(_0xa303('0x3'));var moment=require(_0xa303('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa303('0x5'));var util=require(_0xa303('0x6'));var path=require(_0xa303('0x7'));var sox=require(_0xa303('0x8'));var csv=require(_0xa303('0x9'));var ejs=require(_0xa303('0xa'));var fs=require('fs');var fs_extra=require(_0xa303('0xb'));var _=require(_0xa303('0xc'));var squel=require(_0xa303('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa303('0x9'));var querystring=require(_0xa303('0xe'));var Papa=require('papaparse');var Redis=require(_0xa303('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa303('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa303('0x11'));var logger=require(_0xa303('0x12'))(_0xa303('0x13'));var utils=require(_0xa303('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa303('0x15'));var db=require('../../mysqldb')['db'];config[_0xa303('0x16')]=_[_0xa303('0x17')](config[_0xa303('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa303('0x18'))(new Redis(config[_0xa303('0x16')]));require(_0xa303('0x19'))[_0xa303('0x1a')](socket);function respondWithStatusCode(_0xed0420,_0x1618e6){_0x1618e6=_0x1618e6||0xcc;return function(_0x475a91){if(_0x475a91){return _0xed0420[_0xa303('0x1b')](_0x1618e6);}return _0xed0420['status'](_0x1618e6)[_0xa303('0x1c')]();};}function respondWithResult(_0xd2e8ee,_0x1f3ede){_0x1f3ede=_0x1f3ede||0xc8;return function(_0x288596){if(_0x288596){return _0xd2e8ee[_0xa303('0x1d')](_0x1f3ede)[_0xa303('0x1e')](_0x288596);}};}function respondWithFilteredResult(_0x5ec243,_0x28c164){return function(_0x54ca49){if(_0x54ca49){var _0x1d2003=typeof _0x28c164['offset']===_0xa303('0x1f')&&typeof _0x28c164['limit']===_0xa303('0x1f');var _0xe263f9=_0x54ca49[_0xa303('0x20')];var _0x4bbec6=_0x1d2003?0x0:_0x28c164[_0xa303('0x21')];var _0x188cb6=_0x1d2003?_0x54ca49[_0xa303('0x20')]:_0x28c164['offset']+_0x28c164[_0xa303('0x22')];var _0x3bc8c3;if(_0x188cb6>=_0xe263f9){_0x188cb6=_0xe263f9;_0x3bc8c3=0xc8;}else{_0x3bc8c3=0xce;}_0x5ec243[_0xa303('0x1d')](_0x3bc8c3);return _0x5ec243[_0xa303('0x23')]('Content-Range',_0x4bbec6+'-'+_0x188cb6+'/'+_0xe263f9)[_0xa303('0x1e')](_0x54ca49);}return null;};}function patchUpdates(_0x2a2512){return function(_0x565b2e){try{jsonpatch[_0xa303('0x24')](_0x565b2e,_0x2a2512,!![]);}catch(_0x27c1d7){return BPromise[_0xa303('0x25')](_0x27c1d7);}return _0x565b2e[_0xa303('0x26')]();};}function saveUpdates(_0x65ab0e,_0x577ea7){return function(_0x3d3d8a){if(_0x3d3d8a){return _0x3d3d8a[_0xa303('0x27')](_0x65ab0e)[_0xa303('0x28')](function(_0x57d584){return _0x57d584;});}return null;};}function removeEntity(_0x532d4d,_0x4dad5b){return function(_0x58922f){if(_0x58922f){return _0x58922f['destroy']()[_0xa303('0x28')](function(){var _0xc1fd3a=_0x58922f[_0xa303('0x29')]({'plain':!![]});var _0xbb93f0=[{'name':_0xa303('0x2a'),'value':'inbound','ignore':![]},{'name':_0xa303('0x2b'),'value':_0xa303('0x2c'),'ignore':![]},{'name':'InternalRoutes','value':_0xa303('0x2d'),'ignore':![]}];var _0xef04b=_(_0xbb93f0)[_0xa303('0x2e')](_0xa303('0x2f'))[_0xa303('0x30')](_0xa303('0x31'))[_0xa303('0x31')]();if(_[_0xa303('0x32')](_0xef04b,_0xc1fd3a[_0xa303('0x33')])){return;}var _0x3383f4=_[_0xa303('0x34')](_0xbb93f0,[_0xa303('0x31'),_0xc1fd3a[_0xa303('0x33')]])[_0xa303('0x35')];return db[_0xa303('0x36')][_0xa303('0x37')]({'where':{'type':_0x3383f4,'resourceId':_0xc1fd3a['id']}})[_0xa303('0x28')](function(){return _0x58922f;});})['then'](function(){_0x532d4d['status'](0xcc)[_0xa303('0x1c')]();});}};}function handleEntityNotFound(_0x37cda6,_0xa69c59){return function(_0x273d84){if(!_0x273d84){_0x37cda6['sendStatus'](0x194);}return _0x273d84;};}function handleError(_0x265550,_0x765ee0){_0x765ee0=_0x765ee0||0x1f4;return function(_0x3c21ec){logger[_0xa303('0x38')](_0x3c21ec['stack']);if(_0x3c21ec[_0xa303('0x35')]){delete _0x3c21ec[_0xa303('0x35')];}_0x265550[_0xa303('0x1d')](_0x765ee0)['send'](_0x3c21ec);};}exports[_0xa303('0x39')]=function(_0x4349cd,_0x1150fb){var _0x4a6328={},_0x246e17={},_0x190742={'count':0x0,'rows':[]};var _0x3e432d=_['map'](db[_0xa303('0x3a')][_0xa303('0x3b')],function(_0x3ad97e){return{'name':_0x3ad97e[_0xa303('0x3c')],'type':_0x3ad97e['type'][_0xa303('0x3d')]};});_0x246e17[_0xa303('0x3e')]=_[_0xa303('0x30')](_0x3e432d,_0xa303('0x35'));_0x246e17['query']=_[_0xa303('0x3f')](_0x4349cd[_0xa303('0x40')]);_0x246e17[_0xa303('0x41')]=_[_0xa303('0x42')](_0x246e17[_0xa303('0x3e')],_0x246e17['query']);_0x4a6328['attributes']=_[_0xa303('0x42')](_0x246e17[_0xa303('0x3e')],qs[_0xa303('0x43')](_0x4349cd['query']['fields']));_0x4a6328[_0xa303('0x44')]=_0x4a6328[_0xa303('0x44')][_0xa303('0x45')]?_0x4a6328[_0xa303('0x44')]:_0x246e17['model'];if(!_0x4349cd['query'][_0xa303('0x46')](_0xa303('0x47'))){_0x4a6328[_0xa303('0x22')]=qs[_0xa303('0x22')](_0x4349cd[_0xa303('0x40')]['limit']);_0x4a6328[_0xa303('0x21')]=qs[_0xa303('0x21')](_0x4349cd[_0xa303('0x40')][_0xa303('0x21')]);}_0x4a6328['order']=qs['sort'](_0x4349cd['query'][_0xa303('0x48')]);_0x4a6328[_0xa303('0x49')]=qs[_0xa303('0x41')](_[_0xa303('0x4a')](_0x4349cd[_0xa303('0x40')],_0x246e17[_0xa303('0x41')]),_0x3e432d);if(_0x4349cd[_0xa303('0x40')][_0xa303('0x2e')]){_0x4a6328[_0xa303('0x49')]=_[_0xa303('0x4b')](_0x4a6328[_0xa303('0x49')],{'$or':_['map'](_0x3e432d,function(_0x5036d9){if(_0x5036d9[_0xa303('0x33')]!=='VIRTUAL'){var _0x839adf={};_0x839adf[_0x5036d9['name']]={'$like':'%'+_0x4349cd[_0xa303('0x40')][_0xa303('0x2e')]+'%'};return _0x839adf;}})});}_0x4a6328=_[_0xa303('0x4b')]({},_0x4a6328,_0x4349cd[_0xa303('0x4c')]);var _0x42e273={'where':_0x4a6328[_0xa303('0x49')]};return db[_0xa303('0x3a')][_0xa303('0x20')](_0x42e273)[_0xa303('0x28')](function(_0x63a899){_0x190742[_0xa303('0x20')]=_0x63a899;if(_0x4349cd[_0xa303('0x40')][_0xa303('0x4d')]){_0x4a6328['include']=[{'all':!![]}];}return db[_0xa303('0x3a')]['findAll'](_0x4a6328);})[_0xa303('0x28')](function(_0x11440f){_0x190742[_0xa303('0x4e')]=_0x11440f;return _0x190742;})['then'](respondWithFilteredResult(_0x1150fb,_0x4a6328))['catch'](handleError(_0x1150fb,null));};exports[_0xa303('0x4f')]=function(_0x1b9097,_0xc10adc){var _0x887027={'raw':![],'where':{'id':_0x1b9097[_0xa303('0x50')]['id']}},_0x3fd4d1={};_0x3fd4d1[_0xa303('0x3e')]=_[_0xa303('0x3f')](db[_0xa303('0x3a')][_0xa303('0x3b')]);_0x3fd4d1['query']=_[_0xa303('0x3f')](_0x1b9097[_0xa303('0x40')]);_0x3fd4d1['filters']=_[_0xa303('0x42')](_0x3fd4d1['model'],_0x3fd4d1[_0xa303('0x40')]);_0x887027[_0xa303('0x44')]=_[_0xa303('0x42')](_0x3fd4d1[_0xa303('0x3e')],qs['fields'](_0x1b9097[_0xa303('0x40')][_0xa303('0x43')]));_0x887027[_0xa303('0x44')]=_0x887027[_0xa303('0x44')][_0xa303('0x45')]?_0x887027[_0xa303('0x44')]:_0x3fd4d1['model'];if(_0x1b9097[_0xa303('0x40')][_0xa303('0x4d')]){_0x887027[_0xa303('0x51')]=[{'all':!![]}];}_0x887027=_[_0xa303('0x4b')]({},_0x887027,_0x1b9097['options']);return db['VoiceExtension'][_0xa303('0x34')](_0x887027)[_0xa303('0x28')](handleEntityNotFound(_0xc10adc,null))[_0xa303('0x28')](respondWithResult(_0xc10adc,null))['catch'](handleError(_0xc10adc,null));};exports[_0xa303('0x37')]=function(_0x58071e,_0x5939ea){return db['VoiceExtension']['find']({'where':{'id':_0x58071e[_0xa303('0x50')]['id']}})[_0xa303('0x28')](handleEntityNotFound(_0x5939ea,null))['then'](removeEntity(_0x5939ea,null))[_0xa303('0x52')](handleError(_0x5939ea,null));};exports[_0xa303('0x53')]=function(_0x33a667,_0x3cda19){if(_0x33a667[_0xa303('0x54')]['type']===_0xa303('0x2c')&&!_[_0xa303('0x55')](_0x33a667[_0xa303('0x54')][_0xa303('0x56')],'_')){_0x33a667[_0xa303('0x54')]['exten']='_'['concat'](_0x33a667[_0xa303('0x54')][_0xa303('0x56')]);}return db[_0xa303('0x3a')][_0xa303('0x53')](_0x33a667[_0xa303('0x54')],{'raw':![]})[_0xa303('0x28')](function(_0x3395c5){var _0x15f042=_0x33a667[_0xa303('0x57')]['get']({'plain':!![]});if(!_0x15f042)throw new Error(_0xa303('0x58'));if(_0x15f042[_0xa303('0x59')]===_0xa303('0x57')){var _0x2914db=_0x3395c5['get']({'plain':!![]});var _0x483436=[{'name':_0xa303('0x2a'),'value':'inbound'},{'name':_0xa303('0x2b'),'value':_0xa303('0x2c')},{'name':'InternalRoutes','value':'internal'}];var _0xa75808=_[_0xa303('0x34')](_0x483436,['value',_0x2914db['type']])['name'];return db[_0xa303('0x5a')][_0xa303('0x34')]({'where':{'name':_0xa75808,'userProfileId':_0x15f042[_0xa303('0x5b')]},'raw':!![]})[_0xa303('0x28')](function(_0x28cd01){if(_0x28cd01&&_0x28cd01[_0xa303('0x5c')]===0x0){return db[_0xa303('0x36')][_0xa303('0x53')]({'name':_0x2914db[_0xa303('0x35')],'resourceId':_0x2914db['id'],'type':_0x28cd01['name'],'sectionId':_0x28cd01['id']},{})[_0xa303('0x28')](function(){return _0x3395c5;});}else{return _0x3395c5;}})[_0xa303('0x52')](function(_0x318c16){logger[_0xa303('0x38')](_0xa303('0x5d'),_0x318c16);throw _0x318c16;});}return _0x3395c5;})[_0xa303('0x28')](respondWithResult(_0x3cda19,0xc9))['catch'](handleError(_0x3cda19,null));};exports[_0xa303('0x27')]=function(_0x558a2a,_0x5df9e0){if(_0x558a2a[_0xa303('0x54')]['id']){delete _0x558a2a[_0xa303('0x54')]['id'];}return db['VoiceExtension'][_0xa303('0x34')]({'where':{'id':_0x558a2a[_0xa303('0x50')]['id']}})[_0xa303('0x28')](handleEntityNotFound(_0x5df9e0,null))[_0xa303('0x28')](function(_0x37e415){if(_0x37e415){return db['VoiceExtension']['update'](_['pick'](_0x558a2a[_0xa303('0x54')],[_0xa303('0x56'),_0xa303('0x5e'),'description','recordingFormat',_0xa303('0x5f'),'mandatoryDisposition']),{'where':{'context':_0x37e415['context'],'exten':_0x37e415['exten']},'individualHooks':!![]})['then'](function(_0x410b2b){return _0x410b2b;});}return null;})[_0xa303('0x28')](respondWithStatusCode(_0x5df9e0,null))[_0xa303('0x52')](handleError(_0x5df9e0,null));};exports[_0xa303('0x60')]=function(_0x3008ae,_0x81e0b0,_0xdfb5cd){return db[_0xa303('0x3a')]['findOne']({'where':{'id':_0x3008ae[_0xa303('0x50')]['id']}})[_0xa303('0x28')](handleEntityNotFound(_0x81e0b0,null))[_0xa303('0x28')](function(_0x32ffb2){if(_0x32ffb2){return db[_0xa303('0x61')][_0xa303('0x62')](function(_0x51a87d){return db[_0xa303('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x3008ae['params']['id']},'transaction':_0x51a87d})[_0xa303('0x28')](function(_0x56fd0a){var _0x5d679d=_['map'](_0x3008ae['body'],function(_0x4ee911){_0x4ee911[_0xa303('0x63')]=_0x3008ae[_0xa303('0x50')]['id'];return _0x4ee911;});return db[_0xa303('0x3a')][_0xa303('0x64')](_0x5d679d,{'transaction':_0x51a87d});});})[_0xa303('0x28')](function(){return db['VoiceExtension'][_0xa303('0x65')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3008ae[_0xa303('0x50')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x81e0b0,null))[_0xa303('0x52')](handleError(_0x81e0b0,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 648d5a1..fe31c9d 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 _0xf598=['hasOwnProperty','hook','exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xf598,0xb7));var _0x8f59=function(_0x41e160,_0x124069){_0x41e160=_0x41e160-0x0;var _0xc5ab6e=_0xf598[_0x41e160];return _0xc5ab6e;};'use strict';var EventEmitter=require(_0x8f59('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8f59('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8f59('0x2')](0x0);var events={'afterCreate':_0x8f59('0x3'),'afterUpdate':_0x8f59('0x4'),'afterDestroy':_0x8f59('0x5')};function emitEvent(_0x3a1bfe){return function(_0x36f55c,_0x583402,_0x26ba75){VoiceExtensionEvents[_0x8f59('0x6')](_0x3a1bfe+':'+_0x36f55c['id'],_0x36f55c);VoiceExtensionEvents['emit'](_0x3a1bfe,_0x36f55c);_0x26ba75(null);};}for(var e in events){if(events[_0x8f59('0x7')](e)){var event=events[e];VoiceExtension[_0x8f59('0x8')](e,emitEvent(event));}}module[_0x8f59('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x73ed=['emit','hasOwnProperty','hook','VoiceExtension','remove'];(function(_0x17da47,_0x369178){var _0x2be8aa=function(_0xc1aa2f){while(--_0xc1aa2f){_0x17da47['push'](_0x17da47['shift']());}};_0x2be8aa(++_0x369178);}(_0x73ed,0x116));var _0xd73e=function(_0x1abd7c,_0x2f3aac){_0x1abd7c=_0x1abd7c-0x0;var _0x1a730e=_0x73ed[_0x1abd7c];return _0x1a730e;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0xd73e('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd73e('0x1')};function emitEvent(_0x1a4035){return function(_0x344a76,_0x44bc6a,_0x40b1c2){VoiceExtensionEvents[_0xd73e('0x2')](_0x1a4035+':'+_0x344a76['id'],_0x344a76);VoiceExtensionEvents[_0xd73e('0x2')](_0x1a4035,_0x344a76);_0x40b1c2(null);};}for(var e in events){if(events[_0xd73e('0x3')](e)){var event=events[e];VoiceExtension[_0xd73e('0x4')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c52ba38..ac58d0a 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 _0x4e09=['request-promise','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e09,0x102));var _0x94e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e09[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x94e0('0x0'));var util=require(_0x94e0('0x1'));var logger=require(_0x94e0('0x2'))(_0x94e0('0x3'));var moment=require(_0x94e0('0x4'));var BPromise=require(_0x94e0('0x5'));var rp=require(_0x94e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94e0('0x7'));module[_0x94e0('0x8')]=function(_0x317169,_0x1f250b){return _0x317169['define'](_0x94e0('0x9'),attributes,{'tableName':_0x94e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ff=['./voiceExtension.attributes','exports','define','voice_extensions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x480b01,_0x383d61){var _0x29aae8=function(_0x36b82d){while(--_0x36b82d){_0x480b01['push'](_0x480b01['shift']());}};_0x29aae8(++_0x383d61);}(_0x05ff,0x1d8));var _0xf05f=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x05ff[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xf05f('0x0'));var util=require(_0xf05f('0x1'));var logger=require(_0xf05f('0x2'))(_0xf05f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf05f('0x4'));var fs=require('fs');var path=require(_0xf05f('0x5'));var rimraf=require(_0xf05f('0x6'));var config=require(_0xf05f('0x7'));var attributes=require(_0xf05f('0x8'));module[_0xf05f('0x9')]=function(_0x3f558c,_0x563b64){return _0x3f558c[_0xf05f('0xa')]('VoiceExtension',attributes,{'tableName':_0xf05f('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 e26b72b..eefcf8d 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 _0xbf07=['message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xbf07,0x77));var _0x7bf0=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xbf07[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var moment=require(_0x7bf0('0x2'));var BPromise=require(_0x7bf0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf0('0x4'));var db=require(_0x7bf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7bf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7bf0('0x7')]=_['defaults'](config[_0x7bf0('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bf0('0x8'))(new Redis(config[_0x7bf0('0x7')]));require(_0x7bf0('0x9'))[_0x7bf0('0xa')](socket);function respondWithRpcPromise(_0x27ad53,_0x38fb34,_0x59cad0){return new BPromise(function(_0x13d13f,_0x4d0a69){return client[_0x7bf0('0xb')](_0x27ad53,_0x59cad0)[_0x7bf0('0xc')](function(_0x2d39b6){logger[_0x7bf0('0xd')](_0x7bf0('0xe'),_0x38fb34,_0x7bf0('0xf'));logger[_0x7bf0('0x10')](_0x7bf0('0x11'),_0x38fb34,_0x7bf0('0xf'),JSON[_0x7bf0('0x12')](_0x2d39b6));if(_0x2d39b6[_0x7bf0('0x13')]){if(_0x2d39b6[_0x7bf0('0x13')][_0x7bf0('0x14')]===0x1f4){logger[_0x7bf0('0x13')](_0x7bf0('0xe'),_0x38fb34,_0x2d39b6[_0x7bf0('0x13')][_0x7bf0('0x15')]);return _0x4d0a69(_0x2d39b6[_0x7bf0('0x13')][_0x7bf0('0x15')]);}logger[_0x7bf0('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x38fb34,_0x2d39b6[_0x7bf0('0x13')][_0x7bf0('0x15')]);return _0x13d13f(_0x2d39b6[_0x7bf0('0x13')][_0x7bf0('0x15')]);}else{logger[_0x7bf0('0xd')]('VoiceExtension,\x20%s,\x20%s',_0x38fb34,_0x7bf0('0xf'));_0x13d13f(_0x2d39b6[_0x7bf0('0x16')][_0x7bf0('0x15')]);}})[_0x7bf0('0x17')](function(_0x15f9d0){logger[_0x7bf0('0x13')](_0x7bf0('0xe'),_0x38fb34,_0x15f9d0);_0x4d0a69(_0x15f9d0);});});}exports[_0x7bf0('0x18')]=function(_0x2d3aa2){var _0x1cde3b=this;return new Promise(function(_0x5ca332,_0x115f78){return db[_0x7bf0('0x19')][_0x7bf0('0x1a')]({'raw':_0x2d3aa2[_0x7bf0('0x1b')]?_0x2d3aa2[_0x7bf0('0x1b')][_0x7bf0('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d3aa2['options']?_0x2d3aa2['options'][_0x7bf0('0x1d')]||null:null,'attributes':_0x2d3aa2[_0x7bf0('0x1b')]?_0x2d3aa2['options'][_0x7bf0('0x1e')]||null:null,'limit':_0x2d3aa2['options']?_0x2d3aa2[_0x7bf0('0x1b')][_0x7bf0('0x1f')]||null:null,'include':_0x2d3aa2[_0x7bf0('0x1b')]?_0x2d3aa2[_0x7bf0('0x1b')][_0x7bf0('0x20')]?_[_0x7bf0('0x21')](_0x2d3aa2[_0x7bf0('0x1b')][_0x7bf0('0x20')],function(_0x14a98c){return{'model':db[_0x14a98c[_0x7bf0('0x22')]],'as':_0x14a98c['as'],'attributes':_0x14a98c[_0x7bf0('0x1e')],'include':_0x14a98c['include']?_[_0x7bf0('0x21')](_0x14a98c[_0x7bf0('0x20')],function(_0x358efe){return{'model':db[_0x358efe[_0x7bf0('0x22')]],'as':_0x358efe['as'],'attributes':_0x358efe[_0x7bf0('0x1e')],'include':_0x358efe['include']?_[_0x7bf0('0x21')](_0x358efe[_0x7bf0('0x20')],function(_0x4d1b7a){return{'model':db[_0x4d1b7a[_0x7bf0('0x22')]],'as':_0x4d1b7a['as'],'attributes':_0x4d1b7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bf0('0xc')](function(_0x40395b){logger[_0x7bf0('0xd')]('GetVoiceExtension',_0x2d3aa2);logger[_0x7bf0('0x10')](_0x7bf0('0x18'),_0x2d3aa2,JSON[_0x7bf0('0x12')](_0x40395b));_0x5ca332(_0x40395b);})['catch'](function(_0x371611){logger[_0x7bf0('0x13')](_0x7bf0('0x18'),_0x371611[_0x7bf0('0x15')],_0x2d3aa2);_0x115f78(_0x1cde3b['error'](0x1f4,_0x371611[_0x7bf0('0x15')]));});});}; \ No newline at end of file +var _0x16cc=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','info','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2bf6ce,_0x17de7b){var _0x443e18=function(_0x1c6223){while(--_0x1c6223){_0x2bf6ce['push'](_0x2bf6ce['shift']());}};_0x443e18(++_0x17de7b);}(_0x16cc,0x120));var _0xc16c=function(_0x5313b0,_0x6c87a8){_0x5313b0=_0x5313b0-0x0;var _0x475b2=_0x16cc[_0x5313b0];return _0x475b2;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var moment=require(_0xc16c('0x1'));var BPromise=require(_0xc16c('0x2'));var rs=require(_0xc16c('0x3'));var fs=require('fs');var Redis=require(_0xc16c('0x4'));var db=require(_0xc16c('0x5'))['db'];var utils=require(_0xc16c('0x6'));var logger=require('../../config/logger')(_0xc16c('0x7'));var config=require(_0xc16c('0x8'));var jayson=require(_0xc16c('0x9'));var client=jayson[_0xc16c('0xa')]['http']({'port':0x232a});config[_0xc16c('0xb')]=_['defaults'](config[_0xc16c('0xb')],{'host':_0xc16c('0xc'),'port':0x18eb});var socket=require(_0xc16c('0xd'))(new Redis(config[_0xc16c('0xb')]));require('./voiceExtension.socket')[_0xc16c('0xe')](socket);function respondWithRpcPromise(_0x286c40,_0x3f3ff4,_0x462dcf){return new BPromise(function(_0x510afb,_0x2ccba4){return client[_0xc16c('0xf')](_0x286c40,_0x462dcf)[_0xc16c('0x10')](function(_0x4cb366){logger['info'](_0xc16c('0x11'),_0x3f3ff4,_0xc16c('0x12'));logger[_0xc16c('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3f3ff4,'request\x20sent',JSON['stringify'](_0x4cb366));if(_0x4cb366[_0xc16c('0x14')]){if(_0x4cb366[_0xc16c('0x14')][_0xc16c('0x15')]===0x1f4){logger[_0xc16c('0x14')](_0xc16c('0x11'),_0x3f3ff4,_0x4cb366[_0xc16c('0x14')][_0xc16c('0x16')]);return _0x2ccba4(_0x4cb366[_0xc16c('0x14')][_0xc16c('0x16')]);}logger[_0xc16c('0x14')](_0xc16c('0x11'),_0x3f3ff4,_0x4cb366[_0xc16c('0x14')][_0xc16c('0x16')]);return _0x510afb(_0x4cb366[_0xc16c('0x14')][_0xc16c('0x16')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x3f3ff4,_0xc16c('0x12'));_0x510afb(_0x4cb366[_0xc16c('0x17')][_0xc16c('0x16')]);}})[_0xc16c('0x18')](function(_0x432a0a){logger[_0xc16c('0x14')](_0xc16c('0x11'),_0x3f3ff4,_0x432a0a);_0x2ccba4(_0x432a0a);});});}exports[_0xc16c('0x19')]=function(_0x55dc03){var _0x4770d2=this;return new Promise(function(_0x37afc3,_0x121da2){return db[_0xc16c('0x1a')][_0xc16c('0x1b')]({'raw':_0x55dc03[_0xc16c('0x1c')]?_0x55dc03[_0xc16c('0x1c')][_0xc16c('0x1d')]===undefined?!![]:![]:!![],'where':_0x55dc03[_0xc16c('0x1c')]?_0x55dc03[_0xc16c('0x1c')][_0xc16c('0x1e')]||null:null,'attributes':_0x55dc03[_0xc16c('0x1c')]?_0x55dc03[_0xc16c('0x1c')][_0xc16c('0x1f')]||null:null,'limit':_0x55dc03[_0xc16c('0x1c')]?_0x55dc03['options']['limit']||null:null,'include':_0x55dc03[_0xc16c('0x1c')]?_0x55dc03['options'][_0xc16c('0x20')]?_[_0xc16c('0x21')](_0x55dc03['options'][_0xc16c('0x20')],function(_0x4eb194){return{'model':db[_0x4eb194[_0xc16c('0x22')]],'as':_0x4eb194['as'],'attributes':_0x4eb194[_0xc16c('0x1f')],'include':_0x4eb194['include']?_[_0xc16c('0x21')](_0x4eb194[_0xc16c('0x20')],function(_0x323b60){return{'model':db[_0x323b60['model']],'as':_0x323b60['as'],'attributes':_0x323b60[_0xc16c('0x1f')],'include':_0x323b60[_0xc16c('0x20')]?_['map'](_0x323b60[_0xc16c('0x20')],function(_0x1457d4){return{'model':db[_0x1457d4['model']],'as':_0x1457d4['as'],'attributes':_0x1457d4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc16c('0x10')](function(_0x4dd804){logger[_0xc16c('0x23')](_0xc16c('0x19'),_0x55dc03);logger[_0xc16c('0x13')]('GetVoiceExtension',_0x55dc03,JSON[_0xc16c('0x24')](_0x4dd804));_0x37afc3(_0x4dd804);})[_0xc16c('0x18')](function(_0xbe9a46){logger[_0xc16c('0x14')](_0xc16c('0x19'),_0xbe9a46[_0xc16c('0x16')],_0x55dc03);_0x121da2(_0x4770d2[_0xc16c('0x14')](0x1f4,_0xbe9a46[_0xc16c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index f8d86a2..8440deb 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 _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x172dca,_0xda5041){var _0x2a887f=function(_0x1a6aa5){while(--_0x1a6aa5){_0x172dca['push'](_0x172dca['shift']());}};_0x2a887f(++_0xda5041);}(_0x2ef3,0xba));var _0x32ef=function(_0x148e0b,_0x45a323){_0x148e0b=_0x148e0b-0x0;var _0x84ac02=_0x2ef3[_0x148e0b];return _0x84ac02;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x5dcd26,_0x4f57ba){var _0x5b6e9a=function(_0x6fa5b5){while(--_0x6fa5b5){_0x5dcd26['push'](_0x5dcd26['shift']());}};_0x5b6e9a(++_0x4f57ba);}(_0x7a54,0x106));var _0x47a5=function(_0x226bc5,_0x4b16d9){_0x226bc5=_0x226bc5-0x0;var _0x213a91=_0x7a54[_0x226bc5];return _0x213a91;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index b0b6728..0bfef0c 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 _0xafc4=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','/:id/messages','getMessages','post','update'];(function(_0x5316d1,_0x4d48c3){var _0x328308=function(_0x22781a){while(--_0x22781a){_0x5316d1['push'](_0x5316d1['shift']());}};_0x328308(++_0x4d48c3);}(_0xafc4,0x69));var _0x4afc=function(_0x40f5f0,_0x205e2f){_0x40f5f0=_0x40f5f0-0x0;var _0x61c8c1=_0xafc4[_0x40f5f0];return _0x61c8c1;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['show']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')]('/',auth[_0x4afc('0x7')](),controller['create']);router['put'](_0x4afc('0x9'),auth['isAuthenticated'](),controller[_0x4afc('0xd')]);router[_0x4afc('0xe')]('/:id',auth[_0x4afc('0x7')](),controller[_0x4afc('0xf')]);module[_0x4afc('0x10')]=router; \ No newline at end of file +var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x40fd18,_0x438f4b){var _0x24a758=function(_0x1059f3){while(--_0x1059f3){_0x40fd18['push'](_0x40fd18['shift']());}};_0x24a758(++_0x438f4b);}(_0x7880,0x1f4));var _0x0788=function(_0x355535,_0x1e2607){_0x355535=_0x355535-0x0;var _0x2a4242=_0x7880[_0x355535];return _0x2a4242;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ed9a37c..c3b3250 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 _0x22a1=['TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim','ENUM','yes'];(function(_0x315bbf,_0x260154){var _0x29021a=function(_0x57e302){while(--_0x57e302){_0x315bbf['push'](_0x315bbf['shift']());}};_0x29021a(++_0x260154);}(_0x22a1,0x8d));var _0x122a=function(_0x5db2cc,_0x1a7542){_0x5db2cc=_0x5db2cc-0x0;var _0x105f79=_0x22a1[_0x5db2cc];return _0x105f79;};'use strict';var Sequelize=require(_0x122a('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x122a('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x122a('0x2')},'mailbox':{'type':Sequelize[_0x122a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x122a('0x2')},'password':{'type':Sequelize[_0x122a('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xbdc212){this[_0x122a('0x3')](_0x122a('0x4'),typeof _0xbdc212===_0x122a('0x5')&&_0xbdc212['trim']()?_0xbdc212[_0x122a('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x122a('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':_0x122a('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':_0x122a('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x122a('0x1')]},'callback':{'type':Sequelize[_0x122a('0x1')]},'review':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x122a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x122a('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x122a('0x7')](_0x122a('0x8'),'no'),'defaultValue':_0x122a('0x8'),'allowNull':![]},'stamp':{'type':_0x122a('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x122a('0x1')]},'maxsecs':{'type':Sequelize[_0x122a('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x122a('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x122a('0xb'))+_0x122a('0xc')+this[_0x122a('0xd')](_0x122a('0xe'));}}}; \ No newline at end of file +var _0x8e3c=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','trim'];(function(_0x1a7109,_0x4e9d4d){var _0x24b554=function(_0x39bd8b){while(--_0x39bd8b){_0x1a7109['push'](_0x1a7109['shift']());}};_0x24b554(++_0x4e9d4d);}(_0x8e3c,0x13c));var _0xc8e3=function(_0xbb7e1a,_0x2b103f){_0xbb7e1a=_0xbb7e1a-0x0;var _0x5b9751=_0x8e3c[_0xbb7e1a];return _0x5b9751;};'use strict';var Sequelize=require(_0xc8e3('0x0'));module[_0xc8e3('0x1')]={'customer_id':{'type':Sequelize[_0xc8e3('0x2')]},'context':{'type':Sequelize[_0xc8e3('0x2')],'defaultValue':_0xc8e3('0x3'),'unique':_0xc8e3('0x4')},'mailbox':{'type':Sequelize[_0xc8e3('0x2')],'defaultValue':'','allowNull':![],'unique':_0xc8e3('0x4')},'password':{'type':Sequelize[_0xc8e3('0x2')]},'fullname':{'type':Sequelize[_0xc8e3('0x2')]},'email':{'type':Sequelize[_0xc8e3('0x2')],'validate':{'isEmail':!![]},'set':function(_0x3a3baa){this[_0xc8e3('0x5')]('email',typeof _0x3a3baa==='string'&&_0x3a3baa[_0xc8e3('0x6')]()?_0x3a3baa[_0xc8e3('0x6')]():null);}},'pager':{'type':Sequelize[_0xc8e3('0x2')]},'tz':{'type':Sequelize[_0xc8e3('0x2')],'defaultValue':_0xc8e3('0x7')},'attach':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':_0xc8e3('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc8e3('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc8e3('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc8e3('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':_0xc8e3('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc8e3('0x8')](_0xc8e3('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc8e3('0x8')]('yes','no'),'defaultValue':_0xc8e3('0x9'),'allowNull':![]},'stamp':{'type':_0xc8e3('0xb')},'emailsubject':{'type':Sequelize[_0xc8e3('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xc8e3('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc8e3('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc8e3('0xd')],'get':function(){return this[_0xc8e3('0xe')](_0xc8e3('0xf'))+'\x20-\x20'+this[_0xc8e3('0xe')](_0xc8e3('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f9d3930..c027ded 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 _0x5eb8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','VoiceMail','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','VoiceMailMessage','pick','filter','mailbox'];(function(_0x545a86,_0x278f09){var _0x10bcc6=function(_0x2ce788){while(--_0x2ce788){_0x545a86['push'](_0x545a86['shift']());}};_0x10bcc6(++_0x278f09);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x5eb8[_0x1b5080];return _0x195c87;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['VoiceMail'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['VoiceMail']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['VoiceMail'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))[_0x85eb('0x47')](handleError(_0x214ef7,null));};exports['getMessages']=function(_0x152452,_0x2a0f8b,_0x4a3af9){return db[_0x85eb('0x44')]['findOne']({'where':{'id':_0x152452[_0x85eb('0x49')]['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x2a0f8b,null))[_0x85eb('0x26')](function(_0x13c0b3){var _0x45a201;var _0x15d4a7={},_0x5a729e={};_0x5a729e[_0x85eb('0x33')]=_[_0x85eb('0x35')](db[_0x85eb('0x54')][_0x85eb('0x30')]);_0x5a729e[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x152452[_0x85eb('0x34')]);_0x5a729e[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],_0x5a729e[_0x85eb('0x34')]);_0x15d4a7['attributes']=_[_0x85eb('0x37')](_0x5a729e[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x152452[_0x85eb('0x34')][_0x85eb('0x39')]));_0x15d4a7[_0x85eb('0x38')]=_0x15d4a7['attributes'][_0x85eb('0x3a')]?_0x15d4a7['attributes']:_0x5a729e[_0x85eb('0x33')];if(!_0x152452[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0x15d4a7[_0x85eb('0x1e')]=qs['limit'](_0x152452[_0x85eb('0x34')][_0x85eb('0x1e')]);_0x15d4a7[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x152452[_0x85eb('0x34')][_0x85eb('0x1c')]);}_0x15d4a7[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x152452['query'][_0x85eb('0x3e')]);_0x15d4a7['where']=qs[_0x85eb('0x36')](_[_0x85eb('0x55')](_0x152452[_0x85eb('0x34')],_0x5a729e[_0x85eb('0x36')]));if(_0x152452[_0x85eb('0x34')]['filter']){_0x15d4a7[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'$or':_[_0x85eb('0x2f')](_0x15d4a7[_0x85eb('0x38')],function(_0x419b24){var _0x562ffa={};_0x562ffa[_0x419b24]={'$like':'%'+_0x152452['query'][_0x85eb('0x56')]+'%'};return _0x562ffa;})});}_0x15d4a7['where']=_[_0x85eb('0x40')](_0x15d4a7[_0x85eb('0x3f')],{'mailboxuser':_0x13c0b3[_0x85eb('0x57')]});_0x15d4a7=_[_0x85eb('0x40')]({},_0x15d4a7,_0x152452[_0x85eb('0x4a')]);return db[_0x85eb('0x54')]['findAndCountAll'](_0x15d4a7)[_0x85eb('0x26')](respondWithFilteredResult(_0x2a0f8b,_0x15d4a7));})[_0x85eb('0x47')](handleError(_0x2a0f8b,null));}; \ No newline at end of file +var _0x1339=['../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VoiceMail','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','VoiceMailMessage','pick','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1339,0x1ed));var _0x9133=function(_0x21f406,_0x1afbcf){_0x21f406=_0x21f406-0x0;var _0x2711d7=_0x1339[_0x21f406];return _0x2711d7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){var _0x187e32=_0x4f26e8[_0x9133('0x22')]({'plain':!![]});var _0x3f278d=_0x9133('0x23');return db[_0x9133('0x24')][_0x9133('0x21')]({'where':{'type':_0x3f278d,'resourceId':_0x187e32['id']}})[_0x9133('0x20')](function(){return _0x4f26e8;});})[_0x9133('0x20')](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x25')]();});}};}function handleEntityNotFound(_0x51de62,_0x517e7b){return function(_0x477bf1){if(!_0x477bf1){_0x51de62[_0x9133('0x26')](0x194);}return _0x477bf1;};}function handleError(_0x428e18,_0x348486){_0x348486=_0x348486||0x1f4;return function(_0x4de894){logger['error'](_0x4de894[_0x9133('0x27')]);if(_0x4de894[_0x9133('0x28')]){delete _0x4de894[_0x9133('0x28')];}_0x428e18[_0x9133('0x1a')](_0x348486)[_0x9133('0x29')](_0x4de894);};}exports[_0x9133('0x2a')]=function(_0x48c713,_0x58afe0){var _0x5a27c1={},_0x1ad222={},_0x4a4a8e={'count':0x0,'rows':[]};var _0x43b5f3=_[_0x9133('0x2b')](db['VoiceMail'][_0x9133('0x2c')],function(_0x5dd90b){return{'name':_0x5dd90b[_0x9133('0x2d')],'type':_0x5dd90b[_0x9133('0x2e')][_0x9133('0x2f')]};});_0x1ad222['model']=_[_0x9133('0x2b')](_0x43b5f3,_0x9133('0x28'));_0x1ad222[_0x9133('0x30')]=_['keys'](_0x48c713[_0x9133('0x30')]);_0x1ad222[_0x9133('0x31')]=_[_0x9133('0x32')](_0x1ad222['model'],_0x1ad222[_0x9133('0x30')]);_0x5a27c1[_0x9133('0x33')]=_[_0x9133('0x32')](_0x1ad222[_0x9133('0x34')],qs['fields'](_0x48c713[_0x9133('0x30')][_0x9133('0x35')]));_0x5a27c1['attributes']=_0x5a27c1[_0x9133('0x33')][_0x9133('0x36')]?_0x5a27c1[_0x9133('0x33')]:_0x1ad222[_0x9133('0x34')];if(!_0x48c713[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x5a27c1[_0x9133('0x1d')]=qs[_0x9133('0x1d')](_0x48c713[_0x9133('0x30')][_0x9133('0x1d')]);_0x5a27c1['offset']=qs[_0x9133('0x1e')](_0x48c713[_0x9133('0x30')]['offset']);}_0x5a27c1[_0x9133('0x39')]=qs[_0x9133('0x3a')](_0x48c713[_0x9133('0x30')][_0x9133('0x3a')]);_0x5a27c1[_0x9133('0x3b')]=qs[_0x9133('0x31')](_['pick'](_0x48c713['query'],_0x1ad222[_0x9133('0x31')]),_0x43b5f3);if(_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]){_0x5a27c1[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x5a27c1[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x43b5f3,function(_0x2ee83e){if(_0x2ee83e[_0x9133('0x2e')]!=='VIRTUAL'){var _0xafd8f9={};_0xafd8f9[_0x2ee83e[_0x9133('0x28')]]={'$like':'%'+_0x48c713[_0x9133('0x30')][_0x9133('0x3c')]+'%'};return _0xafd8f9;}})});}_0x5a27c1=_[_0x9133('0x3d')]({},_0x5a27c1,_0x48c713['options']);var _0x3c691e={'where':_0x5a27c1[_0x9133('0x3b')]};return db[_0x9133('0x3e')][_0x9133('0x3f')](_0x3c691e)['then'](function(_0x146734){_0x4a4a8e[_0x9133('0x3f')]=_0x146734;if(_0x48c713[_0x9133('0x30')][_0x9133('0x40')]){_0x5a27c1[_0x9133('0x41')]=[{'all':!![]}];}return db[_0x9133('0x3e')][_0x9133('0x42')](_0x5a27c1);})['then'](function(_0x7f6cd9){_0x4a4a8e['rows']=_0x7f6cd9;return _0x4a4a8e;})['then'](respondWithFilteredResult(_0x58afe0,_0x5a27c1))[_0x9133('0x43')](handleError(_0x58afe0,null));};exports[_0x9133('0x44')]=function(_0x46156d,_0x264df4){var _0xdd485f={'raw':!![],'where':{'id':_0x46156d[_0x9133('0x45')]['id']}},_0x2d2bf7={};_0x2d2bf7[_0x9133('0x34')]=_[_0x9133('0x46')](db['VoiceMail'][_0x9133('0x2c')]);_0x2d2bf7[_0x9133('0x30')]=_[_0x9133('0x46')](_0x46156d['query']);_0x2d2bf7['filters']=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],_0x2d2bf7['query']);_0xdd485f[_0x9133('0x33')]=_[_0x9133('0x32')](_0x2d2bf7[_0x9133('0x34')],qs[_0x9133('0x35')](_0x46156d[_0x9133('0x30')]['fields']));_0xdd485f[_0x9133('0x33')]=_0xdd485f[_0x9133('0x33')][_0x9133('0x36')]?_0xdd485f['attributes']:_0x2d2bf7[_0x9133('0x34')];if(_0x46156d[_0x9133('0x30')]['includeAll']){_0xdd485f['include']=[{'all':!![]}];}_0xdd485f=_[_0x9133('0x3d')]({},_0xdd485f,_0x46156d[_0x9133('0x47')]);return db[_0x9133('0x3e')][_0x9133('0x48')](_0xdd485f)[_0x9133('0x20')](handleEntityNotFound(_0x264df4,null))[_0x9133('0x20')](respondWithResult(_0x264df4,null))[_0x9133('0x43')](handleError(_0x264df4,null));};exports[_0x9133('0x49')]=function(_0x23f134,_0xf07fbb){return db[_0x9133('0x3e')][_0x9133('0x49')](_0x23f134['body'],{})['then'](function(_0xf2e098){var _0x4dc2f3=_0x23f134[_0x9133('0x4a')][_0x9133('0x22')]({'plain':!![]});if(!_0x4dc2f3)throw new Error(_0x9133('0x4b'));if(_0x4dc2f3[_0x9133('0x4c')]==='user'){var _0x2a3848=_0xf2e098[_0x9133('0x22')]({'plain':!![]});var _0x799772='Voicemails';return db[_0x9133('0x4d')][_0x9133('0x48')]({'where':{'name':_0x799772,'userProfileId':_0x4dc2f3[_0x9133('0x4e')]},'raw':!![]})['then'](function(_0x14c825){if(_0x14c825&&_0x14c825['autoAssociation']===0x0){return db[_0x9133('0x24')][_0x9133('0x49')]({'name':_0x2a3848[_0x9133('0x28')],'resourceId':_0x2a3848['id'],'type':_0x14c825[_0x9133('0x28')],'sectionId':_0x14c825['id']},{})['then'](function(){return _0xf2e098;});}else{return _0xf2e098;}})['catch'](function(_0x2f09f6){logger[_0x9133('0x4f')](_0x9133('0x50'),_0x2f09f6);throw _0x2f09f6;});}return _0xf2e098;})[_0x9133('0x20')](respondWithResult(_0xf07fbb,0xc9))[_0x9133('0x43')](handleError(_0xf07fbb,null));};exports['update']=function(_0x554bb9,_0x33599b){if(_0x554bb9[_0x9133('0x51')]['id']){delete _0x554bb9['body']['id'];}return db[_0x9133('0x3e')][_0x9133('0x48')]({'where':{'id':_0x554bb9['params']['id']}})['then'](handleEntityNotFound(_0x33599b,null))['then'](saveUpdates(_0x554bb9[_0x9133('0x51')],null))['then'](respondWithResult(_0x33599b,null))[_0x9133('0x43')](handleError(_0x33599b,null));};exports[_0x9133('0x21')]=function(_0x439258,_0x3d6daa){return db['VoiceMail'][_0x9133('0x48')]({'where':{'id':_0x439258['params']['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3d6daa,null))[_0x9133('0x20')](removeEntity(_0x3d6daa,null))[_0x9133('0x43')](handleError(_0x3d6daa,null));};exports[_0x9133('0x52')]=function(_0x3b9927,_0x3534bf,_0x56861c){return db['VoiceMail']['findOne']({'where':{'id':_0x3b9927[_0x9133('0x45')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x3534bf,null))[_0x9133('0x20')](function(_0x54a330){var _0x3f4cd7;var _0x1f6684={},_0x415d55={};_0x415d55[_0x9133('0x34')]=_[_0x9133('0x46')](db[_0x9133('0x53')][_0x9133('0x2c')]);_0x415d55[_0x9133('0x30')]=_['keys'](_0x3b9927[_0x9133('0x30')]);_0x415d55['filters']=_[_0x9133('0x32')](_0x415d55['model'],_0x415d55[_0x9133('0x30')]);_0x1f6684[_0x9133('0x33')]=_['intersection'](_0x415d55['model'],qs[_0x9133('0x35')](_0x3b9927[_0x9133('0x30')][_0x9133('0x35')]));_0x1f6684[_0x9133('0x33')]=_0x1f6684[_0x9133('0x33')][_0x9133('0x36')]?_0x1f6684[_0x9133('0x33')]:_0x415d55[_0x9133('0x34')];if(!_0x3b9927[_0x9133('0x30')][_0x9133('0x37')](_0x9133('0x38'))){_0x1f6684['limit']=qs[_0x9133('0x1d')](_0x3b9927['query'][_0x9133('0x1d')]);_0x1f6684[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x3b9927[_0x9133('0x30')][_0x9133('0x1e')]);}_0x1f6684['order']=qs[_0x9133('0x3a')](_0x3b9927[_0x9133('0x30')][_0x9133('0x3a')]);_0x1f6684[_0x9133('0x3b')]=qs['filters'](_[_0x9133('0x54')](_0x3b9927[_0x9133('0x30')],_0x415d55[_0x9133('0x31')]));if(_0x3b9927[_0x9133('0x30')]['filter']){_0x1f6684['where']=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'$or':_[_0x9133('0x2b')](_0x1f6684[_0x9133('0x33')],function(_0x28cc46){var _0x2cfaf8={};_0x2cfaf8[_0x28cc46]={'$like':'%'+_0x3b9927['query'][_0x9133('0x3c')]+'%'};return _0x2cfaf8;})});}_0x1f6684[_0x9133('0x3b')]=_[_0x9133('0x3d')](_0x1f6684[_0x9133('0x3b')],{'mailboxuser':_0x54a330['mailbox']});_0x1f6684=_[_0x9133('0x3d')]({},_0x1f6684,_0x3b9927['options']);return db[_0x9133('0x53')][_0x9133('0x55')](_0x1f6684)[_0x9133('0x20')](respondWithFilteredResult(_0x3534bf,_0x1f6684));})[_0x9133('0x43')](handleError(_0x3534bf,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 014a673..b99cc70 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 _0xd435=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_voicemail','lodash'];(function(_0x307fe9,_0x5b4818){var _0x432458=function(_0xfbaf9f){while(--_0xfbaf9f){_0x307fe9['push'](_0x307fe9['shift']());}};_0x432458(++_0x5b4818);}(_0xd435,0xe3));var _0x5d43=function(_0x485659,_0x4045d1){_0x485659=_0x485659-0x0;var _0x4f408c=_0xd435[_0x485659];return _0x4f408c;};'use strict';var _=require(_0x5d43('0x0'));var util=require(_0x5d43('0x1'));var logger=require(_0x5d43('0x2'))('api');var moment=require(_0x5d43('0x3'));var BPromise=require(_0x5d43('0x4'));var rp=require(_0x5d43('0x5'));var fs=require('fs');var path=require(_0x5d43('0x6'));var rimraf=require(_0x5d43('0x7'));var config=require(_0x5d43('0x8'));var attributes=require('./voiceMail.attributes');module[_0x5d43('0x9')]=function(_0x4630ca,_0x4925dc){return _0x4630ca[_0x5d43('0xa')]('VoiceMail',attributes,{'tableName':_0x5d43('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb8e4=['path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','moment','request-promise'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xb8e4,0x183));var _0x4b8e=function(_0x36930f,_0x26faab){_0x36930f=_0x36930f-0x0;var _0x548c8e=_0xb8e4[_0x36930f];return _0x548c8e;};'use strict';var _=require('lodash');var util=require(_0x4b8e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4b8e('0x1'));var BPromise=require('bluebird');var rp=require(_0x4b8e('0x2'));var fs=require('fs');var path=require(_0x4b8e('0x3'));var rimraf=require(_0x4b8e('0x4'));var config=require(_0x4b8e('0x5'));var attributes=require(_0x4b8e('0x6'));module['exports']=function(_0x1692b4,_0x30b9e3){return _0x1692b4[_0x4b8e('0x7')](_0x4b8e('0x8'),attributes,{'tableName':_0x4b8e('0x9'),'paranoid':![],'indexes':[{'name':_0x4b8e('0xa'),'fields':[_0x4b8e('0xb'),_0x4b8e('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 9712f19..20e0baa 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 _0x7012=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','info','result'];(function(_0x2c550e,_0x553704){var _0x113e30=function(_0x5cc3cb){while(--_0x5cc3cb){_0x2c550e['push'](_0x2c550e['shift']());}};_0x113e30(++_0x553704);}(_0x7012,0xe7));var _0x2701=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7012[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x2701('0x0'));var util=require(_0x2701('0x1'));var moment=require(_0x2701('0x2'));var BPromise=require('bluebird');var rs=require(_0x2701('0x3'));var fs=require('fs');var Redis=require(_0x2701('0x4'));var db=require(_0x2701('0x5'))['db'];var utils=require(_0x2701('0x6'));var logger=require(_0x2701('0x7'))('rpc');var config=require(_0x2701('0x8'));var jayson=require(_0x2701('0x9'));var client=jayson['client'][_0x2701('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4464df,_0x1d9ea1,_0x2f65c4){return new BPromise(function(_0xf9fa37,_0x504a8d){return client[_0x2701('0xb')](_0x4464df,_0x2f65c4)['then'](function(_0x53e088){logger['info']('VoiceMail,\x20%s,\x20%s',_0x1d9ea1,_0x2701('0xc'));logger[_0x2701('0xd')](_0x2701('0xe'),_0x1d9ea1,_0x2701('0xc'),JSON[_0x2701('0xf')](_0x53e088));if(_0x53e088['error']){if(_0x53e088[_0x2701('0x10')][_0x2701('0x11')]===0x1f4){logger['error'](_0x2701('0x12'),_0x1d9ea1,_0x53e088[_0x2701('0x10')][_0x2701('0x13')]);return _0x504a8d(_0x53e088['error'][_0x2701('0x13')]);}logger['error'](_0x2701('0x12'),_0x1d9ea1,_0x53e088['error'][_0x2701('0x13')]);return _0xf9fa37(_0x53e088[_0x2701('0x10')][_0x2701('0x13')]);}else{logger[_0x2701('0x14')](_0x2701('0x12'),_0x1d9ea1,_0x2701('0xc'));_0xf9fa37(_0x53e088[_0x2701('0x15')][_0x2701('0x13')]);}})[_0x2701('0x16')](function(_0x4138e5){logger[_0x2701('0x10')](_0x2701('0x12'),_0x1d9ea1,_0x4138e5);_0x504a8d(_0x4138e5);});});} \ No newline at end of file +var _0x816b=['jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0x816b,0x19b));var _0xb816=function(_0x12a222,_0x38b785){_0x12a222=_0x12a222-0x0;var _0x432e76=_0x816b[_0x12a222];return _0x432e76;};'use strict';var _=require(_0xb816('0x0'));var util=require(_0xb816('0x1'));var moment=require(_0xb816('0x2'));var BPromise=require(_0xb816('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb816('0x4'));var db=require(_0xb816('0x5'))['db'];var utils=require(_0xb816('0x6'));var logger=require(_0xb816('0x7'))(_0xb816('0x8'));var config=require('../../config/environment');var jayson=require(_0xb816('0x9'));var client=jayson[_0xb816('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b6aaf,_0x27c14b,_0x2b182c){return new BPromise(function(_0x18ce1b,_0x402c06){return client[_0xb816('0xb')](_0x2b6aaf,_0x2b182c)[_0xb816('0xc')](function(_0x669a71){logger[_0xb816('0xd')](_0xb816('0xe'),_0x27c14b,_0xb816('0xf'));logger[_0xb816('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x27c14b,'request\x20sent',JSON['stringify'](_0x669a71));if(_0x669a71[_0xb816('0x11')]){if(_0x669a71[_0xb816('0x11')]['code']===0x1f4){logger[_0xb816('0x11')]('VoiceMail,\x20%s,\x20%s',_0x27c14b,_0x669a71[_0xb816('0x11')][_0xb816('0x12')]);return _0x402c06(_0x669a71['error']['message']);}logger[_0xb816('0x11')]('VoiceMail,\x20%s,\x20%s',_0x27c14b,_0x669a71[_0xb816('0x11')][_0xb816('0x12')]);return _0x18ce1b(_0x669a71[_0xb816('0x11')][_0xb816('0x12')]);}else{logger[_0xb816('0xd')](_0xb816('0xe'),_0x27c14b,_0xb816('0xf'));_0x18ce1b(_0x669a71[_0xb816('0x13')]['message']);}})[_0xb816('0x14')](function(_0x153701){logger[_0xb816('0x11')](_0xb816('0xe'),_0x27c14b,_0x153701);_0x402c06(_0x153701);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 0d0b137..b5f7005 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 _0xa93a=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','update','delete','destroy'];(function(_0x23507f,_0x16038b){var _0x59c7df=function(_0x1908e0){while(--_0x1908e0){_0x23507f['push'](_0x23507f['shift']());}};_0x59c7df(++_0x16038b);}(_0xa93a,0x112));var _0xaa93=function(_0x26e5ea,_0x5cef83){_0x26e5ea=_0x26e5ea-0x0;var _0x384e77=_0xa93a[_0x26e5ea];return _0x384e77;};'use strict';var multer=require(_0xaa93('0x0'));var util=require(_0xaa93('0x1'));var path=require(_0xaa93('0x2'));var timeout=require(_0xaa93('0x3'));var express=require(_0xaa93('0x4'));var router=express[_0xaa93('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaa93('0x6'));var config=require(_0xaa93('0x7'));var controller=require(_0xaa93('0x8'));router[_0xaa93('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa93('0xa')]);router[_0xaa93('0x9')](_0xaa93('0xb'),auth['isAuthenticated'](),controller[_0xaa93('0xc')]);router[_0xaa93('0x9')](_0xaa93('0xd'),auth[_0xaa93('0xe')](),controller[_0xaa93('0xf')]);router[_0xaa93('0x10')]('/',auth[_0xaa93('0xe')](),controller['create']);router['put'](_0xaa93('0xb'),auth[_0xaa93('0xe')](),controller[_0xaa93('0x11')]);router[_0xaa93('0x12')](_0xaa93('0xb'),auth[_0xaa93('0xe')](),controller[_0xaa93('0x13')]);module[_0xaa93('0x14')]=router; \ No newline at end of file +var _0x1c83=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','index','/:id','isAuthenticated','show','/:id/download','put','update','delete'];(function(_0x4c2788,_0x5e12e7){var _0x15ad78=function(_0x3ca821){while(--_0x3ca821){_0x4c2788['push'](_0x4c2788['shift']());}};_0x15ad78(++_0x5e12e7);}(_0x1c83,0xa3));var _0x31c8=function(_0x5dd12a,_0x4bf890){_0x5dd12a=_0x5dd12a-0x0;var _0x65572d=_0x1c83[_0x5dd12a];return _0x65572d;};'use strict';var multer=require(_0x31c8('0x0'));var util=require(_0x31c8('0x1'));var path=require('path');var timeout=require(_0x31c8('0x2'));var express=require(_0x31c8('0x3'));var router=express[_0x31c8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31c8('0x5'));var interaction=require(_0x31c8('0x6'));var config=require(_0x31c8('0x7'));var controller=require(_0x31c8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x31c8('0x9')]);router['get'](_0x31c8('0xa'),auth[_0x31c8('0xb')](),controller[_0x31c8('0xc')]);router['get'](_0x31c8('0xd'),auth[_0x31c8('0xb')](),controller['download']);router['post']('/',auth[_0x31c8('0xb')](),controller['create']);router[_0x31c8('0xe')]('/:id',auth[_0x31c8('0xb')](),controller[_0x31c8('0xf')]);router[_0x31c8('0x10')]('/:id',auth[_0x31c8('0xb')](),controller['destroy']);module[_0x31c8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ae7abf1..9ea0f6c 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 _0xdccc=['exports','VIRTUAL','getDataValue','STRING','long','TIMESTAMP','sequelize'];(function(_0x49c046,_0x86503b){var _0x5f5562=function(_0x49ae42){while(--_0x49ae42){_0x49c046['push'](_0x49c046['shift']());}};_0x5f5562(++_0x86503b);}(_0xdccc,0x1cd));var _0xcdcc=function(_0x3a8b23,_0x327776){_0x3a8b23=_0x3a8b23-0x0;var _0xa834c4=_0xdccc[_0x3a8b23];return _0xa834c4;};'use strict';var Sequelize=require(_0xcdcc('0x0'));module[_0xcdcc('0x1')]={'name':{'type':Sequelize[_0xcdcc('0x2')],'get':function(_0x803795){return this[_0xcdcc('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xcdcc('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xcdcc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xcdcc('0x6'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xd790=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xd790,0x1c2));var _0x0d79=function(_0x3a0ff8,_0x3241c2){_0x3a0ff8=_0x3a0ff8-0x0;var _0x59f33a=_0xd790[_0x3a0ff8];return _0x59f33a;};'use strict';var Sequelize=require(_0x0d79('0x0'));module[_0x0d79('0x1')]={'name':{'type':Sequelize[_0x0d79('0x2')],'get':function(_0x21f5ad){return this[_0x0d79('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x0d79('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x0d79('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0d79('0x5')],'defaultValue':''},'stamp':{'type':_0x0d79('0x7'),'defaultValue':Sequelize[_0x0d79('0x8')](_0x0d79('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index aeabd04..27b4611 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 _0xa053=['Content-Range','apply','reject','save','update','then','destroy','end','stack','name','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','filters','intersection','fields','attributes','length','model','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set'];(function(_0x4bc43a,_0x12bb15){var _0x42124d=function(_0x56c468){while(--_0x56c468){_0x4bc43a['push'](_0x4bc43a['shift']());}};_0x42124d(++_0x12bb15);}(_0xa053,0x131));var _0x3a05=function(_0x4ff8b4,_0xc41b9){_0x4ff8b4=_0x4ff8b4-0x0;var _0x1d78c4=_0xa053[_0x4ff8b4];return _0x1d78c4;};'use strict';var emlformat=require(_0x3a05('0x0'));var rimraf=require(_0x3a05('0x1'));var zipdir=require(_0x3a05('0x2'));var jsonpatch=require(_0x3a05('0x3'));var rp=require('request-promise');var moment=require(_0x3a05('0x4'));var BPromise=require(_0x3a05('0x5'));var Mustache=require(_0x3a05('0x6'));var util=require(_0x3a05('0x7'));var path=require('path');var sox=require(_0x3a05('0x8'));var csv=require(_0x3a05('0x9'));var ejs=require(_0x3a05('0xa'));var fs=require('fs');var fs_extra=require(_0x3a05('0xb'));var _=require('lodash');var squel=require(_0x3a05('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a05('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a05('0x9'));var querystring=require('querystring');var Papa=require(_0x3a05('0xe'));var Redis=require(_0x3a05('0xf'));var authService=require(_0x3a05('0x10'));var qs=require(_0x3a05('0x11'));var as=require(_0x3a05('0x12'));var hardwareService=require(_0x3a05('0x13'));var logger=require('../../config/logger')(_0x3a05('0x14'));var utils=require(_0x3a05('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3a05('0x16'));var db=require(_0x3a05('0x17'))['db'];function respondWithStatusCode(_0x4f610f,_0xa6f14f){_0xa6f14f=_0xa6f14f||0xcc;return function(_0x503343){if(_0x503343){return _0x4f610f[_0x3a05('0x18')](_0xa6f14f);}return _0x4f610f[_0x3a05('0x19')](_0xa6f14f)['end']();};}function respondWithResult(_0x571071,_0xa1ce38){_0xa1ce38=_0xa1ce38||0xc8;return function(_0x1e755f){if(_0x1e755f){return _0x571071[_0x3a05('0x19')](_0xa1ce38)[_0x3a05('0x1a')](_0x1e755f);}};}function respondWithFilteredResult(_0x184816,_0x4fa094){return function(_0x20c172){if(_0x20c172){var _0x4c1390=typeof _0x4fa094['offset']===_0x3a05('0x1b')&&typeof _0x4fa094[_0x3a05('0x1c')]==='undefined';var _0x5c135c=_0x20c172['count'];var _0x427a37=_0x4c1390?0x0:_0x4fa094[_0x3a05('0x1d')];var _0x51cb5a=_0x4c1390?_0x20c172['count']:_0x4fa094[_0x3a05('0x1d')]+_0x4fa094['limit'];var _0x1bac3e;if(_0x51cb5a>=_0x5c135c){_0x51cb5a=_0x5c135c;_0x1bac3e=0xc8;}else{_0x1bac3e=0xce;}_0x184816[_0x3a05('0x19')](_0x1bac3e);return _0x184816[_0x3a05('0x1e')](_0x3a05('0x1f'),_0x427a37+'-'+_0x51cb5a+'/'+_0x5c135c)['json'](_0x20c172);}return null;};}function patchUpdates(_0x33869b){return function(_0x34eb06){try{jsonpatch[_0x3a05('0x20')](_0x34eb06,_0x33869b,!![]);}catch(_0x67c5a){return BPromise[_0x3a05('0x21')](_0x67c5a);}return _0x34eb06[_0x3a05('0x22')]();};}function saveUpdates(_0x1784a3,_0x4349a8){return function(_0x21d9d2){if(_0x21d9d2){return _0x21d9d2[_0x3a05('0x23')](_0x1784a3)[_0x3a05('0x24')](function(_0x28963f){return _0x28963f;});}return null;};}function removeEntity(_0x329896,_0x1a3281){return function(_0x364477){if(_0x364477){return _0x364477[_0x3a05('0x25')]()[_0x3a05('0x24')](function(){_0x329896[_0x3a05('0x19')](0xcc)[_0x3a05('0x26')]();});}};}function handleEntityNotFound(_0x255964,_0x4dae01){return function(_0x427785){if(!_0x427785){_0x255964[_0x3a05('0x18')](0x194);}return _0x427785;};}function handleError(_0x46e239,_0x37b404){_0x37b404=_0x37b404||0x1f4;return function(_0x2aad97){logger['error'](_0x2aad97[_0x3a05('0x27')]);if(_0x2aad97[_0x3a05('0x28')]){delete _0x2aad97[_0x3a05('0x28')];}_0x46e239[_0x3a05('0x19')](_0x37b404)['send'](_0x2aad97);};}exports['index']=function(_0x56c49a,_0x6624e8){var _0xb4f2e6={},_0x3f09de={},_0x270ef1={'count':0x0,'rows':[]};var _0x438057=_[_0x3a05('0x29')](db[_0x3a05('0x2a')]['rawAttributes'],function(_0x31f9af){return{'name':_0x31f9af[_0x3a05('0x2b')],'type':_0x31f9af[_0x3a05('0x2c')][_0x3a05('0x2d')]};});_0x3f09de['model']=_[_0x3a05('0x2e')](_[_0x3a05('0x29')](_0x438057,_0x3a05('0x28')),[_0x3a05('0x28')]);_0x3f09de[_0x3a05('0x2f')]=_[_0x3a05('0x30')](_0x56c49a[_0x3a05('0x2f')]);_0x3f09de[_0x3a05('0x31')]=_[_0x3a05('0x32')](_0x3f09de['model'],_0x3f09de[_0x3a05('0x2f')]);_0xb4f2e6['attributes']=_['intersection'](_0x3f09de['model'],qs[_0x3a05('0x33')](_0x56c49a[_0x3a05('0x2f')][_0x3a05('0x33')]));_0xb4f2e6[_0x3a05('0x34')]=_0xb4f2e6[_0x3a05('0x34')][_0x3a05('0x35')]?_0xb4f2e6[_0x3a05('0x34')]:_0x3f09de[_0x3a05('0x36')];if(!_0x56c49a[_0x3a05('0x2f')]['hasOwnProperty'](_0x3a05('0x37'))){_0xb4f2e6[_0x3a05('0x1c')]=qs['limit'](_0x56c49a[_0x3a05('0x2f')][_0x3a05('0x1c')]);_0xb4f2e6[_0x3a05('0x1d')]=qs['offset'](_0x56c49a[_0x3a05('0x2f')]['offset']);}_0xb4f2e6[_0x3a05('0x38')]=qs[_0x3a05('0x39')](_0x56c49a[_0x3a05('0x2f')][_0x3a05('0x39')]);_0xb4f2e6[_0x3a05('0x3a')]=qs['filters'](_[_0x3a05('0x3b')](_0x56c49a['query'],_0x3f09de[_0x3a05('0x31')]),_0x438057);if(_0x56c49a[_0x3a05('0x2f')][_0x3a05('0x3c')]){_0xb4f2e6[_0x3a05('0x3a')]=_['merge'](_0xb4f2e6[_0x3a05('0x3a')],{'$or':_[_0x3a05('0x29')](_0x438057,function(_0x10ecba){if(_0x10ecba[_0x3a05('0x2c')]!=='VIRTUAL'){var _0x4e1fe7={};_0x4e1fe7[_0x10ecba[_0x3a05('0x28')]]={'$like':'%'+_0x56c49a[_0x3a05('0x2f')]['filter']+'%'};return _0x4e1fe7;}})});}_0xb4f2e6=_[_0x3a05('0x3d')]({},_0xb4f2e6,_0x56c49a[_0x3a05('0x3e')]);var _0x33bff4={'where':_0xb4f2e6[_0x3a05('0x3a')]};return db['VoiceMailMessage'][_0x3a05('0x3f')](_0x33bff4)['then'](function(_0x1f9ec3){_0x270ef1[_0x3a05('0x3f')]=_0x1f9ec3;if(_0x56c49a[_0x3a05('0x2f')][_0x3a05('0x40')]){_0xb4f2e6[_0x3a05('0x41')]=[{'all':!![]}];}return db[_0x3a05('0x2a')][_0x3a05('0x42')](_0xb4f2e6);})[_0x3a05('0x24')](function(_0x452514){_0x270ef1['rows']=_0x452514;return _0x270ef1;})[_0x3a05('0x24')](respondWithFilteredResult(_0x6624e8,_0xb4f2e6))[_0x3a05('0x43')](handleError(_0x6624e8,null));};exports[_0x3a05('0x44')]=function(_0x597233,_0x374c1e){var _0x1b0ca2={'raw':!![],'where':{'id':_0x597233[_0x3a05('0x45')]['id']}},_0x5041a9={};_0x5041a9[_0x3a05('0x36')]=_[_0x3a05('0x30')](db[_0x3a05('0x2a')][_0x3a05('0x46')]);_0x5041a9[_0x3a05('0x2f')]=_[_0x3a05('0x30')](_0x597233[_0x3a05('0x2f')]);_0x5041a9[_0x3a05('0x31')]=_['intersection'](_0x5041a9[_0x3a05('0x36')],_0x5041a9[_0x3a05('0x2f')]);_0x1b0ca2[_0x3a05('0x34')]=_[_0x3a05('0x32')](_0x5041a9[_0x3a05('0x36')],qs[_0x3a05('0x33')](_0x597233['query'][_0x3a05('0x33')]));_0x1b0ca2[_0x3a05('0x34')]=_0x1b0ca2[_0x3a05('0x34')][_0x3a05('0x35')]?_0x1b0ca2[_0x3a05('0x34')]:_0x5041a9['model'];if(_0x597233[_0x3a05('0x2f')][_0x3a05('0x40')]){_0x1b0ca2[_0x3a05('0x41')]=[{'all':!![]}];}_0x1b0ca2=_[_0x3a05('0x3d')]({},_0x1b0ca2,_0x597233[_0x3a05('0x3e')]);return db[_0x3a05('0x2a')][_0x3a05('0x47')](_0x1b0ca2)[_0x3a05('0x24')](handleEntityNotFound(_0x374c1e,null))['then'](respondWithResult(_0x374c1e,null))[_0x3a05('0x43')](handleError(_0x374c1e,null));};exports[_0x3a05('0x48')]=function(_0x3f3724,_0x84dd6e){return db[_0x3a05('0x2a')][_0x3a05('0x48')](_0x3f3724[_0x3a05('0x49')],{})[_0x3a05('0x24')](respondWithResult(_0x84dd6e,0xc9))[_0x3a05('0x43')](handleError(_0x84dd6e,null));};exports[_0x3a05('0x23')]=function(_0x2a38e2,_0xef45ba){if(_0x2a38e2[_0x3a05('0x49')]['id']){delete _0x2a38e2['body']['id'];}return db['VoiceMailMessage'][_0x3a05('0x47')]({'where':{'id':_0x2a38e2[_0x3a05('0x45')]['id']}})[_0x3a05('0x24')](handleEntityNotFound(_0xef45ba,null))['then'](saveUpdates(_0x2a38e2[_0x3a05('0x49')],null))[_0x3a05('0x24')](respondWithResult(_0xef45ba,null))['catch'](handleError(_0xef45ba,null));};exports[_0x3a05('0x25')]=function(_0xb0f0fe,_0x19a160){return db['VoiceMailMessage'][_0x3a05('0x47')]({'where':{'id':_0xb0f0fe[_0x3a05('0x45')]['id']}})[_0x3a05('0x24')](handleEntityNotFound(_0x19a160,null))[_0x3a05('0x24')](removeEntity(_0x19a160,null))[_0x3a05('0x43')](handleError(_0x19a160,null));};exports[_0x3a05('0x4a')]=function(_0x4ed2d3,_0x135df5,_0x3427d1){return db[_0x3a05('0x2a')][_0x3a05('0x47')]({'where':{'id':_0x4ed2d3[_0x3a05('0x45')]['id']},'attributes':['id',_0x3a05('0x4b'),_0x3a05('0x4c')]})['then'](handleEntityNotFound(_0x135df5,null))['then'](function(_0x22d25a){if(_0x22d25a){if(!_0x22d25a['recording']){throw new db[(_0x3a05('0x4d'))][(_0x3a05('0x4e'))](_0x3a05('0x4f'));}var _0x3b194f={'Content-Type':'audio/wav','Content-Disposition':_0x3a05('0x50')};if(_0x22d25a[_0x3a05('0x4c')]){_0x3b194f['Content-Disposition']=_0x3a05('0x51')+_0x22d25a['msg_id']+_0x3a05('0x52');}_0x135df5['set'](_0x3b194f);return _0x135df5[_0x3a05('0x53')](new Buffer(_0x22d25a[_0x3a05('0x4b')]));}})[_0x3a05('0x43')](handleError(_0x135df5,null));}; \ No newline at end of file +var _0x6cca=['rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','keys','intersection','find','create','body','params','download','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','send','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','reject','save','update','then','destroy','end','stack','name','index','map'];(function(_0xf0b1d0,_0x555fb1){var _0x461292=function(_0x571ac8){while(--_0x571ac8){_0xf0b1d0['push'](_0xf0b1d0['shift']());}};_0x461292(++_0x555fb1);}(_0x6cca,0x189));var _0xa6cc=function(_0x39b606,_0x9f5081){_0x39b606=_0x39b606-0x0;var _0x233d72=_0x6cca[_0x39b606];return _0x233d72;};'use strict';var emlformat=require(_0xa6cc('0x0'));var rimraf=require(_0xa6cc('0x1'));var zipdir=require(_0xa6cc('0x2'));var jsonpatch=require(_0xa6cc('0x3'));var rp=require(_0xa6cc('0x4'));var moment=require(_0xa6cc('0x5'));var BPromise=require(_0xa6cc('0x6'));var Mustache=require(_0xa6cc('0x7'));var util=require(_0xa6cc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa6cc('0x9'));var ejs=require(_0xa6cc('0xa'));var fs=require('fs');var fs_extra=require(_0xa6cc('0xb'));var _=require('lodash');var squel=require(_0xa6cc('0xc'));var crypto=require(_0xa6cc('0xd'));var jsforce=require(_0xa6cc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa6cc('0x9'));var querystring=require('querystring');var Papa=require(_0xa6cc('0xf'));var Redis=require(_0xa6cc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6cc('0x11'));var as=require(_0xa6cc('0x12'));var hardwareService=require(_0xa6cc('0x13'));var logger=require(_0xa6cc('0x14'))('api');var utils=require(_0xa6cc('0x15'));var config=require(_0xa6cc('0x16'));var licenseUtil=require(_0xa6cc('0x17'));var db=require(_0xa6cc('0x18'))['db'];function respondWithStatusCode(_0x32cdbd,_0x3ec205){_0x3ec205=_0x3ec205||0xcc;return function(_0x1ef96e){if(_0x1ef96e){return _0x32cdbd[_0xa6cc('0x19')](_0x3ec205);}return _0x32cdbd[_0xa6cc('0x1a')](_0x3ec205)['end']();};}function respondWithResult(_0xc27b02,_0x2ca021){_0x2ca021=_0x2ca021||0xc8;return function(_0x2941fa){if(_0x2941fa){return _0xc27b02[_0xa6cc('0x1a')](_0x2ca021)[_0xa6cc('0x1b')](_0x2941fa);}};}function respondWithFilteredResult(_0x43133d,_0xa9270d){return function(_0x17ea17){if(_0x17ea17){var _0x22b7e9=typeof _0xa9270d[_0xa6cc('0x1c')]===_0xa6cc('0x1d')&&typeof _0xa9270d['limit']===_0xa6cc('0x1d');var _0x45aec9=_0x17ea17[_0xa6cc('0x1e')];var _0x2d0f22=_0x22b7e9?0x0:_0xa9270d['offset'];var _0x46a130=_0x22b7e9?_0x17ea17[_0xa6cc('0x1e')]:_0xa9270d['offset']+_0xa9270d['limit'];var _0x4a92b1;if(_0x46a130>=_0x45aec9){_0x46a130=_0x45aec9;_0x4a92b1=0xc8;}else{_0x4a92b1=0xce;}_0x43133d[_0xa6cc('0x1a')](_0x4a92b1);return _0x43133d['set'](_0xa6cc('0x1f'),_0x2d0f22+'-'+_0x46a130+'/'+_0x45aec9)[_0xa6cc('0x1b')](_0x17ea17);}return null;};}function patchUpdates(_0x3611d9){return function(_0x24e8df){try{jsonpatch['apply'](_0x24e8df,_0x3611d9,!![]);}catch(_0x3784cf){return BPromise[_0xa6cc('0x20')](_0x3784cf);}return _0x24e8df[_0xa6cc('0x21')]();};}function saveUpdates(_0x446dfa,_0x2639e9){return function(_0x3b0ba7){if(_0x3b0ba7){return _0x3b0ba7[_0xa6cc('0x22')](_0x446dfa)[_0xa6cc('0x23')](function(_0x85a2e4){return _0x85a2e4;});}return null;};}function removeEntity(_0xbbe5f6,_0x4979dc){return function(_0x277af8){if(_0x277af8){return _0x277af8[_0xa6cc('0x24')]()[_0xa6cc('0x23')](function(){_0xbbe5f6[_0xa6cc('0x1a')](0xcc)[_0xa6cc('0x25')]();});}};}function handleEntityNotFound(_0x568df7,_0x4cb7dc){return function(_0x4d1bb3){if(!_0x4d1bb3){_0x568df7[_0xa6cc('0x19')](0x194);}return _0x4d1bb3;};}function handleError(_0x3285c6,_0x58baa8){_0x58baa8=_0x58baa8||0x1f4;return function(_0x2ee3a1){logger['error'](_0x2ee3a1[_0xa6cc('0x26')]);if(_0x2ee3a1[_0xa6cc('0x27')]){delete _0x2ee3a1[_0xa6cc('0x27')];}_0x3285c6[_0xa6cc('0x1a')](_0x58baa8)['send'](_0x2ee3a1);};}exports[_0xa6cc('0x28')]=function(_0x547936,_0x5e507f){var _0x145d76={},_0x35d7e5={},_0x11a721={'count':0x0,'rows':[]};var _0x3ce9cb=_[_0xa6cc('0x29')](db['VoiceMailMessage'][_0xa6cc('0x2a')],function(_0x1fe4ff){return{'name':_0x1fe4ff[_0xa6cc('0x2b')],'type':_0x1fe4ff[_0xa6cc('0x2c')][_0xa6cc('0x2d')]};});_0x35d7e5[_0xa6cc('0x2e')]=_[_0xa6cc('0x2f')](_['map'](_0x3ce9cb,_0xa6cc('0x27')),[_0xa6cc('0x27')]);_0x35d7e5[_0xa6cc('0x30')]=_['keys'](_0x547936[_0xa6cc('0x30')]);_0x35d7e5[_0xa6cc('0x31')]=_['intersection'](_0x35d7e5[_0xa6cc('0x2e')],_0x35d7e5[_0xa6cc('0x30')]);_0x145d76[_0xa6cc('0x32')]=_['intersection'](_0x35d7e5['model'],qs[_0xa6cc('0x33')](_0x547936[_0xa6cc('0x30')][_0xa6cc('0x33')]));_0x145d76['attributes']=_0x145d76[_0xa6cc('0x32')]['length']?_0x145d76['attributes']:_0x35d7e5['model'];if(!_0x547936[_0xa6cc('0x30')][_0xa6cc('0x34')](_0xa6cc('0x35'))){_0x145d76[_0xa6cc('0x36')]=qs[_0xa6cc('0x36')](_0x547936['query'][_0xa6cc('0x36')]);_0x145d76[_0xa6cc('0x1c')]=qs[_0xa6cc('0x1c')](_0x547936[_0xa6cc('0x30')][_0xa6cc('0x1c')]);}_0x145d76[_0xa6cc('0x37')]=qs[_0xa6cc('0x38')](_0x547936[_0xa6cc('0x30')][_0xa6cc('0x38')]);_0x145d76['where']=qs[_0xa6cc('0x31')](_[_0xa6cc('0x39')](_0x547936[_0xa6cc('0x30')],_0x35d7e5[_0xa6cc('0x31')]),_0x3ce9cb);if(_0x547936['query'][_0xa6cc('0x3a')]){_0x145d76['where']=_[_0xa6cc('0x3b')](_0x145d76[_0xa6cc('0x3c')],{'$or':_[_0xa6cc('0x29')](_0x3ce9cb,function(_0x4ef334){if(_0x4ef334[_0xa6cc('0x2c')]!==_0xa6cc('0x3d')){var _0x3a97f5={};_0x3a97f5[_0x4ef334[_0xa6cc('0x27')]]={'$like':'%'+_0x547936[_0xa6cc('0x30')][_0xa6cc('0x3a')]+'%'};return _0x3a97f5;}})});}_0x145d76=_[_0xa6cc('0x3b')]({},_0x145d76,_0x547936[_0xa6cc('0x3e')]);var _0x513cd2={'where':_0x145d76[_0xa6cc('0x3c')]};return db[_0xa6cc('0x3f')][_0xa6cc('0x1e')](_0x513cd2)[_0xa6cc('0x23')](function(_0x36bcc9){_0x11a721['count']=_0x36bcc9;if(_0x547936['query'][_0xa6cc('0x40')]){_0x145d76[_0xa6cc('0x41')]=[{'all':!![]}];}return db[_0xa6cc('0x3f')][_0xa6cc('0x42')](_0x145d76);})[_0xa6cc('0x23')](function(_0x3d059a){_0x11a721[_0xa6cc('0x43')]=_0x3d059a;return _0x11a721;})[_0xa6cc('0x23')](respondWithFilteredResult(_0x5e507f,_0x145d76))[_0xa6cc('0x44')](handleError(_0x5e507f,null));};exports[_0xa6cc('0x45')]=function(_0x2ecdd2,_0x3c80c1){var _0xc1193a={'raw':!![],'where':{'id':_0x2ecdd2['params']['id']}},_0x361667={};_0x361667[_0xa6cc('0x2e')]=_['keys'](db[_0xa6cc('0x3f')][_0xa6cc('0x2a')]);_0x361667['query']=_[_0xa6cc('0x46')](_0x2ecdd2[_0xa6cc('0x30')]);_0x361667[_0xa6cc('0x31')]=_[_0xa6cc('0x47')](_0x361667[_0xa6cc('0x2e')],_0x361667[_0xa6cc('0x30')]);_0xc1193a[_0xa6cc('0x32')]=_[_0xa6cc('0x47')](_0x361667[_0xa6cc('0x2e')],qs[_0xa6cc('0x33')](_0x2ecdd2['query'][_0xa6cc('0x33')]));_0xc1193a[_0xa6cc('0x32')]=_0xc1193a['attributes']['length']?_0xc1193a[_0xa6cc('0x32')]:_0x361667[_0xa6cc('0x2e')];if(_0x2ecdd2[_0xa6cc('0x30')][_0xa6cc('0x40')]){_0xc1193a[_0xa6cc('0x41')]=[{'all':!![]}];}_0xc1193a=_[_0xa6cc('0x3b')]({},_0xc1193a,_0x2ecdd2[_0xa6cc('0x3e')]);return db[_0xa6cc('0x3f')][_0xa6cc('0x48')](_0xc1193a)['then'](handleEntityNotFound(_0x3c80c1,null))['then'](respondWithResult(_0x3c80c1,null))[_0xa6cc('0x44')](handleError(_0x3c80c1,null));};exports['create']=function(_0x4d7fee,_0x56c3fe){return db['VoiceMailMessage'][_0xa6cc('0x49')](_0x4d7fee[_0xa6cc('0x4a')],{})['then'](respondWithResult(_0x56c3fe,0xc9))['catch'](handleError(_0x56c3fe,null));};exports['update']=function(_0x30bc52,_0xc73491){if(_0x30bc52['body']['id']){delete _0x30bc52[_0xa6cc('0x4a')]['id'];}return db[_0xa6cc('0x3f')][_0xa6cc('0x48')]({'where':{'id':_0x30bc52[_0xa6cc('0x4b')]['id']}})[_0xa6cc('0x23')](handleEntityNotFound(_0xc73491,null))['then'](saveUpdates(_0x30bc52[_0xa6cc('0x4a')],null))['then'](respondWithResult(_0xc73491,null))[_0xa6cc('0x44')](handleError(_0xc73491,null));};exports['destroy']=function(_0x54953e,_0x2c39b3){return db[_0xa6cc('0x3f')][_0xa6cc('0x48')]({'where':{'id':_0x54953e[_0xa6cc('0x4b')]['id']}})[_0xa6cc('0x23')](handleEntityNotFound(_0x2c39b3,null))[_0xa6cc('0x23')](removeEntity(_0x2c39b3,null))['catch'](handleError(_0x2c39b3,null));};exports[_0xa6cc('0x4c')]=function(_0x580ed9,_0x189912,_0x341835){return db[_0xa6cc('0x3f')]['find']({'where':{'id':_0x580ed9[_0xa6cc('0x4b')]['id']},'attributes':['id','recording',_0xa6cc('0x4d')]})[_0xa6cc('0x23')](handleEntityNotFound(_0x189912,null))[_0xa6cc('0x23')](function(_0x18769f){if(_0x18769f){if(!_0x18769f['recording']){throw new db[(_0xa6cc('0x4e'))][(_0xa6cc('0x4f'))](_0xa6cc('0x50'));}var _0x2b7ab5={'Content-Type':_0xa6cc('0x51'),'Content-Disposition':_0xa6cc('0x52')};if(_0x18769f[_0xa6cc('0x4d')]){_0x2b7ab5[_0xa6cc('0x53')]=_0xa6cc('0x54')+_0x18769f[_0xa6cc('0x4d')]+'.wav\x22';}_0x189912['set'](_0x2b7ab5);return _0x189912[_0xa6cc('0x55')](new Buffer(_0x18769f[_0xa6cc('0x56')]));}})[_0xa6cc('0x44')](handleError(_0x189912,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 84e7d8b..df88c78 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 _0x88c3=['dir','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages'];(function(_0x1c0c7c,_0x2ede87){var _0x1eeae0=function(_0x6d671b){while(--_0x6d671b){_0x1c0c7c['push'](_0x1c0c7c['shift']());}};_0x1eeae0(++_0x2ede87);}(_0x88c3,0x1ef));var _0x388c=function(_0x23c162,_0x46d0d2){_0x23c162=_0x23c162-0x0;var _0x477a7e=_0x88c3[_0x23c162];return _0x477a7e;};'use strict';var _=require('lodash');var util=require(_0x388c('0x0'));var logger=require(_0x388c('0x1'))(_0x388c('0x2'));var moment=require('moment');var BPromise=require(_0x388c('0x3'));var rp=require(_0x388c('0x4'));var fs=require('fs');var path=require(_0x388c('0x5'));var rimraf=require(_0x388c('0x6'));var config=require(_0x388c('0x7'));var attributes=require(_0x388c('0x8'));module[_0x388c('0x9')]=function(_0x32c36a,_0x424aa7){return _0x32c36a['define'](_0x388c('0xa'),attributes,{'tableName':_0x388c('0xb'),'paranoid':![],'indexes':[{'name':_0x388c('0xc'),'fields':[_0x388c('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd745=['VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x14ba06,_0x332532){var _0x1f72ad=function(_0x5295e7){while(--_0x5295e7){_0x14ba06['push'](_0x14ba06['shift']());}};_0x1f72ad(++_0x332532);}(_0xd745,0x7c));var _0x5d74=function(_0x22dc11,_0x5ccd01){_0x22dc11=_0x22dc11-0x0;var _0xc42129=_0xd745[_0x22dc11];return _0xc42129;};'use strict';var _=require(_0x5d74('0x0'));var util=require(_0x5d74('0x1'));var logger=require(_0x5d74('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d74('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5d74('0x4'));var config=require(_0x5d74('0x5'));var attributes=require(_0x5d74('0x6'));module[_0x5d74('0x7')]=function(_0x5ac452,_0x24a9fb){return _0x5ac452['define'](_0x5d74('0x8'),attributes,{'tableName':_0x5d74('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x5d74('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 0c0667a..efe4e62 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 _0xe5f6=['info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then'];(function(_0x21a1fd,_0x339b0e){var _0x23bee3=function(_0x1e4093){while(--_0x1e4093){_0x21a1fd['push'](_0x21a1fd['shift']());}};_0x23bee3(++_0x339b0e);}(_0xe5f6,0xe7));var _0x6e5f=function(_0x56d139,_0xc78163){_0x56d139=_0x56d139-0x0;var _0x1574e7=_0xe5f6[_0x56d139];return _0x1574e7;};'use strict';var _=require('lodash');var util=require(_0x6e5f('0x0'));var moment=require(_0x6e5f('0x1'));var BPromise=require(_0x6e5f('0x2'));var rs=require(_0x6e5f('0x3'));var fs=require('fs');var Redis=require(_0x6e5f('0x4'));var db=require(_0x6e5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e5f('0x6'))(_0x6e5f('0x7'));var config=require(_0x6e5f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b1c66,_0x35834a,_0x4b962c){return new BPromise(function(_0x114332,_0x4df81e){return client['request'](_0x1b1c66,_0x4b962c)[_0x6e5f('0xa')](function(_0x1692b7){logger[_0x6e5f('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x35834a,_0x6e5f('0xc'));logger[_0x6e5f('0xd')](_0x6e5f('0xe'),_0x35834a,'request\x20sent',JSON[_0x6e5f('0xf')](_0x1692b7));if(_0x1692b7['error']){if(_0x1692b7[_0x6e5f('0x10')][_0x6e5f('0x11')]===0x1f4){logger[_0x6e5f('0x10')](_0x6e5f('0x12'),_0x35834a,_0x1692b7[_0x6e5f('0x10')][_0x6e5f('0x13')]);return _0x4df81e(_0x1692b7[_0x6e5f('0x10')][_0x6e5f('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x35834a,_0x1692b7[_0x6e5f('0x10')][_0x6e5f('0x13')]);return _0x114332(_0x1692b7[_0x6e5f('0x10')][_0x6e5f('0x13')]);}else{logger[_0x6e5f('0xb')](_0x6e5f('0x12'),_0x35834a,_0x6e5f('0xc'));_0x114332(_0x1692b7[_0x6e5f('0x14')][_0x6e5f('0x13')]);}})[_0x6e5f('0x15')](function(_0x278d69){logger[_0x6e5f('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x35834a,_0x278d69);_0x4df81e(_0x278d69);});});} \ No newline at end of file +var _0x82be=['jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x448ee2,_0x10ab43){var _0x2a56f9=function(_0x527a5c){while(--_0x527a5c){_0x448ee2['push'](_0x448ee2['shift']());}};_0x2a56f9(++_0x10ab43);}(_0x82be,0x77));var _0xe82b=function(_0x12fd0a,_0x592349){_0x12fd0a=_0x12fd0a-0x0;var _0xa0d712=_0x82be[_0x12fd0a];return _0xa0d712;};'use strict';var _=require(_0xe82b('0x0'));var util=require(_0xe82b('0x1'));var moment=require(_0xe82b('0x2'));var BPromise=require(_0xe82b('0x3'));var rs=require(_0xe82b('0x4'));var fs=require('fs');var Redis=require(_0xe82b('0x5'));var db=require(_0xe82b('0x6'))['db'];var utils=require(_0xe82b('0x7'));var logger=require(_0xe82b('0x8'))(_0xe82b('0x9'));var config=require(_0xe82b('0xa'));var jayson=require(_0xe82b('0xb'));var client=jayson[_0xe82b('0xc')][_0xe82b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476de3,_0x1c5904,_0x506cf2){return new BPromise(function(_0x48d8ba,_0x19a7f3){return client[_0xe82b('0xe')](_0x476de3,_0x506cf2)[_0xe82b('0xf')](function(_0x184119){logger[_0xe82b('0x10')](_0xe82b('0x11'),_0x1c5904,_0xe82b('0x12'));logger[_0xe82b('0x13')](_0xe82b('0x14'),_0x1c5904,_0xe82b('0x12'),JSON[_0xe82b('0x15')](_0x184119));if(_0x184119[_0xe82b('0x16')]){if(_0x184119[_0xe82b('0x16')][_0xe82b('0x17')]===0x1f4){logger[_0xe82b('0x16')]('VoiceMailMessage,\x20%s,\x20%s',_0x1c5904,_0x184119[_0xe82b('0x16')][_0xe82b('0x18')]);return _0x19a7f3(_0x184119[_0xe82b('0x16')][_0xe82b('0x18')]);}logger[_0xe82b('0x16')](_0xe82b('0x11'),_0x1c5904,_0x184119[_0xe82b('0x16')][_0xe82b('0x18')]);return _0x48d8ba(_0x184119[_0xe82b('0x16')][_0xe82b('0x18')]);}else{logger[_0xe82b('0x10')](_0xe82b('0x11'),_0x1c5904,'request\x20sent');_0x48d8ba(_0x184119['result'][_0xe82b('0x18')]);}})[_0xe82b('0x19')](function(_0x2e3a75){logger['error'](_0xe82b('0x11'),_0x1c5904,_0x2e3a75);_0x19a7f3(_0x2e3a75);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index df50368..726d0e2 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 _0x7ef1=['get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create','addSound','update','delete','destroy','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x7ef1,0x172));var _0x17ef=function(_0x596f90,_0x523bac){_0x596f90=_0x596f90-0x0;var _0x10ef85=_0x7ef1[_0x596f90];return _0x10ef85;};'use strict';var multer=require(_0x17ef('0x0'));var util=require('util');var path=require(_0x17ef('0x1'));var timeout=require(_0x17ef('0x2'));var express=require(_0x17ef('0x3'));var router=express[_0x17ef('0x4')]();var fs_extra=require(_0x17ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x17ef('0x6'));var config=require(_0x17ef('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x17ef('0x8')]('/',auth[_0x17ef('0x9')](),controller['index']);router[_0x17ef('0x8')](_0x17ef('0xa'),auth[_0x17ef('0x9')](),controller['show']);router['get'](_0x17ef('0xb'),auth[_0x17ef('0x9')](),controller[_0x17ef('0xc')]);router[_0x17ef('0xd')]('/',auth[_0x17ef('0x9')](),controller[_0x17ef('0xe')]);router['post']('/:id/sounds',auth[_0x17ef('0x9')](),controller[_0x17ef('0xf')]);router['put'](_0x17ef('0xa'),auth[_0x17ef('0x9')](),controller[_0x17ef('0x10')]);router[_0x17ef('0x11')](_0x17ef('0xa'),auth['isAuthenticated'](),controller[_0x17ef('0x12')]);router[_0x17ef('0x11')]('/:id/sounds/:id2',auth[_0x17ef('0x9')](),controller[_0x17ef('0x13')]);module[_0x17ef('0x14')]=router; \ No newline at end of file +var _0xb059=['/:id/sounds','create','post','addSound','/:id/sounds/:id2','removeSound','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','show'];(function(_0x2e5cf1,_0x32a21f){var _0x403f01=function(_0x106229){while(--_0x106229){_0x2e5cf1['push'](_0x2e5cf1['shift']());}};_0x403f01(++_0x32a21f);}(_0xb059,0x1ec));var _0x9b05=function(_0x2ba062,_0x254338){_0x2ba062=_0x2ba062-0x0;var _0x17f2ed=_0xb059[_0x2ba062];return _0x17f2ed;};'use strict';var multer=require('multer');var util=require(_0x9b05('0x0'));var path=require('path');var timeout=require(_0x9b05('0x1'));var express=require(_0x9b05('0x2'));var router=express[_0x9b05('0x3')]();var fs_extra=require(_0x9b05('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9b05('0x5'));var config=require(_0x9b05('0x6'));var controller=require(_0x9b05('0x7'));router[_0x9b05('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9b05('0x9'),auth[_0x9b05('0xa')](),controller[_0x9b05('0xb')]);router['get'](_0x9b05('0xc'),auth[_0x9b05('0xa')](),controller['getSounds']);router['post']('/',auth[_0x9b05('0xa')](),controller[_0x9b05('0xd')]);router[_0x9b05('0xe')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x9b05('0xf')]);router['put']('/:id',auth[_0x9b05('0xa')](),controller['update']);router['delete'](_0x9b05('0x9'),auth[_0x9b05('0xa')](),controller['destroy']);router['delete'](_0x9b05('0x10'),auth['isAuthenticated'](),controller[_0x9b05('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 f43e2ea..0440597 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 _0x37a9=['quietmp3','mp3','files','STRING','alpha','BOOLEAN','sequelize','exports','name','ENUM','custom','quietmp3nb'];(function(_0x42e6ce,_0x511000){var _0xbe41a7=function(_0xb233c0){while(--_0xb233c0){_0x42e6ce['push'](_0x42e6ce['shift']());}};_0xbe41a7(++_0x511000);}(_0x37a9,0x1f2));var _0x937a=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x37a9[_0x1ea053];return _0x444b08;};'use strict';var Sequelize=require(_0x937a('0x0'));module[_0x937a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x937a('0x2')},'mode':{'type':Sequelize[_0x937a('0x3')](_0x937a('0x4'),'files','mp3nb',_0x937a('0x5'),_0x937a('0x6'),_0x937a('0x7')),'allowNull':!![],'defaultValue':_0x937a('0x8')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x937a('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x937a('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x937a('0x9')],'allowNull':!![],'defaultValue':_0x937a('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x937a('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb76b=['name','ENUM','custom','mp3nb','quietmp3nb','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x342ab4,_0x4bc5b8){var _0x3b43a9=function(_0x1ec0fd){while(--_0x1ec0fd){_0x342ab4['push'](_0x342ab4['shift']());}};_0x3b43a9(++_0x4bc5b8);}(_0xb76b,0x1aa));var _0xbb76=function(_0x3aae27,_0x1485e0){_0x3aae27=_0x3aae27-0x0;var _0x1b4fd6=_0xb76b[_0x3aae27];return _0x1b4fd6;};'use strict';var Sequelize=require(_0xbb76('0x0'));module[_0xbb76('0x1')]={'name':{'type':Sequelize[_0xbb76('0x2')],'allowNull':![],'unique':_0xbb76('0x3')},'mode':{'type':Sequelize[_0xbb76('0x4')](_0xbb76('0x5'),'files',_0xbb76('0x6'),_0xbb76('0x7'),'quietmp3',_0xbb76('0x8')),'allowNull':!![],'defaultValue':_0xbb76('0x9')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xbb76('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xbb76('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xbb76('0x2')],'allowNull':!![],'defaultValue':_0xbb76('0xa')},'format':{'type':Sequelize[_0xbb76('0x2')],'allowNull':!![]},'stamp':{'type':_0xbb76('0xb')},'defaultEntry':{'type':Sequelize[_0xbb76('0xc')],'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 9d7c08e..1452108 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 _0x2754=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','get','MusicOnHolds','error','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','update','body','create','sequelize','transaction','mode','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','message','addSound','Sound','findOne','createdAt','server/files/sounds/converted','format','basename','save_name','extname','converted_format','server/files/moh','symlinkSync','ValidationError','removeSound','id2','%s.%s','getSounds','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1d3d1a,_0x2a3dde){var _0x4bc3ad=function(_0x534345){while(--_0x534345){_0x1d3d1a['push'](_0x1d3d1a['shift']());}};_0x4bc3ad(++_0x2a3dde);}(_0x2754,0x143));var _0x4275=function(_0x1381df,_0xa4f9e9){_0x1381df=_0x1381df-0x0;var _0x3dd915=_0x2754[_0x1381df];return _0x3dd915;};'use strict';var emlformat=require(_0x4275('0x0'));var rimraf=require(_0x4275('0x1'));var zipdir=require(_0x4275('0x2'));var jsonpatch=require(_0x4275('0x3'));var rp=require(_0x4275('0x4'));var moment=require(_0x4275('0x5'));var BPromise=require(_0x4275('0x6'));var Mustache=require('mustache');var util=require(_0x4275('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4275('0x8'));var ejs=require(_0x4275('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4275('0xa'));var squel=require(_0x4275('0xb'));var crypto=require(_0x4275('0xc'));var jsforce=require(_0x4275('0xd'));var deskjs=require(_0x4275('0xe'));var toCsv=require(_0x4275('0x8'));var querystring=require(_0x4275('0xf'));var Papa=require(_0x4275('0x10'));var Redis=require(_0x4275('0x11'));var authService=require(_0x4275('0x12'));var qs=require(_0x4275('0x13'));var as=require(_0x4275('0x14'));var hardwareService=require(_0x4275('0x15'));var logger=require('../../config/logger')(_0x4275('0x16'));var utils=require(_0x4275('0x17'));var config=require(_0x4275('0x18'));var licenseUtil=require(_0x4275('0x19'));var db=require(_0x4275('0x1a'))['db'];function respondWithStatusCode(_0x33638a,_0x35f2bd){_0x35f2bd=_0x35f2bd||0xcc;return function(_0x1756c4){if(_0x1756c4){return _0x33638a[_0x4275('0x1b')](_0x35f2bd);}return _0x33638a[_0x4275('0x1c')](_0x35f2bd)[_0x4275('0x1d')]();};}function respondWithResult(_0x2222c2,_0x18becf){_0x18becf=_0x18becf||0xc8;return function(_0x3acc2d){if(_0x3acc2d){return _0x2222c2[_0x4275('0x1c')](_0x18becf)['json'](_0x3acc2d);}};}function respondWithFilteredResult(_0x567cf2,_0x40ca0b){return function(_0x6c058){if(_0x6c058){var _0x4db511=typeof _0x40ca0b[_0x4275('0x1e')]===_0x4275('0x1f')&&typeof _0x40ca0b[_0x4275('0x20')]==='undefined';var _0x7fab71=_0x6c058[_0x4275('0x21')];var _0x554e70=_0x4db511?0x0:_0x40ca0b[_0x4275('0x1e')];var _0x4f1185=_0x4db511?_0x6c058[_0x4275('0x21')]:_0x40ca0b[_0x4275('0x1e')]+_0x40ca0b[_0x4275('0x20')];var _0xe1cb4d;if(_0x4f1185>=_0x7fab71){_0x4f1185=_0x7fab71;_0xe1cb4d=0xc8;}else{_0xe1cb4d=0xce;}_0x567cf2[_0x4275('0x1c')](_0xe1cb4d);return _0x567cf2[_0x4275('0x22')](_0x4275('0x23'),_0x554e70+'-'+_0x4f1185+'/'+_0x7fab71)[_0x4275('0x24')](_0x6c058);}return null;};}function patchUpdates(_0x26bcee){return function(_0x1319c9){try{jsonpatch['apply'](_0x1319c9,_0x26bcee,!![]);}catch(_0x53f625){return BPromise['reject'](_0x53f625);}return _0x1319c9[_0x4275('0x25')]();};}function saveUpdates(_0x29f311,_0x2c2bbd){return function(_0x306931){if(_0x306931){return _0x306931['update'](_0x29f311)[_0x4275('0x26')](function(_0x50fd1f){return _0x50fd1f;});}return null;};}function removeEntity(_0x5007ef,_0xca744){return function(_0x585362){if(_0x585362){return _0x585362[_0x4275('0x27')]()['then'](function(){var _0x54ceeb=_0x585362[_0x4275('0x28')]({'plain':!![]});var _0x346337=_0x4275('0x29');return db['UserProfileResource'][_0x4275('0x27')]({'where':{'type':_0x346337,'resourceId':_0x54ceeb['id']}})[_0x4275('0x26')](function(){return _0x585362;});})[_0x4275('0x26')](function(){_0x5007ef['status'](0xcc)[_0x4275('0x1d')]();});}};}function handleEntityNotFound(_0x583c86,_0x5c5430){return function(_0x4cbc4b){if(!_0x4cbc4b){_0x583c86['sendStatus'](0x194);}return _0x4cbc4b;};}function handleError(_0x5e90a4,_0x2a61a5){_0x2a61a5=_0x2a61a5||0x1f4;return function(_0x321c7e){logger[_0x4275('0x2a')](_0x321c7e[_0x4275('0x2b')]);if(_0x321c7e[_0x4275('0x2c')]){delete _0x321c7e[_0x4275('0x2c')];}_0x5e90a4[_0x4275('0x1c')](_0x2a61a5)[_0x4275('0x2d')](_0x321c7e);};}exports['index']=function(_0x4fe984,_0x41a4b6){var _0x58f5d7={},_0x4901ab={},_0x7f1d5={'count':0x0,'rows':[]};var _0x2720cf=_['map'](db[_0x4275('0x2e')][_0x4275('0x2f')],function(_0x4d9778){return{'name':_0x4d9778[_0x4275('0x30')],'type':_0x4d9778[_0x4275('0x31')][_0x4275('0x32')]};});_0x4901ab['model']=_[_0x4275('0x33')](_0x2720cf,_0x4275('0x2c'));_0x4901ab[_0x4275('0x34')]=_['keys'](_0x4fe984[_0x4275('0x34')]);_0x4901ab[_0x4275('0x35')]=_[_0x4275('0x36')](_0x4901ab[_0x4275('0x37')],_0x4901ab[_0x4275('0x34')]);_0x58f5d7['attributes']=_[_0x4275('0x36')](_0x4901ab[_0x4275('0x37')],qs['fields'](_0x4fe984[_0x4275('0x34')][_0x4275('0x38')]));_0x58f5d7[_0x4275('0x39')]=_0x58f5d7[_0x4275('0x39')][_0x4275('0x3a')]?_0x58f5d7['attributes']:_0x4901ab[_0x4275('0x37')];if(!_0x4fe984['query'][_0x4275('0x3b')]('nolimit')){_0x58f5d7[_0x4275('0x20')]=qs[_0x4275('0x20')](_0x4fe984[_0x4275('0x34')][_0x4275('0x20')]);_0x58f5d7[_0x4275('0x1e')]=qs[_0x4275('0x1e')](_0x4fe984[_0x4275('0x34')][_0x4275('0x1e')]);}_0x58f5d7[_0x4275('0x3c')]=qs['sort'](_0x4fe984['query'][_0x4275('0x3d')]);delete _0x4fe984[_0x4275('0x34')][_0x4275('0x3d')];_0x58f5d7[_0x4275('0x3e')]=qs[_0x4275('0x35')](_[_0x4275('0x3f')](_0x4fe984['query'],_0x4901ab['filters']),_0x2720cf);if(_0x4fe984[_0x4275('0x34')]['filter']){_0x58f5d7[_0x4275('0x3e')]=_[_0x4275('0x40')](_0x58f5d7[_0x4275('0x3e')],{'$or':_['map'](_0x2720cf,function(_0x7927df){if(_0x7927df['type']!==_0x4275('0x41')){var _0x25deb9={};_0x25deb9[_0x7927df[_0x4275('0x2c')]]={'$like':'%'+_0x4fe984[_0x4275('0x34')]['filter']+'%'};return _0x25deb9;}})});}_0x58f5d7=_['merge']({},_0x58f5d7,_0x4fe984[_0x4275('0x42')]);var _0x7fae5e={'where':_0x58f5d7['where']};return db[_0x4275('0x2e')][_0x4275('0x21')](_0x7fae5e)[_0x4275('0x26')](function(_0x4a8f03){_0x7f1d5[_0x4275('0x21')]=_0x4a8f03;if(_0x4fe984['query'][_0x4275('0x43')]){_0x58f5d7[_0x4275('0x44')]=[{'all':!![]}];}return db[_0x4275('0x2e')]['findAll'](_0x58f5d7);})[_0x4275('0x26')](function(_0x2db0a9){_0x7f1d5[_0x4275('0x45')]=_0x2db0a9;return _0x7f1d5;})[_0x4275('0x26')](respondWithFilteredResult(_0x41a4b6,_0x58f5d7))[_0x4275('0x46')](handleError(_0x41a4b6,null));};exports[_0x4275('0x47')]=function(_0x81c8bf,_0x45c2cf){var _0x4ab380={'raw':![],'where':{'id':_0x81c8bf[_0x4275('0x48')]['id']}},_0x196e74={};_0x196e74[_0x4275('0x37')]=_[_0x4275('0x49')](db[_0x4275('0x2e')][_0x4275('0x2f')]);_0x196e74[_0x4275('0x34')]=_[_0x4275('0x49')](_0x81c8bf[_0x4275('0x34')]);_0x196e74[_0x4275('0x35')]=_[_0x4275('0x36')](_0x196e74[_0x4275('0x37')],_0x196e74['query']);_0x4ab380[_0x4275('0x39')]=_[_0x4275('0x36')](_0x196e74['model'],qs['fields'](_0x81c8bf[_0x4275('0x34')][_0x4275('0x38')]));_0x4ab380[_0x4275('0x39')]=_0x4ab380[_0x4275('0x39')]['length']?_0x4ab380[_0x4275('0x39')]:_0x196e74[_0x4275('0x37')];if(_0x81c8bf[_0x4275('0x34')][_0x4275('0x43')]){_0x4ab380[_0x4275('0x44')]=[{'all':!![]}];}_0x4ab380=_['merge']({},_0x4ab380,_0x81c8bf[_0x4275('0x42')]);return db[_0x4275('0x2e')][_0x4275('0x4a')](_0x4ab380)['then'](handleEntityNotFound(_0x45c2cf,null))[_0x4275('0x26')](respondWithResult(_0x45c2cf,null))[_0x4275('0x46')](handleError(_0x45c2cf,null));};exports[_0x4275('0x4b')]=function(_0x377922,_0x49505b){if(_0x377922[_0x4275('0x4c')]['id']){delete _0x377922[_0x4275('0x4c')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x377922['params']['id']}})['then'](handleEntityNotFound(_0x49505b,null))['then'](saveUpdates(_0x377922[_0x4275('0x4c')],null))[_0x4275('0x26')](respondWithResult(_0x49505b,null))['catch'](handleError(_0x49505b,null));};exports[_0x4275('0x4d')]=function(_0x7cd69,_0x72eb4e,_0x3ae43c){return db[_0x4275('0x4e')][_0x4275('0x4f')](function(_0x1804b8){if(_0x7cd69[_0x4275('0x4c')][_0x4275('0x50')]==='files'){_0x7cd69[_0x4275('0x4c')][_0x4275('0x51')]=path[_0x4275('0x52')](config[_0x4275('0x53')],'server/files/moh',_0x7cd69['body']['name']);}return db[_0x4275('0x2e')]['create'](_0x7cd69[_0x4275('0x4c')],{'transaction':_0x1804b8})['then'](function(_0x585802){if(_0x7cd69[_0x4275('0x4c')][_0x4275('0x50')]==='files'){fs[_0x4275('0x54')](_0x585802[_0x4275('0x51')],parseInt(_0x4275('0x55'),0x8));}var _0x121365=_0x7cd69[_0x4275('0x56')][_0x4275('0x28')]({'plain':!![]});if(!_0x121365)throw new Error(_0x4275('0x57'));if(_0x121365[_0x4275('0x58')]===_0x4275('0x56')){var _0x5a0632=_0x585802['get']({'plain':!![]});return db['UserProfileSection'][_0x4275('0x4a')]({'where':{'name':_0x4275('0x29'),'userProfileId':_0x121365[_0x4275('0x59')]},'raw':!![]})['then'](function(_0x135d0e){if(_0x135d0e&&_0x135d0e[_0x4275('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a0632[_0x4275('0x2c')],'resourceId':_0x5a0632['id'],'type':_0x135d0e[_0x4275('0x2c')],'sectionId':_0x135d0e['id']},{})[_0x4275('0x26')](function(){return _0x585802;});}else{return _0x585802;}})[_0x4275('0x46')](function(_0x6330a3){logger[_0x4275('0x2a')](_0x4275('0x5b'),_0x6330a3);});}return _0x585802;});})[_0x4275('0x26')](respondWithResult(_0x72eb4e,0xc9))[_0x4275('0x46')](handleError(_0x72eb4e,null));};exports[_0x4275('0x27')]=function(_0x16e8ac,_0x46e2e8,_0x32a640){var _0x55cc93;return db[_0x4275('0x2e')][_0x4275('0x4a')]({'where':{'id':_0x16e8ac[_0x4275('0x48')]['id']}})[_0x4275('0x26')](function(_0x549372){if(_0x549372){return db[_0x4275('0x4e')][_0x4275('0x4f')](function(_0x30bedb){return _0x549372['destroy']({'transaction':_0x30bedb,'raw':!![]})[_0x4275('0x26')](function(_0x21d27b){if(_0x21d27b[_0x4275('0x51')]){fs[_0x4275('0x5c')](_0x21d27b['directory'])[_0x4275('0x5d')](function(_0x2866ce){fs[_0x4275('0x5e')](path[_0x4275('0x52')](_0x21d27b['directory'],_0x2866ce));});fs['rmdirSync'](_0x21d27b[_0x4275('0x51')]);}return _0x21d27b;});})[_0x4275('0x46')](function(_0xf886e4){throw new db[(_0x4275('0x5f'))]['ValidationError'](_0xf886e4[_0x4275('0x60')]);});}})[_0x4275('0x26')](handleEntityNotFound(_0x46e2e8,null))[_0x4275('0x26')](removeEntity(_0x46e2e8,null))[_0x4275('0x46')](handleError(_0x46e2e8,null));};exports['addSound']=function(_0x1cb7e1,_0xeee1b1,_0x347c81){return db['sequelize'][_0x4275('0x4f')](function(_0x2a77bc){var _0xd368ff;return db[_0x4275('0x2e')][_0x4275('0x4a')]({'where':{'id':_0x1cb7e1[_0x4275('0x48')]['id']}})['then'](function(_0x5448c1){if(_0x5448c1){_0xd368ff=_0x5448c1;return _0x5448c1[_0x4275('0x61')](_0x1cb7e1[_0x4275('0x4c')]['id'],{'transaction':_0x2a77bc});}})[_0x4275('0x26')](function(_0x4b389d){if(_0x4b389d){return db[_0x4275('0x62')][_0x4275('0x63')]({'where':{'id':_0x1cb7e1[_0x4275('0x4c')]['id']},'attributes':['id',_0x4275('0x2c'),'save_name','converted_format',_0x4275('0x64')],'raw':!![]});}})[_0x4275('0x26')](function(_0x4e95b5){if(_0x4e95b5){var _0x4aa744=path[_0x4275('0x52')](config[_0x4275('0x53')],_0x4275('0x65'),util[_0x4275('0x66')]('%s.%s',path[_0x4275('0x67')](_0x4e95b5[_0x4275('0x68')],path[_0x4275('0x69')](_0x4e95b5[_0x4275('0x68')])),_0x4e95b5[_0x4275('0x6a')]));var _0x4a1967=path['join'](config['root'],_0x4275('0x6b'),_0xd368ff[_0x4275('0x2c')],util[_0x4275('0x66')]('%s.%s',_0x4e95b5[_0x4275('0x2c')],_0x4e95b5[_0x4275('0x6a')]));fs[_0x4275('0x6c')](_0x4aa744,_0x4a1967);return _0x4e95b5;}})[_0x4275('0x46')](function(_0x56de8d){throw new db[(_0x4275('0x5f'))][(_0x4275('0x6d'))](_0x56de8d[_0x4275('0x60')]);});})[_0x4275('0x26')](handleEntityNotFound(_0xeee1b1,null))[_0x4275('0x26')](respondWithResult(_0xeee1b1,0xc9))['catch'](handleError(_0xeee1b1,null));};exports[_0x4275('0x6e')]=function(_0xe3bfec,_0xd564bb,_0x4d21a3){return db[_0x4275('0x4e')][_0x4275('0x4f')](function(_0x59930d){var _0x6cb49e;return db['VoiceMusicOnHold'][_0x4275('0x63')]({'where':{'id':_0xe3bfec['params']['id']}})[_0x4275('0x26')](handleEntityNotFound(_0xd564bb,null))[_0x4275('0x26')](function(_0x5a52b3){if(_0x5a52b3){_0x6cb49e=_0x5a52b3;return _0x5a52b3[_0x4275('0x6e')](_0xe3bfec['params'][_0x4275('0x6f')]);}})['then'](function(_0x221aef){if(_0x221aef){return db[_0x4275('0x62')][_0x4275('0x63')]({'where':{'id':_0xe3bfec[_0x4275('0x48')][_0x4275('0x6f')]},'attributes':['id',_0x4275('0x2c'),'save_name',_0x4275('0x6a'),'createdAt'],'raw':!![]});}})[_0x4275('0x26')](function(_0x55fcca){if(_0x55fcca){fs[_0x4275('0x5e')](path[_0x4275('0x52')](_0x6cb49e[_0x4275('0x51')],util[_0x4275('0x66')](_0x4275('0x70'),_0x55fcca['name'],_0x55fcca[_0x4275('0x6a')])));return _0x55fcca;}})['catch'](function(_0x11f624){throw new db[(_0x4275('0x5f'))][(_0x4275('0x6d'))](_0x11f624[_0x4275('0x60')]);});})[_0x4275('0x26')](handleEntityNotFound(_0xd564bb,null))[_0x4275('0x26')](respondWithStatusCode(_0xd564bb,0xcc))[_0x4275('0x46')](handleError(_0xd564bb,null));};exports[_0x4275('0x71')]=function(_0x2caee3,_0x328b77,_0x1a0179){var _0x996552={};var _0x5b3ab2={};var _0x19d7e1;var _0x26e68f;return db[_0x4275('0x2e')][_0x4275('0x63')]({'where':{'id':_0x2caee3[_0x4275('0x48')]['id']}})['then'](handleEntityNotFound(_0x328b77,null))[_0x4275('0x26')](function(_0x15cb7a){if(_0x15cb7a){_0x19d7e1=_0x15cb7a;_0x5b3ab2['model']=_[_0x4275('0x49')](db[_0x4275('0x62')][_0x4275('0x2f')]);_0x5b3ab2[_0x4275('0x34')]=_[_0x4275('0x49')](_0x2caee3[_0x4275('0x34')]);_0x5b3ab2[_0x4275('0x35')]=_[_0x4275('0x36')](_0x5b3ab2['model'],_0x5b3ab2[_0x4275('0x34')]);_0x996552[_0x4275('0x39')]=_[_0x4275('0x36')](_0x5b3ab2[_0x4275('0x37')],qs['fields'](_0x2caee3['query'][_0x4275('0x38')]));_0x996552[_0x4275('0x39')]=_0x996552[_0x4275('0x39')][_0x4275('0x3a')]?_0x996552[_0x4275('0x39')]:_0x5b3ab2[_0x4275('0x37')];_0x996552[_0x4275('0x3c')]=qs[_0x4275('0x3d')](_0x2caee3[_0x4275('0x34')][_0x4275('0x3d')]);_0x996552[_0x4275('0x3e')]=qs[_0x4275('0x35')](_[_0x4275('0x3f')](_0x2caee3[_0x4275('0x34')],_0x5b3ab2[_0x4275('0x35')]));if(_0x2caee3[_0x4275('0x34')][_0x4275('0x72')]){_0x996552[_0x4275('0x3e')]=_[_0x4275('0x40')](_0x996552[_0x4275('0x3e')],{'$or':_[_0x4275('0x33')](_0x996552[_0x4275('0x39')],function(_0x2f9942){var _0x41625f={};_0x41625f[_0x2f9942]={'$like':'%'+_0x2caee3[_0x4275('0x34')]['filter']+'%'};return _0x41625f;})});}_0x996552=_[_0x4275('0x40')]({},_0x996552,_0x2caee3[_0x4275('0x42')]);return _0x19d7e1['getSounds'](_0x996552);}})[_0x4275('0x26')](function(_0x4751de){if(_0x4751de){_0x26e68f=_0x4751de[_0x4275('0x3a')];if(!_0x2caee3[_0x4275('0x34')][_0x4275('0x3b')]('nolimit')){_0x996552['limit']=qs[_0x4275('0x20')](_0x2caee3[_0x4275('0x34')][_0x4275('0x20')]);_0x996552[_0x4275('0x1e')]=qs[_0x4275('0x1e')](_0x2caee3[_0x4275('0x34')]['offset']);}return _0x19d7e1[_0x4275('0x71')](_0x996552);}})[_0x4275('0x26')](function(_0x5c106b){if(_0x5c106b){return _0x5c106b?{'count':_0x26e68f,'rows':_0x5c106b}:null;}})[_0x4275('0x26')](respondWithResult(_0x328b77,null))[_0x4275('0x46')](handleError(_0x328b77,null));}; \ No newline at end of file +var _0xe454=['request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','show','params','include','find','body','catch','create','sequelize','transaction','files','directory','join','root','server/files/moh','mode','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','message','removeSound','findOne','id2','Sound','unlinkSync','getSounds','eml-format','rimraf','fast-json-patch'];(function(_0x44c280,_0x4d600b){var _0x55d03a=function(_0x4585f4){while(--_0x4585f4){_0x44c280['push'](_0x44c280['shift']());}};_0x55d03a(++_0x4d600b);}(_0xe454,0x165));var _0x4e45=function(_0x118cf4,_0x5eb6fe){_0x118cf4=_0x118cf4-0x0;var _0x228bbf=_0xe454[_0x118cf4];return _0x228bbf;};'use strict';var emlformat=require(_0x4e45('0x0'));var rimraf=require(_0x4e45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e45('0x2'));var rp=require(_0x4e45('0x3'));var moment=require(_0x4e45('0x4'));var BPromise=require(_0x4e45('0x5'));var Mustache=require(_0x4e45('0x6'));var util=require(_0x4e45('0x7'));var path=require('path');var sox=require(_0x4e45('0x8'));var csv=require('to-csv');var ejs=require(_0x4e45('0x9'));var fs=require('fs');var fs_extra=require(_0x4e45('0xa'));var _=require('lodash');var squel=require(_0x4e45('0xb'));var crypto=require(_0x4e45('0xc'));var jsforce=require(_0x4e45('0xd'));var deskjs=require(_0x4e45('0xe'));var toCsv=require(_0x4e45('0xf'));var querystring=require(_0x4e45('0x10'));var Papa=require('papaparse');var Redis=require(_0x4e45('0x11'));var authService=require(_0x4e45('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4e45('0x13'));var hardwareService=require(_0x4e45('0x14'));var logger=require(_0x4e45('0x15'))(_0x4e45('0x16'));var utils=require(_0x4e45('0x17'));var config=require(_0x4e45('0x18'));var licenseUtil=require(_0x4e45('0x19'));var db=require(_0x4e45('0x1a'))['db'];function respondWithStatusCode(_0x5819f2,_0x466ef3){_0x466ef3=_0x466ef3||0xcc;return function(_0x39674f){if(_0x39674f){return _0x5819f2[_0x4e45('0x1b')](_0x466ef3);}return _0x5819f2[_0x4e45('0x1c')](_0x466ef3)['end']();};}function respondWithResult(_0x2a5615,_0x105bd6){_0x105bd6=_0x105bd6||0xc8;return function(_0x248e1d){if(_0x248e1d){return _0x2a5615[_0x4e45('0x1c')](_0x105bd6)[_0x4e45('0x1d')](_0x248e1d);}};}function respondWithFilteredResult(_0x5e528f,_0x4fb53b){return function(_0x27fdbf){if(_0x27fdbf){var _0x2d52a3=typeof _0x4fb53b[_0x4e45('0x1e')]===_0x4e45('0x1f')&&typeof _0x4fb53b[_0x4e45('0x20')]==='undefined';var _0x26cca5=_0x27fdbf[_0x4e45('0x21')];var _0x3d02a7=_0x2d52a3?0x0:_0x4fb53b[_0x4e45('0x1e')];var _0x53def2=_0x2d52a3?_0x27fdbf[_0x4e45('0x21')]:_0x4fb53b[_0x4e45('0x1e')]+_0x4fb53b[_0x4e45('0x20')];var _0x4b7acc;if(_0x53def2>=_0x26cca5){_0x53def2=_0x26cca5;_0x4b7acc=0xc8;}else{_0x4b7acc=0xce;}_0x5e528f[_0x4e45('0x1c')](_0x4b7acc);return _0x5e528f[_0x4e45('0x22')](_0x4e45('0x23'),_0x3d02a7+'-'+_0x53def2+'/'+_0x26cca5)[_0x4e45('0x1d')](_0x27fdbf);}return null;};}function patchUpdates(_0x27c2ba){return function(_0x933d11){try{jsonpatch[_0x4e45('0x24')](_0x933d11,_0x27c2ba,!![]);}catch(_0x3dea64){return BPromise[_0x4e45('0x25')](_0x3dea64);}return _0x933d11[_0x4e45('0x26')]();};}function saveUpdates(_0x8c383e,_0x24739e){return function(_0x3ed4e0){if(_0x3ed4e0){return _0x3ed4e0[_0x4e45('0x27')](_0x8c383e)[_0x4e45('0x28')](function(_0x451fc3){return _0x451fc3;});}return null;};}function removeEntity(_0x43cbb9,_0x204277){return function(_0x5260fd){if(_0x5260fd){return _0x5260fd[_0x4e45('0x29')]()[_0x4e45('0x28')](function(){var _0xa667d8=_0x5260fd[_0x4e45('0x2a')]({'plain':!![]});var _0x54238e=_0x4e45('0x2b');return db[_0x4e45('0x2c')][_0x4e45('0x29')]({'where':{'type':_0x54238e,'resourceId':_0xa667d8['id']}})['then'](function(){return _0x5260fd;});})[_0x4e45('0x28')](function(){_0x43cbb9[_0x4e45('0x1c')](0xcc)[_0x4e45('0x2d')]();});}};}function handleEntityNotFound(_0x23d4ff,_0x4a9156){return function(_0x8a4410){if(!_0x8a4410){_0x23d4ff[_0x4e45('0x1b')](0x194);}return _0x8a4410;};}function handleError(_0x154cfd,_0x3226ec){_0x3226ec=_0x3226ec||0x1f4;return function(_0x54ff5b){logger['error'](_0x54ff5b[_0x4e45('0x2e')]);if(_0x54ff5b[_0x4e45('0x2f')]){delete _0x54ff5b['name'];}_0x154cfd['status'](_0x3226ec)[_0x4e45('0x30')](_0x54ff5b);};}exports[_0x4e45('0x31')]=function(_0x50e483,_0x413178){var _0x587a1d={},_0x5e6b76={},_0xe7d9a4={'count':0x0,'rows':[]};var _0x279c76=_[_0x4e45('0x32')](db[_0x4e45('0x33')][_0x4e45('0x34')],function(_0x2ffefa){return{'name':_0x2ffefa[_0x4e45('0x35')],'type':_0x2ffefa['type'][_0x4e45('0x36')]};});_0x5e6b76['model']=_['map'](_0x279c76,'name');_0x5e6b76[_0x4e45('0x37')]=_[_0x4e45('0x38')](_0x50e483['query']);_0x5e6b76[_0x4e45('0x39')]=_[_0x4e45('0x3a')](_0x5e6b76[_0x4e45('0x3b')],_0x5e6b76[_0x4e45('0x37')]);_0x587a1d[_0x4e45('0x3c')]=_[_0x4e45('0x3a')](_0x5e6b76[_0x4e45('0x3b')],qs['fields'](_0x50e483[_0x4e45('0x37')][_0x4e45('0x3d')]));_0x587a1d[_0x4e45('0x3c')]=_0x587a1d['attributes'][_0x4e45('0x3e')]?_0x587a1d[_0x4e45('0x3c')]:_0x5e6b76['model'];if(!_0x50e483[_0x4e45('0x37')][_0x4e45('0x3f')](_0x4e45('0x40'))){_0x587a1d[_0x4e45('0x20')]=qs[_0x4e45('0x20')](_0x50e483[_0x4e45('0x37')][_0x4e45('0x20')]);_0x587a1d[_0x4e45('0x1e')]=qs[_0x4e45('0x1e')](_0x50e483[_0x4e45('0x37')][_0x4e45('0x1e')]);}_0x587a1d[_0x4e45('0x41')]=qs[_0x4e45('0x42')](_0x50e483[_0x4e45('0x37')][_0x4e45('0x42')]);delete _0x50e483['query']['sort'];_0x587a1d['where']=qs['filters'](_[_0x4e45('0x43')](_0x50e483[_0x4e45('0x37')],_0x5e6b76[_0x4e45('0x39')]),_0x279c76);if(_0x50e483['query'][_0x4e45('0x44')]){_0x587a1d[_0x4e45('0x45')]=_[_0x4e45('0x46')](_0x587a1d[_0x4e45('0x45')],{'$or':_[_0x4e45('0x32')](_0x279c76,function(_0x47237a){if(_0x47237a[_0x4e45('0x47')]!=='VIRTUAL'){var _0xde1b8d={};_0xde1b8d[_0x47237a['name']]={'$like':'%'+_0x50e483[_0x4e45('0x37')]['filter']+'%'};return _0xde1b8d;}})});}_0x587a1d=_[_0x4e45('0x46')]({},_0x587a1d,_0x50e483[_0x4e45('0x48')]);var _0x435f27={'where':_0x587a1d[_0x4e45('0x45')]};return db[_0x4e45('0x33')]['count'](_0x435f27)[_0x4e45('0x28')](function(_0x44e061){_0xe7d9a4[_0x4e45('0x21')]=_0x44e061;if(_0x50e483['query'][_0x4e45('0x49')]){_0x587a1d['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x4e45('0x4a')](_0x587a1d);})['then'](function(_0x1fcfa3){_0xe7d9a4['rows']=_0x1fcfa3;return _0xe7d9a4;})[_0x4e45('0x28')](respondWithFilteredResult(_0x413178,_0x587a1d))['catch'](handleError(_0x413178,null));};exports[_0x4e45('0x4b')]=function(_0x3714ad,_0x287af2){var _0x63d977={'raw':![],'where':{'id':_0x3714ad[_0x4e45('0x4c')]['id']}},_0x3ce2bd={};_0x3ce2bd[_0x4e45('0x3b')]=_[_0x4e45('0x38')](db[_0x4e45('0x33')][_0x4e45('0x34')]);_0x3ce2bd[_0x4e45('0x37')]=_[_0x4e45('0x38')](_0x3714ad['query']);_0x3ce2bd['filters']=_[_0x4e45('0x3a')](_0x3ce2bd['model'],_0x3ce2bd[_0x4e45('0x37')]);_0x63d977[_0x4e45('0x3c')]=_['intersection'](_0x3ce2bd[_0x4e45('0x3b')],qs['fields'](_0x3714ad['query'][_0x4e45('0x3d')]));_0x63d977['attributes']=_0x63d977[_0x4e45('0x3c')][_0x4e45('0x3e')]?_0x63d977[_0x4e45('0x3c')]:_0x3ce2bd[_0x4e45('0x3b')];if(_0x3714ad[_0x4e45('0x37')][_0x4e45('0x49')]){_0x63d977[_0x4e45('0x4d')]=[{'all':!![]}];}_0x63d977=_[_0x4e45('0x46')]({},_0x63d977,_0x3714ad['options']);return db[_0x4e45('0x33')][_0x4e45('0x4e')](_0x63d977)[_0x4e45('0x28')](handleEntityNotFound(_0x287af2,null))[_0x4e45('0x28')](respondWithResult(_0x287af2,null))['catch'](handleError(_0x287af2,null));};exports['update']=function(_0x788ea5,_0x332225){if(_0x788ea5[_0x4e45('0x4f')]['id']){delete _0x788ea5[_0x4e45('0x4f')]['id'];}return db[_0x4e45('0x33')]['find']({'where':{'id':_0x788ea5[_0x4e45('0x4c')]['id']}})[_0x4e45('0x28')](handleEntityNotFound(_0x332225,null))[_0x4e45('0x28')](saveUpdates(_0x788ea5[_0x4e45('0x4f')],null))['then'](respondWithResult(_0x332225,null))[_0x4e45('0x50')](handleError(_0x332225,null));};exports[_0x4e45('0x51')]=function(_0x56a792,_0x1d1427,_0x3cd403){return db[_0x4e45('0x52')][_0x4e45('0x53')](function(_0x5c3d6b){if(_0x56a792['body']['mode']===_0x4e45('0x54')){_0x56a792[_0x4e45('0x4f')][_0x4e45('0x55')]=path[_0x4e45('0x56')](config[_0x4e45('0x57')],_0x4e45('0x58'),_0x56a792[_0x4e45('0x4f')]['name']);}return db['VoiceMusicOnHold'][_0x4e45('0x51')](_0x56a792['body'],{'transaction':_0x5c3d6b})[_0x4e45('0x28')](function(_0x4370fb){if(_0x56a792[_0x4e45('0x4f')][_0x4e45('0x59')]===_0x4e45('0x54')){fs[_0x4e45('0x5a')](_0x4370fb['directory'],parseInt(_0x4e45('0x5b'),0x8));}var _0x1b006c=_0x56a792['user']['get']({'plain':!![]});if(!_0x1b006c)throw new Error(_0x4e45('0x5c'));if(_0x1b006c[_0x4e45('0x5d')]===_0x4e45('0x5e')){var _0x183aac=_0x4370fb['get']({'plain':!![]});return db[_0x4e45('0x5f')][_0x4e45('0x4e')]({'where':{'name':_0x4e45('0x2b'),'userProfileId':_0x1b006c['userProfileId']},'raw':!![]})[_0x4e45('0x28')](function(_0x1ad149){if(_0x1ad149&&_0x1ad149[_0x4e45('0x60')]===0x0){return db[_0x4e45('0x2c')]['create']({'name':_0x183aac['name'],'resourceId':_0x183aac['id'],'type':_0x1ad149['name'],'sectionId':_0x1ad149['id']},{})[_0x4e45('0x28')](function(){return _0x4370fb;});}else{return _0x4370fb;}})['catch'](function(_0x21447c){logger[_0x4e45('0x61')](_0x4e45('0x62'),_0x21447c);});}return _0x4370fb;});})[_0x4e45('0x28')](respondWithResult(_0x1d1427,0xc9))[_0x4e45('0x50')](handleError(_0x1d1427,null));};exports[_0x4e45('0x29')]=function(_0x24c1a7,_0x37be43,_0x4776eb){var _0x48067c;return db[_0x4e45('0x33')][_0x4e45('0x4e')]({'where':{'id':_0x24c1a7[_0x4e45('0x4c')]['id']}})[_0x4e45('0x28')](function(_0x139f0d){if(_0x139f0d){return db[_0x4e45('0x52')][_0x4e45('0x53')](function(_0x2b702e){return _0x139f0d[_0x4e45('0x29')]({'transaction':_0x2b702e,'raw':!![]})[_0x4e45('0x28')](function(_0x260e60){if(_0x260e60[_0x4e45('0x55')]){fs[_0x4e45('0x63')](_0x260e60[_0x4e45('0x55')])[_0x4e45('0x64')](function(_0x4173b7){fs['unlinkSync'](path[_0x4e45('0x56')](_0x260e60[_0x4e45('0x55')],_0x4173b7));});fs[_0x4e45('0x65')](_0x260e60[_0x4e45('0x55')]);}return _0x260e60;});})[_0x4e45('0x50')](function(_0x187899){throw new db[(_0x4e45('0x66'))][(_0x4e45('0x67'))](_0x187899['message']);});}})[_0x4e45('0x28')](handleEntityNotFound(_0x37be43,null))[_0x4e45('0x28')](removeEntity(_0x37be43,null))[_0x4e45('0x50')](handleError(_0x37be43,null));};exports[_0x4e45('0x68')]=function(_0x39be84,_0x4f88a3,_0x107250){return db[_0x4e45('0x52')][_0x4e45('0x53')](function(_0x20bbab){var _0x4fe952;return db[_0x4e45('0x33')][_0x4e45('0x4e')]({'where':{'id':_0x39be84[_0x4e45('0x4c')]['id']}})['then'](function(_0x89f70a){if(_0x89f70a){_0x4fe952=_0x89f70a;return _0x89f70a['addSound'](_0x39be84[_0x4e45('0x4f')]['id'],{'transaction':_0x20bbab});}})[_0x4e45('0x28')](function(_0x5ddcfc){if(_0x5ddcfc){return db['Sound']['findOne']({'where':{'id':_0x39be84['body']['id']},'attributes':['id',_0x4e45('0x2f'),_0x4e45('0x69'),_0x4e45('0x6a'),_0x4e45('0x6b')],'raw':!![]});}})[_0x4e45('0x28')](function(_0x207f8d){if(_0x207f8d){var _0x8a329f=path[_0x4e45('0x56')](config['root'],_0x4e45('0x6c'),util[_0x4e45('0x6d')](_0x4e45('0x6e'),path[_0x4e45('0x6f')](_0x207f8d[_0x4e45('0x69')],path['extname'](_0x207f8d[_0x4e45('0x69')])),_0x207f8d[_0x4e45('0x6a')]));var _0x32d47b=path[_0x4e45('0x56')](config[_0x4e45('0x57')],'server/files/moh',_0x4fe952[_0x4e45('0x2f')],util[_0x4e45('0x6d')](_0x4e45('0x6e'),_0x207f8d[_0x4e45('0x2f')],_0x207f8d['converted_format']));fs[_0x4e45('0x70')](_0x8a329f,_0x32d47b);return _0x207f8d;}})[_0x4e45('0x50')](function(_0x28f4c6){throw new db[(_0x4e45('0x66'))][(_0x4e45('0x67'))](_0x28f4c6[_0x4e45('0x71')]);});})[_0x4e45('0x28')](handleEntityNotFound(_0x4f88a3,null))[_0x4e45('0x28')](respondWithResult(_0x4f88a3,0xc9))[_0x4e45('0x50')](handleError(_0x4f88a3,null));};exports[_0x4e45('0x72')]=function(_0xcda584,_0x239c8d,_0x5347c2){return db['sequelize'][_0x4e45('0x53')](function(_0x54c5ca){var _0x297a38;return db[_0x4e45('0x33')][_0x4e45('0x73')]({'where':{'id':_0xcda584[_0x4e45('0x4c')]['id']}})['then'](handleEntityNotFound(_0x239c8d,null))[_0x4e45('0x28')](function(_0x43b5ad){if(_0x43b5ad){_0x297a38=_0x43b5ad;return _0x43b5ad[_0x4e45('0x72')](_0xcda584[_0x4e45('0x4c')][_0x4e45('0x74')]);}})[_0x4e45('0x28')](function(_0x205b5e){if(_0x205b5e){return db[_0x4e45('0x75')]['findOne']({'where':{'id':_0xcda584[_0x4e45('0x4c')]['id2']},'attributes':['id',_0x4e45('0x2f'),_0x4e45('0x69'),_0x4e45('0x6a'),_0x4e45('0x6b')],'raw':!![]});}})['then'](function(_0x574a99){if(_0x574a99){fs[_0x4e45('0x76')](path[_0x4e45('0x56')](_0x297a38[_0x4e45('0x55')],util['format'](_0x4e45('0x6e'),_0x574a99[_0x4e45('0x2f')],_0x574a99['converted_format'])));return _0x574a99;}})['catch'](function(_0x5ba93b){throw new db[(_0x4e45('0x66'))][(_0x4e45('0x67'))](_0x5ba93b[_0x4e45('0x71')]);});})[_0x4e45('0x28')](handleEntityNotFound(_0x239c8d,null))[_0x4e45('0x28')](respondWithStatusCode(_0x239c8d,0xcc))[_0x4e45('0x50')](handleError(_0x239c8d,null));};exports[_0x4e45('0x77')]=function(_0xccd9bb,_0x53f543,_0xf67c49){var _0xb42d9a={};var _0x9d6e66={};var _0x3b509f;var _0x18846d;return db[_0x4e45('0x33')]['findOne']({'where':{'id':_0xccd9bb[_0x4e45('0x4c')]['id']}})[_0x4e45('0x28')](handleEntityNotFound(_0x53f543,null))[_0x4e45('0x28')](function(_0x5b68f0){if(_0x5b68f0){_0x3b509f=_0x5b68f0;_0x9d6e66[_0x4e45('0x3b')]=_[_0x4e45('0x38')](db[_0x4e45('0x75')][_0x4e45('0x34')]);_0x9d6e66[_0x4e45('0x37')]=_['keys'](_0xccd9bb['query']);_0x9d6e66[_0x4e45('0x39')]=_['intersection'](_0x9d6e66[_0x4e45('0x3b')],_0x9d6e66[_0x4e45('0x37')]);_0xb42d9a['attributes']=_[_0x4e45('0x3a')](_0x9d6e66['model'],qs[_0x4e45('0x3d')](_0xccd9bb[_0x4e45('0x37')]['fields']));_0xb42d9a[_0x4e45('0x3c')]=_0xb42d9a[_0x4e45('0x3c')][_0x4e45('0x3e')]?_0xb42d9a[_0x4e45('0x3c')]:_0x9d6e66['model'];_0xb42d9a[_0x4e45('0x41')]=qs[_0x4e45('0x42')](_0xccd9bb[_0x4e45('0x37')]['sort']);_0xb42d9a[_0x4e45('0x45')]=qs[_0x4e45('0x39')](_[_0x4e45('0x43')](_0xccd9bb[_0x4e45('0x37')],_0x9d6e66[_0x4e45('0x39')]));if(_0xccd9bb['query'][_0x4e45('0x44')]){_0xb42d9a[_0x4e45('0x45')]=_[_0x4e45('0x46')](_0xb42d9a[_0x4e45('0x45')],{'$or':_[_0x4e45('0x32')](_0xb42d9a[_0x4e45('0x3c')],function(_0x5261b4){var _0x2d0606={};_0x2d0606[_0x5261b4]={'$like':'%'+_0xccd9bb['query'][_0x4e45('0x44')]+'%'};return _0x2d0606;})});}_0xb42d9a=_[_0x4e45('0x46')]({},_0xb42d9a,_0xccd9bb[_0x4e45('0x48')]);return _0x3b509f['getSounds'](_0xb42d9a);}})[_0x4e45('0x28')](function(_0x1d05d6){if(_0x1d05d6){_0x18846d=_0x1d05d6[_0x4e45('0x3e')];if(!_0xccd9bb['query'][_0x4e45('0x3f')](_0x4e45('0x40'))){_0xb42d9a[_0x4e45('0x20')]=qs['limit'](_0xccd9bb[_0x4e45('0x37')][_0x4e45('0x20')]);_0xb42d9a['offset']=qs[_0x4e45('0x1e')](_0xccd9bb[_0x4e45('0x37')][_0x4e45('0x1e')]);}return _0x3b509f[_0x4e45('0x77')](_0xb42d9a);}})[_0x4e45('0x28')](function(_0x4dabe8){if(_0x4dabe8){return _0x4dabe8?{'count':_0x18846d,'rows':_0x4dabe8}:null;}})[_0x4e45('0x28')](respondWithResult(_0x53f543,null))[_0x4e45('0x50')](handleError(_0x53f543,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 8e088b8..5abf47e 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 _0xe0e6=['path','rimraf','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe0e6,0x1ea));var _0x6e0e=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xe0e6[_0x9b3efc];return _0x200f05;};'use strict';var _=require(_0x6e0e('0x0'));var util=require(_0x6e0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e0e('0x2'));var BPromise=require(_0x6e0e('0x3'));var rp=require(_0x6e0e('0x4'));var fs=require('fs');var path=require(_0x6e0e('0x5'));var rimraf=require(_0x6e0e('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x6e0e('0x7')]=function(_0x1f89ab,_0xd606f5){return _0x1f89ab[_0x6e0e('0x8')](_0x6e0e('0x9'),attributes,{'tableName':_0x6e0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x576f=['request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x576f,0x10c));var _0xf576=function(_0x2f8862,_0x3282c9){_0x2f8862=_0x2f8862-0x0;var _0x28df65=_0x576f[_0x2f8862];return _0x28df65;};'use strict';var _=require(_0xf576('0x0'));var util=require(_0xf576('0x1'));var logger=require(_0xf576('0x2'))(_0xf576('0x3'));var moment=require(_0xf576('0x4'));var BPromise=require('bluebird');var rp=require(_0xf576('0x5'));var fs=require('fs');var path=require(_0xf576('0x6'));var rimraf=require('rimraf');var config=require(_0xf576('0x7'));var attributes=require(_0xf576('0x8'));module[_0xf576('0x9')]=function(_0x24f698,_0x3a87ec){return _0x24f698[_0xf576('0xa')](_0xf576('0xb'),attributes,{'tableName':_0xf576('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 850a96e..ce54eed 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x1ac8ea,_0x237157){var _0x599f36=function(_0x58a518){while(--_0x58a518){_0x1ac8ea['push'](_0x1ac8ea['shift']());}};_0x599f36(++_0x237157);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xcb91[_0x685346];return _0x52e15b;};'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')]('VoiceMusicOnHold,\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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x6f6f8a,_0x268f92){var _0xa4cf43=function(_0x140639){while(--_0x140639){_0x6f6f8a['push'](_0x6f6f8a['shift']());}};_0xa4cf43(++_0x268f92);}(_0x34e8,0x12c));var _0x834e=function(_0x99d712,_0x47246b){_0x99d712=_0x99d712-0x0;var _0x13cda0=_0x34e8[_0x99d712];return _0x13cda0;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6728c74..ffc8df0 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 _0xb030=['put','delete','destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','create','post'];(function(_0x4fd05b,_0x161c92){var _0x5d5133=function(_0x1e7d0e){while(--_0x1e7d0e){_0x4fd05b['push'](_0x4fd05b['shift']());}};_0x5d5133(++_0x161c92);}(_0xb030,0x1e9));var _0x0b03=function(_0x1aa277,_0x1edd4f){_0x1aa277=_0x1aa277-0x0;var _0x2f21e5=_0xb030[_0x1aa277];return _0x2f21e5;};'use strict';var multer=require(_0x0b03('0x0'));var util=require(_0x0b03('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0b03('0x2'));var router=express[_0x0b03('0x3')]();var fs_extra=require(_0x0b03('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0b03('0x5'));var config=require(_0x0b03('0x6'));var controller=require(_0x0b03('0x7'));router[_0x0b03('0x8')]('/',auth[_0x0b03('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0b03('0xa')]);router[_0x0b03('0x8')](_0x0b03('0xb'),auth[_0x0b03('0x9')](),controller[_0x0b03('0xc')]);router[_0x0b03('0x8')](_0x0b03('0xd'),auth[_0x0b03('0x9')](),controller[_0x0b03('0xe')]);router['post']('/',auth[_0x0b03('0x9')](),controller[_0x0b03('0xf')]);router[_0x0b03('0x10')](_0x0b03('0xd'),auth[_0x0b03('0x9')](),controller['addAgents']);router[_0x0b03('0x11')](_0x0b03('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0b03('0x12')](_0x0b03('0xb'),auth[_0x0b03('0x9')](),controller[_0x0b03('0x13')]);router[_0x0b03('0x12')]('/:id/users',auth[_0x0b03('0x9')](),controller[_0x0b03('0x14')]);module[_0x0b03('0x15')]=router; \ No newline at end of file +var _0x2296=['post','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/users','getAgents'];(function(_0x4fe370,_0x3e5324){var _0x4c191e=function(_0x4c0517){while(--_0x4c0517){_0x4fe370['push'](_0x4fe370['shift']());}};_0x4c191e(++_0x3e5324);}(_0x2296,0x91));var _0x6229=function(_0x3cf70d,_0x28347e){_0x3cf70d=_0x3cf70d-0x0;var _0x4df9d4=_0x2296[_0x3cf70d];return _0x4df9d4;};'use strict';var multer=require(_0x6229('0x0'));var util=require(_0x6229('0x1'));var path=require('path');var timeout=require(_0x6229('0x2'));var express=require(_0x6229('0x3'));var router=express[_0x6229('0x4')]();var fs_extra=require(_0x6229('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6229('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x6229('0x7')]('/',auth[_0x6229('0x8')](),controller[_0x6229('0x9')]);router[_0x6229('0x7')]('/describe',auth[_0x6229('0x8')](),controller[_0x6229('0xa')]);router[_0x6229('0x7')](_0x6229('0xb'),auth[_0x6229('0x8')](),controller[_0x6229('0xc')]);router[_0x6229('0x7')](_0x6229('0xd'),auth[_0x6229('0x8')](),controller[_0x6229('0xe')]);router[_0x6229('0xf')]('/',auth[_0x6229('0x8')](),controller['create']);router[_0x6229('0xf')]('/:id/users',auth[_0x6229('0x8')](),controller['addAgents']);router['put']('/:id',auth[_0x6229('0x8')](),controller['update']);router[_0x6229('0x10')]('/:id',auth[_0x6229('0x8')](),controller[_0x6229('0x11')]);router[_0x6229('0x10')](_0x6229('0xd'),auth[_0x6229('0x8')](),controller[_0x6229('0x12')]);module[_0x6229('0x13')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index e3f3471..e114ae8 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 _0xa10f=['INTEGER','sequelize','exports','STRING','VIRTUAL','system-','getDataValue'];(function(_0x4dc503,_0x2f54ae){var _0x55622e=function(_0x49af7c){while(--_0x49af7c){_0x4dc503['push'](_0x4dc503['shift']());}};_0x55622e(++_0x2f54ae);}(_0xa10f,0x190));var _0xfa10=function(_0x5299b1,_0x634f47){_0x5299b1=_0x5299b1-0x0;var _0x3405a8=_0xa10f[_0x5299b1];return _0x3405a8;};'use strict';var Sequelize=require(_0xfa10('0x0'));module[_0xfa10('0x1')]={'name':{'type':Sequelize[_0xfa10('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xfa10('0x3')],'get':function(_0x5697bc){return _0xfa10('0x4')+this[_0xfa10('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xfa10('0x2')]},'callerIdAll':{'type':Sequelize[_0xfa10('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xfa10('0x6')]}}; \ No newline at end of file +var _0xc60e=['exports','STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0x2b84c8,_0x183d8e){var _0x5cea29=function(_0xcf65d8){while(--_0xcf65d8){_0x2b84c8['push'](_0x2b84c8['shift']());}};_0x5cea29(++_0x183d8e);}(_0xc60e,0xbf));var _0xec60=function(_0x353bc0,_0x14d747){_0x353bc0=_0x353bc0-0x0;var _0x1606f6=_0xc60e[_0x353bc0];return _0x1606f6;};'use strict';var Sequelize=require(_0xec60('0x0'));module[_0xec60('0x1')]={'name':{'type':Sequelize[_0xec60('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xec60('0x3')],'get':function(_0x6955a){return _0xec60('0x4')+this[_0xec60('0x5')](_0xec60('0x6'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xec60('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xec60('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 27e213c..e3c5627 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 _0xa7b5=['stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','describe','create','sequelize','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','CDR(prefix)=','callerIdAll','push','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','body','system-','VoiceExtensionId','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','pick','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','error'];(function(_0x256eeb,_0x3a5ffd){var _0x2700eb=function(_0xa385ba){while(--_0xa385ba){_0x256eeb['push'](_0x256eeb['shift']());}};_0x2700eb(++_0x3a5ffd);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x558dd4,_0x2e7f4d){_0x558dd4=_0x558dd4-0x0;var _0x457367=_0xa7b5[_0x558dd4];return _0x457367;};'use strict';var emlformat=require(_0x5a7b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a7b('0x2'));var moment=require(_0x5a7b('0x3'));var BPromise=require(_0x5a7b('0x4'));var Mustache=require(_0x5a7b('0x5'));var util=require(_0x5a7b('0x6'));var path=require(_0x5a7b('0x7'));var sox=require(_0x5a7b('0x8'));var csv=require(_0x5a7b('0x9'));var ejs=require(_0x5a7b('0xa'));var fs=require('fs');var fs_extra=require(_0x5a7b('0xb'));var _=require(_0x5a7b('0xc'));var squel=require(_0x5a7b('0xd'));var crypto=require(_0x5a7b('0xe'));var jsforce=require(_0x5a7b('0xf'));var deskjs=require(_0x5a7b('0x10'));var toCsv=require(_0x5a7b('0x9'));var querystring=require(_0x5a7b('0x11'));var Papa=require(_0x5a7b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5a7b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a7b('0x14'));var logger=require(_0x5a7b('0x15'))(_0x5a7b('0x16'));var utils=require(_0x5a7b('0x17'));var config=require(_0x5a7b('0x18'));var licenseUtil=require(_0x5a7b('0x19'));var db=require(_0x5a7b('0x1a'))['db'];config[_0x5a7b('0x1b')]=_[_0x5a7b('0x1c')](config[_0x5a7b('0x1b')],{'host':_0x5a7b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a7b('0x1b')]));require(_0x5a7b('0x1e'))[_0x5a7b('0x1f')](socket);function respondWithStatusCode(_0x292a44,_0x540026){_0x540026=_0x540026||0xcc;return function(_0x1c6760){if(_0x1c6760){return _0x292a44[_0x5a7b('0x20')](_0x540026);}return _0x292a44['status'](_0x540026)[_0x5a7b('0x21')]();};}function respondWithResult(_0x4d2e57,_0x3d3239){_0x3d3239=_0x3d3239||0xc8;return function(_0x4b85e0){if(_0x4b85e0){return _0x4d2e57[_0x5a7b('0x22')](_0x3d3239)[_0x5a7b('0x23')](_0x4b85e0);}};}function respondWithFilteredResult(_0x2fc1fa,_0x5a3a89){return function(_0x33b996){if(_0x33b996){var _0x490d82=typeof _0x5a3a89[_0x5a7b('0x24')]===_0x5a7b('0x25')&&typeof _0x5a3a89[_0x5a7b('0x26')]===_0x5a7b('0x25');var _0x550b9a=_0x33b996[_0x5a7b('0x27')];var _0x15d8fb=_0x490d82?0x0:_0x5a3a89[_0x5a7b('0x24')];var _0x4dd310=_0x490d82?_0x33b996[_0x5a7b('0x27')]:_0x5a3a89[_0x5a7b('0x24')]+_0x5a3a89['limit'];var _0x49a892;if(_0x4dd310>=_0x550b9a){_0x4dd310=_0x550b9a;_0x49a892=0xc8;}else{_0x49a892=0xce;}_0x2fc1fa[_0x5a7b('0x22')](_0x49a892);return _0x2fc1fa[_0x5a7b('0x28')](_0x5a7b('0x29'),_0x15d8fb+'-'+_0x4dd310+'/'+_0x550b9a)[_0x5a7b('0x23')](_0x33b996);}return null;};}function patchUpdates(_0x285369){return function(_0x5d1063){try{jsonpatch['apply'](_0x5d1063,_0x285369,!![]);}catch(_0x1ad9cc){return BPromise[_0x5a7b('0x2a')](_0x1ad9cc);}return _0x5d1063[_0x5a7b('0x2b')]();};}function saveUpdates(_0x2a0550,_0x4b1c7f){return function(_0x4f4a3d){if(_0x4f4a3d){return _0x4f4a3d['update'](_0x2a0550)[_0x5a7b('0x2c')](function(_0x3fbff6){return _0x3fbff6;});}return null;};}function removeEntity(_0x11223d,_0x3e572a){return function(_0x26b4f3){if(_0x26b4f3){return _0x26b4f3['destroy']()[_0x5a7b('0x2c')](function(){var _0x55724d=_0x26b4f3[_0x5a7b('0x2d')]({'plain':!![]});var _0x547e82=_0x5a7b('0x2e');return db[_0x5a7b('0x2f')][_0x5a7b('0x30')]({'where':{'type':_0x547e82,'resourceId':_0x55724d['id']}})['then'](function(){return _0x26b4f3;});})[_0x5a7b('0x2c')](function(){_0x11223d[_0x5a7b('0x22')](0xcc)[_0x5a7b('0x21')]();});}};}function handleEntityNotFound(_0x54f1c6,_0x36b90e){return function(_0x3172a8){if(!_0x3172a8){_0x54f1c6[_0x5a7b('0x20')](0x194);}return _0x3172a8;};}function handleError(_0x3cb473,_0x426aa6){_0x426aa6=_0x426aa6||0x1f4;return function(_0x55a0ec){logger[_0x5a7b('0x31')](_0x55a0ec[_0x5a7b('0x32')]);if(_0x55a0ec[_0x5a7b('0x33')]){delete _0x55a0ec[_0x5a7b('0x33')];}_0x3cb473[_0x5a7b('0x22')](_0x426aa6)[_0x5a7b('0x34')](_0x55a0ec);};}exports['index']=function(_0x34f7a8,_0x550eec){var _0x453f49={},_0x54ea9d={},_0xe7f83a={'count':0x0,'rows':[]};var _0x2d49c6=_[_0x5a7b('0x35')](db[_0x5a7b('0x36')][_0x5a7b('0x37')],function(_0x2a09a2){return{'name':_0x2a09a2[_0x5a7b('0x38')],'type':_0x2a09a2['type'][_0x5a7b('0x39')]};});_0x54ea9d['model']=_[_0x5a7b('0x35')](_0x2d49c6,_0x5a7b('0x33'));_0x54ea9d[_0x5a7b('0x3a')]=_[_0x5a7b('0x3b')](_0x34f7a8['query']);_0x54ea9d[_0x5a7b('0x3c')]=_[_0x5a7b('0x3d')](_0x54ea9d[_0x5a7b('0x3e')],_0x54ea9d[_0x5a7b('0x3a')]);_0x453f49['attributes']=_[_0x5a7b('0x3d')](_0x54ea9d[_0x5a7b('0x3e')],qs[_0x5a7b('0x3f')](_0x34f7a8['query'][_0x5a7b('0x3f')]));_0x453f49[_0x5a7b('0x40')]=_0x453f49[_0x5a7b('0x40')][_0x5a7b('0x41')]?_0x453f49['attributes']:_0x54ea9d[_0x5a7b('0x3e')];if(!_0x34f7a8['query'][_0x5a7b('0x42')](_0x5a7b('0x43'))){_0x453f49[_0x5a7b('0x26')]=qs['limit'](_0x34f7a8[_0x5a7b('0x3a')][_0x5a7b('0x26')]);_0x453f49[_0x5a7b('0x24')]=qs[_0x5a7b('0x24')](_0x34f7a8[_0x5a7b('0x3a')][_0x5a7b('0x24')]);}_0x453f49[_0x5a7b('0x44')]=qs[_0x5a7b('0x45')](_0x34f7a8[_0x5a7b('0x3a')][_0x5a7b('0x45')]);_0x453f49['where']=qs['filters'](_['pick'](_0x34f7a8[_0x5a7b('0x3a')],_0x54ea9d['filters']),_0x2d49c6);if(_0x34f7a8[_0x5a7b('0x3a')]['filter']){_0x453f49[_0x5a7b('0x46')]=_[_0x5a7b('0x47')](_0x453f49[_0x5a7b('0x46')],{'$or':_[_0x5a7b('0x35')](_0x2d49c6,function(_0x142cc0){if(_0x142cc0['type']!==_0x5a7b('0x48')){var _0x3c51a6={};_0x3c51a6[_0x142cc0[_0x5a7b('0x33')]]={'$like':'%'+_0x34f7a8['query'][_0x5a7b('0x49')]+'%'};return _0x3c51a6;}})});}_0x453f49=_[_0x5a7b('0x47')]({},_0x453f49,_0x34f7a8[_0x5a7b('0x4a')]);var _0x476213={'where':_0x453f49[_0x5a7b('0x46')]};return db[_0x5a7b('0x36')]['count'](_0x476213)[_0x5a7b('0x2c')](function(_0x56aeca){_0xe7f83a[_0x5a7b('0x27')]=_0x56aeca;if(_0x34f7a8['query'][_0x5a7b('0x4b')]){_0x453f49['include']=[{'all':!![]}];}return db[_0x5a7b('0x36')][_0x5a7b('0x4c')](_0x453f49);})['then'](function(_0x5dcc35){_0xe7f83a[_0x5a7b('0x4d')]=_0x5dcc35;return _0xe7f83a;})['then'](respondWithFilteredResult(_0x550eec,_0x453f49))[_0x5a7b('0x4e')](handleError(_0x550eec,null));};exports['show']=function(_0x4cc88f,_0x479c6f){var _0x33ec3c={'raw':![],'where':{'id':_0x4cc88f[_0x5a7b('0x4f')]['id']}},_0x167a69={};_0x167a69['model']=_[_0x5a7b('0x3b')](db[_0x5a7b('0x36')]['rawAttributes']);_0x167a69[_0x5a7b('0x3a')]=_['keys'](_0x4cc88f[_0x5a7b('0x3a')]);_0x167a69['filters']=_['intersection'](_0x167a69[_0x5a7b('0x3e')],_0x167a69[_0x5a7b('0x3a')]);_0x33ec3c[_0x5a7b('0x40')]=_[_0x5a7b('0x3d')](_0x167a69[_0x5a7b('0x3e')],qs['fields'](_0x4cc88f[_0x5a7b('0x3a')][_0x5a7b('0x3f')]));_0x33ec3c[_0x5a7b('0x40')]=_0x33ec3c[_0x5a7b('0x40')]['length']?_0x33ec3c['attributes']:_0x167a69[_0x5a7b('0x3e')];if(_0x4cc88f['query'][_0x5a7b('0x4b')]){_0x33ec3c[_0x5a7b('0x50')]=[{'all':!![]}];}_0x33ec3c=_[_0x5a7b('0x47')]({},_0x33ec3c,_0x4cc88f[_0x5a7b('0x4a')]);return db['VoicePrefix'][_0x5a7b('0x51')](_0x33ec3c)['then'](handleEntityNotFound(_0x479c6f,null))['then'](respondWithResult(_0x479c6f,null))[_0x5a7b('0x4e')](handleError(_0x479c6f,null));};exports[_0x5a7b('0x30')]=function(_0x5eb7bf,_0x4f981e){return db['VoicePrefix'][_0x5a7b('0x51')]({'where':{'id':_0x5eb7bf[_0x5a7b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f981e,null))[_0x5a7b('0x2c')](removeEntity(_0x4f981e,null))[_0x5a7b('0x4e')](handleError(_0x4f981e,null));};exports['describe']=function(_0x28be64,_0x5a4557){return db[_0x5a7b('0x36')][_0x5a7b('0x52')]()[_0x5a7b('0x2c')](respondWithResult(_0x5a4557,null))[_0x5a7b('0x4e')](handleError(_0x5a4557,null));};exports[_0x5a7b('0x53')]=function(_0x4865fb,_0x3a9262){var _0x39538d;return db[_0x5a7b('0x54')]['transaction'](function(_0x2576dc){return db[_0x5a7b('0x36')][_0x5a7b('0x53')](_0x4865fb['body'],{'transaction':_0x2576dc})[_0x5a7b('0x2c')](function(_0x1775da){_0x39538d=_0x1775da['get']({'plain':!![]});return db[_0x5a7b('0x55')][_0x5a7b('0x51')]({'where':{'id':_0x39538d['VoiceExtensionId']},'raw':!![]})[_0x5a7b('0x2c')](function(_0x33690b){return createVoicePrefixExtensions(_0x39538d,_0x33690b,_0x2576dc);});});})['then'](function(){var _0x248a8a=_0x4865fb[_0x5a7b('0x56')][_0x5a7b('0x2d')]({'plain':!![]});if(!_0x248a8a)throw new Error(_0x5a7b('0x57'));if(_0x248a8a['role']===_0x5a7b('0x56')){var _0x4182df=_0x39538d;return db[_0x5a7b('0x58')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x248a8a[_0x5a7b('0x59')]},'raw':!![]})['then'](function(_0x3360f2){if(_0x3360f2&&_0x3360f2[_0x5a7b('0x5a')]===0x0){return db[_0x5a7b('0x2f')]['create']({'name':_0x4182df[_0x5a7b('0x33')],'resourceId':_0x4182df['id'],'type':_0x3360f2[_0x5a7b('0x33')],'sectionId':_0x3360f2['id']},{})[_0x5a7b('0x2c')](function(){return _0x39538d;});}else{return _0x39538d;}})[_0x5a7b('0x4e')](function(_0x459f9d){logger['error'](_0x5a7b('0x5b'),_0x459f9d);throw _0x459f9d;});}return _0x39538d;})[_0x5a7b('0x2c')](respondWithResult(_0x3a9262,null))['catch'](handleError(_0x3a9262,null));};function Extension(_0x205b64,_0x309e43,_0x20dd32,_0x3fa663){this['context']=_0x5a7b('0x5c');this[_0x5a7b('0x5d')]=_0x205b64;this[_0x5a7b('0x5e')]=_0x20dd32;this[_0x5a7b('0x5f')]=_0x5a7b('0x60');this[_0x5a7b('0x61')]=_0x5a7b('0x62');this[_0x5a7b('0x63')]=_0x309e43;this[_0x5a7b('0x64')]=_0x3fa663;}function createVoicePrefixExtensions(_0xa878fe,_0x25817e,_0x578f42){return new BPromise(function(_0x55795e,_0x5a1923){var _0x1e9d0a=new Extension(formatPrefixName(_0xa878fe[_0x5a7b('0x65')]),0x1,'NoOp',_0x5a7b('0x66'));_0x1e9d0a[_0x5a7b('0x67')]=_0xa878fe['id'];return db[_0x5a7b('0x55')][_0x5a7b('0x53')](_0x1e9d0a,{'transaction':_0x578f42})[_0x5a7b('0x2c')](function(_0x23ef20){var _0x15b8be=_0x23ef20[_0x5a7b('0x2d')]({'plain':!![]});var _0x38b48a=_[_0x5a7b('0x35')](addVoicePrefixExtensions(_0xa878fe,_0x25817e),function(_0x299dfc){_0x299dfc['VoiceExtensionId']=_0x15b8be['id'];_0x299dfc[_0x5a7b('0x67')]=_0xa878fe['id'];return _0x299dfc;});return db['VoiceExtension'][_0x5a7b('0x68')](_0x38b48a,{'transaction':_0x578f42})['then'](function(_0x118c4d){if(!_0x118c4d){return _0x5a1923(_0x5a7b('0x69'));}else{return _0x55795e(_0x118c4d);}})[_0x5a7b('0x4e')](function(_0x4437f0){return _0x5a1923(_0x4437f0);});});;});};function addVoicePrefixExtensions(_0x6369d2,_0x50c16a){var _0x3d95e2=[];var _0x28de29=formatPrefixName(_0x6369d2[_0x5a7b('0x65')]);_0x3d95e2['push'](new Extension(_0x28de29,0x2,'Set',_0x5a7b('0x6a')+_0x6369d2[_0x5a7b('0x33')]));if(_0x6369d2[_0x5a7b('0x6b')]){_0x3d95e2[_0x5a7b('0x6c')](new Extension(_0x28de29,0x3,_0x5a7b('0x6d'),'PREFIX-CALLERIDALL='+_0x6369d2[_0x5a7b('0x6b')]));}else{_0x3d95e2[_0x5a7b('0x6c')](new Extension(_0x28de29,0x3,_0x5a7b('0x6e'),_0x5a7b('0x6f')));}_0x3d95e2[_0x5a7b('0x6c')](new Extension(_0x28de29,0x4,_0x5a7b('0x70'),_0x50c16a['context']+','+_0x5a7b('0x71')+(0x8+_0x6369d2[_0x5a7b('0x33')][_0x5a7b('0x41')])+'}'+','+0x1));return _0x3d95e2;}function formatPrefixName(_0x2fd48e){var _0x598e46='_';for(var _0x56dffe=0x0;_0x56dffe<_0x2fd48e[_0x5a7b('0x41')];_0x56dffe++){if(_0x2fd48e[_0x5a7b('0x72')](_0x56dffe)=='-'){_0x598e46+=_0x2fd48e[_0x5a7b('0x72')](_0x56dffe);}else{_0x598e46+='['+_0x2fd48e[_0x5a7b('0x72')](_0x56dffe)+']';}}_0x598e46+='.';return _0x598e46;}exports[_0x5a7b('0x73')]=function(_0x235be6,_0x1fd33f,_0x161900){var _0x3ef293=_0x235be6[_0x5a7b('0x74')];_0x3ef293[_0x5a7b('0x65')]=_0x5a7b('0x75')+_0x3ef293['name']+'-';return db[_0x5a7b('0x54')]['transaction'](function(_0x4dfa46){return db[_0x5a7b('0x36')][_0x5a7b('0x73')](_0x3ef293,{'where':{'id':_0x3ef293['id']},'transaction':_0x4dfa46})[_0x5a7b('0x2c')](function(){return db[_0x5a7b('0x55')][_0x5a7b('0x30')]({'where':{'VoicePrefixId':_0x3ef293['id']},'transaction':_0x4dfa46})['then'](function(){return db[_0x5a7b('0x55')][_0x5a7b('0x51')]({'where':{'id':_0x3ef293[_0x5a7b('0x76')]},'raw':!![]})['then'](function(_0x21d157){return createVoicePrefixExtensions(_0x3ef293,_0x21d157,_0x4dfa46);});});});})[_0x5a7b('0x2c')](function(){return db[_0x5a7b('0x36')][_0x5a7b('0x77')](_0x3ef293['id']);})['then'](respondWithResult(_0x1fd33f,null))[_0x5a7b('0x4e')](handleError(_0x1fd33f,null));};exports[_0x5a7b('0x78')]=function(_0x20bd85,_0xa9bfa8,_0x4594e3){return db[_0x5a7b('0x36')][_0x5a7b('0x51')]({'where':{'id':_0x20bd85['params']['id']}})[_0x5a7b('0x2c')](handleEntityNotFound(_0xa9bfa8,null))['then'](function(_0x3bee74){if(_0x3bee74){return _0x3bee74[_0x5a7b('0x78')](_0x20bd85['body']['ids'],_[_0x5a7b('0x79')](_0x20bd85[_0x5a7b('0x74')],[_0x5a7b('0x7a'),'id'])||{})[_0x5a7b('0x7b')](function(_0x45ebe1){for(var _0x434b4a=0x0;_0x434b4a<_0x20bd85[_0x5a7b('0x74')][_0x5a7b('0x7a')]['length'];_0x434b4a+=0x1){socket[_0x5a7b('0x7c')](_0x5a7b('0x7d'),{'UserId':Number(_0x20bd85['body'][_0x5a7b('0x7a')][_0x434b4a]),'VoicePrefixId':Number(_0x20bd85[_0x5a7b('0x4f')]['id'])});}return _0x45ebe1;});}})[_0x5a7b('0x2c')](respondWithResult(_0xa9bfa8,null))[_0x5a7b('0x4e')](handleError(_0xa9bfa8,null));};exports[_0x5a7b('0x7e')]=function(_0x396c47,_0x2dc609,_0x43b284){return db[_0x5a7b('0x36')][_0x5a7b('0x51')]({'where':{'id':_0x396c47['params']['id']}})[_0x5a7b('0x2c')](handleEntityNotFound(_0x2dc609,null))[_0x5a7b('0x2c')](function(_0x3029e2){if(_0x3029e2){return _0x3029e2['removeAgents'](_0x396c47[_0x5a7b('0x3a')][_0x5a7b('0x7a')])[_0x5a7b('0x2c')](function(){if(_[_0x5a7b('0x7f')](_0x396c47[_0x5a7b('0x3a')]['ids'])){for(var _0x209f01=0x0;_0x209f01<_0x396c47['query'][_0x5a7b('0x7a')]['length'];_0x209f01+=0x1){socket[_0x5a7b('0x7c')](_0x5a7b('0x80'),{'UserId':Number(_0x396c47[_0x5a7b('0x3a')][_0x5a7b('0x7a')][_0x209f01]),'VoicePrefixId':Number(_0x396c47[_0x5a7b('0x4f')]['id'])});}}else{socket[_0x5a7b('0x7c')](_0x5a7b('0x80'),{'UserId':Number(_0x396c47[_0x5a7b('0x3a')][_0x5a7b('0x7a')]),'VoicePrefixId':Number(_0x396c47[_0x5a7b('0x4f')]['id'])});}});}})[_0x5a7b('0x2c')](respondWithStatusCode(_0x2dc609,null))[_0x5a7b('0x4e')](handleError(_0x2dc609,null));};exports['getAgents']=function(_0x3181bb,_0x36426f,_0x4bd312){var _0x3af2d1={};var _0x525e83={};var _0x1916c7;var _0x2935d5;return db['VoicePrefix'][_0x5a7b('0x81')]({'where':{'id':_0x3181bb[_0x5a7b('0x4f')]['id']}})[_0x5a7b('0x2c')](handleEntityNotFound(_0x36426f,null))[_0x5a7b('0x2c')](function(_0xc131a1){if(_0xc131a1){_0x1916c7=_0xc131a1;_0x525e83[_0x5a7b('0x3e')]=_[_0x5a7b('0x3b')](db['User']['rawAttributes']);_0x525e83[_0x5a7b('0x3a')]=_[_0x5a7b('0x3b')](_0x3181bb[_0x5a7b('0x3a')]);_0x525e83[_0x5a7b('0x3c')]=_[_0x5a7b('0x3d')](_0x525e83[_0x5a7b('0x3e')],_0x525e83[_0x5a7b('0x3a')]);_0x3af2d1[_0x5a7b('0x40')]=_[_0x5a7b('0x3d')](_0x525e83[_0x5a7b('0x3e')],qs[_0x5a7b('0x3f')](_0x3181bb['query'][_0x5a7b('0x3f')]));_0x3af2d1[_0x5a7b('0x40')]=_0x3af2d1[_0x5a7b('0x40')][_0x5a7b('0x41')]?_0x3af2d1[_0x5a7b('0x40')]:_0x525e83[_0x5a7b('0x3e')];_0x3af2d1[_0x5a7b('0x44')]=qs[_0x5a7b('0x45')](_0x3181bb['query'][_0x5a7b('0x45')]);_0x3af2d1[_0x5a7b('0x46')]=qs['filters'](_[_0x5a7b('0x82')](_0x3181bb[_0x5a7b('0x3a')],_0x525e83[_0x5a7b('0x3c')]));if(_0x3181bb[_0x5a7b('0x3a')][_0x5a7b('0x49')]){_0x3af2d1[_0x5a7b('0x46')]=_[_0x5a7b('0x47')](_0x3af2d1[_0x5a7b('0x46')],{'$or':_[_0x5a7b('0x35')](_0x3af2d1[_0x5a7b('0x40')],function(_0x3aeafc){var _0x539547={};_0x539547[_0x3aeafc]={'$like':'%'+_0x3181bb['query']['filter']+'%'};return _0x539547;})});}_0x3af2d1=_[_0x5a7b('0x47')]({},_0x3af2d1,_0x3181bb[_0x5a7b('0x4a')]);return _0x1916c7['getAgents'](_0x3af2d1);}})[_0x5a7b('0x2c')](function(_0x35d4bb){if(_0x35d4bb){_0x2935d5=_0x35d4bb[_0x5a7b('0x41')];if(!_0x3181bb['query'][_0x5a7b('0x42')](_0x5a7b('0x43'))){_0x3af2d1['limit']=qs[_0x5a7b('0x26')](_0x3181bb[_0x5a7b('0x3a')][_0x5a7b('0x26')]);_0x3af2d1[_0x5a7b('0x24')]=qs[_0x5a7b('0x24')](_0x3181bb[_0x5a7b('0x3a')][_0x5a7b('0x24')]);}return _0x1916c7[_0x5a7b('0x83')](_0x3af2d1);}})[_0x5a7b('0x2c')](function(_0x20b288){if(_0x20b288){return _0x20b288?{'count':_0x2935d5,'rows':_0x20b288}:null;}})[_0x5a7b('0x2c')](respondWithResult(_0x36426f,null))[_0x5a7b('0x4e')](handleError(_0x36426f,null));}; \ No newline at end of file +var _0xdc91=['addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','User','rawAttributes','pick','getAgents','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voicePrefix.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','end','error','stack','send','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','include','VoicePrefix','findAll','rows','find','catch','params','describe','sequelize','transaction','create','get','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','context','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','findById'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdc91,0x8b));var _0x1dc9=function(_0x8ea428,_0x132874){_0x8ea428=_0x8ea428-0x0;var _0x3362d6=_0xdc91[_0x8ea428];return _0x3362d6;};'use strict';var emlformat=require(_0x1dc9('0x0'));var rimraf=require(_0x1dc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dc9('0x2'));var Mustache=require(_0x1dc9('0x3'));var util=require(_0x1dc9('0x4'));var path=require(_0x1dc9('0x5'));var sox=require(_0x1dc9('0x6'));var csv=require(_0x1dc9('0x7'));var ejs=require(_0x1dc9('0x8'));var fs=require('fs');var fs_extra=require(_0x1dc9('0x9'));var _=require('lodash');var squel=require(_0x1dc9('0xa'));var crypto=require(_0x1dc9('0xb'));var jsforce=require(_0x1dc9('0xc'));var deskjs=require(_0x1dc9('0xd'));var toCsv=require(_0x1dc9('0x7'));var querystring=require(_0x1dc9('0xe'));var Papa=require(_0x1dc9('0xf'));var Redis=require(_0x1dc9('0x10'));var authService=require(_0x1dc9('0x11'));var qs=require(_0x1dc9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dc9('0x13'));var logger=require('../../config/logger')(_0x1dc9('0x14'));var utils=require('../../config/utils');var config=require(_0x1dc9('0x15'));var licenseUtil=require(_0x1dc9('0x16'));var db=require(_0x1dc9('0x17'))['db'];config[_0x1dc9('0x18')]=_['defaults'](config[_0x1dc9('0x18')],{'host':_0x1dc9('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1dc9('0x18')]));require(_0x1dc9('0x1a'))['register'](socket);function respondWithStatusCode(_0x5daaec,_0x8257d3){_0x8257d3=_0x8257d3||0xcc;return function(_0x197488){if(_0x197488){return _0x5daaec[_0x1dc9('0x1b')](_0x8257d3);}return _0x5daaec[_0x1dc9('0x1c')](_0x8257d3)['end']();};}function respondWithResult(_0x4e8c52,_0x2566bb){_0x2566bb=_0x2566bb||0xc8;return function(_0xeb26e9){if(_0xeb26e9){return _0x4e8c52['status'](_0x2566bb)[_0x1dc9('0x1d')](_0xeb26e9);}};}function respondWithFilteredResult(_0x46aaa6,_0x5b4d9a){return function(_0x197bcd){if(_0x197bcd){var _0x335590=typeof _0x5b4d9a[_0x1dc9('0x1e')]===_0x1dc9('0x1f')&&typeof _0x5b4d9a[_0x1dc9('0x20')]===_0x1dc9('0x1f');var _0x3bcb6f=_0x197bcd[_0x1dc9('0x21')];var _0x2a1c9b=_0x335590?0x0:_0x5b4d9a[_0x1dc9('0x1e')];var _0x5c75bd=_0x335590?_0x197bcd['count']:_0x5b4d9a[_0x1dc9('0x1e')]+_0x5b4d9a['limit'];var _0x4c25db;if(_0x5c75bd>=_0x3bcb6f){_0x5c75bd=_0x3bcb6f;_0x4c25db=0xc8;}else{_0x4c25db=0xce;}_0x46aaa6['status'](_0x4c25db);return _0x46aaa6[_0x1dc9('0x22')](_0x1dc9('0x23'),_0x2a1c9b+'-'+_0x5c75bd+'/'+_0x3bcb6f)[_0x1dc9('0x1d')](_0x197bcd);}return null;};}function patchUpdates(_0x1b6829){return function(_0xe1f7c6){try{jsonpatch[_0x1dc9('0x24')](_0xe1f7c6,_0x1b6829,!![]);}catch(_0x2b1ff8){return BPromise['reject'](_0x2b1ff8);}return _0xe1f7c6[_0x1dc9('0x25')]();};}function saveUpdates(_0x2a4740,_0x14181d){return function(_0x4c6e65){if(_0x4c6e65){return _0x4c6e65[_0x1dc9('0x26')](_0x2a4740)[_0x1dc9('0x27')](function(_0xec8330){return _0xec8330;});}return null;};}function removeEntity(_0x2192bd,_0x2dfe03){return function(_0x476111){if(_0x476111){return _0x476111[_0x1dc9('0x28')]()[_0x1dc9('0x27')](function(){var _0x3e70c3=_0x476111['get']({'plain':!![]});var _0x5635e5=_0x1dc9('0x29');return db[_0x1dc9('0x2a')][_0x1dc9('0x28')]({'where':{'type':_0x5635e5,'resourceId':_0x3e70c3['id']}})[_0x1dc9('0x27')](function(){return _0x476111;});})[_0x1dc9('0x27')](function(){_0x2192bd[_0x1dc9('0x1c')](0xcc)[_0x1dc9('0x2b')]();});}};}function handleEntityNotFound(_0x154370,_0x16b71d){return function(_0x5f1403){if(!_0x5f1403){_0x154370[_0x1dc9('0x1b')](0x194);}return _0x5f1403;};}function handleError(_0x445022,_0x2fcffc){_0x2fcffc=_0x2fcffc||0x1f4;return function(_0x2d75bc){logger[_0x1dc9('0x2c')](_0x2d75bc[_0x1dc9('0x2d')]);if(_0x2d75bc['name']){delete _0x2d75bc['name'];}_0x445022[_0x1dc9('0x1c')](_0x2fcffc)[_0x1dc9('0x2e')](_0x2d75bc);};}exports['index']=function(_0x14223b,_0x139cba){var _0x45889e={},_0x4b7796={},_0x24d96b={'count':0x0,'rows':[]};var _0x56f99f=_[_0x1dc9('0x2f')](db['VoicePrefix']['rawAttributes'],function(_0xe5e270){return{'name':_0xe5e270[_0x1dc9('0x30')],'type':_0xe5e270[_0x1dc9('0x31')][_0x1dc9('0x32')]};});_0x4b7796['model']=_[_0x1dc9('0x2f')](_0x56f99f,'name');_0x4b7796[_0x1dc9('0x33')]=_[_0x1dc9('0x34')](_0x14223b[_0x1dc9('0x33')]);_0x4b7796[_0x1dc9('0x35')]=_[_0x1dc9('0x36')](_0x4b7796[_0x1dc9('0x37')],_0x4b7796[_0x1dc9('0x33')]);_0x45889e[_0x1dc9('0x38')]=_['intersection'](_0x4b7796['model'],qs[_0x1dc9('0x39')](_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x39')]));_0x45889e[_0x1dc9('0x38')]=_0x45889e['attributes'][_0x1dc9('0x3a')]?_0x45889e['attributes']:_0x4b7796[_0x1dc9('0x37')];if(!_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x3b')](_0x1dc9('0x3c'))){_0x45889e[_0x1dc9('0x20')]=qs[_0x1dc9('0x20')](_0x14223b['query'][_0x1dc9('0x20')]);_0x45889e[_0x1dc9('0x1e')]=qs[_0x1dc9('0x1e')](_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x1e')]);}_0x45889e[_0x1dc9('0x3d')]=qs['sort'](_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x3e')]);_0x45889e[_0x1dc9('0x3f')]=qs[_0x1dc9('0x35')](_['pick'](_0x14223b[_0x1dc9('0x33')],_0x4b7796[_0x1dc9('0x35')]),_0x56f99f);if(_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x40')]){_0x45889e[_0x1dc9('0x3f')]=_[_0x1dc9('0x41')](_0x45889e[_0x1dc9('0x3f')],{'$or':_[_0x1dc9('0x2f')](_0x56f99f,function(_0x181865){if(_0x181865[_0x1dc9('0x31')]!==_0x1dc9('0x42')){var _0x38832d={};_0x38832d[_0x181865[_0x1dc9('0x43')]]={'$like':'%'+_0x14223b[_0x1dc9('0x33')][_0x1dc9('0x40')]+'%'};return _0x38832d;}})});}_0x45889e=_[_0x1dc9('0x41')]({},_0x45889e,_0x14223b[_0x1dc9('0x44')]);var _0x3188cb={'where':_0x45889e[_0x1dc9('0x3f')]};return db['VoicePrefix'][_0x1dc9('0x21')](_0x3188cb)[_0x1dc9('0x27')](function(_0x3a3033){_0x24d96b[_0x1dc9('0x21')]=_0x3a3033;if(_0x14223b['query'][_0x1dc9('0x45')]){_0x45889e[_0x1dc9('0x46')]=[{'all':!![]}];}return db[_0x1dc9('0x47')][_0x1dc9('0x48')](_0x45889e);})[_0x1dc9('0x27')](function(_0x437436){_0x24d96b[_0x1dc9('0x49')]=_0x437436;return _0x24d96b;})[_0x1dc9('0x27')](respondWithFilteredResult(_0x139cba,_0x45889e))['catch'](handleError(_0x139cba,null));};exports['show']=function(_0x10034b,_0x5306df){var _0xab8eb1={'raw':![],'where':{'id':_0x10034b['params']['id']}},_0x20f4ca={};_0x20f4ca[_0x1dc9('0x37')]=_[_0x1dc9('0x34')](db[_0x1dc9('0x47')]['rawAttributes']);_0x20f4ca[_0x1dc9('0x33')]=_[_0x1dc9('0x34')](_0x10034b[_0x1dc9('0x33')]);_0x20f4ca[_0x1dc9('0x35')]=_[_0x1dc9('0x36')](_0x20f4ca[_0x1dc9('0x37')],_0x20f4ca[_0x1dc9('0x33')]);_0xab8eb1[_0x1dc9('0x38')]=_[_0x1dc9('0x36')](_0x20f4ca[_0x1dc9('0x37')],qs['fields'](_0x10034b[_0x1dc9('0x33')][_0x1dc9('0x39')]));_0xab8eb1[_0x1dc9('0x38')]=_0xab8eb1['attributes'][_0x1dc9('0x3a')]?_0xab8eb1[_0x1dc9('0x38')]:_0x20f4ca[_0x1dc9('0x37')];if(_0x10034b[_0x1dc9('0x33')][_0x1dc9('0x45')]){_0xab8eb1[_0x1dc9('0x46')]=[{'all':!![]}];}_0xab8eb1=_[_0x1dc9('0x41')]({},_0xab8eb1,_0x10034b['options']);return db[_0x1dc9('0x47')][_0x1dc9('0x4a')](_0xab8eb1)[_0x1dc9('0x27')](handleEntityNotFound(_0x5306df,null))['then'](respondWithResult(_0x5306df,null))[_0x1dc9('0x4b')](handleError(_0x5306df,null));};exports['destroy']=function(_0x46b74b,_0x5a132c){return db['VoicePrefix'][_0x1dc9('0x4a')]({'where':{'id':_0x46b74b[_0x1dc9('0x4c')]['id']}})[_0x1dc9('0x27')](handleEntityNotFound(_0x5a132c,null))[_0x1dc9('0x27')](removeEntity(_0x5a132c,null))[_0x1dc9('0x4b')](handleError(_0x5a132c,null));};exports['describe']=function(_0x1b7205,_0x188cf9){return db[_0x1dc9('0x47')][_0x1dc9('0x4d')]()[_0x1dc9('0x27')](respondWithResult(_0x188cf9,null))['catch'](handleError(_0x188cf9,null));};exports['create']=function(_0x575ba5,_0x42bbe6){var _0x4bffce;return db[_0x1dc9('0x4e')][_0x1dc9('0x4f')](function(_0x467589){return db[_0x1dc9('0x47')][_0x1dc9('0x50')](_0x575ba5['body'],{'transaction':_0x467589})[_0x1dc9('0x27')](function(_0x3cbe33){_0x4bffce=_0x3cbe33[_0x1dc9('0x51')]({'plain':!![]});return db['VoiceExtension'][_0x1dc9('0x4a')]({'where':{'id':_0x4bffce[_0x1dc9('0x52')]},'raw':!![]})[_0x1dc9('0x27')](function(_0x5aa3f8){return createVoicePrefixExtensions(_0x4bffce,_0x5aa3f8,_0x467589);});});})[_0x1dc9('0x27')](function(){var _0x3f981b=_0x575ba5['user'][_0x1dc9('0x51')]({'plain':!![]});if(!_0x3f981b)throw new Error(_0x1dc9('0x53'));if(_0x3f981b[_0x1dc9('0x54')]===_0x1dc9('0x55')){var _0x2975f3=_0x4bffce;return db[_0x1dc9('0x56')][_0x1dc9('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3f981b[_0x1dc9('0x57')]},'raw':!![]})['then'](function(_0x2ed048){if(_0x2ed048&&_0x2ed048[_0x1dc9('0x58')]===0x0){return db[_0x1dc9('0x2a')][_0x1dc9('0x50')]({'name':_0x2975f3['name'],'resourceId':_0x2975f3['id'],'type':_0x2ed048[_0x1dc9('0x43')],'sectionId':_0x2ed048['id']},{})[_0x1dc9('0x27')](function(){return _0x4bffce;});}else{return _0x4bffce;}})[_0x1dc9('0x4b')](function(_0x26cc02){logger[_0x1dc9('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26cc02);throw _0x26cc02;});}return _0x4bffce;})[_0x1dc9('0x27')](respondWithResult(_0x42bbe6,null))['catch'](handleError(_0x42bbe6,null));};function Extension(_0x59b807,_0x324642,_0x467f78,_0x586dcd){this[_0x1dc9('0x59')]='from-sip';this[_0x1dc9('0x5a')]=_0x59b807;this[_0x1dc9('0x5b')]=_0x467f78;this[_0x1dc9('0x31')]=_0x1dc9('0x5c');this[_0x1dc9('0x5d')]=_0x1dc9('0x5e');this['priority']=_0x324642;this[_0x1dc9('0x5f')]=_0x586dcd;}function createVoicePrefixExtensions(_0x582f99,_0x1375bb,_0x1b84ae){return new BPromise(function(_0x162b5a,_0x282f37){var _0x43f841=new Extension(formatPrefixName(_0x582f99[_0x1dc9('0x60')]),0x1,_0x1dc9('0x61'),_0x1dc9('0x62'));_0x43f841['VoicePrefixId']=_0x582f99['id'];return db[_0x1dc9('0x63')][_0x1dc9('0x50')](_0x43f841,{'transaction':_0x1b84ae})[_0x1dc9('0x27')](function(_0x16e70e){var _0x3fc610=_0x16e70e[_0x1dc9('0x51')]({'plain':!![]});var _0x3affb1=_[_0x1dc9('0x2f')](addVoicePrefixExtensions(_0x582f99,_0x1375bb),function(_0x9dde7b){_0x9dde7b['VoiceExtensionId']=_0x3fc610['id'];_0x9dde7b[_0x1dc9('0x64')]=_0x582f99['id'];return _0x9dde7b;});return db['VoiceExtension'][_0x1dc9('0x65')](_0x3affb1,{'transaction':_0x1b84ae})[_0x1dc9('0x27')](function(_0x2b0fd8){if(!_0x2b0fd8){return _0x282f37(_0x1dc9('0x66'));}else{return _0x162b5a(_0x2b0fd8);}})[_0x1dc9('0x4b')](function(_0x4abc1e){return _0x282f37(_0x4abc1e);});});;});};function addVoicePrefixExtensions(_0x5426a2,_0x2657f5){var _0x2155e4=[];var _0x580d8a=formatPrefixName(_0x5426a2[_0x1dc9('0x60')]);_0x2155e4[_0x1dc9('0x67')](new Extension(_0x580d8a,0x2,'Set',_0x1dc9('0x68')+_0x5426a2[_0x1dc9('0x43')]));if(_0x5426a2[_0x1dc9('0x69')]){_0x2155e4[_0x1dc9('0x67')](new Extension(_0x580d8a,0x3,_0x1dc9('0x6a'),_0x1dc9('0x6b')+_0x5426a2[_0x1dc9('0x69')]));}else{_0x2155e4[_0x1dc9('0x67')](new Extension(_0x580d8a,0x3,_0x1dc9('0x61'),'No\x20callerid\x20available'));}_0x2155e4[_0x1dc9('0x67')](new Extension(_0x580d8a,0x4,_0x1dc9('0x6c'),_0x2657f5[_0x1dc9('0x59')]+','+_0x1dc9('0x6d')+(0x8+_0x5426a2[_0x1dc9('0x43')][_0x1dc9('0x3a')])+'}'+','+0x1));return _0x2155e4;}function formatPrefixName(_0xfaa728){var _0x423220='_';for(var _0x4e179c=0x0;_0x4e179c<_0xfaa728[_0x1dc9('0x3a')];_0x4e179c++){if(_0xfaa728[_0x1dc9('0x6e')](_0x4e179c)=='-'){_0x423220+=_0xfaa728['charAt'](_0x4e179c);}else{_0x423220+='['+_0xfaa728[_0x1dc9('0x6e')](_0x4e179c)+']';}}_0x423220+='.';return _0x423220;}exports['update']=function(_0x586938,_0x177cbb,_0x4059eb){var _0x133c52=_0x586938[_0x1dc9('0x6f')];_0x133c52[_0x1dc9('0x60')]='system-'+_0x133c52['name']+'-';return db[_0x1dc9('0x4e')][_0x1dc9('0x4f')](function(_0xae9249){return db[_0x1dc9('0x47')][_0x1dc9('0x26')](_0x133c52,{'where':{'id':_0x133c52['id']},'transaction':_0xae9249})[_0x1dc9('0x27')](function(){return db[_0x1dc9('0x63')][_0x1dc9('0x28')]({'where':{'VoicePrefixId':_0x133c52['id']},'transaction':_0xae9249})[_0x1dc9('0x27')](function(){return db[_0x1dc9('0x63')]['find']({'where':{'id':_0x133c52[_0x1dc9('0x52')]},'raw':!![]})[_0x1dc9('0x27')](function(_0xa81db1){return createVoicePrefixExtensions(_0x133c52,_0xa81db1,_0xae9249);});});});})[_0x1dc9('0x27')](function(){return db[_0x1dc9('0x47')][_0x1dc9('0x70')](_0x133c52['id']);})[_0x1dc9('0x27')](respondWithResult(_0x177cbb,null))[_0x1dc9('0x4b')](handleError(_0x177cbb,null));};exports['addAgents']=function(_0xcdf89e,_0x32effd,_0x4ea4a8){return db['VoicePrefix'][_0x1dc9('0x4a')]({'where':{'id':_0xcdf89e[_0x1dc9('0x4c')]['id']}})[_0x1dc9('0x27')](handleEntityNotFound(_0x32effd,null))[_0x1dc9('0x27')](function(_0x254b50){if(_0x254b50){return _0x254b50[_0x1dc9('0x71')](_0xcdf89e[_0x1dc9('0x6f')][_0x1dc9('0x72')],_[_0x1dc9('0x73')](_0xcdf89e['body'],[_0x1dc9('0x72'),'id'])||{})[_0x1dc9('0x74')](function(_0x17bcc6){for(var _0x5c399c=0x0;_0x5c399c<_0xcdf89e[_0x1dc9('0x6f')][_0x1dc9('0x72')][_0x1dc9('0x3a')];_0x5c399c+=0x1){socket[_0x1dc9('0x75')](_0x1dc9('0x76'),{'UserId':Number(_0xcdf89e[_0x1dc9('0x6f')][_0x1dc9('0x72')][_0x5c399c]),'VoicePrefixId':Number(_0xcdf89e['params']['id'])});}return _0x17bcc6;});}})[_0x1dc9('0x27')](respondWithResult(_0x32effd,null))[_0x1dc9('0x4b')](handleError(_0x32effd,null));};exports[_0x1dc9('0x77')]=function(_0x27b7c4,_0x290856,_0x371043){return db[_0x1dc9('0x47')][_0x1dc9('0x4a')]({'where':{'id':_0x27b7c4['params']['id']}})[_0x1dc9('0x27')](handleEntityNotFound(_0x290856,null))[_0x1dc9('0x27')](function(_0xa495fa){if(_0xa495fa){return _0xa495fa[_0x1dc9('0x77')](_0x27b7c4['query'][_0x1dc9('0x72')])['then'](function(){if(_['isArray'](_0x27b7c4[_0x1dc9('0x33')][_0x1dc9('0x72')])){for(var _0x34d9b0=0x0;_0x34d9b0<_0x27b7c4['query'][_0x1dc9('0x72')][_0x1dc9('0x3a')];_0x34d9b0+=0x1){socket[_0x1dc9('0x75')](_0x1dc9('0x78'),{'UserId':Number(_0x27b7c4[_0x1dc9('0x33')]['ids'][_0x34d9b0]),'VoicePrefixId':Number(_0x27b7c4[_0x1dc9('0x4c')]['id'])});}}else{socket[_0x1dc9('0x75')](_0x1dc9('0x78'),{'UserId':Number(_0x27b7c4[_0x1dc9('0x33')][_0x1dc9('0x72')]),'VoicePrefixId':Number(_0x27b7c4[_0x1dc9('0x4c')]['id'])});}});}})[_0x1dc9('0x27')](respondWithStatusCode(_0x290856,null))[_0x1dc9('0x4b')](handleError(_0x290856,null));};exports['getAgents']=function(_0x25f2e9,_0x785116,_0x23227d){var _0xfedc7f={};var _0x33749e={};var _0x24e726;var _0x1d7b54;return db[_0x1dc9('0x47')][_0x1dc9('0x79')]({'where':{'id':_0x25f2e9['params']['id']}})[_0x1dc9('0x27')](handleEntityNotFound(_0x785116,null))[_0x1dc9('0x27')](function(_0x42ec53){if(_0x42ec53){_0x24e726=_0x42ec53;_0x33749e[_0x1dc9('0x37')]=_[_0x1dc9('0x34')](db[_0x1dc9('0x7a')][_0x1dc9('0x7b')]);_0x33749e[_0x1dc9('0x33')]=_[_0x1dc9('0x34')](_0x25f2e9[_0x1dc9('0x33')]);_0x33749e[_0x1dc9('0x35')]=_[_0x1dc9('0x36')](_0x33749e[_0x1dc9('0x37')],_0x33749e[_0x1dc9('0x33')]);_0xfedc7f[_0x1dc9('0x38')]=_[_0x1dc9('0x36')](_0x33749e[_0x1dc9('0x37')],qs[_0x1dc9('0x39')](_0x25f2e9['query'][_0x1dc9('0x39')]));_0xfedc7f[_0x1dc9('0x38')]=_0xfedc7f['attributes'][_0x1dc9('0x3a')]?_0xfedc7f[_0x1dc9('0x38')]:_0x33749e['model'];_0xfedc7f[_0x1dc9('0x3d')]=qs['sort'](_0x25f2e9[_0x1dc9('0x33')][_0x1dc9('0x3e')]);_0xfedc7f[_0x1dc9('0x3f')]=qs[_0x1dc9('0x35')](_[_0x1dc9('0x7c')](_0x25f2e9['query'],_0x33749e[_0x1dc9('0x35')]));if(_0x25f2e9['query']['filter']){_0xfedc7f[_0x1dc9('0x3f')]=_[_0x1dc9('0x41')](_0xfedc7f[_0x1dc9('0x3f')],{'$or':_[_0x1dc9('0x2f')](_0xfedc7f[_0x1dc9('0x38')],function(_0x206052){var _0x1837da={};_0x1837da[_0x206052]={'$like':'%'+_0x25f2e9[_0x1dc9('0x33')]['filter']+'%'};return _0x1837da;})});}_0xfedc7f=_[_0x1dc9('0x41')]({},_0xfedc7f,_0x25f2e9['options']);return _0x24e726[_0x1dc9('0x7d')](_0xfedc7f);}})['then'](function(_0x3a670d){if(_0x3a670d){_0x1d7b54=_0x3a670d[_0x1dc9('0x3a')];if(!_0x25f2e9[_0x1dc9('0x33')][_0x1dc9('0x3b')](_0x1dc9('0x3c'))){_0xfedc7f[_0x1dc9('0x20')]=qs[_0x1dc9('0x20')](_0x25f2e9[_0x1dc9('0x33')][_0x1dc9('0x20')]);_0xfedc7f[_0x1dc9('0x1e')]=qs['offset'](_0x25f2e9[_0x1dc9('0x33')][_0x1dc9('0x1e')]);}return _0x24e726['getAgents'](_0xfedc7f);}})[_0x1dc9('0x27')](function(_0x5d6f99){if(_0x5d6f99){return _0x5d6f99?{'count':_0x1d7b54,'rows':_0x5d6f99}:null;}})['then'](respondWithResult(_0x785116,null))[_0x1dc9('0x4b')](handleError(_0x785116,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 18a712f..c565c92 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 _0x2d56=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x50cb02,_0x398d9a){var _0x5efe68=function(_0x51059f){while(--_0x51059f){_0x50cb02['push'](_0x50cb02['shift']());}};_0x5efe68(++_0x398d9a);}(_0x2d56,0xfc));var _0x62d5=function(_0x5d38a0,_0x24dd27){_0x5d38a0=_0x5d38a0-0x0;var _0x20a88f=_0x2d56[_0x5d38a0];return _0x20a88f;};'use strict';var EventEmitter=require(_0x62d5('0x0'));var VoicePrefix=require(_0x62d5('0x1'))['db'][_0x62d5('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x62d5('0x3')](0x0);var events={'afterCreate':_0x62d5('0x4'),'afterUpdate':_0x62d5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4dcf42){return function(_0x314db8,_0x449f4c,_0x21c19e){VoicePrefixEvents['emit'](_0x4dcf42+':'+_0x314db8['id'],_0x314db8);VoicePrefixEvents[_0x62d5('0x6')](_0x4dcf42,_0x314db8);_0x21c19e(null);};}for(var e in events){if(events[_0x62d5('0x7')](e)){var event=events[e];VoicePrefix[_0x62d5('0x8')](e,emitEvent(event));}}module[_0x62d5('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0xccc1=['update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','save'];(function(_0x4aeb63,_0x1bf62b){var _0x1feeee=function(_0x456ce4){while(--_0x456ce4){_0x4aeb63['push'](_0x4aeb63['shift']());}};_0x1feeee(++_0x1bf62b);}(_0xccc1,0x136));var _0x1ccc=function(_0x1f75e8,_0x7fa97f){_0x1f75e8=_0x1f75e8-0x0;var _0x120699=_0xccc1[_0x1f75e8];return _0x120699;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1ccc('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ccc('0x1'),'afterUpdate':_0x1ccc('0x2'),'afterDestroy':_0x1ccc('0x3')};function emitEvent(_0x1172d2){return function(_0x5308aa,_0x14d91f,_0x39c4d7){VoicePrefixEvents[_0x1ccc('0x4')](_0x1172d2+':'+_0x5308aa['id'],_0x5308aa);VoicePrefixEvents['emit'](_0x1172d2,_0x5308aa);_0x39c4d7(null);};}for(var e in events){if(events[_0x1ccc('0x5')](e)){var event=events[e];VoicePrefix[_0x1ccc('0x6')](e,emitEvent(event));}}module[_0x1ccc('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d7e4423..0205582 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 _0xd57f=['path','../../config/environment','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56d7f4,_0x528c7c){var _0x2a9d78=function(_0xe11315){while(--_0xe11315){_0x56d7f4['push'](_0x56d7f4['shift']());}};_0x2a9d78(++_0x528c7c);}(_0xd57f,0x19d));var _0xfd57=function(_0x1e91bc,_0x21cb08){_0x1e91bc=_0x1e91bc-0x0;var _0x3811dd=_0xd57f[_0x1e91bc];return _0x3811dd;};'use strict';var _=require(_0xfd57('0x0'));var util=require(_0xfd57('0x1'));var logger=require(_0xfd57('0x2'))(_0xfd57('0x3'));var moment=require(_0xfd57('0x4'));var BPromise=require(_0xfd57('0x5'));var rp=require(_0xfd57('0x6'));var fs=require('fs');var path=require(_0xfd57('0x7'));var rimraf=require('rimraf');var config=require(_0xfd57('0x8'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x19cc72,_0x4632ec){return _0x19cc72[_0xfd57('0x9')](_0xfd57('0xa'),attributes,{'tableName':_0xfd57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b3f=['rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','../../config/logger','bluebird','request-promise'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x2b3f,0x95));var _0xf2b3=function(_0x189968,_0x615b27){_0x189968=_0x189968-0x0;var _0x9aa892=_0x2b3f[_0x189968];return _0x9aa892;};'use strict';var _=require(_0xf2b3('0x0'));var util=require('util');var logger=require(_0xf2b3('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf2b3('0x2'));var rp=require(_0xf2b3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2b3('0x4'));var config=require('../../config/environment');var attributes=require(_0xf2b3('0x5'));module[_0xf2b3('0x6')]=function(_0x5179a1,_0x5cb76c){return _0x5179a1[_0xf2b3('0x7')](_0xf2b3('0x8'),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 021d61b..17bcc0b 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 _0x5360=['debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x3e9c60,_0x4582ae){var _0x569f61=function(_0x43db1a){while(--_0x43db1a){_0x3e9c60['push'](_0x3e9c60['shift']());}};_0x569f61(++_0x4582ae);}(_0x5360,0x157));var _0x0536=function(_0x1d5384,_0x5d6591){_0x1d5384=_0x1d5384-0x0;var _0x52df6b=_0x5360[_0x1d5384];return _0x52df6b;};'use strict';var _=require(_0x0536('0x0'));var util=require(_0x0536('0x1'));var moment=require(_0x0536('0x2'));var BPromise=require(_0x0536('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0536('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0536('0x5'))(_0x0536('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0536('0x7')]({'port':0x232a});config[_0x0536('0x8')]=_[_0x0536('0x9')](config[_0x0536('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0536('0xa'))(new Redis(config[_0x0536('0x8')]));require(_0x0536('0xb'))['register'](socket);function respondWithRpcPromise(_0x2ae1be,_0x53d6fd,_0x4a9530){return new BPromise(function(_0x5548ba,_0x532ab9){return client[_0x0536('0xc')](_0x2ae1be,_0x4a9530)[_0x0536('0xd')](function(_0x25b060){logger[_0x0536('0xe')](_0x0536('0xf'),_0x53d6fd,_0x0536('0x10'));logger[_0x0536('0x11')](_0x0536('0x12'),_0x53d6fd,_0x0536('0x10'),JSON[_0x0536('0x13')](_0x25b060));if(_0x25b060[_0x0536('0x14')]){if(_0x25b060[_0x0536('0x14')][_0x0536('0x15')]===0x1f4){logger['error'](_0x0536('0xf'),_0x53d6fd,_0x25b060[_0x0536('0x14')][_0x0536('0x16')]);return _0x532ab9(_0x25b060[_0x0536('0x14')][_0x0536('0x16')]);}logger['error'](_0x0536('0xf'),_0x53d6fd,_0x25b060[_0x0536('0x14')][_0x0536('0x16')]);return _0x5548ba(_0x25b060[_0x0536('0x14')]['message']);}else{logger['info'](_0x0536('0xf'),_0x53d6fd,_0x0536('0x10'));_0x5548ba(_0x25b060[_0x0536('0x17')]['message']);}})['catch'](function(_0x260faa){logger[_0x0536('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x53d6fd,_0x260faa);_0x532ab9(_0x260faa);});});} \ No newline at end of file +var _0xdeb3=['request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xdeb3,0xb7));var _0x3deb=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdeb3[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x3deb('0x0'));var moment=require(_0x3deb('0x1'));var BPromise=require(_0x3deb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3deb('0x3'))['db'];var utils=require(_0x3deb('0x4'));var logger=require(_0x3deb('0x5'))(_0x3deb('0x6'));var config=require(_0x3deb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3deb('0x8')]['http']({'port':0x232a});config[_0x3deb('0x9')]=_['defaults'](config[_0x3deb('0x9')],{'host':_0x3deb('0xa'),'port':0x18eb});var socket=require(_0x3deb('0xb'))(new Redis(config[_0x3deb('0x9')]));require(_0x3deb('0xc'))[_0x3deb('0xd')](socket);function respondWithRpcPromise(_0x2cd00a,_0x1d628e,_0x36c78a){return new BPromise(function(_0x54b603,_0x5a50f5){return client[_0x3deb('0xe')](_0x2cd00a,_0x36c78a)[_0x3deb('0xf')](function(_0x756238){logger['info'](_0x3deb('0x10'),_0x1d628e,_0x3deb('0x11'));logger[_0x3deb('0x12')](_0x3deb('0x13'),_0x1d628e,'request\x20sent',JSON['stringify'](_0x756238));if(_0x756238['error']){if(_0x756238[_0x3deb('0x14')][_0x3deb('0x15')]===0x1f4){logger[_0x3deb('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x1d628e,_0x756238[_0x3deb('0x14')][_0x3deb('0x16')]);return _0x5a50f5(_0x756238['error'][_0x3deb('0x16')]);}logger[_0x3deb('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x1d628e,_0x756238[_0x3deb('0x14')]['message']);return _0x54b603(_0x756238[_0x3deb('0x14')]['message']);}else{logger['info'](_0x3deb('0x10'),_0x1d628e,_0x3deb('0x11'));_0x54b603(_0x756238[_0x3deb('0x17')][_0x3deb('0x16')]);}})[_0x3deb('0x18')](function(_0x145d16){logger['error'](_0x3deb('0x10'),_0x1d628e,_0x145d16);_0x5a50f5(_0x145d16);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 255ac25..ef318d2 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 _0x9b87=['remove','update','emit','removeListener','register','length','./voicePrefix.events','save'];(function(_0x12fc3a,_0x55a37a){var _0x39c256=function(_0xfcd65b){while(--_0xfcd65b){_0x12fc3a['push'](_0x12fc3a['shift']());}};_0x39c256(++_0x55a37a);}(_0x9b87,0x8e));var _0x79b8=function(_0x13ba24,_0x3d86e1){_0x13ba24=_0x13ba24-0x0;var _0x25dd86=_0x9b87[_0x13ba24];return _0x25dd86;};'use strict';var VoicePrefixEvents=require(_0x79b8('0x0'));var events=[_0x79b8('0x1'),_0x79b8('0x2'),_0x79b8('0x3')];function createListener(_0x77ad5c,_0x4386a6){return function(_0x23b645){_0x4386a6[_0x79b8('0x4')](_0x77ad5c,_0x23b645);};}function removeListener(_0xbc1e74,_0xa65bbc){return function(){VoicePrefixEvents[_0x79b8('0x5')](_0xbc1e74,_0xa65bbc);};}exports[_0x79b8('0x6')]=function(_0x3ccc53){for(var _0x2e21b9=0x0,_0x1d2c9f=events[_0x79b8('0x7')];_0x2e21b9<_0x1d2c9f;_0x2e21b9++){var _0x5e10fe=events[_0x2e21b9];var _0x4e0dd8=createListener('voicePrefix:'+_0x5e10fe,_0x3ccc53);VoicePrefixEvents['on'](_0x5e10fe,_0x4e0dd8);}}; \ No newline at end of file +var _0xb910=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0xb910,0x12b));var _0x0b91=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb910[_0x173441];return _0x2423a8;};'use strict';var VoicePrefixEvents=require(_0x0b91('0x0'));var events=[_0x0b91('0x1'),_0x0b91('0x2'),_0x0b91('0x3')];function createListener(_0x3e7a8b,_0x1a7acd){return function(_0x25927f){_0x1a7acd[_0x0b91('0x4')](_0x3e7a8b,_0x25927f);};}function removeListener(_0x16ba05,_0x1bfbc7){return function(){VoicePrefixEvents[_0x0b91('0x5')](_0x16ba05,_0x1bfbc7);};}exports[_0x0b91('0x6')]=function(_0x295749){for(var _0x1800dc=0x0,_0x5a22b6=events[_0x0b91('0x7')];_0x1800dc<_0x5a22b6;_0x1800dc++){var _0xc65d86=events[_0x1800dc];var _0x3e8800=createListener(_0x0b91('0x8')+_0xc65d86,_0x295749);VoicePrefixEvents['on'](_0xc65d86,_0x3e8800);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index f6dcdfb..2f250d1 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 _0x21c4=['/:id/teams','/:id/users','getAgents','/:id/lists','getBlackLists','post','clone','addTeams','addLists','/:id/blacklists','addBlackLists','put','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks'];(function(_0x489c98,_0x3ea57b){var _0x114825=function(_0x17023d){while(--_0x17023d){_0x489c98['push'](_0x489c98['shift']());}};_0x114825(++_0x3ea57b);}(_0x21c4,0x1ac));var _0x421c=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0x21c4[_0x4dd479];return _0x1b6807;};'use strict';var multer=require('multer');var util=require(_0x421c('0x0'));var path=require('path');var timeout=require(_0x421c('0x1'));var express=require(_0x421c('0x2'));var router=express[_0x421c('0x3')]();var fs_extra=require(_0x421c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x421c('0x5'));var config=require(_0x421c('0x6'));var controller=require('./voiceQueue.controller');router[_0x421c('0x7')]('/',auth[_0x421c('0x8')](),controller[_0x421c('0x9')]);router[_0x421c('0x7')]('/:id',auth[_0x421c('0x8')](),controller[_0x421c('0xa')]);router[_0x421c('0x7')](_0x421c('0xb'),auth[_0x421c('0x8')](),controller[_0x421c('0xc')]);router[_0x421c('0x7')](_0x421c('0xd'),auth[_0x421c('0x8')](),controller['getHopperHistories']);router[_0x421c('0x7')]('/:id/hopper_finals',auth[_0x421c('0x8')](),controller['getHopperFinals']);router[_0x421c('0x7')](_0x421c('0xe'),auth['isAuthenticated'](),controller[_0x421c('0xf')]);router[_0x421c('0x7')](_0x421c('0x10'),auth[_0x421c('0x8')](),controller['getTeams']);router[_0x421c('0x7')](_0x421c('0x11'),auth[_0x421c('0x8')](),controller[_0x421c('0x12')]);router[_0x421c('0x7')]('/:id/members',auth[_0x421c('0x8')](),controller['getMembers']);router[_0x421c('0x7')](_0x421c('0x13'),auth[_0x421c('0x8')](),controller['getLists']);router[_0x421c('0x7')]('/:id/blacklists',auth[_0x421c('0x8')](),controller[_0x421c('0x14')]);router['post']('/',auth[_0x421c('0x8')](),controller['create']);router[_0x421c('0x15')]('/:id/clone',auth[_0x421c('0x8')](),controller[_0x421c('0x16')]);router['post'](_0x421c('0x10'),auth[_0x421c('0x8')](),controller[_0x421c('0x17')]);router['post'](_0x421c('0x11'),auth[_0x421c('0x8')](),controller['addAgents']);router['post'](_0x421c('0x13'),auth['isAuthenticated'](),controller[_0x421c('0x18')]);router[_0x421c('0x15')](_0x421c('0x19'),auth[_0x421c('0x8')](),controller[_0x421c('0x1a')]);router[_0x421c('0x1b')](_0x421c('0x1c'),auth['isAuthenticated'](),controller[_0x421c('0x1d')]);router[_0x421c('0x1e')]('/:id',auth[_0x421c('0x8')](),controller[_0x421c('0x1f')]);router[_0x421c('0x1e')](_0x421c('0x10'),auth[_0x421c('0x8')](),controller[_0x421c('0x20')]);router[_0x421c('0x1e')]('/:id/users',auth[_0x421c('0x8')](),controller[_0x421c('0x21')]);router[_0x421c('0x1e')](_0x421c('0x13'),auth[_0x421c('0x8')](),controller[_0x421c('0x22')]);router[_0x421c('0x1e')]('/:id/blacklists',auth[_0x421c('0x8')](),controller[_0x421c('0x23')]);module[_0x421c('0x24')]=router; \ No newline at end of file +var _0xc404=['/:id/users','addAgents','addLists','addBlackLists','update','delete','removeAgents','removeLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addTeams'];(function(_0x399bd4,_0x3c84ab){var _0x12d41b=function(_0x2341dc){while(--_0x2341dc){_0x399bd4['push'](_0x399bd4['shift']());}};_0x12d41b(++_0x3c84ab);}(_0xc404,0xdb));var _0x4c40=function(_0x5925bf,_0x58581c){_0x5925bf=_0x5925bf-0x0;var _0x58fe8e=_0xc404[_0x5925bf];return _0x58fe8e;};'use strict';var multer=require(_0x4c40('0x0'));var util=require('util');var path=require(_0x4c40('0x1'));var timeout=require(_0x4c40('0x2'));var express=require(_0x4c40('0x3'));var router=express[_0x4c40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c40('0x6'));var controller=require(_0x4c40('0x7'));router[_0x4c40('0x8')]('/',auth[_0x4c40('0x9')](),controller[_0x4c40('0xa')]);router[_0x4c40('0x8')](_0x4c40('0xb'),auth[_0x4c40('0x9')](),controller[_0x4c40('0xc')]);router[_0x4c40('0x8')](_0x4c40('0xd'),auth['isAuthenticated'](),controller[_0x4c40('0xe')]);router['get'](_0x4c40('0xf'),auth['isAuthenticated'](),controller[_0x4c40('0x10')]);router[_0x4c40('0x8')](_0x4c40('0x11'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x12')]);router[_0x4c40('0x8')](_0x4c40('0x13'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x14')]);router[_0x4c40('0x8')](_0x4c40('0x15'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x16')]);router['get']('/:id/users',auth[_0x4c40('0x9')](),controller[_0x4c40('0x17')]);router[_0x4c40('0x8')](_0x4c40('0x18'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x19')]);router[_0x4c40('0x8')](_0x4c40('0x1a'),auth[_0x4c40('0x9')](),controller['getLists']);router['get'](_0x4c40('0x1b'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x1c')]);router[_0x4c40('0x1d')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4c40('0x1d')](_0x4c40('0x1e'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x1f')]);router[_0x4c40('0x1d')](_0x4c40('0x15'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x20')]);router['post'](_0x4c40('0x21'),auth['isAuthenticated'](),controller[_0x4c40('0x22')]);router[_0x4c40('0x1d')](_0x4c40('0x1a'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x23')]);router[_0x4c40('0x1d')]('/:id/blacklists',auth[_0x4c40('0x9')](),controller[_0x4c40('0x24')]);router['put'](_0x4c40('0xb'),auth[_0x4c40('0x9')](),controller[_0x4c40('0x25')]);router[_0x4c40('0x26')](_0x4c40('0xb'),auth[_0x4c40('0x9')](),controller['destroy']);router[_0x4c40('0x26')]('/:id/teams',auth[_0x4c40('0x9')](),controller['removeTeams']);router[_0x4c40('0x26')](_0x4c40('0x21'),auth['isAuthenticated'](),controller[_0x4c40('0x27')]);router['delete']('/:id/lists',auth[_0x4c40('0x9')](),controller[_0x4c40('0x28')]);router['delete'](_0x4c40('0x1b'),auth[_0x4c40('0x9')](),controller['removeBlackLists']);module[_0x4c40('0x29')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index dbc6a0c..5651068 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 _0x83d3=['#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x83d3,0x159));var _0x383d=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0x83d3[_0x535963];return _0x3975f6;};'use strict';var Sequelize=require(_0x383d('0x0'));module['exports']={'name':{'type':Sequelize[_0x383d('0x1')],'allowNull':![],'unique':_0x383d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x4'),_0x383d('0x5')),'allowNull':![],'defaultValue':_0x383d('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x383d('0x6')},'announce':{'type':Sequelize[_0x383d('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x383d('0x3')]('rr',_0x383d('0x7'),_0x383d('0x8'),_0x383d('0x9'),'random',_0x383d('0xa'),'linear',_0x383d('0xb'),_0x383d('0xc')),'allowNull':![],'defaultValue':_0x383d('0x7'),'set':function(_0x38bc87){this[_0x383d('0xd')](_0x383d('0xe'),_0x38bc87?_0x38bc87:'rrmemory');},'get':function(){var _0x4d7a5a=this[_0x383d('0xf')](_0x383d('0x10'));var _0x15db16=this[_0x383d('0xf')]('dialMethod');var _0x276ecb=this['getDataValue'](_0x383d('0xe'));if(_0x4d7a5a===_0x383d('0x4')){return _0x276ecb;}if(_0x15db16==='booked'&&_0x276ecb===_0x383d('0xa')||_0x15db16===_0x383d('0x11')&&_0x276ecb===_0x383d('0x12')){return _0x276ecb;}if(_0x15db16===_0x383d('0x13')||_0x15db16===_0x383d('0x14')||_0x15db16===_0x383d('0x15')){return _0x276ecb;}return null;}},'servicelevel':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x383d('0x16')](0xb)},'timeout':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x383d('0x1')]},'weight':{'type':Sequelize[_0x383d('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x383d('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x17'),'no',_0x383d('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x383d('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x383d('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x383d('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x383d('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x383d('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x383d('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x383d('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x383d('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x17'),'no'),'defaultValue':_0x383d('0x17')},'announce_holdtime':{'type':Sequelize[_0x383d('0x3')]('yes','no',_0x383d('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x383d('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[_0x383d('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x383d('0x1')]},'queue_youarenext':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x383d('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x383d('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x383d('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x383d('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x383d('0x1a')],'set':function(_0x495cf7){this[_0x383d('0xd')](_0x383d('0x1b'),_0x495cf7?_0x495cf7[_0x383d('0x1c')](','):[]);},'get':function(){return this[_0x383d('0xf')](_0x383d('0x1b'))?this[_0x383d('0xf')](_0x383d('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x383d('0x1')],'defaultValue':_0x383d('0x17'),'set':function(_0x282157){this[_0x383d('0xd')](_0x383d('0x1d'),_0x282157?_0x282157[_0x383d('0x1c')](','):undefined);},'get':function(){return this[_0x383d('0xf')](_0x383d('0x1d'))?this[_0x383d('0xf')](_0x383d('0x1d'))[_0x383d('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'no','set':function(_0xc0437c){this[_0x383d('0xd')](_0x383d('0x1f'),_0xc0437c?_0xc0437c[_0x383d('0x1c')](','):undefined);},'get':function(){return this[_0x383d('0xf')](_0x383d('0x1f'))?this[_0x383d('0xf')](_0x383d('0x1f'))[_0x383d('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x383d('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x383d('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x383d('0x1')]},'description':{'type':Sequelize[_0x383d('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x30eda2){this[_0x383d('0xd')]('acw',_0x30eda2);if(_0x30eda2){if(this[_0x383d('0xf')](_0x383d('0x20'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x383d('0x21')],'defaultValue':0x0,'comment':_0x383d('0x22')},'dialMethod':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x23'),_0x383d('0x13'),_0x383d('0x15'),'predictive',_0x383d('0x11')),'defaultValue':_0x383d('0x13'),'comment':_0x383d('0x24')},'dialLimitChannel':{'type':Sequelize[_0x383d('0x16')](0x4)[_0x383d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x383d('0x16')](0x4)[_0x383d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x383d('0x26')},'dialPowerLevel':{'type':Sequelize[_0x383d('0x27')](0x2)[_0x383d('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x383d('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x29'),_0x383d('0x2a')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x383d('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x383d('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x383d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x383d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x383d('0x1')],'defaultValue':_0x383d('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x383d('0x1')],'comment':_0x383d('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'comment':_0x383d('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x383d('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x383d('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x36'),_0x383d('0x37'),_0x383d('0x38')),'defaultValue':_0x383d('0x36')},'dialAMDActive':{'type':Sequelize[_0x383d('0x21')],'defaultValue':0x0,'comment':_0x383d('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x383d('0x16')](0x9)[_0x383d('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x383d('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x383d('0x16')](0x9)[_0x383d('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x383d('0x16')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x383d('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x383d('0x16')](0x9)[_0x383d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x383d('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x383d('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x383d('0x16')](0x9)[_0x383d('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x383d('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x383d('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x383d('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x383d('0x16')](0x9)[_0x383d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x383d('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x383d('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x383d('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x383d('0x21')],'defaultValue':0x0,'comment':_0x383d('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x383d('0x3')](_0x383d('0x43'),_0x383d('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x383d('0x1')],'comment':_0x383d('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x383d('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x383d('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x383d('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x383d('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x383d('0x16')](0x5)[_0x383d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x383d('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x383d('0x16')],'allowNull':!![],'comment':_0x383d('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x383d('0x21')],'defaultValue':![],'comment':_0x383d('0x50'),'set':function(_0x5dbc52){if(!_0x5dbc52)this[_0x383d('0xd')]('mandatoryDispositionPauseId',null);this[_0x383d('0xd')](_0x383d('0x51'),_0x5dbc52);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x383d('0x16')](0x3)[_0x383d('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x6075=['rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x6075,0x191));var _0x5607=function(_0x3e13cf,_0x40f9de){_0x3e13cf=_0x3e13cf-0x0;var _0xc418ca=_0x6075[_0x3e13cf];return _0xc418ca;};'use strict';var Sequelize=require('sequelize');module[_0x5607('0x0')]={'name':{'type':Sequelize[_0x5607('0x1')],'allowNull':![],'unique':_0x5607('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x4'),_0x5607('0x5')),'allowNull':![],'defaultValue':_0x5607('0x4')},'musiconhold':{'type':Sequelize[_0x5607('0x1')],'defaultValue':_0x5607('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x5607('0x3')]('rr',_0x5607('0x7'),_0x5607('0x8'),'fewestcalls','random',_0x5607('0x9'),_0x5607('0xa'),_0x5607('0xb'),_0x5607('0xc')),'allowNull':![],'defaultValue':_0x5607('0x7'),'set':function(_0x4f61bf){this[_0x5607('0xd')](_0x5607('0xe'),_0x4f61bf?_0x4f61bf:_0x5607('0x9'));},'get':function(){var _0x4ea43b=this[_0x5607('0xf')]('type');var _0x49626b=this[_0x5607('0xf')](_0x5607('0x10'));var _0x9174a2=this['getDataValue'](_0x5607('0xe'));if(_0x4ea43b===_0x5607('0x4')){return _0x9174a2;}if(_0x49626b===_0x5607('0x11')&&_0x9174a2===_0x5607('0x9')||_0x49626b===_0x5607('0x11')&&_0x9174a2===_0x5607('0x12')){return _0x9174a2;}if(_0x49626b===_0x5607('0x13')||_0x49626b===_0x5607('0x14')||_0x49626b===_0x5607('0x15')){return _0x9174a2;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5607('0x16')](0xb)},'timeout':{'type':Sequelize[_0x5607('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x5607('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':_0x5607('0x17')},'autopause':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no',_0x5607('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x5607('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5607('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5607('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x5607('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5607('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5607('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':_0x5607('0x17')},'announce_holdtime':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no',_0x5607('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5607('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x5607('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x5607('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5607('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5607('0x1')]},'queue_youarenext':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5607('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5607('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x5607('0x1')]},'queue_less_than':{'type':Sequelize[_0x5607('0x1')]},'periodic_announce':{'type':Sequelize[_0x5607('0x1a')],'set':function(_0x16bb98){this[_0x5607('0xd')]('periodic_announce',_0x16bb98?_0x16bb98[_0x5607('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x5607('0x1c'))?this[_0x5607('0xf')](_0x5607('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x5607('0x1')],'defaultValue':'yes','set':function(_0x46f9b8){this[_0x5607('0xd')](_0x5607('0x1d'),_0x46f9b8?_0x46f9b8[_0x5607('0x1b')](','):undefined);},'get':function(){return this[_0x5607('0xf')]('joinempty')?this[_0x5607('0xf')]('joinempty')[_0x5607('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5607('0x1')],'defaultValue':'no','set':function(_0x4a21b5){this[_0x5607('0xd')](_0x5607('0x1f'),_0x4a21b5?_0x4a21b5[_0x5607('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x5607('0x1f'))?this[_0x5607('0xf')](_0x5607('0x1f'))[_0x5607('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5607('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5607('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5607('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5607('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2ed4c2){this[_0x5607('0xd')](_0x5607('0x20'),_0x2ed4c2);if(_0x2ed4c2){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x5607('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5607('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5607('0x22')],'defaultValue':0x0,'comment':_0x5607('0x23')},'dialMethod':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x24'),_0x5607('0x13'),_0x5607('0x15'),'predictive',_0x5607('0x11')),'defaultValue':_0x5607('0x13'),'comment':_0x5607('0x25')},'dialLimitChannel':{'type':Sequelize[_0x5607('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5607('0x26')},'dialLimitQueue':{'type':Sequelize[_0x5607('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x5607('0x27')](0x2)[_0x5607('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5607('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x5607('0x2a'),'comment':_0x5607('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5607('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5607('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5607('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5607('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5607('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x5607('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5607('0x1')],'defaultValue':_0x5607('0x2e'),'comment':_0x5607('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x5607('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5607('0x28')],'defaultValue':0x3,'comment':_0x5607('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5607('0x37')},'dialTimezone':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5607('0x38')},'dialPrefix':{'type':Sequelize[_0x5607('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x39'),_0x5607('0x3a'),'onlyIfOpen'),'defaultValue':_0x5607('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5607('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5607('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5607('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5607('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5607('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5607('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5607('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5607('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5607('0x16')](0x5)[_0x5607('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5607('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5607('0x16')](0x9)[_0x5607('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5607('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x5607('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5607('0x44')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5607('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5607('0x3')](_0x5607('0x46'),_0x5607('0x47')),'defaultValue':_0x5607('0x46')},'dialQueueProject2':{'type':Sequelize[_0x5607('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5607('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5607('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5607('0x48')},'dialCutDigit':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x4a')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x4b')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5607('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5607('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5607('0x16')](0x5)[_0x5607('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5607('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5607('0x16')],'allowNull':!![],'comment':_0x5607('0x50')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x279420){if(!_0x279420)this['setDataValue'](_0x5607('0x51'),null);this['setDataValue']('mandatoryDisposition',_0x279420);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5607('0x16')](0x3)[_0x5607('0x28')],'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 2b7f5ef..d564e3f 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 _0x83a6=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','./voiceQueue.socket','register','sendStatus','status','end','offset','count','limit','Content-Range','json','apply','reject','save','update','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','then','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','omit','createdAt','VoiceQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','hasOwnProperty','options','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','each','UserVoiceQueue','findOrCreate','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','ids','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','toString','sequelize','QueryTypes','TeamId','union','transaction','removeTeams','removeAgents','UserVoiceQueueRt','addAgents','isEmpty','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','NOW()','updatedAt','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','ListId\x20=\x20?','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x83a6,0xb1));var _0x683a=function(_0x2bc944,_0x295a6c){_0x2bc944=_0x2bc944-0x0;var _0x467676=_0x83a6[_0x2bc944];return _0x467676;};'use strict';var emlformat=require(_0x683a('0x0'));var rimraf=require(_0x683a('0x1'));var zipdir=require(_0x683a('0x2'));var jsonpatch=require(_0x683a('0x3'));var rp=require(_0x683a('0x4'));var moment=require(_0x683a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x683a('0x6'));var util=require(_0x683a('0x7'));var path=require(_0x683a('0x8'));var sox=require('sox');var csv=require(_0x683a('0x9'));var ejs=require(_0x683a('0xa'));var fs=require('fs');var fs_extra=require(_0x683a('0xb'));var _=require(_0x683a('0xc'));var squel=require(_0x683a('0xd'));var crypto=require(_0x683a('0xe'));var jsforce=require(_0x683a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x683a('0x9'));var querystring=require('querystring');var Papa=require(_0x683a('0x10'));var Redis=require(_0x683a('0x11'));var authService=require(_0x683a('0x12'));var qs=require(_0x683a('0x13'));var as=require(_0x683a('0x14'));var hardwareService=require(_0x683a('0x15'));var logger=require('../../config/logger')(_0x683a('0x16'));var utils=require('../../config/utils');var config=require(_0x683a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x683a('0x18'))['db'];config[_0x683a('0x19')]=_['defaults'](config[_0x683a('0x19')],{'host':_0x683a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x683a('0x19')]));require(_0x683a('0x1b'))[_0x683a('0x1c')](socket);function respondWithStatusCode(_0x410c79,_0x27e9b4){_0x27e9b4=_0x27e9b4||0xcc;return function(_0x5e4ea0){if(_0x5e4ea0){return _0x410c79[_0x683a('0x1d')](_0x27e9b4);}return _0x410c79[_0x683a('0x1e')](_0x27e9b4)[_0x683a('0x1f')]();};}function respondWithResult(_0x509d0c,_0x144617){_0x144617=_0x144617||0xc8;return function(_0x249a5b){if(_0x249a5b){return _0x509d0c[_0x683a('0x1e')](_0x144617)['json'](_0x249a5b);}};}function respondWithFilteredResult(_0x43bfeb,_0x2704e3){return function(_0x183d8f){if(_0x183d8f){var _0x249faf=typeof _0x2704e3[_0x683a('0x20')]==='undefined'&&typeof _0x2704e3['limit']==='undefined';var _0x44f84f=_0x183d8f[_0x683a('0x21')];var _0x4623ae=_0x249faf?0x0:_0x2704e3['offset'];var _0x4dd212=_0x249faf?_0x183d8f[_0x683a('0x21')]:_0x2704e3['offset']+_0x2704e3[_0x683a('0x22')];var _0x96b854;if(_0x4dd212>=_0x44f84f){_0x4dd212=_0x44f84f;_0x96b854=0xc8;}else{_0x96b854=0xce;}_0x43bfeb[_0x683a('0x1e')](_0x96b854);return _0x43bfeb['set'](_0x683a('0x23'),_0x4623ae+'-'+_0x4dd212+'/'+_0x44f84f)[_0x683a('0x24')](_0x183d8f);}return null;};}function patchUpdates(_0x9124ab){return function(_0x1ae5b1){try{jsonpatch[_0x683a('0x25')](_0x1ae5b1,_0x9124ab,!![]);}catch(_0x34edb0){return BPromise[_0x683a('0x26')](_0x34edb0);}return _0x1ae5b1[_0x683a('0x27')]();};}function saveUpdates(_0x466bf6,_0x21b50c){return function(_0x46dc21){if(_0x46dc21){return _0x46dc21[_0x683a('0x28')](_0x466bf6)['then'](function(_0x40f7df){return _0x40f7df;});}return null;};}function removeEntity(_0x4b8f4f,_0x4ec644){return function(_0x54a448){if(_0x54a448){return _0x54a448[_0x683a('0x29')]()['then'](function(){var _0x4f4bcd=_0x54a448[_0x683a('0x2a')]({'plain':!![]});var _0x1d3675=[{'name':'VoiceQueues','value':_0x683a('0x2b'),'ignore':![]},{'name':_0x683a('0x2c'),'value':_0x683a('0x2d'),'ignore':![]}];var _0x15c7bc=_(_0x1d3675)[_0x683a('0x2e')](_0x683a('0x2f'))['map'](_0x683a('0x30'))[_0x683a('0x30')]();if(_[_0x683a('0x31')](_0x15c7bc,_0x4f4bcd[_0x683a('0x32')])){return;}var _0x59ea02=_[_0x683a('0x33')](_0x1d3675,[_0x683a('0x30'),_0x4f4bcd[_0x683a('0x32')]])[_0x683a('0x34')];return db[_0x683a('0x35')]['destroy']({'where':{'type':_0x59ea02,'resourceId':_0x4f4bcd['id']}})[_0x683a('0x36')](function(){return _0x54a448;});})[_0x683a('0x36')](function(){_0x4b8f4f['status'](0xcc)[_0x683a('0x1f')]();});}};}function handleEntityNotFound(_0x4a8895,_0x12e8ef){return function(_0x2fda69){if(!_0x2fda69){_0x4a8895[_0x683a('0x1d')](0x194);}return _0x2fda69;};}function handleError(_0x43b513,_0x4cb7cd){_0x4cb7cd=_0x4cb7cd||0x1f4;return function(_0x4e0ad5){logger[_0x683a('0x37')](_0x4e0ad5[_0x683a('0x38')]);if(_0x4e0ad5[_0x683a('0x34')]){delete _0x4e0ad5[_0x683a('0x34')];}_0x43b513['status'](_0x4cb7cd)['send'](_0x4e0ad5);};}exports[_0x683a('0x39')]=function(_0x477651,_0xb2aca){var _0x43cdaa={},_0x11aad6={},_0xfd4c54={'count':0x0,'rows':[]};var _0x3b6e97=_['map'](db[_0x683a('0x3a')][_0x683a('0x3b')],function(_0x4f7f3b){return{'name':_0x4f7f3b[_0x683a('0x3c')],'type':_0x4f7f3b[_0x683a('0x32')][_0x683a('0x3d')]};});_0x11aad6[_0x683a('0x3e')]=_[_0x683a('0x3f')](_0x3b6e97,_0x683a('0x34'));_0x11aad6['query']=_[_0x683a('0x40')](_0x477651[_0x683a('0x41')]);_0x11aad6[_0x683a('0x42')]=_[_0x683a('0x43')](_0x11aad6['model'],_0x11aad6[_0x683a('0x41')]);_0x43cdaa[_0x683a('0x44')]=_[_0x683a('0x43')](_0x11aad6[_0x683a('0x3e')],qs['fields'](_0x477651[_0x683a('0x41')][_0x683a('0x45')]));_0x43cdaa[_0x683a('0x44')]=_0x43cdaa[_0x683a('0x44')][_0x683a('0x46')]?_0x43cdaa[_0x683a('0x44')]:_0x11aad6[_0x683a('0x3e')];if(!_0x477651[_0x683a('0x41')]['hasOwnProperty'](_0x683a('0x47'))){_0x43cdaa['limit']=qs[_0x683a('0x22')](_0x477651[_0x683a('0x41')][_0x683a('0x22')]);_0x43cdaa[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x477651[_0x683a('0x41')][_0x683a('0x20')]);}_0x43cdaa[_0x683a('0x48')]=qs[_0x683a('0x49')](_0x477651[_0x683a('0x41')]['sort']);_0x43cdaa[_0x683a('0x4a')]=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x477651['query'],_0x11aad6[_0x683a('0x42')]),_0x3b6e97);if(_0x477651[_0x683a('0x41')][_0x683a('0x2e')]){_0x43cdaa[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x43cdaa['where'],{'$or':_[_0x683a('0x3f')](_0x3b6e97,function(_0xd7d2a4){if(_0xd7d2a4[_0x683a('0x32')]!==_0x683a('0x4d')){var _0x286fe9={};_0x286fe9[_0xd7d2a4[_0x683a('0x34')]]={'$like':'%'+_0x477651[_0x683a('0x41')]['filter']+'%'};return _0x286fe9;}})});}_0x43cdaa=_['merge']({},_0x43cdaa,_0x477651['options']);var _0x5c3061={'where':_0x43cdaa[_0x683a('0x4a')]};return db['VoiceQueue'][_0x683a('0x21')](_0x5c3061)[_0x683a('0x36')](function(_0x76982d){_0xfd4c54[_0x683a('0x21')]=_0x76982d;if(_0x477651[_0x683a('0x41')][_0x683a('0x4e')]){_0x43cdaa[_0x683a('0x4f')]=[{'all':!![]}];}return db[_0x683a('0x3a')][_0x683a('0x50')](_0x43cdaa);})[_0x683a('0x36')](function(_0x262c25){_0xfd4c54[_0x683a('0x51')]=_0x262c25;return _0xfd4c54;})[_0x683a('0x36')](respondWithFilteredResult(_0xb2aca,_0x43cdaa))['catch'](handleError(_0xb2aca,null));};exports[_0x683a('0x52')]=function(_0xb76277,_0x15696c){var _0x59b31e={'raw':![],'where':{'id':_0xb76277[_0x683a('0x53')]['id']}},_0x4266bc={};_0x4266bc[_0x683a('0x3e')]=_[_0x683a('0x40')](db[_0x683a('0x3a')][_0x683a('0x3b')]);_0x4266bc[_0x683a('0x41')]=_[_0x683a('0x40')](_0xb76277[_0x683a('0x41')]);_0x4266bc[_0x683a('0x42')]=_[_0x683a('0x43')](_0x4266bc[_0x683a('0x3e')],_0x4266bc[_0x683a('0x41')]);_0x59b31e[_0x683a('0x44')]=_['intersection'](_0x4266bc[_0x683a('0x3e')],qs['fields'](_0xb76277['query']['fields']));_0x59b31e[_0x683a('0x44')]=_0x59b31e[_0x683a('0x44')][_0x683a('0x46')]?_0x59b31e[_0x683a('0x44')]:_0x4266bc[_0x683a('0x3e')];if(_0xb76277[_0x683a('0x41')][_0x683a('0x4e')]){_0x59b31e['include']=[{'all':!![]}];}_0x59b31e=_[_0x683a('0x4c')]({},_0x59b31e,_0xb76277['options']);return db[_0x683a('0x3a')]['find'](_0x59b31e)[_0x683a('0x36')](handleEntityNotFound(_0x15696c,null))['then'](respondWithResult(_0x15696c,null))['catch'](handleError(_0x15696c,null));};exports[_0x683a('0x54')]=function(_0x4308bd,_0x4248d3){return db['VoiceQueue'][_0x683a('0x54')](_0x4308bd[_0x683a('0x55')],{})['then'](function(_0x29b312){var _0x3e5bf0=_0x4308bd[_0x683a('0x56')][_0x683a('0x2a')]({'plain':!![]});if(!_0x3e5bf0)throw new Error(_0x683a('0x57'));if(_0x3e5bf0[_0x683a('0x58')]===_0x683a('0x56')){var _0x1949d8=_0x29b312['get']({'plain':!![]});var _0x5d28ed=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x683a('0x2c'),'value':_0x683a('0x2d')}];var _0x5eb766=_[_0x683a('0x33')](_0x5d28ed,['value',_0x1949d8[_0x683a('0x32')]])[_0x683a('0x34')];return db['UserProfileSection'][_0x683a('0x33')]({'where':{'name':_0x5eb766,'userProfileId':_0x3e5bf0[_0x683a('0x59')]},'raw':!![]})[_0x683a('0x36')](function(_0x40982f){if(_0x40982f&&_0x40982f[_0x683a('0x5a')]===0x0){return db[_0x683a('0x35')][_0x683a('0x54')]({'name':_0x1949d8[_0x683a('0x34')],'resourceId':_0x1949d8['id'],'type':_0x40982f['name'],'sectionId':_0x40982f['id']},{})[_0x683a('0x36')](function(){return _0x29b312;});}else{return _0x29b312;}})[_0x683a('0x5b')](function(_0x42c9f5){logger[_0x683a('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42c9f5);throw _0x42c9f5;});}return _0x29b312;})[_0x683a('0x36')](respondWithResult(_0x4248d3,0xc9))['catch'](handleError(_0x4248d3,null));};exports['clone']=function(_0x54a36a,_0x3709dc){var _0x12077f={'where':{'id':_0x54a36a[_0x683a('0x53')]['id']}},_0x30125d={};_0x30125d['model']=_[_0x683a('0x40')](db[_0x683a('0x3a')][_0x683a('0x3b')]);_0x12077f['attributes']=_[_0x683a('0x43')](_0x30125d[_0x683a('0x3e')],qs['fields'](_0x54a36a[_0x683a('0x41')][_0x683a('0x45')]));_0x12077f[_0x683a('0x44')]=_0x12077f[_0x683a('0x44')][_0x683a('0x46')]?_0x12077f[_0x683a('0x44')]:_0x30125d[_0x683a('0x3e')];if(_0x54a36a[_0x683a('0x41')][_0x683a('0x4e')]){_0x12077f[_0x683a('0x4f')]=[{'all':!![]}];}_0x12077f=_[_0x683a('0x4c')]({},_0x12077f,_0x54a36a['options']);return db[_0x683a('0x3a')][_0x683a('0x33')](_0x12077f)['then'](handleEntityNotFound(_0x3709dc,null))[_0x683a('0x36')](function(_0x199f42){if(_0x199f42){var _0x132e00=_0x199f42[_0x683a('0x2a')]({'plain':!![]});_0x132e00=qs[_0x683a('0x5c')](_0x132e00,['id',_0x683a('0x5d'),'updatedAt']);_0x54a36a[_0x683a('0x55')]=_['omit'](_0x54a36a[_0x683a('0x55')],['id',_0x683a('0x5d'),'updatedAt']);return db['VoiceQueue'][_0x683a('0x54')](_['merge'](_0x132e00,_0x54a36a[_0x683a('0x55')]),{'include':_0x54a36a['query']['includeAll']?[{'all':!![]}]:undefined})[_0x683a('0x36')](function(_0x3b9451){var _0x468874=_0x54a36a[_0x683a('0x56')]['get']({'plain':!![]});if(!_0x468874)throw new Error(_0x683a('0x57'));if(_0x468874[_0x683a('0x58')]===_0x683a('0x56')){var _0x4df5dc=_0x3b9451[_0x683a('0x2a')]({'plain':!![]});var _0x16817a=[{'name':_0x683a('0x5e'),'value':'inbound'},{'name':_0x683a('0x2c'),'value':'outbound'}];var _0x266d08=_[_0x683a('0x33')](_0x16817a,[_0x683a('0x30'),_0x4df5dc['type']])[_0x683a('0x34')];return db['UserProfileSection'][_0x683a('0x33')]({'where':{'name':_0x266d08,'userProfileId':_0x468874['userProfileId']},'raw':!![]})[_0x683a('0x36')](function(_0x405bfa){if(_0x405bfa&&_0x405bfa[_0x683a('0x5a')]===0x0){return db[_0x683a('0x35')]['create']({'name':_0x4df5dc[_0x683a('0x34')],'resourceId':_0x4df5dc['id'],'type':_0x405bfa['name'],'sectionId':_0x405bfa['id']},{})['then'](function(){return _0x3b9451;});}else{return _0x3b9451;}})[_0x683a('0x5b')](function(_0x3582f4){logger[_0x683a('0x37')](_0x683a('0x5f'),_0x3582f4);throw _0x3582f4;});}return _0x3b9451;});}})[_0x683a('0x36')](respondWithResult(_0x3709dc,0xc9))['catch'](handleError(_0x3709dc,null));};exports['update']=function(_0x285ce3,_0x1b49a9){if(_0x285ce3[_0x683a('0x55')]['id']){delete _0x285ce3['body']['id'];}return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0x285ce3['params']['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x1b49a9,null))[_0x683a('0x36')](saveUpdates(_0x285ce3['body'],null))['then'](respondWithResult(_0x1b49a9,null))[_0x683a('0x5b')](handleError(_0x1b49a9,null));};exports['destroy']=function(_0x48b298,_0x199104){return db[_0x683a('0x3a')]['find']({'where':{'id':_0x48b298[_0x683a('0x53')]['id']}})['then'](handleEntityNotFound(_0x199104,null))[_0x683a('0x36')](removeEntity(_0x199104,null))[_0x683a('0x5b')](handleError(_0x199104,null));};exports[_0x683a('0x60')]=function(_0x74e362,_0xb3a65d,_0x58ea2){var _0x21bf81={'raw':![],'where':{}};var _0x26169d={};var _0x404ace={'count':0x0,'rows':[]};return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x74e362[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0xb3a65d,null))[_0x683a('0x36')](function(_0x3a7631){if(_0x3a7631){_0x26169d[_0x683a('0x3e')]=_['keys'](db[_0x683a('0x62')][_0x683a('0x3b')]);_0x26169d['query']=_['keys'](_0x74e362['query']);_0x26169d[_0x683a('0x42')]=_['intersection'](_0x26169d[_0x683a('0x3e')],_0x26169d[_0x683a('0x41')]);_0x21bf81[_0x683a('0x44')]=_[_0x683a('0x43')](_0x26169d[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x74e362[_0x683a('0x41')][_0x683a('0x45')]));_0x21bf81[_0x683a('0x44')]=_0x21bf81[_0x683a('0x44')][_0x683a('0x46')]?_0x21bf81[_0x683a('0x44')]:_0x26169d[_0x683a('0x3e')];if(!_0x74e362['query']['hasOwnProperty'](_0x683a('0x47'))){_0x21bf81[_0x683a('0x22')]=qs[_0x683a('0x22')](_0x74e362[_0x683a('0x41')]['limit']);_0x21bf81[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x74e362[_0x683a('0x41')]['offset']);}_0x21bf81[_0x683a('0x48')]=qs[_0x683a('0x49')](_0x74e362[_0x683a('0x41')][_0x683a('0x49')]);_0x21bf81['where']=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x74e362[_0x683a('0x41')],_0x26169d['filters']));_0x21bf81[_0x683a('0x4a')][_0x683a('0x63')]=_0x3a7631['id'];if(_0x74e362[_0x683a('0x41')][_0x683a('0x2e')]){_0x21bf81[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x21bf81[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x21bf81['attributes'],function(_0x393214){var _0x20fdb5={};_0x20fdb5[_0x393214]={'$like':'%'+_0x74e362['query'][_0x683a('0x2e')]+'%'};return _0x20fdb5;})});}_0x21bf81=_['merge']({},_0x21bf81,_0x74e362['options']);return db[_0x683a('0x62')][_0x683a('0x21')]({'where':_0x21bf81[_0x683a('0x4a')]})[_0x683a('0x36')](function(_0x2fca02){_0x404ace['count']=_0x2fca02;if(_0x74e362[_0x683a('0x41')][_0x683a('0x4e')]){_0x21bf81['include']=[{'all':!![]}];}return db[_0x683a('0x62')][_0x683a('0x50')](_0x21bf81);})[_0x683a('0x36')](function(_0x5000a2){_0x404ace[_0x683a('0x51')]=_0x5000a2;return _0x404ace;});}})[_0x683a('0x36')](respondWithFilteredResult(_0xb3a65d,_0x21bf81))[_0x683a('0x5b')](handleError(_0xb3a65d,null));};exports[_0x683a('0x64')]=function(_0x125bf9,_0x5cc622,_0x804bd7){var _0x58d8c0={'raw':!![],'where':{}};var _0x7e6ccc={};var _0xb423c={'count':0x0,'rows':[]};return db[_0x683a('0x3a')]['findOne']({'where':{'id':_0x125bf9[_0x683a('0x53')]['id']}})['then'](handleEntityNotFound(_0x5cc622,null))[_0x683a('0x36')](function(_0x2100e5){if(_0x2100e5){_0x7e6ccc[_0x683a('0x3e')]=_[_0x683a('0x40')](db[_0x683a('0x65')]['rawAttributes']);_0x7e6ccc[_0x683a('0x41')]=_[_0x683a('0x40')](_0x125bf9[_0x683a('0x41')]);_0x7e6ccc[_0x683a('0x42')]=_[_0x683a('0x43')](_0x7e6ccc[_0x683a('0x3e')],_0x7e6ccc[_0x683a('0x41')]);_0x58d8c0[_0x683a('0x44')]=_[_0x683a('0x43')](_0x7e6ccc[_0x683a('0x3e')],qs['fields'](_0x125bf9[_0x683a('0x41')][_0x683a('0x45')]));_0x58d8c0[_0x683a('0x44')]=_0x58d8c0['attributes'][_0x683a('0x46')]?_0x58d8c0[_0x683a('0x44')]:_0x7e6ccc['model'];if(!_0x125bf9[_0x683a('0x41')]['hasOwnProperty'](_0x683a('0x47'))){_0x58d8c0[_0x683a('0x22')]=qs[_0x683a('0x22')](_0x125bf9[_0x683a('0x41')][_0x683a('0x22')]);_0x58d8c0[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x125bf9['query'][_0x683a('0x20')]);}_0x58d8c0['order']=qs['sort'](_0x125bf9['query'][_0x683a('0x49')]);_0x58d8c0['where']=qs['filters'](_['pick'](_0x125bf9[_0x683a('0x41')],_0x7e6ccc[_0x683a('0x42')]));_0x58d8c0[_0x683a('0x4a')][_0x683a('0x63')]=_0x2100e5['id'];if(_0x125bf9['query'][_0x683a('0x2e')]){_0x58d8c0[_0x683a('0x4a')]=_['merge'](_0x58d8c0[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x58d8c0['attributes'],function(_0x12201a){var _0x3932a7={};_0x3932a7[_0x12201a]={'$like':'%'+_0x125bf9[_0x683a('0x41')][_0x683a('0x2e')]+'%'};return _0x3932a7;})});}_0x58d8c0=_[_0x683a('0x4c')]({},_0x58d8c0,_0x125bf9['options']);return db[_0x683a('0x65')]['count']({'where':_0x58d8c0[_0x683a('0x4a')]})[_0x683a('0x36')](function(_0x40c246){_0xb423c[_0x683a('0x21')]=_0x40c246;if(_0x125bf9[_0x683a('0x41')]['includeAll']){_0x58d8c0[_0x683a('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x683a('0x50')](_0x58d8c0);})[_0x683a('0x36')](function(_0xc300a3){_0xb423c[_0x683a('0x51')]=_0xc300a3;return _0xb423c;});}})[_0x683a('0x36')](respondWithFilteredResult(_0x5cc622,_0x58d8c0))[_0x683a('0x5b')](handleError(_0x5cc622,null));};exports[_0x683a('0x66')]=function(_0x25ca4d,_0x430fdd,_0x3f1907){var _0x4e7cfb={'raw':!![],'where':{}};var _0x5e5895={};var _0x4e61f7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x683a('0x61')]({'where':{'id':_0x25ca4d[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x430fdd,null))['then'](function(_0x2639b9){if(_0x2639b9){_0x5e5895[_0x683a('0x3e')]=_[_0x683a('0x40')](db[_0x683a('0x67')]['rawAttributes']);_0x5e5895[_0x683a('0x41')]=_[_0x683a('0x40')](_0x25ca4d[_0x683a('0x41')]);_0x5e5895[_0x683a('0x42')]=_['intersection'](_0x5e5895[_0x683a('0x3e')],_0x5e5895[_0x683a('0x41')]);_0x4e7cfb['attributes']=_[_0x683a('0x43')](_0x5e5895[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x25ca4d[_0x683a('0x41')]['fields']));_0x4e7cfb[_0x683a('0x44')]=_0x4e7cfb[_0x683a('0x44')][_0x683a('0x46')]?_0x4e7cfb['attributes']:_0x5e5895[_0x683a('0x3e')];if(!_0x25ca4d[_0x683a('0x41')][_0x683a('0x68')]('nolimit')){_0x4e7cfb[_0x683a('0x22')]=qs[_0x683a('0x22')](_0x25ca4d[_0x683a('0x41')][_0x683a('0x22')]);_0x4e7cfb[_0x683a('0x20')]=qs['offset'](_0x25ca4d[_0x683a('0x41')][_0x683a('0x20')]);}_0x4e7cfb[_0x683a('0x48')]=qs['sort'](_0x25ca4d['query'][_0x683a('0x49')]);_0x4e7cfb[_0x683a('0x4a')]=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x25ca4d[_0x683a('0x41')],_0x5e5895[_0x683a('0x42')]));_0x4e7cfb[_0x683a('0x4a')][_0x683a('0x63')]=_0x2639b9['id'];if(_0x25ca4d[_0x683a('0x41')][_0x683a('0x2e')]){_0x4e7cfb['where']=_['merge'](_0x4e7cfb[_0x683a('0x4a')],{'$or':_['map'](_0x4e7cfb[_0x683a('0x44')],function(_0x101100){var _0x509f2f={};_0x509f2f[_0x101100]={'$like':'%'+_0x25ca4d[_0x683a('0x41')][_0x683a('0x2e')]+'%'};return _0x509f2f;})});}_0x4e7cfb=_[_0x683a('0x4c')]({},_0x4e7cfb,_0x25ca4d[_0x683a('0x69')]);return db[_0x683a('0x67')][_0x683a('0x21')]({'where':_0x4e7cfb[_0x683a('0x4a')]})[_0x683a('0x36')](function(_0xa399f9){_0x4e61f7[_0x683a('0x21')]=_0xa399f9;if(_0x25ca4d[_0x683a('0x41')][_0x683a('0x4e')]){_0x4e7cfb[_0x683a('0x4f')]=[{'all':!![]}];}return db[_0x683a('0x67')][_0x683a('0x50')](_0x4e7cfb);})[_0x683a('0x36')](function(_0x5609c8){_0x4e61f7[_0x683a('0x51')]=_0x5609c8;return _0x4e61f7;});}})[_0x683a('0x36')](respondWithFilteredResult(_0x430fdd,_0x4e7cfb))[_0x683a('0x5b')](handleError(_0x430fdd,null));};exports[_0x683a('0x6a')]=function(_0x497d6d,_0x4dcaed,_0x3a6faf){var _0x1ca404={'raw':!![],'where':{}};var _0x4c165a={};var _0x1df13a={'count':0x0,'rows':[]};return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x497d6d[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x4dcaed,null))[_0x683a('0x36')](function(_0x2f3ee2){if(_0x2f3ee2){_0x4c165a[_0x683a('0x3e')]=_[_0x683a('0x40')](db[_0x683a('0x6b')][_0x683a('0x3b')]);_0x4c165a[_0x683a('0x41')]=_[_0x683a('0x40')](_0x497d6d[_0x683a('0x41')]);_0x4c165a['filters']=_[_0x683a('0x43')](_0x4c165a[_0x683a('0x3e')],_0x4c165a[_0x683a('0x41')]);_0x1ca404[_0x683a('0x44')]=_[_0x683a('0x43')](_0x4c165a[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x497d6d[_0x683a('0x41')][_0x683a('0x45')]));_0x1ca404['attributes']=_0x1ca404[_0x683a('0x44')][_0x683a('0x46')]?_0x1ca404[_0x683a('0x44')]:_0x4c165a['model'];if(!_0x497d6d[_0x683a('0x41')]['hasOwnProperty'](_0x683a('0x47'))){_0x1ca404['limit']=qs['limit'](_0x497d6d[_0x683a('0x41')][_0x683a('0x22')]);_0x1ca404[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x497d6d[_0x683a('0x41')]['offset']);}_0x1ca404['order']=qs[_0x683a('0x49')](_0x497d6d[_0x683a('0x41')][_0x683a('0x49')]);_0x1ca404[_0x683a('0x4a')]=qs['filters'](_[_0x683a('0x4b')](_0x497d6d[_0x683a('0x41')],_0x4c165a[_0x683a('0x42')]));_0x1ca404[_0x683a('0x4a')][_0x683a('0x63')]=_0x2f3ee2['id'];if(_0x497d6d['query'][_0x683a('0x2e')]){_0x1ca404[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x1ca404[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x1ca404['attributes'],function(_0x1814e0){var _0x13c211={};_0x13c211[_0x1814e0]={'$like':'%'+_0x497d6d['query'][_0x683a('0x2e')]+'%'};return _0x13c211;})});}_0x1ca404=_[_0x683a('0x4c')]({},_0x1ca404,_0x497d6d[_0x683a('0x69')]);return db[_0x683a('0x6b')]['count']({'where':_0x1ca404[_0x683a('0x4a')]})[_0x683a('0x36')](function(_0x4cf8df){_0x1df13a[_0x683a('0x21')]=_0x4cf8df;if(_0x497d6d[_0x683a('0x41')][_0x683a('0x4e')]){_0x1ca404[_0x683a('0x4f')]=[{'all':!![]}];}return db[_0x683a('0x6b')]['findAll'](_0x1ca404);})[_0x683a('0x36')](function(_0x210099){_0x1df13a[_0x683a('0x51')]=_0x210099;return _0x1df13a;});}})['then'](respondWithFilteredResult(_0x4dcaed,_0x1ca404))[_0x683a('0x5b')](handleError(_0x4dcaed,null));};exports['getTeams']=function(_0x35bbbb,_0x232245,_0x15f0fb){var _0x263cfc={};var _0x27b582={};var _0x35c138;var _0x6af467;return db[_0x683a('0x3a')]['findOne']({'where':{'id':_0x35bbbb[_0x683a('0x53')]['id']}})['then'](handleEntityNotFound(_0x232245,null))['then'](function(_0x3ed3d0){if(_0x3ed3d0){_0x35c138=_0x3ed3d0;_0x27b582['model']=_[_0x683a('0x40')](db[_0x683a('0x6c')]['rawAttributes']);_0x27b582[_0x683a('0x41')]=_['keys'](_0x35bbbb[_0x683a('0x41')]);_0x27b582[_0x683a('0x42')]=_[_0x683a('0x43')](_0x27b582['model'],_0x27b582[_0x683a('0x41')]);_0x263cfc[_0x683a('0x44')]=_[_0x683a('0x43')](_0x27b582[_0x683a('0x3e')],qs['fields'](_0x35bbbb[_0x683a('0x41')][_0x683a('0x45')]));_0x263cfc[_0x683a('0x44')]=_0x263cfc[_0x683a('0x44')]['length']?_0x263cfc['attributes']:_0x27b582[_0x683a('0x3e')];_0x263cfc[_0x683a('0x48')]=qs[_0x683a('0x49')](_0x35bbbb[_0x683a('0x41')][_0x683a('0x49')]);_0x263cfc[_0x683a('0x4a')]=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x35bbbb[_0x683a('0x41')],_0x27b582[_0x683a('0x42')]));if(_0x35bbbb[_0x683a('0x41')][_0x683a('0x2e')]){_0x263cfc[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x263cfc[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x263cfc[_0x683a('0x44')],function(_0x5248d5){var _0x2a3a3d={};_0x2a3a3d[_0x5248d5]={'$like':'%'+_0x35bbbb['query'][_0x683a('0x2e')]+'%'};return _0x2a3a3d;})});}_0x263cfc=_[_0x683a('0x4c')]({},_0x263cfc,_0x35bbbb[_0x683a('0x69')]);return _0x35c138['getTeams'](_0x263cfc);}})['then'](function(_0xe1ab1c){if(_0xe1ab1c){_0x6af467=_0xe1ab1c[_0x683a('0x46')];if(!_0x35bbbb[_0x683a('0x41')][_0x683a('0x68')]('nolimit')){_0x263cfc['limit']=qs[_0x683a('0x22')](_0x35bbbb[_0x683a('0x41')][_0x683a('0x22')]);_0x263cfc['offset']=qs[_0x683a('0x20')](_0x35bbbb['query'][_0x683a('0x20')]);}return _0x35c138[_0x683a('0x6d')](_0x263cfc);}})['then'](function(_0x5bff88){if(_0x5bff88){return _0x5bff88?{'count':_0x6af467,'rows':_0x5bff88}:null;}})[_0x683a('0x36')](respondWithResult(_0x232245,null))['catch'](handleError(_0x232245,null));};exports[_0x683a('0x6e')]=function(_0x57c5a6,_0x2c329d,_0x488a65){var _0x2d9893=_0x57c5a6[_0x683a('0x55')][_0x683a('0x6f')];var _0x197e7e=_[_0x683a('0x3f')](_0x2d9893,'id');return db[_0x683a('0x6c')][_0x683a('0x50')]({'where':{'id':_0x197e7e},'attributes':['id'],'include':[{'model':db[_0x683a('0x70')],'as':_0x683a('0x71'),'attributes':['id',_0x683a('0x34'),_0x683a('0x72'),_0x683a('0x73'),_0x683a('0x74')],'raw':!![]}]})['then'](function(_0x236dd2){if(_0x236dd2){var _0x3ca5a2=_[_0x683a('0x75')](_0x236dd2,function(_0x59e882){var _0x47d8c5=_0x59e882['get']({'plain':!![]});_0x47d8c5[_0x683a('0x71')][_0x683a('0x76')](function(_0x2c17ac){_0x2c17ac[_0x683a('0x77')]=_[_0x683a('0x33')](_0x2d9893,{'id':_0x47d8c5['id']})[_0x683a('0x77')];});return _0x47d8c5[_0x683a('0x71')];});return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0x57c5a6[_0x683a('0x53')]['id']}})[_0x683a('0x36')](function(_0x2f8733){return db['sequelize']['transaction'](function(_0x1242f0){return _0x2f8733[_0x683a('0x6e')](_0x197e7e,{'transaction':_0x1242f0})[_0x683a('0x36')](function(){return BPromise['each'](_0x2d9893,function(_0x3f2fe2){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x3f2fe2['id'],'VoiceQueueId':_0x57c5a6['params']['id'],'penalty':_0x3f2fe2[_0x683a('0x77')]},{'transaction':_0x1242f0});});})['then'](function(){return BPromise[_0x683a('0x78')](_0x3ca5a2,function(_0x538e72){return db[_0x683a('0x79')][_0x683a('0x7a')]({'where':{'UserId':_0x538e72['id'],'VoiceQueueId':_0x57c5a6[_0x683a('0x53')]['id']},'defaults':{'penalty':_0x538e72[_0x683a('0x77')]},'transaction':_0x1242f0});});})[_0x683a('0x36')](function(){return BPromise[_0x683a('0x78')](_[_0x683a('0x2e')](_0x3ca5a2,{'online':!![]}),function(_0x2f287e){return db['UserVoiceQueueRt'][_0x683a('0x7b')]({'membername':_0x2f287e[_0x683a('0x34')],'UserId':_0x2f287e['id'],'queue_name':_0x2f8733[_0x683a('0x34')],'VoiceQueueId':_0x2f8733['id'],'interface':_[_0x683a('0x7c')](_0x2f287e[_0x683a('0x74')])?util['format'](_0x683a('0x7d'),_0x2f287e[_0x683a('0x34')]):_0x2f287e[_0x683a('0x74')],'paused':_0x2f287e[_0x683a('0x73')]||![],'penalty':_0x2f287e['penalty']},{'transaction':_0x1242f0});});})[_0x683a('0x36')](function(){_0x3ca5a2['forEach'](function(_0x43d577){socket[_0x683a('0x7e')](_0x683a('0x7f'),{'UserId':_0x43d577['id'],'VoiceQueueId':_0x2f8733['id']});});});});});}})[_0x683a('0x36')](respondWithStatusCode(_0x2c329d,null))[_0x683a('0x5b')](handleError(_0x2c329d,null));};exports['removeTeams']=function(_0x17b289,_0x198d37,_0x245b5b){return db[_0x683a('0x6c')]['findAll']({'where':{'id':_0x17b289['query'][_0x683a('0x80')]},'attributes':['id'],'include':[{'model':db[_0x683a('0x70')],'as':_0x683a('0x71'),'attributes':['id'],'raw':!![]}]})[_0x683a('0x36')](handleEntityNotFound(_0x198d37,null))['then'](function(_0x2d20b7){var _0x414c1e=_[_0x683a('0x3f')](_0x2d20b7,'id');var _0xbc79e9=[];var _0x39e229=[];var _0x35d8da=squel[_0x683a('0x81')]();_0x35d8da[_0x683a('0x82')]('tq.TeamId')[_0x683a('0x83')](_0x683a('0x84'),'tq')[_0x683a('0x85')](_0x683a('0x86'),'ut',_0x683a('0x87'))[_0x683a('0x4a')](_0x683a('0x88'),_0x17b289[_0x683a('0x53')]['id']);for(var _0x399043=0x0;_0x399043<_0x2d20b7[_0x683a('0x46')];_0x399043+=0x1){let _0x17fabc=_0x2d20b7[_0x399043];for(var _0x2e4ec6=0x0;_0x2e4ec6<_0x17fabc[_0x683a('0x71')][_0x683a('0x46')];_0x2e4ec6+=0x1){let _0x335801=_0x17fabc['Agents'][_0x2e4ec6];var _0xcb1577=_0x35d8da[_0x683a('0x89')]();_0xcb1577[_0x683a('0x4a')](_0x683a('0x8a'),_0x335801['id']);_0x39e229[_0x683a('0x8b')](db['sequelize'][_0x683a('0x41')](_0xcb1577[_0x683a('0x8c')](),{'type':db[_0x683a('0x8d')][_0x683a('0x8e')]['SELECT']})[_0x683a('0x36')](function(_0x4be752){if(_0x4be752[_0x683a('0x46')]===0x1){return _0x335801['id'];}else{var _0x331ab9=_['every'](_['map'](_0x4be752,_0x683a('0x8f')),function(_0x4bd152){return _[_0x683a('0x31')](_0x414c1e,_0x4bd152);});if(_0x331ab9){return _0x335801['id'];}}}));}}return BPromise['all'](_0x39e229)[_0x683a('0x36')](function(_0x3afd48){_0xbc79e9=_(_0xbc79e9)[_0x683a('0x90')](_0x3afd48)['compact']()[_0x683a('0x30')]();return db['VoiceQueue'][_0x683a('0x33')]({'where':{'id':_0x17b289['params']['id']}})[_0x683a('0x36')](function(_0xfab365){return db[_0x683a('0x8d')][_0x683a('0x91')](function(_0x4736a3){return _0xfab365[_0x683a('0x92')](_0x17b289[_0x683a('0x41')][_0x683a('0x80')],{'transaction':_0x4736a3})[_0x683a('0x36')](function(){if(!_['isEmpty'](_0xbc79e9)){return _0xfab365[_0x683a('0x93')](_0xbc79e9,{'transaction':_0x4736a3})[_0x683a('0x36')](function(){return db[_0x683a('0x94')][_0x683a('0x29')]({'where':{'VoiceQueueId':_0x17b289[_0x683a('0x53')]['id'],'UserId':_0xbc79e9},'transaction':_0x4736a3});});}})[_0x683a('0x36')](function(){_0xbc79e9['forEach'](function(_0x22f759){socket['emit']('userVoiceQueue:remove',{'UserId':_0x22f759,'VoiceQueueId':_0xfab365['id']});});});});});});})[_0x683a('0x36')](respondWithStatusCode(_0x198d37,null))[_0x683a('0x5b')](handleError(_0x198d37,null));};exports[_0x683a('0x95')]=function(_0x27b460,_0x3f7e45,_0xe4efa1){var _0x4e2139,_0x5f0d80;return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0x27b460[_0x683a('0x53')]['id']}})['then'](handleEntityNotFound(_0x3f7e45,null))[_0x683a('0x36')](function(_0x4b1d46){if(_0x4b1d46){_0x5f0d80=_0x4b1d46;return _0x4b1d46[_0x683a('0x95')](_0x27b460['body'][_0x683a('0x80')],_[_0x683a('0x5c')](_0x27b460[_0x683a('0x55')],['ids','id'])||{})['spread'](function(_0x4366a3){for(var _0x518267=0x0;_0x518267<_0x27b460[_0x683a('0x55')]['ids'][_0x683a('0x46')];_0x518267+=0x1){socket[_0x683a('0x7e')](_0x683a('0x7f'),{'UserId':Number(_0x27b460[_0x683a('0x55')]['ids'][_0x518267]),'VoiceQueueId':Number(_0x27b460[_0x683a('0x53')]['id'])});}return _0x4366a3;});}})[_0x683a('0x36')](function(_0x4f08cc){_0x4e2139=_0x4f08cc||[];if(_0x5f0d80){return db['User'][_0x683a('0x50')]({'where':{'id':_0x27b460[_0x683a('0x55')][_0x683a('0x80')]},'attributes':['id',_0x683a('0x34'),_0x683a('0x72'),'voicePause',_0x683a('0x74')],'raw':!![]});}})['then'](function(_0x22b1f1){if(!_[_0x683a('0x96')](_0x22b1f1)){var _0x39d00d=[];for(var _0xfa8adb=0x0;_0xfa8adb<_0x22b1f1[_0x683a('0x46')];_0xfa8adb++){if(_0x22b1f1[_0xfa8adb]['online']){_0x39d00d['push'](db[_0x683a('0x94')][_0x683a('0x7b')]({'membername':_0x22b1f1[_0xfa8adb]['name'],'UserId':_0x22b1f1[_0xfa8adb]['id'],'queue_name':_0x5f0d80[_0x683a('0x34')],'VoiceQueueId':_0x5f0d80['id'],'interface':_[_0x683a('0x7c')](_0x22b1f1[_0xfa8adb]['interface'])?util['format'](_0x683a('0x7d'),_0x22b1f1[_0xfa8adb][_0x683a('0x34')]):_0x22b1f1[_0xfa8adb][_0x683a('0x74')],'paused':_0x22b1f1[_0xfa8adb]['voicePause']||![],'penalty':_0x27b460['body'][_0x683a('0x77')]||0x0}));}}return BPromise[_0x683a('0x97')](_0x39d00d);}})['then'](function(){return _0x4e2139;})['then'](respondWithResult(_0x3f7e45,null))[_0x683a('0x5b')](handleError(_0x3f7e45,null));};exports[_0x683a('0x93')]=function(_0xae252e,_0x3f8e92,_0x562254){return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0xae252e['params']['id']}})['then'](handleEntityNotFound(_0x3f8e92,null))[_0x683a('0x36')](function(_0x119906){if(_0x119906){return _0x119906[_0x683a('0x93')](_0xae252e[_0x683a('0x41')][_0x683a('0x80')])[_0x683a('0x36')](function(){if(_[_0x683a('0x98')](_0xae252e[_0x683a('0x41')][_0x683a('0x80')])){for(var _0x419b25=0x0;_0x419b25<_0xae252e[_0x683a('0x41')][_0x683a('0x80')][_0x683a('0x46')];_0x419b25+=0x1){socket[_0x683a('0x7e')](_0x683a('0x99'),{'UserId':Number(_0xae252e[_0x683a('0x41')][_0x683a('0x80')][_0x419b25]),'VoiceQueueId':Number(_0xae252e['params']['id'])});}}else{socket[_0x683a('0x7e')](_0x683a('0x99'),{'UserId':Number(_0xae252e[_0x683a('0x41')][_0x683a('0x80')]),'VoiceQueueId':Number(_0xae252e[_0x683a('0x53')]['id'])});}});}})['then'](function(_0x535b27){return db[_0x683a('0x94')][_0x683a('0x29')]({'where':{'VoiceQueueId':_0xae252e[_0x683a('0x53')]['id'],'UserId':_0xae252e[_0x683a('0x41')][_0x683a('0x80')]}})[_0x683a('0x36')](function(){return _0x535b27;});})[_0x683a('0x36')](respondWithStatusCode(_0x3f8e92,null))[_0x683a('0x5b')](handleError(_0x3f8e92,null));};exports[_0x683a('0x9a')]=function(_0x225bda,_0x4a7799,_0x1fa556){var _0x162d07={};var _0x2355e0={};var _0x2c86bf;var _0x408ea6;return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x225bda[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x4a7799,null))[_0x683a('0x36')](function(_0x7019eb){if(_0x7019eb){_0x2c86bf=_0x7019eb;_0x2355e0[_0x683a('0x3e')]=_[_0x683a('0x40')](db['User'][_0x683a('0x3b')]);_0x2355e0[_0x683a('0x41')]=_[_0x683a('0x40')](_0x225bda[_0x683a('0x41')]);_0x2355e0[_0x683a('0x42')]=_[_0x683a('0x43')](_0x2355e0['model'],_0x2355e0[_0x683a('0x41')]);_0x162d07[_0x683a('0x44')]=_[_0x683a('0x43')](_0x2355e0[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x225bda[_0x683a('0x41')][_0x683a('0x45')]));_0x162d07[_0x683a('0x44')]=_0x162d07[_0x683a('0x44')][_0x683a('0x46')]?_0x162d07[_0x683a('0x44')]:_0x2355e0[_0x683a('0x3e')];_0x162d07[_0x683a('0x48')]=qs[_0x683a('0x49')](_0x225bda[_0x683a('0x41')]['sort']);_0x162d07[_0x683a('0x4a')]=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x225bda[_0x683a('0x41')],_0x2355e0[_0x683a('0x42')]));if(_0x225bda[_0x683a('0x41')][_0x683a('0x2e')]){_0x162d07[_0x683a('0x4a')]=_['merge'](_0x162d07['where'],{'$or':_[_0x683a('0x3f')](_0x162d07[_0x683a('0x44')],function(_0x51e821){var _0x349b25={};_0x349b25[_0x51e821]={'$like':'%'+_0x225bda[_0x683a('0x41')][_0x683a('0x2e')]+'%'};return _0x349b25;})});}_0x162d07=_[_0x683a('0x4c')]({},_0x162d07,_0x225bda[_0x683a('0x69')]);return _0x2c86bf[_0x683a('0x9a')](_0x162d07);}})['then'](function(_0x55face){if(_0x55face){_0x408ea6=_0x55face[_0x683a('0x46')];if(!_0x225bda[_0x683a('0x41')][_0x683a('0x68')]('nolimit')){_0x162d07['limit']=qs[_0x683a('0x22')](_0x225bda[_0x683a('0x41')][_0x683a('0x22')]);_0x162d07[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x225bda[_0x683a('0x41')][_0x683a('0x20')]);}return _0x2c86bf[_0x683a('0x9a')](_0x162d07);}})[_0x683a('0x36')](function(_0x5e05c0){if(_0x5e05c0){return _0x5e05c0?{'count':_0x408ea6,'rows':_0x5e05c0}:null;}})[_0x683a('0x36')](respondWithResult(_0x4a7799,null))[_0x683a('0x5b')](handleError(_0x4a7799,null));};exports[_0x683a('0x9b')]=function(_0x4b9953,_0x14bce4,_0x25efa5){var _0x16bab1={};var _0x373b4b={};var _0x39aac2;var _0x44e88b;return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x4b9953[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x14bce4,null))['then'](function(_0x50ce2e){if(_0x50ce2e){_0x39aac2=_0x50ce2e;_0x373b4b['model']=_[_0x683a('0x40')](db[_0x683a('0x94')][_0x683a('0x3b')]);_0x373b4b['query']=_['keys'](_0x4b9953[_0x683a('0x41')]);_0x373b4b[_0x683a('0x42')]=_[_0x683a('0x43')](_0x373b4b[_0x683a('0x3e')],_0x373b4b[_0x683a('0x41')]);_0x16bab1['attributes']=_[_0x683a('0x43')](_0x373b4b[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x4b9953[_0x683a('0x41')][_0x683a('0x45')]));_0x16bab1[_0x683a('0x44')]=_0x16bab1[_0x683a('0x44')][_0x683a('0x46')]?_0x16bab1[_0x683a('0x44')]:_0x373b4b['model'];_0x16bab1['order']=qs[_0x683a('0x49')](_0x4b9953['query'][_0x683a('0x49')]);_0x16bab1[_0x683a('0x4a')]=qs[_0x683a('0x42')](_['pick'](_0x4b9953[_0x683a('0x41')],_0x373b4b[_0x683a('0x42')]));if(_0x4b9953['query'][_0x683a('0x2e')]){_0x16bab1[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x16bab1[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x16bab1[_0x683a('0x44')],function(_0x3021b3){var _0x224475={};_0x224475[_0x3021b3]={'$like':'%'+_0x4b9953[_0x683a('0x41')][_0x683a('0x2e')]+'%'};return _0x224475;})});}_0x16bab1=_['merge']({},_0x16bab1,_0x4b9953[_0x683a('0x69')]);return _0x39aac2[_0x683a('0x9b')](_0x16bab1);}})[_0x683a('0x36')](function(_0x34bace){if(_0x34bace){_0x44e88b=_0x34bace[_0x683a('0x46')];if(!_0x4b9953['query'][_0x683a('0x68')](_0x683a('0x47'))){_0x16bab1[_0x683a('0x22')]=qs['limit'](_0x4b9953[_0x683a('0x41')][_0x683a('0x22')]);_0x16bab1[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x4b9953[_0x683a('0x41')][_0x683a('0x20')]);}return _0x39aac2[_0x683a('0x9b')](_0x16bab1);}})['then'](function(_0xe64fd2){return _0xe64fd2?{'count':_0x44e88b,'rows':_0xe64fd2}:null;})[_0x683a('0x36')](respondWithResult(_0x14bce4,null))['catch'](handleError(_0x14bce4,null));};exports[_0x683a('0x9c')]=function(_0x1a3b1d,_0x38e4d2,_0x41f3e5){var _0x26441c={};var _0x293b95={};var _0x4e410c;var _0x40c28f;return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x1a3b1d[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x38e4d2,null))[_0x683a('0x36')](function(_0x3f9da3){if(_0x3f9da3){_0x4e410c=_0x3f9da3;_0x293b95['model']=_[_0x683a('0x40')](db[_0x683a('0x9d')][_0x683a('0x3b')]);_0x293b95[_0x683a('0x41')]=_['keys'](_0x1a3b1d[_0x683a('0x41')]);_0x293b95[_0x683a('0x42')]=_[_0x683a('0x43')](_0x293b95[_0x683a('0x3e')],_0x293b95['query']);_0x26441c['attributes']=_[_0x683a('0x43')](_0x293b95['model'],qs['fields'](_0x1a3b1d['query'][_0x683a('0x45')]));_0x26441c[_0x683a('0x44')]=_0x26441c[_0x683a('0x44')][_0x683a('0x46')]?_0x26441c[_0x683a('0x44')]:_0x293b95[_0x683a('0x3e')];_0x26441c['order']=qs['sort'](_0x1a3b1d[_0x683a('0x41')][_0x683a('0x49')]);_0x26441c['where']=qs[_0x683a('0x42')](_[_0x683a('0x4b')](_0x1a3b1d[_0x683a('0x41')],_0x293b95[_0x683a('0x42')]));if(_0x1a3b1d['query'][_0x683a('0x2e')]){_0x26441c[_0x683a('0x4a')]=_['merge'](_0x26441c[_0x683a('0x4a')],{'$or':_[_0x683a('0x3f')](_0x26441c[_0x683a('0x44')],function(_0x5d3961){var _0x2e9e08={};_0x2e9e08[_0x5d3961]={'$like':'%'+_0x1a3b1d['query'][_0x683a('0x2e')]+'%'};return _0x2e9e08;})});}_0x26441c=_[_0x683a('0x4c')]({},_0x26441c,_0x1a3b1d[_0x683a('0x69')]);return _0x4e410c[_0x683a('0x9c')](_0x26441c);}})[_0x683a('0x36')](function(_0x4dded0){if(_0x4dded0){_0x40c28f=_0x4dded0[_0x683a('0x46')];if(!_0x1a3b1d[_0x683a('0x41')][_0x683a('0x68')]('nolimit')){_0x26441c[_0x683a('0x22')]=qs[_0x683a('0x22')](_0x1a3b1d[_0x683a('0x41')][_0x683a('0x22')]);_0x26441c[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x1a3b1d[_0x683a('0x41')][_0x683a('0x20')]);}return _0x4e410c[_0x683a('0x9c')](_0x26441c);}})['then'](function(_0x4bdf7b){if(_0x4bdf7b){return _0x4bdf7b?{'count':_0x40c28f,'rows':_0x4bdf7b}:null;}})['then'](respondWithResult(_0x38e4d2,null))['catch'](handleError(_0x38e4d2,null));};exports['addLists']=function(_0xf562c5,_0x50bef9,_0x111589){var _0x4630f7,_0x4faaa9;return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0xf562c5['params']['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x50bef9,null))[_0x683a('0x36')](function(_0x3ce40d){if(_0x3ce40d){_0x4faaa9=_0x3ce40d;return _0x3ce40d[_0x683a('0x9e')](_0xf562c5['body'][_0x683a('0x80')],_['omit'](_0xf562c5[_0x683a('0x55')],[_0x683a('0x80'),'id'])||{});}return null;})[_0x683a('0x9f')](function(_0x5bdd94){var _0x5cd73b;_0x4630f7=_0x5bdd94||[];var _0x5be5ce=[];if(_0x5bdd94){for(var _0x2b3841=0x0;_0x2b3841<_0x5bdd94['length'];_0x2b3841+=0x1){var _0x5df2a6=_0x5bdd94[_0x2b3841][_0x683a('0x2a')]({'plain':!![]});_0x4faaa9[_0x683a('0xa0')]=_0xf562c5[_0x683a('0x55')][_0x683a('0xa0')]?_0xf562c5[_0x683a('0x55')][_0x683a('0xa0')]:_0x4faaa9[_0x683a('0xa0')];switch(_0x4faaa9[_0x683a('0xa0')]){case _0x683a('0xa1'):_0x5cd73b=squel[_0x683a('0xa2')]()['into'](_0x683a('0xa3'))[_0x683a('0xa4')]([_0x683a('0xa5'),_0x683a('0xa6'),'ContactId',_0x683a('0xa7'),'VoiceQueueId',_0x683a('0x5d'),'updatedAt'],squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xa5'),_0x683a('0xa5'))[_0x683a('0x82')]('NOW()',_0x683a('0xa6'))['field']('id',_0x683a('0xa8'))[_0x683a('0x82')](_0x5df2a6[_0x683a('0xa9')][_0x683a('0x8c')](),'ListId')[_0x683a('0x82')](_0xf562c5[_0x683a('0x53')]['id'][_0x683a('0x8c')](),_0x683a('0x63'))[_0x683a('0x82')](_0x683a('0xaa'),'createdAt')[_0x683a('0x82')](_0x683a('0xaa'),_0x683a('0xab'))[_0x683a('0x83')](_0x683a('0xac'))[_0x683a('0x4a')]('deletedAt\x20IS\x20NULL')[_0x683a('0x4a')]('ListId\x20=\x20?',_0x5df2a6['CmListId']['toString']())['where'](_0x683a('0xad'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xae'))['from']('cm_hopper_final')[_0x683a('0x4a')](_0x683a('0x88'),_0xf562c5[_0x683a('0x53')]['id'][_0x683a('0x8c')]()))[_0x683a('0x4a')](_0x683a('0xaf'),squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xb0'))[_0x683a('0x83')]('cm_hopper')['where'](_0x683a('0x88'),_0xf562c5[_0x683a('0x53')]['id'][_0x683a('0x8c')]())))[_0x683a('0x8c')]();break;case _0x683a('0xb1'):_0x5cd73b=squel[_0x683a('0xa2')]()['into'](_0x683a('0xa3'))[_0x683a('0xa4')]([_0x683a('0xa5'),'scheduledAt','ContactId',_0x683a('0xa7'),_0x683a('0x63'),_0x683a('0x5d'),_0x683a('0xab')],squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xa5'),'phone')[_0x683a('0x82')]('NOW()',_0x683a('0xa6'))[_0x683a('0x82')]('id',_0x683a('0xa8'))[_0x683a('0x82')](_0x5df2a6['CmListId'][_0x683a('0x8c')](),'ListId')[_0x683a('0x82')](_0xf562c5[_0x683a('0x53')]['id'][_0x683a('0x8c')](),_0x683a('0x63'))[_0x683a('0x82')](_0x683a('0xaa'),_0x683a('0x5d'))[_0x683a('0x82')](_0x683a('0xaa'),_0x683a('0xab'))[_0x683a('0x83')](_0x683a('0xac'))[_0x683a('0x4a')](_0x683a('0xb2'))[_0x683a('0x4a')]('ListId\x20=\x20?',_0x5df2a6['CmListId'][_0x683a('0x8c')]())[_0x683a('0x4a')](_0x683a('0xad'))[_0x683a('0x4a')](_0x683a('0xaf'),squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xb0'))[_0x683a('0x83')]('cm_hopper')[_0x683a('0x4a')]('VoiceQueueId\x20=\x20?',_0xf562c5['params']['id'][_0x683a('0x8c')]())))[_0x683a('0x8c')]();break;default:_0x5cd73b=squel['insert']()['into'](_0x683a('0xa3'))[_0x683a('0xa4')]([_0x683a('0xa5'),'scheduledAt',_0x683a('0xa8'),_0x683a('0xa7'),_0x683a('0x63'),_0x683a('0x5d'),_0x683a('0xab')],squel[_0x683a('0x81')]()[_0x683a('0x82')](_0x683a('0xa5'),_0x683a('0xa5'))[_0x683a('0x82')](_0x683a('0xaa'),'scheduledAt')['field']('id',_0x683a('0xa8'))[_0x683a('0x82')](_0x5df2a6['CmListId'][_0x683a('0x8c')](),_0x683a('0xa7'))[_0x683a('0x82')](_0xf562c5[_0x683a('0x53')]['id'][_0x683a('0x8c')](),_0x683a('0x63'))[_0x683a('0x82')](_0x683a('0xaa'),_0x683a('0x5d'))[_0x683a('0x82')](_0x683a('0xaa'),_0x683a('0xab'))[_0x683a('0x83')](_0x683a('0xac'))['where'](_0x683a('0xb2'))[_0x683a('0x4a')]('ListId\x20=\x20?',_0x5df2a6['CmListId'][_0x683a('0x8c')]())[_0x683a('0x4a')](_0x683a('0xad')))[_0x683a('0x8c')]();}_0x5be5ce[_0x683a('0x8b')](db['sequelize']['query'](_0x5cd73b));}return BPromise[_0x683a('0x97')](_0x5be5ce);}})[_0x683a('0x36')](function(){return _0x4630f7;})[_0x683a('0x36')](respondWithResult(_0x50bef9,null))[_0x683a('0x5b')](handleError(_0x50bef9,null));};exports[_0x683a('0xb3')]=function(_0x27db7d,_0x3e86c0,_0x21451a){return db['VoiceQueue'][_0x683a('0x33')]({'where':{'id':_0x27db7d['params']['id']}})['then'](handleEntityNotFound(_0x3e86c0,null))['then'](function(_0x30935a){if(_0x30935a){return _0x30935a[_0x683a('0xb3')](_0x27db7d['query']['ids']);}})[_0x683a('0x36')](function(_0x8c41f7){if(_0x8c41f7){return db[_0x683a('0x62')][_0x683a('0x29')]({'where':{'ListId':_0x27db7d[_0x683a('0x41')]['ids'],'VoiceQueueId':_0x27db7d[_0x683a('0x53')]['id']}})[_0x683a('0x36')](function(){return _0x8c41f7;});}})['then'](respondWithStatusCode(_0x3e86c0,null))[_0x683a('0x5b')](handleError(_0x3e86c0,null));};exports[_0x683a('0xb4')]=function(_0x527739,_0x3d987a,_0x478702){var _0x2aa3f8={};var _0x3706cf={};var _0x4c7d74;var _0x2baedd;return db[_0x683a('0x3a')][_0x683a('0x61')]({'where':{'id':_0x527739['params']['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x3d987a,null))['then'](function(_0x500eb3){if(_0x500eb3){_0x4c7d74=_0x500eb3;_0x3706cf[_0x683a('0x3e')]=_[_0x683a('0x40')](db[_0x683a('0x9d')][_0x683a('0x3b')]);_0x3706cf[_0x683a('0x41')]=_[_0x683a('0x40')](_0x527739[_0x683a('0x41')]);_0x3706cf[_0x683a('0x42')]=_[_0x683a('0x43')](_0x3706cf[_0x683a('0x3e')],_0x3706cf['query']);_0x2aa3f8[_0x683a('0x44')]=_[_0x683a('0x43')](_0x3706cf[_0x683a('0x3e')],qs[_0x683a('0x45')](_0x527739[_0x683a('0x41')][_0x683a('0x45')]));_0x2aa3f8['attributes']=_0x2aa3f8[_0x683a('0x44')]['length']?_0x2aa3f8[_0x683a('0x44')]:_0x3706cf[_0x683a('0x3e')];_0x2aa3f8[_0x683a('0x48')]=qs[_0x683a('0x49')](_0x527739[_0x683a('0x41')][_0x683a('0x49')]);_0x2aa3f8[_0x683a('0x4a')]=qs['filters'](_['pick'](_0x527739[_0x683a('0x41')],_0x3706cf[_0x683a('0x42')]));if(_0x527739[_0x683a('0x41')]['filter']){_0x2aa3f8[_0x683a('0x4a')]=_[_0x683a('0x4c')](_0x2aa3f8['where'],{'$or':_[_0x683a('0x3f')](_0x2aa3f8[_0x683a('0x44')],function(_0x37dac7){var _0x55697a={};_0x55697a[_0x37dac7]={'$like':'%'+_0x527739[_0x683a('0x41')]['filter']+'%'};return _0x55697a;})});}_0x2aa3f8=_[_0x683a('0x4c')]({},_0x2aa3f8,_0x527739[_0x683a('0x69')]);return _0x4c7d74[_0x683a('0xb4')](_0x2aa3f8);}})[_0x683a('0x36')](function(_0x33398b){if(_0x33398b){_0x2baedd=_0x33398b[_0x683a('0x46')];if(!_0x527739['query']['hasOwnProperty']('nolimit')){_0x2aa3f8[_0x683a('0x22')]=qs[_0x683a('0x22')](_0x527739['query'][_0x683a('0x22')]);_0x2aa3f8[_0x683a('0x20')]=qs[_0x683a('0x20')](_0x527739['query'][_0x683a('0x20')]);}return _0x4c7d74[_0x683a('0xb4')](_0x2aa3f8);}})['then'](function(_0x302740){if(_0x302740){return _0x302740?{'count':_0x2baedd,'rows':_0x302740}:null;}})[_0x683a('0x36')](respondWithResult(_0x3d987a,null))[_0x683a('0x5b')](handleError(_0x3d987a,null));};exports[_0x683a('0xb5')]=function(_0x52fc4f,_0x480ac9,_0x2d9764){var _0x18d2f1,_0x1ec099;return db[_0x683a('0x3a')][_0x683a('0x33')]({'where':{'id':_0x52fc4f[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0x480ac9,null))[_0x683a('0x36')](function(_0x570e7e){if(_0x570e7e){_0x1ec099=_0x570e7e;return _0x570e7e[_0x683a('0xb5')](_0x52fc4f[_0x683a('0x55')][_0x683a('0x80')],_[_0x683a('0x5c')](_0x52fc4f[_0x683a('0x55')],['ids','id'])||{});}return null;})['spread'](function(_0x498079){var _0x443d93;_0x18d2f1=_0x498079||[];var _0x5e8b09=[];if(_0x498079){for(var _0xf2b23b=0x0;_0xf2b23b<_0x498079['length'];_0xf2b23b+=0x1){var _0x2b0670=_0x498079[_0xf2b23b]['get']({'plain':!![]});_0x443d93=squel[_0x683a('0xa2')]()['into'](_0x683a('0xb6'))['fromQuery']([_0x683a('0xa5'),'ContactId',_0x683a('0xa7'),'VoiceQueueId',_0x683a('0x5d'),_0x683a('0xab')],squel[_0x683a('0x81')]()[_0x683a('0x82')]('phone',_0x683a('0xa5'))[_0x683a('0x82')]('id',_0x683a('0xa8'))[_0x683a('0x82')](_0x2b0670[_0x683a('0xa9')][_0x683a('0x8c')](),_0x683a('0xa7'))['field'](_0x52fc4f[_0x683a('0x53')]['id']['toString'](),_0x683a('0x63'))[_0x683a('0x82')]('NOW()','createdAt')[_0x683a('0x82')](_0x683a('0xaa'),'updatedAt')[_0x683a('0x83')](_0x683a('0xac'))[_0x683a('0x4a')](_0x683a('0xb2'))[_0x683a('0x4a')](_0x683a('0xb7'),_0x2b0670[_0x683a('0xa9')]['toString']())['where'](_0x683a('0xad')))[_0x683a('0x8c')]();_0x5e8b09[_0x683a('0x8b')](db[_0x683a('0x8d')]['query'](_0x443d93));}return BPromise[_0x683a('0x97')](_0x5e8b09);}})[_0x683a('0x36')](function(){return _0x18d2f1;})['then'](respondWithResult(_0x480ac9,null))[_0x683a('0x5b')](handleError(_0x480ac9,null));};exports[_0x683a('0xb8')]=function(_0x361e48,_0xa97812,_0x550181){return db[_0x683a('0x3a')]['find']({'where':{'id':_0x361e48[_0x683a('0x53')]['id']}})[_0x683a('0x36')](handleEntityNotFound(_0xa97812,null))['then'](function(_0xe84613){if(_0xe84613){return _0xe84613['removeBlackLists'](_0x361e48[_0x683a('0x41')][_0x683a('0x80')]);}})['then'](function(_0x27fd78){if(_0x27fd78){return db[_0x683a('0x6b')]['destroy']({'where':{'ListId':_0x361e48['query']['ids'],'VoiceQueueId':_0x361e48[_0x683a('0x53')]['id']}})['then'](function(){return _0x27fd78;});}})[_0x683a('0x36')](respondWithStatusCode(_0xa97812,null))['catch'](handleError(_0xa97812,null));}; \ No newline at end of file +var _0xd65d=['dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','removeLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','options','VoiceQueue','count','include','catch','params','includeAll','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','online','voicePause','flatMap','Agents','forEach','penalty','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','SIP/%s','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','union','compact','transaction','removeTeams','removeAgents','userVoiceQueue:remove','addAgents','emit','isEmpty','all','isArray','getAgents','getMembers','getLists','addLists','spread'];(function(_0x1fc1ee,_0x49fa37){var _0x25f3af=function(_0x5e4a73){while(--_0x5e4a73){_0x1fc1ee['push'](_0x1fc1ee['shift']());}};_0x25f3af(++_0x49fa37);}(_0xd65d,0xd7));var _0xdd65=function(_0x19652e,_0x48901f){_0x19652e=_0x19652e-0x0;var _0x2ddae0=_0xd65d[_0x19652e];return _0x2ddae0;};'use strict';var emlformat=require(_0xdd65('0x0'));var rimraf=require(_0xdd65('0x1'));var zipdir=require(_0xdd65('0x2'));var jsonpatch=require(_0xdd65('0x3'));var rp=require('request-promise');var moment=require(_0xdd65('0x4'));var BPromise=require(_0xdd65('0x5'));var Mustache=require(_0xdd65('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd65('0x7'));var fs=require('fs');var fs_extra=require(_0xdd65('0x8'));var _=require(_0xdd65('0x9'));var squel=require(_0xdd65('0xa'));var crypto=require(_0xdd65('0xb'));var jsforce=require(_0xdd65('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd65('0xd'));var querystring=require(_0xdd65('0xe'));var Papa=require(_0xdd65('0xf'));var Redis=require(_0xdd65('0x10'));var authService=require(_0xdd65('0x11'));var qs=require(_0xdd65('0x12'));var as=require(_0xdd65('0x13'));var hardwareService=require(_0xdd65('0x14'));var logger=require(_0xdd65('0x15'))('api');var utils=require(_0xdd65('0x16'));var config=require(_0xdd65('0x17'));var licenseUtil=require(_0xdd65('0x18'));var db=require(_0xdd65('0x19'))['db'];config[_0xdd65('0x1a')]=_[_0xdd65('0x1b')](config['redis'],{'host':_0xdd65('0x1c'),'port':0x18eb});var socket=require(_0xdd65('0x1d'))(new Redis(config[_0xdd65('0x1a')]));require(_0xdd65('0x1e'))[_0xdd65('0x1f')](socket);function respondWithStatusCode(_0x26097b,_0x5aa183){_0x5aa183=_0x5aa183||0xcc;return function(_0x380cd9){if(_0x380cd9){return _0x26097b[_0xdd65('0x20')](_0x5aa183);}return _0x26097b[_0xdd65('0x21')](_0x5aa183)[_0xdd65('0x22')]();};}function respondWithResult(_0x46ecfe,_0x5200dc){_0x5200dc=_0x5200dc||0xc8;return function(_0x4f86d8){if(_0x4f86d8){return _0x46ecfe[_0xdd65('0x21')](_0x5200dc)[_0xdd65('0x23')](_0x4f86d8);}};}function respondWithFilteredResult(_0x32f181,_0xcb4a30){return function(_0x5456c6){if(_0x5456c6){var _0x1170ea=typeof _0xcb4a30[_0xdd65('0x24')]===_0xdd65('0x25')&&typeof _0xcb4a30[_0xdd65('0x26')]===_0xdd65('0x25');var _0x1756df=_0x5456c6['count'];var _0x588cc0=_0x1170ea?0x0:_0xcb4a30[_0xdd65('0x24')];var _0x56982e=_0x1170ea?_0x5456c6['count']:_0xcb4a30[_0xdd65('0x24')]+_0xcb4a30['limit'];var _0x2c0413;if(_0x56982e>=_0x1756df){_0x56982e=_0x1756df;_0x2c0413=0xc8;}else{_0x2c0413=0xce;}_0x32f181[_0xdd65('0x21')](_0x2c0413);return _0x32f181[_0xdd65('0x27')](_0xdd65('0x28'),_0x588cc0+'-'+_0x56982e+'/'+_0x1756df)[_0xdd65('0x23')](_0x5456c6);}return null;};}function patchUpdates(_0x3a89b5){return function(_0x367353){try{jsonpatch[_0xdd65('0x29')](_0x367353,_0x3a89b5,!![]);}catch(_0x494996){return BPromise[_0xdd65('0x2a')](_0x494996);}return _0x367353[_0xdd65('0x2b')]();};}function saveUpdates(_0x5f2c47,_0x355301){return function(_0x4c2c01){if(_0x4c2c01){return _0x4c2c01['update'](_0x5f2c47)[_0xdd65('0x2c')](function(_0xbde40a){return _0xbde40a;});}return null;};}function removeEntity(_0x19b9fe,_0x5ad421){return function(_0xfe4b6c){if(_0xfe4b6c){return _0xfe4b6c[_0xdd65('0x2d')]()[_0xdd65('0x2c')](function(){var _0x5a21fb=_0xfe4b6c[_0xdd65('0x2e')]({'plain':!![]});var _0x1f632c=[{'name':_0xdd65('0x2f'),'value':_0xdd65('0x30'),'ignore':![]},{'name':_0xdd65('0x31'),'value':_0xdd65('0x32'),'ignore':![]}];var _0x5df857=_(_0x1f632c)[_0xdd65('0x33')](_0xdd65('0x34'))[_0xdd65('0x35')](_0xdd65('0x36'))['value']();if(_[_0xdd65('0x37')](_0x5df857,_0x5a21fb[_0xdd65('0x38')])){return;}var _0x2b8645=_[_0xdd65('0x39')](_0x1f632c,[_0xdd65('0x36'),_0x5a21fb[_0xdd65('0x38')]])[_0xdd65('0x3a')];return db[_0xdd65('0x3b')][_0xdd65('0x2d')]({'where':{'type':_0x2b8645,'resourceId':_0x5a21fb['id']}})[_0xdd65('0x2c')](function(){return _0xfe4b6c;});})[_0xdd65('0x2c')](function(){_0x19b9fe['status'](0xcc)[_0xdd65('0x22')]();});}};}function handleEntityNotFound(_0x41535c,_0x46d3c2){return function(_0x2336e3){if(!_0x2336e3){_0x41535c[_0xdd65('0x20')](0x194);}return _0x2336e3;};}function handleError(_0x3e6f00,_0x3bc9dc){_0x3bc9dc=_0x3bc9dc||0x1f4;return function(_0x7d6d4a){logger[_0xdd65('0x3c')](_0x7d6d4a[_0xdd65('0x3d')]);if(_0x7d6d4a[_0xdd65('0x3a')]){delete _0x7d6d4a['name'];}_0x3e6f00['status'](_0x3bc9dc)[_0xdd65('0x3e')](_0x7d6d4a);};}exports['index']=function(_0x164cee,_0x4dc580){var _0x23492a={},_0x2ffe70={},_0x595489={'count':0x0,'rows':[]};var _0x26f667=_['map'](db['VoiceQueue'][_0xdd65('0x3f')],function(_0x54e470){return{'name':_0x54e470['fieldName'],'type':_0x54e470[_0xdd65('0x38')]['key']};});_0x2ffe70[_0xdd65('0x40')]=_[_0xdd65('0x35')](_0x26f667,_0xdd65('0x3a'));_0x2ffe70[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x164cee[_0xdd65('0x41')]);_0x2ffe70[_0xdd65('0x43')]=_[_0xdd65('0x44')](_0x2ffe70[_0xdd65('0x40')],_0x2ffe70[_0xdd65('0x41')]);_0x23492a['attributes']=_[_0xdd65('0x44')](_0x2ffe70[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x164cee[_0xdd65('0x41')][_0xdd65('0x45')]));_0x23492a['attributes']=_0x23492a[_0xdd65('0x46')][_0xdd65('0x47')]?_0x23492a[_0xdd65('0x46')]:_0x2ffe70[_0xdd65('0x40')];if(!_0x164cee[_0xdd65('0x41')]['hasOwnProperty']('nolimit')){_0x23492a[_0xdd65('0x26')]=qs['limit'](_0x164cee[_0xdd65('0x41')][_0xdd65('0x26')]);_0x23492a[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x164cee[_0xdd65('0x41')][_0xdd65('0x24')]);}_0x23492a[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x164cee['query'][_0xdd65('0x49')]);_0x23492a[_0xdd65('0x4a')]=qs[_0xdd65('0x43')](_[_0xdd65('0x4b')](_0x164cee[_0xdd65('0x41')],_0x2ffe70[_0xdd65('0x43')]),_0x26f667);if(_0x164cee[_0xdd65('0x41')][_0xdd65('0x33')]){_0x23492a['where']=_[_0xdd65('0x4c')](_0x23492a['where'],{'$or':_['map'](_0x26f667,function(_0x33b4be){if(_0x33b4be[_0xdd65('0x38')]!=='VIRTUAL'){var _0x145bcd={};_0x145bcd[_0x33b4be[_0xdd65('0x3a')]]={'$like':'%'+_0x164cee['query'][_0xdd65('0x33')]+'%'};return _0x145bcd;}})});}_0x23492a=_[_0xdd65('0x4c')]({},_0x23492a,_0x164cee[_0xdd65('0x4d')]);var _0x40f74e={'where':_0x23492a[_0xdd65('0x4a')]};return db[_0xdd65('0x4e')][_0xdd65('0x4f')](_0x40f74e)[_0xdd65('0x2c')](function(_0x26d52c){_0x595489['count']=_0x26d52c;if(_0x164cee[_0xdd65('0x41')]['includeAll']){_0x23492a[_0xdd65('0x50')]=[{'all':!![]}];}return db['VoiceQueue']['findAll'](_0x23492a);})[_0xdd65('0x2c')](function(_0x39df57){_0x595489['rows']=_0x39df57;return _0x595489;})[_0xdd65('0x2c')](respondWithFilteredResult(_0x4dc580,_0x23492a))[_0xdd65('0x51')](handleError(_0x4dc580,null));};exports['show']=function(_0x4beb77,_0xabcfb8){var _0x3a30e9={'raw':![],'where':{'id':_0x4beb77[_0xdd65('0x52')]['id']}},_0xa051d0={};_0xa051d0[_0xdd65('0x40')]=_[_0xdd65('0x42')](db['VoiceQueue'][_0xdd65('0x3f')]);_0xa051d0['query']=_[_0xdd65('0x42')](_0x4beb77[_0xdd65('0x41')]);_0xa051d0[_0xdd65('0x43')]=_['intersection'](_0xa051d0['model'],_0xa051d0[_0xdd65('0x41')]);_0x3a30e9[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0xa051d0['model'],qs[_0xdd65('0x45')](_0x4beb77[_0xdd65('0x41')][_0xdd65('0x45')]));_0x3a30e9['attributes']=_0x3a30e9[_0xdd65('0x46')][_0xdd65('0x47')]?_0x3a30e9[_0xdd65('0x46')]:_0xa051d0[_0xdd65('0x40')];if(_0x4beb77[_0xdd65('0x41')][_0xdd65('0x53')]){_0x3a30e9[_0xdd65('0x50')]=[{'all':!![]}];}_0x3a30e9=_[_0xdd65('0x4c')]({},_0x3a30e9,_0x4beb77[_0xdd65('0x4d')]);return db[_0xdd65('0x4e')]['find'](_0x3a30e9)[_0xdd65('0x2c')](handleEntityNotFound(_0xabcfb8,null))[_0xdd65('0x2c')](respondWithResult(_0xabcfb8,null))['catch'](handleError(_0xabcfb8,null));};exports[_0xdd65('0x54')]=function(_0x2a32f4,_0x21e34d){return db[_0xdd65('0x4e')][_0xdd65('0x54')](_0x2a32f4[_0xdd65('0x55')],{})[_0xdd65('0x2c')](function(_0x5e9e6b){var _0x59b83f=_0x2a32f4[_0xdd65('0x56')]['get']({'plain':!![]});if(!_0x59b83f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59b83f[_0xdd65('0x57')]===_0xdd65('0x56')){var _0x508b4b=_0x5e9e6b[_0xdd65('0x2e')]({'plain':!![]});var _0x3941e4=[{'name':_0xdd65('0x2f'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xdd65('0x32')}];var _0x48398f=_['find'](_0x3941e4,['value',_0x508b4b[_0xdd65('0x38')]])['name'];return db[_0xdd65('0x58')][_0xdd65('0x39')]({'where':{'name':_0x48398f,'userProfileId':_0x59b83f[_0xdd65('0x59')]},'raw':!![]})[_0xdd65('0x2c')](function(_0x10e4de){if(_0x10e4de&&_0x10e4de[_0xdd65('0x5a')]===0x0){return db['UserProfileResource'][_0xdd65('0x54')]({'name':_0x508b4b[_0xdd65('0x3a')],'resourceId':_0x508b4b['id'],'type':_0x10e4de[_0xdd65('0x3a')],'sectionId':_0x10e4de['id']},{})['then'](function(){return _0x5e9e6b;});}else{return _0x5e9e6b;}})[_0xdd65('0x51')](function(_0x209714){logger[_0xdd65('0x3c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x209714);throw _0x209714;});}return _0x5e9e6b;})[_0xdd65('0x2c')](respondWithResult(_0x21e34d,0xc9))[_0xdd65('0x51')](handleError(_0x21e34d,null));};exports[_0xdd65('0x5b')]=function(_0x58dac9,_0x577298){var _0x1ba50e={'where':{'id':_0x58dac9['params']['id']}},_0x4df12e={};_0x4df12e[_0xdd65('0x40')]=_[_0xdd65('0x42')](db[_0xdd65('0x4e')][_0xdd65('0x3f')]);_0x1ba50e[_0xdd65('0x46')]=_['intersection'](_0x4df12e[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x58dac9[_0xdd65('0x41')][_0xdd65('0x45')]));_0x1ba50e[_0xdd65('0x46')]=_0x1ba50e[_0xdd65('0x46')][_0xdd65('0x47')]?_0x1ba50e['attributes']:_0x4df12e[_0xdd65('0x40')];if(_0x58dac9[_0xdd65('0x41')][_0xdd65('0x53')]){_0x1ba50e[_0xdd65('0x50')]=[{'all':!![]}];}_0x1ba50e=_['merge']({},_0x1ba50e,_0x58dac9[_0xdd65('0x4d')]);return db['VoiceQueue'][_0xdd65('0x39')](_0x1ba50e)[_0xdd65('0x2c')](handleEntityNotFound(_0x577298,null))[_0xdd65('0x2c')](function(_0x451763){if(_0x451763){var _0x2e9663=_0x451763[_0xdd65('0x2e')]({'plain':!![]});_0x2e9663=qs[_0xdd65('0x5c')](_0x2e9663,['id','createdAt','updatedAt']);_0x58dac9[_0xdd65('0x55')]=_[_0xdd65('0x5c')](_0x58dac9[_0xdd65('0x55')],['id',_0xdd65('0x5d'),_0xdd65('0x5e')]);return db[_0xdd65('0x4e')]['create'](_['merge'](_0x2e9663,_0x58dac9[_0xdd65('0x55')]),{'include':_0x58dac9[_0xdd65('0x41')]['includeAll']?[{'all':!![]}]:undefined})[_0xdd65('0x2c')](function(_0x8a92b7){var _0x4c644f=_0x58dac9['user'][_0xdd65('0x2e')]({'plain':!![]});if(!_0x4c644f)throw new Error(_0xdd65('0x5f'));if(_0x4c644f['role']===_0xdd65('0x56')){var _0x24186b=_0x8a92b7[_0xdd65('0x2e')]({'plain':!![]});var _0x4e2a2d=[{'name':'VoiceQueues','value':_0xdd65('0x30')},{'name':_0xdd65('0x31'),'value':'outbound'}];var _0x177f53=_['find'](_0x4e2a2d,['value',_0x24186b[_0xdd65('0x38')]])[_0xdd65('0x3a')];return db['UserProfileSection'][_0xdd65('0x39')]({'where':{'name':_0x177f53,'userProfileId':_0x4c644f[_0xdd65('0x59')]},'raw':!![]})[_0xdd65('0x2c')](function(_0x4e21a1){if(_0x4e21a1&&_0x4e21a1[_0xdd65('0x5a')]===0x0){return db['UserProfileResource'][_0xdd65('0x54')]({'name':_0x24186b[_0xdd65('0x3a')],'resourceId':_0x24186b['id'],'type':_0x4e21a1[_0xdd65('0x3a')],'sectionId':_0x4e21a1['id']},{})[_0xdd65('0x2c')](function(){return _0x8a92b7;});}else{return _0x8a92b7;}})[_0xdd65('0x51')](function(_0x414a3f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x414a3f);throw _0x414a3f;});}return _0x8a92b7;});}})['then'](respondWithResult(_0x577298,0xc9))[_0xdd65('0x51')](handleError(_0x577298,null));};exports[_0xdd65('0x60')]=function(_0x2ab81f,_0x1bcd70){if(_0x2ab81f[_0xdd65('0x55')]['id']){delete _0x2ab81f[_0xdd65('0x55')]['id'];}return db[_0xdd65('0x4e')]['find']({'where':{'id':_0x2ab81f[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x1bcd70,null))[_0xdd65('0x2c')](saveUpdates(_0x2ab81f['body'],null))[_0xdd65('0x2c')](respondWithResult(_0x1bcd70,null))['catch'](handleError(_0x1bcd70,null));};exports[_0xdd65('0x2d')]=function(_0x51f6ae,_0x2f572a){return db['VoiceQueue'][_0xdd65('0x39')]({'where':{'id':_0x51f6ae[_0xdd65('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f572a,null))[_0xdd65('0x2c')](removeEntity(_0x2f572a,null))['catch'](handleError(_0x2f572a,null));};exports[_0xdd65('0x61')]=function(_0x3c7619,_0x3d8368,_0x53a1c8){var _0x3432c1={'raw':![],'where':{}};var _0x20d0cb={};var _0x4fa030={'count':0x0,'rows':[]};return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x3c7619[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x3d8368,null))['then'](function(_0xa356c9){if(_0xa356c9){_0x20d0cb['model']=_[_0xdd65('0x42')](db[_0xdd65('0x63')]['rawAttributes']);_0x20d0cb[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x3c7619['query']);_0x20d0cb[_0xdd65('0x43')]=_['intersection'](_0x20d0cb[_0xdd65('0x40')],_0x20d0cb[_0xdd65('0x41')]);_0x3432c1[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x20d0cb[_0xdd65('0x40')],qs['fields'](_0x3c7619[_0xdd65('0x41')][_0xdd65('0x45')]));_0x3432c1[_0xdd65('0x46')]=_0x3432c1[_0xdd65('0x46')][_0xdd65('0x47')]?_0x3432c1['attributes']:_0x20d0cb[_0xdd65('0x40')];if(!_0x3c7619[_0xdd65('0x41')][_0xdd65('0x64')](_0xdd65('0x65'))){_0x3432c1['limit']=qs[_0xdd65('0x26')](_0x3c7619[_0xdd65('0x41')]['limit']);_0x3432c1['offset']=qs[_0xdd65('0x24')](_0x3c7619[_0xdd65('0x41')][_0xdd65('0x24')]);}_0x3432c1['order']=qs['sort'](_0x3c7619['query'][_0xdd65('0x49')]);_0x3432c1[_0xdd65('0x4a')]=qs[_0xdd65('0x43')](_[_0xdd65('0x4b')](_0x3c7619[_0xdd65('0x41')],_0x20d0cb[_0xdd65('0x43')]));_0x3432c1['where'][_0xdd65('0x66')]=_0xa356c9['id'];if(_0x3c7619[_0xdd65('0x41')][_0xdd65('0x33')]){_0x3432c1[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x3432c1[_0xdd65('0x4a')],{'$or':_['map'](_0x3432c1[_0xdd65('0x46')],function(_0xfa0f5a){var _0x5e108b={};_0x5e108b[_0xfa0f5a]={'$like':'%'+_0x3c7619[_0xdd65('0x41')][_0xdd65('0x33')]+'%'};return _0x5e108b;})});}_0x3432c1=_[_0xdd65('0x4c')]({},_0x3432c1,_0x3c7619[_0xdd65('0x4d')]);return db[_0xdd65('0x63')][_0xdd65('0x4f')]({'where':_0x3432c1['where']})[_0xdd65('0x2c')](function(_0x2911a3){_0x4fa030[_0xdd65('0x4f')]=_0x2911a3;if(_0x3c7619[_0xdd65('0x41')][_0xdd65('0x53')]){_0x3432c1['include']=[{'all':!![]}];}return db[_0xdd65('0x63')][_0xdd65('0x67')](_0x3432c1);})['then'](function(_0x22b59d){_0x4fa030[_0xdd65('0x68')]=_0x22b59d;return _0x4fa030;});}})['then'](respondWithFilteredResult(_0x3d8368,_0x3432c1))['catch'](handleError(_0x3d8368,null));};exports[_0xdd65('0x69')]=function(_0x195a32,_0x448d82,_0x12f24e){var _0x5c9870={'raw':!![],'where':{}};var _0x548efc={};var _0x4dfe7d={'count':0x0,'rows':[]};return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x195a32[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x448d82,null))['then'](function(_0x58de6f){if(_0x58de6f){_0x548efc[_0xdd65('0x40')]=_['keys'](db[_0xdd65('0x6a')]['rawAttributes']);_0x548efc[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x195a32[_0xdd65('0x41')]);_0x548efc[_0xdd65('0x43')]=_[_0xdd65('0x44')](_0x548efc['model'],_0x548efc['query']);_0x5c9870[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x548efc[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x195a32[_0xdd65('0x41')][_0xdd65('0x45')]));_0x5c9870[_0xdd65('0x46')]=_0x5c9870['attributes'][_0xdd65('0x47')]?_0x5c9870['attributes']:_0x548efc[_0xdd65('0x40')];if(!_0x195a32[_0xdd65('0x41')]['hasOwnProperty']('nolimit')){_0x5c9870['limit']=qs['limit'](_0x195a32[_0xdd65('0x41')][_0xdd65('0x26')]);_0x5c9870[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x195a32[_0xdd65('0x41')][_0xdd65('0x24')]);}_0x5c9870[_0xdd65('0x48')]=qs['sort'](_0x195a32['query'][_0xdd65('0x49')]);_0x5c9870['where']=qs['filters'](_[_0xdd65('0x4b')](_0x195a32[_0xdd65('0x41')],_0x548efc['filters']));_0x5c9870[_0xdd65('0x4a')][_0xdd65('0x66')]=_0x58de6f['id'];if(_0x195a32[_0xdd65('0x41')][_0xdd65('0x33')]){_0x5c9870[_0xdd65('0x4a')]=_['merge'](_0x5c9870['where'],{'$or':_[_0xdd65('0x35')](_0x5c9870[_0xdd65('0x46')],function(_0x480478){var _0x40c742={};_0x40c742[_0x480478]={'$like':'%'+_0x195a32[_0xdd65('0x41')]['filter']+'%'};return _0x40c742;})});}_0x5c9870=_[_0xdd65('0x4c')]({},_0x5c9870,_0x195a32[_0xdd65('0x4d')]);return db[_0xdd65('0x6a')]['count']({'where':_0x5c9870[_0xdd65('0x4a')]})[_0xdd65('0x2c')](function(_0x597b23){_0x4dfe7d['count']=_0x597b23;if(_0x195a32[_0xdd65('0x41')][_0xdd65('0x53')]){_0x5c9870[_0xdd65('0x50')]=[{'all':!![]}];}return db[_0xdd65('0x6a')][_0xdd65('0x67')](_0x5c9870);})[_0xdd65('0x2c')](function(_0x4dd8eb){_0x4dfe7d[_0xdd65('0x68')]=_0x4dd8eb;return _0x4dfe7d;});}})['then'](respondWithFilteredResult(_0x448d82,_0x5c9870))[_0xdd65('0x51')](handleError(_0x448d82,null));};exports[_0xdd65('0x6b')]=function(_0x3c6782,_0x25f71e,_0x281450){var _0x55e37d={'raw':!![],'where':{}};var _0x14cce7={};var _0x10dea5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdd65('0x62')]({'where':{'id':_0x3c6782[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x25f71e,null))[_0xdd65('0x2c')](function(_0x1aa41a){if(_0x1aa41a){_0x14cce7[_0xdd65('0x40')]=_[_0xdd65('0x42')](db[_0xdd65('0x6c')]['rawAttributes']);_0x14cce7['query']=_[_0xdd65('0x42')](_0x3c6782[_0xdd65('0x41')]);_0x14cce7[_0xdd65('0x43')]=_[_0xdd65('0x44')](_0x14cce7[_0xdd65('0x40')],_0x14cce7['query']);_0x55e37d[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x14cce7['model'],qs['fields'](_0x3c6782[_0xdd65('0x41')][_0xdd65('0x45')]));_0x55e37d[_0xdd65('0x46')]=_0x55e37d[_0xdd65('0x46')][_0xdd65('0x47')]?_0x55e37d['attributes']:_0x14cce7[_0xdd65('0x40')];if(!_0x3c6782['query'][_0xdd65('0x64')]('nolimit')){_0x55e37d[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x3c6782[_0xdd65('0x41')][_0xdd65('0x26')]);_0x55e37d[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x3c6782[_0xdd65('0x41')][_0xdd65('0x24')]);}_0x55e37d[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x3c6782[_0xdd65('0x41')][_0xdd65('0x49')]);_0x55e37d[_0xdd65('0x4a')]=qs['filters'](_[_0xdd65('0x4b')](_0x3c6782[_0xdd65('0x41')],_0x14cce7[_0xdd65('0x43')]));_0x55e37d['where']['VoiceQueueId']=_0x1aa41a['id'];if(_0x3c6782['query'][_0xdd65('0x33')]){_0x55e37d['where']=_[_0xdd65('0x4c')](_0x55e37d[_0xdd65('0x4a')],{'$or':_[_0xdd65('0x35')](_0x55e37d[_0xdd65('0x46')],function(_0x285378){var _0x573da7={};_0x573da7[_0x285378]={'$like':'%'+_0x3c6782[_0xdd65('0x41')]['filter']+'%'};return _0x573da7;})});}_0x55e37d=_[_0xdd65('0x4c')]({},_0x55e37d,_0x3c6782[_0xdd65('0x4d')]);return db[_0xdd65('0x6c')][_0xdd65('0x4f')]({'where':_0x55e37d[_0xdd65('0x4a')]})[_0xdd65('0x2c')](function(_0x34dd79){_0x10dea5[_0xdd65('0x4f')]=_0x34dd79;if(_0x3c6782[_0xdd65('0x41')][_0xdd65('0x53')]){_0x55e37d[_0xdd65('0x50')]=[{'all':!![]}];}return db[_0xdd65('0x6c')]['findAll'](_0x55e37d);})[_0xdd65('0x2c')](function(_0x527a36){_0x10dea5[_0xdd65('0x68')]=_0x527a36;return _0x10dea5;});}})[_0xdd65('0x2c')](respondWithFilteredResult(_0x25f71e,_0x55e37d))[_0xdd65('0x51')](handleError(_0x25f71e,null));};exports[_0xdd65('0x6d')]=function(_0x1da877,_0x59bc45,_0x338226){var _0x4520c1={'raw':!![],'where':{}};var _0x5ee26e={};var _0xa6f3a6={'count':0x0,'rows':[]};return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x1da877['params']['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x59bc45,null))['then'](function(_0x17d1c5){if(_0x17d1c5){_0x5ee26e['model']=_[_0xdd65('0x42')](db[_0xdd65('0x6e')][_0xdd65('0x3f')]);_0x5ee26e[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x1da877['query']);_0x5ee26e['filters']=_[_0xdd65('0x44')](_0x5ee26e[_0xdd65('0x40')],_0x5ee26e['query']);_0x4520c1[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x5ee26e[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x1da877['query'][_0xdd65('0x45')]));_0x4520c1[_0xdd65('0x46')]=_0x4520c1[_0xdd65('0x46')]['length']?_0x4520c1[_0xdd65('0x46')]:_0x5ee26e['model'];if(!_0x1da877['query'][_0xdd65('0x64')](_0xdd65('0x65'))){_0x4520c1[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x1da877['query'][_0xdd65('0x26')]);_0x4520c1[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x1da877[_0xdd65('0x41')][_0xdd65('0x24')]);}_0x4520c1[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x1da877['query'][_0xdd65('0x49')]);_0x4520c1[_0xdd65('0x4a')]=qs['filters'](_['pick'](_0x1da877[_0xdd65('0x41')],_0x5ee26e[_0xdd65('0x43')]));_0x4520c1['where'][_0xdd65('0x66')]=_0x17d1c5['id'];if(_0x1da877[_0xdd65('0x41')]['filter']){_0x4520c1['where']=_[_0xdd65('0x4c')](_0x4520c1['where'],{'$or':_[_0xdd65('0x35')](_0x4520c1[_0xdd65('0x46')],function(_0x2e3e1a){var _0x1d2d54={};_0x1d2d54[_0x2e3e1a]={'$like':'%'+_0x1da877[_0xdd65('0x41')]['filter']+'%'};return _0x1d2d54;})});}_0x4520c1=_[_0xdd65('0x4c')]({},_0x4520c1,_0x1da877[_0xdd65('0x4d')]);return db[_0xdd65('0x6e')][_0xdd65('0x4f')]({'where':_0x4520c1[_0xdd65('0x4a')]})[_0xdd65('0x2c')](function(_0x5a7069){_0xa6f3a6['count']=_0x5a7069;if(_0x1da877[_0xdd65('0x41')][_0xdd65('0x53')]){_0x4520c1['include']=[{'all':!![]}];}return db[_0xdd65('0x6e')]['findAll'](_0x4520c1);})[_0xdd65('0x2c')](function(_0x4a5b4b){_0xa6f3a6[_0xdd65('0x68')]=_0x4a5b4b;return _0xa6f3a6;});}})[_0xdd65('0x2c')](respondWithFilteredResult(_0x59bc45,_0x4520c1))[_0xdd65('0x51')](handleError(_0x59bc45,null));};exports['getTeams']=function(_0x33cb25,_0x377698,_0xece355){var _0x3778d6={};var _0x251cf2={};var _0x854b94;var _0x5784cc;return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x33cb25[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x377698,null))[_0xdd65('0x2c')](function(_0x3a9e4b){if(_0x3a9e4b){_0x854b94=_0x3a9e4b;_0x251cf2[_0xdd65('0x40')]=_['keys'](db[_0xdd65('0x6f')][_0xdd65('0x3f')]);_0x251cf2[_0xdd65('0x41')]=_['keys'](_0x33cb25[_0xdd65('0x41')]);_0x251cf2[_0xdd65('0x43')]=_[_0xdd65('0x44')](_0x251cf2['model'],_0x251cf2[_0xdd65('0x41')]);_0x3778d6[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x251cf2['model'],qs['fields'](_0x33cb25[_0xdd65('0x41')]['fields']));_0x3778d6[_0xdd65('0x46')]=_0x3778d6[_0xdd65('0x46')][_0xdd65('0x47')]?_0x3778d6[_0xdd65('0x46')]:_0x251cf2[_0xdd65('0x40')];_0x3778d6[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x33cb25[_0xdd65('0x41')][_0xdd65('0x49')]);_0x3778d6[_0xdd65('0x4a')]=qs[_0xdd65('0x43')](_[_0xdd65('0x4b')](_0x33cb25[_0xdd65('0x41')],_0x251cf2[_0xdd65('0x43')]));if(_0x33cb25[_0xdd65('0x41')][_0xdd65('0x33')]){_0x3778d6[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x3778d6['where'],{'$or':_[_0xdd65('0x35')](_0x3778d6[_0xdd65('0x46')],function(_0x2384d1){var _0x3f17c5={};_0x3f17c5[_0x2384d1]={'$like':'%'+_0x33cb25[_0xdd65('0x41')]['filter']+'%'};return _0x3f17c5;})});}_0x3778d6=_['merge']({},_0x3778d6,_0x33cb25[_0xdd65('0x4d')]);return _0x854b94[_0xdd65('0x70')](_0x3778d6);}})[_0xdd65('0x2c')](function(_0x2e1714){if(_0x2e1714){_0x5784cc=_0x2e1714['length'];if(!_0x33cb25[_0xdd65('0x41')][_0xdd65('0x64')]('nolimit')){_0x3778d6[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x33cb25[_0xdd65('0x41')][_0xdd65('0x26')]);_0x3778d6[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x33cb25[_0xdd65('0x41')][_0xdd65('0x24')]);}return _0x854b94['getTeams'](_0x3778d6);}})['then'](function(_0x465c49){if(_0x465c49){return _0x465c49?{'count':_0x5784cc,'rows':_0x465c49}:null;}})[_0xdd65('0x2c')](respondWithResult(_0x377698,null))['catch'](handleError(_0x377698,null));};exports[_0xdd65('0x71')]=function(_0x48235b,_0x2b1a21,_0x3d9cd1){var _0x5bca5d=_0x48235b[_0xdd65('0x55')][_0xdd65('0x72')];var _0x378ebd=_[_0xdd65('0x35')](_0x5bca5d,'id');return db['Team'][_0xdd65('0x67')]({'where':{'id':_0x378ebd},'attributes':['id'],'include':[{'model':db[_0xdd65('0x73')],'as':'Agents','attributes':['id','name',_0xdd65('0x74'),_0xdd65('0x75'),'interface'],'raw':!![]}]})['then'](function(_0x1224d6){if(_0x1224d6){var _0x384d09=_[_0xdd65('0x76')](_0x1224d6,function(_0xb7f1d){var _0x15a384=_0xb7f1d[_0xdd65('0x2e')]({'plain':!![]});_0x15a384[_0xdd65('0x77')][_0xdd65('0x78')](function(_0x469940){_0x469940['penalty']=_['find'](_0x5bca5d,{'id':_0x15a384['id']})[_0xdd65('0x79')];});return _0x15a384['Agents'];});return db[_0xdd65('0x4e')][_0xdd65('0x39')]({'where':{'id':_0x48235b[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](function(_0x174309){return db['sequelize']['transaction'](function(_0x39b374){return _0x174309[_0xdd65('0x71')](_0x378ebd,{'transaction':_0x39b374})[_0xdd65('0x2c')](function(){return BPromise[_0xdd65('0x7a')](_0x5bca5d,function(_0x2d56b4){return db[_0xdd65('0x7b')][_0xdd65('0x7c')]({'TeamId':_0x2d56b4['id'],'VoiceQueueId':_0x48235b[_0xdd65('0x52')]['id'],'penalty':_0x2d56b4[_0xdd65('0x79')]},{'transaction':_0x39b374});});})['then'](function(){return BPromise[_0xdd65('0x7a')](_0x384d09,function(_0x416dd0){return db[_0xdd65('0x7d')][_0xdd65('0x7e')]({'where':{'UserId':_0x416dd0['id'],'VoiceQueueId':_0x48235b[_0xdd65('0x52')]['id']},'defaults':{'penalty':_0x416dd0['penalty']},'transaction':_0x39b374});});})['then'](function(){return BPromise['each'](_['filter'](_0x384d09,{'online':!![]}),function(_0x41b206){return db[_0xdd65('0x7f')][_0xdd65('0x7c')]({'membername':_0x41b206[_0xdd65('0x3a')],'UserId':_0x41b206['id'],'queue_name':_0x174309[_0xdd65('0x3a')],'VoiceQueueId':_0x174309['id'],'interface':_[_0xdd65('0x80')](_0x41b206[_0xdd65('0x81')])?util['format'](_0xdd65('0x82'),_0x41b206[_0xdd65('0x3a')]):_0x41b206[_0xdd65('0x81')],'paused':_0x41b206['voicePause']||![],'penalty':_0x41b206['penalty']},{'transaction':_0x39b374});});})['then'](function(){_0x384d09['forEach'](function(_0x38ca62){socket['emit'](_0xdd65('0x83'),{'UserId':_0x38ca62['id'],'VoiceQueueId':_0x174309['id']});});});});});}})[_0xdd65('0x2c')](respondWithStatusCode(_0x2b1a21,null))[_0xdd65('0x51')](handleError(_0x2b1a21,null));};exports['removeTeams']=function(_0x34a374,_0x27eb83,_0x237845){return db[_0xdd65('0x6f')][_0xdd65('0x67')]({'where':{'id':_0x34a374[_0xdd65('0x41')][_0xdd65('0x84')]},'attributes':['id'],'include':[{'model':db[_0xdd65('0x73')],'as':_0xdd65('0x77'),'attributes':['id'],'raw':!![]}]})[_0xdd65('0x2c')](handleEntityNotFound(_0x27eb83,null))[_0xdd65('0x2c')](function(_0x58a5ae){var _0x443c4a=_[_0xdd65('0x35')](_0x58a5ae,'id');var _0x262911=[];var _0x5ee7ad=[];var _0x5da979=squel[_0xdd65('0x85')]();_0x5da979[_0xdd65('0x86')](_0xdd65('0x87'))[_0xdd65('0x88')](_0xdd65('0x89'),'tq')[_0xdd65('0x8a')](_0xdd65('0x8b'),'ut',_0xdd65('0x8c'))[_0xdd65('0x4a')]('VoiceQueueId\x20=\x20?',_0x34a374[_0xdd65('0x52')]['id']);for(var _0x4d0aba=0x0;_0x4d0aba<_0x58a5ae[_0xdd65('0x47')];_0x4d0aba+=0x1){let _0x392b3a=_0x58a5ae[_0x4d0aba];for(var _0x5f5cf9=0x0;_0x5f5cf9<_0x392b3a[_0xdd65('0x77')][_0xdd65('0x47')];_0x5f5cf9+=0x1){let _0x1380fd=_0x392b3a['Agents'][_0x5f5cf9];var _0x5ead9c=_0x5da979[_0xdd65('0x5b')]();_0x5ead9c[_0xdd65('0x4a')](_0xdd65('0x8d'),_0x1380fd['id']);_0x5ee7ad[_0xdd65('0x8e')](db[_0xdd65('0x8f')][_0xdd65('0x41')](_0x5ead9c[_0xdd65('0x90')](),{'type':db[_0xdd65('0x8f')]['QueryTypes']['SELECT']})['then'](function(_0x22037d){if(_0x22037d[_0xdd65('0x47')]===0x1){return _0x1380fd['id'];}else{var _0x32d690=_[_0xdd65('0x91')](_[_0xdd65('0x35')](_0x22037d,_0xdd65('0x92')),function(_0x4b198f){return _['includes'](_0x443c4a,_0x4b198f);});if(_0x32d690){return _0x1380fd['id'];}}}));}}return BPromise['all'](_0x5ee7ad)['then'](function(_0x4e0426){_0x262911=_(_0x262911)[_0xdd65('0x93')](_0x4e0426)[_0xdd65('0x94')]()[_0xdd65('0x36')]();return db[_0xdd65('0x4e')][_0xdd65('0x39')]({'where':{'id':_0x34a374['params']['id']}})[_0xdd65('0x2c')](function(_0x2d6c33){return db[_0xdd65('0x8f')][_0xdd65('0x95')](function(_0x235d36){return _0x2d6c33[_0xdd65('0x96')](_0x34a374[_0xdd65('0x41')][_0xdd65('0x84')],{'transaction':_0x235d36})['then'](function(){if(!_['isEmpty'](_0x262911)){return _0x2d6c33[_0xdd65('0x97')](_0x262911,{'transaction':_0x235d36})['then'](function(){return db[_0xdd65('0x7f')][_0xdd65('0x2d')]({'where':{'VoiceQueueId':_0x34a374[_0xdd65('0x52')]['id'],'UserId':_0x262911},'transaction':_0x235d36});});}})['then'](function(){_0x262911[_0xdd65('0x78')](function(_0x23a637){socket['emit'](_0xdd65('0x98'),{'UserId':_0x23a637,'VoiceQueueId':_0x2d6c33['id']});});});});});});})[_0xdd65('0x2c')](respondWithStatusCode(_0x27eb83,null))['catch'](handleError(_0x27eb83,null));};exports[_0xdd65('0x99')]=function(_0x370d2d,_0x34c8fa,_0x461e42){var _0x2a6e17,_0x16e548;return db[_0xdd65('0x4e')][_0xdd65('0x39')]({'where':{'id':_0x370d2d[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x34c8fa,null))['then'](function(_0x2428ad){if(_0x2428ad){_0x16e548=_0x2428ad;return _0x2428ad[_0xdd65('0x99')](_0x370d2d[_0xdd65('0x55')][_0xdd65('0x84')],_[_0xdd65('0x5c')](_0x370d2d['body'],[_0xdd65('0x84'),'id'])||{})['spread'](function(_0x448aac){for(var _0x2a6d92=0x0;_0x2a6d92<_0x370d2d[_0xdd65('0x55')][_0xdd65('0x84')][_0xdd65('0x47')];_0x2a6d92+=0x1){socket[_0xdd65('0x9a')](_0xdd65('0x83'),{'UserId':Number(_0x370d2d['body'][_0xdd65('0x84')][_0x2a6d92]),'VoiceQueueId':Number(_0x370d2d['params']['id'])});}return _0x448aac;});}})[_0xdd65('0x2c')](function(_0x4b7d94){_0x2a6e17=_0x4b7d94||[];if(_0x16e548){return db[_0xdd65('0x73')][_0xdd65('0x67')]({'where':{'id':_0x370d2d['body'][_0xdd65('0x84')]},'attributes':['id',_0xdd65('0x3a'),_0xdd65('0x74'),_0xdd65('0x75'),_0xdd65('0x81')],'raw':!![]});}})[_0xdd65('0x2c')](function(_0x20c219){if(!_[_0xdd65('0x9b')](_0x20c219)){var _0x1dbeb9=[];for(var _0x3af3b8=0x0;_0x3af3b8<_0x20c219['length'];_0x3af3b8++){if(_0x20c219[_0x3af3b8]['online']){_0x1dbeb9[_0xdd65('0x8e')](db[_0xdd65('0x7f')][_0xdd65('0x7c')]({'membername':_0x20c219[_0x3af3b8][_0xdd65('0x3a')],'UserId':_0x20c219[_0x3af3b8]['id'],'queue_name':_0x16e548[_0xdd65('0x3a')],'VoiceQueueId':_0x16e548['id'],'interface':_['isNil'](_0x20c219[_0x3af3b8][_0xdd65('0x81')])?util['format'](_0xdd65('0x82'),_0x20c219[_0x3af3b8][_0xdd65('0x3a')]):_0x20c219[_0x3af3b8]['interface'],'paused':_0x20c219[_0x3af3b8][_0xdd65('0x75')]||![],'penalty':_0x370d2d[_0xdd65('0x55')][_0xdd65('0x79')]||0x0}));}}return BPromise[_0xdd65('0x9c')](_0x1dbeb9);}})[_0xdd65('0x2c')](function(){return _0x2a6e17;})[_0xdd65('0x2c')](respondWithResult(_0x34c8fa,null))['catch'](handleError(_0x34c8fa,null));};exports[_0xdd65('0x97')]=function(_0x2b58bf,_0xf02f2f,_0x3931c0){return db[_0xdd65('0x4e')][_0xdd65('0x39')]({'where':{'id':_0x2b58bf[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0xf02f2f,null))[_0xdd65('0x2c')](function(_0x32ab03){if(_0x32ab03){return _0x32ab03[_0xdd65('0x97')](_0x2b58bf[_0xdd65('0x41')][_0xdd65('0x84')])[_0xdd65('0x2c')](function(){if(_[_0xdd65('0x9d')](_0x2b58bf['query'][_0xdd65('0x84')])){for(var _0x4a94a2=0x0;_0x4a94a2<_0x2b58bf[_0xdd65('0x41')][_0xdd65('0x84')]['length'];_0x4a94a2+=0x1){socket[_0xdd65('0x9a')]('userVoiceQueue:remove',{'UserId':Number(_0x2b58bf['query']['ids'][_0x4a94a2]),'VoiceQueueId':Number(_0x2b58bf['params']['id'])});}}else{socket[_0xdd65('0x9a')](_0xdd65('0x98'),{'UserId':Number(_0x2b58bf[_0xdd65('0x41')][_0xdd65('0x84')]),'VoiceQueueId':Number(_0x2b58bf[_0xdd65('0x52')]['id'])});}});}})[_0xdd65('0x2c')](function(_0x508457){return db[_0xdd65('0x7f')][_0xdd65('0x2d')]({'where':{'VoiceQueueId':_0x2b58bf[_0xdd65('0x52')]['id'],'UserId':_0x2b58bf[_0xdd65('0x41')][_0xdd65('0x84')]}})[_0xdd65('0x2c')](function(){return _0x508457;});})['then'](respondWithStatusCode(_0xf02f2f,null))[_0xdd65('0x51')](handleError(_0xf02f2f,null));};exports['getAgents']=function(_0x23c36f,_0x129836,_0x2c79e1){var _0x3734e5={};var _0x24aea2={};var _0x365a5f;var _0x5a3b4f;return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x23c36f[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x129836,null))[_0xdd65('0x2c')](function(_0x5db6f0){if(_0x5db6f0){_0x365a5f=_0x5db6f0;_0x24aea2[_0xdd65('0x40')]=_[_0xdd65('0x42')](db['User']['rawAttributes']);_0x24aea2[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x23c36f['query']);_0x24aea2[_0xdd65('0x43')]=_['intersection'](_0x24aea2[_0xdd65('0x40')],_0x24aea2[_0xdd65('0x41')]);_0x3734e5[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0x24aea2['model'],qs[_0xdd65('0x45')](_0x23c36f[_0xdd65('0x41')][_0xdd65('0x45')]));_0x3734e5['attributes']=_0x3734e5[_0xdd65('0x46')][_0xdd65('0x47')]?_0x3734e5[_0xdd65('0x46')]:_0x24aea2[_0xdd65('0x40')];_0x3734e5['order']=qs[_0xdd65('0x49')](_0x23c36f[_0xdd65('0x41')][_0xdd65('0x49')]);_0x3734e5['where']=qs['filters'](_[_0xdd65('0x4b')](_0x23c36f[_0xdd65('0x41')],_0x24aea2[_0xdd65('0x43')]));if(_0x23c36f[_0xdd65('0x41')][_0xdd65('0x33')]){_0x3734e5[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x3734e5[_0xdd65('0x4a')],{'$or':_['map'](_0x3734e5[_0xdd65('0x46')],function(_0x115228){var _0x274f96={};_0x274f96[_0x115228]={'$like':'%'+_0x23c36f[_0xdd65('0x41')][_0xdd65('0x33')]+'%'};return _0x274f96;})});}_0x3734e5=_[_0xdd65('0x4c')]({},_0x3734e5,_0x23c36f[_0xdd65('0x4d')]);return _0x365a5f['getAgents'](_0x3734e5);}})[_0xdd65('0x2c')](function(_0x3030db){if(_0x3030db){_0x5a3b4f=_0x3030db[_0xdd65('0x47')];if(!_0x23c36f['query'][_0xdd65('0x64')]('nolimit')){_0x3734e5[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x23c36f[_0xdd65('0x41')][_0xdd65('0x26')]);_0x3734e5[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x23c36f[_0xdd65('0x41')]['offset']);}return _0x365a5f[_0xdd65('0x9e')](_0x3734e5);}})[_0xdd65('0x2c')](function(_0x28e06a){if(_0x28e06a){return _0x28e06a?{'count':_0x5a3b4f,'rows':_0x28e06a}:null;}})[_0xdd65('0x2c')](respondWithResult(_0x129836,null))[_0xdd65('0x51')](handleError(_0x129836,null));};exports[_0xdd65('0x9f')]=function(_0x40d478,_0x4c010e,_0x5e5eda){var _0x2f5a72={};var _0xa99bf7={};var _0x83b605;var _0x126503;return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x40d478[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x4c010e,null))[_0xdd65('0x2c')](function(_0x41aaec){if(_0x41aaec){_0x83b605=_0x41aaec;_0xa99bf7[_0xdd65('0x40')]=_[_0xdd65('0x42')](db[_0xdd65('0x7f')][_0xdd65('0x3f')]);_0xa99bf7[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x40d478[_0xdd65('0x41')]);_0xa99bf7[_0xdd65('0x43')]=_[_0xdd65('0x44')](_0xa99bf7[_0xdd65('0x40')],_0xa99bf7[_0xdd65('0x41')]);_0x2f5a72[_0xdd65('0x46')]=_[_0xdd65('0x44')](_0xa99bf7[_0xdd65('0x40')],qs['fields'](_0x40d478[_0xdd65('0x41')][_0xdd65('0x45')]));_0x2f5a72[_0xdd65('0x46')]=_0x2f5a72[_0xdd65('0x46')]['length']?_0x2f5a72[_0xdd65('0x46')]:_0xa99bf7[_0xdd65('0x40')];_0x2f5a72[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x40d478[_0xdd65('0x41')][_0xdd65('0x49')]);_0x2f5a72[_0xdd65('0x4a')]=qs[_0xdd65('0x43')](_[_0xdd65('0x4b')](_0x40d478['query'],_0xa99bf7[_0xdd65('0x43')]));if(_0x40d478[_0xdd65('0x41')][_0xdd65('0x33')]){_0x2f5a72[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x2f5a72[_0xdd65('0x4a')],{'$or':_[_0xdd65('0x35')](_0x2f5a72['attributes'],function(_0x39e315){var _0x32af5f={};_0x32af5f[_0x39e315]={'$like':'%'+_0x40d478[_0xdd65('0x41')][_0xdd65('0x33')]+'%'};return _0x32af5f;})});}_0x2f5a72=_[_0xdd65('0x4c')]({},_0x2f5a72,_0x40d478[_0xdd65('0x4d')]);return _0x83b605[_0xdd65('0x9f')](_0x2f5a72);}})[_0xdd65('0x2c')](function(_0x2a9a02){if(_0x2a9a02){_0x126503=_0x2a9a02['length'];if(!_0x40d478[_0xdd65('0x41')][_0xdd65('0x64')](_0xdd65('0x65'))){_0x2f5a72[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x40d478[_0xdd65('0x41')][_0xdd65('0x26')]);_0x2f5a72[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x40d478[_0xdd65('0x41')][_0xdd65('0x24')]);}return _0x83b605[_0xdd65('0x9f')](_0x2f5a72);}})[_0xdd65('0x2c')](function(_0x37e06f){return _0x37e06f?{'count':_0x126503,'rows':_0x37e06f}:null;})[_0xdd65('0x2c')](respondWithResult(_0x4c010e,null))[_0xdd65('0x51')](handleError(_0x4c010e,null));};exports[_0xdd65('0xa0')]=function(_0x2a59d4,_0x5e062b,_0x110b40){var _0x5caaef={};var _0x17acc9={};var _0x1bcfbc;var _0x65608a;return db['VoiceQueue']['findOne']({'where':{'id':_0x2a59d4[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x5e062b,null))[_0xdd65('0x2c')](function(_0x397030){if(_0x397030){_0x1bcfbc=_0x397030;_0x17acc9['model']=_[_0xdd65('0x42')](db['CmList'][_0xdd65('0x3f')]);_0x17acc9['query']=_[_0xdd65('0x42')](_0x2a59d4['query']);_0x17acc9['filters']=_['intersection'](_0x17acc9[_0xdd65('0x40')],_0x17acc9['query']);_0x5caaef[_0xdd65('0x46')]=_['intersection'](_0x17acc9[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x2a59d4[_0xdd65('0x41')][_0xdd65('0x45')]));_0x5caaef[_0xdd65('0x46')]=_0x5caaef['attributes'][_0xdd65('0x47')]?_0x5caaef['attributes']:_0x17acc9['model'];_0x5caaef[_0xdd65('0x48')]=qs['sort'](_0x2a59d4['query'][_0xdd65('0x49')]);_0x5caaef[_0xdd65('0x4a')]=qs['filters'](_[_0xdd65('0x4b')](_0x2a59d4[_0xdd65('0x41')],_0x17acc9['filters']));if(_0x2a59d4[_0xdd65('0x41')][_0xdd65('0x33')]){_0x5caaef[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x5caaef[_0xdd65('0x4a')],{'$or':_[_0xdd65('0x35')](_0x5caaef[_0xdd65('0x46')],function(_0x1546f2){var _0x5b050f={};_0x5b050f[_0x1546f2]={'$like':'%'+_0x2a59d4[_0xdd65('0x41')]['filter']+'%'};return _0x5b050f;})});}_0x5caaef=_[_0xdd65('0x4c')]({},_0x5caaef,_0x2a59d4[_0xdd65('0x4d')]);return _0x1bcfbc[_0xdd65('0xa0')](_0x5caaef);}})['then'](function(_0x2c3d0e){if(_0x2c3d0e){_0x65608a=_0x2c3d0e['length'];if(!_0x2a59d4[_0xdd65('0x41')]['hasOwnProperty'](_0xdd65('0x65'))){_0x5caaef[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x2a59d4[_0xdd65('0x41')][_0xdd65('0x26')]);_0x5caaef[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x2a59d4[_0xdd65('0x41')][_0xdd65('0x24')]);}return _0x1bcfbc['getLists'](_0x5caaef);}})['then'](function(_0x5f4187){if(_0x5f4187){return _0x5f4187?{'count':_0x65608a,'rows':_0x5f4187}:null;}})[_0xdd65('0x2c')](respondWithResult(_0x5e062b,null))['catch'](handleError(_0x5e062b,null));};exports[_0xdd65('0xa1')]=function(_0x242871,_0x45a79d,_0x37449a){var _0x2cce5d,_0x34d1f1;return db['VoiceQueue'][_0xdd65('0x39')]({'where':{'id':_0x242871['params']['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x45a79d,null))['then'](function(_0x55378c){if(_0x55378c){_0x34d1f1=_0x55378c;return _0x55378c['addLists'](_0x242871[_0xdd65('0x55')][_0xdd65('0x84')],_[_0xdd65('0x5c')](_0x242871[_0xdd65('0x55')],['ids','id'])||{});}return null;})[_0xdd65('0xa2')](function(_0x24f2b3){var _0x50cc1e;_0x2cce5d=_0x24f2b3||[];var _0x226079=[];if(_0x24f2b3){for(var _0x3dd858=0x0;_0x3dd858<_0x24f2b3[_0xdd65('0x47')];_0x3dd858+=0x1){var _0x529050=_0x24f2b3[_0x3dd858]['get']({'plain':!![]});_0x34d1f1[_0xdd65('0xa3')]=_0x242871[_0xdd65('0x55')][_0xdd65('0xa3')]?_0x242871[_0xdd65('0x55')]['dialCheckDuplicateType']:_0x34d1f1[_0xdd65('0xa3')];switch(_0x34d1f1[_0xdd65('0xa3')]){case _0xdd65('0xa4'):_0x50cc1e=squel[_0xdd65('0xa5')]()[_0xdd65('0xa6')](_0xdd65('0xa7'))[_0xdd65('0xa8')]([_0xdd65('0xa9'),_0xdd65('0xaa'),_0xdd65('0xab'),_0xdd65('0xac'),_0xdd65('0x66'),_0xdd65('0x5d'),'updatedAt'],squel['select']()['field'](_0xdd65('0xa9'),_0xdd65('0xa9'))[_0xdd65('0x86')](_0xdd65('0xad'),_0xdd65('0xaa'))['field']('id',_0xdd65('0xab'))[_0xdd65('0x86')](_0x529050[_0xdd65('0xae')]['toString'](),'ListId')[_0xdd65('0x86')](_0x242871['params']['id'][_0xdd65('0x90')](),'VoiceQueueId')[_0xdd65('0x86')]('NOW()','createdAt')['field'](_0xdd65('0xad'),_0xdd65('0x5e'))['from'](_0xdd65('0xaf'))[_0xdd65('0x4a')](_0xdd65('0xb0'))[_0xdd65('0x4a')]('ListId\x20=\x20?',_0x529050[_0xdd65('0xae')][_0xdd65('0x90')]())['where'](_0xdd65('0xb1'))[_0xdd65('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xdd65('0x86')]('COALESCE(calleridnum,\x27\x27)')[_0xdd65('0x88')](_0xdd65('0xb2'))['where'](_0xdd65('0xb3'),_0x242871[_0xdd65('0x52')]['id'][_0xdd65('0x90')]()))[_0xdd65('0x4a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xdd65('0x85')]()['field'](_0xdd65('0xb4'))[_0xdd65('0x88')](_0xdd65('0xa7'))['where'](_0xdd65('0xb3'),_0x242871[_0xdd65('0x52')]['id'][_0xdd65('0x90')]())))['toString']();break;case _0xdd65('0xb5'):_0x50cc1e=squel['insert']()[_0xdd65('0xa6')](_0xdd65('0xa7'))['fromQuery'](['phone','scheduledAt',_0xdd65('0xab'),_0xdd65('0xac'),_0xdd65('0x66'),'createdAt','updatedAt'],squel[_0xdd65('0x85')]()[_0xdd65('0x86')]('phone',_0xdd65('0xa9'))[_0xdd65('0x86')](_0xdd65('0xad'),_0xdd65('0xaa'))[_0xdd65('0x86')]('id',_0xdd65('0xab'))[_0xdd65('0x86')](_0x529050['CmListId'][_0xdd65('0x90')](),_0xdd65('0xac'))[_0xdd65('0x86')](_0x242871['params']['id'][_0xdd65('0x90')](),_0xdd65('0x66'))['field'](_0xdd65('0xad'),_0xdd65('0x5d'))[_0xdd65('0x86')]('NOW()',_0xdd65('0x5e'))[_0xdd65('0x88')]('cm_contacts')[_0xdd65('0x4a')](_0xdd65('0xb0'))[_0xdd65('0x4a')](_0xdd65('0xb6'),_0x529050[_0xdd65('0xae')][_0xdd65('0x90')]())[_0xdd65('0x4a')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xdd65('0xb7'),squel[_0xdd65('0x85')]()[_0xdd65('0x86')](_0xdd65('0xb4'))['from'](_0xdd65('0xa7'))[_0xdd65('0x4a')](_0xdd65('0xb3'),_0x242871[_0xdd65('0x52')]['id'][_0xdd65('0x90')]())))['toString']();break;default:_0x50cc1e=squel[_0xdd65('0xa5')]()[_0xdd65('0xa6')](_0xdd65('0xa7'))[_0xdd65('0xa8')]([_0xdd65('0xa9'),_0xdd65('0xaa'),_0xdd65('0xab'),_0xdd65('0xac'),_0xdd65('0x66'),_0xdd65('0x5d'),_0xdd65('0x5e')],squel[_0xdd65('0x85')]()[_0xdd65('0x86')]('phone',_0xdd65('0xa9'))[_0xdd65('0x86')](_0xdd65('0xad'),'scheduledAt')[_0xdd65('0x86')]('id',_0xdd65('0xab'))[_0xdd65('0x86')](_0x529050[_0xdd65('0xae')]['toString'](),_0xdd65('0xac'))[_0xdd65('0x86')](_0x242871[_0xdd65('0x52')]['id']['toString'](),_0xdd65('0x66'))[_0xdd65('0x86')](_0xdd65('0xad'),'createdAt')[_0xdd65('0x86')](_0xdd65('0xad'),_0xdd65('0x5e'))['from'](_0xdd65('0xaf'))['where'](_0xdd65('0xb0'))['where'](_0xdd65('0xb6'),_0x529050[_0xdd65('0xae')]['toString']())[_0xdd65('0x4a')](_0xdd65('0xb1')))[_0xdd65('0x90')]();}_0x226079[_0xdd65('0x8e')](db['sequelize']['query'](_0x50cc1e));}return BPromise['all'](_0x226079);}})[_0xdd65('0x2c')](function(){return _0x2cce5d;})[_0xdd65('0x2c')](respondWithResult(_0x45a79d,null))['catch'](handleError(_0x45a79d,null));};exports['removeLists']=function(_0x3a55e6,_0x30741b,_0x4bf260){return db['VoiceQueue'][_0xdd65('0x39')]({'where':{'id':_0x3a55e6[_0xdd65('0x52')]['id']}})['then'](handleEntityNotFound(_0x30741b,null))['then'](function(_0x24a45b){if(_0x24a45b){return _0x24a45b[_0xdd65('0xb8')](_0x3a55e6[_0xdd65('0x41')][_0xdd65('0x84')]);}})[_0xdd65('0x2c')](function(_0x3e7553){if(_0x3e7553){return db['CmHopper']['destroy']({'where':{'ListId':_0x3a55e6[_0xdd65('0x41')][_0xdd65('0x84')],'VoiceQueueId':_0x3a55e6[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](function(){return _0x3e7553;});}})['then'](respondWithStatusCode(_0x30741b,null))[_0xdd65('0x51')](handleError(_0x30741b,null));};exports['getBlackLists']=function(_0x5fd856,_0x4d874f,_0x205b92){var _0x37bcaa={};var _0x2db97e={};var _0x560872;var _0x230d25;return db[_0xdd65('0x4e')][_0xdd65('0x62')]({'where':{'id':_0x5fd856['params']['id']}})['then'](handleEntityNotFound(_0x4d874f,null))[_0xdd65('0x2c')](function(_0x2b6719){if(_0x2b6719){_0x560872=_0x2b6719;_0x2db97e['model']=_[_0xdd65('0x42')](db[_0xdd65('0xb9')][_0xdd65('0x3f')]);_0x2db97e[_0xdd65('0x41')]=_[_0xdd65('0x42')](_0x5fd856['query']);_0x2db97e['filters']=_['intersection'](_0x2db97e['model'],_0x2db97e[_0xdd65('0x41')]);_0x37bcaa['attributes']=_[_0xdd65('0x44')](_0x2db97e[_0xdd65('0x40')],qs[_0xdd65('0x45')](_0x5fd856[_0xdd65('0x41')]['fields']));_0x37bcaa[_0xdd65('0x46')]=_0x37bcaa[_0xdd65('0x46')][_0xdd65('0x47')]?_0x37bcaa['attributes']:_0x2db97e[_0xdd65('0x40')];_0x37bcaa[_0xdd65('0x48')]=qs[_0xdd65('0x49')](_0x5fd856[_0xdd65('0x41')][_0xdd65('0x49')]);_0x37bcaa['where']=qs['filters'](_[_0xdd65('0x4b')](_0x5fd856['query'],_0x2db97e['filters']));if(_0x5fd856['query'][_0xdd65('0x33')]){_0x37bcaa[_0xdd65('0x4a')]=_[_0xdd65('0x4c')](_0x37bcaa[_0xdd65('0x4a')],{'$or':_[_0xdd65('0x35')](_0x37bcaa[_0xdd65('0x46')],function(_0x46ec68){var _0x1defbb={};_0x1defbb[_0x46ec68]={'$like':'%'+_0x5fd856[_0xdd65('0x41')][_0xdd65('0x33')]+'%'};return _0x1defbb;})});}_0x37bcaa=_[_0xdd65('0x4c')]({},_0x37bcaa,_0x5fd856[_0xdd65('0x4d')]);return _0x560872['getBlackLists'](_0x37bcaa);}})[_0xdd65('0x2c')](function(_0x2341a5){if(_0x2341a5){_0x230d25=_0x2341a5[_0xdd65('0x47')];if(!_0x5fd856[_0xdd65('0x41')][_0xdd65('0x64')](_0xdd65('0x65'))){_0x37bcaa[_0xdd65('0x26')]=qs[_0xdd65('0x26')](_0x5fd856[_0xdd65('0x41')][_0xdd65('0x26')]);_0x37bcaa[_0xdd65('0x24')]=qs[_0xdd65('0x24')](_0x5fd856[_0xdd65('0x41')][_0xdd65('0x24')]);}return _0x560872['getBlackLists'](_0x37bcaa);}})[_0xdd65('0x2c')](function(_0x39f18a){if(_0x39f18a){return _0x39f18a?{'count':_0x230d25,'rows':_0x39f18a}:null;}})[_0xdd65('0x2c')](respondWithResult(_0x4d874f,null))[_0xdd65('0x51')](handleError(_0x4d874f,null));};exports['addBlackLists']=function(_0x426451,_0x24b2dd,_0x126ff3){var _0x1c127c,_0x1e8672;return db[_0xdd65('0x4e')]['find']({'where':{'id':_0x426451[_0xdd65('0x52')]['id']}})['then'](handleEntityNotFound(_0x24b2dd,null))[_0xdd65('0x2c')](function(_0x4e99cc){if(_0x4e99cc){_0x1e8672=_0x4e99cc;return _0x4e99cc[_0xdd65('0xba')](_0x426451[_0xdd65('0x55')][_0xdd65('0x84')],_[_0xdd65('0x5c')](_0x426451[_0xdd65('0x55')],[_0xdd65('0x84'),'id'])||{});}return null;})[_0xdd65('0xa2')](function(_0xf8dee7){var _0x49cfbb;_0x1c127c=_0xf8dee7||[];var _0x19e6bc=[];if(_0xf8dee7){for(var _0x429837=0x0;_0x429837<_0xf8dee7[_0xdd65('0x47')];_0x429837+=0x1){var _0x5b28f0=_0xf8dee7[_0x429837][_0xdd65('0x2e')]({'plain':!![]});_0x49cfbb=squel['insert']()['into'](_0xdd65('0xbb'))[_0xdd65('0xa8')]([_0xdd65('0xa9'),_0xdd65('0xab'),'ListId',_0xdd65('0x66'),_0xdd65('0x5d'),_0xdd65('0x5e')],squel['select']()['field'](_0xdd65('0xa9'),'phone')[_0xdd65('0x86')]('id','ContactId')[_0xdd65('0x86')](_0x5b28f0[_0xdd65('0xae')][_0xdd65('0x90')](),_0xdd65('0xac'))[_0xdd65('0x86')](_0x426451[_0xdd65('0x52')]['id']['toString'](),_0xdd65('0x66'))['field'](_0xdd65('0xad'),_0xdd65('0x5d'))['field'](_0xdd65('0xad'),_0xdd65('0x5e'))['from']('cm_contacts')['where'](_0xdd65('0xb0'))['where'](_0xdd65('0xb6'),_0x5b28f0[_0xdd65('0xae')][_0xdd65('0x90')]())['where'](_0xdd65('0xb1')))[_0xdd65('0x90')]();_0x19e6bc[_0xdd65('0x8e')](db['sequelize'][_0xdd65('0x41')](_0x49cfbb));}return BPromise[_0xdd65('0x9c')](_0x19e6bc);}})[_0xdd65('0x2c')](function(){return _0x1c127c;})['then'](respondWithResult(_0x24b2dd,null))['catch'](handleError(_0x24b2dd,null));};exports[_0xdd65('0xbc')]=function(_0x3dd164,_0x4e8edb,_0x48091a){return db[_0xdd65('0x4e')][_0xdd65('0x39')]({'where':{'id':_0x3dd164[_0xdd65('0x52')]['id']}})[_0xdd65('0x2c')](handleEntityNotFound(_0x4e8edb,null))[_0xdd65('0x2c')](function(_0x18c2f0){if(_0x18c2f0){return _0x18c2f0[_0xdd65('0xbc')](_0x3dd164[_0xdd65('0x41')][_0xdd65('0x84')]);}})[_0xdd65('0x2c')](function(_0xeb1e27){if(_0xeb1e27){return db[_0xdd65('0x6e')][_0xdd65('0x2d')]({'where':{'ListId':_0x3dd164[_0xdd65('0x41')]['ids'],'VoiceQueueId':_0x3dd164['params']['id']}})[_0xdd65('0x2c')](function(){return _0xeb1e27;});}})['then'](respondWithStatusCode(_0x4e8edb,null))[_0xdd65('0x51')](handleError(_0x4e8edb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d3dd336..a34f1d4 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 _0xf655=['../../mysqldb','setMaxListeners','emit','hook','exports','events'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0xf655,0xd7));var _0x5f65=function(_0x3b3861,_0x8b0f28){_0x3b3861=_0x3b3861-0x0;var _0x5175f2=_0xf655[_0x3b3861];return _0x5175f2;};'use strict';var EventEmitter=require(_0x5f65('0x0'));var VoiceQueue=require(_0x5f65('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5f65('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e23c9){return function(_0x37771c,_0x13622f,_0x3aeb77){VoiceQueueEvents[_0x5f65('0x3')](_0x1e23c9+':'+_0x37771c['id'],_0x37771c);VoiceQueueEvents[_0x5f65('0x3')](_0x1e23c9,_0x37771c);_0x3aeb77(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x5f65('0x4')](e,emitEvent(event));}}module[_0x5f65('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0xf131=['update','remove','emit','hasOwnProperty','exports','setMaxListeners','save'];(function(_0x6c343b,_0x34abbd){var _0x367cab=function(_0x36c820){while(--_0x36c820){_0x6c343b['push'](_0x6c343b['shift']());}};_0x367cab(++_0x34abbd);}(_0xf131,0x18d));var _0x1f13=function(_0x6dae48,_0xe45c50){_0x6dae48=_0x6dae48-0x0;var _0x58f09e=_0xf131[_0x6dae48];return _0x58f09e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1f13('0x0')](0x0);var events={'afterCreate':_0x1f13('0x1'),'afterUpdate':_0x1f13('0x2'),'afterDestroy':_0x1f13('0x3')};function emitEvent(_0x32d3b4){return function(_0x402785,_0x101bfe,_0x4ce930){VoiceQueueEvents[_0x1f13('0x4')](_0x32d3b4+':'+_0x402785['id'],_0x402785);VoiceQueueEvents['emit'](_0x32d3b4,_0x402785);_0x4ce930(null);};}for(var e in events){if(events[_0x1f13('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x1f13('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d42dfd4..c68adb1 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x9d1658,_0x13535d){var _0x4a635b=function(_0x625192){while(--_0x625192){_0x9d1658['push'](_0x9d1658['shift']());}};_0x4a635b(++_0x13535d);}(_0xedd9,0xfc));var _0x9edd=function(_0x34e951,_0x5f5d14){_0x34e951=_0x34e951-0x0;var _0x2e9356=_0xedd9[_0x34e951];return _0x2e9356;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x4057e3,_0x3e30a9){var _0x4406de=function(_0x4b2c30){while(--_0x4b2c30){_0x4057e3['push'](_0x4057e3['shift']());}};_0x4406de(++_0x3e30a9);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'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 32905db..1aff10a 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 _0xa1ab=['error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','model','map','ShowVoiceQueue','find','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1faeeb,_0x4d24e6){var _0x2a3f29=function(_0x522f35){while(--_0x522f35){_0x1faeeb['push'](_0x1faeeb['shift']());}};_0x2a3f29(++_0x4d24e6);}(_0xa1ab,0x85));var _0xba1a=function(_0x33eac7,_0x198c89){_0x33eac7=_0x33eac7-0x0;var _0x1676ae=_0xa1ab[_0x33eac7];return _0x1676ae;};'use strict';var _=require(_0xba1a('0x0'));var util=require('util');var moment=require(_0xba1a('0x1'));var BPromise=require(_0xba1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba1a('0x3'))['db'];var utils=require(_0xba1a('0x4'));var logger=require(_0xba1a('0x5'))(_0xba1a('0x6'));var config=require(_0xba1a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xba1a('0x8')]({'port':0x232a});config[_0xba1a('0x9')]=_[_0xba1a('0xa')](config['redis'],{'host':_0xba1a('0xb'),'port':0x18eb});var socket=require(_0xba1a('0xc'))(new Redis(config[_0xba1a('0x9')]));require(_0xba1a('0xd'))[_0xba1a('0xe')](socket);function respondWithRpcPromise(_0xeeb4e7,_0x3bed0d,_0x427944){return new BPromise(function(_0x42c808,_0x2e80eb){return client[_0xba1a('0xf')](_0xeeb4e7,_0x427944)[_0xba1a('0x10')](function(_0x27b7b9){logger[_0xba1a('0x11')](_0xba1a('0x12'),_0x3bed0d,_0xba1a('0x13'));logger[_0xba1a('0x14')](_0xba1a('0x15'),_0x3bed0d,'request\x20sent',JSON[_0xba1a('0x16')](_0x27b7b9));if(_0x27b7b9[_0xba1a('0x17')]){if(_0x27b7b9['error'][_0xba1a('0x18')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3bed0d,_0x27b7b9[_0xba1a('0x17')][_0xba1a('0x19')]);return _0x2e80eb(_0x27b7b9[_0xba1a('0x17')]['message']);}logger[_0xba1a('0x17')](_0xba1a('0x12'),_0x3bed0d,_0x27b7b9[_0xba1a('0x17')][_0xba1a('0x19')]);return _0x42c808(_0x27b7b9['error'][_0xba1a('0x19')]);}else{logger[_0xba1a('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x3bed0d,_0xba1a('0x13'));_0x42c808(_0x27b7b9['result'][_0xba1a('0x19')]);}})[_0xba1a('0x1a')](function(_0x16225c){logger[_0xba1a('0x17')](_0xba1a('0x12'),_0x3bed0d,_0x16225c);_0x2e80eb(_0x16225c);});});}exports[_0xba1a('0x1b')]=function(_0x261cf3){var _0x5dbd91=this;return new Promise(function(_0x27d8ca,_0xc9115){return db[_0xba1a('0x1c')][_0xba1a('0x1d')]({'raw':_0x261cf3[_0xba1a('0x1e')]?_0x261cf3['options'][_0xba1a('0x1f')]===undefined?!![]:![]:!![],'where':_0x261cf3[_0xba1a('0x1e')]?_0x261cf3[_0xba1a('0x1e')][_0xba1a('0x20')]||null:null,'attributes':_0x261cf3['options']?_0x261cf3[_0xba1a('0x1e')][_0xba1a('0x21')]||null:null,'limit':_0x261cf3[_0xba1a('0x1e')]?_0x261cf3[_0xba1a('0x1e')]['limit']||null:null,'include':_0x261cf3[_0xba1a('0x1e')]?_0x261cf3[_0xba1a('0x1e')][_0xba1a('0x22')]?_['map'](_0x261cf3['options'][_0xba1a('0x22')],function(_0x13dcaf){return{'model':db[_0x13dcaf[_0xba1a('0x23')]],'as':_0x13dcaf['as'],'attributes':_0x13dcaf[_0xba1a('0x21')],'include':_0x13dcaf[_0xba1a('0x22')]?_[_0xba1a('0x24')](_0x13dcaf['include'],function(_0x2510c0){return{'model':db[_0x2510c0[_0xba1a('0x23')]],'as':_0x2510c0['as'],'attributes':_0x2510c0['attributes'],'include':_0x2510c0[_0xba1a('0x22')]?_[_0xba1a('0x24')](_0x2510c0[_0xba1a('0x22')],function(_0x64037d){return{'model':db[_0x64037d[_0xba1a('0x23')]],'as':_0x64037d['as'],'attributes':_0x64037d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c7fea){logger[_0xba1a('0x11')](_0xba1a('0x1b'),_0x261cf3);logger['debug']('GetVoiceQueue',_0x261cf3,JSON[_0xba1a('0x16')](_0x2c7fea));_0x27d8ca(_0x2c7fea);})['catch'](function(_0x3f8388){logger['error']('GetVoiceQueue',_0x3f8388[_0xba1a('0x19')],_0x261cf3);_0xc9115(_0x5dbd91['error'](0x1f4,_0x3f8388['message']));});});};exports[_0xba1a('0x25')]=function(_0xfb1f77){var _0x4229ff=this;return new Promise(function(_0x33c9a0,_0x503e09){return db[_0xba1a('0x1c')][_0xba1a('0x26')]({'raw':_0xfb1f77[_0xba1a('0x1e')]?_0xfb1f77[_0xba1a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xfb1f77[_0xba1a('0x1e')]?_0xfb1f77[_0xba1a('0x1e')]['where']||null:null,'attributes':_0xfb1f77['options']?_0xfb1f77['options']['attributes']||null:null,'include':_0xfb1f77[_0xba1a('0x1e')]?_0xfb1f77['options'][_0xba1a('0x22')]?_['map'](_0xfb1f77[_0xba1a('0x1e')][_0xba1a('0x22')],function(_0x601a8){return{'model':db[_0x601a8[_0xba1a('0x23')]],'as':_0x601a8['as'],'attributes':_0x601a8[_0xba1a('0x21')],'include':_0x601a8['include']?_[_0xba1a('0x24')](_0x601a8[_0xba1a('0x22')],function(_0x500936){return{'model':db[_0x500936[_0xba1a('0x23')]],'as':_0x500936['as'],'attributes':_0x500936['attributes'],'include':_0x500936[_0xba1a('0x22')]?_[_0xba1a('0x24')](_0x500936[_0xba1a('0x22')],function(_0xd521ac){return{'model':db[_0xd521ac[_0xba1a('0x23')]],'as':_0xd521ac['as'],'attributes':_0xd521ac[_0xba1a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xba1a('0x10')](function(_0x1e5c34){logger['info']('ShowVoiceQueue',_0xfb1f77);logger['debug'](_0xba1a('0x25'),_0xfb1f77,JSON['stringify'](_0x1e5c34));_0x33c9a0(_0x1e5c34);})[_0xba1a('0x1a')](function(_0x3df94e){logger['error'](_0xba1a('0x25'),_0x3df94e[_0xba1a('0x19')],_0xfb1f77);_0x503e09(_0x4229ff[_0xba1a('0x17')](0x1f4,_0x3df94e['message']));});});}; \ No newline at end of file +var _0x055b=['request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowVoiceQueue','find','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x237eb0,_0x3dcb7e){var _0x39e2c4=function(_0x5a05a8){while(--_0x5a05a8){_0x237eb0['push'](_0x237eb0['shift']());}};_0x39e2c4(++_0x3dcb7e);}(_0x055b,0x97));var _0xb055=function(_0x3b3ec9,_0x114fe5){_0x3b3ec9=_0x3b3ec9-0x0;var _0x4b4be5=_0x055b[_0x3b3ec9];return _0x4b4be5;};'use strict';var _=require(_0xb055('0x0'));var util=require(_0xb055('0x1'));var moment=require('moment');var BPromise=require(_0xb055('0x2'));var rs=require(_0xb055('0x3'));var fs=require('fs');var Redis=require(_0xb055('0x4'));var db=require(_0xb055('0x5'))['db'];var utils=require(_0xb055('0x6'));var logger=require('../../config/logger')(_0xb055('0x7'));var config=require(_0xb055('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb055('0x9')][_0xb055('0xa')]({'port':0x232a});config[_0xb055('0xb')]=_[_0xb055('0xc')](config[_0xb055('0xb')],{'host':_0xb055('0xd'),'port':0x18eb});var socket=require(_0xb055('0xe'))(new Redis(config[_0xb055('0xb')]));require(_0xb055('0xf'))[_0xb055('0x10')](socket);function respondWithRpcPromise(_0x7e5693,_0x471b31,_0x2ff423){return new BPromise(function(_0x5d012c,_0x5699f0){return client[_0xb055('0x11')](_0x7e5693,_0x2ff423)[_0xb055('0x12')](function(_0x5422bd){logger['info'](_0xb055('0x13'),_0x471b31,_0xb055('0x14'));logger[_0xb055('0x15')](_0xb055('0x16'),_0x471b31,'request\x20sent',JSON['stringify'](_0x5422bd));if(_0x5422bd[_0xb055('0x17')]){if(_0x5422bd[_0xb055('0x17')][_0xb055('0x18')]===0x1f4){logger[_0xb055('0x17')](_0xb055('0x13'),_0x471b31,_0x5422bd[_0xb055('0x17')][_0xb055('0x19')]);return _0x5699f0(_0x5422bd[_0xb055('0x17')][_0xb055('0x19')]);}logger[_0xb055('0x17')](_0xb055('0x13'),_0x471b31,_0x5422bd['error'][_0xb055('0x19')]);return _0x5d012c(_0x5422bd['error'][_0xb055('0x19')]);}else{logger[_0xb055('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x471b31,_0xb055('0x14'));_0x5d012c(_0x5422bd['result'][_0xb055('0x19')]);}})[_0xb055('0x1b')](function(_0x31a133){logger['error'](_0xb055('0x13'),_0x471b31,_0x31a133);_0x5699f0(_0x31a133);});});}exports[_0xb055('0x1c')]=function(_0x5d5db7){var _0x149e7f=this;return new Promise(function(_0x47e591,_0x16f748){return db[_0xb055('0x1d')][_0xb055('0x1e')]({'raw':_0x5d5db7[_0xb055('0x1f')]?_0x5d5db7['options'][_0xb055('0x20')]===undefined?!![]:![]:!![],'where':_0x5d5db7['options']?_0x5d5db7['options'][_0xb055('0x21')]||null:null,'attributes':_0x5d5db7[_0xb055('0x1f')]?_0x5d5db7[_0xb055('0x1f')][_0xb055('0x22')]||null:null,'limit':_0x5d5db7['options']?_0x5d5db7['options'][_0xb055('0x23')]||null:null,'include':_0x5d5db7['options']?_0x5d5db7['options']['include']?_[_0xb055('0x24')](_0x5d5db7[_0xb055('0x1f')][_0xb055('0x25')],function(_0x34a059){return{'model':db[_0x34a059[_0xb055('0x26')]],'as':_0x34a059['as'],'attributes':_0x34a059['attributes'],'include':_0x34a059['include']?_['map'](_0x34a059[_0xb055('0x25')],function(_0x56d32e){return{'model':db[_0x56d32e['model']],'as':_0x56d32e['as'],'attributes':_0x56d32e['attributes'],'include':_0x56d32e[_0xb055('0x25')]?_[_0xb055('0x24')](_0x56d32e[_0xb055('0x25')],function(_0x130e1b){return{'model':db[_0x130e1b[_0xb055('0x26')]],'as':_0x130e1b['as'],'attributes':_0x130e1b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ddc2d){logger[_0xb055('0x1a')](_0xb055('0x1c'),_0x5d5db7);logger[_0xb055('0x15')](_0xb055('0x1c'),_0x5d5db7,JSON['stringify'](_0x5ddc2d));_0x47e591(_0x5ddc2d);})[_0xb055('0x1b')](function(_0x4712e0){logger[_0xb055('0x17')](_0xb055('0x1c'),_0x4712e0[_0xb055('0x19')],_0x5d5db7);_0x16f748(_0x149e7f['error'](0x1f4,_0x4712e0[_0xb055('0x19')]));});});};exports[_0xb055('0x27')]=function(_0x3f3853){var _0x132e75=this;return new Promise(function(_0x379f6d,_0x139b96){return db[_0xb055('0x1d')][_0xb055('0x28')]({'raw':_0x3f3853[_0xb055('0x1f')]?_0x3f3853[_0xb055('0x1f')][_0xb055('0x20')]===undefined?!![]:![]:!![],'where':_0x3f3853[_0xb055('0x1f')]?_0x3f3853[_0xb055('0x1f')][_0xb055('0x21')]||null:null,'attributes':_0x3f3853[_0xb055('0x1f')]?_0x3f3853[_0xb055('0x1f')][_0xb055('0x22')]||null:null,'include':_0x3f3853[_0xb055('0x1f')]?_0x3f3853[_0xb055('0x1f')][_0xb055('0x25')]?_[_0xb055('0x24')](_0x3f3853[_0xb055('0x1f')][_0xb055('0x25')],function(_0x526e8f){return{'model':db[_0x526e8f['model']],'as':_0x526e8f['as'],'attributes':_0x526e8f['attributes'],'include':_0x526e8f['include']?_['map'](_0x526e8f[_0xb055('0x25')],function(_0x51bacb){return{'model':db[_0x51bacb['model']],'as':_0x51bacb['as'],'attributes':_0x51bacb['attributes'],'include':_0x51bacb[_0xb055('0x25')]?_[_0xb055('0x24')](_0x51bacb[_0xb055('0x25')],function(_0x193ed6){return{'model':db[_0x193ed6['model']],'as':_0x193ed6['as'],'attributes':_0x193ed6[_0xb055('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb055('0x12')](function(_0x2d1330){logger['info'](_0xb055('0x27'),_0x3f3853);logger[_0xb055('0x15')](_0xb055('0x27'),_0x3f3853,JSON[_0xb055('0x29')](_0x2d1330));_0x379f6d(_0x2d1330);})['catch'](function(_0x5a8cd0){logger[_0xb055('0x17')](_0xb055('0x27'),_0x5a8cd0[_0xb055('0x19')],_0x3f3853);_0x139b96(_0x132e75[_0xb055('0x17')](0x1f4,_0x5a8cd0[_0xb055('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 01f9638..2398bd2 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 _0x506b=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x5ed40e,_0x293cc7){var _0x336ce0=function(_0x64a59b){while(--_0x64a59b){_0x5ed40e['push'](_0x5ed40e['shift']());}};_0x336ce0(++_0x293cc7);}(_0x506b,0x70));var _0xb506=function(_0x2c5698,_0x274eae){_0x2c5698=_0x2c5698-0x0;var _0x273578=_0x506b[_0x2c5698];return _0x273578;};'use strict';var VoiceQueueEvents=require(_0xb506('0x0'));var events=[_0xb506('0x1'),_0xb506('0x2'),_0xb506('0x3')];function createListener(_0x48fdd3,_0x16342c){return function(_0x17624a){_0x16342c[_0xb506('0x4')](_0x48fdd3,_0x17624a);};}function removeListener(_0x1457cb,_0x30e7b5){return function(){VoiceQueueEvents[_0xb506('0x5')](_0x1457cb,_0x30e7b5);};}exports[_0xb506('0x6')]=function(_0x3dc321){for(var _0x2cf165=0x0,_0x41d751=events[_0xb506('0x7')];_0x2cf165<_0x41d751;_0x2cf165++){var _0x9af721=events[_0x2cf165];var _0x15f735=createListener(_0xb506('0x8')+_0x9af721,_0x3dc321);VoiceQueueEvents['on'](_0x9af721,_0x15f735);}}; \ No newline at end of file +var _0x0e20=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x30e293,_0x2ece7a){var _0x5187f0=function(_0x2e9f0a){while(--_0x2e9f0a){_0x30e293['push'](_0x30e293['shift']());}};_0x5187f0(++_0x2ece7a);}(_0x0e20,0x7b));var _0x00e2=function(_0x4cfb5b,_0x52b67f){_0x4cfb5b=_0x4cfb5b-0x0;var _0x27691d=_0x0e20[_0x4cfb5b];return _0x27691d;};'use strict';var VoiceQueueEvents=require(_0x00e2('0x0'));var events=[_0x00e2('0x1'),_0x00e2('0x2'),_0x00e2('0x3')];function createListener(_0x5b0329,_0x428652){return function(_0x125b87){_0x428652[_0x00e2('0x4')](_0x5b0329,_0x125b87);};}function removeListener(_0x2eb866,_0x38cbaf){return function(){VoiceQueueEvents['removeListener'](_0x2eb866,_0x38cbaf);};}exports[_0x00e2('0x5')]=function(_0x1ed96f){for(var _0x3e6aa8=0x0,_0x54cf34=events[_0x00e2('0x6')];_0x3e6aa8<_0x54cf34;_0x3e6aa8++){var _0x56a89c=events[_0x3e6aa8];var _0x5ee686=createListener(_0x00e2('0x7')+_0x56a89c,_0x1ed96f);VoiceQueueEvents['on'](_0x56a89c,_0x5ee686);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c975458..2bf02f7 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 _0x7e90=['/describe','isAuthenticated','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index'];(function(_0x44fbfa,_0xd9dc24){var _0x49a0e0=function(_0x16d227){while(--_0x16d227){_0x44fbfa['push'](_0x44fbfa['shift']());}};_0x49a0e0(++_0xd9dc24);}(_0x7e90,0xbb));var _0x07e9=function(_0x410300,_0x4f83be){_0x410300=_0x410300-0x0;var _0x13c474=_0x7e90[_0x410300];return _0x13c474;};'use strict';var multer=require(_0x07e9('0x0'));var util=require(_0x07e9('0x1'));var path=require(_0x07e9('0x2'));var timeout=require(_0x07e9('0x3'));var express=require(_0x07e9('0x4'));var router=express[_0x07e9('0x5')]();var fs_extra=require(_0x07e9('0x6'));var auth=require(_0x07e9('0x7'));var interaction=require(_0x07e9('0x8'));var config=require(_0x07e9('0x9'));var controller=require(_0x07e9('0xa'));router[_0x07e9('0xb')]('/',auth['isAuthenticated'](),controller[_0x07e9('0xc')]);router[_0x07e9('0xb')](_0x07e9('0xd'),auth[_0x07e9('0xe')](),controller['describe']);router['get']('/index',auth[_0x07e9('0xe')](),controller[_0x07e9('0xf')]);router['get'](_0x07e9('0x10'),auth[_0x07e9('0xe')](),controller[_0x07e9('0x11')]);router[_0x07e9('0x12')]('/',auth[_0x07e9('0xe')](),controller[_0x07e9('0x13')]);router[_0x07e9('0x14')](_0x07e9('0x10'),auth[_0x07e9('0xe')](),controller[_0x07e9('0x15')]);router[_0x07e9('0x16')](_0x07e9('0x10'),auth[_0x07e9('0xe')](),controller[_0x07e9('0x17')]);module[_0x07e9('0x18')]=router; \ No newline at end of file +var _0xfcf3=['path','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','/index','getVoiceQueuesReport','/:id','show','put','update','delete','destroy','multer'];(function(_0x461c72,_0x330c4d){var _0x56a004=function(_0x2c316f){while(--_0x2c316f){_0x461c72['push'](_0x461c72['shift']());}};_0x56a004(++_0x330c4d);}(_0xfcf3,0x1df));var _0x3fcf=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xfcf3[_0x2bc3f4];return _0x14ac53;};'use strict';var multer=require(_0x3fcf('0x0'));var util=require('util');var path=require(_0x3fcf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3fcf('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3fcf('0x3'));var controller=require(_0x3fcf('0x4'));router[_0x3fcf('0x5')]('/',auth[_0x3fcf('0x6')](),controller['index']);router['get'](_0x3fcf('0x7'),auth[_0x3fcf('0x6')](),controller['describe']);router[_0x3fcf('0x5')](_0x3fcf('0x8'),auth[_0x3fcf('0x6')](),controller[_0x3fcf('0x9')]);router['get'](_0x3fcf('0xa'),auth['isAuthenticated'](),controller[_0x3fcf('0xb')]);router['post']('/',auth[_0x3fcf('0x6')](),controller['create']);router[_0x3fcf('0xc')](_0x3fcf('0xa'),auth['isAuthenticated'](),controller[_0x3fcf('0xd')]);router[_0x3fcf('0xe')](_0x3fcf('0xa'),auth[_0x3fcf('0x6')](),controller[_0x3fcf('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 6225e3c..411aa27 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 _0xd191=['YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','DATE','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','getDataValue','queuecallerjoinAt'];(function(_0xe92eee,_0x41959c){var _0x1216c6=function(_0x38f24e){while(--_0x38f24e){_0xe92eee['push'](_0xe92eee['shift']());}};_0x1216c6(++_0x41959c);}(_0xd191,0xf9));var _0x1d19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd191[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d19('0x0'));var moment=require(_0x1d19('0x1'));module[_0x1d19('0x2')]={'type':{'type':Sequelize[_0x1d19('0x3')]},'uniqueid':{'type':Sequelize[_0x1d19('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1d19('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x17ccec){var _0x271104=moment(_0x17ccec);var _0x4a5d15=moment(this[_0x1d19('0x4')](_0x1d19('0x5')))['format'](_0x1d19('0x6'));var _0x13794d=_0x271104[_0x1d19('0x7')](_0x4a5d15,'seconds');this[_0x1d19('0x8')](_0x1d19('0x9'),_0x17ccec);this[_0x1d19('0x8')](_0x1d19('0xa'),_0x13794d||null);}},'position':{'type':Sequelize[_0x1d19('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1d19('0xc')]},'queuecallercomplete':{'type':Sequelize[_0x1d19('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1d19('0xc')]},'queuecallerexit':{'type':Sequelize[_0x1d19('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1d19('0xc')]},'queuecallerexitreason':{'type':Sequelize[_0x1d19('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1d19('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1d19('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1d19('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x1d19('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1d19('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1d19('0x3')]},'transfer':{'type':Sequelize[_0x1d19('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x1d19('0xe')},'transferexten':{'type':Sequelize[_0x1d19('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x1d19('0x3')]},'secondDisposition':{'type':Sequelize[_0x1d19('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1d19('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x1d19('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd289=['diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd289,0x151));var _0x9d28=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0xd289[_0x54aea3];return _0x21ae46;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9d28('0x0'));module[_0x9d28('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9d28('0x2')]},'calleridnum':{'type':Sequelize[_0x9d28('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9d28('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x9d28('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x9d28('0x3')],'set':function(_0x4af04a){var _0x5a4bc9=moment(_0x4af04a);var _0x56c9bc=moment(this[_0x9d28('0x4')](_0x9d28('0x5')))[_0x9d28('0x6')](_0x9d28('0x7'));var _0x518a82=_0x5a4bc9[_0x9d28('0x8')](_0x56c9bc,'seconds');this['setDataValue'](_0x9d28('0x9'),_0x4af04a);this[_0x9d28('0xa')](_0x9d28('0xb'),_0x518a82||null);}},'position':{'type':Sequelize[_0x9d28('0xc')]},'count':{'type':Sequelize[_0x9d28('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x9d28('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x9d28('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9d28('0x3')]},'queuecallerexit':{'type':Sequelize[_0x9d28('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9d28('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9d28('0x2')]},'connectedlinename':{'type':Sequelize[_0x9d28('0x2')]},'accountcode':{'type':Sequelize[_0x9d28('0x2')]},'context':{'type':Sequelize[_0x9d28('0x2')]},'exten':{'type':Sequelize[_0x9d28('0x2')]},'priority':{'type':Sequelize[_0x9d28('0x2')]},'holdtime':{'type':Sequelize[_0x9d28('0xc')]},'mohtime':{'type':Sequelize[_0x9d28('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9d28('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9d28('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9d28('0xe')},'transferexten':{'type':Sequelize[_0x9d28('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9d28('0x2')]},'disposition':{'type':Sequelize[_0x9d28('0x2')]},'secondDisposition':{'type':Sequelize[_0x9d28('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 16386dc..52de9a8 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 _0x74b6=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','nolimit','order','pick','getVoiceQueuesReport'];(function(_0x132e74,_0x2588b4){var _0x5c2453=function(_0x54f7ac){while(--_0x54f7ac){_0x132e74['push'](_0x132e74['shift']());}};_0x5c2453(++_0x2588b4);}(_0x74b6,0xa4));var _0x674b=function(_0x324267,_0x5f20a8){_0x324267=_0x324267-0x0;var _0x30734f=_0x74b6[_0x324267];return _0x30734f;};'use strict';var emlformat=require(_0x674b('0x0'));var rimraf=require(_0x674b('0x1'));var zipdir=require(_0x674b('0x2'));var jsonpatch=require(_0x674b('0x3'));var rp=require(_0x674b('0x4'));var moment=require(_0x674b('0x5'));var BPromise=require(_0x674b('0x6'));var Mustache=require('mustache');var util=require(_0x674b('0x7'));var path=require(_0x674b('0x8'));var sox=require(_0x674b('0x9'));var csv=require(_0x674b('0xa'));var ejs=require(_0x674b('0xb'));var fs=require('fs');var fs_extra=require(_0x674b('0xc'));var _=require('lodash');var squel=require(_0x674b('0xd'));var crypto=require(_0x674b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x674b('0xa'));var querystring=require(_0x674b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x674b('0x10'));var qs=require(_0x674b('0x11'));var as=require(_0x674b('0x12'));var hardwareService=require(_0x674b('0x13'));var logger=require('../../config/logger')(_0x674b('0x14'));var utils=require(_0x674b('0x15'));var config=require(_0x674b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x674b('0x17'))['db'];config[_0x674b('0x18')]=_[_0x674b('0x19')](config[_0x674b('0x18')],{'host':_0x674b('0x1a'),'port':0x18eb});var socket=require(_0x674b('0x1b'))(new Redis(config[_0x674b('0x18')]));require(_0x674b('0x1c'))[_0x674b('0x1d')](socket);function respondWithStatusCode(_0x48b0ce,_0x394fcc){_0x394fcc=_0x394fcc||0xcc;return function(_0x4765a7){if(_0x4765a7){return _0x48b0ce[_0x674b('0x1e')](_0x394fcc);}return _0x48b0ce[_0x674b('0x1f')](_0x394fcc)[_0x674b('0x20')]();};}function respondWithResult(_0xfddf20,_0xc1fd74){_0xc1fd74=_0xc1fd74||0xc8;return function(_0xc8d532){if(_0xc8d532){return _0xfddf20[_0x674b('0x1f')](_0xc1fd74)[_0x674b('0x21')](_0xc8d532);}};}function respondWithFilteredResult(_0x18b70d,_0x167af6){return function(_0xfdd131){if(_0xfdd131){var _0x531518=typeof _0x167af6[_0x674b('0x22')]===_0x674b('0x23')&&typeof _0x167af6['limit']===_0x674b('0x23');var _0xc47901=_0xfdd131['count'];var _0x16067d=_0x531518?0x0:_0x167af6[_0x674b('0x22')];var _0x33a1ac=_0x531518?_0xfdd131[_0x674b('0x24')]:_0x167af6[_0x674b('0x22')]+_0x167af6[_0x674b('0x25')];var _0x1796ec;if(_0x33a1ac>=_0xc47901){_0x33a1ac=_0xc47901;_0x1796ec=0xc8;}else{_0x1796ec=0xce;}_0x18b70d[_0x674b('0x1f')](_0x1796ec);return _0x18b70d['set']('Content-Range',_0x16067d+'-'+_0x33a1ac+'/'+_0xc47901)['json'](_0xfdd131);}return null;};}function patchUpdates(_0x43f30d){return function(_0x249fe6){try{jsonpatch[_0x674b('0x26')](_0x249fe6,_0x43f30d,!![]);}catch(_0x1bd7e8){return BPromise['reject'](_0x1bd7e8);}return _0x249fe6[_0x674b('0x27')]();};}function saveUpdates(_0x41e52f,_0x2e54a9){return function(_0x33c129){if(_0x33c129){return _0x33c129[_0x674b('0x28')](_0x41e52f)[_0x674b('0x29')](function(_0xce58ed){return _0xce58ed;});}return null;};}function removeEntity(_0x264f81,_0x431ed4){return function(_0xfe2aba){if(_0xfe2aba){return _0xfe2aba[_0x674b('0x2a')]()[_0x674b('0x29')](function(){_0x264f81[_0x674b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x74c6d0,_0x4708fd){return function(_0x118da9){if(!_0x118da9){_0x74c6d0[_0x674b('0x1e')](0x194);}return _0x118da9;};}function handleError(_0x4be501,_0x20d304){_0x20d304=_0x20d304||0x1f4;return function(_0x4a3325){logger[_0x674b('0x2b')](_0x4a3325['stack']);if(_0x4a3325[_0x674b('0x2c')]){delete _0x4a3325[_0x674b('0x2c')];}_0x4be501[_0x674b('0x1f')](_0x20d304)[_0x674b('0x2d')](_0x4a3325);};}exports[_0x674b('0x2e')]=function(_0x3b2a7a,_0x5e8ef5){var _0x250d29={},_0x2286a={},_0x50e3bb={'count':0x0,'rows':[]};var _0x290355=_[_0x674b('0x2f')](db[_0x674b('0x30')][_0x674b('0x31')],function(_0x394892){return{'name':_0x394892[_0x674b('0x32')],'type':_0x394892[_0x674b('0x33')][_0x674b('0x34')]};});_0x2286a[_0x674b('0x35')]=_[_0x674b('0x2f')](_0x290355,_0x674b('0x2c'));_0x2286a[_0x674b('0x36')]=_[_0x674b('0x37')](_0x3b2a7a[_0x674b('0x36')]);_0x2286a[_0x674b('0x38')]=_[_0x674b('0x39')](_0x2286a[_0x674b('0x35')],_0x2286a[_0x674b('0x36')]);_0x250d29[_0x674b('0x3a')]=_['intersection'](_0x2286a[_0x674b('0x35')],qs[_0x674b('0x3b')](_0x3b2a7a[_0x674b('0x36')][_0x674b('0x3b')]));_0x250d29[_0x674b('0x3a')]=_0x250d29[_0x674b('0x3a')][_0x674b('0x3c')]?_0x250d29['attributes']:_0x2286a[_0x674b('0x35')];if(!_0x3b2a7a[_0x674b('0x36')][_0x674b('0x3d')]('nolimit')){_0x250d29[_0x674b('0x25')]=qs['limit'](_0x3b2a7a['query']['limit']);_0x250d29[_0x674b('0x22')]=qs[_0x674b('0x22')](_0x3b2a7a[_0x674b('0x36')][_0x674b('0x22')]);}_0x250d29['order']=qs['sort'](_0x3b2a7a['query'][_0x674b('0x3e')]);_0x250d29[_0x674b('0x3f')]=qs[_0x674b('0x38')](_['pick'](_0x3b2a7a[_0x674b('0x36')],_0x2286a['filters']),_0x290355);if(_0x3b2a7a[_0x674b('0x36')][_0x674b('0x40')]){_0x250d29['where']=_[_0x674b('0x41')](_0x250d29['where'],{'$or':_[_0x674b('0x2f')](_0x290355,function(_0x2e674f){if(_0x2e674f['type']!==_0x674b('0x42')){var _0x18483c={};_0x18483c[_0x2e674f[_0x674b('0x2c')]]={'$like':'%'+_0x3b2a7a[_0x674b('0x36')][_0x674b('0x40')]+'%'};return _0x18483c;}})});}_0x250d29=_[_0x674b('0x41')]({},_0x250d29,_0x3b2a7a[_0x674b('0x43')]);var _0x14e1d8={'where':_0x250d29[_0x674b('0x3f')]};return db[_0x674b('0x30')]['count'](_0x14e1d8)['then'](function(_0x443686){_0x50e3bb[_0x674b('0x24')]=_0x443686;if(_0x3b2a7a['query'][_0x674b('0x44')]){_0x250d29[_0x674b('0x45')]=[{'all':!![]}];}return db[_0x674b('0x30')][_0x674b('0x46')](_0x250d29);})[_0x674b('0x29')](function(_0xe98eb0){_0x50e3bb['rows']=_0xe98eb0;return _0x50e3bb;})[_0x674b('0x29')](respondWithFilteredResult(_0x5e8ef5,_0x250d29))[_0x674b('0x47')](handleError(_0x5e8ef5,null));};exports[_0x674b('0x48')]=function(_0x18f97f,_0x7e93ab){var _0x28c89d={'raw':![],'where':{'id':_0x18f97f[_0x674b('0x49')]['id']}},_0xf41c1b={};_0xf41c1b[_0x674b('0x35')]=_['keys'](db[_0x674b('0x30')]['rawAttributes']);_0xf41c1b['query']=_[_0x674b('0x37')](_0x18f97f['query']);_0xf41c1b[_0x674b('0x38')]=_[_0x674b('0x39')](_0xf41c1b[_0x674b('0x35')],_0xf41c1b[_0x674b('0x36')]);_0x28c89d[_0x674b('0x3a')]=_[_0x674b('0x39')](_0xf41c1b['model'],qs['fields'](_0x18f97f[_0x674b('0x36')][_0x674b('0x3b')]));_0x28c89d[_0x674b('0x3a')]=_0x28c89d[_0x674b('0x3a')]['length']?_0x28c89d['attributes']:_0xf41c1b['model'];if(_0x18f97f[_0x674b('0x36')][_0x674b('0x44')]){_0x28c89d['include']=[{'all':!![]}];}_0x28c89d=_[_0x674b('0x41')]({},_0x28c89d,_0x18f97f[_0x674b('0x43')]);return db['VoiceQueueReport'][_0x674b('0x4a')](_0x28c89d)[_0x674b('0x29')](handleEntityNotFound(_0x7e93ab,null))[_0x674b('0x29')](respondWithResult(_0x7e93ab,null))['catch'](handleError(_0x7e93ab,null));};exports[_0x674b('0x4b')]=function(_0x35d26e,_0x17eff2){return db[_0x674b('0x30')][_0x674b('0x4b')](_0x35d26e[_0x674b('0x4c')],{})['then'](respondWithResult(_0x17eff2,0xc9))[_0x674b('0x47')](handleError(_0x17eff2,null));};exports[_0x674b('0x28')]=function(_0x42a744,_0x28ac0e){if(_0x42a744['body']['id']){delete _0x42a744[_0x674b('0x4c')]['id'];}return db[_0x674b('0x30')]['find']({'where':{'id':_0x42a744[_0x674b('0x49')]['id']}})[_0x674b('0x29')](handleEntityNotFound(_0x28ac0e,null))[_0x674b('0x29')](saveUpdates(_0x42a744[_0x674b('0x4c')],null))[_0x674b('0x29')](respondWithResult(_0x28ac0e,null))['catch'](handleError(_0x28ac0e,null));};exports[_0x674b('0x2a')]=function(_0x239b4e,_0xfe94e1){return db[_0x674b('0x30')][_0x674b('0x4a')]({'where':{'id':_0x239b4e[_0x674b('0x49')]['id']}})[_0x674b('0x29')](handleEntityNotFound(_0xfe94e1,null))[_0x674b('0x29')](removeEntity(_0xfe94e1,null))[_0x674b('0x47')](handleError(_0xfe94e1,null));};exports[_0x674b('0x4d')]=function(_0x3ffdf4,_0x147888){return db[_0x674b('0x30')][_0x674b('0x4d')]()[_0x674b('0x29')](respondWithResult(_0x147888,null))[_0x674b('0x47')](handleError(_0x147888,null));};exports['getVoiceQueuesReport']=function(_0x19eb31,_0x1b5b68){var _0x48863b={},_0x41c94c={},_0x42cdf2={'count':0x0,'rows':[]};_0x41c94c[_0x674b('0x35')]=_['keys'](db[_0x674b('0x30')][_0x674b('0x31')]);_0x41c94c[_0x674b('0x36')]=_[_0x674b('0x37')](_0x19eb31[_0x674b('0x36')]);_0x41c94c[_0x674b('0x38')]=_['intersection'](_0x41c94c[_0x674b('0x35')],_0x41c94c[_0x674b('0x36')]);_0x48863b[_0x674b('0x3a')]=_[_0x674b('0x39')](_0x41c94c[_0x674b('0x35')],qs[_0x674b('0x3b')](_0x19eb31['query'][_0x674b('0x3b')]));_0x48863b[_0x674b('0x3a')]=_0x48863b['attributes'][_0x674b('0x3c')]?_0x48863b[_0x674b('0x3a')]:_0x41c94c[_0x674b('0x35')];if(!_0x19eb31[_0x674b('0x36')][_0x674b('0x3d')](_0x674b('0x4e'))){_0x48863b[_0x674b('0x25')]=qs[_0x674b('0x25')](_0x19eb31[_0x674b('0x36')]['limit']);_0x48863b[_0x674b('0x22')]=qs[_0x674b('0x22')](_0x19eb31[_0x674b('0x36')][_0x674b('0x22')]);}_0x48863b[_0x674b('0x4f')]=qs['sort'](_0x19eb31[_0x674b('0x36')][_0x674b('0x3e')]);_0x48863b[_0x674b('0x3f')]=qs[_0x674b('0x38')](_[_0x674b('0x50')](_0x19eb31[_0x674b('0x36')],_0x41c94c[_0x674b('0x38')]));if(_0x19eb31[_0x674b('0x36')][_0x674b('0x40')]){_0x48863b[_0x674b('0x3f')]=_['merge'](_0x48863b[_0x674b('0x3f')],{'$or':_['map'](_0x48863b[_0x674b('0x3a')],function(_0x4ada2c){var _0x34e001={};_0x34e001[_0x4ada2c]={'$like':'%'+_0x19eb31['query'][_0x674b('0x40')]+'%'};return _0x34e001;})});}_0x48863b=_['merge']({},_0x48863b,_0x19eb31[_0x674b('0x43')]);var _0x2774a6={'where':_0x48863b[_0x674b('0x3f')]};return db[_0x674b('0x30')]['count'](_0x2774a6)[_0x674b('0x29')](function(_0x5da629){_0x42cdf2[_0x674b('0x24')]=_0x5da629;if(_0x19eb31[_0x674b('0x36')][_0x674b('0x44')]){_0x48863b[_0x674b('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x674b('0x46')](_0x48863b);})[_0x674b('0x29')](function(_0x1eda68){_0x42cdf2['rows']=_0x1eda68;return _0x42cdf2;})['then'](respondWithFilteredResult(_0x1b5b68,_0x48863b,'getVoiceQueuesReport'))['catch'](handleError(_0x1b5b68,null,_0x674b('0x51')));}; \ No newline at end of file +var _0x6ee8=['where','pick','filter','merge','VIRTUAL','VoiceQueueReport','includeAll','include','rows','params','keys','rawAttributes','options','find','catch','create','body','describe','getVoiceQueuesReport','zip-dir','fast-json-patch','moment','util','sox','ejs','fs-extra','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','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','destroy','error','name','index','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x6ee8,0x103));var _0x86ee=function(_0x1a5a29,_0x512c36){_0x1a5a29=_0x1a5a29-0x0;var _0x46841e=_0x6ee8[_0x1a5a29];return _0x46841e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86ee('0x0'));var jsonpatch=require(_0x86ee('0x1'));var rp=require('request-promise');var moment=require(_0x86ee('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x86ee('0x3'));var path=require('path');var sox=require(_0x86ee('0x4'));var csv=require('to-csv');var ejs=require(_0x86ee('0x5'));var fs=require('fs');var fs_extra=require(_0x86ee('0x6'));var _=require(_0x86ee('0x7'));var squel=require(_0x86ee('0x8'));var crypto=require(_0x86ee('0x9'));var jsforce=require(_0x86ee('0xa'));var deskjs=require(_0x86ee('0xb'));var toCsv=require(_0x86ee('0xc'));var querystring=require(_0x86ee('0xd'));var Papa=require('papaparse');var Redis=require(_0x86ee('0xe'));var authService=require(_0x86ee('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x86ee('0x10'));var hardwareService=require(_0x86ee('0x11'));var logger=require(_0x86ee('0x12'))(_0x86ee('0x13'));var utils=require(_0x86ee('0x14'));var config=require(_0x86ee('0x15'));var licenseUtil=require(_0x86ee('0x16'));var db=require(_0x86ee('0x17'))['db'];config['redis']=_[_0x86ee('0x18')](config[_0x86ee('0x19')],{'host':_0x86ee('0x1a'),'port':0x18eb});var socket=require(_0x86ee('0x1b'))(new Redis(config[_0x86ee('0x19')]));require(_0x86ee('0x1c'))[_0x86ee('0x1d')](socket);function respondWithStatusCode(_0x1dd87d,_0x4f98f7){_0x4f98f7=_0x4f98f7||0xcc;return function(_0x31449b){if(_0x31449b){return _0x1dd87d[_0x86ee('0x1e')](_0x4f98f7);}return _0x1dd87d[_0x86ee('0x1f')](_0x4f98f7)[_0x86ee('0x20')]();};}function respondWithResult(_0x41f376,_0x828582){_0x828582=_0x828582||0xc8;return function(_0x283f2a){if(_0x283f2a){return _0x41f376['status'](_0x828582)[_0x86ee('0x21')](_0x283f2a);}};}function respondWithFilteredResult(_0x374d98,_0x145fd4){return function(_0x1886ff){if(_0x1886ff){var _0x4b0640=typeof _0x145fd4[_0x86ee('0x22')]==='undefined'&&typeof _0x145fd4[_0x86ee('0x23')]==='undefined';var _0x79bd31=_0x1886ff['count'];var _0x21822f=_0x4b0640?0x0:_0x145fd4['offset'];var _0x1a835b=_0x4b0640?_0x1886ff[_0x86ee('0x24')]:_0x145fd4[_0x86ee('0x22')]+_0x145fd4[_0x86ee('0x23')];var _0x351192;if(_0x1a835b>=_0x79bd31){_0x1a835b=_0x79bd31;_0x351192=0xc8;}else{_0x351192=0xce;}_0x374d98[_0x86ee('0x1f')](_0x351192);return _0x374d98[_0x86ee('0x25')]('Content-Range',_0x21822f+'-'+_0x1a835b+'/'+_0x79bd31)[_0x86ee('0x21')](_0x1886ff);}return null;};}function patchUpdates(_0x261225){return function(_0x52528d){try{jsonpatch[_0x86ee('0x26')](_0x52528d,_0x261225,!![]);}catch(_0xf853d4){return BPromise['reject'](_0xf853d4);}return _0x52528d[_0x86ee('0x27')]();};}function saveUpdates(_0x2dc478,_0x7d5fb9){return function(_0x446c32){if(_0x446c32){return _0x446c32[_0x86ee('0x28')](_0x2dc478)[_0x86ee('0x29')](function(_0x7629b9){return _0x7629b9;});}return null;};}function removeEntity(_0x4d0495,_0xfc157){return function(_0x7eb5d8){if(_0x7eb5d8){return _0x7eb5d8[_0x86ee('0x2a')]()[_0x86ee('0x29')](function(){_0x4d0495[_0x86ee('0x1f')](0xcc)[_0x86ee('0x20')]();});}};}function handleEntityNotFound(_0x19629a,_0x352fa5){return function(_0x1f915b){if(!_0x1f915b){_0x19629a['sendStatus'](0x194);}return _0x1f915b;};}function handleError(_0x4ba83e,_0x226963){_0x226963=_0x226963||0x1f4;return function(_0x466ff8){logger[_0x86ee('0x2b')](_0x466ff8['stack']);if(_0x466ff8['name']){delete _0x466ff8[_0x86ee('0x2c')];}_0x4ba83e['status'](_0x226963)['send'](_0x466ff8);};}exports[_0x86ee('0x2d')]=function(_0x1f3f23,_0x302798){var _0x3ebf65={},_0x86c6d9={},_0x2f76ce={'count':0x0,'rows':[]};var _0x145932=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0x546f50){return{'name':_0x546f50[_0x86ee('0x2e')],'type':_0x546f50[_0x86ee('0x2f')][_0x86ee('0x30')]};});_0x86c6d9['model']=_[_0x86ee('0x31')](_0x145932,_0x86ee('0x2c'));_0x86c6d9[_0x86ee('0x32')]=_['keys'](_0x1f3f23[_0x86ee('0x32')]);_0x86c6d9[_0x86ee('0x33')]=_[_0x86ee('0x34')](_0x86c6d9['model'],_0x86c6d9['query']);_0x3ebf65['attributes']=_[_0x86ee('0x34')](_0x86c6d9[_0x86ee('0x35')],qs[_0x86ee('0x36')](_0x1f3f23[_0x86ee('0x32')][_0x86ee('0x36')]));_0x3ebf65[_0x86ee('0x37')]=_0x3ebf65[_0x86ee('0x37')][_0x86ee('0x38')]?_0x3ebf65['attributes']:_0x86c6d9[_0x86ee('0x35')];if(!_0x1f3f23['query'][_0x86ee('0x39')](_0x86ee('0x3a'))){_0x3ebf65['limit']=qs[_0x86ee('0x23')](_0x1f3f23['query'][_0x86ee('0x23')]);_0x3ebf65[_0x86ee('0x22')]=qs['offset'](_0x1f3f23[_0x86ee('0x32')][_0x86ee('0x22')]);}_0x3ebf65[_0x86ee('0x3b')]=qs[_0x86ee('0x3c')](_0x1f3f23[_0x86ee('0x32')][_0x86ee('0x3c')]);_0x3ebf65[_0x86ee('0x3d')]=qs[_0x86ee('0x33')](_[_0x86ee('0x3e')](_0x1f3f23[_0x86ee('0x32')],_0x86c6d9[_0x86ee('0x33')]),_0x145932);if(_0x1f3f23['query'][_0x86ee('0x3f')]){_0x3ebf65[_0x86ee('0x3d')]=_[_0x86ee('0x40')](_0x3ebf65[_0x86ee('0x3d')],{'$or':_[_0x86ee('0x31')](_0x145932,function(_0xac2004){if(_0xac2004[_0x86ee('0x2f')]!==_0x86ee('0x41')){var _0x810b5b={};_0x810b5b[_0xac2004[_0x86ee('0x2c')]]={'$like':'%'+_0x1f3f23[_0x86ee('0x32')][_0x86ee('0x3f')]+'%'};return _0x810b5b;}})});}_0x3ebf65=_[_0x86ee('0x40')]({},_0x3ebf65,_0x1f3f23['options']);var _0x850cd7={'where':_0x3ebf65[_0x86ee('0x3d')]};return db[_0x86ee('0x42')][_0x86ee('0x24')](_0x850cd7)['then'](function(_0x3f047f){_0x2f76ce[_0x86ee('0x24')]=_0x3f047f;if(_0x1f3f23[_0x86ee('0x32')][_0x86ee('0x43')]){_0x3ebf65[_0x86ee('0x44')]=[{'all':!![]}];}return db[_0x86ee('0x42')]['findAll'](_0x3ebf65);})[_0x86ee('0x29')](function(_0x26b1a5){_0x2f76ce[_0x86ee('0x45')]=_0x26b1a5;return _0x2f76ce;})['then'](respondWithFilteredResult(_0x302798,_0x3ebf65))['catch'](handleError(_0x302798,null));};exports['show']=function(_0x45b73f,_0x478238){var _0x4330bc={'raw':![],'where':{'id':_0x45b73f[_0x86ee('0x46')]['id']}},_0x5429af={};_0x5429af[_0x86ee('0x35')]=_[_0x86ee('0x47')](db['VoiceQueueReport'][_0x86ee('0x48')]);_0x5429af[_0x86ee('0x32')]=_[_0x86ee('0x47')](_0x45b73f[_0x86ee('0x32')]);_0x5429af['filters']=_[_0x86ee('0x34')](_0x5429af[_0x86ee('0x35')],_0x5429af[_0x86ee('0x32')]);_0x4330bc[_0x86ee('0x37')]=_[_0x86ee('0x34')](_0x5429af[_0x86ee('0x35')],qs[_0x86ee('0x36')](_0x45b73f[_0x86ee('0x32')][_0x86ee('0x36')]));_0x4330bc[_0x86ee('0x37')]=_0x4330bc[_0x86ee('0x37')]['length']?_0x4330bc[_0x86ee('0x37')]:_0x5429af[_0x86ee('0x35')];if(_0x45b73f[_0x86ee('0x32')][_0x86ee('0x43')]){_0x4330bc['include']=[{'all':!![]}];}_0x4330bc=_[_0x86ee('0x40')]({},_0x4330bc,_0x45b73f[_0x86ee('0x49')]);return db[_0x86ee('0x42')][_0x86ee('0x4a')](_0x4330bc)[_0x86ee('0x29')](handleEntityNotFound(_0x478238,null))[_0x86ee('0x29')](respondWithResult(_0x478238,null))[_0x86ee('0x4b')](handleError(_0x478238,null));};exports[_0x86ee('0x4c')]=function(_0x315204,_0x9c3e0f){return db[_0x86ee('0x42')][_0x86ee('0x4c')](_0x315204['body'],{})[_0x86ee('0x29')](respondWithResult(_0x9c3e0f,0xc9))[_0x86ee('0x4b')](handleError(_0x9c3e0f,null));};exports[_0x86ee('0x28')]=function(_0x2307b2,_0x5dca27){if(_0x2307b2[_0x86ee('0x4d')]['id']){delete _0x2307b2[_0x86ee('0x4d')]['id'];}return db['VoiceQueueReport'][_0x86ee('0x4a')]({'where':{'id':_0x2307b2[_0x86ee('0x46')]['id']}})[_0x86ee('0x29')](handleEntityNotFound(_0x5dca27,null))[_0x86ee('0x29')](saveUpdates(_0x2307b2['body'],null))['then'](respondWithResult(_0x5dca27,null))['catch'](handleError(_0x5dca27,null));};exports[_0x86ee('0x2a')]=function(_0x5727a0,_0x175c91){return db[_0x86ee('0x42')][_0x86ee('0x4a')]({'where':{'id':_0x5727a0[_0x86ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x175c91,null))['then'](removeEntity(_0x175c91,null))[_0x86ee('0x4b')](handleError(_0x175c91,null));};exports[_0x86ee('0x4e')]=function(_0x256d1b,_0x77869f){return db[_0x86ee('0x42')][_0x86ee('0x4e')]()['then'](respondWithResult(_0x77869f,null))[_0x86ee('0x4b')](handleError(_0x77869f,null));};exports[_0x86ee('0x4f')]=function(_0x5735c0,_0xadbe6d){var _0x1dccaf={},_0x354dbc={},_0x2890d9={'count':0x0,'rows':[]};_0x354dbc[_0x86ee('0x35')]=_['keys'](db[_0x86ee('0x42')][_0x86ee('0x48')]);_0x354dbc[_0x86ee('0x32')]=_['keys'](_0x5735c0['query']);_0x354dbc[_0x86ee('0x33')]=_[_0x86ee('0x34')](_0x354dbc[_0x86ee('0x35')],_0x354dbc[_0x86ee('0x32')]);_0x1dccaf['attributes']=_[_0x86ee('0x34')](_0x354dbc[_0x86ee('0x35')],qs[_0x86ee('0x36')](_0x5735c0[_0x86ee('0x32')]['fields']));_0x1dccaf[_0x86ee('0x37')]=_0x1dccaf[_0x86ee('0x37')][_0x86ee('0x38')]?_0x1dccaf['attributes']:_0x354dbc[_0x86ee('0x35')];if(!_0x5735c0[_0x86ee('0x32')][_0x86ee('0x39')](_0x86ee('0x3a'))){_0x1dccaf[_0x86ee('0x23')]=qs[_0x86ee('0x23')](_0x5735c0['query'][_0x86ee('0x23')]);_0x1dccaf[_0x86ee('0x22')]=qs[_0x86ee('0x22')](_0x5735c0[_0x86ee('0x32')][_0x86ee('0x22')]);}_0x1dccaf[_0x86ee('0x3b')]=qs['sort'](_0x5735c0[_0x86ee('0x32')][_0x86ee('0x3c')]);_0x1dccaf[_0x86ee('0x3d')]=qs[_0x86ee('0x33')](_['pick'](_0x5735c0['query'],_0x354dbc[_0x86ee('0x33')]));if(_0x5735c0[_0x86ee('0x32')][_0x86ee('0x3f')]){_0x1dccaf['where']=_[_0x86ee('0x40')](_0x1dccaf[_0x86ee('0x3d')],{'$or':_[_0x86ee('0x31')](_0x1dccaf['attributes'],function(_0x44e344){var _0x2dea15={};_0x2dea15[_0x44e344]={'$like':'%'+_0x5735c0[_0x86ee('0x32')][_0x86ee('0x3f')]+'%'};return _0x2dea15;})});}_0x1dccaf=_[_0x86ee('0x40')]({},_0x1dccaf,_0x5735c0[_0x86ee('0x49')]);var _0x50471e={'where':_0x1dccaf[_0x86ee('0x3d')]};return db['VoiceQueueReport'][_0x86ee('0x24')](_0x50471e)[_0x86ee('0x29')](function(_0x2f7474){_0x2890d9[_0x86ee('0x24')]=_0x2f7474;if(_0x5735c0[_0x86ee('0x32')][_0x86ee('0x43')]){_0x1dccaf['include']=[{'all':!![]}];}return db[_0x86ee('0x42')]['findAll'](_0x1dccaf);})[_0x86ee('0x29')](function(_0x5e3d3e){_0x2890d9[_0x86ee('0x45')]=_0x5e3d3e;return _0x2890d9;})[_0x86ee('0x29')](respondWithFilteredResult(_0xadbe6d,_0x1dccaf,_0x86ee('0x4f')))[_0x86ee('0x4b')](handleError(_0xadbe6d,null,_0x86ee('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 4cfbdda..a667ca1 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 _0xc7d3=['hasOwnProperty','hook','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit'];(function(_0x5026b4,_0x5b0b75){var _0x58188e=function(_0x28d901){while(--_0x28d901){_0x5026b4['push'](_0x5026b4['shift']());}};_0x58188e(++_0x5b0b75);}(_0xc7d3,0xaa));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x3c7d('0x0'))['db'][_0x3c7d('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x3c7d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c7d('0x3'),'afterDestroy':_0x3c7d('0x4')};function emitEvent(_0x1de0a7){return function(_0xe69c20,_0x11d852,_0x47876d){VoiceQueueReportEvents[_0x3c7d('0x5')](_0x1de0a7+':'+_0xe69c20['id'],_0xe69c20);VoiceQueueReportEvents[_0x3c7d('0x5')](_0x1de0a7,_0xe69c20);_0x47876d(null);};}for(var e in events){if(events[_0x3c7d('0x6')](e)){var event=events[e];VoiceQueueReport[_0x3c7d('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x14fa=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x375538,_0x503fae){var _0x115b09=function(_0x3e05b6){while(--_0x3e05b6){_0x375538['push'](_0x375538['shift']());}};_0x115b09(++_0x503fae);}(_0x14fa,0xf1));var _0xa14f=function(_0x59026b,_0x12ace5){_0x59026b=_0x59026b-0x0;var _0x2c6152=_0x14fa[_0x59026b];return _0x2c6152;};'use strict';var EventEmitter=require(_0xa14f('0x0'));var VoiceQueueReport=require(_0xa14f('0x1'))['db'][_0xa14f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa14f('0x3')](0x0);var events={'afterCreate':_0xa14f('0x4'),'afterUpdate':_0xa14f('0x5'),'afterDestroy':_0xa14f('0x6')};function emitEvent(_0x57e76a){return function(_0x3f3b56,_0x560263,_0x2fd844){VoiceQueueReportEvents['emit'](_0x57e76a+':'+_0x3f3b56['id'],_0x3f3b56);VoiceQueueReportEvents[_0xa14f('0x7')](_0x57e76a,_0x3f3b56);_0x2fd844(null);};}for(var e in events){if(events[_0xa14f('0x8')](e)){var event=events[e];VoiceQueueReport[_0xa14f('0x9')](e,emitEvent(event));}}module[_0xa14f('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index f3fa793..5772800 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 _0x3f30=['exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x3f30,0x127));var _0x03f3=function(_0xe9b119,_0x3069f4){_0xe9b119=_0xe9b119-0x0;var _0x3a6593=_0x3f30[_0xe9b119];return _0x3a6593;};'use strict';var _=require(_0x03f3('0x0'));var util=require(_0x03f3('0x1'));var logger=require(_0x03f3('0x2'))(_0x03f3('0x3'));var moment=require(_0x03f3('0x4'));var BPromise=require(_0x03f3('0x5'));var rp=require(_0x03f3('0x6'));var fs=require('fs');var path=require(_0x03f3('0x7'));var rimraf=require(_0x03f3('0x8'));var config=require(_0x03f3('0x9'));var attributes=require(_0x03f3('0xa'));module[_0x03f3('0xb')]=function(_0x573646,_0x5f1708){return _0x573646[_0x03f3('0xc')](_0x03f3('0xd'),attributes,{'tableName':_0x03f3('0xe'),'paranoid':![],'indexes':[{'fields':[_0x03f3('0xf')]},{'fields':[_0x03f3('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe44b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util'];(function(_0x337651,_0x2af690){var _0x20893c=function(_0x545dcd){while(--_0x545dcd){_0x337651['push'](_0x337651['shift']());}};_0x20893c(++_0x2af690);}(_0xe44b,0x109));var _0xbe44=function(_0x26a72b,_0x4df8d8){_0x26a72b=_0x26a72b-0x0;var _0x5aa4af=_0xe44b[_0x26a72b];return _0x5aa4af;};'use strict';var _=require('lodash');var util=require(_0xbe44('0x0'));var logger=require(_0xbe44('0x1'))(_0xbe44('0x2'));var moment=require(_0xbe44('0x3'));var BPromise=require(_0xbe44('0x4'));var rp=require(_0xbe44('0x5'));var fs=require('fs');var path=require(_0xbe44('0x6'));var rimraf=require(_0xbe44('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xbe44('0x8')]=function(_0x5a707f,_0x4c9d02){return _0x5a707f[_0xbe44('0x9')](_0xbe44('0xa'),attributes,{'tableName':_0xbe44('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbe44('0xc')]},{'fields':[_0xbe44('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 8b5b39d..bd2bd57 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 _0x1e8e=['raw','where','attributes','limit','include','map','model','then','GetVoiceQueueReport','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','VoiceQueueReport','findAll','options'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1e8e,0x17d));var _0xe1e8=function(_0x3f8c6b,_0x52c11c){_0x3f8c6b=_0x3f8c6b-0x0;var _0x20f990=_0x1e8e[_0x3f8c6b];return _0x20f990;};'use strict';var _=require(_0xe1e8('0x0'));var util=require(_0xe1e8('0x1'));var moment=require('moment');var BPromise=require(_0xe1e8('0x2'));var rs=require(_0xe1e8('0x3'));var fs=require('fs');var Redis=require(_0xe1e8('0x4'));var db=require(_0xe1e8('0x5'))['db'];var utils=require(_0xe1e8('0x6'));var logger=require('../../config/logger')(_0xe1e8('0x7'));var config=require(_0xe1e8('0x8'));var jayson=require(_0xe1e8('0x9'));var client=jayson[_0xe1e8('0xa')][_0xe1e8('0xb')]({'port':0x232a});config[_0xe1e8('0xc')]=_[_0xe1e8('0xd')](config[_0xe1e8('0xc')],{'host':_0xe1e8('0xe'),'port':0x18eb});var socket=require(_0xe1e8('0xf'))(new Redis(config['redis']));require(_0xe1e8('0x10'))[_0xe1e8('0x11')](socket);function respondWithRpcPromise(_0xde4a1a,_0xbd55a1,_0x1bd6b3){return new BPromise(function(_0x1ad03f,_0x481d25){return client[_0xe1e8('0x12')](_0xde4a1a,_0x1bd6b3)['then'](function(_0x38cede){logger['info'](_0xe1e8('0x13'),_0xbd55a1,_0xe1e8('0x14'));logger[_0xe1e8('0x15')](_0xe1e8('0x16'),_0xbd55a1,'request\x20sent',JSON[_0xe1e8('0x17')](_0x38cede));if(_0x38cede[_0xe1e8('0x18')]){if(_0x38cede['error'][_0xe1e8('0x19')]===0x1f4){logger[_0xe1e8('0x18')](_0xe1e8('0x13'),_0xbd55a1,_0x38cede[_0xe1e8('0x18')][_0xe1e8('0x1a')]);return _0x481d25(_0x38cede[_0xe1e8('0x18')]['message']);}logger[_0xe1e8('0x18')](_0xe1e8('0x13'),_0xbd55a1,_0x38cede[_0xe1e8('0x18')]['message']);return _0x1ad03f(_0x38cede[_0xe1e8('0x18')][_0xe1e8('0x1a')]);}else{logger[_0xe1e8('0x1b')]('VoiceQueueReport,\x20%s,\x20%s',_0xbd55a1,_0xe1e8('0x14'));_0x1ad03f(_0x38cede[_0xe1e8('0x1c')][_0xe1e8('0x1a')]);}})[_0xe1e8('0x1d')](function(_0x4befb1){logger[_0xe1e8('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0xbd55a1,_0x4befb1);_0x481d25(_0x4befb1);});});}exports['GetVoiceQueueReport']=function(_0x5b5d5b){var _0x4ba7b1=this;return new Promise(function(_0x58d52d,_0x29828e){return db[_0xe1e8('0x1e')][_0xe1e8('0x1f')]({'raw':_0x5b5d5b['options']?_0x5b5d5b[_0xe1e8('0x20')][_0xe1e8('0x21')]===undefined?!![]:![]:!![],'where':_0x5b5d5b[_0xe1e8('0x20')]?_0x5b5d5b['options'][_0xe1e8('0x22')]||null:null,'attributes':_0x5b5d5b[_0xe1e8('0x20')]?_0x5b5d5b[_0xe1e8('0x20')][_0xe1e8('0x23')]||null:null,'limit':_0x5b5d5b[_0xe1e8('0x20')]?_0x5b5d5b[_0xe1e8('0x20')][_0xe1e8('0x24')]||null:null,'include':_0x5b5d5b[_0xe1e8('0x20')]?_0x5b5d5b[_0xe1e8('0x20')][_0xe1e8('0x25')]?_[_0xe1e8('0x26')](_0x5b5d5b[_0xe1e8('0x20')]['include'],function(_0x5e0eab){return{'model':db[_0x5e0eab['model']],'as':_0x5e0eab['as'],'attributes':_0x5e0eab[_0xe1e8('0x23')],'include':_0x5e0eab[_0xe1e8('0x25')]?_['map'](_0x5e0eab[_0xe1e8('0x25')],function(_0x407069){return{'model':db[_0x407069[_0xe1e8('0x27')]],'as':_0x407069['as'],'attributes':_0x407069['attributes'],'include':_0x407069[_0xe1e8('0x25')]?_[_0xe1e8('0x26')](_0x407069['include'],function(_0x1a016f){return{'model':db[_0x1a016f['model']],'as':_0x1a016f['as'],'attributes':_0x1a016f['attributes']};}):[]};}):[]};}):[]:[]})[_0xe1e8('0x28')](function(_0x3b13df){logger['info'](_0xe1e8('0x29'),_0x5b5d5b);logger['debug'](_0xe1e8('0x29'),_0x5b5d5b,JSON[_0xe1e8('0x17')](_0x3b13df));_0x58d52d(_0x3b13df);})['catch'](function(_0x5cc7fa){logger[_0xe1e8('0x18')](_0xe1e8('0x29'),_0x5cc7fa[_0xe1e8('0x1a')],_0x5b5d5b);_0x29828e(_0x4ba7b1[_0xe1e8('0x18')](0x1f4,_0x5cc7fa[_0xe1e8('0x1a')]));});});};exports[_0xe1e8('0x2a')]=function(_0x1451f6){var _0x48e5e5=this;return new Promise(function(_0x14a940,_0x4a80f5){return db[_0xe1e8('0x1e')]['create'](_0x1451f6[_0xe1e8('0x2b')],{'raw':_0x1451f6[_0xe1e8('0x20')]?_0x1451f6[_0xe1e8('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xe1e8('0x28')](function(_0x1a7a95){logger[_0xe1e8('0x1b')](_0xe1e8('0x2a'),_0x1451f6);logger[_0xe1e8('0x15')]('CreateVoiceQueueReport',_0x1451f6,JSON[_0xe1e8('0x17')](_0x1a7a95));_0x14a940(_0x1a7a95);})[_0xe1e8('0x1d')](function(_0x19f03d){logger[_0xe1e8('0x18')]('CreateVoiceQueueReport',_0x19f03d[_0xe1e8('0x1a')],_0x1451f6);_0x4a80f5(_0x48e5e5[_0xe1e8('0x18')](0x1f4,_0x19f03d[_0xe1e8('0x1a')]));});});};exports[_0xe1e8('0x2c')]=function(_0x429a1d){var _0x22b1fc=this;return new Promise(function(_0x299084,_0x3837fc){return db[_0xe1e8('0x1e')][_0xe1e8('0x2d')](_0x429a1d['body'],{'raw':_0x429a1d['options']?_0x429a1d[_0xe1e8('0x20')][_0xe1e8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x429a1d['options']?_0x429a1d[_0xe1e8('0x20')][_0xe1e8('0x22')]||null:null,'attributes':_0x429a1d[_0xe1e8('0x20')]?_0x429a1d[_0xe1e8('0x20')][_0xe1e8('0x23')]||null:null,'limit':_0x429a1d['options']?_0x429a1d[_0xe1e8('0x20')]['limit']||null:null})[_0xe1e8('0x28')](function(_0x1680be){logger[_0xe1e8('0x1b')](_0xe1e8('0x2c'),_0x429a1d);logger[_0xe1e8('0x15')](_0xe1e8('0x2c'),_0x429a1d,JSON[_0xe1e8('0x17')](_0x1680be));_0x299084(_0x1680be);})[_0xe1e8('0x1d')](function(_0x535ed2){logger[_0xe1e8('0x18')]('UpdateVoiceQueueReport',_0x535ed2['message'],_0x429a1d);_0x3837fc(_0x22b1fc[_0xe1e8('0x18')](0x1f4,_0x535ed2[_0xe1e8('0x1a')]));});});}; \ No newline at end of file +var _0x7b45=['socket.io-emitter','./voiceQueueReport.socket','request','then','info','request\x20sent','stringify','code','error','VoiceQueueReport,\x20%s,\x20%s','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','map','include','model','debug','CreateVoiceQueueReport','raw','update','body','where','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost'];(function(_0x3f8d05,_0x5301a2){var _0x1b38c7=function(_0xda323b){while(--_0xda323b){_0x3f8d05['push'](_0x3f8d05['shift']());}};_0x1b38c7(++_0x5301a2);}(_0x7b45,0xf3));var _0x57b4=function(_0x4bf52d,_0x2f6d7f){_0x4bf52d=_0x4bf52d-0x0;var _0x22854f=_0x7b45[_0x4bf52d];return _0x22854f;};'use strict';var _=require(_0x57b4('0x0'));var util=require(_0x57b4('0x1'));var moment=require(_0x57b4('0x2'));var BPromise=require(_0x57b4('0x3'));var rs=require(_0x57b4('0x4'));var fs=require('fs');var Redis=require(_0x57b4('0x5'));var db=require(_0x57b4('0x6'))['db'];var utils=require(_0x57b4('0x7'));var logger=require(_0x57b4('0x8'))('rpc');var config=require(_0x57b4('0x9'));var jayson=require(_0x57b4('0xa'));var client=jayson[_0x57b4('0xb')]['http']({'port':0x232a});config['redis']=_[_0x57b4('0xc')](config[_0x57b4('0xd')],{'host':_0x57b4('0xe'),'port':0x18eb});var socket=require(_0x57b4('0xf'))(new Redis(config[_0x57b4('0xd')]));require(_0x57b4('0x10'))['register'](socket);function respondWithRpcPromise(_0x2d30e2,_0xfc00eb,_0x45478c){return new BPromise(function(_0x11b438,_0x1fa2da){return client[_0x57b4('0x11')](_0x2d30e2,_0x45478c)[_0x57b4('0x12')](function(_0x144694){logger[_0x57b4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xfc00eb,_0x57b4('0x14'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xfc00eb,_0x57b4('0x14'),JSON[_0x57b4('0x15')](_0x144694));if(_0x144694['error']){if(_0x144694['error'][_0x57b4('0x16')]===0x1f4){logger[_0x57b4('0x17')](_0x57b4('0x18'),_0xfc00eb,_0x144694['error'][_0x57b4('0x19')]);return _0x1fa2da(_0x144694[_0x57b4('0x17')][_0x57b4('0x19')]);}logger[_0x57b4('0x17')](_0x57b4('0x18'),_0xfc00eb,_0x144694[_0x57b4('0x17')][_0x57b4('0x19')]);return _0x11b438(_0x144694[_0x57b4('0x17')][_0x57b4('0x19')]);}else{logger[_0x57b4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xfc00eb,_0x57b4('0x14'));_0x11b438(_0x144694['result'][_0x57b4('0x19')]);}})[_0x57b4('0x1a')](function(_0x19753d){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0xfc00eb,_0x19753d);_0x1fa2da(_0x19753d);});});}exports[_0x57b4('0x1b')]=function(_0x3a8b90){var _0x49f645=this;return new Promise(function(_0xca30c1,_0xf15b2c){return db[_0x57b4('0x1c')][_0x57b4('0x1d')]({'raw':_0x3a8b90[_0x57b4('0x1e')]?_0x3a8b90[_0x57b4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3a8b90[_0x57b4('0x1e')]?_0x3a8b90[_0x57b4('0x1e')]['where']||null:null,'attributes':_0x3a8b90['options']?_0x3a8b90[_0x57b4('0x1e')][_0x57b4('0x1f')]||null:null,'limit':_0x3a8b90[_0x57b4('0x1e')]?_0x3a8b90[_0x57b4('0x1e')][_0x57b4('0x20')]||null:null,'include':_0x3a8b90['options']?_0x3a8b90[_0x57b4('0x1e')]['include']?_[_0x57b4('0x21')](_0x3a8b90[_0x57b4('0x1e')][_0x57b4('0x22')],function(_0x2eadf0){return{'model':db[_0x2eadf0[_0x57b4('0x23')]],'as':_0x2eadf0['as'],'attributes':_0x2eadf0['attributes'],'include':_0x2eadf0['include']?_[_0x57b4('0x21')](_0x2eadf0[_0x57b4('0x22')],function(_0x4937f9){return{'model':db[_0x4937f9[_0x57b4('0x23')]],'as':_0x4937f9['as'],'attributes':_0x4937f9[_0x57b4('0x1f')],'include':_0x4937f9[_0x57b4('0x22')]?_[_0x57b4('0x21')](_0x4937f9[_0x57b4('0x22')],function(_0x5cb865){return{'model':db[_0x5cb865[_0x57b4('0x23')]],'as':_0x5cb865['as'],'attributes':_0x5cb865[_0x57b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x57b4('0x12')](function(_0x522e81){logger['info'](_0x57b4('0x1b'),_0x3a8b90);logger[_0x57b4('0x24')]('GetVoiceQueueReport',_0x3a8b90,JSON[_0x57b4('0x15')](_0x522e81));_0xca30c1(_0x522e81);})[_0x57b4('0x1a')](function(_0x5b5cb4){logger[_0x57b4('0x17')](_0x57b4('0x1b'),_0x5b5cb4[_0x57b4('0x19')],_0x3a8b90);_0xf15b2c(_0x49f645[_0x57b4('0x17')](0x1f4,_0x5b5cb4[_0x57b4('0x19')]));});});};exports[_0x57b4('0x25')]=function(_0x3a2198){var _0x2ba38f=this;return new Promise(function(_0x3ce21d,_0xc7e0ef){return db[_0x57b4('0x1c')]['create'](_0x3a2198['body'],{'raw':_0x3a2198[_0x57b4('0x1e')]?_0x3a2198[_0x57b4('0x1e')][_0x57b4('0x26')]===undefined?!![]:![]:!![]})[_0x57b4('0x12')](function(_0x2b86f1){logger[_0x57b4('0x13')](_0x57b4('0x25'),_0x3a2198);logger['debug'](_0x57b4('0x25'),_0x3a2198,JSON['stringify'](_0x2b86f1));_0x3ce21d(_0x2b86f1);})[_0x57b4('0x1a')](function(_0x55d962){logger['error']('CreateVoiceQueueReport',_0x55d962['message'],_0x3a2198);_0xc7e0ef(_0x2ba38f[_0x57b4('0x17')](0x1f4,_0x55d962['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2414d6){var _0x1b846b=this;return new Promise(function(_0x3960db,_0x30903b){return db[_0x57b4('0x1c')][_0x57b4('0x27')](_0x2414d6[_0x57b4('0x28')],{'raw':_0x2414d6[_0x57b4('0x1e')]?_0x2414d6[_0x57b4('0x1e')][_0x57b4('0x26')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2414d6[_0x57b4('0x1e')]?_0x2414d6[_0x57b4('0x1e')][_0x57b4('0x29')]||null:null,'attributes':_0x2414d6['options']?_0x2414d6[_0x57b4('0x1e')][_0x57b4('0x1f')]||null:null,'limit':_0x2414d6[_0x57b4('0x1e')]?_0x2414d6[_0x57b4('0x1e')]['limit']||null:null})[_0x57b4('0x12')](function(_0x2542f1){logger[_0x57b4('0x13')]('UpdateVoiceQueueReport',_0x2414d6);logger[_0x57b4('0x24')]('UpdateVoiceQueueReport',_0x2414d6,JSON[_0x57b4('0x15')](_0x2542f1));_0x3960db(_0x2542f1);})[_0x57b4('0x1a')](function(_0x1b2f06){logger[_0x57b4('0x17')](_0x57b4('0x2a'),_0x1b2f06[_0x57b4('0x19')],_0x2414d6);_0x30903b(_0x1b846b['error'](0x1f4,_0x1b2f06['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 1d53e1e..1328e74 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 _0x036b=['removeListener','register','length','./voiceQueueReport.events','save','remove','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x036b,0x145));var _0xb036=function(_0x43506e,_0x671bd7){_0x43506e=_0x43506e-0x0;var _0x88dd16=_0x036b[_0x43506e];return _0x88dd16;};'use strict';var VoiceQueueReportEvents=require(_0xb036('0x0'));var events=[_0xb036('0x1'),_0xb036('0x2'),'update'];function createListener(_0x38abd5,_0x2ed0cc){return function(_0x3a7dbe){_0x2ed0cc[_0xb036('0x3')](_0x38abd5,_0x3a7dbe);};}function removeListener(_0x392829,_0x523abc){return function(){VoiceQueueReportEvents[_0xb036('0x4')](_0x392829,_0x523abc);};}exports[_0xb036('0x5')]=function(_0x166b1d){for(var _0x1bb536=0x0,_0x1d495e=events[_0xb036('0x6')];_0x1bb536<_0x1d495e;_0x1bb536++){var _0x5bbb44=events[_0x1bb536];var _0x465d7d=createListener('voiceQueueReport:'+_0x5bbb44,_0x166b1d);VoiceQueueReportEvents['on'](_0x5bbb44,_0x465d7d);}}; \ No newline at end of file +var _0xb016=['update','removeListener','register','./voiceQueueReport.events','save','remove'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb016,0x129));var _0x6b01=function(_0xfd9713,_0x552bf){_0xfd9713=_0xfd9713-0x0;var _0x54489f=_0xb016[_0xfd9713];return _0x54489f;};'use strict';var VoiceQueueReportEvents=require(_0x6b01('0x0'));var events=[_0x6b01('0x1'),_0x6b01('0x2'),_0x6b01('0x3')];function createListener(_0x393377,_0x37b780){return function(_0x3a5b64){_0x37b780['emit'](_0x393377,_0x3a5b64);};}function removeListener(_0x8e8d19,_0x31db10){return function(){VoiceQueueReportEvents[_0x6b01('0x4')](_0x8e8d19,_0x31db10);};}exports[_0x6b01('0x5')]=function(_0x7bc7b1){for(var _0xe5c773=0x0,_0x4069a6=events['length'];_0xe5c773<_0x4069a6;_0xe5c773++){var _0x398a77=events[_0xe5c773];var _0x37875c=createListener('voiceQueueReport:'+_0x398a77,_0x7bc7b1);VoiceQueueReportEvents['on'](_0x398a77,_0x37875c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 111ea23..d866f60 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 _0x2bf4=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2bf4,0x193));var _0x42bf=function(_0x1f7a83,_0x409f6a){_0x1f7a83=_0x1f7a83-0x0;var _0x29e1be=_0x2bf4[_0x1f7a83];return _0x29e1be;};'use strict';var multer=require(_0x42bf('0x0'));var util=require(_0x42bf('0x1'));var path=require(_0x42bf('0x2'));var timeout=require(_0x42bf('0x3'));var express=require(_0x42bf('0x4'));var router=express[_0x42bf('0x5')]();var fs_extra=require(_0x42bf('0x6'));var auth=require(_0x42bf('0x7'));var interaction=require(_0x42bf('0x8'));var config=require('../../config/environment');var controller=require(_0x42bf('0x9'));router['get']('/',auth[_0x42bf('0xa')](),controller['index']);router[_0x42bf('0xb')](_0x42bf('0xc'),auth[_0x42bf('0xa')](),controller[_0x42bf('0xd')]);router[_0x42bf('0xe')]('/',auth[_0x42bf('0xa')](),controller['create']);router[_0x42bf('0xf')](_0x42bf('0xc'),auth[_0x42bf('0xa')](),controller[_0x42bf('0x10')]);router['delete']('/:id',auth[_0x42bf('0xa')](),controller[_0x42bf('0x11')]);module[_0x42bf('0x12')]=router; \ No newline at end of file +var _0xd332=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','path','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd332,0xaf));var _0x2d33=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd332[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x2d33('0x0'));var path=require(_0x2d33('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d33('0x2'));var router=express[_0x2d33('0x3')]();var fs_extra=require(_0x2d33('0x4'));var auth=require(_0x2d33('0x5'));var interaction=require(_0x2d33('0x6'));var config=require(_0x2d33('0x7'));var controller=require(_0x2d33('0x8'));router[_0x2d33('0x9')]('/',auth[_0x2d33('0xa')](),controller[_0x2d33('0xb')]);router[_0x2d33('0x9')]('/:id',auth[_0x2d33('0xa')](),controller[_0x2d33('0xc')]);router[_0x2d33('0xd')]('/',auth[_0x2d33('0xa')](),controller[_0x2d33('0xe')]);router[_0x2d33('0xf')](_0x2d33('0x10'),auth[_0x2d33('0xa')](),controller[_0x2d33('0x11')]);router[_0x2d33('0x12')](_0x2d33('0x10'),auth[_0x2d33('0xa')](),controller['destroy']);module[_0x2d33('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 7be860a..8074328 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 _0x2bfa=['sequelize','moment','STRING','DATE'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x2bfa,0x188));var _0xa2bf=function(_0xd626e4,_0x1ac55d){_0xd626e4=_0xd626e4-0x0;var _0x3a839e=_0x2bfa[_0xd626e4];return _0x3a839e;};'use strict';var Sequelize=require(_0xa2bf('0x0'));var moment=require(_0xa2bf('0x1'));module['exports']={'time':{'type':Sequelize[_0xa2bf('0x2')]},'callid':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xa2bf('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xa2bf('0x3')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x00ad=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x00ad,0x15e));var _0xd00a=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x00ad[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require(_0xd00a('0x0'));var moment=require(_0xd00a('0x1'));module[_0xd00a('0x2')]={'time':{'type':Sequelize[_0xd00a('0x3')]},'callid':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd00a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd00a('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0xd00a('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 7c72fd8..78f5c39 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 _0x4c3e=['apply','reject','save','update','destroy','then','error','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','include','findAll','rows','catch','show','params','length','includeAll','merge','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x6427d5,_0x508e04){var _0x4c7beb=function(_0x2d475b){while(--_0x2d475b){_0x6427d5['push'](_0x6427d5['shift']());}};_0x4c7beb(++_0x508e04);}(_0x4c3e,0xc0));var _0xe4c3=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x4c3e[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4c3('0x0'));var zipdir=require(_0xe4c3('0x1'));var jsonpatch=require(_0xe4c3('0x2'));var rp=require(_0xe4c3('0x3'));var moment=require(_0xe4c3('0x4'));var BPromise=require(_0xe4c3('0x5'));var Mustache=require(_0xe4c3('0x6'));var util=require(_0xe4c3('0x7'));var path=require(_0xe4c3('0x8'));var sox=require(_0xe4c3('0x9'));var csv=require(_0xe4c3('0xa'));var ejs=require(_0xe4c3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4c3('0xc'));var squel=require(_0xe4c3('0xd'));var crypto=require('crypto');var jsforce=require(_0xe4c3('0xe'));var deskjs=require(_0xe4c3('0xf'));var toCsv=require(_0xe4c3('0xa'));var querystring=require(_0xe4c3('0x10'));var Papa=require(_0xe4c3('0x11'));var Redis=require(_0xe4c3('0x12'));var authService=require(_0xe4c3('0x13'));var qs=require(_0xe4c3('0x14'));var as=require(_0xe4c3('0x15'));var hardwareService=require(_0xe4c3('0x16'));var logger=require(_0xe4c3('0x17'))('api');var utils=require(_0xe4c3('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe4c3('0x19'))['db'];function respondWithStatusCode(_0x161eb1,_0x451ae6){_0x451ae6=_0x451ae6||0xcc;return function(_0x276a72){if(_0x276a72){return _0x161eb1[_0xe4c3('0x1a')](_0x451ae6);}return _0x161eb1[_0xe4c3('0x1b')](_0x451ae6)[_0xe4c3('0x1c')]();};}function respondWithResult(_0x2509a8,_0x5b857c){_0x5b857c=_0x5b857c||0xc8;return function(_0x5f05a1){if(_0x5f05a1){return _0x2509a8[_0xe4c3('0x1b')](_0x5b857c)['json'](_0x5f05a1);}};}function respondWithFilteredResult(_0x5d6e46,_0x598743){return function(_0x355890){if(_0x355890){var _0x2259a8=typeof _0x598743[_0xe4c3('0x1d')]===_0xe4c3('0x1e')&&typeof _0x598743[_0xe4c3('0x1f')]===_0xe4c3('0x1e');var _0x483a56=_0x355890[_0xe4c3('0x20')];var _0x1da732=_0x2259a8?0x0:_0x598743['offset'];var _0x5ca23b=_0x2259a8?_0x355890['count']:_0x598743[_0xe4c3('0x1d')]+_0x598743['limit'];var _0x4fb54b;if(_0x5ca23b>=_0x483a56){_0x5ca23b=_0x483a56;_0x4fb54b=0xc8;}else{_0x4fb54b=0xce;}_0x5d6e46[_0xe4c3('0x1b')](_0x4fb54b);return _0x5d6e46[_0xe4c3('0x21')](_0xe4c3('0x22'),_0x1da732+'-'+_0x5ca23b+'/'+_0x483a56)[_0xe4c3('0x23')](_0x355890);}return null;};}function patchUpdates(_0x2bd0f3){return function(_0x332b91){try{jsonpatch[_0xe4c3('0x24')](_0x332b91,_0x2bd0f3,!![]);}catch(_0x45bc7c){return BPromise[_0xe4c3('0x25')](_0x45bc7c);}return _0x332b91[_0xe4c3('0x26')]();};}function saveUpdates(_0x3e8c08,_0x493632){return function(_0x4e42e8){if(_0x4e42e8){return _0x4e42e8[_0xe4c3('0x27')](_0x3e8c08)['then'](function(_0x346e10){return _0x346e10;});}return null;};}function removeEntity(_0x45e419,_0x455914){return function(_0x5f4128){if(_0x5f4128){return _0x5f4128[_0xe4c3('0x28')]()[_0xe4c3('0x29')](function(){_0x45e419[_0xe4c3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ae2fb,_0x4b2f21){return function(_0x37b508){if(!_0x37b508){_0x5ae2fb['sendStatus'](0x194);}return _0x37b508;};}function handleError(_0x3e6e69,_0x37c418){_0x37c418=_0x37c418||0x1f4;return function(_0x57f5e1){logger[_0xe4c3('0x2a')](_0x57f5e1['stack']);if(_0x57f5e1['name']){delete _0x57f5e1[_0xe4c3('0x2b')];}_0x3e6e69['status'](_0x37c418)['send'](_0x57f5e1);};}exports['index']=function(_0x18dd99,_0x2be18f){var _0x11cb61={},_0x1892f5={},_0x4a4262={'count':0x0,'rows':[]};var _0x454cf0=_[_0xe4c3('0x2c')](db[_0xe4c3('0x2d')][_0xe4c3('0x2e')],function(_0x9eeede){return{'name':_0x9eeede[_0xe4c3('0x2f')],'type':_0x9eeede[_0xe4c3('0x30')][_0xe4c3('0x31')]};});_0x1892f5[_0xe4c3('0x32')]=_[_0xe4c3('0x2c')](_0x454cf0,_0xe4c3('0x2b'));_0x1892f5[_0xe4c3('0x33')]=_[_0xe4c3('0x34')](_0x18dd99['query']);_0x1892f5[_0xe4c3('0x35')]=_[_0xe4c3('0x36')](_0x1892f5['model'],_0x1892f5[_0xe4c3('0x33')]);_0x11cb61['attributes']=_['intersection'](_0x1892f5['model'],qs[_0xe4c3('0x37')](_0x18dd99[_0xe4c3('0x33')][_0xe4c3('0x37')]));_0x11cb61['attributes']=_0x11cb61[_0xe4c3('0x38')]['length']?_0x11cb61[_0xe4c3('0x38')]:_0x1892f5[_0xe4c3('0x32')];if(!_0x18dd99[_0xe4c3('0x33')]['hasOwnProperty'](_0xe4c3('0x39'))){_0x11cb61[_0xe4c3('0x1f')]=qs[_0xe4c3('0x1f')](_0x18dd99[_0xe4c3('0x33')][_0xe4c3('0x1f')]);_0x11cb61[_0xe4c3('0x1d')]=qs[_0xe4c3('0x1d')](_0x18dd99[_0xe4c3('0x33')][_0xe4c3('0x1d')]);}_0x11cb61[_0xe4c3('0x3a')]=qs[_0xe4c3('0x3b')](_0x18dd99[_0xe4c3('0x33')][_0xe4c3('0x3b')]);_0x11cb61[_0xe4c3('0x3c')]=qs[_0xe4c3('0x35')](_[_0xe4c3('0x3d')](_0x18dd99[_0xe4c3('0x33')],_0x1892f5[_0xe4c3('0x35')]),_0x454cf0);if(_0x18dd99['query'][_0xe4c3('0x3e')]){_0x11cb61[_0xe4c3('0x3c')]=_['merge'](_0x11cb61['where'],{'$or':_['map'](_0x454cf0,function(_0x4e61fa){if(_0x4e61fa[_0xe4c3('0x30')]!=='VIRTUAL'){var _0x14ef3c={};_0x14ef3c[_0x4e61fa[_0xe4c3('0x2b')]]={'$like':'%'+_0x18dd99[_0xe4c3('0x33')][_0xe4c3('0x3e')]+'%'};return _0x14ef3c;}})});}_0x11cb61=_['merge']({},_0x11cb61,_0x18dd99['options']);var _0x559a0c={'where':_0x11cb61[_0xe4c3('0x3c')]};return db[_0xe4c3('0x2d')][_0xe4c3('0x20')](_0x559a0c)['then'](function(_0x5ec818){_0x4a4262[_0xe4c3('0x20')]=_0x5ec818;if(_0x18dd99[_0xe4c3('0x33')]['includeAll']){_0x11cb61[_0xe4c3('0x3f')]=[{'all':!![]}];}return db[_0xe4c3('0x2d')][_0xe4c3('0x40')](_0x11cb61);})['then'](function(_0x3a5142){_0x4a4262[_0xe4c3('0x41')]=_0x3a5142;return _0x4a4262;})[_0xe4c3('0x29')](respondWithFilteredResult(_0x2be18f,_0x11cb61))[_0xe4c3('0x42')](handleError(_0x2be18f,null));};exports[_0xe4c3('0x43')]=function(_0x1f7483,_0x46b8f8){var _0x40bf78={'raw':!![],'where':{'id':_0x1f7483[_0xe4c3('0x44')]['id']}},_0x468d17={};_0x468d17[_0xe4c3('0x32')]=_[_0xe4c3('0x34')](db[_0xe4c3('0x2d')][_0xe4c3('0x2e')]);_0x468d17[_0xe4c3('0x33')]=_[_0xe4c3('0x34')](_0x1f7483[_0xe4c3('0x33')]);_0x468d17[_0xe4c3('0x35')]=_[_0xe4c3('0x36')](_0x468d17[_0xe4c3('0x32')],_0x468d17[_0xe4c3('0x33')]);_0x40bf78[_0xe4c3('0x38')]=_[_0xe4c3('0x36')](_0x468d17['model'],qs[_0xe4c3('0x37')](_0x1f7483[_0xe4c3('0x33')][_0xe4c3('0x37')]));_0x40bf78[_0xe4c3('0x38')]=_0x40bf78[_0xe4c3('0x38')][_0xe4c3('0x45')]?_0x40bf78['attributes']:_0x468d17[_0xe4c3('0x32')];if(_0x1f7483[_0xe4c3('0x33')][_0xe4c3('0x46')]){_0x40bf78[_0xe4c3('0x3f')]=[{'all':!![]}];}_0x40bf78=_[_0xe4c3('0x47')]({},_0x40bf78,_0x1f7483[_0xe4c3('0x48')]);return db[_0xe4c3('0x2d')][_0xe4c3('0x49')](_0x40bf78)[_0xe4c3('0x29')](handleEntityNotFound(_0x46b8f8,null))[_0xe4c3('0x29')](respondWithResult(_0x46b8f8,null))['catch'](handleError(_0x46b8f8,null));};exports['create']=function(_0x1d686a,_0x88ab14){return db['VoiceQueuesLog'][_0xe4c3('0x4a')](_0x1d686a[_0xe4c3('0x4b')],{})[_0xe4c3('0x29')](respondWithResult(_0x88ab14,0xc9))[_0xe4c3('0x42')](handleError(_0x88ab14,null));};exports['update']=function(_0x582fa9,_0x380d93){if(_0x582fa9[_0xe4c3('0x4b')]['id']){delete _0x582fa9[_0xe4c3('0x4b')]['id'];}return db[_0xe4c3('0x2d')][_0xe4c3('0x49')]({'where':{'id':_0x582fa9[_0xe4c3('0x44')]['id']}})[_0xe4c3('0x29')](handleEntityNotFound(_0x380d93,null))[_0xe4c3('0x29')](saveUpdates(_0x582fa9['body'],null))['then'](respondWithResult(_0x380d93,null))[_0xe4c3('0x42')](handleError(_0x380d93,null));};exports[_0xe4c3('0x28')]=function(_0x5e25d8,_0x337532){return db[_0xe4c3('0x2d')][_0xe4c3('0x49')]({'where':{'id':_0x5e25d8[_0xe4c3('0x44')]['id']}})[_0xe4c3('0x29')](handleEntityNotFound(_0x337532,null))[_0xe4c3('0x29')](removeEntity(_0x337532,null))['catch'](handleError(_0x337532,null));}; \ No newline at end of file +var _0x8c99=['pick','filter','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','rimraf','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','then','destroy','error','stack','name','index','VoiceQueuesLog','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where'];(function(_0x2b4903,_0x1cb7c7){var _0x1bf97c=function(_0x2015ee){while(--_0x2015ee){_0x2b4903['push'](_0x2b4903['shift']());}};_0x1bf97c(++_0x1cb7c7);}(_0x8c99,0x15c));var _0x98c9=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x8c99[_0x3c6dce];return _0x1450e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98c9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98c9('0x1'));var rp=require('request-promise');var moment=require(_0x98c9('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98c9('0x3'));var path=require('path');var sox=require(_0x98c9('0x4'));var csv=require(_0x98c9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98c9('0x6'));var _=require(_0x98c9('0x7'));var squel=require(_0x98c9('0x8'));var crypto=require(_0x98c9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x98c9('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x98c9('0xb'));var Redis=require(_0x98c9('0xc'));var authService=require(_0x98c9('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x98c9('0xe'));var hardwareService=require(_0x98c9('0xf'));var logger=require(_0x98c9('0x10'))(_0x98c9('0x11'));var utils=require(_0x98c9('0x12'));var config=require(_0x98c9('0x13'));var licenseUtil=require(_0x98c9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428551,_0x44aff2){_0x44aff2=_0x44aff2||0xcc;return function(_0x204d06){if(_0x204d06){return _0x428551[_0x98c9('0x15')](_0x44aff2);}return _0x428551['status'](_0x44aff2)[_0x98c9('0x16')]();};}function respondWithResult(_0x457c93,_0x2e7838){_0x2e7838=_0x2e7838||0xc8;return function(_0x15f874){if(_0x15f874){return _0x457c93['status'](_0x2e7838)[_0x98c9('0x17')](_0x15f874);}};}function respondWithFilteredResult(_0x4c0347,_0x19fabf){return function(_0x3c46fd){if(_0x3c46fd){var _0x561c58=typeof _0x19fabf[_0x98c9('0x18')]===_0x98c9('0x19')&&typeof _0x19fabf[_0x98c9('0x1a')]==='undefined';var _0x5417bb=_0x3c46fd[_0x98c9('0x1b')];var _0x1b44d2=_0x561c58?0x0:_0x19fabf[_0x98c9('0x18')];var _0x209bc4=_0x561c58?_0x3c46fd[_0x98c9('0x1b')]:_0x19fabf[_0x98c9('0x18')]+_0x19fabf[_0x98c9('0x1a')];var _0x239fcb;if(_0x209bc4>=_0x5417bb){_0x209bc4=_0x5417bb;_0x239fcb=0xc8;}else{_0x239fcb=0xce;}_0x4c0347[_0x98c9('0x1c')](_0x239fcb);return _0x4c0347[_0x98c9('0x1d')]('Content-Range',_0x1b44d2+'-'+_0x209bc4+'/'+_0x5417bb)[_0x98c9('0x17')](_0x3c46fd);}return null;};}function patchUpdates(_0x1cd866){return function(_0x33c15d){try{jsonpatch[_0x98c9('0x1e')](_0x33c15d,_0x1cd866,!![]);}catch(_0x59e37e){return BPromise[_0x98c9('0x1f')](_0x59e37e);}return _0x33c15d[_0x98c9('0x20')]();};}function saveUpdates(_0x2353d8,_0x4fdab3){return function(_0x53d4b3){if(_0x53d4b3){return _0x53d4b3['update'](_0x2353d8)[_0x98c9('0x21')](function(_0x4d0097){return _0x4d0097;});}return null;};}function removeEntity(_0x30655f,_0x35ac6b){return function(_0x8038d8){if(_0x8038d8){return _0x8038d8[_0x98c9('0x22')]()['then'](function(){_0x30655f[_0x98c9('0x1c')](0xcc)[_0x98c9('0x16')]();});}};}function handleEntityNotFound(_0x28ad0f,_0x50eea7){return function(_0x4c570e){if(!_0x4c570e){_0x28ad0f[_0x98c9('0x15')](0x194);}return _0x4c570e;};}function handleError(_0x598cbf,_0x426bb4){_0x426bb4=_0x426bb4||0x1f4;return function(_0x634658){logger[_0x98c9('0x23')](_0x634658[_0x98c9('0x24')]);if(_0x634658[_0x98c9('0x25')]){delete _0x634658[_0x98c9('0x25')];}_0x598cbf['status'](_0x426bb4)['send'](_0x634658);};}exports[_0x98c9('0x26')]=function(_0x511552,_0x12a344){var _0x12f33d={},_0x5cda7b={},_0xd9cca6={'count':0x0,'rows':[]};var _0x1c6727=_['map'](db[_0x98c9('0x27')][_0x98c9('0x28')],function(_0x51b4b0){return{'name':_0x51b4b0['fieldName'],'type':_0x51b4b0[_0x98c9('0x29')]['key']};});_0x5cda7b[_0x98c9('0x2a')]=_[_0x98c9('0x2b')](_0x1c6727,'name');_0x5cda7b[_0x98c9('0x2c')]=_[_0x98c9('0x2d')](_0x511552['query']);_0x5cda7b[_0x98c9('0x2e')]=_[_0x98c9('0x2f')](_0x5cda7b[_0x98c9('0x2a')],_0x5cda7b['query']);_0x12f33d[_0x98c9('0x30')]=_['intersection'](_0x5cda7b[_0x98c9('0x2a')],qs[_0x98c9('0x31')](_0x511552[_0x98c9('0x2c')]['fields']));_0x12f33d['attributes']=_0x12f33d[_0x98c9('0x30')][_0x98c9('0x32')]?_0x12f33d[_0x98c9('0x30')]:_0x5cda7b[_0x98c9('0x2a')];if(!_0x511552[_0x98c9('0x2c')][_0x98c9('0x33')]('nolimit')){_0x12f33d['limit']=qs[_0x98c9('0x1a')](_0x511552['query'][_0x98c9('0x1a')]);_0x12f33d[_0x98c9('0x18')]=qs[_0x98c9('0x18')](_0x511552['query'][_0x98c9('0x18')]);}_0x12f33d['order']=qs[_0x98c9('0x34')](_0x511552[_0x98c9('0x2c')][_0x98c9('0x34')]);_0x12f33d[_0x98c9('0x35')]=qs['filters'](_[_0x98c9('0x36')](_0x511552[_0x98c9('0x2c')],_0x5cda7b[_0x98c9('0x2e')]),_0x1c6727);if(_0x511552['query'][_0x98c9('0x37')]){_0x12f33d[_0x98c9('0x35')]=_[_0x98c9('0x38')](_0x12f33d['where'],{'$or':_[_0x98c9('0x2b')](_0x1c6727,function(_0x52bcf0){if(_0x52bcf0[_0x98c9('0x29')]!=='VIRTUAL'){var _0x541ab7={};_0x541ab7[_0x52bcf0[_0x98c9('0x25')]]={'$like':'%'+_0x511552[_0x98c9('0x2c')][_0x98c9('0x37')]+'%'};return _0x541ab7;}})});}_0x12f33d=_[_0x98c9('0x38')]({},_0x12f33d,_0x511552['options']);var _0xdb5eeb={'where':_0x12f33d[_0x98c9('0x35')]};return db[_0x98c9('0x27')][_0x98c9('0x1b')](_0xdb5eeb)[_0x98c9('0x21')](function(_0x3712ea){_0xd9cca6[_0x98c9('0x1b')]=_0x3712ea;if(_0x511552['query'][_0x98c9('0x39')]){_0x12f33d[_0x98c9('0x3a')]=[{'all':!![]}];}return db[_0x98c9('0x27')][_0x98c9('0x3b')](_0x12f33d);})['then'](function(_0x33eb79){_0xd9cca6['rows']=_0x33eb79;return _0xd9cca6;})[_0x98c9('0x21')](respondWithFilteredResult(_0x12a344,_0x12f33d))[_0x98c9('0x3c')](handleError(_0x12a344,null));};exports[_0x98c9('0x3d')]=function(_0x208284,_0x485034){var _0x54aa86={'raw':!![],'where':{'id':_0x208284['params']['id']}},_0x2b173a={};_0x2b173a['model']=_['keys'](db[_0x98c9('0x27')][_0x98c9('0x28')]);_0x2b173a[_0x98c9('0x2c')]=_['keys'](_0x208284['query']);_0x2b173a['filters']=_[_0x98c9('0x2f')](_0x2b173a['model'],_0x2b173a['query']);_0x54aa86['attributes']=_['intersection'](_0x2b173a[_0x98c9('0x2a')],qs[_0x98c9('0x31')](_0x208284[_0x98c9('0x2c')]['fields']));_0x54aa86[_0x98c9('0x30')]=_0x54aa86['attributes'][_0x98c9('0x32')]?_0x54aa86[_0x98c9('0x30')]:_0x2b173a['model'];if(_0x208284['query'][_0x98c9('0x39')]){_0x54aa86[_0x98c9('0x3a')]=[{'all':!![]}];}_0x54aa86=_['merge']({},_0x54aa86,_0x208284[_0x98c9('0x3e')]);return db['VoiceQueuesLog'][_0x98c9('0x3f')](_0x54aa86)['then'](handleEntityNotFound(_0x485034,null))[_0x98c9('0x21')](respondWithResult(_0x485034,null))[_0x98c9('0x3c')](handleError(_0x485034,null));};exports[_0x98c9('0x40')]=function(_0x74a294,_0x19514f){return db[_0x98c9('0x27')][_0x98c9('0x40')](_0x74a294[_0x98c9('0x41')],{})[_0x98c9('0x21')](respondWithResult(_0x19514f,0xc9))[_0x98c9('0x3c')](handleError(_0x19514f,null));};exports['update']=function(_0x38e4ab,_0x5e7448){if(_0x38e4ab[_0x98c9('0x41')]['id']){delete _0x38e4ab[_0x98c9('0x41')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x38e4ab['params']['id']}})[_0x98c9('0x21')](handleEntityNotFound(_0x5e7448,null))[_0x98c9('0x21')](saveUpdates(_0x38e4ab[_0x98c9('0x41')],null))[_0x98c9('0x21')](respondWithResult(_0x5e7448,null))['catch'](handleError(_0x5e7448,null));};exports[_0x98c9('0x22')]=function(_0x4ea883,_0x5ac4bd){return db[_0x98c9('0x27')][_0x98c9('0x3f')]({'where':{'id':_0x4ea883[_0x98c9('0x42')]['id']}})[_0x98c9('0x21')](handleEntityNotFound(_0x5ac4bd,null))[_0x98c9('0x21')](removeEntity(_0x5ac4bd,null))['catch'](handleError(_0x5ac4bd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1cf817e..26857ed 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 _0xecb2=['VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3c9c00,_0x38904f){var _0xd9b3d=function(_0x5b681e){while(--_0x5b681e){_0x3c9c00['push'](_0x3c9c00['shift']());}};_0xd9b3d(++_0x38904f);}(_0xecb2,0x112));var _0x2ecb=function(_0x23bc20,_0x82513b){_0x23bc20=_0x23bc20-0x0;var _0x53bc67=_0xecb2[_0x23bc20];return _0x53bc67;};'use strict';var _=require(_0x2ecb('0x0'));var util=require(_0x2ecb('0x1'));var logger=require(_0x2ecb('0x2'))('api');var moment=require(_0x2ecb('0x3'));var BPromise=require(_0x2ecb('0x4'));var rp=require(_0x2ecb('0x5'));var fs=require('fs');var path=require(_0x2ecb('0x6'));var rimraf=require(_0x2ecb('0x7'));var config=require(_0x2ecb('0x8'));var attributes=require(_0x2ecb('0x9'));module[_0x2ecb('0xa')]=function(_0x414871,_0x9e6340){return _0x414871['define'](_0x2ecb('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x2ecb('0xc'),'fields':[_0x2ecb('0xd'),_0x2ecb('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1a7f=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1a7f,0xb4));var _0xf1a7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1a7f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf1a7('0x0'));var util=require(_0xf1a7('0x1'));var logger=require('../../config/logger')(_0xf1a7('0x2'));var moment=require(_0xf1a7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1a7('0x4'));var fs=require('fs');var path=require(_0xf1a7('0x5'));var rimraf=require(_0xf1a7('0x6'));var config=require(_0xf1a7('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0xf1a7('0x8')]=function(_0x6f06d,_0x17a05e){return _0x6f06d[_0xf1a7('0x9')](_0xf1a7('0xa'),attributes,{'tableName':_0xf1a7('0xb'),'paranoid':![],'indexes':[{'name':_0xf1a7('0xc'),'fields':[_0xf1a7('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 231bad9..7eb3daa 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 _0xceab=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xceab,0x106));var _0xbcea=function(_0x559edf,_0x6ff941){_0x559edf=_0x559edf-0x0;var _0x1d9efd=_0xceab[_0x559edf];return _0x1d9efd;};'use strict';var _=require(_0xbcea('0x0'));var util=require('util');var moment=require(_0xbcea('0x1'));var BPromise=require(_0xbcea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcea('0x3'));var db=require(_0xbcea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcea('0x5'))(_0xbcea('0x6'));var config=require('../../config/environment');var jayson=require(_0xbcea('0x7'));var client=jayson[_0xbcea('0x8')][_0xbcea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x331fd0,_0x2647ca,_0x479fdc){return new BPromise(function(_0x445b9b,_0x1869bc){return client[_0xbcea('0xa')](_0x331fd0,_0x479fdc)[_0xbcea('0xb')](function(_0x1dc837){logger['info'](_0xbcea('0xc'),_0x2647ca,'request\x20sent');logger[_0xbcea('0xd')](_0xbcea('0xe'),_0x2647ca,_0xbcea('0xf'),JSON[_0xbcea('0x10')](_0x1dc837));if(_0x1dc837[_0xbcea('0x11')]){if(_0x1dc837[_0xbcea('0x11')][_0xbcea('0x12')]===0x1f4){logger['error'](_0xbcea('0xc'),_0x2647ca,_0x1dc837[_0xbcea('0x11')][_0xbcea('0x13')]);return _0x1869bc(_0x1dc837['error'][_0xbcea('0x13')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2647ca,_0x1dc837[_0xbcea('0x11')][_0xbcea('0x13')]);return _0x445b9b(_0x1dc837[_0xbcea('0x11')][_0xbcea('0x13')]);}else{logger[_0xbcea('0x14')](_0xbcea('0xc'),_0x2647ca,'request\x20sent');_0x445b9b(_0x1dc837[_0xbcea('0x15')]['message']);}})['catch'](function(_0x5c3ace){logger[_0xbcea('0x11')](_0xbcea('0xc'),_0x2647ca,_0x5c3ace);_0x1869bc(_0x5c3ace);});});} \ No newline at end of file +var _0x220b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1d3fec,_0x2ce1c9){var _0x5a7f27=function(_0x5d27bb){while(--_0x5d27bb){_0x1d3fec['push'](_0x1d3fec['shift']());}};_0x5a7f27(++_0x2ce1c9);}(_0x220b,0x1a2));var _0xb220=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x220b[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0xb220('0x0'));var moment=require(_0xb220('0x1'));var BPromise=require(_0xb220('0x2'));var rs=require(_0xb220('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb220('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb220('0x5'))('rpc');var config=require(_0xb220('0x6'));var jayson=require(_0xb220('0x7'));var client=jayson[_0xb220('0x8')][_0xb220('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7d19,_0x23631f,_0x7fa0dd){return new BPromise(function(_0x5b83b9,_0x12c68c){return client[_0xb220('0xa')](_0x5d7d19,_0x7fa0dd)[_0xb220('0xb')](function(_0x2821a6){logger[_0xb220('0xc')](_0xb220('0xd'),_0x23631f,_0xb220('0xe'));logger[_0xb220('0xf')](_0xb220('0x10'),_0x23631f,'request\x20sent',JSON[_0xb220('0x11')](_0x2821a6));if(_0x2821a6[_0xb220('0x12')]){if(_0x2821a6['error']['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x23631f,_0x2821a6['error'][_0xb220('0x13')]);return _0x12c68c(_0x2821a6['error'][_0xb220('0x13')]);}logger[_0xb220('0x12')](_0xb220('0xd'),_0x23631f,_0x2821a6[_0xb220('0x12')]['message']);return _0x5b83b9(_0x2821a6['error'][_0xb220('0x13')]);}else{logger[_0xb220('0xc')](_0xb220('0xd'),_0x23631f,_0xb220('0xe'));_0x5b83b9(_0x2821a6[_0xb220('0x14')][_0xb220('0x13')]);}})[_0xb220('0x15')](function(_0x269c52){logger[_0xb220('0x12')](_0xb220('0xd'),_0x23631f,_0x269c52);_0x12c68c(_0x269c52);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 09842ff..1985149 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 _0x9d5c=['get','isAuthenticated','index','describe','show','download','/:id/downloads','downloadTranscribe','post','/:id/transcribe','runTranscribe','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x456d56,_0x59088c){var _0x4d857d=function(_0xa7ef8e){while(--_0xa7ef8e){_0x456d56['push'](_0x456d56['shift']());}};_0x4d857d(++_0x59088c);}(_0x9d5c,0x1ec));var _0xc9d5=function(_0x2b4fca,_0x5ce536){_0x2b4fca=_0x2b4fca-0x0;var _0x31e686=_0x9d5c[_0x2b4fca];return _0x31e686;};'use strict';var multer=require('multer');var util=require(_0xc9d5('0x0'));var path=require(_0xc9d5('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9d5('0x2'));var router=express['Router']();var fs_extra=require(_0xc9d5('0x3'));var auth=require(_0xc9d5('0x4'));var interaction=require(_0xc9d5('0x5'));var config=require(_0xc9d5('0x6'));var controller=require(_0xc9d5('0x7'));router[_0xc9d5('0x8')]('/',auth[_0xc9d5('0x9')](),controller[_0xc9d5('0xa')]);router[_0xc9d5('0x8')]('/describe',auth[_0xc9d5('0x9')](),controller[_0xc9d5('0xb')]);router[_0xc9d5('0x8')]('/:id',auth[_0xc9d5('0x9')](),controller[_0xc9d5('0xc')]);router[_0xc9d5('0x8')]('/:id/download',auth[_0xc9d5('0x9')](),controller[_0xc9d5('0xd')]);router[_0xc9d5('0x8')](_0xc9d5('0xe'),controller['downloads']);router[_0xc9d5('0x8')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xc9d5('0xf')]);router['post']('/',auth[_0xc9d5('0x9')](),controller['create']);router[_0xc9d5('0x10')](_0xc9d5('0x11'),auth[_0xc9d5('0x9')](),controller[_0xc9d5('0x12')]);router[_0xc9d5('0x13')](_0xc9d5('0x14'),auth[_0xc9d5('0x9')](),controller[_0xc9d5('0x15')]);router[_0xc9d5('0x16')](_0xc9d5('0x14'),auth[_0xc9d5('0x9')](),controller[_0xc9d5('0x17')]);module[_0xc9d5('0x18')]=router; \ No newline at end of file +var _0x0a19=['/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','get','download'];(function(_0x308548,_0x11ba67){var _0x5a4792=function(_0x3e0cfa){while(--_0x3e0cfa){_0x308548['push'](_0x308548['shift']());}};_0x5a4792(++_0x11ba67);}(_0x0a19,0x199));var _0x90a1=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x0a19[_0x3e3bee];return _0x3ae14c;};'use strict';var multer=require(_0x90a1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x90a1('0x1'));var express=require('express');var router=express[_0x90a1('0x2')]();var fs_extra=require(_0x90a1('0x3'));var auth=require(_0x90a1('0x4'));var interaction=require(_0x90a1('0x5'));var config=require(_0x90a1('0x6'));var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x90a1('0x7')](),controller['describe']);router['get'](_0x90a1('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x90a1('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x90a1('0xa')]);router[_0x90a1('0x9')](_0x90a1('0xb'),controller[_0x90a1('0xc')]);router[_0x90a1('0x9')](_0x90a1('0xd'),auth[_0x90a1('0x7')](),controller[_0x90a1('0xe')]);router[_0x90a1('0xf')]('/',auth[_0x90a1('0x7')](),controller[_0x90a1('0x10')]);router['post'](_0x90a1('0xd'),auth[_0x90a1('0x7')](),controller[_0x90a1('0x11')]);router['put'](_0x90a1('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x90a1('0x12')](_0x90a1('0x8'),auth[_0x90a1('0x7')](),controller['destroy']);module[_0x90a1('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index d94816d..470643c 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 2030ea6..c508a62 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 _0x171b=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','name','send','map','rawAttributes','type','key','model','format','query','keys','intersection','attributes','fields','nolimit','sort','filters','pick','filter','where','merge','options','VoiceRecording','includeAll','include','findAll','rows','catch','show','length','find','create','body','update','params','describe','download','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','MD5','col','token','push','$and','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','bucket','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf'];(function(_0x28a55b,_0x250791){var _0x523a7e=function(_0x3aaee0){while(--_0x3aaee0){_0x28a55b['push'](_0x28a55b['shift']());}};_0x523a7e(++_0x250791);}(_0x171b,0x118));var _0xb171=function(_0x2655d1,_0xefa500){_0x2655d1=_0x2655d1-0x0;var _0x1daae3=_0x171b[_0x2655d1];return _0x1daae3;};'use strict';var emlformat=require(_0xb171('0x0'));var rimraf=require(_0xb171('0x1'));var zipdir=require(_0xb171('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb171('0x3'));var BPromise=require(_0xb171('0x4'));var Mustache=require(_0xb171('0x5'));var util=require(_0xb171('0x6'));var path=require(_0xb171('0x7'));var sox=require(_0xb171('0x8'));var csv=require(_0xb171('0x9'));var ejs=require(_0xb171('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb171('0xb'));var crypto=require(_0xb171('0xc'));var jsforce=require(_0xb171('0xd'));var deskjs=require(_0xb171('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb171('0xf'));var Papa=require('papaparse');var AWS=require(_0xb171('0x10'));var uuidv4=require(_0xb171('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb171('0x12'));var as=require(_0xb171('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb171('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb171('0x15'));var licenseUtil=require(_0xb171('0x16'));var db=require(_0xb171('0x17'))['db'];function respondWithStatusCode(_0x568c96,_0x2c5552){_0x2c5552=_0x2c5552||0xcc;return function(_0x15eac7){if(_0x15eac7){return _0x568c96[_0xb171('0x18')](_0x2c5552);}return _0x568c96[_0xb171('0x19')](_0x2c5552)[_0xb171('0x1a')]();};}function respondWithResult(_0x4b962d,_0x18527e){_0x18527e=_0x18527e||0xc8;return function(_0x49e208){if(_0x49e208){return _0x4b962d['status'](_0x18527e)[_0xb171('0x1b')](_0x49e208);}};}function respondWithFilteredResult(_0x1414e8,_0x5759ce){return function(_0x1f4b70){if(_0x1f4b70){var _0x190802=typeof _0x5759ce[_0xb171('0x1c')]===_0xb171('0x1d')&&typeof _0x5759ce[_0xb171('0x1e')]===_0xb171('0x1d');var _0x4b6038=_0x1f4b70[_0xb171('0x1f')];var _0x3530ec=_0x190802?0x0:_0x5759ce['offset'];var _0x2738b1=_0x190802?_0x1f4b70[_0xb171('0x1f')]:_0x5759ce[_0xb171('0x1c')]+_0x5759ce[_0xb171('0x1e')];var _0x210898;if(_0x2738b1>=_0x4b6038){_0x2738b1=_0x4b6038;_0x210898=0xc8;}else{_0x210898=0xce;}_0x1414e8[_0xb171('0x19')](_0x210898);return _0x1414e8[_0xb171('0x20')](_0xb171('0x21'),_0x3530ec+'-'+_0x2738b1+'/'+_0x4b6038)[_0xb171('0x1b')](_0x1f4b70);}return null;};}function patchUpdates(_0x187149){return function(_0x4b9472){try{jsonpatch[_0xb171('0x22')](_0x4b9472,_0x187149,!![]);}catch(_0x36671f){return BPromise['reject'](_0x36671f);}return _0x4b9472[_0xb171('0x23')]();};}function saveUpdates(_0x3edf9d,_0xcfd308){return function(_0x408e9f){if(_0x408e9f){return _0x408e9f['update'](_0x3edf9d)['then'](function(_0x22bd26){return _0x22bd26;});}return null;};}function removeEntity(_0x374311,_0x4c6900){return function(_0x317923){if(_0x317923){return _0x317923[_0xb171('0x24')]()[_0xb171('0x25')](function(){_0x374311[_0xb171('0x19')](0xcc)[_0xb171('0x1a')]();});}};}function handleEntityNotFound(_0x2d4247,_0x3a4ffa){return function(_0xc3a4f4){if(!_0xc3a4f4){_0x2d4247['sendStatus'](0x194);}return _0xc3a4f4;};}function handleError(_0xd9352,_0x23696f){_0x23696f=_0x23696f||0x1f4;return function(_0x14aebe){logger['error'](_0x14aebe['stack']);if(_0x14aebe[_0xb171('0x26')]){delete _0x14aebe['name'];}_0xd9352['status'](_0x23696f)[_0xb171('0x27')](_0x14aebe);};}exports['index']=function(_0x2b9c41,_0x57e8d6){var _0x1c02bf={},_0x14dc6c={},_0x2e3ab2={'count':0x0,'rows':[]};var _0x5173a6=_[_0xb171('0x28')](db['VoiceRecording'][_0xb171('0x29')],function(_0x370aed){return{'name':_0x370aed['fieldName'],'type':_0x370aed[_0xb171('0x2a')][_0xb171('0x2b')]};});_0x14dc6c[_0xb171('0x2c')]=_['differenceBy'](_[_0xb171('0x28')](_0x5173a6,_0xb171('0x26')),[_0xb171('0x2d')]);_0x14dc6c[_0xb171('0x2e')]=_[_0xb171('0x2f')](_0x2b9c41[_0xb171('0x2e')]);_0x14dc6c['filters']=_[_0xb171('0x30')](_0x14dc6c[_0xb171('0x2c')],_0x14dc6c['query']);_0x1c02bf[_0xb171('0x31')]=_[_0xb171('0x30')](_0x14dc6c[_0xb171('0x2c')],qs[_0xb171('0x32')](_0x2b9c41[_0xb171('0x2e')][_0xb171('0x32')]));_0x1c02bf[_0xb171('0x31')]=_0x1c02bf[_0xb171('0x31')]['length']?_0x1c02bf[_0xb171('0x31')]:_0x14dc6c[_0xb171('0x2c')];if(!_0x2b9c41['query']['hasOwnProperty'](_0xb171('0x33'))){_0x1c02bf['limit']=qs[_0xb171('0x1e')](_0x2b9c41[_0xb171('0x2e')][_0xb171('0x1e')]);_0x1c02bf[_0xb171('0x1c')]=qs[_0xb171('0x1c')](_0x2b9c41[_0xb171('0x2e')][_0xb171('0x1c')]);}_0x1c02bf['order']=qs[_0xb171('0x34')](_0x2b9c41[_0xb171('0x2e')][_0xb171('0x34')]);_0x1c02bf['where']=qs[_0xb171('0x35')](_[_0xb171('0x36')](_0x2b9c41[_0xb171('0x2e')],_0x14dc6c['filters']),_0x5173a6);if(_0x2b9c41[_0xb171('0x2e')][_0xb171('0x37')]){_0x1c02bf[_0xb171('0x38')]=_[_0xb171('0x39')](_0x1c02bf[_0xb171('0x38')],{'$or':_[_0xb171('0x28')](_0x5173a6,function(_0x181d94){if(_0x181d94[_0xb171('0x2a')]!=='VIRTUAL'){var _0x5ccc1c={};_0x5ccc1c[_0x181d94['name']]={'$like':'%'+_0x2b9c41[_0xb171('0x2e')][_0xb171('0x37')]+'%'};return _0x5ccc1c;}})});}_0x1c02bf=_['merge']({},_0x1c02bf,_0x2b9c41[_0xb171('0x3a')]);var _0x1fa0d2={'where':_0x1c02bf[_0xb171('0x38')]};return db[_0xb171('0x3b')][_0xb171('0x1f')](_0x1fa0d2)[_0xb171('0x25')](function(_0x2afa61){_0x2e3ab2[_0xb171('0x1f')]=_0x2afa61;if(_0x2b9c41[_0xb171('0x2e')][_0xb171('0x3c')]){_0x1c02bf[_0xb171('0x3d')]=[{'all':!![]}];}return db[_0xb171('0x3b')][_0xb171('0x3e')](_0x1c02bf);})[_0xb171('0x25')](function(_0x7cbdc1){_0x2e3ab2[_0xb171('0x3f')]=_0x7cbdc1;return _0x2e3ab2;})[_0xb171('0x25')](respondWithFilteredResult(_0x57e8d6,_0x1c02bf))[_0xb171('0x40')](handleError(_0x57e8d6,null));};exports[_0xb171('0x41')]=function(_0x2fc202,_0x81f14a){var _0x3d7082={'raw':![],'where':{'id':_0x2fc202['params']['id']}},_0x2ff0b9={};_0x2ff0b9['model']=_[_0xb171('0x2f')](db[_0xb171('0x3b')][_0xb171('0x29')]);_0x2ff0b9['query']=_['keys'](_0x2fc202[_0xb171('0x2e')]);_0x2ff0b9[_0xb171('0x35')]=_[_0xb171('0x30')](_0x2ff0b9[_0xb171('0x2c')],_0x2ff0b9[_0xb171('0x2e')]);_0x3d7082[_0xb171('0x31')]=_[_0xb171('0x30')](_0x2ff0b9[_0xb171('0x2c')],qs[_0xb171('0x32')](_0x2fc202[_0xb171('0x2e')][_0xb171('0x32')]));_0x3d7082[_0xb171('0x31')]=_0x3d7082['attributes'][_0xb171('0x42')]?_0x3d7082[_0xb171('0x31')]:_0x2ff0b9[_0xb171('0x2c')];if(_0x2fc202[_0xb171('0x2e')][_0xb171('0x3c')]){_0x3d7082['include']=[{'all':!![]}];}_0x3d7082=_[_0xb171('0x39')]({},_0x3d7082,_0x2fc202[_0xb171('0x3a')]);return db[_0xb171('0x3b')][_0xb171('0x43')](_0x3d7082)['then'](handleEntityNotFound(_0x81f14a,null))[_0xb171('0x25')](respondWithResult(_0x81f14a,null))[_0xb171('0x40')](handleError(_0x81f14a,null));};exports[_0xb171('0x44')]=function(_0x590908,_0x28a983){return db[_0xb171('0x3b')][_0xb171('0x44')](_0x590908[_0xb171('0x45')],{})[_0xb171('0x25')](respondWithResult(_0x28a983,0xc9))[_0xb171('0x40')](handleError(_0x28a983,null));};exports[_0xb171('0x46')]=function(_0x70e225,_0x1be2f1){if(_0x70e225['body']['id']){delete _0x70e225[_0xb171('0x45')]['id'];}return db[_0xb171('0x3b')][_0xb171('0x43')]({'where':{'id':_0x70e225[_0xb171('0x47')]['id']}})[_0xb171('0x25')](handleEntityNotFound(_0x1be2f1,null))[_0xb171('0x25')](saveUpdates(_0x70e225[_0xb171('0x45')],null))[_0xb171('0x25')](respondWithResult(_0x1be2f1,null))[_0xb171('0x40')](handleError(_0x1be2f1,null));};exports['describe']=function(_0x4ae6e3,_0x449ef8){return db[_0xb171('0x3b')][_0xb171('0x48')]()[_0xb171('0x25')](respondWithResult(_0x449ef8,null))[_0xb171('0x40')](handleError(_0x449ef8,null));};exports[_0xb171('0x49')]=function(_0x47efbc,_0x209590,_0x466b26){var _0x23b290=require('../../components/encryptor');var _0x55d5da=![];var _0x1f29bb={};if(_0x47efbc[_0xb171('0x2e')][_0xb171('0x2a')]&&_0x47efbc[_0xb171('0x2e')][_0xb171('0x2a')]===_0xb171('0x4a')){_0x1f29bb['uniqueid']=_0x47efbc[_0xb171('0x47')]['id'];}else{_0x1f29bb['id']=_0x47efbc[_0xb171('0x47')]['id'];}return db[_0xb171('0x3b')][_0xb171('0x43')]({'where':_0x1f29bb,'attributes':['id',_0xb171('0x4b')],'raw':!![]})[_0xb171('0x25')](handleEntityNotFound(_0x209590,null))[_0xb171('0x25')](function(_0x2499d3){if(_0x2499d3){var _0x2153b0=_0x2499d3['value'];var _0x53cef2=util[_0xb171('0x2d')]('%s.cypher',_0x2153b0);if(fs[_0xb171('0x4c')](_0x53cef2)){_0x55d5da=!![];return _0x23b290[_0xb171('0x4d')](_0x53cef2,_0x2153b0,config[_0xb171('0x4e')][_0xb171('0x4f')])[_0xb171('0x25')](function(){return _0x2499d3;});}return _0x2499d3;}})[_0xb171('0x25')](function(_0x361abf){if(_0x361abf){var _0x432ac2=_0x361abf[_0xb171('0x4b')];if(!fs['existsSync'](_0x432ac2)){throw new db[(_0xb171('0x50'))][(_0xb171('0x51'))](_0xb171('0x52'));}if(_0x361abf[_0xb171('0x53')]){return _0x209590['download'](_0x432ac2,_0x361abf[_0xb171('0x53')]+path[_0xb171('0x54')](_0x432ac2),function(){if(_0x55d5da){fs[_0xb171('0x55')](_0x432ac2);}});}else{return _0x209590[_0xb171('0x49')](_0x432ac2,function(_0x4f0a27){if(_0x55d5da){fs[_0xb171('0x55')](_0x432ac2);}});}}})[_0xb171('0x40')](function(_0x5f1ff3){if(_0x5f1ff3[_0xb171('0x56')]==='VoiceRecording\x20not\x20found'){_0x209590[_0xb171('0x19')](0x194)[_0xb171('0x27')](_0xb171('0x57'));}else{return handleError(_0x209590,null);}});};exports['downloads']=function(_0x4ad6be,_0x404db7,_0x2adfe5){var _0xacd136=require('../../components/encryptor');var _0x9cde03=![];var _0x22bfff={'$and':[db[_0xb171('0x58')][_0xb171('0x38')](db[_0xb171('0x58')]['fn'](_0xb171('0x59'),db['sequelize'][_0xb171('0x5a')]('uniqueid')),_0x4ad6be[_0xb171('0x2e')][_0xb171('0x5b')])]};if(_0x4ad6be[_0xb171('0x2e')][_0xb171('0x2a')]&&_0x4ad6be[_0xb171('0x2e')][_0xb171('0x2a')]==='uniqueid'){_0x22bfff['$and'][_0xb171('0x5c')]({'uniqueid':_0x4ad6be[_0xb171('0x47')]['id']});}else{_0x22bfff[_0xb171('0x5d')][_0xb171('0x5c')]({'id':_0x4ad6be[_0xb171('0x47')]['id']});}return db[_0xb171('0x3b')][_0xb171('0x43')]({'where':_0x22bfff,'attributes':['id',_0xb171('0x4b')],'raw':!![]})[_0xb171('0x25')](handleEntityNotFound(_0x404db7,null))[_0xb171('0x25')](function(_0x3f9d4d){if(_0x3f9d4d){var _0x42b8c5=util['format'](_0xb171('0x5e'),_0x3f9d4d[_0xb171('0x4b')]);if(fs['existsSync'](_0x42b8c5)){_0x9cde03=!![];return _0xacd136[_0xb171('0x4d')](_0x42b8c5,_0x3f9d4d[_0xb171('0x4b')],config[_0xb171('0x4e')]['recording'])['then'](function(){return _0x3f9d4d;});}return _0x3f9d4d;}})[_0xb171('0x25')](function(_0x466953){if(_0x466953){if(!fs[_0xb171('0x4c')](_0x466953[_0xb171('0x4b')])){throw new db['Sequelize'][(_0xb171('0x51'))](_0xb171('0x52'));}if(_0x466953[_0xb171('0x53')]){return _0x404db7['download'](_0x466953[_0xb171('0x4b')],_0x466953['filename']+path[_0xb171('0x54')](_0x466953['value']),function(){if(_0x9cde03){fs['unlink'](_0x466953[_0xb171('0x4b')]);}});}else{return _0x404db7[_0xb171('0x49')](_0x466953[_0xb171('0x4b')],function(_0x18411d){if(_0x9cde03){fs[_0xb171('0x55')](_0x466953[_0xb171('0x4b')]);}});}}})[_0xb171('0x40')](handleError(_0x404db7,null));};exports[_0xb171('0x24')]=function(_0x20fcfe,_0x31a45a){return db[_0xb171('0x3b')][_0xb171('0x43')]({'where':{'id':_0x20fcfe[_0xb171('0x47')]['id']}})[_0xb171('0x25')](function(_0x46fc4b){if(_[_0xb171('0x5f')](_0x46fc4b)){throw new ReferenceError(_0xb171('0x60'));}return _0x46fc4b;})[_0xb171('0x25')](function(_0x30880b){var _0x56e27b=_0x30880b[_0xb171('0x4b')];logger[_0xb171('0x61')](_0xb171('0x62'),_0x56e27b);if(!_[_0xb171('0x5f')](_0x30880b[_0xb171('0x4b')])&&fs[_0xb171('0x4c')](_0x56e27b)){logger[_0xb171('0x61')]('File:\x20\x22'+_0x56e27b+_0xb171('0x63'));fs['unlinkSync'](_0x56e27b);}_0x56e27b=_0x56e27b+'.cypher';if(!_[_0xb171('0x5f')](_0x30880b['value'])&&fs[_0xb171('0x4c')](_0x56e27b)){logger[_0xb171('0x61')](_0xb171('0x64')+_0x56e27b+_0xb171('0x63'));fs['unlinkSync'](_0x56e27b);}return _0x30880b;})['then'](function(_0xc1874e){if(!_0xc1874e)throw new InternalError();return _0xc1874e['destroy']();})[_0xb171('0x25')](function(){_0x31a45a[_0xb171('0x19')](0xcc)[_0xb171('0x1a')]();})[_0xb171('0x40')](handleError(_0x31a45a,null));};function getBucketslist(_0x2d742,_0x504e90,_0x14105e){return new Promise(function(_0x1c85b0,_0x4d05e3){var _0x1d8b6c=new AWS['S3']({'accessKeyId':_0x504e90,'secretAccessKey':_0x2d742,'region':_0x14105e});_0x1d8b6c['listBuckets']({},function(_0x5dc69e,_0x27b41f){if(_0x5dc69e){return _0x4d05e3(_0x5dc69e);}else{return _0x1c85b0(_0x27b41f);}});});}function createBucket(_0x1124bb,_0x286e8a,_0x1bc88e,_0x56c0ba){return new Promise(function(_0x7c7b20,_0x4020e9){var _0x1a2a5a=new AWS['S3']({'accessKeyId':_0x286e8a,'secretAccessKey':_0x1124bb,'region':_0x1bc88e});_0x1a2a5a[_0xb171('0x65')]({'Bucket':_0x56c0ba},function(_0x702f73,_0x2e4ab9){if(_0x702f73){return _0x4020e9(_0x702f73);}else{return _0x7c7b20(_0x2e4ab9);}});});}function uploadFile(_0x59dfda,_0x4fe863,_0x3312f0,_0x167044,_0x69d891,_0xb0a09c){return new Promise(function(_0x6a117,_0x296a38){var _0x231543=new AWS['S3']({'accessKeyId':_0x4fe863,'secretAccessKey':_0x59dfda,'region':_0x3312f0});_0x231543[_0xb171('0x66')]({'Bucket':_0x167044,'Key':_0x69d891,'Body':_0xb0a09c},function(_0x420873,_0x39592a){if(_0x420873){return _0x296a38(_0x420873);}else{return _0x6a117(_0x39592a);}});});}function startTranscribe(_0x3b41fc,_0x3a845a,_0x34f7a9,_0x4039cb,_0x2aea4c,_0x2e129d){return new Promise(function(_0x18ae46,_0x22ee9d){var _0x433fce=new AWS['TranscribeService']({'accessKeyId':_0x3a845a,'secretAccessKey':_0x3b41fc,'region':_0x34f7a9});_0x433fce[_0xb171('0x67')]({'TranscriptionJobName':_0x4039cb,'LanguageCode':_0x2aea4c,'Media':{'MediaFileUri':_0x2e129d}},function(_0x172013,_0x4695dd){if(_0x172013){return _0x22ee9d(_0x172013);}else{return _0x18ae46(_0x4695dd);}});});}function transcribe(_0x3dd33c,_0x375992,_0x226e43,_0x3286f4,_0x38a00e,_0x1ae053,_0x4e99a1){return new Promise(function(_0x45b05f,_0x2901b3){var _0x58fb61={};logger[_0xb171('0x61')](util[_0xb171('0x2d')](_0xb171('0x68'),_0x3dd33c,_0x38a00e));return uploadFile(_0x375992,_0x226e43,_0x3286f4,_0x38a00e,path[_0xb171('0x69')](_0x1ae053),fs[_0xb171('0x6a')](_0x1ae053))[_0xb171('0x25')](function(_0x49ac80){logger['info'](util[_0xb171('0x2d')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3dd33c,_0x38a00e,_0x49ac80[_0xb171('0x6b')]));_0x58fb61['bucket']=_0x49ac80['Bucket'];_0x58fb61[_0xb171('0x6c')]=_0x49ac80[_0xb171('0x6b')];logger[_0xb171('0x61')](util['format'](_0xb171('0x6d'),_0x3dd33c));return startTranscribe(_0x375992,_0x226e43,_0x3286f4,uuidv4(),_0x4e99a1,_0x49ac80[_0xb171('0x6b')]);})[_0xb171('0x25')](function(_0x13bcb1){logger[_0xb171('0x61')](util['format'](_0xb171('0x6e'),_0x3dd33c,_0x13bcb1[_0xb171('0x6f')][_0xb171('0x70')]));_0x58fb61['transcribeName']=_0x13bcb1[_0xb171('0x6f')][_0xb171('0x70')];_0x58fb61['transcribeStatus']=_0x13bcb1[_0xb171('0x6f')]['TranscriptionJobStatus'];return _0x45b05f(_0x58fb61);})[_0xb171('0x40')](function(_0x46acb0){return _0x2901b3(_0x46acb0);});});}exports[_0xb171('0x71')]=function(_0x788276,_0x848e08,_0x1611d2){var _0x12a6ed;var _0xf362de;var _0x4b8ae1;var _0x4d34b6=require('../../components/encryptor');return db[_0xb171('0x3b')][_0xb171('0x72')]({'where':{'id':_0x788276[_0xb171('0x47')]['id']}})[_0xb171('0x25')](function(_0x2e983a){if(_0x2e983a){var _0x24e4e9=util[_0xb171('0x2d')](_0xb171('0x5e'),_0x2e983a[_0xb171('0x4b')]);if(fs[_0xb171('0x4c')](_0x24e4e9)){cypher=!![];return _0x4d34b6['decryptFile'](_0x24e4e9,_0x2e983a[_0xb171('0x4b')],config[_0xb171('0x4e')]['recording'])[_0xb171('0x25')](function(){return _0x2e983a;});}return _0x2e983a;}})['then'](function(_0x515e30){if(!_0x515e30){throw new db[(_0xb171('0x50'))]['ValidationError'](_0xb171('0x73'));}_0xf362de=_0x515e30;return db[_0xb171('0x74')][_0xb171('0x72')]({'where':{'id':0x1}});})[_0xb171('0x25')](handleEntityNotFound(_0x848e08,null))['then'](function(_0x30ae28){if(_0x30ae28){_0x12a6ed=_0x30ae28;if(!_0x12a6ed[_0xb171('0x75')]||!_0x12a6ed[_0xb171('0x76')]||!_0x12a6ed[_0xb171('0x77')]||!_0x12a6ed[_0xb171('0x78')]||!_0x12a6ed['bucket']){throw new db[(_0xb171('0x50'))][(_0xb171('0x51'))](_0xb171('0x79'));}if(_0x788276[_0xb171('0x45')]['runSentiment']&&(!_0x12a6ed[_0xb171('0x7a')]||!_0x12a6ed[_0xb171('0x7b')]||!_0x12a6ed[_0xb171('0x7c')]||!_0x12a6ed[_0xb171('0x78')]||!_0x12a6ed[_0xb171('0x7d')])){throw new db['Sequelize'][(_0xb171('0x51'))]('Sentiment\x20Analysis\x20not\x20configured');}return db['CloudProvider'][_0xb171('0x72')]({'where':{'id':_0x12a6ed[_0xb171('0x76')]}});}})[_0xb171('0x25')](function(_0x4c739b){if(!_0x4c739b){throw new db['Sequelize'][(_0xb171('0x51'))](_0xb171('0x7e'));}if(!_0x4c739b[_0xb171('0x7f')]||!_0x4c739b[_0xb171('0x80')]){throw new db[(_0xb171('0x50'))][(_0xb171('0x51'))](_0xb171('0x81'));}_0x4b8ae1=_0x4c739b;return getBucketslist(_0x4b8ae1[_0xb171('0x7f')],_0x4b8ae1[_0xb171('0x80')],_0x12a6ed['transcribeRegion']);})['then'](function(_0x5283e6){if(_0x5283e6&&_0x5283e6['Buckets']){var _0x4074a4=_['find'](_0x5283e6['Buckets'],function(_0x598951){return _0x598951['Name']===_0x12a6ed['bucket'];});if(!_0x4074a4){logger[_0xb171('0x61')](util[_0xb171('0x2d')](_0xb171('0x82'),_0x788276['params']['id'],_0x12a6ed[_0xb171('0x7d')]));return createBucket(_0x4b8ae1['data1'],_0x4b8ae1[_0xb171('0x80')],_0x12a6ed[_0xb171('0x77')],_0x12a6ed[_0xb171('0x7d')]);}logger[_0xb171('0x61')](util[_0xb171('0x2d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x788276[_0xb171('0x47')]['id'],_0x12a6ed[_0xb171('0x7d')]));return;}})[_0xb171('0x25')](function(_0x1fbb6e){if(_0xf362de[_0xb171('0x83')]===_0xb171('0x84')){return transcribe(_0x788276[_0xb171('0x47')]['id'],_0x4b8ae1[_0xb171('0x7f')],_0x4b8ae1[_0xb171('0x80')],_0x12a6ed[_0xb171('0x77')],_0x12a6ed[_0xb171('0x7d')],_0xf362de['value'],_0x12a6ed[_0xb171('0x78')]);}else{logger['info'](util[_0xb171('0x2d')](_0xb171('0x85'),_0x788276[_0xb171('0x47')]['id']));return{'transcribeStatus':_0xb171('0x86')};}})[_0xb171('0x25')](function(_0x1ad971){if(_0x1ad971){_0x1ad971['tempSentiment']=_0x788276['body']['runSentiment'];return _0xf362de[_0xb171('0x87')](_0x1ad971);}})[_0xb171('0x25')](respondWithResult(_0x848e08,null))[_0xb171('0x40')](handleError(_0x848e08,null));};function writeFile(_0x4c87ce,_0xb737b7){return new Promise(function(_0x1e9ac8,_0x3e72d6){fs[_0xb171('0x88')](_0xb737b7,_0x4c87ce,function(_0x71ddff,_0x3b6306){if(_0x71ddff){return _0x3e72d6(_0x71ddff);}else{return _0x1e9ac8(_0x3b6306);}});});}exports['downloadTranscribe']=function(_0x38d734,_0xaff954,_0x1a1239){return db[_0xb171('0x3b')]['findOne']({'where':{'id':_0x38d734['params']['id']}})[_0xb171('0x25')](handleEntityNotFound(_0xaff954))[_0xb171('0x25')](function(_0x4fd176){if(_0x4fd176&&_0x4fd176[_0xb171('0x89')]){var _0x43b37f=_0x4fd176['fileText'];var _0x4e754c=config[_0xb171('0x8a')]+'/server/files/transcribes/transcribe_'+_0x4fd176['id']+_0xb171('0x8b');if(fs['existsSync'](_0x4e754c)){return _0x4e754c;}return writeFile(_0x43b37f,_0x4e754c)['then'](function(){return _0x4e754c;});}else{throw new db[(_0xb171('0x50'))][(_0xb171('0x51'))](_0xb171('0x8c'));}})['then'](function(_0x4754c4){return _0xaff954[_0xb171('0x49')](_0x4754c4);})[_0xb171('0x40')](handleError(_0xaff954));}; \ No newline at end of file +var _0x7e85=['downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','download','../../components/encryptor','uniqueid','existsSync','secrets','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','value','%s.cypher','decryptFile','recording','Sequelize','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','upload','TranscribeService','startTranscriptionJob','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','transcribeRegion','Buckets','Name','bucket','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','updateAttributes','writeFile'];(function(_0x28220e,_0xb9cf04){var _0x5ac8a8=function(_0x3cdb20){while(--_0x3cdb20){_0x28220e['push'](_0x28220e['shift']());}};_0x5ac8a8(++_0xb9cf04);}(_0x7e85,0x1d7));var _0x57e8=function(_0x369ee0,_0x57a15c){_0x369ee0=_0x369ee0-0x0;var _0x493a06=_0x7e85[_0x369ee0];return _0x493a06;};'use strict';var emlformat=require(_0x57e8('0x0'));var rimraf=require(_0x57e8('0x1'));var zipdir=require(_0x57e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57e8('0x3'));var moment=require(_0x57e8('0x4'));var BPromise=require(_0x57e8('0x5'));var Mustache=require('mustache');var util=require(_0x57e8('0x6'));var path=require(_0x57e8('0x7'));var sox=require(_0x57e8('0x8'));var csv=require(_0x57e8('0x9'));var ejs=require(_0x57e8('0xa'));var fs=require('fs');var fs_extra=require(_0x57e8('0xb'));var _=require(_0x57e8('0xc'));var squel=require(_0x57e8('0xd'));var crypto=require(_0x57e8('0xe'));var jsforce=require(_0x57e8('0xf'));var deskjs=require(_0x57e8('0x10'));var toCsv=require(_0x57e8('0x9'));var querystring=require(_0x57e8('0x11'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x57e8('0x12'));var Redis=require(_0x57e8('0x13'));var authService=require(_0x57e8('0x14'));var qs=require(_0x57e8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57e8('0x16'));var logger=require(_0x57e8('0x17'))(_0x57e8('0x18'));var utils=require(_0x57e8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x57e8('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1987,_0x17b206){_0x17b206=_0x17b206||0xcc;return function(_0x11a52c){if(_0x11a52c){return _0x2b1987['sendStatus'](_0x17b206);}return _0x2b1987[_0x57e8('0x1b')](_0x17b206)[_0x57e8('0x1c')]();};}function respondWithResult(_0x437d30,_0x485f8f){_0x485f8f=_0x485f8f||0xc8;return function(_0x2c177b){if(_0x2c177b){return _0x437d30[_0x57e8('0x1b')](_0x485f8f)[_0x57e8('0x1d')](_0x2c177b);}};}function respondWithFilteredResult(_0x1c730c,_0x487a0e){return function(_0x46c3e8){if(_0x46c3e8){var _0x372a91=typeof _0x487a0e[_0x57e8('0x1e')]==='undefined'&&typeof _0x487a0e['limit']===_0x57e8('0x1f');var _0x34e83b=_0x46c3e8[_0x57e8('0x20')];var _0x576c98=_0x372a91?0x0:_0x487a0e[_0x57e8('0x1e')];var _0x18fb9c=_0x372a91?_0x46c3e8[_0x57e8('0x20')]:_0x487a0e[_0x57e8('0x1e')]+_0x487a0e[_0x57e8('0x21')];var _0x3dc697;if(_0x18fb9c>=_0x34e83b){_0x18fb9c=_0x34e83b;_0x3dc697=0xc8;}else{_0x3dc697=0xce;}_0x1c730c[_0x57e8('0x1b')](_0x3dc697);return _0x1c730c[_0x57e8('0x22')](_0x57e8('0x23'),_0x576c98+'-'+_0x18fb9c+'/'+_0x34e83b)[_0x57e8('0x1d')](_0x46c3e8);}return null;};}function patchUpdates(_0x51a57f){return function(_0x458c70){try{jsonpatch[_0x57e8('0x24')](_0x458c70,_0x51a57f,!![]);}catch(_0x52a978){return BPromise[_0x57e8('0x25')](_0x52a978);}return _0x458c70[_0x57e8('0x26')]();};}function saveUpdates(_0x1170cc,_0x2516ec){return function(_0x21600a){if(_0x21600a){return _0x21600a[_0x57e8('0x27')](_0x1170cc)[_0x57e8('0x28')](function(_0x5bb44e){return _0x5bb44e;});}return null;};}function removeEntity(_0x17f2df,_0x2266d5){return function(_0x5be921){if(_0x5be921){return _0x5be921['destroy']()[_0x57e8('0x28')](function(){_0x17f2df['status'](0xcc)[_0x57e8('0x1c')]();});}};}function handleEntityNotFound(_0x1204fa,_0x2b35cd){return function(_0xabef32){if(!_0xabef32){_0x1204fa['sendStatus'](0x194);}return _0xabef32;};}function handleError(_0x59e7bf,_0x4f118b){_0x4f118b=_0x4f118b||0x1f4;return function(_0x411748){logger[_0x57e8('0x29')](_0x411748[_0x57e8('0x2a')]);if(_0x411748[_0x57e8('0x2b')]){delete _0x411748[_0x57e8('0x2b')];}_0x59e7bf[_0x57e8('0x1b')](_0x4f118b)['send'](_0x411748);};}exports['index']=function(_0x5eb66f,_0x93ffb9){var _0x6ec86e={},_0xc20d01={},_0x52e522={'count':0x0,'rows':[]};var _0xc8b5fc=_[_0x57e8('0x2c')](db[_0x57e8('0x2d')][_0x57e8('0x2e')],function(_0x4b2b2f){return{'name':_0x4b2b2f[_0x57e8('0x2f')],'type':_0x4b2b2f[_0x57e8('0x30')]['key']};});_0xc20d01[_0x57e8('0x31')]=_[_0x57e8('0x32')](_[_0x57e8('0x2c')](_0xc8b5fc,_0x57e8('0x2b')),[_0x57e8('0x33')]);_0xc20d01[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x5eb66f[_0x57e8('0x34')]);_0xc20d01[_0x57e8('0x36')]=_[_0x57e8('0x37')](_0xc20d01['model'],_0xc20d01[_0x57e8('0x34')]);_0x6ec86e[_0x57e8('0x38')]=_[_0x57e8('0x37')](_0xc20d01[_0x57e8('0x31')],qs[_0x57e8('0x39')](_0x5eb66f[_0x57e8('0x34')][_0x57e8('0x39')]));_0x6ec86e[_0x57e8('0x38')]=_0x6ec86e[_0x57e8('0x38')][_0x57e8('0x3a')]?_0x6ec86e[_0x57e8('0x38')]:_0xc20d01[_0x57e8('0x31')];if(!_0x5eb66f[_0x57e8('0x34')]['hasOwnProperty'](_0x57e8('0x3b'))){_0x6ec86e['limit']=qs['limit'](_0x5eb66f[_0x57e8('0x34')]['limit']);_0x6ec86e[_0x57e8('0x1e')]=qs[_0x57e8('0x1e')](_0x5eb66f[_0x57e8('0x34')][_0x57e8('0x1e')]);}_0x6ec86e[_0x57e8('0x3c')]=qs[_0x57e8('0x3d')](_0x5eb66f[_0x57e8('0x34')][_0x57e8('0x3d')]);_0x6ec86e[_0x57e8('0x3e')]=qs[_0x57e8('0x36')](_[_0x57e8('0x3f')](_0x5eb66f['query'],_0xc20d01[_0x57e8('0x36')]),_0xc8b5fc);if(_0x5eb66f['query'][_0x57e8('0x40')]){_0x6ec86e['where']=_[_0x57e8('0x41')](_0x6ec86e[_0x57e8('0x3e')],{'$or':_[_0x57e8('0x2c')](_0xc8b5fc,function(_0x53a9b8){if(_0x53a9b8[_0x57e8('0x30')]!==_0x57e8('0x42')){var _0x10efdd={};_0x10efdd[_0x53a9b8[_0x57e8('0x2b')]]={'$like':'%'+_0x5eb66f[_0x57e8('0x34')][_0x57e8('0x40')]+'%'};return _0x10efdd;}})});}_0x6ec86e=_['merge']({},_0x6ec86e,_0x5eb66f[_0x57e8('0x43')]);var _0x15e402={'where':_0x6ec86e['where']};return db[_0x57e8('0x2d')][_0x57e8('0x20')](_0x15e402)[_0x57e8('0x28')](function(_0x1289a5){_0x52e522['count']=_0x1289a5;if(_0x5eb66f[_0x57e8('0x34')][_0x57e8('0x44')]){_0x6ec86e[_0x57e8('0x45')]=[{'all':!![]}];}return db[_0x57e8('0x2d')][_0x57e8('0x46')](_0x6ec86e);})['then'](function(_0x52b557){_0x52e522[_0x57e8('0x47')]=_0x52b557;return _0x52e522;})[_0x57e8('0x28')](respondWithFilteredResult(_0x93ffb9,_0x6ec86e))[_0x57e8('0x48')](handleError(_0x93ffb9,null));};exports[_0x57e8('0x49')]=function(_0x1e70fd,_0x377df3){var _0x1f5dfd={'raw':![],'where':{'id':_0x1e70fd[_0x57e8('0x4a')]['id']}},_0x292968={};_0x292968[_0x57e8('0x31')]=_[_0x57e8('0x35')](db[_0x57e8('0x2d')][_0x57e8('0x2e')]);_0x292968[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x1e70fd[_0x57e8('0x34')]);_0x292968[_0x57e8('0x36')]=_['intersection'](_0x292968[_0x57e8('0x31')],_0x292968[_0x57e8('0x34')]);_0x1f5dfd[_0x57e8('0x38')]=_[_0x57e8('0x37')](_0x292968[_0x57e8('0x31')],qs[_0x57e8('0x39')](_0x1e70fd['query'][_0x57e8('0x39')]));_0x1f5dfd[_0x57e8('0x38')]=_0x1f5dfd['attributes']['length']?_0x1f5dfd[_0x57e8('0x38')]:_0x292968['model'];if(_0x1e70fd['query'][_0x57e8('0x44')]){_0x1f5dfd[_0x57e8('0x45')]=[{'all':!![]}];}_0x1f5dfd=_[_0x57e8('0x41')]({},_0x1f5dfd,_0x1e70fd[_0x57e8('0x43')]);return db[_0x57e8('0x2d')]['find'](_0x1f5dfd)[_0x57e8('0x28')](handleEntityNotFound(_0x377df3,null))[_0x57e8('0x28')](respondWithResult(_0x377df3,null))[_0x57e8('0x48')](handleError(_0x377df3,null));};exports[_0x57e8('0x4b')]=function(_0x1ad00d,_0x426b1d){return db['VoiceRecording'][_0x57e8('0x4b')](_0x1ad00d[_0x57e8('0x4c')],{})[_0x57e8('0x28')](respondWithResult(_0x426b1d,0xc9))[_0x57e8('0x48')](handleError(_0x426b1d,null));};exports[_0x57e8('0x27')]=function(_0x5e04a3,_0x15a111){if(_0x5e04a3[_0x57e8('0x4c')]['id']){delete _0x5e04a3[_0x57e8('0x4c')]['id'];}return db[_0x57e8('0x2d')][_0x57e8('0x4d')]({'where':{'id':_0x5e04a3[_0x57e8('0x4a')]['id']}})[_0x57e8('0x28')](handleEntityNotFound(_0x15a111,null))[_0x57e8('0x28')](saveUpdates(_0x5e04a3[_0x57e8('0x4c')],null))[_0x57e8('0x28')](respondWithResult(_0x15a111,null))[_0x57e8('0x48')](handleError(_0x15a111,null));};exports[_0x57e8('0x4e')]=function(_0x320e9d,_0x57b5b0){return db[_0x57e8('0x2d')][_0x57e8('0x4e')]()[_0x57e8('0x28')](respondWithResult(_0x57b5b0,null))[_0x57e8('0x48')](handleError(_0x57b5b0,null));};exports[_0x57e8('0x4f')]=function(_0xce90b4,_0x3b0566,_0x46f50a){var _0x2f759e=require(_0x57e8('0x50'));var _0x1bf03f=![];var _0x53e696={};if(_0xce90b4[_0x57e8('0x34')][_0x57e8('0x30')]&&_0xce90b4[_0x57e8('0x34')][_0x57e8('0x30')]===_0x57e8('0x51')){_0x53e696[_0x57e8('0x51')]=_0xce90b4[_0x57e8('0x4a')]['id'];}else{_0x53e696['id']=_0xce90b4[_0x57e8('0x4a')]['id'];}return db[_0x57e8('0x2d')][_0x57e8('0x4d')]({'where':_0x53e696,'attributes':['id','value'],'raw':!![]})[_0x57e8('0x28')](handleEntityNotFound(_0x3b0566,null))[_0x57e8('0x28')](function(_0x3c1901){if(_0x3c1901){var _0x6031ba=_0x3c1901['value'];var _0x1fe6e6=util[_0x57e8('0x33')]('%s.cypher',_0x6031ba);if(fs[_0x57e8('0x52')](_0x1fe6e6)){_0x1bf03f=!![];return _0x2f759e['decryptFile'](_0x1fe6e6,_0x6031ba,config[_0x57e8('0x53')]['recording'])['then'](function(){return _0x3c1901;});}return _0x3c1901;}})[_0x57e8('0x28')](function(_0x2a7461){if(_0x2a7461){var _0x80c0a4=_0x2a7461['value'];if(!fs[_0x57e8('0x52')](_0x80c0a4)){throw new db['Sequelize'][(_0x57e8('0x54'))](_0x57e8('0x55'));}if(_0x2a7461['filename']){return _0x3b0566[_0x57e8('0x4f')](_0x80c0a4,_0x2a7461[_0x57e8('0x56')]+path[_0x57e8('0x57')](_0x80c0a4),function(){if(_0x1bf03f){fs['unlink'](_0x80c0a4);}});}else{return _0x3b0566[_0x57e8('0x4f')](_0x80c0a4,function(_0x187b6e){if(_0x1bf03f){fs[_0x57e8('0x58')](_0x80c0a4);}});}}})[_0x57e8('0x48')](function(_0x3e5a02){if(_0x3e5a02[_0x57e8('0x59')]===_0x57e8('0x55')){_0x3b0566[_0x57e8('0x1b')](0x194)[_0x57e8('0x5a')](_0x57e8('0x5b'));}else{return handleError(_0x3b0566,null);}});};exports[_0x57e8('0x5c')]=function(_0x516085,_0x5471b2,_0x43ff13){var _0x3a221e=require(_0x57e8('0x50'));var _0x35d7dd=![];var _0x43a6e5={'$and':[db[_0x57e8('0x5d')][_0x57e8('0x3e')](db[_0x57e8('0x5d')]['fn'](_0x57e8('0x5e'),db['sequelize']['col'](_0x57e8('0x51'))),_0x516085[_0x57e8('0x34')][_0x57e8('0x5f')])]};if(_0x516085[_0x57e8('0x34')][_0x57e8('0x30')]&&_0x516085[_0x57e8('0x34')][_0x57e8('0x30')]==='uniqueid'){_0x43a6e5[_0x57e8('0x60')]['push']({'uniqueid':_0x516085[_0x57e8('0x4a')]['id']});}else{_0x43a6e5['$and'][_0x57e8('0x61')]({'id':_0x516085[_0x57e8('0x4a')]['id']});}return db[_0x57e8('0x2d')][_0x57e8('0x4d')]({'where':_0x43a6e5,'attributes':['id',_0x57e8('0x62')],'raw':!![]})[_0x57e8('0x28')](handleEntityNotFound(_0x5471b2,null))['then'](function(_0x260632){if(_0x260632){var _0x5c5e5e=util[_0x57e8('0x33')](_0x57e8('0x63'),_0x260632[_0x57e8('0x62')]);if(fs['existsSync'](_0x5c5e5e)){_0x35d7dd=!![];return _0x3a221e[_0x57e8('0x64')](_0x5c5e5e,_0x260632[_0x57e8('0x62')],config[_0x57e8('0x53')][_0x57e8('0x65')])[_0x57e8('0x28')](function(){return _0x260632;});}return _0x260632;}})[_0x57e8('0x28')](function(_0x20bb18){if(_0x20bb18){if(!fs[_0x57e8('0x52')](_0x20bb18[_0x57e8('0x62')])){throw new db[(_0x57e8('0x66'))][(_0x57e8('0x54'))](_0x57e8('0x55'));}if(_0x20bb18[_0x57e8('0x56')]){return _0x5471b2['download'](_0x20bb18[_0x57e8('0x62')],_0x20bb18['filename']+path[_0x57e8('0x57')](_0x20bb18[_0x57e8('0x62')]),function(){if(_0x35d7dd){fs['unlink'](_0x20bb18[_0x57e8('0x62')]);}});}else{return _0x5471b2[_0x57e8('0x4f')](_0x20bb18[_0x57e8('0x62')],function(_0xf19544){if(_0x35d7dd){fs[_0x57e8('0x58')](_0x20bb18[_0x57e8('0x62')]);}});}}})['catch'](handleError(_0x5471b2,null));};exports[_0x57e8('0x67')]=function(_0x13b866,_0x805c6f){return db[_0x57e8('0x2d')][_0x57e8('0x4d')]({'where':{'id':_0x13b866[_0x57e8('0x4a')]['id']}})[_0x57e8('0x28')](function(_0x23d131){if(_[_0x57e8('0x68')](_0x23d131)){throw new ReferenceError(_0x57e8('0x69'));}return _0x23d131;})[_0x57e8('0x28')](function(_0xbf540f){var _0xb813d1=_0xbf540f[_0x57e8('0x62')];logger[_0x57e8('0x6a')](_0x57e8('0x6b'),_0xb813d1);if(!_[_0x57e8('0x68')](_0xbf540f[_0x57e8('0x62')])&&fs['existsSync'](_0xb813d1)){logger[_0x57e8('0x6a')](_0x57e8('0x6c')+_0xb813d1+_0x57e8('0x6d'));fs[_0x57e8('0x6e')](_0xb813d1);}_0xb813d1=_0xb813d1+_0x57e8('0x6f');if(!_['isNil'](_0xbf540f['value'])&&fs[_0x57e8('0x52')](_0xb813d1)){logger['info'](_0x57e8('0x6c')+_0xb813d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x57e8('0x6e')](_0xb813d1);}return _0xbf540f;})[_0x57e8('0x28')](function(_0x2ef7c1){if(!_0x2ef7c1)throw new InternalError();return _0x2ef7c1[_0x57e8('0x67')]();})[_0x57e8('0x28')](function(){_0x805c6f[_0x57e8('0x1b')](0xcc)['end']();})[_0x57e8('0x48')](handleError(_0x805c6f,null));};function getBucketslist(_0x2b5b4d,_0x5c4f3b,_0x4d6da0){return new Promise(function(_0x443696,_0x16acd8){var _0x51f88c=new AWS['S3']({'accessKeyId':_0x5c4f3b,'secretAccessKey':_0x2b5b4d,'region':_0x4d6da0});_0x51f88c['listBuckets']({},function(_0x7cca9e,_0xedad93){if(_0x7cca9e){return _0x16acd8(_0x7cca9e);}else{return _0x443696(_0xedad93);}});});}function createBucket(_0x16f941,_0x26ca0a,_0x7a64cc,_0x4db8da){return new Promise(function(_0x5bc164,_0x2a0610){var _0x2ec1d5=new AWS['S3']({'accessKeyId':_0x26ca0a,'secretAccessKey':_0x16f941,'region':_0x7a64cc});_0x2ec1d5['createBucket']({'Bucket':_0x4db8da},function(_0x134c5e,_0x39cf5b){if(_0x134c5e){return _0x2a0610(_0x134c5e);}else{return _0x5bc164(_0x39cf5b);}});});}function uploadFile(_0x34791a,_0x3a50ff,_0x6cf13a,_0xaadfeb,_0x56d2e0,_0x22c3d2){return new Promise(function(_0x24d2ce,_0x121324){var _0x4fdc79=new AWS['S3']({'accessKeyId':_0x3a50ff,'secretAccessKey':_0x34791a,'region':_0x6cf13a});_0x4fdc79[_0x57e8('0x70')]({'Bucket':_0xaadfeb,'Key':_0x56d2e0,'Body':_0x22c3d2},function(_0xa6f655,_0x5aa7ae){if(_0xa6f655){return _0x121324(_0xa6f655);}else{return _0x24d2ce(_0x5aa7ae);}});});}function startTranscribe(_0x130461,_0x403d02,_0x38ce9a,_0x5d721d,_0x29c25e,_0x2f0dc6){return new Promise(function(_0x3a7cc3,_0x3eb572){var _0x16796d=new AWS[(_0x57e8('0x71'))]({'accessKeyId':_0x403d02,'secretAccessKey':_0x130461,'region':_0x38ce9a});_0x16796d[_0x57e8('0x72')]({'TranscriptionJobName':_0x5d721d,'LanguageCode':_0x29c25e,'Media':{'MediaFileUri':_0x2f0dc6}},function(_0x53d82a,_0x2ed848){if(_0x53d82a){return _0x3eb572(_0x53d82a);}else{return _0x3a7cc3(_0x2ed848);}});});}function transcribe(_0x3ba316,_0x195b96,_0x5b256d,_0x2033e2,_0x22e0cc,_0xa6dbc3,_0x29dd87){return new Promise(function(_0x587e75,_0x5b8756){var _0x3c957e={};logger['info'](util[_0x57e8('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x3ba316,_0x22e0cc));return uploadFile(_0x195b96,_0x5b256d,_0x2033e2,_0x22e0cc,path['basename'](_0xa6dbc3),fs['readFileSync'](_0xa6dbc3))[_0x57e8('0x28')](function(_0x351873){logger[_0x57e8('0x6a')](util[_0x57e8('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x3ba316,_0x22e0cc,_0x351873[_0x57e8('0x73')]));_0x3c957e['bucket']=_0x351873[_0x57e8('0x74')];_0x3c957e[_0x57e8('0x75')]=_0x351873[_0x57e8('0x73')];logger[_0x57e8('0x6a')](util[_0x57e8('0x33')](_0x57e8('0x76'),_0x3ba316));return startTranscribe(_0x195b96,_0x5b256d,_0x2033e2,uuidv4(),_0x29dd87,_0x351873[_0x57e8('0x73')]);})[_0x57e8('0x28')](function(_0x324f9f){logger['info'](util[_0x57e8('0x33')](_0x57e8('0x77'),_0x3ba316,_0x324f9f['TranscriptionJob']['TranscriptionJobName']));_0x3c957e[_0x57e8('0x78')]=_0x324f9f[_0x57e8('0x79')][_0x57e8('0x7a')];_0x3c957e[_0x57e8('0x7b')]=_0x324f9f['TranscriptionJob'][_0x57e8('0x7c')];return _0x587e75(_0x3c957e);})['catch'](function(_0x267b16){return _0x5b8756(_0x267b16);});});}exports[_0x57e8('0x7d')]=function(_0x2c51bf,_0x8ed347,_0x246169){var _0x37056d;var _0x5e216a;var _0x3dc435;var _0x53b3fe=require('../../components/encryptor');return db[_0x57e8('0x2d')][_0x57e8('0x7e')]({'where':{'id':_0x2c51bf[_0x57e8('0x4a')]['id']}})[_0x57e8('0x28')](function(_0x47244b){if(_0x47244b){var _0x383918=util[_0x57e8('0x33')]('%s.cypher',_0x47244b['value']);if(fs[_0x57e8('0x52')](_0x383918)){cypher=!![];return _0x53b3fe[_0x57e8('0x64')](_0x383918,_0x47244b['value'],config[_0x57e8('0x53')][_0x57e8('0x65')])['then'](function(){return _0x47244b;});}return _0x47244b;}})['then'](function(_0x2545f3){if(!_0x2545f3){throw new db['Sequelize'][(_0x57e8('0x54'))](_0x57e8('0x7f'));}_0x5e216a=_0x2545f3;return db['Setting'][_0x57e8('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x8ed347,null))[_0x57e8('0x28')](function(_0xa6c538){if(_0xa6c538){_0x37056d=_0xa6c538;if(!_0x37056d['transcribe']||!_0x37056d[_0x57e8('0x80')]||!_0x37056d['transcribeRegion']||!_0x37056d[_0x57e8('0x81')]||!_0x37056d['bucket']){throw new db['Sequelize'][(_0x57e8('0x54'))](_0x57e8('0x82'));}if(_0x2c51bf['body'][_0x57e8('0x83')]&&(!_0x37056d[_0x57e8('0x84')]||!_0x37056d[_0x57e8('0x85')]||!_0x37056d[_0x57e8('0x86')]||!_0x37056d['language']||!_0x37056d['bucket'])){throw new db['Sequelize'][(_0x57e8('0x54'))](_0x57e8('0x87'));}return db[_0x57e8('0x88')][_0x57e8('0x7e')]({'where':{'id':_0x37056d['transcribeAccountId']}});}})[_0x57e8('0x28')](function(_0x11e19d){if(!_0x11e19d){throw new db['Sequelize'][(_0x57e8('0x54'))](_0x57e8('0x89'));}if(!_0x11e19d[_0x57e8('0x8a')]||!_0x11e19d[_0x57e8('0x8b')]){throw new db['Sequelize'][(_0x57e8('0x54'))]('Cloud\x20Provider\x20not\x20configured');}_0x3dc435=_0x11e19d;return getBucketslist(_0x3dc435[_0x57e8('0x8a')],_0x3dc435[_0x57e8('0x8b')],_0x37056d[_0x57e8('0x8c')]);})[_0x57e8('0x28')](function(_0x222678){if(_0x222678&&_0x222678[_0x57e8('0x8d')]){var _0x2c78a8=_[_0x57e8('0x4d')](_0x222678[_0x57e8('0x8d')],function(_0x21d24a){return _0x21d24a[_0x57e8('0x8e')]===_0x37056d[_0x57e8('0x8f')];});if(!_0x2c78a8){logger['info'](util['format'](_0x57e8('0x90'),_0x2c51bf[_0x57e8('0x4a')]['id'],_0x37056d['bucket']));return createBucket(_0x3dc435[_0x57e8('0x8a')],_0x3dc435[_0x57e8('0x8b')],_0x37056d[_0x57e8('0x8c')],_0x37056d[_0x57e8('0x8f')]);}logger[_0x57e8('0x6a')](util[_0x57e8('0x33')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x2c51bf[_0x57e8('0x4a')]['id'],_0x37056d[_0x57e8('0x8f')]));return;}})[_0x57e8('0x28')](function(_0x46fd26){if(_0x5e216a[_0x57e8('0x7b')]===_0x57e8('0x91')){return transcribe(_0x2c51bf[_0x57e8('0x4a')]['id'],_0x3dc435[_0x57e8('0x8a')],_0x3dc435[_0x57e8('0x8b')],_0x37056d['transcribeRegion'],_0x37056d[_0x57e8('0x8f')],_0x5e216a[_0x57e8('0x62')],_0x37056d[_0x57e8('0x81')]);}else{logger['info'](util[_0x57e8('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2c51bf[_0x57e8('0x4a')]['id']));return{'transcribeStatus':_0x57e8('0x92')};}})[_0x57e8('0x28')](function(_0x4d8c99){if(_0x4d8c99){_0x4d8c99['tempSentiment']=_0x2c51bf['body'][_0x57e8('0x83')];return _0x5e216a[_0x57e8('0x93')](_0x4d8c99);}})[_0x57e8('0x28')](respondWithResult(_0x8ed347,null))[_0x57e8('0x48')](handleError(_0x8ed347,null));};function writeFile(_0x11397c,_0x3ce811){return new Promise(function(_0x27093c,_0x1de846){fs[_0x57e8('0x94')](_0x3ce811,_0x11397c,function(_0x3b32c4,_0x36c9d9){if(_0x3b32c4){return _0x1de846(_0x3b32c4);}else{return _0x27093c(_0x36c9d9);}});});}exports[_0x57e8('0x95')]=function(_0x2e3c2c,_0x37434c,_0x5b3de7){return db[_0x57e8('0x2d')]['findOne']({'where':{'id':_0x2e3c2c['params']['id']}})[_0x57e8('0x28')](handleEntityNotFound(_0x37434c))[_0x57e8('0x28')](function(_0x339a45){if(_0x339a45&&_0x339a45[_0x57e8('0x96')]){var _0x2b1090=_0x339a45[_0x57e8('0x96')];var _0x2fae97=config[_0x57e8('0x97')]+_0x57e8('0x98')+_0x339a45['id']+_0x57e8('0x99');if(fs[_0x57e8('0x52')](_0x2fae97)){return _0x2fae97;}return writeFile(_0x2b1090,_0x2fae97)['then'](function(){return _0x2fae97;});}else{throw new db[(_0x57e8('0x66'))][(_0x57e8('0x54'))](_0x57e8('0x9a'));}})[_0x57e8('0x28')](function(_0x20fad9){return _0x37434c['download'](_0x20fad9);})[_0x57e8('0x48')](handleError(_0x37434c));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 1a36af5..95b0806 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 _0x8a42=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0xe8e430,_0x5d2e38){var _0x11739f=function(_0xae5cbf){while(--_0xae5cbf){_0xe8e430['push'](_0xe8e430['shift']());}};_0x11739f(++_0x5d2e38);}(_0x8a42,0xe3));var _0x28a4=function(_0x5acc92,_0x274b74){_0x5acc92=_0x5acc92-0x0;var _0x3217a1=_0x8a42[_0x5acc92];return _0x3217a1;};'use strict';var _=require(_0x28a4('0x0'));var util=require(_0x28a4('0x1'));var logger=require(_0x28a4('0x2'))('api');var moment=require(_0x28a4('0x3'));var BPromise=require('bluebird');var rp=require(_0x28a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28a4('0x5'));var config=require(_0x28a4('0x6'));var attributes=require(_0x28a4('0x7'));module[_0x28a4('0x8')]=function(_0x3a841f,_0x222d7b){return _0x3a841f[_0x28a4('0x9')](_0x28a4('0xa'),attributes,{'tableName':_0x28a4('0xb'),'paranoid':![],'indexes':[{'name':_0x28a4('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bd2=['exports','define','voice_recordings','uniqueid','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x152f6d,_0x2d4a67){var _0x3959a6=function(_0x56aeed){while(--_0x56aeed){_0x152f6d['push'](_0x152f6d['shift']());}};_0x3959a6(++_0x2d4a67);}(_0x6bd2,0x10c));var _0x26bd=function(_0x3604cb,_0x1cd5d5){_0x3604cb=_0x3604cb-0x0;var _0x6d6f5a=_0x6bd2[_0x3604cb];return _0x6d6f5a;};'use strict';var _=require(_0x26bd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x26bd('0x1'));var moment=require('moment');var BPromise=require(_0x26bd('0x2'));var rp=require(_0x26bd('0x3'));var fs=require('fs');var path=require(_0x26bd('0x4'));var rimraf=require(_0x26bd('0x5'));var config=require(_0x26bd('0x6'));var attributes=require(_0x26bd('0x7'));module[_0x26bd('0x8')]=function(_0x5444b4,_0xac0a4f){return _0x5444b4[_0x26bd('0x9')]('VoiceRecording',attributes,{'tableName':_0x26bd('0xa'),'paranoid':![],'indexes':[{'name':_0x26bd('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b469178..828dedd 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 _0x5fdc=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0x5fdc,0x127));var _0xc5fd=function(_0xb5288f,_0x539c9b){_0xb5288f=_0xb5288f-0x0;var _0x346771=_0x5fdc[_0xb5288f];return _0x346771;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['update'](_0x27f611[_0xc5fd('0x1b')],{'raw':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f611[_0xc5fd('0x1c')]?_0x27f611['options'][_0xc5fd('0x1e')]||null:null,'attributes':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1f')]||null:null,'limit':_0x27f611['options']?_0x27f611['options'][_0xc5fd('0x20')]||null:null})[_0xc5fd('0xf')](function(_0x3d7211){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')]('UpdateVoiceRecording',_0x27f611,JSON[_0xc5fd('0x13')](_0x3d7211));_0x2ee392(_0x3d7211);})[_0xc5fd('0x21')](function(_0x1a5174){logger[_0xc5fd('0x14')](_0xc5fd('0x19'),_0x1a5174[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x1a5174['message']));});});};exports[_0xc5fd('0x22')]=function(_0x48cd1d){var _0x2ee700=this;return new Promise(function(_0x231368,_0x44681d){var _0x2bee22=require('../../components/encryptor');var _0x176313;return db[_0xc5fd('0x23')][_0xc5fd('0x24')]({'attributes':['id',_0xc5fd('0x25')],'where':{'id':0x1},'raw':!![]})[_0xc5fd('0xf')](function(_0x209975){_0x176313=_0x209975;return db['VoiceRecording'][_0xc5fd('0x26')](_0x48cd1d['body']);})['then'](function(_0x12a962){if(_0x176313[_0xc5fd('0x25')]&&fs[_0xc5fd('0x27')](_0x12a962[_0xc5fd('0x28')])){var _0x7693c4=util[_0xc5fd('0x29')](_0xc5fd('0x2a'),_0x12a962[_0xc5fd('0x28')]);return _0x2bee22['encryptFile'](_0x12a962[_0xc5fd('0x28')],_0x7693c4,config[_0xc5fd('0x2b')][_0xc5fd('0x2c')])[_0xc5fd('0xf')](function(){fs[_0xc5fd('0x2d')](_0x12a962[_0xc5fd('0x28')]);logger[_0xc5fd('0x18')](_0xc5fd('0x2e'));return _0x12a962;});}return _0x12a962;})[_0xc5fd('0xf')](function(_0x466aa1){logger[_0xc5fd('0x18')](_0xc5fd('0x22'),_0x48cd1d);logger['debug'](_0xc5fd('0x22'),_0x48cd1d,JSON[_0xc5fd('0x13')](_0x466aa1));_0x231368(_0x466aa1);})[_0xc5fd('0x21')](function(_0x1fa329){logger[_0xc5fd('0x14')](_0xc5fd('0x22'),_0x1fa329[_0xc5fd('0x16')],_0x48cd1d);_0x44681d(_0x2ee700[_0xc5fd('0x14')](0x1f4,_0x1fa329[_0xc5fd('0x16')]));});});}; \ No newline at end of file +var _0x7046=['info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','body','options','raw','attributes','limit','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x481437,_0x48e3f8){var _0x38572f=function(_0x483914){while(--_0x483914){_0x481437['push'](_0x481437['shift']());}};_0x38572f(++_0x48e3f8);}(_0x7046,0x144));var _0x6704=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7046[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});}exports[_0x6704('0x17')]=function(_0x31d732){var _0x135f4b=this;return new Promise(function(_0xe49450,_0x344ed9){return db['VoiceRecording'][_0x6704('0x18')](_0x31d732[_0x6704('0x19')],{'raw':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')][_0x6704('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')]['where']||null:null,'attributes':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')][_0x6704('0x1c')]||null:null,'limit':_0x31d732['options']?_0x31d732['options'][_0x6704('0x1d')]||null:null})[_0x6704('0x1e')](function(_0x3cd12e){logger[_0x6704('0xc')](_0x6704('0x17'),_0x31d732);logger['debug'](_0x6704('0x17'),_0x31d732,JSON[_0x6704('0x11')](_0x3cd12e));_0xe49450(_0x3cd12e);})[_0x6704('0x16')](function(_0x348fcb){logger[_0x6704('0x12')](_0x6704('0x17'),_0x348fcb[_0x6704('0x14')],_0x31d732);_0x344ed9(_0x135f4b[_0x6704('0x12')](0x1f4,_0x348fcb[_0x6704('0x14')]));});});};exports[_0x6704('0x1f')]=function(_0x36bea4){var _0x1bdfee=this;return new Promise(function(_0x118d93,_0x4979ec){var _0x5ac014=require(_0x6704('0x20'));var _0xf875dc;return db[_0x6704('0x21')][_0x6704('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x6704('0x1e')](function(_0x18cd98){_0xf875dc=_0x18cd98;return db['VoiceRecording']['create'](_0x36bea4[_0x6704('0x19')]);})['then'](function(_0x812ba2){if(_0xf875dc['callRecordingEncryption']&&fs['existsSync'](_0x812ba2[_0x6704('0x23')])){var _0x115514=util[_0x6704('0x24')]('%s.cypher',_0x812ba2[_0x6704('0x23')]);return _0x5ac014[_0x6704('0x25')](_0x812ba2[_0x6704('0x23')],_0x115514,config[_0x6704('0x26')][_0x6704('0x27')])[_0x6704('0x1e')](function(){fs[_0x6704('0x28')](_0x812ba2[_0x6704('0x23')]);logger[_0x6704('0xc')](_0x6704('0x29'));return _0x812ba2;});}return _0x812ba2;})[_0x6704('0x1e')](function(_0x454885){logger[_0x6704('0xc')](_0x6704('0x1f'),_0x36bea4);logger[_0x6704('0xf')](_0x6704('0x1f'),_0x36bea4,JSON[_0x6704('0x11')](_0x454885));_0x118d93(_0x454885);})[_0x6704('0x16')](function(_0x219494){logger[_0x6704('0x12')](_0x6704('0x1f'),_0x219494[_0x6704('0x14')],_0x36bea4);_0x4979ec(_0x1bdfee[_0x6704('0x12')](0x1f4,_0x219494[_0x6704('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3a040a8..dd847db 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 _0x90d4=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','index','get','show','post','create'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0x90d4,0x182));var _0x490d=function(_0x43d1d8,_0x423ff5){_0x43d1d8=_0x43d1d8-0x0;var _0x3505ca=_0x90d4[_0x43d1d8];return _0x3505ca;};'use strict';var multer=require(_0x490d('0x0'));var util=require(_0x490d('0x1'));var path=require(_0x490d('0x2'));var timeout=require(_0x490d('0x3'));var express=require('express');var router=express[_0x490d('0x4')]();var fs_extra=require(_0x490d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x490d('0x6'));var config=require('../../config/environment');var controller=require(_0x490d('0x7'));router['get']('/',auth[_0x490d('0x8')](),controller[_0x490d('0x9')]);router[_0x490d('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x490d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x490d('0xb')]);router[_0x490d('0xc')]('/',auth[_0x490d('0x8')](),controller[_0x490d('0xd')]);router[_0x490d('0xe')](_0x490d('0xf'),auth['isAuthenticated'](),controller[_0x490d('0x10')]);router[_0x490d('0x11')](_0x490d('0xf'),auth['isAuthenticated'](),controller[_0x490d('0x12')]);module[_0x490d('0x13')]=router; \ No newline at end of file +var _0xcaf9=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','update','delete','/:id','destroy','exports','multer'];(function(_0x4fcf2f,_0x4f784c){var _0x831a9b=function(_0x208210){while(--_0x208210){_0x4fcf2f['push'](_0x4fcf2f['shift']());}};_0x831a9b(++_0x4f784c);}(_0xcaf9,0x1cd));var _0x9caf=function(_0x33398e,_0x4b658f){_0x33398e=_0x33398e-0x0;var _0x327264=_0xcaf9[_0x33398e];return _0x327264;};'use strict';var multer=require(_0x9caf('0x0'));var util=require(_0x9caf('0x1'));var path=require(_0x9caf('0x2'));var timeout=require(_0x9caf('0x3'));var express=require(_0x9caf('0x4'));var router=express['Router']();var fs_extra=require(_0x9caf('0x5'));var auth=require(_0x9caf('0x6'));var interaction=require(_0x9caf('0x7'));var config=require(_0x9caf('0x8'));var controller=require(_0x9caf('0x9'));router[_0x9caf('0xa')]('/',auth[_0x9caf('0xb')](),controller[_0x9caf('0xc')]);router[_0x9caf('0xa')](_0x9caf('0xd'),auth[_0x9caf('0xb')](),controller['describe']);router[_0x9caf('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9caf('0xe')]);router[_0x9caf('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9caf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9caf('0x11')]);router[_0x9caf('0x12')](_0x9caf('0x13'),auth[_0x9caf('0xb')](),controller[_0x9caf('0x14')]);module[_0x9caf('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 75eb494..fc0dd32 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 _0x31f9=['sequelize','moment','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x565a0b,_0x37269e){var _0x283124=function(_0x43cd7a){while(--_0x43cd7a){_0x565a0b['push'](_0x565a0b['shift']());}};_0x283124(++_0x37269e);}(_0x31f9,0x188));var _0x931f=function(_0x2bf6f8,_0x4b435a){_0x2bf6f8=_0x2bf6f8-0x0;var _0x54ca3f=_0x31f9[_0x2bf6f8];return _0x54ca3f;};'use strict';var Sequelize=require(_0x931f('0x0'));var moment=require(_0x931f('0x1'));module[_0x931f('0x2')]={'type':{'type':Sequelize[_0x931f('0x3')](_0x931f('0x4'),_0x931f('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x931f('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x931f('0x6')]},'transferercalleridname':{'type':Sequelize[_0x931f('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x931f('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x931f('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x931f('0x6')]},'transferercontext':{'type':Sequelize[_0x931f('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x931f('0x6')]},'transfereechannel':{'type':Sequelize[_0x931f('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x931f('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x931f('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x931f('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x931f('0x6')]},'transfereecontext':{'type':Sequelize[_0x931f('0x6')]},'transfereeexten':{'type':Sequelize[_0x931f('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x931f('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x931f('0x6')]}}; \ No newline at end of file +var _0x6bc7=['attended','STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x300ada,_0x519243){var _0x2c77d6=function(_0x450d19){while(--_0x450d19){_0x300ada['push'](_0x300ada['shift']());}};_0x2c77d6(++_0x519243);}(_0x6bc7,0x9b));var _0x76bc=function(_0x5d72c8,_0x85e2e1){_0x5d72c8=_0x5d72c8-0x0;var _0x3abc9e=_0x6bc7[_0x5d72c8];return _0x3abc9e;};'use strict';var Sequelize=require(_0x76bc('0x0'));var moment=require(_0x76bc('0x1'));module[_0x76bc('0x2')]={'type':{'type':Sequelize[_0x76bc('0x3')](_0x76bc('0x4'),_0x76bc('0x5'))},'result':{'type':Sequelize[_0x76bc('0x6')]},'transfererchannel':{'type':Sequelize[_0x76bc('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x76bc('0x6')]},'transferercalleridname':{'type':Sequelize[_0x76bc('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x76bc('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x76bc('0x6')]},'transfererexten':{'type':Sequelize[_0x76bc('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x76bc('0x6')]},'transfereechannel':{'type':Sequelize[_0x76bc('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x76bc('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x76bc('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x76bc('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x76bc('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x76bc('0x6')]},'isexternal':{'type':Sequelize[_0x76bc('0x3')](_0x76bc('0x7'),'No')},'context':{'type':Sequelize[_0x76bc('0x6')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b3f06b0..9f8b8f6 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 _0xc895=['then','stack','name','index','map','VoiceTransferReport','fieldName','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','type','filter','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x1c404d,_0x55d42a){var _0x6952a1=function(_0x45f7e0){while(--_0x45f7e0){_0x1c404d['push'](_0x1c404d['shift']());}};_0x6952a1(++_0x55d42a);}(_0xc895,0x143));var _0x5c89=function(_0x186b0e,_0x57b796){_0x186b0e=_0x186b0e-0x0;var _0x1f69b1=_0xc895[_0x186b0e];return _0x1f69b1;};'use strict';var emlformat=require(_0x5c89('0x0'));var rimraf=require(_0x5c89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c89('0x2'));var rp=require(_0x5c89('0x3'));var moment=require(_0x5c89('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5c89('0x5'));var util=require(_0x5c89('0x6'));var path=require(_0x5c89('0x7'));var sox=require(_0x5c89('0x8'));var csv=require(_0x5c89('0x9'));var ejs=require(_0x5c89('0xa'));var fs=require('fs');var fs_extra=require(_0x5c89('0xb'));var _=require(_0x5c89('0xc'));var squel=require('squel');var crypto=require(_0x5c89('0xd'));var jsforce=require(_0x5c89('0xe'));var deskjs=require(_0x5c89('0xf'));var toCsv=require(_0x5c89('0x9'));var querystring=require('querystring');var Papa=require(_0x5c89('0x10'));var Redis=require('ioredis');var authService=require(_0x5c89('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5c89('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c89('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5c89('0x14'));var licenseUtil=require(_0x5c89('0x15'));var db=require(_0x5c89('0x16'))['db'];function respondWithStatusCode(_0x40e835,_0x466b23){_0x466b23=_0x466b23||0xcc;return function(_0x485fa8){if(_0x485fa8){return _0x40e835[_0x5c89('0x17')](_0x466b23);}return _0x40e835[_0x5c89('0x18')](_0x466b23)[_0x5c89('0x19')]();};}function respondWithResult(_0x2e3b10,_0x201767){_0x201767=_0x201767||0xc8;return function(_0x262b53){if(_0x262b53){return _0x2e3b10[_0x5c89('0x18')](_0x201767)['json'](_0x262b53);}};}function respondWithFilteredResult(_0x4b6b6d,_0x185d46){return function(_0x525965){if(_0x525965){var _0x1685f1=typeof _0x185d46[_0x5c89('0x1a')]===_0x5c89('0x1b')&&typeof _0x185d46[_0x5c89('0x1c')]===_0x5c89('0x1b');var _0x36ea2f=_0x525965[_0x5c89('0x1d')];var _0x51fc2f=_0x1685f1?0x0:_0x185d46['offset'];var _0x5541cb=_0x1685f1?_0x525965[_0x5c89('0x1d')]:_0x185d46[_0x5c89('0x1a')]+_0x185d46[_0x5c89('0x1c')];var _0x1bc01f;if(_0x5541cb>=_0x36ea2f){_0x5541cb=_0x36ea2f;_0x1bc01f=0xc8;}else{_0x1bc01f=0xce;}_0x4b6b6d[_0x5c89('0x18')](_0x1bc01f);return _0x4b6b6d[_0x5c89('0x1e')](_0x5c89('0x1f'),_0x51fc2f+'-'+_0x5541cb+'/'+_0x36ea2f)['json'](_0x525965);}return null;};}function patchUpdates(_0x212983){return function(_0x4e89cd){try{jsonpatch[_0x5c89('0x20')](_0x4e89cd,_0x212983,!![]);}catch(_0x2cd538){return BPromise[_0x5c89('0x21')](_0x2cd538);}return _0x4e89cd[_0x5c89('0x22')]();};}function saveUpdates(_0x16adee,_0x227642){return function(_0x165b19){if(_0x165b19){return _0x165b19[_0x5c89('0x23')](_0x16adee)['then'](function(_0xbfe02d){return _0xbfe02d;});}return null;};}function removeEntity(_0xd4137d,_0x4fbcd0){return function(_0x1a8bd2){if(_0x1a8bd2){return _0x1a8bd2[_0x5c89('0x24')]()[_0x5c89('0x25')](function(){_0xd4137d[_0x5c89('0x18')](0xcc)[_0x5c89('0x19')]();});}};}function handleEntityNotFound(_0x3ad0c4,_0x2d3513){return function(_0x36b494){if(!_0x36b494){_0x3ad0c4[_0x5c89('0x17')](0x194);}return _0x36b494;};}function handleError(_0x192472,_0x3c5392){_0x3c5392=_0x3c5392||0x1f4;return function(_0x1afd12){logger['error'](_0x1afd12[_0x5c89('0x26')]);if(_0x1afd12[_0x5c89('0x27')]){delete _0x1afd12[_0x5c89('0x27')];}_0x192472['status'](_0x3c5392)['send'](_0x1afd12);};}exports[_0x5c89('0x28')]=function(_0x31cd86,_0x471c84){var _0x5ebf93={},_0x4fe0cc={},_0x451ead={'count':0x0,'rows':[]};var _0x46ef1c=_[_0x5c89('0x29')](db[_0x5c89('0x2a')]['rawAttributes'],function(_0x460bac){return{'name':_0x460bac[_0x5c89('0x2b')],'type':_0x460bac['type'][_0x5c89('0x2c')]};});_0x4fe0cc[_0x5c89('0x2d')]=_[_0x5c89('0x29')](_0x46ef1c,_0x5c89('0x27'));_0x4fe0cc['query']=_[_0x5c89('0x2e')](_0x31cd86['query']);_0x4fe0cc['filters']=_[_0x5c89('0x2f')](_0x4fe0cc['model'],_0x4fe0cc['query']);_0x5ebf93['attributes']=_[_0x5c89('0x2f')](_0x4fe0cc[_0x5c89('0x2d')],qs['fields'](_0x31cd86[_0x5c89('0x30')][_0x5c89('0x31')]));_0x5ebf93[_0x5c89('0x32')]=_0x5ebf93['attributes'][_0x5c89('0x33')]?_0x5ebf93[_0x5c89('0x32')]:_0x4fe0cc[_0x5c89('0x2d')];if(!_0x31cd86[_0x5c89('0x30')][_0x5c89('0x34')]('nolimit')){_0x5ebf93[_0x5c89('0x1c')]=qs[_0x5c89('0x1c')](_0x31cd86[_0x5c89('0x30')][_0x5c89('0x1c')]);_0x5ebf93[_0x5c89('0x1a')]=qs[_0x5c89('0x1a')](_0x31cd86[_0x5c89('0x30')]['offset']);}_0x5ebf93['order']=qs[_0x5c89('0x35')](_0x31cd86['query']['sort']);_0x5ebf93[_0x5c89('0x36')]=qs[_0x5c89('0x37')](_[_0x5c89('0x38')](_0x31cd86[_0x5c89('0x30')],_0x4fe0cc[_0x5c89('0x37')]),_0x46ef1c);if(_0x31cd86[_0x5c89('0x30')]['filter']){_0x5ebf93[_0x5c89('0x36')]=_[_0x5c89('0x39')](_0x5ebf93[_0x5c89('0x36')],{'$or':_[_0x5c89('0x29')](_0x46ef1c,function(_0x11cf59){if(_0x11cf59[_0x5c89('0x3a')]!=='VIRTUAL'){var _0x3cda27={};_0x3cda27[_0x11cf59[_0x5c89('0x27')]]={'$like':'%'+_0x31cd86[_0x5c89('0x30')][_0x5c89('0x3b')]+'%'};return _0x3cda27;}})});}_0x5ebf93=_[_0x5c89('0x39')]({},_0x5ebf93,_0x31cd86['options']);var _0x43f637={'where':_0x5ebf93[_0x5c89('0x36')]};return db[_0x5c89('0x2a')][_0x5c89('0x1d')](_0x43f637)[_0x5c89('0x25')](function(_0x32a881){_0x451ead[_0x5c89('0x1d')]=_0x32a881;if(_0x31cd86['query'][_0x5c89('0x3c')]){_0x5ebf93[_0x5c89('0x3d')]=[{'all':!![]}];}return db[_0x5c89('0x2a')]['findAll'](_0x5ebf93);})[_0x5c89('0x25')](function(_0x43980b){_0x451ead[_0x5c89('0x3e')]=_0x43980b;return _0x451ead;})['then'](respondWithFilteredResult(_0x471c84,_0x5ebf93))[_0x5c89('0x3f')](handleError(_0x471c84,null));};exports[_0x5c89('0x40')]=function(_0x19687e,_0x2ef913){var _0x54d029={'raw':!![],'where':{'id':_0x19687e[_0x5c89('0x41')]['id']}},_0x16c8c8={};_0x16c8c8[_0x5c89('0x2d')]=_[_0x5c89('0x2e')](db[_0x5c89('0x2a')][_0x5c89('0x42')]);_0x16c8c8[_0x5c89('0x30')]=_['keys'](_0x19687e[_0x5c89('0x30')]);_0x16c8c8[_0x5c89('0x37')]=_[_0x5c89('0x2f')](_0x16c8c8['model'],_0x16c8c8[_0x5c89('0x30')]);_0x54d029['attributes']=_[_0x5c89('0x2f')](_0x16c8c8[_0x5c89('0x2d')],qs['fields'](_0x19687e[_0x5c89('0x30')][_0x5c89('0x31')]));_0x54d029['attributes']=_0x54d029['attributes'][_0x5c89('0x33')]?_0x54d029['attributes']:_0x16c8c8[_0x5c89('0x2d')];if(_0x19687e['query']['includeAll']){_0x54d029[_0x5c89('0x3d')]=[{'all':!![]}];}_0x54d029=_['merge']({},_0x54d029,_0x19687e[_0x5c89('0x43')]);return db['VoiceTransferReport'][_0x5c89('0x44')](_0x54d029)[_0x5c89('0x25')](handleEntityNotFound(_0x2ef913,null))['then'](respondWithResult(_0x2ef913,null))[_0x5c89('0x3f')](handleError(_0x2ef913,null));};exports[_0x5c89('0x45')]=function(_0x46be53,_0x5e55a7){return db[_0x5c89('0x2a')]['create'](_0x46be53[_0x5c89('0x46')],{})[_0x5c89('0x25')](respondWithResult(_0x5e55a7,0xc9))[_0x5c89('0x3f')](handleError(_0x5e55a7,null));};exports[_0x5c89('0x23')]=function(_0x4b8714,_0x3c2044){if(_0x4b8714[_0x5c89('0x46')]['id']){delete _0x4b8714[_0x5c89('0x46')]['id'];}return db[_0x5c89('0x2a')][_0x5c89('0x44')]({'where':{'id':_0x4b8714['params']['id']}})[_0x5c89('0x25')](handleEntityNotFound(_0x3c2044,null))[_0x5c89('0x25')](saveUpdates(_0x4b8714[_0x5c89('0x46')],null))[_0x5c89('0x25')](respondWithResult(_0x3c2044,null))[_0x5c89('0x3f')](handleError(_0x3c2044,null));};exports[_0x5c89('0x24')]=function(_0x48391b,_0x117d1d){return db[_0x5c89('0x2a')][_0x5c89('0x44')]({'where':{'id':_0x48391b[_0x5c89('0x41')]['id']}})['then'](handleEntityNotFound(_0x117d1d,null))['then'](removeEntity(_0x117d1d,null))[_0x5c89('0x3f')](handleError(_0x117d1d,null));};exports[_0x5c89('0x47')]=function(_0x1a9ba4,_0x53f6bf){return db[_0x5c89('0x2a')][_0x5c89('0x47')]()['then'](respondWithResult(_0x53f6bf,null))[_0x5c89('0x3f')](handleError(_0x53f6bf,null));}; \ No newline at end of file +var _0xebad=['util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','then','destroy','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','keys','includeAll','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x193fa9,_0x561f42){var _0x5e1ad3=function(_0x199c38){while(--_0x199c38){_0x193fa9['push'](_0x193fa9['shift']());}};_0x5e1ad3(++_0x561f42);}(_0xebad,0x85));var _0xdeba=function(_0x4dea83,_0x15987c){_0x4dea83=_0x4dea83-0x0;var _0x53ab21=_0xebad[_0x4dea83];return _0x53ab21;};'use strict';var emlformat=require(_0xdeba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeba('0x1'));var jsonpatch=require(_0xdeba('0x2'));var rp=require(_0xdeba('0x3'));var moment=require(_0xdeba('0x4'));var BPromise=require(_0xdeba('0x5'));var Mustache=require(_0xdeba('0x6'));var util=require(_0xdeba('0x7'));var path=require(_0xdeba('0x8'));var sox=require(_0xdeba('0x9'));var csv=require('to-csv');var ejs=require(_0xdeba('0xa'));var fs=require('fs');var fs_extra=require(_0xdeba('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdeba('0xc'));var toCsv=require(_0xdeba('0xd'));var querystring=require(_0xdeba('0xe'));var Papa=require(_0xdeba('0xf'));var Redis=require(_0xdeba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdeba('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdeba('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xdeba('0x13'));var config=require(_0xdeba('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54d29c,_0x3c5775){_0x3c5775=_0x3c5775||0xcc;return function(_0x31c79f){if(_0x31c79f){return _0x54d29c[_0xdeba('0x15')](_0x3c5775);}return _0x54d29c[_0xdeba('0x16')](_0x3c5775)[_0xdeba('0x17')]();};}function respondWithResult(_0x2da01e,_0x23f51a){_0x23f51a=_0x23f51a||0xc8;return function(_0xa4f9b2){if(_0xa4f9b2){return _0x2da01e['status'](_0x23f51a)[_0xdeba('0x18')](_0xa4f9b2);}};}function respondWithFilteredResult(_0x53aeb4,_0x48889b){return function(_0x15e627){if(_0x15e627){var _0x485e92=typeof _0x48889b[_0xdeba('0x19')]===_0xdeba('0x1a')&&typeof _0x48889b['limit']==='undefined';var _0x187b50=_0x15e627[_0xdeba('0x1b')];var _0x663a87=_0x485e92?0x0:_0x48889b['offset'];var _0x371a6f=_0x485e92?_0x15e627[_0xdeba('0x1b')]:_0x48889b['offset']+_0x48889b['limit'];var _0x173f0b;if(_0x371a6f>=_0x187b50){_0x371a6f=_0x187b50;_0x173f0b=0xc8;}else{_0x173f0b=0xce;}_0x53aeb4[_0xdeba('0x16')](_0x173f0b);return _0x53aeb4['set'](_0xdeba('0x1c'),_0x663a87+'-'+_0x371a6f+'/'+_0x187b50)[_0xdeba('0x18')](_0x15e627);}return null;};}function patchUpdates(_0x7f5fc2){return function(_0x3241d6){try{jsonpatch[_0xdeba('0x1d')](_0x3241d6,_0x7f5fc2,!![]);}catch(_0x44c442){return BPromise['reject'](_0x44c442);}return _0x3241d6['save']();};}function saveUpdates(_0x57f3ed,_0x349bc7){return function(_0xd8b080){if(_0xd8b080){return _0xd8b080['update'](_0x57f3ed)[_0xdeba('0x1e')](function(_0x5493b7){return _0x5493b7;});}return null;};}function removeEntity(_0x5da9a6,_0x5a9567){return function(_0x1811c7){if(_0x1811c7){return _0x1811c7[_0xdeba('0x1f')]()[_0xdeba('0x1e')](function(){_0x5da9a6[_0xdeba('0x16')](0xcc)[_0xdeba('0x17')]();});}};}function handleEntityNotFound(_0x3b2d66,_0x21bec0){return function(_0x5effcc){if(!_0x5effcc){_0x3b2d66[_0xdeba('0x15')](0x194);}return _0x5effcc;};}function handleError(_0xa03010,_0x2ddf55){_0x2ddf55=_0x2ddf55||0x1f4;return function(_0x4b5aa6){logger[_0xdeba('0x20')](_0x4b5aa6[_0xdeba('0x21')]);if(_0x4b5aa6['name']){delete _0x4b5aa6[_0xdeba('0x22')];}_0xa03010[_0xdeba('0x16')](_0x2ddf55)[_0xdeba('0x23')](_0x4b5aa6);};}exports['index']=function(_0x3e50e1,_0x2e5abd){var _0x20bff4={},_0x2901fd={},_0x2bee41={'count':0x0,'rows':[]};var _0xe96c1f=_[_0xdeba('0x24')](db[_0xdeba('0x25')][_0xdeba('0x26')],function(_0x213632){return{'name':_0x213632[_0xdeba('0x27')],'type':_0x213632[_0xdeba('0x28')][_0xdeba('0x29')]};});_0x2901fd[_0xdeba('0x2a')]=_[_0xdeba('0x24')](_0xe96c1f,_0xdeba('0x22'));_0x2901fd[_0xdeba('0x2b')]=_['keys'](_0x3e50e1[_0xdeba('0x2b')]);_0x2901fd[_0xdeba('0x2c')]=_[_0xdeba('0x2d')](_0x2901fd[_0xdeba('0x2a')],_0x2901fd[_0xdeba('0x2b')]);_0x20bff4[_0xdeba('0x2e')]=_[_0xdeba('0x2d')](_0x2901fd[_0xdeba('0x2a')],qs['fields'](_0x3e50e1[_0xdeba('0x2b')][_0xdeba('0x2f')]));_0x20bff4[_0xdeba('0x2e')]=_0x20bff4[_0xdeba('0x2e')][_0xdeba('0x30')]?_0x20bff4[_0xdeba('0x2e')]:_0x2901fd[_0xdeba('0x2a')];if(!_0x3e50e1[_0xdeba('0x2b')][_0xdeba('0x31')](_0xdeba('0x32'))){_0x20bff4[_0xdeba('0x33')]=qs[_0xdeba('0x33')](_0x3e50e1[_0xdeba('0x2b')][_0xdeba('0x33')]);_0x20bff4[_0xdeba('0x19')]=qs[_0xdeba('0x19')](_0x3e50e1[_0xdeba('0x2b')][_0xdeba('0x19')]);}_0x20bff4[_0xdeba('0x34')]=qs['sort'](_0x3e50e1['query']['sort']);_0x20bff4['where']=qs['filters'](_[_0xdeba('0x35')](_0x3e50e1[_0xdeba('0x2b')],_0x2901fd[_0xdeba('0x2c')]),_0xe96c1f);if(_0x3e50e1['query'][_0xdeba('0x36')]){_0x20bff4[_0xdeba('0x37')]=_['merge'](_0x20bff4[_0xdeba('0x37')],{'$or':_[_0xdeba('0x24')](_0xe96c1f,function(_0x2c97a8){if(_0x2c97a8[_0xdeba('0x28')]!==_0xdeba('0x38')){var _0x1db74b={};_0x1db74b[_0x2c97a8['name']]={'$like':'%'+_0x3e50e1['query'][_0xdeba('0x36')]+'%'};return _0x1db74b;}})});}_0x20bff4=_[_0xdeba('0x39')]({},_0x20bff4,_0x3e50e1[_0xdeba('0x3a')]);var _0x3bf0fc={'where':_0x20bff4[_0xdeba('0x37')]};return db[_0xdeba('0x25')][_0xdeba('0x1b')](_0x3bf0fc)[_0xdeba('0x1e')](function(_0xeab845){_0x2bee41[_0xdeba('0x1b')]=_0xeab845;if(_0x3e50e1['query']['includeAll']){_0x20bff4[_0xdeba('0x3b')]=[{'all':!![]}];}return db[_0xdeba('0x25')][_0xdeba('0x3c')](_0x20bff4);})['then'](function(_0x89ff2d){_0x2bee41['rows']=_0x89ff2d;return _0x2bee41;})[_0xdeba('0x1e')](respondWithFilteredResult(_0x2e5abd,_0x20bff4))[_0xdeba('0x3d')](handleError(_0x2e5abd,null));};exports[_0xdeba('0x3e')]=function(_0x5f58cc,_0x1a677c){var _0x41a67e={'raw':!![],'where':{'id':_0x5f58cc['params']['id']}},_0x3f2b0c={};_0x3f2b0c[_0xdeba('0x2a')]=_[_0xdeba('0x3f')](db[_0xdeba('0x25')][_0xdeba('0x26')]);_0x3f2b0c[_0xdeba('0x2b')]=_[_0xdeba('0x3f')](_0x5f58cc[_0xdeba('0x2b')]);_0x3f2b0c[_0xdeba('0x2c')]=_[_0xdeba('0x2d')](_0x3f2b0c['model'],_0x3f2b0c['query']);_0x41a67e['attributes']=_[_0xdeba('0x2d')](_0x3f2b0c[_0xdeba('0x2a')],qs['fields'](_0x5f58cc[_0xdeba('0x2b')][_0xdeba('0x2f')]));_0x41a67e[_0xdeba('0x2e')]=_0x41a67e[_0xdeba('0x2e')][_0xdeba('0x30')]?_0x41a67e['attributes']:_0x3f2b0c[_0xdeba('0x2a')];if(_0x5f58cc['query'][_0xdeba('0x40')]){_0x41a67e[_0xdeba('0x3b')]=[{'all':!![]}];}_0x41a67e=_[_0xdeba('0x39')]({},_0x41a67e,_0x5f58cc[_0xdeba('0x3a')]);return db[_0xdeba('0x25')]['find'](_0x41a67e)[_0xdeba('0x1e')](handleEntityNotFound(_0x1a677c,null))['then'](respondWithResult(_0x1a677c,null))[_0xdeba('0x3d')](handleError(_0x1a677c,null));};exports['create']=function(_0xeba58c,_0x1bd93e){return db['VoiceTransferReport'][_0xdeba('0x41')](_0xeba58c[_0xdeba('0x42')],{})[_0xdeba('0x1e')](respondWithResult(_0x1bd93e,0xc9))[_0xdeba('0x3d')](handleError(_0x1bd93e,null));};exports['update']=function(_0x3ecce7,_0x4a81aa){if(_0x3ecce7['body']['id']){delete _0x3ecce7[_0xdeba('0x42')]['id'];}return db[_0xdeba('0x25')]['find']({'where':{'id':_0x3ecce7[_0xdeba('0x43')]['id']}})[_0xdeba('0x1e')](handleEntityNotFound(_0x4a81aa,null))[_0xdeba('0x1e')](saveUpdates(_0x3ecce7[_0xdeba('0x42')],null))['then'](respondWithResult(_0x4a81aa,null))[_0xdeba('0x3d')](handleError(_0x4a81aa,null));};exports[_0xdeba('0x1f')]=function(_0x1ecd93,_0xd85107){return db['VoiceTransferReport'][_0xdeba('0x44')]({'where':{'id':_0x1ecd93[_0xdeba('0x43')]['id']}})['then'](handleEntityNotFound(_0xd85107,null))['then'](removeEntity(_0xd85107,null))['catch'](handleError(_0xd85107,null));};exports[_0xdeba('0x45')]=function(_0x110db1,_0x42a145){return db[_0xdeba('0x25')][_0xdeba('0x45')]()[_0xdeba('0x1e')](respondWithResult(_0x42a145,null))[_0xdeba('0x3d')](handleError(_0x42a145,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 0875aba..480a86b 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 _0xacde=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x127187,_0x4f7f5c){var _0xcb9e8e=function(_0x2ed907){while(--_0x2ed907){_0x127187['push'](_0x127187['shift']());}};_0xcb9e8e(++_0x4f7f5c);}(_0xacde,0x66));var _0xeacd=function(_0x4d1cc5,_0x5cf765){_0x4d1cc5=_0x4d1cc5-0x0;var _0x5e3fe5=_0xacde[_0x4d1cc5];return _0x5e3fe5;};'use strict';var _=require(_0xeacd('0x0'));var util=require(_0xeacd('0x1'));var logger=require('../../config/logger')(_0xeacd('0x2'));var moment=require(_0xeacd('0x3'));var BPromise=require(_0xeacd('0x4'));var rp=require(_0xeacd('0x5'));var fs=require('fs');var path=require(_0xeacd('0x6'));var rimraf=require(_0xeacd('0x7'));var config=require(_0xeacd('0x8'));var attributes=require(_0xeacd('0x9'));module[_0xeacd('0xa')]=function(_0x49e0bf,_0x3d2f93){return _0x49e0bf[_0xeacd('0xb')](_0xeacd('0xc'),attributes,{'tableName':_0xeacd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x455d=['VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports'];(function(_0x34cad8,_0x1fe91a){var _0x5bb0f2=function(_0x46d578){while(--_0x46d578){_0x34cad8['push'](_0x34cad8['shift']());}};_0x5bb0f2(++_0x1fe91a);}(_0x455d,0xb6));var _0xd455=function(_0x12032d,_0xd93a5e){_0x12032d=_0x12032d-0x0;var _0x22f72d=_0x455d[_0x12032d];return _0x22f72d;};'use strict';var _=require(_0xd455('0x0'));var util=require('util');var logger=require(_0xd455('0x1'))(_0xd455('0x2'));var moment=require('moment');var BPromise=require(_0xd455('0x3'));var rp=require(_0xd455('0x4'));var fs=require('fs');var path=require(_0xd455('0x5'));var rimraf=require(_0xd455('0x6'));var config=require(_0xd455('0x7'));var attributes=require(_0xd455('0x8'));module[_0xd455('0x9')]=function(_0x2b5040,_0x1ece31){return _0x2b5040['define'](_0xd455('0xa'),attributes,{'tableName':_0xd455('0xb'),'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 441bcb0..2dd1435 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 _0x5b0b=['error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x53ca70,_0x31fe6d){var _0x78fc47=function(_0x2faaaa){while(--_0x2faaaa){_0x53ca70['push'](_0x53ca70['shift']());}};_0x78fc47(++_0x31fe6d);}(_0x5b0b,0x107));var _0xb5b0=function(_0x5e7a75,_0x1f7ead){_0x5e7a75=_0x5e7a75-0x0;var _0xbf55a1=_0x5b0b[_0x5e7a75];return _0xbf55a1;};'use strict';var _=require(_0xb5b0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb5b0('0x1'));var rs=require(_0xb5b0('0x2'));var fs=require('fs');var Redis=require(_0xb5b0('0x3'));var db=require(_0xb5b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5b0('0x5'));var config=require(_0xb5b0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb5b0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5ed5a,_0x26a50e,_0x588c04){return new BPromise(function(_0x144db5,_0x4a8024){return client[_0xb5b0('0x8')](_0xe5ed5a,_0x588c04)['then'](function(_0x133d6f){logger['info'](_0xb5b0('0x9'),_0x26a50e,'request\x20sent');logger[_0xb5b0('0xa')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x26a50e,_0xb5b0('0xb'),JSON['stringify'](_0x133d6f));if(_0x133d6f[_0xb5b0('0xc')]){if(_0x133d6f[_0xb5b0('0xc')][_0xb5b0('0xd')]===0x1f4){logger[_0xb5b0('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x26a50e,_0x133d6f['error'][_0xb5b0('0xe')]);return _0x4a8024(_0x133d6f[_0xb5b0('0xc')]['message']);}logger[_0xb5b0('0xc')](_0xb5b0('0x9'),_0x26a50e,_0x133d6f[_0xb5b0('0xc')][_0xb5b0('0xe')]);return _0x144db5(_0x133d6f[_0xb5b0('0xc')][_0xb5b0('0xe')]);}else{logger[_0xb5b0('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x26a50e,'request\x20sent');_0x144db5(_0x133d6f[_0xb5b0('0x10')][_0xb5b0('0xe')]);}})['catch'](function(_0x3c0493){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x26a50e,_0x3c0493);_0x4a8024(_0x3c0493);});});}exports[_0xb5b0('0x11')]=function(_0x461ae8){var _0x418217=this;return new Promise(function(_0x1ce6b8,_0x848dc5){return db[_0xb5b0('0x12')][_0xb5b0('0x13')](_0x461ae8[_0xb5b0('0x14')],{'raw':_0x461ae8[_0xb5b0('0x15')]?_0x461ae8[_0xb5b0('0x15')][_0xb5b0('0x16')]===undefined?!![]:![]:!![]})[_0xb5b0('0x17')](function(_0x9eb225){logger[_0xb5b0('0xf')](_0xb5b0('0x11'),_0x461ae8);logger[_0xb5b0('0xa')](_0xb5b0('0x11'),_0x461ae8,JSON[_0xb5b0('0x18')](_0x9eb225));_0x1ce6b8(_0x9eb225);})['catch'](function(_0x53f739){logger['error'](_0xb5b0('0x11'),_0x53f739[_0xb5b0('0xe')],_0x461ae8);_0x848dc5(_0x418217[_0xb5b0('0xc')](0x1f4,_0x53f739[_0xb5b0('0xe')]));});});}; \ No newline at end of file +var _0x6dea=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x6dea,0x112));var _0xa6de=function(_0x19d04f,_0x2fe0ef){_0x19d04f=_0x19d04f-0x0;var _0x31d4e2=_0x6dea[_0x19d04f];return _0x31d4e2;};'use strict';var _=require(_0xa6de('0x0'));var util=require(_0xa6de('0x1'));var moment=require(_0xa6de('0x2'));var BPromise=require(_0xa6de('0x3'));var rs=require(_0xa6de('0x4'));var fs=require('fs');var Redis=require(_0xa6de('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa6de('0x6'))(_0xa6de('0x7'));var config=require(_0xa6de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa6de('0x9')][_0xa6de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30f7ef,_0x5cf52b,_0x4ac81c){return new BPromise(function(_0x4c20ab,_0xc9f0a4){return client[_0xa6de('0xb')](_0x30f7ef,_0x4ac81c)[_0xa6de('0xc')](function(_0x3ba49a){logger[_0xa6de('0xd')](_0xa6de('0xe'),_0x5cf52b,_0xa6de('0xf'));logger[_0xa6de('0x10')](_0xa6de('0x11'),_0x5cf52b,_0xa6de('0xf'),JSON['stringify'](_0x3ba49a));if(_0x3ba49a[_0xa6de('0x12')]){if(_0x3ba49a[_0xa6de('0x12')][_0xa6de('0x13')]===0x1f4){logger[_0xa6de('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x5cf52b,_0x3ba49a[_0xa6de('0x12')][_0xa6de('0x14')]);return _0xc9f0a4(_0x3ba49a[_0xa6de('0x12')][_0xa6de('0x14')]);}logger['error'](_0xa6de('0xe'),_0x5cf52b,_0x3ba49a[_0xa6de('0x12')][_0xa6de('0x14')]);return _0x4c20ab(_0x3ba49a[_0xa6de('0x12')]['message']);}else{logger[_0xa6de('0xd')](_0xa6de('0xe'),_0x5cf52b,_0xa6de('0xf'));_0x4c20ab(_0x3ba49a['result'][_0xa6de('0x14')]);}})[_0xa6de('0x15')](function(_0x2fe270){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5cf52b,_0x2fe270);_0xc9f0a4(_0x2fe270);});});}exports[_0xa6de('0x16')]=function(_0x4c1a83){var _0x5d1408=this;return new Promise(function(_0x416880,_0x5f1d8c){return db[_0xa6de('0x17')][_0xa6de('0x18')](_0x4c1a83[_0xa6de('0x19')],{'raw':_0x4c1a83['options']?_0x4c1a83[_0xa6de('0x1a')][_0xa6de('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x21f9f5){logger[_0xa6de('0xd')]('CreateVoiceTransferReport',_0x4c1a83);logger['debug'](_0xa6de('0x16'),_0x4c1a83,JSON[_0xa6de('0x1c')](_0x21f9f5));_0x416880(_0x21f9f5);})[_0xa6de('0x15')](function(_0x4fe3ec){logger[_0xa6de('0x12')](_0xa6de('0x16'),_0x4fe3ec[_0xa6de('0x14')],_0x4c1a83);_0x5f1d8c(_0x5d1408[_0xa6de('0x12')](0x1f4,_0x4fe3ec[_0xa6de('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 41084c7..ad63b66 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcd8=['post','/originate','isAuthenticated','originate','canUpdate','hangup','/answer','answer','/hold','/unhold','/calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0xbcd8,0x1d0));var _0x8bcd=function(_0x220345,_0x116053){_0x220345=_0x220345-0x0;var _0x27b5f2=_0xbcd8[_0x220345];return _0x27b5f2;};'use strict';var express=require(_0x8bcd('0x0'));var router=express[_0x8bcd('0x1')]();var auth=require(_0x8bcd('0x2'));var controller=require(_0x8bcd('0x3'));router[_0x8bcd('0x4')](_0x8bcd('0x5'),auth[_0x8bcd('0x6')](),auth['canUpdate'](),controller[_0x8bcd('0x7')]);router[_0x8bcd('0x4')]('/hangup',auth['isAuthenticated'](),auth[_0x8bcd('0x8')](),controller[_0x8bcd('0x9')]);router['post'](_0x8bcd('0xa'),auth[_0x8bcd('0x6')](),auth[_0x8bcd('0x8')](),controller[_0x8bcd('0xb')]);router[_0x8bcd('0x4')](_0x8bcd('0xc'),auth[_0x8bcd('0x6')](),auth[_0x8bcd('0x8')](),controller['hold']);router[_0x8bcd('0x4')](_0x8bcd('0xd'),auth[_0x8bcd('0x6')](),auth[_0x8bcd('0x8')](),controller['unhold']);router[_0x8bcd('0x4')](_0x8bcd('0xe'),auth[_0x8bcd('0x6')](),auth[_0x8bcd('0x8')](),controller['calls']);router[_0x8bcd('0x4')](_0x8bcd('0xf'),auth[_0x8bcd('0x6')](),auth[_0x8bcd('0x8')](),controller[_0x8bcd('0x10')]);module[_0x8bcd('0x11')]=router; \ No newline at end of file +var _0xb180=['unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','answer','/hold','hold','/unhold'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb180,0x109));var _0x0b18=function(_0x3fc6d5,_0x1cbc8b){_0x3fc6d5=_0x3fc6d5-0x0;var _0x19e931=_0xb180[_0x3fc6d5];return _0x19e931;};'use strict';var express=require('express');var router=express[_0x0b18('0x0')]();var auth=require(_0x0b18('0x1'));var controller=require(_0x0b18('0x2'));router[_0x0b18('0x3')](_0x0b18('0x4'),auth[_0x0b18('0x5')](),auth['canUpdate'](),controller[_0x0b18('0x6')]);router[_0x0b18('0x3')](_0x0b18('0x7'),auth['isAuthenticated'](),auth[_0x0b18('0x8')](),controller[_0x0b18('0x9')]);router[_0x0b18('0x3')](_0x0b18('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x0b18('0xb')]);router[_0x0b18('0x3')](_0x0b18('0xc'),auth[_0x0b18('0x5')](),auth['canUpdate'](),controller[_0x0b18('0xd')]);router[_0x0b18('0x3')](_0x0b18('0xe'),auth[_0x0b18('0x5')](),auth['canUpdate'](),controller[_0x0b18('0xf')]);router['post']('/calls',auth[_0x0b18('0x5')](),auth[_0x0b18('0x8')](),controller[_0x0b18('0x10')]);router[_0x0b18('0x3')](_0x0b18('0x11'),auth[_0x0b18('0x5')](),auth[_0x0b18('0x8')](),controller[_0x0b18('0x12')]);module[_0x0b18('0x13')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 550a741..af21061 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe130=['jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','User','findOne','agent','then','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','hangup','webbar:hangup','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','entityFound:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird'];(function(_0x19884a,_0x1afde8){var _0x3c88f3=function(_0x2487f9){while(--_0x2487f9){_0x19884a['push'](_0x19884a['shift']());}};_0x3c88f3(++_0x1afde8);}(_0xe130,0x127));var _0x0e13=function(_0x389deb,_0x5bb371){_0x389deb=_0x389deb-0x0;var _0x1a561d=_0xe130[_0x389deb];return _0x1a561d;};'use strict';var path=require(_0x0e13('0x0'));var fs=require('fs');var _=require(_0x0e13('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x0e13('0x2'));var util=require(_0x0e13('0x3'));var BPromise=require(_0x0e13('0x4'));var jayson=require(_0x0e13('0x5'));var amiClient=jayson[_0x0e13('0x6')]['http']({'port':0x232a});var logger=require(_0x0e13('0x7'))(_0x0e13('0x8'));var Redis=require(_0x0e13('0x9'));config[_0x0e13('0xa')]=_['defaults'](config[_0x0e13('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x0e13('0xb'));var originateValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x0e13('0xd')]},'callerId':{'type':_0x0e13('0xe')},'callbackUrl':{'type':_0x0e13('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0e13('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x0e13('0xe'),'required':[!![],_0x0e13('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]},'sessionId':{'type':_0x0e13('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x0e13('0xc'),'required':[!![],_0x0e13('0xf')]}});function emit(_0x2057fe,_0x433965,_0x38bfb3){logger[_0x0e13('0x11')](_0x2057fe,_0x433965,JSON['stringify'](_0x38bfb3));io['to'](_0x2057fe)[_0x0e13('0x12')](_0x433965,_0x38bfb3);}function handleError(_0x2964d3){return function(_0x510a2b){console['log'](_0x0e13('0x13'),_0x510a2b,_0x510a2b instanceof RangeError);logger['error'](_0x510a2b[_0x0e13('0x14')]);if(_0x510a2b instanceof RangeError){if(_0x510a2b['name']){delete _0x510a2b[_0x0e13('0x15')];}_0x2964d3[_0x0e13('0x16')](0x194)[_0x0e13('0x17')](_0x510a2b);}else{if(_0x510a2b[_0x0e13('0x15')]){delete _0x510a2b[_0x0e13('0x15')];}_0x2964d3['status'](0x1f4)['send'](_0x510a2b);}};}function checkError(){return function(_0x580d43){if(!_0x580d43){throw new RangeError(_0x0e13('0x18'));}return _0x580d43;};}function respondWithRpcPromise(_0x141c84,_0x505d53){return new BPromise(function(_0x515222,_0x295eb0){var _0x296ed3=amiClient;return _0x296ed3[_0x0e13('0x19')](_0x141c84,_0x505d53)['then'](function(_0x400e87){if(_0x400e87[_0x0e13('0x1a')]){if(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1b')]===0x1f4){return _0x295eb0(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1c')]);}return _0x515222(_0x400e87[_0x0e13('0x1a')][_0x0e13('0x1c')]);}else{_0x515222(_0x400e87[_0x0e13('0x1d')]);}})[_0x0e13('0x1e')](function(_0x9621e2){_0x295eb0(_0x9621e2);});});}function getAgent(_0x443a85){return db[_0x0e13('0x1f')][_0x0e13('0x20')]({'where':{'id':_0x443a85,'role':_0x0e13('0x21')}})[_0x0e13('0x22')](checkError());}function getAgentCheckSession(_0x1edc48,_0x59ae33){return new BPromise(function(_0x37fe42,_0x3e8c13){var _0x3684bb=respondWithRpcPromise('VoiceChannels');var _0x2182ae=getAgent(_0x1edc48);Promise[_0x0e13('0x23')]([_0x3684bb,_0x2182ae])[_0x0e13('0x22')](function(_0x4606de){var _0x5d41c3=_0x4606de[0x0];var _0xe9151f=_0x4606de[0x1];var _0x3867d5=_[_0x0e13('0x24')](_0x5d41c3[_0x0e13('0x25')],function(_0x2e65e2){return _0x2e65e2[_0x0e13('0x26')]==_0xe9151f['id']&&_0x2e65e2[_0x0e13('0x27')]==_0x59ae33;});if(_0x3867d5[_0x0e13('0x28')]==0x1){_0x37fe42(_0xe9151f);}else{_0x3e8c13(new RangeError('sessionId\x20'+_0x59ae33+_0x0e13('0x29')));}});});}exports[_0x0e13('0x2a')]=function(_0x325003,_0x53ef0a){logger[_0x0e13('0x11')](_0x0e13('0x2b'),_0x325003[_0x0e13('0x2c')]);var _0x4311da=originateValidation[_0x0e13('0xb')](_0x325003[_0x0e13('0x2c')]);if(_0x4311da[_0x0e13('0x28')]>0x0){return _0x53ef0a[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x4311da);}var _0x4a5cc1=_0x325003[_0x0e13('0x2c')][_0x0e13('0x2e')];var _0x29e017=_0x325003['body'][_0x0e13('0x2f')];var _0x560bee=_0x325003[_0x0e13('0x2c')][_0x0e13('0x30')];var _0x33d819=_0x325003[_0x0e13('0x2c')][_0x0e13('0x31')];return getAgent(_0x4a5cc1)[_0x0e13('0x22')](function(_0x110b37){logger['info']('entityFound:',_0x110b37[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x110b37[_0x0e13('0x15')]),_0x0e13('0x34'),{'callNumber':_0x29e017,'callerId':_0x560bee,'callbackUrl':_0x33d819});return _0x53ef0a[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'originate\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x53ef0a));};exports[_0x0e13('0x35')]=function(_0x476c6e,_0x4729da){logger[_0x0e13('0x11')]('hangup\x20fired:',_0x476c6e[_0x0e13('0x2c')]);var _0x2dd946=hangupValidation[_0x0e13('0xb')](_0x476c6e['body']);if(_0x2dd946[_0x0e13('0x28')]>0x0){return _0x4729da['status'](0x190)[_0x0e13('0x2d')](_0x2dd946);}var _0x5557e6=_0x476c6e[_0x0e13('0x2c')]['userId'];var _0x411b44=_0x476c6e[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x5557e6)[_0x0e13('0x22')](function(_0x11e209){logger[_0x0e13('0x11')]('entityFound:',_0x11e209[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x11e209[_0x0e13('0x15')]),_0x0e13('0x36'),{'sessionId':_0x411b44});return _0x4729da[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'hangup\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x4729da));};exports['answer']=function(_0x54da3f,_0x4ba4ec){logger[_0x0e13('0x11')](_0x0e13('0x37'),_0x54da3f[_0x0e13('0x2c')]);var _0x14ab2a=answerValidation[_0x0e13('0xb')](_0x54da3f[_0x0e13('0x2c')]);if(_0x14ab2a[_0x0e13('0x28')]>0x0){return _0x4ba4ec['status'](0x190)[_0x0e13('0x2d')](_0x14ab2a);}var _0x4f9f28=_0x54da3f['body'][_0x0e13('0x2e')];var _0x3bacaf=_0x54da3f[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x4f9f28)['then'](function(_0xa8f369){logger[_0x0e13('0x11')]('entityFound:',_0xa8f369[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0xa8f369[_0x0e13('0x15')]),_0x0e13('0x38'),{'sessionId':_0x3bacaf});return _0x4ba4ec[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x39')});})[_0x0e13('0x1e')](handleError(_0x4ba4ec));};exports[_0x0e13('0x3a')]=function(_0x4b2a3b,_0x514b1d){logger[_0x0e13('0x11')](_0x0e13('0x3b'),_0x4b2a3b[_0x0e13('0x2c')]);var _0x18bc94=holdValidation[_0x0e13('0xb')](_0x4b2a3b['body']);if(_0x18bc94[_0x0e13('0x28')]>0x0){return _0x514b1d[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x18bc94);}var _0x548259=_0x4b2a3b[_0x0e13('0x2c')]['userId'];var _0x17b5c4=_0x4b2a3b[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x548259)[_0x0e13('0x22')](function(_0x35249c){logger['info'](_0x0e13('0x3c'),_0x35249c['name']);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x35249c['name']),_0x0e13('0x3d'),{'sessionId':_0x17b5c4});return _0x514b1d[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x3e')});})['catch'](handleError(_0x514b1d));};exports[_0x0e13('0x3f')]=function(_0x359de5,_0x4d9afd){logger[_0x0e13('0x11')]('unhold\x20fired:',_0x359de5['body']);var _0x56b589=unholdValidation[_0x0e13('0xb')](_0x359de5['body']);if(_0x56b589[_0x0e13('0x28')]>0x0){return _0x4d9afd[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x56b589);}var _0x417a31=_0x359de5[_0x0e13('0x2c')]['userId'];var _0x39cdc8=_0x359de5[_0x0e13('0x2c')][_0x0e13('0x27')];return getAgent(_0x417a31)[_0x0e13('0x22')](function(_0x4539f6){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x4539f6[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x4539f6[_0x0e13('0x15')]),_0x0e13('0x40'),{'sessionId':_0x39cdc8});return _0x4d9afd['status'](0xc8)[_0x0e13('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0x0e13('0x1e')](handleError(_0x4d9afd));};exports[_0x0e13('0x41')]=function(_0x509c31,_0x10799f){logger[_0x0e13('0x11')]('calls\x20fired:',_0x10799f[_0x0e13('0x2c')]);var _0x65111c=callsValidation[_0x0e13('0xb')](_0x509c31[_0x0e13('0x2c')]);if(_0x65111c['length']>0x0){return _0x10799f[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x65111c);}var _0x348ea5=_0x509c31[_0x0e13('0x2c')][_0x0e13('0x2e')];var _0x27df87=respondWithRpcPromise(_0x0e13('0x42'));var _0x1132ac=getAgent(_0x348ea5);return Promise[_0x0e13('0x23')]([_0x27df87,_0x1132ac])['then'](function(_0x3d5c20){var _0xa3db49=_0x3d5c20[0x0];var _0x15ad8f=_0x3d5c20[0x1];var _0x1d670f=_[_0x0e13('0x24')](_0xa3db49[_0x0e13('0x25')],function(_0x17f680){return _0x17f680[_0x0e13('0x26')]==_0x15ad8f['id'];});return _0x10799f[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'count':_0x1d670f[_0x0e13('0x28')],'rows':_0x1d670f});})['catch'](handleError(_0x10799f));};exports[_0x0e13('0x43')]=function(_0x15ddfa,_0x35b1ea){logger[_0x0e13('0x11')](_0x0e13('0x44'),_0x15ddfa[_0x0e13('0x2c')]);var _0x2e17e7=conferenceValidation['validate'](_0x15ddfa[_0x0e13('0x2c')]);if(_0x2e17e7[_0x0e13('0x28')]>0x0){return _0x35b1ea[_0x0e13('0x16')](0x190)[_0x0e13('0x2d')](_0x2e17e7);}var _0x36b553=_0x15ddfa[_0x0e13('0x2c')][_0x0e13('0x2e')];return getAgent(_0x36b553)['then'](function(_0x49774c){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x49774c[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')](_0x0e13('0x33'),_0x49774c[_0x0e13('0x15')]),_0x0e13('0x45'));return _0x35b1ea[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x46')});})[_0x0e13('0x1e')](handleError(_0x35b1ea));};exports[_0x0e13('0x47')]=function(_0x4d3468,_0x378649){logger[_0x0e13('0x11')]('transfer\x20fired:',_0x4d3468['body']);var _0x343275=transferValidation['validate'](_0x4d3468[_0x0e13('0x2c')]);if(_0x343275[_0x0e13('0x28')]>0x0){return _0x378649['status'](0x190)[_0x0e13('0x2d')](_0x343275);}var _0x882e6b=_0x4d3468['body'][_0x0e13('0x2e')];var _0x24329f=_0x4d3468[_0x0e13('0x2c')][_0x0e13('0x27')];var _0xc9d498=_0x4d3468['body'][_0x0e13('0x48')];return getAgent(_0x882e6b)[_0x0e13('0x22')](function(_0x37252e){logger[_0x0e13('0x11')](_0x0e13('0x3c'),_0x37252e[_0x0e13('0x15')]);emit(util[_0x0e13('0x32')]('user:%s',_0x37252e[_0x0e13('0x15')]),_0x0e13('0x49'),{'sessionId':_0x24329f,'transferNumber':_0xc9d498});return _0x378649[_0x0e13('0x16')](0xc8)[_0x0e13('0x2d')]({'error':![],'message':_0x0e13('0x4a')});})[_0x0e13('0x1e')](handleError(_0x378649));}; \ No newline at end of file +var _0xedd9=['originate\x20executed!','hangup','hangup\x20fired:','status','webbar:hangup','answer\x20fired:','entityFound:','webbar:answer','answer\x20executed!','hold\x20fired:','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','stack','name','send','NotFound','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate'];(function(_0x1d2866,_0x358052){var _0x35f978=function(_0x3b4681){while(--_0x3b4681){_0x1d2866['push'](_0x1d2866['shift']());}};_0x35f978(++_0x358052);}(_0xedd9,0xfc));var _0x9edd=function(_0x157539,_0x3e9729){_0x157539=_0x157539-0x0;var _0x4d3340=_0xedd9[_0x157539];return _0x4d3340;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x9edd('0x0'));var db=require(_0x9edd('0x1'))['db'];var config=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var jayson=require(_0x9edd('0x5'));var amiClient=jayson[_0x9edd('0x6')][_0x9edd('0x7')]({'port':0x232a});var logger=require('../../config/logger')(_0x9edd('0x8'));var Redis=require(_0x9edd('0x9'));config[_0x9edd('0xa')]=_[_0x9edd('0xb')](config['redis'],{'host':_0x9edd('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0xa')]));var Schema=require(_0x9edd('0xd'));var originateValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'callNumber':{'type':'string','required':[!![],_0x9edd('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x9edd('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'sessionId':{'type':_0x9edd('0x11'),'required':[!![],_0x9edd('0x12')]},'transferNumber':{'type':_0x9edd('0x11'),'required':[!![],_0x9edd('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]},'sessionId':{'type':_0x9edd('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9edd('0xe'),'required':[!![],_0x9edd('0xf')]}});function emit(_0x4ea60f,_0x5f5bf4,_0x448996){logger[_0x9edd('0x14')](_0x4ea60f,_0x5f5bf4,JSON['stringify'](_0x448996));io['to'](_0x4ea60f)[_0x9edd('0x15')](_0x5f5bf4,_0x448996);}function handleError(_0x35f454){return function(_0x40ba32){console['log'](_0x9edd('0x16'),_0x40ba32,_0x40ba32 instanceof RangeError);logger['error'](_0x40ba32[_0x9edd('0x17')]);if(_0x40ba32 instanceof RangeError){if(_0x40ba32[_0x9edd('0x18')]){delete _0x40ba32['name'];}_0x35f454['status'](0x194)[_0x9edd('0x19')](_0x40ba32);}else{if(_0x40ba32['name']){delete _0x40ba32[_0x9edd('0x18')];}_0x35f454['status'](0x1f4)['send'](_0x40ba32);}};}function checkError(){return function(_0x356751){if(!_0x356751){throw new RangeError(_0x9edd('0x1a'));}return _0x356751;};}function respondWithRpcPromise(_0x4fb7bf,_0x5823bc){return new BPromise(function(_0x341d67,_0x186186){var _0x477878=amiClient;return _0x477878['request'](_0x4fb7bf,_0x5823bc)[_0x9edd('0x1b')](function(_0x1dca43){if(_0x1dca43[_0x9edd('0x1c')]){if(_0x1dca43[_0x9edd('0x1c')][_0x9edd('0x1d')]===0x1f4){return _0x186186(_0x1dca43['error'][_0x9edd('0x1e')]);}return _0x341d67(_0x1dca43[_0x9edd('0x1c')][_0x9edd('0x1e')]);}else{_0x341d67(_0x1dca43[_0x9edd('0x1f')]);}})[_0x9edd('0x20')](function(_0x4d507f){_0x186186(_0x4d507f);});});}function getAgent(_0x4b3d1b){return db[_0x9edd('0x21')][_0x9edd('0x22')]({'where':{'id':_0x4b3d1b,'role':_0x9edd('0x23')}})[_0x9edd('0x1b')](checkError());}function getAgentCheckSession(_0x3c2227,_0x4fe471){return new BPromise(function(_0x57a2cc,_0x214d0a){var _0x257a26=respondWithRpcPromise(_0x9edd('0x24'));var _0x52746a=getAgent(_0x3c2227);Promise[_0x9edd('0x25')]([_0x257a26,_0x52746a])[_0x9edd('0x1b')](function(_0x2ae8dd){var _0x41af53=_0x2ae8dd[0x0];var _0x5eccfb=_0x2ae8dd[0x1];var _0x2155a1=_[_0x9edd('0x26')](_0x41af53[_0x9edd('0x27')],function(_0x12c1bc){return _0x12c1bc[_0x9edd('0x28')]==_0x5eccfb['id']&&_0x12c1bc[_0x9edd('0x29')]==_0x4fe471;});if(_0x2155a1[_0x9edd('0x2a')]==0x1){_0x57a2cc(_0x5eccfb);}else{_0x214d0a(new RangeError(_0x9edd('0x2b')+_0x4fe471+_0x9edd('0x2c')));}});});}exports[_0x9edd('0x2d')]=function(_0x4fd03f,_0x138002){logger[_0x9edd('0x14')](_0x9edd('0x2e'),_0x4fd03f[_0x9edd('0x2f')]);var _0x5af178=originateValidation[_0x9edd('0xd')](_0x4fd03f[_0x9edd('0x2f')]);if(_0x5af178[_0x9edd('0x2a')]>0x0){return _0x138002['status'](0x190)[_0x9edd('0x30')](_0x5af178);}var _0x3990fb=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x21bc30=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x32')];var _0x438a5d=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x33')];var _0x29e789=_0x4fd03f[_0x9edd('0x2f')][_0x9edd('0x34')];return getAgent(_0x3990fb)[_0x9edd('0x1b')](function(_0x5757fc){logger[_0x9edd('0x14')]('entityFound:',_0x5757fc[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x5757fc[_0x9edd('0x18')]),_0x9edd('0x37'),{'callNumber':_0x21bc30,'callerId':_0x438a5d,'callbackUrl':_0x29e789});return _0x138002['status'](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x38')});})[_0x9edd('0x20')](handleError(_0x138002));};exports[_0x9edd('0x39')]=function(_0x1be77f,_0x337e6c){logger[_0x9edd('0x14')](_0x9edd('0x3a'),_0x1be77f[_0x9edd('0x2f')]);var _0x35c16f=hangupValidation['validate'](_0x1be77f[_0x9edd('0x2f')]);if(_0x35c16f['length']>0x0){return _0x337e6c[_0x9edd('0x3b')](0x190)['json'](_0x35c16f);}var _0x30883e=_0x1be77f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x479661=_0x1be77f[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x30883e)[_0x9edd('0x1b')](function(_0x48958a){logger[_0x9edd('0x14')]('entityFound:',_0x48958a[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')]('user:%s',_0x48958a[_0x9edd('0x18')]),_0x9edd('0x3c'),{'sessionId':_0x479661});return _0x337e6c[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':'hangup\x20executed!'});})[_0x9edd('0x20')](handleError(_0x337e6c));};exports['answer']=function(_0x2bdb3f,_0xc1e657){logger['info'](_0x9edd('0x3d'),_0x2bdb3f['body']);var _0x548299=answerValidation[_0x9edd('0xd')](_0x2bdb3f[_0x9edd('0x2f')]);if(_0x548299[_0x9edd('0x2a')]>0x0){return _0xc1e657[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x548299);}var _0x4737ae=_0x2bdb3f[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x18c149=_0x2bdb3f[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x4737ae)[_0x9edd('0x1b')](function(_0x3d5eba){logger[_0x9edd('0x14')](_0x9edd('0x3e'),_0x3d5eba['name']);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x3d5eba[_0x9edd('0x18')]),_0x9edd('0x3f'),{'sessionId':_0x18c149});return _0xc1e657[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x40')});})['catch'](handleError(_0xc1e657));};exports['hold']=function(_0x4bc7a1,_0x4a7dc9){logger['info'](_0x9edd('0x41'),_0x4bc7a1[_0x9edd('0x2f')]);var _0x2b06d3=holdValidation[_0x9edd('0xd')](_0x4bc7a1[_0x9edd('0x2f')]);if(_0x2b06d3['length']>0x0){return _0x4a7dc9[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x2b06d3);}var _0x40e33d=_0x4bc7a1['body'][_0x9edd('0x31')];var _0xfd7bd1=_0x4bc7a1[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x40e33d)[_0x9edd('0x1b')](function(_0x35bdec){logger['info'](_0x9edd('0x3e'),_0x35bdec[_0x9edd('0x18')]);emit(util['format'](_0x9edd('0x36'),_0x35bdec[_0x9edd('0x18')]),'webbar:hold',{'sessionId':_0xfd7bd1});return _0x4a7dc9[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x42')});})['catch'](handleError(_0x4a7dc9));};exports[_0x9edd('0x43')]=function(_0x151157,_0x317a60){logger[_0x9edd('0x14')]('unhold\x20fired:',_0x151157[_0x9edd('0x2f')]);var _0x527727=unholdValidation[_0x9edd('0xd')](_0x151157['body']);if(_0x527727[_0x9edd('0x2a')]>0x0){return _0x317a60[_0x9edd('0x3b')](0x190)['json'](_0x527727);}var _0x8e59bd=_0x151157['body'][_0x9edd('0x31')];var _0xe6b20c=_0x151157[_0x9edd('0x2f')][_0x9edd('0x29')];return getAgent(_0x8e59bd)[_0x9edd('0x1b')](function(_0x18548e){logger[_0x9edd('0x14')](_0x9edd('0x3e'),_0x18548e[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')](_0x9edd('0x36'),_0x18548e['name']),_0x9edd('0x44'),{'sessionId':_0xe6b20c});return _0x317a60[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':'unhold\x20executed!'});})[_0x9edd('0x20')](handleError(_0x317a60));};exports['calls']=function(_0x54d83d,_0x54ecfa){logger[_0x9edd('0x14')](_0x9edd('0x45'),_0x54ecfa[_0x9edd('0x2f')]);var _0x35ddb3=callsValidation['validate'](_0x54d83d['body']);if(_0x35ddb3['length']>0x0){return _0x54ecfa[_0x9edd('0x3b')](0x190)[_0x9edd('0x30')](_0x35ddb3);}var _0xd5090a=_0x54d83d[_0x9edd('0x2f')][_0x9edd('0x31')];var _0x41ec97=respondWithRpcPromise(_0x9edd('0x24'));var _0x1e3087=getAgent(_0xd5090a);return Promise['all']([_0x41ec97,_0x1e3087])[_0x9edd('0x1b')](function(_0x49d0ce){var _0x421e82=_0x49d0ce[0x0];var _0x6a1cfc=_0x49d0ce[0x1];var _0x4b7e68=_[_0x9edd('0x26')](_0x421e82[_0x9edd('0x27')],function(_0x950e53){return _0x950e53['UserId']==_0x6a1cfc['id'];});return _0x54ecfa[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'count':_0x4b7e68[_0x9edd('0x2a')],'rows':_0x4b7e68});})[_0x9edd('0x20')](handleError(_0x54ecfa));};exports[_0x9edd('0x46')]=function(_0x2c3173,_0x53f55b){logger['info'](_0x9edd('0x47'),_0x2c3173['body']);var _0x173ec9=conferenceValidation[_0x9edd('0xd')](_0x2c3173[_0x9edd('0x2f')]);if(_0x173ec9[_0x9edd('0x2a')]>0x0){return _0x53f55b['status'](0x190)[_0x9edd('0x30')](_0x173ec9);}var _0x507cce=_0x2c3173[_0x9edd('0x2f')][_0x9edd('0x31')];return getAgent(_0x507cce)[_0x9edd('0x1b')](function(_0x5ca123){logger[_0x9edd('0x14')]('entityFound:',_0x5ca123[_0x9edd('0x18')]);emit(util[_0x9edd('0x35')]('user:%s',_0x5ca123[_0x9edd('0x18')]),'webbar:conference');return _0x53f55b[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x48')});})['catch'](handleError(_0x53f55b));};exports[_0x9edd('0x49')]=function(_0x321485,_0x45c17d){logger[_0x9edd('0x14')](_0x9edd('0x4a'),_0x321485['body']);var _0x48f017=transferValidation[_0x9edd('0xd')](_0x321485[_0x9edd('0x2f')]);if(_0x48f017['length']>0x0){return _0x45c17d['status'](0x190)['json'](_0x48f017);}var _0x1bc89b=_0x321485['body']['userId'];var _0x3ef9c9=_0x321485[_0x9edd('0x2f')]['sessionId'];var _0xb9ebeb=_0x321485[_0x9edd('0x2f')][_0x9edd('0x4b')];return getAgent(_0x1bc89b)['then'](function(_0x34b229){logger['info'](_0x9edd('0x3e'),_0x34b229[_0x9edd('0x18')]);emit(util['format'](_0x9edd('0x36'),_0x34b229[_0x9edd('0x18')]),'webbar:transfer',{'sessionId':_0x3ef9c9,'transferNumber':_0xb9ebeb});return _0x45c17d[_0x9edd('0x3b')](0xc8)[_0x9edd('0x30')]({'error':![],'message':_0x9edd('0x4c')});})[_0x9edd('0x20')](handleError(_0x45c17d));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 705878b..a3f52f2 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x44b2ea,_0x596cf6){var _0x5f0608=function(_0x68d00c){while(--_0x68d00c){_0x44b2ea['push'](_0x44b2ea['shift']());}};_0x5f0608(++_0x596cf6);}(_0x2a07,0x74));var _0x72a0=function(_0x4dbe5c,_0x36ed26){_0x4dbe5c=_0x4dbe5c-0x0;var _0x57bd05=_0x2a07[_0x4dbe5c];return _0x57bd05;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['get'](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller['getDispositions']);router[_0x72a0('0xa')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x13')]);router[_0x72a0('0xa')]('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x14')]);router[_0x72a0('0xa')](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x16')]);router[_0x72a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x72a0('0x17')](_0x72a0('0x11'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x18')]);router[_0x72a0('0x17')](_0x72a0('0x12'),auth['isAuthenticated'](),controller[_0x72a0('0x19')]);router[_0x72a0('0x17')](_0x72a0('0x1a'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1b')]);router['post'](_0x72a0('0x15'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x1c')]);router['post'](_0x72a0('0x1d'),controller[_0x72a0('0x1e')]);router[_0x72a0('0x17')](_0x72a0('0x1f'),auth['isAuthenticated'](),controller[_0x72a0('0x20')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x21')]);router['delete'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x22')]);router[_0x72a0('0x23')]('/:id/dispositions',auth[_0x72a0('0xb')](),controller[_0x72a0('0x24')]);router[_0x72a0('0x23')](_0x72a0('0x12'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x25')]);router['delete']('/:id/users',auth[_0x72a0('0xb')](),controller[_0x72a0('0x26')]);module[_0x72a0('0x27')]=router; \ No newline at end of file +var _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x91067d,_0x52e718){var _0x555626=function(_0x5d7247){while(--_0x5d7247){_0x91067d['push'](_0x91067d['shift']());}};_0x555626(++_0x52e718);}(_0x4137,0xf8));var _0x7413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4137[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f75c72a..ea0f3b5 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6f5=['randomstring','STRING','name','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xa6f5,0x10d));var _0x5a6f=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa6f5[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x5a6f('0x0'));var rs=require(_0x5a6f('0x1'));module['exports']={'name':{'type':Sequelize[_0x5a6f('0x2')],'unique':_0x5a6f('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x5a6f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5a6f('0x2')]},'type':{'type':Sequelize[_0x5a6f('0x4')](_0x5a6f('0x5'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5a6f('0x6')],'defaultValue':function(){return _0x5a6f('0x7');}},'notificationSound':{'type':Sequelize[_0x5a6f('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5a6f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a6f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a6f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a6f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a6f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a6f('0x9')],'comment':_0x5a6f('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5a6f('0xb'),'set':function(_0x45b03f){if(!_0x45b03f){this[_0x5a6f('0xc')](_0x5a6f('0xd'),null);}this['setDataValue'](_0x5a6f('0xe'),_0x45b03f);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5e46=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','generate','ENUM','twilio','TEXT'];(function(_0x14c2cc,_0x538682){var _0x430121=function(_0x56fa8a){while(--_0x56fa8a){_0x14c2cc['push'](_0x14c2cc['shift']());}};_0x430121(++_0x538682);}(_0x5e46,0x1da));var _0x65e4=function(_0x32c53b,_0x3d734c){_0x32c53b=_0x32c53b-0x0;var _0x1f31b3=_0x5e46[_0x32c53b];return _0x1f31b3;};'use strict';var Sequelize=require(_0x65e4('0x0'));var rs=require('randomstring');module[_0x65e4('0x1')]={'name':{'type':Sequelize[_0x65e4('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x65e4('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x65e4('0x2')],'defaultValue':function(){return rs[_0x65e4('0x3')]();}},'phone':{'type':Sequelize[_0x65e4('0x2')]},'type':{'type':Sequelize[_0x65e4('0x4')](_0x65e4('0x5'))},'accountSid':{'type':Sequelize[_0x65e4('0x2')]},'authToken':{'type':Sequelize[_0x65e4('0x2')]},'notificationTemplate':{'type':Sequelize[_0x65e4('0x6')],'defaultValue':function(){return _0x65e4('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x65e4('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x65e4('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x65e4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x65e4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x65e4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x65e4('0x9')],'comment':_0x65e4('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x65e4('0x8')],'defaultValue':![],'comment':_0x65e4('0xb'),'set':function(_0xac8d35){if(!_0xac8d35){this[_0x65e4('0xc')]('mandatoryDispositionPauseId',null);}this[_0x65e4('0xc')]('mandatoryDisposition',_0xac8d35);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 11e5e46..2e2bdcf 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e08=['WhatsappInteraction','interaction','created','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','send','\x0a','List','out','user','Messages','dataValues','push','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','intersection','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','nolimit','order','removeDispositions','CannedAnswer','removeAnswers','ids','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','account','applications','asc','Applications','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','CmContact'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x7e08,0xcc));var _0x87e0=function(_0x411644,_0x1cf987){_0x411644=_0x411644-0x0;var _0x4e1813=_0x7e08[_0x411644];return _0x4e1813;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87e0('0x0'));var jsonpatch=require(_0x87e0('0x1'));var rp=require('request-promise');var moment=require(_0x87e0('0x2'));var BPromise=require(_0x87e0('0x3'));var Mustache=require(_0x87e0('0x4'));var util=require(_0x87e0('0x5'));var path=require(_0x87e0('0x6'));var sox=require('sox');var csv=require(_0x87e0('0x7'));var ejs=require(_0x87e0('0x8'));var fs=require('fs');var fs_extra=require(_0x87e0('0x9'));var _=require(_0x87e0('0xa'));var squel=require('squel');var crypto=require(_0x87e0('0xb'));var jsforce=require(_0x87e0('0xc'));var deskjs=require(_0x87e0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x87e0('0xe'));var Redis=require(_0x87e0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x87e0('0x10'));var as=require(_0x87e0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87e0('0x12'))(_0x87e0('0x13'));var utils=require(_0x87e0('0x14'));var config=require(_0x87e0('0x15'));var licenseUtil=require(_0x87e0('0x16'));var db=require(_0x87e0('0x17'))['db'];config[_0x87e0('0x18')]=_[_0x87e0('0x19')](config[_0x87e0('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x87e0('0x1a'))[_0x87e0('0x1b')](socket);var jayson=require(_0x87e0('0x1c'));var client=jayson[_0x87e0('0x1d')][_0x87e0('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x182d43,_0x464260,_0x5aed00,_0x1fccd7){return new BPromise(function(_0x5eb30c,_0x942096){var _0x334687=_0x1fccd7||client;return _0x334687[_0x87e0('0x1f')](_0x182d43,_0x5aed00)[_0x87e0('0x20')](function(_0x2d919a){logger[_0x87e0('0x21')](_0x87e0('0x22'),_0x464260,_0x87e0('0x23'));logger[_0x87e0('0x24')](_0x87e0('0x25'),_0x464260,_0x87e0('0x23'),JSON[_0x87e0('0x26')](_0x2d919a));if(_0x2d919a[_0x87e0('0x27')]){if(_0x2d919a[_0x87e0('0x27')][_0x87e0('0x28')]===0x1f4){logger[_0x87e0('0x27')](_0x87e0('0x22'),_0x464260,_0x2d919a[_0x87e0('0x27')][_0x87e0('0x29')]);return _0x942096(_0x2d919a[_0x87e0('0x27')][_0x87e0('0x29')]);}logger['error'](_0x87e0('0x22'),_0x464260,_0x2d919a[_0x87e0('0x27')][_0x87e0('0x29')]);return _0x5eb30c(_0x2d919a['error'][_0x87e0('0x29')]);}else{logger['info'](_0x87e0('0x22'),_0x464260,_0x87e0('0x23'));_0x5eb30c(_0x2d919a[_0x87e0('0x2a')][_0x87e0('0x29')]);}})[_0x87e0('0x2b')](function(_0x17b8e1){logger['error'](_0x87e0('0x22'),_0x464260,_0x17b8e1);_0x942096(_0x17b8e1);});});}function respondWithStatusCode(_0x417be5,_0x5ccd8a){_0x5ccd8a=_0x5ccd8a||0xcc;return function(_0x56aa64){if(_0x56aa64){return _0x417be5[_0x87e0('0x2c')](_0x5ccd8a);}return _0x417be5[_0x87e0('0x2d')](_0x5ccd8a)[_0x87e0('0x2e')]();};}function respondWithResult(_0x9671ac,_0x4c8ce9){_0x4c8ce9=_0x4c8ce9||0xc8;return function(_0x5d922a){if(_0x5d922a){return _0x9671ac[_0x87e0('0x2d')](_0x4c8ce9)[_0x87e0('0x2f')](_0x5d922a);}};}function respondWithFilteredResult(_0x35b841,_0x532e5a){return function(_0x29b689){if(_0x29b689){var _0x545285=typeof _0x532e5a[_0x87e0('0x30')]==='undefined'&&typeof _0x532e5a['limit']===_0x87e0('0x31');var _0x38e5e8=_0x29b689[_0x87e0('0x32')];var _0x48f81d=_0x545285?0x0:_0x532e5a[_0x87e0('0x30')];var _0x196b58=_0x545285?_0x29b689['count']:_0x532e5a[_0x87e0('0x30')]+_0x532e5a[_0x87e0('0x33')];var _0x176f71;if(_0x196b58>=_0x38e5e8){_0x196b58=_0x38e5e8;_0x176f71=0xc8;}else{_0x176f71=0xce;}_0x35b841[_0x87e0('0x2d')](_0x176f71);return _0x35b841['set']('Content-Range',_0x48f81d+'-'+_0x196b58+'/'+_0x38e5e8)['json'](_0x29b689);}return null;};}function patchUpdates(_0x557012){return function(_0x26c172){try{jsonpatch[_0x87e0('0x34')](_0x26c172,_0x557012,!![]);}catch(_0x307103){return BPromise[_0x87e0('0x35')](_0x307103);}return _0x26c172['save']();};}function saveUpdates(_0x4552a0,_0x40144f){return function(_0x11d69a){if(_0x11d69a){return _0x11d69a[_0x87e0('0x36')](_0x4552a0)[_0x87e0('0x20')](function(_0x54e1e2){return _0x54e1e2;});}return null;};}function removeEntity(_0x8af237,_0x6c06be){return function(_0xec9d33){if(_0xec9d33){return _0xec9d33[_0x87e0('0x37')]()[_0x87e0('0x20')](function(){var _0x1083b7=_0xec9d33[_0x87e0('0x38')]({'plain':!![]});var _0x2710d9=_0x87e0('0x39');return db[_0x87e0('0x3a')][_0x87e0('0x37')]({'where':{'type':_0x2710d9,'resourceId':_0x1083b7['id']}})['then'](function(){return _0xec9d33;});})[_0x87e0('0x20')](function(){_0x8af237[_0x87e0('0x2d')](0xcc)[_0x87e0('0x2e')]();});}};}function handleEntityNotFound(_0x37c09a,_0x19d134){return function(_0x38f4dc){if(!_0x38f4dc){_0x37c09a[_0x87e0('0x2c')](0x194);}return _0x38f4dc;};}function handleError(_0x27ab75,_0x5dfc18){_0x5dfc18=_0x5dfc18||0x1f4;return function(_0x5a4b4f){logger[_0x87e0('0x27')](_0x5a4b4f[_0x87e0('0x3b')]);if(_0x5a4b4f[_0x87e0('0x3c')]){delete _0x5a4b4f[_0x87e0('0x3c')];}_0x27ab75['status'](_0x5dfc18)['send'](_0x5a4b4f);};}exports['index']=function(_0x4faca3,_0x39a8bb){var _0x1e7489={'include':[{'model':db['Pause'],'as':_0x87e0('0x3d')}]},_0x10844a={},_0x404662={'count':0x0,'rows':[]};var _0x26c00c=_[_0x87e0('0x3e')](db[_0x87e0('0x3f')][_0x87e0('0x40')],function(_0x5946a5){return{'name':_0x5946a5[_0x87e0('0x41')],'type':_0x5946a5[_0x87e0('0x42')]['key']};});_0x10844a[_0x87e0('0x43')]=_[_0x87e0('0x3e')](_0x26c00c,'name');_0x10844a[_0x87e0('0x44')]=_[_0x87e0('0x45')](_0x4faca3[_0x87e0('0x44')]);_0x10844a[_0x87e0('0x46')]=_['intersection'](_0x10844a[_0x87e0('0x43')],_0x10844a[_0x87e0('0x44')]);_0x1e7489[_0x87e0('0x47')]=_['intersection'](_0x10844a[_0x87e0('0x43')],qs['fields'](_0x4faca3['query'][_0x87e0('0x48')]));_0x1e7489[_0x87e0('0x47')]=_0x1e7489[_0x87e0('0x47')]['length']?_0x1e7489['attributes']:_0x10844a[_0x87e0('0x43')];if(!_0x4faca3['query'][_0x87e0('0x49')]('nolimit')){_0x1e7489[_0x87e0('0x33')]=qs['limit'](_0x4faca3[_0x87e0('0x44')][_0x87e0('0x33')]);_0x1e7489['offset']=qs['offset'](_0x4faca3[_0x87e0('0x44')][_0x87e0('0x30')]);}_0x1e7489['order']=qs[_0x87e0('0x4a')](_0x4faca3[_0x87e0('0x44')][_0x87e0('0x4a')]);_0x1e7489[_0x87e0('0x4b')]=qs[_0x87e0('0x46')](_[_0x87e0('0x4c')](_0x4faca3[_0x87e0('0x44')],_0x10844a['filters']),_0x26c00c);if(_0x4faca3['query'][_0x87e0('0x4d')]){_0x1e7489[_0x87e0('0x4b')]=_['merge'](_0x1e7489[_0x87e0('0x4b')],{'$or':_[_0x87e0('0x3e')](_0x26c00c,function(_0x28e8f8){if(_0x28e8f8[_0x87e0('0x42')]!==_0x87e0('0x4e')){var _0x4ae43c={};_0x4ae43c[_0x28e8f8[_0x87e0('0x3c')]]={'$like':'%'+_0x4faca3[_0x87e0('0x44')]['filter']+'%'};return _0x4ae43c;}})});}_0x1e7489=_['merge']({},_0x1e7489,_0x4faca3[_0x87e0('0x4f')]);var _0x394d23={'where':_0x1e7489[_0x87e0('0x4b')]};return db[_0x87e0('0x3f')][_0x87e0('0x32')](_0x394d23)[_0x87e0('0x20')](function(_0x35337b){_0x404662['count']=_0x35337b;if(_0x4faca3[_0x87e0('0x44')][_0x87e0('0x50')]){_0x1e7489[_0x87e0('0x51')]=[{'all':!![]}];}return db[_0x87e0('0x3f')][_0x87e0('0x52')](_0x1e7489);})[_0x87e0('0x20')](function(_0x5c7465){_0x404662[_0x87e0('0x53')]=_0x5c7465;return _0x404662;})[_0x87e0('0x20')](respondWithFilteredResult(_0x39a8bb,_0x1e7489))[_0x87e0('0x2b')](handleError(_0x39a8bb,null));};exports[_0x87e0('0x54')]=function(_0x1fd489,_0x4e21c5){var _0x48e50c={'raw':![],'where':{'id':_0x1fd489['params']['id']},'include':[{'model':db[_0x87e0('0x55')],'as':_0x87e0('0x3d')}]},_0x303e7e={};_0x303e7e[_0x87e0('0x43')]=_[_0x87e0('0x45')](db[_0x87e0('0x3f')][_0x87e0('0x40')]);_0x303e7e[_0x87e0('0x44')]=_[_0x87e0('0x45')](_0x1fd489[_0x87e0('0x44')]);_0x303e7e[_0x87e0('0x46')]=_[_0x87e0('0x56')](_0x303e7e[_0x87e0('0x43')],_0x303e7e[_0x87e0('0x44')]);_0x48e50c[_0x87e0('0x47')]=_[_0x87e0('0x56')](_0x303e7e['model'],qs[_0x87e0('0x48')](_0x1fd489[_0x87e0('0x44')]['fields']));_0x48e50c[_0x87e0('0x47')]=_0x48e50c[_0x87e0('0x47')][_0x87e0('0x57')]?_0x48e50c['attributes']:_0x303e7e[_0x87e0('0x43')];if(_0x1fd489[_0x87e0('0x44')][_0x87e0('0x50')]){_0x48e50c[_0x87e0('0x51')]=[{'all':!![]}];}_0x48e50c=_[_0x87e0('0x58')]({},_0x48e50c,_0x1fd489[_0x87e0('0x4f')]);return db[_0x87e0('0x3f')][_0x87e0('0x59')](_0x48e50c)['then'](handleEntityNotFound(_0x4e21c5,null))['then'](respondWithResult(_0x4e21c5,null))[_0x87e0('0x2b')](handleError(_0x4e21c5,null));};exports[_0x87e0('0x5a')]=function(_0x14b29f,_0x298a92){return db[_0x87e0('0x3f')][_0x87e0('0x5a')](_0x14b29f[_0x87e0('0x5b')],{})[_0x87e0('0x20')](function(_0x359d1d){var _0x126f64=_0x14b29f['user'][_0x87e0('0x38')]({'plain':!![]});if(!_0x126f64)throw new Error(_0x87e0('0x5c'));if(_0x126f64[_0x87e0('0x5d')]==='user'){var _0x4e907a=_0x359d1d[_0x87e0('0x38')]({'plain':!![]});var _0x4acc20=_0x87e0('0x39');return db['UserProfileSection'][_0x87e0('0x59')]({'where':{'name':_0x4acc20,'userProfileId':_0x126f64[_0x87e0('0x5e')]},'raw':!![]})[_0x87e0('0x20')](function(_0x3de90d){if(_0x3de90d&&_0x3de90d['autoAssociation']===0x0){return db[_0x87e0('0x3a')]['create']({'name':_0x4e907a['name'],'resourceId':_0x4e907a['id'],'type':_0x3de90d[_0x87e0('0x3c')],'sectionId':_0x3de90d['id']},{})[_0x87e0('0x20')](function(){return _0x359d1d;});}else{return _0x359d1d;}})[_0x87e0('0x2b')](function(_0x4f4f84){logger['error'](_0x87e0('0x5f'),_0x4f4f84);throw _0x4f4f84;});}return _0x359d1d;})[_0x87e0('0x20')](respondWithResult(_0x298a92,0xc9))[_0x87e0('0x2b')](handleError(_0x298a92,null));};exports['update']=function(_0x5d9b74,_0x2e418c){if(_0x5d9b74[_0x87e0('0x5b')]['id']){delete _0x5d9b74['body']['id'];}return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x5d9b74['params']['id']},'include':[{'model':db[_0x87e0('0x55')],'as':_0x87e0('0x3d')}]})[_0x87e0('0x20')](handleEntityNotFound(_0x2e418c,null))[_0x87e0('0x20')](saveUpdates(_0x5d9b74[_0x87e0('0x5b')],null))[_0x87e0('0x20')](respondWithResult(_0x2e418c,null))[_0x87e0('0x2b')](handleError(_0x2e418c,null));};exports['destroy']=function(_0x1641c6,_0x3488fb){return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x1641c6[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x3488fb,null))[_0x87e0('0x20')](removeEntity(_0x3488fb,null))[_0x87e0('0x2b')](handleError(_0x3488fb,null));};exports['describe']=function(_0x1d6175,_0x3546ef){return db[_0x87e0('0x3f')][_0x87e0('0x61')]()[_0x87e0('0x20')](respondWithResult(_0x3546ef,null))[_0x87e0('0x2b')](handleError(_0x3546ef,null));};exports[_0x87e0('0x62')]=function(_0x38f26b,_0x7863d7,_0x541eb7){if(_0x38f26b[_0x87e0('0x5b')]['id']){delete _0x38f26b['body']['id'];}return db['WhatsappAccount'][_0x87e0('0x59')]({'where':{'id':_0x38f26b[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x7863d7,null))[_0x87e0('0x20')](function(_0x14a573){if(_0x14a573){_0x38f26b[_0x87e0('0x5b')][_0x87e0('0x63')]=_0x14a573['id'];return db['Disposition'][_0x87e0('0x5a')](_0x38f26b[_0x87e0('0x5b')]);}})[_0x87e0('0x20')](respondWithResult(_0x7863d7,null))[_0x87e0('0x2b')](handleError(_0x7863d7,null));};exports[_0x87e0('0x64')]=function(_0x59e33a,_0x4d6279,_0x2909bf){var _0x2cdde8={'raw':![],'where':{}};var _0x162715={};var _0x4739f8={'count':0x0,'rows':[]};return db[_0x87e0('0x3f')][_0x87e0('0x65')]({'where':{'id':_0x59e33a[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x4d6279,null))[_0x87e0('0x20')](function(_0xd38ced){if(_0xd38ced){_0x162715[_0x87e0('0x43')]=_[_0x87e0('0x45')](db[_0x87e0('0x66')][_0x87e0('0x40')]);_0x162715[_0x87e0('0x44')]=_[_0x87e0('0x45')](_0x59e33a[_0x87e0('0x44')]);_0x162715[_0x87e0('0x46')]=_[_0x87e0('0x56')](_0x162715[_0x87e0('0x43')],_0x162715[_0x87e0('0x44')]);_0x2cdde8[_0x87e0('0x47')]=_[_0x87e0('0x56')](_0x162715[_0x87e0('0x43')],qs[_0x87e0('0x48')](_0x59e33a[_0x87e0('0x44')]['fields']));_0x2cdde8[_0x87e0('0x47')]=_0x2cdde8['attributes']['length']?_0x2cdde8[_0x87e0('0x47')]:_0x162715[_0x87e0('0x43')];if(!_0x59e33a[_0x87e0('0x44')][_0x87e0('0x49')](_0x87e0('0x67'))){_0x2cdde8[_0x87e0('0x33')]=qs[_0x87e0('0x33')](_0x59e33a[_0x87e0('0x44')][_0x87e0('0x33')]);_0x2cdde8[_0x87e0('0x30')]=qs[_0x87e0('0x30')](_0x59e33a[_0x87e0('0x44')][_0x87e0('0x30')]);}_0x2cdde8[_0x87e0('0x68')]=qs[_0x87e0('0x4a')](_0x59e33a[_0x87e0('0x44')][_0x87e0('0x4a')]);_0x2cdde8[_0x87e0('0x4b')]=qs['filters'](_['pick'](_0x59e33a['query'],_0x162715['filters']));_0x2cdde8[_0x87e0('0x4b')][_0x87e0('0x63')]=_0xd38ced['id'];if(_0x59e33a[_0x87e0('0x44')][_0x87e0('0x4d')]){_0x2cdde8['where']=_[_0x87e0('0x58')](_0x2cdde8['where'],{'$or':_[_0x87e0('0x3e')](_0x2cdde8[_0x87e0('0x47')],function(_0x42f69a){var _0x238a10={};_0x238a10[_0x42f69a]={'$like':'%'+_0x59e33a['query']['filter']+'%'};return _0x238a10;})});}_0x2cdde8=_[_0x87e0('0x58')]({},_0x2cdde8,_0x59e33a[_0x87e0('0x4f')]);return db['Disposition'][_0x87e0('0x32')]({'where':_0x2cdde8[_0x87e0('0x4b')]})['then'](function(_0x14a258){_0x4739f8[_0x87e0('0x32')]=_0x14a258;if(_0x59e33a[_0x87e0('0x44')][_0x87e0('0x50')]){_0x2cdde8['include']=[{'all':!![]}];}return db['Disposition'][_0x87e0('0x52')](_0x2cdde8);})[_0x87e0('0x20')](function(_0xa1124b){_0x4739f8[_0x87e0('0x53')]=_0xa1124b;return _0x4739f8;});}})[_0x87e0('0x20')](respondWithFilteredResult(_0x4d6279,_0x2cdde8))[_0x87e0('0x2b')](handleError(_0x4d6279,null));};exports[_0x87e0('0x69')]=function(_0x1b3bb1,_0x2ce810,_0x5599b2){return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x1b3bb1[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x2ce810,null))[_0x87e0('0x20')](function(_0xc19b1e){if(_0xc19b1e){return _0xc19b1e[_0x87e0('0x69')](_0x1b3bb1[_0x87e0('0x44')]['ids']);}})[_0x87e0('0x20')](respondWithStatusCode(_0x2ce810,null))['catch'](handleError(_0x2ce810,null));};exports['addAnswer']=function(_0x4e342f,_0x1044a4,_0x550593){if(_0x4e342f[_0x87e0('0x5b')]['id']){delete _0x4e342f[_0x87e0('0x5b')]['id'];}return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x4e342f[_0x87e0('0x60')]['id']}})['then'](handleEntityNotFound(_0x1044a4,null))[_0x87e0('0x20')](function(_0x19687a){if(_0x19687a){_0x4e342f['body'][_0x87e0('0x63')]=_0x19687a['id'];return db[_0x87e0('0x6a')]['create'](_0x4e342f['body']);}})[_0x87e0('0x20')](respondWithResult(_0x1044a4,null))[_0x87e0('0x2b')](handleError(_0x1044a4,null));};exports['getAnswers']=function(_0x5b36df,_0x3fa8f6,_0x48e942){var _0x2ff330={'raw':![],'where':{}};var _0x20d802={};var _0x4bcac1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x87e0('0x65')]({'where':{'id':_0x5b36df[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x3fa8f6,null))[_0x87e0('0x20')](function(_0x35486e){if(_0x35486e){_0x20d802[_0x87e0('0x43')]=_[_0x87e0('0x45')](db[_0x87e0('0x6a')][_0x87e0('0x40')]);_0x20d802[_0x87e0('0x44')]=_[_0x87e0('0x45')](_0x5b36df[_0x87e0('0x44')]);_0x20d802[_0x87e0('0x46')]=_[_0x87e0('0x56')](_0x20d802[_0x87e0('0x43')],_0x20d802[_0x87e0('0x44')]);_0x2ff330[_0x87e0('0x47')]=_[_0x87e0('0x56')](_0x20d802['model'],qs['fields'](_0x5b36df[_0x87e0('0x44')]['fields']));_0x2ff330[_0x87e0('0x47')]=_0x2ff330[_0x87e0('0x47')][_0x87e0('0x57')]?_0x2ff330[_0x87e0('0x47')]:_0x20d802[_0x87e0('0x43')];if(!_0x5b36df['query'][_0x87e0('0x49')](_0x87e0('0x67'))){_0x2ff330['limit']=qs['limit'](_0x5b36df[_0x87e0('0x44')][_0x87e0('0x33')]);_0x2ff330['offset']=qs['offset'](_0x5b36df[_0x87e0('0x44')]['offset']);}_0x2ff330[_0x87e0('0x68')]=qs[_0x87e0('0x4a')](_0x5b36df[_0x87e0('0x44')][_0x87e0('0x4a')]);_0x2ff330[_0x87e0('0x4b')]=qs[_0x87e0('0x46')](_[_0x87e0('0x4c')](_0x5b36df[_0x87e0('0x44')],_0x20d802[_0x87e0('0x46')]));_0x2ff330['where'][_0x87e0('0x63')]=_0x35486e['id'];if(_0x5b36df[_0x87e0('0x44')][_0x87e0('0x4d')]){_0x2ff330['where']=_[_0x87e0('0x58')](_0x2ff330[_0x87e0('0x4b')],{'$or':_['map'](_0x2ff330['attributes'],function(_0x3c004f){var _0xe9fb4={};_0xe9fb4[_0x3c004f]={'$like':'%'+_0x5b36df[_0x87e0('0x44')][_0x87e0('0x4d')]+'%'};return _0xe9fb4;})});}_0x2ff330=_[_0x87e0('0x58')]({},_0x2ff330,_0x5b36df[_0x87e0('0x4f')]);return db['CannedAnswer']['count']({'where':_0x2ff330[_0x87e0('0x4b')]})[_0x87e0('0x20')](function(_0x476582){_0x4bcac1[_0x87e0('0x32')]=_0x476582;if(_0x5b36df[_0x87e0('0x44')][_0x87e0('0x50')]){_0x2ff330['include']=[{'all':!![]}];}return db[_0x87e0('0x6a')]['findAll'](_0x2ff330);})[_0x87e0('0x20')](function(_0x53821f){_0x4bcac1[_0x87e0('0x53')]=_0x53821f;return _0x4bcac1;});}})[_0x87e0('0x20')](respondWithFilteredResult(_0x3fa8f6,_0x2ff330))[_0x87e0('0x2b')](handleError(_0x3fa8f6,null));};exports[_0x87e0('0x6b')]=function(_0x4c0499,_0x289d21,_0x21266b){return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x4c0499[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x289d21,null))[_0x87e0('0x20')](function(_0x2b8fea){if(_0x2b8fea){return _0x2b8fea['removeAnswers'](_0x4c0499[_0x87e0('0x44')][_0x87e0('0x6c')]);}})[_0x87e0('0x20')](respondWithStatusCode(_0x289d21,null))[_0x87e0('0x2b')](handleError(_0x289d21,null));};exports[_0x87e0('0x6d')]=function(_0x513834,_0x382b16,_0x22c9ff){return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x513834[_0x87e0('0x60')]['id']}})['then'](handleEntityNotFound(_0x382b16,null))['then'](function(_0x5d31d5){if(_0x5d31d5){return _0x5d31d5['addAgents'](_0x513834['body'][_0x87e0('0x6c')],_[_0x87e0('0x6e')](_0x513834[_0x87e0('0x5b')],[_0x87e0('0x6c'),'id'])||{})[_0x87e0('0x6f')](function(_0x1c2384){for(var _0x5857b6=0x0;_0x5857b6<_0x513834[_0x87e0('0x5b')][_0x87e0('0x6c')][_0x87e0('0x57')];_0x5857b6+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x513834[_0x87e0('0x5b')][_0x87e0('0x6c')][_0x5857b6]),'WhatsappAccountId':Number(_0x513834['params']['id'])});}return _0x1c2384;});}})[_0x87e0('0x20')](respondWithResult(_0x382b16,null))[_0x87e0('0x2b')](handleError(_0x382b16,null));};exports['removeAgents']=function(_0x5f1d54,_0xd9fa83,_0x4198d4){return db[_0x87e0('0x3f')]['find']({'where':{'id':_0x5f1d54[_0x87e0('0x60')]['id']}})['then'](handleEntityNotFound(_0xd9fa83,null))[_0x87e0('0x20')](function(_0x163713){if(_0x163713){return _0x163713[_0x87e0('0x70')](_0x5f1d54['query'][_0x87e0('0x6c')])[_0x87e0('0x20')](function(){if(_[_0x87e0('0x71')](_0x5f1d54[_0x87e0('0x44')][_0x87e0('0x6c')])){for(var _0xd96bf4=0x0;_0xd96bf4<_0x5f1d54[_0x87e0('0x44')][_0x87e0('0x6c')]['length'];_0xd96bf4+=0x1){socket[_0x87e0('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x5f1d54['query'][_0x87e0('0x6c')][_0xd96bf4]),'WhatsappAccountId':Number(_0x5f1d54[_0x87e0('0x60')]['id'])});}}else{socket[_0x87e0('0x72')](_0x87e0('0x73'),{'UserId':Number(_0x5f1d54[_0x87e0('0x44')][_0x87e0('0x6c')]),'WhatsappAccountId':Number(_0x5f1d54['params']['id'])});}});}})[_0x87e0('0x20')](respondWithStatusCode(_0xd9fa83,null))['catch'](handleError(_0xd9fa83,null));};exports[_0x87e0('0x74')]=function(_0x502dc8,_0x20b744,_0x2d9917){var _0x531418={};var _0x11099a={};var _0x2faec6;var _0x53520b;return db[_0x87e0('0x3f')][_0x87e0('0x65')]({'where':{'id':_0x502dc8[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x20b744,null))['then'](function(_0xafae08){if(_0xafae08){_0x2faec6=_0xafae08;_0x11099a[_0x87e0('0x43')]=_[_0x87e0('0x45')](db[_0x87e0('0x75')][_0x87e0('0x40')]);_0x11099a[_0x87e0('0x44')]=_[_0x87e0('0x45')](_0x502dc8[_0x87e0('0x44')]);_0x11099a[_0x87e0('0x46')]=_[_0x87e0('0x56')](_0x11099a[_0x87e0('0x43')],_0x11099a[_0x87e0('0x44')]);_0x531418[_0x87e0('0x47')]=_['intersection'](_0x11099a['model'],qs[_0x87e0('0x48')](_0x502dc8['query']['fields']));_0x531418['attributes']=_0x531418[_0x87e0('0x47')][_0x87e0('0x57')]?_0x531418['attributes']:_0x11099a['model'];_0x531418['order']=qs['sort'](_0x502dc8[_0x87e0('0x44')][_0x87e0('0x4a')]);_0x531418['where']=qs[_0x87e0('0x46')](_[_0x87e0('0x4c')](_0x502dc8[_0x87e0('0x44')],_0x11099a[_0x87e0('0x46')]));if(_0x502dc8[_0x87e0('0x44')][_0x87e0('0x4d')]){_0x531418[_0x87e0('0x4b')]=_['merge'](_0x531418[_0x87e0('0x4b')],{'$or':_[_0x87e0('0x3e')](_0x531418[_0x87e0('0x47')],function(_0x309ab1){var _0x3479ff={};_0x3479ff[_0x309ab1]={'$like':'%'+_0x502dc8[_0x87e0('0x44')][_0x87e0('0x4d')]+'%'};return _0x3479ff;})});}_0x531418=_['merge']({},_0x531418,_0x502dc8[_0x87e0('0x4f')]);return _0x2faec6[_0x87e0('0x74')](_0x531418);}})[_0x87e0('0x20')](function(_0x1988fe){if(_0x1988fe){_0x53520b=_0x1988fe['length'];if(!_0x502dc8['query'][_0x87e0('0x49')](_0x87e0('0x67'))){_0x531418['limit']=qs[_0x87e0('0x33')](_0x502dc8[_0x87e0('0x44')][_0x87e0('0x33')]);_0x531418[_0x87e0('0x30')]=qs['offset'](_0x502dc8[_0x87e0('0x44')]['offset']);}return _0x2faec6[_0x87e0('0x74')](_0x531418);}})['then'](function(_0x275a18){if(_0x275a18){return _0x275a18?{'count':_0x53520b,'rows':_0x275a18}:null;}})[_0x87e0('0x20')](respondWithResult(_0x20b744,null))[_0x87e0('0x2b')](handleError(_0x20b744,null));};exports['addApplications']=function(_0x4ad1f8,_0x2cf84e,_0x509137){return db['WhatsappAccount']['findOne']({'where':{'id':_0x4ad1f8[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x2cf84e,null))['then'](function(_0x511bad){if(_0x511bad){return db['sequelize'][_0x87e0('0x76')](function(_0x226f6d){return db[_0x87e0('0x77')][_0x87e0('0x37')]({'where':{'WhatsappAccountId':_0x4ad1f8[_0x87e0('0x60')]['id']},'transaction':_0x226f6d})[_0x87e0('0x20')](function(_0x165144){var _0x2c7785=_[_0x87e0('0x3e')](_0x4ad1f8[_0x87e0('0x5b')],function(_0x27ef80){_0x27ef80[_0x87e0('0x63')]=_0x4ad1f8['params']['id'];return _0x27ef80;});return db[_0x87e0('0x77')]['bulkCreate'](_0x2c7785,{'transaction':_0x226f6d});});})[_0x87e0('0x20')](function(){return db[_0x87e0('0x77')][_0x87e0('0x78')]({'where':{'WhatsappAccountId':_0x4ad1f8[_0x87e0('0x60')]['id']},'order':_0x87e0('0x79')});});}})[_0x87e0('0x20')](respondWithResult(_0x2cf84e,null))[_0x87e0('0x2b')](handleError(_0x2cf84e,null));};exports[_0x87e0('0x7a')]=function(_0x38b6bf,_0x407261,_0x27f71c){var _0x175f0c={};var _0x2098af={};var _0x489096;var _0x582d1e;return db[_0x87e0('0x3f')][_0x87e0('0x65')]({'where':{'id':_0x38b6bf[_0x87e0('0x60')]['id']}})[_0x87e0('0x20')](handleEntityNotFound(_0x407261,null))[_0x87e0('0x20')](function(_0x48b878){if(_0x48b878){_0x489096=_0x48b878;_0x2098af[_0x87e0('0x43')]=_[_0x87e0('0x45')](db[_0x87e0('0x77')][_0x87e0('0x40')]);_0x2098af['query']=_[_0x87e0('0x45')](_0x38b6bf['query']);_0x2098af[_0x87e0('0x46')]=_[_0x87e0('0x56')](_0x2098af[_0x87e0('0x43')],_0x2098af['query']);_0x175f0c['attributes']=_[_0x87e0('0x56')](_0x2098af[_0x87e0('0x43')],qs[_0x87e0('0x48')](_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x48')]));_0x175f0c['attributes']=_0x175f0c[_0x87e0('0x47')][_0x87e0('0x57')]?_0x175f0c['attributes']:_0x2098af['model'];_0x175f0c[_0x87e0('0x68')]=qs[_0x87e0('0x4a')](_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x4a')]);_0x175f0c[_0x87e0('0x4b')]=qs[_0x87e0('0x46')](_[_0x87e0('0x4c')](_0x38b6bf[_0x87e0('0x44')],_0x2098af['filters']));if(_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x4d')]){_0x175f0c[_0x87e0('0x4b')]=_[_0x87e0('0x58')](_0x175f0c['where'],{'$or':_[_0x87e0('0x3e')](_0x175f0c[_0x87e0('0x47')],function(_0x40b3e8){var _0x42c5ec={};_0x42c5ec[_0x40b3e8]={'$like':'%'+_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x4d')]+'%'};return _0x42c5ec;})});}_0x175f0c=_['merge']({},_0x175f0c,_0x38b6bf[_0x87e0('0x4f')]);return _0x489096['getApplications'](_0x175f0c);}})[_0x87e0('0x20')](function(_0xbe1a77){if(_0xbe1a77){_0x582d1e=_0xbe1a77[_0x87e0('0x57')];if(!_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x49')](_0x87e0('0x67'))){_0x175f0c['limit']=qs[_0x87e0('0x33')](_0x38b6bf[_0x87e0('0x44')][_0x87e0('0x33')]);_0x175f0c[_0x87e0('0x30')]=qs[_0x87e0('0x30')](_0x38b6bf[_0x87e0('0x44')]['offset']);}return _0x489096[_0x87e0('0x7a')](_0x175f0c);}})[_0x87e0('0x20')](function(_0x5327ba){if(_0x5327ba){return _0x5327ba?{'count':_0x582d1e,'rows':_0x5327ba}:null;}})[_0x87e0('0x20')](respondWithResult(_0x407261,null))[_0x87e0('0x2b')](handleError(_0x407261,null));};exports[_0x87e0('0x7b')]=function(_0x2c9584,_0x488c7c,_0x2b459a){var _0x21a317={'channel':'whatsapp'};var _0x490a0c=[];var _0x1e75be=[];var _0x236dbf={};return db[_0x87e0('0x3f')][_0x87e0('0x59')]({'where':{'id':_0x2c9584['params']['id']},'include':[{'model':db[_0x87e0('0x77')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x488c7c,null))['then'](function(_0x102ebb){_0x21a317[_0x87e0('0x7c')]=_0x102ebb;_0x21a317[_0x87e0('0x7d')]=_['orderBy'](_0x102ebb['Applications'],[_0x87e0('0x79')],[_0x87e0('0x7e')]);if(_0x21a317[_0x87e0('0x7c')][_0x87e0('0x7f')]){delete _0x21a317[_0x87e0('0x7c')][_0x87e0('0x7f')];}return db['CmContact']['describe']();})['then'](function(_0x21e726){if(!_0x21e726){throw new db['Sequelize'][(_0x87e0('0x80'))](_0x87e0('0x81'));}_0x490a0c=_['difference'](_[_0x87e0('0x45')](_0x21e726),[_0x87e0('0x82'),_0x87e0('0x83')]);_0x1e75be=_[_0x87e0('0x84')](_[_0x87e0('0x45')](_0x21e726),[_0x87e0('0x82'),'updatedAt',_0x87e0('0x85'),_0x87e0('0x86')]);_0x21a317['body']={'mapKey':_0x87e0('0x87')};if(_0x21a317[_0x87e0('0x7c')][_0x87e0('0x42')]&&_0x21a317['account'][_0x87e0('0x42')]===_0x87e0('0x88')){_0x21a317[_0x87e0('0x5b')][_0x87e0('0x89')]=_0x2c9584[_0x87e0('0x5b')][_0x87e0('0x8a')][_0x87e0('0x8b')](_0x87e0('0x8c'),'');_0x21a317['body'][_0x87e0('0x5b')]=_0x2c9584[_0x87e0('0x5b')][_0x87e0('0x8d')];_0x21a317[_0x87e0('0x5b')][_0x87e0('0x8e')]=_0x2c9584[_0x87e0('0x5b')][_0x87e0('0x8f')];}if(_0x21a317[_0x87e0('0x5b')]['id']){delete _0x21a317[_0x87e0('0x5b')]['id'];}if(_[_0x87e0('0x90')](_0x21a317[_0x87e0('0x5b')][_0x87e0('0x89')])){throw new db['Sequelize'][(_0x87e0('0x80'))](_0x87e0('0x91'));}if(_['isNil'](_0x21a317['body'][_0x87e0('0x5b')])||_0x21a317[_0x87e0('0x5b')][_0x87e0('0x5b')]===''){throw new db['Sequelize'][(_0x87e0('0x80'))](_0x87e0('0x92'));}if(_['isNil'](_0x21a317['body'][_0x87e0('0x93')])){throw new db[(_0x87e0('0x94'))][(_0x87e0('0x80'))](_0x87e0('0x95')+_0x1e75be);}if(!_[_0x87e0('0x96')](_0x1e75be,_0x21a317[_0x87e0('0x5b')][_0x87e0('0x93')])){throw new db[(_0x87e0('0x94'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e75be);}_0x236dbf[_0x21a317[_0x87e0('0x5b')]['mapKey']]=_0x21a317[_0x87e0('0x5b')][_0x87e0('0x89')];return db[_0x87e0('0x97')][_0x87e0('0x59')]({'where':{'id':_0x21a317[_0x87e0('0x7c')][_0x87e0('0x86')]},'include':[{'model':db['CmContact'],'as':_0x87e0('0x98'),'where':_0x236dbf,'limit':0x1,'order':[[_0x87e0('0x83'),_0x87e0('0x99')]]}]});})[_0x87e0('0x20')](handleEntityNotFound(_0x488c7c,null))[_0x87e0('0x20')](function(_0x5c0fd0){if(_0x5c0fd0){_0x21a317[_0x87e0('0x9a')]=_['omit'](_0x5c0fd0,[_0x87e0('0x98')]);if(_0x5c0fd0[_0x87e0('0x98')]['length']){return _0x5c0fd0[_0x87e0('0x98')][0x0];}var _0x4d01a5=_[_0x87e0('0x19')](_0x21a317[_0x87e0('0x5b')],{'firstName':_0x21a317['body']['from'],'ListId':_0x5c0fd0['id']});_0x4d01a5[_0x21a317[_0x87e0('0x5b')]['mapKey']]=_0x21a317[_0x87e0('0x5b')]['from'];return db[_0x87e0('0x9b')][_0x87e0('0x5a')](_0x4d01a5,{'fields':_0x490a0c,'raw':!![]});}})['then'](handleEntityNotFound(_0x488c7c,null))[_0x87e0('0x20')](function(_0xe06057){if(_0xe06057){_0x21a317['contact']=_0xe06057;var _0x53e765={'ContactId':_0xe06057['id'],'phone':_0x21a317[_0x87e0('0x5b')][_0x87e0('0x89')],'WhatsappAccountId':_0x2c9584['params']['id']};var _0x1212d9={'ContactId':_0xe06057['id'],'WhatsappAccountId':_0x2c9584[_0x87e0('0x60')]['id'],'closed':![]};return db[_0x87e0('0x9c')][_0x87e0('0x59')]({'where':_0x1212d9})[_0x87e0('0x20')](function(_0x5d43f4){if(_0x5d43f4){return[_0x5d43f4,![]];}return db[_0x87e0('0x9c')][_0x87e0('0x5a')](_0x53e765)[_0x87e0('0x20')](function(_0xb4779f){return[_0xb4779f,!![]];});});}})['spread'](function(_0x10de2f,_0x1ebf6f){_0x21a317[_0x87e0('0x9d')]=_0x10de2f[_0x87e0('0x38')]({'plain':!![]});_0x21a317[_0x87e0('0x9d')][_0x87e0('0x9e')]=![];if(_0x1ebf6f){if(_0x21a317[_0x87e0('0x7c')]['autoclose']){_0x21a317['applications']['push']({'id':0x0,'priority':_0x21a317[_0x87e0('0x7d')][_0x87e0('0x57')]+0x1,'app':'close','appdata':_0x87e0('0x9f'),'interval':_0x87e0('0xa0')});}_0x21a317[_0x87e0('0x9d')][_0x87e0('0x9e')]=!![];}return db[_0x87e0('0xa1')]['create']({'phone':_0x21a317[_0x87e0('0x5b')][_0x87e0('0x89')],'messageId':_0x21a317[_0x87e0('0x5b')][_0x87e0('0x8e')],'body':_0x21a317[_0x87e0('0x5b')][_0x87e0('0x5b')],'WhatsappAccountId':_0x2c9584[_0x87e0('0x60')]['id'],'WhatsappInteractionId':_0x10de2f['id'],'direction':'in','ContactId':_0x10de2f[_0x87e0('0xa2')],'AttachmentId':_0x21a317[_0x87e0('0x5b')][_0x87e0('0xa3')]});})[_0x87e0('0x20')](function(_0x4870f7){_0x21a317[_0x87e0('0x29')]=_0x4870f7;if(_0x21a317[_0x87e0('0x9d')][_0x87e0('0xa4')]){return db[_0x87e0('0x75')][_0x87e0('0x59')]({'attributes':['id',_0x87e0('0x3c')],'where':{'id':_0x21a317['interaction']['UserId']}})[_0x87e0('0x20')](function(_0x574da4){if(_0x574da4){_0x21a317['applications'][_0x87e0('0xa5')]({'id':0x0,'priority':0x0,'app':_0x87e0('0xa6'),'appdata':_0x574da4['name']+','+(_0x21a317[_0x87e0('0x7c')]['waitForTheAssignedAgent']||0xa),'interval':_0x87e0('0xa0')});}return respondWithRpcPromise('Start',_0x87e0('0xa7'),_0x21a317);});}return respondWithRpcPromise('Start',_0x87e0('0xa7'),_0x21a317);})[_0x87e0('0x20')](function(_0x59b729){if(_0x59b729){var _0x443a24=0xc8;var _0x372b8f=_0x87e0('0xa8');logger[_0x87e0('0x21')](_0x87e0('0x25'),_0x372b8f,_0x443a24,_0x87e0('0xa9'));logger[_0x87e0('0x24')](_0x87e0('0xaa'),_0x372b8f,_0x443a24,'entity\x20found',JSON['stringify'](_0x59b729));if(_0x21a317[_0x87e0('0x7c')][_0x87e0('0x42')]==='twilio'){return _0x488c7c[_0x87e0('0x2d')](_0x443a24)[_0x87e0('0xab')]('Content-Type','text/xml')[_0x87e0('0xac')](_0x87e0('0xad'));}else{return _0x488c7c[_0x87e0('0x2d')](_0x443a24)[_0x87e0('0x2f')](_0x59b729);}}})[_0x87e0('0x2b')](handleError(_0x488c7c,null));};exports[_0x87e0('0xac')]=function(_0x298d25,_0xa22e34,_0x2599e4){var _0x2988d4,_0x62dff0,_0x1e10a2;if(_[_0x87e0('0x90')](_0x298d25['body'][_0x87e0('0x5b')])||_0x298d25[_0x87e0('0x5b')]['body']===''){throw new db['Sequelize'][(_0x87e0('0x80'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x298d25['body']['to'])){throw new db[(_0x87e0('0x94'))][(_0x87e0('0x80'))]('to\x20is\x20mandatory');}_0x2988d4=_0x298d25[_0x87e0('0x5b')]['to'];return db['WhatsappAccount'][_0x87e0('0x59')]({'where':{'id':_0x298d25[_0x87e0('0x60')]['id']},'include':[{'model':db[_0x87e0('0x97')],'as':'List','include':[{'model':db[_0x87e0('0x9b')],'as':_0x87e0('0x98'),'where':{'mobile':_0x2988d4},'limit':0x1,'order':[[_0x87e0('0x83'),_0x87e0('0x99')]]}]}]})[_0x87e0('0x20')](handleEntityNotFound(_0xa22e34,null))['then'](function(_0xc26f75){if(_0xc26f75&&_0xc26f75[_0x87e0('0xae')]){_0x62dff0=_0xc26f75[_0x87e0('0x38')]({'plain':!![]});if(_0x62dff0['List']&&_0x62dff0[_0x87e0('0xae')][_0x87e0('0x98')][_0x87e0('0x57')]){return _0x62dff0[_0x87e0('0xae')][_0x87e0('0x98')][0x0];}return db[_0x87e0('0x9b')][_0x87e0('0x5a')](_[_0x87e0('0x19')](_0x298d25[_0x87e0('0x5b')],{'firstName':_0x2988d4,'mobile':_0x2988d4,'phone':_0x2988d4,'ListId':_0x62dff0['ListId']}));}})[_0x87e0('0x20')](handleEntityNotFound(_0xa22e34,null))[_0x87e0('0x20')](function(_0x182f80){if(_0x182f80){_0x1e10a2=_0x182f80;return db[_0x87e0('0x9c')][_0x87e0('0x59')]({'where':{'ContactId':_0x1e10a2['id'],'closed':![],'WhatsappAccountId':_0x62dff0['id']}})[_0x87e0('0x20')](function(_0x3ff153){if(_0x3ff153){return[_0x3ff153,![]];}return db[_0x87e0('0x9c')][_0x87e0('0x5a')]({'UserId':_0x298d25['user']['id'],'ContactId':_0x1e10a2['id'],'WhatsappAccountId':_0x62dff0['id'],'phone':_0x2988d4,'firstMsgDirection':_0x87e0('0xaf'),'Messages':[_[_0x87e0('0x58')](_0x298d25[_0x87e0('0x5b')],{'read':![],'body':_0x298d25[_0x87e0('0x5b')][_0x87e0('0x5b')],'phone':_0x2988d4,'WhatsappAccountId':_0x62dff0['id'],'UserId':_0x298d25[_0x87e0('0xb0')]['id'],'ContactId':_0x1e10a2['id']})]},{'include':[{'model':db[_0x87e0('0xa1')],'as':_0x87e0('0xb1')}]})['then'](function(_0x4385ca){return[_0x4385ca,!![]];});});}})[_0x87e0('0x6f')](function(_0xe46a93,_0x5c474a){if(_0x5c474a){return _0xe46a93;}return db[_0x87e0('0xa1')][_0x87e0('0x5a')](_['merge'](_0x298d25[_0x87e0('0x5b')],{'read':![],'body':_0x298d25[_0x87e0('0x5b')][_0x87e0('0x5b')],'phone':_0x2988d4,'WhatsappAccountId':_0x62dff0['id'],'WhatsappInteractionId':_0xe46a93['id'],'UserId':_0x298d25[_0x87e0('0xb0')]['id'],'ContactId':_0x1e10a2['id']}))[_0x87e0('0x20')](function(_0x376fe2){_0xe46a93[_0x87e0('0xb2')][_0x87e0('0xb1')]=[];_0xe46a93[_0x87e0('0xb2')][_0x87e0('0xb1')][_0x87e0('0xb3')](_0x376fe2[_0x87e0('0xb2')]);return _0xe46a93;});})['then'](respondWithResult(_0xa22e34,null))[_0x87e0('0x2b')](handleError(_0xa22e34,null));}; \ No newline at end of file +var _0x6406=['fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','params','mandatoryDispositionPause','include','find','create','body','user','role','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','merge','Disposition','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','omit','spread','userWhatsappAccount:save','isArray','emit','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','getApplications','notify','whatsapp','Applications','account','applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','type','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','list','contact','WhatsappInteraction','interaction','created','push','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes'];(function(_0x13688f,_0x33c8fd){var _0x53aed2=function(_0x4765b0){while(--_0x4765b0){_0x13688f['push'](_0x13688f['shift']());}};_0x53aed2(++_0x33c8fd);}(_0x6406,0x1f0));var _0x6640=function(_0x269a6f,_0x4c43c5){_0x269a6f=_0x269a6f-0x0;var _0x29e1e6=_0x6406[_0x269a6f];return _0x29e1e6;};'use strict';var emlformat=require(_0x6640('0x0'));var rimraf=require(_0x6640('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6640('0x2'));var rp=require('request-promise');var moment=require(_0x6640('0x3'));var BPromise=require(_0x6640('0x4'));var Mustache=require(_0x6640('0x5'));var util=require(_0x6640('0x6'));var path=require(_0x6640('0x7'));var sox=require(_0x6640('0x8'));var csv=require(_0x6640('0x9'));var ejs=require(_0x6640('0xa'));var fs=require('fs');var fs_extra=require(_0x6640('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6640('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6640('0xd'));var toCsv=require(_0x6640('0x9'));var querystring=require('querystring');var Papa=require(_0x6640('0xe'));var Redis=require(_0x6640('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6640('0x10'));var as=require(_0x6640('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6640('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6640('0x13'));var db=require('../../mysqldb')['db'];config[_0x6640('0x14')]=_[_0x6640('0x15')](config['redis'],{'host':_0x6640('0x16'),'port':0x18eb});var socket=require(_0x6640('0x17'))(new Redis(config[_0x6640('0x14')]));require(_0x6640('0x18'))[_0x6640('0x19')](socket);var jayson=require(_0x6640('0x1a'));var client=jayson[_0x6640('0x1b')][_0x6640('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x2aab66,_0x14e15c,_0x4f6116,_0x3243ab){return new BPromise(function(_0xe71e4f,_0x19e6c8){var _0x467590=_0x3243ab||client;return _0x467590[_0x6640('0x1d')](_0x2aab66,_0x4f6116)[_0x6640('0x1e')](function(_0x4d504c){logger[_0x6640('0x1f')]('WhatsappAccount,\x20%s,\x20%s',_0x14e15c,_0x6640('0x20'));logger[_0x6640('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x14e15c,_0x6640('0x20'),JSON[_0x6640('0x22')](_0x4d504c));if(_0x4d504c[_0x6640('0x23')]){if(_0x4d504c[_0x6640('0x23')][_0x6640('0x24')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x14e15c,_0x4d504c[_0x6640('0x23')][_0x6640('0x25')]);return _0x19e6c8(_0x4d504c[_0x6640('0x23')][_0x6640('0x25')]);}logger[_0x6640('0x23')](_0x6640('0x26'),_0x14e15c,_0x4d504c[_0x6640('0x23')][_0x6640('0x25')]);return _0xe71e4f(_0x4d504c[_0x6640('0x23')]['message']);}else{logger['info'](_0x6640('0x26'),_0x14e15c,_0x6640('0x20'));_0xe71e4f(_0x4d504c['result'][_0x6640('0x25')]);}})[_0x6640('0x27')](function(_0x36a83b){logger[_0x6640('0x23')](_0x6640('0x26'),_0x14e15c,_0x36a83b);_0x19e6c8(_0x36a83b);});});}function respondWithStatusCode(_0x1c19f5,_0x7aaf48){_0x7aaf48=_0x7aaf48||0xcc;return function(_0x1a46ff){if(_0x1a46ff){return _0x1c19f5[_0x6640('0x28')](_0x7aaf48);}return _0x1c19f5[_0x6640('0x29')](_0x7aaf48)[_0x6640('0x2a')]();};}function respondWithResult(_0x424e06,_0x5be264){_0x5be264=_0x5be264||0xc8;return function(_0x58baf7){if(_0x58baf7){return _0x424e06[_0x6640('0x29')](_0x5be264)[_0x6640('0x2b')](_0x58baf7);}};}function respondWithFilteredResult(_0x5cb9d3,_0x4920e9){return function(_0x2add5e){if(_0x2add5e){var _0x200cdb=typeof _0x4920e9[_0x6640('0x2c')]===_0x6640('0x2d')&&typeof _0x4920e9[_0x6640('0x2e')]===_0x6640('0x2d');var _0x55f94b=_0x2add5e['count'];var _0x1b4621=_0x200cdb?0x0:_0x4920e9['offset'];var _0x371a61=_0x200cdb?_0x2add5e[_0x6640('0x2f')]:_0x4920e9[_0x6640('0x2c')]+_0x4920e9[_0x6640('0x2e')];var _0x598b8b;if(_0x371a61>=_0x55f94b){_0x371a61=_0x55f94b;_0x598b8b=0xc8;}else{_0x598b8b=0xce;}_0x5cb9d3[_0x6640('0x29')](_0x598b8b);return _0x5cb9d3['set']('Content-Range',_0x1b4621+'-'+_0x371a61+'/'+_0x55f94b)[_0x6640('0x2b')](_0x2add5e);}return null;};}function patchUpdates(_0x1cd513){return function(_0x12417e){try{jsonpatch[_0x6640('0x30')](_0x12417e,_0x1cd513,!![]);}catch(_0x44d17a){return BPromise[_0x6640('0x31')](_0x44d17a);}return _0x12417e[_0x6640('0x32')]();};}function saveUpdates(_0x1d9ab3,_0x24e4a0){return function(_0x2e4c1b){if(_0x2e4c1b){return _0x2e4c1b[_0x6640('0x33')](_0x1d9ab3)[_0x6640('0x1e')](function(_0x3a3f34){return _0x3a3f34;});}return null;};}function removeEntity(_0xe04d8f,_0xf457bf){return function(_0x4214a9){if(_0x4214a9){return _0x4214a9[_0x6640('0x34')]()['then'](function(){var _0x4b45a0=_0x4214a9[_0x6640('0x35')]({'plain':!![]});var _0x3c01d7='WhatsappAccounts';return db['UserProfileResource'][_0x6640('0x34')]({'where':{'type':_0x3c01d7,'resourceId':_0x4b45a0['id']}})[_0x6640('0x1e')](function(){return _0x4214a9;});})[_0x6640('0x1e')](function(){_0xe04d8f[_0x6640('0x29')](0xcc)[_0x6640('0x2a')]();});}};}function handleEntityNotFound(_0x341a0d,_0x58c9d5){return function(_0x1a4189){if(!_0x1a4189){_0x341a0d[_0x6640('0x28')](0x194);}return _0x1a4189;};}function handleError(_0x565964,_0x492a9b){_0x492a9b=_0x492a9b||0x1f4;return function(_0x422985){logger[_0x6640('0x23')](_0x422985[_0x6640('0x36')]);if(_0x422985[_0x6640('0x37')]){delete _0x422985[_0x6640('0x37')];}_0x565964[_0x6640('0x29')](_0x492a9b)[_0x6640('0x38')](_0x422985);};}exports[_0x6640('0x39')]=function(_0x3c4098,_0x2b4e68){var _0x360680={'include':[{'model':db[_0x6640('0x3a')],'as':'mandatoryDispositionPause'}]},_0x146aa5={},_0x3350c1={'count':0x0,'rows':[]};var _0x30237f=_[_0x6640('0x3b')](db[_0x6640('0x3c')][_0x6640('0x3d')],function(_0x4c69db){return{'name':_0x4c69db[_0x6640('0x3e')],'type':_0x4c69db['type'][_0x6640('0x3f')]};});_0x146aa5[_0x6640('0x40')]=_[_0x6640('0x3b')](_0x30237f,_0x6640('0x37'));_0x146aa5['query']=_[_0x6640('0x41')](_0x3c4098[_0x6640('0x42')]);_0x146aa5[_0x6640('0x43')]=_[_0x6640('0x44')](_0x146aa5['model'],_0x146aa5[_0x6640('0x42')]);_0x360680[_0x6640('0x45')]=_[_0x6640('0x44')](_0x146aa5[_0x6640('0x40')],qs[_0x6640('0x46')](_0x3c4098[_0x6640('0x42')][_0x6640('0x46')]));_0x360680['attributes']=_0x360680[_0x6640('0x45')][_0x6640('0x47')]?_0x360680[_0x6640('0x45')]:_0x146aa5[_0x6640('0x40')];if(!_0x3c4098[_0x6640('0x42')][_0x6640('0x48')](_0x6640('0x49'))){_0x360680[_0x6640('0x2e')]=qs[_0x6640('0x2e')](_0x3c4098[_0x6640('0x42')][_0x6640('0x2e')]);_0x360680[_0x6640('0x2c')]=qs[_0x6640('0x2c')](_0x3c4098['query'][_0x6640('0x2c')]);}_0x360680[_0x6640('0x4a')]=qs[_0x6640('0x4b')](_0x3c4098['query']['sort']);_0x360680[_0x6640('0x4c')]=qs[_0x6640('0x43')](_[_0x6640('0x4d')](_0x3c4098['query'],_0x146aa5[_0x6640('0x43')]),_0x30237f);if(_0x3c4098['query'][_0x6640('0x4e')]){_0x360680[_0x6640('0x4c')]=_['merge'](_0x360680[_0x6640('0x4c')],{'$or':_[_0x6640('0x3b')](_0x30237f,function(_0x3116b0){if(_0x3116b0['type']!==_0x6640('0x4f')){var _0x434e43={};_0x434e43[_0x3116b0[_0x6640('0x37')]]={'$like':'%'+_0x3c4098[_0x6640('0x42')][_0x6640('0x4e')]+'%'};return _0x434e43;}})});}_0x360680=_['merge']({},_0x360680,_0x3c4098[_0x6640('0x50')]);var _0x3d7dfd={'where':_0x360680[_0x6640('0x4c')]};return db[_0x6640('0x3c')]['count'](_0x3d7dfd)['then'](function(_0xe05d7e){_0x3350c1['count']=_0xe05d7e;if(_0x3c4098[_0x6640('0x42')][_0x6640('0x51')]){_0x360680['include']=[{'all':!![]}];}return db[_0x6640('0x3c')][_0x6640('0x52')](_0x360680);})['then'](function(_0x52cb4c){_0x3350c1[_0x6640('0x53')]=_0x52cb4c;return _0x3350c1;})[_0x6640('0x1e')](respondWithFilteredResult(_0x2b4e68,_0x360680))[_0x6640('0x27')](handleError(_0x2b4e68,null));};exports['show']=function(_0x1370dd,_0xa865ec){var _0x3cb137={'raw':![],'where':{'id':_0x1370dd[_0x6640('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x6640('0x55')}]},_0x2b4899={};_0x2b4899['model']=_[_0x6640('0x41')](db[_0x6640('0x3c')]['rawAttributes']);_0x2b4899['query']=_[_0x6640('0x41')](_0x1370dd[_0x6640('0x42')]);_0x2b4899[_0x6640('0x43')]=_[_0x6640('0x44')](_0x2b4899['model'],_0x2b4899[_0x6640('0x42')]);_0x3cb137[_0x6640('0x45')]=_[_0x6640('0x44')](_0x2b4899[_0x6640('0x40')],qs[_0x6640('0x46')](_0x1370dd['query']['fields']));_0x3cb137['attributes']=_0x3cb137[_0x6640('0x45')][_0x6640('0x47')]?_0x3cb137[_0x6640('0x45')]:_0x2b4899[_0x6640('0x40')];if(_0x1370dd[_0x6640('0x42')][_0x6640('0x51')]){_0x3cb137[_0x6640('0x56')]=[{'all':!![]}];}_0x3cb137=_['merge']({},_0x3cb137,_0x1370dd[_0x6640('0x50')]);return db['WhatsappAccount'][_0x6640('0x57')](_0x3cb137)[_0x6640('0x1e')](handleEntityNotFound(_0xa865ec,null))[_0x6640('0x1e')](respondWithResult(_0xa865ec,null))[_0x6640('0x27')](handleError(_0xa865ec,null));};exports[_0x6640('0x58')]=function(_0x51a3f5,_0x917583){return db[_0x6640('0x3c')][_0x6640('0x58')](_0x51a3f5[_0x6640('0x59')],{})[_0x6640('0x1e')](function(_0x8412bd){var _0x46dc8e=_0x51a3f5[_0x6640('0x5a')][_0x6640('0x35')]({'plain':!![]});if(!_0x46dc8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46dc8e[_0x6640('0x5b')]===_0x6640('0x5a')){var _0x152d74=_0x8412bd['get']({'plain':!![]});var _0x3dbd7f=_0x6640('0x5c');return db[_0x6640('0x5d')][_0x6640('0x57')]({'where':{'name':_0x3dbd7f,'userProfileId':_0x46dc8e[_0x6640('0x5e')]},'raw':!![]})[_0x6640('0x1e')](function(_0x379b4b){if(_0x379b4b&&_0x379b4b[_0x6640('0x5f')]===0x0){return db[_0x6640('0x60')]['create']({'name':_0x152d74['name'],'resourceId':_0x152d74['id'],'type':_0x379b4b[_0x6640('0x37')],'sectionId':_0x379b4b['id']},{})['then'](function(){return _0x8412bd;});}else{return _0x8412bd;}})['catch'](function(_0x14a682){logger['error'](_0x6640('0x61'),_0x14a682);throw _0x14a682;});}return _0x8412bd;})[_0x6640('0x1e')](respondWithResult(_0x917583,0xc9))['catch'](handleError(_0x917583,null));};exports[_0x6640('0x33')]=function(_0x4deca4,_0x4b293f){if(_0x4deca4[_0x6640('0x59')]['id']){delete _0x4deca4[_0x6640('0x59')]['id'];}return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x4deca4[_0x6640('0x54')]['id']},'include':[{'model':db[_0x6640('0x3a')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4b293f,null))[_0x6640('0x1e')](saveUpdates(_0x4deca4[_0x6640('0x59')],null))[_0x6640('0x1e')](respondWithResult(_0x4b293f,null))['catch'](handleError(_0x4b293f,null));};exports[_0x6640('0x34')]=function(_0x12ed8a,_0x4e67e9){return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x12ed8a['params']['id']}})['then'](handleEntityNotFound(_0x4e67e9,null))[_0x6640('0x1e')](removeEntity(_0x4e67e9,null))['catch'](handleError(_0x4e67e9,null));};exports['describe']=function(_0x31b4b4,_0x18976d){return db['WhatsappAccount'][_0x6640('0x62')]()[_0x6640('0x1e')](respondWithResult(_0x18976d,null))[_0x6640('0x27')](handleError(_0x18976d,null));};exports[_0x6640('0x63')]=function(_0x3703db,_0x591efa,_0x31b447){if(_0x3703db[_0x6640('0x59')]['id']){delete _0x3703db[_0x6640('0x59')]['id'];}return db[_0x6640('0x3c')]['find']({'where':{'id':_0x3703db[_0x6640('0x54')]['id']}})['then'](handleEntityNotFound(_0x591efa,null))[_0x6640('0x1e')](function(_0x1d91c7){if(_0x1d91c7){_0x3703db[_0x6640('0x59')][_0x6640('0x64')]=_0x1d91c7['id'];return db['Disposition']['create'](_0x3703db[_0x6640('0x59')]);}})[_0x6640('0x1e')](respondWithResult(_0x591efa,null))[_0x6640('0x27')](handleError(_0x591efa,null));};exports[_0x6640('0x65')]=function(_0x1b870e,_0x357984,_0xa331fb){var _0xcd3d3c={'raw':![],'where':{}};var _0x29dbd4={};var _0x4c10f3={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x1b870e[_0x6640('0x54')]['id']}})['then'](handleEntityNotFound(_0x357984,null))['then'](function(_0x295a41){if(_0x295a41){_0x29dbd4[_0x6640('0x40')]=_['keys'](db['Disposition']['rawAttributes']);_0x29dbd4[_0x6640('0x42')]=_[_0x6640('0x41')](_0x1b870e[_0x6640('0x42')]);_0x29dbd4[_0x6640('0x43')]=_[_0x6640('0x44')](_0x29dbd4[_0x6640('0x40')],_0x29dbd4['query']);_0xcd3d3c[_0x6640('0x45')]=_['intersection'](_0x29dbd4[_0x6640('0x40')],qs['fields'](_0x1b870e['query'][_0x6640('0x46')]));_0xcd3d3c[_0x6640('0x45')]=_0xcd3d3c[_0x6640('0x45')][_0x6640('0x47')]?_0xcd3d3c[_0x6640('0x45')]:_0x29dbd4['model'];if(!_0x1b870e['query'][_0x6640('0x48')]('nolimit')){_0xcd3d3c[_0x6640('0x2e')]=qs[_0x6640('0x2e')](_0x1b870e['query'][_0x6640('0x2e')]);_0xcd3d3c[_0x6640('0x2c')]=qs['offset'](_0x1b870e[_0x6640('0x42')][_0x6640('0x2c')]);}_0xcd3d3c[_0x6640('0x4a')]=qs[_0x6640('0x4b')](_0x1b870e[_0x6640('0x42')][_0x6640('0x4b')]);_0xcd3d3c[_0x6640('0x4c')]=qs['filters'](_[_0x6640('0x4d')](_0x1b870e[_0x6640('0x42')],_0x29dbd4[_0x6640('0x43')]));_0xcd3d3c[_0x6640('0x4c')][_0x6640('0x64')]=_0x295a41['id'];if(_0x1b870e[_0x6640('0x42')][_0x6640('0x4e')]){_0xcd3d3c[_0x6640('0x4c')]=_[_0x6640('0x66')](_0xcd3d3c[_0x6640('0x4c')],{'$or':_['map'](_0xcd3d3c[_0x6640('0x45')],function(_0x153277){var _0x530bc7={};_0x530bc7[_0x153277]={'$like':'%'+_0x1b870e[_0x6640('0x42')]['filter']+'%'};return _0x530bc7;})});}_0xcd3d3c=_[_0x6640('0x66')]({},_0xcd3d3c,_0x1b870e[_0x6640('0x50')]);return db['Disposition'][_0x6640('0x2f')]({'where':_0xcd3d3c['where']})[_0x6640('0x1e')](function(_0xe4bee2){_0x4c10f3[_0x6640('0x2f')]=_0xe4bee2;if(_0x1b870e[_0x6640('0x42')]['includeAll']){_0xcd3d3c[_0x6640('0x56')]=[{'all':!![]}];}return db[_0x6640('0x67')][_0x6640('0x52')](_0xcd3d3c);})[_0x6640('0x1e')](function(_0x3ae4fb){_0x4c10f3[_0x6640('0x53')]=_0x3ae4fb;return _0x4c10f3;});}})[_0x6640('0x1e')](respondWithFilteredResult(_0x357984,_0xcd3d3c))['catch'](handleError(_0x357984,null));};exports['removeDispositions']=function(_0x1e8341,_0x512345,_0x47bad2){return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x1e8341[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x512345,null))[_0x6640('0x1e')](function(_0x49605c){if(_0x49605c){return _0x49605c[_0x6640('0x68')](_0x1e8341[_0x6640('0x42')][_0x6640('0x69')]);}})['then'](respondWithStatusCode(_0x512345,null))['catch'](handleError(_0x512345,null));};exports['addAnswer']=function(_0x5c5818,_0x1637d3,_0x43f944){if(_0x5c5818[_0x6640('0x59')]['id']){delete _0x5c5818[_0x6640('0x59')]['id'];}return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x5c5818[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x1637d3,null))[_0x6640('0x1e')](function(_0xe58f9b){if(_0xe58f9b){_0x5c5818[_0x6640('0x59')]['WhatsappAccountId']=_0xe58f9b['id'];return db['CannedAnswer'][_0x6640('0x58')](_0x5c5818[_0x6640('0x59')]);}})['then'](respondWithResult(_0x1637d3,null))[_0x6640('0x27')](handleError(_0x1637d3,null));};exports[_0x6640('0x6a')]=function(_0x136d4b,_0x35825c,_0x207da2){var _0x294277={'raw':![],'where':{}};var _0xa928ed={};var _0x11f426={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x6640('0x6b')]({'where':{'id':_0x136d4b[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x35825c,null))['then'](function(_0xa38c4){if(_0xa38c4){_0xa928ed[_0x6640('0x40')]=_[_0x6640('0x41')](db[_0x6640('0x6c')]['rawAttributes']);_0xa928ed[_0x6640('0x42')]=_[_0x6640('0x41')](_0x136d4b[_0x6640('0x42')]);_0xa928ed[_0x6640('0x43')]=_[_0x6640('0x44')](_0xa928ed[_0x6640('0x40')],_0xa928ed[_0x6640('0x42')]);_0x294277[_0x6640('0x45')]=_[_0x6640('0x44')](_0xa928ed[_0x6640('0x40')],qs[_0x6640('0x46')](_0x136d4b[_0x6640('0x42')]['fields']));_0x294277['attributes']=_0x294277[_0x6640('0x45')][_0x6640('0x47')]?_0x294277[_0x6640('0x45')]:_0xa928ed['model'];if(!_0x136d4b['query']['hasOwnProperty']('nolimit')){_0x294277[_0x6640('0x2e')]=qs[_0x6640('0x2e')](_0x136d4b[_0x6640('0x42')]['limit']);_0x294277[_0x6640('0x2c')]=qs[_0x6640('0x2c')](_0x136d4b[_0x6640('0x42')][_0x6640('0x2c')]);}_0x294277[_0x6640('0x4a')]=qs[_0x6640('0x4b')](_0x136d4b['query'][_0x6640('0x4b')]);_0x294277[_0x6640('0x4c')]=qs[_0x6640('0x43')](_[_0x6640('0x4d')](_0x136d4b['query'],_0xa928ed['filters']));_0x294277[_0x6640('0x4c')][_0x6640('0x64')]=_0xa38c4['id'];if(_0x136d4b[_0x6640('0x42')][_0x6640('0x4e')]){_0x294277['where']=_[_0x6640('0x66')](_0x294277[_0x6640('0x4c')],{'$or':_[_0x6640('0x3b')](_0x294277[_0x6640('0x45')],function(_0xcebc74){var _0x3262d6={};_0x3262d6[_0xcebc74]={'$like':'%'+_0x136d4b[_0x6640('0x42')]['filter']+'%'};return _0x3262d6;})});}_0x294277=_[_0x6640('0x66')]({},_0x294277,_0x136d4b[_0x6640('0x50')]);return db[_0x6640('0x6c')][_0x6640('0x2f')]({'where':_0x294277[_0x6640('0x4c')]})[_0x6640('0x1e')](function(_0x22a79b){_0x11f426[_0x6640('0x2f')]=_0x22a79b;if(_0x136d4b['query']['includeAll']){_0x294277[_0x6640('0x56')]=[{'all':!![]}];}return db[_0x6640('0x6c')][_0x6640('0x52')](_0x294277);})[_0x6640('0x1e')](function(_0xf7ae){_0x11f426[_0x6640('0x53')]=_0xf7ae;return _0x11f426;});}})['then'](respondWithFilteredResult(_0x35825c,_0x294277))[_0x6640('0x27')](handleError(_0x35825c,null));};exports[_0x6640('0x6d')]=function(_0x5ace72,_0x490628,_0x1d9135){return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x5ace72[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x490628,null))[_0x6640('0x1e')](function(_0xf5e773){if(_0xf5e773){return _0xf5e773['removeAnswers'](_0x5ace72[_0x6640('0x42')][_0x6640('0x69')]);}})['then'](respondWithStatusCode(_0x490628,null))['catch'](handleError(_0x490628,null));};exports['addAgents']=function(_0x18f38d,_0x1d4c36,_0x3a8d33){return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x18f38d['params']['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x1d4c36,null))[_0x6640('0x1e')](function(_0xf5a6ab){if(_0xf5a6ab){return _0xf5a6ab['addAgents'](_0x18f38d[_0x6640('0x59')][_0x6640('0x69')],_[_0x6640('0x6e')](_0x18f38d[_0x6640('0x59')],[_0x6640('0x69'),'id'])||{})[_0x6640('0x6f')](function(_0x34de34){for(var _0x5e3f8c=0x0;_0x5e3f8c<_0x18f38d[_0x6640('0x59')][_0x6640('0x69')][_0x6640('0x47')];_0x5e3f8c+=0x1){socket['emit'](_0x6640('0x70'),{'UserId':Number(_0x18f38d[_0x6640('0x59')][_0x6640('0x69')][_0x5e3f8c]),'WhatsappAccountId':Number(_0x18f38d[_0x6640('0x54')]['id'])});}return _0x34de34;});}})['then'](respondWithResult(_0x1d4c36,null))[_0x6640('0x27')](handleError(_0x1d4c36,null));};exports['removeAgents']=function(_0x520aa2,_0x1c1d9a,_0x3b7573){return db[_0x6640('0x3c')]['find']({'where':{'id':_0x520aa2[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x1c1d9a,null))['then'](function(_0x162fea){if(_0x162fea){return _0x162fea['removeAgents'](_0x520aa2['query']['ids'])[_0x6640('0x1e')](function(){if(_[_0x6640('0x71')](_0x520aa2[_0x6640('0x42')]['ids'])){for(var _0x5b3bc1=0x0;_0x5b3bc1<_0x520aa2['query'][_0x6640('0x69')][_0x6640('0x47')];_0x5b3bc1+=0x1){socket[_0x6640('0x72')](_0x6640('0x73'),{'UserId':Number(_0x520aa2[_0x6640('0x42')][_0x6640('0x69')][_0x5b3bc1]),'WhatsappAccountId':Number(_0x520aa2[_0x6640('0x54')]['id'])});}}else{socket['emit'](_0x6640('0x73'),{'UserId':Number(_0x520aa2[_0x6640('0x42')][_0x6640('0x69')]),'WhatsappAccountId':Number(_0x520aa2[_0x6640('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c1d9a,null))[_0x6640('0x27')](handleError(_0x1c1d9a,null));};exports['getAgents']=function(_0x14a122,_0x3c4eef,_0x286b8f){var _0x212c95={};var _0x127e4a={};var _0x4ad63e;var _0x2d9229;return db[_0x6640('0x3c')][_0x6640('0x6b')]({'where':{'id':_0x14a122[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x3c4eef,null))['then'](function(_0x4246ee){if(_0x4246ee){_0x4ad63e=_0x4246ee;_0x127e4a[_0x6640('0x40')]=_[_0x6640('0x41')](db[_0x6640('0x74')][_0x6640('0x3d')]);_0x127e4a[_0x6640('0x42')]=_['keys'](_0x14a122['query']);_0x127e4a[_0x6640('0x43')]=_[_0x6640('0x44')](_0x127e4a[_0x6640('0x40')],_0x127e4a[_0x6640('0x42')]);_0x212c95[_0x6640('0x45')]=_[_0x6640('0x44')](_0x127e4a[_0x6640('0x40')],qs['fields'](_0x14a122['query']['fields']));_0x212c95[_0x6640('0x45')]=_0x212c95[_0x6640('0x45')][_0x6640('0x47')]?_0x212c95['attributes']:_0x127e4a[_0x6640('0x40')];_0x212c95['order']=qs[_0x6640('0x4b')](_0x14a122[_0x6640('0x42')]['sort']);_0x212c95[_0x6640('0x4c')]=qs[_0x6640('0x43')](_['pick'](_0x14a122[_0x6640('0x42')],_0x127e4a['filters']));if(_0x14a122[_0x6640('0x42')][_0x6640('0x4e')]){_0x212c95[_0x6640('0x4c')]=_['merge'](_0x212c95[_0x6640('0x4c')],{'$or':_[_0x6640('0x3b')](_0x212c95[_0x6640('0x45')],function(_0x1e7147){var _0x475096={};_0x475096[_0x1e7147]={'$like':'%'+_0x14a122[_0x6640('0x42')][_0x6640('0x4e')]+'%'};return _0x475096;})});}_0x212c95=_[_0x6640('0x66')]({},_0x212c95,_0x14a122[_0x6640('0x50')]);return _0x4ad63e['getAgents'](_0x212c95);}})[_0x6640('0x1e')](function(_0x4d5862){if(_0x4d5862){_0x2d9229=_0x4d5862['length'];if(!_0x14a122[_0x6640('0x42')][_0x6640('0x48')](_0x6640('0x49'))){_0x212c95[_0x6640('0x2e')]=qs['limit'](_0x14a122[_0x6640('0x42')][_0x6640('0x2e')]);_0x212c95[_0x6640('0x2c')]=qs[_0x6640('0x2c')](_0x14a122[_0x6640('0x42')][_0x6640('0x2c')]);}return _0x4ad63e[_0x6640('0x75')](_0x212c95);}})[_0x6640('0x1e')](function(_0x40672f){if(_0x40672f){return _0x40672f?{'count':_0x2d9229,'rows':_0x40672f}:null;}})[_0x6640('0x1e')](respondWithResult(_0x3c4eef,null))[_0x6640('0x27')](handleError(_0x3c4eef,null));};exports[_0x6640('0x76')]=function(_0xecd154,_0x220efb,_0x102a3f){return db[_0x6640('0x3c')]['findOne']({'where':{'id':_0xecd154[_0x6640('0x54')]['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x220efb,null))[_0x6640('0x1e')](function(_0x108fd6){if(_0x108fd6){return db[_0x6640('0x77')][_0x6640('0x78')](function(_0xba0c6f){return db[_0x6640('0x79')][_0x6640('0x34')]({'where':{'WhatsappAccountId':_0xecd154['params']['id']},'transaction':_0xba0c6f})[_0x6640('0x1e')](function(_0x1170aa){var _0xe03360=_[_0x6640('0x3b')](_0xecd154['body'],function(_0x3ae62b){_0x3ae62b['WhatsappAccountId']=_0xecd154[_0x6640('0x54')]['id'];return _0x3ae62b;});return db[_0x6640('0x79')][_0x6640('0x7a')](_0xe03360,{'transaction':_0xba0c6f});});})[_0x6640('0x1e')](function(){return db[_0x6640('0x79')][_0x6640('0x7b')]({'where':{'WhatsappAccountId':_0xecd154[_0x6640('0x54')]['id']},'order':'priority'});});}})[_0x6640('0x1e')](respondWithResult(_0x220efb,null))[_0x6640('0x27')](handleError(_0x220efb,null));};exports[_0x6640('0x7c')]=function(_0x4336f5,_0x28df7f,_0x38ad95){var _0x4503e8={};var _0x10c156={};var _0x5ee2c4;var _0x25da0e;return db[_0x6640('0x3c')][_0x6640('0x6b')]({'where':{'id':_0x4336f5['params']['id']}})[_0x6640('0x1e')](handleEntityNotFound(_0x28df7f,null))[_0x6640('0x1e')](function(_0x3dfcd2){if(_0x3dfcd2){_0x5ee2c4=_0x3dfcd2;_0x10c156['model']=_['keys'](db[_0x6640('0x79')]['rawAttributes']);_0x10c156[_0x6640('0x42')]=_['keys'](_0x4336f5['query']);_0x10c156[_0x6640('0x43')]=_[_0x6640('0x44')](_0x10c156[_0x6640('0x40')],_0x10c156[_0x6640('0x42')]);_0x4503e8['attributes']=_['intersection'](_0x10c156[_0x6640('0x40')],qs[_0x6640('0x46')](_0x4336f5[_0x6640('0x42')][_0x6640('0x46')]));_0x4503e8['attributes']=_0x4503e8['attributes'][_0x6640('0x47')]?_0x4503e8['attributes']:_0x10c156[_0x6640('0x40')];_0x4503e8[_0x6640('0x4a')]=qs[_0x6640('0x4b')](_0x4336f5[_0x6640('0x42')][_0x6640('0x4b')]);_0x4503e8[_0x6640('0x4c')]=qs[_0x6640('0x43')](_[_0x6640('0x4d')](_0x4336f5[_0x6640('0x42')],_0x10c156[_0x6640('0x43')]));if(_0x4336f5[_0x6640('0x42')][_0x6640('0x4e')]){_0x4503e8['where']=_[_0x6640('0x66')](_0x4503e8[_0x6640('0x4c')],{'$or':_[_0x6640('0x3b')](_0x4503e8[_0x6640('0x45')],function(_0x43a316){var _0x17a054={};_0x17a054[_0x43a316]={'$like':'%'+_0x4336f5[_0x6640('0x42')][_0x6640('0x4e')]+'%'};return _0x17a054;})});}_0x4503e8=_[_0x6640('0x66')]({},_0x4503e8,_0x4336f5[_0x6640('0x50')]);return _0x5ee2c4['getApplications'](_0x4503e8);}})[_0x6640('0x1e')](function(_0x5a4ebb){if(_0x5a4ebb){_0x25da0e=_0x5a4ebb[_0x6640('0x47')];if(!_0x4336f5[_0x6640('0x42')][_0x6640('0x48')]('nolimit')){_0x4503e8[_0x6640('0x2e')]=qs[_0x6640('0x2e')](_0x4336f5[_0x6640('0x42')][_0x6640('0x2e')]);_0x4503e8[_0x6640('0x2c')]=qs[_0x6640('0x2c')](_0x4336f5[_0x6640('0x42')]['offset']);}return _0x5ee2c4[_0x6640('0x7c')](_0x4503e8);}})[_0x6640('0x1e')](function(_0x4ffaf8){if(_0x4ffaf8){return _0x4ffaf8?{'count':_0x25da0e,'rows':_0x4ffaf8}:null;}})[_0x6640('0x1e')](respondWithResult(_0x28df7f,null))[_0x6640('0x27')](handleError(_0x28df7f,null));};exports[_0x6640('0x7d')]=function(_0x4cd20e,_0x5066bf,_0x12c73d){var _0x26b9f6={'channel':_0x6640('0x7e')};var _0x3b9094=[];var _0x220c06=[];var _0x480535={};return db['WhatsappAccount']['find']({'where':{'id':_0x4cd20e['params']['id']},'include':[{'model':db[_0x6640('0x79')],'as':_0x6640('0x7f')}]})[_0x6640('0x1e')](handleEntityNotFound(_0x5066bf,null))[_0x6640('0x1e')](function(_0x403cb6){_0x26b9f6[_0x6640('0x80')]=_0x403cb6;_0x26b9f6[_0x6640('0x81')]=_['orderBy'](_0x403cb6[_0x6640('0x7f')],[_0x6640('0x82')],[_0x6640('0x83')]);if(_0x26b9f6[_0x6640('0x80')][_0x6640('0x7f')]){delete _0x26b9f6[_0x6640('0x80')]['Applications'];}return db[_0x6640('0x84')][_0x6640('0x62')]();})[_0x6640('0x1e')](function(_0x43e14b){if(!_0x43e14b){throw new db[(_0x6640('0x85'))][(_0x6640('0x86'))](_0x6640('0x87'));}_0x3b9094=_[_0x6640('0x88')](_[_0x6640('0x41')](_0x43e14b),['createdAt',_0x6640('0x89')]);_0x220c06=_['difference'](_['keys'](_0x43e14b),[_0x6640('0x8a'),_0x6640('0x89'),_0x6640('0x8b'),_0x6640('0x8c')]);_0x26b9f6[_0x6640('0x59')]={'mapKey':_0x6640('0x8d')};if(_0x26b9f6['account'][_0x6640('0x8e')]&&_0x26b9f6[_0x6640('0x80')][_0x6640('0x8e')]===_0x6640('0x8f')){_0x26b9f6[_0x6640('0x59')][_0x6640('0x90')]=_0x4cd20e['body'][_0x6640('0x91')][_0x6640('0x92')](_0x6640('0x93'),'');_0x26b9f6[_0x6640('0x59')][_0x6640('0x59')]=_0x4cd20e[_0x6640('0x59')][_0x6640('0x94')];_0x26b9f6['body'][_0x6640('0x95')]=_0x4cd20e[_0x6640('0x59')][_0x6640('0x96')];}if(_0x26b9f6[_0x6640('0x59')]['id']){delete _0x26b9f6[_0x6640('0x59')]['id'];}if(_['isNil'](_0x26b9f6['body'][_0x6640('0x90')])){throw new db['Sequelize'][(_0x6640('0x86'))](_0x6640('0x97'));}if(_[_0x6640('0x98')](_0x26b9f6[_0x6640('0x59')][_0x6640('0x59')])||_0x26b9f6['body'][_0x6640('0x59')]===''){throw new db[(_0x6640('0x85'))][(_0x6640('0x86'))](_0x6640('0x99'));}if(_[_0x6640('0x98')](_0x26b9f6[_0x6640('0x59')][_0x6640('0x9a')])){throw new db[(_0x6640('0x85'))][(_0x6640('0x86'))](_0x6640('0x9b')+_0x220c06);}if(!_[_0x6640('0x9c')](_0x220c06,_0x26b9f6[_0x6640('0x59')][_0x6640('0x9a')])){throw new db[(_0x6640('0x85'))][(_0x6640('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x220c06);}_0x480535[_0x26b9f6[_0x6640('0x59')][_0x6640('0x9a')]]=_0x26b9f6[_0x6640('0x59')][_0x6640('0x90')];return db['CmList'][_0x6640('0x57')]({'where':{'id':_0x26b9f6['account'][_0x6640('0x8c')]},'include':[{'model':db['CmContact'],'as':_0x6640('0x9d'),'where':_0x480535,'limit':0x1,'order':[[_0x6640('0x89'),'DESC']]}]});})[_0x6640('0x1e')](handleEntityNotFound(_0x5066bf,null))[_0x6640('0x1e')](function(_0x23762f){if(_0x23762f){_0x26b9f6[_0x6640('0x9e')]=_[_0x6640('0x6e')](_0x23762f,[_0x6640('0x9d')]);if(_0x23762f[_0x6640('0x9d')][_0x6640('0x47')]){return _0x23762f['Contacts'][0x0];}var _0x161e13=_[_0x6640('0x15')](_0x26b9f6[_0x6640('0x59')],{'firstName':_0x26b9f6[_0x6640('0x59')][_0x6640('0x90')],'ListId':_0x23762f['id']});_0x161e13[_0x26b9f6[_0x6640('0x59')][_0x6640('0x9a')]]=_0x26b9f6[_0x6640('0x59')]['from'];return db[_0x6640('0x84')]['create'](_0x161e13,{'fields':_0x3b9094,'raw':!![]});}})[_0x6640('0x1e')](handleEntityNotFound(_0x5066bf,null))['then'](function(_0x528fca){if(_0x528fca){_0x26b9f6[_0x6640('0x9f')]=_0x528fca;var _0x470377={'ContactId':_0x528fca['id'],'phone':_0x26b9f6[_0x6640('0x59')][_0x6640('0x90')],'WhatsappAccountId':_0x4cd20e[_0x6640('0x54')]['id']};var _0x17557b={'ContactId':_0x528fca['id'],'WhatsappAccountId':_0x4cd20e[_0x6640('0x54')]['id'],'closed':![]};return db[_0x6640('0xa0')]['find']({'where':_0x17557b})[_0x6640('0x1e')](function(_0x135e20){if(_0x135e20){return[_0x135e20,![]];}return db[_0x6640('0xa0')][_0x6640('0x58')](_0x470377)['then'](function(_0x2513d0){return[_0x2513d0,!![]];});});}})['spread'](function(_0x26c890,_0xb9da9f){_0x26b9f6[_0x6640('0xa1')]=_0x26c890[_0x6640('0x35')]({'plain':!![]});_0x26b9f6[_0x6640('0xa1')][_0x6640('0xa2')]=![];if(_0xb9da9f){if(_0x26b9f6[_0x6640('0x80')]['autoclose']){_0x26b9f6[_0x6640('0x81')][_0x6640('0xa3')]({'id':0x0,'priority':_0x26b9f6[_0x6640('0x81')][_0x6640('0x47')]+0x1,'app':'close','appdata':_0x6640('0xa4'),'interval':_0x6640('0xa5')});}_0x26b9f6[_0x6640('0xa1')][_0x6640('0xa2')]=!![];}return db[_0x6640('0xa6')][_0x6640('0x58')]({'phone':_0x26b9f6[_0x6640('0x59')][_0x6640('0x90')],'messageId':_0x26b9f6[_0x6640('0x59')][_0x6640('0x95')],'body':_0x26b9f6[_0x6640('0x59')][_0x6640('0x59')],'WhatsappAccountId':_0x4cd20e[_0x6640('0x54')]['id'],'WhatsappInteractionId':_0x26c890['id'],'direction':'in','ContactId':_0x26c890[_0x6640('0xa7')],'AttachmentId':_0x26b9f6[_0x6640('0x59')][_0x6640('0xa8')]});})['then'](function(_0x2d3c2a){_0x26b9f6[_0x6640('0x25')]=_0x2d3c2a;if(_0x26b9f6[_0x6640('0xa1')][_0x6640('0xa9')]){return db['User'][_0x6640('0x57')]({'attributes':['id',_0x6640('0x37')],'where':{'id':_0x26b9f6['interaction'][_0x6640('0xa9')]}})[_0x6640('0x1e')](function(_0x181eff){if(_0x181eff){_0x26b9f6[_0x6640('0x81')][_0x6640('0xaa')]({'id':0x0,'priority':0x0,'app':_0x6640('0xab'),'appdata':_0x181eff['name']+','+(_0x26b9f6[_0x6640('0x80')][_0x6640('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x6640('0xad'),_0x26b9f6);});}return respondWithRpcPromise(_0x6640('0xae'),_0x6640('0xad'),_0x26b9f6);})['then'](function(_0x2b87a9){if(_0x2b87a9){var _0x23dd2c=0xc8;var _0x254cd3=_0x6640('0xaf');logger[_0x6640('0x1f')](_0x6640('0xb0'),_0x254cd3,_0x23dd2c,'entity\x20found');logger[_0x6640('0x21')](_0x6640('0xb1'),_0x254cd3,_0x23dd2c,'entity\x20found',JSON[_0x6640('0x22')](_0x2b87a9));if(_0x26b9f6[_0x6640('0x80')]['type']===_0x6640('0x8f')){return _0x5066bf[_0x6640('0x29')](_0x23dd2c)['set'](_0x6640('0xb2'),_0x6640('0xb3'))[_0x6640('0x38')](_0x6640('0xb4'));}else{return _0x5066bf[_0x6640('0x29')](_0x23dd2c)[_0x6640('0x2b')](_0x2b87a9);}}})['catch'](handleError(_0x5066bf,null));};exports[_0x6640('0x38')]=function(_0x4ae76e,_0x1e55d4,_0x2ce1e4){var _0xedbae7,_0x47d118,_0x30ca5d;if(_[_0x6640('0x98')](_0x4ae76e['body'][_0x6640('0x59')])||_0x4ae76e['body'][_0x6640('0x59')]===''){throw new db[(_0x6640('0x85'))]['ValidationError'](_0x6640('0x99'));}if(_[_0x6640('0x98')](_0x4ae76e[_0x6640('0x59')]['to'])){throw new db[(_0x6640('0x85'))][(_0x6640('0x86'))](_0x6640('0xb5'));}_0xedbae7=_0x4ae76e[_0x6640('0x59')]['to'];return db[_0x6640('0x3c')][_0x6640('0x57')]({'where':{'id':_0x4ae76e['params']['id']},'include':[{'model':db['CmList'],'as':_0x6640('0xb6'),'include':[{'model':db[_0x6640('0x84')],'as':'Contacts','where':{'mobile':_0xedbae7},'limit':0x1,'order':[[_0x6640('0x89'),'DESC']]}]}]})[_0x6640('0x1e')](handleEntityNotFound(_0x1e55d4,null))[_0x6640('0x1e')](function(_0x4ed1ec){if(_0x4ed1ec&&_0x4ed1ec['List']){_0x47d118=_0x4ed1ec[_0x6640('0x35')]({'plain':!![]});if(_0x47d118[_0x6640('0xb6')]&&_0x47d118['List'][_0x6640('0x9d')][_0x6640('0x47')]){return _0x47d118['List']['Contacts'][0x0];}return db[_0x6640('0x84')][_0x6640('0x58')](_[_0x6640('0x15')](_0x4ae76e[_0x6640('0x59')],{'firstName':_0xedbae7,'mobile':_0xedbae7,'phone':_0xedbae7,'ListId':_0x47d118[_0x6640('0x8c')]}));}})['then'](handleEntityNotFound(_0x1e55d4,null))['then'](function(_0x4e580c){if(_0x4e580c){_0x30ca5d=_0x4e580c;return db['WhatsappInteraction'][_0x6640('0x57')]({'where':{'ContactId':_0x30ca5d['id'],'closed':![],'WhatsappAccountId':_0x47d118['id']}})['then'](function(_0x3a58cf){if(_0x3a58cf){return[_0x3a58cf,![]];}return db[_0x6640('0xa0')][_0x6640('0x58')]({'UserId':_0x4ae76e['user']['id'],'ContactId':_0x30ca5d['id'],'WhatsappAccountId':_0x47d118['id'],'phone':_0xedbae7,'firstMsgDirection':_0x6640('0xb7'),'Messages':[_[_0x6640('0x66')](_0x4ae76e[_0x6640('0x59')],{'read':![],'body':_0x4ae76e['body'][_0x6640('0x59')],'phone':_0xedbae7,'WhatsappAccountId':_0x47d118['id'],'UserId':_0x4ae76e[_0x6640('0x5a')]['id'],'ContactId':_0x30ca5d['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x6640('0xb8')}]})[_0x6640('0x1e')](function(_0x249d4c){return[_0x249d4c,!![]];});});}})[_0x6640('0x6f')](function(_0xed8764,_0x499b85){if(_0x499b85){return _0xed8764;}return db['WhatsappMessage'][_0x6640('0x58')](_[_0x6640('0x66')](_0x4ae76e['body'],{'read':![],'body':_0x4ae76e[_0x6640('0x59')][_0x6640('0x59')],'phone':_0xedbae7,'WhatsappAccountId':_0x47d118['id'],'WhatsappInteractionId':_0xed8764['id'],'UserId':_0x4ae76e[_0x6640('0x5a')]['id'],'ContactId':_0x30ca5d['id']}))['then'](function(_0x36b5f1){_0xed8764['dataValues'][_0x6640('0xb8')]=[];_0xed8764[_0x6640('0xb9')][_0x6640('0xb8')][_0x6640('0xa3')](_0x36b5f1[_0x6640('0xb9')]);return _0xed8764;});})['then'](respondWithResult(_0x1e55d4,null))[_0x6640('0x27')](handleError(_0x1e55d4,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b790651..e6c47b1 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x528f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1c0bf0,_0x389ac0){var _0x26cc3a=function(_0x338912){while(--_0x338912){_0x1c0bf0['push'](_0x1c0bf0['shift']());}};_0x26cc3a(++_0x389ac0);}(_0x528f,0x163));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf528('0x0'));var WhatsappAccount=require(_0xf528('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf528('0x2')](0x0);var events={'afterCreate':_0xf528('0x3'),'afterUpdate':_0xf528('0x4'),'afterDestroy':_0xf528('0x5')};function emitEvent(_0x38447d){return function(_0x1fbe16,_0x167812,_0x16f78e){WhatsappAccountEvents['emit'](_0x38447d+':'+_0x1fbe16['id'],_0x1fbe16);WhatsappAccountEvents[_0xf528('0x6')](_0x38447d,_0x1fbe16);_0x16f78e(null);};}for(var e in events){if(events[_0xf528('0x7')](e)){var event=events[e];WhatsappAccount[_0xf528('0x8')](e,emitEvent(event));}}module[_0xf528('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x899f=['WhatsappAccount','save','emit','hook','exports','../../mysqldb'];(function(_0x3765a0,_0x44093e){var _0x348aa3=function(_0x3a6959){while(--_0x3a6959){_0x3765a0['push'](_0x3765a0['shift']());}};_0x348aa3(++_0x44093e);}(_0x899f,0xdd));var _0xf899=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0x899f[_0x3cb7c1];return _0x3f6ffc;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf899('0x0'))['db'][_0xf899('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf899('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x312c56){return function(_0x297db3,_0x532aa3,_0x568cf7){WhatsappAccountEvents[_0xf899('0x3')](_0x312c56+':'+_0x297db3['id'],_0x297db3);WhatsappAccountEvents['emit'](_0x312c56,_0x297db3);_0x568cf7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xf899('0x4')](e,emitEvent(event));}}module[_0xf899('0x5')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6fd5b2f..1122e8d 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59c6=['lodash','../../config/logger','api','bluebird','path','WhatsappAccount'];(function(_0xdbe530,_0x469b4e){var _0x142d14=function(_0x337930){while(--_0x337930){_0xdbe530['push'](_0xdbe530['shift']());}};_0x142d14(++_0x469b4e);}(_0x59c6,0x7e));var _0x659c=function(_0x4ef8d5,_0x18e445){_0x4ef8d5=_0x4ef8d5-0x0;var _0x335554=_0x59c6[_0x4ef8d5];return _0x335554;};'use strict';var _=require(_0x659c('0x0'));var util=require('util');var logger=require(_0x659c('0x1'))(_0x659c('0x2'));var moment=require('moment');var BPromise=require(_0x659c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x659c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x597b24,_0x1012b6){return _0x597b24['define'](_0x659c('0x5'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9881=['../../config/logger','api','moment','bluebird','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x4d22ec,_0x3a3d10){var _0x375382=function(_0x117362){while(--_0x117362){_0x4d22ec['push'](_0x4d22ec['shift']());}};_0x375382(++_0x3a3d10);}(_0x9881,0x15b));var _0x1988=function(_0x3a2e54,_0x7bdda2){_0x3a2e54=_0x3a2e54-0x0;var _0x252819=_0x9881[_0x3a2e54];return _0x252819;};'use strict';var _=require(_0x1988('0x0'));var util=require('util');var logger=require(_0x1988('0x1'))(_0x1988('0x2'));var moment=require(_0x1988('0x3'));var BPromise=require(_0x1988('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1988('0x5'));var rimraf=require('rimraf');var config=require(_0x1988('0x6'));var attributes=require(_0x1988('0x7'));module[_0x1988('0x8')]=function(_0x247e7c,_0x20e884){return _0x247e7c[_0x1988('0x9')](_0x1988('0xa'),attributes,{'tableName':_0x1988('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 3c585f2..7c86890 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66eb=['./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappAccount','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x1a2e6c,_0x51faa3){var _0x897672=function(_0x20dd94){while(--_0x20dd94){_0x1a2e6c['push'](_0x1a2e6c['shift']());}};_0x897672(++_0x51faa3);}(_0x66eb,0x1d2));var _0xb66e=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x66eb[_0x5b7788];return _0x573871;};'use strict';var _=require(_0xb66e('0x0'));var util=require(_0xb66e('0x1'));var moment=require(_0xb66e('0x2'));var BPromise=require('bluebird');var rs=require(_0xb66e('0x3'));var fs=require('fs');var Redis=require(_0xb66e('0x4'));var db=require(_0xb66e('0x5'))['db'];var utils=require(_0xb66e('0x6'));var logger=require(_0xb66e('0x7'))(_0xb66e('0x8'));var config=require(_0xb66e('0x9'));var jayson=require(_0xb66e('0xa'));var client=jayson['client'][_0xb66e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb66e('0xc')],{'host':_0xb66e('0xd'),'port':0x18eb});var socket=require(_0xb66e('0xe'))(new Redis(config['redis']));require(_0xb66e('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d8f28,_0x1b2488,_0x27cda1){return new BPromise(function(_0x39c1d6,_0x37193e){return client[_0xb66e('0x10')](_0x3d8f28,_0x27cda1)[_0xb66e('0x11')](function(_0x1f1943){logger[_0xb66e('0x12')](_0xb66e('0x13'),_0x1b2488,_0xb66e('0x14'));logger[_0xb66e('0x15')](_0xb66e('0x16'),_0x1b2488,_0xb66e('0x14'),JSON[_0xb66e('0x17')](_0x1f1943));if(_0x1f1943[_0xb66e('0x18')]){if(_0x1f1943[_0xb66e('0x18')]['code']===0x1f4){logger['error'](_0xb66e('0x13'),_0x1b2488,_0x1f1943[_0xb66e('0x18')][_0xb66e('0x19')]);return _0x37193e(_0x1f1943[_0xb66e('0x18')]['message']);}logger[_0xb66e('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x1b2488,_0x1f1943[_0xb66e('0x18')][_0xb66e('0x19')]);return _0x39c1d6(_0x1f1943['error']['message']);}else{logger[_0xb66e('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x1b2488,'request\x20sent');_0x39c1d6(_0x1f1943[_0xb66e('0x1a')][_0xb66e('0x19')]);}})[_0xb66e('0x1b')](function(_0x10f1a5){logger[_0xb66e('0x18')](_0xb66e('0x13'),_0x1b2488,_0x10f1a5);_0x37193e(_0x10f1a5);});});}exports['ShowWhatsappAccount']=function(_0x19c01a){var _0x2b7fbc=this;return new Promise(function(_0x2972b1,_0x493676){return db[_0xb66e('0x1c')]['find']({'raw':_0x19c01a[_0xb66e('0x1d')]?_0x19c01a[_0xb66e('0x1d')][_0xb66e('0x1e')]===undefined?!![]:![]:!![],'where':_0x19c01a['options']?_0x19c01a[_0xb66e('0x1d')][_0xb66e('0x1f')]||null:null,'attributes':_0x19c01a[_0xb66e('0x1d')]?_0x19c01a[_0xb66e('0x1d')][_0xb66e('0x20')]||null:null,'include':_0x19c01a[_0xb66e('0x1d')]?_0x19c01a[_0xb66e('0x1d')][_0xb66e('0x21')]?_[_0xb66e('0x22')](_0x19c01a[_0xb66e('0x1d')][_0xb66e('0x21')],function(_0x4c3ade){return{'model':db[_0x4c3ade[_0xb66e('0x23')]],'as':_0x4c3ade['as'],'attributes':_0x4c3ade[_0xb66e('0x20')],'include':_0x4c3ade[_0xb66e('0x21')]?_['map'](_0x4c3ade['include'],function(_0x292e2d){return{'model':db[_0x292e2d[_0xb66e('0x23')]],'as':_0x292e2d['as'],'attributes':_0x292e2d[_0xb66e('0x20')],'include':_0x292e2d['include']?_['map'](_0x292e2d[_0xb66e('0x21')],function(_0x222a61){return{'model':db[_0x222a61['model']],'as':_0x222a61['as'],'attributes':_0x222a61[_0xb66e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb66e('0x11')](function(_0x397b98){logger[_0xb66e('0x12')](_0xb66e('0x24'),_0x19c01a);logger[_0xb66e('0x15')](_0xb66e('0x24'),_0x19c01a,JSON['stringify'](_0x397b98));_0x2972b1(_0x397b98);})[_0xb66e('0x1b')](function(_0x344278){logger['error']('ShowWhatsappAccount',_0x344278['message'],_0x19c01a);_0x493676(_0x2b7fbc[_0xb66e('0x18')](0x1f4,_0x344278[_0xb66e('0x19')]));});});}; \ No newline at end of file +var _0xb418=['redis','localhost','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowWhatsappAccount','find','options','raw','where','include','model','attributes','map','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb418,0x1b6));var _0x8b41=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xb418[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x8b41('0x0'));var util=require(_0x8b41('0x1'));var moment=require(_0x8b41('0x2'));var BPromise=require(_0x8b41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b41('0x4'));var db=require(_0x8b41('0x5'))['db'];var utils=require(_0x8b41('0x6'));var logger=require('../../config/logger')(_0x8b41('0x7'));var config=require('../../config/environment');var jayson=require(_0x8b41('0x8'));var client=jayson['client'][_0x8b41('0x9')]({'port':0x232a});config[_0x8b41('0xa')]=_['defaults'](config[_0x8b41('0xa')],{'host':_0x8b41('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x17d346,_0x5ec527,_0x5e7705){return new BPromise(function(_0x4ca215,_0x1f2c1a){return client['request'](_0x17d346,_0x5e7705)[_0x8b41('0xc')](function(_0x2adf77){logger[_0x8b41('0xd')](_0x8b41('0xe'),_0x5ec527,_0x8b41('0xf'));logger['debug'](_0x8b41('0x10'),_0x5ec527,'request\x20sent',JSON[_0x8b41('0x11')](_0x2adf77));if(_0x2adf77[_0x8b41('0x12')]){if(_0x2adf77[_0x8b41('0x12')][_0x8b41('0x13')]===0x1f4){logger[_0x8b41('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x5ec527,_0x2adf77[_0x8b41('0x12')][_0x8b41('0x14')]);return _0x1f2c1a(_0x2adf77['error'][_0x8b41('0x14')]);}logger['error'](_0x8b41('0xe'),_0x5ec527,_0x2adf77['error']['message']);return _0x4ca215(_0x2adf77[_0x8b41('0x12')][_0x8b41('0x14')]);}else{logger[_0x8b41('0xd')](_0x8b41('0xe'),_0x5ec527,_0x8b41('0xf'));_0x4ca215(_0x2adf77['result']['message']);}})['catch'](function(_0x363c55){logger[_0x8b41('0x12')](_0x8b41('0xe'),_0x5ec527,_0x363c55);_0x1f2c1a(_0x363c55);});});}exports[_0x8b41('0x15')]=function(_0xd703ee){var _0x56bf3b=this;return new Promise(function(_0x2f4b2e,_0x991e38){return db['WhatsappAccount'][_0x8b41('0x16')]({'raw':_0xd703ee[_0x8b41('0x17')]?_0xd703ee[_0x8b41('0x17')][_0x8b41('0x18')]===undefined?!![]:![]:!![],'where':_0xd703ee['options']?_0xd703ee[_0x8b41('0x17')][_0x8b41('0x19')]||null:null,'attributes':_0xd703ee[_0x8b41('0x17')]?_0xd703ee[_0x8b41('0x17')]['attributes']||null:null,'include':_0xd703ee[_0x8b41('0x17')]?_0xd703ee[_0x8b41('0x17')]['include']?_['map'](_0xd703ee[_0x8b41('0x17')][_0x8b41('0x1a')],function(_0x3ef21f){return{'model':db[_0x3ef21f[_0x8b41('0x1b')]],'as':_0x3ef21f['as'],'attributes':_0x3ef21f[_0x8b41('0x1c')],'include':_0x3ef21f[_0x8b41('0x1a')]?_[_0x8b41('0x1d')](_0x3ef21f[_0x8b41('0x1a')],function(_0x58a5c0){return{'model':db[_0x58a5c0[_0x8b41('0x1b')]],'as':_0x58a5c0['as'],'attributes':_0x58a5c0[_0x8b41('0x1c')],'include':_0x58a5c0[_0x8b41('0x1a')]?_[_0x8b41('0x1d')](_0x58a5c0[_0x8b41('0x1a')],function(_0x5ec521){return{'model':db[_0x5ec521[_0x8b41('0x1b')]],'as':_0x5ec521['as'],'attributes':_0x5ec521[_0x8b41('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8b41('0xc')](function(_0x54004b){logger[_0x8b41('0xd')](_0x8b41('0x15'),_0xd703ee);logger[_0x8b41('0x1e')](_0x8b41('0x15'),_0xd703ee,JSON[_0x8b41('0x11')](_0x54004b));_0x2f4b2e(_0x54004b);})[_0x8b41('0x1f')](function(_0x4a1e97){logger[_0x8b41('0x12')]('ShowWhatsappAccount',_0x4a1e97[_0x8b41('0x14')],_0xd703ee);_0x991e38(_0x56bf3b[_0x8b41('0x12')](0x1f4,_0x4a1e97[_0x8b41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7dcc640..7076649 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd0e6=['removeListener','length','./whatsappAccount.events','save','update'];(function(_0x348563,_0x1b7da1){var _0x447302=function(_0xa65e0e){while(--_0xa65e0e){_0x348563['push'](_0x348563['shift']());}};_0x447302(++_0x1b7da1);}(_0xd0e6,0x17e));var _0x6d0e=function(_0x194adf,_0x220258){_0x194adf=_0x194adf-0x0;var _0x2242e3=_0xd0e6[_0x194adf];return _0x2242e3;};'use strict';var WhatsappAccountEvents=require(_0x6d0e('0x0'));var events=[_0x6d0e('0x1'),'remove',_0x6d0e('0x2')];function createListener(_0x1deaf2,_0x2d7bb2){return function(_0x3ed580){_0x2d7bb2['emit'](_0x1deaf2,_0x3ed580);};}function removeListener(_0x1d3c0b,_0x4a136f){return function(){WhatsappAccountEvents[_0x6d0e('0x3')](_0x1d3c0b,_0x4a136f);};}exports['register']=function(_0x4d2293){for(var _0x3537eb=0x0,_0x2c24e5=events[_0x6d0e('0x4')];_0x3537eb<_0x2c24e5;_0x3537eb++){var _0xf36e=events[_0x3537eb];var _0x210293=createListener('whatsappAccount:'+_0xf36e,_0x4d2293);WhatsappAccountEvents['on'](_0xf36e,_0x210293);}}; \ No newline at end of file +var _0x5a9a=['save','remove','update','emit','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0x5a9a,0x1af));var _0xa5a9=function(_0x269507,_0x2de1ae){_0x269507=_0x269507-0x0;var _0x45566a=_0x5a9a[_0x269507];return _0x45566a;};'use strict';var WhatsappAccountEvents=require(_0xa5a9('0x0'));var events=[_0xa5a9('0x1'),_0xa5a9('0x2'),_0xa5a9('0x3')];function createListener(_0x348452,_0x1020b3){return function(_0x3947df){_0x1020b3[_0xa5a9('0x4')](_0x348452,_0x3947df);};}function removeListener(_0x24afb0,_0x1b031b){return function(){WhatsappAccountEvents['removeListener'](_0x24afb0,_0x1b031b);};}exports[_0xa5a9('0x5')]=function(_0x5999d0){for(var _0x2368f5=0x0,_0x2d2fc8=events[_0xa5a9('0x6')];_0x2368f5<_0x2d2fc8;_0x2368f5++){var _0x308cd6=events[_0x2368f5];var _0x2ab69d=createListener(_0xa5a9('0x7')+_0x308cd6,_0x5999d0);WhatsappAccountEvents['on'](_0x308cd6,_0x2ab69d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 039e898..3ceaec8 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb616=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x45042a,_0x59c0e9){var _0x3feaf7=function(_0x18eb54){while(--_0x18eb54){_0x45042a['push'](_0x45042a['shift']());}};_0x3feaf7(++_0x59c0e9);}(_0xb616,0x178));var _0x6b61=function(_0x4d7756,_0xd7e654){_0x4d7756=_0x4d7756-0x0;var _0x4aff3c=_0xb616[_0x4d7756];return _0x4aff3c;};'use strict';var multer=require(_0x6b61('0x0'));var util=require('util');var path=require(_0x6b61('0x1'));var timeout=require(_0x6b61('0x2'));var express=require(_0x6b61('0x3'));var router=express[_0x6b61('0x4')]();var fs_extra=require(_0x6b61('0x5'));var auth=require(_0x6b61('0x6'));var interaction=require(_0x6b61('0x7'));var config=require(_0x6b61('0x8'));var controller=require(_0x6b61('0x9'));router[_0x6b61('0xa')]('/',auth[_0x6b61('0xb')](),controller[_0x6b61('0xc')]);router[_0x6b61('0xa')](_0x6b61('0xd'),auth[_0x6b61('0xb')](),controller[_0x6b61('0xe')]);router[_0x6b61('0xf')]('/',auth[_0x6b61('0xb')](),controller['create']);router['put'](_0x6b61('0xd'),auth[_0x6b61('0xb')](),controller[_0x6b61('0x10')]);router[_0x6b61('0x11')](_0x6b61('0xd'),auth[_0x6b61('0xb')](),controller[_0x6b61('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6c13=['update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','show','post'];(function(_0x3340fa,_0x54eae8){var _0x309e22=function(_0x1095ff){while(--_0x1095ff){_0x3340fa['push'](_0x3340fa['shift']());}};_0x309e22(++_0x54eae8);}(_0x6c13,0x100));var _0x36c1=function(_0x1c07c3,_0x41e664){_0x1c07c3=_0x1c07c3-0x0;var _0x3728b4=_0x6c13[_0x1c07c3];return _0x3728b4;};'use strict';var multer=require(_0x36c1('0x0'));var util=require(_0x36c1('0x1'));var path=require(_0x36c1('0x2'));var timeout=require(_0x36c1('0x3'));var express=require(_0x36c1('0x4'));var router=express[_0x36c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36c1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x36c1('0x7'));var controller=require(_0x36c1('0x8'));router['get']('/',auth[_0x36c1('0x9')](),controller[_0x36c1('0xa')]);router[_0x36c1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x36c1('0xc')]);router[_0x36c1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x36c1('0xe')]);router[_0x36c1('0xf')](_0x36c1('0x10'),auth[_0x36c1('0x9')](),controller['destroy']);module[_0x36c1('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 306656d..d4df098 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ca7=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1327d4,_0x3c3f72){var _0x224cb1=function(_0x7ecd20){while(--_0x7ecd20){_0x1327d4['push'](_0x1327d4['shift']());}};_0x224cb1(++_0x3c3f72);}(_0x4ca7,0x1e3));var _0x74ca=function(_0x44da5b,_0x17447a){_0x44da5b=_0x44da5b-0x0;var _0x1fc98a=_0x4ca7[_0x44da5b];return _0x1fc98a;};'use strict';var Sequelize=require(_0x74ca('0x0'));module[_0x74ca('0x1')]={'priority':{'type':Sequelize[_0x74ca('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x74ca('0x3')},'appdata':{'type':Sequelize[_0x74ca('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x74ca('0x5')}}; \ No newline at end of file +var _0xee8a=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xee8a,0xf8));var _0xaee8=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xee8a[_0xcf4569];return _0x7fef;};'use strict';var Sequelize=require(_0xaee8('0x0'));module[_0xaee8('0x1')]={'priority':{'type':Sequelize[_0xaee8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaee8('0x3')],'allowNull':![],'defaultValue':_0xaee8('0x4')},'appdata':{'type':Sequelize[_0xaee8('0x5')]()},'description':{'type':Sequelize[_0xaee8('0x3')]},'interval':{'type':Sequelize[_0xaee8('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index ccb3b8b..d5f6d20 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9123=['fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','WhatsappApplication','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send','index','rawAttributes'];(function(_0x2ca744,_0x132574){var _0x5d8ae5=function(_0x8546bd){while(--_0x8546bd){_0x2ca744['push'](_0x2ca744['shift']());}};_0x5d8ae5(++_0x132574);}(_0x9123,0x140));var _0x3912=function(_0x5ef936,_0x38dc46){_0x5ef936=_0x5ef936-0x0;var _0x154d2d=_0x9123[_0x5ef936];return _0x154d2d;};'use strict';var emlformat=require(_0x3912('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3912('0x1'));var moment=require('moment');var BPromise=require(_0x3912('0x2'));var Mustache=require(_0x3912('0x3'));var util=require(_0x3912('0x4'));var path=require(_0x3912('0x5'));var sox=require('sox');var csv=require(_0x3912('0x6'));var ejs=require(_0x3912('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3912('0x8'));var crypto=require(_0x3912('0x9'));var jsforce=require(_0x3912('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3912('0x6'));var querystring=require(_0x3912('0xb'));var Papa=require(_0x3912('0xc'));var Redis=require(_0x3912('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3912('0xe'));var as=require(_0x3912('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3912('0x10'))(_0x3912('0x11'));var utils=require(_0x3912('0x12'));var config=require(_0x3912('0x13'));var licenseUtil=require(_0x3912('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59f22e,_0x475841){_0x475841=_0x475841||0xcc;return function(_0x220215){if(_0x220215){return _0x59f22e[_0x3912('0x15')](_0x475841);}return _0x59f22e['status'](_0x475841)[_0x3912('0x16')]();};}function respondWithResult(_0x2d9986,_0x4bac4a){_0x4bac4a=_0x4bac4a||0xc8;return function(_0x37fdf1){if(_0x37fdf1){return _0x2d9986[_0x3912('0x17')](_0x4bac4a)[_0x3912('0x18')](_0x37fdf1);}};}function respondWithFilteredResult(_0x474fc8,_0x50a76a){return function(_0x1129da){if(_0x1129da){var _0x2b0b8a=typeof _0x50a76a[_0x3912('0x19')]===_0x3912('0x1a')&&typeof _0x50a76a[_0x3912('0x1b')]==='undefined';var _0x23e7a2=_0x1129da[_0x3912('0x1c')];var _0x2e4649=_0x2b0b8a?0x0:_0x50a76a[_0x3912('0x19')];var _0x2b48b1=_0x2b0b8a?_0x1129da['count']:_0x50a76a[_0x3912('0x19')]+_0x50a76a[_0x3912('0x1b')];var _0x135c4a;if(_0x2b48b1>=_0x23e7a2){_0x2b48b1=_0x23e7a2;_0x135c4a=0xc8;}else{_0x135c4a=0xce;}_0x474fc8['status'](_0x135c4a);return _0x474fc8[_0x3912('0x1d')](_0x3912('0x1e'),_0x2e4649+'-'+_0x2b48b1+'/'+_0x23e7a2)[_0x3912('0x18')](_0x1129da);}return null;};}function patchUpdates(_0x3a06ef){return function(_0x344fc3){try{jsonpatch[_0x3912('0x1f')](_0x344fc3,_0x3a06ef,!![]);}catch(_0xc6471f){return BPromise['reject'](_0xc6471f);}return _0x344fc3['save']();};}function saveUpdates(_0x33b507,_0x1a4486){return function(_0x3007c9){if(_0x3007c9){return _0x3007c9[_0x3912('0x20')](_0x33b507)[_0x3912('0x21')](function(_0x11bb54){return _0x11bb54;});}return null;};}function removeEntity(_0x3fd425,_0x40f601){return function(_0x1e21ab){if(_0x1e21ab){return _0x1e21ab['destroy']()[_0x3912('0x21')](function(){_0x3fd425[_0x3912('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2af8cf,_0xcf5300){return function(_0xe6733a){if(!_0xe6733a){_0x2af8cf[_0x3912('0x15')](0x194);}return _0xe6733a;};}function handleError(_0x4e078f,_0x480595){_0x480595=_0x480595||0x1f4;return function(_0x426907){logger[_0x3912('0x22')](_0x426907[_0x3912('0x23')]);if(_0x426907[_0x3912('0x24')]){delete _0x426907[_0x3912('0x24')];}_0x4e078f[_0x3912('0x17')](_0x480595)[_0x3912('0x25')](_0x426907);};}exports[_0x3912('0x26')]=function(_0x289111,_0x20d7a0){var _0x50a031={},_0x5b0729={},_0x4fe3ab={'count':0x0,'rows':[]};var _0x473ee3=_['map'](db['WhatsappApplication'][_0x3912('0x27')],function(_0x31c4cf){return{'name':_0x31c4cf[_0x3912('0x28')],'type':_0x31c4cf['type'][_0x3912('0x29')]};});_0x5b0729[_0x3912('0x2a')]=_[_0x3912('0x2b')](_0x473ee3,_0x3912('0x24'));_0x5b0729[_0x3912('0x2c')]=_[_0x3912('0x2d')](_0x289111[_0x3912('0x2c')]);_0x5b0729[_0x3912('0x2e')]=_['intersection'](_0x5b0729[_0x3912('0x2a')],_0x5b0729[_0x3912('0x2c')]);_0x50a031['attributes']=_[_0x3912('0x2f')](_0x5b0729['model'],qs[_0x3912('0x30')](_0x289111['query']['fields']));_0x50a031[_0x3912('0x31')]=_0x50a031['attributes'][_0x3912('0x32')]?_0x50a031['attributes']:_0x5b0729[_0x3912('0x2a')];if(!_0x289111[_0x3912('0x2c')]['hasOwnProperty'](_0x3912('0x33'))){_0x50a031[_0x3912('0x1b')]=qs[_0x3912('0x1b')](_0x289111['query'][_0x3912('0x1b')]);_0x50a031['offset']=qs[_0x3912('0x19')](_0x289111['query'][_0x3912('0x19')]);}_0x50a031[_0x3912('0x34')]=qs[_0x3912('0x35')](_0x289111[_0x3912('0x2c')][_0x3912('0x35')]);_0x50a031[_0x3912('0x36')]=qs[_0x3912('0x2e')](_['pick'](_0x289111['query'],_0x5b0729['filters']),_0x473ee3);if(_0x289111[_0x3912('0x2c')][_0x3912('0x37')]){_0x50a031[_0x3912('0x36')]=_[_0x3912('0x38')](_0x50a031[_0x3912('0x36')],{'$or':_[_0x3912('0x2b')](_0x473ee3,function(_0x378481){if(_0x378481[_0x3912('0x39')]!==_0x3912('0x3a')){var _0x2f009d={};_0x2f009d[_0x378481[_0x3912('0x24')]]={'$like':'%'+_0x289111['query'][_0x3912('0x37')]+'%'};return _0x2f009d;}})});}_0x50a031=_[_0x3912('0x38')]({},_0x50a031,_0x289111[_0x3912('0x3b')]);var _0x3d6197={'where':_0x50a031[_0x3912('0x36')]};return db[_0x3912('0x3c')][_0x3912('0x1c')](_0x3d6197)[_0x3912('0x21')](function(_0x2f3676){_0x4fe3ab[_0x3912('0x1c')]=_0x2f3676;if(_0x289111[_0x3912('0x2c')]['includeAll']){_0x50a031[_0x3912('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x3912('0x3e')](_0x50a031);})[_0x3912('0x21')](function(_0x1a02a7){_0x4fe3ab[_0x3912('0x3f')]=_0x1a02a7;return _0x4fe3ab;})['then'](respondWithFilteredResult(_0x20d7a0,_0x50a031))[_0x3912('0x40')](handleError(_0x20d7a0,null));};exports[_0x3912('0x41')]=function(_0x5b0c9e,_0x3d7dc1){var _0x20153a={'raw':!![],'where':{'id':_0x5b0c9e[_0x3912('0x42')]['id']}},_0x4fdee0={};_0x4fdee0[_0x3912('0x2a')]=_['keys'](db[_0x3912('0x3c')][_0x3912('0x27')]);_0x4fdee0[_0x3912('0x2c')]=_[_0x3912('0x2d')](_0x5b0c9e[_0x3912('0x2c')]);_0x4fdee0[_0x3912('0x2e')]=_['intersection'](_0x4fdee0[_0x3912('0x2a')],_0x4fdee0[_0x3912('0x2c')]);_0x20153a[_0x3912('0x31')]=_[_0x3912('0x2f')](_0x4fdee0[_0x3912('0x2a')],qs[_0x3912('0x30')](_0x5b0c9e[_0x3912('0x2c')][_0x3912('0x30')]));_0x20153a[_0x3912('0x31')]=_0x20153a['attributes']['length']?_0x20153a[_0x3912('0x31')]:_0x4fdee0['model'];if(_0x5b0c9e[_0x3912('0x2c')][_0x3912('0x43')]){_0x20153a[_0x3912('0x3d')]=[{'all':!![]}];}_0x20153a=_[_0x3912('0x38')]({},_0x20153a,_0x5b0c9e[_0x3912('0x3b')]);return db[_0x3912('0x3c')][_0x3912('0x44')](_0x20153a)[_0x3912('0x21')](handleEntityNotFound(_0x3d7dc1,null))[_0x3912('0x21')](respondWithResult(_0x3d7dc1,null))['catch'](handleError(_0x3d7dc1,null));};exports[_0x3912('0x45')]=function(_0x543cc8,_0x287e7b){return db[_0x3912('0x3c')][_0x3912('0x45')](_0x543cc8[_0x3912('0x46')],{})[_0x3912('0x21')](respondWithResult(_0x287e7b,0xc9))['catch'](handleError(_0x287e7b,null));};exports[_0x3912('0x20')]=function(_0x6b94df,_0x3dfc03){if(_0x6b94df['body']['id']){delete _0x6b94df[_0x3912('0x46')]['id'];}return db[_0x3912('0x3c')][_0x3912('0x44')]({'where':{'id':_0x6b94df['params']['id']}})['then'](handleEntityNotFound(_0x3dfc03,null))[_0x3912('0x21')](saveUpdates(_0x6b94df['body'],null))['then'](respondWithResult(_0x3dfc03,null))[_0x3912('0x40')](handleError(_0x3dfc03,null));};exports[_0x3912('0x47')]=function(_0x4e3c08,_0x37c6eb){return db['WhatsappApplication'][_0x3912('0x44')]({'where':{'id':_0x4e3c08[_0x3912('0x42')]['id']}})['then'](handleEntityNotFound(_0x37c6eb,null))[_0x3912('0x21')](removeEntity(_0x37c6eb,null))['catch'](handleError(_0x37c6eb,null));}; \ No newline at end of file +var _0xcaf2=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring'];(function(_0xbbd83d,_0xfbe6f0){var _0x19cb4a=function(_0x213559){while(--_0x213559){_0xbbd83d['push'](_0xbbd83d['shift']());}};_0x19cb4a(++_0xfbe6f0);}(_0xcaf2,0x8a));var _0x2caf=function(_0x2263d6,_0x23ef72){_0x2263d6=_0x2263d6-0x0;var _0x392795=_0xcaf2[_0x2263d6];return _0x392795;};'use strict';var emlformat=require(_0x2caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2caf('0x1'));var jsonpatch=require(_0x2caf('0x2'));var rp=require('request-promise');var moment=require(_0x2caf('0x3'));var BPromise=require(_0x2caf('0x4'));var Mustache=require('mustache');var util=require(_0x2caf('0x5'));var path=require('path');var sox=require(_0x2caf('0x6'));var csv=require(_0x2caf('0x7'));var ejs=require(_0x2caf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x7'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var as=require(_0x2caf('0x12'));var hardwareService=require(_0x2caf('0x13'));var logger=require(_0x2caf('0x14'))('api');var utils=require(_0x2caf('0x15'));var config=require(_0x2caf('0x16'));var licenseUtil=require(_0x2caf('0x17'));var db=require(_0x2caf('0x18'))['db'];function respondWithStatusCode(_0x1dda08,_0x31c0e7){_0x31c0e7=_0x31c0e7||0xcc;return function(_0x252147){if(_0x252147){return _0x1dda08[_0x2caf('0x19')](_0x31c0e7);}return _0x1dda08['status'](_0x31c0e7)[_0x2caf('0x1a')]();};}function respondWithResult(_0xec8192,_0x502033){_0x502033=_0x502033||0xc8;return function(_0x4c47b8){if(_0x4c47b8){return _0xec8192['status'](_0x502033)[_0x2caf('0x1b')](_0x4c47b8);}};}function respondWithFilteredResult(_0x4da5ba,_0x388e05){return function(_0xa75896){if(_0xa75896){var _0x3b8b67=typeof _0x388e05[_0x2caf('0x1c')]==='undefined'&&typeof _0x388e05[_0x2caf('0x1d')]==='undefined';var _0x2d5b64=_0xa75896['count'];var _0x4a33fc=_0x3b8b67?0x0:_0x388e05[_0x2caf('0x1c')];var _0x58047b=_0x3b8b67?_0xa75896[_0x2caf('0x1e')]:_0x388e05[_0x2caf('0x1c')]+_0x388e05['limit'];var _0x12624b;if(_0x58047b>=_0x2d5b64){_0x58047b=_0x2d5b64;_0x12624b=0xc8;}else{_0x12624b=0xce;}_0x4da5ba[_0x2caf('0x1f')](_0x12624b);return _0x4da5ba[_0x2caf('0x20')](_0x2caf('0x21'),_0x4a33fc+'-'+_0x58047b+'/'+_0x2d5b64)[_0x2caf('0x1b')](_0xa75896);}return null;};}function patchUpdates(_0x595f2f){return function(_0xfa426f){try{jsonpatch[_0x2caf('0x22')](_0xfa426f,_0x595f2f,!![]);}catch(_0x2b4d16){return BPromise[_0x2caf('0x23')](_0x2b4d16);}return _0xfa426f[_0x2caf('0x24')]();};}function saveUpdates(_0x9d6bae,_0x4092ba){return function(_0x256cc4){if(_0x256cc4){return _0x256cc4[_0x2caf('0x25')](_0x9d6bae)[_0x2caf('0x26')](function(_0x6814bc){return _0x6814bc;});}return null;};}function removeEntity(_0x5231fc,_0x296305){return function(_0x14bfd2){if(_0x14bfd2){return _0x14bfd2[_0x2caf('0x27')]()[_0x2caf('0x26')](function(){_0x5231fc[_0x2caf('0x1f')](0xcc)[_0x2caf('0x1a')]();});}};}function handleEntityNotFound(_0x392196,_0x164da){return function(_0x2e0a75){if(!_0x2e0a75){_0x392196[_0x2caf('0x19')](0x194);}return _0x2e0a75;};}function handleError(_0x5ad211,_0x6a32ac){_0x6a32ac=_0x6a32ac||0x1f4;return function(_0x325eda){logger[_0x2caf('0x28')](_0x325eda[_0x2caf('0x29')]);if(_0x325eda[_0x2caf('0x2a')]){delete _0x325eda[_0x2caf('0x2a')];}_0x5ad211[_0x2caf('0x1f')](_0x6a32ac)[_0x2caf('0x2b')](_0x325eda);};}exports[_0x2caf('0x2c')]=function(_0x2304f1,_0x30da75){var _0x1f477={},_0x158d60={},_0x48b5f7={'count':0x0,'rows':[]};var _0xb944cc=_[_0x2caf('0x2d')](db[_0x2caf('0x2e')][_0x2caf('0x2f')],function(_0xa8523b){return{'name':_0xa8523b[_0x2caf('0x30')],'type':_0xa8523b[_0x2caf('0x31')]['key']};});_0x158d60[_0x2caf('0x32')]=_[_0x2caf('0x2d')](_0xb944cc,'name');_0x158d60[_0x2caf('0x33')]=_[_0x2caf('0x34')](_0x2304f1[_0x2caf('0x33')]);_0x158d60['filters']=_[_0x2caf('0x35')](_0x158d60['model'],_0x158d60['query']);_0x1f477[_0x2caf('0x36')]=_[_0x2caf('0x35')](_0x158d60[_0x2caf('0x32')],qs[_0x2caf('0x37')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x37')]));_0x1f477[_0x2caf('0x36')]=_0x1f477[_0x2caf('0x36')][_0x2caf('0x38')]?_0x1f477['attributes']:_0x158d60[_0x2caf('0x32')];if(!_0x2304f1[_0x2caf('0x33')][_0x2caf('0x39')](_0x2caf('0x3a'))){_0x1f477[_0x2caf('0x1d')]=qs[_0x2caf('0x1d')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x1d')]);_0x1f477[_0x2caf('0x1c')]=qs[_0x2caf('0x1c')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x1c')]);}_0x1f477['order']=qs['sort'](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3b')]);_0x1f477[_0x2caf('0x3c')]=qs[_0x2caf('0x3d')](_['pick'](_0x2304f1[_0x2caf('0x33')],_0x158d60[_0x2caf('0x3d')]),_0xb944cc);if(_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3e')]){_0x1f477[_0x2caf('0x3c')]=_[_0x2caf('0x3f')](_0x1f477[_0x2caf('0x3c')],{'$or':_[_0x2caf('0x2d')](_0xb944cc,function(_0x5c133c){if(_0x5c133c['type']!==_0x2caf('0x40')){var _0x863fca={};_0x863fca[_0x5c133c[_0x2caf('0x2a')]]={'$like':'%'+_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3e')]+'%'};return _0x863fca;}})});}_0x1f477=_[_0x2caf('0x3f')]({},_0x1f477,_0x2304f1[_0x2caf('0x41')]);var _0xf93228={'where':_0x1f477[_0x2caf('0x3c')]};return db[_0x2caf('0x2e')][_0x2caf('0x1e')](_0xf93228)['then'](function(_0x35ad7f){_0x48b5f7[_0x2caf('0x1e')]=_0x35ad7f;if(_0x2304f1[_0x2caf('0x33')]['includeAll']){_0x1f477[_0x2caf('0x42')]=[{'all':!![]}];}return db[_0x2caf('0x2e')][_0x2caf('0x43')](_0x1f477);})['then'](function(_0x40cb18){_0x48b5f7[_0x2caf('0x44')]=_0x40cb18;return _0x48b5f7;})['then'](respondWithFilteredResult(_0x30da75,_0x1f477))[_0x2caf('0x45')](handleError(_0x30da75,null));};exports[_0x2caf('0x46')]=function(_0x4e57b0,_0xe5fcbf){var _0x1348d8={'raw':!![],'where':{'id':_0x4e57b0[_0x2caf('0x47')]['id']}},_0x2e4126={};_0x2e4126[_0x2caf('0x32')]=_[_0x2caf('0x34')](db[_0x2caf('0x2e')][_0x2caf('0x2f')]);_0x2e4126['query']=_[_0x2caf('0x34')](_0x4e57b0['query']);_0x2e4126[_0x2caf('0x3d')]=_[_0x2caf('0x35')](_0x2e4126[_0x2caf('0x32')],_0x2e4126['query']);_0x1348d8['attributes']=_[_0x2caf('0x35')](_0x2e4126['model'],qs[_0x2caf('0x37')](_0x4e57b0[_0x2caf('0x33')][_0x2caf('0x37')]));_0x1348d8[_0x2caf('0x36')]=_0x1348d8[_0x2caf('0x36')][_0x2caf('0x38')]?_0x1348d8[_0x2caf('0x36')]:_0x2e4126[_0x2caf('0x32')];if(_0x4e57b0[_0x2caf('0x33')][_0x2caf('0x48')]){_0x1348d8[_0x2caf('0x42')]=[{'all':!![]}];}_0x1348d8=_[_0x2caf('0x3f')]({},_0x1348d8,_0x4e57b0[_0x2caf('0x41')]);return db[_0x2caf('0x2e')][_0x2caf('0x49')](_0x1348d8)[_0x2caf('0x26')](handleEntityNotFound(_0xe5fcbf,null))[_0x2caf('0x26')](respondWithResult(_0xe5fcbf,null))[_0x2caf('0x45')](handleError(_0xe5fcbf,null));};exports[_0x2caf('0x4a')]=function(_0x3a598b,_0x136dc9){return db['WhatsappApplication'][_0x2caf('0x4a')](_0x3a598b[_0x2caf('0x4b')],{})['then'](respondWithResult(_0x136dc9,0xc9))['catch'](handleError(_0x136dc9,null));};exports[_0x2caf('0x25')]=function(_0x6f0a2a,_0x5a822d){if(_0x6f0a2a[_0x2caf('0x4b')]['id']){delete _0x6f0a2a[_0x2caf('0x4b')]['id'];}return db[_0x2caf('0x2e')][_0x2caf('0x49')]({'where':{'id':_0x6f0a2a[_0x2caf('0x47')]['id']}})[_0x2caf('0x26')](handleEntityNotFound(_0x5a822d,null))[_0x2caf('0x26')](saveUpdates(_0x6f0a2a[_0x2caf('0x4b')],null))[_0x2caf('0x26')](respondWithResult(_0x5a822d,null))[_0x2caf('0x45')](handleError(_0x5a822d,null));};exports[_0x2caf('0x27')]=function(_0x2b318a,_0x41b7b2){return db['WhatsappApplication'][_0x2caf('0x49')]({'where':{'id':_0x2b318a[_0x2caf('0x47')]['id']}})[_0x2caf('0x26')](handleEntityNotFound(_0x41b7b2,null))['then'](removeEntity(_0x41b7b2,null))[_0x2caf('0x45')](handleError(_0x41b7b2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 38d812c..d477c4b 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac95=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./whatsappApplication.attributes'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xac95,0xa8));var _0x5ac9=function(_0x1833de,_0x4a41b1){_0x1833de=_0x1833de-0x0;var _0xc71410=_0xac95[_0x1833de];return _0xc71410;};'use strict';var _=require(_0x5ac9('0x0'));var util=require(_0x5ac9('0x1'));var logger=require(_0x5ac9('0x2'))(_0x5ac9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ac9('0x4'));var fs=require('fs');var path=require(_0x5ac9('0x5'));var rimraf=require('rimraf');var config=require(_0x5ac9('0x6'));var attributes=require(_0x5ac9('0x7'));module['exports']=function(_0x1dc09a,_0x2bb4da){return _0x1dc09a[_0x5ac9('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ac9('0x9'),'collate':_0x5ac9('0xa')});}; \ No newline at end of file +var _0xdd0c=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x317b90,_0x23dc6e){var _0x3cfb09=function(_0x36c1d){while(--_0x36c1d){_0x317b90['push'](_0x317b90['shift']());}};_0x3cfb09(++_0x23dc6e);}(_0xdd0c,0x165));var _0xcdd0=function(_0x461039,_0x297ff7){_0x461039=_0x461039-0x0;var _0x5c37de=_0xdd0c[_0x461039];return _0x5c37de;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var logger=require(_0xcdd0('0x1'))(_0xcdd0('0x2'));var moment=require('moment');var BPromise=require(_0xcdd0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd0('0x4'));var rimraf=require(_0xcdd0('0x5'));var config=require(_0xcdd0('0x6'));var attributes=require(_0xcdd0('0x7'));module[_0xcdd0('0x8')]=function(_0x5ae472,_0x2b33fc){return _0x5ae472[_0xcdd0('0x9')](_0xcdd0('0xa'),attributes,{'tableName':_0xcdd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcdd0('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 7f72a5c..a9b4d0a 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x4d98b9,_0x48bb1f){var _0x542ac9=function(_0x18bba0){while(--_0x18bba0){_0x4d98b9['push'](_0x4d98b9['shift']());}};_0x542ac9(++_0x48bb1f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x24ca[_0x58c851];return _0x534d8a;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x27e84d,_0x5f10c5){var _0x180cc0=function(_0x3d163f){while(--_0x3d163f){_0x27e84d['push'](_0x27e84d['shift']());}};_0x180cc0(++_0x5f10c5);}(_0x6aa7,0x178));var _0x76aa=function(_0xbe4d0b,_0xd5c6c0){_0xbe4d0b=_0xbe4d0b-0x0;var _0x557824=_0x6aa7[_0xbe4d0b];return _0x557824;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index dd89dac..5341a8d 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1751=['getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x452da9,_0x5b16f3){var _0x12116d=function(_0x2cdb45){while(--_0x2cdb45){_0x452da9['push'](_0x452da9['shift']());}};_0x12116d(++_0x5b16f3);}(_0x1751,0x76));var _0x1175=function(_0x97d64b,_0x307c29){_0x97d64b=_0x97d64b-0x0;var _0x272077=_0x1751[_0x97d64b];return _0x272077;};'use strict';var multer=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var path=require(_0x1175('0x2'));var timeout=require(_0x1175('0x3'));var express=require('express');var router=express[_0x1175('0x4')]();var fs_extra=require(_0x1175('0x5'));var auth=require(_0x1175('0x6'));var interaction=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var controller=require(_0x1175('0x9'));router[_0x1175('0xa')]('/',auth[_0x1175('0xb')](),controller[_0x1175('0xc')]);router[_0x1175('0xa')](_0x1175('0xd'),auth[_0x1175('0xb')](),controller[_0x1175('0xe')]);router[_0x1175('0xa')](_0x1175('0xf'),auth[_0x1175('0xb')](),controller[_0x1175('0x10')]);router[_0x1175('0xa')](_0x1175('0x11'),auth[_0x1175('0xb')](),controller[_0x1175('0x12')]);router[_0x1175('0xa')](_0x1175('0x13'),auth[_0x1175('0xb')](),controller[_0x1175('0x14')]);router[_0x1175('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1175('0x15')](_0x1175('0x11'),auth['isAuthenticated'](),controller[_0x1175('0x16')]);router[_0x1175('0x15')](_0x1175('0x17'),auth['isAuthenticated'](),interaction[_0x1175('0x18')](_0x1175('0x19'),_0x1175('0x1a')),controller['addTags']);router[_0x1175('0x1b')]('/:id',auth[_0x1175('0xb')](),interaction[_0x1175('0x18')](_0x1175('0x19'),_0x1175('0x1c')),controller['update']);router[_0x1175('0x1d')](_0x1175('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x1175('0x19'),_0x1175('0x1e')),controller[_0x1175('0x1f')]);router[_0x1175('0x1d')](_0x1175('0x17'),auth['isAuthenticated'](),controller[_0x1175('0x20')]);module[_0x1175('0x21')]=router; \ No newline at end of file +var _0x1c9a=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x22a732,_0x1999b5){_0x22a732=_0x22a732-0x0;var _0x441119=_0x1c9a[_0x22a732];return _0x441119;};'use strict';var multer=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var path=require('path');var timeout=require(_0xa1c9('0x2'));var express=require(_0xa1c9('0x3'));var router=express[_0xa1c9('0x4')]();var fs_extra=require(_0xa1c9('0x5'));var auth=require(_0xa1c9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa1c9('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa1c9('0x8')]('/',auth[_0xa1c9('0x9')](),controller[_0xa1c9('0xa')]);router[_0xa1c9('0x8')](_0xa1c9('0xb'),auth[_0xa1c9('0x9')](),controller[_0xa1c9('0xc')]);router[_0xa1c9('0x8')](_0xa1c9('0xd'),auth[_0xa1c9('0x9')](),controller[_0xa1c9('0xe')]);router[_0xa1c9('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa1c9('0xf')]);router['get'](_0xa1c9('0x10'),auth[_0xa1c9('0x9')](),controller[_0xa1c9('0x11')]);router[_0xa1c9('0x12')]('/',auth[_0xa1c9('0x9')](),controller[_0xa1c9('0x13')]);router[_0xa1c9('0x12')](_0xa1c9('0x14'),auth[_0xa1c9('0x9')](),controller[_0xa1c9('0x15')]);router[_0xa1c9('0x12')](_0xa1c9('0x16'),auth[_0xa1c9('0x9')](),interaction[_0xa1c9('0x17')](_0xa1c9('0x18'),_0xa1c9('0x19')),controller[_0xa1c9('0x1a')]);router[_0xa1c9('0x1b')](_0xa1c9('0xd'),auth[_0xa1c9('0x9')](),interaction['tracked'](_0xa1c9('0x18'),'whatsappinteraction:update'),controller[_0xa1c9('0x1c')]);router[_0xa1c9('0x1d')](_0xa1c9('0xd'),auth[_0xa1c9('0x9')](),interaction[_0xa1c9('0x17')](_0xa1c9('0x18'),_0xa1c9('0x1e')),controller[_0xa1c9('0x1f')]);router[_0xa1c9('0x1d')](_0xa1c9('0x16'),auth[_0xa1c9('0x9')](),controller[_0xa1c9('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index b5b6a5b..0754139 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff16=['ENUM','sequelize','moment','BOOLEAN','DATE','STRING','out'];(function(_0x4ff252,_0x5e084b){var _0x67c9e4=function(_0x1b82a9){while(--_0x1b82a9){_0x4ff252['push'](_0x4ff252['shift']());}};_0x67c9e4(++_0x5e084b);}(_0xff16,0x7f));var _0x6ff1=function(_0x1136cb,_0x3111c8){_0x1136cb=_0x1136cb-0x0;var _0x33c8a2=_0xff16[_0x1136cb];return _0x33c8a2;};'use strict';var Sequelize=require(_0x6ff1('0x0'));var moment=require(_0x6ff1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x6ff1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6ff1('0x3')]},'disposition':{'type':Sequelize[_0x6ff1('0x4')]},'secondDisposition':{'type':Sequelize[_0x6ff1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6ff1('0x4')]},'note':{'type':Sequelize[_0x6ff1('0x4')]},'phone':{'type':Sequelize[_0x6ff1('0x4')]},'read1stAt':{'type':Sequelize[_0x6ff1('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6ff1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6ff1('0x6')]('in',_0x6ff1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6ff1('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfc65=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x37b546,_0x8c85de){var _0x24a3b5=function(_0x337bc5){while(--_0x337bc5){_0x37b546['push'](_0x37b546['shift']());}};_0x24a3b5(++_0x8c85de);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x245832,_0x10b37b){_0x245832=_0x245832-0x0;var _0x2bde03=_0xfc65[_0x245832];return _0x2bde03;};'use strict';var Sequelize=require(_0x5fc6('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x5fc6('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5fc6('0x2')]},'disposition':{'type':Sequelize[_0x5fc6('0x3')]},'secondDisposition':{'type':Sequelize[_0x5fc6('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5fc6('0x3')]},'note':{'type':Sequelize[_0x5fc6('0x3')]},'phone':{'type':Sequelize[_0x5fc6('0x3')]},'read1stAt':{'type':Sequelize[_0x5fc6('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x5fc6('0x4')]('in',_0x5fc6('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5fc6('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5fc6('0x4')]('in',_0x5fc6('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index c666206..b3b6946 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xafa5=['then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','push','catch','WhatsappInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','end','Tag','split','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','text','start','body','some','compact','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','options','create','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','hasOwnProperty','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','color','emit','unix','join','root','files','transcript-%d-%s.zip','CmContact','lastName','attachments','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','System','renderFile','server','.pdf','download','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update'];(function(_0x444e68,_0x3bdb39){var _0x34d233=function(_0xd56b88){while(--_0xd56b88){_0x444e68['push'](_0x444e68['shift']());}};_0x34d233(++_0x3bdb39);}(_0xafa5,0x1af));var _0x5afa=function(_0x4dc96f,_0x16c7bc){_0x4dc96f=_0x4dc96f-0x0;var _0x2fb894=_0xafa5[_0x4dc96f];return _0x2fb894;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5afa('0x0'));var zipdir=require(_0x5afa('0x1'));var jsonpatch=require(_0x5afa('0x2'));var rp=require(_0x5afa('0x3'));var moment=require(_0x5afa('0x4'));var BPromise=require(_0x5afa('0x5'));var Mustache=require(_0x5afa('0x6'));var util=require(_0x5afa('0x7'));var path=require(_0x5afa('0x8'));var sox=require(_0x5afa('0x9'));var csv=require(_0x5afa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5afa('0xb'));var _=require(_0x5afa('0xc'));var squel=require(_0x5afa('0xd'));var crypto=require(_0x5afa('0xe'));var jsforce=require(_0x5afa('0xf'));var deskjs=require(_0x5afa('0x10'));var toCsv=require(_0x5afa('0xa'));var querystring=require(_0x5afa('0x11'));var Papa=require(_0x5afa('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5afa('0x13'));var as=require(_0x5afa('0x14'));var pdf=require(_0x5afa('0x15'));var hardwareService=require(_0x5afa('0x16'));var logger=require(_0x5afa('0x17'))(_0x5afa('0x18'));var utils=require(_0x5afa('0x19'));var config=require(_0x5afa('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x5afa('0x1b'))['db'];config[_0x5afa('0x1c')]=_[_0x5afa('0x1d')](config[_0x5afa('0x1c')],{'host':_0x5afa('0x1e'),'port':0x18eb});var socket=require(_0x5afa('0x1f'))(new Redis(config['redis']));require(_0x5afa('0x20'))[_0x5afa('0x21')](socket);function respondWithStatusCode(_0x277ca0,_0x39bc19){_0x39bc19=_0x39bc19||0xcc;return function(_0xfcb0a2){if(_0xfcb0a2){return _0x277ca0[_0x5afa('0x22')](_0x39bc19);}return _0x277ca0[_0x5afa('0x23')](_0x39bc19)['end']();};}function respondWithResult(_0x31aa81,_0x105c16){_0x105c16=_0x105c16||0xc8;return function(_0x5d57e6){if(_0x5d57e6){return _0x31aa81[_0x5afa('0x23')](_0x105c16)[_0x5afa('0x24')](_0x5d57e6);}};}function respondWithFilteredResult(_0x292b57,_0x2cc3a5){return function(_0xe51af9){if(_0xe51af9){var _0xaef03b=typeof _0x2cc3a5[_0x5afa('0x25')]==='undefined'&&typeof _0x2cc3a5[_0x5afa('0x26')]===_0x5afa('0x27');var _0x3b34da=_0xe51af9[_0x5afa('0x28')];var _0x24302a=_0xaef03b?0x0:_0x2cc3a5[_0x5afa('0x25')];var _0x2ac81b=_0xaef03b?_0xe51af9[_0x5afa('0x28')]:_0x2cc3a5[_0x5afa('0x25')]+_0x2cc3a5[_0x5afa('0x26')];var _0x4e4470;if(_0x2ac81b>=_0x3b34da){_0x2ac81b=_0x3b34da;_0x4e4470=0xc8;}else{_0x4e4470=0xce;}_0x292b57[_0x5afa('0x23')](_0x4e4470);return _0x292b57[_0x5afa('0x29')](_0x5afa('0x2a'),_0x24302a+'-'+_0x2ac81b+'/'+_0x3b34da)['json'](_0xe51af9);}return null;};}function patchUpdates(_0x182fd2){return function(_0x1aeb29){try{jsonpatch[_0x5afa('0x2b')](_0x1aeb29,_0x182fd2,!![]);}catch(_0x490b54){return BPromise['reject'](_0x490b54);}return _0x1aeb29['save']();};}function saveUpdates(_0x5186e3,_0x5aa6e5){return function(_0x27c85e){if(_0x27c85e){return _0x27c85e[_0x5afa('0x2c')](_0x5186e3)[_0x5afa('0x2d')](function(_0x2cdf81){return _0x2cdf81;});}return null;};}function removeEntity(_0x4f530c,_0x444909){return function(_0x37d118){if(_0x37d118){return _0x37d118[_0x5afa('0x2e')]()[_0x5afa('0x2d')](function(){_0x4f530c[_0x5afa('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27f88f,_0x18147d){return function(_0x5991cd){if(!_0x5991cd){_0x27f88f[_0x5afa('0x22')](0x194);}return _0x5991cd;};}function handleError(_0x31d236,_0x2c175a){_0x2c175a=_0x2c175a||0x1f4;return function(_0x9a6b5a){logger[_0x5afa('0x2f')](_0x9a6b5a[_0x5afa('0x30')]);if(_0x9a6b5a[_0x5afa('0x31')]){delete _0x9a6b5a[_0x5afa('0x31')];}_0x31d236[_0x5afa('0x23')](_0x2c175a)[_0x5afa('0x32')](_0x9a6b5a);};}function getInteractionUsers(_0x51cc27,_0x14565f){return new BPromise(function(_0x55dc71,_0xcecfb0){try{if(_0x14565f[_0x51cc27['id']]){_0x51cc27['Users']=_[_0x5afa('0x33')](_0x14565f[_0x51cc27['id']],function(_0x4f4778){return{'id':_0x4f4778['id'],'fullname':_0x4f4778[_0x5afa('0x34')]};});}}catch(_0x5a7e18){_0xcecfb0(_0x5a7e18);}_0x55dc71(_0x51cc27);});}function getInteractionTags(_0x57a561,_0x1271b7){return new BPromise(function(_0x1ee9d7,_0xabd1cb){try{if(_0x57a561[_0x5afa('0x35')]){_0x57a561[_0x5afa('0x36')]=[];_0x57a561[_0x5afa('0x35')]['split'](',')['forEach'](function(_0x4aed93){_0x57a561['Tags'][_0x5afa('0x37')](_0x1271b7[_0x4aed93]);});}delete _0x57a561[_0x5afa('0x35')];}catch(_0x167d75){_0xabd1cb(_0x167d75);}_0x1ee9d7(_0x57a561);});}function updateWhatsappInteraction(_0x1cf103,_0x4124f0,_0x454023){return new BPromise(function(_0x1db58f,_0x7db411){return getInteractionUsers(_0x1cf103,_0x454023)['then'](function(_0x4458bf){return getInteractionTags(_0x4458bf,_0x4124f0);})[_0x5afa('0x2d')](function(_0x7c9dbc){_0x1db58f(_0x7c9dbc);})[_0x5afa('0x38')](function(_0xc172ce){_0x7db411(_0xc172ce);});});}exports['index']=function(_0x33d816,_0x41877f){var _0x4e21cd={},_0x238ef2={},_0x1c9bf7={'count':0x0,'rows':[]};var _0x106a35=_[_0x5afa('0x33')](db[_0x5afa('0x39')][_0x5afa('0x3a')],function(_0x2a6319){return{'name':_0x2a6319[_0x5afa('0x3b')],'type':_0x2a6319[_0x5afa('0x3c')]['key']};});_0x238ef2[_0x5afa('0x3d')]=_[_0x5afa('0x33')](_0x106a35,_0x5afa('0x31'));_0x238ef2[_0x5afa('0x3e')]=_[_0x5afa('0x3f')](_0x33d816[_0x5afa('0x3e')]);_0x238ef2[_0x5afa('0x40')]=_[_0x5afa('0x41')](_0x238ef2[_0x5afa('0x3d')],_0x238ef2[_0x5afa('0x3e')]);_0x4e21cd[_0x5afa('0x42')]=_[_0x5afa('0x41')](_0x238ef2[_0x5afa('0x3d')],qs[_0x5afa('0x43')](_0x33d816[_0x5afa('0x3e')][_0x5afa('0x43')]));_0x4e21cd[_0x5afa('0x42')]=_0x4e21cd[_0x5afa('0x42')][_0x5afa('0x44')]?_0x4e21cd['attributes']:_0x238ef2['model'];if(!_0x33d816[_0x5afa('0x3e')]['hasOwnProperty'](_0x5afa('0x45'))){_0x4e21cd[_0x5afa('0x26')]=qs[_0x5afa('0x26')](_0x33d816[_0x5afa('0x3e')]['limit']);_0x4e21cd['offset']=qs[_0x5afa('0x25')](_0x33d816[_0x5afa('0x3e')][_0x5afa('0x25')]);}_0x4e21cd[_0x5afa('0x46')]=qs[_0x5afa('0x47')](_0x33d816['query'][_0x5afa('0x47')]);_0x4e21cd[_0x5afa('0x48')]=qs['filters'](_[_0x5afa('0x49')](_0x33d816[_0x5afa('0x3e')],_0x238ef2['filters']),_0x106a35);var _0x265ad1=[];var _0x3dc68d=squel[_0x5afa('0x4a')]()['field']('id')[_0x5afa('0x4b')](_0x5afa('0x31'))[_0x5afa('0x4b')]('color')[_0x5afa('0x4c')](_0x5afa('0x4d'));var _0x5d74c1=squel['select']()[_0x5afa('0x4b')](_0x5afa('0x4e'))[_0x5afa('0x4b')](_0x5afa('0x4f'))[_0x5afa('0x4b')](_0x5afa('0x50'))[_0x5afa('0x4c')](_0x5afa('0x51'),'ui')[_0x5afa('0x52')](_0x5afa('0x53'),'u',_0x5afa('0x54'));var _0x240066=squel['select']()[_0x5afa('0x4c')](_0x5afa('0x55'),'i')['left_join']('cm_contacts','c',_0x5afa('0x56'))[_0x5afa('0x52')](_0x5afa('0x53'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x5afa('0x57'),'a',_0x5afa('0x58'))[_0x5afa('0x52')]('whatsapp_messages','me',_0x5afa('0x59'))[_0x5afa('0x52')](_0x5afa('0x5a'),'it',_0x5afa('0x5b'))[_0x5afa('0x52')](_0x5afa('0x4d'),'t',_0x5afa('0x5c'));var _0x2183fd=squel[_0x5afa('0x5d')]();var _0xf0c6ac=[];var _0x374bb8=squel[_0x5afa('0x5d')]();var _0x80e662;if(_0x33d816[_0x5afa('0x3e')][_0x5afa('0x5e')]){_0x80e662=as[_0x5afa('0x5f')](_0x33d816['query'][_0x5afa('0x5e')]);var _0x35027c=_0x80e662[_0x5afa('0x60')];for(var _0x56d5b1=0x0;_0x56d5b1<_0x80e662['conditions'][_0x5afa('0x44')];_0x56d5b1++){var _0x33018a=_0x80e662[_0x5afa('0x61')][_0x56d5b1];var _0x5acbbb='i';var _0x5e103a=_[_0x5afa('0x62')](_0x106a35,[_0x5afa('0x31'),_0x33018a[_0x5afa('0x4b')]]);if(!_0x5e103a){switch(_0x33018a[_0x5afa('0x4b')]){case _0x5afa('0x63'):if(_0x33018a[_0x5afa('0x64')]==0x1){_0x240066[_0x5afa('0x65')]('`'+_0x33018a[_0x5afa('0x4b')]+_0x5afa('0x66'));}else{_0x240066['having']('`'+_0x33018a['field']+_0x5afa('0x67'));}break;case _0x5afa('0x68'):if(_0x33018a[_0x5afa('0x69')]==='$substring'){if(_0x33018a[_0x5afa('0x64')]['split']('\x20')[_0x5afa('0x44')]>0x1){_0x2183fd[_0x35027c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x33018a['value']),null);}else{var _0x46c133='%'+_0x33018a['value']+'%';_0x2183fd[_0x35027c](_0x5afa('0x6a'),_0x46c133,_0x46c133,_0x46c133);}}else{_0x5e103a=_['find'](_0x106a35,['name',_0x5afa('0x6b')]);_0x33018a[_0x5afa('0x4b')]=_0x5afa('0x6b');_0x185876=as[_0x5afa('0x6c')](_0x5acbbb,_0x5e103a[_0x5afa('0x3c')],_0x33018a);_0x2183fd[_0x35027c](_0x185876['text'],_0x185876[_0x5afa('0x64')]['start'],_0x185876[_0x5afa('0x64')][_0x5afa('0x6d')]);}break;case _0x5afa('0x6e'):var _0x2b14f9=_0x33018a[_0x5afa('0x64')][_0x5afa('0x6f')](',')['map'](function(_0x13de23){return Number(_0x13de23);});_0x2b14f9['forEach'](function(_0x419224){_0x374bb8['or'](_0x5afa('0x70'),'%,'+_0x419224+',%');});_0xf0c6ac=_[_0x5afa('0x71')](_0xf0c6ac,_0x2b14f9);break;case _0x5afa('0x72'):if(_0x33018a[_0x5afa('0x69')]===_0x5afa('0x73')){_0x2183fd[_0x35027c](_0x5afa('0x74'),'%'+_0x33018a[_0x5afa('0x64')]+'%',null);}else{_0x5e103a=_[_0x5afa('0x62')](_0x106a35,['name',_0x5afa('0x75')]);_0x33018a['field']=_0x5afa('0x75');_0x185876=as[_0x5afa('0x6c')](_0x5acbbb,_0x5e103a[_0x5afa('0x3c')],_0x33018a);_0x2183fd[_0x35027c](_0x185876[_0x5afa('0x76')],_0x185876[_0x5afa('0x64')][_0x5afa('0x77')],_0x185876['value'][_0x5afa('0x6d')]);}break;case _0x5afa('0x78'):_0x185876=as[_0x5afa('0x6c')]('me',null,_0x33018a);_0x2183fd[_0x35027c](_0x185876[_0x5afa('0x76')],_0x185876['value'][_0x5afa('0x77')],_0x185876['value'][_0x5afa('0x6d')]);break;}}else{var _0x185876=as[_0x5afa('0x6c')](_0x5acbbb,_0x5e103a[_0x5afa('0x3c')],_0x33018a);_0x2183fd[_0x35027c](_0x185876[_0x5afa('0x76')],_0x185876[_0x5afa('0x64')][_0x5afa('0x77')],_0x185876[_0x5afa('0x64')][_0x5afa('0x6d')]);}}}else{var _0x284630=_(_0x33d816[_0x5afa('0x3e')])['keys']()['map'](function(_0x51d4e3){return _[_0x5afa('0x79')](_0x106a35,[_0x5afa('0x31'),_0x51d4e3])?_0x51d4e3:undefined;})[_0x5afa('0x7a')]()['value']();if(!_[_0x5afa('0x7b')](_0x284630)){_0x284630[_0x5afa('0x7c')](function(_0x5aca67){if(_0x5aca67===_0x5afa('0x7d')){_0x240066['where'](_0x5afa('0x7e'),[]['concat'](_0x33d816[_0x5afa('0x3e')][_0x5aca67]));}else if(_0x5aca67===_0x5afa('0x7f')){var _0x4fc747=JSON['parse'](_0x33d816[_0x5afa('0x3e')][_0x5aca67])[_0x5afa('0x80')];var _0x2d3f33=JSON[_0x5afa('0x81')](_0x33d816['query'][_0x5aca67])[_0x5afa('0x82')];_0x240066[_0x5afa('0x48')](_0x5afa('0x83'),_0x4fc747,_0x2d3f33);}else{if(_0x33d816[_0x5afa('0x3e')][_0x5aca67]===_0x5afa('0x84')){_0x240066[_0x5afa('0x48')]('i.'+_0x5aca67+'\x20IS\x20NULL');}else{_0x240066[_0x5afa('0x48')]('i.'+_0x5aca67+_0x5afa('0x85'),_0x33d816[_0x5afa('0x3e')][_0x5aca67]);}}});}if(_0x33d816['query'][_0x5afa('0x86')]){if(_0x33d816[_0x5afa('0x3e')]['read']==0x1){_0x240066['having'](_0x5afa('0x87'));}else{_0x240066[_0x5afa('0x65')](_0x5afa('0x88'));}}if(_0x33d816[_0x5afa('0x3e')]['tag']){_0xf0c6ac=_[_0x5afa('0x89')](_0x33d816[_0x5afa('0x3e')][_0x5afa('0x8a')])?_0x33d816['query'][_0x5afa('0x8a')]:new Array(_0x33d816[_0x5afa('0x3e')][_0x5afa('0x8a')]);_0xf0c6ac[_0x5afa('0x7c')](function(_0x32bb9f){_0x374bb8['or'](_0x5afa('0x70'),'%,'+_0x32bb9f+',%');});}if(_0x33d816[_0x5afa('0x3e')][_0x5afa('0x8b')]){var _0x668a7a=_0x33d816['query']['filter'][_0x5afa('0x8c')]('\x5c','\x5c\x5c')[_0x5afa('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x668a7a)){_0x2183fd['or'](_0x5afa('0x8d'),_0x668a7a+'%')['or'](_0x5afa('0x8e'),_0x668a7a+'%');}else{_0x2183fd['or'](_0x5afa('0x8f'),qs[_0x5afa('0x90')](_0x668a7a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x668a7a+'%');}}}_0x240066[_0x5afa('0x48')](_0x2183fd);_0x240066[_0x5afa('0x91')](_0x5afa('0x92'));var _0x1c42cf={'type':db['Sequelize'][_0x5afa('0x93')]['SELECT'],'raw':!![]};var _0x4f492f=_0x240066[_0x5afa('0x94')]();_0x4f492f[_0x5afa('0x4b')](_0x5afa('0x92'));_0x4f492f[_0x5afa('0x4b')](_0x5afa('0x95'),_0x5afa('0x63'));if(_0x4e21cd[_0x5afa('0x46')]){_0x4e21cd['order']['forEach'](function(_0x4eaf44){var _0x2ba708=_0x4eaf44[0x0]===_0x5afa('0x96')?_0x4eaf44[0x0]:'i.'+_0x4eaf44[0x0];_0x240066['order'](_0x2ba708,_0x4eaf44[0x1]===_0x5afa('0x97')?![]:!![]);});}if(!_[_0x5afa('0x7b')](_0xf0c6ac)){_0x240066[_0x5afa('0x65')](_0x374bb8);_0x4f492f[_0x5afa('0x48')](_0x5afa('0x98'),_0xf0c6ac);}BPromise['resolve']()[_0x5afa('0x2d')](function(){if(!_0x80e662){if(_0x33d816['query'][_0x5afa('0x7d')])return;_0x4f492f[_0x5afa('0x48')](_0x5afa('0x99'));_0x240066[_0x5afa('0x48')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x33d816[_0x5afa('0x9a')]['role']!==_0x5afa('0x9b'))return;return _0x33d816[_0x5afa('0x9a')][_0x5afa('0x9c')]({'attributes':['id'],'raw':!![]})[_0x5afa('0x2d')](function(_0x492474){if(_[_0x5afa('0x7b')](_0x492474)){_0x4f492f['where'](_0x5afa('0x9d'));_0x240066['where'](_0x5afa('0x9d'));}else{_0x4f492f['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x5afa('0x33')](_0x492474,'id'));_0x240066[_0x5afa('0x48')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x492474,'id'));}});})[_0x5afa('0x2d')](function(){if(_0x33d816[_0x5afa('0x9a')]['role']===_0x5afa('0x9b')&&!_0x80e662&&!_0x33d816[_0x5afa('0x3e')]['WhatsappAccountId'])return[];return db[_0x5afa('0x9e')][_0x5afa('0x3e')](_0x4f492f[_0x5afa('0x9f')](),_0x1c42cf);})[_0x5afa('0x2d')](function(_0x165bfb){_0x1c9bf7[_0x5afa('0x28')]=_0x165bfb[_0x5afa('0x44')];if(_0x1c9bf7[_0x5afa('0x28')]===0x0)return[];return db[_0x5afa('0x9e')][_0x5afa('0x3e')](_0x3dc68d[_0x5afa('0x9f')](),_0x1c42cf)[_0x5afa('0x2d')](function(_0x101953){_0x265ad1=_[_0x5afa('0xa0')](_0x101953,'id');_0x1c42cf=_[_0x5afa('0xa1')](_0x1c42cf,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x33d816[_0x5afa('0x3e')][_0x5afa('0x43')]){_0x4e21cd[_0x5afa('0x42')][_0x5afa('0x7c')](function(_0x1493a1){_0x240066[_0x5afa('0x4b')]('i.'+_0x1493a1);});}else{_0x240066['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5afa('0x63'));_0x240066['field'](_0x5afa('0xa2'),_0x5afa('0xa3'));_0x240066[_0x5afa('0x4b')](_0x5afa('0xa4'),_0x5afa('0xa5'));_0x240066[_0x5afa('0x4b')](_0x5afa('0xa6'),_0x5afa('0x96'));_0x240066[_0x5afa('0x4b')]('i.*');_0x240066[_0x5afa('0x4b')](_0x5afa('0xa7'),_0x5afa('0xa8'));_0x240066[_0x5afa('0x4b')]('c.lastName',_0x5afa('0xa9'));_0x240066[_0x5afa('0x4b')](_0x5afa('0xaa'),_0x5afa('0xab'));_0x240066['field'](_0x5afa('0xac'),_0x5afa('0xad'));_0x240066[_0x5afa('0x4b')](_0x5afa('0xae'),_0x5afa('0xaf'));_0x240066[_0x5afa('0x4b')]('c.fax','Contact.fax');_0x240066[_0x5afa('0x4b')](_0x5afa('0xb0'),_0x5afa('0xb1'));_0x240066[_0x5afa('0x4b')]('o.internal',_0x5afa('0xb2'));_0x240066[_0x5afa('0x4b')](_0x5afa('0xb3'),'TagIds');}if(_0x4e21cd[_0x5afa('0x26')])_0x240066['limit'](_0x4e21cd[_0x5afa('0x26')]);if(_0x4e21cd[_0x5afa('0x25')])_0x240066['offset'](_0x4e21cd[_0x5afa('0x25')]);return db['sequelize'][_0x5afa('0x3e')](_0x240066[_0x5afa('0x9f')](),_0x1c42cf);})[_0x5afa('0x2d')](function(_0x23989d){if(_0x23989d['length']>0x0)_0x5d74c1[_0x5afa('0x48')](_0x5afa('0xb4'),_[_0x5afa('0x33')](_0x23989d,'id'));return db[_0x5afa('0x9e')][_0x5afa('0x3e')](_0x5d74c1[_0x5afa('0x9f')](),_0x1c42cf)[_0x5afa('0x2d')](function(_0x4e9310){var _0x3fe904=_[_0x5afa('0xb5')](_0x4e9310,'WhatsappInteractionId');var _0x261059=[];_0x23989d[_0x5afa('0x7c')](function(_0x4fe8e6){_0x261059['push'](updateWhatsappInteraction(_0x4fe8e6,_0x265ad1,_0x3fe904));});return BPromise[_0x5afa('0xb6')](_0x261059);});});})[_0x5afa('0x2d')](function(_0x2c1f03){_0x1c9bf7[_0x5afa('0xb7')]=_0x2c1f03;return _0x1c9bf7;})[_0x5afa('0x2d')](respondWithFilteredResult(_0x41877f,_0x4e21cd))['catch'](handleError(_0x41877f,null));};exports[_0x5afa('0xb8')]=function(_0x1d3daa,_0x5999a9){var _0x1439f3={'raw':![],'where':{'id':_0x1d3daa['params']['id']}},_0x467113={};_0x467113[_0x5afa('0x3d')]=_[_0x5afa('0x3f')](db[_0x5afa('0x39')][_0x5afa('0x3a')]);_0x467113[_0x5afa('0x3e')]=_['keys'](_0x1d3daa[_0x5afa('0x3e')]);_0x467113[_0x5afa('0x40')]=_[_0x5afa('0x41')](_0x467113[_0x5afa('0x3d')],_0x467113[_0x5afa('0x3e')]);_0x1439f3['attributes']=_[_0x5afa('0x41')](_0x467113[_0x5afa('0x3d')],qs['fields'](_0x1d3daa[_0x5afa('0x3e')][_0x5afa('0x43')]));_0x1439f3['attributes']=_0x1439f3[_0x5afa('0x42')][_0x5afa('0x44')]?_0x1439f3[_0x5afa('0x42')]:_0x467113['model'];if(_0x1d3daa[_0x5afa('0x3e')][_0x5afa('0xb9')]){_0x1439f3['include']=[{'all':!![]}];}_0x1439f3=_[_0x5afa('0xa1')]({},_0x1439f3,_0x1d3daa[_0x5afa('0xba')]);return db[_0x5afa('0x39')][_0x5afa('0x62')](_0x1439f3)['then'](handleEntityNotFound(_0x5999a9,null))[_0x5afa('0x2d')](respondWithResult(_0x5999a9,null))['catch'](handleError(_0x5999a9,null));};exports[_0x5afa('0xbb')]=function(_0x376307,_0x365b1b){return db['WhatsappInteraction']['create'](_0x376307['body'],{})[_0x5afa('0x2d')](respondWithResult(_0x365b1b,0xc9))['catch'](handleError(_0x365b1b,null));};exports[_0x5afa('0x2c')]=function(_0x56ea8d,_0x40e416){if(_0x56ea8d[_0x5afa('0x78')]['id']){delete _0x56ea8d[_0x5afa('0x78')]['id'];}return db['WhatsappInteraction'][_0x5afa('0x62')]({'where':{'id':_0x56ea8d[_0x5afa('0xbc')]['id']}})[_0x5afa('0x2d')](handleEntityNotFound(_0x40e416,null))[_0x5afa('0x2d')](saveUpdates(_0x56ea8d[_0x5afa('0x78')],null))[_0x5afa('0x2d')](respondWithResult(_0x40e416,null))[_0x5afa('0x38')](handleError(_0x40e416,null));};exports['destroy']=function(_0x2b392d,_0x2715f3){return db[_0x5afa('0x39')][_0x5afa('0x62')]({'where':{'id':_0x2b392d[_0x5afa('0xbc')]['id']}})['then'](handleEntityNotFound(_0x2715f3,null))[_0x5afa('0x2d')](removeEntity(_0x2715f3,null))[_0x5afa('0x38')](handleError(_0x2715f3,null));};exports[_0x5afa('0xbd')]=function(_0x104d88,_0x2cc811){return db[_0x5afa('0x39')]['describe']()['then'](respondWithResult(_0x2cc811,null))[_0x5afa('0x38')](handleError(_0x2cc811,null));};exports[_0x5afa('0xbe')]=function(_0x550c10,_0x5018ae,_0xda2766){return db[_0x5afa('0xbf')][_0x5afa('0x62')]({'where':{'id':_0x550c10[_0x5afa('0xbc')]['id']}})[_0x5afa('0x2d')](handleEntityNotFound(_0x5018ae,null))[_0x5afa('0x2d')](function(_0x22d09a){if(_0x22d09a){return _0x22d09a[_0x5afa('0xbe')](_0x550c10[_0x5afa('0x78')][_0x5afa('0xc0')],_[_0x5afa('0xc1')](_0x550c10['body'],[_0x5afa('0xc0'),'id'])||{});}})[_0x5afa('0x2d')](respondWithResult(_0x5018ae,null))[_0x5afa('0x38')](handleError(_0x5018ae,null));};exports[_0x5afa('0xc2')]=function(_0x37e867,_0x12fe42,_0x104e16){var _0x3f0541={'raw':![],'where':{}};var _0x5b16f9={};var _0xfbea38={'count':0x0,'rows':[]};return db[_0x5afa('0x39')]['findOne']({'where':{'id':_0x37e867[_0x5afa('0xbc')]['id']}})[_0x5afa('0x2d')](handleEntityNotFound(_0x12fe42,null))[_0x5afa('0x2d')](function(_0x5a17c5){if(_0x5a17c5){_0x5b16f9[_0x5afa('0x3d')]=_[_0x5afa('0x3f')](db[_0x5afa('0xbf')][_0x5afa('0x3a')]);_0x5b16f9['query']=_[_0x5afa('0x3f')](_0x37e867['query']);_0x5b16f9['filters']=_[_0x5afa('0x41')](_0x5b16f9[_0x5afa('0x3d')],_0x5b16f9[_0x5afa('0x3e')]);_0x3f0541[_0x5afa('0x42')]=_[_0x5afa('0x41')](_0x5b16f9[_0x5afa('0x3d')],qs[_0x5afa('0x43')](_0x37e867[_0x5afa('0x3e')][_0x5afa('0x43')]));_0x3f0541[_0x5afa('0x42')]=_0x3f0541[_0x5afa('0x42')][_0x5afa('0x44')]?_0x3f0541[_0x5afa('0x42')]:_0x5b16f9[_0x5afa('0x3d')];if(!_0x37e867['query'][_0x5afa('0xc3')](_0x5afa('0x45'))){_0x3f0541[_0x5afa('0x26')]=qs[_0x5afa('0x26')](_0x37e867[_0x5afa('0x3e')]['limit']);_0x3f0541[_0x5afa('0x25')]=qs['offset'](_0x37e867[_0x5afa('0x3e')][_0x5afa('0x25')]);}_0x3f0541[_0x5afa('0x46')]=qs[_0x5afa('0x47')](_0x37e867[_0x5afa('0x3e')][_0x5afa('0x47')]);_0x3f0541[_0x5afa('0x48')]=qs['filters'](_[_0x5afa('0x49')](_0x37e867[_0x5afa('0x3e')],_0x5b16f9[_0x5afa('0x40')]));_0x3f0541[_0x5afa('0x48')][_0x5afa('0xc4')]=_0x5a17c5['id'];if(_0x37e867[_0x5afa('0x3e')][_0x5afa('0x8b')]){_0x3f0541[_0x5afa('0x48')]=_['merge'](_0x3f0541[_0x5afa('0x48')],{'$or':_[_0x5afa('0x33')](_0x3f0541[_0x5afa('0x42')],function(_0x144bd6){var _0x5b053b={};_0x5b053b[_0x144bd6]={'$like':'%'+_0x37e867['query'][_0x5afa('0x8b')]+'%'};return _0x5b053b;})});}if(_0x37e867[_0x5afa('0x3e')]['$gte']){var _0x3b20f3=_0x37e867[_0x5afa('0x3e')][_0x5afa('0x80')][_0x5afa('0x6f')](',');var _0xddfbc5={};_0xddfbc5[_0x3b20f3[0x0]]={'$gte':moment(_0x3b20f3[0x1])[_0x5afa('0xc5')](_0x5afa('0xc6'))};_0x3f0541[_0x5afa('0x48')]=_['merge'](_0x3f0541[_0x5afa('0x48')],_0xddfbc5);}_0x3f0541=_[_0x5afa('0xa1')]({},_0x3f0541,_0x37e867[_0x5afa('0xba')]);return db[_0x5afa('0xbf')][_0x5afa('0x28')]({'where':_0x3f0541['where']})[_0x5afa('0x2d')](function(_0x218e7e){_0xfbea38['count']=_0x218e7e;if(_0x37e867[_0x5afa('0x3e')]['includeAll']){_0x3f0541[_0x5afa('0xc7')]=[{'all':!![]}];}return db[_0x5afa('0xbf')][_0x5afa('0xc8')](_0x3f0541);})['then'](function(_0x5c0db8){_0xfbea38[_0x5afa('0xb7')]=_0x5c0db8;return _0xfbea38;});}})['then'](respondWithFilteredResult(_0x12fe42,_0x3f0541))[_0x5afa('0x38')](handleError(_0x12fe42,null));};exports[_0x5afa('0xc9')]=function(_0x7d97e4,_0x1cee27,_0x11517a){return db[_0x5afa('0x39')]['find']({'where':{'id':_0x7d97e4['params']['id']}})[_0x5afa('0x2d')](handleEntityNotFound(_0x1cee27,null))[_0x5afa('0x2d')](function(_0x52e496){if(_0x52e496){return _0x52e496[_0x5afa('0xca')](_0x7d97e4[_0x5afa('0x78')][_0x5afa('0xc0')],_['omit'](_0x7d97e4[_0x5afa('0x78')],['ids','id'])||{})[_0x5afa('0xcb')](function(){return db[_0x5afa('0x6e')][_0x5afa('0xc8')]({'attributes':['id',_0x5afa('0x31'),_0x5afa('0xcc')],'where':{'id':_0x7d97e4['body'][_0x5afa('0xc0')]}});})['then'](function(_0x1b4927){socket[_0x5afa('0xcd')]('whatsappInteractionTags:save',{'id':Number(_0x7d97e4['params']['id']),'tags':_0x1b4927||[]});return{'id':Number(_0x7d97e4[_0x5afa('0xbc')]['id']),'tags':_0x1b4927||[]};});}})[_0x5afa('0x2d')](respondWithResult(_0x1cee27,null))[_0x5afa('0x38')](handleError(_0x1cee27,null));};exports['removeTags']=function(_0x3b7881,_0x42eefb,_0x3ad9de){return db[_0x5afa('0x39')][_0x5afa('0x62')]({'where':{'id':_0x3b7881['params']['id']}})[_0x5afa('0x2d')](handleEntityNotFound(_0x42eefb,null))[_0x5afa('0x2d')](function(_0x5d63ef){if(_0x5d63ef){return _0x5d63ef['removeTags'](_0x3b7881[_0x5afa('0x3e')]['ids']);}})[_0x5afa('0x2d')](respondWithStatusCode(_0x42eefb,null))[_0x5afa('0x38')](handleError(_0x42eefb,null));};exports['download']=function(_0x26c4fc,_0x135af8){var _0x3099e8=moment()[_0x5afa('0xce')]()[_0x5afa('0x9f')]();var _0x569b6f=path[_0x5afa('0xcf')](config[_0x5afa('0xd0')],'server','files','tmp');var _0x51efbd=path['join'](config['root'],'server',_0x5afa('0xd1'),'attachments');var _0x3604ef=path['join'](_0x569b6f,_0x3099e8);var _0x35b49e=util[_0x5afa('0xc5')](_0x5afa('0xd2'),_0x26c4fc[_0x5afa('0xbc')]['id'],_0x3099e8);var _0x3094ca=path[_0x5afa('0xcf')](_0x569b6f,_0x35b49e);var _0xeaf913=[];_0xeaf913[_0x5afa('0x37')]({'model':db[_0x5afa('0x72')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0xeaf913[_0x5afa('0x37')]({'model':db[_0x5afa('0xd3')],'as':_0x5afa('0x68'),'attributes':['id','firstName',_0x5afa('0xd4')],'raw':!![]});if(_0x26c4fc[_0x5afa('0x3e')][_0x5afa('0xd5')]){_0xeaf913['push']({'model':db['Attachment'],'as':_0x5afa('0xd6'),'raw':!![]});}var _0x2d0c12=[{'model':db['WhatsappMessage'],'as':_0x5afa('0xd7'),'attributes':['id',_0x5afa('0x78'),_0x5afa('0x7f'),_0x5afa('0xd8'),_0x5afa('0xd9'),'read'],'include':_0xeaf913}];_0x2d0c12[_0x5afa('0x37')]({'model':db[_0x5afa('0xda')],'as':_0x5afa('0xdb'),'attributes':['id',_0x5afa('0x31')]});_0x2d0c12[_0x5afa('0x37')]({'model':db['User'],'as':_0x5afa('0xdc'),'attributes':['id',_0x5afa('0x34')]});return db[_0x5afa('0x39')]['find']({'where':{'id':_0x26c4fc[_0x5afa('0xbc')]['id']},'include':_0x2d0c12})['then'](handleEntityNotFound(_0x135af8,null))[_0x5afa('0x2d')](function(_0x1f6b34){if(_0x1f6b34){var _0x16226c=_0x1f6b34[_0x5afa('0xdd')]({'plain':!![]});fs[_0x5afa('0xde')](_0x3604ef);var _0x4440af={'channel':'Whatsapp','account':_0x16226c[_0x5afa('0xdb')][_0x5afa('0x31')],'agent':_0x16226c[_0x5afa('0xdc')]?_0x16226c[_0x5afa('0xdc')][_0x5afa('0x34')]:_0x5afa('0xdf'),'createdAt':moment(_0x16226c[_0x5afa('0x7f')])['format'](_0x5afa('0xc6'))[_0x5afa('0x9f')](),'closedAt':_0x16226c[_0x5afa('0xe0')]?moment(_0x16226c[_0x5afa('0xe1')])[_0x5afa('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5afa('0x9f')]():'','disposition':_0x16226c[_0x5afa('0xe2')],'messages':_(_0x16226c[_0x5afa('0xd7')])[_0x5afa('0x8b')]({'secret':![]})[_0x5afa('0x33')](function(_0x35c1dd){if(_0x35c1dd[_0x5afa('0xd6')]){var _0x4b1374=path[_0x5afa('0xcf')](_0x51efbd,_0x35c1dd[_0x5afa('0xd6')][_0x5afa('0xe3')]);if(fs[_0x5afa('0xe4')](_0x4b1374)){fs[_0x5afa('0xe5')](_0x4b1374)[_0x5afa('0xe6')](fs['createWriteStream'](path[_0x5afa('0xcf')](_0x3604ef,_0x35c1dd[_0x5afa('0xd6')][_0x5afa('0xe3')])));}}return{'date':moment(_0x35c1dd[_0x5afa('0x7f')])[_0x5afa('0xc5')](_0x5afa('0xc6'))[_0x5afa('0x9f')](),'sender':_0x35c1dd['direction']==='out'?_0x35c1dd[_0x5afa('0x72')]?_0x35c1dd[_0x5afa('0x72')][_0x5afa('0x34')]:_0x5afa('0xe7'):_0x35c1dd[_0x5afa('0x68')]['firstName']+(_0x35c1dd[_0x5afa('0x68')][_0x5afa('0xd4')]?'\x20'+_0x35c1dd[_0x5afa('0x68')][_0x5afa('0xd4')]:''),'body':_0x35c1dd[_0x5afa('0xd6')]?_0x35c1dd[_0x5afa('0xd6')][_0x5afa('0xe3')]:_0x35c1dd[_0x5afa('0x78')],'direction':_0x35c1dd[_0x5afa('0xd8')]==='out'?'A':'C','secret':_0x35c1dd[_0x5afa('0xd9')],'read':_0x35c1dd[_0x5afa('0x86')],'attachment':_0x35c1dd['Attachment']};})[_0x5afa('0x64')]()};return ejs[_0x5afa('0xe8')](path[_0x5afa('0xcf')](config['root'],_0x5afa('0xe9'),'views','downloadInteraction.ejs'),{'interaction':_0x4440af})[_0x5afa('0x2d')](function(_0x192341){var _0x487536=path[_0x5afa('0xcf')](_0x3604ef,'transcript-'+_0x16226c['id']+'-'+_0x3099e8+_0x5afa('0xea'));var _0x1be3ff={'path':_0x487536,'channel':'Whatsapp','interactionId':_0x16226c['id']};return pdf['createPdfFromHTML'](_0x192341,_0x1be3ff);})[_0x5afa('0x2d')](function(){return new BPromise(function(_0x46a200,_0x3d7a37){zipdir(_0x3604ef,{'saveTo':_0x3094ca},function(_0x64458a,_0x2091a7){if(_0x64458a)return _0x3d7a37(_0x64458a);return _0x46a200(_0x2091a7);});})[_0x5afa('0x2d')](function(){return new BPromise(function(_0x15556f,_0x161fc7){rimraf(_0x3604ef,function(_0x45be11){if(_0x45be11)_0x161fc7(_0x45be11);return _0x15556f();});});})['then'](function(){return _0x135af8[_0x5afa('0xeb')](_0x3094ca,_0x35b49e,function(_0x145efd){if(_0x145efd){console[_0x5afa('0xec')](_0x5afa('0xed'),_0x145efd);}else{fs['unlinkSync'](_0x3094ca);}});});});}else{return _0x135af8[_0x5afa('0x22')](0xc8);}})[_0x5afa('0x38')](handleError(_0x135af8,null));}; \ No newline at end of file +var _0xdab2=['merge','Account.key','c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','toString','groupBy','WhatsappInteractionId','push','all','params','includeAll','include','create','addMessage','ids','omit','getMessages','WhatsappMessage','pick','format','options','findAll','rows','addTags','setTags','emit','whatsappInteractionTags:save','removeTags','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','fullname','CmContact','firstName','Attachment','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','YYYY-MM-DD\x20HH:mm:ss','disposition','Messages','basename','existsSync','pipe','createWriteStream','direction','out','Contact','lastName','renderFile','views','transcript-','.pdf','download','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','Tags','catch','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','select','field','from','tools_tags','u.fullname','ui.WhatsappInteractionId','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','search','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','text','some','compact','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','keyBy'];(function(_0x7d1282,_0xf89610){var _0x3a713e=function(_0xc02c32){while(--_0xc02c32){_0x7d1282['push'](_0x7d1282['shift']());}};_0x3a713e(++_0xf89610);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dab('0x0'));var rimraf=require(_0x2dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dab('0x2'));var rp=require(_0x2dab('0x3'));var moment=require(_0x2dab('0x4'));var BPromise=require(_0x2dab('0x5'));var Mustache=require('mustache');var util=require(_0x2dab('0x6'));var path=require(_0x2dab('0x7'));var sox=require(_0x2dab('0x8'));var csv=require(_0x2dab('0x9'));var ejs=require(_0x2dab('0xa'));var fs=require('fs');var fs_extra=require(_0x2dab('0xb'));var _=require(_0x2dab('0xc'));var squel=require(_0x2dab('0xd'));var crypto=require(_0x2dab('0xe'));var jsforce=require(_0x2dab('0xf'));var deskjs=require(_0x2dab('0x10'));var toCsv=require(_0x2dab('0x9'));var querystring=require(_0x2dab('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dab('0x12'));var qs=require(_0x2dab('0x13'));var as=require(_0x2dab('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2dab('0x15'))(_0x2dab('0x16'));var utils=require(_0x2dab('0x17'));var config=require(_0x2dab('0x18'));var licenseUtil=require(_0x2dab('0x19'));var db=require('../../mysqldb')['db'];config[_0x2dab('0x1a')]=_[_0x2dab('0x1b')](config['redis'],{'host':_0x2dab('0x1c'),'port':0x18eb});var socket=require(_0x2dab('0x1d'))(new Redis(config[_0x2dab('0x1a')]));require('./whatsappInteraction.socket')[_0x2dab('0x1e')](socket);function respondWithStatusCode(_0x149867,_0x50b496){_0x50b496=_0x50b496||0xcc;return function(_0x3c00b1){if(_0x3c00b1){return _0x149867[_0x2dab('0x1f')](_0x50b496);}return _0x149867[_0x2dab('0x20')](_0x50b496)[_0x2dab('0x21')]();};}function respondWithResult(_0x1285d5,_0x55a92c){_0x55a92c=_0x55a92c||0xc8;return function(_0x128004){if(_0x128004){return _0x1285d5[_0x2dab('0x20')](_0x55a92c)[_0x2dab('0x22')](_0x128004);}};}function respondWithFilteredResult(_0x1815ed,_0x30bbde){return function(_0x2a86b5){if(_0x2a86b5){var _0x4ff9be=typeof _0x30bbde[_0x2dab('0x23')]===_0x2dab('0x24')&&typeof _0x30bbde[_0x2dab('0x25')]==='undefined';var _0x3340fd=_0x2a86b5[_0x2dab('0x26')];var _0x3acee3=_0x4ff9be?0x0:_0x30bbde['offset'];var _0x477494=_0x4ff9be?_0x2a86b5[_0x2dab('0x26')]:_0x30bbde[_0x2dab('0x23')]+_0x30bbde[_0x2dab('0x25')];var _0x2225dd;if(_0x477494>=_0x3340fd){_0x477494=_0x3340fd;_0x2225dd=0xc8;}else{_0x2225dd=0xce;}_0x1815ed[_0x2dab('0x20')](_0x2225dd);return _0x1815ed['set'](_0x2dab('0x27'),_0x3acee3+'-'+_0x477494+'/'+_0x3340fd)[_0x2dab('0x22')](_0x2a86b5);}return null;};}function patchUpdates(_0x4a1c14){return function(_0x2d1032){try{jsonpatch[_0x2dab('0x28')](_0x2d1032,_0x4a1c14,!![]);}catch(_0xf16fec){return BPromise[_0x2dab('0x29')](_0xf16fec);}return _0x2d1032[_0x2dab('0x2a')]();};}function saveUpdates(_0x115e8c,_0x9d8bc5){return function(_0x37b55e){if(_0x37b55e){return _0x37b55e[_0x2dab('0x2b')](_0x115e8c)[_0x2dab('0x2c')](function(_0x50153d){return _0x50153d;});}return null;};}function removeEntity(_0x255478,_0x485443){return function(_0xbe611){if(_0xbe611){return _0xbe611[_0x2dab('0x2d')]()['then'](function(){_0x255478[_0x2dab('0x20')](0xcc)[_0x2dab('0x21')]();});}};}function handleEntityNotFound(_0x208e56,_0x2977ac){return function(_0x57ca7e){if(!_0x57ca7e){_0x208e56[_0x2dab('0x1f')](0x194);}return _0x57ca7e;};}function handleError(_0x26d6d2,_0xa93e){_0xa93e=_0xa93e||0x1f4;return function(_0x2b15c0){logger[_0x2dab('0x2e')](_0x2b15c0[_0x2dab('0x2f')]);if(_0x2b15c0[_0x2dab('0x30')]){delete _0x2b15c0[_0x2dab('0x30')];}_0x26d6d2[_0x2dab('0x20')](_0xa93e)[_0x2dab('0x31')](_0x2b15c0);};}function getInteractionUsers(_0x2a4996,_0x11582d){return new BPromise(function(_0x1b441d,_0x1ea8b8){try{if(_0x11582d[_0x2a4996['id']]){_0x2a4996[_0x2dab('0x32')]=_['map'](_0x11582d[_0x2a4996['id']],function(_0x54fb5e){return{'id':_0x54fb5e['id'],'fullname':_0x54fb5e['fullname']};});}}catch(_0x32d6c4){_0x1ea8b8(_0x32d6c4);}_0x1b441d(_0x2a4996);});}function getInteractionTags(_0x167aba,_0x1bc1fe){return new BPromise(function(_0x46a42e,_0x1a3737){try{if(_0x167aba['TagIds']){_0x167aba[_0x2dab('0x33')]=[];_0x167aba['TagIds']['split'](',')['forEach'](function(_0x2dcd93){_0x167aba[_0x2dab('0x33')]['push'](_0x1bc1fe[_0x2dcd93]);});}delete _0x167aba['TagIds'];}catch(_0x11a8b5){_0x1a3737(_0x11a8b5);}_0x46a42e(_0x167aba);});}function updateWhatsappInteraction(_0x19bb55,_0x349946,_0x17e938){return new BPromise(function(_0x3a68b7,_0x2541a2){return getInteractionUsers(_0x19bb55,_0x17e938)['then'](function(_0x727bd8){return getInteractionTags(_0x727bd8,_0x349946);})['then'](function(_0x85c598){_0x3a68b7(_0x85c598);})[_0x2dab('0x34')](function(_0xda3831){_0x2541a2(_0xda3831);});});}exports[_0x2dab('0x35')]=function(_0x34e6d7,_0x81d546){var _0x56b902={},_0x5ba77d={},_0xe88d26={'count':0x0,'rows':[]};var _0x332792=_[_0x2dab('0x36')](db[_0x2dab('0x37')][_0x2dab('0x38')],function(_0x567bd3){return{'name':_0x567bd3[_0x2dab('0x39')],'type':_0x567bd3[_0x2dab('0x3a')][_0x2dab('0x3b')]};});_0x5ba77d[_0x2dab('0x3c')]=_[_0x2dab('0x36')](_0x332792,_0x2dab('0x30'));_0x5ba77d[_0x2dab('0x3d')]=_[_0x2dab('0x3e')](_0x34e6d7[_0x2dab('0x3d')]);_0x5ba77d[_0x2dab('0x3f')]=_[_0x2dab('0x40')](_0x5ba77d[_0x2dab('0x3c')],_0x5ba77d['query']);_0x56b902[_0x2dab('0x41')]=_['intersection'](_0x5ba77d[_0x2dab('0x3c')],qs['fields'](_0x34e6d7['query'][_0x2dab('0x42')]));_0x56b902[_0x2dab('0x41')]=_0x56b902[_0x2dab('0x41')]['length']?_0x56b902[_0x2dab('0x41')]:_0x5ba77d[_0x2dab('0x3c')];if(!_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x43')](_0x2dab('0x44'))){_0x56b902[_0x2dab('0x25')]=qs[_0x2dab('0x25')](_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x25')]);_0x56b902[_0x2dab('0x23')]=qs['offset'](_0x34e6d7[_0x2dab('0x3d')]['offset']);}_0x56b902['order']=qs[_0x2dab('0x45')](_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x45')]);_0x56b902['where']=qs['filters'](_['pick'](_0x34e6d7['query'],_0x5ba77d[_0x2dab('0x3f')]),_0x332792);var _0x563c7b=[];var _0x3916ac=squel[_0x2dab('0x46')]()[_0x2dab('0x47')]('id')[_0x2dab('0x47')](_0x2dab('0x30'))[_0x2dab('0x47')]('color')[_0x2dab('0x48')](_0x2dab('0x49'));var _0x590439=squel[_0x2dab('0x46')]()[_0x2dab('0x47')]('u.id')['field'](_0x2dab('0x4a'))[_0x2dab('0x47')](_0x2dab('0x4b'))[_0x2dab('0x48')]('user_has_whatsapp_interactions','ui')[_0x2dab('0x4c')](_0x2dab('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x322ea6=squel[_0x2dab('0x46')]()[_0x2dab('0x48')](_0x2dab('0x4e'),'i')[_0x2dab('0x4c')](_0x2dab('0x4f'),'c',_0x2dab('0x50'))[_0x2dab('0x4c')](_0x2dab('0x4d'),'o','o.id\x20=\x20i.UserId')['left_join']('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')['left_join'](_0x2dab('0x51'),'me',_0x2dab('0x52'))[_0x2dab('0x4c')]('whatsapp_interaction_has_tags','it',_0x2dab('0x53'))[_0x2dab('0x4c')](_0x2dab('0x49'),'t','t.id\x20=\x20it.TagId');var _0x1740fc=squel['expr']();var _0x4c1893=[];var _0x284f73=squel[_0x2dab('0x54')]();var _0x83d78d;if(_0x34e6d7[_0x2dab('0x3d')]['search']){_0x83d78d=as[_0x2dab('0x55')](_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x56')]);var _0x5330a6=_0x83d78d['sqlOperator'];for(var _0x580a33=0x0;_0x580a33<_0x83d78d[_0x2dab('0x57')][_0x2dab('0x58')];_0x580a33++){var _0x505605=_0x83d78d[_0x2dab('0x57')][_0x580a33];var _0xf9fa02='i';var _0x40c388=_['find'](_0x332792,[_0x2dab('0x30'),_0x505605[_0x2dab('0x47')]]);if(!_0x40c388){switch(_0x505605[_0x2dab('0x47')]){case _0x2dab('0x59'):if(_0x505605[_0x2dab('0x5a')]==0x1){_0x322ea6[_0x2dab('0x5b')]('`'+_0x505605['field']+_0x2dab('0x5c'));}else{_0x322ea6['having']('`'+_0x505605[_0x2dab('0x47')]+_0x2dab('0x5d'));}break;case'Contact':if(_0x505605[_0x2dab('0x5e')]===_0x2dab('0x5f')){if(_0x505605[_0x2dab('0x5a')][_0x2dab('0x60')]('\x20')[_0x2dab('0x58')]>0x1){_0x1740fc[_0x5330a6](_0x2dab('0x61'),qs['getFullTextValue'](_0x505605['value']),null);}else{var _0x13726c='%'+_0x505605[_0x2dab('0x5a')]+'%';_0x1740fc[_0x5330a6](_0x2dab('0x62'),_0x13726c,_0x13726c,_0x13726c);}}else{_0x40c388=_[_0x2dab('0x63')](_0x332792,[_0x2dab('0x30'),'ContactId']);_0x505605['field']=_0x2dab('0x64');_0x5b15fb=as['buildExpression'](_0xf9fa02,_0x40c388[_0x2dab('0x3a')],_0x505605);_0x1740fc[_0x5330a6](_0x5b15fb['text'],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x65')],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x21')]);}break;case'Tag':var _0x289087=_0x505605[_0x2dab('0x5a')][_0x2dab('0x60')](',')[_0x2dab('0x36')](function(_0x3d9f89){return Number(_0x3d9f89);});_0x289087['forEach'](function(_0x1178e5){_0x284f73['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1178e5+',%');});_0x4c1893=_[_0x2dab('0x66')](_0x4c1893,_0x289087);break;case _0x2dab('0x67'):if(_0x505605[_0x2dab('0x5e')]===_0x2dab('0x5f')){_0x1740fc[_0x5330a6](_0x2dab('0x68'),'%'+_0x505605[_0x2dab('0x5a')]+'%',null);}else{_0x40c388=_[_0x2dab('0x63')](_0x332792,[_0x2dab('0x30'),_0x2dab('0x69')]);_0x505605[_0x2dab('0x47')]=_0x2dab('0x69');_0x5b15fb=as['buildExpression'](_0xf9fa02,_0x40c388['type'],_0x505605);_0x1740fc[_0x5330a6](_0x5b15fb['text'],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x65')],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x21')]);}break;case _0x2dab('0x6a'):_0x5b15fb=as[_0x2dab('0x6b')]('me',null,_0x505605);_0x1740fc[_0x5330a6](_0x5b15fb[_0x2dab('0x6c')],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x65')],_0x5b15fb['value']['end']);break;}}else{var _0x5b15fb=as['buildExpression'](_0xf9fa02,_0x40c388['type'],_0x505605);_0x1740fc[_0x5330a6](_0x5b15fb[_0x2dab('0x6c')],_0x5b15fb[_0x2dab('0x5a')][_0x2dab('0x65')],_0x5b15fb[_0x2dab('0x5a')]['end']);}}}else{var _0x426e57=_(_0x34e6d7['query'])[_0x2dab('0x3e')]()[_0x2dab('0x36')](function(_0x3dee29){return _[_0x2dab('0x6d')](_0x332792,[_0x2dab('0x30'),_0x3dee29])?_0x3dee29:undefined;})[_0x2dab('0x6e')]()[_0x2dab('0x5a')]();if(!_[_0x2dab('0x6f')](_0x426e57)){_0x426e57[_0x2dab('0x70')](function(_0x5531fe){if(_0x5531fe===_0x2dab('0x71')){_0x322ea6['where'](_0x2dab('0x72'),[]['concat'](_0x34e6d7['query'][_0x5531fe]));}else if(_0x5531fe===_0x2dab('0x73')){var _0x3d6ca5=JSON[_0x2dab('0x74')](_0x34e6d7[_0x2dab('0x3d')][_0x5531fe])[_0x2dab('0x75')];var _0x41cdb4=JSON[_0x2dab('0x74')](_0x34e6d7[_0x2dab('0x3d')][_0x5531fe])[_0x2dab('0x76')];_0x322ea6[_0x2dab('0x77')](_0x2dab('0x78'),_0x3d6ca5,_0x41cdb4);}else{if(_0x34e6d7[_0x2dab('0x3d')][_0x5531fe]===_0x2dab('0x79')){_0x322ea6[_0x2dab('0x77')]('i.'+_0x5531fe+_0x2dab('0x7a'));}else{_0x322ea6['where']('i.'+_0x5531fe+_0x2dab('0x7b'),_0x34e6d7[_0x2dab('0x3d')][_0x5531fe]);}}});}if(_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x7c')]){if(_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x7c')]==0x1){_0x322ea6['having'](_0x2dab('0x7d'));}else{_0x322ea6[_0x2dab('0x5b')]('`unreadMessages`\x20>\x200');}}if(_0x34e6d7[_0x2dab('0x3d')]['tag']){_0x4c1893=_[_0x2dab('0x7e')](_0x34e6d7[_0x2dab('0x3d')]['tag'])?_0x34e6d7['query']['tag']:new Array(_0x34e6d7['query'][_0x2dab('0x7f')]);_0x4c1893[_0x2dab('0x70')](function(_0x127dc6){_0x284f73['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x127dc6+',%');});}if(_0x34e6d7['query'][_0x2dab('0x80')]){var _0x4abb09=_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x80')][_0x2dab('0x81')]('\x5c','\x5c\x5c')[_0x2dab('0x81')](/'/g,'\x27\x27');if(qs[_0x2dab('0x82')](_0x4abb09)){_0x1740fc['or']('i.id\x20LIKE\x20?',_0x4abb09+'%')['or'](_0x2dab('0x83'),_0x4abb09+'%');}else{_0x1740fc['or'](_0x2dab('0x84'),qs['getFullTextValue'](_0x4abb09))['or'](_0x2dab('0x85'),_0x4abb09+'%');}}}_0x322ea6['where'](_0x1740fc);_0x322ea6[_0x2dab('0x86')](_0x2dab('0x87'));var _0x4a30d9={'type':db['Sequelize']['QueryTypes'][_0x2dab('0x88')],'raw':!![]};var _0x3bac5f=_0x322ea6[_0x2dab('0x89')]();_0x3bac5f[_0x2dab('0x47')](_0x2dab('0x87'));_0x3bac5f[_0x2dab('0x47')](_0x2dab('0x8a'),_0x2dab('0x59'));if(_0x56b902[_0x2dab('0x8b')]){_0x56b902[_0x2dab('0x8b')]['forEach'](function(_0x4a882b){var _0x18e0a4=_0x4a882b[0x0]===_0x2dab('0x8c')?_0x4a882b[0x0]:'i.'+_0x4a882b[0x0];_0x322ea6[_0x2dab('0x8b')](_0x18e0a4,_0x4a882b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2dab('0x6f')](_0x4c1893)){_0x322ea6[_0x2dab('0x5b')](_0x284f73);_0x3bac5f[_0x2dab('0x77')]('t.id\x20IN\x20?',_0x4c1893);}BPromise['resolve']()[_0x2dab('0x2c')](function(){if(!_0x83d78d){if(_0x34e6d7[_0x2dab('0x3d')]['WhatsappAccountId'])return;_0x3bac5f[_0x2dab('0x77')](_0x2dab('0x8d'));_0x322ea6[_0x2dab('0x77')](_0x2dab('0x8d'));return;}if(_0x34e6d7[_0x2dab('0x8e')][_0x2dab('0x8f')]!==_0x2dab('0x90'))return;return _0x34e6d7[_0x2dab('0x8e')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3c2a17){if(_[_0x2dab('0x6f')](_0x3c2a17)){_0x3bac5f[_0x2dab('0x77')](_0x2dab('0x91'));_0x322ea6['where'](_0x2dab('0x91'));}else{_0x3bac5f[_0x2dab('0x77')](_0x2dab('0x72'),_[_0x2dab('0x36')](_0x3c2a17,'id'));_0x322ea6[_0x2dab('0x77')](_0x2dab('0x72'),_['map'](_0x3c2a17,'id'));}});})[_0x2dab('0x2c')](function(){if(_0x34e6d7[_0x2dab('0x8e')]['role']==='agent'&&!_0x83d78d&&!_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x71')])return[];return db[_0x2dab('0x92')]['query'](_0x3bac5f['toString'](),_0x4a30d9);})[_0x2dab('0x2c')](function(_0xc0d525){_0xe88d26['count']=_0xc0d525[_0x2dab('0x58')];if(_0xe88d26[_0x2dab('0x26')]===0x0)return[];return db[_0x2dab('0x92')][_0x2dab('0x3d')](_0x3916ac['toString'](),_0x4a30d9)[_0x2dab('0x2c')](function(_0x1f9dd4){_0x563c7b=_[_0x2dab('0x93')](_0x1f9dd4,'id');_0x4a30d9=_[_0x2dab('0x94')](_0x4a30d9,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x34e6d7[_0x2dab('0x3d')][_0x2dab('0x42')]){_0x56b902[_0x2dab('0x41')]['forEach'](function(_0x5d7b8f){_0x322ea6['field']('i.'+_0x5d7b8f);});}else{_0x322ea6[_0x2dab('0x47')](_0x2dab('0x8a'),_0x2dab('0x59'));_0x322ea6[_0x2dab('0x47')]('a.key',_0x2dab('0x95'));_0x322ea6[_0x2dab('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x322ea6[_0x2dab('0x47')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x2dab('0x8c'));_0x322ea6[_0x2dab('0x47')]('i.*');_0x322ea6[_0x2dab('0x47')](_0x2dab('0x96'),'Contact.firstName');_0x322ea6[_0x2dab('0x47')](_0x2dab('0x97'),_0x2dab('0x98'));_0x322ea6[_0x2dab('0x47')](_0x2dab('0x99'),'Contact.email');_0x322ea6[_0x2dab('0x47')]('c.phone',_0x2dab('0x9a'));_0x322ea6[_0x2dab('0x47')](_0x2dab('0x9b'),_0x2dab('0x9c'));_0x322ea6[_0x2dab('0x47')](_0x2dab('0x9d'),_0x2dab('0x9e'));_0x322ea6[_0x2dab('0x47')](_0x2dab('0x9f'),_0x2dab('0xa0'));_0x322ea6[_0x2dab('0x47')]('o.internal',_0x2dab('0xa1'));_0x322ea6[_0x2dab('0x47')](_0x2dab('0xa2'),'TagIds');}if(_0x56b902[_0x2dab('0x25')])_0x322ea6['limit'](_0x56b902[_0x2dab('0x25')]);if(_0x56b902['offset'])_0x322ea6[_0x2dab('0x23')](_0x56b902['offset']);return db[_0x2dab('0x92')][_0x2dab('0x3d')](_0x322ea6['toString'](),_0x4a30d9);})[_0x2dab('0x2c')](function(_0x253cf1){if(_0x253cf1[_0x2dab('0x58')]>0x0)_0x590439[_0x2dab('0x77')](_0x2dab('0xa3'),_['map'](_0x253cf1,'id'));return db[_0x2dab('0x92')][_0x2dab('0x3d')](_0x590439[_0x2dab('0xa4')](),_0x4a30d9)['then'](function(_0x11a59e){var _0x55bede=_[_0x2dab('0xa5')](_0x11a59e,_0x2dab('0xa6'));var _0x410b29=[];_0x253cf1[_0x2dab('0x70')](function(_0x1126db){_0x410b29[_0x2dab('0xa7')](updateWhatsappInteraction(_0x1126db,_0x563c7b,_0x55bede));});return BPromise[_0x2dab('0xa8')](_0x410b29);});});})['then'](function(_0x2a1463){_0xe88d26['rows']=_0x2a1463;return _0xe88d26;})['then'](respondWithFilteredResult(_0x81d546,_0x56b902))[_0x2dab('0x34')](handleError(_0x81d546,null));};exports['show']=function(_0x53eb86,_0x4921dc){var _0x1188cb={'raw':![],'where':{'id':_0x53eb86[_0x2dab('0xa9')]['id']}},_0x295763={};_0x295763[_0x2dab('0x3c')]=_[_0x2dab('0x3e')](db[_0x2dab('0x37')][_0x2dab('0x38')]);_0x295763[_0x2dab('0x3d')]=_[_0x2dab('0x3e')](_0x53eb86[_0x2dab('0x3d')]);_0x295763['filters']=_['intersection'](_0x295763[_0x2dab('0x3c')],_0x295763[_0x2dab('0x3d')]);_0x1188cb[_0x2dab('0x41')]=_[_0x2dab('0x40')](_0x295763['model'],qs[_0x2dab('0x42')](_0x53eb86[_0x2dab('0x3d')][_0x2dab('0x42')]));_0x1188cb[_0x2dab('0x41')]=_0x1188cb[_0x2dab('0x41')][_0x2dab('0x58')]?_0x1188cb[_0x2dab('0x41')]:_0x295763['model'];if(_0x53eb86[_0x2dab('0x3d')][_0x2dab('0xaa')]){_0x1188cb[_0x2dab('0xab')]=[{'all':!![]}];}_0x1188cb=_[_0x2dab('0x94')]({},_0x1188cb,_0x53eb86['options']);return db['WhatsappInteraction']['find'](_0x1188cb)[_0x2dab('0x2c')](handleEntityNotFound(_0x4921dc,null))['then'](respondWithResult(_0x4921dc,null))[_0x2dab('0x34')](handleError(_0x4921dc,null));};exports[_0x2dab('0xac')]=function(_0x1b3c37,_0x4bb129){return db['WhatsappInteraction'][_0x2dab('0xac')](_0x1b3c37[_0x2dab('0x6a')],{})[_0x2dab('0x2c')](respondWithResult(_0x4bb129,0xc9))[_0x2dab('0x34')](handleError(_0x4bb129,null));};exports[_0x2dab('0x2b')]=function(_0x557460,_0x3502a5){if(_0x557460[_0x2dab('0x6a')]['id']){delete _0x557460[_0x2dab('0x6a')]['id'];}return db[_0x2dab('0x37')][_0x2dab('0x63')]({'where':{'id':_0x557460[_0x2dab('0xa9')]['id']}})['then'](handleEntityNotFound(_0x3502a5,null))['then'](saveUpdates(_0x557460['body'],null))['then'](respondWithResult(_0x3502a5,null))[_0x2dab('0x34')](handleError(_0x3502a5,null));};exports[_0x2dab('0x2d')]=function(_0x2bba83,_0x14a59c){return db['WhatsappInteraction'][_0x2dab('0x63')]({'where':{'id':_0x2bba83[_0x2dab('0xa9')]['id']}})[_0x2dab('0x2c')](handleEntityNotFound(_0x14a59c,null))[_0x2dab('0x2c')](removeEntity(_0x14a59c,null))[_0x2dab('0x34')](handleError(_0x14a59c,null));};exports['describe']=function(_0x3b42e3,_0x86e9eb){return db[_0x2dab('0x37')]['describe']()[_0x2dab('0x2c')](respondWithResult(_0x86e9eb,null))['catch'](handleError(_0x86e9eb,null));};exports[_0x2dab('0xad')]=function(_0x2f512b,_0x53fc91,_0xa7b92f){return db['WhatsappMessage'][_0x2dab('0x63')]({'where':{'id':_0x2f512b['params']['id']}})[_0x2dab('0x2c')](handleEntityNotFound(_0x53fc91,null))['then'](function(_0x8b6165){if(_0x8b6165){return _0x8b6165[_0x2dab('0xad')](_0x2f512b['body'][_0x2dab('0xae')],_[_0x2dab('0xaf')](_0x2f512b[_0x2dab('0x6a')],['ids','id'])||{});}})[_0x2dab('0x2c')](respondWithResult(_0x53fc91,null))[_0x2dab('0x34')](handleError(_0x53fc91,null));};exports[_0x2dab('0xb0')]=function(_0x52a045,_0x3d9ac5,_0x61266d){var _0xf20750={'raw':![],'where':{}};var _0x2ae1ca={};var _0xd3b1ac={'count':0x0,'rows':[]};return db[_0x2dab('0x37')]['findOne']({'where':{'id':_0x52a045[_0x2dab('0xa9')]['id']}})[_0x2dab('0x2c')](handleEntityNotFound(_0x3d9ac5,null))[_0x2dab('0x2c')](function(_0x133ab5){if(_0x133ab5){_0x2ae1ca['model']=_[_0x2dab('0x3e')](db[_0x2dab('0xb1')][_0x2dab('0x38')]);_0x2ae1ca[_0x2dab('0x3d')]=_[_0x2dab('0x3e')](_0x52a045['query']);_0x2ae1ca[_0x2dab('0x3f')]=_[_0x2dab('0x40')](_0x2ae1ca[_0x2dab('0x3c')],_0x2ae1ca[_0x2dab('0x3d')]);_0xf20750[_0x2dab('0x41')]=_[_0x2dab('0x40')](_0x2ae1ca[_0x2dab('0x3c')],qs[_0x2dab('0x42')](_0x52a045[_0x2dab('0x3d')][_0x2dab('0x42')]));_0xf20750[_0x2dab('0x41')]=_0xf20750[_0x2dab('0x41')][_0x2dab('0x58')]?_0xf20750[_0x2dab('0x41')]:_0x2ae1ca[_0x2dab('0x3c')];if(!_0x52a045[_0x2dab('0x3d')]['hasOwnProperty'](_0x2dab('0x44'))){_0xf20750['limit']=qs[_0x2dab('0x25')](_0x52a045[_0x2dab('0x3d')][_0x2dab('0x25')]);_0xf20750[_0x2dab('0x23')]=qs[_0x2dab('0x23')](_0x52a045[_0x2dab('0x3d')][_0x2dab('0x23')]);}_0xf20750['order']=qs['sort'](_0x52a045[_0x2dab('0x3d')]['sort']);_0xf20750[_0x2dab('0x77')]=qs[_0x2dab('0x3f')](_[_0x2dab('0xb2')](_0x52a045[_0x2dab('0x3d')],_0x2ae1ca[_0x2dab('0x3f')]));_0xf20750['where'][_0x2dab('0xa6')]=_0x133ab5['id'];if(_0x52a045['query'][_0x2dab('0x80')]){_0xf20750['where']=_['merge'](_0xf20750[_0x2dab('0x77')],{'$or':_[_0x2dab('0x36')](_0xf20750[_0x2dab('0x41')],function(_0x32cd3a){var _0x5242bc={};_0x5242bc[_0x32cd3a]={'$like':'%'+_0x52a045[_0x2dab('0x3d')][_0x2dab('0x80')]+'%'};return _0x5242bc;})});}if(_0x52a045[_0x2dab('0x3d')][_0x2dab('0x75')]){var _0x4d2f17=_0x52a045[_0x2dab('0x3d')][_0x2dab('0x75')][_0x2dab('0x60')](',');var _0xdacb52={};_0xdacb52[_0x4d2f17[0x0]]={'$gte':moment(_0x4d2f17[0x1])[_0x2dab('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf20750[_0x2dab('0x77')]=_[_0x2dab('0x94')](_0xf20750[_0x2dab('0x77')],_0xdacb52);}_0xf20750=_[_0x2dab('0x94')]({},_0xf20750,_0x52a045[_0x2dab('0xb4')]);return db[_0x2dab('0xb1')]['count']({'where':_0xf20750[_0x2dab('0x77')]})['then'](function(_0x371c33){_0xd3b1ac['count']=_0x371c33;if(_0x52a045[_0x2dab('0x3d')]['includeAll']){_0xf20750[_0x2dab('0xab')]=[{'all':!![]}];}return db[_0x2dab('0xb1')][_0x2dab('0xb5')](_0xf20750);})[_0x2dab('0x2c')](function(_0x3fb887){_0xd3b1ac[_0x2dab('0xb6')]=_0x3fb887;return _0xd3b1ac;});}})['then'](respondWithFilteredResult(_0x3d9ac5,_0xf20750))['catch'](handleError(_0x3d9ac5,null));};exports[_0x2dab('0xb7')]=function(_0x496007,_0x496afe,_0x13b9c1){return db[_0x2dab('0x37')][_0x2dab('0x63')]({'where':{'id':_0x496007[_0x2dab('0xa9')]['id']}})['then'](handleEntityNotFound(_0x496afe,null))['then'](function(_0x5af3f8){if(_0x5af3f8){return _0x5af3f8[_0x2dab('0xb8')](_0x496007[_0x2dab('0x6a')][_0x2dab('0xae')],_[_0x2dab('0xaf')](_0x496007[_0x2dab('0x6a')],[_0x2dab('0xae'),'id'])||{})['spread'](function(){return db['Tag'][_0x2dab('0xb5')]({'attributes':['id',_0x2dab('0x30'),'color'],'where':{'id':_0x496007[_0x2dab('0x6a')]['ids']}});})[_0x2dab('0x2c')](function(_0x20ad20){socket[_0x2dab('0xb9')](_0x2dab('0xba'),{'id':Number(_0x496007[_0x2dab('0xa9')]['id']),'tags':_0x20ad20||[]});return{'id':Number(_0x496007[_0x2dab('0xa9')]['id']),'tags':_0x20ad20||[]};});}})['then'](respondWithResult(_0x496afe,null))[_0x2dab('0x34')](handleError(_0x496afe,null));};exports[_0x2dab('0xbb')]=function(_0x87191f,_0x42abb8,_0x4f7c97){return db[_0x2dab('0x37')][_0x2dab('0x63')]({'where':{'id':_0x87191f[_0x2dab('0xa9')]['id']}})[_0x2dab('0x2c')](handleEntityNotFound(_0x42abb8,null))['then'](function(_0x2cc73c){if(_0x2cc73c){return _0x2cc73c[_0x2dab('0xbb')](_0x87191f[_0x2dab('0x3d')]['ids']);}})['then'](respondWithStatusCode(_0x42abb8,null))['catch'](handleError(_0x42abb8,null));};exports['download']=function(_0xe37f24,_0x50f854){var _0x1343f0=moment()[_0x2dab('0xbc')]()[_0x2dab('0xa4')]();var _0x2086bf=path['join'](config[_0x2dab('0xbd')],_0x2dab('0xbe'),_0x2dab('0xbf'),_0x2dab('0xc0'));var _0x757c07=path['join'](config['root'],_0x2dab('0xbe'),_0x2dab('0xbf'),_0x2dab('0xc1'));var _0x12d08f=path[_0x2dab('0xc2')](_0x2086bf,_0x1343f0);var _0x1f8d48=util[_0x2dab('0xb3')](_0x2dab('0xc3'),_0xe37f24['params']['id'],_0x1343f0);var _0x299813=path[_0x2dab('0xc2')](_0x2086bf,_0x1f8d48);var _0x444260=[];_0x444260[_0x2dab('0xa7')]({'model':db[_0x2dab('0x67')],'as':_0x2dab('0x67'),'attributes':['id',_0x2dab('0xc4')],'raw':!![]});_0x444260['push']({'model':db[_0x2dab('0xc5')],'as':'Contact','attributes':['id',_0x2dab('0xc6'),'lastName'],'raw':!![]});if(_0xe37f24[_0x2dab('0x3d')]['attachments']){_0x444260[_0x2dab('0xa7')]({'model':db[_0x2dab('0xc7')],'as':_0x2dab('0xc7'),'raw':!![]});}var _0x5c47d8=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id','body','createdAt','direction','secret','read'],'include':_0x444260}];_0x5c47d8['push']({'model':db[_0x2dab('0xc8')],'as':_0x2dab('0xc9'),'attributes':['id',_0x2dab('0x30')]});_0x5c47d8[_0x2dab('0xa7')]({'model':db[_0x2dab('0x67')],'as':_0x2dab('0xca'),'attributes':['id',_0x2dab('0xc4')]});return db[_0x2dab('0x37')][_0x2dab('0x63')]({'where':{'id':_0xe37f24[_0x2dab('0xa9')]['id']},'include':_0x5c47d8})[_0x2dab('0x2c')](handleEntityNotFound(_0x50f854,null))['then'](function(_0x339136){if(_0x339136){var _0x499f08=_0x339136[_0x2dab('0xcb')]({'plain':!![]});fs[_0x2dab('0xcc')](_0x12d08f);var _0x4b6f5a={'channel':_0x2dab('0xcd'),'account':_0x499f08[_0x2dab('0xc9')]['name'],'agent':_0x499f08[_0x2dab('0xca')]?_0x499f08[_0x2dab('0xca')][_0x2dab('0xc4')]:_0x2dab('0xce'),'createdAt':moment(_0x499f08['createdAt'])[_0x2dab('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2dab('0xa4')](),'closedAt':_0x499f08[_0x2dab('0xcf')]?moment(_0x499f08['closedAt'])[_0x2dab('0xb3')](_0x2dab('0xd0'))[_0x2dab('0xa4')]():'','disposition':_0x499f08[_0x2dab('0xd1')],'messages':_(_0x499f08[_0x2dab('0xd2')])[_0x2dab('0x80')]({'secret':![]})[_0x2dab('0x36')](function(_0x994f10){if(_0x994f10[_0x2dab('0xc7')]){var _0x3a2178=path[_0x2dab('0xc2')](_0x757c07,_0x994f10[_0x2dab('0xc7')][_0x2dab('0xd3')]);if(fs[_0x2dab('0xd4')](_0x3a2178)){fs['createReadStream'](_0x3a2178)[_0x2dab('0xd5')](fs[_0x2dab('0xd6')](path[_0x2dab('0xc2')](_0x12d08f,_0x994f10['Attachment'][_0x2dab('0xd3')])));}}return{'date':moment(_0x994f10[_0x2dab('0x73')])[_0x2dab('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x994f10[_0x2dab('0xd7')]===_0x2dab('0xd8')?_0x994f10[_0x2dab('0x67')]?_0x994f10[_0x2dab('0x67')][_0x2dab('0xc4')]:'System':_0x994f10[_0x2dab('0xd9')][_0x2dab('0xc6')]+(_0x994f10[_0x2dab('0xd9')][_0x2dab('0xda')]?'\x20'+_0x994f10[_0x2dab('0xd9')]['lastName']:''),'body':_0x994f10[_0x2dab('0xc7')]?_0x994f10[_0x2dab('0xc7')][_0x2dab('0xd3')]:_0x994f10['body'],'direction':_0x994f10['direction']===_0x2dab('0xd8')?'A':'C','secret':_0x994f10['secret'],'read':_0x994f10[_0x2dab('0x7c')],'attachment':_0x994f10['Attachment']};})[_0x2dab('0x5a')]()};return ejs[_0x2dab('0xdb')](path['join'](config['root'],_0x2dab('0xbe'),_0x2dab('0xdc'),'downloadInteraction.ejs'),{'interaction':_0x4b6f5a})[_0x2dab('0x2c')](function(_0x5d72f7){var _0x1d1a3e=path['join'](_0x12d08f,_0x2dab('0xdd')+_0x499f08['id']+'-'+_0x1343f0+_0x2dab('0xde'));var _0x2eb227={'path':_0x1d1a3e,'channel':_0x2dab('0xcd'),'interactionId':_0x499f08['id']};return pdf['createPdfFromHTML'](_0x5d72f7,_0x2eb227);})[_0x2dab('0x2c')](function(){return new BPromise(function(_0x2c2c44,_0x3f0319){zipdir(_0x12d08f,{'saveTo':_0x299813},function(_0x266eef,_0xf31bb5){if(_0x266eef)return _0x3f0319(_0x266eef);return _0x2c2c44(_0xf31bb5);});})[_0x2dab('0x2c')](function(){return new BPromise(function(_0x4eff68,_0x8686ff){rimraf(_0x12d08f,function(_0x4e2724){if(_0x4e2724)_0x8686ff(_0x4e2724);return _0x4eff68();});});})[_0x2dab('0x2c')](function(){return _0x50f854[_0x2dab('0xdf')](_0x299813,_0x1f8d48,function(_0x54144a){if(_0x54144a){console[_0x2dab('0xe0')]('err',_0x54144a);}else{fs[_0x2dab('0xe1')](_0x299813);}});});});}else{return _0x50f854[_0x2dab('0x1f')](0xc8);}})['catch'](handleError(_0x50f854,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 8ef49a2..f7a3d08 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8482=['length','emit','catch','hasOwnProperty','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','map','findAll','unreadMessages'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8482,0x14e));var _0x2848=function(_0xd05f31,_0x4e0301){_0xd05f31=_0xd05f31-0x0;var _0x2550a2=_0x8482[_0xd05f31];return _0x2550a2;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x2848('0x0'))['db'][_0x2848('0x1')];var WhatsappMessage=require(_0x2848('0x0'))['db'][_0x2848('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2848('0x3')](0x0);var events={'afterCreate':_0x2848('0x4'),'afterUpdate':_0x2848('0x5'),'afterDestroy':_0x2848('0x6')};function emitEvent(_0x467ee5){return function(_0x391cad,_0x5cc8e1,_0x1eb602){_0x391cad[_0x2848('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xeca507){_0x391cad['setDataValue']('Users',_0xeca507[_0x2848('0x8')](function(_0x582500){return{'id':_0x582500['id']};}));return WhatsappMessage[_0x2848('0x9')]({'where':{'WhatsappInteractionId':_0x391cad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5bcc65){_0x391cad['setDataValue'](_0x2848('0xa'),_0x5bcc65[_0x2848('0xb')]);WhatsappInteractionEvents[_0x2848('0xc')](_0x467ee5+':'+_0x391cad['id'],_0x391cad);WhatsappInteractionEvents[_0x2848('0xc')](_0x467ee5,_0x391cad);_0x1eb602(null);})[_0x2848('0xd')](_0x1eb602(null));};}for(var e in events){if(events[_0x2848('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x2a41=['update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x2fbbfc,_0x627e60){var _0x47d819=function(_0x271b64){while(--_0x271b64){_0x2fbbfc['push'](_0x2fbbfc['shift']());}};_0x47d819(++_0x627e60);}(_0x2a41,0x126));var _0x12a4=function(_0xa7879c,_0x4dc1d9){_0xa7879c=_0xa7879c-0x0;var _0x576d61=_0x2a41[_0xa7879c];return _0x576d61;};'use strict';var EventEmitter=require(_0x12a4('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x12a4('0x1')];var WhatsappMessage=require(_0x12a4('0x2'))['db'][_0x12a4('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x12a4('0x4')](0x0);var events={'afterCreate':_0x12a4('0x5'),'afterUpdate':_0x12a4('0x6'),'afterDestroy':_0x12a4('0x7')};function emitEvent(_0x28a00e){return function(_0x3ae504,_0x501fcf,_0x379b3c){_0x3ae504[_0x12a4('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d2353){_0x3ae504[_0x12a4('0x9')]('Users',_0x5d2353[_0x12a4('0xa')](function(_0x3eeef7){return{'id':_0x3eeef7['id']};}));return WhatsappMessage[_0x12a4('0xb')]({'where':{'WhatsappInteractionId':_0x3ae504['id'],'direction':'in','read':![]},'raw':!![]});})[_0x12a4('0xc')](function(_0x3d8beb){_0x3ae504['setDataValue'](_0x12a4('0xd'),_0x3d8beb[_0x12a4('0xe')]);WhatsappInteractionEvents[_0x12a4('0xf')](_0x28a00e+':'+_0x3ae504['id'],_0x3ae504);WhatsappInteractionEvents[_0x12a4('0xf')](_0x28a00e,_0x3ae504);_0x379b3c(null);})[_0x12a4('0x10')](_0x379b3c(null));};}for(var e in events){if(events[_0x12a4('0x11')](e)){var event=events[e];WhatsappInteraction[_0x12a4('0x12')](e,emitEvent(event));}}module[_0x12a4('0x13')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 6aaa5fc..41ae0c6 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50c2=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','../../config/environment','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x50c2,0x127));var _0x250c=function(_0x593c70,_0x1d60a4){_0x593c70=_0x593c70-0x0;var _0x22ed39=_0x50c2[_0x593c70];return _0x22ed39;};'use strict';var _=require('lodash');var util=require(_0x250c('0x0'));var logger=require(_0x250c('0x1'))(_0x250c('0x2'));var moment=require(_0x250c('0x3'));var BPromise=require(_0x250c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x250c('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0x250c('0x6')]=function(_0x4193f5,_0x1d015){return _0x4193f5['define'](_0x250c('0x7'),attributes,{'tableName':_0x250c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe728ba,_0x5a8ed6,_0x386b4e){if(_0xe728ba[_0x250c('0x9')](_0x250c('0xa'))){_0xe728ba[_0x250c('0xb')]=moment()[_0x250c('0xc')](_0x250c('0xd'));}_0x386b4e(null,_0xe728ba);}}});}; \ No newline at end of file +var _0xd94b=['rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x968e1c,_0x3ef68b){var _0x3dd45e=function(_0x1301c5){while(--_0x1301c5){_0x968e1c['push'](_0x968e1c['shift']());}};_0x3dd45e(++_0x3ef68b);}(_0xd94b,0xbf));var _0xbd94=function(_0x208cf0,_0x486665){_0x208cf0=_0x208cf0-0x0;var _0x372d0d=_0xd94b[_0x208cf0];return _0x372d0d;};'use strict';var _=require(_0xbd94('0x0'));var util=require(_0xbd94('0x1'));var logger=require(_0xbd94('0x2'))(_0xbd94('0x3'));var moment=require('moment');var BPromise=require(_0xbd94('0x4'));var rp=require(_0xbd94('0x5'));var fs=require('fs');var path=require(_0xbd94('0x6'));var rimraf=require(_0xbd94('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd94('0x8'));module[_0xbd94('0x9')]=function(_0x3191da,_0x2f5b16){return _0x3191da[_0xbd94('0xa')](_0xbd94('0xb'),attributes,{'tableName':_0xbd94('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20635d,_0x4aa203,_0x329624){if(_0x20635d[_0xbd94('0xd')](_0xbd94('0xe'))){_0x20635d[_0xbd94('0xf')]=moment()[_0xbd94('0x10')](_0xbd94('0x11'));}_0x329624(null,_0x20635d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index b8b399f..e17d118 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf20b=['where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','attributes','limit','AddTagsToWhatsappInteraction','find'];(function(_0x1eafd0,_0x4acc2b){var _0x380d80=function(_0xe4f991){while(--_0xe4f991){_0x1eafd0['push'](_0x1eafd0['shift']());}};_0x380d80(++_0x4acc2b);}(_0xf20b,0xb6));var _0xbf20=function(_0x11cbfc,_0x963bec){_0x11cbfc=_0x11cbfc-0x0;var _0x76f4e2=_0xf20b[_0x11cbfc];return _0x76f4e2;};'use strict';var _=require(_0xbf20('0x0'));var util=require(_0xbf20('0x1'));var moment=require('moment');var BPromise=require(_0xbf20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf20('0x3'));var db=require(_0xbf20('0x4'))['db'];var utils=require(_0xbf20('0x5'));var logger=require(_0xbf20('0x6'))(_0xbf20('0x7'));var config=require(_0xbf20('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf20('0x9')][_0xbf20('0xa')]({'port':0x232a});config[_0xbf20('0xb')]=_[_0xbf20('0xc')](config[_0xbf20('0xb')],{'host':_0xbf20('0xd'),'port':0x18eb});var socket=require(_0xbf20('0xe'))(new Redis(config[_0xbf20('0xb')]));require(_0xbf20('0xf'))[_0xbf20('0x10')](socket);function respondWithRpcPromise(_0x4037a9,_0x4c49c1,_0x3cfbe2){return new BPromise(function(_0x59ba3a,_0x386ee0){return client[_0xbf20('0x11')](_0x4037a9,_0x3cfbe2)[_0xbf20('0x12')](function(_0x4cb1cd){logger[_0xbf20('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x4c49c1,_0xbf20('0x14'));logger[_0xbf20('0x15')](_0xbf20('0x16'),_0x4c49c1,_0xbf20('0x14'),JSON[_0xbf20('0x17')](_0x4cb1cd));if(_0x4cb1cd[_0xbf20('0x18')]){if(_0x4cb1cd['error']['code']===0x1f4){logger[_0xbf20('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x4c49c1,_0x4cb1cd[_0xbf20('0x18')][_0xbf20('0x19')]);return _0x386ee0(_0x4cb1cd[_0xbf20('0x18')][_0xbf20('0x19')]);}logger[_0xbf20('0x18')](_0xbf20('0x1a'),_0x4c49c1,_0x4cb1cd[_0xbf20('0x18')][_0xbf20('0x19')]);return _0x59ba3a(_0x4cb1cd['error'][_0xbf20('0x19')]);}else{logger[_0xbf20('0x13')](_0xbf20('0x1a'),_0x4c49c1,_0xbf20('0x14'));_0x59ba3a(_0x4cb1cd[_0xbf20('0x1b')][_0xbf20('0x19')]);}})[_0xbf20('0x1c')](function(_0x289f04){logger['error'](_0xbf20('0x1a'),_0x4c49c1,_0x289f04);_0x386ee0(_0x289f04);});});}exports[_0xbf20('0x1d')]=function(_0x38324a){var _0x1228e5=this;return new Promise(function(_0x32b31b,_0x14f186){return db[_0xbf20('0x1e')]['update'](_0x38324a[_0xbf20('0x1f')],{'raw':_0x38324a[_0xbf20('0x20')]?_0x38324a[_0xbf20('0x20')][_0xbf20('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38324a[_0xbf20('0x20')]?_0x38324a[_0xbf20('0x20')]['where']||null:null,'attributes':_0x38324a[_0xbf20('0x20')]?_0x38324a[_0xbf20('0x20')][_0xbf20('0x22')]||null:null,'limit':_0x38324a[_0xbf20('0x20')]?_0x38324a[_0xbf20('0x20')][_0xbf20('0x23')]||null:null})['then'](function(_0xa2917){logger[_0xbf20('0x13')]('UpdateWhatsappInteraction',_0x38324a);logger[_0xbf20('0x15')](_0xbf20('0x1d'),_0x38324a,JSON[_0xbf20('0x17')](_0xa2917));_0x32b31b(_0xa2917);})[_0xbf20('0x1c')](function(_0x3b68b6){logger['error'](_0xbf20('0x1d'),_0x3b68b6[_0xbf20('0x19')],_0x38324a);_0x14f186(_0x1228e5[_0xbf20('0x18')](0x1f4,_0x3b68b6[_0xbf20('0x19')]));});});};exports[_0xbf20('0x24')]=function(_0x100621){return new Promise(function(_0x48d760,_0x3e3354){return db[_0xbf20('0x1e')][_0xbf20('0x25')]({'where':_0x100621[_0xbf20('0x20')]?_0x100621[_0xbf20('0x20')][_0xbf20('0x26')]||null:null})[_0xbf20('0x12')](function(_0x56a6d0){if(_0x56a6d0){return _0x56a6d0[_0xbf20('0x27')](_0x100621[_0xbf20('0x1f')][_0xbf20('0x28')],_[_0xbf20('0x29')](_0x100621[_0xbf20('0x1f')],[_0xbf20('0x28'),'id'])||{});}})[_0xbf20('0x2a')](function(_0x1ff07d){logger[_0xbf20('0x13')](_0xbf20('0x2b'),_0x100621);logger[_0xbf20('0x15')](_0xbf20('0x2b'),_0x100621,JSON['stringify'](_0x1ff07d));_0x48d760(_0x1ff07d);})[_0xbf20('0x1c')](function(_0x203394){logger[_0xbf20('0x18')](_0xbf20('0x2b'),_0x203394[_0xbf20('0x19')],_0x100621);_0x3e3354(_this[_0xbf20('0x18')](0x1f4,_0x203394['message']));});});}; \ No newline at end of file +var _0x2492=['body','options','raw','where','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0x2492,0xa8));var _0x2249=function(_0x4d6050,_0x546494){_0x4d6050=_0x4d6050-0x0;var _0x316a70=_0x2492[_0x4d6050];return _0x316a70;};'use strict';var _=require(_0x2249('0x0'));var util=require('util');var moment=require(_0x2249('0x1'));var BPromise=require(_0x2249('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2249('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2249('0x4'));var logger=require(_0x2249('0x5'))(_0x2249('0x6'));var config=require('../../config/environment');var jayson=require(_0x2249('0x7'));var client=jayson[_0x2249('0x8')]['http']({'port':0x232a});config[_0x2249('0x9')]=_['defaults'](config['redis'],{'host':_0x2249('0xa'),'port':0x18eb});var socket=require(_0x2249('0xb'))(new Redis(config[_0x2249('0x9')]));require(_0x2249('0xc'))[_0x2249('0xd')](socket);function respondWithRpcPromise(_0x45f78f,_0x3acb5e,_0x5d1ff3){return new BPromise(function(_0x22acec,_0x28c332){return client[_0x2249('0xe')](_0x45f78f,_0x5d1ff3)[_0x2249('0xf')](function(_0x59531f){logger[_0x2249('0x10')](_0x2249('0x11'),_0x3acb5e,_0x2249('0x12'));logger[_0x2249('0x13')](_0x2249('0x14'),_0x3acb5e,_0x2249('0x12'),JSON[_0x2249('0x15')](_0x59531f));if(_0x59531f[_0x2249('0x16')]){if(_0x59531f[_0x2249('0x16')]['code']===0x1f4){logger[_0x2249('0x16')](_0x2249('0x11'),_0x3acb5e,_0x59531f[_0x2249('0x16')][_0x2249('0x17')]);return _0x28c332(_0x59531f[_0x2249('0x16')][_0x2249('0x17')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3acb5e,_0x59531f['error'][_0x2249('0x17')]);return _0x22acec(_0x59531f[_0x2249('0x16')]['message']);}else{logger[_0x2249('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x3acb5e,_0x2249('0x12'));_0x22acec(_0x59531f[_0x2249('0x18')]['message']);}})[_0x2249('0x19')](function(_0x5ebc5a){logger[_0x2249('0x16')](_0x2249('0x11'),_0x3acb5e,_0x5ebc5a);_0x28c332(_0x5ebc5a);});});}exports['UpdateWhatsappInteraction']=function(_0x1cf401){var _0x34a499=this;return new Promise(function(_0x33456b,_0x2f57f9){return db['WhatsappInteraction'][_0x2249('0x1a')](_0x1cf401[_0x2249('0x1b')],{'raw':_0x1cf401[_0x2249('0x1c')]?_0x1cf401[_0x2249('0x1c')][_0x2249('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cf401[_0x2249('0x1c')]?_0x1cf401[_0x2249('0x1c')][_0x2249('0x1e')]||null:null,'attributes':_0x1cf401[_0x2249('0x1c')]?_0x1cf401[_0x2249('0x1c')]['attributes']||null:null,'limit':_0x1cf401[_0x2249('0x1c')]?_0x1cf401[_0x2249('0x1c')]['limit']||null:null})['then'](function(_0x4ddf85){logger[_0x2249('0x10')](_0x2249('0x1f'),_0x1cf401);logger[_0x2249('0x13')](_0x2249('0x1f'),_0x1cf401,JSON[_0x2249('0x15')](_0x4ddf85));_0x33456b(_0x4ddf85);})['catch'](function(_0x4dd7d8){logger[_0x2249('0x16')](_0x2249('0x1f'),_0x4dd7d8['message'],_0x1cf401);_0x2f57f9(_0x34a499[_0x2249('0x16')](0x1f4,_0x4dd7d8[_0x2249('0x17')]));});});};exports[_0x2249('0x20')]=function(_0x3bce3c){return new Promise(function(_0x1c482c,_0x2f4ebc){return db[_0x2249('0x21')]['find']({'where':_0x3bce3c[_0x2249('0x1c')]?_0x3bce3c['options'][_0x2249('0x1e')]||null:null})['then'](function(_0x46c759){if(_0x46c759){return _0x46c759[_0x2249('0x22')](_0x3bce3c[_0x2249('0x1b')][_0x2249('0x23')],_[_0x2249('0x24')](_0x3bce3c['body'],['ids','id'])||{});}})[_0x2249('0x25')](function(_0x20b65e){logger[_0x2249('0x10')]('AddTags',_0x3bce3c);logger['debug'](_0x2249('0x26'),_0x3bce3c,JSON['stringify'](_0x20b65e));_0x1c482c(_0x20b65e);})[_0x2249('0x19')](function(_0x1e7b1a){logger[_0x2249('0x16')](_0x2249('0x26'),_0x1e7b1a[_0x2249('0x17')],_0x3bce3c);_0x2f4ebc(_this[_0x2249('0x16')](0x1f4,_0x1e7b1a[_0x2249('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 757cac6..1f15006 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9f0=['register','./whatsappInteraction.events','save','remove','update'];(function(_0x51f729,_0x4dbd66){var _0x7b6c1f=function(_0x47aa26){while(--_0x47aa26){_0x51f729['push'](_0x51f729['shift']());}};_0x7b6c1f(++_0x4dbd66);}(_0xf9f0,0x128));var _0x0f9f=function(_0x35ffd6,_0x3f8195){_0x35ffd6=_0x35ffd6-0x0;var _0x2dd178=_0xf9f0[_0x35ffd6];return _0x2dd178;};'use strict';var WhatsappInteractionEvents=require(_0x0f9f('0x0'));var events=[_0x0f9f('0x1'),_0x0f9f('0x2'),_0x0f9f('0x3')];function createListener(_0x4b9707,_0x22563c){return function(_0x5acbb7){_0x22563c['emit'](_0x4b9707,_0x5acbb7);};}function removeListener(_0x38c304,_0x3a0c77){return function(){WhatsappInteractionEvents['removeListener'](_0x38c304,_0x3a0c77);};}exports[_0x0f9f('0x4')]=function(_0x3af967){for(var _0x5a9b66=0x0,_0x1780a4=events['length'];_0x5a9b66<_0x1780a4;_0x5a9b66++){var _0x39b554=events[_0x5a9b66];var _0x4ab0a1=createListener('whatsappInteraction:'+_0x39b554,_0x3af967);WhatsappInteractionEvents['on'](_0x39b554,_0x4ab0a1);}}; \ No newline at end of file +var _0x488f=['./whatsappInteraction.events','remove','update','length'];(function(_0x73689d,_0x3a378a){var _0x5c2417=function(_0x2a683d){while(--_0x2a683d){_0x73689d['push'](_0x73689d['shift']());}};_0x5c2417(++_0x3a378a);}(_0x488f,0x6c));var _0xf488=function(_0x6f7cb1,_0xbf8f8e){_0x6f7cb1=_0x6f7cb1-0x0;var _0x535a2d=_0x488f[_0x6f7cb1];return _0x535a2d;};'use strict';var WhatsappInteractionEvents=require(_0xf488('0x0'));var events=['save',_0xf488('0x1'),_0xf488('0x2')];function createListener(_0x44a6ad,_0x1678ed){return function(_0x2115e0){_0x1678ed['emit'](_0x44a6ad,_0x2115e0);};}function removeListener(_0x57d326,_0x5d988e){return function(){WhatsappInteractionEvents['removeListener'](_0x57d326,_0x5d988e);};}exports['register']=function(_0x3c0370){for(var _0x1240fb=0x0,_0x368d05=events[_0xf488('0x3')];_0x1240fb<_0x368d05;_0x1240fb++){var _0x35ea6e=events[_0x1240fb];var _0x251d18=createListener('whatsappInteraction:'+_0x35ea6e,_0x3c0370);WhatsappInteractionEvents['on'](_0x35ea6e,_0x251d18);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 85acf69..1f7db99 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ad=['accept','/:id/reject','delete','destroy','exports','multer','util','express','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index','get','/describe','isAuthenticated','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id','update','/:id/accept'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x84ad,0xbb));var _0xd84a=function(_0x101134,_0x1ed1d3){_0x101134=_0x101134-0x0;var _0xc47acc=_0x84ad[_0x101134];return _0xc47acc;};'use strict';var multer=require(_0xd84a('0x0'));var util=require(_0xd84a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd84a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd84a('0x3'));var config=require(_0xd84a('0x4'));var controller=require(_0xd84a('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd84a('0x6')]);router[_0xd84a('0x7')](_0xd84a('0x8'),auth[_0xd84a('0x9')](),controller['describe']);router[_0xd84a('0x7')]('/:id',auth[_0xd84a('0x9')](),controller[_0xd84a('0xa')]);router[_0xd84a('0xb')]('/',auth[_0xd84a('0x9')](),interaction[_0xd84a('0xc')](_0xd84a('0xd'),_0xd84a('0xe')),controller['create']);router['post'](_0xd84a('0xf'),controller[_0xd84a('0x10')]);router[_0xd84a('0x11')](_0xd84a('0x12'),auth[_0xd84a('0x9')](),controller[_0xd84a('0x13')]);router[_0xd84a('0x11')](_0xd84a('0x14'),auth[_0xd84a('0x9')](),controller[_0xd84a('0x15')]);router[_0xd84a('0x11')](_0xd84a('0x16'),auth[_0xd84a('0x9')](),controller['reject']);router[_0xd84a('0x17')]('/:id',auth[_0xd84a('0x9')](),controller[_0xd84a('0x18')]);module[_0xd84a('0x19')]=router; \ No newline at end of file +var _0x7ab1=['whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','describe','/:id','show','post','whatsapp'];(function(_0xba43fa,_0x2589c3){var _0x5befaa=function(_0x241a6b){while(--_0x241a6b){_0xba43fa['push'](_0xba43fa['shift']());}};_0x5befaa(++_0x2589c3);}(_0x7ab1,0x1d5));var _0x17ab=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x7ab1[_0x1f9f37];return _0x21c080;};'use strict';var multer=require(_0x17ab('0x0'));var util=require(_0x17ab('0x1'));var path=require(_0x17ab('0x2'));var timeout=require('connect-timeout');var express=require(_0x17ab('0x3'));var router=express[_0x17ab('0x4')]();var fs_extra=require(_0x17ab('0x5'));var auth=require(_0x17ab('0x6'));var interaction=require(_0x17ab('0x7'));var config=require(_0x17ab('0x8'));var controller=require(_0x17ab('0x9'));router[_0x17ab('0xa')]('/',auth[_0x17ab('0xb')](),controller['index']);router['get']('/describe',auth[_0x17ab('0xb')](),controller[_0x17ab('0xc')]);router[_0x17ab('0xa')](_0x17ab('0xd'),auth[_0x17ab('0xb')](),controller[_0x17ab('0xe')]);router[_0x17ab('0xf')]('/',auth[_0x17ab('0xb')](),interaction['tracked'](_0x17ab('0x10'),_0x17ab('0x11')),controller[_0x17ab('0x12')]);router[_0x17ab('0xf')](_0x17ab('0x13'),controller[_0x17ab('0x14')]);router[_0x17ab('0x15')](_0x17ab('0xd'),auth[_0x17ab('0xb')](),controller[_0x17ab('0x16')]);router['put'](_0x17ab('0x17'),auth[_0x17ab('0xb')](),controller['accept']);router[_0x17ab('0x15')](_0x17ab('0x18'),auth[_0x17ab('0xb')](),controller[_0x17ab('0x19')]);router[_0x17ab('0x1a')](_0x17ab('0xd'),auth[_0x17ab('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f5f9cf4..38bc2b9 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x510e=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x510e,0x1ed));var _0xe510=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x510e[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0xe510('0x0'));module[_0xe510('0x1')]={'body':{'type':Sequelize[_0xe510('0x2')](_0xe510('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe510('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe510('0x5')]('in',_0xe510('0x6')),'defaultValue':_0xe510('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe510('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe510('0x8')]},'secret':{'type':Sequelize[_0xe510('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe510('0x7')]},'providerResponse':{'type':Sequelize[_0xe510('0x2')]}}; \ No newline at end of file +var _0x7ece=['ENUM','out','STRING','exports','TEXT','BOOLEAN'];(function(_0x4d5d28,_0x26bd9b){var _0x2026b1=function(_0x1fe42c){while(--_0x1fe42c){_0x4d5d28['push'](_0x4d5d28['shift']());}};_0x2026b1(++_0x26bd9b);}(_0x7ece,0xc9));var _0xe7ec=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7ece[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0xe7ec('0x0')]={'body':{'type':Sequelize[_0xe7ec('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe7ec('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe7ec('0x3')]('in',_0xe7ec('0x4')),'defaultValue':_0xe7ec('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe7ec('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe7ec('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe7ec('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e0349b7..0bde452 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f00=['destroy','name','send','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','fields','includeAll','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','QueryTypes','User','fullname','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update'];(function(_0x3dcc89,_0x49a878){var _0xcb0f2a=function(_0x2cec9f){while(--_0x2cec9f){_0x3dcc89['push'](_0x3dcc89['shift']());}};_0xcb0f2a(++_0x49a878);}(_0x7f00,0x161));var _0x07f0=function(_0x4e8d75,_0x400022){_0x4e8d75=_0x4e8d75-0x0;var _0x3329d6=_0x7f00[_0x4e8d75];return _0x3329d6;};'use strict';var emlformat=require(_0x07f0('0x0'));var rimraf=require(_0x07f0('0x1'));var zipdir=require(_0x07f0('0x2'));var jsonpatch=require(_0x07f0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x07f0('0x4'));var Mustache=require(_0x07f0('0x5'));var util=require(_0x07f0('0x6'));var path=require(_0x07f0('0x7'));var sox=require(_0x07f0('0x8'));var csv=require(_0x07f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07f0('0xa'));var _=require(_0x07f0('0xb'));var squel=require(_0x07f0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x07f0('0xd'));var toCsv=require(_0x07f0('0x9'));var querystring=require(_0x07f0('0xe'));var Papa=require('papaparse');var Redis=require(_0x07f0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x07f0('0x10'));var as=require(_0x07f0('0x11'));var hardwareService=require(_0x07f0('0x12'));var logger=require(_0x07f0('0x13'))(_0x07f0('0x14'));var utils=require(_0x07f0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x07f0('0x16')](config[_0x07f0('0x17')],{'host':_0x07f0('0x18'),'port':0x18eb});var socket=require(_0x07f0('0x19'))(new Redis(config[_0x07f0('0x17')]));require(_0x07f0('0x1a'))['register'](socket);var jayson=require(_0x07f0('0x1b'));var client=jayson['client'][_0x07f0('0x1c')]({'port':0x232c});var client9002=jayson[_0x07f0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3ecd,_0x51a77c,_0x515443,_0x394d46){return new BPromise(function(_0x2e5b8d,_0xeed91d){var _0xa2a9e2=_0x394d46||client;return _0xa2a9e2[_0x07f0('0x1e')](_0x1f3ecd,_0x515443)[_0x07f0('0x1f')](function(_0x8d6469){logger[_0x07f0('0x20')](_0x07f0('0x21'),_0x51a77c,'request\x20sent');logger[_0x07f0('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x51a77c,_0x07f0('0x23'),JSON[_0x07f0('0x24')](_0x8d6469));if(_0x8d6469[_0x07f0('0x25')]){if(_0x8d6469[_0x07f0('0x25')][_0x07f0('0x26')]===0x1f4){logger[_0x07f0('0x25')](_0x07f0('0x21'),_0x51a77c,_0x8d6469[_0x07f0('0x25')]['message']);return _0xeed91d(_0x8d6469[_0x07f0('0x25')][_0x07f0('0x27')]);}logger[_0x07f0('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x51a77c,_0x8d6469['error'][_0x07f0('0x27')]);return _0x2e5b8d(_0x8d6469[_0x07f0('0x25')][_0x07f0('0x27')]);}else{logger[_0x07f0('0x20')](_0x07f0('0x21'),_0x51a77c,_0x07f0('0x23'));_0x2e5b8d(_0x8d6469[_0x07f0('0x28')][_0x07f0('0x27')]);}})[_0x07f0('0x29')](function(_0x1330b3){logger['error'](_0x07f0('0x21'),_0x51a77c,_0x1330b3);_0xeed91d(_0x1330b3);});});}function respondWithStatusCode(_0x361f24,_0x1cfe52){_0x1cfe52=_0x1cfe52||0xcc;return function(_0x4d06b9){if(_0x4d06b9){return _0x361f24[_0x07f0('0x2a')](_0x1cfe52);}return _0x361f24[_0x07f0('0x2b')](_0x1cfe52)[_0x07f0('0x2c')]();};}function respondWithResult(_0x2fbd3f,_0x6ad449){_0x6ad449=_0x6ad449||0xc8;return function(_0x433f5f){if(_0x433f5f){return _0x2fbd3f[_0x07f0('0x2b')](_0x6ad449)[_0x07f0('0x2d')](_0x433f5f);}};}function respondWithFilteredResult(_0x305fe1,_0x46377b){return function(_0x2086c1){if(_0x2086c1){var _0x12029e=typeof _0x46377b['offset']===_0x07f0('0x2e')&&typeof _0x46377b[_0x07f0('0x2f')]==='undefined';var _0x3580b4=_0x2086c1[_0x07f0('0x30')];var _0x502614=_0x12029e?0x0:_0x46377b['offset'];var _0x2c4c92=_0x12029e?_0x2086c1[_0x07f0('0x30')]:_0x46377b[_0x07f0('0x31')]+_0x46377b[_0x07f0('0x2f')];var _0x15afab;if(_0x2c4c92>=_0x3580b4){_0x2c4c92=_0x3580b4;_0x15afab=0xc8;}else{_0x15afab=0xce;}_0x305fe1[_0x07f0('0x2b')](_0x15afab);return _0x305fe1[_0x07f0('0x32')]('Content-Range',_0x502614+'-'+_0x2c4c92+'/'+_0x3580b4)[_0x07f0('0x2d')](_0x2086c1);}return null;};}function patchUpdates(_0x21003a){return function(_0x300abd){try{jsonpatch[_0x07f0('0x33')](_0x300abd,_0x21003a,!![]);}catch(_0x379c2b){return BPromise[_0x07f0('0x34')](_0x379c2b);}return _0x300abd[_0x07f0('0x35')]();};}function saveUpdates(_0x1477b0,_0x16821a){return function(_0x56a151){if(_0x56a151){return _0x56a151[_0x07f0('0x36')](_0x1477b0)['then'](function(_0x191878){return _0x191878;});}return null;};}function removeEntity(_0x25d988,_0xe64624){return function(_0x3c20cc){if(_0x3c20cc){return _0x3c20cc[_0x07f0('0x37')]()['then'](function(){_0x25d988['status'](0xcc)[_0x07f0('0x2c')]();});}};}function handleEntityNotFound(_0x3bc4dc,_0xe8b3bd){return function(_0x28f3c9){if(!_0x28f3c9){_0x3bc4dc[_0x07f0('0x2a')](0x194);}return _0x28f3c9;};}function handleError(_0xbd7ac,_0x487fd8){_0x487fd8=_0x487fd8||0x1f4;return function(_0x594614){logger[_0x07f0('0x25')](_0x594614['stack']);if(_0x594614[_0x07f0('0x38')]){delete _0x594614[_0x07f0('0x38')];}_0xbd7ac[_0x07f0('0x2b')](_0x487fd8)[_0x07f0('0x39')](_0x594614);};}exports['index']=function(_0x101906,_0x5c7e80){var _0xc814c3={},_0x3072fb={},_0x35fbb3={'count':0x0,'rows':[]};var _0x37e12c=_['map'](db[_0x07f0('0x3a')][_0x07f0('0x3b')],function(_0x36a039){return{'name':_0x36a039[_0x07f0('0x3c')],'type':_0x36a039[_0x07f0('0x3d')][_0x07f0('0x3e')]};});_0x3072fb[_0x07f0('0x3f')]=_[_0x07f0('0x40')](_0x37e12c,_0x07f0('0x38'));_0x3072fb[_0x07f0('0x41')]=_[_0x07f0('0x42')](_0x101906[_0x07f0('0x41')]);_0x3072fb[_0x07f0('0x43')]=_[_0x07f0('0x44')](_0x3072fb[_0x07f0('0x3f')],_0x3072fb[_0x07f0('0x41')]);_0xc814c3[_0x07f0('0x45')]=_[_0x07f0('0x44')](_0x3072fb[_0x07f0('0x3f')],qs['fields'](_0x101906[_0x07f0('0x41')]['fields']));_0xc814c3[_0x07f0('0x45')]=_0xc814c3[_0x07f0('0x45')][_0x07f0('0x46')]?_0xc814c3[_0x07f0('0x45')]:_0x3072fb['model'];if(!_0x101906['query']['hasOwnProperty'](_0x07f0('0x47'))){_0xc814c3[_0x07f0('0x2f')]=qs[_0x07f0('0x2f')](_0x101906[_0x07f0('0x41')]['limit']);_0xc814c3['offset']=qs['offset'](_0x101906[_0x07f0('0x41')][_0x07f0('0x31')]);}_0xc814c3[_0x07f0('0x48')]=qs[_0x07f0('0x49')](_0x101906[_0x07f0('0x41')][_0x07f0('0x49')]);_0xc814c3['where']=qs[_0x07f0('0x43')](_[_0x07f0('0x4a')](_0x101906[_0x07f0('0x41')],_0x3072fb[_0x07f0('0x43')]),_0x37e12c);if(_0x101906[_0x07f0('0x41')][_0x07f0('0x4b')]){_0xc814c3[_0x07f0('0x4c')]=_[_0x07f0('0x4d')](_0xc814c3[_0x07f0('0x4c')],{'$or':_[_0x07f0('0x40')](_0x37e12c,function(_0x55540f){if(_0x55540f[_0x07f0('0x3d')]!==_0x07f0('0x4e')){var _0x2be002={};_0x2be002[_0x55540f[_0x07f0('0x38')]]={'$like':'%'+_0x101906[_0x07f0('0x41')][_0x07f0('0x4b')]+'%'};return _0x2be002;}})});}_0xc814c3=_[_0x07f0('0x4d')]({},_0xc814c3,_0x101906[_0x07f0('0x4f')]);var _0x43a559={'where':_0xc814c3[_0x07f0('0x4c')]};return db[_0x07f0('0x3a')][_0x07f0('0x30')](_0x43a559)[_0x07f0('0x1f')](function(_0x4231f8){_0x35fbb3['count']=_0x4231f8;if(_0x101906['query']['includeAll']){_0xc814c3[_0x07f0('0x50')]=[{'all':!![]}];}return db[_0x07f0('0x3a')][_0x07f0('0x51')](_0xc814c3);})[_0x07f0('0x1f')](function(_0x146c33){_0x35fbb3['rows']=_0x146c33;return _0x35fbb3;})[_0x07f0('0x1f')](respondWithFilteredResult(_0x5c7e80,_0xc814c3))['catch'](handleError(_0x5c7e80,null));};exports[_0x07f0('0x52')]=function(_0x7a36f5,_0x526eb7){var _0x2382f7={'raw':!![],'where':{'id':_0x7a36f5[_0x07f0('0x53')]['id']}},_0x24e3e1={};_0x24e3e1[_0x07f0('0x3f')]=_['keys'](db['WhatsappMessage'][_0x07f0('0x3b')]);_0x24e3e1['query']=_[_0x07f0('0x42')](_0x7a36f5[_0x07f0('0x41')]);_0x24e3e1[_0x07f0('0x43')]=_['intersection'](_0x24e3e1['model'],_0x24e3e1['query']);_0x2382f7['attributes']=_[_0x07f0('0x44')](_0x24e3e1[_0x07f0('0x3f')],qs[_0x07f0('0x54')](_0x7a36f5[_0x07f0('0x41')][_0x07f0('0x54')]));_0x2382f7[_0x07f0('0x45')]=_0x2382f7[_0x07f0('0x45')]['length']?_0x2382f7[_0x07f0('0x45')]:_0x24e3e1[_0x07f0('0x3f')];if(_0x7a36f5[_0x07f0('0x41')][_0x07f0('0x55')]){_0x2382f7[_0x07f0('0x50')]=[{'all':!![]}];}_0x2382f7=_[_0x07f0('0x4d')]({},_0x2382f7,_0x7a36f5[_0x07f0('0x4f')]);return db[_0x07f0('0x3a')][_0x07f0('0x56')](_0x2382f7)[_0x07f0('0x1f')](handleEntityNotFound(_0x526eb7,null))['then'](respondWithResult(_0x526eb7,null))['catch'](handleError(_0x526eb7,null));};exports[_0x07f0('0x57')]=function(_0x20e38f,_0x38389f){return db[_0x07f0('0x3a')]['create'](_0x20e38f[_0x07f0('0x58')],{})[_0x07f0('0x1f')](respondWithResult(_0x38389f,0xc9))['catch'](handleError(_0x38389f,null));};exports['update']=function(_0x82ac74,_0x383327){if(_0x82ac74['body']['id']){delete _0x82ac74[_0x07f0('0x58')]['id'];}return db['WhatsappMessage'][_0x07f0('0x56')]({'where':{'id':_0x82ac74['params']['id']}})['then'](handleEntityNotFound(_0x383327,null))[_0x07f0('0x1f')](saveUpdates(_0x82ac74[_0x07f0('0x58')],null))['then'](respondWithResult(_0x383327,null))[_0x07f0('0x29')](handleError(_0x383327,null));};exports[_0x07f0('0x37')]=function(_0x51503d,_0x121209){return db[_0x07f0('0x3a')]['find']({'where':{'id':_0x51503d[_0x07f0('0x53')]['id']}})[_0x07f0('0x1f')](handleEntityNotFound(_0x121209,null))['then'](removeEntity(_0x121209,null))[_0x07f0('0x29')](handleError(_0x121209,null));};exports[_0x07f0('0x59')]=function(_0x2385e6,_0x6b314f){return db[_0x07f0('0x3a')][_0x07f0('0x59')]()[_0x07f0('0x1f')](respondWithResult(_0x6b314f,null))['catch'](handleError(_0x6b314f,null));};var interaction_log=require(_0x07f0('0x13'))(_0x07f0('0x5a'));exports[_0x07f0('0x5b')]=function(_0x34c0be,_0xb52ac7,_0x2d25a2){var _0x36aab2={'agent':{},'channel':_0x07f0('0x5c')};if(_0x34c0be[_0x07f0('0x58')]['id']){delete _0x34c0be['body']['id'];}_0x34c0be[_0x07f0('0x58')][_0x07f0('0x5d')]=!![];_0x34c0be['body'][_0x07f0('0x5e')]=moment()[_0x07f0('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x34c0be['body'][_0x07f0('0x60')]=_0x34c0be[_0x07f0('0x58')][_0x07f0('0x60')]||_0x34c0be['user']['id'];_0x36aab2[_0x07f0('0x61')]['id']=_0x34c0be['body']['UserId'];return db[_0x07f0('0x3a')][_0x07f0('0x56')]({'where':{'id':_0x34c0be[_0x07f0('0x53')]['id'],'UserId':null}})[_0x07f0('0x1f')](handleEntityNotFound(_0xb52ac7,null))[_0x07f0('0x1f')](saveUpdates(_0x34c0be[_0x07f0('0x58')],null))['then'](function(_0x218229){if(_0x218229){_0x36aab2[_0x07f0('0x27')]=_0x218229[_0x07f0('0x62')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x218229[_0x07f0('0x63')]}});}return null;})[_0x07f0('0x1f')](handleEntityNotFound(_0xb52ac7,null))[_0x07f0('0x1f')](function(_0x103a44){if(_0x103a44){return _0x103a44[_0x07f0('0x36')]({'UserId':_0x34c0be[_0x07f0('0x58')][_0x07f0('0x60')],'read1stAt':_[_0x07f0('0x64')](_0x103a44[_0x07f0('0x65')])?moment()[_0x07f0('0x5f')](_0x07f0('0x66')):undefined});}return null;})[_0x07f0('0x1f')](function(_0x49aec6){if(_0x49aec6){_0x36aab2[_0x07f0('0x67')]=_0x49aec6[_0x07f0('0x62')]({'plain':!![]});interaction_log[_0x07f0('0x20')](_0x07f0('0x68'),_0x34c0be[_0x07f0('0x69')]['id'],_0x34c0be[_0x07f0('0x69')][_0x07f0('0x38')],_0x34c0be[_0x07f0('0x69')]['role'],_0x36aab2['interaction']['id'],_0x34c0be[_0x07f0('0x58')]?JSON[_0x07f0('0x24')](_0x34c0be[_0x07f0('0x58')]):_0x07f0('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x07f0('0x6b'),_0x36aab2);}return null;})[_0x07f0('0x1f')](function(_0x77b4ce){var _0x18606c=_0x07f0('0x6c')+_0x77b4ce[_0x07f0('0x27')][_0x07f0('0x6d')];return db[_0x07f0('0x6e')][_0x07f0('0x41')](_0x18606c,{'type':db[_0x07f0('0x6f')]['QueryTypes'][_0x07f0('0x70')],'raw':!![]})[_0x07f0('0x1f')](function(_0x1dec53){return _0x1dec53;});})[_0x07f0('0x1f')](function(_0x2410e9){if(_0x2410e9){_0x36aab2[_0x07f0('0x27')]['contact']=_0x2410e9[0x0];if(!_0x34c0be[_0x07f0('0x58')][_0x07f0('0x60')])return;return db['User'][_0x07f0('0x56')]({'where':{'id':_0x34c0be[_0x07f0('0x58')][_0x07f0('0x60')],'role':'agent'},'attributes':['id',_0x07f0('0x38'),'fullname',_0x07f0('0x71'),_0x07f0('0x72')],'raw':!![]});}return null;})[_0x07f0('0x1f')](function(_0x9f7912){if(!_0x9f7912)return null;_0x36aab2[_0x07f0('0x27')][_0x07f0('0x61')]=_0x9f7912;return _0x36aab2;})[_0x07f0('0x1f')](function(_0x4d0e41){if(_0x4d0e41){if(_0x34c0be[_0x07f0('0x58')][_0x07f0('0x73')]){_0x36aab2[_0x07f0('0x27')][_0x07f0('0x74')]=util[_0x07f0('0x5f')](_0x07f0('0x75'),_0x34c0be[_0x07f0('0x69')][_0x07f0('0x38')]);_0x36aab2[_0x07f0('0x27')][_0x07f0('0x76')]=_0x36aab2['channel'];_0x36aab2[_0x07f0('0x27')][_0x07f0('0x77')]='accept';return respondWithRpcPromise(_0x07f0('0x78'),_0x07f0('0x78'),{'event':_0x07f0('0x79'),'message':_0x36aab2[_0x07f0('0x27')]},client9002)['then'](function(){return _0x36aab2;});}return _0x36aab2;}return null;})['then'](respondWithResult(_0xb52ac7,null))[_0x07f0('0x29')](handleError(_0xb52ac7,null));};var interaction_log=require('../../config/logger')(_0x07f0('0x5a'));exports[_0x07f0('0x34')]=function(_0x378519,_0x16725e,_0x583ec7){var _0x1304ab={'agent':{},'channel':'whatsapp'};if(_0x378519[_0x07f0('0x58')]['id']){delete _0x378519[_0x07f0('0x58')]['id'];}_0x378519['body']['UserId']=_0x378519['body'][_0x07f0('0x60')]||_0x378519[_0x07f0('0x69')]['id'];_0x1304ab[_0x07f0('0x61')]['id']=_0x378519[_0x07f0('0x58')]['UserId'];return db[_0x07f0('0x3a')][_0x07f0('0x56')]({'where':{'id':_0x378519[_0x07f0('0x53')]['id'],'UserId':null}})[_0x07f0('0x1f')](handleEntityNotFound(_0x16725e,null))[_0x07f0('0x1f')](function(_0x1937ad){if(_0x1937ad){_0x1304ab['message']=_0x1937ad[_0x07f0('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x07f0('0x56')]({'where':{'id':_0x1937ad[_0x07f0('0x63')]}});}return null;})[_0x07f0('0x1f')](handleEntityNotFound(_0x16725e,null))[_0x07f0('0x1f')](function(_0x252d28){if(_0x252d28){_0x1304ab[_0x07f0('0x67')]=_0x252d28['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x378519['user']['id'],_0x378519[_0x07f0('0x69')][_0x07f0('0x38')],_0x378519['user']['role'],_0x1304ab['interaction']['id'],_0x378519['body']?JSON[_0x07f0('0x24')](_0x378519[_0x07f0('0x58')]):'null');return respondWithRpcPromise(_0x07f0('0x7a'),_0x07f0('0x7b'),_0x1304ab);}return null;})[_0x07f0('0x1f')](function(_0x5472b5){var _0x3c9e9d=_0x07f0('0x6c')+_0x5472b5['message'][_0x07f0('0x6d')];return db['sequelize'][_0x07f0('0x41')](_0x3c9e9d,{'type':db[_0x07f0('0x6f')][_0x07f0('0x7c')][_0x07f0('0x70')],'raw':!![]})[_0x07f0('0x1f')](function(_0xfea3a4){return _0xfea3a4;});})[_0x07f0('0x1f')](function(_0x1900ff){if(_0x1900ff){_0x1304ab[_0x07f0('0x27')]['contact']=_0x1900ff[0x0];if(!_0x378519[_0x07f0('0x58')]['UserId'])return;return db[_0x07f0('0x7d')][_0x07f0('0x56')]({'where':{'id':_0x378519[_0x07f0('0x58')][_0x07f0('0x60')],'role':_0x07f0('0x61')},'attributes':['id',_0x07f0('0x38'),_0x07f0('0x7e'),'email',_0x07f0('0x72')],'raw':!![]});}return null;})[_0x07f0('0x1f')](function(_0x413db6){if(!_0x413db6)return null;_0x1304ab['message'][_0x07f0('0x61')]=_0x413db6;return _0x1304ab;})['then'](function(_0x50d881){if(_0x50d881){_0x50d881[_0x07f0('0x27')][_0x07f0('0x74')]=util[_0x07f0('0x5f')](_0x07f0('0x75'),_0x378519['user'][_0x07f0('0x38')]);_0x50d881[_0x07f0('0x27')]['channel']=_0x1304ab[_0x07f0('0x76')];_0x50d881[_0x07f0('0x27')][_0x07f0('0x77')]=_0x07f0('0x34');respondWithRpcPromise(_0x07f0('0x78'),_0x07f0('0x78'),{'event':'rejectmessage','message':_0x50d881[_0x07f0('0x27')]},client9002);return _0x1304ab;}return null;})[_0x07f0('0x1f')](respondWithResult(_0x16725e,null))[_0x07f0('0x29')](handleError(_0x16725e,null));};exports['status']=function(_0x1a57d9,_0x2b4f9c,_0x5eff8a){if(_0x1a57d9['body']['id']){delete _0x1a57d9['body']['id'];}var _0x22723c;return db[_0x07f0('0x3a')]['find']({'where':{'id':_0x1a57d9[_0x07f0('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b4f9c,null))[_0x07f0('0x1f')](function(_0x2a1125){if(_0x2a1125){_0x22723c=_0x2a1125;return db[_0x07f0('0x7f')][_0x07f0('0x56')]({'where':{'id':_0x2a1125[_0x07f0('0x80')]}});}})[_0x07f0('0x1f')](handleEntityNotFound(_0x2b4f9c,null))[_0x07f0('0x1f')](function(_0x375c11){if(_0x375c11){logger[_0x07f0('0x22')](_0x07f0('0x81'),_0x07f0('0x2b'),'received\x20delivery\x20report\x20from',_0x375c11['type'],util[_0x07f0('0x82')](_0x1a57d9['body'],{'showHidden':![],'depth':null}));switch(_0x375c11[_0x07f0('0x3d')]){case'twilio':if(_0x1a57d9[_0x07f0('0x58')][_0x07f0('0x83')]&&_0x1a57d9[_0x07f0('0x58')][_0x07f0('0x83')]===_0x22723c[_0x07f0('0x84')]&&_0x1a57d9[_0x07f0('0x58')][_0x07f0('0x85')]&&_0x1a57d9[_0x07f0('0x58')]['MessageStatus']===_0x07f0('0x5d')){return _0x22723c[_0x07f0('0x36')]({'read':!![]});}else{logger[_0x07f0('0x25')](_0x07f0('0x86'),_0x07f0('0x2b'),_0x07f0('0x87'),util['inspect'](_0x1a57d9['body'],{'showHidden':![],'depth':null}));}break;}return _0x22723c;}})[_0x07f0('0x1f')](respondWithResult(_0x2b4f9c,null))[_0x07f0('0x29')](handleError(_0x2b4f9c,null));}; \ No newline at end of file +var _0x503b=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','update','body','describe','../../config/logger','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','find','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','SIP/%s','channel','event','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type'];(function(_0x36bf88,_0x15c459){var _0x332914=function(_0x512adf){while(--_0x512adf){_0x36bf88['push'](_0x36bf88['shift']());}};_0x332914(++_0x15c459);}(_0x503b,0xdf));var _0xb503=function(_0x374826,_0x17324b){_0x374826=_0x374826-0x0;var _0x1b4f46=_0x503b[_0x374826];return _0x1b4f46;};'use strict';var emlformat=require(_0xb503('0x0'));var rimraf=require(_0xb503('0x1'));var zipdir=require(_0xb503('0x2'));var jsonpatch=require(_0xb503('0x3'));var rp=require(_0xb503('0x4'));var moment=require(_0xb503('0x5'));var BPromise=require(_0xb503('0x6'));var Mustache=require('mustache');var util=require(_0xb503('0x7'));var path=require(_0xb503('0x8'));var sox=require(_0xb503('0x9'));var csv=require(_0xb503('0xa'));var ejs=require(_0xb503('0xb'));var fs=require('fs');var fs_extra=require(_0xb503('0xc'));var _=require(_0xb503('0xd'));var squel=require(_0xb503('0xe'));var crypto=require(_0xb503('0xf'));var jsforce=require(_0xb503('0x10'));var deskjs=require(_0xb503('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb503('0x12'));var Redis=require(_0xb503('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb503('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb503('0x15'));var logger=require('../../config/logger')(_0xb503('0x16'));var utils=require('../../config/utils');var config=require(_0xb503('0x17'));var licenseUtil=require(_0xb503('0x18'));var db=require('../../mysqldb')['db'];config[_0xb503('0x19')]=_[_0xb503('0x1a')](config['redis'],{'host':_0xb503('0x1b'),'port':0x18eb});var socket=require(_0xb503('0x1c'))(new Redis(config[_0xb503('0x19')]));require(_0xb503('0x1d'))[_0xb503('0x1e')](socket);var jayson=require(_0xb503('0x1f'));var client=jayson['client'][_0xb503('0x20')]({'port':0x232c});var client9002=jayson[_0xb503('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28b0a0,_0x2a02ee,_0x3e6beb,_0x24ca65){return new BPromise(function(_0x3cdff9,_0x415609){var _0x1df239=_0x24ca65||client;return _0x1df239[_0xb503('0x22')](_0x28b0a0,_0x3e6beb)[_0xb503('0x23')](function(_0x7989fc){logger[_0xb503('0x24')](_0xb503('0x25'),_0x2a02ee,'request\x20sent');logger[_0xb503('0x26')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2a02ee,_0xb503('0x27'),JSON[_0xb503('0x28')](_0x7989fc));if(_0x7989fc[_0xb503('0x29')]){if(_0x7989fc[_0xb503('0x29')][_0xb503('0x2a')]===0x1f4){logger['error'](_0xb503('0x25'),_0x2a02ee,_0x7989fc['error'][_0xb503('0x2b')]);return _0x415609(_0x7989fc[_0xb503('0x29')][_0xb503('0x2b')]);}logger[_0xb503('0x29')]('WhatsappMessage,\x20%s,\x20%s',_0x2a02ee,_0x7989fc['error'][_0xb503('0x2b')]);return _0x3cdff9(_0x7989fc[_0xb503('0x29')][_0xb503('0x2b')]);}else{logger[_0xb503('0x24')](_0xb503('0x25'),_0x2a02ee,_0xb503('0x27'));_0x3cdff9(_0x7989fc['result'][_0xb503('0x2b')]);}})[_0xb503('0x2c')](function(_0x2cc50e){logger[_0xb503('0x29')](_0xb503('0x25'),_0x2a02ee,_0x2cc50e);_0x415609(_0x2cc50e);});});}function respondWithStatusCode(_0x306d21,_0x2f1033){_0x2f1033=_0x2f1033||0xcc;return function(_0x37cbda){if(_0x37cbda){return _0x306d21[_0xb503('0x2d')](_0x2f1033);}return _0x306d21[_0xb503('0x2e')](_0x2f1033)[_0xb503('0x2f')]();};}function respondWithResult(_0x3a4560,_0x426c0f){_0x426c0f=_0x426c0f||0xc8;return function(_0x39c225){if(_0x39c225){return _0x3a4560['status'](_0x426c0f)[_0xb503('0x30')](_0x39c225);}};}function respondWithFilteredResult(_0x50a2b6,_0x43189a){return function(_0x2d3af1){if(_0x2d3af1){var _0x16da17=typeof _0x43189a[_0xb503('0x31')]===_0xb503('0x32')&&typeof _0x43189a[_0xb503('0x33')]===_0xb503('0x32');var _0x565306=_0x2d3af1[_0xb503('0x34')];var _0x374de9=_0x16da17?0x0:_0x43189a[_0xb503('0x31')];var _0x28b385=_0x16da17?_0x2d3af1[_0xb503('0x34')]:_0x43189a[_0xb503('0x31')]+_0x43189a[_0xb503('0x33')];var _0x20c546;if(_0x28b385>=_0x565306){_0x28b385=_0x565306;_0x20c546=0xc8;}else{_0x20c546=0xce;}_0x50a2b6[_0xb503('0x2e')](_0x20c546);return _0x50a2b6[_0xb503('0x35')](_0xb503('0x36'),_0x374de9+'-'+_0x28b385+'/'+_0x565306)[_0xb503('0x30')](_0x2d3af1);}return null;};}function patchUpdates(_0x3e35c5){return function(_0x4aa2c3){try{jsonpatch[_0xb503('0x37')](_0x4aa2c3,_0x3e35c5,!![]);}catch(_0x38e08c){return BPromise[_0xb503('0x38')](_0x38e08c);}return _0x4aa2c3[_0xb503('0x39')]();};}function saveUpdates(_0x2b39a9,_0x194c96){return function(_0x5e7bc4){if(_0x5e7bc4){return _0x5e7bc4['update'](_0x2b39a9)[_0xb503('0x23')](function(_0x521db4){return _0x521db4;});}return null;};}function removeEntity(_0x2927e7,_0x36e498){return function(_0x8a19f8){if(_0x8a19f8){return _0x8a19f8[_0xb503('0x3a')]()[_0xb503('0x23')](function(){_0x2927e7['status'](0xcc)[_0xb503('0x2f')]();});}};}function handleEntityNotFound(_0x463a45,_0x35f42d){return function(_0x3ea261){if(!_0x3ea261){_0x463a45['sendStatus'](0x194);}return _0x3ea261;};}function handleError(_0x36706b,_0x3f72bf){_0x3f72bf=_0x3f72bf||0x1f4;return function(_0xa4fc3d){logger['error'](_0xa4fc3d[_0xb503('0x3b')]);if(_0xa4fc3d[_0xb503('0x3c')]){delete _0xa4fc3d[_0xb503('0x3c')];}_0x36706b[_0xb503('0x2e')](_0x3f72bf)[_0xb503('0x3d')](_0xa4fc3d);};}exports['index']=function(_0x4a6ee5,_0xfc3cf5){var _0x1bffc8={},_0x466aca={},_0x48aa47={'count':0x0,'rows':[]};var _0x38f0bf=_[_0xb503('0x3e')](db[_0xb503('0x3f')][_0xb503('0x40')],function(_0x4ce15b){return{'name':_0x4ce15b[_0xb503('0x41')],'type':_0x4ce15b[_0xb503('0x42')]['key']};});_0x466aca[_0xb503('0x43')]=_['map'](_0x38f0bf,_0xb503('0x3c'));_0x466aca[_0xb503('0x44')]=_[_0xb503('0x45')](_0x4a6ee5[_0xb503('0x44')]);_0x466aca[_0xb503('0x46')]=_[_0xb503('0x47')](_0x466aca[_0xb503('0x43')],_0x466aca[_0xb503('0x44')]);_0x1bffc8[_0xb503('0x48')]=_[_0xb503('0x47')](_0x466aca['model'],qs[_0xb503('0x49')](_0x4a6ee5[_0xb503('0x44')][_0xb503('0x49')]));_0x1bffc8[_0xb503('0x48')]=_0x1bffc8[_0xb503('0x48')]['length']?_0x1bffc8[_0xb503('0x48')]:_0x466aca['model'];if(!_0x4a6ee5[_0xb503('0x44')][_0xb503('0x4a')](_0xb503('0x4b'))){_0x1bffc8['limit']=qs['limit'](_0x4a6ee5[_0xb503('0x44')][_0xb503('0x33')]);_0x1bffc8[_0xb503('0x31')]=qs[_0xb503('0x31')](_0x4a6ee5[_0xb503('0x44')]['offset']);}_0x1bffc8[_0xb503('0x4c')]=qs[_0xb503('0x4d')](_0x4a6ee5[_0xb503('0x44')][_0xb503('0x4d')]);_0x1bffc8[_0xb503('0x4e')]=qs[_0xb503('0x46')](_[_0xb503('0x4f')](_0x4a6ee5[_0xb503('0x44')],_0x466aca[_0xb503('0x46')]),_0x38f0bf);if(_0x4a6ee5[_0xb503('0x44')][_0xb503('0x50')]){_0x1bffc8[_0xb503('0x4e')]=_[_0xb503('0x51')](_0x1bffc8[_0xb503('0x4e')],{'$or':_[_0xb503('0x3e')](_0x38f0bf,function(_0x5cbbfb){if(_0x5cbbfb[_0xb503('0x42')]!==_0xb503('0x52')){var _0x1cbf0f={};_0x1cbf0f[_0x5cbbfb['name']]={'$like':'%'+_0x4a6ee5[_0xb503('0x44')][_0xb503('0x50')]+'%'};return _0x1cbf0f;}})});}_0x1bffc8=_[_0xb503('0x51')]({},_0x1bffc8,_0x4a6ee5[_0xb503('0x53')]);var _0x3429f9={'where':_0x1bffc8[_0xb503('0x4e')]};return db[_0xb503('0x3f')][_0xb503('0x34')](_0x3429f9)[_0xb503('0x23')](function(_0x354bef){_0x48aa47[_0xb503('0x34')]=_0x354bef;if(_0x4a6ee5[_0xb503('0x44')][_0xb503('0x54')]){_0x1bffc8[_0xb503('0x55')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb503('0x56')](_0x1bffc8);})['then'](function(_0x118b2e){_0x48aa47[_0xb503('0x57')]=_0x118b2e;return _0x48aa47;})[_0xb503('0x23')](respondWithFilteredResult(_0xfc3cf5,_0x1bffc8))['catch'](handleError(_0xfc3cf5,null));};exports[_0xb503('0x58')]=function(_0xcfbef0,_0x5636e8){var _0x2aab9d={'raw':!![],'where':{'id':_0xcfbef0[_0xb503('0x59')]['id']}},_0x2b9793={};_0x2b9793[_0xb503('0x43')]=_['keys'](db[_0xb503('0x3f')][_0xb503('0x40')]);_0x2b9793[_0xb503('0x44')]=_[_0xb503('0x45')](_0xcfbef0['query']);_0x2b9793[_0xb503('0x46')]=_[_0xb503('0x47')](_0x2b9793[_0xb503('0x43')],_0x2b9793[_0xb503('0x44')]);_0x2aab9d[_0xb503('0x48')]=_[_0xb503('0x47')](_0x2b9793[_0xb503('0x43')],qs[_0xb503('0x49')](_0xcfbef0['query']['fields']));_0x2aab9d[_0xb503('0x48')]=_0x2aab9d[_0xb503('0x48')][_0xb503('0x5a')]?_0x2aab9d['attributes']:_0x2b9793[_0xb503('0x43')];if(_0xcfbef0[_0xb503('0x44')][_0xb503('0x54')]){_0x2aab9d[_0xb503('0x55')]=[{'all':!![]}];}_0x2aab9d=_[_0xb503('0x51')]({},_0x2aab9d,_0xcfbef0['options']);return db[_0xb503('0x3f')]['find'](_0x2aab9d)['then'](handleEntityNotFound(_0x5636e8,null))[_0xb503('0x23')](respondWithResult(_0x5636e8,null))[_0xb503('0x2c')](handleError(_0x5636e8,null));};exports['create']=function(_0x316dbe,_0x22556b){return db[_0xb503('0x3f')][_0xb503('0x5b')](_0x316dbe['body'],{})[_0xb503('0x23')](respondWithResult(_0x22556b,0xc9))[_0xb503('0x2c')](handleError(_0x22556b,null));};exports[_0xb503('0x5c')]=function(_0x2e6101,_0x4817d9){if(_0x2e6101['body']['id']){delete _0x2e6101[_0xb503('0x5d')]['id'];}return db[_0xb503('0x3f')]['find']({'where':{'id':_0x2e6101['params']['id']}})[_0xb503('0x23')](handleEntityNotFound(_0x4817d9,null))[_0xb503('0x23')](saveUpdates(_0x2e6101[_0xb503('0x5d')],null))[_0xb503('0x23')](respondWithResult(_0x4817d9,null))[_0xb503('0x2c')](handleError(_0x4817d9,null));};exports[_0xb503('0x3a')]=function(_0x1280b0,_0x328640){return db[_0xb503('0x3f')]['find']({'where':{'id':_0x1280b0[_0xb503('0x59')]['id']}})[_0xb503('0x23')](handleEntityNotFound(_0x328640,null))[_0xb503('0x23')](removeEntity(_0x328640,null))[_0xb503('0x2c')](handleError(_0x328640,null));};exports[_0xb503('0x5e')]=function(_0x2d88bf,_0x6d7f6c){return db['WhatsappMessage']['describe']()[_0xb503('0x23')](respondWithResult(_0x6d7f6c,null))['catch'](handleError(_0x6d7f6c,null));};var interaction_log=require(_0xb503('0x5f'))('whatsapp-interactions');exports[_0xb503('0x60')]=function(_0x1c7819,_0x4cdaa5,_0x595a90){var _0x2f04de={'agent':{},'channel':_0xb503('0x61')};if(_0x1c7819[_0xb503('0x5d')]['id']){delete _0x1c7819[_0xb503('0x5d')]['id'];}_0x1c7819[_0xb503('0x5d')]['read']=!![];_0x1c7819[_0xb503('0x5d')][_0xb503('0x62')]=moment()['format'](_0xb503('0x63'));_0x1c7819[_0xb503('0x5d')]['UserId']=_0x1c7819[_0xb503('0x5d')][_0xb503('0x64')]||_0x1c7819[_0xb503('0x65')]['id'];_0x2f04de[_0xb503('0x66')]['id']=_0x1c7819[_0xb503('0x5d')]['UserId'];return db[_0xb503('0x3f')][_0xb503('0x67')]({'where':{'id':_0x1c7819[_0xb503('0x59')]['id'],'UserId':null}})[_0xb503('0x23')](handleEntityNotFound(_0x4cdaa5,null))[_0xb503('0x23')](saveUpdates(_0x1c7819[_0xb503('0x5d')],null))[_0xb503('0x23')](function(_0x5c24d3){if(_0x5c24d3){_0x2f04de[_0xb503('0x2b')]=_0x5c24d3[_0xb503('0x68')]({'plain':!![]});return db[_0xb503('0x69')][_0xb503('0x67')]({'where':{'id':_0x5c24d3[_0xb503('0x6a')]}});}return null;})[_0xb503('0x23')](handleEntityNotFound(_0x4cdaa5,null))['then'](function(_0xc54fb3){if(_0xc54fb3){return _0xc54fb3[_0xb503('0x5c')]({'UserId':_0x1c7819[_0xb503('0x5d')]['UserId'],'read1stAt':_[_0xb503('0x6b')](_0xc54fb3[_0xb503('0x6c')])?moment()[_0xb503('0x6d')](_0xb503('0x63')):undefined});}return null;})[_0xb503('0x23')](function(_0xa63908){if(_0xa63908){_0x2f04de[_0xb503('0x6e')]=_0xa63908[_0xb503('0x68')]({'plain':!![]});interaction_log[_0xb503('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c7819[_0xb503('0x65')]['id'],_0x1c7819[_0xb503('0x65')][_0xb503('0x3c')],_0x1c7819['user']['role'],_0x2f04de['interaction']['id'],_0x1c7819[_0xb503('0x5d')]?JSON[_0xb503('0x28')](_0x1c7819[_0xb503('0x5d')]):'null');return respondWithRpcPromise(_0xb503('0x6f'),_0xb503('0x70'),_0x2f04de);}return null;})['then'](function(_0x2cfc11){var _0x2ce352='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cfc11[_0xb503('0x2b')][_0xb503('0x71')];return db[_0xb503('0x72')][_0xb503('0x44')](_0x2ce352,{'type':db[_0xb503('0x73')][_0xb503('0x74')]['SELECT'],'raw':!![]})[_0xb503('0x23')](function(_0x526eaf){return _0x526eaf;});})[_0xb503('0x23')](function(_0x347d38){if(_0x347d38){_0x2f04de[_0xb503('0x2b')][_0xb503('0x75')]=_0x347d38[0x0];if(!_0x1c7819[_0xb503('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x1c7819[_0xb503('0x5d')]['UserId'],'role':'agent'},'attributes':['id',_0xb503('0x3c'),_0xb503('0x76'),_0xb503('0x77'),_0xb503('0x78')],'raw':!![]});}return null;})[_0xb503('0x23')](function(_0x23dd18){if(!_0x23dd18)return null;_0x2f04de['message'][_0xb503('0x66')]=_0x23dd18;return _0x2f04de;})[_0xb503('0x23')](function(_0x43d5ff){if(_0x43d5ff){if(_0x1c7819['body']['manual']){_0x2f04de[_0xb503('0x2b')]['interface']=util[_0xb503('0x6d')](_0xb503('0x79'),_0x1c7819[_0xb503('0x65')][_0xb503('0x3c')]);_0x2f04de['message'][_0xb503('0x7a')]=_0x2f04de[_0xb503('0x7a')];_0x2f04de[_0xb503('0x2b')][_0xb503('0x7b')]='accept';return respondWithRpcPromise(_0xb503('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x2f04de[_0xb503('0x2b')]},client9002)[_0xb503('0x23')](function(){return _0x2f04de;});}return _0x2f04de;}return null;})[_0xb503('0x23')](respondWithResult(_0x4cdaa5,null))['catch'](handleError(_0x4cdaa5,null));};var interaction_log=require('../../config/logger')(_0xb503('0x7d'));exports[_0xb503('0x38')]=function(_0x44ec9f,_0x2b98fc,_0x52b45d){var _0x4bb764={'agent':{},'channel':'whatsapp'};if(_0x44ec9f['body']['id']){delete _0x44ec9f['body']['id'];}_0x44ec9f[_0xb503('0x5d')]['UserId']=_0x44ec9f[_0xb503('0x5d')]['UserId']||_0x44ec9f[_0xb503('0x65')]['id'];_0x4bb764[_0xb503('0x66')]['id']=_0x44ec9f[_0xb503('0x5d')][_0xb503('0x64')];return db[_0xb503('0x3f')]['find']({'where':{'id':_0x44ec9f['params']['id'],'UserId':null}})[_0xb503('0x23')](handleEntityNotFound(_0x2b98fc,null))[_0xb503('0x23')](function(_0x42f8a8){if(_0x42f8a8){_0x4bb764[_0xb503('0x2b')]=_0x42f8a8[_0xb503('0x68')]({'plain':!![]});return db[_0xb503('0x69')]['find']({'where':{'id':_0x42f8a8[_0xb503('0x6a')]}});}return null;})[_0xb503('0x23')](handleEntityNotFound(_0x2b98fc,null))[_0xb503('0x23')](function(_0x4a283d){if(_0x4a283d){_0x4bb764[_0xb503('0x6e')]=_0x4a283d[_0xb503('0x68')]({'plain':!![]});interaction_log[_0xb503('0x24')](_0xb503('0x7e'),_0x44ec9f[_0xb503('0x65')]['id'],_0x44ec9f[_0xb503('0x65')]['name'],_0x44ec9f[_0xb503('0x65')][_0xb503('0x7f')],_0x4bb764[_0xb503('0x6e')]['id'],_0x44ec9f[_0xb503('0x5d')]?JSON[_0xb503('0x28')](_0x44ec9f[_0xb503('0x5d')]):_0xb503('0x80'));return respondWithRpcPromise(_0xb503('0x81'),_0xb503('0x82'),_0x4bb764);}return null;})['then'](function(_0xa7936c){var _0x3e7e05='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa7936c['message'][_0xb503('0x71')];return db[_0xb503('0x72')]['query'](_0x3e7e05,{'type':db[_0xb503('0x73')][_0xb503('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x53f2f8){return _0x53f2f8;});})[_0xb503('0x23')](function(_0x2710d9){if(_0x2710d9){_0x4bb764['message'][_0xb503('0x75')]=_0x2710d9[0x0];if(!_0x44ec9f[_0xb503('0x5d')][_0xb503('0x64')])return;return db[_0xb503('0x83')][_0xb503('0x67')]({'where':{'id':_0x44ec9f['body'][_0xb503('0x64')],'role':_0xb503('0x66')},'attributes':['id',_0xb503('0x3c'),_0xb503('0x76'),_0xb503('0x77'),_0xb503('0x78')],'raw':!![]});}return null;})[_0xb503('0x23')](function(_0x351ac1){if(!_0x351ac1)return null;_0x4bb764['message']['agent']=_0x351ac1;return _0x4bb764;})[_0xb503('0x23')](function(_0x37677e){if(_0x37677e){_0x37677e[_0xb503('0x2b')][_0xb503('0x84')]=util[_0xb503('0x6d')]('SIP/%s',_0x44ec9f[_0xb503('0x65')][_0xb503('0x3c')]);_0x37677e['message'][_0xb503('0x7a')]=_0x4bb764[_0xb503('0x7a')];_0x37677e['message'][_0xb503('0x7b')]=_0xb503('0x38');respondWithRpcPromise(_0xb503('0x7c'),_0xb503('0x7c'),{'event':_0xb503('0x85'),'message':_0x37677e[_0xb503('0x2b')]},client9002);return _0x4bb764;}return null;})['then'](respondWithResult(_0x2b98fc,null))['catch'](handleError(_0x2b98fc,null));};exports[_0xb503('0x2e')]=function(_0x830c7f,_0x328a9e,_0x154d94){if(_0x830c7f[_0xb503('0x5d')]['id']){delete _0x830c7f['body']['id'];}var _0x2941ca;return db['WhatsappMessage']['find']({'where':{'id':_0x830c7f[_0xb503('0x59')]['id']}})['then'](handleEntityNotFound(_0x328a9e,null))[_0xb503('0x23')](function(_0x2fa2f8){if(_0x2fa2f8){_0x2941ca=_0x2fa2f8;return db[_0xb503('0x86')]['find']({'where':{'id':_0x2fa2f8[_0xb503('0x87')]}});}})['then'](handleEntityNotFound(_0x328a9e,null))[_0xb503('0x23')](function(_0x508d24){if(_0x508d24){logger[_0xb503('0x26')](_0xb503('0x88'),'status',_0xb503('0x89'),_0x508d24[_0xb503('0x42')],util[_0xb503('0x8a')](_0x830c7f[_0xb503('0x5d')],{'showHidden':![],'depth':null}));switch(_0x508d24[_0xb503('0x42')]){case _0xb503('0x8b'):if(_0x830c7f[_0xb503('0x5d')][_0xb503('0x8c')]&&_0x830c7f[_0xb503('0x5d')][_0xb503('0x8c')]===_0x2941ca[_0xb503('0x8d')]&&_0x830c7f[_0xb503('0x5d')]['MessageStatus']&&_0x830c7f['body'][_0xb503('0x8e')]===_0xb503('0x8f')){return _0x2941ca[_0xb503('0x5c')]({'read':!![]});}else{logger['error'](_0xb503('0x90'),_0xb503('0x2e'),'twilio',util[_0xb503('0x8a')](_0x830c7f[_0xb503('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x2941ca;}})['then'](respondWithResult(_0x328a9e,null))[_0xb503('0x2c')](handleError(_0x328a9e,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index e7a95fd..17dd546 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['update','emit','hook','events','../../mysqldb','WhatsappMessage','save'];(function(_0x17b062,_0x506448){var _0x12d6e0=function(_0x35538c){while(--_0x35538c){_0x17b062['push'](_0x17b062['shift']());}};_0x12d6e0(++_0x506448);}(_0x6c76,0x184));var _0x66c7=function(_0x1a9f9f,_0x27ef9e){_0x1a9f9f=_0x1a9f9f-0x0;var _0x17c64c=_0x6c76[_0x1a9f9f];return _0x17c64c;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var WhatsappMessage=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x9f4d=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x38cb7c,_0xf33f42){_0x38cb7c=_0x38cb7c-0x0;var _0x2a5f5e=_0x9f4d[_0x38cb7c];return _0x2a5f5e;};'use strict';var EventEmitter=require(_0xd9f4('0x0'));var WhatsappMessage=require(_0xd9f4('0x1'))['db'][_0xd9f4('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd9f4('0x3')](0x0);var events={'afterCreate':_0xd9f4('0x4'),'afterUpdate':_0xd9f4('0x5'),'afterDestroy':_0xd9f4('0x6')};function emitEvent(_0x273eb9){return function(_0x7dccea,_0x5e0ab0,_0x2c39cb){WhatsappMessageEvents['emit'](_0x273eb9+':'+_0x7dccea['id'],_0x7dccea);WhatsappMessageEvents[_0xd9f4('0x7')](_0x273eb9,_0x7dccea);_0x2c39cb(null);};}for(var e in events){if(events[_0xd9f4('0x8')](e)){var event=events[e];WhatsappMessage[_0xd9f4('0x9')](e,emitEvent(event));}}module[_0xd9f4('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 8409565..c10ae87 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaa3=['whatsapp:','remote','token','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xcaa3,0xcb));var _0x3caa=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xcaa3[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x3caa('0x0'));var util=require(_0x3caa('0x1'));var logger=require(_0x3caa('0x2'))(_0x3caa('0x3'));var moment=require(_0x3caa('0x4'));var BPromise=require(_0x3caa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3caa('0x6'));var config=require(_0x3caa('0x7'));var attributes=require(_0x3caa('0x8'));module[_0x3caa('0x9')]=function(_0x171c56,_0x54ba79){return _0x171c56[_0x3caa('0xa')](_0x3caa('0xb'),attributes,{'tableName':_0x3caa('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x3caa('0xd')]},{'name':_0x3caa('0xe'),'fields':[_0x3caa('0xf')],'type':_0x3caa('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x453164,_0x169ece,_0x2bae6e){var _0xf003a7=_0x171c56[_0x3caa('0x11')];var _0x115452=_0x453164[_0x3caa('0x12')]({'plain':!![]});if(_0x115452[_0x3caa('0x13')]['toLowerCase']()==='in'||_0x115452['direction'][_0x3caa('0x14')]()===_0x3caa('0x15')&&!_0x115452['secret']&&!_[_0x3caa('0x16')](_0x115452['UserId'])){_0xf003a7[_0x3caa('0x17')]['findOne']({'where':{'id':_0x115452[_0x3caa('0x18')]}})[_0x3caa('0x19')](function(_0x1b18e3){if(_0x1b18e3){_0x1b18e3['update']({'lastMsgAt':_0x115452[_0x3caa('0x1a')],'lastMsgDirection':_0x115452['direction'][_0x3caa('0x14')]()});}})[_0x3caa('0x1b')](function(_0x563cdd){console[_0x3caa('0x1c')](_0x563cdd);});}if(_0x115452[_0x3caa('0x13')]===_0x3caa('0x15')&&!_0x115452['secret']){var _0xbfe273;_0xf003a7[_0x3caa('0x1d')][_0x3caa('0x1e')]({'where':{'id':_0x115452[_0x3caa('0x1f')]},'raw':!![]})[_0x3caa('0x19')](function(_0x12e1cd){_0xbfe273=_0x12e1cd;if(_0xbfe273&&_0xbfe273[_0x3caa('0x20')]){switch(_0xbfe273['type']){case'twilio':var _0x335ce0=require(_0x3caa('0x21'));if(_0xbfe273[_0x3caa('0x22')]&&_0xbfe273['authToken']&&_0xbfe273[_0x3caa('0x23')]){var _0x2dfc98=new _0x335ce0(_0xbfe273[_0x3caa('0x22')],_0xbfe273[_0x3caa('0x24')]);_0x2dfc98['messages']['create']({'body':_0x115452[_0x3caa('0xf')],'to':_0x3caa('0x25')+_0x115452[_0x3caa('0x23')],'from':_0x3caa('0x25')+_0xbfe273['phone'],'statusCallback':_0xbfe273[_0x3caa('0x26')]+'/api/whatsapp/messages/'+_0x115452['id']+'/status?token='+_0xbfe273[_0x3caa('0x27')]})[_0x3caa('0x19')](function(_0x3ff98a){if(_0x3ff98a[_0x3caa('0x28')]){return _0x453164[_0x3caa('0x29')]({'messageId':_0x3ff98a[_0x3caa('0x28')]});}})[_0x3caa('0x1b')](function(_0x48c378){logger[_0x3caa('0x1c')](_0x3caa('0x2a'),_0x3caa('0x2b'),_0x3caa('0x21'),util[_0x3caa('0x2c')](_0x48c378,{'showHidden':![],'depth':null}));});}else{logger[_0x3caa('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',_0x3caa('0x2d'));}break;}}})[_0x3caa('0x2e')](function(){_0x2bae6e();});}else{_0x2bae6e();}}},'charset':'utf8mb4','collate':_0x3caa('0x2f')});}; \ No newline at end of file +var _0xcba4=['whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/status?token=','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage'];(function(_0x381ba2,_0x5898ae){var _0x5c9d35=function(_0x557fd9){while(--_0x557fd9){_0x381ba2['push'](_0x381ba2['shift']());}};_0x5c9d35(++_0x5898ae);}(_0xcba4,0x174));var _0x4cba=function(_0x3b23fa,_0x53ad01){_0x3b23fa=_0x3b23fa-0x0;var _0x40f138=_0xcba4[_0x3b23fa];return _0x40f138;};'use strict';var _=require(_0x4cba('0x0'));var util=require('util');var logger=require(_0x4cba('0x1'))(_0x4cba('0x2'));var moment=require('moment');var BPromise=require(_0x4cba('0x3'));var rp=require(_0x4cba('0x4'));var fs=require('fs');var path=require(_0x4cba('0x5'));var rimraf=require(_0x4cba('0x6'));var config=require(_0x4cba('0x7'));var attributes=require(_0x4cba('0x8'));module[_0x4cba('0x9')]=function(_0x1151f8,_0x26d182){return _0x1151f8[_0x4cba('0xa')](_0x4cba('0xb'),attributes,{'tableName':_0x4cba('0xc'),'paranoid':![],'indexes':[{'name':_0x4cba('0xd'),'fields':[_0x4cba('0xd')]},{'name':_0x4cba('0xe'),'fields':[_0x4cba('0xf')],'type':_0x4cba('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d4875,_0x120e27,_0x4284c4){var _0x34c16d=_0x1151f8[_0x4cba('0x11')];var _0xa1fb3f=_0x3d4875['get']({'plain':!![]});if(_0xa1fb3f[_0x4cba('0x12')]['toLowerCase']()==='in'||_0xa1fb3f[_0x4cba('0x12')][_0x4cba('0x13')]()===_0x4cba('0x14')&&!_0xa1fb3f[_0x4cba('0x15')]&&!_['isNil'](_0xa1fb3f[_0x4cba('0x16')])){_0x34c16d['WhatsappInteraction'][_0x4cba('0x17')]({'where':{'id':_0xa1fb3f[_0x4cba('0x18')]}})[_0x4cba('0x19')](function(_0x2349b8){if(_0x2349b8){_0x2349b8[_0x4cba('0x1a')]({'lastMsgAt':_0xa1fb3f[_0x4cba('0x1b')],'lastMsgDirection':_0xa1fb3f[_0x4cba('0x12')]['toLowerCase']()});}})[_0x4cba('0x1c')](function(_0x4afaa1){console[_0x4cba('0x1d')](_0x4afaa1);});}if(_0xa1fb3f[_0x4cba('0x12')]===_0x4cba('0x14')&&!_0xa1fb3f[_0x4cba('0x15')]){var _0x5f3753;_0x34c16d[_0x4cba('0x1e')]['find']({'where':{'id':_0xa1fb3f['WhatsappAccountId']},'raw':!![]})[_0x4cba('0x19')](function(_0x1f23ff){_0x5f3753=_0x1f23ff;if(_0x5f3753&&_0x5f3753[_0x4cba('0x1f')]){switch(_0x5f3753['type']){case _0x4cba('0x20'):var _0xb8a648=require('twilio');if(_0x5f3753[_0x4cba('0x21')]&&_0x5f3753['authToken']&&_0x5f3753[_0x4cba('0x22')]){var _0x42da3f=new _0xb8a648(_0x5f3753[_0x4cba('0x21')],_0x5f3753[_0x4cba('0x23')]);_0x42da3f[_0x4cba('0x24')][_0x4cba('0x25')]({'body':_0xa1fb3f[_0x4cba('0xf')],'to':_0x4cba('0x26')+_0xa1fb3f[_0x4cba('0x22')],'from':_0x4cba('0x26')+_0x5f3753[_0x4cba('0x22')],'statusCallback':_0x5f3753[_0x4cba('0x27')]+'/api/whatsapp/messages/'+_0xa1fb3f['id']+_0x4cba('0x28')+_0x5f3753['token']})[_0x4cba('0x19')](function(_0x4a432f){if(_0x4a432f[_0x4cba('0x29')]){return _0x3d4875[_0x4cba('0x1a')]({'messageId':_0x4a432f['sid']});}})[_0x4cba('0x1c')](function(_0x3544fc){logger[_0x4cba('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4cba('0x2a'),_0x4cba('0x20'),util[_0x4cba('0x2b')](_0x3544fc,{'showHidden':![],'depth':null}));});}else{logger[_0x4cba('0x1d')](_0x4cba('0x2c'),_0x4cba('0x2a'),_0x4cba('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x4cba('0x2d')](function(){_0x4284c4();});}else{_0x4284c4();}}},'charset':_0x4cba('0x2e'),'collate':_0x4cba('0x2f')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index acb2c61..3e71b37 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7c5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','raw','CreateWhatsappMessage','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x133368,_0x1f8d8e){var _0x4c01a9=function(_0x32d8ad){while(--_0x32d8ad){_0x133368['push'](_0x133368['shift']());}};_0x4c01a9(++_0x1f8d8e);}(_0xa7c5,0x12d));var _0x5a7c=function(_0x3a1ab2,_0x2e6da0){_0x3a1ab2=_0x3a1ab2-0x0;var _0x2795bf=_0xa7c5[_0x3a1ab2];return _0x2795bf;};'use strict';var _=require(_0x5a7c('0x0'));var util=require(_0x5a7c('0x1'));var moment=require(_0x5a7c('0x2'));var BPromise=require(_0x5a7c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a7c('0x4'))['db'];var utils=require(_0x5a7c('0x5'));var logger=require(_0x5a7c('0x6'))(_0x5a7c('0x7'));var config=require(_0x5a7c('0x8'));var jayson=require(_0x5a7c('0x9'));var client=jayson[_0x5a7c('0xa')][_0x5a7c('0xb')]({'port':0x232a});config[_0x5a7c('0xc')]=_[_0x5a7c('0xd')](config['redis'],{'host':_0x5a7c('0xe'),'port':0x18eb});var socket=require(_0x5a7c('0xf'))(new Redis(config[_0x5a7c('0xc')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x51fc74,_0x522e88,_0x299826){return new BPromise(function(_0x2cff34,_0x167b37){return client[_0x5a7c('0x10')](_0x51fc74,_0x299826)[_0x5a7c('0x11')](function(_0x19918b){logger[_0x5a7c('0x12')](_0x5a7c('0x13'),_0x522e88,_0x5a7c('0x14'));logger[_0x5a7c('0x15')](_0x5a7c('0x16'),_0x522e88,_0x5a7c('0x14'),JSON[_0x5a7c('0x17')](_0x19918b));if(_0x19918b[_0x5a7c('0x18')]){if(_0x19918b[_0x5a7c('0x18')][_0x5a7c('0x19')]===0x1f4){logger[_0x5a7c('0x18')](_0x5a7c('0x13'),_0x522e88,_0x19918b['error']['message']);return _0x167b37(_0x19918b[_0x5a7c('0x18')][_0x5a7c('0x1a')]);}logger[_0x5a7c('0x18')](_0x5a7c('0x13'),_0x522e88,_0x19918b[_0x5a7c('0x18')][_0x5a7c('0x1a')]);return _0x2cff34(_0x19918b[_0x5a7c('0x18')]['message']);}else{logger[_0x5a7c('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x522e88,_0x5a7c('0x14'));_0x2cff34(_0x19918b[_0x5a7c('0x1b')][_0x5a7c('0x1a')]);}})['catch'](function(_0x5e9297){logger[_0x5a7c('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x522e88,_0x5e9297);_0x167b37(_0x5e9297);});});}exports['CreateWhatsappMessage']=function(_0x5026d3){var _0x33ba92=this;return new Promise(function(_0x272610,_0x2ba782){return db['WhatsappMessage'][_0x5a7c('0x1c')](_0x5026d3[_0x5a7c('0x1d')],{'raw':_0x5026d3[_0x5a7c('0x1e')]?_0x5026d3['options'][_0x5a7c('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x5bc351){logger[_0x5a7c('0x12')]('CreateWhatsappMessage',_0x5026d3);logger['debug'](_0x5a7c('0x20'),_0x5026d3,JSON[_0x5a7c('0x17')](_0x5bc351));_0x272610(_0x5bc351);})[_0x5a7c('0x21')](function(_0x50c86c){logger[_0x5a7c('0x18')](_0x5a7c('0x20'),_0x50c86c['message'],_0x5026d3);_0x2ba782(_0x33ba92[_0x5a7c('0x18')](0x1f4,_0x50c86c[_0x5a7c('0x1a')]));});});}; \ No newline at end of file +var _0xf773=['http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','WhatsappMessage','options','raw','stringify','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x111ee6,_0xd8a3ea){var _0x8bbb51=function(_0x273011){while(--_0x273011){_0x111ee6['push'](_0x111ee6['shift']());}};_0x8bbb51(++_0xd8a3ea);}(_0xf773,0x120));var _0x3f77=function(_0x545dc5,_0x6d0b57){_0x545dc5=_0x545dc5-0x0;var _0x11155c=_0xf773[_0x545dc5];return _0x11155c;};'use strict';var _=require(_0x3f77('0x0'));var util=require(_0x3f77('0x1'));var moment=require(_0x3f77('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f77('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f77('0x5'))(_0x3f77('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f77('0x7'));var client=jayson[_0x3f77('0x8')][_0x3f77('0x9')]({'port':0x232a});config[_0x3f77('0xa')]=_[_0x3f77('0xb')](config[_0x3f77('0xa')],{'host':_0x3f77('0xc'),'port':0x18eb});var socket=require(_0x3f77('0xd'))(new Redis(config[_0x3f77('0xa')]));require(_0x3f77('0xe'))[_0x3f77('0xf')](socket);function respondWithRpcPromise(_0x14caa3,_0x451de9,_0x290f8a){return new BPromise(function(_0xf12306,_0x4b93cd){return client[_0x3f77('0x10')](_0x14caa3,_0x290f8a)[_0x3f77('0x11')](function(_0x52f181){logger[_0x3f77('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x451de9,'request\x20sent');logger[_0x3f77('0x13')](_0x3f77('0x14'),_0x451de9,_0x3f77('0x15'),JSON['stringify'](_0x52f181));if(_0x52f181['error']){if(_0x52f181[_0x3f77('0x16')][_0x3f77('0x17')]===0x1f4){logger[_0x3f77('0x16')](_0x3f77('0x18'),_0x451de9,_0x52f181[_0x3f77('0x16')]['message']);return _0x4b93cd(_0x52f181[_0x3f77('0x16')]['message']);}logger[_0x3f77('0x16')](_0x3f77('0x18'),_0x451de9,_0x52f181[_0x3f77('0x16')][_0x3f77('0x19')]);return _0xf12306(_0x52f181[_0x3f77('0x16')][_0x3f77('0x19')]);}else{logger[_0x3f77('0x12')](_0x3f77('0x18'),_0x451de9,_0x3f77('0x15'));_0xf12306(_0x52f181[_0x3f77('0x1a')]['message']);}})['catch'](function(_0x1f5bba){logger[_0x3f77('0x16')](_0x3f77('0x18'),_0x451de9,_0x1f5bba);_0x4b93cd(_0x1f5bba);});});}exports[_0x3f77('0x1b')]=function(_0x2ac527){var _0x12a236=this;return new Promise(function(_0x36212f,_0x2eb977){return db[_0x3f77('0x1c')]['create'](_0x2ac527['body'],{'raw':_0x2ac527[_0x3f77('0x1d')]?_0x2ac527[_0x3f77('0x1d')][_0x3f77('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x64c45d){logger[_0x3f77('0x12')](_0x3f77('0x1b'),_0x2ac527);logger[_0x3f77('0x13')]('CreateWhatsappMessage',_0x2ac527,JSON[_0x3f77('0x1f')](_0x64c45d));_0x36212f(_0x64c45d);})[_0x3f77('0x20')](function(_0x4aabb4){logger[_0x3f77('0x16')](_0x3f77('0x1b'),_0x4aabb4['message'],_0x2ac527);_0x2eb977(_0x12a236[_0x3f77('0x16')](0x1f4,_0x4aabb4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2643175..a19f930 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2cc7=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x2cc7,0x16d));var _0x72cc=function(_0x12c4f9,_0x95b170){_0x12c4f9=_0x12c4f9-0x0;var _0x5e6359=_0x2cc7[_0x12c4f9];return _0x5e6359;};'use strict';var WhatsappMessageEvents=require(_0x72cc('0x0'));var events=[_0x72cc('0x1'),_0x72cc('0x2'),'update'];function createListener(_0x40b58c,_0x242025){return function(_0x1879c7){_0x242025[_0x72cc('0x3')](_0x40b58c,_0x1879c7);};}function removeListener(_0x310763,_0x16e349){return function(){WhatsappMessageEvents[_0x72cc('0x4')](_0x310763,_0x16e349);};}exports[_0x72cc('0x5')]=function(_0x19d93a){for(var _0x46cffa=0x0,_0x17eef6=events[_0x72cc('0x6')];_0x46cffa<_0x17eef6;_0x46cffa++){var _0x4813a8=events[_0x46cffa];var _0x14612b=createListener(_0x72cc('0x7')+_0x4813a8,_0x19d93a);WhatsappMessageEvents['on'](_0x4813a8,_0x14612b);}}; \ No newline at end of file +var _0x42f0=['save','remove','update','removeListener','register','length','./whatsappMessage.events'];(function(_0x3974ac,_0x1cecce){var _0x24ea73=function(_0x1fd421){while(--_0x1fd421){_0x3974ac['push'](_0x3974ac['shift']());}};_0x24ea73(++_0x1cecce);}(_0x42f0,0x68));var _0x042f=function(_0x45de8d,_0xc53486){_0x45de8d=_0x45de8d-0x0;var _0x22098a=_0x42f0[_0x45de8d];return _0x22098a;};'use strict';var WhatsappMessageEvents=require(_0x042f('0x0'));var events=[_0x042f('0x1'),_0x042f('0x2'),_0x042f('0x3')];function createListener(_0x35aaa7,_0x7ea3b0){return function(_0x248897){_0x7ea3b0['emit'](_0x35aaa7,_0x248897);};}function removeListener(_0x39d785,_0x2f654e){return function(){WhatsappMessageEvents[_0x042f('0x4')](_0x39d785,_0x2f654e);};}exports[_0x042f('0x5')]=function(_0x28c1fa){for(var _0x247ec7=0x0,_0x1769a4=events[_0x042f('0x6')];_0x247ec7<_0x1769a4;_0x247ec7++){var _0x21f47a=events[_0x247ec7];var _0x112013=createListener('whatsappMessage:'+_0x21f47a,_0x28c1fa);WhatsappMessageEvents['on'](_0x21f47a,_0x112013);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d21a68f..030ac5d 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3492=['isAuthenticated','index','/describe','/:id','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','destroy','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./whatsappQueue.controller','get'];(function(_0x5aae85,_0x12fb5a){var _0x40e3d5=function(_0x1e831d){while(--_0x1e831d){_0x5aae85['push'](_0x5aae85['shift']());}};_0x40e3d5(++_0x12fb5a);}(_0x3492,0x123));var _0x2349=function(_0x344fd0,_0x1ebb2a){_0x344fd0=_0x344fd0-0x0;var _0x391c13=_0x3492[_0x344fd0];return _0x391c13;};'use strict';var multer=require(_0x2349('0x0'));var util=require(_0x2349('0x1'));var path=require(_0x2349('0x2'));var timeout=require(_0x2349('0x3'));var express=require(_0x2349('0x4'));var router=express[_0x2349('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2349('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2349('0x7'));router[_0x2349('0x8')]('/',auth[_0x2349('0x9')](),controller[_0x2349('0xa')]);router[_0x2349('0x8')](_0x2349('0xb'),auth[_0x2349('0x9')](),controller['describe']);router[_0x2349('0x8')](_0x2349('0xc'),auth[_0x2349('0x9')](),controller['show']);router[_0x2349('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x2349('0x8')](_0x2349('0xd'),auth[_0x2349('0x9')](),controller['getTeams']);router[_0x2349('0x8')](_0x2349('0xe'),auth['isAuthenticated'](),controller[_0x2349('0xf')]);router[_0x2349('0x10')]('/',auth[_0x2349('0x9')](),controller['create']);router[_0x2349('0x10')](_0x2349('0xd'),auth['isAuthenticated'](),controller[_0x2349('0x11')]);router[_0x2349('0x10')](_0x2349('0xe'),auth[_0x2349('0x9')](),controller[_0x2349('0x12')]);router[_0x2349('0x13')](_0x2349('0xc'),auth[_0x2349('0x9')](),controller['update']);router['delete'](_0x2349('0xc'),auth[_0x2349('0x9')](),controller[_0x2349('0x14')]);router['delete'](_0x2349('0xd'),auth[_0x2349('0x9')](),controller[_0x2349('0x15')]);router[_0x2349('0x16')](_0x2349('0xe'),auth[_0x2349('0x9')](),controller[_0x2349('0x17')]);module[_0x2349('0x18')]=router; \ No newline at end of file +var _0x80e5=['removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','destroy'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x80e5,0xb7));var _0x580e=function(_0x3f4a8e,_0x507c39){_0x3f4a8e=_0x3f4a8e-0x0;var _0x7f68fd=_0x80e5[_0x3f4a8e];return _0x7f68fd;};'use strict';var multer=require(_0x580e('0x0'));var util=require(_0x580e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x580e('0x2'));var router=express[_0x580e('0x3')]();var fs_extra=require(_0x580e('0x4'));var auth=require(_0x580e('0x5'));var interaction=require(_0x580e('0x6'));var config=require(_0x580e('0x7'));var controller=require(_0x580e('0x8'));router[_0x580e('0x9')]('/',auth[_0x580e('0xa')](),controller[_0x580e('0xb')]);router[_0x580e('0x9')](_0x580e('0xc'),auth[_0x580e('0xa')](),controller['describe']);router[_0x580e('0x9')]('/:id',auth[_0x580e('0xa')](),controller['show']);router['get'](_0x580e('0xd'),auth[_0x580e('0xa')](),controller[_0x580e('0xe')]);router[_0x580e('0x9')](_0x580e('0xf'),auth[_0x580e('0xa')](),controller[_0x580e('0x10')]);router[_0x580e('0x9')](_0x580e('0x11'),auth[_0x580e('0xa')](),controller[_0x580e('0x12')]);router[_0x580e('0x13')]('/',auth[_0x580e('0xa')](),controller[_0x580e('0x14')]);router[_0x580e('0x13')](_0x580e('0xf'),auth[_0x580e('0xa')](),controller['addTeams']);router[_0x580e('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x580e('0x15')]);router[_0x580e('0x16')](_0x580e('0x17'),auth['isAuthenticated'](),controller[_0x580e('0x18')]);router[_0x580e('0x19')](_0x580e('0x17'),auth[_0x580e('0xa')](),controller[_0x580e('0x1a')]);router[_0x580e('0x19')](_0x580e('0xf'),auth[_0x580e('0xa')](),controller[_0x580e('0x1b')]);router['delete'](_0x580e('0x11'),auth['isAuthenticated'](),controller[_0x580e('0x1c')]);module[_0x580e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4b7f0a3..e57bb6e 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc4c=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x3e8f4d,_0x2973ed){var _0x590a2e=function(_0x5ebea8){while(--_0x5ebea8){_0x3e8f4d['push'](_0x3e8f4d['shift']());}};_0x590a2e(++_0x2973ed);}(_0xfc4c,0xca));var _0xcfc4=function(_0x2d7da4,_0x33d23d){_0x2d7da4=_0x2d7da4-0x0;var _0x985116=_0xfc4c[_0x2d7da4];return _0x985116;};'use strict';var Sequelize=require(_0xcfc4('0x0'));module[_0xcfc4('0x1')]={'name':{'type':Sequelize[_0xcfc4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcfc4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfc4('0x4')](_0xcfc4('0x5'),'beepall','roundrobin')},'description':{'type':Sequelize[_0xcfc4('0x2')]}}; \ No newline at end of file +var _0x47fd=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x52f57e,_0x4162c5){var _0x94f560=function(_0x249c46){while(--_0x249c46){_0x52f57e['push'](_0x52f57e['shift']());}};_0x94f560(++_0x4162c5);}(_0x47fd,0x13c));var _0xd47f=function(_0x110309,_0x36cd12){_0x110309=_0x110309-0x0;var _0x4c4030=_0x47fd[_0x110309];return _0x4c4030;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'name':{'type':Sequelize[_0xd47f('0x2')],'unique':_0xd47f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd47f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd47f('0x5')](_0xd47f('0x6'),_0xd47f('0x7'),_0xd47f('0x8'))},'description':{'type':Sequelize[_0xd47f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 714ee1d..13d27a8 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe94c=['spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','User','UserId','agent','whatsappPause','updatedAt','%s/%s','Team','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','UserWhatsappQueue','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe94c,0x8f));var _0xce94=function(_0x4ecbc2,_0x49898b){_0x4ecbc2=_0x4ecbc2-0x0;var _0x39470f=_0xe94c[_0x4ecbc2];return _0x39470f;};'use strict';var emlformat=require(_0xce94('0x0'));var rimraf=require(_0xce94('0x1'));var zipdir=require(_0xce94('0x2'));var jsonpatch=require(_0xce94('0x3'));var rp=require(_0xce94('0x4'));var moment=require(_0xce94('0x5'));var BPromise=require(_0xce94('0x6'));var Mustache=require('mustache');var util=require(_0xce94('0x7'));var path=require(_0xce94('0x8'));var sox=require(_0xce94('0x9'));var csv=require(_0xce94('0xa'));var ejs=require(_0xce94('0xb'));var fs=require('fs');var fs_extra=require(_0xce94('0xc'));var _=require(_0xce94('0xd'));var squel=require(_0xce94('0xe'));var crypto=require(_0xce94('0xf'));var jsforce=require(_0xce94('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xce94('0xa'));var querystring=require(_0xce94('0x11'));var Papa=require(_0xce94('0x12'));var Redis=require(_0xce94('0x13'));var authService=require(_0xce94('0x14'));var qs=require(_0xce94('0x15'));var as=require(_0xce94('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce94('0x17'));var utils=require(_0xce94('0x18'));var config=require(_0xce94('0x19'));var licenseUtil=require(_0xce94('0x1a'));var db=require('../../mysqldb')['db'];config[_0xce94('0x1b')]=_[_0xce94('0x1c')](config[_0xce94('0x1b')],{'host':_0xce94('0x1d'),'port':0x18eb});var socket=require(_0xce94('0x1e'))(new Redis(config['redis']));require(_0xce94('0x1f'))[_0xce94('0x20')](socket);function respondWithStatusCode(_0x11d1cb,_0x6a65b){_0x6a65b=_0x6a65b||0xcc;return function(_0x9e526a){if(_0x9e526a){return _0x11d1cb[_0xce94('0x21')](_0x6a65b);}return _0x11d1cb[_0xce94('0x22')](_0x6a65b)['end']();};}function respondWithResult(_0x4a03ad,_0x426c93){_0x426c93=_0x426c93||0xc8;return function(_0x504344){if(_0x504344){return _0x4a03ad[_0xce94('0x22')](_0x426c93)[_0xce94('0x23')](_0x504344);}};}function respondWithFilteredResult(_0x4fdbf9,_0x32ef4d){return function(_0x1585a2){if(_0x1585a2){var _0x3da1f5=typeof _0x32ef4d['offset']==='undefined'&&typeof _0x32ef4d[_0xce94('0x24')]===_0xce94('0x25');var _0x48030c=_0x1585a2[_0xce94('0x26')];var _0x3848db=_0x3da1f5?0x0:_0x32ef4d['offset'];var _0x49979e=_0x3da1f5?_0x1585a2['count']:_0x32ef4d[_0xce94('0x27')]+_0x32ef4d[_0xce94('0x24')];var _0x53610b;if(_0x49979e>=_0x48030c){_0x49979e=_0x48030c;_0x53610b=0xc8;}else{_0x53610b=0xce;}_0x4fdbf9[_0xce94('0x22')](_0x53610b);return _0x4fdbf9[_0xce94('0x28')](_0xce94('0x29'),_0x3848db+'-'+_0x49979e+'/'+_0x48030c)[_0xce94('0x23')](_0x1585a2);}return null;};}function patchUpdates(_0x2f87e2){return function(_0x29c9fb){try{jsonpatch[_0xce94('0x2a')](_0x29c9fb,_0x2f87e2,!![]);}catch(_0x49988a){return BPromise[_0xce94('0x2b')](_0x49988a);}return _0x29c9fb[_0xce94('0x2c')]();};}function saveUpdates(_0x29fb53,_0x3fc8f4){return function(_0x438d55){if(_0x438d55){return _0x438d55[_0xce94('0x2d')](_0x29fb53)[_0xce94('0x2e')](function(_0x5aa517){return _0x5aa517;});}return null;};}function removeEntity(_0x43659d,_0x1aea24){return function(_0x352b76){if(_0x352b76){return _0x352b76[_0xce94('0x2f')]()['then'](function(){var _0x5468b6=_0x352b76[_0xce94('0x30')]({'plain':!![]});var _0x3861d8=_0xce94('0x31');return db['UserProfileResource'][_0xce94('0x2f')]({'where':{'type':_0x3861d8,'resourceId':_0x5468b6['id']}})['then'](function(){return _0x352b76;});})[_0xce94('0x2e')](function(){_0x43659d['status'](0xcc)[_0xce94('0x32')]();});}};}function handleEntityNotFound(_0x33a7f1,_0x20846a){return function(_0x1c6618){if(!_0x1c6618){_0x33a7f1[_0xce94('0x21')](0x194);}return _0x1c6618;};}function handleError(_0x249a0a,_0x470b53){_0x470b53=_0x470b53||0x1f4;return function(_0x4906f7){logger[_0xce94('0x33')](_0x4906f7[_0xce94('0x34')]);if(_0x4906f7['name']){delete _0x4906f7[_0xce94('0x35')];}_0x249a0a[_0xce94('0x22')](_0x470b53)[_0xce94('0x36')](_0x4906f7);};}exports[_0xce94('0x37')]=function(_0x44bdf2,_0x32c89c){var _0x51f40a={},_0x5c2da6={},_0x3c8eee={'count':0x0,'rows':[]};var _0x33e92b=_[_0xce94('0x38')](db['WhatsappQueue']['rawAttributes'],function(_0x2ba9b3){return{'name':_0x2ba9b3[_0xce94('0x39')],'type':_0x2ba9b3[_0xce94('0x3a')][_0xce94('0x3b')]};});_0x5c2da6[_0xce94('0x3c')]=_[_0xce94('0x38')](_0x33e92b,_0xce94('0x35'));_0x5c2da6[_0xce94('0x3d')]=_[_0xce94('0x3e')](_0x44bdf2[_0xce94('0x3d')]);_0x5c2da6['filters']=_[_0xce94('0x3f')](_0x5c2da6[_0xce94('0x3c')],_0x5c2da6['query']);_0x51f40a[_0xce94('0x40')]=_[_0xce94('0x3f')](_0x5c2da6[_0xce94('0x3c')],qs[_0xce94('0x41')](_0x44bdf2[_0xce94('0x3d')][_0xce94('0x41')]));_0x51f40a[_0xce94('0x40')]=_0x51f40a[_0xce94('0x40')][_0xce94('0x42')]?_0x51f40a[_0xce94('0x40')]:_0x5c2da6[_0xce94('0x3c')];if(!_0x44bdf2['query'][_0xce94('0x43')](_0xce94('0x44'))){_0x51f40a[_0xce94('0x24')]=qs[_0xce94('0x24')](_0x44bdf2[_0xce94('0x3d')][_0xce94('0x24')]);_0x51f40a['offset']=qs['offset'](_0x44bdf2[_0xce94('0x3d')]['offset']);}_0x51f40a['order']=qs[_0xce94('0x45')](_0x44bdf2[_0xce94('0x3d')]['sort']);_0x51f40a[_0xce94('0x46')]=qs[_0xce94('0x47')](_[_0xce94('0x48')](_0x44bdf2['query'],_0x5c2da6[_0xce94('0x47')]),_0x33e92b);if(_0x44bdf2[_0xce94('0x3d')][_0xce94('0x49')]){_0x51f40a[_0xce94('0x46')]=_[_0xce94('0x4a')](_0x51f40a[_0xce94('0x46')],{'$or':_[_0xce94('0x38')](_0x33e92b,function(_0x5d2bfc){if(_0x5d2bfc['type']!==_0xce94('0x4b')){var _0x5693ae={};_0x5693ae[_0x5d2bfc[_0xce94('0x35')]]={'$like':'%'+_0x44bdf2[_0xce94('0x3d')][_0xce94('0x49')]+'%'};return _0x5693ae;}})});}_0x51f40a=_['merge']({},_0x51f40a,_0x44bdf2[_0xce94('0x4c')]);var _0x5a4a43={'where':_0x51f40a[_0xce94('0x46')]};return db['WhatsappQueue'][_0xce94('0x26')](_0x5a4a43)[_0xce94('0x2e')](function(_0x3576ac){_0x3c8eee[_0xce94('0x26')]=_0x3576ac;if(_0x44bdf2[_0xce94('0x3d')][_0xce94('0x4d')]){_0x51f40a[_0xce94('0x4e')]=[{'all':!![]}];}return db[_0xce94('0x4f')][_0xce94('0x50')](_0x51f40a);})[_0xce94('0x2e')](function(_0x97cc68){_0x3c8eee[_0xce94('0x51')]=_0x97cc68;return _0x3c8eee;})[_0xce94('0x2e')](respondWithFilteredResult(_0x32c89c,_0x51f40a))[_0xce94('0x52')](handleError(_0x32c89c,null));};exports['show']=function(_0x5350e6,_0x3957f5){var _0x4c1c78={'raw':!![],'where':{'id':_0x5350e6[_0xce94('0x53')]['id']}},_0xed2c9b={};_0xed2c9b[_0xce94('0x3c')]=_[_0xce94('0x3e')](db['WhatsappQueue'][_0xce94('0x54')]);_0xed2c9b['query']=_[_0xce94('0x3e')](_0x5350e6[_0xce94('0x3d')]);_0xed2c9b['filters']=_[_0xce94('0x3f')](_0xed2c9b[_0xce94('0x3c')],_0xed2c9b[_0xce94('0x3d')]);_0x4c1c78['attributes']=_[_0xce94('0x3f')](_0xed2c9b[_0xce94('0x3c')],qs[_0xce94('0x41')](_0x5350e6['query'][_0xce94('0x41')]));_0x4c1c78[_0xce94('0x40')]=_0x4c1c78['attributes'][_0xce94('0x42')]?_0x4c1c78['attributes']:_0xed2c9b[_0xce94('0x3c')];if(_0x5350e6[_0xce94('0x3d')][_0xce94('0x4d')]){_0x4c1c78[_0xce94('0x4e')]=[{'all':!![]}];}_0x4c1c78=_[_0xce94('0x4a')]({},_0x4c1c78,_0x5350e6[_0xce94('0x4c')]);return db[_0xce94('0x4f')][_0xce94('0x55')](_0x4c1c78)[_0xce94('0x2e')](handleEntityNotFound(_0x3957f5,null))[_0xce94('0x2e')](respondWithResult(_0x3957f5,null))[_0xce94('0x52')](handleError(_0x3957f5,null));};exports[_0xce94('0x56')]=function(_0x396d78,_0x566693){return db[_0xce94('0x4f')]['create'](_0x396d78[_0xce94('0x57')],{})['then'](function(_0x6a6a9a){var _0x20710a=_0x396d78['user']['get']({'plain':!![]});if(!_0x20710a)throw new Error(_0xce94('0x58'));if(_0x20710a[_0xce94('0x59')]==='user'){var _0x335938=_0x6a6a9a[_0xce94('0x30')]({'plain':!![]});var _0x259267='WhatsappQueues';return db[_0xce94('0x5a')][_0xce94('0x55')]({'where':{'name':_0x259267,'userProfileId':_0x20710a[_0xce94('0x5b')]},'raw':!![]})[_0xce94('0x2e')](function(_0x78ea6d){if(_0x78ea6d&&_0x78ea6d[_0xce94('0x5c')]===0x0){return db['UserProfileResource'][_0xce94('0x56')]({'name':_0x335938['name'],'resourceId':_0x335938['id'],'type':_0x78ea6d['name'],'sectionId':_0x78ea6d['id']},{})['then'](function(){return _0x6a6a9a;});}else{return _0x6a6a9a;}})[_0xce94('0x52')](function(_0x411a16){logger['error'](_0xce94('0x5d'),_0x411a16);throw _0x411a16;});}return _0x6a6a9a;})[_0xce94('0x2e')](respondWithResult(_0x566693,0xc9))[_0xce94('0x52')](handleError(_0x566693,null));};exports[_0xce94('0x2d')]=function(_0x3153f2,_0x2b1efc){if(_0x3153f2[_0xce94('0x57')]['id']){delete _0x3153f2[_0xce94('0x57')]['id'];}return db['WhatsappQueue'][_0xce94('0x55')]({'where':{'id':_0x3153f2[_0xce94('0x53')]['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x2b1efc,null))[_0xce94('0x2e')](saveUpdates(_0x3153f2[_0xce94('0x57')],null))['then'](respondWithResult(_0x2b1efc,null))['catch'](handleError(_0x2b1efc,null));};exports[_0xce94('0x2f')]=function(_0x153dd1,_0x368ffb){return db[_0xce94('0x4f')]['find']({'where':{'id':_0x153dd1[_0xce94('0x53')]['id']}})['then'](handleEntityNotFound(_0x368ffb,null))[_0xce94('0x2e')](removeEntity(_0x368ffb,null))[_0xce94('0x52')](handleError(_0x368ffb,null));};exports[_0xce94('0x5e')]=function(_0x56ba90,_0x5dd050){return db['WhatsappQueue'][_0xce94('0x5e')]()[_0xce94('0x2e')](respondWithResult(_0x5dd050,null))['catch'](handleError(_0x5dd050,null));};exports[_0xce94('0x5f')]=function(_0x555fd7,_0x549991,_0x45a695){var _0x14f251={'raw':!![],'where':{}},_0x3122f5={},_0x275105;return db[_0xce94('0x4f')][_0xce94('0x60')]({'where':{'id':_0x555fd7['params']['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x549991,null))[_0xce94('0x2e')](function(_0x18346d){if(_0x18346d){_0x275105=_0x18346d[_0xce94('0x30')]({'plain':!![]});_0x3122f5[_0xce94('0x3c')]=_[_0xce94('0x3e')](db['UserWhatsappQueue'][_0xce94('0x54')]);_0x3122f5[_0xce94('0x3d')]=_[_0xce94('0x3e')](_0x555fd7[_0xce94('0x3d')]);_0x3122f5[_0xce94('0x47')]=_[_0xce94('0x3f')](_0x3122f5[_0xce94('0x3c')],_0x3122f5[_0xce94('0x3d')]);_0x14f251[_0xce94('0x40')]=_[_0xce94('0x3f')](_0x3122f5[_0xce94('0x3c')],qs[_0xce94('0x41')](_0x555fd7[_0xce94('0x3d')][_0xce94('0x41')]));_0x14f251[_0xce94('0x40')]=_0x14f251[_0xce94('0x40')][_0xce94('0x42')]?_0x14f251[_0xce94('0x40')]:_0x3122f5[_0xce94('0x3c')];if(!_0x555fd7['query']['hasOwnProperty'](_0xce94('0x44'))){_0x14f251[_0xce94('0x24')]=qs[_0xce94('0x24')](_0x555fd7[_0xce94('0x3d')][_0xce94('0x24')]);_0x14f251['offset']=qs[_0xce94('0x27')](_0x555fd7[_0xce94('0x3d')][_0xce94('0x27')]);}_0x14f251[_0xce94('0x61')]=qs['sort'](_0x555fd7['query'][_0xce94('0x45')]);_0x14f251['where']=qs['filters'](_['pick'](_0x555fd7['query'],_0x3122f5[_0xce94('0x47')]));_0x14f251[_0xce94('0x46')]['WhatsappQueueId']=_0x18346d['id'];if(_0x555fd7['query'][_0xce94('0x49')]){_0x14f251[_0xce94('0x46')]=_['merge'](_0x14f251[_0xce94('0x46')],{'$or':_[_0xce94('0x38')](_0x14f251['attributes'],function(_0x169175){var _0x40ee28={};_0x40ee28[_0x169175]={'$like':'%'+_0x555fd7[_0xce94('0x3d')][_0xce94('0x49')]+'%'};return _0x40ee28;})});}_0x14f251=_[_0xce94('0x4a')]({},_0x14f251,_0x555fd7[_0xce94('0x4c')]);return db['UserWhatsappQueue']['findAll'](_0x14f251);}})[_0xce94('0x2e')](function(_0x4f12a8){if(_0x4f12a8){return db[_0xce94('0x62')]['findAndCountAll']({'where':{'id':_[_0xce94('0x38')](_0x4f12a8,_0xce94('0x63')),'role':_0xce94('0x64')},'attributes':['id','name',_0xce94('0x65'),_0xce94('0x66'),'createdAt']});}})[_0xce94('0x2e')](function(_0x211bf2){if(_0x211bf2){return{'count':_0x211bf2[_0xce94('0x26')],'rows':_[_0xce94('0x38')](_0x211bf2[_0xce94('0x51')],function(_0x5a4f3f){return{'membername':_0x5a4f3f[_0xce94('0x35')],'UserId':_0x5a4f3f['id'],'queue_name':_0x275105[_0xce94('0x35')],'WhatsappQueueId':_0x275105['id'],'interface':util['format'](_0xce94('0x67'),'SIP',_0x5a4f3f[_0xce94('0x35')]),'penalty':0x0,'paused':_0x5a4f3f['whatsappPause'],'createdAt':_0x5a4f3f['createdAt'],'updatedAt':_0x5a4f3f[_0xce94('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xce94('0x2e')](respondWithFilteredResult(_0x549991,_0x14f251))[_0xce94('0x52')](handleError(_0x549991,null));};exports['getTeams']=function(_0x3db9f9,_0x1d791f,_0x55b006){var _0x4174d3={};var _0x24da28={};var _0x1fcee6;var _0x4eec6e;return db[_0xce94('0x4f')][_0xce94('0x60')]({'where':{'id':_0x3db9f9[_0xce94('0x53')]['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x1d791f,null))[_0xce94('0x2e')](function(_0xcb3704){if(_0xcb3704){_0x1fcee6=_0xcb3704;_0x24da28[_0xce94('0x3c')]=_[_0xce94('0x3e')](db[_0xce94('0x68')][_0xce94('0x54')]);_0x24da28['query']=_[_0xce94('0x3e')](_0x3db9f9[_0xce94('0x3d')]);_0x24da28[_0xce94('0x47')]=_[_0xce94('0x3f')](_0x24da28['model'],_0x24da28[_0xce94('0x3d')]);_0x4174d3['attributes']=_[_0xce94('0x3f')](_0x24da28[_0xce94('0x3c')],qs['fields'](_0x3db9f9[_0xce94('0x3d')][_0xce94('0x41')]));_0x4174d3[_0xce94('0x40')]=_0x4174d3[_0xce94('0x40')]['length']?_0x4174d3[_0xce94('0x40')]:_0x24da28['model'];_0x4174d3[_0xce94('0x61')]=qs['sort'](_0x3db9f9[_0xce94('0x3d')][_0xce94('0x45')]);_0x4174d3['where']=qs['filters'](_[_0xce94('0x48')](_0x3db9f9['query'],_0x24da28['filters']));if(_0x3db9f9['query'][_0xce94('0x49')]){_0x4174d3['where']=_[_0xce94('0x4a')](_0x4174d3[_0xce94('0x46')],{'$or':_['map'](_0x4174d3[_0xce94('0x40')],function(_0x36fc7a){var _0x45f5f8={};_0x45f5f8[_0x36fc7a]={'$like':'%'+_0x3db9f9['query'][_0xce94('0x49')]+'%'};return _0x45f5f8;})});}_0x4174d3=_['merge']({},_0x4174d3,_0x3db9f9[_0xce94('0x4c')]);return _0x1fcee6[_0xce94('0x69')](_0x4174d3);}})[_0xce94('0x2e')](function(_0x569aea){if(_0x569aea){_0x4eec6e=_0x569aea['length'];if(!_0x3db9f9[_0xce94('0x3d')][_0xce94('0x43')](_0xce94('0x44'))){_0x4174d3[_0xce94('0x24')]=qs[_0xce94('0x24')](_0x3db9f9[_0xce94('0x3d')][_0xce94('0x24')]);_0x4174d3[_0xce94('0x27')]=qs[_0xce94('0x27')](_0x3db9f9[_0xce94('0x3d')][_0xce94('0x27')]);}return _0x1fcee6[_0xce94('0x69')](_0x4174d3);}})['then'](function(_0x358e1a){if(_0x358e1a){return _0x358e1a?{'count':_0x4eec6e,'rows':_0x358e1a}:null;}})[_0xce94('0x2e')](respondWithResult(_0x1d791f,null))[_0xce94('0x52')](handleError(_0x1d791f,null));};exports[_0xce94('0x6a')]=function(_0x26459f,_0xd86358,_0x568fc6){var _0x476e0f=_0x26459f[_0xce94('0x57')][_0xce94('0x6b')];return db[_0xce94('0x68')]['findAll']({'where':{'id':_0x476e0f},'attributes':['id'],'include':[{'model':db[_0xce94('0x62')],'as':'Agents','attributes':['id',_0xce94('0x35'),_0xce94('0x6c'),_0xce94('0x6d'),'interface'],'raw':!![]}]})[_0xce94('0x2e')](function(_0x1c6313){if(_0x1c6313){var _0x4c8ae4=_[_0xce94('0x6e')](_0x1c6313,function(_0x3a83a5){var _0x49ef61=_0x3a83a5['get']({'plain':!![]});return _0x49ef61[_0xce94('0x6f')];});return db['WhatsappQueue'][_0xce94('0x55')]({'where':{'id':_0x26459f[_0xce94('0x53')]['id']}})[_0xce94('0x2e')](function(_0x285adf){return db[_0xce94('0x70')][_0xce94('0x71')](function(_0x513118){return _0x285adf[_0xce94('0x6a')](_0x476e0f,{'transaction':_0x513118})[_0xce94('0x2e')](function(){return BPromise['each'](_0x4c8ae4,function(_0x56bf79){return db[_0xce94('0x72')][_0xce94('0x73')]({'where':{'UserId':_0x56bf79['id'],'WhatsappQueueId':_0x26459f['params']['id']},'transaction':_0x513118});});})[_0xce94('0x2e')](function(){_0x4c8ae4[_0xce94('0x74')](function(_0x22bd9a){socket[_0xce94('0x75')](_0xce94('0x76'),{'UserId':_0x22bd9a['id'],'WhatsappQueueId':_0x285adf['id']});});});});});}})[_0xce94('0x2e')](respondWithStatusCode(_0xd86358,null))[_0xce94('0x52')](handleError(_0xd86358,null));};exports[_0xce94('0x77')]=function(_0x5ccc5d,_0x40feb9,_0x917c67){return db[_0xce94('0x68')][_0xce94('0x50')]({'where':{'id':_0x5ccc5d[_0xce94('0x3d')][_0xce94('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xce94('0x62')],'as':_0xce94('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xce94('0x2e')](handleEntityNotFound(_0x40feb9,null))['then'](function(_0x406570){var _0x196e8c=_[_0xce94('0x38')](_0x406570,'id');var _0x487336=[];var _0x18942a=[];var _0x1cd8e7=squel['select']();_0x1cd8e7['field']('tq.TeamId')[_0xce94('0x78')](_0xce94('0x79'),'tq')[_0xce94('0x7a')]('user_has_teams','ut',_0xce94('0x7b'))[_0xce94('0x46')](_0xce94('0x7c'),_0x5ccc5d['params']['id']);for(var _0x176ba6=0x0;_0x176ba6<_0x406570['length'];_0x176ba6+=0x1){let _0x396ea0=_0x406570[_0x176ba6];for(var _0x4724fe=0x0;_0x4724fe<_0x396ea0[_0xce94('0x6f')][_0xce94('0x42')];_0x4724fe+=0x1){let _0x599edf=_0x396ea0[_0xce94('0x6f')][_0x4724fe];var _0x506678=_0x1cd8e7['clone']();_0x506678[_0xce94('0x46')]('ut.UserId\x20=\x20?',_0x599edf['id']);_0x18942a[_0xce94('0x7d')](db[_0xce94('0x70')]['query'](_0x506678[_0xce94('0x7e')](),{'type':db[_0xce94('0x70')][_0xce94('0x7f')][_0xce94('0x80')]})[_0xce94('0x2e')](function(_0x42c632){if(_0x42c632[_0xce94('0x42')]===0x1){return _0x599edf['id'];}else{var _0x297e9b=_['every'](_['map'](_0x42c632,_0xce94('0x81')),function(_0x6d4ffd){return _[_0xce94('0x82')](_0x196e8c,_0x6d4ffd);});if(_0x297e9b){return _0x599edf['id'];}}}));}}return BPromise[_0xce94('0x83')](_0x18942a)['then'](function(_0x33b9fb){_0x487336=_(_0x487336)[_0xce94('0x84')](_0x33b9fb)['compact']()['value']();return db[_0xce94('0x4f')][_0xce94('0x55')]({'where':{'id':_0x5ccc5d[_0xce94('0x53')]['id']}})['then'](function(_0x49c5e6){return db[_0xce94('0x70')][_0xce94('0x71')](function(_0x371d90){return _0x49c5e6[_0xce94('0x77')](_0x5ccc5d[_0xce94('0x3d')][_0xce94('0x6b')],{'transaction':_0x371d90})[_0xce94('0x2e')](function(){if(!_[_0xce94('0x85')](_0x487336)){return _0x49c5e6[_0xce94('0x86')](_0x487336,{'transaction':_0x371d90});}})['then'](function(){_0x487336[_0xce94('0x74')](function(_0x19b41e){socket[_0xce94('0x75')](_0xce94('0x87'),{'UserId':_0x19b41e,'WhatsappQueueId':_0x49c5e6['id']});});});});});});})['then'](respondWithStatusCode(_0x40feb9,null))[_0xce94('0x52')](handleError(_0x40feb9,null));};exports[_0xce94('0x88')]=function(_0x3cae29,_0x3739ea,_0x3db8f3){return db[_0xce94('0x4f')][_0xce94('0x55')]({'where':{'id':_0x3cae29['params']['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x3739ea,null))['then'](function(_0x3f5a5f){if(_0x3f5a5f){return _0x3f5a5f[_0xce94('0x88')](_0x3cae29[_0xce94('0x57')]['ids'],_['omit'](_0x3cae29[_0xce94('0x57')],[_0xce94('0x6b'),'id'])||{})[_0xce94('0x89')](function(_0x4e5037){for(var _0x866c7b=0x0;_0x866c7b<_0x3cae29['body'][_0xce94('0x6b')]['length'];_0x866c7b+=0x1){socket[_0xce94('0x75')]('userWhatsappQueue:save',{'UserId':Number(_0x3cae29['body'][_0xce94('0x6b')][_0x866c7b]),'WhatsappQueueId':Number(_0x3cae29['params']['id'])});}return _0x4e5037;});}})[_0xce94('0x2e')](respondWithResult(_0x3739ea,null))[_0xce94('0x52')](handleError(_0x3739ea,null));};exports['removeAgents']=function(_0x2a05c3,_0x1ae0ff,_0x240039){return db[_0xce94('0x4f')][_0xce94('0x55')]({'where':{'id':_0x2a05c3[_0xce94('0x53')]['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x1ae0ff,null))[_0xce94('0x2e')](function(_0x47d168){if(_0x47d168){return _0x47d168[_0xce94('0x86')](_0x2a05c3['query'][_0xce94('0x6b')])[_0xce94('0x2e')](function(){if(_[_0xce94('0x8a')](_0x2a05c3[_0xce94('0x3d')][_0xce94('0x6b')])){for(var _0x133219=0x0;_0x133219<_0x2a05c3[_0xce94('0x3d')][_0xce94('0x6b')]['length'];_0x133219+=0x1){socket[_0xce94('0x75')](_0xce94('0x87'),{'UserId':Number(_0x2a05c3[_0xce94('0x3d')][_0xce94('0x6b')][_0x133219]),'WhatsappQueueId':Number(_0x2a05c3[_0xce94('0x53')]['id'])});}}else{socket[_0xce94('0x75')](_0xce94('0x87'),{'UserId':Number(_0x2a05c3[_0xce94('0x3d')][_0xce94('0x6b')]),'WhatsappQueueId':Number(_0x2a05c3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1ae0ff,null))[_0xce94('0x52')](handleError(_0x1ae0ff,null));};exports[_0xce94('0x8b')]=function(_0x20b91f,_0x2ed7fa,_0x2b0713){var _0x45165c={};var _0x5806bf={};var _0x2b24c6;var _0x330160;return db[_0xce94('0x4f')][_0xce94('0x60')]({'where':{'id':_0x20b91f['params']['id']}})[_0xce94('0x2e')](handleEntityNotFound(_0x2ed7fa,null))[_0xce94('0x2e')](function(_0x6ac92e){if(_0x6ac92e){_0x2b24c6=_0x6ac92e;_0x5806bf[_0xce94('0x3c')]=_[_0xce94('0x3e')](db[_0xce94('0x62')][_0xce94('0x54')]);_0x5806bf['query']=_['keys'](_0x20b91f[_0xce94('0x3d')]);_0x5806bf[_0xce94('0x47')]=_[_0xce94('0x3f')](_0x5806bf[_0xce94('0x3c')],_0x5806bf[_0xce94('0x3d')]);_0x45165c[_0xce94('0x40')]=_[_0xce94('0x3f')](_0x5806bf['model'],qs['fields'](_0x20b91f['query'][_0xce94('0x41')]));_0x45165c[_0xce94('0x40')]=_0x45165c[_0xce94('0x40')][_0xce94('0x42')]?_0x45165c['attributes']:_0x5806bf[_0xce94('0x3c')];_0x45165c[_0xce94('0x61')]=qs[_0xce94('0x45')](_0x20b91f['query'][_0xce94('0x45')]);_0x45165c[_0xce94('0x46')]=qs['filters'](_[_0xce94('0x48')](_0x20b91f[_0xce94('0x3d')],_0x5806bf[_0xce94('0x47')]));if(_0x20b91f[_0xce94('0x3d')][_0xce94('0x49')]){_0x45165c[_0xce94('0x46')]=_['merge'](_0x45165c['where'],{'$or':_['map'](_0x45165c[_0xce94('0x40')],function(_0x26a64a){var _0x4b1f55={};_0x4b1f55[_0x26a64a]={'$like':'%'+_0x20b91f[_0xce94('0x3d')][_0xce94('0x49')]+'%'};return _0x4b1f55;})});}_0x45165c=_['merge']({},_0x45165c,_0x20b91f[_0xce94('0x4c')]);return _0x2b24c6[_0xce94('0x8b')](_0x45165c);}})[_0xce94('0x2e')](function(_0x1cda00){if(_0x1cda00){_0x330160=_0x1cda00[_0xce94('0x42')];if(!_0x20b91f[_0xce94('0x3d')]['hasOwnProperty'](_0xce94('0x44'))){_0x45165c[_0xce94('0x24')]=qs[_0xce94('0x24')](_0x20b91f['query'][_0xce94('0x24')]);_0x45165c[_0xce94('0x27')]=qs['offset'](_0x20b91f[_0xce94('0x3d')][_0xce94('0x27')]);}return _0x2b24c6[_0xce94('0x8b')](_0x45165c);}})['then'](function(_0x341d8c){if(_0x341d8c){return _0x341d8c?{'count':_0x330160,'rows':_0x341d8c}:null;}})[_0xce94('0x2e')](respondWithResult(_0x2ed7fa,null))[_0xce94('0x52')](handleError(_0x2ed7fa,null));}; \ No newline at end of file +var _0x1309=['name','send','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','map','include','catch','params','keys','length','includeAll','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAll','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','rows','format','SIP','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','field','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','SELECT','every','all','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack'];(function(_0x45b7a8,_0x314d97){var _0x4bab0a=function(_0x567a7e){while(--_0x567a7e){_0x45b7a8['push'](_0x45b7a8['shift']());}};_0x4bab0a(++_0x314d97);}(_0x1309,0x1ee));var _0x9130=function(_0x3c7eb4,_0x19a313){_0x3c7eb4=_0x3c7eb4-0x0;var _0x567ae8=_0x1309[_0x3c7eb4];return _0x567ae8;};'use strict';var emlformat=require(_0x9130('0x0'));var rimraf=require(_0x9130('0x1'));var zipdir=require(_0x9130('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9130('0x3'));var moment=require(_0x9130('0x4'));var BPromise=require(_0x9130('0x5'));var Mustache=require('mustache');var util=require(_0x9130('0x6'));var path=require('path');var sox=require(_0x9130('0x7'));var csv=require(_0x9130('0x8'));var ejs=require(_0x9130('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9130('0xa'));var squel=require('squel');var crypto=require(_0x9130('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9130('0xc'));var toCsv=require(_0x9130('0x8'));var querystring=require('querystring');var Papa=require(_0x9130('0xd'));var Redis=require(_0x9130('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9130('0xf'));var as=require(_0x9130('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9130('0x11'));var utils=require(_0x9130('0x12'));var config=require(_0x9130('0x13'));var licenseUtil=require(_0x9130('0x14'));var db=require('../../mysqldb')['db'];config[_0x9130('0x15')]=_[_0x9130('0x16')](config['redis'],{'host':_0x9130('0x17'),'port':0x18eb});var socket=require(_0x9130('0x18'))(new Redis(config['redis']));require(_0x9130('0x19'))[_0x9130('0x1a')](socket);function respondWithStatusCode(_0x2d6aed,_0xea4be9){_0xea4be9=_0xea4be9||0xcc;return function(_0x236b45){if(_0x236b45){return _0x2d6aed[_0x9130('0x1b')](_0xea4be9);}return _0x2d6aed[_0x9130('0x1c')](_0xea4be9)[_0x9130('0x1d')]();};}function respondWithResult(_0x517755,_0x131185){_0x131185=_0x131185||0xc8;return function(_0xe0e1d7){if(_0xe0e1d7){return _0x517755[_0x9130('0x1c')](_0x131185)[_0x9130('0x1e')](_0xe0e1d7);}};}function respondWithFilteredResult(_0x403235,_0x17d2d2){return function(_0x39a21f){if(_0x39a21f){var _0x12474f=typeof _0x17d2d2[_0x9130('0x1f')]===_0x9130('0x20')&&typeof _0x17d2d2[_0x9130('0x21')]==='undefined';var _0x203127=_0x39a21f['count'];var _0x21249a=_0x12474f?0x0:_0x17d2d2[_0x9130('0x1f')];var _0x16d782=_0x12474f?_0x39a21f[_0x9130('0x22')]:_0x17d2d2[_0x9130('0x1f')]+_0x17d2d2['limit'];var _0x361673;if(_0x16d782>=_0x203127){_0x16d782=_0x203127;_0x361673=0xc8;}else{_0x361673=0xce;}_0x403235[_0x9130('0x1c')](_0x361673);return _0x403235['set'](_0x9130('0x23'),_0x21249a+'-'+_0x16d782+'/'+_0x203127)['json'](_0x39a21f);}return null;};}function patchUpdates(_0x266e1d){return function(_0x3bad06){try{jsonpatch[_0x9130('0x24')](_0x3bad06,_0x266e1d,!![]);}catch(_0x33479f){return BPromise[_0x9130('0x25')](_0x33479f);}return _0x3bad06[_0x9130('0x26')]();};}function saveUpdates(_0x3c3f50,_0x3fc5b0){return function(_0x36b8de){if(_0x36b8de){return _0x36b8de[_0x9130('0x27')](_0x3c3f50)[_0x9130('0x28')](function(_0x1002df){return _0x1002df;});}return null;};}function removeEntity(_0x547db9,_0x2be680){return function(_0x56f4e6){if(_0x56f4e6){return _0x56f4e6[_0x9130('0x29')]()[_0x9130('0x28')](function(){var _0x11fe13=_0x56f4e6[_0x9130('0x2a')]({'plain':!![]});var _0x23eb1e=_0x9130('0x2b');return db[_0x9130('0x2c')][_0x9130('0x29')]({'where':{'type':_0x23eb1e,'resourceId':_0x11fe13['id']}})[_0x9130('0x28')](function(){return _0x56f4e6;});})[_0x9130('0x28')](function(){_0x547db9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b6ad,_0x36cd8e){return function(_0x18c5b2){if(!_0x18c5b2){_0x26b6ad[_0x9130('0x1b')](0x194);}return _0x18c5b2;};}function handleError(_0x445eae,_0x2ab86a){_0x2ab86a=_0x2ab86a||0x1f4;return function(_0x5324a0){logger['error'](_0x5324a0[_0x9130('0x2d')]);if(_0x5324a0[_0x9130('0x2e')]){delete _0x5324a0['name'];}_0x445eae[_0x9130('0x1c')](_0x2ab86a)[_0x9130('0x2f')](_0x5324a0);};}exports['index']=function(_0x490aa6,_0x1178d3){var _0x5050ab={},_0x4f43e7={},_0x2c5bf0={'count':0x0,'rows':[]};var _0xcce769=_['map'](db[_0x9130('0x30')][_0x9130('0x31')],function(_0x3a0162){return{'name':_0x3a0162[_0x9130('0x32')],'type':_0x3a0162[_0x9130('0x33')][_0x9130('0x34')]};});_0x4f43e7[_0x9130('0x35')]=_['map'](_0xcce769,_0x9130('0x2e'));_0x4f43e7[_0x9130('0x36')]=_['keys'](_0x490aa6[_0x9130('0x36')]);_0x4f43e7[_0x9130('0x37')]=_[_0x9130('0x38')](_0x4f43e7['model'],_0x4f43e7['query']);_0x5050ab['attributes']=_[_0x9130('0x38')](_0x4f43e7[_0x9130('0x35')],qs[_0x9130('0x39')](_0x490aa6[_0x9130('0x36')][_0x9130('0x39')]));_0x5050ab[_0x9130('0x3a')]=_0x5050ab[_0x9130('0x3a')]['length']?_0x5050ab[_0x9130('0x3a')]:_0x4f43e7['model'];if(!_0x490aa6[_0x9130('0x36')]['hasOwnProperty'](_0x9130('0x3b'))){_0x5050ab[_0x9130('0x21')]=qs['limit'](_0x490aa6[_0x9130('0x36')][_0x9130('0x21')]);_0x5050ab[_0x9130('0x1f')]=qs[_0x9130('0x1f')](_0x490aa6['query'][_0x9130('0x1f')]);}_0x5050ab[_0x9130('0x3c')]=qs[_0x9130('0x3d')](_0x490aa6['query'][_0x9130('0x3d')]);_0x5050ab['where']=qs[_0x9130('0x37')](_[_0x9130('0x3e')](_0x490aa6[_0x9130('0x36')],_0x4f43e7[_0x9130('0x37')]),_0xcce769);if(_0x490aa6[_0x9130('0x36')][_0x9130('0x3f')]){_0x5050ab[_0x9130('0x40')]=_[_0x9130('0x41')](_0x5050ab[_0x9130('0x40')],{'$or':_[_0x9130('0x42')](_0xcce769,function(_0x10e1a5){if(_0x10e1a5[_0x9130('0x33')]!=='VIRTUAL'){var _0x541134={};_0x541134[_0x10e1a5[_0x9130('0x2e')]]={'$like':'%'+_0x490aa6[_0x9130('0x36')][_0x9130('0x3f')]+'%'};return _0x541134;}})});}_0x5050ab=_[_0x9130('0x41')]({},_0x5050ab,_0x490aa6['options']);var _0x6257e={'where':_0x5050ab[_0x9130('0x40')]};return db[_0x9130('0x30')]['count'](_0x6257e)[_0x9130('0x28')](function(_0x346e7b){_0x2c5bf0[_0x9130('0x22')]=_0x346e7b;if(_0x490aa6[_0x9130('0x36')]['includeAll']){_0x5050ab[_0x9130('0x43')]=[{'all':!![]}];}return db[_0x9130('0x30')]['findAll'](_0x5050ab);})[_0x9130('0x28')](function(_0x28d97d){_0x2c5bf0['rows']=_0x28d97d;return _0x2c5bf0;})[_0x9130('0x28')](respondWithFilteredResult(_0x1178d3,_0x5050ab))[_0x9130('0x44')](handleError(_0x1178d3,null));};exports['show']=function(_0x1c4e43,_0x4bd93e){var _0x589849={'raw':!![],'where':{'id':_0x1c4e43[_0x9130('0x45')]['id']}},_0x4c3748={};_0x4c3748[_0x9130('0x35')]=_[_0x9130('0x46')](db[_0x9130('0x30')][_0x9130('0x31')]);_0x4c3748[_0x9130('0x36')]=_[_0x9130('0x46')](_0x1c4e43[_0x9130('0x36')]);_0x4c3748[_0x9130('0x37')]=_[_0x9130('0x38')](_0x4c3748[_0x9130('0x35')],_0x4c3748['query']);_0x589849[_0x9130('0x3a')]=_[_0x9130('0x38')](_0x4c3748['model'],qs[_0x9130('0x39')](_0x1c4e43[_0x9130('0x36')]['fields']));_0x589849[_0x9130('0x3a')]=_0x589849[_0x9130('0x3a')][_0x9130('0x47')]?_0x589849['attributes']:_0x4c3748[_0x9130('0x35')];if(_0x1c4e43['query'][_0x9130('0x48')]){_0x589849[_0x9130('0x43')]=[{'all':!![]}];}_0x589849=_[_0x9130('0x41')]({},_0x589849,_0x1c4e43[_0x9130('0x49')]);return db[_0x9130('0x30')][_0x9130('0x4a')](_0x589849)['then'](handleEntityNotFound(_0x4bd93e,null))[_0x9130('0x28')](respondWithResult(_0x4bd93e,null))[_0x9130('0x44')](handleError(_0x4bd93e,null));};exports['create']=function(_0x119ab3,_0x3437f5){return db['WhatsappQueue']['create'](_0x119ab3[_0x9130('0x4b')],{})['then'](function(_0x5b6e08){var _0x2a39be=_0x119ab3['user']['get']({'plain':!![]});if(!_0x2a39be)throw new Error(_0x9130('0x4c'));if(_0x2a39be['role']===_0x9130('0x4d')){var _0x57c4cf=_0x5b6e08['get']({'plain':!![]});var _0x2fac34='WhatsappQueues';return db[_0x9130('0x4e')][_0x9130('0x4a')]({'where':{'name':_0x2fac34,'userProfileId':_0x2a39be['userProfileId']},'raw':!![]})['then'](function(_0x13ca43){if(_0x13ca43&&_0x13ca43['autoAssociation']===0x0){return db[_0x9130('0x2c')][_0x9130('0x4f')]({'name':_0x57c4cf['name'],'resourceId':_0x57c4cf['id'],'type':_0x13ca43[_0x9130('0x2e')],'sectionId':_0x13ca43['id']},{})[_0x9130('0x28')](function(){return _0x5b6e08;});}else{return _0x5b6e08;}})[_0x9130('0x44')](function(_0x46fdda){logger[_0x9130('0x50')](_0x9130('0x51'),_0x46fdda);throw _0x46fdda;});}return _0x5b6e08;})['then'](respondWithResult(_0x3437f5,0xc9))['catch'](handleError(_0x3437f5,null));};exports[_0x9130('0x27')]=function(_0x25dc11,_0x3bf5cf){if(_0x25dc11[_0x9130('0x4b')]['id']){delete _0x25dc11[_0x9130('0x4b')]['id'];}return db[_0x9130('0x30')][_0x9130('0x4a')]({'where':{'id':_0x25dc11['params']['id']}})[_0x9130('0x28')](handleEntityNotFound(_0x3bf5cf,null))[_0x9130('0x28')](saveUpdates(_0x25dc11[_0x9130('0x4b')],null))[_0x9130('0x28')](respondWithResult(_0x3bf5cf,null))[_0x9130('0x44')](handleError(_0x3bf5cf,null));};exports[_0x9130('0x29')]=function(_0xf2bb9b,_0x448dc2){return db[_0x9130('0x30')]['find']({'where':{'id':_0xf2bb9b[_0x9130('0x45')]['id']}})[_0x9130('0x28')](handleEntityNotFound(_0x448dc2,null))['then'](removeEntity(_0x448dc2,null))[_0x9130('0x44')](handleError(_0x448dc2,null));};exports[_0x9130('0x52')]=function(_0x169886,_0x4af3a4){return db['WhatsappQueue'][_0x9130('0x52')]()[_0x9130('0x28')](respondWithResult(_0x4af3a4,null))[_0x9130('0x44')](handleError(_0x4af3a4,null));};exports[_0x9130('0x53')]=function(_0x66f5d4,_0x4fd9e3,_0x22f7ee){var _0x34a7f6={'raw':!![],'where':{}},_0x1485fd={},_0x57ce13;return db[_0x9130('0x30')]['findOne']({'where':{'id':_0x66f5d4['params']['id']}})[_0x9130('0x28')](handleEntityNotFound(_0x4fd9e3,null))[_0x9130('0x28')](function(_0xf6c12c){if(_0xf6c12c){_0x57ce13=_0xf6c12c[_0x9130('0x2a')]({'plain':!![]});_0x1485fd[_0x9130('0x35')]=_['keys'](db[_0x9130('0x54')]['rawAttributes']);_0x1485fd[_0x9130('0x36')]=_[_0x9130('0x46')](_0x66f5d4['query']);_0x1485fd['filters']=_[_0x9130('0x38')](_0x1485fd[_0x9130('0x35')],_0x1485fd[_0x9130('0x36')]);_0x34a7f6['attributes']=_[_0x9130('0x38')](_0x1485fd[_0x9130('0x35')],qs[_0x9130('0x39')](_0x66f5d4['query'][_0x9130('0x39')]));_0x34a7f6[_0x9130('0x3a')]=_0x34a7f6[_0x9130('0x3a')]['length']?_0x34a7f6[_0x9130('0x3a')]:_0x1485fd[_0x9130('0x35')];if(!_0x66f5d4[_0x9130('0x36')][_0x9130('0x55')]('nolimit')){_0x34a7f6[_0x9130('0x21')]=qs[_0x9130('0x21')](_0x66f5d4[_0x9130('0x36')]['limit']);_0x34a7f6[_0x9130('0x1f')]=qs[_0x9130('0x1f')](_0x66f5d4['query']['offset']);}_0x34a7f6['order']=qs[_0x9130('0x3d')](_0x66f5d4[_0x9130('0x36')][_0x9130('0x3d')]);_0x34a7f6[_0x9130('0x40')]=qs[_0x9130('0x37')](_[_0x9130('0x3e')](_0x66f5d4[_0x9130('0x36')],_0x1485fd[_0x9130('0x37')]));_0x34a7f6[_0x9130('0x40')][_0x9130('0x56')]=_0xf6c12c['id'];if(_0x66f5d4['query'][_0x9130('0x3f')]){_0x34a7f6['where']=_['merge'](_0x34a7f6[_0x9130('0x40')],{'$or':_[_0x9130('0x42')](_0x34a7f6[_0x9130('0x3a')],function(_0x8d2d98){var _0x499058={};_0x499058[_0x8d2d98]={'$like':'%'+_0x66f5d4[_0x9130('0x36')][_0x9130('0x3f')]+'%'};return _0x499058;})});}_0x34a7f6=_[_0x9130('0x41')]({},_0x34a7f6,_0x66f5d4[_0x9130('0x49')]);return db['UserWhatsappQueue'][_0x9130('0x57')](_0x34a7f6);}})[_0x9130('0x28')](function(_0x325d80){if(_0x325d80){return db[_0x9130('0x58')][_0x9130('0x59')]({'where':{'id':_[_0x9130('0x42')](_0x325d80,_0x9130('0x5a')),'role':'agent'},'attributes':['id',_0x9130('0x2e'),_0x9130('0x5b'),_0x9130('0x5c'),_0x9130('0x5d')]});}})[_0x9130('0x28')](function(_0x1c2b84){if(_0x1c2b84){return{'count':_0x1c2b84[_0x9130('0x22')],'rows':_[_0x9130('0x42')](_0x1c2b84[_0x9130('0x5e')],function(_0x45d679){return{'membername':_0x45d679[_0x9130('0x2e')],'UserId':_0x45d679['id'],'queue_name':_0x57ce13[_0x9130('0x2e')],'WhatsappQueueId':_0x57ce13['id'],'interface':util[_0x9130('0x5f')]('%s/%s',_0x9130('0x60'),_0x45d679[_0x9130('0x2e')]),'penalty':0x0,'paused':_0x45d679['whatsappPause'],'createdAt':_0x45d679['createdAt'],'updatedAt':_0x45d679[_0x9130('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9130('0x28')](respondWithFilteredResult(_0x4fd9e3,_0x34a7f6))[_0x9130('0x44')](handleError(_0x4fd9e3,null));};exports[_0x9130('0x61')]=function(_0x22aac8,_0x85d6d4,_0x151fd3){var _0x132491={};var _0x2dbe84={};var _0x267561;var _0x680f0b;return db['WhatsappQueue'][_0x9130('0x62')]({'where':{'id':_0x22aac8[_0x9130('0x45')]['id']}})[_0x9130('0x28')](handleEntityNotFound(_0x85d6d4,null))[_0x9130('0x28')](function(_0x64d451){if(_0x64d451){_0x267561=_0x64d451;_0x2dbe84[_0x9130('0x35')]=_['keys'](db[_0x9130('0x63')]['rawAttributes']);_0x2dbe84[_0x9130('0x36')]=_[_0x9130('0x46')](_0x22aac8[_0x9130('0x36')]);_0x2dbe84[_0x9130('0x37')]=_[_0x9130('0x38')](_0x2dbe84[_0x9130('0x35')],_0x2dbe84[_0x9130('0x36')]);_0x132491[_0x9130('0x3a')]=_[_0x9130('0x38')](_0x2dbe84[_0x9130('0x35')],qs[_0x9130('0x39')](_0x22aac8[_0x9130('0x36')]['fields']));_0x132491['attributes']=_0x132491[_0x9130('0x3a')]['length']?_0x132491[_0x9130('0x3a')]:_0x2dbe84[_0x9130('0x35')];_0x132491[_0x9130('0x3c')]=qs[_0x9130('0x3d')](_0x22aac8[_0x9130('0x36')][_0x9130('0x3d')]);_0x132491[_0x9130('0x40')]=qs['filters'](_[_0x9130('0x3e')](_0x22aac8[_0x9130('0x36')],_0x2dbe84[_0x9130('0x37')]));if(_0x22aac8['query'][_0x9130('0x3f')]){_0x132491[_0x9130('0x40')]=_['merge'](_0x132491[_0x9130('0x40')],{'$or':_[_0x9130('0x42')](_0x132491[_0x9130('0x3a')],function(_0x300916){var _0x415f53={};_0x415f53[_0x300916]={'$like':'%'+_0x22aac8[_0x9130('0x36')][_0x9130('0x3f')]+'%'};return _0x415f53;})});}_0x132491=_['merge']({},_0x132491,_0x22aac8['options']);return _0x267561[_0x9130('0x61')](_0x132491);}})['then'](function(_0x20aaea){if(_0x20aaea){_0x680f0b=_0x20aaea[_0x9130('0x47')];if(!_0x22aac8[_0x9130('0x36')][_0x9130('0x55')](_0x9130('0x3b'))){_0x132491['limit']=qs['limit'](_0x22aac8[_0x9130('0x36')][_0x9130('0x21')]);_0x132491['offset']=qs[_0x9130('0x1f')](_0x22aac8[_0x9130('0x36')][_0x9130('0x1f')]);}return _0x267561['getTeams'](_0x132491);}})[_0x9130('0x28')](function(_0x490c0b){if(_0x490c0b){return _0x490c0b?{'count':_0x680f0b,'rows':_0x490c0b}:null;}})[_0x9130('0x28')](respondWithResult(_0x85d6d4,null))['catch'](handleError(_0x85d6d4,null));};exports[_0x9130('0x64')]=function(_0x3bbfcc,_0x56af4a,_0x16ebd7){var _0x211ee0=_0x3bbfcc[_0x9130('0x4b')][_0x9130('0x65')];return db['Team']['findAll']({'where':{'id':_0x211ee0},'attributes':['id'],'include':[{'model':db[_0x9130('0x58')],'as':'Agents','attributes':['id',_0x9130('0x2e'),_0x9130('0x66'),_0x9130('0x67'),_0x9130('0x68')],'raw':!![]}]})['then'](function(_0x396f34){if(_0x396f34){var _0x4cadc2=_[_0x9130('0x69')](_0x396f34,function(_0x57aed0){var _0x4922a0=_0x57aed0['get']({'plain':!![]});return _0x4922a0[_0x9130('0x6a')];});return db[_0x9130('0x30')][_0x9130('0x4a')]({'where':{'id':_0x3bbfcc['params']['id']}})['then'](function(_0x48a087){return db['sequelize'][_0x9130('0x6b')](function(_0x2b42c5){return _0x48a087[_0x9130('0x64')](_0x211ee0,{'transaction':_0x2b42c5})[_0x9130('0x28')](function(){return BPromise[_0x9130('0x6c')](_0x4cadc2,function(_0x32d495){return db[_0x9130('0x54')][_0x9130('0x6d')]({'where':{'UserId':_0x32d495['id'],'WhatsappQueueId':_0x3bbfcc[_0x9130('0x45')]['id']},'transaction':_0x2b42c5});});})[_0x9130('0x28')](function(){_0x4cadc2['forEach'](function(_0x2690d2){socket[_0x9130('0x6e')](_0x9130('0x6f'),{'UserId':_0x2690d2['id'],'WhatsappQueueId':_0x48a087['id']});});});});});}})['then'](respondWithStatusCode(_0x56af4a,null))[_0x9130('0x44')](handleError(_0x56af4a,null));};exports[_0x9130('0x70')]=function(_0x1151db,_0x4928f6,_0x326b46){return db['Team'][_0x9130('0x57')]({'where':{'id':_0x1151db[_0x9130('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9130('0x58')],'as':_0x9130('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x9130('0x28')](handleEntityNotFound(_0x4928f6,null))[_0x9130('0x28')](function(_0x2e98a8){var _0x54b70f=_['map'](_0x2e98a8,'id');var _0x19ad0c=[];var _0x25fb45=[];var _0x355a74=squel['select']();_0x355a74[_0x9130('0x71')]('tq.TeamId')[_0x9130('0x72')](_0x9130('0x73'),'tq')['join'](_0x9130('0x74'),'ut',_0x9130('0x75'))[_0x9130('0x40')](_0x9130('0x76'),_0x1151db[_0x9130('0x45')]['id']);for(var _0x29d72c=0x0;_0x29d72c<_0x2e98a8[_0x9130('0x47')];_0x29d72c+=0x1){let _0x2f83f0=_0x2e98a8[_0x29d72c];for(var _0x201d55=0x0;_0x201d55<_0x2f83f0[_0x9130('0x6a')][_0x9130('0x47')];_0x201d55+=0x1){let _0x5687ad=_0x2f83f0['Agents'][_0x201d55];var _0x5a7f9a=_0x355a74['clone']();_0x5a7f9a[_0x9130('0x40')](_0x9130('0x77'),_0x5687ad['id']);_0x25fb45['push'](db[_0x9130('0x78')][_0x9130('0x36')](_0x5a7f9a['toString'](),{'type':db[_0x9130('0x78')]['QueryTypes'][_0x9130('0x79')]})[_0x9130('0x28')](function(_0x160cfc){if(_0x160cfc[_0x9130('0x47')]===0x1){return _0x5687ad['id'];}else{var _0x5011d1=_[_0x9130('0x7a')](_[_0x9130('0x42')](_0x160cfc,'TeamId'),function(_0x30ec94){return _['includes'](_0x54b70f,_0x30ec94);});if(_0x5011d1){return _0x5687ad['id'];}}}));}}return BPromise[_0x9130('0x7b')](_0x25fb45)['then'](function(_0x4f76b4){_0x19ad0c=_(_0x19ad0c)[_0x9130('0x7c')](_0x4f76b4)[_0x9130('0x7d')]()[_0x9130('0x7e')]();return db[_0x9130('0x30')][_0x9130('0x4a')]({'where':{'id':_0x1151db[_0x9130('0x45')]['id']}})['then'](function(_0x55b6d6){return db['sequelize']['transaction'](function(_0x38021d){return _0x55b6d6[_0x9130('0x70')](_0x1151db[_0x9130('0x36')][_0x9130('0x65')],{'transaction':_0x38021d})[_0x9130('0x28')](function(){if(!_[_0x9130('0x7f')](_0x19ad0c)){return _0x55b6d6[_0x9130('0x80')](_0x19ad0c,{'transaction':_0x38021d});}})[_0x9130('0x28')](function(){_0x19ad0c[_0x9130('0x81')](function(_0x2befe5){socket[_0x9130('0x6e')](_0x9130('0x82'),{'UserId':_0x2befe5,'WhatsappQueueId':_0x55b6d6['id']});});});});});});})['then'](respondWithStatusCode(_0x4928f6,null))[_0x9130('0x44')](handleError(_0x4928f6,null));};exports[_0x9130('0x83')]=function(_0x4b50a8,_0x37c9b2,_0xb08949){return db[_0x9130('0x30')]['find']({'where':{'id':_0x4b50a8[_0x9130('0x45')]['id']}})['then'](handleEntityNotFound(_0x37c9b2,null))[_0x9130('0x28')](function(_0x45341e){if(_0x45341e){return _0x45341e[_0x9130('0x83')](_0x4b50a8[_0x9130('0x4b')][_0x9130('0x65')],_[_0x9130('0x84')](_0x4b50a8['body'],['ids','id'])||{})[_0x9130('0x85')](function(_0x3c4e1a){for(var _0x401907=0x0;_0x401907<_0x4b50a8[_0x9130('0x4b')][_0x9130('0x65')][_0x9130('0x47')];_0x401907+=0x1){socket[_0x9130('0x6e')](_0x9130('0x6f'),{'UserId':Number(_0x4b50a8[_0x9130('0x4b')]['ids'][_0x401907]),'WhatsappQueueId':Number(_0x4b50a8[_0x9130('0x45')]['id'])});}return _0x3c4e1a;});}})['then'](respondWithResult(_0x37c9b2,null))[_0x9130('0x44')](handleError(_0x37c9b2,null));};exports[_0x9130('0x80')]=function(_0x1fe638,_0x39594f,_0x284661){return db[_0x9130('0x30')][_0x9130('0x4a')]({'where':{'id':_0x1fe638['params']['id']}})[_0x9130('0x28')](handleEntityNotFound(_0x39594f,null))[_0x9130('0x28')](function(_0x22600f){if(_0x22600f){return _0x22600f[_0x9130('0x80')](_0x1fe638['query']['ids'])[_0x9130('0x28')](function(){if(_['isArray'](_0x1fe638[_0x9130('0x36')]['ids'])){for(var _0x51969b=0x0;_0x51969b<_0x1fe638['query'][_0x9130('0x65')][_0x9130('0x47')];_0x51969b+=0x1){socket[_0x9130('0x6e')](_0x9130('0x82'),{'UserId':Number(_0x1fe638['query'][_0x9130('0x65')][_0x51969b]),'WhatsappQueueId':Number(_0x1fe638[_0x9130('0x45')]['id'])});}}else{socket['emit'](_0x9130('0x82'),{'UserId':Number(_0x1fe638[_0x9130('0x36')][_0x9130('0x65')]),'WhatsappQueueId':Number(_0x1fe638[_0x9130('0x45')]['id'])});}});}})[_0x9130('0x28')](respondWithStatusCode(_0x39594f,null))[_0x9130('0x44')](handleError(_0x39594f,null));};exports[_0x9130('0x86')]=function(_0x2b876e,_0x2f7f6d,_0x2aba1a){var _0x51d7c0={};var _0x4dbb98={};var _0x1a964d;var _0x160a4a;return db[_0x9130('0x30')][_0x9130('0x62')]({'where':{'id':_0x2b876e[_0x9130('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f7f6d,null))[_0x9130('0x28')](function(_0xafaea8){if(_0xafaea8){_0x1a964d=_0xafaea8;_0x4dbb98[_0x9130('0x35')]=_['keys'](db['User'][_0x9130('0x31')]);_0x4dbb98[_0x9130('0x36')]=_[_0x9130('0x46')](_0x2b876e[_0x9130('0x36')]);_0x4dbb98[_0x9130('0x37')]=_[_0x9130('0x38')](_0x4dbb98[_0x9130('0x35')],_0x4dbb98[_0x9130('0x36')]);_0x51d7c0[_0x9130('0x3a')]=_[_0x9130('0x38')](_0x4dbb98['model'],qs[_0x9130('0x39')](_0x2b876e['query'][_0x9130('0x39')]));_0x51d7c0[_0x9130('0x3a')]=_0x51d7c0['attributes']['length']?_0x51d7c0[_0x9130('0x3a')]:_0x4dbb98[_0x9130('0x35')];_0x51d7c0['order']=qs['sort'](_0x2b876e[_0x9130('0x36')]['sort']);_0x51d7c0['where']=qs[_0x9130('0x37')](_[_0x9130('0x3e')](_0x2b876e['query'],_0x4dbb98[_0x9130('0x37')]));if(_0x2b876e[_0x9130('0x36')][_0x9130('0x3f')]){_0x51d7c0[_0x9130('0x40')]=_[_0x9130('0x41')](_0x51d7c0[_0x9130('0x40')],{'$or':_[_0x9130('0x42')](_0x51d7c0[_0x9130('0x3a')],function(_0x396ba6){var _0x5ae2d5={};_0x5ae2d5[_0x396ba6]={'$like':'%'+_0x2b876e['query'][_0x9130('0x3f')]+'%'};return _0x5ae2d5;})});}_0x51d7c0=_[_0x9130('0x41')]({},_0x51d7c0,_0x2b876e['options']);return _0x1a964d[_0x9130('0x86')](_0x51d7c0);}})[_0x9130('0x28')](function(_0x1979cf){if(_0x1979cf){_0x160a4a=_0x1979cf[_0x9130('0x47')];if(!_0x2b876e[_0x9130('0x36')][_0x9130('0x55')]('nolimit')){_0x51d7c0[_0x9130('0x21')]=qs[_0x9130('0x21')](_0x2b876e[_0x9130('0x36')]['limit']);_0x51d7c0[_0x9130('0x1f')]=qs[_0x9130('0x1f')](_0x2b876e[_0x9130('0x36')][_0x9130('0x1f')]);}return _0x1a964d['getAgents'](_0x51d7c0);}})[_0x9130('0x28')](function(_0x4d65fb){if(_0x4d65fb){return _0x4d65fb?{'count':_0x160a4a,'rows':_0x4d65fb}:null;}})[_0x9130('0x28')](respondWithResult(_0x2f7f6d,null))[_0x9130('0x44')](handleError(_0x2f7f6d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index e689704..9066ea0 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5558=['WhatsappQueue','setMaxListeners','save','update','emit','exports'];(function(_0x3cfe40,_0x1f6768){var _0x5df75a=function(_0x538e2b){while(--_0x538e2b){_0x3cfe40['push'](_0x3cfe40['shift']());}};_0x5df75a(++_0x1f6768);}(_0x5558,0x1e0));var _0x8555=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5558[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x8555('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8555('0x1')](0x0);var events={'afterCreate':_0x8555('0x2'),'afterUpdate':_0x8555('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44f489){return function(_0x3f8a34,_0x4a628c,_0x1b4a54){WhatsappQueueEvents[_0x8555('0x4')](_0x44f489+':'+_0x3f8a34['id'],_0x3f8a34);WhatsappQueueEvents[_0x8555('0x4')](_0x44f489,_0x3f8a34);_0x1b4a54(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x8555('0x5')]=WhatsappQueueEvents; \ No newline at end of file +var _0xb247=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x9f0ea2,_0x378f10){var _0x3536e4=function(_0x3e728f){while(--_0x3e728f){_0x9f0ea2['push'](_0x9f0ea2['shift']());}};_0x3536e4(++_0x378f10);}(_0xb247,0x16a));var _0x7b24=function(_0x40f470,_0x3a5975){_0x40f470=_0x40f470-0x0;var _0x46ce5f=_0xb247[_0x40f470];return _0x46ce5f;};'use strict';var EventEmitter=require(_0x7b24('0x0'));var WhatsappQueue=require(_0x7b24('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7b24('0x2')](0x0);var events={'afterCreate':_0x7b24('0x3'),'afterUpdate':_0x7b24('0x4'),'afterDestroy':_0x7b24('0x5')};function emitEvent(_0x17b71b){return function(_0x48116e,_0x4f52c0,_0xb486c9){WhatsappQueueEvents[_0x7b24('0x6')](_0x17b71b+':'+_0x48116e['id'],_0x48116e);WhatsappQueueEvents[_0x7b24('0x6')](_0x17b71b,_0x48116e);_0xb486c9(null);};}for(var e in events){if(events[_0x7b24('0x7')](e)){var event=events[e];WhatsappQueue[_0x7b24('0x8')](e,emitEvent(event));}}module[_0x7b24('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d453b19..fdc8fce 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4df9=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x5947e0,_0x2a4da7){var _0x2931cf=function(_0x355542){while(--_0x355542){_0x5947e0['push'](_0x5947e0['shift']());}};_0x2931cf(++_0x2a4da7);}(_0x4df9,0xb2));var _0x94df=function(_0x5ca430,_0x56332a){_0x5ca430=_0x5ca430-0x0;var _0x25cf86=_0x4df9[_0x5ca430];return _0x25cf86;};'use strict';var _=require(_0x94df('0x0'));var util=require(_0x94df('0x1'));var logger=require(_0x94df('0x2'))(_0x94df('0x3'));var moment=require(_0x94df('0x4'));var BPromise=require('bluebird');var rp=require(_0x94df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94df('0x6'));var config=require(_0x94df('0x7'));var attributes=require(_0x94df('0x8'));module[_0x94df('0x9')]=function(_0x347c9f,_0xb18ef8){return _0x347c9f[_0x94df('0xa')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee20=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues','lodash'];(function(_0x2d3ca8,_0x3fa060){var _0x102d3b=function(_0x3b6fb2){while(--_0x3b6fb2){_0x2d3ca8['push'](_0x2d3ca8['shift']());}};_0x102d3b(++_0x3fa060);}(_0xee20,0xef));var _0x0ee2=function(_0x192721,_0x1d7494){_0x192721=_0x192721-0x0;var _0x590c5b=_0xee20[_0x192721];return _0x590c5b;};'use strict';var _=require(_0x0ee2('0x0'));var util=require(_0x0ee2('0x1'));var logger=require(_0x0ee2('0x2'))(_0x0ee2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ee2('0x4'));var fs=require('fs');var path=require(_0x0ee2('0x5'));var rimraf=require(_0x0ee2('0x6'));var config=require(_0x0ee2('0x7'));var attributes=require(_0x0ee2('0x8'));module[_0x0ee2('0x9')]=function(_0x180ad8,_0x1ce522){return _0x180ad8[_0x0ee2('0xa')]('WhatsappQueue',attributes,{'tableName':_0x0ee2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 9984f61..4797817 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f6d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetWhatsappQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','ShowWhatsappQueue','WhatsappQueue','find','lodash','util','moment','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0f6d,0xc8));var _0xd0f6=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x0f6d[_0x40927b];return _0x2635e8;};'use strict';var _=require(_0xd0f6('0x0'));var util=require(_0xd0f6('0x1'));var moment=require(_0xd0f6('0x2'));var BPromise=require(_0xd0f6('0x3'));var rs=require(_0xd0f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0f6('0x5'))['db'];var utils=require(_0xd0f6('0x6'));var logger=require(_0xd0f6('0x7'))('rpc');var config=require(_0xd0f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd0f6('0x9')][_0xd0f6('0xa')]({'port':0x232a});config[_0xd0f6('0xb')]=_[_0xd0f6('0xc')](config[_0xd0f6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0f6('0xd'))(new Redis(config[_0xd0f6('0xb')]));require(_0xd0f6('0xe'))[_0xd0f6('0xf')](socket);function respondWithRpcPromise(_0x205d24,_0xc7f486,_0x43d6cd){return new BPromise(function(_0x3b52cb,_0x5e8ee8){return client[_0xd0f6('0x10')](_0x205d24,_0x43d6cd)['then'](function(_0x48d72b){logger[_0xd0f6('0x11')](_0xd0f6('0x12'),_0xc7f486,_0xd0f6('0x13'));logger[_0xd0f6('0x14')](_0xd0f6('0x15'),_0xc7f486,_0xd0f6('0x13'),JSON[_0xd0f6('0x16')](_0x48d72b));if(_0x48d72b[_0xd0f6('0x17')]){if(_0x48d72b[_0xd0f6('0x17')]['code']===0x1f4){logger[_0xd0f6('0x17')](_0xd0f6('0x12'),_0xc7f486,_0x48d72b[_0xd0f6('0x17')][_0xd0f6('0x18')]);return _0x5e8ee8(_0x48d72b[_0xd0f6('0x17')]['message']);}logger[_0xd0f6('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0xc7f486,_0x48d72b['error'][_0xd0f6('0x18')]);return _0x3b52cb(_0x48d72b[_0xd0f6('0x17')][_0xd0f6('0x18')]);}else{logger['info'](_0xd0f6('0x12'),_0xc7f486,'request\x20sent');_0x3b52cb(_0x48d72b[_0xd0f6('0x19')][_0xd0f6('0x18')]);}})[_0xd0f6('0x1a')](function(_0x19cae4){logger[_0xd0f6('0x17')](_0xd0f6('0x12'),_0xc7f486,_0x19cae4);_0x5e8ee8(_0x19cae4);});});}exports[_0xd0f6('0x1b')]=function(_0x1fd9c8){var _0x312735=this;return new Promise(function(_0x1729df,_0x9bede5){return db['WhatsappQueue'][_0xd0f6('0x1c')]({'raw':_0x1fd9c8[_0xd0f6('0x1d')]?_0x1fd9c8[_0xd0f6('0x1d')][_0xd0f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fd9c8['options']?_0x1fd9c8[_0xd0f6('0x1d')][_0xd0f6('0x1f')]||null:null,'attributes':_0x1fd9c8[_0xd0f6('0x1d')]?_0x1fd9c8[_0xd0f6('0x1d')]['attributes']||null:null,'limit':_0x1fd9c8[_0xd0f6('0x1d')]?_0x1fd9c8['options'][_0xd0f6('0x20')]||null:null,'include':_0x1fd9c8[_0xd0f6('0x1d')]?_0x1fd9c8[_0xd0f6('0x1d')][_0xd0f6('0x21')]?_[_0xd0f6('0x22')](_0x1fd9c8[_0xd0f6('0x1d')]['include'],function(_0x123740){return{'model':db[_0x123740['model']],'as':_0x123740['as'],'attributes':_0x123740[_0xd0f6('0x23')],'include':_0x123740[_0xd0f6('0x21')]?_['map'](_0x123740[_0xd0f6('0x21')],function(_0x49c8c3){return{'model':db[_0x49c8c3[_0xd0f6('0x24')]],'as':_0x49c8c3['as'],'attributes':_0x49c8c3[_0xd0f6('0x23')],'include':_0x49c8c3[_0xd0f6('0x21')]?_['map'](_0x49c8c3[_0xd0f6('0x21')],function(_0x3e3657){return{'model':db[_0x3e3657[_0xd0f6('0x24')]],'as':_0x3e3657['as'],'attributes':_0x3e3657['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0f6('0x25')](function(_0x3bded1){logger['info'](_0xd0f6('0x1b'),_0x1fd9c8);logger[_0xd0f6('0x14')]('GetWhatsappQueue',_0x1fd9c8,JSON[_0xd0f6('0x16')](_0x3bded1));_0x1729df(_0x3bded1);})[_0xd0f6('0x1a')](function(_0x345582){logger['error'](_0xd0f6('0x1b'),_0x345582[_0xd0f6('0x18')],_0x1fd9c8);_0x9bede5(_0x312735[_0xd0f6('0x17')](0x1f4,_0x345582[_0xd0f6('0x18')]));});});};exports[_0xd0f6('0x26')]=function(_0x3b89d5){var _0x238591=this;return new Promise(function(_0x58eccc,_0x5ecc8a){return db[_0xd0f6('0x27')][_0xd0f6('0x28')]({'raw':_0x3b89d5[_0xd0f6('0x1d')]?_0x3b89d5[_0xd0f6('0x1d')][_0xd0f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b89d5[_0xd0f6('0x1d')]?_0x3b89d5[_0xd0f6('0x1d')][_0xd0f6('0x1f')]||null:null,'attributes':_0x3b89d5['options']?_0x3b89d5[_0xd0f6('0x1d')][_0xd0f6('0x23')]||null:null,'include':_0x3b89d5[_0xd0f6('0x1d')]?_0x3b89d5[_0xd0f6('0x1d')][_0xd0f6('0x21')]?_[_0xd0f6('0x22')](_0x3b89d5[_0xd0f6('0x1d')][_0xd0f6('0x21')],function(_0x452972){return{'model':db[_0x452972[_0xd0f6('0x24')]],'as':_0x452972['as'],'attributes':_0x452972[_0xd0f6('0x23')],'include':_0x452972[_0xd0f6('0x21')]?_[_0xd0f6('0x22')](_0x452972[_0xd0f6('0x21')],function(_0x814999){return{'model':db[_0x814999[_0xd0f6('0x24')]],'as':_0x814999['as'],'attributes':_0x814999['attributes'],'include':_0x814999[_0xd0f6('0x21')]?_[_0xd0f6('0x22')](_0x814999[_0xd0f6('0x21')],function(_0x1d0221){return{'model':db[_0x1d0221[_0xd0f6('0x24')]],'as':_0x1d0221['as'],'attributes':_0x1d0221[_0xd0f6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd0f6('0x25')](function(_0x44bfe7){logger['info'](_0xd0f6('0x26'),_0x3b89d5);logger['debug'](_0xd0f6('0x26'),_0x3b89d5,JSON[_0xd0f6('0x16')](_0x44bfe7));_0x58eccc(_0x44bfe7);})[_0xd0f6('0x1a')](function(_0x467853){logger[_0xd0f6('0x17')]('ShowWhatsappQueue',_0x467853[_0xd0f6('0x18')],_0x3b89d5);_0x5ecc8a(_0x238591[_0xd0f6('0x17')](0x1f4,_0x467853[_0xd0f6('0x18')]));});});}; \ No newline at end of file +var _0x849c=['findAll','options','where','limit','include','model','attributes','map','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappQueue'];(function(_0x5d2c05,_0x47cd6f){var _0x4f1028=function(_0x7bddad){while(--_0x7bddad){_0x5d2c05['push'](_0x5d2c05['shift']());}};_0x4f1028(++_0x47cd6f);}(_0x849c,0x1a8));var _0xc849=function(_0x344d0d,_0x14a463){_0x344d0d=_0x344d0d-0x0;var _0x1585dc=_0x849c[_0x344d0d];return _0x1585dc;};'use strict';var _=require(_0xc849('0x0'));var util=require(_0xc849('0x1'));var moment=require(_0xc849('0x2'));var BPromise=require(_0xc849('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc849('0x4'));var db=require(_0xc849('0x5'))['db'];var utils=require(_0xc849('0x6'));var logger=require('../../config/logger')(_0xc849('0x7'));var config=require(_0xc849('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc849('0x9')][_0xc849('0xa')]({'port':0x232a});config[_0xc849('0xb')]=_['defaults'](config['redis'],{'host':_0xc849('0xc'),'port':0x18eb});var socket=require(_0xc849('0xd'))(new Redis(config['redis']));require(_0xc849('0xe'))[_0xc849('0xf')](socket);function respondWithRpcPromise(_0x1f99b6,_0x535b5f,_0x5329f3){return new BPromise(function(_0x4edd86,_0x2deb83){return client[_0xc849('0x10')](_0x1f99b6,_0x5329f3)[_0xc849('0x11')](function(_0x26421b){logger[_0xc849('0x12')](_0xc849('0x13'),_0x535b5f,_0xc849('0x14'));logger[_0xc849('0x15')](_0xc849('0x16'),_0x535b5f,'request\x20sent',JSON['stringify'](_0x26421b));if(_0x26421b[_0xc849('0x17')]){if(_0x26421b[_0xc849('0x17')][_0xc849('0x18')]===0x1f4){logger[_0xc849('0x17')](_0xc849('0x13'),_0x535b5f,_0x26421b[_0xc849('0x17')][_0xc849('0x19')]);return _0x2deb83(_0x26421b[_0xc849('0x17')][_0xc849('0x19')]);}logger[_0xc849('0x17')](_0xc849('0x13'),_0x535b5f,_0x26421b[_0xc849('0x17')][_0xc849('0x19')]);return _0x4edd86(_0x26421b[_0xc849('0x17')][_0xc849('0x19')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x535b5f,_0xc849('0x14'));_0x4edd86(_0x26421b['result']['message']);}})['catch'](function(_0x146a7b){logger[_0xc849('0x17')](_0xc849('0x13'),_0x535b5f,_0x146a7b);_0x2deb83(_0x146a7b);});});}exports['GetWhatsappQueue']=function(_0x21574f){var _0xc6ca26=this;return new Promise(function(_0x257ed8,_0x1bf90e){return db[_0xc849('0x1a')][_0xc849('0x1b')]({'raw':_0x21574f[_0xc849('0x1c')]?_0x21574f['options']['raw']===undefined?!![]:![]:!![],'where':_0x21574f[_0xc849('0x1c')]?_0x21574f[_0xc849('0x1c')][_0xc849('0x1d')]||null:null,'attributes':_0x21574f[_0xc849('0x1c')]?_0x21574f[_0xc849('0x1c')]['attributes']||null:null,'limit':_0x21574f['options']?_0x21574f['options'][_0xc849('0x1e')]||null:null,'include':_0x21574f[_0xc849('0x1c')]?_0x21574f[_0xc849('0x1c')]['include']?_['map'](_0x21574f[_0xc849('0x1c')][_0xc849('0x1f')],function(_0x56bbad){return{'model':db[_0x56bbad[_0xc849('0x20')]],'as':_0x56bbad['as'],'attributes':_0x56bbad[_0xc849('0x21')],'include':_0x56bbad[_0xc849('0x1f')]?_['map'](_0x56bbad[_0xc849('0x1f')],function(_0x3506b4){return{'model':db[_0x3506b4[_0xc849('0x20')]],'as':_0x3506b4['as'],'attributes':_0x3506b4[_0xc849('0x21')],'include':_0x3506b4['include']?_[_0xc849('0x22')](_0x3506b4[_0xc849('0x1f')],function(_0x280eec){return{'model':db[_0x280eec[_0xc849('0x20')]],'as':_0x280eec['as'],'attributes':_0x280eec[_0xc849('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc849('0x11')](function(_0x2cf293){logger[_0xc849('0x12')](_0xc849('0x23'),_0x21574f);logger[_0xc849('0x15')](_0xc849('0x23'),_0x21574f,JSON[_0xc849('0x24')](_0x2cf293));_0x257ed8(_0x2cf293);})['catch'](function(_0x2ac784){logger['error']('GetWhatsappQueue',_0x2ac784['message'],_0x21574f);_0x1bf90e(_0xc6ca26[_0xc849('0x17')](0x1f4,_0x2ac784['message']));});});};exports[_0xc849('0x25')]=function(_0x182f9b){var _0x175c6f=this;return new Promise(function(_0x4c4137,_0x3e7583){return db[_0xc849('0x1a')][_0xc849('0x26')]({'raw':_0x182f9b[_0xc849('0x1c')]?_0x182f9b[_0xc849('0x1c')][_0xc849('0x27')]===undefined?!![]:![]:!![],'where':_0x182f9b['options']?_0x182f9b['options'][_0xc849('0x1d')]||null:null,'attributes':_0x182f9b[_0xc849('0x1c')]?_0x182f9b[_0xc849('0x1c')][_0xc849('0x21')]||null:null,'include':_0x182f9b[_0xc849('0x1c')]?_0x182f9b['options'][_0xc849('0x1f')]?_[_0xc849('0x22')](_0x182f9b['options'][_0xc849('0x1f')],function(_0x450a3e){return{'model':db[_0x450a3e[_0xc849('0x20')]],'as':_0x450a3e['as'],'attributes':_0x450a3e['attributes'],'include':_0x450a3e['include']?_[_0xc849('0x22')](_0x450a3e['include'],function(_0x189a08){return{'model':db[_0x189a08['model']],'as':_0x189a08['as'],'attributes':_0x189a08[_0xc849('0x21')],'include':_0x189a08[_0xc849('0x1f')]?_[_0xc849('0x22')](_0x189a08[_0xc849('0x1f')],function(_0x3960a5){return{'model':db[_0x3960a5[_0xc849('0x20')]],'as':_0x3960a5['as'],'attributes':_0x3960a5[_0xc849('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc849('0x11')](function(_0x4460a8){logger[_0xc849('0x12')](_0xc849('0x25'),_0x182f9b);logger['debug'](_0xc849('0x25'),_0x182f9b,JSON[_0xc849('0x24')](_0x4460a8));_0x4c4137(_0x4460a8);})[_0xc849('0x28')](function(_0x1ffdd2){logger[_0xc849('0x17')](_0xc849('0x25'),_0x1ffdd2[_0xc849('0x19')],_0x182f9b);_0x3e7583(_0x175c6f[_0xc849('0x17')](0x1f4,_0x1ffdd2[_0xc849('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 3fc7aae..58dbdc0 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd35a=['save','remove','update','emit','removeListener','length','whatsappQueue:'];(function(_0xa2d567,_0x26abee){var _0x21663c=function(_0x3c13e9){while(--_0x3c13e9){_0xa2d567['push'](_0xa2d567['shift']());}};_0x21663c(++_0x26abee);}(_0xd35a,0x1a4));var _0xad35=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0xd35a[_0x49a57c];return _0x4e0316;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xad35('0x0'),_0xad35('0x1'),_0xad35('0x2')];function createListener(_0x522cb2,_0x3716ff){return function(_0x5f4182){_0x3716ff[_0xad35('0x3')](_0x522cb2,_0x5f4182);};}function removeListener(_0x4750b2,_0x1ffd13){return function(){WhatsappQueueEvents[_0xad35('0x4')](_0x4750b2,_0x1ffd13);};}exports['register']=function(_0x1e8836){for(var _0x55dbd6=0x0,_0x51e4ba=events[_0xad35('0x5')];_0x55dbd6<_0x51e4ba;_0x55dbd6++){var _0x4c3326=events[_0x55dbd6];var _0x84d3e=createListener(_0xad35('0x6')+_0x4c3326,_0x1e8836);WhatsappQueueEvents['on'](_0x4c3326,_0x84d3e);}}; \ No newline at end of file +var _0x86f9=['removeListener','register','whatsappQueue:','./whatsappQueue.events','save','update','emit'];(function(_0x3bdc82,_0x2ac5e1){var _0x4267d0=function(_0x47a0f2){while(--_0x47a0f2){_0x3bdc82['push'](_0x3bdc82['shift']());}};_0x4267d0(++_0x2ac5e1);}(_0x86f9,0x1c3));var _0x986f=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x86f9[_0x1344d6];return _0xf45b24;};'use strict';var WhatsappQueueEvents=require(_0x986f('0x0'));var events=[_0x986f('0x1'),'remove',_0x986f('0x2')];function createListener(_0xc640f5,_0x3f516b){return function(_0x4a3106){_0x3f516b[_0x986f('0x3')](_0xc640f5,_0x4a3106);};}function removeListener(_0x47e823,_0x4e4d29){return function(){WhatsappQueueEvents[_0x986f('0x4')](_0x47e823,_0x4e4d29);};}exports[_0x986f('0x5')]=function(_0x3e0d71){for(var _0x2a98cb=0x0,_0x2b9036=events['length'];_0x2a98cb<_0x2b9036;_0x2a98cb++){var _0xbb8ab8=events[_0x2a98cb];var _0x3d950f=createListener(_0x986f('0x6')+_0xbb8ab8,_0x3e0d71);WhatsappQueueEvents['on'](_0xbb8ab8,_0x3d950f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 94a0559..6e4d8a2 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4603=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5f252a,_0x268f97){var _0x465e32=function(_0x4cd1e5){while(--_0x4cd1e5){_0x5f252a['push'](_0x5f252a['shift']());}};_0x465e32(++_0x268f97);}(_0x4603,0x174));var _0x3460=function(_0x9045bb,_0x3994ba){_0x9045bb=_0x9045bb-0x0;var _0x257317=_0x4603[_0x9045bb];return _0x257317;};'use strict';var multer=require(_0x3460('0x0'));var util=require(_0x3460('0x1'));var path=require(_0x3460('0x2'));var timeout=require(_0x3460('0x3'));var express=require('express');var router=express[_0x3460('0x4')]();var fs_extra=require(_0x3460('0x5'));var auth=require(_0x3460('0x6'));var interaction=require(_0x3460('0x7'));var config=require(_0x3460('0x8'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3460('0x9')]);router[_0x3460('0xa')](_0x3460('0xb'),auth[_0x3460('0xc')](),controller[_0x3460('0xd')]);router[_0x3460('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3460('0xe')]);router['post']('/',auth[_0x3460('0xc')](),controller[_0x3460('0xf')]);router[_0x3460('0x10')](_0x3460('0x11'),auth['isAuthenticated'](),controller[_0x3460('0x12')]);router[_0x3460('0x13')](_0x3460('0x11'),auth['isAuthenticated'](),controller[_0x3460('0x14')]);module[_0x3460('0x15')]=router; \ No newline at end of file +var _0x7f14=['./whatsappQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11eeda,_0x4a266f){var _0x385c89=function(_0x1a1ab1){while(--_0x1a1ab1){_0x11eeda['push'](_0x11eeda['shift']());}};_0x385c89(++_0x4a266f);}(_0x7f14,0x170));var _0x47f1=function(_0x173c95,_0x161556){_0x173c95=_0x173c95-0x0;var _0x24c449=_0x7f14[_0x173c95];return _0x24c449;};'use strict';var multer=require(_0x47f1('0x0'));var util=require(_0x47f1('0x1'));var path=require(_0x47f1('0x2'));var timeout=require(_0x47f1('0x3'));var express=require(_0x47f1('0x4'));var router=express[_0x47f1('0x5')]();var fs_extra=require(_0x47f1('0x6'));var auth=require(_0x47f1('0x7'));var interaction=require(_0x47f1('0x8'));var config=require(_0x47f1('0x9'));var controller=require(_0x47f1('0xa'));router[_0x47f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x47f1('0xc')]);router[_0x47f1('0xb')]('/describe',auth[_0x47f1('0xd')](),controller[_0x47f1('0xe')]);router[_0x47f1('0xb')](_0x47f1('0xf'),auth[_0x47f1('0xd')](),controller[_0x47f1('0x10')]);router['post']('/',auth[_0x47f1('0xd')](),controller['create']);router[_0x47f1('0x11')](_0x47f1('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x47f1('0x12')](_0x47f1('0xf'),auth[_0x47f1('0xd')](),controller[_0x47f1('0x13')]);module[_0x47f1('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 718a7e0..692f44d 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x34aabc,_0x173a45){var _0x7a018f=function(_0x2d5154){while(--_0x2d5154){_0x34aabc['push'](_0x34aabc['shift']());}};_0x7a018f(++_0x173a45);}(_0x7a54,0x106));var _0x47a5=function(_0x22cdf7,_0x39cb67){_0x22cdf7=_0x22cdf7-0x0;var _0x32393e=_0x7a54[_0x22cdf7];return _0x32393e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x2afa95,_0x339cd7){var _0x33f009=function(_0x2ec876){while(--_0x2ec876){_0x2afa95['push'](_0x2afa95['shift']());}};_0x33f009(++_0x339cd7);}(_0x7a54,0x106));var _0x47a5=function(_0xaf3bb7,_0x3c7e2e){_0xaf3bb7=_0xaf3bb7-0x0;var _0x79a633=_0x7a54[_0xaf3bb7];return _0x79a633;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 99f0bf8..95a32e0 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x087b=['name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','update','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack'];(function(_0x31725d,_0x9b9418){var _0x5eede3=function(_0x3db5f7){while(--_0x3db5f7){_0x31725d['push'](_0x31725d['shift']());}};_0x5eede3(++_0x9b9418);}(_0x087b,0x11a));var _0xb087=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x087b[_0x525c7b];return _0x27b33e;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a2dc6,_0x50745a){return function(_0x598b99){if(!_0x598b99){_0x5a2dc6['sendStatus'](0x194);}return _0x598b99;};}function handleError(_0x304840,_0x45685d){_0x45685d=_0x45685d||0x1f4;return function(_0x1d124f){logger[_0xb087('0x28')](_0x1d124f[_0xb087('0x29')]);if(_0x1d124f[_0xb087('0x2a')]){delete _0x1d124f[_0xb087('0x2a')];}_0x304840[_0xb087('0x1c')](_0x45685d)[_0xb087('0x2b')](_0x1d124f);};}exports[_0xb087('0x2c')]=function(_0x18058c,_0x31e3e6){var _0xb0baf6={},_0x263259={},_0x593b78={'count':0x0,'rows':[]};var _0x37393a=_[_0xb087('0x2d')](db[_0xb087('0x2e')][_0xb087('0x2f')],function(_0x22d441){return{'name':_0x22d441[_0xb087('0x30')],'type':_0x22d441[_0xb087('0x31')][_0xb087('0x32')]};});_0x263259['model']=_['map'](_0x37393a,_0xb087('0x2a'));_0x263259[_0xb087('0x33')]=_['keys'](_0x18058c[_0xb087('0x33')]);_0x263259[_0xb087('0x34')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],_0x263259[_0xb087('0x33')]);_0xb0baf6[_0xb087('0x37')]=_[_0xb087('0x35')](_0x263259[_0xb087('0x36')],qs[_0xb087('0x38')](_0x18058c[_0xb087('0x33')][_0xb087('0x38')]));_0xb0baf6[_0xb087('0x37')]=_0xb0baf6['attributes'][_0xb087('0x39')]?_0xb0baf6['attributes']:_0x263259[_0xb087('0x36')];if(!_0x18058c[_0xb087('0x33')][_0xb087('0x3a')](_0xb087('0x3b'))){_0xb0baf6[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x18058c[_0xb087('0x33')][_0xb087('0x20')]);_0xb0baf6[_0xb087('0x1f')]=qs['offset'](_0x18058c['query'][_0xb087('0x1f')]);}_0xb0baf6[_0xb087('0x3c')]=qs[_0xb087('0x3d')](_0x18058c[_0xb087('0x33')][_0xb087('0x3d')]);_0xb0baf6['where']=qs[_0xb087('0x34')](_[_0xb087('0x3e')](_0x18058c['query'],_0x263259['filters']),_0x37393a);if(_0x18058c[_0xb087('0x33')][_0xb087('0x3f')]){_0xb0baf6[_0xb087('0x40')]=_['merge'](_0xb0baf6[_0xb087('0x40')],{'$or':_[_0xb087('0x2d')](_0x37393a,function(_0x1caa6e){if(_0x1caa6e[_0xb087('0x31')]!==_0xb087('0x41')){var _0x5db6b9={};_0x5db6b9[_0x1caa6e[_0xb087('0x2a')]]={'$like':'%'+_0x18058c['query'][_0xb087('0x3f')]+'%'};return _0x5db6b9;}})});}_0xb0baf6=_['merge']({},_0xb0baf6,_0x18058c[_0xb087('0x42')]);var _0xc9f9e9={'where':_0xb0baf6['where']};return db[_0xb087('0x2e')]['count'](_0xc9f9e9)[_0xb087('0x27')](function(_0x4a360c){_0x593b78[_0xb087('0x22')]=_0x4a360c;if(_0x18058c[_0xb087('0x33')][_0xb087('0x43')]){_0xb0baf6[_0xb087('0x44')]=[{'all':!![]}];}return db[_0xb087('0x2e')][_0xb087('0x45')](_0xb0baf6);})[_0xb087('0x27')](function(_0x5e7690){_0x593b78[_0xb087('0x46')]=_0x5e7690;return _0x593b78;})['then'](respondWithFilteredResult(_0x31e3e6,_0xb0baf6))[_0xb087('0x47')](handleError(_0x31e3e6,null));};exports[_0xb087('0x48')]=function(_0x5b6924,_0xb662bf){var _0x45dc6f={'raw':!![],'where':{'id':_0x5b6924['params']['id']}},_0x7650c5={};_0x7650c5[_0xb087('0x36')]=_['keys'](db[_0xb087('0x2e')][_0xb087('0x2f')]);_0x7650c5['query']=_[_0xb087('0x49')](_0x5b6924[_0xb087('0x33')]);_0x7650c5['filters']=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],_0x7650c5['query']);_0x45dc6f[_0xb087('0x37')]=_[_0xb087('0x35')](_0x7650c5[_0xb087('0x36')],qs[_0xb087('0x38')](_0x5b6924['query']['fields']));_0x45dc6f[_0xb087('0x37')]=_0x45dc6f[_0xb087('0x37')][_0xb087('0x39')]?_0x45dc6f[_0xb087('0x37')]:_0x7650c5[_0xb087('0x36')];if(_0x5b6924[_0xb087('0x33')]['includeAll']){_0x45dc6f['include']=[{'all':!![]}];}_0x45dc6f=_[_0xb087('0x4a')]({},_0x45dc6f,_0x5b6924['options']);return db[_0xb087('0x2e')][_0xb087('0x4b')](_0x45dc6f)[_0xb087('0x27')](handleEntityNotFound(_0xb662bf,null))[_0xb087('0x27')](respondWithResult(_0xb662bf,null))['catch'](handleError(_0xb662bf,null));};exports[_0xb087('0x4c')]=function(_0x562751,_0x2fe8a0){return db[_0xb087('0x2e')][_0xb087('0x4c')](_0x562751[_0xb087('0x4d')],{})[_0xb087('0x27')](respondWithResult(_0x2fe8a0,0xc9))['catch'](handleError(_0x2fe8a0,null));};exports[_0xb087('0x4e')]=function(_0xb15e28,_0x588d96){if(_0xb15e28['body']['id']){delete _0xb15e28[_0xb087('0x4d')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0xb15e28[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x588d96,null))['then'](saveUpdates(_0xb15e28[_0xb087('0x4d')],null))[_0xb087('0x27')](respondWithResult(_0x588d96,null))[_0xb087('0x47')](handleError(_0x588d96,null));};exports['destroy']=function(_0x5ba160,_0x30cc83){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5ba160[_0xb087('0x4f')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x30cc83,null))[_0xb087('0x27')](removeEntity(_0x30cc83,null))[_0xb087('0x47')](handleError(_0x30cc83,null));};exports[_0xb087('0x50')]=function(_0x148642,_0xbd849d){return db[_0xb087('0x2e')][_0xb087('0x50')]()[_0xb087('0x27')](respondWithResult(_0xbd849d,null))[_0xb087('0x47')](handleError(_0xbd849d,null));}; \ No newline at end of file +var _0xe1e3=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x207acb,_0x2d6a4e){_0x207acb=_0x207acb-0x0;var _0x1b34bb=_0xe1e3[_0x207acb];return _0x1b34bb;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3fb93a6..5cd2057 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a1c=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x476531,_0x198410){var _0x59a75d=function(_0x9a65f2){while(--_0x9a65f2){_0x476531['push'](_0x476531['shift']());}};_0x59a75d(++_0x198410);}(_0x3a1c,0x176));var _0xc3a1=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x3a1c[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xc3a1('0x0'));var util=require(_0xc3a1('0x1'));var logger=require(_0xc3a1('0x2'))(_0xc3a1('0x3'));var moment=require(_0xc3a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc3a1('0x6'));var config=require(_0xc3a1('0x7'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x119be1,_0x313b93){return _0x119be1['define'](_0xc3a1('0x8'),attributes,{'tableName':_0xc3a1('0x9'),'paranoid':![],'indexes':[{'name':_0xc3a1('0xa'),'fields':[_0xc3a1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbdd1=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','bluebird','request-promise'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xbdd1,0x15b));var _0x1bdd=function(_0x112ff4,_0x443568){_0x112ff4=_0x112ff4-0x0;var _0x273cd2=_0xbdd1[_0x112ff4];return _0x273cd2;};'use strict';var _=require(_0x1bdd('0x0'));var util=require(_0x1bdd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1bdd('0x2'));var rp=require(_0x1bdd('0x3'));var fs=require('fs');var path=require(_0x1bdd('0x4'));var rimraf=require(_0x1bdd('0x5'));var config=require(_0x1bdd('0x6'));var attributes=require(_0x1bdd('0x7'));module[_0x1bdd('0x8')]=function(_0x1d3537,_0x25ff04){return _0x1d3537[_0x1bdd('0x9')](_0x1bdd('0xa'),attributes,{'tableName':_0x1bdd('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1bdd('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c0ecc82..dfa6eb8 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x601c=['client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','stringify','catch','update','limit','UpdateWhatsappQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x49e1b1,_0x11357f){var _0x467cb3=function(_0x51231f){while(--_0x51231f){_0x49e1b1['push'](_0x49e1b1['shift']());}};_0x467cb3(++_0x11357f);}(_0x601c,0x73));var _0xc601=function(_0x1daac8,_0x2027e8){_0x1daac8=_0x1daac8-0x0;var _0x40072e=_0x601c[_0x1daac8];return _0x40072e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc601('0x0'));var BPromise=require(_0xc601('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc601('0x2'));var db=require(_0xc601('0x3'))['db'];var utils=require(_0xc601('0x4'));var logger=require(_0xc601('0x5'))(_0xc601('0x6'));var config=require(_0xc601('0x7'));var jayson=require(_0xc601('0x8'));var client=jayson[_0xc601('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32a2ef,_0x3aafa2,_0x105739){return new BPromise(function(_0x2c79f7,_0x47f0c9){return client[_0xc601('0xa')](_0x32a2ef,_0x105739)[_0xc601('0xb')](function(_0x518b3f){logger['info'](_0xc601('0xc'),_0x3aafa2,_0xc601('0xd'));logger['debug'](_0xc601('0xe'),_0x3aafa2,_0xc601('0xd'),JSON['stringify'](_0x518b3f));if(_0x518b3f[_0xc601('0xf')]){if(_0x518b3f[_0xc601('0xf')][_0xc601('0x10')]===0x1f4){logger[_0xc601('0xf')](_0xc601('0xc'),_0x3aafa2,_0x518b3f[_0xc601('0xf')]['message']);return _0x47f0c9(_0x518b3f['error'][_0xc601('0x11')]);}logger[_0xc601('0xf')](_0xc601('0xc'),_0x3aafa2,_0x518b3f[_0xc601('0xf')][_0xc601('0x11')]);return _0x2c79f7(_0x518b3f[_0xc601('0xf')][_0xc601('0x11')]);}else{logger[_0xc601('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3aafa2,_0xc601('0xd'));_0x2c79f7(_0x518b3f['result'][_0xc601('0x11')]);}})['catch'](function(_0x76b2ee){logger['error'](_0xc601('0xc'),_0x3aafa2,_0x76b2ee);_0x47f0c9(_0x76b2ee);});});}exports[_0xc601('0x13')]=function(_0x400a08){var _0x3b4210=this;return new Promise(function(_0x5c1334,_0x3efee7){return db[_0xc601('0x14')][_0xc601('0x15')](_0x400a08[_0xc601('0x16')],{'raw':_0x400a08['options']?_0x400a08[_0xc601('0x17')][_0xc601('0x18')]===undefined?!![]:![]:!![]})[_0xc601('0xb')](function(_0xc6df93){logger[_0xc601('0x12')](_0xc601('0x13'),_0x400a08);logger[_0xc601('0x19')](_0xc601('0x13'),_0x400a08,JSON[_0xc601('0x1a')](_0xc6df93));_0x5c1334(_0xc6df93);})[_0xc601('0x1b')](function(_0x152086){logger[_0xc601('0xf')]('CreateWhatsappQueueReport',_0x152086['message'],_0x400a08);_0x3efee7(_0x3b4210['error'](0x1f4,_0x152086[_0xc601('0x11')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x496d2c){var _0x4a05bf=this;return new Promise(function(_0x3c2de5,_0x55c0df){return db[_0xc601('0x14')][_0xc601('0x1c')](_0x496d2c[_0xc601('0x16')],{'raw':_0x496d2c[_0xc601('0x17')]?_0x496d2c[_0xc601('0x17')][_0xc601('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496d2c[_0xc601('0x17')]?_0x496d2c['options']['where']||null:null,'attributes':_0x496d2c[_0xc601('0x17')]?_0x496d2c[_0xc601('0x17')]['attributes']||null:null,'limit':_0x496d2c['options']?_0x496d2c[_0xc601('0x17')][_0xc601('0x1d')]||null:null})[_0xc601('0xb')](function(_0x35067b){logger['info'](_0xc601('0x1e'),_0x496d2c);logger[_0xc601('0x19')](_0xc601('0x1e'),_0x496d2c,JSON[_0xc601('0x1a')](_0x35067b));_0x3c2de5(_0x35067b);})[_0xc601('0x1b')](function(_0x53fb95){logger['error'](_0xc601('0x1e'),_0x53fb95[_0xc601('0x11')],_0x496d2c);_0x55c0df(_0x4a05bf[_0xc601('0xf')](0x1f4,_0x53fb95['message']));});});}; \ No newline at end of file +var _0x157e=['limit','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','stringify','UpdateWhatsappQueueReport','update','attributes'];(function(_0x541095,_0x582b30){var _0x5a2c40=function(_0xb7650f){while(--_0xb7650f){_0x541095['push'](_0x541095['shift']());}};_0x5a2c40(++_0x582b30);}(_0x157e,0x121));var _0xe157=function(_0x3d6785,_0x492ea3){_0x3d6785=_0x3d6785-0x0;var _0x39a624=_0x157e[_0x3d6785];return _0x39a624;};'use strict';var _=require(_0xe157('0x0'));var util=require('util');var moment=require(_0xe157('0x1'));var BPromise=require(_0xe157('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe157('0x3'))['db'];var utils=require(_0xe157('0x4'));var logger=require(_0xe157('0x5'))(_0xe157('0x6'));var config=require(_0xe157('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe157('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d99d0,_0x1f4f6d,_0x1c7d69){return new BPromise(function(_0x117723,_0x3913a9){return client[_0xe157('0x9')](_0x3d99d0,_0x1c7d69)[_0xe157('0xa')](function(_0x4dce11){logger['info'](_0xe157('0xb'),_0x1f4f6d,_0xe157('0xc'));logger[_0xe157('0xd')](_0xe157('0xe'),_0x1f4f6d,_0xe157('0xc'),JSON['stringify'](_0x4dce11));if(_0x4dce11['error']){if(_0x4dce11['error'][_0xe157('0xf')]===0x1f4){logger[_0xe157('0x10')](_0xe157('0xb'),_0x1f4f6d,_0x4dce11[_0xe157('0x10')]['message']);return _0x3913a9(_0x4dce11[_0xe157('0x10')][_0xe157('0x11')]);}logger['error'](_0xe157('0xb'),_0x1f4f6d,_0x4dce11[_0xe157('0x10')]['message']);return _0x117723(_0x4dce11[_0xe157('0x10')][_0xe157('0x11')]);}else{logger[_0xe157('0x12')](_0xe157('0xb'),_0x1f4f6d,_0xe157('0xc'));_0x117723(_0x4dce11[_0xe157('0x13')][_0xe157('0x11')]);}})[_0xe157('0x14')](function(_0x1e0e57){logger[_0xe157('0x10')](_0xe157('0xb'),_0x1f4f6d,_0x1e0e57);_0x3913a9(_0x1e0e57);});});}exports[_0xe157('0x15')]=function(_0x2f2f51){var _0x1da4a1=this;return new Promise(function(_0x111f98,_0x566506){return db[_0xe157('0x16')][_0xe157('0x17')](_0x2f2f51[_0xe157('0x18')],{'raw':_0x2f2f51[_0xe157('0x19')]?_0x2f2f51[_0xe157('0x19')][_0xe157('0x1a')]===undefined?!![]:![]:!![]})[_0xe157('0xa')](function(_0x426d0b){logger[_0xe157('0x12')]('CreateWhatsappQueueReport',_0x2f2f51);logger[_0xe157('0xd')](_0xe157('0x15'),_0x2f2f51,JSON[_0xe157('0x1b')](_0x426d0b));_0x111f98(_0x426d0b);})[_0xe157('0x14')](function(_0x108ffa){logger[_0xe157('0x10')]('CreateWhatsappQueueReport',_0x108ffa['message'],_0x2f2f51);_0x566506(_0x1da4a1[_0xe157('0x10')](0x1f4,_0x108ffa[_0xe157('0x11')]));});});};exports[_0xe157('0x1c')]=function(_0xea9da8){var _0x5a0eb1=this;return new Promise(function(_0x12e430,_0x35e2f9){return db[_0xe157('0x16')][_0xe157('0x1d')](_0xea9da8[_0xe157('0x18')],{'raw':_0xea9da8[_0xe157('0x19')]?_0xea9da8[_0xe157('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xea9da8[_0xe157('0x19')]?_0xea9da8[_0xe157('0x19')]['where']||null:null,'attributes':_0xea9da8[_0xe157('0x19')]?_0xea9da8[_0xe157('0x19')][_0xe157('0x1e')]||null:null,'limit':_0xea9da8['options']?_0xea9da8[_0xe157('0x19')][_0xe157('0x1f')]||null:null})[_0xe157('0xa')](function(_0x1b2ff6){logger['info']('UpdateWhatsappQueueReport',_0xea9da8);logger[_0xe157('0xd')]('UpdateWhatsappQueueReport',_0xea9da8,JSON[_0xe157('0x1b')](_0x1b2ff6));_0x12e430(_0x1b2ff6);})[_0xe157('0x14')](function(_0x523ae8){logger['error'](_0xe157('0x1c'),_0x523ae8[_0xe157('0x11')],_0xea9da8);_0x35e2f9(_0x5a0eb1[_0xe157('0x10')](0x1f4,_0x523ae8[_0xe157('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 6167af7..de0a10a 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe090=['exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete'];(function(_0x5ee858,_0x27cef4){var _0x348ece=function(_0x3331cd){while(--_0x3331cd){_0x5ee858['push'](_0x5ee858['shift']());}};_0x348ece(++_0x27cef4);}(_0xe090,0xac));var _0x0e09=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe090[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x0e09('0x0'));var path=require(_0x0e09('0x1'));var timeout=require(_0x0e09('0x2'));var express=require(_0x0e09('0x3'));var router=express[_0x0e09('0x4')]();var fs_extra=require(_0x0e09('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e09('0x6'));var controller=require(_0x0e09('0x7'));router[_0x0e09('0x8')]('/',auth[_0x0e09('0x9')](),controller[_0x0e09('0xa')]);router[_0x0e09('0x8')](_0x0e09('0xb'),auth[_0x0e09('0x9')](),controller['describe']);router[_0x0e09('0x8')](_0x0e09('0xc'),auth[_0x0e09('0x9')](),controller[_0x0e09('0xd')]);router[_0x0e09('0xe')]('/',auth['isAuthenticated'](),controller[_0x0e09('0xf')]);router['put'](_0x0e09('0xc'),auth[_0x0e09('0x9')](),controller[_0x0e09('0x10')]);router[_0x0e09('0x11')]('/:id',auth[_0x0e09('0x9')](),controller['destroy']);module[_0x0e09('0x12')]=router; \ No newline at end of file +var _0x7c58=['index','/:id','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated'];(function(_0x442ec2,_0x1efd7a){var _0x1bdbb7=function(_0x46dbf3){while(--_0x46dbf3){_0x442ec2['push'](_0x442ec2['shift']());}};_0x1bdbb7(++_0x1efd7a);}(_0x7c58,0xc3));var _0x87c5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c58[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x87c5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87c5('0x1'));var router=express[_0x87c5('0x2')]();var fs_extra=require(_0x87c5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x87c5('0x4'));var config=require(_0x87c5('0x5'));var controller=require(_0x87c5('0x6'));router[_0x87c5('0x7')]('/',auth[_0x87c5('0x8')](),controller[_0x87c5('0x9')]);router['get']('/describe',auth[_0x87c5('0x8')](),controller['describe']);router[_0x87c5('0x7')](_0x87c5('0xa'),auth[_0x87c5('0x8')](),controller['show']);router[_0x87c5('0xb')]('/',auth[_0x87c5('0x8')](),controller['create']);router[_0x87c5('0xc')](_0x87c5('0xa'),auth['isAuthenticated'](),controller[_0x87c5('0xd')]);router[_0x87c5('0xe')](_0x87c5('0xa'),auth[_0x87c5('0x8')](),controller[_0x87c5('0xf')]);module[_0x87c5('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 523e5a7..4652251 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa702=['STRING','ENUM','account','queue','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa702,0x1ae));var _0x2a70=function(_0x273b24,_0x34cf75){_0x273b24=_0x273b24-0x0;var _0xc414a8=_0xa702[_0x273b24];return _0xc414a8;};'use strict';var Sequelize=require(_0x2a70('0x0'));module[_0x2a70('0x1')]={'uniqueid':{'type':Sequelize[_0x2a70('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2a70('0x3')](_0x2a70('0x4'),'agent',_0x2a70('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x5853=['queue','DATE','sequelize','exports','STRING','ENUM','account'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5853,0x113));var _0x3585=function(_0x52fb3c,_0x2cf66e){_0x52fb3c=_0x52fb3c-0x0;var _0x5c9223=_0x5853[_0x52fb3c];return _0x5c9223;};'use strict';var Sequelize=require(_0x3585('0x0'));module[_0x3585('0x1')]={'uniqueid':{'type':Sequelize[_0x3585('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3585('0x3')](_0x3585('0x4'),'agent',_0x3585('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x3585('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2cb032b..eb2890d 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','apply','save','update','then','error','stack','send','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','rows','catch','params','create','body','destroy','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x261395,_0x1923e7){var _0x36324e=function(_0x4ce3dd){while(--_0x4ce3dd){_0x261395['push'](_0x261395['shift']());}};_0x36324e(++_0x1923e7);}(_0x04ed,0x170));var _0xd04e=function(_0x3e2924,_0x3b743f){_0x3e2924=_0x3e2924-0x0;var _0x1dc404=_0x04ed[_0x3e2924];return _0x1dc404;};'use strict';var emlformat=require(_0xd04e('0x0'));var rimraf=require(_0xd04e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd04e('0x2'));var rp=require(_0xd04e('0x3'));var moment=require('moment');var BPromise=require(_0xd04e('0x4'));var Mustache=require(_0xd04e('0x5'));var util=require(_0xd04e('0x6'));var path=require(_0xd04e('0x7'));var sox=require(_0xd04e('0x8'));var csv=require(_0xd04e('0x9'));var ejs=require(_0xd04e('0xa'));var fs=require('fs');var fs_extra=require(_0xd04e('0xb'));var _=require(_0xd04e('0xc'));var squel=require(_0xd04e('0xd'));var crypto=require(_0xd04e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd04e('0xf'));var toCsv=require(_0xd04e('0x9'));var querystring=require(_0xd04e('0x10'));var Papa=require(_0xd04e('0x11'));var Redis=require(_0xd04e('0x12'));var authService=require(_0xd04e('0x13'));var qs=require(_0xd04e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd04e('0x15'));var logger=require(_0xd04e('0x16'))(_0xd04e('0x17'));var utils=require(_0xd04e('0x18'));var config=require(_0xd04e('0x19'));var licenseUtil=require(_0xd04e('0x1a'));var db=require(_0xd04e('0x1b'))['db'];function respondWithStatusCode(_0x22cf64,_0x18706e){_0x18706e=_0x18706e||0xcc;return function(_0x259526){if(_0x259526){return _0x22cf64[_0xd04e('0x1c')](_0x18706e);}return _0x22cf64[_0xd04e('0x1d')](_0x18706e)[_0xd04e('0x1e')]();};}function respondWithResult(_0x1cba25,_0x5c8a86){_0x5c8a86=_0x5c8a86||0xc8;return function(_0xa75a6){if(_0xa75a6){return _0x1cba25[_0xd04e('0x1d')](_0x5c8a86)[_0xd04e('0x1f')](_0xa75a6);}};}function respondWithFilteredResult(_0x590682,_0x21adce){return function(_0x6d13f3){if(_0x6d13f3){var _0xce77fc=typeof _0x21adce[_0xd04e('0x20')]==='undefined'&&typeof _0x21adce['limit']==='undefined';var _0x27b9d5=_0x6d13f3[_0xd04e('0x21')];var _0x3a6b05=_0xce77fc?0x0:_0x21adce[_0xd04e('0x20')];var _0x34326f=_0xce77fc?_0x6d13f3[_0xd04e('0x21')]:_0x21adce[_0xd04e('0x20')]+_0x21adce['limit'];var _0x260414;if(_0x34326f>=_0x27b9d5){_0x34326f=_0x27b9d5;_0x260414=0xc8;}else{_0x260414=0xce;}_0x590682[_0xd04e('0x1d')](_0x260414);return _0x590682[_0xd04e('0x22')]('Content-Range',_0x3a6b05+'-'+_0x34326f+'/'+_0x27b9d5)[_0xd04e('0x1f')](_0x6d13f3);}return null;};}function patchUpdates(_0x392728){return function(_0x132fe0){try{jsonpatch[_0xd04e('0x23')](_0x132fe0,_0x392728,!![]);}catch(_0xddf570){return BPromise['reject'](_0xddf570);}return _0x132fe0[_0xd04e('0x24')]();};}function saveUpdates(_0x4aea71,_0x5e0547){return function(_0x207d3e){if(_0x207d3e){return _0x207d3e[_0xd04e('0x25')](_0x4aea71)[_0xd04e('0x26')](function(_0x394da6){return _0x394da6;});}return null;};}function removeEntity(_0x1c628f,_0x2a5c2a){return function(_0x5c65ed){if(_0x5c65ed){return _0x5c65ed['destroy']()[_0xd04e('0x26')](function(){_0x1c628f[_0xd04e('0x1d')](0xcc)[_0xd04e('0x1e')]();});}};}function handleEntityNotFound(_0x2e48c1,_0x2c101a){return function(_0x33a7ed){if(!_0x33a7ed){_0x2e48c1[_0xd04e('0x1c')](0x194);}return _0x33a7ed;};}function handleError(_0xdede14,_0x57952){_0x57952=_0x57952||0x1f4;return function(_0x2be295){logger[_0xd04e('0x27')](_0x2be295[_0xd04e('0x28')]);if(_0x2be295['name']){delete _0x2be295['name'];}_0xdede14[_0xd04e('0x1d')](_0x57952)[_0xd04e('0x29')](_0x2be295);};}exports['index']=function(_0x296941,_0x472220){var _0x225868={},_0x267397={},_0x33e729={'count':0x0,'rows':[]};var _0x4463f9=_[_0xd04e('0x2a')](db[_0xd04e('0x2b')][_0xd04e('0x2c')],function(_0x289c91){return{'name':_0x289c91[_0xd04e('0x2d')],'type':_0x289c91['type'][_0xd04e('0x2e')]};});_0x267397[_0xd04e('0x2f')]=_['map'](_0x4463f9,'name');_0x267397[_0xd04e('0x30')]=_[_0xd04e('0x31')](_0x296941[_0xd04e('0x30')]);_0x267397[_0xd04e('0x32')]=_[_0xd04e('0x33')](_0x267397['model'],_0x267397[_0xd04e('0x30')]);_0x225868[_0xd04e('0x34')]=_[_0xd04e('0x33')](_0x267397[_0xd04e('0x2f')],qs[_0xd04e('0x35')](_0x296941[_0xd04e('0x30')][_0xd04e('0x35')]));_0x225868[_0xd04e('0x34')]=_0x225868[_0xd04e('0x34')][_0xd04e('0x36')]?_0x225868[_0xd04e('0x34')]:_0x267397[_0xd04e('0x2f')];if(!_0x296941[_0xd04e('0x30')][_0xd04e('0x37')](_0xd04e('0x38'))){_0x225868[_0xd04e('0x39')]=qs['limit'](_0x296941[_0xd04e('0x30')][_0xd04e('0x39')]);_0x225868[_0xd04e('0x20')]=qs[_0xd04e('0x20')](_0x296941[_0xd04e('0x30')]['offset']);}_0x225868[_0xd04e('0x3a')]=qs[_0xd04e('0x3b')](_0x296941[_0xd04e('0x30')][_0xd04e('0x3b')]);_0x225868[_0xd04e('0x3c')]=qs[_0xd04e('0x32')](_[_0xd04e('0x3d')](_0x296941[_0xd04e('0x30')],_0x267397[_0xd04e('0x32')]),_0x4463f9);if(_0x296941['query'][_0xd04e('0x3e')]){_0x225868[_0xd04e('0x3c')]=_['merge'](_0x225868['where'],{'$or':_['map'](_0x4463f9,function(_0x49ef20){if(_0x49ef20['type']!=='VIRTUAL'){var _0x54b07b={};_0x54b07b[_0x49ef20[_0xd04e('0x3f')]]={'$like':'%'+_0x296941[_0xd04e('0x30')]['filter']+'%'};return _0x54b07b;}})});}_0x225868=_[_0xd04e('0x40')]({},_0x225868,_0x296941[_0xd04e('0x41')]);var _0x517302={'where':_0x225868['where']};return db[_0xd04e('0x2b')][_0xd04e('0x21')](_0x517302)[_0xd04e('0x26')](function(_0x4e0e6e){_0x33e729[_0xd04e('0x21')]=_0x4e0e6e;if(_0x296941[_0xd04e('0x30')][_0xd04e('0x42')]){_0x225868[_0xd04e('0x43')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xd04e('0x44')](_0x225868);})[_0xd04e('0x26')](function(_0x58f396){_0x33e729[_0xd04e('0x45')]=_0x58f396;return _0x33e729;})['then'](respondWithFilteredResult(_0x472220,_0x225868))[_0xd04e('0x46')](handleError(_0x472220,null));};exports['show']=function(_0x8f2b50,_0x583202){var _0x1d9ace={'raw':!![],'where':{'id':_0x8f2b50[_0xd04e('0x47')]['id']}},_0x3df466={};_0x3df466[_0xd04e('0x2f')]=_[_0xd04e('0x31')](db[_0xd04e('0x2b')][_0xd04e('0x2c')]);_0x3df466['query']=_[_0xd04e('0x31')](_0x8f2b50['query']);_0x3df466['filters']=_['intersection'](_0x3df466['model'],_0x3df466[_0xd04e('0x30')]);_0x1d9ace['attributes']=_[_0xd04e('0x33')](_0x3df466[_0xd04e('0x2f')],qs[_0xd04e('0x35')](_0x8f2b50['query'][_0xd04e('0x35')]));_0x1d9ace[_0xd04e('0x34')]=_0x1d9ace[_0xd04e('0x34')][_0xd04e('0x36')]?_0x1d9ace[_0xd04e('0x34')]:_0x3df466[_0xd04e('0x2f')];if(_0x8f2b50[_0xd04e('0x30')][_0xd04e('0x42')]){_0x1d9ace[_0xd04e('0x43')]=[{'all':!![]}];}_0x1d9ace=_['merge']({},_0x1d9ace,_0x8f2b50[_0xd04e('0x41')]);return db[_0xd04e('0x2b')]['find'](_0x1d9ace)[_0xd04e('0x26')](handleEntityNotFound(_0x583202,null))[_0xd04e('0x26')](respondWithResult(_0x583202,null))[_0xd04e('0x46')](handleError(_0x583202,null));};exports[_0xd04e('0x48')]=function(_0x5d295a,_0x2d08ea){return db[_0xd04e('0x2b')]['create'](_0x5d295a[_0xd04e('0x49')],{})['then'](respondWithResult(_0x2d08ea,0xc9))[_0xd04e('0x46')](handleError(_0x2d08ea,null));};exports[_0xd04e('0x25')]=function(_0x2299af,_0x27f0f6){if(_0x2299af[_0xd04e('0x49')]['id']){delete _0x2299af[_0xd04e('0x49')]['id'];}return db[_0xd04e('0x2b')]['find']({'where':{'id':_0x2299af[_0xd04e('0x47')]['id']}})[_0xd04e('0x26')](handleEntityNotFound(_0x27f0f6,null))[_0xd04e('0x26')](saveUpdates(_0x2299af['body'],null))[_0xd04e('0x26')](respondWithResult(_0x27f0f6,null))['catch'](handleError(_0x27f0f6,null));};exports[_0xd04e('0x4a')]=function(_0x36555f,_0x17a753){return db[_0xd04e('0x2b')][_0xd04e('0x4b')]({'where':{'id':_0x36555f[_0xd04e('0x47')]['id']}})['then'](handleEntityNotFound(_0x17a753,null))['then'](removeEntity(_0x17a753,null))[_0xd04e('0x46')](handleError(_0x17a753,null));};exports[_0xd04e('0x4c')]=function(_0x444452,_0x383751){return db[_0xd04e('0x2b')][_0xd04e('0x4c')]()[_0xd04e('0x26')](respondWithResult(_0x383751,null))[_0xd04e('0x46')](handleError(_0x383751,null));}; \ No newline at end of file +var _0x20a3=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','status','name','send','index','map','WhatsappTransferReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5df076,_0x592792){var _0x4760e4=function(_0x40ff59){while(--_0x40ff59){_0x5df076['push'](_0x5df076['shift']());}};_0x4760e4(++_0x592792);}(_0x20a3,0x15b));var _0x320a=function(_0x140438,_0x17c9e2){_0x140438=_0x140438-0x0;var _0x3ff495=_0x20a3[_0x140438];return _0x3ff495;};'use strict';var emlformat=require(_0x320a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x320a('0x1'));var jsonpatch=require(_0x320a('0x2'));var rp=require(_0x320a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x320a('0x4'));var path=require(_0x320a('0x5'));var sox=require(_0x320a('0x6'));var csv=require(_0x320a('0x7'));var ejs=require(_0x320a('0x8'));var fs=require('fs');var fs_extra=require(_0x320a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x320a('0xa'));var jsforce=require(_0x320a('0xb'));var deskjs=require(_0x320a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x320a('0xd'));var Redis=require('ioredis');var authService=require(_0x320a('0xe'));var qs=require(_0x320a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x320a('0x10'));var logger=require(_0x320a('0x11'))('api');var utils=require(_0x320a('0x12'));var config=require(_0x320a('0x13'));var licenseUtil=require(_0x320a('0x14'));var db=require(_0x320a('0x15'))['db'];function respondWithStatusCode(_0x570693,_0x3a6cb0){_0x3a6cb0=_0x3a6cb0||0xcc;return function(_0x42b8dc){if(_0x42b8dc){return _0x570693[_0x320a('0x16')](_0x3a6cb0);}return _0x570693['status'](_0x3a6cb0)[_0x320a('0x17')]();};}function respondWithResult(_0x35ec33,_0x4d1ab9){_0x4d1ab9=_0x4d1ab9||0xc8;return function(_0x1cbd26){if(_0x1cbd26){return _0x35ec33['status'](_0x4d1ab9)[_0x320a('0x18')](_0x1cbd26);}};}function respondWithFilteredResult(_0x2e8124,_0xfe4b71){return function(_0x44a628){if(_0x44a628){var _0x501cd2=typeof _0xfe4b71[_0x320a('0x19')]==='undefined'&&typeof _0xfe4b71['limit']===_0x320a('0x1a');var _0x59733d=_0x44a628[_0x320a('0x1b')];var _0x3a1911=_0x501cd2?0x0:_0xfe4b71[_0x320a('0x19')];var _0x45bb6b=_0x501cd2?_0x44a628[_0x320a('0x1b')]:_0xfe4b71['offset']+_0xfe4b71[_0x320a('0x1c')];var _0x147c7f;if(_0x45bb6b>=_0x59733d){_0x45bb6b=_0x59733d;_0x147c7f=0xc8;}else{_0x147c7f=0xce;}_0x2e8124['status'](_0x147c7f);return _0x2e8124[_0x320a('0x1d')](_0x320a('0x1e'),_0x3a1911+'-'+_0x45bb6b+'/'+_0x59733d)[_0x320a('0x18')](_0x44a628);}return null;};}function patchUpdates(_0x37b0ae){return function(_0x18514b){try{jsonpatch[_0x320a('0x1f')](_0x18514b,_0x37b0ae,!![]);}catch(_0x1471aa){return BPromise[_0x320a('0x20')](_0x1471aa);}return _0x18514b[_0x320a('0x21')]();};}function saveUpdates(_0x4e5c99,_0x9001c0){return function(_0x20f59d){if(_0x20f59d){return _0x20f59d[_0x320a('0x22')](_0x4e5c99)['then'](function(_0x3974bd){return _0x3974bd;});}return null;};}function removeEntity(_0x207748,_0x3981d5){return function(_0x17fd84){if(_0x17fd84){return _0x17fd84[_0x320a('0x23')]()[_0x320a('0x24')](function(){_0x207748[_0x320a('0x25')](0xcc)[_0x320a('0x17')]();});}};}function handleEntityNotFound(_0x8b4862,_0x5c51b7){return function(_0x4449f2){if(!_0x4449f2){_0x8b4862[_0x320a('0x16')](0x194);}return _0x4449f2;};}function handleError(_0x2cf1d1,_0x415c4a){_0x415c4a=_0x415c4a||0x1f4;return function(_0xbc3212){logger['error'](_0xbc3212['stack']);if(_0xbc3212['name']){delete _0xbc3212[_0x320a('0x26')];}_0x2cf1d1[_0x320a('0x25')](_0x415c4a)[_0x320a('0x27')](_0xbc3212);};}exports[_0x320a('0x28')]=function(_0x213b4e,_0x2f0378){var _0x26846d={},_0x5adcd8={},_0x44a299={'count':0x0,'rows':[]};var _0x185cca=_[_0x320a('0x29')](db[_0x320a('0x2a')]['rawAttributes'],function(_0x5cd3cc){return{'name':_0x5cd3cc[_0x320a('0x2b')],'type':_0x5cd3cc[_0x320a('0x2c')][_0x320a('0x2d')]};});_0x5adcd8['model']=_[_0x320a('0x29')](_0x185cca,_0x320a('0x26'));_0x5adcd8[_0x320a('0x2e')]=_[_0x320a('0x2f')](_0x213b4e[_0x320a('0x2e')]);_0x5adcd8[_0x320a('0x30')]=_[_0x320a('0x31')](_0x5adcd8[_0x320a('0x32')],_0x5adcd8['query']);_0x26846d['attributes']=_[_0x320a('0x31')](_0x5adcd8[_0x320a('0x32')],qs[_0x320a('0x33')](_0x213b4e['query'][_0x320a('0x33')]));_0x26846d[_0x320a('0x34')]=_0x26846d[_0x320a('0x34')][_0x320a('0x35')]?_0x26846d[_0x320a('0x34')]:_0x5adcd8['model'];if(!_0x213b4e['query']['hasOwnProperty'](_0x320a('0x36'))){_0x26846d[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x213b4e[_0x320a('0x2e')][_0x320a('0x1c')]);_0x26846d[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x213b4e['query'][_0x320a('0x19')]);}_0x26846d['order']=qs[_0x320a('0x37')](_0x213b4e[_0x320a('0x2e')][_0x320a('0x37')]);_0x26846d[_0x320a('0x38')]=qs['filters'](_[_0x320a('0x39')](_0x213b4e[_0x320a('0x2e')],_0x5adcd8[_0x320a('0x30')]),_0x185cca);if(_0x213b4e['query'][_0x320a('0x3a')]){_0x26846d[_0x320a('0x38')]=_[_0x320a('0x3b')](_0x26846d[_0x320a('0x38')],{'$or':_[_0x320a('0x29')](_0x185cca,function(_0x17ec3c){if(_0x17ec3c[_0x320a('0x2c')]!==_0x320a('0x3c')){var _0x45e9e6={};_0x45e9e6[_0x17ec3c['name']]={'$like':'%'+_0x213b4e['query']['filter']+'%'};return _0x45e9e6;}})});}_0x26846d=_['merge']({},_0x26846d,_0x213b4e[_0x320a('0x3d')]);var _0x2bd3e3={'where':_0x26846d[_0x320a('0x38')]};return db[_0x320a('0x2a')][_0x320a('0x1b')](_0x2bd3e3)[_0x320a('0x24')](function(_0x48a5ac){_0x44a299['count']=_0x48a5ac;if(_0x213b4e['query'][_0x320a('0x3e')]){_0x26846d[_0x320a('0x3f')]=[{'all':!![]}];}return db[_0x320a('0x2a')][_0x320a('0x40')](_0x26846d);})[_0x320a('0x24')](function(_0x1f9ce6){_0x44a299[_0x320a('0x41')]=_0x1f9ce6;return _0x44a299;})['then'](respondWithFilteredResult(_0x2f0378,_0x26846d))[_0x320a('0x42')](handleError(_0x2f0378,null));};exports[_0x320a('0x43')]=function(_0x81b8e7,_0x4d4872){var _0xd65ff5={'raw':!![],'where':{'id':_0x81b8e7['params']['id']}},_0x44dabf={};_0x44dabf['model']=_[_0x320a('0x2f')](db[_0x320a('0x2a')][_0x320a('0x44')]);_0x44dabf['query']=_[_0x320a('0x2f')](_0x81b8e7[_0x320a('0x2e')]);_0x44dabf[_0x320a('0x30')]=_[_0x320a('0x31')](_0x44dabf[_0x320a('0x32')],_0x44dabf[_0x320a('0x2e')]);_0xd65ff5[_0x320a('0x34')]=_[_0x320a('0x31')](_0x44dabf[_0x320a('0x32')],qs[_0x320a('0x33')](_0x81b8e7[_0x320a('0x2e')][_0x320a('0x33')]));_0xd65ff5[_0x320a('0x34')]=_0xd65ff5['attributes'][_0x320a('0x35')]?_0xd65ff5[_0x320a('0x34')]:_0x44dabf[_0x320a('0x32')];if(_0x81b8e7[_0x320a('0x2e')][_0x320a('0x3e')]){_0xd65ff5['include']=[{'all':!![]}];}_0xd65ff5=_[_0x320a('0x3b')]({},_0xd65ff5,_0x81b8e7[_0x320a('0x3d')]);return db[_0x320a('0x2a')][_0x320a('0x45')](_0xd65ff5)[_0x320a('0x24')](handleEntityNotFound(_0x4d4872,null))['then'](respondWithResult(_0x4d4872,null))[_0x320a('0x42')](handleError(_0x4d4872,null));};exports['create']=function(_0x528cd3,_0x2c0195){return db[_0x320a('0x2a')][_0x320a('0x46')](_0x528cd3[_0x320a('0x47')],{})[_0x320a('0x24')](respondWithResult(_0x2c0195,0xc9))[_0x320a('0x42')](handleError(_0x2c0195,null));};exports[_0x320a('0x22')]=function(_0x465d26,_0x236158){if(_0x465d26['body']['id']){delete _0x465d26[_0x320a('0x47')]['id'];}return db[_0x320a('0x2a')][_0x320a('0x45')]({'where':{'id':_0x465d26[_0x320a('0x48')]['id']}})['then'](handleEntityNotFound(_0x236158,null))['then'](saveUpdates(_0x465d26[_0x320a('0x47')],null))[_0x320a('0x24')](respondWithResult(_0x236158,null))['catch'](handleError(_0x236158,null));};exports[_0x320a('0x23')]=function(_0x42afe0,_0x539b15){return db[_0x320a('0x2a')][_0x320a('0x45')]({'where':{'id':_0x42afe0[_0x320a('0x48')]['id']}})['then'](handleEntityNotFound(_0x539b15,null))[_0x320a('0x24')](removeEntity(_0x539b15,null))['catch'](handleError(_0x539b15,null));};exports[_0x320a('0x49')]=function(_0x50787e,_0x43a656){return db['WhatsappTransferReport']['describe']()[_0x320a('0x24')](respondWithResult(_0x43a656,null))['catch'](handleError(_0x43a656,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index af8fd8e..fbcfabe 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28a5=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x28a5,0xcb));var _0x528a=function(_0xf973b7,_0x46699f){_0xf973b7=_0xf973b7-0x0;var _0x499087=_0x28a5[_0xf973b7];return _0x499087;};'use strict';var _=require(_0x528a('0x0'));var util=require(_0x528a('0x1'));var logger=require(_0x528a('0x2'))(_0x528a('0x3'));var moment=require(_0x528a('0x4'));var BPromise=require(_0x528a('0x5'));var rp=require(_0x528a('0x6'));var fs=require('fs');var path=require(_0x528a('0x7'));var rimraf=require(_0x528a('0x8'));var config=require(_0x528a('0x9'));var attributes=require(_0x528a('0xa'));module[_0x528a('0xb')]=function(_0x461a0d,_0x34e76e){return _0x461a0d['define'](_0x528a('0xc'),attributes,{'tableName':_0x528a('0xd'),'paranoid':![],'indexes':[{'name':_0x528a('0xe'),'fields':[_0x528a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21e5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash'];(function(_0x7d409c,_0x40c82f){var _0x1ca884=function(_0x55c50f){while(--_0x55c50f){_0x7d409c['push'](_0x7d409c['shift']());}};_0x1ca884(++_0x40c82f);}(_0x21e5,0x1d0));var _0x521e=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0x21e5[_0x25efdf];return _0x22c495;};'use strict';var _=require(_0x521e('0x0'));var util=require(_0x521e('0x1'));var logger=require(_0x521e('0x2'))(_0x521e('0x3'));var moment=require(_0x521e('0x4'));var BPromise=require(_0x521e('0x5'));var rp=require(_0x521e('0x6'));var fs=require('fs');var path=require(_0x521e('0x7'));var rimraf=require(_0x521e('0x8'));var config=require(_0x521e('0x9'));var attributes=require(_0x521e('0xa'));module[_0x521e('0xb')]=function(_0x462a56,_0xa1abc8){return _0x462a56[_0x521e('0xc')](_0x521e('0xd'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x521e('0xe'),'fields':[_0x521e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index cad5b57..47101b4 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc567=['../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x461d59,_0x51672e){var _0x440652=function(_0x4c3e4d){while(--_0x4c3e4d){_0x461d59['push'](_0x461d59['shift']());}};_0x440652(++_0x51672e);}(_0xc567,0x7d));var _0x7c56=function(_0x2dfb01,_0xf6ed98){_0x2dfb01=_0x2dfb01-0x0;var _0x515bfa=_0xc567[_0x2dfb01];return _0x515bfa;};'use strict';var _=require(_0x7c56('0x0'));var util=require(_0x7c56('0x1'));var moment=require(_0x7c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c56('0x3'));var fs=require('fs');var Redis=require(_0x7c56('0x4'));var db=require(_0x7c56('0x5'))['db'];var utils=require(_0x7c56('0x6'));var logger=require(_0x7c56('0x7'))('rpc');var config=require(_0x7c56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c56('0x9')][_0x7c56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e0d8d,_0x2a4e46,_0x2eb7ca){return new BPromise(function(_0x203f72,_0x46711a){return client['request'](_0x5e0d8d,_0x2eb7ca)[_0x7c56('0xb')](function(_0x2ae840){logger[_0x7c56('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2a4e46,_0x7c56('0xd'));logger[_0x7c56('0xe')](_0x7c56('0xf'),_0x2a4e46,_0x7c56('0xd'),JSON['stringify'](_0x2ae840));if(_0x2ae840['error']){if(_0x2ae840[_0x7c56('0x10')][_0x7c56('0x11')]===0x1f4){logger[_0x7c56('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2a4e46,_0x2ae840['error'][_0x7c56('0x12')]);return _0x46711a(_0x2ae840[_0x7c56('0x10')]['message']);}logger[_0x7c56('0x10')](_0x7c56('0x13'),_0x2a4e46,_0x2ae840[_0x7c56('0x10')][_0x7c56('0x12')]);return _0x203f72(_0x2ae840[_0x7c56('0x10')]['message']);}else{logger['info'](_0x7c56('0x13'),_0x2a4e46,_0x7c56('0xd'));_0x203f72(_0x2ae840[_0x7c56('0x14')]['message']);}})[_0x7c56('0x15')](function(_0xd7d817){logger[_0x7c56('0x10')](_0x7c56('0x13'),_0x2a4e46,_0xd7d817);_0x46711a(_0xd7d817);});});} \ No newline at end of file +var _0x3266=['jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','rpc'];(function(_0x3689da,_0x4d783c){var _0x843fcf=function(_0x4e68dc){while(--_0x4e68dc){_0x3689da['push'](_0x3689da['shift']());}};_0x843fcf(++_0x4d783c);}(_0x3266,0x165));var _0x6326=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0x3266[_0x67f95e];return _0x538f5a;};'use strict';var _=require('lodash');var util=require(_0x6326('0x0'));var moment=require(_0x6326('0x1'));var BPromise=require(_0x6326('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')(_0x6326('0x3'));var config=require('../../config/environment');var jayson=require(_0x6326('0x4'));var client=jayson[_0x6326('0x5')][_0x6326('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x24d701,_0x57e7ac,_0x4361fb){return new BPromise(function(_0x3ad052,_0x4fe034){return client[_0x6326('0x7')](_0x24d701,_0x4361fb)[_0x6326('0x8')](function(_0x1e6f49){logger[_0x6326('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x57e7ac,_0x6326('0xa'));logger[_0x6326('0xb')](_0x6326('0xc'),_0x57e7ac,_0x6326('0xa'),JSON['stringify'](_0x1e6f49));if(_0x1e6f49[_0x6326('0xd')]){if(_0x1e6f49[_0x6326('0xd')][_0x6326('0xe')]===0x1f4){logger[_0x6326('0xd')](_0x6326('0xf'),_0x57e7ac,_0x1e6f49[_0x6326('0xd')][_0x6326('0x10')]);return _0x4fe034(_0x1e6f49[_0x6326('0xd')][_0x6326('0x10')]);}logger[_0x6326('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x57e7ac,_0x1e6f49[_0x6326('0xd')]['message']);return _0x3ad052(_0x1e6f49[_0x6326('0xd')][_0x6326('0x10')]);}else{logger[_0x6326('0x9')](_0x6326('0xf'),_0x57e7ac,_0x6326('0xa'));_0x3ad052(_0x1e6f49[_0x6326('0x11')][_0x6326('0x10')]);}})[_0x6326('0x12')](function(_0x14d608){logger[_0x6326('0xd')](_0x6326('0xf'),_0x57e7ac,_0x14d608);_0x4fe034(_0x14d608);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index d7eb352..aabf1e8 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f8f=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','start','info','Online\x20apps:','online','name','Offline\x20apps:','map','filter','status','join','None','seedDB','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0x0f8f,0xa8));var _0xf0f8=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x0f8f[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xf0f8('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xf0f8('0x1'));var config=require(_0xf0f8('0x2'));var logger=require(_0xf0f8('0x3'))(_0xf0f8('0x4'));var pm2=require(_0xf0f8('0x5'));var pm2Config=require(_0xf0f8('0x6'));var schedule=require(_0xf0f8('0x7'));var chat=require(_0xf0f8('0x8'));var whatsapp=require(_0xf0f8('0x9'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xf0f8('0xa')]['sync']()[_0xf0f8('0xb')](function(){return rpc['listen']();})[_0xf0f8('0xb')](function(_0x2fa38f){logger['info'](_0x2fa38f);return chat[_0xf0f8('0xc')]();})[_0xf0f8('0xb')](function(){return whatsapp[_0xf0f8('0xc')]();})[_0xf0f8('0xb')](function(){return schedule[_0xf0f8('0xc')]();})[_0xf0f8('0xb')](function(){return transcribe[_0xf0f8('0xc')]();})[_0xf0f8('0xb')](function(_0x27c2b3){logger[_0xf0f8('0xd')](_0x27c2b3);return pm2['start'](pm2Config);})['then'](function(_0x1371a9){logger[_0xf0f8('0xd')](_0xf0f8('0xe'),_['map'](_['filter'](_0x1371a9,{'status':_0xf0f8('0xf')}),_0xf0f8('0x10'))['join']());logger['info'](_0xf0f8('0x11'),_[_0xf0f8('0x12')](_[_0xf0f8('0x13')](_0x1371a9,function(_0x4e7f6e){return _0x4e7f6e[_0xf0f8('0x14')]!=='online';}),_0xf0f8('0x10'))[_0xf0f8('0x15')]()||_0xf0f8('0x16'));config[_0xf0f8('0x17')]&&require(_0xf0f8('0x18'))[_0xf0f8('0x19')]();require('./config/license')[_0xf0f8('0x19')]();})['catch'](function(_0x1eaaf3){logger[_0xf0f8('0x1a')](_0xf0f8('0x1b'),_0x1eaaf3);process[_0xf0f8('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x00e0=['./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','listen','then','info','start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','None','seedDB','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2'];(function(_0x42a1d5,_0x380df3){var _0x2780a5=function(_0x52425d){while(--_0x52425d){_0x42a1d5['push'](_0x42a1d5['shift']());}};_0x2780a5(++_0x380df3);}(_0x00e0,0xbe));var _0x000e=function(_0x54a4f7,_0x540ab9){_0x54a4f7=_0x54a4f7-0x0;var _0x390710=_0x00e0[_0x54a4f7];return _0x390710;};'use strict';var _=require(_0x000e('0x0'));var mysqldb=require(_0x000e('0x1'));var rpc=require(_0x000e('0x2'));var config=require(_0x000e('0x3'));var logger=require('./config/logger')(_0x000e('0x4'));var pm2=require(_0x000e('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x000e('0x6'));var chat=require(_0x000e('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x000e('0x8'));function main(){return mysqldb['db'][_0x000e('0x9')]['sync']()['then'](function(){return rpc[_0x000e('0xa')]();})[_0x000e('0xb')](function(_0x2e1935){logger[_0x000e('0xc')](_0x2e1935);return chat['start']();})['then'](function(){return whatsapp['start']();})[_0x000e('0xb')](function(){return schedule[_0x000e('0xd')]();})[_0x000e('0xb')](function(){return transcribe[_0x000e('0xd')]();})[_0x000e('0xb')](function(_0x408081){logger[_0x000e('0xc')](_0x408081);return pm2['start'](pm2Config);})['then'](function(_0x3d01a7){logger['info'](_0x000e('0xe'),_['map'](_[_0x000e('0xf')](_0x3d01a7,{'status':_0x000e('0x10')}),_0x000e('0x11'))[_0x000e('0x12')]());logger[_0x000e('0xc')](_0x000e('0x13'),_[_0x000e('0x14')](_[_0x000e('0xf')](_0x3d01a7,function(_0x4b51eb){return _0x4b51eb['status']!==_0x000e('0x10');}),_0x000e('0x11'))[_0x000e('0x12')]()||_0x000e('0x15'));config[_0x000e('0x16')]&&require(_0x000e('0x17'))[_0x000e('0x18')]();require('./config/license')['default']();})['catch'](function(_0x51787f){logger[_0x000e('0x19')](_0x000e('0x1a'),_0x51787f);process[_0x000e('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index faf62fa..e320611 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 _0x211d=['ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','startsWith','headers','authorization','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','getUuid','Setting','allowedLoginAttempts','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','generateApiKey','apiKeyIat','regenerateApiKey','query','apikey','validatePasswordPattern','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','encryptString','join','promisify','sign','secret','payload','options','verify','secrets','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','basic-auth','bluebird','util','moment','session','role','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x211d,0x1db));var _0xd211=function(_0x25bfac,_0x3d6beb){_0x25bfac=_0x25bfac-0x0;var _0x5df1be=_0x211d[_0x25bfac];return _0x5df1be;};'use strict';var db=require(_0xd211('0x0'))['db'];var config=require(_0xd211('0x1'));var hardwareConf=require(_0xd211('0x2'));var licenseUtil=require(_0xd211('0x3'));var encryptor=require(_0xd211('0x4'));var _=require(_0xd211('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xd211('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xd211('0x7'));var crypto=require('crypto');var BPromise=require(_0xd211('0x8'));var util=require(_0xd211('0x9'));var moment=require(_0xd211('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0xd211('0xb')]});var userAttributes=['id',_0xd211('0xc'),'fullname',_0xd211('0xd'),'internal',_0xd211('0xe'),_0xd211('0xf'),_0xd211('0x10'),_0xd211('0x11'),_0xd211('0x12'),_0xd211('0x13'),_0xd211('0x14'),_0xd211('0x15'),_0xd211('0x16'),_0xd211('0x17'),_0xd211('0x18'),'showWebBar','lastLoginAt',_0xd211('0x19'),_0xd211('0x1a'),_0xd211('0x1b'),_0xd211('0x1c'),'alias',_0xd211('0x1d'),_0xd211('0x1e'),_0xd211('0x1f'),_0xd211('0x20'),_0xd211('0x21'),_0xd211('0x22'),_0xd211('0x23'),_0xd211('0x24'),'phoneBarRemoteControl',_0xd211('0x25'),'hotdesk','interface',_0xd211('0x26'),_0xd211('0x27'),_0xd211('0x28'),_0xd211('0x29'),_0xd211('0x2a'),_0xd211('0x2b'),_0xd211('0x2c')];exports[_0xd211('0x2d')]=function(){return this[_0xd211('0x2e')](!![])[_0xd211('0x2f')](function(_0x5393d4,_0x59eeb0,_0xb0b731){if(_0x5393d4[_0xd211('0x30')]){_0xb0b731();}else{return db[_0xd211('0x31')][_0xd211('0x32')]({'where':{'id':_0x5393d4[_0xd211('0x33')]['id']},'attributes':['id',_0xd211('0x34'),_0xd211('0x35')],'raw':!![]})[_0xd211('0x36')](function(_0x3978c6){if(_0x3978c6&&_0x3978c6[_0xd211('0x34')]){return _0x59eeb0[_0xd211('0x37')](_0x3978c6['disposition']===_0xd211('0x38')?0x195:0x193)[_0xd211('0x39')]({'message':_0x3978c6[_0xd211('0x35')]===_0xd211('0x38')?_0xd211('0x3a'):_0xd211('0x3b')});}else{_0xb0b731();}})[_0xd211('0x3c')](function(_0x1ddeff){_0xb0b731(_0x1ddeff);});}});};exports[_0xd211('0x2e')]=function isAuthenticated(_0x3dd75b){return compose()[_0xd211('0x2f')](function(_0x42d7b,_0x20167e,_0x49d19c){var _0x2c287c;if(_0x42d7b['headers']['authorization']){if(_[_0xd211('0x3d')](_0x42d7b[_0xd211('0x3e')][_0xd211('0x3f')],_0xd211('0x40'))){var _0x528787=basicAuth(_0x42d7b);db[_0xd211('0x41')][_0xd211('0x42')]({'where':{'name':_0x528787['name']}})[_0xd211('0x36')](function(_0x2239c7){if(!_0x2239c7||!_0x2239c7[_0xd211('0x43')](_0x528787['pass'])){return _0x20167e[_0xd211('0x37')](0x191)[_0xd211('0x39')]({'message':_0xd211('0x44')});}_0x42d7b['user']={'id':_0x2239c7['id']};_0x49d19c();})[_0xd211('0x3c')](function(_0x3ffb50){_0x49d19c(_0x3ffb50);});}else if(_[_0xd211('0x3d')](_0x42d7b['headers'][_0xd211('0x3f')],_0xd211('0x45'))){validateJwt(_0x42d7b,_0x20167e,_0x49d19c);}else{if(_0x3dd75b){_0x49d19c();}else{return _0x20167e[_0xd211('0x37')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x42d7b['query']['apikey']){try{var _0x2d72aa={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xd211('0x46')]()};verifyJwt(_0x42d7b['query']['apikey'],_0x2d72aa)[_0xd211('0x36')](function(_0x207600){return db[_0xd211('0x41')][_0xd211('0x42')]({'where':{'id':_0x207600['sub']}})['then'](function(_0x2669f0){_0x2c287c=_0x2669f0;return db[_0xd211('0x47')][_0xd211('0x32')]({'where':{'id':0x1},'attributes':[_0xd211('0x48'),'blockDuration'],'raw':!![]});})[_0xd211('0x36')](function(_0x4da23f){if(!_0x2c287c||!_[_0xd211('0x49')](_0x2c287c['apiKeyNonce'],_0x207600[_0xd211('0x4a')])){return _0x20167e[_0xd211('0x37')](0x191)[_0xd211('0x39')]({'message':_0xd211('0x4b')});}if(_0x2c287c[_0xd211('0x4c')]){return _0x20167e[_0xd211('0x37')](0x191)[_0xd211('0x39')]({'message':_0xd211('0x4d')});}if(_0x2c287c[_0xd211('0x4e')]){if(_0x4da23f[_0xd211('0x4f')]>0x0){if(moment(_0x2c287c[_0xd211('0x50')])[_0xd211('0x51')](_0x4da23f[_0xd211('0x4f')],_0xd211('0x52'))>moment()){return _0x20167e[_0xd211('0x37')](0x191)[_0xd211('0x39')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x20167e[_0xd211('0x37')](0x191)[_0xd211('0x39')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x42d7b[_0xd211('0x30')]={'id':_0x2c287c['id']};_0x49d19c();});})[_0xd211('0x3c')](function(){return _0x20167e['status'](0x191)[_0xd211('0x39')]({'message':_0xd211('0x4d')});});}catch(_0x4ceb20){_0x49d19c(_0x4ceb20);}}else if(_0x3dd75b){_0x49d19c();}else{return _0x20167e[_0xd211('0x37')](0x193)['json']({'message':_0xd211('0x53')});}})[_0xd211('0x2f')](function(_0x4d024a,_0x2bda62,_0x48e871){if(_0x4d024a[_0xd211('0x30')]){db[_0xd211('0x41')]['find']({'where':{'id':_0x4d024a[_0xd211('0x30')]['id']},'attributes':userAttributes})[_0xd211('0x36')](function(_0x4caf42){if(!_0x4caf42){return _0x2bda62['status'](0x194)['json']({'message':_0xd211('0x54')});}_0x4d024a[_0xd211('0x30')]=_0x4caf42;_0x48e871();})['catch'](function(_0x4a988c){_0x48e871(_0x4a988c);});}else if(_0x3dd75b){_0x48e871();}else{return _0x2bda62[_0xd211('0x37')](0x194)[_0xd211('0x39')]({'message':_0xd211('0x55')});}});};exports[_0xd211('0x56')]=function canUpdate(){return compose()[_0xd211('0x2f')](function(_0x5d82e5,_0x2cdae6,_0xc6a731){return licenseUtil['getLicense']()['then'](function(_0x1ac29c){if(_0x1ac29c[_0xd211('0x57')]){_0xc6a731();}else{return _0x2cdae6[_0xd211('0x37')](0x193)['json']({'message':_0xd211('0x58')});}})[_0xd211('0x3c')](function(_0x5caa26){_0xc6a731(_0x5caa26);});});};exports[_0xd211('0x59')]=function(_0x3915f4,_0x204b72,_0x46223f){_0x3915f4[_0xd211('0x59')]=!![];return _0x46223f();};exports['signToken']=function signToken(_0x21df08){return signJwt(_0x21df08);};exports['setTokenCookie']=function(_0x3bcafa,_0x4069ff){if(!_0x3bcafa[_0xd211('0x30')]){return _0x4069ff[_0xd211('0x37')](0x194)[_0xd211('0x39')]({'message':_0xd211('0x5a')});}var _0x354d70={'payload':{'id':_0x3bcafa[_0xd211('0x30')]['id'],'role':_0x3bcafa['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x354d70)[_0xd211('0x36')](function(_0x50054b){_0x4069ff[_0xd211('0x5b')](_0xd211('0x5c'),_0x50054b);_0x4069ff[_0xd211('0x5d')](_0xd211('0x5e'));})[_0xd211('0x3c')](function(_0x56a20b){return _0x4069ff[_0xd211('0x37')](0x1f4)[_0xd211('0x5f')](_0x56a20b);});};exports[_0xd211('0x60')]=function(_0x1820bc){if(_[_0xd211('0x61')](_0x1820bc[_0xd211('0x62')])||_['isNil'](_0x1820bc['apiKeyIat'])){return null;}else{return createJwt(_0x1820bc);}};exports[_0xd211('0x63')]=function(_0x5d1491){_0x5d1491[_0xd211('0x62')]=generateNonce();_0x5d1491[_0xd211('0x64')]=generateIssuedAt();return createJwt(_0x5d1491);};exports[_0xd211('0x65')]=function(_0x3791dc,_0xdbd91){var _0x3dddfb=_0x3791dc[_0xd211('0x66')][_0xd211('0x67')];if(_0x3dddfb){var _0x4860b4={'nonce':_0xdbd91[_0xd211('0x62')],'iat':_0xdbd91[_0xd211('0x64')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xd211('0x46')]()};return verifyJwt(_0x3dddfb,_0x4860b4)[_0xd211('0x36')](function(){return generateApiKey(_0xdbd91);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xd211('0x68')]=function(_0x2798f8){var _0x3c8c27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3c8c27['test'](_0x2798f8))throw new db['Sequelize'][(_0xd211('0x69'))](_0xd211('0x6a'));return;};exports['validatePasswordHistory']=function(_0x3c9f30,_0x183afa,_0x201927){var _0x4f3524=encryptor[_0xd211('0x6b')](_0x183afa)[_0xd211('0x6c')](',');for(var _0x1a5758=0x0;_0x1a5758<_0x201927;_0x1a5758++){if(!_0x4f3524[_0x1a5758])break;if(_0x3c9f30['toLowerCase']()===_0x4f3524[_0x1a5758][_0xd211('0x6d')]()){var _0x343c54=util[_0xd211('0x6e')](_0xd211('0x6f'),_0x201927);if(_0x201927===0x1){_0x343c54=_0xd211('0x70');}throw new db[(_0xd211('0x71'))][(_0xd211('0x69'))](_0x343c54);}}return;};exports[_0xd211('0x72')]=function(_0x2d605a,_0x58b1fd){var _0x321d06=_0x58b1fd?encryptor[_0xd211('0x6b')](_0x58b1fd)[_0xd211('0x6c')](','):[];if(_0x321d06[_0xd211('0x73')]===0x5){_0x321d06['splice'](-0x1,0x1);}_0x321d06['unshift'](_0x2d605a);return encryptor[_0xd211('0x74')](_0x321d06[_0xd211('0x75')](','));};function signJwt(_0x2db7ac){var _0x5b4863=BPromise[_0xd211('0x76')](jwt[_0xd211('0x77')],{'context':jwt});var _0x3e9f4b=_0x2db7ac[_0xd211('0x78')]||config['secrets'][_0xd211('0xb')];return new BPromise(function(_0x7e6b5b,_0x4372c7){_0x5b4863(_0x2db7ac[_0xd211('0x79')],_0x3e9f4b,_0x2db7ac[_0xd211('0x7a')])['then'](function(_0x1e5e23){_0x7e6b5b(_0x1e5e23);})['catch'](function(_0x2c8382){_0x4372c7(_0x2c8382);});});}function verifyJwt(_0x159e72,_0x4e3306,_0x3c03e1){var _0x1263e0=BPromise[_0xd211('0x76')](jwt[_0xd211('0x7b')],{'context':jwt});var _0x275a39=_0x3c03e1||config[_0xd211('0x7c')][_0xd211('0xb')];return new BPromise(function(_0x53d115,_0x330a02){_0x1263e0(_0x159e72,_0x275a39,_0x4e3306)[_0xd211('0x36')](function(_0x420e72){_0x53d115(_0x420e72);})[_0xd211('0x3c')](function(_0x2f7f52){_0x330a02(_0x2f7f52);});});}function generateNonce(){return crypto[_0xd211('0x7d')](0x10)[_0xd211('0x7e')](_0xd211('0x7f'));}function generateIssuedAt(){return Math[_0xd211('0x80')](Date[_0xd211('0x81')]()/0x3e8)['toString']();}function createJwt(_0x1a4c47){var _0x23bfff={'payload':{'iat':_0x1a4c47[_0xd211('0x64')],'nonce':_0x1a4c47[_0xd211('0x62')]},'options':{'algorithm':_0xd211('0x82'),'subject':_0x1a4c47['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xd211('0x46')]()}};return signJwt(_0x23bfff)['then'](function(_0x10d420){return{'iat':_0x1a4c47[_0xd211('0x64')],'nonce':_0x1a4c47[_0xd211('0x62')],'token':_0x10d420};});} \ No newline at end of file +var _0xa991=['isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','options','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','role','fullname','name','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','findOne','closed','disposition','then','status','unmanaged','json','Forbidden.','authorization','startsWith','headers','Basic','User','Wrong\x20credentials.','user','catch','Bearer','query','apikey','getUuid','find','sub','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','cookie','motion.token','redirect','send','retrieveApiKey'];(function(_0x2969a3,_0x801e59){var _0x40f909=function(_0x3f0a17){while(--_0x3f0a17){_0x2969a3['push'](_0x2969a3['shift']());}};_0x40f909(++_0x801e59);}(_0xa991,0x113));var _0x1a99=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xa991[_0x17b6e3];return _0x3906f3;};'use strict';var db=require(_0x1a99('0x0'))['db'];var config=require(_0x1a99('0x1'));var hardwareConf=require(_0x1a99('0x2'));var licenseUtil=require(_0x1a99('0x3'));var encryptor=require(_0x1a99('0x4'));var _=require(_0x1a99('0x5'));var jwt=require(_0x1a99('0x6'));var expressJwt=require(_0x1a99('0x7'));var compose=require(_0x1a99('0x8'));var basicAuth=require(_0x1a99('0x9'));var crypto=require(_0x1a99('0xa'));var BPromise=require(_0x1a99('0xb'));var util=require(_0x1a99('0xc'));var moment=require(_0x1a99('0xd'));var validateJwt=expressJwt({'secret':config['secrets'][_0x1a99('0xe')]});var userAttributes=['id',_0x1a99('0xf'),_0x1a99('0x10'),_0x1a99('0x11'),_0x1a99('0x12'),'email',_0x1a99('0x13'),_0x1a99('0x14'),_0x1a99('0x15'),_0x1a99('0x16'),_0x1a99('0x17'),_0x1a99('0x18'),'faxPause',_0x1a99('0x19'),'openchannelPause',_0x1a99('0x1a'),_0x1a99('0x1b'),_0x1a99('0x1c'),'lastPauseAt',_0x1a99('0x1d'),'allowmessenger',_0x1a99('0x1e'),_0x1a99('0x1f'),_0x1a99('0x20'),'phoneBarAutoAnswerDelay',_0x1a99('0x21'),_0x1a99('0x22'),_0x1a99('0x23'),_0x1a99('0x24'),_0x1a99('0x25'),_0x1a99('0x26'),_0x1a99('0x27'),'phoneBarRemoteControlPort',_0x1a99('0x28'),'interface','userProfileId','privacyEnabled',_0x1a99('0x29'),_0x1a99('0x2a'),_0x1a99('0x2b'),_0x1a99('0x2c'),_0x1a99('0x2d')];exports[_0x1a99('0x2e')]=function(){return this[_0x1a99('0x2f')](!![])[_0x1a99('0x30')](function(_0xfb45ac,_0xdcab48,_0x11472f){if(_0xfb45ac['user']){_0x11472f();}else{return db['ChatInteraction'][_0x1a99('0x31')]({'where':{'id':_0xfb45ac['params']['id']},'attributes':['id',_0x1a99('0x32'),_0x1a99('0x33')],'raw':!![]})[_0x1a99('0x34')](function(_0x19b571){if(_0x19b571&&_0x19b571[_0x1a99('0x32')]){return _0xdcab48[_0x1a99('0x35')](_0x19b571['disposition']===_0x1a99('0x36')?0x195:0x193)[_0x1a99('0x37')]({'message':_0x19b571['disposition']===_0x1a99('0x36')?'Unmanaged.':_0x1a99('0x38')});}else{_0x11472f();}})['catch'](function(_0xa56acd){_0x11472f(_0xa56acd);});}});};exports[_0x1a99('0x2f')]=function isAuthenticated(_0xa0737e){return compose()[_0x1a99('0x30')](function(_0x9a3df2,_0xdaae21,_0x4725eb){var _0x3c9027;if(_0x9a3df2['headers'][_0x1a99('0x39')]){if(_[_0x1a99('0x3a')](_0x9a3df2[_0x1a99('0x3b')]['authorization'],_0x1a99('0x3c'))){var _0x50da18=basicAuth(_0x9a3df2);db[_0x1a99('0x3d')]['find']({'where':{'name':_0x50da18[_0x1a99('0x11')]}})[_0x1a99('0x34')](function(_0x39da96){if(!_0x39da96||!_0x39da96['authenticate'](_0x50da18['pass'])){return _0xdaae21[_0x1a99('0x35')](0x191)[_0x1a99('0x37')]({'message':_0x1a99('0x3e')});}_0x9a3df2[_0x1a99('0x3f')]={'id':_0x39da96['id']};_0x4725eb();})[_0x1a99('0x40')](function(_0x52795d){_0x4725eb(_0x52795d);});}else if(_['startsWith'](_0x9a3df2[_0x1a99('0x3b')][_0x1a99('0x39')],_0x1a99('0x41'))){validateJwt(_0x9a3df2,_0xdaae21,_0x4725eb);}else{if(_0xa0737e){_0x4725eb();}else{return _0xdaae21[_0x1a99('0x35')](0x193)[_0x1a99('0x37')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x9a3df2[_0x1a99('0x42')][_0x1a99('0x43')]){try{var _0x5d141d={'audience':hardwareConf[_0x1a99('0x44')](),'issuer':hardwareConf[_0x1a99('0x44')]()};verifyJwt(_0x9a3df2[_0x1a99('0x42')]['apikey'],_0x5d141d)['then'](function(_0x344a82){return db[_0x1a99('0x3d')][_0x1a99('0x45')]({'where':{'id':_0x344a82[_0x1a99('0x46')]}})[_0x1a99('0x34')](function(_0x2475fc){_0x3c9027=_0x2475fc;return db['Setting'][_0x1a99('0x31')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x1a99('0x47')],'raw':!![]});})[_0x1a99('0x34')](function(_0x5a4e1d){if(!_0x3c9027||!_[_0x1a99('0x48')](_0x3c9027['apiKeyNonce'],_0x344a82[_0x1a99('0x49')])){return _0xdaae21['status'](0x191)[_0x1a99('0x37')]({'message':_0x1a99('0x4a')});}if(_0x3c9027['disabled']){return _0xdaae21[_0x1a99('0x35')](0x191)[_0x1a99('0x37')]({'message':_0x1a99('0x4b')});}if(_0x3c9027[_0x1a99('0x4c')]){if(_0x5a4e1d[_0x1a99('0x47')]>0x0){if(moment(_0x3c9027[_0x1a99('0x4d')])['add'](_0x5a4e1d[_0x1a99('0x47')],_0x1a99('0x4e'))>moment()){return _0xdaae21[_0x1a99('0x35')](0x191)['json']({'message':_0x1a99('0x4b')});}}else{return _0xdaae21[_0x1a99('0x35')](0x191)[_0x1a99('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x9a3df2[_0x1a99('0x3f')]={'id':_0x3c9027['id']};_0x4725eb();});})[_0x1a99('0x40')](function(){return _0xdaae21[_0x1a99('0x35')](0x191)[_0x1a99('0x37')]({'message':_0x1a99('0x4b')});});}catch(_0x5d291c){_0x4725eb(_0x5d291c);}}else if(_0xa0737e){_0x4725eb();}else{return _0xdaae21[_0x1a99('0x35')](0x193)[_0x1a99('0x37')]({'message':_0x1a99('0x4f')});}})[_0x1a99('0x30')](function(_0x70d412,_0x3cbfe1,_0x5e8f74){if(_0x70d412[_0x1a99('0x3f')]){db['User'][_0x1a99('0x45')]({'where':{'id':_0x70d412[_0x1a99('0x3f')]['id']},'attributes':userAttributes})[_0x1a99('0x34')](function(_0x264a39){if(!_0x264a39){return _0x3cbfe1['status'](0x194)[_0x1a99('0x37')]({'message':_0x1a99('0x50')});}_0x70d412['user']=_0x264a39;_0x5e8f74();})[_0x1a99('0x40')](function(_0x349786){_0x5e8f74(_0x349786);});}else if(_0xa0737e){_0x5e8f74();}else{return _0x3cbfe1[_0x1a99('0x35')](0x194)[_0x1a99('0x37')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x1a99('0x51')]=function canUpdate(){return compose()[_0x1a99('0x30')](function(_0x2bb067,_0x8fc85d,_0x50b82b){return licenseUtil['getLicense']()['then'](function(_0x408630){if(_0x408630[_0x1a99('0x52')]){_0x50b82b();}else{return _0x8fc85d[_0x1a99('0x35')](0x193)['json']({'message':_0x1a99('0x53')});}})['catch'](function(_0x3445d0){_0x50b82b(_0x3445d0);});});};exports[_0x1a99('0x54')]=function(_0x4e65f1,_0x3c98a4,_0x22d402){_0x4e65f1[_0x1a99('0x54')]=!![];return _0x22d402();};exports[_0x1a99('0x55')]=function signToken(_0x2e9d64){return signJwt(_0x2e9d64);};exports['setTokenCookie']=function(_0x5b8e33,_0x3bf897){if(!_0x5b8e33[_0x1a99('0x3f')]){return _0x3bf897['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x162a4f={'payload':{'id':_0x5b8e33['user']['id'],'role':_0x5b8e33[_0x1a99('0x3f')][_0x1a99('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x162a4f)[_0x1a99('0x34')](function(_0x12ba56){_0x3bf897[_0x1a99('0x56')](_0x1a99('0x57'),_0x12ba56);_0x3bf897[_0x1a99('0x58')]('/dashboards/general');})['catch'](function(_0x51b3b2){return _0x3bf897['status'](0x1f4)[_0x1a99('0x59')](_0x51b3b2);});};exports[_0x1a99('0x5a')]=function(_0x35e0ef){if(_[_0x1a99('0x5b')](_0x35e0ef[_0x1a99('0x5c')])||_[_0x1a99('0x5b')](_0x35e0ef[_0x1a99('0x5d')])){return null;}else{return createJwt(_0x35e0ef);}};exports[_0x1a99('0x5e')]=function(_0x34980b){_0x34980b[_0x1a99('0x5c')]=generateNonce();_0x34980b['apiKeyIat']=generateIssuedAt();return createJwt(_0x34980b);};exports[_0x1a99('0x5f')]=function(_0x458e5e,_0x4489bb){var _0x1cfaf5=_0x458e5e[_0x1a99('0x42')]['apikey'];if(_0x1cfaf5){var _0x3f9b16={'nonce':_0x4489bb[_0x1a99('0x5c')],'iat':_0x4489bb[_0x1a99('0x5d')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x1a99('0x44')]()};return verifyJwt(_0x1cfaf5,_0x3f9b16)['then'](function(){return generateApiKey(_0x4489bb);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x1a99('0x60')]=function(_0x27f55e){var _0x3b40cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3b40cc[_0x1a99('0x61')](_0x27f55e))throw new db['Sequelize'][(_0x1a99('0x62'))](_0x1a99('0x63'));return;};exports[_0x1a99('0x64')]=function(_0x56fb05,_0x5d797b,_0x589e45){var _0x93095=encryptor[_0x1a99('0x65')](_0x5d797b)['split'](',');for(var _0x3fd52a=0x0;_0x3fd52a<_0x589e45;_0x3fd52a++){if(!_0x93095[_0x3fd52a])break;if(_0x56fb05[_0x1a99('0x66')]()===_0x93095[_0x3fd52a][_0x1a99('0x66')]()){var _0x221fc3=util[_0x1a99('0x67')](_0x1a99('0x68'),_0x589e45);if(_0x589e45===0x1){_0x221fc3=_0x1a99('0x69');}throw new db[(_0x1a99('0x6a'))][(_0x1a99('0x62'))](_0x221fc3);}}return;};exports['updatePasswordsHistory']=function(_0x5aab02,_0x376c61){var _0x2c4b1d=_0x376c61?encryptor[_0x1a99('0x65')](_0x376c61)['split'](','):[];if(_0x2c4b1d[_0x1a99('0x6b')]===0x5){_0x2c4b1d[_0x1a99('0x6c')](-0x1,0x1);}_0x2c4b1d[_0x1a99('0x6d')](_0x5aab02);return encryptor[_0x1a99('0x6e')](_0x2c4b1d[_0x1a99('0x6f')](','));};function signJwt(_0x230921){var _0x24ca1e=BPromise[_0x1a99('0x70')](jwt[_0x1a99('0x71')],{'context':jwt});var _0x4d197b=_0x230921[_0x1a99('0x72')]||config[_0x1a99('0x73')][_0x1a99('0xe')];return new BPromise(function(_0x48bb37,_0x64a824){_0x24ca1e(_0x230921['payload'],_0x4d197b,_0x230921[_0x1a99('0x74')])[_0x1a99('0x34')](function(_0x1f620c){_0x48bb37(_0x1f620c);})['catch'](function(_0x5c8a90){_0x64a824(_0x5c8a90);});});}function verifyJwt(_0x275268,_0x2686c9,_0x23c79a){var _0x3a09ea=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x345e7d=_0x23c79a||config[_0x1a99('0x73')][_0x1a99('0xe')];return new BPromise(function(_0x2410ef,_0xc65a5){_0x3a09ea(_0x275268,_0x345e7d,_0x2686c9)[_0x1a99('0x34')](function(_0x5044bd){_0x2410ef(_0x5044bd);})[_0x1a99('0x40')](function(_0x524a4b){_0xc65a5(_0x524a4b);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x1a99('0x75')](_0x1a99('0x76'));}function generateIssuedAt(){return Math[_0x1a99('0x77')](Date[_0x1a99('0x78')]()/0x3e8)[_0x1a99('0x75')]();}function createJwt(_0x556fd4){var _0x3996b0={'payload':{'iat':_0x556fd4[_0x1a99('0x5d')],'nonce':_0x556fd4[_0x1a99('0x5c')]},'options':{'algorithm':_0x1a99('0x79'),'subject':_0x556fd4['id'][_0x1a99('0x75')](),'issuer':hardwareConf[_0x1a99('0x44')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x3996b0)[_0x1a99('0x34')](function(_0x210dde){return{'iat':_0x556fd4['apiKeyIat'],'nonce':_0x556fd4[_0x1a99('0x5c')],'token':_0x210dde};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 9ab4f07..ffe46dc 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 _0x3354=['../../config/environment','../../config/logger','app','secrets','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createCipher','data','update','binary','final','write','end','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird'];(function(_0x232000,_0x1d1ab3){var _0x2cd783=function(_0x255dbc){while(--_0x255dbc){_0x232000['push'](_0x232000['shift']());}};_0x2cd783(++_0x1d1ab3);}(_0x3354,0x169));var _0x4335=function(_0x25ac32,_0x216a7d){_0x25ac32=_0x25ac32-0x0;var _0x34359c=_0x3354[_0x25ac32];return _0x34359c;};'use strict';var crypto=require(_0x4335('0x0'));var fs=require('fs');var BPromise=require(_0x4335('0x1'));var _=require('lodash');var config=require(_0x4335('0x2'));var logger=require(_0x4335('0x3'))(_0x4335('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4335('0x5')]['session'],'algorithm':_0x4335('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x4335('0x7')]&&config[_0x4335('0x7')][_0x4335('0x8')]){var isSupported=isAlgorithmSupported(config[_0x4335('0x7')][_0x4335('0x8')]);if(isSupported){fileOptions[_0x4335('0x8')]=config[_0x4335('0x7')][_0x4335('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x4335('0x9')](',\x20');logger['error'](config[_0x4335('0x7')][_0x4335('0x8')],_0x4335('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x2b1c90){return AES_SUPPORTED_RX[_0x4335('0xb')](_0x2b1c90);}function getSupportedCiphers(){return crypto[_0x4335('0xc')]()[_0x4335('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x548931){return getSupportedCiphers()[_0x4335('0xe')](_0x548931)>-0x1;}function combineOptions(_0x4614e9){var _0x4128eb={};for(var _0x216549 in fileOptions){if(fileOptions[_0x4335('0xf')](_0x216549)){_0x4128eb[_0x216549]=fileOptions[_0x216549];}}if(_0x4614e9){for(var _0x5656a2 in _0x4614e9){if(_0x4614e9['hasOwnProperty'](_0x5656a2)){_0x4128eb[_0x5656a2]=_0x4614e9[_0x5656a2];}}}return _0x4128eb;}exports['encryptFile']=function(_0x4537d8,_0x337cba,_0x16924f,_0x427125){return new BPromise(function(_0x3c648a,_0x43a3d0){_0x427125=combineOptions(_0x427125);var _0x1ac02d=new Buffer(_0x16924f);var _0x59d776=fs['createReadStream'](_0x4537d8);var _0x4ae2e4=fs['createWriteStream'](_0x337cba);var _0x21733e=crypto[_0x4335('0x10')](_0x427125[_0x4335('0x8')],_0x1ac02d);_0x59d776['on'](_0x4335('0x11'),function(_0x1795ba){var _0x17ee00=new Buffer(_0x21733e[_0x4335('0x12')](_0x1795ba),_0x4335('0x13'));_0x4ae2e4['write'](_0x17ee00);});_0x59d776['on']('end',function(){try{var _0x3a7d4e=new Buffer(_0x21733e[_0x4335('0x14')](_0x4335('0x13')),_0x4335('0x13'));_0x4ae2e4[_0x4335('0x15')](_0x3a7d4e);_0x4ae2e4[_0x4335('0x16')]();_0x4ae2e4['on'](_0x4335('0x17'),function(){return _0x3c648a(_0x337cba);});}catch(_0x1542fc){fs[_0x4335('0x18')](_0x337cba);return _0x43a3d0(_0x1542fc);}});});};exports[_0x4335('0x19')]=function(_0x4fb6ad,_0x2204ec,_0x840de4,_0x35a650){return new BPromise(function(_0x46759d,_0x4197d4){_0x35a650=combineOptions(_0x35a650);var _0x24b35b=new Buffer(_0x840de4);var _0x36829d=fs[_0x4335('0x1a')](_0x4fb6ad);var _0x5aaf89=fs['createWriteStream'](_0x2204ec);var _0x4efc12=crypto[_0x4335('0x1b')](_0x35a650['algorithm'],_0x24b35b);_0x36829d['on'](_0x4335('0x11'),function(_0x23787e){var _0x2c30d6=new Buffer(_0x4efc12[_0x4335('0x12')](_0x23787e),_0x4335('0x13'));_0x5aaf89[_0x4335('0x15')](_0x2c30d6);});_0x36829d['on'](_0x4335('0x16'),function(){try{var _0x53fb88=new Buffer(_0x4efc12['final'](_0x4335('0x13')),'binary');_0x5aaf89[_0x4335('0x15')](_0x53fb88);_0x5aaf89[_0x4335('0x16')]();_0x5aaf89['on'](_0x4335('0x17'),function(){return _0x46759d(_0x2204ec);});}catch(_0x20c096){fs[_0x4335('0x18')](_0x2204ec);return _0x4197d4(_0x20c096);}});});};exports[_0x4335('0x1c')]=function(_0x2307ef,_0x4824a5,_0x15c985){var _0x34dd45=_0x15c985||stringOptions['algorithm'];var _0x172b04=_0x4824a5||stringOptions[_0x4335('0x1d')];var _0xa75e87=crypto[_0x4335('0x10')](_0x34dd45,_0x172b04);var _0x3900e7=_0xa75e87['update'](_0x2307ef,_0x4335('0x1e'),_0x4335('0x1f'));_0x3900e7+=_0xa75e87[_0x4335('0x14')](_0x4335('0x1f'));return _0x3900e7;};exports[_0x4335('0x20')]=function(_0x4862c0,_0x74a2d7,_0x3a4a77){var _0x2132a3=_0x3a4a77||stringOptions['algorithm'];var _0x5c9f37=_0x74a2d7||stringOptions[_0x4335('0x1d')];var _0x424011=crypto[_0x4335('0x1b')](_0x2132a3,_0x5c9f37);var _0x45fc51=_0x424011['update'](_0x4862c0,_0x4335('0x1f'),_0x4335('0x1e'));_0x45fc51+=_0x424011['final'](_0x4335('0x1e'));return _0x45fc51;}; \ No newline at end of file +var _0x58fb=['binary','write','end','final','close','createDecipher','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update'];(function(_0x4d0967,_0x4cc1c8){var _0x4976ab=function(_0x97dd66){while(--_0x97dd66){_0x4d0967['push'](_0x4d0967['shift']());}};_0x4976ab(++_0x4cc1c8);}(_0x58fb,0x1ea));var _0xb58f=function(_0x438886,_0x1a5b68){_0x438886=_0x438886-0x0;var _0x4c6e0b=_0x58fb[_0x438886];return _0x4c6e0b;};'use strict';var crypto=require(_0xb58f('0x0'));var fs=require('fs');var BPromise=require(_0xb58f('0x1'));var _=require(_0xb58f('0x2'));var config=require(_0xb58f('0x3'));var logger=require(_0xb58f('0x4'))(_0xb58f('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xb58f('0x6')],'algorithm':_0xb58f('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0xb58f('0x8')]&&config[_0xb58f('0x8')][_0xb58f('0x9')]){var isSupported=isAlgorithmSupported(config[_0xb58f('0x8')][_0xb58f('0x9')]);if(isSupported){fileOptions[_0xb58f('0x9')]=config['encrypt'][_0xb58f('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb58f('0xa')](',\x20');logger[_0xb58f('0xb')](config[_0xb58f('0x8')][_0xb58f('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x56e605){return AES_SUPPORTED_RX[_0xb58f('0xc')](_0x56e605);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xb58f('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x42d1f8){return getSupportedCiphers()[_0xb58f('0xe')](_0x42d1f8)>-0x1;}function combineOptions(_0x347dca){var _0x267b77={};for(var _0x5d9d10 in fileOptions){if(fileOptions[_0xb58f('0xf')](_0x5d9d10)){_0x267b77[_0x5d9d10]=fileOptions[_0x5d9d10];}}if(_0x347dca){for(var _0x4883c9 in _0x347dca){if(_0x347dca['hasOwnProperty'](_0x4883c9)){_0x267b77[_0x4883c9]=_0x347dca[_0x4883c9];}}}return _0x267b77;}exports[_0xb58f('0x10')]=function(_0x1f2cdd,_0x5d6378,_0x4adb2f,_0x21eded){return new BPromise(function(_0x322300,_0x51d031){_0x21eded=combineOptions(_0x21eded);var _0x272d81=new Buffer(_0x4adb2f);var _0x152f61=fs[_0xb58f('0x11')](_0x1f2cdd);var _0x3a10ae=fs[_0xb58f('0x12')](_0x5d6378);var _0x4742f1=crypto[_0xb58f('0x13')](_0x21eded['algorithm'],_0x272d81);_0x152f61['on'](_0xb58f('0x14'),function(_0x39a30a){var _0x2e2c85=new Buffer(_0x4742f1[_0xb58f('0x15')](_0x39a30a),_0xb58f('0x16'));_0x3a10ae[_0xb58f('0x17')](_0x2e2c85);});_0x152f61['on'](_0xb58f('0x18'),function(){try{var _0x1faada=new Buffer(_0x4742f1[_0xb58f('0x19')]('binary'),'binary');_0x3a10ae[_0xb58f('0x17')](_0x1faada);_0x3a10ae[_0xb58f('0x18')]();_0x3a10ae['on'](_0xb58f('0x1a'),function(){return _0x322300(_0x5d6378);});}catch(_0xea46c1){fs['unlink'](_0x5d6378);return _0x51d031(_0xea46c1);}});});};exports['decryptFile']=function(_0x4b1c78,_0x4c639d,_0xdfebb,_0x4bda68){return new BPromise(function(_0x171ff1,_0x1379ab){_0x4bda68=combineOptions(_0x4bda68);var _0x498afd=new Buffer(_0xdfebb);var _0x52bead=fs[_0xb58f('0x11')](_0x4b1c78);var _0x2009ed=fs[_0xb58f('0x12')](_0x4c639d);var _0x3da9c9=crypto[_0xb58f('0x1b')](_0x4bda68[_0xb58f('0x9')],_0x498afd);_0x52bead['on']('data',function(_0x1a21d0){var _0x125ee1=new Buffer(_0x3da9c9['update'](_0x1a21d0),_0xb58f('0x16'));_0x2009ed[_0xb58f('0x17')](_0x125ee1);});_0x52bead['on'](_0xb58f('0x18'),function(){try{var _0x2d6fa0=new Buffer(_0x3da9c9[_0xb58f('0x19')](_0xb58f('0x16')),_0xb58f('0x16'));_0x2009ed[_0xb58f('0x17')](_0x2d6fa0);_0x2009ed[_0xb58f('0x18')]();_0x2009ed['on'](_0xb58f('0x1a'),function(){return _0x171ff1(_0x4c639d);});}catch(_0xf34a0e){fs['unlink'](_0x4c639d);return _0x1379ab(_0xf34a0e);}});});};exports['encryptString']=function(_0x262c7b,_0xdaffc2,_0x25b72c){var _0x3a12fb=_0x25b72c||stringOptions['algorithm'];var _0x1d8d72=_0xdaffc2||stringOptions[_0xb58f('0x1c')];var _0x191fa9=crypto[_0xb58f('0x13')](_0x3a12fb,_0x1d8d72);var _0x5e484e=_0x191fa9[_0xb58f('0x15')](_0x262c7b,'utf8',_0xb58f('0x1d'));_0x5e484e+=_0x191fa9['final'](_0xb58f('0x1d'));return _0x5e484e;};exports[_0xb58f('0x1e')]=function(_0xf541c7,_0x88165a,_0x352d3a){var _0x1257cc=_0x352d3a||stringOptions[_0xb58f('0x9')];var _0x305461=_0x88165a||stringOptions[_0xb58f('0x1c')];var _0x26e759=crypto['createDecipher'](_0x1257cc,_0x305461);var _0x39cc69=_0x26e759['update'](_0xf541c7,_0xb58f('0x1d'),_0xb58f('0x1f'));_0x39cc69+=_0x26e759[_0xb58f('0x19')](_0xb58f('0x1f'));return _0x39cc69;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index ef56f51..7db624d 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 _0x9f4d=['../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','length','existsSync','join','mkdirSync','%s%d.%s','csv','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','%s.%s','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x4ca88b,_0x207e14){var _0x393ad2=function(_0x4248b3){while(--_0x4248b3){_0x4ca88b['push'](_0x4ca88b['shift']());}};_0x393ad2(++_0x207e14);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0x9f4d[_0x17b287];return _0x177054;};'use strict';var util=require(_0xd9f4('0x0'));var path=require(_0xd9f4('0x1'));var _=require(_0xd9f4('0x2'));var csv=require(_0xd9f4('0x3'));var fs=require('fs');var BPromise=require(_0xd9f4('0x4'));var zipdir=require(_0xd9f4('0x5'));var rimraf=require(_0xd9f4('0x6'));var db=require(_0xd9f4('0x7'))['db'];var dbH=require(_0xd9f4('0x7'))['dbH'];var logger=require(_0xd9f4('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd9f4('0x9')][0x2]);var QUERY=process[_0xd9f4('0x9')][0x3];var PATH=process[_0xd9f4('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x366b9d,_0x5cf448){var _0x6b13b5={'status':_0x366b9d};var _0x18305f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5cf448){_0x6b13b5['savename']=_0x5cf448;}return db[_0xd9f4('0xa')]['update'](_0x6b13b5,_0x18305f);}function main(){var _0x16cacf=0x1388;var _0x41709a;logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xd9f4('0xe')][_0xd9f4('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd9f4('0x10'),_0xd9f4('0x11')]})[_0xd9f4('0x12')](function(_0x104834){if(_0x104834){_0x41709a=_0x104834;_0x16cacf=_0x41709a[_0xd9f4('0x11')]||0x1388;}})[_0xd9f4('0x12')](function(){return dbH['sequelize'][_0xd9f4('0x13')](util[_0xd9f4('0xc')](_0xd9f4('0x14'),QUERY),{'type':dbH[_0xd9f4('0x15')][_0xd9f4('0x16')][_0xd9f4('0x17')]});})[_0xd9f4('0x12')](function(_0x12dcfb){if(!_0x12dcfb[0x0][_0xd9f4('0x18')]){return analyticExtractedReport(_0xd9f4('0x19'));}var _0xfd15a4=[];var _0x14c78e=0x0;var _0x33ca2f=!![];if(_0x12dcfb&&_0x12dcfb['length']){var _0x4dc76f=_0x12dcfb[0x0]['num']%(_0x14c78e+_0x16cacf);if(_0x41709a['split']){for(;_0x33ca2f;_0x14c78e+=_0x16cacf,_0x4dc76f=_0x12dcfb[0x0][_0xd9f4('0x18')]%(_0x14c78e+_0x16cacf)){if(_0x4dc76f==0x0||_0x4dc76f==_0x12dcfb[0x0][_0xd9f4('0x18')]){_0x33ca2f=![];}_0xfd15a4[_0xd9f4('0x1a')](dbH['sequelize'][_0xd9f4('0x13')](util[_0xd9f4('0xc')](_0xd9f4('0x1b'),QUERY,_0x16cacf,_0x14c78e),{'type':dbH['sequelize'][_0xd9f4('0x16')]['SELECT']}));}}else{_0xfd15a4[_0xd9f4('0x1a')](dbH[_0xd9f4('0x15')][_0xd9f4('0x13')](QUERY,{'type':dbH['sequelize'][_0xd9f4('0x16')][_0xd9f4('0x17')]}));}}var _0x5c2ea8=path['dirname'](PATH);var _0x7196ab=path['basename'](PATH,_0xd9f4('0x1c'));var _0x39df81=_0x41709a[_0xd9f4('0x10')]&&_0xfd15a4[_0xd9f4('0x1d')]>0x1;var _0x101e86=[];if(!fs[_0xd9f4('0x1e')](path[_0xd9f4('0x1f')](_0x5c2ea8,_0x7196ab))&&_0x39df81){fs[_0xd9f4('0x20')](path[_0xd9f4('0x1f')](_0x5c2ea8,_0x7196ab));}return BPromise['each'](_0xfd15a4,function(_0x770a2c){_0x101e86[_0xd9f4('0x1a')](_0x770a2c);})[_0xd9f4('0x12')](function(){for(var _0x3ee51c=0x0;_0x3ee51c<_0x101e86[_0xd9f4('0x1d')];_0x3ee51c+=0x1){var _0x2ed32c;var _0x12958b=_0x101e86[_0x3ee51c];if(_0x39df81){_0x2ed32c=path['join'](_0x5c2ea8,_0x7196ab,util[_0xd9f4('0xc')](_0xd9f4('0x21'),_0x7196ab,_0x3ee51c,_0xd9f4('0x22')));}else{_0x2ed32c=path[_0xd9f4('0x1f')](_0x5c2ea8,util['format']('%s.%s',_0x7196ab,'csv'));}fs[_0xd9f4('0x23')](_0x2ed32c,csv(_0x12958b));}})['then'](function(){if(_0x39df81){zipdir(path[_0xd9f4('0x1f')](_0x5c2ea8,_0x7196ab),{'saveTo':path[_0xd9f4('0x1f')](_0x5c2ea8,util['format']('%s.%s',_0x7196ab,_0xd9f4('0x24')))},function(_0x30e009,_0x5f6cb9){});rimraf(path[_0xd9f4('0x1f')](_0x5c2ea8,_0x7196ab),function(){});}})[_0xd9f4('0x12')](function(){logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0x25'),EXTRACTED_REPORT_ID,_0xd9f4('0x26')));return analyticExtractedReport(_0xd9f4('0x27'),_0x39df81?util[_0xd9f4('0xc')](_0xd9f4('0x28'),_0x7196ab,_0x39df81?'zip':_0xd9f4('0x22')):null);});})['catch'](function(_0x1eeae3){logger[_0xd9f4('0xb')](util[_0xd9f4('0xc')](_0xd9f4('0x29'),EXTRACTED_REPORT_ID,_0xd9f4('0x26')),util[_0xd9f4('0x2a')](_0x1eeae3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd9f4('0x2b'));})[_0xd9f4('0x2c')](function(){process[_0xd9f4('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcffe=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','existsSync','mkdirSync','join','%s%d.%s','csv','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','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format'];(function(_0x652707,_0x429d9f){var _0x52772b=function(_0x71ec0e){while(--_0x71ec0e){_0x652707['push'](_0x652707['shift']());}};_0x52772b(++_0x429d9f);}(_0xcffe,0x1a1));var _0xecff=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0xcffe[_0x9d14e3];return _0x19bf32;};'use strict';var util=require(_0xecff('0x0'));var path=require(_0xecff('0x1'));var _=require(_0xecff('0x2'));var csv=require(_0xecff('0x3'));var fs=require('fs');var BPromise=require(_0xecff('0x4'));var zipdir=require(_0xecff('0x5'));var rimraf=require(_0xecff('0x6'));var db=require(_0xecff('0x7'))['db'];var dbH=require(_0xecff('0x7'))[_0xecff('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xecff('0x9')][0x2]);var QUERY=process[_0xecff('0x9')][0x3];var PATH=process[_0xecff('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x38a8f6,_0x50c98b){var _0x298c19={'status':_0x38a8f6};var _0x1f7386={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50c98b){_0x298c19['savename']=_0x50c98b;}return db[_0xecff('0xa')][_0xecff('0xb')](_0x298c19,_0x1f7386);}function main(){var _0x195b15=0x1388;var _0x20ab4f;logger[_0xecff('0xc')](util['format'](_0xecff('0xd'),EXTRACTED_REPORT_ID,_0xecff('0xe')));return db[_0xecff('0xf')][_0xecff('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xecff('0x11'),_0xecff('0x12')]})[_0xecff('0x13')](function(_0x32627c){if(_0x32627c){_0x20ab4f=_0x32627c;_0x195b15=_0x20ab4f[_0xecff('0x12')]||0x1388;}})[_0xecff('0x13')](function(){return dbH[_0xecff('0x14')][_0xecff('0x15')](util[_0xecff('0x16')](_0xecff('0x17'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xecff('0x18')]});})[_0xecff('0x13')](function(_0x558ecd){if(!_0x558ecd[0x0][_0xecff('0x19')]){return analyticExtractedReport(_0xecff('0x1a'));}var _0x3a7623=[];var _0x596b09=0x0;var _0x52b62f=!![];if(_0x558ecd&&_0x558ecd[_0xecff('0x1b')]){var _0xa5816b=_0x558ecd[0x0]['num']%(_0x596b09+_0x195b15);if(_0x20ab4f[_0xecff('0x11')]){for(;_0x52b62f;_0x596b09+=_0x195b15,_0xa5816b=_0x558ecd[0x0][_0xecff('0x19')]%(_0x596b09+_0x195b15)){if(_0xa5816b==0x0||_0xa5816b==_0x558ecd[0x0][_0xecff('0x19')]){_0x52b62f=![];}_0x3a7623[_0xecff('0x1c')](dbH[_0xecff('0x14')][_0xecff('0x15')](util['format'](_0xecff('0x1d'),QUERY,_0x195b15,_0x596b09),{'type':dbH[_0xecff('0x14')][_0xecff('0x1e')][_0xecff('0x18')]}));}}else{_0x3a7623['push'](dbH[_0xecff('0x14')][_0xecff('0x15')](QUERY,{'type':dbH[_0xecff('0x14')][_0xecff('0x1e')][_0xecff('0x18')]}));}}var _0x2402e0=path['dirname'](PATH);var _0x14378d=path['basename'](PATH,'.csv');var _0x2d16f1=_0x20ab4f['split']&&_0x3a7623[_0xecff('0x1b')]>0x1;var _0x49c0cd=[];if(!fs[_0xecff('0x1f')](path['join'](_0x2402e0,_0x14378d))&&_0x2d16f1){fs[_0xecff('0x20')](path[_0xecff('0x21')](_0x2402e0,_0x14378d));}return BPromise['each'](_0x3a7623,function(_0x9f173d){_0x49c0cd[_0xecff('0x1c')](_0x9f173d);})[_0xecff('0x13')](function(){for(var _0x3cadb9=0x0;_0x3cadb9<_0x49c0cd[_0xecff('0x1b')];_0x3cadb9+=0x1){var _0x493465;var _0x4f987b=_0x49c0cd[_0x3cadb9];if(_0x2d16f1){_0x493465=path[_0xecff('0x21')](_0x2402e0,_0x14378d,util['format'](_0xecff('0x22'),_0x14378d,_0x3cadb9,_0xecff('0x23')));}else{_0x493465=path[_0xecff('0x21')](_0x2402e0,util[_0xecff('0x16')]('%s.%s',_0x14378d,'csv'));}fs['writeFileSync'](_0x493465,csv(_0x4f987b));}})[_0xecff('0x13')](function(){if(_0x2d16f1){zipdir(path[_0xecff('0x21')](_0x2402e0,_0x14378d),{'saveTo':path[_0xecff('0x21')](_0x2402e0,util[_0xecff('0x16')]('%s.%s',_0x14378d,_0xecff('0x24')))},function(_0x46372c,_0x1926a5){});rimraf(path['join'](_0x2402e0,_0x14378d),function(){});}})[_0xecff('0x13')](function(){logger[_0xecff('0xc')](util[_0xecff('0x16')](_0xecff('0x25'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xecff('0x26'),_0x2d16f1?util[_0xecff('0x16')]('%s.%s',_0x14378d,_0x2d16f1?_0xecff('0x24'):_0xecff('0x23')):null);});})[_0xecff('0x27')](function(_0x1ca0f3){logger['info'](util[_0xecff('0x16')](_0xecff('0x28'),EXTRACTED_REPORT_ID,_0xecff('0xe')),util['inspect'](_0x1ca0f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xecff('0x29'));})[_0xecff('0x2a')](function(){process[_0xecff('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index fa0defd..93c89f6 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 _0xf050=['join','pdf','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','existsSync','all','flatten','createPdfKitDocument','%s%d.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','%s.%s','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','catch','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','end','lodash','path','moment','html-to-pdfmake','rimraf','jsdom','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','tableHeader','map','pick','toString','value','fill','auto','body','push','concat','chunk','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','format','endDate','length','header','before','\x20/\x20','footer','Arial','black','right','num','Empty','dirname','basename','.pdf'];(function(_0x31218c,_0x28ae34){var _0x13e4ab=function(_0x3e0521){while(--_0x3e0521){_0x31218c['push'](_0x31218c['shift']());}};_0x13e4ab(++_0x28ae34);}(_0xf050,0x1b9));var _0x0f05=function(_0x3e0e6c,_0x4757cd){_0x3e0e6c=_0x3e0e6c-0x0;var _0xad2be9=_0xf050[_0x3e0e6c];return _0xad2be9;};'use strict';var _=require(_0x0f05('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x0f05('0x1'));var moment=require(_0x0f05('0x2'));var htmlToPdfmake=require(_0x0f05('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x0f05('0x4'));var JSDOM=require(_0x0f05('0x5'))['JSDOM'];var window=new JSDOM('')[_0x0f05('0x6')];var db=require(_0x0f05('0x7'))['db'];var dbH=require(_0x0f05('0x7'))[_0x0f05('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x0f05('0x9')][0x2]);var QUERY=process[_0x0f05('0x9')][0x3];var PATH=process[_0x0f05('0x9')][0x4];var NAME=process[_0x0f05('0x9')][0x5];var FORMAT=_0x0f05('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x39ccec,_0x56a75d){var _0x310176={'status':_0x39ccec};var _0x21483f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56a75d){_0x310176[_0x0f05('0xb')]=_0x56a75d;}return db['AnalyticExtractedReport']['update'](_0x310176,_0x21483f);}function getHeaders(_0x19d337){return _['map'](_0x19d337,function(_0x169efb){return{'text':_0x169efb,'style':_0x0f05('0xc')};});}function getRows(_0x1edbe5,_0x25f149){return _[_0x0f05('0xd')](_0x25f149,function(_0x2f9702){return _(_0x2f9702)[_0x0f05('0xe')](_0x1edbe5)[_0x0f05('0xd')](function(_0x2f7a99){return _0x2f7a99?_[_0x0f05('0xf')](_0x2f7a99):'';})[_0x0f05('0x10')]();});}function createTable(_0x1401ee,_0x3caf98){var _0x50ef11={'widths':_[_0x0f05('0x11')](Array(_0x1401ee['length']),0x91),'heights':function(_0x27e43b){return _0x27e43b===0x0?_0x0f05('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x358c85=getHeaders(_0x1401ee);_0x50ef11[_0x0f05('0x13')][_0x0f05('0x14')](_0x358c85);var _0x591d5c=getRows(_0x1401ee,_0x3caf98);_0x50ef11[_0x0f05('0x13')]=_0x50ef11[_0x0f05('0x13')][_0x0f05('0x15')](_0x591d5c);return _0x50ef11;}function createTables(_0x40a6a6){var _0x21b8b0=[];var _0x1d36d1=_[_0x0f05('0x16')](Object['keys'](_0x40a6a6[0x0]),0x5);_0x1d36d1['forEach'](function(_0xa5bf2f){_0x21b8b0['push'](createTable(_0xa5bf2f,_0x40a6a6));});return _0x21b8b0;}function getPDFDocDefinition(_0x5862ba){var _0x38bdb5=util['format'](_0x0f05('0x17'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x0f05('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x0f05('0x19')])['format'](FORMAT));var _0x3338d=[];for(var _0x4a4998=0x0;_0x4a4998<_0x5862ba[_0x0f05('0x1a')];_0x4a4998++){var _0xbf9991=[];if(_0x4a4998===0x0){_0xbf9991[_0x0f05('0x14')]({'text':_0x38bdb5,'style':_0x0f05('0x1b')});}var _0x4301f3={'table':_0x5862ba[_0x4a4998]};if(_0x4a4998>0x0){_0x4301f3['pageBreak']=_0x0f05('0x1c');_0x4301f3['margin']=[0x0,0x46,0x0,0x0];}_0xbf9991[_0x0f05('0x14')](_0x4301f3);_0x3338d[_0x0f05('0x14')](_0xbf9991);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3338d,'footer':function(_0x44041a,_0x24b285){return{'text':_0x44041a['toString']()+_0x0f05('0x1d')+_0x24b285,'style':_0x0f05('0x1e')};},'defaultStyle':{'font':_0x0f05('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0f05('0x20')},'footer':{'alignment':_0x0f05('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1d6234){var _0x13096c=0x1388;var _0x87084a;if(!_0x1d6234[0x0][_0x0f05('0x22')]){return analyticExtractedReport(_0x0f05('0x23'));}var _0x5c3dca=[];var _0x1431b2=0x0;var _0x28ebf8=!![];var _0x44dcf4=path[_0x0f05('0x24')](PATH);var _0x3e582d=path[_0x0f05('0x25')](PATH,_0x0f05('0x26'));var _0x455076=path[_0x0f05('0x27')](_0x44dcf4,util[_0x0f05('0x18')]('%s.%s',_0x3e582d,_0x0f05('0x28')));var _0x566ae6=![];return db[_0x0f05('0x29')][_0x0f05('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0f05('0x2b'),_0x0f05('0x2c')]})['then'](function(_0x23bcb8){if(_0x23bcb8){_0x87084a=_0x23bcb8;_0x13096c=_0x87084a[_0x0f05('0x2c')]||0x3e8;}})[_0x0f05('0x2d')](function(){if(_0x1d6234&&_0x1d6234[_0x0f05('0x1a')]){var _0x274579=_0x1d6234[0x0][_0x0f05('0x22')]%(_0x1431b2+_0x13096c);if(_0x87084a[_0x0f05('0x2b')]){for(;_0x28ebf8;_0x1431b2+=_0x13096c,_0x274579=_0x1d6234[0x0][_0x0f05('0x22')]%(_0x1431b2+_0x13096c)){if(_0x274579==0x0||_0x274579==_0x1d6234[0x0][_0x0f05('0x22')]){_0x28ebf8=![];}_0x5c3dca['push'](dbH[_0x0f05('0x2e')][_0x0f05('0x2f')](util[_0x0f05('0x18')](_0x0f05('0x30'),QUERY,_0x13096c,_0x1431b2),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}else{_0x5c3dca[_0x0f05('0x14')](dbH[_0x0f05('0x2e')][_0x0f05('0x2f')](QUERY,{'type':dbH[_0x0f05('0x2e')][_0x0f05('0x31')]['SELECT']}));}}_0x566ae6=_0x87084a[_0x0f05('0x2b')]&&_0x5c3dca['length']>0x1;if(!fs[_0x0f05('0x32')](path[_0x0f05('0x27')](_0x44dcf4,_0x3e582d))&&_0x566ae6){fs['mkdirSync'](path['join'](_0x44dcf4,_0x3e582d));}return Promise[_0x0f05('0x33')](_0x5c3dca);})[_0x0f05('0x2d')](function(_0x28172d){return createTables(_[_0x0f05('0x34')](_0x28172d));})['then'](function(_0x15d76f){var _0x476c8e=getPDFDocDefinition(_0x15d76f);var _0x35f455=getPDFPrinter();var _0x239a73=_0x35f455[_0x0f05('0x35')](_0x476c8e);if(_0x566ae6)_0x455076=path[_0x0f05('0x27')](_0x44dcf4,_0x3e582d,util[_0x0f05('0x18')](_0x0f05('0x36'),_0x3e582d,index,_0x0f05('0x28')));return writePDFDocument(_0x239a73,_0x455076);})[_0x0f05('0x2d')](function(){if(!_0x566ae6)return;zipdir(path[_0x0f05('0x27')](_0x44dcf4,_0x3e582d),{'saveTo':path[_0x0f05('0x27')](_0x44dcf4,util[_0x0f05('0x18')]('%s.%s',_0x3e582d,'zip'))},function(_0xf7733b){if(_0xf7733b)throw _0xf7733b;return;});})[_0x0f05('0x2d')](function(){if(!_0x566ae6)return;rimraf(path[_0x0f05('0x27')](_0x44dcf4,_0x3e582d),function(){});})[_0x0f05('0x2d')](function(){logger[_0x0f05('0x37')](util['format'](_0x0f05('0x38'),EXTRACTED_REPORT_ID,_0x0f05('0x39')));return analyticExtractedReport(_0x0f05('0x3a'),_0x566ae6?util[_0x0f05('0x18')](_0x0f05('0x3b'),_0x3e582d,_0x566ae6?'zip':'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0f05('0x37')](util[_0x0f05('0x18')](_0x0f05('0x3c'),EXTRACTED_REPORT_ID,_0x0f05('0x3d')));return db['AnalyticExtractedReport'][_0x0f05('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0f05('0x2d')](function(_0x419e96){EXTRACTED_REPORT=_0x419e96;return dbH[_0x0f05('0x2e')][_0x0f05('0x2f')](util[_0x0f05('0x18')](_0x0f05('0x3f'),QUERY),{'type':dbH[_0x0f05('0x2e')]['QueryTypes'][_0x0f05('0x40')]});})[_0x0f05('0x2d')](extractReport)[_0x0f05('0x41')](function(_0x45e30a){logger[_0x0f05('0x37')](util[_0x0f05('0x18')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0f05('0x3d')),util[_0x0f05('0x42')](_0x45e30a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0f05('0x43'));})[_0x0f05('0x44')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x279f2a=new PdfPrinter({'Arial':{'normal':__dirname+_0x0f05('0x45'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x0f05('0x46'),'bolditalics':__dirname+_0x0f05('0x47')}});return _0x279f2a;}function getPDFDocDefinitionFromHTML(_0xafdc6a,_0x90e06f){var _0x250b16=util['format'](_0x0f05('0x48'),_0x90e06f[_0x0f05('0x49')],_0x90e06f['interactionId']);var _0x23c61d=moment()[_0x0f05('0x18')](_0x0f05('0x4a'))[_0x0f05('0xf')]();var _0x29c9b7=htmlToPdfmake(_0xafdc6a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x29c9b7],'defaultStyle':{'font':_0x0f05('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0f05('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0f05('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0f05('0x4b')}},'header':function(){return[{'text':_0x0f05('0x4c'),'style':_0x0f05('0x1b')}];},'footer':function(_0x251d7c,_0x192476){return[{'text':util[_0x0f05('0x18')](_0x0f05('0x4d'),_0x250b16,_0x251d7c,_0x192476,_0x23c61d),'style':_0x0f05('0x1e')}];}};}function writePDFDocument(_0x2444bb,_0x3a3ca4){return new Promise(function(_0x55aa77,_0x167dee){var _0x4e4416=_0x2444bb['pipe'](fs['createWriteStream'](_0x3a3ca4));_0x4e4416['on']('finish',function(){_0x55aa77(_0x0f05('0x4e'));});_0x4e4416['on']('error',function(_0x4aaa5c){_0x167dee(_0x4aaa5c);});_0x2444bb[_0x0f05('0x4f')]();});}exports['createPdfFromHTML']=function(_0x3c4286,_0x3c2394){var _0x54ff7e=getPDFPrinter();var _0x209ada=getPDFDocDefinitionFromHTML(_0x3c4286,_0x3c2394);var _0x5b9e87=_0x54ff7e[_0x0f05('0x35')](_0x209ada);return writePDFDocument(_0x5b9e87,_0x3c2394[_0x0f05('0x1')])[_0x0f05('0x41')](function(_0x3248cd){throw _0x3248cd;});}; \ No newline at end of file +var _0x8c49=['interactionId','YYYY-MM-DD','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','length','chunk','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','Empty','dirname','basename','join','%s.%s','pdf','Setting','find','split','splitSizePdf','then','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel'];(function(_0x4e2750,_0x49b318){var _0x3c445d=function(_0xd58b1d){while(--_0xd58b1d){_0x4e2750['push'](_0x4e2750['shift']());}};_0x3c445d(++_0x49b318);}(_0x8c49,0xb2));var _0x98c4=function(_0x1889e8,_0x30b3df){_0x1889e8=_0x1889e8-0x0;var _0x3a8bac=_0x8c49[_0x1889e8];return _0x3a8bac;};'use strict';var _=require(_0x98c4('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x98c4('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x98c4('0x2'));var PdfPrinter=require(_0x98c4('0x3'));var zipdir=require(_0x98c4('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x98c4('0x5'))[_0x98c4('0x6')];var window=new JSDOM('')['window'];var db=require(_0x98c4('0x7'))['db'];var dbH=require(_0x98c4('0x7'))[_0x98c4('0x8')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x98c4('0x9')][0x3];var PATH=process[_0x98c4('0x9')][0x4];var NAME=process[_0x98c4('0x9')][0x5];var FORMAT=_0x98c4('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x21b67d,_0x24f36c){var _0xc458bc={'status':_0x21b67d};var _0x3750a8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x24f36c){_0xc458bc[_0x98c4('0xb')]=_0x24f36c;}return db[_0x98c4('0xc')]['update'](_0xc458bc,_0x3750a8);}function getHeaders(_0xb9222a){return _[_0x98c4('0xd')](_0xb9222a,function(_0xb0aff6){return{'text':_0xb0aff6,'style':_0x98c4('0xe')};});}function getRows(_0x3a39cb,_0xe60930){return _[_0x98c4('0xd')](_0xe60930,function(_0x3e2827){return _(_0x3e2827)[_0x98c4('0xf')](_0x3a39cb)['map'](function(_0x24bb02){return _0x24bb02?_[_0x98c4('0x10')](_0x24bb02):'';})[_0x98c4('0x11')]();});}function createTable(_0x18e4ac,_0x465210){var _0x1b1db7={'widths':_['fill'](Array(_0x18e4ac[_0x98c4('0x12')]),0x91),'heights':function(_0x417dce){return _0x417dce===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x24bd4b=getHeaders(_0x18e4ac);_0x1b1db7['body']['push'](_0x24bd4b);var _0xdb0ccb=getRows(_0x18e4ac,_0x465210);_0x1b1db7['body']=_0x1b1db7['body']['concat'](_0xdb0ccb);return _0x1b1db7;}function createTables(_0x4088ae){var _0x15dbc4=[];var _0x2817e6=_[_0x98c4('0x13')](Object[_0x98c4('0x14')](_0x4088ae[0x0]),0x5);_0x2817e6[_0x98c4('0x15')](function(_0x59c81e){_0x15dbc4[_0x98c4('0x16')](createTable(_0x59c81e,_0x4088ae));});return _0x15dbc4;}function getPDFDocDefinition(_0x207043){var _0x447691=util['format'](_0x98c4('0x17'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x98c4('0x18')])[_0x98c4('0x19')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x98c4('0x19')](FORMAT));var _0x30f32b=[];for(var _0x594bd1=0x0;_0x594bd1<_0x207043['length'];_0x594bd1++){var _0x2bdca8=[];if(_0x594bd1===0x0){_0x2bdca8[_0x98c4('0x16')]({'text':_0x447691,'style':'header'});}var _0x1a5154={'table':_0x207043[_0x594bd1]};if(_0x594bd1>0x0){_0x1a5154[_0x98c4('0x1a')]=_0x98c4('0x1b');_0x1a5154[_0x98c4('0x1c')]=[0x0,0x46,0x0,0x0];}_0x2bdca8['push'](_0x1a5154);_0x30f32b[_0x98c4('0x16')](_0x2bdca8);}return{'pageSize':'A4','pageOrientation':_0x98c4('0x1d'),'content':_0x30f32b,'footer':function(_0x490804,_0x3fd5c7){return{'text':_0x490804[_0x98c4('0x10')]()+_0x98c4('0x1e')+_0x3fd5c7,'style':'footer'};},'defaultStyle':{'font':_0x98c4('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x98c4('0x20')},'footer':{'alignment':_0x98c4('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x206c83){var _0x210579=0x1388;var _0xea4d0a;if(!_0x206c83[0x0]['num']){return analyticExtractedReport(_0x98c4('0x22'));}var _0x3e8d1c=[];var _0x1bf9ac=0x0;var _0x479b5d=!![];var _0x538fc7=path[_0x98c4('0x23')](PATH);var _0x22c814=path[_0x98c4('0x24')](PATH,'.pdf');var _0x5d2de5=path[_0x98c4('0x25')](_0x538fc7,util[_0x98c4('0x19')](_0x98c4('0x26'),_0x22c814,_0x98c4('0x27')));var _0x32020d=![];return db[_0x98c4('0x28')][_0x98c4('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x98c4('0x2a'),_0x98c4('0x2b')]})[_0x98c4('0x2c')](function(_0x343ab4){if(_0x343ab4){_0xea4d0a=_0x343ab4;_0x210579=_0xea4d0a['splitSizePdf']||0x3e8;}})['then'](function(){if(_0x206c83&&_0x206c83[_0x98c4('0x12')]){var _0x1949db=_0x206c83[0x0]['num']%(_0x1bf9ac+_0x210579);if(_0xea4d0a[_0x98c4('0x2a')]){for(;_0x479b5d;_0x1bf9ac+=_0x210579,_0x1949db=_0x206c83[0x0][_0x98c4('0x2d')]%(_0x1bf9ac+_0x210579)){if(_0x1949db==0x0||_0x1949db==_0x206c83[0x0][_0x98c4('0x2d')]){_0x479b5d=![];}_0x3e8d1c[_0x98c4('0x16')](dbH[_0x98c4('0x2e')][_0x98c4('0x2f')](util['format'](_0x98c4('0x30'),QUERY,_0x210579,_0x1bf9ac),{'type':dbH[_0x98c4('0x2e')][_0x98c4('0x31')]['SELECT']}));}}else{_0x3e8d1c[_0x98c4('0x16')](dbH['sequelize'][_0x98c4('0x2f')](QUERY,{'type':dbH[_0x98c4('0x2e')][_0x98c4('0x31')][_0x98c4('0x32')]}));}}_0x32020d=_0xea4d0a['split']&&_0x3e8d1c[_0x98c4('0x12')]>0x1;if(!fs['existsSync'](path[_0x98c4('0x25')](_0x538fc7,_0x22c814))&&_0x32020d){fs[_0x98c4('0x33')](path[_0x98c4('0x25')](_0x538fc7,_0x22c814));}return Promise[_0x98c4('0x34')](_0x3e8d1c);})['then'](function(_0x57ab69){return createTables(_[_0x98c4('0x35')](_0x57ab69));})[_0x98c4('0x2c')](function(_0xe1e80f){var _0x433d24=getPDFDocDefinition(_0xe1e80f);var _0x1e7823=getPDFPrinter();var _0x47ecda=_0x1e7823[_0x98c4('0x36')](_0x433d24);if(_0x32020d)_0x5d2de5=path[_0x98c4('0x25')](_0x538fc7,_0x22c814,util[_0x98c4('0x19')](_0x98c4('0x37'),_0x22c814,index,_0x98c4('0x27')));return writePDFDocument(_0x47ecda,_0x5d2de5);})[_0x98c4('0x2c')](function(){if(!_0x32020d)return;zipdir(path[_0x98c4('0x25')](_0x538fc7,_0x22c814),{'saveTo':path[_0x98c4('0x25')](_0x538fc7,util[_0x98c4('0x19')](_0x98c4('0x26'),_0x22c814,_0x98c4('0x38')))},function(_0x365fec){if(_0x365fec)throw _0x365fec;return;});})[_0x98c4('0x2c')](function(){if(!_0x32020d)return;rimraf(path[_0x98c4('0x25')](_0x538fc7,_0x22c814),function(){});})[_0x98c4('0x2c')](function(){logger[_0x98c4('0x39')](util['format'](_0x98c4('0x3a'),EXTRACTED_REPORT_ID,_0x98c4('0x3b')));return analyticExtractedReport(_0x98c4('0x3c'),_0x32020d?util[_0x98c4('0x19')]('%s.%s',_0x22c814,_0x32020d?_0x98c4('0x38'):_0x98c4('0x27')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x98c4('0x39')](util[_0x98c4('0x19')](_0x98c4('0x3d'),EXTRACTED_REPORT_ID,_0x98c4('0x3e')));return db[_0x98c4('0xc')][_0x98c4('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x98c4('0x2c')](function(_0x33cd9b){EXTRACTED_REPORT=_0x33cd9b;return dbH[_0x98c4('0x2e')][_0x98c4('0x2f')](util[_0x98c4('0x19')](_0x98c4('0x40'),QUERY),{'type':dbH[_0x98c4('0x2e')][_0x98c4('0x31')][_0x98c4('0x32')]});})[_0x98c4('0x2c')](extractReport)[_0x98c4('0x41')](function(_0x2e2c53){logger[_0x98c4('0x39')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x98c4('0x3e')),util['inspect'](_0x2e2c53,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x98c4('0x42'));})['finally'](function(){process[_0x98c4('0x43')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1c72e7=new PdfPrinter({'Arial':{'normal':__dirname+_0x98c4('0x44'),'bold':__dirname+_0x98c4('0x45'),'italics':__dirname+_0x98c4('0x46'),'bolditalics':__dirname+_0x98c4('0x47')}});return _0x1c72e7;}function getPDFDocDefinitionFromHTML(_0x326640,_0x431edd){var _0x588c10=util[_0x98c4('0x19')](_0x98c4('0x48'),_0x431edd[_0x98c4('0x49')],_0x431edd[_0x98c4('0x4a')]);var _0x42e00d=moment()['format'](_0x98c4('0x4b'))[_0x98c4('0x10')]();var _0x3425af=htmlToPdfmake(_0x326640,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3425af],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x98c4('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x98c4('0x4c')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x98c4('0x4d')}];},'footer':function(_0x98b4c8,_0xffabae){return[{'text':util['format'](_0x98c4('0x4e'),_0x588c10,_0x98b4c8,_0xffabae,_0x42e00d),'style':_0x98c4('0x4f')}];}};}function writePDFDocument(_0x198316,_0x163bdf){return new Promise(function(_0x3fabfc,_0x1a19f8){var _0x579ca7=_0x198316['pipe'](fs['createWriteStream'](_0x163bdf));_0x579ca7['on'](_0x98c4('0x50'),function(){_0x3fabfc(_0x98c4('0x50'));});_0x579ca7['on'](_0x98c4('0x51'),function(_0x3ae4e6){_0x1a19f8(_0x3ae4e6);});_0x198316[_0x98c4('0x52')]();});}exports[_0x98c4('0x53')]=function(_0x304b41,_0x1f5a3f){var _0x53b55b=getPDFPrinter();var _0x50eefb=getPDFDocDefinitionFromHTML(_0x304b41,_0x1f5a3f);var _0x4dd65d=_0x53b55b[_0x98c4('0x36')](_0x50eefb);return writePDFDocument(_0x4dd65d,_0x1f5a3f[_0x98c4('0x1')])[_0x98c4('0x41')](function(_0x23813c){throw _0x23813c;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2fb8389..55e3a95 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 _0x788b=['QueryTypes','dirname','basename','existsSync','join','each','format','xlsx','%s.%s','binary','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','Failed','finally','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push'];(function(_0x259d17,_0x220710){var _0x407535=function(_0x49bc38){while(--_0x49bc38){_0x259d17['push'](_0x259d17['shift']());}};_0x407535(++_0x220710);}(_0x788b,0x179));var _0xb788=function(_0x4f9612,_0x51583a){_0x4f9612=_0x4f9612-0x0;var _0x2788cc=_0x788b[_0x4f9612];return _0x2788cc;};'use strict';var util=require('util');var path=require(_0xb788('0x0'));var _=require(_0xb788('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xb788('0x2'));var zipdir=require(_0xb788('0x3'));var rimraf=require(_0xb788('0x4'));var db=require(_0xb788('0x5'))['db'];var dbH=require(_0xb788('0x5'))[_0xb788('0x6')];var logger=require(_0xb788('0x7'))(_0xb788('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xb788('0x9')][0x2]);var QUERY=process[_0xb788('0x9')][0x3];var PATH=process[_0xb788('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x294b6a,_0x15d205){var _0x40d254={'status':_0x294b6a};var _0x144ce4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x15d205){_0x40d254[_0xb788('0xa')]=_0x15d205;}return db[_0xb788('0xb')][_0xb788('0xc')](_0x40d254,_0x144ce4);}function main(){var _0x39bc21=0x1388;var _0x1ccc1b;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb788('0xd')));return db[_0xb788('0xe')][_0xb788('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb788('0x10'),'splitSizeXlsx']})['then'](function(_0x2137b3){if(_0x2137b3){_0x1ccc1b=_0x2137b3;_0x39bc21=_0x1ccc1b[_0xb788('0x11')]||0x1388;}})[_0xb788('0x12')](function(){return dbH[_0xb788('0x13')]['query'](util['format'](_0xb788('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](function(_0x57f43c){if(!_0x57f43c[0x0][_0xb788('0x15')]){return analyticExtractedReport(_0xb788('0x16'));}var _0x3602f1=[];var _0x5ea00a=0x0;var _0x38274e=!![];if(_0x1ccc1b[_0xb788('0x10')]){if(_0x57f43c&&_0x57f43c[_0xb788('0x17')]){var _0x20ddc4=_0x57f43c[0x0]['num']%(_0x5ea00a+_0x39bc21);for(;_0x38274e;_0x5ea00a+=_0x39bc21,_0x20ddc4=_0x57f43c[0x0][_0xb788('0x15')]%(_0x5ea00a+_0x39bc21)){if(_0x20ddc4==0x0||_0x20ddc4==_0x57f43c[0x0]['num']){_0x38274e=![];}_0x3602f1['push'](dbH[_0xb788('0x13')][_0xb788('0x18')](util['format'](_0xb788('0x19'),QUERY,_0x39bc21,_0x5ea00a),{'type':dbH['sequelize']['QueryTypes'][_0xb788('0x1a')]}));}}}else{_0x3602f1[_0xb788('0x1b')](dbH[_0xb788('0x13')][_0xb788('0x18')](QUERY,{'type':dbH[_0xb788('0x13')][_0xb788('0x1c')][_0xb788('0x1a')]}));}var _0x1b0dde=path[_0xb788('0x1d')](PATH);var _0x14c65a=path[_0xb788('0x1e')](PATH,'.xlsx');var _0x181d71=_0x1ccc1b['split']&&_0x3602f1['length']>0x1;var _0x2bce0c=[];if(!fs[_0xb788('0x1f')](path[_0xb788('0x20')](_0x1b0dde,_0x14c65a))&&_0x181d71){fs['mkdirSync'](path[_0xb788('0x20')](_0x1b0dde,_0x14c65a));}return BPromise[_0xb788('0x21')](_0x3602f1,function(_0x1c3bfd){_0x2bce0c[_0xb788('0x1b')](_0x1c3bfd);})[_0xb788('0x12')](function(){for(var _0x39406c=0x0;_0x39406c<_0x2bce0c[_0xb788('0x17')];_0x39406c+=0x1){var _0x5aa377;var _0xf43118=_0x2bce0c[_0x39406c];if(_0x181d71){_0x5aa377=path[_0xb788('0x20')](_0x1b0dde,_0x14c65a,util[_0xb788('0x22')]('%s%d.%s',_0x14c65a,_0x39406c,_0xb788('0x23')));}else{_0x5aa377=path['join'](_0x1b0dde,util[_0xb788('0x22')](_0xb788('0x24'),_0x14c65a,'xlsx'));}fs['writeFileSync'](_0x5aa377,json2xls(_0xf43118),_0xb788('0x25'));}})[_0xb788('0x12')](function(){if(_0x181d71){zipdir(path['join'](_0x1b0dde,_0x14c65a),{'saveTo':path[_0xb788('0x20')](_0x1b0dde,util[_0xb788('0x22')](_0xb788('0x24'),_0x14c65a,_0xb788('0x26')))},function(_0x1257f3,_0x28d2f6){});rimraf(path[_0xb788('0x20')](_0x1b0dde,_0x14c65a),function(){});}})[_0xb788('0x12')](function(){logger['info'](util[_0xb788('0x22')](_0xb788('0x27'),EXTRACTED_REPORT_ID,_0xb788('0xd')));return analyticExtractedReport(_0xb788('0x28'),_0x181d71?util[_0xb788('0x22')](_0xb788('0x24'),_0x14c65a,_0x181d71?_0xb788('0x26'):'xlsx'):null);});})[_0xb788('0x29')](function(_0x5827da){logger['info'](util[_0xb788('0x22')](_0xb788('0x2a'),EXTRACTED_REPORT_ID,_0xb788('0xd')),util['inspect'](_0x5827da,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb788('0x2b'));})[_0xb788('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7f07=['split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','push','query','dirname','basename','length','existsSync','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find'];(function(_0xde965b,_0x18169c){var _0x1dd370=function(_0x41b992){while(--_0x41b992){_0xde965b['push'](_0xde965b['shift']());}};_0x1dd370(++_0x18169c);}(_0x7f07,0x107));var _0x77f0=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x7f07[_0x55daf2];return _0x1c8500;};'use strict';var util=require('util');var path=require(_0x77f0('0x0'));var _=require(_0x77f0('0x1'));var fs=require('fs');var json2xls=require(_0x77f0('0x2'));var BPromise=require(_0x77f0('0x3'));var zipdir=require(_0x77f0('0x4'));var rimraf=require(_0x77f0('0x5'));var db=require(_0x77f0('0x6'))['db'];var dbH=require(_0x77f0('0x6'))[_0x77f0('0x7')];var logger=require(_0x77f0('0x8'))(_0x77f0('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x77f0('0xa')][0x2]);var QUERY=process[_0x77f0('0xa')][0x3];var PATH=process[_0x77f0('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x12d6c2,_0x572825){var _0x196f27={'status':_0x12d6c2};var _0x2b7cef={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x572825){_0x196f27[_0x77f0('0xb')]=_0x572825;}return db[_0x77f0('0xc')][_0x77f0('0xd')](_0x196f27,_0x2b7cef);}function main(){var _0x1e272a=0x1388;var _0x259932;logger[_0x77f0('0xe')](util[_0x77f0('0xf')](_0x77f0('0x10'),EXTRACTED_REPORT_ID,_0x77f0('0x11')));return db['Setting'][_0x77f0('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x77f0('0x13'),_0x77f0('0x14')]})[_0x77f0('0x15')](function(_0x2fd4ed){if(_0x2fd4ed){_0x259932=_0x2fd4ed;_0x1e272a=_0x259932[_0x77f0('0x14')]||0x1388;}})[_0x77f0('0x15')](function(){return dbH['sequelize']['query'](util[_0x77f0('0xf')](_0x77f0('0x16'),QUERY),{'type':dbH[_0x77f0('0x17')][_0x77f0('0x18')][_0x77f0('0x19')]});})['then'](function(_0x2090a8){if(!_0x2090a8[0x0][_0x77f0('0x1a')]){return analyticExtractedReport(_0x77f0('0x1b'));}var _0x2d59e3=[];var _0x4ad868=0x0;var _0x3846e2=!![];if(_0x259932[_0x77f0('0x13')]){if(_0x2090a8&&_0x2090a8['length']){var _0x1be0f2=_0x2090a8[0x0]['num']%(_0x4ad868+_0x1e272a);for(;_0x3846e2;_0x4ad868+=_0x1e272a,_0x1be0f2=_0x2090a8[0x0][_0x77f0('0x1a')]%(_0x4ad868+_0x1e272a)){if(_0x1be0f2==0x0||_0x1be0f2==_0x2090a8[0x0][_0x77f0('0x1a')]){_0x3846e2=![];}_0x2d59e3[_0x77f0('0x1c')](dbH[_0x77f0('0x17')]['query'](util[_0x77f0('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e272a,_0x4ad868),{'type':dbH[_0x77f0('0x17')][_0x77f0('0x18')][_0x77f0('0x19')]}));}}}else{_0x2d59e3[_0x77f0('0x1c')](dbH[_0x77f0('0x17')][_0x77f0('0x1d')](QUERY,{'type':dbH[_0x77f0('0x17')]['QueryTypes']['SELECT']}));}var _0x3cf954=path[_0x77f0('0x1e')](PATH);var _0x40244e=path[_0x77f0('0x1f')](PATH,'.xlsx');var _0x19e2a3=_0x259932[_0x77f0('0x13')]&&_0x2d59e3[_0x77f0('0x20')]>0x1;var _0x3c4e91=[];if(!fs[_0x77f0('0x21')](path[_0x77f0('0x22')](_0x3cf954,_0x40244e))&&_0x19e2a3){fs[_0x77f0('0x23')](path[_0x77f0('0x22')](_0x3cf954,_0x40244e));}return BPromise['each'](_0x2d59e3,function(_0x1bc509){_0x3c4e91[_0x77f0('0x1c')](_0x1bc509);})[_0x77f0('0x15')](function(){for(var _0x52631d=0x0;_0x52631d<_0x3c4e91[_0x77f0('0x20')];_0x52631d+=0x1){var _0x51bedb;var _0x5877e5=_0x3c4e91[_0x52631d];if(_0x19e2a3){_0x51bedb=path['join'](_0x3cf954,_0x40244e,util[_0x77f0('0xf')](_0x77f0('0x24'),_0x40244e,_0x52631d,_0x77f0('0x25')));}else{_0x51bedb=path['join'](_0x3cf954,util[_0x77f0('0xf')](_0x77f0('0x26'),_0x40244e,'xlsx'));}fs[_0x77f0('0x27')](_0x51bedb,json2xls(_0x5877e5),_0x77f0('0x28'));}})['then'](function(){if(_0x19e2a3){zipdir(path[_0x77f0('0x22')](_0x3cf954,_0x40244e),{'saveTo':path[_0x77f0('0x22')](_0x3cf954,util[_0x77f0('0xf')]('%s.%s',_0x40244e,_0x77f0('0x29')))},function(_0x59dbf4,_0x43b978){});rimraf(path[_0x77f0('0x22')](_0x3cf954,_0x40244e),function(){});}})[_0x77f0('0x15')](function(){logger['info'](util[_0x77f0('0xf')](_0x77f0('0x2a'),EXTRACTED_REPORT_ID,_0x77f0('0x11')));return analyticExtractedReport(_0x77f0('0x2b'),_0x19e2a3?util[_0x77f0('0xf')](_0x77f0('0x26'),_0x40244e,_0x19e2a3?_0x77f0('0x29'):_0x77f0('0x25')):null);});})['catch'](function(_0x4728c8){logger[_0x77f0('0xe')](util[_0x77f0('0xf')](_0x77f0('0x2c'),EXTRACTED_REPORT_ID,_0x77f0('0x11')),util[_0x77f0('0x2d')](_0x4728c8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x77f0('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 09bd241..73ccfd1 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 _0xbf84=['splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','filter','playback','hasOwnProperty','priority','extension','find','extensions','type','Set','format','CDR(type)=%s','context','push','${EXTEN:','cutdigits','${EXTEN}','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','interval','*,*,*,*','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbf84,0x145));var _0x4bf8=function(_0x50e438,_0x4d6048){_0x50e438=_0x50e438-0x0;var _0x2f830c=_0xbf84[_0x50e438];return _0x2f830c;};'use strict';var _=require(_0x4bf8('0x0'));var util=require(_0x4bf8('0x1'));function rewrite(_0x3cd9ae,_0x13cf0e){var _0x3842b9=this;return _0x3cd9ae[_0x4bf8('0x2')][_0x4bf8('0x3')][_0x4bf8('0x4')]({'raw':!![]})[_0x4bf8('0x5')](function(_0x3bace7){_0x3842b9[_0x4bf8('0x6')]=_0x3bace7;return _0x3cd9ae[_0x4bf8('0x2')]['VoiceExtension'][_0x4bf8('0x4')]({'where':{'IntervalId':_0x13cf0e[_0x4bf8('0x7')]},'raw':!![]});})['then'](function(_0x4372ef){return _0x3cd9ae[_0x4bf8('0x2')][_0x4bf8('0x8')][_0x4bf8('0x4')]({'where':{'exten':{'$in':_[_0x4bf8('0x9')](_[_0x4bf8('0xa')](_0x4372ef,_0x4bf8('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x4bf8('0x5')](function(_0x5c65cb){var _0x60628f=_['filter'](_0x5c65cb,{'priority':'1'});var _0x392464=_[_0x4bf8('0xc')](_0x5c65cb,{'isApp':0x1});var _0x382b23=_['groupBy'](_0x392464,_0x4bf8('0xb'));var _0x18cc48=['queue',_0x4bf8('0xd')];var _0x42cc14=[];var _0xd4c6d5=[];for(var _0x4e49f6 in _0x382b23){if(_0x382b23[_0x4bf8('0xe')](_0x4e49f6)){_0x3842b9[_0x4bf8('0xf')]=0x2;_0x3842b9['extensions']=[];_0x3842b9[_0x4bf8('0x10')]=_[_0x4bf8('0x11')](_0x60628f,{'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')]});_0x3842b9[_0x4bf8('0x12')]['push']({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':util[_0x4bf8('0x15')](_0x4bf8('0x16'),_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')]),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0]['exten'],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});if(_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')]==='outbound'){if(_0x3842b9[_0x4bf8('0x10')]){_0x3842b9['extensions'][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':'CDR(destination)='+(_0x3842b9[_0x4bf8('0x10')]['cutdigits']?_0x4bf8('0x19')+_0x3842b9[_0x4bf8('0x10')][_0x4bf8('0x1a')]+'}':_0x4bf8('0x1b')),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});}_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':'CDR(routeid)='+_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')],'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0]['exten'],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});var _0x61d356=_0x3842b9[_0x4bf8('0xf')]++;_0x3842b9[_0x4bf8('0x12')]['push']({'type':_0x382b23[_0x4e49f6][0x0]['type'],'app':_0x4bf8('0x1d'),'appdata':_0x4bf8('0x1e')+(_0x61d356+0x2)+_0x4bf8('0x1f')+(_0x61d356+0x1)+')','context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x61d356,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});if(_0x3842b9[_0x4bf8('0x10')]){_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':_0x3842b9['extension'][_0x4bf8('0x1a')]?_0x4bf8('0x20')+_0x3842b9[_0x4bf8('0x10')][_0x4bf8('0x1a')]+'}':_0x4bf8('0x21'),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9['priority']++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});}_0x3842b9['extensions']['push']({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':'outboundrouteid='+_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')],'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});if(_0x3842b9['extension']&&_0x3842b9['extension'][_0x4bf8('0xe')](_0x4bf8('0x22'))&&_0x3842b9[_0x4bf8('0x10')]['recordingFormat']!==_0x4bf8('0x23')){_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':_0x4bf8('0x24'),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0]['exten'],'priority':_0x3842b9['priority']++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':_0x4bf8('0x25')+_0x3842b9[_0x4bf8('0x10')][_0x4bf8('0x22')]||'wav','context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});}}_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0]['type'],'app':'Set','appdata':_0x4bf8('0x26'),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0]['type'],'app':_0x4bf8('0x14'),'appdata':_0x4bf8('0x27'),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0]['exten'],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]});_0x3842b9[_0x4bf8('0x12')][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':_0x4bf8('0x28'),'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'priority':_0x3842b9[_0x4bf8('0xf')]++,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});for(var _0x379b22=0x0,_0x428267=0x0;_0x379b22<_0x382b23[_0x4e49f6]['length'];_0x379b22+=0x1,_0x428267=0x0){var _0x3fcc86=_0x382b23[_0x4e49f6][_0x379b22];if(_0x3fcc86[_0x4bf8('0x13')]){_0x3fcc86['type']=_0x3fcc86['type'][_0x4bf8('0x29')]();}var _0x53a432=[];var _0x5760f7=[];delete _0x3fcc86['id'];delete _0x3fcc86['createdAt'];delete _0x3fcc86['updatedAt'];var _0x44acb6=_0x3fcc86[_0x4bf8('0x2a')]!==_0x4bf8('0x2b')?[_0x3fcc86[_0x4bf8('0x2a')]]:_0x3fcc86[_0x4bf8('0x7')]?_[_0x4bf8('0xa')](_[_0x4bf8('0xc')](_0x3842b9[_0x4bf8('0x6')],{'IntervalId':_0x3fcc86[_0x4bf8('0x7')]}),_0x4bf8('0x2a')):[];if(_0x3fcc86[_0x4bf8('0xe')](_0x4bf8('0x2c'))){if(_0x3fcc86[_0x4bf8('0x2c')]&&_0x3fcc86[_0x4bf8('0x2c')]!=='--'){_0x53a432[_0x4bf8('0x18')]({'type':_0x3fcc86[_0x4bf8('0x13')],'app':'Set','appdata':'CDR(tag)='+_0x3fcc86['tag'],'context':_0x3fcc86[_0x4bf8('0x17')],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9[_0x4bf8('0xf')]+_0x428267++,'VoiceExtensionId':_0x3fcc86[_0x4bf8('0x1c')]});}}if(_0x3fcc86[_0x4bf8('0x13')]==='outbound'&&_0x3fcc86['hasOwnProperty'](_0x4bf8('0x2e'))){if(_0x3fcc86['callerID']){_0x53a432[_0x4bf8('0x18')]({'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x3fcc86['callerID']+')','context':_0x3fcc86['context'],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9[_0x4bf8('0xf')]+_0x428267++,'VoiceExtensionId':_0x3fcc86['VoiceExtensionId']});}else{_0x53a432[_0x4bf8('0x18')]({'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x1d'),'appdata':_0x4bf8('0x2f'),'context':_0x3fcc86[_0x4bf8('0x17')],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9[_0x4bf8('0xf')]+_0x428267++,'VoiceExtensionId':_0x3fcc86[_0x4bf8('0x1c')]});}}if(_0x3fcc86[_0x4bf8('0xe')](_0x4bf8('0x30'))){if(_0x18cc48[_0x4bf8('0x31')](_0x3fcc86[_0x4bf8('0x32')][_0x4bf8('0x29')]())>=0x0&&_0x3fcc86[_0x4bf8('0x33')]!==_0x4bf8('0x34')){if(_0x3fcc86['answer']){_0x53a432['push']({'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x1d'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x3fcc86[_0x4bf8('0x17')],'exten':_0x3fcc86['exten'],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9[_0x4bf8('0xf')]+_0x428267++,'VoiceExtensionId':_0x3fcc86['VoiceExtensionId']});_0x53a432[_0x4bf8('0x18')]({'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3fcc86[_0x4bf8('0x17')],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9['priority']+_0x428267++,'VoiceExtensionId':_0x3fcc86['VoiceExtensionId']});}else{_0x53a432['push']({'type':_0x3fcc86[_0x4bf8('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3fcc86['context'],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9['priority']+_0x428267++,'VoiceExtensionId':_0x3fcc86[_0x4bf8('0x1c')]});_0x53a432[_0x4bf8('0x18')]({'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x14'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3fcc86[_0x4bf8('0x17')],'exten':_0x3fcc86[_0x4bf8('0xb')],'priority':_0x44acb6[_0x4bf8('0x2d')]+_0x3842b9[_0x4bf8('0xf')]+_0x428267++,'VoiceExtensionId':_0x3fcc86[_0x4bf8('0x1c')]});}}}for(var _0x356c6a=0x0;_0x356c6a<_0x44acb6[_0x4bf8('0x2d')];_0x356c6a+=0x1){var _0x2d27a6=_0x3842b9[_0x4bf8('0xf')]+_0x44acb6[_0x4bf8('0x2d')];var _0x2c02b4=_0x356c6a===_0x44acb6['length']-0x1?_0x3842b9[_0x4bf8('0xf')]+_0x53a432[_0x4bf8('0x2d')]+_0x5760f7['length']+0x2:_0x3842b9['priority']+_0x356c6a+0x1;_0x53a432[_0x4bf8('0x35')](_0x356c6a,0x0,{'type':_0x3fcc86[_0x4bf8('0x13')],'app':_0x4bf8('0x36'),'appdata':_0x44acb6[_0x356c6a]+'?'+_0x3fcc86[_0x4bf8('0x17')]+_0x4bf8('0x37')+_0x2d27a6+':'+_0x3fcc86[_0x4bf8('0x17')]+_0x4bf8('0x37')+_0x2c02b4,'exten':_0x3fcc86[_0x4bf8('0xb')],'context':_0x3fcc86['context'],'priority':_0x3842b9[_0x4bf8('0xf')]+_0x356c6a,'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});}_0x3fcc86['priority']=_0x53a432['length']?_['last'](_0x53a432)['priority']+0x1:_0x3842b9[_0x4bf8('0xf')];_0x3842b9[_0x4bf8('0xf')]=(_0x5760f7['length']?_[_0x4bf8('0x38')](_0x5760f7)[_0x4bf8('0xf')]:_0x3fcc86[_0x4bf8('0xf')])+0x1;_0x3842b9[_0x4bf8('0x12')]=_[_0x4bf8('0x39')](_0x3842b9['extensions'],_0x53a432,[_0x3fcc86],_0x5760f7);}_0x3842b9['extensions'][_0x4bf8('0x18')]({'type':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x13')],'app':_0x4bf8('0x3a'),'exten':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0xb')],'context':_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x17')],'priority':_0x3842b9[_0x4bf8('0xf')],'VoiceExtensionId':_0x382b23[_0x4e49f6][0x0]['VoiceExtensionId']});_0x42cc14[_0x4bf8('0x18')](_0x382b23[_0x4e49f6][0x0][_0x4bf8('0x1c')]);_0xd4c6d5=_[_0x4bf8('0x39')](_0xd4c6d5,_0x3842b9[_0x4bf8('0x12')]);}}return _0x3cd9ae[_0x4bf8('0x3b')](function(_0x4db93b){return _0x3cd9ae[_0x4bf8('0x2')][_0x4bf8('0x8')][_0x4bf8('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x42cc14}},'transaction':_0x4db93b})[_0x4bf8('0x5')](function(_0x4b6290){return _0x3cd9ae['models'][_0x4bf8('0x8')]['bulkCreate'](_['sortBy'](_0xd4c6d5,_0x4bf8('0xf')),{'transaction':_0x4db93b});});});})[_0x4bf8('0x3d')](function(_0x7ecf65){console['error'](_0x7ecf65);});}exports[_0x4bf8('0x3e')]=rewrite; \ No newline at end of file +var _0x876e=['CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','app','appType','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extensions','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN:','extension','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag'];(function(_0x5b884c,_0x4fbcfe){var _0x1a11bc=function(_0x315161){while(--_0x315161){_0x5b884c['push'](_0x5b884c['shift']());}};_0x1a11bc(++_0x4fbcfe);}(_0x876e,0x172));var _0xe876=function(_0x18f6dd,_0xb32afb){_0x18f6dd=_0x18f6dd-0x0;var _0x11d8e1=_0x876e[_0x18f6dd];return _0x11d8e1;};'use strict';var _=require(_0xe876('0x0'));var util=require('util');function rewrite(_0xe96298,_0x1b5cf9){var _0x1b79e2=this;return _0xe96298[_0xe876('0x1')]['Interval'][_0xe876('0x2')]({'raw':!![]})[_0xe876('0x3')](function(_0x289819){_0x1b79e2[_0xe876('0x4')]=_0x289819;return _0xe96298[_0xe876('0x1')][_0xe876('0x5')][_0xe876('0x2')]({'where':{'IntervalId':_0x1b5cf9[_0xe876('0x6')]},'raw':!![]});})['then'](function(_0x384d6f){return _0xe96298[_0xe876('0x1')]['VoiceExtension'][_0xe876('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0xe876('0x7')](_0x384d6f,_0xe876('0x8')))}},'order':[{'raw':_0xe876('0x9')}],'raw':!![]});})[_0xe876('0x3')](function(_0x1b7b36){var _0x46d822=_[_0xe876('0xa')](_0x1b7b36,{'priority':'1'});var _0x26c84f=_[_0xe876('0xa')](_0x1b7b36,{'isApp':0x1});var _0xc27391=_[_0xe876('0xb')](_0x26c84f,_0xe876('0x8'));var _0x418608=[_0xe876('0xc'),_0xe876('0xd')];var _0x21f840=[];var _0x2d0458=[];for(var _0x10a1a2 in _0xc27391){if(_0xc27391['hasOwnProperty'](_0x10a1a2)){_0x1b79e2[_0xe876('0xe')]=0x2;_0x1b79e2[_0xe876('0xf')]=[];_0x1b79e2['extension']=_['find'](_0x46d822,{'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')]});_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':util[_0xe876('0x13')](_0xe876('0x14'),_0xc27391[_0x10a1a2][0x0]['type']),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});if(_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')]===_0xe876('0x17')){if(_0x1b79e2['extension']){_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x18')+(_0x1b79e2['extension'][_0xe876('0x19')]?_0xe876('0x1a')+_0x1b79e2[_0xe876('0x1b')][_0xe876('0x19')]+'}':_0xe876('0x1c')),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});}_0x1b79e2[_0xe876('0xf')]['push']({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x1d')+_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')],'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});var _0x18531f=_0x1b79e2['priority']++;_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x1e'),'appdata':_0xe876('0x1f')+(_0x18531f+0x2)+_0xe876('0x20')+(_0x18531f+0x1)+')','context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x18531f,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});if(_0x1b79e2['extension']){_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0]['type'],'app':_0xe876('0x12'),'appdata':_0x1b79e2['extension'][_0xe876('0x19')]?_0xe876('0x21')+_0x1b79e2[_0xe876('0x1b')][_0xe876('0x19')]+'}':'CDR(prefix)=noprefix','context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0]['exten'],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});}_0x1b79e2[_0xe876('0xf')]['push']({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':'Set','appdata':'outboundrouteid='+_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')],'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0]['VoiceExtensionId']});if(_0x1b79e2[_0xe876('0x1b')]&&_0x1b79e2['extension'][_0xe876('0x22')](_0xe876('0x23'))&&_0x1b79e2[_0xe876('0x1b')][_0xe876('0x23')]!==_0xe876('0x24')){_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x25'),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2['priority']++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0]['VoiceExtensionId']});_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0]['type'],'app':'Set','appdata':_0xe876('0x26')+_0x1b79e2[_0xe876('0x1b')]['recordingFormat']||_0xe876('0x27'),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0]['VoiceExtensionId']});}}_0x1b79e2['extensions'][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x28'),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0]['exten'],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x29'),'context':_0xc27391[_0x10a1a2][0x0]['context'],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2['priority']++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0]['VoiceExtensionId']});_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x2a'),'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'priority':_0x1b79e2[_0xe876('0xe')]++,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});for(var _0x5e344b=0x0,_0x75d5eb=0x0;_0x5e344b<_0xc27391[_0x10a1a2][_0xe876('0x2b')];_0x5e344b+=0x1,_0x75d5eb=0x0){var _0x6ca043=_0xc27391[_0x10a1a2][_0x5e344b];if(_0x6ca043['type']){_0x6ca043['type']=_0x6ca043[_0xe876('0x11')][_0xe876('0x2c')]();}var _0x442726=[];var _0x103796=[];delete _0x6ca043['id'];delete _0x6ca043[_0xe876('0x2d')];delete _0x6ca043[_0xe876('0x2e')];var _0x3b90b4=_0x6ca043[_0xe876('0x2f')]!==_0xe876('0x30')?[_0x6ca043['interval']]:_0x6ca043[_0xe876('0x6')]?_[_0xe876('0x7')](_['filter'](_0x1b79e2[_0xe876('0x4')],{'IntervalId':_0x6ca043['IntervalId']}),'interval'):[];if(_0x6ca043[_0xe876('0x22')](_0xe876('0x31'))){if(_0x6ca043[_0xe876('0x31')]&&_0x6ca043['tag']!=='--'){_0x442726[_0xe876('0x10')]({'type':_0x6ca043['type'],'app':_0xe876('0x12'),'appdata':_0xe876('0x32')+_0x6ca043[_0xe876('0x31')],'context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});}}if(_0x6ca043[_0xe876('0x11')]===_0xe876('0x17')&&_0x6ca043[_0xe876('0x22')](_0xe876('0x33'))){if(_0x6ca043['callerID']){_0x442726[_0xe876('0x10')]({'type':_0x6ca043[_0xe876('0x11')],'app':'ExecIf','appdata':_0xe876('0x34')+_0x6ca043['callerID']+')','context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2['priority']+_0x75d5eb++,'VoiceExtensionId':_0x6ca043['VoiceExtensionId']});}else{_0x442726[_0xe876('0x10')]({'type':_0x6ca043[_0xe876('0x11')],'app':_0xe876('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});}}if(_0x6ca043[_0xe876('0x22')](_0xe876('0x35'))){if(_0x418608['indexOf'](_0x6ca043[_0xe876('0x36')]['toLowerCase']())>=0x0&&_0x6ca043[_0xe876('0x37')]!==_0xe876('0x38')){if(_0x6ca043[_0xe876('0x35')]){_0x442726[_0xe876('0x10')]({'type':_0x6ca043['type'],'app':_0xe876('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043['exten'],'priority':_0x3b90b4['length']+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});_0x442726[_0xe876('0x10')]({'type':_0x6ca043['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});}else{_0x442726[_0xe876('0x10')]({'type':_0x6ca043['type'],'app':_0xe876('0x1e'),'appdata':_0xe876('0x39'),'context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});_0x442726[_0xe876('0x10')]({'type':_0x6ca043[_0xe876('0x11')],'app':_0xe876('0x12'),'appdata':_0xe876('0x3a'),'context':_0x6ca043[_0xe876('0x15')],'exten':_0x6ca043[_0xe876('0x8')],'priority':_0x3b90b4[_0xe876('0x2b')]+_0x1b79e2[_0xe876('0xe')]+_0x75d5eb++,'VoiceExtensionId':_0x6ca043[_0xe876('0x16')]});}}}for(var _0x1e8c7a=0x0;_0x1e8c7a<_0x3b90b4[_0xe876('0x2b')];_0x1e8c7a+=0x1){var _0x49245a=_0x1b79e2[_0xe876('0xe')]+_0x3b90b4[_0xe876('0x2b')];var _0xb0275b=_0x1e8c7a===_0x3b90b4['length']-0x1?_0x1b79e2[_0xe876('0xe')]+_0x442726[_0xe876('0x2b')]+_0x103796[_0xe876('0x2b')]+0x2:_0x1b79e2['priority']+_0x1e8c7a+0x1;_0x442726[_0xe876('0x3b')](_0x1e8c7a,0x0,{'type':_0x6ca043[_0xe876('0x11')],'app':_0xe876('0x3c'),'appdata':_0x3b90b4[_0x1e8c7a]+'?'+_0x6ca043[_0xe876('0x15')]+_0xe876('0x3d')+_0x49245a+':'+_0x6ca043[_0xe876('0x15')]+',${EXTEN},'+_0xb0275b,'exten':_0x6ca043[_0xe876('0x8')],'context':_0x6ca043[_0xe876('0x15')],'priority':_0x1b79e2[_0xe876('0xe')]+_0x1e8c7a,'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});}_0x6ca043[_0xe876('0xe')]=_0x442726['length']?_[_0xe876('0x3e')](_0x442726)['priority']+0x1:_0x1b79e2['priority'];_0x1b79e2[_0xe876('0xe')]=(_0x103796[_0xe876('0x2b')]?_[_0xe876('0x3e')](_0x103796)[_0xe876('0xe')]:_0x6ca043[_0xe876('0xe')])+0x1;_0x1b79e2[_0xe876('0xf')]=_[_0xe876('0x3f')](_0x1b79e2['extensions'],_0x442726,[_0x6ca043],_0x103796);}_0x1b79e2[_0xe876('0xf')][_0xe876('0x10')]({'type':_0xc27391[_0x10a1a2][0x0][_0xe876('0x11')],'app':_0xe876('0x40'),'exten':_0xc27391[_0x10a1a2][0x0][_0xe876('0x8')],'context':_0xc27391[_0x10a1a2][0x0][_0xe876('0x15')],'priority':_0x1b79e2[_0xe876('0xe')],'VoiceExtensionId':_0xc27391[_0x10a1a2][0x0][_0xe876('0x16')]});_0x21f840[_0xe876('0x10')](_0xc27391[_0x10a1a2][0x0]['VoiceExtensionId']);_0x2d0458=_[_0xe876('0x3f')](_0x2d0458,_0x1b79e2[_0xe876('0xf')]);}}return _0xe96298[_0xe876('0x41')](function(_0x3144f2){return _0xe96298[_0xe876('0x1')][_0xe876('0x5')][_0xe876('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x21f840}},'transaction':_0x3144f2})['then'](function(_0x351084){return _0xe96298[_0xe876('0x1')][_0xe876('0x5')]['bulkCreate'](_[_0xe876('0x43')](_0x2d0458,_0xe876('0xe')),{'transaction':_0x3144f2});});});})['catch'](function(_0x8170b5){console[_0xe876('0x44')](_0x8170b5);});}exports[_0xe876('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 51128cf..e71e296 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 _0x8154=['inspect','insert','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','select','field','phone','NOW()','scheduledAt','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','str','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','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!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','CompanyId','Duplicate\x20Contact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper'];(function(_0x4dc0d9,_0x4f6443){var _0x3e44a8=function(_0x26d2fc){while(--_0x26d2fc){_0x4dc0d9['push'](_0x4dc0d9['shift']());}};_0x3e44a8(++_0x4f6443);}(_0x8154,0x18d));var _0x4815=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8154[_0xbd08b4];return _0x314f1e;};'use strict';var BPromise=require(_0x4815('0x0'));var util=require(_0x4815('0x1'));var _=require(_0x4815('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x4815('0x3'));var Redis=require(_0x4815('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x4815('0x5'));var logger=require(_0x4815('0x6'))(_0x4815('0x7'));config[_0x4815('0x8')]=_[_0x4815('0x9')](config['redis'],{'host':_0x4815('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4815('0x8')]));require(_0x4815('0xb'))[_0x4815('0xc')](socket);try{if(!process[_0x4815('0xd')][0x2]||process['argv'][0x2]===_0x4815('0xe')||process[_0x4815('0xd')][0x2]===_0x4815('0xf')){throw new Error(_0x4815('0x10'));}var FILEPATH=process[_0x4815('0xd')][0x2];if(!process[_0x4815('0xd')][0x3]||process[_0x4815('0xd')][0x3]===_0x4815('0xe')||process[_0x4815('0xd')][0x3]===_0x4815('0xf')||!process[_0x4815('0xd')][0x4]||process[_0x4815('0xd')][0x4]===_0x4815('0xe')||process[_0x4815('0xd')][0x4]===_0x4815('0xf')){throw new Error(_0x4815('0x11'));}var FIELDS=_[_0x4815('0x12')](process[_0x4815('0xd')][0x3][_0x4815('0x13')](','),process[_0x4815('0xd')][0x4][_0x4815('0x13')](','));if(!process[_0x4815('0xd')][0x5]||process[_0x4815('0xd')][0x5]===_0x4815('0xe')||process[_0x4815('0xd')][0x5]==='null'){throw new Error(_0x4815('0x14'));}var LISTID=process[_0x4815('0xd')][0x5];var COMPANYID=process[_0x4815('0xd')][0x6]&&process[_0x4815('0xd')][0x6]!==_0x4815('0xe')&&process[_0x4815('0xd')][0x6]!==_0x4815('0xf')?process[_0x4815('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x4815('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x4815('0xf')?process['argv'][0x7]:null;if(!process[_0x4815('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x4815('0xd')][0x8]===_0x4815('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x4815('0xd')][0x8];}catch(_0x5f2b79){logger[_0x4815('0x15')](_0x5f2b79);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(_0x4048b9,_0x4f6b0a,_0x59899,_0x8d78b7){var _0x2195b5={'message':_0x4f6b0a};_0x2195b5[_0x4048b9]=!![];if(_0x59899){_0x2195b5['contact']=_0x59899;}if(_0x8d78b7){_0x2195b5[_0x4815('0x16')]=_0x8d78b7;}return _0x2195b5;}function isEmail(_0x46d9fd){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))*$/[_0x4815('0x17')](_0x46d9fd);}function checkRow(_0x36cf51,_0x38431d,_0x5b5afc){return new BPromise(function(_0xd87d6a,_0x333250){if(_[_0x4815('0x18')](_0x36cf51)){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x19'),null,_0x5b5afc));}if(_0x36cf51[_0x4815('0x1a')]&&_0x36cf51[_0x4815('0x1a')][_0x4815('0x1b')]){var _0x4387e2=_['map'](_0x36cf51[_0x4815('0x1a')],_0x4815('0x1c'))[_0x4815('0x1d')](';');return _0x333250(handleCheckRowError('error',_0x4387e2,null,_0x5b5afc));}var _0x1230cc={};for(var _0x17f755 in FIELDS){if(FIELDS[_0x4815('0x1e')](_0x17f755)&&FIELDS[_0x17f755]){_0x1230cc[_0x17f755]=_0x36cf51[_0x4815('0x1f')][0x0][FIELDS[_0x17f755]]||_0x36cf51[_0x4815('0x1f')][0x0]['\ufeff'+FIELDS[_0x17f755]];}}if(!_0x1230cc[_0x4815('0x20')]){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x21'),null,_0x5b5afc));}if(!_0x1230cc['phone']){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x22'),null,_0x5b5afc));}if(_0x1230cc[_0x4815('0x23')]){var _0x383ad0=moment(_0x1230cc[_0x4815('0x23')],_0x4815('0x24'));if(!_0x383ad0[_0x4815('0x25')]()){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x26'),null,_0x5b5afc));}}if(_0x1230cc['email']){if(!isEmail(_0x1230cc['email'])){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x27'),null,_0x5b5afc));}}_0x1230cc['ListId']=LISTID;_0x1230cc[_0x4815('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x38431d){var _0x1726e1={};for(var _0x12e199=0x0,_0x12c387=DUPLICATES[_0x4815('0x1b')];_0x12e199<_0x12c387;_0x12e199+=0x1){_0x1726e1[DUPLICATES[_0x12e199]]=_0x1230cc[DUPLICATES[_0x12e199]];}var _0x1a61f=_['find'](_0x38431d,_0x1726e1);if(_0x1a61f){return _0x333250(handleCheckRowError('duplicate',_0x4815('0x29'),_0x1a61f,_0x5b5afc));}}return db['CmContact'][_0x4815('0x2a')](_0x1230cc,{'raw':!![],'hooks':![],'fields':_[_0x4815('0x2b')](_0x1230cc)})[_0x4815('0x2c')](function(_0x47fa71){if(DUPLICATES&&DUPLICATES[_0x4815('0x1b')]&&_0x38431d){_0x38431d['push'](_[_0x4815('0x2d')](_0x1230cc,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x47fa71['id'];return _0xd87d6a();})[_0x4815('0x2e')](function(_0x2e9bef){return _0x333250(handleCheckRowError(_0x4815('0x15'),_0x4815('0x2f')+(_0x2e9bef[_0x4815('0x1c')]||JSON[_0x4815('0x30')](_0x2e9bef)),null,_0x5b5afc));});});}function checkHopper(){function _0x3b8974(){return function(_0x42790a){logger['error'](_0x4815('0x31'),_0x4815('0x32'),util[_0x4815('0x33')](_0x42790a,{'showHidden':![],'depth':null}));};}var _0x4af713=function(_0x2b3131,_0x367e97){var _0x39e2e1=squel[_0x4815('0x34')]()[_0x4815('0x35')](_0x4815('0x36'))[_0x4815('0x37')](['phone','scheduledAt','ContactId',_0x4815('0x38'),_0x367e97,_0x4815('0x39'),_0x4815('0x3a')],squel[_0x4815('0x3b')]()[_0x4815('0x3c')](_0x4815('0x3d'),_0x4815('0x3d'))[_0x4815('0x3c')](_0x4815('0x3e'),_0x4815('0x3f'))[_0x4815('0x3c')]('id',_0x4815('0x40'))['field'](LISTID[_0x4815('0x41')](),_0x4815('0x38'))[_0x4815('0x3c')](_0x2b3131['id'][_0x4815('0x41')](),_0x367e97)['field'](_0x4815('0x3e'),_0x4815('0x39'))[_0x4815('0x3c')](_0x4815('0x3e'),_0x4815('0x3a'))['from'](_0x4815('0x42'))['where'](_0x4815('0x43'))[_0x4815('0x44')](_0x4815('0x45'),LISTID['toString']())[_0x4815('0x44')](_0x4815('0x46'))[_0x4815('0x44')](_0x4815('0x47'),squel[_0x4815('0x3b')]()[_0x4815('0x3c')]('phone')[_0x4815('0x48')](_0x4815('0x36'))[_0x4815('0x44')](_0x367e97+_0x4815('0x49'),_0x2b3131['id'][_0x4815('0x41')]())))[_0x4815('0x41')]();return _0x39e2e1;};var _0x3a8302=function(_0x2f0cfe,_0x550abd){var _0x3bfcc3=squel[_0x4815('0x34')]()[_0x4815('0x35')](_0x4815('0x36'))[_0x4815('0x37')]([_0x4815('0x3d'),'scheduledAt',_0x4815('0x40'),_0x4815('0x38'),_0x550abd,_0x4815('0x39'),_0x4815('0x3a')],squel['select']()[_0x4815('0x3c')](_0x4815('0x3d'),_0x4815('0x3d'))['field']('NOW()',_0x4815('0x3f'))[_0x4815('0x3c')]('id',_0x4815('0x40'))['field'](LISTID[_0x4815('0x41')](),_0x4815('0x38'))[_0x4815('0x3c')](_0x2f0cfe['id'][_0x4815('0x41')](),_0x550abd)[_0x4815('0x3c')](_0x4815('0x3e'),'createdAt')['field']('NOW()',_0x4815('0x3a'))[_0x4815('0x48')](_0x4815('0x42'))['where']('deletedAt\x20IS\x20NULL')[_0x4815('0x44')](_0x4815('0x45'),LISTID[_0x4815('0x41')]())[_0x4815('0x44')]('id\x20IN\x20?',squel[_0x4815('0x4a')](hopperContacts))[_0x4815('0x44')](_0x4815('0x46'))[_0x4815('0x44')](_0x4815('0x47'),squel[_0x4815('0x3b')]()[_0x4815('0x3c')]('calleridnum')[_0x4815('0x48')](_0x4815('0x4b'))['where'](_0x550abd+_0x4815('0x49'),_0x2f0cfe['id'][_0x4815('0x41')]()))[_0x4815('0x44')](_0x4815('0x47'),squel[_0x4815('0x3b')]()[_0x4815('0x3c')](_0x4815('0x3d'))['from']('cm_hopper')[_0x4815('0x44')](_0x550abd+_0x4815('0x49'),_0x2f0cfe['id'][_0x4815('0x41')]())))[_0x4815('0x41')]();return _0x3bfcc3;};function _0x560474(_0x4b2e25,_0x528b48){var _0x56184d=squel[_0x4815('0x34')]()[_0x4815('0x35')](_0x4815('0x36'))[_0x4815('0x37')]([_0x4815('0x3d'),'scheduledAt',_0x4815('0x40'),_0x4815('0x38'),_0x528b48,_0x4815('0x39'),'updatedAt'],squel[_0x4815('0x3b')]()[_0x4815('0x3c')]('phone',_0x4815('0x3d'))[_0x4815('0x3c')]('NOW()',_0x4815('0x3f'))[_0x4815('0x3c')]('id',_0x4815('0x40'))[_0x4815('0x3c')](LISTID[_0x4815('0x41')](),_0x4815('0x38'))[_0x4815('0x3c')](_0x4b2e25['id']['toString'](),_0x528b48)[_0x4815('0x3c')](_0x4815('0x3e'),_0x4815('0x39'))[_0x4815('0x3c')]('NOW()',_0x4815('0x3a'))[_0x4815('0x48')](_0x4815('0x42'))[_0x4815('0x44')](_0x4815('0x43'))[_0x4815('0x44')](_0x4815('0x45'),LISTID[_0x4815('0x41')]())['where'](_0x4815('0x4c'),squel[_0x4815('0x4a')](hopperContacts))[_0x4815('0x44')](_0x4815('0x46')))[_0x4815('0x41')]();return _0x56184d;}function _0x2ba986(_0x51b543,_0x256eaa){var _0x42a609=squel['insert']()[_0x4815('0x35')](_0x4815('0x4d'))[_0x4815('0x37')]([_0x4815('0x3d'),_0x4815('0x40'),_0x4815('0x38'),_0x256eaa,_0x4815('0x39'),'updatedAt'],squel[_0x4815('0x3b')]()[_0x4815('0x3c')](_0x4815('0x3d'),'phone')[_0x4815('0x3c')]('id',_0x4815('0x40'))[_0x4815('0x3c')](LISTID[_0x4815('0x41')](),_0x4815('0x38'))[_0x4815('0x3c')](_0x51b543['id']['toString'](),_0x256eaa)[_0x4815('0x3c')]('NOW()',_0x4815('0x39'))[_0x4815('0x3c')](_0x4815('0x3e'),_0x4815('0x3a'))[_0x4815('0x48')](_0x4815('0x42'))[_0x4815('0x44')](_0x4815('0x43'))[_0x4815('0x44')](_0x4815('0x45'),LISTID['toString']())['where'](_0x4815('0x4c'),squel['str'](hopperContacts))['where'](_0x4815('0x46')))['toString']();return _0x42a609;}return db[_0x4815('0x4e')][_0x4815('0x4f')]({'where':{'type':_0x4815('0x50')},'attributes':['id',_0x4815('0x51')],'include':[{'model':db[_0x4815('0x52')],'as':_0x4815('0x53'),'where':{'id':LISTID}}]})[_0x4815('0x2c')](function(_0x16005a){var _0xb7bdef=[];if(_0x16005a){var _0x5c7284;for(var _0x3c30cc=0x0,_0x509bef;_0x3c30cc<_0x16005a[_0x4815('0x1b')];_0x3c30cc+=0x1){_0x509bef=_0x16005a[_0x3c30cc][_0x4815('0x54')]({'plain':!![]});switch(_0x509bef[_0x4815('0x51')]){case _0x4815('0x55'):_0xb7bdef[_0x4815('0x56')](db['sequelize'][_0x4815('0x57')](_0x3a8302(_0x509bef,_0x4815('0x58')))[_0x4815('0x2c')](function(){})['catch'](_0x3b8974()));break;case _0x4815('0x59'):_0xb7bdef[_0x4815('0x56')](db[_0x4815('0x5a')][_0x4815('0x57')](_0x4af713(_0x509bef,_0x4815('0x58')))[_0x4815('0x2c')](function(){})['catch'](_0x3b8974()));break;default:_0xb7bdef['push'](db[_0x4815('0x5a')]['query'](_0x560474(_0x509bef,'VoiceQueueId'))['then'](function(){})[_0x4815('0x2e')](_0x3b8974()));}}}return _0xb7bdef;})[_0x4815('0x5b')]()['then'](function(){return db['VoiceQueue'][_0x4815('0x4f')]({'where':{'type':_0x4815('0x50')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x4815('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x336d29){var _0x3827d2=[];if(_0x336d29){var _0x3ec788;for(var _0x30b210=0x0,_0xbe2b1e;_0x30b210<_0x336d29[_0x4815('0x1b')];_0x30b210+=0x1){_0xbe2b1e=_0x336d29[_0x30b210]['get']({'plain':!![]});_0x3827d2[_0x4815('0x56')](db[_0x4815('0x5a')]['query'](_0x2ba986(_0xbe2b1e,_0x4815('0x58')))[_0x4815('0x2c')](function(){})[_0x4815('0x2e')](_0x3b8974()));}}return _0x3827d2;})[_0x4815('0x5b')]();})[_0x4815('0x2c')](function(){return db['Campaign'][_0x4815('0x4f')]({'attributes':['id',_0x4815('0x51')],'include':[{'model':db[_0x4815('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x4815('0x2c')](function(_0x406ec0){var _0x46a0cb=[];if(_0x406ec0){for(var _0xba17e3=0x0,_0x5e8f75;_0xba17e3<_0x406ec0[_0x4815('0x1b')];_0xba17e3+=0x1){_0x5e8f75=_0x406ec0[_0xba17e3]['get']({'plain':!![]});switch(_0x5e8f75[_0x4815('0x51')]){case _0x4815('0x55'):_0x46a0cb[_0x4815('0x56')](db[_0x4815('0x5a')][_0x4815('0x57')](_0x3a8302(_0x5e8f75,_0x4815('0x5d')))[_0x4815('0x2c')](function(){})[_0x4815('0x2e')](_0x3b8974()));break;case _0x4815('0x59'):_0x46a0cb[_0x4815('0x56')](db[_0x4815('0x5a')][_0x4815('0x57')](_0x4af713(_0x5e8f75,_0x4815('0x5d')))['then'](function(){})[_0x4815('0x2e')](_0x3b8974()));break;default:_0x46a0cb['push'](db[_0x4815('0x5a')][_0x4815('0x57')](_0x560474(_0x5e8f75,_0x4815('0x5d')))[_0x4815('0x2c')](function(){})[_0x4815('0x2e')](_0x3b8974()));}}}return _0x46a0cb;})[_0x4815('0x5b')]();})[_0x4815('0x2c')](function(){return db[_0x4815('0x5e')][_0x4815('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4815('0x2c')](function(_0x4da1bb){var _0x2468ab=[];if(_0x4da1bb){for(var _0x190889=0x0,_0x2e828c;_0x190889<_0x4da1bb['length'];_0x190889+=0x1){_0x2e828c=_0x4da1bb[_0x190889][_0x4815('0x54')]({'plain':!![]});_0x2468ab[_0x4815('0x56')](db[_0x4815('0x5a')]['query'](_0x2ba986(_0x2e828c,_0x4815('0x5d')))[_0x4815('0x2c')](function(){})['catch'](_0x3b8974()));}}return _0x2468ab;})[_0x4815('0x5b')]();})[_0x4815('0x2e')](function(_0x8d4d01){logger['error'](_0x4815('0x5f'),_0x4815('0x60'),_0x8d4d01['message']);});}var processPromises=function(_0xf264f5){return BPromise['all'](promises)[_0x4815('0x2c')](function(_0x125218){})['catch'](function(_0x1a6d04){logger[_0x4815('0x15')](_0x4815('0x61'),JSON[_0x4815('0x30')](_0x1a6d04));})['finally'](function(){socket[_0x4815('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xf264f5){return _0xf264f5[_0x4815('0x63')]();}});};var endCsv=function(){return BPromise[_0x4815('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x4815('0x2c')](function(){socket['emit'](_0x4815('0x65')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4815('0x66')](FILEPATH);}catch(_0x47adcd){logger[_0x4815('0x15')](_0x4815('0x67'),JSON['stringify'](_0x47adcd));}finally{process[_0x4815('0x68')](0x0);}});};process['on'](_0x4815('0x69'),function(){logger[_0x4815('0x6a')](_0x4815('0x6b'));endCsv();});function main(){return BPromise[_0x4815('0x64')]()[_0x4815('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4815('0x13')](',');return db['CmContact'][_0x4815('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5e0fff){var _0x2abbcc=fs[_0x4815('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2abbcc,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1042d5,_0x5ebd50){total+=0x1;var _0x1ee95c=total;promises['push'](checkRow(_0x1042d5,_0x5e0fff,_0x1ee95c)['then'](function(){success+=0x1;})[_0x4815('0x2e')](function(_0x4bbad){if(_0x4bbad[_0x4815('0x15')]){errors+=0x1;delete _0x4bbad[_0x4815('0x15')];}else if(_0x4bbad['duplicate']){duplicates+=0x1;delete _0x4bbad['duplicate'];}rows[_0x4815('0x56')](_0x4bbad);}));if(total%0xc8===0x0){_0x5ebd50[_0x4815('0x6d')]();return processPromises(_0x5ebd50);}},'complete':function(){return processPromises()[_0x4815('0x2c')](function(){logger[_0x4815('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x33e42a,_0x16dc47){logger[_0x4815('0x6a')](_0x4815('0x6e'),JSON[_0x4815('0x30')](_0x33e42a));endCsv();}});})['catch'](function(_0x24fdc3){logger[_0x4815('0x15')](_0x4815('0x6f'),JSON[_0x4815('0x30')](_0x24fdc3));});}main(); \ No newline at end of file +var _0xe4e2=['checkHopper','inspect','into','cm_hopper','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','insert','fromQuery','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','findAll','CmList','BlackLists','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','contact:csv_','emit','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','register','undefined','null','Missing\x20filepath\x20parameter!','argv','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e2,0x1e6));var _0x2e4e=function(_0x16fe4a,_0x566bcd){_0x16fe4a=_0x16fe4a-0x0;var _0x26a2bd=_0xe4e2[_0x16fe4a];return _0x26a2bd;};'use strict';var BPromise=require(_0x2e4e('0x0'));var util=require('util');var _=require(_0x2e4e('0x1'));var fs=require('fs');var squel=require(_0x2e4e('0x2'));var Papa=require(_0x2e4e('0x3'));var Redis=require(_0x2e4e('0x4'));var db=require(_0x2e4e('0x5'))['db'];var config=require(_0x2e4e('0x6'));var logger=require(_0x2e4e('0x7'))(_0x2e4e('0x8'));config[_0x2e4e('0x9')]=_[_0x2e4e('0xa')](config[_0x2e4e('0x9')],{'host':_0x2e4e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e4e('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x2e4e('0xc')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x2e4e('0xd')||process['argv'][0x2]===_0x2e4e('0xe')){throw new Error(_0x2e4e('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0x2e4e('0x10')][0x3]||process[_0x2e4e('0x10')][0x3]===_0x2e4e('0xd')||process['argv'][0x3]===_0x2e4e('0xe')||!process[_0x2e4e('0x10')][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0x2e4e('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process['argv'][0x3][_0x2e4e('0x11')](','),process[_0x2e4e('0x10')][0x4][_0x2e4e('0x11')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x2e4e('0xd')||process[_0x2e4e('0x10')][0x5]==='null'){throw new Error(_0x2e4e('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x2e4e('0x10')][0x6]&&process[_0x2e4e('0x10')][0x6]!==_0x2e4e('0xd')&&process[_0x2e4e('0x10')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x2e4e('0x10')][0x7]&&process[_0x2e4e('0x10')][0x7]!==_0x2e4e('0xd')&&process[_0x2e4e('0x10')][0x7]!==_0x2e4e('0xe')?process[_0x2e4e('0x10')][0x7]:null;if(!process[_0x2e4e('0x10')][0x8]||process['argv'][0x8]===_0x2e4e('0xd')||process['argv'][0x8]===_0x2e4e('0xe')){throw new Error(_0x2e4e('0x13'));}var SOCKET_TIMESTAMP=process[_0x2e4e('0x10')][0x8];}catch(_0x130039){logger[_0x2e4e('0x14')](_0x130039);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(_0x28321b,_0x56d9fb,_0x2686a2,_0x582a2a){var _0x2fcf1a={'message':_0x56d9fb};_0x2fcf1a[_0x28321b]=!![];if(_0x2686a2){_0x2fcf1a[_0x2e4e('0x15')]=_0x2686a2;}if(_0x582a2a){_0x2fcf1a['index']=_0x582a2a;}return _0x2fcf1a;}function isEmail(_0x1ce633){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))*$/[_0x2e4e('0x16')](_0x1ce633);}function checkRow(_0x35cb3c,_0x30301c,_0x5d8e8f){return new BPromise(function(_0x3f8505,_0xa374b0){if(_['isNil'](_0x35cb3c)){return _0xa374b0(handleCheckRowError(_0x2e4e('0x14'),_0x2e4e('0x17'),null,_0x5d8e8f));}if(_0x35cb3c['errors']&&_0x35cb3c[_0x2e4e('0x18')]['length']){var _0x216868=_[_0x2e4e('0x19')](_0x35cb3c[_0x2e4e('0x18')],_0x2e4e('0x1a'))['join'](';');return _0xa374b0(handleCheckRowError(_0x2e4e('0x14'),_0x216868,null,_0x5d8e8f));}var _0x49cecc={};for(var _0x2b111c in FIELDS){if(FIELDS[_0x2e4e('0x1b')](_0x2b111c)&&FIELDS[_0x2b111c]){_0x49cecc[_0x2b111c]=_0x35cb3c[_0x2e4e('0x1c')][0x0][FIELDS[_0x2b111c]]||_0x35cb3c[_0x2e4e('0x1c')][0x0]['\ufeff'+FIELDS[_0x2b111c]];}}if(!_0x49cecc[_0x2e4e('0x1d')]){return _0xa374b0(handleCheckRowError(_0x2e4e('0x14'),'firstName\x20not\x20specified!',null,_0x5d8e8f));}if(!_0x49cecc[_0x2e4e('0x1e')]){return _0xa374b0(handleCheckRowError('error',_0x2e4e('0x1f'),null,_0x5d8e8f));}if(_0x49cecc[_0x2e4e('0x20')]){var _0x519814=moment(_0x49cecc[_0x2e4e('0x20')],_0x2e4e('0x21'));if(!_0x519814[_0x2e4e('0x22')]()){return _0xa374b0(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5d8e8f));}}if(_0x49cecc[_0x2e4e('0x23')]){if(!isEmail(_0x49cecc['email'])){return _0xa374b0(handleCheckRowError(_0x2e4e('0x14'),_0x2e4e('0x24'),null,_0x5d8e8f));}}_0x49cecc[_0x2e4e('0x25')]=LISTID;_0x49cecc[_0x2e4e('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x2e4e('0x27')]&&_0x30301c){var _0x38b4b8={};for(var _0x24c69d=0x0,_0x1e4ad1=DUPLICATES['length'];_0x24c69d<_0x1e4ad1;_0x24c69d+=0x1){_0x38b4b8[DUPLICATES[_0x24c69d]]=_0x49cecc[DUPLICATES[_0x24c69d]];}var _0x3aa482=_[_0x2e4e('0x28')](_0x30301c,_0x38b4b8);if(_0x3aa482){return _0xa374b0(handleCheckRowError(_0x2e4e('0x29'),'Duplicate\x20Contact',_0x3aa482,_0x5d8e8f));}}return db[_0x2e4e('0x2a')]['create'](_0x49cecc,{'raw':!![],'hooks':![],'fields':_['keys'](_0x49cecc)})[_0x2e4e('0x2b')](function(_0x3afee2){if(DUPLICATES&&DUPLICATES[_0x2e4e('0x27')]&&_0x30301c){_0x30301c[_0x2e4e('0x2c')](_[_0x2e4e('0x2d')](_0x49cecc,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3afee2['id'];return _0x3f8505();})[_0x2e4e('0x2e')](function(_0x433d73){return _0xa374b0(handleCheckRowError(_0x2e4e('0x14'),_0x2e4e('0x2f')+(_0x433d73[_0x2e4e('0x1a')]||JSON['stringify'](_0x433d73)),null,_0x5d8e8f));});});}function checkHopper(){function _0x598f87(){return function(_0x5267d2){logger[_0x2e4e('0x14')](_0x2e4e('0x30'),_0x2e4e('0x31'),util[_0x2e4e('0x32')](_0x5267d2,{'showHidden':![],'depth':null}));};}var _0x5f4084=function(_0x660809,_0xa748){var _0x23a5a9=squel['insert']()[_0x2e4e('0x33')](_0x2e4e('0x34'))['fromQuery']([_0x2e4e('0x1e'),_0x2e4e('0x35'),_0x2e4e('0x36'),_0x2e4e('0x25'),_0xa748,_0x2e4e('0x37'),_0x2e4e('0x38')],squel[_0x2e4e('0x39')]()[_0x2e4e('0x3a')](_0x2e4e('0x1e'),'phone')[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x35'))[_0x2e4e('0x3a')]('id',_0x2e4e('0x36'))[_0x2e4e('0x3a')](LISTID[_0x2e4e('0x3c')](),_0x2e4e('0x25'))[_0x2e4e('0x3a')](_0x660809['id'][_0x2e4e('0x3c')](),_0xa748)[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x37'))['field'](_0x2e4e('0x3b'),_0x2e4e('0x38'))[_0x2e4e('0x3d')](_0x2e4e('0x3e'))[_0x2e4e('0x3f')](_0x2e4e('0x40'))[_0x2e4e('0x3f')](_0x2e4e('0x41'),LISTID[_0x2e4e('0x3c')]())[_0x2e4e('0x3f')](_0x2e4e('0x42'))[_0x2e4e('0x3f')](_0x2e4e('0x43'),squel[_0x2e4e('0x39')]()['field']('phone')['from']('cm_hopper')[_0x2e4e('0x3f')](_0xa748+'\x20=\x20?',_0x660809['id'][_0x2e4e('0x3c')]())))['toString']();return _0x23a5a9;};var _0x34c76d=function(_0x165137,_0x597151){var _0xfa0d85=squel[_0x2e4e('0x44')]()[_0x2e4e('0x33')]('cm_hopper')[_0x2e4e('0x45')]([_0x2e4e('0x1e'),'scheduledAt','ContactId',_0x2e4e('0x25'),_0x597151,_0x2e4e('0x37'),_0x2e4e('0x38')],squel[_0x2e4e('0x39')]()[_0x2e4e('0x3a')](_0x2e4e('0x1e'),_0x2e4e('0x1e'))[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x35'))[_0x2e4e('0x3a')]('id',_0x2e4e('0x36'))[_0x2e4e('0x3a')](LISTID[_0x2e4e('0x3c')](),_0x2e4e('0x25'))[_0x2e4e('0x3a')](_0x165137['id'][_0x2e4e('0x3c')](),_0x597151)[_0x2e4e('0x3a')](_0x2e4e('0x3b'),'createdAt')[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x38'))[_0x2e4e('0x3d')](_0x2e4e('0x3e'))['where'](_0x2e4e('0x40'))[_0x2e4e('0x3f')](_0x2e4e('0x41'),LISTID[_0x2e4e('0x3c')]())['where'](_0x2e4e('0x46'),squel[_0x2e4e('0x47')](hopperContacts))[_0x2e4e('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x2e4e('0x3f')](_0x2e4e('0x43'),squel['select']()[_0x2e4e('0x3a')]('calleridnum')['from'](_0x2e4e('0x48'))[_0x2e4e('0x3f')](_0x597151+'\x20=\x20?',_0x165137['id'][_0x2e4e('0x3c')]()))[_0x2e4e('0x3f')](_0x2e4e('0x43'),squel[_0x2e4e('0x39')]()['field'](_0x2e4e('0x1e'))[_0x2e4e('0x3d')](_0x2e4e('0x34'))[_0x2e4e('0x3f')](_0x597151+_0x2e4e('0x49'),_0x165137['id']['toString']())))['toString']();return _0xfa0d85;};function _0x2686d6(_0x34ff87,_0x202de7){var _0x8f4629=squel[_0x2e4e('0x44')]()[_0x2e4e('0x33')]('cm_hopper')['fromQuery']([_0x2e4e('0x1e'),_0x2e4e('0x35'),_0x2e4e('0x36'),_0x2e4e('0x25'),_0x202de7,_0x2e4e('0x37'),_0x2e4e('0x38')],squel[_0x2e4e('0x39')]()[_0x2e4e('0x3a')](_0x2e4e('0x1e'),_0x2e4e('0x1e'))[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x35'))[_0x2e4e('0x3a')]('id',_0x2e4e('0x36'))[_0x2e4e('0x3a')](LISTID[_0x2e4e('0x3c')](),_0x2e4e('0x25'))[_0x2e4e('0x3a')](_0x34ff87['id'][_0x2e4e('0x3c')](),_0x202de7)[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x37'))[_0x2e4e('0x3a')](_0x2e4e('0x3b'),_0x2e4e('0x38'))[_0x2e4e('0x3d')](_0x2e4e('0x3e'))[_0x2e4e('0x3f')](_0x2e4e('0x40'))['where'](_0x2e4e('0x41'),LISTID[_0x2e4e('0x3c')]())[_0x2e4e('0x3f')](_0x2e4e('0x46'),squel[_0x2e4e('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2e4e('0x3c')]();return _0x8f4629;}function _0x4eb92c(_0x32c5e3,_0x4fae1d){var _0x40bb8e=squel[_0x2e4e('0x44')]()[_0x2e4e('0x33')](_0x2e4e('0x4a'))[_0x2e4e('0x45')](['phone',_0x2e4e('0x36'),'ListId',_0x4fae1d,_0x2e4e('0x37'),_0x2e4e('0x38')],squel[_0x2e4e('0x39')]()[_0x2e4e('0x3a')](_0x2e4e('0x1e'),_0x2e4e('0x1e'))['field']('id','ContactId')[_0x2e4e('0x3a')](LISTID['toString'](),_0x2e4e('0x25'))['field'](_0x32c5e3['id'][_0x2e4e('0x3c')](),_0x4fae1d)['field'](_0x2e4e('0x3b'),_0x2e4e('0x37'))[_0x2e4e('0x3a')]('NOW()',_0x2e4e('0x38'))[_0x2e4e('0x3d')](_0x2e4e('0x3e'))[_0x2e4e('0x3f')](_0x2e4e('0x40'))[_0x2e4e('0x3f')](_0x2e4e('0x41'),LISTID[_0x2e4e('0x3c')]())['where'](_0x2e4e('0x46'),squel[_0x2e4e('0x47')](hopperContacts))[_0x2e4e('0x3f')](_0x2e4e('0x42')))[_0x2e4e('0x3c')]();return _0x40bb8e;}return db[_0x2e4e('0x4b')]['findAll']({'where':{'type':_0x2e4e('0x4c')},'attributes':['id',_0x2e4e('0x4d')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x43e36b){var _0xeb7b73=[];if(_0x43e36b){var _0x2980d0;for(var _0x36fb37=0x0,_0x12d346;_0x36fb37<_0x43e36b[_0x2e4e('0x27')];_0x36fb37+=0x1){_0x12d346=_0x43e36b[_0x36fb37][_0x2e4e('0x4e')]({'plain':!![]});switch(_0x12d346[_0x2e4e('0x4d')]){case _0x2e4e('0x4f'):_0xeb7b73['push'](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x34c76d(_0x12d346,'VoiceQueueId'))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));break;case _0x2e4e('0x52'):_0xeb7b73[_0x2e4e('0x2c')](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x5f4084(_0x12d346,_0x2e4e('0x53')))['then'](function(){})[_0x2e4e('0x2e')](_0x598f87()));break;default:_0xeb7b73[_0x2e4e('0x2c')](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x2686d6(_0x12d346,_0x2e4e('0x53')))['then'](function(){})[_0x2e4e('0x2e')](_0x598f87()));}}}return _0xeb7b73;})[_0x2e4e('0x54')]()[_0x2e4e('0x2b')](function(){return db[_0x2e4e('0x4b')][_0x2e4e('0x55')]({'where':{'type':_0x2e4e('0x4c')},'attributes':['id'],'include':[{'model':db[_0x2e4e('0x56')],'as':_0x2e4e('0x57'),'where':{'id':LISTID}}]})[_0x2e4e('0x2b')](function(_0x5a0d68){var _0x37d074=[];if(_0x5a0d68){var _0x19803f;for(var _0x32d470=0x0,_0x5788f2;_0x32d470<_0x5a0d68[_0x2e4e('0x27')];_0x32d470+=0x1){_0x5788f2=_0x5a0d68[_0x32d470][_0x2e4e('0x4e')]({'plain':!![]});_0x37d074['push'](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x4eb92c(_0x5788f2,_0x2e4e('0x53')))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));}}return _0x37d074;})[_0x2e4e('0x54')]();})[_0x2e4e('0x2b')](function(){return db[_0x2e4e('0x58')][_0x2e4e('0x55')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x2e4e('0x56')],'as':_0x2e4e('0x59'),'where':{'id':LISTID}}]})[_0x2e4e('0x2b')](function(_0x53fdfc){var _0x2582dc=[];if(_0x53fdfc){for(var _0xe8dbc6=0x0,_0x5a79f4;_0xe8dbc6<_0x53fdfc['length'];_0xe8dbc6+=0x1){_0x5a79f4=_0x53fdfc[_0xe8dbc6][_0x2e4e('0x4e')]({'plain':!![]});switch(_0x5a79f4[_0x2e4e('0x4d')]){case _0x2e4e('0x4f'):_0x2582dc[_0x2e4e('0x2c')](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x34c76d(_0x5a79f4,_0x2e4e('0x5a')))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));break;case'onlyIfOpen':_0x2582dc[_0x2e4e('0x2c')](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x5f4084(_0x5a79f4,'CampaignId'))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));break;default:_0x2582dc[_0x2e4e('0x2c')](db[_0x2e4e('0x50')][_0x2e4e('0x51')](_0x2686d6(_0x5a79f4,'CampaignId'))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));}}}return _0x2582dc;})[_0x2e4e('0x54')]();})[_0x2e4e('0x2b')](function(){return db[_0x2e4e('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x2e4e('0x56')],'as':_0x2e4e('0x57'),'where':{'id':LISTID}}]})[_0x2e4e('0x2b')](function(_0x189fb3){var _0x5a4d33=[];if(_0x189fb3){for(var _0x406e4b=0x0,_0x3dba72;_0x406e4b<_0x189fb3[_0x2e4e('0x27')];_0x406e4b+=0x1){_0x3dba72=_0x189fb3[_0x406e4b]['get']({'plain':!![]});_0x5a4d33['push'](db['sequelize'][_0x2e4e('0x51')](_0x4eb92c(_0x3dba72,_0x2e4e('0x5a')))[_0x2e4e('0x2b')](function(){})[_0x2e4e('0x2e')](_0x598f87()));}}return _0x5a4d33;})['all']();})[_0x2e4e('0x2e')](function(_0x16d99c){logger[_0x2e4e('0x14')](_0x2e4e('0x5b'),_0x2e4e('0x5c'),_0x16d99c[_0x2e4e('0x1a')]);});}var processPromises=function(_0x44ae90){return BPromise[_0x2e4e('0x54')](promises)['then'](function(_0x1f345b){})['catch'](function(_0x5ce85b){logger[_0x2e4e('0x14')](_0x2e4e('0x5d'),JSON[_0x2e4e('0x5e')](_0x5ce85b));})['finally'](function(){socket['emit'](_0x2e4e('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x44ae90){return _0x44ae90['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0x2e4e('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x2e4e('0x2b')](function(){socket[_0x2e4e('0x60')](_0x2e4e('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x2e4e('0x61')](FILEPATH);}catch(_0x32a5bc){logger[_0x2e4e('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x32a5bc));}finally{process[_0x2e4e('0x62')](0x0);}});};process['on'](_0x2e4e('0x63'),function(){logger[_0x2e4e('0x64')](_0x2e4e('0x65'));endCsv();});function main(){return BPromise[_0x2e4e('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x2e4e('0x11')](',');return db[_0x2e4e('0x2a')][_0x2e4e('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x31d9a8){var _0x55af6a=fs[_0x2e4e('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55af6a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1449fd,_0xa80b98){total+=0x1;var _0x2d57c6=total;promises[_0x2e4e('0x2c')](checkRow(_0x1449fd,_0x31d9a8,_0x2d57c6)[_0x2e4e('0x2b')](function(){success+=0x1;})['catch'](function(_0x40639d){if(_0x40639d['error']){errors+=0x1;delete _0x40639d[_0x2e4e('0x14')];}else if(_0x40639d[_0x2e4e('0x29')]){duplicates+=0x1;delete _0x40639d[_0x2e4e('0x29')];}rows[_0x2e4e('0x2c')](_0x40639d);}));if(total%0xc8===0x0){_0xa80b98[_0x2e4e('0x68')]();return processPromises(_0xa80b98);}},'complete':function(){return processPromises()['then'](function(){logger[_0x2e4e('0x64')](_0x2e4e('0x69'));endCsv();});},'error':function(_0x455929,_0x210c8a){logger[_0x2e4e('0x64')](_0x2e4e('0x6a'),JSON[_0x2e4e('0x5e')](_0x455929));endCsv();}});})[_0x2e4e('0x2e')](function(_0x371f85){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x2e4e('0x5e')](_0x371f85));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 8834eba..050a5b7 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 _0x6a56=['catch','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','select','phone','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fromQuery','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','concat','insert',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','error','message','exit','errors','code','sequelize','spread','push','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','keys','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','appendFileSync','contact:import:','Abort\x20parser','abort','cm_contacts_','\x20LIKE\x20cm_contacts;',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','then','finish','affectedRows','unlink'];(function(_0x5e2eb5,_0x3f4e6c){var _0x180baf=function(_0x3e97d1){while(--_0x3e97d1){_0x5e2eb5['push'](_0x5e2eb5['shift']());}};_0x180baf(++_0x3f4e6c);}(_0x6a56,0x10e));var _0x66a5=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x6a56[_0x200827];return _0x120047;};'use strict';var fs=require('fs');var path=require(_0x66a5('0x0'));var _=require('lodash');var Papa=require(_0x66a5('0x1'));var util=require(_0x66a5('0x2'));var BPromise=require('bluebird');var moment=require(_0x66a5('0x3'));var squel=require(_0x66a5('0x4'));var Redis=require(_0x66a5('0x5'));var db=require(_0x66a5('0x6'))['db'];var config=require(_0x66a5('0x7'));var logger=require(_0x66a5('0x8'))(_0x66a5('0x9'));config[_0x66a5('0xa')]=_[_0x66a5('0xb')](config['redis'],{'host':_0x66a5('0xc'),'port':0x18eb});var socket=require(_0x66a5('0xd'))(new Redis(config[_0x66a5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x66a5('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x47f207){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))*$/[_0x66a5('0xf')](_0x47f207);}function selectNotIn(_0x4e5a16,_0x28b101,_0x140d1f,_0x17bdf4,_0x515256){return squel[_0x66a5('0x10')]()['field'](_0x66a5('0x11'))['from'](_0x17bdf4)['join'](_0x28b101,null,_0x28b101+_0x66a5('0x12')+_0x17bdf4+'.'+_0x140d1f)[_0x66a5('0x13')](_0x17bdf4+'.'+_0x140d1f+_0x66a5('0x14')+_0x4e5a16+'.'+_0x140d1f)[_0x66a5('0x13')](_0x28b101+'.dialCheckDuplicateType\x20IN\x20('+_0x515256[_0x66a5('0x15')]()+')');}function insertCmHopper(_0x4ccfe0,_0x360cb7,_0x3392ef,_0x5be508,_0x3388eb){var _0x45c507=['cm_contacts.phone',_0x66a5('0x16'),_0x66a5('0x17'),_0x66a5('0x18'),_0x360cb7+'.'+_0x5be508,_0x66a5('0x19'),_0x66a5('0x1a'),_0x66a5('0x1b'),_0x66a5('0x1c'),'\x22'+_0x3388eb+'\x22'];return squel['insert']()[_0x66a5('0x1d')](_0x66a5('0x1e'))['fromQuery']([_0x66a5('0x11'),_0x66a5('0x1f'),_0x66a5('0x20'),_0x66a5('0x21'),_0x5be508,_0x66a5('0x22'),_0x66a5('0x23'),_0x66a5('0x24'),_0x66a5('0x25'),'recallme'],squel[_0x66a5('0x10')]()[_0x66a5('0x26')](_0x45c507)[_0x66a5('0x27')](_0x360cb7)[_0x66a5('0x15')](_0x66a5('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x360cb7+'.CmListId')[_0x66a5('0x15')](_0x3392ef,null,_0x3392ef+_0x66a5('0x12')+_0x360cb7+'.'+_0x5be508)[_0x66a5('0x13')](_0x360cb7+_0x66a5('0x29'),_0x4ccfe0)[_0x66a5('0x13')](_0x66a5('0x2a'),NOW)['where'](_0x66a5('0x2b'),selectNotIn(_0x360cb7,_0x3392ef,_0x5be508,_0x66a5('0x1e'),[_0x66a5('0x2c'),_0x66a5('0x2d')]))['where'](_0x66a5('0x2b'),selectNotIn(_0x360cb7,_0x3392ef,_0x5be508,_0x66a5('0x1e'),[_0x66a5('0x2c')])))[_0x66a5('0x2e')]();}function insertCmHopperBlack(_0x398285,_0x5bfc62,_0x482c5d,_0x149136){var _0xe74578=['cm_contacts.phone','cm_contacts.id',_0x66a5('0x18'),_0x5bfc62+'.'+_0x149136,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0x66a5('0x1d')](_0x66a5('0x2f'))[_0x66a5('0x30')]([_0x66a5('0x11'),_0x66a5('0x20'),_0x66a5('0x21'),_0x149136,'createdAt',_0x66a5('0x23')],squel[_0x66a5('0x10')]()[_0x66a5('0x26')](_0xe74578)[_0x66a5('0x27')](_0x5bfc62)[_0x66a5('0x15')](_0x66a5('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x5bfc62+_0x66a5('0x31'))[_0x66a5('0x15')](_0x482c5d,null,_0x482c5d+'.id\x20=\x20'+_0x5bfc62+'.'+_0x149136)[_0x66a5('0x13')](_0x5bfc62+_0x66a5('0x29'),_0x398285)[_0x66a5('0x13')](_0x66a5('0x2a'),NOW)['where'](_0x66a5('0x2b'),squel[_0x66a5('0x10')]()[_0x66a5('0x32')]('phone')[_0x66a5('0x27')](_0x66a5('0x2f'))[_0x66a5('0x13')](_0x66a5('0x33'),_0x398285)[_0x66a5('0x13')](_0x149136+_0x66a5('0x34'),_0x5bfc62+'.'+_0x149136)))[_0x66a5('0x2e')]();}function insertCmContact(_0x1ea4bf,_0x5f5d72,_0x1be312,_0x1babad){var _0x573a6f=_[_0x66a5('0x35')](_['keys'](_0x1babad),[_0x66a5('0x21'),'CompanyId',_0x66a5('0x22'),_0x66a5('0x23')]);return squel[_0x66a5('0x36')]()[_0x66a5('0x1d')]('cm_contacts')[_0x66a5('0x30')](_0x573a6f,squel[_0x66a5('0x10')]()[_0x66a5('0x26')](_0x573a6f)['from'](_0x5f5d72)['where']('('+_0x1be312[_0x66a5('0x15')](',')+_0x66a5('0x37'),squel['select']()[_0x66a5('0x26')](_0x1be312)['from'](_0x66a5('0x28'))[_0x66a5('0x13')]('ListId\x20=\x20?',_0x1ea4bf)[_0x66a5('0x13')]('deletedAt\x20IS\x20NULL'))['where']('id\x20IN\x20?',squel[_0x66a5('0x10')]()[_0x66a5('0x32')](_0x66a5('0x38'),_0x66a5('0x39'))['from'](_0x5f5d72)[_0x66a5('0x3a')](_0x1be312[_0x66a5('0x15')](','))))[_0x66a5('0x2e')]();}function handleStop(){logger[_0x66a5('0x3b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1308e4){logger[_0x66a5('0x3c')](_0x1308e4[_0x66a5('0x3d')]);process[_0x66a5('0x3e')](0x1);}function handleError(_0x32d3a9,_0x3348a8){stats[_0x66a5('0x3f')]['push']({'name':_0x3348a8[_0x66a5('0x40')],'message':_0x3348a8[_0x66a5('0x3d')],'row':_0x32d3a9});}function handleQuery(_0x58e3d1){logger[_0x66a5('0x3b')](_0x58e3d1);return db[_0x66a5('0x41')]['query'](_0x58e3d1)[_0x66a5('0x42')](function(_0x2114f6){results[_0x66a5('0x43')](_0x2114f6);})['catch'](function(_0x50e6b9){logger[_0x66a5('0x3c')](_0x50e6b9[_0x66a5('0x3d')]);});}function main(_0x33551a,_0x37f300,_0x2b51e1,_0x3287bf){logger[_0x66a5('0x3b')](_0x66a5('0x44'),_0x33551a,JSON[_0x66a5('0x45')](_0x37f300));process[_0x66a5('0x46')]('start');var _0x424801=_0x37f300[_0x66a5('0x47')];var _0x2fcd8d=_0x37f300[_0x66a5('0x48')];var _0x1a286a=path[_0x66a5('0x15')](config[_0x66a5('0x49')],_0x66a5('0x4a'),_0x2fcd8d+'.csv');var _0x334112=_[_0x66a5('0x4b')](_0x424801)[_0x66a5('0x15')]();logger[_0x66a5('0x3b')]('header',_0x334112);fs[_0x66a5('0x4c')](_0x1a286a,_0x334112+'\x0a');Papa[_0x66a5('0x4d')](fs[_0x66a5('0x4e')](_0x33551a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x553f6f,_0x5734a0){try{for(var _0x4ea5dc=0x0,_0x33a611=[];_0x4ea5dc<_0x553f6f[_0x66a5('0x4f')][_0x66a5('0x50')];_0x4ea5dc++){stats[_0x66a5('0x51')]+=0x1;if(_0x553f6f[_0x66a5('0x3f')][_0x4ea5dc]){handleError(_0x553f6f[_0x66a5('0x4f')][_0x4ea5dc],_0x553f6f[_0x66a5('0x3f')][_0x4ea5dc]);}else{var _0x4f57f0=[];for(var _0x2424c4 in _0x424801){if(_0x424801[_0x66a5('0x52')](_0x2424c4)){if(_0x553f6f[_0x66a5('0x4f')][_0x4ea5dc][_0x424801[_0x2424c4]]){var _0xbf7d47=_[_0x66a5('0x53')](_0x553f6f[_0x66a5('0x4f')][_0x4ea5dc][_0x424801[_0x2424c4]]['replace'](/"/g,'\x27'));switch(_0x2424c4){case _0x66a5('0x1f'):var _0x107d0c=moment(_0xbf7d47,_0x66a5('0x54'),!![]);if(_0x107d0c[_0x66a5('0x55')]()){_0x33a611['push']('\x22'+_0xbf7d47+'\x22');}else{_0x4f57f0[_0x66a5('0x43')](_0x66a5('0x56'));}break;case _0x66a5('0x24'):var _0x2f9b15=parseInt(_0xbf7d47);_0xbf7d47=_[_0x66a5('0x57')](_0x2f9b15)||_0x2f9b15<0x0||_0x2f9b15>0x4?_0x3287bf?0x3:0x2:_0x2f9b15;_0x33a611['push']('\x22'+_0xbf7d47+'\x22');break;case _0x66a5('0x25'):var _0x48734d=parseInt(_0xbf7d47);if(_[_0x66a5('0x58')](_0x48734d)&&_[_0x66a5('0x59')](_0x2b51e1,_0x48734d)){_0x33a611[_0x66a5('0x43')]('\x22'+_0x48734d+'\x22');}else{_0x4f57f0[_0x66a5('0x43')](_0x66a5('0x5a'));}break;case'email':if(isEmail(_0xbf7d47)){_0x33a611[_0x66a5('0x43')]('\x22'+_0xbf7d47+'\x22');}else{_0x4f57f0[_0x66a5('0x43')]('email\x20wrong\x20format');}break;case _0x66a5('0x5b'):var _0x23f7ce=moment(_0xbf7d47,_0x66a5('0x5c'),!![]);if(_0x23f7ce['isValid']()){_0x33a611['push']('\x22'+_0xbf7d47+'\x22');}else{_0x4f57f0[_0x66a5('0x43')](_0x66a5('0x5d'));}break;default:_0x33a611['push']('\x22'+_0xbf7d47+'\x22');}}else{switch(_0x2424c4){case'firstName':case'phone':_0x4f57f0[_0x66a5('0x43')](_0x2424c4+'\x20not\x20specified');break;default:_0x33a611[_0x66a5('0x43')]('\x22\x22');}}}}if(_0x4f57f0[_0x66a5('0x50')]){handleError(_0x553f6f[_0x66a5('0x4f')][_0x4ea5dc],{'code':'SystemRow','message':_0x4f57f0[_0x66a5('0x15')]()});}else{fs[_0x66a5('0x5e')](_0x1a286a,_0x33a611['join']()+'\x0a');}_0x33a611=[];}if(!(stats[_0x66a5('0x51')]%0xc8)){socket['emit'](_0x66a5('0x5f')+_0x2fcd8d,stats);stats[_0x66a5('0x3f')]=[];}}if(stopped){logger[_0x66a5('0x3b')](_0x66a5('0x60'));_0x5734a0[_0x66a5('0x61')]();}}catch(_0x56f225){handleError(_0x553f6f[_0x66a5('0x4f')][_0x4ea5dc],{'code':'SystemError','message':_0x56f225[_0x66a5('0x3d')]});logger[_0x66a5('0x3c')]('step',_0x56f225['message']);}},'complete':function(){try{var _0x37459d=[];var _0x4b9851='cm_contacts';if(_0x37f300['duplicates']&&_0x37f300['duplicates'][_0x66a5('0x50')]){_0x4b9851=_0x66a5('0x62')+_0x2fcd8d;_0x37459d['push']('CREATE\x20TABLE\x20'+_0x4b9851+_0x66a5('0x63'));}var _0x1f7005=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x1a286a,_0x4b9851,_0x334112,_0x37f300[_0x66a5('0x21')],_0x37f300['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x424801[_0x66a5('0x1f')])){_0x1f7005+=_0x66a5('0x64');}_0x37459d[_0x66a5('0x43')](_0x1f7005);if(_0x37f300[_0x66a5('0x65')]&&_0x37f300['duplicates'][_0x66a5('0x50')]){_0x37459d['push'](insertCmContact(_0x37f300[_0x66a5('0x21')],_0x4b9851,_0x37f300['duplicates'],_0x424801));_0x37459d[_0x66a5('0x43')](_0x66a5('0x66')+_0x4b9851+';');}_0x37459d[_0x66a5('0x43')](insertCmHopper(_0x37f300[_0x66a5('0x21')],_0x66a5('0x67'),_0x66a5('0x68'),_0x66a5('0x69'),_0x3287bf));_0x37459d[_0x66a5('0x43')](insertCmHopperBlack(_0x37f300[_0x66a5('0x21')],_0x66a5('0x6a'),_0x66a5('0x68'),_0x66a5('0x69')));_0x37459d[_0x66a5('0x43')](insertCmHopper(_0x37f300[_0x66a5('0x21')],_0x66a5('0x6b'),_0x66a5('0x6c'),_0x66a5('0x6d'),_0x3287bf));_0x37459d[_0x66a5('0x43')](insertCmHopperBlack(_0x37f300[_0x66a5('0x21')],'campaigns_has_cm_blacklists',_0x66a5('0x6c'),_0x66a5('0x6d')));BPromise['each'](_0x37459d,handleQuery)[_0x66a5('0x6e')](function(_0x1d7eb9){stats[_0x66a5('0x6f')]=!![];stats[_0x66a5('0x70')]=_0x37f300[_0x66a5('0x65')]&&_0x37f300[_0x66a5('0x65')][_0x66a5('0x50')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x66a5('0x5f')+_0x2fcd8d,stats);fs[_0x66a5('0x71')](_0x33551a);fs[_0x66a5('0x71')](_0x1a286a);process[_0x66a5('0x3e')](0x0);})[_0x66a5('0x72')](function(_0x3f109c){logger['error'](_0x3f109c[_0x66a5('0x3d')]);process[_0x66a5('0x3e')](0x1);});}catch(_0x395f17){logger[_0x66a5('0x3c')](_0x66a5('0x73'),_0x395f17['message']);process[_0x66a5('0x3e')](0x1);}},'error':function(_0x3efe51,_0x5352ca,_0xb4473a,_0x4afe3f){throw new Error(_0x4afe3f);}});}function validate(){if(process['argv']&&process[_0x66a5('0x74')][_0x66a5('0x50')]<0x4){throw new Error(_0x66a5('0x75'));}var _0x33a472=path[_0x66a5('0x15')](config[_0x66a5('0x49')],_0x66a5('0x4a'),process[_0x66a5('0x74')][0x2]);if(!fs[_0x66a5('0x76')](_0x33a472)){throw new Error(_0x66a5('0x77'));}var _0x4b04e7={};try{_0x4b04e7=JSON[_0x66a5('0x4d')](process[_0x66a5('0x74')][0x3]);if(!_0x4b04e7[_0x66a5('0x47')]){throw new Error(_0x66a5('0x78'));}if(!_0x4b04e7['binding'][_0x66a5('0x11')]){throw new Error(_0x66a5('0x79'));}if(!_0x4b04e7[_0x66a5('0x47')][_0x66a5('0x7a')]){throw new Error(_0x66a5('0x7b'));}var _0xdb7b24=0x0;if(_0x4b04e7[_0x66a5('0x47')][_0x66a5('0x25')]){_0xdb7b24=0x1;}if(!_0x4b04e7[_0x66a5('0x21')]){throw new Error(_0x66a5('0x7c'));}}catch(_0x386055){throw new Error('body\x20id\x20mandatory');}var _0x45c03e=[];try{_0x45c03e=_[_0x66a5('0x7d')](JSON[_0x66a5('0x4d')](process[_0x66a5('0x74')][0x4]),'id');}catch(_0x3b3fe6){logger['info']('No\x20agent\x20available');}main(_0x33a472,_0x4b04e7,_0x45c03e,_0xdb7b24);}validate();process['on'](_0x66a5('0x7e'),handleStop);process['on'](_0x66a5('0x7f'),handleUncaughtException); \ No newline at end of file +var _0x978a=['campaigns','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_hopper_black','ListId','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','select','ListId\x20=\x20?','\x20=\x20?','CompanyId','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','send','start','binding','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','trim','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','appendFileSync','rows','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns_has_cm_blacklists'];(function(_0x24c44e,_0x5996c3){var _0x5dbf9f=function(_0x3ea63e){while(--_0x3ea63e){_0x24c44e['push'](_0x24c44e['shift']());}};_0x5dbf9f(++_0x5996c3);}(_0x978a,0x93));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0xa978('0x0'));var _=require(_0xa978('0x1'));var Papa=require(_0xa978('0x2'));var util=require(_0xa978('0x3'));var BPromise=require(_0xa978('0x4'));var moment=require(_0xa978('0x5'));var squel=require('squel');var Redis=require(_0xa978('0x6'));var db=require(_0xa978('0x7'))['db'];var config=require(_0xa978('0x8'));var logger=require(_0xa978('0x9'))(_0xa978('0xa'));config['redis']=_['defaults'](config[_0xa978('0xb')],{'host':_0xa978('0xc'),'port':0x18eb});var socket=require(_0xa978('0xd'))(new Redis(config[_0xa978('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa978('0xe')](_0xa978('0xf'));function isEmail(_0x2a6ce7){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))*$/[_0xa978('0x10')](_0x2a6ce7);}function selectNotIn(_0x5c7af3,_0x460c3e,_0x21ae97,_0x3520b0,_0xdd7815){return squel['select']()[_0xa978('0x11')](_0xa978('0x12'))['from'](_0x3520b0)[_0xa978('0x13')](_0x460c3e,null,_0x460c3e+_0xa978('0x14')+_0x3520b0+'.'+_0x21ae97)['where'](_0x3520b0+'.'+_0x21ae97+'\x20=\x20'+_0x5c7af3+'.'+_0x21ae97)[_0xa978('0x15')](_0x460c3e+'.dialCheckDuplicateType\x20IN\x20('+_0xdd7815[_0xa978('0x13')]()+')');}function insertCmHopper(_0x472747,_0x20a694,_0x2ededc,_0x48dcbe,_0x426963){var _0x156288=[_0xa978('0x16'),_0xa978('0x17'),_0xa978('0x18'),'cm_contacts.ListId',_0x20a694+'.'+_0x48dcbe,'cm_contacts.createdAt',_0xa978('0x19'),_0xa978('0x1a'),_0xa978('0x1b'),'\x22'+_0x426963+'\x22'];return squel[_0xa978('0x1c')]()[_0xa978('0x1d')](_0xa978('0x1e'))[_0xa978('0x1f')]([_0xa978('0x12'),'scheduledat',_0xa978('0x20'),'ListId',_0x48dcbe,_0xa978('0x21'),_0xa978('0x22'),_0xa978('0x23'),'UserId',_0xa978('0x24')],squel['select']()[_0xa978('0x25')](_0x156288)['from'](_0x20a694)[_0xa978('0x13')](_0xa978('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x20a694+_0xa978('0x27'))[_0xa978('0x13')](_0x2ededc,null,_0x2ededc+_0xa978('0x14')+_0x20a694+'.'+_0x48dcbe)[_0xa978('0x15')](_0x20a694+'.CmListId\x20=\x20?',_0x472747)['where'](_0xa978('0x28'),NOW)[_0xa978('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x20a694,_0x2ededc,_0x48dcbe,'cm_hopper',[_0xa978('0x29'),_0xa978('0x2a')]))[_0xa978('0x15')](_0xa978('0x2b'),selectNotIn(_0x20a694,_0x2ededc,_0x48dcbe,_0xa978('0x1e'),['\x22always\x22'])))[_0xa978('0x2c')]();}function insertCmHopperBlack(_0x38bfa8,_0x31de9e,_0xdf2695,_0x380edc){var _0x4afe04=[_0xa978('0x16'),'cm_contacts.id',_0xa978('0x2d'),_0x31de9e+'.'+_0x380edc,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xa978('0x1c')]()[_0xa978('0x1d')](_0xa978('0x2e'))[_0xa978('0x1f')]([_0xa978('0x12'),_0xa978('0x20'),_0xa978('0x2f'),_0x380edc,_0xa978('0x21'),_0xa978('0x22')],squel['select']()['fields'](_0x4afe04)[_0xa978('0x30')](_0x31de9e)[_0xa978('0x13')](_0xa978('0x26'),null,_0xa978('0x31')+_0x31de9e+'.CmListId')[_0xa978('0x13')](_0xdf2695,null,_0xdf2695+'.id\x20=\x20'+_0x31de9e+'.'+_0x380edc)[_0xa978('0x15')](_0x31de9e+_0xa978('0x32'),_0x38bfa8)[_0xa978('0x15')](_0xa978('0x28'),NOW)['where'](_0xa978('0x2b'),squel[_0xa978('0x33')]()[_0xa978('0x11')](_0xa978('0x12'))['from']('cm_hopper_black')[_0xa978('0x15')](_0xa978('0x34'),_0x38bfa8)['where'](_0x380edc+_0xa978('0x35'),_0x31de9e+'.'+_0x380edc)))['toString']();}function insertCmContact(_0x41c8bf,_0x437e09,_0x1a4958,_0x250969){var _0x4f0600=_['concat'](_['keys'](_0x250969),[_0xa978('0x2f'),_0xa978('0x36'),_0xa978('0x21'),_0xa978('0x22')]);return squel[_0xa978('0x1c')]()['into'](_0xa978('0x26'))[_0xa978('0x1f')](_0x4f0600,squel[_0xa978('0x33')]()['fields'](_0x4f0600)[_0xa978('0x30')](_0x437e09)[_0xa978('0x15')]('('+_0x1a4958[_0xa978('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0xa978('0x33')]()[_0xa978('0x25')](_0x1a4958)[_0xa978('0x30')](_0xa978('0x26'))[_0xa978('0x15')](_0xa978('0x34'),_0x41c8bf)[_0xa978('0x15')](_0xa978('0x37')))['where']('id\x20IN\x20?',squel['select']()[_0xa978('0x11')](_0xa978('0x38'),_0xa978('0x39'))[_0xa978('0x30')](_0x437e09)[_0xa978('0x3a')](_0x1a4958['join'](','))))[_0xa978('0x2c')]();}function handleStop(){logger[_0xa978('0x3b')](_0xa978('0x3c'));stopped=!![];}function handleUncaughtException(_0x2426bf){logger[_0xa978('0x3d')](_0x2426bf[_0xa978('0x3e')]);process[_0xa978('0x3f')](0x1);}function handleError(_0x2a5c51,_0x426fe2){stats[_0xa978('0x40')][_0xa978('0x41')]({'name':_0x426fe2[_0xa978('0x42')],'message':_0x426fe2[_0xa978('0x3e')],'row':_0x2a5c51});}function handleQuery(_0x4ad671){logger[_0xa978('0x3b')](_0x4ad671);return db[_0xa978('0x43')][_0xa978('0x44')](_0x4ad671)[_0xa978('0x45')](function(_0x197af8){results[_0xa978('0x41')](_0x197af8);})[_0xa978('0x46')](function(_0x1839fe){logger['error'](_0x1839fe['message']);});}function main(_0x208df6,_0x55b4e7,_0x2b2b38,_0x17a93b){logger[_0xa978('0x3b')]('main',_0x208df6,JSON['stringify'](_0x55b4e7));process[_0xa978('0x47')](_0xa978('0x48'));var _0x443fa9=_0x55b4e7[_0xa978('0x49')];var _0x3ad08a=_0x55b4e7['socket_timestamp'];var _0x15e773=path[_0xa978('0x13')](config[_0xa978('0x4a')],_0xa978('0x4b'),_0x3ad08a+'.csv');var _0x48670c=_['keys'](_0x443fa9)[_0xa978('0x13')]();logger[_0xa978('0x3b')](_0xa978('0x4c'),_0x48670c);fs[_0xa978('0x4d')](_0x15e773,_0x48670c+'\x0a');Papa[_0xa978('0x4e')](fs[_0xa978('0x4f')](_0x208df6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f60da,_0xd6e0f){try{for(var _0x53d97d=0x0,_0x110b1c=[];_0x53d97d<_0x1f60da[_0xa978('0x50')][_0xa978('0x51')];_0x53d97d++){stats['rows']+=0x1;if(_0x1f60da['errors'][_0x53d97d]){handleError(_0x1f60da[_0xa978('0x50')][_0x53d97d],_0x1f60da[_0xa978('0x40')][_0x53d97d]);}else{var _0x4efecb=[];for(var _0x4efbdf in _0x443fa9){if(_0x443fa9[_0xa978('0x52')](_0x4efbdf)){if(_0x1f60da['data'][_0x53d97d][_0x443fa9[_0x4efbdf]]){var _0x1dd9de=_[_0xa978('0x53')](_0x1f60da['data'][_0x53d97d][_0x443fa9[_0x4efbdf]]['replace'](/"/g,'\x27'));switch(_0x4efbdf){case _0xa978('0x54'):var _0x378f3a=moment(_0x1dd9de,_0xa978('0xf'),!![]);if(_0x378f3a[_0xa978('0x55')]()){_0x110b1c['push']('\x22'+_0x1dd9de+'\x22');}else{_0x4efecb['push'](_0xa978('0x56'));}break;case _0xa978('0x23'):var _0x2e0e18=parseInt(_0x1dd9de);_0x1dd9de=_[_0xa978('0x57')](_0x2e0e18)||_0x2e0e18<0x0||_0x2e0e18>0x4?_0x17a93b?0x3:0x2:_0x2e0e18;_0x110b1c[_0xa978('0x41')]('\x22'+_0x1dd9de+'\x22');break;case _0xa978('0x58'):var _0x23689e=parseInt(_0x1dd9de);if(_['isNumber'](_0x23689e)&&_[_0xa978('0x59')](_0x2b2b38,_0x23689e)){_0x110b1c[_0xa978('0x41')]('\x22'+_0x23689e+'\x22');}else{_0x4efecb[_0xa978('0x41')]('agent\x20not\x20exists');}break;case _0xa978('0x5a'):if(isEmail(_0x1dd9de)){_0x110b1c['push']('\x22'+_0x1dd9de+'\x22');}else{_0x4efecb[_0xa978('0x41')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x303540=moment(_0x1dd9de,'YYYY-MM-DD',!![]);if(_0x303540[_0xa978('0x55')]()){_0x110b1c['push']('\x22'+_0x1dd9de+'\x22');}else{_0x4efecb[_0xa978('0x41')](_0xa978('0x5b'));}break;default:_0x110b1c[_0xa978('0x41')]('\x22'+_0x1dd9de+'\x22');}}else{switch(_0x4efbdf){case _0xa978('0x5c'):case _0xa978('0x12'):_0x4efecb[_0xa978('0x41')](_0x4efbdf+'\x20not\x20specified');break;default:_0x110b1c[_0xa978('0x41')]('\x22\x22');}}}}if(_0x4efecb['length']){handleError(_0x1f60da['data'][_0x53d97d],{'code':'SystemRow','message':_0x4efecb[_0xa978('0x13')]()});}else{fs[_0xa978('0x5d')](_0x15e773,_0x110b1c[_0xa978('0x13')]()+'\x0a');}_0x110b1c=[];}if(!(stats[_0xa978('0x5e')]%0xc8)){socket[_0xa978('0x5f')]('contact:import:'+_0x3ad08a,stats);stats[_0xa978('0x40')]=[];}}if(stopped){logger[_0xa978('0x3b')](_0xa978('0x60'));_0xd6e0f[_0xa978('0x61')]();}}catch(_0x1b354c){handleError(_0x1f60da[_0xa978('0x50')][_0x53d97d],{'code':_0xa978('0x62'),'message':_0x1b354c[_0xa978('0x3e')]});logger[_0xa978('0x3d')](_0xa978('0x63'),_0x1b354c[_0xa978('0x3e')]);}},'complete':function(){try{var _0x1741ac=[];var _0x135b5e=_0xa978('0x26');if(_0x55b4e7[_0xa978('0x64')]&&_0x55b4e7[_0xa978('0x64')][_0xa978('0x51')]){_0x135b5e=_0xa978('0x65')+_0x3ad08a;_0x1741ac[_0xa978('0x41')](_0xa978('0x66')+_0x135b5e+'\x20LIKE\x20cm_contacts;');}var _0x1a58d9=util[_0xa978('0xe')]('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',_0x15e773,_0x135b5e,_0x48670c,_0x55b4e7[_0xa978('0x2f')],_0x55b4e7[_0xa978('0x36')]||null,NOW,NOW);if(_[_0xa978('0x67')](_0x443fa9[_0xa978('0x54')])){_0x1a58d9+=',\x20scheduledAt\x20=\x20NOW()';}_0x1741ac[_0xa978('0x41')](_0x1a58d9);if(_0x55b4e7[_0xa978('0x64')]&&_0x55b4e7[_0xa978('0x64')]['length']){_0x1741ac[_0xa978('0x41')](insertCmContact(_0x55b4e7[_0xa978('0x2f')],_0x135b5e,_0x55b4e7[_0xa978('0x64')],_0x443fa9));_0x1741ac[_0xa978('0x41')](_0xa978('0x68')+_0x135b5e+';');}_0x1741ac[_0xa978('0x41')](insertCmHopper(_0x55b4e7[_0xa978('0x2f')],_0xa978('0x69'),_0xa978('0x6a'),'VoiceQueueId',_0x17a93b));_0x1741ac[_0xa978('0x41')](insertCmHopperBlack(_0x55b4e7[_0xa978('0x2f')],_0xa978('0x6b'),_0xa978('0x6a'),_0xa978('0x6c')));_0x1741ac[_0xa978('0x41')](insertCmHopper(_0x55b4e7['ListId'],_0xa978('0x6d'),'campaigns','CampaignId',_0x17a93b));_0x1741ac[_0xa978('0x41')](insertCmHopperBlack(_0x55b4e7[_0xa978('0x2f')],_0xa978('0x6e'),_0xa978('0x6f'),'CampaignId'));BPromise[_0xa978('0x70')](_0x1741ac,handleQuery)[_0xa978('0x71')](function(_0x4a3b5a){stats[_0xa978('0x72')]=!![];stats[_0xa978('0x73')]=_0x55b4e7[_0xa978('0x64')]&&_0x55b4e7[_0xa978('0x64')][_0xa978('0x51')]?results[0x2][_0xa978('0x73')]:results[0x0]['affectedRows'];socket[_0xa978('0x5f')](_0xa978('0x74')+_0x3ad08a,stats);fs[_0xa978('0x75')](_0x208df6);fs[_0xa978('0x75')](_0x15e773);process[_0xa978('0x3f')](0x0);})[_0xa978('0x46')](function(_0xe8146c){logger[_0xa978('0x3d')](_0xe8146c[_0xa978('0x3e')]);process[_0xa978('0x3f')](0x1);});}catch(_0x33911e){logger['error'](_0xa978('0x76'),_0x33911e[_0xa978('0x3e')]);process[_0xa978('0x3f')](0x1);}},'error':function(_0x65a9e2,_0x4d282d,_0x2f9c3f,_0x18df24){throw new Error(_0x18df24);}});}function validate(){if(process[_0xa978('0x77')]&&process[_0xa978('0x77')][_0xa978('0x51')]<0x4){throw new Error(_0xa978('0x78'));}var _0x2e2c32=path[_0xa978('0x13')](config['root'],'server/files/tmp',process[_0xa978('0x77')][0x2]);if(!fs[_0xa978('0x79')](_0x2e2c32)){throw new Error(_0xa978('0x7a'));}var _0x270f9f={};try{_0x270f9f=JSON[_0xa978('0x4e')](process[_0xa978('0x77')][0x3]);if(!_0x270f9f[_0xa978('0x49')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x270f9f[_0xa978('0x49')][_0xa978('0x12')]){throw new Error(_0xa978('0x7b'));}if(!_0x270f9f[_0xa978('0x49')][_0xa978('0x5c')]){throw new Error(_0xa978('0x7c'));}var _0x43b34f=0x0;if(_0x270f9f[_0xa978('0x49')][_0xa978('0x58')]){_0x43b34f=0x1;}if(!_0x270f9f[_0xa978('0x2f')]){throw new Error(_0xa978('0x7d'));}}catch(_0x3743c7){throw new Error('body\x20id\x20mandatory');}var _0x383be7=[];try{_0x383be7=_['map'](JSON[_0xa978('0x4e')](process[_0xa978('0x77')][0x4]),'id');}catch(_0x20d086){logger[_0xa978('0x3b')](_0xa978('0x7e'));}main(_0x2e2c32,_0x270f9f,_0x383be7,_0x43b34f);}validate();process['on'](_0xa978('0x7f'),handleStop);process['on'](_0xa978('0x80'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 935308e..d995ae5 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 _0xf00f=['agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Answer\x20Time','answertime','endtime','duration','Billable\x20Time','billableseconds','getSubjects','string','voice','toLowerCase','push','variable','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','calleridnum','Caller\x20Name','calleridname','Call\x20To','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***'];(function(_0x18dc34,_0x205f71){var _0x4ab15b=function(_0x50572f){while(--_0x50572f){_0x18dc34['push'](_0x18dc34['shift']());}};_0x4ab15b(++_0x205f71);}(_0xf00f,0x15b));var _0xff00=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xf00f[_0x25d386];return _0x857f4a;};'use strict';exports[_0xff00('0x0')]=function(_0x21de07,_0x3f8114){var _0x54903c=[{'type':_0xff00('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x21de07['toLowerCase']()){case _0xff00('0x2'):switch(_0x3f8114[_0xff00('0x3')]()){case'inbound':_0x54903c[_0xff00('0x4')]({'type':_0xff00('0x5'),'content':'','variableName':'queue'});_0x54903c[_0xff00('0x4')]({'type':_0xff00('0x5'),'content':'','variableName':'calleridnum'});break;case _0xff00('0x6'):_0x54903c['push']({'type':'string','content':_0xff00('0x7'),'variableName':null});_0x54903c['push']({'type':'variable','content':'','variableName':_0xff00('0x8')});break;}}return _0x54903c;};exports['getDescriptions']=function(_0x1e229e,_0x1ffdc2){var _0x597689=[];switch(_0x1e229e[_0xff00('0x3')]()){case'voice':switch(_0x1ffdc2[_0xff00('0x3')]()){case'inbound':_0x597689=[{'type':'string','content':_0xff00('0x9'),'key':null,'keyType':null,'variableName':null},{'type':_0xff00('0xa'),'content':'','key':'Caller\x20Number','keyType':_0xff00('0x5'),'variableName':_0xff00('0xb')},{'type':'keyValue','content':'','key':_0xff00('0xc'),'keyType':_0xff00('0x5'),'variableName':_0xff00('0xd')},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0xe'),'keyType':_0xff00('0x5'),'variableName':'destexten'},{'type':_0xff00('0xa'),'content':'','key':'Queue','keyType':_0xff00('0x5'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0xff00('0xf'),'keyType':'variable','variableName':_0xff00('0x10')},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x11'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xff00('0x1'),'content':_0xff00('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x13'),'keyType':_0xff00('0x5'),'variableName':_0xff00('0x14')},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x15'),'keyType':_0xff00('0x5'),'variableName':_0xff00('0x8')},{'type':_0xff00('0x1'),'content':_0xff00('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xff00('0xa'),'content':'','key':'Agent\x20Ring','keyType':_0xff00('0x5'),'variableName':_0xff00('0x17')},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x18'),'keyType':_0xff00('0x5'),'variableName':_0xff00('0x19')},{'type':'keyValue','content':'','key':_0xff00('0x1a'),'keyType':_0xff00('0x5'),'variableName':_0xff00('0x1b')},{'type':_0xff00('0xa'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x1c'),'keyType':'variable','variableName':_0xff00('0x1d')}];break;case _0xff00('0x6'):_0x597689=[{'type':_0xff00('0x1'),'content':_0xff00('0x9'),'variableName':null},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x1e'),'keyType':_0xff00('0x5'),'keyContent':'','variableName':_0xff00('0x8')},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xff00('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0xff00('0x10')},{'type':_0xff00('0xa'),'content':'','key':_0xff00('0x11'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xff00('0x1'),'content':_0xff00('0x16')},{'type':'keyValue','content':'','key':_0xff00('0x1f'),'keyType':_0xff00('0x5'),'keyContent':'','variableName':_0xff00('0x20')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0xff00('0x5'),'keyContent':'','variableName':_0xff00('0x21')},{'type':_0xff00('0xa'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0xff00('0x22')},{'type':'keyValue','content':'','key':_0xff00('0x23'),'keyType':'variable','keyContent':'','variableName':_0xff00('0x24')}];break;}}return _0x597689;}; \ No newline at end of file +var _0x453a=['uniqueid','Date','agentcalledAt','string','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x453a,0xf4));var _0xa453=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x453a[_0x1f1e31];return _0x229b56;};'use strict';exports[_0xa453('0x0')]=function(_0x4f3420,_0x31e23b){var _0x50dee7=[{'type':'string','content':_0xa453('0x1'),'variableName':null}];switch(_0x4f3420[_0xa453('0x2')]()){case _0xa453('0x3'):switch(_0x31e23b[_0xa453('0x2')]()){case _0xa453('0x4'):_0x50dee7[_0xa453('0x5')]({'type':_0xa453('0x6'),'content':'','variableName':_0xa453('0x7')});_0x50dee7['push']({'type':_0xa453('0x6'),'content':'','variableName':_0xa453('0x8')});break;case _0xa453('0x9'):_0x50dee7['push']({'type':'string','content':_0xa453('0xa'),'variableName':null});_0x50dee7['push']({'type':'variable','content':'','variableName':_0xa453('0xb')});break;}}return _0x50dee7;};exports[_0xa453('0xc')]=function(_0x3ca7c5,_0x127ad2){var _0x2661ee=[];switch(_0x3ca7c5[_0xa453('0x2')]()){case'voice':switch(_0x127ad2['toLowerCase']()){case'inbound':_0x2661ee=[{'type':'string','content':_0xa453('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0xf'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x8')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x10'),'keyType':'variable','variableName':'calleridname'},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x11'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x12')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x13'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x7')},{'type':_0xa453('0xe'),'content':'','key':'UniqueId','keyType':_0xa453('0x6'),'variableName':_0xa453('0x14')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x15'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x16')},{'type':_0xa453('0x17'),'content':_0xa453('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa453('0x19'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x1a')},{'type':_0xa453('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xa453('0x6'),'variableName':_0xa453('0xb')},{'type':_0xa453('0x17'),'content':_0xa453('0x1b'),'key':null,'keyType':null,'variableName':null},{'type':_0xa453('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0xa453('0x6'),'variableName':_0xa453('0x16')},{'type':_0xa453('0xe'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0xa453('0x1c')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x1d'),'keyType':_0xa453('0x6'),'variableName':_0xa453('0x1e')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x1f'),'keyType':'variable','variableName':'holdtime'},{'type':_0xa453('0xe'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xa453('0x20')}];break;case _0xa453('0x9'):_0x2661ee=[{'type':'string','content':_0xa453('0xd'),'variableName':null},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x21'),'keyType':_0xa453('0x6'),'keyContent':'','variableName':_0xa453('0xb')},{'type':'keyValue','content':'','key':_0xa453('0x22'),'keyType':_0xa453('0x6'),'keyContent':'','variableName':_0xa453('0x23')},{'type':_0xa453('0xe'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0xa453('0x14')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x15'),'keyType':'variable','keyContent':'','variableName':_0xa453('0x24')},{'type':_0xa453('0x17'),'content':_0xa453('0x1b')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x25'),'keyType':_0xa453('0x6'),'keyContent':'','variableName':_0xa453('0x26')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x27'),'keyType':_0xa453('0x6'),'keyContent':'','variableName':_0xa453('0x28')},{'type':'keyValue','content':'','key':_0xa453('0x29'),'keyType':'variable','keyContent':'','variableName':_0xa453('0x2a')},{'type':_0xa453('0xe'),'content':'','key':_0xa453('0x2b'),'keyType':_0xa453('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x2661ee;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 31ab4b9..88043e4 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 _0x8dc2=['InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','findOne','then','info','catch','error','tracked','user','clone','body','html','fax','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','upperFirst'];(function(_0x3906b9,_0x56e4f2){var _0x148361=function(_0x20eafb){while(--_0x20eafb){_0x3906b9['push'](_0x3906b9['shift']());}};_0x148361(++_0x56e4f2);}(_0x8dc2,0xe3));var _0x28dc=function(_0x301ea6,_0x202cf3){_0x301ea6=_0x301ea6-0x0;var _0x3bd1ae=_0x8dc2[_0x301ea6];return _0x3bd1ae;};'use strict';var _=require(_0x28dc('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x28dc('0x1'))(_0x28dc('0x2')),'mail':require(_0x28dc('0x1'))(_0x28dc('0x3')),'fax':require(_0x28dc('0x1'))(_0x28dc('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x28dc('0x1'))(_0x28dc('0x5')),'whatsapp':require(_0x28dc('0x1'))('whatsapp-interactions')};function getInteractionId(_0x57578a,_0x592a25,_0x4278de){if(_0x57578a&&_0x57578a[_[_0x28dc('0x6')](_0x4278de)+_0x28dc('0x7')]){return _0x57578a[_['upperFirst'](_0x4278de)+_0x28dc('0x7')];}else if(_0x57578a&&_0x57578a['id']){return _0x57578a['id'];}else if(_0x592a25&&_0x592a25['id']){return _0x592a25['id'];}else{return'unknown';}}function log(_0x93c3dc,_0x190b04,_0x36ae24,_0x5f44d0,_0x57ee53,_0x2bfe03){loggers[_0x57ee53[_0x28dc('0x8')]()][_0x93c3dc](_0x28dc('0x9'),_0x2bfe03['toUpperCase'](),_0x190b04?_0x190b04['id']:null,_0x190b04?_0x190b04['name']:null,_0x190b04?_0x190b04[_0x28dc('0xa')]:null,getInteractionId(_0x36ae24,_0x5f44d0,_0x57ee53),_0x36ae24?JSON[_0x28dc('0xb')](_0x36ae24):_0x28dc('0xc'));}function updateUser(_0x3be324,_0x3e822e,_0x53ef65,_0x3db924,_0x18482b){db[_[_0x28dc('0x6')](_0x3db924)+_0x28dc('0xd')][_0x28dc('0xe')]({'where':{'id':getInteractionId(_0x3e822e,_0x53ef65,_0x3db924)}})['then'](function(_0x118746){if(_0x118746){return _0x118746['update']({'UserId':_0x3be324?_0x3be324['id']:null});}})[_0x28dc('0xf')](function(_0x4cfee8){if(_0x4cfee8){log(_0x28dc('0x10'),_0x3be324,_0x3e822e,_0x53ef65,_0x3db924,_0x18482b);}})[_0x28dc('0x11')](function(){log(_0x28dc('0x12'),_0x3be324,_0x3e822e,_0x53ef65,_0x3db924,_0x18482b);});}exports[_0x28dc('0x13')]=function(_0x552acc,_0x39583b){return function(_0x21bd3d,_0x5074a3,_0x39a7ee){var _0x53aff7=_0x21bd3d[_0x28dc('0x14')];var _0x284382={};var _0x507d1c=_0x21bd3d['query'];if(_0x284382){_0x284382=_[_0x28dc('0x15')](_0x21bd3d[_0x28dc('0x16')]);_0x284382=_['omit'](_0x284382,[_0x28dc('0x16'),_0x28dc('0x17'),'phone',_0x28dc('0x18'),_0x28dc('0x19')]);}updateUser(_0x53aff7,_0x284382,_0x507d1c,_0x552acc,_0x39583b);_0x39a7ee(null);};}; \ No newline at end of file +var _0x5162=['findOne','then','update','catch','error','tracked','user','query','omit','body','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null'];(function(_0x3eea0c,_0x3c3c95){var _0x5e07e3=function(_0x1e86e2){while(--_0x1e86e2){_0x3eea0c['push'](_0x3eea0c['shift']());}};_0x5e07e3(++_0x3c3c95);}(_0x5162,0x11c));var _0x2516=function(_0x229066,_0x443063){_0x229066=_0x229066-0x0;var _0xd7c89=_0x5162[_0x229066];return _0xd7c89;};'use strict';var _=require(_0x2516('0x0'));var db=require(_0x2516('0x1'))['db'];var loggers={'openchannel':require(_0x2516('0x2'))(_0x2516('0x3')),'mail':require(_0x2516('0x2'))(_0x2516('0x4')),'fax':require(_0x2516('0x2'))(_0x2516('0x5')),'sms':require(_0x2516('0x2'))(_0x2516('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x2516('0x2'))('whatsapp-interactions')};function getInteractionId(_0x27e512,_0x3628de,_0x1bd087){if(_0x27e512&&_0x27e512[_[_0x2516('0x7')](_0x1bd087)+_0x2516('0x8')]){return _0x27e512[_['upperFirst'](_0x1bd087)+_0x2516('0x8')];}else if(_0x27e512&&_0x27e512['id']){return _0x27e512['id'];}else if(_0x3628de&&_0x3628de['id']){return _0x3628de['id'];}else{return _0x2516('0x9');}}function log(_0x35f16c,_0x945f23,_0x315b22,_0x8088c7,_0x3105cd,_0x560ef2){loggers[_0x3105cd['toLowerCase']()][_0x35f16c](_0x2516('0xa'),_0x560ef2[_0x2516('0xb')](),_0x945f23?_0x945f23['id']:null,_0x945f23?_0x945f23[_0x2516('0xc')]:null,_0x945f23?_0x945f23[_0x2516('0xd')]:null,getInteractionId(_0x315b22,_0x8088c7,_0x3105cd),_0x315b22?JSON[_0x2516('0xe')](_0x315b22):_0x2516('0xf'));}function updateUser(_0x43e89f,_0x256925,_0x5d4fb5,_0x55be4f,_0x5ee639){db[_[_0x2516('0x7')](_0x55be4f)+'Interaction'][_0x2516('0x10')]({'where':{'id':getInteractionId(_0x256925,_0x5d4fb5,_0x55be4f)}})[_0x2516('0x11')](function(_0x4df63f){if(_0x4df63f){return _0x4df63f[_0x2516('0x12')]({'UserId':_0x43e89f?_0x43e89f['id']:null});}})[_0x2516('0x11')](function(_0x973093){if(_0x973093){log('info',_0x43e89f,_0x256925,_0x5d4fb5,_0x55be4f,_0x5ee639);}})[_0x2516('0x13')](function(){log(_0x2516('0x14'),_0x43e89f,_0x256925,_0x5d4fb5,_0x55be4f,_0x5ee639);});}exports[_0x2516('0x15')]=function(_0xec3f89,_0x4747f8){return function(_0x79856e,_0x41c7f2,_0x5b6dbe){var _0x40426e=_0x79856e[_0x2516('0x16')];var _0x265fbd={};var _0x473555=_0x79856e[_0x2516('0x17')];if(_0x265fbd){_0x265fbd=_['clone'](_0x79856e['body']);_0x265fbd=_[_0x2516('0x18')](_0x265fbd,[_0x2516('0x19'),_0x2516('0x1a'),_0x2516('0x1b'),_0x2516('0x1c'),_0x2516('0x1d')]);}updateUser(_0x40426e,_0x265fbd,_0x473555,_0xec3f89,_0x4747f8);_0x5b6dbe(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index f3d5403..8a7c5b1 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 _0xdaed=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','isUserLimit','crypto','util','composable-middleware','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','License','findOne','then','count','status'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdaed,0x103));var _0xddae=function(_0x215cb5,_0x8cc0f4){_0x215cb5=_0x215cb5-0x0;var _0x590e00=_0xdaed[_0x215cb5];return _0x590e00;};'use strict';var crypto=require(_0xddae('0x0'));var util=require(_0xddae('0x1'));var compose=require(_0xddae('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4a3719,_0x52d684){if(_0x4a3719&&_0x52d684){if(_0x52d684['data1']&&_0x52d684[_0xddae('0x3')]){var _0x465ad3=_0x52d684['data1'];var _0x1dbd87=_0x52d684[_0xddae('0x3')];var _0x59ba3=_0x465ad3[_0xddae('0x4')]('-')[0x4];var _0x1aa85b=_0x465ad3[_0xddae('0x4')]('-')[0x0];var _0x216247=crypto[_0xddae('0x5')](_0xddae('0x6'),util[_0xddae('0x7')](_0xddae('0x8'),_0x59ba3,_0x465ad3,_0x1aa85b));var _0x1d4d46=_0x216247[_0xddae('0x9')](_0x1dbd87,'base64',_0xddae('0xa'));_0x1d4d46+=_0x216247[_0xddae('0xb')](_0xddae('0xa'));var _0x4d71c6=JSON['parse'](_0x1d4d46);return _0x4d71c6['hasOwnProperty'](_0x4a3719)?_0x4d71c6[_0x4a3719]:null;}}return null;}function isLimit(_0x2c2c1b,_0x26efdc,_0x4825ac,_0x13630c){var _0xcfd62=_0x26efdc;return compose()['use'](function(_0x12076b,_0x41c66c,_0x3590f8){return db[_0xddae('0xc')][_0xddae('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xddae('0xe')](function(_0x155846){var _0x4a6a8=getValueFromLicense(_0x2c2c1b,_0x155846);return _0x4a6a8?_0x4a6a8:_0xcfd62;})[_0xddae('0xe')](function(_0xa2b7b5){_0xcfd62=_0xa2b7b5;return _0x4825ac[_0xddae('0xf')](_0x13630c);})[_0xddae('0xe')](function(_0x1d7b27){if(_0x1d7b27>=_0xcfd62){return _0x41c66c[_0xddae('0x10')](0x193)[_0xddae('0x11')]({'message':util[_0xddae('0x7')](_0xddae('0x12'),_0x2c2c1b)});}_0x3590f8();})[_0xddae('0x13')](function(_0x34c7c4){_0x3590f8(_0x34c7c4);});});}function isUserLimit(){return isLimit(_0xddae('0x14'),0x1,db[_0xddae('0x15')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xddae('0x16')]=isUserLimit; \ No newline at end of file +var _0x73ab=['use','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','base64','utf8','final','hasOwnProperty'];(function(_0x1a0c9d,_0x1f608b){var _0x5b939d=function(_0x1dd617){while(--_0x1dd617){_0x1a0c9d['push'](_0x1a0c9d['shift']());}};_0x5b939d(++_0x1f608b);}(_0x73ab,0x1a7));var _0xb73a=function(_0x15a8fa,_0x4652b2){_0x15a8fa=_0x15a8fa-0x0;var _0x1355c2=_0x73ab[_0x15a8fa];return _0x1355c2;};'use strict';var crypto=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var compose=require('composable-middleware');var db=require(_0xb73a('0x2'))['db'];var config=require(_0xb73a('0x3'));function getValueFromLicense(_0x5af336,_0x417244){if(_0x5af336&&_0x417244){if(_0x417244[_0xb73a('0x4')]&&_0x417244[_0xb73a('0x5')]){var _0x11a261=_0x417244[_0xb73a('0x4')];var _0x389dda=_0x417244[_0xb73a('0x5')];var _0x5457ce=_0x11a261[_0xb73a('0x6')]('-')[0x4];var _0x23e31f=_0x11a261[_0xb73a('0x6')]('-')[0x0];var _0x3f74f7=crypto[_0xb73a('0x7')](_0xb73a('0x8'),util[_0xb73a('0x9')]('%s:%s:%s',_0x5457ce,_0x11a261,_0x23e31f));var _0x5e4ddf=_0x3f74f7['update'](_0x389dda,_0xb73a('0xa'),_0xb73a('0xb'));_0x5e4ddf+=_0x3f74f7[_0xb73a('0xc')]('utf8');var _0x5a40d4=JSON['parse'](_0x5e4ddf);return _0x5a40d4[_0xb73a('0xd')](_0x5af336)?_0x5a40d4[_0x5af336]:null;}}return null;}function isLimit(_0x5792dc,_0x6cfddc,_0x1b3871,_0x36a5ec){var _0x25936e=_0x6cfddc;return compose()[_0xb73a('0xe')](function(_0x4f58b6,_0x4c5b5f,_0x2ab818){return db['License'][_0xb73a('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x491ffb){var _0x4e1262=getValueFromLicense(_0x5792dc,_0x491ffb);return _0x4e1262?_0x4e1262:_0x25936e;})[_0xb73a('0x10')](function(_0x4b8e0f){_0x25936e=_0x4b8e0f;return _0x1b3871[_0xb73a('0x11')](_0x36a5ec);})[_0xb73a('0x10')](function(_0x13bc39){if(_0x13bc39>=_0x25936e){return _0x4c5b5f['status'](0x193)[_0xb73a('0x12')]({'message':util[_0xb73a('0x9')](_0xb73a('0x13'),_0x5792dc)});}_0x2ab818();})[_0xb73a('0x14')](function(_0xf722ce){_0x2ab818(_0xf722ce);});});}function isUserLimit(){return isLimit(_0xb73a('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0xb73a('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index d5e083f..bd36e55 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 _0x0bf2=['format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','$in','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','[$and]','[$or]','length','split','slice','forEach','shift','filter','indexOf','conditions','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days'];(function(_0x393734,_0x500e23){var _0x2e8f58=function(_0xb0c104){while(--_0xb0c104){_0x393734['push'](_0x393734['shift']());}};_0x2e8f58(++_0x500e23);}(_0x0bf2,0x1ce));var _0x20bf=function(_0x576d09,_0x5bd6d1){_0x576d09=_0x576d09-0x0;var _0x5ed409=_0x0bf2[_0x576d09];return _0x5ed409;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x20bf('0x0')]=function(_0x332e21){var _0x5835fd={'conditions':[]};_0x5835fd[_0x20bf('0x1')]=_[_0x20bf('0x2')](_0x332e21,'[$or]')?'or':'and';var _0x36d9e1=_0x332e21['replace'](_0x20bf('0x3'),'')['replace'](_0x20bf('0x4'),'')['split']('||');for(var _0x21299e=0x0;_0x21299e<_0x36d9e1[_0x20bf('0x5')];_0x21299e++){var _0x444e8f=_0x36d9e1[_0x21299e][_0x20bf('0x6')](':=');var _0x2dd4c5=_0x444e8f[0x0];var _0x2eeb79=_0x444e8f[_0x20bf('0x7')](0x1);_0x2eeb79[_0x20bf('0x8')](function(_0x974fdc){var _0x3d43f0=_0x974fdc[_0x20bf('0x6')]('[')[_0x20bf('0x9')]();var _0x3cc551=_0x974fdc['match'](/\[(.*?)\]/g);_0x3cc551[_0x20bf('0x8')](function(_0xcd21a9){var _0x279d3f=_0xcd21a9[_0x20bf('0x6')]('[')[_0x20bf('0xa')](function(_0x48d513){return _0x48d513[_0x20bf('0xb')](']')>-0x1;})['map'](function(_0x1cdb3c){return _0x1cdb3c[_0x20bf('0x6')](']')[0x0];})[0x0];_0x5835fd[_0x20bf('0xc')]['push']({'field':_0x2dd4c5,'operator':_0x3d43f0,'value':_0x279d3f});});});}return _0x5835fd;};exports[_0x20bf('0xd')]=function(_0x1eaaa6,_0xd2f18e,_0x183e95){var _0x3517cd={};if(_0xd2f18e===_0x20bf('0xe')){if(_0x183e95['operator']===_0x20bf('0xf')){_0x183e95[_0x20bf('0x10')]=_0x20bf('0x11');_0x183e95['value']+=','+_0x183e95[_0x20bf('0x12')];}else if(_[_0x20bf('0x13')]([_0x20bf('0x14'),_0x20bf('0x15')],_0x183e95[_0x20bf('0x10')])){_0x183e95[_0x20bf('0x12')]=moment(_0x183e95[_0x20bf('0x12')])[_0x20bf('0x16')](0x1,_0x20bf('0x17'))[_0x20bf('0x18')](_0x20bf('0x19'));}}if(_0x183e95[_0x20bf('0x1a')]){_0xd2f18e=_0x183e95[_0x20bf('0x1a')];_0x3517cd[_0x20bf('0x1b')]=_0x20bf('0x1c')+_0x1eaaa6+'.'+_0x183e95[_0x20bf('0x1d')]+_0x20bf('0x1e')+_0x183e95[_0x20bf('0x1a')]+')\x20'+parseOperator(_0x183e95[_0x20bf('0x10')]);}else{_0x3517cd[_0x20bf('0x1b')]=_0x1eaaa6+'.'+_0x183e95[_0x20bf('0x1d')]+'\x20'+parseOperator(_0x183e95[_0x20bf('0x10')]);}if(_[_0x20bf('0x13')]([_0x20bf('0x1f'),_0x20bf('0x20')],_0x183e95['operator']))_0x3517cd['text']='('+_0x3517cd[_0x20bf('0x1b')]+_0x20bf('0x21')+_0x1eaaa6+'.'+_0x183e95[_0x20bf('0x1d')]+'\x20IS\x20NULL)';_0x3517cd[_0x20bf('0x12')]=parseValue(_0xd2f18e,_0x183e95[_0x20bf('0x10')],_0x183e95[_0x20bf('0x12')]);return _0x3517cd;};function parseOperator(_0x50ad12){var _0x2ac4c6;switch(_0x50ad12){case _0x20bf('0x22'):_0x2ac4c6=_0x20bf('0x23');break;case _0x20bf('0x20'):_0x2ac4c6='NOT\x20IN\x20?';break;case'$eq':_0x2ac4c6=_0x20bf('0x24');break;case _0x20bf('0x1f'):_0x2ac4c6=_0x20bf('0x25');break;case _0x20bf('0x26'):case _0x20bf('0x27'):case _0x20bf('0x28'):_0x2ac4c6=_0x20bf('0x29');break;case'$lt':_0x2ac4c6=_0x20bf('0x2a');break;case _0x20bf('0x14'):_0x2ac4c6=_0x20bf('0x2b');break;case _0x20bf('0x15'):_0x2ac4c6=_0x20bf('0x2c');break;case _0x20bf('0x2d'):_0x2ac4c6=_0x20bf('0x2e');break;case _0x20bf('0x11'):_0x2ac4c6=_0x20bf('0x2f');break;}return _0x2ac4c6;}function parseValue(_0x1cd677,_0x42dce9,_0x243dbd){var _0x1ed7bb={'start':undefined,'end':undefined};switch(_0x42dce9){case _0x20bf('0x22'):case _0x20bf('0x20'):_0x1ed7bb[_0x20bf('0x30')]=_0x243dbd['split'](',');break;case _0x20bf('0x26'):_0x1ed7bb[_0x20bf('0x30')]='%'+_0x243dbd+'%';break;case _0x20bf('0x27'):_0x1ed7bb[_0x20bf('0x30')]=_0x243dbd+'%';break;case'$endsWith':_0x1ed7bb[_0x20bf('0x30')]='%'+_0x243dbd;break;case _0x20bf('0x11'):var _0x572c47=_0x243dbd[_0x20bf('0x6')](',');var _0x243dbd=_0x572c47[_0x20bf('0x9')]();var _0x456f34=_0x572c47[_0x20bf('0x31')]();if(_0x1cd677===_0x20bf('0xe')){_0x243dbd=moment(_0x243dbd)[_0x20bf('0x32')](0x0,!![])[_0x20bf('0x18')]();_0x456f34=moment(_0x456f34)['utcOffset'](0x0,!![])[_0x20bf('0x16')](0x17,_0x20bf('0x33'))[_0x20bf('0x16')](0x3b,_0x20bf('0x34'))[_0x20bf('0x16')](0x3b,_0x20bf('0x35'))[_0x20bf('0x18')]();}_0x1ed7bb={'start':_0x243dbd,'end':_0x456f34};break;default:_0x1ed7bb[_0x20bf('0x30')]=_0x243dbd;break;}return _0x1ed7bb;} \ No newline at end of file +var _0x3c6d=['<\x20?','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','format','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','filter','indexOf','map','conditions','push','operator','$between','value','includes','$gt','add','castTo','text','field','$notIn','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$endsWith','LIKE\x20?'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x3c6d,0x1bc));var _0xd3c6=function(_0x263a60,_0x163e01){_0x263a60=_0x263a60-0x0;var _0x298257=_0x3c6d[_0x263a60];return _0x298257;};'use strict';var _=require('lodash');var moment=require(_0xd3c6('0x0'));exports[_0xd3c6('0x1')]=function(_0x4a0bff){var _0x3780ae={'conditions':[]};_0x3780ae[_0xd3c6('0x2')]=_[_0xd3c6('0x3')](_0x4a0bff,_0xd3c6('0x4'))?'or':_0xd3c6('0x5');var _0x1cf9e3=_0x4a0bff[_0xd3c6('0x6')](_0xd3c6('0x7'),'')[_0xd3c6('0x6')](_0xd3c6('0x4'),'')[_0xd3c6('0x8')]('||');for(var _0x62b8ba=0x0;_0x62b8ba<_0x1cf9e3['length'];_0x62b8ba++){var _0x5c5c47=_0x1cf9e3[_0x62b8ba][_0xd3c6('0x8')](':=');var _0x5a4e15=_0x5c5c47[0x0];var _0x5e66f2=_0x5c5c47[_0xd3c6('0x9')](0x1);_0x5e66f2[_0xd3c6('0xa')](function(_0x420d3d){var _0x4ddd85=_0x420d3d[_0xd3c6('0x8')]('[')[_0xd3c6('0xb')]();var _0x178928=_0x420d3d['match'](/\[(.*?)\]/g);_0x178928[_0xd3c6('0xa')](function(_0x5c299e){var _0x40d207=_0x5c299e[_0xd3c6('0x8')]('[')[_0xd3c6('0xc')](function(_0x5d8dfb){return _0x5d8dfb[_0xd3c6('0xd')](']')>-0x1;})[_0xd3c6('0xe')](function(_0x4a4b16){return _0x4a4b16[_0xd3c6('0x8')](']')[0x0];})[0x0];_0x3780ae[_0xd3c6('0xf')][_0xd3c6('0x10')]({'field':_0x5a4e15,'operator':_0x4ddd85,'value':_0x40d207});});});}return _0x3780ae;};exports['buildExpression']=function(_0x4a6163,_0x50a045,_0x5f3100){var _0x18639f={};if(_0x50a045==='DATE'){if(_0x5f3100[_0xd3c6('0x11')]==='$eq'){_0x5f3100[_0xd3c6('0x11')]=_0xd3c6('0x12');_0x5f3100[_0xd3c6('0x13')]+=','+_0x5f3100['value'];}else if(_[_0xd3c6('0x14')]([_0xd3c6('0x15'),'$lte'],_0x5f3100[_0xd3c6('0x11')])){_0x5f3100[_0xd3c6('0x13')]=moment(_0x5f3100[_0xd3c6('0x13')])[_0xd3c6('0x16')](0x1,'days')['format']('YYYY-MM-DD');}}if(_0x5f3100[_0xd3c6('0x17')]){_0x50a045=_0x5f3100[_0xd3c6('0x17')];_0x18639f[_0xd3c6('0x18')]='CAST('+_0x4a6163+'.'+_0x5f3100[_0xd3c6('0x19')]+'\x20AS\x20'+_0x5f3100[_0xd3c6('0x17')]+')\x20'+parseOperator(_0x5f3100[_0xd3c6('0x11')]);}else{_0x18639f[_0xd3c6('0x18')]=_0x4a6163+'.'+_0x5f3100[_0xd3c6('0x19')]+'\x20'+parseOperator(_0x5f3100['operator']);}if(_['includes'](['$ne',_0xd3c6('0x1a')],_0x5f3100[_0xd3c6('0x11')]))_0x18639f['text']='('+_0x18639f[_0xd3c6('0x18')]+_0xd3c6('0x1b')+_0x4a6163+'.'+_0x5f3100[_0xd3c6('0x19')]+'\x20IS\x20NULL)';_0x18639f[_0xd3c6('0x13')]=parseValue(_0x50a045,_0x5f3100[_0xd3c6('0x11')],_0x5f3100[_0xd3c6('0x13')]);return _0x18639f;};function parseOperator(_0x2b0d81){var _0x1cd49a;switch(_0x2b0d81){case _0xd3c6('0x1c'):_0x1cd49a=_0xd3c6('0x1d');break;case _0xd3c6('0x1a'):_0x1cd49a=_0xd3c6('0x1e');break;case'$eq':_0x1cd49a=_0xd3c6('0x1f');break;case _0xd3c6('0x20'):_0x1cd49a=_0xd3c6('0x21');break;case'$substring':case'$startsWith':case _0xd3c6('0x22'):_0x1cd49a=_0xd3c6('0x23');break;case'$lt':_0x1cd49a=_0xd3c6('0x24');break;case'$gt':_0x1cd49a=_0xd3c6('0x25');break;case _0xd3c6('0x26'):_0x1cd49a=_0xd3c6('0x27');break;case _0xd3c6('0x28'):_0x1cd49a='>=\x20?';break;case _0xd3c6('0x12'):_0x1cd49a=_0xd3c6('0x29');break;}return _0x1cd49a;}function parseValue(_0x453ad7,_0x5992d9,_0x504ac1){var _0x1fc434={'start':undefined,'end':undefined};switch(_0x5992d9){case _0xd3c6('0x1c'):case _0xd3c6('0x1a'):_0x1fc434[_0xd3c6('0x2a')]=_0x504ac1[_0xd3c6('0x8')](',');break;case'$substring':_0x1fc434[_0xd3c6('0x2a')]='%'+_0x504ac1+'%';break;case'$startsWith':_0x1fc434[_0xd3c6('0x2a')]=_0x504ac1+'%';break;case'$endsWith':_0x1fc434[_0xd3c6('0x2a')]='%'+_0x504ac1;break;case _0xd3c6('0x12'):var _0x5c7b1b=_0x504ac1[_0xd3c6('0x8')](',');var _0x504ac1=_0x5c7b1b[_0xd3c6('0xb')]();var _0x2d9d2d=_0x5c7b1b[_0xd3c6('0x2b')]();if(_0x453ad7==='DATE'){_0x504ac1=moment(_0x504ac1)['utcOffset'](0x0,!![])[_0xd3c6('0x2c')]();_0x2d9d2d=moment(_0x2d9d2d)['utcOffset'](0x0,!![])['add'](0x17,_0xd3c6('0x2d'))[_0xd3c6('0x16')](0x3b,_0xd3c6('0x2e'))[_0xd3c6('0x16')](0x3b,_0xd3c6('0x2f'))[_0xd3c6('0x2c')]();}_0x1fc434={'start':_0x504ac1,'end':_0x2d9d2d};break;default:_0x1fc434[_0xd3c6('0x2a')]=_0x504ac1;break;}return _0x1fc434;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a008baa..19a567c 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 _0x2286=['order','pick','filter','where','merge','type','VIRTUAL','lodash','moment','filters','isEmpty','forOwn','find','DATE','isPlainObject','parse','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','split','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','ASC','length','omit','isObject','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','name','keys','query','intersection','model','attributes','fields','nolimit','limit'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x2286,0x77));var _0x6228=function(_0x2e4102,_0x380633){_0x2e4102=_0x2e4102-0x0;var _0x3bb1c3=_0x2286[_0x2e4102];return _0x3bb1c3;};'use strict';var _=require(_0x6228('0x0'));var sequelize=require('sequelize');var moment=require(_0x6228('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x1a1124){var _0x5649aa=null;if(_0x1a1124){_0x5649aa=_0x1a1124['split'](',');}return _0x5649aa;};exports[_0x6228('0x2')]=function(_0x55b83c,_0x1cf22b){var _0x3cc19f={};if(!_[_0x6228('0x3')](_0x55b83c)){_[_0x6228('0x4')](_0x55b83c,function(_0x3f8d16,_0x3efa72){try{if(_0x1cf22b){var _0x25a89c=_[_0x6228('0x5')](_0x1cf22b,{'name':_0x3efa72})||{};if(_0x25a89c['type']===_0x6228('0x6')&&_[_0x6228('0x7')](_0x3f8d16)){var _0x5cc175=JSON[_0x6228('0x8')](_0x3f8d16);var _0x56d911={'$gte':moment(moment(_0x5cc175[_0x6228('0x9')])['format'](_0x6228('0xa')))[_0x6228('0xb')]()[_0x6228('0xc')](),'$lte':moment(moment(_0x5cc175[_0x6228('0xd')])[_0x6228('0xc')](_0x6228('0xa')))[_0x6228('0xb')]()[_0x6228('0xe')](0x1,'s')[_0x6228('0xc')]()};_0x3cc19f[_0x3efa72]=_0x56d911;}else if(_0x25a89c['name']===_0x6228('0xf')){_0x3cc19f[_0x3efa72]=_0x3f8d16;}else{_0x3cc19f[_0x3efa72]=_['isArray'](_0x3f8d16)?_0x3f8d16:JSON[_0x6228('0x8')](_0x3f8d16);}}else{_0x3cc19f[_0x3efa72]=_[_0x6228('0x10')](_0x3f8d16)?_0x3f8d16:JSON[_0x6228('0x8')](_0x3f8d16);}}catch(_0x48a32e){_0x3cc19f[_0x3efa72]=_0x3f8d16[_0x6228('0x11')](',');}});}return _0x3cc19f;};exports['limit']=function(_0x20728b){_0x20728b=parseInt(_0x20728b,0xa);if(!_0x20728b||_0x20728b<0x0){_0x20728b=LIMIT_VALUE;}return _0x20728b;};exports[_0x6228('0x12')]=function(_0x266b64){_0x266b64=parseInt(_0x266b64,0xa);if(!_0x266b64||_0x266b64<0x0){_0x266b64=0x0;}return _0x266b64;};exports[_0x6228('0x13')]=function(_0x5e5195){var _0x1f8660,_0x42ee25=null;if(_0x5e5195){_0x1f8660=_0x5e5195[_0x6228('0x11')](',');_0x42ee25=_[_0x6228('0x14')](_0x1f8660,function(_0x114d87){if(_0x114d87[_0x6228('0x15')]('-')===0x0){return[_0x114d87===_0x6228('0x16')?sequelize['cast'](sequelize[_0x6228('0x17')](_0x6228('0x16')),_0x6228('0x18')):_0x114d87[_0x6228('0x19')](0x1),_0x6228('0x1a')];}else{return[_0x114d87===_0x6228('0x16')?sequelize['cast'](sequelize[_0x6228('0x17')]('priority'),'unsigned'):_0x114d87,_0x6228('0x1b')];}});}return _0x42ee25;};exports['omit']=function(_0x8887c7,_0x559cc7){if(_[_0x6228('0x3')](_0x8887c7)){return _0x8887c7;}if(_[_0x6228('0x10')](_0x8887c7)){for(var _0x1d08fc=0x0;_0x1d08fc<_0x8887c7[_0x6228('0x1c')];_0x1d08fc+=0x1){_0x8887c7[_0x1d08fc]=this[_0x6228('0x1d')](_0x8887c7[_0x1d08fc],_0x559cc7);}return _0x8887c7;}if(!_[_0x6228('0x1e')](_0x8887c7)){return _0x8887c7;}if(_['isString'](_0x559cc7)){_0x559cc7=[_0x559cc7];}if(!_[_0x6228('0x10')](_0x559cc7)){return _0x8887c7;}for(var _0x50a0c2=0x0;_0x50a0c2<_0x559cc7[_0x6228('0x1c')];_0x50a0c2+=0x1){_['unset'](_0x8887c7,_0x559cc7[_0x50a0c2]);}for(var _0x4788c5 in _0x8887c7){if(_0x8887c7[_0x6228('0x1f')](_0x4788c5)){_0x8887c7[_0x4788c5]=this[_0x6228('0x1d')](_0x8887c7[_0x4788c5],_0x559cc7);}}return _0x8887c7;};exports[_0x6228('0x20')]=function(_0x5dd83){return _0x5dd83['match'](RegExp(_0x6228('0x21')))?!![]:![];};exports[_0x6228('0x22')]=function(_0x169134){return _0x169134['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x6228('0x23')]=function(_0x401ab6){var _0x423a60=[];_0x401ab6[_0x6228('0x11')](/[ ,]+/)[_0x6228('0x24')](function(_0x266987){_0x266987=_0x266987[_0x6228('0x25')](/([^:]")"+/g,'$1');_0x266987='+'+_0x266987+'*';if(_0x266987['includes']('@'))_0x266987='\x22'+_0x266987+'\x22';_0x423a60[_0x6228('0x26')](_0x266987);});return _0x423a60[_0x6228('0x27')]('\x20');};exports['getOptions']=function(_0x65ea0a,_0x1fbff1){var _0x430da2={},_0x4ce529={};_0x430da2['model']=_[_0x6228('0x14')](_0x65ea0a,_0x6228('0x28'));_0x430da2['query']=_[_0x6228('0x29')](_0x1fbff1[_0x6228('0x2a')]);_0x430da2[_0x6228('0x2')]=_[_0x6228('0x2b')](_0x430da2[_0x6228('0x2c')],_0x430da2[_0x6228('0x2a')]);_0x4ce529[_0x6228('0x2d')]=_[_0x6228('0x2b')](_0x430da2[_0x6228('0x2c')],this[_0x6228('0x2e')](_0x1fbff1[_0x6228('0x2a')][_0x6228('0x2e')]));_0x4ce529[_0x6228('0x2d')]=_0x4ce529['attributes'][_0x6228('0x1c')]?_0x4ce529[_0x6228('0x2d')]:_0x430da2[_0x6228('0x2c')];if(!_0x1fbff1[_0x6228('0x2a')][_0x6228('0x1f')](_0x6228('0x2f'))){_0x4ce529['limit']=this['limit'](_0x1fbff1[_0x6228('0x2a')][_0x6228('0x30')]);_0x4ce529[_0x6228('0x12')]=this[_0x6228('0x12')](_0x1fbff1[_0x6228('0x2a')]['offset']);}_0x4ce529[_0x6228('0x31')]=this[_0x6228('0x13')](_0x1fbff1['query'][_0x6228('0x13')]);_0x4ce529['where']=this[_0x6228('0x2')](_[_0x6228('0x32')](_0x1fbff1[_0x6228('0x2a')],_0x430da2['filters']),_0x65ea0a);if(_0x1fbff1[_0x6228('0x2a')][_0x6228('0x33')]){_0x4ce529[_0x6228('0x34')]=_[_0x6228('0x35')](_0x4ce529[_0x6228('0x34')],{'$or':_[_0x6228('0x14')](_0x65ea0a,function(_0x442c7c){if(_0x442c7c[_0x6228('0x36')]!==_0x6228('0x37')){var _0x3efd15={};_0x3efd15[_0x442c7c[_0x6228('0x28')]]={'$like':'%'+_0x1fbff1[_0x6228('0x2a')][_0x6228('0x33')]+'%'};return _0x3efd15;}})});}_0x4ce529=_['merge']({},_0x4ce529,_0x1fbff1['options']);return _0x4ce529;}; \ No newline at end of file +var _0xb3d8=['sequelize','moment','fields','filters','isEmpty','forOwn','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','split','limit','offset','sort','indexOf','priority','cast','col','substr','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isEmail','getFullTextValue','forEach','replace','includes','push','getOptions','map','query','keys','intersection','model','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','options'];(function(_0x18a3c4,_0x277f40){var _0x3a3836=function(_0x3a0e47){while(--_0x3a0e47){_0x18a3c4['push'](_0x18a3c4['shift']());}};_0x3a3836(++_0x277f40);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x1a2185,_0x1ce2af){_0x1a2185=_0x1a2185-0x0;var _0x281173=_0xb3d8[_0x1a2185];return _0x281173;};'use strict';var _=require('lodash');var sequelize=require(_0x8b3d('0x0'));var moment=require(_0x8b3d('0x1'));var LIMIT_VALUE=0xfa;exports[_0x8b3d('0x2')]=function(_0x8c76a7){var _0x5dba96=null;if(_0x8c76a7){_0x5dba96=_0x8c76a7['split'](',');}return _0x5dba96;};exports[_0x8b3d('0x3')]=function(_0x3c71c3,_0x3d51ca){var _0x29d5f6={};if(!_[_0x8b3d('0x4')](_0x3c71c3)){_[_0x8b3d('0x5')](_0x3c71c3,function(_0x3b0f04,_0x4447a2){try{if(_0x3d51ca){var _0x7ddf10=_['find'](_0x3d51ca,{'name':_0x4447a2})||{};if(_0x7ddf10[_0x8b3d('0x6')]===_0x8b3d('0x7')&&_[_0x8b3d('0x8')](_0x3b0f04)){var _0x11161f=JSON[_0x8b3d('0x9')](_0x3b0f04);var _0x2a7637={'$gte':moment(moment(_0x11161f[_0x8b3d('0xa')])[_0x8b3d('0xb')](_0x8b3d('0xc')))[_0x8b3d('0xd')]()['format'](),'$lte':moment(moment(_0x11161f['$lte'])[_0x8b3d('0xb')](_0x8b3d('0xc')))[_0x8b3d('0xd')]()[_0x8b3d('0xe')](0x1,'s')[_0x8b3d('0xb')]()};_0x29d5f6[_0x4447a2]=_0x2a7637;}else if(_0x7ddf10[_0x8b3d('0xf')]===_0x8b3d('0x10')){_0x29d5f6[_0x4447a2]=_0x3b0f04;}else{_0x29d5f6[_0x4447a2]=_[_0x8b3d('0x11')](_0x3b0f04)?_0x3b0f04:JSON[_0x8b3d('0x9')](_0x3b0f04);}}else{_0x29d5f6[_0x4447a2]=_[_0x8b3d('0x11')](_0x3b0f04)?_0x3b0f04:JSON[_0x8b3d('0x9')](_0x3b0f04);}}catch(_0x3f03ee){_0x29d5f6[_0x4447a2]=_0x3b0f04[_0x8b3d('0x12')](',');}});}return _0x29d5f6;};exports[_0x8b3d('0x13')]=function(_0x173e94){_0x173e94=parseInt(_0x173e94,0xa);if(!_0x173e94||_0x173e94<0x0){_0x173e94=LIMIT_VALUE;}return _0x173e94;};exports[_0x8b3d('0x14')]=function(_0x4fc552){_0x4fc552=parseInt(_0x4fc552,0xa);if(!_0x4fc552||_0x4fc552<0x0){_0x4fc552=0x0;}return _0x4fc552;};exports[_0x8b3d('0x15')]=function(_0x381c0d){var _0x5c11b9,_0x37fd79=null;if(_0x381c0d){_0x5c11b9=_0x381c0d[_0x8b3d('0x12')](',');_0x37fd79=_['map'](_0x5c11b9,function(_0xb493ac){if(_0xb493ac[_0x8b3d('0x16')]('-')===0x0){return[_0xb493ac===_0x8b3d('0x17')?sequelize[_0x8b3d('0x18')](sequelize[_0x8b3d('0x19')]('priority'),'unsigned'):_0xb493ac[_0x8b3d('0x1a')](0x1),'DESC'];}else{return[_0xb493ac==='priority'?sequelize['cast'](sequelize[_0x8b3d('0x19')](_0x8b3d('0x17')),'unsigned'):_0xb493ac,_0x8b3d('0x1b')];}});}return _0x37fd79;};exports[_0x8b3d('0x1c')]=function(_0xff346c,_0xbdfd5){if(_[_0x8b3d('0x4')](_0xff346c)){return _0xff346c;}if(_[_0x8b3d('0x11')](_0xff346c)){for(var _0x3510f4=0x0;_0x3510f4<_0xff346c[_0x8b3d('0x1d')];_0x3510f4+=0x1){_0xff346c[_0x3510f4]=this[_0x8b3d('0x1c')](_0xff346c[_0x3510f4],_0xbdfd5);}return _0xff346c;}if(!_[_0x8b3d('0x1e')](_0xff346c)){return _0xff346c;}if(_[_0x8b3d('0x1f')](_0xbdfd5)){_0xbdfd5=[_0xbdfd5];}if(!_['isArray'](_0xbdfd5)){return _0xff346c;}for(var _0x37c98e=0x0;_0x37c98e<_0xbdfd5['length'];_0x37c98e+=0x1){_[_0x8b3d('0x20')](_0xff346c,_0xbdfd5[_0x37c98e]);}for(var _0x17cd4c in _0xff346c){if(_0xff346c[_0x8b3d('0x21')](_0x17cd4c)){_0xff346c[_0x17cd4c]=this[_0x8b3d('0x1c')](_0xff346c[_0x17cd4c],_0xbdfd5);}}return _0xff346c;};exports['isNumeric']=function(_0x219ecb){return _0x219ecb['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x8b3d('0x22')]=function(_0x513bb1){return _0x513bb1['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x8b3d('0x23')]=function(_0x3a075b){var _0x52467f=[];_0x3a075b['split'](/[ ,]+/)[_0x8b3d('0x24')](function(_0x3aef33){_0x3aef33=_0x3aef33[_0x8b3d('0x25')](/([^:]")"+/g,'$1');_0x3aef33='+'+_0x3aef33+'*';if(_0x3aef33[_0x8b3d('0x26')]('@'))_0x3aef33='\x22'+_0x3aef33+'\x22';_0x52467f[_0x8b3d('0x27')](_0x3aef33);});return _0x52467f['join']('\x20');};exports[_0x8b3d('0x28')]=function(_0x747446,_0x1125dc){var _0x322453={},_0x38c989={};_0x322453['model']=_[_0x8b3d('0x29')](_0x747446,_0x8b3d('0xf'));_0x322453[_0x8b3d('0x2a')]=_[_0x8b3d('0x2b')](_0x1125dc['query']);_0x322453[_0x8b3d('0x3')]=_[_0x8b3d('0x2c')](_0x322453[_0x8b3d('0x2d')],_0x322453['query']);_0x38c989[_0x8b3d('0x2e')]=_[_0x8b3d('0x2c')](_0x322453[_0x8b3d('0x2d')],this['fields'](_0x1125dc['query'][_0x8b3d('0x2')]));_0x38c989[_0x8b3d('0x2e')]=_0x38c989[_0x8b3d('0x2e')][_0x8b3d('0x1d')]?_0x38c989[_0x8b3d('0x2e')]:_0x322453[_0x8b3d('0x2d')];if(!_0x1125dc[_0x8b3d('0x2a')]['hasOwnProperty'](_0x8b3d('0x2f'))){_0x38c989[_0x8b3d('0x13')]=this[_0x8b3d('0x13')](_0x1125dc[_0x8b3d('0x2a')][_0x8b3d('0x13')]);_0x38c989[_0x8b3d('0x14')]=this[_0x8b3d('0x14')](_0x1125dc[_0x8b3d('0x2a')][_0x8b3d('0x14')]);}_0x38c989[_0x8b3d('0x30')]=this[_0x8b3d('0x15')](_0x1125dc[_0x8b3d('0x2a')][_0x8b3d('0x15')]);_0x38c989[_0x8b3d('0x31')]=this[_0x8b3d('0x3')](_[_0x8b3d('0x32')](_0x1125dc[_0x8b3d('0x2a')],_0x322453['filters']),_0x747446);if(_0x1125dc['query'][_0x8b3d('0x33')]){_0x38c989['where']=_[_0x8b3d('0x34')](_0x38c989[_0x8b3d('0x31')],{'$or':_[_0x8b3d('0x29')](_0x747446,function(_0x5e4a08){if(_0x5e4a08['type']!==_0x8b3d('0x35')){var _0x50a0b0={};_0x50a0b0[_0x5e4a08[_0x8b3d('0xf')]]={'$like':'%'+_0x1125dc['query']['filter']+'%'};return _0x50a0b0;}})});}_0x38c989=_['merge']({},_0x38c989,_0x1125dc[_0x8b3d('0x36')]);return _0x38c989;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 2dbfc3e..41de699 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a82=['join','root','development','use','json\x20replacer','toISOString','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath'];(function(_0x2d0644,_0x2a042e){var _0x1232e5=function(_0x32429c){while(--_0x32429c){_0x2d0644['push'](_0x2d0644['shift']());}};_0x1232e5(++_0x2a042e);}(_0x9a82,0xef));var _0x29a8=function(_0x525cf1,_0x56034f){_0x525cf1=_0x525cf1-0x0;var _0x5e0242=_0x9a82[_0x525cf1];return _0x5e0242;};'use strict';var express=require('express');var favicon=require(_0x29a8('0x0'));var bodyParser=require(_0x29a8('0x1'));var methodOverride=require(_0x29a8('0x2'));var cookieParser=require(_0x29a8('0x3'));var errorHandler=require(_0x29a8('0x4'));var path=require(_0x29a8('0x5'));var passport=require(_0x29a8('0x6'));var cors=require(_0x29a8('0x7'));var moment=require(_0x29a8('0x8'));var config=require(_0x29a8('0x9'));var db=require(_0x29a8('0xa'))['db'];exports[_0x29a8('0xb')]=function(_0x29a0c0){var _0x4ec6a2=_0x29a0c0[_0x29a8('0xc')](_0x29a8('0xd'));if(_0x4ec6a2===_0x29a8('0xe')){_0x29a0c0[_0x29a8('0xf')](_0x29a8('0x10'),path[_0x29a8('0x11')](config[_0x29a8('0x12')],'public'));}if(_0x4ec6a2===_0x29a8('0x13')||_0x4ec6a2==='test'){_0x29a0c0[_0x29a8('0xf')](_0x29a8('0x10'),path['join'](config[_0x29a8('0x12')],'client'));_0x29a0c0[_0x29a8('0x14')](errorHandler());}_0x29a0c0[_0x29a8('0xf')](_0x29a8('0x15'),function(_0xf55e4,_0xfb5da2){if(this[_0xf55e4]instanceof Date){_0xfb5da2=this[_0xf55e4][_0x29a8('0x16')]()['split']('.')[0x0]+'Z';}return _0xfb5da2;});_0x29a0c0[_0x29a8('0x14')](express[_0x29a8('0x17')](_0x29a0c0[_0x29a8('0xc')]('appPath')));_0x29a0c0[_0x29a8('0xf')](_0x29a8('0x18'),config[_0x29a8('0x12')]+_0x29a8('0x19'));_0x29a0c0[_0x29a8('0x1a')](_0x29a8('0x1b'),require(_0x29a8('0x1c'))[_0x29a8('0x1d')]);_0x29a0c0[_0x29a8('0xf')](_0x29a8('0x1e'),_0x29a8('0x1b'));_0x29a0c0[_0x29a8('0x14')](bodyParser[_0x29a8('0x1f')]({'limit':'50mb','extended':!![]}));_0x29a0c0[_0x29a8('0x14')](bodyParser['json']({'limit':'50mb'}));_0x29a0c0['use'](cors());_0x29a0c0['use'](methodOverride());_0x29a0c0[_0x29a8('0x14')](cookieParser());_0x29a0c0[_0x29a8('0x14')](passport['initialize']());}; \ No newline at end of file +var _0x85ca=['json\x20replacer','split','static','views','engine','html','ejs','renderFile','view\x20engine','50mb','json','initialize','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','../mysqldb','default','get','env','production','appPath','join','root','public','development','test','set','client','use'];(function(_0x22ac6a,_0x46eb37){var _0xb13da8=function(_0x26ad1a){while(--_0x26ad1a){_0x22ac6a['push'](_0x22ac6a['shift']());}};_0xb13da8(++_0x46eb37);}(_0x85ca,0x114));var _0xa85c=function(_0x588fe2,_0x5c2889){_0x588fe2=_0x588fe2-0x0;var _0x56cacb=_0x85ca[_0x588fe2];return _0x56cacb;};'use strict';var express=require(_0xa85c('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0xa85c('0x1'));var cookieParser=require(_0xa85c('0x2'));var errorHandler=require(_0xa85c('0x3'));var path=require('path');var passport=require(_0xa85c('0x4'));var cors=require(_0xa85c('0x5'));var moment=require('moment');var config=require(_0xa85c('0x6'));var db=require(_0xa85c('0x7'))['db'];exports[_0xa85c('0x8')]=function(_0x17c51c){var _0x40c52e=_0x17c51c[_0xa85c('0x9')](_0xa85c('0xa'));if(_0x40c52e===_0xa85c('0xb')){_0x17c51c['set'](_0xa85c('0xc'),path[_0xa85c('0xd')](config[_0xa85c('0xe')],_0xa85c('0xf')));}if(_0x40c52e===_0xa85c('0x10')||_0x40c52e===_0xa85c('0x11')){_0x17c51c[_0xa85c('0x12')](_0xa85c('0xc'),path[_0xa85c('0xd')](config[_0xa85c('0xe')],_0xa85c('0x13')));_0x17c51c[_0xa85c('0x14')](errorHandler());}_0x17c51c['set'](_0xa85c('0x15'),function(_0x4df7ac,_0x2c4a3e){if(this[_0x4df7ac]instanceof Date){_0x2c4a3e=this[_0x4df7ac]['toISOString']()[_0xa85c('0x16')]('.')[0x0]+'Z';}return _0x2c4a3e;});_0x17c51c[_0xa85c('0x14')](express[_0xa85c('0x17')](_0x17c51c['get']('appPath')));_0x17c51c[_0xa85c('0x12')](_0xa85c('0x18'),config[_0xa85c('0xe')]+'/server/views');_0x17c51c[_0xa85c('0x19')](_0xa85c('0x1a'),require(_0xa85c('0x1b'))[_0xa85c('0x1c')]);_0x17c51c['set'](_0xa85c('0x1d'),'html');_0x17c51c[_0xa85c('0x14')](bodyParser['urlencoded']({'limit':_0xa85c('0x1e'),'extended':!![]}));_0x17c51c[_0xa85c('0x14')](bodyParser[_0xa85c('0x1f')]({'limit':_0xa85c('0x1e')}));_0x17c51c[_0xa85c('0x14')](cors());_0x17c51c[_0xa85c('0x14')](methodOverride());_0x17c51c[_0xa85c('0x14')](cookieParser());_0x17c51c['use'](passport[_0xa85c('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 72b49e5..be10a08 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 _0x2343=['win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','md5','substring','bimedia-machine-uuid','child_process','../environment','networkInterfaces','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','getUuid','platform','licenseToken','test'];(function(_0xb802c1,_0x100ee8){var _0x2e07be=function(_0x52325d){while(--_0x52325d){_0xb802c1['push'](_0xb802c1['shift']());}};_0x2e07be(++_0x100ee8);}(_0x2343,0xb6));var _0x3234=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x2343[_0x2af053];return _0x4b4001;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require(_0x3234('0x0'));var exec=require(_0x3234('0x1'))['execSync'];var config=require(_0x3234('0x2'));function getInterfaces(){var _0x53ed38=[];var _0x34e467=os[_0x3234('0x3')]();var _0x127488=_['orderBy'](_[_0x3234('0x4')](_0x34e467));for(var _0x12069b=0x0;_0x12069b<_0x127488[_0x3234('0x5')];_0x12069b++){var _0x4b16b1=_0x34e467[_0x127488[_0x12069b]][_0x3234('0x6')](function(_0x1764c1){return _0x1764c1['family']===_0x3234('0x7')&&_0x1764c1[_0x3234('0x8')]===![];});_0x53ed38=_0x53ed38[_0x3234('0x9')](_0x4b16b1);}return _0x53ed38;}function getFirstInterface(){var _0x3f98bf=_[_0x3234('0xa')](getInterfaces());return{'macAddress':_0x3f98bf&&_0x3f98bf[_0x3234('0xb')]?_0x3f98bf[_0x3234('0xb')]:_0x3234('0xc'),'ipAddress':_0x3f98bf&&_0x3f98bf[_0x3234('0xd')]?_0x3f98bf[_0x3234('0xd')]:_0x3234('0xe')};}exports[_0x3234('0xf')]=getFirstInterface;function getCPUhash(){var _0x54cb6c=_['orderBy'](os[_0x3234('0x10')]()[_0x3234('0x11')](function(_0x204c17){return _0x204c17[_0x3234('0x12')];}))[_0x3234('0x13')](':');return crypto[_0x3234('0x14')]('md5')[_0x3234('0x15')](_0x54cb6c)[_0x3234('0x16')](_0x3234('0x17'));}exports[_0x3234('0x18')]=function(){var _0x1ddce1=os[_0x3234('0x19')]();var _0x37d4b6=/[0-9a-f-]{36}/;if(config[_0x3234('0x1a')]&&_0x37d4b6[_0x3234('0x1b')](config['licenseToken'])){return config[_0x3234('0x1a')];}else if(_0x1ddce1===_0x3234('0x1c')){return exec(_0x3234('0x1d'),{'encoding':_0x3234('0x1e')})[_0x3234('0x1f')]('\x0d\x0a','');}else{var _0xc83e84=getFirstInterface();var _0x1bc258=getCPUhash();var _0x3a1116=_0x1bc258+'|'+os['hostname']()+'|'+_0xc83e84['macAddress']+'|'+_0xc83e84[_0x3234('0x20')];var _0x3178f4=crypto[_0x3234('0x14')](_0x3234('0x21'))[_0x3234('0x15')](_0x3a1116)[_0x3234('0x16')](_0x3234('0x17'));return _0x3178f4[_0x3234('0x22')](0x0,0x8)+'-'+_0x3178f4[_0x3234('0x22')](0x8,0xc)+'-'+_0x3178f4[_0x3234('0x22')](0xc,0x10)+'-'+_0x3178f4[_0x3234('0x22')](0x10,0x14)+'-'+_0x3178f4[_0x3234('0x22')](0x14);}}; \ No newline at end of file +var _0x8e47=['macAddress','ipAddress','update','substring','lodash','crypto','child_process','execSync','networkInterfaces','orderBy','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x2d2b05,_0x2420d0){var _0x56dadc=function(_0x2fe21f){while(--_0x2fe21f){_0x2d2b05['push'](_0x2d2b05['shift']());}};_0x56dadc(++_0x2420d0);}(_0x8e47,0x90));var _0x78e4=function(_0x107b5f,_0x492f53){_0x107b5f=_0x107b5f-0x0;var _0x44118d=_0x8e47[_0x107b5f];return _0x44118d;};'use strict';var _=require(_0x78e4('0x0'));var os=require('os');var crypto=require(_0x78e4('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x78e4('0x2'))[_0x78e4('0x3')];var config=require('../environment');function getInterfaces(){var _0xc00040=[];var _0x49873d=os[_0x78e4('0x4')]();var _0x13e662=_[_0x78e4('0x5')](_['keys'](_0x49873d));for(var _0x4ab20c=0x0;_0x4ab20c<_0x13e662['length'];_0x4ab20c++){var _0x2770dd=_0x49873d[_0x13e662[_0x4ab20c]]['filter'](function(_0x35f98c){return _0x35f98c[_0x78e4('0x6')]==='IPv4'&&_0x35f98c[_0x78e4('0x7')]===![];});_0xc00040=_0xc00040[_0x78e4('0x8')](_0x2770dd);}return _0xc00040;}function getFirstInterface(){var _0x39d128=_[_0x78e4('0x9')](getInterfaces());return{'macAddress':_0x39d128&&_0x39d128[_0x78e4('0xa')]?_0x39d128[_0x78e4('0xa')]:_0x78e4('0xb'),'ipAddress':_0x39d128&&_0x39d128['address']?_0x39d128[_0x78e4('0xc')]:_0x78e4('0xd')};}exports[_0x78e4('0xe')]=getFirstInterface;function getCPUhash(){var _0x2a9a59=_[_0x78e4('0x5')](os[_0x78e4('0xf')]()[_0x78e4('0x10')](function(_0x240118){return _0x240118['model'];}))[_0x78e4('0x11')](':');return crypto[_0x78e4('0x12')](_0x78e4('0x13'))['update'](_0x2a9a59)[_0x78e4('0x14')](_0x78e4('0x15'));}exports[_0x78e4('0x16')]=function(){var _0x2bca46=os[_0x78e4('0x17')]();var _0x36846f=/[0-9a-f-]{36}/;if(config[_0x78e4('0x18')]&&_0x36846f[_0x78e4('0x19')](config[_0x78e4('0x18')])){return config['licenseToken'];}else if(_0x2bca46===_0x78e4('0x1a')){return exec(_0x78e4('0x1b'),{'encoding':_0x78e4('0x1c')})[_0x78e4('0x1d')]('\x0d\x0a','');}else{var _0x3576eb=getFirstInterface();var _0xb567c7=getCPUhash();var _0xb4dced=_0xb567c7+'|'+os[_0x78e4('0x1e')]()+'|'+_0x3576eb[_0x78e4('0x1f')]+'|'+_0x3576eb[_0x78e4('0x20')];var _0x1527b9=crypto[_0x78e4('0x12')](_0x78e4('0x13'))[_0x78e4('0x21')](_0xb4dced)[_0x78e4('0x14')](_0x78e4('0x15'));return _0x1527b9['substring'](0x0,0x8)+'-'+_0x1527b9[_0x78e4('0x22')](0x8,0xc)+'-'+_0x1527b9[_0x78e4('0x22')](0xc,0x10)+'-'+_0x1527b9[_0x78e4('0x22')](0x10,0x14)+'-'+_0x1527b9[_0x78e4('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index b8f0627..f01d133 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 _0x3037=['get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','getUuid','License','spread','message','default','util','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3037,0x12c));var _0x7303=function(_0x318e6b,_0x11d4dd){_0x318e6b=_0x318e6b-0x0;var _0x36bb2b=_0x3037[_0x318e6b];return _0x36bb2b;};'use strict';var util=require(_0x7303('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x7303('0x1'));var pkginfo=require(_0x7303('0x2'))(module,_0x7303('0x3'));var db=require(_0x7303('0x4'))['db'];var encryptor=require(_0x7303('0x5'));var hardware=require('./hardware');var logger=require(_0x7303('0x6'))(_0x7303('0x7'));var HOST=_0x7303('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x57672d){return new BPromise(function(_0x47e6d8,_0x71684f){var _0x2fcae5=util[_0x7303('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x57672d,module[_0x7303('0xa')]['version']);if(oldToken){_0x2fcae5=util[_0x7303('0x9')](_0x7303('0xb'),HOST,_0x57672d,module[_0x7303('0xa')][_0x7303('0x3')],oldToken);}var _0x17468d={'uri':_0x2fcae5,'method':_0x7303('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x17468d)[_0x7303('0xd')](function(_0x372dd8){_0x47e6d8(_0x372dd8);})[_0x7303('0xe')](function(_0x34a46a){_0x71684f(_0x34a46a);});});}function manageLicense(_0x30f20a,_0x258b0){var _0x35aadb=_0x258b0[_0x7303('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x35aadb[_0x7303('0x10')]!==_0x30f20a&&!_0x35aadb['data2']){oldToken=_0x35aadb[_0x7303('0x10')];}httpRequest(_0x30f20a)[_0x7303('0xd')](function(_0x2cf3d2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2cf3d2[_0x7303('0x11')]){isOldTokenSent=![];if(!_0x35aadb[_0x7303('0x7')]&&_0x35aadb[_0x7303('0x7')]!=_0x2cf3d2[_0x7303('0x7')]||_0x35aadb[_0x7303('0x7')]&&_0x35aadb[_0x7303('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x35aadb['license']&&!_0x35aadb['data2']&&_0x35aadb[_0x7303('0x7')]!=_0x2cf3d2[_0x7303('0x7')]){logger[_0x7303('0x13')](_0x7303('0x14'));}if(_0x35aadb[_0x7303('0x7')]&&!_0x35aadb[_0x7303('0x12')]&&_0x35aadb['license']==_0x2cf3d2[_0x7303('0x7')]){return _0x258b0;}return _0x258b0[_0x7303('0x15')]({'data1':_0x30f20a,'data2':null,'license':_0x2cf3d2[_0x7303('0x7')]});}else{if(_0x2cf3d2[_0x7303('0x7')]||_0x35aadb['license']){if(!_0x35aadb['data2']){if(_0x35aadb[_0x7303('0x10')]==_0x30f20a){GRAY_PERIOD_REASON=_0x7303('0x16');logger[_0x7303('0x13')](_0x7303('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x35aadb[_0x7303('0x10')],_0x30f20a);}logger[_0x7303('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x7303('0x18')](),moment()['format'](_0x7303('0x19')));return _0x258b0[_0x7303('0x15')]({'data2':encryptor['encryptString'](moment()[_0x7303('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x35aadb[_0x7303('0x12')]),_0x7303('0x1a'))>DAYS){logger['info'](_0x7303('0x1b'),moment()[_0x7303('0x9')](_0x7303('0x19')));isOldTokenSent=![];return _0x258b0[_0x7303('0x15')]({'data1':_0x30f20a,'data2':null,'license':null});}}}else{if(_0x35aadb['data1']!=_0x30f20a){logger['info'](_0x7303('0x1c'),_0x35aadb[_0x7303('0x10')],_0x30f20a);return _0x258b0[_0x7303('0x15')]({'data1':_0x30f20a,'data2':null,'license':null});}}}return _0x258b0;})[_0x7303('0xd')](function(_0x1c0a0a){_0x258b0=_0x1c0a0a;})[_0x7303('0xe')](function(_0x1816f5){logger[_0x7303('0x1d')](_0x1816f5['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x7303('0x1e')](),_0x258b0);},TIME);});}function defaultLicense(){var _0xd83e1d=hardware[_0x7303('0x1e')]();if(_0xd83e1d){return db[_0x7303('0x1f')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xd83e1d}})[_0x7303('0x20')](function(_0x40a37e,_0x5d0609){logger[_0x7303('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xd83e1d);manageLicense(_0xd83e1d,_0x40a37e);})[_0x7303('0xe')](function(_0x19af3e){logger[_0x7303('0x1d')](_0x19af3e[_0x7303('0x21')]);});}}exports[_0x7303('0x22')]=defaultLicense; \ No newline at end of file +var _0xba71=['DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days'];(function(_0x4c019c,_0x24980e){var _0x41dd6d=function(_0x3797d8){while(--_0x3797d8){_0x4c019c['push'](_0x4c019c['shift']());}};_0x41dd6d(++_0x24980e);}(_0xba71,0x127));var _0x1ba7=function(_0x494c54,_0x3f6626){_0x494c54=_0x494c54-0x0;var _0x646241=_0xba71[_0x494c54];return _0x646241;};'use strict';var util=require(_0x1ba7('0x0'));var moment=require(_0x1ba7('0x1'));var rp=require(_0x1ba7('0x2'));var BPromise=require(_0x1ba7('0x3'));var pkginfo=require(_0x1ba7('0x4'))(module,_0x1ba7('0x5'));var db=require(_0x1ba7('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x1ba7('0x7'));var logger=require(_0x1ba7('0x8'))('license');var HOST=_0x1ba7('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f97a7){return new BPromise(function(_0x5ca7e0,_0x35f323){var _0x56e489=util[_0x1ba7('0xa')](_0x1ba7('0xb'),HOST,_0x2f97a7,module['exports'][_0x1ba7('0x5')]);if(oldToken){_0x56e489=util[_0x1ba7('0xa')](_0x1ba7('0xc'),HOST,_0x2f97a7,module['exports'][_0x1ba7('0x5')],oldToken);}var _0x5e4d90={'uri':_0x56e489,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x5e4d90)[_0x1ba7('0xd')](function(_0x15ea30){_0x5ca7e0(_0x15ea30);})[_0x1ba7('0xe')](function(_0x478edd){_0x35f323(_0x478edd);});});}function manageLicense(_0xd4149f,_0x2fab03){var _0x2e84a9=_0x2fab03[_0x1ba7('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x2e84a9[_0x1ba7('0x10')]!==_0xd4149f&&!_0x2e84a9[_0x1ba7('0x11')]){oldToken=_0x2e84a9[_0x1ba7('0x10')];}httpRequest(_0xd4149f)['then'](function(_0x59371f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x59371f[_0x1ba7('0x12')]){isOldTokenSent=![];if(!_0x2e84a9[_0x1ba7('0x13')]&&_0x2e84a9[_0x1ba7('0x13')]!=_0x59371f['license']||_0x2e84a9[_0x1ba7('0x13')]&&_0x2e84a9[_0x1ba7('0x11')]){logger[_0x1ba7('0x14')](_0x1ba7('0x15'));}if(_0x2e84a9['license']&&!_0x2e84a9[_0x1ba7('0x11')]&&_0x2e84a9[_0x1ba7('0x13')]!=_0x59371f['license']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2e84a9['license']&&!_0x2e84a9[_0x1ba7('0x11')]&&_0x2e84a9[_0x1ba7('0x13')]==_0x59371f[_0x1ba7('0x13')]){return _0x2fab03;}return _0x2fab03[_0x1ba7('0x16')]({'data1':_0xd4149f,'data2':null,'license':_0x59371f[_0x1ba7('0x13')]});}else{if(_0x59371f[_0x1ba7('0x13')]||_0x2e84a9[_0x1ba7('0x13')]){if(!_0x2e84a9['data2']){if(_0x2e84a9[_0x1ba7('0x10')]==_0xd4149f){GRAY_PERIOD_REASON=_0x1ba7('0x17');logger['info'](_0x1ba7('0x18'));}else{GRAY_PERIOD_REASON=_0x1ba7('0x19');logger[_0x1ba7('0x14')](_0x1ba7('0x1a'),_0x2e84a9[_0x1ba7('0x10')],_0xd4149f);}logger[_0x1ba7('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x1ba7('0x1b')](),moment()['format'](_0x1ba7('0x1c')));return _0x2fab03[_0x1ba7('0x16')]({'data2':encryptor[_0x1ba7('0x1d')](moment()[_0x1ba7('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x1ba7('0x1e')](encryptor[_0x1ba7('0x1f')](_0x2e84a9[_0x1ba7('0x11')]),_0x1ba7('0x20'))>DAYS){logger['info'](_0x1ba7('0x21'),moment()[_0x1ba7('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x2fab03[_0x1ba7('0x16')]({'data1':_0xd4149f,'data2':null,'license':null});}}}else{if(_0x2e84a9[_0x1ba7('0x10')]!=_0xd4149f){logger[_0x1ba7('0x14')](_0x1ba7('0x1a'),_0x2e84a9[_0x1ba7('0x10')],_0xd4149f);return _0x2fab03[_0x1ba7('0x16')]({'data1':_0xd4149f,'data2':null,'license':null});}}}return _0x2fab03;})[_0x1ba7('0xd')](function(_0x4bd462){_0x2fab03=_0x4bd462;})[_0x1ba7('0xe')](function(_0x1b9ea6){logger['error'](_0x1b9ea6[_0x1ba7('0x22')]);})[_0x1ba7('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x1ba7('0x24')](),_0x2fab03);},TIME);});}function defaultLicense(){var _0x3c1fd4=hardware[_0x1ba7('0x24')]();if(_0x3c1fd4){return db[_0x1ba7('0x25')][_0x1ba7('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x3c1fd4}})[_0x1ba7('0x27')](function(_0x6ea563,_0x5b14df){logger['info'](_0x1ba7('0x28'),_0x3c1fd4);manageLicense(_0x3c1fd4,_0x6ea563);})[_0x1ba7('0xe')](function(_0x352acc){logger['error'](_0x352acc['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index e621135..329146e 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 _0xb594=['data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','demo','gray','deadline','add','days','grayReason','machineUuid','disabled','message','User','findAll','role','COUNT','sequelize','col','count','admin','user','telephone','users','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid'];(function(_0x48aae3,_0x5a47de){var _0x24c19d=function(_0x5c1ba2){while(--_0x5c1ba2){_0x48aae3['push'](_0x48aae3['shift']());}};_0x24c19d(++_0x5a47de);}(_0xb594,0x117));var _0x4b59=function(_0x3502e,_0x264b8b){_0x3502e=_0x3502e-0x0;var _0x300758=_0xb594[_0x3502e];return _0x300758;};'use strict';var util=require(_0x4b59('0x0'));var _=require(_0x4b59('0x1'));var moment=require('moment');var BPromise=require(_0x4b59('0x2'));var hardware=require(_0x4b59('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x4b59('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b59('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4b59('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4b59('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4b59('0x7'),'machineUuid':hardware[_0x4b59('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x365c71){return new BPromise(function(_0x1ca068,_0x4eefb5){return db[_0x4b59('0x9')][_0x4b59('0xa')](_[_0x4b59('0xb')](_0x365c71,{'raw':!![],'where':{'id':0x1}}))[_0x4b59('0xc')](function(_0x4082aa){return checkLicense(_0x4082aa,null);})[_0x4b59('0xc')](function(_0x1b1500){_0x1ca068(_0x1b1500);return;})[_0x4b59('0xd')](function(_0x319eea){_0x4eefb5(_0x319eea);});});}function checkLicense(_0x28ee3a,_0x2aba56){if(!_0x28ee3a){demoLicense[_0x4b59('0xe')]=_0x28ee3a[_0x4b59('0xf')];return demoLicense;}try{var _0x1e6256=_0x2aba56||_0x28ee3a[_0x4b59('0x10')];if(_[_0x4b59('0x11')](_0x1e6256)){throw new Error(_0x4b59('0x12'));}var _0x15f65b=_0x28ee3a['data1'];var _0x2de92f=_0x28ee3a[_0x4b59('0x13')];var _0x39a5b7=_0x15f65b[_0x4b59('0x14')]('-')[0x4];var _0x2b96b7=_0x15f65b[_0x4b59('0x14')]('-')[0x0];var _0x157baa=encryptor[_0x4b59('0x15')](_0x1e6256,util[_0x4b59('0x16')]('%s:%s:%s',_0x39a5b7,_0x15f65b,_0x2b96b7));var _0x2056a2=JSON['parse'](_0x157baa);_0x2056a2[_0x4b59('0x17')]=![];_0x2056a2[_0x4b59('0xe')]=_0x15f65b;_0x2056a2['machineUuid']=hardware[_0x4b59('0x8')]();if(_0x2de92f){var _0x32ca74=encryptor['decryptString'](_0x2de92f);_0x2056a2[_0x4b59('0x18')]=_0x32ca74;_0x2056a2[_0x4b59('0x19')]=moment(_0x32ca74)[_0x4b59('0x1a')](0x7,_0x4b59('0x1b'))[_0x4b59('0x16')]();_0x2056a2[_0x4b59('0x1c')]=_0x2056a2[_0x4b59('0xe')]!=_0x2056a2[_0x4b59('0x1d')]?'changed':_0x4b59('0x1e');}return _0x2056a2;}catch(_0x2753b9){breakingLicense['uuid']=_0x28ee3a['data1'];breakingLicense[_0x4b59('0x1f')]=_0x2753b9[_0x4b59('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4d3d82,_0xdd4ca8){getLicense()[_0x4b59('0xc')](function(_0x973663){return db[_0x4b59('0x20')][_0x4b59('0x21')]({'attributes':[_0x4b59('0x22'),[db['sequelize']['fn'](_0x4b59('0x23'),db[_0x4b59('0x24')][_0x4b59('0x25')]('role')),_0x4b59('0x26')]],'group':'role','where':{'role':{'$or':[_0x4b59('0x27'),_0x4b59('0x28'),_0x4b59('0x29')]}},'raw':!![]})[_0x4b59('0xc')](function(_0x17a888){var _0x3de1e2={'user':_0x973663[_0x4b59('0x2a')]||0x0,'telephone':_0x973663['telephones']||0x0};_0x17a888[_0x4b59('0x2b')](function(_0xa2f24e){var _0x3394e9=_0xa2f24e[_0x4b59('0x22')]===_0x4b59('0x27')?_0x4b59('0x28'):_0xa2f24e[_0x4b59('0x22')];_0x3de1e2[_0x3394e9]-=_0xa2f24e['count'];if(_0x3de1e2[_0x3394e9]<0x0)_0x3de1e2[_0x3394e9]=0x0;});_0x4d3d82(_0x3de1e2);return;});})[_0x4b59('0xd')](function(_0x286d35){_0xdd4ca8(_0x286d35);});});}function checkUserLimits(_0xa0823e){return new BPromise(function(_0x7626e6,_0x1638fa){getLimits()[_0x4b59('0xc')](function(_0x155306){var _0x4fadcc=_[_0x4b59('0x2c')](_[_0x4b59('0x2d')](_0xa0823e,'role'),[_0x4b59('0x27'),_0x4b59('0x28'),_0x4b59('0x29')]);var _0x1cec0a=(_0x4fadcc[_0x4b59('0x27')]||0x0)+(_0x4fadcc[_0x4b59('0x28')]||0x0);var _0x56374=_0x4fadcc[_0x4b59('0x29')]||0x0;if(_0x1cec0a>_0x155306[_0x4b59('0x28')])return _0x1638fa(_0x4b59('0x2e'));if(_0x56374>_0x155306[_0x4b59('0x29')])return _0x1638fa(_0x4b59('0x2f'));return _0x7626e6();})['catch'](function(_0x570fcf){_0x1638fa(_0x570fcf);});});}module[_0x4b59('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x11b1=['grayReason','uuid','changed','disabled','data1','User','findAll','role','sequelize','COUNT','count','admin','telephone','forEach','user','pick','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','parse','demo','add','days','format'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x11b1,0x115));var _0x111b=function(_0x24174f,_0x414730){_0x24174f=_0x24174f-0x0;var _0x5d2e66=_0x11b1[_0x24174f];return _0x5d2e66;};'use strict';var util=require(_0x111b('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x111b('0x1'));var hardware=require(_0x111b('0x2'));var encryptor=require(_0x111b('0x3'));var db=require(_0x111b('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x111b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x111b('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x111b('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4cb9df){return new BPromise(function(_0x49a345,_0x15cdcc){return db[_0x111b('0x8')][_0x111b('0x9')](_[_0x111b('0xa')](_0x4cb9df,{'raw':!![],'where':{'id':0x1}}))[_0x111b('0xb')](function(_0x5b2ec9){return checkLicense(_0x5b2ec9,null);})[_0x111b('0xb')](function(_0x5ccd4c){_0x49a345(_0x5ccd4c);return;})[_0x111b('0xc')](function(_0x4a68ff){_0x15cdcc(_0x4a68ff);});});}function checkLicense(_0x1393a7,_0x21928a){if(!_0x1393a7){demoLicense['uuid']=_0x1393a7['data1'];return demoLicense;}try{var _0x189736=_0x21928a||_0x1393a7[_0x111b('0xd')];if(_[_0x111b('0xe')](_0x189736)){throw new Error(_0x111b('0xf'));}var _0x12a0f5=_0x1393a7['data1'];var _0x1eca86=_0x1393a7[_0x111b('0x10')];var _0x6d1f82=_0x12a0f5[_0x111b('0x11')]('-')[0x4];var _0x31bea3=_0x12a0f5['split']('-')[0x0];var _0x4fdc17=encryptor[_0x111b('0x12')](_0x189736,util['format']('%s:%s:%s',_0x6d1f82,_0x12a0f5,_0x31bea3));var _0x5c4f46=JSON[_0x111b('0x13')](_0x4fdc17);_0x5c4f46[_0x111b('0x14')]=![];_0x5c4f46['uuid']=_0x12a0f5;_0x5c4f46['machineUuid']=hardware[_0x111b('0x6')]();if(_0x1eca86){var _0x26d84f=encryptor['decryptString'](_0x1eca86);_0x5c4f46['gray']=_0x26d84f;_0x5c4f46['deadline']=moment(_0x26d84f)[_0x111b('0x15')](0x7,_0x111b('0x16'))[_0x111b('0x17')]();_0x5c4f46[_0x111b('0x18')]=_0x5c4f46[_0x111b('0x19')]!=_0x5c4f46['machineUuid']?_0x111b('0x1a'):_0x111b('0x1b');}return _0x5c4f46;}catch(_0x459a48){breakingLicense[_0x111b('0x19')]=_0x1393a7[_0x111b('0x1c')];breakingLicense['message']=_0x459a48['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4247ab,_0x526828){getLicense()[_0x111b('0xb')](function(_0x5ff468){return db[_0x111b('0x1d')][_0x111b('0x1e')]({'attributes':[_0x111b('0x1f'),[db[_0x111b('0x20')]['fn'](_0x111b('0x21'),db['sequelize']['col'](_0x111b('0x1f'))),_0x111b('0x22')]],'group':_0x111b('0x1f'),'where':{'role':{'$or':[_0x111b('0x23'),'user',_0x111b('0x24')]}},'raw':!![]})[_0x111b('0xb')](function(_0x5eee9a){var _0x4ea1e1={'user':_0x5ff468['users']||0x0,'telephone':_0x5ff468['telephones']||0x0};_0x5eee9a[_0x111b('0x25')](function(_0x585e9e){var _0x2fee06=_0x585e9e[_0x111b('0x1f')]===_0x111b('0x23')?_0x111b('0x26'):_0x585e9e[_0x111b('0x1f')];_0x4ea1e1[_0x2fee06]-=_0x585e9e[_0x111b('0x22')];if(_0x4ea1e1[_0x2fee06]<0x0)_0x4ea1e1[_0x2fee06]=0x0;});_0x4247ab(_0x4ea1e1);return;});})[_0x111b('0xc')](function(_0x6abe19){_0x526828(_0x6abe19);});});}function checkUserLimits(_0xac6c9e){return new BPromise(function(_0x12289e,_0x31fb64){getLimits()['then'](function(_0x40eb63){var _0x3308e5=_[_0x111b('0x27')](_['countBy'](_0xac6c9e,'role'),[_0x111b('0x23'),_0x111b('0x26'),_0x111b('0x24')]);var _0x53cf5e=(_0x3308e5['admin']||0x0)+(_0x3308e5[_0x111b('0x26')]||0x0);var _0x49b293=_0x3308e5[_0x111b('0x24')]||0x0;if(_0x53cf5e>_0x40eb63[_0x111b('0x26')])return _0x31fb64(_0x111b('0x28'));if(_0x49b293>_0x40eb63[_0x111b('0x24')])return _0x31fb64(_0x111b('0x29'));return _0x12289e();})[_0x111b('0xc')](function(_0x23cf60){_0x31fb64(_0x23cf60);});});}module[_0x111b('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index dd5e276..9bd33db 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 _0x7334=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x170b8f,_0x145bb5){var _0x212301=function(_0x9265ed){while(--_0x9265ed){_0x170b8f['push'](_0x170b8f['shift']());}};_0x212301(++_0x145bb5);}(_0x7334,0x184));var _0x4733=function(_0x367ab2,_0x460310){_0x367ab2=_0x367ab2-0x0;var _0x3a04d4=_0x7334[_0x367ab2];return _0x3a04d4;};'use strict';module[_0x4733('0x0')]={'DOMAIN':_0x4733('0x1'),'SESSION_SECRET':_0x4733('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x63a5=['myappanuglar-secret','secret','exports','http://localhost:9000'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x63a5,0x18e));var _0x563a=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x63a5[_0x456fb1];return _0x4083d6;};'use strict';module[_0x563a('0x0')]={'DOMAIN':_0x563a('0x1'),'SESSION_SECRET':_0x563a('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x563a('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 61ec1f3..5bf32fa 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb88c=['message','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','transports','File','%s-%s','error','info','env','debugLevel','moment','winston','util','path','INFO','/var','log','xcally','%s-%s.log'];(function(_0x111494,_0x1d73da){var _0x1d0d8b=function(_0x344935){while(--_0x344935){_0x111494['push'](_0x111494['shift']());}};_0x1d0d8b(++_0x1d73da);}(_0xb88c,0x1d7));var _0xcb88=function(_0x49331c,_0x5a0f4d){_0x49331c=_0x49331c-0x0;var _0x200932=_0xb88c[_0x49331c];return _0x200932;};'use strict';var moment=require(_0xcb88('0x0'));var winston=require(_0xcb88('0x1'));var util=require(_0xcb88('0x2'));var path=require(_0xcb88('0x3'));var debugLevel=_0xcb88('0x4');function filename(_0x3a199e,_0x525bb6){return path['join'](_0xcb88('0x5'),_0xcb88('0x6'),_0xcb88('0x7'),util['format'](_0xcb88('0x8'),_0x3a199e,_0x525bb6));}function formatter(_0xa00ae,_0x49079f){_0x49079f[_0xcb88('0x9')]=_0x49079f['message'][_0xcb88('0xa')](/@@{/g,_0xcb88('0xb'))[_0xcb88('0xa')](/}@@/g,'}}}')[_0xcb88('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xcb88('0xc')](_0xcb88('0xd'),moment()[_0xcb88('0xc')](_0xcb88('0xe')),_0x49079f['level'][_0xcb88('0xf')](),_0xa00ae,_0x49079f[_0xcb88('0x9')]);}module[_0xcb88('0x10')]=function(_0x3622fd){return new winston['Logger']({'transports':[new winston[(_0xcb88('0x11'))][(_0xcb88('0x12'))]({'name':util[_0xcb88('0xc')](_0xcb88('0x13'),_0x3622fd,'error'),'filename':filename(_0x3622fd,_0xcb88('0x14')),'level':_0xcb88('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x52ab04){return formatter(_0x3622fd,_0x52ab04);}}),new winston[(_0xcb88('0x11'))][(_0xcb88('0x12'))]({'name':util[_0xcb88('0xc')](_0xcb88('0x13'),_0x3622fd,_0xcb88('0x15')),'filename':filename(_0x3622fd,_0xcb88('0x15')),'level':_0xcb88('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x484e7c){return formatter(_0x3622fd,_0x484e7c);}}),new winston[(_0xcb88('0x11'))]['Console']({'level':process[_0xcb88('0x16')][_0xcb88('0x17')]||debugLevel,'json':![],'formatter':function(_0x138383){return formatter(_0x3622fd,_0x138383);}})]});}; \ No newline at end of file +var _0x8b63=['YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','%s-%s','error','File','info','Console','env','debugLevel','moment','winston','util','INFO','join','/var','log','xcally','format','%s-%s.log','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b63,0x145));var _0x38b6=function(_0x27d157,_0x39f652){_0x27d157=_0x27d157-0x0;var _0x351ba0=_0x8b63[_0x27d157];return _0x351ba0;};'use strict';var moment=require(_0x38b6('0x0'));var winston=require(_0x38b6('0x1'));var util=require(_0x38b6('0x2'));var path=require('path');var debugLevel=_0x38b6('0x3');function filename(_0x3df893,_0x1e58df){return path[_0x38b6('0x4')](_0x38b6('0x5'),_0x38b6('0x6'),_0x38b6('0x7'),util[_0x38b6('0x8')](_0x38b6('0x9'),_0x3df893,_0x1e58df));}function formatter(_0x18b8f8,_0x4b2eae){_0x4b2eae['message']=_0x4b2eae['message'][_0x38b6('0xa')](/@@{/g,'{{{')[_0x38b6('0xa')](/}@@/g,_0x38b6('0xb'))[_0x38b6('0xa')](/@{/g,'{{')[_0x38b6('0xa')](/}@/g,'}}');return util[_0x38b6('0x8')](_0x38b6('0xc'),moment()[_0x38b6('0x8')](_0x38b6('0xd')),_0x4b2eae[_0x38b6('0xe')][_0x38b6('0xf')](),_0x18b8f8,_0x4b2eae['message']);}module[_0x38b6('0x10')]=function(_0x3c6804){return new winston[(_0x38b6('0x11'))]({'transports':[new winston[(_0x38b6('0x12'))]['File']({'name':util['format'](_0x38b6('0x13'),_0x3c6804,'error'),'filename':filename(_0x3c6804,_0x38b6('0x14')),'level':_0x38b6('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41aa32){return formatter(_0x3c6804,_0x41aa32);}}),new winston['transports'][(_0x38b6('0x15'))]({'name':util[_0x38b6('0x8')]('%s-%s',_0x3c6804,'info'),'filename':filename(_0x3c6804,_0x38b6('0x16')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1d1ac4){return formatter(_0x3c6804,_0x1d1ac4);}}),new winston['transports'][(_0x38b6('0x17'))]({'level':process[_0x38b6('0x18')][_0x38b6('0x19')]||debugLevel,'json':![],'formatter':function(_0x22658f){return formatter(_0x3c6804,_0x22658f);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5dff358..7d3f2f9 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 _0xe2a3=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x110e00,_0x20940c){var _0x8bb473=function(_0x16aca4){while(--_0x16aca4){_0x110e00['push'](_0x110e00['shift']());}};_0x8bb473(++_0x20940c);}(_0xe2a3,0x12a));var _0x3e2a=function(_0x4dd2d3,_0x264f72){_0x4dd2d3=_0x4dd2d3-0x0;var _0x269be2=_0xe2a3[_0x4dd2d3];return _0x269be2;};'use strict';var path=require(_0x3e2a('0x0'));var os=require('os');var config={'apps':[{'name':_0x3e2a('0x1'),'script':path[_0x3e2a('0x2')](__dirname,_0x3e2a('0x3'))},{'name':_0x3e2a('0x4'),'script':path['join'](__dirname,_0x3e2a('0x5'))},{'name':'agi','script':path[_0x3e2a('0x2')](__dirname,_0x3e2a('0x6'))},{'name':_0x3e2a('0x7'),'script':path[_0x3e2a('0x2')](__dirname,_0x3e2a('0x8'))},{'name':'routing','script':path[_0x3e2a('0x2')](__dirname,_0x3e2a('0x9'))},{'name':_0x3e2a('0xa'),'script':path[_0x3e2a('0x2')](__dirname,_0x3e2a('0xb'))}]};module[_0x3e2a('0xc')]=config; \ No newline at end of file +var _0x8e13=['agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8e13,0x68));var _0x38e1=function(_0x5ee081,_0x2be78e){_0x5ee081=_0x5ee081-0x0;var _0x5eb46b=_0x8e13[_0x5ee081];return _0x5eb46b;};'use strict';var path=require(_0x38e1('0x0'));var os=require('os');var config={'apps':[{'name':_0x38e1('0x1'),'script':path[_0x38e1('0x2')](__dirname,_0x38e1('0x3'))},{'name':'ami','script':path[_0x38e1('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x38e1('0x4'),'script':path[_0x38e1('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x38e1('0x5'),'script':path[_0x38e1('0x2')](__dirname,_0x38e1('0x6'))},{'name':_0x38e1('0x7'),'script':path[_0x38e1('0x2')](__dirname,_0x38e1('0x8'))},{'name':_0x38e1('0x9'),'script':path[_0x38e1('0x2')](__dirname,_0x38e1('0xa'))}]};module[_0x38e1('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 0e8a1fd..1824cda 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 _0xd3ed=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x4ecbba,_0x3c366f){var _0x569384=function(_0x38a8a5){while(--_0x38a8a5){_0x4ecbba['push'](_0x4ecbba['shift']());}};_0x569384(++_0x3c366f);}(_0xd3ed,0x138));var _0xdd3e=function(_0x2e6646,_0xf55366){_0x2e6646=_0x2e6646-0x0;var _0x8705c=_0xd3ed[_0x2e6646];return _0x8705c;};'use strict';var pm2=require(_0xdd3e('0x0'));var BPromise=require(_0xdd3e('0x1'));var config=require(_0xdd3e('0x2'));function connect(){return new BPromise(function(_0x30788,_0x5f4816){return pm2[_0xdd3e('0x3')](function(_0x16e27c){if(_0x16e27c){return _0x5f4816(_0x16e27c);}return _0x30788(_0xdd3e('0x4'));});});};exports[_0xdd3e('0x5')]=function(_0x18b47e){return connect()[_0xdd3e('0x6')](function(){return new BPromise(function(_0x1d86f9,_0x57730a){return pm2[_0xdd3e('0x5')](_0x18b47e,function(_0x9a73aa,_0x3cf032){if(_0x9a73aa){return _0x57730a(_0x9a73aa);}pm2[_0xdd3e('0x7')]();return _0x1d86f9(_0x3cf032);});});});};exports[_0xdd3e('0x8')]=function(_0x2c2948){return connect()[_0xdd3e('0x6')](function(){return new BPromise(function(_0x24ff1b,_0x12fc29){return pm2['stop'](_0x2c2948,function(_0x22a5e1,_0x5aa77a){if(_0x22a5e1){return _0x12fc29(_0x22a5e1);}pm2[_0xdd3e('0x7')]();return _0x24ff1b(_0x5aa77a);});});});};exports[_0xdd3e('0x9')]=function(_0x17e62e){return connect()[_0xdd3e('0x6')](function(){return new BPromise(function(_0x5dcf43,_0x19f508){return pm2[_0xdd3e('0x9')](_0x17e62e,function(_0x47500e,_0x4f273f){if(_0x47500e){return _0x19f508(_0x47500e);}pm2[_0xdd3e('0x7')]();return _0x5dcf43(_0x4f273f);});});});};exports[_0xdd3e('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x17160d,_0x3d2c5f){return pm2[_0xdd3e('0xa')](function(_0x34ece8,_0x46ea45){if(_0x34ece8){return _0x3d2c5f(_0x34ece8);}pm2[_0xdd3e('0x7')]();return _0x17160d(_0x46ea45);});});});};exports[_0xdd3e('0xb')]=function(_0x2e060c){return connect()[_0xdd3e('0x6')](function(){return new BPromise(function(_0x56942f,_0x267936){return pm2['describe'](_0x2e060c,function(_0x448633,_0x844fbd){if(_0x448633){return _0x267936(_0x448633);}pm2[_0xdd3e('0x7')]();return _0x56942f(_0x844fbd);});});});};exports[_0xdd3e('0xc')]=function(_0x28fbbd){return connect()[_0xdd3e('0x6')](function(){return new BPromise(function(_0x3df258,_0xacc801){return pm2['delete'](_0x28fbbd,function(_0x579018,_0x25d43d){if(_0x579018){return _0xacc801(_0x579018);}pm2[_0xdd3e('0x7')]();return _0x3df258(_0x25d43d);});});});};exports[_0xdd3e('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x47dbcc,_0x13db78){return pm2[_0xdd3e('0xd')](function(_0x245d53){if(_0x245d53){return _0x13db78(_0x245d53);}return _0x47dbcc(_0xdd3e('0xe'));});});});}; \ No newline at end of file +var _0xbc1f=['start','disconnect','stop','restart','then','list','describe','delete','dump','bluebird','./config','connect','connected'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc1f,0x1d0));var _0xfbc1=function(_0x35144f,_0x516095){_0x35144f=_0x35144f-0x0;var _0x2858d0=_0xbc1f[_0x35144f];return _0x2858d0;};'use strict';var pm2=require('pm2');var BPromise=require(_0xfbc1('0x0'));var config=require(_0xfbc1('0x1'));function connect(){return new BPromise(function(_0x85ad83,_0x4322f2){return pm2[_0xfbc1('0x2')](function(_0x12933c){if(_0x12933c){return _0x4322f2(_0x12933c);}return _0x85ad83(_0xfbc1('0x3'));});});};exports[_0xfbc1('0x4')]=function(_0x4bc0d5){return connect()['then'](function(){return new BPromise(function(_0xaa1788,_0x21fa94){return pm2[_0xfbc1('0x4')](_0x4bc0d5,function(_0x3a0d86,_0x589e47){if(_0x3a0d86){return _0x21fa94(_0x3a0d86);}pm2[_0xfbc1('0x5')]();return _0xaa1788(_0x589e47);});});});};exports[_0xfbc1('0x6')]=function(_0x4ec25e){return connect()['then'](function(){return new BPromise(function(_0x228c9e,_0x54fc43){return pm2[_0xfbc1('0x6')](_0x4ec25e,function(_0x3e4c04,_0x334329){if(_0x3e4c04){return _0x54fc43(_0x3e4c04);}pm2[_0xfbc1('0x5')]();return _0x228c9e(_0x334329);});});});};exports[_0xfbc1('0x7')]=function(_0x57ca52){return connect()[_0xfbc1('0x8')](function(){return new BPromise(function(_0x4b15d2,_0x50569e){return pm2[_0xfbc1('0x7')](_0x57ca52,function(_0x3d552b,_0x1a89b1){if(_0x3d552b){return _0x50569e(_0x3d552b);}pm2[_0xfbc1('0x5')]();return _0x4b15d2(_0x1a89b1);});});});};exports[_0xfbc1('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1529ce,_0x5778e2){return pm2['list'](function(_0x611da5,_0x2bf446){if(_0x611da5){return _0x5778e2(_0x611da5);}pm2['disconnect']();return _0x1529ce(_0x2bf446);});});});};exports[_0xfbc1('0xa')]=function(_0x4348b6){return connect()[_0xfbc1('0x8')](function(){return new BPromise(function(_0x28c7de,_0x341fd5){return pm2[_0xfbc1('0xa')](_0x4348b6,function(_0x30e817,_0x2c13d4){if(_0x30e817){return _0x341fd5(_0x30e817);}pm2[_0xfbc1('0x5')]();return _0x28c7de(_0x2c13d4);});});});};exports[_0xfbc1('0xb')]=function(_0x5f4a7a){return connect()[_0xfbc1('0x8')](function(){return new BPromise(function(_0x2d8973,_0xfd53b1){return pm2[_0xfbc1('0xb')](_0x5f4a7a,function(_0x4ad35b,_0x245c71){if(_0x4ad35b){return _0xfd53b1(_0x4ad35b);}pm2[_0xfbc1('0x5')]();return _0x2d8973(_0x245c71);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x39d4c1,_0x259a17){return pm2[_0xfbc1('0xc')](function(_0x17a12a){if(_0x17a12a){return _0x259a17(_0x17a12a);}return _0x39d4c1('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index d2a9764..64b07d2 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 _0x5db6=['chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','length','map','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','join'];(function(_0x114c53,_0x2249c6){var _0x4e0c14=function(_0x1fe406){while(--_0x1fe406){_0x114c53['push'](_0x114c53['shift']());}};_0x4e0c14(++_0x2249c6);}(_0x5db6,0x106));var _0x65db=function(_0x47032a,_0x3750d3){_0x47032a=_0x47032a-0x0;var _0x5609ba=_0x5db6[_0x47032a];return _0x5609ba;};'use strict';var _=require(_0x65db('0x0'));var moment=require(_0x65db('0x1'));var Redis=require(_0x65db('0x2'));var util=require(_0x65db('0x3'));var config=require(_0x65db('0x4'));var db=require(_0x65db('0x5'))['db'];var logger=require(_0x65db('0x6'))(_0x65db('0x7'));config[_0x65db('0x8')]=_['defaults'](config[_0x65db('0x8')],{'host':_0x65db('0x9'),'port':0x18eb});var io=require(_0x65db('0xa'))(new Redis(config[_0x65db('0x8')]));function closeInteractions(){var _0xb8f5b3=0x0;var _0x45b483=[];return db['Setting']['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x2d8f1e){_0xb8f5b3=_0x2d8f1e[_0x65db('0xb')];if(_0xb8f5b3){return db[_0x65db('0xc')][_0x65db('0xd')]({'raw':!![],'attributes':['id',_0x65db('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2d8f1e[_0x65db('0xb')],_0x65db('0xf'))}}});}else{return[];}})['then'](function(_0x24f253){if(_0x24f253&&_0x24f253[_0x65db('0x10')]){_0x45b483=_[_0x65db('0x11')](_0x24f253||[],'id');logger[_0x65db('0x12')]('[CHAT]\x20Interactions\x20to\x20close:',_0x45b483['join']());return db[_0x65db('0xc')][_0x65db('0x13')]({'closeReason':_0x65db('0x14'),'disposition':_0x65db('0x15'),'closed':!![],'closedAt':moment()[_0x65db('0x16')](_0x65db('0x17'))},{'where':{'id':_0x45b483}});}})[_0x65db('0x18')](function(){if(_0x45b483&&_0x45b483[_0x65db('0x10')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x45b483[_0x65db('0x19')]());for(var _0x481a99=0x0;_0x481a99<_0x45b483[_0x65db('0x10')];_0x481a99++){io['emit'](_0x65db('0x1a'),{'id':_0x45b483[_0x481a99],'closed':!![]});}}})[_0x65db('0x1b')](function(_0x4b237a){logger[_0x65db('0x1c')](_0x65db('0x1d'),_0x4b237a?util[_0x65db('0x1e')](_0x4b237a,{'showHidden':![],'depth':null}):'');});}exports[_0x65db('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xeb59=['info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','schedule','defaults','localhost','socket.io-emitter','redis','Setting','chatTimeout','ChatInteraction','findAll','minutes','then','length','map'];(function(_0x27a37d,_0x49008c){var _0xed99f9=function(_0x51bdf1){while(--_0x51bdf1){_0x27a37d['push'](_0x27a37d['shift']());}};_0xed99f9(++_0x49008c);}(_0xeb59,0x1a1));var _0x9eb5=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0xeb59[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0x9eb5('0x0'));var moment=require(_0x9eb5('0x1'));var Redis=require('ioredis');var util=require(_0x9eb5('0x2'));var config=require(_0x9eb5('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x9eb5('0x4'));config['redis']=_[_0x9eb5('0x5')](config['redis'],{'host':_0x9eb5('0x6'),'port':0x18eb});var io=require(_0x9eb5('0x7'))(new Redis(config[_0x9eb5('0x8')]));function closeInteractions(){var _0x58ea47=0x0;var _0x15eb42=[];return db[_0x9eb5('0x9')]['find']({'raw':!![],'attributes':['id',_0x9eb5('0xa')],'where':{'id':0x1}})['then'](function(_0x891320){_0x58ea47=_0x891320['chatTimeout'];if(_0x58ea47){return db[_0x9eb5('0xb')][_0x9eb5('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x891320[_0x9eb5('0xa')],_0x9eb5('0xd'))}}});}else{return[];}})[_0x9eb5('0xe')](function(_0x4c4ec5){if(_0x4c4ec5&&_0x4c4ec5[_0x9eb5('0xf')]){_0x15eb42=_[_0x9eb5('0x10')](_0x4c4ec5||[],'id');logger[_0x9eb5('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x15eb42[_0x9eb5('0x12')]());return db['ChatInteraction'][_0x9eb5('0x13')]({'closeReason':_0x9eb5('0x14'),'disposition':_0x9eb5('0x15'),'closed':!![],'closedAt':moment()[_0x9eb5('0x16')](_0x9eb5('0x17'))},{'where':{'id':_0x15eb42}});}})[_0x9eb5('0xe')](function(){if(_0x15eb42&&_0x15eb42[_0x9eb5('0xf')]){logger[_0x9eb5('0x11')](_0x9eb5('0x18'),_0x15eb42[_0x9eb5('0x12')]());for(var _0x1b8620=0x0;_0x1b8620<_0x15eb42['length'];_0x1b8620++){io[_0x9eb5('0x19')](_0x9eb5('0x1a'),{'id':_0x15eb42[_0x1b8620],'closed':!![]});}}})[_0x9eb5('0x1b')](function(_0x4c55d1){logger[_0x9eb5('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4c55d1?util[_0x9eb5('0x1d')](_0x4c55d1,{'showHidden':![],'depth':null}):'');});}exports[_0x9eb5('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index e7ef5da..a9bc61c 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 _0x240d=['isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','exists','stop','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','endAt','add','start','isBetween','update\x20cron','run','util','path','lodash','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','basename','savename','extname','zip','existsSync','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','data'];(function(_0x548d70,_0x133f43){var _0x5be6c4=function(_0x44e73d){while(--_0x44e73d){_0x548d70['push'](_0x548d70['shift']());}};_0x5be6c4(++_0x133f43);}(_0x240d,0x185));var _0xd240=function(_0x1dc3ad,_0x401211){_0x1dc3ad=_0x1dc3ad-0x0;var _0x45198f=_0x240d[_0x1dc3ad];return _0x45198f;};'use strict';var fs=require('fs');var util=require(_0xd240('0x0'));var path=require(_0xd240('0x1'));var _=require(_0xd240('0x2'));var moment=require('moment');var CronJobManager=require(_0xd240('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0xd240('0x4'));var logger=require(_0xd240('0x5'))(_0xd240('0x6'));var db=require(_0xd240('0x7'))['db'];var analyticCustomReportController=require(_0xd240('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xd240('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x117a8c,_0x489000){return function(){logger['info'](_0xd240('0xa'),_0x117a8c[_0xd240('0xb')]);var _0x55a63f=!![];var _0x354a91={'tls':{'rejectUnauthorized':![]}};if(_0x117a8c['MailAccount'][_0xd240('0xc')][_0xd240('0xd')]){_0x354a91[_0xd240('0xd')]=_0x117a8c[_0xd240('0xe')][_0xd240('0xc')][_0xd240('0xd')];}else{_0x354a91[_0xd240('0xf')]=_0x117a8c[_0xd240('0xe')]['Smtp']['host'];_0x354a91['port']=_0x117a8c[_0xd240('0xe')][_0xd240('0xc')][_0xd240('0x10')];_0x354a91[_0xd240('0x11')]=_0x117a8c[_0xd240('0xe')][_0xd240('0xc')][_0xd240('0x11')];}if(_0x117a8c['MailAccount']['Smtp'][_0xd240('0x12')]){_0x354a91['auth']={'user':_0x117a8c[_0xd240('0xe')][_0xd240('0xc')][_0xd240('0x13')],'pass':_0x117a8c[_0xd240('0xe')][_0xd240('0xc')][_0xd240('0x14')]};}var _0x393fc6={'account':_0x354a91,'message':{'from':util[_0xd240('0x15')](_0xd240('0x16'),_0x117a8c['MailAccount'][_0xd240('0x17')],_0x117a8c[_0xd240('0xe')][_0xd240('0xb')]||_0x117a8c[_0xd240('0xe')][_0xd240('0xc')]['user']),'to':_0x117a8c[_0xd240('0xb')],'cc':_0x117a8c['cc'],'bcc':_0x117a8c['bcc'],'subject':util[_0xd240('0x15')](_0xd240('0x18'),_0x489000[_0xd240('0x17')],_0x117a8c[_0xd240('0x19')],_0x117a8c[_0xd240('0x1a')])}};var _0x6af77a=path[_0xd240('0x1b')](__dirname,'../../files/reports');var _0x14cd67=_0x489000['savename'];var _0x31bf68=util[_0xd240('0x15')](_0xd240('0x1c'),path[_0xd240('0x1d')](_0x489000[_0xd240('0x1e')],path[_0xd240('0x1f')](_0x489000[_0xd240('0x1e')])),_0xd240('0x20'));var _0x5b3ce5=path[_0xd240('0x1b')](_0x6af77a,_0x14cd67);var _0x44a255=path[_0xd240('0x1b')](_0x6af77a,_0x31bf68);if(fs[_0xd240('0x21')](_0x5b3ce5)){_0x489000['status']=_0xd240('0x22');_0x393fc6['message'][_0xd240('0x23')]=[{'filename':_0x14cd67,'path':_0x5b3ce5}];_0x393fc6[_0xd240('0x24')][_0xd240('0x25')]=util['format'](_0xd240('0x26'),JSON[_0xd240('0x27')](_0x489000,null,0x2));}else if(fs[_0xd240('0x21')](_0x44a255)){_0x489000[_0xd240('0x28')]=_0xd240('0x22');_0x393fc6[_0xd240('0x24')][_0xd240('0x23')]=[{'filename':_0x31bf68,'path':_0x44a255}];}else{_0x393fc6[_0xd240('0x24')][_0xd240('0x25')]=_0xd240('0x29');if(!_0x117a8c[_0xd240('0x2a')]){_0x55a63f=![];logger[_0xd240('0x2b')](_0xd240('0x2c'));}}if(_0x55a63f){return client['request'](_0xd240('0x2d'),_0x393fc6)[_0xd240('0x2e')](function(_0x292e7a){if(_0x292e7a[_0xd240('0x2f')]){return logger[_0xd240('0x2f')](_0xd240('0x30'),JSON[_0xd240('0x27')](_0x292e7a));}return logger[_0xd240('0x2b')]('email\x20sent');})[_0xd240('0x31')](function(_0x20bb0f){return logger['error'](_0xd240('0x30'),JSON[_0xd240('0x27')](_0x20bb0f));});}};}function handleError(){return function(_0x4a8776){return logger['error'](JSON['stringify'](_0x4a8776));};}function handleResult(_0x5a0837){return function(_0xb1d667){logger[_0xd240('0x2b')](_0xd240('0x32'),JSON[_0xd240('0x27')](_0xb1d667));if(_0x5a0837['MailAccount']&&_0x5a0837['MailAccount'][_0xd240('0xc')]&&!_[_0xd240('0x33')](_0x5a0837[_0xd240('0xb')])){setTimeout(handleSendEmail(_0x5a0837,_0xb1d667),0x3c*0x3e8);}};}function handleJob(_0x3dc782){return function(){try{if(_[_0xd240('0x33')](_0x3dc782[_0xd240('0x19')])){return logger[_0xd240('0x2b')](_0xd240('0x34'));}if(_[_0xd240('0x33')](_0x3dc782[_0xd240('0x1a')])){return logger['info'](_0xd240('0x35'));}var _0x31c064={'startDate':moment()[_0xd240('0x36')](_0x3dc782['subtractNumber'],_0x3dc782['subtractUnit'])[_0xd240('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0xd240('0x37')),'type':_0xd240('0x38'),'output':_0x3dc782['output'],'name':_0x3dc782[_0xd240('0x17')]};if(!_['isNil'](_0x3dc782[_0xd240('0x39')])){logger['info'](_0xd240('0x3a'),_0x3dc782[_0xd240('0x39')]);return analyticDefaultReportController[_0xd240('0x3b')]({'id':_0x3dc782['DefaultReportId']},_0x31c064)[_0xd240('0x2e')](handleResult(_0x3dc782))[_0xd240('0x31')](handleError());}if(!_['isNil'](_0x3dc782['CustomReportId'])){logger['info'](_0xd240('0x3c'),_0x3dc782[_0xd240('0x3d')]);return analyticCustomReportController[_0xd240('0x3b')]({'id':_0x3dc782['CustomReportId']},_0x31c064)[_0xd240('0x2e')](handleResult(_0x3dc782))['catch'](handleError());}}catch(_0x31fb06){logger[_0xd240('0x2f')](JSON[_0xd240('0x27')](_0x31fb06));}return logger[_0xd240('0x2b')](_0xd240('0x3e'));};}function getJobs(_0x5bb0c8){var _0x51b82b={};if(_0x5bb0c8){_0x51b82b['id']=_0x5bb0c8;}return db[_0xd240('0x3f')][_0xd240('0x40')]({'where':_0x51b82b,'include':[{'model':db[_0xd240('0xe')],'attributes':['id',_0xd240('0x17'),'email'],'include':[{'model':db[_0xd240('0x41')],'as':_0xd240('0xc')}]}]})[_0xd240('0x2e')](function(_0x15b3b0){var _0x16b5ce=_[_0xd240('0x42')](manager[_0xd240('0x43')]);var _0x35b69f=_[_0xd240('0x44')](_0x15b3b0,function(_0x4845a4){return _0x4845a4['id'][_0xd240('0x45')]();});var _0x21a3e1=_['keyBy'](_0x15b3b0,function(_0x5c1961){return _0x5c1961['id'][_0xd240('0x45')]();});var _0x4d6f11=_0x5bb0c8?_0x35b69f:_['difference'](_0x35b69f,_0x16b5ce);var _0x4f1401=_[_0xd240('0x46')](_0x35b69f,_0x16b5ce);var _0x4d30fe=_['difference'](_0x16b5ce,_0x35b69f);var _0x17db0e;var _0x4a5f17;for(_0x17db0e=0x0;_0x17db0e<_0x4d30fe['length']&&!_0x5bb0c8;_0x17db0e+=0x1){_0x4a5f17=_0x4d30fe[_0x17db0e][_0xd240('0x45')]();if(manager[_0xd240('0x47')](_0x4a5f17)){manager[_0xd240('0x48')](_0x4a5f17);manager[_0xd240('0x49')](_0x4a5f17);logger['info']('delete\x20cron',_0x4a5f17);}}logger[_0xd240('0x2b')](_0xd240('0x4a'),JSON[_0xd240('0x27')](_0x4d6f11));for(_0x17db0e=0x0;_0x17db0e<_0x4d6f11[_0xd240('0x4b')];_0x17db0e+=0x1){_0x4a5f17=_0x4d6f11[_0x17db0e]['toString']();logger['info'](_0xd240('0x4c'),_0x4a5f17);if(_0x5bb0c8){logger[_0xd240('0x2b')](_0xd240('0x4d'),_0x5bb0c8);logger[_0xd240('0x2b')](JSON[_0xd240('0x27')](_0x21a3e1[_0x4a5f17]));BPromise[_0xd240('0x4e')]()[_0xd240('0x2e')](handleJob(_0x21a3e1[_0x4a5f17]));logger[_0xd240('0x2b')](_0xd240('0x4f'),_0x21a3e1[_0x4a5f17][_0xd240('0x17')],_0x21a3e1[_0x4a5f17][_0xd240('0x50')]);}else if(_0x21a3e1[_0x4a5f17][_0xd240('0x50')]&&_0x21a3e1[_0x4a5f17][_0xd240('0x51')]&&moment()['isBetween'](_0x21a3e1[_0x4a5f17]['startAt'],_0x21a3e1[_0x4a5f17][_0xd240('0x52')])){manager[_0xd240('0x53')](_0x4a5f17,_0x21a3e1[_0x4a5f17][_0xd240('0x50')],handleJob(_0x21a3e1[_0x4a5f17]));manager[_0xd240('0x54')](_0x4a5f17);logger[_0xd240('0x2b')]('add\x20cron',_0x21a3e1[_0x4a5f17]['name'],_0x21a3e1[_0x4a5f17][_0xd240('0x50')]);}else if(manager['exists'](_0x4a5f17)){manager['stop'](_0x4a5f17);manager['deleteJob'](_0x4a5f17);logger[_0xd240('0x2b')]('stop\x20cron',_0x21a3e1[_0x4a5f17][_0xd240('0x17')],_0x21a3e1[_0x4a5f17][_0xd240('0x50')]);}}for(_0x17db0e=0x0,_0x4a5f17;_0x17db0e<_0x4f1401[_0xd240('0x4b')]&&!_0x5bb0c8;_0x17db0e+=0x1){_0x4a5f17=_0x4f1401[_0x17db0e]['toString']();if(manager[_0xd240('0x47')](_0x4a5f17)){if(_0x21a3e1[_0x4a5f17][_0xd240('0x50')]&&_0x21a3e1[_0x4a5f17][_0xd240('0x51')]&&moment()[_0xd240('0x55')](_0x21a3e1[_0x4a5f17]['startAt'],_0x21a3e1[_0x4a5f17][_0xd240('0x52')])){manager['update'](_0x4a5f17,_0x21a3e1[_0x4a5f17][_0xd240('0x50')],handleJob(_0x21a3e1[_0x4a5f17]));logger[_0xd240('0x2b')](_0xd240('0x56'),_0x21a3e1[_0x4a5f17]['name'],_0x21a3e1[_0x4a5f17]['cron']);}else{manager[_0xd240('0x48')](_0x4a5f17);manager['deleteJob'](_0x4a5f17);logger[_0xd240('0x2b')]('stop\x20cron',_0x21a3e1[_0x4a5f17][_0xd240('0x17')],_0x21a3e1[_0x4a5f17][_0xd240('0x50')]);}}}})[_0xd240('0x31')](function(_0x41d36e){logger[_0xd240('0x2f')](JSON[_0xd240('0x27')](_0x41d36e));});}exports[_0xd240('0x57')]=function(_0xfdfe3a){return getJobs(_0xfdfe3a);};exports[_0xd240('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x98da=['Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','message','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','active','update','update\x20cron','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','port','Smtp','secure','authentication','auth','user','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','extname','zip','existsSync','status','text'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x98da,0x14c));var _0xa98d=function(_0x39d388,_0x1687ae){_0x39d388=_0x39d388-0x0;var _0xdddc85=_0x98da[_0x39d388];return _0xdddc85;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xa98d('0x0'));var _=require(_0xa98d('0x1'));var moment=require(_0xa98d('0x2'));var CronJobManager=require(_0xa98d('0x3'));var jayson=require(_0xa98d('0x4'));var BPromise=require(_0xa98d('0x5'));var logger=require('../logger')(_0xa98d('0x6'));var db=require(_0xa98d('0x7'))['db'];var analyticCustomReportController=require(_0xa98d('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xa98d('0x9')][_0xa98d('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x216fc8,_0x519ff5){return function(){logger[_0xa98d('0xb')](_0xa98d('0xc'),_0x216fc8[_0xa98d('0xd')]);var _0x1747f7=!![];var _0x42e5a5={'tls':{'rejectUnauthorized':![]}};if(_0x216fc8[_0xa98d('0xe')]['Smtp'][_0xa98d('0xf')]){_0x42e5a5['service']=_0x216fc8[_0xa98d('0xe')]['Smtp'][_0xa98d('0xf')];}else{_0x42e5a5[_0xa98d('0x10')]=_0x216fc8['MailAccount']['Smtp'][_0xa98d('0x10')];_0x42e5a5[_0xa98d('0x11')]=_0x216fc8[_0xa98d('0xe')][_0xa98d('0x12')][_0xa98d('0x11')];_0x42e5a5[_0xa98d('0x13')]=_0x216fc8[_0xa98d('0xe')]['Smtp']['secure'];}if(_0x216fc8[_0xa98d('0xe')][_0xa98d('0x12')][_0xa98d('0x14')]){_0x42e5a5[_0xa98d('0x15')]={'user':_0x216fc8[_0xa98d('0xe')][_0xa98d('0x12')][_0xa98d('0x16')],'pass':_0x216fc8[_0xa98d('0xe')][_0xa98d('0x12')]['pass']};}var _0x85ae25={'account':_0x42e5a5,'message':{'from':util[_0xa98d('0x17')]('\x22%s\x22\x20<%s>',_0x216fc8[_0xa98d('0xe')]['name'],_0x216fc8['MailAccount'][_0xa98d('0xd')]||_0x216fc8[_0xa98d('0xe')][_0xa98d('0x12')][_0xa98d('0x16')]),'to':_0x216fc8['email'],'cc':_0x216fc8['cc'],'bcc':_0x216fc8['bcc'],'subject':util[_0xa98d('0x17')](_0xa98d('0x18'),_0x519ff5[_0xa98d('0x19')],_0x216fc8[_0xa98d('0x1a')],_0x216fc8[_0xa98d('0x1b')])}};var _0x53667a=path[_0xa98d('0x1c')](__dirname,_0xa98d('0x1d'));var _0x57a726=_0x519ff5[_0xa98d('0x1e')];var _0x197deb=util[_0xa98d('0x17')]('%s.%s',path['basename'](_0x519ff5['savename'],path[_0xa98d('0x1f')](_0x519ff5['savename'])),_0xa98d('0x20'));var _0x18f8e5=path[_0xa98d('0x1c')](_0x53667a,_0x57a726);var _0x214884=path[_0xa98d('0x1c')](_0x53667a,_0x197deb);if(fs[_0xa98d('0x21')](_0x18f8e5)){_0x519ff5[_0xa98d('0x22')]='Sent';_0x85ae25['message']['attachments']=[{'filename':_0x57a726,'path':_0x18f8e5}];_0x85ae25['message'][_0xa98d('0x23')]=util[_0xa98d('0x17')](_0xa98d('0x24'),JSON[_0xa98d('0x25')](_0x519ff5,null,0x2));}else if(fs[_0xa98d('0x21')](_0x214884)){_0x519ff5['status']='Sent';_0x85ae25[_0xa98d('0x26')][_0xa98d('0x27')]=[{'filename':_0x197deb,'path':_0x214884}];}else{_0x85ae25[_0xa98d('0x26')]['text']=_0xa98d('0x28');if(!_0x216fc8[_0xa98d('0x29')]){_0x1747f7=![];logger[_0xa98d('0xb')](_0xa98d('0x2a'));}}if(_0x1747f7){return client[_0xa98d('0x2b')](_0xa98d('0x2c'),_0x85ae25)[_0xa98d('0x2d')](function(_0x394c71){if(_0x394c71[_0xa98d('0x2e')]){return logger[_0xa98d('0x2e')](_0xa98d('0x2f'),JSON[_0xa98d('0x25')](_0x394c71));}return logger[_0xa98d('0xb')]('email\x20sent');})[_0xa98d('0x30')](function(_0x56618d){return logger[_0xa98d('0x2e')](_0xa98d('0x2f'),JSON[_0xa98d('0x25')](_0x56618d));});}};}function handleError(){return function(_0x203e9f){return logger[_0xa98d('0x2e')](JSON[_0xa98d('0x25')](_0x203e9f));};}function handleResult(_0x1d17c7){return function(_0xb66c1b){logger[_0xa98d('0xb')](_0xa98d('0x31'),JSON[_0xa98d('0x25')](_0xb66c1b));if(_0x1d17c7[_0xa98d('0xe')]&&_0x1d17c7[_0xa98d('0xe')][_0xa98d('0x12')]&&!_['isNil'](_0x1d17c7['email'])){setTimeout(handleSendEmail(_0x1d17c7,_0xb66c1b),0x3c*0x3e8);}};}function handleJob(_0x379463){return function(){try{if(_[_0xa98d('0x32')](_0x379463[_0xa98d('0x1a')])){return logger[_0xa98d('0xb')](_0xa98d('0x33'));}if(_['isNil'](_0x379463[_0xa98d('0x1b')])){return logger[_0xa98d('0xb')](_0xa98d('0x34'));}var _0x2d7ad5={'startDate':moment()[_0xa98d('0x35')](_0x379463['subtractNumber'],_0x379463[_0xa98d('0x1b')])['format'](_0xa98d('0x36')),'endDate':moment()[_0xa98d('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xa98d('0x37'),'output':_0x379463[_0xa98d('0x38')],'name':_0x379463['name']};if(!_[_0xa98d('0x32')](_0x379463['DefaultReportId'])){logger[_0xa98d('0xb')](_0xa98d('0x39'),_0x379463['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x379463[_0xa98d('0x3a')]},_0x2d7ad5)[_0xa98d('0x2d')](handleResult(_0x379463))[_0xa98d('0x30')](handleError());}if(!_[_0xa98d('0x32')](_0x379463[_0xa98d('0x3b')])){logger[_0xa98d('0xb')](_0xa98d('0x3c'),_0x379463[_0xa98d('0x3b')]);return analyticCustomReportController[_0xa98d('0x3d')]({'id':_0x379463[_0xa98d('0x3b')]},_0x2d7ad5)[_0xa98d('0x2d')](handleResult(_0x379463))[_0xa98d('0x30')](handleError());}}catch(_0x3c959c){logger[_0xa98d('0x2e')](JSON[_0xa98d('0x25')](_0x3c959c));}return logger[_0xa98d('0xb')](_0xa98d('0x3e'));};}function getJobs(_0x4abc43){var _0x46c90c={};if(_0x4abc43){_0x46c90c['id']=_0x4abc43;}return db[_0xa98d('0x3f')][_0xa98d('0x40')]({'where':_0x46c90c,'include':[{'model':db[_0xa98d('0xe')],'attributes':['id',_0xa98d('0x19'),_0xa98d('0xd')],'include':[{'model':db[_0xa98d('0x41')],'as':_0xa98d('0x12')}]}]})[_0xa98d('0x2d')](function(_0x58c6f9){var _0x103dfd=_[_0xa98d('0x42')](manager[_0xa98d('0x43')]);var _0x2cdc13=_['map'](_0x58c6f9,function(_0x1502c3){return _0x1502c3['id'][_0xa98d('0x44')]();});var _0x33e629=_[_0xa98d('0x45')](_0x58c6f9,function(_0x379095){return _0x379095['id']['toString']();});var _0x37413c=_0x4abc43?_0x2cdc13:_[_0xa98d('0x46')](_0x2cdc13,_0x103dfd);var _0x2d4329=_[_0xa98d('0x47')](_0x2cdc13,_0x103dfd);var _0x2d94a5=_[_0xa98d('0x46')](_0x103dfd,_0x2cdc13);var _0x1efdde;var _0x466b00;for(_0x1efdde=0x0;_0x1efdde<_0x2d94a5[_0xa98d('0x48')]&&!_0x4abc43;_0x1efdde+=0x1){_0x466b00=_0x2d94a5[_0x1efdde][_0xa98d('0x44')]();if(manager[_0xa98d('0x49')](_0x466b00)){manager['stop'](_0x466b00);manager[_0xa98d('0x4a')](_0x466b00);logger[_0xa98d('0xb')](_0xa98d('0x4b'),_0x466b00);}}logger['info']('toRun',JSON[_0xa98d('0x25')](_0x37413c));for(_0x1efdde=0x0;_0x1efdde<_0x37413c[_0xa98d('0x48')];_0x1efdde+=0x1){_0x466b00=_0x37413c[_0x1efdde][_0xa98d('0x44')]();logger[_0xa98d('0xb')](_0xa98d('0x4c'),_0x466b00);if(_0x4abc43){logger['info'](_0xa98d('0x4d'),_0x4abc43);logger[_0xa98d('0xb')](JSON[_0xa98d('0x25')](_0x33e629[_0x466b00]));BPromise[_0xa98d('0x4e')]()['then'](handleJob(_0x33e629[_0x466b00]));logger[_0xa98d('0xb')](_0xa98d('0x4f'),_0x33e629[_0x466b00]['name'],_0x33e629[_0x466b00][_0xa98d('0x50')]);}else if(_0x33e629[_0x466b00][_0xa98d('0x50')]&&_0x33e629[_0x466b00]['active']&&moment()[_0xa98d('0x51')](_0x33e629[_0x466b00][_0xa98d('0x52')],_0x33e629[_0x466b00][_0xa98d('0x53')])){manager[_0xa98d('0x54')](_0x466b00,_0x33e629[_0x466b00]['cron'],handleJob(_0x33e629[_0x466b00]));manager[_0xa98d('0x55')](_0x466b00);logger['info'](_0xa98d('0x56'),_0x33e629[_0x466b00][_0xa98d('0x19')],_0x33e629[_0x466b00][_0xa98d('0x50')]);}else if(manager[_0xa98d('0x49')](_0x466b00)){manager[_0xa98d('0x57')](_0x466b00);manager[_0xa98d('0x4a')](_0x466b00);logger[_0xa98d('0xb')](_0xa98d('0x58'),_0x33e629[_0x466b00][_0xa98d('0x19')],_0x33e629[_0x466b00][_0xa98d('0x50')]);}}for(_0x1efdde=0x0,_0x466b00;_0x1efdde<_0x2d4329['length']&&!_0x4abc43;_0x1efdde+=0x1){_0x466b00=_0x2d4329[_0x1efdde][_0xa98d('0x44')]();if(manager[_0xa98d('0x49')](_0x466b00)){if(_0x33e629[_0x466b00][_0xa98d('0x50')]&&_0x33e629[_0x466b00][_0xa98d('0x59')]&&moment()['isBetween'](_0x33e629[_0x466b00]['startAt'],_0x33e629[_0x466b00][_0xa98d('0x53')])){manager[_0xa98d('0x5a')](_0x466b00,_0x33e629[_0x466b00][_0xa98d('0x50')],handleJob(_0x33e629[_0x466b00]));logger[_0xa98d('0xb')](_0xa98d('0x5b'),_0x33e629[_0x466b00]['name'],_0x33e629[_0x466b00][_0xa98d('0x50')]);}else{manager['stop'](_0x466b00);manager[_0xa98d('0x4a')](_0x466b00);logger[_0xa98d('0xb')](_0xa98d('0x58'),_0x33e629[_0x466b00]['name'],_0x33e629[_0x466b00]['cron']);}}}})['catch'](function(_0x21debf){logger[_0xa98d('0x2e')](JSON[_0xa98d('0x25')](_0x21debf));});}exports['run']=function(_0x1eb606){return getJobs(_0x1eb606);};exports[_0xa98d('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index d21225e..b972f44 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa03c=['findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','push','start','lodash','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','Mixed','SentimentScore','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','Sentiment','Positive','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xa03c,0x94));var _0xca03=function(_0x3ccb82,_0x36d5bf){_0x3ccb82=_0x3ccb82-0x0;var _0x42354f=_0xa03c[_0x3ccb82];return _0x42354f;};var _=require(_0xca03('0x0'));var AWS=require('aws-sdk');var rp=require(_0xca03('0x1'));var util=require(_0xca03('0x2'));var BPromise=require(_0xca03('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xca03('0x4'))(_0xca03('0x5'));function getTranscriptionJob(_0x61cd34,_0x481715,_0x3dc5ef,_0x1bf647){return new Promise(function(_0x2f0ace,_0x20cf52){var _0x27aac6=new AWS[(_0xca03('0x6'))]({'accessKeyId':_0x481715,'secretAccessKey':_0x61cd34,'region':_0x3dc5ef});_0x27aac6['getTranscriptionJob']({'TranscriptionJobName':_0x1bf647},function(_0x1832cc,_0x18ddee){if(_0x1832cc){return _0x20cf52(_0x1832cc);}else{return _0x2f0ace(_0x18ddee);}});});}function sentiment(_0x2e9c92,_0x51cdb4,_0x31e7be,_0x9f510d,_0x34f897){return new Promise(function(_0x2a0468,_0x17b38d){var _0x3cea29=new AWS['Comprehend']({'accessKeyId':_0x51cdb4,'secretAccessKey':_0x2e9c92,'region':_0x31e7be});_0x3cea29[_0xca03('0x7')]({'Text':_0x9f510d,'LanguageCode':_0x34f897[_0xca03('0x8')](0x0,0x2)},function(_0x14c74a,_0x2571b8){if(_0x14c74a){return _0x17b38d(_0x14c74a);}else{return _0x2a0468(_0x2571b8);}});});}function checkTranscribeJob(_0x1a6abb,_0xfad3cc,_0x26c060){var _0x2623bb;return new BPromise(function(_0xb3ab63,_0xc50414){logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0xb'),_0x1a6abb['id'],_0x1a6abb[_0xca03('0xc')]));return getTranscriptionJob(_0x26c060[_0xca03('0xd')],_0x26c060[_0xca03('0xe')],_0xfad3cc[_0xca03('0xf')],_0x1a6abb[_0xca03('0xc')])[_0xca03('0x10')](function(_0x5b9801){logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0x11'),_0x1a6abb['id'],_0x1a6abb[_0xca03('0xc')],_0x5b9801[_0xca03('0x12')][_0xca03('0x13')]));if(!_0x1a6abb[_0xca03('0x14')]){switch(_0x5b9801[_0xca03('0x12')]['TranscriptionJobStatus']){case _0xca03('0x15'):var _0x56eab4={'transcribeStatus':_0x5b9801['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x5b9801[_0xca03('0x12')][_0xca03('0x16')][_0xca03('0x17')]};logger[_0xca03('0x9')](util['format'](_0xca03('0x18'),_0x1a6abb['id']));return rp({'uri':_0x5b9801['TranscriptionJob'][_0xca03('0x16')][_0xca03('0x17')],'json':!![]})[_0xca03('0x10')](function(_0x20e22a){logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0x19'),_0x1a6abb['id']));if(_0x20e22a&&_0x20e22a[_0xca03('0x1a')]&&_0x20e22a[_0xca03('0x1a')][_0xca03('0x1b')]&&_0x20e22a['results'][_0xca03('0x1b')][_0xca03('0x1c')]){_0x56eab4[_0xca03('0x14')]='';for(var _0x2d05cb=0x0;_0x2d05cb<_0x20e22a['results'][_0xca03('0x1b')][_0xca03('0x1c')];_0x2d05cb++){_0x56eab4[_0xca03('0x14')]+=_0x20e22a['results'][_0xca03('0x1b')][_0x2d05cb]['transcript']+'';}}return _0x1a6abb[_0xca03('0x1d')](_0x56eab4);})['then'](function(){logger[_0xca03('0x9')](util['format'](_0xca03('0x1e'),_0x1a6abb['id']));if(!_0x1a6abb[_0xca03('0x1f')]){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x22'));}if(!_0xfad3cc[_0xca03('0x23')]||!_0xfad3cc['sentimentAccountId']||!_0xfad3cc['sentimentRegion']||!_0xfad3cc['language']||!_0xfad3cc[_0xca03('0x24')]){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x25'));}if(!_0x56eab4[_0xca03('0x14')]){throw new Error(_0xca03('0x26'));}if(_0xfad3cc[_0xca03('0x27')]===_0x26c060['id']){return _0x26c060;}else{return db[_0xca03('0x28')][_0xca03('0x29')]({'where':{'id':_settings[_0xca03('0x27')]}});}})['then'](function(_0x1baa05){if(!_0x1baa05){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1baa05[_0xca03('0xd')]||!_0x1baa05[_0xca03('0xe')]){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x2a'));}_0x2623bb=_0x1baa05;logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0x2b'),_0x1a6abb['id']));return sentiment(_0x2623bb[_0xca03('0xd')],_0x2623bb['data2'],_0xfad3cc[_0xca03('0x2c')],_0x56eab4['fileText'],_0xfad3cc[_0xca03('0x2d')]);})[_0xca03('0x10')](function(_0x5bc1e6){logger[_0xca03('0x9')](util[_0xca03('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1a6abb['id']));return _0x1a6abb[_0xca03('0x1d')]({'sentiment':_0x5bc1e6['Sentiment'],'sPositive':_0x5bc1e6['SentimentScore']['Positive'],'sNegative':_0x5bc1e6['SentimentScore']['Negative'],'sMixed':_0x5bc1e6['SentimentScore'][_0xca03('0x2e')],'sNeutral':_0x5bc1e6[_0xca03('0x2f')][_0xca03('0x30')]});})[_0xca03('0x10')](function(){logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0x1e'),_0x1a6abb['id']));_0xb3ab63();});case _0xca03('0x31'):return _0x1a6abb[_0xca03('0x1d')]({'transcribeStatus':_0xca03('0x31'),'failureReason':_0x5b9801['TranscriptionJob']['FailureReason']})['then'](function(){logger['info'](util[_0xca03('0xa')](_0xca03('0x1e'),_0x1a6abb['id']));_0xb3ab63();});default:logger[_0xca03('0x9')](util[_0xca03('0xa')](_0xca03('0x32'),_0x1a6abb['id']));break;}}else{return BPromise[_0xca03('0x33')]()[_0xca03('0x10')](function(){if(!_0x1a6abb[_0xca03('0x1f')]){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x22'));}if(!_0xfad3cc[_0xca03('0x23')]||!_0xfad3cc[_0xca03('0x27')]||!_0xfad3cc[_0xca03('0x2c')]||!_0xfad3cc[_0xca03('0x2d')]||!_0xfad3cc['bucket']){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x1a6abb[_0xca03('0x14')]){throw new Error(_0xca03('0x26'));}if(_0xfad3cc['sentimentAccountId']===_0x26c060['id']){return _0x26c060;}else{return db[_0xca03('0x28')][_0xca03('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x584747){if(!_0x584747){throw new db['Sequelize']['ValidationError'](_0xca03('0x34'));}if(!_0x584747[_0xca03('0xd')]||!_0x584747['data2']){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x2a'));}_0x2623bb=_0x584747;logger['info'](util['format'](_0xca03('0x2b'),_0x1a6abb['id']));return sentiment(_0x2623bb['data1'],_0x2623bb[_0xca03('0xe')],_0xfad3cc[_0xca03('0x2c')],_0x1a6abb[_0xca03('0x14')],_0xfad3cc[_0xca03('0x2d')]);})[_0xca03('0x10')](function(_0x278704){logger[_0xca03('0x9')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1a6abb['id']));return _0x1a6abb[_0xca03('0x1d')]({'sentiment':_0x278704[_0xca03('0x35')],'sPositive':_0x278704[_0xca03('0x2f')][_0xca03('0x36')],'sNegative':_0x278704[_0xca03('0x2f')][_0xca03('0x37')],'sMixed':_0x278704[_0xca03('0x2f')][_0xca03('0x2e')],'sNeutral':_0x278704['SentimentScore'][_0xca03('0x30')],'transcribeStatus':_0xca03('0x15')});})['then'](function(){logger[_0xca03('0x9')](util['format'](_0xca03('0x1e'),_0x1a6abb['id']));_0xb3ab63();});}})[_0xca03('0x38')](function(_0x1a0194){if(_0x1a0194){if(!_0x1a0194[_0xca03('0x39')]||_0x1a0194[_0xca03('0x39')]!==_0xca03('0x3a')){logger['error'](util[_0xca03('0xa')](_0xca03('0x3b'),_0x1a6abb['id']),util[_0xca03('0x3c')](_0x1a0194,{'showHidden':![],'depth':null}));}}_0xb3ab63();});});}function checkTranscribe(){var _0x251344;var _0x474223;var _0x1609b8;return db[_0xca03('0x3d')][_0xca03('0x3e')]({'where':{'transcribeStatus':_0xca03('0x3f')}})['then'](function(_0x2eb6c3){if(!_0x2eb6c3||!_0x2eb6c3[_0xca03('0x1c')]){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))](_0xca03('0x40'));}_0x251344=_0x2eb6c3;return db[_0xca03('0x41')][_0xca03('0x29')]({'where':{'id':0x1}});})['then'](function(_0x517b4d){if(!_0x517b4d){throw new db['Sequelize'][(_0xca03('0x21'))](_0xca03('0x42'));}_0x474223=_0x517b4d;if(!_0x474223[_0xca03('0x5')]||!_0x474223[_0xca03('0x43')]||!_0x474223['transcribeRegion']||!_0x474223[_0xca03('0x2d')]||!_0x474223['bucket']){throw new db[(_0xca03('0x20'))][(_0xca03('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xca03('0x28')][_0xca03('0x29')]({'where':{'id':_0x474223[_0xca03('0x43')]}});})[_0xca03('0x10')](function(_0x3a0a68){if(!_0x3a0a68){throw new db['Sequelize'][(_0xca03('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3a0a68[_0xca03('0xd')]||!_0x3a0a68['data2']){throw new db['Sequelize'][(_0xca03('0x21'))](_0xca03('0x2a'));}_0x1609b8=_0x3a0a68;var _0x31aa4d=[];_0x251344['forEach'](function(_0x1b4a92){_0x31aa4d[_0xca03('0x44')](checkTranscribeJob(_0x1b4a92,_0x474223,_0x1609b8));});return BPromise['all'](_0x31aa4d);})[_0xca03('0x38')](function(_0x57ecec){if(_0x57ecec){if(!_0x57ecec['name']||_0x57ecec[_0xca03('0x39')]!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x57ecec,{'showHidden':![],'depth':null}));}}});}exports[_0xca03('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4213=['update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','sentiment','language','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','sentimentRegion','Sentiment','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','bucket','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','length','Setting','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeRegion','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts'];(function(_0x7ab42b,_0x310027){var _0x16787c=function(_0x5643cf){while(--_0x5643cf){_0x7ab42b['push'](_0x7ab42b['shift']());}};_0x16787c(++_0x310027);}(_0x4213,0x77));var _0x3421=function(_0x10cd7e,_0x25fb52){_0x10cd7e=_0x10cd7e-0x0;var _0x1ece97=_0x4213[_0x10cd7e];return _0x1ece97;};var _=require(_0x3421('0x0'));var AWS=require(_0x3421('0x1'));var rp=require(_0x3421('0x2'));var util=require(_0x3421('0x3'));var BPromise=require(_0x3421('0x4'));var db=require(_0x3421('0x5'))['db'];var logger=require(_0x3421('0x6'))('transcribe');function getTranscriptionJob(_0xdbd54e,_0x5c3719,_0x459c5e,_0xfe969c){return new Promise(function(_0x2155f8,_0x2a04e0){var _0x5469d8=new AWS[(_0x3421('0x7'))]({'accessKeyId':_0x5c3719,'secretAccessKey':_0xdbd54e,'region':_0x459c5e});_0x5469d8[_0x3421('0x8')]({'TranscriptionJobName':_0xfe969c},function(_0x130625,_0x1cf6a0){if(_0x130625){return _0x2a04e0(_0x130625);}else{return _0x2155f8(_0x1cf6a0);}});});}function sentiment(_0x13b0dd,_0x4ddfce,_0x1f20cf,_0x58d511,_0x4ff986){return new Promise(function(_0x12eee0,_0x4b9d24){var _0x2d8676=new AWS[(_0x3421('0x9'))]({'accessKeyId':_0x4ddfce,'secretAccessKey':_0x13b0dd,'region':_0x1f20cf});_0x2d8676[_0x3421('0xa')]({'Text':_0x58d511,'LanguageCode':_0x4ff986[_0x3421('0xb')](0x0,0x2)},function(_0x2f12b1,_0x55c317){if(_0x2f12b1){return _0x4b9d24(_0x2f12b1);}else{return _0x12eee0(_0x55c317);}});});}function checkTranscribeJob(_0xf9cb85,_0x59eaf1,_0x26d459){var _0x3e2ecd;return new BPromise(function(_0xb4ea90,_0x15eef0){logger[_0x3421('0xc')](util[_0x3421('0xd')](_0x3421('0xe'),_0xf9cb85['id'],_0xf9cb85['transcribeName']));return getTranscriptionJob(_0x26d459[_0x3421('0xf')],_0x26d459['data2'],_0x59eaf1[_0x3421('0x10')],_0xf9cb85[_0x3421('0x11')])['then'](function(_0x1e33ab){logger['info'](util[_0x3421('0xd')](_0x3421('0x12'),_0xf9cb85['id'],_0xf9cb85['transcribeName'],_0x1e33ab[_0x3421('0x13')][_0x3421('0x14')]));if(!_0xf9cb85[_0x3421('0x15')]){switch(_0x1e33ab[_0x3421('0x13')][_0x3421('0x14')]){case _0x3421('0x16'):var _0x3f1b1d={'transcribeStatus':_0x1e33ab[_0x3421('0x13')][_0x3421('0x14')],'fileUri':_0x1e33ab[_0x3421('0x13')][_0x3421('0x17')]['TranscriptFileUri']};logger[_0x3421('0xc')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xf9cb85['id']));return rp({'uri':_0x1e33ab['TranscriptionJob'][_0x3421('0x17')][_0x3421('0x18')],'json':!![]})[_0x3421('0x19')](function(_0x256cc5){logger[_0x3421('0xc')](util[_0x3421('0xd')](_0x3421('0x1a'),_0xf9cb85['id']));if(_0x256cc5&&_0x256cc5[_0x3421('0x1b')]&&_0x256cc5[_0x3421('0x1b')][_0x3421('0x1c')]&&_0x256cc5['results']['transcripts']['length']){_0x3f1b1d[_0x3421('0x15')]='';for(var _0x958899=0x0;_0x958899<_0x256cc5[_0x3421('0x1b')]['transcripts']['length'];_0x958899++){_0x3f1b1d[_0x3421('0x15')]+=_0x256cc5['results'][_0x3421('0x1c')][_0x958899]['transcript']+'';}}return _0xf9cb85[_0x3421('0x1d')](_0x3f1b1d);})[_0x3421('0x19')](function(){logger[_0x3421('0xc')](util[_0x3421('0xd')](_0x3421('0x1e'),_0xf9cb85['id']));if(!_0xf9cb85['tempSentiment']){throw new db[(_0x3421('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x59eaf1[_0x3421('0x20')]||!_0x59eaf1['sentimentAccountId']||!_0x59eaf1['sentimentRegion']||!_0x59eaf1[_0x3421('0x21')]||!_0x59eaf1['bucket']){throw new db[(_0x3421('0x1f'))]['ValidationError'](_0x3421('0x22'));}if(!_0x3f1b1d[_0x3421('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x59eaf1[_0x3421('0x23')]===_0x26d459['id']){return _0x26d459;}else{return db[_0x3421('0x24')][_0x3421('0x25')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3421('0x19')](function(_0x50d61b){if(!_0x50d61b){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x27'));}if(!_0x50d61b[_0x3421('0xf')]||!_0x50d61b[_0x3421('0x28')]){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x29'));}_0x3e2ecd=_0x50d61b;logger[_0x3421('0xc')](util[_0x3421('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf9cb85['id']));return sentiment(_0x3e2ecd['data1'],_0x3e2ecd[_0x3421('0x28')],_0x59eaf1[_0x3421('0x2a')],_0x3f1b1d['fileText'],_0x59eaf1[_0x3421('0x21')]);})[_0x3421('0x19')](function(_0x3dbd29){logger[_0x3421('0xc')](util[_0x3421('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xf9cb85['id']));return _0xf9cb85[_0x3421('0x1d')]({'sentiment':_0x3dbd29[_0x3421('0x2b')],'sPositive':_0x3dbd29[_0x3421('0x2c')]['Positive'],'sNegative':_0x3dbd29[_0x3421('0x2c')]['Negative'],'sMixed':_0x3dbd29[_0x3421('0x2c')][_0x3421('0x2d')],'sNeutral':_0x3dbd29[_0x3421('0x2c')][_0x3421('0x2e')]});})[_0x3421('0x19')](function(){logger[_0x3421('0xc')](util[_0x3421('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf9cb85['id']));_0xb4ea90();});case'FAILED':return _0xf9cb85['update']({'transcribeStatus':_0x3421('0x2f'),'failureReason':_0x1e33ab['TranscriptionJob']['FailureReason']})[_0x3421('0x19')](function(){logger['info'](util[_0x3421('0xd')](_0x3421('0x1e'),_0xf9cb85['id']));_0xb4ea90();});default:logger['info'](util[_0x3421('0xd')](_0x3421('0x30'),_0xf9cb85['id']));break;}}else{return BPromise[_0x3421('0x31')]()[_0x3421('0x19')](function(){if(!_0xf9cb85['tempSentiment']){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x32'));}if(!_0x59eaf1[_0x3421('0x20')]||!_0x59eaf1[_0x3421('0x23')]||!_0x59eaf1['sentimentRegion']||!_0x59eaf1[_0x3421('0x21')]||!_0x59eaf1[_0x3421('0x33')]){throw new db['Sequelize'][(_0x3421('0x26'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xf9cb85['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x59eaf1[_0x3421('0x23')]===_0x26d459['id']){return _0x26d459;}else{return db[_0x3421('0x24')][_0x3421('0x25')]({'where':{'id':_settings[_0x3421('0x23')]}});}})[_0x3421('0x19')](function(_0x417d6e){if(!_0x417d6e){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x27'));}if(!_0x417d6e[_0x3421('0xf')]||!_0x417d6e[_0x3421('0x28')]){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x29'));}_0x3e2ecd=_0x417d6e;logger['info'](util[_0x3421('0xd')](_0x3421('0x34'),_0xf9cb85['id']));return sentiment(_0x3e2ecd[_0x3421('0xf')],_0x3e2ecd[_0x3421('0x28')],_0x59eaf1['sentimentRegion'],_0xf9cb85[_0x3421('0x15')],_0x59eaf1['language']);})[_0x3421('0x19')](function(_0x248f84){logger[_0x3421('0xc')](util[_0x3421('0xd')](_0x3421('0x35'),_0xf9cb85['id']));return _0xf9cb85[_0x3421('0x1d')]({'sentiment':_0x248f84[_0x3421('0x2b')],'sPositive':_0x248f84[_0x3421('0x2c')][_0x3421('0x36')],'sNegative':_0x248f84[_0x3421('0x2c')][_0x3421('0x37')],'sMixed':_0x248f84[_0x3421('0x2c')][_0x3421('0x2d')],'sNeutral':_0x248f84['SentimentScore'][_0x3421('0x2e')],'transcribeStatus':'COMPLETED'});})[_0x3421('0x19')](function(){logger[_0x3421('0xc')](util[_0x3421('0xd')](_0x3421('0x1e'),_0xf9cb85['id']));_0xb4ea90();});}})[_0x3421('0x38')](function(_0x354b20){if(_0x354b20){if(!_0x354b20[_0x3421('0x39')]||_0x354b20[_0x3421('0x39')]!==_0x3421('0x3a')){logger[_0x3421('0x3b')](util['format'](_0x3421('0x3c'),_0xf9cb85['id']),util[_0x3421('0x3d')](_0x354b20,{'showHidden':![],'depth':null}));}}_0xb4ea90();});});}function checkTranscribe(){var _0x261819;var _0x57bf06;var _0x566f95;return db[_0x3421('0x3e')][_0x3421('0x3f')]({'where':{'transcribeStatus':_0x3421('0x40')}})['then'](function(_0x38ca90){if(!_0x38ca90||!_0x38ca90[_0x3421('0x41')]){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))]('No\x20transcribe\x20job\x20to\x20check');}_0x261819=_0x38ca90;return db[_0x3421('0x42')][_0x3421('0x25')]({'where':{'id':0x1}});})[_0x3421('0x19')](function(_0x51a21f){if(!_0x51a21f){throw new db['Sequelize']['ValidationError'](_0x3421('0x43'));}_0x57bf06=_0x51a21f;if(!_0x57bf06[_0x3421('0x44')]||!_0x57bf06['transcribeAccountId']||!_0x57bf06['transcribeRegion']||!_0x57bf06[_0x3421('0x21')]||!_0x57bf06[_0x3421('0x33')]){throw new db[(_0x3421('0x1f'))][(_0x3421('0x26'))](_0x3421('0x45'));}return db['CloudProvider'][_0x3421('0x25')]({'where':{'id':_0x57bf06[_0x3421('0x46')]}});})[_0x3421('0x19')](function(_0x2f9ce1){if(!_0x2f9ce1){throw new db['Sequelize'][(_0x3421('0x26'))](_0x3421('0x27'));}if(!_0x2f9ce1[_0x3421('0xf')]||!_0x2f9ce1['data2']){throw new db[(_0x3421('0x1f'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x566f95=_0x2f9ce1;var _0x11d30f=[];_0x261819['forEach'](function(_0x4e33a0){_0x11d30f[_0x3421('0x47')](checkTranscribeJob(_0x4e33a0,_0x57bf06,_0x566f95));});return BPromise[_0x3421('0x48')](_0x11d30f);})['catch'](function(_0xe120bf){if(_0xe120bf){if(!_0xe120bf[_0x3421('0x39')]||_0xe120bf[_0x3421('0x39')]!==_0x3421('0x3a')){logger[_0x3421('0x3b')](util[_0x3421('0x3d')](_0xe120bf,{'showHidden':![],'depth':null}));}}});}exports[_0x3421('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index dcb3ab2..1eb70f0 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeefe=['emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','../../config/environment','../../mysqldb','schedule','redis','localhost','WhatsappInteraction','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x53177b,_0x4dbb96){var _0xb276ac=function(_0x376865){while(--_0x376865){_0x53177b['push'](_0x53177b['shift']());}};_0xb276ac(++_0x4dbb96);}(_0xeefe,0x119));var _0xeeef=function(_0x17a067,_0xb04ff8){_0x17a067=_0x17a067-0x0;var _0x1d8a23=_0xeefe[_0x17a067];return _0x1d8a23;};'use strict';var _=require(_0xeeef('0x0'));var moment=require(_0xeeef('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xeeef('0x2'));var db=require(_0xeeef('0x3'))['db'];var logger=require('../logger')(_0xeeef('0x4'));config[_0xeeef('0x5')]=_['defaults'](config[_0xeeef('0x5')],{'host':_0xeeef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeeef('0x5')]));function closeInteractions(){var _0x592d6d=[];return db[_0xeeef('0x7')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xeeef('0x8')](0x18,'hours')}}})[_0xeeef('0x9')](function(_0x21519a){if(_0x21519a&&_0x21519a[_0xeeef('0xa')]){_0x592d6d=_[_0xeeef('0xb')](_0x21519a||[],'id');logger[_0xeeef('0xc')](_0xeeef('0xd'),_0x592d6d['join']());return db[_0xeeef('0x7')][_0xeeef('0xe')]({'closeReason':_0xeeef('0xf'),'disposition':_0xeeef('0x10'),'closed':!![],'closedAt':moment()['format'](_0xeeef('0x11'))},{'where':{'id':_0x592d6d}});}})['then'](function(){if(_0x592d6d&&_0x592d6d['length']){logger[_0xeeef('0xc')](_0xeeef('0x12'),_0x592d6d['join']());for(var _0x130a7b=0x0;_0x130a7b<_0x592d6d[_0xeeef('0xa')];_0x130a7b++){io[_0xeeef('0x13')](_0xeeef('0x14'),{'id':_0x592d6d[_0x130a7b],'closed':!![]});}}})[_0xeeef('0x15')](function(_0x562f0e){logger[_0xeeef('0x16')](_0xeeef('0x17'),_0x562f0e?util[_0xeeef('0x18')](_0x562f0e,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc366=['timeout','format','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','util','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0x5786f1,_0x3b6883){var _0x5abaeb=function(_0x50230b){while(--_0x50230b){_0x5786f1['push'](_0x5786f1['shift']());}};_0x5abaeb(++_0x3b6883);}(_0xc366,0x10d));var _0x6c36=function(_0x26ab5a,_0x298b43){_0x26ab5a=_0x26ab5a-0x0;var _0x5c3cab=_0xc366[_0x26ab5a];return _0x5c3cab;};'use strict';var _=require(_0x6c36('0x0'));var moment=require(_0x6c36('0x1'));var Redis=require(_0x6c36('0x2'));var util=require(_0x6c36('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x6c36('0x4'));config[_0x6c36('0x5')]=_[_0x6c36('0x6')](config['redis'],{'host':_0x6c36('0x7'),'port':0x18eb});var io=require(_0x6c36('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x3d53bc=[];return db[_0x6c36('0x9')][_0x6c36('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6c36('0xb')](0x18,_0x6c36('0xc'))}}})[_0x6c36('0xd')](function(_0x31a52c){if(_0x31a52c&&_0x31a52c[_0x6c36('0xe')]){_0x3d53bc=_[_0x6c36('0xf')](_0x31a52c||[],'id');logger[_0x6c36('0x10')](_0x6c36('0x11'),_0x3d53bc[_0x6c36('0x12')]());return db[_0x6c36('0x9')][_0x6c36('0x13')]({'closeReason':_0x6c36('0x14'),'disposition':_0x6c36('0x15'),'closed':!![],'closedAt':moment()[_0x6c36('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3d53bc}});}})['then'](function(){if(_0x3d53bc&&_0x3d53bc[_0x6c36('0xe')]){logger[_0x6c36('0x10')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3d53bc[_0x6c36('0x12')]());for(var _0x1f1b0a=0x0;_0x1f1b0a<_0x3d53bc['length'];_0x1f1b0a++){io[_0x6c36('0x17')](_0x6c36('0x18'),{'id':_0x3d53bc[_0x1f1b0a],'closed':!![]});}}})[_0x6c36('0x19')](function(_0x406cb2){logger[_0x6c36('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x406cb2?util[_0x6c36('0x1b')](_0x406cb2,{'showHidden':![],'depth':null}):'');});}exports[_0x6c36('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 342fc78..568bf6a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21f8=['CmHopper','log','hopper1','bulkCreate','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','CmContact','finished\x20populating'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x21f8,0x1a5));var _0x821f=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x21f8[_0x81dcac];return _0xc7803b;};'use strict';var util=require('util');var db=require(_0x821f('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x821f('0x1')]({'id':i,'firstName':_0x821f('0x2')+i,'lastName':_0x821f('0x3')+i,'phone':0xf879fb460+i,'email':_0x821f('0x4')+i+_0x821f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x821f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x821f('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x821f('0x2')+i,'lastName':_0x821f('0x3')+i,'phone':0xf879fb460+i,'email':_0x821f('0x4')+i+_0x821f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x821f('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x821f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x821f('0x6')](),'updatedAt':Date['now']()});}db['CmContact'][_0x821f('0x7')]({'where':{}})[_0x821f('0x8')](function(){return db[_0x821f('0x9')]['bulkCreate'](contacts);})[_0x821f('0x8')](function(){console['log'](_0x821f('0xa'),'contacts1');return db[_0x821f('0xb')][_0x821f('0x7')]({'where':{}});})[_0x821f('0x8')](function(){return db[_0x821f('0xb')]['bulkCreate'](hopper);})['then'](function(){console[_0x821f('0xc')](_0x821f('0xa'),_0x821f('0xd'));return db[_0x821f('0x9')][_0x821f('0xe')](contacts2);})[_0x821f('0x8')](function(){console['log'](_0x821f('0xa'),_0x821f('0xf'));return db[_0x821f('0xb')][_0x821f('0xe')](hopper2);})[_0x821f('0x8')](function(){console[_0x821f('0xc')](_0x821f('0xa'),_0x821f('0x10'));})[_0x821f('0x11')](function(_0x471926){console[_0x821f('0xc')](_0x471926);}); \ No newline at end of file +var _0xf9d6=['innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','catch','Biondo'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf9d6,0x87));var _0x6f9d=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0xf9d6[_0x2bc1fe];return _0x1a47a5;};'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['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6f9d('0x0')+i,'phone':0xf879fb460+i,'email':_0x6f9d('0x1')+i+_0x6f9d('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6f9d('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x6f9d('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6f9d('0x4')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6f9d('0x3')]({'id':i,'firstName':_0x6f9d('0x5')+i,'lastName':_0x6f9d('0x0')+i,'phone':0xf879fb460+i,'email':_0x6f9d('0x1')+i+_0x6f9d('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6f9d('0x4')]()});}db[_0x6f9d('0x6')][_0x6f9d('0x7')]({'where':{}})[_0x6f9d('0x8')](function(){return db[_0x6f9d('0x6')][_0x6f9d('0x9')](contacts);})[_0x6f9d('0x8')](function(){console[_0x6f9d('0xa')](_0x6f9d('0xb'),_0x6f9d('0xc'));return db[_0x6f9d('0xd')][_0x6f9d('0x7')]({'where':{}});})[_0x6f9d('0x8')](function(){return db[_0x6f9d('0xd')][_0x6f9d('0x9')](hopper);})[_0x6f9d('0x8')](function(){console[_0x6f9d('0xa')](_0x6f9d('0xb'),_0x6f9d('0xe'));return db['CmContact'][_0x6f9d('0x9')](contacts2);})[_0x6f9d('0x8')](function(){console['log']('finished\x20populating',_0x6f9d('0xf'));return db['CmHopper'][_0x6f9d('0x9')](hopper2);})[_0x6f9d('0x8')](function(){console[_0x6f9d('0xa')](_0x6f9d('0xb'),'hopper2');})[_0x6f9d('0x10')](function(_0x1b9dbd){console[_0x6f9d('0xa')](_0x1b9dbd);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7982c27..bcda768 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaea9=['format','%s%s','agent','%s%s@xcally.com','password','friend','wss','all','yes','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push'];(function(_0x537127,_0x5a2766){var _0x2f2105=function(_0x2925ee){while(--_0x2925ee){_0x537127['push'](_0x537127['shift']());}};_0x2f2105(++_0x5a2766);}(_0xaea9,0x179));var _0x9aea=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xaea9[_0x23e7c1];return _0x1add43;};'use strict';var util=require(_0x9aea('0x0'));var db=require(_0x9aea('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9aea('0x2')]({'name':util[_0x9aea('0x3')](_0x9aea('0x4'),_0x9aea('0x5'),i),'fullname':util[_0x9aea('0x3')](_0x9aea('0x4'),_0x9aea('0x5'),i),'email':util['format'](_0x9aea('0x6'),_0x9aea('0x5'),i),'role':_0x9aea('0x5'),'password':_0x9aea('0x7'),'internal':0xfa0+i,'type':_0x9aea('0x8'),'transport':['udp','ws',_0x9aea('0x9')],'disallow':[_0x9aea('0xa')],'allow':['ulaw'],'defaultuser':util[_0x9aea('0x3')](_0x9aea('0x4'),'agent',i),'encryption':_0x9aea('0xb'),'avpf':_0x9aea('0xb'),'force_avp':_0x9aea('0xb'),'icesupport':_0x9aea('0xb'),'dtlsenable':_0x9aea('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x9aea('0xc'),'dtlssetup':_0x9aea('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x9aea('0x3')](_0x9aea('0x4'),_0x9aea('0x5'),i),0xfa0+i)});}db['User'][_0x9aea('0xe')](users)[_0x9aea('0xf')](function(){console[_0x9aea('0x10')](_0x9aea('0x11'));})[_0x9aea('0x12')](function(_0x2a45ac){console[_0x9aea('0x10')](_0x2a45ac);}); \ No newline at end of file +var _0x9389=['/etc/pki/tls/certs/motion.crt','%s%s','User','bulkCreate','then','log','add\x20user','../mysqldb','push','agent','format','password','friend','udp','wss','all','ulaw','yes'];(function(_0x40afdc,_0x1d140a){var _0x3662ac=function(_0x115dd3){while(--_0x115dd3){_0x40afdc['push'](_0x40afdc['shift']());}};_0x3662ac(++_0x1d140a);}(_0x9389,0x139));var _0x9938=function(_0x31e373,_0x92014e){_0x31e373=_0x31e373-0x0;var _0x57b958=_0x9389[_0x31e373];return _0x57b958;};'use strict';var util=require('util');var db=require(_0x9938('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9938('0x1')]({'name':util['format']('%s%s',_0x9938('0x2'),i),'fullname':util[_0x9938('0x3')]('%s%s','agent',i),'email':util[_0x9938('0x3')]('%s%s@xcally.com',_0x9938('0x2'),i),'role':_0x9938('0x2'),'password':_0x9938('0x4'),'internal':0xfa0+i,'type':_0x9938('0x5'),'transport':[_0x9938('0x6'),'ws',_0x9938('0x7')],'disallow':[_0x9938('0x8')],'allow':[_0x9938('0x9')],'defaultuser':util[_0x9938('0x3')]('%s%s','agent',i),'encryption':_0x9938('0xa'),'avpf':_0x9938('0xa'),'force_avp':_0x9938('0xa'),'icesupport':_0x9938('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x9938('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x9938('0x3')](_0x9938('0xc'),'agent',i),0xfa0+i)});}db[_0x9938('0xd')][_0x9938('0xe')](users)[_0x9938('0xf')](function(){console[_0x9938('0x10')](_0x9938('0x11'));})['catch'](function(_0x7b5dfa){console[_0x9938('0x10')](_0x7b5dfa);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 530aa97..58e1d63 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5302=['ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','userProfileId','OpenchannelQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','join','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','bluebird','../mysqldb','Agents','name','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','User','where','role','Campaign','format','%s:queue:%s','length','query','find','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','include','push','VoiceQueue'];(function(_0x43e2f3,_0x42712f){var _0x448ff5=function(_0x1d32f5){while(--_0x1d32f5){_0x43e2f3['push'](_0x43e2f3['shift']());}};_0x448ff5(++_0x42712f);}(_0x5302,0x1b5));var _0x2530=function(_0x16907f,_0x19c4a1){_0x16907f=_0x16907f-0x0;var _0xdb824=_0x5302[_0x16907f];return _0xdb824;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x2530('0x0'));var db=require(_0x2530('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x2530('0x2'),'model':db['User'],'attributes':['id',_0x2530('0x3'),'role'],'raw':!![],'where':{'role':_0x2530('0x4')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2530('0x3')],'where':{'role':_0x2530('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2530('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x2530('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2530('0x3'),_0x2530('0x6')],'where':{'type':_0x2530('0x7')}};function getAssociatedResources(_0x1070de,_0x3f7422,_0x166848){return db[_0x2530('0x8')][_0x2530('0x9')]({'where':{'name':_0x1070de,'userProfileId':_0x3f7422},'raw':!![]})[_0x2530('0xa')](function(_0x35b948){if(_0x35b948){if(_0x35b948[_0x2530('0xb')]){switch(_0x1070de){case _0x2530('0xc'):case _0x2530('0xd'):case _0x2530('0xe'):case _0x2530('0xf'):case _0x2530('0x10'):case _0x2530('0x11'):case'WhatsappQueues':return db[_0x166848][_0x2530('0x12')](queryQueues);case _0x2530('0x13'):return db[_0x166848][_0x2530('0x12')](queryTelephones);case _0x2530('0x14'):return db[_0x166848][_0x2530('0x12')](queryTrunks);case _0x2530('0x15'):return db[_0x166848][_0x2530('0x12')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x35b948['id']},'raw':!![]})['then'](function(_0x1d276e){if(_0x1d276e){var _0x28b792={'where':{'id':_['map'](_0x1d276e,_0x2530('0x16'))},'raw':!![]};switch(_0x166848){case _0x2530('0x17'):_0x28b792[_0x2530('0x18')][_0x2530('0x19')]=_0x2530('0x5');break;case _0x2530('0x1a'):_0x28b792[_0x2530('0x18')][_0x2530('0x6')]=_0x2530('0x7');break;}return db[_0x166848]['findAll'](_0x28b792);}else{return[];}});}}else{return[];}})[_0x2530('0xa')](function(_0x16d6c6){return _0x16d6c6;});}function joinOrLeaveQueues(_0x42032f,_0x31edcd,_0x421ea4,_0xde715e){_0x42032f[_0x31edcd](util[_0x2530('0x1b')](_0x2530('0x1c'),_0x421ea4,_0xde715e[_0x2530('0x3')]));if(_0xde715e[_0x2530('0x2')]){for(var _0x23bcea=0x0;_0x23bcea<_0xde715e['Agents'][_0x2530('0x1d')];_0x23bcea+=0x1){_0x42032f[_0x31edcd](util[_0x2530('0x1b')]('user:%s',_0xde715e['Agents'][_0x23bcea][_0x2530('0x3')]));}}}function joinOrLeave(_0x29ce72,_0x16a913,_0x1a58eb){var _0x3dcf2c;if(_0x29ce72['handshake'][_0x2530('0x1e')]['id']){db[_0x2530('0x17')][_0x2530('0x1f')]({'attributes':['id',_0x2530('0x3'),_0x2530('0x19'),'userProfileId'],'where':{'id':_0x29ce72[_0x2530('0x20')]['query']['id']},'include':[{'model':db[_0x2530('0x21')],'as':_0x2530('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x2530('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2530('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2530('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x2530('0x26')],'as':_0x2530('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x2530('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x54d1b7){if(_0x54d1b7){_0x3dcf2c=_0x54d1b7;_0x29ce72[_0x16a913](util[_0x2530('0x1b')](_0x2530('0x29'),_0x54d1b7[_0x2530('0x3')]));var _0x5efc21=[];switch(_0x54d1b7['role']){case _0x2530('0x2a'):_0x29ce72[_0x16a913](_0x2530('0x2b'));_0x29ce72[_0x16a913](_0x2530('0x2c'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x2530('0x2d')];}_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x2f')][_0x2530('0x12')](queryQueues));_0x5efc21['push'](db[_0x2530('0x30')]['findAll'](queryQueues));_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x31')][_0x2530('0x12')](queryQueues));_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x32')][_0x2530('0x12')](queryQueues));_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x33')][_0x2530('0x12')](queryQueues));_0x5efc21['push'](db['OpenchannelQueue']['findAll'](queryQueues));_0x5efc21['push'](db[_0x2530('0x34')]['findAll'](queryQueues));_0x5efc21['push'](db[_0x2530('0x17')][_0x2530('0x12')](queryTelephones));_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x35')]['findAll'](queryTrunks));_0x5efc21[_0x2530('0x2e')](db[_0x2530('0x1a')]['findAll'](queryCampaigns));_0x5efc21[_0x2530('0x2e')](db['User'][_0x2530('0x12')](queryAgents));break;case _0x2530('0x36'):_0x29ce72[_0x16a913]('voice:inbound');_0x29ce72[_0x16a913](_0x2530('0x2c'));_0x5efc21[_0x2530('0x2e')](getAssociatedResources(_0x2530('0xc'),_0x54d1b7[_0x2530('0x37')],_0x2530('0x2f')));_0x5efc21['push'](getAssociatedResources(_0x2530('0xd'),_0x54d1b7['userProfileId'],_0x2530('0x30')));_0x5efc21[_0x2530('0x2e')](getAssociatedResources(_0x2530('0xe'),_0x54d1b7[_0x2530('0x37')],_0x2530('0x31')));_0x5efc21['push'](getAssociatedResources('SmsQueues',_0x54d1b7[_0x2530('0x37')],'SmsQueue'));_0x5efc21[_0x2530('0x2e')](getAssociatedResources(_0x2530('0x10'),_0x54d1b7[_0x2530('0x37')],_0x2530('0x33')));_0x5efc21[_0x2530('0x2e')](getAssociatedResources(_0x2530('0x11'),_0x54d1b7[_0x2530('0x37')],_0x2530('0x38')));_0x5efc21['push'](getAssociatedResources('WhatsappQueues',_0x54d1b7[_0x2530('0x37')],_0x2530('0x34')));_0x5efc21['push'](getAssociatedResources(_0x2530('0x13'),_0x54d1b7[_0x2530('0x37')],_0x2530('0x17')));_0x5efc21['push'](getAssociatedResources('Trunks',_0x54d1b7['userProfileId'],_0x2530('0x35')));_0x5efc21['push'](getAssociatedResources(_0x2530('0x15'),_0x54d1b7['userProfileId'],_0x2530('0x1a')));_0x5efc21[_0x2530('0x2e')](db['User']['findAll'](queryAgents));break;case'agent':_0x29ce72[_0x16a913]('voice:inbound');_0x29ce72[_0x16a913]('voice:outbound');_0x5efc21['push'](_0x54d1b7[_0x2530('0x39')]({'attributes':['id','name']}));_0x5efc21[_0x2530('0x2e')](_0x54d1b7[_0x2530('0x3a')]({'attributes':['id','name']}));_0x5efc21[_0x2530('0x2e')](_0x54d1b7[_0x2530('0x3b')]({'attributes':['id',_0x2530('0x3')]}));_0x5efc21['push'](_0x54d1b7[_0x2530('0x3c')]({'attributes':['id',_0x2530('0x3')]}));_0x5efc21['push'](_0x54d1b7['getMailQueues']({'attributes':['id',_0x2530('0x3')]}));_0x5efc21[_0x2530('0x2e')](_0x54d1b7[_0x2530('0x3d')]({'attributes':['id',_0x2530('0x3')]}));_0x5efc21[_0x2530('0x2e')](_0x54d1b7[_0x2530('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x2530('0x3f')](_0x5efc21);}})[_0x2530('0xa')](function(_0x44265b){if(_0x44265b&&_0x44265b[_0x2530('0x1d')]){for(var _0x4d88e5=0x0;_0x4d88e5<_0x44265b['length'];_0x4d88e5+=0x1){for(var _0xd28d0d=0x0;_0xd28d0d<_0x44265b[_0x4d88e5][_0x2530('0x1d')];_0xd28d0d+=0x1){switch(_0x4d88e5){case 0x0:joinOrLeaveQueues(_0x29ce72,_0x16a913,'voice',_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x1:joinOrLeaveQueues(_0x29ce72,_0x16a913,_0x2530('0x40'),_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x2:joinOrLeaveQueues(_0x29ce72,_0x16a913,_0x2530('0x41'),_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x3:joinOrLeaveQueues(_0x29ce72,_0x16a913,_0x2530('0x42'),_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x4:joinOrLeaveQueues(_0x29ce72,_0x16a913,_0x2530('0x43'),_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x5:joinOrLeaveQueues(_0x29ce72,_0x16a913,'openchannel',_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x6:joinOrLeaveQueues(_0x29ce72,_0x16a913,_0x2530('0x44'),_0x44265b[_0x4d88e5][_0xd28d0d]);break;case 0x7:if(_0x3dcf2c[_0x2530('0x19')]!==_0x2530('0x4'))_0x29ce72[_0x16a913](util['format']('telephone:%s',_0x44265b[_0x4d88e5][_0xd28d0d][_0x2530('0x3')]));break;case 0x8:if(_0x3dcf2c[_0x2530('0x19')]!==_0x2530('0x4'))_0x29ce72[_0x16a913](util[_0x2530('0x1b')](_0x2530('0x45'),_0x44265b[_0x4d88e5][_0xd28d0d][_0x2530('0x3')]));break;case 0x9:if(_0x3dcf2c['role']!==_0x2530('0x4'))_0x29ce72[_0x16a913](util['format'](_0x2530('0x46'),_0x44265b[_0x4d88e5][_0xd28d0d][_0x2530('0x6')],_0x44265b[_0x4d88e5][_0xd28d0d]['name']));break;case 0xa:_0x29ce72[_0x16a913](util[_0x2530('0x1b')](_0x2530('0x29'),_0x44265b[_0x4d88e5][_0xd28d0d][_0x2530('0x3')]));break;}}}}})[_0x2530('0xa')](function(){if(_0x16a913===_0x2530('0x47')){var _0x36623e=_[_0x2530('0x48')](_0x3dcf2c[_0x2530('0x22')],'id');return _0x3dcf2c[_0x2530('0x49')](_0x36623e)[_0x2530('0xa')](function(){for(var _0x546b8c=0x0;_0x546b8c<_0x36623e[_0x2530('0x1d')];_0x546b8c+=0x1){_0x1a58eb[_0x2530('0x4a')](_0x2530('0x4b'),{'ChatInteractionId':Number(_0x36623e[_0x546b8c]),'UserId':Number(_0x3dcf2c['id'])});}});}})[_0x2530('0xa')](function(){if(_0x16a913===_0x2530('0x47')){var _0x4ba5be=_['map'](_0x3dcf2c[_0x2530('0x4c')],'id');return _0x3dcf2c['removeMailInteractions'](_0x4ba5be)[_0x2530('0xa')](function(){for(var _0x9dd409=0x0;_0x9dd409<_0x4ba5be['length'];_0x9dd409+=0x1){_0x1a58eb[_0x2530('0x4a')](_0x2530('0x4d'),{'MailInteractionId':Number(_0x4ba5be[_0x9dd409]),'UserId':Number(_0x3dcf2c['id'])});}});}})[_0x2530('0xa')](function(){if(_0x16a913===_0x2530('0x47')){var _0x372a1c=_['map'](_0x3dcf2c[_0x2530('0x4e')],'id');return _0x3dcf2c[_0x2530('0x4f')](_0x372a1c)['then'](function(){for(var _0x5a178a=0x0;_0x5a178a<_0x372a1c['length'];_0x5a178a+=0x1){_0x1a58eb[_0x2530('0x4a')](_0x2530('0x50'),{'FaxInteractionId':Number(_0x372a1c[_0x5a178a]),'UserId':Number(_0x3dcf2c['id'])});}});}})[_0x2530('0xa')](function(){if(_0x16a913===_0x2530('0x47')){var _0xb052ab=_['map'](_0x3dcf2c['SmsInteractions'],'id');return _0x3dcf2c[_0x2530('0x51')](_0xb052ab)['then'](function(){for(var _0x4a7b89=0x0;_0x4a7b89<_0xb052ab[_0x2530('0x1d')];_0x4a7b89+=0x1){_0x1a58eb[_0x2530('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xb052ab[_0x4a7b89]),'UserId':Number(_0x3dcf2c['id'])});}});}})['then'](function(){if(_0x16a913===_0x2530('0x47')){var _0x52e73c=_[_0x2530('0x48')](_0x3dcf2c[_0x2530('0x27')],'id');return _0x3dcf2c[_0x2530('0x52')](_0x52e73c)['then'](function(){for(var _0x185a72=0x0;_0x185a72<_0x52e73c[_0x2530('0x1d')];_0x185a72+=0x1){_0x1a58eb[_0x2530('0x4a')](_0x2530('0x53'),{'OpenchannelInteractionId':Number(_0x52e73c[_0x185a72]),'UserId':Number(_0x3dcf2c['id'])});}});}})[_0x2530('0xa')](function(){if(_0x16a913===_0x2530('0x47')){var _0x32844b=_['map'](_0x3dcf2c[_0x2530('0x28')],'id');return _0x3dcf2c['removeWhatsappInteractions'](_0x32844b)[_0x2530('0xa')](function(){for(var _0x19d4b5=0x0;_0x19d4b5<_0x32844b[_0x2530('0x1d')];_0x19d4b5+=0x1){_0x1a58eb['emit'](_0x2530('0x54'),{'WhatsappInteractionId':Number(_0x32844b[_0x19d4b5]),'UserId':Number(_0x3dcf2c['id'])});}});}})['catch'](function(_0x53a028){_0x29ce72['log'](_0x53a028);});}}function onDisconnect(_0x29b824,_0x1a2fc2){joinOrLeave(_0x29b824,'leave',_0x1a2fc2);}function onConnect(_0x4c5246){joinOrLeave(_0x4c5246,_0x2530('0x55'));}exports['default']=function(_0x23ba11){_0x23ba11['on'](_0x2530('0x56'),function(_0x427d9d){_0x427d9d[_0x2530('0x57')](0x0);_0x427d9d[_0x2530('0x58')]=_0x427d9d[_0x2530('0x59')][_0x2530('0x56')]['remoteAddress']+':'+_0x427d9d[_0x2530('0x59')][_0x2530('0x56')][_0x2530('0x5a')];_0x427d9d[_0x2530('0x5b')]=new Date();_0x427d9d[_0x2530('0x5c')]=function(_0x33f248){console[_0x2530('0x5c')](_0x2530('0x5d')+_0x427d9d[_0x2530('0x5e')][_0x2530('0x3')]+'['+_0x427d9d[_0x2530('0x58')]+']',_0x33f248);};_0x427d9d['on']('disconnect',function(){onDisconnect(_0x427d9d,_0x23ba11);_0x427d9d[_0x2530('0x5c')](_0x2530('0x5f'));});onConnect(_0x427d9d);_0x427d9d[_0x2530('0x5c')](_0x2530('0x60'));});}; \ No newline at end of file +var _0x6365=['ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','user','userProfileId','WhatsappQueue','Trunks','Trunk','agent','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','chat','sms','mail','openchannel','campaign:%s:%s','leave','map','removeChatInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','connection','setMaxListeners','address','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','telephone','type','UserProfileSection','findOne','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','resourceId','then','Campaign','where','ivr','%s:queue:%s','format','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue'];(function(_0x49d563,_0x39ee4d){var _0x2e39ed=function(_0x44429b){while(--_0x44429b){_0x49d563['push'](_0x49d563['shift']());}};_0x2e39ed(++_0x39ee4d);}(_0x6365,0x148));var _0x5636=function(_0x5dca2c,_0x52d28c){_0x5dca2c=_0x5dca2c-0x0;var _0x5710e9=_0x6365[_0x5dca2c];return _0x5710e9;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var BPromise=require(_0x5636('0x2'));var db=require(_0x5636('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x5636('0x4')],'include':[{'as':_0x5636('0x5'),'model':db[_0x5636('0x6')],'attributes':['id',_0x5636('0x4'),_0x5636('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5636('0x4')],'where':{'role':_0x5636('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5636('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x5636('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5636('0x4'),_0x5636('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x516641,_0x10d9bc,_0x43e880){return db[_0x5636('0xa')][_0x5636('0xb')]({'where':{'name':_0x516641,'userProfileId':_0x10d9bc},'raw':!![]})['then'](function(_0x4a810c){if(_0x4a810c){if(_0x4a810c[_0x5636('0xc')]){switch(_0x516641){case'VoiceQueues':case _0x5636('0xd'):case _0x5636('0xe'):case _0x5636('0xf'):case _0x5636('0x10'):case _0x5636('0x11'):case _0x5636('0x12'):return db[_0x43e880]['findAll'](queryQueues);case _0x5636('0x13'):return db[_0x43e880][_0x5636('0x14')](queryTelephones);case'Trunks':return db[_0x43e880][_0x5636('0x14')](queryTrunks);case _0x5636('0x15'):return db[_0x43e880]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x5636('0x14')]({'attributes':[_0x5636('0x16')],'where':{'sectionId':_0x4a810c['id']},'raw':!![]})[_0x5636('0x17')](function(_0x11340b){if(_0x11340b){var _0x3fb15a={'where':{'id':_['map'](_0x11340b,_0x5636('0x16'))},'raw':!![]};switch(_0x43e880){case'User':_0x3fb15a['where'][_0x5636('0x7')]=_0x5636('0x8');break;case _0x5636('0x18'):_0x3fb15a[_0x5636('0x19')][_0x5636('0x9')]=_0x5636('0x1a');break;}return db[_0x43e880][_0x5636('0x14')](_0x3fb15a);}else{return[];}});}}else{return[];}})[_0x5636('0x17')](function(_0x522d61){return _0x522d61;});}function joinOrLeaveQueues(_0x4dd749,_0x306e98,_0x433fec,_0x418891){_0x4dd749[_0x306e98](util['format'](_0x5636('0x1b'),_0x433fec,_0x418891[_0x5636('0x4')]));if(_0x418891[_0x5636('0x5')]){for(var _0x2e0c79=0x0;_0x2e0c79<_0x418891[_0x5636('0x5')]['length'];_0x2e0c79+=0x1){_0x4dd749[_0x306e98](util[_0x5636('0x1c')](_0x5636('0x1d'),_0x418891[_0x5636('0x5')][_0x2e0c79][_0x5636('0x4')]));}}}function joinOrLeave(_0x51520a,_0x4c913c,_0x39585c){var _0x4d8f1c;if(_0x51520a[_0x5636('0x1e')][_0x5636('0x1f')]['id']){db[_0x5636('0x6')][_0x5636('0x20')]({'attributes':['id','name',_0x5636('0x7'),'userProfileId'],'where':{'id':_0x51520a[_0x5636('0x1e')]['query']['id']},'include':[{'model':db[_0x5636('0x21')],'as':_0x5636('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x5636('0x23')],'as':_0x5636('0x24'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x5636('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5636('0x26')],'as':_0x5636('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5636('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5636('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x5636('0x17')](function(_0x54726e){if(_0x54726e){_0x4d8f1c=_0x54726e;_0x51520a[_0x4c913c](util[_0x5636('0x1c')]('user:%s',_0x54726e[_0x5636('0x4')]));var _0x4f0ac2=[];switch(_0x54726e[_0x5636('0x7')]){case'admin':_0x51520a[_0x4c913c](_0x5636('0x2a'));_0x51520a[_0x4c913c](_0x5636('0x2b'));if(queryQueues[_0x5636('0x2c')]('include')){delete queryQueues[_0x5636('0x2d')];}_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x2f')]['findAll'](queryQueues));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x30')][_0x5636('0x14')](queryQueues));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x31')][_0x5636('0x14')](queryQueues));_0x4f0ac2['push'](db['SmsQueue'][_0x5636('0x14')](queryQueues));_0x4f0ac2['push'](db[_0x5636('0x32')]['findAll'](queryQueues));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x33')][_0x5636('0x14')](queryQueues));_0x4f0ac2[_0x5636('0x2e')](db['WhatsappQueue'][_0x5636('0x14')](queryQueues));_0x4f0ac2['push'](db[_0x5636('0x6')][_0x5636('0x14')](queryTelephones));_0x4f0ac2[_0x5636('0x2e')](db['Trunk']['findAll'](queryTrunks));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x18')][_0x5636('0x14')](queryCampaigns));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x6')][_0x5636('0x14')](queryAgents));break;case _0x5636('0x34'):_0x51520a[_0x4c913c]('voice:inbound');_0x51520a[_0x4c913c](_0x5636('0x2b'));_0x4f0ac2['push'](getAssociatedResources('VoiceQueues',_0x54726e[_0x5636('0x35')],_0x5636('0x2f')));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0xd'),_0x54726e[_0x5636('0x35')],_0x5636('0x30')));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0xe'),_0x54726e[_0x5636('0x35')],_0x5636('0x31')));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0xf'),_0x54726e['userProfileId'],'SmsQueue'));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0x10'),_0x54726e['userProfileId'],'MailQueue'));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0x11'),_0x54726e[_0x5636('0x35')],_0x5636('0x33')));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources('WhatsappQueues',_0x54726e['userProfileId'],_0x5636('0x36')));_0x4f0ac2[_0x5636('0x2e')](getAssociatedResources(_0x5636('0x13'),_0x54726e[_0x5636('0x35')],'User'));_0x4f0ac2['push'](getAssociatedResources(_0x5636('0x37'),_0x54726e[_0x5636('0x35')],_0x5636('0x38')));_0x4f0ac2['push'](getAssociatedResources('IvrCampaigns',_0x54726e[_0x5636('0x35')],_0x5636('0x18')));_0x4f0ac2[_0x5636('0x2e')](db[_0x5636('0x6')]['findAll'](queryAgents));break;case _0x5636('0x39'):_0x51520a[_0x4c913c](_0x5636('0x2a'));_0x51520a[_0x4c913c](_0x5636('0x2b'));_0x4f0ac2[_0x5636('0x2e')](_0x54726e[_0x5636('0x3a')]({'attributes':['id',_0x5636('0x4')]}));_0x4f0ac2[_0x5636('0x2e')](_0x54726e[_0x5636('0x3b')]({'attributes':['id',_0x5636('0x4')]}));_0x4f0ac2['push'](_0x54726e[_0x5636('0x3c')]({'attributes':['id','name']}));_0x4f0ac2[_0x5636('0x2e')](_0x54726e['getSmsQueues']({'attributes':['id',_0x5636('0x4')]}));_0x4f0ac2[_0x5636('0x2e')](_0x54726e[_0x5636('0x3d')]({'attributes':['id',_0x5636('0x4')]}));_0x4f0ac2[_0x5636('0x2e')](_0x54726e[_0x5636('0x3e')]({'attributes':['id','name']}));_0x4f0ac2[_0x5636('0x2e')](_0x54726e[_0x5636('0x3f')]({'attributes':['id',_0x5636('0x4')]}));break;}return BPromise[_0x5636('0x40')](_0x4f0ac2);}})[_0x5636('0x17')](function(_0x394ae8){if(_0x394ae8&&_0x394ae8[_0x5636('0x41')]){for(var _0x39c019=0x0;_0x39c019<_0x394ae8[_0x5636('0x41')];_0x39c019+=0x1){for(var _0x310051=0x0;_0x310051<_0x394ae8[_0x39c019][_0x5636('0x41')];_0x310051+=0x1){switch(_0x39c019){case 0x0:joinOrLeaveQueues(_0x51520a,_0x4c913c,'voice',_0x394ae8[_0x39c019][_0x310051]);break;case 0x1:joinOrLeaveQueues(_0x51520a,_0x4c913c,_0x5636('0x42'),_0x394ae8[_0x39c019][_0x310051]);break;case 0x2:joinOrLeaveQueues(_0x51520a,_0x4c913c,'fax',_0x394ae8[_0x39c019][_0x310051]);break;case 0x3:joinOrLeaveQueues(_0x51520a,_0x4c913c,_0x5636('0x43'),_0x394ae8[_0x39c019][_0x310051]);break;case 0x4:joinOrLeaveQueues(_0x51520a,_0x4c913c,_0x5636('0x44'),_0x394ae8[_0x39c019][_0x310051]);break;case 0x5:joinOrLeaveQueues(_0x51520a,_0x4c913c,_0x5636('0x45'),_0x394ae8[_0x39c019][_0x310051]);break;case 0x6:joinOrLeaveQueues(_0x51520a,_0x4c913c,'whatsapp',_0x394ae8[_0x39c019][_0x310051]);break;case 0x7:if(_0x4d8f1c[_0x5636('0x7')]!==_0x5636('0x39'))_0x51520a[_0x4c913c](util[_0x5636('0x1c')]('telephone:%s',_0x394ae8[_0x39c019][_0x310051]['name']));break;case 0x8:if(_0x4d8f1c['role']!==_0x5636('0x39'))_0x51520a[_0x4c913c](util[_0x5636('0x1c')]('trunk:%s',_0x394ae8[_0x39c019][_0x310051][_0x5636('0x4')]));break;case 0x9:if(_0x4d8f1c['role']!==_0x5636('0x39'))_0x51520a[_0x4c913c](util[_0x5636('0x1c')](_0x5636('0x46'),_0x394ae8[_0x39c019][_0x310051][_0x5636('0x9')],_0x394ae8[_0x39c019][_0x310051][_0x5636('0x4')]));break;case 0xa:_0x51520a[_0x4c913c](util['format'](_0x5636('0x1d'),_0x394ae8[_0x39c019][_0x310051][_0x5636('0x4')]));break;}}}}})[_0x5636('0x17')](function(){if(_0x4c913c===_0x5636('0x47')){var _0x56f38a=_[_0x5636('0x48')](_0x4d8f1c[_0x5636('0x22')],'id');return _0x4d8f1c[_0x5636('0x49')](_0x56f38a)[_0x5636('0x17')](function(){for(var _0x163268=0x0;_0x163268<_0x56f38a[_0x5636('0x41')];_0x163268+=0x1){_0x39585c['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x56f38a[_0x163268]),'UserId':Number(_0x4d8f1c['id'])});}});}})['then'](function(){if(_0x4c913c===_0x5636('0x47')){var _0x3b7840=_[_0x5636('0x48')](_0x4d8f1c[_0x5636('0x24')],'id');return _0x4d8f1c['removeMailInteractions'](_0x3b7840)[_0x5636('0x17')](function(){for(var _0x23cdde=0x0;_0x23cdde<_0x3b7840['length'];_0x23cdde+=0x1){_0x39585c['emit'](_0x5636('0x4a'),{'MailInteractionId':Number(_0x3b7840[_0x23cdde]),'UserId':Number(_0x4d8f1c['id'])});}});}})['then'](function(){if(_0x4c913c==='leave'){var _0x5d0d72=_['map'](_0x4d8f1c[_0x5636('0x25')],'id');return _0x4d8f1c[_0x5636('0x4b')](_0x5d0d72)[_0x5636('0x17')](function(){for(var _0x1d3699=0x0;_0x1d3699<_0x5d0d72['length'];_0x1d3699+=0x1){_0x39585c[_0x5636('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5d0d72[_0x1d3699]),'UserId':Number(_0x4d8f1c['id'])});}});}})[_0x5636('0x17')](function(){if(_0x4c913c===_0x5636('0x47')){var _0x257bf0=_[_0x5636('0x48')](_0x4d8f1c[_0x5636('0x27')],'id');return _0x4d8f1c[_0x5636('0x4d')](_0x257bf0)[_0x5636('0x17')](function(){for(var _0x28a72a=0x0;_0x28a72a<_0x257bf0[_0x5636('0x41')];_0x28a72a+=0x1){_0x39585c['emit'](_0x5636('0x4e'),{'SmsInteractionId':Number(_0x257bf0[_0x28a72a]),'UserId':Number(_0x4d8f1c['id'])});}});}})[_0x5636('0x17')](function(){if(_0x4c913c===_0x5636('0x47')){var _0x48283d=_[_0x5636('0x48')](_0x4d8f1c[_0x5636('0x4f')],'id');return _0x4d8f1c[_0x5636('0x50')](_0x48283d)[_0x5636('0x17')](function(){for(var _0x44daac=0x0;_0x44daac<_0x48283d['length'];_0x44daac+=0x1){_0x39585c['emit'](_0x5636('0x51'),{'OpenchannelInteractionId':Number(_0x48283d[_0x44daac]),'UserId':Number(_0x4d8f1c['id'])});}});}})[_0x5636('0x17')](function(){if(_0x4c913c===_0x5636('0x47')){var _0x3eb35e=_[_0x5636('0x48')](_0x4d8f1c['WhatsappInteractions'],'id');return _0x4d8f1c['removeWhatsappInteractions'](_0x3eb35e)[_0x5636('0x17')](function(){for(var _0x510a16=0x0;_0x510a16<_0x3eb35e[_0x5636('0x41')];_0x510a16+=0x1){_0x39585c[_0x5636('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3eb35e[_0x510a16]),'UserId':Number(_0x4d8f1c['id'])});}});}})[_0x5636('0x52')](function(_0x2e8acc){_0x51520a[_0x5636('0x53')](_0x2e8acc);});}}function onDisconnect(_0x2ad9ab,_0x3a4127){joinOrLeave(_0x2ad9ab,_0x5636('0x47'),_0x3a4127);}function onConnect(_0x1fcaa3){joinOrLeave(_0x1fcaa3,_0x5636('0x54'));}exports['default']=function(_0x3fe4dd){_0x3fe4dd['on'](_0x5636('0x55'),function(_0x1bed7f){_0x1bed7f[_0x5636('0x56')](0x0);_0x1bed7f[_0x5636('0x57')]=_0x1bed7f['request'][_0x5636('0x55')][_0x5636('0x58')]+':'+_0x1bed7f['request']['connection'][_0x5636('0x59')];_0x1bed7f[_0x5636('0x5a')]=new Date();_0x1bed7f['log']=function(_0x43bb83){console[_0x5636('0x53')](_0x5636('0x5b')+_0x1bed7f['nsp'][_0x5636('0x4')]+'['+_0x1bed7f[_0x5636('0x57')]+']',_0x43bb83);};_0x1bed7f['on'](_0x5636('0x5c'),function(){onDisconnect(_0x1bed7f,_0x3fe4dd);_0x1bed7f[_0x5636('0x53')]('DISCONNECTED');});onConnect(_0x1bed7f);_0x1bed7f['log'](_0x5636('0x5d'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 38e4f2b..32d6746 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 _0xece0=['Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','error','code','Trigger,\x20%s','catch','get','event','direction','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','find','name','interface','format','SIP/%s','channel','agent','incomingmessage','outgoingmessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','changed','closed','UserId','fullname','internal','length','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xece0,0x69));var _0x0ece=function(_0x1b691a,_0x3aea0d){_0x1b691a=_0x1b691a-0x0;var _0x5de158=_0xece0[_0x1b691a];return _0x5de158;};'use strict';var util=require(_0x0ece('0x0'));var db=require(_0x0ece('0x1'))['db'];var jayson=require(_0x0ece('0x2'));var logger=require(_0x0ece('0x3'))(_0x0ece('0x4'));var _=require(_0x0ece('0x5'));var client=jayson[_0x0ece('0x6')]['http']({'port':0x232a});var triggers=[{'channel':_0x0ece('0x7'),'model':_0x0ece('0x8'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xa'),'callback':afterCreate},{'channel':_0x0ece('0x7'),'model':_0x0ece('0x8'),'event':_0x0ece('0xb'),'condition':_0x0ece('0xc'),'callback':afterUpdate},{'channel':_0x0ece('0x7'),'model':_0x0ece('0xd'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xe'),'callback':afterCreateMessage},{'channel':_0x0ece('0xf'),'model':_0x0ece('0x10'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xa'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0ece('0xf'),'model':'SmsMessage','event':_0x0ece('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0ece('0x11'),'model':_0x0ece('0x12'),'event':_0x0ece('0x9'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0ece('0x11'),'model':_0x0ece('0x12'),'event':'afterUpdate','condition':_0x0ece('0xc'),'callback':afterUpdate},{'channel':_0x0ece('0x11'),'model':_0x0ece('0x13'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xe'),'callback':afterCreateMessage},{'channel':_0x0ece('0x14'),'model':_0x0ece('0x15'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xa'),'callback':afterCreate},{'channel':_0x0ece('0x14'),'model':_0x0ece('0x15'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0ece('0x14'),'model':'FaxMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0ece('0x16'),'model':_0x0ece('0x17'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x0ece('0x16'),'model':_0x0ece('0x17'),'event':_0x0ece('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x0ece('0x18'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xe'),'callback':afterCreateMessage},{'channel':_0x0ece('0x19'),'model':_0x0ece('0x1a'),'event':_0x0ece('0x9'),'condition':_0x0ece('0xa'),'callback':afterCreate},{'channel':_0x0ece('0x19'),'model':_0x0ece('0x1a'),'event':'afterUpdate','condition':_0x0ece('0xc'),'callback':afterUpdate},{'channel':_0x0ece('0x19'),'model':_0x0ece('0x1b'),'event':'afterCreate','condition':_0x0ece('0xe'),'callback':afterCreateMessage}];function request(_0x1e43d0){return client[_0x0ece('0x1c')](_0x0ece('0x1d'),_0x1e43d0)[_0x0ece('0x1e')](function(_0x189dec){logger['info']('Trigger,\x20%s',_0x0ece('0x1d'),_0x189dec);if(_0x189dec[_0x0ece('0x1f')]){if(_0x189dec[_0x0ece('0x1f')][_0x0ece('0x20')]===0x1f4){logger[_0x0ece('0x1f')](_0x0ece('0x21'),_0x0ece('0x1d'),_0x189dec[_0x0ece('0x1f')]);}}})[_0x0ece('0x22')](function(_0x1661e0){logger[_0x0ece('0x1f')]('Trigger,\x20%s','EventManager',_0x1661e0);});}function afterCreateMessage(_0xf00d36,_0x505815){return function(_0x33cbfa,_0x3c3ae0){_0x33cbfa=_0x33cbfa[_0x0ece('0x23')]({'plain':!![]});_0x33cbfa['channel']=_0xf00d36;_0x33cbfa[_0x0ece('0x24')]=_0x33cbfa[_0x0ece('0x25')];var _0x3e15f8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33cbfa[_0x0ece('0x26')];return db[_0x0ece('0x27')]['query'](_0x3e15f8,{'type':db[_0x0ece('0x28')][_0x0ece('0x29')][_0x0ece('0x2a')],'raw':!![]})[_0x0ece('0x1e')](function(_0x344c5b){return _0x344c5b;})[_0x0ece('0x1e')](function(_0x17caf7){if(_0x17caf7){_0x33cbfa[_0x0ece('0x2b')]=_0x17caf7[0x0];}if(_0x33cbfa['UserId']){return db['User'][_0x0ece('0x2c')]({'where':{'id':_0x33cbfa['UserId']},'attributes':['id',_0x0ece('0x2d'),'fullname','email','internal'],'raw':!![]})[_0x0ece('0x1e')](function(_0x15e15e){_0x33cbfa[_0x0ece('0x2e')]=util[_0x0ece('0x2f')](_0x0ece('0x30'),_0x15e15e[_0x0ece('0x2d')]);_0x33cbfa[_0x0ece('0x31')]=_0xf00d36;_0x33cbfa[_0x0ece('0x32')]=_0x15e15e;return request({'event':_0x0ece('0x33'),'message':_0x33cbfa});})['catch'](function(_0x26d7ba){console['error'](_0x26d7ba);});}else{return request({'event':_0x0ece('0x34'),'message':_0x33cbfa});}});};}function afterCreate(_0x572f00,_0x1de3b3){return function(_0x4c371d,_0x2d37ad){_0x4c371d=_0x4c371d['get']({'plain':!![]});_0x4c371d[_0x0ece('0x31')]=_0x572f00;_0x4c371d[_0x0ece('0x24')]='opened';var _0x490486=_0x0ece('0x35')+_0x4c371d[_0x0ece('0x26')];return db[_0x0ece('0x27')][_0x0ece('0x36')](_0x490486,{'type':db[_0x0ece('0x28')]['QueryTypes'][_0x0ece('0x2a')],'raw':!![]})['then'](function(_0x39f3dd){return _0x39f3dd;})[_0x0ece('0x1e')](function(_0x4a4228){if(_0x4a4228){_0x4c371d[_0x0ece('0x2b')]=_0x4a4228[0x0];}return request({'event':_0x1de3b3,'message':_0x4c371d});});};}function afterUpdate(_0x5221a6,_0x18797e){return function(_0xfaff97,_0x33a359){if(_0xfaff97[_0x0ece('0x37')](_0x0ece('0x38'))&&_0xfaff97[_0x0ece('0x38')]){_0xfaff97=_0xfaff97[_0x0ece('0x23')]({'plain':!![]});_0xfaff97[_0x0ece('0x31')]=_0x5221a6;_0xfaff97[_0x0ece('0x24')]=_0x0ece('0x38');var _0x12a1b8=_0x0ece('0x35')+_0xfaff97[_0x0ece('0x26')];return db[_0x0ece('0x27')][_0x0ece('0x36')](_0x12a1b8,{'type':db[_0x0ece('0x28')][_0x0ece('0x29')][_0x0ece('0x2a')],'raw':!![]})['then'](function(_0xcd992d){return _0xcd992d;})[_0x0ece('0x1e')](function(_0x586dd6){if(_0x586dd6){_0xfaff97[_0x0ece('0x2b')]=_0x586dd6[0x0];}if(_0xfaff97[_0x0ece('0x39')]){return db['User'][_0x0ece('0x2c')]({'where':{'id':_0xfaff97[_0x0ece('0x39')]},'attributes':['id',_0x0ece('0x2d'),_0x0ece('0x3a'),'email',_0x0ece('0x3b')],'raw':!![]})[_0x0ece('0x1e')](function(_0x44f18b){_0xfaff97[_0x0ece('0x2e')]=util['format'](_0x0ece('0x30'),_0x44f18b[_0x0ece('0x2d')]);_0xfaff97['agent']=_0x44f18b;return request({'event':_0x18797e,'message':_0xfaff97});})['catch'](function(_0x478674){console[_0x0ece('0x1f')](_0x478674);});}else{return request({'event':_0x18797e,'message':_0xfaff97});}});}};}exports['default']=function(){for(var _0x23d1ba=0x0;_0x23d1ba=_0x20bc48['agents']){throw Error(_0xa86d('0x12'));}_0x4f34bc(_0x13d33c);})[_0xa86d('0x13')](function(_0x4aaf1b){_0x4762a3(_0x4aaf1b);});});}; \ No newline at end of file +var _0x8850=['isUndefined','updateAttributes','getLicense','agent','count','agents','catch','lodash','bluebird','../mysqldb','./license/util','mail','chat','sms','whatsapp','getChannels','isValidChannel','includes','clearBlockUser'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x8850,0x1e2));var _0x0885=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8850[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x0885('0x0'));var BPromise=require(_0x0885('0x1'));var db=require(_0x0885('0x2'))['db'];var util=require(_0x0885('0x3'));var channels=['voice',_0x0885('0x4'),_0x0885('0x5'),'fax',_0x0885('0x6'),_0x0885('0x7'),'openchannel'];exports[_0x0885('0x8')]=function(){return channels;};exports[_0x0885('0x9')]=function(_0x1495ac){_0x1495ac=_0x1495ac['toLowerCase']();return _[_0x0885('0xa')](channels,_0x1495ac);};exports[_0x0885('0xb')]=function(_0x4d0a52,_0x5b99c2,_0x371622,_0x2aa454){var _0x1058a3={'loginAttempts':_0x5b99c2,'blocked':_0x371622};if(!_[_0x0885('0xc')](_0x2aa454)){_0x1058a3['blockedAt']=_0x2aa454;}return _0x4d0a52[_0x0885('0xd')](_0x1058a3);};exports[_0x0885('0xe')]=function(_0x4e36e8){return new BPromise(function(_0x69e87,_0x1ec259){var _0x1ceacb=0x0;if(_0x4e36e8['role']!==_0x0885('0xf')){_0x69e87(_0x4e36e8);}db['User'][_0x0885('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4e36e8['id']}}})['then'](function(_0xbcf0b0){_0x1ceacb=_0xbcf0b0;return util[_0x0885('0xe')]();})['then'](function(_0x2d011b){if(_0x2d011b&&_0x2d011b[_0x0885('0x11')]&&_0x1ceacb>=_0x2d011b[_0x0885('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x69e87(_0x4e36e8);})[_0x0885('0x12')](function(_0x35e6a3){_0x1ec259(_0x35e6a3);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 31397c6..d55b95a 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bae=['send','exports','404','render','status','json'];(function(_0x5dc475,_0x24fdef){var _0x1682bd=function(_0x2e36b0){while(--_0x2e36b0){_0x5dc475['push'](_0x5dc475['shift']());}};_0x1682bd(++_0x24fdef);}(_0x9bae,0x115));var _0xe9ba=function(_0x40810e,_0x1d0f96){_0x40810e=_0x40810e-0x0;var _0x414a94=_0x9bae[_0x40810e];return _0x414a94;};'use strict';module[_0xe9ba('0x0')][0x194]=function pageNotFound(_0x4f8014,_0x5e42b1){var _0x4e942d=_0xe9ba('0x1');var _0xe9f6cc=0x194;var _0x3a6e6c={'status':_0xe9f6cc};_0x5e42b1['status'](_0x3a6e6c['status']);_0x5e42b1[_0xe9ba('0x2')](_0x4e942d,{},function(_0x2cf51b,_0x759d9b){if(_0x2cf51b){return _0x5e42b1[_0xe9ba('0x3')](_0x3a6e6c['status'])[_0xe9ba('0x4')](_0x3a6e6c);}_0x5e42b1[_0xe9ba('0x5')](_0x759d9b);});}; \ No newline at end of file +var _0x1d6a=['status','render','json','send'];(function(_0x34007c,_0x2be81c){var _0x5bf874=function(_0x502b36){while(--_0x502b36){_0x34007c['push'](_0x34007c['shift']());}};_0x5bf874(++_0x2be81c);}(_0x1d6a,0x190));var _0xa1d6=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1d6a[_0x465a0c];return _0x1e202e;};'use strict';module['exports'][0x194]=function pageNotFound(_0x431276,_0x18b6b5){var _0x14177d='404';var _0x26e3cb=0x194;var _0x5368d5={'status':_0x26e3cb};_0x18b6b5[_0xa1d6('0x0')](_0x5368d5[_0xa1d6('0x0')]);_0x18b6b5[_0xa1d6('0x1')](_0x14177d,{},function(_0x4f43f9,_0x370885){if(_0x4f43f9){return _0x18b6b5[_0xa1d6('0x0')](_0x5368d5['status'])[_0xa1d6('0x2')](_0x5368d5);}_0x18b6b5[_0xa1d6('0x3')](_0x370885);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 2f868f2..4b915d1 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd506=['../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','Realtime','../api/realtime/realtime.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteraction','FaxInteractions','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','VoicePrefix','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','cascade','ChanSpyId','VoiceExtension','Applications','Members','VoiceQueueId','HopperHistories','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','VoiceAgentReport','uniqueid','Contact','ContactId','MailAccount','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','ListId','team_has_mail_queues','MailInteractionId','Account','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','List','Dashboard','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','Users','FaxMessage','AttachmentId','team_has_fax_queues','CannedAnswer','SmsAccountId','SmsApplication','SmsInteractionId','Owner','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','chat_group_has_users','Website','Hoppers','JscriptySessions','MailInteractions','Company','CompanyId','cm_contact_has_tags','CampaignId','CmHopperBlack','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Field','VariableId','AccountId','Subjects','Description','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','Dynamics365Account','FreshsalesField','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','JscriptyAnswerReport','SessionId','JscriptyProject','ProjectId','SmsQueues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','sequelize','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','name','database','username','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue'];(function(_0xe2ebaa,_0x138483){var _0x563838=function(_0x542a4c){while(--_0x542a4c){_0xe2ebaa['push'](_0xe2ebaa['shift']());}};_0x563838(++_0x138483);}(_0xd506,0x197));var _0x6d50=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd506[_0x243b2f];return _0xcb3c2d;};'use strict';var path=require(_0x6d50('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config[_0x6d50('0x1')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x6d50('0x2'),'port':0xcea,'dialect':_0x6d50('0x3'),'dialectOptions':{'charset':_0x6d50('0x4')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x6d50('0x5'),'collate':_0x6d50('0x6')}}});config[_0x6d50('0x7')]=_['defaultsDeep'](config[_0x6d50('0x7')],{'database':'motion2','username':_0x6d50('0x8'),'password':_0x6d50('0x9'),'options':{'host':_0x6d50('0x2'),'port':0xcea,'dialect':_0x6d50('0x3'),'dialectOptions':{'charset':_0x6d50('0x4')},'logging':![],'timezone':timezone[_0x6d50('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x6d50('0xb')],config[_0x6d50('0x1')][_0x6d50('0xc')],config[_0x6d50('0x1')]['password'],config[_0x6d50('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6d50('0x7')]['database'],config['sequelizeHistory']['username'],config[_0x6d50('0x7')]['password'],config[_0x6d50('0x7')][_0x6d50('0xd')])};db['User']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xf'));db[_0x6d50('0x10')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x11'));db[_0x6d50('0x12')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/voiceExtension/voiceExtension.model');db[_0x6d50('0x13')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x14'));db[_0x6d50('0x15')]=db['sequelize']['import']('../api/voiceQueue/voiceQueue.model');db[_0x6d50('0x16')]=db[_0x6d50('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x17'));db[_0x6d50('0x18')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x19'));db[_0x6d50('0x1a')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x1b'));db['VoiceCallReport']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x1c'));db['VoiceAgentReport']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x1d'));db[_0x6d50('0x1e')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x1f'));db[_0x6d50('0x20')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x21'));db[_0x6d50('0x22')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x23'));db[_0x6d50('0x24')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x25'));db[_0x6d50('0x26')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x27'));db[_0x6d50('0x28')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x29'));db[_0x6d50('0x2a')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x2b'));db['UserMailQueue']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x2c'));db[_0x6d50('0x2d')]=db[_0x6d50('0x1')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x6d50('0x2e')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x2f'));db[_0x6d50('0x30')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x31'));db[_0x6d50('0x32')]=db['sequelize']['import'](_0x6d50('0x33'));db[_0x6d50('0x34')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x35'));db['MailServerOut']=db[_0x6d50('0x1')]['import']('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x36'));db['MailQueue']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x37'));db[_0x6d50('0x38')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x39'));db[_0x6d50('0x3a')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x3b'));db[_0x6d50('0x3c')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x3d'));db[_0x6d50('0x3e')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x3f'));db['Dashboard']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/dashboard/dashboard.model');db[_0x6d50('0x40')]=db['sequelize']['import'](_0x6d50('0x41'));db['FaxAccount']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/faxAccount/faxAccount.model');db[_0x6d50('0x42')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x43'));db['FaxMessage']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x44'));db[_0x6d50('0x45')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x46'));db[_0x6d50('0x47')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize']['import'](_0x6d50('0x48'));db[_0x6d50('0x49')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x4a'));db[_0x6d50('0x4b')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x4c'));db[_0x6d50('0x4d')]=db[_0x6d50('0x1')]['import']('../api/smsQueue/smsQueue.model');db[_0x6d50('0x4e')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x4f'));db[_0x6d50('0x50')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x51'));db[_0x6d50('0x52')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x53'));db[_0x6d50('0x54')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x55'));db[_0x6d50('0x56')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x57'));db[_0x6d50('0x58')]=db['sequelize']['import'](_0x6d50('0x59'));db[_0x6d50('0x5a')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x5b'));db[_0x6d50('0x5c')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x5d'));db[_0x6d50('0x5e')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x5f'));db[_0x6d50('0x60')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x61'));db[_0x6d50('0x62')]=db['sequelize']['import'](_0x6d50('0x63'));db[_0x6d50('0x64')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x65'));db[_0x6d50('0x66')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/chatGroup/chatGroup.model');db[_0x6d50('0x67')]=db['sequelize']['import'](_0x6d50('0x68'));db[_0x6d50('0x69')]=db['sequelize'][_0x6d50('0xe')]('../api/cmCompany/cmCompany.model');db[_0x6d50('0x6a')]=db['sequelize']['import'](_0x6d50('0x6b'));db[_0x6d50('0x6c')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x6d'));db['CmHopperBlack']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x6e'));db[_0x6d50('0x6f')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x70'));db['CmHopperHistory']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x71'));db[_0x6d50('0x72')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x73'));db[_0x6d50('0x74')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x75'));db[_0x6d50('0x76')]=db[_0x6d50('0x1')]['import']('../api/action/action.model');db[_0x6d50('0x77')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x78'));db['CannedAnswer']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x79'));db[_0x6d50('0x7a')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x7b'));db['Condition']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x7c'));db[_0x6d50('0x7d')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x7e'));db[_0x6d50('0x7f')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x80'));db['Cdr']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x81'));db[_0x6d50('0x82')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x83'));db[_0x6d50('0x84')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x85'));db[_0x6d50('0x86')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x87'));db['Tag']=db['sequelize']['import'](_0x6d50('0x88'));db[_0x6d50('0x89')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x8a'));db[_0x6d50('0x8b')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x8c'));db[_0x6d50('0x8d')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x8e'));db[_0x6d50('0x8f')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/integration/integration.model');db[_0x6d50('0x90')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x91'));db[_0x6d50('0x92')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x6d50('0x93')]=db['sequelize']['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x6d50('0x94')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x95'));db['AnalyticMetric']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x96'));db[_0x6d50('0x97')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x98'));db[_0x6d50('0x99')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x9a'));db[_0x6d50('0x9b')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x9c'));db['SalesforceConfiguration']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x9d'));db[_0x6d50('0x9e')]=db['sequelize'][_0x6d50('0xe')]('../api/intSalesforceField/intSalesforceField.model');db[_0x6d50('0x9f')]=db['sequelize']['import'](_0x6d50('0xa0'));db[_0x6d50('0xa1')]=db['sequelize'][_0x6d50('0xe')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x6d50('0xa2')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xa3'));db[_0x6d50('0xa4')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xa5'));db[_0x6d50('0xa6')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xa7'));db[_0x6d50('0xa8')]=db[_0x6d50('0x1')]['import'](_0x6d50('0xa9'));db[_0x6d50('0xaa')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xab'));db[_0x6d50('0xac')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xad'));db[_0x6d50('0xae')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xaf'));db[_0x6d50('0xb0')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xb1'));db[_0x6d50('0xb2')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xb3'));db[_0x6d50('0xb4')]=db[_0x6d50('0x1')]['import'](_0x6d50('0xb5'));db[_0x6d50('0xb6')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xb7'));db[_0x6d50('0xb8')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xb9'));db[_0x6d50('0xba')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x6d50('0xbb')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xbc'));db[_0x6d50('0xbd')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xbe'));db[_0x6d50('0xbf')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xc0'));db[_0x6d50('0xc1')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xc2'));db[_0x6d50('0xc3')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xc4'));db[_0x6d50('0xc5')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xc6'));db['Dynamics365Account']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xc7'));db[_0x6d50('0xc8')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xc9'));db[_0x6d50('0xca')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xcb'));db[_0x6d50('0xcc')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xcd'));db[_0x6d50('0xce')]=db[_0x6d50('0x1')]['import'](_0x6d50('0xcf'));db['FreshsalesField']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xd0'));db[_0x6d50('0x8f')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/integration/integration.model');db[_0x6d50('0xd1')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xd2'));db['ChatQueueReport']=db['sequelize'][_0x6d50('0xe')]('../api/chatQueueReport/chatQueueReport.model');db[_0x6d50('0xd3')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xd4'));db['JscriptyAnswerReport']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xd5'));db['JscriptyQuestionReport']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xd6'));db[_0x6d50('0xd7')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xd8'));db[_0x6d50('0xd9')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xda'));db[_0x6d50('0xdb')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xdc'));db[_0x6d50('0xdd')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xde'));db[_0x6d50('0xdf')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xe0'));db[_0x6d50('0xe1')]=db[_0x6d50('0x1')]['import'](_0x6d50('0xe2'));db[_0x6d50('0xe3')]=db[_0x6d50('0x1')]['import'](_0x6d50('0xe4'));db[_0x6d50('0xe5')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/squareRecording/squareRecording.model');db[_0x6d50('0xe6')]=db['sequelize'][_0x6d50('0xe')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/team/team.model');db[_0x6d50('0xe7')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xe8'));db[_0x6d50('0xe9')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xea'));db[_0x6d50('0xeb')]=db[_0x6d50('0x1')]['import']('../api/migration/migration.model');db['Attachment']=db['sequelize'][_0x6d50('0xe')]('../api/attachment/attachment.model');db[_0x6d50('0xec')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/plugin/plugin.model');db[_0x6d50('0xed')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/mailTransferReport/mailTransferReport.model');db[_0x6d50('0xee')]=db['sequelize']['import'](_0x6d50('0xef'));db[_0x6d50('0xf0')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xf1'));db[_0x6d50('0xf2')]=db[_0x6d50('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x6d50('0xf3')]=db[_0x6d50('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xf4'));db['VoicePrefix']=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xf5'));db[_0x6d50('0xf6')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/userProfile/userProfile.model');db[_0x6d50('0xf7')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0xf8'));db[_0x6d50('0xf9')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/userNotification/userNotification.model');db[_0x6d50('0xfa')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/whatsappAccount/whatsappAccount.model');db[_0x6d50('0xfb')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0xfc'));db[_0x6d50('0xfd')]=db[_0x6d50('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x6d50('0xfe')]=db['sequelize']['import'](_0x6d50('0xff'));db[_0x6d50('0x100')]=db[_0x6d50('0x1')][_0x6d50('0xe')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x6d50('0x101')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x102'));db[_0x6d50('0x103')]=db['sequelize'][_0x6d50('0xe')](_0x6d50('0x104'));db[_0x6d50('0x105')]=db[_0x6d50('0x1')]['import'](_0x6d50('0x106'));db[_0x6d50('0x107')]=db[_0x6d50('0x1')][_0x6d50('0xe')](_0x6d50('0x108'));db[_0x6d50('0x109')]=db['sequelize']['import'](_0x6d50('0x10a'));db[_0x6d50('0x10b')][_0x6d50('0x10c')](db[_0x6d50('0x18')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x16')],{'as':'Recordings','foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x26')],{'as':_0x6d50('0x10f'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x10b')]['hasMany'](db['VoiceExtension'],{'as':_0x6d50('0x110'),'onDelete':'cascade','hooks':!![]});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x6f')],{'as':_0x6d50('0x111'),'foreignKey':_0x6d50('0x10d')});db['User']['hasMany'](db[_0x6d50('0x112')],{'as':'HopperHistory','foreignKey':_0x6d50('0x10d')});db['User'][_0x6d50('0x10e')](db['ReportAgentPreview'],{'as':_0x6d50('0x72'),'foreignKey':'UserId'});db['User'][_0x6d50('0x10e')](db[_0x6d50('0x52')],{'as':_0x6d50('0x113'),'foreignKey':_0x6d50('0x10d')});db['User']['hasMany'](db[_0x6d50('0x5e')],{'as':_0x6d50('0x114'),'foreignKey':'UserId'});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x49')],{'as':'SmsInteractions','foreignKey':_0x6d50('0x10d')});db['User'][_0x6d50('0x10e')](db[_0x6d50('0x115')],{'as':_0x6d50('0x116'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x3a')],{'as':'MailInteractions','foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0xfd')],{'as':_0x6d50('0x117'),'foreignKey':'UserId'});db[_0x6d50('0x10b')][_0x6d50('0x10e')](db[_0x6d50('0x118')],{'as':_0x6d50('0x119'),'foreignKey':'SenderId'});db[_0x6d50('0x10b')][_0x6d50('0x11a')](db[_0x6d50('0xf6')],{'as':_0x6d50('0xf6'),'foreignKey':_0x6d50('0x11b')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x66')],{'as':'Groups','through':'chat_group_has_users'});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x11d'),'through':_0x6d50('0x11e')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x120'),'through':_0x6d50('0x121')});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0x122')],{'through':_0x6d50('0x123')});db['User'][_0x6d50('0x11c')](db[_0x6d50('0x3a')],{'as':'MailInteractions','through':_0x6d50('0x124')});db['User'][_0x6d50('0x11c')](db['ChatInteraction'],{'as':_0x6d50('0x114'),'through':_0x6d50('0x125')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x115')],{'as':'FaxInteractions','through':_0x6d50('0x126')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x49')],{'as':_0x6d50('0x127'),'through':_0x6d50('0x128')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x6d50('0x113'),'through':_0x6d50('0x129')});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0xfd')],{'as':_0x6d50('0x117'),'through':_0x6d50('0x12a')});db[_0x6d50('0x10b')]['belongsToMany'](db['VoiceQueue'],{'as':_0x6d50('0x12b'),'through':_0x6d50('0x28'),'required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x12c')],{'as':_0x6d50('0x12d'),'through':'UserMailQueue','required':![]});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0x64')],{'as':_0x6d50('0x12e'),'through':_0x6d50('0x2a'),'required':![],'hooks':!![]});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0x45')],{'as':_0x6d50('0x12f'),'through':_0x6d50('0x2d'),'required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x4d')],{'as':'SmsQueues','through':_0x6d50('0x2e'),'required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x56')],{'as':_0x6d50('0x130'),'through':'UserOpenchannelQueue','required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x103')],{'as':_0x6d50('0x131'),'through':'UserWhatsappQueue','required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x11f')],{'through':_0x6d50('0x121')});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0x132')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x58')],{'as':'ChatWebsites','through':_0x6d50('0x133')});db['User'][_0x6d50('0x11c')](db[_0x6d50('0x134')],{'as':_0x6d50('0x135'),'through':_0x6d50('0x136')});db['User'][_0x6d50('0x11c')](db['MailAccount'],{'as':_0x6d50('0x137'),'through':_0x6d50('0x138')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db[_0x6d50('0x4e')],{'as':_0x6d50('0x139'),'through':_0x6d50('0x13a')});db[_0x6d50('0x10b')]['belongsToMany'](db[_0x6d50('0x13b')],{'as':_0x6d50('0x13c'),'through':_0x6d50('0x13d')});db['User'][_0x6d50('0x11c')](db[_0x6d50('0xfa')],{'as':_0x6d50('0x13e'),'through':_0x6d50('0x13f')});db[_0x6d50('0x10b')][_0x6d50('0x11c')](db['SquareProject'],{'as':_0x6d50('0x140'),'through':_0x6d50('0x141')});db[_0x6d50('0x10')][_0x6d50('0x10e')](db['VoiceExtension'],{'as':_0x6d50('0x142'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x144')});db[_0x6d50('0x12')]['hasMany'](db[_0x6d50('0x145')],{'onDelete':'cascade'});db[_0x6d50('0x145')]['hasMany'](db[_0x6d50('0x145')],{'as':_0x6d50('0x146'),'onDelete':'cascade'});db[_0x6d50('0x13')][_0x6d50('0x11c')](db['Sound'],{'as':'Sounds','through':'moh_has_sounds'});db[_0x6d50('0x15')][_0x6d50('0x10e')](db[_0x6d50('0x26')],{'as':_0x6d50('0x147'),'foreignKey':_0x6d50('0x148')});db[_0x6d50('0x15')]['hasMany'](db[_0x6d50('0x6c')],{'as':'Hoppers','foreignKey':_0x6d50('0x148')});db[_0x6d50('0x15')][_0x6d50('0x10e')](db[_0x6d50('0x6f')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x6d50('0x15')][_0x6d50('0x10e')](db[_0x6d50('0x112')],{'as':_0x6d50('0x149'),'foreignKey':_0x6d50('0x148')});db['VoiceQueue'][_0x6d50('0x10e')](db[_0x6d50('0x72')],{'as':_0x6d50('0x72'),'foreignKey':_0x6d50('0x148')});db[_0x6d50('0x15')][_0x6d50('0x10e')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x6d50('0x148')});db[_0x6d50('0x15')][_0x6d50('0x10e')](db[_0x6d50('0xd7')],{'as':'JscriptySessions','foreignKey':_0x6d50('0x148')});db['VoiceQueue']['belongsTo'](db[_0x6d50('0x22')],{'as':_0x6d50('0x22'),'foreignKey':_0x6d50('0x14a')});db[_0x6d50('0x15')][_0x6d50('0x11a')](db[_0x6d50('0x22')],{'as':_0x6d50('0x14b'),'foreignKey':_0x6d50('0x14c')});db[_0x6d50('0x15')]['belongsTo'](db[_0x6d50('0x7d')],{'as':_0x6d50('0x7d'),'foreignKey':_0x6d50('0x14d')});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0x6d50('0x14e'),'foreignKey':_0x6d50('0x14f')});db['VoiceQueue'][_0x6d50('0x11c')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x120'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x28')});db[_0x6d50('0x15')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'as':_0x6d50('0x151'),'through':'TeamVoiceQueue'});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x6d50('0x152'),'through':'voice_queues_has_cm_blacklists'});db[_0x6d50('0x16')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':'User','foreignKey':_0x6d50('0x10d')});db['ScreenRecording']['belongsTo'](db[_0x6d50('0x10b')],{'as':_0x6d50('0x10b'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x18')][_0x6d50('0x10e')](db['VoiceMailMessage'],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':'mailboxuser','sourceKey':_0x6d50('0x154')});db[_0x6d50('0x1a')][_0x6d50('0x11a')](db[_0x6d50('0x18')],{'foreignKey':_0x6d50('0x155'),'targetKey':_0x6d50('0x154')});db[_0x6d50('0x156')]['hasMany'](db['VoiceQueueReport'],{'as':_0x6d50('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0x6d50('0x156')]['hasMany'](db[_0x6d50('0x158')],{'as':'AgentReports','foreignKey':_0x6d50('0x159'),'constraints':![]});db[_0x6d50('0x156')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x10b'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x156')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x34')][_0x6d50('0x11a')](db[_0x6d50('0x15c')],{'as':_0x6d50('0x15c'),'foreignKey':_0x6d50('0x15d')});db[_0x6d50('0x15e')][_0x6d50('0x11a')](db[_0x6d50('0x15c')],{'as':'MailAccount','foreignKey':_0x6d50('0x15d')});db[_0x6d50('0x15c')][_0x6d50('0x10c')](db[_0x6d50('0x34')],{'as':_0x6d50('0x15f'),'onDelete':_0x6d50('0x143')});db['MailAccount'][_0x6d50('0x10c')](db[_0x6d50('0x15e')],{'as':_0x6d50('0x160'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0x15c')][_0x6d50('0x10e')](db[_0x6d50('0x7a')],{'as':_0x6d50('0x161'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x6d50('0x162'),'foreignKey':'MailAccountId'});db[_0x6d50('0x15c')][_0x6d50('0x10e')](db[_0x6d50('0x163')],{'as':_0x6d50('0x153'),'foreignKey':'MailAccountId'});db[_0x6d50('0x15c')]['hasMany'](db[_0x6d50('0x3a')],{'as':_0x6d50('0x164')});db[_0x6d50('0x15c')]['hasMany'](db['MailApplication'],{'as':'Applications'});db[_0x6d50('0x15c')][_0x6d50('0x11a')](db['CmList'],{'as':'List','foreignKey':_0x6d50('0x165')});db['MailAccount'][_0x6d50('0x11a')](db[_0x6d50('0x89')],{'as':'Template','foreignKey':'TemplateId'});db[_0x6d50('0x15c')][_0x6d50('0x11a')](db[_0x6d50('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x6d50('0x14f')});db[_0x6d50('0x15c')][_0x6d50('0x11c')](db['User'],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x6d50('0x12c')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':'UserMailQueue'});db[_0x6d50('0x12c')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':_0x6d50('0x166'),'as':_0x6d50('0x151')});db[_0x6d50('0x3a')][_0x6d50('0x10e')](db[_0x6d50('0x163')],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x167')});db['MailInteraction'][_0x6d50('0x11a')](db['MailAccount'],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x15d')});db[_0x6d50('0x3a')]['belongsTo'](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x3a')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':'Owner','foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x3a')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x16a'),'as':_0x6d50('0x16b')});db[_0x6d50('0x3a')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x16a'),'as':_0x6d50('0x16c')});db['MailInteraction'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':'Users','through':_0x6d50('0x124'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x6d50('0x10e')](db[_0x6d50('0x16d')],{'as':_0x6d50('0x16e'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0x163')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x10b')});db[_0x6d50('0x163')][_0x6d50('0x11a')](db['CmContact'],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a')});db[_0x6d50('0x163')]['belongsTo'](db[_0x6d50('0x3a')],{'as':_0x6d50('0x16f'),'foreignKey':_0x6d50('0x167')});db[_0x6d50('0x163')][_0x6d50('0x11a')](db['MailAccount'],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x15d')});db[_0x6d50('0x163')][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'as':_0x6d50('0x58'),'foreignKey':_0x6d50('0x170')});db[_0x6d50('0x163')][_0x6d50('0x11a')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x6d50('0x171')});db[_0x6d50('0x3c')]['belongsTo'](db[_0x6d50('0x10b')],{'onDelete':'restrict'});db['MailApplication'][_0x6d50('0x11a')](db['MailQueue'],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x3c')][_0x6d50('0x11a')](db['MailAccount'],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x3c')][_0x6d50('0x11a')](db['Interval'],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x14d')});db[_0x6d50('0x3c')]['belongsTo'](db['Tag'],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x173')});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db[_0x6d50('0x15c')],{});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x174'),'foreignKey':'ListId'});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':'Contact','foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db['MailInteraction'],{});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db[_0x6d50('0x163')],{});db['MailQueueReport']['belongsTo'](db[_0x6d50('0x10b')],{});db[_0x6d50('0x3e')][_0x6d50('0x11a')](db[_0x6d50('0x12c')],{});db[_0x6d50('0x175')][_0x6d50('0x10e')](db['DashboardItem'],{'as':'Items','onDelete':_0x6d50('0x143')});db[_0x6d50('0x134')][_0x6d50('0x10e')](db[_0x6d50('0x7a')],{'as':'Dispositions','foreignKey':_0x6d50('0x176')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x6d50('0x162'),'foreignKey':'FaxAccountId'});db[_0x6d50('0x134')]['hasMany'](db[_0x6d50('0x115')],{'as':_0x6d50('0x164')});db[_0x6d50('0x134')]['hasMany'](db['FaxApplication'],{'as':_0x6d50('0x146')});db['FaxAccount'][_0x6d50('0x10e')](db[_0x6d50('0x145')],{'as':'Exntensions','onDelete':'cascade'});db[_0x6d50('0x134')][_0x6d50('0x10e')](db['FaxMessage'],{'as':_0x6d50('0x153')});db['FaxAccount'][_0x6d50('0x11a')](db[_0x6d50('0x22')],{'as':_0x6d50('0x22')});db['FaxAccount'][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x174'),'foreignKey':'ListId'});db[_0x6d50('0x134')]['belongsTo'](db[_0x6d50('0x7f')],{'as':_0x6d50('0x14e'),'foreignKey':_0x6d50('0x14f')});db[_0x6d50('0x134')]['belongsToMany'](db['User'],{'as':_0x6d50('0x150'),'through':'user_has_fax_accounts'});db[_0x6d50('0x42')][_0x6d50('0x11a')](db['User'],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x42')][_0x6d50('0x11a')](db[_0x6d50('0x45')],{'onDelete':_0x6d50('0x172')});db['FaxApplication'][_0x6d50('0x11a')](db[_0x6d50('0x134')],{'onDelete':_0x6d50('0x172')});db['FaxApplication'][_0x6d50('0x11a')](db[_0x6d50('0x169')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x173')});db[_0x6d50('0x115')][_0x6d50('0x10e')](db['FaxMessage'],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x177')});db[_0x6d50('0x115')][_0x6d50('0x11a')](db['FaxAccount'],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x176')});db[_0x6d50('0x115')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x115')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':'Owner','foreignKey':'UserId'});db[_0x6d50('0x115')]['belongsToMany'](db['Tag'],{'through':_0x6d50('0x178'),'as':_0x6d50('0x16b')});db[_0x6d50('0x115')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x6d50('0x115')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x179'),'through':'user_has_fax_interactions','foreignKey':_0x6d50('0x177')});db[_0x6d50('0x17a')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'onDelete':'cascade','as':_0x6d50('0x10b')});db[_0x6d50('0x17a')][_0x6d50('0x11a')](db[_0x6d50('0x115')],{'as':_0x6d50('0x16f'),'foreignKey':'FaxInteractionId'});db[_0x6d50('0x17a')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a')});db[_0x6d50('0x17a')][_0x6d50('0x11a')](db[_0x6d50('0x16d')],{'as':_0x6d50('0x16d'),'foreignKey':_0x6d50('0x17b')});db['FaxMessage'][_0x6d50('0x11a')](db[_0x6d50('0x134')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x176')});db[_0x6d50('0x45')][_0x6d50('0x11c')](db['User'],{'as':_0x6d50('0x150'),'through':_0x6d50('0x2d')});db[_0x6d50('0x45')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':_0x6d50('0x17c'),'as':_0x6d50('0x151')});db[_0x6d50('0x47')][_0x6d50('0x11a')](db[_0x6d50('0x134')],{});db[_0x6d50('0x47')][_0x6d50('0x11a')](db['CmList'],{'as':_0x6d50('0x174'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x47')][_0x6d50('0x11a')](db['CmContact'],{'as':_0x6d50('0x15a'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x115')],{});db[_0x6d50('0x47')][_0x6d50('0x11a')](db[_0x6d50('0x17a')],{});db[_0x6d50('0x47')]['belongsTo'](db['User'],{});db[_0x6d50('0x47')][_0x6d50('0x11a')](db[_0x6d50('0x45')],{});db['SmsAccount'][_0x6d50('0x10e')](db['Disposition'],{'as':_0x6d50('0x161'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x6d50('0x10e')](db[_0x6d50('0x17d')],{'as':_0x6d50('0x162'),'foreignKey':'SmsAccountId'});db[_0x6d50('0x13b')][_0x6d50('0x10e')](db[_0x6d50('0x4b')],{'as':_0x6d50('0x153'),'foreignKey':_0x6d50('0x17e')});db[_0x6d50('0x13b')][_0x6d50('0x10e')](db['SmsInteraction'],{'as':'Interactions'});db['SmsAccount'][_0x6d50('0x10e')](db[_0x6d50('0x17f')],{'as':_0x6d50('0x146')});db[_0x6d50('0x13b')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x6d50('0x13b')]['belongsTo'](db[_0x6d50('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6d50('0x13b')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x13d')});db[_0x6d50('0x17f')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x17f')][_0x6d50('0x11a')](db[_0x6d50('0x4d')],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x17f')]['belongsTo'](db[_0x6d50('0x13b')],{'onDelete':_0x6d50('0x172')});db['SmsApplication'][_0x6d50('0x11a')](db[_0x6d50('0x7d')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x14d')});db['SmsApplication']['belongsTo'](db[_0x6d50('0x169')],{'onDelete':'restrict','foreignKey':_0x6d50('0x173')});db[_0x6d50('0x49')]['hasMany'](db['SmsMessage'],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x180')});db[_0x6d50('0x49')][_0x6d50('0x11a')](db['SmsAccount'],{'as':'Account','foreignKey':_0x6d50('0x17e')});db[_0x6d50('0x49')][_0x6d50('0x11a')](db['CmContact'],{'as':_0x6d50('0x15a'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db[_0x6d50('0x10b')],{'as':_0x6d50('0x181'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x49')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x182'),'as':_0x6d50('0x16b')});db[_0x6d50('0x49')]['belongsToMany'](db[_0x6d50('0x169')],{'through':_0x6d50('0x182'),'as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0x6d50('0x10b')],{'as':'Users','through':_0x6d50('0x128'),'foreignKey':_0x6d50('0x180')});db['SmsMessage']['belongsTo'](db[_0x6d50('0x10b')],{'as':_0x6d50('0x10b')});db[_0x6d50('0x4b')]['belongsTo'](db[_0x6d50('0x6a')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a')});db[_0x6d50('0x4b')][_0x6d50('0x11a')](db[_0x6d50('0x49')],{'onDelete':_0x6d50('0x143'),'as':'Interaction','foreignKey':_0x6d50('0x180')});db[_0x6d50('0x4b')][_0x6d50('0x11a')](db[_0x6d50('0x13b')],{'as':_0x6d50('0x168'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x2e'),'foreignKey':_0x6d50('0x183')});db[_0x6d50('0x4d')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':_0x6d50('0x184'),'as':'Teams'});db[_0x6d50('0x4e')][_0x6d50('0x10e')](db[_0x6d50('0x7a')],{'as':_0x6d50('0x161'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x4e')][_0x6d50('0x10e')](db['CannedAnswer'],{'as':_0x6d50('0x162'),'foreignKey':_0x6d50('0x185')});db['OpenchannelAccount'][_0x6d50('0x10e')](db[_0x6d50('0x52')],{'as':_0x6d50('0x164'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x4e')][_0x6d50('0x10e')](db[_0x6d50('0x54')],{'as':_0x6d50('0x153'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x4e')][_0x6d50('0x10e')](db[_0x6d50('0x50')],{'as':_0x6d50('0x146'),'foreignKey':_0x6d50('0x185')});db['OpenchannelAccount']['belongsTo'](db[_0x6d50('0x11f')],{'as':_0x6d50('0x174'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x4e')][_0x6d50('0x11a')](db[_0x6d50('0x7f')],{'as':_0x6d50('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':'Agents','through':_0x6d50('0x13a')});db[_0x6d50('0x50')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0x50')][_0x6d50('0x11a')](db[_0x6d50('0x56')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x186')});db[_0x6d50('0x50')][_0x6d50('0x11a')](db[_0x6d50('0x4e')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x50')][_0x6d50('0x11a')](db[_0x6d50('0x7d')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x6d50('0x50')][_0x6d50('0x11a')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x6d50('0x173')});db[_0x6d50('0x52')][_0x6d50('0x10e')](db[_0x6d50('0x54')],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x187')});db[_0x6d50('0x52')][_0x6d50('0x11a')](db[_0x6d50('0x4e')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x52')]['belongsTo'](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x52')]['belongsTo'](db[_0x6d50('0x10b')],{'as':_0x6d50('0x181'),'foreignKey':_0x6d50('0x10d')});db['OpenchannelInteraction']['belongsToMany'](db[_0x6d50('0x169')],{'through':_0x6d50('0x188'),'as':_0x6d50('0x16b')});db['OpenchannelInteraction'][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x188'),'as':_0x6d50('0x16c')});db['OpenchannelInteraction'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x179'),'through':'user_has_openchannel_interactions','foreignKey':_0x6d50('0x187')});db[_0x6d50('0x54')]['belongsTo'](db[_0x6d50('0x10b')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x10b')});db[_0x6d50('0x54')]['belongsTo'](db['CmContact'],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a')});db[_0x6d50('0x54')][_0x6d50('0x11a')](db[_0x6d50('0x52')],{'onDelete':_0x6d50('0x143'),'as':'Interaction','foreignKey':_0x6d50('0x187')});db[_0x6d50('0x54')][_0x6d50('0x11a')](db[_0x6d50('0x16d')],{'as':_0x6d50('0x16d'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0x6d50('0x11a')](db[_0x6d50('0x4e')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x185')});db[_0x6d50('0x56')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x30'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':_0x6d50('0x189'),'as':_0x6d50('0x151')});db['ChatWebsite']['hasMany'](db[_0x6d50('0x7a')],{'as':_0x6d50('0x161'),'foreignKey':_0x6d50('0x170')});db[_0x6d50('0x58')]['hasMany'](db[_0x6d50('0x17d')],{'as':_0x6d50('0x162'),'foreignKey':_0x6d50('0x170')});db[_0x6d50('0x58')][_0x6d50('0x10e')](db['ChatProactiveAction'],{'as':_0x6d50('0x18a')});db[_0x6d50('0x58')][_0x6d50('0x10e')](db['ChatInteraction'],{'as':_0x6d50('0x164')});db[_0x6d50('0x58')][_0x6d50('0x10e')](db[_0x6d50('0x5c')],{'as':_0x6d50('0x146')});db['ChatWebsite'][_0x6d50('0x10e')](db[_0x6d50('0x60')],{'as':_0x6d50('0x153')});db[_0x6d50('0x58')][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':'List','foreignKey':_0x6d50('0x165')});db[_0x6d50('0x58')][_0x6d50('0x11a')](db['Interval'],{'as':_0x6d50('0x7d'),'foreignKey':_0x6d50('0x14d')});db[_0x6d50('0x58')][_0x6d50('0x11a')](db[_0x6d50('0x15c')],{'as':_0x6d50('0x15c'),'foreignKey':_0x6d50('0x15d')});db['ChatWebsite'][_0x6d50('0x11a')](db[_0x6d50('0x7f')],{'as':_0x6d50('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6d50('0x58')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x6d50('0x5a')][_0x6d50('0x11a')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x174'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x5a')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x5a')][_0x6d50('0x11a')](db[_0x6d50('0x52')],{});db['OpenchannelQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x54')],{});db[_0x6d50('0x5a')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{});db[_0x6d50('0x5a')][_0x6d50('0x11a')](db['OpenchannelQueue'],{});db[_0x6d50('0x5c')]['belongsTo'](db[_0x6d50('0x10b')],{'as':_0x6d50('0x18b'),'foreignKey':'UserId','onDelete':_0x6d50('0x172')});db[_0x6d50('0x5c')][_0x6d50('0x11a')](db[_0x6d50('0x64')],{'as':_0x6d50('0x18c'),'foreignKey':_0x6d50('0x18d'),'onDelete':'restrict'});db['ChatApplication'][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'as':'Website','foreignKey':_0x6d50('0x170'),'onDelete':'restrict'});db[_0x6d50('0x5c')][_0x6d50('0x11a')](db[_0x6d50('0x169')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x173')});db['ChatInteraction'][_0x6d50('0x10e')](db['ChatMessage'],{'as':_0x6d50('0x153'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x18e')});db[_0x6d50('0x5e')][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x6d50('0x5e')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x6d50('0x5e')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':'Owner','foreignKey':_0x6d50('0x10d')});db['ChatInteraction']['belongsToMany'](db[_0x6d50('0x169')],{'through':'chat_interaction_has_tags','as':_0x6d50('0x16b')});db['ChatInteraction'][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x18f'),'as':_0x6d50('0x16c')});db[_0x6d50('0x5e')]['belongsToMany'](db['User'],{'as':_0x6d50('0x179'),'through':_0x6d50('0x125'),'foreignKey':'ChatInteractionId'});db[_0x6d50('0x60')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x10b')});db['ChatMessage'][_0x6d50('0x11a')](db['CmContact'],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x60')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x16f'),'foreignKey':'ChatInteractionId'});db[_0x6d50('0x60')]['belongsTo'](db['Attachment'],{'as':_0x6d50('0x16d'),'foreignKey':'AttachmentId'});db[_0x6d50('0x60')][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x170')});db[_0x6d50('0x62')]['hasMany'](db[_0x6d50('0x16d')],{'as':_0x6d50('0x16e'),'foreignKey':_0x6d50('0x171'),'onDelete':'cascade','hooks':!![]});db[_0x6d50('0x62')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x62')][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'as':_0x6d50('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x2a'),'hooks':!![]});db[_0x6d50('0x64')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':'team_has_chat_queues','as':_0x6d50('0x151')});db['ChatGroup'][_0x6d50('0x10e')](db[_0x6d50('0xd3')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0x6d50('0x143')});db[_0x6d50('0x66')][_0x6d50('0x11c')](db['User'],{'as':_0x6d50('0x147'),'through':_0x6d50('0x190')});db['ChatProactiveAction']['belongsTo'](db['ChatWebsite'],{'as':_0x6d50('0x191'),'foreignKey':_0x6d50('0x170')});db['CmCompany'][_0x6d50('0x10e')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x11d'),'foreignKey':'CompanyId'});db['CmContact'][_0x6d50('0x10e')](db[_0x6d50('0x6c')],{'as':_0x6d50('0x192'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x6a')]['hasMany'](db[_0x6d50('0x6f')],{'as':_0x6d50('0x111'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db['CmHopperHistory'],{'as':_0x6d50('0x149'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db['ReportAgentPreview'],{'as':_0x6d50('0x72'),'foreignKey':_0x6d50('0x15b')});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db['JscriptySessionReport'],{'as':_0x6d50('0x193'),'foreignKey':'ContactId'});db[_0x6d50('0x6a')]['hasMany'](db[_0x6d50('0x52')],{'as':_0x6d50('0x113'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db[_0x6d50('0x5e')],{'as':_0x6d50('0x114'),'foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x172')});db[_0x6d50('0x6a')]['hasMany'](db[_0x6d50('0x49')],{'as':'SmsInteractions','foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x172')});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db[_0x6d50('0x115')],{'as':_0x6d50('0x116'),'foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x172')});db[_0x6d50('0x6a')][_0x6d50('0x10e')](db[_0x6d50('0x3a')],{'as':_0x6d50('0x194'),'foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x172')});db[_0x6d50('0x6a')][_0x6d50('0x11a')](db['CmCompany'],{'as':_0x6d50('0x195'),'foreignKey':_0x6d50('0x196')});db[_0x6d50('0x6a')][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':'List','foreignKey':_0x6d50('0x165'),'onDelete':'cascade'});db['CmContact'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x179'),'through':_0x6d50('0x11e')});db[_0x6d50('0x6a')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'as':_0x6d50('0x16b'),'through':_0x6d50('0x197')});db[_0x6d50('0x6a')]['belongsToMany'](db['Tag'],{'through':_0x6d50('0x197'),'as':_0x6d50('0x16c')});db['CmHopper']['belongsTo'](db['CmContact'],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0x6c')][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':'List','foreignKey':'ListId','onDelete':_0x6d50('0x143')});db[_0x6d50('0x6c')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x18b'),'foreignKey':_0x6d50('0x10d')});db[_0x6d50('0x6c')][_0x6d50('0x11a')](db['VoiceQueue'],{'as':_0x6d50('0x18c'),'foreignKey':_0x6d50('0x148'),'onDelete':_0x6d50('0x143')});db['CmHopper'][_0x6d50('0x11a')](db[_0x6d50('0xe9')],{'as':_0x6d50('0xe9'),'foreignKey':_0x6d50('0x198'),'onDelete':'cascade'});db['CmHopper'][_0x6d50('0x11a')](db['User'],{'as':_0x6d50('0x181'),'foreignKey':'OwnerId'});db[_0x6d50('0x199')][_0x6d50('0x11a')](db['CmContact'],{'as':'Contact','foreignKey':_0x6d50('0x15b'),'onDelete':_0x6d50('0x143')});db['CmHopperBlack'][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':'List','foreignKey':_0x6d50('0x165'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0x199')][_0x6d50('0x11a')](db['VoiceQueue'],{'as':_0x6d50('0x18c'),'foreignKey':_0x6d50('0x148'),'onDelete':'cascade'});db['CmHopperBlack'][_0x6d50('0x11a')](db[_0x6d50('0xe9')],{'as':_0x6d50('0xe9'),'foreignKey':_0x6d50('0x198'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0x77')][_0x6d50('0x10e')](db[_0x6d50('0x19a')],{'as':{'plural':_0x6d50('0x19b'),'singular':_0x6d50('0x19c')},'foreignKey':_0x6d50('0x19d'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x6d50('0x10e')](db[_0x6d50('0x19a')],{'as':{'plural':_0x6d50('0x19e'),'singular':_0x6d50('0x19f')},'foreignKey':_0x6d50('0x1a0'),'onDelete':'cascade','hooks':!![]});db[_0x6d50('0x77')][_0x6d50('0x10e')](db[_0x6d50('0x76')],{'as':_0x6d50('0x1a1'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x6d50('0x7a')][_0x6d50('0x10e')](db['Disposition'],{'as':_0x6d50('0x161'),'foreignKey':_0x6d50('0x1a2'),'onDelete':_0x6d50('0x143')});db['Interval'][_0x6d50('0x10e')](db['Interval'],{'as':'Intervals','foreignKey':_0x6d50('0x14d'),'onDelete':_0x6d50('0x143'),'hooks':!![],'required':![]});db[_0x6d50('0x7d')][_0x6d50('0x10e')](db[_0x6d50('0x145')],{'as':_0x6d50('0x110'),'foreignKey':_0x6d50('0x14d'),'onDelete':_0x6d50('0x172')});db[_0x6d50('0x7d')]['hasMany'](db[_0x6d50('0x3c')],{'as':_0x6d50('0x1a3'),'foreignKey':_0x6d50('0x14d')});db[_0x6d50('0x7d')]['hasMany'](db[_0x6d50('0x5c')],{'as':_0x6d50('0x1a4'),'foreignKey':_0x6d50('0x14d')});db['Interval'][_0x6d50('0x10e')](db[_0x6d50('0x42')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0x6d50('0x7d')][_0x6d50('0x10e')](db[_0x6d50('0x17f')],{'as':_0x6d50('0x1a5'),'foreignKey':'IntervalId'});db[_0x6d50('0x84')]['belongsTo'](db['MailAccount'],{});db[_0x6d50('0x84')]['belongsTo'](db[_0x6d50('0x93')],{'foreignKey':_0x6d50('0x1a6')});db[_0x6d50('0x84')]['belongsTo'](db[_0x6d50('0x92')],{'foreignKey':_0x6d50('0x1a7')});db['Sound'][_0x6d50('0x11c')](db[_0x6d50('0x13')],{'as':_0x6d50('0x1a8'),'through':_0x6d50('0x1a9'),'onDelete':'restrict'});db[_0x6d50('0x169')][_0x6d50('0x11c')](db[_0x6d50('0x6a')],{'through':_0x6d50('0x197')});db[_0x6d50('0x169')][_0x6d50('0x11c')](db[_0x6d50('0x5e')],{'through':_0x6d50('0x18f')});db[_0x6d50('0x169')][_0x6d50('0x11c')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag'][_0x6d50('0x11c')](db[_0x6d50('0x49')],{'through':_0x6d50('0x182')});db['Tag'][_0x6d50('0x11c')](db[_0x6d50('0x115')],{'through':_0x6d50('0x178')});db['Tag'][_0x6d50('0x11c')](db[_0x6d50('0x52')],{'through':_0x6d50('0x188')});db[_0x6d50('0x169')][_0x6d50('0x11c')](db[_0x6d50('0xfd')],{'through':_0x6d50('0x1aa')});db[_0x6d50('0x8b')][_0x6d50('0x10e')](db[_0x6d50('0x19a')],{'as':{'plural':_0x6d50('0x1ab'),'singular':_0x6d50('0x1ac')},'foreignKey':_0x6d50('0x1ad'),'onDelete':_0x6d50('0x143'),'hooks':!![]});db[_0x6d50('0x8b')]['hasMany'](db[_0x6d50('0x19a')],{'as':{'plural':_0x6d50('0x1ae'),'singular':_0x6d50('0x1af')},'foreignKey':_0x6d50('0x1b0'),'onDelete':_0x6d50('0x143'),'hooks':!![]});db[_0x6d50('0x8b')]['hasMany'](db[_0x6d50('0x76')],{'as':_0x6d50('0x1a1'),'foreignKey':_0x6d50('0x1b1'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x6d50('0x97')],{'as':_0x6d50('0x1b2'),'onDelete':_0x6d50('0x143'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x6d50('0x93')][_0x6d50('0x10e')](db[_0x6d50('0x97')],{'as':'Fields','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1a6')});db[_0x6d50('0x1b3')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x6d50('0x1b2'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b4')});db[_0x6d50('0x97')][_0x6d50('0x11a')](db[_0x6d50('0x1b3')],{'foreignKey':'MetricId'});db[_0x6d50('0x9b')][_0x6d50('0x10e')](db[_0x6d50('0x1b5')],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0x6d50('0x9e')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x6d50('0x1b5')][_0x6d50('0x10e')](db[_0x6d50('0x9e')],{'as':_0x6d50('0x1b7'),'onDelete':'cascade','foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0x1b5')][_0x6d50('0x10e')](db['SalesforceField'],{'as':_0x6d50('0x1b2'),'onDelete':'cascade','foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0x1b5')][_0x6d50('0x11a')](db[_0x6d50('0x9b')],{'as':_0x6d50('0x168'),'foreignKey':'AccountId'});db['SalesforceField'][_0x6d50('0x10e')](db[_0x6d50('0x9e')],{'as':_0x6d50('0x1ba'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0x6d50('0x1b8')});db['SalesforceField'][_0x6d50('0x10e')](db[_0x6d50('0x9e')],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0x9e')]['belongsTo'](db['Variable'],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0x9f')][_0x6d50('0x10e')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0x6d50('0x1bf'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1bb')});db['SugarcrmConfiguration'][_0x6d50('0x10e')](db[_0x6d50('0xa2')],{'as':'Descriptions','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b8')});db['SugarcrmConfiguration'][_0x6d50('0x10e')](db[_0x6d50('0xa2')],{'as':_0x6d50('0x1b2'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xa1')][_0x6d50('0x11a')](db['SugarcrmAccount'],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x1be')});db['SugarcrmField'][_0x6d50('0x10e')](db['SugarcrmField'],{'as':_0x6d50('0x1ba'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xa2')][_0x6d50('0x10e')](db[_0x6d50('0xa2')],{'as':_0x6d50('0x1c0'),'foreignKey':'DescriptionId'});db[_0x6d50('0xa2')][_0x6d50('0x10e')](db[_0x6d50('0xa2')],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xa2')]['belongsTo'](db[_0x6d50('0x8d')],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xa4')][_0x6d50('0x10e')](db['DeskConfiguration'],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db['DeskConfiguration']['hasMany'](db[_0x6d50('0xa8')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x6d50('0xa6')][_0x6d50('0x10e')](db['DeskField'],{'as':'Descriptions','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xa6')][_0x6d50('0x10e')](db[_0x6d50('0xa8')],{'as':_0x6d50('0x1b2'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xa6')][_0x6d50('0x11a')](db[_0x6d50('0xa4')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xa6')]['belongsToMany'](db[_0x6d50('0x169')],{'through':_0x6d50('0x1c1')});db[_0x6d50('0xa8')][_0x6d50('0x10e')](db[_0x6d50('0xa8')],{'as':_0x6d50('0x1ba'),'foreignKey':_0x6d50('0x1bb')});db['DeskField'][_0x6d50('0x10e')](db[_0x6d50('0xa8')],{'as':_0x6d50('0x1c0'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xa8')][_0x6d50('0x10e')](db[_0x6d50('0xa8')],{'as':'Field','foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xa8')][_0x6d50('0x11a')](db[_0x6d50('0x8d')],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xaa')][_0x6d50('0x10e')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xac')][_0x6d50('0x10e')](db[_0x6d50('0xae')],{'as':_0x6d50('0x1bf'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xac')][_0x6d50('0x10e')](db['ZohoField'],{'as':_0x6d50('0x1b7'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xac')]['hasMany'](db[_0x6d50('0xae')],{'as':'Fields','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xac')]['belongsTo'](db[_0x6d50('0xaa')],{'as':_0x6d50('0x168'),'foreignKey':'AccountId'});db['ZohoField'][_0x6d50('0x10e')](db[_0x6d50('0xae')],{'as':_0x6d50('0x1ba'),'foreignKey':'SubjectId'});db[_0x6d50('0xae')][_0x6d50('0x10e')](db[_0x6d50('0xae')],{'as':_0x6d50('0x1c0'),'foreignKey':_0x6d50('0x1b8')});db['ZohoField'][_0x6d50('0x10e')](db[_0x6d50('0xae')],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xae')]['belongsTo'](db[_0x6d50('0x8d')],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xb0')][_0x6d50('0x10e')](db[_0x6d50('0xb2')],{'as':_0x6d50('0x1b6'),'onDelete':'cascade','foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xb2')]['hasMany'](db[_0x6d50('0xb4')],{'as':_0x6d50('0x1bf'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xb2')][_0x6d50('0x10e')](db[_0x6d50('0xb4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0x6d50('0x1b2'),'foreignKey':'FieldId'});db[_0x6d50('0xb2')]['belongsTo'](db[_0x6d50('0xb0')],{'as':'Account','foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xb2')]['belongsToMany'](db[_0x6d50('0x169')],{'through':_0x6d50('0x1c2')});db[_0x6d50('0xb4')][_0x6d50('0x10e')](db[_0x6d50('0xb4')],{'as':_0x6d50('0x1ba'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xb4')][_0x6d50('0x10e')](db['ZendeskField'],{'as':'Description','foreignKey':_0x6d50('0x1b8')});db['ZendeskField'][_0x6d50('0x10e')](db[_0x6d50('0xb4')],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xb4')]['belongsTo'](db[_0x6d50('0x8d')],{'as':'Variable','foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xb6')][_0x6d50('0x10e')](db['FreshdeskConfiguration'],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xb8')][_0x6d50('0x10e')](db[_0x6d50('0xba')],{'as':_0x6d50('0x1bf'),'onDelete':_0x6d50('0x143'),'foreignKey':'SubjectId'});db[_0x6d50('0xb8')][_0x6d50('0x10e')](db['FreshdeskField'],{'as':_0x6d50('0x1b7'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xb8')][_0x6d50('0x10e')](db[_0x6d50('0xba')],{'as':_0x6d50('0x1b2'),'onDelete':'cascade','foreignKey':_0x6d50('0x1b9')});db['FreshdeskConfiguration'][_0x6d50('0x11a')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xb8')]['belongsToMany'](db[_0x6d50('0x169')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x6d50('0xba')]['hasMany'](db[_0x6d50('0xba')],{'as':_0x6d50('0x1ba'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0x6d50('0xba')],{'as':_0x6d50('0x1c0'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xba')][_0x6d50('0x10e')](db[_0x6d50('0xba')],{'as':_0x6d50('0x1bc'),'foreignKey':'FieldId'});db[_0x6d50('0xba')][_0x6d50('0x11a')](db[_0x6d50('0x8d')],{'as':'Variable','foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xbb')][_0x6d50('0x10e')](db[_0x6d50('0xbd')],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xbd')]['hasMany'](db[_0x6d50('0xbf')],{'as':_0x6d50('0x1bf'),'foreignKey':'SubjectId'});db[_0x6d50('0xbd')]['hasMany'](db[_0x6d50('0xbf')],{'as':_0x6d50('0x1b7'),'foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0xbd')][_0x6d50('0x10e')](db[_0x6d50('0xbf')],{'as':_0x6d50('0x1b2'),'foreignKey':'FieldId'});db[_0x6d50('0xbd')][_0x6d50('0x11a')](db[_0x6d50('0xbb')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xbf')][_0x6d50('0x10e')](db[_0x6d50('0xbf')],{'as':'Subject','foreignKey':'SubjectId'});db['VtigerField'][_0x6d50('0x10e')](db[_0x6d50('0xbf')],{'as':_0x6d50('0x1c0'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x6d50('0x10e')](db['VtigerField'],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xbf')]['belongsTo'](db['Variable'],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0xc1')][_0x6d50('0x10e')](db[_0x6d50('0xc3')],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xc3')]['hasMany'](db[_0x6d50('0xc5')],{'as':_0x6d50('0x1bf'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xc3')][_0x6d50('0x10e')](db[_0x6d50('0xc5')],{'as':'Descriptions','foreignKey':_0x6d50('0x1b8')});db['ServicenowConfiguration'][_0x6d50('0x10e')](db[_0x6d50('0xc5')],{'as':'Fields','foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xc3')][_0x6d50('0x11a')](db[_0x6d50('0xc1')],{'as':_0x6d50('0x168'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xc5')][_0x6d50('0x10e')](db[_0x6d50('0xc5')],{'as':'Subject','foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xc5')]['hasMany'](db[_0x6d50('0xc5')],{'as':_0x6d50('0x1c0'),'foreignKey':'DescriptionId'});db[_0x6d50('0xc5')][_0x6d50('0x10e')](db[_0x6d50('0xc5')],{'as':_0x6d50('0x1bc'),'foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xc5')][_0x6d50('0x11a')](db[_0x6d50('0x8d')],{'as':'Variable','foreignKey':_0x6d50('0x1bd')});db[_0x6d50('0x1c3')]['hasMany'](db[_0x6d50('0xc8')],{'as':'Configurations','onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1be')});db[_0x6d50('0xc8')][_0x6d50('0x10e')](db[_0x6d50('0xca')],{'as':_0x6d50('0x1bf'),'onDelete':_0x6d50('0x143'),'foreignKey':'SubjectId'});db[_0x6d50('0xc8')]['hasMany'](db['Dynamics365Field'],{'as':_0x6d50('0x1b7'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x6d50('0xc8')][_0x6d50('0x10e')](db['Dynamics365Field'],{'as':_0x6d50('0x1b2'),'onDelete':_0x6d50('0x143'),'foreignKey':'FieldId'});db[_0x6d50('0xc8')][_0x6d50('0x11a')](db['Dynamics365Account'],{'as':_0x6d50('0x168'),'foreignKey':'AccountId'});db[_0x6d50('0xca')][_0x6d50('0x10e')](db[_0x6d50('0xca')],{'as':_0x6d50('0x1ba'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xca')][_0x6d50('0x10e')](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x6d50('0x1b8')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xca')][_0x6d50('0x11a')](db[_0x6d50('0x8d')],{'as':_0x6d50('0x8d'),'foreignKey':'VariableId'});db[_0x6d50('0xcc')][_0x6d50('0x10e')](db[_0x6d50('0xce')],{'as':_0x6d50('0x1b6'),'onDelete':_0x6d50('0x143'),'foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x6d50('0x1bf'),'foreignKey':_0x6d50('0x1bb')});db[_0x6d50('0xce')][_0x6d50('0x10e')](db[_0x6d50('0x1c4')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x6d50('0x10e')](db[_0x6d50('0x1c4')],{'as':'Fields','foreignKey':_0x6d50('0x1b9')});db[_0x6d50('0xce')]['belongsTo'](db[_0x6d50('0xcc')],{'as':'Account','foreignKey':'AccountId'});db[_0x6d50('0x1c4')][_0x6d50('0x10e')](db['FreshsalesField'],{'as':_0x6d50('0x1ba'),'foreignKey':'SubjectId'});db[_0x6d50('0x1c4')]['hasMany'](db[_0x6d50('0x1c4')],{'as':'Description','foreignKey':_0x6d50('0x1b8')});db[_0x6d50('0x1c4')]['hasMany'](db[_0x6d50('0x1c4')],{'as':_0x6d50('0x1bc'),'foreignKey':'FieldId'});db[_0x6d50('0x1c4')][_0x6d50('0x11a')](db['Variable'],{'as':_0x6d50('0x8d'),'foreignKey':_0x6d50('0x1bd')});db['ChatQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x58')],{});db['ChatQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x174'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x1c5')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':'Contact','foreignKey':_0x6d50('0x15b')});db['ChatQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0x5e')],{});db['ChatQueueReport']['belongsTo'](db[_0x6d50('0x60')],{});db[_0x6d50('0x1c5')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{});db[_0x6d50('0x1c5')]['belongsTo'](db[_0x6d50('0x64')],{});db[_0x6d50('0xd3')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1c6')});db[_0x6d50('0xd3')][_0x6d50('0x11a')](db['User'],{'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x1c7')});db['JscriptySessionReport'][_0x6d50('0x10e')](db[_0x6d50('0x1c8')],{'foreignKey':'SessionId','onDelete':_0x6d50('0x143')});db[_0x6d50('0xd7')][_0x6d50('0x10e')](db[_0x6d50('0x1c9')],{'foreignKey':_0x6d50('0x1ca'),'onDelete':'cascade'});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db['CmList'],{'as':_0x6d50('0x174'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':'ContactId'});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db['SmsInteraction'],{});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db[_0x6d50('0x4b')],{});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db['User'],{});db[_0x6d50('0xd9')][_0x6d50('0x11a')](db[_0x6d50('0x4d')],{});db[_0x6d50('0x1cb')][_0x6d50('0x10e')](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x6d50('0x1cb')][_0x6d50('0x10e')](db['JscriptyQuestionReport'],{'foreignKey':_0x6d50('0x1cc')});db[_0x6d50('0x1cb')][_0x6d50('0x10e')](db['JscriptyAnswerReport'],{'foreignKey':_0x6d50('0x1cc')});db[_0x6d50('0xe3')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x179'),'through':'user_has_square_projects'});db['Team'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':'Agents','through':'user_has_teams'});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x15')],{'through':_0x6d50('0x109'),'as':'VoiceQueues'});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x12c')],{'through':_0x6d50('0x166'),'as':_0x6d50('0x12d')});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x64')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x45')],{'through':_0x6d50('0x17c'),'as':_0x6d50('0x12f')});db[_0x6d50('0x122')][_0x6d50('0x11c')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x6d50('0x1cd')});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x56')],{'through':'team_has_openchannel_queues','as':_0x6d50('0x130')});db[_0x6d50('0x122')][_0x6d50('0x11c')](db[_0x6d50('0x103')],{'through':_0x6d50('0x1ce'),'as':_0x6d50('0x131')});db[_0x6d50('0xe9')][_0x6d50('0x10e')](db[_0x6d50('0x6c')],{'as':_0x6d50('0x192'),'foreignKey':_0x6d50('0x198')});db[_0x6d50('0xe9')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x6d50('0x198')});db[_0x6d50('0xe9')][_0x6d50('0x10e')](db[_0x6d50('0x112')],{'as':_0x6d50('0x149'),'foreignKey':_0x6d50('0x198')});db['Campaign'][_0x6d50('0x10e')](db[_0x6d50('0x199')],{'as':_0x6d50('0x1cf'),'foreignKey':_0x6d50('0x198')});db[_0x6d50('0xe9')][_0x6d50('0x11a')](db['Trunk'],{'as':_0x6d50('0x22'),'foreignKey':'TrunkId'});db['Campaign']['belongsTo'](db[_0x6d50('0x22')],{'as':_0x6d50('0x14b'),'foreignKey':_0x6d50('0x14c')});db['Campaign'][_0x6d50('0x11a')](db[_0x6d50('0x7d')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x6d50('0xe9')][_0x6d50('0x11a')](db[_0x6d50('0xe3')],{'as':_0x6d50('0xe3'),'foreignKey':_0x6d50('0x1d0')});db['Campaign'][_0x6d50('0x11c')](db[_0x6d50('0x11f')],{'as':'Lists','through':_0x6d50('0x1d1')});db[_0x6d50('0xe9')][_0x6d50('0x11c')](db[_0x6d50('0x11f')],{'as':_0x6d50('0x152'),'through':_0x6d50('0x1d2')});db['Attachment'][_0x6d50('0x11a')](db[_0x6d50('0x62')],{'as':'ChatOfflineMessage','foreignKey':_0x6d50('0x171')});db[_0x6d50('0xed')][_0x6d50('0x11a')](db[_0x6d50('0x163')],{});db[_0x6d50('0xed')][_0x6d50('0x11a')](db['MailInteraction'],{});db['MailTransferReport'][_0x6d50('0x11a')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x6d50('0x1d3')});db[_0x6d50('0xed')]['belongsTo'](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1d4'),'as':_0x6d50('0x1d5')});db[_0x6d50('0xed')][_0x6d50('0x11a')](db['User'],{'foreignKey':'ToUserId','as':_0x6d50('0x1d6')});db[_0x6d50('0xed')][_0x6d50('0x11a')](db[_0x6d50('0x12c')],{'foreignKey':_0x6d50('0x1d7'),'as':_0x6d50('0x1d8')});db[_0x6d50('0xed')][_0x6d50('0x11a')](db[_0x6d50('0x15c')],{'foreignKey':'ToMailAccountId','as':_0x6d50('0x1d9')});db['ChatTransferReport']['belongsTo'](db[_0x6d50('0x60')],{});db[_0x6d50('0xee')][_0x6d50('0x11a')](db[_0x6d50('0x5e')],{});db[_0x6d50('0xee')][_0x6d50('0x11a')](db[_0x6d50('0x58')],{'foreignKey':_0x6d50('0x1da'),'as':'FromAccount'});db[_0x6d50('0xee')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1d4'),'as':_0x6d50('0x1d5')});db['ChatTransferReport'][_0x6d50('0x11a')](db['User'],{'foreignKey':_0x6d50('0x1db'),'as':_0x6d50('0x1d6')});db[_0x6d50('0xee')][_0x6d50('0x11a')](db[_0x6d50('0x64')],{'foreignKey':_0x6d50('0x1dc'),'as':_0x6d50('0x1d8')});db[_0x6d50('0xee')][_0x6d50('0x11a')](db['ChatWebsite'],{'foreignKey':_0x6d50('0x1dd'),'as':'ToAccount'});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db['FaxMessage'],{});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db['FaxInteraction'],{});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db[_0x6d50('0x134')],{'foreignKey':_0x6d50('0x1de'),'as':_0x6d50('0x1d3')});db[_0x6d50('0xf0')]['belongsTo'](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1d4'),'as':_0x6d50('0x1d5')});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1db'),'as':'ToAgent'});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db[_0x6d50('0x45')],{'foreignKey':_0x6d50('0x1df'),'as':_0x6d50('0x1d8')});db[_0x6d50('0xf0')][_0x6d50('0x11a')](db[_0x6d50('0x134')],{'foreignKey':'ToFaxAccountId','as':_0x6d50('0x1d9')});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db['OpenchannelMessage'],{});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db[_0x6d50('0x52')],{});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db['OpenchannelAccount'],{'foreignKey':_0x6d50('0x1e0'),'as':_0x6d50('0x1d3')});db[_0x6d50('0xf2')]['belongsTo'](db[_0x6d50('0x10b')],{'foreignKey':'FromUserId','as':_0x6d50('0x1d5')});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':'ToUserId','as':_0x6d50('0x1d6')});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db[_0x6d50('0x56')],{'foreignKey':_0x6d50('0x1e1'),'as':'ToQueue'});db[_0x6d50('0xf2')][_0x6d50('0x11a')](db[_0x6d50('0x4e')],{'foreignKey':'ToOpenchannelAccountId','as':_0x6d50('0x1d9')});db[_0x6d50('0xf3')][_0x6d50('0x11a')](db[_0x6d50('0x4b')],{});db[_0x6d50('0xf3')]['belongsTo'](db[_0x6d50('0x49')],{});db['SmsTransferReport'][_0x6d50('0x11a')](db[_0x6d50('0x13b')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x6d50('0xf3')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1d4'),'as':'FromAgent'});db[_0x6d50('0xf3')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1db'),'as':_0x6d50('0x1d6')});db['SmsTransferReport'][_0x6d50('0x11a')](db['SmsQueue'],{'foreignKey':_0x6d50('0x1e2'),'as':_0x6d50('0x1d8')});db[_0x6d50('0xf3')][_0x6d50('0x11a')](db[_0x6d50('0x13b')],{'foreignKey':_0x6d50('0x1e3'),'as':'ToAccount'});db['CmList'][_0x6d50('0x10e')](db[_0x6d50('0x7a')],{'as':_0x6d50('0x161'),'foreignKey':_0x6d50('0x165')});db['CmList'][_0x6d50('0x10e')](db['CmCustomField'],{'as':_0x6d50('0x1e4'),'foreignKey':'ListId'});db[_0x6d50('0x11f')][_0x6d50('0x10e')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x11d'),'onDelete':_0x6d50('0x143'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x11f')][_0x6d50('0x10e')](db[_0x6d50('0x6f')],{'as':_0x6d50('0x111'),'foreignKey':_0x6d50('0x165')});db[_0x6d50('0x11f')][_0x6d50('0x10e')](db[_0x6d50('0x112')],{'as':'HopperHistory','foreignKey':_0x6d50('0x165')});db[_0x6d50('0x11f')][_0x6d50('0x10e')](db['ReportAgentPreview'],{'as':_0x6d50('0x72'),'foreignKey':'ListId'});db[_0x6d50('0x11f')]['belongsToMany'](db[_0x6d50('0x15')],{'as':_0x6d50('0x1e5'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db['User'],{'as':_0x6d50('0x150'),'through':_0x6d50('0x121')});db['VoicePrefix'][_0x6d50('0x10e')](db[_0x6d50('0x145')],{'as':_0x6d50('0x110'),'onDelete':_0x6d50('0x143')});db['VoicePrefix'][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':'user_has_voice_prefixes'});db[_0x6d50('0xf6')]['hasMany'](db[_0x6d50('0x10b')],{'as':'Users','foreignKey':_0x6d50('0x11b')});db[_0x6d50('0xf6')][_0x6d50('0x10e')](db[_0x6d50('0xf7')],{'as':_0x6d50('0x1e6'),'foreignKey':_0x6d50('0x11b'),'onDelete':_0x6d50('0x143')});db[_0x6d50('0xf7')][_0x6d50('0x10e')](db[_0x6d50('0xf9')],{'as':_0x6d50('0x1e7'),'foreignKey':'sectionId','onDelete':_0x6d50('0x143')});db[_0x6d50('0xfa')][_0x6d50('0x10e')](db['Disposition'],{'as':_0x6d50('0x161'),'foreignKey':'WhatsappAccountId'});db[_0x6d50('0xfa')]['hasMany'](db['CannedAnswer'],{'as':_0x6d50('0x162'),'foreignKey':_0x6d50('0x1e8')});db[_0x6d50('0xfa')][_0x6d50('0x10e')](db[_0x6d50('0xfe')],{'as':_0x6d50('0x153'),'foreignKey':_0x6d50('0x1e8')});db['WhatsappAccount']['hasMany'](db['WhatsappInteraction'],{'as':_0x6d50('0x164')});db[_0x6d50('0xfa')][_0x6d50('0x10e')](db[_0x6d50('0xfb')],{'as':_0x6d50('0x146')});db[_0x6d50('0xfa')][_0x6d50('0x11a')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['WhatsappAccount'][_0x6d50('0x11a')](db['Pause'],{'as':_0x6d50('0x14e'),'foreignKey':_0x6d50('0x14f')});db[_0x6d50('0xfa')][_0x6d50('0x11c')](db['User'],{'as':_0x6d50('0x150'),'through':_0x6d50('0x13f')});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':_0x6d50('0x172')});db[_0x6d50('0xfb')]['belongsTo'](db[_0x6d50('0x103')],{'onDelete':_0x6d50('0x172')});db['WhatsappApplication'][_0x6d50('0x11a')](db[_0x6d50('0xfa')],{'onDelete':'restrict'});db[_0x6d50('0xfb')][_0x6d50('0x11a')](db[_0x6d50('0x7d')],{'onDelete':_0x6d50('0x172'),'foreignKey':_0x6d50('0x14d')});db[_0x6d50('0xfb')][_0x6d50('0x11a')](db[_0x6d50('0x169')],{'onDelete':_0x6d50('0x172'),'foreignKey':'TagId'});db[_0x6d50('0xfd')][_0x6d50('0x10e')](db[_0x6d50('0xfe')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x6d50('0x1e9')});db[_0x6d50('0xfd')]['belongsTo'](db['WhatsappAccount'],{'as':_0x6d50('0x168'),'foreignKey':'WhatsappAccountId'});db[_0x6d50('0xfd')][_0x6d50('0x11a')](db[_0x6d50('0x6a')],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db['WhatsappInteraction'][_0x6d50('0x11a')](db['User'],{'as':'Owner','foreignKey':_0x6d50('0x10d')});db[_0x6d50('0xfd')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x6d50('0xfd')][_0x6d50('0x11c')](db[_0x6d50('0x169')],{'through':_0x6d50('0x1aa'),'as':_0x6d50('0x16c')});db[_0x6d50('0xfd')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x179'),'through':_0x6d50('0x12a'),'foreignKey':'WhatsappInteractionId'});db[_0x6d50('0xfe')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x10b')});db[_0x6d50('0xfe')]['belongsTo'](db['CmContact'],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x15a')});db['WhatsappMessage'][_0x6d50('0x11a')](db[_0x6d50('0xfd')],{'onDelete':_0x6d50('0x143'),'as':_0x6d50('0x16f'),'foreignKey':_0x6d50('0x1e9')});db[_0x6d50('0xfe')][_0x6d50('0x11a')](db[_0x6d50('0xfa')],{'as':_0x6d50('0x168'),'foreignKey':'WhatsappAccountId'});db[_0x6d50('0x100')]['belongsTo'](db['WhatsappAccount'],{});db[_0x6d50('0x100')][_0x6d50('0x11a')](db[_0x6d50('0x11f')],{'as':'List','foreignKey':'ListId'});db[_0x6d50('0x100')]['belongsTo'](db['CmContact'],{'as':_0x6d50('0x15a'),'foreignKey':_0x6d50('0x15b')});db['WhatsappQueueReport'][_0x6d50('0x11a')](db[_0x6d50('0xfd')],{});db[_0x6d50('0x100')][_0x6d50('0x11a')](db[_0x6d50('0x103')],{});db[_0x6d50('0x100')]['belongsTo'](db[_0x6d50('0xfe')],{});db[_0x6d50('0x100')][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{});db[_0x6d50('0x101')][_0x6d50('0x11a')](db['WhatsappMessage'],{});db[_0x6d50('0x101')]['belongsTo'](db[_0x6d50('0xfd')],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':_0x6d50('0x1d3')});db[_0x6d50('0x101')][_0x6d50('0x11a')](db[_0x6d50('0xfa')],{'foreignKey':_0x6d50('0x1ea'),'as':'ToAccount'});db[_0x6d50('0x101')][_0x6d50('0x11a')](db[_0x6d50('0x103')],{'foreignKey':_0x6d50('0x1eb'),'as':_0x6d50('0x1d8')});db[_0x6d50('0x101')]['belongsTo'](db['User'],{'foreignKey':_0x6d50('0x1d4'),'as':_0x6d50('0x1d5')});db['WhatsappTransferReport'][_0x6d50('0x11a')](db[_0x6d50('0x10b')],{'foreignKey':_0x6d50('0x1db'),'as':_0x6d50('0x1d6')});db[_0x6d50('0x103')][_0x6d50('0x11c')](db[_0x6d50('0x10b')],{'as':_0x6d50('0x150'),'through':_0x6d50('0x32'),'foreignKey':_0x6d50('0x1ec')});db[_0x6d50('0x103')][_0x6d50('0x11c')](db[_0x6d50('0x122')],{'through':_0x6d50('0x1ce'),'as':_0x6d50('0x151')});module[_0x6d50('0x1ed')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x7d14=['OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','chat_group_has_users','ChatProactiveAction','JscriptySessions','Company','CompanyId','cm_contact_has_tags','OwnerId','CampaignId','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','Configurations','SubjectId','DescriptionId','FieldId','AccountId','Subject','Field','Descriptions','Description','VariableId','DeskConfiguration','Subjects','DeskField','ZohoConfiguration','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Field','ChatQueueReport','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','team_has_sms_queues','TrunkId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromUserId','ToFaxAccountId','FromOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','user_has_voice_prefixes','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','path','../config/environment','lodash','jstz','determine','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','utf8','sequelizeHistory','defaultsDeep','mysql','utf8mb4','name','utf8_general_ci','username','password','options','database','User','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','Realtime','../api/realtime/realtime.model','../api/teamVoiceQueue/teamVoiceQueue.model','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','HopperHistory','ChatInteractions','SmsInteractions','MailInteractions','WhatsappInteraction','UserNotifications','SenderId','belongsTo','userProfileId','Groups','belongsToMany','CmContact','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','hasOne','Imap','Dispositions','Answers','Interactions','ListId','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Tag','Users','Attachments','Interaction','ChatWebsiteId','restrict','TagId','List','Dashboard','Items','FaxAccountId','FaxApplication','FaxInteractionId','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','IntervalId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts'];(function(_0x278949,_0x3502cc){var _0x273699=function(_0x19114f){while(--_0x19114f){_0x278949['push'](_0x278949['shift']());}};_0x273699(++_0x3502cc);}(_0x7d14,0x6d));var _0x47d1=function(_0x4c8489,_0x190092){_0x4c8489=_0x4c8489-0x0;var _0x58a6d6=_0x7d14[_0x4c8489];return _0x58a6d6;};'use strict';var path=require(_0x47d1('0x0'));var config=require(_0x47d1('0x1'));var Sequelize=require('sequelize');var _=require(_0x47d1('0x2'));var jstz=require(_0x47d1('0x3'));var timezone=jstz[_0x47d1('0x4')]();config[_0x47d1('0x5')]=_['defaultsDeep'](config[_0x47d1('0x5')],{'database':_0x47d1('0x6'),'username':_0x47d1('0x7'),'password':_0x47d1('0x8'),'options':{'host':_0x47d1('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x47d1('0xa'),'collate':'utf8_general_ci'}}});config[_0x47d1('0xb')]=_[_0x47d1('0xc')](config[_0x47d1('0xb')],{'database':_0x47d1('0x6'),'username':_0x47d1('0x7'),'password':_0x47d1('0x8'),'options':{'host':_0x47d1('0x9'),'port':0xcea,'dialect':_0x47d1('0xd'),'dialectOptions':{'charset':_0x47d1('0xe')},'logging':![],'timezone':timezone[_0x47d1('0xf')](),'define':{'charset':_0x47d1('0xa'),'collate':_0x47d1('0x10')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x47d1('0x5')]['database'],config[_0x47d1('0x5')][_0x47d1('0x11')],config[_0x47d1('0x5')][_0x47d1('0x12')],config[_0x47d1('0x5')][_0x47d1('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x47d1('0xb')][_0x47d1('0x14')],config[_0x47d1('0xb')][_0x47d1('0x11')],config[_0x47d1('0xb')][_0x47d1('0x12')],config[_0x47d1('0xb')][_0x47d1('0x13')])};db[_0x47d1('0x15')]=db[_0x47d1('0x5')]['import']('../api/user/user.model');db[_0x47d1('0x16')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x17'));db['VoiceContext']=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x19'));db[_0x47d1('0x1a')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x1b'));db['VoiceMusicOnHold']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x1c'));db['VoiceQueue']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x1d'));db[_0x47d1('0x1e')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x1f'));db[_0x47d1('0x20')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x21'));db[_0x47d1('0x22')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x23'));db[_0x47d1('0x24')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x47d1('0x25')]=db['sequelize']['import'](_0x47d1('0x26'));db[_0x47d1('0x27')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x28'));db[_0x47d1('0x29')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x47d1('0x2a')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x2b'));db[_0x47d1('0x2c')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x2d'));db[_0x47d1('0x2e')]=db[_0x47d1('0x5')]['import']('../api/trunk/trunk.model');db[_0x47d1('0x2f')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x47d1('0x30')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x31'));db[_0x47d1('0x32')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x33'));db[_0x47d1('0x34')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x35'));db[_0x47d1('0x36')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x37'));db['UserFaxQueue']=db['sequelize']['import'](_0x47d1('0x38'));db[_0x47d1('0x39')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/userSmsQueue/userSmsQueue.model');db[_0x47d1('0x3a')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x3b'));db['UserWhatsappQueue']=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x47d1('0x3c')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x3d'));db[_0x47d1('0x3e')]=db['sequelize'][_0x47d1('0x18')]('../api/mailServerOut/mailServerOut.model');db[_0x47d1('0x3f')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x40'));db[_0x47d1('0x41')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x42'));db[_0x47d1('0x43')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x44'));db[_0x47d1('0x45')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x46'));db[_0x47d1('0x47')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x48'));db[_0x47d1('0x49')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x4a'));db[_0x47d1('0x4b')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x4c'));db['Dashboard']=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x4d'));db[_0x47d1('0x4e')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x4f'));db[_0x47d1('0x50')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x51'));db['FaxApplication']=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x52'));db[_0x47d1('0x53')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x54'));db[_0x47d1('0x55')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x56'));db[_0x47d1('0x57')]=db[_0x47d1('0x5')]['import']('../api/faxQueue/faxQueue.model');db[_0x47d1('0x58')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x59'));db['SmsAccount']=db[_0x47d1('0x5')]['import']('../api/smsAccount/smsAccount.model');db[_0x47d1('0x5a')]=db['sequelize']['import']('../api/smsApplication/smsApplication.model');db[_0x47d1('0x5b')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x5c'));db[_0x47d1('0x5d')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x5e'));db[_0x47d1('0x5f')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x60'));db[_0x47d1('0x61')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x62'));db['OpenchannelApplication']=db[_0x47d1('0x5')]['import'](_0x47d1('0x63'));db[_0x47d1('0x64')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x47d1('0x65')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x66'));db[_0x47d1('0x67')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x68'));db[_0x47d1('0x69')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x6a'));db[_0x47d1('0x6b')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x6c'));db[_0x47d1('0x6d')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/chatApplication/chatApplication.model');db[_0x47d1('0x6e')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/chatInteraction/chatInteraction.model');db[_0x47d1('0x6f')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/chatMessage/chatMessage.model');db[_0x47d1('0x70')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x71'));db[_0x47d1('0x72')]=db['sequelize']['import'](_0x47d1('0x73'));db[_0x47d1('0x74')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x75'));db[_0x47d1('0x76')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x77'));db[_0x47d1('0x78')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x79'));db[_0x47d1('0x7a')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x47d1('0x7b')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x7c'));db[_0x47d1('0x7d')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x7e'));db[_0x47d1('0x7f')]=db['sequelize']['import'](_0x47d1('0x80'));db[_0x47d1('0x81')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x82'));db[_0x47d1('0x83')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x84'));db[_0x47d1('0x85')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x86'));db[_0x47d1('0x87')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x88'));db[_0x47d1('0x89')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/disposition/disposition.model');db[_0x47d1('0x8a')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/condition/condition.model');db[_0x47d1('0x8b')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x8c'));db[_0x47d1('0x8d')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x8e'));db[_0x47d1('0x8f')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/cdr/cdr.model');db[_0x47d1('0x90')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x91'));db[_0x47d1('0x92')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x93'));db[_0x47d1('0x94')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x95'));db['Tag']=db['sequelize']['import'](_0x47d1('0x96'));db[_0x47d1('0x97')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/template/template.model');db[_0x47d1('0x98')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x99'));db[_0x47d1('0x9a')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x9b'));db[_0x47d1('0x9c')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x9d'));db[_0x47d1('0x9e')]=db[_0x47d1('0x5')]['import'](_0x47d1('0x9f'));db['AnalyticCustomReport']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xa0'));db[_0x47d1('0xa1')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize']['import'](_0x47d1('0xa2'));db[_0x47d1('0xa3')]=db['sequelize'][_0x47d1('0x18')]('../api/analyticMetric/analyticMetric.model');db[_0x47d1('0xa4')]=db['sequelize'][_0x47d1('0x18')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x47d1('0xa5')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xa6'));db[_0x47d1('0xa7')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xa8'));db[_0x47d1('0xa9')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xaa'));db[_0x47d1('0xab')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/intSalesforceField/intSalesforceField.model');db[_0x47d1('0xac')]=db[_0x47d1('0x5')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x47d1('0xad')]=db['sequelize'][_0x47d1('0x18')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x47d1('0xae')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xaf'));db[_0x47d1('0xb0')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xb1'));db['DeskConfiguration']=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xb2'));db[_0x47d1('0xb3')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xb4'));db['ZohoConfiguration']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xb5'));db[_0x47d1('0xb6')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xb7'));db[_0x47d1('0xb8')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xb9'));db[_0x47d1('0xba')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xbb'));db[_0x47d1('0xbc')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xbd'));db[_0x47d1('0xbe')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xbf'));db[_0x47d1('0xc0')]=db['sequelize'][_0x47d1('0x18')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x47d1('0xc1')]=db['sequelize'][_0x47d1('0x18')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x47d1('0xc2')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xc3'));db[_0x47d1('0xc4')]=db[_0x47d1('0x5')]['import'](_0x47d1('0xc5'));db[_0x47d1('0xc6')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xc7'));db['ServicenowConfiguration']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xc8'));db[_0x47d1('0xc9')]=db[_0x47d1('0x5')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x47d1('0xca')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xcb'));db[_0x47d1('0xcc')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xcd'));db['Dynamics365Field']=db['sequelize'][_0x47d1('0x18')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x47d1('0xce')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xcf'));db[_0x47d1('0xd0')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xd1'));db[_0x47d1('0xd2')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xd3'));db[_0x47d1('0x9c')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x9d'));db['Network']=db[_0x47d1('0x5')]['import']('../api/network/network.model');db['ChatQueueReport']=db['sequelize'][_0x47d1('0x18')]('../api/chatQueueReport/chatQueueReport.model');db[_0x47d1('0xd4')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xd5'));db['JscriptyAnswerReport']=db[_0x47d1('0x5')]['import'](_0x47d1('0xd6'));db[_0x47d1('0xd7')]=db[_0x47d1('0x5')]['import'](_0x47d1('0xd8'));db[_0x47d1('0xd9')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xda'));db[_0x47d1('0xdb')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/smsQueueReport/smsQueueReport.model');db[_0x47d1('0xdc')]=db[_0x47d1('0x5')]['import'](_0x47d1('0xdd'));db['SquareDetailsReport']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xde'));db[_0x47d1('0xdf')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xe0'));db[_0x47d1('0xe1')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/setting/setting.model');db[_0x47d1('0xe2')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xe3'));db[_0x47d1('0xe4')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xe5'));db[_0x47d1('0xe6')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xe7'));db[_0x47d1('0xe8')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/squareMessage/squareMessage.model');db[_0x47d1('0xe9')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xea'));db['License']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xeb'));db[_0x47d1('0xec')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xed'));db['Migration']=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xee'));db[_0x47d1('0xef')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xf0'));db[_0x47d1('0xf1')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xf2'));db[_0x47d1('0xf3')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xf4'));db[_0x47d1('0xf5')]=db[_0x47d1('0x5')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0x47d1('0xf6')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xf7'));db[_0x47d1('0xf8')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0xf9'));db['SmsTransferReport']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xfa'));db[_0x47d1('0xfb')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/cmList/cmList.model');db[_0x47d1('0xfc')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0xfd'));db[_0x47d1('0xfe')]=db[_0x47d1('0x5')]['import'](_0x47d1('0xff'));db[_0x47d1('0x100')]=db['sequelize'][_0x47d1('0x18')]('../api/userProfileSection/userProfileSection.model');db[_0x47d1('0x101')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x102'));db[_0x47d1('0x103')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x104'));db[_0x47d1('0x105')]=db['sequelize'][_0x47d1('0x18')](_0x47d1('0x106'));db['WhatsappApplication']=db['sequelize']['import'](_0x47d1('0x107'));db['WhatsappInteraction']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x108'));db[_0x47d1('0x109')]=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/whatsappMessage/whatsappMessage.model');db[_0x47d1('0x10a')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x10b'));db['WhatsappTransferReport']=db[_0x47d1('0x5')][_0x47d1('0x18')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x47d1('0x10c')]=db['sequelize']['import'](_0x47d1('0x10d'));db['CloudProvider']=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x10e'));db[_0x47d1('0x10f')]=db[_0x47d1('0x5')][_0x47d1('0x18')](_0x47d1('0x110'));db['TeamVoiceQueue']=db[_0x47d1('0x5')]['import'](_0x47d1('0x111'));db[_0x47d1('0x15')]['hasOne'](db['VoiceMail'],{'as':_0x47d1('0x22'),'onDelete':_0x47d1('0x112'),'foreignKey':'UserId'});db[_0x47d1('0x15')][_0x47d1('0x113')](db['VoiceRecording'],{'as':_0x47d1('0x114'),'foreignKey':_0x47d1('0x115')});db['User'][_0x47d1('0x113')](db[_0x47d1('0x30')],{'as':_0x47d1('0x116'),'foreignKey':_0x47d1('0x115')});db['User'][_0x47d1('0x113')](db[_0x47d1('0x1a')],{'as':_0x47d1('0x117'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x7b')],{'as':'HopperFinals','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x7d')],{'as':_0x47d1('0x118'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db['ReportAgentPreview'],{'as':_0x47d1('0x7f'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x64')],{'as':'OpenchannelInteractions','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x6e')],{'as':_0x47d1('0x119'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x5b')],{'as':_0x47d1('0x11a'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x47d1('0x115')});db['User']['hasMany'](db[_0x47d1('0x45')],{'as':_0x47d1('0x11b'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db[_0x47d1('0x11c')],{'as':'WhatsappInteractions','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x15')][_0x47d1('0x113')](db['UserNotification'],{'as':_0x47d1('0x11d'),'foreignKey':_0x47d1('0x11e')});db[_0x47d1('0x15')][_0x47d1('0x11f')](db[_0x47d1('0xfe')],{'as':'UserProfile','foreignKey':_0x47d1('0x120')});db['User']['belongsToMany'](db[_0x47d1('0x74')],{'as':_0x47d1('0x121'),'through':'chat_group_has_users'});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x123')],{'as':_0x47d1('0x124'),'through':'cm_user_has_contacts'});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x125'),'through':_0x47d1('0x126')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0xe9')],{'through':_0x47d1('0x127')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x45')],{'as':_0x47d1('0x11b'),'through':_0x47d1('0x128')});db['User']['belongsToMany'](db[_0x47d1('0x6e')],{'as':'ChatInteractions','through':_0x47d1('0x129')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x53')],{'as':_0x47d1('0x12a'),'through':_0x47d1('0x12b')});db[_0x47d1('0x15')]['belongsToMany'](db[_0x47d1('0x5b')],{'as':_0x47d1('0x11a'),'through':_0x47d1('0x12c')});db[_0x47d1('0x15')][_0x47d1('0x122')](db['OpenchannelInteraction'],{'as':_0x47d1('0x12d'),'through':_0x47d1('0x12e')});db[_0x47d1('0x15')]['belongsToMany'](db[_0x47d1('0x11c')],{'as':'WhatsappInteractions','through':_0x47d1('0x12f')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x130')],{'as':_0x47d1('0x131'),'through':_0x47d1('0x32'),'required':![]});db[_0x47d1('0x15')]['belongsToMany'](db[_0x47d1('0x41')],{'as':_0x47d1('0x132'),'through':'UserMailQueue','required':![]});db[_0x47d1('0x15')]['belongsToMany'](db[_0x47d1('0x72')],{'as':'ChatQueues','through':_0x47d1('0x34'),'required':![],'hooks':!![]});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x57')],{'as':'FaxQueues','through':_0x47d1('0x133'),'required':![]});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x5f')],{'as':_0x47d1('0x134'),'through':_0x47d1('0x39'),'required':![]});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x67')],{'as':_0x47d1('0x135'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x47d1('0x122')](db[_0x47d1('0x10c')],{'as':_0x47d1('0x136'),'through':_0x47d1('0x137'),'required':![]});db[_0x47d1('0x15')][_0x47d1('0x122')](db['CmList'],{'through':_0x47d1('0x126')});db[_0x47d1('0x15')][_0x47d1('0x122')](db['VoicePrefix'],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x69')],{'as':_0x47d1('0x138'),'through':_0x47d1('0x139')});db['User'][_0x47d1('0x122')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x47d1('0x13a')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0x3f')],{'as':_0x47d1('0x13b'),'through':'user_has_mail_accounts'});db['User'][_0x47d1('0x122')](db[_0x47d1('0x61')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User'][_0x47d1('0x122')](db[_0x47d1('0x13c')],{'as':_0x47d1('0x13d'),'through':_0x47d1('0x13e')});db[_0x47d1('0x15')]['belongsToMany'](db[_0x47d1('0x105')],{'as':_0x47d1('0x13f'),'through':_0x47d1('0x140')});db[_0x47d1('0x15')][_0x47d1('0x122')](db[_0x47d1('0xe4')],{'as':_0x47d1('0x141'),'through':_0x47d1('0x142')});db['VoiceChanSpy'][_0x47d1('0x113')](db['VoiceExtension'],{'as':_0x47d1('0x143'),'onDelete':_0x47d1('0x112'),'foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db[_0x47d1('0x1a')],{'onDelete':_0x47d1('0x112')});db['VoiceExtension'][_0x47d1('0x113')](db[_0x47d1('0x1a')],{'as':_0x47d1('0x144'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x145')][_0x47d1('0x122')](db[_0x47d1('0x94')],{'as':_0x47d1('0x146'),'through':_0x47d1('0x147')});db[_0x47d1('0x130')]['hasMany'](db[_0x47d1('0x30')],{'as':_0x47d1('0x148'),'foreignKey':_0x47d1('0x149')});db[_0x47d1('0x130')][_0x47d1('0x113')](db[_0x47d1('0x78')],{'as':_0x47d1('0x14a'),'foreignKey':_0x47d1('0x149')});db[_0x47d1('0x130')][_0x47d1('0x113')](db[_0x47d1('0x7b')],{'as':_0x47d1('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x47d1('0x130')][_0x47d1('0x113')](db[_0x47d1('0x7d')],{'as':_0x47d1('0x14c'),'foreignKey':_0x47d1('0x149')});db['VoiceQueue'][_0x47d1('0x113')](db['ReportAgentPreview'],{'as':_0x47d1('0x7f'),'foreignKey':_0x47d1('0x149')});db[_0x47d1('0x130')][_0x47d1('0x113')](db[_0x47d1('0x7a')],{'as':_0x47d1('0x14d'),'foreignKey':_0x47d1('0x149')});db[_0x47d1('0x130')]['hasMany'](db[_0x47d1('0xd9')],{'as':'JscriptySessions','foreignKey':_0x47d1('0x149')});db[_0x47d1('0x130')][_0x47d1('0x11f')](db[_0x47d1('0x2e')],{'as':_0x47d1('0x2e'),'foreignKey':'TrunkId'});db[_0x47d1('0x130')]['belongsTo'](db[_0x47d1('0x2e')],{'as':_0x47d1('0x14e'),'foreignKey':_0x47d1('0x14f')});db[_0x47d1('0x130')]['belongsTo'](db[_0x47d1('0x8b')],{'as':_0x47d1('0x8b'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0x47d1('0x11f')](db[_0x47d1('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x47d1('0x150')});db[_0x47d1('0x130')][_0x47d1('0x122')](db['CmList'],{'as':_0x47d1('0x125'),'through':_0x47d1('0x151')});db[_0x47d1('0x130')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x32')});db[_0x47d1('0x130')][_0x47d1('0x122')](db[_0x47d1('0xe9')],{'as':_0x47d1('0x153'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0x47d1('0x122')](db['CmList'],{'as':_0x47d1('0x154'),'through':_0x47d1('0x155')});db[_0x47d1('0x1e')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x15'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x20')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':'User','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x22')]['hasMany'](db['VoiceMailMessage'],{'as':_0x47d1('0x156'),'onDelete':_0x47d1('0x112'),'foreignKey':'mailboxuser','sourceKey':_0x47d1('0x157')});db[_0x47d1('0x24')][_0x47d1('0x11f')](db[_0x47d1('0x22')],{'foreignKey':'mailboxuser','targetKey':_0x47d1('0x157')});db[_0x47d1('0x25')][_0x47d1('0x113')](db[_0x47d1('0x2a')],{'as':_0x47d1('0x158'),'foreignKey':_0x47d1('0x159'),'constraints':![]});db['VoiceCallReport'][_0x47d1('0x113')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x47d1('0x25')]['belongsTo'](db[_0x47d1('0x15')],{'as':'User','foreignKey':'UserId'});db['VoiceCallReport'][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x3c')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{'as':_0x47d1('0x3f'),'foreignKey':_0x47d1('0x15c')});db[_0x47d1('0x3e')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{'as':_0x47d1('0x3f'),'foreignKey':_0x47d1('0x15c')});db[_0x47d1('0x3f')][_0x47d1('0x15d')](db[_0x47d1('0x3c')],{'as':_0x47d1('0x15e'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x3f')][_0x47d1('0x15d')](db[_0x47d1('0x3e')],{'as':'Smtp','onDelete':_0x47d1('0x112')});db[_0x47d1('0x3f')]['hasMany'](db[_0x47d1('0x89')],{'as':_0x47d1('0x15f'),'foreignKey':'MailAccountId'});db[_0x47d1('0x3f')][_0x47d1('0x113')](db[_0x47d1('0x87')],{'as':_0x47d1('0x160'),'foreignKey':_0x47d1('0x15c')});db[_0x47d1('0x3f')][_0x47d1('0x113')](db[_0x47d1('0x47')],{'as':_0x47d1('0x156'),'foreignKey':_0x47d1('0x15c')});db[_0x47d1('0x3f')]['hasMany'](db['MailInteraction'],{'as':_0x47d1('0x161')});db[_0x47d1('0x3f')]['hasMany'](db[_0x47d1('0x49')],{'as':_0x47d1('0x144')});db['MailAccount'][_0x47d1('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x47d1('0x162')});db[_0x47d1('0x3f')][_0x47d1('0x11f')](db['Template'],{'as':'Template','foreignKey':_0x47d1('0x163')});db[_0x47d1('0x3f')][_0x47d1('0x11f')](db[_0x47d1('0x8d')],{'as':_0x47d1('0x164'),'foreignKey':_0x47d1('0x150')});db[_0x47d1('0x3f')][_0x47d1('0x122')](db['User'],{'as':_0x47d1('0x152'),'through':_0x47d1('0x165')});db['MailQueue']['belongsToMany'](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':'UserMailQueue'});db['MailQueue'][_0x47d1('0x122')](db[_0x47d1('0xe9')],{'through':_0x47d1('0x166'),'as':_0x47d1('0x153')});db[_0x47d1('0x45')]['hasMany'](db[_0x47d1('0x47')],{'as':'Messages','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x167')});db[_0x47d1('0x45')][_0x47d1('0x11f')](db['MailAccount'],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x15c')});db[_0x47d1('0x45')]['belongsTo'](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':'ContactId'});db[_0x47d1('0x45')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x169'),'foreignKey':'UserId'});db[_0x47d1('0x45')][_0x47d1('0x122')](db['Tag'],{'through':_0x47d1('0x16a'),'as':_0x47d1('0x16b')});db[_0x47d1('0x45')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x47d1('0x45')][_0x47d1('0x122')](db['User'],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x128'),'foreignKey':_0x47d1('0x167')});db[_0x47d1('0x47')][_0x47d1('0x113')](db[_0x47d1('0xef')],{'as':_0x47d1('0x16e'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x47')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x15')});db[_0x47d1('0x47')][_0x47d1('0x11f')](db['CmContact'],{'onDelete':_0x47d1('0x112'),'as':'Contact'});db[_0x47d1('0x47')]['belongsTo'](db[_0x47d1('0x45')],{'as':_0x47d1('0x16f'),'foreignKey':'MailInteractionId'});db[_0x47d1('0x47')][_0x47d1('0x11f')](db['MailAccount'],{'as':_0x47d1('0x168'),'foreignKey':'MailAccountId'});db[_0x47d1('0x47')]['belongsTo'](db[_0x47d1('0x69')],{'as':'ChatWebsite','foreignKey':_0x47d1('0x170')});db[_0x47d1('0x47')][_0x47d1('0x11f')](db[_0x47d1('0x70')],{'as':_0x47d1('0x70'),'foreignKey':'ChatOfflineMessageId'});db[_0x47d1('0x49')][_0x47d1('0x11f')](db['User'],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x49')][_0x47d1('0x11f')](db[_0x47d1('0x41')],{'onDelete':_0x47d1('0x171')});db['MailApplication']['belongsTo'](db[_0x47d1('0x3f')],{'onDelete':_0x47d1('0x171')});db['MailApplication'][_0x47d1('0x11f')](db[_0x47d1('0x8b')],{'onDelete':_0x47d1('0x171'),'foreignKey':'IntervalId'});db[_0x47d1('0x49')]['belongsTo'](db[_0x47d1('0x16c')],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x172')});db[_0x47d1('0x4b')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{});db[_0x47d1('0x4b')][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x173'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0x4b')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db['MailQueueReport'][_0x47d1('0x11f')](db[_0x47d1('0x45')],{});db[_0x47d1('0x4b')][_0x47d1('0x11f')](db[_0x47d1('0x47')],{});db[_0x47d1('0x4b')]['belongsTo'](db['User'],{});db[_0x47d1('0x4b')][_0x47d1('0x11f')](db['MailQueue'],{});db[_0x47d1('0x174')][_0x47d1('0x113')](db[_0x47d1('0x4e')],{'as':_0x47d1('0x175'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x89')],{'as':'Dispositions','foreignKey':_0x47d1('0x176')});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x87')],{'as':_0x47d1('0x160'),'foreignKey':'FaxAccountId'});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x53')],{'as':_0x47d1('0x161')});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x177')],{'as':_0x47d1('0x144')});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x1a')],{'as':'Exntensions','onDelete':_0x47d1('0x112')});db[_0x47d1('0x50')][_0x47d1('0x113')](db[_0x47d1('0x55')],{'as':'Messages'});db[_0x47d1('0x50')][_0x47d1('0x11f')](db[_0x47d1('0x2e')],{'as':_0x47d1('0x2e')});db[_0x47d1('0x50')][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':'List','foreignKey':'ListId'});db['FaxAccount'][_0x47d1('0x11f')](db[_0x47d1('0x8d')],{'as':_0x47d1('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x47d1('0x50')]['belongsToMany'](db[_0x47d1('0x15')],{'as':'Agents','through':_0x47d1('0x13a')});db['FaxApplication'][_0x47d1('0x11f')](db['User'],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x177')][_0x47d1('0x11f')](db[_0x47d1('0x57')],{'onDelete':'restrict'});db['FaxApplication'][_0x47d1('0x11f')](db[_0x47d1('0x50')],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x177')]['belongsTo'](db[_0x47d1('0x16c')],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x172')});db['FaxInteraction'][_0x47d1('0x113')](db[_0x47d1('0x55')],{'as':_0x47d1('0x156'),'onDelete':'cascade','foreignKey':_0x47d1('0x178')});db[_0x47d1('0x53')][_0x47d1('0x11f')](db[_0x47d1('0x50')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x176')});db['FaxInteraction'][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':'Contact','foreignKey':_0x47d1('0x15b')});db['FaxInteraction'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':'Owner','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x53')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x179'),'as':_0x47d1('0x16b')});db[_0x47d1('0x53')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x179'),'as':_0x47d1('0x17a')});db[_0x47d1('0x53')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x12b'),'foreignKey':_0x47d1('0x178')});db['FaxMessage']['belongsTo'](db['User'],{'onDelete':_0x47d1('0x112'),'as':'User'});db[_0x47d1('0x55')][_0x47d1('0x11f')](db['FaxInteraction'],{'as':_0x47d1('0x16f'),'foreignKey':_0x47d1('0x178')});db[_0x47d1('0x55')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'onDelete':_0x47d1('0x112'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0x47d1('0xef')],{'as':_0x47d1('0xef'),'foreignKey':_0x47d1('0x17b')});db[_0x47d1('0x55')][_0x47d1('0x11f')](db[_0x47d1('0x50')],{'as':'Account','foreignKey':_0x47d1('0x176')});db[_0x47d1('0x57')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x133')});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0x47d1('0x17c'),'as':_0x47d1('0x153')});db[_0x47d1('0x58')]['belongsTo'](db[_0x47d1('0x50')],{});db[_0x47d1('0x58')][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x173'),'foreignKey':'ListId'});db[_0x47d1('0x58')][_0x47d1('0x11f')](db['CmContact'],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x58')][_0x47d1('0x11f')](db[_0x47d1('0x53')],{});db[_0x47d1('0x58')]['belongsTo'](db[_0x47d1('0x55')],{});db[_0x47d1('0x58')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{});db[_0x47d1('0x58')][_0x47d1('0x11f')](db[_0x47d1('0x57')],{});db[_0x47d1('0x13c')]['hasMany'](db[_0x47d1('0x89')],{'as':'Dispositions','foreignKey':_0x47d1('0x17d')});db[_0x47d1('0x13c')][_0x47d1('0x113')](db['CannedAnswer'],{'as':_0x47d1('0x160'),'foreignKey':_0x47d1('0x17d')});db[_0x47d1('0x13c')][_0x47d1('0x113')](db[_0x47d1('0x5d')],{'as':'Messages','foreignKey':_0x47d1('0x17d')});db[_0x47d1('0x13c')][_0x47d1('0x113')](db[_0x47d1('0x5b')],{'as':'Interactions'});db[_0x47d1('0x13c')][_0x47d1('0x113')](db[_0x47d1('0x5a')],{'as':_0x47d1('0x144')});db[_0x47d1('0x13c')]['belongsTo'](db[_0x47d1('0xfb')],{'as':'List','foreignKey':_0x47d1('0x162')});db[_0x47d1('0x13c')]['belongsTo'](db[_0x47d1('0x8d')],{'as':_0x47d1('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x47d1('0x13c')]['belongsToMany'](db['User'],{'as':_0x47d1('0x152'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0x47d1('0x11f')](db['User'],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x5a')][_0x47d1('0x11f')](db[_0x47d1('0x5f')],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x5a')][_0x47d1('0x11f')](db[_0x47d1('0x13c')],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x5a')][_0x47d1('0x11f')](db[_0x47d1('0x8b')],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x5a')][_0x47d1('0x11f')](db[_0x47d1('0x16c')],{'onDelete':_0x47d1('0x171'),'foreignKey':'TagId'});db['SmsInteraction'][_0x47d1('0x113')](db['SmsMessage'],{'as':'Messages','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x17f')});db[_0x47d1('0x5b')][_0x47d1('0x11f')](db['SmsAccount'],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x17d')});db[_0x47d1('0x5b')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x5b')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':'Owner','foreignKey':_0x47d1('0x115')});db[_0x47d1('0x5b')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x180'),'as':'Tags'});db[_0x47d1('0x5b')][_0x47d1('0x122')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x47d1('0x17a')});db[_0x47d1('0x5b')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x12c'),'foreignKey':_0x47d1('0x17f')});db['SmsMessage'][_0x47d1('0x11f')](db['User'],{'as':'User'});db[_0x47d1('0x5d')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15a')});db[_0x47d1('0x5d')][_0x47d1('0x11f')](db[_0x47d1('0x5b')],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x16f'),'foreignKey':_0x47d1('0x17f')});db[_0x47d1('0x5d')][_0x47d1('0x11f')](db[_0x47d1('0x13c')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x17d')});db['SmsQueue'][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x39'),'foreignKey':_0x47d1('0x181')});db[_0x47d1('0x5f')][_0x47d1('0x122')](db[_0x47d1('0xe9')],{'through':'team_has_sms_queues','as':_0x47d1('0x153')});db[_0x47d1('0x61')][_0x47d1('0x113')](db[_0x47d1('0x89')],{'as':_0x47d1('0x15f'),'foreignKey':_0x47d1('0x182')});db[_0x47d1('0x61')][_0x47d1('0x113')](db[_0x47d1('0x87')],{'as':_0x47d1('0x160'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x47d1('0x113')](db[_0x47d1('0x64')],{'as':'Interactions','foreignKey':_0x47d1('0x182')});db[_0x47d1('0x61')][_0x47d1('0x113')](db[_0x47d1('0x65')],{'as':_0x47d1('0x156'),'foreignKey':_0x47d1('0x182')});db['OpenchannelAccount']['hasMany'](db[_0x47d1('0x183')],{'as':_0x47d1('0x144'),'foreignKey':_0x47d1('0x182')});db['OpenchannelAccount'][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x173'),'foreignKey':'ListId'});db[_0x47d1('0x61')][_0x47d1('0x11f')](db['Pause'],{'as':_0x47d1('0x164'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x47d1('0x61')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x184')});db['OpenchannelApplication'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'onDelete':_0x47d1('0x171')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x185')});db['OpenchannelApplication'][_0x47d1('0x11f')](db['OpenchannelAccount'],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x182')});db[_0x47d1('0x183')]['belongsTo'](db['Interval'],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x183')][_0x47d1('0x11f')](db['Tag'],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x172')});db[_0x47d1('0x64')][_0x47d1('0x113')](db[_0x47d1('0x65')],{'as':'Messages','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x186')});db[_0x47d1('0x64')][_0x47d1('0x11f')](db[_0x47d1('0x61')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x182')});db[_0x47d1('0x64')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':'Contact','foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x64')]['belongsTo'](db[_0x47d1('0x15')],{'as':'Owner','foreignKey':_0x47d1('0x115')});db['OpenchannelInteraction'][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':'openchannel_interaction_has_tags','as':_0x47d1('0x16b')});db[_0x47d1('0x64')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x187'),'as':_0x47d1('0x17a')});db['OpenchannelInteraction'][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x12e'),'foreignKey':_0x47d1('0x186')});db['OpenchannelMessage'][_0x47d1('0x11f')](db['User'],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15')});db[_0x47d1('0x65')][_0x47d1('0x11f')](db['CmContact'],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15a')});db[_0x47d1('0x65')][_0x47d1('0x11f')](db[_0x47d1('0x64')],{'onDelete':'cascade','as':_0x47d1('0x16f'),'foreignKey':_0x47d1('0x186')});db[_0x47d1('0x65')]['belongsTo'](db['Attachment'],{'as':_0x47d1('0xef'),'foreignKey':_0x47d1('0x17b')});db['OpenchannelMessage']['belongsTo'](db[_0x47d1('0x61')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x182')});db[_0x47d1('0x67')]['belongsToMany'](db[_0x47d1('0x15')],{'as':'Agents','through':_0x47d1('0x3a'),'foreignKey':_0x47d1('0x185')});db[_0x47d1('0x67')]['belongsToMany'](db[_0x47d1('0xe9')],{'through':_0x47d1('0x188'),'as':_0x47d1('0x153')});db[_0x47d1('0x69')][_0x47d1('0x113')](db['Disposition'],{'as':_0x47d1('0x15f'),'foreignKey':_0x47d1('0x170')});db[_0x47d1('0x69')][_0x47d1('0x113')](db[_0x47d1('0x87')],{'as':_0x47d1('0x160'),'foreignKey':_0x47d1('0x170')});db[_0x47d1('0x69')]['hasMany'](db['ChatProactiveAction'],{'as':_0x47d1('0x189')});db[_0x47d1('0x69')][_0x47d1('0x113')](db[_0x47d1('0x6e')],{'as':'Interactions'});db['ChatWebsite'][_0x47d1('0x113')](db[_0x47d1('0x6d')],{'as':'Applications'});db[_0x47d1('0x69')][_0x47d1('0x113')](db['ChatMessage'],{'as':'Messages'});db[_0x47d1('0x69')][_0x47d1('0x11f')](db['CmList'],{'as':_0x47d1('0x173'),'foreignKey':'ListId'});db[_0x47d1('0x69')][_0x47d1('0x11f')](db[_0x47d1('0x8b')],{'as':_0x47d1('0x8b'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x69')][_0x47d1('0x11f')](db['MailAccount'],{'as':_0x47d1('0x3f'),'foreignKey':_0x47d1('0x15c')});db['ChatWebsite'][_0x47d1('0x11f')](db['Pause'],{'as':_0x47d1('0x164'),'foreignKey':_0x47d1('0x150')});db['ChatWebsite'][_0x47d1('0x122')](db['User'],{'as':'Agents','through':_0x47d1('0x139')});db[_0x47d1('0x6b')][_0x47d1('0x11f')](db[_0x47d1('0x61')],{});db[_0x47d1('0x6b')]['belongsTo'](db[_0x47d1('0xfb')],{'as':_0x47d1('0x173'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0x6b')]['belongsTo'](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':'ContactId'});db[_0x47d1('0x6b')][_0x47d1('0x11f')](db[_0x47d1('0x64')],{});db[_0x47d1('0x6b')][_0x47d1('0x11f')](db['OpenchannelMessage'],{});db[_0x47d1('0x6b')][_0x47d1('0x11f')](db['User'],{});db[_0x47d1('0x6b')]['belongsTo'](db[_0x47d1('0x67')],{});db[_0x47d1('0x6d')]['belongsTo'](db[_0x47d1('0x15')],{'as':_0x47d1('0x18a'),'foreignKey':_0x47d1('0x115'),'onDelete':_0x47d1('0x171')});db['ChatApplication'][_0x47d1('0x11f')](db[_0x47d1('0x72')],{'as':_0x47d1('0x18b'),'foreignKey':_0x47d1('0x18c'),'onDelete':_0x47d1('0x171')});db['ChatApplication'][_0x47d1('0x11f')](db['ChatWebsite'],{'as':_0x47d1('0x18d'),'foreignKey':_0x47d1('0x170'),'onDelete':_0x47d1('0x171')});db[_0x47d1('0x6d')][_0x47d1('0x11f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x47d1('0x172')});db[_0x47d1('0x6e')][_0x47d1('0x113')](db[_0x47d1('0x6f')],{'as':_0x47d1('0x156'),'onDelete':'cascade','foreignKey':_0x47d1('0x18e')});db[_0x47d1('0x6e')][_0x47d1('0x11f')](db[_0x47d1('0x69')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x170')});db[_0x47d1('0x6e')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x6e')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x169'),'foreignKey':'UserId'});db['ChatInteraction'][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x18f'),'as':_0x47d1('0x16b')});db[_0x47d1('0x6e')]['belongsToMany'](db['Tag'],{'through':_0x47d1('0x18f'),'as':_0x47d1('0x17a')});db['ChatInteraction'][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x129'),'foreignKey':'ChatInteractionId'});db[_0x47d1('0x6f')]['belongsTo'](db[_0x47d1('0x15')],{'onDelete':_0x47d1('0x112'),'as':'User'});db[_0x47d1('0x6f')][_0x47d1('0x11f')](db['CmContact'],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x6f')][_0x47d1('0x11f')](db['ChatInteraction'],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x16f'),'foreignKey':_0x47d1('0x18e')});db[_0x47d1('0x6f')]['belongsTo'](db[_0x47d1('0xef')],{'as':_0x47d1('0xef'),'foreignKey':_0x47d1('0x17b')});db[_0x47d1('0x6f')]['belongsTo'](db[_0x47d1('0x69')],{'as':'Account','foreignKey':_0x47d1('0x170')});db['ChatOfflineMessage'][_0x47d1('0x113')](db['Attachment'],{'as':'Attachments','foreignKey':_0x47d1('0x190'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x70')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x70')]['belongsTo'](db[_0x47d1('0x69')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x170')});db[_0x47d1('0x72')][_0x47d1('0x122')](db['User'],{'as':'Agents','through':_0x47d1('0x34'),'hooks':!![]});db['ChatQueue'][_0x47d1('0x122')](db['Team'],{'through':_0x47d1('0x191'),'as':_0x47d1('0x153')});db[_0x47d1('0x74')]['hasMany'](db[_0x47d1('0xd4')],{'as':_0x47d1('0x156'),'foreignKey':_0x47d1('0x192'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x74')][_0x47d1('0x122')](db['User'],{'as':_0x47d1('0x148'),'through':_0x47d1('0x193')});db[_0x47d1('0x194')][_0x47d1('0x11f')](db['ChatWebsite'],{'as':_0x47d1('0x18d'),'foreignKey':_0x47d1('0x170')});db['CmCompany'][_0x47d1('0x113')](db[_0x47d1('0x123')],{'as':_0x47d1('0x124'),'foreignKey':'CompanyId'});db[_0x47d1('0x123')][_0x47d1('0x113')](db[_0x47d1('0x78')],{'as':_0x47d1('0x14a'),'foreignKey':_0x47d1('0x15b')});db['CmContact'][_0x47d1('0x113')](db[_0x47d1('0x7b')],{'as':_0x47d1('0x14b'),'foreignKey':'ContactId'});db['CmContact'][_0x47d1('0x113')](db[_0x47d1('0x7d')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x47d1('0x123')][_0x47d1('0x113')](db[_0x47d1('0x7f')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x47d1('0x123')][_0x47d1('0x113')](db[_0x47d1('0xd9')],{'as':_0x47d1('0x195'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x123')]['hasMany'](db[_0x47d1('0x64')],{'as':_0x47d1('0x12d'),'foreignKey':_0x47d1('0x15b'),'onDelete':_0x47d1('0x171')});db[_0x47d1('0x123')][_0x47d1('0x113')](db['ChatInteraction'],{'as':_0x47d1('0x119'),'foreignKey':'ContactId','onDelete':_0x47d1('0x171')});db[_0x47d1('0x123')][_0x47d1('0x113')](db[_0x47d1('0x5b')],{'as':_0x47d1('0x11a'),'foreignKey':_0x47d1('0x15b'),'onDelete':_0x47d1('0x171')});db[_0x47d1('0x123')][_0x47d1('0x113')](db['FaxInteraction'],{'as':_0x47d1('0x12a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x47d1('0x123')]['hasMany'](db['MailInteraction'],{'as':_0x47d1('0x11b'),'foreignKey':_0x47d1('0x15b'),'onDelete':'restrict'});db['CmContact']['belongsTo'](db[_0x47d1('0x76')],{'as':_0x47d1('0x196'),'foreignKey':_0x47d1('0x197')});db['CmContact']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x47d1('0x162'),'onDelete':'cascade'});db[_0x47d1('0x123')][_0x47d1('0x122')](db['User'],{'as':_0x47d1('0x16d'),'through':'cm_user_has_contacts'});db[_0x47d1('0x123')][_0x47d1('0x122')](db['Tag'],{'as':_0x47d1('0x16b'),'through':_0x47d1('0x198')});db[_0x47d1('0x123')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x198'),'as':_0x47d1('0x17a')});db[_0x47d1('0x78')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x78')][_0x47d1('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x47d1('0x162'),'onDelete':_0x47d1('0x112')});db['CmHopper']['belongsTo'](db[_0x47d1('0x15')],{'as':_0x47d1('0x18a'),'foreignKey':'UserId'});db[_0x47d1('0x78')][_0x47d1('0x11f')](db[_0x47d1('0x130')],{'as':_0x47d1('0x18b'),'foreignKey':_0x47d1('0x149'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x78')][_0x47d1('0x11f')](db[_0x47d1('0xec')],{'as':_0x47d1('0xec'),'foreignKey':'CampaignId','onDelete':_0x47d1('0x112')});db['CmHopper'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x169'),'foreignKey':_0x47d1('0x199')});db[_0x47d1('0x7a')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'as':'Contact','foreignKey':_0x47d1('0x15b'),'onDelete':'cascade'});db[_0x47d1('0x7a')][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x173'),'foreignKey':_0x47d1('0x162'),'onDelete':'cascade'});db[_0x47d1('0x7a')][_0x47d1('0x11f')](db['VoiceQueue'],{'as':_0x47d1('0x18b'),'foreignKey':_0x47d1('0x149'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x7a')][_0x47d1('0x11f')](db[_0x47d1('0xec')],{'as':_0x47d1('0xec'),'foreignKey':_0x47d1('0x19a'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x85')][_0x47d1('0x113')](db[_0x47d1('0x8a')],{'as':{'plural':'All','singular':_0x47d1('0x19b')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x47d1('0x85')][_0x47d1('0x113')](db[_0x47d1('0x8a')],{'as':{'plural':_0x47d1('0x19c'),'singular':_0x47d1('0x19d')},'foreignKey':_0x47d1('0x19e'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x85')][_0x47d1('0x113')](db[_0x47d1('0x83')],{'as':_0x47d1('0x19f'),'foreignKey':_0x47d1('0x1a0'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x89')][_0x47d1('0x113')](db[_0x47d1('0x89')],{'as':_0x47d1('0x15f'),'foreignKey':_0x47d1('0x1a1'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x8b')][_0x47d1('0x113')](db[_0x47d1('0x8b')],{'as':_0x47d1('0x1a2'),'foreignKey':_0x47d1('0x17e'),'onDelete':_0x47d1('0x112'),'hooks':!![],'required':![]});db[_0x47d1('0x8b')][_0x47d1('0x113')](db[_0x47d1('0x1a')],{'as':_0x47d1('0x117'),'foreignKey':_0x47d1('0x17e'),'onDelete':_0x47d1('0x171')});db[_0x47d1('0x8b')][_0x47d1('0x113')](db['MailApplication'],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0x47d1('0x8b')][_0x47d1('0x113')](db[_0x47d1('0x6d')],{'as':_0x47d1('0x1a3'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x8b')][_0x47d1('0x113')](db[_0x47d1('0x177')],{'as':_0x47d1('0x1a4'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x8b')][_0x47d1('0x113')](db[_0x47d1('0x5a')],{'as':_0x47d1('0x1a5'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0x92')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{});db[_0x47d1('0x92')][_0x47d1('0x11f')](db[_0x47d1('0xa1')],{'foreignKey':_0x47d1('0x1a6')});db['Schedule'][_0x47d1('0x11f')](db[_0x47d1('0x1a7')],{'foreignKey':_0x47d1('0x1a8')});db[_0x47d1('0x94')][_0x47d1('0x122')](db[_0x47d1('0x145')],{'as':_0x47d1('0x1a9'),'through':_0x47d1('0x147'),'onDelete':_0x47d1('0x171')});db[_0x47d1('0x16c')]['belongsToMany'](db[_0x47d1('0x123')],{'through':_0x47d1('0x198')});db['Tag'][_0x47d1('0x122')](db[_0x47d1('0x6e')],{'through':_0x47d1('0x18f')});db[_0x47d1('0x16c')][_0x47d1('0x122')](db[_0x47d1('0x45')],{'through':_0x47d1('0x16a')});db[_0x47d1('0x16c')][_0x47d1('0x122')](db[_0x47d1('0x5b')],{'through':_0x47d1('0x180')});db['Tag'][_0x47d1('0x122')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x47d1('0x16c')][_0x47d1('0x122')](db['OpenchannelInteraction'],{'through':_0x47d1('0x187')});db['Tag']['belongsToMany'](db[_0x47d1('0x11c')],{'through':_0x47d1('0x1aa')});db['Trigger'][_0x47d1('0x113')](db[_0x47d1('0x8a')],{'as':{'plural':_0x47d1('0x1ab'),'singular':_0x47d1('0x1ac')},'foreignKey':_0x47d1('0x1ad'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x98')][_0x47d1('0x113')](db[_0x47d1('0x8a')],{'as':{'plural':_0x47d1('0x1ae'),'singular':_0x47d1('0x1af')},'foreignKey':_0x47d1('0x1b0'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db[_0x47d1('0x98')]['hasMany'](db[_0x47d1('0x83')],{'as':_0x47d1('0x19f'),'foreignKey':_0x47d1('0x1b1'),'onDelete':_0x47d1('0x112'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0x47d1('0x1b2'),'onDelete':'cascade','foreignKey':_0x47d1('0x1a8'),'hooks':!![]});db[_0x47d1('0xa1')][_0x47d1('0x113')](db[_0x47d1('0xa4')],{'as':_0x47d1('0x1b2'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1a6')});db[_0x47d1('0xa3')]['hasMany'](db[_0x47d1('0xa4')],{'as':_0x47d1('0x1b2'),'onDelete':_0x47d1('0x112'),'foreignKey':'MetricId'});db[_0x47d1('0xa4')]['belongsTo'](db[_0x47d1('0xa3')],{'foreignKey':'MetricId'});db[_0x47d1('0xa7')][_0x47d1('0x113')](db['SalesforceConfiguration'],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':'AccountId'});db[_0x47d1('0xa9')][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':'Subjects','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xa9')][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':'Descriptions','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xa9')][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':_0x47d1('0x1b2'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xa9')][_0x47d1('0x11f')](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xab')][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xab')][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':'Description','foreignKey':_0x47d1('0x1b5')});db['SalesforceField'][_0x47d1('0x113')](db[_0x47d1('0xab')],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xab')]['belongsTo'](db['Variable'],{'as':_0x47d1('0x9a'),'foreignKey':'VariableId'});db[_0x47d1('0xac')][_0x47d1('0x113')](db[_0x47d1('0xad')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xad')][_0x47d1('0x113')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b4')});db['SugarcrmConfiguration'][_0x47d1('0x113')](db['SugarcrmField'],{'as':_0x47d1('0x1ba'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b5')});db['SugarcrmConfiguration']['hasMany'](db[_0x47d1('0xae')],{'as':_0x47d1('0x1b2'),'onDelete':_0x47d1('0x112'),'foreignKey':'FieldId'});db['SugarcrmConfiguration']['belongsTo'](db[_0x47d1('0xac')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xae')][_0x47d1('0x113')](db[_0x47d1('0xae')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xae')][_0x47d1('0x113')](db['SugarcrmField'],{'as':_0x47d1('0x1bb'),'foreignKey':'DescriptionId'});db[_0x47d1('0xae')][_0x47d1('0x113')](db[_0x47d1('0xae')],{'as':'Field','foreignKey':'FieldId'});db[_0x47d1('0xae')][_0x47d1('0x11f')](db[_0x47d1('0x9a')],{'as':_0x47d1('0x9a'),'foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0xb0')][_0x47d1('0x113')](db[_0x47d1('0x1bd')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':'AccountId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0x47d1('0x1be'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0x1bd')]['hasMany'](db['DeskField'],{'as':_0x47d1('0x1ba'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0x1bd')][_0x47d1('0x113')](db[_0x47d1('0x1bf')],{'as':_0x47d1('0x1b2'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x47d1('0x1bd')][_0x47d1('0x11f')](db['DeskAccount'],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0x1bd')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':'int_desk_configuration_has_tags'});db[_0x47d1('0x1bf')][_0x47d1('0x113')](db[_0x47d1('0x1bf')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0x1bf')][_0x47d1('0x113')](db[_0x47d1('0x1bf')],{'as':_0x47d1('0x1bb'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0x1bf')]['hasMany'](db[_0x47d1('0x1bf')],{'as':'Field','foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0x1bf')][_0x47d1('0x11f')](db[_0x47d1('0x9a')],{'as':'Variable','foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0xb3')][_0x47d1('0x113')](db[_0x47d1('0x1c0')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0x1c0')][_0x47d1('0x113')](db[_0x47d1('0xb6')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0x47d1('0xb6')],{'as':_0x47d1('0x1ba'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Fields','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0x1c0')][_0x47d1('0x11f')](db[_0x47d1('0xb3')],{'as':_0x47d1('0x168'),'foreignKey':'AccountId'});db['ZohoField'][_0x47d1('0x113')](db[_0x47d1('0xb6')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xb6')]['hasMany'](db[_0x47d1('0xb6')],{'as':'Description','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xb6')][_0x47d1('0x113')](db['ZohoField'],{'as':'Field','foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xb6')][_0x47d1('0x11f')](db[_0x47d1('0x9a')],{'as':'Variable','foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0xb8')][_0x47d1('0x113')](db[_0x47d1('0xba')],{'as':'Configurations','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xba')][_0x47d1('0x113')](db['ZendeskField'],{'as':_0x47d1('0x1be'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xba')][_0x47d1('0x113')](db[_0x47d1('0xbc')],{'as':_0x47d1('0x1ba'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x47d1('0x113')](db[_0x47d1('0xbc')],{'as':_0x47d1('0x1b2'),'foreignKey':_0x47d1('0x1b6')});db['ZendeskConfiguration']['belongsTo'](db['ZendeskAccount'],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xba')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x47d1('0x113')](db[_0x47d1('0xbc')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db['ZendeskField'][_0x47d1('0x113')](db[_0x47d1('0xbc')],{'as':'Description','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xbc')]['hasMany'](db[_0x47d1('0xbc')],{'as':_0x47d1('0x1b9'),'foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db[_0x47d1('0x9a')],{'as':_0x47d1('0x9a'),'foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0xbe')][_0x47d1('0x113')](db[_0x47d1('0x1c1')],{'as':'Configurations','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db['FreshdeskConfiguration'][_0x47d1('0x113')](db[_0x47d1('0xc0')],{'as':_0x47d1('0x1be'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0x1c1')]['hasMany'](db[_0x47d1('0xc0')],{'as':_0x47d1('0x1ba'),'onDelete':'cascade','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0x1c1')][_0x47d1('0x113')](db[_0x47d1('0xc0')],{'as':'Fields','onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0x1c1')][_0x47d1('0x11f')](db[_0x47d1('0xbe')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0x1c1')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':_0x47d1('0x1c2')});db[_0x47d1('0xc0')]['hasMany'](db[_0x47d1('0xc0')],{'as':_0x47d1('0x1b8'),'foreignKey':'SubjectId'});db[_0x47d1('0xc0')][_0x47d1('0x113')](db[_0x47d1('0xc0')],{'as':_0x47d1('0x1bb'),'foreignKey':_0x47d1('0x1b5')});db['FreshdeskField'][_0x47d1('0x113')](db[_0x47d1('0xc0')],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db['FreshdeskField'][_0x47d1('0x11f')](db['Variable'],{'as':_0x47d1('0x9a'),'foreignKey':_0x47d1('0x1bc')});db['VtigerAccount']['hasMany'](db[_0x47d1('0xc2')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xc2')][_0x47d1('0x113')](db['VtigerField'],{'as':_0x47d1('0x1be'),'foreignKey':'SubjectId'});db[_0x47d1('0xc2')][_0x47d1('0x113')](db[_0x47d1('0xc4')],{'as':_0x47d1('0x1ba'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xc2')]['hasMany'](db[_0x47d1('0xc4')],{'as':_0x47d1('0x1b2'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xc2')][_0x47d1('0x11f')](db[_0x47d1('0xc1')],{'as':'Account','foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xc4')][_0x47d1('0x113')](db[_0x47d1('0xc4')],{'as':_0x47d1('0x1b8'),'foreignKey':'SubjectId'});db['VtigerField'][_0x47d1('0x113')](db[_0x47d1('0xc4')],{'as':_0x47d1('0x1bb'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xc4')]['hasMany'](db[_0x47d1('0xc4')],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xc4')][_0x47d1('0x11f')](db[_0x47d1('0x9a')],{'as':_0x47d1('0x9a'),'foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0xc6')][_0x47d1('0x113')](db['ServicenowConfiguration'],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db['ServicenowConfiguration'][_0x47d1('0x113')](db[_0x47d1('0xc9')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0x47d1('0xc9')],{'as':_0x47d1('0x1ba'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0x1c3')][_0x47d1('0x113')](db[_0x47d1('0xc9')],{'as':'Fields','foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0x1c3')][_0x47d1('0x11f')](db[_0x47d1('0xc6')],{'as':'Account','foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xc9')][_0x47d1('0x113')](db[_0x47d1('0xc9')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xc9')][_0x47d1('0x113')](db['ServicenowField'],{'as':'Description','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xc9')][_0x47d1('0x113')](db['ServicenowField'],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xc9')][_0x47d1('0x11f')](db[_0x47d1('0x9a')],{'as':'Variable','foreignKey':_0x47d1('0x1bc')});db['Dynamics365Account'][_0x47d1('0x113')](db[_0x47d1('0xcc')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db['Dynamics365Configuration'][_0x47d1('0x113')](db[_0x47d1('0x1c4')],{'as':_0x47d1('0x1be'),'onDelete':'cascade','foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xcc')]['hasMany'](db[_0x47d1('0x1c4')],{'as':_0x47d1('0x1ba'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xcc')][_0x47d1('0x113')](db[_0x47d1('0x1c4')],{'as':_0x47d1('0x1b2'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b6')});db['Dynamics365Configuration'][_0x47d1('0x11f')](db['Dynamics365Account'],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0x1c4')]['hasMany'](db[_0x47d1('0x1c4')],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0x1c4')]['hasMany'](db[_0x47d1('0x1c4')],{'as':'Description','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0x1c4')]['hasMany'](db['Dynamics365Field'],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0x1c4')]['belongsTo'](db[_0x47d1('0x9a')],{'as':'Variable','foreignKey':_0x47d1('0x1bc')});db['FreshsalesAccount'][_0x47d1('0x113')](db[_0x47d1('0xd0')],{'as':_0x47d1('0x1b3'),'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1b7')});db[_0x47d1('0xd0')][_0x47d1('0x113')](db[_0x47d1('0xd2')],{'as':_0x47d1('0x1be'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xd0')][_0x47d1('0x113')](db[_0x47d1('0xd2')],{'as':'Descriptions','foreignKey':_0x47d1('0x1b5')});db[_0x47d1('0xd0')][_0x47d1('0x113')](db['FreshsalesField'],{'as':_0x47d1('0x1b2'),'foreignKey':_0x47d1('0x1b6')});db['FreshsalesConfiguration'][_0x47d1('0x11f')](db['FreshsalesAccount'],{'as':_0x47d1('0x168'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x47d1('0x113')](db['FreshsalesField'],{'as':_0x47d1('0x1b8'),'foreignKey':_0x47d1('0x1b4')});db[_0x47d1('0xd2')][_0x47d1('0x113')](db[_0x47d1('0xd2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x47d1('0xd2')]['hasMany'](db[_0x47d1('0xd2')],{'as':_0x47d1('0x1b9'),'foreignKey':_0x47d1('0x1b6')});db[_0x47d1('0xd2')]['belongsTo'](db[_0x47d1('0x9a')],{'as':_0x47d1('0x9a'),'foreignKey':_0x47d1('0x1bc')});db[_0x47d1('0x1c5')][_0x47d1('0x11f')](db[_0x47d1('0x69')],{});db[_0x47d1('0x1c5')]['belongsTo'](db['CmList'],{'as':_0x47d1('0x173'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0x1c5')]['belongsTo'](db['CmContact'],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0x1c5')]['belongsTo'](db[_0x47d1('0x6e')],{});db['ChatQueueReport']['belongsTo'](db[_0x47d1('0x6f')],{});db['ChatQueueReport'][_0x47d1('0x11f')](db['User'],{});db[_0x47d1('0x1c5')][_0x47d1('0x11f')](db[_0x47d1('0x72')],{});db[_0x47d1('0xd4')]['belongsTo'](db['User'],{'onDelete':_0x47d1('0x112'),'foreignKey':_0x47d1('0x1c6')});db[_0x47d1('0xd4')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'onDelete':'cascade','foreignKey':_0x47d1('0x1c7')});db[_0x47d1('0xd9')][_0x47d1('0x113')](db[_0x47d1('0xd7')],{'foreignKey':_0x47d1('0x1c8'),'onDelete':_0x47d1('0x112')});db['JscriptySessionReport']['hasMany'](db[_0x47d1('0x1c9')],{'foreignKey':'SessionId','onDelete':_0x47d1('0x112')});db[_0x47d1('0xdb')]['belongsTo'](db[_0x47d1('0x13c')],{});db[_0x47d1('0xdb')][_0x47d1('0x11f')](db[_0x47d1('0xfb')],{'as':'List','foreignKey':'ListId'});db[_0x47d1('0xdb')]['belongsTo'](db[_0x47d1('0x123')],{'as':_0x47d1('0x15a'),'foreignKey':_0x47d1('0x15b')});db[_0x47d1('0xdb')][_0x47d1('0x11f')](db[_0x47d1('0x5b')],{});db[_0x47d1('0xdb')][_0x47d1('0x11f')](db[_0x47d1('0x5d')],{});db['SmsQueueReport'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{});db['SmsQueueReport'][_0x47d1('0x11f')](db[_0x47d1('0x5f')],{});db['JscriptyProject'][_0x47d1('0x113')](db[_0x47d1('0xd9')],{'foreignKey':_0x47d1('0x1ca')});db[_0x47d1('0xdf')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x47d1('0x1ca')});db[_0x47d1('0xdf')][_0x47d1('0x113')](db['JscriptyAnswerReport'],{'foreignKey':_0x47d1('0x1ca')});db[_0x47d1('0xe4')]['belongsToMany'](db[_0x47d1('0x15')],{'as':'Users','through':_0x47d1('0x142')});db[_0x47d1('0xe9')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x127')});db['Team']['belongsToMany'](db[_0x47d1('0x130')],{'through':'TeamVoiceQueue','as':_0x47d1('0x131')});db[_0x47d1('0xe9')][_0x47d1('0x122')](db[_0x47d1('0x41')],{'through':_0x47d1('0x166'),'as':_0x47d1('0x132')});db[_0x47d1('0xe9')][_0x47d1('0x122')](db[_0x47d1('0x72')],{'through':_0x47d1('0x191'),'as':'ChatQueues'});db['Team'][_0x47d1('0x122')](db['FaxQueue'],{'through':_0x47d1('0x17c'),'as':'FaxQueues'});db['Team']['belongsToMany'](db['SmsQueue'],{'through':_0x47d1('0x1cb'),'as':_0x47d1('0x134')});db['Team']['belongsToMany'](db[_0x47d1('0x67')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x47d1('0xe9')][_0x47d1('0x122')](db[_0x47d1('0x10c')],{'through':'team_has_whatsapp_queues','as':_0x47d1('0x136')});db[_0x47d1('0xec')][_0x47d1('0x113')](db['CmHopper'],{'as':_0x47d1('0x14a'),'foreignKey':_0x47d1('0x19a')});db[_0x47d1('0xec')][_0x47d1('0x113')](db['CmHopperFinal'],{'as':_0x47d1('0x14b'),'foreignKey':_0x47d1('0x19a')});db[_0x47d1('0xec')][_0x47d1('0x113')](db[_0x47d1('0x7d')],{'as':_0x47d1('0x14c'),'foreignKey':'CampaignId'});db[_0x47d1('0xec')][_0x47d1('0x113')](db['CmHopperBlack'],{'as':_0x47d1('0x14d'),'foreignKey':_0x47d1('0x19a')});db['Campaign']['belongsTo'](db[_0x47d1('0x2e')],{'as':_0x47d1('0x2e'),'foreignKey':_0x47d1('0x1cc')});db['Campaign'][_0x47d1('0x11f')](db[_0x47d1('0x2e')],{'as':_0x47d1('0x14e'),'foreignKey':'TrunkBackupId'});db[_0x47d1('0xec')]['belongsTo'](db[_0x47d1('0x8b')],{'as':_0x47d1('0x8b'),'foreignKey':_0x47d1('0x17e')});db[_0x47d1('0xec')][_0x47d1('0x11f')](db['SquareProject'],{'as':_0x47d1('0xe4'),'foreignKey':_0x47d1('0x1cd')});db[_0x47d1('0xec')][_0x47d1('0x122')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x125'),'through':'campaigns_has_cm_lists'});db[_0x47d1('0xec')][_0x47d1('0x122')](db[_0x47d1('0xfb')],{'as':_0x47d1('0x154'),'through':_0x47d1('0x1ce')});db[_0x47d1('0xef')][_0x47d1('0x11f')](db[_0x47d1('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0x47d1('0x190')});db[_0x47d1('0xf3')][_0x47d1('0x11f')](db[_0x47d1('0x47')],{});db[_0x47d1('0xf3')][_0x47d1('0x11f')](db['MailInteraction'],{});db[_0x47d1('0xf3')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{'foreignKey':_0x47d1('0x1cf'),'as':_0x47d1('0x1d0')});db[_0x47d1('0xf3')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x47d1('0x1d1')});db['MailTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'foreignKey':_0x47d1('0x1d2'),'as':_0x47d1('0x1d3')});db[_0x47d1('0xf3')][_0x47d1('0x11f')](db['MailQueue'],{'foreignKey':_0x47d1('0x1d4'),'as':_0x47d1('0x1d5')});db[_0x47d1('0xf3')][_0x47d1('0x11f')](db[_0x47d1('0x3f')],{'foreignKey':_0x47d1('0x1d6'),'as':'ToAccount'});db[_0x47d1('0xf5')][_0x47d1('0x11f')](db[_0x47d1('0x6f')],{});db[_0x47d1('0xf5')][_0x47d1('0x11f')](db['ChatInteraction'],{});db[_0x47d1('0xf5')][_0x47d1('0x11f')](db[_0x47d1('0x69')],{'foreignKey':_0x47d1('0x1d7'),'as':_0x47d1('0x1d0')});db['ChatTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'foreignKey':'FromUserId','as':_0x47d1('0x1d1')});db[_0x47d1('0xf5')][_0x47d1('0x11f')](db['User'],{'foreignKey':_0x47d1('0x1d2'),'as':'ToAgent'});db[_0x47d1('0xf5')][_0x47d1('0x11f')](db[_0x47d1('0x72')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x69')],{'foreignKey':_0x47d1('0x1d8'),'as':_0x47d1('0x1d9')});db[_0x47d1('0xf6')][_0x47d1('0x11f')](db[_0x47d1('0x55')],{});db['FaxTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x53')],{});db[_0x47d1('0xf6')][_0x47d1('0x11f')](db[_0x47d1('0x50')],{'foreignKey':_0x47d1('0x1da'),'as':'FromAccount'});db[_0x47d1('0xf6')]['belongsTo'](db['User'],{'foreignKey':_0x47d1('0x1db'),'as':_0x47d1('0x1d1')});db[_0x47d1('0xf6')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'foreignKey':_0x47d1('0x1d2'),'as':_0x47d1('0x1d3')});db[_0x47d1('0xf6')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x47d1('0x1d5')});db['FaxTransferReport']['belongsTo'](db[_0x47d1('0x50')],{'foreignKey':_0x47d1('0x1dc'),'as':_0x47d1('0x1d9')});db['OpenchannelTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x65')],{});db['OpenchannelTransferReport'][_0x47d1('0x11f')](db[_0x47d1('0x64')],{});db[_0x47d1('0xf8')][_0x47d1('0x11f')](db[_0x47d1('0x61')],{'foreignKey':_0x47d1('0x1dd'),'as':_0x47d1('0x1d0')});db[_0x47d1('0xf8')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x47d1('0x1d1')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x47d1('0x1d2'),'as':'ToAgent'});db[_0x47d1('0xf8')]['belongsTo'](db[_0x47d1('0x67')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x47d1('0xf8')][_0x47d1('0x11f')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0x47d1('0x1d9')});db[_0x47d1('0x1de')][_0x47d1('0x11f')](db[_0x47d1('0x5d')],{});db['SmsTransferReport'][_0x47d1('0x11f')](db['SmsInteraction'],{});db[_0x47d1('0x1de')][_0x47d1('0x11f')](db[_0x47d1('0x13c')],{'foreignKey':_0x47d1('0x1df'),'as':'FromAccount'});db[_0x47d1('0x1de')]['belongsTo'](db[_0x47d1('0x15')],{'foreignKey':'FromUserId','as':_0x47d1('0x1d1')});db[_0x47d1('0x1de')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'foreignKey':_0x47d1('0x1d2'),'as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0x47d1('0x5f')],{'foreignKey':_0x47d1('0x1e0'),'as':_0x47d1('0x1d5')});db[_0x47d1('0x1de')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x47d1('0x1e1'),'as':_0x47d1('0x1d9')});db[_0x47d1('0xfb')]['hasMany'](db['Disposition'],{'as':_0x47d1('0x15f'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0xfb')][_0x47d1('0x113')](db['CmCustomField'],{'as':_0x47d1('0x1e2'),'foreignKey':_0x47d1('0x162')});db['CmList'][_0x47d1('0x113')](db[_0x47d1('0x123')],{'as':_0x47d1('0x124'),'onDelete':'cascade','foreignKey':_0x47d1('0x162')});db[_0x47d1('0xfb')][_0x47d1('0x113')](db[_0x47d1('0x7b')],{'as':_0x47d1('0x14b'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0xfb')]['hasMany'](db[_0x47d1('0x7d')],{'as':_0x47d1('0x118'),'foreignKey':'ListId'});db['CmList'][_0x47d1('0x113')](db[_0x47d1('0x7f')],{'as':_0x47d1('0x7f'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0xfb')][_0x47d1('0x122')](db['VoiceQueue'],{'as':_0x47d1('0x1e3'),'through':_0x47d1('0x151')});db[_0x47d1('0xfb')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x126')});db[_0x47d1('0xfc')]['hasMany'](db[_0x47d1('0x1a')],{'as':_0x47d1('0x117'),'onDelete':_0x47d1('0x112')});db['VoicePrefix'][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x1e4')});db[_0x47d1('0xfe')][_0x47d1('0x113')](db[_0x47d1('0x15')],{'as':'Users','foreignKey':_0x47d1('0x120')});db[_0x47d1('0xfe')][_0x47d1('0x113')](db[_0x47d1('0x100')],{'as':_0x47d1('0x1e5'),'foreignKey':_0x47d1('0x120'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x100')][_0x47d1('0x113')](db[_0x47d1('0x101')],{'as':_0x47d1('0x1e6'),'foreignKey':_0x47d1('0x1e7'),'onDelete':_0x47d1('0x112')});db[_0x47d1('0x105')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x47d1('0x1e8')});db['WhatsappAccount'][_0x47d1('0x113')](db[_0x47d1('0x87')],{'as':_0x47d1('0x160'),'foreignKey':'WhatsappAccountId'});db[_0x47d1('0x105')][_0x47d1('0x113')](db[_0x47d1('0x109')],{'as':_0x47d1('0x156'),'foreignKey':'WhatsappAccountId'});db[_0x47d1('0x105')]['hasMany'](db[_0x47d1('0x11c')],{'as':_0x47d1('0x161')});db[_0x47d1('0x105')][_0x47d1('0x113')](db[_0x47d1('0x1e9')],{'as':_0x47d1('0x144')});db[_0x47d1('0x105')][_0x47d1('0x11f')](db['CmList'],{'as':_0x47d1('0x173'),'foreignKey':_0x47d1('0x162')});db[_0x47d1('0x105')][_0x47d1('0x11f')](db[_0x47d1('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x47d1('0x150')});db[_0x47d1('0x105')][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x140')});db[_0x47d1('0x1e9')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'onDelete':_0x47d1('0x171')});db[_0x47d1('0x1e9')][_0x47d1('0x11f')](db[_0x47d1('0x10c')],{'onDelete':_0x47d1('0x171')});db['WhatsappApplication']['belongsTo'](db[_0x47d1('0x105')],{'onDelete':_0x47d1('0x171')});db['WhatsappApplication'][_0x47d1('0x11f')](db[_0x47d1('0x8b')],{'onDelete':_0x47d1('0x171'),'foreignKey':'IntervalId'});db[_0x47d1('0x1e9')][_0x47d1('0x11f')](db['Tag'],{'onDelete':_0x47d1('0x171'),'foreignKey':_0x47d1('0x172')});db['WhatsappInteraction']['hasMany'](db[_0x47d1('0x109')],{'as':'Messages','onDelete':_0x47d1('0x112'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x47d1('0x11f')](db[_0x47d1('0x105')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1e8')});db[_0x47d1('0x11c')][_0x47d1('0x11f')](db['CmContact'],{'as':_0x47d1('0x15a'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x169'),'foreignKey':_0x47d1('0x115')});db[_0x47d1('0x11c')][_0x47d1('0x122')](db['Tag'],{'through':_0x47d1('0x1aa'),'as':_0x47d1('0x16b')});db[_0x47d1('0x11c')][_0x47d1('0x122')](db[_0x47d1('0x16c')],{'through':'whatsapp_interaction_has_tags','as':_0x47d1('0x17a')});db[_0x47d1('0x11c')]['belongsToMany'](db['User'],{'as':_0x47d1('0x16d'),'through':_0x47d1('0x12f'),'foreignKey':_0x47d1('0x1ea')});db[_0x47d1('0x109')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'as':_0x47d1('0x15')});db[_0x47d1('0x109')][_0x47d1('0x11f')](db[_0x47d1('0x123')],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x15a')});db[_0x47d1('0x109')][_0x47d1('0x11f')](db[_0x47d1('0x11c')],{'onDelete':_0x47d1('0x112'),'as':_0x47d1('0x16f'),'foreignKey':_0x47d1('0x1ea')});db[_0x47d1('0x109')][_0x47d1('0x11f')](db[_0x47d1('0x105')],{'as':_0x47d1('0x168'),'foreignKey':_0x47d1('0x1e8')});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db[_0x47d1('0x105')],{});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db[_0x47d1('0x11c')],{});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db[_0x47d1('0x10c')],{});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db[_0x47d1('0x109')],{});db[_0x47d1('0x10a')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{});db[_0x47d1('0x1eb')][_0x47d1('0x11f')](db['WhatsappMessage'],{});db[_0x47d1('0x1eb')][_0x47d1('0x11f')](db[_0x47d1('0x11c')],{});db[_0x47d1('0x1eb')][_0x47d1('0x11f')](db[_0x47d1('0x105')],{'foreignKey':_0x47d1('0x1ec'),'as':_0x47d1('0x1d0')});db[_0x47d1('0x1eb')][_0x47d1('0x11f')](db[_0x47d1('0x105')],{'foreignKey':_0x47d1('0x1ed'),'as':_0x47d1('0x1d9')});db[_0x47d1('0x1eb')]['belongsTo'](db[_0x47d1('0x10c')],{'foreignKey':_0x47d1('0x1ee'),'as':_0x47d1('0x1d5')});db[_0x47d1('0x1eb')][_0x47d1('0x11f')](db[_0x47d1('0x15')],{'foreignKey':_0x47d1('0x1db'),'as':'FromAgent'});db[_0x47d1('0x1eb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x47d1('0x1d3')});db['WhatsappQueue'][_0x47d1('0x122')](db[_0x47d1('0x15')],{'as':_0x47d1('0x152'),'through':_0x47d1('0x137'),'foreignKey':_0x47d1('0x1ef')});db[_0x47d1('0x10c')]['belongsToMany'](db[_0x47d1('0xe9')],{'through':_0x47d1('0x1f0'),'as':_0x47d1('0x153')});module[_0x47d1('0x1f1')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6d97602..5928188 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68c0=['/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/intervals','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./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/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','password','newPassword','apiKey','firstName','street','phone','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','membername','calleridname','calleridnum','vidaooApiKey','clientEmail','secretaccesskey','key','accountSid','localstationid','dsn','registry','isPlainObject','length','isString','replace','}@@','includes','path','express','./errors','./config/logger','api','auth','default','logger','isEmpty','body','\x20body=%s','format','x-forwarded-for','remoteAddress','statusCode','responseTime','user','name','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','method','headers','url','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','/api/voice/calls/reports','./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/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal'];(function(_0x2ad31e,_0x637f3c){var _0xbe631e=function(_0x4d2e77){while(--_0x4d2e77){_0x2ad31e['push'](_0x2ad31e['shift']());}};_0xbe631e(++_0x637f3c);}(_0x68c0,0xc8));var _0x068c=function(_0x3a5fff,_0x527475){_0x3a5fff=_0x3a5fff-0x0;var _0x318aff=_0x68c0[_0x3a5fff];return _0x318aff;};'use strict';var _=require('lodash');var path=require(_0x068c('0x0'));var express=require(_0x068c('0x1'));var ewinston=require('express-winston');var util=require('util');var errors=require(_0x068c('0x2'));var config=require('./config/environment');var logger=require(_0x068c('0x3'))(_0x068c('0x4'));var authLogger=require(_0x068c('0x3'))(_0x068c('0x5'));exports[_0x068c('0x6')]=function(_0x51e3f2){_0x51e3f2['use'](ewinston[_0x068c('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2467c8,_0x4d964b){var _0x34ee09='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x068c('0x8')](_0x2467c8[_0x068c('0x9')])){_0x34ee09+=_0x068c('0xa');var _0x549583=_0x2467c8[_0x068c('0x9')];maskSensitiveData(_0x549583);}return util[_0x068c('0xb')](_0x34ee09,_0x2467c8['method'],_0x2467c8['headers'][_0x068c('0xc')]?_0x2467c8['headers'][_0x068c('0xc')]:_0x2467c8['connection'][_0x068c('0xd')]||_0x2467c8['ip'],_0x2467c8['url'],_0x4d964b[_0x068c('0xe')],_0x4d964b[_0x068c('0xf')],_0x2467c8['user']?_0x2467c8[_0x068c('0x10')]['id']:null,_0x2467c8['user']?_0x2467c8[_0x068c('0x10')][_0x068c('0x11')]:null,_0x2467c8[_0x068c('0x10')]?_0x2467c8[_0x068c('0x10')][_0x068c('0x12')]:null,_0x549583?util[_0x068c('0x13')](_0x549583,![],null):'');}}));_0x51e3f2[_0x068c('0x14')](ewinston[_0x068c('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x475cae,_0x399f66){var _0x206cbc=_0x068c('0x15');if(_0x475cae['body']&&_0x475cae[_0x068c('0x9')][_0x068c('0x16')]&&_0x475cae[_0x068c('0x9')][_0x068c('0x17')]){_0x206cbc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x206cbc,_0x475cae[_0x068c('0x18')],_0x475cae[_0x068c('0x19')][_0x068c('0xc')]?_0x475cae[_0x068c('0x19')][_0x068c('0xc')]:_0x475cae['connection'][_0x068c('0xd')]||_0x475cae['ip'],_0x475cae[_0x068c('0x1a')],_0x399f66['statusCode'],_0x399f66['responseTime'],_0x475cae[_0x068c('0x10')]?_0x475cae[_0x068c('0x10')]['id']:null,_0x475cae[_0x068c('0x10')]?_0x475cae[_0x068c('0x10')][_0x068c('0x11')]:null,_0x475cae[_0x068c('0x10')]?_0x475cae[_0x068c('0x10')][_0x068c('0x12')]:null,_0x475cae['body']&&_0x475cae['body']['device']?_0x475cae['body']['device']:_0x068c('0x1b'),_0x475cae['body']&&_0x475cae[_0x068c('0x9')]['agent_id']?_0x475cae['body'][_0x068c('0x17')]:'',_0x475cae[_0x068c('0x9')]&&_0x475cae[_0x068c('0x9')][_0x068c('0x1c')]?_0x475cae[_0x068c('0x9')][_0x068c('0x1c')]:'');},'ignoreRoute':function(_0x151e08){var _0x5861ab=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5861ab[_0x068c('0x1d')](_0x151e08[_0x068c('0x1a')]);}}));_0x51e3f2[_0x068c('0x14')](_0x068c('0x1e'),require(_0x068c('0x1f')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x20'),require(_0x068c('0x21')));_0x51e3f2[_0x068c('0x14')]('/api/voice/contexts',require(_0x068c('0x22')));_0x51e3f2['use'](_0x068c('0x23'),require(_0x068c('0x24')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x25'),require(_0x068c('0x26')));_0x51e3f2['use']('/api/voice/queues',require('./api/voiceQueue'));_0x51e3f2[_0x068c('0x14')]('/api/voice/recordings',require('./api/voiceRecording'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x27'),require(_0x068c('0x28')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x29'),require('./api/voiceMail'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x2a'),require('./api/voiceMailMessage'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x2b'),require(_0x068c('0x2c')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x2d'),require(_0x068c('0x2e')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x2f'),require(_0x068c('0x30')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x31'),require(_0x068c('0x32')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x33'),require(_0x068c('0x34')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x35'),require(_0x068c('0x36')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x37'),require(_0x068c('0x38')));_0x51e3f2[_0x068c('0x14')]('/api/mail/out_servers',require(_0x068c('0x39')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x3a'),require(_0x068c('0x3b')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x3c'),require(_0x068c('0x3d')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x3e'),require(_0x068c('0x3f')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x40'),require(_0x068c('0x41')));_0x51e3f2[_0x068c('0x14')]('/api/mail/messages',require(_0x068c('0x42')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x43'),require('./api/mailApplication'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x44'),require('./api/mailQueueReport'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x45'),require('./api/dashboard'));_0x51e3f2['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x46'),require(_0x068c('0x47')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x48'),require(_0x068c('0x49')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x4a'),require(_0x068c('0x4b')));_0x51e3f2[_0x068c('0x14')]('/api/fax/messages',require(_0x068c('0x4c')));_0x51e3f2['use']('/api/fax/queues',require(_0x068c('0x4d')));_0x51e3f2['use'](_0x068c('0x4e'),require(_0x068c('0x4f')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x50'),require('./api/smsAccount'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x51'),require(_0x068c('0x52')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x53'),require('./api/smsInteraction'));_0x51e3f2['use'](_0x068c('0x54'),require(_0x068c('0x55')));_0x51e3f2[_0x068c('0x14')]('/api/sms/queues',require(_0x068c('0x56')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x57'),require('./api/openchannelAccount'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x58'),require(_0x068c('0x59')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x5a'),require(_0x068c('0x5b')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x5c'),require(_0x068c('0x5d')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x5e'),require(_0x068c('0x5f')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x60'),require('./api/chatWebsite'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x61'),require('./api/openchannelQueueReport'));_0x51e3f2[_0x068c('0x14')]('/api/chat/applications',require(_0x068c('0x62')));_0x51e3f2['use'](_0x068c('0x63'),require(_0x068c('0x64')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x65'),require(_0x068c('0x66')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x67'),require(_0x068c('0x68')));_0x51e3f2['use'](_0x068c('0x69'),require(_0x068c('0x6a')));_0x51e3f2[_0x068c('0x14')]('/api/chat/groups',require('./api/chatGroup'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x6b'),require('./api/chatProactiveAction'));_0x51e3f2[_0x068c('0x14')]('/api/cm/companies',require(_0x068c('0x6c')));_0x51e3f2['use'](_0x068c('0x6d'),require(_0x068c('0x6e')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x6f'),require('./api/cmHopper'));_0x51e3f2[_0x068c('0x14')]('/api/cm/hopper_black',require(_0x068c('0x70')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x71'),require(_0x068c('0x72')));_0x51e3f2['use'](_0x068c('0x73'),require('./api/cmHopperHistory'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x74'),require(_0x068c('0x75')));_0x51e3f2['use'](_0x068c('0x76'),require('./api/action'));_0x51e3f2[_0x068c('0x14')]('/api/automations',require('./api/automation'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x77'),require(_0x068c('0x78')));_0x51e3f2[_0x068c('0x14')]('/api/dispositions',require(_0x068c('0x79')));_0x51e3f2[_0x068c('0x14')]('/api/conditions',require('./api/condition'));_0x51e3f2['use'](_0x068c('0x7a'),require('./api/interval'));_0x51e3f2['use'](_0x068c('0x7b'),require('./api/pause'));_0x51e3f2['use'](_0x068c('0x7c'),require('./api/cdr'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x7d'),require('./api/voiceQueuesLog'));_0x51e3f2[_0x068c('0x14')]('/api/schedules',require(_0x068c('0x7e')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x7f'),require('./api/sound'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x80'),require(_0x068c('0x81')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x82'),require('./api/template'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x83'),require('./api/trigger'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x84'),require(_0x068c('0x85')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x86'),require(_0x068c('0x87')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x88'),require('./api/integrationReport'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x89'),require(_0x068c('0x8a')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x8b'),require(_0x068c('0x8c')));_0x51e3f2[_0x068c('0x14')]('/api/analytics/extracted_reports',require(_0x068c('0x8d')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x8e'),require(_0x068c('0x8f')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x90'),require(_0x068c('0x91')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x92'),require('./api/analyticTreeReport'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x93'),require(_0x068c('0x94')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x95'),require(_0x068c('0x96')));_0x51e3f2[_0x068c('0x14')]('/api/integrations/salesforce/fields',require(_0x068c('0x97')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x98'),require(_0x068c('0x99')));_0x51e3f2['use'](_0x068c('0x9a'),require(_0x068c('0x9b')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x9c'),require(_0x068c('0x9d')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x9e'),require('./api/intDeskAccount'));_0x51e3f2[_0x068c('0x14')](_0x068c('0x9f'),require('./api/intDeskConfiguration'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xa0'),require(_0x068c('0xa1')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xa2'),require(_0x068c('0xa3')));_0x51e3f2['use']('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x51e3f2['use'](_0x068c('0xa4'),require(_0x068c('0xa5')));_0x51e3f2['use'](_0x068c('0xa6'),require(_0x068c('0xa7')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xa8'),require(_0x068c('0xa9')));_0x51e3f2[_0x068c('0x14')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x51e3f2['use'](_0x068c('0xaa'),require(_0x068c('0xab')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xac'),require(_0x068c('0xad')));_0x51e3f2[_0x068c('0x14')]('/api/integrations/freshdesk/fields',require(_0x068c('0xae')));_0x51e3f2['use'](_0x068c('0xaf'),require(_0x068c('0xb0')));_0x51e3f2['use'](_0x068c('0xb1'),require(_0x068c('0xb2')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xb3'),require(_0x068c('0xb4')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xb5'),require(_0x068c('0xb6')));_0x51e3f2['use'](_0x068c('0xb7'),require(_0x068c('0xb8')));_0x51e3f2[_0x068c('0x14')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x51e3f2['use'](_0x068c('0xb9'),require(_0x068c('0xba')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xbb'),require(_0x068c('0xbc')));_0x51e3f2[_0x068c('0x14')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xbd'),require(_0x068c('0xbe')));_0x51e3f2['use'](_0x068c('0xbf'),require('./api/intFreshsalesConfiguration'));_0x51e3f2[_0x068c('0x14')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x51e3f2[_0x068c('0x14')]('/api/networks',require(_0x068c('0xc0')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xc1'),require(_0x068c('0xc2')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xc3'),require('./api/chatInternalMessage'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xc4'),require(_0x068c('0xc5')));_0x51e3f2[_0x068c('0x14')]('/api/jscripty/questions/reports',require(_0x068c('0xc6')));_0x51e3f2['use'](_0x068c('0xc7'),require(_0x068c('0xc8')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xc9'),require('./api/smsQueueReport'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xca'),require(_0x068c('0xcb')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xcc'),require(_0x068c('0xcd')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xce'),require(_0x068c('0xcf')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xd0'),require(_0x068c('0xd1')));_0x51e3f2['use']('/api/square/odbc',require('./api/squareOdbc'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xd2'),require(_0x068c('0xd3')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xd4'),require('./api/squareRecording'));_0x51e3f2[_0x068c('0x14')]('/api/square/messages',require(_0x068c('0xd5')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xd6'),require(_0x068c('0xd7')));_0x51e3f2[_0x068c('0x14')]('/api/license',require(_0x068c('0xd8')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xd9'),require('./api/campaign'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xda'),require('./api/migration'));_0x51e3f2['use'](_0x068c('0xdb'),require('./api/attachment'));_0x51e3f2[_0x068c('0x14')]('/api/plugins',require(_0x068c('0xdc')));_0x51e3f2['use'](_0x068c('0xdd'),require(_0x068c('0xde')));_0x51e3f2[_0x068c('0x14')]('/api/chat/reports/transfer',require(_0x068c('0xdf')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xe0'),require(_0x068c('0xe1')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xe2'),require(_0x068c('0xe3')));_0x51e3f2['use'](_0x068c('0xe4'),require(_0x068c('0xe5')));_0x51e3f2['use'](_0x068c('0xe6'),require(_0x068c('0xe7')));_0x51e3f2['use'](_0x068c('0xe8'),require('./api/voicePrefix'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xe9'),require(_0x068c('0xea')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xeb'),require(_0x068c('0xec')));_0x51e3f2['use'](_0x068c('0xed'),require(_0x068c('0xee')));_0x51e3f2[_0x068c('0x14')]('/api/userNotifications',require(_0x068c('0xef')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xf0'),require(_0x068c('0xf1')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xf2'),require(_0x068c('0xf3')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xf4'),require(_0x068c('0xf5')));_0x51e3f2[_0x068c('0x14')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x51e3f2[_0x068c('0x14')]('/api/whatsapp/reports/queue',require(_0x068c('0xf6')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xf7'),require('./api/whatsappTransferReport'));_0x51e3f2[_0x068c('0x14')](_0x068c('0xf8'),require(_0x068c('0xf9')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xfa'),require(_0x068c('0xfb')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xfc'),require(_0x068c('0xfd')));_0x51e3f2[_0x068c('0x14')](_0x068c('0xfe'),require(_0x068c('0xff')));_0x51e3f2['use']('/api/auth/google',require(_0x068c('0x100')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x101'),require(_0x068c('0x102')));_0x51e3f2[_0x068c('0x14')]('/api/rpc',require(_0x068c('0x103')));_0x51e3f2[_0x068c('0x14')]('/api/version',require(_0x068c('0x104')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x105'),require(_0x068c('0x106')));_0x51e3f2['use'](_0x068c('0x107'),require(_0x068c('0x108')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x109'),require(_0x068c('0x10a')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x10b'),express[_0x068c('0x10c')](path[_0x068c('0x10d')](config[_0x068c('0x10e')],_0x068c('0x10b'))));_0x51e3f2['use']('/www',express['static'](path[_0x068c('0x10d')](config[_0x068c('0x10e')],_0x068c('0x10f'))));_0x51e3f2[_0x068c('0x14')](_0x068c('0x110'),express[_0x068c('0x10c')](path[_0x068c('0x10d')](config['root'],_0x068c('0x110'))));_0x51e3f2[_0x068c('0x14')](_0x068c('0x111'),express[_0x068c('0x10c')](path['join'](config[_0x068c('0x10e')],'snippet','3.0.0')));_0x51e3f2[_0x068c('0x14')](_0x068c('0x112'),express[_0x068c('0x10c')](path[_0x068c('0x10d')](config['root'],_0x068c('0x113'))));_0x51e3f2[_0x068c('0x114')](_0x068c('0x115'))[_0x068c('0x116')](errors[0x194]);_0x51e3f2[_0x068c('0x114')]('/*')[_0x068c('0x116')](function(_0x192a3d,_0x394b94){_0x394b94[_0x068c('0x117')](path[_0x068c('0x118')](_0x51e3f2[_0x068c('0x116')]('appPath')+'/index.html'));});};var sensitiveFields=['username',_0x068c('0x119'),_0x068c('0x11a'),_0x068c('0x11b'),_0x068c('0x11c'),'lastName',_0x068c('0x11d'),_0x068c('0x11e'),'mobile','fax','email','clientId',_0x068c('0x11f'),_0x068c('0x120'),_0x068c('0x121'),_0x068c('0x122'),_0x068c('0x123'),_0x068c('0x124'),_0x068c('0x125'),_0x068c('0x126'),_0x068c('0x127'),_0x068c('0x128'),_0x068c('0x129'),'consumerSecret',_0x068c('0x12a'),_0x068c('0x12b'),_0x068c('0x12c'),'exten',_0x068c('0x12d'),_0x068c('0x12e'),'privateKey','accesskeyid',_0x068c('0x12f'),_0x068c('0x130'),'user','pass',_0x068c('0x131'),_0x068c('0x132'),_0x068c('0x133'),'secret',_0x068c('0x134'),'oldPassword'];function maskSensitiveData(_0x4e51a7){var _0x1e4b32=/(?!^)[\s\S](?!$)/g;if(!_[_0x068c('0x135')](_0x4e51a7))return;for(var _0x48afba in _0x4e51a7){if(_['isArray'](_0x4e51a7[_0x48afba])){for(var _0x1f729d=0x0;_0x1f729d<_0x4e51a7[_0x48afba][_0x068c('0x136')];_0x1f729d++){maskSensitiveData(_0x4e51a7[_0x48afba][_0x1f729d]);}}else if(_[_0x068c('0x135')](_0x4e51a7[_0x48afba])){maskSensitiveData(_0x4e51a7[_0x48afba]);}else if(_[_0x068c('0x137')](_0x4e51a7[_0x48afba])){_0x4e51a7[_0x48afba]=_0x4e51a7[_0x48afba][_0x068c('0x138')](/{{{/g,'@@{')[_0x068c('0x138')](/}}}/g,_0x068c('0x139'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x068c('0x13a')](sensitiveFields,_0x48afba)){_0x4e51a7[_0x48afba]=_0x4e51a7[_0x48afba][_0x068c('0x138')](_0x1e4b32,'*');}}}} \ No newline at end of file +var _0x3c18=['responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_id','agent_name','use','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./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/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/messages','/api/fax/queues','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/square/odbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/cloudProvider','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','email','clientId','clientSecret','accessKey','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','vidaooApiKey','accesskeyid','key','pass','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express-winston','util','./config/environment','./config/logger','auth','default','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url'];(function(_0x1e49c0,_0x445bc2){var _0x162e0e=function(_0x3736a5){while(--_0x3736a5){_0x1e49c0['push'](_0x1e49c0['shift']());}};_0x162e0e(++_0x445bc2);}(_0x3c18,0x125));var _0x83c1=function(_0x29ec97,_0x23afe8){_0x29ec97=_0x29ec97-0x0;var _0x3ef94e=_0x3c18[_0x29ec97];return _0x3ef94e;};'use strict';var _=require(_0x83c1('0x0'));var path=require(_0x83c1('0x1'));var express=require('express');var ewinston=require(_0x83c1('0x2'));var util=require(_0x83c1('0x3'));var errors=require('./errors');var config=require(_0x83c1('0x4'));var logger=require(_0x83c1('0x5'))('api');var authLogger=require(_0x83c1('0x5'))(_0x83c1('0x6'));exports[_0x83c1('0x7')]=function(_0x395f60){_0x395f60['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x46ee61,_0x2c8d19){var _0x2cbe67='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x83c1('0x8')](_0x46ee61[_0x83c1('0x9')])){_0x2cbe67+=_0x83c1('0xa');var _0x41b886=_0x46ee61[_0x83c1('0x9')];maskSensitiveData(_0x41b886);}return util[_0x83c1('0xb')](_0x2cbe67,_0x46ee61[_0x83c1('0xc')],_0x46ee61[_0x83c1('0xd')][_0x83c1('0xe')]?_0x46ee61[_0x83c1('0xd')][_0x83c1('0xe')]:_0x46ee61[_0x83c1('0xf')][_0x83c1('0x10')]||_0x46ee61['ip'],_0x46ee61[_0x83c1('0x11')],_0x2c8d19['statusCode'],_0x2c8d19[_0x83c1('0x12')],_0x46ee61[_0x83c1('0x13')]?_0x46ee61[_0x83c1('0x13')]['id']:null,_0x46ee61[_0x83c1('0x13')]?_0x46ee61[_0x83c1('0x13')][_0x83c1('0x14')]:null,_0x46ee61[_0x83c1('0x13')]?_0x46ee61[_0x83c1('0x13')][_0x83c1('0x15')]:null,_0x41b886?util[_0x83c1('0x16')](_0x41b886,![],null):'');}}));_0x395f60['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4f47c1,_0x1850a9){var _0x1b3b9a=_0x83c1('0x17');if(_0x4f47c1[_0x83c1('0x9')]&&_0x4f47c1[_0x83c1('0x9')][_0x83c1('0x18')]&&_0x4f47c1[_0x83c1('0x9')]['agent_id']){_0x1b3b9a=_0x83c1('0x19');}return util['format'](_0x1b3b9a,_0x4f47c1[_0x83c1('0xc')],_0x4f47c1['headers']['x-forwarded-for']?_0x4f47c1[_0x83c1('0xd')][_0x83c1('0xe')]:_0x4f47c1[_0x83c1('0xf')][_0x83c1('0x10')]||_0x4f47c1['ip'],_0x4f47c1[_0x83c1('0x11')],_0x1850a9['statusCode'],_0x1850a9[_0x83c1('0x12')],_0x4f47c1[_0x83c1('0x13')]?_0x4f47c1[_0x83c1('0x13')]['id']:null,_0x4f47c1[_0x83c1('0x13')]?_0x4f47c1['user'][_0x83c1('0x14')]:null,_0x4f47c1[_0x83c1('0x13')]?_0x4f47c1[_0x83c1('0x13')]['role']:null,_0x4f47c1[_0x83c1('0x9')]&&_0x4f47c1[_0x83c1('0x9')]['device']?_0x4f47c1[_0x83c1('0x9')][_0x83c1('0x18')]:_0x83c1('0x1a'),_0x4f47c1[_0x83c1('0x9')]&&_0x4f47c1[_0x83c1('0x9')][_0x83c1('0x1b')]?_0x4f47c1[_0x83c1('0x9')][_0x83c1('0x1b')]:'',_0x4f47c1['body']&&_0x4f47c1[_0x83c1('0x9')][_0x83c1('0x1c')]?_0x4f47c1['body'][_0x83c1('0x1c')]:'');},'ignoreRoute':function(_0x46143d){var _0x54ebfa=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x54ebfa['test'](_0x46143d[_0x83c1('0x11')]);}}));_0x395f60[_0x83c1('0x1d')]('/api/users',require(_0x83c1('0x1e')));_0x395f60[_0x83c1('0x1d')]('/api/voice/chanspy',require(_0x83c1('0x1f')));_0x395f60['use']('/api/voice/contexts',require(_0x83c1('0x20')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x21'),require(_0x83c1('0x22')));_0x395f60[_0x83c1('0x1d')]('/api/voice/mohs',require(_0x83c1('0x23')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x24'),require(_0x83c1('0x25')));_0x395f60['use'](_0x83c1('0x26'),require(_0x83c1('0x27')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x28'),require(_0x83c1('0x29')));_0x395f60[_0x83c1('0x1d')]('/api/voice/mails',require(_0x83c1('0x2a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x2b'),require(_0x83c1('0x2c')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x2d'),require(_0x83c1('0x2e')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x2f'),require(_0x83c1('0x30')));_0x395f60['use'](_0x83c1('0x31'),require(_0x83c1('0x32')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x33'),require(_0x83c1('0x34')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x35'),require(_0x83c1('0x36')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x37'),require(_0x83c1('0x38')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x39'),require(_0x83c1('0x3a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x3b'),require(_0x83c1('0x3c')));_0x395f60[_0x83c1('0x1d')]('/api/mail/accounts',require(_0x83c1('0x3d')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x3e'),require('./api/mailQueue'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x3f'),require(_0x83c1('0x40')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x41'),require(_0x83c1('0x42')));_0x395f60['use'](_0x83c1('0x43'),require('./api/mailMessage'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x44'),require(_0x83c1('0x45')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x46'),require('./api/mailQueueReport'));_0x395f60['use'](_0x83c1('0x47'),require(_0x83c1('0x48')));_0x395f60[_0x83c1('0x1d')]('/api/dashboards/items',require('./api/dashboardItem'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x49'),require(_0x83c1('0x4a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x4b'),require(_0x83c1('0x4c')));_0x395f60[_0x83c1('0x1d')]('/api/fax/interactions',require('./api/faxInteraction'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x4d'),require('./api/faxMessage'));_0x395f60['use'](_0x83c1('0x4e'),require('./api/faxQueue'));_0x395f60[_0x83c1('0x1d')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x4f'),require('./api/smsAccount'));_0x395f60[_0x83c1('0x1d')]('/api/sms/applications',require(_0x83c1('0x50')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x51'),require(_0x83c1('0x52')));_0x395f60['use'](_0x83c1('0x53'),require('./api/smsMessage'));_0x395f60[_0x83c1('0x1d')]('/api/sms/queues',require(_0x83c1('0x54')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x55'),require(_0x83c1('0x56')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x57'),require(_0x83c1('0x58')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x59'),require(_0x83c1('0x5a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x5b'),require(_0x83c1('0x5c')));_0x395f60['use']('/api/openchannel/queues',require(_0x83c1('0x5d')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x5e'),require('./api/chatWebsite'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x5f'),require(_0x83c1('0x60')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x61'),require(_0x83c1('0x62')));_0x395f60['use'](_0x83c1('0x63'),require(_0x83c1('0x64')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x65'),require(_0x83c1('0x66')));_0x395f60[_0x83c1('0x1d')]('/api/chat/offline_messages',require(_0x83c1('0x67')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x68'),require(_0x83c1('0x69')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x6a'),require(_0x83c1('0x6b')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x6c'),require('./api/chatProactiveAction'));_0x395f60['use'](_0x83c1('0x6d'),require(_0x83c1('0x6e')));_0x395f60[_0x83c1('0x1d')]('/api/cm/contacts',require(_0x83c1('0x6f')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x70'),require(_0x83c1('0x71')));_0x395f60['use'](_0x83c1('0x72'),require('./api/cmHopperBlack'));_0x395f60[_0x83c1('0x1d')]('/api/cm/hopper_final',require(_0x83c1('0x73')));_0x395f60['use']('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x74'),require('./api/cmCustomField'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x75'),require(_0x83c1('0x76')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x77'),require(_0x83c1('0x78')));_0x395f60['use'](_0x83c1('0x79'),require(_0x83c1('0x7a')));_0x395f60['use'](_0x83c1('0x7b'),require('./api/disposition'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x7c'),require(_0x83c1('0x7d')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x7e'),require('./api/interval'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x7f'),require(_0x83c1('0x80')));_0x395f60['use']('/api/cdr',require(_0x83c1('0x81')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x82'),require(_0x83c1('0x83')));_0x395f60['use'](_0x83c1('0x84'),require('./api/schedule'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x85'),require(_0x83c1('0x86')));_0x395f60['use'](_0x83c1('0x87'),require('./api/tag'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x88'),require('./api/template'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x89'),require(_0x83c1('0x8a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x8b'),require(_0x83c1('0x8c')));_0x395f60['use'](_0x83c1('0x8d'),require(_0x83c1('0x8e')));_0x395f60[_0x83c1('0x1d')]('/api/integrations/reports',require('./api/integrationReport'));_0x395f60['use']('/api/analytics/custom_reports',require(_0x83c1('0x8f')));_0x395f60['use']('/api/analytics/default_reports',require(_0x83c1('0x90')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x91'),require(_0x83c1('0x92')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x93'),require(_0x83c1('0x94')));_0x395f60['use'](_0x83c1('0x95'),require(_0x83c1('0x96')));_0x395f60['use'](_0x83c1('0x97'),require(_0x83c1('0x98')));_0x395f60[_0x83c1('0x1d')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x99'),require(_0x83c1('0x9a')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x9b'),require(_0x83c1('0x9c')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x9d'),require('./api/intSugarcrmAccount'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x9e'),require(_0x83c1('0x9f')));_0x395f60['use'](_0x83c1('0xa0'),require(_0x83c1('0xa1')));_0x395f60['use']('/api/integrations/desk/accounts',require(_0x83c1('0xa2')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xa3'),require('./api/intDeskConfiguration'));_0x395f60['use'](_0x83c1('0xa4'),require(_0x83c1('0xa5')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xa6'),require(_0x83c1('0xa7')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xa8'),require(_0x83c1('0xa9')));_0x395f60['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xaa'),require('./api/intZendeskAccount'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xab'),require(_0x83c1('0xac')));_0x395f60['use'](_0x83c1('0xad'),require('./api/intZendeskField'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xae'),require('./api/intFreshdeskAccount'));_0x395f60['use']('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x395f60['use'](_0x83c1('0xaf'),require(_0x83c1('0xb0')));_0x395f60['use'](_0x83c1('0xb1'),require('./api/intVtigerAccount'));_0x395f60[_0x83c1('0x1d')]('/api/integrations/vtiger/configurations',require(_0x83c1('0xb2')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xb3'),require(_0x83c1('0xb4')));_0x395f60[_0x83c1('0x1d')]('/api/integrations/servicenow/accounts',require(_0x83c1('0xb5')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xb6'),require(_0x83c1('0xb7')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xb8'),require('./api/intServicenowField'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xb9'),require(_0x83c1('0xba')));_0x395f60['use']('/api/integrations/dynamics365/configurations',require(_0x83c1('0xbb')));_0x395f60['use']('/api/integrations/dynamics365/fields',require(_0x83c1('0xbc')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xbd'),require(_0x83c1('0xbe')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xbf'),require(_0x83c1('0xc0')));_0x395f60['use']('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xc1'),require(_0x83c1('0xc2')));_0x395f60[_0x83c1('0x1d')]('/api/chat/reports/queue',require(_0x83c1('0xc3')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xc4'),require('./api/chatInternalMessage'));_0x395f60[_0x83c1('0x1d')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xc5'),require(_0x83c1('0xc6')));_0x395f60[_0x83c1('0x1d')]('/api/jscripty/sessions/reports',require(_0x83c1('0xc7')));_0x395f60[_0x83c1('0x1d')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xc8'),require(_0x83c1('0xc9')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xca'),require('./api/squareReportDetail'));_0x395f60[_0x83c1('0x1d')]('/api/jscripty/projects',require(_0x83c1('0xcb')));_0x395f60[_0x83c1('0x1d')]('/api/settings',require('./api/setting'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xcc'),require('./api/squareOdbc'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xcd'),require('./api/squareProject'));_0x395f60['use'](_0x83c1('0xce'),require(_0x83c1('0xcf')));_0x395f60[_0x83c1('0x1d')]('/api/square/messages',require(_0x83c1('0xd0')));_0x395f60['use'](_0x83c1('0xd1'),require(_0x83c1('0xd2')));_0x395f60['use'](_0x83c1('0xd3'),require(_0x83c1('0xd4')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xd5'),require(_0x83c1('0xd6')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xd7'),require('./api/migration'));_0x395f60['use'](_0x83c1('0xd8'),require('./api/attachment'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xd9'),require(_0x83c1('0xda')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xdb'),require(_0x83c1('0xdc')));_0x395f60[_0x83c1('0x1d')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x395f60['use'](_0x83c1('0xdd'),require(_0x83c1('0xde')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xdf'),require(_0x83c1('0xe0')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xe1'),require(_0x83c1('0xe2')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xe3'),require(_0x83c1('0xe4')));_0x395f60[_0x83c1('0x1d')]('/api/voice/prefixes',require(_0x83c1('0xe5')));_0x395f60[_0x83c1('0x1d')]('/api/userProfiles',require(_0x83c1('0xe6')));_0x395f60['use'](_0x83c1('0xe7'),require('./api/userProfileSection'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xe8'),require(_0x83c1('0xe9')));_0x395f60['use'](_0x83c1('0xea'),require(_0x83c1('0xeb')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xec'),require('./api/whatsappAccount'));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xed'),require(_0x83c1('0xee')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xef'),require(_0x83c1('0xf0')));_0x395f60[_0x83c1('0x1d')]('/api/whatsapp/messages',require(_0x83c1('0xf1')));_0x395f60[_0x83c1('0x1d')]('/api/whatsapp/reports/queue',require(_0x83c1('0xf2')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xf3'),require(_0x83c1('0xf4')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xf5'),require('./api/whatsappQueue'));_0x395f60['use']('/api/cloudProviders',require(_0x83c1('0xf6')));_0x395f60['use']('/api/realtime',require('./api/realtime'));_0x395f60['use'](_0x83c1('0xf7'),require(_0x83c1('0xf8')));_0x395f60[_0x83c1('0x1d')]('/api/auth/google',require(_0x83c1('0xf9')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xfa'),require(_0x83c1('0xfb')));_0x395f60['use'](_0x83c1('0xfc'),require(_0x83c1('0xfd')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0xfe'),require(_0x83c1('0xff')));_0x395f60[_0x83c1('0x1d')]('/api/system',require('./api/system'));_0x395f60[_0x83c1('0x1d')]('/api/pm2',require(_0x83c1('0x100')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x101'),require(_0x83c1('0x102')));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x103'),express[_0x83c1('0x104')](path[_0x83c1('0x105')](config[_0x83c1('0x106')],'/apidoc')));_0x395f60['use'](_0x83c1('0x107'),express[_0x83c1('0x104')](path[_0x83c1('0x105')](config[_0x83c1('0x106')],_0x83c1('0x107'))));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x108'),express[_0x83c1('0x104')](path[_0x83c1('0x105')](config[_0x83c1('0x106')],_0x83c1('0x108'))));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x109'),express[_0x83c1('0x104')](path[_0x83c1('0x105')](config['root'],'snippet',_0x83c1('0x10a'))));_0x395f60[_0x83c1('0x1d')](_0x83c1('0x10b'),express[_0x83c1('0x104')](path[_0x83c1('0x105')](config['root'],_0x83c1('0x10c'))));_0x395f60[_0x83c1('0x10d')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x83c1('0x10e')](errors[0x194]);_0x395f60[_0x83c1('0x10d')]('/*')[_0x83c1('0x10e')](function(_0x2105b9,_0x14cdfa){_0x14cdfa[_0x83c1('0x10f')](path['resolve'](_0x395f60[_0x83c1('0x10e')]('appPath')+_0x83c1('0x110')));});};var sensitiveFields=[_0x83c1('0x111'),_0x83c1('0x112'),_0x83c1('0x113'),_0x83c1('0x114'),_0x83c1('0x115'),_0x83c1('0x116'),_0x83c1('0x117'),'phone','mobile','fax',_0x83c1('0x118'),_0x83c1('0x119'),_0x83c1('0x11a'),'securityToken','code',_0x83c1('0x11b'),'tenantId',_0x83c1('0x11c'),_0x83c1('0x11d'),_0x83c1('0x11e'),_0x83c1('0x11f'),_0x83c1('0x120'),_0x83c1('0x121'),_0x83c1('0x122'),_0x83c1('0x123'),_0x83c1('0x124'),'calleridnum',_0x83c1('0x125'),_0x83c1('0x126'),'clientEmail','privateKey',_0x83c1('0x127'),'secretaccesskey',_0x83c1('0x128'),_0x83c1('0x13'),_0x83c1('0x129'),_0x83c1('0x12a'),_0x83c1('0x12b'),_0x83c1('0x12c'),'secret',_0x83c1('0x12d'),_0x83c1('0x12e')];function maskSensitiveData(_0x552f71){var _0x4c7f71=/(?!^)[\s\S](?!$)/g;if(!_[_0x83c1('0x12f')](_0x552f71))return;for(var _0x551ca1 in _0x552f71){if(_[_0x83c1('0x130')](_0x552f71[_0x551ca1])){for(var _0x10dfec=0x0;_0x10dfec<_0x552f71[_0x551ca1][_0x83c1('0x131')];_0x10dfec++){maskSensitiveData(_0x552f71[_0x551ca1][_0x10dfec]);}}else if(_[_0x83c1('0x12f')](_0x552f71[_0x551ca1])){maskSensitiveData(_0x552f71[_0x551ca1]);}else if(_[_0x83c1('0x132')](_0x552f71[_0x551ca1])){_0x552f71[_0x551ca1]=_0x552f71[_0x551ca1][_0x83c1('0x133')](/{{{/g,_0x83c1('0x134'))['replace'](/}}}/g,_0x83c1('0x135'))[_0x83c1('0x133')](/{{/g,'@{')[_0x83c1('0x133')](/}}/g,'}@');if(_[_0x83c1('0x136')](sensitiveFields,_0x551ca1)){_0x552f71[_0x551ca1]=_0x552f71[_0x551ca1][_0x83c1('0x133')](_0x4c7f71,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 8021361..a347431 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdce=['port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.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/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc'];(function(_0x31cdff,_0x545438){var _0x14091f=function(_0x363721){while(--_0x363721){_0x31cdff['push'](_0x31cdff['shift']());}};_0x14091f(++_0x545438);}(_0xbdce,0xd3));var _0xebdc=function(_0x657a68,_0x4ef12e){_0x657a68=_0x657a68-0x0;var _0x483b44=_0xbdce[_0x657a68];return _0x483b44;};'use strict';var jayson=require(_0xebdc('0x0'));var BPromise=require(_0xebdc('0x1'));var _=require(_0xebdc('0x2'));var config=require(_0xebdc('0x3'));exports[_0xebdc('0x4')]=function(){return new BPromise(function(_0x117177,_0x33fe4e){var _0x30cbbd={};_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/user/user.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x6')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/voiceQueue/voiceQueue.rpc'));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x7')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x8')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x9')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/memberReport/memberReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0xa')));_0x30cbbd=_['merge'](_0x30cbbd,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0xb')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0xc')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0xd')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0xe')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0xf')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x10')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/mailApplication/mailApplication.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x11')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/faxAccount/faxAccount.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x12')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x13')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x14')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x15')));_0x30cbbd=_['merge'](_0x30cbbd,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/smsAccount/smsAccount.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/smsInteraction/smsInteraction.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/smsMessage/smsMessage.rpc'));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x16')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x17')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x18')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x19')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1a')));_0x30cbbd=_['merge'](_0x30cbbd,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1b')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1c')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/chatQueue/chatQueue.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1d')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1e')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x1f')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x20')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x21')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x22')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x23')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x24')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x25')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x26')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x27')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/variable/variable.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x28')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x29')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x2a')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x2b')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x2c')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x2d')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x2e')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x2f')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x30')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x31')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/squareReport/squareReport.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x32')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x33')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x34')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/squareRecording/squareRecording.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x35')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x36')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x37')));_0x30cbbd=_['merge'](_0x30cbbd,require(_0xebdc('0x38')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x39')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require(_0xebdc('0x3a')));_0x30cbbd=_[_0xebdc('0x5')](_0x30cbbd,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0xd709f5=jayson[_0xebdc('0x3b')](_0x30cbbd)['http']();var _0x2b71fd=config[_0xebdc('0x3c')][_0xebdc('0x3d')]||config[_0xebdc('0x3d')]+0x1;var _0x2757ec=config['rpc']['ip']||_0xebdc('0x3e');_0xd709f5['on'](_0xebdc('0x3f'),function(_0x3aa2d5){return _0x33fe4e(_0x3aa2d5);});_0xd709f5[_0xebdc('0x4')](_0x2b71fd,_0x2757ec,function(){console['log'](_0xebdc('0x40'),_0x2757ec,_0x2b71fd);require(_0xebdc('0x41'))[_0xebdc('0x42')]();return _0x117177(_0xebdc('0x43')+_0x2757ec+':'+_0x2b71fd);});});}; \ No newline at end of file +var _0xa7a9=['../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc'];(function(_0x295245,_0x110169){var _0x3d166a=function(_0x361a6c){while(--_0x361a6c){_0x295245['push'](_0x295245['shift']());}};_0x3d166a(++_0x110169);}(_0xa7a9,0x149));var _0x9a7a=function(_0x2d1635,_0x2392a2){_0x2d1635=_0x2d1635-0x0;var _0x288716=_0xa7a9[_0x2d1635];return _0x288716;};'use strict';var jayson=require(_0x9a7a('0x0'));var BPromise=require('bluebird');var _=require(_0x9a7a('0x1'));var config=require(_0x9a7a('0x2'));exports['listen']=function(){return new BPromise(function(_0x34d736,_0x45c7eb){var _0x5b0ca3={};_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x4')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x5')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/voiceQueue/voiceQueue.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/voiceRecording/voiceRecording.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x6')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x7')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/memberReport/memberReport.rpc'));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x8')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x9')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0xa')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0xb')));_0x5b0ca3=_['merge'](_0x5b0ca3,require('../api/mailQueue/mailQueue.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/mailInteraction/mailInteraction.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0xc')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/mailApplication/mailApplication.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0xd')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/faxAccount/faxAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/faxApplication/faxApplication.rpc'));_0x5b0ca3=_['merge'](_0x5b0ca3,require('../api/faxInteraction/faxInteraction.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0xe')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0xf')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x10')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x11')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x12')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x13')));_0x5b0ca3=_['merge'](_0x5b0ca3,require('../api/smsQueue/smsQueue.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x14')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x15')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x16')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x17')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x18')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x19')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x1a')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/cmContact/cmContact.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x1b')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x1c')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x1d')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x1e')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x1f')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x20')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x21')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x22')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x23')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x24')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x25')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x26')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x27')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x28')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x29')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x2a')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x2b')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/setting/setting.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x2c')));_0x5b0ca3=_['merge'](_0x5b0ca3,require('../api/squareProject/squareProject.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/squareRecording/squareRecording.rpc'));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x2d')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x2e')));_0x5b0ca3=_['merge'](_0x5b0ca3,require(_0x9a7a('0x2f')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x30')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x31')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x32')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x33')));_0x5b0ca3=_[_0x9a7a('0x3')](_0x5b0ca3,require(_0x9a7a('0x34')));var _0x32040d=jayson['server'](_0x5b0ca3)[_0x9a7a('0x35')]();var _0xd799c6=config[_0x9a7a('0x36')][_0x9a7a('0x37')]||config[_0x9a7a('0x37')]+0x1;var _0x35b558=config[_0x9a7a('0x36')]['ip']||_0x9a7a('0x38');_0x32040d['on']('error',function(_0x24b4ba){return _0x45c7eb(_0x24b4ba);});_0x32040d[_0x9a7a('0x39')](_0xd799c6,_0x35b558,function(){console['log'](_0x9a7a('0x3a'),_0x35b558,_0xd799c6);require(_0x9a7a('0x3b'))[_0x9a7a('0x3c')]();return _0x34d736('RPC\x20listening\x20on\x20'+_0x35b558+':'+_0xd799c6);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 60a1e98..58cdd33 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 _0x80d3=['RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','events','EventEmitter','setEncoding','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','function','substring','no\x20code','replace','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','answer','ANSWER','beep','format','exec','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP'];(function(_0x4d0810,_0x13e15f){var _0x3e47e0=function(_0x202853){while(--_0x202853){_0x4d0810['push'](_0x4d0810['shift']());}};_0x3e47e0(++_0x13e15f);}(_0x80d3,0x122));var _0x380d=function(_0x80ba9d,_0x476f63){_0x80ba9d=_0x80ba9d-0x0;var _0x58ddb5=_0x80d3[_0x80ba9d];return _0x58ddb5;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x380d('0x0'))[_0x380d('0x1')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x55dd26){var _0x1057f2=this,_0x516d0c=new AGIReply(),_0x4d515a=![],_0x4a9c79={};EventEmitter['call'](_0x1057f2);_0x55dd26[_0x380d('0x2')]('utf8');_0x55dd26['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x516d0c[_0x380d('0x2')](_0x380d('0x3'));_0x516d0c['on']('headers',function(_0x13f08a){for(var _0x11a738 in _0x13f08a){_0x1057f2[_0x11a738]=_0x13f08a[_0x11a738];}_0x1057f2[_0x380d('0x4')](_0x380d('0x5'));});_0x516d0c['on'](_0x380d('0x6'),function(_0x5bd9ff){if(_0x5bd9ff[_0x380d('0x7')]()==_0x380d('0x8')){_0x1057f2[_0x380d('0x4')](_0x380d('0x8'));return;}if(_0x5bd9ff['substring'](0x0,0xb)==_0x380d('0x9')){_0x4d515a=!![];}if(_0x4d515a){_0x4a9c79['rx']+=_0x5bd9ff+'\x0a';if(_0x5bd9ff['search']('520\x20End\x20of\x20proper')!=-0x1){_0x4d515a=![];}}else{_0x4a9c79['rx']=_0x5bd9ff;}if(_0x4d515a){return;}if(typeof _0x4a9c79['cb']==_0x380d('0xa')){var _0x9d3f09=_0x4a9c79['rx'][_0x380d('0xb')](0x0,0x3),_0x47e862=null,_0xde7ea3=null;_0x9d3f09=parseInt(_0x9d3f09);if(isNaN(_0x9d3f09)){_0x4a9c79['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x380d('0xc')});return;}if(_0x9d3f09!=0xc8){_0x4a9c79['cb'](null,{'code':_0x9d3f09,'result':-0x1,'extra':'KO'});return;}_0x47e862=_0x4a9c79['rx']['substring'](0x4)[_0x380d('0xd')]('result=','');if(_0x47e862['indexOf']('\x20')!=-0x1){_0x47e862=_0x47e862[_0x380d('0xe')](0x0,_0x47e862['indexOf']('\x20'));}if(_[_0x380d('0xf')](_0x47e862,'-1')){_0x47e862=parseInt(_0x47e862);}_0xde7ea3=_0x4a9c79['rx'][_0x380d('0x10')]('\x20');if(_0xde7ea3[_0x380d('0x11')]==0x3){_0xde7ea3=_0xde7ea3[0x2][_0x380d('0xb')](0x1,_0xde7ea3[0x2]['length']-0x1);}else if(_0xde7ea3[_0x380d('0x11')]>0x3){var _0x3e9af2=/\((.+)\)/;var _0x3fe81a=_0x4a9c79['rx'][_0x380d('0x12')](_0x3e9af2);if(_0x3fe81a){_0xde7ea3=_0x3fe81a[0x1];}else{_0xde7ea3=null;}}else{_0xde7ea3=null;}_0x4a9c79['cb'](null,{'code':_0x9d3f09,'result':_0x47e862,'extra':_0xde7ea3});}});_0x55dd26['on']('error',function(_0x595a22){_0x1057f2[_0x380d('0x4')](_0x380d('0x13'),new AGIError(_0x380d('0x14'),_0x595a22[_0x380d('0x15')]));});_0x55dd26['on'](_0x380d('0x16'),function(){_0x1057f2['emit'](_0x380d('0x16'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x55dd26['on'](_0x380d('0x17'),function(){_0x1057f2[_0x380d('0x4')](_0x380d('0x17'),new AGIError(_0x380d('0x18')));_0x55dd26[_0x380d('0x19')]();});_0x55dd26[_0x380d('0x1a')](_0x516d0c);this[_0x380d('0x1b')]=function(_0x1d15cb,_0x52f104){var _0x1d15cb=_0x1d15cb||'',_0x52f104=typeof _0x52f104==_0x380d('0xa')?_0x52f104:new Function();_0x4a9c79={'tx':_0x1d15cb,'rx':'','cb':_0x52f104};_0x55dd26[_0x380d('0x1c')](_0x1d15cb+'\x0a');},this['close']=function(){_0x55dd26[_0x380d('0x19')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x380d('0x1d')][_0x380d('0x1e')]=function(_0x56aebe){return this[_0x380d('0x1b')][_0x380d('0x1f')](this,_0x56aebe);};AGIChannel['prototype'][_0x380d('0x20')]=function(){return this[_0x380d('0x1e')](_0x380d('0x21'));};AGIChannel['prototype']['getData']=function(_0x18aa4d,_0x33e7c6,_0x203a25){_0x18aa4d=_0x18aa4d===undefined?_0x380d('0x22'):_0x18aa4d;_0x33e7c6=_0x33e7c6===undefined?'5':_0x33e7c6;_0x203a25=_0x203a25===undefined?'1':_0x203a25;return this[_0x380d('0x1e')](util[_0x380d('0x23')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x18aa4d,_0x33e7c6*0x3e8,_0x203a25));};AGIChannel[_0x380d('0x1d')]['noop']=function(_0x5e2b5c){_0x5e2b5c=_0x5e2b5c||'NO\x20MESSAGE';return this[_0x380d('0x1e')](util[_0x380d('0x23')]('VERBOSE\x20\x22%s\x22',_0x5e2b5c));};AGIChannel[_0x380d('0x1d')][_0x380d('0x24')]=function(_0x1d6acc,_0x43e533){if(_['isArray'](_0x43e533)){return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x25'),_0x1d6acc,_0x43e533[_0x380d('0x26')](',')));}return this['sendRequest'](util[_0x380d('0x23')](_0x380d('0x25'),_0x1d6acc,_0x43e533));};AGIChannel[_0x380d('0x1d')][_0x380d('0x27')]=function(_0xe5b493){return this['sendRequest'](util[_0x380d('0x23')]('SET\x20CONTEXT\x20%s',_0xe5b493));};AGIChannel[_0x380d('0x1d')][_0x380d('0x28')]=function(_0x225bed){return this[_0x380d('0x1e')](util['format'](_0x380d('0x29'),_0x225bed));};AGIChannel[_0x380d('0x1d')][_0x380d('0x2a')]=function(_0x3d4d66){return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x2b'),_0x3d4d66));};AGIChannel[_0x380d('0x1d')][_0x380d('0x8')]=function(){return this[_0x380d('0x1e')](_0x380d('0x2c'));};AGIChannel[_0x380d('0x1d')][_0x380d('0x2d')]=function(_0x38645e,_0x5824d5){var _0x475579=_[_0x380d('0x2e')](_0x5824d5)||_['isNumber'](_0x5824d5)?_0x5824d5[_0x380d('0x2f')]():_0x5824d5;return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x30'),_0x38645e,_0x475579?_0x475579[_0x380d('0x2f')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x380d('0x1d')][_0x380d('0x31')]=function(_0x34ac98,_0x911d5a){return this[_0x380d('0x1e')](util[_0x380d('0x23')]('SAY\x20NUMBER\x20%s\x20%s',_0x34ac98,_0x911d5a));};AGIChannel[_0x380d('0x1d')][_0x380d('0x32')]=function(_0x5b7de2,_0x41aa01){return this['sendRequest'](util[_0x380d('0x23')](_0x380d('0x33'),_0x5b7de2,_0x41aa01));};AGIChannel[_0x380d('0x1d')][_0x380d('0x34')]=function(_0x2d7f93,_0x802853){return this[_0x380d('0x1e')](util[_0x380d('0x23')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2d7f93,_0x802853));};AGIChannel['prototype'][_0x380d('0x35')]=function(_0x25de60,_0x2a26cd,_0x5065f4){_0x2a26cd=_0x2a26cd||this[_0x380d('0x36')];_0x5065f4=_0x5065f4||0x1;this[_0x380d('0x27')](_0x25de60);this[_0x380d('0x28')](_0x2a26cd);this['setPriority'](_0x5065f4);return this['noop'](util[_0x380d('0x23')](_0x380d('0x37'),_0x25de60,_0x2a26cd,_0x5065f4));};AGIChannel[_0x380d('0x1d')]['getVariable']=function(_0x215cd1){return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x38'),_0x215cd1));};AGIChannel[_0x380d('0x1d')][_0x380d('0x39')]=function(_0xe68ce6,_0x41adec,_0x63a66,_0x4484ef,_0x50cb46,_0x47d184){_0x41adec=_0x41adec||_0x380d('0x3a');_0x63a66=_0x63a66||'';_0x4484ef=_0x4484ef===undefined?-0x1:_0x4484ef==='-1'?-0x1:_0x4484ef*0x3e8;_0x50cb46=_0x50cb46===undefined?'':'s='+_0x50cb46;_0x47d184=_0x47d184?_0x380d('0x3b'):'';return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x3c'),_0xe68ce6,_0x41adec,_0x63a66,_0x4484ef,_0x47d184,_0x50cb46));};AGIChannel['prototype'][_0x380d('0x3d')]=function(_0x5bc118,_0x175009){_0x175009=_0x175009||'';return this[_0x380d('0x1e')](util[_0x380d('0x23')](_0x380d('0x3e'),_0x5bc118,_0x175009));};AGIChannel['prototype'][_0x380d('0x3f')]=function(_0x16ec4b){return this[_0x380d('0x24')](_0x380d('0x40'),_0x16ec4b);};AGIChannel['prototype'][_0x380d('0x41')]=function(_0x50e6a8){return this[_0x380d('0x24')](_0x380d('0x42'),_0x50e6a8);};AGIChannel[_0x380d('0x1d')][_0x380d('0x13')]=function(_0x24ce1e,_0x11bbc2){this[_0x380d('0x43')](util[_0x380d('0x23')](_0x380d('0x44'),_0x24ce1e['id'],_0x24ce1e['label'],_0x11bbc2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x380d('0x45')]=AGIChannel; \ No newline at end of file +var _0xb6d4=['EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','hangup','substring','520-Invalid','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','prototype','sendRequest','answer','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','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','exec','AGI','wait','WAIT','label','exports','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb6d4,0x16c));var _0x4b6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6d4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4b6d('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x4b6d('0x1')];var AGIReply=require(_0x4b6d('0x2'));var AGIError=require(_0x4b6d('0x3'));function AGIChannel(_0x81831a){var _0x1914a0=this,_0x598386=new AGIReply(),_0x4442c2=![],_0x201dfe={};EventEmitter[_0x4b6d('0x4')](_0x1914a0);_0x81831a[_0x4b6d('0x5')](_0x4b6d('0x6'));_0x81831a[_0x4b6d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x598386[_0x4b6d('0x5')](_0x4b6d('0x6'));_0x598386['on'](_0x4b6d('0x8'),function(_0x1ffaca){for(var _0x20f68f in _0x1ffaca){_0x1914a0[_0x20f68f]=_0x1ffaca[_0x20f68f];}_0x1914a0[_0x4b6d('0x9')]('ready');});_0x598386['on']('line',function(_0x564786){if(_0x564786['toLowerCase']()==_0x4b6d('0xa')){_0x1914a0[_0x4b6d('0x9')](_0x4b6d('0xa'));return;}if(_0x564786[_0x4b6d('0xb')](0x0,0xb)==_0x4b6d('0xc')){_0x4442c2=!![];}if(_0x4442c2){_0x201dfe['rx']+=_0x564786+'\x0a';if(_0x564786['search']('520\x20End\x20of\x20proper')!=-0x1){_0x4442c2=![];}}else{_0x201dfe['rx']=_0x564786;}if(_0x4442c2){return;}if(typeof _0x201dfe['cb']==_0x4b6d('0xd')){var _0xe2670=_0x201dfe['rx'][_0x4b6d('0xb')](0x0,0x3),_0x51b0f6=null,_0x511520=null;_0xe2670=parseInt(_0xe2670);if(isNaN(_0xe2670)){_0x201dfe['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4b6d('0xe')});return;}if(_0xe2670!=0xc8){_0x201dfe['cb'](null,{'code':_0xe2670,'result':-0x1,'extra':'KO'});return;}_0x51b0f6=_0x201dfe['rx'][_0x4b6d('0xb')](0x4)[_0x4b6d('0xf')](_0x4b6d('0x10'),'');if(_0x51b0f6[_0x4b6d('0x11')]('\x20')!=-0x1){_0x51b0f6=_0x51b0f6[_0x4b6d('0x12')](0x0,_0x51b0f6['indexOf']('\x20'));}if(_['startsWith'](_0x51b0f6,'-1')){_0x51b0f6=parseInt(_0x51b0f6);}_0x511520=_0x201dfe['rx'][_0x4b6d('0x13')]('\x20');if(_0x511520[_0x4b6d('0x14')]==0x3){_0x511520=_0x511520[0x2][_0x4b6d('0xb')](0x1,_0x511520[0x2][_0x4b6d('0x14')]-0x1);}else if(_0x511520[_0x4b6d('0x14')]>0x3){var _0x5d5076=/\((.+)\)/;var _0xd72f3f=_0x201dfe['rx'][_0x4b6d('0x15')](_0x5d5076);if(_0xd72f3f){_0x511520=_0xd72f3f[0x1];}else{_0x511520=null;}}else{_0x511520=null;}_0x201dfe['cb'](null,{'code':_0xe2670,'result':_0x51b0f6,'extra':_0x511520});}});_0x81831a['on'](_0x4b6d('0x16'),function(_0x3e8079){_0x1914a0[_0x4b6d('0x9')]('error',new AGIError(_0x4b6d('0x17'),_0x3e8079[_0x4b6d('0x18')]));});_0x81831a['on'](_0x4b6d('0x19'),function(){_0x1914a0[_0x4b6d('0x9')]('close',new AGIError(_0x4b6d('0x1a')));});_0x81831a['on'](_0x4b6d('0x1b'),function(){_0x1914a0['emit']('timeout',new AGIError(_0x4b6d('0x1c')));_0x81831a['destroy']();});_0x81831a[_0x4b6d('0x1d')](_0x598386);this[_0x4b6d('0x1e')]=function(_0x8ac7c1,_0x13dc4e){var _0x8ac7c1=_0x8ac7c1||'',_0x13dc4e=typeof _0x13dc4e==_0x4b6d('0xd')?_0x13dc4e:new Function();_0x201dfe={'tx':_0x8ac7c1,'rx':'','cb':_0x13dc4e};_0x81831a[_0x4b6d('0x1f')](_0x8ac7c1+'\x0a');},this[_0x4b6d('0x19')]=function(){_0x81831a[_0x4b6d('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x22')]=function(_0x21c916){return this[_0x4b6d('0x1e')]['sync'](this,_0x21c916);};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x23')]=function(){return this[_0x4b6d('0x22')]('ANSWER');};AGIChannel['prototype']['getData']=function(_0x525ddd,_0x46cc8a,_0x4d18bd){_0x525ddd=_0x525ddd===undefined?_0x4b6d('0x24'):_0x525ddd;_0x46cc8a=_0x46cc8a===undefined?'5':_0x46cc8a;_0x4d18bd=_0x4d18bd===undefined?'1':_0x4d18bd;return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x26'),_0x525ddd,_0x46cc8a*0x3e8,_0x4d18bd));};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x27')]=function(_0x3f69f6){_0x3f69f6=_0x3f69f6||_0x4b6d('0x28');return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x29'),_0x3f69f6));};AGIChannel['prototype']['exec']=function(_0x30b413,_0x4a50ac){if(_[_0x4b6d('0x2a')](_0x4a50ac)){return this['sendRequest'](util[_0x4b6d('0x25')](_0x4b6d('0x2b'),_0x30b413,_0x4a50ac[_0x4b6d('0x2c')](',')));}return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x2b'),_0x30b413,_0x4a50ac));};AGIChannel['prototype'][_0x4b6d('0x2d')]=function(_0x3c01b8){return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x2e'),_0x3c01b8));};AGIChannel[_0x4b6d('0x21')]['setExtension']=function(_0x413603){return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x2f'),_0x413603));};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x30')]=function(_0x5444df){return this['sendRequest'](util[_0x4b6d('0x25')](_0x4b6d('0x31'),_0x5444df));};AGIChannel['prototype'][_0x4b6d('0xa')]=function(){return this[_0x4b6d('0x22')](_0x4b6d('0x32'));};AGIChannel[_0x4b6d('0x21')]['setVariable']=function(_0x355dd7,_0x11e55d){var _0x3c5f3c=_[_0x4b6d('0x33')](_0x11e55d)||_['isNumber'](_0x11e55d)?_0x11e55d[_0x4b6d('0x34')]():_0x11e55d;return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x35'),_0x355dd7,_0x3c5f3c?_0x3c5f3c['toString']()[_0x4b6d('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x2c1e94,_0x14a972){return this['sendRequest'](util['format'](_0x4b6d('0x36'),_0x2c1e94,_0x14a972));};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x37')]=function(_0x1d29fc,_0x3b5e94){return this['sendRequest'](util['format'](_0x4b6d('0x38'),_0x1d29fc,_0x3b5e94));};AGIChannel['prototype'][_0x4b6d('0x39')]=function(_0x4de7a2,_0x2ce2c4){return this['sendRequest'](util[_0x4b6d('0x25')](_0x4b6d('0x3a'),_0x4de7a2,_0x2ce2c4));};AGIChannel['prototype'][_0x4b6d('0x3b')]=function(_0x2d1d62,_0x12ff48,_0x250845){_0x12ff48=_0x12ff48||this[_0x4b6d('0x3c')];_0x250845=_0x250845||0x1;this['setContext'](_0x2d1d62);this['setExtension'](_0x12ff48);this[_0x4b6d('0x30')](_0x250845);return this[_0x4b6d('0x27')](util[_0x4b6d('0x25')]('GOTO\x20%s\x20%s\x20%s',_0x2d1d62,_0x12ff48,_0x250845));};AGIChannel['prototype']['getVariable']=function(_0x2fb5bf){return this[_0x4b6d('0x22')](util[_0x4b6d('0x25')](_0x4b6d('0x3d'),_0x2fb5bf));};AGIChannel[_0x4b6d('0x21')]['recordFile']=function(_0x5dc9f0,_0x1b65ff,_0x2b5ad0,_0x37bca4,_0x392e58,_0x512cb6){_0x1b65ff=_0x1b65ff||_0x4b6d('0x3e');_0x2b5ad0=_0x2b5ad0||'';_0x37bca4=_0x37bca4===undefined?-0x1:_0x37bca4==='-1'?-0x1:_0x37bca4*0x3e8;_0x392e58=_0x392e58===undefined?'':'s='+_0x392e58;_0x512cb6=_0x512cb6?_0x4b6d('0x3f'):'';return this['sendRequest'](util['format'](_0x4b6d('0x40'),_0x5dc9f0,_0x1b65ff,_0x2b5ad0,_0x37bca4,_0x512cb6,_0x392e58));};AGIChannel['prototype']['streamFile']=function(_0x46c1f1,_0x120a90){_0x120a90=_0x120a90||'';return this[_0x4b6d('0x22')](util['format'](_0x4b6d('0x41'),_0x46c1f1,_0x120a90));};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x42')]=function(_0x45347e){return this[_0x4b6d('0x43')](_0x4b6d('0x44'),_0x45347e);};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x45')]=function(_0x431391){return this['exec'](_0x4b6d('0x46'),_0x431391);};AGIChannel[_0x4b6d('0x21')][_0x4b6d('0x16')]=function(_0x5eaabb,_0x5aaf01){this['noop'](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x5eaabb['id'],_0x5eaabb[_0x4b6d('0x47')],_0x5aaf01));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4b6d('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 64aa1af..e1663f7 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 _0x0ae4=['push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x308ee9,_0x244b8d){var _0x19c35a=function(_0x4841a6){while(--_0x4841a6){_0x308ee9['push'](_0x308ee9['shift']());}};_0x19c35a(++_0x244b8d);}(_0x0ae4,0x1d1));var _0x40ae=function(_0x4daacc,_0xcd6d0f){_0x4daacc=_0x4daacc-0x0;var _0xb90f41=_0x0ae4[_0x4daacc];return _0xb90f41;};'use strict';var util=require(_0x40ae('0x0'));var error={'E_AGI_UNDEFINED':_0x40ae('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x40ae('0x2'),'E_AGI_SERVER_CLOSE':_0x40ae('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x40ae('0x4'),'E_AGI_SOCKET_CLOSE':_0x40ae('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x40ae('0x6'),'E_AGI_COMMAND_EMPTY':_0x40ae('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x40ae('0x8'),'E_AGI_IVR_ENTRY':_0x40ae('0x9')};function AGIError(_0xa12a61){var _0xa12a61=_0xa12a61||null,_0x4a9840=_0x4a9840||[],_0x4be29e=0x1,_0x57faf2='';if(!error[_0xa12a61]){_0xa12a61=_0x40ae('0xa');}_0x4a9840[_0x40ae('0xb')](error[_0xa12a61]);while(arguments[_0x4be29e]){_0x4a9840[_0x40ae('0xb')](arguments[_0x4be29e]);_0x4be29e++;}_0x57faf2=util[_0x40ae('0xc')][_0x40ae('0xd')](util,_0x4a9840);this[_0x40ae('0xe')]=_0x57faf2;this[_0x40ae('0xf')]=_0xa12a61;}module[_0x40ae('0x10')]=AGIError; \ No newline at end of file +var _0x446d=['Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.'];(function(_0xe29e68,_0x350041){var _0x19aab3=function(_0x54f12b){while(--_0x54f12b){_0xe29e68['push'](_0xe29e68['shift']());}};_0x19aab3(++_0x350041);}(_0x446d,0xff));var _0xd446=function(_0x222a4b,_0x3d53d2){_0x222a4b=_0x222a4b-0x0;var _0x2bedb3=_0x446d[_0x222a4b];return _0x2bedb3;};'use strict';var util=require(_0xd446('0x0'));var error={'E_AGI_UNDEFINED':_0xd446('0x1'),'E_AGI_ARGUMENT_PORT':_0xd446('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xd446('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xd446('0x4'),'E_AGI_SOCKET_CLOSE':_0xd446('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd446('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x190847){var _0x190847=_0x190847||null,_0x7c3aec=_0x7c3aec||[],_0x2f4ec9=0x1,_0xb7ee4='';if(!error[_0x190847]){_0x190847=_0xd446('0x7');}_0x7c3aec[_0xd446('0x8')](error[_0x190847]);while(arguments[_0x2f4ec9]){_0x7c3aec[_0xd446('0x8')](arguments[_0x2f4ec9]);_0x2f4ec9++;}_0xb7ee4=util[_0xd446('0x9')][_0xd446('0xa')](util,_0x7c3aec);this[_0xd446('0xb')]=_0xb7ee4;this['name']=_0x190847;}module[_0xd446('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 b55b754..1b6890b 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 _0x9345=['info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','vswitch','target','default','agicommand','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','getVertex','traverseBFS'];(function(_0x21803b,_0x4a7464){var _0x14d19f=function(_0x3335e9){while(--_0x3335e9){_0x21803b['push'](_0x21803b['shift']());}};_0x14d19f(++_0x4a7464);}(_0x9345,0x126));var _0x5934=function(_0x6dfbaa,_0x31eede){_0x6dfbaa=_0x6dfbaa-0x0;var _0xfbe02=_0x9345[_0x6dfbaa];return _0xfbe02;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0x5934('0x0'));var verticesWithRetry=[_0x5934('0x1'),_0x5934('0x2'),_0x5934('0x3')];var Graph=function(){this['vertices']={};this[_0x5934('0x4')]={};this[_0x5934('0x5')]=0x0;};Graph[_0x5934('0x6')][_0x5934('0x7')]=function(_0x5817a3){this['vertices'][_0x5817a3['id']]=_0x5817a3;this[_0x5934('0x4')][_0x5817a3['id']]=[];};Graph['prototype'][_0x5934('0x8')]=function(_0x24cbec,_0xff8bbe,_0x33a9cf){this[_0x5934('0x4')][_0x24cbec][_0x5934('0x9')]({'target':_0xff8bbe,'condition':_0x33a9cf});this[_0x5934('0x5')]+=0x1;};Graph['prototype'][_0x5934('0xa')]=function(){return _[_0x5934('0xa')](this[_0x5934('0xb')]);};Graph[_0x5934('0x6')]['relations']=function(){return this[_0x5934('0x5')];};Graph[_0x5934('0x6')][_0x5934('0xc')]=function(_0x482702){return this[_0x5934('0xb')][_0x482702];};Graph[_0x5934('0x6')][_0x5934('0xd')]=function(_0x108f89,_0x419ac5){if(!this['vertices'][_0x108f89]){return logger['info']('no\x20vertex\x20found');}var _0x546456=_0x419ac5(this[_0x5934('0xb')][_0x108f89]);if(!_0x546456){return logger[_0x5934('0xe')](_0x5934('0xf'));}if(this['edges'][_0x108f89]['length']===0x0){return logger[_0x5934('0xe')](_0x5934('0x10'));}for(var _0x2ca42b=0x0,_0x3a739c=[],_0x30457c=![];_0x2ca42b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','[%s]\x20%s','name','message','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','omit','mxCell','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','substring','variables','stringify','close','timeout','sync','production','start','root','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','debug','vertex'];(function(_0x5a46df,_0x59d24e){var _0x52bb7a=function(_0x18ba4d){while(--_0x18ba4d){_0x5a46df['push'](_0x5a46df['shift']());}};_0x52bb7a(++_0x59d24e);}(_0x34c3,0x129));var _0x334c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x34c3[_0x13d07a];return _0x5ee0ee;};'use strict';var parser=require(_0x334c('0x0'));var _=require(_0x334c('0x1'));var syncho=require(_0x334c('0x2'));var util=require(_0x334c('0x3'));var moment=require('moment');var config=require(_0x334c('0x4'));var logger=require(_0x334c('0x5'))(_0x334c('0x6'));var utilLicense=require(_0x334c('0x7'));var rpc=require(_0x334c('0x8'));var mailRpc=require(_0x334c('0x9'));var Graph=require('./graph');var Vertices=require(_0x334c('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x334c('0x6')]=_['defaults'](config[_0x334c('0x6')],{'ip':_0x334c('0xb'),'port':0x11dd});function connectionHandler(_0x441727){process[_0x334c('0xc')](function(){syncho(function(){try{setChannelVariables(_0x441727);agiHandler(_0x441727);}catch(_0x48fe27){logger[_0x334c('0xd')](_0x48fe27[_0x334c('0xe')]);}});});}function listeningHandler(){console[_0x334c('0xf')](_0x334c('0x10'),config[_0x334c('0x6')]['port']);logger['info'](util[_0x334c('0x11')](_0x334c('0x12'),config[_0x334c('0x6')]['ip'],config['agi'][_0x334c('0x13')]));}function errorHandler(_0x37c06b){if(_0x37c06b&&_0x37c06b['name']&&_0x37c06b['message']){logger[_0x334c('0xd')](util[_0x334c('0x11')](_0x334c('0x14'),_0x37c06b[_0x334c('0x15')],_0x37c06b[_0x334c('0x16')]));}else{logger[_0x334c('0xd')](util[_0x334c('0x11')](_0x334c('0x17'),_0x37c06b[_0x334c('0xe')]));}}function closeHandler(){logger[_0x334c('0x18')](util[_0x334c('0x11')](_0x334c('0x19'),this[_0x334c('0x1a')],this['calleridname'],this['callerid'],this[_0x334c('0x1b')],this[_0x334c('0x1c')]));try{createSquareReport(this);}catch(_0x2de40d){logger[_0x334c('0xd')](_0x2de40d['stack']);}}function timeoutHandler(){logger[_0x334c('0x18')](util[_0x334c('0x11')](_0x334c('0x1d'),this[_0x334c('0x1a')],this['calleridname'],this['callerid'],this[_0x334c('0x1b')],this[_0x334c('0x1c')]));}function hangupHandler(){logger[_0x334c('0x18')](util[_0x334c('0x11')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x334c('0x1a')],this[_0x334c('0x1e')],this[_0x334c('0x1f')],this[_0x334c('0x1b')],this[_0x334c('0x1c')]));this[_0x334c('0x20')]=!![];}function getRoot(_0x327f5d){return parser['toJson'](_0x327f5d,{'object':!![]})[_0x334c('0x21')]['root'];}function addVertex(_0xfa5b01,_0x204064,_0x305742){_0x204064[_0x334c('0x22')]=_0x305742;if(_0x204064[_0x334c('0x23')](_0x334c('0x24'))){_0x204064['maxRetry']=parseInt(_0x204064[_0x334c('0x24')],0xa);}_0xfa5b01['addVertex'](_[_0x334c('0x25')](_0x204064,_0x334c('0x26')));}function initGraph(_0x3c2f0d,_0x2a7e61){var _0x2f6332=new Graph();for(var _0x448145 in _0x3c2f0d){if(_0x3c2f0d['hasOwnProperty'](_0x448145)){if(_['isArray'](_0x3c2f0d[_0x448145])){for(var _0x841440=0x0;_0x841440<_0x3c2f0d[_0x448145][_0x334c('0x27')];_0x841440+=0x1){addVertex(_0x2f6332,_0x3c2f0d[_0x448145][_0x841440],_0x448145);}}else{addVertex(_0x2f6332,_0x3c2f0d[_0x448145],_0x448145);}}}for(var _0x4933f3=0x0;_0x4933f3<_0x2a7e61[_0x334c('0x27')];_0x4933f3+=0x1){if(_0x2a7e61[_0x4933f3][_0x334c('0x28')]&&_0x2a7e61[_0x4933f3][_0x334c('0x29')]){_0x2f6332[_0x334c('0x2a')](_0x2a7e61[_0x4933f3][_0x334c('0x28')],_0x2a7e61[_0x4933f3][_0x334c('0x29')],_0x2a7e61[_0x4933f3]['value']);}}return _0x2f6332;}function getSquareProject(_0x522a24,_0x461806){rpc[_0x334c('0x2b')](_0x522a24)[_0x334c('0x2c')](function(_0x32181e){_0x461806(null,_0x32181e);})[_0x334c('0x2d')](function(_0xeeb70a){_0x461806(null,_0xeeb70a);});}function createSquareReport(_0x481960,_0x14ce30){rpc[_0x334c('0x2e')](_0x481960)[_0x334c('0x2c')](function(_0x5269a4){if(_0x14ce30){_0x14ce30(null,_0x5269a4);}})[_0x334c('0x2d')](function(_0x3f49f8){if(_0x14ce30){_0x14ce30(null,_0x3f49f8);}});}function setChannelVariables(_0x6b3bf0){for(var _0x49db85 in _0x6b3bf0){if(_0x6b3bf0[_0x334c('0x23')](_0x49db85)){if(_0x49db85[_0x334c('0x2f')]('agi_')===0x0){_0x6b3bf0[_0x49db85[_0x334c('0x30')](0x4)]=_0x6b3bf0[_0x49db85];delete _0x6b3bf0[_0x49db85];}}}}function getLogFromObject(_0x2da638){return util['inspect'](_0x2da638,{'showHidden':![],'depth':null});}function agiHandler(_0x5e0122){var _0x2167bc,_0x7c2d37,_0xdd949a,_0x3fc219,_0x4edfcd;logger['debug'](_0x334c('0x31'),JSON[_0x334c('0x32')](_0x5e0122,null,0x2));logger[_0x334c('0x18')](util[_0x334c('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5e0122['arg_1'],_0x5e0122[_0x334c('0x1e')],_0x5e0122[_0x334c('0x1f')],_0x5e0122['dnid'],_0x5e0122[_0x334c('0x1c')]));_0x5e0122['on'](_0x334c('0xd'),errorHandler);_0x5e0122['on'](_0x334c('0x33'),closeHandler);_0x5e0122['on'](_0x334c('0x34'),timeoutHandler);_0x5e0122[_0x334c('0x20')]=![];_0x5e0122['on']('hangup',hangupHandler);var _0x174033=getSquareProject[_0x334c('0x35')](null,_0x5e0122['arg_1']);if(_0x174033){if(_0x174033['production']){_0x2167bc=getRoot(_0x174033[_0x334c('0x36')]);if(_0x2167bc&&_0x2167bc[_0x334c('0x37')]){logger['debug'](_0x334c('0x38'),JSON[_0x334c('0x32')](_0x2167bc,null,0x2));_0x5e0122[_0x334c('0x39')]=moment()[_0x334c('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x7c2d37=initGraph(_[_0x334c('0x25')](_0x2167bc,_0x334c('0x26')),_0x2167bc[_0x334c('0x26')]);_0xdd949a=new Vertices(_0x5e0122,rpc,mailRpc);logger[_0x334c('0x18')](util[_0x334c('0x11')](_0x334c('0x3a'),_0x5e0122[_0x334c('0x1a')],_0x5e0122[_0x334c('0x1e')],_0x5e0122[_0x334c('0x1f')],_0x5e0122[_0x334c('0x1b')],_0x5e0122['uniqueid']));_0x7c2d37[_0x334c('0x3b')](_0x2167bc[_0x334c('0x37')]['id'],function(_0x856115){try{_0x856115=_0xdd949a[_0x334c('0x3c')](_0x856115);logger[_0x334c('0x3d')](_0x334c('0x3e'),JSON[_0x334c('0x32')](_0x856115,null,0x2));if(_0x856115[_0x334c('0x22')]===_0x334c('0x3f')){logger[_0x334c('0x18')](_0x334c('0x40'));_0x5e0122['context']=_0x856115[_0x334c('0x41')]||_0x5e0122[_0x334c('0x41')];_0x5e0122[_0x334c('0x42')]=_0x856115[_0x334c('0x42')];_0x5e0122[_0x334c('0x43')]=_0x856115[_0x334c('0x43')]?_0x856115[_0x334c('0x43')]-0x1:0x1;return null;}else if(_0x856115&&_0xdd949a[_0x856115[_0x334c('0x22')]]){_0x4edfcd=_0xdd949a[_0x856115[_0x334c('0x22')]](_0x856115);logger[_0x334c('0x18')](_0x334c('0x44'),JSON[_0x334c('0x32')](_0x4edfcd,null,0x2));if(_0x4edfcd&&_0x4edfcd['code']===AGI_CODE_SUCCESS&&_0x4edfcd[_0x334c('0x45')]!==AGI_RESULT_ERROR&&!_0x5e0122[_0x334c('0x20')]){logger['debug'](_0x334c('0x44'),getLogFromObject(_0x4edfcd));return _['isUndefined'](_0x4edfcd['result'])?null:_0x4edfcd[_0x334c('0x45')][_0x334c('0x46')]();}else{logger[_0x334c('0xd')](_0x334c('0x44'),getLogFromObject(_0x4edfcd));return null;}}else{logger['error'](_0x334c('0x47'));return null;}}catch(_0xa9dfb9){logger['error'](_0xa9dfb9[_0x334c('0xe')]);return null;}});if(_0x2167bc['finally']){logger[_0x334c('0x18')](util[_0x334c('0x11')](_0x334c('0x48'),_0x5e0122[_0x334c('0x1a')],_0x5e0122[_0x334c('0x1e')],_0x5e0122[_0x334c('0x1f')],_0x5e0122[_0x334c('0x1b')],_0x5e0122[_0x334c('0x1c')]));_0x7c2d37[_0x334c('0x3b')](_0x2167bc[_0x334c('0x49')]['id'],function(_0xdd39b){try{_0xdd39b=_0xdd949a[_0x334c('0x3c')](_0xdd39b);logger['debug'](_0x334c('0x3e'),JSON[_0x334c('0x32')](_0xdd39b,null,0x2));if(_0xdd39b&&_0xdd949a[_0xdd39b[_0x334c('0x22')]]){_0x4edfcd=_0xdd949a[_0xdd39b['agicommand']](_0xdd39b);if(_0x4edfcd){logger['debug'](_0x334c('0x44'),getLogFromObject(_0x4edfcd));return _[_0x334c('0x4a')](_0x4edfcd[_0x334c('0x45')])?null:_0x4edfcd[_0x334c('0x45')][_0x334c('0x46')]();}else{logger['error'](_0x334c('0x44'),getLogFromObject(_0x4edfcd));return null;}}else{logger[_0x334c('0xd')](_0x334c('0x47'));return null;}}catch(_0x118330){logger[_0x334c('0xd')](_0x118330['stack']);return null;}});}logger[_0x334c('0x18')](util['format'](_0x334c('0x4b'),_0x5e0122['arg_1'],_0x5e0122[_0x334c('0x1e')],_0x5e0122['callerid'],_0x5e0122[_0x334c('0x1b')],_0x5e0122[_0x334c('0x1c')]));logger['info'](util[_0x334c('0x11')](_0x334c('0x4c'),_0x5e0122['context'],_0x5e0122[_0x334c('0x42')],parseInt(_0x5e0122[_0x334c('0x43')],0xa)+0x1));_0x5e0122[_0x334c('0x4d')](_0x5e0122[_0x334c('0x41')],_0x5e0122[_0x334c('0x42')],parseInt(_0x5e0122[_0x334c('0x43')],0xa)+0x1);_0x5e0122[_0x334c('0x33')]();}}else{logger[_0x334c('0xd')](util[_0x334c('0x11')](_0x334c('0x4e'),_0x5e0122[_0x334c('0x1a')]));_0x5e0122[_0x334c('0x4d')](_0x5e0122[_0x334c('0x41')],_0x5e0122['extension'],parseInt(_0x5e0122[_0x334c('0x43')],0xa)+0x1);_0x5e0122['close']();}}else{logger[_0x334c('0xd')](util[_0x334c('0x11')](_0x334c('0x4f'),_0x5e0122[_0x334c('0x1a')]));_0x5e0122[_0x334c('0x4d')](_0x5e0122['context'],_0x5e0122['extension'],parseInt(_0x5e0122[_0x334c('0x43')],0xa)+0x1);_0x5e0122[_0x334c('0x33')]();}}function main(){var _0x143886;return utilLicense[_0x334c('0x50')]()[_0x334c('0x2c')](function(_0x1708cf){if(_0x1708cf){if(_0x1708cf[_0x334c('0x51')]){if(_0x1708cf[_0x334c('0x52')]&&_0x1708cf['callysquare']>0x0){logger[_0x334c('0x18')](util[_0x334c('0x11')](_0x334c('0x53'),_0x1708cf[_0x334c('0x52')]));_0x143886=_0x1708cf['callysquare'];}else{logger[_0x334c('0x18')](_0x334c('0x54'));}}else{logger[_0x334c('0x18')](_0x334c('0x55'));_0x143886=-0x1;}}})[_0x334c('0x2d')](function(_0x2c6601){logger[_0x334c('0xd')](_0x334c('0x56'),_0x2c6601[_0x334c('0xe')]);})[_0x334c('0x49')](function(){var _0x1d2568=require(_0x334c('0x57'))(config['agi'][_0x334c('0x13')],config['agi']['ip'],_0x143886);_0x1d2568['on'](_0x334c('0xd'),errorHandler);_0x1d2568['on'](_0x334c('0x58'),listeningHandler);_0x1d2568['on'](_0x334c('0x59'),connectionHandler);_0x1d2568['on'](_0x334c('0x33'),closeHandler);});}main(); \ No newline at end of file +var _0x1187=['catch','createSquareReport','then','agi_','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','root','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','start','vertex','stringify','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','extension','close','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','../../config/logger','../../config/license/util','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','agicommand','maxRetry','retry','omit','mxCell','hasOwnProperty','length','source','target','addEdge','getSquareProject'];(function(_0xfa514e,_0x2665aa){var _0x39d8b0=function(_0x46328e){while(--_0x46328e){_0xfa514e['push'](_0xfa514e['shift']());}};_0x39d8b0(++_0x2665aa);}(_0x1187,0x1d8));var _0x7118=function(_0x2b5648,_0x5688ae){_0x2b5648=_0x2b5648-0x0;var _0x3ea5db=_0x1187[_0x2b5648];return _0x3ea5db;};'use strict';var parser=require(_0x7118('0x0'));var _=require(_0x7118('0x1'));var syncho=require(_0x7118('0x2'));var util=require(_0x7118('0x3'));var moment=require(_0x7118('0x4'));var config=require('../../config/environment');var logger=require(_0x7118('0x5'))('agi');var utilLicense=require(_0x7118('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x7118('0x7'));var Vertices=require(_0x7118('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7118('0x9')]=_[_0x7118('0xa')](config['agi'],{'ip':_0x7118('0xb'),'port':0x11dd});function connectionHandler(_0x1beed8){process[_0x7118('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1beed8);agiHandler(_0x1beed8);}catch(_0x37220e){logger[_0x7118('0xd')](_0x37220e[_0x7118('0xe')]);}});});}function listeningHandler(){console[_0x7118('0xf')](_0x7118('0x10'),config[_0x7118('0x9')][_0x7118('0x11')]);logger[_0x7118('0x12')](util[_0x7118('0x13')](_0x7118('0x14'),config[_0x7118('0x9')]['ip'],config['agi'][_0x7118('0x11')]));}function errorHandler(_0x4be492){if(_0x4be492&&_0x4be492[_0x7118('0x15')]&&_0x4be492[_0x7118('0x16')]){logger[_0x7118('0xd')](util['format'](_0x7118('0x17'),_0x4be492['name'],_0x4be492[_0x7118('0x16')]));}else{logger[_0x7118('0xd')](util[_0x7118('0x13')](_0x7118('0x18'),_0x4be492[_0x7118('0xe')]));}}function closeHandler(){logger[_0x7118('0x12')](util['format'](_0x7118('0x19'),this['arg_1'],this['calleridname'],this[_0x7118('0x1a')],this[_0x7118('0x1b')],this[_0x7118('0x1c')]));try{createSquareReport(this);}catch(_0x454a03){logger[_0x7118('0xd')](_0x454a03[_0x7118('0xe')]);}}function timeoutHandler(){logger[_0x7118('0x12')](util[_0x7118('0x13')](_0x7118('0x1d'),this[_0x7118('0x1e')],this['calleridname'],this['callerid'],this[_0x7118('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x7118('0x12')](util['format'](_0x7118('0x1f'),this[_0x7118('0x1e')],this['calleridname'],this[_0x7118('0x1a')],this['dnid'],this[_0x7118('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x2a7f4a){return parser[_0x7118('0x20')](_0x2a7f4a,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x31c1de,_0xe2767d,_0x36821a){_0xe2767d[_0x7118('0x21')]=_0x36821a;if(_0xe2767d['hasOwnProperty']('retry')){_0xe2767d[_0x7118('0x22')]=parseInt(_0xe2767d[_0x7118('0x23')],0xa);}_0x31c1de['addVertex'](_[_0x7118('0x24')](_0xe2767d,_0x7118('0x25')));}function initGraph(_0x2a9905,_0x4f8d80){var _0x34afac=new Graph();for(var _0x49109b in _0x2a9905){if(_0x2a9905[_0x7118('0x26')](_0x49109b)){if(_['isArray'](_0x2a9905[_0x49109b])){for(var _0x5ea936=0x0;_0x5ea936<_0x2a9905[_0x49109b][_0x7118('0x27')];_0x5ea936+=0x1){addVertex(_0x34afac,_0x2a9905[_0x49109b][_0x5ea936],_0x49109b);}}else{addVertex(_0x34afac,_0x2a9905[_0x49109b],_0x49109b);}}}for(var _0x41f20c=0x0;_0x41f20c<_0x4f8d80[_0x7118('0x27')];_0x41f20c+=0x1){if(_0x4f8d80[_0x41f20c][_0x7118('0x28')]&&_0x4f8d80[_0x41f20c][_0x7118('0x29')]){_0x34afac[_0x7118('0x2a')](_0x4f8d80[_0x41f20c][_0x7118('0x28')],_0x4f8d80[_0x41f20c]['target'],_0x4f8d80[_0x41f20c]['value']);}}return _0x34afac;}function getSquareProject(_0xe6a488,_0x16e06a){rpc[_0x7118('0x2b')](_0xe6a488)['then'](function(_0x1d1f62){_0x16e06a(null,_0x1d1f62);})[_0x7118('0x2c')](function(_0x27d3b0){_0x16e06a(null,_0x27d3b0);});}function createSquareReport(_0x47da82,_0x851efb){rpc[_0x7118('0x2d')](_0x47da82)[_0x7118('0x2e')](function(_0x187d1c){if(_0x851efb){_0x851efb(null,_0x187d1c);}})['catch'](function(_0x1c5f9e){if(_0x851efb){_0x851efb(null,_0x1c5f9e);}});}function setChannelVariables(_0x2abf2a){for(var _0x5616ab in _0x2abf2a){if(_0x2abf2a[_0x7118('0x26')](_0x5616ab)){if(_0x5616ab['indexOf'](_0x7118('0x2f'))===0x0){_0x2abf2a[_0x5616ab['substring'](0x4)]=_0x2abf2a[_0x5616ab];delete _0x2abf2a[_0x5616ab];}}}}function getLogFromObject(_0x3d30ea){return util['inspect'](_0x3d30ea,{'showHidden':![],'depth':null});}function agiHandler(_0xe3d433){var _0x3e6c3e,_0x471c9c,_0x81343e,_0x490d8e,_0x50f995;logger[_0x7118('0x30')](_0x7118('0x31'),JSON['stringify'](_0xe3d433,null,0x2));logger[_0x7118('0x12')](util['format'](_0x7118('0x32'),_0xe3d433['arg_1'],_0xe3d433['calleridname'],_0xe3d433['callerid'],_0xe3d433['dnid'],_0xe3d433['uniqueid']));_0xe3d433['on'](_0x7118('0xd'),errorHandler);_0xe3d433['on']('close',closeHandler);_0xe3d433['on'](_0x7118('0x33'),timeoutHandler);_0xe3d433['evtHangup']=![];_0xe3d433['on'](_0x7118('0x34'),hangupHandler);var _0x28d064=getSquareProject[_0x7118('0x35')](null,_0xe3d433[_0x7118('0x1e')]);if(_0x28d064){if(_0x28d064[_0x7118('0x36')]){_0x3e6c3e=getRoot(_0x28d064[_0x7118('0x36')]);if(_0x3e6c3e&&_0x3e6c3e['start']){logger['debug'](_0x7118('0x37'),JSON['stringify'](_0x3e6c3e,null,0x2));_0xe3d433[_0x7118('0x38')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x471c9c=initGraph(_[_0x7118('0x24')](_0x3e6c3e,_0x7118('0x25')),_0x3e6c3e[_0x7118('0x25')]);_0x81343e=new Vertices(_0xe3d433,rpc,mailRpc);logger['info'](util[_0x7118('0x13')](_0x7118('0x39'),_0xe3d433[_0x7118('0x1e')],_0xe3d433[_0x7118('0x3a')],_0xe3d433['callerid'],_0xe3d433[_0x7118('0x1b')],_0xe3d433[_0x7118('0x1c')]));_0x471c9c[_0x7118('0x3b')](_0x3e6c3e[_0x7118('0x3c')]['id'],function(_0x145b44){try{_0x145b44=_0x81343e['clear'](_0x145b44);logger[_0x7118('0x30')](_0x7118('0x3d'),JSON[_0x7118('0x3e')](_0x145b44,null,0x2));if(_0x145b44[_0x7118('0x21')]==='gotoc'){logger[_0x7118('0x12')](_0x7118('0x3f'));_0xe3d433[_0x7118('0x40')]=_0x145b44[_0x7118('0x40')]||_0xe3d433[_0x7118('0x40')];_0xe3d433['extension']=_0x145b44['extension'];_0xe3d433['priority']=_0x145b44[_0x7118('0x41')]?_0x145b44[_0x7118('0x41')]-0x1:0x1;return null;}else if(_0x145b44&&_0x81343e[_0x145b44[_0x7118('0x21')]]){_0x50f995=_0x81343e[_0x145b44['agicommand']](_0x145b44);logger['info'](_0x7118('0x42'),JSON[_0x7118('0x3e')](_0x50f995,null,0x2));if(_0x50f995&&_0x50f995[_0x7118('0x43')]===AGI_CODE_SUCCESS&&_0x50f995[_0x7118('0x44')]!==AGI_RESULT_ERROR&&!_0xe3d433['evtHangup']){logger[_0x7118('0x30')](_0x7118('0x42'),getLogFromObject(_0x50f995));return _[_0x7118('0x45')](_0x50f995[_0x7118('0x44')])?null:_0x50f995[_0x7118('0x44')][_0x7118('0x46')]();}else{logger[_0x7118('0xd')](_0x7118('0x42'),getLogFromObject(_0x50f995));return null;}}else{logger['error'](_0x7118('0x47'));return null;}}catch(_0x4f82af){logger[_0x7118('0xd')](_0x4f82af[_0x7118('0xe')]);return null;}});if(_0x3e6c3e['finally']){logger[_0x7118('0x12')](util[_0x7118('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xe3d433[_0x7118('0x1e')],_0xe3d433['calleridname'],_0xe3d433[_0x7118('0x1a')],_0xe3d433[_0x7118('0x1b')],_0xe3d433[_0x7118('0x1c')]));_0x471c9c[_0x7118('0x3b')](_0x3e6c3e[_0x7118('0x48')]['id'],function(_0x32a4db){try{_0x32a4db=_0x81343e['clear'](_0x32a4db);logger[_0x7118('0x30')]('vertex',JSON[_0x7118('0x3e')](_0x32a4db,null,0x2));if(_0x32a4db&&_0x81343e[_0x32a4db[_0x7118('0x21')]]){_0x50f995=_0x81343e[_0x32a4db[_0x7118('0x21')]](_0x32a4db);if(_0x50f995){logger[_0x7118('0x30')]('response',getLogFromObject(_0x50f995));return _[_0x7118('0x45')](_0x50f995[_0x7118('0x44')])?null:_0x50f995[_0x7118('0x44')][_0x7118('0x46')]();}else{logger[_0x7118('0xd')](_0x7118('0x42'),getLogFromObject(_0x50f995));return null;}}else{logger['error'](_0x7118('0x47'));return null;}}catch(_0x192bdd){logger[_0x7118('0xd')](_0x192bdd['stack']);return null;}});}logger[_0x7118('0x12')](util[_0x7118('0x13')](_0x7118('0x49'),_0xe3d433[_0x7118('0x1e')],_0xe3d433[_0x7118('0x3a')],_0xe3d433[_0x7118('0x1a')],_0xe3d433['dnid'],_0xe3d433['uniqueid']));logger[_0x7118('0x12')](util[_0x7118('0x13')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xe3d433[_0x7118('0x40')],_0xe3d433[_0x7118('0x4a')],parseInt(_0xe3d433[_0x7118('0x41')],0xa)+0x1));_0xe3d433['continueAt'](_0xe3d433['context'],_0xe3d433['extension'],parseInt(_0xe3d433[_0x7118('0x41')],0xa)+0x1);_0xe3d433[_0x7118('0x4b')]();}}else{logger[_0x7118('0xd')](util[_0x7118('0x13')]('Project\x20%s\x20not\x20published',_0xe3d433[_0x7118('0x1e')]));_0xe3d433[_0x7118('0x4c')](_0xe3d433['context'],_0xe3d433[_0x7118('0x4a')],parseInt(_0xe3d433['priority'],0xa)+0x1);_0xe3d433[_0x7118('0x4b')]();}}else{logger['error'](util['format'](_0x7118('0x4d'),_0xe3d433[_0x7118('0x1e')]));_0xe3d433[_0x7118('0x4c')](_0xe3d433[_0x7118('0x40')],_0xe3d433['extension'],parseInt(_0xe3d433[_0x7118('0x41')],0xa)+0x1);_0xe3d433[_0x7118('0x4b')]();}}function main(){var _0x26d7a3;return utilLicense[_0x7118('0x4e')]()['then'](function(_0x1dc50d){if(_0x1dc50d){if(_0x1dc50d[_0x7118('0x4f')]){if(_0x1dc50d['callysquare']&&_0x1dc50d[_0x7118('0x50')]>0x0){logger[_0x7118('0x12')](util['format'](_0x7118('0x51'),_0x1dc50d[_0x7118('0x50')]));_0x26d7a3=_0x1dc50d[_0x7118('0x50')];}else{logger['info'](_0x7118('0x52'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x26d7a3=-0x1;}}})['catch'](function(_0xa23261){logger[_0x7118('0xd')](_0x7118('0x53'),_0xa23261[_0x7118('0xe')]);})[_0x7118('0x48')](function(){var _0x1ba35b=require(_0x7118('0x54'))(config[_0x7118('0x9')]['port'],config[_0x7118('0x9')]['ip'],_0x26d7a3);_0x1ba35b['on'](_0x7118('0xd'),errorHandler);_0x1ba35b['on']('listening',listeningHandler);_0x1ba35b['on'](_0x7118('0x55'),connectionHandler);_0x1ba35b['on']('close',closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 2e5d9b0..4ca15d5 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 _0x4fec=['message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error'];(function(_0x5076ae,_0x4d9525){var _0x1b936f=function(_0x46f2a4){while(--_0x46f2a4){_0x5076ae['push'](_0x5076ae['shift']());}};_0x1b936f(++_0x4d9525);}(_0x4fec,0x18a));var _0xc4fe=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x4fec[_0x15ea09];return _0x3e9c78;};'use strict';var BPromise=require(_0xc4fe('0x0'));var jayson=require(_0xc4fe('0x1'));var client=jayson[_0xc4fe('0x2')][_0xc4fe('0x3')]({'port':0x232b});function request(_0x3a26eb,_0x19e7d3){return new BPromise(function(_0x1afc8a,_0x390237){return client[_0xc4fe('0x4')](_0x3a26eb,_0x19e7d3)['then'](function(_0x4c50ca){if(_0x4c50ca[_0xc4fe('0x5')]){return _0x390237(_0x4c50ca['error'][_0xc4fe('0x6')]);}else{return _0x1afc8a(_0x4c50ca[_0xc4fe('0x7')]);}})['catch'](function(_0x3824b0){return _0x390237(_0x3824b0);});});}exports[_0xc4fe('0x8')]=function(_0x1a5eaf,_0xe61ed1){return request(_0xc4fe('0x9'),{'account':_0x1a5eaf,'message':_0xe61ed1});}; \ No newline at end of file +var _0xbda4=['client','http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x1db506,_0x1a4765){var _0x398baf=function(_0x47fbbb){while(--_0x47fbbb){_0x1db506['push'](_0x1db506['shift']());}};_0x398baf(++_0x1a4765);}(_0xbda4,0x1cd));var _0x4bda=function(_0x5b5862,_0x3e710f){_0x5b5862=_0x5b5862-0x0;var _0x18966f=_0xbda4[_0x5b5862];return _0x18966f;};'use strict';var BPromise=require(_0x4bda('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x4bda('0x1')][_0x4bda('0x2')]({'port':0x232b});function request(_0x170e41,_0x3bb66a){return new BPromise(function(_0x31040c,_0xfae27){return client[_0x4bda('0x3')](_0x170e41,_0x3bb66a)[_0x4bda('0x4')](function(_0x209eb5){if(_0x209eb5[_0x4bda('0x5')]){return _0xfae27(_0x209eb5[_0x4bda('0x5')][_0x4bda('0x6')]);}else{return _0x31040c(_0x209eb5[_0x4bda('0x7')]);}})[_0x4bda('0x8')](function(_0x4972c1){return _0xfae27(_0x4972c1);});});}exports[_0x4bda('0x9')]=function(_0x3081c7,_0x533710){return request(_0x4bda('0xa'),{'account':_0x3081c7,'message':_0x533710});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 91c5a96..9920166 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 _0xfb56=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','stream','_localBuffer','_inBody','inherits'];(function(_0x33e62e,_0x52020a){var _0x1d0aa3=function(_0x1871a9){while(--_0x1871a9){_0x33e62e['push'](_0x33e62e['shift']());}};_0x1d0aa3(++_0x52020a);}(_0xfb56,0x194));var _0x6fb5=function(_0x250d2a,_0x2983be){_0x250d2a=_0x250d2a-0x0;var _0x5738fa=_0xfb56[_0x250d2a];return _0x5738fa;};'use strict';var util=require('util');var Transform=require(_0x6fb5('0x0'))['Transform'];function AGIReply(_0x35ac1a){Transform['call'](this,_0x35ac1a);this[_0x6fb5('0x1')]='';this[_0x6fb5('0x2')]=![];}util[_0x6fb5('0x3')](AGIReply,Transform);AGIReply[_0x6fb5('0x4')][_0x6fb5('0x5')]=function(_0xdafa9,_0x433a2e,_0x14406a){var _0x30b8a4='\x0a',_0x1829b5=['\x0a\x0a',_0x6fb5('0x6')],_0x433414=-0x1,_0x3b6412=-0x1,_0x4ff7e2='',_0xc8f72e=0x0,_0x434f15='',_0x52837f='';this[_0x6fb5('0x1')]+=_0xdafa9[_0x6fb5('0x7')]();_0x434f15=this['_localBuffer'];if(!this[_0x6fb5('0x2')]){_0xc8f72e=0x0;while(_0x1829b5[_0xc8f72e]){while((_0x3b6412=_0x434f15[_0x6fb5('0x8')](_0x1829b5[_0xc8f72e]))!=-0x1){_0x4ff7e2=_0x1829b5[_0xc8f72e];_0x52837f=_0x434f15[_0x6fb5('0x9')](0x0,_0x3b6412);_0x434f15=_0x434f15[_0x6fb5('0x9')](_0x3b6412+_0x4ff7e2[_0x6fb5('0xa')]);var _0x9be137=_0x52837f[_0x6fb5('0xb')](_0x30b8a4),_0x15c86d=0x0,_0x7ef678={},_0x149dc0='',_0x40b81='',_0x177078=-0x1;while(_0x9be137[_0x15c86d]){_0x177078=_0x9be137[_0x15c86d][_0x6fb5('0x8')](':');if(_0x177078!=-0x1){_0x149dc0=_0x9be137[_0x15c86d][_0x6fb5('0xc')](0x0,_0x177078)[_0x6fb5('0xd')]();_0x40b81=_0x9be137[_0x15c86d]['slice'](_0x177078+0x1)['trim']();if(_0x149dc0['length']>0x0){_0x7ef678[_0x149dc0]=_0x40b81;}}else{}_0x15c86d++;}this[_0x6fb5('0xe')](_0x6fb5('0xf'),_0x7ef678);this['_inBody']=!![];}_0xc8f72e++;}this[_0x6fb5('0x1')]=_0x434f15;}else{while((_0x433414=_0x434f15['indexOf'](_0x30b8a4))!=-0x1){_0x52837f=_0x434f15[_0x6fb5('0x9')](0x0,_0x433414);this[_0x6fb5('0xe')](_0x6fb5('0x10'),_0x52837f);_0x434f15=_0x434f15[_0x6fb5('0x9')](_0x433414+_0x30b8a4[_0x6fb5('0xa')]);}this[_0x6fb5('0x1')]=_0x434f15;}_0x14406a();};module['exports']=AGIReply; \ No newline at end of file +var _0x1917=['_transform','\x0d\x0a\x0d\x0a','toString','substring','length','split','indexOf','slice','trim','headers','exports','util','Transform','call','_localBuffer','_inBody','inherits','prototype'];(function(_0x196646,_0x360c5c){var _0x1d765c=function(_0x72feed){while(--_0x72feed){_0x196646['push'](_0x196646['shift']());}};_0x1d765c(++_0x360c5c);}(_0x1917,0x9b));var _0x7191=function(_0x3cefd0,_0x5e8682){_0x3cefd0=_0x3cefd0-0x0;var _0x158b28=_0x1917[_0x3cefd0];return _0x158b28;};'use strict';var util=require(_0x7191('0x0'));var Transform=require('stream')[_0x7191('0x1')];function AGIReply(_0x12b35d){Transform[_0x7191('0x2')](this,_0x12b35d);this[_0x7191('0x3')]='';this[_0x7191('0x4')]=![];}util[_0x7191('0x5')](AGIReply,Transform);AGIReply[_0x7191('0x6')][_0x7191('0x7')]=function(_0x2065f7,_0x405136,_0x45ba3e){var _0xb5f22f='\x0a',_0x611486=['\x0a\x0a',_0x7191('0x8')],_0x45aa53=-0x1,_0x2e5a93=-0x1,_0x3dd4f6='',_0x30f45a=0x0,_0x2c4238='',_0x382a61='';this['_localBuffer']+=_0x2065f7[_0x7191('0x9')]();_0x2c4238=this[_0x7191('0x3')];if(!this[_0x7191('0x4')]){_0x30f45a=0x0;while(_0x611486[_0x30f45a]){while((_0x2e5a93=_0x2c4238['indexOf'](_0x611486[_0x30f45a]))!=-0x1){_0x3dd4f6=_0x611486[_0x30f45a];_0x382a61=_0x2c4238[_0x7191('0xa')](0x0,_0x2e5a93);_0x2c4238=_0x2c4238['substring'](_0x2e5a93+_0x3dd4f6[_0x7191('0xb')]);var _0x1e5520=_0x382a61[_0x7191('0xc')](_0xb5f22f),_0x538baf=0x0,_0x283643={},_0x41a357='',_0x1f7a0d='',_0x46abdf=-0x1;while(_0x1e5520[_0x538baf]){_0x46abdf=_0x1e5520[_0x538baf][_0x7191('0xd')](':');if(_0x46abdf!=-0x1){_0x41a357=_0x1e5520[_0x538baf][_0x7191('0xe')](0x0,_0x46abdf)[_0x7191('0xf')]();_0x1f7a0d=_0x1e5520[_0x538baf][_0x7191('0xe')](_0x46abdf+0x1)[_0x7191('0xf')]();if(_0x41a357['length']>0x0){_0x283643[_0x41a357]=_0x1f7a0d;}}else{}_0x538baf++;}this['emit'](_0x7191('0x10'),_0x283643);this[_0x7191('0x4')]=!![];}_0x30f45a++;}this[_0x7191('0x3')]=_0x2c4238;}else{while((_0x45aa53=_0x2c4238[_0x7191('0xd')](_0xb5f22f))!=-0x1){_0x382a61=_0x2c4238['substring'](0x0,_0x45aa53);this['emit']('line',_0x382a61);_0x2c4238=_0x2c4238[_0x7191('0xa')](_0x45aa53+_0xb5f22f['length']);}this[_0x7191('0x3')]=_0x2c4238;}_0x45ba3e();};module[_0x7191('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ee7e525..fd425eb 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 _0x6bb8=['agentPause','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','http','request','then','error','result','catch','production','getMailAccountById','ShowMailAccount','MailServerOut','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin'];(function(_0x4a2ff1,_0x13de3b){var _0x106aa7=function(_0x433dca){while(--_0x433dca){_0x4a2ff1['push'](_0x4a2ff1['shift']());}};_0x106aa7(++_0x13de3b);}(_0x6bb8,0x1bc));var _0x86bb=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x6bb8[_0xf2f332];return _0x56cce3;};'use strict';var BPromise=require(_0x86bb('0x0'));var moment=require(_0x86bb('0x1'));var _=require('lodash');var util=require('util');var jayson=require('jayson/promise');var client=jayson['client'][_0x86bb('0x2')]({'port':0x2329});function request(_0xfdbab1,_0x31bf83){return new BPromise(function(_0xe1d3f2,_0x58d337){return client[_0x86bb('0x3')](_0xfdbab1,_0x31bf83)[_0x86bb('0x4')](function(_0x534eae){if(_0x534eae[_0x86bb('0x5')]){return _0x58d337(_0x534eae[_0x86bb('0x5')]['message']);}else{return _0xe1d3f2(_0x534eae[_0x86bb('0x6')]);}})[_0x86bb('0x7')](function(_0x4736c){return _0x58d337(_0x4736c);});});}exports['getSquareProject']=function(_0x564d6d){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x564d6d},'attributes':[_0x86bb('0x8')]}});};exports[_0x86bb('0x9')]=function(_0x57e1ab){return request(_0x86bb('0xa'),{'options':{'raw':![],'where':{'id':_0x57e1ab},'include':[{'model':_0x86bb('0xb'),'as':'Smtp'}],'attributes':['id',_0x86bb('0xc'),'email']}});};exports['getSquareProjectById']=function(_0x16d8f5){return request('ShowSquareProject',{'options':{'where':{'id':_0x16d8f5},'attributes':['name']}});};exports[_0x86bb('0xd')]=function(_0x1bd42d){return request(_0x86bb('0xe'),{'options':{'where':{'id':_0x1bd42d},'attributes':[_0x86bb('0xc')]}});};exports[_0x86bb('0xf')]=function(_0x4be52c){return request(_0x86bb('0x10'),{'options':{'where':{'id':_0x4be52c},'attributes':[_0x86bb('0xc')]}});};exports[_0x86bb('0x11')]=function(_0x374dda){return request(_0x86bb('0x12'),{'options':{'where':{'id':_0x374dda},'attributes':[_0x86bb('0x13')]}});};exports['getUserById']=function(_0x21a19c){return request('ShowUser',{'options':{'where':{'id':_0x21a19c},'attributes':[_0x86bb('0xc')]}});};exports[_0x86bb('0x14')]=function(_0x265827){return request(_0x86bb('0x15'),{'options':{'where':{'id':_0x265827},'attributes':[_0x86bb('0xc')]}});};exports[_0x86bb('0x16')]=function(_0x13436a){return request(_0x86bb('0x17'),{'options':{'where':{'id':_0x13436a},'attributes':[_0x86bb('0x18')]}});};exports[_0x86bb('0x19')]=function(_0xf6632){return request(_0x86bb('0x1a'),{'options':{'raw':![],'where':{'id':_0xf6632},'include':[{'model':_0x86bb('0x1b'),'as':_0x86bb('0x1c')}]}});};exports[_0x86bb('0x1d')]=function(_0x41b43a){return request(_0x86bb('0x1e'),{'options':{'where':{'id':_0x41b43a},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x446e81){return request(_0x86bb('0x1f'),{'body':_0x446e81});};exports[_0x86bb('0x20')]=function(_0x4635c3){return request(_0x86bb('0x21'),{'body':_0x4635c3});};exports[_0x86bb('0x22')]=function(_0x4c74be){return request(_0x86bb('0x23'),{'body':_[_0x86bb('0x24')](_0x4c74be,{'project_name':_0x4c74be[_0x86bb('0x25')],'prev_project_name':_0x4c74be[_0x86bb('0x26')]||'','is_subproject':_0x4c74be[_0x86bb('0x26')]?!![]:![],'leaveAt':moment()[_0x86bb('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x86bb('0x28')]=function(_0x2b4870){return request(_0x86bb('0x29'),{'body':_0x2b4870});};exports[_0x86bb('0x2a')]=function(_0x263289){return request('CreateSquareMessage',{'body':_0x263289});};exports[_0x86bb('0x2b')]=function(_0x3aaa31){return request(_0x86bb('0x2c'),{'options':{'raw':![],'where':{'phone':_0x3aaa31[_0x86bb('0x2d')],'ListId':_0x3aaa31[_0x86bb('0x2e')]}}})[_0x86bb('0x4')](function(_0x250ccd){if(_0x250ccd){return _0x250ccd;}return request(_0x86bb('0x2f'),{'body':_0x3aaa31});});};exports[_0x86bb('0x30')]=function(_0x1d07e8){return request(_0x86bb('0x31'),{'options':{'where':{'id':_0x1d07e8},'attributes':[_0x86bb('0xc')]}});};exports[_0x86bb('0x32')]=function(_0xe14a6c,_0x1f9c64){return request('LoginUser',{'body':{'interface':_0x1f9c64},'options':{'where':_0xe14a6c}});};exports[_0x86bb('0x33')]=function(_0x35c6d7,_0x138b6e,_0x1e66d5){return request('PauseUser',{'body':{'type':_0x138b6e,'uniqueid':_0x1e66d5},'options':{'where':_0x35c6d7}});};exports[_0x86bb('0x34')]=function(_0x440c9b){return request(_0x86bb('0x35'),{'body':{},'options':{'where':_0x440c9b}});};exports[_0x86bb('0x36')]=function(_0x1fca90){return request('LogoutUser',{'body':{},'options':{'where':_0x1fca90}});}; \ No newline at end of file +var _0x8dbb=['getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','util','jayson/promise','client','request','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x8dbb,0x138));var _0xb8db=function(_0x4bf279,_0x537317){_0x4bf279=_0x4bf279-0x0;var _0x324b86=_0x8dbb[_0x4bf279];return _0x324b86;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0xb8db('0x0'));var jayson=require(_0xb8db('0x1'));var client=jayson[_0xb8db('0x2')]['http']({'port':0x2329});function request(_0x3fc993,_0x24a717){return new BPromise(function(_0x364c90,_0x143508){return client[_0xb8db('0x3')](_0x3fc993,_0x24a717)['then'](function(_0x2d4ac5){if(_0x2d4ac5[_0xb8db('0x4')]){return _0x143508(_0x2d4ac5[_0xb8db('0x4')][_0xb8db('0x5')]);}else{return _0x364c90(_0x2d4ac5['result']);}})[_0xb8db('0x6')](function(_0x43e7b0){return _0x143508(_0x43e7b0);});});}exports[_0xb8db('0x7')]=function(_0x7bd5ee){return request(_0xb8db('0x8'),{'options':{'raw':![],'where':{'name':_0x7bd5ee},'attributes':[_0xb8db('0x9')]}});};exports[_0xb8db('0xa')]=function(_0x3d8b45){return request(_0xb8db('0xb'),{'options':{'raw':![],'where':{'id':_0x3d8b45},'include':[{'model':_0xb8db('0xc'),'as':_0xb8db('0xd')}],'attributes':['id',_0xb8db('0xe'),_0xb8db('0xf')]}});};exports['getSquareProjectById']=function(_0xb1d22b){return request(_0xb8db('0x8'),{'options':{'where':{'id':_0xb1d22b},'attributes':[_0xb8db('0xe')]}});};exports[_0xb8db('0x10')]=function(_0x14ffd7){return request(_0xb8db('0x11'),{'options':{'where':{'id':_0x14ffd7},'attributes':[_0xb8db('0xe')]}});};exports[_0xb8db('0x12')]=function(_0x2e9eff){return request('ShowVariable',{'options':{'where':{'id':_0x2e9eff},'attributes':[_0xb8db('0xe')]}});};exports['getSquareOdbcById']=function(_0xfc34b){return request(_0xb8db('0x13'),{'options':{'where':{'id':_0xfc34b},'attributes':[_0xb8db('0x14')]}});};exports[_0xb8db('0x15')]=function(_0xe64ad){return request(_0xb8db('0x16'),{'options':{'where':{'id':_0xe64ad},'attributes':[_0xb8db('0xe')]}});};exports[_0xb8db('0x17')]=function(_0x3a3dfc){return request('ShowTrunk',{'options':{'where':{'id':_0x3a3dfc},'attributes':[_0xb8db('0xe')]}});};exports[_0xb8db('0x18')]=function(_0x188500){return request(_0xb8db('0x19'),{'options':{'where':{'id':_0x188500},'attributes':[_0xb8db('0x1a')]}});};exports[_0xb8db('0x1b')]=function(_0x4a2aed){return request(_0xb8db('0x1c'),{'options':{'raw':![],'where':{'id':_0x4a2aed},'include':[{'model':_0xb8db('0x1d'),'as':_0xb8db('0x1e')}]}});};exports[_0xb8db('0x1f')]=function(_0x5cdeac){return request(_0xb8db('0x20'),{'options':{'where':{'id':_0x5cdeac},'attributes':['id',_0xb8db('0xe')]}});};exports[_0xb8db('0x21')]=function(_0x298b57){return request(_0xb8db('0x22'),{'body':_0x298b57});};exports[_0xb8db('0x23')]=function(_0x41a27a){return request(_0xb8db('0x24'),{'body':_0x41a27a});};exports[_0xb8db('0x25')]=function(_0x5c8f09){return request(_0xb8db('0x26'),{'body':_[_0xb8db('0x27')](_0x5c8f09,{'project_name':_0x5c8f09['arg_1'],'prev_project_name':_0x5c8f09[_0xb8db('0x28')]||'','is_subproject':_0x5c8f09[_0xb8db('0x28')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xb8db('0x29')]=function(_0x1725e8){return request(_0xb8db('0x2a'),{'body':_0x1725e8});};exports[_0xb8db('0x2b')]=function(_0x499fbf){return request(_0xb8db('0x2c'),{'body':_0x499fbf});};exports[_0xb8db('0x2d')]=function(_0x33fc2c){return request(_0xb8db('0x2e'),{'options':{'raw':![],'where':{'phone':_0x33fc2c['phone'],'ListId':_0x33fc2c[_0xb8db('0x2f')]}}})['then'](function(_0x4b3654){if(_0x4b3654){return _0x4b3654;}return request(_0xb8db('0x30'),{'body':_0x33fc2c});});};exports[_0xb8db('0x31')]=function(_0x476e43){return request(_0xb8db('0x32'),{'options':{'where':{'id':_0x476e43},'attributes':[_0xb8db('0xe')]}});};exports['agentLogin']=function(_0x5ab837,_0x3f5695){return request(_0xb8db('0x33'),{'body':{'interface':_0x3f5695},'options':{'where':_0x5ab837}});};exports[_0xb8db('0x34')]=function(_0x57ada7,_0x2c7131,_0x4ab9b9){return request(_0xb8db('0x35'),{'body':{'type':_0x2c7131,'uniqueid':_0x4ab9b9},'options':{'where':_0x57ada7}});};exports['agentUnpause']=function(_0x3d97bd){return request(_0xb8db('0x36'),{'body':{},'options':{'where':_0x3d97bd}});};exports['agentLogout']=function(_0x1517ec){return request(_0xb8db('0x37'),{'body':{},'options':{'where':_0x1517ec}});}; \ 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 f14590e..05b58a4 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 _0x24ce=['./lex','exports'];(function(_0x1b89a0,_0x770c5b){var _0x4ee896=function(_0x4c7f93){while(--_0x4c7f93){_0x1b89a0['push'](_0x1b89a0['shift']());}};_0x4ee896(++_0x770c5b);}(_0x24ce,0x1de));var _0xe24c=function(_0x4c0ba0,_0x35ca48){_0x4c0ba0=_0x4c0ba0-0x0;var _0x30fa82=_0x24ce[_0x4c0ba0];return _0x30fa82;};var polly=require('./polly');var lex=require(_0xe24c('0x0'));module[_0xe24c('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd9c8=['./polly','./lex'];(function(_0x39ba60,_0x53dca8){var _0x9643e0=function(_0x4e96c1){while(--_0x4e96c1){_0x39ba60['push'](_0x39ba60['shift']());}};_0x9643e0(++_0x53dca8);}(_0xd9c8,0x15c));var _0x8d9c=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd9c8[_0xefd519];return _0x4bb882;};var polly=require(_0x8d9c('0x0'));var lex=require(_0x8d9c('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1273693..86341b7 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ No newline at end of file +var _0xa9e0=['exports','./lib/api'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var lex=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]=function(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808){return lex(_0x29929c,_0x5dd881,_0x550fbc,_0x18d5c9,_0x4ce2f1,_0x333808);}; \ 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 b488ec4..7c8f449 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1d69bb,_0x59a1ee){var _0x4416c1=function(_0x4f54d9){while(--_0x4f54d9){_0x1d69bb['push'](_0x1d69bb['shift']());}};_0x4416c1(++_0x59a1ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1a3ea6,_0x469e40){var _0x3ccbc3=function(_0x21c41f){while(--_0x21c41f){_0x1a3ea6['push'](_0x1a3ea6['shift']());}};_0x3ccbc3(++_0x469e40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 4f37205..963bc77 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 _0x0aa6=['exports'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x0aa6,0x12c));var _0x60aa=function(_0xded1a6,_0x363c08){_0xded1a6=_0xded1a6-0x0;var _0x4f1e12=_0x0aa6[_0xded1a6];return _0x4f1e12;};'use strict';var polly=require('./lib/api');module[_0x60aa('0x0')]=function(_0x5bd352,_0x4cfb1d,_0x596ff6,_0x159a65,_0xdfd435,_0x237b52,_0x3ee246){return polly(_0x5bd352,_0x4cfb1d,_0x596ff6,_0x159a65,_0xdfd435,_0x237b52,_0x3ee246);}; \ No newline at end of file +var _0x3fd0=['./lib/api'];(function(_0x2e0ffa,_0x451f12){var _0x24d627=function(_0x4d0f09){while(--_0x4d0f09){_0x2e0ffa['push'](_0x2e0ffa['shift']());}};_0x24d627(++_0x451f12);}(_0x3fd0,0x191));var _0x03fd=function(_0x53d05d,_0x248066){_0x53d05d=_0x53d05d-0x0;var _0x1c4723=_0x3fd0[_0x53d05d];return _0x1c4723;};'use strict';var polly=require(_0x03fd('0x0'));module['exports']=function(_0x5d32f7,_0x12f948,_0x32b761,_0x46edcc,_0x22727c,_0x184def,_0x6494b9){return polly(_0x5d32f7,_0x12f948,_0x32b761,_0x46edcc,_0x22727c,_0x184def,_0x6494b9);}; \ 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 f4485cb..f34a5ad 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 _0xa44d=['bluebird','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0xcae535,_0x4b1ea7){var _0x37d4cc=function(_0x20bc00){while(--_0x20bc00){_0xcae535['push'](_0xcae535['shift']());}};_0x37d4cc(++_0x4b1ea7);}(_0xa44d,0x198));var _0xda44=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0xa44d[_0x5517c0];return _0x33803b;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xda44('0x0'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x4636bc,_0x2233b7,_0x39fb63){return new BPromise(function(_0x1ff9a9,_0x4954de){_0x4636bc[_0xda44('0x1')](_0x2233b7,function(_0x8c5a3d,_0xe3877c){if(_0x8c5a3d){_0x4954de(_0x8c5a3d);}else if(_0xe3877c){if(_0xe3877c[_0xda44('0x2')]instanceof Buffer){fs['writeFile'](_0x39fb63,_0xe3877c[_0xda44('0x2')],function(_0x260832){if(_0x260832){_0x4954de(_0x260832);}else{_0x1ff9a9();}});}else{_0x4954de(new Error(_0xda44('0x3')));}}else{_0x4954de(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xda44('0x4')]=function(_0x1089c2,_0xaa84b7,_0xb8415f,_0x5448d0,_0x39db78,_0xdd1d8f,_0x408b63){var _0x20a067=new AWS[(_0xda44('0x5'))]({'accessKeyId':_0x1089c2,'secretAccessKey':_0xaa84b7,'region':_0xb8415f});var _0xa13c26={'Text':_0x39db78,'TextType':_0xdd1d8f||_0xda44('0x6'),'OutputFormat':_0xda44('0x7'),'VoiceId':_0x5448d0};return pollyResult(_0x20a067,_0xa13c26,_0x408b63);}; \ No newline at end of file +var _0xdf6a=['text','mp3','bluebird','randomstring','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x5674cf,_0x5e102d){var _0x46f0e1=function(_0x23da9b){while(--_0x23da9b){_0x5674cf['push'](_0x5674cf['shift']());}};_0x46f0e1(++_0x5e102d);}(_0xdf6a,0x152));var _0xadf6=function(_0x4f5515,_0x49bd25){_0x4f5515=_0x4f5515-0x0;var _0x2eb9d8=_0xdf6a[_0x4f5515];return _0x2eb9d8;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xadf6('0x0'));var rs=require(_0xadf6('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x2808ed,_0x4cd141,_0x64f602){return new BPromise(function(_0x25823a,_0x5abaca){_0x2808ed[_0xadf6('0x2')](_0x4cd141,function(_0x42385d,_0x32019d){if(_0x42385d){_0x5abaca(_0x42385d);}else if(_0x32019d){if(_0x32019d[_0xadf6('0x3')]instanceof Buffer){fs['writeFile'](_0x64f602,_0x32019d[_0xadf6('0x3')],function(_0x96b85b){if(_0x96b85b){_0x5abaca(_0x96b85b);}else{_0x25823a();}});}else{_0x5abaca(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5abaca(new Error(_0xadf6('0x4')));}});});}module[_0xadf6('0x5')]=function(_0x56eaf1,_0x173dbd,_0x136320,_0x5933ea,_0x2fffe3,_0x1877f0,_0x33a884){var _0x61e99e=new AWS['Polly']({'accessKeyId':_0x56eaf1,'secretAccessKey':_0x173dbd,'region':_0x136320});var _0x10b4ea={'Text':_0x2fffe3,'TextType':_0x1877f0||_0xadf6('0x6'),'OutputFormat':_0xadf6('0x7'),'VoiceId':_0x5933ea};return pollyResult(_0x61e99e,_0x10b4ea,_0x33a884);}; \ 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 a144314..f437310 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x3cfbbd,_0x2e2dc9,_0x188450,_0x406cf5){return asr(_0x3cfbbd,_0x2e2dc9,_0x188450);}; \ No newline at end of file +var _0x98cf=['./lib/api'];(function(_0x5d61b4,_0x4f7b91){var _0x183fc5=function(_0x5ecf92){while(--_0x5ecf92){_0x5d61b4['push'](_0x5d61b4['shift']());}};_0x183fc5(++_0x4f7b91);}(_0x98cf,0x159));var _0xf98c=function(_0x13cfe9,_0x302bac){_0x13cfe9=_0x13cfe9-0x0;var _0x1a9fc1=_0x98cf[_0x13cfe9];return _0x1a9fc1;};'use strict';var asr=require(_0xf98c('0x0'));module['exports']=function(_0x45f60e,_0x1da8ab,_0x336c77,_0x1d784a){return asr(_0x45f60e,_0x1da8ab,_0x336c77);}; \ 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 11f1d37..6e2e22a 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 _0xb07f=['bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','8000','url'];(function(_0x2d361c,_0x594a94){var _0x5d6edc=function(_0x5a2c9){while(--_0x5a2c9){_0x2d361c['push'](_0x2d361c['shift']());}};_0x5d6edc(++_0x594a94);}(_0xb07f,0x109));var _0xfb07=function(_0xc259fc,_0x2e036d){_0xc259fc=_0xc259fc-0x0;var _0x4f641e=_0xb07f[_0xc259fc];return _0x4f641e;};'use strict';var url=require(_0xfb07('0x0'));var BPromise=require(_0xfb07('0x1'));var fs=require('fs');var host=_0xfb07('0x2');module[_0xfb07('0x3')]=function(_0x2e561d,_0xc9317c,_0x3a262e){return new BPromise(function(_0x25212c,_0x3b3c05){var _0x2fc1ce;if(typeof _0x2e561d!==_0xfb07('0x4')||_0x2e561d['length']===0x0){return _0x3b3c05(_0xfb07('0x5'));}if(typeof _0xc9317c!==_0xfb07('0x4')||_0xc9317c[_0xfb07('0x6')]===0x0){return _0x3b3c05(_0xfb07('0x7'));}if(typeof _0x3a262e!==_0xfb07('0x8')&&(typeof _0x3a262e!==_0xfb07('0x4')||_0x3a262e[_0xfb07('0x6')]===0x0)){return _0x3b3c05(_0xfb07('0x9'));}try{_0x2fc1ce=fs[_0xfb07('0xa')](_0x2e561d)[_0xfb07('0xb')](_0xfb07('0xc'));}catch(_0x360df9){return _0x3b3c05(_0x360df9);}return _0x25212c({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0xc9317c,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xfb07('0xd'),'languageCode':_0x3a262e},'audio':{'content':_0x2fc1ce}},'json':!![]});});}; \ No newline at end of file +var _0xfd28=['lang\x20should\x20be\x20a\x20string','toString','/v1/speech:recognize?key=','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xfd28,0x148));var _0x8fd2=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xfd28[_0x26fc81];return _0x9feece;};'use strict';var url=require('url');var BPromise=require(_0x8fd2('0x0'));var fs=require('fs');var host=_0x8fd2('0x1');module['exports']=function(_0x56f4d0,_0x4e5c5e,_0x37baf5){return new BPromise(function(_0xf7417d,_0x4e2108){var _0x4b22ae;if(typeof _0x56f4d0!==_0x8fd2('0x2')||_0x56f4d0[_0x8fd2('0x3')]===0x0){return _0x4e2108(_0x8fd2('0x4'));}if(typeof _0x4e5c5e!==_0x8fd2('0x2')||_0x4e5c5e[_0x8fd2('0x3')]===0x0){return _0x4e2108('key\x20should\x20be\x20a\x20string');}if(typeof _0x37baf5!=='undefined'&&(typeof _0x37baf5!==_0x8fd2('0x2')||_0x37baf5[_0x8fd2('0x3')]===0x0)){return _0x4e2108(_0x8fd2('0x5'));}try{_0x4b22ae=fs['readFileSync'](_0x56f4d0)[_0x8fd2('0x6')]('base64');}catch(_0x2842f3){return _0x4e2108(_0x2842f3);}return _0xf7417d({'method':'POST','uri':host+_0x8fd2('0x7')+_0x4e5c5e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x8fd2('0x8'),'languageCode':_0x37baf5},'audio':{'content':_0x4b22ae}},'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 d8e3772..ab1b5cf 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 _0xa5ec=['./asr'];(function(_0x4fa559,_0x5e7a03){var _0x59a8ed=function(_0x29a158){while(--_0x29a158){_0x4fa559['push'](_0x4fa559['shift']());}};_0x59a8ed(++_0x5e7a03);}(_0xa5ec,0xbd));var _0xca5e=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0xa5ec[_0x22ffbf];return _0x360c17;};var asr=require(_0xca5e('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xdd3a=['exports','./asr'];(function(_0x54c45f,_0xa7e454){var _0x449cb7=function(_0x1140e8){while(--_0x1140e8){_0x54c45f['push'](_0x54c45f['shift']());}};_0x449cb7(++_0xa7e454);}(_0xdd3a,0xa5));var _0xadd3=function(_0x273c62,_0x49eb78){_0x273c62=_0x273c62-0x0;var _0x86f13e=_0xdd3a[_0x273c62];return _0x86f13e;};var asr=require(_0xadd3('0x0'));module[_0xadd3('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 0a1d142..8b65a86 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 _0x9459=['%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','CustomAction','channelData','CustomActionData','AudioFromTts','Data','audiofile','bluebird','dialogflow','md5','querystring','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','path','get','error','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','unlink','pipe','end','https:','data','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','[%s]\x20%s:%s','name','message','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x9459,0x92));var _0x9945=function(_0xa25165,_0x1574cc){_0xa25165=_0xa25165-0x0;var _0xa0cd92=_0x9459[_0xa25165];return _0xa0cd92;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x9945('0x0'));var dialogflow=require(_0x9945('0x1'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x9945('0x2'));var path=require('path');var querystring=require(_0x9945('0x3'));var rp=require('request-promise');var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x9945('0x4'))[_0x9945('0x5')];var util=require(_0x9945('0x6'));var aws=require(_0x9945('0x7'));var google=require(_0x9945('0x8'));var sestek=require(_0x9945('0x9'));var tilde=require(_0x9945('0xa'));var logger=require(_0x9945('0xb'))(_0x9945('0xc'));var ISPEECH_API=_0x9945('0xd');function downloadFile(_0x1b1d57,_0x57e732){return new BPromise(function(_0x4cb77d,_0x3a6b28){var _0x351a24=urlParse(_0x1b1d57);var _0xb64046=_0x351a24[_0x9945('0xe')]==='https:'?https:http;var _0x3da099={'host':_0x351a24[_0x9945('0xf')],'path':_0x351a24[_0x9945('0x10')],'headers':{'user-agent':'WHAT_EVER'}};_0xb64046[_0x9945('0x11')](_0x3da099,function(_0x2be6b0){if(_0x2be6b0['statusCode']!==0xc8){logger[_0x9945('0x12')]('request\x20to\x20'+_0x1b1d57+'\x20failed,\x20status\x20code\x20=\x20'+_0x2be6b0[_0x9945('0x13')]+'\x20('+_0x2be6b0[_0x9945('0x14')]+')');_0x3a6b28(new Error('request\x20to\x20'+_0x1b1d57+_0x9945('0x15')+_0x2be6b0[_0x9945('0x13')]+'\x20('+_0x2be6b0[_0x9945('0x14')]+')'));return;}var _0x41771a=fs['createWriteStream'](_0x57e732);_0x41771a['on'](_0x9945('0x16'),function(){logger[_0x9945('0x17')](_0x9945('0x18'));_0x41771a[_0x9945('0x19')](_0x4cb77d);});_0x41771a['on'](_0x9945('0x12'),function(_0x132a8c){fs[_0x9945('0x1a')](_0x57e732);logger['error']('download\x20error',_0x132a8c);_0x3a6b28(_0x132a8c);});_0x2be6b0[_0x9945('0x1b')](_0x41771a);})['on'](_0x9945('0x12'),function(_0x526649){logger[_0x9945('0x12')](_0x526649);_0x3a6b28(_0x526649);})[_0x9945('0x1c')]();});}function uploadFile(_0x3a6d0c){return new BPromise(function(_0x3ae79a,_0xa6fb73){var _0x5188c1=urlParse(_0x3a6d0c);var _0x523c85=_0x5188c1[_0x9945('0xe')]===_0x9945('0x1d')?https:http;var _0x504162={'host':_0x5188c1[_0x9945('0xf')],'path':_0x5188c1['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x523c85[_0x9945('0x11')](_0x504162,function(_0x552b16){if(_0x552b16[_0x9945('0x13')]!==0xc8){_0xa6fb73(new Error('request\x20to\x20'+_0x3a6d0c+'\x20failed,\x20status\x20code\x20=\x20'+_0x552b16[_0x9945('0x13')]+'\x20('+_0x552b16['statusMessage']+')'));return;}var _0x51dbeb='';_0x552b16['on'](_0x9945('0x1e'),function(_0x497ea0){_0x51dbeb+=_0x497ea0;});_0x552b16['on']('end',function(){_0x3ae79a(_0x51dbeb);});})['on'](_0x9945('0x12'),function(_0x1dff4e){_0xa6fb73(_0x1dff4e);})['end']();});}function convertFile(_0x48e94c,_0x347b87){return new BPromise(function(_0x548a2f,_0x51eb0b){var _0x301dc6=sox['transcode'](_0x48e94c,_0x347b87,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x301dc6['on'](_0x9945('0x12'),function(_0x1600a5){logger[_0x9945('0x12')](_0x9945('0x1f'),_0x1600a5);_0x51eb0b(_0x1600a5);});_0x301dc6['on']('end',function(){logger[_0x9945('0x17')](_0x9945('0x20'));_0x548a2f();});_0x301dc6['start']();});}function base64Decode(_0x4fbd91,_0x11aecf){var _0x3a8adb=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs[_0x9945('0x23')](0x4)+_0x9945('0x24'));fs[_0x9945('0x25')](_0x3a8adb,_0x4fbd91,_0x9945('0x26'));return convertFile(_0x3a8adb,_0x11aecf)[_0x9945('0x27')](function(){try{fs[_0x9945('0x1a')](_0x3a8adb);fs[_0x9945('0x28')](_0x11aecf,'777');}catch(_0x3a4de3){logger[_0x9945('0x12')](_0x3a4de3);}return _0x11aecf[_0x9945('0x29')]('.')[0x0];});}function base64Encode(_0x2a7ca2){var _0x31dd40=fs[_0x9945('0x2a')](_0x2a7ca2);return new Buffer(_0x31dd40)[_0x9945('0x2b')]('base64');}exports[_0x9945('0x2c')]=function(_0x45135a,_0x49637a,_0x2a3b85,_0x1a8171,_0xe5c6ae,_0xd2748f){var _0x46018e,_0x4059b4;var _0x57b316=_0x9945('0x2d');var _0x57200e='?key='+_0x45135a;var _0x4936ad={};if(_0x49637a===_0x9945('0x2e')){_0x4936ad[_0x9945('0x2f')]={'ssml':_0x2a3b85};}else{_0x4936ad[_0x9945('0x2f')]={'text':_0x2a3b85};};_0x4936ad[_0x9945('0x30')]={'languageCode':_0x1a8171,'ssmlGender':_0xe5c6ae};_0x4936ad[_0x9945('0x31')]={'audioEncoding':_0x9945('0x32'),'sampleRateHertz':0x1f40};var _0x1c599b={'url':_0x57b316+_0x9945('0x33')+_0x57200e,'method':_0x9945('0x34'),'json':!![],'body':_0x4936ad};return rp(_0x1c599b)[_0x9945('0x27')](function(_0x2882c0){return new BPromise(function(_0x24ecaa,_0x3c3c3c){_0x46018e=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs[_0x9945('0x23')](0x4)+_0x9945('0x35'));var _0xd2fc64=Buffer[_0x9945('0x36')](_0x2882c0['audioContent'],_0x9945('0x26'));return fs[_0x9945('0x37')](_0x46018e,_0xd2fc64,function(_0x26023d){_0x3c3c3c(_0x26023d);},function(_0x4be609){fs[_0x9945('0x28')](_0x46018e,_0x9945('0x38'));_0x24ecaa(_0x4be609);});});})[_0x9945('0x27')](function(_0xc7d87f){_0x4059b4=path[_0x9945('0x21')](__dirname,'tmp',rs['generate'](0x4)+_0x9945('0x24'));return convertFile(_0x46018e,_0x4059b4);})[_0x9945('0x27')](function(){try{fs[_0x9945('0x1a')](_0x46018e);fs[_0x9945('0x28')](_0x4059b4,_0x9945('0x38'));}catch(_0x4071af){logger[_0x9945('0x12')](_0x4071af);}logger[_0x9945('0x17')](_0x9945('0x39'),_0x4059b4[_0x9945('0x29')]('.')[0x0]);return _0x4059b4[_0x9945('0x29')]('.')[0x0];});};exports[_0x9945('0x3a')]=function(_0x41ef8c,_0x8b7fa2){var _0x5df787=_0x9945('0x3b');var _0x3565c6,_0x3fd738;var _0x50bde5;var _0x4a481b={'encoding':_0x9945('0x3c'),'method':_0x9945('0x34'),'timeout':0x2710,'url':_0x5df787,'headers':{'Content-Type':_0x9945('0x3d')},'body':_0x9945('0x3e')+encodeURIComponent(JSON[_0x9945('0x3f')]([[['jQ1olc',JSON[_0x9945('0x3f')]([_0x41ef8c,_0x8b7fa2||'en',![],_0x9945('0x40')]),null,_0x9945('0x41')]]]))};return rp(_0x4a481b)[_0x9945('0x27')](function(_0x1d685d){try{_0x50bde5=eval(_0x1d685d[_0x9945('0x42')](0x5))[0x0][0x2];}catch(_0x1ae825){throw new Error(_0x9945('0x43')+_0x1d685d[_0x9945('0x1e')]);}if(!_0x50bde5){if(_0x41ef8c[_0x9945('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x9945('0x45')+_0x8b7fa2+_0x9945('0x46'));}}try{_0x50bde5=eval(_0x50bde5)[0x0];}catch(_0x180a3d){throw new Error(_0x9945('0x43')+res[_0x9945('0x1e')]);}const _0x3573a5=_0x50bde5;_0x3565c6=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs['generate'](0x4)+_0x9945('0x35'));fs[_0x9945('0x25')](_0x3565c6,_0x50bde5,{'encoding':'base64'});_0x3fd738=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs['generate'](0x4)+'.wav');return convertFile(_0x3565c6,_0x3fd738);})[_0x9945('0x27')](function(){try{fs[_0x9945('0x1a')](_0x3565c6);fs[_0x9945('0x28')](_0x3fd738,_0x9945('0x38'));}catch(_0x2919b8){logger[_0x9945('0x12')](_0x2919b8);}logger[_0x9945('0x17')](_0x9945('0x47'),_0x3fd738[_0x9945('0x29')]('.')[0x0]);return _0x3fd738[_0x9945('0x29')]('.')[0x0];});};exports[_0x9945('0x48')]=function(_0x4c8fd1,_0x3c4c8f,_0x5899da){return google[_0x9945('0x49')](_0x4c8fd1,_0x3c4c8f,_0x5899da)[_0x9945('0x27')](function(_0x158578){logger[_0x9945('0x17')](_0x158578[_0x9945('0x4a')]);return rp(_0x158578);})[_0x9945('0x27')](function(_0xb85577){var _0x46c820='';var _0x56c7fa=0x0;try{fs[_0x9945('0x1a')](_0x4c8fd1);}catch(_0x31af8e){logger[_0x9945('0x12')](_0x31af8e);}if(_0xb85577&&_0xb85577[_0x9945('0x4b')]){_0x46c820=_0xb85577['results'][_0x9945('0x4c')](function(_0x975ae5){return _0x975ae5&&_0x975ae5['alternatives'][0x0]&&_0x975ae5[_0x9945('0x4d')][0x0]['transcript']?_0x975ae5[_0x9945('0x4d')][0x0][_0x9945('0x4e')]:'';})['join']('\x0a');_0x56c7fa=_0xb85577['results']['map'](function(_0x35e9ef){return _0x35e9ef&&_0x35e9ef[_0x9945('0x4d')][0x0]&&_0x35e9ef['alternatives'][0x0][_0x9945('0x4f')]?_0x35e9ef['alternatives'][0x0][_0x9945('0x4f')]:0x0;})[_0x9945('0x50')]('\x0a');}logger[_0x9945('0x17')](_0x9945('0x51'),_0x46c820);logger['info']('googleASR\x20confidence',_0x56c7fa);return{'transcript':_0x46c820,'confidence':_0x56c7fa};})['catch'](function(_0x2a3c3e){logger[_0x9945('0x12')](_0x9945('0x52'),_0x2a3c3e[_0x9945('0x13')],_0x2a3c3e[_0x9945('0x53')],_0x2a3c3e[_0x9945('0x54')]);});};exports['googleDialogflow']=function(_0x51848d,_0x19dccd,_0xaf96c3,_0x303809){var _0x285aa6=apiai(_0x19dccd,{'language':_0x303809||'en'});return _0x285aa6['textRequest'](_0xaf96c3,{'sessionId':md5(_0x51848d)})[_0x9945('0x27')](function(_0x5ebdff){logger[_0x9945('0x17')](JSON['stringify'](_0x5ebdff));return{'source':_0x5ebdff[_0x9945('0x55')][_0x9945('0x56')],'resolvedQuery':_0x5ebdff[_0x9945('0x55')][_0x9945('0x57')],'action':_0x5ebdff[_0x9945('0x55')][_0x9945('0x58')],'actionIncomplete':_0x5ebdff[_0x9945('0x55')][_0x9945('0x59')],'speech':_0x5ebdff['result'][_0x9945('0x5a')][_0x9945('0x5b')],'score':_0x5ebdff['result'][_0x9945('0x5c')],'statusCode':_0x5ebdff[_0x9945('0x5d')][_0x9945('0x5e')],'endConversation':_0x5ebdff[_0x9945('0x55')][_0x9945('0x5f')][_0x9945('0x60')]||![],'isFallbackIntent':_0x5ebdff[_0x9945('0x55')][_0x9945('0x5f')]['isFallbackIntent']};});};exports[_0x9945('0x61')]=function(_0x309cba,_0x3c6a4f,_0x5e2632,_0x5ad8a5,_0xaa8e6c,_0x2fb167){var _0x516cef=_0x5ad8a5['replace'](/\\n/g,'\x0a');var _0x13ace6={'credentials':{'private_key':_0x516cef,'client_email':_0x5e2632}};var _0x202f30=new dialogflow[(_0x9945('0x62'))](_0x13ace6);var _0x1b6ea7=_0x202f30[_0x9945('0x63')](_0x3c6a4f,md5(_0x309cba));var _0x1670ce={'session':_0x1b6ea7,'queryInput':{'text':{'text':_0xaa8e6c,'languageCode':_0x2fb167}}};return _0x202f30['detectIntent'](_0x1670ce)['then'](function(_0x23e5bf){if(_0x23e5bf&&_0x23e5bf['length']){logger[_0x9945('0x17')]('Dialogflow\x20V2\x20response:',JSON[_0x9945('0x3f')](_0x23e5bf));var _0x501815=_0x23e5bf[0x0];if(_0x501815){var _0x1d429a={'action':_0x501815['queryResult'][_0x9945('0x58')],'allRequiredParamsPresent':_0x501815[_0x9945('0x64')][_0x9945('0x65')],'endConversation':_0x501815[_0x9945('0x64')][_0x9945('0x66')]&&_0x501815[_0x9945('0x64')]['diagnosticInfo'][_0x9945('0x67')]?_0x501815[_0x9945('0x64')][_0x9945('0x66')][_0x9945('0x67')][_0x9945('0x68')][_0x9945('0x69')]:![],'fulfillmentText':_0x501815['queryResult'][_0x9945('0x6a')],'intentName':_0x501815[_0x9945('0x64')][_0x9945('0x6b')][_0x9945('0x53')],'intentDisplayName':_0x501815['queryResult']['intent'][_0x9945('0x6c')],'isFallbackIntent':_0x501815[_0x9945('0x64')][_0x9945('0x6b')][_0x9945('0x6d')],'languageCode':_0x501815[_0x9945('0x64')][_0x9945('0x6e')],'queryText':_0x501815[_0x9945('0x64')]['queryText'],'responseId':_0x501815[_0x9945('0x6f')],'score':_0x501815[_0x9945('0x64')][_0x9945('0x70')],'speech':_0x501815['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x9945('0x3f')](_0x23e5bf)};return _0x1d429a;}}});};exports[_0x9945('0x71')]=function(_0x4b017f,_0x315fc2,_0x515fcd,_0x14244a){return tilde['asr'](_0x4b017f,_0x315fc2,_0x515fcd,_0x14244a)[_0x9945('0x27')](function(_0x4fe650){try{fs[_0x9945('0x1a')](_0x4b017f);}catch(_0x4b2ebe){logger[_0x9945('0x12')](_0x4b2ebe);}logger['info'](_0x9945('0x72'),_0x4fe650['transcript']);logger['info'](_0x9945('0x73'),_0x4fe650['confidence']);return _0x4fe650;});};exports['awsPolly']=function(_0x48e67f,_0x3db2d0,_0x1f40c5,_0xfed0b2,_0x1c3dcc,_0xd41017){var _0x311232=path[_0x9945('0x21')](__dirname,'tmp',rs['generate'](0x4)+_0x9945('0x35'));var _0x589331;return aws[_0x9945('0x74')](_0x48e67f,_0x3db2d0,_0x1f40c5,_0xfed0b2,_0x1c3dcc,_0xd41017,_0x311232)['then'](function(){_0x589331=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs[_0x9945('0x23')](0x4)+_0x9945('0x24'));return convertFile(_0x311232,_0x589331);})[_0x9945('0x27')](function(){try{fs[_0x9945('0x1a')](_0x311232);fs['chmodSync'](_0x589331,_0x9945('0x38'));}catch(_0xa817e){logger[_0x9945('0x12')](_0xa817e);}return _0x589331[_0x9945('0x29')]('.')[0x0];});};exports[_0x9945('0x75')]=function(_0x32a897,_0x3f680e,_0x433e15,_0x12ad02,_0x88406c,_0x1036c6){return aws['lex'](_0x32a897,_0x3f680e,_0x433e15,_0x12ad02,_0x88406c,_0x1036c6)[_0x9945('0x27')](function(_0x3ccca0){logger[_0x9945('0x17')](JSON['stringify'](_0x3ccca0));return _0x3ccca0;});};exports[_0x9945('0x76')]=function(_0x2cc657,_0x400360,_0x56013a,_0x150b84){var _0xd41625=util[_0x9945('0x77')](_0x9945('0x78'),ISPEECH_API,_0x2cc657,encodeURIComponent(_0x400360),_0x56013a,_0x150b84);var _0x1b2067=path[_0x9945('0x21')](__dirname,_0x9945('0x22'),rs[_0x9945('0x23')](0x4)+_0x9945('0x35'));var _0x11daed;return downloadFile(_0xd41625,_0x1b2067)['then'](function(){_0x11daed=path[_0x9945('0x21')](__dirname,'tmp',rs[_0x9945('0x23')](0x4)+_0x9945('0x24'));return convertFile(_0x1b2067,_0x11daed);})[_0x9945('0x27')](function(){try{fs['unlink'](_0x1b2067);fs[_0x9945('0x28')](_0x11daed,_0x9945('0x38'));}catch(_0x560bfe){logger['error'](_0x560bfe);}return _0x11daed[_0x9945('0x29')]('.')[0x0];});};exports[_0x9945('0x79')]=function(_0x4a87a5,_0x47109c,_0x3cb7b4,_0x29fa21){var _0x592351=util[_0x9945('0x77')](_0x9945('0x7a'),ISPEECH_API,_0x47109c,_0x3cb7b4,base64Encode(_0x4a87a5),_0x29fa21?util[_0x9945('0x77')](_0x9945('0x7b'),encodeURIComponent(_0x29fa21)):_0x9945('0x7c'));return uploadFile(_0x592351)[_0x9945('0x27')](function(_0x10ac78){return querystring[_0x9945('0x5')](_0x10ac78);});};exports[_0x9945('0x7d')]=function(_0x31cc84,_0x2f610c){return sestek[_0x9945('0x7e')](_0x31cc84,_0x2f610c)[_0x9945('0x27')](function(_0x4d2df8){logger[_0x9945('0x17')](JSON[_0x9945('0x3f')](_0x4d2df8));var _0x5bc79e={'speech':_0x4d2df8[_0x9945('0x7f')],'action':_0x4d2df8['channelData']?_0x4d2df8['channelData'][_0x9945('0x80')]:undefined,'actiondata':_0x4d2df8[_0x9945('0x81')]?_0x4d2df8[_0x9945('0x81')][_0x9945('0x82')]:undefined};if(_0x4d2df8[_0x9945('0x81')]&&_0x4d2df8[_0x9945('0x81')][_0x9945('0x83')]){return base64Decode(_0x4d2df8[_0x9945('0x81')][_0x9945('0x83')][_0x9945('0x84')],path['resolve'](__dirname,_0x9945('0x22'),rs[_0x9945('0x23')](0x4)+_0x9945('0x24')))[_0x9945('0x27')](function(_0x3c475b){_0x5bc79e[_0x9945('0x85')]=_0x3c475b;return _0x5bc79e;});}return _0x5bc79e;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x1eb8=['tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','http','https','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','transcode','wav','error\x20convert','end','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20confidence','name','message','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','isFallback','queryText','responseId','intentDetectionConfidence','fulfillmentText'];(function(_0x49bb60,_0x194098){var _0x538823=function(_0x190081){while(--_0x190081){_0x49bb60['push'](_0x49bb60['shift']());}};_0x538823(++_0x194098);}(_0x1eb8,0xa2));var _0x81eb=function(_0x7633c4,_0x510e06){_0x7633c4=_0x7633c4-0x0;var _0x497125=_0x1eb8[_0x7633c4];return _0x497125;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x81eb('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x81eb('0x1'));var https=require(_0x81eb('0x2'));var md5=require('md5');var path=require(_0x81eb('0x3'));var querystring=require('querystring');var rp=require(_0x81eb('0x4'));var rs=require(_0x81eb('0x5'));var sox=require(_0x81eb('0x6'));var tts=require(_0x81eb('0x7'));var urlParse=require(_0x81eb('0x8'))[_0x81eb('0x9')];var util=require(_0x81eb('0xa'));var aws=require(_0x81eb('0xb'));var google=require('./google');var sestek=require(_0x81eb('0xc'));var tilde=require('./tilde');var logger=require(_0x81eb('0xd'))('agi');var ISPEECH_API=_0x81eb('0xe');function downloadFile(_0x3c056f,_0x2253e0){return new BPromise(function(_0xcb930d,_0x47cd02){var _0x44a36e=urlParse(_0x3c056f);var _0x3858ec=_0x44a36e[_0x81eb('0xf')]===_0x81eb('0x10')?https:http;var _0x384f04={'host':_0x44a36e[_0x81eb('0x11')],'path':_0x44a36e['path'],'headers':{'user-agent':_0x81eb('0x12')}};_0x3858ec[_0x81eb('0x13')](_0x384f04,function(_0x30b40d){if(_0x30b40d[_0x81eb('0x14')]!==0xc8){logger[_0x81eb('0x15')](_0x81eb('0x16')+_0x3c056f+_0x81eb('0x17')+_0x30b40d[_0x81eb('0x14')]+'\x20('+_0x30b40d[_0x81eb('0x18')]+')');_0x47cd02(new Error('request\x20to\x20'+_0x3c056f+_0x81eb('0x17')+_0x30b40d['statusCode']+'\x20('+_0x30b40d[_0x81eb('0x18')]+')'));return;}var _0x39a5e5=fs[_0x81eb('0x19')](_0x2253e0);_0x39a5e5['on'](_0x81eb('0x1a'),function(){logger['info'](_0x81eb('0x1b'));_0x39a5e5[_0x81eb('0x1c')](_0xcb930d);});_0x39a5e5['on'](_0x81eb('0x15'),function(_0xec9baa){fs[_0x81eb('0x1d')](_0x2253e0);logger[_0x81eb('0x15')](_0x81eb('0x1e'),_0xec9baa);_0x47cd02(_0xec9baa);});_0x30b40d[_0x81eb('0x1f')](_0x39a5e5);})['on'](_0x81eb('0x15'),function(_0x3abe7a){logger[_0x81eb('0x15')](_0x3abe7a);_0x47cd02(_0x3abe7a);})['end']();});}function uploadFile(_0x14a48a){return new BPromise(function(_0x5f1e89,_0x2a0c73){var _0x5f1a59=urlParse(_0x14a48a);var _0x5be983=_0x5f1a59[_0x81eb('0xf')]===_0x81eb('0x10')?https:http;var _0x189d1c={'host':_0x5f1a59[_0x81eb('0x11')],'path':_0x5f1a59[_0x81eb('0x3')],'headers':{'user-agent':_0x81eb('0x12')}};_0x5be983['get'](_0x189d1c,function(_0x4189b5){if(_0x4189b5[_0x81eb('0x14')]!==0xc8){_0x2a0c73(new Error(_0x81eb('0x16')+_0x14a48a+_0x81eb('0x17')+_0x4189b5[_0x81eb('0x14')]+'\x20('+_0x4189b5[_0x81eb('0x18')]+')'));return;}var _0x195ef1='';_0x4189b5['on']('data',function(_0xf76876){_0x195ef1+=_0xf76876;});_0x4189b5['on']('end',function(){_0x5f1e89(_0x195ef1);});})['on']('error',function(_0x386152){_0x2a0c73(_0x386152);})['end']();});}function convertFile(_0x29bf0f,_0x33a4b2){return new BPromise(function(_0x260f6c,_0x2d2c37){var _0x7c15bc=sox[_0x81eb('0x20')](_0x29bf0f,_0x33a4b2,{'sampleRate':0x1f40,'format':_0x81eb('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7c15bc['on'](_0x81eb('0x15'),function(_0x1e1cd3){logger[_0x81eb('0x15')](_0x81eb('0x22'),_0x1e1cd3);_0x2d2c37(_0x1e1cd3);});_0x7c15bc['on'](_0x81eb('0x23'),function(){logger[_0x81eb('0x24')](_0x81eb('0x25'));_0x260f6c();});_0x7c15bc[_0x81eb('0x26')]();});}function base64Decode(_0x307936,_0xec85d4){var _0x5874cc=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+_0x81eb('0x2a'));fs[_0x81eb('0x2b')](_0x5874cc,_0x307936,_0x81eb('0x2c'));return convertFile(_0x5874cc,_0xec85d4)[_0x81eb('0x2d')](function(){try{fs[_0x81eb('0x1d')](_0x5874cc);fs['chmodSync'](_0xec85d4,_0x81eb('0x2e'));}catch(_0x4f6fd7){logger[_0x81eb('0x15')](_0x4f6fd7);}return _0xec85d4[_0x81eb('0x2f')]('.')[0x0];});}function base64Encode(_0x2e415b){var _0x1be412=fs[_0x81eb('0x30')](_0x2e415b);return new Buffer(_0x1be412)[_0x81eb('0x31')](_0x81eb('0x2c'));}exports[_0x81eb('0x32')]=function(_0x5e1438,_0x3a360d,_0x40b0f8,_0x525446,_0xe25d25,_0x4bf19b){var _0x260d82,_0x5ee43f;var _0x224405=_0x81eb('0x33');var _0x1493e8='?key='+_0x5e1438;var _0xa8f64e={};if(_0x3a360d===_0x81eb('0x34')){_0xa8f64e[_0x81eb('0x35')]={'ssml':_0x40b0f8};}else{_0xa8f64e[_0x81eb('0x35')]={'text':_0x40b0f8};};_0xa8f64e[_0x81eb('0x36')]={'languageCode':_0x525446,'ssmlGender':_0xe25d25};_0xa8f64e[_0x81eb('0x37')]={'audioEncoding':_0x81eb('0x38'),'sampleRateHertz':0x1f40};var _0x5483ea={'url':_0x224405+_0x81eb('0x39')+_0x1493e8,'method':_0x81eb('0x3a'),'json':!![],'body':_0xa8f64e};return rp(_0x5483ea)['then'](function(_0x134f1d){return new BPromise(function(_0x12be74,_0x2a94bb){_0x260d82=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+_0x81eb('0x3b'));var _0x5e89b6=Buffer[_0x81eb('0x3c')](_0x134f1d[_0x81eb('0x3d')],_0x81eb('0x2c'));return fs['writeFile'](_0x260d82,_0x5e89b6,function(_0x2e0697){_0x2a94bb(_0x2e0697);},function(_0x1401bd){fs[_0x81eb('0x3e')](_0x260d82,'777');_0x12be74(_0x1401bd);});});})[_0x81eb('0x2d')](function(_0x3c153b){_0x5ee43f=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+_0x81eb('0x2a'));return convertFile(_0x260d82,_0x5ee43f);})['then'](function(){try{fs[_0x81eb('0x1d')](_0x260d82);fs[_0x81eb('0x3e')](_0x5ee43f,'777');}catch(_0x1f32a9){logger[_0x81eb('0x15')](_0x1f32a9);}logger['info'](_0x81eb('0x3f'),_0x5ee43f[_0x81eb('0x2f')]('.')[0x0]);return _0x5ee43f[_0x81eb('0x2f')]('.')[0x0];});};exports[_0x81eb('0x40')]=function(_0x537732,_0x1bd84c){var _0x5c34e0=_0x81eb('0x41');var _0x40a479,_0x158e11;var _0x4f824b;var _0x377a63={'encoding':_0x81eb('0x42'),'method':_0x81eb('0x3a'),'timeout':0x2710,'url':_0x5c34e0,'headers':{'Content-Type':_0x81eb('0x43')},'body':_0x81eb('0x44')+encodeURIComponent(JSON[_0x81eb('0x45')]([[['jQ1olc',JSON[_0x81eb('0x45')]([_0x537732,_0x1bd84c||'en',![],_0x81eb('0x46')]),null,_0x81eb('0x47')]]]))};return rp(_0x377a63)[_0x81eb('0x2d')](function(_0x34ec74){try{_0x4f824b=eval(_0x34ec74[_0x81eb('0x48')](0x5))[0x0][0x2];}catch(_0x129d33){throw new Error(_0x81eb('0x49')+_0x34ec74[_0x81eb('0x4a')]);}if(!_0x4f824b){if(_0x537732[_0x81eb('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x81eb('0x4c')+_0x1bd84c+_0x81eb('0x4d'));}}try{_0x4f824b=eval(_0x4f824b)[0x0];}catch(_0x1ba454){throw new Error(_0x81eb('0x49')+res[_0x81eb('0x4a')]);}const _0x18678d=_0x4f824b;_0x40a479=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs['generate'](0x4)+_0x81eb('0x3b'));fs[_0x81eb('0x2b')](_0x40a479,_0x4f824b,{'encoding':_0x81eb('0x2c')});_0x158e11=path[_0x81eb('0x27')](__dirname,'tmp',rs[_0x81eb('0x29')](0x4)+_0x81eb('0x2a'));return convertFile(_0x40a479,_0x158e11);})[_0x81eb('0x2d')](function(){try{fs[_0x81eb('0x1d')](_0x40a479);fs[_0x81eb('0x3e')](_0x158e11,_0x81eb('0x2e'));}catch(_0x425b67){logger[_0x81eb('0x15')](_0x425b67);}logger['info'](_0x81eb('0x4e'),_0x158e11['split']('.')[0x0]);return _0x158e11[_0x81eb('0x2f')]('.')[0x0];});};exports[_0x81eb('0x4f')]=function(_0xf25b33,_0x4be9bc,_0x374549){return google[_0x81eb('0x50')](_0xf25b33,_0x4be9bc,_0x374549)[_0x81eb('0x2d')](function(_0x450642){logger[_0x81eb('0x24')](_0x450642[_0x81eb('0x51')]);return rp(_0x450642);})['then'](function(_0x104829){var _0x4983bf='';var _0x951717=0x0;try{fs['unlink'](_0xf25b33);}catch(_0x13e5f0){logger[_0x81eb('0x15')](_0x13e5f0);}if(_0x104829&&_0x104829['results']){_0x4983bf=_0x104829[_0x81eb('0x52')]['map'](function(_0x1f1882){return _0x1f1882&&_0x1f1882[_0x81eb('0x53')][0x0]&&_0x1f1882[_0x81eb('0x53')][0x0][_0x81eb('0x54')]?_0x1f1882['alternatives'][0x0][_0x81eb('0x54')]:'';})[_0x81eb('0x55')]('\x0a');_0x951717=_0x104829['results'][_0x81eb('0x56')](function(_0x4cb332){return _0x4cb332&&_0x4cb332[_0x81eb('0x53')][0x0]&&_0x4cb332[_0x81eb('0x53')][0x0][_0x81eb('0x57')]?_0x4cb332['alternatives'][0x0][_0x81eb('0x57')]:0x0;})[_0x81eb('0x55')]('\x0a');}logger[_0x81eb('0x24')]('googleASR\x20transcription',_0x4983bf);logger['info'](_0x81eb('0x58'),_0x951717);return{'transcript':_0x4983bf,'confidence':_0x951717};})['catch'](function(_0x52f2a9){logger[_0x81eb('0x15')]('[%s]\x20%s:%s',_0x52f2a9[_0x81eb('0x14')],_0x52f2a9[_0x81eb('0x59')],_0x52f2a9[_0x81eb('0x5a')]);});};exports[_0x81eb('0x5b')]=function(_0x564f71,_0x5d46df,_0x279e55,_0x3c4ac0){var _0x561c45=apiai(_0x5d46df,{'language':_0x3c4ac0||'en'});return _0x561c45['textRequest'](_0x279e55,{'sessionId':md5(_0x564f71)})[_0x81eb('0x2d')](function(_0x1ea96a){logger[_0x81eb('0x24')](JSON['stringify'](_0x1ea96a));return{'source':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x5d')],'resolvedQuery':_0x1ea96a['result'][_0x81eb('0x5e')],'action':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x5f')],'actionIncomplete':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x60')],'speech':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x61')][_0x81eb('0x62')],'score':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x63')],'statusCode':_0x1ea96a[_0x81eb('0x64')][_0x81eb('0x65')],'endConversation':_0x1ea96a[_0x81eb('0x5c')]['metadata'][_0x81eb('0x66')]||![],'isFallbackIntent':_0x1ea96a[_0x81eb('0x5c')][_0x81eb('0x67')][_0x81eb('0x68')]};});};exports[_0x81eb('0x69')]=function(_0x4a5707,_0x369012,_0x4ee266,_0x989ca,_0x375930,_0x23c7be){var _0x1e2089=_0x989ca[_0x81eb('0x6a')](/\\n/g,'\x0a');var _0x74918d={'credentials':{'private_key':_0x1e2089,'client_email':_0x4ee266}};var _0x2deda2=new dialogflow['SessionsClient'](_0x74918d);var _0x347db8=_0x2deda2['sessionPath'](_0x369012,md5(_0x4a5707));var _0x2067fb={'session':_0x347db8,'queryInput':{'text':{'text':_0x375930,'languageCode':_0x23c7be}}};return _0x2deda2[_0x81eb('0x6b')](_0x2067fb)[_0x81eb('0x2d')](function(_0x49f267){if(_0x49f267&&_0x49f267['length']){logger['info'](_0x81eb('0x6c'),JSON[_0x81eb('0x45')](_0x49f267));var _0x3049e8=_0x49f267[0x0];if(_0x3049e8){var _0x16e307={'action':_0x3049e8[_0x81eb('0x6d')][_0x81eb('0x5f')],'allRequiredParamsPresent':_0x3049e8[_0x81eb('0x6d')]['allRequiredParamsPresent'],'endConversation':_0x3049e8[_0x81eb('0x6d')][_0x81eb('0x6e')]&&_0x3049e8[_0x81eb('0x6d')][_0x81eb('0x6e')]['fields']?_0x3049e8[_0x81eb('0x6d')]['diagnosticInfo'][_0x81eb('0x6f')][_0x81eb('0x70')][_0x81eb('0x71')]:![],'fulfillmentText':_0x3049e8[_0x81eb('0x6d')]['fulfillmentText'],'intentName':_0x3049e8['queryResult']['intent'][_0x81eb('0x59')],'intentDisplayName':_0x3049e8[_0x81eb('0x6d')][_0x81eb('0x72')]['displayName'],'isFallbackIntent':_0x3049e8['queryResult'][_0x81eb('0x72')][_0x81eb('0x73')],'languageCode':_0x3049e8[_0x81eb('0x6d')]['languageCode'],'queryText':_0x3049e8[_0x81eb('0x6d')][_0x81eb('0x74')],'responseId':_0x3049e8[_0x81eb('0x75')],'score':_0x3049e8['queryResult'][_0x81eb('0x76')],'speech':_0x3049e8['queryResult'][_0x81eb('0x77')],'providerResponse':JSON[_0x81eb('0x45')](_0x49f267)};return _0x16e307;}}});};exports[_0x81eb('0x78')]=function(_0x226a8a,_0x1f9523,_0x5f045c,_0x4226b3){return tilde[_0x81eb('0x50')](_0x226a8a,_0x1f9523,_0x5f045c,_0x4226b3)[_0x81eb('0x2d')](function(_0xbd0413){try{fs[_0x81eb('0x1d')](_0x226a8a);}catch(_0x51ab3e){logger[_0x81eb('0x15')](_0x51ab3e);}logger[_0x81eb('0x24')]('Tilde\x20ASR\x20transcription',_0xbd0413['transcript']);logger[_0x81eb('0x24')](_0x81eb('0x79'),_0xbd0413[_0x81eb('0x57')]);return _0xbd0413;});};exports[_0x81eb('0x7a')]=function(_0x40f96b,_0x5f0295,_0x11c6c5,_0x13de54,_0x21f68c,_0x28ff17){var _0x6c08fc=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x81eb('0x3b'));var _0xf529d3;return aws[_0x81eb('0x7b')](_0x40f96b,_0x5f0295,_0x11c6c5,_0x13de54,_0x21f68c,_0x28ff17,_0x6c08fc)[_0x81eb('0x2d')](function(){_0xf529d3=path['resolve'](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+'.wav');return convertFile(_0x6c08fc,_0xf529d3);})[_0x81eb('0x2d')](function(){try{fs['unlink'](_0x6c08fc);fs[_0x81eb('0x3e')](_0xf529d3,_0x81eb('0x2e'));}catch(_0x45f19c){logger[_0x81eb('0x15')](_0x45f19c);}return _0xf529d3[_0x81eb('0x2f')]('.')[0x0];});};exports[_0x81eb('0x7c')]=function(_0x3be64b,_0xa6fff7,_0x32af69,_0x55572c,_0x49bc93,_0x25a474){return aws[_0x81eb('0x7d')](_0x3be64b,_0xa6fff7,_0x32af69,_0x55572c,_0x49bc93,_0x25a474)[_0x81eb('0x2d')](function(_0x3f08b5){logger['info'](JSON['stringify'](_0x3f08b5));return _0x3f08b5;});};exports[_0x81eb('0x7e')]=function(_0x5a514c,_0x5b067e,_0x30b6d0,_0x240fe7){var _0x9e74dc=util[_0x81eb('0x7f')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x5a514c,encodeURIComponent(_0x5b067e),_0x30b6d0,_0x240fe7);var _0x5eaa96=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+'.mp3');var _0x593c;return downloadFile(_0x9e74dc,_0x5eaa96)[_0x81eb('0x2d')](function(){_0x593c=path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs['generate'](0x4)+_0x81eb('0x2a'));return convertFile(_0x5eaa96,_0x593c);})[_0x81eb('0x2d')](function(){try{fs[_0x81eb('0x1d')](_0x5eaa96);fs[_0x81eb('0x3e')](_0x593c,'777');}catch(_0x16919d){logger['error'](_0x16919d);}return _0x593c[_0x81eb('0x2f')]('.')[0x0];});};exports[_0x81eb('0x80')]=function(_0x3cb176,_0x5a9b09,_0x6f3658,_0x3c1f00){var _0x1b2945=util[_0x81eb('0x7f')](_0x81eb('0x81'),ISPEECH_API,_0x5a9b09,_0x6f3658,base64Encode(_0x3cb176),_0x3c1f00?util[_0x81eb('0x7f')](_0x81eb('0x82'),encodeURIComponent(_0x3c1f00)):_0x81eb('0x83'));return uploadFile(_0x1b2945)[_0x81eb('0x2d')](function(_0x6f5afd){return querystring[_0x81eb('0x9')](_0x6f5afd);});};exports[_0x81eb('0x84')]=function(_0x13541c,_0x3eda39){return sestek[_0x81eb('0x85')](_0x13541c,_0x3eda39)['then'](function(_0x158026){logger[_0x81eb('0x24')](JSON[_0x81eb('0x45')](_0x158026));var _0x9d7f71={'speech':_0x158026[_0x81eb('0x86')],'action':_0x158026['channelData']?_0x158026['channelData']['CustomAction']:undefined,'actiondata':_0x158026[_0x81eb('0x87')]?_0x158026[_0x81eb('0x87')][_0x81eb('0x88')]:undefined};if(_0x158026[_0x81eb('0x87')]&&_0x158026[_0x81eb('0x87')][_0x81eb('0x89')]){return base64Decode(_0x158026[_0x81eb('0x87')][_0x81eb('0x89')][_0x81eb('0x8a')],path[_0x81eb('0x27')](__dirname,_0x81eb('0x28'),rs[_0x81eb('0x29')](0x4)+_0x81eb('0x2a')))[_0x81eb('0x2d')](function(_0x2cf6f5){_0x9d7f71[_0x81eb('0x8b')]=_0x2cf6f5;return _0x9d7f71;});}return _0x9d7f71;});};exports[_0x81eb('0x8c')]=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 4b559fb..f0f2c29 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 _0x52cf=['./nda'];(function(_0x520ac6,_0x3cc594){var _0x48699d=function(_0x34bcfe){while(--_0x34bcfe){_0x520ac6['push'](_0x520ac6['shift']());}};_0x48699d(++_0x3cc594);}(_0x52cf,0x1b5));var _0xf52c=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x52cf[_0xea8947];return _0x2455e9;};var nda=require(_0xf52c('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x9b97=['exports','./nda'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9b97,0x129));var _0x79b9=function(_0x3e0b70,_0x53f613){_0x3e0b70=_0x3e0b70-0x0;var _0xc0cdc6=_0x9b97[_0x3e0b70];return _0xc0cdc6;};var nda=require(_0x79b9('0x0'));module[_0x79b9('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 a7ece70..e5efb70 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 _0xd4bd=['message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','channelData','ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','username','then','ndassistant_url','ndaactivity_type'];(function(_0x80bbe7,_0x350583){var _0x510594=function(_0x306b5c){while(--_0x306b5c){_0x80bbe7['push'](_0x80bbe7['shift']());}};_0x510594(++_0x350583);}(_0xd4bd,0x15f));var _0xdd4b=function(_0x3a5fdd,_0x410065){_0x3a5fdd=_0x3a5fdd-0x0;var _0x46fcd6=_0xd4bd[_0x3a5fdd];return _0x46fcd6;};'use strict';var rp=require(_0xdd4b('0x0'));var url=require(_0xdd4b('0x1'));var logger=require(_0xdd4b('0x2'))(_0xdd4b('0x3'));module[_0xdd4b('0x4')]=function(_0x5f2139,_0x37f821){var _0xa49dde={'method':_0xdd4b('0x5'),'uri':url[_0xdd4b('0x6')](_0x37f821[_0xdd4b('0x7')],'/token'),'form':{'grant_type':'password','username':_0x37f821[_0xdd4b('0x8')],'password':_0x37f821['password']},'json':!![]};return rp(_0xa49dde)[_0xdd4b('0x9')](function(_0x173584){var _0x4ac6a5={'method':'POST','uri':url[_0xdd4b('0x6')](_0x37f821[_0xdd4b('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x37f821[_0xdd4b('0xb')]||_0xdd4b('0xc'),'channelId':_0xdd4b('0xd'),'conversation':{'id':_0x5f2139['uniqueid']},'from':{'id':_0x5f2139[_0xdd4b('0xe')],'name':_0x5f2139[_0xdd4b('0xf')]},'recipient':{'id':_0x5f2139[_0xdd4b('0x10')],'name':_0x5f2139[_0xdd4b('0x11')]},'text':_0x37f821[_0xdd4b('0x12')],'channelData':{}},'headers':{'Authorization':_0xdd4b('0x13')+_0x173584[_0xdd4b('0x14')]},'json':!![]};if(_0x37f821[_0xdd4b('0x15')]){_0x4ac6a5['body'][_0xdd4b('0x16')]['ProjectName']=_0x37f821[_0xdd4b('0x15')];}if(_0x37f821[_0xdd4b('0x17')]=='1'){_0x4ac6a5[_0xdd4b('0x18')][_0xdd4b('0x16')][_0xdd4b('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xdd4b('0x1a')};}if(_0x37f821['custom_action']){_0x4ac6a5['body'][_0xdd4b('0x16')][_0xdd4b('0x1b')]=_0x37f821[_0xdd4b('0x1c')];if(_0x37f821[_0xdd4b('0x1d')]){_0x4ac6a5[_0xdd4b('0x18')][_0xdd4b('0x16')][_0xdd4b('0x1e')]=_0x37f821['custom_action_data'];}}logger[_0xdd4b('0x1f')](JSON[_0xdd4b('0x20')](_0x4ac6a5));return rp(_0x4ac6a5);});}; \ No newline at end of file +var _0x7b37=['password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','agi','exports','POST','resolve','ndauth_url'];(function(_0x50e560,_0x28d5b3){var _0x3b0e30=function(_0x1c0a99){while(--_0x1c0a99){_0x50e560['push'](_0x50e560['shift']());}};_0x3b0e30(++_0x28d5b3);}(_0x7b37,0xd9));var _0x77b3=function(_0x151c38,_0x3d5723){_0x151c38=_0x151c38-0x0;var _0x18a987=_0x7b37[_0x151c38];return _0x18a987;};'use strict';var rp=require(_0x77b3('0x0'));var url=require(_0x77b3('0x1'));var logger=require('../../../../../config/logger')(_0x77b3('0x2'));module[_0x77b3('0x3')]=function(_0x4a94e7,_0x465b1d){var _0x522d20={'method':_0x77b3('0x4'),'uri':url[_0x77b3('0x5')](_0x465b1d[_0x77b3('0x6')],'/token'),'form':{'grant_type':_0x77b3('0x7'),'username':_0x465b1d[_0x77b3('0x8')],'password':_0x465b1d['password']},'json':!![]};return rp(_0x522d20)['then'](function(_0x2f896b){var _0x5b3fb4={'method':_0x77b3('0x4'),'uri':url[_0x77b3('0x5')](_0x465b1d['ndassistant_url'],_0x77b3('0x9')),'body':{'type':_0x465b1d[_0x77b3('0xa')]||_0x77b3('0xb'),'channelId':_0x77b3('0xc'),'conversation':{'id':_0x4a94e7[_0x77b3('0xd')]},'from':{'id':_0x4a94e7[_0x77b3('0xe')],'name':_0x4a94e7[_0x77b3('0xf')]},'recipient':{'id':_0x4a94e7[_0x77b3('0x10')],'name':_0x4a94e7[_0x77b3('0x11')]},'text':_0x465b1d[_0x77b3('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2f896b[_0x77b3('0x13')]},'json':!![]};if(_0x465b1d[_0x77b3('0x14')]){_0x5b3fb4[_0x77b3('0x15')][_0x77b3('0x16')][_0x77b3('0x17')]=_0x465b1d[_0x77b3('0x14')];}if(_0x465b1d[_0x77b3('0x18')]=='1'){_0x5b3fb4[_0x77b3('0x15')][_0x77b3('0x16')][_0x77b3('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x77b3('0x1a')};}if(_0x465b1d[_0x77b3('0x1b')]){_0x5b3fb4['body'][_0x77b3('0x16')][_0x77b3('0x1c')]=_0x465b1d[_0x77b3('0x1b')];if(_0x465b1d[_0x77b3('0x1d')]){_0x5b3fb4['body'][_0x77b3('0x16')]['CustomActionData']=_0x465b1d['custom_action_data'];}}logger[_0x77b3('0x1e')](JSON[_0x77b3('0x1f')](_0x5b3fb4));return rp(_0x5b3fb4);});}; \ 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 dbe568e..b7526e9 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 _0x12b7=['exports','./lib/api'];(function(_0x1cbbb1,_0x1577e6){var _0x9f36b7=function(_0xf6b82){while(--_0xf6b82){_0x1cbbb1['push'](_0x1cbbb1['shift']());}};_0x9f36b7(++_0x1577e6);}(_0x12b7,0x1a9));var _0x712b=function(_0x4cdce4,_0x52f9e9){_0x4cdce4=_0x4cdce4-0x0;var _0x457021=_0x12b7[_0x4cdce4];return _0x457021;};'use strict';var asr=require(_0x712b('0x0'));module[_0x712b('0x1')]=function(_0x50eedd,_0x10f8d3,_0x4bbbef,_0x35e839){return asr(_0x50eedd,_0x10f8d3,_0x4bbbef,_0x35e839);}; \ No newline at end of file +var _0x1dc7=['exports'];(function(_0x32f4f6,_0x5974b5){var _0x42dc3f=function(_0xe4b9bd){while(--_0xe4b9bd){_0x32f4f6['push'](_0x32f4f6['shift']());}};_0x42dc3f(++_0x5974b5);}(_0x1dc7,0xf3));var _0x71dc=function(_0x18649d,_0x408885){_0x18649d=_0x18649d-0x0;var _0x41c937=_0x1dc7[_0x18649d];return _0x41c937;};'use strict';var asr=require('./lib/api');module[_0x71dc('0x0')]=function(_0x163150,_0x323660,_0x6fa2ef,_0xd4f507){return asr(_0x163150,_0x323660,_0x6fa2ef,_0xd4f507);}; \ 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 bbeabee..2771837 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 _0x132d=['isNil','isObject','open','message','close','bluebird','lodash','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','status','result','final','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','terminate','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket'];(function(_0x459b2a,_0x221b21){var _0x28ecc4=function(_0x502a1c){while(--_0x502a1c){_0x459b2a['push'](_0x459b2a['shift']());}};_0x28ecc4(++_0x221b21);}(_0x132d,0x1bd));var _0xd132=function(_0x243184,_0x4547f9){_0x243184=_0x243184-0x0;var _0x37d2e9=_0x132d[_0x243184];return _0x37d2e9;};'use strict';var BPromise=require(_0xd132('0x0'));var _=require(_0xd132('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xd132('0x2'));var logger=require('../../../../../../config/logger')(_0xd132('0x3'));module[_0xd132('0x4')]=function(_0x42d5d1,_0x1b71c8,_0x4e3606,_0x36b50a){return new BPromise(function(_0x3f92d3,_0x65ce3f){logger[_0xd132('0x5')](_0xd132('0x6'),_0x36b50a||_0xd132('0x7'));var _0x3db56c=new WebSocket(_0x36b50a||_0xd132('0x7'),{'perMessageDeflate':![]});var _0x182f4b='';var _0x4cb38a='0';var _0x4d4a3a='1';var _0x2cddcd=_0xd132('0x8');function _0x2e5f07(_0x5679ba){var _0x19ade3=crypto[_0xd132('0x9')](_0xd132('0xa'));_0x19ade3[_0xd132('0xb')](_0x5679ba);return _0x19ade3[_0xd132('0xc')](_0xd132('0xd'));}function _0x20e77d(){try{logger[_0xd132('0x5')](_0xd132('0xe'));var _0x5d256b=moment()[_0xd132('0xf')]();var _0x925c0=_0x2e5f07(_0x5d256b+_0x1b71c8+_0x4e3606);_0x3db56c[_0xd132('0x10')](JSON[_0xd132('0x11')]({'appID':_0x1b71c8,'timestamp':_0x5d256b,'appKey':_0x925c0}));var _0x582b73=fs['createReadStream'](_0x42d5d1);_0x582b73['on'](_0xd132('0x12'),function(_0x451d77){_0x3db56c[_0xd132('0x10')](_0x451d77);});_0x582b73['on']('close',function(){_0x3db56c['send'](_0xd132('0x13'));});}catch(_0x647272){logger[_0xd132('0x14')](_0xd132('0x15'),JSON[_0xd132('0x11')](_0x647272));_0x3db56c['terminate']();}}function _0x41fa6f(_0x5b13f1){try{if(_0x5b13f1){var _0x57cd2e=JSON['parse'](_0x5b13f1);switch(_0x57cd2e[_0xd132('0x16')]){case 0x0:if(_0x57cd2e['result']){if(_0x57cd2e[_0xd132('0x17')][_0xd132('0x18')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x57cd2e[_0xd132('0x17')]['hypotheses']));_0x182f4b=_0x57cd2e[_0xd132('0x17')][_0xd132('0x19')][0x0][_0xd132('0x1a')];_0x4cb38a=_0x57cd2e[_0xd132('0x17')][_0xd132('0x19')][0x0][_0xd132('0x1b')];_0x4d4a3a='0';_0x2cddcd='Success.';_0x3db56c['terminate']();}}break;case 0x1:logger[_0xd132('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4d4a3a='1';_0x2cddcd=_0xd132('0x8');break;case 0x2:logger[_0xd132('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4d4a3a='2';_0x2cddcd=_0xd132('0x1c');break;case 0x9:logger[_0xd132('0x5')](_0xd132('0x1d'));_0x4d4a3a='9';_0x2cddcd=_0xd132('0x1d');break;case 0xa:logger['info'](_0xd132('0x1e'));_0x4d4a3a='10';_0x2cddcd='Authentication\x20failed.';break;case 0xb:logger[_0xd132('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4d4a3a='11';_0x2cddcd='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x90099a){logger['error'](_0xd132('0x1f'),JSON[_0xd132('0x11')](_0x90099a));_0x3db56c[_0xd132('0x20')]();}}function _0x30f112(){logger['info'](_0xd132('0x21'));_0x3f92d3({'transcript':_0x182f4b,'confidence':_0x4cb38a,'status':_0x4d4a3a,'status_message':_0x2cddcd});}function _0x46d858(_0x2d529e){logger[_0xd132('0x14')](_0xd132('0x22'));if(!_[_0xd132('0x23')](_0x2d529e)){logger['error'](_[_0xd132('0x24')](_0x2d529e)?JSON['stringify'](_0x2d529e):_0x2d529e);}}_0x3db56c['on'](_0xd132('0x25'),_0x20e77d);_0x3db56c['on'](_0xd132('0x26'),_0x41fa6f);_0x3db56c['on'](_0xd132('0x27'),_0x30f112);_0x3db56c['on'](_0xd132('0x14'),_0x46d858);});}; \ No newline at end of file +var _0x2d98=['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','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x533437,_0x4d59d1){var _0x53f4ce=function(_0x483f6b){while(--_0x483f6b){_0x533437['push'](_0x533437['shift']());}};_0x53f4ce(++_0x4d59d1);}(_0x2d98,0x141));var _0x82d9=function(_0x5fd03,_0x135420){_0x5fd03=_0x5fd03-0x0;var _0x10d3fd=_0x2d98[_0x5fd03];return _0x10d3fd;};'use strict';var BPromise=require(_0x82d9('0x0'));var _=require(_0x82d9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x82d9('0x2'));var crypto=require(_0x82d9('0x3'));var logger=require('../../../../../../config/logger')(_0x82d9('0x4'));module[_0x82d9('0x5')]=function(_0x5ad5dc,_0x57a5a1,_0x169296,_0x1c3d0d){return new BPromise(function(_0x1e848c,_0x38c141){logger[_0x82d9('0x6')](_0x82d9('0x7'),_0x1c3d0d||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x28e594=new WebSocket(_0x1c3d0d||_0x82d9('0x8'),{'perMessageDeflate':![]});var _0x2c6661='';var _0x1fe6db='0';var _0x543af3='1';var _0x2676d9=_0x82d9('0x9');function _0x251156(_0x18031a){var _0x5a5258=crypto['createHash'](_0x82d9('0xa'));_0x5a5258[_0x82d9('0xb')](_0x18031a);return _0x5a5258[_0x82d9('0xc')](_0x82d9('0xd'));}function _0x4f98cb(){try{logger[_0x82d9('0x6')](_0x82d9('0xe'));var _0x3e56f1=moment()[_0x82d9('0xf')]();var _0x5ed9f2=_0x251156(_0x3e56f1+_0x57a5a1+_0x169296);_0x28e594[_0x82d9('0x10')](JSON[_0x82d9('0x11')]({'appID':_0x57a5a1,'timestamp':_0x3e56f1,'appKey':_0x5ed9f2}));var _0x40886e=fs[_0x82d9('0x12')](_0x5ad5dc);_0x40886e['on'](_0x82d9('0x13'),function(_0x22209d){_0x28e594['send'](_0x22209d);});_0x40886e['on']('close',function(){_0x28e594[_0x82d9('0x10')]('EOS');});}catch(_0x36e9a6){logger[_0x82d9('0x14')](_0x82d9('0x15'),JSON[_0x82d9('0x11')](_0x36e9a6));_0x28e594[_0x82d9('0x16')]();}}function _0x339927(_0x3357f7){try{if(_0x3357f7){var _0x12c328=JSON['parse'](_0x3357f7);switch(_0x12c328['status']){case 0x0:if(_0x12c328[_0x82d9('0x17')]){if(_0x12c328[_0x82d9('0x17')][_0x82d9('0x18')]){logger[_0x82d9('0x6')](_0x82d9('0x19'),JSON[_0x82d9('0x11')](_0x12c328['result'][_0x82d9('0x1a')]));_0x2c6661=_0x12c328[_0x82d9('0x17')][_0x82d9('0x1a')][0x0][_0x82d9('0x1b')];_0x1fe6db=_0x12c328[_0x82d9('0x17')]['hypotheses'][0x0][_0x82d9('0x1c')];_0x543af3='0';_0x2676d9='Success.';_0x28e594[_0x82d9('0x16')]();}}break;case 0x1:logger[_0x82d9('0x6')](_0x82d9('0x9'));_0x543af3='1';_0x2676d9=_0x82d9('0x9');break;case 0x2:logger[_0x82d9('0x6')](_0x82d9('0x1d'));_0x543af3='2';_0x2676d9=_0x82d9('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x543af3='9';_0x2676d9=_0x82d9('0x1e');break;case 0xa:logger[_0x82d9('0x6')](_0x82d9('0x1f'));_0x543af3='10';_0x2676d9=_0x82d9('0x1f');break;case 0xb:logger[_0x82d9('0x6')](_0x82d9('0x20'));_0x543af3='11';_0x2676d9=_0x82d9('0x20');}}}catch(_0x1c6282){logger['error'](_0x82d9('0x21'),JSON[_0x82d9('0x11')](_0x1c6282));_0x28e594[_0x82d9('0x16')]();}}function _0x45bf47(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x1e848c({'transcript':_0x2c6661,'confidence':_0x1fe6db,'status':_0x543af3,'status_message':_0x2676d9});}function _0xf19603(_0x41f816){logger[_0x82d9('0x14')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x82d9('0x22')](_0x41f816)){logger[_0x82d9('0x14')](_[_0x82d9('0x23')](_0x41f816)?JSON[_0x82d9('0x11')](_0x41f816):_0x41f816);}}_0x28e594['on'](_0x82d9('0x24'),_0x4f98cb);_0x28e594['on'](_0x82d9('0x25'),_0x339927);_0x28e594['on'](_0x82d9('0x26'),_0x45bf47);_0x28e594['on'](_0x82d9('0x14'),_0xf19603);});}; \ 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 4473504..a64ab02 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 _0xa22a=['exports','./asr'];(function(_0x1d5641,_0x2c3ec9){var _0x456157=function(_0x1e7ae5){while(--_0x1e7ae5){_0x1d5641['push'](_0x1d5641['shift']());}};_0x456157(++_0x2c3ec9);}(_0xa22a,0x9d));var _0xaa22=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa22a[_0x3947c9];return _0x2e7871;};var asr=require(_0xaa22('0x0'));module[_0xaa22('0x1')]={'asr':asr}; \ No newline at end of file +var _0x759d=['./asr','exports'];(function(_0x559871,_0x50d6cb){var _0xb973f2=function(_0x37faf6){while(--_0x37faf6){_0x559871['push'](_0x559871['shift']());}};_0xb973f2(++_0x50d6cb);}(_0x759d,0x14e));var _0xd759=function(_0x3dfd0e,_0x59e8ab){_0x3dfd0e=_0x3dfd0e-0x0;var _0x1f2d90=_0x759d[_0x3dfd0e];return _0x1f2d90;};var asr=require(_0xd759('0x0'));module[_0xd759('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index bdee572..187c311 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 _0xdfa0=['destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','events','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x45c3a3,_0x310ada){var _0x62c7a5=function(_0x3f95b1){while(--_0x3f95b1){_0x45c3a3['push'](_0x45c3a3['shift']());}};_0x62c7a5(++_0x310ada);}(_0xdfa0,0x85));var _0x0dfa=function(_0x393055,_0x31acf7){_0x393055=_0x393055-0x0;var _0x235762=_0xdfa0[_0x393055];return _0x235762;};'use strict';var util=require(_0x0dfa('0x0'));var net=require('net');var EventEmitter=require(_0x0dfa('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0dfa('0x2'));var AGIServer=function(_0x5b9a6e,_0x41f14c,_0x441e44){var _0x1a8673=this,_0x5b9a6e=_0x5b9a6e||0x11dd,_0x41f14c=_0x41f14c||_0x0dfa('0x3'),_0x577bdc=null,_0x4ec3a0=0x0;EventEmitter[_0x0dfa('0x4')](_0x1a8673);function _0x5b3250(){if(!_0x5b9a6e){_0x1a8673[_0x0dfa('0x5')]('error',new AGIError(_0x0dfa('0x6')));return![];}_0x577bdc=net['createServer']();_0x577bdc[_0x0dfa('0x7')](_0x5b9a6e,_0x41f14c);_0x577bdc['on'](_0x0dfa('0x8'),function(){_0x1a8673[_0x0dfa('0x5')](_0x0dfa('0x8'));});_0x577bdc['on'](_0x0dfa('0x9'),function(_0x51c5c9){_0x577bdc[_0x0dfa('0xa')](function(_0x59efd3,_0x529d29){if(_0x59efd3){_0x1a8673['emit'](_0x0dfa('0xb'),new AGIError(_0x0dfa('0xc'),_0x59efd3));}else if(_0x441e44&&_0x441e44<0x0){_0x1a8673[_0x0dfa('0x5')]('error',new AGIError(_0x0dfa('0xd')));_0x51c5c9[_0x0dfa('0xe')]();}else if(_0x441e44&&_0x441e44>0x0&&_0x441e44<_0x529d29){_0x4ec3a0+=0x1;_0x1a8673[_0x0dfa('0x5')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4ec3a0));_0x51c5c9['destroy']();}else{var _0x5625ae=new AGIChannel(_0x51c5c9);_0x5625ae['on'](_0x0dfa('0xf'),function(){_0x1a8673[_0x0dfa('0x5')](_0x0dfa('0x9'),_0x5625ae);});}});});_0x577bdc['on'](_0x0dfa('0xb'),function(_0x258992){_0x1a8673[_0x0dfa('0x5')]('error',new AGIError(_0x0dfa('0xc'),_0x258992[_0x0dfa('0x10')]));});_0x577bdc['on'](_0x0dfa('0x11'),function(){_0x1a8673[_0x0dfa('0x5')]('close',new AGIError(_0x0dfa('0x12')));});}process[_0x0dfa('0x13')](function(){_0x5b3250();});};util[_0x0dfa('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x1b1e65,_0x22ac9d,_0x278432){return new AGIServer(_0x1b1e65,_0x22ac9d,_0x278432);}; \ No newline at end of file +var _0x3ab9=['exports','net','events','EventEmitter','./error','error','E_AGI_ARGUMENT_PORT','createServer','listen','connection','getConnections','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x3ab9,0x1cf));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var net=require(_0x93ab('0x0'));var EventEmitter=require(_0x93ab('0x1'))[_0x93ab('0x2')];var AGIError=require(_0x93ab('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x5b6464,_0x5a6ed3,_0x2f3f9b){var _0x4a5fab=this,_0x5b6464=_0x5b6464||0x11dd,_0x5a6ed3=_0x5a6ed3||'127.0.0.1',_0xd540ff=null,_0x1b06fe=0x0;EventEmitter['call'](_0x4a5fab);function _0x672a79(){if(!_0x5b6464){_0x4a5fab['emit'](_0x93ab('0x4'),new AGIError(_0x93ab('0x5')));return![];}_0xd540ff=net[_0x93ab('0x6')]();_0xd540ff[_0x93ab('0x7')](_0x5b6464,_0x5a6ed3);_0xd540ff['on']('listening',function(){_0x4a5fab['emit']('listening');});_0xd540ff['on'](_0x93ab('0x8'),function(_0x54ca3e){_0xd540ff[_0x93ab('0x9')](function(_0x4b3390,_0x484c5e){if(_0x4b3390){_0x4a5fab[_0x93ab('0xa')]('error',new AGIError(_0x93ab('0xb'),_0x4b3390));}else if(_0x2f3f9b&&_0x2f3f9b<0x0){_0x4a5fab[_0x93ab('0xa')](_0x93ab('0x4'),new AGIError(_0x93ab('0xc')));_0x54ca3e[_0x93ab('0xd')]();}else if(_0x2f3f9b&&_0x2f3f9b>0x0&&_0x2f3f9b<_0x484c5e){_0x1b06fe+=0x1;_0x4a5fab[_0x93ab('0xa')]('error',new AGIError(_0x93ab('0xe'),_0x1b06fe));_0x54ca3e['destroy']();}else{var _0x53729f=new AGIChannel(_0x54ca3e);_0x53729f['on'](_0x93ab('0xf'),function(){_0x4a5fab['emit'](_0x93ab('0x8'),_0x53729f);});}});});_0xd540ff['on'](_0x93ab('0x4'),function(_0x104117){_0x4a5fab[_0x93ab('0xa')](_0x93ab('0x4'),new AGIError(_0x93ab('0xb'),_0x104117[_0x93ab('0x10')]));});_0xd540ff['on'](_0x93ab('0x11'),function(){_0x4a5fab[_0x93ab('0xa')]('close',new AGIError(_0x93ab('0x12')));});}process[_0x93ab('0x13')](function(){_0x672a79();});};util[_0x93ab('0x14')](AGIServer,EventEmitter);module[_0x93ab('0x15')]=function(_0x24044b,_0x2c1887,_0xf3c1a7){return new AGIServer(_0x24044b,_0x2c1887,_0xf3c1a7);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f300741..116fa5a 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 _0x172c=['getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','POST','PUT','body','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','render','stringify','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','includes','clone','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','getSquareOdbc','odbc_id','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','DIALOGFLOW_%s','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','recordFile','intKey','ISPEECH_ASR_%s','ispeech\x20%s\x20file\x20created','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','Executed\x20command\x20%s\x20%s','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn'];(function(_0x5add18,_0x3f751e){var _0xb87753=function(_0x42ce34){while(--_0x42ce34){_0x5add18['push'](_0x5add18['shift']());}};_0xb87753(++_0x3f751e);}(_0x172c,0x1ad));var _0xc172=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x172c[_0x3c504b];return _0x2e5354;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xc172('0x0'));var _=require('lodash');var sh=require(_0xc172('0x1'));var odbc=require(_0xc172('0x2'))();var rs=require(_0xc172('0x3'));var moment=require(_0xc172('0x4'));var Mustache=require(_0xc172('0x5'));var rp=require(_0xc172('0x6'));var logger=require('../../config/logger')(_0xc172('0x7'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0xc172('0x8');var recursiveMapAttributes=[_0xc172('0x9'),_0xc172('0xa')];var verticesWithRetry=[_0xc172('0xb'),_0xc172('0xc'),'getsecretdigits'];var AGIVertices=function(_0x3bfa42,_0x3a9d13,_0x3c3618){this[_0xc172('0xd')]=_0x3bfa42;this[_0xc172('0xe')]=_0x3a9d13;this[_0xc172('0xf')]=_0x3c3618;};AGIVertices[_0xc172('0x10')][_0xc172('0x11')]=function(_0xa10365,_0x2ba9cc){this[_0xc172('0xe')][_0xc172('0x12')](_0xa10365)[_0xc172('0x13')](function(_0x3b71e6){_0x2ba9cc(null,_0x3b71e6?_0x3b71e6[_0xc172('0x14')]:![]);})[_0xc172('0x15')](function(_0x3a858f){_0x2ba9cc(_0x3a858f);});};AGIVertices['prototype'][_0xc172('0x16')]=function(_0x5bfc59,_0x16ed1e){this['rpc'][_0xc172('0x17')](_0x5bfc59)['then'](function(_0x295a3a){_0x16ed1e(null,_0x295a3a?_0x295a3a[_0xc172('0x14')]:![]);})[_0xc172('0x15')](function(_0x4d237c){_0x16ed1e(_0x4d237c);});};AGIVertices[_0xc172('0x10')][_0xc172('0x18')]=function(_0x15eabe,_0xd077c6){this[_0xc172('0xe')][_0xc172('0x19')](_0x15eabe)[_0xc172('0x13')](function(_0x324eef){_0xd077c6(null,_0x324eef?_0x324eef[_0xc172('0x14')]:![]);})['catch'](function(_0x55a07b){_0xd077c6(_0x55a07b);});};AGIVertices[_0xc172('0x10')]['getSquareOdbc']=function(_0x5b95df,_0x550c18){this[_0xc172('0xe')][_0xc172('0x1a')](_0x5b95df)[_0xc172('0x13')](function(_0x292979){_0x550c18(null,_0x292979?_0x292979[_0xc172('0x1b')]:![]);})[_0xc172('0x15')](function(_0x207219){_0x550c18(_0x207219);});};AGIVertices[_0xc172('0x10')][_0xc172('0x1c')]=function(_0x368e83,_0x61ceec){this[_0xc172('0xe')][_0xc172('0x1d')](_0x368e83)[_0xc172('0x13')](function(_0x29e25b){_0x61ceec(null,_0x29e25b?_0x29e25b[_0xc172('0x14')]:![]);})[_0xc172('0x15')](function(_0x3fc135){_0x61ceec(_0x3fc135);});};AGIVertices[_0xc172('0x10')][_0xc172('0x1e')]=function(_0x43172a,_0x45cf87){this[_0xc172('0xe')]['getTrunkById'](_0x43172a)[_0xc172('0x13')](function(_0x4c077c){_0x45cf87(null,_0x4c077c?_0x4c077c[_0xc172('0x14')]:![]);})[_0xc172('0x15')](function(_0x361cfb){_0x45cf87(_0x361cfb);});};AGIVertices[_0xc172('0x10')]['getSound']=function(_0x449470,_0x47f581){var _0x97c9ab=this;this[_0xc172('0xe')][_0xc172('0x1f')](_0x449470)[_0xc172('0x13')](function(_0xb6d298){_0x47f581(null,_0xb6d298?_0x97c9ab[_0xc172('0x20')](_0xb6d298[_0xc172('0x21')]):![]);})[_0xc172('0x15')](function(_0x2f9485){_0x47f581(_0x2f9485);});};AGIVertices[_0xc172('0x10')]['getMailAccount']=function(_0x3a20cd,_0x48f16b){this[_0xc172('0xe')][_0xc172('0x22')](_0x3a20cd)[_0xc172('0x13')](function(_0x1a7aa2){_0x48f16b(null,_0x1a7aa2?_0x1a7aa2:![]);})[_0xc172('0x15')](function(_0x5c530){_0x48f16b(_0x5c530);});};AGIVertices['prototype'][_0xc172('0x23')]=function(_0x23371e,_0x2ce729,_0x541b25){this[_0xc172('0xf')][_0xc172('0x23')](_0x23371e,_0x2ce729)[_0xc172('0x13')](function(){_0x541b25(null);})['catch'](function(_0x34719f){_0x541b25(_0x34719f);});};AGIVertices[_0xc172('0x10')][_0xc172('0x24')]=function(_0x121cfb,_0x5f5663){this['rpc']['getIntervalById'](_0x121cfb)[_0xc172('0x13')](function(_0xc40c5a){if(_0xc40c5a){if(_0xc40c5a[_0xc172('0x25')]){_0x5f5663(null,[_0xc40c5a['interval']]);}else{_0x5f5663(null,_[_0xc172('0x26')](_0xc40c5a['Intervals'],_0xc172('0x27')));}}else{_0x5f5663(null,![]);}})['catch'](function(_0xb68a39){_0x5f5663(_0xb68a39);});};AGIVertices['prototype'][_0xc172('0x20')]=function(_0x6760a8){return util[_0xc172('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x6760a8);};AGIVertices[_0xc172('0x10')][_0xc172('0x29')]=function(_0x2eb6ad,_0x40cf2f,_0x1c6783){odbc[_0xc172('0x2a')](_0x2eb6ad,function(_0x3ef573){if(_0x3ef573){logger[_0xc172('0x2b')](_0xc172('0x2c'),_0x3ef573);_0x1c6783(_0x3ef573);}else{logger[_0xc172('0x2d')](_0xc172('0x2e'));odbc[_0xc172('0x2f')](_0x40cf2f,function(_0xbdce77,_0x326a5e){if(_0xbdce77){logger['info'](_0xc172('0x30'),_0x40cf2f);_0x1c6783(_0xbdce77);}else{logger['info'](_0xc172('0x31'),_0x40cf2f);odbc['close'](function(_0x104137){if(_0x104137){logger[_0xc172('0x2b')](_0xc172('0x32'),_0x104137);}_0x1c6783(null,_0x326a5e);});}});}});};AGIVertices['prototype'][_0xc172('0x33')]=function(_0x5e185c,_0x536c34){this[_0xc172('0xe')][_0xc172('0x34')](_0x5e185c)[_0xc172('0x13')](function(_0x2b3261){_0x536c34(null,_0x2b3261?_0x2b3261:![]);})[_0xc172('0x15')](function(_0x51894e){_0x536c34(_0x51894e);});};AGIVertices[_0xc172('0x10')][_0xc172('0x35')]=function(_0xd8a15c,_0x362218){this[_0xc172('0xe')]['createSmsMessage'](_0xd8a15c)['then'](function(_0x2ced81){_0x362218(null,_0x2ced81);})['catch'](function(_0x1f1f3d){_0x362218(_0x1f1f3d);});};AGIVertices[_0xc172('0x10')][_0xc172('0x36')]=function(_0x43c8c8,_0x1fd80d,_0x5a31a4){this[_0xc172('0xe')][_0xc172('0x36')]({'uniqueid':this['channel'][_0xc172('0x37')],'node':_0x43c8c8[_0xc172('0x38')],'application':_0x43c8c8[_0xc172('0x39')],'data':_0x1fd80d||null,'project_name':this[_0xc172('0xd')][_0xc172('0x3a')],'callerid':this[_0xc172('0xd')][_0xc172('0x3b')]})[_0xc172('0x13')](function(_0x291289){if(_0x5a31a4){_0x5a31a4(null,_0x291289);}})[_0xc172('0x15')](function(_0x3a73f6){if(_0x5a31a4){_0x5a31a4(_0x3a73f6);}});};AGIVertices[_0xc172('0x10')][_0xc172('0x3c')]=function(_0x29cef8,_0x577be3,_0x1795ea,_0x4f9fb8){this[_0xc172('0xe')]['createSquareRecording']({'uniqueid':this[_0xc172('0xd')][_0xc172('0x37')],'callerid':this[_0xc172('0xd')][_0xc172('0x3b')],'calleridname':this[_0xc172('0xd')][_0xc172('0x3d')],'context':this[_0xc172('0xd')][_0xc172('0x3e')],'extension':this['channel'][_0xc172('0x3f')],'priority':this['channel'][_0xc172('0x40')],'accountcode':this[_0xc172('0xd')]['accountcode'],'dnid':this[_0xc172('0xd')][_0xc172('0x41')],'projectName':this[_0xc172('0xd')][_0xc172('0x3a')],'saveName':_0x577be3,'filename':_0x29cef8[_0xc172('0x42')]||_0x577be3,'savePath':_0x1795ea})['then'](function(_0xab7af2){_0x4f9fb8(null,_0xab7af2);})[_0xc172('0x15')](function(_0x3a66f0){_0x4f9fb8(_0x3a66f0);});};AGIVertices['prototype'][_0xc172('0x43')]=function(_0x2539b2,_0x39846a,_0x179a68,_0x5f05c7,_0x337571){this[_0xc172('0xe')][_0xc172('0x43')]({'uniqueid':this['channel'][_0xc172('0x37')],'body':_0x2539b2,'direction':_0x39846a,'providerName':_0x179a68,'providerResponse':_0x5f05c7})[_0xc172('0x13')](function(_0x2f3b5a){if(_0x337571){_0x337571(null,_0x2f3b5a);}})[_0xc172('0x15')](function(_0x34e4fd){if(_0x337571){_0x337571(_0x34e4fd);}});};AGIVertices[_0xc172('0x10')]['createCmContact']=function(_0x19cbbf,_0x494ae2){this['rpc'][_0xc172('0x44')]({'firstName':_[_0xc172('0x45')](_0x19cbbf['name'])||_[_0xc172('0x46')](_0x19cbbf[_0xc172('0x14')])?'callback_'+Math['random']():_0x19cbbf[_0xc172('0x14')],'lastName':_['isEmpty'](_0x19cbbf[_0xc172('0x47')])||_[_0xc172('0x46')](_0x19cbbf[_0xc172('0x47')])?null:_0x19cbbf['lastName'],'phone':_0x19cbbf['phone'],'ListId':_0x19cbbf[_0xc172('0x48')],'scheduledat':_0x19cbbf[_0xc172('0x49')],'callbackUniqueid':this[_0xc172('0xd')][_0xc172('0x37')],'tags':'callback','description':_0xc172('0x4a')+_0x19cbbf[_0xc172('0x49')][_0xc172('0x4b')](),'priority':_0x19cbbf[_0xc172('0x4c')]})[_0xc172('0x13')](function(_0x7eeb87){_0x494ae2(null,_0x7eeb87);})['catch'](function(_0x1baec3){_0x494ae2(_0x1baec3);});};AGIVertices['prototype'][_0xc172('0x4d')]=function(_0x9424aa,_0x4fffde){this[_0xc172('0xe')][_0xc172('0x4e')](_0x9424aa)['then'](function(_0xdc72ae){_0x4fffde(null,_0xdc72ae?_0xdc72ae[_0xc172('0x14')]:![]);})[_0xc172('0x15')](function(_0x13e50e){_0x4fffde(_0x13e50e);});};AGIVertices[_0xc172('0x10')]['agentPause']=function(_0x4a127e,_0x526ed7,_0x12001e){var _0x158392={'role':_0xc172('0x4f')};_0x158392[_0x4a127e]=this[_0xc172('0xd')]['callerid'];this[_0xc172('0xe')]['agentPause'](_0x158392,_0x526ed7,this[_0xc172('0xd')]['uniqueid'])[_0xc172('0x13')](function(_0x3a5c08){_0x12001e(null,_[_0xc172('0x46')](_0x3a5c08)?![]:!![]);})[_0xc172('0x15')](function(_0x59995e){logger[_0xc172('0x2b')](_0x59995e);_0x12001e(null,![]);});};AGIVertices['prototype'][_0xc172('0x50')]=function(_0x2e4047,_0x4cdc51){var _0x8b05ba={'role':_0xc172('0x4f')};_0x8b05ba[_0x2e4047]=this[_0xc172('0xd')][_0xc172('0x3b')];this[_0xc172('0xe')][_0xc172('0x50')](_0x8b05ba)[_0xc172('0x13')](function(_0x622b14){_0x4cdc51(null,_['isNil'](_0x622b14)?![]:!![]);})[_0xc172('0x15')](function(_0x299455){logger[_0xc172('0x2b')](_0x299455);_0x4cdc51(null,![]);});};AGIVertices['prototype'][_0xc172('0x51')]=function(_0x3aca9b,_0xac46fe){var _0x2d7012={'role':_0xc172('0x4f')};_0x2d7012[_0x3aca9b]=this[_0xc172('0xd')][_0xc172('0x3b')];this[_0xc172('0xe')][_0xc172('0x51')](_0x2d7012)[_0xc172('0x13')](function(_0x15e11f){_0xac46fe(null,_['isNil'](_0x15e11f)?![]:!![]);})['catch'](function(_0x2242d0){logger[_0xc172('0x2b')](_0x2242d0);_0xac46fe(null,![]);});};AGIVertices[_0xc172('0x10')][_0xc172('0x52')]=function(_0x2aa256,_0x238660){var _0x596a4c={'role':_0xc172('0x4f')};_0x596a4c[_0x2aa256]=this[_0xc172('0xd')][_0xc172('0x3b')];var _0x26a0cc=_0x2aa256!=_0xc172('0x53')?util[_0xc172('0x28')]('%s/%s@from-sip/n',_0xc172('0x54'),this['channel']['callerid']):undefined;this['rpc']['agentLogin'](_0x596a4c,_0x26a0cc)[_0xc172('0x13')](function(_0xe50785){_0x238660(null,_[_0xc172('0x46')](_0xe50785)?![]:!![]);})['catch'](function(_0xc38c33){logger[_0xc172('0x2b')](_0xc38c33);_0x238660(null,![]);});};AGIVertices['prototype'][_0xc172('0x55')]=function(_0x16aa05,_0x354e2d){sh[_0xc172('0x56')](_[_0xc172('0x57')](_0x16aa05),function(_0x10a7c2,_0x1ea971){var _0x4f5b38=_0x1ea971[_0xc172('0x58')](/(\r\n|\n|\r)/gm,'');_0x354e2d(null,_0x4f5b38);});};AGIVertices[_0xc172('0x10')]['googleCloudTTS']=function(_0x576697,_0x6f9f33){scripts[_0xc172('0x59')](_0x576697[_0xc172('0x5a')],_0x576697[_0xc172('0x5b')]||'text',_0x576697[_0xc172('0x5c')],_0x576697[_0xc172('0x5d')]||_0xc172('0x5e'),_0x576697[_0xc172('0x5f')]||_0xc172('0x60'),_0x576697[_0xc172('0x61')]||'MP3')[_0xc172('0x13')](function(_0x8a6e2e){_0x6f9f33(null,_0x8a6e2e);})[_0xc172('0x15')](function(_0x41d5c2){_0x6f9f33(_0x41d5c2);});};AGIVertices[_0xc172('0x10')][_0xc172('0x62')]=function(_0x227770,_0x55aea9){scripts['googleTTS'](_0x227770[_0xc172('0x5c')],_0x227770[_0xc172('0x63')]||'en',0x1)[_0xc172('0x13')](function(_0x44a07a){_0x55aea9(null,_0x44a07a);})[_0xc172('0x15')](function(_0x491a84){_0x55aea9(_0x491a84);});};AGIVertices[_0xc172('0x10')][_0xc172('0x64')]=function(_0x37f1e4,_0x4c7d4e){var _0x4d2629={'uri':_0x37f1e4[_0xc172('0x65')],'method':_0x37f1e4[_0xc172('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x37f1e4[_0xc172('0x67')])==='number'&&parseInt(_0x37f1e4[_0xc172('0x67')])>=0x1?parseInt(_0x37f1e4[_0xc172('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xc172('0x68'),_0xc172('0x69')],_0x4d2629[_0xc172('0x66')]['toUpperCase']())){try{_0x4d2629[_0xc172('0x6a')]=_0x37f1e4[_0xc172('0xa')]?JSON[_0xc172('0x6b')](_0x37f1e4['rawBody']):{};}catch(_0x240d09){logger[_0xc172('0x2b')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x240d09);}}try{_0x4d2629['headers']=_0x37f1e4[_0xc172('0x9')]?JSON['parse'](_0x37f1e4[_0xc172('0x9')]):{};}catch(_0x5ceba2){logger[_0xc172('0x2b')](_0xc172('0x6c'),_0x5ceba2);}if(_0x37f1e4[_0xc172('0x6d')]){try{var _0x51d633=require(_0x37f1e4[_0xc172('0x6d')])[_0xc172('0x6e')](this,_0x4d2629);_0x4d2629[_0xc172('0x6f')]=Mustache['render'](_0x37f1e4['url'],_0x51d633,{},['$$','$$']);if(_0x4d2629[_0xc172('0x70')]){_0x4d2629[_0xc172('0x70')]=JSON[_0xc172('0x6b')](Mustache[_0xc172('0x71')](JSON['stringify'](_0x4d2629[_0xc172('0x70')]),_0x51d633,{},['$$','$$']));}if(_0x4d2629[_0xc172('0x6a')]){_0x4d2629[_0xc172('0x6a')]=JSON['parse'](Mustache['render'](JSON[_0xc172('0x72')](_0x4d2629[_0xc172('0x6a')]),_0x51d633,{},['$$','$$']));}}catch(_0x26f8a5){logger[_0xc172('0x2b')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x26f8a5);}}rp(_0x4d2629)[_0xc172('0x13')](function(_0xa53f7d){var _0x1e8d93={'statusCode':_0xa53f7d[_0xc172('0x73')]||0xc8,'statusMessage':_0xa53f7d[_0xc172('0x74')]||'OK','headers':_0xa53f7d[_0xc172('0x70')]||{},'body':_0xa53f7d['body']||{}};_0x4c7d4e(null,_0x1e8d93);})[_0xc172('0x15')](function(_0x4b58f2){var _0x549148={'statusCode':_0x4b58f2['statusCode']||0x1f4,'statusMessage':_0x4b58f2[_0xc172('0x75')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4b58f2[_0xc172('0x76')][_0xc172('0x70')]||{},'body':_0x4b58f2['options']['body']||{}};_0x4c7d4e(null,_0x549148);});};AGIVertices[_0xc172('0x10')][_0xc172('0x77')]=function(_0x59944c,_0xe53990){scripts[_0xc172('0x77')](this[_0xc172('0xd')][_0xc172('0x37')],_0x59944c[_0xc172('0x78')],_0x59944c[_0xc172('0x5c')],_0x59944c[_0xc172('0x79')]||'en')[_0xc172('0x13')](function(_0xbd040a){_0xe53990(null,_0xbd040a);})[_0xc172('0x15')](function(_0x4d00a6){_0xe53990(_0x4d00a6);});};AGIVertices['prototype'][_0xc172('0x7a')]=function(_0x5422ce,_0x2271a5){scripts[_0xc172('0x7a')](this['channel'][_0xc172('0x37')],_0x5422ce[_0xc172('0x7b')],_0x5422ce[_0xc172('0x7c')],_0x5422ce['private_key'],_0x5422ce[_0xc172('0x5c')],_0x5422ce[_0xc172('0x7d')]||'en')[_0xc172('0x13')](function(_0x4d98ea){_0x2271a5(null,_0x4d98ea);})[_0xc172('0x15')](function(_0x503f25){_0x2271a5(_0x503f25);});};AGIVertices[_0xc172('0x10')]['sestekNDA']=function(_0x22a62b,_0x145bcb){scripts[_0xc172('0x7e')](this[_0xc172('0xd')],_0x22a62b)['then'](function(_0x2080f6){_0x145bcb(null,_0x2080f6);})[_0xc172('0x15')](function(_0x358e18){_0x145bcb(_0x358e18);});};AGIVertices['prototype']['ispeechTTS']=function(_0x22bd24,_0x4f9dce){scripts[_0xc172('0x7f')](_0x22bd24[_0xc172('0x78')],_0x22bd24[_0xc172('0x5c')],_0x22bd24['ispeech_tts_language']||'en-US',_0x22bd24[_0xc172('0x80')])[_0xc172('0x13')](function(_0x3f8151){_0x4f9dce(null,_0x3f8151);})['catch'](function(_0x506d9e){_0x4f9dce(_0x506d9e);});};AGIVertices[_0xc172('0x10')][_0xc172('0x81')]=function(_0x1ab523,_0x48edbb,_0x42f047){scripts[_0xc172('0x81')](_0x48edbb,_0x1ab523[_0xc172('0x78')],_0x1ab523['ispeech_asr_language']||_0xc172('0x5e'),this[_0xc172('0x82')](_0x1ab523[_0xc172('0x83')])?_0x1ab523[_0xc172('0x83')]:undefined)['then'](function(_0x263b4e){_0x42f047(null,_0x263b4e);})[_0xc172('0x15')](function(_0x2af87a){_0x42f047(_0x2af87a);});};AGIVertices[_0xc172('0x10')][_0xc172('0x84')]=function(_0x2f803e,_0x1f685d){scripts[_0xc172('0x84')](_0x2f803e[_0xc172('0x85')],_0x2f803e['aws_secret_access_key'],_0x2f803e[_0xc172('0x86')],_0x2f803e[_0xc172('0x87')]||_0xc172('0x88'),_0x2f803e[_0xc172('0x5c')],_0x2f803e[_0xc172('0x89')]||_0xc172('0x5c'))[_0xc172('0x13')](function(_0x42698a){_0x1f685d(null,_0x42698a);})['catch'](function(_0x31e6ef){_0x1f685d(_0x31e6ef);});};AGIVertices[_0xc172('0x10')][_0xc172('0x8a')]=function(_0x5e429e,_0x3ae110){scripts[_0xc172('0x8a')](this[_0xc172('0xd')]['uniqueid'],_0x5e429e['aws_access_key_id'],_0x5e429e[_0xc172('0x8b')],_0x5e429e['aws_lex_region'],_0x5e429e['text'],_0x5e429e[_0xc172('0x8c')])[_0xc172('0x13')](function(_0x236a16){_0x3ae110(null,_0x236a16);})['catch'](function(_0x46a5ff){_0x3ae110(_0x46a5ff);});};AGIVertices[_0xc172('0x10')][_0xc172('0x8d')]=function(_0x3a4f7c,_0x40e0bf,_0x51c0dd){scripts[_0xc172('0x8d')](_0x40e0bf,_0x3a4f7c['key'],_0x3a4f7c[_0xc172('0x8e')]||'en-US')[_0xc172('0x13')](function(_0x460476){_0x51c0dd(null,_0x460476);})[_0xc172('0x15')](function(_0x3d236f){_0x51c0dd(_0x3d236f);});};AGIVertices[_0xc172('0x10')][_0xc172('0x8f')]=function(_0xd43d02,_0x3e39aa,_0x274329){scripts[_0xc172('0x8f')](_0x3e39aa,_0xd43d02[_0xc172('0x90')],_0xd43d02['appsecret'],_0xd43d02[_0xc172('0x6f')])[_0xc172('0x13')](function(_0x57f4ea){_0x274329(null,_0x57f4ea);})[_0xc172('0x15')](function(_0x4d3e7f){_0x274329(_0x4d3e7f);});};AGIVertices[_0xc172('0x10')][_0xc172('0x91')]=function(_0x1e776c){var _0xa50f84=_[_0xc172('0x92')](verticesWithRetry,_0x1e776c[_0xc172('0x39')])?_0x1e776c:_[_0xc172('0x93')](_0x1e776c);for(var _0x4fbb81 in _0xa50f84){if(_0xa50f84[_0xc172('0x94')](_0x4fbb81)){if(_0xa50f84[_0x4fbb81]&&_[_0xc172('0x95')](_0xa50f84[_0x4fbb81])){if(_[_0xc172('0x92')](recursiveMapAttributes,_0x4fbb81)){_0xa50f84[_0x4fbb81]=this['replaceObjectAllVariables'](_0xa50f84[_0x4fbb81]);}else{_0xa50f84[_0x4fbb81]=this['replaceAllVariables'](_0xa50f84[_0x4fbb81]);}}}}return _0xa50f84;};AGIVertices[_0xc172('0x10')][_0xc172('0x96')]=function(_0x406f71){for(var _0x2232b1 in _0x406f71){if(_0x406f71['hasOwnProperty'](_0x2232b1)){if(_[_0xc172('0x97')](_0x406f71[_0x2232b1])){this[_0xc172('0x96')](_0x406f71[_0x2232b1]);}else if(_[_0xc172('0x98')](_0x406f71[_0x2232b1])){for(var _0x1b72e1=0x0;_0x1b72e1<_0x406f71[_0x2232b1]['length'];_0x1b72e1++){this['recursiveNodeIndex'](_0x406f71[_0x2232b1][_0x1b72e1]);}}else if(_[_0xc172('0x95')](_0x406f71[_0x2232b1])){_0x406f71[_0x2232b1]=this[_0xc172('0x99')](_0x406f71[_0x2232b1]);}}}};AGIVertices[_0xc172('0x10')][_0xc172('0x9a')]=function(_0x45fc54,_0x1d974c){for(var _0x4acd30 in _0x45fc54){if(_0x45fc54['hasOwnProperty'](_0x4acd30)){if(_[_0xc172('0x97')](_0x45fc54[_0x4acd30])){if(!_[_0xc172('0x45')](_0x45fc54[_0x4acd30])){this[_0xc172('0x9a')](_0x45fc54[_0x4acd30],util[_0xc172('0x28')](_0xc172('0x9b'),_0x1d974c,_0x4acd30));}}else if(_[_0xc172('0x98')](_0x45fc54[_0x4acd30])){for(var _0x45dfea=0x0;_0x45dfea<_0x45fc54[_0x4acd30][_0xc172('0x9c')];_0x45dfea++){this[_0xc172('0x9a')](_0x45fc54[_0x4acd30][_0x45dfea],util[_0xc172('0x28')](_0xc172('0x9b'),_0x1d974c,_0x4acd30+'['+_0x45dfea+']'));}}else{if(!_['isNil'](_0x45fc54[_0x4acd30])){this['channel'][_0xc172('0x9d')](util['format'](_0xc172('0x9b'),_0x1d974c,_0x4acd30),_0x45fc54[_0x4acd30]);}}}}};AGIVertices[_0xc172('0x10')][_0xc172('0x9e')]=function(_0x57800c){try{var _0x48371c=JSON['parse'](_0x57800c);this[_0xc172('0x96')](_0x48371c);return JSON['stringify'](_0x48371c);}catch(_0x29e697){return this[_0xc172('0x99')](_0x57800c);}};AGIVertices['prototype'][_0xc172('0x99')]=function(_0x4d8c50){var _0x262f6b=_0x4d8c50[_0xc172('0x9f')]('{');for(var _0x3e6e4a=0x1;_0x3e6e4a<_0x262f6b[_0xc172('0x9c')];_0x3e6e4a+=0x1){var _0x1fe3f5=_0x262f6b[_0x3e6e4a]['split']('}');if(_0x1fe3f5['length']>0x1){_0x4d8c50=_0x4d8c50[_0xc172('0xa0')]('{'+_0x1fe3f5[0x0]+'}',this[_0xc172('0xd')][_0xc172('0x11')](_0x1fe3f5[0x0])[_0xc172('0xa1')]||_0x1fe3f5[0x0]);}}if(_0x262f6b[_0xc172('0x9c')]===0x1){return _0x4d8c50[_0xc172('0x4b')]();}return this[_0xc172('0x99')](_0x4d8c50);};AGIVertices['prototype'][_0xc172('0xa2')]=function(_0x16932f,_0xf6742){var _0x2f1bc2=this[_0xc172('0xd')][_0xc172('0x11')](_0x16932f);if(_0x2f1bc2[_0xc172('0xa3')]===-0x1){return _0x2f1bc2;}logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xa4'),_0xf6742,_0x2f1bc2[_0xc172('0xa1')]));return this['channel'][_0xc172('0x9d')](_0xf6742,_0x2f1bc2[_0xc172('0xa1')]);};AGIVertices[_0xc172('0x10')][_0xc172('0x82')]=function(_0x3497da){return _0x3497da&&_0x3497da!=='0'&&_0x3497da!=='-1'&&_0x3497da!=='';};AGIVertices[_0xc172('0x10')][_0xc172('0xa5')]=function(_0x410851){this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x410851,'-');_0x410851[_0xc172('0xa6')]=_0x410851[_0xc172('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc172('0x10')][_0xc172('0xa7')]=function(_0x3d1c90){logger['info'](util[_0xc172('0x28')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3d1c90[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x3d1c90[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}var _0x14655c='\x22'+_0x3d1c90[_0xc172('0x5c')]+'\x22';if(this[_0xc172('0x82')](_0x3d1c90[_0xc172('0x76')])){_0x14655c+=','+_0x3d1c90[_0xc172('0x76')];}var _0x6e6b6c=this[_0xc172('0xd')][_0xc172('0x56')](_0xc172('0xaa'),_0x14655c);if(_0x6e6b6c[_0xc172('0xa3')]===-0x1){return _0x6e6b6c;}return this[_0xc172('0xd')][_0xc172('0xa8')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x14655c));};AGIVertices[_0xc172('0x10')][_0xc172('0xab')]=function(_0x154925){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xac'),_0x154925[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x154925[_0xc172('0xad')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xae'));}var _0x4922cf=_0x154925[_0xc172('0xad')];if(this[_0xc172('0x82')](_0x154925[_0xc172('0x76')])){_0x4922cf+=','+_0x154925[_0xc172('0x76')];}var _0x420529=this[_0xc172('0xd')]['exec']('MRCPRecog',_0x4922cf);if(_0x420529['result']===-0x1){return _0x420529;}var _0xda9d84=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xc172('0xaf'));if(_0xda9d84[_0xc172('0xa3')]===-0x1){return _0xda9d84;}var _0x1fb843=this[_0xc172('0xa2')](_0xc172('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x1fb843[_0xc172('0xa3')]===-0x1){return _0x1fb843;}var _0x4391c7=this['getAndSetVariable'](_0xc172('0xb1'),_0xc172('0xb2'));if(_0x4391c7[_0xc172('0xa3')]===-0x1){return _0x4391c7;}return this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xb3'),_0x4922cf));};AGIVertices[_0xc172('0x10')][_0xc172('0x7')]=function(_0x371bb7){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xb4'),_0x371bb7[_0xc172('0x38')]));return this[_0xc172('0xd')][_0xc172('0x7')]([_0x371bb7['command'],_0x371bb7[_0xc172('0xb5')]]);};AGIVertices[_0xc172('0x10')][_0xc172('0xb6')]=function(_0x132a29){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xb7'),_0x132a29['label']));if(this[_0xc172('0x82')](_0x132a29[_0xc172('0x67')])){logger['info'](util[_0xc172('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x132a29[_0xc172('0x67')]));var _0x303cc9=this[_0xc172('0xd')]['wait'](_0x132a29[_0xc172('0x67')]);if(_0x303cc9[_0xc172('0xa3')]===-0x1){return _0x303cc9;}}return this[_0xc172('0xd')][_0xc172('0xb6')]();};AGIVertices[_0xc172('0x10')][_0xc172('0xb8')]=function(_0x1f6019){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xb9'),_0x1f6019[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x1f6019[_0xc172('0x48')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x1f6019,'no\x20list\x20selected');}_0x1f6019['scheduledAt']=moment();if(this['isConfigured'](_0x1f6019['delay'])){_0x1f6019[_0xc172('0x49')]=moment()[_0xc172('0xba')](_0x1f6019[_0xc172('0xbb')],_0xc172('0xbc'));}if(!this['isConfigured'](_0x1f6019['callback_priority'])){_0x1f6019[_0xc172('0x4c')]=0x2;}this[_0xc172('0x44')][_0xc172('0x6e')](this,_0x1f6019);return this[_0xc172('0xd')]['noop'](util['format'](_0xc172('0xbd'),_0x1f6019[_0xc172('0xbe')],_0x1f6019[_0xc172('0x48')],_0x1f6019['scheduledAt']));};AGIVertices[_0xc172('0x10')][_0xc172('0xbf')]=function(_0x5f3f39){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xc0'),_0x5f3f39[_0xc172('0x38')]));var _0x4518c8=this[_0xc172('0xd')]['exec'](_0x5f3f39[_0xc172('0xc1')],_0x5f3f39['options']);if(_0x4518c8['result']===-0x1){return _0x4518c8;}return this[_0xc172('0xd')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x5f3f39['application'],_0x5f3f39[_0xc172('0x76')]));};AGIVertices[_0xc172('0x10')][_0xc172('0xc2')]=function(_0x5456a6){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xc3'),_0x5456a6['label']));if(!this[_0xc172('0x82')](_0x5456a6[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}var _0x13534b='\x22'+_0x5456a6[_0xc172('0x5c')]+'\x22';if(this['isConfigured'](_0x5456a6[_0xc172('0x76')])){_0x13534b+=','+_0x5456a6[_0xc172('0x76')];}var _0x10f73d=this[_0xc172('0xd')][_0xc172('0x56')](_0xc172('0xaa'),_0x13534b);if(_0x10f73d[_0xc172('0xa3')]===-0x1){return _0x10f73d;}return this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x13534b));};AGIVertices['prototype'][_0xc172('0xc4')]=function(_0x2d89e7){logger['info'](util['format'](_0xc172('0xc5'),_0x2d89e7[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x2d89e7[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}var _0x572e3f='\x22'+_0x2d89e7[_0xc172('0x5c')]+'\x22';if(this[_0xc172('0x82')](_0x2d89e7[_0xc172('0x76')])){_0x572e3f+=','+_0x2d89e7[_0xc172('0x76')];}var _0x199cb2=this['channel'][_0xc172('0x56')](_0xc172('0xaa'),_0x572e3f);if(_0x199cb2[_0xc172('0xa3')]===-0x1){return _0x199cb2;}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xc6'),_0x572e3f));};AGIVertices[_0xc172('0x10')][_0xc172('0xc7')]=function(_0x23a29b){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xc8'),_0x23a29b[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x23a29b[_0xc172('0xad')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xae'));}var _0x591538=_0x23a29b[_0xc172('0xad')];if(this[_0xc172('0x82')](_0x23a29b[_0xc172('0x76')])){_0x591538+=','+_0x23a29b[_0xc172('0x76')];}var _0x125f4d=this['channel'][_0xc172('0x56')](_0xc172('0xc9'),_0x591538);if(_0x125f4d[_0xc172('0xa3')]===-0x1){return _0x125f4d;}var _0x5debb6=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xc172('0xca'));if(_0x5debb6[_0xc172('0xa3')]===-0x1){return _0x5debb6;}var _0x36b7fb=this[_0xc172('0xa2')](_0xc172('0xb0'),_0xc172('0xcb'));if(_0x36b7fb['result']===-0x1){return _0x36b7fb;}var _0x4ba97e=this[_0xc172('0xa2')](_0xc172('0xb1'),_0xc172('0xcc'));if(_0x4ba97e[_0xc172('0xa3')]===-0x1){return _0x4ba97e;}return this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0xb3'),_0x591538));};AGIVertices[_0xc172('0x10')]['sestekasr']=function(_0x2dc2ed){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xcd'),_0x2dc2ed[_0xc172('0x38')]));if(!this['isConfigured'](_0x2dc2ed[_0xc172('0xad')])){return this['channel'][_0xc172('0xa8')](_0xc172('0xae'));}var _0xd10d64=_0x2dc2ed['grammar'];if(this[_0xc172('0x82')](_0x2dc2ed[_0xc172('0x76')])){_0xd10d64+=','+_0x2dc2ed[_0xc172('0x76')];}var _0x507676=this[_0xc172('0xd')][_0xc172('0x56')]('MRCPRecog',_0xd10d64);if(_0x507676[_0xc172('0xa3')]===-0x1){return _0x507676;}var _0x330de3=this['getAndSetVariable'](_0xc172('0xce'),_0xc172('0xcf'));if(_0x330de3['result']===-0x1){return _0x330de3;}var _0x2d7825=this[_0xc172('0xa2')](_0xc172('0xb0'),_0xc172('0xd0'));if(_0x2d7825[_0xc172('0xa3')]===-0x1){return _0x2d7825;}var _0x8bb578=this[_0xc172('0xa2')]('RECOG_INSTANCE()',_0xc172('0xd1'));if(_0x8bb578[_0xc172('0xa3')]===-0x1){return _0x8bb578;}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xb3'),_0xd10d64));};AGIVertices[_0xc172('0x10')][_0xc172('0xd2')]=function(_0x2e13f7){logger[_0xc172('0x2d')](util[_0xc172('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2e13f7[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x2e13f7['odbc_id'])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2e13f7,'no\x20database\x20selected');}var _0x510b90=this[_0xc172('0xd3')][_0xc172('0x6e')](this,_0x2e13f7[_0xc172('0xd4')]);if(!_0x510b90){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2e13f7,'no\x20odbc\x20database\x20found');}if(!this[_0xc172('0x82')](_0x2e13f7[_0xc172('0x2f')])){return this[_0xc172('0xd')]['error'](_0x2e13f7,'no\x20query\x20configured');}var _0x38ba38=_0x2e13f7[_0xc172('0x2f')][_0xc172('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xc172('0x28')](_0xc172('0xd5'),_0x38ba38));var _0x1c6802=this['getQueryOdbc'][_0xc172('0x6e')](this,_0x510b90,_0x38ba38);this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x2e13f7,_0x38ba38);if(!this[_0xc172('0x82')](_0x2e13f7['variable_id'])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xd6'));}var _0x3c1797=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0x2e13f7[_0xc172('0xd7')]);if(!_0x3c1797){return this[_0xc172('0xd')]['error'](_0x2e13f7,_0xc172('0xd8'));}var _0x3bd616=this;_0x1c6802[_0xc172('0xd9')](function(_0xd726ce,_0x42b0a3){Object['keys'](_0xd726ce)[_0xc172('0xd9')](function(_0x5a06f9){_0x3bd616['channel'][_0xc172('0x9d')](util['format'](_0xc172('0xda'),_0x3c1797,_0x42b0a3,_0x5a06f9),_0xd726ce[_0x5a06f9]);});});this['channel'][_0xc172('0x9d')](util['format'](_0xc172('0xdb'),_0x3c1797),_0x1c6802[_0xc172('0x9c')]);return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xdc'),_0x3c1797));};AGIVertices[_0xc172('0x10')][_0xc172('0xdd')]=function(_0x5c8f2a){logger[_0xc172('0xde')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x5c8f2a[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x5c8f2a[_0xc172('0xdf')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5c8f2a,_0xc172('0xe0'));}var _0x582788=this[_0xc172('0x1c')][_0xc172('0x6e')](this,_0x5c8f2a[_0xc172('0xdf')]);if(!_0x582788){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5c8f2a,_0xc172('0xe1'));}var _0xd5de9d=this[_0xc172('0xd')][_0xc172('0x56')](_0xc172('0xe2'),[util[_0xc172('0x28')](_0xc172('0xe3'),_0x582788),_0x5c8f2a['timeout'],_0x5c8f2a[_0xc172('0xe4')],_0x5c8f2a['url']]);if(_0xd5de9d[_0xc172('0xa3')]===-0x1){return _0xd5de9d;}return this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xe5'),'DIAL'));};AGIVertices[_0xc172('0x10')][_0xc172('0xe6')]=function(_0x3b1db5){logger[_0xc172('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3b1db5[_0xc172('0x38')]));if(!this['isConfigured'](_0x3b1db5['key'])){return this[_0xc172('0xd')][_0xc172('0xa8')]('no\x20key\x20configured');}if(!this[_0xc172('0x82')](_0x3b1db5[_0xc172('0x5c')])){return this[_0xc172('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0xc172('0xe7')]=!![];this['createSquareDetailsReport'](_0x3b1db5);this[_0xc172('0x43')](_0x3b1db5['text'],'in','','');this[_0xc172('0xd')]['noop'](util['format']('Trying\x20Dialogflow:\x20%s',_0x3b1db5[_0xc172('0x5c')]));var _0xe6aea6=this[_0xc172('0x77')][_0xc172('0x6e')](this,_0x3b1db5);if(_0xe6aea6){for(var _0x67d17e in _0xe6aea6){if(_0xe6aea6[_0xc172('0x94')](_0x67d17e)){this[_0xc172('0xd')]['setVariable'](util['format'](_0xc172('0xe8'),_0x67d17e[_0xc172('0xe9')]()),_0xe6aea6[_0x67d17e]);}}this[_0xc172('0x43')](_0xe6aea6['speech'],_0xc172('0xea'),'dialogflow','');return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xeb'),_0xe6aea6[_0xc172('0xec')]));}return this[_0xc172('0xd')][_0xc172('0x2b')](_0x3b1db5,_0xc172('0xed'));};AGIVertices['prototype']['dialogflowV2']=function(_0x2818ac){logger[_0xc172('0x2d')](util['format'](_0xc172('0xee'),_0x2818ac['label']));if(!this[_0xc172('0x82')](_0x2818ac[_0xc172('0x7b')])){return this['channel'][_0xc172('0xa8')]('no\x20project_id\x20configured');}if(!this[_0xc172('0x82')](_0x2818ac[_0xc172('0x7c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xef'));}if(!this[_0xc172('0x82')](_0x2818ac['private_key'])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xf0'));}if(!this[_0xc172('0x82')](_0x2818ac[_0xc172('0x7d')])){return this[_0xc172('0xd')]['noop']('no\x20anguage\x20configured');}if(!this[_0xc172('0x82')](_0x2818ac[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}this[_0xc172('0xd')][_0xc172('0xe7')]=!![];this[_0xc172('0x36')](_0x2818ac);this[_0xc172('0x43')](_0x2818ac[_0xc172('0x5c')],'in','','');this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')](_0xc172('0xf1'),_0x2818ac[_0xc172('0x5c')]));var _0x1d5f7d=this['googleDialogflowV2'][_0xc172('0x6e')](this,_0x2818ac);if(_0x1d5f7d){for(var _0x54f21b in _0x1d5f7d){if(_0x1d5f7d[_0xc172('0x94')](_0x54f21b)){if(_0x54f21b!==_0xc172('0xf2')){this['channel'][_0xc172('0x9d')](util[_0xc172('0x28')](_0xc172('0xe8'),_0x54f21b['toUpperCase']()),_0x1d5f7d[_0x54f21b]);}}}this[_0xc172('0x43')](_0x1d5f7d[_0xc172('0xec')],_0xc172('0xea'),_0xc172('0xf3'),_0x1d5f7d[_0xc172('0xf2')]);return this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('DialogflowV2\x20Result\x20%s',_0x1d5f7d[_0xc172('0xec')]));}return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2818ac,_0xc172('0xf4'));};AGIVertices[_0xc172('0x10')][_0xc172('0xf5')]=function(_0xa36ef8){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0xf6'),_0xa36ef8[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0xa36ef8[_0xc172('0xf7')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xf8'));}if(!this[_0xc172('0x82')](_0xa36ef8[_0xc172('0xf9')])){return this[_0xc172('0xd')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0xa36ef8[_0xc172('0xfa')])){return this[_0xc172('0xd')][_0xc172('0xa8')]('no\x20password\x20configured');}if(!this['isConfigured'](_0xa36ef8[_0xc172('0xfb')])){return this['channel'][_0xc172('0xa8')](_0xc172('0xa9'));}this['channel'][_0xc172('0xe7')]=!![];this[_0xc172('0x36')](_0xa36ef8);this[_0xc172('0x43')](_0xa36ef8[_0xc172('0x5c')],'in','','');this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Trying\x20SestekNDA:\x20%s',_0xa36ef8['text']));var _0x58c23b=this[_0xc172('0x7e')][_0xc172('0x6e')](this,_0xa36ef8);if(_0x58c23b){for(var _0x35fb6d in _0x58c23b){if(_0x58c23b[_0xc172('0x94')](_0x35fb6d)){this[_0xc172('0xd')]['setVariable'](util['format']('SESTEK_NDA_%s',_0x35fb6d['toUpperCase']()),_0x58c23b[_0x35fb6d]);}}this[_0xc172('0x43')](_0x58c23b[_0xc172('0xec')],_0xc172('0xea'),_0xc172('0xf5'),'');if(_0x58c23b[_0xc172('0xfc')]){this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x58c23b['audiofile']));var _0x47cae7=this['channel']['streamFile'](_0x58c23b[_0xc172('0xfc')]);try{fs[_0xc172('0xfd')](_0x58c23b['audiofile']+_0xc172('0xfe'));}catch(_0x4af4b9){logger[_0xc172('0x2b')](_0x4af4b9);}return _0x47cae7;}else{return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xff'),_0x58c23b[_0xc172('0xec')]));}}return this['channel'][_0xc172('0x2b')](_0xa36ef8,_0xc172('0x100'));};AGIVertices[_0xc172('0x10')][_0xc172('0x101')]=function(_0x4fdaa8){logger[_0xc172('0x2d')](util['format'](_0xc172('0x102'),_0x4fdaa8[_0xc172('0x38')]));return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x101'));};AGIVertices[_0xc172('0x10')]['ext_dial']=function(_0x2f4838){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x103'),_0x2f4838[_0xc172('0x38')]));var _0x20fd40='';if(_0x2f4838[_0xc172('0x104')]){if(!this[_0xc172('0x82')](_0x2f4838[_0xc172('0x104')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2f4838,_0xc172('0x105'));}else{var _0xc4772d=parseInt(_0x2f4838['trunk_id'],0xa);if(isNaN(_0xc4772d)){_0x20fd40=_0x2f4838[_0xc172('0x104')];}else{_0x20fd40=this[_0xc172('0x1e')]['sync'](this,_0x2f4838[_0xc172('0x104')]);if(!_0x20fd40){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2f4838,_0xc172('0x106'));}}}}else if(_0x2f4838[_0xc172('0x107')]){_0x20fd40=_0x2f4838[_0xc172('0x107')];}else{return this[_0xc172('0xd')][_0xc172('0x2b')](_0x2f4838,_0xc172('0x105'));}var _0xf2ca03=this[_0xc172('0xd')][_0xc172('0x56')](_0xc172('0xe2'),[util[_0xc172('0x28')](_0xc172('0x108'),_0x20fd40,_0x2f4838[_0xc172('0xbe')]),_0x2f4838['timeout'],_0x2f4838[_0xc172('0xe4')],_0x2f4838[_0xc172('0x65')]]);if(_0xf2ca03[_0xc172('0xa3')]===-0x1){return _0xf2ca03;}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xe5'),_0xc172('0xe2')));};AGIVertices['prototype'][_0xc172('0x109')]=function(_0x534424){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x10a'),_0x534424[_0xc172('0x38')]));return this[_0xc172('0xd')]['noop']('finally');};AGIVertices[_0xc172('0x10')][_0xc172('0xc')]=function(_0x5a4c81){logger['info'](util[_0xc172('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5a4c81[_0xc172('0x38')]));if(_0x5a4c81[_0xc172('0xa6')]===0x0){return this[_0xc172('0xa5')](_0x5a4c81);}_0x5a4c81[_0xc172('0xa6')]-=0x1;if(!this[_0xc172('0x82')](_0x5a4c81[_0xc172('0x10b')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5a4c81,_0xc172('0x10c'));}var _0x284d40=this['getSound'][_0xc172('0x6e')](this,_0x5a4c81[_0xc172('0x10b')]);if(!_0x284d40){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5a4c81,_0xc172('0x10d'));}if(!this[_0xc172('0x82')](_0x5a4c81[_0xc172('0xd7')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0xc172('0xd6'));}var _0x441539=this[_0xc172('0xd')][_0xc172('0x10e')](_0x284d40,_0x5a4c81[_0xc172('0x10f')],_0x5a4c81[_0xc172('0x110')]);var _0x4845ad=_0x441539[_0xc172('0xa3')]?_0x441539['result'][_0xc172('0x4b')]():'';logger['info'](_0xc172('0x111'),JSON[_0xc172('0x72')](_0x441539));if(_0x441539[_0xc172('0xa3')]===-0x1){this['createSquareDetailsReport'][_0xc172('0x6e')](this,_0x5a4c81,_0x4845ad);return _0x441539;}else if(_0x441539[_0xc172('0xa1')]===_0xc172('0x67')){_0x441539[_0xc172('0xa3')]=_0x4845ad[_0xc172('0x9c')]>=parseInt(_0x5a4c81['mindigit'])?'x':'i';}else{_0x441539['result']=_0x4845ad[_0xc172('0x9c')]>=parseInt(_0x5a4c81['mindigit'])&&_0x4845ad[_0xc172('0x9c')]<=parseInt(_0x5a4c81[_0xc172('0x110')])?'x':'i';}var _0x4edaf8=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0x5a4c81[_0xc172('0xd7')]);if(!_0x4edaf8){return this['channel'][_0xc172('0x2b')](_0x5a4c81,_0xc172('0xd8'));}this[_0xc172('0xd')][_0xc172('0x9d')](_0x4edaf8,_0x4845ad);if(this[_0xc172('0x82')](_0x5a4c81[_0xc172('0x112')])){var _0x14c84d=parseInt(_0x5a4c81[_0xc172('0x112')],0xa);var _0x149bb0=rs[_0xc172('0x113')]({'charset':'*','length':_0x14c84d});var _0x3d41b3=_0x4845ad[_0xc172('0x9c')];if(_0x3d41b3>0x0){if(_0x3d41b3>_0x14c84d){this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x5a4c81,_0x5a4c81[_0xc172('0x114')]==='first'?_0x149bb0+_0x4845ad[_0xc172('0x115')](_0x14c84d):_0x4845ad[_0xc172('0x115')](0x0,_0x3d41b3-_0x14c84d)+_0x149bb0);}else{this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x5a4c81,rs['generate']({'charset':'*','length':_0x3d41b3}));}}else{this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x5a4c81,'');}}else{this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x5a4c81,_0x4845ad);}return _0x441539;};AGIVertices[_0xc172('0x10')][_0xc172('0x116')]=function(_0x127dbd){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x117'),_0x127dbd[_0xc172('0x38')]));return this['getdigits'](_0x127dbd);};AGIVertices['prototype']['goal']=function(_0x118c10){logger[_0xc172('0x2d')](util['format'](_0xc172('0x118'),_0x118c10[_0xc172('0x38')]));this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x118c10,_0x118c10[_0xc172('0x119')]);return this[_0xc172('0xd')]['noop'](util['format'](_0xc172('0x11a'),_0x118c10[_0xc172('0x119')]));};AGIVertices[_0xc172('0x10')][_0xc172('0x11b')]=function(_0x1c4d4d){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x11c'),_0x1c4d4d[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x1c4d4d['aws_access_key_id'])||!this[_0xc172('0x82')](_0x1c4d4d[_0xc172('0x8b')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x11d'));}if(!this[_0xc172('0x82')](_0x1c4d4d[_0xc172('0x5c')])){return this[_0xc172('0xd')]['noop'](_0xc172('0xa9'));}this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x11e'),_0x1c4d4d[_0xc172('0x5c')]));var _0x45df0c=this[_0xc172('0x84')][_0xc172('0x6e')](this,_0x1c4d4d);if(_0x45df0c){this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x11f'),_0x45df0c));var _0xf05434=this[_0xc172('0xd')][_0xc172('0x120')](_0x45df0c);try{fs[_0xc172('0xfd')](_0x45df0c+_0xc172('0xfe'));}catch(_0x574131){logger[_0xc172('0x2b')](_0x574131);}return _0xf05434;}return this['channel'][_0xc172('0x2b')](_0x1c4d4d,_0xc172('0x121'));};AGIVertices[_0xc172('0x10')]['awslex']=function(_0x46efa9){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x122'),_0x46efa9[_0xc172('0x38')]));if(!this['isConfigured'](_0x46efa9[_0xc172('0x85')])||!this[_0xc172('0x82')](_0x46efa9[_0xc172('0x8b')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x11d'));}if(!this['isConfigured'](_0x46efa9[_0xc172('0x8c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x123'));}if(!this['isConfigured'](_0x46efa9[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}this['channel']['bot']=!![];this[_0xc172('0x36')](_0x46efa9);this['createSquareMessage'](_0x46efa9[_0xc172('0x5c')],'in','','');this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x46efa9[_0xc172('0x5c')]));var _0x3a6f11=this['awsLex'][_0xc172('0x6e')](this,_0x46efa9);if(_0x3a6f11){for(var _0x82e34b in _0x3a6f11){if(_0x3a6f11[_0xc172('0x94')](_0x82e34b)&&_[_0xc172('0x95')](_0x3a6f11[_0x82e34b])){this['channel'][_0xc172('0x9d')](util[_0xc172('0x28')](_0xc172('0x124'),_0x82e34b[_0xc172('0xe9')]()),_0x3a6f11[_0x82e34b]);}}if(_[_0xc172('0x46')](_0x3a6f11[_0xc172('0x75')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x125'));}else{this[_0xc172('0x43')](_0x3a6f11[_0xc172('0x75')],_0xc172('0xea'),_0xc172('0x126'),'');return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x127'),_0x3a6f11['message']));}}return this[_0xc172('0xd')][_0xc172('0x2b')](_0x46efa9,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xc172('0x10')][_0xc172('0x128')]=function(_0x2caaa2){logger[_0xc172('0x2d')](util['format'](_0xc172('0x129'),_0x2caaa2['label'],_0x2caaa2['timeout']));if(!this[_0xc172('0x82')](_0x2caaa2['key'])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x12a'));}var _0x34945e=_0xc172('0x12b');var _0x64162f=util[_0xc172('0x28')](_0xc172('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x1a78f5=util['format'](_0xc172('0x9b'),_0x64162f,_0x34945e);var _0x2b9725=!![];if(_0x2caaa2[_0xc172('0x12d')]==='NOBEEP'){_0x2b9725=![];}var _0x419094=this[_0xc172('0xd')]['recordFile'](_0x64162f,_0x34945e,_0x2caaa2['intKey'],_0x2caaa2['timeout'],undefined,_0x2b9725);if(_0x419094[_0xc172('0xa3')]!==-0x1){this[_0xc172('0xd')]['noop'](util['format']('google\x20%s\x20file\x20created',_0x1a78f5));var _0x244017=this[_0xc172('0x8d')]['sync'](this,_0x2caaa2,_0x1a78f5);if(_0x244017){for(var _0x309f5f in _0x244017){if(_0x244017[_0xc172('0x94')](_0x309f5f)){this[_0xc172('0xd')][_0xc172('0x9d')](util['format'](_0xc172('0x12e'),_0x309f5f[_0xc172('0xe9')]()),_0x244017[_0x309f5f]);}}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x12f'),JSON[_0xc172('0x72')](_0x244017)));}}return _0x419094;};AGIVertices[_0xc172('0x10')][_0xc172('0x130')]=function(_0x22dd57){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x131'),_0x22dd57['label']));if(!this[_0xc172('0x82')](_0x22dd57[_0xc172('0x90')])){return this['channel'][_0xc172('0xa8')](_0xc172('0x132'));}if(!this[_0xc172('0x82')](_0x22dd57[_0xc172('0x133')])){return this['channel'][_0xc172('0xa8')](_0xc172('0x134'));}var _0x4711df=_0xc172('0x12b');var _0x45916b=util[_0xc172('0x28')](_0xc172('0x12c'),FILES_PATH,rs[_0xc172('0x113')](0x4));var _0x199b30=util['format'](_0xc172('0x9b'),_0x45916b,_0x4711df);var _0x5c66d9=!![];if(_0x22dd57[_0xc172('0x12d')]===_0xc172('0x135')){_0x5c66d9=![];}var _0x52c8e9=this[_0xc172('0xd')]['recordFile'](_0x45916b,_0x4711df,_0x22dd57['intKey'],_0x22dd57[_0xc172('0x67')],undefined,_0x5c66d9);if(_0x52c8e9['result']!==-0x1){this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0x136'),_0x199b30));var _0x48f2dd=this['tildeASR']['sync'](this,_0x22dd57,_0x199b30);if(_0x48f2dd){for(var _0xee36b3 in _0x48f2dd){if(_0x48f2dd[_0xc172('0x94')](_0xee36b3)){this[_0xc172('0xd')][_0xc172('0x9d')](util[_0xc172('0x28')]('TILDE_ASR_%s',_0xee36b3[_0xc172('0xe9')]()),_0x48f2dd[_0xee36b3]);}}return this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0x137'),JSON[_0xc172('0x72')](_0x48f2dd)));}}return _0x52c8e9;};AGIVertices[_0xc172('0x10')][_0xc172('0x138')]=function(_0x1c1fce){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x139'),_0x1c1fce[_0xc172('0x38')]));return this[_0xc172('0xd')][_0xc172('0x13a')](_0x1c1fce['context'],_0x1c1fce[_0xc172('0x3f')],_0x1c1fce[_0xc172('0x40')]);};AGIVertices['prototype']['gotoif']=function(_0x25e5fc){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x13b'),_0x25e5fc[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x25e5fc[_0xc172('0x13c')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x25e5fc,_0xc172('0x13d'));}try{var _0x26974a=eval(_0x25e5fc[_0xc172('0x13c')])?'true':'false';this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('EVAL\x20CONDITION\x20%s\x20%s',_0x25e5fc[_0xc172('0x13c')],_0x26974a));return{'code':0xc8,'result':_0x26974a};}catch(_0xf99dcd){return{'code':0xc8,'result':_0xc172('0x13e')};}};AGIVertices[_0xc172('0x10')][_0xc172('0x13f')]=function(_0x315556){logger[_0xc172('0x2d')](util['format'](_0xc172('0x140'),_0x315556[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x315556[_0xc172('0x141')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x315556,_0xc172('0x142'));}var _0x3992a2=this[_0xc172('0x24')][_0xc172('0x6e')](this,_0x315556['interval_id']);if(!_0x3992a2){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x315556,'no\x20intervals\x20found');}for(var _0x1310be=0x0;_0x1310be<_0x3992a2[_0xc172('0x9c')];_0x1310be+=0x1){var _0x413a3f=this[_0xc172('0xd')][_0xc172('0x11')](util['format'](_0xc172('0x143'),_0x3992a2[_0x1310be]));if(_0x413a3f['result']===-0x1){return _0x413a3f;}logger[_0xc172('0x2d')](util[_0xc172('0x28')]('IFTIME\x20%s\x20%s',_0x3992a2[_0x1310be],_0x413a3f[_0xc172('0xa1')]));if(_0x413a3f[_0xc172('0xa1')]===_0xc172('0x144')){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x145'),_0x3992a2[_0x1310be],'true'));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x145'),_0x3992a2[_0x1310be],_0xc172('0x144')));return{'code':0xc8,'result':_0xc172('0x144')};}else{logger[_0xc172('0x2d')](util['format'](_0xc172('0x145'),_0x3992a2[_0x1310be],'false'));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x145'),_0x3992a2[_0x1310be],_0xc172('0x13e')));}}return{'code':0xc8,'result':_0xc172('0x13e')};};AGIVertices['prototype']['hangup']=function(_0x713635){logger[_0xc172('0x2d')](util['format'](_0xc172('0x146'),_0x713635['label']));return this[_0xc172('0xd')][_0xc172('0x147')]();};AGIVertices[_0xc172('0x10')]['ispeechasr']=function(_0x5cda3d){logger[_0xc172('0x2d')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x5cda3d[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x5cda3d[_0xc172('0x78')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x12a'));}var _0x75d6a9=_0xc172('0x12b');var _0x1ecf67=util[_0xc172('0x28')](_0xc172('0x12c'),FILES_PATH,rs[_0xc172('0x113')](0x4));var _0x1282e1=util[_0xc172('0x28')](_0xc172('0x9b'),_0x1ecf67,_0x75d6a9);var _0x228009=!![];if(_0x5cda3d[_0xc172('0x12d')]===_0xc172('0x135')){_0x228009=![];}var _0x2e61bb=this[_0xc172('0xd')][_0xc172('0x148')](_0x1ecf67,_0x75d6a9,_0x5cda3d[_0xc172('0x149')],_0x5cda3d[_0xc172('0x67')],undefined,_0x228009);if(_0x2e61bb[_0xc172('0xa3')]!==-0x1){this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('ispeech\x20%s\x20file\x20created',_0x1282e1));var _0x58347e=this['ispeechASR'][_0xc172('0x6e')](this,_0x5cda3d,_0x1282e1);if(_0x58347e){for(var _0x40dff8 in _0x58347e){if(_0x58347e[_0xc172('0x94')](_0x40dff8)){this[_0xc172('0xd')]['setVariable'](util['format'](_0xc172('0x14a'),_0x40dff8[_0xc172('0xe9')]()),_0x58347e[_0x40dff8]);}}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x58347e)));}}return _0x2e61bb;};AGIVertices['prototype']['ispeechtts']=function(_0x1a395c){logger[_0xc172('0x2d')](util[_0xc172('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x1a395c[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x1a395c[_0xc172('0x78')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x12a'));}if(!this[_0xc172('0x82')](_0x1a395c['text'])){return this['channel']['noop'](_0xc172('0xa9'));}this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Trying\x20ispeech\x20TTS\x20%s',_0x1a395c[_0xc172('0x5c')]));var _0x583869=this[_0xc172('0x7f')][_0xc172('0x6e')](this,_0x1a395c);if(_0x583869){this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x14b'),_0x583869));var _0x3e3295=this[_0xc172('0xd')][_0xc172('0x120')](_0x583869,_0x1a395c[_0xc172('0x149')]);try{fs[_0xc172('0xfd')](_0x583869+_0xc172('0xfe'));}catch(_0x55aceb){logger[_0xc172('0x2b')](_0x55aceb);}return _0x3e3295;}return this['channel']['error'](_0x1a395c,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xc172('0x10')][_0xc172('0x14c')]=function(_0x23b43c){logger['info'](util[_0xc172('0x28')](_0xc172('0x14d'),_0x23b43c[_0xc172('0x38')]));if(!this['isConfigured'](_0x23b43c['findBy'])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x23b43c,_0xc172('0x14e'));}logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x14f'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x23b43c[_0xc172('0x150')]));var _0x1f6107=this['agentLogin']['sync'](this,_0x23b43c[_0xc172('0x150')]);if(_0x1f6107){logger['info'](util[_0xc172('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc172('0xd')][_0xc172('0x3b')],_0x23b43c[_0xc172('0x150')]));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x151'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x23b43c['findBy']));return{'code':0xc8,'result':_0xc172('0x152')};}else{logger[_0xc172('0x2d')](util['format'](_0xc172('0x153'),this[_0xc172('0xd')]['callerid'],_0x23b43c[_0xc172('0x150')]));this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0x153'),this[_0xc172('0xd')]['callerid'],_0x23b43c[_0xc172('0x150')]));return{'code':0xc8,'result':_0xc172('0x154')};}};AGIVertices['prototype'][_0xc172('0x155')]=function(_0x65dc4d){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x156'),_0x65dc4d[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x65dc4d[_0xc172('0x150')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x65dc4d,_0xc172('0x14e'));}logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x14f'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x65dc4d[_0xc172('0x150')]));var _0x5d5481=this[_0xc172('0x51')][_0xc172('0x6e')](this,_0x65dc4d[_0xc172('0x150')]);if(_0x5d5481){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xc172('0x3b')],_0x65dc4d['findBy']));this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc172('0xd')][_0xc172('0x3b')],_0x65dc4d['findBy']));return{'code':0xc8,'result':_0xc172('0x152')};}else{logger['info'](util[_0xc172('0x28')](_0xc172('0x153'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x65dc4d[_0xc172('0x150')]));this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc172('0xd')][_0xc172('0x3b')],_0x65dc4d[_0xc172('0x150')]));return{'code':0xc8,'result':_0xc172('0x154')};}};AGIVertices[_0xc172('0x10')][_0xc172('0x157')]=function(_0x5323e9){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x158'),_0x5323e9[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x5323e9[_0xc172('0x159')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5323e9,_0xc172('0x15a'));}this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')]('math\x20%s',_0x5323e9['operation']));var _0x29cd72=eval(_0x5323e9[_0xc172('0x159')]);if(!this[_0xc172('0x82')](_0x5323e9['variable_id'])){return this[_0xc172('0xd')][_0xc172('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2b3f5e=this[_0xc172('0x11')]['sync'](this,_0x5323e9['variable_id']);if(!_0x2b3f5e){return this['channel'][_0xc172('0x2b')](_0x5323e9,_0xc172('0xd8'));}if(_[_0xc172('0x98')](_0x29cd72)){var _0x1d749e=this;_0x29cd72[_0xc172('0xd9')](function(_0x577ec0,_0x58a585){_0x1d749e[_0xc172('0xd')]['setVariable'](util['format'](_0xc172('0x15b'),_0x2b3f5e,_0x58a585),_0x577ec0);});return this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('variable\x20%s[key]\x20set',_0x2b3f5e));}else{return this[_0xc172('0xd')][_0xc172('0x9d')](_0x2b3f5e,_0x29cd72);}};AGIVertices[_0xc172('0x10')][_0xc172('0xb')]=function(_0xdba360){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x15c'),_0xdba360[_0xc172('0x38')]));if(_0xdba360[_0xc172('0xa6')]===0x0){return this[_0xc172('0xa5')](_0xdba360);}_0xdba360[_0xc172('0xa6')]-=0x1;if(!this['isConfigured'](_0xdba360[_0xc172('0x10b')])){return this[_0xc172('0xd')]['error'](_0xdba360,_0xc172('0x10c'));}var _0x18b847=this[_0xc172('0x15d')][_0xc172('0x6e')](this,_0xdba360[_0xc172('0x10b')]);if(!_0x18b847){return this[_0xc172('0xd')][_0xc172('0x2b')](_0xdba360,_0xc172('0x10d'));}var _0x4bc326=this[_0xc172('0xd')][_0xc172('0x10e')](_0x18b847,_0xdba360[_0xc172('0x10f')],_0xdba360['digit']);var _0x413a25=_0x4bc326[_0xc172('0xa3')];if(_0x4bc326[_0xc172('0xa3')]===-0x1){this[_0xc172('0x36')][_0xc172('0x6e')](this,_0xdba360,'-1');return _0x4bc326;}else if(_0x4bc326[_0xc172('0xa1')]==='timeout'){_0x4bc326[_0xc172('0xa3')]=_0x4bc326[_0xc172('0xa3')]['length']>0x0?_0x4bc326['result']:'t';}else if(_['isEmpty'](_0x4bc326[_0xc172('0xa3')])){_0x4bc326[_0xc172('0xa3')]='#';_0x413a25='#';}if(!this[_0xc172('0x82')](_0xdba360[_0xc172('0xd7')])){this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xd6'));}else{var _0x3df972=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0xdba360['variable_id']);if(!_0x3df972){return this[_0xc172('0xd')][_0xc172('0x2b')](_0xdba360,'no\x20variable\x20found');}this[_0xc172('0xd')][_0xc172('0x9d')](_0x3df972,_0x413a25);}this[_0xc172('0x36')][_0xc172('0x6e')](this,_0xdba360,_0x413a25);return _0x4bc326;};AGIVertices[_0xc172('0x10')][_0xc172('0xa8')]=function(_0x2f3f14){logger[_0xc172('0x2d')](util['format'](_0xc172('0x15e'),_0x2f3f14[_0xc172('0x38')]));return this[_0xc172('0xd')][_0xc172('0xa8')](_0x2f3f14[_0xc172('0x15f')]||_0x2f3f14[_0xc172('0x38')]);};AGIVertices[_0xc172('0x10')][_0xc172('0x160')]=function(_0x6a5e1c){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x161'),_0x6a5e1c[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x6a5e1c[_0xc172('0x150')])){return this[_0xc172('0xd')]['error'](_0x6a5e1c,_0xc172('0x14e'));}logger['info'](util[_0xc172('0x28')](_0xc172('0x14f'),this['channel']['callerid'],_0x6a5e1c['findBy']));var _0x2dd334=this[_0xc172('0x4d')][_0xc172('0x6e')](this,_0x6a5e1c[_0xc172('0x162')]);var _0x593314=this['agentPause'][_0xc172('0x6e')](this,_0x6a5e1c[_0xc172('0x150')],_0x2dd334);if(_0x593314){logger['info'](util['format'](_0xc172('0x151'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x6a5e1c['findBy']));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x151'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x6a5e1c[_0xc172('0x150')]));return{'code':0xc8,'result':_0xc172('0x152')};}else{logger['info'](util['format'](_0xc172('0x153'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x6a5e1c['findBy']));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x151'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x6a5e1c[_0xc172('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc172('0x10')][_0xc172('0x163')]=function(_0x9429b2){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x164'),_0x9429b2[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x9429b2[_0xc172('0x10b')])){return this[_0xc172('0xd')]['error'](_0x9429b2,_0xc172('0x10c'));}var _0x19b033=this[_0xc172('0x15d')][_0xc172('0x6e')](this,_0x9429b2[_0xc172('0x10b')]);if(!_0x19b033){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x9429b2,_0xc172('0x10d'));}var _0x17f543=this[_0xc172('0xd')][_0xc172('0x56')]('PLAYBACK',[_0x19b033,_0x9429b2[_0xc172('0xe4')]]);if(_0x17f543[_0xc172('0xa3')]===-0x1){return _0x17f543;}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Executed\x20command\x20%s\x20%s',_0xc172('0x165'),_0x19b033));};AGIVertices[_0xc172('0x10')][_0xc172('0x166')]=function(_0x466b05){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x167'),_0x466b05['label']));if(!this[_0xc172('0x82')](_0x466b05[_0xc172('0x168')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x466b05,'no\x20queue\x20selected');}var _0x3468cd='';var _0x39db9a=parseInt(_0x466b05[_0xc172('0x168')],0xa);if(isNaN(_0x39db9a)){_0x3468cd=_0x466b05['queue_id'];}else{_0x3468cd=this['getVoiceQueue'][_0xc172('0x6e')](this,_0x466b05['queue_id']);if(!_0x3468cd){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x466b05,_0xc172('0x169'));}}var _0xec778c='';if(this[_0xc172('0x82')](_0x466b05[_0xc172('0x10b')])){var _0x28d645=this['getSound'][_0xc172('0x6e')](this,_0x466b05[_0xc172('0x10b')]);if(_0x28d645){_0xec778c=_0x28d645;}}this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x466b05,_0x3468cd);if(_0x466b05[_0xc172('0xe4')][_0xc172('0x16a')]('x')<0x0){_0x466b05[_0xc172('0xe4')]+='x';}if(_0x466b05['opts'][_0xc172('0x16a')]('X')<0x0){_0x466b05[_0xc172('0xe4')]+='X';}this[_0xc172('0xd')]['setVariable'](_0xc172('0x16b'),_0x3468cd?_0x3468cd[_0xc172('0x16c')]():'');var _0x50a843=this[_0xc172('0xd')]['exec'](_0xc172('0x16d'),[_0x3468cd,_0x466b05[_0xc172('0xe4')],_0x466b05[_0xc172('0x65')],_0xec778c,_0x466b05['timeout'],_0x466b05[_0xc172('0x7')],_0x466b05[_0xc172('0x16e')],_0x466b05[_0xc172('0x16f')],'',_0x466b05[_0xc172('0x170')]]);if(_0x50a843[_0xc172('0xa3')]===-0x1){return _0x50a843;}return this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')]('Executed\x20command\x20%s\x20%s',_0xc172('0x16d'),_0x3468cd));};AGIVertices[_0xc172('0x10')]['record']=function(_0x4e4d11){logger[_0xc172('0x2d')](util['format'](_0xc172('0x171'),_0x4e4d11['label']));var _0x2ffd6b=_0x4e4d11[_0xc172('0x172')]||'wav';var _0x4e018b=util[_0xc172('0x28')](_0xc172('0x173'),this['channel'][_0xc172('0x37')],rs[_0xc172('0x113')](0x5));var _0x245343=util[_0xc172('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x4e018b,_0x2ffd6b);var _0x371c3a=util['format']('%s/recordings/%s',FILES_PATH,_0x4e018b);this[_0xc172('0x3c')]['sync'](this,_0x4e4d11,_0x4e018b,_0x245343);this['channel'][_0xc172('0x9d')](_0xc172('0x174'),_0x4e018b);logger['info'](_0xc172('0x175'),_0x371c3a,_0x2ffd6b,_0x4e4d11[_0xc172('0x176')],_0x4e4d11[_0xc172('0x67')]);return this['channel'][_0xc172('0x148')](_0x371c3a,_0x2ffd6b,_0x4e4d11['escape_digits'],_0x4e4d11['timeout'],undefined,!![]);};AGIVertices[_0xc172('0x10')]['restapi']=function(_0x4c795b){logger['info'](util[_0xc172('0x28')](_0xc172('0x177'),_0x4c795b['label']));if(!this[_0xc172('0x82')](_0x4c795b[_0xc172('0x65')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x178'));}var _0x5e8999=this[_0xc172('0x64')][_0xc172('0x6e')](this,_0x4c795b);logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x179'),util['inspect'](_0x5e8999,{'showHidden':![],'depth':null})));if(!this[_0xc172('0x82')](_0x4c795b[_0xc172('0xd7')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x17a'));}var _0x1a7c14=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0x4c795b['variable_id']);if(!_0x1a7c14){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x4c795b,'no\x20variable\x20found');}this[_0xc172('0xd')][_0xc172('0x9d')](util[_0xc172('0x28')](_0xc172('0x17b'),_0x1a7c14),_0x5e8999[_0xc172('0x73')]?_0x5e8999[_0xc172('0x73')]:_0xc172('0x17c'));this['channel'][_0xc172('0x9d')](util[_0xc172('0x28')](_0xc172('0x17d'),_0x1a7c14),_0x5e8999[_0xc172('0x74')]?_0x5e8999[_0xc172('0x74')]:'OK');if(_0x5e8999[_0xc172('0x6a')]){try{this[_0xc172('0x9a')](_0x5e8999[_0xc172('0x6a')],_0x1a7c14);}catch(_0xbf9b90){logger[_0xc172('0x2b')](util[_0xc172('0x28')](_0xc172('0x17e'),_0x1a7c14));}}return this['channel'][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0xdc'),_0x1a7c14));};AGIVertices[_0xc172('0x10')][_0xc172('0x17f')]=function(_0x348736){logger[_0xc172('0x2d')](util[_0xc172('0x28')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x348736['label']));return this['channel'][_0xc172('0x180')](_0x348736[_0xc172('0x181')]['replace'](/\s+/g,''),_0x348736[_0xc172('0x176')]);};AGIVertices[_0xc172('0x10')][_0xc172('0x182')]=function(_0x47aae5){logger['info'](util[_0xc172('0x28')](_0xc172('0x183'),_0x47aae5[_0xc172('0x38')]));return this['channel']['sayNumber'](_0x47aae5[_0xc172('0x184')][_0xc172('0x58')](/\s+/g,''),_0x47aae5[_0xc172('0x176')]);};AGIVertices['prototype'][_0xc172('0x185')]=function(_0x25b0d6){logger[_0xc172('0x2d')](util['format'](_0xc172('0x186'),_0x25b0d6['label']));return this[_0xc172('0xd')][_0xc172('0x187')](_0x25b0d6[_0xc172('0x5c')],_0x25b0d6[_0xc172('0x176')]);};AGIVertices[_0xc172('0x10')][_0xc172('0x188')]=function(_0x57dc6b){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x189'),_0x57dc6b[_0xc172('0x38')]));if(!this[_0xc172('0x82')](_0x57dc6b[_0xc172('0x18a')])){return this[_0xc172('0xd')][_0xc172('0xa8')]('no\x20mail\x20account\x20configured');}var _0x1c711b=this[_0xc172('0x18b')][_0xc172('0x6e')](this,_0x57dc6b[_0xc172('0x18a')]);if(!_0x1c711b||!_0x1c711b[_0xc172('0x18c')]){return this['channel']['error'](_0x57dc6b,_0xc172('0x18d'));}var _0x5750e0={'from':util['format'](_0xc172('0x18e'),_0x1c711b[_0xc172('0x14')],_0x1c711b[_0xc172('0x18f')]||_0x1c711b[_0xc172('0x18c')]['user']),'to':_0x57dc6b['to']||'','cc':_0x57dc6b['cc']||'','bcc':_0x57dc6b[_0xc172('0x190')]||'','subject':_0x57dc6b[_0xc172('0x191')],'html':_0x57dc6b['text'],'text':_0x57dc6b['text']};var _0x48ab8e={'tls':{'rejectUnauthorized':![]}};if(_0x1c711b[_0xc172('0x18c')][_0xc172('0x192')]){_0x48ab8e[_0xc172('0x192')]=_0x1c711b[_0xc172('0x18c')][_0xc172('0x192')];}else{_0x48ab8e[_0xc172('0x193')]=_0x1c711b[_0xc172('0x18c')][_0xc172('0x193')];_0x48ab8e[_0xc172('0x194')]=_0x1c711b[_0xc172('0x18c')][_0xc172('0x194')];_0x48ab8e[_0xc172('0x195')]=_0x1c711b[_0xc172('0x18c')][_0xc172('0x195')];}if(_0x1c711b[_0xc172('0x18c')][_0xc172('0x196')]){_0x48ab8e[_0xc172('0x197')]={'user':_0x1c711b['Smtp']['user'],'pass':_0x1c711b[_0xc172('0x18c')]['pass']};}if(this[_0xc172('0x82')](_0x57dc6b[_0xc172('0x198')])){}logger[_0xc172('0xde')]('sendMail\x20message',JSON[_0xc172('0x72')](_0x5750e0));this['createSquareDetailsReport']['sync'](this,_0x57dc6b,_0x57dc6b['account_id']);this['channel']['noop'](util[_0xc172('0x28')](_0xc172('0x199'),_0x1c711b[_0xc172('0x14')]));this[_0xc172('0x23')][_0xc172('0x6e')](this,_0x48ab8e,_0x5750e0);return this[_0xc172('0xd')]['noop'](_0xc172('0x19a'));};AGIVertices['prototype'][_0xc172('0x19b')]=function(_0x58ee99){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x19c'),_0x58ee99[_0xc172('0x38')]));return this['channel'][_0xc172('0xa8')](_0xc172('0x19d'));};AGIVertices['prototype'][_0xc172('0x19e')]=function(_0x2a4820){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x19f'),_0x2a4820[_0xc172('0x38')]));if(!this['isConfigured'](_0x2a4820[_0xc172('0x1a0')])){return this['channel']['noop'](_0xc172('0x1a1'));}var _0x371515=this['getSmsAccount']['sync'](this,_0x2a4820[_0xc172('0x1a0')]);if(!_0x371515){return this['channel'][_0xc172('0x2b')](_0x2a4820,_0xc172('0x1a2'));}var _0x571bee={'body':_0x2a4820['sms_text'],'phone':_0x2a4820['to']||'','SmsAccountId':_0x371515['id']};logger[_0xc172('0xde')]('sendSMS\x20message',JSON[_0xc172('0x72')](_0x571bee));this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x2a4820,_0x2a4820[_0xc172('0x1a0')]);this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x1a3'),_0x371515[_0xc172('0x14')]));this[_0xc172('0x35')][_0xc172('0x6e')](this,_0x571bee);return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x1a4'));};AGIVertices[_0xc172('0x10')][_0xc172('0x1a5')]=function(_0x24f044){logger[_0xc172('0x2d')](util['format'](_0xc172('0x1a6'),_0x24f044[_0xc172('0x38')]));if(!this['isConfigured'](_0x24f044['variable_id'])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x24f044,_0xc172('0x1a7'));}var _0x3d4756=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0x24f044[_0xc172('0xd7')]);if(!_0x3d4756){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x24f044,_0xc172('0xd8'));}return this[_0xc172('0xd')][_0xc172('0x9d')](_0x3d4756,_0x24f044[_0xc172('0x1a8')]);};AGIVertices[_0xc172('0x10')][_0xc172('0x1a9')]=function(_0x30ebc9){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x1aa'),_0x30ebc9[_0xc172('0x38')]));this[_0xc172('0xd')]['noop'](_0xc172('0x1ab'));if(_0x30ebc9[_0xc172('0xb6')]==='yes'){this['channel']['noop'](_0xc172('0x1ac'));return this[_0xc172('0xd')][_0xc172('0xb6')]();}return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0x1ad'));};AGIVertices['prototype']['subproject']=function(_0x3a867a){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x1ae'),_0x3a867a[_0xc172('0x38')]));if(!this['isConfigured'](_0x3a867a[_0xc172('0x1af')])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x3a867a,_0xc172('0x1b0'));}var _0x4c7b73=this['getSquareProject'][_0xc172('0x6e')](this,_0x3a867a[_0xc172('0x1af')]);if(!this[_0xc172('0x82')](_0x4c7b73)){return this['channel'][_0xc172('0x2b')](_0x3a867a,util[_0xc172('0x28')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3a867a['project_id']));}if(_0x4c7b73===this[_0xc172('0xd')]['arg_1']){return this[_0xc172('0xd')]['error'](_0x3a867a,_0xc172('0x1b1'));}this[_0xc172('0x36')][_0xc172('0x6e')](this,_0x3a867a,_0x4c7b73);var _0x4c8321=this[_0xc172('0xd')][_0xc172('0x56')]('AGI',util[_0xc172('0x28')](_0xc172('0x1b2'),config[_0xc172('0x7')][_0xc172('0x193')]||'127.0.0.1',_0x4c7b73,this[_0xc172('0xd')]['arg_1']));if(_0x4c8321['result']===-0x1){return _0x4c8321;}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Executed\x20command\x20%s\x20%s','AGI',_0x4c7b73));};AGIVertices[_0xc172('0x10')][_0xc172('0x1b3')]=function(_0x252442){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x1b4'),_0x252442[_0xc172('0x38')]));var _0x2cc42a=this['shellCommand'][_0xc172('0x6e')](this,_0x252442['command']);this['createSquareDetailsReport'][_0xc172('0x6e')](this,_0x252442,_0x252442['command']);if(this[_0xc172('0x82')](_0x252442[_0xc172('0xd7')])){var _0x19a09a=this['getVariable'][_0xc172('0x6e')](this,_0x252442[_0xc172('0xd7')]);if(_0x19a09a){this[_0xc172('0xd')]['setVariable'](_0x19a09a,_0x2cc42a);return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x252442[_0xc172('0x1b5')],_0x19a09a));}}return this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x1b6'),_0x252442[_0xc172('0x1b5')]));};AGIVertices[_0xc172('0x10')]['google_cloud_tts']=function(_0x5251d9){logger[_0xc172('0x2d')](util['format'](_0xc172('0x1b7'),_0x5251d9[_0xc172('0x38')]));_0x5251d9[_0xc172('0x5c')]=_0x5251d9['text'][_0xc172('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc172('0x82')](_0x5251d9[_0xc172('0x5a')])){return this['channel']['noop'](_0xc172('0x1b8'));}if(!this[_0xc172('0x82')](_0x5251d9[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}this[_0xc172('0xd')]['noop'](util[_0xc172('0x28')](_0xc172('0x1b9'),_0x5251d9[_0xc172('0x5c')]));var _0x4f88da=this[_0xc172('0x59')][_0xc172('0x6e')](this,_0x5251d9);if(_0x4f88da){this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x1ba'),_0x4f88da));var _0x541525=this[_0xc172('0xd')][_0xc172('0x120')](_0x4f88da);try{fs[_0xc172('0xfd')](_0x4f88da+_0xc172('0xfe'));}catch(_0x3d5a2f){logger[_0xc172('0x2b')](_0x3d5a2f);}return _0x541525;}return this[_0xc172('0xd')][_0xc172('0x2b')](_0x5251d9,_0xc172('0x1bb'));};AGIVertices[_0xc172('0x10')][_0xc172('0x1bc')]=function(_0x17955a){logger[_0xc172('0x2d')](util['format'](_0xc172('0x1bd'),_0x17955a[_0xc172('0x38')]));_0x17955a['text']=_0x17955a[_0xc172('0x5c')][_0xc172('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc172('0x82')](_0x17955a[_0xc172('0x5c')])){return this[_0xc172('0xd')][_0xc172('0xa8')](_0xc172('0xa9'));}this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')]('Trying\x20Google\x20TTS\x20%s',_0x17955a[_0xc172('0x5c')]));var _0x52ac98=this['googleTTS'][_0xc172('0x6e')](this,_0x17955a);if(_0x52ac98){this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x1be'),_0x52ac98));var _0x2edb9e=this[_0xc172('0xd')][_0xc172('0x120')](_0x52ac98);try{fs[_0xc172('0xfd')](_0x52ac98+'.wav');}catch(_0x11168d){logger[_0xc172('0x2b')](_0x11168d);}return _0x2edb9e;}return this[_0xc172('0xd')][_0xc172('0x2b')](_0x17955a,_0xc172('0x1bf'));};AGIVertices[_0xc172('0x10')][_0xc172('0x1c0')]=function(_0x1b5a62){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x1c1'),_0x1b5a62['label']));if(!this[_0xc172('0x82')](_0x1b5a62['findBy'])){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x1b5a62,_0xc172('0x14e'));}logger['info'](util[_0xc172('0x28')](_0xc172('0x14f'),this['channel'][_0xc172('0x3b')],_0x1b5a62[_0xc172('0x150')]));var _0x2a7cc6=this[_0xc172('0x50')][_0xc172('0x6e')](this,_0x1b5a62[_0xc172('0x150')]);if(_0x2a7cc6){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x151'),this['channel']['callerid'],_0x1b5a62[_0xc172('0x150')]));this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0x151'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x1b5a62['findBy']));return{'code':0xc8,'result':_0xc172('0x152')};}else{logger[_0xc172('0x2d')](util['format'](_0xc172('0x153'),this[_0xc172('0xd')][_0xc172('0x3b')],_0x1b5a62['findBy']));this[_0xc172('0xd')][_0xc172('0xa8')](util[_0xc172('0x28')](_0xc172('0x153'),this['channel'][_0xc172('0x3b')],_0x1b5a62['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc172('0x10')][_0xc172('0x1c2')]=function(_0x3e1b08){logger[_0xc172('0x2d')](util[_0xc172('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3e1b08[_0xc172('0x38')]));var _0x550e83=this[_0xc172('0xd')][_0xc172('0x56')](_0xc172('0x1c3'),[_0x3e1b08['mailbox'],_0x3e1b08[_0xc172('0x76')]]);if(_0x550e83['result']===-0x1){return _0x550e83;}return this[_0xc172('0xd')][_0xc172('0xa8')](util['format'](_0xc172('0x1c4'),_0xc172('0x1c3'),_0x3e1b08[_0xc172('0x1c5')]));};AGIVertices['prototype'][_0xc172('0x1c6')]=function(_0x1f9438){logger[_0xc172('0x2d')](util[_0xc172('0x28')](_0xc172('0x1c7'),_0x1f9438['label']));if(!this['isConfigured'](_0x1f9438['variable_id'])){return this['channel']['error'](_0x1f9438,_0xc172('0x1a7'));}var _0x3833ef=this[_0xc172('0x11')][_0xc172('0x6e')](this,_0x1f9438[_0xc172('0xd7')]);if(!_0x3833ef){return this[_0xc172('0xd')][_0xc172('0x2b')](_0x1f9438,_0xc172('0xd8'));}var _0x570e8c=this[_0xc172('0xd')]['getVariable'](_0x3833ef);return{'code':0xc8,'result':_0x570e8c[_0xc172('0xa1')]?_0x570e8c[_0xc172('0xa1')]:'-'};};String[_0xc172('0x10')][_0xc172('0xa0')]=function(_0x57cc42,_0x5e9dee){return this[_0xc172('0x9f')](_0x57cc42)['join'](_0x5e9dee);};module[_0xc172('0x1c8')]=AGIVertices; \ No newline at end of file +var _0xa988=['getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','includes','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','agicommand','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','RECOG_CONFIDENCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','out','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','streamFile','unlink','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','SIP/%s/%s','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','.wav','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','beep','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','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','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','user','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','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','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','save_name','mailRpc','sendMailMessage','getIntervalById','interval','Intervals'];(function(_0x2c27e,_0x2e4740){var _0x2e46cf=function(_0x55308f){while(--_0x55308f){_0x2c27e['push'](_0x2c27e['shift']());}};_0x2e46cf(++_0x2e4740);}(_0xa988,0x1a7));var _0x8a98=function(_0x1711e0,_0x645432){_0x1711e0=_0x1711e0-0x0;var _0x186f71=_0xa988[_0x1711e0];return _0x186f71;};'use strict';var fs=require('fs');var path=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var _=require(_0x8a98('0x2'));var sh=require(_0x8a98('0x3'));var odbc=require(_0x8a98('0x4'))();var rs=require('randomstring');var moment=require(_0x8a98('0x5'));var Mustache=require(_0x8a98('0x6'));var rp=require(_0x8a98('0x7'));var logger=require(_0x8a98('0x8'))(_0x8a98('0x9'));var config=require(_0x8a98('0xa'));var scripts=require(_0x8a98('0xb'));var FILES_PATH=_0x8a98('0xc');var recursiveMapAttributes=['rawHeaders',_0x8a98('0xd')];var verticesWithRetry=[_0x8a98('0xe'),'getdigits',_0x8a98('0xf')];var AGIVertices=function(_0x188aea,_0x4e1bb9,_0x5552b2){this[_0x8a98('0x10')]=_0x188aea;this[_0x8a98('0x11')]=_0x4e1bb9;this['mailRpc']=_0x5552b2;};AGIVertices[_0x8a98('0x12')][_0x8a98('0x13')]=function(_0x1f88b0,_0x591b27){this[_0x8a98('0x11')][_0x8a98('0x14')](_0x1f88b0)[_0x8a98('0x15')](function(_0x50fd87){_0x591b27(null,_0x50fd87?_0x50fd87[_0x8a98('0x16')]:![]);})['catch'](function(_0x55dcde){_0x591b27(_0x55dcde);});};AGIVertices['prototype'][_0x8a98('0x17')]=function(_0x4a317f,_0x519e18){this['rpc'][_0x8a98('0x18')](_0x4a317f)['then'](function(_0x28f117){_0x519e18(null,_0x28f117?_0x28f117[_0x8a98('0x16')]:![]);})[_0x8a98('0x19')](function(_0x2d3997){_0x519e18(_0x2d3997);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1a')]=function(_0x384bec,_0x92a1e8){this['rpc']['getSquareProjectById'](_0x384bec)[_0x8a98('0x15')](function(_0x467317){_0x92a1e8(null,_0x467317?_0x467317['name']:![]);})[_0x8a98('0x19')](function(_0x4c91d6){_0x92a1e8(_0x4c91d6);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1b')]=function(_0xc9658d,_0xf35f5){this[_0x8a98('0x11')]['getSquareOdbcById'](_0xc9658d)['then'](function(_0x239094){_0xf35f5(null,_0x239094?_0x239094[_0x8a98('0x1c')]:![]);})[_0x8a98('0x19')](function(_0x291d03){_0xf35f5(_0x291d03);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1d')]=function(_0x3b9b88,_0xde5a55){this[_0x8a98('0x11')][_0x8a98('0x1e')](_0x3b9b88)['then'](function(_0x2c08ae){_0xde5a55(null,_0x2c08ae?_0x2c08ae[_0x8a98('0x16')]:![]);})[_0x8a98('0x19')](function(_0x2576e9){_0xde5a55(_0x2576e9);});};AGIVertices[_0x8a98('0x12')]['getTrunk']=function(_0x1deb61,_0x58f590){this['rpc'][_0x8a98('0x1f')](_0x1deb61)[_0x8a98('0x15')](function(_0x21c720){_0x58f590(null,_0x21c720?_0x21c720[_0x8a98('0x16')]:![]);})[_0x8a98('0x19')](function(_0xfb5806){_0x58f590(_0xfb5806);});};AGIVertices['prototype'][_0x8a98('0x20')]=function(_0x1bcb8c,_0x190578){var _0x5ddb9a=this;this[_0x8a98('0x11')][_0x8a98('0x21')](_0x1bcb8c)[_0x8a98('0x15')](function(_0x2f4aba){_0x190578(null,_0x2f4aba?_0x5ddb9a['getSoundPath'](_0x2f4aba[_0x8a98('0x22')]):![]);})['catch'](function(_0x214172){_0x190578(_0x214172);});};AGIVertices[_0x8a98('0x12')]['getMailAccount']=function(_0xc3e740,_0x292fee){this[_0x8a98('0x11')]['getMailAccountById'](_0xc3e740)[_0x8a98('0x15')](function(_0x15afbd){_0x292fee(null,_0x15afbd?_0x15afbd:![]);})[_0x8a98('0x19')](function(_0x1a9622){_0x292fee(_0x1a9622);});};AGIVertices[_0x8a98('0x12')]['sendMailMessage']=function(_0x56b35d,_0x24ea39,_0x346c61){this[_0x8a98('0x23')][_0x8a98('0x24')](_0x56b35d,_0x24ea39)[_0x8a98('0x15')](function(){_0x346c61(null);})[_0x8a98('0x19')](function(_0x6720e0){_0x346c61(_0x6720e0);});};AGIVertices['prototype']['getIntervals']=function(_0x3bc48d,_0x1f93e3){this[_0x8a98('0x11')][_0x8a98('0x25')](_0x3bc48d)[_0x8a98('0x15')](function(_0x10efd3){if(_0x10efd3){if(_0x10efd3['IntervalId']){_0x1f93e3(null,[_0x10efd3[_0x8a98('0x26')]]);}else{_0x1f93e3(null,_['map'](_0x10efd3[_0x8a98('0x27')],'interval'));}}else{_0x1f93e3(null,![]);}})[_0x8a98('0x19')](function(_0x1d88ea){_0x1f93e3(_0x1d88ea);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x28')]=function(_0x2799a4){return util[_0x8a98('0x29')](_0x8a98('0x2a'),FILES_PATH,_0x2799a4);};AGIVertices['prototype'][_0x8a98('0x2b')]=function(_0x166f42,_0x4f3d4c,_0x39d1a9){odbc[_0x8a98('0x2c')](_0x166f42,function(_0x6cf1ae){if(_0x6cf1ae){logger[_0x8a98('0x2d')](_0x8a98('0x2e'),_0x6cf1ae);_0x39d1a9(_0x6cf1ae);}else{logger['info'](_0x8a98('0x2f'));odbc[_0x8a98('0x30')](_0x4f3d4c,function(_0x278241,_0x1a8ee2){if(_0x278241){logger[_0x8a98('0x31')](_0x8a98('0x32'),_0x4f3d4c);_0x39d1a9(_0x278241);}else{logger['info'](_0x8a98('0x33'),_0x4f3d4c);odbc[_0x8a98('0x34')](function(_0x26afd2){if(_0x26afd2){logger[_0x8a98('0x2d')](_0x8a98('0x35'),_0x26afd2);}_0x39d1a9(null,_0x1a8ee2);});}});}});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x36')]=function(_0x29385f,_0x4e9e82){this[_0x8a98('0x11')]['getSmsAccountById'](_0x29385f)[_0x8a98('0x15')](function(_0x47617b){_0x4e9e82(null,_0x47617b?_0x47617b:![]);})[_0x8a98('0x19')](function(_0x2f450c){_0x4e9e82(_0x2f450c);});};AGIVertices['prototype'][_0x8a98('0x37')]=function(_0x197edc,_0x10b0cc){this[_0x8a98('0x11')][_0x8a98('0x37')](_0x197edc)[_0x8a98('0x15')](function(_0x4c399e){_0x10b0cc(null,_0x4c399e);})[_0x8a98('0x19')](function(_0x100816){_0x10b0cc(_0x100816);});};AGIVertices['prototype'][_0x8a98('0x38')]=function(_0x173105,_0x9d34d7,_0x4d18c9){this['rpc'][_0x8a98('0x38')]({'uniqueid':this[_0x8a98('0x10')]['uniqueid'],'node':_0x173105[_0x8a98('0x39')],'application':_0x173105['agicommand'],'data':_0x9d34d7||null,'project_name':this[_0x8a98('0x10')][_0x8a98('0x3a')],'callerid':this[_0x8a98('0x10')][_0x8a98('0x3b')]})[_0x8a98('0x15')](function(_0xe9fabb){if(_0x4d18c9){_0x4d18c9(null,_0xe9fabb);}})[_0x8a98('0x19')](function(_0x806c7c){if(_0x4d18c9){_0x4d18c9(_0x806c7c);}});};AGIVertices[_0x8a98('0x12')]['createSquareRecording']=function(_0x3125c8,_0x198f40,_0x156d5f,_0x1b7473){this[_0x8a98('0x11')][_0x8a98('0x3c')]({'uniqueid':this['channel'][_0x8a98('0x3d')],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0x8a98('0x3e')],'context':this[_0x8a98('0x10')]['context'],'extension':this['channel'][_0x8a98('0x3f')],'priority':this[_0x8a98('0x10')][_0x8a98('0x40')],'accountcode':this[_0x8a98('0x10')]['accountcode'],'dnid':this['channel'][_0x8a98('0x41')],'projectName':this[_0x8a98('0x10')]['arg_1'],'saveName':_0x198f40,'filename':_0x3125c8[_0x8a98('0x42')]||_0x198f40,'savePath':_0x156d5f})[_0x8a98('0x15')](function(_0x5222d8){_0x1b7473(null,_0x5222d8);})[_0x8a98('0x19')](function(_0x2f3b37){_0x1b7473(_0x2f3b37);});};AGIVertices[_0x8a98('0x12')]['createSquareMessage']=function(_0x310a50,_0x5918a9,_0x1056cb,_0x4e66ec,_0x3b4c84){this[_0x8a98('0x11')][_0x8a98('0x43')]({'uniqueid':this[_0x8a98('0x10')][_0x8a98('0x3d')],'body':_0x310a50,'direction':_0x5918a9,'providerName':_0x1056cb,'providerResponse':_0x4e66ec})[_0x8a98('0x15')](function(_0xef0f7a){if(_0x3b4c84){_0x3b4c84(null,_0xef0f7a);}})[_0x8a98('0x19')](function(_0x39be84){if(_0x3b4c84){_0x3b4c84(_0x39be84);}});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x44')]=function(_0x3290d7,_0x25e850){this['rpc'][_0x8a98('0x44')]({'firstName':_[_0x8a98('0x45')](_0x3290d7['name'])||_[_0x8a98('0x46')](_0x3290d7['name'])?_0x8a98('0x47')+Math[_0x8a98('0x48')]():_0x3290d7[_0x8a98('0x16')],'lastName':_[_0x8a98('0x45')](_0x3290d7[_0x8a98('0x49')])||_[_0x8a98('0x46')](_0x3290d7[_0x8a98('0x49')])?null:_0x3290d7[_0x8a98('0x49')],'phone':_0x3290d7[_0x8a98('0x4a')],'ListId':_0x3290d7['list_id'],'scheduledat':_0x3290d7[_0x8a98('0x4b')],'callbackUniqueid':this[_0x8a98('0x10')]['uniqueid'],'tags':_0x8a98('0x4c'),'description':'Callback\x20scheduled\x20at\x20'+_0x3290d7[_0x8a98('0x4b')][_0x8a98('0x4d')](),'priority':_0x3290d7[_0x8a98('0x4e')]})[_0x8a98('0x15')](function(_0x58af81){_0x25e850(null,_0x58af81);})['catch'](function(_0x2cd97b){_0x25e850(_0x2cd97b);});};AGIVertices['prototype'][_0x8a98('0x4f')]=function(_0x281172,_0x24ad38){this['rpc'][_0x8a98('0x50')](_0x281172)[_0x8a98('0x15')](function(_0x147695){_0x24ad38(null,_0x147695?_0x147695[_0x8a98('0x16')]:![]);})[_0x8a98('0x19')](function(_0x47f02d){_0x24ad38(_0x47f02d);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x51')]=function(_0x4dabdf,_0x4b758d,_0xcf5ae8){var _0x4966ed={'role':_0x8a98('0x52')};_0x4966ed[_0x4dabdf]=this[_0x8a98('0x10')][_0x8a98('0x3b')];this[_0x8a98('0x11')][_0x8a98('0x51')](_0x4966ed,_0x4b758d,this['channel']['uniqueid'])[_0x8a98('0x15')](function(_0x144db5){_0xcf5ae8(null,_[_0x8a98('0x46')](_0x144db5)?![]:!![]);})[_0x8a98('0x19')](function(_0x56c0c4){logger[_0x8a98('0x2d')](_0x56c0c4);_0xcf5ae8(null,![]);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x53')]=function(_0x552ec5,_0x20baed){var _0x1e7c06={'role':'agent'};_0x1e7c06[_0x552ec5]=this['channel'][_0x8a98('0x3b')];this[_0x8a98('0x11')][_0x8a98('0x53')](_0x1e7c06)['then'](function(_0x5daaa1){_0x20baed(null,_['isNil'](_0x5daaa1)?![]:!![]);})['catch'](function(_0x147fb6){logger[_0x8a98('0x2d')](_0x147fb6);_0x20baed(null,![]);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x54')]=function(_0x20bc7e,_0x5caa01){var _0x3517a7={'role':_0x8a98('0x52')};_0x3517a7[_0x20bc7e]=this[_0x8a98('0x10')][_0x8a98('0x3b')];this[_0x8a98('0x11')][_0x8a98('0x54')](_0x3517a7)[_0x8a98('0x15')](function(_0x133bff){_0x5caa01(null,_[_0x8a98('0x46')](_0x133bff)?![]:!![]);})[_0x8a98('0x19')](function(_0x2c5bd1){logger['error'](_0x2c5bd1);_0x5caa01(null,![]);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x55')]=function(_0x220257,_0x30fe59){var _0xe2cb84={'role':_0x8a98('0x52')};_0xe2cb84[_0x220257]=this[_0x8a98('0x10')][_0x8a98('0x3b')];var _0x25249f=_0x220257!='internal'?util[_0x8a98('0x29')]('%s/%s@from-sip/n',_0x8a98('0x56'),this[_0x8a98('0x10')]['callerid']):undefined;this[_0x8a98('0x11')][_0x8a98('0x55')](_0xe2cb84,_0x25249f)[_0x8a98('0x15')](function(_0x364bd5){_0x30fe59(null,_[_0x8a98('0x46')](_0x364bd5)?![]:!![]);})['catch'](function(_0x4b3aa7){logger[_0x8a98('0x2d')](_0x4b3aa7);_0x30fe59(null,![]);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x57')]=function(_0x62b3be,_0x3c5b5b){sh['exec'](_[_0x8a98('0x58')](_0x62b3be),function(_0x128840,_0x4973cb){var _0x317d8c=_0x4973cb[_0x8a98('0x59')](/(\r\n|\n|\r)/gm,'');_0x3c5b5b(null,_0x317d8c);});};AGIVertices['prototype'][_0x8a98('0x5a')]=function(_0x2d91d7,_0x34197f){scripts[_0x8a98('0x5a')](_0x2d91d7[_0x8a98('0x5b')],_0x2d91d7[_0x8a98('0x5c')]||_0x8a98('0x5d'),_0x2d91d7[_0x8a98('0x5d')],_0x2d91d7['languageCode']||'en-US',_0x2d91d7[_0x8a98('0x5e')]||_0x8a98('0x5f'),_0x2d91d7[_0x8a98('0x60')]||_0x8a98('0x61'))['then'](function(_0x191856){_0x34197f(null,_0x191856);})['catch'](function(_0x2952ce){_0x34197f(_0x2952ce);});};AGIVertices[_0x8a98('0x12')]['googleTTS']=function(_0x5db50e,_0x20b646){scripts[_0x8a98('0x62')](_0x5db50e[_0x8a98('0x5d')],_0x5db50e[_0x8a98('0x63')]||'en',0x1)[_0x8a98('0x15')](function(_0x343f3b){_0x20b646(null,_0x343f3b);})[_0x8a98('0x19')](function(_0x299b91){_0x20b646(_0x299b91);});};AGIVertices[_0x8a98('0x12')]['restAPI']=function(_0x24cc56,_0x582650){var _0x4f5117={'uri':_0x24cc56[_0x8a98('0x64')],'method':_0x24cc56[_0x8a98('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x24cc56[_0x8a98('0x66')])==='number'&&parseInt(_0x24cc56[_0x8a98('0x66')])>=0x1?parseInt(_0x24cc56[_0x8a98('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x8a98('0x67')](['POST',_0x8a98('0x68')],_0x4f5117[_0x8a98('0x65')][_0x8a98('0x69')]())){try{_0x4f5117[_0x8a98('0x6a')]=_0x24cc56[_0x8a98('0xd')]?JSON[_0x8a98('0x6b')](_0x24cc56[_0x8a98('0xd')]):{};}catch(_0x1f23f5){logger[_0x8a98('0x2d')](_0x8a98('0x6c'),_0x1f23f5);}}try{_0x4f5117[_0x8a98('0x6d')]=_0x24cc56['rawHeaders']?JSON[_0x8a98('0x6b')](_0x24cc56[_0x8a98('0x6e')]):{};}catch(_0x27e2dc){logger[_0x8a98('0x2d')](_0x8a98('0x6f'),_0x27e2dc);}if(_0x24cc56[_0x8a98('0x70')]){try{var _0x4801f6=require(_0x24cc56[_0x8a98('0x70')])[_0x8a98('0x71')](this,_0x4f5117);_0x4f5117[_0x8a98('0x72')]=Mustache[_0x8a98('0x73')](_0x24cc56[_0x8a98('0x64')],_0x4801f6,{},['$$','$$']);if(_0x4f5117[_0x8a98('0x6d')]){_0x4f5117[_0x8a98('0x6d')]=JSON['parse'](Mustache['render'](JSON[_0x8a98('0x74')](_0x4f5117[_0x8a98('0x6d')]),_0x4801f6,{},['$$','$$']));}if(_0x4f5117[_0x8a98('0x6a')]){_0x4f5117[_0x8a98('0x6a')]=JSON[_0x8a98('0x6b')](Mustache[_0x8a98('0x73')](JSON[_0x8a98('0x74')](_0x4f5117['body']),_0x4801f6,{},['$$','$$']));}}catch(_0x48b7b0){logger[_0x8a98('0x2d')](_0x8a98('0x75'),_0x48b7b0);}}rp(_0x4f5117)[_0x8a98('0x15')](function(_0x48432a){var _0x5a1004={'statusCode':_0x48432a[_0x8a98('0x76')]||0xc8,'statusMessage':_0x48432a[_0x8a98('0x77')]||'OK','headers':_0x48432a[_0x8a98('0x6d')]||{},'body':_0x48432a[_0x8a98('0x6a')]||{}};_0x582650(null,_0x5a1004);})[_0x8a98('0x19')](function(_0x2bf1fb){var _0x39ffd1={'statusCode':_0x2bf1fb[_0x8a98('0x76')]||0x1f4,'statusMessage':_0x2bf1fb[_0x8a98('0x78')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2bf1fb[_0x8a98('0x79')][_0x8a98('0x6d')]||{},'body':_0x2bf1fb[_0x8a98('0x79')][_0x8a98('0x6a')]||{}};_0x582650(null,_0x39ffd1);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x7a')]=function(_0x36644d,_0x4f7bdd){scripts[_0x8a98('0x7a')](this[_0x8a98('0x10')][_0x8a98('0x3d')],_0x36644d[_0x8a98('0x7b')],_0x36644d[_0x8a98('0x5d')],_0x36644d[_0x8a98('0x7c')]||'en')['then'](function(_0x1d5f79){_0x4f7bdd(null,_0x1d5f79);})[_0x8a98('0x19')](function(_0x48f85d){_0x4f7bdd(_0x48f85d);});};AGIVertices[_0x8a98('0x12')]['googleDialogflowV2']=function(_0xcf29df,_0x2e6dda){scripts[_0x8a98('0x7d')](this[_0x8a98('0x10')][_0x8a98('0x3d')],_0xcf29df[_0x8a98('0x7e')],_0xcf29df['client_email'],_0xcf29df[_0x8a98('0x7f')],_0xcf29df[_0x8a98('0x5d')],_0xcf29df[_0x8a98('0x80')]||'en')[_0x8a98('0x15')](function(_0x2b1e49){_0x2e6dda(null,_0x2b1e49);})[_0x8a98('0x19')](function(_0xd43112){_0x2e6dda(_0xd43112);});};AGIVertices[_0x8a98('0x12')]['sestekNDA']=function(_0x27a17a,_0x2dec53){scripts['sestekNDA'](this[_0x8a98('0x10')],_0x27a17a)[_0x8a98('0x15')](function(_0x21b8c7){_0x2dec53(null,_0x21b8c7);})[_0x8a98('0x19')](function(_0xc23db3){_0x2dec53(_0xc23db3);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x81')]=function(_0x4bd760,_0x3eb047){scripts[_0x8a98('0x81')](_0x4bd760['key'],_0x4bd760[_0x8a98('0x5d')],_0x4bd760[_0x8a98('0x82')]||_0x8a98('0x83'),_0x4bd760[_0x8a98('0x84')])[_0x8a98('0x15')](function(_0x2c36ef){_0x3eb047(null,_0x2c36ef);})[_0x8a98('0x19')](function(_0x5cafbc){_0x3eb047(_0x5cafbc);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x85')]=function(_0x4cdbe6,_0x687ec8,_0x29f12a){scripts[_0x8a98('0x85')](_0x687ec8,_0x4cdbe6[_0x8a98('0x7b')],_0x4cdbe6['ispeech_asr_language']||'en-US',this[_0x8a98('0x86')](_0x4cdbe6[_0x8a98('0x87')])?_0x4cdbe6[_0x8a98('0x87')]:undefined)['then'](function(_0x2cc4b8){_0x29f12a(null,_0x2cc4b8);})[_0x8a98('0x19')](function(_0x12b753){_0x29f12a(_0x12b753);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x88')]=function(_0x5a9588,_0x441665){scripts['awsPolly'](_0x5a9588[_0x8a98('0x89')],_0x5a9588[_0x8a98('0x8a')],_0x5a9588[_0x8a98('0x8b')],_0x5a9588[_0x8a98('0x8c')]||_0x8a98('0x8d'),_0x5a9588[_0x8a98('0x5d')],_0x5a9588[_0x8a98('0x8e')]||'text')[_0x8a98('0x15')](function(_0x310aff){_0x441665(null,_0x310aff);})[_0x8a98('0x19')](function(_0x321a49){_0x441665(_0x321a49);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x8f')]=function(_0x1200aa,_0x57e4bc){scripts[_0x8a98('0x8f')](this[_0x8a98('0x10')][_0x8a98('0x3d')],_0x1200aa[_0x8a98('0x89')],_0x1200aa[_0x8a98('0x8a')],_0x1200aa[_0x8a98('0x90')],_0x1200aa[_0x8a98('0x5d')],_0x1200aa[_0x8a98('0x91')])[_0x8a98('0x15')](function(_0x42f9a9){_0x57e4bc(null,_0x42f9a9);})['catch'](function(_0x5742f6){_0x57e4bc(_0x5742f6);});};AGIVertices['prototype'][_0x8a98('0x92')]=function(_0xe31f3d,_0x2859d9,_0x1dbe53){scripts[_0x8a98('0x92')](_0x2859d9,_0xe31f3d[_0x8a98('0x7b')],_0xe31f3d['google_asr_language']||'en-US')[_0x8a98('0x15')](function(_0x3d2254){_0x1dbe53(null,_0x3d2254);})['catch'](function(_0x5f454a){_0x1dbe53(_0x5f454a);});};AGIVertices[_0x8a98('0x12')]['tildeASR']=function(_0x5e1027,_0x3df624,_0x2fa156){scripts[_0x8a98('0x93')](_0x3df624,_0x5e1027[_0x8a98('0x94')],_0x5e1027[_0x8a98('0x95')],_0x5e1027['uri'])[_0x8a98('0x15')](function(_0x175e02){_0x2fa156(null,_0x175e02);})[_0x8a98('0x19')](function(_0x321bb8){_0x2fa156(_0x321bb8);});};AGIVertices[_0x8a98('0x12')][_0x8a98('0x96')]=function(_0x14330a){var _0xb36c0f=_[_0x8a98('0x67')](verticesWithRetry,_0x14330a[_0x8a98('0x97')])?_0x14330a:_[_0x8a98('0x98')](_0x14330a);for(var _0x1292a9 in _0xb36c0f){if(_0xb36c0f[_0x8a98('0x99')](_0x1292a9)){if(_0xb36c0f[_0x1292a9]&&_[_0x8a98('0x9a')](_0xb36c0f[_0x1292a9])){if(_[_0x8a98('0x67')](recursiveMapAttributes,_0x1292a9)){_0xb36c0f[_0x1292a9]=this[_0x8a98('0x9b')](_0xb36c0f[_0x1292a9]);}else{_0xb36c0f[_0x1292a9]=this[_0x8a98('0x9c')](_0xb36c0f[_0x1292a9]);}}}}return _0xb36c0f;};AGIVertices[_0x8a98('0x12')][_0x8a98('0x9d')]=function(_0x4fb239){for(var _0x1fae30 in _0x4fb239){if(_0x4fb239[_0x8a98('0x99')](_0x1fae30)){if(_['isPlainObject'](_0x4fb239[_0x1fae30])){this[_0x8a98('0x9d')](_0x4fb239[_0x1fae30]);}else if(_['isArray'](_0x4fb239[_0x1fae30])){for(var _0x439c99=0x0;_0x439c99<_0x4fb239[_0x1fae30][_0x8a98('0x9e')];_0x439c99++){this[_0x8a98('0x9d')](_0x4fb239[_0x1fae30][_0x439c99]);}}else if(_[_0x8a98('0x9a')](_0x4fb239[_0x1fae30])){_0x4fb239[_0x1fae30]=this[_0x8a98('0x9c')](_0x4fb239[_0x1fae30]);}}}};AGIVertices[_0x8a98('0x12')][_0x8a98('0x9f')]=function(_0x34bb1b,_0x2152a9){for(var _0x2eeeb5 in _0x34bb1b){if(_0x34bb1b[_0x8a98('0x99')](_0x2eeeb5)){if(_['isPlainObject'](_0x34bb1b[_0x2eeeb5])){if(!_[_0x8a98('0x45')](_0x34bb1b[_0x2eeeb5])){this[_0x8a98('0x9f')](_0x34bb1b[_0x2eeeb5],util[_0x8a98('0x29')](_0x8a98('0xa0'),_0x2152a9,_0x2eeeb5));}}else if(_[_0x8a98('0xa1')](_0x34bb1b[_0x2eeeb5])){for(var _0x355010=0x0;_0x355010<_0x34bb1b[_0x2eeeb5]['length'];_0x355010++){this[_0x8a98('0x9f')](_0x34bb1b[_0x2eeeb5][_0x355010],util[_0x8a98('0x29')](_0x8a98('0xa0'),_0x2152a9,_0x2eeeb5+'['+_0x355010+']'));}}else{if(!_[_0x8a98('0x46')](_0x34bb1b[_0x2eeeb5])){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0xa0'),_0x2152a9,_0x2eeeb5),_0x34bb1b[_0x2eeeb5]);}}}}};AGIVertices[_0x8a98('0x12')][_0x8a98('0x9b')]=function(_0x116cc1){try{var _0x13a46b=JSON[_0x8a98('0x6b')](_0x116cc1);this[_0x8a98('0x9d')](_0x13a46b);return JSON[_0x8a98('0x74')](_0x13a46b);}catch(_0x56fe87){return this[_0x8a98('0x9c')](_0x116cc1);}};AGIVertices[_0x8a98('0x12')][_0x8a98('0x9c')]=function(_0x41a065){var _0x3c23b0=_0x41a065[_0x8a98('0xa3')]('{');for(var _0x3083b6=0x1;_0x3083b6<_0x3c23b0[_0x8a98('0x9e')];_0x3083b6+=0x1){var _0xbada99=_0x3c23b0[_0x3083b6]['split']('}');if(_0xbada99[_0x8a98('0x9e')]>0x1){_0x41a065=_0x41a065[_0x8a98('0xa4')]('{'+_0xbada99[0x0]+'}',this['channel'][_0x8a98('0x13')](_0xbada99[0x0])['extra']||_0xbada99[0x0]);}}if(_0x3c23b0[_0x8a98('0x9e')]===0x1){return _0x41a065['toString']();}return this['replaceAllVariables'](_0x41a065);};AGIVertices[_0x8a98('0x12')][_0x8a98('0xa5')]=function(_0x853701,_0x604422){var _0x38b3fc=this[_0x8a98('0x10')][_0x8a98('0x13')](_0x853701);if(_0x38b3fc[_0x8a98('0xa6')]===-0x1){return _0x38b3fc;}logger['info'](util['format'](_0x8a98('0xa7'),_0x604422,_0x38b3fc['extra']));return this['channel'][_0x8a98('0xa2')](_0x604422,_0x38b3fc[_0x8a98('0xa8')]);};AGIVertices[_0x8a98('0x12')][_0x8a98('0x86')]=function(_0x2e2085){return _0x2e2085&&_0x2e2085!=='0'&&_0x2e2085!=='-1'&&_0x2e2085!=='';};AGIVertices[_0x8a98('0x12')]['maxRetry']=function(_0x33b39f){this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x33b39f,'-');_0x33b39f[_0x8a98('0xa9')]=_0x33b39f[_0x8a98('0xaa')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x17a38f){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xab'),_0x17a38f[_0x8a98('0x39')]));if(!this['isConfigured'](_0x17a38f[_0x8a98('0x5d')])){return this['channel'][_0x8a98('0xac')](_0x8a98('0xad'));}var _0xe9cc36='\x22'+_0x17a38f[_0x8a98('0x5d')]+'\x22';if(this[_0x8a98('0x86')](_0x17a38f[_0x8a98('0x79')])){_0xe9cc36+=','+_0x17a38f[_0x8a98('0x79')];}var _0x27b059=this[_0x8a98('0x10')][_0x8a98('0xae')]('MRCPSynth',_0xe9cc36);if(_0x27b059[_0x8a98('0xa6')]===-0x1){return _0x27b059;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0xe9cc36));};AGIVertices[_0x8a98('0x12')][_0x8a98('0xaf')]=function(_0x283f03){logger[_0x8a98('0x31')](util['format'](_0x8a98('0xb0'),_0x283f03[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x283f03[_0x8a98('0xb1')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xb2'));}var _0x34dcb7=_0x283f03[_0x8a98('0xb1')];if(this['isConfigured'](_0x283f03[_0x8a98('0x79')])){_0x34dcb7+=','+_0x283f03['options'];}var _0x3f4bbe=this[_0x8a98('0x10')][_0x8a98('0xae')](_0x8a98('0xb3'),_0x34dcb7);if(_0x3f4bbe['result']===-0x1){return _0x3f4bbe;}var _0x20a954=this[_0x8a98('0xa5')]('RECOG_CONFIDENCE()',_0x8a98('0xb4'));if(_0x20a954[_0x8a98('0xa6')]===-0x1){return _0x20a954;}var _0x54e7e1=this[_0x8a98('0xa5')](_0x8a98('0xb5'),_0x8a98('0xb6'));if(_0x54e7e1[_0x8a98('0xa6')]===-0x1){return _0x54e7e1;}var _0x3f907a=this[_0x8a98('0xa5')](_0x8a98('0xb7'),_0x8a98('0xb8'));if(_0x3f907a['result']===-0x1){return _0x3f907a;}return this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x34dcb7));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x9')]=function(_0x16b74d){logger['info'](util['format'](_0x8a98('0xb9'),_0x16b74d['label']));return this[_0x8a98('0x10')][_0x8a98('0x9')]([_0x16b74d['command'],_0x16b74d['args']]);};AGIVertices['prototype']['answer']=function(_0x5670f7){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xba'),_0x5670f7[_0x8a98('0x39')]));if(this[_0x8a98('0x86')](_0x5670f7[_0x8a98('0x66')])){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xbb'),_0x5670f7['timeout']));var _0x13419c=this['channel']['wait'](_0x5670f7[_0x8a98('0x66')]);if(_0x13419c['result']===-0x1){return _0x13419c;}}return this[_0x8a98('0x10')][_0x8a98('0xbc')]();};AGIVertices[_0x8a98('0x12')][_0x8a98('0x4c')]=function(_0x47e98a){logger['info'](util[_0x8a98('0x29')](_0x8a98('0xbd'),_0x47e98a['label']));if(!this[_0x8a98('0x86')](_0x47e98a[_0x8a98('0xbe')])){return this[_0x8a98('0x10')]['error'](_0x47e98a,_0x8a98('0xbf'));}_0x47e98a[_0x8a98('0x4b')]=moment();if(this['isConfigured'](_0x47e98a[_0x8a98('0xc0')])){_0x47e98a['scheduledAt']=moment()['add'](_0x47e98a[_0x8a98('0xc0')],'minutes');}if(!this[_0x8a98('0x86')](_0x47e98a[_0x8a98('0x4e')])){_0x47e98a[_0x8a98('0x4e')]=0x2;}this[_0x8a98('0x44')][_0x8a98('0x71')](this,_0x47e98a);return this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x47e98a[_0x8a98('0x4a')],_0x47e98a[_0x8a98('0xbe')],_0x47e98a[_0x8a98('0x4b')]));};AGIVertices[_0x8a98('0x12')]['custom_app']=function(_0x387a29){logger[_0x8a98('0x31')](util[_0x8a98('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x387a29[_0x8a98('0x39')]));var _0x44c905=this[_0x8a98('0x10')][_0x8a98('0xae')](_0x387a29[_0x8a98('0xc1')],_0x387a29['options']);if(_0x44c905['result']===-0x1){return _0x44c905;}return this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')](_0x8a98('0xc2'),_0x387a29[_0x8a98('0xc1')],_0x387a29[_0x8a98('0x79')]));};AGIVertices['prototype'][_0x8a98('0xc3')]=function(_0x259eb4){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xc4'),_0x259eb4[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x259eb4[_0x8a98('0x5d')])){return this[_0x8a98('0x10')]['noop'](_0x8a98('0xad'));}var _0x462a71='\x22'+_0x259eb4[_0x8a98('0x5d')]+'\x22';if(this['isConfigured'](_0x259eb4[_0x8a98('0x79')])){_0x462a71+=','+_0x259eb4['options'];}var _0x5db8c4=this[_0x8a98('0x10')][_0x8a98('0xae')](_0x8a98('0xc5'),_0x462a71);if(_0x5db8c4[_0x8a98('0xa6')]===-0x1){return _0x5db8c4;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xc6'),_0x462a71));};AGIVertices[_0x8a98('0x12')][_0x8a98('0xc7')]=function(_0xde4486){logger[_0x8a98('0x31')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0xde4486[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0xde4486[_0x8a98('0x5d')])){return this[_0x8a98('0x10')][_0x8a98('0xac')]('no\x20text\x20configured');}var _0x29be06='\x22'+_0xde4486['text']+'\x22';if(this[_0x8a98('0x86')](_0xde4486['options'])){_0x29be06+=','+_0xde4486[_0x8a98('0x79')];}var _0x1d9eef=this[_0x8a98('0x10')][_0x8a98('0xae')]('MRCPSynth',_0x29be06);if(_0x1d9eef['result']===-0x1){return _0x1d9eef;}return this['channel'][_0x8a98('0xac')](util['format'](_0x8a98('0xc6'),_0x29be06));};AGIVertices[_0x8a98('0x12')]['lumenvoxasr']=function(_0x538602){logger[_0x8a98('0x31')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x538602[_0x8a98('0x39')]));if(!this['isConfigured'](_0x538602[_0x8a98('0xb1')])){return this['channel']['noop'](_0x8a98('0xb2'));}var _0x2638af=_0x538602['grammar'];if(this[_0x8a98('0x86')](_0x538602['options'])){_0x2638af+=','+_0x538602[_0x8a98('0x79')];}var _0x4e922d=this[_0x8a98('0x10')][_0x8a98('0xae')](_0x8a98('0xb3'),_0x2638af);if(_0x4e922d[_0x8a98('0xa6')]===-0x1){return _0x4e922d;}var _0x140fe6=this[_0x8a98('0xa5')](_0x8a98('0xc8'),'LUMENVOX_ASR_CONFIDENCE');if(_0x140fe6[_0x8a98('0xa6')]===-0x1){return _0x140fe6;}var _0x17abbb=this[_0x8a98('0xa5')](_0x8a98('0xb5'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x17abbb['result']===-0x1){return _0x17abbb;}var _0x283de3=this['getAndSetVariable'](_0x8a98('0xb7'),'LUMENVOX_ASR_INSTANCE');if(_0x283de3[_0x8a98('0xa6')]===-0x1){return _0x283de3;}return this['channel'][_0x8a98('0xac')](util['format'](_0x8a98('0xc9'),_0x2638af));};AGIVertices['prototype'][_0x8a98('0xca')]=function(_0x24e61b){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xcb'),_0x24e61b[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x24e61b[_0x8a98('0xb1')])){return this['channel']['noop'](_0x8a98('0xb2'));}var _0xafffae=_0x24e61b['grammar'];if(this['isConfigured'](_0x24e61b[_0x8a98('0x79')])){_0xafffae+=','+_0x24e61b['options'];}var _0x2070e3=this[_0x8a98('0x10')][_0x8a98('0xae')](_0x8a98('0xb3'),_0xafffae);if(_0x2070e3[_0x8a98('0xa6')]===-0x1){return _0x2070e3;}var _0x2e12b1=this[_0x8a98('0xa5')](_0x8a98('0xc8'),_0x8a98('0xcc'));if(_0x2e12b1[_0x8a98('0xa6')]===-0x1){return _0x2e12b1;}var _0x40c436=this[_0x8a98('0xa5')](_0x8a98('0xb5'),'SESTEK_ASR_TRANSCRIPT');if(_0x40c436['result']===-0x1){return _0x40c436;}var _0x24824c=this[_0x8a98('0xa5')](_0x8a98('0xb7'),_0x8a98('0xcd'));if(_0x24824c[_0x8a98('0xa6')]===-0x1){return _0x24824c;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xc9'),_0xafffae));};AGIVertices['prototype'][_0x8a98('0xce')]=function(_0x1a748a){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xcf'),_0x1a748a[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x1a748a[_0x8a98('0xd0')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x1a748a,_0x8a98('0xd1'));}var _0x331bf2=this[_0x8a98('0x1b')][_0x8a98('0x71')](this,_0x1a748a['odbc_id']);if(!_0x331bf2){return this['channel'][_0x8a98('0x2d')](_0x1a748a,_0x8a98('0xd2'));}if(!this[_0x8a98('0x86')](_0x1a748a[_0x8a98('0x30')])){return this['channel'][_0x8a98('0x2d')](_0x1a748a,_0x8a98('0xd3'));}var _0xf40239=_0x1a748a['query'][_0x8a98('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')]('query:\x20%s',_0xf40239));var _0x4af5b8=this[_0x8a98('0x2b')]['sync'](this,_0x331bf2,_0xf40239);this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x1a748a,_0xf40239);if(!this[_0x8a98('0x86')](_0x1a748a[_0x8a98('0xd4')])){return this[_0x8a98('0x10')]['noop'](_0x8a98('0xd5'));}var _0x1e9b87=this[_0x8a98('0x13')]['sync'](this,_0x1a748a[_0x8a98('0xd4')]);if(!_0x1e9b87){return this['channel'][_0x8a98('0x2d')](_0x1a748a,_0x8a98('0xd6'));}var _0x5ac8e2=this;_0x4af5b8[_0x8a98('0xd7')](function(_0x1e4076,_0x1fa9c4){Object[_0x8a98('0xd8')](_0x1e4076)[_0x8a98('0xd7')](function(_0xd16743){_0x5ac8e2[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0xd9'),_0x1e9b87,_0x1fa9c4,_0xd16743),_0x1e4076[_0xd16743]);});});this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0xda'),_0x1e9b87),_0x4af5b8[_0x8a98('0x9e')]);return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xdb'),_0x1e9b87));};AGIVertices[_0x8a98('0x12')]['dial']=function(_0x2572ad){logger[_0x8a98('0xdc')](util['format'](_0x8a98('0xdd'),_0x2572ad[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x2572ad['sip_id'])){return this['channel'][_0x8a98('0x2d')](_0x2572ad,_0x8a98('0xde'));}var _0x471c78=this[_0x8a98('0x1d')][_0x8a98('0x71')](this,_0x2572ad[_0x8a98('0xdf')]);if(!_0x471c78){return this[_0x8a98('0x10')]['error'](_0x2572ad,_0x8a98('0xe0'));}var _0x141bd1=this['channel'][_0x8a98('0xae')]('DIAL',[util['format'](_0x8a98('0xe1'),_0x471c78),_0x2572ad['timeout'],_0x2572ad[_0x8a98('0xe2')],_0x2572ad[_0x8a98('0x64')]]);if(_0x141bd1[_0x8a98('0xa6')]===-0x1){return _0x141bd1;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0xe3'),_0x8a98('0xe4')));};AGIVertices[_0x8a98('0x12')]['dialogflow']=function(_0x25a9a5){logger[_0x8a98('0x31')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x25a9a5['label']));if(!this['isConfigured'](_0x25a9a5[_0x8a98('0x7b')])){return this[_0x8a98('0x10')]['noop'](_0x8a98('0xe5'));}if(!this[_0x8a98('0x86')](_0x25a9a5[_0x8a98('0x5d')])){return this['channel'][_0x8a98('0xac')](_0x8a98('0xad'));}this['channel'][_0x8a98('0xe6')]=!![];this['createSquareDetailsReport'](_0x25a9a5);this['createSquareMessage'](_0x25a9a5[_0x8a98('0x5d')],'in','','');this[_0x8a98('0x10')]['noop'](util['format'](_0x8a98('0xe7'),_0x25a9a5[_0x8a98('0x5d')]));var _0x47e082=this[_0x8a98('0x7a')][_0x8a98('0x71')](this,_0x25a9a5);if(_0x47e082){for(var _0x2911dc in _0x47e082){if(_0x47e082[_0x8a98('0x99')](_0x2911dc)){this[_0x8a98('0x10')][_0x8a98('0xa2')](util['format']('DIALOGFLOW_%s',_0x2911dc[_0x8a98('0x69')]()),_0x47e082[_0x2911dc]);}}this[_0x8a98('0x43')](_0x47e082[_0x8a98('0xe8')],'out',_0x8a98('0xe9'),'');return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xea'),_0x47e082[_0x8a98('0xe8')]));}return this['channel']['error'](_0x25a9a5,_0x8a98('0xeb'));};AGIVertices['prototype']['dialogflowV2']=function(_0x174a10){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xec'),_0x174a10['label']));if(!this[_0x8a98('0x86')](_0x174a10[_0x8a98('0x7e')])){return this[_0x8a98('0x10')]['noop']('no\x20project_id\x20configured');}if(!this[_0x8a98('0x86')](_0x174a10['client_email'])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xed'));}if(!this['isConfigured'](_0x174a10[_0x8a98('0x7f')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xee'));}if(!this[_0x8a98('0x86')](_0x174a10['dialogflowV2_language'])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xef'));}if(!this[_0x8a98('0x86')](_0x174a10[_0x8a98('0x5d')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xad'));}this[_0x8a98('0x10')][_0x8a98('0xe6')]=!![];this['createSquareDetailsReport'](_0x174a10);this[_0x8a98('0x43')](_0x174a10['text'],'in','','');this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xf0'),_0x174a10['text']));var _0x597cac=this[_0x8a98('0x7d')]['sync'](this,_0x174a10);if(_0x597cac){for(var _0x2dba7a in _0x597cac){if(_0x597cac[_0x8a98('0x99')](_0x2dba7a)){if(_0x2dba7a!==_0x8a98('0xf1')){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')]('DIALOGFLOW_%s',_0x2dba7a['toUpperCase']()),_0x597cac[_0x2dba7a]);}}}this['createSquareMessage'](_0x597cac[_0x8a98('0xe8')],_0x8a98('0xf2'),_0x8a98('0xf3'),_0x597cac[_0x8a98('0xf1')]);return this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xf4'),_0x597cac[_0x8a98('0xe8')]));}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x174a10,_0x8a98('0xf5'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0xf6')]=function(_0x3a3544){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0xf7'),_0x3a3544[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x3a3544[_0x8a98('0xf8')])){return this[_0x8a98('0x10')][_0x8a98('0xac')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x8a98('0x86')](_0x3a3544[_0x8a98('0xf9')])){return this['channel']['noop'](_0x8a98('0xfa'));}if(!this[_0x8a98('0x86')](_0x3a3544[_0x8a98('0xfb')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xfc'));}if(!this[_0x8a98('0x86')](_0x3a3544[_0x8a98('0xfd')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xad'));}this[_0x8a98('0x10')][_0x8a98('0xe6')]=!![];this['createSquareDetailsReport'](_0x3a3544);this['createSquareMessage'](_0x3a3544[_0x8a98('0x5d')],'in','','');this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')](_0x8a98('0xfe'),_0x3a3544[_0x8a98('0x5d')]));var _0x31b31e=this[_0x8a98('0xff')]['sync'](this,_0x3a3544);if(_0x31b31e){for(var _0x12ca4b in _0x31b31e){if(_0x31b31e[_0x8a98('0x99')](_0x12ca4b)){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0x100'),_0x12ca4b[_0x8a98('0x69')]()),_0x31b31e[_0x12ca4b]);}}this['createSquareMessage'](_0x31b31e['speech'],_0x8a98('0xf2'),'sesteknda','');if(_0x31b31e['audiofile']){this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x31b31e[_0x8a98('0x101')]));var _0x1a245b=this[_0x8a98('0x10')][_0x8a98('0x102')](_0x31b31e[_0x8a98('0x101')]);try{fs[_0x8a98('0x103')](_0x31b31e[_0x8a98('0x101')]+'.wav');}catch(_0x3e644d){logger[_0x8a98('0x2d')](_0x3e644d);}return _0x1a245b;}else{return this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')](_0x8a98('0x104'),_0x31b31e[_0x8a98('0xe8')]));}}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x3a3544,_0x8a98('0x105'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x106')]=function(_0xdb9855){logger['info'](util['format'](_0x8a98('0x107'),_0xdb9855['label']));return this[_0x8a98('0x10')][_0x8a98('0xac')]('end');};AGIVertices[_0x8a98('0x12')][_0x8a98('0x108')]=function(_0xb31c4){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x109'),_0xb31c4[_0x8a98('0x39')]));var _0x4bd1d9='';if(_0xb31c4['trunk_id']){if(!this[_0x8a98('0x86')](_0xb31c4[_0x8a98('0x10a')])){return this[_0x8a98('0x10')]['error'](_0xb31c4,_0x8a98('0x10b'));}else{var _0x54a500=parseInt(_0xb31c4['trunk_id'],0xa);if(isNaN(_0x54a500)){_0x4bd1d9=_0xb31c4[_0x8a98('0x10a')];}else{_0x4bd1d9=this['getTrunk']['sync'](this,_0xb31c4['trunk_id']);if(!_0x4bd1d9){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0xb31c4,_0x8a98('0x10c'));}}}}else if(_0xb31c4['trunk_name']){_0x4bd1d9=_0xb31c4['trunk_name'];}else{return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0xb31c4,_0x8a98('0x10b'));}var _0x1dd3be=this['channel'][_0x8a98('0xae')](_0x8a98('0xe4'),[util[_0x8a98('0x29')](_0x8a98('0x10d'),_0x4bd1d9,_0xb31c4['phone']),_0xb31c4['timeout'],_0xb31c4[_0x8a98('0xe2')],_0xb31c4[_0x8a98('0x64')]]);if(_0x1dd3be[_0x8a98('0xa6')]===-0x1){return _0x1dd3be;}return this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x8a98('0x12')]['finally']=function(_0x178b4b){logger[_0x8a98('0x31')](util[_0x8a98('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x178b4b['label']));return this['channel'][_0x8a98('0xac')](_0x8a98('0x10e'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x10f')]=function(_0x42eb09){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x110'),_0x42eb09['label']));if(_0x42eb09[_0x8a98('0xa9')]===0x0){return this[_0x8a98('0xaa')](_0x42eb09);}_0x42eb09[_0x8a98('0xa9')]-=0x1;if(!this[_0x8a98('0x86')](_0x42eb09[_0x8a98('0x111')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x42eb09,'no\x20file\x20audio\x20selected');}var _0x1061a1=this[_0x8a98('0x20')]['sync'](this,_0x42eb09[_0x8a98('0x111')]);if(!_0x1061a1){return this['channel'][_0x8a98('0x2d')](_0x42eb09,_0x8a98('0x112'));}if(!this[_0x8a98('0x86')](_0x42eb09['variable_id'])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x8a98('0xd5'));}var _0x3391b8=this[_0x8a98('0x10')][_0x8a98('0x113')](_0x1061a1,_0x42eb09[_0x8a98('0x114')],_0x42eb09[_0x8a98('0x115')]);var _0x26671c=_0x3391b8[_0x8a98('0xa6')]?_0x3391b8[_0x8a98('0xa6')][_0x8a98('0x4d')]():'';logger[_0x8a98('0x31')](_0x8a98('0x116'),JSON[_0x8a98('0x74')](_0x3391b8));if(_0x3391b8['result']===-0x1){this[_0x8a98('0x38')]['sync'](this,_0x42eb09,_0x26671c);return _0x3391b8;}else if(_0x3391b8[_0x8a98('0xa8')]===_0x8a98('0x66')){_0x3391b8['result']=_0x26671c[_0x8a98('0x9e')]>=parseInt(_0x42eb09['mindigit'])?'x':'i';}else{_0x3391b8['result']=_0x26671c[_0x8a98('0x9e')]>=parseInt(_0x42eb09[_0x8a98('0x117')])&&_0x26671c[_0x8a98('0x9e')]<=parseInt(_0x42eb09[_0x8a98('0x115')])?'x':'i';}var _0x2ca9b8=this[_0x8a98('0x13')]['sync'](this,_0x42eb09[_0x8a98('0xd4')]);if(!_0x2ca9b8){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x42eb09,_0x8a98('0xd6'));}this[_0x8a98('0x10')][_0x8a98('0xa2')](_0x2ca9b8,_0x26671c);if(this[_0x8a98('0x86')](_0x42eb09['hiddendigitsnum'])){var _0x41ef8a=parseInt(_0x42eb09[_0x8a98('0x118')],0xa);var _0xbde9bc=rs[_0x8a98('0x119')]({'charset':'*','length':_0x41ef8a});var _0x5b1189=_0x26671c['length'];if(_0x5b1189>0x0){if(_0x5b1189>_0x41ef8a){this['createSquareDetailsReport']['sync'](this,_0x42eb09,_0x42eb09[_0x8a98('0x11a')]===_0x8a98('0x11b')?_0xbde9bc+_0x26671c[_0x8a98('0x11c')](_0x41ef8a):_0x26671c[_0x8a98('0x11c')](0x0,_0x5b1189-_0x41ef8a)+_0xbde9bc);}else{this['createSquareDetailsReport'][_0x8a98('0x71')](this,_0x42eb09,rs[_0x8a98('0x119')]({'charset':'*','length':_0x5b1189}));}}else{this[_0x8a98('0x38')]['sync'](this,_0x42eb09,'');}}else{this[_0x8a98('0x38')]['sync'](this,_0x42eb09,_0x26671c);}return _0x3391b8;};AGIVertices[_0x8a98('0x12')][_0x8a98('0xf')]=function(_0x23a23d){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x11d'),_0x23a23d['label']));return this[_0x8a98('0x10f')](_0x23a23d);};AGIVertices['prototype'][_0x8a98('0x11e')]=function(_0x45056b){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x11f'),_0x45056b[_0x8a98('0x39')]));this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x45056b,_0x45056b[_0x8a98('0x120')]);return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format']('GOAL\x20%s',_0x45056b[_0x8a98('0x120')]));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x121')]=function(_0x50a2f8){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x122'),_0x50a2f8['label']));if(!this[_0x8a98('0x86')](_0x50a2f8[_0x8a98('0x89')])||!this['isConfigured'](_0x50a2f8['aws_secret_access_key'])){return this['channel'][_0x8a98('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x8a98('0x86')](_0x50a2f8[_0x8a98('0x5d')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xad'));}this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x123'),_0x50a2f8['text']));var _0x45919a=this[_0x8a98('0x88')][_0x8a98('0x71')](this,_0x50a2f8);if(_0x45919a){this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x45919a));var _0x2e3b22=this[_0x8a98('0x10')][_0x8a98('0x102')](_0x45919a);try{fs['unlink'](_0x45919a+_0x8a98('0x124'));}catch(_0x58a4ca){logger[_0x8a98('0x2d')](_0x58a4ca);}return _0x2e3b22;}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x50a2f8,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x8a98('0x125')]=function(_0x14c558){logger[_0x8a98('0x31')](util[_0x8a98('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x14c558[_0x8a98('0x39')]));if(!this['isConfigured'](_0x14c558[_0x8a98('0x89')])||!this[_0x8a98('0x86')](_0x14c558[_0x8a98('0x8a')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x126'));}if(!this['isConfigured'](_0x14c558[_0x8a98('0x91')])){return this['channel'][_0x8a98('0xac')](_0x8a98('0x127'));}if(!this[_0x8a98('0x86')](_0x14c558['text'])){return this[_0x8a98('0x10')]['noop'](_0x8a98('0xad'));}this[_0x8a98('0x10')][_0x8a98('0xe6')]=!![];this['createSquareDetailsReport'](_0x14c558);this[_0x8a98('0x43')](_0x14c558[_0x8a98('0x5d')],'in','','');this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x14c558[_0x8a98('0x5d')]));var _0x3e7b5c=this[_0x8a98('0x8f')][_0x8a98('0x71')](this,_0x14c558);if(_0x3e7b5c){for(var _0x86d66d in _0x3e7b5c){if(_0x3e7b5c[_0x8a98('0x99')](_0x86d66d)&&_[_0x8a98('0x9a')](_0x3e7b5c[_0x86d66d])){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0x128'),_0x86d66d[_0x8a98('0x69')]()),_0x3e7b5c[_0x86d66d]);}}if(_[_0x8a98('0x46')](_0x3e7b5c[_0x8a98('0x78')])){return this['channel'][_0x8a98('0xac')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x8a98('0x43')](_0x3e7b5c[_0x8a98('0x78')],_0x8a98('0xf2'),_0x8a98('0x129'),'');return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x12a'),_0x3e7b5c[_0x8a98('0x78')]));}}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x14c558,_0x8a98('0x12b'));};AGIVertices[_0x8a98('0x12')]['googleasr']=function(_0xf359b){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x12c'),_0xf359b[_0x8a98('0x39')],_0xf359b[_0x8a98('0x66')]));if(!this[_0x8a98('0x86')](_0xf359b[_0x8a98('0x7b')])){return this[_0x8a98('0x10')]['noop']('no\x20key\x20configured');}var _0x42d707=_0x8a98('0x12d');var _0x53e920=util[_0x8a98('0x29')](_0x8a98('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x502148=util[_0x8a98('0x29')](_0x8a98('0xa0'),_0x53e920,_0x42d707);var _0x289e6b=!![];if(_0xf359b['beep']==='NOBEEP'){_0x289e6b=![];}var _0x14be3a=this[_0x8a98('0x10')]['recordFile'](_0x53e920,_0x42d707,_0xf359b[_0x8a98('0x12f')],_0xf359b['timeout'],undefined,_0x289e6b);if(_0x14be3a[_0x8a98('0xa6')]!==-0x1){this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x130'),_0x502148));var _0x3d7720=this[_0x8a98('0x92')][_0x8a98('0x71')](this,_0xf359b,_0x502148);if(_0x3d7720){for(var _0xddbc01 in _0x3d7720){if(_0x3d7720['hasOwnProperty'](_0xddbc01)){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')]('GOOGLE_ASR_%s',_0xddbc01[_0x8a98('0x69')]()),_0x3d7720[_0xddbc01]);}}return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x8a98('0x74')](_0x3d7720)));}}return _0x14be3a;};AGIVertices[_0x8a98('0x12')][_0x8a98('0x131')]=function(_0x117414){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x132'),_0x117414[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x117414[_0x8a98('0x94')])){return this[_0x8a98('0x10')][_0x8a98('0xac')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x117414[_0x8a98('0x95')])){return this[_0x8a98('0x10')][_0x8a98('0xac')]('no\x20appsecret\x20configured');}var _0x38fc3a=_0x8a98('0x12d');var _0x3dd7c5=util['format'](_0x8a98('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x40bde1=util[_0x8a98('0x29')]('%s.%s',_0x3dd7c5,_0x38fc3a);var _0x33b360=!![];if(_0x117414[_0x8a98('0x133')]==='NOBEEP'){_0x33b360=![];}var _0x24402e=this[_0x8a98('0x10')][_0x8a98('0x134')](_0x3dd7c5,_0x38fc3a,_0x117414[_0x8a98('0x12f')],_0x117414[_0x8a98('0x66')],undefined,_0x33b360);if(_0x24402e[_0x8a98('0xa6')]!==-0x1){this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')]('tilde\x20%s\x20file\x20created',_0x40bde1));var _0x180a8b=this['tildeASR'][_0x8a98('0x71')](this,_0x117414,_0x40bde1);if(_0x180a8b){for(var _0x529148 in _0x180a8b){if(_0x180a8b[_0x8a98('0x99')](_0x529148)){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0x135'),_0x529148[_0x8a98('0x69')]()),_0x180a8b[_0x529148]);}}return this['channel']['noop'](util[_0x8a98('0x29')](_0x8a98('0x136'),JSON[_0x8a98('0x74')](_0x180a8b)));}}return _0x24402e;};AGIVertices[_0x8a98('0x12')][_0x8a98('0x137')]=function(_0x4cb428){logger['info'](util[_0x8a98('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4cb428[_0x8a98('0x39')]));return this[_0x8a98('0x10')][_0x8a98('0x138')](_0x4cb428[_0x8a98('0x139')],_0x4cb428[_0x8a98('0x3f')],_0x4cb428[_0x8a98('0x40')]);};AGIVertices['prototype'][_0x8a98('0x13a')]=function(_0x683719){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x13b'),_0x683719['label']));if(!this[_0x8a98('0x86')](_0x683719[_0x8a98('0x13c')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x683719,_0x8a98('0x13d'));}try{var _0x2b22a3=eval(_0x683719[_0x8a98('0x13c')])?_0x8a98('0x13e'):'false';this['channel']['noop'](util['format'](_0x8a98('0x13f'),_0x683719[_0x8a98('0x13c')],_0x2b22a3));return{'code':0xc8,'result':_0x2b22a3};}catch(_0x4e7ee9){return{'code':0xc8,'result':_0x8a98('0x140')};}};AGIVertices[_0x8a98('0x12')]['gotoiftime']=function(_0xa71f4){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x141'),_0xa71f4[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0xa71f4['interval_id'])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0xa71f4,_0x8a98('0x142'));}var _0x403298=this[_0x8a98('0x143')][_0x8a98('0x71')](this,_0xa71f4[_0x8a98('0x144')]);if(!_0x403298){return this['channel'][_0x8a98('0x2d')](_0xa71f4,'no\x20intervals\x20found');}for(var _0x3fe47d=0x0;_0x3fe47d<_0x403298[_0x8a98('0x9e')];_0x3fe47d+=0x1){var _0x18bfaa=this[_0x8a98('0x10')]['getVariable'](util[_0x8a98('0x29')](_0x8a98('0x145'),_0x403298[_0x3fe47d]));if(_0x18bfaa[_0x8a98('0xa6')]===-0x1){return _0x18bfaa;}logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x146'),_0x403298[_0x3fe47d],_0x18bfaa[_0x8a98('0xa8')]));if(_0x18bfaa['extra']===_0x8a98('0x13e')){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x146'),_0x403298[_0x3fe47d],_0x8a98('0x13e')));this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x146'),_0x403298[_0x3fe47d],_0x8a98('0x13e')));return{'code':0xc8,'result':_0x8a98('0x13e')};}else{logger[_0x8a98('0x31')](util['format'](_0x8a98('0x146'),_0x403298[_0x3fe47d],_0x8a98('0x140')));this[_0x8a98('0x10')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0x403298[_0x3fe47d],'false'));}}return{'code':0xc8,'result':_0x8a98('0x140')};};AGIVertices[_0x8a98('0x12')][_0x8a98('0x147')]=function(_0x442dd5){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x148'),_0x442dd5[_0x8a98('0x39')]));return this[_0x8a98('0x10')]['hangup']();};AGIVertices[_0x8a98('0x12')]['ispeechasr']=function(_0x427d39){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x149'),_0x427d39[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x427d39[_0x8a98('0x7b')])){return this['channel'][_0x8a98('0xac')](_0x8a98('0xe5'));}var _0x87f439=_0x8a98('0x12d');var _0x16e61c=util[_0x8a98('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x8a98('0x119')](0x4));var _0x5ca3ef=util[_0x8a98('0x29')](_0x8a98('0xa0'),_0x16e61c,_0x87f439);var _0x3ec559=!![];if(_0x427d39[_0x8a98('0x133')]===_0x8a98('0x14a')){_0x3ec559=![];}var _0x433521=this[_0x8a98('0x10')][_0x8a98('0x134')](_0x16e61c,_0x87f439,_0x427d39['intKey'],_0x427d39[_0x8a98('0x66')],undefined,_0x3ec559);if(_0x433521[_0x8a98('0xa6')]!==-0x1){this['channel']['noop'](util[_0x8a98('0x29')](_0x8a98('0x14b'),_0x5ca3ef));var _0x2a2d7c=this[_0x8a98('0x85')][_0x8a98('0x71')](this,_0x427d39,_0x5ca3ef);if(_0x2a2d7c){for(var _0x8494d1 in _0x2a2d7c){if(_0x2a2d7c[_0x8a98('0x99')](_0x8494d1)){this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0x14c'),_0x8494d1[_0x8a98('0x69')]()),_0x2a2d7c[_0x8494d1]);}}return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x14d'),JSON['stringify'](_0x2a2d7c)));}}return _0x433521;};AGIVertices[_0x8a98('0x12')][_0x8a98('0x14e')]=function(_0x47cab1){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x14f'),_0x47cab1[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x47cab1[_0x8a98('0x7b')])){return this[_0x8a98('0x10')]['noop'](_0x8a98('0xe5'));}if(!this['isConfigured'](_0x47cab1[_0x8a98('0x5d')])){return this['channel'][_0x8a98('0xac')]('no\x20text\x20configured');}this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x150'),_0x47cab1[_0x8a98('0x5d')]));var _0xc015ce=this[_0x8a98('0x81')]['sync'](this,_0x47cab1);if(_0xc015ce){this['channel']['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0xc015ce));var _0x3e7a5b=this['channel'][_0x8a98('0x102')](_0xc015ce,_0x47cab1[_0x8a98('0x12f')]);try{fs[_0x8a98('0x103')](_0xc015ce+'.wav');}catch(_0xa00b20){logger[_0x8a98('0x2d')](_0xa00b20);}return _0x3e7a5b;}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x47cab1,_0x8a98('0x151'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x152')]=function(_0x3fb5bb){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x153'),_0x3fb5bb[_0x8a98('0x39')]));if(!this['isConfigured'](_0x3fb5bb['findBy'])){return this['channel']['error'](_0x3fb5bb,_0x8a98('0x154'));}logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x155'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x3fb5bb[_0x8a98('0x156')]));var _0x461869=this['agentLogin'][_0x8a98('0x71')](this,_0x3fb5bb[_0x8a98('0x156')]);if(_0x461869){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x157'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x3fb5bb[_0x8a98('0x156')]));this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x157'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x3fb5bb[_0x8a98('0x156')]));return{'code':0xc8,'result':_0x8a98('0x158')};}else{logger['info'](util[_0x8a98('0x29')](_0x8a98('0x159'),this[_0x8a98('0x10')]['callerid'],_0x3fb5bb[_0x8a98('0x156')]));this['channel']['noop'](util[_0x8a98('0x29')](_0x8a98('0x159'),this[_0x8a98('0x10')]['callerid'],_0x3fb5bb[_0x8a98('0x156')]));return{'code':0xc8,'result':_0x8a98('0x15a')};}};AGIVertices['prototype'][_0x8a98('0x15b')]=function(_0x28fb9f){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x15c'),_0x28fb9f['label']));if(!this[_0x8a98('0x86')](_0x28fb9f[_0x8a98('0x156')])){return this['channel']['error'](_0x28fb9f,'no\x20find\x20by\x20configured');}logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x155'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x28fb9f['findBy']));var _0x2d35ac=this[_0x8a98('0x54')][_0x8a98('0x71')](this,_0x28fb9f[_0x8a98('0x156')]);if(_0x2d35ac){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x157'),this[_0x8a98('0x10')]['callerid'],_0x28fb9f['findBy']));this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x157'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x28fb9f[_0x8a98('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x159'),this['channel']['callerid'],_0x28fb9f[_0x8a98('0x156')]));this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x159'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x28fb9f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x8a98('0x15d')]=function(_0x16339b){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x15e'),_0x16339b[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x16339b[_0x8a98('0x15f')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x16339b,'no\x20operation\x20configured');}this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x160'),_0x16339b[_0x8a98('0x15f')]));var _0x19c269=eval(_0x16339b[_0x8a98('0x15f')]);if(!this['isConfigured'](_0x16339b[_0x8a98('0xd4')])){return this[_0x8a98('0x10')][_0x8a98('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b6f9b=this[_0x8a98('0x13')][_0x8a98('0x71')](this,_0x16339b[_0x8a98('0xd4')]);if(!_0x3b6f9b){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x16339b,_0x8a98('0xd6'));}if(_[_0x8a98('0xa1')](_0x19c269)){var _0x5115a5=this;_0x19c269[_0x8a98('0xd7')](function(_0x4969b9,_0x5d0cc4){_0x5115a5[_0x8a98('0x10')]['setVariable'](util['format'](_0x8a98('0x161'),_0x3b6f9b,_0x5d0cc4),_0x4969b9);});return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')]('variable\x20%s[key]\x20set',_0x3b6f9b));}else{return this[_0x8a98('0x10')][_0x8a98('0xa2')](_0x3b6f9b,_0x19c269);}};AGIVertices[_0x8a98('0x12')][_0x8a98('0xe')]=function(_0x1b5f20){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x162'),_0x1b5f20[_0x8a98('0x39')]));if(_0x1b5f20[_0x8a98('0xa9')]===0x0){return this[_0x8a98('0xaa')](_0x1b5f20);}_0x1b5f20[_0x8a98('0xa9')]-=0x1;if(!this[_0x8a98('0x86')](_0x1b5f20[_0x8a98('0x111')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x1b5f20,_0x8a98('0x163'));}var _0x160da5=this[_0x8a98('0x20')][_0x8a98('0x71')](this,_0x1b5f20['file_id']);if(!_0x160da5){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x1b5f20,_0x8a98('0x112'));}var _0x4df310=this[_0x8a98('0x10')]['getData'](_0x160da5,_0x1b5f20['response'],_0x1b5f20['digit']);var _0x4d9609=_0x4df310['result'];if(_0x4df310[_0x8a98('0xa6')]===-0x1){this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x1b5f20,'-1');return _0x4df310;}else if(_0x4df310[_0x8a98('0xa8')]==='timeout'){_0x4df310[_0x8a98('0xa6')]=_0x4df310[_0x8a98('0xa6')]['length']>0x0?_0x4df310[_0x8a98('0xa6')]:'t';}else if(_[_0x8a98('0x45')](_0x4df310[_0x8a98('0xa6')])){_0x4df310[_0x8a98('0xa6')]='#';_0x4d9609='#';}if(!this[_0x8a98('0x86')](_0x1b5f20[_0x8a98('0xd4')])){this[_0x8a98('0x10')]['noop'](_0x8a98('0xd5'));}else{var _0x23772f=this[_0x8a98('0x13')][_0x8a98('0x71')](this,_0x1b5f20[_0x8a98('0xd4')]);if(!_0x23772f){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x1b5f20,_0x8a98('0xd6'));}this[_0x8a98('0x10')]['setVariable'](_0x23772f,_0x4d9609);}this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x1b5f20,_0x4d9609);return _0x4df310;};AGIVertices[_0x8a98('0x12')][_0x8a98('0xac')]=function(_0x410288){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x164'),_0x410288[_0x8a98('0x39')]));return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x410288[_0x8a98('0x165')]||_0x410288[_0x8a98('0x39')]);};AGIVertices[_0x8a98('0x12')][_0x8a98('0x166')]=function(_0x332465){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x167'),_0x332465['label']));if(!this[_0x8a98('0x86')](_0x332465['findBy'])){return this[_0x8a98('0x10')]['error'](_0x332465,_0x8a98('0x154'));}logger[_0x8a98('0x31')](util[_0x8a98('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x332465[_0x8a98('0x156')]));var _0xe8b692=this[_0x8a98('0x4f')][_0x8a98('0x71')](this,_0x332465[_0x8a98('0x168')]);var _0x27d155=this['agentPause'][_0x8a98('0x71')](this,_0x332465['findBy'],_0xe8b692);if(_0x27d155){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x157'),this['channel'][_0x8a98('0x3b')],_0x332465[_0x8a98('0x156')]));this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x157'),this[_0x8a98('0x10')]['callerid'],_0x332465[_0x8a98('0x156')]));return{'code':0xc8,'result':_0x8a98('0x158')};}else{logger[_0x8a98('0x31')](util['format'](_0x8a98('0x159'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x332465['findBy']));this['channel']['noop'](util[_0x8a98('0x29')](_0x8a98('0x157'),this['channel'][_0x8a98('0x3b')],_0x332465['findBy']));return{'code':0xc8,'result':_0x8a98('0x15a')};}};AGIVertices[_0x8a98('0x12')][_0x8a98('0x169')]=function(_0x2ac62a){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x16a'),_0x2ac62a[_0x8a98('0x39')]));if(!this['isConfigured'](_0x2ac62a['file_id'])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x2ac62a,_0x8a98('0x163'));}var _0x4752d2=this['getSound'][_0x8a98('0x71')](this,_0x2ac62a[_0x8a98('0x111')]);if(!_0x4752d2){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x2ac62a,'no\x20file\x20audio\x20found');}var _0x5dd484=this[_0x8a98('0x10')]['exec'](_0x8a98('0x16b'),[_0x4752d2,_0x2ac62a['opts']]);if(_0x5dd484[_0x8a98('0xa6')]===-0x1){return _0x5dd484;}return this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xc2'),_0x8a98('0x16b'),_0x4752d2));};AGIVertices[_0x8a98('0x12')]['queue']=function(_0x1b4093){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x16c'),_0x1b4093[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x1b4093['queue_id'])){return this[_0x8a98('0x10')]['error'](_0x1b4093,_0x8a98('0x16d'));}var _0xc4a16e='';var _0x3ae72e=parseInt(_0x1b4093[_0x8a98('0x16e')],0xa);if(isNaN(_0x3ae72e)){_0xc4a16e=_0x1b4093[_0x8a98('0x16e')];}else{_0xc4a16e=this[_0x8a98('0x17')][_0x8a98('0x71')](this,_0x1b4093['queue_id']);if(!_0xc4a16e){return this[_0x8a98('0x10')]['error'](_0x1b4093,'no\x20queue\x20found');}}var _0x369ab5='';if(this[_0x8a98('0x86')](_0x1b4093['file_id'])){var _0x25adf2=this[_0x8a98('0x20')]['sync'](this,_0x1b4093[_0x8a98('0x111')]);if(_0x25adf2){_0x369ab5=_0x25adf2;}}this[_0x8a98('0x38')][_0x8a98('0x71')](this,_0x1b4093,_0xc4a16e);if(_0x1b4093[_0x8a98('0xe2')][_0x8a98('0x16f')]('x')<0x0){_0x1b4093[_0x8a98('0xe2')]+='x';}if(_0x1b4093['opts']['indexOf']('X')<0x0){_0x1b4093[_0x8a98('0xe2')]+='X';}this[_0x8a98('0x10')]['setVariable'](_0x8a98('0x170'),_0xc4a16e?_0xc4a16e[_0x8a98('0x171')]():'');var _0x250556=this[_0x8a98('0x10')]['exec'](_0x8a98('0x172'),[_0xc4a16e,_0x1b4093[_0x8a98('0xe2')],_0x1b4093[_0x8a98('0x64')],_0x369ab5,_0x1b4093[_0x8a98('0x66')],_0x1b4093[_0x8a98('0x9')],_0x1b4093[_0x8a98('0x173')],_0x1b4093[_0x8a98('0x174')],'',_0x1b4093[_0x8a98('0x175')]]);if(_0x250556[_0x8a98('0xa6')]===-0x1){return _0x250556;}return this['channel'][_0x8a98('0xac')](util['format']('Executed\x20command\x20%s\x20%s',_0x8a98('0x172'),_0xc4a16e));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x176')]=function(_0x14345d){logger['info'](util[_0x8a98('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x14345d['label']));var _0x307b12=_0x14345d[_0x8a98('0x177')]||_0x8a98('0x12d');var _0x33833c=util['format'](_0x8a98('0x178'),this['channel']['uniqueid'],rs[_0x8a98('0x119')](0x5));var _0x1ee1d9=util[_0x8a98('0x29')](_0x8a98('0x179'),FILES_PATH,_0x33833c,_0x307b12);var _0x120752=util[_0x8a98('0x29')]('%s/recordings/%s',FILES_PATH,_0x33833c);this[_0x8a98('0x3c')]['sync'](this,_0x14345d,_0x33833c,_0x1ee1d9);this['channel'][_0x8a98('0xa2')](_0x8a98('0x17a'),_0x33833c);logger[_0x8a98('0x31')](_0x8a98('0x17b'),_0x120752,_0x307b12,_0x14345d[_0x8a98('0x17c')],_0x14345d['timeout']);return this[_0x8a98('0x10')]['recordFile'](_0x120752,_0x307b12,_0x14345d[_0x8a98('0x17c')],_0x14345d[_0x8a98('0x66')],undefined,!![]);};AGIVertices[_0x8a98('0x12')][_0x8a98('0x17d')]=function(_0x19dfb2){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x17e'),_0x19dfb2[_0x8a98('0x39')]));if(!this['isConfigured'](_0x19dfb2['url'])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x17f'));}var _0x19413f=this[_0x8a98('0x180')][_0x8a98('0x71')](this,_0x19dfb2);logger[_0x8a98('0x31')](util['format'](_0x8a98('0x181'),util[_0x8a98('0x182')](_0x19413f,{'showHidden':![],'depth':null})));if(!this[_0x8a98('0x86')](_0x19dfb2['variable_id'])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x183'));}var _0x58352a=this[_0x8a98('0x13')][_0x8a98('0x71')](this,_0x19dfb2[_0x8a98('0xd4')]);if(!_0x58352a){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x19dfb2,'no\x20variable\x20found');}this[_0x8a98('0x10')][_0x8a98('0xa2')](util[_0x8a98('0x29')](_0x8a98('0x184'),_0x58352a),_0x19413f[_0x8a98('0x76')]?_0x19413f[_0x8a98('0x76')]:_0x8a98('0x185'));this['channel']['setVariable'](util[_0x8a98('0x29')](_0x8a98('0x186'),_0x58352a),_0x19413f['statusMessage']?_0x19413f[_0x8a98('0x77')]:'OK');if(_0x19413f[_0x8a98('0x6a')]){try{this[_0x8a98('0x9f')](_0x19413f['body'],_0x58352a);}catch(_0x211a9f){logger['error'](util[_0x8a98('0x29')](_0x8a98('0x187'),_0x58352a));}}return this['channel']['noop'](util['format'](_0x8a98('0xdb'),_0x58352a));};AGIVertices[_0x8a98('0x12')]['saydigits']=function(_0x5ce9b2){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5ce9b2[_0x8a98('0x39')]));return this['channel'][_0x8a98('0x188')](_0x5ce9b2[_0x8a98('0x189')][_0x8a98('0x59')](/\s+/g,''),_0x5ce9b2[_0x8a98('0x17c')]);};AGIVertices[_0x8a98('0x12')][_0x8a98('0x18a')]=function(_0x26fc4c){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x18b'),_0x26fc4c[_0x8a98('0x39')]));return this[_0x8a98('0x10')][_0x8a98('0x18c')](_0x26fc4c[_0x8a98('0x18d')][_0x8a98('0x59')](/\s+/g,''),_0x26fc4c[_0x8a98('0x17c')]);};AGIVertices['prototype']['sayphonetic']=function(_0x1b80c3){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x18e'),_0x1b80c3['label']));return this['channel'][_0x8a98('0x18f')](_0x1b80c3[_0x8a98('0x5d')],_0x1b80c3[_0x8a98('0x17c')]);};AGIVertices[_0x8a98('0x12')][_0x8a98('0x190')]=function(_0x176575){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x191'),_0x176575['label']));if(!this[_0x8a98('0x86')](_0x176575[_0x8a98('0x192')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x193'));}var _0x2317a0=this['getMailAccount'][_0x8a98('0x71')](this,_0x176575['account_id']);if(!_0x2317a0||!_0x2317a0['Smtp']){return this['channel'][_0x8a98('0x2d')](_0x176575,'no\x20mail\x20account\x20found');}var _0x17c55b={'from':util['format'](_0x8a98('0x194'),_0x2317a0[_0x8a98('0x16')],_0x2317a0[_0x8a98('0x195')]||_0x2317a0[_0x8a98('0x196')][_0x8a98('0x197')]),'to':_0x176575['to']||'','cc':_0x176575['cc']||'','bcc':_0x176575['bcc']||'','subject':_0x176575['subject'],'html':_0x176575['text'],'text':_0x176575[_0x8a98('0x5d')]};var _0x590dfa={'tls':{'rejectUnauthorized':![]}};if(_0x2317a0['Smtp'][_0x8a98('0x198')]){_0x590dfa[_0x8a98('0x198')]=_0x2317a0[_0x8a98('0x196')][_0x8a98('0x198')];}else{_0x590dfa['host']=_0x2317a0[_0x8a98('0x196')][_0x8a98('0x199')];_0x590dfa[_0x8a98('0x19a')]=_0x2317a0[_0x8a98('0x196')]['port'];_0x590dfa[_0x8a98('0x19b')]=_0x2317a0['Smtp'][_0x8a98('0x19b')];}if(_0x2317a0[_0x8a98('0x196')][_0x8a98('0x19c')]){_0x590dfa['auth']={'user':_0x2317a0[_0x8a98('0x196')][_0x8a98('0x197')],'pass':_0x2317a0[_0x8a98('0x196')][_0x8a98('0x19d')]};}if(this['isConfigured'](_0x176575[_0x8a98('0x19e')])){}logger[_0x8a98('0xdc')](_0x8a98('0x19f'),JSON[_0x8a98('0x74')](_0x17c55b));this[_0x8a98('0x38')]['sync'](this,_0x176575,_0x176575[_0x8a98('0x192')]);this['channel'][_0x8a98('0xac')](util['format'](_0x8a98('0x1a0'),_0x2317a0['name']));this[_0x8a98('0x24')]['sync'](this,_0x590dfa,_0x17c55b);return this['channel'][_0x8a98('0xac')](_0x8a98('0x1a1'));};AGIVertices[_0x8a98('0x12')]['sendFax']=function(_0x424a76){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x1a2'),_0x424a76[_0x8a98('0x39')]));return this['channel'][_0x8a98('0xac')](_0x8a98('0x1a3'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1a4')]=function(_0x1bfe28){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x1a5'),_0x1bfe28[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x1bfe28[_0x8a98('0x1a6')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x1a7'));}var _0x1fd0d7=this[_0x8a98('0x36')][_0x8a98('0x71')](this,_0x1bfe28[_0x8a98('0x1a6')]);if(!_0x1fd0d7){return this[_0x8a98('0x10')]['error'](_0x1bfe28,_0x8a98('0x1a8'));}var _0x522a1b={'body':_0x1bfe28[_0x8a98('0x1a9')],'phone':_0x1bfe28['to']||'','SmsAccountId':_0x1fd0d7['id']};logger[_0x8a98('0xdc')]('sendSMS\x20message',JSON[_0x8a98('0x74')](_0x522a1b));this[_0x8a98('0x38')]['sync'](this,_0x1bfe28,_0x1bfe28[_0x8a98('0x1a6')]);this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1fd0d7[_0x8a98('0x16')]));this['createSmsMessage'][_0x8a98('0x71')](this,_0x522a1b);return this[_0x8a98('0x10')]['noop'](_0x8a98('0x1aa'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1ab')]=function(_0x2913d9){logger[_0x8a98('0x31')](util['format'](_0x8a98('0x1ac'),_0x2913d9[_0x8a98('0x39')]));if(!this['isConfigured'](_0x2913d9[_0x8a98('0xd4')])){return this[_0x8a98('0x10')]['error'](_0x2913d9,'no\x20variable\x20selected');}var _0x362a4e=this['getVariable'][_0x8a98('0x71')](this,_0x2913d9[_0x8a98('0xd4')]);if(!_0x362a4e){return this[_0x8a98('0x10')]['error'](_0x2913d9,_0x8a98('0xd6'));}return this[_0x8a98('0x10')][_0x8a98('0xa2')](_0x362a4e,_0x2913d9[_0x8a98('0x1ad')]);};AGIVertices['prototype']['start']=function(_0x21769b){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x1ae'),_0x21769b[_0x8a98('0x39')]));this['channel'][_0x8a98('0xac')](_0x8a98('0x1af'));if(_0x21769b['answer']===_0x8a98('0x1b0')){this[_0x8a98('0x10')]['noop'](_0x8a98('0x1b1'));return this[_0x8a98('0x10')][_0x8a98('0xbc')]();}return this[_0x8a98('0x10')][_0x8a98('0xac')]('Skipped\x20Answer');};AGIVertices[_0x8a98('0x12')]['subproject']=function(_0x5cac36){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x1b2'),_0x5cac36[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x5cac36['project_id'])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x5cac36,_0x8a98('0x1b3'));}var _0x1445ea=this['getSquareProject'][_0x8a98('0x71')](this,_0x5cac36[_0x8a98('0x1b4')]);if(!this['isConfigured'](_0x1445ea)){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x5cac36,util[_0x8a98('0x29')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5cac36[_0x8a98('0x1b4')]));}if(_0x1445ea===this['channel'][_0x8a98('0x3a')]){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x5cac36,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x5cac36,_0x1445ea);var _0x1149a0=this['channel']['exec']('AGI',util[_0x8a98('0x29')](_0x8a98('0x1b5'),config[_0x8a98('0x9')][_0x8a98('0x199')]||_0x8a98('0x1b6'),_0x1445ea,this[_0x8a98('0x10')]['arg_1']));if(_0x1149a0[_0x8a98('0xa6')]===-0x1){return _0x1149a0;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0xc2'),_0x8a98('0x1b7'),_0x1445ea));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1b8')]=function(_0x343e4e){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x1b9'),_0x343e4e[_0x8a98('0x39')]));var _0x18dcfd=this['shellCommand'][_0x8a98('0x71')](this,_0x343e4e['command']);this['createSquareDetailsReport'][_0x8a98('0x71')](this,_0x343e4e,_0x343e4e[_0x8a98('0x1ba')]);if(this[_0x8a98('0x86')](_0x343e4e[_0x8a98('0xd4')])){var _0xb374ff=this[_0x8a98('0x13')][_0x8a98('0x71')](this,_0x343e4e['variable_id']);if(_0xb374ff){this[_0x8a98('0x10')][_0x8a98('0xa2')](_0xb374ff,_0x18dcfd);return this[_0x8a98('0x10')][_0x8a98('0xac')](util['format'](_0x8a98('0x1bb'),_0x343e4e[_0x8a98('0x1ba')],_0xb374ff));}}return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x1bc'),_0x343e4e['command']));};AGIVertices['prototype'][_0x8a98('0x1bd')]=function(_0x4fca17){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x1be'),_0x4fca17[_0x8a98('0x39')]));_0x4fca17[_0x8a98('0x5d')]=_0x4fca17['text'][_0x8a98('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8a98('0x86')](_0x4fca17[_0x8a98('0x5b')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0x1bf'));}if(!this[_0x8a98('0x86')](_0x4fca17[_0x8a98('0x5d')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xad'));}this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x1c0'),_0x4fca17[_0x8a98('0x5d')]));var _0x410f92=this[_0x8a98('0x5a')][_0x8a98('0x71')](this,_0x4fca17);if(_0x410f92){this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x1c1'),_0x410f92));var _0xae83=this[_0x8a98('0x10')][_0x8a98('0x102')](_0x410f92);try{fs['unlink'](_0x410f92+_0x8a98('0x124'));}catch(_0x5ab31b){logger[_0x8a98('0x2d')](_0x5ab31b);}return _0xae83;}return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x4fca17,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x3d7ac8){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x1c2'),_0x3d7ac8[_0x8a98('0x39')]));_0x3d7ac8[_0x8a98('0x5d')]=_0x3d7ac8[_0x8a98('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8a98('0x86')](_0x3d7ac8[_0x8a98('0x5d')])){return this[_0x8a98('0x10')][_0x8a98('0xac')](_0x8a98('0xad'));}this['channel'][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x1c3'),_0x3d7ac8[_0x8a98('0x5d')]));var _0x2dd5b9=this[_0x8a98('0x62')][_0x8a98('0x71')](this,_0x3d7ac8);if(_0x2dd5b9){this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')](_0x8a98('0x1c4'),_0x2dd5b9));var _0x345d79=this[_0x8a98('0x10')]['streamFile'](_0x2dd5b9);try{fs['unlink'](_0x2dd5b9+_0x8a98('0x124'));}catch(_0x5b180a){logger[_0x8a98('0x2d')](_0x5b180a);}return _0x345d79;}return this['channel'][_0x8a98('0x2d')](_0x3d7ac8,_0x8a98('0x1c5'));};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1c6')]=function(_0x4496eb){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x1c7'),_0x4496eb[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x4496eb[_0x8a98('0x156')])){return this['channel'][_0x8a98('0x2d')](_0x4496eb,_0x8a98('0x154'));}logger[_0x8a98('0x31')](util[_0x8a98('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x4496eb[_0x8a98('0x156')]));var _0xef5216=this['agentUnpause']['sync'](this,_0x4496eb['findBy']);if(_0xef5216){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x157'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x4496eb[_0x8a98('0x156')]));this[_0x8a98('0x10')]['noop'](util[_0x8a98('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8a98('0x10')]['callerid'],_0x4496eb['findBy']));return{'code':0xc8,'result':_0x8a98('0x158')};}else{logger['info'](util[_0x8a98('0x29')](_0x8a98('0x159'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x4496eb['findBy']));this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0x159'),this[_0x8a98('0x10')][_0x8a98('0x3b')],_0x4496eb[_0x8a98('0x156')]));return{'code':0xc8,'result':_0x8a98('0x15a')};}};AGIVertices[_0x8a98('0x12')][_0x8a98('0x1c8')]=function(_0x3bc0c5){logger[_0x8a98('0x31')](util[_0x8a98('0x29')](_0x8a98('0x1c9'),_0x3bc0c5[_0x8a98('0x39')]));var _0x36f029=this[_0x8a98('0x10')][_0x8a98('0xae')]('VOICEMAIL',[_0x3bc0c5[_0x8a98('0x1ca')],_0x3bc0c5[_0x8a98('0x79')]]);if(_0x36f029['result']===-0x1){return _0x36f029;}return this[_0x8a98('0x10')][_0x8a98('0xac')](util[_0x8a98('0x29')](_0x8a98('0xc2'),'VOICEMAIL',_0x3bc0c5[_0x8a98('0x1ca')]));};AGIVertices[_0x8a98('0x12')]['vswitch']=function(_0x48c5eb){logger['info'](util[_0x8a98('0x29')](_0x8a98('0x1cb'),_0x48c5eb[_0x8a98('0x39')]));if(!this[_0x8a98('0x86')](_0x48c5eb[_0x8a98('0xd4')])){return this[_0x8a98('0x10')][_0x8a98('0x2d')](_0x48c5eb,_0x8a98('0x1cc'));}var _0x44e83d=this[_0x8a98('0x13')][_0x8a98('0x71')](this,_0x48c5eb[_0x8a98('0xd4')]);if(!_0x44e83d){return this['channel'][_0x8a98('0x2d')](_0x48c5eb,_0x8a98('0xd6'));}var _0x1fb71c=this[_0x8a98('0x10')]['getVariable'](_0x44e83d);return{'code':0xc8,'result':_0x1fb71c['extra']?_0x1fb71c[_0x8a98('0xa8')]:'-'};};String[_0x8a98('0x12')][_0x8a98('0xa4')]=function(_0x484d11,_0x1a9b25){return this[_0x8a98('0xa3')](_0x484d11)[_0x8a98('0x1cd')](_0x1a9b25);};module[_0x8a98('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 5d9e763..de54b89 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 _0xeed5=['blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','isNil','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','all','Auto-Pause','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','channels','hanguprequest','bind','syncHangup','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x5845f2,_0x3f30da){var _0x37c59a=function(_0xc8e082){while(--_0xc8e082){_0x5845f2['push'](_0x5845f2['shift']());}};_0x37c59a(++_0x3f30da);}(_0xeed5,0x136));var _0x5eed=function(_0x205258,_0x443ab3){_0x205258=_0x205258-0x0;var _0x2d1cc3=_0xeed5[_0x205258];return _0x2d1cc3;};'use strict';var util=require('util');var _=require(_0x5eed('0x0'));var moment=require(_0x5eed('0x1'));var ami=require(_0x5eed('0x2'));var logger=require('../../../config/logger')(_0x5eed('0x3'));var RpcUser=require(_0x5eed('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x44e248){this[_0x5eed('0x5')]=_0x44e248[_0x5eed('0x5')];this['agents']=_0x44e248[_0x5eed('0x6')];this['timers']=_0x44e248[_0x5eed('0x7')];this[_0x5eed('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x5eed('0x9'),this['syncHangupRequest'][_0x5eed('0xa')](this));ami['on']('hangup',this[_0x5eed('0xb')][_0x5eed('0xa')](this));ami['on']('agentringnoanswer',this[_0x5eed('0xc')][_0x5eed('0xa')](this));ami['on'](_0x5eed('0xd'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x5eed('0xe'),this[_0x5eed('0xf')][_0x5eed('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x5eed('0x10')][_0x5eed('0xa')](this));}function getDiff(_0x2b67db){var _0x8f9606=moment()[_0x5eed('0x11')](0x0);var _0x450286=moment(_0x2b67db)[_0x5eed('0x11')](0x0);return _0x8f9606['diff'](_0x450286,_0x5eed('0x12'));}Acw['prototype'][_0x5eed('0x13')]=function(_0x4986c6){try{var _0x130ee4=this;var _0x4d78ce=this[_0x5eed('0x8')][_0x4986c6][_0x5eed('0x14')];var _0x4338a4=this['channels'][_0x4986c6][_0x5eed('0x15')];var _0x39a3ad=this[_0x5eed('0x5')][_0x4338a4];var _0x16c2be=![];var _0x2c60ed=_0x5eed('0x16');if(_0x39a3ad[_0x5eed('0x17')]){if(_0x39a3ad[_0x5eed('0x18')]['name']){_0x16c2be=!![];_0x2c60ed=_0x39a3ad[_0x5eed('0x18')][_0x5eed('0x19')];}}ami[_0x5eed('0x1a')]({'action':_0x5eed('0x1b'),'interface':_0x4d78ce,'paused':!![],'reason':_0x2c60ed})['then'](function(_0x368b0d){if(_0x130ee4[_0x5eed('0x6')][_0x4d78ce]){return RpcUser[_0x5eed('0x1c')](_0x130ee4['agents'][_0x4d78ce]['id'])[_0x5eed('0x1d')](function(_0x1253d9){if(_0x1253d9&&!_0x1253d9['voicePause']){logger[_0x5eed('0x1e')](_0x5eed('0x1f'),_0x4986c6,_0x4d78ce,_0x4338a4);var _0x2e4c19=_0x130ee4[_0x5eed('0x8')][_0x4986c6]['attended']&&_0x130ee4[_0x5eed('0x8')][_0x4986c6]['destlinkedid']?_0x130ee4[_0x5eed('0x8')][_0x4986c6][_0x5eed('0x20')]:_0x4986c6;return RpcUser[_0x5eed('0x21')](_0x130ee4['agents'][_0x4d78ce],_0x2c60ed,_0x2e4c19)[_0x5eed('0x1d')](function(_0x195fb6){if(!_0x16c2be){_0x130ee4['timers'][_0x4d78ce]={};logger[_0x5eed('0x1e')](_0x5eed('0x22'),_0x4986c6,_0x130ee4[_0x5eed('0x5')][_0x4338a4][_0x5eed('0x23')],_0x4d78ce,_0x4338a4);_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x24')]=setTimeout(_0x130ee4[_0x5eed('0x25')][_0x5eed('0xa')](_0x130ee4,_0x4d78ce),_0x130ee4[_0x5eed('0x5')][_0x4338a4][_0x5eed('0x23')]*0x3e8);_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x26')]=moment()['format'](_0x5eed('0x27'));_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x28')]=_0x4986c6;_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x15')]=_0x4338a4;_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x29')]=function(){var _0x46f01a=getDiff(_0x130ee4[_0x5eed('0x7')][_0x4d78ce]['lastPauseAt']);clearTimeout(_0x130ee4['timers'][_0x4d78ce][_0x5eed('0x24')]);_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x24')]=![];RpcVoiceAgentReport[_0x5eed('0x2a')]({'acwtime':_0x46f01a},_0x130ee4[_0x5eed('0x7')][_0x4d78ce][_0x5eed('0x28')],_0x4d78ce)[_0x5eed('0x1d')](function(_0x6bf4af){logger['info'](_0x5eed('0x2b'),_0x4986c6,_0x46f01a,_0x6bf4af);})['catch'](function(_0x578a85){logger[_0x5eed('0x2c')](_0x5eed('0x2d'),_0x4986c6,_0x578a85);});delete _0x130ee4[_0x5eed('0x7')][_0x4d78ce];};}});}else{logger['info'](_0x5eed('0x2e'),_0x4986c6,_0x4d78ce,_0x4338a4);}});}})[_0x5eed('0x2f')](function(_0x3ced64){logger[_0x5eed('0x2c')](_0x5eed('0x22'),_0x4986c6,_0x130ee4['voiceQueues'][_0x4338a4]['acwTimeout'],_0x4d78ce,_0x4338a4);})[_0x5eed('0x30')](function(){delete _0x130ee4[_0x5eed('0x8')][_0x4986c6];});}catch(_0x353584){logger[_0x5eed('0x2c')](_0x5eed('0x31'),_0x353584[_0x5eed('0x32')]);}};Acw[_0x5eed('0x33')][_0x5eed('0x25')]=function(_0x1fc8f4){try{var _0x40666d=this;if(_0x40666d[_0x5eed('0x7')][_0x1fc8f4]){_0x40666d['timers'][_0x1fc8f4][_0x5eed('0x24')]=![];var _0x4e38fb=_0x40666d[_0x5eed('0x7')][_0x1fc8f4]['uniqueid'];var _0xbb7f1b=_0x40666d['timers'][_0x1fc8f4]['queue'];var _0x1fa93b=_0x40666d[_0x5eed('0x5')][_0xbb7f1b][_0x5eed('0x23')];logger[_0x5eed('0x1e')](_0x5eed('0x34'),_0x4e38fb,_0x1fc8f4);RpcUser[_0x5eed('0x35')](this['agents'][_0x1fc8f4]);RpcVoiceAgentReport['update']({'acwtime':_0x1fa93b,'agentacw':!![]},_0x4e38fb,_0x1fc8f4)[_0x5eed('0x1d')](function(_0x1416d4){logger[_0x5eed('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x4e38fb,_0x1fa93b,_0x1416d4);})[_0x5eed('0x2f')](function(_0x3d5982){logger[_0x5eed('0x2c')](_0x5eed('0x2d'),_0x4e38fb,_0x3d5982);});}else{logger[_0x5eed('0x2c')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1fc8f4);if(_0x40666d['timers']){logger[_0x5eed('0x1e')](_0x5eed('0x36'),JSON['stringify'](_0x40666d[_0x5eed('0x7')]));}}}catch(_0x35b704){logger[_0x5eed('0x2c')](_0x5eed('0x37'),_0x35b704[_0x5eed('0x32')]);}};Acw[_0x5eed('0x33')][_0x5eed('0x38')]=function(_0x4d58b5){try{if(this['voiceQueues'][_0x4d58b5['queue']]&&(this[_0x5eed('0x5')][_0x4d58b5[_0x5eed('0x15')]]['acw']||this[_0x5eed('0x5')][_0x4d58b5['queue']][_0x5eed('0x17')])){if(this[_0x5eed('0x6')][_0x4d58b5[_0x5eed('0x14')]]){this[_0x5eed('0x8')][_0x4d58b5[_0x5eed('0x28')]]={'queue':_0x4d58b5[_0x5eed('0x15')],'interface':_0x4d58b5[_0x5eed('0x14')],'destlinkedid':_0x4d58b5[_0x5eed('0x20')]};}}}catch(_0x252e1b){logger[_0x5eed('0x2c')](_0x5eed('0x39'),_0x252e1b['message']);}};Acw[_0x5eed('0x33')][_0x5eed('0x10')]=function(_0x4bc785){try{if(this[_0x5eed('0x5')][_0x4bc785[_0x5eed('0x15')]]&&(this[_0x5eed('0x5')][_0x4bc785[_0x5eed('0x15')]][_0x5eed('0x3')]||this[_0x5eed('0x5')][_0x4bc785[_0x5eed('0x15')]]['mandatoryDisposition'])){if(this[_0x5eed('0x6')][_0x4bc785[_0x5eed('0x14')]]){this[_0x5eed('0x8')][_0x4bc785[_0x5eed('0x28')]]={'queue':_0x4bc785[_0x5eed('0x15')],'interface':_0x4bc785['interface']};}}}catch(_0x48f10a){logger[_0x5eed('0x2c')](_0x5eed('0x3a'),_0x48f10a[_0x5eed('0x32')]);}};Acw[_0x5eed('0x33')][_0x5eed('0x3b')]=function(_0x3b4ff2){try{if(this[_0x5eed('0x8')][_0x3b4ff2['uniqueid']]&&_[_0x5eed('0x3c')](this[_0x5eed('0x8')][_0x3b4ff2['uniqueid']][_0x5eed('0x3d')])){logger[_0x5eed('0x1e')](_0x5eed('0x3e'),_0x3b4ff2[_0x5eed('0x28')]);this[_0x5eed('0x13')](_0x3b4ff2[_0x5eed('0x28')]);}else if(this[_0x5eed('0x8')][_0x3b4ff2[_0x5eed('0x3f')]]&&_['isUndefined'](this[_0x5eed('0x8')][_0x3b4ff2[_0x5eed('0x3f')]]['attended'])){logger[_0x5eed('0x1e')](_0x5eed('0x40'),_0x3b4ff2[_0x5eed('0x3f')]);this[_0x5eed('0x13')](_0x3b4ff2[_0x5eed('0x3f')]);}}catch(_0x28cb2f){logger[_0x5eed('0x2c')](_0x5eed('0x41'),_0x28cb2f['message']);}};Acw[_0x5eed('0x33')][_0x5eed('0xb')]=function(_0x49c33e){try{if(this[_0x5eed('0x8')][_0x49c33e['uniqueid']]&&this[_0x5eed('0x8')][_0x49c33e[_0x5eed('0x28')]][_0x5eed('0x3d')]){logger[_0x5eed('0x1e')](_0x5eed('0x42'),_0x49c33e[_0x5eed('0x28')]);this[_0x5eed('0x13')](_0x49c33e[_0x5eed('0x28')]);}else if(this[_0x5eed('0x8')][_0x49c33e[_0x5eed('0x3f')]]&&this[_0x5eed('0x8')][_0x49c33e[_0x5eed('0x3f')]][_0x5eed('0x3d')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x49c33e[_0x5eed('0x3f')]);this['startAcw'](_0x49c33e[_0x5eed('0x3f')]);}}catch(_0xcffe22){logger[_0x5eed('0x2c')]('[ACW][syncHangup]\x20%s',_0xcffe22[_0x5eed('0x32')]);}};Acw[_0x5eed('0x33')][_0x5eed('0x43')]=function(_0x2c1841){try{if(!_[_0x5eed('0x44')](this[_0x5eed('0x8')][_0x2c1841['transfereeuniqueid']])){this[_0x5eed('0x13')](_0x2c1841['transfereeuniqueid']);if(this[_0x5eed('0x8')][_0x2c1841['secondtransfereruniqueid']]){this['channels'][_0x2c1841['secondtransfereruniqueid']][_0x5eed('0x3d')]=!![];this[_0x5eed('0x8')][_0x2c1841[_0x5eed('0x45')]]=this[_0x5eed('0x8')][_0x2c1841[_0x5eed('0x46')]];delete this[_0x5eed('0x8')][_0x2c1841[_0x5eed('0x46')]];}}else if(!_[_0x5eed('0x44')](this['channels'][_0x2c1841[_0x5eed('0x45')]])){this['startAcw'](_0x2c1841[_0x5eed('0x45')]);if(this[_0x5eed('0x8')][_0x2c1841['origtransfereruniqueid']]){this['channels'][_0x2c1841[_0x5eed('0x47')]][_0x5eed('0x3d')]=!![];this[_0x5eed('0x8')][_0x2c1841[_0x5eed('0x48')]]=this['channels'][_0x2c1841['origtransfereruniqueid']];delete this[_0x5eed('0x8')][_0x2c1841['origtransfereruniqueid']];}}}catch(_0x4408c7){logger[_0x5eed('0x2c')](_0x5eed('0x49'),_0x4408c7[_0x5eed('0x32')]);}};Acw[_0x5eed('0x33')][_0x5eed('0xf')]=function(_0x3e9972){try{if(this['channels'][_0x3e9972[_0x5eed('0x4a')]]){logger[_0x5eed('0x1e')](_0x5eed('0x4b'),JSON['stringify'](_0x3e9972[_0x5eed('0x4a')]));this[_0x5eed('0x13')](_0x3e9972['transfereruniqueid']);}else if(this['channels'][_0x3e9972[_0x5eed('0x4c')]]){logger[_0x5eed('0x1e')](_0x5eed('0x4d'),JSON[_0x5eed('0x4e')](_0x3e9972[_0x5eed('0x4c')]));this[_0x5eed('0x13')](_0x3e9972[_0x5eed('0x4c')]);}}catch(_0x1926a2){logger[_0x5eed('0x2c')]('[ACW][syncBlindTransfer]\x20%s',_0x1926a2['message']);}};Acw[_0x5eed('0x33')][_0x5eed('0xc')]=function(_0x16f828){try{if(this[_0x5eed('0x5')][_0x16f828[_0x5eed('0x15')]]&&this['voiceQueues'][_0x16f828['queue']]['autopause']===_0x5eed('0x4f')){if(this['agents'][_0x16f828['interface']]){logger[_0x5eed('0x1e')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x16f828[_0x5eed('0x28')],_0x16f828['interface'],_0x16f828['queue']);return RpcUser[_0x5eed('0x21')](this[_0x5eed('0x6')][_0x16f828[_0x5eed('0x14')]],_0x5eed('0x50'),_0x16f828[_0x5eed('0x28')]);}}}catch(_0x309605){logger[_0x5eed('0x2c')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x309605[_0x5eed('0x32')]);}};module['exports']=Acw; \ No newline at end of file +var _0xa7de=['[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','../ami','../../../config/logger','acw','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','[%s][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','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa7de,0xb0));var _0xea7d=function(_0x5f29d4,_0xe8207c){_0x5f29d4=_0x5f29d4-0x0;var _0x2789b6=_0xa7de[_0x5f29d4];return _0x2789b6;};'use strict';var util=require(_0xea7d('0x0'));var _=require(_0xea7d('0x1'));var moment=require('moment');var ami=require(_0xea7d('0x2'));var logger=require(_0xea7d('0x3'))(_0xea7d('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4dd80a){this[_0xea7d('0x5')]=_0x4dd80a[_0xea7d('0x5')];this[_0xea7d('0x6')]=_0x4dd80a[_0xea7d('0x6')];this[_0xea7d('0x7')]=_0x4dd80a['timers'];this['channels']={};ami['on'](_0xea7d('0x8'),this[_0xea7d('0x9')][_0xea7d('0xa')](this));ami['on'](_0xea7d('0xb'),this['syncHangupRequest'][_0xea7d('0xa')](this));ami['on'](_0xea7d('0xc'),this['syncHangup'][_0xea7d('0xa')](this));ami['on'](_0xea7d('0xd'),this[_0xea7d('0xe')][_0xea7d('0xa')](this));ami['on'](_0xea7d('0xf'),this[_0xea7d('0x10')][_0xea7d('0xa')](this));ami['on']('blindtransfer',this[_0xea7d('0x11')][_0xea7d('0xa')](this));ami['on'](_0xea7d('0x12'),this[_0xea7d('0x13')]['bind'](this));}function getDiff(_0xb3b111){var _0x37fede=moment()[_0xea7d('0x14')](0x0);var _0x2f51ee=moment(_0xb3b111)['milliseconds'](0x0);return _0x37fede['diff'](_0x2f51ee,_0xea7d('0x15'));}Acw[_0xea7d('0x16')][_0xea7d('0x17')]=function(_0x32b380){try{var _0x48cc58=this;var _0x14e82d=this['channels'][_0x32b380][_0xea7d('0x18')];var _0x40d41=this[_0xea7d('0x19')][_0x32b380][_0xea7d('0x1a')];var _0x231a4d=this[_0xea7d('0x5')][_0x40d41];var _0x27c964=![];var _0x1919f5=_0xea7d('0x1b');if(_0x231a4d[_0xea7d('0x1c')]){if(_0x231a4d[_0xea7d('0x1d')][_0xea7d('0x1e')]){_0x27c964=!![];_0x1919f5=_0x231a4d[_0xea7d('0x1d')][_0xea7d('0x1e')];}}ami[_0xea7d('0x1f')]({'action':_0xea7d('0x20'),'interface':_0x14e82d,'paused':!![],'reason':_0x1919f5})[_0xea7d('0x21')](function(_0x247ae1){if(_0x48cc58[_0xea7d('0x6')][_0x14e82d]){return RpcUser[_0xea7d('0x22')](_0x48cc58[_0xea7d('0x6')][_0x14e82d]['id'])[_0xea7d('0x21')](function(_0x5ddfa5){if(_0x5ddfa5&&!_0x5ddfa5[_0xea7d('0x23')]){logger[_0xea7d('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x32b380,_0x14e82d,_0x40d41);var _0x413b41=_0x48cc58['channels'][_0x32b380][_0xea7d('0x25')]&&_0x48cc58['channels'][_0x32b380][_0xea7d('0x26')]?_0x48cc58[_0xea7d('0x19')][_0x32b380]['destlinkedid']:_0x32b380;return RpcUser[_0xea7d('0x27')](_0x48cc58[_0xea7d('0x6')][_0x14e82d],_0x1919f5,_0x413b41)['then'](function(_0x2abc67){if(!_0x27c964){_0x48cc58[_0xea7d('0x7')][_0x14e82d]={};logger[_0xea7d('0x24')](_0xea7d('0x28'),_0x32b380,_0x48cc58[_0xea7d('0x5')][_0x40d41]['acwTimeout'],_0x14e82d,_0x40d41);_0x48cc58[_0xea7d('0x7')][_0x14e82d][_0xea7d('0x29')]=setTimeout(_0x48cc58[_0xea7d('0x2a')][_0xea7d('0xa')](_0x48cc58,_0x14e82d),_0x48cc58[_0xea7d('0x5')][_0x40d41][_0xea7d('0x2b')]*0x3e8);_0x48cc58['timers'][_0x14e82d][_0xea7d('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x48cc58[_0xea7d('0x7')][_0x14e82d][_0xea7d('0x2d')]=_0x32b380;_0x48cc58[_0xea7d('0x7')][_0x14e82d][_0xea7d('0x1a')]=_0x40d41;_0x48cc58['timers'][_0x14e82d][_0xea7d('0x2e')]=function(){var _0x2fc9da=getDiff(_0x48cc58['timers'][_0x14e82d]['lastPauseAt']);clearTimeout(_0x48cc58[_0xea7d('0x7')][_0x14e82d][_0xea7d('0x29')]);_0x48cc58[_0xea7d('0x7')][_0x14e82d][_0xea7d('0x29')]=![];RpcVoiceAgentReport[_0xea7d('0x2f')]({'acwtime':_0x2fc9da},_0x48cc58['timers'][_0x14e82d][_0xea7d('0x2d')],_0x14e82d)[_0xea7d('0x21')](function(_0x2c740f){logger['info'](_0xea7d('0x30'),_0x32b380,_0x2fc9da,_0x2c740f);})[_0xea7d('0x31')](function(_0xefc96c){logger['error'](_0xea7d('0x32'),_0x32b380,_0xefc96c);});delete _0x48cc58[_0xea7d('0x7')][_0x14e82d];};}});}else{logger[_0xea7d('0x24')](_0xea7d('0x33'),_0x32b380,_0x14e82d,_0x40d41);}});}})[_0xea7d('0x31')](function(_0x3f6ba2){logger[_0xea7d('0x34')](_0xea7d('0x28'),_0x32b380,_0x48cc58[_0xea7d('0x5')][_0x40d41]['acwTimeout'],_0x14e82d,_0x40d41);})['finally'](function(){delete _0x48cc58[_0xea7d('0x19')][_0x32b380];});}catch(_0x2b9c9e){logger[_0xea7d('0x34')](_0xea7d('0x35'),_0x2b9c9e[_0xea7d('0x36')]);}};Acw[_0xea7d('0x16')][_0xea7d('0x2a')]=function(_0x3797f3){try{var _0x2514f1=this;if(_0x2514f1['timers'][_0x3797f3]){_0x2514f1[_0xea7d('0x7')][_0x3797f3][_0xea7d('0x29')]=![];var _0x558c92=_0x2514f1[_0xea7d('0x7')][_0x3797f3][_0xea7d('0x2d')];var _0x653e6a=_0x2514f1[_0xea7d('0x7')][_0x3797f3][_0xea7d('0x1a')];var _0x4fd282=_0x2514f1[_0xea7d('0x5')][_0x653e6a][_0xea7d('0x2b')];logger['info'](_0xea7d('0x37'),_0x558c92,_0x3797f3);RpcUser[_0xea7d('0x38')](this['agents'][_0x3797f3]);RpcVoiceAgentReport[_0xea7d('0x2f')]({'acwtime':_0x4fd282,'agentacw':!![]},_0x558c92,_0x3797f3)[_0xea7d('0x21')](function(_0x3a7dc1){logger[_0xea7d('0x24')](_0xea7d('0x30'),_0x558c92,_0x4fd282,_0x3a7dc1);})['catch'](function(_0x2bfd3c){logger[_0xea7d('0x34')](_0xea7d('0x32'),_0x558c92,_0x2bfd3c);});}else{logger[_0xea7d('0x34')](_0xea7d('0x39'),_0x3797f3);if(_0x2514f1['timers']){logger[_0xea7d('0x24')](_0xea7d('0x3a'),JSON[_0xea7d('0x3b')](_0x2514f1['timers']));}}}catch(_0xc7804c){logger[_0xea7d('0x34')](_0xea7d('0x3c'),_0xc7804c[_0xea7d('0x36')]);}};Acw['prototype'][_0xea7d('0x9')]=function(_0x345bbc){try{if(this[_0xea7d('0x5')][_0x345bbc['queue']]&&(this[_0xea7d('0x5')][_0x345bbc[_0xea7d('0x1a')]][_0xea7d('0x4')]||this['voiceQueues'][_0x345bbc[_0xea7d('0x1a')]][_0xea7d('0x1c')])){if(this[_0xea7d('0x6')][_0x345bbc[_0xea7d('0x18')]]){this[_0xea7d('0x19')][_0x345bbc[_0xea7d('0x2d')]]={'queue':_0x345bbc[_0xea7d('0x1a')],'interface':_0x345bbc[_0xea7d('0x18')],'destlinkedid':_0x345bbc[_0xea7d('0x26')]};}}}catch(_0x39bc1b){logger['error'](_0xea7d('0x3d'),_0x39bc1b['message']);}};Acw[_0xea7d('0x16')]['syncAgentConnectPreview']=function(_0xefe8b5){try{if(this['voiceQueues'][_0xefe8b5[_0xea7d('0x1a')]]&&(this['voiceQueues'][_0xefe8b5[_0xea7d('0x1a')]][_0xea7d('0x4')]||this[_0xea7d('0x5')][_0xefe8b5[_0xea7d('0x1a')]][_0xea7d('0x1c')])){if(this[_0xea7d('0x6')][_0xefe8b5[_0xea7d('0x18')]]){this[_0xea7d('0x19')][_0xefe8b5[_0xea7d('0x2d')]]={'queue':_0xefe8b5[_0xea7d('0x1a')],'interface':_0xefe8b5[_0xea7d('0x18')]};}}}catch(_0x18fcf8){logger[_0xea7d('0x34')](_0xea7d('0x3e'),_0x18fcf8[_0xea7d('0x36')]);}};Acw[_0xea7d('0x16')][_0xea7d('0x3f')]=function(_0x57a897){try{if(this[_0xea7d('0x19')][_0x57a897['uniqueid']]&&_[_0xea7d('0x40')](this[_0xea7d('0x19')][_0x57a897[_0xea7d('0x2d')]][_0xea7d('0x25')])){logger[_0xea7d('0x24')](_0xea7d('0x41'),_0x57a897[_0xea7d('0x2d')]);this[_0xea7d('0x17')](_0x57a897['uniqueid']);}else if(this[_0xea7d('0x19')][_0x57a897[_0xea7d('0x42')]]&&_[_0xea7d('0x40')](this[_0xea7d('0x19')][_0x57a897[_0xea7d('0x42')]][_0xea7d('0x25')])){logger['info'](_0xea7d('0x43'),_0x57a897[_0xea7d('0x42')]);this[_0xea7d('0x17')](_0x57a897['linkedid']);}}catch(_0x12fb49){logger[_0xea7d('0x34')](_0xea7d('0x44'),_0x12fb49['message']);}};Acw['prototype'][_0xea7d('0x45')]=function(_0x16c27e){try{if(this[_0xea7d('0x19')][_0x16c27e['uniqueid']]&&this[_0xea7d('0x19')][_0x16c27e[_0xea7d('0x2d')]][_0xea7d('0x25')]){logger['info'](_0xea7d('0x46'),_0x16c27e[_0xea7d('0x2d')]);this[_0xea7d('0x17')](_0x16c27e[_0xea7d('0x2d')]);}else if(this['channels'][_0x16c27e['linkedid']]&&this['channels'][_0x16c27e[_0xea7d('0x42')]][_0xea7d('0x25')]){logger[_0xea7d('0x24')](_0xea7d('0x47'),_0x16c27e[_0xea7d('0x42')]);this['startAcw'](_0x16c27e[_0xea7d('0x42')]);}}catch(_0x44f52e){logger[_0xea7d('0x34')]('[ACW][syncHangup]\x20%s',_0x44f52e[_0xea7d('0x36')]);}};Acw[_0xea7d('0x16')]['syncAttendedTransfer']=function(_0x5c840e){try{if(!_[_0xea7d('0x48')](this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x49')]])){this[_0xea7d('0x17')](_0x5c840e[_0xea7d('0x49')]);if(this[_0xea7d('0x19')][_0x5c840e['secondtransfereruniqueid']]){this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x4a')]]['attended']=!![];this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x4b')]]=this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x4a')]];delete this['channels'][_0x5c840e[_0xea7d('0x4a')]];}}else if(!_[_0xea7d('0x48')](this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x4b')]])){this[_0xea7d('0x17')](_0x5c840e[_0xea7d('0x4b')]);if(this[_0xea7d('0x19')][_0x5c840e['origtransfereruniqueid']]){this[_0xea7d('0x19')][_0x5c840e['origtransfereruniqueid']]['attended']=!![];this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x49')]]=this[_0xea7d('0x19')][_0x5c840e['origtransfereruniqueid']];delete this[_0xea7d('0x19')][_0x5c840e[_0xea7d('0x4c')]];}}}catch(_0xb60b48){logger[_0xea7d('0x34')](_0xea7d('0x4d'),_0xb60b48['message']);}};Acw[_0xea7d('0x16')]['syncBlindTransfer']=function(_0x57092e){try{if(this[_0xea7d('0x19')][_0x57092e[_0xea7d('0x4e')]]){logger[_0xea7d('0x24')](_0xea7d('0x4f'),JSON['stringify'](_0x57092e[_0xea7d('0x4e')]));this['startAcw'](_0x57092e['transfereruniqueid']);}else if(this[_0xea7d('0x19')][_0x57092e[_0xea7d('0x50')]]){logger['info'](_0xea7d('0x51'),JSON[_0xea7d('0x3b')](_0x57092e['transfererlinkedid']));this[_0xea7d('0x17')](_0x57092e[_0xea7d('0x50')]);}}catch(_0x583372){logger[_0xea7d('0x34')](_0xea7d('0x52'),_0x583372[_0xea7d('0x36')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x9ddca0){try{if(this[_0xea7d('0x5')][_0x9ddca0[_0xea7d('0x1a')]]&&this[_0xea7d('0x5')][_0x9ddca0[_0xea7d('0x1a')]][_0xea7d('0x53')]===_0xea7d('0x54')){if(this[_0xea7d('0x6')][_0x9ddca0[_0xea7d('0x18')]]){logger[_0xea7d('0x24')](_0xea7d('0x55'),_0x9ddca0[_0xea7d('0x2d')],_0x9ddca0['interface'],_0x9ddca0[_0xea7d('0x1a')]);return RpcUser[_0xea7d('0x27')](this[_0xea7d('0x6')][_0x9ddca0['interface']],_0xea7d('0x56'),_0x9ddca0[_0xea7d('0x2d')]);}}}catch(_0xa0716e){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0xa0716e[_0xea7d('0x36')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3908f83..d63628c 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 _0x7e58=['moment','ami','port','asterisk','keepConnected','Action','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','error','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionSipShowRegistry','then','catch','log','asterisk-manager','bluebird'];(function(_0x12cd43,_0x4668ae){var _0xcb0277=function(_0x51176c){while(--_0x51176c){_0x12cd43['push'](_0x12cd43['shift']());}};_0xcb0277(++_0x4668ae);}(_0x7e58,0xf3));var _0x87e5=function(_0x29eab1,_0x239afc){_0x29eab1=_0x29eab1-0x0;var _0x32b613=_0x7e58[_0x29eab1];return _0x32b613;};'use strict';var Manager=require(_0x87e5('0x0'));var BPromise=require(_0x87e5('0x1'));var moment=require(_0x87e5('0x2'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0x87e5('0x3'));var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x87e5('0x4')],config[_0x87e5('0x5')]['ip'],config[_0x87e5('0x5')]['username'],config[_0x87e5('0x5')]['password'],!![]);ami[_0x87e5('0x6')]();ami[_0x87e5('0x7')]=BPromise['promisify'](ami[_0x87e5('0x8')]);function error(_0x3102c4){logger['error'](util[_0x87e5('0x9')](_0x87e5('0xa'),config[_0x87e5('0x5')][_0x87e5('0xb')],config['asterisk']['ip'],config['asterisk']['port'],util[_0x87e5('0xc')](_0x3102c4,![],null)));}function close(){logger['error'](util[_0x87e5('0x9')](_0x87e5('0xd'),config[_0x87e5('0x5')][_0x87e5('0xb')],config[_0x87e5('0x5')]['ip'],config[_0x87e5('0x5')][_0x87e5('0x4')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x87e5('0x7')]({'action':_0x87e5('0xe')});};};ami[_0x87e5('0xf')]=function(){return function(){return ami[_0x87e5('0x7')]({'action':_0x87e5('0x10')});};};ami[_0x87e5('0x11')]=function(){return function(){return ami['Action']({'action':_0x87e5('0x12')});};};ami[_0x87e5('0x13')]=function(){return function(){return ami['Action']({'action':_0x87e5('0x14')});};};ami[_0x87e5('0x15')]=function(){return function(){return ami['Action']({'action':_0x87e5('0x16')});};};function connect(_0x5f3aea){logger[_0x87e5('0x17')](util[_0x87e5('0x9')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x87e5('0xb')],config[_0x87e5('0x5')]['ip'],config[_0x87e5('0x5')][_0x87e5('0x4')]));ami[_0x87e5('0x18')](_0x87e5('0x19'),error);ami[_0x87e5('0x18')](_0x87e5('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x87e5('0x1b'),function(_0x1c40a7){logger[_0x87e5('0x17')](util['format'](_0x87e5('0x1c'),config[_0x87e5('0x5')][_0x87e5('0xb')],config['asterisk']['ip'],config[_0x87e5('0x5')][_0x87e5('0x4')],util[_0x87e5('0xc')](_0x1c40a7,![],null)));});ami['on'](_0x87e5('0x1d'),function(_0x552cf5){logger[_0x87e5('0x17')](util[_0x87e5('0x9')](_0x87e5('0x1e'),config[_0x87e5('0x5')][_0x87e5('0xb')],config[_0x87e5('0x5')]['ip'],config[_0x87e5('0x5')][_0x87e5('0x4')]));return BPromise['resolve']()['then'](ami[_0x87e5('0x1f')]())[_0x87e5('0x20')](ami[_0x87e5('0xf')]())['then'](ami[_0x87e5('0x11')]())[_0x87e5('0x20')](ami['actionQueueSummary']())[_0x87e5('0x20')](ami[_0x87e5('0x15')]())[_0x87e5('0x21')](function(_0x5efbcc){console[_0x87e5('0x22')](_0x5efbcc);});});ami[_0x87e5('0x18')](_0x87e5('0x19'),error);ami[_0x87e5('0x18')](_0x87e5('0x1a'),close);module['exports']=ami; \ No newline at end of file +var _0x71ed=['promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','catch','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','port','asterisk','username','Action'];(function(_0x5638d5,_0x18a3eb){var _0x5de000=function(_0xb0f07b){while(--_0xb0f07b){_0x5638d5['push'](_0x5638d5['shift']());}};_0x5de000(++_0x18a3eb);}(_0x71ed,0x1d7));var _0xd71e=function(_0x47f131,_0xd41844){_0x47f131=_0x47f131-0x0;var _0x165619=_0x71ed[_0x47f131];return _0x165619;};'use strict';var Manager=require(_0xd71e('0x0'));var BPromise=require(_0xd71e('0x1'));var moment=require(_0xd71e('0x2'));var util=require(_0xd71e('0x3'));var _=require(_0xd71e('0x4'));var logger=require(_0xd71e('0x5'))('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0xd71e('0x6')],config[_0xd71e('0x7')]['ip'],config[_0xd71e('0x7')][_0xd71e('0x8')],config[_0xd71e('0x7')]['password'],!![]);ami['keepConnected']();ami[_0xd71e('0x9')]=BPromise[_0xd71e('0xa')](ami[_0xd71e('0xb')]);function error(_0x39eb52){logger[_0xd71e('0xc')](util[_0xd71e('0xd')](_0xd71e('0xe'),config[_0xd71e('0x7')]['username'],config[_0xd71e('0x7')]['ip'],config[_0xd71e('0x7')][_0xd71e('0x6')],util[_0xd71e('0xf')](_0x39eb52,![],null)));}function close(){logger[_0xd71e('0xc')](util[_0xd71e('0xd')](_0xd71e('0x10'),config[_0xd71e('0x7')][_0xd71e('0x8')],config[_0xd71e('0x7')]['ip'],config[_0xd71e('0x7')][_0xd71e('0x6')]));}ami[_0xd71e('0x11')]=function(){return function(){return ami[_0xd71e('0x9')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xd71e('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xd71e('0x9')]({'action':_0xd71e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xd71e('0x9')]({'action':_0xd71e('0x14')});};};ami[_0xd71e('0x15')]=function(){return function(){return ami[_0xd71e('0x9')]({'action':'coreshowchannels'});};};function connect(_0xceed21){logger['info'](util[_0xd71e('0xd')](_0xd71e('0x16'),config[_0xd71e('0x7')][_0xd71e('0x8')],config[_0xd71e('0x7')]['ip'],config[_0xd71e('0x7')][_0xd71e('0x6')]));ami[_0xd71e('0x17')](_0xd71e('0xc'),error);ami['once'](_0xd71e('0x18'),close);}ami['on'](_0xd71e('0x19'),connect);ami['on'](_0xd71e('0x1a'),function(_0x41160e){logger[_0xd71e('0x1b')](util[_0xd71e('0xd')](_0xd71e('0x1c'),config[_0xd71e('0x7')]['username'],config[_0xd71e('0x7')]['ip'],config[_0xd71e('0x7')][_0xd71e('0x6')],util['inspect'](_0x41160e,![],null)));});ami['on']('fullybooted',function(_0x3c4b20){logger[_0xd71e('0x1b')](util[_0xd71e('0xd')](_0xd71e('0x1d'),config[_0xd71e('0x7')][_0xd71e('0x8')],config['asterisk']['ip'],config[_0xd71e('0x7')][_0xd71e('0x6')]));return BPromise[_0xd71e('0x1e')]()['then'](ami['actionSipShowRegistry']())[_0xd71e('0x1f')](ami[_0xd71e('0x20')]())[_0xd71e('0x1f')](ami[_0xd71e('0x21')]())['then'](ami[_0xd71e('0x22')]())['then'](ami[_0xd71e('0x15')]())[_0xd71e('0x23')](function(_0x3c3a68){console[_0xd71e('0x24')](_0x3c3a68);});});ami[_0xd71e('0x17')](_0xd71e('0xc'),error);ami[_0xd71e('0x17')](_0xd71e('0x18'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index aac8703..4a03243 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 _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb7e7[_0x3ab9ee];return _0x82ee88;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x4c060b,_0x4c5e75){var _0x5b9790=function(_0x32e525){while(--_0x32e525){_0x4c060b['push'](_0x4c060b['shift']());}};_0x5b9790(++_0x4c5e75);}(_0xb43b,0x1b2));var _0xbb43=function(_0x57d59e,_0x25342b){_0x57d59e=_0x57d59e-0x0;var _0x330342=_0xb43b[_0x57d59e];return _0x330342;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 43a39df..930c3db 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 _0xc01c=['lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName'];(function(_0x1d3211,_0x25c87c){var _0x9606cb=function(_0x1ca5c9){while(--_0x1ca5c9){_0x1d3211['push'](_0x1d3211['shift']());}};_0x9606cb(++_0x25c87c);}(_0xc01c,0x105));var _0xcc01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc01c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xcc01('0x0'));function checkNameSurname(_0x4cbf1a,_0x211930,_0x56ae7e){var _0x5a2fdf='';if(!_[_0xcc01('0x1')](_0x211930)&&_0xcc01('0x2')===typeof _0x211930){_0x5a2fdf+=_0x211930;}if(!_[_0xcc01('0x1')](_0x56ae7e)&&_0xcc01('0x2')===typeof _0x56ae7e){_0x5a2fdf+='\x20'+_0x56ae7e;}if(_0x5a2fdf!==''){return _0x5a2fdf;}return _0x4cbf1a;}function Action(_0x3b214b,_0x1c68b9,_0x1cd277){this[_0xcc01('0x3')]=_0x3b214b;this[_0xcc01('0x4')]=_0x1cd277||undefined;this[_0xcc01('0x5')]=checkNameSurname(_0x1c68b9[_0xcc01('0x6')][_0xcc01('0x7')],_0x1c68b9[_0xcc01('0x6')][_0xcc01('0x8')],_0x1c68b9[_0xcc01('0x6')][_0xcc01('0x9')]);this[_0xcc01('0xa')]=_0x1c68b9[_0xcc01('0x6')]['phone'];this[_0xcc01('0xb')]=_0x3b214b[_0xcc01('0x5')];this[_0xcc01('0xc')]=_0x1c68b9[_0xcc01('0xc')]||![];this[_0xcc01('0xd')]=_0x3b214b[_0xcc01('0xd')];this[_0xcc01('0xe')]=_0x3b214b[_0xcc01('0xe')]||0x3;this['scheduledat']=_0x1c68b9[_0xcc01('0xf')];this['countbusyretry']=_0x1c68b9[_0xcc01('0x10')];this['countcongestionretry']=_0x1c68b9[_0xcc01('0x11')];this[_0xcc01('0x12')]=_0x1c68b9[_0xcc01('0x12')];this[_0xcc01('0x13')]=_0x1c68b9['countnosuchnumberretry'];this[_0xcc01('0x14')]=_0x1c68b9[_0xcc01('0x14')];this[_0xcc01('0x15')]=_0x1c68b9[_0xcc01('0x15')];this[_0xcc01('0x16')]=_0x1c68b9[_0xcc01('0x16')];this[_0xcc01('0x17')]=_0x1c68b9[_0xcc01('0x17')];this[_0xcc01('0x18')]=_0x1c68b9[_0xcc01('0x18')];this[_0xcc01('0x19')]=_0x1c68b9[_0xcc01('0x19')];this[_0xcc01('0x1a')]=_0x1c68b9[_0xcc01('0x1a')];this[_0xcc01('0x1b')]=_0x1c68b9['VoiceQueueId'];this[_0xcc01('0x1c')]=_0x1c68b9[_0xcc01('0x1c')];this[_0xcc01('0x1d')]=_0x1c68b9['id'];this[_0xcc01('0x1e')]=_0x1c68b9[_0xcc01('0x6')]['firstName']||'';this[_0xcc01('0x1f')]=moment()[_0xcc01('0x20')](_0xcc01('0x21'));this[_0xcc01('0x22')]=_0x1c68b9[_0xcc01('0x22')];this[_0xcc01('0x23')]=_0x1c68b9[_0xcc01('0x23')];this['callbackat']=_0x1c68b9[_0xcc01('0x24')];this[_0xcc01('0x25')]=_0x1c68b9['recallme'];this[_0xcc01('0x26')]='';this['originatecalleridname']='';}Action[_0xcc01('0x27')][_0xcc01('0x28')]=function(){return util[_0xcc01('0x20')](_0xcc01('0x29'),this['name'],this['voiceQueue'][_0xcc01('0x2a')]>0x0?this[_0xcc01('0xa')][_0xcc01('0x2b')](this[_0xcc01('0x3')]['dialCutDigit']):this[_0xcc01('0xa')]);};Action[_0xcc01('0x27')][_0xcc01('0x2c')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0xecf8=['phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','prototype','getQueue','exports','lodash','isNil','string','voiceQueue','uniqueid','name'];(function(_0x65fd92,_0x17a418){var _0x372735=function(_0x50887e){while(--_0x50887e){_0x65fd92['push'](_0x65fd92['shift']());}};_0x372735(++_0x17a418);}(_0xecf8,0x1e9));var _0x8ecf=function(_0x48425d,_0x2557fc){_0x48425d=_0x48425d-0x0;var _0x10deef=_0xecf8[_0x48425d];return _0x10deef;};'use strict';var util=require('util');var _=require(_0x8ecf('0x0'));var moment=require('moment');function checkNameSurname(_0x514d50,_0x1f253e,_0x368b51){var _0x1b8287='';if(!_[_0x8ecf('0x1')](_0x1f253e)&&_0x8ecf('0x2')===typeof _0x1f253e){_0x1b8287+=_0x1f253e;}if(!_[_0x8ecf('0x1')](_0x368b51)&&_0x8ecf('0x2')===typeof _0x368b51){_0x1b8287+='\x20'+_0x368b51;}if(_0x1b8287!==''){return _0x1b8287;}return _0x514d50;}function Action(_0x4d7a83,_0x30e663,_0x55281b){this[_0x8ecf('0x3')]=_0x4d7a83;this[_0x8ecf('0x4')]=_0x55281b||undefined;this[_0x8ecf('0x5')]=checkNameSurname(_0x30e663['Contact'][_0x8ecf('0x6')],_0x30e663[_0x8ecf('0x7')][_0x8ecf('0x8')],_0x30e663['Contact'][_0x8ecf('0x9')]);this[_0x8ecf('0xa')]=_0x30e663[_0x8ecf('0x7')]['phone'];this[_0x8ecf('0xb')]=_0x4d7a83['name'];this[_0x8ecf('0xc')]=_0x30e663[_0x8ecf('0xc')]||![];this['type']=_0x4d7a83[_0x8ecf('0xd')];this[_0x8ecf('0xe')]=_0x4d7a83[_0x8ecf('0xe')]||0x3;this['scheduledat']=_0x30e663[_0x8ecf('0xf')];this[_0x8ecf('0x10')]=_0x30e663['countbusyretry'];this[_0x8ecf('0x11')]=_0x30e663[_0x8ecf('0x11')];this[_0x8ecf('0x12')]=_0x30e663['countnoanswerretry'];this[_0x8ecf('0x13')]=_0x30e663['countnosuchnumberretry'];this[_0x8ecf('0x14')]=_0x30e663[_0x8ecf('0x14')];this[_0x8ecf('0x15')]=_0x30e663[_0x8ecf('0x15')];this[_0x8ecf('0x16')]=_0x30e663[_0x8ecf('0x16')];this['countagentrejectretry']=_0x30e663[_0x8ecf('0x17')];this['ContactId']=_0x30e663[_0x8ecf('0x18')];this['ListId']=_0x30e663[_0x8ecf('0x19')];this['UserId']=_0x30e663[_0x8ecf('0x1a')];this[_0x8ecf('0x1b')]=_0x30e663[_0x8ecf('0x1b')];this[_0x8ecf('0x1c')]=_0x30e663[_0x8ecf('0x1c')];this[_0x8ecf('0x1d')]=_0x30e663['id'];this['ContactFirstName']=_0x30e663[_0x8ecf('0x7')]['firstName']||'';this[_0x8ecf('0x1e')]=moment()['format'](_0x8ecf('0x1f'));this[_0x8ecf('0x20')]=_0x30e663['callback'];this[_0x8ecf('0x21')]=_0x30e663[_0x8ecf('0x21')];this[_0x8ecf('0x22')]=_0x30e663['callbackat'];this['recallme']=_0x30e663[_0x8ecf('0x23')];this[_0x8ecf('0x24')]='';this[_0x8ecf('0x25')]='';}Action['prototype'][_0x8ecf('0x26')]=function(){return util[_0x8ecf('0x27')](_0x8ecf('0x28'),this['name'],this[_0x8ecf('0x3')][_0x8ecf('0x29')]>0x0?this[_0x8ecf('0xa')]['substring'](this[_0x8ecf('0x3')][_0x8ecf('0x29')]):this[_0x8ecf('0xa')]);};Action[_0x8ecf('0x2a')][_0x8ecf('0x2b')]=function(){return this[_0x8ecf('0xb')];};module[_0x8ecf('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index bfa96f2..3b8975c 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 _0xa9d7=['ContactId','ListId','UserId','CampaignId','originatecalleridname','exports','util','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xa9d7,0x180));var _0x7a9d=function(_0x1e89ed,_0x1cf7de){_0x1e89ed=_0x1e89ed-0x0;var _0x3e3e2c=_0xa9d7[_0x1e89ed];return _0x3e3e2c;};'use strict';var util=require(_0x7a9d('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x5f3407,_0x112d56){var _0x12a35f=moment(_0x5f3407)[_0x7a9d('0x1')](0x0);var _0xde68bd=moment(_0x112d56)[_0x7a9d('0x1')](0x0);return _0x12a35f['diff'](_0xde68bd,_0x7a9d('0x2'));}function AgentComplete(_0x1b660c,_0x454259){this[_0x7a9d('0x3')]=0x4;this[_0x7a9d('0x4')]=_0x7a9d('0x5');this[_0x7a9d('0x6')]=_0x1b660c[_0x7a9d('0x6')];this['type']=_0x1b660c[_0x7a9d('0x7')];this[_0x7a9d('0x8')]=_0x1b660c[_0x7a9d('0x7')]===_0x7a9d('0x9')?_0x7a9d('0xa'):_0x1b660c[_0x7a9d('0x7')];this[_0x7a9d('0xb')]=_0x1b660c[_0x7a9d('0xb')];this[_0x7a9d('0xc')]=_0x1b660c[_0x7a9d('0xc')];this['countnoanswerretry']=_0x1b660c[_0x7a9d('0xd')];this[_0x7a9d('0xe')]=_0x1b660c[_0x7a9d('0xb')]+_0x1b660c['countcongestionretry']+_0x1b660c['countnoanswerretry']+_0x1b660c['countnosuchnumberretry']+_0x1b660c[_0x7a9d('0xf')]+_0x1b660c[_0x7a9d('0x10')]+_0x1b660c[_0x7a9d('0x11')]+_0x1b660c['countagentrejectretry'];this[_0x7a9d('0x12')]=_0x1b660c['countnosuchnumberretry'];this[_0x7a9d('0xf')]=_0x1b660c[_0x7a9d('0xf')];this['countabandonedretry']=_0x1b660c[_0x7a9d('0x10')];this['countmachineretry']=_0x1b660c[_0x7a9d('0x11')];this[_0x7a9d('0x13')]=_0x1b660c['countagentrejectretry'];this[_0x7a9d('0x14')]=_0x454259[_0x7a9d('0x14')];this[_0x7a9d('0x15')]=_0x1b660c['name'];this[_0x7a9d('0x16')]=_0x1b660c[_0x7a9d('0x17')];this[_0x7a9d('0x18')]=_0x1b660c[_0x7a9d('0x18')];this[_0x7a9d('0x19')]=_0x1b660c[_0x7a9d('0x19')];this[_0x7a9d('0x1a')]=_0x1b660c[_0x7a9d('0x1a')];this['endtime']=moment()[_0x7a9d('0x1b')](_0x7a9d('0x1c'));this['ringtime']=getSeconds(_0x1b660c[_0x7a9d('0x19')],_0x1b660c[_0x7a9d('0x18')]);this[_0x7a9d('0x1d')]=getSeconds(_0x1b660c[_0x7a9d('0x1a')],_0x1b660c[_0x7a9d('0x19')]);this[_0x7a9d('0x1e')]=getSeconds(this['endtime'],_0x1b660c[_0x7a9d('0x1a')]);this[_0x7a9d('0xa')]=_0x454259[_0x7a9d('0xa')];this[_0x7a9d('0x1f')]=_0x454259[_0x7a9d('0x1f')];this[_0x7a9d('0x20')]=_0x454259['reason'];this[_0x7a9d('0x21')]=_0x1b660c[_0x7a9d('0x21')];this['callbackuniqueid']=_0x1b660c[_0x7a9d('0x22')];this['callbackat']=_0x1b660c['callbackat'];this[_0x7a9d('0x23')]=_0x1b660c[_0x7a9d('0x23')];this[_0x7a9d('0x24')]=_0x1b660c[_0x7a9d('0x24')];this['ListId']=_0x1b660c[_0x7a9d('0x25')];this['UserId']=_0x1b660c[_0x7a9d('0x26')];this['VoiceQueueId']=_0x1b660c['VoiceQueueId'];this['CampaignId']=_0x1b660c[_0x7a9d('0x27')];this['originatecalleridnum']=_0x1b660c['originatecalleridnum']||'';this[_0x7a9d('0x28')]=_0x1b660c[_0x7a9d('0x28')]||'';}module[_0x7a9d('0x29')]=AgentComplete; \ No newline at end of file +var _0x2319=['originatecalleridname','exports','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x114c1c,_0x5bfd6d){var _0x50a0a6=function(_0x4f97f0){while(--_0x4f97f0){_0x114c1c['push'](_0x114c1c['shift']());}};_0x50a0a6(++_0x5bfd6d);}(_0x2319,0x116));var _0x9231=function(_0x29e58a,_0xae730){_0x29e58a=_0x29e58a-0x0;var _0x3375b2=_0x2319[_0x29e58a];return _0x3375b2;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x2e632f,_0x47e694){var _0x55a505=moment(_0x2e632f)[_0x9231('0x0')](0x0);var _0x5515ea=moment(_0x47e694)[_0x9231('0x0')](0x0);return _0x55a505[_0x9231('0x1')](_0x5515ea,_0x9231('0x2'));}function AgentComplete(_0x2f50e3,_0x1255c1){this[_0x9231('0x3')]=0x4;this[_0x9231('0x4')]=_0x9231('0x5');this[_0x9231('0x6')]=_0x2f50e3[_0x9231('0x6')];this[_0x9231('0x7')]=_0x2f50e3[_0x9231('0x7')];this[_0x9231('0x8')]=_0x2f50e3[_0x9231('0x7')]==='outbound'?'queue':_0x2f50e3['type'];this[_0x9231('0x9')]=_0x2f50e3[_0x9231('0x9')];this[_0x9231('0xa')]=_0x2f50e3[_0x9231('0xa')];this[_0x9231('0xb')]=_0x2f50e3[_0x9231('0xb')];this[_0x9231('0xc')]=_0x2f50e3['countbusyretry']+_0x2f50e3['countcongestionretry']+_0x2f50e3[_0x9231('0xb')]+_0x2f50e3['countnosuchnumberretry']+_0x2f50e3[_0x9231('0xd')]+_0x2f50e3[_0x9231('0xe')]+_0x2f50e3['countmachineretry']+_0x2f50e3[_0x9231('0xf')];this[_0x9231('0x10')]=_0x2f50e3[_0x9231('0x10')];this[_0x9231('0xd')]=_0x2f50e3[_0x9231('0xd')];this[_0x9231('0xe')]=_0x2f50e3[_0x9231('0xe')];this[_0x9231('0x11')]=_0x2f50e3[_0x9231('0x11')];this[_0x9231('0xf')]=_0x2f50e3[_0x9231('0xf')];this[_0x9231('0x12')]=_0x1255c1['uniqueid'];this[_0x9231('0x13')]=_0x2f50e3['name'];this[_0x9231('0x14')]=_0x2f50e3[_0x9231('0x15')];this[_0x9231('0x16')]=_0x2f50e3['starttime'];this[_0x9231('0x17')]=_0x2f50e3['responsetime'];this[_0x9231('0x18')]=_0x2f50e3['answertime'];this[_0x9231('0x19')]=moment()[_0x9231('0x1a')](_0x9231('0x1b'));this[_0x9231('0x1c')]=getSeconds(_0x2f50e3[_0x9231('0x17')],_0x2f50e3[_0x9231('0x16')]);this[_0x9231('0x1d')]=getSeconds(_0x2f50e3['answertime'],_0x2f50e3[_0x9231('0x17')]);this[_0x9231('0x1e')]=getSeconds(this[_0x9231('0x19')],_0x2f50e3[_0x9231('0x18')]);this['queue']=_0x1255c1[_0x9231('0x1f')];this['membername']=_0x1255c1[_0x9231('0x20')];this[_0x9231('0x21')]=_0x1255c1['reason'];this[_0x9231('0x22')]=_0x2f50e3['callback'];this[_0x9231('0x23')]=_0x2f50e3['callbackuniqueid'];this[_0x9231('0x24')]=_0x2f50e3[_0x9231('0x24')];this['recallme']=_0x2f50e3[_0x9231('0x25')];this[_0x9231('0x26')]=_0x2f50e3[_0x9231('0x26')];this[_0x9231('0x27')]=_0x2f50e3[_0x9231('0x27')];this[_0x9231('0x28')]=_0x2f50e3[_0x9231('0x28')];this[_0x9231('0x29')]=_0x2f50e3[_0x9231('0x29')];this['CampaignId']=_0x2f50e3[_0x9231('0x2a')];this[_0x9231('0x2b')]=_0x2f50e3['originatecalleridnum']||'';this[_0x9231('0x2c')]=_0x2f50e3[_0x9231('0x2c')]||'';}module[_0x9231('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 6ff18ae..4f30b4f 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 _0x55ca=['milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55ca,0x126));var _0xa55c=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x55ca[_0x35c5a8];return _0x34782c;};'use strict';var util=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var moment=require('moment');function getSeconds(_0x5edc58,_0x49875a){var _0x1c6ec3=moment(_0x5edc58)[_0xa55c('0x2')](0x0);var _0x5dc716=moment(_0x49875a)[_0xa55c('0x2')](0x0);return _0x1c6ec3[_0xa55c('0x3')](_0x5dc716,_0xa55c('0x4'));}function Final(_0x204951){this[_0xa55c('0x5')]=_0x204951[_0xa55c('0x5')];this[_0xa55c('0x6')]=_0x204951['scheduledat'];this[_0xa55c('0x7')]=_0x204951[_0xa55c('0x7')];this['campaigntype']=_0x204951[_0xa55c('0x7')]===_0xa55c('0x8')?'queue':_0x204951['type'];this[_0xa55c('0x9')]=_0x204951[_0xa55c('0x9')];this[_0xa55c('0xa')]=_0x204951[_0xa55c('0xa')];this[_0xa55c('0xb')]=_0x204951[_0xa55c('0xb')];this[_0xa55c('0xc')]=_0x204951[_0xa55c('0x9')]+_0x204951[_0xa55c('0xa')]+_0x204951[_0xa55c('0xb')]+_0x204951['countnosuchnumberretry']+_0x204951['countdropretry']+_0x204951[_0xa55c('0xd')]+_0x204951['countmachineretry']+_0x204951['countagentrejectretry'];this['countnosuchnumberretry']=_0x204951[_0xa55c('0xe')];this[_0xa55c('0xf')]=_0x204951[_0xa55c('0xf')];this[_0xa55c('0xd')]=_0x204951[_0xa55c('0xd')];this[_0xa55c('0x10')]=_0x204951['countmachineretry'];this[_0xa55c('0x11')]=_0x204951[_0xa55c('0x11')];this[_0xa55c('0x12')]=_0x204951[_0xa55c('0x12')];this[_0xa55c('0x13')]=_0x204951[_0xa55c('0x13')];this[_0xa55c('0x14')]=_0x204951[_0xa55c('0x14')];this[_0xa55c('0x15')]=_0x204951['starttime'];this[_0xa55c('0x16')]=_0x204951[_0xa55c('0x16')];this[_0xa55c('0x17')]=_0x204951[_0xa55c('0x16')];this[_0xa55c('0x18')]=_0x204951[_0xa55c('0x18')]||0x0;this['holdtime']=_0x204951['holdtime']||0x0;this[_0xa55c('0x19')]=_0x204951[_0xa55c('0x19')]||0x0;this[_0xa55c('0x1a')]=_0x204951['callback'];this[_0xa55c('0x1b')]=_0x204951[_0xa55c('0x1b')];this['callbackat']=_0x204951[_0xa55c('0x1c')];this[_0xa55c('0x1d')]=_0x204951[_0xa55c('0x1d')];this[_0xa55c('0x1e')]=_0x204951[_0xa55c('0x1e')];this['ListId']=_0x204951[_0xa55c('0x1f')];this['UserId']=_0x204951['UserId'];this['VoiceQueueId']=_0x204951[_0xa55c('0x20')];this['CampaignId']=_0x204951[_0xa55c('0x21')];this[_0xa55c('0x22')]=_0x204951[_0xa55c('0x22')]||'';this[_0xa55c('0x23')]=_0x204951[_0xa55c('0x23')]||'';}module[_0xa55c('0x24')]=Final; \ No newline at end of file +var _0x8a28=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x59c20d,_0xe8598e){var _0x412845=function(_0x2d5804){while(--_0x2d5804){_0x59c20d['push'](_0x59c20d['shift']());}};_0x412845(++_0xe8598e);}(_0x8a28,0xfd));var _0x88a2=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8a28[_0x37bd26];return _0xe83dc4;};'use strict';var util=require(_0x88a2('0x0'));var _=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));function getSeconds(_0x3c2c72,_0x27b1c1){var _0x29e6d8=moment(_0x3c2c72)[_0x88a2('0x3')](0x0);var _0x3fc89d=moment(_0x27b1c1)['milliseconds'](0x0);return _0x29e6d8[_0x88a2('0x4')](_0x3fc89d,_0x88a2('0x5'));}function Final(_0x3c3392){this[_0x88a2('0x6')]=_0x3c3392[_0x88a2('0x6')];this['scheduledat']=_0x3c3392[_0x88a2('0x7')];this['type']=_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0x9')]=_0x3c3392[_0x88a2('0x8')]===_0x88a2('0xa')?_0x88a2('0xb'):_0x3c3392[_0x88a2('0x8')];this[_0x88a2('0xc')]=_0x3c3392[_0x88a2('0xc')];this[_0x88a2('0xd')]=_0x3c3392['countcongestionretry'];this['countnoanswerretry']=_0x3c3392[_0x88a2('0xe')];this[_0x88a2('0xf')]=_0x3c3392[_0x88a2('0xc')]+_0x3c3392[_0x88a2('0xd')]+_0x3c3392[_0x88a2('0xe')]+_0x3c3392['countnosuchnumberretry']+_0x3c3392[_0x88a2('0x10')]+_0x3c3392[_0x88a2('0x11')]+_0x3c3392[_0x88a2('0x12')]+_0x3c3392[_0x88a2('0x13')];this['countnosuchnumberretry']=_0x3c3392[_0x88a2('0x14')];this[_0x88a2('0x10')]=_0x3c3392[_0x88a2('0x10')];this['countabandonedretry']=_0x3c3392[_0x88a2('0x11')];this[_0x88a2('0x12')]=_0x3c3392[_0x88a2('0x12')];this[_0x88a2('0x13')]=_0x3c3392[_0x88a2('0x13')];this[_0x88a2('0xb')]=_0x3c3392[_0x88a2('0xb')];this[_0x88a2('0x15')]=_0x3c3392[_0x88a2('0x15')];this[_0x88a2('0x16')]=_0x3c3392[_0x88a2('0x16')];this[_0x88a2('0x17')]=_0x3c3392[_0x88a2('0x17')];this[_0x88a2('0x18')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x19')]=_0x3c3392[_0x88a2('0x18')];this[_0x88a2('0x1a')]=_0x3c3392['ringtime']||0x0;this[_0x88a2('0x1b')]=_0x3c3392[_0x88a2('0x1b')]||0x0;this['talktime']=_0x3c3392['talktime']||0x0;this[_0x88a2('0x1c')]=_0x3c3392[_0x88a2('0x1c')];this[_0x88a2('0x1d')]=_0x3c3392[_0x88a2('0x1d')];this[_0x88a2('0x1e')]=_0x3c3392['callbackat'];this[_0x88a2('0x1f')]=_0x3c3392[_0x88a2('0x1f')];this[_0x88a2('0x20')]=_0x3c3392[_0x88a2('0x20')];this['ListId']=_0x3c3392[_0x88a2('0x21')];this['UserId']=_0x3c3392['UserId'];this[_0x88a2('0x22')]=_0x3c3392[_0x88a2('0x22')];this['CampaignId']=_0x3c3392['CampaignId'];this[_0x88a2('0x23')]=_0x3c3392[_0x88a2('0x23')]||'';this['originatecalleridname']=_0x3c3392[_0x88a2('0x24')]||'';}module[_0x88a2('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b67bd22..c9c8491 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 _0x61f8=['callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','milliseconds','seconds','statedesc','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid'];(function(_0x416913,_0x2128cd){var _0x6b4103=function(_0x3676c5){while(--_0x3676c5){_0x416913['push'](_0x416913['shift']());}};_0x6b4103(++_0x2128cd);}(_0x61f8,0x1b5));var _0x861f=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x61f8[_0x5e238b];return _0x389bea;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x861f('0x0'));function getSeconds(_0x38fc45,_0x2b076b){var _0x54fe7f=moment(_0x38fc45)[_0x861f('0x1')](0x0);var _0x33db06=moment(_0x2b076b)[_0x861f('0x1')](0x0);return _0x54fe7f['diff'](_0x33db06,_0x861f('0x2'));}function Hangup(_0x5df3ab,_0x5c0a9e){this['state']=0x4;this[_0x861f('0x3')]=_0x861f('0x4');this['scheduledat']=_0x5df3ab['scheduledat'];this[_0x861f('0x5')]=_0x5df3ab[_0x861f('0x5')];this[_0x861f('0x6')]=_0x5df3ab['type']===_0x861f('0x7')?_0x861f('0x8'):_0x5df3ab[_0x861f('0x5')];this[_0x861f('0x9')]=_0x5df3ab[_0x861f('0x9')];this[_0x861f('0xa')]=_0x5df3ab[_0x861f('0xa')];this['countnoanswerretry']=_0x5df3ab[_0x861f('0xb')];this[_0x861f('0xc')]=_0x5df3ab[_0x861f('0x9')]+_0x5df3ab[_0x861f('0xa')]+_0x5df3ab['countnoanswerretry']+_0x5df3ab[_0x861f('0xd')]+_0x5df3ab[_0x861f('0xe')]+_0x5df3ab['countabandonedretry']+_0x5df3ab['countmachineretry']+_0x5df3ab[_0x861f('0xf')];this[_0x861f('0xd')]=_0x5df3ab[_0x861f('0xd')];this[_0x861f('0xe')]=_0x5df3ab[_0x861f('0xe')];this[_0x861f('0x10')]=_0x5df3ab['countabandonedretry'];this['countmachineretry']=_0x5df3ab[_0x861f('0x11')];this[_0x861f('0xf')]=_0x5df3ab[_0x861f('0xf')];this[_0x861f('0x12')]=_0x5c0a9e[_0x861f('0x12')];this[_0x861f('0x13')]=_0x5df3ab[_0x861f('0x14')];this[_0x861f('0x15')]=_0x5df3ab[_0x861f('0x16')];this[_0x861f('0x17')]=_0x5df3ab[_0x861f('0x17')];this[_0x861f('0x18')]=_0x5df3ab['responsetime'];this[_0x861f('0x19')]=moment()[_0x861f('0x1a')](_0x861f('0x1b'));this[_0x861f('0x1c')]=getSeconds(_0x5df3ab[_0x861f('0x18')],_0x5df3ab[_0x861f('0x17')]);this[_0x861f('0x1d')]=0x0;this[_0x861f('0x1e')]=getSeconds(this[_0x861f('0x19')],_0x5df3ab['responsetime']);this[_0x861f('0x8')]=_0x5df3ab[_0x861f('0x8')];this[_0x861f('0x1f')]=_0x861f('0x20');this[_0x861f('0x21')]=_0x5c0a9e['cause-txt'];this[_0x861f('0x22')]=_0x5df3ab[_0x861f('0x22')];this[_0x861f('0x23')]=_0x5df3ab[_0x861f('0x23')];this[_0x861f('0x24')]=_0x5df3ab['callbackat'];this[_0x861f('0x25')]=_0x5df3ab['recallme'];this[_0x861f('0x26')]=_0x5df3ab[_0x861f('0x26')];this['ListId']=_0x5df3ab[_0x861f('0x27')];this['UserId']=_0x5df3ab[_0x861f('0x28')];this['VoiceQueueId']=_0x5df3ab['VoiceQueueId'];this['CampaignId']=_0x5df3ab[_0x861f('0x29')];}module[_0x861f('0x2a')]=Hangup; \ No newline at end of file +var _0x3304=['number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name'];(function(_0x5a0d60,_0x176685){var _0x365165=function(_0x24f2c3){while(--_0x24f2c3){_0x5a0d60['push'](_0x5a0d60['shift']());}};_0x365165(++_0x176685);}(_0x3304,0x165));var _0x4330=function(_0x24c892,_0x689614){_0x24c892=_0x24c892-0x0;var _0x5d8a2d=_0x3304[_0x24c892];return _0x5d8a2d;};'use strict';var util=require(_0x4330('0x0'));var _=require(_0x4330('0x1'));var moment=require(_0x4330('0x2'));function getSeconds(_0x43ab31,_0x17eaff){var _0x1847ea=moment(_0x43ab31)['milliseconds'](0x0);var _0x300c87=moment(_0x17eaff)[_0x4330('0x3')](0x0);return _0x1847ea[_0x4330('0x4')](_0x300c87,_0x4330('0x5'));}function Hangup(_0x2295bd,_0x24d5fb){this['state']=0x4;this['statedesc']='Answer';this[_0x4330('0x6')]=_0x2295bd['scheduledat'];this[_0x4330('0x7')]=_0x2295bd[_0x4330('0x7')];this[_0x4330('0x8')]=_0x2295bd[_0x4330('0x7')]==='outbound'?_0x4330('0x9'):_0x2295bd[_0x4330('0x7')];this[_0x4330('0xa')]=_0x2295bd[_0x4330('0xa')];this[_0x4330('0xb')]=_0x2295bd[_0x4330('0xb')];this[_0x4330('0xc')]=_0x2295bd[_0x4330('0xc')];this[_0x4330('0xd')]=_0x2295bd[_0x4330('0xa')]+_0x2295bd[_0x4330('0xb')]+_0x2295bd[_0x4330('0xc')]+_0x2295bd[_0x4330('0xe')]+_0x2295bd[_0x4330('0xf')]+_0x2295bd[_0x4330('0x10')]+_0x2295bd[_0x4330('0x11')]+_0x2295bd['countagentrejectretry'];this['countnosuchnumberretry']=_0x2295bd[_0x4330('0xe')];this[_0x4330('0xf')]=_0x2295bd[_0x4330('0xf')];this[_0x4330('0x10')]=_0x2295bd[_0x4330('0x10')];this[_0x4330('0x11')]=_0x2295bd[_0x4330('0x11')];this[_0x4330('0x12')]=_0x2295bd['countagentrejectretry'];this['uniqueid']=_0x24d5fb[_0x4330('0x13')];this['calleridname']=_0x2295bd[_0x4330('0x14')];this['calleridnum']=_0x2295bd[_0x4330('0x15')];this[_0x4330('0x16')]=_0x2295bd[_0x4330('0x16')];this[_0x4330('0x17')]=_0x2295bd[_0x4330('0x17')];this[_0x4330('0x18')]=moment()['format'](_0x4330('0x19'));this[_0x4330('0x1a')]=getSeconds(_0x2295bd['responsetime'],_0x2295bd[_0x4330('0x16')]);this[_0x4330('0x1b')]=0x0;this[_0x4330('0x1c')]=getSeconds(this[_0x4330('0x18')],_0x2295bd['responsetime']);this[_0x4330('0x9')]=_0x2295bd[_0x4330('0x9')];this[_0x4330('0x1d')]=_0x4330('0x1e');this[_0x4330('0x1f')]=_0x24d5fb[_0x4330('0x20')];this[_0x4330('0x21')]=_0x2295bd[_0x4330('0x21')];this['callbackuniqueid']=_0x2295bd[_0x4330('0x22')];this[_0x4330('0x23')]=_0x2295bd[_0x4330('0x23')];this[_0x4330('0x24')]=_0x2295bd['recallme'];this[_0x4330('0x25')]=_0x2295bd[_0x4330('0x25')];this['ListId']=_0x2295bd['ListId'];this[_0x4330('0x26')]=_0x2295bd[_0x4330('0x26')];this[_0x4330('0x27')]=_0x2295bd['VoiceQueueId'];this[_0x4330('0x28')]=_0x2295bd[_0x4330('0x28')];}module[_0x4330('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index fae336c..24a17f2 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 _0x7c6e=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7c6e,0x121));var _0xe7c6=function(_0xf184b,_0x32f63a){_0xf184b=_0xf184b-0x0;var _0x1e08bc=_0x7c6e[_0xf184b];return _0x1e08bc;};'use strict';var util=require('util');var _=require(_0xe7c6('0x0'));var moment=require(_0xe7c6('0x1'));function getSeconds(_0xbf1eb5,_0x3b7796){var _0x4529cc=moment(_0xbf1eb5)['milliseconds'](0x0);var _0x5bc266=moment(_0x3b7796)[_0xe7c6('0x2')](0x0);return _0x4529cc[_0xe7c6('0x3')](_0x5bc266,_0xe7c6('0x4'));}function History(_0x423d4b){this[_0xe7c6('0x5')]=_0x423d4b[_0xe7c6('0x5')];this[_0xe7c6('0x6')]=_0x423d4b[_0xe7c6('0x6')]||undefined;this[_0xe7c6('0x7')]=_0x423d4b['type'];this[_0xe7c6('0x8')]=_0x423d4b[_0xe7c6('0x7')]===_0xe7c6('0x9')?_0xe7c6('0xa'):_0x423d4b[_0xe7c6('0x7')];this['countbusyretry']=_0x423d4b[_0xe7c6('0xb')];this[_0xe7c6('0xc')]=_0x423d4b[_0xe7c6('0xc')];this[_0xe7c6('0xd')]=_0x423d4b[_0xe7c6('0xd')];this['countglobal']=_0x423d4b[_0xe7c6('0xb')]+_0x423d4b[_0xe7c6('0xc')]+_0x423d4b[_0xe7c6('0xd')]+_0x423d4b[_0xe7c6('0xe')]+_0x423d4b[_0xe7c6('0xf')]+_0x423d4b[_0xe7c6('0x10')]+_0x423d4b[_0xe7c6('0x11')]+_0x423d4b['countagentrejectretry'];this[_0xe7c6('0xe')]=_0x423d4b[_0xe7c6('0xe')];this[_0xe7c6('0xf')]=_0x423d4b[_0xe7c6('0xf')];this[_0xe7c6('0x10')]=_0x423d4b['countabandonedretry'];this[_0xe7c6('0x11')]=_0x423d4b['countmachineretry'];this[_0xe7c6('0x12')]=_0x423d4b[_0xe7c6('0x12')];this[_0xe7c6('0xa')]=_0x423d4b[_0xe7c6('0xa')];this[_0xe7c6('0x13')]=_0x423d4b[_0xe7c6('0x14')];this[_0xe7c6('0x15')]=_0x423d4b[_0xe7c6('0x16')];this[_0xe7c6('0x17')]=_0x423d4b['starttime'];this[_0xe7c6('0x18')]=_0x423d4b[_0xe7c6('0x18')];this['endtime']=_0x423d4b[_0xe7c6('0x18')];this[_0xe7c6('0x19')]=getSeconds(_0x423d4b[_0xe7c6('0x18')],_0x423d4b[_0xe7c6('0x17')]);this[_0xe7c6('0x1a')]=0x0;this[_0xe7c6('0x1b')]=0x0;this['callback']=_0x423d4b['callback'];this['callbackuniqueid']=_0x423d4b[_0xe7c6('0x1c')];this[_0xe7c6('0x1d')]=_0x423d4b[_0xe7c6('0x1d')];this[_0xe7c6('0x1e')]=_0x423d4b[_0xe7c6('0x1e')];this['ContactId']=_0x423d4b['ContactId'];this[_0xe7c6('0x1f')]=_0x423d4b[_0xe7c6('0x1f')];this[_0xe7c6('0x20')]=_0x423d4b[_0xe7c6('0x20')];this['VoiceQueueId']=_0x423d4b[_0xe7c6('0x21')];this['CampaignId']=_0x423d4b[_0xe7c6('0x22')];this[_0xe7c6('0x23')]=_0x423d4b[_0xe7c6('0x23')]||'';this[_0xe7c6('0x24')]=_0x423d4b['originatecalleridname']||'';}module[_0xe7c6('0x25')]=History; \ No newline at end of file +var _0xa2bc=['VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xa2bc,0x1d8));var _0xca2b=function(_0x3e14a5,_0x3386dd){_0x3e14a5=_0x3e14a5-0x0;var _0x15d478=_0xa2bc[_0x3e14a5];return _0x15d478;};'use strict';var util=require(_0xca2b('0x0'));var _=require(_0xca2b('0x1'));var moment=require(_0xca2b('0x2'));function getSeconds(_0x368d4d,_0x133103){var _0x551523=moment(_0x368d4d)[_0xca2b('0x3')](0x0);var _0x406be7=moment(_0x133103)[_0xca2b('0x3')](0x0);return _0x551523[_0xca2b('0x4')](_0x406be7,'seconds');}function History(_0x3809fe){this[_0xca2b('0x5')]=_0x3809fe[_0xca2b('0x5')];this[_0xca2b('0x6')]=_0x3809fe['scheduledat']||undefined;this[_0xca2b('0x7')]=_0x3809fe[_0xca2b('0x7')];this['campaigntype']=_0x3809fe[_0xca2b('0x7')]==='outbound'?_0xca2b('0x8'):_0x3809fe['type'];this[_0xca2b('0x9')]=_0x3809fe['countbusyretry'];this[_0xca2b('0xa')]=_0x3809fe['countcongestionretry'];this[_0xca2b('0xb')]=_0x3809fe[_0xca2b('0xb')];this[_0xca2b('0xc')]=_0x3809fe['countbusyretry']+_0x3809fe[_0xca2b('0xa')]+_0x3809fe[_0xca2b('0xb')]+_0x3809fe['countnosuchnumberretry']+_0x3809fe[_0xca2b('0xd')]+_0x3809fe[_0xca2b('0xe')]+_0x3809fe['countmachineretry']+_0x3809fe['countagentrejectretry'];this['countnosuchnumberretry']=_0x3809fe[_0xca2b('0xf')];this[_0xca2b('0xd')]=_0x3809fe['countdropretry'];this[_0xca2b('0xe')]=_0x3809fe[_0xca2b('0xe')];this[_0xca2b('0x10')]=_0x3809fe[_0xca2b('0x10')];this['countagentrejectretry']=_0x3809fe[_0xca2b('0x11')];this[_0xca2b('0x8')]=_0x3809fe[_0xca2b('0x8')];this[_0xca2b('0x12')]=_0x3809fe[_0xca2b('0x13')];this[_0xca2b('0x14')]=_0x3809fe[_0xca2b('0x15')];this[_0xca2b('0x16')]=_0x3809fe[_0xca2b('0x16')];this[_0xca2b('0x17')]=_0x3809fe['responsetime'];this[_0xca2b('0x18')]=_0x3809fe[_0xca2b('0x17')];this[_0xca2b('0x19')]=getSeconds(_0x3809fe[_0xca2b('0x17')],_0x3809fe[_0xca2b('0x16')]);this[_0xca2b('0x1a')]=0x0;this[_0xca2b('0x1b')]=0x0;this[_0xca2b('0x1c')]=_0x3809fe[_0xca2b('0x1c')];this[_0xca2b('0x1d')]=_0x3809fe['callbackuniqueid'];this['callbackat']=_0x3809fe[_0xca2b('0x1e')];this['recallme']=_0x3809fe[_0xca2b('0x1f')];this['ContactId']=_0x3809fe[_0xca2b('0x20')];this[_0xca2b('0x21')]=_0x3809fe[_0xca2b('0x21')];this[_0xca2b('0x22')]=_0x3809fe[_0xca2b('0x22')];this[_0xca2b('0x23')]=_0x3809fe[_0xca2b('0x23')];this[_0xca2b('0x24')]=_0x3809fe['CampaignId'];this[_0xca2b('0x25')]=_0x3809fe[_0xca2b('0x25')]||'';this['originatecalleridname']=_0x3809fe['originatecalleridname']||'';}module[_0xca2b('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index b692598..3094b4f 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 _0xf00e=['[syncHangupInAMD][createHistory]','MACHINE','outboundAnswerCallsDay','countmachineretry','countglobal','custom:amd','buildObj','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HANGUP','HangupInAMD','membername','[syncHangupInAMDIvr][createHistory]','value','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countdropretry','reason19\x20machine....','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','strategy','actionid','locked','paused','stateinterface','push','pick','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','SIP/%s/%s%s','substring','xcally-motion-dialer','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','RUNNING','Contact.phone','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','maxNumberOriginate','actions','contactsId','startPredictive','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','Trunk','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','diff','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','clearZombieChannels','[uniqueid]','enqueue','Action','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','trunks','SIP/%s','reachable','unmonitored','syncVarSet','uniqueId','uniqueid','isNil','variable','exten','dialAMDActive','outboundAnswerAgiCallsDay','statedesc','AMD','amd'];(function(_0x32b6f5,_0x7cd4c2){var _0x408c7b=function(_0xf37ef5){while(--_0xf37ef5){_0x32b6f5['push'](_0x32b6f5['shift']());}};_0x408c7b(++_0x7cd4c2);}(_0xf00e,0x12f));var _0xef00=function(_0x220324,_0x32c6f0){_0x220324=_0x220324-0x0;var _0x62cf9a=_0xf00e[_0x220324];return _0x62cf9a;};'use strict';var util=require(_0xef00('0x0'));var _=require(_0xef00('0x1'));var BPromise=require(_0xef00('0x2'));var uuid=require(_0xef00('0x3'));var moment=require(_0xef00('0x4'));var rr=require('rr');var md5=require(_0xef00('0x5'));var Redis=require(_0xef00('0x6'));var ut=require(_0xef00('0x7'));var config=require(_0xef00('0x8'));var logger=require(_0xef00('0x9'))(_0xef00('0xa'));var loggerBooked=require(_0xef00('0x9'))(_0xef00('0xb'));var loggerPredictive=require(_0xef00('0x9'))(_0xef00('0xc'));var loggerPredictiveCalls=require(_0xef00('0x9'))(_0xef00('0xd'));var loggerSyncQueueSummary=require(_0xef00('0x9'))('syncQueueSummary');var ami=require(_0xef00('0xe'));config['redis']=_['defaults'](config[_0xef00('0xf')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xef00('0xf')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xef00('0x10'));var cmHopperBlack=require(_0xef00('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0xef00('0x12'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xef00('0x13'));var ipAgi=process['env'][_0xef00('0x14')]||_0xef00('0x15');var strategy={'rrmemory':_0xef00('0x16'),'roundrobin':_0xef00('0x17')};var Sequence=function(){};Sequence[_0xef00('0x18')]['enqueue']=function(_0x37afae){this[_0xef00('0x19')]=this['tail']?this[_0xef00('0x19')][_0xef00('0x1a')](_0x37afae):_0x37afae();};function Dialer(_0x165ac0,_0x32fe6d){this['sequence']=new Sequence();this[_0xef00('0x1b')]=_0x32fe6d;this[_0xef00('0x1c')]=_0x165ac0['voiceQueues'];this[_0xef00('0x1d')]=_0x165ac0[_0xef00('0x1d')];this[_0xef00('0x1e')]=_0x165ac0['agents'];this['trunks']=_0x165ac0['trunks'];this[_0xef00('0x1f')]=config[_0xef00('0x1f')]||0x2;this['channels']={};this[_0xef00('0x20')]={};this[_0xef00('0x21')]={};this['uniqueId']={};this['optionPredictive']={};this[_0xef00('0x22')]={};this[_0xef00('0x23')]={};this['ivrOriginated']={};this[_0xef00('0x24')]={};this[_0xef00('0x25')]={};ami['on']('agentconnect',this[_0xef00('0x26')]['bind'](this));ami['on']('queuecallerabandon',this[_0xef00('0x27')]['bind'](this));ami['on'](_0xef00('0x28'),this[_0xef00('0x29')][_0xef00('0x2a')](this));ami['on'](_0xef00('0x2b'),this['syncAgentComplete'][_0xef00('0x2a')](this));ami['on'](_0xef00('0x2c'),this[_0xef00('0x2d')]['bind'](this));ami['on'](_0xef00('0x2e'),this[_0xef00('0x2f')][_0xef00('0x2a')](this));ami['on'](_0xef00('0x30'),this[_0xef00('0x31')][_0xef00('0x2a')](this));ami['on'](_0xef00('0x32'),this['syncVarSet']['bind'](this));ami['on'](_0xef00('0x33'),this[_0xef00('0x34')][_0xef00('0x2a')](this));ami['on']('queuestatuscomplete',this[_0xef00('0x35')][_0xef00('0x2a')](this));this[_0xef00('0x36')]();this[_0xef00('0x37')]();}function isNotNull(_0x248d83){return _0x248d83!==null&&!_['isUndefined'](_0x248d83);}function checkIsLoggedIn(_0x26f3c0,_0xba426c){return function(){if(_0xba426c<=0x0){_0x26f3c0['message']=_0xef00('0x38');throw _0x26f3c0[_0xef00('0x39')]+_0xef00('0x3a');}};}function isActive(_0xf1f651){return _0xf1f651;}function checkIsActive(_0x400fd1,_0x1959b4){return function(){if(!isActive(_0x1959b4)){_0x400fd1[_0xef00('0x3b')]='NOT_ACTIVE';throw _0x400fd1[_0xef00('0x39')]+_0xef00('0x3c');}};}function checkInterval(_0x13d68b){return function(){if(!isNotNull(_0x13d68b['Interval'])){_0x13d68b['message']=_0xef00('0x3d');throw _0x13d68b['name']+_0xef00('0x3e');}if(!isNotNull(_0x13d68b[_0xef00('0x3f')][_0xef00('0x40')])){_0x13d68b[_0xef00('0x3b')]=_0xef00('0x3d');throw _0x13d68b['name']+_0xef00('0x3e');}if(!isNotNull(_['isEmpty'](_0x13d68b[_0xef00('0x3f')][_0xef00('0x40')]))){_0x13d68b[_0xef00('0x3b')]=_0xef00('0x3d');throw _0x13d68b[_0xef00('0x39')]+_0xef00('0x3e');}};}function msgResponse(_0x5a22e0,_0x266101,_0x6c8e40){return{'action':_0x5a22e0,'response':_0x266101,'message':_0x6c8e40,'stack':_0x6c8e40};}function myreject(_0x3865f9){return function(_0x587fb8){return _0x3865f9(msgResponse(_0xef00('0x41'),_0xef00('0x42'),JSON[_0xef00('0x43')](_0x587fb8)));};}function getSeconds(_0x4ee256,_0x5f1715){var _0x4c6770=moment(_0x4ee256)['milliseconds'](0x0);var _0x3d9094=moment(_0x5f1715)[_0xef00('0x44')](0x0);return _0x4c6770['diff'](_0x3d9094,'seconds');}function emit(_0x145aae,_0x2d1892,_0xfd51e){io['to'](_0x145aae)[_0xef00('0x45')](_0x2d1892,_0xfd51e);}function emitVoiceQueueSummary(_0x457ac7){if(_0x457ac7[_0xef00('0x46')]===_0xef00('0x47')){var _0x414ba8={'id':_0x457ac7['id'],'name':_0x457ac7[_0xef00('0x39')],'strategy':_0x457ac7['strategy'],'answered':_0x457ac7[_0xef00('0x48')],'available':_0x457ac7[_0xef00('0x49')],'loggedIn':_0x457ac7[_0xef00('0x4a')],'pTalking':_0x457ac7[_0xef00('0x4b')],'sumBillable':_0x457ac7[_0xef00('0x4c')],'sumDuration':_0x457ac7[_0xef00('0x4d')],'sumHoldTime':_0x457ac7[_0xef00('0x4e')]||0x0,'talking':_0x457ac7[_0xef00('0x4f')],'total':_0x457ac7[_0xef00('0x50')],'type':_0x457ac7[_0xef00('0x46')],'unmanaged':_0x457ac7[_0xef00('0x51')],'abandoned':_0x457ac7['abandoned'],'waiting':_0x457ac7[_0xef00('0x52')],'loggedInDb':_0x457ac7[_0xef00('0x53')],'dialActive':_0x457ac7['dialActive'],'dialMethod':_0x457ac7['dialMethod'],'dialOriginateCallerIdName':_0x457ac7['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x457ac7[_0xef00('0x54')],'dialOriginateTimeout':_0x457ac7[_0xef00('0x55')],'dialPrefix':_0x457ac7[_0xef00('0x56')],'outboundAnswerAgiCallsDay':_0x457ac7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x457ac7['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x457ac7[_0xef00('0x57')],'outboundBusyCallsDay':_0x457ac7[_0xef00('0x58')],'outboundCongestionCallsDay':_0x457ac7[_0xef00('0x59')],'outboundDropCallsDayACS':_0x457ac7['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x457ac7[_0xef00('0x5a')],'outboundDropCallsDayTimeout':_0x457ac7[_0xef00('0x5b')],'outboundNoAnswerCallsDay':_0x457ac7[_0xef00('0x5c')],'outboundNoSuchCallsDay':_0x457ac7[_0xef00('0x5d')],'outboundOriginateFailureCallsDay':_0x457ac7[_0xef00('0x5e')],'outboundReCallsDay':_0x457ac7[_0xef00('0x5f')],'outboundRejectCallsDay':_0x457ac7[_0xef00('0x60')],'outboundUnknownCallsDay':_0x457ac7['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x457ac7[_0xef00('0x61')],'predictiveIntervalAvgHoldtime':_0x457ac7[_0xef00('0x62')],'predictiveIntervalAvgTalktime':_0x457ac7[_0xef00('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x457ac7[_0xef00('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x457ac7[_0xef00('0x65')],'predictiveIntervalErlangCalls':_0x457ac7[_0xef00('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x457ac7[_0xef00('0x67')],'predictiveIntervalHitRate':_0x457ac7[_0xef00('0x68')],'predictiveIntervalMultiplicativeFactor':_0x457ac7['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x457ac7[_0xef00('0x69')],'predictiveIntervalAvailable':_0x457ac7[_0xef00('0x6a')],'predictiveIntervalTotalCalls':_0x457ac7['predictiveIntervalTotalCalls'],'message':_0x457ac7['message'],'originated':_0x457ac7[_0xef00('0x6b')],'erlangCalls':_0x457ac7['erlangCalls'],'erlangCallToSecond':_0x457ac7[_0xef00('0x6c')],'erlangAbandonmentRate':_0x457ac7[_0xef00('0x6d')],'erlangBusyFactor':_0x457ac7['erlangBusyFactor'],'startPredictive':_0x457ac7[_0xef00('0x22')],'startProgressive':_0x457ac7[_0xef00('0x23')]};if(_0x457ac7['Trunk']){_0x414ba8[_0xef00('0x6e')]={'id':_0x457ac7[_0xef00('0x6e')]['id'],'name':_0x457ac7[_0xef00('0x6e')][_0xef00('0x39')],'active':_0x457ac7['Trunk']['active'],'callerid':_0x457ac7[_0xef00('0x6e')]['callerid']};}if(_0x457ac7[_0xef00('0x3f')]){_0x414ba8[_0xef00('0x3f')]={'id':_0x457ac7['Interval']['id'],'name':_0x457ac7[_0xef00('0x3f')][_0xef00('0x39')]};}var _0x21aed8=md5(JSON[_0xef00('0x43')](_0x414ba8));if(_0x457ac7[_0xef00('0x5')]!==_0x21aed8){_0x457ac7[_0xef00('0x5')]=_0x21aed8;emit(util[_0xef00('0x6f')](_0xef00('0x70'),_0x414ba8[_0xef00('0x39')]),_0xef00('0x71'),_0x414ba8);}}}function emitCampaignSummary(_0x567e92){if(_0x567e92[_0xef00('0x46')]==='ivr'){emit(util[_0xef00('0x6f')](_0xef00('0x72'),_0x567e92[_0xef00('0x39')]),_0xef00('0x73'),_0x567e92);}}function checkGetDataPredictive(_0xcfb6c2){if(isNotNull(_0xcfb6c2)&&!_[_0xef00('0x74')](_0xcfb6c2)){loggerPredictive['info'](_0xef00('0x75'));loggerPredictive[_0xef00('0x76')](_0xef00('0x77'),_0xcfb6c2[_0xef00('0x78')]);loggerPredictive[_0xef00('0x76')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcfb6c2[_0xef00('0x61')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x79'),_0xcfb6c2[_0xef00('0x65')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcfb6c2[_0xef00('0x64')]);loggerPredictive['info'](_0xef00('0x7a'),_0xcfb6c2[_0xef00('0x62')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x7b'),_0xcfb6c2[_0xef00('0x63')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x7c'));if(_0xcfb6c2[_0xef00('0x78')]>0x0){if(!_['isUndefined'](_0xcfb6c2[_0xef00('0x63')])&&_0xcfb6c2[_0xef00('0x63')]>0x0){return!![];}loggerPredictive['info'](_0xef00('0x7d'));if(!_[_0xef00('0x7e')](_0xcfb6c2[_0xef00('0x62')])&&_0xcfb6c2[_0xef00('0x62')]>0x0){return!![];}loggerPredictive[_0xef00('0x76')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xef00('0x76')](_0xef00('0x7f'));}}else{loggerPredictive[_0xef00('0x76')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5a88dd){return function(_0x4602cc){loggerPredictive[_0xef00('0x76')](_0xef00('0x80'));loggerPredictive[_0xef00('0x76')](_0xef00('0x81'),_0x4602cc[_0xef00('0x82')]);loggerPredictive[_0xef00('0x76')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4602cc[_0xef00('0x6c')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x83'),_0x4602cc[_0xef00('0x6d')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x84'),_0x4602cc[_0xef00('0x85')]);loggerPredictive['info'](_0xef00('0x83'),_0x4602cc[_0xef00('0x6d')]);loggerPredictive[_0xef00('0x76')](_0xef00('0x7c'));_[_0xef00('0x86')](_0x5a88dd,_0x4602cc);};}function getDiff(_0x1a2bfe){var _0x4cb970=moment()[_0xef00('0x44')](0x0);var _0x4981d7=moment(_0x1a2bfe)[_0xef00('0x44')](0x0);return _0x4cb970[_0xef00('0x87')](_0x4981d7,_0xef00('0x88'));}function ifInterval(_0x1c0f12,_0x40692e){if(_['isUndefined'](_0x40692e)){return![];}return getDiff(_0x40692e)<_0x1c0f12*0x3c;}function freeVariablesPredictive(_0x10ca34){if(isNotNull(_0x10ca34)){if(!_[_0xef00('0x7e')](_0x10ca34['startProgressive'])){_0x10ca34[_0xef00('0x23')]=undefined;loggerPredictive[_0xef00('0x76')](_0x10ca34[_0xef00('0x39')],_0xef00('0x89'));}if(!_[_0xef00('0x7e')](_0x10ca34[_0xef00('0x22')])){_0x10ca34[_0xef00('0x22')]=undefined;loggerPredictive[_0xef00('0x76')](_0x10ca34[_0xef00('0x39')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xef00('0x7e')](_0x10ca34[_0xef00('0x8a')])){clearInterval(_0x10ca34[_0xef00('0x8a')]);_0x10ca34['handlePredictive']=undefined;loggerPredictive['info'](_0x10ca34[_0xef00('0x39')],_0xef00('0x8b'));}}}function erlangb(_0x5cb7a2,_0x528c63){if(_0x528c63===0x0){return 0x0;}var _0x16ed82=0x1;for(var _0x4c105b=0x1;_0x4c105b<=_0x528c63;_0x4c105b+=0x1){_0x16ed82=0x1+_0x16ed82*_0x4c105b/_0x5cb7a2;}return 0x1/_0x16ed82;}function isVoiceQueueOutbound(_0x3aa3ac){return _0x3aa3ac==='outbound';}function isNotPreview(_0x3edc70){return _0x3edc70!==_0xef00('0x1b');}function isCampaignIvr(_0x233352){return _0x233352===_0xef00('0x8c');}function getCallerId(_0x1991c9,_0x2d4e71,_0x28ac39){if(!_[_0xef00('0x7e')](_0x28ac39)&&typeof _0x28ac39===_0xef00('0x8d')&&!_['isEmpty'](_0x28ac39)){if(!_[_0xef00('0x7e')](_0x2d4e71)&&typeof _0x2d4e71==='string'&&!_[_0xef00('0x74')](_0x2d4e71)){return util[_0xef00('0x6f')](_0xef00('0x8e'),_0x2d4e71,_0x28ac39);}return util[_0xef00('0x6f')](_0xef00('0x8e'),_0x28ac39,_0x28ac39);}if(!_['isUndefined'](_0x1991c9)&&typeof _0x1991c9===_0xef00('0x8d')&&!_[_0xef00('0x74')](_0x1991c9)){return _0x1991c9;}return _0xef00('0x8f');}function loggerCatchQueueSummary(_0x3fa238,_0x4acdfa){return function(_0x33c395){freeVariablesPredictive(_0x4acdfa);emitVoiceQueueSummary(_0x4acdfa);emitCampaignSummary(_0x4acdfa);loggerSyncQueueSummary[_0xef00('0x90')](_0x3fa238,util[_0xef00('0x91')](_0x33c395,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x152ceb,_0x48d977){return function(_0x4714a1){loggerPredictive['error'](_0x48d977[_0xef00('0x39')],_0x152ceb);loggerPredictive[_0xef00('0x90')](_0x4714a1['stack']);freeVariablesPredictive(_0x48d977);};}function loggerCatch(_0x2128db){return function(_0x40576e){logger[_0xef00('0x90')](_0x2128db,util[_0xef00('0x91')](_0x40576e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x245ec7){return _0x245ec7&&!_[_0xef00('0x7e')](_0x245ec7)&&_0x245ec7[_0xef00('0x92')]>0x0;}function decremetOriginate(_0x3a729d){if(!_['isUndefined'](_0x3a729d)&&_0x3a729d!==null){if(typeof _0x3a729d[_0xef00('0x6b')]!==_0xef00('0x93')){if(_0x3a729d['originated']>0x0){_0x3a729d[_0xef00('0x6b')]-=0x1;}else{logger[_0xef00('0x90')](_0xef00('0x94'));}}}else{logger[_0xef00('0x90')](_0xef00('0x95'));}}function checkContactLowerLimitOriginate(_0x298992,_0x4c00b8,_0x24380e){if(_0x4c00b8>_0x24380e){for(var _0x4365a9=0x0;_0x4365a9<_0x4c00b8-_0x24380e;_0x4365a9+=0x1){decremetOriginate(_0x298992);}}}function loggerGetContactDialer(_0x5146d9,_0x5cefca,_0x57fd81){return function(_0x56cabe){checkContactLowerLimitOriginate(_0x5cefca,_0x57fd81,0x0);logger[_0xef00('0x90')](_0x5146d9,util[_0xef00('0x91')](_0x56cabe,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x12bed6){return function(_0x1d9371){if(isNotNull(_0x1d9371)&&isNotNull(_0x1d9371[0x0])){if(_0x1d9371[0x0][_0xef00('0x96')]>0x0){_0x12bed6['message']=_0xef00('0x97');logger[_0xef00('0x76')](_0xef00('0x98')+_0x12bed6[_0xef00('0x39')],_0x1d9371[0x0][_0xef00('0x96')],_0xef00('0x99'));}else{_0x12bed6[_0xef00('0x3b')]=_0xef00('0x9a');logger[_0xef00('0x76')](_0xef00('0x9b')+_0x12bed6[_0xef00('0x39')]);}}};}function notSendMessagesQueue(_0x385eac){if(_0x385eac[_0xef00('0x9c')]){freeVariablesPredictive(_0x385eac);if(_0x385eac[_0xef00('0x6b')]===0x0&&_0x385eac[_0xef00('0x4f')]===0x0&&_0x385eac[_0xef00('0x52')]===0x0&&(_0x385eac[_0xef00('0x4b')]||0x0)===0x0){_0x385eac[_0xef00('0x9c')]=![];_0x385eac[_0xef00('0x49')]=0x0;_0x385eac[_0xef00('0x3b')]=_0xef00('0x9d');loggerSyncQueueSummary[_0xef00('0x90')](_0xef00('0x9e'),_0x385eac['name'],_0xef00('0x9f'));}else{_0x385eac[_0xef00('0x3b')]=_0xef00('0xa0');loggerSyncQueueSummary[_0xef00('0x90')](_0xef00('0x9e'),_0x385eac[_0xef00('0x39')],_0xef00('0xa1'));}emitVoiceQueueSummary(_0x385eac);}}function notSendMessagesCampaign(_0x27e44a){if(_0x27e44a[_0xef00('0x9c')]){if(_0x27e44a[_0xef00('0x6b')]===0x0){_0x27e44a[_0xef00('0x9c')]=![];_0x27e44a[_0xef00('0x3b')]=_0xef00('0x9d');loggerSyncQueueSummary['error'](_0xef00('0xa2'),_0x27e44a[_0xef00('0x39')],_0xef00('0x9f'));}else{_0x27e44a[_0xef00('0x3b')]=_0xef00('0xa0');loggerSyncQueueSummary[_0xef00('0x90')](_0xef00('0xa2'),_0x27e44a[_0xef00('0x39')],'is\x20disactive');}emitCampaignSummary(_0x27e44a);}}function createObjHistory(_0x545cdd,_0x5713a,_0x5149ad,_0x3d4213,_0x592fbf){_0x545cdd[_0xef00('0x3b')]=_0x5149ad;var _0x2ee7ab=new Action(_0x545cdd,_0x5713a);var _0x425be0=new History(_0x2ee7ab);_0x425be0[_0xef00('0xa3')]=_0x3d4213;_0x425be0['statedesc']=_0x592fbf;_0x425be0[_0xef00('0xa4')]=_0x2ee7ab[_0xef00('0xa5')];return _0x425be0;}Dialer[_0xef00('0x18')][_0xef00('0x37')]=function(){var _0x2c2568=this;setInterval(function(){_0x2c2568[_0xef00('0xa6')](_0x2c2568['uniqueId'],_0xef00('0xa7'));_0x2c2568[_0xef00('0xa6')](_0x2c2568[_0xef00('0x20')],'[actions]');},0x32c8);};Dialer[_0xef00('0x18')][_0xef00('0xa6')]=function(_0x251231,_0x29041e){var _0x1f1eea=this;for(var _0x39b18b in _0x251231){if(typeof _0x251231[_0x39b18b]!==_0xef00('0x93')){this['sequence'][_0xef00('0xa8')](function(){if(!_['isNil'](_0x251231[_0x39b18b])){return ami[_0xef00('0xa9')]({'action':_0xef00('0xaa'),'channel':_0x251231[_0x39b18b][_0xef00('0xab')]})[_0xef00('0xac')](function(_0x1b6d60){if(_0x1b6d60[_0xef00('0x3b')]===_0xef00('0xad')){setTimeout(function(){if(_0x251231[_0x39b18b]&&_0x251231[_0x39b18b][_0xef00('0x46')]!=='ivr'){_0x1f1eea['updateOriginated'](_0x1f1eea[_0xef00('0x1c')][_0x251231[_0x39b18b]['queue']]);logger[_0xef00('0x90')](_0xef00('0xae'),_0x29041e,_0x39b18b,_0x251231[_0x39b18b][_0xef00('0xaf')]);delete _0x251231[_0x39b18b];}if(_0x251231[_0x39b18b]&&_0x251231[_0x39b18b][_0xef00('0x46')]===_0xef00('0x8c')){_0x1f1eea[_0xef00('0xb0')](_0x1f1eea[_0xef00('0x1d')][_0x251231[_0x39b18b]['queue']]);logger[_0xef00('0x90')]('[Dialer][checkChannel][ivr]',_0x29041e,_0x39b18b,_0x251231[_0x39b18b][_0xef00('0xaf')]);delete _0x251231[_0x39b18b];}},0x2328);}});}});}}};Dialer[_0xef00('0x18')][_0xef00('0xb1')]=function(_0xd24631){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopper['countReScheduled'](_0xd24631))['catch'](loggerCatch(_0xef00('0xb4')));};Dialer['prototype'][_0xef00('0xb5')]=function(_0x489b08){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopperBlack[_0xef00('0xb5')](_0x489b08))['catch'](loggerCatch(_0xef00('0xb6')));};Dialer[_0xef00('0x18')][_0xef00('0xb7')]=function(_0x41bbe6){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopperBlack[_0xef00('0xb7')](_0x41bbe6))['catch'](loggerCatch(_0xef00('0xb8')));};Dialer['prototype'][_0xef00('0xb9')]=function(_0x147d1c){return BPromise[_0xef00('0xb2')]()['then'](cmHopperHistory[_0xef00('0xba')](_0x147d1c))[_0xef00('0xac')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xef00('0x18')][_0xef00('0xbb')]=function(_0x32fea7){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopper['rescheduleContact'](_0x32fea7))[_0xef00('0xac')](loggerCatch(_0xef00('0xbc')));};Dialer[_0xef00('0x18')][_0xef00('0xbd')]=function(_0x4ed643,_0x3f14ce,_0x497c2a){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopper[_0xef00('0xbd')](_0x4ed643,_0x3f14ce,_0x497c2a))['catch'](loggerCatch(_0xef00('0xbe')));};Dialer[_0xef00('0x18')][_0xef00('0xbf')]=function(_0x2f0627,_0x54db7d,_0x2b2366,_0x41f7fe,_0x27d2f0){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopper[_0xef00('0xbf')](_0x2f0627,_0x54db7d,_0x2b2366,_0x41f7fe))[_0xef00('0xac')](function(_0xb665b7){_0x27d2f0['temp']-=_0x2b2366;_0x27d2f0['temp']=_0x27d2f0['temp']>0x0?_0x27d2f0[_0xef00('0xc0')]:0x0;loggerCatch('[getContactDialer]\x20')(_0xb665b7);});};Dialer[_0xef00('0x18')][_0xef00('0xc1')]=function(_0x8615dd,_0x296a81,_0xb642ca,_0x2694c4){return BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](cmHopper[_0xef00('0xc1')](_0x8615dd,_0x296a81,_0xb642ca))[_0xef00('0xac')](function(_0x4f640c){_0x2694c4[_0xef00('0xc0')]-=_0x296a81;_0x2694c4['temp']=_0x2694c4[_0xef00('0xc0')]>0x0?_0x2694c4[_0xef00('0xc0')]:0x0;loggerCatch(_0xef00('0xc2'))(_0x4f640c);});};Dialer[_0xef00('0x18')][_0xef00('0xc3')]=function(_0x1471ba){return BPromise[_0xef00('0xb2')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x1471ba))[_0xef00('0xac')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xef00('0x18')][_0xef00('0xc4')]=function(_0x49511e){return BPromise['resolve']()[_0xef00('0xb3')](cmHopper[_0xef00('0xc4')](_0x49511e))[_0xef00('0xac')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xef00('0x18')]['createHistory']=function(_0x207f69){return BPromise[_0xef00('0xb2')]()['then'](cmHopperHistory[_0xef00('0xc5')](_0x207f69))['catch'](loggerCatch(_0xef00('0xc6')));};Dialer[_0xef00('0x18')][_0xef00('0xb0')]=function(_0x5400d3){if(!_[_0xef00('0x7e')](_0x5400d3)&&_0x5400d3!==null){if(typeof _0x5400d3['originated']!=='undefined'){if(_0x5400d3[_0xef00('0x6b')]>0x0){_0x5400d3['originated']-=0x1;}else{logger['error'](_0xef00('0xc7'));}}}else{logger[_0xef00('0x90')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xef00('0x18')]['loggerHandler']=function(_0x4e94a5,_0x38a87b){var _0x39be3c=this;return function(_0x1a8731){_0x39be3c[_0xef00('0xb0')](_0x38a87b);logger[_0xef00('0x90')](_0x4e94a5,util[_0xef00('0x91')](_0x1a8731,{'showHidden':![],'depth':null}));};};Dialer[_0xef00('0x18')]['emptyContact']=function(_0x46d8bb,_0x580765,_0x42e210){var _0x1c9298={'state':0x19,'statedesc':_0xef00('0xc8')};this[_0xef00('0xb0')](_0x580765);this[_0xef00('0xc9')](_['merge'](_0x1c9298,_['pick'](_0x42e210,[_0xef00('0xca'),_0xef00('0xcb'),_0xef00('0xcc'),_0xef00('0xcd'),'CampaignId'])),'[emptyContact][createHistory]',_0xef00('0xce'));logger['error'](_0x46d8bb);};Dialer[_0xef00('0x18')][_0xef00('0xcf')]=function(_0x2fdb3c){return _0x2fdb3c===_0xef00('0xd0');};Dialer[_0xef00('0x18')][_0xef00('0xd1')]=function(_0x476c3e){return!_[_0xef00('0x7e')](_0x476c3e)&&_0x476c3e&&!_[_0xef00('0x7e')](_0x476c3e[_0xef00('0x39')])&&!_[_0xef00('0x7e')](_0x476c3e[_0xef00('0xd2')])&&_0x476c3e[_0xef00('0xd2')]&&(this[_0xef00('0xd3')][util[_0xef00('0x6f')](_0xef00('0xd4'),_0x476c3e[_0xef00('0x39')])][_0xef00('0xaa')]===_0xef00('0xd5')||this[_0xef00('0xd3')][util[_0xef00('0x6f')](_0xef00('0xd4'),_0x476c3e['name'])][_0xef00('0xaa')]===_0xef00('0xd6'));};Dialer['prototype'][_0xef00('0xc9')]=function(_0x1802e5,_0x507975,_0x55f12e){this[_0xef00('0xc5')](_0x1802e5)[_0xef00('0xac')](loggerCatch(_0x507975));this[_0xef00('0xc4')](_0x1802e5)[_0xef00('0xac')](loggerCatch(_0x55f12e));};Dialer['prototype'][_0xef00('0xd7')]=function(_0x585bab){var _0x42c0da=this[_0xef00('0xd8')][_0x585bab[_0xef00('0xd9')]];var _0x4c3cdc;if(!_[_0xef00('0xda')](_0x585bab)&&!_[_0xef00('0xda')](_0x585bab[_0xef00('0xdb')])&&!_[_0xef00('0xda')](_0x585bab['variable']['amdstatus'])&&_0x585bab[_0xef00('0xdc')]==='xcally-motion-dialer'&&_0x42c0da){if(_0x42c0da[_0xef00('0x46')]!=='ivr'&&this[_0xef00('0x1c')][_0x42c0da[_0xef00('0xaf')]][_0xef00('0xdd')]&&_0x585bab['value']==='HANGUP'){delete this[_0xef00('0xd8')][_0x585bab['uniqueid']];this[_0xef00('0xb0')](this['voiceQueues'][_0x42c0da[_0xef00('0xaf')]]);this[_0xef00('0x1c')][_0x42c0da[_0xef00('0xaf')]]['outboundAnswerCallsDay']+=0x1;this[_0xef00('0x1c')][_0x42c0da['queue']][_0xef00('0xde')]+=0x1;_0x4c3cdc=new Hangup(_0x42c0da,_0x585bab);_0x4c3cdc[_0xef00('0xa3')]=0x12;_0x4c3cdc[_0xef00('0xdf')]='HangupInAMD';_0x4c3cdc['membername']=_0xef00('0xe0');ami[_0xef00('0x45')]('custom:amd',ut['buildObj'](_0x4c3cdc,_0xef00('0xe1')));this['saveInDb'](_0x4c3cdc,_0xef00('0xe2'),'[syncHangupInAMD]');}if(_0x42c0da[_0xef00('0x46')]!==_0xef00('0x8c')&&this[_0xef00('0x1c')][_0x42c0da[_0xef00('0xaf')]]['dialAMDActive']&&_0x585bab['value']===_0xef00('0xe3')){var _0x5228ad=this;return new BPromise(function(_0x13add9,_0x43e204){delete _0x5228ad['uniqueId'][_0x585bab[_0xef00('0xd9')]];_0x5228ad[_0xef00('0xb0')](_0x5228ad[_0xef00('0x1c')][_0x42c0da[_0xef00('0xaf')]]);_0x5228ad[_0xef00('0x1c')][_0x42c0da['queue']][_0xef00('0xe4')]+=0x1;_0x5228ad['voiceQueues'][_0x42c0da['queue']][_0xef00('0xde')]+=0x1;var _0x5f3fe0=_0x5228ad[_0xef00('0x1c')][_0x42c0da[_0xef00('0xaf')]];var _0x4c501a=new Hangup(_0x42c0da,_0x585bab);_0x4c501a[_0xef00('0xa3')]=0x13;_0x4c501a['statedesc']='Machine';_0x4c501a['membername']='AMD';_0x4c501a[_0xef00('0xe5')]+=0x1;_0x4c501a[_0xef00('0xe6')]+=0x1;_0x4c501a[_0xef00('0xe1')]=!![];ami[_0xef00('0x45')](_0xef00('0xe7'),ut[_0xef00('0xe8')](_0x4c501a,'amd'));_0x5228ad[_0xef00('0xc5')](_0x4c501a)[_0xef00('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4c501a['countbusyretry']+_0x4c501a[_0xef00('0xe9')]+_0x4c501a['countnoanswerretry']+_0x4c501a[_0xef00('0xea')]+_0x4c501a['countdropretry']+_0x4c501a[_0xef00('0xeb')]+_0x4c501a[_0xef00('0xe5')]+_0x4c501a[_0xef00('0xec')]>=_0x5f3fe0[_0xef00('0xed')]){_0x5228ad[_0xef00('0xee')](_0x4c501a,_0x13add9,_0x43e204,'reason19\x20machine....');}else{if(_0x4c501a[_0xef00('0xe5')]>=_0x5f3fe0[_0xef00('0xef')]){_0x5228ad[_0xef00('0xf0')](_0x4c501a,_0x13add9,_0x43e204,'reason\x2019\x20machine....');}else{_0x5228ad[_0xef00('0xbb')]({'active':![],'countmachineretry':_0x4c501a[_0xef00('0xe5')],'scheduledat':moment()[_0xef00('0xf1')](_0x5f3fe0[_0xef00('0xf2')],_0xef00('0xf3'))[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0x4c501a[_0xef00('0xca')],'ListId':_0x4c501a[_0xef00('0xcb')],'VoiceQueueId':_0x4c501a[_0xef00('0xcd')]||undefined,'CampaignId':_0x4c501a[_0xef00('0xf5')]||undefined})['catch'](loggerCatch(_0xef00('0xf6')));_0x13add9({'reschedule':0x1});}}});}if(_0x42c0da['type']===_0xef00('0x8c')&&this[_0xef00('0x1d')][_0x42c0da[_0xef00('0xaf')]][_0xef00('0xdd')]&&_0x585bab['value']===_0xef00('0xf7')){delete this[_0xef00('0xd8')][_0x585bab[_0xef00('0xd9')]];this['updateOriginated'](this['campaigns'][_0x42c0da[_0xef00('0xaf')]]);_0x4c3cdc=new Hangup(_0x42c0da,_0x585bab);_0x4c3cdc[_0xef00('0xa3')]=0x12;_0x4c3cdc['statedesc']=_0xef00('0xf8');_0x4c3cdc[_0xef00('0xf9')]='AMD';ami[_0xef00('0x45')](_0xef00('0xe7'),ut[_0xef00('0xe8')](_0x4c3cdc,_0xef00('0xe1')));this[_0xef00('0xc9')](_0x4c3cdc,_0xef00('0xfa'),'[syncHangupInAMDIvr]');}if(_0x42c0da['type']===_0xef00('0x8c')&&this['campaigns'][_0x42c0da[_0xef00('0xaf')]]['dialAMDActive']&&_0x585bab[_0xef00('0xfb')]===_0xef00('0xe3')){var _0x5228ad=this;return new BPromise(function(_0x31e9e5,_0x6a1973){delete _0x5228ad[_0xef00('0xd8')][_0x585bab[_0xef00('0xd9')]];_0x5228ad[_0xef00('0xb0')](_0x5228ad[_0xef00('0x1d')][_0x42c0da['queue']]);_0x5228ad[_0xef00('0x1d')][_0x42c0da[_0xef00('0xaf')]]['outboundAnswerCallsDay']+=0x1;_0x5228ad['campaigns'][_0x42c0da[_0xef00('0xaf')]][_0xef00('0xde')]+=0x1;var _0x4bedb8=_0x5228ad[_0xef00('0x1d')][_0x42c0da[_0xef00('0xaf')]];var _0x3d8562=new Hangup(_0x42c0da,_0x585bab);_0x3d8562['state']=0x13;_0x3d8562['statedesc']='Machine';_0x3d8562[_0xef00('0xf9')]=_0xef00('0xe0');_0x3d8562[_0xef00('0xe5')]+=0x1;_0x3d8562[_0xef00('0xe6')]+=0x1;_0x3d8562[_0xef00('0xe1')]=!![];ami[_0xef00('0x45')](_0xef00('0xe7'),ut[_0xef00('0xe8')](_0x3d8562,_0xef00('0xe1')));_0x5228ad['createHistory'](_0x3d8562)[_0xef00('0xac')](loggerCatch(_0xef00('0xfc')));if(_0x3d8562[_0xef00('0xfd')]+_0x3d8562[_0xef00('0xe9')]+_0x3d8562[_0xef00('0xfe')]+_0x3d8562[_0xef00('0xea')]+_0x3d8562[_0xef00('0xff')]+_0x3d8562[_0xef00('0xeb')]+_0x3d8562[_0xef00('0xe5')]+_0x3d8562[_0xef00('0xec')]>=_0x4bedb8['dialGlobalMaxRetry']){_0x5228ad[_0xef00('0xee')](_0x3d8562,_0x31e9e5,_0x6a1973,_0xef00('0x100'));}else{if(_0x3d8562[_0xef00('0xe5')]>=_0x4bedb8[_0xef00('0xef')]){_0x5228ad['createStateFinal'](_0x3d8562,_0x31e9e5,_0x6a1973,_0xef00('0x101'));}else{_0x5228ad[_0xef00('0xbb')]({'active':![],'countmachineretry':_0x3d8562[_0xef00('0xe5')],'scheduledat':moment()[_0xef00('0xf1')](_0x4bedb8[_0xef00('0xf2')],_0xef00('0xf3'))[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0x3d8562[_0xef00('0xca')],'ListId':_0x3d8562[_0xef00('0xcb')],'VoiceQueueId':_0x3d8562['VoiceQueueId']||undefined,'CampaignId':_0x3d8562[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0xf6')));_0x31e9e5({'reschedule':0x1});}}});}}};Dialer[_0xef00('0x18')][_0xef00('0x2f')]=function(_0x55388f){var _0x276f07=this[_0xef00('0xd8')][_0x55388f['uniqueid']];var _0x181bbe=this;var _0x54da61;if(_0x276f07&&_0x276f07[_0xef00('0x46')]==='ivr'){delete this['uniqueId'][_0x55388f['uniqueid']];this['updateOriginated'](this[_0xef00('0x1d')][_0x276f07[_0xef00('0xaf')]]);this['campaigns'][_0x276f07[_0xef00('0xaf')]][_0xef00('0x102')]+=0x1;_0x54da61=new Hangup(_0x276f07,_0x55388f);this[_0xef00('0xc5')](_0x54da61)[_0xef00('0xac')](loggerCatch(_0xef00('0x103')));this['moveContactManagedDialer'](_0x54da61)[_0xef00('0xac')](loggerCatch(_0xef00('0x104')));}if(_0x276f07&&_0x276f07[_0xef00('0x46')]!==_0xef00('0x8c')&&isNotNull(this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]]['dialQueueProject'])){delete this[_0xef00('0xd8')][_0x55388f[_0xef00('0xd9')]];this['updateOriginated'](this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]]);this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]][_0xef00('0xe4')]+=0x1;this['voiceQueues'][_0x276f07[_0xef00('0xaf')]][_0xef00('0xde')]+=0x1;_0x54da61=new Hangup(_0x276f07,_0x55388f);_0x54da61[_0xef00('0xa3')]=0x10;_0x54da61[_0xef00('0xdf')]='AnswerAGI';_0x54da61[_0xef00('0xf9')]=_0xef00('0x105');this[_0xef00('0xc5')](_0x54da61)[_0xef00('0xac')](loggerCatch(_0xef00('0x103')));this[_0xef00('0xc4')](_0x54da61)['catch'](loggerCatch(_0xef00('0x104')));}if(_0x276f07&&_0x276f07['type']!==_0xef00('0x8c')&&!isNotNull(this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]][_0xef00('0x106')])){delete this[_0xef00('0xd8')][_0x55388f['uniqueid']];this[_0xef00('0xb0')](this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]]);this[_0xef00('0x1c')][_0x276f07[_0xef00('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x54da61=new Hangup(_0x276f07,_0x55388f);_0x54da61[_0xef00('0xa3')]=0xc;_0x54da61['statedesc']=_0x55388f[_0xef00('0x107')];_0x54da61[_0xef00('0xf9')]=_0xef00('0x108');this[_0xef00('0xc5')](_0x54da61)['catch'](loggerCatch(_0xef00('0x103')));this[_0xef00('0xc4')](_0x54da61)[_0xef00('0xac')](loggerCatch(_0xef00('0x104')));}};Dialer['prototype'][_0xef00('0x109')]=function(_0x1e4dbb){var _0x11f279=this[_0xef00('0xd8')][_0x1e4dbb[_0xef00('0xd9')]];var _0x5b38f4=this;if(this[_0xef00('0x1c')][_0x1e4dbb[_0xef00('0xaf')]]){if(_0x11f279&&_0x11f279[_0xef00('0x46')]!=='ivr'){delete this['uniqueId'][_0x1e4dbb['uniqueid']];this[_0xef00('0x1c')][_0x1e4dbb['queue']]['outboundAnswerCallsDay']+=0x1;var _0x3d0309=new AgentComplete(_0x11f279,_0x1e4dbb);if(_0x1e4dbb[_0xef00('0x10a')]===_0xef00('0x10b')){_0x3d0309[_0xef00('0x10c')]=this['voiceQueues'][_0x1e4dbb[_0xef00('0xaf')]]['dialQueueProject2']&&this[_0xef00('0x1c')][_0x1e4dbb['queue']][_0xef00('0x10d')]?moment()[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x3d0309)[_0xef00('0xac')](loggerCatch(_0xef00('0x10e')));this['moveContactManagedDialer'](_0x3d0309)[_0xef00('0xac')](loggerCatch(_0xef00('0x10f')));}}};Dialer[_0xef00('0x18')][_0xef00('0x26')]=function(_0x4b3d85){if(this[_0xef00('0x1c')][_0x4b3d85[_0xef00('0xaf')]]){if(this[_0xef00('0xd8')][_0x4b3d85[_0xef00('0xd9')]]&&this[_0xef00('0xd8')][_0x4b3d85[_0xef00('0xd9')]][_0xef00('0x46')]!==_0xef00('0x8c')){this[_0xef00('0xb0')](this[_0xef00('0x1c')][_0x4b3d85[_0xef00('0xaf')]]);this[_0xef00('0xd8')][_0x4b3d85[_0xef00('0xd9')]][_0xef00('0x110')]=moment()[_0xef00('0x6f')](_0xef00('0xf4'));}}};Dialer[_0xef00('0x18')]['queueCallerAbandonCreateState']=function(_0x3030f7){this[_0xef00('0xc5')](_0x3030f7)[_0xef00('0xac')](loggerCatch(_0xef00('0x10e')));this['moveContactManagedDialer'](_0x3030f7)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xef00('0x18')][_0xef00('0x27')]=function(_0x50edf3){var _0x11924f=this['uniqueId'][_0x50edf3[_0xef00('0xd9')]];var _0xba33d2=this;if(this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]]){if(_0x11924f&&_0x11924f[_0xef00('0x46')]!==_0xef00('0x8c')){delete this[_0xef00('0xd8')][_0x50edf3[_0xef00('0xd9')]];this[_0xef00('0xb0')](this[_0xef00('0x1c')][_0x50edf3['queue']]);_0x11924f[_0xef00('0x111')]=moment()[_0xef00('0x6f')](_0xef00('0xf4'));var _0x1bd259=new QueueCallerAbandon(_0x11924f,_0x50edf3);if(getSeconds(_0x11924f[_0xef00('0x111')],_0x11924f[_0xef00('0x112')])>=_0x11924f[_0xef00('0x113')]){this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1bd259[_0xef00('0xa3')]=0xa;_0x1bd259[_0xef00('0xdf')]=_0xef00('0x114');_0x1bd259[_0xef00('0x115')]=_0xef00('0x116');_0x1bd259[_0xef00('0x10c')]=this[_0xef00('0x1c')][_0x50edf3['queue']][_0xef00('0x117')]?moment()['format'](_0xef00('0xf4')):undefined;_0x1bd259[_0xef00('0xff')]+=0x1;_0x1bd259[_0xef00('0xe6')]+=0x1;if(_0x1bd259[_0xef00('0xff')]>=this['voiceQueues'][_0x50edf3['queue']][_0xef00('0x118')]){this[_0xef00('0x119')](_0x1bd259);}else{this[_0xef00('0xbb')]({'active':![],'countdropretry':_0x1bd259[_0xef00('0xff')],'scheduledat':moment()[_0xef00('0xf1')](this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]][_0xef00('0x11a')],'minutes')[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0x11924f['ContactId'],'ListId':_0x11924f[_0xef00('0xcb')],'VoiceQueueId':_0x11924f[_0xef00('0xcd')]||undefined,'CampaignId':_0x11924f[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x11b')));var _0x21e775=new History(_0x1bd259);_0x21e775[_0xef00('0xa3')]=0xa;_0x21e775[_0xef00('0xdf')]=_0xef00('0x114');_0x21e775[_0xef00('0xa5')]=moment()[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');_0x21e775[_0xef00('0xa4')]=_0x21e775[_0xef00('0xa5')];_0x21e775['calleridname']=_0x1bd259['calleridname'];_0x21e775[_0xef00('0x11c')]=_0x1bd259['calleridnum'];this['createHistory'](_0x21e775)[_0xef00('0xac')](loggerCatch(_0xef00('0x11d')));}}else{this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]][_0xef00('0x64')]+=0x1;this['voiceQueues'][_0x50edf3[_0xef00('0xaf')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1bd259[_0xef00('0xa3')]=0xb;_0x1bd259[_0xef00('0xdf')]=_0xef00('0x11e');_0x1bd259[_0xef00('0x115')]=_0xef00('0x11f');_0x1bd259['countabandonedretry']+=0x1;_0x1bd259[_0xef00('0xe6')]+=0x1;if(_0x1bd259[_0xef00('0xeb')]>=this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x1bd259);}else{this[_0xef00('0xbb')]({'active':![],'countabandonedretry':_0x1bd259[_0xef00('0xeb')],'scheduledat':moment()[_0xef00('0xf1')](this[_0xef00('0x1c')][_0x50edf3[_0xef00('0xaf')]][_0xef00('0x120')],_0xef00('0xf3'))[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0x11924f[_0xef00('0xca')],'ListId':_0x11924f[_0xef00('0xcb')],'VoiceQueueId':_0x11924f['VoiceQueueId']||undefined,'CampaignId':_0x11924f[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x21e775=new History(_0x1bd259);_0x21e775['state']=0xb;_0x21e775[_0xef00('0xdf')]=_0xef00('0x11e');_0x21e775[_0xef00('0xa5')]=moment()[_0xef00('0x6f')](_0xef00('0xf4'));_0x21e775[_0xef00('0xa4')]=_0x21e775[_0xef00('0xa5')];_0x21e775['calleridname']=_0x1bd259['calleridname'];_0x21e775[_0xef00('0x11c')]=_0x1bd259[_0xef00('0x11c')];this[_0xef00('0xc5')](_0x21e775)[_0xef00('0xac')](loggerCatch(_0xef00('0x121')));}}}}};Dialer[_0xef00('0x18')][_0xef00('0x31')]=function(_0x4e7f05){if(this['actions'][_0x4e7f05[_0xef00('0xd9')]]){this[_0xef00('0x20')][_0x4e7f05['uniqueid']][_0xef00('0xab')]=_0x4e7f05['channel'];}if(this[_0xef00('0xd8')][_0x4e7f05[_0xef00('0xd9')]]){this['uniqueId'][_0x4e7f05[_0xef00('0xd9')]][_0xef00('0xab')]=_0x4e7f05[_0xef00('0xab')];}};Dialer['prototype']['syncQueueMember']=function(_0x59b873){if(strategy[this['voiceQueues'][this[_0xef00('0x20')][_0x59b873['actionid']][_0xef00('0xaf')]][_0xef00('0x122')]]===_0xef00('0x17')){if(this[_0xef00('0x20')][_0x59b873['actionid']]&&_['isNil'](this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]][_0xef00('0x124')])&&_0x59b873[_0xef00('0xaa')]==='1'&&_0x59b873[_0xef00('0x125')]==='0'){if(this[_0xef00('0x1e')][_0x59b873[_0xef00('0x126')]]){if(!this[_0xef00('0x1e')][_0x59b873[_0xef00('0x126')]][_0xef00('0x124')]){this[_0xef00('0x1e')][_0x59b873[_0xef00('0x126')]][_0xef00('0x124')]=!![];this[_0xef00('0x20')][_0x59b873['actionid']]['locked']=!![];this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]][_0xef00('0x126')]=_0x59b873[_0xef00('0x126')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x59b873['actionid']][_0xef00('0xaf')]][_0xef00('0x122')]]||'rrmemory')===_0xef00('0x16')){if(this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]]){if(this['agents'][_0x59b873[_0xef00('0x126')]]){this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]][_0xef00('0x126')]=_0x59b873[_0xef00('0x126')];if(_[_0xef00('0xda')](this[_0xef00('0x24')][this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]][_0xef00('0xaf')]])){this[_0xef00('0x24')][this['actions'][_0x59b873[_0xef00('0x123')]][_0xef00('0xaf')]]=[];}this[_0xef00('0x24')][this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]]['queue']][_0xef00('0x127')](_['merge'](_[_0xef00('0x128')](this[_0xef00('0x20')][_0x59b873[_0xef00('0x123')]],['idHopper',_0xef00('0x126')]),{'status':_0x59b873[_0xef00('0xaa')],'paused':_0x59b873[_0xef00('0x125')]}));}}}};function unlockQueueStatus(_0xbb5084,_0x5ec173){setTimeout(function(){if(_['isUndefined'](_0xbb5084[_0xef00('0x129')])){loggerBooked[_0xef00('0x90')]('[unlockQueueStatus][undefined]',_0x5ec173);}_0xbb5084[_0xef00('0x129')]=!![];loggerBooked[_0xef00('0x76')](_0xef00('0x12a'),_0x5ec173,JSON['stringify'](_[_0xef00('0x128')](_0xbb5084,[_0xef00('0x39'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xef00('0x18')][_0xef00('0x35')]=function(_0x5c8856){var _0x233c2d=this;var _0x3105cd=_0x233c2d['voiceQueues'][_0x233c2d[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]];if(strategy[this[_0xef00('0x1c')][this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]][_0xef00('0x122')]]===_0xef00('0x17')){if(this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]]&&this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0x126')]){this[_0xef00('0x1b')][_0xef00('0x12b')](this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0x12c')],this[_0xef00('0x20')][_0x5c8856['actionid']][_0xef00('0x126')])[_0xef00('0xac')](function(_0x1c2ab0){logger[_0xef00('0x90')](_0xef00('0x12d'),util['inspect'](_0x1c2ab0,{'showHidden':![],'depth':null}));})[_0xef00('0x1a')](function(){_0x233c2d[_0xef00('0xb0')](_0x233c2d[_0xef00('0x1c')][_0x233c2d[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]]);_0x233c2d[_0xef00('0x1e')][_0x233c2d[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]]['stateinterface']][_0xef00('0x124')]=![];delete _0x233c2d['actions'][_0x5c8856[_0xef00('0x123')]];unlockQueueStatus(_0x3105cd);});}else{this[_0xef00('0xb0')](this['voiceQueues'][this[_0xef00('0x20')][_0x5c8856['actionid']]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xef00('0x20')][_0x5c8856['actionid']][_0xef00('0xca')],'ListId':this['actions'][_0x5c8856[_0xef00('0x123')]][_0xef00('0xcb')],'VoiceQueueId':this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xcd')]||undefined,'CampaignId':this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x12e')));delete this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]];unlockQueueStatus(_0x3105cd);}}else if((strategy[this[_0xef00('0x1c')][this['actions'][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]][_0xef00('0x122')]]||_0xef00('0x16'))==='rrmemory'){var _0x5187b2;if(this['actions'][_0x5c8856[_0xef00('0x123')]]&&!_['isEmpty'](this[_0xef00('0x24')][this[_0xef00('0x20')][_0x5c8856['actionid']][_0xef00('0xaf')]])){if(this[_0xef00('0x25')][_0x233c2d[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]]['queue']]){this[_0xef00('0x25')][_0x233c2d[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]]=this['queueBookedRR'][this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]]?this[_0xef00('0x25')][this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]]:this[_0xef00('0x24')][this[_0xef00('0x20')][_0x5c8856['actionid']][_0xef00('0xaf')]]?this[_0xef00('0x24')][this['actions'][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]][_0xef00('0x12f')]||0x0:0x0;}this[_0xef00('0x24')][this['actions'][_0x5c8856['actionid']]['queue']][_0xef00('0x12f')]=this['queueBookedRR'][this[_0xef00('0x20')][_0x5c8856[_0xef00('0x123')]][_0xef00('0xaf')]];for(var _0x6a5bf4=0x0;_0x6a5bf4=0x0;})['catch'](myreject(_0x4e37ab)));}}else{_0x4cfac5[_0xef00('0x127')](ami['Action']({'action':_0xef00('0x147'),'command':util[_0xef00('0x6f')]('iftime\x20%s,%s',_0x4616e5,!_[_0xef00('0x7e')](config[_0xef00('0x143')][_0x22fb9b])?_0x22fb9b:'')})[_0xef00('0xb3')](function(_0x2a66d7){return _0x2a66d7[_0xef00('0x14a')][_0xef00('0x14c')](_0xef00('0x14b'))>=0x0;})[_0xef00('0xac')](myreject(_0x4e37ab)));}BPromise[_0xef00('0x14d')](_0x4cfac5)[_0xef00('0xb3')](function(_0x2fb7){var _0x2863c6=_[_0xef00('0x14e')](_0x2fb7);if(_0x2863c6){return _0x1074df(_0x2863c6);}else{_0x111775['message']=_0x453738?'GLOBAL_INTERVAL_IS_OVERTIME':_0xef00('0x14f');return _0x4e37ab(msgResponse(_0xef00('0x150'),'Failure','Global:\x20'+_0x453738+'\x20'+_0x4cf7c0+_0xef00('0x151')+util[_0xef00('0x91')](_0x4616e5,{'showHidden':![],'depth':null})+_0xef00('0x152')+_0x22fb9b));}})['catch'](function(_0x22fe09){return _0x4e37ab(msgResponse(_0xef00('0x13d'),_0xef00('0x141'),JSON[_0xef00('0x43')](_0x22fe09)));});});};Dialer[_0xef00('0x18')][_0xef00('0x153')]=function(_0x850ed2){var _0x57e15f=this;return function(){switch(_0x850ed2[_0xef00('0x154')]){case _0xef00('0x155'):freeVariablesPredictive(_0x850ed2);_0x57e15f[_0xef00('0x156')](_0x850ed2,0x1);break;case _0xef00('0x157'):freeVariablesPredictive(_0x850ed2);_0x57e15f['handlePower'](_0x850ed2,_0x850ed2[_0xef00('0x158')]);break;case _0xef00('0xc'):_0x57e15f[_0xef00('0xc')](_0x850ed2);break;case _0xef00('0xb'):freeVariablesPredictive(_0x850ed2);_0x57e15f[_0xef00('0x156')](_0x850ed2,0x1);break;default:freeVariablesPredictive(_0x850ed2);logger[_0xef00('0x90')](_0xef00('0x159'),_0x850ed2[_0xef00('0x39')],_0xef00('0x15a'));}};};Dialer[_0xef00('0x18')][_0xef00('0x15b')]=function(_0x272e30){var _0x5d3799=this;return function(){_0x5d3799[_0xef00('0x15c')](_0x272e30);};};Dialer[_0xef00('0x18')][_0xef00('0x2d')]=function(_0xaa38b6){var _0x371855=this;if(isNotPreview(_0xaa38b6[_0xef00('0x154')])){if(isVoiceQueueOutbound(_0xaa38b6[_0xef00('0x46')])&&isActive(_0xaa38b6[_0xef00('0x15d')])){_0xaa38b6[_0xef00('0x9c')]=!![];BPromise[_0xef00('0xb2')]()['then'](checkIsLoggedIn(_0xaa38b6,_0xaa38b6['loggedIn']))[_0xef00('0xb3')](checkIsActive(_0xaa38b6,_0xaa38b6[_0xef00('0x15d')]))[_0xef00('0xb3')](checkInterval(_0xaa38b6))[_0xef00('0xb3')](_0x371855[_0xef00('0x138')](_0xaa38b6))[_0xef00('0xb3')](_0x371855[_0xef00('0x13c')](_0xaa38b6[_0xef00('0x15e')],_0xaa38b6['dialTimezone'],_0xaa38b6[_0xef00('0x39')],_0xaa38b6))[_0xef00('0xb3')](_0x371855[_0xef00('0x13e')](_0xaa38b6[_0xef00('0x3f')],_0xaa38b6['dialTimezone'],_0xaa38b6[_0xef00('0x39')],_0xaa38b6))['then'](_0x371855['checkDialMethod'](_0xaa38b6))[_0xef00('0xac')](loggerCatchQueueSummary(_0xef00('0x15f'),_0xaa38b6));}else{notSendMessagesQueue(_0xaa38b6);}}else{freeVariablesPredictive(_0xaa38b6);}};Dialer[_0xef00('0x18')]['syncCampaigns']=function(){var _0x1633a1=this;var _0x48511b;for(var _0x45efd9 in this[_0xef00('0x1d')]){if(typeof this[_0xef00('0x1d')][_0x45efd9]!==_0xef00('0x93')){_0x48511b=this[_0xef00('0x1d')][_0x45efd9];if(isCampaignIvr(_0x48511b[_0xef00('0x46')])&&isActive(_0x48511b[_0xef00('0xd2')])){_0x48511b[_0xef00('0x9c')]=!![];BPromise[_0xef00('0xb2')]()[_0xef00('0xb3')](checkIsActive(_0x48511b,_0x48511b['active']))['then'](checkInterval(_0x48511b))[_0xef00('0xb3')](_0x1633a1[_0xef00('0x138')](_0x48511b))['then'](_0x1633a1['checkIfTime'](_0x48511b['dialGlobalInterval'],_0x48511b['dialTimezone'],_0x48511b[_0xef00('0x39')],_0x48511b))[_0xef00('0xb3')](_0x1633a1[_0xef00('0x13e')](_0x48511b[_0xef00('0x3f')],_0x48511b[_0xef00('0x160')],_0x48511b[_0xef00('0x39')],_0x48511b))[_0xef00('0xb3')](_0x1633a1['launchHandleIvr'](_0x48511b))[_0xef00('0xac')](loggerCatchQueueSummary(_0xef00('0x161'),_0x48511b));}else{notSendMessagesCampaign(_0x48511b);}}}};function getCallerIdRandom(_0x241f02,_0x4ef718){var _0x280488;var _0x4f0f31;var _0x420c84;if(_0x4ef718<=0x0){_0x4ef718=0x1;}_0x280488=new RegExp(_0xef00('0x162')+_0x4ef718+'}$');_0x4f0f31=Math[_0xef00('0x163')](0xa,_0x4ef718-0x1);_0x420c84=Math[_0xef00('0x163')](0xa,_0x4ef718)-0x1;return util[_0xef00('0x6f')]('%s',_['replace'](_0x241f02,_0x280488,_[_0xef00('0x164')](_0x4f0f31,_0x420c84)));}function extractCalleridName(_0x504e95){var _0x27b0b3=_0x504e95[_0xef00('0x165')](/"(.*?)"/);return _0x27b0b3?_0x27b0b3[0x1]:_0x504e95;}function extractCalleridNumber(_0x3c0037){var _0x3d8488=_0x3c0037[_0xef00('0x165')](/<(.*?)>/);return _0x3d8488?_0x3d8488[0x1]:_0x3c0037;}Dialer[_0xef00('0x18')]['actionOriginate']=function(_0x1a80cc,_0xda7c42){var _0x1c4c67=this;var _0x28824f=uuid['v4']();this['actions'][_0x28824f]=new Action(_0x1a80cc,_0xda7c42,_0x28824f);return new BPromise(function(_0x5ec851,_0xc71c0c){if(_[_0xef00('0x7e')](_0x1a80cc)&&typeof _0x1a80cc!==_0xef00('0x166')){return _0xc71c0c(msgResponse(_0xef00('0x167'),'Failure',_0xef00('0x168')));}if(_[_0xef00('0x7e')](_0xda7c42[_0xef00('0x169')][_0xef00('0x16a')])||_0xda7c42[_0xef00('0x169')][_0xef00('0x16a')]===null){return _0xc71c0c(msgResponse(_0xef00('0x167'),_0xef00('0x141'),_0xef00('0x16b')));}var _0x124df4={'XMD-CALLERID':_0x1c4c67[_0xef00('0x20')][_0x28824f]['getCaller'](),'XMD-AGI':_0x1a80cc[_0xef00('0x106')]?util[_0xef00('0x6f')](_0xef00('0x16c'),ipAgi,_0x1a80cc[_0xef00('0x106')]):'NONE','XMD-AGIAFTER':_0x1a80cc[_0xef00('0x117')]?util['format'](_0xef00('0x16c'),ipAgi,_0x1a80cc[_0xef00('0x117')]):_0xef00('0x16d'),'XMD-QUEUE':_0x1a80cc[_0xef00('0x46')]===_0xef00('0x47')?util[_0xef00('0x6f')](_0xef00('0x16e'),_0x1a80cc[_0xef00('0x39')],_0x1a80cc[_0xef00('0x16f')]||'',_0x1a80cc[_0xef00('0x10d')]?'c':'',_0x1a80cc[_0xef00('0x113')]||0x3):_0xef00('0x16d'),'XMD-CONTACTID':_0xda7c42[_0xef00('0xca')],'XMD-CDRTYPE':_0xef00('0xa'),'CALLERID(all)':_0x1c4c67[_0xef00('0x20')][_0x28824f]['getCaller'](),'XMD-AMD':_0x1a80cc[_0xef00('0xdd')]?_0xef00('0x170'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1a80cc[_0xef00('0xdd')]){_0x124df4[_0xef00('0x171')]=_0x1a80cc[_0xef00('0x172')]||0x9c4;_0x124df4[_0xef00('0x173')]=_0x1a80cc['dialAMDGreeting']||0x5dc;_0x124df4['XMD-AMDAFTERGREETINGSILENCE']=_0x1a80cc[_0xef00('0x174')]||0x320;_0x124df4[_0xef00('0x175')]=_0x1a80cc[_0xef00('0x176')]||0x1388;_0x124df4[_0xef00('0x177')]=_0x1a80cc['dialAMDMinWordLength']||0x64;_0x124df4[_0xef00('0x178')]=_0x1a80cc[_0xef00('0x179')]||0x32;_0x124df4['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x1a80cc[_0xef00('0x17a')]||0x3;_0x124df4[_0xef00('0x17b')]=_0x1a80cc[_0xef00('0x17c')]||0x100;_0x124df4['XMD-AMDMAXIMUMWORDLENGTH']=_0x1a80cc[_0xef00('0x17d')]||0x1388;}if(_0x1a80cc['type']==='outbound'){_0x124df4[_0xef00('0x17e')]=_0xda7c42[_0xef00('0xcd')];}else{_0x124df4[_0xef00('0x17f')]=_0xda7c42[_0xef00('0xf5')];}for(var _0x50f5d7 in _0xda7c42[_0xef00('0x169')]){if(typeof _0xda7c42['Contact'][_0x50f5d7]!=='undefined'){if(isNotNull(_0xda7c42[_0xef00('0x169')][_0x50f5d7])&&_0x50f5d7!=='id'&&_0x50f5d7!==_0xef00('0x180')&&_0x50f5d7!=='createdAt'&&_0x50f5d7!==_0xef00('0x181')){_0x124df4[util['format'](_0xef00('0x182'),_0xef00('0x183'),_[_0xef00('0x184')](_0x50f5d7))]=_0xda7c42[_0xef00('0x169')][_0x50f5d7];}}}var _0x51124b=_0x1c4c67[_0xef00('0xd1')](_0x1a80cc[_0xef00('0x6e')])?getCallerId(_0x1a80cc[_0xef00('0x6e')][_0xef00('0x185')],_0x1a80cc[_0xef00('0x186')],_0x1a80cc[_0xef00('0x187')]>0x0?getCallerIdRandom(_0x1a80cc['dialOriginateCallerIdNumber'],_0x1a80cc['dialRandomLastDigitCallerIdNumber']):_0x1a80cc[_0xef00('0x54')]):getCallerId(_[_0xef00('0xda')](_0x1a80cc['TrunkBackup'])?_0x1a80cc[_0xef00('0x6e')][_0xef00('0x185')]:_0x1a80cc[_0xef00('0x139')][_0xef00('0x185')],_0x1a80cc[_0xef00('0x186')],_0x1a80cc[_0xef00('0x187')]>0x0?getCallerIdRandom(_0x1a80cc[_0xef00('0x54')],_0x1a80cc[_0xef00('0x187')]):_0x1a80cc[_0xef00('0x54')]);if(_0x51124b){_0x124df4[_0xef00('0x188')]=_0x1c4c67[_0xef00('0x20')][_0x28824f][_0xef00('0x189')]=extractCalleridName(_0x51124b);_0x124df4[_0xef00('0x18a')]=_0x1c4c67[_0xef00('0x20')][_0x28824f][_0xef00('0x18b')]=extractCalleridNumber(_0x51124b);}return ami[_0xef00('0xa9')]({'actionid':_0x28824f,'action':_0xef00('0x167'),'channel':_0x1c4c67['isTrunkReachable'](_0x1a80cc['Trunk'])?util[_0xef00('0x6f')]('SIP/%s/%s%s',_0x1a80cc[_0xef00('0x6e')][_0xef00('0x39')],isNotNull(_0x1a80cc['dialPrefix'])?_0x1a80cc[_0xef00('0x56')][_0xef00('0x18c')]()||'':'',_0x1a80cc[_0xef00('0x18d')]>0x0?_0xda7c42['Contact'][_0xef00('0x16a')]['substring'](_0x1a80cc[_0xef00('0x18d')]):_0xda7c42[_0xef00('0x169')][_0xef00('0x16a')]):util[_0xef00('0x6f')](_0xef00('0x18e'),_['isNil'](_0x1a80cc[_0xef00('0x139')])?_0x1a80cc[_0xef00('0x6e')][_0xef00('0x39')]:_0x1a80cc[_0xef00('0x139')][_0xef00('0x39')],isNotNull(_0x1a80cc[_0xef00('0x56')])?_0x1a80cc[_0xef00('0x56')]['trim']()||'':'',_0x1a80cc[_0xef00('0x18d')]>0x0?_0xda7c42[_0xef00('0x169')][_0xef00('0x16a')][_0xef00('0x18f')](_0x1a80cc[_0xef00('0x18d')]):_0xda7c42[_0xef00('0x169')][_0xef00('0x16a')]),'callerid':_0x51124b,'Exten':_0xef00('0x190'),'Context':_0xef00('0x191'),'Priority':'1','variable':_0x124df4,'timeout':(_0x1a80cc['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x28824f})[_0xef00('0xb3')](function(_0x5d0449){return _0x5ec851(_0x5d0449);})[_0xef00('0xac')](function(_0x2ce746){_0x1a80cc[_0xef00('0x5e')]+=0x1;var _0x391506=new History(_0x1c4c67[_0xef00('0x20')][_0x28824f]);logger['error'](util[_0xef00('0x6f')](_0xef00('0x192'),JSON['stringify'](_0x2ce746)));_0x391506[_0xef00('0xa3')]=0xe;_0x391506[_0xef00('0xdf')]=_0xef00('0x193');_0x391506['starttime']=moment()[_0xef00('0x6f')](_0xef00('0xf4'));_0x391506[_0xef00('0xa4')]=_0x391506[_0xef00('0xa5')];_0x1c4c67[_0xef00('0xc5')](_0x391506)['catch'](loggerCatch(_0xef00('0x194')));_0x1c4c67[_0xef00('0xc4')](_0x391506)[_0xef00('0xac')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x1c4c67[_0xef00('0x20')][_0x28824f];return _0xc71c0c(msgResponse(_0xef00('0x167'),'Error',_0xef00('0x195')));});});});};Dialer[_0xef00('0x18')][_0xef00('0x29')]=function(_0x358c04){var _0x169a62=this['actions'][_0x358c04[_0xef00('0x123')]];if(_0x169a62){delete this[_0xef00('0x20')][_0x358c04[_0xef00('0x123')]];_0x169a62[_0xef00('0x112')]=moment()['format'](_0xef00('0xf4'));var _0x16e19a=_0x169a62[_0xef00('0x46')]===_0xef00('0x8c')?this[_0xef00('0x1d')][_0x169a62[_0xef00('0xaf')]]:this['voiceQueues'][_0x169a62[_0xef00('0x196')]()];if(!this[_0xef00('0xcf')](_0x358c04[_0xef00('0x197')])){this[_0xef00('0xb0')](_0x16e19a);return this[_0xef00('0x198')](_0x169a62,_0x16e19a,_0x358c04)['catch'](loggerCatch(_0xef00('0x199')));}this[_0xef00('0xd8')][_0x358c04[_0xef00('0xd9')]]=_0x169a62;}};Dialer[_0xef00('0x18')][_0xef00('0x19a')]=function(_0x21e399,_0x43f016,_0x514f71){var _0xd22923=new History(_0x43f016);if(_0xd22923[_0xef00('0xfd')]+_0xd22923['countcongestionretry']+_0xd22923[_0xef00('0xfe')]+_0xd22923[_0xef00('0xea')]+_0xd22923[_0xef00('0xff')]+_0xd22923[_0xef00('0xeb')]+_0xd22923[_0xef00('0xe5')]+_0xd22923['countagentrejectretry']>=_0x514f71[_0xef00('0xed')]-0x1){return!![];}switch(_0x21e399){case 0x3:if(_0xd22923[_0xef00('0xfe')]>=_0x514f71[_0xef00('0x19b')]-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countnoanswerretry':_0xd22923[_0xef00('0xfe')]+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x19c')],_0xef00('0xf3'))[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xd22923['ContactId'],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923[_0xef00('0xcd')]||undefined,'CampaignId':_0xd22923['CampaignId']||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x19d')));break;case 0x5:if(_0xd22923[_0xef00('0xfd')]>=_0x514f71['dialBusyMaxRetry']-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countbusyretry':_0xd22923[_0xef00('0xfd')]+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71['dialBusyRetryFrequency'],'minutes')[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0xd22923[_0xef00('0xca')],'ListId':_0xd22923['ListId'],'VoiceQueueId':_0xd22923['VoiceQueueId']||undefined,'CampaignId':_0xd22923[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x19e')));break;case 0x8:if(_0xd22923[_0xef00('0xe9')]>=_0x514f71[_0xef00('0x19f')]-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countcongestionretry':_0xd22923[_0xef00('0xe9')]+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x1a0')],'minutes')[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0xd22923[_0xef00('0xca')],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923[_0xef00('0xcd')]||undefined,'CampaignId':_0xd22923[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1a1')));break;case 0x0:if(_0xd22923[_0xef00('0xea')]>=_0x514f71[_0xef00('0x1a2')]-0x1){return!![];}else{this[_0xef00('0xbb')]({'active':![],'countnosuchnumberretry':_0xd22923[_0xef00('0xea')]+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x1a3')],_0xef00('0xf3'))[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xd22923[_0xef00('0xca')],'ListId':_0xd22923['ListId'],'VoiceQueueId':_0xd22923[_0xef00('0xcd')]||undefined,'CampaignId':_0xd22923['CampaignId']||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1a4')));}break;case 0xa:if(_0xd22923['countdropretry']>=_0x514f71[_0xef00('0x118')]-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countdropretry':_0xd22923[_0xef00('0xff')]+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x11a')],'minutes')['format'](_0xef00('0xf4')),'ContactId':_0xd22923['ContactId'],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923[_0xef00('0xcd')]||undefined,'CampaignId':_0xd22923[_0xef00('0xf5')]||undefined})['catch'](loggerCatch(_0xef00('0x11b')));break;case 0xb:if(_0xd22923[_0xef00('0xeb')]>=_0x514f71['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0xd22923['countabandonedretry']+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x120')],_0xef00('0xf3'))[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0xd22923[_0xef00('0xca')],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923[_0xef00('0xcd')]||undefined,'CampaignId':_0xd22923['CampaignId']||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1a5')));break;case 0x13:if(_0xd22923[_0xef00('0xe5')]>=_0x514f71[_0xef00('0xef')]-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countmachineretry':_0xd22923['countmachineretry']+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0xf2')],_0xef00('0xf3'))[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xd22923['ContactId'],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923['VoiceQueueId']||undefined,'CampaignId':_0xd22923['CampaignId']||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0xf6')));break;case 0x14:if(_0xd22923[_0xef00('0xec')]>=_0x514f71[_0xef00('0x1a6')]-0x1){return!![];}this[_0xef00('0xbb')]({'active':![],'countagentrejectretry':_0xd22923['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xef00('0xf1')](_0x514f71[_0xef00('0x1a7')],_0xef00('0xf3'))[_0xef00('0x6f')](_0xef00('0xf4')),'ContactId':_0xd22923[_0xef00('0xca')],'ListId':_0xd22923[_0xef00('0xcb')],'VoiceQueueId':_0xd22923['VoiceQueueId']||undefined,'CampaignId':_0xd22923[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1a8')));break;default:return!![];}};Dialer[_0xef00('0x18')]['callProgressDetecting']=function(_0x44522e,_0x3b81e0,_0x4c8c0f){var _0x31051c=this;var _0x456d6d=new History(_0x44522e);return new BPromise(function(_0x56fc29,_0x3381c5){if(_[_0xef00('0x7e')](_0x3b81e0)&&typeof _0x3b81e0!=='object'){return _0x3381c5(msgResponse(_0xef00('0x1a9'),_0xef00('0x141'),_0xef00('0x1aa')));}if(_[_0xef00('0x7e')](_0x4c8c0f)&&typeof _0x4c8c0f!=='object'){return _0x3381c5(msgResponse('[callProgressDetecting]',_0xef00('0x141'),_0xef00('0x1ab')));}switch(_0x4c8c0f['reason']){case'0':_0x3b81e0[_0xef00('0x5d')]+=0x1;_0x456d6d[_0xef00('0xa3')]=0x0;_0x456d6d[_0xef00('0xdf')]=_0xef00('0x1ac');_0x456d6d['countnosuchnumberretry']+=0x1;_0x456d6d[_0xef00('0xe6')]+=0x1;ami[_0xef00('0x45')](_0xef00('0x1ad'),ut['buildObj'](_0x44522e,_0xef00('0x1ae')));_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0xfc')));if(_0x31051c[_0xef00('0x19a')](0x0,_0x44522e,_0x3b81e0)){if(_0x456d6d['countnosuchnumberretry']>=_0x3b81e0['dialNoSuchNumberMaxRetry']){_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1af'));}else{_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1af'));}}break;case'3':_0x3b81e0[_0xef00('0x5c')]+=0x1;_0x456d6d[_0xef00('0xa3')]=0x3;_0x456d6d['statedesc']='NoAnswer';_0x456d6d['countnoanswerretry']+=0x1;_0x456d6d[_0xef00('0xe6')]+=0x1;ami[_0xef00('0x45')](_0xef00('0x1b0'),ut[_0xef00('0xe8')](_0x44522e,_0xef00('0x1b1')));_0x31051c['createHistory'](_0x456d6d)[_0xef00('0xac')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x31051c['checkRetriveMax'](0x3,_0x44522e,_0x3b81e0)){if(_0x456d6d[_0xef00('0xfe')]>=_0x3b81e0[_0xef00('0x19b')]){_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1b2'));}else{_0x31051c['stateGlobal'](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1b2'));}}break;case'5':_0x3b81e0[_0xef00('0x58')]+=0x1;_0x456d6d[_0xef00('0xa3')]=0x5;_0x456d6d['statedesc']=_0xef00('0x1b3');_0x456d6d[_0xef00('0xfd')]+=0x1;_0x456d6d[_0xef00('0xe6')]+=0x1;ami['emit']('custom:agentbusy',ut[_0xef00('0xe8')](_0x44522e,_0xef00('0x1b4')));_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0x1b5')));if(_0x31051c[_0xef00('0x19a')](0x5,_0x44522e,_0x3b81e0)){if(_0x456d6d[_0xef00('0xfd')]>=_0x3b81e0[_0xef00('0x1b6')]){_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1b7'));}else{_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1b7'));}}break;case'8':_0x3b81e0[_0xef00('0x59')]+=0x1;_0x456d6d[_0xef00('0xa3')]=0x8;_0x456d6d[_0xef00('0xdf')]='Congestion';_0x456d6d[_0xef00('0xe9')]+=0x1;_0x456d6d[_0xef00('0xe6')]+=0x1;ami[_0xef00('0x45')](_0xef00('0x1b8'),ut['buildObj'](_0x44522e,'congestion'));_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0x1b9')));if(_0x31051c[_0xef00('0x19a')](0x8,_0x44522e,_0x3b81e0)){if(_0x456d6d[_0xef00('0xe9')]>=_0x3b81e0[_0xef00('0x19f')]){_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1ba'));}else{_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1ba'));}}break;case'11':_0x3b81e0['outboundAbandonedCallsDay']+=0x1;_0x456d6d[_0xef00('0xa3')]=0xb;_0x456d6d[_0xef00('0xdf')]=_0xef00('0x11e');_0x456d6d[_0xef00('0xeb')]+=0x1;_0x456d6d[_0xef00('0xe6')]+=0x1;_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0x121')));if(_0x31051c[_0xef00('0x19a')](0xb,_0x44522e,_0x3b81e0)){if(_0x456d6d[_0xef00('0xeb')]>=_0x3b81e0['dialAbandonedMaxRetry']){_0x31051c['createStateFinal'](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1bb'));}else{_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1bb'));}}break;case'20':_0x3b81e0[_0xef00('0x60')]+=0x1;_0x456d6d['state']=0x14;_0x456d6d['statedesc']=_0xef00('0x1bc');_0x456d6d[_0xef00('0xec')]+=0x1;_0x456d6d['countglobal']+=0x1;ami[_0xef00('0x45')]('custom:agentreject',ut[_0xef00('0xe8')](_0x44522e,'agentreject'));_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0x1bd')));if(_0x31051c[_0xef00('0x19a')](0x14,_0x44522e,_0x3b81e0)){if(_0x456d6d['countagentrejectretry']>=_0x3b81e0[_0xef00('0x1a6')]){_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1be'));}else{_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0xef00('0x1be'));}}break;default:_0x3b81e0[_0xef00('0x1bf')]+=0x1;_0x456d6d[_0xef00('0xa3')]=0xc;_0x456d6d[_0xef00('0xdf')]=_0x4c8c0f['reason'];_0x31051c[_0xef00('0xc5')](_0x456d6d)[_0xef00('0xac')](loggerCatch(_0xef00('0x1c0')));if(_0x31051c[_0xef00('0x19a')](_0x4c8c0f[_0xef00('0x10a')],_0x44522e,_0x3b81e0)){if(_0x456d6d['countbusyretry']+_0x456d6d['countcongestionretry']+_0x456d6d[_0xef00('0xfe')]+_0x456d6d[_0xef00('0xea')]+_0x456d6d[_0xef00('0xff')]+_0x456d6d[_0xef00('0xeb')]+_0x456d6d['countmachineretry']+_0x456d6d[_0xef00('0xec')]>=_0x3b81e0[_0xef00('0xed')]){_0x31051c[_0xef00('0xee')](_0x456d6d,_0x56fc29,_0x3381c5,_0x4c8c0f[_0xef00('0x10a')]);}else{_0x31051c[_0xef00('0xf0')](_0x456d6d,_0x56fc29,_0x3381c5,_0x4c8c0f['reason']);}}}});};Dialer[_0xef00('0x18')][_0xef00('0xee')]=function(_0x1f21c5,_0x2436c2,_0x493285,_0xed84b3){var _0x9b9278=new Final(_0x1f21c5);_0x9b9278[_0xef00('0xa3')]=0xf;_0x9b9278[_0xef00('0xdf')]='Global';this[_0xef00('0xf0')](_0x9b9278,_0x2436c2,_0x493285,_0xed84b3);};Dialer[_0xef00('0x18')][_0xef00('0xf0')]=function(_0x1deca1,_0x211f5e,_0x306074,_0x34bea1){this['moveContactManagedDialer'](_0x1deca1)[_0xef00('0xb3')](function(){return _0x211f5e(msgResponse(_0xef00('0x1a9'),_0xef00('0xd0'),_0x34bea1));})[_0xef00('0xac')](function(){return _0x306074(msgResponse(_0xef00('0x1c1'),_0xef00('0x141'),'contact\x20not\x20moved'));});};Dialer[_0xef00('0x18')][_0xef00('0xc')]=function(_0x44f8df){var _0x3d2470=_0x44f8df[_0xef00('0x1c2')]/0x64;var _0x3a17e1=_0x44f8df[_0xef00('0x5b')]/(_0x44f8df[_0xef00('0x5b')]+_0x44f8df[_0xef00('0xe4')]);var _0x4ce7ce=Math['round'](_0x44f8df[_0xef00('0x6a')]*(_0x44f8df['predictiveIntervalMaxThreshold']/0x64));var _0x1a5009=Math[_0xef00('0x1c3')](_0x44f8df[_0xef00('0x6a')]*(_0x44f8df[_0xef00('0x1c4')]/0x64));var _0x427eb8=_0x44f8df[_0xef00('0x49')]+_0x44f8df[_0xef00('0x4f')];var _0x1fca66=Math[_0xef00('0x1c5')](_0x44f8df['erlangCalls']*_0x44f8df['erlangAbandonmentRate']*_0x44f8df[_0xef00('0x68')]*_0x44f8df[_0xef00('0x1c6')]);if(_[_0xef00('0x7e')](_0x44f8df[_0xef00('0x23')])){if(!_['isUndefined'](_0x44f8df[_0xef00('0x22')])){_0x44f8df['startPredictive']=undefined;loggerPredictive[_0xef00('0x90')](_0xef00('0x1c7'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x44f8df[_0xef00('0x8a')])){loggerPredictive['error'](_0xef00('0x1c7'),_0xef00('0x1c8'));clearInterval(_0x44f8df[_0xef00('0x8a')]);_0x44f8df[_0xef00('0x8a')]=undefined;}_0x44f8df[_0xef00('0x23')]=moment()[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xef00('0x76')](_0x44f8df[_0xef00('0x39')],_0xef00('0x1c9'),_0x44f8df[_0xef00('0x23')]);this[_0xef00('0x156')](_0x44f8df,0x1);}else if(ifInterval(_0x44f8df[_0xef00('0x1ca')],_0x44f8df[_0xef00('0x23')])){this[_0xef00('0x156')](_0x44f8df,0x1);loggerPredictiveCalls[_0xef00('0x76')](_0xef00('0x1cb'),_0x44f8df[_0xef00('0x23')],_0x44f8df[_0xef00('0x39')]);_0x44f8df[_0xef00('0x82')]=0x0;_0x44f8df[_0xef00('0x67')]=0x0;}else if(_0x3d2470<_0x3a17e1&&_0x44f8df[_0xef00('0x1cc')]===_0xef00('0x1cd')){freeVariablesPredictive(_0x44f8df);loggerPredictive[_0xef00('0x76')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x3a17e1,'startProgressive',_0x44f8df['name']);}else if(_0x1fca66<_0x44f8df[_0xef00('0x67')]&&_0x44f8df[_0xef00('0x1cc')]===_0xef00('0x1cd')){freeVariablesPredictive(_0x44f8df);loggerPredictive[_0xef00('0x76')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xef00('0x1ce'),_0x1fca66,_0xef00('0x1cf'),_0x44f8df[_0xef00('0x67')],'startProgressive',_0x44f8df['name']);}else if(!ifInterval(_0x44f8df[_0xef00('0x1ca')],_0x44f8df[_0xef00('0x23')])&&_['isUndefined'](_0x44f8df['startPredictive'])&&!_[_0xef00('0x7e')](_0x44f8df[_0xef00('0x23')])){_0x44f8df[_0xef00('0x22')]=moment()['format'](_0xef00('0xf4'));loggerPredictive['info'](_0x44f8df['name'],_0xef00('0x1d0'),_0x44f8df[_0xef00('0x22')]);this[_0xef00('0xb9')](_0x44f8df['dialPredictiveInterval'])[_0xef00('0xb3')](this[_0xef00('0x1d1')](_0x44f8df))[_0xef00('0xb3')](mergeDataErlangB(_0x44f8df))[_0xef00('0xb3')](this[_0xef00('0x1d2')](_0x44f8df))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x44f8df));}else if(!ifInterval(_0x44f8df['dialPredictiveInterval'],_0x44f8df['startPredictive'])){_0x44f8df[_0xef00('0x67')]=0x0;_0x44f8df[_0xef00('0x22')]=moment()[_0xef00('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xef00('0x76')](_0x44f8df['name'],_0xef00('0x1d3'),_0x44f8df[_0xef00('0x22')]);clearInterval(_0x44f8df['handlePredictive']);_0x44f8df[_0xef00('0x8a')]=undefined;this[_0xef00('0xb9')](_0x44f8df[_0xef00('0x1ca')])[_0xef00('0xb3')](this[_0xef00('0x1d1')](_0x44f8df))[_0xef00('0xb3')](mergeDataErlangB(_0x44f8df))[_0xef00('0xb3')](this['startMethodPredictive'](_0x44f8df))['catch'](loggerCatchPredictive(_0xef00('0x1d4'),_0x44f8df));}else if(_0x44f8df['predictiveIntervalAvailable']&&_0x427eb8<_0x44f8df[_0xef00('0x6a')]-_0x1a5009){freeVariablesPredictive(_0x44f8df);loggerPredictive['info'](_0x44f8df[_0xef00('0x39')],_0xef00('0x1d5'),_0x427eb8,_0xef00('0x1d6'),_0x44f8df[_0xef00('0x6a')],'-',_0x1a5009,'=',_0x44f8df[_0xef00('0x6a')]-_0x1a5009,')');}else if(_0x44f8df['predictiveIntervalAvailable']&&_0x427eb8>_0x44f8df[_0xef00('0x6a')]+_0x4ce7ce){freeVariablesPredictive(_0x44f8df);loggerPredictive['info'](_0x44f8df[_0xef00('0x39')],_0xef00('0x1d5'),_0x427eb8,')\x20are\x20more\x20than\x20threshold\x20(',_0x44f8df[_0xef00('0x6a')],'+',_0x4ce7ce,'=',_0x44f8df['predictiveIntervalAvailable']+_0x4ce7ce,')');}};Dialer['prototype'][_0xef00('0x1d1')]=function(_0xe7d130){var _0x4ede54=this;return function(_0x556787){return new BPromise(function(_0x3bb6d2,_0x3294eb){_[_0xef00('0x86')](_0xe7d130,_0x556787[0x0]);if(checkGetDataPredictive(_0x556787[0x0])){var _0x4eeee4=_0xe7d130['predictiveIntervalAvailable']=_0xe7d130[_0xef00('0x4f')]+_0xe7d130[_0xef00('0x49')];var _0xdf7a29=_0xe7d130[_0xef00('0x1ca')]*0x3c;var _0x267050=_0x556787[0x0][_0xef00('0x63')]+_0x556787[0x0][_0xef00('0x62')];var _0x42adb7=(_0x556787[0x0][_0xef00('0x61')]+_0x556787[0x0][_0xef00('0x65')]+_0x556787[0x0][_0xef00('0x64')])/_0x556787[0x0]['predictiveIntervalTotalCalls'];_0xe7d130[_0xef00('0x68')]=_0x42adb7>0x0?_0x42adb7:0x1;switch(_0xe7d130[_0xef00('0x1cc')]){case _0xef00('0x1cd'):var _0x223228=_0xe7d130[_0xef00('0x1c2')]/0x64;return _0x4ede54[_0xef00('0x1d7')](_0x4eeee4,_0xdf7a29,_0x267050,_0x42adb7,_0x223228)[_0xef00('0xb3')](function(_0x5a9bac){return _0x3bb6d2(_0x5a9bac);});case _0xef00('0x1d8'):var _0x12d854=_0xe7d130['dialPredictiveOptimizationPercentage']/0x64;return _0x4ede54[_0xef00('0x1d9')](_0x4eeee4,_0xdf7a29,_0x267050,_0x42adb7,_0x12d854)['then'](function(_0x5284ac){return _0x3bb6d2(_0x5284ac);});default:return _0x3294eb(msgResponse('[getDataPredictive]','Failure',_0xef00('0x1da')));}}else{return _0x3294eb(msgResponse(_0xef00('0x1db'),_0xef00('0x141'),_0xef00('0x1dc')));}});};};Dialer[_0xef00('0x18')]['getDataPredictiveOld']=function(_0x24ffc0){var _0x35d25c=this;return function(_0xe1160b){return new BPromise(function(_0x3d5b4a,_0x512b0f){_[_0xef00('0x86')](_0x24ffc0,_0xe1160b[0x0]);if(checkGetDataPredictive(_0xe1160b[0x0])){loggerPredictive[_0xef00('0x76')](JSON[_0xef00('0x43')](_0xe1160b[0x0]));if(_0x24ffc0[_0xef00('0x1cc')]===_0xef00('0x1cd')){return _0x35d25c[_0xef00('0xc3')](_0x24ffc0['id'])[_0xef00('0xb3')](function(_0x529a99){var _0x1f04b1=_0x24ffc0[_0xef00('0x4a')]-_0x529a99[0x0]['outboundQueuePauses'];var _0x56e0fe=_0x24ffc0[_0xef00('0x1ca')]*0x3c;var _0x291d43=_0xe1160b[0x0][_0xef00('0x63')]+_0xe1160b[0x0][_0xef00('0x62')];var _0x358273=(_0xe1160b[0x0][_0xef00('0x61')]+_0xe1160b[0x0][_0xef00('0x65')]+_0xe1160b[0x0][_0xef00('0x64')])/_0xe1160b[0x0][_0xef00('0x78')];var _0x33753e=_0x24ffc0[_0xef00('0x1c2')]/0x64;_0x24ffc0[_0xef00('0x69')]=_0x529a99[0x0][_0xef00('0x1dd')]||0x0;_0x24ffc0['predictiveIntervalHitRate']=_0x358273>0x0?_0x358273:0x1;return _0x35d25c['abandonmentRate'](_0x1f04b1,_0x56e0fe,_0x291d43,_0x358273,_0x33753e);})[_0xef00('0xb3')](function(_0x532951){return _0x3d5b4a(_0x532951);})[_0xef00('0xac')](function(_0x5d5077){return _0x512b0f(msgResponse(_0xef00('0x1de'),_0xef00('0x141'),JSON[_0xef00('0x43')](_0x5d5077)));});}if(_0x24ffc0[_0xef00('0x1cc')]===_0xef00('0x1d8')){return _0x35d25c[_0xef00('0xc3')](_0x24ffc0['id'])[_0xef00('0xb3')](function(_0x39026b){var _0x1e746b=_0x24ffc0['loggedIn']-_0x39026b[0x0]['outboundQueuePauses'];var _0x3db355=_0x24ffc0[_0xef00('0x1ca')]*0x3c;var _0x3540f7=_0xe1160b[0x0][_0xef00('0x63')]+_0xe1160b[0x0][_0xef00('0x62')];var _0x4f5cc5=(_0xe1160b[0x0]['predictiveIntervalAnsweredCalls']+_0xe1160b[0x0][_0xef00('0x65')]+_0xe1160b[0x0][_0xef00('0x64')])/_0xe1160b[0x0][_0xef00('0x78')];var _0x1f7f62=_0x24ffc0[_0xef00('0x1c2')]/0x64;_0x24ffc0['predictiveIntervalPauses']=_0x39026b[0x0]['outboundQueuePauses']||0x0;_0x24ffc0[_0xef00('0x68')]=_0x4f5cc5>0x0?_0x4f5cc5:0x1;return _0x35d25c[_0xef00('0x1d9')](_0x1e746b,_0x3db355,_0x3540f7,_0x4f5cc5,_0x1f7f62);})['then'](function(_0x3de09d){return _0x3d5b4a(_0x3de09d);})[_0xef00('0xac')](function(_0x3331b6){return _0x512b0f(msgResponse(_0xef00('0x1de'),_0xef00('0x141'),JSON[_0xef00('0x43')](_0x3331b6)));});}}else{return _0x512b0f(msgResponse(_0xef00('0x1db'),_0xef00('0x141'),_0xef00('0x1dc')));}});};};Dialer[_0xef00('0x18')][_0xef00('0x1d2')]=function(_0x802f8){var _0xf9948a=this;return function(){var _0x3b3ef4=0x0;var _0x5719db=Math['floor'](_0x802f8['erlangCallToSecond']*0x3e8);if(_0x5719db>0x0){_0x5719db=_0x5719db<0x64?0x64:_0x5719db;loggerPredictive[_0xef00('0x76')](_0x802f8['name'],'one\x20call\x20every:',_0x5719db,_0xef00('0x44'));_0x802f8[_0xef00('0x8a')]=setInterval(function(){_0xf9948a['handlePredictive'](_0x802f8);loggerPredictiveCalls[_0xef00('0x76')](_0xef00('0x1df'),_0x3b3ef4+=0x1);},_0x5719db);}else{loggerPredictive['info'](_0x802f8[_0xef00('0x39')],_0xef00('0x1e0'));}};};Dialer[_0xef00('0x18')]['checkContactBlack']=function(_0x74919f,_0x50cf04){var _0x3d1836=this;return function(_0x3386db){if(_[_0xef00('0x74')](_0x3386db)){if(_['isNil'](_0x50cf04[_0xef00('0xcc')])||!_0x50cf04[_0xef00('0x1e1')]){if(_0x74919f['dialMethod']===_0xef00('0xb')){_0x74919f['queueStatusComplete']=_[_0xef00('0x7e')](_0x74919f[_0xef00('0x129')])?!![]:_0x74919f[_0xef00('0x129')];var _0x5f5577=uuid['v4']();_0x3d1836['actions'][_0x5f5577]=new Action(_0x74919f,_0x50cf04,_0x5f5577);loggerBooked[_0xef00('0x76')](_0xef00('0x1e2'),_0x5f5577,'queueStatusComplete:\x20',JSON['stringify'](_0x74919f['queueStatusComplete']),_0xef00('0x1e3'),_0x74919f[_0xef00('0x39')]);if(_0x74919f[_0xef00('0x129')]){_0x74919f[_0xef00('0x129')]=![];_0x3d1836[_0xef00('0x24')][_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xaf')]]=[];ami[_0xef00('0xa9')]({'actionid':_0x5f5577,'action':_0xef00('0x1e4'),'queue':_0x74919f[_0xef00('0x39')]})['catch'](function(){_0x3d1836[_0xef00('0xb0')](_0x74919f);_0x3d1836[_0xef00('0xbb')]({'active':![],'ContactId':_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xca')],'ListId':_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xcb')],'VoiceQueueId':_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xcd')]||undefined,'CampaignId':_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1e5')));delete _0x3d1836[_0xef00('0x20')][_0x5f5577];});}else{loggerBooked[_0xef00('0x76')]('[booked][checkContactBlack][else]',JSON[_0xef00('0x43')](_0x74919f[_0xef00('0x129')]),_0xef00('0x1e3'),_0x74919f[_0xef00('0x39')]);_0x3d1836['updateOriginated'](_0x74919f);_0x3d1836[_0xef00('0xbb')]({'active':![],'ContactId':_0x3d1836[_0xef00('0x20')][_0x5f5577][_0xef00('0xca')],'ListId':_0x3d1836['actions'][_0x5f5577]['ListId'],'VoiceQueueId':_0x3d1836[_0xef00('0x20')][_0x5f5577]['VoiceQueueId']||undefined,'CampaignId':_0x3d1836['actions'][_0x5f5577][_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch(_0xef00('0x1e5')));delete _0x3d1836[_0xef00('0x20')][_0x5f5577];}}else{return _0x3d1836[_0xef00('0x1e6')](_0x74919f,_0x50cf04);}}else{if(getDiff(_0x50cf04[_0xef00('0x1e7')])<_0x74919f['dialRecallMeTimeout']*0x3c){if(_0x50cf04['Agent']&&!_0x50cf04[_0xef00('0x1e8')][_0xef00('0x1e9')]){_0x3d1836['preview']['run'](_0x50cf04['id'])[_0xef00('0x1a')](function(){_0x3d1836['updateOriginated'](_0x74919f);});}else{_0x3d1836[_0xef00('0xbd')]({'active':![]},_0x50cf04['id'],0x1)['finally'](function(){_0x3d1836[_0xef00('0xb0')](_0x74919f);});}}else{_0x74919f['outboundReCallsDay']+=0x1;_0x3d1836[_0xef00('0xb0')](_0x74919f);if(_0x74919f[_0xef00('0x1ea')]){_0x3d1836[_0xef00('0xbb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x50cf04[_0xef00('0xca')],'ListId':_0x50cf04[_0xef00('0xcb')],'VoiceQueueId':_0x50cf04[_0xef00('0xcd')]||undefined,'CampaignId':_0x50cf04[_0xef00('0xf5')]||undefined})[_0xef00('0xac')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3d1836[_0xef00('0xc5')](createObjHistory(_0x74919f,_0x50cf04,_0xef00('0x1eb'),0x17,_0xef00('0x1ec')))['catch'](loggerCatch(_0xef00('0x1ed')));}else{_0x3d1836[_0xef00('0xc9')](createObjHistory(_0x74919f,_0x50cf04,_0xef00('0x1ee'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xef00('0x1ef'));}}}}else{_0x74919f[_0xef00('0x57')]+=0x1;_0x3d1836['saveInDb'](createObjHistory(_0x74919f,_0x50cf04,_0xef00('0x1f0'),0xd,_0xef00('0x1f1')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xef00('0x18')][_0xef00('0x15c')]=function(_0x5f437d){var _0x28bd21=this;var _0x4efb2f=_0x5f437d[_0xef00('0x1f2')]-_0x5f437d[_0xef00('0x6b')]-_0x5f437d[_0xef00('0xc0')];emitCampaignSummary(_0x5f437d);if(_0x4efb2f>0x0){if(_0x4efb2f>this[_0xef00('0x1f')]){_0x4efb2f=this[_0xef00('0x1f')];}_0x5f437d[_0xef00('0xc0')]+=_0x4efb2f;this[_0xef00('0xc1')](_0x5f437d['id'],_0x4efb2f,_0x5f437d[_0xef00('0x1f3')],_0x5f437d)['then'](function(_0x1b449f){_0x5f437d['temp']-=_0x4efb2f;_0x5f437d['temp']=_0x5f437d['temp']>0x0?_0x5f437d[_0xef00('0xc0')]:0x0;if(!checkContactEmpty(_0x1b449f)){_0x5f437d[_0xef00('0x3b')]=_0xef00('0x9a');logger[_0xef00('0x76')](_0xef00('0x1f4')+_0x5f437d[_0xef00('0x39')]);}else{_0x5f437d['originated']+=_0x1b449f[_0xef00('0x92')];_0x5f437d['message']='RUNNING';for(var _0x46e580=0x0;_0x46e580<_0x1b449f[_0xef00('0x92')];_0x46e580+=0x1){_0x5f437d[_0xef00('0x1f5')]+=0x1;if(_['isNil'](_0x1b449f[_0x46e580])||_[_0xef00('0xda')](_0x1b449f[_0x46e580][_0xef00('0x169')])||_[_0xef00('0xda')](_0x1b449f[_0x46e580]['Contact'][_0xef00('0x16a')])){_0x28bd21[_0xef00('0x1f6')](_0xef00('0x1f7'),_0x5f437d,_0x1b449f[_0x46e580]);}else{_0x28bd21['checkIsBlackListIvr'](_[_0xef00('0x128')](_0x1b449f[_0x46e580],[_0xef00('0xf5'),'Contact.phone']))[_0xef00('0xb3')](_0x28bd21[_0xef00('0x1f8')](_0x5f437d,_0x1b449f[_0x46e580]))[_0xef00('0xac')](_0x28bd21['loggerHandler'](_0xef00('0x1f9'),_0x5f437d));}}}})[_0xef00('0xac')](loggerGetContactDialer('[getContactCampaign2]',_0x5f437d,_0x4efb2f));}};Dialer[_0xef00('0x18')][_0xef00('0x156')]=function(_0x1ec771,_0x1c946d){var _0x224af6=this;var _0x5dd707=[];var _0x3cff40=_0x1c946d>=0x1?_0x1c946d:0x1;if(_0x1ec771['dialMethod']===_0xef00('0xb')){_0x3cff40=0x1;}var _0x5a7679=Math[_0xef00('0x1c5')](_0x1ec771[_0xef00('0x49')]*_0x3cff40)-_0x1ec771['originated']-_0x1ec771[_0xef00('0xc0')];emitVoiceQueueSummary(_0x1ec771);if(_0x1ec771[_0xef00('0x1fa')]>0x0){var _0x3796a3=_0x1ec771[_0xef00('0x1fa')]-_0x1ec771[_0xef00('0x6b')]-_0x1ec771[_0xef00('0x4f')]-_0x1ec771[_0xef00('0xc0')]-_0x1ec771[_0xef00('0x4b')];if(_0x5a7679>_0x3796a3){_0x5a7679=_0x3796a3;}}if(_0x5a7679>0x0){if(_0x1ec771['dialMethod']==='booked'){_0x5a7679=0x1;}if(_0x5a7679>this[_0xef00('0x1f')]){_0x5a7679=this[_0xef00('0x1f')];}_0x1ec771[_0xef00('0xc0')]+=_0x5a7679;for(var _0x2f1377 in this[_0xef00('0x1e')]){if(typeof this['agents'][_0x2f1377]!==_0xef00('0x93')){if(this['agents'][_0x2f1377][_0xef00('0xa3')]===_0xef00('0x1fb')&&this['agents'][_0x2f1377]['status']===_0xef00('0xd5')){_0x5dd707[_0xef00('0x127')](this[_0xef00('0x1e')][_0x2f1377]['id']);}}}this['getContactDialer'](_0x1ec771['id'],_0x5dd707,_0x5a7679,_0x1ec771[_0xef00('0x1f3')],_0x1ec771)['then'](function(_0x55de41){_0x1ec771[_0xef00('0xc0')]-=_0x5a7679;_0x1ec771[_0xef00('0xc0')]=_0x1ec771[_0xef00('0xc0')]>0x0?_0x1ec771[_0xef00('0xc0')]:0x0;if(!checkContactEmpty(_0x55de41)){_0x224af6[_0xef00('0xb1')](_0x1ec771)['then'](sendMessageReschedule(_0x1ec771))[_0xef00('0xac')](loggerCatch(_0xef00('0xb4')));}else{_0x1ec771[_0xef00('0x6b')]+=_0x55de41[_0xef00('0x92')];_0x1ec771[_0xef00('0x3b')]=_0x1ec771['dialMethod']===_0xef00('0xb')?_0xef00('0x170'):_0xef00('0x1fc');for(var _0x583553=0x0;_0x583553<_0x55de41[_0xef00('0x92')];_0x583553+=0x1){if(_['isNil'](_0x55de41[_0x583553])||_['isNil'](_0x55de41[_0x583553][_0xef00('0x169')])||_[_0xef00('0xda')](_0x55de41[_0x583553][_0xef00('0x169')]['phone'])){_0x224af6[_0xef00('0x1f6')](_0xef00('0x1f7'),_0x1ec771,_0x55de41[_0x583553]);}else{_0x224af6['checkIsBlackList'](_['pick'](_0x55de41[_0x583553],[_0xef00('0xcd'),_0xef00('0x1fd')]))[_0xef00('0xb3')](_0x224af6['checkContactBlack'](_0x1ec771,_0x55de41[_0x583553]))[_0xef00('0xac')](_0x224af6['loggerHandler'](_0xef00('0x1f7'),_0x1ec771));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x1ec771,_0x5a7679));}};Dialer[_0xef00('0x18')]['handlePredictive']=function(_0x5213d1){if(_0x5213d1['dialLimitQueue']>0x0){var _0x306fdd=_0x5213d1['dialLimitQueue']-_0x5213d1[_0xef00('0x6b')]-_0x5213d1['talking'];if(_0x306fdd>0x0){this[_0xef00('0x1fe')](_0x5213d1);}else{loggerPredictiveCalls[_0xef00('0x76')](_0xef00('0x1ff'));}}else{this[_0xef00('0x1fe')](_0x5213d1);}};Dialer[_0xef00('0x18')][_0xef00('0x1fe')]=function(_0x433733){var _0x2c5687=this;var _0x3f4898=[];_0x433733[_0xef00('0x6b')]+=0x1;for(var _0x4ea695 in this[_0xef00('0x1e')]){if(typeof this['agents'][_0x4ea695]!==_0xef00('0x93')){if(this['agents'][_0x4ea695][_0xef00('0xa3')]===_0xef00('0x1fb')&&this[_0xef00('0x1e')][_0x4ea695][_0xef00('0xaa')]==='reachable'){_0x3f4898[_0xef00('0x127')](this[_0xef00('0x1e')][_0x4ea695]['id']);}}}this[_0xef00('0xbf')](_0x433733['id'],_0x3f4898,0x1,_0x433733[_0xef00('0x1f3')],_0x433733)[_0xef00('0xb3')](function(_0x4b120e){if(!checkContactEmpty(_0x4b120e)){checkContactLowerLimitOriginate(_0x433733,0x1,0x0);_0x2c5687[_0xef00('0xb1')](_0x433733)[_0xef00('0xb3')](sendMessageReschedule(_0x433733))[_0xef00('0xac')](loggerCatch(_0xef00('0xb4')));}else{_0x433733[_0xef00('0x3b')]=_0xef00('0x1fc');if(_[_0xef00('0xda')](_0x4b120e[0x0])||_['isNil'](_0x4b120e[0x0][_0xef00('0x169')])||_[_0xef00('0xda')](_0x4b120e[0x0]['Contact'][_0xef00('0x16a')])){_0x2c5687[_0xef00('0x1f6')]('[actionOriginate]\x20',_0x433733,_0x4b120e[0x0]);}else{_0x2c5687[_0xef00('0xb5')](_['pick'](_0x4b120e[0x0],[_0xef00('0xcd'),_0xef00('0x1fd')]))[_0xef00('0xb3')](_0x2c5687['checkContactBlack'](_0x433733,_0x4b120e[0x0]))['catch'](_0x2c5687['loggerHandler'](_0xef00('0x200'),_0x433733));}}})[_0xef00('0xac')](loggerGetContactDialer(_0xef00('0x201'),_0x433733,0x1));emitVoiceQueueSummary(_0x433733);};Dialer[_0xef00('0x18')][_0xef00('0x1d7')]=function(_0x37b975,_0x4a5605,_0x3c72f9,_0x34f2b1,_0x20f73b,_0x1a8d6c){loggerPredictive[_0xef00('0x76')](_0xef00('0x202'));loggerPredictive[_0xef00('0x76')](_0xef00('0x203'),_0x37b975);loggerPredictive[_0xef00('0x76')](_0xef00('0x204'),_0x4a5605);loggerPredictive[_0xef00('0x76')](_0xef00('0x205'),_0x3c72f9);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34f2b1);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x20f73b);loggerPredictive[_0xef00('0x76')](_0xef00('0x7c'));return new BPromise(function(_0x2eb9b7,_0x511069){if(_0x37b975<=0x0||isNaN(_0x37b975)){return _0x511069(msgResponse('[abandonmentRate]',_0xef00('0x42'),_0xef00('0x206')+_0x37b975));}if(_0x3c72f9<=0x0||isNaN(_0x3c72f9)){return _0x511069(msgResponse(_0xef00('0x207'),_0xef00('0x42'),_0xef00('0x208')+_0x3c72f9));}if(_0x34f2b1<=0x0||isNaN(_0x34f2b1)){return _0x511069(msgResponse(_0xef00('0x207'),_0xef00('0x42'),_0xef00('0x209')+_0x34f2b1));}if(_0x4a5605<=0x0||isNaN(_0x4a5605)){return _0x511069(msgResponse(_0xef00('0x207'),'Error',_0xef00('0x20a')+_0x4a5605));}if(_0x20f73b<=0x0||isNaN(_0x20f73b)){return _0x511069(msgResponse(_0xef00('0x207'),_0xef00('0x42'),_0xef00('0x20b')+_0x20f73b));}_0x1a8d6c=_0x1a8d6c||0x0;var _0x5cf367=0x1/_0x3c72f9;var _0x1cd58d=0x0;var _0x4a2dd4=0x0;var _0x1f371e=0x0;var _0x46acb1=0x0;for(var _0x27b00f=0x0;_0x1f371e<_0x20f73b;_0x27b00f+=0x1){_0x4a2dd4=_0x27b00f/_0x4a5605;_0x1cd58d=(_0x34f2b1*_0x4a2dd4+_0x1a8d6c)/_0x5cf367;_0x1f371e=erlangb(_0x1cd58d,_0x37b975);_0x46acb1=_0x1cd58d/_0x37b975*(0x1-erlangb(_0x1cd58d,_0x37b975));}return _0x2eb9b7({'erlangCalls':_0x27b00f,'erlangCallToSecond':_0x4a5605/_0x27b00f,'erlangAbandonmentRate':_0x1f371e,'erlangBusyFactor':_0x46acb1});});};Dialer['prototype'][_0xef00('0x1d9')]=function(_0x113076,_0x534d31,_0x4c9df2,_0x36fb59,_0x5bea38,_0x11db4d){loggerPredictive[_0xef00('0x76')](_0xef00('0x20c'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x113076);loggerPredictive['info'](_0xef00('0x204'),_0x534d31);loggerPredictive[_0xef00('0x76')](_0xef00('0x205'),_0x4c9df2);loggerPredictive[_0xef00('0x76')](_0xef00('0x20d'),_0x36fb59);loggerPredictive['info'](_0xef00('0x20e'),_0x5bea38);loggerPredictive[_0xef00('0x76')](_0xef00('0x7c'));return new BPromise(function(_0x1698d3,_0x3aaf71){if(_0x113076<=0x0||isNaN(_0x113076)){return _0x3aaf71(msgResponse(_0xef00('0x20f'),_0xef00('0x42'),_0xef00('0x206')+_0x113076));}if(_0x4c9df2<=0x0||isNaN(_0x4c9df2)){return _0x3aaf71(msgResponse(_0xef00('0x20f'),_0xef00('0x42'),_0xef00('0x208')+_0x4c9df2));}if(_0x36fb59<=0x0||isNaN(_0x36fb59)){return _0x3aaf71(msgResponse(_0xef00('0x20f'),_0xef00('0x42'),_0xef00('0x209')+_0x36fb59));}if(_0x534d31<=0x0||isNaN(_0x534d31)){return _0x3aaf71(msgResponse(_0xef00('0x20f'),'Error',_0xef00('0x20a')+_0x534d31));}if(_0x5bea38<=0x0||isNaN(_0x5bea38)){return _0x3aaf71(msgResponse(_0xef00('0x20f'),_0xef00('0x42'),_0xef00('0x210')+_0x5bea38));}_0x11db4d=_0x11db4d||0x0;var _0x490247=0x1/_0x4c9df2;var _0x1181e2=0x0;var _0x3c0035=0x0;var _0x8d50d6=0x0;var _0x38ac8f=0x0;for(var _0x459d6d=0x0;_0x38ac8f<_0x5bea38;_0x459d6d+=0x1){_0x3c0035=_0x459d6d/_0x534d31;_0x1181e2=(_0x36fb59*_0x3c0035+_0x11db4d)/_0x490247;_0x8d50d6=erlangb(_0x1181e2,_0x113076);_0x38ac8f=_0x1181e2/_0x113076*(0x1-erlangb(_0x1181e2,_0x113076));}return _0x1698d3({'erlangCalls':_0x459d6d,'erlangCallToSecond':_0x534d31/_0x459d6d,'erlangAbandonmentRate':_0x8d50d6,'erlangBusyFactor':_0x38ac8f});});};module['exports']=Dialer; \ No newline at end of file +var _0xd2ce=['amd','MACHINE','uniqueid','statedesc','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','[syncAgentComplete][createHistory]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','Drop','calleridname','calleridnum','Abandoned','CALLEREXIT','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','Failure','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','indexOf','command','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','booked','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','OriginateError','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\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]','exports','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\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','Avg\x20Hold\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','status','channel','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','pick','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','Success','reachable','SIP/%s','unmonitored','syncVarSet','isNil','variable','amdstatus','dialAMDActive','value','HANGUP','updateOriginated','HangupInAMD','membername','custom:amd','buildObj'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2ce,0x13c));var _0xed2c=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xd2ce[_0x934425];return _0x31d596;};'use strict';var util=require('util');var _=require(_0xed2c('0x0'));var BPromise=require('bluebird');var uuid=require(_0xed2c('0x1'));var moment=require(_0xed2c('0x2'));var rr=require('rr');var md5=require(_0xed2c('0x3'));var Redis=require(_0xed2c('0x4'));var ut=require(_0xed2c('0x5'));var config=require(_0xed2c('0x6'));var logger=require(_0xed2c('0x7'))('dialer');var loggerBooked=require(_0xed2c('0x7'))('booked');var loggerPredictive=require(_0xed2c('0x7'))(_0xed2c('0x8'));var loggerPredictiveCalls=require(_0xed2c('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xed2c('0x7'))('syncQueueSummary');var ami=require(_0xed2c('0x9'));config[_0xed2c('0xa')]=_['defaults'](config['redis'],{'host':_0xed2c('0xb'),'port':0x18eb});var io=require(_0xed2c('0xc'))(new Redis(config[_0xed2c('0xa')]));var cmHopper=require(_0xed2c('0xd'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xed2c('0xe'));var voiceQueueRt=require(_0xed2c('0xf'));var Action=require(_0xed2c('0x10'));var History=require(_0xed2c('0x11'));var Final=require(_0xed2c('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xed2c('0x13'));var Hangup=require(_0xed2c('0x14'));var ipAgi=process[_0xed2c('0x15')][_0xed2c('0x16')]||_0xed2c('0x17');var strategy={'rrmemory':_0xed2c('0x18'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xed2c('0x19')]['enqueue']=function(_0xe60474){this[_0xed2c('0x1a')]=this[_0xed2c('0x1a')]?this[_0xed2c('0x1a')][_0xed2c('0x1b')](_0xe60474):_0xe60474();};function Dialer(_0x142e77,_0x2b0ac5){this[_0xed2c('0x1c')]=new Sequence();this[_0xed2c('0x1d')]=_0x2b0ac5;this[_0xed2c('0x1e')]=_0x142e77[_0xed2c('0x1e')];this[_0xed2c('0x1f')]=_0x142e77[_0xed2c('0x1f')];this[_0xed2c('0x20')]=_0x142e77[_0xed2c('0x20')];this[_0xed2c('0x21')]=_0x142e77[_0xed2c('0x21')];this['maxNumberOriginate']=config[_0xed2c('0x22')]||0x2;this['channels']={};this[_0xed2c('0x23')]={};this['contactsId']={};this[_0xed2c('0x24')]={};this[_0xed2c('0x25')]={};this['startPredictive']={};this[_0xed2c('0x26')]={};this[_0xed2c('0x27')]={};this[_0xed2c('0x28')]={};this[_0xed2c('0x29')]={};ami['on'](_0xed2c('0x2a'),this[_0xed2c('0x2b')]['bind'](this));ami['on'](_0xed2c('0x2c'),this[_0xed2c('0x2d')]['bind'](this));ami['on'](_0xed2c('0x2e'),this['syncOriginateResponse'][_0xed2c('0x2f')](this));ami['on'](_0xed2c('0x30'),this['syncAgentComplete'][_0xed2c('0x2f')](this));ami['on']('custom:queuesummary',this[_0xed2c('0x31')][_0xed2c('0x2f')](this));ami['on'](_0xed2c('0x32'),this[_0xed2c('0x33')][_0xed2c('0x2f')](this));ami['on'](_0xed2c('0x34'),this[_0xed2c('0x35')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xed2c('0x2f')](this));ami['on'](_0xed2c('0x36'),this[_0xed2c('0x37')][_0xed2c('0x2f')](this));ami['on'](_0xed2c('0x38'),this[_0xed2c('0x39')][_0xed2c('0x2f')](this));this[_0xed2c('0x3a')]();this[_0xed2c('0x3b')]();}function isNotNull(_0xdb54b6){return _0xdb54b6!==null&&!_[_0xed2c('0x3c')](_0xdb54b6);}function checkIsLoggedIn(_0x451637,_0x1b0568){return function(){if(_0x1b0568<=0x0){_0x451637[_0xed2c('0x3d')]='AGENTS_NOT_LOGGED';throw _0x451637[_0xed2c('0x3e')]+_0xed2c('0x3f');}};}function isActive(_0x41f64f){return _0x41f64f;}function checkIsActive(_0x133479,_0x18d21b){return function(){if(!isActive(_0x18d21b)){_0x133479['message']=_0xed2c('0x40');throw _0x133479[_0xed2c('0x3e')]+'\x20NOT\x20Active';}};}function checkInterval(_0x5a6b1f){return function(){if(!isNotNull(_0x5a6b1f[_0xed2c('0x41')])){_0x5a6b1f[_0xed2c('0x3d')]=_0xed2c('0x42');throw _0x5a6b1f[_0xed2c('0x3e')]+_0xed2c('0x43');}if(!isNotNull(_0x5a6b1f[_0xed2c('0x41')][_0xed2c('0x44')])){_0x5a6b1f[_0xed2c('0x3d')]=_0xed2c('0x42');throw _0x5a6b1f[_0xed2c('0x3e')]+_0xed2c('0x43');}if(!isNotNull(_[_0xed2c('0x45')](_0x5a6b1f['Interval']['Intervals']))){_0x5a6b1f[_0xed2c('0x3d')]=_0xed2c('0x42');throw _0x5a6b1f[_0xed2c('0x3e')]+_0xed2c('0x43');}};}function msgResponse(_0x4f5a69,_0x563e71,_0x28dc9b){return{'action':_0x4f5a69,'response':_0x563e71,'message':_0x28dc9b,'stack':_0x28dc9b};}function myreject(_0x594df7){return function(_0x4c300f){return _0x594df7(msgResponse('[ifTime][Action]',_0xed2c('0x46'),JSON[_0xed2c('0x47')](_0x4c300f)));};}function getSeconds(_0x5206a3,_0x1f16a3){var _0x531d3f=moment(_0x5206a3)['milliseconds'](0x0);var _0x290f24=moment(_0x1f16a3)[_0xed2c('0x48')](0x0);return _0x531d3f[_0xed2c('0x49')](_0x290f24,_0xed2c('0x4a'));}function emit(_0x363a5b,_0x10426c,_0x457929){io['to'](_0x363a5b)[_0xed2c('0x4b')](_0x10426c,_0x457929);}function emitVoiceQueueSummary(_0x42449e){if(_0x42449e[_0xed2c('0x4c')]==='outbound'){var _0x2c27ca={'id':_0x42449e['id'],'name':_0x42449e['name'],'strategy':_0x42449e[_0xed2c('0x4d')],'answered':_0x42449e[_0xed2c('0x4e')],'available':_0x42449e[_0xed2c('0x4f')],'loggedIn':_0x42449e[_0xed2c('0x50')],'pTalking':_0x42449e[_0xed2c('0x51')],'sumBillable':_0x42449e[_0xed2c('0x52')],'sumDuration':_0x42449e[_0xed2c('0x53')],'sumHoldTime':_0x42449e[_0xed2c('0x54')]||0x0,'talking':_0x42449e[_0xed2c('0x55')],'total':_0x42449e[_0xed2c('0x56')],'type':_0x42449e['type'],'unmanaged':_0x42449e['unmanaged'],'abandoned':_0x42449e[_0xed2c('0x57')],'waiting':_0x42449e[_0xed2c('0x58')],'loggedInDb':_0x42449e[_0xed2c('0x59')],'dialActive':_0x42449e['dialActive'],'dialMethod':_0x42449e[_0xed2c('0x5a')],'dialOriginateCallerIdName':_0x42449e[_0xed2c('0x5b')],'dialOriginateCallerIdNumber':_0x42449e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x42449e['dialOriginateTimeout'],'dialPrefix':_0x42449e[_0xed2c('0x5c')],'outboundAnswerAgiCallsDay':_0x42449e[_0xed2c('0x5d')],'outboundAnswerCallsDay':_0x42449e[_0xed2c('0x5e')],'outboundBlacklistCallsDay':_0x42449e[_0xed2c('0x5f')],'outboundBusyCallsDay':_0x42449e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x42449e['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x42449e[_0xed2c('0x60')],'outboundDropCallsDayCallersExit':_0x42449e[_0xed2c('0x61')],'outboundDropCallsDayTimeout':_0x42449e[_0xed2c('0x62')],'outboundNoAnswerCallsDay':_0x42449e[_0xed2c('0x63')],'outboundNoSuchCallsDay':_0x42449e[_0xed2c('0x64')],'outboundOriginateFailureCallsDay':_0x42449e[_0xed2c('0x65')],'outboundReCallsDay':_0x42449e[_0xed2c('0x66')],'outboundRejectCallsDay':_0x42449e[_0xed2c('0x67')],'outboundUnknownCallsDay':_0x42449e[_0xed2c('0x68')],'predictiveIntervalAnsweredCalls':_0x42449e[_0xed2c('0x69')],'predictiveIntervalAvgHoldtime':_0x42449e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x42449e[_0xed2c('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x42449e[_0xed2c('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x42449e[_0xed2c('0x6c')],'predictiveIntervalErlangCalls':_0x42449e[_0xed2c('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x42449e[_0xed2c('0x6e')],'predictiveIntervalHitRate':_0x42449e[_0xed2c('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x42449e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x42449e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x42449e[_0xed2c('0x70')],'predictiveIntervalTotalCalls':_0x42449e[_0xed2c('0x71')],'message':_0x42449e['message'],'originated':_0x42449e[_0xed2c('0x72')],'erlangCalls':_0x42449e[_0xed2c('0x73')],'erlangCallToSecond':_0x42449e[_0xed2c('0x74')],'erlangAbandonmentRate':_0x42449e['erlangAbandonmentRate'],'erlangBusyFactor':_0x42449e[_0xed2c('0x75')],'startPredictive':_0x42449e[_0xed2c('0x76')],'startProgressive':_0x42449e['startProgressive']};if(_0x42449e[_0xed2c('0x77')]){_0x2c27ca[_0xed2c('0x77')]={'id':_0x42449e[_0xed2c('0x77')]['id'],'name':_0x42449e['Trunk'][_0xed2c('0x3e')],'active':_0x42449e[_0xed2c('0x77')][_0xed2c('0x78')],'callerid':_0x42449e[_0xed2c('0x77')][_0xed2c('0x79')]};}if(_0x42449e[_0xed2c('0x41')]){_0x2c27ca[_0xed2c('0x41')]={'id':_0x42449e[_0xed2c('0x41')]['id'],'name':_0x42449e[_0xed2c('0x41')][_0xed2c('0x3e')]};}var _0x4c85da=md5(JSON['stringify'](_0x2c27ca));if(_0x42449e[_0xed2c('0x3')]!==_0x4c85da){_0x42449e[_0xed2c('0x3')]=_0x4c85da;emit(util['format'](_0xed2c('0x7a'),_0x2c27ca[_0xed2c('0x3e')]),_0xed2c('0x7b'),_0x2c27ca);}}}function emitCampaignSummary(_0x2ba3d4){if(_0x2ba3d4[_0xed2c('0x4c')]===_0xed2c('0x7c')){emit(util[_0xed2c('0x7d')](_0xed2c('0x7e'),_0x2ba3d4['name']),_0xed2c('0x7f'),_0x2ba3d4);}}function checkGetDataPredictive(_0x34fc61){if(isNotNull(_0x34fc61)&&!_[_0xed2c('0x45')](_0x34fc61)){loggerPredictive[_0xed2c('0x80')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0xed2c('0x81'),_0x34fc61['predictiveIntervalTotalCalls']);loggerPredictive[_0xed2c('0x80')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34fc61[_0xed2c('0x69')]);loggerPredictive[_0xed2c('0x80')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34fc61[_0xed2c('0x6c')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x82'),_0x34fc61[_0xed2c('0x6b')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x83'),_0x34fc61[_0xed2c('0x84')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x85'),_0x34fc61['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xed2c('0x86'));if(_0x34fc61[_0xed2c('0x71')]>0x0){if(!_[_0xed2c('0x3c')](_0x34fc61[_0xed2c('0x6a')])&&_0x34fc61['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xed2c('0x80')](_0xed2c('0x87'));if(!_['isUndefined'](_0x34fc61['predictiveIntervalAvgHoldtime'])&&_0x34fc61[_0xed2c('0x84')]>0x0){return!![];}loggerPredictive['info'](_0xed2c('0x88'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xed2c('0x80')](_0xed2c('0x89'));}return![];}function mergeDataErlangB(_0x386b72){return function(_0x50d1a4){loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8a'));loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8b'),_0x50d1a4[_0xed2c('0x73')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8c'),_0x50d1a4[_0xed2c('0x74')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8d'),_0x50d1a4[_0xed2c('0x8e')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8f'),_0x50d1a4[_0xed2c('0x75')]);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x8d'),_0x50d1a4[_0xed2c('0x8e')]);loggerPredictive[_0xed2c('0x80')]('---------------------------');_[_0xed2c('0x90')](_0x386b72,_0x50d1a4);};}function getDiff(_0x325f83){var _0x32866b=moment()[_0xed2c('0x48')](0x0);var _0xd28f90=moment(_0x325f83)[_0xed2c('0x48')](0x0);return _0x32866b[_0xed2c('0x49')](_0xd28f90,_0xed2c('0x4a'));}function ifInterval(_0x1cc00d,_0x24e89b){if(_[_0xed2c('0x3c')](_0x24e89b)){return![];}return getDiff(_0x24e89b)<_0x1cc00d*0x3c;}function freeVariablesPredictive(_0x4890b2){if(isNotNull(_0x4890b2)){if(!_[_0xed2c('0x3c')](_0x4890b2[_0xed2c('0x26')])){_0x4890b2[_0xed2c('0x26')]=undefined;loggerPredictive[_0xed2c('0x80')](_0x4890b2['name'],_0xed2c('0x91'));}if(!_['isUndefined'](_0x4890b2[_0xed2c('0x76')])){_0x4890b2[_0xed2c('0x76')]=undefined;loggerPredictive['info'](_0x4890b2[_0xed2c('0x3e')],_0xed2c('0x92'));}if(!_[_0xed2c('0x3c')](_0x4890b2[_0xed2c('0x93')])){clearInterval(_0x4890b2[_0xed2c('0x93')]);_0x4890b2[_0xed2c('0x93')]=undefined;loggerPredictive[_0xed2c('0x80')](_0x4890b2[_0xed2c('0x3e')],_0xed2c('0x94'));}}}function erlangb(_0x46684d,_0x1cf2df){if(_0x1cf2df===0x0){return 0x0;}var _0x45d41d=0x1;for(var _0x47b4bc=0x1;_0x47b4bc<=_0x1cf2df;_0x47b4bc+=0x1){_0x45d41d=0x1+_0x45d41d*_0x47b4bc/_0x46684d;}return 0x1/_0x45d41d;}function isVoiceQueueOutbound(_0x426c84){return _0x426c84===_0xed2c('0x95');}function isNotPreview(_0x5c3061){return _0x5c3061!==_0xed2c('0x1d');}function isCampaignIvr(_0x2c4097){return _0x2c4097===_0xed2c('0x7c');}function getCallerId(_0x1cd80d,_0x2b50e5,_0x4e6619){if(!_['isUndefined'](_0x4e6619)&&typeof _0x4e6619===_0xed2c('0x96')&&!_[_0xed2c('0x45')](_0x4e6619)){if(!_[_0xed2c('0x3c')](_0x2b50e5)&&typeof _0x2b50e5===_0xed2c('0x96')&&!_['isEmpty'](_0x2b50e5)){return util[_0xed2c('0x7d')](_0xed2c('0x97'),_0x2b50e5,_0x4e6619);}return util['format'](_0xed2c('0x97'),_0x4e6619,_0x4e6619);}if(!_['isUndefined'](_0x1cd80d)&&typeof _0x1cd80d===_0xed2c('0x96')&&!_[_0xed2c('0x45')](_0x1cd80d)){return _0x1cd80d;}return _0xed2c('0x98');}function loggerCatchQueueSummary(_0x3ac3ff,_0xf01998){return function(_0x4959b5){freeVariablesPredictive(_0xf01998);emitVoiceQueueSummary(_0xf01998);emitCampaignSummary(_0xf01998);loggerSyncQueueSummary['error'](_0x3ac3ff,util['inspect'](_0x4959b5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x43846a,_0x1000db){return function(_0x334fc7){loggerPredictive[_0xed2c('0x99')](_0x1000db[_0xed2c('0x3e')],_0x43846a);loggerPredictive[_0xed2c('0x99')](_0x334fc7[_0xed2c('0x9a')]);freeVariablesPredictive(_0x1000db);};}function loggerCatch(_0x2bc41b){return function(_0x6e7fef){logger[_0xed2c('0x99')](_0x2bc41b,util[_0xed2c('0x9b')](_0x6e7fef,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x42b60a){return _0x42b60a&&!_[_0xed2c('0x3c')](_0x42b60a)&&_0x42b60a['length']>0x0;}function decremetOriginate(_0x40e0e6){if(!_[_0xed2c('0x3c')](_0x40e0e6)&&_0x40e0e6!==null){if(typeof _0x40e0e6[_0xed2c('0x72')]!==_0xed2c('0x9c')){if(_0x40e0e6['originated']>0x0){_0x40e0e6[_0xed2c('0x72')]-=0x1;}else{logger[_0xed2c('0x99')](_0xed2c('0x9d'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x16bf7c,_0x53acca,_0xe255e0){if(_0x53acca>_0xe255e0){for(var _0x254a6a=0x0;_0x254a6a<_0x53acca-_0xe255e0;_0x254a6a+=0x1){decremetOriginate(_0x16bf7c);}}}function loggerGetContactDialer(_0x42a9ae,_0x1b1862,_0x2f972b){return function(_0x29c662){checkContactLowerLimitOriginate(_0x1b1862,_0x2f972b,0x0);logger[_0xed2c('0x99')](_0x42a9ae,util[_0xed2c('0x9b')](_0x29c662,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3fcaa2){return function(_0x14911e){if(isNotNull(_0x14911e)&&isNotNull(_0x14911e[0x0])){if(_0x14911e[0x0]['contactsRescheduled']>0x0){_0x3fcaa2[_0xed2c('0x3d')]=_0xed2c('0x9e');logger['info'](_0xed2c('0x9f')+_0x3fcaa2[_0xed2c('0x3e')],_0x14911e[0x0][_0xed2c('0xa0')],'contacts');}else{_0x3fcaa2[_0xed2c('0x3d')]=_0xed2c('0xa1');logger[_0xed2c('0x80')]('[getContactDialer2][Empty]'+_0x3fcaa2['name']);}}};}function notSendMessagesQueue(_0x11d2cd){if(_0x11d2cd['sendMessageOneNotActive']){freeVariablesPredictive(_0x11d2cd);if(_0x11d2cd[_0xed2c('0x72')]===0x0&&_0x11d2cd[_0xed2c('0x55')]===0x0&&_0x11d2cd[_0xed2c('0x58')]===0x0&&(_0x11d2cd['pTalking']||0x0)===0x0){_0x11d2cd[_0xed2c('0xa2')]=![];_0x11d2cd[_0xed2c('0x4f')]=0x0;_0x11d2cd[_0xed2c('0x3d')]=_0xed2c('0x40');loggerSyncQueueSummary[_0xed2c('0x99')](_0xed2c('0xa3'),_0x11d2cd[_0xed2c('0x3e')],_0xed2c('0xa4'));}else{_0x11d2cd[_0xed2c('0x3d')]=_0xed2c('0xa5');loggerSyncQueueSummary[_0xed2c('0x99')](_0xed2c('0xa3'),_0x11d2cd[_0xed2c('0x3e')],_0xed2c('0xa6'));}emitVoiceQueueSummary(_0x11d2cd);}}function notSendMessagesCampaign(_0x54291e){if(_0x54291e[_0xed2c('0xa2')]){if(_0x54291e['originated']===0x0){_0x54291e[_0xed2c('0xa2')]=![];_0x54291e[_0xed2c('0x3d')]=_0xed2c('0x40');loggerSyncQueueSummary[_0xed2c('0x99')](_0xed2c('0xa7'),_0x54291e['name'],'is\x20not\x20active');}else{_0x54291e[_0xed2c('0x3d')]=_0xed2c('0xa5');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x54291e[_0xed2c('0x3e')],_0xed2c('0xa6'));}emitCampaignSummary(_0x54291e);}}function createObjHistory(_0x36640f,_0x9f7471,_0x92e38b,_0x3ba92e,_0x11c527){_0x36640f[_0xed2c('0x3d')]=_0x92e38b;var _0x446f48=new Action(_0x36640f,_0x9f7471);var _0x40f0d0=new History(_0x446f48);_0x40f0d0[_0xed2c('0xa8')]=_0x3ba92e;_0x40f0d0['statedesc']=_0x11c527;_0x40f0d0['endtime']=_0x446f48[_0xed2c('0xa9')];return _0x40f0d0;}Dialer[_0xed2c('0x19')][_0xed2c('0x3b')]=function(){var _0x3e9412=this;setInterval(function(){_0x3e9412[_0xed2c('0xaa')](_0x3e9412[_0xed2c('0x24')],_0xed2c('0xab'));_0x3e9412[_0xed2c('0xaa')](_0x3e9412[_0xed2c('0x23')],_0xed2c('0xac'));},0x32c8);};Dialer[_0xed2c('0x19')][_0xed2c('0xaa')]=function(_0x2dbb2c,_0x2f31c4){var _0x4b4f88=this;for(var _0x292634 in _0x2dbb2c){if(typeof _0x2dbb2c[_0x292634]!=='undefined'){this[_0xed2c('0x1c')]['enqueue'](function(){if(!_['isNil'](_0x2dbb2c[_0x292634])){return ami[_0xed2c('0xad')]({'action':_0xed2c('0xae'),'channel':_0x2dbb2c[_0x292634][_0xed2c('0xaf')]})[_0xed2c('0xb0')](function(_0x1216f8){if(_0x1216f8['message']===_0xed2c('0xb1')){setTimeout(function(){if(_0x2dbb2c[_0x292634]&&_0x2dbb2c[_0x292634]['type']!=='ivr'){_0x4b4f88['updateOriginated'](_0x4b4f88[_0xed2c('0x1e')][_0x2dbb2c[_0x292634]['queue']]);logger[_0xed2c('0x99')](_0xed2c('0xb2'),_0x2f31c4,_0x292634,_0x2dbb2c[_0x292634]['queue']);delete _0x2dbb2c[_0x292634];}if(_0x2dbb2c[_0x292634]&&_0x2dbb2c[_0x292634][_0xed2c('0x4c')]===_0xed2c('0x7c')){_0x4b4f88['updateOriginated'](_0x4b4f88[_0xed2c('0x1f')][_0x2dbb2c[_0x292634][_0xed2c('0xb3')]]);logger[_0xed2c('0x99')](_0xed2c('0xb4'),_0x2f31c4,_0x292634,_0x2dbb2c[_0x292634][_0xed2c('0xb3')]);delete _0x2dbb2c[_0x292634];}},0x2328);}});}});}}};Dialer[_0xed2c('0x19')]['countReScheduled']=function(_0x2a3489){return BPromise['resolve']()[_0xed2c('0xb5')](cmHopper['countReScheduled'](_0x2a3489))['catch'](loggerCatch(_0xed2c('0xb6')));};Dialer[_0xed2c('0x19')][_0xed2c('0xb7')]=function(_0xf4a52a){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopperBlack['checkIsBlackList'](_0xf4a52a))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xb9')));};Dialer[_0xed2c('0x19')][_0xed2c('0xba')]=function(_0x4a4e96){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopperBlack[_0xed2c('0xba')](_0x4a4e96))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xbb')));};Dialer[_0xed2c('0x19')]['averageHandleTime']=function(_0x113ce6){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopperHistory[_0xed2c('0xbc')](_0x113ce6))['catch'](loggerCatch(_0xed2c('0xbd')));};Dialer[_0xed2c('0x19')][_0xed2c('0xbe')]=function(_0x387a50){return BPromise['resolve']()[_0xed2c('0xb5')](cmHopper[_0xed2c('0xbe')](_0x387a50))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xbf')));};Dialer[_0xed2c('0x19')][_0xed2c('0xc0')]=function(_0x38b5a6,_0x2ad2e5,_0x1dbe24){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopper[_0xed2c('0xc0')](_0x38b5a6,_0x2ad2e5,_0x1dbe24))[_0xed2c('0xb0')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xed2c('0x19')][_0xed2c('0xc1')]=function(_0x332fa6,_0x597080,_0x22dd65,_0x2d4f41,_0x21d922){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopper[_0xed2c('0xc1')](_0x332fa6,_0x597080,_0x22dd65,_0x2d4f41))[_0xed2c('0xb0')](function(_0x109fe0){_0x21d922[_0xed2c('0xc2')]-=_0x22dd65;_0x21d922[_0xed2c('0xc2')]=_0x21d922[_0xed2c('0xc2')]>0x0?_0x21d922[_0xed2c('0xc2')]:0x0;loggerCatch(_0xed2c('0xc3'))(_0x109fe0);});};Dialer[_0xed2c('0x19')][_0xed2c('0xc4')]=function(_0x5b3493,_0x3b6602,_0x1dd576,_0x521302){return BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](cmHopper[_0xed2c('0xc4')](_0x5b3493,_0x3b6602,_0x1dd576))['catch'](function(_0x276da2){_0x521302['temp']-=_0x3b6602;_0x521302[_0xed2c('0xc2')]=_0x521302[_0xed2c('0xc2')]>0x0?_0x521302[_0xed2c('0xc2')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x276da2);});};Dialer['prototype'][_0xed2c('0xc5')]=function(_0x3931b3){return BPromise['resolve']()[_0xed2c('0xb5')](voiceQueueRt[_0xed2c('0xc5')](_0x3931b3))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xc6')));};Dialer['prototype'][_0xed2c('0xc7')]=function(_0x42d714){return BPromise['resolve']()['then'](cmHopper[_0xed2c('0xc7')](_0x42d714))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xc8')));};Dialer['prototype'][_0xed2c('0xc9')]=function(_0x42b044){return BPromise['resolve']()[_0xed2c('0xb5')](cmHopperHistory['createHistory'](_0x42b044))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xca')));};Dialer[_0xed2c('0x19')]['updateOriginated']=function(_0x1ff02b){if(!_[_0xed2c('0x3c')](_0x1ff02b)&&_0x1ff02b!==null){if(typeof _0x1ff02b[_0xed2c('0x72')]!==_0xed2c('0x9c')){if(_0x1ff02b[_0xed2c('0x72')]>0x0){_0x1ff02b[_0xed2c('0x72')]-=0x1;}else{logger[_0xed2c('0x99')](_0xed2c('0xcb'));}}}else{logger['error'](_0xed2c('0xcc'));}};Dialer[_0xed2c('0x19')]['loggerHandler']=function(_0x441567,_0xbc419f){var _0x42100b=this;return function(_0x4f3e09){_0x42100b['updateOriginated'](_0xbc419f);logger[_0xed2c('0x99')](_0x441567,util['inspect'](_0x4f3e09,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x510c80,_0x58199a,_0x5da99b){var _0x2bc4a4={'state':0x19,'statedesc':_0xed2c('0xcd')};this['updateOriginated'](_0x58199a);this[_0xed2c('0xce')](_['merge'](_0x2bc4a4,_[_0xed2c('0xcf')](_0x5da99b,['ContactId','ListId',_0xed2c('0xd0'),_0xed2c('0xd1'),_0xed2c('0xd2')])),_0xed2c('0xd3'),_0xed2c('0xd4'));logger[_0xed2c('0x99')](_0x510c80);};Dialer[_0xed2c('0x19')]['isSuccess']=function(_0x5a3254){return _0x5a3254===_0xed2c('0xd5');};Dialer[_0xed2c('0x19')]['isTrunkReachable']=function(_0xdb614){return!_['isUndefined'](_0xdb614)&&_0xdb614&&!_[_0xed2c('0x3c')](_0xdb614[_0xed2c('0x3e')])&&!_[_0xed2c('0x3c')](_0xdb614[_0xed2c('0x78')])&&_0xdb614['active']&&(this[_0xed2c('0x21')][util[_0xed2c('0x7d')]('SIP/%s',_0xdb614[_0xed2c('0x3e')])][_0xed2c('0xae')]===_0xed2c('0xd6')||this[_0xed2c('0x21')][util[_0xed2c('0x7d')](_0xed2c('0xd7'),_0xdb614['name'])][_0xed2c('0xae')]===_0xed2c('0xd8'));};Dialer[_0xed2c('0x19')]['saveInDb']=function(_0x5f1f73,_0xd86536,_0x1ea1e7){this['createHistory'](_0x5f1f73)[_0xed2c('0xb0')](loggerCatch(_0xd86536));this['moveContactManagedDialer'](_0x5f1f73)[_0xed2c('0xb0')](loggerCatch(_0x1ea1e7));};Dialer[_0xed2c('0x19')][_0xed2c('0xd9')]=function(_0x2528c8){var _0xdc9306=this[_0xed2c('0x24')][_0x2528c8['uniqueid']];var _0x1a8cef;if(!_[_0xed2c('0xda')](_0x2528c8)&&!_[_0xed2c('0xda')](_0x2528c8['variable'])&&!_[_0xed2c('0xda')](_0x2528c8[_0xed2c('0xdb')][_0xed2c('0xdc')])&&_0x2528c8['exten']==='xcally-motion-dialer'&&_0xdc9306){if(_0xdc9306[_0xed2c('0x4c')]!==_0xed2c('0x7c')&&this[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0xdd')]&&_0x2528c8[_0xed2c('0xde')]===_0xed2c('0xdf')){delete this[_0xed2c('0x24')][_0x2528c8['uniqueid']];this[_0xed2c('0xe0')](this[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]]);this['voiceQueues'][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5e')]+=0x1;this[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5d')]+=0x1;_0x1a8cef=new Hangup(_0xdc9306,_0x2528c8);_0x1a8cef['state']=0x12;_0x1a8cef['statedesc']=_0xed2c('0xe1');_0x1a8cef[_0xed2c('0xe2')]='AMD';ami[_0xed2c('0x4b')](_0xed2c('0xe3'),ut[_0xed2c('0xe4')](_0x1a8cef,_0xed2c('0xe5')));this[_0xed2c('0xce')](_0x1a8cef,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0xdc9306[_0xed2c('0x4c')]!==_0xed2c('0x7c')&&this[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0xdd')]&&_0x2528c8[_0xed2c('0xde')]===_0xed2c('0xe6')){var _0x303137=this;return new BPromise(function(_0x58fd7c,_0x4f3a5c){delete _0x303137[_0xed2c('0x24')][_0x2528c8[_0xed2c('0xe7')]];_0x303137[_0xed2c('0xe0')](_0x303137['voiceQueues'][_0xdc9306[_0xed2c('0xb3')]]);_0x303137[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5e')]+=0x1;_0x303137[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5d')]+=0x1;var _0x199864=_0x303137[_0xed2c('0x1e')][_0xdc9306[_0xed2c('0xb3')]];var _0x414c85=new Hangup(_0xdc9306,_0x2528c8);_0x414c85[_0xed2c('0xa8')]=0x13;_0x414c85[_0xed2c('0xe8')]=_0xed2c('0xe9');_0x414c85[_0xed2c('0xe2')]=_0xed2c('0xea');_0x414c85[_0xed2c('0xeb')]+=0x1;_0x414c85[_0xed2c('0xec')]+=0x1;_0x414c85[_0xed2c('0xe5')]=!![];ami[_0xed2c('0x4b')](_0xed2c('0xe3'),ut['buildObj'](_0x414c85,_0xed2c('0xe5')));_0x303137[_0xed2c('0xc9')](_0x414c85)['catch'](loggerCatch(_0xed2c('0xed')));if(_0x414c85[_0xed2c('0xee')]+_0x414c85[_0xed2c('0xef')]+_0x414c85[_0xed2c('0xf0')]+_0x414c85[_0xed2c('0xf1')]+_0x414c85[_0xed2c('0xf2')]+_0x414c85[_0xed2c('0xf3')]+_0x414c85[_0xed2c('0xeb')]+_0x414c85[_0xed2c('0xf4')]>=_0x199864[_0xed2c('0xf5')]){_0x303137['stateGlobal'](_0x414c85,_0x58fd7c,_0x4f3a5c,_0xed2c('0xf6'));}else{if(_0x414c85['countmachineretry']>=_0x199864['dialMachineMaxRetry']){_0x303137[_0xed2c('0xf7')](_0x414c85,_0x58fd7c,_0x4f3a5c,'reason\x2019\x20machine....');}else{_0x303137[_0xed2c('0xbe')]({'active':![],'countmachineretry':_0x414c85[_0xed2c('0xeb')],'scheduledat':moment()[_0xed2c('0xf8')](_0x199864[_0xed2c('0xf9')],_0xed2c('0xfa'))['format'](_0xed2c('0xfb')),'ContactId':_0x414c85[_0xed2c('0xfc')],'ListId':_0x414c85[_0xed2c('0xfd')],'VoiceQueueId':_0x414c85[_0xed2c('0xd1')]||undefined,'CampaignId':_0x414c85[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xfe')));_0x58fd7c({'reschedule':0x1});}}});}if(_0xdc9306['type']==='ivr'&&this[_0xed2c('0x1f')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0xdd')]&&_0x2528c8[_0xed2c('0xde')]==='HANGUP'){delete this[_0xed2c('0x24')][_0x2528c8[_0xed2c('0xe7')]];this['updateOriginated'](this['campaigns'][_0xdc9306[_0xed2c('0xb3')]]);_0x1a8cef=new Hangup(_0xdc9306,_0x2528c8);_0x1a8cef['state']=0x12;_0x1a8cef[_0xed2c('0xe8')]=_0xed2c('0xe1');_0x1a8cef[_0xed2c('0xe2')]=_0xed2c('0xea');ami[_0xed2c('0x4b')](_0xed2c('0xe3'),ut[_0xed2c('0xe4')](_0x1a8cef,'amd'));this[_0xed2c('0xce')](_0x1a8cef,_0xed2c('0xff'),_0xed2c('0x100'));}if(_0xdc9306[_0xed2c('0x4c')]===_0xed2c('0x7c')&&this[_0xed2c('0x1f')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0xdd')]&&_0x2528c8[_0xed2c('0xde')]===_0xed2c('0xe6')){var _0x303137=this;return new BPromise(function(_0x3eda48,_0x4e9758){delete _0x303137['uniqueId'][_0x2528c8[_0xed2c('0xe7')]];_0x303137[_0xed2c('0xe0')](_0x303137[_0xed2c('0x1f')][_0xdc9306['queue']]);_0x303137[_0xed2c('0x1f')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5e')]+=0x1;_0x303137[_0xed2c('0x1f')][_0xdc9306[_0xed2c('0xb3')]][_0xed2c('0x5d')]+=0x1;var _0x4effc7=_0x303137[_0xed2c('0x1f')][_0xdc9306[_0xed2c('0xb3')]];var _0x4942b5=new Hangup(_0xdc9306,_0x2528c8);_0x4942b5[_0xed2c('0xa8')]=0x13;_0x4942b5[_0xed2c('0xe8')]=_0xed2c('0xe9');_0x4942b5[_0xed2c('0xe2')]=_0xed2c('0xea');_0x4942b5[_0xed2c('0xeb')]+=0x1;_0x4942b5[_0xed2c('0xec')]+=0x1;_0x4942b5[_0xed2c('0xe5')]=!![];ami[_0xed2c('0x4b')](_0xed2c('0xe3'),ut['buildObj'](_0x4942b5,_0xed2c('0xe5')));_0x303137[_0xed2c('0xc9')](_0x4942b5)['catch'](loggerCatch(_0xed2c('0xed')));if(_0x4942b5['countbusyretry']+_0x4942b5[_0xed2c('0xef')]+_0x4942b5[_0xed2c('0xf0')]+_0x4942b5[_0xed2c('0xf1')]+_0x4942b5[_0xed2c('0xf2')]+_0x4942b5[_0xed2c('0xf3')]+_0x4942b5[_0xed2c('0xeb')]+_0x4942b5['countagentrejectretry']>=_0x4effc7[_0xed2c('0xf5')]){_0x303137[_0xed2c('0x101')](_0x4942b5,_0x3eda48,_0x4e9758,_0xed2c('0xf6'));}else{if(_0x4942b5[_0xed2c('0xeb')]>=_0x4effc7[_0xed2c('0x102')]){_0x303137[_0xed2c('0xf7')](_0x4942b5,_0x3eda48,_0x4e9758,_0xed2c('0x103'));}else{_0x303137[_0xed2c('0xbe')]({'active':![],'countmachineretry':_0x4942b5[_0xed2c('0xeb')],'scheduledat':moment()[_0xed2c('0xf8')](_0x4effc7[_0xed2c('0xf9')],'minutes')[_0xed2c('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4942b5[_0xed2c('0xfc')],'ListId':_0x4942b5[_0xed2c('0xfd')],'VoiceQueueId':_0x4942b5[_0xed2c('0xd1')]||undefined,'CampaignId':_0x4942b5['CampaignId']||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xfe')));_0x3eda48({'reschedule':0x1});}}});}}};Dialer[_0xed2c('0x19')][_0xed2c('0x33')]=function(_0x326b8f){var _0x3ae236=this[_0xed2c('0x24')][_0x326b8f[_0xed2c('0xe7')]];var _0x1d9b7d=this;var _0x341ebd;if(_0x3ae236&&_0x3ae236[_0xed2c('0x4c')]===_0xed2c('0x7c')){delete this['uniqueId'][_0x326b8f[_0xed2c('0xe7')]];this[_0xed2c('0xe0')](this['campaigns'][_0x3ae236['queue']]);this[_0xed2c('0x1f')][_0x3ae236[_0xed2c('0xb3')]][_0xed2c('0x104')]+=0x1;_0x341ebd=new Hangup(_0x3ae236,_0x326b8f);this['createHistory'](_0x341ebd)['catch'](loggerCatch(_0xed2c('0x105')));this[_0xed2c('0xc7')](_0x341ebd)[_0xed2c('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x3ae236&&_0x3ae236[_0xed2c('0x4c')]!==_0xed2c('0x7c')&&isNotNull(this['voiceQueues'][_0x3ae236['queue']][_0xed2c('0x106')])){delete this[_0xed2c('0x24')][_0x326b8f[_0xed2c('0xe7')]];this[_0xed2c('0xe0')](this[_0xed2c('0x1e')][_0x3ae236['queue']]);this[_0xed2c('0x1e')][_0x3ae236[_0xed2c('0xb3')]][_0xed2c('0x5e')]+=0x1;this[_0xed2c('0x1e')][_0x3ae236[_0xed2c('0xb3')]][_0xed2c('0x5d')]+=0x1;_0x341ebd=new Hangup(_0x3ae236,_0x326b8f);_0x341ebd['state']=0x10;_0x341ebd['statedesc']=_0xed2c('0x107');_0x341ebd[_0xed2c('0xe2')]=_0xed2c('0x108');this[_0xed2c('0xc9')](_0x341ebd)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x105')));this[_0xed2c('0xc7')](_0x341ebd)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x109')));}if(_0x3ae236&&_0x3ae236[_0xed2c('0x4c')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x3ae236[_0xed2c('0xb3')]][_0xed2c('0x106')])){delete this[_0xed2c('0x24')][_0x326b8f[_0xed2c('0xe7')]];this[_0xed2c('0xe0')](this[_0xed2c('0x1e')][_0x3ae236['queue']]);this['voiceQueues'][_0x3ae236['queue']]['outboundUnknownCallsDay']+=0x1;_0x341ebd=new Hangup(_0x3ae236,_0x326b8f);_0x341ebd['state']=0xc;_0x341ebd[_0xed2c('0xe8')]=_0x326b8f[_0xed2c('0x10a')];_0x341ebd[_0xed2c('0xe2')]=_0xed2c('0x10b');this[_0xed2c('0xc9')](_0x341ebd)[_0xed2c('0xb0')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xed2c('0xc7')](_0x341ebd)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x109')));}};Dialer['prototype'][_0xed2c('0x10c')]=function(_0x263a7c){var _0x1337f6=this[_0xed2c('0x24')][_0x263a7c[_0xed2c('0xe7')]];var _0x3e33f3=this;if(this[_0xed2c('0x1e')][_0x263a7c[_0xed2c('0xb3')]]){if(_0x1337f6&&_0x1337f6['type']!==_0xed2c('0x7c')){delete this['uniqueId'][_0x263a7c[_0xed2c('0xe7')]];this[_0xed2c('0x1e')][_0x263a7c[_0xed2c('0xb3')]][_0xed2c('0x5e')]+=0x1;var _0xc1dc21=new AgentComplete(_0x1337f6,_0x263a7c);if(_0x263a7c[_0xed2c('0x10d')]===_0xed2c('0x10e')){_0xc1dc21[_0xed2c('0x10f')]=this[_0xed2c('0x1e')][_0x263a7c[_0xed2c('0xb3')]]['dialQueueProject2']&&this[_0xed2c('0x1e')][_0x263a7c[_0xed2c('0xb3')]][_0xed2c('0x110')]?moment()[_0xed2c('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xed2c('0xc9')](_0xc1dc21)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xed2c('0xc7')](_0xc1dc21)['catch'](loggerCatch(_0xed2c('0x111')));}}};Dialer[_0xed2c('0x19')][_0xed2c('0x2b')]=function(_0x2ca9eb){if(this[_0xed2c('0x1e')][_0x2ca9eb[_0xed2c('0xb3')]]){if(this[_0xed2c('0x24')][_0x2ca9eb[_0xed2c('0xe7')]]&&this[_0xed2c('0x24')][_0x2ca9eb[_0xed2c('0xe7')]][_0xed2c('0x4c')]!==_0xed2c('0x7c')){this[_0xed2c('0xe0')](this[_0xed2c('0x1e')][_0x2ca9eb['queue']]);this['uniqueId'][_0x2ca9eb[_0xed2c('0xe7')]][_0xed2c('0x112')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));}}};Dialer[_0xed2c('0x19')]['queueCallerAbandonCreateState']=function(_0x4830fb){this[_0xed2c('0xc9')](_0x4830fb)['catch'](loggerCatch(_0xed2c('0x113')));this[_0xed2c('0xc7')](_0x4830fb)[_0xed2c('0xb0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xed2c('0x19')][_0xed2c('0x2d')]=function(_0x32f67b){var _0x42276d=this[_0xed2c('0x24')][_0x32f67b[_0xed2c('0xe7')]];var _0x4c750d=this;if(this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]]){if(_0x42276d&&_0x42276d[_0xed2c('0x4c')]!=='ivr'){delete this[_0xed2c('0x24')][_0x32f67b[_0xed2c('0xe7')]];this[_0xed2c('0xe0')](this['voiceQueues'][_0x32f67b[_0xed2c('0xb3')]]);_0x42276d[_0xed2c('0x114')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));var _0x16888f=new QueueCallerAbandon(_0x42276d,_0x32f67b);if(getSeconds(_0x42276d['droptime'],_0x42276d[_0xed2c('0x115')])>=_0x42276d[_0xed2c('0x116')]){this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x6c')]+=0x1;this[_0xed2c('0x1e')][_0x32f67b['queue']][_0xed2c('0x62')]+=0x1;this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x6e')]+=0x1;_0x16888f['state']=0xa;_0x16888f[_0xed2c('0xe8')]='Drop';_0x16888f[_0xed2c('0x117')]=_0xed2c('0x118');_0x16888f['agiafterat']=this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x119')]?moment()[_0xed2c('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x16888f[_0xed2c('0xf2')]+=0x1;_0x16888f[_0xed2c('0xec')]+=0x1;if(_0x16888f[_0xed2c('0xf2')]>=this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x11a')]){this[_0xed2c('0x11b')](_0x16888f);}else{this[_0xed2c('0xbe')]({'active':![],'countdropretry':_0x16888f['countdropretry'],'scheduledat':moment()[_0xed2c('0xf8')](this['voiceQueues'][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x11c')],'minutes')[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x42276d[_0xed2c('0xfc')],'ListId':_0x42276d[_0xed2c('0xfd')],'VoiceQueueId':_0x42276d[_0xed2c('0xd1')]||undefined,'CampaignId':_0x42276d['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x3cd7bc=new History(_0x16888f);_0x3cd7bc[_0xed2c('0xa8')]=0xa;_0x3cd7bc['statedesc']=_0xed2c('0x11d');_0x3cd7bc[_0xed2c('0xa9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3cd7bc['endtime']=_0x3cd7bc[_0xed2c('0xa9')];_0x3cd7bc[_0xed2c('0x11e')]=_0x16888f['calleridname'];_0x3cd7bc[_0xed2c('0x11f')]=_0x16888f['calleridnum'];this[_0xed2c('0xc9')](_0x3cd7bc)[_0xed2c('0xb0')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this['voiceQueues'][_0x32f67b[_0xed2c('0xb3')]][_0xed2c('0x6b')]+=0x1;this[_0xed2c('0x1e')][_0x32f67b['queue']][_0xed2c('0x61')]+=0x1;_0x16888f[_0xed2c('0xa8')]=0xb;_0x16888f[_0xed2c('0xe8')]=_0xed2c('0x120');_0x16888f[_0xed2c('0x117')]=_0xed2c('0x121');_0x16888f[_0xed2c('0xf3')]+=0x1;_0x16888f[_0xed2c('0xec')]+=0x1;if(_0x16888f[_0xed2c('0xf3')]>=this[_0xed2c('0x1e')][_0x32f67b[_0xed2c('0xb3')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x16888f);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x16888f[_0xed2c('0xf3')],'scheduledat':moment()[_0xed2c('0xf8')](this['voiceQueues'][_0x32f67b[_0xed2c('0xb3')]]['dialAbandonedRetryFrequency'],_0xed2c('0xfa'))['format'](_0xed2c('0xfb')),'ContactId':_0x42276d[_0xed2c('0xfc')],'ListId':_0x42276d[_0xed2c('0xfd')],'VoiceQueueId':_0x42276d[_0xed2c('0xd1')]||undefined,'CampaignId':_0x42276d[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x122')));var _0x3cd7bc=new History(_0x16888f);_0x3cd7bc['state']=0xb;_0x3cd7bc[_0xed2c('0xe8')]=_0xed2c('0x120');_0x3cd7bc[_0xed2c('0xa9')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));_0x3cd7bc['endtime']=_0x3cd7bc[_0xed2c('0xa9')];_0x3cd7bc[_0xed2c('0x11e')]=_0x16888f[_0xed2c('0x11e')];_0x3cd7bc[_0xed2c('0x11f')]=_0x16888f[_0xed2c('0x11f')];this['createHistory'](_0x3cd7bc)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x123')));}}}}};Dialer[_0xed2c('0x19')][_0xed2c('0x35')]=function(_0x4f38c2){if(this[_0xed2c('0x23')][_0x4f38c2[_0xed2c('0xe7')]]){this[_0xed2c('0x23')][_0x4f38c2['uniqueid']][_0xed2c('0xaf')]=_0x4f38c2[_0xed2c('0xaf')];}if(this['uniqueId'][_0x4f38c2[_0xed2c('0xe7')]]){this['uniqueId'][_0x4f38c2[_0xed2c('0xe7')]][_0xed2c('0xaf')]=_0x4f38c2[_0xed2c('0xaf')];}};Dialer['prototype'][_0xed2c('0x37')]=function(_0x2235e6){if(strategy[this[_0xed2c('0x1e')][this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]]['queue']][_0xed2c('0x4d')]]===_0xed2c('0x125')){if(this[_0xed2c('0x23')][_0x2235e6['actionid']]&&_[_0xed2c('0xda')](this['actions'][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0x126')])&&_0x2235e6['status']==='1'&&_0x2235e6['paused']==='0'){if(this[_0xed2c('0x20')][_0x2235e6[_0xed2c('0x127')]]){if(!this[_0xed2c('0x20')][_0x2235e6[_0xed2c('0x127')]][_0xed2c('0x126')]){this[_0xed2c('0x20')][_0x2235e6['stateinterface']][_0xed2c('0x126')]=!![];this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0x126')]=!![];this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0x127')]=_0x2235e6[_0xed2c('0x127')];}}}}else if((strategy[this['voiceQueues'][this[_0xed2c('0x23')][_0x2235e6['actionid']][_0xed2c('0xb3')]]['strategy']]||'rrmemory')===_0xed2c('0x18')){if(this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]]){if(this[_0xed2c('0x20')][_0x2235e6['stateinterface']]){this['actions'][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0x127')]=_0x2235e6[_0xed2c('0x127')];if(_[_0xed2c('0xda')](this[_0xed2c('0x28')][this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0xb3')]])){this[_0xed2c('0x28')][this['actions'][_0x2235e6[_0xed2c('0x124')]]['queue']]=[];}this[_0xed2c('0x28')][this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]][_0xed2c('0xb3')]][_0xed2c('0x128')](_[_0xed2c('0x90')](_[_0xed2c('0xcf')](this[_0xed2c('0x23')][_0x2235e6[_0xed2c('0x124')]],[_0xed2c('0x129'),_0xed2c('0x127')]),{'status':_0x2235e6[_0xed2c('0xae')],'paused':_0x2235e6[_0xed2c('0x12a')]}));}}}};function unlockQueueStatus(_0x4a10c9,_0x8a4b54){setTimeout(function(){if(_[_0xed2c('0x3c')](_0x4a10c9[_0xed2c('0x12b')])){loggerBooked[_0xed2c('0x99')](_0xed2c('0x12c'),_0x8a4b54);}_0x4a10c9[_0xed2c('0x12b')]=!![];loggerBooked[_0xed2c('0x80')](_0xed2c('0x12d'),_0x8a4b54,JSON[_0xed2c('0x47')](_[_0xed2c('0xcf')](_0x4a10c9,[_0xed2c('0x3e'),'queueStatusComplete'])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x164b5f){var _0x5c4433=this;var _0x3db5f6=_0x5c4433[_0xed2c('0x1e')][_0x5c4433[_0xed2c('0x23')][_0x164b5f['actionid']][_0xed2c('0xb3')]];if(strategy[this['voiceQueues'][this['actions'][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]][_0xed2c('0x4d')]]===_0xed2c('0x125')){if(this['actions'][_0x164b5f[_0xed2c('0x124')]]&&this['actions'][_0x164b5f['actionid']][_0xed2c('0x127')]){this[_0xed2c('0x1d')][_0xed2c('0x12e')](this['actions'][_0x164b5f['actionid']][_0xed2c('0x129')],this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]]['stateinterface'])[_0xed2c('0xb0')](function(_0x1b9fbb){logger['error'](_0xed2c('0x12f'),util[_0xed2c('0x9b')](_0x1b9fbb,{'showHidden':![],'depth':null}));})[_0xed2c('0x1b')](function(){_0x5c4433['updateOriginated'](_0x5c4433[_0xed2c('0x1e')][_0x5c4433['actions'][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]]);_0x5c4433[_0xed2c('0x20')][_0x5c4433[_0xed2c('0x23')][_0x164b5f['actionid']][_0xed2c('0x127')]][_0xed2c('0x126')]=![];delete _0x5c4433[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]];unlockQueueStatus(_0x3db5f6);});}else{this[_0xed2c('0xe0')](this[_0xed2c('0x1e')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]]);this[_0xed2c('0xbe')]({'active':![],'ContactId':this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xfc')],'ListId':this[_0xed2c('0x23')][_0x164b5f['actionid']][_0xed2c('0xfd')],'VoiceQueueId':this[_0xed2c('0x23')][_0x164b5f['actionid']][_0xed2c('0xd1')]||undefined,'CampaignId':this['actions'][_0x164b5f[_0xed2c('0x124')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xed2c('0x130')));delete this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]];unlockQueueStatus(_0x3db5f6);}}else if((strategy[this[_0xed2c('0x1e')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]][_0xed2c('0x4d')]]||'rrmemory')===_0xed2c('0x18')){var _0xcfea4f;if(this[_0xed2c('0x23')][_0x164b5f['actionid']]&&!_[_0xed2c('0x45')](this[_0xed2c('0x28')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]])){if(this[_0xed2c('0x29')][_0x5c4433['actions'][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]]){this[_0xed2c('0x29')][_0x5c4433['actions'][_0x164b5f['actionid']][_0xed2c('0xb3')]]=this[_0xed2c('0x29')][this['actions'][_0x164b5f[_0xed2c('0x124')]]['queue']]?this['queueBookedRR'][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]]:this[_0xed2c('0x28')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]]['queue']]?this[_0xed2c('0x28')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]][_0xed2c('0x131')]=this[_0xed2c('0x29')][this[_0xed2c('0x23')][_0x164b5f[_0xed2c('0x124')]][_0xed2c('0xb3')]];for(var _0x57ca06=0x0;_0x57ca06=0x0;})[_0xed2c('0xb0')](myreject(_0x526bbe)));}}else{_0x4381e2[_0xed2c('0x128')](ami[_0xed2c('0xad')]({'action':_0xed2c('0x14d'),'command':util[_0xed2c('0x7d')](_0xed2c('0x14a'),_0x1903af,!_[_0xed2c('0x3c')](config[_0xed2c('0x146')][_0xbe61c3])?_0xbe61c3:'')})[_0xed2c('0xb5')](function(_0x2f625e){return _0x2f625e['content']['indexOf'](_0xed2c('0x14e'))>=0x0;})[_0xed2c('0xb0')](myreject(_0x526bbe)));}BPromise[_0xed2c('0x14f')](_0x4381e2)[_0xed2c('0xb5')](function(_0x400cce){var _0x222604=_['some'](_0x400cce);if(_0x222604){return _0x4bdb07(_0x222604);}else{_0x41352a[_0xed2c('0x3d')]=_0x538a0a?_0xed2c('0x150'):_0xed2c('0x151');return _0x526bbe(msgResponse('[ifTime][promiseAll]',_0xed2c('0x147'),_0xed2c('0x152')+_0x538a0a+'\x20'+_0x1984d8+'\x20Interval\x20is\x20overtime:\x20'+util[_0xed2c('0x9b')](_0x1903af,{'showHidden':![],'depth':null})+_0xed2c('0x153')+_0xbe61c3));}})[_0xed2c('0xb0')](function(_0x4a35ff){return _0x526bbe(msgResponse('ifTime',_0xed2c('0x147'),JSON[_0xed2c('0x47')](_0x4a35ff)));});});};Dialer['prototype'][_0xed2c('0x154')]=function(_0x32544b){var _0x458d6a=this;return function(){switch(_0x32544b[_0xed2c('0x5a')]){case _0xed2c('0x155'):freeVariablesPredictive(_0x32544b);_0x458d6a[_0xed2c('0x156')](_0x32544b,0x1);break;case _0xed2c('0x157'):freeVariablesPredictive(_0x32544b);_0x458d6a[_0xed2c('0x156')](_0x32544b,_0x32544b['dialPowerLevel']);break;case _0xed2c('0x8'):_0x458d6a['predictive'](_0x32544b);break;case _0xed2c('0x158'):freeVariablesPredictive(_0x32544b);_0x458d6a[_0xed2c('0x156')](_0x32544b,0x1);break;default:freeVariablesPredictive(_0x32544b);logger[_0xed2c('0x99')]('Queue',_0x32544b[_0xed2c('0x3e')],'method\x20not\x20recognized');}};};Dialer[_0xed2c('0x19')][_0xed2c('0x159')]=function(_0x18975a){var _0xba4a04=this;return function(){_0xba4a04['handleIvr'](_0x18975a);};};Dialer[_0xed2c('0x19')][_0xed2c('0x31')]=function(_0x3082dd){var _0x5e2703=this;if(isNotPreview(_0x3082dd[_0xed2c('0x5a')])){if(isVoiceQueueOutbound(_0x3082dd[_0xed2c('0x4c')])&&isActive(_0x3082dd[_0xed2c('0x15a')])){_0x3082dd['sendMessageOneNotActive']=!![];BPromise[_0xed2c('0xb8')]()[_0xed2c('0xb5')](checkIsLoggedIn(_0x3082dd,_0x3082dd[_0xed2c('0x50')]))['then'](checkIsActive(_0x3082dd,_0x3082dd[_0xed2c('0x15a')]))[_0xed2c('0xb5')](checkInterval(_0x3082dd))[_0xed2c('0xb5')](_0x5e2703['checkIsTrunkReachable'](_0x3082dd))[_0xed2c('0xb5')](_0x5e2703[_0xed2c('0x141')](_0x3082dd[_0xed2c('0x15b')],_0x3082dd[_0xed2c('0x15c')],_0x3082dd[_0xed2c('0x3e')],_0x3082dd))[_0xed2c('0xb5')](_0x5e2703[_0xed2c('0x143')](_0x3082dd[_0xed2c('0x41')],_0x3082dd[_0xed2c('0x15c')],_0x3082dd[_0xed2c('0x3e')],_0x3082dd))[_0xed2c('0xb5')](_0x5e2703['checkDialMethod'](_0x3082dd))[_0xed2c('0xb0')](loggerCatchQueueSummary(_0xed2c('0x15d'),_0x3082dd));}else{notSendMessagesQueue(_0x3082dd);}}else{freeVariablesPredictive(_0x3082dd);}};Dialer[_0xed2c('0x19')][_0xed2c('0x13b')]=function(){var _0x22b497=this;var _0x9f57c6;for(var _0x14b99c in this[_0xed2c('0x1f')]){if(typeof this['campaigns'][_0x14b99c]!==_0xed2c('0x9c')){_0x9f57c6=this['campaigns'][_0x14b99c];if(isCampaignIvr(_0x9f57c6[_0xed2c('0x4c')])&&isActive(_0x9f57c6[_0xed2c('0x78')])){_0x9f57c6[_0xed2c('0xa2')]=!![];BPromise['resolve']()[_0xed2c('0xb5')](checkIsActive(_0x9f57c6,_0x9f57c6[_0xed2c('0x78')]))['then'](checkInterval(_0x9f57c6))['then'](_0x22b497[_0xed2c('0x13c')](_0x9f57c6))[_0xed2c('0xb5')](_0x22b497['checkIfTime'](_0x9f57c6[_0xed2c('0x15b')],_0x9f57c6[_0xed2c('0x15c')],_0x9f57c6[_0xed2c('0x3e')],_0x9f57c6))[_0xed2c('0xb5')](_0x22b497[_0xed2c('0x143')](_0x9f57c6[_0xed2c('0x41')],_0x9f57c6[_0xed2c('0x15c')],_0x9f57c6[_0xed2c('0x3e')],_0x9f57c6))['then'](_0x22b497[_0xed2c('0x159')](_0x9f57c6))[_0xed2c('0xb0')](loggerCatchQueueSummary(_0xed2c('0x15e'),_0x9f57c6));}else{notSendMessagesCampaign(_0x9f57c6);}}}};function getCallerIdRandom(_0x3518de,_0x52e6c1){var _0x4a85e4;var _0x26aa79;var _0x170e4e;if(_0x52e6c1<=0x0){_0x52e6c1=0x1;}_0x4a85e4=new RegExp(_0xed2c('0x15f')+_0x52e6c1+'}$');_0x26aa79=Math[_0xed2c('0x160')](0xa,_0x52e6c1-0x1);_0x170e4e=Math[_0xed2c('0x160')](0xa,_0x52e6c1)-0x1;return util['format']('%s',_['replace'](_0x3518de,_0x4a85e4,_[_0xed2c('0x161')](_0x26aa79,_0x170e4e)));}function extractCalleridName(_0x5e3d2d){var _0x44ce8b=_0x5e3d2d['match'](/"(.*?)"/);return _0x44ce8b?_0x44ce8b[0x1]:_0x5e3d2d;}function extractCalleridNumber(_0x4f9643){var _0x1e5e14=_0x4f9643[_0xed2c('0x162')](/<(.*?)>/);return _0x1e5e14?_0x1e5e14[0x1]:_0x4f9643;}Dialer[_0xed2c('0x19')][_0xed2c('0x163')]=function(_0x6c7ee4,_0x583bc1){var _0x508d87=this;var _0x908061=uuid['v4']();this['actions'][_0x908061]=new Action(_0x6c7ee4,_0x583bc1,_0x908061);return new BPromise(function(_0x1416d0,_0x4d140f){if(_[_0xed2c('0x3c')](_0x6c7ee4)&&typeof _0x6c7ee4!==_0xed2c('0x164')){return _0x4d140f(msgResponse('originate',_0xed2c('0x147'),_0xed2c('0x165')));}if(_[_0xed2c('0x3c')](_0x583bc1[_0xed2c('0x166')][_0xed2c('0x167')])||_0x583bc1[_0xed2c('0x166')]['phone']===null){return _0x4d140f(msgResponse(_0xed2c('0x168'),_0xed2c('0x147'),_0xed2c('0x169')));}var _0x2862ac={'XMD-CALLERID':_0x508d87[_0xed2c('0x23')][_0x908061]['getCaller'](),'XMD-AGI':_0x6c7ee4[_0xed2c('0x106')]?util[_0xed2c('0x7d')](_0xed2c('0x16a'),ipAgi,_0x6c7ee4[_0xed2c('0x106')]):'NONE','XMD-AGIAFTER':_0x6c7ee4[_0xed2c('0x119')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x6c7ee4[_0xed2c('0x119')]):_0xed2c('0x16b'),'XMD-QUEUE':_0x6c7ee4[_0xed2c('0x4c')]===_0xed2c('0x95')?util[_0xed2c('0x7d')](_0xed2c('0x16c'),_0x6c7ee4[_0xed2c('0x3e')],_0x6c7ee4[_0xed2c('0x16d')]||'',_0x6c7ee4[_0xed2c('0x110')]?'c':'',_0x6c7ee4[_0xed2c('0x116')]||0x3):_0xed2c('0x16b'),'XMD-CONTACTID':_0x583bc1['ContactId'],'XMD-CDRTYPE':_0xed2c('0x16e'),'CALLERID(all)':_0x508d87[_0xed2c('0x23')][_0x908061][_0xed2c('0x16f')](),'XMD-AMD':_0x6c7ee4[_0xed2c('0xdd')]?_0xed2c('0x170'):_0xed2c('0x16b'),'XMD-DESTINATION':_0xed2c('0x171')};if(_0x6c7ee4[_0xed2c('0xdd')]){_0x2862ac[_0xed2c('0x172')]=_0x6c7ee4[_0xed2c('0x173')]||0x9c4;_0x2862ac[_0xed2c('0x174')]=_0x6c7ee4[_0xed2c('0x175')]||0x5dc;_0x2862ac[_0xed2c('0x176')]=_0x6c7ee4[_0xed2c('0x177')]||0x320;_0x2862ac[_0xed2c('0x178')]=_0x6c7ee4[_0xed2c('0x179')]||0x1388;_0x2862ac['XMD-AMDMINWORDLENGTH']=_0x6c7ee4[_0xed2c('0x17a')]||0x64;_0x2862ac['XMD-AMDBETWEENWORDSSILENCE']=_0x6c7ee4[_0xed2c('0x17b')]||0x32;_0x2862ac['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x6c7ee4[_0xed2c('0x17c')]||0x3;_0x2862ac['XMD-AMDSILENCETHRESHOLD']=_0x6c7ee4[_0xed2c('0x17d')]||0x100;_0x2862ac[_0xed2c('0x17e')]=_0x6c7ee4[_0xed2c('0x17f')]||0x1388;}if(_0x6c7ee4[_0xed2c('0x4c')]===_0xed2c('0x95')){_0x2862ac[_0xed2c('0x180')]=_0x583bc1[_0xed2c('0xd1')];}else{_0x2862ac[_0xed2c('0x181')]=_0x583bc1[_0xed2c('0xd2')];}for(var _0x55e8e2 in _0x583bc1[_0xed2c('0x166')]){if(typeof _0x583bc1[_0xed2c('0x166')][_0x55e8e2]!==_0xed2c('0x9c')){if(isNotNull(_0x583bc1[_0xed2c('0x166')][_0x55e8e2])&&_0x55e8e2!=='id'&&_0x55e8e2!==_0xed2c('0x182')&&_0x55e8e2!=='createdAt'&&_0x55e8e2!==_0xed2c('0x183')){_0x2862ac[util[_0xed2c('0x7d')](_0xed2c('0x184'),_0xed2c('0x185'),_[_0xed2c('0x186')](_0x55e8e2))]=_0x583bc1['Contact'][_0x55e8e2];}}}var _0x333d03=_0x508d87[_0xed2c('0x13d')](_0x6c7ee4[_0xed2c('0x77')])?getCallerId(_0x6c7ee4[_0xed2c('0x77')]['callerid'],_0x6c7ee4['dialOriginateCallerIdName'],_0x6c7ee4[_0xed2c('0x187')]>0x0?getCallerIdRandom(_0x6c7ee4[_0xed2c('0x188')],_0x6c7ee4[_0xed2c('0x187')]):_0x6c7ee4['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x6c7ee4[_0xed2c('0x13e')])?_0x6c7ee4[_0xed2c('0x77')][_0xed2c('0x79')]:_0x6c7ee4[_0xed2c('0x13e')][_0xed2c('0x79')],_0x6c7ee4['dialOriginateCallerIdName'],_0x6c7ee4[_0xed2c('0x187')]>0x0?getCallerIdRandom(_0x6c7ee4['dialOriginateCallerIdNumber'],_0x6c7ee4[_0xed2c('0x187')]):_0x6c7ee4[_0xed2c('0x188')]);if(_0x333d03){_0x2862ac[_0xed2c('0x189')]=_0x508d87[_0xed2c('0x23')][_0x908061][_0xed2c('0x18a')]=extractCalleridName(_0x333d03);_0x2862ac[_0xed2c('0x18b')]=_0x508d87['actions'][_0x908061][_0xed2c('0x18c')]=extractCalleridNumber(_0x333d03);}return ami['Action']({'actionid':_0x908061,'action':'originate','channel':_0x508d87[_0xed2c('0x13d')](_0x6c7ee4['Trunk'])?util[_0xed2c('0x7d')](_0xed2c('0x18d'),_0x6c7ee4[_0xed2c('0x77')]['name'],isNotNull(_0x6c7ee4['dialPrefix'])?_0x6c7ee4[_0xed2c('0x5c')][_0xed2c('0x18e')]()||'':'',_0x6c7ee4[_0xed2c('0x18f')]>0x0?_0x583bc1[_0xed2c('0x166')][_0xed2c('0x167')]['substring'](_0x6c7ee4[_0xed2c('0x18f')]):_0x583bc1[_0xed2c('0x166')][_0xed2c('0x167')]):util[_0xed2c('0x7d')]('SIP/%s/%s%s',_[_0xed2c('0xda')](_0x6c7ee4['TrunkBackup'])?_0x6c7ee4[_0xed2c('0x77')][_0xed2c('0x3e')]:_0x6c7ee4['TrunkBackup'][_0xed2c('0x3e')],isNotNull(_0x6c7ee4[_0xed2c('0x5c')])?_0x6c7ee4[_0xed2c('0x5c')]['trim']()||'':'',_0x6c7ee4['dialCutDigit']>0x0?_0x583bc1[_0xed2c('0x166')]['phone'][_0xed2c('0x190')](_0x6c7ee4[_0xed2c('0x18f')]):_0x583bc1[_0xed2c('0x166')][_0xed2c('0x167')]),'callerid':_0x333d03,'Exten':_0xed2c('0x171'),'Context':_0xed2c('0x191'),'Priority':'1','variable':_0x2862ac,'timeout':(_0x6c7ee4[_0xed2c('0x192')]||0x1e)*0x3e8,'async':!![],'channelid':_0x908061})['then'](function(_0x55be08){return _0x1416d0(_0x55be08);})[_0xed2c('0xb0')](function(_0x11d83a){_0x6c7ee4[_0xed2c('0x65')]+=0x1;var _0x1561aa=new History(_0x508d87[_0xed2c('0x23')][_0x908061]);logger[_0xed2c('0x99')](util[_0xed2c('0x7d')]('[originateError]:\x20%s',JSON[_0xed2c('0x47')](_0x11d83a)));_0x1561aa[_0xed2c('0xa8')]=0xe;_0x1561aa[_0xed2c('0xe8')]=_0xed2c('0x193');_0x1561aa['starttime']=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));_0x1561aa['endtime']=_0x1561aa[_0xed2c('0xa9')];_0x508d87[_0xed2c('0xc9')](_0x1561aa)[_0xed2c('0xb0')](loggerCatch('[originate][error]'));_0x508d87[_0xed2c('0xc7')](_0x1561aa)[_0xed2c('0xb0')](loggerCatch('[originate][error]'))[_0xed2c('0x1b')](function(){delete _0x508d87['actions'][_0x908061];return _0x4d140f(msgResponse(_0xed2c('0x168'),_0xed2c('0x46'),_0xed2c('0x194')));});});});};Dialer['prototype'][_0xed2c('0x195')]=function(_0x41ba78){var _0x3824b2=this[_0xed2c('0x23')][_0x41ba78[_0xed2c('0x124')]];if(_0x3824b2){delete this['actions'][_0x41ba78['actionid']];_0x3824b2[_0xed2c('0x115')]=moment()['format'](_0xed2c('0xfb'));var _0x147618=_0x3824b2[_0xed2c('0x4c')]===_0xed2c('0x7c')?this[_0xed2c('0x1f')][_0x3824b2[_0xed2c('0xb3')]]:this[_0xed2c('0x1e')][_0x3824b2[_0xed2c('0x196')]()];if(!this[_0xed2c('0x197')](_0x41ba78[_0xed2c('0x198')])){this['updateOriginated'](_0x147618);return this['callProgressDetecting'](_0x3824b2,_0x147618,_0x41ba78)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x199')));}this[_0xed2c('0x24')][_0x41ba78[_0xed2c('0xe7')]]=_0x3824b2;}};Dialer['prototype'][_0xed2c('0x19a')]=function(_0x5e8ac8,_0x106eff,_0x197696){var _0x55670f=new History(_0x106eff);if(_0x55670f[_0xed2c('0xee')]+_0x55670f[_0xed2c('0xef')]+_0x55670f['countnoanswerretry']+_0x55670f[_0xed2c('0xf1')]+_0x55670f[_0xed2c('0xf2')]+_0x55670f[_0xed2c('0xf3')]+_0x55670f[_0xed2c('0xeb')]+_0x55670f[_0xed2c('0xf4')]>=_0x197696[_0xed2c('0xf5')]-0x1){return!![];}switch(_0x5e8ac8){case 0x3:if(_0x55670f['countnoanswerretry']>=_0x197696[_0xed2c('0x19b')]-0x1){return!![];}this[_0xed2c('0xbe')]({'active':![],'countnoanswerretry':_0x55670f['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696['dialNoAnswerRetryFrequency'],_0xed2c('0xfa'))[_0xed2c('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f['VoiceQueueId']||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x19c')));break;case 0x5:if(_0x55670f[_0xed2c('0xee')]>=_0x197696['dialBusyMaxRetry']-0x1){return!![];}this[_0xed2c('0xbe')]({'active':![],'countbusyretry':_0x55670f[_0xed2c('0xee')]+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696[_0xed2c('0x19d')],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x19e')));break;case 0x8:if(_0x55670f[_0xed2c('0xef')]>=_0x197696[_0xed2c('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x55670f[_0xed2c('0xef')]+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696['dialCongestionRetryFrequency'],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f['ListId'],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x55670f[_0xed2c('0xf1')]>=_0x197696[_0xed2c('0x1a0')]-0x1){return!![];}else{this[_0xed2c('0xbe')]({'active':![],'countnosuchnumberretry':_0x55670f[_0xed2c('0xf1')]+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696[_0xed2c('0x1a1')],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f['ContactId'],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})['catch'](loggerCatch(_0xed2c('0x1a2')));}break;case 0xa:if(_0x55670f[_0xed2c('0xf2')]>=_0x197696[_0xed2c('0x11a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x55670f['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x197696['dialDropRetryFrequency'],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f['ContactId'],'ListId':_0x55670f['ListId'],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1a3')));break;case 0xb:if(_0x55670f[_0xed2c('0xf3')]>=_0x197696[_0xed2c('0x1a4')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x55670f[_0xed2c('0xf3')]+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696[_0xed2c('0x1a5')],'minutes')[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x122')));break;case 0x13:if(_0x55670f[_0xed2c('0xeb')]>=_0x197696[_0xed2c('0x102')]-0x1){return!![];}this[_0xed2c('0xbe')]({'active':![],'countmachineretry':_0x55670f['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x197696[_0xed2c('0xf9')],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xfe')));break;case 0x14:if(_0x55670f['countagentrejectretry']>=_0x197696[_0xed2c('0x1a6')]-0x1){return!![];}this[_0xed2c('0xbe')]({'active':![],'countagentrejectretry':_0x55670f[_0xed2c('0xf4')]+=0x1,'scheduledat':moment()[_0xed2c('0xf8')](_0x197696[_0xed2c('0x1a7')],_0xed2c('0xfa'))[_0xed2c('0x7d')](_0xed2c('0xfb')),'ContactId':_0x55670f[_0xed2c('0xfc')],'ListId':_0x55670f[_0xed2c('0xfd')],'VoiceQueueId':_0x55670f[_0xed2c('0xd1')]||undefined,'CampaignId':_0x55670f[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xed2c('0x19')][_0xed2c('0x1a8')]=function(_0x21e70c,_0x4a994e,_0x49c3ad){var _0xdeaa73=this;var _0x35f405=new History(_0x21e70c);return new BPromise(function(_0x1b1ace,_0x1e4570){if(_[_0xed2c('0x3c')](_0x4a994e)&&typeof _0x4a994e!=='object'){return _0x1e4570(msgResponse(_0xed2c('0x1a9'),'Failure',_0xed2c('0x1aa')));}if(_[_0xed2c('0x3c')](_0x49c3ad)&&typeof _0x49c3ad!==_0xed2c('0x164')){return _0x1e4570(msgResponse(_0xed2c('0x1a9'),_0xed2c('0x147'),_0xed2c('0x1ab')));}switch(_0x49c3ad[_0xed2c('0x10d')]){case'0':_0x4a994e[_0xed2c('0x64')]+=0x1;_0x35f405['state']=0x0;_0x35f405[_0xed2c('0xe8')]=_0xed2c('0x1ac');_0x35f405[_0xed2c('0xf1')]+=0x1;_0x35f405[_0xed2c('0xec')]+=0x1;ami[_0xed2c('0x4b')]('custom:agentnosuchnumber',ut[_0xed2c('0xe4')](_0x21e70c,_0xed2c('0x1ad')));_0xdeaa73[_0xed2c('0xc9')](_0x35f405)[_0xed2c('0xb0')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xdeaa73[_0xed2c('0x19a')](0x0,_0x21e70c,_0x4a994e)){if(_0x35f405[_0xed2c('0xf1')]>=_0x4a994e[_0xed2c('0x1a0')]){_0xdeaa73['createStateFinal'](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1ae'));}else{_0xdeaa73[_0xed2c('0x101')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1ae'));}}break;case'3':_0x4a994e[_0xed2c('0x63')]+=0x1;_0x35f405[_0xed2c('0xa8')]=0x3;_0x35f405['statedesc']=_0xed2c('0x1af');_0x35f405[_0xed2c('0xf0')]+=0x1;_0x35f405[_0xed2c('0xec')]+=0x1;ami[_0xed2c('0x4b')](_0xed2c('0x1b0'),ut[_0xed2c('0xe4')](_0x21e70c,'noanswer'));_0xdeaa73[_0xed2c('0xc9')](_0x35f405)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1b1')));if(_0xdeaa73[_0xed2c('0x19a')](0x3,_0x21e70c,_0x4a994e)){if(_0x35f405[_0xed2c('0xf0')]>=_0x4a994e[_0xed2c('0x19b')]){_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1b2'));}else{_0xdeaa73[_0xed2c('0x101')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1b2'));}}break;case'5':_0x4a994e['outboundBusyCallsDay']+=0x1;_0x35f405[_0xed2c('0xa8')]=0x5;_0x35f405[_0xed2c('0xe8')]=_0xed2c('0x1b3');_0x35f405['countbusyretry']+=0x1;_0x35f405['countglobal']+=0x1;ami['emit'](_0xed2c('0x1b4'),ut['buildObj'](_0x21e70c,_0xed2c('0x1b5')));_0xdeaa73[_0xed2c('0xc9')](_0x35f405)[_0xed2c('0xb0')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xdeaa73[_0xed2c('0x19a')](0x5,_0x21e70c,_0x4a994e)){if(_0x35f405[_0xed2c('0xee')]>=_0x4a994e[_0xed2c('0x1b6')]){_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1b7'));}else{_0xdeaa73['stateGlobal'](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1b7'));}}break;case'8':_0x4a994e['outboundCongestionCallsDay']+=0x1;_0x35f405[_0xed2c('0xa8')]=0x8;_0x35f405[_0xed2c('0xe8')]=_0xed2c('0x1b8');_0x35f405[_0xed2c('0xef')]+=0x1;_0x35f405['countglobal']+=0x1;ami['emit'](_0xed2c('0x1b9'),ut['buildObj'](_0x21e70c,'congestion'));_0xdeaa73[_0xed2c('0xc9')](_0x35f405)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1ba')));if(_0xdeaa73[_0xed2c('0x19a')](0x8,_0x21e70c,_0x4a994e)){if(_0x35f405['countcongestionretry']>=_0x4a994e[_0xed2c('0x19f')]){_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1bb'));}else{_0xdeaa73[_0xed2c('0x101')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1bb'));}}break;case'11':_0x4a994e[_0xed2c('0x1bc')]+=0x1;_0x35f405[_0xed2c('0xa8')]=0xb;_0x35f405['statedesc']=_0xed2c('0x120');_0x35f405[_0xed2c('0xf3')]+=0x1;_0x35f405[_0xed2c('0xec')]+=0x1;_0xdeaa73[_0xed2c('0xc9')](_0x35f405)[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x123')));if(_0xdeaa73[_0xed2c('0x19a')](0xb,_0x21e70c,_0x4a994e)){if(_0x35f405[_0xed2c('0xf3')]>=_0x4a994e[_0xed2c('0x1a4')]){_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1bd'));}else{_0xdeaa73['stateGlobal'](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1bd'));}}break;case'20':_0x4a994e[_0xed2c('0x67')]+=0x1;_0x35f405[_0xed2c('0xa8')]=0x14;_0x35f405['statedesc']=_0xed2c('0x1be');_0x35f405[_0xed2c('0xf4')]+=0x1;_0x35f405[_0xed2c('0xec')]+=0x1;ami[_0xed2c('0x4b')](_0xed2c('0x1bf'),ut[_0xed2c('0xe4')](_0x21e70c,_0xed2c('0x1c0')));_0xdeaa73['createHistory'](_0x35f405)['catch'](loggerCatch(_0xed2c('0x1c1')));if(_0xdeaa73[_0xed2c('0x19a')](0x14,_0x21e70c,_0x4a994e)){if(_0x35f405['countagentrejectretry']>=_0x4a994e['dialAgentRejectMaxRetry']){_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1c2'));}else{_0xdeaa73[_0xed2c('0x101')](_0x35f405,_0x1b1ace,_0x1e4570,_0xed2c('0x1c2'));}}break;default:_0x4a994e['outboundUnknownCallsDay']+=0x1;_0x35f405[_0xed2c('0xa8')]=0xc;_0x35f405[_0xed2c('0xe8')]=_0x49c3ad[_0xed2c('0x10d')];_0xdeaa73['createHistory'](_0x35f405)['catch'](loggerCatch(_0xed2c('0x1c3')));if(_0xdeaa73[_0xed2c('0x19a')](_0x49c3ad[_0xed2c('0x10d')],_0x21e70c,_0x4a994e)){if(_0x35f405[_0xed2c('0xee')]+_0x35f405[_0xed2c('0xef')]+_0x35f405[_0xed2c('0xf0')]+_0x35f405[_0xed2c('0xf1')]+_0x35f405[_0xed2c('0xf2')]+_0x35f405[_0xed2c('0xf3')]+_0x35f405[_0xed2c('0xeb')]+_0x35f405['countagentrejectretry']>=_0x4a994e[_0xed2c('0xf5')]){_0xdeaa73[_0xed2c('0x101')](_0x35f405,_0x1b1ace,_0x1e4570,_0x49c3ad[_0xed2c('0x10d')]);}else{_0xdeaa73[_0xed2c('0xf7')](_0x35f405,_0x1b1ace,_0x1e4570,_0x49c3ad[_0xed2c('0x10d')]);}}}});};Dialer[_0xed2c('0x19')][_0xed2c('0x101')]=function(_0x550db5,_0x1e000a,_0x58f355,_0x510120){var _0x383f21=new Final(_0x550db5);_0x383f21['state']=0xf;_0x383f21['statedesc']=_0xed2c('0x1c4');this['createStateFinal'](_0x383f21,_0x1e000a,_0x58f355,_0x510120);};Dialer[_0xed2c('0x19')][_0xed2c('0xf7')]=function(_0x432ad8,_0x3b72c3,_0x4897c8,_0x136ba8){this[_0xed2c('0xc7')](_0x432ad8)[_0xed2c('0xb5')](function(){return _0x3b72c3(msgResponse('[callProgressDetecting]','Success',_0x136ba8));})['catch'](function(){return _0x4897c8(msgResponse(_0xed2c('0x1c5'),_0xed2c('0x147'),_0xed2c('0x1c6')));});};Dialer[_0xed2c('0x19')][_0xed2c('0x8')]=function(_0x406ff5){var _0x115aa7=_0x406ff5['dialPredictiveOptimizationPercentage']/0x64;var _0x18126c=_0x406ff5[_0xed2c('0x62')]/(_0x406ff5['outboundDropCallsDayTimeout']+_0x406ff5[_0xed2c('0x5e')]);var _0x572145=Math[_0xed2c('0x1c7')](_0x406ff5['predictiveIntervalAvailable']*(_0x406ff5[_0xed2c('0x1c8')]/0x64));var _0x21d20e=Math['round'](_0x406ff5[_0xed2c('0x70')]*(_0x406ff5[_0xed2c('0x1c9')]/0x64));var _0x20c940=_0x406ff5[_0xed2c('0x4f')]+_0x406ff5[_0xed2c('0x55')];var _0x327737=Math[_0xed2c('0x1ca')](_0x406ff5[_0xed2c('0x73')]*_0x406ff5[_0xed2c('0x8e')]*_0x406ff5['predictiveIntervalHitRate']*_0x406ff5['predictiveIntervalMultiplicativeFactor']);if(_[_0xed2c('0x3c')](_0x406ff5[_0xed2c('0x26')])){if(!_[_0xed2c('0x3c')](_0x406ff5[_0xed2c('0x76')])){_0x406ff5[_0xed2c('0x76')]=undefined;loggerPredictive['error'](_0xed2c('0x1cb'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x406ff5[_0xed2c('0x93')])){loggerPredictive[_0xed2c('0x99')]('[startMethodPredictive][StartProgressive]',_0xed2c('0x1cc'));clearInterval(_0x406ff5[_0xed2c('0x93')]);_0x406ff5[_0xed2c('0x93')]=undefined;}_0x406ff5[_0xed2c('0x26')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));loggerPredictive['info'](_0x406ff5[_0xed2c('0x3e')],_0xed2c('0x1cd'),_0x406ff5['startProgressive']);this[_0xed2c('0x156')](_0x406ff5,0x1);}else if(ifInterval(_0x406ff5[_0xed2c('0x1ce')],_0x406ff5['startProgressive'])){this[_0xed2c('0x156')](_0x406ff5,0x1);loggerPredictiveCalls[_0xed2c('0x80')](_0xed2c('0x1cf'),_0x406ff5['startProgressive'],_0x406ff5['name']);_0x406ff5[_0xed2c('0x73')]=0x0;_0x406ff5['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x115aa7<_0x18126c&&_0x406ff5[_0xed2c('0x1d0')]==='dropRate'){freeVariablesPredictive(_0x406ff5);loggerPredictive['info'](_0xed2c('0x1d1'),_0xed2c('0x1d2'),_0x18126c,_0xed2c('0x26'),_0x406ff5[_0xed2c('0x3e')]);}else if(_0x327737<_0x406ff5['predictiveIntervalErlangCallsDroppedCalls']&&_0x406ff5['dialPredictiveOptimization']===_0xed2c('0x1d3')){freeVariablesPredictive(_0x406ff5);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x1d4'),_0xed2c('0x1d5'),_0x327737,_0xed2c('0x1d6'),_0x406ff5[_0xed2c('0x6e')],_0xed2c('0x26'),_0x406ff5[_0xed2c('0x3e')]);}else if(!ifInterval(_0x406ff5[_0xed2c('0x1ce')],_0x406ff5[_0xed2c('0x26')])&&_[_0xed2c('0x3c')](_0x406ff5['startPredictive'])&&!_[_0xed2c('0x3c')](_0x406ff5[_0xed2c('0x26')])){_0x406ff5[_0xed2c('0x76')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));loggerPredictive[_0xed2c('0x80')](_0x406ff5[_0xed2c('0x3e')],_0xed2c('0x1d7'),_0x406ff5[_0xed2c('0x76')]);this[_0xed2c('0x1d8')](_0x406ff5[_0xed2c('0x1ce')])[_0xed2c('0xb5')](this[_0xed2c('0x1d9')](_0x406ff5))['then'](mergeDataErlangB(_0x406ff5))['then'](this[_0xed2c('0x1da')](_0x406ff5))[_0xed2c('0xb0')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x406ff5));}else if(!ifInterval(_0x406ff5['dialPredictiveInterval'],_0x406ff5[_0xed2c('0x76')])){_0x406ff5[_0xed2c('0x6e')]=0x0;_0x406ff5[_0xed2c('0x76')]=moment()[_0xed2c('0x7d')](_0xed2c('0xfb'));loggerPredictive[_0xed2c('0x80')](_0x406ff5[_0xed2c('0x3e')],_0xed2c('0x1db'),_0x406ff5[_0xed2c('0x76')]);clearInterval(_0x406ff5[_0xed2c('0x93')]);_0x406ff5['handlePredictive']=undefined;this['averageHandleTime'](_0x406ff5[_0xed2c('0x1ce')])['then'](this['getDataPredictive'](_0x406ff5))[_0xed2c('0xb5')](mergeDataErlangB(_0x406ff5))['then'](this[_0xed2c('0x1da')](_0x406ff5))[_0xed2c('0xb0')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x406ff5));}else if(_0x406ff5[_0xed2c('0x70')]&&_0x20c940<_0x406ff5[_0xed2c('0x70')]-_0x21d20e){freeVariablesPredictive(_0x406ff5);loggerPredictive['info'](_0x406ff5[_0xed2c('0x3e')],_0xed2c('0x1dc'),_0x20c940,_0xed2c('0x1dd'),_0x406ff5[_0xed2c('0x70')],'-',_0x21d20e,'=',_0x406ff5[_0xed2c('0x70')]-_0x21d20e,')');}else if(_0x406ff5[_0xed2c('0x70')]&&_0x20c940>_0x406ff5['predictiveIntervalAvailable']+_0x572145){freeVariablesPredictive(_0x406ff5);loggerPredictive[_0xed2c('0x80')](_0x406ff5[_0xed2c('0x3e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x20c940,_0xed2c('0x1de'),_0x406ff5[_0xed2c('0x70')],'+',_0x572145,'=',_0x406ff5['predictiveIntervalAvailable']+_0x572145,')');}};Dialer[_0xed2c('0x19')]['getDataPredictive']=function(_0xb084d9){var _0x25df43=this;return function(_0x184355){return new BPromise(function(_0x4c40c2,_0x14e477){_[_0xed2c('0x90')](_0xb084d9,_0x184355[0x0]);if(checkGetDataPredictive(_0x184355[0x0])){var _0x55cd56=_0xb084d9[_0xed2c('0x70')]=_0xb084d9[_0xed2c('0x55')]+_0xb084d9[_0xed2c('0x4f')];var _0x3b2904=_0xb084d9[_0xed2c('0x1ce')]*0x3c;var _0x41c22a=_0x184355[0x0]['predictiveIntervalAvgTalktime']+_0x184355[0x0]['predictiveIntervalAvgHoldtime'];var _0x31ba2b=(_0x184355[0x0]['predictiveIntervalAnsweredCalls']+_0x184355[0x0][_0xed2c('0x6c')]+_0x184355[0x0][_0xed2c('0x6b')])/_0x184355[0x0][_0xed2c('0x71')];_0xb084d9[_0xed2c('0x6f')]=_0x31ba2b>0x0?_0x31ba2b:0x1;switch(_0xb084d9[_0xed2c('0x1d0')]){case _0xed2c('0x1d3'):var _0x11a4f0=_0xb084d9[_0xed2c('0x1df')]/0x64;return _0x25df43[_0xed2c('0x1e0')](_0x55cd56,_0x3b2904,_0x41c22a,_0x31ba2b,_0x11a4f0)[_0xed2c('0xb5')](function(_0x52d7a3){return _0x4c40c2(_0x52d7a3);});case _0xed2c('0x1e1'):var _0x7f39eb=_0xb084d9[_0xed2c('0x1df')]/0x64;return _0x25df43[_0xed2c('0x1e2')](_0x55cd56,_0x3b2904,_0x41c22a,_0x31ba2b,_0x7f39eb)[_0xed2c('0xb5')](function(_0xe69052){return _0x4c40c2(_0xe69052);});default:return _0x14e477(msgResponse(_0xed2c('0x1e3'),_0xed2c('0x147'),_0xed2c('0x1e4')));}}else{return _0x14e477(msgResponse('[getDataPredictive]',_0xed2c('0x147'),_0xed2c('0x1e5')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x54d356){var _0x18540f=this;return function(_0x2d26bf){return new BPromise(function(_0x4d5478,_0xf48abb){_[_0xed2c('0x90')](_0x54d356,_0x2d26bf[0x0]);if(checkGetDataPredictive(_0x2d26bf[0x0])){loggerPredictive[_0xed2c('0x80')](JSON['stringify'](_0x2d26bf[0x0]));if(_0x54d356['dialPredictiveOptimization']===_0xed2c('0x1d3')){return _0x18540f[_0xed2c('0xc5')](_0x54d356['id'])[_0xed2c('0xb5')](function(_0x5e8d55){var _0x2d7400=_0x54d356[_0xed2c('0x50')]-_0x5e8d55[0x0][_0xed2c('0x1e6')];var _0x2a33a7=_0x54d356[_0xed2c('0x1ce')]*0x3c;var _0x549766=_0x2d26bf[0x0][_0xed2c('0x6a')]+_0x2d26bf[0x0][_0xed2c('0x84')];var _0x5a375b=(_0x2d26bf[0x0][_0xed2c('0x69')]+_0x2d26bf[0x0][_0xed2c('0x6c')]+_0x2d26bf[0x0][_0xed2c('0x6b')])/_0x2d26bf[0x0]['predictiveIntervalTotalCalls'];var _0x111fba=_0x54d356[_0xed2c('0x1df')]/0x64;_0x54d356['predictiveIntervalPauses']=_0x5e8d55[0x0][_0xed2c('0x1e6')]||0x0;_0x54d356[_0xed2c('0x6f')]=_0x5a375b>0x0?_0x5a375b:0x1;return _0x18540f[_0xed2c('0x1e0')](_0x2d7400,_0x2a33a7,_0x549766,_0x5a375b,_0x111fba);})['then'](function(_0x5efc35){return _0x4d5478(_0x5efc35);})['catch'](function(_0x3c56a2){return _0xf48abb(msgResponse('[CatchErlangB]',_0xed2c('0x147'),JSON['stringify'](_0x3c56a2)));});}if(_0x54d356[_0xed2c('0x1d0')]===_0xed2c('0x1e1')){return _0x18540f[_0xed2c('0xc5')](_0x54d356['id'])['then'](function(_0x4c9074){var _0x166693=_0x54d356[_0xed2c('0x50')]-_0x4c9074[0x0][_0xed2c('0x1e6')];var _0x24cbe5=_0x54d356[_0xed2c('0x1ce')]*0x3c;var _0x5d61da=_0x2d26bf[0x0]['predictiveIntervalAvgTalktime']+_0x2d26bf[0x0][_0xed2c('0x84')];var _0x17ae35=(_0x2d26bf[0x0][_0xed2c('0x69')]+_0x2d26bf[0x0][_0xed2c('0x6c')]+_0x2d26bf[0x0][_0xed2c('0x6b')])/_0x2d26bf[0x0][_0xed2c('0x71')];var _0x5a1ea9=_0x54d356['dialPredictiveOptimizationPercentage']/0x64;_0x54d356['predictiveIntervalPauses']=_0x4c9074[0x0][_0xed2c('0x1e6')]||0x0;_0x54d356['predictiveIntervalHitRate']=_0x17ae35>0x0?_0x17ae35:0x1;return _0x18540f[_0xed2c('0x1e2')](_0x166693,_0x24cbe5,_0x5d61da,_0x17ae35,_0x5a1ea9);})[_0xed2c('0xb5')](function(_0x4fc7d0){return _0x4d5478(_0x4fc7d0);})[_0xed2c('0xb0')](function(_0x52b14){return _0xf48abb(msgResponse(_0xed2c('0x1e7'),_0xed2c('0x147'),JSON[_0xed2c('0x47')](_0x52b14)));});}}else{return _0xf48abb(msgResponse(_0xed2c('0x1e3'),_0xed2c('0x147'),'check\x20failure'));}});};};Dialer[_0xed2c('0x19')][_0xed2c('0x1da')]=function(_0x3b88a5){var _0x171223=this;return function(){var _0x25d874=0x0;var _0x1f63d7=Math[_0xed2c('0x1ca')](_0x3b88a5['erlangCallToSecond']*0x3e8);if(_0x1f63d7>0x0){_0x1f63d7=_0x1f63d7<0x64?0x64:_0x1f63d7;loggerPredictive[_0xed2c('0x80')](_0x3b88a5[_0xed2c('0x3e')],_0xed2c('0x1e8'),_0x1f63d7,_0xed2c('0x48'));_0x3b88a5['handlePredictive']=setInterval(function(){_0x171223['handlePredictive'](_0x3b88a5);loggerPredictiveCalls['info']('[handlePredictive]',_0x25d874+=0x1);},_0x1f63d7);}else{loggerPredictive[_0xed2c('0x80')](_0x3b88a5['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xed2c('0x1e9')]=function(_0x55bb17,_0x1bff05){var _0x21113d=this;return function(_0x1c13d2){if(_[_0xed2c('0x45')](_0x1c13d2)){if(_[_0xed2c('0xda')](_0x1bff05[_0xed2c('0xd0')])||!_0x1bff05[_0xed2c('0x1ea')]){if(_0x55bb17[_0xed2c('0x5a')]===_0xed2c('0x158')){_0x55bb17[_0xed2c('0x12b')]=_['isUndefined'](_0x55bb17[_0xed2c('0x12b')])?!![]:_0x55bb17[_0xed2c('0x12b')];var _0x7cdcb4=uuid['v4']();_0x21113d[_0xed2c('0x23')][_0x7cdcb4]=new Action(_0x55bb17,_0x1bff05,_0x7cdcb4);loggerBooked['info'](_0xed2c('0x1eb'),_0x7cdcb4,_0xed2c('0x1ec'),JSON[_0xed2c('0x47')](_0x55bb17[_0xed2c('0x12b')]),_0xed2c('0x1ed'),_0x55bb17[_0xed2c('0x3e')]);if(_0x55bb17[_0xed2c('0x12b')]){_0x55bb17[_0xed2c('0x12b')]=![];_0x21113d[_0xed2c('0x28')][_0x21113d['actions'][_0x7cdcb4][_0xed2c('0xb3')]]=[];ami[_0xed2c('0xad')]({'actionid':_0x7cdcb4,'action':_0xed2c('0x1ee'),'queue':_0x55bb17[_0xed2c('0x3e')]})[_0xed2c('0xb0')](function(){_0x21113d[_0xed2c('0xe0')](_0x55bb17);_0x21113d[_0xed2c('0xbe')]({'active':![],'ContactId':_0x21113d[_0xed2c('0x23')][_0x7cdcb4]['ContactId'],'ListId':_0x21113d['actions'][_0x7cdcb4][_0xed2c('0xfd')],'VoiceQueueId':_0x21113d[_0xed2c('0x23')][_0x7cdcb4][_0xed2c('0xd1')]||undefined,'CampaignId':_0x21113d[_0xed2c('0x23')][_0x7cdcb4][_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1ef')));delete _0x21113d[_0xed2c('0x23')][_0x7cdcb4];});}else{loggerBooked['info'](_0xed2c('0x1f0'),JSON['stringify'](_0x55bb17[_0xed2c('0x12b')]),_0xed2c('0x1ed'),_0x55bb17['name']);_0x21113d[_0xed2c('0xe0')](_0x55bb17);_0x21113d[_0xed2c('0xbe')]({'active':![],'ContactId':_0x21113d['actions'][_0x7cdcb4]['ContactId'],'ListId':_0x21113d['actions'][_0x7cdcb4][_0xed2c('0xfd')],'VoiceQueueId':_0x21113d[_0xed2c('0x23')][_0x7cdcb4][_0xed2c('0xd1')]||undefined,'CampaignId':_0x21113d[_0xed2c('0x23')][_0x7cdcb4][_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1ef')));delete _0x21113d[_0xed2c('0x23')][_0x7cdcb4];}}else{return _0x21113d[_0xed2c('0x163')](_0x55bb17,_0x1bff05);}}else{if(getDiff(_0x1bff05[_0xed2c('0x1f1')])<_0x55bb17['dialRecallMeTimeout']*0x3c){if(_0x1bff05['Agent']&&!_0x1bff05[_0xed2c('0x1f2')][_0xed2c('0x1f3')]){_0x21113d[_0xed2c('0x1d')][_0xed2c('0x12e')](_0x1bff05['id'])['finally'](function(){_0x21113d[_0xed2c('0xe0')](_0x55bb17);});}else{_0x21113d[_0xed2c('0xc0')]({'active':![]},_0x1bff05['id'],0x1)[_0xed2c('0x1b')](function(){_0x21113d['updateOriginated'](_0x55bb17);});}}else{_0x55bb17[_0xed2c('0x66')]+=0x1;_0x21113d[_0xed2c('0xe0')](_0x55bb17);if(_0x55bb17[_0xed2c('0x1f4')]){_0x21113d[_0xed2c('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1bff05[_0xed2c('0xfc')],'ListId':_0x1bff05[_0xed2c('0xfd')],'VoiceQueueId':_0x1bff05[_0xed2c('0xd1')]||undefined,'CampaignId':_0x1bff05[_0xed2c('0xd2')]||undefined})[_0xed2c('0xb0')](loggerCatch(_0xed2c('0x1f5')));_0x21113d['createHistory'](createObjHistory(_0x55bb17,_0x1bff05,_0xed2c('0x1f6'),0x17,_0xed2c('0x1f7')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x21113d[_0xed2c('0xce')](createObjHistory(_0x55bb17,_0x1bff05,'RECALLFAILEDTIMEOUT',0x16,_0xed2c('0x1f8')),_0xed2c('0x1f9'),'[Originate][HistoryRecallClose]');}}}}else{_0x55bb17[_0xed2c('0x5f')]+=0x1;_0x21113d[_0xed2c('0xce')](createObjHistory(_0x55bb17,_0x1bff05,_0xed2c('0x1fa'),0xd,_0xed2c('0x1fb')),_0xed2c('0x1fc'),_0xed2c('0x1fd'));throw _0xed2c('0x1fe');}};};Dialer[_0xed2c('0x19')][_0xed2c('0x1ff')]=function(_0x279a51){var _0x93cd70=this;var _0xb8b0d1=_0x279a51[_0xed2c('0x200')]-_0x279a51[_0xed2c('0x72')]-_0x279a51[_0xed2c('0xc2')];emitCampaignSummary(_0x279a51);if(_0xb8b0d1>0x0){if(_0xb8b0d1>this[_0xed2c('0x22')]){_0xb8b0d1=this[_0xed2c('0x22')];}_0x279a51[_0xed2c('0xc2')]+=_0xb8b0d1;this[_0xed2c('0xc4')](_0x279a51['id'],_0xb8b0d1,_0x279a51[_0xed2c('0x201')],_0x279a51)[_0xed2c('0xb5')](function(_0x18ee0a){_0x279a51[_0xed2c('0xc2')]-=_0xb8b0d1;_0x279a51[_0xed2c('0xc2')]=_0x279a51['temp']>0x0?_0x279a51[_0xed2c('0xc2')]:0x0;if(!checkContactEmpty(_0x18ee0a)){_0x279a51[_0xed2c('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xed2c('0x80')]('[getContactCampaign2][Empty]'+_0x279a51['name']);}else{_0x279a51[_0xed2c('0x72')]+=_0x18ee0a['length'];_0x279a51[_0xed2c('0x3d')]=_0xed2c('0x202');for(var _0x196789=0x0;_0x196789<_0x18ee0a[_0xed2c('0x132')];_0x196789+=0x1){_0x279a51[_0xed2c('0x203')]+=0x1;if(_[_0xed2c('0xda')](_0x18ee0a[_0x196789])||_[_0xed2c('0xda')](_0x18ee0a[_0x196789][_0xed2c('0x166')])||_[_0xed2c('0xda')](_0x18ee0a[_0x196789][_0xed2c('0x166')]['phone'])){_0x93cd70['emptyContact'](_0xed2c('0x204'),_0x279a51,_0x18ee0a[_0x196789]);}else{_0x93cd70[_0xed2c('0xba')](_[_0xed2c('0xcf')](_0x18ee0a[_0x196789],['CampaignId',_0xed2c('0x205')]))[_0xed2c('0xb5')](_0x93cd70[_0xed2c('0x1e9')](_0x279a51,_0x18ee0a[_0x196789]))['catch'](_0x93cd70[_0xed2c('0x206')](_0xed2c('0x207'),_0x279a51));}}}})[_0xed2c('0xb0')](loggerGetContactDialer(_0xed2c('0x208'),_0x279a51,_0xb8b0d1));}};Dialer[_0xed2c('0x19')][_0xed2c('0x156')]=function(_0x3c5383,_0x5e78e0){var _0x59fdc0=this;var _0x1ca247=[];var _0x5848d8=_0x5e78e0>=0x1?_0x5e78e0:0x1;if(_0x3c5383[_0xed2c('0x5a')]===_0xed2c('0x158')){_0x5848d8=0x1;}var _0x4db7b6=Math[_0xed2c('0x1ca')](_0x3c5383['available']*_0x5848d8)-_0x3c5383[_0xed2c('0x72')]-_0x3c5383['temp'];emitVoiceQueueSummary(_0x3c5383);if(_0x3c5383[_0xed2c('0x209')]>0x0){var _0x4bc530=_0x3c5383[_0xed2c('0x209')]-_0x3c5383['originated']-_0x3c5383[_0xed2c('0x55')]-_0x3c5383[_0xed2c('0xc2')]-_0x3c5383['pTalking'];if(_0x4db7b6>_0x4bc530){_0x4db7b6=_0x4bc530;}}if(_0x4db7b6>0x0){if(_0x3c5383[_0xed2c('0x5a')]===_0xed2c('0x158')){_0x4db7b6=0x1;}if(_0x4db7b6>this[_0xed2c('0x22')]){_0x4db7b6=this['maxNumberOriginate'];}_0x3c5383[_0xed2c('0xc2')]+=_0x4db7b6;for(var _0xa17063 in this[_0xed2c('0x20')]){if(typeof this[_0xed2c('0x20')][_0xa17063]!=='undefined'){if(this['agents'][_0xa17063]['state']===_0xed2c('0x20a')&&this[_0xed2c('0x20')][_0xa17063][_0xed2c('0xae')]===_0xed2c('0xd6')){_0x1ca247[_0xed2c('0x128')](this[_0xed2c('0x20')][_0xa17063]['id']);}}}this['getContactDialer'](_0x3c5383['id'],_0x1ca247,_0x4db7b6,_0x3c5383[_0xed2c('0x201')],_0x3c5383)[_0xed2c('0xb5')](function(_0x14c060){_0x3c5383['temp']-=_0x4db7b6;_0x3c5383[_0xed2c('0xc2')]=_0x3c5383[_0xed2c('0xc2')]>0x0?_0x3c5383['temp']:0x0;if(!checkContactEmpty(_0x14c060)){_0x59fdc0[_0xed2c('0x20b')](_0x3c5383)[_0xed2c('0xb5')](sendMessageReschedule(_0x3c5383))['catch'](loggerCatch(_0xed2c('0xb6')));}else{_0x3c5383[_0xed2c('0x72')]+=_0x14c060[_0xed2c('0x132')];_0x3c5383[_0xed2c('0x3d')]=_0x3c5383[_0xed2c('0x5a')]===_0xed2c('0x158')?'ACTIVE':_0xed2c('0x202');for(var _0x1278a2=0x0;_0x1278a2<_0x14c060[_0xed2c('0x132')];_0x1278a2+=0x1){if(_[_0xed2c('0xda')](_0x14c060[_0x1278a2])||_[_0xed2c('0xda')](_0x14c060[_0x1278a2][_0xed2c('0x166')])||_[_0xed2c('0xda')](_0x14c060[_0x1278a2][_0xed2c('0x166')][_0xed2c('0x167')])){_0x59fdc0['emptyContact'](_0xed2c('0x204'),_0x3c5383,_0x14c060[_0x1278a2]);}else{_0x59fdc0[_0xed2c('0xb7')](_[_0xed2c('0xcf')](_0x14c060[_0x1278a2],[_0xed2c('0xd1'),_0xed2c('0x205')]))[_0xed2c('0xb5')](_0x59fdc0[_0xed2c('0x1e9')](_0x3c5383,_0x14c060[_0x1278a2]))['catch'](_0x59fdc0[_0xed2c('0x206')](_0xed2c('0x204'),_0x3c5383));}}}})['catch'](loggerGetContactDialer(_0xed2c('0x20c'),_0x3c5383,_0x4db7b6));}};Dialer[_0xed2c('0x19')][_0xed2c('0x93')]=function(_0x2d611d){if(_0x2d611d[_0xed2c('0x209')]>0x0){var _0x1deaad=_0x2d611d[_0xed2c('0x209')]-_0x2d611d[_0xed2c('0x72')]-_0x2d611d[_0xed2c('0x55')];if(_0x1deaad>0x0){this[_0xed2c('0x20d')](_0x2d611d);}else{loggerPredictiveCalls[_0xed2c('0x80')](_0xed2c('0x20e'));}}else{this[_0xed2c('0x20d')](_0x2d611d);}};Dialer[_0xed2c('0x19')][_0xed2c('0x20d')]=function(_0x5c29ff){var _0x1cc3ee=this;var _0x2bfc14=[];_0x5c29ff[_0xed2c('0x72')]+=0x1;for(var _0x337616 in this[_0xed2c('0x20')]){if(typeof this[_0xed2c('0x20')][_0x337616]!=='undefined'){if(this['agents'][_0x337616]['state']===_0xed2c('0x20a')&&this[_0xed2c('0x20')][_0x337616][_0xed2c('0xae')]===_0xed2c('0xd6')){_0x2bfc14[_0xed2c('0x128')](this[_0xed2c('0x20')][_0x337616]['id']);}}}this[_0xed2c('0xc1')](_0x5c29ff['id'],_0x2bfc14,0x1,_0x5c29ff['dialOrderByScheduledAt'],_0x5c29ff)['then'](function(_0x355bcb){if(!checkContactEmpty(_0x355bcb)){checkContactLowerLimitOriginate(_0x5c29ff,0x1,0x0);_0x1cc3ee[_0xed2c('0x20b')](_0x5c29ff)[_0xed2c('0xb5')](sendMessageReschedule(_0x5c29ff))[_0xed2c('0xb0')](loggerCatch(_0xed2c('0xb6')));}else{_0x5c29ff['message']=_0xed2c('0x202');if(_[_0xed2c('0xda')](_0x355bcb[0x0])||_[_0xed2c('0xda')](_0x355bcb[0x0][_0xed2c('0x166')])||_[_0xed2c('0xda')](_0x355bcb[0x0][_0xed2c('0x166')][_0xed2c('0x167')])){_0x1cc3ee['emptyContact'](_0xed2c('0x204'),_0x5c29ff,_0x355bcb[0x0]);}else{_0x1cc3ee['checkIsBlackList'](_['pick'](_0x355bcb[0x0],['VoiceQueueId',_0xed2c('0x205')]))[_0xed2c('0xb5')](_0x1cc3ee[_0xed2c('0x1e9')](_0x5c29ff,_0x355bcb[0x0]))[_0xed2c('0xb0')](_0x1cc3ee[_0xed2c('0x206')](_0xed2c('0x20f'),_0x5c29ff));}}})['catch'](loggerGetContactDialer(_0xed2c('0x210'),_0x5c29ff,0x1));emitVoiceQueueSummary(_0x5c29ff);};Dialer[_0xed2c('0x19')]['abandonmentRate']=function(_0x292a79,_0x2842a0,_0x15e055,_0x3e983c,_0x59e6c7,_0x459d99){loggerPredictive[_0xed2c('0x80')](_0xed2c('0x211'));loggerPredictive[_0xed2c('0x80')](_0xed2c('0x212'),_0x292a79);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x213'),_0x2842a0);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x214'),_0x15e055);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x215'),_0x3e983c);loggerPredictive['info'](_0xed2c('0x216'),_0x59e6c7);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x86'));return new BPromise(function(_0x3341f7,_0x5f564e){if(_0x292a79<=0x0||isNaN(_0x292a79)){return _0x5f564e(msgResponse('[abandonmentRate]',_0xed2c('0x46'),_0xed2c('0x217')+_0x292a79));}if(_0x15e055<=0x0||isNaN(_0x15e055)){return _0x5f564e(msgResponse(_0xed2c('0x218'),_0xed2c('0x46'),_0xed2c('0x219')+_0x15e055));}if(_0x3e983c<=0x0||isNaN(_0x3e983c)){return _0x5f564e(msgResponse(_0xed2c('0x218'),_0xed2c('0x46'),_0xed2c('0x21a')+_0x3e983c));}if(_0x2842a0<=0x0||isNaN(_0x2842a0)){return _0x5f564e(msgResponse(_0xed2c('0x218'),_0xed2c('0x46'),_0xed2c('0x21b')+_0x2842a0));}if(_0x59e6c7<=0x0||isNaN(_0x59e6c7)){return _0x5f564e(msgResponse(_0xed2c('0x218'),_0xed2c('0x46'),_0xed2c('0x21c')+_0x59e6c7));}_0x459d99=_0x459d99||0x0;var _0x2da9c6=0x1/_0x15e055;var _0x223925=0x0;var _0x413432=0x0;var _0x422622=0x0;var _0x237458=0x0;for(var _0x958383=0x0;_0x422622<_0x59e6c7;_0x958383+=0x1){_0x413432=_0x958383/_0x2842a0;_0x223925=(_0x3e983c*_0x413432+_0x459d99)/_0x2da9c6;_0x422622=erlangb(_0x223925,_0x292a79);_0x237458=_0x223925/_0x292a79*(0x1-erlangb(_0x223925,_0x292a79));}return _0x3341f7({'erlangCalls':_0x958383,'erlangCallToSecond':_0x2842a0/_0x958383,'erlangAbandonmentRate':_0x422622,'erlangBusyFactor':_0x237458});});};Dialer[_0xed2c('0x19')][_0xed2c('0x1e2')]=function(_0x5de9bd,_0x36b760,_0xd567c,_0x5b2263,_0x436332,_0x205716){loggerPredictive[_0xed2c('0x80')](_0xed2c('0x21d'));loggerPredictive[_0xed2c('0x80')](_0xed2c('0x212'),_0x5de9bd);loggerPredictive[_0xed2c('0x80')](_0xed2c('0x213'),_0x36b760);loggerPredictive[_0xed2c('0x80')]('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',_0xd567c);loggerPredictive[_0xed2c('0x80')]('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',_0x5b2263);loggerPredictive['info'](_0xed2c('0x21e'),_0x436332);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x9a0711,_0x247fee){if(_0x5de9bd<=0x0||isNaN(_0x5de9bd)){return _0x247fee(msgResponse(_0xed2c('0x21f'),'Error',_0xed2c('0x217')+_0x5de9bd));}if(_0xd567c<=0x0||isNaN(_0xd567c)){return _0x247fee(msgResponse(_0xed2c('0x21f'),'Error',_0xed2c('0x219')+_0xd567c));}if(_0x5b2263<=0x0||isNaN(_0x5b2263)){return _0x247fee(msgResponse(_0xed2c('0x21f'),'Error',_0xed2c('0x21a')+_0x5b2263));}if(_0x36b760<=0x0||isNaN(_0x36b760)){return _0x247fee(msgResponse(_0xed2c('0x21f'),_0xed2c('0x46'),_0xed2c('0x21b')+_0x36b760));}if(_0x436332<=0x0||isNaN(_0x436332)){return _0x247fee(msgResponse(_0xed2c('0x21f'),_0xed2c('0x46'),'Umin\x20=\x20'+_0x436332));}_0x205716=_0x205716||0x0;var _0x4e1074=0x1/_0xd567c;var _0x1ec3ef=0x0;var _0x5134e9=0x0;var _0x5a3425=0x0;var _0x58db8f=0x0;for(var _0x23772f=0x0;_0x58db8f<_0x436332;_0x23772f+=0x1){_0x5134e9=_0x23772f/_0x36b760;_0x1ec3ef=(_0x5b2263*_0x5134e9+_0x205716)/_0x4e1074;_0x5a3425=erlangb(_0x1ec3ef,_0x5de9bd);_0x58db8f=_0x1ec3ef/_0x5de9bd*(0x1-erlangb(_0x1ec3ef,_0x5de9bd));}return _0x9a0711({'erlangCalls':_0x23772f,'erlangCallToSecond':_0x36b760/_0x23772f,'erlangAbandonmentRate':_0x5a3425,'erlangBusyFactor':_0x58db8f});});};module[_0xed2c('0x220')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 88964e9..d19a409 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 _0xa434=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound'];(function(_0x2a8da9,_0x1ba292){var _0x22b8b2=function(_0x1b347b){while(--_0x1b347b){_0x2a8da9['push'](_0x2a8da9['shift']());}};_0x22b8b2(++_0x1ba292);}(_0xa434,0x1af));var _0x4a43=function(_0x448422,_0x362248){_0x448422=_0x448422-0x0;var _0xcc0afd=_0xa434[_0x448422];return _0xcc0afd;};'use strict';var util=require(_0x4a43('0x0'));var _=require(_0x4a43('0x1'));var moment=require(_0x4a43('0x2'));function getSeconds(_0x3877c9,_0x58b931){var _0x8838ff=moment(_0x3877c9)['milliseconds'](0x0);var _0x201933=moment(_0x58b931)[_0x4a43('0x3')](0x0);return _0x8838ff[_0x4a43('0x4')](_0x201933,'seconds');}function QueueCallerAbandon(_0x13c99a,_0x40abdc){this['scheduledat']=_0x13c99a[_0x4a43('0x5')];this[_0x4a43('0x6')]=_0x13c99a[_0x4a43('0x6')];this[_0x4a43('0x7')]=_0x13c99a['type']===_0x4a43('0x8')?_0x4a43('0x9'):_0x13c99a[_0x4a43('0x6')];this[_0x4a43('0xa')]=_0x13c99a[_0x4a43('0xa')];this[_0x4a43('0xb')]=_0x13c99a['countcongestionretry'];this[_0x4a43('0xc')]=_0x13c99a[_0x4a43('0xc')];this['countglobal']=_0x13c99a[_0x4a43('0xa')]+_0x13c99a[_0x4a43('0xb')]+_0x13c99a[_0x4a43('0xc')]+_0x13c99a[_0x4a43('0xd')]+_0x13c99a[_0x4a43('0xe')]+_0x13c99a[_0x4a43('0xf')]+_0x13c99a[_0x4a43('0x10')]+_0x13c99a['countagentrejectretry'];this[_0x4a43('0xd')]=_0x13c99a[_0x4a43('0xd')];this[_0x4a43('0xe')]=_0x13c99a[_0x4a43('0xe')];this[_0x4a43('0xf')]=_0x13c99a[_0x4a43('0xf')];this[_0x4a43('0x10')]=_0x13c99a[_0x4a43('0x10')];this[_0x4a43('0x11')]=_0x13c99a['countagentrejectretry'];this[_0x4a43('0x12')]=_0x40abdc[_0x4a43('0x12')];this[_0x4a43('0x13')]=_0x13c99a[_0x4a43('0x14')];this[_0x4a43('0x15')]=_0x13c99a['number'];this[_0x4a43('0x16')]=_0x13c99a[_0x4a43('0x16')];this[_0x4a43('0x17')]=_0x13c99a['responsetime'];this[_0x4a43('0x18')]=_0x13c99a[_0x4a43('0x18')];this['endtime']=this[_0x4a43('0x18')];this['ringtime']=getSeconds(_0x13c99a[_0x4a43('0x17')],_0x13c99a[_0x4a43('0x16')]);this['holdtime']=getSeconds(this[_0x4a43('0x18')],_0x13c99a[_0x4a43('0x17')]);this[_0x4a43('0x19')]=0x0;this['queue']=_0x40abdc[_0x4a43('0x9')];this['membername']=_0x40abdc[_0x4a43('0x1a')];this[_0x4a43('0x1b')]=_0x40abdc[_0x4a43('0x1b')];this[_0x4a43('0x1c')]=_0x13c99a[_0x4a43('0x1c')];this[_0x4a43('0x1d')]=_0x13c99a[_0x4a43('0x1d')];this[_0x4a43('0x1e')]=_0x13c99a[_0x4a43('0x1e')];this['recallme']=_0x13c99a[_0x4a43('0x1f')];this[_0x4a43('0x20')]=_0x13c99a[_0x4a43('0x20')];this[_0x4a43('0x21')]=_0x13c99a['ListId'];this[_0x4a43('0x22')]=_0x13c99a['UserId'];this[_0x4a43('0x23')]=_0x13c99a[_0x4a43('0x23')];this[_0x4a43('0x24')]=_0x13c99a[_0x4a43('0x24')];this[_0x4a43('0x25')]=_0x13c99a[_0x4a43('0x25')]||'';this[_0x4a43('0x26')]=_0x13c99a[_0x4a43('0x26')]||'';}module[_0x4a43('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0xa82a=['name','responsetime','droptime','endtime','ringtime','starttime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname'];(function(_0x4ab0b4,_0x3fca2b){var _0x2c6179=function(_0x2d2f70){while(--_0x2d2f70){_0x4ab0b4['push'](_0x4ab0b4['shift']());}};_0x2c6179(++_0x3fca2b);}(_0xa82a,0x8d));var _0xaa82=function(_0x368448,_0x32ab72){_0x368448=_0x368448-0x0;var _0x128fe2=_0xa82a[_0x368448];return _0x128fe2;};'use strict';var util=require(_0xaa82('0x0'));var _=require('lodash');var moment=require(_0xaa82('0x1'));function getSeconds(_0x5905f5,_0x261151){var _0x413a1f=moment(_0x5905f5)[_0xaa82('0x2')](0x0);var _0x3bb623=moment(_0x261151)[_0xaa82('0x2')](0x0);return _0x413a1f['diff'](_0x3bb623,_0xaa82('0x3'));}function QueueCallerAbandon(_0xadeefc,_0x226fc7){this['scheduledat']=_0xadeefc[_0xaa82('0x4')];this[_0xaa82('0x5')]=_0xadeefc['type'];this[_0xaa82('0x6')]=_0xadeefc[_0xaa82('0x5')]==='outbound'?_0xaa82('0x7'):_0xadeefc[_0xaa82('0x5')];this[_0xaa82('0x8')]=_0xadeefc[_0xaa82('0x8')];this['countcongestionretry']=_0xadeefc[_0xaa82('0x9')];this[_0xaa82('0xa')]=_0xadeefc[_0xaa82('0xa')];this[_0xaa82('0xb')]=_0xadeefc['countbusyretry']+_0xadeefc[_0xaa82('0x9')]+_0xadeefc[_0xaa82('0xa')]+_0xadeefc[_0xaa82('0xc')]+_0xadeefc[_0xaa82('0xd')]+_0xadeefc[_0xaa82('0xe')]+_0xadeefc['countmachineretry']+_0xadeefc[_0xaa82('0xf')];this[_0xaa82('0xc')]=_0xadeefc[_0xaa82('0xc')];this[_0xaa82('0xd')]=_0xadeefc[_0xaa82('0xd')];this[_0xaa82('0xe')]=_0xadeefc[_0xaa82('0xe')];this[_0xaa82('0x10')]=_0xadeefc[_0xaa82('0x10')];this['countagentrejectretry']=_0xadeefc[_0xaa82('0xf')];this[_0xaa82('0x11')]=_0x226fc7[_0xaa82('0x11')];this[_0xaa82('0x12')]=_0xadeefc[_0xaa82('0x13')];this['calleridnum']=_0xadeefc['number'];this['starttime']=_0xadeefc['starttime'];this['responsetime']=_0xadeefc[_0xaa82('0x14')];this[_0xaa82('0x15')]=_0xadeefc['droptime'];this[_0xaa82('0x16')]=this[_0xaa82('0x15')];this[_0xaa82('0x17')]=getSeconds(_0xadeefc[_0xaa82('0x14')],_0xadeefc[_0xaa82('0x18')]);this[_0xaa82('0x19')]=getSeconds(this[_0xaa82('0x15')],_0xadeefc[_0xaa82('0x14')]);this['talktime']=0x0;this['queue']=_0x226fc7[_0xaa82('0x7')];this[_0xaa82('0x1a')]=_0x226fc7[_0xaa82('0x1b')];this[_0xaa82('0x1c')]=_0x226fc7[_0xaa82('0x1c')];this[_0xaa82('0x1d')]=_0xadeefc['callback'];this[_0xaa82('0x1e')]=_0xadeefc['callbackuniqueid'];this['callbackat']=_0xadeefc[_0xaa82('0x1f')];this[_0xaa82('0x20')]=_0xadeefc[_0xaa82('0x20')];this['ContactId']=_0xadeefc['ContactId'];this['ListId']=_0xadeefc[_0xaa82('0x21')];this['UserId']=_0xadeefc[_0xaa82('0x22')];this[_0xaa82('0x23')]=_0xadeefc[_0xaa82('0x23')];this[_0xaa82('0x24')]=_0xadeefc['CampaignId'];this[_0xaa82('0x25')]=_0xadeefc['originatecalleridnum']||'';this[_0xaa82('0x26')]=_0xadeefc['originatecalleridname']||'';}module[_0xaa82('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 8ae4cbb..478ee01 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x1690bb,_0x1da427){var _0xe52b9c=function(_0x501e20){while(--_0x501e20){_0x1690bb['push'](_0x1690bb['shift']());}};_0xe52b9c(++_0x1da427);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x46174b,_0x1e65fc){var _0x428da6=function(_0x1276a7){while(--_0x1276a7){_0x46174b['push'](_0x46174b['shift']());}};_0x428da6(++_0x1e65fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 1e9be8d..9703c7d 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 _0xa4d4=['application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','response','reason','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxstatus','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','message','Fax\x20failed','checkAfterSend','checkTrunk','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','execute','dir','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newexten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','syncNewState','channelstate','channelstatedesc','syncNewExten','hasOwnProperty','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf'];(function(_0xe57508,_0x3478c1){var _0x96a18f=function(_0x4a4dad){while(--_0x4a4dad){_0xe57508['push'](_0xe57508['shift']());}};_0x96a18f(++_0x3478c1);}(_0xa4d4,0x12f));var _0x4a4d=function(_0x52f20f,_0x159520){_0x52f20f=_0x52f20f-0x0;var _0x2d1dda=_0xa4d4[_0x52f20f];return _0x2d1dda;};'use strict';var util=require(_0x4a4d('0x0'));var _=require(_0x4a4d('0x1'));var BPromise=require(_0x4a4d('0x2'));var uuid=require(_0x4a4d('0x3'));var moment=require(_0x4a4d('0x4'));var path=require(_0x4a4d('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4a4d('0x6'));var logger=require(_0x4a4d('0x7'))(_0x4a4d('0x8'));var ami=require(_0x4a4d('0x9'));var rpcDb=require(_0x4a4d('0xa'));var Channel=require(_0x4a4d('0xb'));var ut=require(_0x4a4d('0xc'));var Action=require(_0x4a4d('0xd'));var faxAccount=require(_0x4a4d('0xe'));var attachment=require(_0x4a4d('0xf'));var faxMessage=require(_0x4a4d('0x10'));function Fax(_0x431686){this[_0x4a4d('0x11')]={};this[_0x4a4d('0x12')]=_0x431686[_0x4a4d('0x12')];this[_0x4a4d('0x13')]=_0x431686[_0x4a4d('0x13')];this[_0x4a4d('0x14')]={};ami['on'](_0x4a4d('0x15'),this[_0x4a4d('0x16')][_0x4a4d('0x17')](this));ami['on'](_0x4a4d('0x18'),this['syncVarSet']['bind'](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0x4a4d('0x19'),this['syncNewExten'][_0x4a4d('0x17')](this));ami['on']('faxstatus',this[_0x4a4d('0x1a')]['bind'](this));ami['on'](_0x4a4d('0x1b'),this[_0x4a4d('0x1c')][_0x4a4d('0x17')](this));ami['on'](_0x4a4d('0x1d'),this['syncHangup'][_0x4a4d('0x17')](this));ami['on'](_0x4a4d('0x1e'),this[_0x4a4d('0x1f')][_0x4a4d('0x17')](this));}Fax[_0x4a4d('0x20')][_0x4a4d('0x16')]=function(_0x1302c9){if(_0x1302c9[_0x4a4d('0x21')]===_0x4a4d('0x22')){for(var _0x51d9e5 in this[_0x4a4d('0x12')]){if(this[_0x4a4d('0x12')]['hasOwnProperty'](_0x51d9e5)){if(_0x1302c9[_0x4a4d('0x23')]===this[_0x4a4d('0x12')][_0x51d9e5][_0x4a4d('0x24')]){this[_0x4a4d('0x11')][_0x1302c9[_0x4a4d('0x25')]]={};this[_0x4a4d('0x11')][_0x1302c9['uniqueid']][_0x4a4d('0x26')]=_0x1302c9[_0x4a4d('0x26')];this[_0x4a4d('0x11')][_0x1302c9[_0x4a4d('0x25')]]['id']=this[_0x4a4d('0x12')][_0x51d9e5]['id'];this[_0x4a4d('0x11')][_0x1302c9[_0x4a4d('0x25')]][_0x4a4d('0x27')]=this[_0x4a4d('0x12')][_0x51d9e5][_0x4a4d('0x27')];logger[_0x4a4d('0x28')](_0x1302c9[_0x4a4d('0x25')],_0x4a4d('0x29'));}}}}if(this[_0x4a4d('0x14')][_0x1302c9[_0x4a4d('0x25')]]){this[_0x4a4d('0x11')][_0x1302c9['uniqueid']]={};this[_0x4a4d('0x11')][_0x1302c9[_0x4a4d('0x25')]][_0x4a4d('0x26')]=_0x1302c9[_0x4a4d('0x26')];logger[_0x4a4d('0x28')](_0x1302c9['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x4a4d('0x20')][_0x4a4d('0x2a')]=function(_0x278b49){if(this[_0x4a4d('0x11')][_0x278b49[_0x4a4d('0x25')]]){for(var _0x18d535 in _0x278b49['variable']){if(_0x278b49[_0x4a4d('0x2b')]['hasOwnProperty'](_0x18d535)){this['channels'][_0x278b49['uniqueid']][_0x18d535]=_0x278b49[_0x4a4d('0x2c')];}}}};Fax[_0x4a4d('0x20')][_0x4a4d('0x2d')]=function(_0x2e3794){if(this[_0x4a4d('0x11')][_0x2e3794[_0x4a4d('0x25')]]){this[_0x4a4d('0x11')][_0x2e3794['uniqueid']][_0x4a4d('0x2e')]=_0x2e3794[_0x4a4d('0x2e')];this['channels'][_0x2e3794[_0x4a4d('0x25')]][_0x4a4d('0x2f')]=_0x2e3794[_0x4a4d('0x2f')];}};Fax[_0x4a4d('0x20')][_0x4a4d('0x30')]=function(_0x48d9d8){if(this['channels'][_0x48d9d8['uniqueid']]){for(var _0x4e22e2 in _0x48d9d8[_0x4a4d('0x2b')]){if(_0x48d9d8[_0x4a4d('0x2b')][_0x4a4d('0x31')](_0x4e22e2)){this[_0x4a4d('0x11')][_0x48d9d8[_0x4a4d('0x25')]][_0x4e22e2]=_0x48d9d8[_0x4a4d('0x2c')];}}}};Fax[_0x4a4d('0x20')][_0x4a4d('0x1a')]=function(_0x123eb1){if(this[_0x4a4d('0x11')][_0x123eb1[_0x4a4d('0x25')]]){this[_0x4a4d('0x11')][_0x123eb1[_0x4a4d('0x25')]][_0x4a4d('0x32')]=_0x123eb1['operation'];this['channels'][_0x123eb1[_0x4a4d('0x25')]]['status']=_0x123eb1[_0x4a4d('0x33')];this[_0x4a4d('0x11')][_0x123eb1[_0x4a4d('0x25')]][_0x4a4d('0x24')]=_0x123eb1[_0x4a4d('0x24')];this[_0x4a4d('0x11')][_0x123eb1[_0x4a4d('0x25')]]['filename']=_0x123eb1[_0x4a4d('0x34')];logger[_0x4a4d('0x28')](_0x123eb1['uniqueid'],_0x4a4d('0x35'));}};Fax[_0x4a4d('0x20')][_0x4a4d('0x1c')]=function(_0x2eeeb8){var _0x3936fe=this;if(this['channels'][_0x2eeeb8[_0x4a4d('0x25')]]){var _0x41a8f7=this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]]['id'];this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]][_0x4a4d('0x36')]=_0x2eeeb8['remotestationid'];this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]][_0x4a4d('0x37')]=_0x2eeeb8[_0x4a4d('0x37')];this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]]['localstationid']=_0x2eeeb8['localstationid'];this['channels'][_0x2eeeb8[_0x4a4d('0x25')]][_0x4a4d('0x38')]=_0x2eeeb8[_0x4a4d('0x38')];this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]]['transferrate']=_0x2eeeb8[_0x4a4d('0x39')];this[_0x4a4d('0x11')][_0x2eeeb8[_0x4a4d('0x25')]][_0x4a4d('0x34')]=_0x2eeeb8[_0x4a4d('0x34')];this['channels'][_0x2eeeb8[_0x4a4d('0x25')]]['calleridnum']=_0x2eeeb8[_0x4a4d('0x3a')];if(this['channels'][_0x2eeeb8['uniqueid']][_0x4a4d('0x37')]>0x0){tiff2pdf(_0x2eeeb8['filename'],_0x4a4d('0x3b'),function(_0x2ef490){logger[_0x4a4d('0x28')](_0x2eeeb8[_0x4a4d('0x25')],_0x4a4d('0x3c'),_0x2ef490['message']);attachment['create']({'name':path[_0x4a4d('0x3d')](_0x2eeeb8['filename'])[_0x4a4d('0x27')],'basename':path[_0x4a4d('0x3d')](_0x2eeeb8[_0x4a4d('0x34')])[_0x4a4d('0x27')]+_0x4a4d('0x3e'),'type':_0x4a4d('0x3f')})[_0x4a4d('0x40')](function(_0x5420d6){faxAccount[_0x4a4d('0x41')](_0x41a8f7,{'from':_0x2eeeb8[_0x4a4d('0x3a')],'mapKey':_0x4a4d('0x8'),'body':path[_0x4a4d('0x3d')](_0x2eeeb8[_0x4a4d('0x34')])['name']+'.pdf','AttachmentId':_0x5420d6['id']})[_0x4a4d('0x42')](function(_0x204738){logger[_0x4a4d('0x43')](_0x2eeeb8['uniqueid'],'\x20notify\x20',JSON[_0x4a4d('0x44')](_0x204738));});})['catch'](function(_0x2b9426){logger[_0x4a4d('0x43')](_0x2eeeb8[_0x4a4d('0x25')],_0x4a4d('0x45'),JSON[_0x4a4d('0x44')](_0x2b9426));});});}logger['info'](_0x2eeeb8[_0x4a4d('0x25')],_0x4a4d('0x45'));}};Fax[_0x4a4d('0x20')]['syncOriginateResponse']=function(_0x205969){if(this[_0x4a4d('0x14')][_0x205969['uniqueid']]){_[_0x4a4d('0x46')](this['channels'][_0x205969[_0x4a4d('0x25')]],_['pick'](_0x205969,[_0x4a4d('0x47'),_0x4a4d('0x48')]));}};function updateStatus(_0x17bb2c){if(_0x17bb2c['AttachmentId']){faxMessage[_0x4a4d('0x49')](_0x17bb2c['AttachmentId'],{'failMessage':_0x4a4d('0x4a')})[_0x4a4d('0x40')](function(_0x2384ea){ut['logger'](_0x4a4d('0x4b'),_0x2384ea);})['catch'](function(_0x5a1647){ut[_0x4a4d('0x4c')]('[Fax][Message][Error][NoUpdate1]',_0x5a1647);});}else{ut['logger'](_0x4a4d('0x4d'));}}Fax[_0x4a4d('0x20')][_0x4a4d('0x4e')]=function(_0xb1c335,_0x272014,_0x41a01d){var _0x33d1a8=this;var _0x267e72={};if(_0x272014){_0x267e72={'read':_0x272014};}else{_0x267e72={'failMessage':_0x41a01d};}if(this[_0x4a4d('0x14')][_0xb1c335][_0x4a4d('0x4f')]){faxMessage[_0x4a4d('0x49')](this[_0x4a4d('0x14')][_0xb1c335]['AttachmentId'],_0x267e72)[_0x4a4d('0x40')](function(_0x44039d){ut[_0x4a4d('0x4c')](_0x4a4d('0x50'),_0x44039d);})['catch'](function(_0x33e0d9){ut[_0x4a4d('0x4c')](_0x4a4d('0x51'),_0x33e0d9);})[_0x4a4d('0x52')](function(){delete _0x33d1a8[_0x4a4d('0x11')][_0xb1c335];delete _0x33d1a8[_0x4a4d('0x14')][_0xb1c335];});}else{ut[_0x4a4d('0x4c')](_0x4a4d('0x53'));delete this[_0x4a4d('0x11')][_0xb1c335];delete this[_0x4a4d('0x14')][_0xb1c335];}};Fax['prototype']['syncHangup']=function(_0x335485){var _0x26ad8b=this;if(this[_0x4a4d('0x11')][_0x335485[_0x4a4d('0x25')]]){if(this[_0x4a4d('0x14')][_0x335485[_0x4a4d('0x25')]]){this[_0x4a4d('0x11')][_0x335485[_0x4a4d('0x25')]]['id']=this[_0x4a4d('0x14')][_0x335485[_0x4a4d('0x25')]]['id'];this['channels'][_0x335485[_0x4a4d('0x25')]][_0x4a4d('0x27')]=this[_0x4a4d('0x14')][_0x335485[_0x4a4d('0x25')]][_0x4a4d('0x27')];}logger[_0x4a4d('0x28')](_0x335485[_0x4a4d('0x25')],this[_0x4a4d('0x14')][_0x335485[_0x4a4d('0x25')]]?_0x4a4d('0x54'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x4a4d('0x11')][_0x335485[_0x4a4d('0x25')]]));if(this[_0x4a4d('0x14')][_0x335485[_0x4a4d('0x25')]]){if(this['channels'][_0x335485[_0x4a4d('0x25')]]['faxpages']>0x0&&this['channels'][_0x335485[_0x4a4d('0x25')]][_0x4a4d('0x55')]==='SUCCESS'){this[_0x4a4d('0x4e')](_0x335485['uniqueid'],!![]);}else{this[_0x4a4d('0x4e')](_0x335485['uniqueid'],![],this[_0x4a4d('0x11')][_0x335485[_0x4a4d('0x25')]][_0x4a4d('0x56')]?'SENDING\x20FAILED:\x20'+this[_0x4a4d('0x11')][_0x335485[_0x4a4d('0x25')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x4a4d('0x20')][_0x4a4d('0x57')]=function(_0x4bc8ff){var _0x19b2ce=this;return new BPromise(function(_0xf00fad,_0x17474b){_0x19b2ce[_0x4a4d('0x58')](_0x4bc8ff,_0x19b2ce['faxAccounts'][_0x4bc8ff[_0x4a4d('0x59')]])['then'](function(_0x2bec1b){ut['logger'](_0x4a4d('0x5a'),_0x2bec1b);_0xf00fad(ut['message'](_0x4a4d('0x5b')));})[_0x4a4d('0x42')](function(_0x4af0ca){ut[_0x4a4d('0x4c')]('[Fax][execOriginate][failure]',_0x4af0ca);updateStatus(_0x4bc8ff);_0x17474b(ut[_0x4a4d('0x5c')](_0x4a4d('0x5d')));});});};Fax['prototype'][_0x4a4d('0x5e')]=function(_0x356a75){var _0x467457=this;return new BPromise(function(_0x1d62da,_0x11abb9){var _0x4870e3=_0x467457[_0x4a4d('0x5f')](_0x467457[_0x4a4d('0x12')][_0x356a75[_0x4a4d('0x59')]][_0x4a4d('0x60')],_0x356a75);if(_0x4870e3[_0x4a4d('0x61')]){_0x1d62da(ut['message'](_0x4a4d('0x62')));}else{_0x11abb9(ut[_0x4a4d('0x5c')](_0x4870e3[_0x4a4d('0x5c')]));}});};function originate(_0x141416,_0xe5d532,_0x49ab96){return new BPromise(function(_0x2dd8a4,_0x41f208){if(_0x49ab96){var _0x1a23d4=util[_0x4a4d('0x63')](_0x4a4d('0x64'),path[_0x4a4d('0x3d')](_0x141416[_0x4a4d('0x5')])[_0x4a4d('0x27')],_0x141416[_0x4a4d('0x5')]);gs[_0x4a4d('0x65')](_0x1a23d4)[_0x4a4d('0x40')](function(){_0x141416[_0x4a4d('0x5')]=util[_0x4a4d('0x63')]('%s/%s.tif',path[_0x4a4d('0x3d')](_0x141416[_0x4a4d('0x5')])[_0x4a4d('0x66')],path[_0x4a4d('0x3d')](_0x141416[_0x4a4d('0x5')])['name']);_0xe5d532['XMF-PATH']=_0x141416['path'];ut['logger'](_0x4a4d('0x67'),'');ami[_0x4a4d('0x68')](ut['variablesAction'](_0x141416,_0xe5d532))[_0x4a4d('0x40')](function(_0x400bc1){_0x2dd8a4(_0x400bc1);})[_0x4a4d('0x42')](function(_0x20e7a1){_0x41f208(_0x20e7a1);});})[_0x4a4d('0x42')](function(_0x438283){_0x41f208(_0x438283);});}else{ami['Action'](ut['variablesAction'](_0x141416,_0xe5d532))['then'](function(_0x1244bd){_0x2dd8a4(_0x1244bd);})[_0x4a4d('0x42')](function(_0x42463e){_0x41f208(_0x42463e);});}});}Fax['prototype'][_0x4a4d('0x58')]=function(_0x36485f,_0x2cd8ad){var _0x61fc6e=this;return new BPromise(function(_0x1067fa,_0x27eed7){var _0x58d691=uuid['v4']();var _0x1ccabe=ut[_0x4a4d('0x69')](_0x36485f,_0x2cd8ad);_0x61fc6e[_0x4a4d('0x14')][_0x58d691]=new Action(_0x58d691,_0x2cd8ad,_0x36485f);var _0x10cb57=_0x61fc6e[_0x4a4d('0x14')][_0x58d691];if(path['parse'](_0x36485f[_0x4a4d('0x5')])[_0x4a4d('0x6a')]===_0x4a4d('0x3e')){originate(_0x10cb57,_0x1ccabe,!![])[_0x4a4d('0x40')](function(_0x13d4fd){_0x1067fa(_0x13d4fd);})[_0x4a4d('0x42')](function(_0x36a7a0){_0x27eed7(_0x36a7a0);});}else{originate(_0x10cb57,_0x1ccabe,![])[_0x4a4d('0x40')](function(_0x2e4848){_0x1067fa(_0x2e4848);})[_0x4a4d('0x42')](function(_0x42be0c){_0x27eed7(_0x42be0c);});}});};Fax[_0x4a4d('0x20')][_0x4a4d('0x6b')]=function(_0x59726b){return!_[_0x4a4d('0x6c')](_0x59726b)&&!_[_0x4a4d('0x6c')](_0x59726b[_0x4a4d('0x27')])&&!_[_0x4a4d('0x6c')](_0x59726b[_0x4a4d('0x6d')])&&_0x59726b['active']&&!_[_0x4a4d('0x6c')](this[_0x4a4d('0x13')][util['format'](_0x4a4d('0x6e'),_0x59726b[_0x4a4d('0x27')])])&&!_[_0x4a4d('0x6c')](this[_0x4a4d('0x13')][util['format']('SIP/%s',_0x59726b['name'])][_0x4a4d('0x33')])&&(this[_0x4a4d('0x13')][util[_0x4a4d('0x63')](_0x4a4d('0x6e'),_0x59726b['name'])][_0x4a4d('0x33')]===_0x4a4d('0x6f')||this[_0x4a4d('0x13')][util['format'](_0x4a4d('0x6e'),_0x59726b[_0x4a4d('0x27')])][_0x4a4d('0x33')]===_0x4a4d('0x70'));};Fax[_0x4a4d('0x20')]['checkTrunk']=function(_0x22df87,_0x2db0fe){if(!this[_0x4a4d('0x6b')](_0x22df87)){ut['logger'](_0x4a4d('0x71'),_[_0x4a4d('0x6c')](_0x22df87)?'':_0x22df87[_0x4a4d('0x27')]+_0x4a4d('0x72'));return{'isValid':![],'message':_0x4a4d('0x73')};}if(_['isNil'](_0x2db0fe[_0x4a4d('0x8')])){ut[_0x4a4d('0x4c')](_0x4a4d('0x74'),JSON[_0x4a4d('0x44')](_0x2db0fe));return{'isValid':![],'message':_0x4a4d('0x75')};}if(_['isNil'](_0x2db0fe['path'])){ut[_0x4a4d('0x4c')](_0x4a4d('0x76'),JSON[_0x4a4d('0x44')](_0x2db0fe));return{'isValid':![],'message':_0x4a4d('0x77')};}return{'isValid':!![],'message':_0x4a4d('0x78')};};module[_0x4a4d('0x79')]=Fax; \ No newline at end of file +var _0x0820=['catch','stringify','\x20receiveFax\x20','merge','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','execute','XMF-PATH','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','exports','util','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','name','application/pdf','then','notify','.pdf','error','\x20notify\x20'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x0820,0x110));var _0x0082=function(_0x4e44ae,_0x51df27){_0x4e44ae=_0x4e44ae-0x0;var _0x4cb789=_0x0820[_0x4e44ae];return _0x4cb789;};'use strict';var util=require(_0x0082('0x0'));var _=require('lodash');var BPromise=require(_0x0082('0x1'));var uuid=require(_0x0082('0x2'));var moment=require(_0x0082('0x3'));var path=require('path');var tiff2pdf=require(_0x0082('0x4'));var gs=require(_0x0082('0x5'));var logger=require(_0x0082('0x6'))('fax');var ami=require(_0x0082('0x7'));var rpcDb=require(_0x0082('0x8'));var Channel=require(_0x0082('0x9'));var ut=require(_0x0082('0xa'));var Action=require(_0x0082('0xb'));var faxAccount=require(_0x0082('0xc'));var attachment=require(_0x0082('0xd'));var faxMessage=require(_0x0082('0xe'));function Fax(_0x1090fb){this['channels']={};this[_0x0082('0xf')]=_0x1090fb[_0x0082('0xf')];this[_0x0082('0x10')]=_0x1090fb[_0x0082('0x10')];this[_0x0082('0x11')]={};ami['on'](_0x0082('0x12'),this[_0x0082('0x13')][_0x0082('0x14')](this));ami['on'](_0x0082('0x15'),this[_0x0082('0x16')][_0x0082('0x14')](this));ami['on'](_0x0082('0x17'),this['syncNewState'][_0x0082('0x14')](this));ami['on'](_0x0082('0x18'),this[_0x0082('0x19')][_0x0082('0x14')](this));ami['on']('faxstatus',this[_0x0082('0x1a')][_0x0082('0x14')](this));ami['on']('receivefax',this[_0x0082('0x1b')]['bind'](this));ami['on'](_0x0082('0x1c'),this[_0x0082('0x1d')][_0x0082('0x14')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x0082('0x1e')][_0x0082('0x13')]=function(_0x73a53d){if(_0x73a53d[_0x0082('0x1f')]===_0x0082('0x20')){for(var _0x40afb0 in this[_0x0082('0xf')]){if(this[_0x0082('0xf')][_0x0082('0x21')](_0x40afb0)){if(_0x73a53d['exten']===this[_0x0082('0xf')][_0x40afb0][_0x0082('0x22')]){this[_0x0082('0x23')][_0x73a53d[_0x0082('0x24')]]={};this[_0x0082('0x23')][_0x73a53d[_0x0082('0x24')]]['channel']=_0x73a53d[_0x0082('0x25')];this['channels'][_0x73a53d[_0x0082('0x24')]]['id']=this[_0x0082('0xf')][_0x40afb0]['id'];this['channels'][_0x73a53d[_0x0082('0x24')]]['name']=this[_0x0082('0xf')][_0x40afb0]['name'];logger[_0x0082('0x26')](_0x73a53d['uniqueid'],_0x0082('0x27'));}}}}if(this[_0x0082('0x11')][_0x73a53d[_0x0082('0x24')]]){this['channels'][_0x73a53d['uniqueid']]={};this[_0x0082('0x23')][_0x73a53d[_0x0082('0x24')]]['channel']=_0x73a53d['channel'];logger[_0x0082('0x26')](_0x73a53d[_0x0082('0x24')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x0082('0x16')]=function(_0x47ae0a){if(this['channels'][_0x47ae0a[_0x0082('0x24')]]){for(var _0x3c17bc in _0x47ae0a[_0x0082('0x28')]){if(_0x47ae0a[_0x0082('0x28')][_0x0082('0x21')](_0x3c17bc)){this[_0x0082('0x23')][_0x47ae0a['uniqueid']][_0x3c17bc]=_0x47ae0a[_0x0082('0x29')];}}}};Fax[_0x0082('0x1e')][_0x0082('0x2a')]=function(_0x40ad8e){if(this[_0x0082('0x23')][_0x40ad8e[_0x0082('0x24')]]){this[_0x0082('0x23')][_0x40ad8e[_0x0082('0x24')]][_0x0082('0x2b')]=_0x40ad8e[_0x0082('0x2b')];this[_0x0082('0x23')][_0x40ad8e[_0x0082('0x24')]]['channelstatedesc']=_0x40ad8e['channelstatedesc'];}};Fax[_0x0082('0x1e')][_0x0082('0x19')]=function(_0x4d7382){if(this['channels'][_0x4d7382[_0x0082('0x24')]]){for(var _0x2e63b2 in _0x4d7382[_0x0082('0x28')]){if(_0x4d7382[_0x0082('0x28')][_0x0082('0x21')](_0x2e63b2)){this[_0x0082('0x23')][_0x4d7382[_0x0082('0x24')]][_0x2e63b2]=_0x4d7382[_0x0082('0x29')];}}}};Fax[_0x0082('0x1e')]['syncFaxStatus']=function(_0x3114b7){if(this[_0x0082('0x23')][_0x3114b7[_0x0082('0x24')]]){this[_0x0082('0x23')][_0x3114b7[_0x0082('0x24')]][_0x0082('0x2c')]=_0x3114b7[_0x0082('0x2c')];this['channels'][_0x3114b7[_0x0082('0x24')]][_0x0082('0x2d')]=_0x3114b7[_0x0082('0x2d')];this[_0x0082('0x23')][_0x3114b7[_0x0082('0x24')]]['localstationid']=_0x3114b7[_0x0082('0x22')];this[_0x0082('0x23')][_0x3114b7['uniqueid']][_0x0082('0x2e')]=_0x3114b7['filename'];logger[_0x0082('0x26')](_0x3114b7[_0x0082('0x24')],_0x0082('0x2f'));}};Fax['prototype'][_0x0082('0x1b')]=function(_0x833ec0){var _0x1a7745=this;if(this['channels'][_0x833ec0[_0x0082('0x24')]]){var _0x2b52e8=this[_0x0082('0x23')][_0x833ec0[_0x0082('0x24')]]['id'];this[_0x0082('0x23')][_0x833ec0['uniqueid']][_0x0082('0x30')]=_0x833ec0[_0x0082('0x30')];this['channels'][_0x833ec0['uniqueid']]['pagestransferred']=_0x833ec0[_0x0082('0x31')];this['channels'][_0x833ec0[_0x0082('0x24')]]['localstationid']=_0x833ec0[_0x0082('0x22')];this[_0x0082('0x23')][_0x833ec0[_0x0082('0x24')]][_0x0082('0x32')]=_0x833ec0[_0x0082('0x32')];this['channels'][_0x833ec0[_0x0082('0x24')]][_0x0082('0x33')]=_0x833ec0[_0x0082('0x33')];this[_0x0082('0x23')][_0x833ec0[_0x0082('0x24')]][_0x0082('0x2e')]=_0x833ec0[_0x0082('0x2e')];this['channels'][_0x833ec0[_0x0082('0x24')]]['calleridnum']=_0x833ec0[_0x0082('0x34')];if(this[_0x0082('0x23')][_0x833ec0[_0x0082('0x24')]][_0x0082('0x31')]>0x0){tiff2pdf(_0x833ec0[_0x0082('0x2e')],'/var/opt/motion2/server/files/attachments/',function(_0x571952){logger[_0x0082('0x26')](_0x833ec0[_0x0082('0x24')],_0x0082('0x35'),_0x571952[_0x0082('0x36')]);attachment[_0x0082('0x37')]({'name':path[_0x0082('0x38')](_0x833ec0[_0x0082('0x2e')])[_0x0082('0x39')],'basename':path[_0x0082('0x38')](_0x833ec0[_0x0082('0x2e')])[_0x0082('0x39')]+'.pdf','type':_0x0082('0x3a')})[_0x0082('0x3b')](function(_0x15ccf5){faxAccount[_0x0082('0x3c')](_0x2b52e8,{'from':_0x833ec0[_0x0082('0x34')],'mapKey':'fax','body':path[_0x0082('0x38')](_0x833ec0[_0x0082('0x2e')])[_0x0082('0x39')]+_0x0082('0x3d'),'AttachmentId':_0x15ccf5['id']})['catch'](function(_0x2090ca){logger[_0x0082('0x3e')](_0x833ec0[_0x0082('0x24')],_0x0082('0x3f'),JSON['stringify'](_0x2090ca));});})[_0x0082('0x40')](function(_0x55c9ec){logger['error'](_0x833ec0[_0x0082('0x24')],'\x20receiveFax\x20',JSON[_0x0082('0x41')](_0x55c9ec));});});}logger[_0x0082('0x26')](_0x833ec0[_0x0082('0x24')],_0x0082('0x42'));}};Fax[_0x0082('0x1e')]['syncOriginateResponse']=function(_0x2c58a8){if(this[_0x0082('0x11')][_0x2c58a8[_0x0082('0x24')]]){_[_0x0082('0x43')](this[_0x0082('0x23')][_0x2c58a8[_0x0082('0x24')]],_['pick'](_0x2c58a8,['response',_0x0082('0x44')]));}};function updateStatus(_0x33d614){if(_0x33d614['AttachmentId']){faxMessage[_0x0082('0x45')](_0x33d614[_0x0082('0x46')],{'failMessage':_0x0082('0x47')})[_0x0082('0x3b')](function(_0x453d63){ut[_0x0082('0x48')]('[Fax][Message][Error][Updated]',_0x453d63);})['catch'](function(_0x1702e8){ut['logger'](_0x0082('0x49'),_0x1702e8);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x0082('0x1e')][_0x0082('0x4a')]=function(_0x2b33b7,_0x2782ac,_0x3e6c82){var _0x233e40=this;var _0x5a385b={};if(_0x2782ac){_0x5a385b={'read':_0x2782ac};}else{_0x5a385b={'failMessage':_0x3e6c82};}if(this[_0x0082('0x11')][_0x2b33b7][_0x0082('0x46')]){faxMessage[_0x0082('0x45')](this[_0x0082('0x11')][_0x2b33b7][_0x0082('0x46')],_0x5a385b)[_0x0082('0x3b')](function(_0x40f5c7){ut[_0x0082('0x48')](_0x0082('0x4b'),_0x40f5c7);})[_0x0082('0x40')](function(_0x4d686e){ut['logger'](_0x0082('0x4c'),_0x4d686e);})[_0x0082('0x4d')](function(){delete _0x233e40[_0x0082('0x23')][_0x2b33b7];delete _0x233e40[_0x0082('0x11')][_0x2b33b7];});}else{ut[_0x0082('0x48')](_0x0082('0x4e'));delete this[_0x0082('0x23')][_0x2b33b7];delete this[_0x0082('0x11')][_0x2b33b7];}};Fax[_0x0082('0x1e')][_0x0082('0x1d')]=function(_0x3443da){var _0x25dbca=this;if(this[_0x0082('0x23')][_0x3443da[_0x0082('0x24')]]){if(this[_0x0082('0x11')][_0x3443da[_0x0082('0x24')]]){this['channels'][_0x3443da['uniqueid']]['id']=this[_0x0082('0x11')][_0x3443da['uniqueid']]['id'];this['channels'][_0x3443da['uniqueid']][_0x0082('0x39')]=this[_0x0082('0x11')][_0x3443da['uniqueid']][_0x0082('0x39')];}logger['info'](_0x3443da[_0x0082('0x24')],this[_0x0082('0x11')][_0x3443da[_0x0082('0x24')]]?'\x20hangup\x20sendFile\x20':_0x0082('0x4f'),JSON[_0x0082('0x41')](this[_0x0082('0x23')][_0x3443da[_0x0082('0x24')]]));if(this['actions'][_0x3443da[_0x0082('0x24')]]){if(this[_0x0082('0x23')][_0x3443da[_0x0082('0x24')]]['faxpages']>0x0&&this[_0x0082('0x23')][_0x3443da['uniqueid']][_0x0082('0x50')]===_0x0082('0x51')){this[_0x0082('0x4a')](_0x3443da[_0x0082('0x24')],!![]);}else{this[_0x0082('0x4a')](_0x3443da[_0x0082('0x24')],![],this[_0x0082('0x23')][_0x3443da['uniqueid']][_0x0082('0x52')]?'SENDING\x20FAILED:\x20'+this[_0x0082('0x23')][_0x3443da[_0x0082('0x24')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x0082('0x1e')]['send']=function(_0x39f8ca){var _0x142d0c=this;return new BPromise(function(_0x135470,_0x2d907b){_0x142d0c[_0x0082('0x53')](_0x39f8ca,_0x142d0c[_0x0082('0xf')][_0x39f8ca[_0x0082('0x54')]])[_0x0082('0x3b')](function(_0x40d830){ut[_0x0082('0x48')](_0x0082('0x55'),_0x40d830);_0x135470(ut[_0x0082('0x36')](_0x0082('0x56')));})[_0x0082('0x40')](function(_0x30f6cd){ut['logger'](_0x0082('0x57'),_0x30f6cd);updateStatus(_0x39f8ca);_0x2d907b(ut[_0x0082('0x36')](_0x0082('0x58')));});});};Fax[_0x0082('0x1e')][_0x0082('0x59')]=function(_0x405932){var _0x7a5217=this;return new BPromise(function(_0x137111,_0x2b023c){var _0x2fe433=_0x7a5217[_0x0082('0x5a')](_0x7a5217[_0x0082('0xf')][_0x405932[_0x0082('0x54')]][_0x0082('0x5b')],_0x405932);if(_0x2fe433[_0x0082('0x5c')]){_0x137111(ut[_0x0082('0x36')](_0x0082('0x5d')));}else{_0x2b023c(ut['message'](_0x2fe433[_0x0082('0x36')]));}});};function originate(_0x3d18a6,_0x2bfcaf,_0x355564){return new BPromise(function(_0x369b90,_0x57c58e){if(_0x355564){var _0x19017e=util[_0x0082('0x5e')](_0x0082('0x5f'),path[_0x0082('0x38')](_0x3d18a6[_0x0082('0x60')])[_0x0082('0x39')],_0x3d18a6[_0x0082('0x60')]);gs[_0x0082('0x61')](_0x19017e)['then'](function(){_0x3d18a6[_0x0082('0x60')]=util[_0x0082('0x5e')]('%s/%s.tif',path[_0x0082('0x38')](_0x3d18a6[_0x0082('0x60')])['dir'],path[_0x0082('0x38')](_0x3d18a6[_0x0082('0x60')])[_0x0082('0x39')]);_0x2bfcaf[_0x0082('0x62')]=_0x3d18a6[_0x0082('0x60')];ut[_0x0082('0x48')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0x0082('0x63')](_0x3d18a6,_0x2bfcaf))[_0x0082('0x3b')](function(_0x443076){_0x369b90(_0x443076);})['catch'](function(_0x3a3a56){_0x57c58e(_0x3a3a56);});})[_0x0082('0x40')](function(_0x174f73){_0x57c58e(_0x174f73);});}else{ami[_0x0082('0x64')](ut['variablesAction'](_0x3d18a6,_0x2bfcaf))[_0x0082('0x3b')](function(_0x541c26){_0x369b90(_0x541c26);})[_0x0082('0x40')](function(_0x113af2){_0x57c58e(_0x113af2);});}});}Fax[_0x0082('0x1e')]['execOriginate']=function(_0x4b1c0c,_0xef3258){var _0x303b39=this;return new BPromise(function(_0x180705,_0x1a9d64){var _0x1292a4=uuid['v4']();var _0x37c6fd=ut[_0x0082('0x65')](_0x4b1c0c,_0xef3258);_0x303b39[_0x0082('0x11')][_0x1292a4]=new Action(_0x1292a4,_0xef3258,_0x4b1c0c);var _0x592a1d=_0x303b39[_0x0082('0x11')][_0x1292a4];if(path[_0x0082('0x38')](_0x4b1c0c[_0x0082('0x60')])['ext']==='.pdf'){originate(_0x592a1d,_0x37c6fd,!![])[_0x0082('0x3b')](function(_0x136bd5){_0x180705(_0x136bd5);})[_0x0082('0x40')](function(_0xf8d353){_0x1a9d64(_0xf8d353);});}else{originate(_0x592a1d,_0x37c6fd,![])[_0x0082('0x3b')](function(_0x12d1af){_0x180705(_0x12d1af);})[_0x0082('0x40')](function(_0x37032a){_0x1a9d64(_0x37032a);});}});};Fax[_0x0082('0x1e')][_0x0082('0x66')]=function(_0x4cba05){return!_[_0x0082('0x67')](_0x4cba05)&&!_[_0x0082('0x67')](_0x4cba05['name'])&&!_[_0x0082('0x67')](_0x4cba05[_0x0082('0x68')])&&_0x4cba05['active']&&!_[_0x0082('0x67')](this['trunks'][util[_0x0082('0x5e')](_0x0082('0x69'),_0x4cba05[_0x0082('0x39')])])&&!_[_0x0082('0x67')](this[_0x0082('0x10')][util[_0x0082('0x5e')]('SIP/%s',_0x4cba05[_0x0082('0x39')])][_0x0082('0x2d')])&&(this[_0x0082('0x10')][util[_0x0082('0x5e')](_0x0082('0x69'),_0x4cba05[_0x0082('0x39')])]['status']==='reachable'||this[_0x0082('0x10')][util['format']('SIP/%s',_0x4cba05[_0x0082('0x39')])][_0x0082('0x2d')]===_0x0082('0x6a'));};Fax['prototype'][_0x0082('0x5a')]=function(_0x5a7ae7,_0xa940c2){if(!this[_0x0082('0x66')](_0x5a7ae7)){ut[_0x0082('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x0082('0x67')](_0x5a7ae7)?'':_0x5a7ae7[_0x0082('0x39')]+_0x0082('0x6b'));return{'isValid':![],'message':_0x0082('0x6c')};}if(_['isNil'](_0xa940c2['fax'])){ut[_0x0082('0x48')](_0x0082('0x6d'),JSON[_0x0082('0x41')](_0xa940c2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x0082('0x67')](_0xa940c2['path'])){ut[_0x0082('0x48')](_0x0082('0x6e'),JSON[_0x0082('0x41')](_0xa940c2));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x0082('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 794b0ee..19f8e24 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 _0xa3ad=['error','inspect','notify','resolve','util','../../../config/logger','preview','../rpc/faxAccount'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xa3ad,0xac));var _0xda3a=function(_0x13ac97,_0x3ebd47){_0x13ac97=_0x13ac97-0x0;var _0x3ac41f=_0xa3ad[_0x13ac97];return _0x3ac41f;};'use strict';var util=require(_0xda3a('0x0'));var BPromise=require('bluebird');var logger=require(_0xda3a('0x1'))(_0xda3a('0x2'));var _=require('lodash');var faxAccount=require(_0xda3a('0x3'));function loggerCatch(_0x3dda96){return function(_0x18ff8a){logger[_0xda3a('0x4')](_0x3dda96,util[_0xda3a('0x5')](_0x18ff8a,{'showHidden':![],'depth':null}));};}exports[_0xda3a('0x6')]=function(_0x1717ed,_0x2c14f0){return BPromise[_0xda3a('0x7')]()['then'](faxAccount[_0xda3a('0x6')](_0x1717ed,_0x2c14f0))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xd9bc=['[Notify]\x20','util','preview','lodash','../rpc/faxAccount','notify','then','catch'];(function(_0x41a7da,_0xe4c8ed){var _0x313230=function(_0x5a9299){while(--_0x5a9299){_0x41a7da['push'](_0x41a7da['shift']());}};_0x313230(++_0xe4c8ed);}(_0xd9bc,0x91));var _0xcd9b=function(_0x2b19ca,_0x38f021){_0x2b19ca=_0x2b19ca-0x0;var _0x1feb38=_0xd9bc[_0x2b19ca];return _0x1feb38;};'use strict';var util=require(_0xcd9b('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0xcd9b('0x1'));var _=require(_0xcd9b('0x2'));var faxAccount=require(_0xcd9b('0x3'));function loggerCatch(_0x1fe33e){return function(_0x4676a8){logger['error'](_0x1fe33e,util['inspect'](_0x4676a8,{'showHidden':![],'depth':null}));};}exports[_0xcd9b('0x4')]=function(_0x43a4eb,_0x2422ef){return BPromise['resolve']()[_0xcd9b('0x5')](faxAccount[_0xcd9b('0x4')](_0x43a4eb,_0x2422ef))[_0xcd9b('0x6')](loggerCatch(_0xcd9b('0x7')));}; \ 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 87cd89b..04001e3 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 _0xfa3a=['\x20Error\x20:','inspect','util','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x2b7567,_0x412715){var _0x2522dc=function(_0x242d85){while(--_0x242d85){_0x2b7567['push'](_0x2b7567['shift']());}};_0x2522dc(++_0x412715);}(_0xfa3a,0xfe));var _0xafa3=function(_0x366ce0,_0x4c3fad){_0x366ce0=_0x366ce0-0x0;var _0x5ae1c0=_0xfa3a[_0x366ce0];return _0x5ae1c0;};'use strict';var util=require(_0xafa3('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xafa3('0x1'));var exec=require(_0xafa3('0x2'))[_0xafa3('0x3')];exports[_0xafa3('0x4')]=function(_0x2f752d){return new BPromise(function(_0x1ccffc,_0x3a4d27){exec(_0x2f752d,function(_0x1716c9,_0x59f686,_0x44e86e){logger[_0xafa3('0x5')](_0xafa3('0x6'),_0x59f686);if(_0x1716c9){logger[_0xafa3('0x5')](_0xafa3('0x6'),_0xafa3('0x7'),util[_0xafa3('0x8')](_0x1716c9,{'showHidden':![],'depth':null}),_0x59f686,_0x44e86e);_0x3a4d27(_0x1716c9);}_0x1ccffc(_0x59f686);});});}; \ No newline at end of file +var _0x2f74=['../../../../config/logger','fax','child_process','exec','Exec\x20gs','info','\x20Error\x20:','util'];(function(_0x580cea,_0x41fab5){var _0x5311c8=function(_0x3c654f){while(--_0x3c654f){_0x580cea['push'](_0x580cea['shift']());}};_0x5311c8(++_0x41fab5);}(_0x2f74,0x137));var _0x42f7=function(_0x185133,_0x29a472){_0x185133=_0x185133-0x0;var _0x862f7f=_0x2f74[_0x185133];return _0x862f7f;};'use strict';var util=require(_0x42f7('0x0'));var logger=require(_0x42f7('0x1'))(_0x42f7('0x2'));var BPromise=require('bluebird');var exec=require(_0x42f7('0x3'))[_0x42f7('0x4')];exports['execute']=function(_0x255582){return new BPromise(function(_0x1455ed,_0x54cb73){exec(_0x255582,function(_0x53c5c2,_0x3bcef5,_0x4820bf){logger['info'](_0x42f7('0x5'),_0x3bcef5);if(_0x53c5c2){logger[_0x42f7('0x6')](_0x42f7('0x5'),_0x42f7('0x7'),util['inspect'](_0x53c5c2,{'showHidden':![],'depth':null}),_0x3bcef5,_0x4820bf);_0x54cb73(_0x53c5c2);}_0x1455ed(_0x3bcef5);});});}; \ 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 b98231c..d6c5757 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 _0xd942=['format','\x22%s\x22\x20<%s>','headerinfo','util','../../../../config/logger','fax','message','info','inspect','addVariables','minrate','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip'];(function(_0x22ffbf,_0x16f31e){var _0x360c17=function(_0x40807f){while(--_0x40807f){_0x22ffbf['push'](_0x22ffbf['shift']());}};_0x360c17(++_0x16f31e);}(_0xd942,0x179));var _0x2d94=function(_0x3a5335,_0x46df67){_0x3a5335=_0x3a5335-0x0;var _0x3e477c=_0xd942[_0x3a5335];return _0x3e477c;};'use strict';var util=require(_0x2d94('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2d94('0x1'))(_0x2d94('0x2'));exports[_0x2d94('0x3')]=function(_0x479b4c){return{'message':_0x479b4c};};exports['logger']=function(_0xb8e7a5,_0x3ad7a2){logger[_0x2d94('0x4')](_0xb8e7a5,util[_0x2d94('0x5')](_0x3ad7a2,{'showHidden':![],'depth':null}));};exports[_0x2d94('0x6')]=function(_0x204b22,_0x2eea8f){var _0x215edd={'XMF-ECM':_0x2eea8f['ecm'],'XMF-HEADERINFO':_0x2eea8f['headerinfo'],'XMF-MINRATE':_0x2eea8f[_0x2d94('0x7')],'XMF-MAXRATE':_0x2eea8f['maxrate'],'XMF-MODEM':util['format']('\x22%s\x22',_0x2eea8f[_0x2d94('0x8')]),'XMF-GATEWAY':_0x2eea8f[_0x2d94('0x9')],'XMF-FAXDETECT':_0x2eea8f[_0x2d94('0xa')],'XMF-T38TIMEOUT':_0x2eea8f[_0x2d94('0xb')],'XMF-LOCALSTATIONID':_0x2eea8f[_0x2d94('0xc')],'XMF-PATH':_0x204b22[_0x2d94('0xd')]};return _0x215edd;};exports[_0x2d94('0xe')]=function(_0x45d1a2,_0x46d724){return{'actionid':_0x45d1a2['uniqueid'],'action':_0x2d94('0xf'),'channel':_0x45d1a2[_0x2d94('0x10')],'Exten':_0x2d94('0x11'),'Context':_0x2d94('0x12'),'Priority':'1','callerid':util[_0x2d94('0x13')](_0x2d94('0x14'),_0x45d1a2[_0x2d94('0x15')]?_0x45d1a2[_0x2d94('0x15')]:'',_0x45d1a2[_0x2d94('0xc')]),'variable':_0x46d724,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x45d1a2['uniqueid']};}; \ No newline at end of file +var _0x7cd3=['../../../../config/logger','fax','message','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','moment'];(function(_0x2633a3,_0x53c6f1){var _0x4d0f72=function(_0x160a80){while(--_0x160a80){_0x2633a3['push'](_0x2633a3['shift']());}};_0x4d0f72(++_0x53c6f1);}(_0x7cd3,0x18f));var _0x37cd=function(_0x3384d0,_0x460c7d){_0x3384d0=_0x3384d0-0x0;var _0x2bc831=_0x7cd3[_0x3384d0];return _0x2bc831;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x37cd('0x0'));var logger=require(_0x37cd('0x1'))(_0x37cd('0x2'));exports[_0x37cd('0x3')]=function(_0x4d901c){return{'message':_0x4d901c};};exports['logger']=function(_0x3eca2e,_0x36ad5b){logger['info'](_0x3eca2e,util['inspect'](_0x36ad5b,{'showHidden':![],'depth':null}));};exports[_0x37cd('0x4')]=function(_0x2b8eff,_0x3d864c){var _0x3af262={'XMF-ECM':_0x3d864c[_0x37cd('0x5')],'XMF-HEADERINFO':_0x3d864c[_0x37cd('0x6')],'XMF-MINRATE':_0x3d864c['minrate'],'XMF-MAXRATE':_0x3d864c[_0x37cd('0x7')],'XMF-MODEM':util[_0x37cd('0x8')](_0x37cd('0x9'),_0x3d864c[_0x37cd('0xa')]),'XMF-GATEWAY':_0x3d864c['gateway'],'XMF-FAXDETECT':_0x3d864c[_0x37cd('0xb')],'XMF-T38TIMEOUT':_0x3d864c[_0x37cd('0xc')],'XMF-LOCALSTATIONID':_0x3d864c[_0x37cd('0xd')],'XMF-PATH':_0x2b8eff[_0x37cd('0xe')]};return _0x3af262;};exports[_0x37cd('0xf')]=function(_0x280666,_0x35d913){return{'actionid':_0x280666[_0x37cd('0x10')],'action':'originate','channel':_0x280666[_0x37cd('0x11')],'Exten':'xcally-motion-fax','Context':_0x37cd('0x12'),'Priority':'1','callerid':util[_0x37cd('0x8')](_0x37cd('0x13'),_0x280666['headerinfo']?_0x280666[_0x37cd('0x6')]:'',_0x280666[_0x37cd('0xd')]),'variable':_0x35d913,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x280666[_0x37cd('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9da1054..9c4ad0e 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 _0x40f3=['initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./report','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./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','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x40f3,0x9f));var _0x340f=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x40f3[_0x42bdad];return _0x122626;};'use strict';var BPromise=require(_0x340f('0x0'));var util=require(_0x340f('0x1'));var moment=require(_0x340f('0x2'));var server=require(_0x340f('0x3'));var Realtime=require('./realtime');var Report=require(_0x340f('0x4'));var Acw=require('./acw');var Trigger=require(_0x340f('0x5'));var Dialer=require(_0x340f('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x340f('0x7'));var voiceQueue=require(_0x340f('0x8'));var voiceQueueReport=require(_0x340f('0x9'));var voiceCallReport=require(_0x340f('0xa'));var trunk=require(_0x340f('0xb'));var trigger=require(_0x340f('0xc'));var template=require(_0x340f('0xd'));var cmHopperHistory=require(_0x340f('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x340f('0xf'));var faxAccount=require(_0x340f('0x10'));var zendesk=require(_0x340f('0x11'));var salesforce=require(_0x340f('0x12'));var sugarcrm=require(_0x340f('0x13'));var freshdesk=require(_0x340f('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x340f('0x15'));var vtiger=require(_0x340f('0x16'));var freshsales=require(_0x340f('0x17'));var servicenow=require(_0x340f('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x340f('0x19')](_0x340f('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x340f('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x340f('0x1b')]()[_0x340f('0x1c')](user[_0x340f('0x1d')]())[_0x340f('0x1c')](realtime[_0x340f('0x1e')]())[_0x340f('0x1c')](user[_0x340f('0x1f')]())['then'](realtime[_0x340f('0x20')]())[_0x340f('0x1c')](trunk[_0x340f('0x21')]())[_0x340f('0x1c')](realtime[_0x340f('0x22')]())[_0x340f('0x1c')](voiceQueue[_0x340f('0x23')]())[_0x340f('0x1c')](realtime[_0x340f('0x24')]())['then'](trigger[_0x340f('0x25')]())['then'](realtime[_0x340f('0x26')]())['then'](template[_0x340f('0x27')]())[_0x340f('0x1c')](realtime[_0x340f('0x28')]())[_0x340f('0x1c')](zendesk['getZendeskAccounts']())['then'](realtime[_0x340f('0x29')]())[_0x340f('0x1c')](salesforce['getSalesforceAccounts']())[_0x340f('0x1c')](realtime[_0x340f('0x2a')]())[_0x340f('0x1c')](sugarcrm[_0x340f('0x2b')]())[_0x340f('0x1c')](realtime['initSugarcrmAccounts']())[_0x340f('0x1c')](freshdesk[_0x340f('0x2c')]())[_0x340f('0x1c')](realtime[_0x340f('0x2d')]())[_0x340f('0x1c')](desk[_0x340f('0x2e')]())[_0x340f('0x1c')](realtime[_0x340f('0x2f')]())[_0x340f('0x1c')](zoho['getZohoAccounts']())[_0x340f('0x1c')](realtime[_0x340f('0x30')]())['then'](vtiger[_0x340f('0x31')]())['then'](realtime[_0x340f('0x32')]())['then'](freshsales[_0x340f('0x33')]())[_0x340f('0x1c')](realtime[_0x340f('0x34')]())[_0x340f('0x1c')](servicenow['getServicenowAccounts']())[_0x340f('0x1c')](realtime[_0x340f('0x35')]())[_0x340f('0x1c')](dynamics365[_0x340f('0x36')]())[_0x340f('0x1c')](realtime[_0x340f('0x37')]())['then'](campaign[_0x340f('0x38')]())['then'](realtime[_0x340f('0x39')]())[_0x340f('0x1c')](voiceExtension[_0x340f('0x3a')]())[_0x340f('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount['getFaxAccounts']())[_0x340f('0x1c')](realtime['initFaxAccounts']())[_0x340f('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x340f('0x1b')]()[_0x340f('0x1c')](voiceQueueReport[_0x340f('0x3b')]())[_0x340f('0x1c')](realtime[_0x340f('0x3c')]())[_0x340f('0x1c')](cmHopperHistory[_0x340f('0x3d')]())[_0x340f('0x1c')](realtime[_0x340f('0x3e')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x340f('0x1c')](realtime[_0x340f('0x3f')]())[_0x340f('0x1c')](voiceCallReport[_0x340f('0x40')]())[_0x340f('0x1c')](realtime[_0x340f('0x41')]())[_0x340f('0x1c')](function(_0x2b9e78){})[_0x340f('0x42')](function(_0x56310a){console[_0x340f('0x43')](_0x56310a);});}function main(){return server[_0x340f('0x44')](realtime,preview,fax)['then'](function(_0x474401){return initRealtime();})[_0x340f('0x1c')](function(){return initParams();})[_0x340f('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x340f('0x42')](function(_0x5b9065){console['log'](_0x5b9065);});}main(); \ No newline at end of file +var _0xd312=['getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','catch','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','getAgents','initAgents','then'];(function(_0x21ed1d,_0x3e4456){var _0xcdd16e=function(_0x565a8d){while(--_0x565a8d){_0x21ed1d['push'](_0x21ed1d['shift']());}};_0xcdd16e(++_0x3e4456);}(_0xd312,0x18c));var _0x2d31=function(_0x557c28,_0x4f4558){_0x557c28=_0x557c28-0x0;var _0x7a8ef8=_0xd312[_0x557c28];return _0x7a8ef8;};'use strict';var BPromise=require(_0x2d31('0x0'));var util=require(_0x2d31('0x1'));var moment=require(_0x2d31('0x2'));var server=require(_0x2d31('0x3'));var Realtime=require(_0x2d31('0x4'));var Report=require(_0x2d31('0x5'));var Acw=require(_0x2d31('0x6'));var Trigger=require(_0x2d31('0x7'));var Dialer=require('./dialer');var Preview=require(_0x2d31('0x8'));var Fax=require(_0x2d31('0x9'));var user=require(_0x2d31('0xa'));var voiceQueue=require(_0x2d31('0xb'));var voiceQueueReport=require(_0x2d31('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x2d31('0xd'));var trigger=require(_0x2d31('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x2d31('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x2d31('0x10'));var faxAccount=require(_0x2d31('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x2d31('0x12'));var sugarcrm=require(_0x2d31('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x2d31('0x14'));var zoho=require(_0x2d31('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x2d31('0x16'));var servicenow=require(_0x2d31('0x17'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2d31('0x18')](_0x2d31('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x2d31('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x2d31('0x1a')]()['then'](user[_0x2d31('0x1b')]())['then'](realtime[_0x2d31('0x1c')]())[_0x2d31('0x1d')](user[_0x2d31('0x1e')]())[_0x2d31('0x1d')](realtime['initTelephones']())[_0x2d31('0x1d')](trunk[_0x2d31('0x1f')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x20')]())[_0x2d31('0x1d')](voiceQueue[_0x2d31('0x21')]())['then'](realtime['initVoiceQueues']())[_0x2d31('0x1d')](trigger[_0x2d31('0x22')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x23')]())[_0x2d31('0x1d')](template['getTemplates']())[_0x2d31('0x1d')](realtime['initTemplates']())[_0x2d31('0x1d')](zendesk[_0x2d31('0x24')]())['then'](realtime[_0x2d31('0x25')]())[_0x2d31('0x1d')](salesforce[_0x2d31('0x26')]())['then'](realtime[_0x2d31('0x27')]())[_0x2d31('0x1d')](sugarcrm[_0x2d31('0x28')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x29')]())['then'](freshdesk[_0x2d31('0x2a')]())['then'](realtime[_0x2d31('0x2b')]())[_0x2d31('0x1d')](desk['getDeskAccounts']())[_0x2d31('0x1d')](realtime[_0x2d31('0x2c')]())[_0x2d31('0x1d')](zoho[_0x2d31('0x2d')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x2e')]())['then'](vtiger[_0x2d31('0x2f')]())['then'](realtime['initVtigerAccounts']())[_0x2d31('0x1d')](freshsales[_0x2d31('0x30')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x31')]())[_0x2d31('0x1d')](servicenow[_0x2d31('0x32')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x33')]())['then'](dynamics365[_0x2d31('0x34')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x35')]())[_0x2d31('0x1d')](campaign[_0x2d31('0x36')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x37')]())[_0x2d31('0x1d')](voiceExtension['getVoiceExtensions']())[_0x2d31('0x1d')](realtime[_0x2d31('0x38')]())[_0x2d31('0x1d')](faxAccount[_0x2d31('0x39')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x3a')]())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x2d31('0x1d')](voiceQueueReport[_0x2d31('0x3b')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x3c')]())[_0x2d31('0x1d')](cmHopperHistory[_0x2d31('0x3d')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x3e')]())[_0x2d31('0x1d')](cmHopperHistory[_0x2d31('0x3f')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x40')]())[_0x2d31('0x1d')](voiceCallReport[_0x2d31('0x41')]())[_0x2d31('0x1d')](realtime[_0x2d31('0x42')]())[_0x2d31('0x1d')](function(_0x5eabcb){})['catch'](function(_0x5eac68){console[_0x2d31('0x43')](_0x5eac68);});}function main(){return server[_0x2d31('0x44')](realtime,preview,fax)['then'](function(_0x3bd631){return initRealtime();})[_0x2d31('0x1d')](function(){return initParams();})[_0x2d31('0x1d')](function(){report[_0x2d31('0x45')]();setInterval(initRealtime,0x1388);})[_0x2d31('0x46')](function(_0x5df39a){console[_0x2d31('0x43')](_0x5df39a);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 96cbeb3..e92f7e6 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 _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x2c929a,_0x343663){var _0x418fa0=function(_0x486699){while(--_0x486699){_0x2c929a['push'](_0x2c929a['shift']());}};_0x418fa0(++_0x343663);}(_0x34e8,0x12c));var _0x834e=function(_0x386b85,_0x2e3cdf){_0x386b85=_0x386b85-0x0;var _0x33473c=_0x34e8[_0x386b85];return _0x33473c;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x4414dc,_0x20ced3){var _0x4869e=function(_0x5d430d){while(--_0x5d430d){_0x4414dc['push'](_0x4414dc['shift']());}};_0x4869e(++_0x20ced3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xcb91[_0x5e8c32];return _0x595f7b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 74cf330..1589645 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 _0xd9d2=['Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x531780,_0x40b5cc){var _0x16c02e=function(_0x1464b4){while(--_0x1464b4){_0x531780['push'](_0x531780['shift']());}};_0x16c02e(++_0x40b5cc);}(_0xd9d2,0xf8));var _0x2d9d=function(_0x4e4c40,_0xd32534){_0x4e4c40=_0x4e4c40-0x0;var _0x5ce582=_0xd9d2[_0x4e4c40];return _0x5ce582;};'use strict';function Campaign(_0x425694){this['id']=_0x425694['id']||0x0;this['name']=_0x425694[_0x2d9d('0x0')]||'';this[_0x2d9d('0x1')]=_0x425694['type']||_0x2d9d('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x2d9d('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2d9d('0x4')]='';this['sendMessageOneNotActive']=!![];this[_0x2d9d('0x5')]=_0x425694[_0x2d9d('0x5')];this['limitCalls']=_0x425694[_0x2d9d('0x6')];this[_0x2d9d('0x7')]=_0x425694[_0x2d9d('0x7')]||null;this[_0x2d9d('0x8')]=_0x425694[_0x2d9d('0x8')]?_0x425694['dialGlobalInterval']:null;this[_0x2d9d('0x9')]=_0x425694[_0x2d9d('0x9')];this[_0x2d9d('0xa')]=_0x425694[_0x2d9d('0xa')];this['dialOriginateTimeout']=_0x425694[_0x2d9d('0xb')]||0x1e;this[_0x2d9d('0xc')]=_0x425694['dialCongestionMaxRetry'];this[_0x2d9d('0xd')]=_0x425694[_0x2d9d('0xd')];this[_0x2d9d('0xe')]=_0x425694[_0x2d9d('0xe')];this[_0x2d9d('0xf')]=_0x425694[_0x2d9d('0xf')];this[_0x2d9d('0x10')]=_0x425694[_0x2d9d('0x10')];this[_0x2d9d('0x11')]=_0x425694[_0x2d9d('0x11')];this['dialGlobalMaxRetry']=_0x425694['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x425694[_0x2d9d('0x12')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x425694[_0x2d9d('0x13')]||0x96;this[_0x2d9d('0x14')]=_0x425694[_0x2d9d('0x14')]||0x3;this[_0x2d9d('0x15')]=_0x425694[_0x2d9d('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x425694[_0x2d9d('0x16')]||0x3;this[_0x2d9d('0x17')]=_0x425694[_0x2d9d('0x17')]||0x96;this[_0x2d9d('0x18')]=_0x425694['dialMachineMaxRetry']||0x3;this[_0x2d9d('0x19')]=_0x425694[_0x2d9d('0x19')]||0x96;this[_0x2d9d('0x1a')]=_0x425694[_0x2d9d('0x1a')]||0x3;this[_0x2d9d('0x1b')]=_0x425694[_0x2d9d('0x1b')]||0x96;this[_0x2d9d('0x1c')]=_0x425694['dialOrderByScheduledAt']||_0x2d9d('0x1d');this['dialPrefix']=_0x425694[_0x2d9d('0x1e')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x425694[_0x2d9d('0x1f')]||undefined;this[_0x2d9d('0x20')]=_0x425694[_0x2d9d('0x20')]||undefined;this['TrunkBackup']=_0x425694[_0x2d9d('0x21')]?_0x425694[_0x2d9d('0x21')]:undefined;this[_0x2d9d('0x22')]=_0x425694[_0x2d9d('0x22')]?_0x425694['Trunk']:undefined;this[_0x2d9d('0x23')]=_0x425694[_0x2d9d('0x23')]?_0x425694[_0x2d9d('0x23')]:undefined;this['SquareProject']=_0x425694[_0x2d9d('0x24')]?_0x425694[_0x2d9d('0x24')]:undefined;this['dialQueueProject']=_0x425694[_0x2d9d('0x24')]?_0x425694[_0x2d9d('0x24')][_0x2d9d('0x0')]:undefined;this[_0x2d9d('0x25')]=_0x425694[_0x2d9d('0x25')]||![];this[_0x2d9d('0x26')]=_0x425694[_0x2d9d('0x26')];this['dialAMDGreeting']=_0x425694[_0x2d9d('0x27')];this['dialAMDAfterGreetingSilence']=_0x425694[_0x2d9d('0x28')];this[_0x2d9d('0x29')]=_0x425694['dialAMDTotalAnalysisTime'];this[_0x2d9d('0x2a')]=_0x425694[_0x2d9d('0x2a')];this[_0x2d9d('0x2b')]=_0x425694[_0x2d9d('0x2b')];this[_0x2d9d('0x2c')]=_0x425694[_0x2d9d('0x2c')];this[_0x2d9d('0x2d')]=_0x425694['dialAMDSilenceThreshold'];this[_0x2d9d('0x2e')]=_0x425694[_0x2d9d('0x2e')];}module['exports']=Campaign; \ No newline at end of file +var _0x60e4=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0x60e4,0xf4));var _0x460e=function(_0x468c0a,_0x245d99){_0x468c0a=_0x468c0a-0x0;var _0x52f693=_0x60e4[_0x468c0a];return _0x52f693;};'use strict';function Campaign(_0x22ecfd){this['id']=_0x22ecfd['id']||0x0;this['name']=_0x22ecfd['name']||'';this[_0x460e('0x0')]=_0x22ecfd[_0x460e('0x0')]||_0x460e('0x1');this[_0x460e('0x2')]=0x0;this[_0x460e('0x3')]=0x0;this[_0x460e('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x460e('0x5')]='';this[_0x460e('0x6')]=!![];this[_0x460e('0x7')]=_0x22ecfd['active'];this[_0x460e('0x8')]=_0x22ecfd[_0x460e('0x8')];this[_0x460e('0x9')]=_0x22ecfd[_0x460e('0x9')]||null;this[_0x460e('0xa')]=_0x22ecfd[_0x460e('0xa')]?_0x22ecfd['dialGlobalInterval']:null;this[_0x460e('0xb')]=_0x22ecfd[_0x460e('0xb')];this[_0x460e('0xc')]=_0x22ecfd[_0x460e('0xc')];this[_0x460e('0xd')]=_0x22ecfd[_0x460e('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x22ecfd[_0x460e('0xe')];this['dialCongestionRetryFrequency']=_0x22ecfd[_0x460e('0xf')];this[_0x460e('0x10')]=_0x22ecfd['dialBusyMaxRetry'];this[_0x460e('0x11')]=_0x22ecfd[_0x460e('0x11')];this[_0x460e('0x12')]=_0x22ecfd['dialNoAnswerMaxRetry'];this[_0x460e('0x13')]=_0x22ecfd[_0x460e('0x13')];this[_0x460e('0x14')]=_0x22ecfd[_0x460e('0x14')];this['dialNoSuchNumberMaxRetry']=_0x22ecfd[_0x460e('0x15')]||0x3;this[_0x460e('0x16')]=_0x22ecfd['dialNoSuchNumberRetryFrequency']||0x96;this[_0x460e('0x17')]=_0x22ecfd['dialDropMaxRetry']||0x3;this[_0x460e('0x18')]=_0x22ecfd[_0x460e('0x18')]||0x96;this[_0x460e('0x19')]=_0x22ecfd[_0x460e('0x19')]||0x3;this[_0x460e('0x1a')]=_0x22ecfd[_0x460e('0x1a')]||0x96;this[_0x460e('0x1b')]=_0x22ecfd[_0x460e('0x1b')]||0x3;this[_0x460e('0x1c')]=_0x22ecfd[_0x460e('0x1c')]||0x96;this[_0x460e('0x1d')]=_0x22ecfd[_0x460e('0x1d')]||0x3;this[_0x460e('0x1e')]=_0x22ecfd[_0x460e('0x1e')]||0x96;this[_0x460e('0x1f')]=_0x22ecfd[_0x460e('0x1f')]||_0x460e('0x20');this[_0x460e('0x21')]=_0x22ecfd[_0x460e('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x22ecfd['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x22ecfd[_0x460e('0x22')]||undefined;this[_0x460e('0x23')]=_0x22ecfd[_0x460e('0x23')]?_0x22ecfd[_0x460e('0x23')]:undefined;this[_0x460e('0x24')]=_0x22ecfd['Trunk']?_0x22ecfd[_0x460e('0x24')]:undefined;this[_0x460e('0x25')]=_0x22ecfd['Interval']?_0x22ecfd[_0x460e('0x25')]:undefined;this[_0x460e('0x26')]=_0x22ecfd[_0x460e('0x26')]?_0x22ecfd[_0x460e('0x26')]:undefined;this['dialQueueProject']=_0x22ecfd[_0x460e('0x26')]?_0x22ecfd[_0x460e('0x26')][_0x460e('0x27')]:undefined;this[_0x460e('0x28')]=_0x22ecfd[_0x460e('0x28')]||![];this[_0x460e('0x29')]=_0x22ecfd[_0x460e('0x29')];this[_0x460e('0x2a')]=_0x22ecfd[_0x460e('0x2a')];this['dialAMDAfterGreetingSilence']=_0x22ecfd[_0x460e('0x2b')];this[_0x460e('0x2c')]=_0x22ecfd[_0x460e('0x2c')];this[_0x460e('0x2d')]=_0x22ecfd[_0x460e('0x2d')];this[_0x460e('0x2e')]=_0x22ecfd['dialAMDBetweenWordsSilence'];this[_0x460e('0x2f')]=_0x22ecfd['dialAMDMaximumNumberOfWords'];this[_0x460e('0x30')]=_0x22ecfd['dialAMDSilenceThreshold'];this[_0x460e('0x31')]=_0x22ecfd[_0x460e('0x31')];}module[_0x460e('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index e4691cf..0c33331 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 _0xe486=['monitor','monitorFilename','queue','transfercalleridnum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','type','disposition'];(function(_0x5e7a23,_0x1d48f5){var _0x534d63=function(_0x247c63){while(--_0x247c63){_0x5e7a23['push'](_0x5e7a23['shift']());}};_0x534d63(++_0x1d48f5);}(_0xe486,0x6a));var _0x6e48=function(_0x53fba5,_0x580aeb){_0x53fba5=_0x53fba5-0x0;var _0x47b96b=_0xe486[_0x53fba5];return _0x47b96b;};'use strict';function Channel(){this[_0x6e48('0x0')]=null;this[_0x6e48('0x1')]='';this[_0x6e48('0x2')]='';this[_0x6e48('0x3')]=0x0;this[_0x6e48('0x4')]='';this[_0x6e48('0x5')]=undefined;this[_0x6e48('0x6')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x6e48('0x7')]=0x0;this[_0x6e48('0x8')]=0x0;this[_0x6e48('0x9')]=0x0;this[_0x6e48('0xa')]=![];this['answertime']=null;this[_0x6e48('0xb')]=null;this[_0x6e48('0xc')]=![];this[_0x6e48('0xd')]=![];this[_0x6e48('0xe')]='';this[_0x6e48('0xf')]='';this['duration']=0x0;this[_0x6e48('0x10')]=0x0;this['holdtime']=0x0;this[_0x6e48('0x11')]=null;this['tag']=null;this[_0x6e48('0x12')]=null;this[_0x6e48('0x13')]=![];this[_0x6e48('0x14')]=null;this[_0x6e48('0x15')]=null;this['monitors']=[];this[_0x6e48('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x6e48('0x17')]=0x0;}module[_0x6e48('0x18')]=Channel; \ No newline at end of file +var _0x032e=['disposition','monitorFilename','transferconnectedlinenum','mohtime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','type','tag'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x032e,0x1cc));var _0xe032=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x032e[_0x484e36];return _0xafc85d;};'use strict';function Channel(){this['starttime']=null;this[_0xe032('0x0')]='';this[_0xe032('0x1')]='';this[_0xe032('0x2')]=0x0;this[_0xe032('0x3')]='';this[_0xe032('0x4')]=undefined;this['connectedlinename']=undefined;this[_0xe032('0x5')]=0x0;this[_0xe032('0x6')]='';this[_0xe032('0x7')]=0x0;this[_0xe032('0x8')]=0x0;this[_0xe032('0x9')]=0x0;this[_0xe032('0xa')]=![];this[_0xe032('0xb')]=null;this['endtime']=null;this[_0xe032('0xc')]=![];this[_0xe032('0xd')]=![];this[_0xe032('0xe')]='';this[_0xe032('0xf')]='';this[_0xe032('0x10')]=0x0;this[_0xe032('0x11')]=0x0;this['holdtime']=0x0;this[_0xe032('0x12')]=null;this[_0xe032('0x13')]=null;this[_0xe032('0x14')]=null;this['monitor']=![];this[_0xe032('0x15')]=null;this['queue']=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xe032('0x16')]=undefined;this['transferType']=undefined;this[_0xe032('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 03a8974..c000721 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 _0x7714=['consumerSecret','token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7714,0xf6));var _0x4771=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x7714[_0x1b6186];return _0x186121;};'use strict';function DeskAccount(_0x14338b){this['id']=_0x14338b['id']||0x0;this[_0x4771('0x0')]=_0x14338b[_0x4771('0x0')]||'';this[_0x4771('0x1')]=_0x14338b[_0x4771('0x1')]||'';this[_0x4771('0x2')]=_0x14338b[_0x4771('0x2')]||'';this[_0x4771('0x3')]=_0x14338b['authType']||'';this['password']=_0x14338b[_0x4771('0x4')]||'';this[_0x4771('0x5')]=_0x14338b[_0x4771('0x5')]||'';this[_0x4771('0x6')]=_0x14338b[_0x4771('0x6')]||'';this[_0x4771('0x7')]=_0x14338b[_0x4771('0x7')]||'';this[_0x4771('0x8')]=_0x14338b['tokenSecret']||'';this[_0x4771('0x9')]=_0x14338b[_0x4771('0x9')]||'';this['serverUrl']=_0x14338b[_0x4771('0xa')]||'';this['Configurations']=_0x14338b['Configurations']||{};}module[_0x4771('0xb')]=DeskAccount; \ No newline at end of file +var _0xd0c5=['type','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xd0c5,0x7b));var _0x5d0c=function(_0x2b18e3,_0x40e4fd){_0x2b18e3=_0x2b18e3-0x0;var _0x1ceb96=_0xd0c5[_0x2b18e3];return _0x1ceb96;};'use strict';function DeskAccount(_0x196a0e){this['id']=_0x196a0e['id']||0x0;this[_0x5d0c('0x0')]=_0x196a0e[_0x5d0c('0x0')]||'';this['username']=_0x196a0e[_0x5d0c('0x1')]||'';this['remoteUri']=_0x196a0e[_0x5d0c('0x2')]||'';this[_0x5d0c('0x3')]=_0x196a0e[_0x5d0c('0x3')]||'';this['password']=_0x196a0e[_0x5d0c('0x4')]||'';this[_0x5d0c('0x5')]=_0x196a0e['consumerKey']||'';this[_0x5d0c('0x6')]=_0x196a0e[_0x5d0c('0x6')]||'';this[_0x5d0c('0x7')]=_0x196a0e[_0x5d0c('0x7')]||'';this[_0x5d0c('0x8')]=_0x196a0e[_0x5d0c('0x8')]||'';this[_0x5d0c('0x9')]=_0x196a0e[_0x5d0c('0x9')]||'';this['serverUrl']=_0x196a0e['serverUrl']||'';this[_0x5d0c('0xa')]=_0x196a0e[_0x5d0c('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 99d5825..77a0ffc 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 _0x9ffd=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0xf86c3a,_0x18240c){var _0x4202b0=function(_0x4997b3){while(--_0x4997b3){_0xf86c3a['push'](_0xf86c3a['shift']());}};_0x4202b0(++_0x18240c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x13542e,_0x5df28b){_0x13542e=_0x13542e-0x0;var _0x1d84dd=_0x9ffd[_0x13542e];return _0x1d84dd;};'use strict';function Dynamics365Account(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['username']=_0x4c26a1[_0xd9ff('0x1')]||'';this[_0xd9ff('0x2')]=_0x4c26a1[_0xd9ff('0x2')]||'';this[_0xd9ff('0x3')]=_0x4c26a1['remoteUri']||'';this[_0xd9ff('0x4')]=_0x4c26a1[_0xd9ff('0x4')]||'';this['clientId']=_0x4c26a1[_0xd9ff('0x5')]||'';this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||{};this[_0xd9ff('0x7')]=_0x4c26a1[_0xd9ff('0x7')]||'';this[_0xd9ff('0x8')]=_0x4c26a1[_0xd9ff('0x8')]||{};}module[_0xd9ff('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x087b=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x10cde6,_0x562ae9){var _0x75ae2=function(_0x37dd95){while(--_0x37dd95){_0x10cde6['push'](_0x10cde6['shift']());}};_0x75ae2(++_0x562ae9);}(_0x087b,0x11a));var _0xb087=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x087b[_0xb24a3e];return _0x4038d7;};'use strict';function Dynamics365Account(_0x534915){this['id']=_0x534915['id']||0x0;this[_0xb087('0x0')]=_0x534915['name']||'';this['username']=_0x534915[_0xb087('0x1')]||'';this['password']=_0x534915[_0xb087('0x2')]||'';this[_0xb087('0x3')]=_0x534915[_0xb087('0x3')]||'';this[_0xb087('0x4')]=_0x534915[_0xb087('0x4')]||'';this[_0xb087('0x5')]=_0x534915[_0xb087('0x5')]||'';this[_0xb087('0x6')]=_0x534915[_0xb087('0x6')]||{};this[_0xb087('0x7')]=_0x534915[_0xb087('0x7')]||'';this[_0xb087('0x8')]=_0x534915[_0xb087('0x8')]||{};}module[_0xb087('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 23e45b7..33752db 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 _0x44b9=['tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout'];(function(_0x4abc38,_0x24beb2){var _0x4e1c7a=function(_0x436aa4){while(--_0x436aa4){_0x4abc38['push'](_0x4abc38['shift']());}};_0x4e1c7a(++_0x24beb2);}(_0x44b9,0x125));var _0x944b=function(_0x21255d,_0x59713e){_0x21255d=_0x21255d-0x0;var _0x198223=_0x44b9[_0x21255d];return _0x198223;};'use strict';function FaxAccount(_0x5623c2){this['id']=_0x5623c2['id']||0x0;this[_0x944b('0x0')]=_0x5623c2[_0x944b('0x0')]||'';this[_0x944b('0x1')]=_0x5623c2['description'];this['ecm']=_0x5623c2[_0x944b('0x2')];this[_0x944b('0x3')]=_0x5623c2[_0x944b('0x3')];this[_0x944b('0x4')]=_0x5623c2[_0x944b('0x4')];this['minrate']=_0x5623c2[_0x944b('0x5')]||0x960;this[_0x944b('0x6')]=_0x5623c2[_0x944b('0x6')]||0x3840;this[_0x944b('0x7')]=_0x5623c2[_0x944b('0x7')]||'v17,v27,v29';this[_0x944b('0x8')]=_0x5623c2[_0x944b('0x8')]||'no';this[_0x944b('0x9')]=_0x5623c2[_0x944b('0x9')]||'no';this[_0x944b('0xa')]=_0x5623c2[_0x944b('0xa')]||0x1388;this[_0x944b('0xb')]=_0x5623c2[_0x944b('0xb')]||_0x944b('0xc');this['Trunk']=_0x5623c2[_0x944b('0xd')]?_0x5623c2[_0x944b('0xd')]:undefined;this['ListId']=_0x5623c2['ListId'];this[_0x944b('0xe')]=_0x5623c2[_0x944b('0xe')];}module[_0x944b('0xf')]=FaxAccount; \ No newline at end of file +var _0xebda=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name'];(function(_0x4b4eaa,_0x1a408f){var _0x225e36=function(_0x521a6f){while(--_0x521a6f){_0x4b4eaa['push'](_0x4b4eaa['shift']());}};_0x225e36(++_0x1a408f);}(_0xebda,0xa9));var _0xaebd=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xebda[_0x42245d];return _0x4b211a;};'use strict';function FaxAccount(_0x367253){this['id']=_0x367253['id']||0x0;this[_0xaebd('0x0')]=_0x367253[_0xaebd('0x0')]||'';this[_0xaebd('0x1')]=_0x367253[_0xaebd('0x1')];this[_0xaebd('0x2')]=_0x367253['ecm'];this[_0xaebd('0x3')]=_0x367253[_0xaebd('0x3')];this[_0xaebd('0x4')]=_0x367253[_0xaebd('0x4')];this[_0xaebd('0x5')]=_0x367253[_0xaebd('0x5')]||0x960;this[_0xaebd('0x6')]=_0x367253[_0xaebd('0x6')]||0x3840;this['modem']=_0x367253[_0xaebd('0x7')]||_0xaebd('0x8');this['gateway']=_0x367253[_0xaebd('0x9')]||'no';this[_0xaebd('0xa')]=_0x367253['faxdetect']||'no';this[_0xaebd('0xb')]=_0x367253[_0xaebd('0xb')]||0x1388;this[_0xaebd('0xc')]=_0x367253[_0xaebd('0xc')]||_0xaebd('0xd');this[_0xaebd('0xe')]=_0x367253[_0xaebd('0xe')]?_0x367253[_0xaebd('0xe')]:undefined;this[_0xaebd('0xf')]=_0x367253[_0xaebd('0xf')];this[_0xaebd('0x10')]=_0x367253['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 52c88d2..213fe99 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 _0x12e2=['name','username','token','serverUrl','Configurations'];(function(_0xec9262,_0x3e62bd){var _0x19aeff=function(_0x39c18a){while(--_0x39c18a){_0xec9262['push'](_0xec9262['shift']());}};_0x19aeff(++_0x3e62bd);}(_0x12e2,0xd7));var _0x212e=function(_0x41c5ea,_0x2b0d22){_0x41c5ea=_0x41c5ea-0x0;var _0x23117e=_0x12e2[_0x41c5ea];return _0x23117e;};'use strict';function FreshdeskAccount(_0x5bb4d9){this['id']=_0x5bb4d9['id']||0x0;this[_0x212e('0x0')]=_0x5bb4d9[_0x212e('0x0')]||'';this[_0x212e('0x1')]=_0x5bb4d9['username']||'';this['apiKey']=_0x5bb4d9[_0x212e('0x2')]||'';this['remoteUri']=_0x5bb4d9['remoteUri']||'';this[_0x212e('0x3')]=_0x5bb4d9['serverUrl']||'';this[_0x212e('0x4')]=_0x5bb4d9[_0x212e('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x961f=['token','remoteUri','serverUrl','exports','name','username'];(function(_0x28900d,_0x4326ab){var _0x2ea58c=function(_0x43dfe5){while(--_0x43dfe5){_0x28900d['push'](_0x28900d['shift']());}};_0x2ea58c(++_0x4326ab);}(_0x961f,0xca));var _0xf961=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0x961f[_0xb4cc12];return _0x8593b5;};'use strict';function FreshdeskAccount(_0x2bacb4){this['id']=_0x2bacb4['id']||0x0;this[_0xf961('0x0')]=_0x2bacb4[_0xf961('0x0')]||'';this[_0xf961('0x1')]=_0x2bacb4[_0xf961('0x1')]||'';this['apiKey']=_0x2bacb4[_0xf961('0x2')]||'';this[_0xf961('0x3')]=_0x2bacb4[_0xf961('0x3')]||'';this[_0xf961('0x4')]=_0x2bacb4[_0xf961('0x4')]||'';this['Configurations']=_0x2bacb4['Configurations']||{};}module[_0xf961('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1611583..18f94cd 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 _0xc1fa=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0xc1fa,0x83));var _0xac1f=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xc1fa[_0x44216d];return _0xeca523;};'use strict';function FreshsalesAccount(_0x4168fb){this['id']=_0x4168fb['id']||0x0;this[_0xac1f('0x0')]=_0x4168fb[_0xac1f('0x0')]||'';this[_0xac1f('0x1')]=_0x4168fb[_0xac1f('0x1')]||'';this[_0xac1f('0x2')]=_0x4168fb['token']||'';this[_0xac1f('0x3')]=_0x4168fb[_0xac1f('0x3')]||'';this[_0xac1f('0x4')]=_0x4168fb[_0xac1f('0x4')]||'';this[_0xac1f('0x5')]=_0x4168fb[_0xac1f('0x5')]||{};}module[_0xac1f('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x0f80=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x260c10,_0x566139){var _0x17e714=function(_0x107a46){while(--_0x107a46){_0x260c10['push'](_0x260c10['shift']());}};_0x17e714(++_0x566139);}(_0x0f80,0x108));var _0x00f8=function(_0x4726f9,_0x37f54e){_0x4726f9=_0x4726f9-0x0;var _0x4e8449=_0x0f80[_0x4726f9];return _0x4e8449;};'use strict';function FreshsalesAccount(_0x2aaa24){this['id']=_0x2aaa24['id']||0x0;this[_0x00f8('0x0')]=_0x2aaa24[_0x00f8('0x0')]||'';this[_0x00f8('0x1')]=_0x2aaa24[_0x00f8('0x1')]||'';this[_0x00f8('0x2')]=_0x2aaa24['token']||'';this[_0x00f8('0x3')]=_0x2aaa24[_0x00f8('0x3')]||'';this[_0x00f8('0x4')]=_0x2aaa24['serverUrl']||'';this[_0x00f8('0x5')]=_0x2aaa24[_0x00f8('0x5')]||{};}module[_0x00f8('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 1ec2e28..085b686 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 _0xed40=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','priority','assigned','lastAssignedTo','mohtime','exports','type','inbound','calleridname','queue','position','count','queuecallerabandon'];(function(_0x4ea1cc,_0x3c7ef2){var _0x5a6684=function(_0x5069bb){while(--_0x5069bb){_0x4ea1cc['push'](_0x4ea1cc['shift']());}};_0x5a6684(++_0x3c7ef2);}(_0xed40,0x111));var _0x0ed4=function(_0x1a9e31,_0x2b4a3d){_0x1a9e31=_0x1a9e31-0x0;var _0x205755=_0xed40[_0x1a9e31];return _0x205755;};'use strict';function QueueReport(){this[_0x0ed4('0x0')]=_0x0ed4('0x1');this['uniqueid']='';this['calleridnum']='';this[_0x0ed4('0x2')]='';this[_0x0ed4('0x3')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x0ed4('0x4')]=0x1;this[_0x0ed4('0x5')]=0x1;this[_0x0ed4('0x6')]=![];this[_0x0ed4('0x7')]=null;this[_0x0ed4('0x8')]=![];this[_0x0ed4('0x9')]=null;this[_0x0ed4('0xa')]=![];this[_0x0ed4('0xb')]=null;this[_0x0ed4('0xc')]=0x1;this[_0x0ed4('0xd')]='';this[_0x0ed4('0xe')]='';this['connectedlinename']='';this['accountcode']='';this['context']='';this['exten']='';this[_0x0ed4('0xf')]='';this['holdtime']=0x0;this[_0x0ed4('0x10')]=![];this[_0x0ed4('0x11')]='';this[_0x0ed4('0x12')]=0x0;this['variables']={};}module[_0x0ed4('0x13')]=QueueReport; \ No newline at end of file +var _0x06fd=['position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','exten','priority','holdtime','assigned','mohtime','variables','exports','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0x06fd,0x1aa));var _0xd06f=function(_0x510794,_0x120e85){_0x510794=_0x510794-0x0;var _0x3bd818=_0x06fd[_0x510794];return _0x3bd818;};'use strict';function QueueReport(){this['type']=_0xd06f('0x0');this[_0xd06f('0x1')]='';this[_0xd06f('0x2')]='';this['calleridname']='';this[_0xd06f('0x3')]='';this[_0xd06f('0x4')]=null;this[_0xd06f('0x5')]=null;this[_0xd06f('0x6')]=0x1;this[_0xd06f('0x7')]=0x1;this[_0xd06f('0x8')]=![];this[_0xd06f('0x9')]=null;this[_0xd06f('0xa')]=![];this[_0xd06f('0xb')]=null;this[_0xd06f('0xc')]=![];this[_0xd06f('0xd')]=null;this['originalposition']=0x1;this[_0xd06f('0xe')]='';this[_0xd06f('0xf')]='';this[_0xd06f('0x10')]='';this['accountcode']='';this['context']='';this[_0xd06f('0x11')]='';this[_0xd06f('0x12')]='';this[_0xd06f('0x13')]=0x0;this[_0xd06f('0x14')]=![];this['lastAssignedTo']='';this[_0xd06f('0x15')]=0x0;this[_0xd06f('0x16')]={};}module[_0xd06f('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d313f3e..e2dcc3d 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 _0xdebe=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','type','serverUrl'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0xdebe,0x142));var _0xedeb=function(_0xc76f3c,_0x587f7b){_0xc76f3c=_0xc76f3c-0x0;var _0x2a42e2=_0xdebe[_0xc76f3c];return _0x2a42e2;};'use strict';function SalesforceAccount(_0x22f5e7){this['id']=_0x22f5e7['id']||0x0;this[_0xedeb('0x0')]=_0x22f5e7[_0xedeb('0x0')]||'';this[_0xedeb('0x1')]=_0x22f5e7['username']||'';this[_0xedeb('0x2')]=_0x22f5e7['remoteUri']||'';this[_0xedeb('0x3')]=_0x22f5e7[_0xedeb('0x3')]||'';this['clientId']=_0x22f5e7[_0xedeb('0x4')]||'';this[_0xedeb('0x5')]=_0x22f5e7['clientSecret']||'';this['securityToken']=_0x22f5e7['securityToken']||'';this[_0xedeb('0x6')]=_0x22f5e7[_0xedeb('0x6')]||'integrationTab';this[_0xedeb('0x7')]=_0x22f5e7['serverUrl']||'';this[_0xedeb('0x8')]=_0x22f5e7[_0xedeb('0x8')]||{};}module[_0xedeb('0x9')]=SalesforceAccount; \ No newline at end of file +var _0xc59f=['password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri'];(function(_0x1d8574,_0x110f59){var _0x7f1ff0=function(_0x459f5c){while(--_0x459f5c){_0x1d8574['push'](_0x1d8574['shift']());}};_0x7f1ff0(++_0x110f59);}(_0xc59f,0xe3));var _0xfc59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc59f[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x554602){this['id']=_0x554602['id']||0x0;this[_0xfc59('0x0')]=_0x554602[_0xfc59('0x0')]||'';this[_0xfc59('0x1')]=_0x554602[_0xfc59('0x1')]||'';this[_0xfc59('0x2')]=_0x554602[_0xfc59('0x2')]||'';this[_0xfc59('0x3')]=_0x554602['password']||'';this['clientId']=_0x554602['clientId']||'';this[_0xfc59('0x4')]=_0x554602[_0xfc59('0x4')]||'';this['securityToken']=_0x554602[_0xfc59('0x5')]||'';this[_0xfc59('0x6')]=_0x554602[_0xfc59('0x6')]||_0xfc59('0x7');this['serverUrl']=_0x554602[_0xfc59('0x8')]||'';this['Configurations']=_0x554602[_0xfc59('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 55c1203..652eda9 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 _0xec62=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xec62,0x18a));var _0x2ec6=function(_0x71a70,_0x4e1cdd){_0x71a70=_0x71a70-0x0;var _0x3a2b22=_0xec62[_0x71a70];return _0x3a2b22;};'use strict';function ServicenowAccount(_0x1f0896){this['id']=_0x1f0896['id']||0x0;this[_0x2ec6('0x0')]=_0x1f0896['name']||'';this[_0x2ec6('0x1')]=_0x1f0896[_0x2ec6('0x1')]||'';this['password']=_0x1f0896[_0x2ec6('0x2')]||'';this[_0x2ec6('0x3')]=_0x1f0896[_0x2ec6('0x3')]||'';this['serverUrl']=_0x1f0896[_0x2ec6('0x4')]||'';this[_0x2ec6('0x5')]=_0x1f0896[_0x2ec6('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x67e9=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x575d0,_0x45eb69){var _0x1a6e7b=function(_0x16d607){while(--_0x16d607){_0x575d0['push'](_0x575d0['shift']());}};_0x1a6e7b(++_0x45eb69);}(_0x67e9,0x163));var _0x967e=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0x67e9[_0xf8886b];return _0x321bd5;};'use strict';function ServicenowAccount(_0x2904d3){this['id']=_0x2904d3['id']||0x0;this[_0x967e('0x0')]=_0x2904d3[_0x967e('0x0')]||'';this['username']=_0x2904d3[_0x967e('0x1')]||'';this[_0x967e('0x2')]=_0x2904d3[_0x967e('0x2')]||'';this[_0x967e('0x3')]=_0x2904d3['remoteUri']||'';this[_0x967e('0x4')]=_0x2904d3[_0x967e('0x4')]||'';this[_0x967e('0x5')]=_0x2904d3['Configurations']||{};}module[_0x967e('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 6124a3d..b38ddf8 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 _0xc847=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc847,0x1dc));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x561398){this['id']=_0x561398['id']||0x0;this[_0x7c84('0x0')]=_0x561398[_0x7c84('0x0')]||'';this[_0x7c84('0x1')]=_0x561398[_0x7c84('0x1')]||'';this['password']=_0x561398[_0x7c84('0x2')]||'';this[_0x7c84('0x3')]=_0x561398[_0x7c84('0x3')]||'';this[_0x7c84('0x4')]=_0x561398[_0x7c84('0x4')]||'';this[_0x7c84('0x5')]=_0x561398[_0x7c84('0x5')]||{};}module[_0x7c84('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa6b0=['username','password','Configurations','name'];(function(_0x232ac4,_0x1f5da4){var _0x4b50b7=function(_0x2a7595){while(--_0x2a7595){_0x232ac4['push'](_0x232ac4['shift']());}};_0x4b50b7(++_0x1f5da4);}(_0xa6b0,0xb3));var _0x0a6b=function(_0x355751,_0x598402){_0x355751=_0x355751-0x0;var _0x583152=_0xa6b0[_0x355751];return _0x583152;};'use strict';function SugarcrmAccount(_0x167ed4){this['id']=_0x167ed4['id']||0x0;this[_0x0a6b('0x0')]=_0x167ed4[_0x0a6b('0x0')]||'';this[_0x0a6b('0x1')]=_0x167ed4[_0x0a6b('0x1')]||'';this[_0x0a6b('0x2')]=_0x167ed4[_0x0a6b('0x2')]||'';this['remoteUri']=_0x167ed4['remoteUri']||'';this['serverUrl']=_0x167ed4['serverUrl']||'';this[_0x0a6b('0x3')]=_0x167ed4[_0x0a6b('0x3')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 3127e8e..1d383d1 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 _0x3ba2=['status','unknown','name','accountcode','state','stateTime'];(function(_0x2192e7,_0xb19e41){var _0x40fb76=function(_0x57d782){while(--_0x57d782){_0x2192e7['push'](_0x2192e7['shift']());}};_0x40fb76(++_0xb19e41);}(_0x3ba2,0x158));var _0x23ba=function(_0x3de5fb,_0x200a61){_0x3de5fb=_0x3de5fb-0x0;var _0x2efff0=_0x3ba2[_0x3de5fb];return _0x2efff0;};'use strict';function Telephone(_0x4aa500){this['id']=_0x4aa500['id']||0x0;this['name']=_0x4aa500[_0x23ba('0x0')]||'';this[_0x23ba('0x1')]=_0x4aa500[_0x23ba('0x1')]||'';this[_0x23ba('0x2')]='unknown';this[_0x23ba('0x3')]=0x0;this[_0x23ba('0x4')]=_0x23ba('0x5');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0xed91=['accountcode','unknown','address','exports','name'];(function(_0x54e333,_0x1adf0a){var _0x3ffd7e=function(_0x365e51){while(--_0x365e51){_0x54e333['push'](_0x54e333['shift']());}};_0x3ffd7e(++_0x1adf0a);}(_0xed91,0x185));var _0x1ed9=function(_0x2a36af,_0x21799f){_0x2a36af=_0x2a36af-0x0;var _0x48ef05=_0xed91[_0x2a36af];return _0x48ef05;};'use strict';function Telephone(_0x316aac){this['id']=_0x316aac['id']||0x0;this[_0x1ed9('0x0')]=_0x316aac['name']||'';this['accountcode']=_0x316aac[_0x1ed9('0x1')]||'';this['state']=_0x1ed9('0x2');this['stateTime']=0x0;this['status']=_0x1ed9('0x2');this[_0x1ed9('0x3')]='';}module[_0x1ed9('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ccd8f5f..c706281 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 _0xa9e0=['exports','name'];(function(_0x446e22,_0x168c29){var _0x18ef8d=function(_0x895884){while(--_0x895884){_0x446e22['push'](_0x446e22['shift']());}};_0x18ef8d(++_0x168c29);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x346563,_0x128a8e){var _0x60c770=function(_0x19eb64){while(--_0x19eb64){_0x346563['push'](_0x346563['shift']());}};_0x60c770(++_0x128a8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x6edc85,_0x2c7710){_0x6edc85=_0x6edc85-0x0;var _0x4631a9=_0xb10b[_0x6edc85];return _0x4631a9;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 55aa1a2..c0a9f50 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 _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x0b0e[_0x54a9e3];return _0x247cce;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index eca43bf..1b37cd9 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 _0x076b=['stateRegistry','registrationtime','address','defaultuser','active','name','unknown','stateTime','status','registry','indexOf','split','domainport','refresh'];(function(_0x412818,_0xe8171a){var _0x2d40d1=function(_0xa3099a){while(--_0xa3099a){_0x412818['push'](_0x412818['shift']());}};_0x2d40d1(++_0xe8171a);}(_0x076b,0x1e0));var _0xb076=function(_0x383020,_0x95a975){_0x383020=_0x383020-0x0;var _0x49600e=_0x076b[_0x383020];return _0x49600e;};'use strict';function Trunk(_0x441dec){this['id']=_0x441dec['id']||0x0;this[_0xb076('0x0')]=_0x441dec[_0xb076('0x0')]||![];this[_0xb076('0x1')]=_0x441dec[_0xb076('0x1')]||'';this['state']=_0xb076('0x2');this[_0xb076('0x3')]=0x0;this[_0xb076('0x4')]='unknown';this['registry']=_0x441dec[_0xb076('0x5')]&&_0x441dec[_0xb076('0x5')][_0xb076('0x6')](':')?_0x441dec[_0xb076('0x5')][_0xb076('0x7')](':')[0x0]:'';this['host']='';this['port']='';this['domain']='';this[_0xb076('0x8')]='';this[_0xb076('0x9')]='';this[_0xb076('0xa')]=_0xb076('0x2');this[_0xb076('0xb')]='';this[_0xb076('0xc')]='';this['defaultuser']=_0x441dec[_0xb076('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0xbd75=['domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port'];(function(_0x5d5e88,_0x4b3068){var _0x4cea64=function(_0x1b0f6d){while(--_0x1b0f6d){_0x5d5e88['push'](_0x5d5e88['shift']());}};_0x4cea64(++_0x4b3068);}(_0xbd75,0x7e));var _0x5bd7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbd75[_0x20a584];return _0x4b41a8;};'use strict';function Trunk(_0x46eb74){this['id']=_0x46eb74['id']||0x0;this[_0x5bd7('0x0')]=_0x46eb74[_0x5bd7('0x0')]||![];this[_0x5bd7('0x1')]=_0x46eb74[_0x5bd7('0x1')]||'';this['state']=_0x5bd7('0x2');this[_0x5bd7('0x3')]=0x0;this[_0x5bd7('0x4')]=_0x5bd7('0x2');this[_0x5bd7('0x5')]=_0x46eb74[_0x5bd7('0x5')]&&_0x46eb74['registry'][_0x5bd7('0x6')](':')?_0x46eb74[_0x5bd7('0x5')][_0x5bd7('0x7')](':')[0x0]:'';this[_0x5bd7('0x8')]='';this[_0x5bd7('0x9')]='';this[_0x5bd7('0xa')]='';this[_0x5bd7('0xb')]='';this['refresh']='';this[_0x5bd7('0xc')]=_0x5bd7('0x2');this[_0x5bd7('0xd')]='';this[_0x5bd7('0xe')]='';this[_0x5bd7('0xf')]=_0x46eb74['defaultuser']||'';}module[_0x5bd7('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 1b24208..0ec7ccd 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 _0x6cc3=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x45c95a,_0xbe2777){var _0x5589d7=function(_0x175323){while(--_0x175323){_0x45c95a['push'](_0x45c95a['shift']());}};_0x5589d7(++_0xbe2777);}(_0x6cc3,0xd2));var _0x36cc=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x6cc3[_0x3d27a];return _0x314fd7;};'use strict';function voiceExtension(_0x19545c){this['id']=_0x19545c['id']||0x0;this[_0x36cc('0x0')]=_0x19545c['exten']||'';this[_0x36cc('0x1')]=_0x19545c[_0x36cc('0x1')]||'none';this[_0x36cc('0x2')]=_0x19545c[_0x36cc('0x2')]||![];}module[_0x36cc('0x3')]=voiceExtension; \ No newline at end of file +var _0x6d49=['mandatoryDisposition','exten','none'];(function(_0x5ca901,_0x3df575){var _0x122bce=function(_0x2160cc){while(--_0x2160cc){_0x5ca901['push'](_0x5ca901['shift']());}};_0x122bce(++_0x3df575);}(_0x6d49,0x1de));var _0x96d4=function(_0x2fea83,_0x145e5e){_0x2fea83=_0x2fea83-0x0;var _0x55c033=_0x6d49[_0x2fea83];return _0x55c033;};'use strict';function voiceExtension(_0x12c428){this['id']=_0x12c428['id']||0x0;this[_0x96d4('0x0')]=_0x12c428[_0x96d4('0x0')]||'';this['recordingFormat']=_0x12c428['recordingFormat']||_0x96d4('0x1');this[_0x96d4('0x2')]=_0x12c428[_0x96d4('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ac14a70..764defb 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 _0xf34b=['dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval'];(function(_0x15db4f,_0x228267){var _0x3009d0=function(_0x2aacf1){while(--_0x2aacf1){_0x15db4f['push'](_0x15db4f['shift']());}};_0x3009d0(++_0x228267);}(_0xf34b,0xb1));var _0xbf34=function(_0x5a1fe8,_0x277b0b){_0x5a1fe8=_0x5a1fe8-0x0;var _0xb221f5=_0xf34b[_0x5a1fe8];return _0xb221f5;};'use strict';var statusDesc=[_0xbf34('0x0'),_0xbf34('0x1'),_0xbf34('0x2'),_0xbf34('0x3'),'invalid',_0xbf34('0x4'),_0xbf34('0x5'),_0xbf34('0x6'),_0xbf34('0x7')];var monitorFormat={'wav':_0xbf34('0x8'),'wav49':_0xbf34('0x9'),'gsm':_0xbf34('0xa')};var strategy={'rrmemory':_0xbf34('0xb'),'roundrobin':_0xbf34('0xc')};function VoiceQueue(_0x4a809f){this['id']=_0x4a809f['id']||0x0;this['name']=_0x4a809f[_0xbf34('0xd')]||'';this[_0xbf34('0xe')]=_0x4a809f[_0xbf34('0xe')]||'';this[_0xbf34('0xf')]=_0x4a809f[_0xbf34('0xf')]||'inbound';this[_0xbf34('0x10')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0xbf34('0x11')]=0x0;this[_0xbf34('0x12')]=0x0;this[_0xbf34('0x13')]=0x0;this[_0xbf34('0x14')]=0x0;this[_0xbf34('0x15')]=0x0;this[_0xbf34('0x16')]=0x0;this[_0xbf34('0x17')]=0x0;this['available']=0x0;this['acw']=_0x4a809f[_0xbf34('0x18')]||![];this[_0xbf34('0x19')]=_0x4a809f[_0xbf34('0x19')]||0xa;this[_0xbf34('0x1a')]=_0x4a809f[_0xbf34('0x1a')]||'no';this[_0xbf34('0x1b')]=!![];this[_0xbf34('0x1c')]='';this[_0xbf34('0x1d')]=0x0;this['temp']=0x0;this[_0xbf34('0x1e')]=_0x4a809f['dialTimezone']||null;this['dialGlobalInterval']=_0x4a809f[_0xbf34('0x1f')]?_0x4a809f[_0xbf34('0x1f')]:null;this['dialActive']=_0x4a809f['dialActive'];this[_0xbf34('0x20')]=_0x4a809f[_0xbf34('0x20')]||_0xbf34('0x21');this[_0xbf34('0x22')]=_0x4a809f[_0xbf34('0x22')]||0x0;this['dialLimitQueue']=_0x4a809f[_0xbf34('0x23')]||0x0;this[_0xbf34('0x24')]=_0x4a809f[_0xbf34('0x24')]||0x1;this[_0xbf34('0x25')]=_0x4a809f['dialPredictiveOptimization']||_0xbf34('0x26');this[_0xbf34('0x27')]=_0x4a809f['dialPredictiveOptimizationPercentage']||0.03;this[_0xbf34('0x28')]=_0x4a809f[_0xbf34('0x28')]||0x258;this[_0xbf34('0x29')]=_0x4a809f[_0xbf34('0x29')]||'anonymous';this[_0xbf34('0x2a')]=_0x4a809f[_0xbf34('0x2a')]||_0xbf34('0x2b');this[_0xbf34('0x2c')]=_0x4a809f['dialOriginateTimeout']||0x1e;this[_0xbf34('0x2d')]=_0x4a809f['dialQueueOptions']||_0xbf34('0x2e');this[_0xbf34('0x2f')]=_0x4a809f[_0xbf34('0x2f')]||0x3;this[_0xbf34('0x30')]=_0x4a809f['dialQueueProject']||undefined;this[_0xbf34('0x31')]=_0x4a809f[_0xbf34('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x4a809f['dialCongestionRetryFrequency']||0x96;this[_0xbf34('0x32')]=_0x4a809f[_0xbf34('0x32')]||0x3;this[_0xbf34('0x33')]=_0x4a809f['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x4a809f['dialNoAnswerMaxRetry']||0x3;this[_0xbf34('0x34')]=_0x4a809f[_0xbf34('0x34')]||0x96;this[_0xbf34('0x35')]=_0x4a809f['dialNoSuchNumberMaxRetry']||0x3;this[_0xbf34('0x36')]=_0x4a809f['dialNoSuchNumberRetryFrequency']||0x96;this[_0xbf34('0x37')]=_0x4a809f[_0xbf34('0x37')]||0x3;this['dialDropRetryFrequency']=_0x4a809f['dialDropRetryFrequency']||0x96;this[_0xbf34('0x38')]=_0x4a809f['dialAbandonedMaxRetry']||0x3;this[_0xbf34('0x39')]=_0x4a809f[_0xbf34('0x39')]||0x96;this[_0xbf34('0x3a')]=_0x4a809f[_0xbf34('0x3a')]||0x3;this[_0xbf34('0x3b')]=_0x4a809f['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x4a809f[_0xbf34('0x3c')]||0x3;this[_0xbf34('0x3d')]=_0x4a809f['dialAgentRejectRetryFrequency']||0x96;this[_0xbf34('0x3e')]=_0x4a809f[_0xbf34('0x3e')]||0x4;this['Trunk']=_0x4a809f[_0xbf34('0x3f')]?_0x4a809f[_0xbf34('0x3f')]:undefined;this['TrunkBackup']=_0x4a809f[_0xbf34('0x40')]?_0x4a809f[_0xbf34('0x40')]:undefined;this[_0xbf34('0x41')]=_0x4a809f['dialPrefix']||undefined;this['Interval']=_0x4a809f[_0xbf34('0x42')]?_0x4a809f[_0xbf34('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x4a809f[_0xbf34('0x43')]||_0xbf34('0x44');this[_0xbf34('0x45')]=_0x4a809f[_0xbf34('0x45')]||undefined;this[_0xbf34('0x46')]=_0x4a809f[_0xbf34('0x46')]||undefined;this['strategy']=strategy[_0x4a809f[_0xbf34('0x47')]]||_0xbf34('0xb');this[_0xbf34('0x48')]=!![];this[_0xbf34('0x49')]=_0x4a809f[_0xbf34('0x49')]||![];this[_0xbf34('0x4a')]=_0x4a809f[_0xbf34('0x4a')];this['dialAMDGreeting']=_0x4a809f[_0xbf34('0x4b')];this[_0xbf34('0x4c')]=_0x4a809f[_0xbf34('0x4c')];this['dialAMDTotalAnalysisTime']=_0x4a809f[_0xbf34('0x4d')];this[_0xbf34('0x4e')]=_0x4a809f[_0xbf34('0x4e')];this[_0xbf34('0x4f')]=_0x4a809f[_0xbf34('0x4f')];this[_0xbf34('0x50')]=_0x4a809f[_0xbf34('0x50')];this[_0xbf34('0x51')]=_0x4a809f['dialAMDSilenceThreshold'];this[_0xbf34('0x52')]=_0x4a809f[_0xbf34('0x52')];this[_0xbf34('0x53')]=0x0;this[_0xbf34('0x54')]=0x0;this[_0xbf34('0x55')]=_0x4a809f['timeout'];this[_0xbf34('0x56')]=0x0;this[_0xbf34('0x57')]=0x0;this[_0xbf34('0x58')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xbf34('0x59')]=0x0;this[_0xbf34('0x5a')]=0x0;this[_0xbf34('0x5b')]=0x0;this[_0xbf34('0x5c')]=0x0;this[_0xbf34('0x5d')]=0x0;this[_0xbf34('0x5e')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xbf34('0x5f')]=0x0;this[_0xbf34('0x60')]=undefined;this[_0xbf34('0x61')]=undefined;this[_0xbf34('0x62')]=undefined;this[_0xbf34('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xbf34('0x64')]=0x0;this[_0xbf34('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xbf34('0x66')]=0x0;this[_0xbf34('0x67')]=0x0;this[_0xbf34('0x68')]=0x0;this[_0xbf34('0x69')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4a809f[_0xbf34('0x6a')]||0x14;this[_0xbf34('0x6b')]=_0x4a809f[_0xbf34('0x6a')]||0xa;this[_0xbf34('0x6c')]=0x0;this[_0xbf34('0x6d')]=0x0;this[_0xbf34('0x6e')]=0x1;this[_0xbf34('0x6f')]=0x0;this[_0xbf34('0x70')]=0x0;this[_0xbf34('0x71')]=0x0;this[_0xbf34('0x72')]=0x0;this['dialRecallMeTimeout']=_0x4a809f[_0xbf34('0x73')]||0x1e;this[_0xbf34('0x74')]=_0x4a809f['dialRecallInQueue']||![];this[_0xbf34('0x75')]=_0x4a809f[_0xbf34('0x75')]||undefined;this[_0xbf34('0x76')]=_0x4a809f[_0xbf34('0x76')]||![];this[_0xbf34('0x77')]=_0x4a809f['dialAgiAfterHangupAgent']||![];this[_0xbf34('0xe')]=monitorFormat[_0x4a809f[_0xbf34('0xe')]]?monitorFormat[_0x4a809f['monitor_format']]:undefined;this[_0xbf34('0x78')]=_0x4a809f['mandatoryDisposition']||![];this[_0xbf34('0x79')]=_0x4a809f[_0xbf34('0x79')]?_0x4a809f['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0xe19e=['outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','acw','acwTimeout','autopause','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe19e,0x93));var _0xee19=function(_0x18f654,_0x350dd3){_0x18f654=_0x18f654-0x0;var _0x66471a=_0xe19e[_0x18f654];return _0x66471a;};'use strict';var statusDesc=[_0xee19('0x0'),_0xee19('0x1'),_0xee19('0x2'),_0xee19('0x3'),_0xee19('0x4'),_0xee19('0x5'),_0xee19('0x6'),_0xee19('0x7'),'onhold'];var monitorFormat={'wav':_0xee19('0x8'),'wav49':_0xee19('0x9'),'gsm':_0xee19('0xa')};var strategy={'rrmemory':_0xee19('0xb'),'roundrobin':_0xee19('0xc')};function VoiceQueue(_0x855f38){this['id']=_0x855f38['id']||0x0;this[_0xee19('0xd')]=_0x855f38[_0xee19('0xd')]||'';this[_0xee19('0xe')]=_0x855f38[_0xee19('0xe')]||'';this[_0xee19('0xf')]=_0x855f38[_0xee19('0xf')]||_0xee19('0x10');this[_0xee19('0x11')]=0x0;this[_0xee19('0x12')]=0x0;this['total']=0x0;this[_0xee19('0x13')]=0x0;this[_0xee19('0x14')]=0x0;this[_0xee19('0x15')]=0x0;this[_0xee19('0x16')]=0x0;this[_0xee19('0x17')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0xee19('0x18')]=0x0;this[_0xee19('0x19')]=_0x855f38['acw']||![];this[_0xee19('0x1a')]=_0x855f38[_0xee19('0x1a')]||0xa;this[_0xee19('0x1b')]=_0x855f38[_0xee19('0x1b')]||'no';this['sendMessageOneNotActive']=!![];this[_0xee19('0x1c')]='';this['originated']=0x0;this['temp']=0x0;this[_0xee19('0x1d')]=_0x855f38[_0xee19('0x1d')]||null;this[_0xee19('0x1e')]=_0x855f38['dialGlobalInterval']?_0x855f38[_0xee19('0x1e')]:null;this[_0xee19('0x1f')]=_0x855f38['dialActive'];this[_0xee19('0x20')]=_0x855f38[_0xee19('0x20')]||_0xee19('0x21');this[_0xee19('0x22')]=_0x855f38[_0xee19('0x22')]||0x0;this[_0xee19('0x23')]=_0x855f38[_0xee19('0x23')]||0x0;this[_0xee19('0x24')]=_0x855f38[_0xee19('0x24')]||0x1;this[_0xee19('0x25')]=_0x855f38['dialPredictiveOptimization']||_0xee19('0x26');this[_0xee19('0x27')]=_0x855f38[_0xee19('0x27')]||0.03;this['dialPredictiveInterval']=_0x855f38[_0xee19('0x28')]||0x258;this['dialOriginateCallerIdName']=_0x855f38[_0xee19('0x29')]||'anonymous';this[_0xee19('0x2a')]=_0x855f38[_0xee19('0x2a')]||'anonymous';this[_0xee19('0x2b')]=_0x855f38[_0xee19('0x2b')]||0x1e;this[_0xee19('0x2c')]=_0x855f38[_0xee19('0x2c')]||'tTxX';this['dialQueueTimeout']=_0x855f38[_0xee19('0x2d')]||0x3;this['dialQueueProject']=_0x855f38[_0xee19('0x2e')]||undefined;this[_0xee19('0x2f')]=_0x855f38[_0xee19('0x2f')]||0x3;this[_0xee19('0x30')]=_0x855f38[_0xee19('0x30')]||0x96;this[_0xee19('0x31')]=_0x855f38['dialBusyMaxRetry']||0x3;this[_0xee19('0x32')]=_0x855f38['dialBusyRetryFrequency']||0x96;this[_0xee19('0x33')]=_0x855f38[_0xee19('0x33')]||0x3;this[_0xee19('0x34')]=_0x855f38['dialNoAnswerRetryFrequency']||0x96;this[_0xee19('0x35')]=_0x855f38[_0xee19('0x35')]||0x3;this[_0xee19('0x36')]=_0x855f38[_0xee19('0x36')]||0x96;this[_0xee19('0x37')]=_0x855f38[_0xee19('0x37')]||0x3;this[_0xee19('0x38')]=_0x855f38[_0xee19('0x38')]||0x96;this[_0xee19('0x39')]=_0x855f38[_0xee19('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x855f38[_0xee19('0x3a')]||0x96;this[_0xee19('0x3b')]=_0x855f38[_0xee19('0x3b')]||0x3;this[_0xee19('0x3c')]=_0x855f38[_0xee19('0x3c')]||0x96;this[_0xee19('0x3d')]=_0x855f38[_0xee19('0x3d')]||0x3;this[_0xee19('0x3e')]=_0x855f38[_0xee19('0x3e')]||0x96;this[_0xee19('0x3f')]=_0x855f38['dialGlobalMaxRetry']||0x4;this[_0xee19('0x40')]=_0x855f38[_0xee19('0x40')]?_0x855f38[_0xee19('0x40')]:undefined;this['TrunkBackup']=_0x855f38['TrunkBackup']?_0x855f38[_0xee19('0x41')]:undefined;this[_0xee19('0x42')]=_0x855f38[_0xee19('0x42')]||undefined;this[_0xee19('0x43')]=_0x855f38['Interval']?_0x855f38[_0xee19('0x43')]:undefined;this[_0xee19('0x44')]=_0x855f38[_0xee19('0x44')]||_0xee19('0x45');this[_0xee19('0x46')]=_0x855f38[_0xee19('0x46')]||undefined;this[_0xee19('0x47')]=_0x855f38[_0xee19('0x47')]||undefined;this[_0xee19('0x48')]=strategy[_0x855f38[_0xee19('0x48')]]||_0xee19('0xb');this[_0xee19('0x49')]=!![];this[_0xee19('0x4a')]=_0x855f38['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x855f38[_0xee19('0x4b')];this[_0xee19('0x4c')]=_0x855f38[_0xee19('0x4c')];this[_0xee19('0x4d')]=_0x855f38[_0xee19('0x4d')];this[_0xee19('0x4e')]=_0x855f38[_0xee19('0x4e')];this['dialAMDMinWordLength']=_0x855f38[_0xee19('0x4f')];this[_0xee19('0x50')]=_0x855f38[_0xee19('0x50')];this[_0xee19('0x51')]=_0x855f38[_0xee19('0x51')];this[_0xee19('0x52')]=_0x855f38[_0xee19('0x52')];this[_0xee19('0x53')]=_0x855f38['dialAMDMaximumWordLength'];this[_0xee19('0x54')]=0x0;this['pTalking']=0x0;this[_0xee19('0x55')]=_0x855f38[_0xee19('0x55')];this[_0xee19('0x56')]=0x0;this[_0xee19('0x57')]=0x0;this[_0xee19('0x58')]=0x0;this[_0xee19('0x59')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xee19('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xee19('0x5b')]=0x0;this[_0xee19('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xee19('0x5d')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xee19('0x5e')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xee19('0x5f')]=undefined;this[_0xee19('0x60')]=undefined;this[_0xee19('0x61')]=1.05;this[_0xee19('0x62')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xee19('0x63')]=0x0;this[_0xee19('0x64')]=0x0;this[_0xee19('0x65')]=0x0;this[_0xee19('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xee19('0x67')]=_0x855f38[_0xee19('0x68')]||0x14;this[_0xee19('0x69')]=_0x855f38[_0xee19('0x68')]||0xa;this[_0xee19('0x6a')]=0x0;this[_0xee19('0x6b')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xee19('0x6c')]=0x0;this[_0xee19('0x6d')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xee19('0x6e')]=0x0;this[_0xee19('0x6f')]=_0x855f38[_0xee19('0x6f')]||0x1e;this['dialRecallInQueue']=_0x855f38[_0xee19('0x70')]||![];this[_0xee19('0x71')]=_0x855f38[_0xee19('0x71')]||undefined;this[_0xee19('0x72')]=_0x855f38[_0xee19('0x72')]||![];this[_0xee19('0x73')]=_0x855f38[_0xee19('0x73')]||![];this[_0xee19('0xe')]=monitorFormat[_0x855f38[_0xee19('0xe')]]?monitorFormat[_0x855f38[_0xee19('0xe')]]:undefined;this[_0xee19('0x74')]=_0x855f38[_0xee19('0x74')]||![];this[_0xee19('0x75')]=_0x855f38[_0xee19('0x75')]?_0x855f38[_0xee19('0x75')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 5eab7c0..d7eb54d 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 _0xdb70=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x23b117,_0x500081){var _0x4c8a54=function(_0x2175dc){while(--_0x2175dc){_0x23b117['push'](_0x23b117['shift']());}};_0x4c8a54(++_0x500081);}(_0xdb70,0xa0));var _0x0db7=function(_0x54f859,_0x59d463){_0x54f859=_0x54f859-0x0;var _0x17a08b=_0xdb70[_0x54f859];return _0x17a08b;};'use strict';function VtigerAccount(_0x1c9665){this['id']=_0x1c9665['id']||0x0;this[_0x0db7('0x0')]=_0x1c9665[_0x0db7('0x0')]||'';this['username']=_0x1c9665[_0x0db7('0x1')]||'';this[_0x0db7('0x2')]=_0x1c9665[_0x0db7('0x2')]||'';this[_0x0db7('0x3')]=_0x1c9665[_0x0db7('0x3')]||'';this[_0x0db7('0x4')]=_0x1c9665[_0x0db7('0x4')]||'';this[_0x0db7('0x5')]=_0x1c9665[_0x0db7('0x5')]||{};}module[_0x0db7('0x6')]=VtigerAccount; \ No newline at end of file +var _0xd59d=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x788da2,_0x463ae7){var _0x1b4cf1=function(_0x30fb1e){while(--_0x30fb1e){_0x788da2['push'](_0x788da2['shift']());}};_0x1b4cf1(++_0x463ae7);}(_0xd59d,0x81));var _0xdd59=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xd59d[_0x92c450];return _0x2a9599;};'use strict';function VtigerAccount(_0x5e16ea){this['id']=_0x5e16ea['id']||0x0;this['name']=_0x5e16ea[_0xdd59('0x0')]||'';this[_0xdd59('0x1')]=_0x5e16ea[_0xdd59('0x1')]||'';this[_0xdd59('0x2')]=_0x5e16ea[_0xdd59('0x2')]||'';this[_0xdd59('0x3')]=_0x5e16ea['remoteUri']||'';this[_0xdd59('0x4')]=_0x5e16ea[_0xdd59('0x4')]||'';this['Configurations']=_0x5e16ea[_0xdd59('0x5')]||{};}module[_0xdd59('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index d5c76e4..4f3ea14 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 _0x9430=['authType','type','integrationTab','serverUrl','Configurations','name','username','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9430,0x1ad));var _0x0943=function(_0x22cad6,_0x419e11){_0x22cad6=_0x22cad6-0x0;var _0x2a97a7=_0x9430[_0x22cad6];return _0x2a97a7;};'use strict';function ZendeskAccount(_0x4e8455){this['id']=_0x4e8455['id']||0x0;this['name']=_0x4e8455[_0x0943('0x0')]||'';this[_0x0943('0x1')]=_0x4e8455[_0x0943('0x1')]||'';this['password']=_0x4e8455['password']||'';this['token']=_0x4e8455['token']||'';this[_0x0943('0x2')]=_0x4e8455['remoteUri']||'';this[_0x0943('0x3')]=_0x4e8455[_0x0943('0x3')]||'';this[_0x0943('0x4')]=_0x4e8455[_0x0943('0x4')]||_0x0943('0x5');this['serverUrl']=_0x4e8455[_0x0943('0x6')]||'';this[_0x0943('0x7')]=_0x4e8455[_0x0943('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x7eba=['name','username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations'];(function(_0x382acd,_0x5ac8ff){var _0x18baf8=function(_0x37da6f){while(--_0x37da6f){_0x382acd['push'](_0x382acd['shift']());}};_0x18baf8(++_0x5ac8ff);}(_0x7eba,0x156));var _0xa7eb=function(_0x12d3c3,_0x188e55){_0x12d3c3=_0x12d3c3-0x0;var _0x240358=_0x7eba[_0x12d3c3];return _0x240358;};'use strict';function ZendeskAccount(_0x440498){this['id']=_0x440498['id']||0x0;this[_0xa7eb('0x0')]=_0x440498[_0xa7eb('0x0')]||'';this[_0xa7eb('0x1')]=_0x440498[_0xa7eb('0x1')]||'';this[_0xa7eb('0x2')]=_0x440498[_0xa7eb('0x2')]||'';this[_0xa7eb('0x3')]=_0x440498[_0xa7eb('0x3')]||'';this['remoteUri']=_0x440498[_0xa7eb('0x4')]||'';this[_0xa7eb('0x5')]=_0x440498['authType']||'';this['type']=_0x440498['type']||_0xa7eb('0x6');this[_0xa7eb('0x7')]=_0x440498['serverUrl']||'';this[_0xa7eb('0x8')]=_0x440498[_0xa7eb('0x8')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index f14dd6e..fcb38a3 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 _0xda0b=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name'];(function(_0x24df23,_0x104a7c){var _0x16a77d=function(_0x2f0bd9){while(--_0x2f0bd9){_0x24df23['push'](_0x24df23['shift']());}};_0x16a77d(++_0x104a7c);}(_0xda0b,0xc7));var _0xbda0=function(_0x186f5a,_0x57034e){_0x186f5a=_0x186f5a-0x0;var _0x3944ef=_0xda0b[_0x186f5a];return _0x3944ef;};'use strict';function ZohoAccount(_0x1315d4){this['id']=_0x1315d4['id']||0x0;this[_0xbda0('0x0')]=_0x1315d4[_0xbda0('0x0')]||'';this[_0xbda0('0x1')]=_0x1315d4[_0xbda0('0x1')]||'';this[_0xbda0('0x2')]=_0x1315d4[_0xbda0('0x2')]||'';this[_0xbda0('0x3')]=_0x1315d4[_0xbda0('0x3')]||'';this[_0xbda0('0x4')]=_0x1315d4[_0xbda0('0x4')]||'';this[_0xbda0('0x5')]=_0x1315d4[_0xbda0('0x5')]||'';this[_0xbda0('0x6')]=_0x1315d4[_0xbda0('0x6')]||'';this[_0xbda0('0x7')]=_0x1315d4[_0xbda0('0x7')]||'';this['refreshToken']=_0x1315d4[_0xbda0('0x8')]||'';this[_0xbda0('0x9')]=_0x1315d4[_0xbda0('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xbf07=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x1dac7a,_0x1828ce){var _0x4cb363=function(_0x80f6de){while(--_0x80f6de){_0x1dac7a['push'](_0x1dac7a['shift']());}};_0x4cb363(++_0x1828ce);}(_0xbf07,0x68));var _0x7bf0=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xbf07[_0x53b8e0];return _0x10630c;};'use strict';function ZohoAccount(_0x3c2081){this['id']=_0x3c2081['id']||0x0;this[_0x7bf0('0x0')]=_0x3c2081[_0x7bf0('0x0')]||'';this[_0x7bf0('0x1')]=_0x3c2081[_0x7bf0('0x1')]||'';this[_0x7bf0('0x2')]=_0x3c2081[_0x7bf0('0x2')]||'';this[_0x7bf0('0x3')]=_0x3c2081[_0x7bf0('0x3')]||'';this[_0x7bf0('0x4')]=_0x3c2081[_0x7bf0('0x4')]||'';this[_0x7bf0('0x5')]=_0x3c2081[_0x7bf0('0x5')]||'';this[_0x7bf0('0x6')]=_0x3c2081[_0x7bf0('0x6')]||'';this[_0x7bf0('0x7')]=_0x3c2081[_0x7bf0('0x7')]||'';this[_0x7bf0('0x8')]=_0x3c2081[_0x7bf0('0x8')]||'';this[_0x7bf0('0x9')]=_0x3c2081[_0x7bf0('0x9')]||{};}module[_0x7bf0('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 70673b6..6c7b2f2 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 _0x3546=['moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x3546,0x1b6));var _0x6354=function(_0x3e5f6d,_0x121db6){_0x3e5f6d=_0x3e5f6d-0x0;var _0x1bea6e=_0x3546[_0x3e5f6d];return _0x1bea6e;};'use strict';var util=require(_0x6354('0x0'));var _=require(_0x6354('0x1'));var moment=require(_0x6354('0x2'));function checkNameSurname(_0x4db6ba,_0x2e226e,_0x4340d0){var _0x40d62e='';if(!_[_0x6354('0x3')](_0x2e226e)&&_0x6354('0x4')===typeof _0x2e226e){_0x40d62e+=_0x2e226e;}if(!_['isNil'](_0x4340d0)&&_0x6354('0x4')===typeof _0x4340d0){_0x40d62e+='\x20'+_0x4340d0;}if(_0x40d62e!==''){return _0x40d62e;}return _0x4db6ba;}function Action(_0x8c55b2,_0x47f07d,_0xb7a303,_0x4353b6,_0x12e7aa){this[_0x6354('0x5')]=_0xb7a303||undefined;this['idContact']=_0x8c55b2['id'];this[_0x6354('0x6')]=_0x47f07d[_0x6354('0x7')];this[_0x6354('0x8')]=_0x47f07d[_0x6354('0x8')];this[_0x6354('0x9')]=_0x6354('0x6');this[_0x6354('0xa')]=![];this[_0x6354('0xb')]=_[_0x6354('0x3')](_0x8c55b2[_0x6354('0xc')])?undefined:_0x8c55b2[_0x6354('0xc')][_0x6354('0x7')];this[_0x6354('0xd')]=this[_0x6354('0xb')]?util[_0x6354('0xe')](_0x6354('0xf'),this[_0x6354('0xb')]):_0x4353b6||undefined;this[_0x6354('0x10')]=checkNameSurname(_0x8c55b2['Contact'][_0x6354('0x11')],_0x8c55b2[_0x6354('0x12')][_0x6354('0x13')],_0x8c55b2[_0x6354('0x12')][_0x6354('0x14')]);this[_0x6354('0x15')]=_0x8c55b2[_0x6354('0x15')]||![];this['calleridnum']=_0x8c55b2[_0x6354('0x12')][_0x6354('0x11')];this[_0x6354('0x16')]=_0x8c55b2[_0x6354('0x16')];this[_0x6354('0x17')]=_0x8c55b2['countbusyretry']||0x0;this['countcongestionretry']=_0x8c55b2[_0x6354('0x18')]||0x0;this[_0x6354('0x19')]=_0x8c55b2['countnoanswerretry']||0x0;this['countglobal']=(_0x8c55b2[_0x6354('0x17')]||0x0)+(_0x8c55b2[_0x6354('0x18')]||0x0)+(_0x8c55b2[_0x6354('0x19')]||0x0)+(_0x8c55b2[_0x6354('0x1a')]||0x0)+(_0x8c55b2[_0x6354('0x1b')]||0x0)+(_0x8c55b2[_0x6354('0x1c')]||0x0)+(_0x8c55b2['countmachineretry']||0x0)+(_0x8c55b2[_0x6354('0x1d')]||0x0);this[_0x6354('0x1a')]=_0x8c55b2[_0x6354('0x1a')]||0x0;this[_0x6354('0x1b')]=_0x8c55b2[_0x6354('0x1b')]||0x0;this[_0x6354('0x1c')]=_0x8c55b2[_0x6354('0x1c')]||0x0;this[_0x6354('0x1e')]=_0x8c55b2['countmachineretry']||0x0;this['countagentrejectretry']=_0x8c55b2[_0x6354('0x1d')]||0x0;this['callback']=_0x8c55b2[_0x6354('0x1f')];this['callbackuniqueid']=_0x8c55b2[_0x6354('0x20')];this['callbackat']=_0x8c55b2['callbackat'];this[_0x6354('0x21')]=_0x8c55b2[_0x6354('0x21')];this[_0x6354('0x22')]=_0x8c55b2[_0x6354('0x22')];this['ListId']=_0x8c55b2[_0x6354('0x23')];this[_0x6354('0x24')]=_[_0x6354('0x3')](_0x8c55b2[_0x6354('0xc')])?_0x8c55b2['UserId']:_0x8c55b2['Agent']['id'];this[_0x6354('0x25')]=_0x8c55b2['VoiceQueueId'];this[_0x6354('0x26')]='';this[_0x6354('0x27')]='';}Action[_0x6354('0x28')]['getCaller']=function(){return util[_0x6354('0xe')](_0x6354('0x29'),this['calleridname'],this[_0x6354('0x2a')]);};module[_0x6354('0x2b')]=Action; \ No newline at end of file +var _0xafe7=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','format','calleridname','Contact','phone','firstName','lastName','active'];(function(_0xcf098d,_0x1b9e69){var _0x99daff=function(_0x3aedcc){while(--_0x3aedcc){_0xcf098d['push'](_0xcf098d['shift']());}};_0x99daff(++_0x1b9e69);}(_0xafe7,0x9c));var _0x7afe=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xafe7[_0x13d07a];return _0x5ee0ee;};'use strict';var util=require(_0x7afe('0x0'));var _=require(_0x7afe('0x1'));var moment=require(_0x7afe('0x2'));function checkNameSurname(_0x4e6c1b,_0x4f87e3,_0x558932){var _0x30ab1f='';if(!_[_0x7afe('0x3')](_0x4f87e3)&&'string'===typeof _0x4f87e3){_0x30ab1f+=_0x4f87e3;}if(!_[_0x7afe('0x3')](_0x558932)&&_0x7afe('0x4')===typeof _0x558932){_0x30ab1f+='\x20'+_0x558932;}if(_0x30ab1f!==''){return _0x30ab1f;}return _0x4e6c1b;}function Action(_0x248000,_0x1d4bc2,_0x29a015,_0x5b0ed4,_0x67f959){this[_0x7afe('0x5')]=_0x29a015||undefined;this[_0x7afe('0x6')]=_0x248000['id'];this[_0x7afe('0x7')]=_0x1d4bc2[_0x7afe('0x8')];this[_0x7afe('0x9')]=_0x1d4bc2[_0x7afe('0x9')];this['campaigntype']=_0x7afe('0x7');this[_0x7afe('0xa')]=![];this[_0x7afe('0xb')]=_['isNil'](_0x248000[_0x7afe('0xc')])?undefined:_0x248000[_0x7afe('0xc')][_0x7afe('0x8')];this['channelAgent']=this[_0x7afe('0xb')]?util[_0x7afe('0xd')]('SIP/%s',this[_0x7afe('0xb')]):_0x5b0ed4||undefined;this[_0x7afe('0xe')]=checkNameSurname(_0x248000[_0x7afe('0xf')][_0x7afe('0x10')],_0x248000[_0x7afe('0xf')][_0x7afe('0x11')],_0x248000[_0x7afe('0xf')][_0x7afe('0x12')]);this[_0x7afe('0x13')]=_0x248000[_0x7afe('0x13')]||![];this[_0x7afe('0x14')]=_0x248000[_0x7afe('0xf')]['phone'];this[_0x7afe('0x15')]=_0x248000['scheduledat'];this[_0x7afe('0x16')]=_0x248000[_0x7afe('0x16')]||0x0;this[_0x7afe('0x17')]=_0x248000[_0x7afe('0x17')]||0x0;this['countnoanswerretry']=_0x248000['countnoanswerretry']||0x0;this[_0x7afe('0x18')]=(_0x248000[_0x7afe('0x16')]||0x0)+(_0x248000[_0x7afe('0x17')]||0x0)+(_0x248000['countnoanswerretry']||0x0)+(_0x248000['countnosuchnumberretry']||0x0)+(_0x248000[_0x7afe('0x19')]||0x0)+(_0x248000[_0x7afe('0x1a')]||0x0)+(_0x248000['countmachineretry']||0x0)+(_0x248000[_0x7afe('0x1b')]||0x0);this[_0x7afe('0x1c')]=_0x248000['countnosuchnumberretry']||0x0;this[_0x7afe('0x19')]=_0x248000[_0x7afe('0x19')]||0x0;this[_0x7afe('0x1a')]=_0x248000[_0x7afe('0x1a')]||0x0;this['countmachineretry']=_0x248000['countmachineretry']||0x0;this[_0x7afe('0x1b')]=_0x248000['countagentrejectretry']||0x0;this[_0x7afe('0x1d')]=_0x248000['callback'];this[_0x7afe('0x1e')]=_0x248000[_0x7afe('0x1e')];this[_0x7afe('0x1f')]=_0x248000[_0x7afe('0x1f')];this[_0x7afe('0x20')]=_0x248000['recallme'];this[_0x7afe('0x21')]=_0x248000[_0x7afe('0x21')];this[_0x7afe('0x22')]=_0x248000['ListId'];this[_0x7afe('0x23')]=_[_0x7afe('0x3')](_0x248000['Agent'])?_0x248000[_0x7afe('0x23')]:_0x248000['Agent']['id'];this[_0x7afe('0x24')]=_0x248000['VoiceQueueId'];this[_0x7afe('0x25')]='';this[_0x7afe('0x26')]='';}Action[_0x7afe('0x27')][_0x7afe('0x28')]=function(){return util[_0x7afe('0xd')](_0x7afe('0x29'),this[_0x7afe('0xe')],this[_0x7afe('0x2a')]);};module[_0x7afe('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a40f120..8a92a6e 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 _0x1cba=['buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countbusyretry','unlockAgent','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','unlock','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','lookAgent','logLookAgent','response','unlockContact','Answer','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','destlinkedid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','redis','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','prototype','loopCampaigns','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','enqueue','isNil','Queue','queue','originated:\x20','stringify','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][Preview]','info','size','getContactRecallMe','length','getDiff','dialRecallMeTimeout','Agent','voicePause','then','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x1cba,0x1f3));var _0xa1cb=function(_0x4ed17b,_0x2b1745){_0x4ed17b=_0x4ed17b-0x0;var _0x24b248=_0x1cba[_0x4ed17b];return _0x24b248;};'use strict';var util=require(_0xa1cb('0x0'));var _=require(_0xa1cb('0x1'));var BPromise=require(_0xa1cb('0x2'));var uuid=require(_0xa1cb('0x3'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xa1cb('0x4'));var config=require(_0xa1cb('0x5'));var logger=require(_0xa1cb('0x6'))(_0xa1cb('0x7'));var loggerAction=require(_0xa1cb('0x6'))(_0xa1cb('0x8'));var ami=require('../ami');var rpcDb=require(_0xa1cb('0x9'));var Action=require(_0xa1cb('0xa'));var ut=require('./util/util');config[_0xa1cb('0xb')]=_['defaults'](config[_0xa1cb('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xa1cb('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x569cd8){this[_0xa1cb('0xd')]=this[_0xa1cb('0xd')]?this['tail'][_0xa1cb('0xe')](_0x569cd8):_0x569cd8();};function Preview(_0x3d4d36){this[_0xa1cb('0xf')]=new Sequence();this[_0xa1cb('0x10')]=_0x3d4d36[_0xa1cb('0x11')];this['trunks']=_0x3d4d36[_0xa1cb('0x12')];this[_0xa1cb('0x13')]={};this[_0xa1cb('0x14')]=_0x3d4d36[_0xa1cb('0x14')];this[_0xa1cb('0x15')]=0x0;ami['on']('originateresponse',this[_0xa1cb('0x16')][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x18'),this[_0xa1cb('0x19')][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x1a'),this['syncHangupRequest'][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x1b'),this['syncDialEnd'][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x1c'),this[_0xa1cb('0x1d')]['bind'](this));ami['on']('varset',this[_0xa1cb('0x1e')][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x1f'),this[_0xa1cb('0x20')][_0xa1cb('0x17')](this));ami['on'](_0xa1cb('0x21'),this[_0xa1cb('0x22')]['bind'](this));this['loopCampaigns'](this[_0xa1cb('0x10')]);}function emit(_0x1e3711,_0x243198,_0x1f6b39){io['to'](_0x1e3711)[_0xa1cb('0x23')](_0x243198,_0x1f6b39);}function emitCampaignPreview(_0x1b5401){if(_0x1b5401[_0xa1cb('0x24')]===_0xa1cb('0x25')){var _0x290535={'id':_0x1b5401['id'],'name':_0x1b5401[_0xa1cb('0x26')],'strategy':_0x1b5401[_0xa1cb('0x27')],'answered':_0x1b5401[_0xa1cb('0x28')],'available':_0x1b5401[_0xa1cb('0x29')],'loggedIn':_0x1b5401[_0xa1cb('0x2a')],'pTalking':_0x1b5401['pTalking'],'sumBillable':_0x1b5401[_0xa1cb('0x2b')],'sumDuration':_0x1b5401[_0xa1cb('0x2c')],'sumHoldTime':_0x1b5401[_0xa1cb('0x2d')]||0x0,'talking':_0x1b5401['talking'],'total':_0x1b5401[_0xa1cb('0x2e')],'type':_0x1b5401[_0xa1cb('0x24')],'unmanaged':_0x1b5401['unmanaged'],'abandoned':_0x1b5401[_0xa1cb('0x2f')],'waiting':_0x1b5401[_0xa1cb('0x30')],'loggedInDb':_0x1b5401[_0xa1cb('0x31')],'dialActive':_0x1b5401[_0xa1cb('0x32')],'dialMethod':_0x1b5401[_0xa1cb('0x33')],'dialOriginateCallerIdName':_0x1b5401['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1b5401[_0xa1cb('0x34')],'dialOriginateTimeout':_0x1b5401[_0xa1cb('0x35')],'dialPrefix':_0x1b5401[_0xa1cb('0x36')],'outboundAnswerAgiCallsDay':_0x1b5401[_0xa1cb('0x37')],'outboundAnswerCallsDay':_0x1b5401['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1b5401[_0xa1cb('0x38')],'outboundBusyCallsDay':_0x1b5401[_0xa1cb('0x39')],'outboundCongestionCallsDay':_0x1b5401['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1b5401[_0xa1cb('0x3a')],'outboundDropCallsDayCallersExit':_0x1b5401['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1b5401[_0xa1cb('0x3b')],'outboundNoAnswerCallsDay':_0x1b5401['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1b5401['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1b5401[_0xa1cb('0x3c')],'outboundReCallsDay':_0x1b5401['outboundReCallsDay'],'outboundRejectCallsDay':_0x1b5401[_0xa1cb('0x3d')],'outboundUnknownCallsDay':_0x1b5401[_0xa1cb('0x3e')],'outboundAbandonedCallsDay':_0x1b5401[_0xa1cb('0x3f')],'predictiveIntervalAnsweredCalls':_0x1b5401[_0xa1cb('0x40')],'predictiveIntervalAvgHoldtime':_0x1b5401[_0xa1cb('0x41')],'predictiveIntervalAvgTalktime':_0x1b5401['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1b5401[_0xa1cb('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x1b5401[_0xa1cb('0x43')],'predictiveIntervalErlangCalls':_0x1b5401['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1b5401[_0xa1cb('0x44')],'predictiveIntervalHitRate':_0x1b5401[_0xa1cb('0x45')],'predictiveIntervalMultiplicativeFactor':_0x1b5401['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1b5401['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1b5401[_0xa1cb('0x46')],'predictiveIntervalTotalCalls':_0x1b5401[_0xa1cb('0x47')],'message':_0x1b5401[_0xa1cb('0x48')],'originated':_0x1b5401[_0xa1cb('0x49')],'erlangCalls':_0x1b5401[_0xa1cb('0x4a')],'erlangCallToSecond':_0x1b5401[_0xa1cb('0x4b')],'erlangAbandonmentRate':_0x1b5401['erlangAbandonmentRate'],'erlangBusyFactor':_0x1b5401[_0xa1cb('0x4c')],'startPredictive':_0x1b5401[_0xa1cb('0x4d')],'startProgressive':_0x1b5401[_0xa1cb('0x4e')]};if(_0x1b5401['Trunk']){_0x290535['Trunk']={'id':_0x1b5401[_0xa1cb('0x4f')]['id'],'name':_0x1b5401[_0xa1cb('0x4f')][_0xa1cb('0x26')],'active':_0x1b5401[_0xa1cb('0x4f')][_0xa1cb('0x50')],'callerid':_0x1b5401[_0xa1cb('0x4f')][_0xa1cb('0x51')]};}if(_0x1b5401[_0xa1cb('0x52')]){_0x290535['Interval']={'id':_0x1b5401['Interval']['id'],'name':_0x1b5401['Interval']['name']};}var _0x26dd95=md5(JSON['stringify'](_0x290535));if(_0x1b5401[_0xa1cb('0x53')]!==_0x26dd95){_0x1b5401[_0xa1cb('0x53')]=_0x26dd95;emit(util[_0xa1cb('0x54')](_0xa1cb('0x55'),_0x290535[_0xa1cb('0x26')]),_0xa1cb('0x56'),_0x290535);}}}function emitVoiceQueueChannelRemove(_0x153cc5){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x153cc5));emit(util[_0xa1cb('0x54')](_0xa1cb('0x55'),_0x153cc5[_0xa1cb('0x26')]),_0xa1cb('0x57'),_0x153cc5);io[_0xa1cb('0x23')]('voice_queue_presence:remove',_0x153cc5);}function notSendMessagesQueue(_0x56c771){if(_0x56c771[_0xa1cb('0x58')]){if(_0x56c771[_0xa1cb('0x49')]===0x0&&_0x56c771[_0xa1cb('0x59')]===0x0){_0x56c771['sendMessageOneNotActive']=![];_0x56c771['available']=0x0;_0x56c771[_0xa1cb('0x5a')]=0x0;_0x56c771[_0xa1cb('0x48')]=_0xa1cb('0x5b');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x56c771[_0xa1cb('0x26')]+_0xa1cb('0x5c'));}else{_0x56c771[_0xa1cb('0x48')]=_0xa1cb('0x5d');ut[_0xa1cb('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x56c771['name']+_0xa1cb('0x5f'));}emitCampaignPreview(_0x56c771);}}Preview[_0xa1cb('0x60')][_0xa1cb('0x61')]=function(){var _0x13ea60=this;setInterval(function(){_0x13ea60['syncCampaigns']();},0x7cf);};Preview[_0xa1cb('0x60')]['syncCampaigns']=function(){var _0xf5a95=this[_0xa1cb('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0xec843a in _0xf5a95){if(_0xf5a95[_0xa1cb('0x62')](_0xec843a)&&(_0xf5a95[_0xec843a][_0xa1cb('0x33')]===_0xa1cb('0x7')||_0xf5a95[_0xec843a][_0xa1cb('0x33')]===_0xa1cb('0x63'))&&_0xf5a95[_0xec843a]['type']===_0xa1cb('0x25')){if(this['clockClearZombieChannels']>0x7){this[_0xa1cb('0x15')]=0x0;this[_0xa1cb('0x64')]();}}if(_0xf5a95[_0xa1cb('0x62')](_0xec843a)&&_0xf5a95[_0xec843a][_0xa1cb('0x33')]===_0xa1cb('0x7')&&_0xf5a95[_0xec843a][_0xa1cb('0x24')]==='outbound'){if(_0xf5a95[_0xec843a][_0xa1cb('0x32')]){this['setMessage'](_0xf5a95[_0xec843a]);this[_0xa1cb('0x65')](_0xf5a95[_0xec843a]);}else{notSendMessagesQueue(_0xf5a95[_0xec843a]);}}}};Preview[_0xa1cb('0x60')][_0xa1cb('0x66')]=function(_0x4bf581){var _0x4f9007=this;this[_0xa1cb('0xf')][_0xa1cb('0x67')](function(){if(!_[_0xa1cb('0x68')](_0x4f9007['actions'][_0x4bf581])){loggerAction['info']('[clearZombieChannels][talking]',_0x4bf581,_0xa1cb('0x69'),_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x6a')],_0xa1cb('0x6b'),JSON[_0xa1cb('0x6c')](_0x4f9007[_0xa1cb('0x10')][_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x6a')]][_0xa1cb('0x49')]),_0xa1cb('0x6d'),JSON[_0xa1cb('0x6c')](_0x4f9007[_0xa1cb('0x10')][_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x6a')]][_0xa1cb('0x59')]),JSON[_0xa1cb('0x6c')](_0x4f9007[_0xa1cb('0x13')][_0x4bf581]['dialAnswer']),JSON[_0xa1cb('0x6c')](_[_0xa1cb('0x6e')](_0x4f9007[_0xa1cb('0x13')][_0x4bf581],[_0xa1cb('0x6f'),_0xa1cb('0x70'),_0xa1cb('0x71'),_0xa1cb('0x72')])));return ami['Action']({'action':_0xa1cb('0x73'),'channel':_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x74')]})[_0xa1cb('0x75')](function(_0x4740db){if(_0x4740db[_0xa1cb('0x48')]===_0xa1cb('0x76')){setTimeout(function(){if(_0x4f9007[_0xa1cb('0x13')][_0x4bf581]){ut[_0xa1cb('0x77')](_0x4f9007[_0xa1cb('0x10')][_0x4f9007['actions'][_0x4bf581][_0xa1cb('0x6a')]],_0xa1cb('0x78'));if(_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x79')]===!![]){ut['decrementTalkink'](_0x4f9007[_0xa1cb('0x10')][_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x6a')]],_0xa1cb('0x78'));ut[_0xa1cb('0x7a')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4bf581,_0x4f9007['actions'][_0x4bf581][_0xa1cb('0x6a')]);}ut[_0xa1cb('0x7a')](_0xa1cb('0x7b')+_0x4bf581,_0x4f9007[_0xa1cb('0x13')][_0x4bf581][_0xa1cb('0x6a')]);delete _0x4f9007[_0xa1cb('0x13')][_0x4bf581];}},0x2328);}});}});};Preview[_0xa1cb('0x60')][_0xa1cb('0x64')]=function(){var _0x552267=this;loggerAction[_0xa1cb('0x7c')]('[action]',_[_0xa1cb('0x7d')](this['actions']));for(var _0x5827d9 in this['actions']){if(_0x552267[_0xa1cb('0x13')][_0xa1cb('0x62')](_0x5827d9)){_0x552267[_0xa1cb('0x66')](_0x5827d9);}}};Preview[_0xa1cb('0x60')][_0xa1cb('0x65')]=function(_0xe753bd){var _0x1960ea=this;rpcDb[_0xa1cb('0x7e')](_0xe753bd['id'],ut['agentReadyId'](this[_0xa1cb('0x14')]))['then'](function(_0x23e272){if(!_[_0xa1cb('0x68')](_0x23e272)){for(var _0x13f63f=0x0;_0x13f63f<_0x23e272[_0xa1cb('0x7f')];_0x13f63f+=0x1){if(ut[_0xa1cb('0x80')](_0x23e272[_0x13f63f]['scheduledat'])<_0xe753bd[_0xa1cb('0x81')]*0x3c){if(_0x23e272[_0x13f63f][_0xa1cb('0x82')]&&!_0x23e272[_0x13f63f]['Agent'][_0xa1cb('0x83')]){_0x1960ea['run'](_0x23e272[_0x13f63f]['id'])[_0xa1cb('0x84')](ut['logger2']('[RecallMe]'))[_0xa1cb('0x75')](ut[_0xa1cb('0x85')](_0xa1cb('0x86')));}else{rpcDb[_0xa1cb('0x87')](_0x23e272[_0x13f63f]['id']);}}else{var _0x3b27b0=new Action(_0x23e272[_0x13f63f],_0xe753bd);_0x3b27b0[_0xa1cb('0x88')]=moment()[_0xa1cb('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0xe753bd['outboundReCallsDay']+=0x1;ut[_0xa1cb('0x89')](_0x3b27b0,0x17,_0xa1cb('0x8a'));if(_0xe753bd['dialRecallInQueue']){rpcDb[_0xa1cb('0x8b')](ut[_0xa1cb('0x8c')](_0x23e272[_0x13f63f]));rpcDb[_0xa1cb('0x8d')](_0x3b27b0,_0xa1cb('0x8e'));}else{ut['logCustomer'](_0x3b27b0,0x16,'RecallFailedTimeout');rpcDb[_0xa1cb('0x8d')](_0x3b27b0,_0xa1cb('0x8f'));rpcDb[_0xa1cb('0x90')](_0x3b27b0,_0xa1cb('0x8f'));}}}}})['catch'](ut[_0xa1cb('0x85')](_0xa1cb('0x91')));};Preview[_0xa1cb('0x60')][_0xa1cb('0x92')]=function(_0x534248){_0x534248[_0xa1cb('0x58')]=!![];if(ut['IsNotLoggedIn'](_0x534248[_0xa1cb('0x2a')])){_0x534248[_0xa1cb('0x48')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x534248[_0xa1cb('0x32')])){_0x534248['message']=_0xa1cb('0x5b');}else if(!this[_0xa1cb('0x93')](_0x534248[_0xa1cb('0x4f')])){if(!this[_0xa1cb('0x93')](_0x534248[_0xa1cb('0x94')])){_0x534248[_0xa1cb('0x48')]='TRUNK_IS_NOT_REACHABLE';}else{_0x534248[_0xa1cb('0x48')]=_0xa1cb('0x95');}}else{_0x534248[_0xa1cb('0x48')]='ACTIVE';}emitCampaignPreview(_0x534248);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x3c3a16,_0x4567e3,_0xf524d){var _0x5bd137=this;var _0x51bb53=this[_0xa1cb('0x13')][_0x4567e3];var _0x2ed5b9=this[_0xa1cb('0x10')][_0x51bb53[_0xa1cb('0x6a')]];var _0x5468c9;if(_0x2ed5b9){switch(_0xf524d){case'1':_0x2ed5b9[_0xa1cb('0x96')]+=0x1;_0x51bb53[_0xa1cb('0x97')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x0,'NoSuchNumber');ami[_0xa1cb('0x23')](_0xa1cb('0x9a'),ut[_0xa1cb('0x9b')](_0x51bb53,_0xa1cb('0x9c')));rpcDb[_0xa1cb('0x8d')](_0x51bb53,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,'Global');rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0x9f'));}else{if(_0x51bb53[_0xa1cb('0x97')]>=_0x2ed5b9[_0xa1cb('0xa0')]){rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0x9f'));}else{rpcDb[_0xa1cb('0xa1')](ut[_0xa1cb('0xa2')](_0x51bb53,_0xa1cb('0x97'),_0x2ed5b9[_0xa1cb('0xa3')]),_0x51bb53['unlockAgent'],_0x51bb53[_0xa1cb('0xa4')]);}}delete this['actions'][_0x3c3a16[_0xa1cb('0xa5')]];break;case _0xa1cb('0xa6'):var _0x27a51b=moment()[_0xa1cb('0x54')](_0xa1cb('0xa7'));_0x51bb53[_0xa1cb('0xa8')]=_0x27a51b;_0x51bb53[_0xa1cb('0xa9')]=_0x27a51b;_0x51bb53[_0xa1cb('0x79')]=!![];_0x2ed5b9['pTalking']+=0x1;logger[_0xa1cb('0x7c')](_0xa1cb('0xaa'),_0x51bb53[_0xa1cb('0xab')],_0xa1cb('0xac'),_0x2ed5b9[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x2ed5b9[_0xa1cb('0x59')]);ami['emit'](_0xa1cb('0xad'),ut[_0xa1cb('0x9b')](_0x51bb53,_0xa1cb('0xae'),this[_0xa1cb('0x10')][_0x51bb53[_0xa1cb('0x6a')]]));if(_0x2ed5b9[_0xa1cb('0xaf')]){ami[_0xa1cb('0x23')](_0xa1cb('0xb0'),ut[_0xa1cb('0xb1')](_0x51bb53));}break;case'16':ami[_0xa1cb('0x23')](_0xa1cb('0xb2'),ut[_0xa1cb('0x9b')](_0x51bb53,_0xa1cb('0xb3'),this['campaignsPreview'][_0x51bb53[_0xa1cb('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0xa1cb('0x9b')](_0x51bb53,_0xa1cb('0xb3')));_0x2ed5b9[_0xa1cb('0xb4')]+=0x1;_0x2ed5b9[_0xa1cb('0x2e')]+=0x1;_0x2ed5b9[_0xa1cb('0x28')]+=0x1;ut[_0xa1cb('0xb5')](_0x2ed5b9,'[16]');_0x51bb53['countglobal']=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x4,'Answer');rpcDb[_0xa1cb('0x8d')](_0x51bb53,_0xa1cb('0xb6'));rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0xb7'));rpcDb[_0xa1cb('0xb8')](_0x51bb53);_0x2ed5b9['sumDuration']+=_0x51bb53[_0xa1cb('0xb9')];_0x2ed5b9[_0xa1cb('0x2b')]+=_0x51bb53['talktime'];logger[_0xa1cb('0x7c')](_0xa1cb('0xba'),_0x51bb53[_0xa1cb('0xab')],'\x20Queue',_0x2ed5b9[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x2ed5b9[_0xa1cb('0x59')]);delete this[_0xa1cb('0x13')][_0x3c3a16[_0xa1cb('0xa5')]];break;case _0xa1cb('0xbb'):_0x2ed5b9[_0xa1cb('0x39')]+=0x1;_0x51bb53['countbusyretry']+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x5,_0xa1cb('0xbc'));ami[_0xa1cb('0x23')](_0xa1cb('0xbd'),ut[_0xa1cb('0x9b')](_0x51bb53,'busy'));rpcDb['createCustomerHistory'](_0x51bb53,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9['dialGlobalMaxRetry']){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,'Global');rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0xbe'));}else{if(_0x51bb53['countbusyretry']>=_0x2ed5b9[_0xa1cb('0xbf')]){rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0xc0'));}else{rpcDb[_0xa1cb('0xa1')](ut['scheduledAt'](_0x51bb53,_0xa1cb('0xc1'),_0x2ed5b9['dialBusyRetryFrequency']),_0x51bb53[_0xa1cb('0xc2')],_0x51bb53[_0xa1cb('0xa4')]);}}break;case _0xa1cb('0xc3'):_0x2ed5b9['outboundNoAnswerCallsDay']+=0x1;_0x51bb53['countnoanswerretry']+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut['totalGlobal'](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x3,_0xa1cb('0xc4'));ami[_0xa1cb('0x23')](_0xa1cb('0xc5'),ut['buildObj'](_0x51bb53,_0xa1cb('0xc6')));rpcDb[_0xa1cb('0x8d')](_0x51bb53,_0xa1cb('0xc7'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,_0xa1cb('0xc8'));rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0xc9'));}else{if(_0x51bb53[_0xa1cb('0xca')]>=_0x2ed5b9[_0xa1cb('0xcb')]){rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0xc7'));}else{rpcDb[_0xa1cb('0xa1')](ut[_0xa1cb('0xa2')](_0x51bb53,'countnoanswerretry',_0x2ed5b9[_0xa1cb('0xcc')]),_0x51bb53['unlockAgent'],_0x51bb53['activeContact']);}}break;case _0xa1cb('0xcd'):_0x2ed5b9[_0xa1cb('0xce')]+=0x1;_0x51bb53[_0xa1cb('0xcf')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x8,_0xa1cb('0xd0'));ami['emit'](_0xa1cb('0xd1'),ut[_0xa1cb('0x9b')](_0x51bb53,_0xa1cb('0xd2')));rpcDb[_0xa1cb('0x8d')](_0x51bb53,_0xa1cb('0xd3'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,'Global');rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0xd4'));}else{if(_0x51bb53[_0xa1cb('0xcf')]>=_0x2ed5b9[_0xa1cb('0xd5')]){rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0xd3'));}else{rpcDb[_0xa1cb('0xa1')](ut['scheduledAt'](_0x51bb53,_0xa1cb('0xcf'),_0x2ed5b9[_0xa1cb('0xd6')]),_0x51bb53[_0xa1cb('0xc2')],_0x51bb53['activeContact']);}}break;case'CANCEL':_0x2ed5b9[_0xa1cb('0x3d')]+=0x1;_0x51bb53[_0xa1cb('0xd7')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut['logCustomer'](_0x51bb53,0x14,'AgentReject');ami[_0xa1cb('0x23')](_0xa1cb('0xd8'),ut[_0xa1cb('0x9b')](_0x51bb53,'agentreject'));rpcDb[_0xa1cb('0x8d')](_0x51bb53,_0xa1cb('0xd9'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0x14,_0xa1cb('0xda'));rpcDb[_0xa1cb('0x90')](_0x5468c9,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x51bb53['countagentrejectretry']>=_0x2ed5b9[_0xa1cb('0xdb')]){rpcDb['createCustomerFinal'](_0x51bb53,_0xa1cb('0xdc'));}else{rpcDb[_0xa1cb('0xa1')](ut[_0xa1cb('0xa2')](_0x51bb53,_0xa1cb('0xd7'),_0x2ed5b9[_0xa1cb('0xdd')]),_0x51bb53['unlockAgent'],_0x51bb53[_0xa1cb('0xa4')]);}}break;case'ABANDONED':_0x2ed5b9[_0xa1cb('0x3f')]+=0x1;_0x51bb53[_0xa1cb('0xde')]+=0x1;_0x51bb53['countglobal']=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0xb,_0xa1cb('0xdf'));rpcDb['createCustomerHistory'](_0x51bb53,_0xa1cb('0xe0'));if(ut['totalGlobal'](_0x51bb53)>=_0x2ed5b9['dialGlobalMaxRetry']){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,_0xa1cb('0xc8'));rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0xe0'));}else{if(_0x51bb53['countabandonedetry']>=_0x2ed5b9['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x51bb53,_0xa1cb('0xe0'));}else{rpcDb['rescheduleContact'](ut[_0xa1cb('0xa2')](_0x51bb53,_0xa1cb('0xde'),_0x2ed5b9[_0xa1cb('0xe1')]),_0x51bb53['unlockAgent'],_0x51bb53[_0xa1cb('0xa4')]);}}break;case'18':_0x2ed5b9['outboundUnknownCallsDay']+=0x1;_0x51bb53[_0xa1cb('0xe2')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut[_0xa1cb('0x89')](_0x51bb53,0x12,_0x3c3a16[_0xa1cb('0xe3')]||_0x3c3a16[_0xa1cb('0xe4')]);ami[_0xa1cb('0x23')](_0xa1cb('0xe5'),ut[_0xa1cb('0x9b')](_0x51bb53,'amd'));rpcDb['createCustomerHistory'](_0x51bb53,_0xa1cb('0xe6'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut['cloneAction'](_0x51bb53,0xf,_0xa1cb('0xc8'));rpcDb['createCustomerFinal'](_0x5468c9,_0xa1cb('0xe6'));}else{rpcDb['createCustomerFinal'](_0x51bb53,_0xa1cb('0xe6'));}delete this[_0xa1cb('0x13')][_0x3c3a16[_0xa1cb('0xa5')]];break;case'19':_0x2ed5b9[_0xa1cb('0x3e')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut[_0xa1cb('0x99')](_0x51bb53);ut['logCustomer'](_0x51bb53,0x13,_0x3c3a16[_0xa1cb('0xe3')]||_0x3c3a16['dialstatus']);ami[_0xa1cb('0x23')]('custom:amd',ut[_0xa1cb('0x9b')](_0x51bb53,'amd'));rpcDb['createCustomerHistory'](_0x51bb53,_0xa1cb('0xe7'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9['dialGlobalMaxRetry']){_0x5468c9=ut[_0xa1cb('0x9e')](_0x51bb53,0xf,'Global');rpcDb[_0xa1cb('0x90')](_0x5468c9,_0xa1cb('0xe7'));}else{rpcDb['createCustomerFinal'](_0x51bb53,'[callProgressDetectingCustomer][machine]');}delete this[_0xa1cb('0x13')][_0x3c3a16['linkedid']];break;default:if(_0x51bb53[_0xa1cb('0x79')]){ut[_0xa1cb('0xb5')](_0x2ed5b9,_0xa1cb('0xe8'));ut[_0xa1cb('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x2ed5b9[_0xa1cb('0x26')],_0x3c3a16);}_0x2ed5b9[_0xa1cb('0x3e')]+=0x1;_0x51bb53[_0xa1cb('0x98')]=ut['totalGlobal'](_0x51bb53);ut['logCustomer'](_0x51bb53,0xc,_0x3c3a16[_0xa1cb('0xe3')]||_0x3c3a16['dialstatus']);rpcDb[_0xa1cb('0x8d')](_0x51bb53,_0xa1cb('0xe9'));if(ut[_0xa1cb('0x99')](_0x51bb53)>=_0x2ed5b9[_0xa1cb('0x9d')]){_0x5468c9=ut['cloneAction'](_0x51bb53,0xf,_0xa1cb('0xc8'));rpcDb['createCustomerFinal'](_0x5468c9,_0xa1cb('0xea'));}else{rpcDb[_0xa1cb('0x90')](_0x51bb53,_0xa1cb('0xea'));}delete this[_0xa1cb('0x13')][_0x3c3a16[_0xa1cb('0xa5')]];}if(!(_0x51bb53['dialAnswer']&&_0xf524d==='16')){ut[_0xa1cb('0x77')](_0x2ed5b9,_0xa1cb('0xeb'));logger[_0xa1cb('0x7c')](_0xa1cb('0xec'),_0x51bb53[_0xa1cb('0xab')],_0xa1cb('0xac'),_0x2ed5b9[_0xa1cb('0x26')],_0xa1cb('0x6b'),_0x2ed5b9[_0xa1cb('0x49')]);}if(_0xf524d!==_0xa1cb('0xa6')){delete this[_0xa1cb('0x13')][_0x3c3a16['linkedid']];delete this['actions'][_0x3c3a16['destlinkedid']];}}};Preview[_0xa1cb('0x60')][_0xa1cb('0xed')]=function(_0x507233,_0x3ae4ad,_0x1d3dec){if(_[_0xa1cb('0xee')](_0x3ae4ad)&&_0xa1cb('0xef')!==typeof _0x3ae4ad){return;}if(_['isUndefined'](_0x1d3dec)&&_0xa1cb('0xef')!==typeof _0x1d3dec){return;}switch(_0x1d3dec['reason']){case'0':ut[_0xa1cb('0xf0')](_0x507233,0x0,_0xa1cb('0xf1'));rpcDb[_0xa1cb('0xf2')](_0x507233,_0xa1cb('0xf3'));break;case'3':ut[_0xa1cb('0xf0')](_0x507233,0x3,'NoAnswer');rpcDb[_0xa1cb('0xf2')](_0x507233,_0xa1cb('0xf4'));break;case'5':ut[_0xa1cb('0xf0')](_0x507233,0x5,_0xa1cb('0xbc'));rpcDb['createAgentHistory'](_0x507233,_0xa1cb('0xf5'));break;case'8':ut[_0xa1cb('0xf0')](_0x507233,0x8,'Congestion');rpcDb[_0xa1cb('0xf2')](_0x507233,_0xa1cb('0xf6'));break;case'22':ut[_0xa1cb('0xf0')](_0x507233,0x16,_0xa1cb('0xf7'));rpcDb[_0xa1cb('0xf2')](_0x507233,_0xa1cb('0xf8'));break;default:ut[_0xa1cb('0xf0')](_0x507233,0xc,_0x1d3dec['reason']);rpcDb[_0xa1cb('0xf2')](_0x507233,_0xa1cb('0xf6'));}ut[_0xa1cb('0x77')](_0x3ae4ad,_0xa1cb('0xf9'));logger['info'](_0xa1cb('0xfa'),_0x507233[_0xa1cb('0xab')],_0xa1cb('0xac'),_0x3ae4ad[_0xa1cb('0x26')],_0xa1cb('0x6b'),_0x3ae4ad[_0xa1cb('0x49')]);delete this['actions'][_0x507233['uniqueid']];};Preview[_0xa1cb('0x60')][_0xa1cb('0xfb')]=function(_0x404caa,_0x3828f4,_0x5c8a5f,_0x11e578,_0x19f983){var _0x22f36c=this;return new BPromise(function(_0x1d650f,_0x2f990e){if(_[_0xa1cb('0x68')](_0x3828f4)||_[_0xa1cb('0x68')](_0x3828f4[_0xa1cb('0xfc')])||_[_0xa1cb('0x68')](_0x3828f4[_0xa1cb('0xfc')][_0xa1cb('0xfd')])||_['isNil'](_0x3828f4['VoiceQueueId'])){_0x2f990e(ut[_0xa1cb('0x48')](_0xa1cb('0xfe'),_0x11e578,_0x19f983));return;}var _0x396ed1=uuid['v4']();var _0x1aa79c=_0x22f36c[_0xa1cb('0x10')][_0x3828f4[_0xa1cb('0x69')][_0xa1cb('0x26')]];var _0x3dad2e=_0x5c8a5f?_0x22f36c['agents'][_0x5c8a5f]['id']:undefined;_0x22f36c[_0xa1cb('0x13')][_0x396ed1]=new Action(_0x3828f4,_0x1aa79c,_0x396ed1,_0x5c8a5f,_0x3dad2e);var _0x31a041=_0x22f36c['actions'][_0x396ed1];_0x31a041['unlockAgent']=_0x11e578;_0x31a041['activeContact']=_0x19f983;_0x31a041['lookAgent']=_0x5c8a5f;if(_['isEmpty'](_0x404caa)){_0x22f36c[_0xa1cb('0xff')](_0x31a041,_0x1aa79c,_0x3828f4,_0x5c8a5f)[_0xa1cb('0x84')](function(_0x4b8c0){logger['info'](_0xa1cb('0x100'),_0xa1cb('0x101')+_0x31a041[_0xa1cb('0x6a')]+_0xa1cb('0x102')+_0x31a041[_0xa1cb('0x103')],JSON[_0xa1cb('0x6c')](_0x4b8c0));ami[_0xa1cb('0x23')]('custom:agentcalled',ut[_0xa1cb('0x9b')](_0x31a041,'called',_0x22f36c['campaignsPreview'][_0x31a041[_0xa1cb('0x6a')]]));_0x1d650f(ut[_0xa1cb('0x48')](_0xa1cb('0x104')));})['catch'](function(_0x5204f5){ut[_0xa1cb('0x5e')](_0xa1cb('0x105'),_0x5204f5);_0x2f990e(ut[_0xa1cb('0x48')]('Call\x20failed',_0x11e578,_0x19f983));});}else{_0x1aa79c[_0xa1cb('0x38')]+=0x1;ut['logBlacklist'](_0x31a041);rpcDb[_0xa1cb('0x106')](_0x31a041,_0xa1cb('0x107'));delete _0x22f36c[_0xa1cb('0x13')][_0x396ed1];_0x2f990e(ut[_0xa1cb('0x48')](_0xa1cb('0x108'),_0x11e578,_0x19f983));}});};Preview[_0xa1cb('0x60')][_0xa1cb('0x93')]=function(_0x34d987){return!_['isNil'](_0x34d987)&&!_[_0xa1cb('0x68')](_0x34d987[_0xa1cb('0x26')])&&!_['isNil'](_0x34d987['active'])&&_0x34d987[_0xa1cb('0x50')]&&!_[_0xa1cb('0x68')](this[_0xa1cb('0x12')][util[_0xa1cb('0x54')]('SIP/%s',_0x34d987[_0xa1cb('0x26')])])&&!_[_0xa1cb('0x68')](this[_0xa1cb('0x12')][util[_0xa1cb('0x54')](_0xa1cb('0x109'),_0x34d987[_0xa1cb('0x26')])][_0xa1cb('0x73')])&&(this[_0xa1cb('0x12')][util[_0xa1cb('0x54')](_0xa1cb('0x109'),_0x34d987[_0xa1cb('0x26')])]['status']===_0xa1cb('0x10a')||this['trunks'][util[_0xa1cb('0x54')]('SIP/%s',_0x34d987['name'])]['status']===_0xa1cb('0x10b'));};Preview[_0xa1cb('0x60')][_0xa1cb('0x10c')]=function(_0x43acc3,_0x27fbc4){var _0x3616ca=this;return new BPromise(function(_0x5eaa54,_0x2de641){_0x3616ca['execRun'](_0x43acc3,_0x27fbc4)[_0xa1cb('0x84')](function(_0x1d12ec){_0x5eaa54(_[_0xa1cb('0x6e')](_0x1d12ec,[_0xa1cb('0x48')]));})['catch'](function(_0x2d6792){if(_0x2d6792[_0xa1cb('0x10d')]){rpcDb['unlockContact'](_0x43acc3);}if(_0x2d6792[_0xa1cb('0x50')]){rpcDb[_0xa1cb('0x87')](_0x43acc3);}_0x2de641(_['pick'](_0x2d6792,['message']));});});};Preview[_0xa1cb('0x60')][_0xa1cb('0x10e')]=function(_0x350825,_0x12b39c){var _0x58467b=this;return new BPromise(function(_0x5a11f9,_0x36298f){var _0x73ea26,_0x2c42b0;rpcDb[_0xa1cb('0x10f')](_0x350825)[_0xa1cb('0x84')](function(_0x1d25be){if(!_['isNil'](_0x1d25be[0x0])){_0x2c42b0=_0x1d25be[0x0][_0xa1cb('0x110')]?![]:!![];_0x73ea26=_0x1d25be[0x0][_0xa1cb('0x110')]?!![]:![];_0x73ea26=_0x12b39c?!![]:_0x73ea26;}var _0xbfbb93=_0x58467b[_0xa1cb('0x111')](_0x1d25be);if(_0xbfbb93[_0xa1cb('0x112')]){rpcDb['checkIsBlackList'](_[_0xa1cb('0x6e')](_0x1d25be[0x0],[_0xa1cb('0x71'),_0xa1cb('0x113')]))[_0xa1cb('0x84')](function(_0x5274e7){_0x58467b[_0xa1cb('0xfb')](_0x5274e7,_0x1d25be[0x0],_0x12b39c,_0x2c42b0,_0x73ea26)['then'](function(_0x51e9af){_0x5a11f9(_0x51e9af);})[_0xa1cb('0x75')](function(_0x530aec){_0x36298f(_0x530aec);});})['catch'](function(_0x31a0d5){ut[_0xa1cb('0x5e')](_0xa1cb('0x114'),_0x31a0d5);_0x36298f(ut[_0xa1cb('0x48')]('Call\x20unsuccessful',_0x2c42b0,_0x73ea26));});}else{_0x36298f(ut[_0xa1cb('0x48')](_0xbfbb93[_0xa1cb('0x48')],_0x2c42b0,_0x73ea26));}})[_0xa1cb('0x75')](function(_0x55077e){ut[_0xa1cb('0x5e')](_0xa1cb('0x115'),_0x55077e);_0x36298f(ut[_0xa1cb('0x48')](_0xa1cb('0x116'),![],!![]));});});};Preview[_0xa1cb('0x60')][_0xa1cb('0x111')]=function(_0x5286ea){if(_['isNil'](_0x5286ea)||_[_0xa1cb('0x117')](_0x5286ea)||!_[_0xa1cb('0x68')](_0x5286ea[0x0][_0xa1cb('0x82')])&&_[_0xa1cb('0x68')](_0x5286ea[0x0][_0xa1cb('0x82')][_0xa1cb('0x26')])){ut['logger'](_0xa1cb('0x118'),_0x5286ea);return{'isValid':![],'message':_0xa1cb('0x119')};}var _0x106f68=this[_0xa1cb('0x10')][_0x5286ea[0x0][_0xa1cb('0x69')][_0xa1cb('0x26')]];_0x106f68['message']='ACTIVE';if(_[_0xa1cb('0x68')](_0x106f68)){ut[_0xa1cb('0x5e')](_0xa1cb('0x11a'),_0x106f68);return{'isValid':![],'message':_0xa1cb('0x11b')};}if(!this[_0xa1cb('0x93')](_0x106f68[_0xa1cb('0x4f')])){ut[_0xa1cb('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x106f68[_0xa1cb('0x26')]+_0xa1cb('0x11c'));if(!this[_0xa1cb('0x93')](_0x106f68['TrunkBackup'])){ut['logger'](_0xa1cb('0x11d'),_0x106f68['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xa1cb('0x11e')};}}if(!ut['isActive'](_0x106f68[_0xa1cb('0x32')])){ut[_0xa1cb('0x5e')]('[Preview][validateContact][Campaign\x20Active]',_0x106f68[_0xa1cb('0x26')]+_0xa1cb('0x11f'));return{'isValid':![],'message':_0xa1cb('0x120')+_0x106f68[_0xa1cb('0x26')]+_0xa1cb('0x11f')};}return{'isValid':!![],'message':_0xa1cb('0x121')};};Preview['prototype'][_0xa1cb('0xff')]=function(_0x597cb4,_0x229bab,_0x48facc,_0x1a731c){var _0x4d1daa=this;return new BPromise(function(_0x5207a2,_0x1946da){var _0x41e03c=_0x597cb4[_0xa1cb('0xab')];var _0x241b77=_0x4d1daa['isTrunkReachable'](_0x229bab[_0xa1cb('0x4f')])?util[_0xa1cb('0x54')]('SIP/%s/%s%s',_0x229bab['Trunk'][_0xa1cb('0x26')],_['isNil'](_0x229bab[_0xa1cb('0x36')])?'':_0x229bab[_0xa1cb('0x36')][_0xa1cb('0x122')]()||'',_0x229bab[_0xa1cb('0x123')]>0x0?_0x48facc[_0xa1cb('0xfc')]['phone'][_0xa1cb('0x124')](_0x229bab[_0xa1cb('0x123')]):_0x48facc[_0xa1cb('0xfc')][_0xa1cb('0xfd')]):util[_0xa1cb('0x54')](_0xa1cb('0x125'),_[_0xa1cb('0x68')](_0x229bab[_0xa1cb('0x94')])?_0x229bab[_0xa1cb('0x4f')]['name']:_0x229bab[_0xa1cb('0x94')][_0xa1cb('0x26')],_[_0xa1cb('0x68')](_0x229bab[_0xa1cb('0x36')])?'':_0x229bab[_0xa1cb('0x36')][_0xa1cb('0x122')]()||'',_0x229bab[_0xa1cb('0x123')]>0x0?_0x48facc['Contact'][_0xa1cb('0xfd')][_0xa1cb('0x124')](_0x229bab[_0xa1cb('0x123')]):_0x48facc[_0xa1cb('0xfc')][_0xa1cb('0xfd')]);var _0x493c93=_0x4d1daa[_0xa1cb('0x93')](_0x229bab[_0xa1cb('0x4f')])?ut[_0xa1cb('0x126')](_0x229bab[_0xa1cb('0x4f')][_0xa1cb('0x51')],_0x229bab[_0xa1cb('0x127')],_0x229bab[_0xa1cb('0x128')]>0x0?ut[_0xa1cb('0x129')](_0x229bab['dialOriginateCallerIdNumber'],_0x229bab[_0xa1cb('0x128')]):_0x229bab[_0xa1cb('0x34')]):ut[_0xa1cb('0x126')](_[_0xa1cb('0x68')](_0x229bab['TrunkBackup'])?_0x229bab['Trunk'][_0xa1cb('0x51')]:_0x229bab[_0xa1cb('0x94')][_0xa1cb('0x51')],_0x229bab[_0xa1cb('0x127')],_0x229bab[_0xa1cb('0x128')]>0x0?ut['getCallerIdRandom'](_0x229bab[_0xa1cb('0x34')],_0x229bab[_0xa1cb('0x128')]):_0x229bab[_0xa1cb('0x34')]);if(_0x493c93){_0x597cb4[_0xa1cb('0x12a')]=ut[_0xa1cb('0x12b')](_0x493c93);_0x597cb4[_0xa1cb('0x12c')]=ut['extractCalleridNumber'](_0x493c93);}var _0x2d24f8=ut[_0xa1cb('0x12d')](_0x229bab,_0x48facc,_0x241b77,_0x493c93,_0x41e03c,_0x597cb4);_[_0xa1cb('0x12e')](_0x597cb4,ut['toLowerVariables'](_0x2d24f8));_0x597cb4['starttime']=moment()[_0xa1cb('0x54')](_0xa1cb('0xa7'));ami[_0xa1cb('0x12f')](ut[_0xa1cb('0x130')](_0x597cb4,_0x229bab,_0x2d24f8,_0x597cb4[_0xa1cb('0xa4')],_0x1a731c))[_0xa1cb('0x84')](function(_0x55f3df){_0x229bab[_0xa1cb('0x49')]+=0x1;logger[_0xa1cb('0x7c')](_0xa1cb('0x131'),_0x41e03c,'\x20Queue',_0x229bab['name'],_0xa1cb('0x6b'),_0x229bab[_0xa1cb('0x49')]);_0x5207a2(_0x55f3df);})[_0xa1cb('0x75')](function(_0x12df7c){ut[_0xa1cb('0xf0')](_0x597cb4,0xe,_0xa1cb('0x132'));rpcDb['createAgentHistory'](_0x597cb4,_0xa1cb('0x133'));_0x1946da(_0x12df7c);});});};Preview[_0xa1cb('0x60')][_0xa1cb('0x1d')]=function(_0x2690b8){if(this[_0xa1cb('0x13')][_0x2690b8[_0xa1cb('0xa5')]]){this['actions'][_0x2690b8[_0xa1cb('0xa5')]]['channel']=_0x2690b8[_0xa1cb('0x74')];}};Preview[_0xa1cb('0x60')]['syncOriginateResponse']=function(_0x1d55e8){var _0x3b14b7=this;var _0x505cd=this['actions'][_0x1d55e8['actionid']];if(_0x505cd){if(_0x505cd[_0xa1cb('0x134')]&&this[_0xa1cb('0x14')][_0x505cd[_0xa1cb('0x134')]]){ut[_0xa1cb('0x135')](_0x505cd,this[_0xa1cb('0x14')][_0x505cd['lookAgent']][_0xa1cb('0x26')],this[_0xa1cb('0x14')][_0x505cd[_0xa1cb('0x134')]]['id']);}var _0x1a9ac4=_['clone'](_0x505cd);_0x1a9ac4['responsetime']=moment()[_0xa1cb('0x54')](_0xa1cb('0xa7'));var _0x379d03=_0x3b14b7[_0xa1cb('0x10')][_0x505cd[_0xa1cb('0x6a')]];if(ut['isFailure'](_0x1d55e8[_0xa1cb('0x136')])){if(_0x505cd[_0xa1cb('0xc2')]){rpcDb[_0xa1cb('0x137')](_0x505cd[_0xa1cb('0x103')]);}if(_0x505cd[_0xa1cb('0xa4')]){rpcDb['disableContact'](_0x505cd[_0xa1cb('0x103')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x505cd,'rejected',this['campaignsPreview'][_0x505cd[_0xa1cb('0x6a')]]));this[_0xa1cb('0xed')](_0x1a9ac4,_0x379d03,_0x1d55e8);}else{_0x505cd[_0xa1cb('0x88')]=moment()[_0xa1cb('0x54')](_0xa1cb('0xa7'));ut[_0xa1cb('0xf0')](_0x1a9ac4,0x4,_0xa1cb('0x138'));rpcDb[_0xa1cb('0xf2')](_0x1a9ac4,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xa1cb('0x60')][_0xa1cb('0x19')]=function(_0x5205c2){var _0x54028b=this;var _0x217088=this['actions'][_0x5205c2['linkedid']];var _0x529bf5;if(_0x217088){_0x529bf5=this[_0xa1cb('0x10')][_0x217088[_0xa1cb('0x6a')]];logger[_0xa1cb('0x7c')](_0xa1cb('0x139'),_0x5205c2[_0xa1cb('0xa5')],_0xa1cb('0xac'),_0x529bf5[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x529bf5[_0xa1cb('0x59')]);}if(this[_0xa1cb('0x13')][_0x5205c2[_0xa1cb('0xa5')]]&&_0x5205c2[_0xa1cb('0xa5')]!==_0x5205c2['uniqueid']){if(_0x5205c2[_0xa1cb('0x13a')]==='16'&&this[_0xa1cb('0x13')][_0x5205c2[_0xa1cb('0xa5')]][_0xa1cb('0x79')]){this[_0xa1cb('0x13b')](_0x5205c2,_0x5205c2[_0xa1cb('0xa5')],_0x5205c2[_0xa1cb('0x13a')]);}else if(this[_0xa1cb('0x13')][_0x5205c2[_0xa1cb('0xa5')]][_0xa1cb('0x79')]){logger['info'](_0xa1cb('0x13c'),_0x5205c2[_0xa1cb('0xa5')],_0x5205c2[_0xa1cb('0x13a')],_0xa1cb('0xac'),_0x529bf5[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x529bf5[_0xa1cb('0x59')]);this['callProgressDetectingCustomer'](_0x5205c2,_0x5205c2[_0xa1cb('0xa5')],_0x5205c2['cause']);}}else if(_0x217088&&_[_0xa1cb('0x68')](_0x217088[_0xa1cb('0x13d')])&&_0x529bf5[_0xa1cb('0x13e')]&&_0x5205c2[_0xa1cb('0xa5')]===_0x5205c2[_0xa1cb('0xab')]&&_[_0xa1cb('0x68')](_0x5205c2[_0xa1cb('0x13f')])&&_0x5205c2[_0xa1cb('0x13a')]==='16'&&_0x5205c2[_0xa1cb('0x140')]==='6'&&_[_0xa1cb('0xee')](_0x217088['transfer'])){if(_0x217088['unlockAgent']){rpcDb[_0xa1cb('0x137')](_0x217088[_0xa1cb('0x103')]);}if(_0x217088['activeContact']){rpcDb[_0xa1cb('0x87')](_0x217088[_0xa1cb('0x103')]);}_0x5205c2[_0xa1cb('0x13f')]='22';this['callProgressDetectingAgent'](_0x217088,_0x529bf5,_0x5205c2);}else if(_0x217088&&_0x217088[_0xa1cb('0x141')]){if(_0x5205c2[_0xa1cb('0x13a')]==='16'&&this['actions'][_0x5205c2[_0xa1cb('0xa5')]][_0xa1cb('0x79')]){logger[_0xa1cb('0x7c')](_0xa1cb('0x142'),_0x5205c2['linkedid'],_0x5205c2['cause'],_0xa1cb('0xac'),_0x529bf5[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x529bf5[_0xa1cb('0x59')]);this[_0xa1cb('0x13b')](_0x5205c2,_0x5205c2['linkedid'],_0x5205c2[_0xa1cb('0x13a')]);}else if(this[_0xa1cb('0x13')][_0x5205c2[_0xa1cb('0xa5')]]['dialAnswer']){logger[_0xa1cb('0x7c')]('[syncHangup][talking][cause]',_0x5205c2[_0xa1cb('0xa5')],_0x5205c2[_0xa1cb('0x13a')],_0xa1cb('0xac'),_0x529bf5[_0xa1cb('0x26')],_0xa1cb('0x6d'),_0x529bf5[_0xa1cb('0x59')]);this[_0xa1cb('0x13b')](_0x5205c2,_0x5205c2['linkedid'],_0x5205c2[_0xa1cb('0x13a')]);}}};Preview['prototype'][_0xa1cb('0x143')]=function(_0xcbc05){if(this['actions'][_0xcbc05['destlinkedid']]&&_0xcbc05['destlinkedid']!==_0xcbc05[_0xa1cb('0x144')]){this[_0xa1cb('0x13b')](_0xcbc05,_0xcbc05[_0xa1cb('0x145')],_0xcbc05[_0xa1cb('0xe4')]);}};Preview[_0xa1cb('0x60')][_0xa1cb('0x146')]=function(_0x47b304){if(this['actions'][_0x47b304[_0xa1cb('0xa5')]]&&_0x47b304[_0xa1cb('0xa5')]!==_0x47b304[_0xa1cb('0xab')]&&!this['actions'][_0x47b304[_0xa1cb('0xa5')]][_0xa1cb('0x79')]){if(_0x47b304[_0xa1cb('0x13a')]==='1'){this[_0xa1cb('0x13b')](_0x47b304,_0x47b304[_0xa1cb('0xa5')],_0x47b304['cause']);}}};Preview[_0xa1cb('0x60')][_0xa1cb('0x147')]=function(_0x4554a7,_0x3cd1c6,_0x19144b){if(this[_0xa1cb('0x13')][_0x4554a7]){if(_[_0xa1cb('0x68')](this[_0xa1cb('0x13')][_0x4554a7][_0xa1cb('0x148')])){this['actions'][_0x4554a7][_0xa1cb('0x148')]={};}this['actions'][_0x4554a7]['variables'][_0x3cd1c6]=_0x19144b;}};Preview[_0xa1cb('0x60')][_0xa1cb('0x1e')]=function(_0x146953){try{if(!_['isNil'](_0x146953)){if(ut[_0xa1cb('0x149')](_['keys'](_0x146953['variable'])[0x0])){this[_0xa1cb('0x147')](_0x146953[_0xa1cb('0xab')],_[_0xa1cb('0x14a')](_0x146953[_0xa1cb('0x14b')])[0x0],_0x146953[_0xa1cb('0x14c')]);}}}catch(_0x552d90){logger[_0xa1cb('0x14d')](_0xa1cb('0x14e'),util['inspect'](_0x552d90,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xa1cb('0x20')]=function(_0x492bf4){if(_0x492bf4){if(this['actions'][_0x492bf4[_0xa1cb('0x14f')]]){this['actions'][_0x492bf4[_0xa1cb('0x14f')]]['transfer']=!![];}}};Preview['prototype'][_0xa1cb('0x22')]=function(_0x9ba735){if(_0x9ba735){if(this[_0xa1cb('0x13')][_0x9ba735[_0xa1cb('0x150')]]){this[_0xa1cb('0x13')][_0x9ba735[_0xa1cb('0x150')]]['transfer']=!![];}}};module[_0xa1cb('0x151')]=Preview; \ No newline at end of file +var _0x946d=['buildAcw','complete','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','execCall','then','[Preview][execCall][success]','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','variables','syncVarSet','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','dialend','syncDialEnd','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','dialMethod','clearZombieChannels','hasOwnProperty','setMessage','recallMe','[clearZombieChannels][talking]','queue','originated:\x20','actions','pTalking:\x20','pick','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','clearZombieChannel','getContactRecallMe','agentReadyId','agents','isNil','getDiff','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview'];(function(_0xc45d40,_0x8c1bb1){var _0x8dd84=function(_0x20d138){while(--_0x20d138){_0xc45d40['push'](_0xc45d40['shift']());}};_0x8dd84(++_0x8c1bb1);}(_0x946d,0x1f4));var _0xd946=function(_0x364e9c,_0x12db51){_0x364e9c=_0x364e9c-0x0;var _0x3c8430=_0x946d[_0x364e9c];return _0x3c8430;};'use strict';var util=require('util');var _=require(_0xd946('0x0'));var BPromise=require(_0xd946('0x1'));var uuid=require(_0xd946('0x2'));var moment=require(_0xd946('0x3'));var md5=require(_0xd946('0x4'));var Redis=require('ioredis');var config=require(_0xd946('0x5'));var logger=require(_0xd946('0x6'))(_0xd946('0x7'));var loggerAction=require(_0xd946('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xd946('0x8'));config[_0xd946('0x9')]=_[_0xd946('0xa')](config[_0xd946('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xd946('0xb'))(new Redis(config[_0xd946('0x9')]));var Sequence=function(){};Sequence[_0xd946('0xc')][_0xd946('0xd')]=function(_0x549b0f){this[_0xd946('0xe')]=this[_0xd946('0xe')]?this[_0xd946('0xe')]['finally'](_0x549b0f):_0x549b0f();};function Preview(_0x5080a2){this[_0xd946('0xf')]=new Sequence();this[_0xd946('0x10')]=_0x5080a2['voiceQueues'];this['trunks']=_0x5080a2['trunks'];this['actions']={};this['agents']=_0x5080a2['agents'];this[_0xd946('0x11')]=0x0;ami['on'](_0xd946('0x12'),this[_0xd946('0x13')][_0xd946('0x14')](this));ami['on']('hangup',this[_0xd946('0x15')][_0xd946('0x14')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xd946('0x14')](this));ami['on'](_0xd946('0x16'),this[_0xd946('0x17')][_0xd946('0x14')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0xd946('0x18'),this['syncVarSet'][_0xd946('0x14')](this));ami['on'](_0xd946('0x19'),this[_0xd946('0x1a')][_0xd946('0x14')](this));ami['on'](_0xd946('0x1b'),this[_0xd946('0x1c')][_0xd946('0x14')](this));this[_0xd946('0x1d')](this[_0xd946('0x10')]);}function emit(_0x38688e,_0x19960e,_0x560384){io['to'](_0x38688e)[_0xd946('0x1e')](_0x19960e,_0x560384);}function emitCampaignPreview(_0x331037){if(_0x331037[_0xd946('0x1f')]===_0xd946('0x20')){var _0x5cfa7f={'id':_0x331037['id'],'name':_0x331037['name'],'strategy':_0x331037[_0xd946('0x21')],'answered':_0x331037[_0xd946('0x22')],'available':_0x331037[_0xd946('0x23')],'loggedIn':_0x331037[_0xd946('0x24')],'pTalking':_0x331037[_0xd946('0x25')],'sumBillable':_0x331037[_0xd946('0x26')],'sumDuration':_0x331037[_0xd946('0x27')],'sumHoldTime':_0x331037[_0xd946('0x28')]||0x0,'talking':_0x331037[_0xd946('0x29')],'total':_0x331037[_0xd946('0x2a')],'type':_0x331037[_0xd946('0x1f')],'unmanaged':_0x331037[_0xd946('0x2b')],'abandoned':_0x331037['abandoned'],'waiting':_0x331037[_0xd946('0x2c')],'loggedInDb':_0x331037[_0xd946('0x2d')],'dialActive':_0x331037[_0xd946('0x2e')],'dialMethod':_0x331037['dialMethod'],'dialOriginateCallerIdName':_0x331037[_0xd946('0x2f')],'dialOriginateCallerIdNumber':_0x331037[_0xd946('0x30')],'dialOriginateTimeout':_0x331037[_0xd946('0x31')],'dialPrefix':_0x331037[_0xd946('0x32')],'outboundAnswerAgiCallsDay':_0x331037[_0xd946('0x33')],'outboundAnswerCallsDay':_0x331037[_0xd946('0x34')],'outboundBlacklistCallsDay':_0x331037[_0xd946('0x35')],'outboundBusyCallsDay':_0x331037['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x331037[_0xd946('0x36')],'outboundDropCallsDayACS':_0x331037[_0xd946('0x37')],'outboundDropCallsDayCallersExit':_0x331037[_0xd946('0x38')],'outboundDropCallsDayTimeout':_0x331037[_0xd946('0x39')],'outboundNoAnswerCallsDay':_0x331037[_0xd946('0x3a')],'outboundNoSuchCallsDay':_0x331037[_0xd946('0x3b')],'outboundOriginateFailureCallsDay':_0x331037[_0xd946('0x3c')],'outboundReCallsDay':_0x331037[_0xd946('0x3d')],'outboundRejectCallsDay':_0x331037[_0xd946('0x3e')],'outboundUnknownCallsDay':_0x331037['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x331037[_0xd946('0x3f')],'predictiveIntervalAnsweredCalls':_0x331037[_0xd946('0x40')],'predictiveIntervalAvgHoldtime':_0x331037['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x331037[_0xd946('0x41')],'predictiveIntervalDroppedCallsCallersExit':_0x331037[_0xd946('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x331037[_0xd946('0x43')],'predictiveIntervalErlangCalls':_0x331037['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x331037['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x331037['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x331037[_0xd946('0x44')],'predictiveIntervalPauses':_0x331037[_0xd946('0x45')],'predictiveIntervalAvailable':_0x331037[_0xd946('0x46')],'predictiveIntervalTotalCalls':_0x331037[_0xd946('0x47')],'message':_0x331037[_0xd946('0x48')],'originated':_0x331037[_0xd946('0x49')],'erlangCalls':_0x331037[_0xd946('0x4a')],'erlangCallToSecond':_0x331037[_0xd946('0x4b')],'erlangAbandonmentRate':_0x331037[_0xd946('0x4c')],'erlangBusyFactor':_0x331037[_0xd946('0x4d')],'startPredictive':_0x331037[_0xd946('0x4e')],'startProgressive':_0x331037[_0xd946('0x4f')]};if(_0x331037[_0xd946('0x50')]){_0x5cfa7f['Trunk']={'id':_0x331037[_0xd946('0x50')]['id'],'name':_0x331037[_0xd946('0x50')][_0xd946('0x51')],'active':_0x331037[_0xd946('0x50')]['active'],'callerid':_0x331037['Trunk'][_0xd946('0x52')]};}if(_0x331037['Interval']){_0x5cfa7f[_0xd946('0x53')]={'id':_0x331037[_0xd946('0x53')]['id'],'name':_0x331037[_0xd946('0x53')]['name']};}var _0x3a950a=md5(JSON[_0xd946('0x54')](_0x5cfa7f));if(_0x331037['md5']!==_0x3a950a){_0x331037[_0xd946('0x4')]=_0x3a950a;emit(util[_0xd946('0x55')](_0xd946('0x56'),_0x5cfa7f[_0xd946('0x51')]),_0xd946('0x57'),_0x5cfa7f);}}}function emitVoiceQueueChannelRemove(_0x4cb21b){logger[_0xd946('0x58')](_0xd946('0x59'),JSON[_0xd946('0x54')](_0x4cb21b));emit(util['format']('voice:queue:%s',_0x4cb21b[_0xd946('0x51')]),_0xd946('0x5a'),_0x4cb21b);io[_0xd946('0x1e')](_0xd946('0x5b'),_0x4cb21b);}function notSendMessagesQueue(_0x25da6d){if(_0x25da6d[_0xd946('0x5c')]){if(_0x25da6d[_0xd946('0x49')]===0x0&&_0x25da6d[_0xd946('0x25')]===0x0){_0x25da6d[_0xd946('0x5c')]=![];_0x25da6d[_0xd946('0x23')]=0x0;_0x25da6d[_0xd946('0x5d')]=0x0;_0x25da6d[_0xd946('0x48')]=_0xd946('0x5e');ut[_0xd946('0x5f')](_0xd946('0x60'),_0x25da6d['name']+'\x20is\x20not\x20active');}else{_0x25da6d[_0xd946('0x48')]=_0xd946('0x61');ut[_0xd946('0x5f')](_0xd946('0x60'),_0x25da6d[_0xd946('0x51')]+_0xd946('0x62'));}emitCampaignPreview(_0x25da6d);}}Preview[_0xd946('0xc')]['loopCampaigns']=function(){var _0x5ed713=this;setInterval(function(){_0x5ed713[_0xd946('0x63')]();},0x7cf);};Preview[_0xd946('0xc')][_0xd946('0x63')]=function(){var _0x31d306=this[_0xd946('0x10')];this[_0xd946('0x11')]+=0x1;for(var _0xa5a495 in _0x31d306){if(_0x31d306['hasOwnProperty'](_0xa5a495)&&(_0x31d306[_0xa5a495]['dialMethod']===_0xd946('0x7')||_0x31d306[_0xa5a495][_0xd946('0x64')]==='booked')&&_0x31d306[_0xa5a495][_0xd946('0x1f')]===_0xd946('0x20')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0xd946('0x65')]();}}if(_0x31d306[_0xd946('0x66')](_0xa5a495)&&_0x31d306[_0xa5a495][_0xd946('0x64')]==='preview'&&_0x31d306[_0xa5a495][_0xd946('0x1f')]===_0xd946('0x20')){if(_0x31d306[_0xa5a495][_0xd946('0x2e')]){this[_0xd946('0x67')](_0x31d306[_0xa5a495]);this[_0xd946('0x68')](_0x31d306[_0xa5a495]);}else{notSendMessagesQueue(_0x31d306[_0xa5a495]);}}}};Preview[_0xd946('0xc')]['clearZombieChannel']=function(_0x4bfe5e){var _0x1d5ebe=this;this[_0xd946('0xf')][_0xd946('0xd')](function(){if(!_['isNil'](_0x1d5ebe['actions'][_0x4bfe5e])){loggerAction[_0xd946('0x58')](_0xd946('0x69'),_0x4bfe5e,'Queue',_0x1d5ebe['actions'][_0x4bfe5e][_0xd946('0x6a')],_0xd946('0x6b'),JSON[_0xd946('0x54')](_0x1d5ebe['campaignsPreview'][_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e]['queue']][_0xd946('0x49')]),_0xd946('0x6d'),JSON[_0xd946('0x54')](_0x1d5ebe['campaignsPreview'][_0x1d5ebe['actions'][_0x4bfe5e]['queue']]['pTalking']),JSON[_0xd946('0x54')](_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e]['dialAnswer']),JSON[_0xd946('0x54')](_[_0xd946('0x6e')](_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e],['contactId',_0xd946('0x6f'),'VoiceQueueId','ListId'])));return ami[_0xd946('0x70')]({'action':_0xd946('0x71'),'channel':_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e][_0xd946('0x72')]})[_0xd946('0x73')](function(_0x5dfa96){if(_0x5dfa96[_0xd946('0x48')]===_0xd946('0x74')){setTimeout(function(){if(_0x1d5ebe['actions'][_0x4bfe5e]){ut[_0xd946('0x75')](_0x1d5ebe['campaignsPreview'][_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e][_0xd946('0x6a')]],_0xd946('0x76'));if(_0x1d5ebe['actions'][_0x4bfe5e][_0xd946('0x77')]===!![]){ut[_0xd946('0x78')](_0x1d5ebe['campaignsPreview'][_0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e][_0xd946('0x6a')]],_0xd946('0x76'));ut[_0xd946('0x79')](_0xd946('0x7a')+_0x4bfe5e,_0x1d5ebe['actions'][_0x4bfe5e][_0xd946('0x6a')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x4bfe5e,_0x1d5ebe['actions'][_0x4bfe5e]['queue']);delete _0x1d5ebe[_0xd946('0x6c')][_0x4bfe5e];}},0x2328);}});}});};Preview['prototype'][_0xd946('0x65')]=function(){var _0x3a75df=this;loggerAction[_0xd946('0x58')](_0xd946('0x7b'),_['size'](this[_0xd946('0x6c')]));for(var _0x260fc1 in this['actions']){if(_0x3a75df['actions']['hasOwnProperty'](_0x260fc1)){_0x3a75df[_0xd946('0x7c')](_0x260fc1);}}};Preview[_0xd946('0xc')][_0xd946('0x68')]=function(_0x5a0813){var _0xe10297=this;rpcDb[_0xd946('0x7d')](_0x5a0813['id'],ut[_0xd946('0x7e')](this[_0xd946('0x7f')]))['then'](function(_0x24ffc5){if(!_[_0xd946('0x80')](_0x24ffc5)){for(var _0x1340ba=0x0;_0x1340ba<_0x24ffc5['length'];_0x1340ba+=0x1){if(ut[_0xd946('0x81')](_0x24ffc5[_0x1340ba]['scheduledat'])<_0x5a0813[_0xd946('0x82')]*0x3c){if(_0x24ffc5[_0x1340ba][_0xd946('0x83')]&&!_0x24ffc5[_0x1340ba][_0xd946('0x83')][_0xd946('0x84')]){_0xe10297['run'](_0x24ffc5[_0x1340ba]['id'])['then'](ut[_0xd946('0x85')](_0xd946('0x86')))[_0xd946('0x73')](ut[_0xd946('0x85')](_0xd946('0x86')));}else{rpcDb['disableContact'](_0x24ffc5[_0x1340ba]['id']);}}else{var _0x232594=new Action(_0x24ffc5[_0x1340ba],_0x5a0813);_0x232594[_0xd946('0x87')]=moment()['format'](_0xd946('0x88'));_0x5a0813['outboundReCallsDay']+=0x1;ut[_0xd946('0x89')](_0x232594,0x17,_0xd946('0x8a'));if(_0x5a0813[_0xd946('0x8b')]){rpcDb[_0xd946('0x8c')](ut[_0xd946('0x8d')](_0x24ffc5[_0x1340ba]));rpcDb[_0xd946('0x8e')](_0x232594,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xd946('0x89')](_0x232594,0x16,_0xd946('0x8f'));rpcDb[_0xd946('0x8e')](_0x232594,_0xd946('0x90'));rpcDb['createCustomerFinal'](_0x232594,_0xd946('0x90'));}}}}})[_0xd946('0x73')](ut[_0xd946('0x85')](_0xd946('0x91')));};Preview[_0xd946('0xc')]['setMessage']=function(_0x26375f){_0x26375f[_0xd946('0x5c')]=!![];if(ut[_0xd946('0x92')](_0x26375f[_0xd946('0x24')])){_0x26375f[_0xd946('0x48')]=_0xd946('0x93');}else if(!ut[_0xd946('0x94')](_0x26375f[_0xd946('0x2e')])){_0x26375f[_0xd946('0x48')]='NOT_ACTIVE';}else if(!this[_0xd946('0x95')](_0x26375f[_0xd946('0x50')])){if(!this[_0xd946('0x95')](_0x26375f['TrunkBackup'])){_0x26375f[_0xd946('0x48')]=_0xd946('0x96');}else{_0x26375f[_0xd946('0x48')]=_0xd946('0x97');}}else{_0x26375f['message']=_0xd946('0x97');}emitCampaignPreview(_0x26375f);};Preview[_0xd946('0xc')][_0xd946('0x98')]=function(_0x19e6d7,_0x162df1,_0x4972bd){var _0x5ccaf2=this;var _0x61b816=this[_0xd946('0x6c')][_0x162df1];var _0x5e22cf=this[_0xd946('0x10')][_0x61b816[_0xd946('0x6a')]];var _0x20d8dd;if(_0x5e22cf){switch(_0x4972bd){case'1':_0x5e22cf[_0xd946('0x3b')]+=0x1;_0x61b816[_0xd946('0x99')]+=0x1;_0x61b816['countglobal']=ut['totalGlobal'](_0x61b816);ut['logCustomer'](_0x61b816,0x0,_0xd946('0x9a'));ami[_0xd946('0x1e')](_0xd946('0x9b'),ut[_0xd946('0x9c')](_0x61b816,_0xd946('0x9d')));rpcDb[_0xd946('0x8e')](_0x61b816,_0xd946('0x9e'));if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,_0xd946('0xa2'));rpcDb['createCustomerFinal'](_0x20d8dd,_0xd946('0xa3'));}else{if(_0x61b816['countnosuchnumberretry']>=_0x5e22cf[_0xd946('0xa4')]){rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xa3'));}else{rpcDb[_0xd946('0xa6')](ut[_0xd946('0xa7')](_0x61b816,_0xd946('0x99'),_0x5e22cf[_0xd946('0xa8')]),_0x61b816['unlockAgent'],_0x61b816[_0xd946('0xa9')]);}}delete this[_0xd946('0x6c')][_0x19e6d7[_0xd946('0xaa')]];break;case _0xd946('0xab'):var _0x13362a=moment()[_0xd946('0x55')](_0xd946('0x88'));_0x61b816[_0xd946('0xac')]=_0x13362a;_0x61b816[_0xd946('0xad')]=_0x13362a;_0x61b816[_0xd946('0x77')]=!![];_0x5e22cf[_0xd946('0x25')]+=0x1;logger[_0xd946('0x58')]('[syncHangup][talking][increment]',_0x61b816[_0xd946('0xae')],_0xd946('0xaf'),_0x5e22cf[_0xd946('0x51')],_0xd946('0x6d'),_0x5e22cf[_0xd946('0x25')]);ami[_0xd946('0x1e')](_0xd946('0xb0'),ut[_0xd946('0x9c')](_0x61b816,_0xd946('0xb1'),this[_0xd946('0x10')][_0x61b816['queue']]));if(_0x5e22cf[_0xd946('0xb2')]){ami['emit'](_0xd946('0xb3'),ut[_0xd946('0xb4')](_0x61b816));}break;case'16':ami[_0xd946('0x1e')]('custom:agentcomplete',ut[_0xd946('0x9c')](_0x61b816,_0xd946('0xb5'),this[_0xd946('0x10')][_0x61b816['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x61b816,_0xd946('0xb5')));_0x5e22cf[_0xd946('0x34')]+=0x1;_0x5e22cf[_0xd946('0x2a')]+=0x1;_0x5e22cf['answered']+=0x1;ut['decrementTalkink'](_0x5e22cf,'[16]');_0x61b816[_0xd946('0xb6')]=ut['totalGlobal'](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0x4,_0xd946('0xb7'));rpcDb[_0xd946('0x8e')](_0x61b816,_0xd946('0xb8'));rpcDb[_0xd946('0xa5')](_0x61b816,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xd946('0xb9')](_0x61b816);_0x5e22cf[_0xd946('0x27')]+=_0x61b816[_0xd946('0xba')];_0x5e22cf[_0xd946('0x26')]+=_0x61b816[_0xd946('0xba')];logger[_0xd946('0x58')](_0xd946('0xbb'),_0x61b816[_0xd946('0xae')],_0xd946('0xaf'),_0x5e22cf[_0xd946('0x51')],'pTalking:\x20',_0x5e22cf[_0xd946('0x25')]);delete this[_0xd946('0x6c')][_0x19e6d7[_0xd946('0xaa')]];break;case _0xd946('0xbc'):_0x5e22cf[_0xd946('0xbd')]+=0x1;_0x61b816[_0xd946('0xbe')]+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut['logCustomer'](_0x61b816,0x5,_0xd946('0xbf'));ami[_0xd946('0x1e')](_0xd946('0xc0'),ut[_0xd946('0x9c')](_0x61b816,_0xd946('0xc1')));rpcDb[_0xd946('0x8e')](_0x61b816,_0xd946('0xc2'));if(ut['totalGlobal'](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,_0xd946('0xa2'));rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xc3'));}else{if(_0x61b816[_0xd946('0xbe')]>=_0x5e22cf[_0xd946('0xc4')]){rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xc2'));}else{rpcDb[_0xd946('0xa6')](ut['scheduledAt'](_0x61b816,_0xd946('0xbe'),_0x5e22cf[_0xd946('0xc5')]),_0x61b816[_0xd946('0xc6')],_0x61b816['activeContact']);}}break;case _0xd946('0xc7'):_0x5e22cf[_0xd946('0x3a')]+=0x1;_0x61b816[_0xd946('0xc8')]+=0x1;_0x61b816['countglobal']=ut[_0xd946('0x9f')](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0x3,'NoAnswer');ami['emit'](_0xd946('0xc9'),ut['buildObj'](_0x61b816,_0xd946('0xca')));rpcDb['createCustomerHistory'](_0x61b816,_0xd946('0xcb'));if(ut['totalGlobal'](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,_0xd946('0xa2'));rpcDb[_0xd946('0xa5')](_0x20d8dd,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x61b816[_0xd946('0xc8')]>=_0x5e22cf[_0xd946('0xcc')]){rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xcb'));}else{rpcDb[_0xd946('0xa6')](ut[_0xd946('0xa7')](_0x61b816,_0xd946('0xc8'),_0x5e22cf['dialNoAnswerRetryFrequency']),_0x61b816[_0xd946('0xc6')],_0x61b816['activeContact']);}}break;case'CONGESTION':_0x5e22cf['outboundCongestionCallsDay']+=0x1;_0x61b816[_0xd946('0xcd')]+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut['logCustomer'](_0x61b816,0x8,_0xd946('0xce'));ami[_0xd946('0x1e')](_0xd946('0xcf'),ut[_0xd946('0x9c')](_0x61b816,'congestion'));rpcDb[_0xd946('0x8e')](_0x61b816,_0xd946('0xd0'));if(ut['totalGlobal'](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,'Global');rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xd1'));}else{if(_0x61b816[_0xd946('0xcd')]>=_0x5e22cf['dialCongestionMaxRetry']){rpcDb[_0xd946('0xa5')](_0x61b816,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd946('0xa6')](ut['scheduledAt'](_0x61b816,'countcongestionretry',_0x5e22cf['dialBusyRetryFrequency']),_0x61b816[_0xd946('0xc6')],_0x61b816[_0xd946('0xa9')]);}}break;case _0xd946('0xd2'):_0x5e22cf[_0xd946('0x3e')]+=0x1;_0x61b816[_0xd946('0xd3')]+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0x14,_0xd946('0xd4'));ami[_0xd946('0x1e')](_0xd946('0xd5'),ut[_0xd946('0x9c')](_0x61b816,_0xd946('0xd6')));rpcDb['createCustomerHistory'](_0x61b816,'[syncHangupRequest][logAgentReject]');if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut['cloneAction'](_0x61b816,0x14,'AgentReject');rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xd7'));}else{if(_0x61b816[_0xd946('0xd3')]>=_0x5e22cf[_0xd946('0xd8')]){rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xd7'));}else{rpcDb['rescheduleContact'](ut[_0xd946('0xa7')](_0x61b816,_0xd946('0xd3'),_0x5e22cf['dialAgentRejectRetryFrequency']),_0x61b816[_0xd946('0xc6')],_0x61b816[_0xd946('0xa9')]);}}break;case _0xd946('0xd9'):_0x5e22cf[_0xd946('0x3f')]+=0x1;_0x61b816[_0xd946('0xda')]+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0xb,_0xd946('0xdb'));rpcDb['createCustomerHistory'](_0x61b816,_0xd946('0xdc'));if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut['cloneAction'](_0x61b816,0xf,_0xd946('0xa2'));rpcDb[_0xd946('0xa5')](_0x20d8dd,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x61b816[_0xd946('0xdd')]>=_0x5e22cf[_0xd946('0xde')]){rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xdc'));}else{rpcDb['rescheduleContact'](ut[_0xd946('0xa7')](_0x61b816,'countabandonedretry',_0x5e22cf[_0xd946('0xdf')]),_0x61b816[_0xd946('0xc6')],_0x61b816['activeContact']);}}break;case'18':_0x5e22cf[_0xd946('0xe0')]+=0x1;_0x61b816[_0xd946('0xe1')]+=0x1;_0x61b816[_0xd946('0xb6')]=ut['totalGlobal'](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0x12,_0x19e6d7[_0xd946('0xe2')]||_0x19e6d7[_0xd946('0xe3')]);ami[_0xd946('0x1e')]('custom:amd',ut[_0xd946('0x9c')](_0x61b816,'amd'));rpcDb[_0xd946('0x8e')](_0x61b816,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,'Global');rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xe4'));}else{rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xe4'));}delete this[_0xd946('0x6c')][_0x19e6d7[_0xd946('0xaa')]];break;case'19':_0x5e22cf['outboundUnknownCallsDay']+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0x13,_0x19e6d7[_0xd946('0xe2')]||_0x19e6d7[_0xd946('0xe3')]);ami[_0xd946('0x1e')](_0xd946('0xe5'),ut[_0xd946('0x9c')](_0x61b816,_0xd946('0xe6')));rpcDb[_0xd946('0x8e')](_0x61b816,_0xd946('0xe7'));if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut[_0xd946('0xa1')](_0x61b816,0xf,_0xd946('0xa2'));rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xe7'));}else{rpcDb[_0xd946('0xa5')](_0x61b816,_0xd946('0xe7'));}delete this[_0xd946('0x6c')][_0x19e6d7['linkedid']];break;default:if(_0x61b816[_0xd946('0x77')]){ut[_0xd946('0x78')](_0x5e22cf,_0xd946('0xe8'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5e22cf[_0xd946('0x51')],_0x19e6d7);}_0x5e22cf['outboundUnknownCallsDay']+=0x1;_0x61b816[_0xd946('0xb6')]=ut[_0xd946('0x9f')](_0x61b816);ut[_0xd946('0x89')](_0x61b816,0xc,_0x19e6d7[_0xd946('0xe2')]||_0x19e6d7[_0xd946('0xe3')]);rpcDb['createCustomerHistory'](_0x61b816,_0xd946('0xe9'));if(ut[_0xd946('0x9f')](_0x61b816)>=_0x5e22cf[_0xd946('0xa0')]){_0x20d8dd=ut['cloneAction'](_0x61b816,0xf,_0xd946('0xa2'));rpcDb[_0xd946('0xa5')](_0x20d8dd,_0xd946('0xea'));}else{rpcDb[_0xd946('0xa5')](_0x61b816,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xd946('0x6c')][_0x19e6d7[_0xd946('0xaa')]];}if(!(_0x61b816[_0xd946('0x77')]&&_0x4972bd==='16')){ut[_0xd946('0x75')](_0x5e22cf,_0xd946('0xeb'));logger[_0xd946('0x58')]('[originated][decrement][callProgressDetectingCustomer]',_0x61b816[_0xd946('0xae')],'\x20Queue',_0x5e22cf[_0xd946('0x51')],'originated:\x20',_0x5e22cf[_0xd946('0x49')]);}if(_0x4972bd!==_0xd946('0xab')){delete this['actions'][_0x19e6d7[_0xd946('0xaa')]];delete this[_0xd946('0x6c')][_0x19e6d7[_0xd946('0xec')]];}}};Preview['prototype'][_0xd946('0xed')]=function(_0x2d34c4,_0x3c1660,_0x5ae334){if(_[_0xd946('0xee')](_0x3c1660)&&_0xd946('0xef')!==typeof _0x3c1660){return;}if(_['isUndefined'](_0x5ae334)&&_0xd946('0xef')!==typeof _0x5ae334){return;}switch(_0x5ae334[_0xd946('0xf0')]){case'0':ut['logAgent'](_0x2d34c4,0x0,_0xd946('0x9a'));rpcDb[_0xd946('0xf1')](_0x2d34c4,_0xd946('0xf2'));break;case'3':ut[_0xd946('0xf3')](_0x2d34c4,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x2d34c4,_0xd946('0xf4'));break;case'5':ut['logAgent'](_0x2d34c4,0x5,_0xd946('0xbf'));rpcDb[_0xd946('0xf1')](_0x2d34c4,_0xd946('0xf5'));break;case'8':ut[_0xd946('0xf3')](_0x2d34c4,0x8,_0xd946('0xce'));rpcDb[_0xd946('0xf1')](_0x2d34c4,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x2d34c4,0x16,'AnswerAGI');rpcDb[_0xd946('0xf1')](_0x2d34c4,_0xd946('0xf6'));break;default:ut[_0xd946('0xf3')](_0x2d34c4,0xc,_0x5ae334[_0xd946('0xf0')]);rpcDb[_0xd946('0xf1')](_0x2d34c4,_0xd946('0xf7'));}ut['updateOriginated'](_0x3c1660,_0xd946('0xf8'));logger['info'](_0xd946('0xf9'),_0x2d34c4[_0xd946('0xae')],_0xd946('0xaf'),_0x3c1660[_0xd946('0x51')],_0xd946('0x6b'),_0x3c1660[_0xd946('0x49')]);delete this[_0xd946('0x6c')][_0x2d34c4[_0xd946('0xae')]];};Preview[_0xd946('0xc')][_0xd946('0xfa')]=function(_0x319010,_0x51403d,_0x530f9d,_0x3a057f,_0x4d9bdb){var _0x119064=this;return new BPromise(function(_0xcd6242,_0x147865){if(_['isNil'](_0x51403d)||_[_0xd946('0x80')](_0x51403d['Contact'])||_[_0xd946('0x80')](_0x51403d[_0xd946('0xfb')]['phone'])||_[_0xd946('0x80')](_0x51403d[_0xd946('0xfc')])){_0x147865(ut[_0xd946('0x48')](_0xd946('0xfd'),_0x3a057f,_0x4d9bdb));return;}var _0x4b8ba1=uuid['v4']();var _0x55fc18=_0x119064[_0xd946('0x10')][_0x51403d[_0xd946('0xfe')][_0xd946('0x51')]];var _0x58a24e=_0x530f9d?_0x119064[_0xd946('0x7f')][_0x530f9d]['id']:undefined;_0x119064[_0xd946('0x6c')][_0x4b8ba1]=new Action(_0x51403d,_0x55fc18,_0x4b8ba1,_0x530f9d,_0x58a24e);var _0x46003c=_0x119064[_0xd946('0x6c')][_0x4b8ba1];_0x46003c['unlockAgent']=_0x3a057f;_0x46003c['activeContact']=_0x4d9bdb;_0x46003c[_0xd946('0xff')]=_0x530f9d;if(_['isEmpty'](_0x319010)){_0x119064[_0xd946('0x100')](_0x46003c,_0x55fc18,_0x51403d,_0x530f9d)[_0xd946('0x101')](function(_0xbfafde){logger[_0xd946('0x58')](_0xd946('0x102'),'Queue:\x20'+_0x46003c[_0xd946('0x6a')]+'\x20IdHopper:\x20'+_0x46003c[_0xd946('0x103')],JSON['stringify'](_0xbfafde));ami[_0xd946('0x1e')](_0xd946('0x104'),ut[_0xd946('0x9c')](_0x46003c,_0xd946('0x105'),_0x119064[_0xd946('0x10')][_0x46003c[_0xd946('0x6a')]]));_0xcd6242(ut[_0xd946('0x48')]('Calling'));})['catch'](function(_0x4dc334){ut[_0xd946('0x5f')](_0xd946('0x106'),_0x4dc334);_0x147865(ut[_0xd946('0x48')]('Call\x20failed',_0x3a057f,_0x4d9bdb));});}else{_0x55fc18['outboundBlacklistCallsDay']+=0x1;ut[_0xd946('0x107')](_0x46003c);rpcDb['createHistory'](_0x46003c,_0xd946('0x108'));delete _0x119064[_0xd946('0x6c')][_0x4b8ba1];_0x147865(ut[_0xd946('0x48')](_0xd946('0x109'),_0x3a057f,_0x4d9bdb));}});};Preview[_0xd946('0xc')][_0xd946('0x95')]=function(_0xc4aea2){return!_[_0xd946('0x80')](_0xc4aea2)&&!_[_0xd946('0x80')](_0xc4aea2[_0xd946('0x51')])&&!_['isNil'](_0xc4aea2[_0xd946('0x10a')])&&_0xc4aea2[_0xd946('0x10a')]&&!_['isNil'](this[_0xd946('0x10b')][util[_0xd946('0x55')](_0xd946('0x10c'),_0xc4aea2[_0xd946('0x51')])])&&!_[_0xd946('0x80')](this[_0xd946('0x10b')][util['format'](_0xd946('0x10c'),_0xc4aea2[_0xd946('0x51')])]['status'])&&(this[_0xd946('0x10b')][util['format'](_0xd946('0x10c'),_0xc4aea2['name'])][_0xd946('0x71')]===_0xd946('0x10d')||this[_0xd946('0x10b')][util[_0xd946('0x55')](_0xd946('0x10c'),_0xc4aea2[_0xd946('0x51')])][_0xd946('0x71')]===_0xd946('0x10e'));};Preview[_0xd946('0xc')]['run']=function(_0x24a056,_0x3f61fd){var _0x5b50aa=this;return new BPromise(function(_0xde4561,_0x24a5b8){_0x5b50aa[_0xd946('0x10f')](_0x24a056,_0x3f61fd)[_0xd946('0x101')](function(_0x4e5601){_0xde4561(_['pick'](_0x4e5601,[_0xd946('0x48')]));})[_0xd946('0x73')](function(_0x57086a){if(_0x57086a[_0xd946('0x110')]){rpcDb[_0xd946('0x111')](_0x24a056);}if(_0x57086a[_0xd946('0x10a')]){rpcDb[_0xd946('0x112')](_0x24a056);}_0x24a5b8(_['pick'](_0x57086a,[_0xd946('0x48')]));});});};Preview[_0xd946('0xc')][_0xd946('0x10f')]=function(_0x34ec8e,_0x5e3139){var _0x59fb3c=this;return new BPromise(function(_0x50f9b2,_0x453986){var _0x2cfb9a,_0x334b84;rpcDb[_0xd946('0x113')](_0x34ec8e)[_0xd946('0x101')](function(_0x3aadb7){if(!_[_0xd946('0x80')](_0x3aadb7[0x0])){_0x334b84=_0x3aadb7[0x0]['recallme']?![]:!![];_0x2cfb9a=_0x3aadb7[0x0][_0xd946('0x114')]?!![]:![];_0x2cfb9a=_0x5e3139?!![]:_0x2cfb9a;}var _0x239ba0=_0x59fb3c[_0xd946('0x115')](_0x3aadb7);if(_0x239ba0[_0xd946('0x116')]){rpcDb[_0xd946('0x117')](_['pick'](_0x3aadb7[0x0],[_0xd946('0xfc'),_0xd946('0x118')]))[_0xd946('0x101')](function(_0x288926){_0x59fb3c[_0xd946('0xfa')](_0x288926,_0x3aadb7[0x0],_0x5e3139,_0x334b84,_0x2cfb9a)[_0xd946('0x101')](function(_0x29635d){_0x50f9b2(_0x29635d);})[_0xd946('0x73')](function(_0x53b7c0){_0x453986(_0x53b7c0);});})['catch'](function(_0x1c81f0){ut[_0xd946('0x5f')](_0xd946('0x119'),_0x1c81f0);_0x453986(ut[_0xd946('0x48')](_0xd946('0x11a'),_0x334b84,_0x2cfb9a));});}else{_0x453986(ut[_0xd946('0x48')](_0x239ba0[_0xd946('0x48')],_0x334b84,_0x2cfb9a));}})[_0xd946('0x73')](function(_0x2e193b){ut[_0xd946('0x5f')]('[Preview][getContactPreview]',_0x2e193b);_0x453986(ut[_0xd946('0x48')](_0xd946('0x11a'),![],!![]));});});};Preview[_0xd946('0xc')][_0xd946('0x115')]=function(_0x5db708){if(_['isNil'](_0x5db708)||_[_0xd946('0x11b')](_0x5db708)||!_['isNil'](_0x5db708[0x0]['Agent'])&&_['isNil'](_0x5db708[0x0][_0xd946('0x83')][_0xd946('0x51')])){ut[_0xd946('0x5f')](_0xd946('0x11c'),_0x5db708);return{'isValid':![],'message':_0xd946('0x11d')};}var _0x1acb3c=this[_0xd946('0x10')][_0x5db708[0x0][_0xd946('0xfe')][_0xd946('0x51')]];_0x1acb3c[_0xd946('0x48')]=_0xd946('0x97');if(_[_0xd946('0x80')](_0x1acb3c)){ut[_0xd946('0x5f')](_0xd946('0x11e'),_0x1acb3c);return{'isValid':![],'message':_0xd946('0x11f')};}if(!this[_0xd946('0x95')](_0x1acb3c[_0xd946('0x50')])){ut[_0xd946('0x5f')](_0xd946('0x120'),_0xd946('0x121')+_0x1acb3c[_0xd946('0x51')]+_0xd946('0x122'));if(!this[_0xd946('0x95')](_0x1acb3c[_0xd946('0x123')])){ut[_0xd946('0x5f')](_0xd946('0x120'),_0x1acb3c['name']+_0xd946('0x124'));return{'isValid':![],'message':_0xd946('0x125')};}}if(!ut[_0xd946('0x94')](_0x1acb3c['dialActive'])){ut['logger'](_0xd946('0x126'),_0x1acb3c['name']+_0xd946('0x127'));return{'isValid':![],'message':_0xd946('0x121')+_0x1acb3c[_0xd946('0x51')]+_0xd946('0x127')};}return{'isValid':!![],'message':_0xd946('0x128')};};Preview[_0xd946('0xc')]['execCall']=function(_0x5129aa,_0x3abef4,_0x2edc6d,_0x28414e){var _0x2f898b=this;return new BPromise(function(_0x406017,_0x98f8de){var _0x555f88=_0x5129aa['uniqueid'];var _0x2dce67=_0x2f898b['isTrunkReachable'](_0x3abef4[_0xd946('0x50')])?util[_0xd946('0x55')](_0xd946('0x129'),_0x3abef4[_0xd946('0x50')][_0xd946('0x51')],_['isNil'](_0x3abef4[_0xd946('0x32')])?'':_0x3abef4['dialPrefix'][_0xd946('0x12a')]()||'',_0x3abef4[_0xd946('0x12b')]>0x0?_0x2edc6d['Contact'][_0xd946('0x12c')][_0xd946('0x12d')](_0x3abef4[_0xd946('0x12b')]):_0x2edc6d[_0xd946('0xfb')][_0xd946('0x12c')]):util['format']('SIP/%s/%s%s',_[_0xd946('0x80')](_0x3abef4['TrunkBackup'])?_0x3abef4[_0xd946('0x50')][_0xd946('0x51')]:_0x3abef4['TrunkBackup'][_0xd946('0x51')],_[_0xd946('0x80')](_0x3abef4['dialPrefix'])?'':_0x3abef4['dialPrefix'][_0xd946('0x12a')]()||'',_0x3abef4[_0xd946('0x12b')]>0x0?_0x2edc6d[_0xd946('0xfb')][_0xd946('0x12c')][_0xd946('0x12d')](_0x3abef4[_0xd946('0x12b')]):_0x2edc6d[_0xd946('0xfb')][_0xd946('0x12c')]);var _0x445808=_0x2f898b[_0xd946('0x95')](_0x3abef4[_0xd946('0x50')])?ut[_0xd946('0x12e')](_0x3abef4[_0xd946('0x50')][_0xd946('0x52')],_0x3abef4[_0xd946('0x2f')],_0x3abef4[_0xd946('0x12f')]>0x0?ut[_0xd946('0x130')](_0x3abef4[_0xd946('0x30')],_0x3abef4[_0xd946('0x12f')]):_0x3abef4['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0xd946('0x80')](_0x3abef4[_0xd946('0x123')])?_0x3abef4[_0xd946('0x50')][_0xd946('0x52')]:_0x3abef4[_0xd946('0x123')][_0xd946('0x52')],_0x3abef4[_0xd946('0x2f')],_0x3abef4[_0xd946('0x12f')]>0x0?ut[_0xd946('0x130')](_0x3abef4['dialOriginateCallerIdNumber'],_0x3abef4[_0xd946('0x12f')]):_0x3abef4[_0xd946('0x30')]);if(_0x445808){_0x5129aa[_0xd946('0x131')]=ut[_0xd946('0x132')](_0x445808);_0x5129aa[_0xd946('0x133')]=ut[_0xd946('0x134')](_0x445808);}var _0x19bafd=ut[_0xd946('0x135')](_0x3abef4,_0x2edc6d,_0x2dce67,_0x445808,_0x555f88,_0x5129aa);_[_0xd946('0x136')](_0x5129aa,ut['toLowerVariables'](_0x19bafd));_0x5129aa[_0xd946('0x87')]=moment()[_0xd946('0x55')](_0xd946('0x88'));ami['Action'](ut['variablesAction'](_0x5129aa,_0x3abef4,_0x19bafd,_0x5129aa['activeContact'],_0x28414e))[_0xd946('0x101')](function(_0x2a11e5){_0x3abef4['originated']+=0x1;logger[_0xd946('0x58')](_0xd946('0x137'),_0x555f88,'\x20Queue',_0x3abef4[_0xd946('0x51')],_0xd946('0x6b'),_0x3abef4['originated']);_0x406017(_0x2a11e5);})[_0xd946('0x73')](function(_0x18742c){ut[_0xd946('0xf3')](_0x5129aa,0xe,_0xd946('0x138'));rpcDb[_0xd946('0xf1')](_0x5129aa,_0xd946('0x139'));_0x98f8de(_0x18742c);});});};Preview[_0xd946('0xc')][_0xd946('0x13a')]=function(_0x512f3c){if(this['actions'][_0x512f3c['linkedid']]){this['actions'][_0x512f3c[_0xd946('0xaa')]][_0xd946('0x72')]=_0x512f3c[_0xd946('0x72')];}};Preview[_0xd946('0xc')][_0xd946('0x13')]=function(_0x5b4344){var _0x47974e=this;var _0x6ca86e=this['actions'][_0x5b4344[_0xd946('0x13b')]];if(_0x6ca86e){if(_0x6ca86e[_0xd946('0xff')]&&this['agents'][_0x6ca86e[_0xd946('0xff')]]){ut[_0xd946('0x13c')](_0x6ca86e,this[_0xd946('0x7f')][_0x6ca86e['lookAgent']][_0xd946('0x51')],this[_0xd946('0x7f')][_0x6ca86e[_0xd946('0xff')]]['id']);}var _0xbad4ae=_[_0xd946('0x13d')](_0x6ca86e);_0xbad4ae[_0xd946('0xac')]=moment()['format'](_0xd946('0x88'));var _0x2049fe=_0x47974e[_0xd946('0x10')][_0x6ca86e[_0xd946('0x6a')]];if(ut['isFailure'](_0x5b4344[_0xd946('0x13e')])){if(_0x6ca86e[_0xd946('0xc6')]){rpcDb[_0xd946('0x111')](_0x6ca86e[_0xd946('0x103')]);}if(_0x6ca86e[_0xd946('0xa9')]){rpcDb[_0xd946('0x112')](_0x6ca86e[_0xd946('0x103')]);}ami[_0xd946('0x1e')]('custom:agentringnoanswer',ut[_0xd946('0x9c')](_0x6ca86e,_0xd946('0x13f'),this[_0xd946('0x10')][_0x6ca86e[_0xd946('0x6a')]]));this['callProgressDetectingAgent'](_0xbad4ae,_0x2049fe,_0x5b4344);}else{_0x6ca86e[_0xd946('0x87')]=moment()[_0xd946('0x55')](_0xd946('0x88'));ut[_0xd946('0xf3')](_0xbad4ae,0x4,_0xd946('0xb7'));rpcDb[_0xd946('0xf1')](_0xbad4ae,_0xd946('0x140'));}}};Preview[_0xd946('0xc')][_0xd946('0x15')]=function(_0x45f794){var _0x2d5c53=this;var _0x1b7a25=this[_0xd946('0x6c')][_0x45f794['linkedid']];var _0x5843f0;if(_0x1b7a25){_0x5843f0=this[_0xd946('0x10')][_0x1b7a25[_0xd946('0x6a')]];logger[_0xd946('0x58')](_0xd946('0x141'),_0x45f794[_0xd946('0xaa')],_0xd946('0xaf'),_0x5843f0['name'],_0xd946('0x6d'),_0x5843f0[_0xd946('0x25')]);}if(this[_0xd946('0x6c')][_0x45f794[_0xd946('0xaa')]]&&_0x45f794[_0xd946('0xaa')]!==_0x45f794['uniqueid']){if(_0x45f794[_0xd946('0x142')]==='16'&&this[_0xd946('0x6c')][_0x45f794['linkedid']][_0xd946('0x77')]){this['callProgressDetectingCustomer'](_0x45f794,_0x45f794[_0xd946('0xaa')],_0x45f794['cause']);}else if(this[_0xd946('0x6c')][_0x45f794[_0xd946('0xaa')]][_0xd946('0x77')]){logger[_0xd946('0x58')]('[syncHangup][talking][cause]',_0x45f794[_0xd946('0xaa')],_0x45f794[_0xd946('0x142')],_0xd946('0xaf'),_0x5843f0[_0xd946('0x51')],_0xd946('0x6d'),_0x5843f0['pTalking']);this[_0xd946('0x98')](_0x45f794,_0x45f794[_0xd946('0xaa')],_0x45f794['cause']);}}else if(_0x1b7a25&&_[_0xd946('0x80')](_0x1b7a25[_0xd946('0x143')])&&_0x5843f0[_0xd946('0x144')]&&_0x45f794[_0xd946('0xaa')]===_0x45f794[_0xd946('0xae')]&&_[_0xd946('0x80')](_0x45f794[_0xd946('0xf0')])&&_0x45f794['cause']==='16'&&_0x45f794[_0xd946('0x145')]==='6'&&_[_0xd946('0xee')](_0x1b7a25[_0xd946('0x146')])){if(_0x1b7a25['unlockAgent']){rpcDb[_0xd946('0x111')](_0x1b7a25[_0xd946('0x103')]);}if(_0x1b7a25['activeContact']){rpcDb['disableContact'](_0x1b7a25[_0xd946('0x103')]);}_0x45f794[_0xd946('0xf0')]='22';this[_0xd946('0xed')](_0x1b7a25,_0x5843f0,_0x45f794);}else if(_0x1b7a25&&_0x1b7a25[_0xd946('0x146')]){if(_0x45f794[_0xd946('0x142')]==='16'&&this[_0xd946('0x6c')][_0x45f794[_0xd946('0xaa')]][_0xd946('0x77')]){logger[_0xd946('0x58')](_0xd946('0x147'),_0x45f794[_0xd946('0xaa')],_0x45f794[_0xd946('0x142')],_0xd946('0xaf'),_0x5843f0[_0xd946('0x51')],_0xd946('0x6d'),_0x5843f0['pTalking']);this[_0xd946('0x98')](_0x45f794,_0x45f794['linkedid'],_0x45f794[_0xd946('0x142')]);}else if(this[_0xd946('0x6c')][_0x45f794[_0xd946('0xaa')]][_0xd946('0x77')]){logger[_0xd946('0x58')]('[syncHangup][talking][cause]',_0x45f794[_0xd946('0xaa')],_0x45f794[_0xd946('0x142')],'\x20Queue',_0x5843f0[_0xd946('0x51')],_0xd946('0x6d'),_0x5843f0[_0xd946('0x25')]);this['callProgressDetectingCustomer'](_0x45f794,_0x45f794['linkedid'],_0x45f794[_0xd946('0x142')]);}}};Preview['prototype'][_0xd946('0x17')]=function(_0x3adf53){if(this['actions'][_0x3adf53[_0xd946('0xec')]]&&_0x3adf53[_0xd946('0xec')]!==_0x3adf53[_0xd946('0x148')]){this['callProgressDetectingCustomer'](_0x3adf53,_0x3adf53[_0xd946('0xec')],_0x3adf53[_0xd946('0xe3')]);}};Preview['prototype'][_0xd946('0x149')]=function(_0xcbe14f){if(this[_0xd946('0x6c')][_0xcbe14f[_0xd946('0xaa')]]&&_0xcbe14f['linkedid']!==_0xcbe14f[_0xd946('0xae')]&&!this[_0xd946('0x6c')][_0xcbe14f[_0xd946('0xaa')]][_0xd946('0x77')]){if(_0xcbe14f[_0xd946('0x142')]==='1'){this[_0xd946('0x98')](_0xcbe14f,_0xcbe14f[_0xd946('0xaa')],_0xcbe14f[_0xd946('0x142')]);}}};Preview[_0xd946('0xc')][_0xd946('0x14a')]=function(_0x204df8,_0x35e30e,_0x3f120e){if(this[_0xd946('0x6c')][_0x204df8]){if(_[_0xd946('0x80')](this['actions'][_0x204df8][_0xd946('0x14b')])){this[_0xd946('0x6c')][_0x204df8][_0xd946('0x14b')]={};}this['actions'][_0x204df8]['variables'][_0x35e30e]=_0x3f120e;}};Preview[_0xd946('0xc')][_0xd946('0x14c')]=function(_0x1f60b9){try{if(!_['isNil'](_0x1f60b9)){if(ut['filterKey'](_[_0xd946('0x14d')](_0x1f60b9[_0xd946('0x14e')])[0x0])){this[_0xd946('0x14a')](_0x1f60b9['uniqueid'],_[_0xd946('0x14d')](_0x1f60b9[_0xd946('0x14e')])[0x0],_0x1f60b9['value']);}}}catch(_0x2b8c02){logger[_0xd946('0x14f')](_0xd946('0x150'),util[_0xd946('0x151')](_0x2b8c02,{'showHidden':![],'depth':null}));}};Preview[_0xd946('0xc')][_0xd946('0x1a')]=function(_0x3702dc){if(_0x3702dc){if(this[_0xd946('0x6c')][_0x3702dc[_0xd946('0x152')]]){this['actions'][_0x3702dc[_0xd946('0x152')]][_0xd946('0x146')]=!![];}}};Preview[_0xd946('0xc')][_0xd946('0x1c')]=function(_0x41581a){if(_0x41581a){if(this[_0xd946('0x6c')][_0x41581a['transfererlinkedid']]){this[_0xd946('0x6c')][_0x41581a[_0xd946('0x153')]][_0xd946('0x146')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index ad16565..43d0a75 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 _0x72d7=['queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo'];(function(_0x20677e,_0x16b4ae){var _0x36fad8=function(_0x4dbdf8){while(--_0x4dbdf8){_0x20677e['push'](_0x20677e['shift']());}};_0x36fad8(++_0x16b4ae);}(_0x72d7,0xb1));var _0x772d=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x72d7[_0x38a7ac];return _0x53061a;};'use strict';var util=require('util');var BPromise=require(_0x772d('0x0'));var logger=require('../../../config/logger')(_0x772d('0x1'));var _=require(_0x772d('0x2'));var cmHopper=require(_0x772d('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x772d('0x4'));var cmHopperBlack=require(_0x772d('0x5'));var voiceQueueRt=require(_0x772d('0x6'));var agentReportPreview=require(_0x772d('0x7'));var voiceQueueReport=require(_0x772d('0x8'));function loggerCatch(_0x10f316){return function(_0x21c68f){logger[_0x772d('0x9')](_0x10f316,util[_0x772d('0xa')](_0x21c68f,{'showHidden':![],'depth':null}));};}function create(_0x5a64f5){return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopperHistory['createHistory'](_0x5a64f5))[_0x772d('0xd')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x207dc8){return BPromise['resolve']()[_0x772d('0xc')](agentReportPreview['createHistory'](_0x207dc8))[_0x772d('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5b68c2){return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopper[_0x772d('0xe')](_0x5b68c2,!![]))['catch'](loggerCatch(_0x772d('0xf')));}exports[_0x772d('0x10')]=function(_0x260ba0){return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopperBlack['checkIsBlackList'](_0x260ba0))[_0x772d('0xd')](loggerCatch(_0x772d('0x11')));};exports[_0x772d('0x12')]=function(_0x4d56f5){return BPromise[_0x772d('0xb')]()['then'](cmHopper[_0x772d('0x12')](_0x4d56f5))[_0x772d('0xd')](loggerCatch(_0x772d('0x13')));};exports[_0x772d('0x14')]=function(_0x4e1c64,_0x5d7914){create(_0x4e1c64)[_0x772d('0xd')](loggerCatch(_0x5d7914));moveContact(_0x4e1c64)[_0x772d('0xd')](loggerCatch(_0x5d7914));};exports[_0x772d('0x15')]=function(_0x73b0e4,_0x3daf3c){createAgent(_0x73b0e4)[_0x772d('0xd')](loggerCatch(_0x3daf3c));};exports['createCustomerHistory']=function(_0x5413c5,_0x107cde){create(_0x5413c5)['catch'](loggerCatch(_0x107cde));};exports['createCustomerFinal']=function(_0x50cd22,_0x33d5e5){moveContact(_0x50cd22)[_0x772d('0xd')](loggerCatch(_0x33d5e5));};exports['rescheduleContact']=function(_0x59a82e,_0x1e7c8,_0xe8d493){if(_0x1e7c8){_0x59a82e['UserId']=null;}if(_0xe8d493){_0x59a82e[_0x772d('0x16')]=![];}return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopper[_0x772d('0x17')](_0x59a82e))[_0x772d('0xd')](loggerCatch(_0x772d('0x18')));};exports[_0x772d('0x19')]=function(_0x2d25a7){return BPromise[_0x772d('0xb')]()['then'](cmHopper[_0x772d('0x19')](_0x2d25a7))[_0x772d('0xd')](loggerCatch(_0x772d('0x1a')));};exports[_0x772d('0x1b')]=function(_0x2e0495){return BPromise['resolve']()['then'](cmHopper[_0x772d('0x1b')]({'UserId':null},_0x2e0495,0x1))[_0x772d('0xd')](loggerCatch(_0x772d('0x1c')));};exports[_0x772d('0x1d')]=function(_0x245a29){return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopper[_0x772d('0x1b')]({'active':![]},_0x245a29,0x1))[_0x772d('0xd')](loggerCatch(_0x772d('0x1e')));};exports[_0x772d('0x1f')]=function(_0x2f7a02){var _0x1c7fea={};_0x1c7fea[_0x772d('0x20')]=_0x2f7a02[_0x772d('0x20')];_0x1c7fea[_0x772d('0x21')]=_0x2f7a02[_0x772d('0x21')];_0x1c7fea[_0x772d('0x22')]=_0x2f7a02[_0x772d('0x22')];_0x1c7fea[_0x772d('0x23')]=_0x2f7a02['calleridname'];_0x1c7fea[_0x772d('0x24')]=_0x2f7a02[_0x772d('0x24')];_0x1c7fea[_0x772d('0x25')]=_0x2f7a02[_0x772d('0x26')];_0x1c7fea[_0x772d('0x27')]=_0x2f7a02[_0x772d('0x26')];_0x1c7fea['queuecallercomplete']=0x1;_0x1c7fea[_0x772d('0x28')]=_0x2f7a02[_0x772d('0x29')];_0x1c7fea[_0x772d('0x2a')]=_0x2f7a02[_0x772d('0x2b')];_0x1c7fea[_0x772d('0x2c')]=_0x772d('0x2d');_0x1c7fea[_0x772d('0x2e')]=_0x772d('0x2f');_0x1c7fea[_0x772d('0x30')]=0x0;_0x1c7fea[_0x772d('0x31')]=0x1;_0x1c7fea[_0x772d('0x32')]=_0x2f7a02[_0x772d('0x2b')];_0x1c7fea[_0x772d('0x33')]=_0x772d('0x34');return BPromise['resolve']()[_0x772d('0xc')](voiceQueueReport[_0x772d('0x35')](_0x1c7fea))[_0x772d('0xd')](loggerCatch(_0x772d('0x36')));};exports['getContactRecallMe']=function(_0x408480,_0x5a3c30){return BPromise[_0x772d('0xb')]()[_0x772d('0xc')](cmHopper[_0x772d('0x37')](_0x408480,_0x5a3c30))[_0x772d('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x262e84){return BPromise[_0x772d('0xb')]()['then'](cmHopper[_0x772d('0x17')](_0x262e84,!![],!![]))[_0x772d('0xd')](loggerCatch(_0x772d('0x38')));}; \ No newline at end of file +var _0x479e=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','then','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue'];(function(_0x4cb827,_0x5ca1de){var _0x4b4b9f=function(_0x2949a4){while(--_0x2949a4){_0x4cb827['push'](_0x4cb827['shift']());}};_0x4b4b9f(++_0x5ca1de);}(_0x479e,0x82));var _0xe479=function(_0x57fec9,_0x3aa629){_0x57fec9=_0x57fec9-0x0;var _0x5d64dd=_0x479e[_0x57fec9];return _0x5d64dd;};'use strict';var util=require(_0xe479('0x0'));var BPromise=require(_0xe479('0x1'));var logger=require('../../../config/logger')(_0xe479('0x2'));var _=require(_0xe479('0x3'));var cmHopper=require(_0xe479('0x4'));var cmHopperFinal=require(_0xe479('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xe479('0x6'));var voiceQueueRt=require(_0xe479('0x7'));var agentReportPreview=require(_0xe479('0x8'));var voiceQueueReport=require(_0xe479('0x9'));function loggerCatch(_0x45187b){return function(_0x1a9208){logger[_0xe479('0xa')](_0x45187b,util['inspect'](_0x1a9208,{'showHidden':![],'depth':null}));};}function create(_0x556a25){return BPromise['resolve']()[_0xe479('0xb')](cmHopperHistory['createHistory'](_0x556a25))[_0xe479('0xc')](loggerCatch(_0xe479('0xd')));}function createAgent(_0x1b4d8c){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](agentReportPreview[_0xe479('0xf')](_0x1b4d8c))[_0xe479('0xc')](loggerCatch(_0xe479('0xd')));}function moveContact(_0x18fefa){return BPromise[_0xe479('0xe')]()['then'](cmHopper[_0xe479('0x10')](_0x18fefa,!![]))[_0xe479('0xc')](loggerCatch(_0xe479('0x11')));}exports[_0xe479('0x12')]=function(_0x382cca){return BPromise[_0xe479('0xe')]()['then'](cmHopperBlack[_0xe479('0x12')](_0x382cca))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xe479('0x13')]=function(_0x233a63){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](cmHopper['getContactPreview'](_0x233a63))[_0xe479('0xc')](loggerCatch(_0xe479('0x14')));};exports[_0xe479('0xf')]=function(_0xbb20d3,_0x26c88f){create(_0xbb20d3)[_0xe479('0xc')](loggerCatch(_0x26c88f));moveContact(_0xbb20d3)[_0xe479('0xc')](loggerCatch(_0x26c88f));};exports[_0xe479('0x15')]=function(_0x1e89a1,_0x48b4c5){createAgent(_0x1e89a1)['catch'](loggerCatch(_0x48b4c5));};exports[_0xe479('0x16')]=function(_0x1d51f0,_0x1b1405){create(_0x1d51f0)[_0xe479('0xc')](loggerCatch(_0x1b1405));};exports[_0xe479('0x17')]=function(_0x5c499e,_0x411f34){moveContact(_0x5c499e)[_0xe479('0xc')](loggerCatch(_0x411f34));};exports[_0xe479('0x18')]=function(_0x20d9a9,_0x2ef128,_0x27a4e7){if(_0x2ef128){_0x20d9a9[_0xe479('0x19')]=null;}if(_0x27a4e7){_0x20d9a9[_0xe479('0x1a')]=![];}return BPromise['resolve']()[_0xe479('0xb')](cmHopper[_0xe479('0x18')](_0x20d9a9))[_0xe479('0xc')](loggerCatch(_0xe479('0x1b')));};exports[_0xe479('0x1c')]=function(_0xcc675a){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](cmHopper[_0xe479('0x1c')](_0xcc675a))[_0xe479('0xc')](loggerCatch(_0xe479('0x1d')));};exports[_0xe479('0x1e')]=function(_0x3b916f){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](cmHopper[_0xe479('0x1e')]({'UserId':null},_0x3b916f,0x1))[_0xe479('0xc')](loggerCatch(_0xe479('0x1f')));};exports[_0xe479('0x20')]=function(_0x51c2a3){return BPromise['resolve']()[_0xe479('0xb')](cmHopper[_0xe479('0x1e')]({'active':![]},_0x51c2a3,0x1))[_0xe479('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xe479('0x21')]=function(_0x2cb3f6){var _0x38317a={};_0x38317a['type']=_0x2cb3f6['type'];_0x38317a[_0xe479('0x22')]=_0x2cb3f6[_0xe479('0x22')];_0x38317a['calleridnum']=_0x2cb3f6[_0xe479('0x23')];_0x38317a[_0xe479('0x24')]=_0x2cb3f6[_0xe479('0x24')];_0x38317a[_0xe479('0x25')]=_0x2cb3f6[_0xe479('0x25')];_0x38317a[_0xe479('0x26')]=_0x2cb3f6[_0xe479('0x27')];_0x38317a[_0xe479('0x28')]=_0x2cb3f6[_0xe479('0x27')];_0x38317a[_0xe479('0x29')]=0x1;_0x38317a[_0xe479('0x2a')]=_0x2cb3f6['endtime'];_0x38317a[_0xe479('0x2b')]=_0x2cb3f6['membername'];_0x38317a[_0xe479('0x2c')]=_0xe479('0x2d');_0x38317a[_0xe479('0x2e')]='xcally-motion-preview';_0x38317a[_0xe479('0x2f')]=0x0;_0x38317a[_0xe479('0x30')]=0x1;_0x38317a[_0xe479('0x31')]=_0x2cb3f6['membername'];_0x38317a[_0xe479('0x32')]=_0xe479('0x33');return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](voiceQueueReport[_0xe479('0x34')](_0x38317a))['catch'](loggerCatch(_0xe479('0x35')));};exports[_0xe479('0x36')]=function(_0x3de587,_0x2277a4){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](cmHopper['getContactRecallMe'](_0x3de587,_0x2277a4))[_0xe479('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0xe71ddf){return BPromise[_0xe479('0xe')]()[_0xe479('0xb')](cmHopper[_0xe479('0x18')](_0xe71ddf,!![],!![]))[_0xe479('0xc')](loggerCatch(_0xe479('0x37')));}; \ 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 ae4e402..7eb0068 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 _0xe8bf=['info','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','addVariables','Queue','name','calleridname','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','mandatoryDisposition','agentReadyId','not_inuse','status','getDiff','filterKey','active','scheduledat','countglobal','callback','callbackuniqueid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','inspect'];(function(_0x2e1b0a,_0x4981ac){var _0x31b7af=function(_0x4b5b79){while(--_0x4b5b79){_0x2e1b0a['push'](_0x2e1b0a['shift']());}};_0x31b7af(++_0x4981ac);}(_0xe8bf,0x76));var _0xfe8b=function(_0x895a75,_0x1acee1){_0x895a75=_0x895a75-0x0;var _0x4734fc=_0xe8bf[_0x895a75];return _0x4734fc;};'use strict';var util=require(_0xfe8b('0x0'));var _=require(_0xfe8b('0x1'));var moment=require(_0xfe8b('0x2'));var logger=require(_0xfe8b('0x3'))(_0xfe8b('0x4'));var ipAgi=process[_0xfe8b('0x5')][_0xfe8b('0x6')]||'127.0.0.1';function getSeconds(_0x33dd41,_0x378d82){var _0x33db15=moment(_0x33dd41)[_0xfe8b('0x7')](0x0);var _0x4af848=moment(_0x378d82)[_0xfe8b('0x7')](0x0);return _0x33db15[_0xfe8b('0x8')](_0x4af848,_0xfe8b('0x9'));}exports['loggerCatch']=function(_0x5c2a9e){return function(_0x42ee28){logger[_0xfe8b('0xa')](_0x5c2a9e,util[_0xfe8b('0xb')](_0x42ee28,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x218d2a,_0x597cfb){logger[_0xfe8b('0xc')](_0x218d2a,util[_0xfe8b('0xb')](_0x597cfb,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x5b28d2,_0x2325ee){logger[_0xfe8b('0xa')](_0x5b28d2,util[_0xfe8b('0xb')](_0x2325ee,{'showHidden':![],'depth':null}));};exports[_0xfe8b('0xd')]=function(_0x405b7c){return function(_0x56c6d7){logger['info'](_0x405b7c,util[_0xfe8b('0xb')](_0x56c6d7,{'showHidden':![],'depth':null}));};};exports[_0xfe8b('0xe')]=function(_0x284eee,_0x16e402,_0x3daa43){return{'message':_0x284eee,'unlock':_0x16e402,'active':_0x3daa43};};exports[_0xfe8b('0xf')]=function(_0x28ce8a,_0x375cb2,_0x139193){if(!_[_0xfe8b('0x10')](_0x139193)&&_0xfe8b('0x11')===typeof _0x139193&&!_[_0xfe8b('0x12')](_0x139193)){if(!_[_0xfe8b('0x10')](_0x375cb2)&&'string'===typeof _0x375cb2&&!_[_0xfe8b('0x12')](_0x375cb2)){return util['format'](_0xfe8b('0x13'),_0x375cb2,_0x139193);}return util[_0xfe8b('0x14')](_0xfe8b('0x13'),_0x139193,_0x139193);}if(!_[_0xfe8b('0x10')](_0x28ce8a)&&_0xfe8b('0x11')===typeof _0x28ce8a&&!_[_0xfe8b('0x12')](_0x28ce8a)){return _0x28ce8a;}return'\x22\x22\x20<>';};exports[_0xfe8b('0x15')]=function(_0x218686){if(_['isNil'](_0x218686)){return![];}return _0x218686;};exports[_0xfe8b('0x16')]=function(_0x4a57e4,_0x210527,_0x49ac1d,_0x2014b1,_0x2d8dac,_0x113afd){var _0x5b3091={'XMD-QUEUE':_0x210527['Queue']?_0x210527[_0xfe8b('0x17')][_0xfe8b('0x18')]:'','XMD-CALLERID':_0x2014b1,'XMD-CALLERID-PREVIEW':_0x113afd?util[_0xfe8b('0x14')]('\x22%s\x22\x20<%s>',_0x113afd[_0xfe8b('0x19')],_0x113afd['calleridnum']):_0x2014b1,'XMD-DIALID':_0x2d8dac,'XMD-CONTACTID':_0x210527['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2014b1,'XMD-VOICEQUEUEID':_0x210527[_0xfe8b('0x1a')],'XMD-DIALCHANNEL':_0x49ac1d,'XMD-DIALTIMEOUT':_0x4a57e4[_0xfe8b('0x1b')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xfe8b('0x1c'),_0x4a57e4[_0xfe8b('0x1d')]?'g':'',_[_0xfe8b('0x12')](_0x4a57e4[_0xfe8b('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4a57e4[_0xfe8b('0x1f')]||'','XMD-AGI':_0x4a57e4['dialQueueProject']?util[_0xfe8b('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4a57e4[_0xfe8b('0x20')]):'NONE','XMD-AGIAFTER':_0x4a57e4[_0xfe8b('0x1d')]?util['format'](_0xfe8b('0x21'),ipAgi,_0x4a57e4[_0xfe8b('0x1d')]):_0xfe8b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x113afd?_0x113afd['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x113afd?_0x113afd['originatecalleridname']:'','XMD-DESTINATION':_0xfe8b('0x23')};if(!_['isEmpty'](_0x4a57e4[_0xfe8b('0x1e')])){_0x5b3091[util['format']('%s',_0xfe8b('0x24'))]=_0x4a57e4['monitor_format'];_0x5b3091[util[_0xfe8b('0x14')]('%s',_0xfe8b('0x25'))]=_0x2d8dac;}if(_0x210527&&_0x210527[_0xfe8b('0x26')]){for(var _0x23db2e in _0x210527['Contact']){if(_0x210527[_0xfe8b('0x26')][_0xfe8b('0x27')](_0x23db2e)){if(!_[_0xfe8b('0x28')](_0x210527[_0xfe8b('0x26')][_0x23db2e])&&_0x23db2e!=='id'&&_0x23db2e!==_0xfe8b('0x29')&&_0x23db2e!==_0xfe8b('0x2a')&&_0x23db2e!==_0xfe8b('0x2b')){_0x5b3091[util[_0xfe8b('0x14')](_0xfe8b('0x2c'),_0xfe8b('0x2d'),_[_0xfe8b('0x2e')](_0x23db2e))]=_0x210527[_0xfe8b('0x26')][_0x23db2e];}}}}return _0x5b3091;};exports['toLowerVariables']=function(_0x107f2f){var _0x2d61d9={};for(var _0x33f87c in _0x107f2f){if(_0x107f2f[_0xfe8b('0x27')](_0x33f87c)){_0x2d61d9[util['format']('%s',_[_0xfe8b('0x2f')](_0x33f87c))]=_0x107f2f[_0x33f87c];}}return{'variables':_0x2d61d9};};exports['updateOriginated']=function(_0x5c5c14,_0x2f7d87){if(!_[_0xfe8b('0x28')](_0x5c5c14)){if(_0x5c5c14[_0xfe8b('0x27')](_0xfe8b('0x30'))){if(_0x5c5c14[_0xfe8b('0x30')]>0x0){_0x5c5c14[_0xfe8b('0x30')]-=0x1;}else{logger[_0xfe8b('0xa')](_0xfe8b('0x31'),_0x2f7d87);}}}else{logger[_0xfe8b('0xa')](_0xfe8b('0x32'),_0x2f7d87);}};exports[_0xfe8b('0x33')]=function(_0x1485e8){var _0x481b98=moment()[_0xfe8b('0x14')](_0xfe8b('0x34'));_0x1485e8[_0xfe8b('0x35')]=0xd;_0x1485e8[_0xfe8b('0x36')]=_0xfe8b('0x37');_0x1485e8[_0xfe8b('0x38')]=_0x481b98;_0x1485e8['responsetime']=_0x481b98;_0x1485e8['endtime']=_0x481b98;};exports[_0xfe8b('0x39')]=function(_0x4374a9,_0x6e1d55,_0xc615bd){var _0x12c3d9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4374a9[_0xfe8b('0x35')]=_0x6e1d55;_0x4374a9['statedesc']=_0xc615bd;_0x4374a9[_0xfe8b('0x3a')]=_0x12c3d9;_0x4374a9[_0xfe8b('0x3b')]=getSeconds(_0x4374a9[_0xfe8b('0x3a')],_0x4374a9['starttime']);};exports[_0xfe8b('0x3c')]=function(_0x4edc92,_0x1ecd47,_0x29e197){_0x4edc92[_0xfe8b('0x3d')]=_0x1ecd47;_0x4edc92[_0xfe8b('0x3e')]=_0x29e197;};exports[_0xfe8b('0x3f')]=function(_0xa45dcb,_0x4468df,_0x47e20b){var _0xf56cf6=moment()[_0xfe8b('0x14')](_0xfe8b('0x34'));_0xa45dcb[_0xfe8b('0x35')]=_0x4468df;_0xa45dcb[_0xfe8b('0x36')]=_0x47e20b;_0xa45dcb['responsetime']=_0xa45dcb[_0xfe8b('0x3a')]?_0xa45dcb[_0xfe8b('0x3a')]:_0xf56cf6;_0xa45dcb['endtime']=_0xa45dcb[_0xfe8b('0x40')]?_0xa45dcb[_0xfe8b('0x40')]:_0xf56cf6;_0xa45dcb[_0xfe8b('0x3b')]=getSeconds(_0xa45dcb['responsetime']||0x0,_0xa45dcb['starttime']||0x0);_0xa45dcb[_0xfe8b('0x41')]=_0xa45dcb['answertime']?getSeconds(_0xa45dcb[_0xfe8b('0x40')],_0xa45dcb[_0xfe8b('0x42')]):0x0;};exports[_0xfe8b('0x43')]=function(_0x40f098){return _0x40f098==='Failure';};exports[_0xfe8b('0x44')]=function(_0xa8ceae,_0x365348,_0x4896fb,_0x513256,_0x183f2a){var _0x3a41f1=_0x513256?_0xfe8b('0x45'):_0xa8ceae['calleridname'];_0x3a41f1=_0x183f2a?_0xfe8b('0x46'):_0x3a41f1;return{'actionid':_0xa8ceae[_0xfe8b('0x47')],'action':_0xfe8b('0x48'),'channel':_0xa8ceae[_0xfe8b('0x49')],'callerid':util[_0xfe8b('0x14')]('\x22%s\x22\x20<%s>',_0x3a41f1,_0xa8ceae[_0xfe8b('0x4a')]),'Exten':_0xfe8b('0x23'),'Context':_0xfe8b('0x4b'),'Priority':'1','variable':_0x4896fb,'timeout':(_0x365348['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xa8ceae[_0xfe8b('0x47')]};};exports[_0xfe8b('0x4c')]=function(_0x554406){return _0x554406[_0xfe8b('0x4d')]+_0x554406[_0xfe8b('0x4e')]+_0x554406[_0xfe8b('0x4f')]+_0x554406[_0xfe8b('0x50')]+_0x554406[_0xfe8b('0x51')];};exports[_0xfe8b('0x52')]=function(_0x1aaefb){var _0x1b1723=_[_0xfe8b('0x53')](_0x1aaefb);_0x1b1723[_0xfe8b('0x35')]=0xf;_0x1b1723[_0xfe8b('0x36')]='Global';return _0x1b1723;};exports[_0xfe8b('0x54')]=function(_0x3272e3,_0x180b36,_0x3389bd){var _0x42d096={};_0x42d096[_0x180b36]=_0x3272e3[_0x180b36];_0x42d096['active']=![];_0x42d096['scheduledat']=moment()[_0xfe8b('0x55')](_0x3389bd,_0xfe8b('0x56'))['format'](_0xfe8b('0x34'));_0x42d096[_0xfe8b('0x57')]=_0x3272e3[_0xfe8b('0x57')];_0x42d096['ListId']=_0x3272e3[_0xfe8b('0x58')];_0x42d096[_0xfe8b('0x1a')]=_0x3272e3[_0xfe8b('0x1a')]||undefined;return _0x42d096;};exports[_0xfe8b('0x59')]=function(_0x4da0d4,_0x1ee2fa){if(!_['isNil'](_0x4da0d4)){if(_0x4da0d4['pTalking']>0x0){_0x4da0d4[_0xfe8b('0x5a')]-=0x1;}else{logger[_0xfe8b('0xa')](_0x1ee2fa,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xfe8b('0xa')](_0x1ee2fa,_0xfe8b('0x5b'));}};exports['IsNotLoggedIn']=function(_0x4a6e51){if(_0x4a6e51<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2387dd,_0x5c3af3,_0x16f2b5){_0x2387dd[_0xfe8b('0x5c')]=_0x5c3af3;_0x2387dd[_0xfe8b('0x18')]=_0x2387dd[_0xfe8b('0x5d')];_0x2387dd['interface']=_0x2387dd[_0xfe8b('0x49')];if(_0x16f2b5){_0x2387dd[_0xfe8b('0x5e')]=_0x16f2b5[_0xfe8b('0x5e')];}return _0x2387dd;};exports['buildAcw']=function(_0x1ff8c9){var _0x35c35c={};_0x35c35c[_0xfe8b('0x5d')]=_0x1ff8c9['queue'];_0x35c35c['interface']=_0x1ff8c9['channelAgent'];_0x35c35c[_0xfe8b('0x47')]=_0x1ff8c9[_0xfe8b('0x47')];return _0x35c35c;};exports[_0xfe8b('0x5f')]=function(_0x3d4f68){var _0x6ca8fe=[];for(var _0x401dc8 in _0x3d4f68){if(_0x3d4f68[_0xfe8b('0x27')](_0x401dc8)){if(!_[_0xfe8b('0x28')](_0x3d4f68[_0x401dc8])&&_0x3d4f68[_0x401dc8][_0xfe8b('0x35')]===_0xfe8b('0x60')&&_0x3d4f68[_0x401dc8][_0xfe8b('0x61')]==='reachable'){_0x6ca8fe['push'](_0x3d4f68[_0x401dc8]['id']);}}}return _0x6ca8fe;};exports[_0xfe8b('0x62')]=function(_0x56c830){var _0x49cf4f=moment()[_0xfe8b('0x7')](0x0);var _0x1acd77=moment(_0x56c830)[_0xfe8b('0x7')](0x0);return _0x49cf4f[_0xfe8b('0x8')](_0x1acd77,_0xfe8b('0x9'));};exports['createBody']=function(_0xb5e855){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xb5e855[_0xfe8b('0x57')],'ListId':_0xb5e855[_0xfe8b('0x58')],'VoiceQueueId':_0xb5e855[_0xfe8b('0x1a')]||undefined,'CampaignId':_0xb5e855['CampaignId']||undefined};};exports[_0xfe8b('0x63')]=function(_0x2ae6e8){if(_0x2ae6e8===_0xfe8b('0x47')||_0x2ae6e8==='idContact'||_0x2ae6e8===_0xfe8b('0x5d')||_0x2ae6e8==='type'||_0x2ae6e8==='campaigntype'||_0x2ae6e8==='dialAnswer'||_0x2ae6e8==='membername'||_0x2ae6e8==='channelAgent'||_0x2ae6e8==='calleridname'||_0x2ae6e8===_0xfe8b('0x64')||_0x2ae6e8===_0xfe8b('0x4a')||_0x2ae6e8===_0xfe8b('0x65')||_0x2ae6e8===_0xfe8b('0x4d')||_0x2ae6e8===_0xfe8b('0x4e')||_0x2ae6e8===_0xfe8b('0x4f')||_0x2ae6e8===_0xfe8b('0x66')||_0x2ae6e8===_0xfe8b('0x67')||_0x2ae6e8===_0xfe8b('0x68')||_0x2ae6e8==='callbackat'||_0x2ae6e8==='recallme'||_0x2ae6e8===_0xfe8b('0x57')||_0x2ae6e8===_0xfe8b('0x58')||_0x2ae6e8===_0xfe8b('0x3e')||_0x2ae6e8===_0xfe8b('0x1a')||_0x2ae6e8==='sipcallid'||_0x2ae6e8===_0xfe8b('0x69')||_0x2ae6e8===_0xfe8b('0x6a')||_0x2ae6e8===_0xfe8b('0x6b')||_0x2ae6e8===_0xfe8b('0x6c')||_0x2ae6e8===_0xfe8b('0x6d')||_0x2ae6e8===_0xfe8b('0x6e')||_0x2ae6e8==='xmd-dialoptions'||_0x2ae6e8===_0xfe8b('0x6f')||_0x2ae6e8==='xmd-dialchannel'||_0x2ae6e8===_0xfe8b('0x70')||_0x2ae6e8===_0xfe8b('0x71')||_0x2ae6e8===_0xfe8b('0x72')||_0x2ae6e8===_0xfe8b('0x73')||_0x2ae6e8==='xmd-agi'||_0x2ae6e8===_0xfe8b('0x74')||_0x2ae6e8===_0xfe8b('0x75')||_0x2ae6e8==='rtpaudioqosjitter'||_0x2ae6e8===_0xfe8b('0x76')||_0x2ae6e8===_0xfe8b('0x77')||_0x2ae6e8===_0xfe8b('0x78')||_0x2ae6e8==='rtpaudioqosrtt'||_0x2ae6e8===_0xfe8b('0x79')||_0x2ae6e8==='rtpaudioqos'||_0x2ae6e8==='rtpaudioqosbridged'||_0x2ae6e8===_0xfe8b('0x7a')||_0x2ae6e8==='rtpaudioqosjitterbridged'||_0x2ae6e8===_0xfe8b('0x77')||_0x2ae6e8==='rtpaudioqoslossbridged'||_0x2ae6e8==='rtpaudioqosrtt'||_0x2ae6e8===_0xfe8b('0x79')||_0x2ae6e8===_0xfe8b('0x7b')||_0x2ae6e8===_0xfe8b('0x7c')||_0x2ae6e8==='state'||_0x2ae6e8==='statedesc'){return![];}return!![];};exports[_0xfe8b('0x7d')]=function(_0x2df87e,_0x17c55c){var _0x51c6c2,_0x28f7d4,_0x593481;if(_0x17c55c<=0x0){_0x17c55c=0x1;}_0x51c6c2=new RegExp('\x5cw{0,'+_0x17c55c+'}$');_0x28f7d4=Math[_0xfe8b('0x7e')](0xa,_0x17c55c-0x1);_0x593481=Math['pow'](0xa,_0x17c55c)-0x1;return util['format']('%s',_[_0xfe8b('0x7f')](_0x2df87e,_0x51c6c2,_['random'](_0x28f7d4,_0x593481)));};exports['extractCalleridName']=function(_0x1337c8){var _0xab2cdf=_0x1337c8[_0xfe8b('0x80')](/"(.*?)"/);return _0xab2cdf?_0xab2cdf[0x1]:_0x1337c8;};exports[_0xfe8b('0x81')]=function(_0x13ee8e){var _0x3eee68=_0x13ee8e[_0xfe8b('0x80')](/<(.*?)>/);return _0x3eee68?_0x3eee68[0x1]:_0x13ee8e;}; \ No newline at end of file +var _0x879f=['VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','queue','agentReadyId','not_inuse','status','push','createBody','CampaignId','idContact','dialAnswer','countglobal','callback','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','lodash','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','logger2','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer'];(function(_0x48ec14,_0x4b0683){var _0x129f0f=function(_0x1b82e2){while(--_0x1b82e2){_0x48ec14['push'](_0x48ec14['shift']());}};_0x129f0f(++_0x4b0683);}(_0x879f,0xee));var _0xf879=function(_0x4f5457,_0x651ef5){_0x4f5457=_0x4f5457-0x0;var _0xb3b996=_0x879f[_0x4f5457];return _0xb3b996;};'use strict';var util=require('util');var _=require(_0xf879('0x0'));var moment=require('moment');var logger=require(_0xf879('0x1'))('preview');var ipAgi=process['env'][_0xf879('0x2')]||_0xf879('0x3');function getSeconds(_0x500faa,_0x29f6f0){var _0x34f155=moment(_0x500faa)['milliseconds'](0x0);var _0x14dbcf=moment(_0x29f6f0)[_0xf879('0x4')](0x0);return _0x34f155[_0xf879('0x5')](_0x14dbcf,_0xf879('0x6'));}exports[_0xf879('0x7')]=function(_0x35ad0f){return function(_0x32cc6a){logger['error'](_0x35ad0f,util[_0xf879('0x8')](_0x32cc6a,{'showHidden':![],'depth':null}));};};exports[_0xf879('0x9')]=function(_0x48509b,_0x4ee3c2){logger[_0xf879('0xa')](_0x48509b,util['inspect'](_0x4ee3c2,{'showHidden':![],'depth':null}));};exports[_0xf879('0xb')]=function(_0x584b32,_0x72d4fd){logger['error'](_0x584b32,util[_0xf879('0x8')](_0x72d4fd,{'showHidden':![],'depth':null}));};exports[_0xf879('0xc')]=function(_0x52a1b8){return function(_0x326f85){logger['info'](_0x52a1b8,util[_0xf879('0x8')](_0x326f85,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5ced36,_0x17880e,_0x499a1a){return{'message':_0x5ced36,'unlock':_0x17880e,'active':_0x499a1a};};exports[_0xf879('0xd')]=function(_0x3ebc1e,_0x365cb7,_0x3d6184){if(!_['isUndefined'](_0x3d6184)&&_0xf879('0xe')===typeof _0x3d6184&&!_[_0xf879('0xf')](_0x3d6184)){if(!_[_0xf879('0x10')](_0x365cb7)&&'string'===typeof _0x365cb7&&!_[_0xf879('0xf')](_0x365cb7)){return util[_0xf879('0x11')](_0xf879('0x12'),_0x365cb7,_0x3d6184);}return util[_0xf879('0x11')](_0xf879('0x12'),_0x3d6184,_0x3d6184);}if(!_[_0xf879('0x10')](_0x3ebc1e)&&'string'===typeof _0x3ebc1e&&!_[_0xf879('0xf')](_0x3ebc1e)){return _0x3ebc1e;}return _0xf879('0x13');};exports['isActive']=function(_0x575036){if(_[_0xf879('0x14')](_0x575036)){return![];}return _0x575036;};exports[_0xf879('0x15')]=function(_0x4e2d40,_0x320678,_0x23db87,_0x3fbfef,_0x3c06de,_0x2110b0){var _0x38dcb6={'XMD-QUEUE':_0x320678[_0xf879('0x16')]?_0x320678[_0xf879('0x16')][_0xf879('0x17')]:'','XMD-CALLERID':_0x3fbfef,'XMD-CALLERID-PREVIEW':_0x2110b0?util['format'](_0xf879('0x12'),_0x2110b0[_0xf879('0x18')],_0x2110b0[_0xf879('0x19')]):_0x3fbfef,'XMD-DIALID':_0x3c06de,'XMD-CONTACTID':_0x320678[_0xf879('0x1a')],'XMD-CDRTYPE':_0xf879('0x1b'),'CALLERID(all)':_0x3fbfef,'XMD-VOICEQUEUEID':_0x320678[_0xf879('0x1c')],'XMD-DIALCHANNEL':_0x23db87,'XMD-DIALTIMEOUT':_0x4e2d40[_0xf879('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xf879('0x1e'),_0x4e2d40[_0xf879('0x1f')]?'g':'',_['isEmpty'](_0x4e2d40[_0xf879('0x20')])?'':_0xf879('0x21')),'XMD-DIALURL':_0x4e2d40['dialPreviewUrl']||'','XMD-AGI':_0x4e2d40[_0xf879('0x22')]?util['format'](_0xf879('0x23'),ipAgi,_0x4e2d40['dialQueueProject']):_0xf879('0x24'),'XMD-AGIAFTER':_0x4e2d40[_0xf879('0x1f')]?util[_0xf879('0x11')](_0xf879('0x23'),ipAgi,_0x4e2d40[_0xf879('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2110b0?_0x2110b0[_0xf879('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x2110b0?_0x2110b0[_0xf879('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xf879('0xf')](_0x4e2d40[_0xf879('0x20')])){_0x38dcb6[util[_0xf879('0x11')]('%s',_0xf879('0x27'))]=_0x4e2d40[_0xf879('0x20')];_0x38dcb6[util['format']('%s',_0xf879('0x28'))]=_0x3c06de;}if(_0x320678&&_0x320678['Contact']){for(var _0x232fff in _0x320678[_0xf879('0x29')]){if(_0x320678[_0xf879('0x29')][_0xf879('0x2a')](_0x232fff)){if(!_[_0xf879('0x14')](_0x320678[_0xf879('0x29')][_0x232fff])&&_0x232fff!=='id'&&_0x232fff!=='tags'&&_0x232fff!==_0xf879('0x2b')&&_0x232fff!=='updatedAt'){_0x38dcb6[util[_0xf879('0x11')](_0xf879('0x2c'),_0xf879('0x2d'),_[_0xf879('0x2e')](_0x232fff))]=_0x320678['Contact'][_0x232fff];}}}}return _0x38dcb6;};exports[_0xf879('0x2f')]=function(_0x1e30fe){var _0x3b38a5={};for(var _0xf306a8 in _0x1e30fe){if(_0x1e30fe[_0xf879('0x2a')](_0xf306a8)){_0x3b38a5[util[_0xf879('0x11')]('%s',_['toLower'](_0xf306a8))]=_0x1e30fe[_0xf306a8];}}return{'variables':_0x3b38a5};};exports[_0xf879('0x30')]=function(_0x924421,_0x581002){if(!_[_0xf879('0x14')](_0x924421)){if(_0x924421[_0xf879('0x2a')](_0xf879('0x31'))){if(_0x924421[_0xf879('0x31')]>0x0){_0x924421['originated']-=0x1;}else{logger[_0xf879('0x32')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x581002);}}}else{logger[_0xf879('0x32')](_0xf879('0x33'),_0x581002);}};exports['logBlacklist']=function(_0xa9c252){var _0x4cf957=moment()[_0xf879('0x11')](_0xf879('0x34'));_0xa9c252[_0xf879('0x35')]=0xd;_0xa9c252[_0xf879('0x36')]=_0xf879('0x37');_0xa9c252[_0xf879('0x38')]=_0x4cf957;_0xa9c252[_0xf879('0x39')]=_0x4cf957;_0xa9c252[_0xf879('0x3a')]=_0x4cf957;};exports[_0xf879('0x3b')]=function(_0x1e821e,_0x30b83c,_0x157c6f){var _0xbbff6e=moment()[_0xf879('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e821e[_0xf879('0x35')]=_0x30b83c;_0x1e821e[_0xf879('0x36')]=_0x157c6f;_0x1e821e[_0xf879('0x39')]=_0xbbff6e;_0x1e821e[_0xf879('0x3c')]=getSeconds(_0x1e821e[_0xf879('0x39')],_0x1e821e['starttime']);};exports[_0xf879('0x3d')]=function(_0x2cd6d9,_0x5692fb,_0x544d6a){_0x2cd6d9[_0xf879('0x3e')]=_0x5692fb;_0x2cd6d9[_0xf879('0x3f')]=_0x544d6a;};exports[_0xf879('0x40')]=function(_0x4ef3d6,_0x47d803,_0x12b327){var _0x37ef65=moment()[_0xf879('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ef3d6[_0xf879('0x35')]=_0x47d803;_0x4ef3d6[_0xf879('0x36')]=_0x12b327;_0x4ef3d6['responsetime']=_0x4ef3d6[_0xf879('0x39')]?_0x4ef3d6[_0xf879('0x39')]:_0x37ef65;_0x4ef3d6[_0xf879('0x3a')]=_0x4ef3d6['endtime']?_0x4ef3d6[_0xf879('0x3a')]:_0x37ef65;_0x4ef3d6[_0xf879('0x3c')]=getSeconds(_0x4ef3d6[_0xf879('0x39')]||0x0,_0x4ef3d6['starttime']||0x0);_0x4ef3d6['talktime']=_0x4ef3d6['answertime']?getSeconds(_0x4ef3d6[_0xf879('0x3a')],_0x4ef3d6[_0xf879('0x41')]):0x0;};exports[_0xf879('0x42')]=function(_0x35a792){return _0x35a792==='Failure';};exports[_0xf879('0x43')]=function(_0x1dcc79,_0x2b42c2,_0x256885,_0x16256f,_0x55c2fa){var _0x4b6e1c=_0x16256f?_0xf879('0x44'):_0x1dcc79[_0xf879('0x18')];_0x4b6e1c=_0x55c2fa?_0xf879('0x45'):_0x4b6e1c;return{'actionid':_0x1dcc79[_0xf879('0x46')],'action':'originate','channel':_0x1dcc79[_0xf879('0x47')],'callerid':util[_0xf879('0x11')](_0xf879('0x12'),_0x4b6e1c,_0x1dcc79['calleridnum']),'Exten':_0xf879('0x48'),'Context':_0xf879('0x49'),'Priority':'1','variable':_0x256885,'timeout':(_0x2b42c2['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1dcc79[_0xf879('0x46')]};};exports['totalGlobal']=function(_0x29986a){return _0x29986a[_0xf879('0x4a')]+_0x29986a[_0xf879('0x4b')]+_0x29986a[_0xf879('0x4c')]+_0x29986a[_0xf879('0x4d')]+_0x29986a[_0xf879('0x4e')];};exports['cloneAction']=function(_0x150fd0){var _0x535dfa=_[_0xf879('0x4f')](_0x150fd0);_0x535dfa[_0xf879('0x35')]=0xf;_0x535dfa['statedesc']=_0xf879('0x50');return _0x535dfa;};exports[_0xf879('0x51')]=function(_0x164aa7,_0x23b449,_0x170a63){var _0x12a90b={};_0x12a90b[_0x23b449]=_0x164aa7[_0x23b449];_0x12a90b['active']=![];_0x12a90b[_0xf879('0x52')]=moment()[_0xf879('0x53')](_0x170a63,'minutes')[_0xf879('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x12a90b[_0xf879('0x1a')]=_0x164aa7[_0xf879('0x1a')];_0x12a90b[_0xf879('0x54')]=_0x164aa7['ListId'];_0x12a90b['VoiceQueueId']=_0x164aa7[_0xf879('0x1c')]||undefined;return _0x12a90b;};exports[_0xf879('0x55')]=function(_0x3c776f,_0x3b622f){if(!_[_0xf879('0x14')](_0x3c776f)){if(_0x3c776f['pTalking']>0x0){_0x3c776f['pTalking']-=0x1;}else{logger['error'](_0x3b622f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xf879('0x32')](_0x3b622f,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xf879('0x56')]=function(_0x218e96){if(_0x218e96<=0x0){return!![];}return![];};exports[_0xf879('0x57')]=function(_0x2ff270,_0x5e26ec,_0x386454){_0x2ff270[_0xf879('0x58')]=_0x5e26ec;_0x2ff270[_0xf879('0x17')]=_0x2ff270['queue'];_0x2ff270[_0xf879('0x59')]=_0x2ff270[_0xf879('0x47')];if(_0x386454){_0x2ff270[_0xf879('0x5a')]=_0x386454['mandatoryDisposition'];}return _0x2ff270;};exports['buildAcw']=function(_0x5d6f0d){var _0x2e3cce={};_0x2e3cce[_0xf879('0x5b')]=_0x5d6f0d[_0xf879('0x5b')];_0x2e3cce[_0xf879('0x59')]=_0x5d6f0d[_0xf879('0x47')];_0x2e3cce['uniqueid']=_0x5d6f0d[_0xf879('0x46')];return _0x2e3cce;};exports[_0xf879('0x5c')]=function(_0xd2612a){var _0x243087=[];for(var _0x1073ba in _0xd2612a){if(_0xd2612a[_0xf879('0x2a')](_0x1073ba)){if(!_[_0xf879('0x14')](_0xd2612a[_0x1073ba])&&_0xd2612a[_0x1073ba]['state']===_0xf879('0x5d')&&_0xd2612a[_0x1073ba][_0xf879('0x5e')]==='reachable'){_0x243087[_0xf879('0x5f')](_0xd2612a[_0x1073ba]['id']);}}}return _0x243087;};exports['getDiff']=function(_0x712216){var _0x54d5c4=moment()[_0xf879('0x4')](0x0);var _0x47bfd8=moment(_0x712216)[_0xf879('0x4')](0x0);return _0x54d5c4[_0xf879('0x5')](_0x47bfd8,_0xf879('0x6'));};exports[_0xf879('0x60')]=function(_0x222b1c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x222b1c[_0xf879('0x1a')],'ListId':_0x222b1c[_0xf879('0x54')],'VoiceQueueId':_0x222b1c[_0xf879('0x1c')]||undefined,'CampaignId':_0x222b1c[_0xf879('0x61')]||undefined};};exports['filterKey']=function(_0x1e4afa){if(_0x1e4afa===_0xf879('0x46')||_0x1e4afa===_0xf879('0x62')||_0x1e4afa==='queue'||_0x1e4afa==='type'||_0x1e4afa==='campaigntype'||_0x1e4afa===_0xf879('0x63')||_0x1e4afa===_0xf879('0x3e')||_0x1e4afa===_0xf879('0x47')||_0x1e4afa===_0xf879('0x18')||_0x1e4afa==='active'||_0x1e4afa===_0xf879('0x19')||_0x1e4afa===_0xf879('0x52')||_0x1e4afa===_0xf879('0x4a')||_0x1e4afa===_0xf879('0x4b')||_0x1e4afa==='countnoanswerretry'||_0x1e4afa===_0xf879('0x64')||_0x1e4afa===_0xf879('0x65')||_0x1e4afa==='callbackuniqueid'||_0x1e4afa===_0xf879('0x66')||_0x1e4afa===_0xf879('0x67')||_0x1e4afa===_0xf879('0x1a')||_0x1e4afa===_0xf879('0x54')||_0x1e4afa===_0xf879('0x3f')||_0x1e4afa==='VoiceQueueId'||_0x1e4afa===_0xf879('0x68')||_0x1e4afa==='xmd-voicequeueid'||_0x1e4afa===_0xf879('0x69')||_0x1e4afa===_0xf879('0x6a')||_0x1e4afa===_0xf879('0x6b')||_0x1e4afa===_0xf879('0x6c')||_0x1e4afa==='xmd-dialtimeout'||_0x1e4afa===_0xf879('0x6d')||_0x1e4afa===_0xf879('0x6e')||_0x1e4afa===_0xf879('0x6f')||_0x1e4afa==='xmd-contactid'||_0x1e4afa===_0xf879('0x70')||_0x1e4afa===_0xf879('0x71')||_0x1e4afa===_0xf879('0x72')||_0x1e4afa===_0xf879('0x73')||_0x1e4afa===_0xf879('0x74')||_0x1e4afa===_0xf879('0x75')||_0x1e4afa===_0xf879('0x76')||_0x1e4afa===_0xf879('0x77')||_0x1e4afa==='rtpaudioqosloss'||_0x1e4afa===_0xf879('0x78')||_0x1e4afa===_0xf879('0x79')||_0x1e4afa==='rtpaudioqosrttbridged'||_0x1e4afa===_0xf879('0x74')||_0x1e4afa==='rtpaudioqosbridged'||_0x1e4afa==='rtpaudioqosjitter'||_0x1e4afa==='rtpaudioqosjitterbridged'||_0x1e4afa===_0xf879('0x7a')||_0x1e4afa===_0xf879('0x78')||_0x1e4afa===_0xf879('0x79')||_0x1e4afa===_0xf879('0x7b')||_0x1e4afa===_0xf879('0x7c')||_0x1e4afa===_0xf879('0x7d')||_0x1e4afa===_0xf879('0x35')||_0x1e4afa===_0xf879('0x36')){return![];}return!![];};exports[_0xf879('0x7e')]=function(_0x5db069,_0x375093){var _0x47df06,_0x1b8b97,_0x499e4a;if(_0x375093<=0x0){_0x375093=0x1;}_0x47df06=new RegExp(_0xf879('0x7f')+_0x375093+'}$');_0x1b8b97=Math[_0xf879('0x80')](0xa,_0x375093-0x1);_0x499e4a=Math['pow'](0xa,_0x375093)-0x1;return util[_0xf879('0x11')]('%s',_['replace'](_0x5db069,_0x47df06,_[_0xf879('0x81')](_0x1b8b97,_0x499e4a)));};exports[_0xf879('0x82')]=function(_0x455d1b){var _0x37efe7=_0x455d1b['match'](/"(.*?)"/);return _0x37efe7?_0x37efe7[0x1]:_0x455d1b;};exports[_0xf879('0x83')]=function(_0x5af987){var _0x3c6ebf=_0x5af987[_0xf879('0x84')](/<(.*?)>/);return _0x3c6ebf?_0x3c6ebf[0x1]:_0x5af987;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 1825a86..b95f55b 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 _0x8f18=['number','queueremove','queuepause','reload','queueadd','string'];(function(_0xe3daa8,_0x5d1d71){var _0x45ff15=function(_0x3408fe){while(--_0x3408fe){_0xe3daa8['push'](_0xe3daa8['shift']());}};_0x45ff15(++_0x5d1d71);}(_0x8f18,0x1ae));var _0x88f1=function(_0x1d3e7d,_0xa9e25d){_0x1d3e7d=_0x1d3e7d-0x0;var _0x58e1d9=_0x8f18[_0x1d3e7d];return _0x58e1d9;};'use strict';exports[_0x88f1('0x0')]={'queue':{'type':_0x88f1('0x1'),'required':!![]},'interface':{'type':_0x88f1('0x1'),'required':!![]},'membername':{'type':_0x88f1('0x1'),'required':!![]},'penalty':{'type':_0x88f1('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x88f1('0x3')]={'queue':{'type':_0x88f1('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x88f1('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x88f1('0x5')]={'module':{'type':_0x88f1('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x88f1('0x1'),'required':!![]},'filename':{'type':_0x88f1('0x1')},'format':{'type':_0x88f1('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x88f1('0x1'),'required':!![]},'context':{'type':_0x88f1('0x1')}}; \ No newline at end of file +var _0xd0f1=['number','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string'];(function(_0x56abe6,_0x1dfa2b){var _0x39a04d=function(_0x549f37){while(--_0x549f37){_0x56abe6['push'](_0x56abe6['shift']());}};_0x39a04d(++_0x1dfa2b);}(_0xd0f1,0x177));var _0x1d0f=function(_0x1a1689,_0x141eef){_0x1a1689=_0x1a1689-0x0;var _0x4e043e=_0xd0f1[_0x1a1689];return _0x4e043e;};'use strict';exports['queueadd']={'queue':{'type':_0x1d0f('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1d0f('0x1'),'required':![]},'paused':{'type':_0x1d0f('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x1d0f('0x0'),'required':!![]},'interface':{'type':_0x1d0f('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x1d0f('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x1d0f('0x0'),'required':![]}};exports[_0x1d0f('0x3')]={'module':{'type':_0x1d0f('0x0'),'required':![]}};exports[_0x1d0f('0x4')]={'uniqueid':{'type':_0x1d0f('0x0'),'required':!![]}};exports[_0x1d0f('0x5')]={'uniqueid':{'type':_0x1d0f('0x0'),'required':!![]},'filename':{'type':_0x1d0f('0x0')},'format':{'type':_0x1d0f('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x1d0f('0x6')]={'uniqueid':{'type':_0x1d0f('0x0'),'required':!![]}};exports[_0x1d0f('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1d0f('0x0'),'required':!![]},'context':{'type':_0x1d0f('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b9c8bde..a8d3918 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 _0xe0ab=['initSalesforceAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercompleteAt','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initZendeskAccounts'];(function(_0x1d5442,_0x3e7bff){var _0x15330f=function(_0x346aa3){while(--_0x346aa3){_0x1d5442['push'](_0x1d5442['shift']());}};_0x15330f(++_0x3e7bff);}(_0xe0ab,0xf7));var _0xbe0a=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xe0ab[_0x16d10f];return _0x50c823;};'use strict';var BPromise=require(_0xbe0a('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require(_0xbe0a('0x1'));var Telephone=require(_0xbe0a('0x2'));var Trunk=require(_0xbe0a('0x3'));var VoiceQueue=require(_0xbe0a('0x4'));var Trigger=require(_0xbe0a('0x5'));var Template=require(_0xbe0a('0x6'));var Campaign=require(_0xbe0a('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xbe0a('0x8'));var SalesforceAccount=require(_0xbe0a('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xbe0a('0xa'));var ZohoAccount=require(_0xbe0a('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xbe0a('0xc'));var ServicenowAccount=require(_0xbe0a('0xd'));var Dynamics365Account=require(_0xbe0a('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xbe0a('0xf'));var Realtime=function(){this[_0xbe0a('0x10')]={};this[_0xbe0a('0x11')]={};this[_0xbe0a('0x12')]={};this[_0xbe0a('0x13')]={};this[_0xbe0a('0x14')]={};this[_0xbe0a('0x15')]={};this[_0xbe0a('0x16')]={};this[_0xbe0a('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbe0a('0x18')]={};this[_0xbe0a('0x19')]={};this[_0xbe0a('0x1a')]={};this[_0xbe0a('0x1b')]={};this[_0xbe0a('0x1c')]={};this[_0xbe0a('0x1d')]={};this[_0xbe0a('0x1e')]={};this[_0xbe0a('0x1f')]={};this[_0xbe0a('0x20')]={};this[_0xbe0a('0x21')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0xbe0a('0x22')]={};this[_0xbe0a('0x23')]={};this[_0xbe0a('0x24')]={};this[_0xbe0a('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0xbb75da,_0x3119d7,_0x3a8218){var _0xc734c8=_[_0xbe0a('0x26')](_0xbb75da,function(_0x1db0e6,_0xc543b4){return _0x1db0e6[_0x3a8218];});for(var _0x1d40eb in _0x3119d7){if(_0x3119d7[_0xbe0a('0x27')](_0x1d40eb)){if(!_0xc734c8[_0x1d40eb]){delete _0x3119d7[_0x1d40eb];}}}}function freeIsNotKeySip(_0x1634cc,_0x5e95b5){var _0x16eae3=_[_0xbe0a('0x26')](_0x1634cc,function(_0x5c8805,_0xd1d0bf){return util[_0xbe0a('0x28')](_0xbe0a('0x29'),_0x5c8805[_0xbe0a('0x2a')]);});for(var _0x3be04d in _0x5e95b5){if(_0x5e95b5[_0xbe0a('0x27')](_0x3be04d)){if(!_0x16eae3[_0x3be04d]){delete _0x5e95b5[_0x3be04d];}}}}function freeIsNotKeyAgent(_0x405ff4,_0xcc5b63){var _0x217531=_['mapKeys'](_0x405ff4,function(_0x5da9c5,_0x1526e9){var _0x4a3349=_['isNil'](_0x5da9c5[_0xbe0a('0x2b')])?util[_0xbe0a('0x28')](_0xbe0a('0x29'),_0x5da9c5['name']):_0x5da9c5[_0xbe0a('0x2b')];return _0x4a3349;});for(var _0x7b1cd4 in _0xcc5b63){if(_0xcc5b63[_0xbe0a('0x27')](_0x7b1cd4)){if(!_0x217531[_0x7b1cd4]){delete _0xcc5b63[_0x7b1cd4];}}}}function clearVoiceCallReports(_0x1b07bb){_0x1b07bb[_0xbe0a('0x2c')]=0x0;_0x1b07bb[_0xbe0a('0x2d')]=0x0;_0x1b07bb[_0xbe0a('0x2e')]=0x0;_0x1b07bb[_0xbe0a('0x2f')]=0x0;_0x1b07bb[_0xbe0a('0x30')]=0x0;}function clearCampaigns(_0x3f67ea){if(!_[_0xbe0a('0x31')](_0x3f67ea)){for(var _0x9dea73 in _0x3f67ea){if(_0x3f67ea[_0xbe0a('0x27')](_0x9dea73)){_0x3f67ea[_0x9dea73][_0xbe0a('0x32')]=0x0;_0x3f67ea[_0x9dea73][_0xbe0a('0x33')]=0x0;}}}}function clearVoiceQueues(_0x17ef30){if(!_[_0xbe0a('0x31')](_0x17ef30)){for(var _0x492af2 in _0x17ef30){if(_0x17ef30[_0xbe0a('0x27')](_0x492af2)){_0x17ef30[_0x492af2]['total']=0x0;_0x17ef30[_0x492af2]['answered']=0x0;_0x17ef30[_0x492af2]['unmanaged']=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x34')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x2e')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x2f')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x30')]=0x0;_0x17ef30[_0x492af2]['outboundAnswerAgiCallsDay']=0x0;_0x17ef30[_0x492af2]['outboundNoAnswerCallsDay']=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x35')]=0x0;_0x17ef30[_0x492af2]['outboundCongestionCallsDay']=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x36')]=0x0;_0x17ef30[_0x492af2]['outboundUnknownCallsDay']=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x37')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x38')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x39')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3a')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3b')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3c')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3d')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3e')]=0x0;_0x17ef30[_0x492af2][_0xbe0a('0x3f')]=!![];}}}}Realtime['prototype'][_0xbe0a('0x40')]=function(_0x3e0546,_0x7727dd){for(var _0x1a7e4c in _0x7727dd){if(_0x3e0546[_0xbe0a('0x27')](_0x1a7e4c)){_0x3e0546[_0x1a7e4c]=_0x7727dd[_0x1a7e4c];}}};Realtime[_0xbe0a('0x41')]['initAgents']=function(){var _0x11b377=this;return function(_0x571e15){if(_0x571e15){freeIsNotKeyAgent(_0x571e15,_0x11b377[_0xbe0a('0x10')]);for(var _0x24b00e=0x0,_0xf0fee4={},_0x5379a1={};_0x24b00e<_0x571e15[_0xbe0a('0x42')];_0x24b00e+=0x1){_0xf0fee4=_0x571e15[_0x24b00e];var _0x1a44e7=_[_0xbe0a('0x43')](_0xf0fee4['interface'])?util[_0xbe0a('0x28')](_0xbe0a('0x29'),_0xf0fee4[_0xbe0a('0x2a')]):_0xf0fee4[_0xbe0a('0x2b')];if(_[_0xbe0a('0x44')](_0x11b377[_0xbe0a('0x10')][_0x1a44e7])){_0x11b377[_0xbe0a('0x10')][_0x1a44e7]=new Agent(_0xf0fee4);}else{_0x11b377[_0xbe0a('0x40')](_0x11b377[_0xbe0a('0x10')][_0x1a44e7],_0xf0fee4);}}}return _0x11b377[_0xbe0a('0x10')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x45')]=function(){var _0x4904ec=this;return function(_0x4dd1b6){if(_0x4dd1b6){freeIsNotKeySip(_0x4dd1b6,_0x4904ec[_0xbe0a('0x11')]);for(var _0x261b6a=0x0,_0x580dfb={},_0x142f7e={};_0x261b6a<_0x4dd1b6[_0xbe0a('0x42')];_0x261b6a+=0x1){_0x580dfb=_0x4dd1b6[_0x261b6a];if(_[_0xbe0a('0x44')](_0x4904ec[_0xbe0a('0x11')][util[_0xbe0a('0x28')]('SIP/%s',_0x580dfb[_0xbe0a('0x2a')])])){_0x4904ec[_0xbe0a('0x11')][util[_0xbe0a('0x28')](_0xbe0a('0x29'),_0x580dfb['name'])]=new Telephone(_0x580dfb);}else{_0x4904ec[_0xbe0a('0x40')](_0x4904ec[_0xbe0a('0x11')][util['format'](_0xbe0a('0x29'),_0x580dfb[_0xbe0a('0x2a')])],_0x580dfb);}}}return _0x4904ec[_0xbe0a('0x11')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x46')]=function(){var _0x552606=this;return function(_0x191185){if(_0x191185){freeIsNotKeySip(_0x191185,_0x552606[_0xbe0a('0x12')]);for(var _0x17bb3b=0x0,_0x1f0108={},_0x33ff42={};_0x17bb3b<_0x191185[_0xbe0a('0x42')];_0x17bb3b+=0x1){_0x1f0108=_0x191185[_0x17bb3b];if(_[_0xbe0a('0x44')](_0x552606[_0xbe0a('0x12')][util[_0xbe0a('0x28')](_0xbe0a('0x29'),_0x1f0108[_0xbe0a('0x2a')])])){_0x552606[_0xbe0a('0x12')][util['format'](_0xbe0a('0x29'),_0x1f0108[_0xbe0a('0x2a')])]=new Trunk(_0x1f0108);}else{_0x552606[_0xbe0a('0x40')](_0x552606['trunks'][util['format'](_0xbe0a('0x29'),_0x1f0108[_0xbe0a('0x2a')])],_0x1f0108);}}}return _0x552606['trunks'];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x47')]=function(){var _0x479ea9=this;return function(_0x5175d7){if(_0x5175d7){freeIsNotKey(_0x5175d7,_0x479ea9[_0xbe0a('0x13')],_0xbe0a('0x2a'));for(var _0x4da8a1=0x0,_0x523bc6={},_0x58f7a2={};_0x4da8a1<_0x5175d7[_0xbe0a('0x42')];_0x4da8a1+=0x1){_0x523bc6=_0x5175d7[_0x4da8a1];if(_['isUndefined'](_0x479ea9[_0xbe0a('0x13')][_0x523bc6[_0xbe0a('0x2a')]])){_0x479ea9[_0xbe0a('0x13')][_0x523bc6[_0xbe0a('0x2a')]]=new VoiceQueue(_0x523bc6);}else{_0x479ea9['mergeFromDatabase'](_0x479ea9[_0xbe0a('0x13')][_0x523bc6[_0xbe0a('0x2a')]],_0x523bc6);}}}return _0x479ea9[_0xbe0a('0x13')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x48')]=function(){var _0x165ebd=this;return function(_0x1d2921){if(_0x1d2921){freeIsNotKey(_0x1d2921,_0x165ebd['triggers'],'id');for(var _0x23b4e1=0x0,_0x2b37cf={},_0x2759bd={};_0x23b4e1<_0x1d2921[_0xbe0a('0x42')];_0x23b4e1+=0x1){_0x2b37cf=_0x1d2921[_0x23b4e1];if(_[_0xbe0a('0x44')](_0x165ebd[_0xbe0a('0x14')][_0x2b37cf['id']])){_0x165ebd[_0xbe0a('0x14')][_0x2b37cf['id']]=new Trigger(_0x2b37cf);}else{_0x165ebd[_0xbe0a('0x40')](_0x165ebd[_0xbe0a('0x14')][_0x2b37cf['id']],_0x2b37cf);}}}return _0x165ebd['triggers'];};};Realtime[_0xbe0a('0x41')]['initTemplates']=function(){var _0x36dac1=this;return function(_0x104b13){if(_0x104b13){freeIsNotKey(_0x104b13,_0x36dac1['templates'],'id');for(var _0x50ce0b=0x0,_0x2d57fe={},_0x537949={};_0x50ce0b<_0x104b13[_0xbe0a('0x42')];_0x50ce0b+=0x1){_0x2d57fe=_0x104b13[_0x50ce0b];if(_[_0xbe0a('0x44')](_0x36dac1[_0xbe0a('0x16')][_0x2d57fe['id']])){_0x36dac1[_0xbe0a('0x16')][_0x2d57fe['id']]=new Template(_0x2d57fe);}else{_0x36dac1[_0xbe0a('0x40')](_0x36dac1[_0xbe0a('0x16')][_0x2d57fe['id']],_0x2d57fe);}}}return _0x36dac1[_0xbe0a('0x16')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x49')]=function(){var _0x50f696=this;return function(_0x4238f6){if(_0x4238f6){freeIsNotKey(_0x4238f6,_0x50f696['zendeskAccounts'],'id');for(var _0x3e73db=0x0,_0x1a3adb={},_0x63e8f6={};_0x3e73db<_0x4238f6[_0xbe0a('0x42')];_0x3e73db+=0x1){_0x1a3adb=_0x4238f6[_0x3e73db];if(_['isUndefined'](_0x50f696['zendeskAccounts'][_0x1a3adb['id']])){_0x50f696[_0xbe0a('0x1e')][_0x1a3adb['id']]=new ZendeskAccount(_0x1a3adb);}else{_0x50f696[_0xbe0a('0x40')](_0x50f696[_0xbe0a('0x1e')][_0x1a3adb['id']],_0x1a3adb);}}}return _0x50f696[_0xbe0a('0x1e')];};};Realtime['prototype'][_0xbe0a('0x4a')]=function(){var _0x5119e0=this;return function(_0x1765d3){if(_0x1765d3){freeIsNotKey(_0x1765d3,_0x5119e0[_0xbe0a('0x1f')],'id');for(var _0x148f8c=0x0,_0x5c2465={},_0x37aead={};_0x148f8c<_0x1765d3[_0xbe0a('0x42')];_0x148f8c+=0x1){_0x5c2465=_0x1765d3[_0x148f8c];if(_['isUndefined'](_0x5119e0[_0xbe0a('0x1f')][_0x5c2465['id']])){_0x5119e0[_0xbe0a('0x1f')][_0x5c2465['id']]=new SalesforceAccount(_0x5c2465);}else{_0x5119e0[_0xbe0a('0x40')](_0x5119e0[_0xbe0a('0x1f')][_0x5c2465['id']],_0x5c2465);}}}return _0x5119e0['salesforceAccounts'];};};Realtime[_0xbe0a('0x41')]['initFreshdeskAccounts']=function(){var _0x24d11c=this;return function(_0x2e4cdb){if(_0x2e4cdb){freeIsNotKey(_0x2e4cdb,_0x24d11c[_0xbe0a('0x21')],'id');for(var _0x3bd2cd=0x0,_0x173ea2={},_0x3689bc={};_0x3bd2cd<_0x2e4cdb[_0xbe0a('0x42')];_0x3bd2cd+=0x1){_0x173ea2=_0x2e4cdb[_0x3bd2cd];if(_['isUndefined'](_0x24d11c[_0xbe0a('0x21')][_0x173ea2['id']])){_0x24d11c[_0xbe0a('0x21')][_0x173ea2['id']]=new FreshdeskAccount(_0x173ea2);}else{_0x24d11c[_0xbe0a('0x40')](_0x24d11c[_0xbe0a('0x21')][_0x173ea2['id']],_0x173ea2);}}}return _0x24d11c[_0xbe0a('0x21')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x4b')]=function(){var _0x413dcb=this;return function(_0x5d7783){if(_0x5d7783){freeIsNotKey(_0x5d7783,_0x413dcb[_0xbe0a('0x4c')],'id');for(var _0x150ac6=0x0,_0x445a60={},_0x27eece={};_0x150ac6<_0x5d7783[_0xbe0a('0x42')];_0x150ac6+=0x1){_0x445a60=_0x5d7783[_0x150ac6];if(_[_0xbe0a('0x44')](_0x413dcb[_0xbe0a('0x4c')][_0x445a60['id']])){_0x413dcb['zohoAccounts'][_0x445a60['id']]=new ZohoAccount(_0x445a60);}else{_0x413dcb[_0xbe0a('0x40')](_0x413dcb[_0xbe0a('0x4c')][_0x445a60['id']],_0x445a60);}}}return _0x413dcb[_0xbe0a('0x4c')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x4d')]=function(){var _0x5dff2f=this;return function(_0x4b8c3a){if(_0x4b8c3a){freeIsNotKey(_0x4b8c3a,_0x5dff2f[_0xbe0a('0x4e')],'id');for(var _0x4e3eb3=0x0,_0x8a6642={},_0x33062e={};_0x4e3eb3<_0x4b8c3a['length'];_0x4e3eb3+=0x1){_0x8a6642=_0x4b8c3a[_0x4e3eb3];if(_[_0xbe0a('0x44')](_0x5dff2f['deskAccounts'][_0x8a6642['id']])){_0x5dff2f['deskAccounts'][_0x8a6642['id']]=new DeskAccount(_0x8a6642);}else{_0x5dff2f[_0xbe0a('0x40')](_0x5dff2f['deskAccounts'][_0x8a6642['id']],_0x8a6642);}}}return _0x5dff2f[_0xbe0a('0x4e')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x4f')]=function(){var _0x5d56d9=this;return function(_0x592b38){if(_0x592b38){freeIsNotKey(_0x592b38,_0x5d56d9[_0xbe0a('0x20')],'id');for(var _0x33347d=0x0,_0x2d88be={},_0x47d1ab={};_0x33347d<_0x592b38[_0xbe0a('0x42')];_0x33347d+=0x1){_0x2d88be=_0x592b38[_0x33347d];if(_[_0xbe0a('0x44')](_0x5d56d9[_0xbe0a('0x20')][_0x2d88be['id']])){_0x5d56d9[_0xbe0a('0x20')][_0x2d88be['id']]=new SugarcrmAccount(_0x2d88be);}else{_0x5d56d9['mergeFromDatabase'](_0x5d56d9[_0xbe0a('0x20')][_0x2d88be['id']],_0x2d88be);}}}return _0x5d56d9[_0xbe0a('0x20')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x50')]=function(){var _0x2ee5fa=this;return function(_0x2aa07b){if(_0x2aa07b){freeIsNotKey(_0x2aa07b,_0x2ee5fa[_0xbe0a('0x22')],'id');for(var _0x31d8cd=0x0,_0x594b3b={},_0x3060f0={};_0x31d8cd<_0x2aa07b[_0xbe0a('0x42')];_0x31d8cd+=0x1){_0x594b3b=_0x2aa07b[_0x31d8cd];if(_[_0xbe0a('0x44')](_0x2ee5fa[_0xbe0a('0x22')][_0x594b3b['id']])){_0x2ee5fa[_0xbe0a('0x22')][_0x594b3b['id']]=new VtigerAccount(_0x594b3b);}else{_0x2ee5fa[_0xbe0a('0x40')](_0x2ee5fa[_0xbe0a('0x22')][_0x594b3b['id']],_0x594b3b);}}}return _0x2ee5fa[_0xbe0a('0x22')];};};Realtime[_0xbe0a('0x41')]['initServicenowAccounts']=function(){var _0x5c4e60=this;return function(_0x280385){if(_0x280385){freeIsNotKey(_0x280385,_0x5c4e60['servicenowAccounts'],'id');for(var _0x3d7846=0x0,_0x585d83={},_0x6078e5={};_0x3d7846<_0x280385['length'];_0x3d7846+=0x1){_0x585d83=_0x280385[_0x3d7846];if(_[_0xbe0a('0x44')](_0x5c4e60[_0xbe0a('0x23')][_0x585d83['id']])){_0x5c4e60[_0xbe0a('0x23')][_0x585d83['id']]=new ServicenowAccount(_0x585d83);}else{_0x5c4e60[_0xbe0a('0x40')](_0x5c4e60[_0xbe0a('0x23')][_0x585d83['id']],_0x585d83);}}}return _0x5c4e60[_0xbe0a('0x23')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x51')]=function(){var _0x7dc0d3=this;return function(_0x4d08ca){if(_0x4d08ca){freeIsNotKey(_0x4d08ca,_0x7dc0d3[_0xbe0a('0x24')],'id');for(var _0xd98f66=0x0,_0x30d17c={},_0xb8b429={};_0xd98f66<_0x4d08ca[_0xbe0a('0x42')];_0xd98f66+=0x1){_0x30d17c=_0x4d08ca[_0xd98f66];if(_[_0xbe0a('0x44')](_0x7dc0d3['dynamics365Accounts'][_0x30d17c['id']])){_0x7dc0d3[_0xbe0a('0x24')][_0x30d17c['id']]=new Dynamics365Account(_0x30d17c);}else{_0x7dc0d3[_0xbe0a('0x40')](_0x7dc0d3[_0xbe0a('0x24')][_0x30d17c['id']],_0x30d17c);}}}return _0x7dc0d3[_0xbe0a('0x24')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x52')]=function(){var _0x5465a3=this;return function(_0x424d03){if(_0x424d03){freeIsNotKey(_0x424d03,_0x5465a3[_0xbe0a('0x25')],'id');for(var _0x5e9b3c=0x0,_0x2ba433={},_0x3091fb={};_0x5e9b3c<_0x424d03[_0xbe0a('0x42')];_0x5e9b3c+=0x1){_0x2ba433=_0x424d03[_0x5e9b3c];if(_[_0xbe0a('0x44')](_0x5465a3[_0xbe0a('0x25')][_0x2ba433['id']])){_0x5465a3[_0xbe0a('0x25')][_0x2ba433['id']]=new FreshsalesAccount(_0x2ba433);}else{_0x5465a3[_0xbe0a('0x40')](_0x5465a3[_0xbe0a('0x25')][_0x2ba433['id']],_0x2ba433);}}}return _0x5465a3[_0xbe0a('0x25')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x53')]=function(){var _0x52d444=this;return function(_0x4de7a1){for(var _0x181745=0x0;_0x181745<_0x4de7a1['length'];_0x181745+=0x1){_['merge'](_0x52d444['voiceQueues'][_0x4de7a1[_0x181745][_0xbe0a('0x2a')]],_0x4de7a1[_0x181745]);}return _0x52d444[_0xbe0a('0x13')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3a9e70=this;return function(_0x3aace9){clearVoiceQueues(_0x3a9e70[_0xbe0a('0x13')]);if(_0x3aace9){_0x3aace9=_[_0xbe0a('0x54')](_0x3aace9,'uniqueid');for(var _0x4fdfe5 in _0x3aace9){if(_0x3aace9[_0xbe0a('0x27')](_0x4fdfe5)){var _0x3ea43e={};for(var _0x1c83bd=0x0;_0x1c83bd<_0x3aace9[_0x4fdfe5]['length'];_0x1c83bd+=0x1){var _0x54f15a=_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x55')];if(_0x3a9e70['voiceQueues'][_0x54f15a]){if(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x56')]){_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x57')]+=0x1;}if(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x58')]){_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x34')]+=0x1;}_0x3a9e70[_0xbe0a('0x13')][_0x54f15a]['sumHoldTime']+=moment(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x59')])[_0xbe0a('0x5a')](moment(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x5b')]),_0xbe0a('0x5c'))||0x0;if(_0x1c83bd===_0x3aace9[_0x4fdfe5][_0xbe0a('0x42')]-0x1){_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x2f')]+=moment(_0x3aace9[_0x4fdfe5][_0x1c83bd]['queuecallercompleteAt']||_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x5d')]||_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x5e')])[_0xbe0a('0x5a')](moment(_0x3aace9[_0x4fdfe5][_0x1c83bd]['queuecallerjoinAt']),_0xbe0a('0x5c'))||0x0;_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x2c')]+=0x1;if(_0x3aace9[_0x4fdfe5][_0x1c83bd]['queuecallercomplete']){_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x2d')]+=0x1;_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x30')]+=moment(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x5f')])[_0xbe0a('0x5a')](moment(_0x3aace9[_0x4fdfe5][_0x1c83bd][_0xbe0a('0x59')]),_0xbe0a('0x5c'))||0x0;}}else{_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x2f')]+=_0x3a9e70[_0xbe0a('0x13')][_0x54f15a][_0xbe0a('0x2e')]||0x0;}}}}}}return _0x3a9e70[_0xbe0a('0x13')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x4aba05=this;return function(_0x3e7b37){clearVoiceCallReports(_0x4aba05[_0xbe0a('0x17')]);if(_0x3e7b37){for(var _0x39ab25=0x0;_0x39ab25<_0x3e7b37[_0xbe0a('0x42')];_0x39ab25+=0x1){_0x4aba05[_0xbe0a('0x17')][_0xbe0a('0x2c')]+=0x1;_0x4aba05[_0xbe0a('0x17')]['sumDuration']+=_0x3e7b37[_0x39ab25][_0xbe0a('0x60')];if(_0x3e7b37[_0x39ab25][_0xbe0a('0x61')]===_0xbe0a('0x62')){_0x4aba05[_0xbe0a('0x17')][_0xbe0a('0x2d')]+=0x1;_0x4aba05['outbound'][_0xbe0a('0x2e')]+=_0x3e7b37[_0x39ab25][_0xbe0a('0x60')]-_0x3e7b37[_0x39ab25][_0xbe0a('0x63')]||0x0;_0x4aba05[_0xbe0a('0x17')][_0xbe0a('0x30')]+=_0x3e7b37[_0x39ab25]['billableseconds'];}}}return _0x4aba05[_0xbe0a('0x17')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x64')]=function(){var _0x5067c3=this;return function(_0x332e5a){if(_0x332e5a){freeIsNotKey(_0x332e5a,_0x5067c3[_0xbe0a('0x15')],_0xbe0a('0x2a'));for(var _0x524fae=0x0,_0x57e6da={};_0x524fae<_0x332e5a[_0xbe0a('0x42')];_0x524fae+=0x1){_0x57e6da=_0x332e5a[_0x524fae];if(_[_0xbe0a('0x44')](_0x5067c3[_0xbe0a('0x15')][_0x57e6da[_0xbe0a('0x2a')]])){_0x5067c3[_0xbe0a('0x15')][_0x57e6da['name']]=new Campaign(_0x57e6da);}else{_0x5067c3[_0xbe0a('0x40')](_0x5067c3[_0xbe0a('0x15')][_0x57e6da[_0xbe0a('0x2a')]],_0x57e6da);_0x5067c3[_0xbe0a('0x15')][_0x57e6da['name']][_0xbe0a('0x65')]=_0x57e6da[_0xbe0a('0x66')]?_0x57e6da[_0xbe0a('0x66')][_0xbe0a('0x2a')]:undefined;}}}return _0x5067c3[_0xbe0a('0x15')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x67')]=function(){var _0x3c4651=this;return function(_0x1b301b){if(_0x1b301b){freeIsNotKey(_0x1b301b,_0x3c4651[_0xbe0a('0x18')],'id');for(var _0xdaa450=0x0,_0x273057={};_0xdaa450<_0x1b301b[_0xbe0a('0x42')];_0xdaa450+=0x1){_0x273057=_0x1b301b[_0xdaa450];if(_[_0xbe0a('0x44')](_0x3c4651[_0xbe0a('0x18')][_0x273057['id']])){_0x3c4651['voiceExtensions'][_0x273057['id']]=new VoiceExtension(_0x273057);}else{_0x3c4651[_0xbe0a('0x40')](_0x3c4651[_0xbe0a('0x18')][_0x273057['id']],_0x273057);}}}return _0x3c4651[_0xbe0a('0x18')];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x68')]=function(){var _0x2001a3=this;return function(_0x2b21b2){clearCampaigns(_0x2001a3[_0xbe0a('0x15')]);for(var _0x2a8736=0x0;_0x2a8736<_0x2b21b2[_0xbe0a('0x42')];_0x2a8736+=0x1){_['merge'](_0x2001a3['campaigns'][_0x2b21b2[_0x2a8736][_0xbe0a('0x2a')]],_0x2b21b2[_0x2a8736]);}return _0x2001a3['campaigns'];};};Realtime[_0xbe0a('0x41')][_0xbe0a('0x69')]=function(){var _0x118895=this;return function(_0x44336e){if(_0x44336e){freeIsNotKey(_0x44336e,_0x118895['faxAccounts'],'id');for(var _0x124846=0x0,_0x2c16ae={},_0x257250={};_0x124846<_0x44336e[_0xbe0a('0x42')];_0x124846+=0x1){_0x2c16ae=_0x44336e[_0x124846];if(_[_0xbe0a('0x44')](_0x118895[_0xbe0a('0x6a')][_0x2c16ae['id']])){_0x118895[_0xbe0a('0x6a')][_0x2c16ae['id']]=new FaxAccount(_0x2c16ae);}else{_0x118895[_0xbe0a('0x40')](_0x118895[_0xbe0a('0x6a')][_0x2c16ae['id']],_0x2c16ae);}}}return _0x118895[_0xbe0a('0x6a')];};};module['exports']=Realtime; \ No newline at end of file +var _0xb8cd=['outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','agents','telephones','initTrunks','initVoiceQueues','voiceQueues','initTemplates','initSalesforceAccounts','initZohoAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallercomplete','diff','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','exports','bluebird','util','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','trunks','triggers','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','answered','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay'];(function(_0x580b84,_0x56fd3f){var _0x5dcc8b=function(_0x501c4c){while(--_0x501c4c){_0x580b84['push'](_0x580b84['shift']());}};_0x5dcc8b(++_0x56fd3f);}(_0xb8cd,0x96));var _0xdb8c=function(_0x20a63e,_0xcb0bea){_0x20a63e=_0x20a63e-0x0;var _0x56fe3d=_0xb8cd[_0x20a63e];return _0x56fe3d;};'use strict';var BPromise=require(_0xdb8c('0x0'));var util=require(_0xdb8c('0x1'));var _=require('lodash');var moment=require(_0xdb8c('0x2'));var Agent=require(_0xdb8c('0x3'));var Telephone=require(_0xdb8c('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xdb8c('0x5'));var Trigger=require(_0xdb8c('0x6'));var Template=require(_0xdb8c('0x7'));var Campaign=require(_0xdb8c('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xdb8c('0x9'));var SalesforceAccount=require(_0xdb8c('0xa'));var FreshdeskAccount=require(_0xdb8c('0xb'));var SugarcrmAccount=require(_0xdb8c('0xc'));var ZohoAccount=require(_0xdb8c('0xd'));var DeskAccount=require(_0xdb8c('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xdb8c('0xf'));var Dynamics365Account=require(_0xdb8c('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xdb8c('0x11'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0xdb8c('0x12')]={};this['voiceQueues']={};this[_0xdb8c('0x13')]={};this[_0xdb8c('0x14')]={};this[_0xdb8c('0x15')]={};this[_0xdb8c('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xdb8c('0x17')]={};this['queueChannels']={};this[_0xdb8c('0x18')]={};this['timers']={};this[_0xdb8c('0x19')]={};this[_0xdb8c('0x1a')]={};this[_0xdb8c('0x1b')]={};this[_0xdb8c('0x1c')]={};this[_0xdb8c('0x1d')]={};this[_0xdb8c('0x1e')]={};this[_0xdb8c('0x1f')]={};this[_0xdb8c('0x20')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0xdb8c('0x21')]={};this[_0xdb8c('0x22')]={};};function freeIsNotKey(_0xb37bad,_0x58dcf5,_0x48c132){var _0x4f8fe4=_[_0xdb8c('0x23')](_0xb37bad,function(_0x992237,_0x52badc){return _0x992237[_0x48c132];});for(var _0x897305 in _0x58dcf5){if(_0x58dcf5[_0xdb8c('0x24')](_0x897305)){if(!_0x4f8fe4[_0x897305]){delete _0x58dcf5[_0x897305];}}}}function freeIsNotKeySip(_0x1cf5a1,_0x1d9e53){var _0x2a7536=_[_0xdb8c('0x23')](_0x1cf5a1,function(_0x2103a1,_0x2e2fbf){return util[_0xdb8c('0x25')](_0xdb8c('0x26'),_0x2103a1[_0xdb8c('0x27')]);});for(var _0x28a03c in _0x1d9e53){if(_0x1d9e53[_0xdb8c('0x24')](_0x28a03c)){if(!_0x2a7536[_0x28a03c]){delete _0x1d9e53[_0x28a03c];}}}}function freeIsNotKeyAgent(_0x5a440f,_0x2f898a){var _0x1b6f0a=_[_0xdb8c('0x23')](_0x5a440f,function(_0x4216a1,_0x4ef177){var _0x39048a=_[_0xdb8c('0x28')](_0x4216a1[_0xdb8c('0x29')])?util[_0xdb8c('0x25')]('SIP/%s',_0x4216a1['name']):_0x4216a1[_0xdb8c('0x29')];return _0x39048a;});for(var _0x28c4ef in _0x2f898a){if(_0x2f898a['hasOwnProperty'](_0x28c4ef)){if(!_0x1b6f0a[_0x28c4ef]){delete _0x2f898a[_0x28c4ef];}}}}function clearVoiceCallReports(_0x4fa3be){_0x4fa3be[_0xdb8c('0x2a')]=0x0;_0x4fa3be['answered']=0x0;_0x4fa3be[_0xdb8c('0x2b')]=0x0;_0x4fa3be['sumDuration']=0x0;_0x4fa3be[_0xdb8c('0x2c')]=0x0;}function clearCampaigns(_0x1401d4){if(!_['isEmpty'](_0x1401d4)){for(var _0x2a2e4d in _0x1401d4){if(_0x1401d4[_0xdb8c('0x24')](_0x2a2e4d)){_0x1401d4[_0x2a2e4d][_0xdb8c('0x2d')]=0x0;_0x1401d4[_0x2a2e4d][_0xdb8c('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x4e3c56){if(!_[_0xdb8c('0x2f')](_0x4e3c56)){for(var _0x1682e0 in _0x4e3c56){if(_0x4e3c56[_0xdb8c('0x24')](_0x1682e0)){_0x4e3c56[_0x1682e0][_0xdb8c('0x2a')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x30')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x31')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x32')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x2b')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x33')]=0x0;_0x4e3c56[_0x1682e0]['sumBillable']=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x34')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x35')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x36')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x37')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x38')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x39')]=0x0;_0x4e3c56[_0x1682e0]['outboundDropCallsDayTimeout']=0x0;_0x4e3c56[_0x1682e0]['outboundDropCallsDayCallersExit']=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x3a')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x3b')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x3c')]=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x3d')]=0x0;_0x4e3c56[_0x1682e0]['outboundAnswerAgiCallsDay']=0x0;_0x4e3c56[_0x1682e0][_0xdb8c('0x3e')]=0x0;_0x4e3c56[_0x1682e0]['queueStatusComplete']=!![];}}}}Realtime[_0xdb8c('0x3f')][_0xdb8c('0x40')]=function(_0x109d78,_0x5de784){for(var _0x39e0cf in _0x5de784){if(_0x109d78['hasOwnProperty'](_0x39e0cf)){_0x109d78[_0x39e0cf]=_0x5de784[_0x39e0cf];}}};Realtime['prototype'][_0xdb8c('0x41')]=function(){var _0x29195b=this;return function(_0x571e72){if(_0x571e72){freeIsNotKeyAgent(_0x571e72,_0x29195b['agents']);for(var _0x53a20c=0x0,_0x2bac34={},_0x5c4268={};_0x53a20c<_0x571e72[_0xdb8c('0x42')];_0x53a20c+=0x1){_0x2bac34=_0x571e72[_0x53a20c];var _0x5e85ca=_[_0xdb8c('0x28')](_0x2bac34[_0xdb8c('0x29')])?util[_0xdb8c('0x25')]('SIP/%s',_0x2bac34['name']):_0x2bac34[_0xdb8c('0x29')];if(_[_0xdb8c('0x43')](_0x29195b[_0xdb8c('0x44')][_0x5e85ca])){_0x29195b['agents'][_0x5e85ca]=new Agent(_0x2bac34);}else{_0x29195b['mergeFromDatabase'](_0x29195b[_0xdb8c('0x44')][_0x5e85ca],_0x2bac34);}}}return _0x29195b['agents'];};};Realtime[_0xdb8c('0x3f')]['initTelephones']=function(){var _0x46cae0=this;return function(_0x237fd0){if(_0x237fd0){freeIsNotKeySip(_0x237fd0,_0x46cae0[_0xdb8c('0x45')]);for(var _0x4c450d=0x0,_0x3b92f3={},_0x510780={};_0x4c450d<_0x237fd0[_0xdb8c('0x42')];_0x4c450d+=0x1){_0x3b92f3=_0x237fd0[_0x4c450d];if(_['isUndefined'](_0x46cae0[_0xdb8c('0x45')][util['format'](_0xdb8c('0x26'),_0x3b92f3['name'])])){_0x46cae0[_0xdb8c('0x45')][util[_0xdb8c('0x25')]('SIP/%s',_0x3b92f3[_0xdb8c('0x27')])]=new Telephone(_0x3b92f3);}else{_0x46cae0[_0xdb8c('0x40')](_0x46cae0[_0xdb8c('0x45')][util[_0xdb8c('0x25')](_0xdb8c('0x26'),_0x3b92f3[_0xdb8c('0x27')])],_0x3b92f3);}}}return _0x46cae0[_0xdb8c('0x45')];};};Realtime['prototype'][_0xdb8c('0x46')]=function(){var _0x2f5790=this;return function(_0x419e7f){if(_0x419e7f){freeIsNotKeySip(_0x419e7f,_0x2f5790[_0xdb8c('0x12')]);for(var _0x14a0f8=0x0,_0x1a554a={},_0xc49d3b={};_0x14a0f8<_0x419e7f[_0xdb8c('0x42')];_0x14a0f8+=0x1){_0x1a554a=_0x419e7f[_0x14a0f8];if(_['isUndefined'](_0x2f5790[_0xdb8c('0x12')][util[_0xdb8c('0x25')](_0xdb8c('0x26'),_0x1a554a[_0xdb8c('0x27')])])){_0x2f5790[_0xdb8c('0x12')][util[_0xdb8c('0x25')](_0xdb8c('0x26'),_0x1a554a[_0xdb8c('0x27')])]=new Trunk(_0x1a554a);}else{_0x2f5790[_0xdb8c('0x40')](_0x2f5790['trunks'][util[_0xdb8c('0x25')]('SIP/%s',_0x1a554a[_0xdb8c('0x27')])],_0x1a554a);}}}return _0x2f5790[_0xdb8c('0x12')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x47')]=function(){var _0x2157a8=this;return function(_0x40d811){if(_0x40d811){freeIsNotKey(_0x40d811,_0x2157a8['voiceQueues'],_0xdb8c('0x27'));for(var _0xa79988=0x0,_0x3c1252={},_0x556c44={};_0xa79988<_0x40d811[_0xdb8c('0x42')];_0xa79988+=0x1){_0x3c1252=_0x40d811[_0xa79988];if(_['isUndefined'](_0x2157a8['voiceQueues'][_0x3c1252[_0xdb8c('0x27')]])){_0x2157a8[_0xdb8c('0x48')][_0x3c1252['name']]=new VoiceQueue(_0x3c1252);}else{_0x2157a8[_0xdb8c('0x40')](_0x2157a8['voiceQueues'][_0x3c1252['name']],_0x3c1252);}}}return _0x2157a8[_0xdb8c('0x48')];};};Realtime[_0xdb8c('0x3f')]['initTriggers']=function(){var _0x32eb87=this;return function(_0x469748){if(_0x469748){freeIsNotKey(_0x469748,_0x32eb87[_0xdb8c('0x13')],'id');for(var _0x1a802d=0x0,_0x50e574={},_0x5a707d={};_0x1a802d<_0x469748[_0xdb8c('0x42')];_0x1a802d+=0x1){_0x50e574=_0x469748[_0x1a802d];if(_[_0xdb8c('0x43')](_0x32eb87[_0xdb8c('0x13')][_0x50e574['id']])){_0x32eb87['triggers'][_0x50e574['id']]=new Trigger(_0x50e574);}else{_0x32eb87[_0xdb8c('0x40')](_0x32eb87['triggers'][_0x50e574['id']],_0x50e574);}}}return _0x32eb87[_0xdb8c('0x13')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x49')]=function(){var _0x4300c0=this;return function(_0x26a053){if(_0x26a053){freeIsNotKey(_0x26a053,_0x4300c0['templates'],'id');for(var _0x3d24f8=0x0,_0x723f3b={},_0x1fab38={};_0x3d24f8<_0x26a053[_0xdb8c('0x42')];_0x3d24f8+=0x1){_0x723f3b=_0x26a053[_0x3d24f8];if(_[_0xdb8c('0x43')](_0x4300c0[_0xdb8c('0x15')][_0x723f3b['id']])){_0x4300c0[_0xdb8c('0x15')][_0x723f3b['id']]=new Template(_0x723f3b);}else{_0x4300c0['mergeFromDatabase'](_0x4300c0[_0xdb8c('0x15')][_0x723f3b['id']],_0x723f3b);}}}return _0x4300c0[_0xdb8c('0x15')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x416c79=this;return function(_0x4e1143){if(_0x4e1143){freeIsNotKey(_0x4e1143,_0x416c79['zendeskAccounts'],'id');for(var _0x509d9c=0x0,_0xa62e98={},_0x312dad={};_0x509d9c<_0x4e1143[_0xdb8c('0x42')];_0x509d9c+=0x1){_0xa62e98=_0x4e1143[_0x509d9c];if(_['isUndefined'](_0x416c79[_0xdb8c('0x1a')][_0xa62e98['id']])){_0x416c79[_0xdb8c('0x1a')][_0xa62e98['id']]=new ZendeskAccount(_0xa62e98);}else{_0x416c79['mergeFromDatabase'](_0x416c79[_0xdb8c('0x1a')][_0xa62e98['id']],_0xa62e98);}}}return _0x416c79['zendeskAccounts'];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x4a')]=function(){var _0x405cc2=this;return function(_0x5e40bf){if(_0x5e40bf){freeIsNotKey(_0x5e40bf,_0x405cc2[_0xdb8c('0x1b')],'id');for(var _0x240951=0x0,_0x281179={},_0x58b409={};_0x240951<_0x5e40bf[_0xdb8c('0x42')];_0x240951+=0x1){_0x281179=_0x5e40bf[_0x240951];if(_[_0xdb8c('0x43')](_0x405cc2[_0xdb8c('0x1b')][_0x281179['id']])){_0x405cc2[_0xdb8c('0x1b')][_0x281179['id']]=new SalesforceAccount(_0x281179);}else{_0x405cc2[_0xdb8c('0x40')](_0x405cc2[_0xdb8c('0x1b')][_0x281179['id']],_0x281179);}}}return _0x405cc2[_0xdb8c('0x1b')];};};Realtime[_0xdb8c('0x3f')]['initFreshdeskAccounts']=function(){var _0x356ea6=this;return function(_0x165c2c){if(_0x165c2c){freeIsNotKey(_0x165c2c,_0x356ea6['freshdeskAccounts'],'id');for(var _0x20d35e=0x0,_0x345759={},_0x7ccba1={};_0x20d35e<_0x165c2c['length'];_0x20d35e+=0x1){_0x345759=_0x165c2c[_0x20d35e];if(_[_0xdb8c('0x43')](_0x356ea6[_0xdb8c('0x1d')][_0x345759['id']])){_0x356ea6[_0xdb8c('0x1d')][_0x345759['id']]=new FreshdeskAccount(_0x345759);}else{_0x356ea6[_0xdb8c('0x40')](_0x356ea6[_0xdb8c('0x1d')][_0x345759['id']],_0x345759);}}}return _0x356ea6[_0xdb8c('0x1d')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x4b')]=function(){var _0x5b3c77=this;return function(_0xaf1d0d){if(_0xaf1d0d){freeIsNotKey(_0xaf1d0d,_0x5b3c77[_0xdb8c('0x1e')],'id');for(var _0x41c0b7=0x0,_0x30e20c={},_0x3e2f2f={};_0x41c0b7<_0xaf1d0d[_0xdb8c('0x42')];_0x41c0b7+=0x1){_0x30e20c=_0xaf1d0d[_0x41c0b7];if(_[_0xdb8c('0x43')](_0x5b3c77[_0xdb8c('0x1e')][_0x30e20c['id']])){_0x5b3c77[_0xdb8c('0x1e')][_0x30e20c['id']]=new ZohoAccount(_0x30e20c);}else{_0x5b3c77[_0xdb8c('0x40')](_0x5b3c77[_0xdb8c('0x1e')][_0x30e20c['id']],_0x30e20c);}}}return _0x5b3c77[_0xdb8c('0x1e')];};};Realtime[_0xdb8c('0x3f')]['initDeskAccounts']=function(){var _0x5463f1=this;return function(_0x5e8ea8){if(_0x5e8ea8){freeIsNotKey(_0x5e8ea8,_0x5463f1['deskAccounts'],'id');for(var _0x1cfa5f=0x0,_0x1d6467={},_0x1399dd={};_0x1cfa5f<_0x5e8ea8[_0xdb8c('0x42')];_0x1cfa5f+=0x1){_0x1d6467=_0x5e8ea8[_0x1cfa5f];if(_[_0xdb8c('0x43')](_0x5463f1['deskAccounts'][_0x1d6467['id']])){_0x5463f1[_0xdb8c('0x1f')][_0x1d6467['id']]=new DeskAccount(_0x1d6467);}else{_0x5463f1[_0xdb8c('0x40')](_0x5463f1['deskAccounts'][_0x1d6467['id']],_0x1d6467);}}}return _0x5463f1[_0xdb8c('0x1f')];};};Realtime[_0xdb8c('0x3f')]['initSugarcrmAccounts']=function(){var _0xa1a8a6=this;return function(_0x3dd387){if(_0x3dd387){freeIsNotKey(_0x3dd387,_0xa1a8a6[_0xdb8c('0x1c')],'id');for(var _0x359743=0x0,_0x2eb392={},_0x48747a={};_0x359743<_0x3dd387[_0xdb8c('0x42')];_0x359743+=0x1){_0x2eb392=_0x3dd387[_0x359743];if(_[_0xdb8c('0x43')](_0xa1a8a6['sugarcrmAccounts'][_0x2eb392['id']])){_0xa1a8a6['sugarcrmAccounts'][_0x2eb392['id']]=new SugarcrmAccount(_0x2eb392);}else{_0xa1a8a6['mergeFromDatabase'](_0xa1a8a6['sugarcrmAccounts'][_0x2eb392['id']],_0x2eb392);}}}return _0xa1a8a6[_0xdb8c('0x1c')];};};Realtime['prototype'][_0xdb8c('0x4c')]=function(){var _0x32a186=this;return function(_0x6512b1){if(_0x6512b1){freeIsNotKey(_0x6512b1,_0x32a186['vtigerAccounts'],'id');for(var _0x300112=0x0,_0x5055b9={},_0x8912ab={};_0x300112<_0x6512b1['length'];_0x300112+=0x1){_0x5055b9=_0x6512b1[_0x300112];if(_[_0xdb8c('0x43')](_0x32a186['vtigerAccounts'][_0x5055b9['id']])){_0x32a186[_0xdb8c('0x20')][_0x5055b9['id']]=new VtigerAccount(_0x5055b9);}else{_0x32a186[_0xdb8c('0x40')](_0x32a186[_0xdb8c('0x20')][_0x5055b9['id']],_0x5055b9);}}}return _0x32a186['vtigerAccounts'];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x4d')]=function(){var _0x1f7712=this;return function(_0x271e89){if(_0x271e89){freeIsNotKey(_0x271e89,_0x1f7712[_0xdb8c('0x4e')],'id');for(var _0x37c9bd=0x0,_0x4a8c6e={},_0x34b001={};_0x37c9bd<_0x271e89[_0xdb8c('0x42')];_0x37c9bd+=0x1){_0x4a8c6e=_0x271e89[_0x37c9bd];if(_[_0xdb8c('0x43')](_0x1f7712[_0xdb8c('0x4e')][_0x4a8c6e['id']])){_0x1f7712[_0xdb8c('0x4e')][_0x4a8c6e['id']]=new ServicenowAccount(_0x4a8c6e);}else{_0x1f7712[_0xdb8c('0x40')](_0x1f7712['servicenowAccounts'][_0x4a8c6e['id']],_0x4a8c6e);}}}return _0x1f7712[_0xdb8c('0x4e')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x4f')]=function(){var _0x257c1d=this;return function(_0x355711){if(_0x355711){freeIsNotKey(_0x355711,_0x257c1d[_0xdb8c('0x50')],'id');for(var _0x1b6ff0=0x0,_0x2aa1db={},_0x59da0e={};_0x1b6ff0<_0x355711['length'];_0x1b6ff0+=0x1){_0x2aa1db=_0x355711[_0x1b6ff0];if(_['isUndefined'](_0x257c1d[_0xdb8c('0x50')][_0x2aa1db['id']])){_0x257c1d['dynamics365Accounts'][_0x2aa1db['id']]=new Dynamics365Account(_0x2aa1db);}else{_0x257c1d[_0xdb8c('0x40')](_0x257c1d['dynamics365Accounts'][_0x2aa1db['id']],_0x2aa1db);}}}return _0x257c1d['dynamics365Accounts'];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x51')]=function(){var _0x56ba2d=this;return function(_0x332da8){if(_0x332da8){freeIsNotKey(_0x332da8,_0x56ba2d[_0xdb8c('0x21')],'id');for(var _0x37571d=0x0,_0x5331d6={},_0x482364={};_0x37571d<_0x332da8[_0xdb8c('0x42')];_0x37571d+=0x1){_0x5331d6=_0x332da8[_0x37571d];if(_['isUndefined'](_0x56ba2d['freshsalesAccounts'][_0x5331d6['id']])){_0x56ba2d[_0xdb8c('0x21')][_0x5331d6['id']]=new FreshsalesAccount(_0x5331d6);}else{_0x56ba2d[_0xdb8c('0x40')](_0x56ba2d['freshsalesAccounts'][_0x5331d6['id']],_0x5331d6);}}}return _0x56ba2d[_0xdb8c('0x21')];};};Realtime[_0xdb8c('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x13be18=this;return function(_0x5d957b){for(var _0x1a4456=0x0;_0x1a4456<_0x5d957b[_0xdb8c('0x42')];_0x1a4456+=0x1){_['merge'](_0x13be18[_0xdb8c('0x48')][_0x5d957b[_0x1a4456][_0xdb8c('0x27')]],_0x5d957b[_0x1a4456]);}return _0x13be18[_0xdb8c('0x48')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x52')]=function(){var _0x48b768=this;return function(_0x23fe03){clearVoiceQueues(_0x48b768['voiceQueues']);if(_0x23fe03){_0x23fe03=_[_0xdb8c('0x53')](_0x23fe03,'uniqueid');for(var _0x48e13c in _0x23fe03){if(_0x23fe03[_0xdb8c('0x24')](_0x48e13c)){var _0x12e008={};for(var _0x263512=0x0;_0x263512<_0x23fe03[_0x48e13c][_0xdb8c('0x42')];_0x263512+=0x1){var _0x22b9c3=_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x54')];if(_0x48b768[_0xdb8c('0x48')][_0x22b9c3]){if(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x55')]){_0x48b768[_0xdb8c('0x48')][_0x22b9c3][_0xdb8c('0x31')]+=0x1;}if(_0x23fe03[_0x48e13c][_0x263512]['queuecallerabandon']){_0x48b768[_0xdb8c('0x48')][_0x22b9c3][_0xdb8c('0x32')]+=0x1;}_0x48b768[_0xdb8c('0x48')][_0x22b9c3][_0xdb8c('0x2b')]+=moment(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x56')])['diff'](moment(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x57')]),_0xdb8c('0x58'))||0x0;if(_0x263512===_0x23fe03[_0x48e13c]['length']-0x1){_0x48b768['voiceQueues'][_0x22b9c3][_0xdb8c('0x33')]+=moment(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x59')]||_0x23fe03[_0x48e13c][_0x263512]['queuecallerabandonAt']||_0x23fe03[_0x48e13c][_0x263512]['queuecallerexitAt'])['diff'](moment(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x57')]),_0xdb8c('0x58'))||0x0;_0x48b768[_0xdb8c('0x48')][_0x22b9c3][_0xdb8c('0x2a')]+=0x1;if(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x5a')]){_0x48b768['voiceQueues'][_0x22b9c3][_0xdb8c('0x30')]+=0x1;_0x48b768['voiceQueues'][_0x22b9c3][_0xdb8c('0x2c')]+=moment(_0x23fe03[_0x48e13c][_0x263512]['queuecallercompleteAt'])[_0xdb8c('0x5b')](moment(_0x23fe03[_0x48e13c][_0x263512][_0xdb8c('0x56')]),'seconds')||0x0;}}else{_0x48b768['voiceQueues'][_0x22b9c3][_0xdb8c('0x33')]+=_0x48b768['voiceQueues'][_0x22b9c3][_0xdb8c('0x2b')]||0x0;}}}}}}return _0x48b768[_0xdb8c('0x48')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x5c')]=function(){var _0x2f4d7a=this;return function(_0x49b9d4){clearVoiceCallReports(_0x2f4d7a['outbound']);if(_0x49b9d4){for(var _0x2032c1=0x0;_0x2032c1<_0x49b9d4[_0xdb8c('0x42')];_0x2032c1+=0x1){_0x2f4d7a[_0xdb8c('0x16')]['total']+=0x1;_0x2f4d7a[_0xdb8c('0x16')][_0xdb8c('0x33')]+=_0x49b9d4[_0x2032c1][_0xdb8c('0x5d')];if(_0x49b9d4[_0x2032c1][_0xdb8c('0x5e')]===_0xdb8c('0x5f')){_0x2f4d7a[_0xdb8c('0x16')][_0xdb8c('0x30')]+=0x1;_0x2f4d7a[_0xdb8c('0x16')][_0xdb8c('0x2b')]+=_0x49b9d4[_0x2032c1][_0xdb8c('0x5d')]-_0x49b9d4[_0x2032c1][_0xdb8c('0x60')]||0x0;_0x2f4d7a[_0xdb8c('0x16')][_0xdb8c('0x2c')]+=_0x49b9d4[_0x2032c1]['billableseconds'];}}}return _0x2f4d7a['outbound'];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x61')]=function(){var _0x3313b2=this;return function(_0x3e140c){if(_0x3e140c){freeIsNotKey(_0x3e140c,_0x3313b2[_0xdb8c('0x14')],_0xdb8c('0x27'));for(var _0x3fdac7=0x0,_0x35832d={};_0x3fdac7<_0x3e140c[_0xdb8c('0x42')];_0x3fdac7+=0x1){_0x35832d=_0x3e140c[_0x3fdac7];if(_[_0xdb8c('0x43')](_0x3313b2[_0xdb8c('0x14')][_0x35832d[_0xdb8c('0x27')]])){_0x3313b2['campaigns'][_0x35832d[_0xdb8c('0x27')]]=new Campaign(_0x35832d);}else{_0x3313b2['mergeFromDatabase'](_0x3313b2[_0xdb8c('0x14')][_0x35832d[_0xdb8c('0x27')]],_0x35832d);_0x3313b2[_0xdb8c('0x14')][_0x35832d[_0xdb8c('0x27')]][_0xdb8c('0x62')]=_0x35832d[_0xdb8c('0x63')]?_0x35832d['SquareProject'][_0xdb8c('0x27')]:undefined;}}}return _0x3313b2[_0xdb8c('0x14')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x64')]=function(){var _0x50d057=this;return function(_0x465aad){if(_0x465aad){freeIsNotKey(_0x465aad,_0x50d057[_0xdb8c('0x65')],'id');for(var _0x171792=0x0,_0x452540={};_0x171792<_0x465aad['length'];_0x171792+=0x1){_0x452540=_0x465aad[_0x171792];if(_[_0xdb8c('0x43')](_0x50d057['voiceExtensions'][_0x452540['id']])){_0x50d057[_0xdb8c('0x65')][_0x452540['id']]=new VoiceExtension(_0x452540);}else{_0x50d057[_0xdb8c('0x40')](_0x50d057[_0xdb8c('0x65')][_0x452540['id']],_0x452540);}}}return _0x50d057[_0xdb8c('0x65')];};};Realtime[_0xdb8c('0x3f')][_0xdb8c('0x66')]=function(){var _0x1472db=this;return function(_0x3b6f2a){clearCampaigns(_0x1472db[_0xdb8c('0x14')]);for(var _0x3fa7cd=0x0;_0x3fa7cd<_0x3b6f2a[_0xdb8c('0x42')];_0x3fa7cd+=0x1){_[_0xdb8c('0x67')](_0x1472db['campaigns'][_0x3b6f2a[_0x3fa7cd]['name']],_0x3b6f2a[_0x3fa7cd]);}return _0x1472db[_0xdb8c('0x14')];};};Realtime[_0xdb8c('0x3f')]['initFaxAccounts']=function(){var _0x49f828=this;return function(_0x54cc0d){if(_0x54cc0d){freeIsNotKey(_0x54cc0d,_0x49f828[_0xdb8c('0x22')],'id');for(var _0x343cf2=0x0,_0x33d94e={},_0x303ef4={};_0x343cf2<_0x54cc0d['length'];_0x343cf2+=0x1){_0x33d94e=_0x54cc0d[_0x343cf2];if(_[_0xdb8c('0x43')](_0x49f828[_0xdb8c('0x22')][_0x33d94e['id']])){_0x49f828[_0xdb8c('0x22')][_0x33d94e['id']]=new FaxAccount(_0x33d94e);}else{_0x49f828[_0xdb8c('0x40')](_0x49f828[_0xdb8c('0x22')][_0x33d94e['id']],_0x33d94e);}}}return _0x49f828[_0xdb8c('0x22')];};};module[_0xdb8c('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index df363d2..37ef1cd 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 _0x3d95=['type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','substring','mobile','indexOf','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','exten'];(function(_0x12f5f7,_0xa58b52){var _0x345c1b=function(_0x306035){while(--_0x306035){_0x12f5f7['push'](_0x12f5f7['shift']());}};_0x345c1b(++_0xa58b52);}(_0x3d95,0x1ea));var _0x53d9=function(_0x16cecf,_0x26ad2c){_0x16cecf=_0x16cecf-0x0;var _0x937c14=_0x3d95[_0x16cecf];return _0x937c14;};'use strict';var _=require(_0x53d9('0x0'));var moment=require(_0x53d9('0x1'));var util=require(_0x53d9('0x2'));var config=require(_0x53d9('0x3'));var ami=require(_0x53d9('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x53d9('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x53d9('0x6'));var RpcVoiceQueueReport=require(_0x53d9('0x7'));var RpcVoiceRecording=require(_0x53d9('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x53d9('0x9'));var VoiceCallReport=require(_0x53d9('0xa'));var VoiceAgentReport=require(_0x53d9('0xb'));var VoiceDialReport=require(_0x53d9('0xc'));var UserReport=require('./userReport');function Report(_0x313254){this[_0x53d9('0xd')]=_0x313254;this[_0x53d9('0xe')]=_0x313254['agents'];this[_0x53d9('0xf')]=_0x313254[_0x53d9('0xf')];}Report['prototype'][_0x53d9('0x10')]=function(_0x37ba96){var _0xfc6d55=new VoiceQueueReport(this[_0x53d9('0xd')]);var _0x1a234b=new VoiceAgentReport(this['realtime']);var _0x12d802=new VoiceDialReport(this['realtime']);var _0x320eaa=new VoiceCallReport(this[_0x53d9('0xd')]);var _0x2688b1=new UserReport(this[_0x53d9('0xd')]);if(config[_0x53d9('0x11')]&&config[_0x53d9('0x11')][_0x53d9('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x53d9('0x13')][_0x53d9('0x14')](this));ami['on'](_0x53d9('0x15'),this['voiceCallReport'][_0x53d9('0x14')](this));ami['on'](_0x53d9('0x16'),this[_0x53d9('0x17')]['bind'](this));ami['on'](_0x53d9('0x18'),this['voiceDialReport']['bind'](this));ami['on'](_0x53d9('0x19'),this[_0x53d9('0x1a')][_0x53d9('0x14')](this));ami['on']('attendedtransfer',this[_0x53d9('0x1b')][_0x53d9('0x14')](this));}};Report[_0x53d9('0x1c')][_0x53d9('0x1d')]=function(_0x21fcb4){var _0x18458b;_0x18458b=_[_0x53d9('0x1e')](this[_0x53d9('0xe')],function(_0x213599){return _0x213599[_0x53d9('0x1f')]==_0x21fcb4||_0x213599[_0x53d9('0x20')]==_0x21fcb4;});if(_[_0x53d9('0x21')](_0x18458b)){var _0xe334d8=_[_0x53d9('0x1e')](this[_0x53d9('0xf')],function(_0x53cd2c){return _0x53cd2c['accountcode']==_0x21fcb4||_0x53cd2c[_0x53d9('0x20')]==_0x21fcb4;});if(_0xe334d8){_0x18458b=_[_0x53d9('0x1e')](this[_0x53d9('0xe')],function(_0x407373){return _0x407373[_0x53d9('0x22')]==util[_0x53d9('0x23')](_0x53d9('0x24'),_0xe334d8['name']);});}}return _0x18458b;};Report[_0x53d9('0x1c')][_0x53d9('0x13')]=function(_0x39bf94){for(var _0x16ebcb=0x0;_0x16ebcb<_0x39bf94[_0x53d9('0x25')];_0x16ebcb+=0x1){var _0x4c6045=this[_0x53d9('0x1d')](_0x39bf94[_0x16ebcb][_0x53d9('0x26')]);if(_0x4c6045){_0x39bf94[_0x16ebcb][_0x53d9('0x1f')]=_0x4c6045['accountcode'];_0x39bf94[_0x16ebcb][_0x53d9('0x27')]=!![];_0x39bf94[_0x16ebcb]['lastAssignedTo']=_0x4c6045[_0x53d9('0x20')];_0x39bf94[_0x16ebcb][_0x53d9('0x22')]=_[_0x53d9('0x21')](_0x4c6045[_0x53d9('0x22')])?util[_0x53d9('0x23')](_0x53d9('0x24'),_0x4c6045[_0x53d9('0x20')]):_0x4c6045[_0x53d9('0x22')];if(_0x39bf94[_0x16ebcb][_0x53d9('0x28')]){_0x39bf94[_0x16ebcb][_0x53d9('0x29')]=moment()[_0x53d9('0x23')](_0x53d9('0x2a'));}if(_0x39bf94[_0x16ebcb][_0x53d9('0x2b')]){_0x39bf94[_0x16ebcb][_0x53d9('0x2c')]=moment()[_0x53d9('0x23')](_0x53d9('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x39bf94[_0x16ebcb]);}RpcVoiceQueueReport[_0x53d9('0x2d')](_0x39bf94[_0x16ebcb]);}};function extractCalleridNumber(_0x227738){var _0x691387=_0x227738[_0x53d9('0x2e')](/<(.*?)>/);return _0x691387?_0x691387[0x1]:_0x227738;}Report[_0x53d9('0x1c')][_0x53d9('0x2f')]=function(_0x7bb88d){_0x7bb88d[_0x53d9('0x30')]=_0x7bb88d[_0x53d9('0x30')]||_0x7bb88d[_0x53d9('0x31')];if(_0x7bb88d[_0x53d9('0x32')]==_0x53d9('0x33')){_0x7bb88d[_0x53d9('0x34')]=_0x53d9('0x35');_0x7bb88d[_0x53d9('0x36')]=_0x7bb88d[_0x53d9('0x35')];if(_0x7bb88d[_0x53d9('0x37')]==_0x53d9('0x38')){_0x7bb88d[_0x53d9('0x1f')]='';_0x7bb88d[_0x53d9('0x30')]=extractCalleridNumber(_0x7bb88d[_0x53d9('0x39')]);}else if(_0x7bb88d[_0x53d9('0x37')]==_0x53d9('0x3a')){if(_0x7bb88d[_0x53d9('0x30')]==_0x53d9('0x3b')){_0x7bb88d[_0x53d9('0x30')]=extractCalleridNumber(_0x7bb88d['calleridpreview']);_0x7bb88d[_0x53d9('0x3c')]=_0x7bb88d[_0x53d9('0x3d')];_0x7bb88d[_0x53d9('0x3e')]=[_0x7bb88d[_0x53d9('0x3f')],_0x7bb88d[_0x53d9('0x3f')]=_0x7bb88d[_0x53d9('0x3e')]][0x0];_0x7bb88d[_0x53d9('0x39')]=_0x7bb88d[_0x53d9('0x40')];}else{_0x7bb88d['destination']=_0x7bb88d[_0x53d9('0x3c')];_0x7bb88d[_0x53d9('0x3c')]=_0x7bb88d['originatecalleridnum'];if(_0x7bb88d[_0x53d9('0x41')]==_0x53d9('0x42')){_0x7bb88d[_0x53d9('0x1f')]=_0x7bb88d[_0x53d9('0x26')];}else{_0x7bb88d[_0x53d9('0x1f')]='';}}}}else{_0x7bb88d[_0x53d9('0x39')]=util[_0x53d9('0x23')](_0x53d9('0x43'),_0x7bb88d[_0x53d9('0x44')],_0x7bb88d[_0x53d9('0x3c')]);}if(RpcVoiceTransferReport[_0x53d9('0x45')][_0x7bb88d[_0x53d9('0x46')]]){var _0x45c344=RpcVoiceTransferReport['transfers'][_0x7bb88d[_0x53d9('0x46')]];_0x45c344[_0x53d9('0x47')]=_0x7bb88d[_0x53d9('0x48')];RpcVoiceTransferReport[_0x53d9('0x1a')](_0x45c344);delete RpcVoiceTransferReport['transfers'][_0x7bb88d[_0x53d9('0x46')]];}RpcVoiceCallReport[_0x53d9('0x2d')](_0x7bb88d);if(_0x7bb88d[_0x53d9('0x49')]){for(var _0x46c96b=0x0;_0x46c96b<_0x7bb88d[_0x53d9('0x4a')][_0x53d9('0x25')];_0x46c96b+=0x1){_0x7bb88d[_0x53d9('0x4b')]=_0x7bb88d[_0x53d9('0x4a')][_0x46c96b][_0x53d9('0x4c')];_0x7bb88d['createdAt']=_0x7bb88d['monitors'][_0x46c96b][_0x53d9('0x4d')];if(_0x7bb88d['exten']==_0x53d9('0x3b')){_0x7bb88d[_0x53d9('0x3c')]=_0x7bb88d[_0x53d9('0x26')];_0x7bb88d[_0x53d9('0x44')]=_0x7bb88d['connectedlinename'];_0x7bb88d[_0x53d9('0x26')]=_0x7bb88d[_0x53d9('0x1f')];_0x7bb88d['connectedlinename']=_0x7bb88d['membername'];_0x7bb88d[_0x53d9('0x31')]=_0x7bb88d['originatecalleridnum'];}else if(_0x7bb88d['exten']==_0x53d9('0x4e')){_0x7bb88d[_0x53d9('0x3c')]=_0x7bb88d['destination'];_0x7bb88d[_0x53d9('0x31')]=_0x7bb88d[_0x53d9('0x3d')];}RpcVoiceRecording[_0x53d9('0x2d')](_0x7bb88d);}}};Report['prototype'][_0x53d9('0x17')]=function(_0x25314e){if(_[_0x53d9('0x4f')](_0x25314e)){_0x25314e[_0x53d9('0x50')](function(_0x1df5c5){RpcVoiceAgentReport[_0x53d9('0x2d')](_0x1df5c5);});}else{RpcVoiceAgentReport[_0x53d9('0x2d')](_0x25314e);}};Report['prototype'][_0x53d9('0x51')]=function(_0x2294fd){RpcVoiceDialReport['create'](_0x2294fd);var _0x1ab509;var _0x5062c8;var _0x576587=_0x2294fd[_0x53d9('0x3f')];if(_[_0x53d9('0x52')](_0x576587,'Local')){_0x5062c8=_0x576587[_0x53d9('0x53')](_0x576587['indexOf']('/')+0x1,_0x576587['indexOf']('@'));_0x1ab509=_[_0x53d9('0x1e')](this['agents'],function(_0x3a3caf){return _0x3a3caf[_0x53d9('0x54')]==_0x5062c8||_0x3a3caf['phone']==_0x5062c8||_0x3a3caf[_0x53d9('0x1f')]==_0x5062c8;});}else{_0x5062c8=_0x576587['substring'](_0x576587[_0x53d9('0x55')]('/')+0x1,_0x576587[_0x53d9('0x56')]('-'));_0x1ab509=this[_0x53d9('0x1d')](_0x5062c8);}if(_0x1ab509){_0x2294fd[_0x53d9('0x22')]=_[_0x53d9('0x21')](_0x1ab509[_0x53d9('0x22')])?util[_0x53d9('0x23')](_0x53d9('0x24'),_0x1ab509[_0x53d9('0x20')]):_0x1ab509['interface'];_0x2294fd[_0x53d9('0x57')]=_0x1ab509[_0x53d9('0x20')];_0x2294fd[_0x53d9('0x1f')]=_0x1ab509[_0x53d9('0x1f')];RpcMemberReport[_0x53d9('0x51')](_0x2294fd);}};Report[_0x53d9('0x1c')]['blindTransfer']=function(_0x1e30e5){RpcVoiceTransferReport[_0x53d9('0x45')][_0x1e30e5[_0x53d9('0x58')]]=_0x1e30e5;};Report[_0x53d9('0x1c')][_0x53d9('0x1b')]=function(_0x205ab0){RpcVoiceTransferReport[_0x53d9('0x1b')](_0x205ab0);};module[_0x53d9('0x59')]=Report; \ No newline at end of file +var _0x303f=['callerid','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','uniqueid','blindTransfer','monitor','monitors','length','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceDialReport','voiceDialReport','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','voiceQueueReport','connectedlinenum','assigned','format','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','type'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x303f,0xbe));var _0xf303=function(_0x10d8e8,_0x35a012){_0x10d8e8=_0x10d8e8-0x0;var _0x48ac0e=_0x303f[_0x10d8e8];return _0x48ac0e;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xf303('0x0'));var config=require('../../../config/environment');var ami=require(_0xf303('0x1'));var RpcVoiceAgentReport=require(_0xf303('0x2'));var RpcVoiceCallReport=require(_0xf303('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xf303('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xf303('0x5'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xf303('0x6'));var VoiceCallReport=require(_0xf303('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xf303('0x8'));var UserReport=require('./userReport');function Report(_0x35eef0){this[_0xf303('0x9')]=_0x35eef0;this['agents']=_0x35eef0[_0xf303('0xa')];this[_0xf303('0xb')]=_0x35eef0[_0xf303('0xb')];}Report[_0xf303('0xc')]['sync']=function(_0x15618a){var _0x5ac30c=new VoiceQueueReport(this['realtime']);var _0x1f9e48=new VoiceAgentReport(this[_0xf303('0x9')]);var _0x1b74d2=new VoiceDialReport(this[_0xf303('0x9')]);var _0x158298=new VoiceCallReport(this[_0xf303('0x9')]);var _0x220b97=new UserReport(this[_0xf303('0x9')]);if(config[_0xf303('0xd')]&&config[_0xf303('0xd')][_0xf303('0xe')]){ami['on'](_0xf303('0xf'),this['voiceQueueReport'][_0xf303('0x10')](this));ami['on'](_0xf303('0x11'),this[_0xf303('0x12')][_0xf303('0x10')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0xf303('0x10')](this));ami['on'](_0xf303('0x13'),this[_0xf303('0x14')][_0xf303('0x10')](this));ami['on']('blindtransfer',this['blindTransfer'][_0xf303('0x10')](this));ami['on']('attendedtransfer',this[_0xf303('0x15')][_0xf303('0x10')](this));}};Report[_0xf303('0xc')][_0xf303('0x16')]=function(_0x1d44a3){var _0x51c1bf;_0x51c1bf=_[_0xf303('0x17')](this['agents'],function(_0x3c6582){return _0x3c6582[_0xf303('0x18')]==_0x1d44a3||_0x3c6582[_0xf303('0x19')]==_0x1d44a3;});if(_[_0xf303('0x1a')](_0x51c1bf)){var _0x12b994=_[_0xf303('0x17')](this['telephones'],function(_0x701f15){return _0x701f15[_0xf303('0x18')]==_0x1d44a3||_0x701f15[_0xf303('0x19')]==_0x1d44a3;});if(_0x12b994){_0x51c1bf=_[_0xf303('0x17')](this[_0xf303('0xa')],function(_0xcf91f6){return _0xcf91f6[_0xf303('0x1b')]==util['format'](_0xf303('0x1c'),_0x12b994[_0xf303('0x19')]);});}}return _0x51c1bf;};Report['prototype'][_0xf303('0x1d')]=function(_0x6aab9){for(var _0x4f101b=0x0;_0x4f101b<_0x6aab9['length'];_0x4f101b+=0x1){var _0xe97ade=this[_0xf303('0x16')](_0x6aab9[_0x4f101b][_0xf303('0x1e')]);if(_0xe97ade){_0x6aab9[_0x4f101b][_0xf303('0x18')]=_0xe97ade['accountcode'];_0x6aab9[_0x4f101b][_0xf303('0x1f')]=!![];_0x6aab9[_0x4f101b]['lastAssignedTo']=_0xe97ade[_0xf303('0x19')];_0x6aab9[_0x4f101b][_0xf303('0x1b')]=_[_0xf303('0x1a')](_0xe97ade[_0xf303('0x1b')])?util[_0xf303('0x20')](_0xf303('0x1c'),_0xe97ade[_0xf303('0x19')]):_0xe97ade[_0xf303('0x1b')];if(_0x6aab9[_0x4f101b]['queuecallercomplete']){_0x6aab9[_0x4f101b][_0xf303('0x21')]=moment()[_0xf303('0x20')](_0xf303('0x22'));}if(_0x6aab9[_0x4f101b][_0xf303('0x23')]){_0x6aab9[_0x4f101b][_0xf303('0x24')]=moment()[_0xf303('0x20')](_0xf303('0x22'));}RpcMemberReport[_0xf303('0x1d')](_0x6aab9[_0x4f101b]);}RpcVoiceQueueReport[_0xf303('0x25')](_0x6aab9[_0x4f101b]);}};function extractCalleridNumber(_0x1be012){var _0x8682c1=_0x1be012['match'](/<(.*?)>/);return _0x8682c1?_0x8682c1[0x1]:_0x1be012;}Report[_0xf303('0xc')][_0xf303('0x12')]=function(_0x48f71a){_0x48f71a['destination']=_0x48f71a[_0xf303('0x26')]||_0x48f71a[_0xf303('0x27')];if(_0x48f71a[_0xf303('0x28')]=='dialer'){_0x48f71a['lastapplication']='queue';_0x48f71a['lastdata']=_0x48f71a['queue'];if(_0x48f71a['context']=='from-voip-provider'){_0x48f71a[_0xf303('0x18')]='';_0x48f71a[_0xf303('0x26')]=extractCalleridNumber(_0x48f71a[_0xf303('0x29')]);}else if(_0x48f71a[_0xf303('0x2a')]==_0xf303('0x2b')){if(_0x48f71a['destination']==_0xf303('0x2c')){_0x48f71a[_0xf303('0x26')]=extractCalleridNumber(_0x48f71a[_0xf303('0x2d')]);_0x48f71a[_0xf303('0x2e')]=_0x48f71a[_0xf303('0x2f')];_0x48f71a['destinationchannel']=[_0x48f71a[_0xf303('0x30')],_0x48f71a[_0xf303('0x30')]=_0x48f71a[_0xf303('0x31')]][0x0];_0x48f71a[_0xf303('0x29')]=_0x48f71a[_0xf303('0x2d')];}else{_0x48f71a[_0xf303('0x26')]=_0x48f71a[_0xf303('0x2e')];_0x48f71a['calleridnum']=_0x48f71a['originatecalleridnum'];if(_0x48f71a[_0xf303('0x32')]==_0xf303('0x33')){_0x48f71a['accountcode']=_0x48f71a['connectedlinenum'];}else{_0x48f71a[_0xf303('0x18')]='';}}}}else{_0x48f71a[_0xf303('0x29')]=util[_0xf303('0x20')](_0xf303('0x34'),_0x48f71a[_0xf303('0x35')],_0x48f71a[_0xf303('0x2e')]);}if(RpcVoiceTransferReport['transfers'][_0x48f71a[_0xf303('0x36')]]){var _0x2cdd79=RpcVoiceTransferReport[_0xf303('0x37')][_0x48f71a[_0xf303('0x36')]];_0x2cdd79['transfereelinkedid']=_0x48f71a[_0xf303('0x38')];RpcVoiceTransferReport[_0xf303('0x39')](_0x2cdd79);delete RpcVoiceTransferReport[_0xf303('0x37')][_0x48f71a[_0xf303('0x36')]];}RpcVoiceCallReport[_0xf303('0x25')](_0x48f71a);if(_0x48f71a[_0xf303('0x3a')]){for(var _0x3d7528=0x0;_0x3d7528<_0x48f71a[_0xf303('0x3b')][_0xf303('0x3c')];_0x3d7528+=0x1){_0x48f71a['monitorFilename']=_0x48f71a['monitors'][_0x3d7528][_0xf303('0x3d')];_0x48f71a[_0xf303('0x3e')]=_0x48f71a[_0xf303('0x3b')][_0x3d7528]['createdAt'];if(_0x48f71a[_0xf303('0x27')]==_0xf303('0x2c')){_0x48f71a[_0xf303('0x2e')]=_0x48f71a[_0xf303('0x1e')];_0x48f71a[_0xf303('0x35')]=_0x48f71a[_0xf303('0x3f')];_0x48f71a[_0xf303('0x1e')]=_0x48f71a[_0xf303('0x18')];_0x48f71a[_0xf303('0x3f')]=_0x48f71a['membername'];_0x48f71a[_0xf303('0x27')]=_0x48f71a['originatecalleridnum'];}else if(_0x48f71a[_0xf303('0x27')]==_0xf303('0x40')){_0x48f71a[_0xf303('0x2e')]=_0x48f71a[_0xf303('0x26')];_0x48f71a['exten']=_0x48f71a[_0xf303('0x2f')];}RpcVoiceRecording[_0xf303('0x25')](_0x48f71a);}}};Report[_0xf303('0xc')]['voiceAgentReport']=function(_0x5632d9){if(_[_0xf303('0x41')](_0x5632d9)){_0x5632d9[_0xf303('0x42')](function(_0x5d55b8){RpcVoiceAgentReport['create'](_0x5d55b8);});}else{RpcVoiceAgentReport[_0xf303('0x25')](_0x5632d9);}};Report[_0xf303('0xc')][_0xf303('0x14')]=function(_0x1890e4){RpcVoiceDialReport[_0xf303('0x25')](_0x1890e4);var _0x32a663;var _0x27586f;var _0x347dba=_0x1890e4[_0xf303('0x30')];if(_[_0xf303('0x43')](_0x347dba,_0xf303('0x44'))){_0x27586f=_0x347dba[_0xf303('0x45')](_0x347dba[_0xf303('0x46')]('/')+0x1,_0x347dba[_0xf303('0x46')]('@'));_0x32a663=_['find'](this['agents'],function(_0x1d8c21){return _0x1d8c21[_0xf303('0x47')]==_0x27586f||_0x1d8c21[_0xf303('0x48')]==_0x27586f||_0x1d8c21[_0xf303('0x18')]==_0x27586f;});}else{_0x27586f=_0x347dba['substring'](_0x347dba['indexOf']('/')+0x1,_0x347dba[_0xf303('0x49')]('-'));_0x32a663=this['findAgent'](_0x27586f);}if(_0x32a663){_0x1890e4[_0xf303('0x1b')]=_[_0xf303('0x1a')](_0x32a663[_0xf303('0x1b')])?util['format'](_0xf303('0x1c'),_0x32a663[_0xf303('0x19')]):_0x32a663[_0xf303('0x1b')];_0x1890e4[_0xf303('0x4a')]=_0x32a663['name'];_0x1890e4[_0xf303('0x18')]=_0x32a663[_0xf303('0x18')];RpcMemberReport[_0xf303('0x14')](_0x1890e4);}};Report[_0xf303('0xc')][_0xf303('0x39')]=function(_0x3c98f8){RpcVoiceTransferReport[_0xf303('0x37')][_0x3c98f8[_0xf303('0x4b')]]=_0x3c98f8;};Report[_0xf303('0xc')]['attendedTransfer']=function(_0x358bb2){RpcVoiceTransferReport[_0xf303('0x15')](_0x358bb2);};module[_0xf303('0x4c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 053db89..c604292 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 _0xa8bc=['substring','indexOf','mobile','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','moment','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','bind','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','syncDeviceState','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xa8bc,0x1c7));var _0xca8b=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0xa8bc[_0x53f897];return _0x6879f8;};'use strict';var _=require('lodash');var moment=require(_0xca8b('0x0'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0xca8b('0x1'));var config=require(_0xca8b('0x2'));var logger=require(_0xca8b('0x3'))(_0xca8b('0x4'));var ami=require(_0xca8b('0x5'));config[_0xca8b('0x6')]=_[_0xca8b('0x7')](config[_0xca8b('0x6')],{'host':_0xca8b('0x8'),'port':0x18eb});var io=require(_0xca8b('0x9'))(new Redis(config[_0xca8b('0x6')]));function UserReport(_0x5dd710){this[_0xca8b('0xa')]=_0x5dd710['trunks'];this[_0xca8b('0xb')]=_0x5dd710['agents'];this[_0xca8b('0xc')]=_0x5dd710['telephones'];ami['on']('registryentry',this[_0xca8b('0xd')]['bind'](this));ami['on'](_0xca8b('0xe'),this[_0xca8b('0xd')][_0xca8b('0xf')](this));ami['on'](_0xca8b('0x10'),this['syncDeviceState'][_0xca8b('0xf')](this));ami['on'](_0xca8b('0x11'),this[_0xca8b('0x12')][_0xca8b('0xf')](this));return this[_0xca8b('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0xca8b('0x14')](ami[_0xca8b('0x15')]())[_0xca8b('0x16')](function(_0x3e0621){logger[_0xca8b('0x17')](_0xca8b('0x18'),util[_0xca8b('0x19')](_0x3e0621,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xca8b('0x1a')]()['then'](ami[_0xca8b('0x1b')]())[_0xca8b('0x16')](function(_0x1e4497){logger[_0xca8b('0x17')]('[userReport][devicestatelist]',util[_0xca8b('0x19')](_0x1e4497,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xca8b('0x1a')]()[_0xca8b('0x14')](ami['actionSipPeerStatus']())[_0xca8b('0x16')](function(_0x39a36a){logger[_0xca8b('0x17')](_0xca8b('0x1c'),util[_0xca8b('0x19')](_0x39a36a,{'showHidden':![],'depth':null}));});}UserReport[_0xca8b('0x1d')][_0xca8b('0x13')]=function(){setInterval(function(){BPromise[_0xca8b('0x1a')]()[_0xca8b('0x14')](showSipRegistrations())['then'](listDeviceStates())[_0xca8b('0x14')](showPeersStatus());},0x32c8);};UserReport[_0xca8b('0x1d')][_0xca8b('0x1e')]=function(_0x37fe19){return _0x37fe19!==null&&!_[_0xca8b('0x1f')](_0x37fe19);};UserReport[_0xca8b('0x1d')][_0xca8b('0x20')]=function(_0x46c3a0,_0x57ed9a,_0x5462b5){io['to'](_0x46c3a0)[_0xca8b('0x20')](_0x57ed9a,_0x5462b5);};UserReport[_0xca8b('0x1d')][_0xca8b('0xd')]=function(_0xe64a2f){try{if(this[_0xca8b('0x1e')](_0xe64a2f)){logger[_0xca8b('0x21')](_0xca8b('0x22'),_0xe64a2f[_0xca8b('0x23')],_0xe64a2f[_0xca8b('0x24')]);logger[_0xca8b('0x25')](_0xca8b('0x26'),util[_0xca8b('0x19')](_0xe64a2f,{'showHidden':![],'depth':null}));var _0x5ec543=_[_0xca8b('0x27')](this[_0xca8b('0xa')],{'defaultuser':_0xe64a2f[_0xca8b('0x23')]});if(_0x5ec543){_0xe64a2f[_0xca8b('0x28')]=_0xe64a2f[_0xca8b('0x24')];_[_0xca8b('0x29')](_0x5ec543,_[_0xca8b('0x2a')](_0xe64a2f,[_0xca8b('0x2b'),_0xca8b('0x2c'),_0xca8b('0x23'),_0xca8b('0x24')]));logger[_0xca8b('0x25')](_0xca8b('0x2d'),util[_0xca8b('0x19')](_0x5ec543,{'showHidden':![],'depth':null}));this[_0xca8b('0x20')](util[_0xca8b('0x2e')](_0xca8b('0x2f'),_0x5ec543[_0xca8b('0x30')]),_0xca8b('0x31'),_0x5ec543);}}}catch(_0x257e68){logger['error'](_0xca8b('0x26'),util[_0xca8b('0x19')](_0x257e68,{'showHidden':![],'depth':null}));}};UserReport[_0xca8b('0x1d')][_0xca8b('0x32')]=function(_0x3215fb){try{if(this['isNotNull'](_0x3215fb)){logger[_0xca8b('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x3215fb[_0xca8b('0x33')],_0x3215fb[_0xca8b('0x24')]);logger['debug'](_0xca8b('0x34'),util[_0xca8b('0x19')](_0x3215fb,{'showHidden':![],'depth':null}));if(this[_0xca8b('0xb')][_0x3215fb[_0xca8b('0x33')]]){if(!this[_0xca8b('0xb')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x35')]||_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]()=='inuse'){this[_0xca8b('0xb')][_0x3215fb['device']]['local']=![];if(this[_0xca8b('0xb')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]!==_0x3215fb[_0xca8b('0x24')]['toLowerCase']()){this[_0xca8b('0xb')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x37')]=_[_0xca8b('0x38')](moment()[_0xca8b('0x2e')]('x'));}this[_0xca8b('0xb')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]=_0x3215fb[_0xca8b('0x24')]['toLowerCase']();this['agents'][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x39')](_0x3215fb);}}else if(this[_0xca8b('0xc')][_0x3215fb[_0xca8b('0x33')]]){if(this[_0xca8b('0xc')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]!==_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]()){this[_0xca8b('0xc')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x37')]=_[_0xca8b('0x38')](moment()[_0xca8b('0x2e')]('x'));}this['telephones'][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]=_0x3215fb['state'][_0xca8b('0x36')]();logger[_0xca8b('0x25')](_0xca8b('0x3a'),util['inspect'](this['telephones'][_0x3215fb[_0xca8b('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xca8b('0x2e')]('telephone:%s',this['telephones'][_0x3215fb['device']]['name']),_0xca8b('0x3b'),this['telephones'][_0x3215fb[_0xca8b('0x33')]]);}else if(this[_0xca8b('0xa')][_0x3215fb[_0xca8b('0x33')]]){if(this['trunks'][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]!==_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]()){this['trunks'][_0x3215fb[_0xca8b('0x33')]]['stateTime']=_[_0xca8b('0x38')](moment()[_0xca8b('0x2e')]('x'));}this[_0xca8b('0xa')][_0x3215fb[_0xca8b('0x33')]][_0xca8b('0x24')]=_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]();logger[_0xca8b('0x25')](_0xca8b('0x3c'),util[_0xca8b('0x19')](this[_0xca8b('0xa')][_0x3215fb[_0xca8b('0x33')]],{'showHidden':![],'depth':null}));this[_0xca8b('0x20')](util['format'](_0xca8b('0x2f'),this[_0xca8b('0xa')][_0x3215fb['device']][_0xca8b('0x30')]),_0xca8b('0x31'),this[_0xca8b('0xa')][_0x3215fb['device']]);}else if(_[_0xca8b('0x3d')](_0x3215fb['device'],_0xca8b('0x3e'))){var _0x50c544=_0x3215fb[_0xca8b('0x33')];var _0x5bea18=_0x50c544[_0xca8b('0x3f')](_0x50c544[_0xca8b('0x40')]('/')+0x1,_0x50c544['indexOf']('@'));var _0x42f743=_[_0xca8b('0x27')](this['agents'],function(_0x283d9d){return _0x283d9d[_0xca8b('0x41')]==_0x5bea18||_0x283d9d[_0xca8b('0x42')]==_0x5bea18||_0x283d9d['accountcode']==_0x5bea18;});if(_0x42f743){if(_0x42f743['state']!==_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]()){_0x42f743[_0xca8b('0x37')]=_['toNumber'](moment()[_0xca8b('0x2e')]('x'));}_0x42f743[_0xca8b('0x24')]=_0x3215fb[_0xca8b('0x24')][_0xca8b('0x36')]();_0x42f743[_0xca8b('0x35')]=!![];_0x42f743[_0xca8b('0x39')](_0x3215fb);}}}}catch(_0x124e11){logger[_0xca8b('0x17')](_0xca8b('0x34'),util[_0xca8b('0x19')](_0x124e11,{'showHidden':![],'depth':null}));}};UserReport[_0xca8b('0x1d')][_0xca8b('0x12')]=function(_0x123e4d){try{if(this[_0xca8b('0x1e')](_0x123e4d)&&this[_0xca8b('0x1e')](_0x123e4d[_0xca8b('0x11')])){logger[_0xca8b('0x21')](_0xca8b('0x43'),_0x123e4d['peer'],_0x123e4d[_0xca8b('0x44')],_0x123e4d[_0xca8b('0x11')]);logger[_0xca8b('0x25')](_0xca8b('0x45'),util['inspect'](_0x123e4d,{'showHidden':![],'depth':null}));if(this['agents'][_0x123e4d['peer']]){if(!this['agents'][_0x123e4d[_0xca8b('0x46')]]['local']||_0x123e4d['peerstatus'][_0xca8b('0x36')]()=='registered'){this[_0xca8b('0xb')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x35')]=![];this[_0xca8b('0xb')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x47')]=_0x123e4d['peerstatus'][_0xca8b('0x36')]();this[_0xca8b('0xb')][_0x123e4d[_0xca8b('0x46')]]['address']=_0x123e4d[_0xca8b('0x44')];this[_0xca8b('0xb')][_0x123e4d['peer']][_0xca8b('0x39')](_0x123e4d);}}else if(this[_0xca8b('0xc')][_0x123e4d[_0xca8b('0x46')]]){this[_0xca8b('0xc')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x47')]=_0x123e4d[_0xca8b('0x11')][_0xca8b('0x36')]();this[_0xca8b('0xc')][_0x123e4d['peer']][_0xca8b('0x44')]=_0x123e4d[_0xca8b('0x44')];logger['debug'](_0xca8b('0x48'),util['inspect'](this[_0xca8b('0xc')][_0x123e4d[_0xca8b('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xca8b('0x2e')](_0xca8b('0x49'),this[_0xca8b('0xc')][_0x123e4d['peer']]['name']),_0xca8b('0x3b'),this[_0xca8b('0xc')][_0x123e4d[_0xca8b('0x46')]]);}else if(this[_0xca8b('0xa')][_0x123e4d['peer']]){this[_0xca8b('0xa')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x47')]=_0x123e4d[_0xca8b('0x11')][_0xca8b('0x36')]();this[_0xca8b('0xa')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x44')]=_0x123e4d[_0xca8b('0x44')];logger[_0xca8b('0x25')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0xca8b('0xa')][_0x123e4d[_0xca8b('0x46')]],{'showHidden':![],'depth':null}));this[_0xca8b('0x20')](util[_0xca8b('0x2e')](_0xca8b('0x2f'),this[_0xca8b('0xa')][_0x123e4d[_0xca8b('0x46')]][_0xca8b('0x30')]),'trunk:save',this['trunks'][_0x123e4d[_0xca8b('0x46')]]);}}}catch(_0x35e89c){logger[_0xca8b('0x17')](_0xca8b('0x45'),util['inspect'](_0x35e89c,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x71e8=['device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','[userReport][registry]\x20registry:%s\x20state:%s','username','state','stateRegistry','merge','omit','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','info','[userReport][devicestatechange]\x20device:%s\x20state:%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x71e8,0x1f0));var _0x871e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x71e8[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x871e('0x0'));var moment=require('moment');var util=require(_0x871e('0x1'));var Redis=require(_0x871e('0x2'));var BPromise=require(_0x871e('0x3'));var config=require('../../../config/environment');var logger=require(_0x871e('0x4'))(_0x871e('0x5'));var ami=require(_0x871e('0x6'));config[_0x871e('0x7')]=_[_0x871e('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x871e('0x9'))(new Redis(config[_0x871e('0x7')]));function UserReport(_0x5e36a7){this[_0x871e('0xa')]=_0x5e36a7['trunks'];this[_0x871e('0xb')]=_0x5e36a7[_0x871e('0xb')];this[_0x871e('0xc')]=_0x5e36a7['telephones'];ami['on'](_0x871e('0xd'),this[_0x871e('0xe')][_0x871e('0xf')](this));ami['on'](_0x871e('0x10'),this[_0x871e('0xe')]['bind'](this));ami['on']('devicestatechange',this[_0x871e('0x11')]['bind'](this));ami['on'](_0x871e('0x12'),this[_0x871e('0x13')][_0x871e('0xf')](this));return this[_0x871e('0x14')]();}function showSipRegistrations(){Promise[_0x871e('0x15')]()[_0x871e('0x16')](ami[_0x871e('0x17')]())[_0x871e('0x18')](function(_0x3fe6ef){logger[_0x871e('0x19')](_0x871e('0x1a'),util[_0x871e('0x1b')](_0x3fe6ef,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x871e('0x16')](ami['actionDeviceStateList']())[_0x871e('0x18')](function(_0x5e7b15){logger[_0x871e('0x19')]('[userReport][devicestatelist]',util['inspect'](_0x5e7b15,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x871e('0x15')]()[_0x871e('0x16')](ami[_0x871e('0x1c')]())['catch'](function(_0x413d53){logger[_0x871e('0x19')](_0x871e('0x1d'),util['inspect'](_0x413d53,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x871e('0x14')]=function(){setInterval(function(){BPromise[_0x871e('0x15')]()[_0x871e('0x16')](showSipRegistrations())[_0x871e('0x16')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x871e('0x1e')][_0x871e('0x1f')]=function(_0x2ac0ab){return _0x2ac0ab!==null&&!_[_0x871e('0x20')](_0x2ac0ab);};UserReport['prototype'][_0x871e('0x21')]=function(_0x84bb8,_0x1885ce,_0x2e7df0){io['to'](_0x84bb8)[_0x871e('0x21')](_0x1885ce,_0x2e7df0);};UserReport[_0x871e('0x1e')]['syncRegistry']=function(_0x3bfe34){try{if(this[_0x871e('0x1f')](_0x3bfe34)){logger['info'](_0x871e('0x22'),_0x3bfe34[_0x871e('0x23')],_0x3bfe34[_0x871e('0x24')]);logger['debug']('[userReport][registry]',util[_0x871e('0x1b')](_0x3bfe34,{'showHidden':![],'depth':null}));var _0x273ef9=_['find'](this[_0x871e('0xa')],{'defaultuser':_0x3bfe34['username']});if(_0x273ef9){_0x3bfe34[_0x871e('0x25')]=_0x3bfe34[_0x871e('0x24')];_[_0x871e('0x26')](_0x273ef9,_[_0x871e('0x27')](_0x3bfe34,['event',_0x871e('0x28'),_0x871e('0x23'),_0x871e('0x24')]));logger[_0x871e('0x29')](_0x871e('0x2a'),util[_0x871e('0x1b')](_0x273ef9,{'showHidden':![],'depth':null}));this[_0x871e('0x21')](util[_0x871e('0x2b')](_0x871e('0x2c'),_0x273ef9[_0x871e('0x2d')]),_0x871e('0x2e'),_0x273ef9);}}}catch(_0x18b4a1){logger[_0x871e('0x19')](_0x871e('0x2f'),util['inspect'](_0x18b4a1,{'showHidden':![],'depth':null}));}};UserReport[_0x871e('0x1e')][_0x871e('0x11')]=function(_0x596a30){try{if(this[_0x871e('0x1f')](_0x596a30)){logger[_0x871e('0x30')](_0x871e('0x31'),_0x596a30['device'],_0x596a30[_0x871e('0x24')]);logger[_0x871e('0x29')]('[userReport][devicestatechange]',util[_0x871e('0x1b')](_0x596a30,{'showHidden':![],'depth':null}));if(this['agents'][_0x596a30[_0x871e('0x32')]]){if(!this['agents'][_0x596a30[_0x871e('0x32')]][_0x871e('0x33')]||_0x596a30[_0x871e('0x24')][_0x871e('0x34')]()==_0x871e('0x35')){this[_0x871e('0xb')][_0x596a30[_0x871e('0x32')]][_0x871e('0x33')]=![];if(this[_0x871e('0xb')][_0x596a30[_0x871e('0x32')]][_0x871e('0x24')]!==_0x596a30[_0x871e('0x24')]['toLowerCase']()){this['agents'][_0x596a30['device']][_0x871e('0x36')]=_[_0x871e('0x37')](moment()[_0x871e('0x2b')]('x'));}this[_0x871e('0xb')][_0x596a30[_0x871e('0x32')]]['state']=_0x596a30[_0x871e('0x24')]['toLowerCase']();this['agents'][_0x596a30[_0x871e('0x32')]][_0x871e('0x38')](_0x596a30);}}else if(this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]]){if(this[_0x871e('0xc')][_0x596a30['device']][_0x871e('0x24')]!==_0x596a30[_0x871e('0x24')][_0x871e('0x34')]()){this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]][_0x871e('0x36')]=_[_0x871e('0x37')](moment()['format']('x'));}this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]][_0x871e('0x24')]=_0x596a30[_0x871e('0x24')][_0x871e('0x34')]();logger[_0x871e('0x29')](_0x871e('0x39'),util[_0x871e('0x1b')](this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]],{'showHidden':![],'depth':null}));this[_0x871e('0x21')](util[_0x871e('0x2b')](_0x871e('0x3a'),this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]][_0x871e('0x2d')]),_0x871e('0x3b'),this[_0x871e('0xc')][_0x596a30[_0x871e('0x32')]]);}else if(this['trunks'][_0x596a30['device']]){if(this[_0x871e('0xa')][_0x596a30[_0x871e('0x32')]][_0x871e('0x24')]!==_0x596a30['state'][_0x871e('0x34')]()){this[_0x871e('0xa')][_0x596a30[_0x871e('0x32')]]['stateTime']=_[_0x871e('0x37')](moment()[_0x871e('0x2b')]('x'));}this[_0x871e('0xa')][_0x596a30[_0x871e('0x32')]][_0x871e('0x24')]=_0x596a30['state'][_0x871e('0x34')]();logger[_0x871e('0x29')](_0x871e('0x3c'),util[_0x871e('0x1b')](this[_0x871e('0xa')][_0x596a30['device']],{'showHidden':![],'depth':null}));this[_0x871e('0x21')](util['format'](_0x871e('0x2c'),this[_0x871e('0xa')][_0x596a30['device']][_0x871e('0x2d')]),'trunk:save',this[_0x871e('0xa')][_0x596a30[_0x871e('0x32')]]);}else if(_[_0x871e('0x3d')](_0x596a30[_0x871e('0x32')],_0x871e('0x3e'))){var _0x443075=_0x596a30[_0x871e('0x32')];var _0x2cce1d=_0x443075[_0x871e('0x3f')](_0x443075[_0x871e('0x40')]('/')+0x1,_0x443075[_0x871e('0x40')]('@'));var _0x4e62d6=_[_0x871e('0x41')](this[_0x871e('0xb')],function(_0x463e55){return _0x463e55[_0x871e('0x42')]==_0x2cce1d||_0x463e55[_0x871e('0x43')]==_0x2cce1d||_0x463e55[_0x871e('0x44')]==_0x2cce1d;});if(_0x4e62d6){if(_0x4e62d6[_0x871e('0x24')]!==_0x596a30[_0x871e('0x24')][_0x871e('0x34')]()){_0x4e62d6[_0x871e('0x36')]=_['toNumber'](moment()[_0x871e('0x2b')]('x'));}_0x4e62d6['state']=_0x596a30[_0x871e('0x24')][_0x871e('0x34')]();_0x4e62d6[_0x871e('0x33')]=!![];_0x4e62d6['updateStatusRealtime'](_0x596a30);}}}}catch(_0x3fd55d){logger['error']('[userReport][devicestatechange]',util[_0x871e('0x1b')](_0x3fd55d,{'showHidden':![],'depth':null}));}};UserReport[_0x871e('0x1e')]['syncPeerStatus']=function(_0x43561d){try{if(this[_0x871e('0x1f')](_0x43561d)&&this['isNotNull'](_0x43561d['peerstatus'])){logger[_0x871e('0x30')](_0x871e('0x45'),_0x43561d[_0x871e('0x46')],_0x43561d['address'],_0x43561d[_0x871e('0x12')]);logger[_0x871e('0x29')](_0x871e('0x47'),util[_0x871e('0x1b')](_0x43561d,{'showHidden':![],'depth':null}));if(this[_0x871e('0xb')][_0x43561d['peer']]){if(!this[_0x871e('0xb')][_0x43561d['peer']]['local']||_0x43561d['peerstatus'][_0x871e('0x34')]()==_0x871e('0x48')){this[_0x871e('0xb')][_0x43561d[_0x871e('0x46')]][_0x871e('0x33')]=![];this[_0x871e('0xb')][_0x43561d[_0x871e('0x46')]][_0x871e('0x49')]=_0x43561d[_0x871e('0x12')][_0x871e('0x34')]();this['agents'][_0x43561d[_0x871e('0x46')]][_0x871e('0x4a')]=_0x43561d[_0x871e('0x4a')];this[_0x871e('0xb')][_0x43561d[_0x871e('0x46')]][_0x871e('0x38')](_0x43561d);}}else if(this['telephones'][_0x43561d[_0x871e('0x46')]]){this['telephones'][_0x43561d[_0x871e('0x46')]][_0x871e('0x49')]=_0x43561d[_0x871e('0x12')][_0x871e('0x34')]();this[_0x871e('0xc')][_0x43561d[_0x871e('0x46')]][_0x871e('0x4a')]=_0x43561d[_0x871e('0x4a')];logger['debug'](_0x871e('0x4b'),util[_0x871e('0x1b')](this['telephones'][_0x43561d[_0x871e('0x46')]],{'showHidden':![],'depth':null}));this[_0x871e('0x21')](util[_0x871e('0x2b')](_0x871e('0x3a'),this[_0x871e('0xc')][_0x43561d[_0x871e('0x46')]][_0x871e('0x2d')]),_0x871e('0x3b'),this[_0x871e('0xc')][_0x43561d['peer']]);}else if(this['trunks'][_0x43561d[_0x871e('0x46')]]){this[_0x871e('0xa')][_0x43561d[_0x871e('0x46')]][_0x871e('0x49')]=_0x43561d['peerstatus'][_0x871e('0x34')]();this[_0x871e('0xa')][_0x43561d['peer']][_0x871e('0x4a')]=_0x43561d[_0x871e('0x4a')];logger[_0x871e('0x29')](_0x871e('0x4c'),util['inspect'](this['trunks'][_0x43561d['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x871e('0x2b')](_0x871e('0x2c'),this[_0x871e('0xa')][_0x43561d[_0x871e('0x46')]]['name']),_0x871e('0x2e'),this[_0x871e('0xa')][_0x43561d['peer']]);}}}catch(_0x6f2910){logger[_0x871e('0x19')](_0x871e('0x47'),util[_0x871e('0x1b')](_0x6f2910,{'showHidden':![],'depth':null}));}};module[_0x871e('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 78b7a08..dac333e 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 _0x2d74=['musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','info','uniqueid','membername','destuniqueid','debug','inspect','format','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','answeredelsewheredestinationuniqueid','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','agentringnoanswerAt','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','isNotNull','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','interface','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:%s','user:agentcomplete','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x2d74,0x116));var _0x42d7=function(_0x1f8e57,_0x1d790e){_0x1f8e57=_0x1f8e57-0x0;var _0x2ea86e=_0x2d74[_0x1f8e57];return _0x2ea86e;};'use strict';var _=require(_0x42d7('0x0'));var moment=require(_0x42d7('0x1'));var util=require(_0x42d7('0x2'));var Redis=require(_0x42d7('0x3'));var config=require(_0x42d7('0x4'));var logger=require(_0x42d7('0x5'))(_0x42d7('0x6'));var ami=require(_0x42d7('0x7'));config[_0x42d7('0x8')]=_[_0x42d7('0x9')](config[_0x42d7('0x8')],{'host':_0x42d7('0xa'),'port':0x18eb});var io=require(_0x42d7('0xb'))(new Redis(config[_0x42d7('0x8')]));function VoiceAgentReport(_0x14d285){this[_0x42d7('0xc')]={};this[_0x42d7('0xd')]=_0x14d285[_0x42d7('0xd')];this['agents']=_0x14d285[_0x42d7('0xe')];this[_0x42d7('0xf')]={};ami['on'](_0x42d7('0x10'),this[_0x42d7('0x11')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x13'),this[_0x42d7('0x14')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x15'),this[_0x42d7('0x16')]['bind'](this));ami['on'](_0x42d7('0x17'),this[_0x42d7('0x18')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x19'),this[_0x42d7('0x1a')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x1b'),this[_0x42d7('0x1c')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x1d'),this[_0x42d7('0x1e')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x1f'),this['syncMusicOnHoldStart'][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x20'),this[_0x42d7('0x21')][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x22'),this['syncAttendedTransfer'][_0x42d7('0x12')](this));ami['on'](_0x42d7('0x23'),this[_0x42d7('0x24')][_0x42d7('0x12')](this));}VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x26')]=function(_0x4639dc,_0x5bcd82,_0x42850e){io['to'](_0x4639dc)[_0x42d7('0x26')](_0x5bcd82,_0x42850e);};VoiceAgentReport['prototype']['isNotNull']=function(_0x2c6110){return _0x2c6110!==null&&!_[_0x42d7('0x27')](_0x2c6110);};VoiceAgentReport[_0x42d7('0x25')]['syncAgentCalled']=function(_0x140fe7){try{if(this['isNotNull'](_0x140fe7)){logger[_0x42d7('0x28')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x140fe7[_0x42d7('0x29')],_0x140fe7[_0x42d7('0x2a')],_0x140fe7[_0x42d7('0x2b')]);logger[_0x42d7('0x2c')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x140fe7[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x140fe7,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x42d7('0xc')][_0x140fe7[_0x42d7('0x29')]])){this[_0x42d7('0xc')][_0x140fe7[_0x42d7('0x29')]]={};}if(_[_0x42d7('0x27')](this[_0x42d7('0xc')][_0x140fe7[_0x42d7('0x29')]][_0x140fe7[_0x42d7('0x2b')]])){this['channels'][_0x140fe7[_0x42d7('0x29')]][_0x140fe7[_0x42d7('0x2b')]]={'agentcalledAt':moment()[_0x42d7('0x2e')](_0x42d7('0x2f')),'lastevent':'called','mandatoryDisposition':this[_0x42d7('0xd')][_0x140fe7['queue']]?this[_0x42d7('0xd')][_0x140fe7[_0x42d7('0x30')]][_0x42d7('0x31')]||![]:![],'type':this[_0x42d7('0xd')][_0x140fe7[_0x42d7('0x30')]]?this[_0x42d7('0xd')][_0x140fe7['queue']][_0x42d7('0x32')]||_0x42d7('0x33'):_0x42d7('0x33'),'variables':this[_0x42d7('0xf')][_0x140fe7[_0x42d7('0x29')]]};}_['merge'](this['channels'][_0x140fe7[_0x42d7('0x29')]][_0x140fe7[_0x42d7('0x2b')]],_['omit'](_0x140fe7,[_0x42d7('0x34'),_0x42d7('0x35')]));logger[_0x42d7('0x2c')](_0x42d7('0x36'),_0x140fe7[_0x42d7('0x29')],util[_0x42d7('0x2d')](this['channels'][_0x140fe7[_0x42d7('0x29')]][_0x140fe7[_0x42d7('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x37'),this['channels'][_0x140fe7['uniqueid']][_0x140fe7[_0x42d7('0x2b')]]);logger[_0x42d7('0x2c')](_0x42d7('0x38'),_0x140fe7['uniqueid'],util[_0x42d7('0x2d')](this['channels'][_0x140fe7[_0x42d7('0x29')]][_0x140fe7[_0x42d7('0x2b')]],{'showHidden':![],'depth':null}));this[_0x42d7('0x26')](util['format']('user:%s',_0x140fe7[_0x42d7('0x2a')]),_0x42d7('0x39'),this[_0x42d7('0xc')][_0x140fe7[_0x42d7('0x29')]][_0x140fe7['destuniqueid']]);}}catch(_0x37012a){logger[_0x42d7('0x3a')](_0x42d7('0x3b'),_0x140fe7['uniqueid'],util[_0x42d7('0x2d')](_0x37012a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x42d7('0x14')]=function(_0xeae6cb){try{if(this['isNotNull'](_0xeae6cb)){if(this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]]){logger[_0x42d7('0x2c')](_0x42d7('0x3c'),_0xeae6cb[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0xeae6cb,{'showHidden':![],'depth':null}));for(var _0x5d67f3 in this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]]){if(this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x42d7('0x3d')](_0x5d67f3)){if(_0xeae6cb[_0x42d7('0x2b')]===_0x5d67f3){logger[_0x42d7('0x28')](_0x42d7('0x3e'),_0xeae6cb[_0x42d7('0x29')],_0xeae6cb[_0x42d7('0x2a')],_0xeae6cb['destuniqueid']);this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x3f')]=moment()['format'](_0x42d7('0x2f'));this['channels'][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]['connectedlinename']=_0xeae6cb['connectedlinename'];this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x40')]=_0xeae6cb['connectedlinenum'];this[_0x42d7('0xc')][_0xeae6cb['uniqueid']][_0x5d67f3]['destchannelstate']=_0xeae6cb[_0x42d7('0x41')];this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x42')]=_0xeae6cb[_0x42d7('0x42')];this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x43')]=_0xeae6cb['holdtime'];this['channels'][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x44')]=_0x42d7('0x45');_[_0x42d7('0x46')](this[_0x42d7('0xe')][_0xeae6cb['interface']],_[_0x42d7('0x47')](_0xeae6cb,[_0x42d7('0x30'),_0x42d7('0x48')]));logger['debug'](_0x42d7('0x49'),_0xeae6cb[_0x42d7('0x29')],util[_0x42d7('0x2d')](this[_0x42d7('0xc')][_0xeae6cb['uniqueid']][_0xeae6cb[_0x42d7('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x4a'),this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0xeae6cb[_0x42d7('0x2b')]]);logger[_0x42d7('0x2c')](_0x42d7('0x4b'),_0xeae6cb['uniqueid'],util[_0x42d7('0x2d')](this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0xeae6cb[_0x42d7('0x2b')]],{'showHidden':![],'depth':null}));this[_0x42d7('0x26')](util[_0x42d7('0x2e')]('user:%s',_0xeae6cb[_0x42d7('0x2a')]),_0x42d7('0x4c'),this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0xeae6cb[_0x42d7('0x2b')]]);}else if(!this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x15')]&&!this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x19')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0xeae6cb[_0x42d7('0x29')],this['channels'][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]['membername'],_0x5d67f3);this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]['agentringnoanswer']=!![];this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]['agentringnoanswerAt']=moment()[_0x42d7('0x2e')](_0x42d7('0x2f'));this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x4d')]=_0xeae6cb[_0x42d7('0x2b')];this[_0x42d7('0xc')][_0xeae6cb['uniqueid']][_0x5d67f3]['answeredelsewheremembername']=_0xeae6cb[_0x42d7('0x2a')];this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]['lastevent']='answered_elsewhere';this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3][_0x42d7('0x4e')]=_0x42d7('0x4f');logger['debug'](_0x42d7('0x50'),_0xeae6cb['uniqueid'],util['inspect'](this[_0x42d7('0xc')][_0xeae6cb['uniqueid']][_0x5d67f3],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x51'),this[_0x42d7('0xc')][_0xeae6cb[_0x42d7('0x29')]][_0x5d67f3]);}}}}}}catch(_0x421da4){logger[_0x42d7('0x3a')]('[%s][voiceAgentReport][agentconnect]',_0xeae6cb[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x421da4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x16')]=function(_0x42efbd){try{if(this['isNotNull'](_0x42efbd)){logger['debug'](_0x42d7('0x52'),_0x42efbd['uniqueid'],util[_0x42d7('0x2d')](_0x42efbd,{'showHidden':![],'depth':null}));if(this[_0x42d7('0xc')][_0x42efbd[_0x42d7('0x29')]]&&this[_0x42d7('0xc')][_0x42efbd[_0x42d7('0x29')]][_0x42efbd[_0x42d7('0x2b')]]){logger[_0x42d7('0x28')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x42efbd['uniqueid'],_0x42efbd['membername'],_0x42efbd[_0x42d7('0x2b')]);this['channels'][_0x42efbd['uniqueid']][_0x42efbd['destuniqueid']][_0x42d7('0x15')]=!![];this[_0x42d7('0xc')][_0x42efbd[_0x42d7('0x29')]][_0x42efbd['destuniqueid']][_0x42d7('0x53')]=moment()[_0x42d7('0x2e')](_0x42d7('0x2f'));this[_0x42d7('0xc')][_0x42efbd['uniqueid']][_0x42efbd['destuniqueid']][_0x42d7('0x44')]=_0x42d7('0x54');this[_0x42d7('0xc')][_0x42efbd[_0x42d7('0x29')]][_0x42efbd[_0x42d7('0x2b')]]['reason']=_0x42d7('0x54');logger[_0x42d7('0x2c')](_0x42d7('0x55'),_0x42efbd[_0x42d7('0x29')],util[_0x42d7('0x2d')](this[_0x42d7('0xc')][_0x42efbd[_0x42d7('0x29')]][_0x42efbd[_0x42d7('0x2b')]],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x56'),this['channels'][_0x42efbd['uniqueid']][_0x42efbd[_0x42d7('0x2b')]]);}}}catch(_0x40d09d){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0x42efbd[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x40d09d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x18')]=function(_0x265a9d){try{if(this['isNotNull'](_0x265a9d)){logger['debug'](_0x42d7('0x57'),_0x265a9d[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x265a9d,{'showHidden':![],'depth':null}));if(this[_0x42d7('0xc')][_0x265a9d['uniqueid']]){for(var _0x335fc9 in this['channels'][_0x265a9d[_0x42d7('0x29')]]){if(this['channels'][_0x265a9d[_0x42d7('0x29')]][_0x42d7('0x3d')](_0x335fc9)&&!this[_0x42d7('0xc')][_0x265a9d['uniqueid']][_0x335fc9]['agentringnoanswer']&&!this[_0x42d7('0xc')][_0x265a9d[_0x42d7('0x29')]][_0x335fc9][_0x42d7('0x19')]){logger[_0x42d7('0x28')](_0x42d7('0x58'),_0x265a9d[_0x42d7('0x29')],this[_0x42d7('0xc')][_0x265a9d[_0x42d7('0x29')]][_0x335fc9]['membername'],_0x335fc9);this['channels'][_0x265a9d['uniqueid']][_0x335fc9][_0x42d7('0x15')]=!![];this[_0x42d7('0xc')][_0x265a9d['uniqueid']][_0x335fc9]['agentringnoanswerAt']=moment()[_0x42d7('0x2e')](_0x42d7('0x2f'));this[_0x42d7('0xc')][_0x265a9d[_0x42d7('0x29')]][_0x335fc9][_0x42d7('0x44')]=_0x42d7('0x59');this[_0x42d7('0xc')][_0x265a9d[_0x42d7('0x29')]][_0x335fc9][_0x42d7('0x4e')]=_0x42d7('0x59');logger[_0x42d7('0x2c')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x265a9d[_0x42d7('0x29')],util[_0x42d7('0x2d')](this['channels'][_0x265a9d[_0x42d7('0x29')]][_0x335fc9],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x5a'),this[_0x42d7('0xc')][_0x265a9d[_0x42d7('0x29')]][_0x335fc9]);}}}}}catch(_0xd8f1d3){logger[_0x42d7('0x3a')](_0x42d7('0x5b'),_0x265a9d[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0xd8f1d3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')]['syncAgentComplete']=function(_0x558a9c){try{if(this[_0x42d7('0x5c')](_0x558a9c)){logger[_0x42d7('0x2c')](_0x42d7('0x5d'),_0x558a9c[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x558a9c,{'showHidden':![],'depth':null}));if(this['channels'][_0x558a9c[_0x42d7('0x29')]]){for(var _0x5bbe82 in this[_0x42d7('0xc')][_0x558a9c[_0x42d7('0x29')]]){if(this[_0x42d7('0xc')][_0x558a9c[_0x42d7('0x29')]][_0x42d7('0x3d')](_0x5bbe82)){if(this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x3f')]&&!this[_0x42d7('0xc')][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82][_0x42d7('0x19')]){logger[_0x42d7('0x28')](_0x42d7('0x5e'),_0x558a9c[_0x42d7('0x29')],this['channels'][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x2a')],_0x5bbe82);this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x19')]=!![];this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82]['agentcompleteAt']=moment()[_0x42d7('0x2e')](_0x42d7('0x2f'));this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x44')]=_0x42d7('0x5f');this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x4e')]=_0x558a9c[_0x42d7('0x4e')]==_0x42d7('0x60')?_0x42d7('0x61'):_0x558a9c['reason'];this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82][_0x42d7('0x62')]=_0x558a9c[_0x42d7('0x62')];if(this[_0x42d7('0xd')][_0x558a9c[_0x42d7('0x30')]]&&this[_0x42d7('0xd')][_0x558a9c[_0x42d7('0x30')]][_0x42d7('0x63')]){this['channels'][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82][_0x42d7('0x64')]=this[_0x42d7('0xd')][_0x558a9c[_0x42d7('0x30')]][_0x42d7('0x65')];this['channels'][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82][_0x42d7('0x66')]=!![];}this[_0x42d7('0xe')][_0x558a9c[_0x42d7('0x67')]]=_[_0x42d7('0x68')](this[_0x42d7('0xe')][_0x558a9c[_0x42d7('0x67')]],[_0x42d7('0x30'),_0x42d7('0x48')]);logger[_0x42d7('0x2c')](_0x42d7('0x69'),_0x558a9c[_0x42d7('0x29')],util['inspect'](this['channels'][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82],{'showHidden':![],'depth':null}));ami[_0x42d7('0x26')](_0x42d7('0x6a'),this[_0x42d7('0xc')][_0x558a9c['uniqueid']][_0x5bbe82]);logger[_0x42d7('0x2c')](_0x42d7('0x6b'),_0x558a9c[_0x42d7('0x29')],util[_0x42d7('0x2d')](this[_0x42d7('0xc')][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82],{'showHidden':![],'depth':null}));this[_0x42d7('0x26')](util[_0x42d7('0x2e')](_0x42d7('0x6c'),_0x558a9c[_0x42d7('0x2a')]),_0x42d7('0x6d'),this['channels'][_0x558a9c[_0x42d7('0x29')]][_0x5bbe82]);}}}}}}catch(_0x194f2e){logger[_0x42d7('0x3a')]('[%s][voiceAgentReport][agentcomplete]',_0x558a9c[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x194f2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x1c')]=function(_0xc47f16){try{if(this[_0x42d7('0x5c')](_0xc47f16)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0xc47f16['uniqueid'],util[_0x42d7('0x2d')](_0xc47f16,{'showHidden':![],'depth':null}));this[_0x42d7('0x6e')](_0xc47f16[_0x42d7('0x29')],_[_0x42d7('0x6f')](_0xc47f16[_0x42d7('0x70')])[0x0],_0xc47f16[_0x42d7('0x71')]);if(this[_0x42d7('0xc')][_0xc47f16['uniqueid']]){for(var _0x152a51 in this[_0x42d7('0xc')][_0xc47f16[_0x42d7('0x29')]]){if(this[_0x42d7('0xc')][_0xc47f16['uniqueid']][_0x42d7('0x3d')](_0x152a51)){logger['info'](_0x42d7('0x72'),_0xc47f16[_0x42d7('0x29')],_0x152a51,_[_0x42d7('0x6f')](_0xc47f16[_0x42d7('0x70')])[0x0],_0xc47f16[_0x42d7('0x71')]);if(_[_0x42d7('0x27')](this[_0x42d7('0xc')][_0xc47f16[_0x42d7('0x29')]][_0x152a51][_0x42d7('0xf')])){this[_0x42d7('0xc')][_0xc47f16[_0x42d7('0x29')]][_0x152a51][_0x42d7('0xf')]={};}this[_0x42d7('0xc')][_0xc47f16[_0x42d7('0x29')]][_0x152a51][_0x42d7('0xf')]=this[_0x42d7('0xf')][_0xc47f16[_0x42d7('0x29')]];}}}}}catch(_0x24f9cb){logger[_0x42d7('0x3a')](_0x42d7('0x73'),_0xc47f16['uniqueid'],util[_0x42d7('0x2d')](_0x24f9cb,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x562b31,_0x5ccbaf,_0x472f36){var _0x5d84b0=[_0x42d7('0x74'),'rtpaudioqosbridged',_0x42d7('0x75'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x42d7('0x76'),'rtpaudioqosrtt',_0x42d7('0x77'),'sipcallid',_0x42d7('0x78'),_0x42d7('0x79'),_0x42d7('0x7a'),_0x42d7('0x7b'),_0x42d7('0x7c'),_0x42d7('0x7d'),'memberlastcall','membername',_0x42d7('0x7e'),_0x42d7('0x7f')];if(!_[_0x42d7('0x80')](_0x5ccbaf)&&!_[_0x42d7('0x81')](_0x5d84b0,_0x5ccbaf)){if(_[_0x42d7('0x27')](this['variables'][_0x562b31])){this[_0x42d7('0xf')][_0x562b31]={};}this[_0x42d7('0xf')][_0x562b31][_0x5ccbaf]=_0x472f36;}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x1e')]=function(_0x2cfd96){try{if(this[_0x42d7('0x5c')](_0x2cfd96)){logger[_0x42d7('0x2c')](_0x42d7('0x82'),_0x2cfd96[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x2cfd96,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cfd96[_0x42d7('0x29')]]){for(var _0x32cba5 in this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]]){if(this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]][_0x42d7('0x3d')](_0x32cba5)){if(this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]][_0x32cba5][_0x42d7('0x4e')]==_0x42d7('0x60')&&this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]][_0x32cba5][_0x42d7('0x19')]){logger[_0x42d7('0x28')](_0x42d7('0x83'),_0x2cfd96[_0x42d7('0x29')],_0x32cba5);this[_0x42d7('0xc')][_0x2cfd96['uniqueid']][_0x32cba5][_0x42d7('0x84')]=moment()[_0x42d7('0x2e')](_0x42d7('0x2f'));}}}logger[_0x42d7('0x2c')](_0x42d7('0x85'),_0x2cfd96['uniqueid'],util[_0x42d7('0x2d')](_[_0x42d7('0x86')](this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x42d7('0x86')](this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]]));delete this[_0x42d7('0xc')][_0x2cfd96[_0x42d7('0x29')]];}if(this[_0x42d7('0xf')][_0x2cfd96[_0x42d7('0x29')]]){delete this[_0x42d7('0xf')][_0x2cfd96[_0x42d7('0x29')]];}}}catch(_0x94277a){logger[_0x42d7('0x3a')]('[%s][voiceAgentReport][hangup]',_0x2cfd96[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x94277a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x87')]=function(_0x11ec4d){try{if(this['isNotNull'](_0x11ec4d)){logger[_0x42d7('0x2c')](_0x42d7('0x88'),_0x11ec4d['uniqueid'],util['inspect'](_0x11ec4d,{'showHidden':![],'depth':null}));if(this['channels'][_0x11ec4d[_0x42d7('0x89')]]){for(var _0x1bd540 in this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]]){if(this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]][_0x42d7('0x3d')](_0x1bd540)){if(_0x11ec4d['origtransfereruniqueid']===_0x1bd540){logger['info'](_0x42d7('0x8a'),_0x11ec4d[_0x42d7('0x29')],this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]][_0x1bd540][_0x42d7('0x2a')],_0x1bd540);var _0x294c03=moment();this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]][_0x1bd540]['agentcomplete']=!![];this[_0x42d7('0xc')][_0x11ec4d['transfereeuniqueid']][_0x1bd540][_0x42d7('0x84')]=moment()['format'](_0x42d7('0x2f'));this['channels'][_0x11ec4d[_0x42d7('0x89')]][_0x1bd540]['lastevent']=_0x42d7('0x5f');this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]][_0x1bd540][_0x42d7('0x4e')]=_0x42d7('0x60');this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]][_0x1bd540][_0x42d7('0x62')]=_0x294c03['diff'](this[_0x42d7('0xc')][_0x11ec4d['transfereeuniqueid']][_0x1bd540]['agentconnectAt'],_0x42d7('0x8b'));}}}}if(this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x8c')]]){var _0x50e4e1=this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x8c')]];this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x8c')]]=this['channels'][_0x11ec4d[_0x42d7('0x89')]];this[_0x42d7('0xc')][_0x11ec4d[_0x42d7('0x89')]]=_0x50e4e1;}}}catch(_0xac16e4){logger[_0x42d7('0x3a')](_0x42d7('0x8d'),_0x11ec4d[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0xac16e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x24')]=function(_0x1f991d){try{if(this['isNotNull'](_0x1f991d)){logger['debug'](_0x42d7('0x8e'),_0x1f991d['uniqueid'],util[_0x42d7('0x2d')](_0x1f991d,{'showHidden':![],'depth':null}));if(this[_0x42d7('0xc')][_0x1f991d['transfereeuniqueid']]){for(var _0x36edc6 in this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]]){if(this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]]['hasOwnProperty'](_0x36edc6)){if(_0x1f991d['transfereruniqueid']===_0x36edc6){logger[_0x42d7('0x28')](_0x42d7('0x8f'),_0x1f991d[_0x42d7('0x29')],this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]][_0x36edc6][_0x42d7('0x2a')],_0x36edc6);var _0x4f898a=moment();this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]][_0x36edc6][_0x42d7('0x19')]=!![];this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]][_0x36edc6][_0x42d7('0x84')]=_0x4f898a;this['channels'][_0x1f991d[_0x42d7('0x89')]][_0x36edc6][_0x42d7('0x44')]=_0x42d7('0x5f');this['channels'][_0x1f991d['transfereeuniqueid']][_0x36edc6][_0x42d7('0x4e')]=_0x42d7('0x60');this[_0x42d7('0xc')][_0x1f991d[_0x42d7('0x89')]][_0x36edc6]['talktime']=_0x4f898a['diff'](this[_0x42d7('0xc')][_0x1f991d['transfereeuniqueid']][_0x36edc6][_0x42d7('0x3f')],_0x42d7('0x8b'));}}}}}}catch(_0x3a9511){logger[_0x42d7('0x3a')](_0x42d7('0x90'),_0x1f991d[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x3a9511,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x91')]=function(_0x56eb12){var _0x2dda02='';try{if(this[_0x42d7('0x5c')](_0x56eb12)){logger[_0x42d7('0x2c')](_0x42d7('0x92'),_0x56eb12[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x56eb12,{'showHidden':![],'depth':null}));if(_0x56eb12[_0x42d7('0x93')]){_0x2dda02=_0x56eb12[_0x42d7('0x93')][_0x42d7('0x94')](0x0,_0x56eb12[_0x42d7('0x93')][_0x42d7('0x95')]('-'));if(this[_0x42d7('0xe')][_0x2dda02]){logger[_0x42d7('0x28')](_0x42d7('0x96'),_0x56eb12[_0x42d7('0x29')],_0x2dda02);this[_0x42d7('0xe')][_0x2dda02][_0x42d7('0x97')]=!![];}}}}catch(_0x313a53){logger[_0x42d7('0x3a')](_0x42d7('0x98'),_0x56eb12[_0x42d7('0x29')],util['inspect'](_0x313a53,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x42d7('0x25')][_0x42d7('0x21')]=function(_0x2ed444){var _0x11670c='';try{if(this['isNotNull'](_0x2ed444)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x2ed444[_0x42d7('0x29')],util[_0x42d7('0x2d')](_0x2ed444,{'showHidden':![],'depth':null}));if(_0x2ed444[_0x42d7('0x93')]){_0x11670c=_0x2ed444['channel']['substring'](0x0,_0x2ed444[_0x42d7('0x93')][_0x42d7('0x95')]('-'));if(this['agents'][_0x11670c]){logger['info'](_0x42d7('0x99'),_0x2ed444['uniqueid'],_0x11670c);this[_0x42d7('0xe')][_0x11670c]['onhold']=![];}}}}catch(_0x566619){logger[_0x42d7('0x3a')](_0x42d7('0x9a'),_0x2ed444[_0x42d7('0x29')],util['inspect'](_0x566619,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x95b2=['[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','isNotNull','info','uniqueid','membername','destuniqueid','inspect','channels','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','inbound','omit','event','privilege','debug','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','format','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberrealtime','isNil','includes','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s'];(function(_0x157183,_0xcbf204){var _0x1ad730=function(_0x4b4b2f){while(--_0x4b4b2f){_0x157183['push'](_0x157183['shift']());}};_0x1ad730(++_0xcbf204);}(_0x95b2,0x144));var _0x295b=function(_0x1852b7,_0x15bd49){_0x1852b7=_0x1852b7-0x0;var _0x19dfd1=_0x95b2[_0x1852b7];return _0x19dfd1;};'use strict';var _=require(_0x295b('0x0'));var moment=require(_0x295b('0x1'));var util=require(_0x295b('0x2'));var Redis=require(_0x295b('0x3'));var config=require(_0x295b('0x4'));var logger=require(_0x295b('0x5'))(_0x295b('0x6'));var ami=require(_0x295b('0x7'));config[_0x295b('0x8')]=_['defaults'](config[_0x295b('0x8')],{'host':_0x295b('0x9'),'port':0x18eb});var io=require(_0x295b('0xa'))(new Redis(config[_0x295b('0x8')]));function VoiceAgentReport(_0xef543d){this['channels']={};this[_0x295b('0xb')]=_0xef543d[_0x295b('0xb')];this[_0x295b('0xc')]=_0xef543d[_0x295b('0xc')];this[_0x295b('0xd')]={};ami['on'](_0x295b('0xe'),this[_0x295b('0xf')][_0x295b('0x10')](this));ami['on'](_0x295b('0x11'),this['syncAgentConnect'][_0x295b('0x10')](this));ami['on'](_0x295b('0x12'),this[_0x295b('0x13')]['bind'](this));ami['on']('queuecallerabandon',this[_0x295b('0x14')][_0x295b('0x10')](this));ami['on'](_0x295b('0x15'),this[_0x295b('0x16')]['bind'](this));ami['on'](_0x295b('0x17'),this['syncVarSet'][_0x295b('0x10')](this));ami['on'](_0x295b('0x18'),this['syncHangup'][_0x295b('0x10')](this));ami['on'](_0x295b('0x19'),this[_0x295b('0x1a')][_0x295b('0x10')](this));ami['on'](_0x295b('0x1b'),this[_0x295b('0x1c')][_0x295b('0x10')](this));ami['on'](_0x295b('0x1d'),this['syncAttendedTransfer'][_0x295b('0x10')](this));ami['on'](_0x295b('0x1e'),this[_0x295b('0x1f')][_0x295b('0x10')](this));}VoiceAgentReport[_0x295b('0x20')][_0x295b('0x21')]=function(_0x5e4ed7,_0x1c303a,_0x16ff1c){io['to'](_0x5e4ed7)[_0x295b('0x21')](_0x1c303a,_0x16ff1c);};VoiceAgentReport[_0x295b('0x20')]['isNotNull']=function(_0xc82e83){return _0xc82e83!==null&&!_[_0x295b('0x22')](_0xc82e83);};VoiceAgentReport[_0x295b('0x20')][_0x295b('0xf')]=function(_0x411acd){try{if(this[_0x295b('0x23')](_0x411acd)){logger[_0x295b('0x24')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x411acd[_0x295b('0x25')],_0x411acd[_0x295b('0x26')],_0x411acd[_0x295b('0x27')]);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x411acd['uniqueid'],util[_0x295b('0x28')](_0x411acd,{'showHidden':![],'depth':null}));if(_[_0x295b('0x22')](this['channels'][_0x411acd[_0x295b('0x25')]])){this[_0x295b('0x29')][_0x411acd[_0x295b('0x25')]]={};}if(_['isUndefined'](this[_0x295b('0x29')][_0x411acd[_0x295b('0x25')]][_0x411acd[_0x295b('0x27')]])){this[_0x295b('0x29')][_0x411acd[_0x295b('0x25')]][_0x411acd[_0x295b('0x27')]]={'agentcalledAt':moment()['format'](_0x295b('0x2a')),'lastevent':_0x295b('0x2b'),'mandatoryDisposition':this[_0x295b('0xb')][_0x411acd[_0x295b('0x2c')]]?this[_0x295b('0xb')][_0x411acd[_0x295b('0x2c')]][_0x295b('0x2d')]||![]:![],'type':this[_0x295b('0xb')][_0x411acd['queue']]?this[_0x295b('0xb')][_0x411acd[_0x295b('0x2c')]]['type']||'inbound':_0x295b('0x2e'),'variables':this[_0x295b('0xd')][_0x411acd[_0x295b('0x25')]]};}_['merge'](this[_0x295b('0x29')][_0x411acd[_0x295b('0x25')]][_0x411acd[_0x295b('0x27')]],_[_0x295b('0x2f')](_0x411acd,[_0x295b('0x30'),_0x295b('0x31')]));logger[_0x295b('0x32')](_0x295b('0x33'),_0x411acd[_0x295b('0x25')],util[_0x295b('0x28')](this[_0x295b('0x29')][_0x411acd[_0x295b('0x25')]][_0x411acd[_0x295b('0x27')]],{'showHidden':![],'depth':null}));ami[_0x295b('0x21')]('custom:agentcalled',this[_0x295b('0x29')][_0x411acd['uniqueid']][_0x411acd[_0x295b('0x27')]]);logger[_0x295b('0x32')](_0x295b('0x34'),_0x411acd['uniqueid'],util[_0x295b('0x28')](this[_0x295b('0x29')][_0x411acd['uniqueid']][_0x411acd[_0x295b('0x27')]],{'showHidden':![],'depth':null}));this[_0x295b('0x21')](util['format'](_0x295b('0x35'),_0x411acd['membername']),_0x295b('0x36'),this[_0x295b('0x29')][_0x411acd['uniqueid']][_0x411acd[_0x295b('0x27')]]);}}catch(_0x153022){logger[_0x295b('0x37')]('[%s][voiceAgentReport][agentcalled]',_0x411acd['uniqueid'],util[_0x295b('0x28')](_0x153022,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x295b('0x38')]=function(_0x226cb9){try{if(this[_0x295b('0x23')](_0x226cb9)){if(this[_0x295b('0x29')][_0x226cb9['uniqueid']]){logger[_0x295b('0x32')](_0x295b('0x39'),_0x226cb9[_0x295b('0x25')],util[_0x295b('0x28')](_0x226cb9,{'showHidden':![],'depth':null}));for(var _0x595114 in this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]]){if(this[_0x295b('0x29')][_0x226cb9['uniqueid']][_0x295b('0x3a')](_0x595114)){if(_0x226cb9[_0x295b('0x27')]===_0x595114){logger[_0x295b('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x226cb9[_0x295b('0x25')],_0x226cb9[_0x295b('0x26')],_0x226cb9[_0x295b('0x27')]);this[_0x295b('0x29')][_0x226cb9['uniqueid']][_0x595114]['agentconnectAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x3b')]=_0x226cb9[_0x295b('0x3b')];this['channels'][_0x226cb9[_0x295b('0x25')]][_0x595114]['connectedlinenum']=_0x226cb9[_0x295b('0x3c')];this['channels'][_0x226cb9['uniqueid']][_0x595114][_0x295b('0x3d')]=_0x226cb9[_0x295b('0x3d')];this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x3e')]=_0x226cb9[_0x295b('0x3e')];this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x3f')]=_0x226cb9['holdtime'];this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x40')]=_0x295b('0x41');_['merge'](this['agents'][_0x226cb9['interface']],_[_0x295b('0x42')](_0x226cb9,[_0x295b('0x2c'),_0x295b('0x43')]));logger[_0x295b('0x32')](_0x295b('0x44'),_0x226cb9[_0x295b('0x25')],util[_0x295b('0x28')](this['channels'][_0x226cb9[_0x295b('0x25')]][_0x226cb9['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x295b('0x21')](_0x295b('0x45'),this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x226cb9[_0x295b('0x27')]]);logger[_0x295b('0x32')](_0x295b('0x46'),_0x226cb9[_0x295b('0x25')],util[_0x295b('0x28')](this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x226cb9[_0x295b('0x27')]],{'showHidden':![],'depth':null}));this[_0x295b('0x21')](util[_0x295b('0x47')]('user:%s',_0x226cb9['membername']),_0x295b('0x48'),this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x226cb9[_0x295b('0x27')]]);}else if(!this[_0x295b('0x29')][_0x226cb9['uniqueid']][_0x595114][_0x295b('0x12')]&&!this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114]['agentcomplete']){logger['info'](_0x295b('0x49'),_0x226cb9['uniqueid'],this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x26')],_0x595114);this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x12')]=!![];this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x4a')]=moment()[_0x295b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x4b')]=_0x226cb9[_0x295b('0x27')];this[_0x295b('0x29')][_0x226cb9['uniqueid']][_0x595114][_0x295b('0x4c')]=_0x226cb9['membername'];this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114]['lastevent']=_0x295b('0x4d');this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114][_0x295b('0x4e')]=_0x295b('0x4d');logger['debug'](_0x295b('0x4f'),_0x226cb9[_0x295b('0x25')],util[_0x295b('0x28')](this[_0x295b('0x29')][_0x226cb9[_0x295b('0x25')]][_0x595114],{'showHidden':![],'depth':null}));ami[_0x295b('0x21')](_0x295b('0x50'),this['channels'][_0x226cb9[_0x295b('0x25')]][_0x595114]);}}}}}}catch(_0x280724){logger[_0x295b('0x37')](_0x295b('0x51'),_0x226cb9['uniqueid'],util['inspect'](_0x280724,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x13')]=function(_0x7553b3){try{if(this[_0x295b('0x23')](_0x7553b3)){logger[_0x295b('0x32')](_0x295b('0x52'),_0x7553b3[_0x295b('0x25')],util['inspect'](_0x7553b3,{'showHidden':![],'depth':null}));if(this[_0x295b('0x29')][_0x7553b3['uniqueid']]&&this['channels'][_0x7553b3[_0x295b('0x25')]][_0x7553b3['destuniqueid']]){logger[_0x295b('0x24')](_0x295b('0x53'),_0x7553b3['uniqueid'],_0x7553b3[_0x295b('0x26')],_0x7553b3['destuniqueid']);this[_0x295b('0x29')][_0x7553b3[_0x295b('0x25')]][_0x7553b3[_0x295b('0x27')]][_0x295b('0x12')]=!![];this[_0x295b('0x29')][_0x7553b3['uniqueid']][_0x7553b3[_0x295b('0x27')]][_0x295b('0x4a')]=moment()[_0x295b('0x47')](_0x295b('0x2a'));this[_0x295b('0x29')][_0x7553b3['uniqueid']][_0x7553b3['destuniqueid']][_0x295b('0x40')]=_0x295b('0x54');this[_0x295b('0x29')][_0x7553b3[_0x295b('0x25')]][_0x7553b3[_0x295b('0x27')]]['reason']='rejected';logger[_0x295b('0x32')](_0x295b('0x55'),_0x7553b3[_0x295b('0x25')],util[_0x295b('0x28')](this['channels'][_0x7553b3[_0x295b('0x25')]][_0x7553b3[_0x295b('0x27')]],{'showHidden':![],'depth':null}));ami['emit'](_0x295b('0x56'),this[_0x295b('0x29')][_0x7553b3['uniqueid']][_0x7553b3['destuniqueid']]);}}}catch(_0x218e4d){logger['error'](_0x295b('0x57'),_0x7553b3[_0x295b('0x25')],util[_0x295b('0x28')](_0x218e4d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x14')]=function(_0x3b40b6){try{if(this[_0x295b('0x23')](_0x3b40b6)){logger[_0x295b('0x32')](_0x295b('0x58'),_0x3b40b6[_0x295b('0x25')],util[_0x295b('0x28')](_0x3b40b6,{'showHidden':![],'depth':null}));if(this['channels'][_0x3b40b6[_0x295b('0x25')]]){for(var _0x468965 in this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]]){if(this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]]['hasOwnProperty'](_0x468965)&&!this[_0x295b('0x29')][_0x3b40b6['uniqueid']][_0x468965][_0x295b('0x12')]&&!this['channels'][_0x3b40b6[_0x295b('0x25')]][_0x468965][_0x295b('0x15')]){logger[_0x295b('0x24')](_0x295b('0x59'),_0x3b40b6[_0x295b('0x25')],this['channels'][_0x3b40b6[_0x295b('0x25')]][_0x468965]['membername'],_0x468965);this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965][_0x295b('0x12')]=!![];this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965][_0x295b('0x4a')]=moment()['format'](_0x295b('0x2a'));this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965]['lastevent']=_0x295b('0x5a');this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965][_0x295b('0x4e')]=_0x295b('0x5a');logger[_0x295b('0x32')](_0x295b('0x5b'),_0x3b40b6[_0x295b('0x25')],util['inspect'](this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965],{'showHidden':![],'depth':null}));ami[_0x295b('0x21')](_0x295b('0x5c'),this[_0x295b('0x29')][_0x3b40b6[_0x295b('0x25')]][_0x468965]);}}}}}catch(_0x51c80a){logger[_0x295b('0x37')](_0x295b('0x5d'),_0x3b40b6[_0x295b('0x25')],util['inspect'](_0x51c80a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x16')]=function(_0x103a21){try{if(this['isNotNull'](_0x103a21)){logger['debug'](_0x295b('0x5e'),_0x103a21[_0x295b('0x25')],util[_0x295b('0x28')](_0x103a21,{'showHidden':![],'depth':null}));if(this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]]){for(var _0x551520 in this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]]){if(this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]]['hasOwnProperty'](_0x551520)){if(this['channels'][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x5f')]&&!this[_0x295b('0x29')][_0x103a21['uniqueid']][_0x551520][_0x295b('0x15')]){logger['info'](_0x295b('0x60'),_0x103a21[_0x295b('0x25')],this[_0x295b('0x29')][_0x103a21['uniqueid']][_0x551520][_0x295b('0x26')],_0x551520);this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x15')]=!![];this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x61')]=moment()[_0x295b('0x47')](_0x295b('0x2a'));this['channels'][_0x103a21[_0x295b('0x25')]][_0x551520]['lastevent']=_0x295b('0x62');this[_0x295b('0x29')][_0x103a21['uniqueid']][_0x551520][_0x295b('0x4e')]=_0x103a21['reason']==_0x295b('0x63')?_0x295b('0x64'):_0x103a21[_0x295b('0x4e')];this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x65')]=_0x103a21[_0x295b('0x65')];if(this[_0x295b('0xb')][_0x103a21['queue']]&&this[_0x295b('0xb')][_0x103a21[_0x295b('0x2c')]][_0x295b('0x66')]){this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x67')]=this[_0x295b('0xb')][_0x103a21[_0x295b('0x2c')]][_0x295b('0x68')];this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520][_0x295b('0x69')]=!![];}this[_0x295b('0xc')][_0x103a21[_0x295b('0x6a')]]=_[_0x295b('0x2f')](this[_0x295b('0xc')][_0x103a21[_0x295b('0x6a')]],['queue',_0x295b('0x43')]);logger[_0x295b('0x32')](_0x295b('0x6b'),_0x103a21[_0x295b('0x25')],util[_0x295b('0x28')](this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520],{'showHidden':![],'depth':null}));ami[_0x295b('0x21')](_0x295b('0x6c'),this[_0x295b('0x29')][_0x103a21['uniqueid']][_0x551520]);logger[_0x295b('0x32')](_0x295b('0x6d'),_0x103a21[_0x295b('0x25')],util['inspect'](this[_0x295b('0x29')][_0x103a21[_0x295b('0x25')]][_0x551520],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x295b('0x35'),_0x103a21[_0x295b('0x26')]),_0x295b('0x6e'),this[_0x295b('0x29')][_0x103a21['uniqueid']][_0x551520]);}}}}}}catch(_0x324183){logger[_0x295b('0x37')](_0x295b('0x6f'),_0x103a21[_0x295b('0x25')],util[_0x295b('0x28')](_0x324183,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x295b('0x70')]=function(_0xa6897e){try{if(this[_0x295b('0x23')](_0xa6897e)){logger[_0x295b('0x32')](_0x295b('0x71'),_0xa6897e[_0x295b('0x25')],util[_0x295b('0x28')](_0xa6897e,{'showHidden':![],'depth':null}));this[_0x295b('0x72')](_0xa6897e['uniqueid'],_[_0x295b('0x73')](_0xa6897e[_0x295b('0x74')])[0x0],_0xa6897e['value']);if(this[_0x295b('0x29')][_0xa6897e[_0x295b('0x25')]]){for(var _0x409489 in this['channels'][_0xa6897e[_0x295b('0x25')]]){if(this[_0x295b('0x29')][_0xa6897e['uniqueid']][_0x295b('0x3a')](_0x409489)){logger['info'](_0x295b('0x75'),_0xa6897e['uniqueid'],_0x409489,_[_0x295b('0x73')](_0xa6897e[_0x295b('0x74')])[0x0],_0xa6897e[_0x295b('0x76')]);if(_[_0x295b('0x22')](this['channels'][_0xa6897e[_0x295b('0x25')]][_0x409489][_0x295b('0xd')])){this['channels'][_0xa6897e[_0x295b('0x25')]][_0x409489][_0x295b('0xd')]={};}this[_0x295b('0x29')][_0xa6897e[_0x295b('0x25')]][_0x409489][_0x295b('0xd')]=this['variables'][_0xa6897e['uniqueid']];}}}}}catch(_0x2f4477){logger[_0x295b('0x37')](_0x295b('0x77'),_0xa6897e[_0x295b('0x25')],util[_0x295b('0x28')](_0x2f4477,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x72')]=function(_0x1320f9,_0xc5e779,_0x175d59){var _0x5efde2=['rtpaudioqos','rtpaudioqosbridged',_0x295b('0x78'),_0x295b('0x79'),_0x295b('0x7a'),_0x295b('0x7b'),_0x295b('0x7c'),_0x295b('0x7d'),'sipcallid',_0x295b('0x7e'),_0x295b('0x7f'),'bridgepvtcallid',_0x295b('0x80'),_0x295b('0x81'),'memberinterface',_0x295b('0x82'),_0x295b('0x26'),'memberpenalty',_0x295b('0x83')];if(!_[_0x295b('0x84')](_0xc5e779)&&!_[_0x295b('0x85')](_0x5efde2,_0xc5e779)){if(_[_0x295b('0x22')](this[_0x295b('0xd')][_0x1320f9])){this[_0x295b('0xd')][_0x1320f9]={};}this[_0x295b('0xd')][_0x1320f9][_0xc5e779]=_0x175d59;}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x86')]=function(_0xfd7188){try{if(this['isNotNull'](_0xfd7188)){logger['debug'](_0x295b('0x87'),_0xfd7188['uniqueid'],util[_0x295b('0x28')](_0xfd7188,{'showHidden':![],'depth':null}));if(this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]]){for(var _0x346a5e in this['channels'][_0xfd7188[_0x295b('0x25')]]){if(this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]][_0x295b('0x3a')](_0x346a5e)){if(this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]][_0x346a5e][_0x295b('0x4e')]==_0x295b('0x63')&&this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]][_0x346a5e]['agentcomplete']){logger[_0x295b('0x24')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0xfd7188[_0x295b('0x25')],_0x346a5e);this['channels'][_0xfd7188[_0x295b('0x25')]][_0x346a5e]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x295b('0x32')](_0x295b('0x88'),_0xfd7188[_0x295b('0x25')],util[_0x295b('0x28')](_['values'](this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x295b('0x21')](_0x295b('0x89'),_[_0x295b('0x8a')](this[_0x295b('0x29')][_0xfd7188['uniqueid']]));delete this[_0x295b('0x29')][_0xfd7188[_0x295b('0x25')]];}if(this[_0x295b('0xd')][_0xfd7188[_0x295b('0x25')]]){delete this[_0x295b('0xd')][_0xfd7188['uniqueid']];}}}catch(_0x448c33){logger['error'](_0x295b('0x8b'),_0xfd7188['uniqueid'],util[_0x295b('0x28')](_0x448c33,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x295b('0x8c')]=function(_0x12e647){try{if(this[_0x295b('0x23')](_0x12e647)){logger[_0x295b('0x32')](_0x295b('0x8d'),_0x12e647[_0x295b('0x25')],util[_0x295b('0x28')](_0x12e647,{'showHidden':![],'depth':null}));if(this['channels'][_0x12e647[_0x295b('0x8e')]]){for(var _0x5d7f4c in this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]]){if(this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x295b('0x3a')](_0x5d7f4c)){if(_0x12e647[_0x295b('0x8f')]===_0x5d7f4c){logger[_0x295b('0x24')](_0x295b('0x90'),_0x12e647[_0x295b('0x25')],this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c][_0x295b('0x26')],_0x5d7f4c);var _0x19019d=moment();this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c]['agentcomplete']=!![];this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c][_0x295b('0x61')]=moment()[_0x295b('0x47')](_0x295b('0x2a'));this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c]['lastevent']=_0x295b('0x62');this['channels'][_0x12e647['transfereeuniqueid']][_0x5d7f4c]['reason']=_0x295b('0x63');this['channels'][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c]['talktime']=_0x19019d[_0x295b('0x91')](this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]][_0x5d7f4c][_0x295b('0x5f')],_0x295b('0x92'));}}}}if(this[_0x295b('0x29')][_0x12e647[_0x295b('0x93')]]){var _0x1532c1=this['channels'][_0x12e647[_0x295b('0x93')]];this[_0x295b('0x29')][_0x12e647[_0x295b('0x93')]]=this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]];this[_0x295b('0x29')][_0x12e647[_0x295b('0x8e')]]=_0x1532c1;}}}catch(_0x56f0e9){logger[_0x295b('0x37')](_0x295b('0x94'),_0x12e647[_0x295b('0x25')],util[_0x295b('0x28')](_0x56f0e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x1f')]=function(_0x2929a5){try{if(this[_0x295b('0x23')](_0x2929a5)){logger[_0x295b('0x32')](_0x295b('0x95'),_0x2929a5['uniqueid'],util['inspect'](_0x2929a5,{'showHidden':![],'depth':null}));if(this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]]){for(var _0x1564ec in this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]]){if(this[_0x295b('0x29')][_0x2929a5['transfereeuniqueid']][_0x295b('0x3a')](_0x1564ec)){if(_0x2929a5[_0x295b('0x96')]===_0x1564ec){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2929a5[_0x295b('0x25')],this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]][_0x1564ec][_0x295b('0x26')],_0x1564ec);var _0x2409db=moment();this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]][_0x1564ec]['agentcomplete']=!![];this[_0x295b('0x29')][_0x2929a5['transfereeuniqueid']][_0x1564ec][_0x295b('0x61')]=_0x2409db;this['channels'][_0x2929a5[_0x295b('0x8e')]][_0x1564ec]['lastevent']=_0x295b('0x62');this[_0x295b('0x29')][_0x2929a5['transfereeuniqueid']][_0x1564ec][_0x295b('0x4e')]=_0x295b('0x63');this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]][_0x1564ec][_0x295b('0x65')]=_0x2409db['diff'](this[_0x295b('0x29')][_0x2929a5[_0x295b('0x8e')]][_0x1564ec][_0x295b('0x5f')],'seconds');}}}}}}catch(_0x5284d9){logger[_0x295b('0x37')](_0x295b('0x97'),_0x2929a5[_0x295b('0x25')],util[_0x295b('0x28')](_0x5284d9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x295b('0x20')][_0x295b('0x1a')]=function(_0x408187){var _0x4e0b70='';try{if(this['isNotNull'](_0x408187)){logger[_0x295b('0x32')](_0x295b('0x98'),_0x408187[_0x295b('0x25')],util['inspect'](_0x408187,{'showHidden':![],'depth':null}));if(_0x408187['channel']){_0x4e0b70=_0x408187[_0x295b('0x99')][_0x295b('0x9a')](0x0,_0x408187[_0x295b('0x99')][_0x295b('0x9b')]('-'));if(this['agents'][_0x4e0b70]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x408187[_0x295b('0x25')],_0x4e0b70);this['agents'][_0x4e0b70][_0x295b('0x9c')]=!![];}}}}catch(_0x5aba0a){logger[_0x295b('0x37')]('[%s][voiceAgentReport][musiconholdstart]',_0x408187[_0x295b('0x25')],util[_0x295b('0x28')](_0x5aba0a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x542a63){var _0x1acf23='';try{if(this[_0x295b('0x23')](_0x542a63)){logger[_0x295b('0x32')](_0x295b('0x9d'),_0x542a63[_0x295b('0x25')],util[_0x295b('0x28')](_0x542a63,{'showHidden':![],'depth':null}));if(_0x542a63['channel']){_0x1acf23=_0x542a63[_0x295b('0x99')]['substring'](0x0,_0x542a63[_0x295b('0x99')]['lastIndexOf']('-'));if(this[_0x295b('0xc')][_0x1acf23]){logger['info'](_0x295b('0x9e'),_0x542a63[_0x295b('0x25')],_0x1acf23);this[_0x295b('0xc')][_0x1acf23][_0x295b('0x9c')]=![];}}}}catch(_0x6979fb){logger[_0x295b('0x37')](_0x295b('0x9f'),_0x542a63[_0x295b('0x25')],util[_0x295b('0x28')](_0x6979fb,{'showHidden':![],'depth':null}));}};module[_0x295b('0xa0')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index fedf81b..2be0068 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 _0xc805=['agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isUndefined','emit','prototype','syncNewCallerId','isNotNull','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','keys','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','pick','channel','split','destconnectedlinenum','exten','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','appdata','applicationdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','set','cdr(','match','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','calleridnum','xcally-motion-preview','connectedlinenum','toNumber','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','endtime','billableseconds','diff','from-sip','omit','user:agentcomplete','resolve','then','transferType','undefined','stopRecordingOnTransfer','Action','StopMixMonitor','catch','destinationchannel','webbar:stopmonitors','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','transferconnectedlinenum','origtransfereruniqueid','some','ATTENDED','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','bluebird','moment','util','path','ioredis','../../../config/environment','ami','../ami','../rpc/setting','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','agi','dial','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','channels'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0xc805,0x171));var _0x5c80=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xc805[_0xcf5436];return _0xc4f5c8;};'use strict';var BPromise=require(_0x5c80('0x0'));var _=require('lodash');var moment=require(_0x5c80('0x1'));var util=require(_0x5c80('0x2'));var path=require(_0x5c80('0x3'));var Redis=require(_0x5c80('0x4'));var config=require(_0x5c80('0x5'));var logger=require('../../../config/logger')(_0x5c80('0x6'));var ami=require(_0x5c80('0x7'));var Channel=require('../model/channel');var RpcSetting=require(_0x5c80('0x8'));var statusDesc=['unknown',_0x5c80('0x9'),_0x5c80('0xa'),_0x5c80('0xb'),'invalid',_0x5c80('0xc'),_0x5c80('0xd'),_0x5c80('0xe'),_0x5c80('0xf')];var applications=['set','queue',_0x5c80('0x10'),_0x5c80('0x11'),'playback',_0x5c80('0x12')];var dispositions=[_0x5c80('0x13'),_0x5c80('0x14'),_0x5c80('0x14'),'NO\x20ANSWER',_0x5c80('0x13'),_0x5c80('0x13'),'ANSWERED',_0x5c80('0x15'),_0x5c80('0x14'),_0x5c80('0x14'),_0x5c80('0x14')];var actions={};config[_0x5c80('0x16')]=_[_0x5c80('0x17')](config[_0x5c80('0x16')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5c80('0x16')]));function VoiceCallReport(_0x441acc){this[_0x5c80('0x18')]=_0x441acc[_0x5c80('0x18')];this[_0x5c80('0x19')]=_0x441acc['agents'];this[_0x5c80('0x1a')]={};ami['on'](_0x5c80('0x1b'),this[_0x5c80('0x1c')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x1e'),this[_0x5c80('0x1c')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x1f'),this[_0x5c80('0x20')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x21'),this[_0x5c80('0x22')][_0x5c80('0x1d')](this));ami['on']('varset',this[_0x5c80('0x23')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x24'),this[_0x5c80('0x25')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x26'),this['syncNewCallerId'][_0x5c80('0x1d')](this));ami['on']('attendedtransfer',this[_0x5c80('0x27')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x28'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x5c80('0x29'),this[_0x5c80('0x2a')][_0x5c80('0x1d')](this));ami['on'](_0x5c80('0x2b'),this[_0x5c80('0x2c')][_0x5c80('0x1d')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x5c80('0x2d')]();}catch(_0x3b5c7a){logger[_0x5c80('0x2e')](_0x5c80('0x2f'),util[_0x5c80('0x30')](_0x3b5c7a,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x9519c3){return _0x9519c3!==null&&!_[_0x5c80('0x31')](_0x9519c3);};VoiceCallReport['prototype'][_0x5c80('0x32')]=function(_0x1b9b3b,_0x4304ac,_0x1bf8a6){io['to'](_0x1b9b3b)[_0x5c80('0x32')](_0x4304ac,_0x1bf8a6);};VoiceCallReport[_0x5c80('0x33')][_0x5c80('0x34')]=function(_0x30247c){try{if(this[_0x5c80('0x35')](_0x30247c)){logger[_0x5c80('0x36')](_0x5c80('0x37'),_0x30247c[_0x5c80('0x38')],_0x30247c[_0x5c80('0x39')],_0x30247c['calleridnum']);logger['debug'](_0x5c80('0x3a'),_0x30247c[_0x5c80('0x38')],util['inspect'](_0x30247c,{'showHidden':![],'depth':null}));if(_0x30247c[_0x5c80('0x38')]===_0x30247c[_0x5c80('0x3b')]){if(!_[_0x5c80('0x31')](this[_0x5c80('0x18')][_0x30247c['uniqueid']])){_['merge'](this[_0x5c80('0x18')][_0x30247c[_0x5c80('0x38')]],_['pick'](_0x30247c,_[_0x5c80('0x3c')](this[_0x5c80('0x18')][_0x30247c[_0x5c80('0x38')]])));}}}}catch(_0xa636d1){logger[_0x5c80('0x2e')](_0x5c80('0x3d'),_0x30247c['uniqueid'],util[_0x5c80('0x30')](_0xa636d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c80('0x33')]['syncNewChannel']=function(_0x2b91fb){try{if(this[_0x5c80('0x35')](_0x2b91fb)){logger[_0x5c80('0x3e')](_0x5c80('0x3f'),_0x2b91fb[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x2b91fb,{'showHidden':![],'depth':null}));if(_0x2b91fb[_0x5c80('0x38')]===_0x2b91fb['linkedid']&&_0x2b91fb['channel']!=_0x5c80('0x40')){if(_['isUndefined'](this[_0x5c80('0x18')][_0x2b91fb[_0x5c80('0x38')]])){logger[_0x5c80('0x36')](_0x5c80('0x41'),_0x2b91fb['uniqueid'],_0x2b91fb[_0x5c80('0x42')],_0x2b91fb['exten']);this[_0x5c80('0x18')][_0x2b91fb[_0x5c80('0x38')]]=new Channel();this[_0x5c80('0x18')][_0x2b91fb['uniqueid']][_0x5c80('0x43')]=moment()[_0x5c80('0x44')](_0x5c80('0x45'));this[_0x5c80('0x18')][_0x2b91fb[_0x5c80('0x38')]][_0x5c80('0x46')]=dispositions[_['toNumber'](_0x2b91fb[_0x5c80('0x47')])];_[_0x5c80('0x48')](this[_0x5c80('0x18')][_0x2b91fb['uniqueid']],_[_0x5c80('0x49')](_0x2b91fb,_['keys'](this[_0x5c80('0x18')][_0x2b91fb[_0x5c80('0x38')]])));if(_0x2b91fb[_0x5c80('0x42')]==='from-sip'){if(this['agents'][_0x2b91fb[_0x5c80('0x4a')]['split']('-')[0x0]]){this[_0x5c80('0x19')][_0x2b91fb[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x4c')]=_0x2b91fb[_0x5c80('0x4d')];logger['debug'](_0x5c80('0x4e'),_0x2b91fb[_0x5c80('0x38')],util['inspect']({'id':this[_0x5c80('0x19')][_0x2b91fb[_0x5c80('0x4a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x5c80('0x19')][_0x2b91fb[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x4f')],'destconnectedlinenum':_0x2b91fb[_0x5c80('0x4d')]},{'showHidden':![],'depth':null}));this[_0x5c80('0x32')](util['format'](_0x5c80('0x50'),this[_0x5c80('0x19')][_0x2b91fb['channel']['split']('-')[0x0]][_0x5c80('0x51')]),_0x5c80('0x52'),{'id':this['agents'][_0x2b91fb['channel'][_0x5c80('0x4b')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c80('0x19')][_0x2b91fb[_0x5c80('0x4a')]['split']('-')[0x0]][_0x5c80('0x4f')],'destconnectedlinenum':_0x2b91fb[_0x5c80('0x4d')]});}}}}}}catch(_0x409240){logger[_0x5c80('0x2e')](_0x5c80('0x53'),_0x2b91fb['uniqueid'],util[_0x5c80('0x30')](_0x409240,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c80('0x1c')]=function(_0x2ebe9d){try{if(this['isNotNull'](_0x2ebe9d)){logger[_0x5c80('0x3e')](_0x5c80('0x54'),_0x2ebe9d['uniqueid'],util[_0x5c80('0x30')](_0x2ebe9d,{'showHidden':![],'depth':null}));if(_0x2ebe9d[_0x5c80('0x38')]===_0x2ebe9d[_0x5c80('0x3b')]&&_0x2ebe9d[_0x5c80('0x4d')]!='h'&&_0x2ebe9d[_0x5c80('0x4a')]!='OutgoingSpoolFailed'){_0x2ebe9d[_0x5c80('0x55')]=_0x2ebe9d[_0x5c80('0x55')]['toLowerCase']();_0x2ebe9d['applicationdata']=(_0x2ebe9d[_0x5c80('0x56')]||_0x2ebe9d[_0x5c80('0x57')])[_0x5c80('0x58')]();logger['info'](_0x5c80('0x59'),_0x2ebe9d[_0x5c80('0x38')],_0x2ebe9d['application'],_0x2ebe9d[_0x5c80('0x57')]);if(_[_0x5c80('0x31')](this[_0x5c80('0x18')][_0x2ebe9d['uniqueid']])){this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]]=new Channel();this['channels'][_0x2ebe9d['uniqueid']][_0x5c80('0x43')]=_0x2ebe9d[_0x5c80('0x5a')]?moment()['subtract'](moment[_0x5c80('0x5a')](_0x2ebe9d['duration'])[_0x5c80('0x5b')](),_0x5c80('0x5b'))[_0x5c80('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x5c80('0x44')](_0x5c80('0x45'));this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]]['disposition']=_0x5c80('0x13');}_[_0x5c80('0x48')](this['channels'][_0x2ebe9d[_0x5c80('0x38')]],_[_0x5c80('0x49')](_0x2ebe9d,_[_0x5c80('0x3c')](this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]])));if(_[_0x5c80('0x5c')](applications,_0x2ebe9d[_0x5c80('0x55')])){this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]][_0x5c80('0x5d')]=_0x2ebe9d[_0x5c80('0x55')];this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]][_0x5c80('0x5e')]=_0x2ebe9d[_0x5c80('0x57')];if(_0x2ebe9d[_0x5c80('0x55')]===_0x5c80('0x5f')&&_['startsWith'](_0x2ebe9d[_0x5c80('0x57')],_0x5c80('0x60'))){var _0x521fcc=_0x2ebe9d[_0x5c80('0x57')][_0x5c80('0x4b')]('=');var _0x224712=_0x521fcc[0x0][_0x5c80('0x61')](/cdr\((.*)\)/);if(_0x224712){this['channels'][_0x2ebe9d[_0x5c80('0x38')]][_0x224712[0x1]]=_0x521fcc[0x1];}}else if(_0x2ebe9d[_0x5c80('0x55')]===_0x5c80('0x62')){this[_0x5c80('0x18')][_0x2ebe9d[_0x5c80('0x38')]][_0x5c80('0x62')]=_0x2ebe9d[_0x5c80('0x57')][_0x5c80('0x4b')](',')[0x0];}}}}}catch(_0x18e4e5){logger[_0x5c80('0x2e')](_0x5c80('0x63'),_0x2ebe9d[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x18e4e5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x30898c){try{if(this[_0x5c80('0x35')](_0x30898c)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x30898c['uniqueid'],_0x30898c['linkedid'],_0x30898c[_0x5c80('0x39')],_0x30898c['calleridnum']);logger[_0x5c80('0x3e')](_0x5c80('0x64'),_0x30898c['uniqueid'],util[_0x5c80('0x30')](_0x30898c,{'showHidden':![],'depth':null}));if(_0x30898c[_0x5c80('0x38')]!==_0x30898c[_0x5c80('0x3b')]){if(this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]]){if(_0x30898c[_0x5c80('0x47')]==='6'){if(!this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x65')]){var _0x92d4b9=moment();this['channels'][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x65')]=!![];this['channels'][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x66')]=_0x92d4b9[_0x5c80('0x44')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x5c80('0x18')][_0x30898c['linkedid']][_0x5c80('0x43')]){this[_0x5c80('0x18')][_0x30898c['linkedid']][_0x5c80('0x67')]=_0x92d4b9['diff'](this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x43')],_0x5c80('0x5b'));}}this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x3b')]=_0x30898c[_0x5c80('0x38')];if(_0x30898c[_0x5c80('0x68')]!==_0x5c80('0x69')){this['channels'][_0x30898c['linkedid']][_0x5c80('0x6a')]=_0x30898c[_0x5c80('0x68')];}this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]]['connectedlinename']=_0x30898c['calleridname'];this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]]['destinationchannel']=_0x30898c[_0x5c80('0x4a')];this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]][_0x5c80('0x46')]=dispositions[_[_0x5c80('0x6b')](_0x30898c[_0x5c80('0x47')])];if(this[_0x5c80('0x19')][_0x30898c[_0x5c80('0x4a')]['split']('-')[0x0]]){this[_0x5c80('0x18')][_0x30898c['linkedid']]['UserId']=this['agents'][_0x30898c[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]]['id'];this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x3b')]]['membername']=this[_0x5c80('0x19')][_0x30898c[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x51')];}}}}else{if(this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x38')]]){if(_0x30898c[_0x5c80('0x47')]==='6'){if(this[_0x5c80('0x19')][_0x30898c[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]]){this[_0x5c80('0x18')][_0x30898c[_0x5c80('0x38')]]['UserId']=this[_0x5c80('0x19')][_0x30898c['channel'][_0x5c80('0x4b')]('-')[0x0]]['id'];this[_0x5c80('0x18')][_0x30898c['uniqueid']][_0x5c80('0x6c')]=this[_0x5c80('0x19')][_0x30898c[_0x5c80('0x4a')]['split']('-')[0x0]][_0x5c80('0x51')];}}}}}}catch(_0x4648b9){logger['error'](_0x5c80('0x6d'),_0x30898c['uniqueid'],util['inspect'](_0x4648b9,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c80('0x6e')]=function(_0x415ebd,_0x31cabe){try{if(this[_0x5c80('0x18')][_0x415ebd]){logger[_0x5c80('0x36')](_0x5c80('0x6f'),_0x415ebd,_0x31cabe);this['channels'][_0x415ebd][_0x5c80('0x70')]=!![];if(_[_0x5c80('0x71')](_0x31cabe,_0x5c80('0x72'))){_0x31cabe=_0x31cabe['replace'](_0x5c80('0x72'),_0x5c80('0x73'));}this[_0x5c80('0x18')][_0x415ebd]['monitorFilename']=_0x31cabe;var _0xbcd980=_[_0x5c80('0x74')](this[_0x5c80('0x18')][_0x415ebd][_0x5c80('0x75')],{'filename':_0x31cabe});if(_[_0x5c80('0x76')](_0xbcd980)){this[_0x5c80('0x18')][_0x415ebd][_0x5c80('0x75')]['push']({'filename':_0x31cabe,'createdAt':moment()[_0x5c80('0x44')](_0x5c80('0x45')),'mixmonitorid':'','status':_0x5c80('0x77')});}}}catch(_0x7e9c26){logger['error'](_0x5c80('0x78'),_0x415ebd,util['inspect'](_0x7e9c26,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c80('0x33')]['syncVarSet']=function(_0x2b7ff4){try{if(this[_0x5c80('0x35')](_0x2b7ff4)){logger[_0x5c80('0x3e')]('[%s][voiceCallReport][varset]\x20event:',_0x2b7ff4[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x2b7ff4,{'showHidden':![],'depth':null}));if(this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]]&&_0x2b7ff4['channel']!=_0x5c80('0x40')){if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')])){if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x7a')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x2b7ff4['uniqueid'],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x6e')](_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')]);}else if(this['isNotNull'](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x7c')])){logger['info'](_0x5c80('0x7d'),_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]][_0x5c80('0x68')]=_0x2b7ff4[_0x5c80('0x7b')];}else if(this[_0x5c80('0x35')](_0x2b7ff4['variable'][_0x5c80('0x7e')])){logger[_0x5c80('0x36')](_0x5c80('0x7f'),_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4['value']);this[_0x5c80('0x18')][_0x2b7ff4['uniqueid']][_0x5c80('0x80')]=_0x2b7ff4[_0x5c80('0x7b')];}else if(this['isNotNull'](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x81')])){logger[_0x5c80('0x36')](_0x5c80('0x82'),_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]][_0x5c80('0x83')]=_0x2b7ff4['value'];}else if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')]['xmd-queue'])){logger[_0x5c80('0x36')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')][_0x5c80('0x4b')](',')[0x0]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]][_0x5c80('0x62')]=_0x2b7ff4[_0x5c80('0x7b')][_0x5c80('0x4b')](',')[0x0];}else if(this['isNotNull'](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x84')])){logger[_0x5c80('0x36')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]][_0x5c80('0x85')]=_0x2b7ff4['value'];}else if(this['isNotNull'](_0x2b7ff4[_0x5c80('0x79')]['xmd-destination'])){logger[_0x5c80('0x36')](_0x5c80('0x86'),_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4['value']);this[_0x5c80('0x18')][_0x2b7ff4['uniqueid']]['destination']=_0x2b7ff4[_0x5c80('0x7b')];}else if(this[_0x5c80('0x35')](_0x2b7ff4['variable'][_0x5c80('0x87')])){logger[_0x5c80('0x36')](_0x5c80('0x88'),_0x2b7ff4['uniqueid'],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]][_0x5c80('0x89')]=_0x2b7ff4['value'];}else if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')]['xmcs-queue'])){logger[_0x5c80('0x36')](_0x5c80('0x8a'),_0x2b7ff4[_0x5c80('0x38')],_0x2b7ff4[_0x5c80('0x7b')]);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]]['queue']=_0x2b7ff4[_0x5c80('0x7b')];}else if(this['isNotNull'](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x8b')])){logger['info'](_0x5c80('0x8c'),_0x2b7ff4['uniqueid'],_0x2b7ff4['value']);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x38')]]['sipcalluniqueid']=_0x2b7ff4['value'];}}}else if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')][_0x5c80('0x7a')])){if(_0x2b7ff4[_0x5c80('0x7b')]){var _0xc206e9=path[_0x5c80('0x8d')](_0x2b7ff4[_0x5c80('0x7b')])[_0x5c80('0x51')];logger[_0x5c80('0x36')](_0x5c80('0x8e'),_0xc206e9,_0x2b7ff4['value']);this[_0x5c80('0x6e')](_0xc206e9,_0x2b7ff4[_0x5c80('0x7b')]);}}else if(this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x3b')]]){if(this[_0x5c80('0x35')](_0x2b7ff4[_0x5c80('0x79')])){if(this[_0x5c80('0x35')](_0x2b7ff4['variable'][_0x5c80('0x8b')])){logger[_0x5c80('0x36')](_0x5c80('0x8c'),_0x2b7ff4[_0x5c80('0x3b')],_0x2b7ff4['value']);this[_0x5c80('0x18')][_0x2b7ff4[_0x5c80('0x3b')]][_0x5c80('0x8f')]=_0x2b7ff4[_0x5c80('0x7b')];}}}}}catch(_0x48b1ee){logger[_0x5c80('0x2e')](_0x5c80('0x90'),_0x2b7ff4[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x48b1ee,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c80('0x33')]['syncHangup']=function(_0xb665f4){try{if(this[_0x5c80('0x35')](_0xb665f4)){logger[_0x5c80('0x3e')](_0x5c80('0x91'),_0xb665f4[_0x5c80('0x38')],util[_0x5c80('0x30')](_0xb665f4,{'showHidden':![],'depth':null}));if(this[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]]){logger[_0x5c80('0x36')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0xb665f4[_0x5c80('0x38')],_0xb665f4['cause-txt']);var _0x3ff0c9=moment();this[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x92')]=_0x3ff0c9[_0x5c80('0x44')](_0x5c80('0x45'));this[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x5a')]=_0x3ff0c9['diff'](this['channels'][_0xb665f4[_0x5c80('0x38')]]['starttime'],_0x5c80('0x5b'));if(this['channels'][_0xb665f4['uniqueid']][_0x5c80('0x65')]){this[_0x5c80('0x18')][_0xb665f4['uniqueid']][_0x5c80('0x93')]=_0x3ff0c9[_0x5c80('0x94')](this['channels'][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x66')],_0x5c80('0x5b'));this['channels'][_0xb665f4['uniqueid']][_0x5c80('0x67')]=this[_0x5c80('0x18')][_0xb665f4['uniqueid']][_0x5c80('0x5a')]-this[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x93')];}if(_0xb665f4[_0x5c80('0x42')]===_0x5c80('0x95')){if(this[_0x5c80('0x19')][_0xb665f4[_0x5c80('0x4a')]['split']('-')[0x0]]){this[_0x5c80('0x19')][_0xb665f4[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]]=_[_0x5c80('0x96')](this['agents'][_0xb665f4[_0x5c80('0x4a')]['split']('-')[0x0]],[_0x5c80('0x4c')]);logger[_0x5c80('0x3e')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0xb665f4[_0x5c80('0x38')],util['inspect']({'id':this[_0x5c80('0x19')][_0xb665f4[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c80('0x19')][_0xb665f4['channel'][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x4f')]},{'showHidden':![],'depth':null}));this[_0x5c80('0x32')](util[_0x5c80('0x44')](_0x5c80('0x50'),this[_0x5c80('0x19')][_0xb665f4['channel'][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x51')]),_0x5c80('0x97'),{'id':this[_0x5c80('0x19')][_0xb665f4[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c80('0x19')][_0xb665f4[_0x5c80('0x4a')][_0x5c80('0x4b')]('-')[0x0]][_0x5c80('0x4f')]});}}var _0x2bd10a=this;Promise[_0x5c80('0x98')]()[_0x5c80('0x99')](function(){var _0x4b4ad4=_0x2bd10a[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]];if(typeof _0x4b4ad4[_0x5c80('0x9a')]===_0x5c80('0x9b'))return;if(_['isEmpty'](_0x4b4ad4[_0x5c80('0x75')]))return;return RpcSetting['getSettings']()[_0x5c80('0x99')](function(_0x2d6df4){if(!_0x2d6df4[_0x5c80('0x9c')])return;return Promise[_0x5c80('0x98')]()[_0x5c80('0x99')](function(){return ami[_0x5c80('0x9d')]({'action':_0x5c80('0x9e'),'channel':_0x4b4ad4['channel']})[_0x5c80('0x9f')](function(){});})['then'](function(){return ami[_0x5c80('0x9d')]({'action':'StopMixMonitor','channel':_0x4b4ad4['destinationchannel']})[_0x5c80('0x9f')](function(){})['finally'](function(){var _0x42d8f2=_0x2bd10a['agents'][_0x4b4ad4[_0x5c80('0xa0')]['split']('-')[0x0]];if(!_0x42d8f2)return;io[_0x5c80('0x32')](_0x5c80('0xa1'),{'agentId':_0x42d8f2['id'],'uniqueid':_0x4b4ad4['uniqueid']});});});});})['then'](function(){if(_0xb665f4[_0x5c80('0xa2')]==='BlindTransfer'){_0x2bd10a[_0x5c80('0x1a')][_0xb665f4[_0x5c80('0x38')]]=_0x2bd10a[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]];}else{if(_0x2bd10a[_0x5c80('0x18')][_0xb665f4['uniqueid']][_0x5c80('0x83')]===_0x5c80('0xa3')&&_0x2bd10a[_0x5c80('0x1a')][_0xb665f4[_0x5c80('0x38')]]){_0x2bd10a[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x38')]=[_0x2bd10a[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x3b')],_0x2bd10a['channels'][_0xb665f4[_0x5c80('0x38')]][_0x5c80('0x3b')]=_0x2bd10a[_0x5c80('0x18')][_0xb665f4['uniqueid']][_0x5c80('0x38')]][0x0];delete _0x2bd10a[_0x5c80('0x1a')][_0xb665f4['uniqueid']];}}logger[_0x5c80('0x3e')](_0x5c80('0xa4'),_0xb665f4['uniqueid'],util[_0x5c80('0x30')](_0x2bd10a[_0x5c80('0x18')][_0xb665f4[_0x5c80('0x38')]],{'showHidden':![],'depth':null}));ami[_0x5c80('0x32')](_0x5c80('0xa5'),_0x2bd10a['channels'][_0xb665f4[_0x5c80('0x38')]]);delete _0x2bd10a[_0x5c80('0x18')][_0xb665f4['uniqueid']];});}}}catch(_0x30645e){logger[_0x5c80('0x2e')]('[%s][voiceCallReport][hangup]',_0xb665f4[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x30645e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c80('0x33')][_0x5c80('0x27')]=function(_0x20c44a){try{if(this[_0x5c80('0x35')](_0x20c44a)){logger['info'](_0x5c80('0xa6'),_0x20c44a[_0x5c80('0x38')],_0x20c44a['origtransferercalleridnum'],_0x20c44a[_0x5c80('0xa7')]);logger[_0x5c80('0x3e')](_0x5c80('0xa8'),_0x20c44a[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x20c44a,{'showHidden':![],'depth':null}));if(this[_0x5c80('0x18')][_0x20c44a['transfereeuniqueid']]){this['channels'][_0x20c44a[_0x5c80('0xa9')]][_0x5c80('0xaa')]=_0x20c44a['origtransferercalleridnum'];this[_0x5c80('0x18')][_0x20c44a['transfereeuniqueid']]['transferconnectedlinenum']=_0x20c44a[_0x5c80('0xa7')];if(this['channels'][_0x20c44a['secondtransfereruniqueid']]){var _0x49788b=this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xab')]];this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xab')]]=this[_0x5c80('0x18')][_0x20c44a['transfereeuniqueid']];this['channels'][_0x20c44a[_0x5c80('0xa9')]]=_0x49788b;}}else if(this[_0x5c80('0x18')][_0x20c44a['transfertargetuniqueid']]){this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xac')]]['transfercalleridnum']=_0x20c44a[_0x5c80('0xad')];this['channels'][_0x20c44a[_0x5c80('0xac')]][_0x5c80('0xae')]=_0x20c44a[_0x5c80('0xa7')];if(this[_0x5c80('0x18')][_0x20c44a['origtransfereruniqueid']]){var _0x49788b=this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xaf')]];this['channels'][_0x20c44a[_0x5c80('0xaf')]]=this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xac')]];this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xac')]]=_0x49788b;}}if((this['channels'][_0x20c44a[_0x5c80('0xaf')]]||this[_0x5c80('0x18')][_0x20c44a['origtransfererlinkedid']])&&this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xab')]]){var _0x209749=_[_0x5c80('0xb0')]([this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xaf')]],this[_0x5c80('0x18')][_0x20c44a['origtransfererlinkedid']],this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xab')]]],function(_0x2045a0){return _0x2045a0&&_0x2045a0['type']===_0x5c80('0xa3')&&_0x2045a0['routeid'];});if(_0x209749){if(this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xaf')]])this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xaf')]]['transferType']=_0x5c80('0xb1');if(this[_0x5c80('0x18')][_0x20c44a[_0x5c80('0xb2')]])this['channels'][_0x20c44a[_0x5c80('0xb2')]]['transferType']=_0x5c80('0xb1');this[_0x5c80('0x18')][_0x20c44a['secondtransfereruniqueid']][_0x5c80('0x9a')]='ATTENDED';}}}}catch(_0x3bc7fa){logger['error'](_0x5c80('0xb3'),_0x20c44a[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x3bc7fa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c80('0x33')]['syncBlindTransfer']=function(_0x4d83ca){try{if(this[_0x5c80('0x35')](_0x4d83ca)){logger[_0x5c80('0x36')](_0x5c80('0xb4'),_0x4d83ca[_0x5c80('0x38')],_0x4d83ca[_0x5c80('0xb5')],_0x4d83ca[_0x5c80('0xb6')]);logger[_0x5c80('0x3e')](_0x5c80('0xb7'),_0x4d83ca[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x4d83ca,{'showHidden':![],'depth':null}));if(this[_0x5c80('0x18')][_0x4d83ca['transfereeuniqueid']]){this['channels'][_0x4d83ca[_0x5c80('0xa9')]][_0x5c80('0xaa')]=_0x4d83ca[_0x5c80('0xb5')];this[_0x5c80('0x18')][_0x4d83ca['transfereeuniqueid']][_0x5c80('0xae')]=_0x4d83ca[_0x5c80('0xb6')];this[_0x5c80('0x18')][_0x4d83ca[_0x5c80('0xa9')]][_0x5c80('0x9a')]=_0x5c80('0xb8');this['syncHangup']({'event':_0x5c80('0xb9'),'uniqueid':_0x4d83ca[_0x5c80('0xa9')],'context':_0x4d83ca[_0x5c80('0x42')],'channel':_0x4d83ca['transfererchannel']});}else{this[_0x5c80('0x18')][_0x4d83ca[_0x5c80('0xba')]][_0x5c80('0x9a')]=_0x5c80('0xb8');}}}catch(_0x549d55){logger[_0x5c80('0x2e')](_0x5c80('0xbb'),_0x4d83ca[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x549d55,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c80('0x2a')]=function(_0x2032d9){try{if(this['isNotNull'](_0x2032d9)){logger[_0x5c80('0x3e')](_0x5c80('0xbc'),_0x2032d9[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x2032d9,{'showHidden':![],'depth':null}));if(this[_0x5c80('0x18')][_0x2032d9[_0x5c80('0x38')]]){if(!_[_0x5c80('0x76')](this[_0x5c80('0x18')][_0x2032d9[_0x5c80('0x38')]]['answertime'])){this[_0x5c80('0x18')][_0x2032d9[_0x5c80('0x38')]][_0x5c80('0xbd')]=moment()[_0x5c80('0x44')](_0x5c80('0x45'));logger[_0x5c80('0x36')](_0x5c80('0xbe'),_0x2032d9[_0x5c80('0x38')],this[_0x5c80('0x18')][_0x2032d9[_0x5c80('0x38')]][_0x5c80('0xbd')]);}}}}catch(_0x5074a6){logger['error'](_0x5c80('0xbf'),_0x2032d9[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x5074a6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c80('0x2c')]=function(_0x486051){try{if(this[_0x5c80('0x35')](_0x486051)){logger[_0x5c80('0x3e')](_0x5c80('0xc0'),_0x486051['uniqueid'],util[_0x5c80('0x30')](_0x486051,{'showHidden':![],'depth':null}));if(this['channels'][_0x486051[_0x5c80('0x38')]]){if(!_[_0x5c80('0x76')](this['channels'][_0x486051[_0x5c80('0x38')]][_0x5c80('0xbd')])){this[_0x5c80('0x18')][_0x486051[_0x5c80('0x38')]][_0x5c80('0xc1')]+=moment()[_0x5c80('0xc2')](0x0)[_0x5c80('0x94')](this[_0x5c80('0x18')][_0x486051[_0x5c80('0x38')]][_0x5c80('0xbd')],'seconds');logger[_0x5c80('0x36')](_0x5c80('0xc3'),_0x486051[_0x5c80('0x38')],this[_0x5c80('0x18')][_0x486051[_0x5c80('0x38')]][_0x5c80('0xc1')]);delete this[_0x5c80('0x18')][_0x486051[_0x5c80('0x38')]][_0x5c80('0xbd')];}}}}catch(_0x54db0f){logger[_0x5c80('0x2e')]('[%s][voiceCallReport][musiconholdstop]',_0x486051[_0x5c80('0x38')],util[_0x5c80('0x30')](_0x54db0f,{'showHidden':![],'depth':null}));}};module[_0x5c80('0xc4')]=VoiceCallReport; \ No newline at end of file +var _0x082b=['user:agentcomplete','resolve','then','transferType','undefined','isEmpty','stopRecordingOnTransfer','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','outbound','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','extension','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','bluebird','lodash','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','unknown','invalid','unavailable','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','bind','newexten','syncNewExten','syncNewChannel','syncVarSet','newcallerid','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','syncNewCallerId','isNotNull','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','error','[%s][voiceCallReport][newcallerid]','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','format','disposition','toNumber','channelstate','from-sip','split','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','name','user:agentconnect','application','toLowerCase','applicationdata','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','lastapplication','lastdata','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','isNil','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s'];(function(_0x597607,_0x488b0f){var _0x584fa4=function(_0x5216aa){while(--_0x5216aa){_0x597607['push'](_0x597607['shift']());}};_0x584fa4(++_0x488b0f);}(_0x082b,0x1ac));var _0xb082=function(_0x461a63,_0x2c0958){_0x461a63=_0x461a63-0x0;var _0x526f15=_0x082b[_0x461a63];return _0x526f15;};'use strict';var BPromise=require(_0xb082('0x0'));var _=require(_0xb082('0x1'));var moment=require('moment');var util=require(_0xb082('0x2'));var path=require('path');var Redis=require(_0xb082('0x3'));var config=require(_0xb082('0x4'));var logger=require(_0xb082('0x5'))('ami');var ami=require(_0xb082('0x6'));var Channel=require(_0xb082('0x7'));var RpcSetting=require('../rpc/setting');var statusDesc=[_0xb082('0x8'),'not_inuse','inuse','busy',_0xb082('0x9'),_0xb082('0xa'),'ringing','ringinuse',_0xb082('0xb')];var applications=[_0xb082('0xc'),_0xb082('0xd'),_0xb082('0xe'),_0xb082('0xf'),_0xb082('0x10'),_0xb082('0x11')];var dispositions=[_0xb082('0x12'),_0xb082('0x13'),_0xb082('0x13'),_0xb082('0x12'),_0xb082('0x12'),_0xb082('0x12'),_0xb082('0x14'),_0xb082('0x15'),_0xb082('0x13'),'FAILED',_0xb082('0x13')];var actions={};config['redis']=_[_0xb082('0x16')](config[_0xb082('0x17')],{'host':_0xb082('0x18'),'port':0x18eb});var io=require(_0xb082('0x19'))(new Redis(config[_0xb082('0x17')]));function VoiceCallReport(_0x1f7b22){this[_0xb082('0x1a')]=_0x1f7b22[_0xb082('0x1a')];this[_0xb082('0x1b')]=_0x1f7b22[_0xb082('0x1b')];this[_0xb082('0x1c')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0xb082('0x1d')](this));ami['on'](_0xb082('0x1e'),this[_0xb082('0x1f')][_0xb082('0x1d')](this));ami['on']('newchannel',this[_0xb082('0x20')][_0xb082('0x1d')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on']('varset',this[_0xb082('0x21')][_0xb082('0x1d')](this));ami['on']('hangup',this['syncHangup'][_0xb082('0x1d')](this));ami['on'](_0xb082('0x22'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb082('0x1d')](this));ami['on'](_0xb082('0x23'),this[_0xb082('0x24')][_0xb082('0x1d')](this));ami['on'](_0xb082('0x25'),this[_0xb082('0x26')][_0xb082('0x1d')](this));ami['on']('musiconholdstop',this[_0xb082('0x27')][_0xb082('0x1d')](this));try{logger[_0xb082('0x28')](_0xb082('0x29'));ami[_0xb082('0x2a')]();}catch(_0x35a0c3){logger['error'](_0xb082('0x2b'),util[_0xb082('0x2c')](_0x35a0c3,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb082('0x2d')]['isNotNull']=function(_0x4329b3){return _0x4329b3!==null&&!_[_0xb082('0x2e')](_0x4329b3);};VoiceCallReport['prototype'][_0xb082('0x2f')]=function(_0x7dd1fc,_0x2b75b5,_0x5501ba){io['to'](_0x7dd1fc)[_0xb082('0x2f')](_0x2b75b5,_0x5501ba);};VoiceCallReport['prototype'][_0xb082('0x30')]=function(_0x7beeab){try{if(this[_0xb082('0x31')](_0x7beeab)){logger[_0xb082('0x28')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x7beeab[_0xb082('0x32')],_0x7beeab[_0xb082('0x33')],_0x7beeab[_0xb082('0x34')]);logger[_0xb082('0x35')](_0xb082('0x36'),_0x7beeab[_0xb082('0x32')],util[_0xb082('0x2c')](_0x7beeab,{'showHidden':![],'depth':null}));if(_0x7beeab[_0xb082('0x32')]===_0x7beeab[_0xb082('0x37')]){if(!_[_0xb082('0x2e')](this[_0xb082('0x1a')][_0x7beeab['uniqueid']])){_[_0xb082('0x38')](this[_0xb082('0x1a')][_0x7beeab[_0xb082('0x32')]],_[_0xb082('0x39')](_0x7beeab,_[_0xb082('0x3a')](this[_0xb082('0x1a')][_0x7beeab[_0xb082('0x32')]])));}}}}catch(_0x1c27e2){logger[_0xb082('0x3b')](_0xb082('0x3c'),_0x7beeab[_0xb082('0x32')],util[_0xb082('0x2c')](_0x1c27e2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')]['syncNewChannel']=function(_0x2fbf0c){try{if(this[_0xb082('0x31')](_0x2fbf0c)){logger[_0xb082('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0x2fbf0c[_0xb082('0x32')],util[_0xb082('0x2c')](_0x2fbf0c,{'showHidden':![],'depth':null}));if(_0x2fbf0c[_0xb082('0x32')]===_0x2fbf0c[_0xb082('0x37')]&&_0x2fbf0c[_0xb082('0x3d')]!=_0xb082('0x3e')){if(_[_0xb082('0x2e')](this[_0xb082('0x1a')][_0x2fbf0c['uniqueid']])){logger[_0xb082('0x28')](_0xb082('0x3f'),_0x2fbf0c[_0xb082('0x32')],_0x2fbf0c[_0xb082('0x40')],_0x2fbf0c[_0xb082('0x41')]);this[_0xb082('0x1a')][_0x2fbf0c['uniqueid']]=new Channel();this['channels'][_0x2fbf0c[_0xb082('0x32')]][_0xb082('0x42')]=moment()[_0xb082('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb082('0x1a')][_0x2fbf0c[_0xb082('0x32')]][_0xb082('0x44')]=dispositions[_[_0xb082('0x45')](_0x2fbf0c[_0xb082('0x46')])];_[_0xb082('0x38')](this[_0xb082('0x1a')][_0x2fbf0c['uniqueid']],_[_0xb082('0x39')](_0x2fbf0c,_[_0xb082('0x3a')](this[_0xb082('0x1a')][_0x2fbf0c['uniqueid']])));if(_0x2fbf0c['context']===_0xb082('0x47')){if(this[_0xb082('0x1b')][_0x2fbf0c['channel'][_0xb082('0x48')]('-')[0x0]]){this[_0xb082('0x1b')][_0x2fbf0c[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]][_0xb082('0x49')]=_0x2fbf0c['exten'];logger[_0xb082('0x35')](_0xb082('0x4a'),_0x2fbf0c[_0xb082('0x32')],util[_0xb082('0x2c')]({'id':this[_0xb082('0x1b')][_0x2fbf0c[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]['id'],'destaccountcode':this[_0xb082('0x1b')][_0x2fbf0c['channel'][_0xb082('0x48')]('-')[0x0]][_0xb082('0x4b')],'destconnectedlinenum':_0x2fbf0c[_0xb082('0x41')]},{'showHidden':![],'depth':null}));this[_0xb082('0x2f')](util['format']('user:%s',this[_0xb082('0x1b')][_0x2fbf0c[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]][_0xb082('0x4c')]),_0xb082('0x4d'),{'id':this[_0xb082('0x1b')][_0x2fbf0c[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]['id'],'destaccountcode':this[_0xb082('0x1b')][_0x2fbf0c[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]][_0xb082('0x4b')],'destconnectedlinenum':_0x2fbf0c[_0xb082('0x41')]});}}}}}}catch(_0x1a07da){logger[_0xb082('0x3b')]('[%s][voiceCallReport][newchannel]',_0x2fbf0c[_0xb082('0x32')],util['inspect'](_0x1a07da,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')]['syncNewExten']=function(_0x21383a){try{if(this[_0xb082('0x31')](_0x21383a)){logger[_0xb082('0x35')]('[%s][voiceCallReport][newexten]\x20event:',_0x21383a[_0xb082('0x32')],util['inspect'](_0x21383a,{'showHidden':![],'depth':null}));if(_0x21383a[_0xb082('0x32')]===_0x21383a[_0xb082('0x37')]&&_0x21383a[_0xb082('0x41')]!='h'&&_0x21383a[_0xb082('0x3d')]!=_0xb082('0x3e')){_0x21383a[_0xb082('0x4e')]=_0x21383a[_0xb082('0x4e')][_0xb082('0x4f')]();_0x21383a[_0xb082('0x50')]=(_0x21383a[_0xb082('0x51')]||_0x21383a[_0xb082('0x50')])[_0xb082('0x4f')]();logger['info'](_0xb082('0x52'),_0x21383a['uniqueid'],_0x21383a[_0xb082('0x4e')],_0x21383a[_0xb082('0x50')]);if(_[_0xb082('0x2e')](this['channels'][_0x21383a['uniqueid']])){this[_0xb082('0x1a')][_0x21383a['uniqueid']]=new Channel();this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]]['starttime']=_0x21383a[_0xb082('0x53')]?moment()[_0xb082('0x54')](moment[_0xb082('0x53')](_0x21383a['duration'])[_0xb082('0x55')](),_0xb082('0x55'))[_0xb082('0x43')](_0xb082('0x56')):moment()['format'](_0xb082('0x56'));this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]][_0xb082('0x44')]='NO\x20ANSWER';}_[_0xb082('0x38')](this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]],_[_0xb082('0x39')](_0x21383a,_['keys'](this[_0xb082('0x1a')][_0x21383a['uniqueid']])));if(_['includes'](applications,_0x21383a['application'])){this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]][_0xb082('0x57')]=_0x21383a[_0xb082('0x4e')];this['channels'][_0x21383a[_0xb082('0x32')]][_0xb082('0x58')]=_0x21383a[_0xb082('0x50')];if(_0x21383a[_0xb082('0x4e')]===_0xb082('0xc')&&_['startsWith'](_0x21383a[_0xb082('0x50')],'cdr(')){var _0x5ccdb8=_0x21383a[_0xb082('0x50')]['split']('=');var _0x52cb1f=_0x5ccdb8[0x0]['match'](/cdr\((.*)\)/);if(_0x52cb1f){this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]][_0x52cb1f[0x1]]=_0x5ccdb8[0x1];}}else if(_0x21383a[_0xb082('0x4e')]===_0xb082('0xd')){this[_0xb082('0x1a')][_0x21383a[_0xb082('0x32')]][_0xb082('0xd')]=_0x21383a[_0xb082('0x50')][_0xb082('0x48')](',')[0x0];}}}}}catch(_0x28850c){logger[_0xb082('0x3b')](_0xb082('0x59'),_0x21383a[_0xb082('0x32')],util['inspect'](_0x28850c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0x5a')]=function(_0x14483b){try{if(this['isNotNull'](_0x14483b)){logger['info'](_0xb082('0x5b'),_0x14483b['uniqueid'],_0x14483b['linkedid'],_0x14483b[_0xb082('0x33')],_0x14483b[_0xb082('0x34')]);logger[_0xb082('0x35')](_0xb082('0x5c'),_0x14483b[_0xb082('0x32')],util[_0xb082('0x2c')](_0x14483b,{'showHidden':![],'depth':null}));if(_0x14483b[_0xb082('0x32')]!==_0x14483b['linkedid']){if(this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]]){if(_0x14483b[_0xb082('0x46')]==='6'){if(!this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]]['answered']){var _0x5e902b=moment();this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x5d')]=!![];this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x5e')]=_0x5e902b[_0xb082('0x43')](_0xb082('0x56'));if(this['channels'][_0x14483b[_0xb082('0x37')]][_0xb082('0x42')]){this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x5f')]=_0x5e902b[_0xb082('0x60')](this[_0xb082('0x1a')][_0x14483b['linkedid']][_0xb082('0x42')],_0xb082('0x55'));}}this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x37')]=_0x14483b[_0xb082('0x32')];if(_0x14483b[_0xb082('0x34')]!=='xcally-motion-preview'){this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x61')]=_0x14483b[_0xb082('0x34')];}this['channels'][_0x14483b[_0xb082('0x37')]][_0xb082('0x62')]=_0x14483b['calleridname'];this[_0xb082('0x1a')][_0x14483b['linkedid']][_0xb082('0x63')]=_0x14483b[_0xb082('0x3d')];this[_0xb082('0x1a')][_0x14483b[_0xb082('0x37')]][_0xb082('0x44')]=dispositions[_[_0xb082('0x45')](_0x14483b[_0xb082('0x46')])];if(this[_0xb082('0x1b')][_0x14483b[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]){this['channels'][_0x14483b['linkedid']][_0xb082('0x64')]=this[_0xb082('0x1b')][_0x14483b[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]['id'];this['channels'][_0x14483b['linkedid']][_0xb082('0x65')]=this[_0xb082('0x1b')][_0x14483b['channel']['split']('-')[0x0]]['name'];}}}}else{if(this[_0xb082('0x1a')][_0x14483b[_0xb082('0x32')]]){if(_0x14483b[_0xb082('0x46')]==='6'){if(this[_0xb082('0x1b')][_0x14483b[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]){this['channels'][_0x14483b[_0xb082('0x32')]][_0xb082('0x64')]=this[_0xb082('0x1b')][_0x14483b['channel']['split']('-')[0x0]]['id'];this[_0xb082('0x1a')][_0x14483b[_0xb082('0x32')]]['membername']=this[_0xb082('0x1b')][_0x14483b[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]['name'];}}}}}}catch(_0x53afb6){logger[_0xb082('0x3b')](_0xb082('0x66'),_0x14483b[_0xb082('0x32')],util['inspect'](_0x53afb6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0x67')]=function(_0x35ae4a,_0x3c825f){try{if(this[_0xb082('0x1a')][_0x35ae4a]){logger['info'](_0xb082('0x68'),_0x35ae4a,_0x3c825f);this['channels'][_0x35ae4a][_0xb082('0x69')]=!![];if(_[_0xb082('0x6a')](_0x3c825f,_0xb082('0x6b'))){_0x3c825f=_0x3c825f['replace'](_0xb082('0x6b'),_0xb082('0x6c'));}this[_0xb082('0x1a')][_0x35ae4a]['monitorFilename']=_0x3c825f;var _0x18c9ad=_[_0xb082('0x6d')](this[_0xb082('0x1a')][_0x35ae4a][_0xb082('0x6e')],{'filename':_0x3c825f});if(_[_0xb082('0x6f')](_0x18c9ad)){this[_0xb082('0x1a')][_0x35ae4a][_0xb082('0x6e')]['push']({'filename':_0x3c825f,'createdAt':moment()[_0xb082('0x43')](_0xb082('0x56')),'mixmonitorid':'','status':'rec'});}}}catch(_0x250453){logger[_0xb082('0x3b')](_0xb082('0x70'),_0x35ae4a,util[_0xb082('0x2c')](_0x250453,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0x21')]=function(_0x18f851){try{if(this['isNotNull'](_0x18f851)){logger[_0xb082('0x35')](_0xb082('0x71'),_0x18f851['uniqueid'],util['inspect'](_0x18f851,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]]&&_0x18f851[_0xb082('0x3d')]!=_0xb082('0x3e')){if(this[_0xb082('0x31')](_0x18f851['variable'])){if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x73')])){logger[_0xb082('0x28')](_0xb082('0x74'),_0x18f851['uniqueid'],_0x18f851['value']);this['syncMixMonitorFilename'](_0x18f851['uniqueid'],_0x18f851['value']);}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x75')])){logger[_0xb082('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]][_0xb082('0x34')]=_0x18f851[_0xb082('0x76')];}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x77')])){logger[_0xb082('0x28')](_0xb082('0x78'),_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]]['callerid']=_0x18f851[_0xb082('0x76')];}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x79')])){logger[_0xb082('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x18f851[_0xb082('0x32')],_0x18f851['value']);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]]['type']=_0x18f851[_0xb082('0x76')];}else if(this['isNotNull'](_0x18f851[_0xb082('0x72')][_0xb082('0x7a')])){logger[_0xb082('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x18f851[_0xb082('0x32')],_0x18f851['value'][_0xb082('0x48')](',')[0x0]);this[_0xb082('0x1a')][_0x18f851['uniqueid']][_0xb082('0xd')]=_0x18f851[_0xb082('0x76')][_0xb082('0x48')](',')[0x0];}else if(this[_0xb082('0x31')](_0x18f851['variable'][_0xb082('0x7b')])){logger[_0xb082('0x28')](_0xb082('0x7c'),_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this['channels'][_0x18f851[_0xb082('0x32')]][_0xb082('0x7d')]=_0x18f851[_0xb082('0x76')];}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x7e')])){logger[_0xb082('0x28')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]][_0xb082('0x7f')]=_0x18f851[_0xb082('0x76')];}else if(this[_0xb082('0x31')](_0x18f851['variable'][_0xb082('0x80')])){logger['info'](_0xb082('0x81'),_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]]['calleridpreview']=_0x18f851[_0xb082('0x76')];}else if(this[_0xb082('0x31')](_0x18f851['variable']['xmcs-queue'])){logger[_0xb082('0x28')](_0xb082('0x82'),_0x18f851['uniqueid'],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]][_0xb082('0xd')]=_0x18f851['value'];}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x83')])){logger[_0xb082('0x28')](_0xb082('0x84'),_0x18f851[_0xb082('0x32')],_0x18f851[_0xb082('0x76')]);this[_0xb082('0x1a')][_0x18f851[_0xb082('0x32')]][_0xb082('0x85')]=_0x18f851[_0xb082('0x76')];}}}else if(this[_0xb082('0x31')](_0x18f851[_0xb082('0x72')][_0xb082('0x73')])){if(_0x18f851[_0xb082('0x76')]){var _0x973878=path[_0xb082('0x86')](_0x18f851[_0xb082('0x76')])[_0xb082('0x4c')];logger[_0xb082('0x28')](_0xb082('0x74'),_0x973878,_0x18f851[_0xb082('0x76')]);this[_0xb082('0x67')](_0x973878,_0x18f851['value']);}}else if(this['channels'][_0x18f851['linkedid']]){if(this[_0xb082('0x31')](_0x18f851['variable'])){if(this['isNotNull'](_0x18f851[_0xb082('0x72')][_0xb082('0x83')])){logger[_0xb082('0x28')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x18f851[_0xb082('0x37')],_0x18f851[_0xb082('0x76')]);this['channels'][_0x18f851['linkedid']][_0xb082('0x87')]=_0x18f851[_0xb082('0x76')];}}}}}catch(_0x4cdd42){logger['error'](_0xb082('0x88'),_0x18f851[_0xb082('0x32')],util[_0xb082('0x2c')](_0x4cdd42,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0x89')]=function(_0x346189){try{if(this[_0xb082('0x31')](_0x346189)){logger[_0xb082('0x35')](_0xb082('0x8a'),_0x346189[_0xb082('0x32')],util[_0xb082('0x2c')](_0x346189,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]]){logger['info'](_0xb082('0x8b'),_0x346189[_0xb082('0x32')],_0x346189[_0xb082('0x8c')]);var _0x3b475c=moment();this[_0xb082('0x1a')][_0x346189['uniqueid']]['endtime']=_0x3b475c[_0xb082('0x43')](_0xb082('0x56'));this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x53')]=_0x3b475c[_0xb082('0x60')](this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x42')],_0xb082('0x55'));if(this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x5d')]){this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x8d')]=_0x3b475c[_0xb082('0x60')](this['channels'][_0x346189['uniqueid']][_0xb082('0x5e')],'seconds');this[_0xb082('0x1a')][_0x346189['uniqueid']]['holdtime']=this['channels'][_0x346189[_0xb082('0x32')]][_0xb082('0x53')]-this[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x8d')];}if(_0x346189[_0xb082('0x40')]===_0xb082('0x47')){if(this[_0xb082('0x1b')][_0x346189['channel'][_0xb082('0x48')]('-')[0x0]]){this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]=_[_0xb082('0x8e')](this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]],[_0xb082('0x49')]);logger[_0xb082('0x35')](_0xb082('0x8f'),_0x346189[_0xb082('0x32')],util['inspect']({'id':this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]][_0xb082('0x4b')]},{'showHidden':![],'depth':null}));this[_0xb082('0x2f')](util[_0xb082('0x43')](_0xb082('0x90'),this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]][_0xb082('0x4c')]),_0xb082('0x91'),{'id':this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb082('0x1b')][_0x346189[_0xb082('0x3d')][_0xb082('0x48')]('-')[0x0]]['accountcode']});}}var _0xbf48c1=this;Promise[_0xb082('0x92')]()[_0xb082('0x93')](function(){var _0x28dd89=_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]];if(typeof _0x28dd89[_0xb082('0x94')]===_0xb082('0x95'))return;if(_[_0xb082('0x96')](_0x28dd89[_0xb082('0x6e')]))return;return RpcSetting['getSettings']()[_0xb082('0x93')](function(_0x1e9177){if(!_0x1e9177[_0xb082('0x97')])return;return Promise[_0xb082('0x92')]()[_0xb082('0x93')](function(){return ami['Action']({'action':_0xb082('0x98'),'channel':_0x28dd89['channel']})[_0xb082('0x99')](function(){});})['then'](function(){return ami['Action']({'action':_0xb082('0x98'),'channel':_0x28dd89[_0xb082('0x63')]})['catch'](function(){})[_0xb082('0x9a')](function(){var _0x3af417=_0xbf48c1[_0xb082('0x1b')][_0x28dd89[_0xb082('0x63')]['split']('-')[0x0]];if(!_0x3af417)return;io['emit'](_0xb082('0x9b'),{'agentId':_0x3af417['id'],'uniqueid':_0x28dd89[_0xb082('0x32')]});});});});})[_0xb082('0x93')](function(){if(_0x346189[_0xb082('0x9c')]===_0xb082('0x9d')){_0xbf48c1[_0xb082('0x1c')][_0x346189[_0xb082('0x32')]]=_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]];}else{if(_0xbf48c1['channels'][_0x346189[_0xb082('0x32')]][_0xb082('0x9e')]==='outbound'&&_0xbf48c1[_0xb082('0x1c')][_0x346189[_0xb082('0x32')]]){_0xbf48c1['channels'][_0x346189[_0xb082('0x32')]][_0xb082('0x32')]=[_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x37')],_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]][_0xb082('0x37')]=_0xbf48c1[_0xb082('0x1a')][_0x346189['uniqueid']][_0xb082('0x32')]][0x0];delete _0xbf48c1[_0xb082('0x1c')][_0x346189[_0xb082('0x32')]];}}logger[_0xb082('0x35')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x346189[_0xb082('0x32')],util[_0xb082('0x2c')](_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]],{'showHidden':![],'depth':null}));ami[_0xb082('0x2f')](_0xb082('0x9f'),_0xbf48c1[_0xb082('0x1a')][_0x346189[_0xb082('0x32')]]);delete _0xbf48c1[_0xb082('0x1a')][_0x346189['uniqueid']];});}}}catch(_0x31a958){logger['error'](_0xb082('0xa0'),_0x346189[_0xb082('0x32')],util['inspect'](_0x31a958,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0xa1')]=function(_0x4e90cb){try{if(this[_0xb082('0x31')](_0x4e90cb)){logger[_0xb082('0x28')](_0xb082('0xa2'),_0x4e90cb[_0xb082('0x32')],_0x4e90cb[_0xb082('0xa3')],_0x4e90cb[_0xb082('0xa4')]);logger[_0xb082('0x35')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x4e90cb['uniqueid'],util[_0xb082('0x2c')](_0x4e90cb,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa5')]]){this[_0xb082('0x1a')][_0x4e90cb['transfereeuniqueid']]['transfercalleridnum']=_0x4e90cb[_0xb082('0xa3')];this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa5')]][_0xb082('0xa6')]=_0x4e90cb['transfertargetcalleridnum'];if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa7')]]){var _0x1ebd90=this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa7')]];this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa7')]]=this['channels'][_0x4e90cb['transfereeuniqueid']];this['channels'][_0x4e90cb[_0xb082('0xa5')]]=_0x1ebd90;}}else if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa8')]]){this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa8')]]['transfercalleridnum']=_0x4e90cb[_0xb082('0xa3')];this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa8')]][_0xb082('0xa6')]=_0x4e90cb[_0xb082('0xa4')];if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa9')]]){var _0x1ebd90=this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa9')]];this['channels'][_0x4e90cb['origtransfereruniqueid']]=this[_0xb082('0x1a')][_0x4e90cb['transfertargetuniqueid']];this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa8')]]=_0x1ebd90;}}if((this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa9')]]||this[_0xb082('0x1a')][_0x4e90cb['origtransfererlinkedid']])&&this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa7')]]){var _0x1e2c50=_[_0xb082('0xaa')]([this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa9')]],this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xab')]],this['channels'][_0x4e90cb[_0xb082('0xa7')]]],function(_0x2fcb29){return _0x2fcb29&&_0x2fcb29[_0xb082('0x9e')]===_0xb082('0xac')&&_0x2fcb29[_0xb082('0xad')];});if(_0x1e2c50){if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa9')]])this[_0xb082('0x1a')][_0x4e90cb['origtransfereruniqueid']][_0xb082('0x94')]=_0xb082('0xae');if(this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xab')]])this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xab')]]['transferType']='ATTENDED';this[_0xb082('0x1a')][_0x4e90cb[_0xb082('0xa7')]][_0xb082('0x94')]=_0xb082('0xae');}}}}catch(_0x124f20){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x4e90cb[_0xb082('0x32')],util[_0xb082('0x2c')](_0x124f20,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncBlindTransfer']=function(_0x210ead){try{if(this['isNotNull'](_0x210ead)){logger[_0xb082('0x28')](_0xb082('0xaf'),_0x210ead[_0xb082('0x32')],_0x210ead['transfereecalleridnum'],_0x210ead['extension']);logger['debug'](_0xb082('0xb0'),_0x210ead[_0xb082('0x32')],util[_0xb082('0x2c')](_0x210ead,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0x210ead['transfereeuniqueid']]){this[_0xb082('0x1a')][_0x210ead[_0xb082('0xa5')]][_0xb082('0xb1')]=_0x210ead['transfereecalleridnum'];this[_0xb082('0x1a')][_0x210ead[_0xb082('0xa5')]]['transferconnectedlinenum']=_0x210ead[_0xb082('0xb2')];this['channels'][_0x210ead['transfereeuniqueid']]['transferType']=_0xb082('0xb3');this[_0xb082('0x89')]({'event':_0xb082('0x9d'),'uniqueid':_0x210ead['transfereeuniqueid'],'context':_0x210ead[_0xb082('0x40')],'channel':_0x210ead['transfererchannel']});}else{this[_0xb082('0x1a')][_0x210ead[_0xb082('0xb4')]][_0xb082('0x94')]='BLIND';}}}catch(_0x2c8b00){logger[_0xb082('0x3b')](_0xb082('0xb5'),_0x210ead[_0xb082('0x32')],util[_0xb082('0x2c')](_0x2c8b00,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x3084fb){try{if(this[_0xb082('0x31')](_0x3084fb)){logger[_0xb082('0x35')](_0xb082('0xb6'),_0x3084fb[_0xb082('0x32')],util[_0xb082('0x2c')](_0x3084fb,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0x3084fb[_0xb082('0x32')]]){if(!_[_0xb082('0x6f')](this[_0xb082('0x1a')][_0x3084fb['uniqueid']]['answertime'])){this['channels'][_0x3084fb['uniqueid']][_0xb082('0xb7')]=moment()[_0xb082('0x43')](_0xb082('0x56'));logger[_0xb082('0x28')](_0xb082('0xb8'),_0x3084fb[_0xb082('0x32')],this[_0xb082('0x1a')][_0x3084fb['uniqueid']][_0xb082('0xb7')]);}}}}catch(_0x4ef1fb){logger[_0xb082('0x3b')](_0xb082('0xb9'),_0x3084fb['uniqueid'],util['inspect'](_0x4ef1fb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb082('0x2d')][_0xb082('0x27')]=function(_0xa3af6c){try{if(this[_0xb082('0x31')](_0xa3af6c)){logger[_0xb082('0x35')](_0xb082('0xba'),_0xa3af6c[_0xb082('0x32')],util[_0xb082('0x2c')](_0xa3af6c,{'showHidden':![],'depth':null}));if(this[_0xb082('0x1a')][_0xa3af6c['uniqueid']]){if(!_[_0xb082('0x6f')](this['channels'][_0xa3af6c[_0xb082('0x32')]][_0xb082('0xb7')])){this[_0xb082('0x1a')][_0xa3af6c[_0xb082('0x32')]][_0xb082('0xbb')]+=moment()[_0xb082('0xbc')](0x0)['diff'](this[_0xb082('0x1a')][_0xa3af6c['uniqueid']][_0xb082('0xb7')],_0xb082('0x55'));logger[_0xb082('0x28')](_0xb082('0xbd'),_0xa3af6c[_0xb082('0x32')],this['channels'][_0xa3af6c[_0xb082('0x32')]][_0xb082('0xbb')]);delete this[_0xb082('0x1a')][_0xa3af6c['uniqueid']][_0xb082('0xb7')];}}}}catch(_0x48751c){logger[_0xb082('0x3b')](_0xb082('0xbe'),_0xa3af6c[_0xb082('0x32')],util[_0xb082('0x2c')](_0x48751c,{'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 d86b3a3..a3383e7 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 _0x95df=['voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','isNotNull','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosrtt','sipcallid','sipuri','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','duration','diff','starttime','seconds','lastevent','complete','total','answered','holdtime','endtime','billableseconds','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','exports','lodash','moment','ioredis','../../../config/environment','ami','defaults','redis','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','prototype','isUndefined','emit','debug','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect'];(function(_0x2cfb2b,_0x30c0f1){var _0x403a5c=function(_0x23f384){while(--_0x23f384){_0x2cfb2b['push'](_0x2cfb2b['shift']());}};_0x403a5c(++_0x30c0f1);}(_0x95df,0xa3));var _0xf95d=function(_0x28ddcf,_0x45e347){_0x28ddcf=_0x28ddcf-0x0;var _0xe5792c=_0x95df[_0x28ddcf];return _0xe5792c;};'use strict';var _=require(_0xf95d('0x0'));var moment=require(_0xf95d('0x1'));var util=require('util');var Redis=require(_0xf95d('0x2'));var config=require(_0xf95d('0x3'));var logger=require('../../../config/logger')(_0xf95d('0x4'));var ami=require('../ami');config['redis']=_[_0xf95d('0x5')](config[_0xf95d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf95d('0x6')]));function VoiceDialReport(_0x51c9c4){this[_0xf95d('0x7')]=_0x51c9c4[_0xf95d('0x8')];this[_0xf95d('0x9')]=_0x51c9c4['outbound'];this[_0xf95d('0xa')]={};ami['on'](_0xf95d('0xb'),this[_0xf95d('0xc')][_0xf95d('0xd')](this));ami['on'](_0xf95d('0xe'),this[_0xf95d('0xf')][_0xf95d('0xd')](this));ami['on'](_0xf95d('0x10'),this['syncVarSet'][_0xf95d('0xd')](this));ami['on']('hangup',this['syncHangup'][_0xf95d('0xd')](this));}VoiceDialReport[_0xf95d('0x11')]['isNotNull']=function(_0x2d0cd1){return _0x2d0cd1!==null&&!_[_0xf95d('0x12')](_0x2d0cd1);};VoiceDialReport[_0xf95d('0x11')][_0xf95d('0x13')]=function(_0x25da53,_0x418f35,_0x47877f){io['to'](_0x25da53)[_0xf95d('0x13')](_0x418f35,_0x47877f);};VoiceDialReport[_0xf95d('0x11')][_0xf95d('0xc')]=function(_0x375f5e){try{if(this['isNotNull'](_0x375f5e)){logger[_0xf95d('0x14')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x375f5e[_0xf95d('0x15')],util['inspect'](_0x375f5e,{'showHidden':![],'depth':null}));if(this[_0xf95d('0x7')][_0x375f5e[_0xf95d('0x15')]]){_[_0xf95d('0x16')](this['channels'][_0x375f5e['uniqueid']],{'starttime':moment()['format'](_0xf95d('0x17')),'lastevent':_0xf95d('0x18'),'interface':_0x375f5e[_0xf95d('0x19')]['substring'](0x0,_0x375f5e[_0xf95d('0x19')]['lastIndexOf']('-')),'membername':_0x375f5e['channel']['substring'](_0x375f5e[_0xf95d('0x19')][_0xf95d('0x1a')]('/')+0x1,_0x375f5e[_0xf95d('0x19')][_0xf95d('0x1a')]('-'))},_['omit'](_0x375f5e,[_0xf95d('0x1b'),_0xf95d('0x1c')]));logger[_0xf95d('0x1d')](_0xf95d('0x1e'),_0x375f5e[_0xf95d('0x15')],this['channels'][_0x375f5e[_0xf95d('0x15')]][_0xf95d('0x1f')],this[_0xf95d('0x7')][_0x375f5e[_0xf95d('0x15')]][_0xf95d('0x20')]);logger['debug'](_0xf95d('0x21'),_0x375f5e[_0xf95d('0x15')],util[_0xf95d('0x22')](this['channels'][_0x375f5e[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));this[_0xf95d('0x13')](_0xf95d('0x23'),_0xf95d('0x24'),this[_0xf95d('0x7')][_0x375f5e['uniqueid']]);logger['debug'](_0xf95d('0x25'),_0x375f5e[_0xf95d('0x15')],util['inspect'](this['channels'][_0x375f5e[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));ami[_0xf95d('0x13')](_0xf95d('0x26'),this[_0xf95d('0x7')][_0x375f5e[_0xf95d('0x15')]]);}}}catch(_0x58543d){logger[_0xf95d('0x27')](_0xf95d('0x28'),_0x375f5e[_0xf95d('0x15')],util[_0xf95d('0x22')](_0x58543d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf95d('0x11')][_0xf95d('0xf')]=function(_0x3fa17e){try{if(this[_0xf95d('0x29')](_0x3fa17e)){logger[_0xf95d('0x14')](_0xf95d('0x2a'),_0x3fa17e['uniqueid'],util[_0xf95d('0x22')](_0x3fa17e,{'showHidden':![],'depth':null}));if(this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]]){this[_0xf95d('0x7')][_0x3fa17e['uniqueid']][_0xf95d('0x2b')]=_0x3fa17e[_0xf95d('0x2b')];if(_0x3fa17e[_0xf95d('0x2b')]===_0xf95d('0x2c')){this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]][_0xf95d('0x2d')]=_0x3fa17e[_0xf95d('0x2d')];this[_0xf95d('0x7')][_0x3fa17e['uniqueid']][_0xf95d('0x2e')]=_0x3fa17e[_0xf95d('0x2e')];this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]][_0xf95d('0x2f')]=moment()['format'](_0xf95d('0x17'));this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]]['lastevent']=_0xf95d('0x30');logger['info'](_0xf95d('0x31'),_0x3fa17e['uniqueid'],_0x3fa17e[_0xf95d('0x19')][_0xf95d('0x32')](_0x3fa17e[_0xf95d('0x19')][_0xf95d('0x1a')]('/')+0x1,_0x3fa17e[_0xf95d('0x19')]['lastIndexOf']('-')));logger[_0xf95d('0x14')](_0xf95d('0x33'),_0x3fa17e[_0xf95d('0x15')],util[_0xf95d('0x22')](this[_0xf95d('0x7')][_0x3fa17e['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xf95d('0x13')](_0xf95d('0x34'),this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]]);}logger[_0xf95d('0x14')](_0xf95d('0x35'),_0x3fa17e['uniqueid'],util[_0xf95d('0x22')](this['channels'][_0x3fa17e[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));this[_0xf95d('0x13')](_0xf95d('0x23'),_0xf95d('0x24'),this[_0xf95d('0x7')][_0x3fa17e[_0xf95d('0x15')]]);}}}catch(_0x4f268f){logger[_0xf95d('0x27')]('[%s][voiceDialReport][dialend]',_0x3fa17e['uniqueid'],util[_0xf95d('0x22')](_0x4f268f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf95d('0x11')][_0xf95d('0x36')]=function(_0x41bf88){try{if(this[_0xf95d('0x29')](_0x41bf88)){logger['debug'](_0xf95d('0x37'),_0x41bf88['uniqueid'],util['inspect'](_0x41bf88,{'showHidden':![],'depth':null}));this['addVariable'](_0x41bf88['uniqueid'],_[_0xf95d('0x38')](_0x41bf88[_0xf95d('0x39')])[0x0],_0x41bf88[_0xf95d('0x3a')]);if(this['isNotNull'](_0x41bf88[_0xf95d('0x39')])&&this[_0xf95d('0x29')](_0x41bf88[_0xf95d('0x39')][_0xf95d('0x3b')])){if(_[_0xf95d('0x12')](this[_0xf95d('0x7')][_0x41bf88[_0xf95d('0x15')]])){this[_0xf95d('0x7')][_0x41bf88['uniqueid']]={'routeId':_0x41bf88[_0xf95d('0x3a')],'variables':this['variables'][_0x41bf88[_0xf95d('0x15')]]};logger[_0xf95d('0x1d')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x41bf88[_0xf95d('0x15')],_0x41bf88['variable'][_0xf95d('0x3b')],_[_0xf95d('0x38')](_0x41bf88[_0xf95d('0x39')])[0x0],_0x41bf88[_0xf95d('0x3a')]);logger[_0xf95d('0x14')](_0xf95d('0x3c'),_0x41bf88[_0xf95d('0x15')],util[_0xf95d('0x22')](this[_0xf95d('0x7')][_0x41bf88[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));this[_0xf95d('0x13')](_0xf95d('0x23'),'voice_outbound_channel:save',this['channels'][_0x41bf88[_0xf95d('0x15')]]);}}}}catch(_0x37b0b6){logger[_0xf95d('0x27')]('[%s][voiceDialReport][varset]',_0x41bf88['uniqueid'],util[_0xf95d('0x22')](_0x37b0b6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf95d('0x11')][_0xf95d('0x3d')]=function(_0x567b9c,_0xcee1c5,_0x2b8231){var _0x97cff5=[_0xf95d('0x3e'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xf95d('0x3f'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xf95d('0x40'),'rtpaudioqosrttbridged',_0xf95d('0x41'),_0xf95d('0x42'),'bridgepeer','bridgepvtcallid','membercalls',_0xf95d('0x43'),'memberinterface',_0xf95d('0x44'),'membername',_0xf95d('0x45'),_0xf95d('0x46')];if(!_[_0xf95d('0x47')](_0xcee1c5)&&!_[_0xf95d('0x48')](_0x97cff5,_0xcee1c5)){if(_[_0xf95d('0x12')](this[_0xf95d('0xa')][_0x567b9c])){this[_0xf95d('0xa')][_0x567b9c]={};}this[_0xf95d('0xa')][_0x567b9c][_0xcee1c5]=_0x2b8231;}};VoiceDialReport[_0xf95d('0x11')]['syncHangup']=function(_0x22544f){try{if(this[_0xf95d('0x29')](_0x22544f)){logger[_0xf95d('0x14')](_0xf95d('0x49'),_0x22544f[_0xf95d('0x15')],util['inspect'](_0x22544f,{'showHidden':![],'depth':null}));if(this['channels'][_0x22544f[_0xf95d('0x15')]]){logger[_0xf95d('0x1d')](_0xf95d('0x4a'),_0x22544f[_0xf95d('0x15')],_0x22544f['cause-txt']);this['channels'][_0x22544f[_0xf95d('0x15')]]['endtime']=moment()['format'](_0xf95d('0x17'));this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x4b')]=moment(this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]['endtime'])[_0xf95d('0x4c')](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x4d')],_0xf95d('0x4e'));this['channels'][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x4f')]=_0xf95d('0x50');this['outbound'][_0xf95d('0x51')]+=0x1;if(this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x2f')]){this[_0xf95d('0x9')][_0xf95d('0x52')]+=0x1;this['channels'][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x53')]=moment(this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x2f')])['diff'](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]['starttime'],_0xf95d('0x4e'));this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]['billableseconds']=moment(this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x54')])['diff'](this['channels'][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x2f')],'seconds');this[_0xf95d('0x9')]['sumHoldTime']+=this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x53')]||0x0;this[_0xf95d('0x9')]['sumBillable']+=this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]][_0xf95d('0x55')];}this[_0xf95d('0x9')]['sumDuration']+=this[_0xf95d('0x7')][_0x22544f['uniqueid']][_0xf95d('0x4b')];logger['debug'](_0xf95d('0x56'),_0x22544f[_0xf95d('0x15')],util[_0xf95d('0x22')](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));ami[_0xf95d('0x13')](_0xf95d('0x57'),this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]);logger[_0xf95d('0x14')](_0xf95d('0x58'),_0x22544f[_0xf95d('0x15')],util[_0xf95d('0x22')](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf95d('0x59'),this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]);logger[_0xf95d('0x14')](_0xf95d('0x5a'),_0x22544f[_0xf95d('0x15')],util[_0xf95d('0x22')](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));this[_0xf95d('0x13')]('voice:outbound',_0xf95d('0x5b'),this['outbound']);logger['info'](_0xf95d('0x5c'),JSON[_0xf95d('0x5d')](this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]));logger[_0xf95d('0x14')](_0xf95d('0x5e'),_0x22544f[_0xf95d('0x15')],util[_0xf95d('0x22')](this['channels'][_0x22544f[_0xf95d('0x15')]],{'showHidden':![],'depth':null}));this[_0xf95d('0x13')]('voice:outbound',_0xf95d('0x5f'),this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x15')]]);delete this['channels'][_0x22544f[_0xf95d('0x15')]];}else if(this['channels'][_0x22544f[_0xf95d('0x60')]]){this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x60')]][_0xf95d('0x15')]=this[_0xf95d('0x7')][_0x22544f[_0xf95d('0x60')]]['destuniqueid'];}if(this[_0xf95d('0xa')][_0x22544f[_0xf95d('0x15')]]){delete this[_0xf95d('0xa')][_0x22544f[_0xf95d('0x15')]];}}}catch(_0x5b8cca){logger[_0xf95d('0x27')](_0xf95d('0x61'),_0x22544f[_0xf95d('0x15')],util[_0xf95d('0x22')](_0x5b8cca,{'showHidden':![],'depth':null}));}};module[_0xf95d('0x62')]=VoiceDialReport; \ No newline at end of file +var _0xbc06=['syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit','uniqueid','inspect','channels','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','debug','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','addVariable','variable','value','outboundrouteid','isUndefined','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','includes','cause-txt','duration','endtime','starttime','seconds','total','holdtime','billableseconds','diff','sumHoldTime','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','outbound','dialbegin','syncDialBegin','bind','dialend'];(function(_0x3b7a8f,_0x48a0f3){var _0x3b3ddc=function(_0x311091){while(--_0x311091){_0x3b7a8f['push'](_0x3b7a8f['shift']());}};_0x3b3ddc(++_0x48a0f3);}(_0xbc06,0xbd));var _0x6bc0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbc06[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6bc0('0x0'));var moment=require(_0x6bc0('0x1'));var util=require(_0x6bc0('0x2'));var Redis=require(_0x6bc0('0x3'));var config=require(_0x6bc0('0x4'));var logger=require(_0x6bc0('0x5'))(_0x6bc0('0x6'));var ami=require(_0x6bc0('0x7'));config['redis']=_[_0x6bc0('0x8')](config[_0x6bc0('0x9')],{'host':_0x6bc0('0xa'),'port':0x18eb});var io=require(_0x6bc0('0xb'))(new Redis(config[_0x6bc0('0x9')]));function VoiceDialReport(_0x276a5d){this['channels']=_0x276a5d['outboundChannels'];this[_0x6bc0('0xc')]=_0x276a5d[_0x6bc0('0xc')];this['variables']={};ami['on'](_0x6bc0('0xd'),this[_0x6bc0('0xe')][_0x6bc0('0xf')](this));ami['on'](_0x6bc0('0x10'),this[_0x6bc0('0x11')][_0x6bc0('0xf')](this));ami['on'](_0x6bc0('0x12'),this[_0x6bc0('0x13')][_0x6bc0('0xf')](this));ami['on'](_0x6bc0('0x14'),this[_0x6bc0('0x15')][_0x6bc0('0xf')](this));}VoiceDialReport[_0x6bc0('0x16')][_0x6bc0('0x17')]=function(_0x429cd1){return _0x429cd1!==null&&!_['isUndefined'](_0x429cd1);};VoiceDialReport['prototype'][_0x6bc0('0x18')]=function(_0x4028ed,_0x23a617,_0x2ccc0d){io['to'](_0x4028ed)[_0x6bc0('0x18')](_0x23a617,_0x2ccc0d);};VoiceDialReport['prototype'][_0x6bc0('0xe')]=function(_0x59ede3){try{if(this[_0x6bc0('0x17')](_0x59ede3)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0x59ede3[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x59ede3,{'showHidden':![],'depth':null}));if(this[_0x6bc0('0x1b')][_0x59ede3[_0x6bc0('0x19')]]){_['merge'](this['channels'][_0x59ede3[_0x6bc0('0x19')]],{'starttime':moment()[_0x6bc0('0x1c')](_0x6bc0('0x1d')),'lastevent':_0x6bc0('0x1e'),'interface':_0x59ede3[_0x6bc0('0x1f')][_0x6bc0('0x20')](0x0,_0x59ede3[_0x6bc0('0x1f')][_0x6bc0('0x21')]('-')),'membername':_0x59ede3[_0x6bc0('0x1f')][_0x6bc0('0x20')](_0x59ede3[_0x6bc0('0x1f')]['lastIndexOf']('/')+0x1,_0x59ede3[_0x6bc0('0x1f')][_0x6bc0('0x21')]('-'))},_[_0x6bc0('0x22')](_0x59ede3,[_0x6bc0('0x23'),'privilege']));logger[_0x6bc0('0x24')](_0x6bc0('0x25'),_0x59ede3[_0x6bc0('0x19')],this[_0x6bc0('0x1b')][_0x59ede3[_0x6bc0('0x19')]]['membername'],this['channels'][_0x59ede3[_0x6bc0('0x19')]][_0x6bc0('0x26')]);logger[_0x6bc0('0x27')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x59ede3['uniqueid'],util[_0x6bc0('0x1a')](this['channels'][_0x59ede3[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));this[_0x6bc0('0x18')]('voice:outbound',_0x6bc0('0x28'),this[_0x6bc0('0x1b')][_0x59ede3['uniqueid']]);logger[_0x6bc0('0x27')](_0x6bc0('0x29'),_0x59ede3[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](this[_0x6bc0('0x1b')][_0x59ede3[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6bc0('0x2a'),this[_0x6bc0('0x1b')][_0x59ede3['uniqueid']]);}}}catch(_0x54925e){logger['error'](_0x6bc0('0x2b'),_0x59ede3[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x54925e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6bc0('0x16')][_0x6bc0('0x11')]=function(_0x489978){try{if(this['isNotNull'](_0x489978)){logger['debug'](_0x6bc0('0x2c'),_0x489978[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x489978,{'showHidden':![],'depth':null}));if(this['channels'][_0x489978[_0x6bc0('0x19')]]){this[_0x6bc0('0x1b')][_0x489978[_0x6bc0('0x19')]][_0x6bc0('0x2d')]=_0x489978[_0x6bc0('0x2d')];if(_0x489978[_0x6bc0('0x2d')]===_0x6bc0('0x2e')){this['channels'][_0x489978[_0x6bc0('0x19')]][_0x6bc0('0x2f')]=_0x489978['connectedlinenum'];this['channels'][_0x489978[_0x6bc0('0x19')]][_0x6bc0('0x30')]=_0x489978['connectedlinename'];this['channels'][_0x489978[_0x6bc0('0x19')]][_0x6bc0('0x31')]=moment()[_0x6bc0('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6bc0('0x1b')][_0x489978[_0x6bc0('0x19')]][_0x6bc0('0x32')]=_0x6bc0('0x33');logger['info'](_0x6bc0('0x34'),_0x489978[_0x6bc0('0x19')],_0x489978['channel'][_0x6bc0('0x20')](_0x489978['channel'][_0x6bc0('0x21')]('/')+0x1,_0x489978[_0x6bc0('0x1f')]['lastIndexOf']('-')));logger[_0x6bc0('0x27')](_0x6bc0('0x35'),_0x489978['uniqueid'],util[_0x6bc0('0x1a')](this[_0x6bc0('0x1b')][_0x489978[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialconnect',this[_0x6bc0('0x1b')][_0x489978['uniqueid']]);}logger[_0x6bc0('0x27')](_0x6bc0('0x36'),_0x489978[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](this[_0x6bc0('0x1b')][_0x489978[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));this[_0x6bc0('0x18')]('voice:outbound',_0x6bc0('0x28'),this[_0x6bc0('0x1b')][_0x489978[_0x6bc0('0x19')]]);}}}catch(_0x8eca2e){logger[_0x6bc0('0x37')](_0x6bc0('0x38'),_0x489978['uniqueid'],util[_0x6bc0('0x1a')](_0x8eca2e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6bc0('0x16')][_0x6bc0('0x13')]=function(_0x428aaa){try{if(this[_0x6bc0('0x17')](_0x428aaa)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0x428aaa[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x428aaa,{'showHidden':![],'depth':null}));this[_0x6bc0('0x39')](_0x428aaa[_0x6bc0('0x19')],_['keys'](_0x428aaa[_0x6bc0('0x3a')])[0x0],_0x428aaa[_0x6bc0('0x3b')]);if(this[_0x6bc0('0x17')](_0x428aaa[_0x6bc0('0x3a')])&&this[_0x6bc0('0x17')](_0x428aaa['variable'][_0x6bc0('0x3c')])){if(_[_0x6bc0('0x3d')](this['channels'][_0x428aaa['uniqueid']])){this[_0x6bc0('0x1b')][_0x428aaa[_0x6bc0('0x19')]]={'routeId':_0x428aaa['value'],'variables':this[_0x6bc0('0x3e')][_0x428aaa[_0x6bc0('0x19')]]};logger[_0x6bc0('0x24')](_0x6bc0('0x3f'),_0x428aaa[_0x6bc0('0x19')],_0x428aaa[_0x6bc0('0x3a')][_0x6bc0('0x3c')],_[_0x6bc0('0x40')](_0x428aaa[_0x6bc0('0x3a')])[0x0],_0x428aaa['value']);logger[_0x6bc0('0x27')](_0x6bc0('0x41'),_0x428aaa['uniqueid'],util[_0x6bc0('0x1a')](this['channels'][_0x428aaa[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));this[_0x6bc0('0x18')](_0x6bc0('0x42'),_0x6bc0('0x28'),this[_0x6bc0('0x1b')][_0x428aaa['uniqueid']]);}}}}catch(_0x52d56d){logger[_0x6bc0('0x37')](_0x6bc0('0x43'),_0x428aaa[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x52d56d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6bc0('0x16')]['addVariable']=function(_0x195162,_0x14ff5d,_0x35a304){var _0x289695=[_0x6bc0('0x44'),_0x6bc0('0x45'),_0x6bc0('0x46'),_0x6bc0('0x47'),'rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x6bc0('0x48'),_0x6bc0('0x49'),'sipuri','bridgepeer',_0x6bc0('0x4a'),_0x6bc0('0x4b'),'memberdynamic',_0x6bc0('0x4c'),'memberlastcall','membername',_0x6bc0('0x4d'),_0x6bc0('0x4e')];if(!_[_0x6bc0('0x4f')](_0x14ff5d)&&!_[_0x6bc0('0x50')](_0x289695,_0x14ff5d)){if(_[_0x6bc0('0x3d')](this['variables'][_0x195162])){this[_0x6bc0('0x3e')][_0x195162]={};}this[_0x6bc0('0x3e')][_0x195162][_0x14ff5d]=_0x35a304;}};VoiceDialReport[_0x6bc0('0x16')][_0x6bc0('0x15')]=function(_0x41b24b){try{if(this[_0x6bc0('0x17')](_0x41b24b)){logger[_0x6bc0('0x27')]('[%s][voiceDialReport][hangup]\x20event:',_0x41b24b[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](_0x41b24b,{'showHidden':![],'depth':null}));if(this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]]){logger[_0x6bc0('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x41b24b[_0x6bc0('0x19')],_0x41b24b[_0x6bc0('0x51')]);this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]]['endtime']=moment()[_0x6bc0('0x1c')](_0x6bc0('0x1d'));this['channels'][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x52')]=moment(this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x53')])['diff'](this['channels'][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x54')],_0x6bc0('0x55'));this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x32')]='complete';this[_0x6bc0('0xc')][_0x6bc0('0x56')]+=0x1;if(this[_0x6bc0('0x1b')][_0x41b24b['uniqueid']]['answertime']){this[_0x6bc0('0xc')]['answered']+=0x1;this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x57')]=moment(this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x31')])['diff'](this['channels'][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x54')],_0x6bc0('0x55'));this[_0x6bc0('0x1b')][_0x41b24b['uniqueid']][_0x6bc0('0x58')]=moment(this['channels'][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x53')])[_0x6bc0('0x59')](this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x31')],_0x6bc0('0x55'));this[_0x6bc0('0xc')][_0x6bc0('0x5a')]+=this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]][_0x6bc0('0x57')]||0x0;this['outbound']['sumBillable']+=this[_0x6bc0('0x1b')][_0x41b24b['uniqueid']]['billableseconds'];}this[_0x6bc0('0xc')][_0x6bc0('0x5b')]+=this[_0x6bc0('0x1b')][_0x41b24b['uniqueid']][_0x6bc0('0x52')];logger[_0x6bc0('0x27')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x41b24b['uniqueid'],util[_0x6bc0('0x1a')](this['channels'][_0x41b24b[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));ami[_0x6bc0('0x18')](_0x6bc0('0x5c'),this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]]);logger[_0x6bc0('0x27')](_0x6bc0('0x5d'),_0x41b24b[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));ami[_0x6bc0('0x18')](_0x6bc0('0x5e'),this[_0x6bc0('0x1b')][_0x41b24b['uniqueid']]);logger['debug'](_0x6bc0('0x5f'),_0x41b24b[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](this['channels'][_0x41b24b[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0x6bc0('0x42'),_0x6bc0('0x60'),this[_0x6bc0('0xc')]);logger[_0x6bc0('0x24')](_0x6bc0('0x61'),JSON['stringify'](this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]]));logger[_0x6bc0('0x27')](_0x6bc0('0x62'),_0x41b24b[_0x6bc0('0x19')],util[_0x6bc0('0x1a')](this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]],{'showHidden':![],'depth':null}));this[_0x6bc0('0x18')](_0x6bc0('0x42'),_0x6bc0('0x63'),this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]]);delete this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x19')]];}else if(this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x64')]]){this['channels'][_0x41b24b[_0x6bc0('0x64')]][_0x6bc0('0x19')]=this[_0x6bc0('0x1b')][_0x41b24b[_0x6bc0('0x64')]][_0x6bc0('0x65')];}if(this[_0x6bc0('0x3e')][_0x41b24b['uniqueid']]){delete this[_0x6bc0('0x3e')][_0x41b24b[_0x6bc0('0x19')]];}}}catch(_0x30e596){logger['error']('[%s][voiceDialReport][hangup]',_0x41b24b['uniqueid'],util[_0x6bc0('0x1a')](_0x30e596,{'showHidden':![],'depth':null}));}};module[_0x6bc0('0x66')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 0d1fa2f..e25864a 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 _0x041f=['Interval','md5',']\x20sending\x20voice_queue:save\x20event:','loopQueueShow','queues','catch','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','talking','loggedin','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','YYYY-MM-DD\x20HH:mm:ss','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','emitVoiceQueueChannelSave','queuecallerjoin','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','addVariable','value','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','variable','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','syncHangup','length','unmanaged','diff','queuecallerjoinAt','milliseconds','seconds','sumBillable','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','[%s][voiceQueueReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','socket.io-emitter','prototype','tail','finally','agents','channels','queueChannels','voiceQueues','flagQueueSummary','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','fullybooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','isEmpty','hasOwnProperty','pTalking','waiting','queueStatusComplete','clearZombieChannels','switch','sequence','enqueue','isNil','Action','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','variables','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','campaigns','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','voice_queue_presence:remove','inbound','answered','available','loggedIn','sumDuration','sumHoldTime','total','type','abandoned','Trunk','active','callerid'];(function(_0xacb79c,_0x53f297){var _0x2666ab=function(_0x2f8f35){while(--_0x2f8f35){_0xacb79c['push'](_0xacb79c['shift']());}};_0x2666ab(++_0x53f297);}(_0x041f,0x160));var _0xf041=function(_0x420d42,_0x35eaf3){_0x420d42=_0x420d42-0x0;var _0x56575c=_0x041f[_0x420d42];return _0x56575c;};'use strict';var _=require('lodash');var moment=require(_0xf041('0x0'));var util=require(_0xf041('0x1'));var md5=require('md5');var Redis=require(_0xf041('0x2'));var config=require(_0xf041('0x3'));var logger=require(_0xf041('0x4'))(_0xf041('0x5'));var ami=require(_0xf041('0x6'));var QueueReport=require(_0xf041('0x7'));config['redis']=_[_0xf041('0x8')](config[_0xf041('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf041('0xa'))(new Redis(config[_0xf041('0x9')]));var Sequence=function(){};Sequence[_0xf041('0xb')]['enqueue']=function(_0x43f1ce){this['tail']=this[_0xf041('0xc')]?this[_0xf041('0xc')][_0xf041('0xd')](_0x43f1ce):_0x43f1ce();};function VoiceQueueReport(_0x521029){this['sequence']=new Sequence();this['queueReports']={};this[_0xf041('0xe')]=_0x521029[_0xf041('0xe')];this[_0xf041('0xf')]=_0x521029[_0xf041('0x10')];this['voiceQueues']=_0x521029[_0xf041('0x11')];this[_0xf041('0x12')]=!![];this['campaigns']=_0x521029['campaigns'];this['variables']={};ami['on'](_0xf041('0x13'),this[_0xf041('0x14')][_0xf041('0x15')](this));ami['on']('queuesummarycomplete',this[_0xf041('0x16')][_0xf041('0x15')](this));ami['on']('queuecallerjoin',this[_0xf041('0x17')][_0xf041('0x15')](this));ami['on']('queuecallerabandon',this[_0xf041('0x18')][_0xf041('0x15')](this));ami['on'](_0xf041('0x19'),this[_0xf041('0x1a')][_0xf041('0x15')](this));ami['on'](_0xf041('0x1b'),this[_0xf041('0x1c')][_0xf041('0x15')](this));ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0xf041('0x1d'),this[_0xf041('0x1e')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xf041('0x1f'),this['syncFullyBooted']['bind'](this));ami['on'](_0xf041('0x20'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xf041('0x21'),this[_0xf041('0x22')][_0xf041('0x15')](this));ami['on'](_0xf041('0x23'),this[_0xf041('0x24')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0xf041('0x25')]();this['loopQueueShow']();}function clearChannels(_0x5c71e2){if(!_['isEmpty'](_0x5c71e2)){for(var _0x65df48 in _0x5c71e2){if(_0x5c71e2['hasOwnProperty'](_0x65df48)){delete _0x5c71e2[_0x65df48];}}}}function clearCampaigns(_0x158667){if(!_[_0xf041('0x26')](_0x158667)){for(var _0x3ce2fd in _0x158667){if(_0x158667[_0xf041('0x27')](_0x3ce2fd)){_0x158667[_0x3ce2fd]['originated']=0x0;}}}}function clearVoiceQueues(_0x5db1f0){if(!_[_0xf041('0x26')](_0x5db1f0)){for(var _0xd1d291 in _0x5db1f0){if(_0x5db1f0[_0xf041('0x27')](_0xd1d291)){_0x5db1f0[_0xd1d291]['originated']=0x0;_0x5db1f0[_0xd1d291]['talking']=0x0;_0x5db1f0[_0xd1d291][_0xf041('0x28')]=0x0;_0x5db1f0[_0xd1d291][_0xf041('0x29')]=0x0;_0x5db1f0[_0xd1d291][_0xf041('0x2a')]=!![];}}}}function clearAgentBooked(_0x2acb0f){if(!_[_0xf041('0x26')](_0x2acb0f)){for(var _0x697714 in _0x2acb0f){if(_0x2acb0f[_0xf041('0x27')](_0x697714)){_0x2acb0f[_0x697714]['unlockRR']=!![];}}}}VoiceQueueReport[_0xf041('0xb')][_0xf041('0x2b')]=function(){var _0xbd8072=this;for(var _0x584fac in this['channels']){if(this[_0xf041('0xf')]['hasOwnProperty'](_0x584fac)&&!this[_0xf041('0xf')][_0x584fac][_0xf041('0x2c')]){this[_0xf041('0x2d')][_0xf041('0x2e')](function(){if(!_[_0xf041('0x2f')](_0xbd8072[_0xf041('0xf')][_0x584fac])){return ami[_0xf041('0x30')]({'action':'status','channel':_0xbd8072[_0xf041('0xf')][_0x584fac]['channel']})['catch'](function(_0x3659b8){if(_0x3659b8['message']===_0xf041('0x31')){setTimeout(function(){if(_0xbd8072[_0xf041('0xf')][_0x584fac]){delete _0xbd8072[_0xf041('0xf')][_0x584fac];logger[_0xf041('0x32')](_0xf041('0x33'),_0x584fac,util[_0xf041('0x34')](_0x3659b8,{'showHidden':![],'depth':null}));}if(_0xbd8072['queueReports'][_0x584fac]){delete _0xbd8072[_0xf041('0x35')][_0x584fac];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x584fac,util['inspect'](_0x3659b8,{'showHidden':![],'depth':null}));}if(_0xbd8072[_0xf041('0x36')][_0x584fac]){delete _0xbd8072['variables'][_0x584fac];logger['error'](_0xf041('0x37'),_0x584fac,util[_0xf041('0x34')](_0x3659b8,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x38')]=function(){logger[_0xf041('0x32')](_0xf041('0x39'));clearChannels(this[_0xf041('0xf')]);this[_0xf041('0x3a')](this[_0xf041('0x35')]);clearAgentBooked(this[_0xf041('0xe')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xf041('0x3b')]);};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x3a')]=function(_0x2ea74e){var _0x4e6a1e=this;if(!_['isEmpty'](_0x2ea74e)){for(var _0x4e0eda in _0x2ea74e){if(_0x2ea74e[_0xf041('0x27')](_0x4e0eda)){_0x4e6a1e[_0xf041('0x3c')](_0x2ea74e[_0x4e0eda],_0xf041('0x3d'));delete _0x2ea74e[_0x4e0eda];}}}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x3e')]=function(_0xa8e587,_0x3c02cd,_0x2d3fbb){io['to'](_0xa8e587)[_0xf041('0x3e')](_0x3c02cd,_0x2d3fbb);};VoiceQueueReport[_0xf041('0xb')]['emitVoiceQueueChannelSave']=function(_0x10e271,_0x219f5a){logger[_0xf041('0x3f')](_0xf041('0x40')+_0x219f5a+_0xf041('0x41'),_0x10e271[_0xf041('0x42')],util[_0xf041('0x34')](_0x10e271,{'showHidden':![],'depth':null}));this[_0xf041('0x3e')](util[_0xf041('0x43')]('voice:queue:%s',_0x10e271[_0xf041('0x44')]),_0xf041('0x45'),_0x10e271);io[_0xf041('0x3e')](_0xf041('0x46'),_0x10e271);};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x3c')]=function(_0x220590,_0x4e6af6){logger[_0xf041('0x3f')](_0xf041('0x40')+_0x4e6af6+_0xf041('0x47'),_0x220590[_0xf041('0x42')],util[_0xf041('0x34')](_0x220590,{'showHidden':![],'depth':null}));this[_0xf041('0x3e')](util[_0xf041('0x43')](_0xf041('0x48'),_0x220590[_0xf041('0x44')]),'voice_queue_channel:remove',_0x220590);io[_0xf041('0x3e')](_0xf041('0x49'),_0x220590);};VoiceQueueReport[_0xf041('0xb')]['emitVoiceQueueSummary']=function(_0x12c8b5,_0x423152){if(_0x12c8b5['type']===_0xf041('0x4a')){var _0x3fd700={'id':_0x12c8b5['id'],'name':_0x12c8b5[_0xf041('0x44')],'strategy':_0x12c8b5['strategy'],'answered':_0x12c8b5[_0xf041('0x4b')],'available':_0x12c8b5[_0xf041('0x4c')],'loggedIn':_0x12c8b5[_0xf041('0x4d')],'pTalking':_0x12c8b5[_0xf041('0x28')],'sumBillable':_0x12c8b5['sumBillable'],'sumDuration':_0x12c8b5[_0xf041('0x4e')],'sumHoldTime':_0x12c8b5[_0xf041('0x4f')]||0x0,'talking':_0x12c8b5['talking'],'total':_0x12c8b5[_0xf041('0x50')],'type':_0x12c8b5[_0xf041('0x51')],'unmanaged':_0x12c8b5['unmanaged'],'abandoned':_0x12c8b5[_0xf041('0x52')],'waiting':_0x12c8b5[_0xf041('0x29')]};if(_0x12c8b5[_0xf041('0x53')]){_0x3fd700[_0xf041('0x53')]={'id':_0x12c8b5[_0xf041('0x53')]['id'],'name':_0x12c8b5[_0xf041('0x53')][_0xf041('0x44')],'active':_0x12c8b5['Trunk'][_0xf041('0x54')],'callerid':_0x12c8b5[_0xf041('0x53')][_0xf041('0x55')]};}if(_0x12c8b5['Interval']){_0x3fd700[_0xf041('0x56')]={'id':_0x12c8b5['Interval']['id'],'name':_0x12c8b5['Interval'][_0xf041('0x44')]};}var _0x273281=md5(JSON['stringify'](_0x3fd700));if(_0x12c8b5[_0xf041('0x57')]!==_0x273281){_0x12c8b5[_0xf041('0x57')]=_0x273281;logger['debug']('[voiceQueueReport]['+_0x423152+_0xf041('0x58'),util[_0xf041('0x34')](_0x3fd700,{'showHidden':![],'depth':null}));this[_0xf041('0x3e')](util[_0xf041('0x43')]('voice:queue:%s',_0x3fd700[_0xf041('0x44')]),'voice_queue:save',_0x3fd700);}}};VoiceQueueReport[_0xf041('0xb')]['isNotNull']=function(_0x481a23){return _0x481a23!==null&&!_['isUndefined'](_0x481a23);};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x59')]=function(){var _0x53b048=this;setInterval(function(){_0x53b048['clearZombieChannels']();ami['Action']({'action':_0xf041('0x5a')})[_0xf041('0x5b')](function(_0x2d0067){logger[_0xf041('0x32')](_0xf041('0x5c'),util['inspect'](_0x2d0067,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x25')]=function(){var _0x1c9b2d=this;setInterval(function(){if(_0x1c9b2d['flagQueueSummary']){return ami[_0xf041('0x30')]({'action':_0xf041('0x13')})[_0xf041('0x5d')](function(_0x49f535){_0x1c9b2d[_0xf041('0x12')]=![];})[_0xf041('0x5b')](function(_0x5c2978){logger[_0xf041('0x32')](_0xf041('0x5e'),util[_0xf041('0x34')](_0x5c2978,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xf041('0x14')]=function(_0x1ce19c){try{if(this['isNotNull'](_0x1ce19c)&&this[_0xf041('0x5f')](_0x1ce19c[_0xf041('0x60')])){logger['debug'](_0xf041('0x61'),util['inspect'](_0x1ce19c,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x1ce19c[_0xf041('0x60')]]){logger['info'](_0xf041('0x62'),_0x1ce19c[_0xf041('0x60')]);var _0x2454f6=_[_0xf041('0x63')](this['channels'],'queue')[_0x1ce19c[_0xf041('0x60')]]||0x0;var _0x5b14f7=_0x2454f6-_0x1ce19c[_0xf041('0x64')];if(this[_0xf041('0x11')][_0x1ce19c['queue']][_0xf041('0x29')]!==_[_0xf041('0x65')](_0x1ce19c[_0xf041('0x64')])||this['voiceQueues'][_0x1ce19c[_0xf041('0x60')]]['loggedIn']!==_[_0xf041('0x65')](_0x1ce19c['loggedin'])||this['voiceQueues'][_0x1ce19c['queue']][_0xf041('0x4c')]!==_[_0xf041('0x65')](_0x1ce19c['available'])||this[_0xf041('0x11')][_0x1ce19c['queue']][_0xf041('0x66')]!==_0x5b14f7){this['voiceQueues'][_0x1ce19c[_0xf041('0x60')]][_0xf041('0x29')]=_[_0xf041('0x65')](_0x1ce19c['callers']);this['voiceQueues'][_0x1ce19c['queue']][_0xf041('0x4d')]=_[_0xf041('0x65')](_0x1ce19c['loggedin']);this[_0xf041('0x11')][_0x1ce19c[_0xf041('0x60')]]['available']=_[_0xf041('0x65')](_0x1ce19c[_0xf041('0x4c')]);this['voiceQueues'][_0x1ce19c[_0xf041('0x60')]]['talking']=_0x5b14f7>0x0?_0x5b14f7:0x0;this[_0xf041('0x11')][_0x1ce19c[_0xf041('0x60')]]['talking']=this[_0xf041('0x11')][_0x1ce19c[_0xf041('0x60')]][_0xf041('0x66')]>_[_0xf041('0x65')](_0x1ce19c[_0xf041('0x67')])?_[_0xf041('0x65')](_0x1ce19c['loggedin']):this['voiceQueues'][_0x1ce19c['queue']][_0xf041('0x66')];this[_0xf041('0x68')](this[_0xf041('0x11')][_0x1ce19c[_0xf041('0x60')]],'queuesummary');}logger['debug'](_0xf041('0x69'),util[_0xf041('0x34')](this[_0xf041('0x11')][_0x1ce19c['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xf041('0x6a'),this[_0xf041('0x11')][_0x1ce19c[_0xf041('0x60')]]);}}}catch(_0x459434){logger['error'](_0xf041('0x5e'),util[_0xf041('0x34')](_0x459434,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')]['syncQueueSummaryComplete']=function(_0x3715a8){logger[_0xf041('0x3f')](_0xf041('0x6b'),util[_0xf041('0x34')](_0x3715a8,{'showHidden':![],'depth':null}));this[_0xf041('0x12')]=!![];};VoiceQueueReport[_0xf041('0xb')]['syncQueueCallerJoin']=function(_0xd208a2){try{if(this[_0xf041('0x5f')](_0xd208a2)){logger[_0xf041('0x3f')](_0xf041('0x6c'),_0xd208a2[_0xf041('0x42')],util[_0xf041('0x34')](_0xd208a2,{'showHidden':![],'depth':null}));if(_[_0xf041('0x6d')](this[_0xf041('0x35')][_0xd208a2['uniqueid']])){this[_0xf041('0x35')][_0xd208a2[_0xf041('0x42')]]=[];this[_0xf041('0xf')][_0xd208a2[_0xf041('0x42')]]={};}var _0x2320c8=new QueueReport();_0x2320c8[_0xf041('0x44')]=_0xd208a2['queue'];_0x2320c8[_0xf041('0x51')]=this[_0xf041('0x11')][_0x2320c8[_0xf041('0x44')]]&&this[_0xf041('0x11')][_0x2320c8[_0xf041('0x44')]][_0xf041('0x51')]?this[_0xf041('0x11')][_0x2320c8[_0xf041('0x44')]]['type']||'inbound':'inbound';_0x2320c8[_0xf041('0x60')]=_0xd208a2[_0xf041('0x60')];_0x2320c8['queuecallerjoinAt']=moment()[_0xf041('0x43')](_0xf041('0x6e'));_0x2320c8['position']=_0xd208a2['position'];_0x2320c8[_0xf041('0x6f')]=_0xd208a2['count'];_0x2320c8[_0xf041('0x42')]=_0xd208a2[_0xf041('0x42')];logger[_0xf041('0x70')](_0xf041('0x71'),_0x2320c8['name'],_0x2320c8[_0xf041('0x51')]);_[_0xf041('0x72')](_0x2320c8,_['pick'](_0xd208a2,_[_0xf041('0x73')](_0x2320c8)));this[_0xf041('0x35')][_0xd208a2[_0xf041('0x42')]]['push'](_0x2320c8);this[_0xf041('0xf')][_0xd208a2['uniqueid']]=_0x2320c8;this[_0xf041('0x74')](_0x2320c8,_0xf041('0x75'));}}catch(_0x2b170e){logger[_0xf041('0x32')]('[%s][voiceQueueReport][queuecallerjoin]',_0xd208a2[_0xf041('0x42')],util[_0xf041('0x34')](_0x2b170e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x18')]=function(_0xc32530){try{if(this[_0xf041('0x5f')](_0xc32530)){logger[_0xf041('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0xc32530[_0xf041('0x42')],util['inspect'](_0xc32530,{'showHidden':![],'depth':null}));if(this[_0xf041('0x35')][_0xc32530[_0xf041('0x42')]]){var _0x54e393=_[_0xf041('0x76')](this[_0xf041('0x35')][_0xc32530[_0xf041('0x42')]]);_0x54e393[_0xf041('0x77')]=![];_0x54e393[_0xf041('0x78')]=null;_0x54e393[_0xf041('0x79')]=_0xc32530[_0xf041('0x79')];_0x54e393['originalposition']=_0xc32530[_0xf041('0x7a')];_0x54e393[_0xf041('0x7b')]=!![];_0x54e393['queuecallerabandonAt']=moment()[_0xf041('0x43')](_0xf041('0x6e'));_0x54e393['queuecallerexitreason']='ABANDONED';_0x54e393[_0xf041('0x7c')]=null;logger[_0xf041('0x70')](_0xf041('0x7d'),_0x54e393['name'],_0x54e393[_0xf041('0x51')]);this[_0xf041('0xf')][_0xc32530[_0xf041('0x42')]]=_0x54e393;this[_0xf041('0x3c')](_0x54e393,_0xf041('0x7b'));}}}catch(_0x1fc3d6){logger[_0xf041('0x32')](_0xf041('0x7e'),_0xc32530[_0xf041('0x42')],util['inspect'](_0x1fc3d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf041('0x1a')]=function(_0x4cce28){try{if(this[_0xf041('0x5f')](_0x4cce28)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x4cce28['uniqueid'],util['inspect'](_0x4cce28,{'showHidden':![],'depth':null}));if(this[_0xf041('0x35')][_0x4cce28['uniqueid']]){var _0xc81e32=_[_0xf041('0x76')](this[_0xf041('0x35')][_0x4cce28[_0xf041('0x42')]]);_0xc81e32[_0xf041('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc81e32[_0xf041('0x80')]=_0x4cce28[_0xf041('0x80')];_0xc81e32[_0xf041('0x81')]=_0x4cce28['connectedlinename'];logger[_0xf041('0x70')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xc81e32['name'],_0xc81e32[_0xf041('0x51')],_0x4cce28['connectedlinenum'],_0x4cce28['connectedlinename']);this[_0xf041('0xf')][_0x4cce28['uniqueid']]=_0xc81e32;this[_0xf041('0x74')](_0xc81e32,_0xf041('0x19'));}}}catch(_0x54e8fe){logger['error'](_0xf041('0x82'),_0x4cce28[_0xf041('0x42')],util[_0xf041('0x34')](_0x54e8fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x83')]=function(_0x111293){try{if(this[_0xf041('0x5f')](_0x111293)){logger[_0xf041('0x3f')](_0xf041('0x84'),_0x111293['uniqueid'],util[_0xf041('0x34')](_0x111293,{'showHidden':![],'depth':null}));if(this[_0xf041('0x35')][_0x111293[_0xf041('0x42')]]){var _0x6e23e1=_[_0xf041('0x76')](this[_0xf041('0x35')][_0x111293['uniqueid']]);_0x6e23e1[_0xf041('0x77')]=!![];_0x6e23e1[_0xf041('0x85')]=_0xf041('0x86');logger[_0xf041('0x70')](_0xf041('0x87'),_0x6e23e1[_0xf041('0x44')],_0x6e23e1['type']);}}}catch(_0x49192e){logger[_0xf041('0x32')](_0xf041('0x84'),_0x111293[_0xf041('0x42')],util[_0xf041('0x34')](_0x49192e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')]['syncAgentComplete']=function(_0x15c998){try{if(this['isNotNull'](_0x15c998)){logger['debug'](_0xf041('0x88'),_0x15c998['uniqueid'],util[_0xf041('0x34')](_0x15c998,{'showHidden':![],'depth':null}));if(this[_0xf041('0x35')][_0x15c998[_0xf041('0x42')]]){var _0x42b4bf=_['last'](this[_0xf041('0x35')][_0x15c998['uniqueid']]);_0x42b4bf['queuecallerabandon']=![];_0x42b4bf[_0xf041('0x89')]=null;_0x42b4bf[_0xf041('0x8a')]=!![];_0x42b4bf[_0xf041('0x7c')]=_0x15c998[_0xf041('0x8b')];_0x42b4bf[_0xf041('0x79')]=_0x15c998[_0xf041('0x79')];_0x42b4bf[_0xf041('0x77')]=!![];_0x42b4bf[_0xf041('0x8c')]=![];_0x42b4bf[_0xf041('0x8d')]=null;if(!_0x42b4bf[_0xf041('0x8e')]){if(_0x15c998[_0xf041('0x8f')]==_0xf041('0x8e')){_0x42b4bf[_0xf041('0x85')]=_0xf041('0x90');logger['info'](_0xf041('0x91'),_0x42b4bf[_0xf041('0x44')],_0x42b4bf[_0xf041('0x51')]);}else{if(_[_0xf041('0x92')](_0x15c998['channel'][_0xf041('0x93')](),_0xf041('0x94'))){if(this[_0xf041('0x35')][_0x15c998['linkedid']]){var _0x3f0073=_[_0xf041('0x76')](this[_0xf041('0x35')][_0x15c998[_0xf041('0x95')]]);_0x3f0073[_0xf041('0x77')]=![];_0x3f0073['queuecallerexit']=!![];_0x3f0073['queuecallerexitAt']=moment(_0x42b4bf['queuecallerjoinAt'])['add'](_0x15c998[_0xf041('0x79')],'seconds')[_0xf041('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f0073[_0xf041('0x85')]=_0xf041('0x96');_0x3f0073[_0xf041('0x8e')]=!![];_0x3f0073[_0xf041('0x97')]='FORWARD';_0x3f0073[_0xf041('0x98')]=_0x15c998[_0xf041('0x99')];_0x3f0073[_0xf041('0x9a')]=_0x15c998[_0xf041('0x42')];logger[_0xf041('0x70')](_0xf041('0x9b'),_0x3f0073['name'],_0x3f0073[_0xf041('0x51')]);var _0x374618=this[_0xf041('0x35')][_0x15c998[_0xf041('0x95')]];this[_0xf041('0x35')][_0x15c998[_0xf041('0x95')]]=this[_0xf041('0x35')][_0x15c998[_0xf041('0x42')]];this['queueReports'][_0x15c998[_0xf041('0x42')]]=_0x374618;}}else{_0x42b4bf[_0xf041('0x85')]='COMPLETEDBY'+_0x15c998[_0xf041('0x8f')]['toUpperCase']();logger[_0xf041('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x42b4bf[_0xf041('0x44')],_0x42b4bf[_0xf041('0x51')],_0x42b4bf[_0xf041('0x85')]);}}}this[_0xf041('0xf')][_0x15c998[_0xf041('0x42')]]=_0x42b4bf;this[_0xf041('0x3c')](_0x42b4bf,_0xf041('0x1b'));}}}catch(_0x24309c){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x15c998[_0xf041('0x42')],util[_0xf041('0x34')](_0x24309c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x1e')]=function(_0x1874e7){try{if(this[_0xf041('0x5f')](_0x1874e7)){logger['debug']('[%s][voiceQueueReport][varset]',_0x1874e7[_0xf041('0x42')],util[_0xf041('0x34')](_0x1874e7,{'showHidden':![],'depth':null}));this[_0xf041('0x9c')](_0x1874e7['uniqueid'],_['keys'](_0x1874e7['variable'])[0x0],_0x1874e7['value']);if(this[_0xf041('0x35')][_0x1874e7[_0xf041('0x42')]]){var _0x43ed93=_['last'](this[_0xf041('0x35')][_0x1874e7[_0xf041('0x42')]]);if(_0x43ed93){if(this['isNotNull'](_0x1874e7['variable'])&&this[_0xf041('0x5f')](_0x1874e7['variable']['queuestatus'])){switch(_0x1874e7[_0xf041('0x9d')]){case'CONTINUE':_0x43ed93[_0xf041('0x8c')]=![];_0x43ed93['queuecallerexitAt']=null;break;case _0xf041('0x9e'):_0x43ed93[_0xf041('0x9f')]='timeout';_0x43ed93[_0xf041('0x8c')]=!![];_0x43ed93[_0xf041('0x8d')]=moment()['format'](_0xf041('0x6e'));_0x43ed93[_0xf041('0x7f')]=moment()[_0xf041('0x43')](_0xf041('0x6e'));logger['debug'](_0xf041('0xa0'),_0x1874e7[_0xf041('0x42')],util[_0xf041('0x34')](_0x43ed93,{'showHidden':![],'depth':null}));ami[_0xf041('0x3e')](_0xf041('0xa1'),_0x43ed93);break;default:_0x43ed93[_0xf041('0x8c')]=!![];_0x43ed93['queuecallerexitAt']=moment()[_0xf041('0x43')](_0xf041('0x6e'));_0x43ed93[_0xf041('0x7f')]=moment()[_0xf041('0x43')](_0xf041('0x6e'));}_0x43ed93['queuecallerabandon']=![];_0x43ed93[_0xf041('0x89')]=null;_0x43ed93['queuecallerexitreason']=_0x1874e7['value'];this[_0xf041('0xf')][_0x1874e7[_0xf041('0x42')]]=_0x43ed93;this[_0xf041('0x3c')](_0x43ed93,'varset');}else if(this[_0xf041('0x5f')](_0x1874e7[_0xf041('0xa2')])&&this['isNotNull'](_0x1874e7[_0xf041('0xa2')][_0xf041('0xa3')])){if(!_0x43ed93[_0xf041('0x7b')]){_0x43ed93[_0xf041('0x8c')]=!![];_0x43ed93[_0xf041('0x8d')]=moment()[_0xf041('0x43')](_0xf041('0x6e'));_0x43ed93[_0xf041('0x85')]=_0xf041('0xa4');_0x43ed93['queuecallerleaveAt']=moment()['format'](_0xf041('0x6e'));this[_0xf041('0xf')][_0x1874e7[_0xf041('0x42')]]=_0x43ed93;}}logger['info'](_0xf041('0xa5'),_0x1874e7[_0xf041('0x42')],_0x43ed93[_0xf041('0x44')],_0x43ed93[_0xf041('0x51')],_['keys'](_0x1874e7[_0xf041('0xa2')])[0x0],_0x1874e7['value']);_0x43ed93[_0xf041('0x36')]=this[_0xf041('0x36')][_0x1874e7[_0xf041('0x42')]];}}}}catch(_0x22c8c4){logger[_0xf041('0x32')](_0xf041('0xa6'),_0x1874e7[_0xf041('0x42')],util[_0xf041('0x34')](_0x22c8c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf041('0xb')][_0xf041('0x9c')]=function(_0x2a8031,_0x3b9fce,_0xed7b29){var _0x6c0fbb=['rtpaudioqos',_0xf041('0xa7'),_0xf041('0xa8'),_0xf041('0xa9'),_0xf041('0xaa'),_0xf041('0xab'),_0xf041('0xac'),_0xf041('0xad'),'sipcallid',_0xf041('0xae'),'bridgepeer',_0xf041('0xaf'),_0xf041('0xb0'),_0xf041('0xb1'),'memberinterface',_0xf041('0xb2'),_0xf041('0x8b'),_0xf041('0xb3'),_0xf041('0xb4')];if(!_['isNil'](_0x3b9fce)&&!_['includes'](_0x6c0fbb,_0x3b9fce)){if(_[_0xf041('0x6d')](this[_0xf041('0x36')][_0x2a8031])){this['variables'][_0x2a8031]={};}this['variables'][_0x2a8031][_0x3b9fce]=_0xed7b29;}};VoiceQueueReport['prototype'][_0xf041('0xb5')]=function(_0x493d20){try{if(this[_0xf041('0x5f')](_0x493d20)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x493d20[_0xf041('0x42')],util[_0xf041('0x34')](_0x493d20,{'showHidden':![],'depth':null}));if(this[_0xf041('0x35')][_0x493d20[_0xf041('0x42')]]){for(var _0x5c593b=0x0,_0x4bcefd={};_0x5c593b0x0?_0x5a956f:0x0;this[_0x5276('0xd')][_0x5d3998[_0x5276('0x65')]]['talking']=this['voiceQueues'][_0x5d3998[_0x5276('0x65')]][_0x5276('0x2c')]>_[_0x5276('0x68')](_0x5d3998[_0x5276('0x69')])?_[_0x5276('0x68')](_0x5d3998['loggedin']):this[_0x5276('0xd')][_0x5d3998[_0x5276('0x65')]]['talking'];this[_0x5276('0x4c')](this[_0x5276('0xd')][_0x5d3998[_0x5276('0x65')]],_0x5276('0x10'));}logger[_0x5276('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x5276('0x3b')](this[_0x5276('0xd')][_0x5d3998[_0x5276('0x65')]],{'showHidden':![],'depth':null}));ami[_0x5276('0x40')](_0x5276('0x6a'),this[_0x5276('0xd')][_0x5d3998[_0x5276('0x65')]]);}}}catch(_0x12ff45){logger['error'](_0x5276('0x6b'),util['inspect'](_0x12ff45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x13')]=function(_0x291925){logger[_0x5276('0x41')](_0x5276('0x6c'),util[_0x5276('0x3b')](_0x291925,{'showHidden':![],'depth':null}));this[_0x5276('0x63')]=!![];};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x16')]=function(_0x3d5ed3){try{if(this[_0x5276('0x5e')](_0x3d5ed3)){logger[_0x5276('0x41')](_0x5276('0x6d'),_0x3d5ed3['uniqueid'],util[_0x5276('0x3b')](_0x3d5ed3,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x5276('0xa')][_0x3d5ed3[_0x5276('0x43')]])){this[_0x5276('0xa')][_0x3d5ed3[_0x5276('0x43')]]=[];this[_0x5276('0xc')][_0x3d5ed3[_0x5276('0x43')]]={};}var _0x306f3d=new QueueReport();_0x306f3d[_0x5276('0x49')]=_0x3d5ed3[_0x5276('0x65')];_0x306f3d[_0x5276('0x54')]=this['voiceQueues'][_0x306f3d[_0x5276('0x49')]]&&this[_0x5276('0xd')][_0x306f3d[_0x5276('0x49')]][_0x5276('0x54')]?this[_0x5276('0xd')][_0x306f3d[_0x5276('0x49')]][_0x5276('0x54')]||'inbound':_0x5276('0x6e');_0x306f3d[_0x5276('0x65')]=_0x3d5ed3[_0x5276('0x65')];_0x306f3d[_0x5276('0x6f')]=moment()[_0x5276('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x306f3d[_0x5276('0x70')]=_0x3d5ed3['position'];_0x306f3d[_0x5276('0x71')]=_0x3d5ed3[_0x5276('0x71')];_0x306f3d[_0x5276('0x43')]=_0x3d5ed3[_0x5276('0x43')];logger[_0x5276('0x72')](_0x5276('0x73'),_0x306f3d[_0x5276('0x49')],_0x306f3d[_0x5276('0x54')]);_[_0x5276('0x74')](_0x306f3d,_[_0x5276('0x75')](_0x3d5ed3,_[_0x5276('0x76')](_0x306f3d)));this[_0x5276('0xa')][_0x3d5ed3[_0x5276('0x43')]]['push'](_0x306f3d);this[_0x5276('0xc')][_0x3d5ed3[_0x5276('0x43')]]=_0x306f3d;this[_0x5276('0x77')](_0x306f3d,'queuecallerjoin');}}catch(_0x461f99){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x3d5ed3[_0x5276('0x43')],util[_0x5276('0x3b')](_0x461f99,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x18')]=function(_0x1110ff){try{if(this[_0x5276('0x5e')](_0x1110ff)){logger[_0x5276('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1110ff[_0x5276('0x43')],util['inspect'](_0x1110ff,{'showHidden':![],'depth':null}));if(this[_0x5276('0xa')][_0x1110ff['uniqueid']]){var _0x3f059d=_[_0x5276('0x78')](this[_0x5276('0xa')][_0x1110ff[_0x5276('0x43')]]);_0x3f059d[_0x5276('0x79')]=![];_0x3f059d[_0x5276('0x7a')]=null;_0x3f059d[_0x5276('0x7b')]=_0x1110ff['holdtime'];_0x3f059d[_0x5276('0x7c')]=_0x1110ff[_0x5276('0x7c')];_0x3f059d['queuecallerabandon']=!![];_0x3f059d[_0x5276('0x7d')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));_0x3f059d[_0x5276('0x7f')]='ABANDONED';_0x3f059d[_0x5276('0x80')]=null;logger['info'](_0x5276('0x81'),_0x3f059d[_0x5276('0x49')],_0x3f059d['type']);this['channels'][_0x1110ff[_0x5276('0x43')]]=_0x3f059d;this[_0x5276('0x82')](_0x3f059d,'queuecallerabandon');}}}catch(_0xeedae4){logger[_0x5276('0x39')](_0x5276('0x83'),_0x1110ff[_0x5276('0x43')],util[_0x5276('0x3b')](_0xeedae4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5276('0x19')]=function(_0xfd79f1){try{if(this[_0x5276('0x5e')](_0xfd79f1)){logger[_0x5276('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0xfd79f1[_0x5276('0x43')],util[_0x5276('0x3b')](_0xfd79f1,{'showHidden':![],'depth':null}));if(this[_0x5276('0xa')][_0xfd79f1[_0x5276('0x43')]]){var _0x54b2cf=_[_0x5276('0x78')](this[_0x5276('0xa')][_0xfd79f1[_0x5276('0x43')]]);_0x54b2cf[_0x5276('0x84')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));_0x54b2cf[_0x5276('0x85')]=_0xfd79f1[_0x5276('0x85')];_0x54b2cf[_0x5276('0x86')]=_0xfd79f1[_0x5276('0x86')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x54b2cf[_0x5276('0x49')],_0x54b2cf[_0x5276('0x54')],_0xfd79f1[_0x5276('0x85')],_0xfd79f1[_0x5276('0x86')]);this[_0x5276('0xc')][_0xfd79f1['uniqueid']]=_0x54b2cf;this[_0x5276('0x77')](_0x54b2cf,_0x5276('0x87'));}}}catch(_0x5bf368){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0xfd79f1[_0x5276('0x43')],util['inspect'](_0x5bf368,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x1d')]=function(_0x413c79){try{if(this[_0x5276('0x5e')](_0x413c79)){logger[_0x5276('0x41')](_0x5276('0x88'),_0x413c79[_0x5276('0x43')],util[_0x5276('0x3b')](_0x413c79,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x413c79[_0x5276('0x43')]]){var _0x369b00=_[_0x5276('0x78')](this['queueReports'][_0x413c79['uniqueid']]);_0x369b00[_0x5276('0x79')]=!![];_0x369b00[_0x5276('0x7f')]=_0x5276('0x89');logger[_0x5276('0x72')](_0x5276('0x8a'),_0x369b00[_0x5276('0x49')],_0x369b00[_0x5276('0x54')]);}}}catch(_0xbd6579){logger['error'](_0x5276('0x88'),_0x413c79['uniqueid'],util[_0x5276('0x3b')](_0xbd6579,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x1b')]=function(_0x26aef2){try{if(this[_0x5276('0x5e')](_0x26aef2)){logger[_0x5276('0x41')](_0x5276('0x8b'),_0x26aef2[_0x5276('0x43')],util[_0x5276('0x3b')](_0x26aef2,{'showHidden':![],'depth':null}));if(this[_0x5276('0xa')][_0x26aef2[_0x5276('0x43')]]){var _0x54f2e5=_[_0x5276('0x78')](this[_0x5276('0xa')][_0x26aef2[_0x5276('0x43')]]);_0x54f2e5[_0x5276('0x17')]=![];_0x54f2e5[_0x5276('0x7d')]=null;_0x54f2e5[_0x5276('0x8c')]=!![];_0x54f2e5[_0x5276('0x80')]=_0x26aef2[_0x5276('0x8d')];_0x54f2e5['holdtime']=_0x26aef2[_0x5276('0x7b')];_0x54f2e5[_0x5276('0x79')]=!![];_0x54f2e5[_0x5276('0x8e')]=![];_0x54f2e5[_0x5276('0x8f')]=null;if(!_0x54f2e5[_0x5276('0x90')]){if(_0x26aef2[_0x5276('0x91')]==_0x5276('0x90')){_0x54f2e5[_0x5276('0x7f')]=_0x5276('0x92');logger[_0x5276('0x72')](_0x5276('0x93'),_0x54f2e5[_0x5276('0x49')],_0x54f2e5['type']);}else{if(_[_0x5276('0x94')](_0x26aef2[_0x5276('0x37')][_0x5276('0x95')](),'local/')){if(this[_0x5276('0xa')][_0x26aef2[_0x5276('0x96')]]){var _0x497309=_[_0x5276('0x78')](this[_0x5276('0xa')][_0x26aef2[_0x5276('0x96')]]);_0x497309[_0x5276('0x79')]=![];_0x497309[_0x5276('0x8e')]=!![];_0x497309[_0x5276('0x8f')]=moment(_0x54f2e5['queuecallerjoinAt'])[_0x5276('0x97')](_0x26aef2[_0x5276('0x7b')],_0x5276('0x98'))[_0x5276('0x48')](_0x5276('0x7e'));_0x497309[_0x5276('0x7f')]=_0x5276('0x99');_0x497309['transfer']=!![];_0x497309[_0x5276('0x9a')]=_0x5276('0x9b');_0x497309['transferexten']=_0x26aef2[_0x5276('0x9c')];_0x497309[_0x5276('0x9d')]=_0x26aef2[_0x5276('0x43')];logger['info'](_0x5276('0x9e'),_0x497309[_0x5276('0x49')],_0x497309['type']);var _0x46e21b=this[_0x5276('0xa')][_0x26aef2[_0x5276('0x96')]];this[_0x5276('0xa')][_0x26aef2[_0x5276('0x96')]]=this[_0x5276('0xa')][_0x26aef2['uniqueid']];this['queueReports'][_0x26aef2[_0x5276('0x43')]]=_0x46e21b;}}else{_0x54f2e5['queuecallerexitreason']=_0x5276('0x9f')+_0x26aef2['reason'][_0x5276('0xa0')]();logger[_0x5276('0x72')](_0x5276('0xa1'),_0x54f2e5['name'],_0x54f2e5[_0x5276('0x54')],_0x54f2e5['queuecallerexitreason']);}}}this[_0x5276('0xc')][_0x26aef2[_0x5276('0x43')]]=_0x54f2e5;this['emitVoiceQueueChannelRemove'](_0x54f2e5,_0x5276('0x1a'));}}}catch(_0x5effbf){logger['error'](_0x5276('0x8b'),_0x26aef2['uniqueid'],util[_0x5276('0x3b')](_0x5effbf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')]['syncVarSet']=function(_0x4a048a){try{if(this['isNotNull'](_0x4a048a)){logger[_0x5276('0x41')](_0x5276('0xa2'),_0x4a048a[_0x5276('0x43')],util[_0x5276('0x3b')](_0x4a048a,{'showHidden':![],'depth':null}));this[_0x5276('0xa3')](_0x4a048a['uniqueid'],_[_0x5276('0x76')](_0x4a048a[_0x5276('0xa4')])[0x0],_0x4a048a['value']);if(this[_0x5276('0xa')][_0x4a048a[_0x5276('0x43')]]){var _0x232db3=_['last'](this['queueReports'][_0x4a048a[_0x5276('0x43')]]);if(_0x232db3){if(this[_0x5276('0x5e')](_0x4a048a['variable'])&&this[_0x5276('0x5e')](_0x4a048a[_0x5276('0xa4')]['queuestatus'])){switch(_0x4a048a[_0x5276('0xa5')]){case _0x5276('0xa6'):_0x232db3['queuecallerexit']=![];_0x232db3[_0x5276('0x8f')]=null;break;case'TIMEOUT':_0x232db3[_0x5276('0xa7')]='timeout';_0x232db3[_0x5276('0x8e')]=!![];_0x232db3[_0x5276('0x8f')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));_0x232db3[_0x5276('0x84')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));logger[_0x5276('0x41')](_0x5276('0xa8'),_0x4a048a[_0x5276('0x43')],util[_0x5276('0x3b')](_0x232db3,{'showHidden':![],'depth':null}));ami['emit'](_0x5276('0xa9'),_0x232db3);break;default:_0x232db3[_0x5276('0x8e')]=!![];_0x232db3[_0x5276('0x8f')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));_0x232db3[_0x5276('0x84')]=moment()[_0x5276('0x48')](_0x5276('0x7e'));}_0x232db3[_0x5276('0x17')]=![];_0x232db3[_0x5276('0x7d')]=null;_0x232db3[_0x5276('0x7f')]=_0x4a048a[_0x5276('0xa5')];this['channels'][_0x4a048a[_0x5276('0x43')]]=_0x232db3;this[_0x5276('0x82')](_0x232db3,_0x5276('0x1e'));}else if(this[_0x5276('0x5e')](_0x4a048a['variable'])&&this[_0x5276('0x5e')](_0x4a048a[_0x5276('0xa4')][_0x5276('0xaa')])){if(!_0x232db3[_0x5276('0x17')]){_0x232db3[_0x5276('0x8e')]=!![];_0x232db3['queuecallerexitAt']=moment()[_0x5276('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x232db3[_0x5276('0x7f')]='EXITWITHKEY';_0x232db3['queuecallerleaveAt']=moment()[_0x5276('0x48')](_0x5276('0x7e'));this[_0x5276('0xc')][_0x4a048a[_0x5276('0x43')]]=_0x232db3;}}logger[_0x5276('0x72')](_0x5276('0xab'),_0x4a048a[_0x5276('0x43')],_0x232db3[_0x5276('0x49')],_0x232db3[_0x5276('0x54')],_[_0x5276('0x76')](_0x4a048a['variable'])[0x0],_0x4a048a[_0x5276('0xa5')]);_0x232db3[_0x5276('0xf')]=this['variables'][_0x4a048a['uniqueid']];}}}}catch(_0xfd7343){logger[_0x5276('0x39')](_0x5276('0xa2'),_0x4a048a[_0x5276('0x43')],util['inspect'](_0xfd7343,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5276('0x7')]['addVariable']=function(_0x5e763e,_0x35fd40,_0x19f7ea){var _0x384f80=[_0x5276('0xac'),_0x5276('0xad'),_0x5276('0xae'),_0x5276('0xaf'),_0x5276('0xb0'),_0x5276('0xb1'),_0x5276('0xb2'),_0x5276('0xb3'),_0x5276('0xb4'),_0x5276('0xb5'),_0x5276('0xb6'),_0x5276('0xb7'),_0x5276('0xb8'),'memberdynamic',_0x5276('0xb9'),'memberlastcall',_0x5276('0x8d'),_0x5276('0xba'),'memberrealtime'];if(!_[_0x5276('0x34')](_0x35fd40)&&!_['includes'](_0x384f80,_0x35fd40)){if(_[_0x5276('0x5f')](this[_0x5276('0xf')][_0x5e763e])){this[_0x5276('0xf')][_0x5e763e]={};}this[_0x5276('0xf')][_0x5e763e][_0x35fd40]=_0x19f7ea;}};VoiceQueueReport[_0x5276('0x7')][_0x5276('0x1f')]=function(_0x26125f){try{if(this[_0x5276('0x5e')](_0x26125f)){logger[_0x5276('0x41')](_0x5276('0xbb'),_0x26125f[_0x5276('0x43')],util[_0x5276('0x3b')](_0x26125f,{'showHidden':![],'depth':null}));if(this[_0x5276('0xa')][_0x26125f[_0x5276('0x43')]]){for(var _0x560c08=0x0,_0x40a65c={};_0x560c08=0x0?moment(_0x13c627['endtime'])['diff'](_0x13c627[_0xf60e('0x1a')],_0xf60e('0xf')):null,'data1':_0xf60e('0x1b'),'data2':_0x13c627[_0xf60e('0x1c')],'data3':_0x13c627[_0xf60e('0x11')],'data4':_0x13c627[_0xf60e('0x1d')]||null,'role':_0xf60e('0x13'),'internal':_0x13c627['accountcode']?_[_0xf60e('0x14')](_0x13c627[_0xf60e('0x1c')]):undefined,'uniqueid':_0x13c627['uniqueid']},'log':_0xf60e('0x5')});}; \ No newline at end of file +var _0x360c=['diff','starttime','outbound','dialstring','toNumber','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voiceDialReport','membername','endtime'];(function(_0x27889f,_0x4809b9){var _0x201713=function(_0x5e5c1e){while(--_0x5e5c1e){_0x27889f['push'](_0x27889f['shift']());}};_0x201713(++_0x4809b9);}(_0x360c,0xf5));var _0xc360=function(_0x47a472,_0x1cbaa4){_0x47a472=_0x47a472-0x0;var _0x1be52a=_0x360c[_0x47a472];return _0x1be52a;};'use strict';var moment=require(_0xc360('0x0'));var _=require(_0xc360('0x1'));var util=require('util');var client=require(_0xc360('0x2'));exports[_0xc360('0x3')]=function(_0x533f78){var _0x3a4161=_0x533f78[_0xc360('0x4')]||_0x533f78[_0xc360('0x5')];return client['Request'](_0xc360('0x6'),{'body':{'channel':_0xc360('0x7'),'membername':_0x533f78[_0xc360('0x8')],'interface':_[_0xc360('0x9')](_0x533f78[_0xc360('0xa')])?util['format'](_0xc360('0xb'),_0x533f78['lastAssignedTo']):_0x533f78[_0xc360('0xa')],'type':_0xc360('0xc'),'enterAt':_0x533f78[_0xc360('0xd')],'exitAt':_0x3a4161,'duration':moment(_0x3a4161)['diff'](_0x533f78[_0xc360('0xd')],_0xc360('0xe')),'data1':_0xc360('0xf'),'data2':_0x533f78[_0xc360('0x10')],'data3':_0x533f78[_0xc360('0x11')],'data4':null,'data5':_0x533f78[_0xc360('0x12')],'role':_0xc360('0x13'),'internal':_0x533f78[_0xc360('0x14')]?_['toNumber'](_0x533f78[_0xc360('0x14')]):undefined,'uniqueid':_0x533f78[_0xc360('0x15')]},'log':_0xc360('0x6')});};exports[_0xc360('0x16')]=function(_0x15ad90){return client['Request'](_0xc360('0x6'),{'body':{'channel':'voice','membername':_0x15ad90[_0xc360('0x17')],'interface':_0x15ad90['interface'],'type':'TALKING','enterAt':_0x15ad90['starttime'],'exitAt':_0x15ad90[_0xc360('0x18')],'duration':moment(_0x15ad90[_0xc360('0x18')])[_0xc360('0x19')](_0x15ad90['starttime'],_0xc360('0xe'))>=0x0?moment(_0x15ad90[_0xc360('0x18')])[_0xc360('0x19')](_0x15ad90[_0xc360('0x1a')],_0xc360('0xe')):null,'data1':_0xc360('0x1b'),'data2':_0x15ad90[_0xc360('0x14')],'data3':_0x15ad90[_0xc360('0x11')],'data4':_0x15ad90[_0xc360('0x1c')]||null,'role':_0xc360('0x13'),'internal':_0x15ad90[_0xc360('0x14')]?_[_0xc360('0x1d')](_0x15ad90['accountcode']):undefined,'uniqueid':_0x15ad90[_0xc360('0x15')]},'log':_0xc360('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index debfb74..b56f5a7 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe31=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0xe86041,_0x2fbd7b){var _0x1230a9=function(_0x1366e8){while(--_0x1366e8){_0xe86041['push'](_0xe86041['shift']());}};_0x1230a9(++_0x2fbd7b);}(_0xbe31,0x83));var _0x1be3=function(_0x554d75,_0x571688){_0x554d75=_0x554d75-0x0;var _0x2b6694=_0xbe31[_0x554d75];return _0x2b6694;};'use strict';var client=require('../client');exports[_0x1be3('0x0')]=function(){return client[_0x1be3('0x1')](_0x1be3('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1be3('0x3')]},'log':_0x1be3('0x4')});}; \ No newline at end of file +var _0x33d2=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0xbfa1af,_0x7ce64){var _0x197247=function(_0x3c45ff){while(--_0x3c45ff){_0xbfa1af['push'](_0xbfa1af['shift']());}};_0x197247(++_0x7ce64);}(_0x33d2,0x7f));var _0x233d=function(_0x49b14d,_0x578d07){_0x49b14d=_0x49b14d-0x0;var _0x3d2488=_0x33d2[_0x49b14d];return _0x3d2488;};'use strict';var client=require(_0x233d('0x0'));exports[_0x233d('0x1')]=function(){return client[_0x233d('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x233d('0x3')]},'log':_0x233d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 59e363c..88ccb49 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 _0xc7e8=['name','html','../client','getTemplates','Request','GetTemplate'];(function(_0x29a4aa,_0x259ccf){var _0x5d86d3=function(_0x59249a){while(--_0x59249a){_0x29a4aa['push'](_0x29a4aa['shift']());}};_0x5d86d3(++_0x259ccf);}(_0xc7e8,0xc2));var _0x8c7e=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xc7e8[_0x2132a3];return _0x21890c;};'use strict';var client=require(_0x8c7e('0x0'));exports[_0x8c7e('0x1')]=function(_0x2a4aac){return function(_0x1e389a){return client[_0x8c7e('0x2')](_0x8c7e('0x3'),{'options':{'raw':!![],'attributes':['id',_0x8c7e('0x4'),_0x8c7e('0x5')]},'log':_0x8c7e('0x3')});};}; \ No newline at end of file +var _0xf506=['GetTemplate','getTemplates','name','html'];(function(_0x4a6d0a,_0x28cae8){var _0x3855bf=function(_0x553e5f){while(--_0x553e5f){_0x4a6d0a['push'](_0x4a6d0a['shift']());}};_0x3855bf(++_0x28cae8);}(_0xf506,0x12d));var _0x6f50=function(_0x4246c9,_0x3a702c){_0x4246c9=_0x4246c9-0x0;var _0x128d43=_0xf506[_0x4246c9];return _0x128d43;};'use strict';var client=require('../client');exports[_0x6f50('0x0')]=function(_0x4e6754){return function(_0x1cb361){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x6f50('0x1'),_0x6f50('0x2')]},'log':_0x6f50('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3c890d9..97514b1 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 _0xc53d=['AnyConditions','value','Action','Actions','action','data2','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','name','channel','Condition','field','operator'];(function(_0x5d2791,_0x348d9a){var _0x3bb477=function(_0x2eb9f8){while(--_0x2eb9f8){_0x5d2791['push'](_0x5d2791['shift']());}};_0x3bb477(++_0x348d9a);}(_0xc53d,0xdd));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdc53('0x0'));exports[_0xdc53('0x1')]=function(_0x109f06){return function(_0xf65fff){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xdc53('0x2'),_0xdc53('0x3'),'status'],'include':[{'model':_0xdc53('0x4'),'as':'AllConditions','attributes':['id',_0xdc53('0x5'),_0xdc53('0x6'),'value']},{'model':_0xdc53('0x4'),'as':_0xdc53('0x7'),'attributes':['id',_0xdc53('0x5'),'operator',_0xdc53('0x8')]},{'model':_0xdc53('0x9'),'as':_0xdc53('0xa'),'attributes':['id',_0xdc53('0xb'),'data1',_0xdc53('0xc'),_0xdc53('0xd'),_0xdc53('0xe'),_0xdc53('0xf'),_0xdc53('0x10'),_0xdc53('0x11')]}]},'log':_0xdc53('0x12')});};}; \ No newline at end of file +var _0x14be=['value','Condition','AnyConditions','field','Action','Actions','data1','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','operator'];(function(_0xc18ce1,_0x329f9b){var _0x12ea8b=function(_0x1cac01){while(--_0x1cac01){_0xc18ce1['push'](_0xc18ce1['shift']());}};_0x12ea8b(++_0x329f9b);}(_0x14be,0x171));var _0xe14b=function(_0x41dcef,_0x9e92e){_0x41dcef=_0x41dcef-0x0;var _0xa260d1=_0x14be[_0x41dcef];return _0xa260d1;};'use strict';var client=require(_0xe14b('0x0'));exports[_0xe14b('0x1')]=function(_0xc3a1c7){return function(_0x3a10a2){return client[_0xe14b('0x2')](_0xe14b('0x3'),{'options':{'raw':![],'attributes':['id',_0xe14b('0x4'),_0xe14b('0x5'),_0xe14b('0x6')],'include':[{'model':'Condition','as':_0xe14b('0x7'),'attributes':['id','field',_0xe14b('0x8'),_0xe14b('0x9')]},{'model':_0xe14b('0xa'),'as':_0xe14b('0xb'),'attributes':['id',_0xe14b('0xc'),_0xe14b('0x8'),_0xe14b('0x9')]},{'model':_0xe14b('0xd'),'as':_0xe14b('0xe'),'attributes':['id','action',_0xe14b('0xf'),_0xe14b('0x10'),'data3',_0xe14b('0x11'),_0xe14b('0x12'),_0xe14b('0x13'),_0xe14b('0x14')]}]},'log':_0xe14b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d42cac2..47e8365 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 _0x3b75=['../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x14a7e2,_0x4916f1){var _0x35941e=function(_0x56ad06){while(--_0x56ad06){_0x14a7e2['push'](_0x14a7e2['shift']());}};_0x35941e(++_0x4916f1);}(_0x3b75,0x144));var _0x53b7=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x3b75[_0x2132a3];return _0x21890c;};'use strict';var client=require(_0x53b7('0x0'));exports[_0x53b7('0x1')]=function(_0x43da7f){return function(_0x9db663){return client[_0x53b7('0x2')](_0x53b7('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x53b7('0x4'),_0x53b7('0x5'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xaeef=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x1da35e,_0x5868e3){var _0x2ec721=function(_0x44f744){while(--_0x44f744){_0x1da35e['push'](_0x1da35e['shift']());}};_0x2ec721(++_0x5868e3);}(_0xaeef,0x14a));var _0xfaee=function(_0x2de34b,_0xecd5f0){_0x2de34b=_0x2de34b-0x0;var _0x24608b=_0xaeef[_0x2de34b];return _0x24608b;};'use strict';var client=require(_0xfaee('0x0'));exports[_0xfaee('0x1')]=function(_0x3a75f9){return function(_0x55a01e){return client[_0xfaee('0x2')](_0xfaee('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xfaee('0x4'),_0xfaee('0x5'),_0xfaee('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 84392ca..185ed3c 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe706,0xa3));var _0x6e70=function(_0x4df5d3,_0x522c48){_0x4df5d3=_0x4df5d3-0x0;var _0x34a8d=_0xe706[_0x4df5d3];return _0x34a8d;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x5e492a,_0x372ba5){var _0x12c0e3=function(_0x23e2f2){while(--_0x23e2f2){_0x5e492a['push'](_0x5e492a['shift']());}};_0x12c0e3(++_0x372ba5);}(_0x34e8,0x12c));var _0x834e=function(_0x949675,_0x2076bc){_0x949675=_0x949675-0x0;var _0x40ef14=_0x34e8[_0x949675];return _0x40ef14;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5206cfc..b757053 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 _0x5211=['update','../client','create','Request','CreateVoiceAgentReport'];(function(_0xc6799a,_0x2b5236){var _0x2399f3=function(_0x221e37){while(--_0x221e37){_0xc6799a['push'](_0xc6799a['shift']());}};_0x2399f3(++_0x2b5236);}(_0x5211,0x79));var _0x1521=function(_0x3d70ae,_0x6ddb0f){_0x3d70ae=_0x3d70ae-0x0;var _0x1ba273=_0x5211[_0x3d70ae];return _0x1ba273;};'use strict';var client=require(_0x1521('0x0'));exports[_0x1521('0x1')]=function(_0x530947){return client[_0x1521('0x2')](_0x1521('0x3'),{'body':_0x530947,'log':'CreateVoiceAgentReport'});};exports[_0x1521('0x4')]=function(_0x5e67e3,_0x13d125,_0x271c1e){return client[_0x1521('0x2')]('UpdateVoiceAgentReport',{'body':_0x5e67e3,'options':{'where':{'uniqueid':_0x13d125,'interface':_0x271c1e,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x1539=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1539,0x1b0));var _0x9153=function(_0x5626bf,_0x2cb83d){_0x5626bf=_0x5626bf-0x0;var _0x39ecd8=_0x1539[_0x5626bf];return _0x39ecd8;};'use strict';var client=require(_0x9153('0x0'));exports[_0x9153('0x1')]=function(_0x477309){return client[_0x9153('0x2')]('CreateVoiceAgentReport',{'body':_0x477309,'log':_0x9153('0x3')});};exports[_0x9153('0x4')]=function(_0x3a8d35,_0x126eb3,_0xfa5a8f){return client[_0x9153('0x2')]('UpdateVoiceAgentReport',{'body':_0x3a8d35,'options':{'where':{'uniqueid':_0x126eb3,'interface':_0xfa5a8f,'agentcomplete':!![]}},'log':_0x9153('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index dc9d17b..90e6466 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 _0x7f40=['CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','disposition','duration','moment','util','lodash','create','Request'];(function(_0x4990f2,_0x16a78e){var _0x44115d=function(_0x80f247){while(--_0x80f247){_0x4990f2['push'](_0x4990f2['shift']());}};_0x44115d(++_0x16a78e);}(_0x7f40,0x19d));var _0x07f4=function(_0x2565a8,_0x1cfacd){_0x2565a8=_0x2565a8-0x0;var _0x122bee=_0x7f40[_0x2565a8];return _0x122bee;};'use strict';var moment=require(_0x07f4('0x0'));var util=require(_0x07f4('0x1'));var _=require(_0x07f4('0x2'));var client=require('../client');exports[_0x07f4('0x3')]=function(_0x32ae21){return client[_0x07f4('0x4')](_0x07f4('0x5'),{'body':_[_0x07f4('0x6')](_0x32ae21,{'source':_0x32ae21[_0x07f4('0x7')],'destinationcontext':_0x32ae21['context'],'callerid':_0x32ae21[_0x07f4('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x07f4('0x5')});};exports[_0x07f4('0x9')]=function(){return function(){return client['Request'](_0x07f4('0xa'),{'options':{'where':{'type':[_0x07f4('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x07f4('0xc'))['format'](_0x07f4('0xd')),moment()[_0x07f4('0xe')]('day')[_0x07f4('0xf')](_0x07f4('0xd'))]}},'attributes':[_0x07f4('0x10'),_0x07f4('0x11'),_0x07f4('0x12'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x556a=['DOCUMENTATION','getVoiceCallReports','Request','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','create','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x556a,0x77));var _0xa556=function(_0x3bce8f,_0x2e8a04){_0x3bce8f=_0x3bce8f-0x0;var _0x129dfa=_0x556a[_0x3bce8f];return _0x129dfa;};'use strict';var moment=require(_0xa556('0x0'));var util=require('util');var _=require(_0xa556('0x1'));var client=require('../client');exports[_0xa556('0x2')]=function(_0x49ee45){return client['Request'](_0xa556('0x3'),{'body':_[_0xa556('0x4')](_0x49ee45,{'source':_0x49ee45[_0xa556('0x5')],'destinationcontext':_0x49ee45[_0xa556('0x6')],'callerid':_0x49ee45['callerid'],'amaflags':_0xa556('0x7')}),'log':_0xa556('0x3')});};exports[_0xa556('0x8')]=function(){return function(){return client[_0xa556('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xa556('0xa'))[_0xa556('0xb')](_0xa556('0xc')),moment()['endOf'](_0xa556('0xa'))[_0xa556('0xb')](_0xa556('0xc'))]}},'attributes':[_0xa556('0xd'),_0xa556('0xe'),_0xa556('0xf'),_0xa556('0x10')]},'log':_0xa556('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fd22279..e0dd8ad 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 _0x3b8e=['Request','CreateVoiceDialReport','create'];(function(_0x3c657a,_0x7c3b70){var _0x31f0af=function(_0x5f4566){while(--_0x5f4566){_0x3c657a['push'](_0x3c657a['shift']());}};_0x31f0af(++_0x7c3b70);}(_0x3b8e,0x74));var _0xe3b8=function(_0x4af713,_0x540f7d){_0x4af713=_0x4af713-0x0;var _0x41a1ec=_0x3b8e[_0x4af713];return _0x41a1ec;};'use strict';var client=require('../client');exports[_0xe3b8('0x0')]=function(_0x2ac9b4){return client[_0xe3b8('0x1')]('CreateVoiceDialReport',{'body':_0x2ac9b4,'log':_0xe3b8('0x2')});}; \ No newline at end of file +var _0x4222=['../client','create','Request','CreateVoiceDialReport'];(function(_0x3d61f0,_0x3eaaa1){var _0x635f9c=function(_0x26c6a7){while(--_0x26c6a7){_0x3d61f0['push'](_0x3d61f0['shift']());}};_0x635f9c(++_0x3eaaa1);}(_0x4222,0x174));var _0x2422=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x4222[_0x82129b];return _0x2ae5dc;};'use strict';var client=require(_0x2422('0x0'));exports[_0x2422('0x1')]=function(_0x5a1da0){return client[_0x2422('0x2')](_0x2422('0x3'),{'body':_0x5a1da0,'log':_0x2422('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index fb659ce..4a1bfde 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 _0xde56=['../client','Request','GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x525bf1,_0x39c247){var _0x1aff6b=function(_0x27669a){while(--_0x27669a){_0x525bf1['push'](_0x525bf1['shift']());}};_0x1aff6b(++_0x39c247);}(_0xde56,0x144));var _0x6de5=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xde56[_0x166d93];return _0xba708;};'use strict';var client=require(_0x6de5('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x6de5('0x1')](_0x6de5('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6de5('0x3'),_0x6de5('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x6de5('0x5')});};}; \ No newline at end of file +var _0xdb94=['exten','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x1ea66f,_0x1b398a){var _0x14196a=function(_0x4c157a){while(--_0x4c157a){_0x1ea66f['push'](_0x1ea66f['shift']());}};_0x14196a(++_0x1b398a);}(_0xdb94,0xab));var _0x4db9=function(_0x4718c4,_0x522978){_0x4718c4=_0x4718c4-0x0;var _0x5f58a3=_0xdb94[_0x4718c4];return _0x5f58a3;};'use strict';var client=require(_0x4db9('0x0'));exports[_0x4db9('0x1')]=function(){return function(){return client[_0x4db9('0x2')](_0x4db9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x4db9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4db9('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8e7ead6..ef23e3f 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 _0x8ce2=['dialRandomLastDigitCallerIdNumber','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2'];(function(_0x396097,_0x231219){var _0x4f48ed=function(_0x5ef60d){while(--_0x5ef60d){_0x396097['push'](_0x396097['shift']());}};_0x4f48ed(++_0x231219);}(_0x8ce2,0xbe));var _0x28ce=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ce2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x28ce('0x0'));exports[_0x28ce('0x1')]=function(){return function(){return client[_0x28ce('0x2')](_0x28ce('0x3'),{'options':{'raw':![],'attributes':['id',_0x28ce('0x4'),_0x28ce('0x5'),_0x28ce('0x6'),_0x28ce('0x7'),_0x28ce('0x8'),_0x28ce('0x9'),_0x28ce('0xa'),_0x28ce('0xb'),_0x28ce('0xc'),'dialLimitQueue',_0x28ce('0xd'),_0x28ce('0xe'),'dialPredictiveOptimizationPercentage',_0x28ce('0xf'),_0x28ce('0x10'),_0x28ce('0x11'),_0x28ce('0x12'),_0x28ce('0x13'),'dialQueueTimeout','dialQueueProject',_0x28ce('0x14'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x28ce('0x15'),'dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency',_0x28ce('0x16'),_0x28ce('0x17'),_0x28ce('0x18'),'dialPrefix','dialCheckDuplicateType',_0x28ce('0x19'),'dialAMDInitialSilence',_0x28ce('0x1a'),_0x28ce('0x1b'),'dialAMDTotalAnalysisTime',_0x28ce('0x1c'),_0x28ce('0x1d'),'dialAMDMaximumNumberOfWords',_0x28ce('0x1e'),_0x28ce('0x1f'),_0x28ce('0x20'),_0x28ce('0x21'),_0x28ce('0x22'),_0x28ce('0x23'),'dialAgiAfterHangupAgent',_0x28ce('0x24'),_0x28ce('0x25'),_0x28ce('0x8'),'strategy',_0x28ce('0x26'),'dialCutDigit','dialNoSuchNumberMaxRetry',_0x28ce('0x27'),_0x28ce('0x28'),_0x28ce('0x29'),_0x28ce('0x2a'),_0x28ce('0x2b'),_0x28ce('0x2c'),'dialMachineRetryFrequency',_0x28ce('0x2d'),_0x28ce('0x2e'),_0x28ce('0x2f'),_0x28ce('0x30'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x28ce('0x31'),'as':_0x28ce('0x31'),'attributes':['id',_0x28ce('0x4'),_0x28ce('0x32'),_0x28ce('0x33')]},{'model':_0x28ce('0x34'),'as':_0x28ce('0x35'),'attributes':['id',_0x28ce('0x4')]},{'model':_0x28ce('0x31'),'as':_0x28ce('0x36'),'attributes':['id',_0x28ce('0x4'),_0x28ce('0x32'),_0x28ce('0x33')]},{'model':_0x28ce('0x37'),'as':_0x28ce('0x37'),'attributes':['id',_0x28ce('0x4')],'include':[{'model':_0x28ce('0x37'),'as':_0x28ce('0x38'),'attributes':['id','name','interval']}]}]},'log':_0x28ce('0x1')});};}; \ No newline at end of file +var _0x06e0=['dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval'];(function(_0x1abc66,_0xc25cd5){var _0x4f5485=function(_0x196cd6){while(--_0x196cd6){_0x1abc66['push'](_0x1abc66['shift']());}};_0x4f5485(++_0xc25cd5);}(_0x06e0,0x9a));var _0x006e=function(_0x4264bf,_0x39db0f){_0x4264bf=_0x4264bf-0x0;var _0x515e5f=_0x06e0[_0x4264bf];return _0x515e5f;};'use strict';var client=require(_0x006e('0x0'));exports[_0x006e('0x1')]=function(){return function(){return client[_0x006e('0x2')](_0x006e('0x3'),{'options':{'raw':![],'attributes':['id',_0x006e('0x4'),_0x006e('0x5'),_0x006e('0x6'),_0x006e('0x7'),_0x006e('0x8'),_0x006e('0x9'),_0x006e('0xa'),'dialMethod',_0x006e('0xb'),_0x006e('0xc'),_0x006e('0xd'),_0x006e('0xe'),'dialPredictiveOptimizationPercentage',_0x006e('0xf'),'dialOriginateCallerIdName',_0x006e('0x10'),_0x006e('0x11'),'dialQueueOptions',_0x006e('0x12'),_0x006e('0x13'),_0x006e('0x14'),_0x006e('0x15'),_0x006e('0x16'),_0x006e('0x17'),_0x006e('0x18'),_0x006e('0x19'),_0x006e('0x1a'),_0x006e('0x1b'),_0x006e('0x1c'),_0x006e('0x1d'),_0x006e('0x1e'),_0x006e('0x1f'),_0x006e('0x20'),'dialAMDGreeting',_0x006e('0x21'),'dialAMDTotalAnalysisTime',_0x006e('0x22'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x006e('0x23'),_0x006e('0x24'),_0x006e('0x25'),'dialRecallMeTimeout',_0x006e('0x26'),_0x006e('0x27'),_0x006e('0x28'),_0x006e('0x29'),_0x006e('0x2a'),_0x006e('0x8'),_0x006e('0x2b'),_0x006e('0x2c'),'dialCutDigit',_0x006e('0x2d'),_0x006e('0x2e'),'dialDropMaxRetry',_0x006e('0x2f'),_0x006e('0x30'),_0x006e('0x31'),'dialMachineMaxRetry',_0x006e('0x32'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x006e('0x33'),_0x006e('0x34'),_0x006e('0x35')],'include':[{'model':_0x006e('0x36'),'as':'Trunk','attributes':['id',_0x006e('0x4'),_0x006e('0x37'),'active']},{'model':_0x006e('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0x006e('0x4')]},{'model':'Trunk','as':_0x006e('0x39'),'attributes':['id',_0x006e('0x4'),_0x006e('0x37'),'active']},{'model':_0x006e('0x3a'),'as':_0x006e('0x3a'),'attributes':['id',_0x006e('0x4')],'include':[{'model':_0x006e('0x3a'),'as':_0x006e('0x3b'),'attributes':['id',_0x006e('0x4'),_0x006e('0x3c')]}]}]},'log':_0x006e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d4893fc..c110f0c 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4c4b9e,_0x26f82a){var _0x3e2836=function(_0x3fd01f){while(--_0x3fd01f){_0x4c4b9e['push'](_0x4c4b9e['shift']());}};_0x3e2836(++_0x26f82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x142033,_0x58219c){var _0x5430c0=function(_0x21ca66){while(--_0x21ca66){_0x142033['push'](_0x142033['shift']());}};_0x5430c0(++_0x58219c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 4fafcf6..20d15ba 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 _0x1813=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3fd367,_0x4882d5){var _0x297872=function(_0x20d8c1){while(--_0x20d8c1){_0x3fd367['push'](_0x3fd367['shift']());}};_0x297872(++_0x4882d5);}(_0x1813,0x9e));var _0x3181=function(_0x5712a0,_0x38319b){_0x5712a0=_0x5712a0-0x0;var _0x1d5f47=_0x1813[_0x5712a0];return _0x1d5f47;};'use strict';var client=require(_0x3181('0x0'));exports[_0x3181('0x1')]=function(_0xb785a8){return function(){return client[_0x3181('0x2')](_0x3181('0x3'),{'options':{'where':{'VoiceQueueId':_0xb785a8,'paused':!![]},'raw':!![]},'log':_0x3181('0x1')});};}; \ No newline at end of file +var _0x4fc9=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x4fc9,0xc0));var _0x94fc=function(_0x403399,_0x37356d){_0x403399=_0x403399-0x0;var _0x1b0154=_0x4fc9[_0x403399];return _0x1b0154;};'use strict';var client=require(_0x94fc('0x0'));exports['getVoiceQueueRtPauses']=function(_0x326961){return function(){return client[_0x94fc('0x1')](_0x94fc('0x2'),{'options':{'where':{'VoiceQueueId':_0x326961,'paused':!![]},'raw':!![]},'log':_0x94fc('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 824f44e..30aae4f 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x5d5f9f,_0x3765fb){var _0x28da82=function(_0x5a706e){while(--_0x5a706e){_0x5d5f9f['push'](_0x5d5f9f['shift']());}};_0x28da82(++_0x3765fb);}(_0x7a54,0x106));var _0x47a5=function(_0x27b3b5,_0x5b35ad){_0x27b3b5=_0x27b3b5-0x0;var _0x4051ed=_0x7a54[_0x27b3b5];return _0x4051ed;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x40afd3,_0x4460af){var _0x56ceda=function(_0x5ac386){while(--_0x5ac386){_0x40afd3['push'](_0x40afd3['shift']());}};_0x56ceda(++_0x4460af);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 1a1382b..a2384ca 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 _0x710f=['transfereelinkedid','extension','blind','CreateVoiceTransferReport','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','result','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereecontext'];(function(_0x10db66,_0x1889c6){var _0x5d4751=function(_0x3c478c){while(--_0x3c478c){_0x10db66['push'](_0x10db66['shift']());}};_0x5d4751(++_0x1889c6);}(_0x710f,0x131));var _0xf710=function(_0xe5376a,_0x3ed99e){_0xe5376a=_0xe5376a-0x0;var _0xa6d1e8=_0x710f[_0xe5376a];return _0xa6d1e8;};'use strict';var client=require(_0xf710('0x0'));exports[_0xf710('0x1')]={};exports[_0xf710('0x2')]=function(_0x739229){return client[_0xf710('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x739229[_0xf710('0x4')],'transfererchannel':_0x739229['transfererchannel'],'transferercalleridnum':_0x739229[_0xf710('0x5')],'transferercalleridname':_0x739229['transferercalleridname'],'transfererconnectedlinenum':_0x739229[_0xf710('0x6')],'transfererconnectedlinename':_0x739229['transfererconnectedlinename'],'transfereraccountcode':_0x739229[_0xf710('0x7')],'transferercontext':_0x739229[_0xf710('0x8')],'transfererexten':_0x739229[_0xf710('0x9')],'transfererlinkedid':_0x739229[_0xf710('0xa')],'transfereechannel':_0x739229[_0xf710('0xb')],'transfereecalleridnum':_0x739229[_0xf710('0xc')],'transfereecalleridname':_0x739229['transfereecalleridname'],'transfereeconnectedlinenum':_0x739229[_0xf710('0xd')],'transfereeconnectedlinename':_0x739229['transfereeconnectedlinename'],'transfereeaccountcode':_0x739229['transfereeaccountcode'],'transfereecontext':_0x739229[_0xf710('0xe')],'transfereeexten':_0x739229['transfereeexten'],'transfereelinkedid':_0x739229[_0xf710('0xf')],'isexternal':_0x739229['isexternal'],'context':_0x739229['context'],'extension':_0x739229[_0xf710('0x10')],'type':_0xf710('0x11')},'log':_0xf710('0x12')});};exports['attendedTransfer']=function(_0x478c48){return client['Request'](_0xf710('0x12'),{'body':{'result':_0x478c48['result'],'transfererchannel':_0x478c48['origtransfererchannel'],'transferercalleridnum':_0x478c48['origtransferercalleridnum'],'transferercalleridname':_0x478c48[_0xf710('0x13')],'transfererconnectedlinenum':_0x478c48[_0xf710('0x14')],'transfererconnectedlinename':_0x478c48['secondtransfererconnectedlinename'],'transfereraccountcode':_0x478c48[_0xf710('0x15')],'transferercontext':_0x478c48['secondtransferercontext'],'transfererexten':_0x478c48[_0xf710('0x16')],'transfererlinkedid':_0x478c48[_0xf710('0x17')],'transfereechannel':_0x478c48[_0xf710('0x18')],'transfereecalleridnum':_0x478c48['transfertargetcalleridnum'],'transfereecalleridname':_0x478c48['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x478c48[_0xf710('0x19')],'transfereeconnectedlinename':_0x478c48[_0xf710('0x1a')],'transfereeaccountcode':_0x478c48['transfertargetaccountcode'],'transfereecontext':_0x478c48[_0xf710('0x1b')],'transfereeexten':_0x478c48[_0xf710('0x1c')],'transfereelinkedid':_0x478c48['transfertargetlinkedid'],'isexternal':_0x478c48[_0xf710('0x1d')],'context':_0x478c48[_0xf710('0x1e')],'extension':_0x478c48[_0xf710('0x1f')],'type':'attended'},'log':_0xf710('0x12')});}; \ No newline at end of file +var _0x0667=['transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','attended','blindTransfer','Request','CreateVoiceTransferReport','result'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x0667,0xc4));var _0x7066=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0667[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x7066('0x0')]=function(_0x31352b){return client[_0x7066('0x1')](_0x7066('0x2'),{'body':{'result':_0x31352b[_0x7066('0x3')],'transfererchannel':_0x31352b[_0x7066('0x4')],'transferercalleridnum':_0x31352b[_0x7066('0x5')],'transferercalleridname':_0x31352b[_0x7066('0x6')],'transfererconnectedlinenum':_0x31352b[_0x7066('0x7')],'transfererconnectedlinename':_0x31352b['transfererconnectedlinename'],'transfereraccountcode':_0x31352b[_0x7066('0x8')],'transferercontext':_0x31352b[_0x7066('0x9')],'transfererexten':_0x31352b[_0x7066('0xa')],'transfererlinkedid':_0x31352b['transfererlinkedid'],'transfereechannel':_0x31352b[_0x7066('0xb')],'transfereecalleridnum':_0x31352b['transfereecalleridnum'],'transfereecalleridname':_0x31352b[_0x7066('0xc')],'transfereeconnectedlinenum':_0x31352b[_0x7066('0xd')],'transfereeconnectedlinename':_0x31352b[_0x7066('0xe')],'transfereeaccountcode':_0x31352b[_0x7066('0xf')],'transfereecontext':_0x31352b[_0x7066('0x10')],'transfereeexten':_0x31352b[_0x7066('0x11')],'transfereelinkedid':_0x31352b[_0x7066('0x12')],'isexternal':_0x31352b[_0x7066('0x13')],'context':_0x31352b[_0x7066('0x14')],'extension':_0x31352b[_0x7066('0x15')],'type':_0x7066('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x7066('0x17')]=function(_0x59a2fc){return client['Request'](_0x7066('0x2'),{'body':{'result':_0x59a2fc[_0x7066('0x3')],'transfererchannel':_0x59a2fc['origtransfererchannel'],'transferercalleridnum':_0x59a2fc[_0x7066('0x18')],'transferercalleridname':_0x59a2fc[_0x7066('0x19')],'transfererconnectedlinenum':_0x59a2fc[_0x7066('0x1a')],'transfererconnectedlinename':_0x59a2fc[_0x7066('0x1b')],'transfereraccountcode':_0x59a2fc[_0x7066('0x1c')],'transferercontext':_0x59a2fc[_0x7066('0x1d')],'transfererexten':_0x59a2fc[_0x7066('0x1e')],'transfererlinkedid':_0x59a2fc[_0x7066('0x1f')],'transfereechannel':_0x59a2fc['transfertargetchannel'],'transfereecalleridnum':_0x59a2fc['transfertargetcalleridnum'],'transfereecalleridname':_0x59a2fc[_0x7066('0x20')],'transfereeconnectedlinenum':_0x59a2fc[_0x7066('0x21')],'transfereeconnectedlinename':_0x59a2fc[_0x7066('0x22')],'transfereeaccountcode':_0x59a2fc[_0x7066('0x23')],'transfereecontext':_0x59a2fc[_0x7066('0x24')],'transfereeexten':_0x59a2fc['transfertargetexten'],'transfereelinkedid':_0x59a2fc[_0x7066('0x25')],'isexternal':_0x59a2fc['isexternal'],'context':_0x59a2fc[_0x7066('0x26')],'extension':_0x59a2fc['origtransfererexten'],'type':_0x7066('0x27')},'log':_0x7066('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index dee782d..7977c6f 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 _0x83d0=['%s.%s','filename','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','StopMixMonitor','destinationchannel','wav','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../properties','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','username','ami\x20disconnected','join','pick','keys','action','Action','then','message','catch','asterisk','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','isConnected','voicechannel','map','channel','format'];(function(_0x14548e,_0x1070fb){var _0x2f39ed=function(_0x33e505){while(--_0x33e505){_0x14548e['push'](_0x14548e['shift']());}};_0x2f39ed(++_0x1070fb);}(_0x83d0,0xb7));var _0x083d=function(_0x4af17c,_0x5adca9){_0x4af17c=_0x4af17c-0x0;var _0x2e6867=_0x83d0[_0x4af17c];return _0x2e6867;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var jayson=require(_0x083d('0x2'));var schema=require(_0x083d('0x3'));var BPromise=require(_0x083d('0x4'));var moment=require(_0x083d('0x5'));var config=require('../../../config/environment');var properties=require(_0x083d('0x6'));var ami=require('../ami');exports['listen']=function(_0x404d77,_0x143ec8,_0x3c4b8c){return new BPromise(function(_0x2e75e8,_0x472c6b){var _0x52a3e7={'QueuePause':function(_0x4ec2e7){return new Promise(function(_0xddbf58,_0x32fa2c){var _0x3000d7=util['format'](_0x083d('0x7'),_0x083d('0x8'),_0x4ec2e7[_0x083d('0x9')]);if(_0x404d77[_0x083d('0xa')]&&_0x404d77['timers'][_0x3000d7]&&_0x404d77[_0x083d('0xa')][_0x3000d7]['timer']){_0x404d77[_0x083d('0xa')][_0x3000d7][_0x083d('0xb')]();}if(_0x404d77['agents'][_0x3000d7]){_0x404d77[_0x083d('0xc')][_0x3000d7][_0x083d('0xd')]({'statePause':_0x4ec2e7[_0x083d('0xe')]?!![]:![]});}_0xddbf58({'code':0xc8,'message':_0x083d('0xf')});});},'Reload':function(_0x3dfe4a){var _0x59fd41=this;return new Promise(function(_0xeb0ac2,_0x2266b2){if(ami['isConnected']()==![]){return _0x2266b2(_0x59fd41[_0x083d('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x083d('0x11')],_0x083d('0x12')][_0x083d('0x13')]('\x20')));}_0x3dfe4a=_[_0x083d('0x14')](_0x3dfe4a,_[_0x083d('0x15')](properties['module']));_0x3dfe4a[_0x083d('0x16')]='Reload';return ami[_0x083d('0x17')](_0x3dfe4a)[_0x083d('0x18')](function(_0x24708d){_0xeb0ac2({'code':0xc8,'message':_0x24708d[_0x083d('0x19')]});})[_0x083d('0x1a')](function(_0x63c0b6){_0x2266b2(_0x59fd41[_0x083d('0x10')](0x1f5,_0x63c0b6[_0x083d('0x19')]));});});},'Command':function(_0x160afb){var _0x2cb79c=this;return new Promise(function(_0x3ae260,_0xb8a16f){if(ami['isConnected']()==![]){return _0xb8a16f(_0x2cb79c[_0x083d('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x083d('0x1b')][_0x083d('0x11')],'ami\x20disconnected'][_0x083d('0x13')]('\x20')));}_0x160afb=_['pick'](_0x160afb,'command');_0x160afb['action']=_0x083d('0x1c');return ami[_0x083d('0x17')](_0x160afb)[_0x083d('0x18')](function(_0x2669b6){_0x3ae260({'code':0xc8,'message':_0x2669b6[_0x083d('0x1d')]});})[_0x083d('0x1a')](function(_0x5d8397){_0xb8a16f(_0x2cb79c[_0x083d('0x10')](0x1f5,_0x5d8397[_0x083d('0x19')]));});});},'VoiceQueues':function(_0x5e6e43){return new Promise(function(_0x3a0ce2,_0x38ca23){var _0x33d32a=[];for(var _0x3117af in _0x404d77[_0x083d('0x1e')]){if(_0x404d77[_0x083d('0x1e')][_0x083d('0x1f')](_0x3117af)){var _0x3923ff=_0x404d77['voiceQueues'][_0x3117af];var _0x6bccbd={'id':_0x3923ff['id'],'name':_0x3923ff['name'],'strategy':_0x3923ff[_0x083d('0x20')],'answered':_0x3923ff[_0x083d('0x21')],'available':_0x3923ff[_0x083d('0x22')],'loggedIn':_0x3923ff[_0x083d('0x23')],'pTalking':_0x3923ff[_0x083d('0x24')],'sumBillable':_0x3923ff[_0x083d('0x25')],'sumDuration':_0x3923ff[_0x083d('0x26')],'sumHoldTime':_0x3923ff[_0x083d('0x27')]||0x0,'talking':_0x3923ff[_0x083d('0x28')],'total':_0x3923ff[_0x083d('0x29')],'type':_0x3923ff[_0x083d('0x2a')],'unmanaged':_0x3923ff[_0x083d('0x2b')],'abandoned':_0x3923ff[_0x083d('0x2c')],'waiting':_0x3923ff[_0x083d('0x2d')],'loggedInDb':_0x3923ff[_0x083d('0x2e')]};if(_0x3923ff['type']===_0x083d('0x2f')){_0x6bccbd[_0x083d('0x30')]=_0x3923ff['dialActive'];_0x6bccbd['dialMethod']=_0x3923ff[_0x083d('0x31')];_0x6bccbd['dialOriginateCallerIdName']=_0x3923ff[_0x083d('0x32')];_0x6bccbd['dialOriginateCallerIdNumber']=_0x3923ff[_0x083d('0x33')];_0x6bccbd['dialOriginateTimeout']=_0x3923ff[_0x083d('0x34')];_0x6bccbd[_0x083d('0x35')]=_0x3923ff[_0x083d('0x35')];_0x6bccbd['temp']=_0x3923ff['temp'];_0x6bccbd[_0x083d('0x36')]=_0x3923ff['outboundAnswerAgiCallsDay'];_0x6bccbd[_0x083d('0x37')]=_0x3923ff[_0x083d('0x37')];_0x6bccbd[_0x083d('0x38')]=_0x3923ff[_0x083d('0x38')];_0x6bccbd['outboundBusyCallsDay']=_0x3923ff[_0x083d('0x39')];_0x6bccbd[_0x083d('0x3a')]=_0x3923ff[_0x083d('0x3a')];_0x6bccbd[_0x083d('0x3b')]=_0x3923ff['outboundDropCallsDayACS'];_0x6bccbd[_0x083d('0x3c')]=_0x3923ff[_0x083d('0x3c')];_0x6bccbd[_0x083d('0x3d')]=_0x3923ff[_0x083d('0x3d')];_0x6bccbd['outboundNoAnswerCallsDay']=_0x3923ff['outboundNoAnswerCallsDay'];_0x6bccbd[_0x083d('0x3e')]=_0x3923ff[_0x083d('0x3e')];_0x6bccbd[_0x083d('0x3f')]=_0x3923ff[_0x083d('0x3f')];_0x6bccbd[_0x083d('0x40')]=_0x3923ff['outboundReCallsDay'];_0x6bccbd[_0x083d('0x41')]=_0x3923ff[_0x083d('0x41')];_0x6bccbd['outboundUnknownCallsDay']=_0x3923ff[_0x083d('0x42')];_0x6bccbd['predictiveIntervalAnsweredCalls']=_0x3923ff['predictiveIntervalAnsweredCalls'];_0x6bccbd[_0x083d('0x43')]=_0x3923ff[_0x083d('0x43')];_0x6bccbd['predictiveIntervalAvgTalktime']=_0x3923ff[_0x083d('0x44')];_0x6bccbd[_0x083d('0x45')]=_0x3923ff[_0x083d('0x45')];_0x6bccbd['predictiveIntervalDroppedCallsTimeout']=_0x3923ff['predictiveIntervalDroppedCallsTimeout'];_0x6bccbd['predictiveIntervalErlangCalls']=_0x3923ff['predictiveIntervalErlangCalls'];_0x6bccbd[_0x083d('0x46')]=_0x3923ff[_0x083d('0x46')];_0x6bccbd[_0x083d('0x47')]=_0x3923ff[_0x083d('0x47')];_0x6bccbd['predictiveIntervalMultiplicativeFactor']=_0x3923ff[_0x083d('0x48')];_0x6bccbd[_0x083d('0x49')]=_0x3923ff['predictiveIntervalPauses'];_0x6bccbd[_0x083d('0x4a')]=_0x3923ff[_0x083d('0x4a')];_0x6bccbd[_0x083d('0x4b')]=_0x3923ff[_0x083d('0x4b')];_0x6bccbd[_0x083d('0x19')]=_0x3923ff[_0x083d('0x19')];_0x6bccbd[_0x083d('0x4c')]=_0x3923ff[_0x083d('0x4c')];_0x6bccbd['erlangCalls']=_0x3923ff[_0x083d('0x4d')];_0x6bccbd[_0x083d('0x4e')]=_0x3923ff[_0x083d('0x4e')];_0x6bccbd[_0x083d('0x4f')]=_0x3923ff[_0x083d('0x4f')];_0x6bccbd[_0x083d('0x50')]=_0x3923ff[_0x083d('0x50')];_0x6bccbd['startPredictive']=_0x3923ff[_0x083d('0x51')];_0x6bccbd[_0x083d('0x52')]=_0x3923ff['startProgressive'];}if(_0x3923ff[_0x083d('0x53')]){_0x6bccbd[_0x083d('0x53')]={'id':_0x3923ff[_0x083d('0x53')]['id'],'name':_0x3923ff[_0x083d('0x53')][_0x083d('0x9')],'active':_0x3923ff['Trunk'][_0x083d('0x54')],'callerid':_0x3923ff[_0x083d('0x53')][_0x083d('0x55')]};}if(_0x3923ff[_0x083d('0x56')]){_0x6bccbd[_0x083d('0x56')]={'id':_0x3923ff['Interval']['id'],'name':_0x3923ff[_0x083d('0x56')][_0x083d('0x9')]};}_0x33d32a[_0x083d('0x57')](_0x6bccbd);}}_0x3a0ce2({'count':_0x33d32a[_0x083d('0x58')],'rows':_0x33d32a});});},'UpdateVoiceQueue':function(_0x1d45a1){return new Promise(function(_0x15232f,_0x592d1a){var _0xd1f130=_[_0x083d('0x59')](_0x404d77[_0x083d('0x1e')],{'id':parseInt(_0x1d45a1['id'])});var _0x1bdafc=_[_0x083d('0x5a')](_0x1d45a1,['id']);if(_0xd1f130){for(var _0x1faad5 in _0x1bdafc){if(typeof _0x1bdafc[_0x1faad5]!==_0x083d('0x5b')&&typeof _0xd1f130[_0x1faad5]!=='undefined'){_0xd1f130[_0x1faad5]=_0x1bdafc[_0x1faad5];}}_0x15232f(_0xd1f130);}else{_0x592d1a();}});},'VoiceChannels':function(_0x515b43){return new Promise(function(_0x5c3258,_0x1dee34){var _0x509b72=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x5d')]);_0x5c3258({'count':_0x509b72[_0x083d('0x58')],'rows':_0x509b72});});},'VoiceChannelMixMonitor':function(_0x1bc090){var _0x525dd9=this;return new Promise(function(_0x117601,_0x410fb7){if(ami[_0x083d('0x5e')]()==![]){return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f4,[config[_0x083d('0x1b')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x083d('0x13')]('\x20')));}var _0x34ed6c=schema(properties[_0x083d('0x5f')])[_0x083d('0x3')](_0x1bc090);if(_0x34ed6c[_0x083d('0x58')]>0x0){return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x34ed6c,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x5a8620=_['find'](_0x404d77[_0x083d('0x5d')],{'uniqueid':_0x1bc090['uniqueid']});if(_0x5a8620&&_0x5a8620[_0x083d('0x61')]){var _0x2dd4f5=util[_0x083d('0x62')](_0x083d('0x63'),_0x1bc090[_0x083d('0x64')]||_0x1bc090['uniqueid'],_0x1bc090[_0x083d('0x62')]||'wav');return ami['Action']({'action':_0x083d('0x65'),'channel':_0x5a8620[_0x083d('0x61')],'file':_0x2dd4f5,'options':_0x083d('0x66')})[_0x083d('0x18')](function(_0x10db3e){var _0x2d26c4=_[_0x083d('0x59')](_0x5a8620['monitors'],{'filename':_0x083d('0x67')+_0x2dd4f5[_0x083d('0x68')]()});if(_[_0x083d('0x69')](_0x2d26c4)){_0x5a8620[_0x083d('0x6a')][_0x083d('0x57')]({'filename':_0x083d('0x67')+_0x2dd4f5[_0x083d('0x68')](),'createdAt':moment()[_0x083d('0x62')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x10db3e[_0x083d('0x6b')],'status':_0x083d('0x6c')});}else{_0x2d26c4[_0x083d('0x6b')]=_0x10db3e[_0x083d('0x6b')];_0x2d26c4[_0x083d('0x6d')]=_0x083d('0x6c');}_0x117601({'code':0xc8,'message':[_0x1bc090[_0x083d('0x6e')],_0x083d('0x6f'),_0x10db3e[_0x083d('0x6b')]][_0x083d('0x13')]('\x20'),'mixmonitorid':_0x10db3e[_0x083d('0x6b')]});})[_0x083d('0x1a')](function(_0x475ac6){_0x410fb7(_0x525dd9['error'](0x1f5,[_0x1bc090['uniqueid'],_0x475ac6[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2ea876){var _0x14918f=this;return new Promise(function(_0x3aa5dc,_0x3c305e){if(ami[_0x083d('0x5e')]()==![]){return _0x3c305e(_0x14918f['error'](0x1f4,[config['asterisk']['ip'],config[_0x083d('0x1b')][_0x083d('0x11')],_0x083d('0x12')]['join']('\x20')));}var _0x39ca60=schema(properties[_0x083d('0x5f')])['validate'](_0x2ea876);if(_0x39ca60[_0x083d('0x58')]>0x0){return _0x3c305e(_0x14918f[_0x083d('0x10')](0x1f4,_['map'](_0x39ca60,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x533dbc=_[_0x083d('0x59')](_0x404d77[_0x083d('0x5d')],{'uniqueid':_0x2ea876['uniqueid']});if(_0x533dbc){return BPromise['resolve']()[_0x083d('0x18')](function(){if(_0x533dbc[_0x083d('0x61')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x70'),'channel':_0x533dbc['channel'],'mixmonitorid':_0x2ea876[_0x083d('0x6b')]})[_0x083d('0x1a')](function(_0x33c209){});}})['then'](function(){if(_0x533dbc[_0x083d('0x71')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x70'),'channel':_0x533dbc[_0x083d('0x71')],'mixmonitorid':_0x2ea876['mixmonitorid']})['catch'](function(_0xd6e7d9){});}})[_0x083d('0x18')](function(_0x5acf5d){var _0x20f921=_[_0x083d('0x59')](_0x533dbc[_0x083d('0x6a')],{'mixmonitorid':_0x2ea876[_0x083d('0x6b')]});if(_0x20f921){_0x20f921[_0x083d('0x6d')]='stop';}})[_0x083d('0x18')](function(){var _0x3bec08=util[_0x083d('0x62')](_0x083d('0x63'),_0x2ea876[_0x083d('0x64')]||_0x2ea876[_0x083d('0x6e')],_0x2ea876[_0x083d('0x62')]||_0x083d('0x72'));var _0x4e4543=_[_0x083d('0x59')](_0x533dbc[_0x083d('0x6a')],{'filename':_0x083d('0x67')+_0x3bec08['toLowerCase']()});if(_0x4e4543){_0x4e4543['status']=_0x083d('0x73');}})[_0x083d('0x18')](function(){_0x3aa5dc({'code':0xc8,'message':[_0x2ea876[_0x083d('0x6e')],_0x083d('0x74')]['join']('\x20')});})[_0x083d('0x1a')](function(_0x5b116b){_0x3c305e(_0x14918f['error'](0x1f5,[_0x2ea876[_0x083d('0x6e')],_0x5b116b[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x3c305e(_0x14918f[_0x083d('0x10')](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannels':function(_0xa2afc){return new Promise(function(_0x135171,_0xca6924){var _0x2fdb74=_[_0x083d('0x5c')](_0x404d77['queueChannels']);_0x135171({'count':_0x2fdb74[_0x083d('0x58')],'rows':_0x2fdb74});});},'VoiceQueuesChannel':function(_0x565080){var _0x5ea764=this;return new Promise(function(_0x413a23,_0x18c0b6){var _0x3afabf=schema(properties[_0x083d('0x76')])['validate'](_0x565080);if(_0x3afabf['length']>0x0){return _0x18c0b6(_0x5ea764[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x3afabf,_0x083d('0x19'))['join'](',\x20')));}var _0x27c6dc=_[_0x083d('0x59')](_0x404d77['queueChannels'],{'uniqueid':_0x565080[_0x083d('0x6e')]});if(_0x27c6dc){_0x413a23(_0x27c6dc);}else{return _0x18c0b6(_0x5ea764[_0x083d('0x10')](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x2c9fb5){var _0x36605d=this;return new Promise(function(_0x3a9f3f,_0x5359f0){if(ami[_0x083d('0x5e')]()==![]){return _0x5359f0(_0x36605d['error'](0x1f4,[config[_0x083d('0x1b')]['ip'],config['asterisk']['username'],_0x083d('0x12')]['join']('\x20')));}var _0x1d4add=schema(properties[_0x083d('0x77')])[_0x083d('0x3')](_0x2c9fb5);if(_0x1d4add[_0x083d('0x58')]>0x0){return _0x5359f0(_0x36605d['error'](0x1f4,_[_0x083d('0x60')](_0x1d4add,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x18c422=_[_0x083d('0x59')](_0x404d77[_0x083d('0x78')],{'uniqueid':_0x2c9fb5['uniqueid']});if(_0x18c422&&_0x18c422[_0x083d('0x61')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x79'),'channel':_0x18c422['channel']})[_0x083d('0x18')](function(_0x13f487){_0x3a9f3f({'code':0xc8,'message':[_0x2c9fb5[_0x083d('0x6e')],_0x13f487[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')});})['catch'](function(_0x24b593){_0x5359f0(_0x36605d[_0x083d('0x10')](0x1f5,[_0x2c9fb5['uniqueid'],_0x24b593[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x5359f0(_0x36605d['error'](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x3ce6bf){var _0x5c3e46=this;return new Promise(function(_0x460ae3,_0x4d52e0){if(ami[_0x083d('0x5e')]()==![]){return _0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f4,[config[_0x083d('0x1b')]['ip'],config[_0x083d('0x1b')]['username'],_0x083d('0x12')]['join']('\x20')));}var _0x3f75a4=schema(properties[_0x083d('0x7a')])['validate'](_0x3ce6bf);if(_0x3f75a4[_0x083d('0x58')]>0x0){return _0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x3f75a4,_0x083d('0x19'))['join'](',\x20')));}var _0x4a9f1e=_['find'](_0x404d77[_0x083d('0x78')],{'uniqueid':_0x3ce6bf['uniqueid']});if(_0x4a9f1e&&_0x4a9f1e[_0x083d('0x61')]){return ami['Action']({'action':_0x083d('0x7b'),'channel':_0x4a9f1e[_0x083d('0x61')],'exten':_0x3ce6bf[_0x083d('0x7c')],'context':_0x3ce6bf[_0x083d('0x7d')]||_0x4a9f1e[_0x083d('0x7d')],'priority':0x1})[_0x083d('0x18')](function(_0x2b2562){_0x460ae3({'code':0xc8,'message':[_0x3ce6bf[_0x083d('0x6e')],_0x2b2562['message'][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')});})['catch'](function(_0x1e0cae){_0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f5,[_0x3ce6bf[_0x083d('0x6e')],_0x1e0cae[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x4d52e0(_0x5c3e46['error'](0x1f5,_0x083d('0x75')));}});},'Agents':function(_0x19259b){return new Promise(function(_0x5120a1,_0x55f34a){var _0x28ff6b=_[_0x083d('0x5c')](_0x404d77[_0x083d('0xc')]);_0x5120a1({'count':_0x28ff6b[_0x083d('0x58')],'rows':_0x28ff6b});});},'Telephones':function(_0x4889aa){return new Promise(function(_0x214a98,_0x23c8cd){var _0x2acf74=_[_0x083d('0x5c')](_0x404d77['telephones']);_0x214a98({'count':_0x2acf74['length'],'rows':_0x2acf74});});},'Trunks':function(_0x586a14){return new Promise(function(_0x5d9253,_0x3cae5c){var _0x12cf61=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x7e')]);_0x5d9253({'count':_0x12cf61[_0x083d('0x58')],'rows':_0x12cf61});});},'OutboundChannels':function(_0x12f8dd){return new Promise(function(_0x181a7a,_0x17cf6d){var _0x5164ea=_['values'](_0x404d77[_0x083d('0x7f')]);_0x181a7a({'count':_0x5164ea[_0x083d('0x58')],'rows':_0x5164ea});});},'Outbound':function(_0x28aa94){return new Promise(function(_0x26f7ec,_0x279355){_0x26f7ec(_0x404d77[_0x083d('0x2f')]);});},'Campaigns':function(_0x4feb9d){return new Promise(function(_0x21a44e,_0xedd308){var _0x1ad23d=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x80')]);_0x21a44e({'count':_0x1ad23d[_0x083d('0x58')],'rows':_0x1ad23d});});},'VoiceQueuesPreview':function(_0x1e75d9){var _0x356fef=this;return new Promise(function(_0x1966af,_0x381299){_0x143ec8[_0x083d('0x81')](_0x1e75d9['id'])['then'](function(_0x4ae132){_0x1966af({'code':0xc8,'message':_0x4ae132[_0x083d('0x19')]});})['catch'](function(_0x2afcd9){_0x381299(_0x356fef[_0x083d('0x10')](0x1f4,_0x2afcd9[_0x083d('0x19')]));});});},'EventManager':function(_0x310c32){var _0x517b26=this;return new Promise(function(_0x573ac7,_0x5ac7ae){if(!_0x310c32['event']){return _0x5ac7ae(_0x517b26[_0x083d('0x10')](0x1f4,_0x083d('0x82')));}ami[_0x083d('0x83')](_0x083d('0x84')+_0x310c32[_0x083d('0x85')],_0x310c32[_0x083d('0x19')]);_0x573ac7({'code':0xc8,'message':_0x310c32});});},'FaxAccounts':function(_0x1e4508){return new Promise(function(_0x5efbe6,_0x1f12e6){var _0x54cee3=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x86')]);_0x5efbe6({'count':_0x54cee3[_0x083d('0x58')],'rows':_0x54cee3});});},'SendFax':function(_0x40cd0){var _0x5e227b=this;return new Promise(function(_0x5260a1,_0x1cbed9){_0x3c4b8c[_0x083d('0x87')](_0x40cd0)[_0x083d('0x18')](function(_0x90f46){_0x5260a1({'code':0xc8,'message':_0x90f46['message']});})[_0x083d('0x1a')](function(_0x1bb396){_0x1cbed9(_0x5e227b[_0x083d('0x10')](0x1f4,_0x1bb396['message']));});});},'CheckAfterSend':function(_0x518628){var _0x2a862d=this;return new Promise(function(_0x302332,_0x37fccc){_0x3c4b8c[_0x083d('0x88')](_0x518628)['then'](function(_0x4d37f9){_0x302332({'code':0xc8,'message':_0x4d37f9[_0x083d('0x19')]});})[_0x083d('0x1a')](function(_0x41fb77){_0x37fccc(_0x2a862d[_0x083d('0x10')](0x1f4,_0x41fb77[_0x083d('0x19')]));});});}};var _0x135509=jayson['server'](_0x52a3e7)['http']();_0x135509['on'](_0x083d('0x10'),function(_0x281096){return _0x472c6b(_0x281096);});_0x135509[_0x083d('0x89')](0x232a,_0x083d('0x8a'),function(){console[_0x083d('0x8b')](_0x083d('0x8c'),0x232a);return _0x2e75e8('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x2675=['pick','keys','module','action','Reload','Action','then','message','catch','username','command','Command','voiceQueues','available','loggedIn','pTalking','sumBillable','sumDuration','total','type','unmanaged','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','ami\x20disconnected','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','channels','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','faxAccounts','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','bluebird','moment','../properties','../ami','format','SIP','name','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','join'];(function(_0x3dce3a,_0x9a9370){var _0x83c9a6=function(_0x5e8c9b){while(--_0x5e8c9b){_0x3dce3a['push'](_0x3dce3a['shift']());}};_0x83c9a6(++_0x9a9370);}(_0x2675,0x75));var _0x5267=function(_0x5b743c,_0x19bdb1){_0x5b743c=_0x5b743c-0x0;var _0x4e0df8=_0x2675[_0x5b743c];return _0x4e0df8;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var config=require('../../../config/environment');var properties=require(_0x5267('0x3'));var ami=require(_0x5267('0x4'));exports['listen']=function(_0x328776,_0xf2b350,_0x4bd042){return new BPromise(function(_0x10f92c,_0x20f065){var _0xc56cd5={'QueuePause':function(_0x527c16){return new Promise(function(_0x9e0a27,_0x46bfdf){var _0x506fd7=util[_0x5267('0x5')]('%s/%s',_0x5267('0x6'),_0x527c16[_0x5267('0x7')]);if(_0x328776[_0x5267('0x8')]&&_0x328776['timers'][_0x506fd7]&&_0x328776[_0x5267('0x8')][_0x506fd7]['timer']){_0x328776[_0x5267('0x8')][_0x506fd7]['updateAcw']();}if(_0x328776[_0x5267('0x9')][_0x506fd7]){_0x328776[_0x5267('0x9')][_0x506fd7][_0x5267('0xa')]({'statePause':_0x527c16[_0x5267('0xb')]?!![]:![]});}_0x9e0a27({'code':0xc8,'message':_0x5267('0xc')});});},'Reload':function(_0x1171b9){var _0x20785c=this;return new Promise(function(_0x36dc17,_0x3e19e4){if(ami[_0x5267('0xd')]()==![]){return _0x3e19e4(_0x20785c[_0x5267('0xe')](0x1f4,[config[_0x5267('0xf')]['ip'],config[_0x5267('0xf')]['username'],'ami\x20disconnected'][_0x5267('0x10')]('\x20')));}_0x1171b9=_[_0x5267('0x11')](_0x1171b9,_[_0x5267('0x12')](properties[_0x5267('0x13')]));_0x1171b9[_0x5267('0x14')]=_0x5267('0x15');return ami[_0x5267('0x16')](_0x1171b9)[_0x5267('0x17')](function(_0x15d81e){_0x36dc17({'code':0xc8,'message':_0x15d81e[_0x5267('0x18')]});})[_0x5267('0x19')](function(_0x1ab03){_0x3e19e4(_0x20785c['error'](0x1f5,_0x1ab03[_0x5267('0x18')]));});});},'Command':function(_0x2afd38){var _0x5069e8=this;return new Promise(function(_0x20cb50,_0x56733e){if(ami[_0x5267('0xd')]()==![]){return _0x56733e(_0x5069e8[_0x5267('0xe')](0x1f4,[config[_0x5267('0xf')]['ip'],config[_0x5267('0xf')][_0x5267('0x1a')],'ami\x20disconnected'][_0x5267('0x10')]('\x20')));}_0x2afd38=_['pick'](_0x2afd38,_0x5267('0x1b'));_0x2afd38[_0x5267('0x14')]=_0x5267('0x1c');return ami['Action'](_0x2afd38)['then'](function(_0x5546e2){_0x20cb50({'code':0xc8,'message':_0x5546e2['content']});})['catch'](function(_0x26c7f8){_0x56733e(_0x5069e8[_0x5267('0xe')](0x1f5,_0x26c7f8[_0x5267('0x18')]));});});},'VoiceQueues':function(_0x279377){return new Promise(function(_0x11c8ea,_0x40d1be){var _0x126a97=[];for(var _0x220e03 in _0x328776[_0x5267('0x1d')]){if(_0x328776['voiceQueues']['hasOwnProperty'](_0x220e03)){var _0x354111=_0x328776[_0x5267('0x1d')][_0x220e03];var _0x5abf95={'id':_0x354111['id'],'name':_0x354111[_0x5267('0x7')],'strategy':_0x354111['strategy'],'answered':_0x354111['answered'],'available':_0x354111[_0x5267('0x1e')],'loggedIn':_0x354111[_0x5267('0x1f')],'pTalking':_0x354111[_0x5267('0x20')],'sumBillable':_0x354111[_0x5267('0x21')],'sumDuration':_0x354111[_0x5267('0x22')],'sumHoldTime':_0x354111['sumHoldTime']||0x0,'talking':_0x354111['talking'],'total':_0x354111[_0x5267('0x23')],'type':_0x354111[_0x5267('0x24')],'unmanaged':_0x354111[_0x5267('0x25')],'abandoned':_0x354111['abandoned'],'waiting':_0x354111['waiting'],'loggedInDb':_0x354111[_0x5267('0x26')]};if(_0x354111[_0x5267('0x24')]===_0x5267('0x27')){_0x5abf95['dialActive']=_0x354111['dialActive'];_0x5abf95[_0x5267('0x28')]=_0x354111[_0x5267('0x28')];_0x5abf95[_0x5267('0x29')]=_0x354111[_0x5267('0x29')];_0x5abf95['dialOriginateCallerIdNumber']=_0x354111[_0x5267('0x2a')];_0x5abf95[_0x5267('0x2b')]=_0x354111[_0x5267('0x2b')];_0x5abf95[_0x5267('0x2c')]=_0x354111[_0x5267('0x2c')];_0x5abf95[_0x5267('0x2d')]=_0x354111[_0x5267('0x2d')];_0x5abf95[_0x5267('0x2e')]=_0x354111['outboundAnswerAgiCallsDay'];_0x5abf95['outboundAnswerCallsDay']=_0x354111[_0x5267('0x2f')];_0x5abf95['outboundBlacklistCallsDay']=_0x354111[_0x5267('0x30')];_0x5abf95[_0x5267('0x31')]=_0x354111[_0x5267('0x31')];_0x5abf95[_0x5267('0x32')]=_0x354111['outboundCongestionCallsDay'];_0x5abf95[_0x5267('0x33')]=_0x354111[_0x5267('0x33')];_0x5abf95[_0x5267('0x34')]=_0x354111[_0x5267('0x34')];_0x5abf95[_0x5267('0x35')]=_0x354111[_0x5267('0x35')];_0x5abf95[_0x5267('0x36')]=_0x354111[_0x5267('0x36')];_0x5abf95['outboundNoSuchCallsDay']=_0x354111[_0x5267('0x37')];_0x5abf95['outboundOriginateFailureCallsDay']=_0x354111[_0x5267('0x38')];_0x5abf95[_0x5267('0x39')]=_0x354111[_0x5267('0x39')];_0x5abf95[_0x5267('0x3a')]=_0x354111[_0x5267('0x3a')];_0x5abf95[_0x5267('0x3b')]=_0x354111[_0x5267('0x3b')];_0x5abf95['predictiveIntervalAnsweredCalls']=_0x354111[_0x5267('0x3c')];_0x5abf95[_0x5267('0x3d')]=_0x354111[_0x5267('0x3d')];_0x5abf95[_0x5267('0x3e')]=_0x354111[_0x5267('0x3e')];_0x5abf95[_0x5267('0x3f')]=_0x354111[_0x5267('0x3f')];_0x5abf95['predictiveIntervalDroppedCallsTimeout']=_0x354111[_0x5267('0x40')];_0x5abf95['predictiveIntervalErlangCalls']=_0x354111[_0x5267('0x41')];_0x5abf95['predictiveIntervalErlangCallsDroppedCalls']=_0x354111['predictiveIntervalErlangCallsDroppedCalls'];_0x5abf95['predictiveIntervalHitRate']=_0x354111[_0x5267('0x42')];_0x5abf95['predictiveIntervalMultiplicativeFactor']=_0x354111[_0x5267('0x43')];_0x5abf95[_0x5267('0x44')]=_0x354111[_0x5267('0x44')];_0x5abf95[_0x5267('0x45')]=_0x354111['predictiveIntervalAvailable'];_0x5abf95[_0x5267('0x46')]=_0x354111[_0x5267('0x46')];_0x5abf95['message']=_0x354111['message'];_0x5abf95[_0x5267('0x47')]=_0x354111['originated'];_0x5abf95[_0x5267('0x48')]=_0x354111[_0x5267('0x48')];_0x5abf95[_0x5267('0x49')]=_0x354111[_0x5267('0x49')];_0x5abf95[_0x5267('0x4a')]=_0x354111[_0x5267('0x4a')];_0x5abf95[_0x5267('0x4b')]=_0x354111['erlangBusyFactor'];_0x5abf95['startPredictive']=_0x354111[_0x5267('0x4c')];_0x5abf95['startProgressive']=_0x354111[_0x5267('0x4d')];}if(_0x354111[_0x5267('0x4e')]){_0x5abf95['Trunk']={'id':_0x354111[_0x5267('0x4e')]['id'],'name':_0x354111[_0x5267('0x4e')][_0x5267('0x7')],'active':_0x354111[_0x5267('0x4e')][_0x5267('0x4f')],'callerid':_0x354111[_0x5267('0x4e')][_0x5267('0x50')]};}if(_0x354111[_0x5267('0x51')]){_0x5abf95[_0x5267('0x51')]={'id':_0x354111['Interval']['id'],'name':_0x354111[_0x5267('0x51')][_0x5267('0x7')]};}_0x126a97[_0x5267('0x52')](_0x5abf95);}}_0x11c8ea({'count':_0x126a97[_0x5267('0x53')],'rows':_0x126a97});});},'UpdateVoiceQueue':function(_0x1270d4){return new Promise(function(_0x5a97f5,_0x3d15ac){var _0x4e0132=_[_0x5267('0x54')](_0x328776['voiceQueues'],{'id':parseInt(_0x1270d4['id'])});var _0x4ae9f9=_[_0x5267('0x55')](_0x1270d4,['id']);if(_0x4e0132){for(var _0x56d33f in _0x4ae9f9){if(typeof _0x4ae9f9[_0x56d33f]!==_0x5267('0x56')&&typeof _0x4e0132[_0x56d33f]!==_0x5267('0x56')){_0x4e0132[_0x56d33f]=_0x4ae9f9[_0x56d33f];}}_0x5a97f5(_0x4e0132);}else{_0x3d15ac();}});},'VoiceChannels':function(_0x222c9f){return new Promise(function(_0x29ab9b,_0x5bddff){var _0x12d6a8=_['values'](_0x328776['channels']);_0x29ab9b({'count':_0x12d6a8[_0x5267('0x53')],'rows':_0x12d6a8});});},'VoiceChannelMixMonitor':function(_0x3a277c){var _0x47d8dd=this;return new Promise(function(_0x49ce4f,_0x383ebe){if(ami[_0x5267('0xd')]()==![]){return _0x383ebe(_0x47d8dd[_0x5267('0xe')](0x1f4,[config[_0x5267('0xf')]['ip'],config[_0x5267('0xf')][_0x5267('0x1a')],_0x5267('0x57')][_0x5267('0x10')]('\x20')));}var _0x4332c7=schema(properties[_0x5267('0x58')])[_0x5267('0x59')](_0x3a277c);if(_0x4332c7[_0x5267('0x53')]>0x0){return _0x383ebe(_0x47d8dd[_0x5267('0xe')](0x1f4,_[_0x5267('0x5a')](_0x4332c7,'message')[_0x5267('0x10')](',\x20')));}var _0x466d46=_[_0x5267('0x54')](_0x328776['channels'],{'uniqueid':_0x3a277c[_0x5267('0x5b')]});if(_0x466d46&&_0x466d46[_0x5267('0x5c')]){var _0x31b722=util[_0x5267('0x5')](_0x5267('0x5d'),_0x3a277c[_0x5267('0x5e')]||_0x3a277c['uniqueid'],_0x3a277c[_0x5267('0x5')]||'wav');return ami[_0x5267('0x16')]({'action':_0x5267('0x5f'),'channel':_0x466d46[_0x5267('0x5c')],'file':_0x31b722,'options':_0x5267('0x60')})[_0x5267('0x17')](function(_0x3f9664){var _0x19bfd6=_['find'](_0x466d46['monitors'],{'filename':_0x5267('0x61')+_0x31b722[_0x5267('0x62')]()});if(_['isNil'](_0x19bfd6)){_0x466d46[_0x5267('0x63')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x31b722[_0x5267('0x62')](),'createdAt':moment()[_0x5267('0x5')](_0x5267('0x64')),'mixmonitorid':_0x3f9664[_0x5267('0x65')],'status':_0x5267('0x66')});}else{_0x19bfd6[_0x5267('0x65')]=_0x3f9664[_0x5267('0x65')];_0x19bfd6[_0x5267('0x67')]=_0x5267('0x66');}_0x49ce4f({'code':0xc8,'message':[_0x3a277c[_0x5267('0x5b')],'MixMonitor\x20Success',_0x3f9664[_0x5267('0x65')]][_0x5267('0x10')]('\x20'),'mixmonitorid':_0x3f9664[_0x5267('0x65')]});})[_0x5267('0x19')](function(_0x2544f1){_0x383ebe(_0x47d8dd[_0x5267('0xe')](0x1f5,[_0x3a277c['uniqueid'],_0x2544f1[_0x5267('0x18')]['toLowerCase']()][_0x5267('0x10')]('\x20')));});}else{return _0x383ebe(_0x47d8dd[_0x5267('0xe')](0x1f5,_0x5267('0x68')));}});},'VoiceChannelStopMixMonitor':function(_0x4a72c3){var _0x1593ce=this;return new Promise(function(_0x161dab,_0x181079){if(ami[_0x5267('0xd')]()==![]){return _0x181079(_0x1593ce[_0x5267('0xe')](0x1f4,[config[_0x5267('0xf')]['ip'],config['asterisk'][_0x5267('0x1a')],_0x5267('0x57')][_0x5267('0x10')]('\x20')));}var _0x2c3168=schema(properties['voicechannel'])['validate'](_0x4a72c3);if(_0x2c3168[_0x5267('0x53')]>0x0){return _0x181079(_0x1593ce['error'](0x1f4,_[_0x5267('0x5a')](_0x2c3168,_0x5267('0x18'))['join'](',\x20')));}var _0x489780=_[_0x5267('0x54')](_0x328776[_0x5267('0x69')],{'uniqueid':_0x4a72c3[_0x5267('0x5b')]});if(_0x489780){return BPromise['resolve']()[_0x5267('0x17')](function(){if(_0x489780[_0x5267('0x5c')]){return ami[_0x5267('0x16')]({'action':_0x5267('0x6a'),'channel':_0x489780['channel'],'mixmonitorid':_0x4a72c3['mixmonitorid']})['catch'](function(_0x3be34e){});}})[_0x5267('0x17')](function(){if(_0x489780[_0x5267('0x6b')]){return ami[_0x5267('0x16')]({'action':_0x5267('0x6a'),'channel':_0x489780[_0x5267('0x6b')],'mixmonitorid':_0x4a72c3[_0x5267('0x65')]})[_0x5267('0x19')](function(_0x486b02){});}})[_0x5267('0x17')](function(_0x667b5d){var _0x5dbe25=_[_0x5267('0x54')](_0x489780[_0x5267('0x63')],{'mixmonitorid':_0x4a72c3[_0x5267('0x65')]});if(_0x5dbe25){_0x5dbe25[_0x5267('0x67')]=_0x5267('0x6c');}})[_0x5267('0x17')](function(){var _0x4915f4=util[_0x5267('0x5')](_0x5267('0x5d'),_0x4a72c3[_0x5267('0x5e')]||_0x4a72c3[_0x5267('0x5b')],_0x4a72c3[_0x5267('0x5')]||_0x5267('0x6d'));var _0x4aac32=_[_0x5267('0x54')](_0x489780[_0x5267('0x63')],{'filename':_0x5267('0x61')+_0x4915f4[_0x5267('0x62')]()});if(_0x4aac32){_0x4aac32[_0x5267('0x67')]=_0x5267('0x6c');}})['then'](function(){_0x161dab({'code':0xc8,'message':[_0x4a72c3[_0x5267('0x5b')],_0x5267('0x6e')][_0x5267('0x10')]('\x20')});})[_0x5267('0x19')](function(_0x490b8c){_0x181079(_0x1593ce['error'](0x1f5,[_0x4a72c3['uniqueid'],_0x490b8c[_0x5267('0x18')]['toLowerCase']()][_0x5267('0x10')]('\x20')));});}else{return _0x181079(_0x1593ce['error'](0x1f5,_0x5267('0x68')));}});},'VoiceQueuesChannels':function(_0x1150ba){return new Promise(function(_0x3fdb33,_0x439411){var _0x8674cb=_[_0x5267('0x6f')](_0x328776[_0x5267('0x70')]);_0x3fdb33({'count':_0x8674cb[_0x5267('0x53')],'rows':_0x8674cb});});},'VoiceQueuesChannel':function(_0x489b9a){var _0x489f46=this;return new Promise(function(_0x5853e9,_0x30ce72){var _0x28a101=schema(properties[_0x5267('0x71')])[_0x5267('0x59')](_0x489b9a);if(_0x28a101['length']>0x0){return _0x30ce72(_0x489f46[_0x5267('0xe')](0x1f4,_[_0x5267('0x5a')](_0x28a101,_0x5267('0x18'))[_0x5267('0x10')](',\x20')));}var _0x5a0e73=_[_0x5267('0x54')](_0x328776[_0x5267('0x70')],{'uniqueid':_0x489b9a['uniqueid']});if(_0x5a0e73){_0x5853e9(_0x5a0e73);}else{return _0x30ce72(_0x489f46[_0x5267('0xe')](0x1f5,_0x5267('0x68')));}});},'VoiceQueuesChannelHangup':function(_0x4a9995){var _0x47e235=this;return new Promise(function(_0x1521c4,_0x1c4c6b){if(ami['isConnected']()==![]){return _0x1c4c6b(_0x47e235['error'](0x1f4,[config[_0x5267('0xf')]['ip'],config[_0x5267('0xf')][_0x5267('0x1a')],_0x5267('0x57')][_0x5267('0x10')]('\x20')));}var _0x48a589=schema(properties[_0x5267('0x72')])[_0x5267('0x59')](_0x4a9995);if(_0x48a589['length']>0x0){return _0x1c4c6b(_0x47e235[_0x5267('0xe')](0x1f4,_[_0x5267('0x5a')](_0x48a589,_0x5267('0x18'))[_0x5267('0x10')](',\x20')));}var _0xb8c52c=_[_0x5267('0x54')](_0x328776[_0x5267('0x70')],{'uniqueid':_0x4a9995[_0x5267('0x5b')]});if(_0xb8c52c&&_0xb8c52c['channel']){return ami['Action']({'action':_0x5267('0x73'),'channel':_0xb8c52c[_0x5267('0x5c')]})[_0x5267('0x17')](function(_0x3a6ad7){_0x1521c4({'code':0xc8,'message':[_0x4a9995['uniqueid'],_0x3a6ad7[_0x5267('0x18')]['toLowerCase']()][_0x5267('0x10')]('\x20')});})[_0x5267('0x19')](function(_0x1bf43a){_0x1c4c6b(_0x47e235[_0x5267('0xe')](0x1f5,[_0x4a9995['uniqueid'],_0x1bf43a['message'][_0x5267('0x62')]()][_0x5267('0x10')]('\x20')));});}else{return _0x1c4c6b(_0x47e235[_0x5267('0xe')](0x1f5,_0x5267('0x68')));}});},'VoiceQueuesChannelRedirect':function(_0x162506){var _0x371302=this;return new Promise(function(_0x5e1ba4,_0x1b8d72){if(ami['isConnected']()==![]){return _0x1b8d72(_0x371302[_0x5267('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x5267('0xf')][_0x5267('0x1a')],_0x5267('0x57')][_0x5267('0x10')]('\x20')));}var _0x164cc1=schema(properties[_0x5267('0x74')])[_0x5267('0x59')](_0x162506);if(_0x164cc1[_0x5267('0x53')]>0x0){return _0x1b8d72(_0x371302[_0x5267('0xe')](0x1f4,_[_0x5267('0x5a')](_0x164cc1,_0x5267('0x18'))['join'](',\x20')));}var _0x40c7b5=_[_0x5267('0x54')](_0x328776['queueChannels'],{'uniqueid':_0x162506[_0x5267('0x5b')]});if(_0x40c7b5&&_0x40c7b5[_0x5267('0x5c')]){return ami[_0x5267('0x16')]({'action':_0x5267('0x75'),'channel':_0x40c7b5[_0x5267('0x5c')],'exten':_0x162506[_0x5267('0x76')],'context':_0x162506[_0x5267('0x77')]||_0x40c7b5['context'],'priority':0x1})[_0x5267('0x17')](function(_0x2f8b17){_0x5e1ba4({'code':0xc8,'message':[_0x162506[_0x5267('0x5b')],_0x2f8b17[_0x5267('0x18')][_0x5267('0x62')]()]['join']('\x20')});})['catch'](function(_0x34d446){_0x1b8d72(_0x371302[_0x5267('0xe')](0x1f5,[_0x162506[_0x5267('0x5b')],_0x34d446[_0x5267('0x18')]['toLowerCase']()][_0x5267('0x10')]('\x20')));});}else{return _0x1b8d72(_0x371302[_0x5267('0xe')](0x1f5,_0x5267('0x68')));}});},'Agents':function(_0x2dffd8){return new Promise(function(_0x21a451,_0x7d8077){var _0x2b38f2=_[_0x5267('0x6f')](_0x328776[_0x5267('0x9')]);_0x21a451({'count':_0x2b38f2[_0x5267('0x53')],'rows':_0x2b38f2});});},'Telephones':function(_0x91509a){return new Promise(function(_0x212bcc,_0x1fc382){var _0x4a0422=_[_0x5267('0x6f')](_0x328776[_0x5267('0x78')]);_0x212bcc({'count':_0x4a0422[_0x5267('0x53')],'rows':_0x4a0422});});},'Trunks':function(_0x16374d){return new Promise(function(_0x447b5f,_0x25ce90){var _0x257c69=_[_0x5267('0x6f')](_0x328776[_0x5267('0x79')]);_0x447b5f({'count':_0x257c69[_0x5267('0x53')],'rows':_0x257c69});});},'OutboundChannels':function(_0x3a4696){return new Promise(function(_0x24058e,_0x204570){var _0x209669=_[_0x5267('0x6f')](_0x328776[_0x5267('0x7a')]);_0x24058e({'count':_0x209669[_0x5267('0x53')],'rows':_0x209669});});},'Outbound':function(_0x35a4a3){return new Promise(function(_0x7ecf0e,_0x676556){_0x7ecf0e(_0x328776[_0x5267('0x27')]);});},'Campaigns':function(_0x1464ae){return new Promise(function(_0x87fc43,_0x59233f){var _0x339f3f=_[_0x5267('0x6f')](_0x328776[_0x5267('0x7b')]);_0x87fc43({'count':_0x339f3f[_0x5267('0x53')],'rows':_0x339f3f});});},'VoiceQueuesPreview':function(_0x38f5b7){var _0x557749=this;return new Promise(function(_0xf814eb,_0x3c5418){_0xf2b350['run'](_0x38f5b7['id'])['then'](function(_0x4bdf77){_0xf814eb({'code':0xc8,'message':_0x4bdf77[_0x5267('0x18')]});})['catch'](function(_0x1183d0){_0x3c5418(_0x557749['error'](0x1f4,_0x1183d0['message']));});});},'EventManager':function(_0x21431b){var _0x4703cb=this;return new Promise(function(_0x2fdc63,_0x41dcd1){if(!_0x21431b[_0x5267('0x7c')]){return _0x41dcd1(_0x4703cb['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5267('0x7d')](_0x5267('0x7e')+_0x21431b[_0x5267('0x7c')],_0x21431b[_0x5267('0x18')]);_0x2fdc63({'code':0xc8,'message':_0x21431b});});},'FaxAccounts':function(_0x5a728d){return new Promise(function(_0x586a50,_0x1205a2){var _0x5bece1=_['values'](_0x328776[_0x5267('0x7f')]);_0x586a50({'count':_0x5bece1['length'],'rows':_0x5bece1});});},'SendFax':function(_0x5da8d6){var _0x3ebe63=this;return new Promise(function(_0x321322,_0x5085d8){_0x4bd042['send'](_0x5da8d6)['then'](function(_0xaaf010){_0x321322({'code':0xc8,'message':_0xaaf010['message']});})[_0x5267('0x19')](function(_0x59af19){_0x5085d8(_0x3ebe63[_0x5267('0xe')](0x1f4,_0x59af19[_0x5267('0x18')]));});});},'CheckAfterSend':function(_0x58cc0b){var _0x1ae9fe=this;return new Promise(function(_0x367841,_0x3906d6){_0x4bd042[_0x5267('0x80')](_0x58cc0b)[_0x5267('0x17')](function(_0x835563){_0x367841({'code':0xc8,'message':_0x835563['message']});})['catch'](function(_0x1ebe0f){_0x3906d6(_0x1ae9fe['error'](0x1f4,_0x1ebe0f['message']));});});}};var _0x1a3146=jayson['server'](_0xc56cd5)[_0x5267('0x81')]();_0x1a3146['on']('error',function(_0x67f1c9){return _0x20f065(_0x67f1c9);});_0x1a3146['listen'](0x232a,_0x5267('0x82'),function(){console[_0x5267('0x83')](_0x5267('0x84'),0x232a);return _0x10f92c(_0x5267('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 67819a5..cecf996 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 _0x0ba6=['user:%s','name','trigger:%s','action','merge','lodash','bluebird','util','../../../../config/environment','trigger','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','xmd-contactid','ListId','data3','phone','$or','routeId','destcalleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridnum','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format'];(function(_0x1cea7b,_0x37f5f4){var _0x5618d1=function(_0x7c8aa6){while(--_0x7c8aa6){_0x1cea7b['push'](_0x1cea7b['shift']());}};_0x5618d1(++_0x37f5f4);}(_0x0ba6,0x11d));var _0x60ba=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x0ba6[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0x60ba('0x0'));var BPromise=require(_0x60ba('0x1'));var Redis=require('ioredis');var util=require(_0x60ba('0x2'));var config=require(_0x60ba('0x3'));var logger=require('../../../../config/logger')(_0x60ba('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x60ba('0x5')]=_['defaults'](config[_0x60ba('0x5')],{'host':_0x60ba('0x6'),'port':0x18eb});var io=require(_0x60ba('0x7'))(new Redis(config['redis']));function emit(_0x490f97,_0x3feff5,_0x288480,_0x8cbc81,_0x3fd84b){logger[_0x60ba('0x8')](_0x60ba('0x9'),_0x490f97,_0x3feff5['id'],_0x288480,_0x8cbc81,JSON[_0x60ba('0xa')](_0x3fd84b));io['to'](_0x288480)['emit'](_0x8cbc81,_0x3fd84b);}exports[_0x60ba('0xb')]=function(_0x199b41,_0x1050b5,_0xac6973,_0x1e17a4){var _0x278bfd,_0x5ea553;var _0x388fa8={};var _0x29a2a2=Number(_0xac6973[_0x60ba('0xc')]);var _0xdfcaf8=_0xac6973['data2']?Boolean(Number(_0xac6973[_0x60ba('0xd')])):![];var _0x3e929d;if(_0x1e17a4[_0x60ba('0xe')]){_0x388fa8['id']=_0x1e17a4[_0x60ba('0xe')];}if(!_0x388fa8['id']){_0x388fa8[_0x60ba('0xf')]=_0x29a2a2;_0x3e929d=_0xac6973[_0x60ba('0x10')]&&_0xac6973[_0x60ba('0x10')]!=='0'?_0xac6973['data3']['split'](','):[_0x60ba('0x11')];_0x388fa8[_0x60ba('0x12')]=_['map'](_0x3e929d,function(_0x3646d0){var _0x3a3783={};_0x3a3783[_0x3646d0]=_0x1e17a4[_0x60ba('0x13')]?_0x1e17a4[_0x60ba('0x14')]:_0x1e17a4['calleridnum'];return _0x3a3783;});}var _0x2e52fa=['id',_0x60ba('0x15'),_0x60ba('0x16'),_0x60ba('0x11'),_0x60ba('0x17'),_0x60ba('0x18'),_0x60ba('0xf'),_0x60ba('0x19'),_0x60ba('0x1a'),_0x60ba('0x1b')];var _0x2dca69=_[_0x60ba('0x1c')](_0x2e52fa,_0x3e929d);BPromise[_0x60ba('0x1d')]()[_0x60ba('0x1e')](cmContactRpc[_0x60ba('0x1f')]({'attributes':_0x2dca69,'where':_0x388fa8}))['then'](function(_0x220422){_0x5ea553=_0x220422;if(!_[_0x60ba('0x20')](_0x5ea553)){if(_0x5ea553[_0x60ba('0x21')]===0x1){_0x278bfd=_0x5ea553[0x0];logger[_0x60ba('0x8')](_0x60ba('0x22'),_0x1e17a4[_0x60ba('0x23')],_0x1050b5['id'],_0x278bfd['id']);}else{logger[_0x60ba('0x8')](_0x60ba('0x24'),_0x1e17a4['uniqueid'],_0x1050b5['id'],_[_0x60ba('0x25')](_0x5ea553,'id')['join'](','));}return;}else{logger[_0x60ba('0x8')](_0x60ba('0x26'),_0x1e17a4[_0x60ba('0x23')],_0x1050b5['id']);var _0x27eeef={'ListId':_0x29a2a2};var _0x55cb44=_0xac6973[_0x60ba('0x27')]&&_0xac6973[_0x60ba('0x27')]!=='0'?_0xac6973[_0x60ba('0x27')]:_0x60ba('0x11');if(_0xdfcaf8){logger[_0x60ba('0x8')](_0x60ba('0x28'),_0x1e17a4['uniqueid'],_0x1050b5['id']);_0x27eeef[_0x55cb44]=_[_0x60ba('0x29')](_0x1e17a4[_0x60ba('0x13')])?_0x1e17a4[_0x60ba('0x2a')]:_0x1e17a4[_0x60ba('0x14')];if(_[_0x60ba('0x29')](_0x1e17a4[_0x60ba('0x13')])){_0x27eeef[_0x60ba('0x15')]=_0x1e17a4[_0x60ba('0x2b')]&&_0x1e17a4['calleridname']!==_0x60ba('0x2c')?_0x1e17a4[_0x60ba('0x2b')]:_0x60ba('0x2d');}else{_0x27eeef[_0x60ba('0x15')]=_0x1e17a4[_0x60ba('0x2e')]&&_0x1e17a4['destcalleridname']!==_0x60ba('0x2c')?_0x1e17a4[_0x60ba('0x2e')]:_0x60ba('0x2d');}return BPromise[_0x60ba('0x1d')]()[_0x60ba('0x1e')](cmContactRpc['createContact'](_0x27eeef))['then'](function(_0x21c380){_0x278bfd=_0x21c380;_0x5ea553['push'](_0x21c380);if(_0x278bfd){logger[_0x60ba('0x8')](_0x60ba('0x2f'),_0x1e17a4[_0x60ba('0x23')],_0x1050b5['id'],_0x278bfd['id']);}return;});}else{logger[_0x60ba('0x8')](_0x60ba('0x30'),_0x1e17a4['uniqueid'],_0x1050b5['id']);_0x27eeef[_0x55cb44]=_[_0x60ba('0x29')](_0x1e17a4[_0x60ba('0x13')])?_0x1e17a4[_0x60ba('0x2a')]:_0x1e17a4[_0x60ba('0x14')];if(_[_0x60ba('0x29')](_0x1e17a4['routeId'])){_0x27eeef[_0x60ba('0x15')]=_0x1e17a4[_0x60ba('0x2b')]&&_0x1e17a4['calleridname']!==_0x60ba('0x2c')?_0x1e17a4['calleridname']:_0x60ba('0x2d');}else{_0x27eeef['firstName']=_0x1e17a4[_0x60ba('0x2e')]&&_0x1e17a4[_0x60ba('0x2e')]!==_0x60ba('0x2c')?_0x1e17a4[_0x60ba('0x2e')]:_0x60ba('0x2d');}_0x278bfd=_0x27eeef;_0x5ea553[_0x60ba('0x31')](_0x27eeef);return;}}})[_0x60ba('0x1e')](function(){if(_0x199b41){emit(_0x1e17a4[_0x60ba('0x23')],_0x1050b5,util[_0x60ba('0x32')](_0x60ba('0x33'),_0x199b41[_0x60ba('0x34')]),util[_0x60ba('0x32')](_0x60ba('0x35'),_0xac6973[_0x60ba('0x36')]['toLowerCase']()),{'evt':_[_0x60ba('0x37')](_0x1e17a4,{'autoCreate':_0xdfcaf8}),'contact':_0x278bfd===undefined?{}:_0x278bfd,'contacts':_0x5ea553['length']===0x0?undefined:_0x5ea553});}});}; \ No newline at end of file +var _0xa8c2=['[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data2','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xa8c2,0x1e2));var _0x2a8c=function(_0x34a97f,_0x340c7a){_0x34a97f=_0x34a97f-0x0;var _0x501f54=_0xa8c2[_0x34a97f];return _0x501f54;};'use strict';var _=require('lodash');var BPromise=require(_0x2a8c('0x0'));var Redis=require(_0x2a8c('0x1'));var util=require(_0x2a8c('0x2'));var config=require(_0x2a8c('0x3'));var logger=require(_0x2a8c('0x4'))(_0x2a8c('0x5'));var cmContactRpc=require(_0x2a8c('0x6'));config[_0x2a8c('0x7')]=_[_0x2a8c('0x8')](config['redis'],{'host':_0x2a8c('0x9'),'port':0x18eb});var io=require(_0x2a8c('0xa'))(new Redis(config['redis']));function emit(_0x1efb31,_0x39324b,_0x46b999,_0x1b0f00,_0x12ca8c){logger[_0x2a8c('0xb')]('[CM][%s][%s]',_0x1efb31,_0x39324b['id'],_0x46b999,_0x1b0f00,JSON[_0x2a8c('0xc')](_0x12ca8c));io['to'](_0x46b999)[_0x2a8c('0xd')](_0x1b0f00,_0x12ca8c);}exports[_0x2a8c('0xe')]=function(_0x529116,_0x1b3c03,_0x188fa7,_0x49c349){var _0x3451d4,_0xcc20d7;var _0x41f98e={};var _0x1530c5=Number(_0x188fa7['data1']);var _0x175ba3=_0x188fa7[_0x2a8c('0xf')]?Boolean(Number(_0x188fa7[_0x2a8c('0xf')])):![];var _0x10bbdc;if(_0x49c349['xmd-contactid']){_0x41f98e['id']=_0x49c349[_0x2a8c('0x10')];}if(!_0x41f98e['id']){_0x41f98e[_0x2a8c('0x11')]=_0x1530c5;_0x10bbdc=_0x188fa7[_0x2a8c('0x12')]&&_0x188fa7['data3']!=='0'?_0x188fa7[_0x2a8c('0x12')]['split'](','):['phone'];_0x41f98e[_0x2a8c('0x13')]=_[_0x2a8c('0x14')](_0x10bbdc,function(_0x128c2e){var _0x19d65c={};_0x19d65c[_0x128c2e]=_0x49c349[_0x2a8c('0x15')]?_0x49c349[_0x2a8c('0x16')]:_0x49c349[_0x2a8c('0x17')];return _0x19d65c;});}var _0x573c5d=['id',_0x2a8c('0x18'),_0x2a8c('0x19'),_0x2a8c('0x1a'),_0x2a8c('0x1b'),_0x2a8c('0x1c'),_0x2a8c('0x11'),_0x2a8c('0x1d'),_0x2a8c('0x1e'),_0x2a8c('0x1f')];var _0x3b213d=_[_0x2a8c('0x20')](_0x573c5d,_0x10bbdc);BPromise[_0x2a8c('0x21')]()['then'](cmContactRpc[_0x2a8c('0x22')]({'attributes':_0x3b213d,'where':_0x41f98e}))[_0x2a8c('0x23')](function(_0x25eae9){_0xcc20d7=_0x25eae9;if(!_[_0x2a8c('0x24')](_0xcc20d7)){if(_0xcc20d7[_0x2a8c('0x25')]===0x1){_0x3451d4=_0xcc20d7[0x0];logger[_0x2a8c('0xb')](_0x2a8c('0x26'),_0x49c349[_0x2a8c('0x27')],_0x1b3c03['id'],_0x3451d4['id']);}else{logger[_0x2a8c('0xb')](_0x2a8c('0x28'),_0x49c349[_0x2a8c('0x27')],_0x1b3c03['id'],_[_0x2a8c('0x14')](_0xcc20d7,'id')['join'](','));}return;}else{logger['info'](_0x2a8c('0x29'),_0x49c349[_0x2a8c('0x27')],_0x1b3c03['id']);var _0x309520={'ListId':_0x1530c5};var _0xb917b2=_0x188fa7['data4']&&_0x188fa7[_0x2a8c('0x2a')]!=='0'?_0x188fa7['data4']:_0x2a8c('0x1a');if(_0x175ba3){logger[_0x2a8c('0xb')](_0x2a8c('0x2b'),_0x49c349[_0x2a8c('0x27')],_0x1b3c03['id']);_0x309520[_0xb917b2]=_[_0x2a8c('0x2c')](_0x49c349[_0x2a8c('0x15')])?_0x49c349[_0x2a8c('0x17')]:_0x49c349[_0x2a8c('0x16')];if(_[_0x2a8c('0x2c')](_0x49c349['routeId'])){_0x309520[_0x2a8c('0x18')]=_0x49c349[_0x2a8c('0x2d')]&&_0x49c349[_0x2a8c('0x2d')]!==_0x2a8c('0x2e')?_0x49c349[_0x2a8c('0x2d')]:_0x2a8c('0x2f');}else{_0x309520[_0x2a8c('0x18')]=_0x49c349[_0x2a8c('0x30')]&&_0x49c349[_0x2a8c('0x30')]!==_0x2a8c('0x2e')?_0x49c349[_0x2a8c('0x30')]:_0x2a8c('0x2f');}return BPromise[_0x2a8c('0x21')]()['then'](cmContactRpc[_0x2a8c('0x31')](_0x309520))[_0x2a8c('0x23')](function(_0xa779d0){_0x3451d4=_0xa779d0;_0xcc20d7[_0x2a8c('0x32')](_0xa779d0);if(_0x3451d4){logger[_0x2a8c('0xb')](_0x2a8c('0x33'),_0x49c349[_0x2a8c('0x27')],_0x1b3c03['id'],_0x3451d4['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x49c349['uniqueid'],_0x1b3c03['id']);_0x309520[_0xb917b2]=_[_0x2a8c('0x2c')](_0x49c349[_0x2a8c('0x15')])?_0x49c349[_0x2a8c('0x17')]:_0x49c349[_0x2a8c('0x16')];if(_['isNil'](_0x49c349['routeId'])){_0x309520[_0x2a8c('0x18')]=_0x49c349[_0x2a8c('0x2d')]&&_0x49c349[_0x2a8c('0x2d')]!==_0x2a8c('0x2e')?_0x49c349[_0x2a8c('0x2d')]:_0x2a8c('0x2f');}else{_0x309520[_0x2a8c('0x18')]=_0x49c349[_0x2a8c('0x30')]&&_0x49c349[_0x2a8c('0x30')]!==''?_0x49c349[_0x2a8c('0x30')]:_0x2a8c('0x2f');}_0x3451d4=_0x309520;_0xcc20d7[_0x2a8c('0x32')](_0x309520);return;}}})[_0x2a8c('0x23')](function(){if(_0x529116){emit(_0x49c349[_0x2a8c('0x27')],_0x1b3c03,util[_0x2a8c('0x34')](_0x2a8c('0x35'),_0x529116['name']),util['format'](_0x2a8c('0x36'),_0x188fa7[_0x2a8c('0x37')][_0x2a8c('0x38')]()),{'evt':_[_0x2a8c('0x39')](_0x49c349,{'autoCreate':_0x175ba3}),'contact':_0x3451d4===undefined?{}:_0x3451d4,'contacts':_0xcc20d7[_0x2a8c('0x25')]===0x0?undefined:_0xcc20d7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4e5327b..1e2691f 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 _0x3ee6=['sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','custom:agentcomplete','syncCustomEvent','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','info','stringify','clone','checkTriggers','interface','hasOwnProperty','status','Actions','action','toLowerCase','contactmanager','motionbar','data1','popup','TemplateId','data2','html','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','data6','600','winapp','winApplication','render','winArguments','emit','user:%s','name','trigger:%s:%s','merge','format','trigger:%s','integration','exec','queue','routeId','urlforward','script','parse','search','replace','checkTrigger','length','AllConditions','channel','AnyConditions','some','checkConditions','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','exports','util','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts'];(function(_0x47a491,_0x45e171){var _0x3b176b=function(_0x8c826){while(--_0x8c826){_0x47a491['push'](_0x47a491['shift']());}};_0x3b176b(++_0x45e171);}(_0x3ee6,0x147));var _0x63ee=function(_0x54a431,_0x21ae6f){_0x54a431=_0x54a431-0x0;var _0x240bc3=_0x3ee6[_0x54a431];return _0x240bc3;};'use strict';var util=require(_0x63ee('0x0'));var _=require('lodash');var url=require('url');var Mustache=require('mustache');var Redis=require(_0x63ee('0x1'));var urlforward=require(_0x63ee('0x2'));var integration=require(_0x63ee('0x3'));var cmContact=require(_0x63ee('0x4'));var script=require(_0x63ee('0x5'));var config=require('../../../config/environment');var logger=require(_0x63ee('0x6'))('trigger');var ami=require(_0x63ee('0x7'));config[_0x63ee('0x8')]=_[_0x63ee('0x9')](config['redis'],{'host':_0x63ee('0xa'),'port':0x18eb});var io=require(_0x63ee('0xb'))(new Redis(config[_0x63ee('0x8')]));var operators={'equals':function(_0x565a84,_0x368198){return _0x565a84==_0x368198;},'not_equals':function(_0x1dd695,_0xa5976d){return _0x1dd695!=_0xa5976d;}};var barAndWebActions=['popup',_0x63ee('0xc'),'winapp'];function Trigger(_0x4622b1){this[_0x63ee('0xd')]=_0x4622b1[_0x63ee('0xd')];this[_0x63ee('0xe')]=_0x4622b1['agents'];this['voiceQueues']=_0x4622b1[_0x63ee('0xf')];this[_0x63ee('0x10')]=_0x4622b1[_0x63ee('0x10')];this[_0x63ee('0x11')]=_0x4622b1['voiceExtensions'];this[_0x63ee('0x12')]=_0x4622b1[_0x63ee('0x12')];this[_0x63ee('0x13')]=_0x4622b1[_0x63ee('0x13')];this[_0x63ee('0x14')]=_0x4622b1[_0x63ee('0x14')];this[_0x63ee('0x15')]=_0x4622b1[_0x63ee('0x15')];this[_0x63ee('0x16')]=_0x4622b1['zohoAccounts'];this[_0x63ee('0x17')]=_0x4622b1[_0x63ee('0x17')];this['vtigerAccounts']=_0x4622b1[_0x63ee('0x18')];this[_0x63ee('0x19')]=_0x4622b1[_0x63ee('0x19')];this[_0x63ee('0x1a')]=_0x4622b1[_0x63ee('0x1a')];this[_0x63ee('0x1b')]=_0x4622b1[_0x63ee('0x1b')];this[_0x63ee('0x1c')]={'zendesk':this[_0x63ee('0x12')],'salesforce':this[_0x63ee('0x14')],'freshdesk':this[_0x63ee('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x63ee('0x1a')],'freshsales':this[_0x63ee('0x1b')],'servicenow':this[_0x63ee('0x19')]};ami['on'](_0x63ee('0x1d'),this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x1f'),this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x20'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x22'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x23'),this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x24'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x25'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x26'),this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on']('custom:queuecallerabandon',this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x27'),this[_0x63ee('0x28')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x29'),this[_0x63ee('0x28')][_0x63ee('0x1e')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x2a'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on']('custom:closedinteraction',this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on']('custom:incomingmessage',this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x2b'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on'](_0x63ee('0x2c'),this[_0x63ee('0x21')][_0x63ee('0x1e')](this));ami['on']('custom:rejectmessage',this[_0x63ee('0x21')][_0x63ee('0x1e')](this));}Trigger[_0x63ee('0x2d')]['emit']=function(_0x2afec0,_0x58b8ee,_0xa8d56d){logger[_0x63ee('0x2e')](_0x2afec0,_0x58b8ee,JSON[_0x63ee('0x2f')](_0xa8d56d));io['to'](_0x2afec0)['emit'](_0x58b8ee,_0xa8d56d);};Trigger[_0x63ee('0x2d')][_0x63ee('0x21')]=function(_0x53da02){var _0x4d9d74=_[_0x63ee('0x30')](_0x53da02);this[_0x63ee('0x31')](_0x4d9d74);};Trigger[_0x63ee('0x2d')]['syncAgentDial']=function(_0x4a0e96){if(this[_0x63ee('0xe')][_0x4a0e96[_0x63ee('0x32')]]){this['syncCustomEvent'](_0x4a0e96);}};Trigger[_0x63ee('0x2d')][_0x63ee('0x31')]=function(_0x14edce){var _0x5a0056;for(var _0x515bab in this[_0x63ee('0xd')]){if(this[_0x63ee('0xd')][_0x63ee('0x33')](_0x515bab)){if(this['triggers'][_0x515bab][_0x63ee('0x34')]){_0x5a0056=this['checkTrigger'](this[_0x63ee('0xd')][_0x515bab],_0x14edce);if(_0x5a0056){_['merge'](_0x14edce,_0x14edce['variables']);for(var _0x32c067=0x0,_0x273142,_0x229713,_0x3be8ab;_0x32c0670x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x1b7d92,_0x32a99a){var _0x593c2f=function(_0x5aa32d){while(--_0x5aa32d){_0x1b7d92['push'](_0x1b7d92['shift']());}};_0x593c2f(++_0x32a99a);}(_0x814b,0x1a2));var _0xb814=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0x814b[_0x154940];return _0x401409;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 c34c4a3..a9daf2d 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 _0x0b91=['toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','idField','indexOf','ticketType','incidents','assign','Subjects','getString','Descriptions','/contacts(','phonecalls','callDirection','queue','Fields','headers','odata-entityid','format','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','./util','md5','ioredis','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x0b91,0xae));var _0x10b9=function(_0x1b4a2f,_0x56b8d2){_0x1b4a2f=_0x1b4a2f-0x0;var _0x3cd7a8=_0x0b91[_0x1b4a2f];return _0x3cd7a8;};'use strict';var _=require('lodash');var BPromise=require(_0x10b9('0x0'));var rp=require(_0x10b9('0x1'));var util=require('util');var intUtil=require(_0x10b9('0x2'));var md5=require(_0x10b9('0x3'));var Redis=require(_0x10b9('0x4'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x10b9('0x5'));config[_0x10b9('0x6')]=_[_0x10b9('0x7')](config[_0x10b9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x10b9('0x8'))(new Redis(config['redis']));function getAuthToken(_0x4c4a3a,_0x47701e,_0x528fb0){var _0x3d6b74={'method':_0x10b9('0x9'),'uri':_0x47701e,'form':{'client_id':_0x4c4a3a[_0x10b9('0xa')],'resource':_0x4c4a3a[_0x10b9('0xb')],'username':_0x4c4a3a['username'],'password':_0x4c4a3a[_0x10b9('0xc')],'grant_type':_0x10b9('0xc'),'client_secret':_0x4c4a3a[_0x10b9('0xd')]},'json':!![]};return rp(_0x3d6b74)[_0x10b9('0xe')](function(_0xc4d8be){return _0xc4d8be[_0x10b9('0xf')];})[_0x10b9('0x10')](function(_0x58e11e){logger[_0x10b9('0x11')]('['+[_0x528fb0[_0x10b9('0x12')]()]+_0x10b9('0x13'));return _0x58e11e[_0x10b9('0x14')];});}function getUser(_0x2da1d6,_0x54da60,_0x21465a,_0x1aca8b,_0x27ee5e,_0x1c5bb1){return new BPromise(function(_0x443936,_0x1d1093){return getAuthToken(_0x54da60,_0x1aca8b,_0x1c5bb1)[_0x10b9('0xe')](function(_0x4917be){var _0x46bc22={'method':'GET','uri':_0x27ee5e+_0x10b9('0x15'),'headers':{'Authorization':_0x10b9('0x16')+_0x4917be,'OData-Version':_0x10b9('0x17')},'json':!![]};return rp(_0x46bc22);})['then'](function(_0x5c9ab4){var _0x273ad1=_0x5c9ab4['value'];var _0x3efd05=![];var _0x113482=null;if(!_['isNil'](_0x21465a)){if(intUtil[_0x10b9('0x18')](_0x21465a[_0x10b9('0x19')])){_0x2da1d6[_0x10b9('0x1a')]=_0x21465a[_0x10b9('0x19')];for(_0x113482=0x0;_0x113482<_0x273ad1[_0x10b9('0x1b')];_0x113482++){if(_0x273ad1[_0x113482][_0x10b9('0x1c')]===_0x21465a['email']&&!_0x273ad1[_0x113482][_0x10b9('0x1d')]){_0x3efd05=!![];logger[_0x10b9('0x1e')]('['+[_0x1c5bb1[_0x10b9('0x12')]()]+_0x10b9('0x1f')+_0x273ad1[_0x113482][_0x10b9('0x20')]+'!');_0x2da1d6['userId']=_0x273ad1[_0x113482][_0x10b9('0x20')];}}}}if(!_0x3efd05){logger[_0x10b9('0x1e')]('['+[_0x1c5bb1[_0x10b9('0x12')]()]+_0x10b9('0x21'));_0x2da1d6[_0x10b9('0x1a')]=_0x54da60[_0x10b9('0x22')];for(_0x113482=0x0;_0x113482<_0x273ad1[_0x10b9('0x1b')];_0x113482++){if(_0x273ad1[_0x113482]['internalemailaddress']===_0x54da60[_0x10b9('0x22')]){_0x2da1d6[_0x10b9('0x23')]=_0x273ad1[_0x113482]['systemuserid'];}}}_0x443936(_0x2da1d6);})[_0x10b9('0x10')](function(_0x2540f3){_0x1d1093(_0x2540f3['message']);});});}function createEndUser(_0x1c638d,_0x38bb7a,_0x1bd847,_0x42d5d3,_0x473f20,_0x3037ae){return new BPromise(function(_0x157805,_0x11d9f0){return getAuthToken(_0x38bb7a,_0x1bd847,_0x3037ae)[_0x10b9('0xe')](function(_0x120abc){var _0x391fba=_0x3037ae[_0x10b9('0x24')]()===_0x10b9('0x25')?_0x473f20[_0x10b9('0x26')]:_0x473f20[_0x10b9('0x27')];var _0x114870={'method':_0x10b9('0x9'),'uri':_0x42d5d3+_0x10b9('0x28'),'body':{'telephone1':_0x391fba,'fullname':_0x391fba,'firstname':_0x391fba,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x10b9('0x29')+_0x1c638d[_0x10b9('0x23')]+')'},'headers':{'Authorization':_0x10b9('0x16')+_0x120abc,'OData-Version':_0x10b9('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x114870);})[_0x10b9('0xe')](function(_0x54b126){var _0x8a529f=_0x54b126['headers']['odata-entityid'];var _0x9b0a1a=_0x8a529f[_0x10b9('0x2a')](_0x8a529f[_0x10b9('0x2b')]('(')+0x1,_0x8a529f[_0x10b9('0x2b')](')'));_0x1c638d[_0x10b9('0x2c')]=_0x9b0a1a;_0x157805(_0x1c638d);})['catch'](function(_0x5f4c10){_0x11d9f0(_0x5f4c10[_0x10b9('0x14')]);});});}function getEndUser(_0x34bdfe,_0x17b0c9,_0x32808b,_0x2d7b82,_0xa6f761,_0x5e4428){return new BPromise(function(_0x40d006,_0x1192a0){var _0x3bfdec=_0x5e4428[_0x10b9('0x24')]()==='outbound'?_0xa6f761[_0x10b9('0x26')]:_0xa6f761[_0x10b9('0x27')];return getAuthToken(_0x17b0c9,_0x32808b,_0x5e4428)['then'](function(_0x1762df){var _0xa76313={'method':_0x10b9('0x2d'),'uri':_0x2d7b82+_0x10b9('0x2e')+_0x3bfdec['replace']('+',_0x10b9('0x2f'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1762df,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa76313);})[_0x10b9('0xe')](function(_0x3e6b0d){var _0x4c6dfb=null;if(_0x3e6b0d){var _0xdf7719=_0x3e6b0d['value'];var _0x3b2e32=![];for(_0x4c6dfb=0x0;_0x4c6dfb<_0xdf7719[_0x10b9('0x1b')];_0x4c6dfb++){if(_0xdf7719[_0x4c6dfb]['telephone1']===_0x3bfdec){_0x3b2e32=!![];_0x34bdfe['enduserId']=_0xdf7719[_0x4c6dfb][_0x10b9('0x30')];}}if(_0x3b2e32){_0x40d006(_0x34bdfe);}else{return createEndUser(_0x34bdfe,_0x17b0c9,_0x32808b,_0x2d7b82,_0xa6f761,_0x5e4428)[_0x10b9('0xe')](function(_0x4236e2){logger[_0x10b9('0x1e')]('['+[_0x5e4428['toUpperCase']()]+_0x10b9('0x31'),_0x4236e2[_0x10b9('0x2c')]);_0x40d006(_0x4236e2);});}}else{return createEndUser(_0x34bdfe,_0x17b0c9,_0x32808b,_0x2d7b82,_0xa6f761,_0x5e4428)['then'](function(_0xafbc95){logger[_0x10b9('0x1e')]('['+[_0x5e4428['toUpperCase']()]+_0x10b9('0x32'),_0xafbc95[_0x10b9('0x2c')]);_0x40d006(_0xafbc95);});}});});}function getCustomFields(_0x2b9ba3,_0x48290e,_0x26686c){var _0x35f59d={};if(_0x2b9ba3[_0x10b9('0x1b')]>0x0){_[_0x10b9('0x33')](_0x2b9ba3,function(_0xd04fc2){if(_[_0x10b9('0x34')]([_0x10b9('0x35'),_0x10b9('0x36')],_0xd04fc2[_0x10b9('0x37')])&&_0xd04fc2['nameField']&&!_0xd04fc2['customField']){var _0x5949c2=_0xd04fc2[_0x10b9('0x38')][_0x10b9('0x24')]();var _0x309299=_0x5949c2[_0x10b9('0x2a')](0x0,_0x5949c2[_0x10b9('0x39')]('_'));var _0x58a9c6=_0x5949c2[_0x10b9('0x2a')](_0x5949c2[_0x10b9('0x39')]('_')+0x1);if(_0x309299===_0x26686c){_0x35f59d[_0x58a9c6]=_0xd04fc2['content'];}}});}return _0x35f59d;}function getTicket(_0x2e1a80,_0x4e5922,_0x411557,_0x451870,_0x28169b,_0x2abd93,_0x214950){return new BPromise(function(_0x4eb333,_0x507c4c){var _0x34384d;return getAuthToken(_0x4e5922,_0x411557,_0x214950)['then'](function(_0x4625a1){if(_0x2abd93[_0x10b9('0x3a')]==='incident'){_0x34384d={'method':_0x10b9('0x9'),'uri':_0x451870+_0x10b9('0x3b'),'body':Object[_0x10b9('0x3c')]({},{'title':intUtil['getString'](_0x2abd93[_0x10b9('0x3d')],_0x28169b,'\x20'),'description':intUtil[_0x10b9('0x3e')](_0x2abd93[_0x10b9('0x3f')],_0x28169b,'\x0a'),'customerid_contact@odata.bind':_0x10b9('0x40')+_0x2e1a80[_0x10b9('0x2c')]+')','ownerid@odata.bind':_0x10b9('0x29')+_0x2e1a80[_0x10b9('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x2abd93['Fields'],_0x28169b,_0x2abd93[_0x10b9('0x3a')])),'headers':{'Authorization':_0x10b9('0x16')+_0x4625a1,'OData-Version':_0x10b9('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2abd93['ticketType']==='phonecall'){_0x34384d={'method':_0x10b9('0x9'),'uri':_0x451870+_0x10b9('0x41'),'body':Object[_0x10b9('0x3c')]({},{'subject':intUtil[_0x10b9('0x3e')](_0x2abd93['Subjects'],_0x28169b,'\x20'),'phonenumber':String(_0x28169b['calleridnum']),'description':intUtil['getString'](_0x2abd93[_0x10b9('0x3f')],_0x28169b,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x2e1a80['enduserId']+')','ownerid@odata.bind':_0x10b9('0x29')+_0x2e1a80[_0x10b9('0x23')]+')','directioncode':_0x2e1a80['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x10b9('0x29')+_0x2e1a80[_0x10b9('0x23')]+')','participationtypemask':_0x2e1a80[_0x10b9('0x42')]===_0x10b9('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x10b9('0x40')+_0x2e1a80['enduserId']+')','participationtypemask':_0x2e1a80['callDirection']===_0x10b9('0x43')?0x1:0x2}]},getCustomFields(_0x2abd93[_0x10b9('0x44')],_0x28169b,_0x2abd93[_0x10b9('0x3a')])),'headers':{'Authorization':_0x10b9('0x16')+_0x4625a1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x34384d);})['then'](function(_0x518a89){var _0x3751b7=_0x518a89[_0x10b9('0x45')][_0x10b9('0x46')];var _0x83cea4=_0x3751b7['substring'](_0x3751b7[_0x10b9('0x2b')]('(')+0x1,_0x3751b7[_0x10b9('0x2b')](')'));_0x2e1a80['ticketId']=_0x83cea4;_0x4eb333(_0x2e1a80);})['catch'](function(_0x1831ee){_0x507c4c(_0x1831ee[_0x10b9('0x14')]);});});}function emit(_0x487bfe,_0x28db06,_0x3e0e1d,_0x3a079d){var _0x294fc9={'uri':util[_0x10b9('0x47')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x487bfe,_0x3e0e1d,_0x3a079d)};io['to'](util[_0x10b9('0x47')](_0x10b9('0x48'),_0x28db06))[_0x10b9('0x49')]('trigger:browser:url',_0x294fc9);}exports['cs']=function(_0x1dc825,_0x5a362,_0x1ee960,_0x3deb66,_0x3340af,_0x48551c,_0x585be4,_0x3de190){var _0x3133ed={};_0x48551c[_0x10b9('0xb')]=intUtil[_0x10b9('0x4a')](_0x48551c[_0x10b9('0xb')]);_0x48551c[_0x10b9('0x4b')]=intUtil[_0x10b9('0x4a')](_0x48551c[_0x10b9('0x4b')]);_0x3133ed[_0x10b9('0x42')]=_0x3de190===_0x10b9('0x43')||_0x3de190===_0x10b9('0x4c')?_0x10b9('0x43'):_0x10b9('0x25');var _0x337ee6=util[_0x10b9('0x47')](_0x10b9('0x4d'),_0x48551c[_0x10b9('0xb')]);var _0x4bcf59=util[_0x10b9('0x47')](_0x10b9('0x4e'),_0x48551c[_0x10b9('0x4f')]);var _0x54403b=util[_0x10b9('0x47')](_0x10b9('0x50'),_0x48551c[_0x10b9('0x4b')],_0x5a362[_0x10b9('0x51')],md5(_0x5a362[_0x10b9('0x51')]));if(_0x3340af&&_0x3340af[_0x10b9('0x52')]){logger[_0x10b9('0x1e')](_0x10b9('0x53'),_0x10b9('0x54'));_0x5a362['recordingURL']=_0x54403b;}else if(_0x585be4&&_0x585be4['recordingFormat']&&_0x585be4['recordingFormat']!==_0x10b9('0x55')){logger['info'](_0x10b9('0x56'),_0x10b9('0x54'));_0x5a362['recordingURL']=_0x54403b;}else{_0x5a362['recordingURL']='';}return getUser(_0x3133ed,_0x48551c,_0x3deb66,_0x4bcf59,_0x337ee6,_0x3de190)[_0x10b9('0xe')](function(_0x5bc17b){logger[_0x10b9('0x1e')]('['+_0x3de190[_0x10b9('0x12')]()+_0x10b9('0x57'),_0x5bc17b[_0x10b9('0x23')]);logger['info']('['+_0x3de190[_0x10b9('0x12')]()+_0x10b9('0x58'),_0x5bc17b[_0x10b9('0x1a')]);return getEndUser(_0x5bc17b,_0x48551c,_0x4bcf59,_0x337ee6,_0x5a362,_0x3de190);})[_0x10b9('0xe')](function(_0x2ab299){logger[_0x10b9('0x1e')]('['+_0x3de190[_0x10b9('0x12')]()+_0x10b9('0x59'),_0x2ab299[_0x10b9('0x2c')]);logger[_0x10b9('0x1e')]('['+_0x3de190[_0x10b9('0x12')]()+_0x10b9('0x5a'),_0x5a362[_0x10b9('0x27')]);return getTicket(_0x2ab299,_0x48551c,_0x4bcf59,_0x337ee6,_0x5a362,_0x1ee960,_0x3de190);})[_0x10b9('0xe')](function(_0x55fc83){logger[_0x10b9('0x1e')](util[_0x10b9('0x47')]('['+_0x3de190['toUpperCase']()+_0x10b9('0x5b'),_0x1ee960[_0x10b9('0x3a')],_0x55fc83[_0x10b9('0x5c')]));logger['info'](util[_0x10b9('0x47')]('['+_0x3de190[_0x10b9('0x12')]()+']\x20Call\x20direction:\x20%s',_0x3de190));if(_0x3de190!=='unmanaged'){logger[_0x10b9('0x1e')]('['+_0x3de190[_0x10b9('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x48551c[_0x10b9('0xb')],_0x3deb66[_0x10b9('0x5d')],_0x1ee960[_0x10b9('0x3a')],_0x55fc83[_0x10b9('0x5c')]);}})['catch'](function(_0x3936fb){logger[_0x10b9('0x11')]('['+_0x3de190[_0x10b9('0x12')]()+_0x10b9('0x5e'),util[_0x10b9('0x5f')](_0x3936fb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0a31=['ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','assign','queue','callDirection','substring','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','name','error','inspect','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','POST','remoteUri','username','password','then','access_token',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','content'];(function(_0x14d1e1,_0x59484d){var _0x4b8dee=function(_0xa352e3){while(--_0xa352e3){_0x14d1e1['push'](_0x14d1e1['shift']());}};_0x4b8dee(++_0x59484d);}(_0x0a31,0xf3));var _0x10a3=function(_0x43a3f8,_0x488b70){_0x43a3f8=_0x43a3f8-0x0;var _0x3e4782=_0x0a31[_0x43a3f8];return _0x3e4782;};'use strict';var _=require(_0x10a3('0x0'));var BPromise=require('bluebird');var rp=require(_0x10a3('0x1'));var util=require(_0x10a3('0x2'));var intUtil=require(_0x10a3('0x3'));var md5=require(_0x10a3('0x4'));var Redis=require('ioredis');var logger=require(_0x10a3('0x5'))(_0x10a3('0x6'));var config=require(_0x10a3('0x7'));config['redis']=_[_0x10a3('0x8')](config['redis'],{'host':_0x10a3('0x9'),'port':0x18eb});var io=require(_0x10a3('0xa'))(new Redis(config[_0x10a3('0xb')]));function getAuthToken(_0x1cb4e6,_0x2cb976,_0x22d062){var _0x48b01a={'method':_0x10a3('0xc'),'uri':_0x2cb976,'form':{'client_id':_0x1cb4e6['clientId'],'resource':_0x1cb4e6[_0x10a3('0xd')],'username':_0x1cb4e6[_0x10a3('0xe')],'password':_0x1cb4e6[_0x10a3('0xf')],'grant_type':_0x10a3('0xf'),'client_secret':_0x1cb4e6['clientSecret']},'json':!![]};return rp(_0x48b01a)[_0x10a3('0x10')](function(_0x3b76a7){return _0x3b76a7[_0x10a3('0x11')];})['catch'](function(_0x43f432){logger['error']('['+[_0x22d062['toUpperCase']()]+_0x10a3('0x12'));return _0x43f432[_0x10a3('0x13')];});}function getUser(_0x2d55b1,_0x4ce7bd,_0x251b4b,_0xf0751b,_0xc8e6f6,_0x5695e9){return new BPromise(function(_0x2dfce2,_0x5c5e31){return getAuthToken(_0x4ce7bd,_0xf0751b,_0x5695e9)[_0x10a3('0x10')](function(_0x38ac8d){var _0x27048f={'method':_0x10a3('0x14'),'uri':_0xc8e6f6+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x10a3('0x15')+_0x38ac8d,'OData-Version':'4.0'},'json':!![]};return rp(_0x27048f);})[_0x10a3('0x10')](function(_0x407bfb){var _0x51e183=_0x407bfb[_0x10a3('0x16')];var _0x4df287=![];var _0x5832a6=null;if(!_[_0x10a3('0x17')](_0x251b4b)){if(intUtil[_0x10a3('0x18')](_0x251b4b[_0x10a3('0x19')])){_0x2d55b1[_0x10a3('0x1a')]=_0x251b4b[_0x10a3('0x19')];for(_0x5832a6=0x0;_0x5832a6<_0x51e183['length'];_0x5832a6++){if(_0x51e183[_0x5832a6][_0x10a3('0x1b')]===_0x251b4b[_0x10a3('0x19')]&&!_0x51e183[_0x5832a6][_0x10a3('0x1c')]){_0x4df287=!![];logger[_0x10a3('0x1d')]('['+[_0x5695e9[_0x10a3('0x1e')]()]+_0x10a3('0x1f')+_0x51e183[_0x5832a6][_0x10a3('0x20')]+'!');_0x2d55b1['userId']=_0x51e183[_0x5832a6]['systemuserid'];}}}}if(!_0x4df287){logger[_0x10a3('0x1d')]('['+[_0x5695e9[_0x10a3('0x1e')]()]+_0x10a3('0x21'));_0x2d55b1[_0x10a3('0x1a')]=_0x4ce7bd[_0x10a3('0xe')];for(_0x5832a6=0x0;_0x5832a6<_0x51e183[_0x10a3('0x22')];_0x5832a6++){if(_0x51e183[_0x5832a6][_0x10a3('0x1b')]===_0x4ce7bd[_0x10a3('0xe')]){_0x2d55b1[_0x10a3('0x23')]=_0x51e183[_0x5832a6]['systemuserid'];}}}_0x2dfce2(_0x2d55b1);})[_0x10a3('0x24')](function(_0x194b8a){_0x5c5e31(_0x194b8a[_0x10a3('0x13')]);});});}function createEndUser(_0x29a0b5,_0x3b9f7d,_0x2f2c0a,_0x163d81,_0x1d50ea,_0x20c87d){return new BPromise(function(_0x475089,_0xa240f5){return getAuthToken(_0x3b9f7d,_0x2f2c0a,_0x20c87d)['then'](function(_0x25ec80){var _0x249438=_0x20c87d[_0x10a3('0x25')]()===_0x10a3('0x26')?_0x1d50ea[_0x10a3('0x27')]:_0x1d50ea[_0x10a3('0x28')];var _0xc223f5={'method':_0x10a3('0xc'),'uri':_0x163d81+_0x10a3('0x29'),'body':{'telephone1':_0x249438,'fullname':_0x249438,'firstname':_0x249438,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x10a3('0x2a')+_0x29a0b5[_0x10a3('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x25ec80,'OData-Version':_0x10a3('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xc223f5);})[_0x10a3('0x10')](function(_0x332cc5){var _0x265239=_0x332cc5[_0x10a3('0x2c')][_0x10a3('0x2d')];var _0x33c67c=_0x265239['substring'](_0x265239[_0x10a3('0x2e')]('(')+0x1,_0x265239['lastIndexOf'](')'));_0x29a0b5['enduserId']=_0x33c67c;_0x475089(_0x29a0b5);})[_0x10a3('0x24')](function(_0x3e9608){_0xa240f5(_0x3e9608[_0x10a3('0x13')]);});});}function getEndUser(_0x395849,_0x4a86f7,_0x43e5cb,_0x30ae8b,_0x7e1456,_0x3e6ee6){return new BPromise(function(_0x22cc0d,_0x12b926){var _0x15915f=_0x3e6ee6[_0x10a3('0x25')]()===_0x10a3('0x26')?_0x7e1456['destcalleridnum']:_0x7e1456[_0x10a3('0x28')];return getAuthToken(_0x4a86f7,_0x43e5cb,_0x3e6ee6)[_0x10a3('0x10')](function(_0x46ad45){var _0x3de3e6={'method':'GET','uri':_0x30ae8b+_0x10a3('0x2f')+_0x15915f[_0x10a3('0x30')]('+',_0x10a3('0x31'))+'\x27','headers':{'Authorization':_0x10a3('0x15')+_0x46ad45,'If-None-Match':null,'OData-Version':_0x10a3('0x2b')},'json':!![]};return rp(_0x3de3e6);})['then'](function(_0x1e92e7){var _0x3cc578=null;if(_0x1e92e7){var _0x149a0d=_0x1e92e7[_0x10a3('0x16')];var _0x2765d7=![];for(_0x3cc578=0x0;_0x3cc578<_0x149a0d[_0x10a3('0x22')];_0x3cc578++){if(_0x149a0d[_0x3cc578][_0x10a3('0x32')]===_0x15915f){_0x2765d7=!![];_0x395849[_0x10a3('0x33')]=_0x149a0d[_0x3cc578][_0x10a3('0x34')];}}if(_0x2765d7){_0x22cc0d(_0x395849);}else{return createEndUser(_0x395849,_0x4a86f7,_0x43e5cb,_0x30ae8b,_0x7e1456,_0x3e6ee6)[_0x10a3('0x10')](function(_0x8fcdec){logger[_0x10a3('0x1d')]('['+[_0x3e6ee6['toUpperCase']()]+_0x10a3('0x35'),_0x8fcdec['enduserId']);_0x22cc0d(_0x8fcdec);});}}else{return createEndUser(_0x395849,_0x4a86f7,_0x43e5cb,_0x30ae8b,_0x7e1456,_0x3e6ee6)[_0x10a3('0x10')](function(_0xe09c20){logger['info']('['+[_0x3e6ee6[_0x10a3('0x1e')]()]+']\x20Enduser\x20Created!',_0xe09c20[_0x10a3('0x33')]);_0x22cc0d(_0xe09c20);});}});});}function getCustomFields(_0x3e653c,_0x1f96af,_0x15e294){var _0x24d8e4={};if(_0x3e653c[_0x10a3('0x22')]>0x0){_[_0x10a3('0x36')](_0x3e653c,function(_0x35e807){if(_[_0x10a3('0x37')]([_0x10a3('0x38'),_0x10a3('0x39')],_0x35e807[_0x10a3('0x3a')])&&_0x35e807[_0x10a3('0x3b')]&&!_0x35e807[_0x10a3('0x3c')]){var _0x44d34c=_0x35e807['idField'][_0x10a3('0x25')]();var _0x57b5de=_0x44d34c['substring'](0x0,_0x44d34c[_0x10a3('0x3d')]('_'));var _0x54ab7d=_0x44d34c['substring'](_0x44d34c[_0x10a3('0x3d')]('_')+0x1);if(_0x57b5de===_0x15e294){_0x24d8e4[_0x54ab7d]=_0x35e807[_0x10a3('0x3e')];}}});}return _0x24d8e4;}function getTicket(_0x3a2fd0,_0x436971,_0x134d5a,_0x470cf6,_0x130adc,_0x247e3a,_0xe4e97e){return new BPromise(function(_0x1be93f,_0x4e3c68){var _0x3fa379;return getAuthToken(_0x436971,_0x134d5a,_0xe4e97e)['then'](function(_0x5dc211){if(_0x247e3a[_0x10a3('0x3f')]===_0x10a3('0x40')){_0x3fa379={'method':_0x10a3('0xc'),'uri':_0x470cf6+_0x10a3('0x41'),'body':Object['assign']({},{'title':intUtil[_0x10a3('0x42')](_0x247e3a[_0x10a3('0x43')],_0x130adc,'\x20'),'description':intUtil['getString'](_0x247e3a[_0x10a3('0x44')],_0x130adc,'\x0a'),'customerid_contact@odata.bind':_0x10a3('0x45')+_0x3a2fd0[_0x10a3('0x33')]+')','ownerid@odata.bind':_0x10a3('0x2a')+_0x3a2fd0['userId']+')','caseorigincode':'1'},getCustomFields(_0x247e3a[_0x10a3('0x46')],_0x130adc,_0x247e3a['ticketType'])),'headers':{'Authorization':_0x10a3('0x15')+_0x5dc211,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x247e3a[_0x10a3('0x3f')]===_0x10a3('0x47')){_0x3fa379={'method':_0x10a3('0xc'),'uri':_0x470cf6+_0x10a3('0x48'),'body':Object[_0x10a3('0x49')]({},{'subject':intUtil['getString'](_0x247e3a[_0x10a3('0x43')],_0x130adc,'\x20'),'phonenumber':String(_0x130adc[_0x10a3('0x28')]),'description':intUtil[_0x10a3('0x42')](_0x247e3a[_0x10a3('0x44')],_0x130adc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x10a3('0x45')+_0x3a2fd0['enduserId']+')','ownerid@odata.bind':_0x10a3('0x2a')+_0x3a2fd0[_0x10a3('0x23')]+')','directioncode':_0x3a2fd0['callDirection']===_0x10a3('0x4a')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x10a3('0x2a')+_0x3a2fd0[_0x10a3('0x23')]+')','participationtypemask':_0x3a2fd0[_0x10a3('0x4b')]===_0x10a3('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0x10a3('0x45')+_0x3a2fd0['enduserId']+')','participationtypemask':_0x3a2fd0[_0x10a3('0x4b')]==='queue'?0x1:0x2}]},getCustomFields(_0x247e3a[_0x10a3('0x46')],_0x130adc,_0x247e3a[_0x10a3('0x3f')])),'headers':{'Authorization':_0x10a3('0x15')+_0x5dc211,'OData-Version':_0x10a3('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3fa379);})[_0x10a3('0x10')](function(_0x381442){var _0x31c43d=_0x381442['headers'][_0x10a3('0x2d')];var _0x4b7400=_0x31c43d[_0x10a3('0x4c')](_0x31c43d[_0x10a3('0x2e')]('(')+0x1,_0x31c43d[_0x10a3('0x2e')](')'));_0x3a2fd0[_0x10a3('0x4d')]=_0x4b7400;_0x1be93f(_0x3a2fd0);})[_0x10a3('0x24')](function(_0x246b3d){_0x4e3c68(_0x246b3d[_0x10a3('0x13')]);});});}function emit(_0x5aaf41,_0x38e199,_0x1f336e,_0xef5172){var _0x56ae6e={'uri':util[_0x10a3('0x4e')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5aaf41,_0x1f336e,_0xef5172)};io['to'](util[_0x10a3('0x4e')](_0x10a3('0x4f'),_0x38e199))['emit'](_0x10a3('0x50'),_0x56ae6e);}exports['cs']=function(_0x1a5ae8,_0x4a5d00,_0xd50484,_0x168cf2,_0x1d5d63,_0x16ae3e,_0x292b03,_0xd07d54){var _0x15fc1d={};_0x16ae3e[_0x10a3('0xd')]=intUtil[_0x10a3('0x51')](_0x16ae3e[_0x10a3('0xd')]);_0x16ae3e['serverUrl']=intUtil['stripTrailingSlash'](_0x16ae3e[_0x10a3('0x52')]);_0x15fc1d['callDirection']=_0xd07d54==='queue'||_0xd07d54===_0x10a3('0x53')?_0x10a3('0x4a'):'outbound';var _0x3c554f=util[_0x10a3('0x4e')](_0x10a3('0x54'),_0x16ae3e['remoteUri']);var _0x14486c=util[_0x10a3('0x4e')](_0x10a3('0x55'),_0x16ae3e[_0x10a3('0x56')]);var _0x5896d6=util['format'](_0x10a3('0x57'),_0x16ae3e[_0x10a3('0x52')],_0x4a5d00[_0x10a3('0x58')],md5(_0x4a5d00[_0x10a3('0x58')]));if(_0x1d5d63&&_0x1d5d63['monitor_format']){logger[_0x10a3('0x1d')]('[QUEUE]',_0x10a3('0x59'));_0x4a5d00['recordingURL']=_0x5896d6;}else if(_0x292b03&&_0x292b03[_0x10a3('0x5a')]&&_0x292b03[_0x10a3('0x5a')]!==_0x10a3('0x5b')){logger['info'](_0x10a3('0x5c'),_0x10a3('0x59'));_0x4a5d00[_0x10a3('0x5d')]=_0x5896d6;}else{_0x4a5d00[_0x10a3('0x5d')]='';}return getUser(_0x15fc1d,_0x16ae3e,_0x168cf2,_0x14486c,_0x3c554f,_0xd07d54)[_0x10a3('0x10')](function(_0x117dd5){logger[_0x10a3('0x1d')]('['+_0xd07d54[_0x10a3('0x1e')]()+_0x10a3('0x5e'),_0x117dd5['userId']);logger['info']('['+_0xd07d54[_0x10a3('0x1e')]()+_0x10a3('0x5f'),_0x117dd5[_0x10a3('0x1a')]);return getEndUser(_0x117dd5,_0x16ae3e,_0x14486c,_0x3c554f,_0x4a5d00,_0xd07d54);})[_0x10a3('0x10')](function(_0x2c3d4b){logger[_0x10a3('0x1d')]('['+_0xd07d54[_0x10a3('0x1e')]()+_0x10a3('0x60'),_0x2c3d4b['enduserId']);logger[_0x10a3('0x1d')]('['+_0xd07d54['toUpperCase']()+_0x10a3('0x61'),_0x4a5d00['calleridnum']);return getTicket(_0x2c3d4b,_0x16ae3e,_0x14486c,_0x3c554f,_0x4a5d00,_0xd50484,_0xd07d54);})[_0x10a3('0x10')](function(_0x2f4be7){logger['info'](util[_0x10a3('0x4e')]('['+_0xd07d54['toUpperCase']()+_0x10a3('0x62'),_0xd50484[_0x10a3('0x3f')],_0x2f4be7[_0x10a3('0x4d')]));logger['info'](util[_0x10a3('0x4e')]('['+_0xd07d54['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xd07d54));if(_0xd07d54!==_0x10a3('0x53')){logger[_0x10a3('0x1d')]('['+_0xd07d54['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x16ae3e[_0x10a3('0xd')],_0x168cf2[_0x10a3('0x63')],_0xd50484[_0x10a3('0x3f')],_0x2f4be7[_0x10a3('0x4d')]);}})['catch'](function(_0x21cde0){logger[_0x10a3('0x64')]('['+_0xd07d54['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x10a3('0x65')](_0x21cde0,{'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 5795c22..29abdea 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 _0x1eab=['trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','value','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1eab,0x1d1));var _0xb1ea=function(_0x435302,_0x13a68e){_0x435302=_0x435302-0x0;var _0x285697=_0x1eab[_0x435302];return _0x285697;};'use strict';var _=require(_0xb1ea('0x0'));var rp=require(_0xb1ea('0x1'));var md5=require('md5');var util=require(_0xb1ea('0x2'));var Redis=require(_0xb1ea('0x3'));var intUtil=require(_0xb1ea('0x4'));var config=require(_0xb1ea('0x5'));var logger=require('../../../../config/logger')(_0xb1ea('0x6'));config[_0xb1ea('0x7')]=_[_0xb1ea('0x8')](config[_0xb1ea('0x7')],{'host':_0xb1ea('0x9'),'port':0x18eb});var io=require(_0xb1ea('0xa'))(new Redis(config[_0xb1ea('0x7')]));var headers={'Content-Type':_0xb1ea('0xb'),'Accept':_0xb1ea('0xb')};function emit(_0xdd9809,_0x1be413,_0x3d0bed){io['to'](_0xdd9809)[_0xb1ea('0xc')](_0x1be413,_0x3d0bed);}function getTicket(_0x30d820,_0xcdc1d5,_0x53922a,_0x214cd8,_0x5a4405){logger[_0xb1ea('0xd')]('Creating\x20new\x20ticket...');var _0x4acfa0=_[_0xb1ea('0xe')]({'responder_id':_0xcdc1d5['id'],'requester_id':_0x53922a['id'],'name':util[_0xb1ea('0xf')]('Caller\x20-\x20%s',_0x5a4405[_0xb1ea('0x10')]),'phone':_0x5a4405[_0xb1ea('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb1ea('0x12')](_0x214cd8[_0xb1ea('0x13')],_0x5a4405,'\x20'),'description':intUtil[_0xb1ea('0x12')](_0x214cd8[_0xb1ea('0x14')],_0x5a4405,_0xb1ea('0x15')),'tags':getTags(_0x214cd8['Tags'],_0xb1ea('0x16'))},getCustomFields(_0x214cd8[_0xb1ea('0x17')],_0x5a4405));_0x4acfa0[_0xb1ea('0x18')]=_[_0xb1ea('0x19')](_['keyBy'](_0x4acfa0['custom_fields'],'id'),_0xb1ea('0x1a'));return request({'uri':util[_0xb1ea('0xf')]('%s/api/v2/tickets',_0x30d820['remoteUri']),'method':_0xb1ea('0x1b'),'body':_0x4acfa0})[_0xb1ea('0x1c')](function(_0x35eeb0){logger[_0xb1ea('0xd')](_0xb1ea('0x1d'));return _0x35eeb0;});}function getUser(_0x4d61d2,_0x1d13d9){if(intUtil['validateEmail'](_0x1d13d9)){return request({'uri':util[_0xb1ea('0xf')](_0xb1ea('0x1e'),_0x4d61d2[_0xb1ea('0x1f')]),'qs':{'email':_0x1d13d9}})[_0xb1ea('0x1c')](function(_0x98ddce){if(_0x98ddce[_0xb1ea('0x20')]){logger[_0xb1ea('0xd')](_0xb1ea('0x21'));return _[_0xb1ea('0x22')](_0x98ddce,function(_0x502696){return _0x502696[_0xb1ea('0x23')][_0xb1ea('0x24')]===_0x1d13d9;});}else{logger[_0xb1ea('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb1ea('0xf')](_0xb1ea('0x25'),_0x4d61d2[_0xb1ea('0x1f')])})[_0xb1ea('0x1c')](function(_0x3e398a){logger[_0xb1ea('0xd')](_0xb1ea('0x26'));return _0x3e398a;});}});}else{logger[_0xb1ea('0xd')](_0xb1ea('0x27'));return request({'uri':util[_0xb1ea('0xf')](_0xb1ea('0x25'),_0x4d61d2['remoteUri'])})[_0xb1ea('0x1c')](function(_0x15dd66){logger['info'](_0xb1ea('0x26'));return _0x15dd66;});}}function getEndUser(_0x823eab,_0x1dacd8,_0xa06e0d){logger[_0xb1ea('0xd')]('Searching\x20enduser\x20with\x20phone',_0xa06e0d);return request({'uri':util['format'](_0xb1ea('0x28'),_0x823eab[_0xb1ea('0x1f')]),'qs':{'phone':_0xa06e0d}})['then'](function(_0x354345){if(_0x354345[_0xb1ea('0x20')]){logger[_0xb1ea('0xd')](_0xb1ea('0x29'));return _[_0xb1ea('0x22')](_0x354345,{'phone':_0xa06e0d});}else{logger[_0xb1ea('0xd')](_0xb1ea('0x2a'));return request({'uri':util['format'](_0xb1ea('0x28'),_0x823eab[_0xb1ea('0x1f')]),'method':_0xb1ea('0x1b'),'body':{'name':_0x1dacd8,'phone':_0xa06e0d}})[_0xb1ea('0x1c')](function(_0x3d2853){logger['info'](_0xb1ea('0x2b'));return _0x3d2853;});}});}function getAuth(_0x3f591d){return util[_0xb1ea('0xf')](_0xb1ea('0x2c'),new Buffer(_0x3f591d['apiKey']+':X')[_0xb1ea('0x2d')](_0xb1ea('0x2e')));}function request(_0x17e1b5){logger['debug'](_0xb1ea('0x2f'),JSON[_0xb1ea('0x30')](_0x17e1b5));return rp(_['defaults'](_0x17e1b5,{'method':_0xb1ea('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x475594,_0x222497){var _0x3e9d53=[];if(_0x475594&&_0x475594[_0xb1ea('0x20')]>0x0){_0x3e9d53=_[_0xb1ea('0x32')](_0x475594,_0x222497);}return _0x3e9d53;}function getCustomFields(_0x53687a,_0x1322e2){var _0x250361=[];var _0x5ba135={'custom_fields':[]};if(_0x53687a[_0xb1ea('0x20')]>0x0){_['forEach'](_0x53687a,function(_0x17c236){if(_[_0xb1ea('0x33')]([_0xb1ea('0x34'),_0xb1ea('0x35')],_0x17c236[_0xb1ea('0x36')])&&_0x17c236[_0xb1ea('0x37')]&&!_0x17c236[_0xb1ea('0x38')]){_0x5ba135[_0x17c236[_0xb1ea('0x37')][_0xb1ea('0x39')]()]=_0x17c236[_0xb1ea('0x3a')][_0xb1ea('0x2d')]();}else if(_[_0xb1ea('0x33')]([_0xb1ea('0x34'),_0xb1ea('0x35')],_0x17c236[_0xb1ea('0x36')])&&_0x17c236[_0xb1ea('0x3b')]&&_0x17c236[_0xb1ea('0x38')]){_0x5ba135[_0xb1ea('0x18')][_0xb1ea('0x3c')]({'id':_0x17c236['idField'],'value':_0x17c236[_0xb1ea('0x3a')][_0xb1ea('0x2d')]()});}else if(_0x17c236[_0xb1ea('0x36')]===_0xb1ea('0x3d')&&_0x17c236['variableName']&&_0x17c236['idField']&&_0x17c236[_0xb1ea('0x38')]){_0x1322e2[_0x17c236[_0xb1ea('0x3e')]]&&_0x5ba135[_0xb1ea('0x18')]['push']({'id':_0x17c236[_0xb1ea('0x3b')],'value':_0x1322e2[_0x17c236[_0xb1ea('0x3e')]]['toString']()});}else if(_0x17c236[_0xb1ea('0x36')]===_0xb1ea('0x3f')&&_0x17c236[_0xb1ea('0x40')]&&_0x17c236[_0xb1ea('0x40')]['name']&&_0x17c236['idField']&&_0x17c236[_0xb1ea('0x38')]){_0x1322e2[_0x17c236[_0xb1ea('0x40')]['name']['toLowerCase']()]&&_0x5ba135[_0xb1ea('0x18')][_0xb1ea('0x3c')]({'id':_0x17c236[_0xb1ea('0x3b')],'value':_0x1322e2[_0x17c236[_0xb1ea('0x40')][_0xb1ea('0x16')][_0xb1ea('0x39')]()][_0xb1ea('0x2d')]()});}});}return _0x5ba135;}exports['queue']=function(_0x229321,_0x481fea,_0x526279,_0x3e7e82,_0x2bce94,_0x3f6710){var _0x24e82f,_0x28ecdc;_0x3f6710[_0xb1ea('0x1f')]=intUtil[_0xb1ea('0x41')](_0x3f6710[_0xb1ea('0x1f')]);_0x3f6710[_0xb1ea('0x42')]=intUtil[_0xb1ea('0x41')](_0x3f6710[_0xb1ea('0x42')]);if(_0x2bce94&&_0x2bce94[_0xb1ea('0x43')]){logger['info'](_0xb1ea('0x44'),'Recording\x20is\x20enabled!');_0x481fea['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f6710[_0xb1ea('0x42')],_0x481fea[_0xb1ea('0x45')],md5(_0x481fea[_0xb1ea('0x45')]));}else{_0x481fea[_0xb1ea('0x46')]='';}headers[_0xb1ea('0x47')]=getAuth(_0x3f6710);return getUser(_0x3f6710,_0x3e7e82[_0xb1ea('0x24')])[_0xb1ea('0x1c')](function(_0x20b174){_0x24e82f=_0x20b174;logger[_0xb1ea('0xd')]('The\x20User\x20ID\x20is:',_0x24e82f['id']);return getEndUser(_0x3f6710,_0x481fea['calleridname'],_0x481fea[_0xb1ea('0x11')]);})['then'](function(_0x2a2624){_0x28ecdc=_0x2a2624;logger[_0xb1ea('0xd')](_0xb1ea('0x48'),_0x28ecdc['id']);return getTicket(_0x3f6710,_0x24e82f,_0x28ecdc,_0x526279,_0x481fea);})['then'](function(_0x305a06){if(_0x305a06&&_0x305a06['id']){logger[_0xb1ea('0xd')](_0xb1ea('0x1d'));logger[_0xb1ea('0xd')]('The\x20Ticket\x20ID\x20is:',_0x305a06['id']);logger[_0xb1ea('0xd')](_0xb1ea('0x44'),_0xb1ea('0x49'));emit(util[_0xb1ea('0xf')](_0xb1ea('0x4a'),_0x3e7e82[_0xb1ea('0x16')]),_0xb1ea('0x4b'),{'uri':util['format'](_0xb1ea('0x4c'),_0x3f6710['remoteUri'],_0x305a06['id'])});}})[_0xb1ea('0x4d')](function(_0x4503ca){logger[_0xb1ea('0x4e')](_0xb1ea('0x44'),JSON[_0xb1ea('0x30')](_0x4503ca));});};exports['outbound']=function(_0x1788cc,_0x27341a,_0x1e6cd5,_0x43014e,_0x44d8af,_0x3a02db,_0x2bd4c9){var _0x5788e6,_0x2f8470;_0x3a02db[_0xb1ea('0x1f')]=intUtil[_0xb1ea('0x41')](_0x3a02db[_0xb1ea('0x1f')]);_0x3a02db[_0xb1ea('0x42')]=intUtil[_0xb1ea('0x41')](_0x3a02db['serverUrl']);if(_0x2bd4c9&&_0x2bd4c9[_0xb1ea('0x4f')]&&_0x2bd4c9['recordingFormat']!==_0xb1ea('0x50')){logger[_0xb1ea('0xd')]('[OUTBOUND]',_0xb1ea('0x51'));_0x27341a[_0xb1ea('0x46')]=util['format'](_0xb1ea('0x52'),_0x3a02db['serverUrl'],_0x27341a['uniqueid'],md5(_0x27341a[_0xb1ea('0x45')]));}headers[_0xb1ea('0x47')]=getAuth(_0x3a02db);return getUser(_0x3a02db,_0x43014e['email'])[_0xb1ea('0x1c')](function(_0x24a4bf){_0x5788e6=_0x24a4bf;logger['info'](_0xb1ea('0x53'),_0x5788e6['id']);return getEndUser(_0x3a02db,_0x27341a[_0xb1ea('0x54')],_0x27341a[_0xb1ea('0x55')]);})[_0xb1ea('0x1c')](function(_0x39571c){_0x2f8470=_0x39571c;logger[_0xb1ea('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2f8470['id']);return getTicket(_0x3a02db,_0x5788e6,_0x2f8470,_0x1e6cd5,_0x27341a);})[_0xb1ea('0x1c')](function(_0xeb7a61){if(_0xeb7a61&&_0xeb7a61['id']){logger[_0xb1ea('0xd')](_0xb1ea('0x1d'));logger['info'](_0xb1ea('0x56'),_0xeb7a61['id']);logger[_0xb1ea('0xd')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb1ea('0x4a'),_0x43014e[_0xb1ea('0x16')]),'trigger:browser:url',{'uri':util[_0xb1ea('0xf')](_0xb1ea('0x4c'),_0x3a02db[_0xb1ea('0x1f')],_0xeb7a61['id'])});}})[_0xb1ea('0x4d')](function(_0x4a970a){logger[_0xb1ea('0x4e')](_0xb1ea('0x57'),JSON['stringify'](_0x4a970a));});};exports[_0xb1ea('0x58')]=function(_0x3bb483,_0x4f87ec,_0x36ad2d,_0x5c9bbe,_0x55f045,_0x2be9ac){var _0x34eb37,_0x1a1938;_0x2be9ac[_0xb1ea('0x1f')]=intUtil['stripTrailingSlash'](_0x2be9ac['remoteUri']);_0x2be9ac['serverUrl']=intUtil[_0xb1ea('0x41')](_0x2be9ac[_0xb1ea('0x42')]);if(_0x55f045&&_0x55f045[_0xb1ea('0x43')]){logger['info']('['+_0x4f87ec['lastevent'][_0xb1ea('0x59')]()+']',_0xb1ea('0x51'));_0x4f87ec[_0xb1ea('0x46')]=util['format'](_0xb1ea('0x52'),_0x2be9ac['serverUrl'],_0x4f87ec['uniqueid'],md5(_0x4f87ec[_0xb1ea('0x45')]));}else{_0x4f87ec['recordingURL']='';}headers[_0xb1ea('0x47')]=getAuth(_0x2be9ac);return getUser(_0x2be9ac,'')[_0xb1ea('0x1c')](function(_0xb834f7){_0x34eb37=_0xb834f7;logger[_0xb1ea('0xd')](_0xb1ea('0x53'),_0x34eb37['id']);return getEndUser(_0x2be9ac,_0x4f87ec['calleridname'],_0x4f87ec[_0xb1ea('0x11')]);})[_0xb1ea('0x1c')](function(_0x3c9bc5){_0x1a1938=_0x3c9bc5;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1a1938['id']);return getTicket(_0x2be9ac,_0x34eb37,_0x1a1938,_0x36ad2d,_0x4f87ec);})[_0xb1ea('0x1c')](function(_0x56d296){if(_0x56d296){logger[_0xb1ea('0xd')](_0xb1ea('0x1d'));logger[_0xb1ea('0xd')]('The\x20Ticket\x20ID\x20is:',_0x56d296['id']);}})[_0xb1ea('0x4d')](function(_0x1cbfc4){logger[_0xb1ea('0x4e')]('['+_0x4f87ec['lastevent'][_0xb1ea('0x59')]()+']',JSON['stringify'](_0x1cbfc4));});}; \ No newline at end of file +var _0xfaaa=['Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','catch','unmanaged','lastevent','toUpperCase','util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','getString','Descriptions','
','name','Fields','custom_fields','mapValues','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','picklist','nameField','customField','toString','string','type','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid'];(function(_0x384ae4,_0xd2f00a){var _0x5974bc=function(_0x2ee34a){while(--_0x2ee34a){_0x384ae4['push'](_0x384ae4['shift']());}};_0x5974bc(++_0xd2f00a);}(_0xfaaa,0x162));var _0xafaa=function(_0x32e2c4,_0x540260){_0x32e2c4=_0x32e2c4-0x0;var _0x3733d0=_0xfaaa[_0x32e2c4];return _0x3733d0;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xafaa('0x0'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xafaa('0x1'))(_0xafaa('0x2'));config[_0xafaa('0x3')]=_['defaults'](config['redis'],{'host':_0xafaa('0x4'),'port':0x18eb});var io=require(_0xafaa('0x5'))(new Redis(config[_0xafaa('0x3')]));var headers={'Content-Type':_0xafaa('0x6'),'Accept':'application/json'};function emit(_0x5b6d9e,_0x310a28,_0x34a912){io['to'](_0x5b6d9e)[_0xafaa('0x7')](_0x310a28,_0x34a912);}function getTicket(_0x1aedf0,_0x4e88f8,_0x155800,_0x2658c2,_0xa64186){logger[_0xafaa('0x8')](_0xafaa('0x9'));var _0x240aaf=_[_0xafaa('0xa')]({'responder_id':_0x4e88f8['id'],'requester_id':_0x155800['id'],'name':util[_0xafaa('0xb')]('Caller\x20-\x20%s',_0xa64186[_0xafaa('0xc')]),'phone':_0xa64186['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2658c2['Subjects'],_0xa64186,'\x20'),'description':intUtil[_0xafaa('0xd')](_0x2658c2[_0xafaa('0xe')],_0xa64186,_0xafaa('0xf')),'tags':getTags(_0x2658c2['Tags'],_0xafaa('0x10'))},getCustomFields(_0x2658c2[_0xafaa('0x11')],_0xa64186));_0x240aaf[_0xafaa('0x12')]=_[_0xafaa('0x13')](_['keyBy'](_0x240aaf[_0xafaa('0x12')],'id'),'value');return request({'uri':util['format']('%s/api/v2/tickets',_0x1aedf0[_0xafaa('0x14')]),'method':_0xafaa('0x15'),'body':_0x240aaf})[_0xafaa('0x16')](function(_0x3a8c00){logger[_0xafaa('0x8')](_0xafaa('0x17'));return _0x3a8c00;});}function getUser(_0x1f09b8,_0x4a7443){if(intUtil['validateEmail'](_0x4a7443)){return request({'uri':util[_0xafaa('0xb')](_0xafaa('0x18'),_0x1f09b8[_0xafaa('0x14')]),'qs':{'email':_0x4a7443}})[_0xafaa('0x16')](function(_0x54e2f0){if(_0x54e2f0[_0xafaa('0x19')]){logger[_0xafaa('0x8')](_0xafaa('0x1a'));return _[_0xafaa('0x1b')](_0x54e2f0,function(_0x432987){return _0x432987['contact'][_0xafaa('0x1c')]===_0x4a7443;});}else{logger[_0xafaa('0x8')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xafaa('0xb')](_0xafaa('0x1d'),_0x1f09b8[_0xafaa('0x14')])})['then'](function(_0x55ac8f){logger[_0xafaa('0x8')](_0xafaa('0x1e'));return _0x55ac8f;});}});}else{logger[_0xafaa('0x8')](_0xafaa('0x1f'));return request({'uri':util['format'](_0xafaa('0x1d'),_0x1f09b8[_0xafaa('0x14')])})['then'](function(_0x44e672){logger[_0xafaa('0x8')](_0xafaa('0x1e'));return _0x44e672;});}}function getEndUser(_0xb07a3,_0x51229e,_0x465c4d){logger['info'](_0xafaa('0x20'),_0x465c4d);return request({'uri':util[_0xafaa('0xb')](_0xafaa('0x21'),_0xb07a3[_0xafaa('0x14')]),'qs':{'phone':_0x465c4d}})[_0xafaa('0x16')](function(_0x4ee3b5){if(_0x4ee3b5[_0xafaa('0x19')]){logger[_0xafaa('0x8')]('Enduser\x20found!');return _[_0xafaa('0x1b')](_0x4ee3b5,{'phone':_0x465c4d});}else{logger[_0xafaa('0x8')](_0xafaa('0x22'));return request({'uri':util[_0xafaa('0xb')](_0xafaa('0x21'),_0xb07a3[_0xafaa('0x14')]),'method':_0xafaa('0x15'),'body':{'name':_0x51229e,'phone':_0x465c4d}})[_0xafaa('0x16')](function(_0xe56938){logger[_0xafaa('0x8')]('Enduser\x20created.');return _0xe56938;});}});}function getAuth(_0x103f58){return util[_0xafaa('0xb')](_0xafaa('0x23'),new Buffer(_0x103f58['apiKey']+':X')['toString'](_0xafaa('0x24')));}function request(_0x2ded1e){logger[_0xafaa('0x25')](_0xafaa('0x26'),JSON[_0xafaa('0x27')](_0x2ded1e));return rp(_[_0xafaa('0x28')](_0x2ded1e,{'method':_0xafaa('0x29'),'headers':headers,'json':!![]}));}function getTags(_0x1e64a3,_0x1295e1){var _0x33b19b=[];if(_0x1e64a3&&_0x1e64a3[_0xafaa('0x19')]>0x0){_0x33b19b=_[_0xafaa('0x2a')](_0x1e64a3,_0x1295e1);}return _0x33b19b;}function getCustomFields(_0x141ca6,_0x324033){var _0x241f6b=[];var _0x51c30f={'custom_fields':[]};if(_0x141ca6[_0xafaa('0x19')]>0x0){_[_0xafaa('0x2b')](_0x141ca6,function(_0xac32f9){if(_[_0xafaa('0x2c')](['string',_0xafaa('0x2d')],_0xac32f9['type'])&&_0xac32f9[_0xafaa('0x2e')]&&!_0xac32f9[_0xafaa('0x2f')]){_0x51c30f[_0xac32f9[_0xafaa('0x2e')]['toLowerCase']()]=_0xac32f9['content'][_0xafaa('0x30')]();}else if(_[_0xafaa('0x2c')]([_0xafaa('0x31'),_0xafaa('0x2d')],_0xac32f9[_0xafaa('0x32')])&&_0xac32f9[_0xafaa('0x33')]&&_0xac32f9[_0xafaa('0x2f')]){_0x51c30f[_0xafaa('0x12')]['push']({'id':_0xac32f9[_0xafaa('0x33')],'value':_0xac32f9['content'][_0xafaa('0x30')]()});}else if(_0xac32f9[_0xafaa('0x32')]===_0xafaa('0x34')&&_0xac32f9[_0xafaa('0x35')]&&_0xac32f9[_0xafaa('0x33')]&&_0xac32f9[_0xafaa('0x2f')]){_0x324033[_0xac32f9[_0xafaa('0x35')]]&&_0x51c30f['custom_fields'][_0xafaa('0x36')]({'id':_0xac32f9[_0xafaa('0x33')],'value':_0x324033[_0xac32f9[_0xafaa('0x35')]][_0xafaa('0x30')]()});}else if(_0xac32f9[_0xafaa('0x32')]===_0xafaa('0x37')&&_0xac32f9[_0xafaa('0x38')]&&_0xac32f9[_0xafaa('0x38')][_0xafaa('0x10')]&&_0xac32f9['idField']&&_0xac32f9[_0xafaa('0x2f')]){_0x324033[_0xac32f9['Variable'][_0xafaa('0x10')][_0xafaa('0x39')]()]&&_0x51c30f[_0xafaa('0x12')][_0xafaa('0x36')]({'id':_0xac32f9[_0xafaa('0x33')],'value':_0x324033[_0xac32f9[_0xafaa('0x38')][_0xafaa('0x10')][_0xafaa('0x39')]()]['toString']()});}});}return _0x51c30f;}exports[_0xafaa('0x3a')]=function(_0x494017,_0x317f47,_0x1e0476,_0x19a1b8,_0xd1afa,_0x4dfae4){var _0x5c6a25,_0x36d8b9;_0x4dfae4['remoteUri']=intUtil[_0xafaa('0x3b')](_0x4dfae4[_0xafaa('0x14')]);_0x4dfae4['serverUrl']=intUtil['stripTrailingSlash'](_0x4dfae4['serverUrl']);if(_0xd1afa&&_0xd1afa[_0xafaa('0x3c')]){logger['info'](_0xafaa('0x3d'),'Recording\x20is\x20enabled!');_0x317f47[_0xafaa('0x3e')]=util[_0xafaa('0xb')](_0xafaa('0x3f'),_0x4dfae4[_0xafaa('0x40')],_0x317f47[_0xafaa('0x41')],md5(_0x317f47['uniqueid']));}else{_0x317f47['recordingURL']='';}headers[_0xafaa('0x42')]=getAuth(_0x4dfae4);return getUser(_0x4dfae4,_0x19a1b8[_0xafaa('0x1c')])[_0xafaa('0x16')](function(_0x2d9b14){_0x5c6a25=_0x2d9b14;logger['info'](_0xafaa('0x43'),_0x5c6a25['id']);return getEndUser(_0x4dfae4,_0x317f47[_0xafaa('0xc')],_0x317f47['calleridnum']);})['then'](function(_0x3b8696){_0x36d8b9=_0x3b8696;logger[_0xafaa('0x8')](_0xafaa('0x44'),_0x36d8b9['id']);return getTicket(_0x4dfae4,_0x5c6a25,_0x36d8b9,_0x1e0476,_0x317f47);})['then'](function(_0x56fa58){if(_0x56fa58&&_0x56fa58['id']){logger[_0xafaa('0x8')](_0xafaa('0x17'));logger[_0xafaa('0x8')](_0xafaa('0x45'),_0x56fa58['id']);logger[_0xafaa('0x8')]('[QUEUE]',_0xafaa('0x46'));emit(util[_0xafaa('0xb')](_0xafaa('0x47'),_0x19a1b8[_0xafaa('0x10')]),_0xafaa('0x48'),{'uri':util['format'](_0xafaa('0x49'),_0x4dfae4[_0xafaa('0x14')],_0x56fa58['id'])});}})['catch'](function(_0x2aee94){logger[_0xafaa('0x4a')]('[QUEUE]',JSON[_0xafaa('0x27')](_0x2aee94));});};exports[_0xafaa('0x4b')]=function(_0x21a816,_0x4a4201,_0x501ebd,_0x149397,_0x431737,_0x24dc0e,_0x16b821){var _0x4a277a,_0x321d51;_0x24dc0e[_0xafaa('0x14')]=intUtil[_0xafaa('0x3b')](_0x24dc0e['remoteUri']);_0x24dc0e[_0xafaa('0x40')]=intUtil['stripTrailingSlash'](_0x24dc0e[_0xafaa('0x40')]);if(_0x16b821&&_0x16b821[_0xafaa('0x4c')]&&_0x16b821['recordingFormat']!==_0xafaa('0x4d')){logger[_0xafaa('0x8')](_0xafaa('0x4e'),_0xafaa('0x4f'));_0x4a4201[_0xafaa('0x3e')]=util[_0xafaa('0xb')](_0xafaa('0x3f'),_0x24dc0e[_0xafaa('0x40')],_0x4a4201['uniqueid'],md5(_0x4a4201[_0xafaa('0x41')]));}headers[_0xafaa('0x42')]=getAuth(_0x24dc0e);return getUser(_0x24dc0e,_0x149397[_0xafaa('0x1c')])[_0xafaa('0x16')](function(_0x5c9be9){_0x4a277a=_0x5c9be9;logger[_0xafaa('0x8')]('The\x20User\x20ID\x20is:',_0x4a277a['id']);return getEndUser(_0x24dc0e,_0x4a4201['destcalleridname'],_0x4a4201['destcalleridnum']);})[_0xafaa('0x16')](function(_0x36714e){_0x321d51=_0x36714e;logger[_0xafaa('0x8')](_0xafaa('0x44'),_0x321d51['id']);return getTicket(_0x24dc0e,_0x4a277a,_0x321d51,_0x501ebd,_0x4a4201);})[_0xafaa('0x16')](function(_0x4c99bb){if(_0x4c99bb&&_0x4c99bb['id']){logger[_0xafaa('0x8')](_0xafaa('0x17'));logger[_0xafaa('0x8')]('The\x20Ticket\x20ID\x20is:',_0x4c99bb['id']);logger[_0xafaa('0x8')](_0xafaa('0x4e'),_0xafaa('0x46'));emit(util[_0xafaa('0xb')](_0xafaa('0x47'),_0x149397[_0xafaa('0x10')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x24dc0e[_0xafaa('0x14')],_0x4c99bb['id'])});}})[_0xafaa('0x50')](function(_0x516bce){logger[_0xafaa('0x4a')](_0xafaa('0x4e'),JSON[_0xafaa('0x27')](_0x516bce));});};exports[_0xafaa('0x51')]=function(_0x2099b6,_0x30293b,_0x13141a,_0x99ca5e,_0x3667a5,_0x1c62df){var _0xdf8c15,_0x4de75d;_0x1c62df[_0xafaa('0x14')]=intUtil[_0xafaa('0x3b')](_0x1c62df[_0xafaa('0x14')]);_0x1c62df[_0xafaa('0x40')]=intUtil['stripTrailingSlash'](_0x1c62df[_0xafaa('0x40')]);if(_0x3667a5&&_0x3667a5['monitor_format']){logger[_0xafaa('0x8')]('['+_0x30293b[_0xafaa('0x52')][_0xafaa('0x53')]()+']','Recording\x20is\x20enabled!');_0x30293b[_0xafaa('0x3e')]=util[_0xafaa('0xb')](_0xafaa('0x3f'),_0x1c62df[_0xafaa('0x40')],_0x30293b['uniqueid'],md5(_0x30293b[_0xafaa('0x41')]));}else{_0x30293b[_0xafaa('0x3e')]='';}headers['Authorization']=getAuth(_0x1c62df);return getUser(_0x1c62df,'')[_0xafaa('0x16')](function(_0x99e7ce){_0xdf8c15=_0x99e7ce;logger[_0xafaa('0x8')](_0xafaa('0x43'),_0xdf8c15['id']);return getEndUser(_0x1c62df,_0x30293b['calleridname'],_0x30293b['calleridnum']);})[_0xafaa('0x16')](function(_0x2123ab){_0x4de75d=_0x2123ab;logger[_0xafaa('0x8')](_0xafaa('0x44'),_0x4de75d['id']);return getTicket(_0x1c62df,_0xdf8c15,_0x4de75d,_0x13141a,_0x30293b);})['then'](function(_0x58e516){if(_0x58e516){logger[_0xafaa('0x8')](_0xafaa('0x17'));logger[_0xafaa('0x8')](_0xafaa('0x45'),_0x58e516['id']);}})[_0xafaa('0x50')](function(_0x126157){logger[_0xafaa('0x4a')]('['+_0x30293b[_0xafaa('0x52')][_0xafaa('0x53')]()+']',JSON[_0xafaa('0x27')](_0x126157));});}; \ 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 f047064..e122477 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 _0x84de=['Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','task','ticketId','/contacts/','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','inspect','lodash','request-promise','util','moment','bluebird','./util','../../../../config/environment','freshsales','redis','defaults','GET','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','/api/selector/owners','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','adminId','toUpperCase','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','contactNumber','mobile_number','endUserId'];(function(_0x162a08,_0x2ab5e9){var _0xde29c3=function(_0x3b03ef){while(--_0x3b03ef){_0x162a08['push'](_0x162a08['shift']());}};_0xde29c3(++_0x2ab5e9);}(_0x84de,0x16c));var _0xe84d=function(_0x1352f0,_0x4cd565){_0x1352f0=_0x1352f0-0x0;var _0x1c2a82=_0x84de[_0x1352f0];return _0x1c2a82;};'use strict';var _=require(_0xe84d('0x0'));var rp=require(_0xe84d('0x1'));var md5=require('md5');var util=require(_0xe84d('0x2'));var moment=require(_0xe84d('0x3'));var Promise=require(_0xe84d('0x4'));var Redis=require('ioredis');var intUtil=require(_0xe84d('0x5'));var config=require(_0xe84d('0x6'));var logger=require('../../../../config/logger')(_0xe84d('0x7'));config[_0xe84d('0x8')]=_[_0xe84d('0x9')](config[_0xe84d('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe84d('0x8')]));function getAdminId(_0x6c29d7,_0x19ea54,_0x3430b9,_0x45d1e2){return new Promise(function(_0x248d0b,_0x325caf){var _0x3aefde=![];var _0x204801={'method':_0xe84d('0xa'),'uri':_0x45d1e2+'/api/selector/owners','json':!![]};_0x204801[_0xe84d('0xb')]=_0x3430b9;logger[_0xe84d('0xc')](_0xe84d('0xd'));return rp(_0x204801)['then'](function(_0x352a2e){if(_0x352a2e){var _0x3c5a60=_0x352a2e[_0xe84d('0xe')];var _0x38d7ee=null;for(_0x38d7ee=0x0;_0x38d7ee<_0x3c5a60[_0xe84d('0xf')];_0x38d7ee++){if(_0x3c5a60[_0x38d7ee][_0xe84d('0x10')]===_0x6c29d7[_0xe84d('0x11')]){_0x6c29d7['adminId']=_0x3c5a60[_0x38d7ee]['id'];_0x3aefde=!![];}}if(_0x3aefde){logger[_0xe84d('0xc')](_0xe84d('0x12'),_0x6c29d7['adminId']);_0x248d0b(_0x6c29d7);}else{_0x325caf({'statusCode':0x194,'message':_0xe84d('0x13')});}}else{_0x325caf({'statusCode':0x194,'message':_0xe84d('0x13')});}})[_0xe84d('0x14')](function(_0x472806){logger[_0xe84d('0x15')]('['+[_0x19ea54['toUpperCase']()]+']',_0x472806['message']);_0x325caf(_0x472806);});});}function getUser(_0x392158,_0x40e443,_0x4ec058){return function(_0x4e9102){return new Promise(function(_0x70be3e,_0x2d210c){var _0x8b524={'method':_0xe84d('0xa'),'uri':_0x4ec058+_0xe84d('0x16'),'json':!![]};_0x8b524[_0xe84d('0xb')]=_0x40e443;logger[_0xe84d('0xc')](_0xe84d('0x17'));return rp(_0x8b524)[_0xe84d('0x18')](function(_0x448d4e){if(_0x448d4e){var _0x4d8cc5=_0x448d4e[_0xe84d('0xe')];var _0xefc2ad=![];var _0x18edaf=null;if(_0x4e9102[_0xe84d('0x19')]!==null){logger[_0xe84d('0xc')](_0xe84d('0x1a'),_0x4e9102[_0xe84d('0x19')]);_0x4e9102[_0xe84d('0x1b')]=_0x4e9102[_0xe84d('0x19')];for(_0x18edaf=0x0;_0x18edaf<_0x4d8cc5[_0xe84d('0xf')];_0x18edaf++){if(_0x4d8cc5[_0x18edaf][_0xe84d('0x10')]===_0x4e9102['agentEmail']){_0xefc2ad=!![];_0x4e9102['userId']=_0x4d8cc5[_0x18edaf]['id'];logger['info'](_0xe84d('0x1c'),_0x4e9102[_0xe84d('0x1d')]);}}}if(!_0xefc2ad){logger['info']('Admin\x20selected');_0x4e9102[_0xe84d('0x1b')]=_0x4e9102[_0xe84d('0x11')];_0x4e9102['userId']=_0x4e9102[_0xe84d('0x1e')];_0xefc2ad=!![];}if(_0xefc2ad){_0x70be3e(_0x4e9102);}else{_0x2d210c({'statusCode':0x194,'message':_0xe84d('0x13')});}}else{_0x2d210c({'statusCode':0x194,'message':_0xe84d('0x13')});}})[_0xe84d('0x14')](function(_0x3204af){logger[_0xe84d('0x15')]('['+[_0x392158[_0xe84d('0x1f')]()]+']',_0x3204af[_0xe84d('0x20')]);_0x2d210c(_0x3204af);});});};}function searchContact(_0x38887d,_0x3de4ea,_0xa4175,_0x50051c){return new Promise(function(_0x10074f,_0x5aea82){var _0x41ba77={'method':'GET','headers':_0x3de4ea,'uri':_0x38887d+_0xe84d('0x21')+_0x50051c+_0xe84d('0x22')+_0xa4175+_0xe84d('0x23'),'json':!![]};rp(_0x41ba77)['then'](function(_0x5248db){var _0x16b95b=_[_0xe84d('0x24')](_0x5248db['contacts'][_0xe84d('0x25')],[_0xa4175,_0x50051c]);_0x10074f(_0x16b95b);})[_0xe84d('0x14')](function(_0x4d7dc4){_0x5aea82(_0x4d7dc4);});});}function getEndUser(_0x495486,_0x446277,_0x111241){return function(_0xe10244){return new Promise(function(_0x39e13a,_0xa7b16c){logger[_0xe84d('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0xe10244[_0xe84d('0x26')]));searchContact(_0x111241,_0x446277,_0xe84d('0x27'),_0xe10244[_0xe84d('0x26')])['then'](function(_0x3c4511){if(_0x3c4511){_0xe10244[_0xe84d('0x28')]=_0x3c4511['id'];logger[_0xe84d('0xc')](_0xe84d('0x29'),_0xe10244[_0xe84d('0x28')]);return _0x39e13a(_0xe10244);}searchContact(_0x111241,_0x446277,_0xe84d('0x2a'),_0xe10244['contactNumber'])[_0xe84d('0x18')](function(_0x2dcb5a){if(_0x2dcb5a){_0xe10244[_0xe84d('0x28')]=_0x2dcb5a['id'];logger[_0xe84d('0xc')](_0xe84d('0x2b'),_0xe10244[_0xe84d('0x28')]);return _0x39e13a(_0xe10244);}createEndUser(_0xe10244,_0x495486,_0x446277,_0x111241)[_0xe84d('0x18')](function(_0x5ae5e4){logger[_0xe84d('0xc')](_0xe84d('0x2c'),_0x5ae5e4[_0xe84d('0x28')]);return _0x39e13a(_0x5ae5e4);});});})[_0xe84d('0x14')](function(_0x291b61){_0xa7b16c(_0x291b61);});});};}function createEndUser(_0x137bbc,_0x3cc86a,_0x100163,_0x3b342e){return new Promise(function(_0x2525bd,_0x41ef49){var _0x4b1460=moment();var _0x35dda9={'method':_0xe84d('0x2d'),'uri':_0x3b342e+_0xe84d('0x2e'),'body':{'contact':{'last_name':_0x137bbc[_0xe84d('0x26')],'work_number':_0x137bbc['contactNumber'],'mobile_number':_0x137bbc[_0xe84d('0x26')],'owner_id':_0x137bbc[_0xe84d('0x1d')],'created_at':_0x4b1460[_0xe84d('0x2f')](_0xe84d('0x30'))}},'json':!![]};_0x35dda9[_0xe84d('0xb')]=_0x100163;logger['info']('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x35dda9)[_0xe84d('0x18')](function(_0x522924){_0x137bbc[_0xe84d('0x28')]=_0x522924[_0xe84d('0x31')]['id'];_0x2525bd(_0x137bbc);})[_0xe84d('0x14')](function(_0x4ae1c9){logger[_0xe84d('0x15')]('['+[_0x3cc86a[_0xe84d('0x1f')]()]+']',_0x4ae1c9['message']);_0x41ef49(_0x4ae1c9[_0xe84d('0x20')]);});});}function getTicket(_0x4c7aec,_0x1359a1,_0x1c9661,_0x313a6b,_0xa4a1ce){return function(_0x575dbb){logger['info'](_0xe84d('0x32'));return new Promise(function(_0x2a3c11,_0x497c66){var _0x317cca=moment();var _0x5536a6={'method':_0xe84d('0x2d'),'uri':_0x1c9661+'/api/tasks','body':{'title':intUtil[_0xe84d('0x33')](_0x313a6b[_0xe84d('0x34')],_0xa4a1ce,'\x20'),'description':intUtil[_0xe84d('0x33')](_0x313a6b[_0xe84d('0x35')],_0xa4a1ce,'\x0a'),'owner_id':_0x575dbb[_0xe84d('0x1d')],'creater_id':_0x575dbb[_0xe84d('0x1e')],'targetable_id':_0x575dbb[_0xe84d('0x28')],'targetable_type':_0xe84d('0x36'),'created_at':_0x317cca[_0xe84d('0x2f')](_0xe84d('0x30')),'due_date':_0x317cca[_0xe84d('0x37')](0x1e,'m')['format'](_0xe84d('0x30'))},'json':!![]};_0x5536a6[_0xe84d('0xb')]=_0x1359a1;return rp(_0x5536a6)[_0xe84d('0x18')](function(_0x15a6e7){_0x575dbb['ticketId']=_0x15a6e7[_0xe84d('0x38')]['id'];logger['info']('Task\x20created:',_0x575dbb[_0xe84d('0x39')]);_0x2a3c11(_0x575dbb);})[_0xe84d('0x14')](function(_0x314f90){logger[_0xe84d('0x15')]('['+[_0x4c7aec[_0xe84d('0x1f')]()]+']',_0x314f90['message']);_0x497c66(_0x314f90[_0xe84d('0x20')]);});});};}function emit(_0x5d7713,_0x21d63e,_0x9ecff6){var _0x4a0196={'uri':_0x5d7713+_0xe84d('0x3a')+_0x9ecff6};io['to'](util['format'](_0xe84d('0x3b'),_0x21d63e))[_0xe84d('0x3c')]('trigger:browser:url',_0x4a0196);}exports['cs']=function(_0x528ca6,_0x2831d5,_0x3744c9,_0xc0434a,_0x2be297,_0x329bb3,_0xc85161,_0x2e8f5d){var _0x511cdf={};var _0x241f7e={'Authorization':'Token\x20token='+_0x329bb3[_0xe84d('0x3d')]};_0x329bb3[_0xe84d('0x3e')]=intUtil[_0xe84d('0x3f')](_0x329bb3['remoteUri']);_0x329bb3[_0xe84d('0x40')]=intUtil['stripTrailingSlash'](_0x329bb3[_0xe84d('0x40')]);var _0x5a822b=_0x329bb3[_0xe84d('0x3e')];_0x511cdf[_0xe84d('0x11')]=_0x329bb3[_0xe84d('0x41')];_0x511cdf['contactNumber']=_0x2e8f5d['toLowerCase']()===_0xe84d('0x42')?_0x2831d5[_0xe84d('0x43')]:_0x2831d5['calleridnum'];_0x511cdf[_0xe84d('0x44')]=_0x2e8f5d===_0xe84d('0x45')||_0x2e8f5d===_0xe84d('0x46')?_0xe84d('0x45'):_0xe84d('0x42');if(_0xc0434a){_0x511cdf[_0xe84d('0x19')]=_0xc0434a[_0xe84d('0x10')];}var _0x49808d=util[_0xe84d('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x329bb3[_0xe84d('0x40')],_0x2831d5[_0xe84d('0x47')],md5(_0x2831d5[_0xe84d('0x47')]));if(_0x2be297&&_0x2be297[_0xe84d('0x48')]){logger[_0xe84d('0xc')](_0xe84d('0x49'),_0xe84d('0x4a'));_0x2831d5[_0xe84d('0x4b')]=_0x49808d;}else if(_0xc85161&&_0xc85161[_0xe84d('0x4c')]&&_0xc85161[_0xe84d('0x4c')]!==_0xe84d('0x4d')){logger[_0xe84d('0xc')](_0xe84d('0x4e'),_0xe84d('0x4a'));_0x2831d5[_0xe84d('0x4b')]=_0x49808d;}else{_0x2831d5[_0xe84d('0x4b')]='';}return getAdminId(_0x511cdf,_0x2e8f5d,_0x241f7e,_0x5a822b)[_0xe84d('0x18')](getUser(_0x2e8f5d,_0x241f7e,_0x5a822b))[_0xe84d('0x18')](getEndUser(_0x2e8f5d,_0x241f7e,_0x5a822b))[_0xe84d('0x18')](getTicket(_0x2e8f5d,_0x241f7e,_0x5a822b,_0x3744c9,_0x2831d5))[_0xe84d('0x18')](function(_0x2d3660){logger[_0xe84d('0xc')](util[_0xe84d('0x2f')](_0xe84d('0x4f'),_0x2d3660['ticketId']));if(_0x2e8f5d!==_0xe84d('0x46')){logger['info']('['+[_0x2e8f5d['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x5a822b,_0xc0434a['name'],_0x2d3660[_0xe84d('0x28')]);}})[_0xe84d('0x14')](function(_0x3fee91){logger['error']('['+[_0x2e8f5d[_0xe84d('0x1f')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xe84d('0x50')](_0x3fee91,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x314d=['The\x20ticket\x20ID\x20is:\x20%s','unmanaged','inspect','lodash','request-promise','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminId','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','POST','Subjects','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','callDirection','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL'];(function(_0x3f17b5,_0x409b36){var _0x4f4a0d=function(_0x3d0f80){while(--_0x3d0f80){_0x3f17b5['push'](_0x3f17b5['shift']());}};_0x4f4a0d(++_0x409b36);}(_0x314d,0x18e));var _0xd314=function(_0x573a84,_0xab5706){_0x573a84=_0x573a84-0x0;var _0x3f78eb=_0x314d[_0x573a84];return _0x3f78eb;};'use strict';var _=require(_0xd314('0x0'));var rp=require(_0xd314('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0xd314('0x2'));var Promise=require(_0xd314('0x3'));var Redis=require(_0xd314('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd314('0x5'))(_0xd314('0x6'));config[_0xd314('0x7')]=_[_0xd314('0x8')](config[_0xd314('0x7')],{'host':_0xd314('0x9'),'port':0x18eb});var io=require(_0xd314('0xa'))(new Redis(config[_0xd314('0x7')]));function getAdminId(_0x2befaf,_0x20d58e,_0x182d5d,_0x4b2342){return new Promise(function(_0x4a654d,_0x44459a){var _0x4198f1=![];var _0x4c4892={'method':_0xd314('0xb'),'uri':_0x4b2342+_0xd314('0xc'),'json':!![]};_0x4c4892[_0xd314('0xd')]=_0x182d5d;logger[_0xd314('0xe')](_0xd314('0xf'));return rp(_0x4c4892)[_0xd314('0x10')](function(_0x293c0f){if(_0x293c0f){var _0x4147ae=_0x293c0f[_0xd314('0x11')];var _0x2bfa7d=null;for(_0x2bfa7d=0x0;_0x2bfa7d<_0x4147ae[_0xd314('0x12')];_0x2bfa7d++){if(_0x4147ae[_0x2bfa7d]['email']===_0x2befaf[_0xd314('0x13')]){_0x2befaf['adminId']=_0x4147ae[_0x2bfa7d]['id'];_0x4198f1=!![];}}if(_0x4198f1){logger['info'](_0xd314('0x14'),_0x2befaf['adminId']);_0x4a654d(_0x2befaf);}else{_0x44459a({'statusCode':0x194,'message':_0xd314('0x15')});}}else{_0x44459a({'statusCode':0x194,'message':_0xd314('0x15')});}})[_0xd314('0x16')](function(_0x2e3978){logger[_0xd314('0x17')]('['+[_0x20d58e['toUpperCase']()]+']',_0x2e3978[_0xd314('0x18')]);_0x44459a(_0x2e3978);});});}function getUser(_0x3ee252,_0x38f197,_0x3dc2b3){return function(_0x38c886){return new Promise(function(_0x237b32,_0x4017cd){var _0x278762={'method':_0xd314('0xb'),'uri':_0x3dc2b3+_0xd314('0xc'),'json':!![]};_0x278762[_0xd314('0xd')]=_0x38f197;logger[_0xd314('0xe')](_0xd314('0x19'));return rp(_0x278762)[_0xd314('0x10')](function(_0x2d5339){if(_0x2d5339){var _0x45af1d=_0x2d5339['users'];var _0x27bf4c=![];var _0x20e491=null;if(_0x38c886[_0xd314('0x1a')]!==null){logger[_0xd314('0xe')](_0xd314('0x1b'),_0x38c886['agentEmail']);_0x38c886[_0xd314('0x1c')]=_0x38c886[_0xd314('0x1a')];for(_0x20e491=0x0;_0x20e491<_0x45af1d[_0xd314('0x12')];_0x20e491++){if(_0x45af1d[_0x20e491]['email']===_0x38c886[_0xd314('0x1a')]){_0x27bf4c=!![];_0x38c886['userId']=_0x45af1d[_0x20e491]['id'];logger['info']('User\x20found:',_0x38c886[_0xd314('0x1d')]);}}}if(!_0x27bf4c){logger[_0xd314('0xe')](_0xd314('0x1e'));_0x38c886[_0xd314('0x1c')]=_0x38c886[_0xd314('0x13')];_0x38c886[_0xd314('0x1d')]=_0x38c886[_0xd314('0x1f')];_0x27bf4c=!![];}if(_0x27bf4c){_0x237b32(_0x38c886);}else{_0x4017cd({'statusCode':0x194,'message':_0xd314('0x15')});}}else{_0x4017cd({'statusCode':0x194,'message':_0xd314('0x15')});}})[_0xd314('0x16')](function(_0x19997c){logger[_0xd314('0x17')]('['+[_0x3ee252['toUpperCase']()]+']',_0x19997c[_0xd314('0x18')]);_0x4017cd(_0x19997c);});});};}function searchContact(_0x10dd32,_0x4cdc60,_0x5b2d0e,_0x2034ed){return new Promise(function(_0x41aaf2,_0x1435de){var _0x2340a6={'method':_0xd314('0xb'),'headers':_0x4cdc60,'uri':_0x10dd32+_0xd314('0x20')+_0x2034ed+_0xd314('0x21')+_0x5b2d0e+_0xd314('0x22'),'json':!![]};rp(_0x2340a6)[_0xd314('0x10')](function(_0x16ffed){var _0x1e338b=_[_0xd314('0x23')](_0x16ffed[_0xd314('0x24')][_0xd314('0x24')],[_0x5b2d0e,_0x2034ed]);_0x41aaf2(_0x1e338b);})['catch'](function(_0x40a32e){_0x1435de(_0x40a32e);});});}function getEndUser(_0xdea368,_0x38a02c,_0x250bed){return function(_0x2af52b){return new Promise(function(_0x3303d5,_0x14f36a){logger[_0xd314('0xe')](util['format'](_0xd314('0x25'),_0x2af52b['contactNumber']));searchContact(_0x250bed,_0x38a02c,'mobile_number',_0x2af52b[_0xd314('0x26')])[_0xd314('0x10')](function(_0x553a47){if(_0x553a47){_0x2af52b['endUserId']=_0x553a47['id'];logger[_0xd314('0xe')](_0xd314('0x27'),_0x2af52b[_0xd314('0x28')]);return _0x3303d5(_0x2af52b);}searchContact(_0x250bed,_0x38a02c,_0xd314('0x29'),_0x2af52b[_0xd314('0x26')])[_0xd314('0x10')](function(_0x251dc6){if(_0x251dc6){_0x2af52b['endUserId']=_0x251dc6['id'];logger[_0xd314('0xe')]('Contact\x20found\x20work_number:',_0x2af52b[_0xd314('0x28')]);return _0x3303d5(_0x2af52b);}createEndUser(_0x2af52b,_0xdea368,_0x38a02c,_0x250bed)[_0xd314('0x10')](function(_0x3d2b94){logger[_0xd314('0xe')](_0xd314('0x2a'),_0x3d2b94[_0xd314('0x28')]);return _0x3303d5(_0x3d2b94);});});})[_0xd314('0x16')](function(_0x22023b){_0x14f36a(_0x22023b);});});};}function createEndUser(_0x37ed0e,_0x103629,_0x1f9815,_0x2aa2b0){return new Promise(function(_0x2865d6,_0x22da5d){var _0x354447=moment();var _0x3661f2={'method':'POST','uri':_0x2aa2b0+'/api/contacts','body':{'contact':{'last_name':_0x37ed0e[_0xd314('0x26')],'work_number':_0x37ed0e[_0xd314('0x26')],'mobile_number':_0x37ed0e[_0xd314('0x26')],'owner_id':_0x37ed0e[_0xd314('0x1d')],'created_at':_0x354447[_0xd314('0x2b')](_0xd314('0x2c'))}},'json':!![]};_0x3661f2[_0xd314('0xd')]=_0x1f9815;logger[_0xd314('0xe')](_0xd314('0x2d'));return rp(_0x3661f2)[_0xd314('0x10')](function(_0xef6db0){_0x37ed0e[_0xd314('0x28')]=_0xef6db0[_0xd314('0x2e')]['id'];_0x2865d6(_0x37ed0e);})[_0xd314('0x16')](function(_0x17fbc8){logger[_0xd314('0x17')]('['+[_0x103629[_0xd314('0x2f')]()]+']',_0x17fbc8[_0xd314('0x18')]);_0x22da5d(_0x17fbc8['message']);});});}function getTicket(_0x3fe744,_0x5a60b6,_0x257b98,_0x2f381c,_0x2b3d16){return function(_0x2deebf){logger[_0xd314('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x391c63,_0x329f6b){var _0x1a27b4=moment();var _0x38ec5d={'method':_0xd314('0x30'),'uri':_0x257b98+'/api/tasks','body':{'title':intUtil['getString'](_0x2f381c[_0xd314('0x31')],_0x2b3d16,'\x20'),'description':intUtil[_0xd314('0x32')](_0x2f381c[_0xd314('0x33')],_0x2b3d16,'\x0a'),'owner_id':_0x2deebf['userId'],'creater_id':_0x2deebf[_0xd314('0x1f')],'targetable_id':_0x2deebf[_0xd314('0x28')],'targetable_type':_0xd314('0x34'),'created_at':_0x1a27b4[_0xd314('0x2b')](_0xd314('0x2c')),'due_date':_0x1a27b4[_0xd314('0x35')](0x1e,'m')[_0xd314('0x2b')](_0xd314('0x2c'))},'json':!![]};_0x38ec5d['headers']=_0x5a60b6;return rp(_0x38ec5d)[_0xd314('0x10')](function(_0x62dd95){_0x2deebf[_0xd314('0x36')]=_0x62dd95[_0xd314('0x37')]['id'];logger[_0xd314('0xe')]('Task\x20created:',_0x2deebf[_0xd314('0x36')]);_0x391c63(_0x2deebf);})[_0xd314('0x16')](function(_0x5a3d74){logger[_0xd314('0x17')]('['+[_0x3fe744[_0xd314('0x2f')]()]+']',_0x5a3d74[_0xd314('0x18')]);_0x329f6b(_0x5a3d74[_0xd314('0x18')]);});});};}function emit(_0x9e549a,_0x175519,_0x416fdd){var _0x46d5d4={'uri':_0x9e549a+_0xd314('0x38')+_0x416fdd};io['to'](util[_0xd314('0x2b')](_0xd314('0x39'),_0x175519))[_0xd314('0x3a')](_0xd314('0x3b'),_0x46d5d4);}exports['cs']=function(_0x2cde1c,_0x1e060a,_0x13dbed,_0x159069,_0x507ebf,_0x49118d,_0x4c4335,_0x4b69bb){var _0x3aa005={};var _0x32a63c={'Authorization':_0xd314('0x3c')+_0x49118d[_0xd314('0x3d')]};_0x49118d[_0xd314('0x3e')]=intUtil[_0xd314('0x3f')](_0x49118d['remoteUri']);_0x49118d['serverUrl']=intUtil[_0xd314('0x3f')](_0x49118d['serverUrl']);var _0x3d56b3=_0x49118d[_0xd314('0x3e')];_0x3aa005[_0xd314('0x13')]=_0x49118d[_0xd314('0x40')];_0x3aa005[_0xd314('0x26')]=_0x4b69bb[_0xd314('0x41')]()===_0xd314('0x42')?_0x1e060a[_0xd314('0x43')]:_0x1e060a['calleridnum'];_0x3aa005[_0xd314('0x44')]=_0x4b69bb==='queue'||_0x4b69bb==='unmanaged'?'queue':_0xd314('0x42');if(_0x159069){_0x3aa005[_0xd314('0x1a')]=_0x159069['email'];}var _0x2acd8e=util[_0xd314('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49118d[_0xd314('0x45')],_0x1e060a['uniqueid'],md5(_0x1e060a['uniqueid']));if(_0x507ebf&&_0x507ebf[_0xd314('0x46')]){logger[_0xd314('0xe')](_0xd314('0x47'),_0xd314('0x48'));_0x1e060a['recordingURL']=_0x2acd8e;}else if(_0x4c4335&&_0x4c4335[_0xd314('0x49')]&&_0x4c4335[_0xd314('0x49')]!=='none'){logger['info'](_0xd314('0x4a'),_0xd314('0x48'));_0x1e060a[_0xd314('0x4b')]=_0x2acd8e;}else{_0x1e060a[_0xd314('0x4b')]='';}return getAdminId(_0x3aa005,_0x4b69bb,_0x32a63c,_0x3d56b3)[_0xd314('0x10')](getUser(_0x4b69bb,_0x32a63c,_0x3d56b3))[_0xd314('0x10')](getEndUser(_0x4b69bb,_0x32a63c,_0x3d56b3))[_0xd314('0x10')](getTicket(_0x4b69bb,_0x32a63c,_0x3d56b3,_0x13dbed,_0x1e060a))[_0xd314('0x10')](function(_0x5dc826){logger[_0xd314('0xe')](util['format'](_0xd314('0x4c'),_0x5dc826[_0xd314('0x36')]));if(_0x4b69bb!==_0xd314('0x4d')){logger['info']('['+[_0x4b69bb[_0xd314('0x2f')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3d56b3,_0x159069['name'],_0x5dc826[_0xd314('0x28')]);}})['catch'](function(_0x865fb9){logger[_0xd314('0x17')]('['+[_0x4b69bb[_0xd314('0x2f')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xd314('0x4e')](_0x865fb9,{'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 676701f..d38fedf 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 _0x3d75=['routeId','outbound','unmanaged','zoho','servicenow','log','unknown\x20integration','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','Configurations','queue'];(function(_0x137cd7,_0x28f679){var _0x9ca7cd=function(_0x37bb60){while(--_0x37bb60){_0x137cd7['push'](_0x137cd7['shift']());}};_0x9ca7cd(++_0x28f679);}(_0x3d75,0x189));var _0x53d7=function(_0x454ccd,_0x1c0650){_0x454ccd=_0x454ccd-0x0;var _0x6131a6=_0x3d75[_0x454ccd];return _0x6131a6;};'use strict';var _=require('lodash');var util=require(_0x53d7('0x0'));var zendesk=require(_0x53d7('0x1'));var salesforce=require(_0x53d7('0x2'));var sugarcrm=require(_0x53d7('0x3'));var freshdesk=require(_0x53d7('0x4'));var zoho=require(_0x53d7('0x5'));var desk=require('./desk');var vtiger=require(_0x53d7('0x6'));var servicenow=require(_0x53d7('0x7'));var dynamics365=require(_0x53d7('0x8'));var freshsales=require('./freshsales');var integrations=[_0x53d7('0x9'),_0x53d7('0xa'),_0x53d7('0xb'),_0x53d7('0xc'),'zoho',_0x53d7('0xd'),_0x53d7('0xe'),_0x53d7('0xf'),_0x53d7('0x10'),'servicenow'];exports[_0x53d7('0x11')]=function(_0x1adf39,_0x46c8d4,_0x113bcb,_0x5a8e9c,_0x3e0da2,_0x44cc1c){if(_0x113bcb){if(_[_0x53d7('0x12')](integrations,_0x1adf39[_0x53d7('0x13')]['toLowerCase']())){try{var _0x48efd4=null;var _0x1f6260='';var _0x32dcb1=_0x113bcb[_0x1adf39[_0x53d7('0x13')][_0x53d7('0x14')]()];if(_0x32dcb1){var _0x5d1e65=_0x32dcb1[_0x1adf39[_0x53d7('0x15')]];if(_0x5d1e65){var _0x3a2ba3=_[_0x53d7('0x16')](_0x5d1e65[_0x53d7('0x17')],{'id':parseInt(_0x1adf39['data3'],0xa)});if(_0x3a2ba3){if(_0x5a8e9c){if(_0x3e0da2&&_0x46c8d4[_0x53d7('0x18')]){_0x1f6260=_0x53d7('0x18');}else if(_0x46c8d4[_0x53d7('0x19')]){_0x1f6260=_0x53d7('0x1a');}else{console['log']('EVENT\x20UNKNOWN',_0x46c8d4);}}else{_0x1f6260=_0x53d7('0x1b');}switch(_0x1adf39['data1'][_0x53d7('0x14')]()){case _0x53d7('0x9'):zendesk[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case'salesforce':salesforce[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case _0x53d7('0xb'):sugarcrm[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case'freshdesk':freshdesk[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case _0x53d7('0x1c'):zoho[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case _0x53d7('0xd'):desk[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case _0x53d7('0xe'):vtiger[_0x1f6260](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c);break;case _0x53d7('0x10'):freshsales['cs'](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c,_0x1f6260);break;case _0x53d7('0x1d'):servicenow['cs'](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c,_0x1f6260);break;case _0x53d7('0xf'):dynamics365['cs'](_0x1adf39,_0x46c8d4,_0x3a2ba3,_0x5a8e9c,_0x3e0da2,_0x5d1e65,_0x44cc1c,_0x1f6260);break;default:console[_0x53d7('0x1e')](_0x53d7('0x1f'));}}else{_0x48efd4=require('../../../../config/logger')(_0x1adf39[_0x53d7('0x13')][_0x53d7('0x14')]());_0x48efd4[_0x53d7('0x20')](_0x53d7('0x21'),util['format'](_0x53d7('0x22'),_0x1adf39[_0x53d7('0x13')][_0x53d7('0x14')](),_0x1adf39[_0x53d7('0x23')]));}}else{_0x48efd4=require(_0x53d7('0x24'))(_0x1adf39['data1'][_0x53d7('0x14')]());_0x48efd4[_0x53d7('0x20')](_0x53d7('0x21'),util['format'](_0x53d7('0x25'),_0x1adf39['data1'][_0x53d7('0x14')](),_0x1adf39[_0x53d7('0x15')]));}}else{}}catch(_0x478991){console[_0x53d7('0x20')](_0x478991);}}}}; \ No newline at end of file +var _0x7e1f=['unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./zoho','./desk','./vtiger','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','vtiger','servicenow','exec','includes','data1','toLowerCase','data2','find','data3','queue','outbound','log','unmanaged','zendesk','desk','dynamics365'];(function(_0x1ec73b,_0x3ed663){var _0x34c380=function(_0x10c828){while(--_0x10c828){_0x1ec73b['push'](_0x1ec73b['shift']());}};_0x34c380(++_0x3ed663);}(_0x7e1f,0x150));var _0xf7e1=function(_0x522dbf,_0x37abca){_0x522dbf=_0x522dbf-0x0;var _0x5d80d3=_0x7e1f[_0x522dbf];return _0x5d80d3;};'use strict';var _=require(_0xf7e1('0x0'));var util=require(_0xf7e1('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xf7e1('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0xf7e1('0x3'));var desk=require(_0xf7e1('0x4'));var vtiger=require(_0xf7e1('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xf7e1('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk',_0xf7e1('0x7'),_0xf7e1('0x8'),_0xf7e1('0x9'),_0xf7e1('0xa'),'desk',_0xf7e1('0xb'),'dynamics365','freshsales',_0xf7e1('0xc')];exports[_0xf7e1('0xd')]=function(_0x2a07c2,_0x4a3b40,_0x4fdf6f,_0x1b9b46,_0x424a92,_0xc2a0ee){if(_0x4fdf6f){if(_[_0xf7e1('0xe')](integrations,_0x2a07c2[_0xf7e1('0xf')][_0xf7e1('0x10')]())){try{var _0x11b077=null;var _0x22ac45='';var _0x7ea5ae=_0x4fdf6f[_0x2a07c2[_0xf7e1('0xf')][_0xf7e1('0x10')]()];if(_0x7ea5ae){var _0x1c189f=_0x7ea5ae[_0x2a07c2[_0xf7e1('0x11')]];if(_0x1c189f){var _0x134cf2=_[_0xf7e1('0x12')](_0x1c189f['Configurations'],{'id':parseInt(_0x2a07c2[_0xf7e1('0x13')],0xa)});if(_0x134cf2){if(_0x1b9b46){if(_0x424a92&&_0x4a3b40[_0xf7e1('0x14')]){_0x22ac45=_0xf7e1('0x14');}else if(_0x4a3b40['routeId']){_0x22ac45=_0xf7e1('0x15');}else{console[_0xf7e1('0x16')]('EVENT\x20UNKNOWN',_0x4a3b40);}}else{_0x22ac45=_0xf7e1('0x17');}switch(_0x2a07c2['data1'][_0xf7e1('0x10')]()){case _0xf7e1('0x18'):zendesk[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case _0xf7e1('0x7'):salesforce[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case _0xf7e1('0x8'):sugarcrm[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case _0xf7e1('0x9'):freshdesk[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case _0xf7e1('0xa'):zoho[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case _0xf7e1('0x19'):desk[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case'vtiger':vtiger[_0x22ac45](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee);break;case'freshsales':freshsales['cs'](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee,_0x22ac45);break;case _0xf7e1('0xc'):servicenow['cs'](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee,_0x22ac45);break;case _0xf7e1('0x1a'):dynamics365['cs'](_0x2a07c2,_0x4a3b40,_0x134cf2,_0x1b9b46,_0x424a92,_0x1c189f,_0xc2a0ee,_0x22ac45);break;default:console[_0xf7e1('0x16')](_0xf7e1('0x1b'));}}else{_0x11b077=require('../../../../config/logger')(_0x2a07c2['data1'][_0xf7e1('0x10')]());_0x11b077[_0xf7e1('0x1c')](_0xf7e1('0x1d'),util[_0xf7e1('0x1e')](_0xf7e1('0x1f'),_0x2a07c2[_0xf7e1('0xf')][_0xf7e1('0x10')](),_0x2a07c2[_0xf7e1('0x13')]));}}else{_0x11b077=require('../../../../config/logger')(_0x2a07c2[_0xf7e1('0xf')]['toLowerCase']());_0x11b077[_0xf7e1('0x1c')]('[EXEC]',util[_0xf7e1('0x1e')](_0xf7e1('0x20'),_0x2a07c2['data1']['toLowerCase'](),_0x2a07c2[_0xf7e1('0x11')]));}}else{}}catch(_0x51a0b9){console[_0xf7e1('0x1c')](_0x51a0b9);}}}}; \ 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 f6de964..ab77ffb 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 _0xe188=['then','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','additionalSearchAccount','Account','Contact','account','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','Name','upperFirst','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','toLowerCase','password','concat','Connection','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','salesforce','redis','defaults','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','endUserType','lead','WhoId','WhatId','contact','ContactId','leadId','info','create','isNil','validateEmail','sobject','find','execute'];(function(_0x19b9d1,_0x4f603f){var _0x1ca4f7=function(_0x2d1ea7){while(--_0x2d1ea7){_0x19b9d1['push'](_0x19b9d1['shift']());}};_0x1ca4f7(++_0x4f603f);}(_0xe188,0xd7));var _0x8e18=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xe188[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x8e18('0x0'));var rp=require(_0x8e18('0x1'));var moment=require('moment');var BPromise=require(_0x8e18('0x2'));var md5=require(_0x8e18('0x3'));var jsforce=require(_0x8e18('0x4'));var util=require(_0x8e18('0x5'));var Redis=require(_0x8e18('0x6'));var intUtil=require(_0x8e18('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x8e18('0x8'));config[_0x8e18('0x9')]=_[_0x8e18('0xa')](config[_0x8e18('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e18('0x9')]));function emit(_0x31eece,_0x5b6f01,_0x373d3b){io['to'](_0x31eece)['emit'](_0x5b6f01,_0x373d3b);}function getTicket(_0x2d1574,_0x4105c8,_0x1507f5,_0x191d58,_0xd609e,_0x435f06,_0x55bfef,_0x32e909){var _0x33fe1d=Object[_0x8e18('0xb')]({},{'OwnerId':_0x4105c8['id'],'Subject':intUtil['getString'](_0x191d58[_0x8e18('0xc')],_0xd609e,'\x20'),'Description':intUtil[_0x8e18('0xd')](_0x191d58[_0x8e18('0xe')],_0xd609e,'\x0a')},getCustomFields(_0x435f06,_0xd609e));if(_0x1507f5){if(_0x191d58[_0x8e18('0xf')]===_0x8e18('0x10')){_0x33fe1d[_0x8e18('0x11')]=moment['utc']();_0x33fe1d['IsReminderSet']=![];_0x33fe1d[_0x8e18('0x12')]=![];if(_0x1507f5[_0x8e18('0x13')]==='contact'||_0x1507f5[_0x8e18('0x13')]===_0x8e18('0x14')){_0x33fe1d[_0x8e18('0x15')]=_0x1507f5['id'];}else if(_0x1507f5[_0x8e18('0x13')]==='account'){_0x33fe1d[_0x8e18('0x16')]=_0x1507f5['id'];}}else if(_0x191d58['ticketType']==='Case'){if(_0x1507f5[_0x8e18('0x13')]===_0x8e18('0x17')){_0x33fe1d[_0x8e18('0x18')]=_0x1507f5['id'];}else if(_0x1507f5[_0x8e18('0x13')]==='account'){_0x33fe1d['AccountId']=_0x1507f5['id'];}else if(_0x1507f5[_0x8e18('0x13')]===_0x8e18('0x14')&&_0x191d58['leadId']){_0x33fe1d[_0x191d58[_0x8e18('0x19')]]=_0x1507f5['id'];}else{logger[_0x8e18('0x1a')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x55bfef['sobject'](_0x191d58[_0x8e18('0xf')])[_0x8e18('0x1b')](_0x33fe1d);}function getUser(_0x3b3ca0,_0x320d8e,_0xbfad43){if(!_[_0x8e18('0x1c')](_0x320d8e)&&intUtil[_0x8e18('0x1d')](_0x320d8e)){var _0x5d6854={'Email':_0x320d8e};var _0xdaf10f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xbfad43[_0x8e18('0x1e')]('User')[_0x8e18('0x1f')](_0x5d6854,_0xdaf10f)[_0x8e18('0x20')]()[_0x8e18('0x21')](function(_0x2459b8){if(_0x2459b8['length']){var _0x3976ac=_[_0x8e18('0x1f')](_0x2459b8,function(_0x398215){return _0x398215[_0x8e18('0x22')]===_0x320d8e;});if(_0x3976ac){logger[_0x8e18('0x1a')](_0x8e18('0x23'),_0x320d8e);return BPromise[_0x8e18('0x24')]({'id':_0x3976ac['Id'],'name':_0x3976ac['Name']});}}else{logger[_0x8e18('0x1a')](_0x8e18('0x25'),_0x320d8e);return _0xbfad43[_0x8e18('0x26')]()['then'](function(_0x35e934){return BPromise['resolve']({'id':_0x35e934[_0x8e18('0x27')],'name':_0x35e934[_0x8e18('0x28')]});});}});}else{logger[_0x8e18('0x1a')](_0x8e18('0x25'),_0x320d8e);return _0xbfad43['identity']()[_0x8e18('0x21')](function(_0x3e4655){return BPromise['resolve']({'id':_0x3e4655[_0x8e18('0x27')],'name':_0x3e4655[_0x8e18('0x28')]});});}}function getEndUser(_0x2c4ac5,_0x1773db,_0x21ab96,_0x5bfceb,_0x3f662a){var _0x5d3c46={'$or':{'Phone':_0x5bfceb}};var _0x5436fb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8e18('0x24')]()[_0x8e18('0x21')](function(){logger[_0x8e18('0x1a')](_0x8e18('0x29'),_0x5bfceb,_0x1773db['moduleSearch']);switch(_0x1773db[_0x8e18('0x2a')]){case _0x8e18('0x2b'):var _0x2887f7=_[_0x8e18('0x2c')](_0x5d3c46);if(_0x1773db['additionalSearchContact']){var _0x1fd3e9={};_0x1fd3e9[_0x1773db[_0x8e18('0x2d')]]=_0x5bfceb;_[_0x8e18('0x2e')](_0x2887f7[_0x8e18('0x2f')],_0x1fd3e9);}return _0x3f662a[_0x8e18('0x1e')]('Contact')[_0x8e18('0x1f')](_0x2887f7,_0x5436fb)[_0x8e18('0x20')]()[_0x8e18('0x21')](function(_0x48f11e){if(_0x48f11e&&_0x48f11e[_0x8e18('0x30')]){return _0x48f11e;}else{var _0x4a5b92=_['cloneDeep'](_0x5d3c46);if(_0x1773db[_0x8e18('0x31')]){var _0x576202={};_0x576202[_0x1773db[_0x8e18('0x31')]]=_0x5bfceb;_[_0x8e18('0x2e')](_0x4a5b92['$or'],_0x576202);}return _0x3f662a[_0x8e18('0x1e')](_0x8e18('0x32'))[_0x8e18('0x1f')](_0x4a5b92,_0x5436fb);}});case'account_contact_lead':var _0x287399=_[_0x8e18('0x2c')](_0x5d3c46);if(_0x1773db[_0x8e18('0x33')]){var _0x1fd3e9={};_0x1fd3e9[_0x1773db['additionalSearchAccount']]=_0x5bfceb;_[_0x8e18('0x2e')](_0x287399[_0x8e18('0x2f')],_0x1fd3e9);}return _0x3f662a['sobject'](_0x8e18('0x34'))[_0x8e18('0x1f')](_0x287399,_0x5436fb)[_0x8e18('0x20')]()[_0x8e18('0x21')](function(_0x4345dd){if(_0x4345dd&&_0x4345dd[_0x8e18('0x30')]){return _0x4345dd;}else{var _0x58bb66=_['cloneDeep'](_0x5d3c46);if(_0x1773db[_0x8e18('0x2d')]){var _0x9f537a={};_0x9f537a[_0x1773db['additionalSearchContact']]=_0x5bfceb;_['merge'](_0x58bb66['$or'],_0x9f537a);}return _0x3f662a['sobject'](_0x8e18('0x35'))[_0x8e18('0x1f')](_0x58bb66,_0x5436fb)[_0x8e18('0x21')](function(_0x260b76){if(_0x260b76&&_0x260b76[_0x8e18('0x30')]){return _0x260b76;}else{var _0x397d0b=_['cloneDeep'](_0x5d3c46);if(_0x1773db[_0x8e18('0x31')]){var _0x280bd4={};_0x280bd4[_0x1773db['additionalSearchLead']]=_0x5bfceb;_['merge'](_0x397d0b[_0x8e18('0x2f')],_0x280bd4);}return _0x3f662a[_0x8e18('0x1e')](_0x8e18('0x32'))['find'](_0x397d0b,_0x5436fb);}});}});case _0x8e18('0x17'):var _0x2887f7=_[_0x8e18('0x2c')](_0x5d3c46);if(_0x1773db['additionalSearchContact']){var _0x1fd3e9={};_0x1fd3e9[_0x1773db[_0x8e18('0x2d')]]=_0x5bfceb;_[_0x8e18('0x2e')](_0x2887f7['$or'],_0x1fd3e9);}return _0x3f662a[_0x8e18('0x1e')](_0x8e18('0x35'))[_0x8e18('0x1f')](_0x2887f7,_0x5436fb)[_0x8e18('0x20')]();case _0x8e18('0x14'):var _0x2c0d02=_['cloneDeep'](_0x5d3c46);if(_0x1773db[_0x8e18('0x31')]){var _0x1fd3e9={};_0x1fd3e9[_0x1773db[_0x8e18('0x31')]]=_0x5bfceb;_[_0x8e18('0x2e')](_0x2c0d02[_0x8e18('0x2f')],_0x1fd3e9);}return _0x3f662a['sobject']('Lead')[_0x8e18('0x1f')](_0x2c0d02,_0x5436fb);case _0x8e18('0x36'):var _0x287399=_['cloneDeep'](_0x5d3c46);if(_0x1773db[_0x8e18('0x33')]){var _0x1fd3e9={};_0x1fd3e9[_0x1773db[_0x8e18('0x33')]]=_0x5bfceb;_[_0x8e18('0x2e')](_0x287399[_0x8e18('0x2f')],_0x1fd3e9);}return _0x3f662a[_0x8e18('0x1e')]('Account')[_0x8e18('0x1f')](_0x287399,_0x5436fb);default:return null;}})[_0x8e18('0x21')](function(_0x11b1c0){if(_0x11b1c0&&_0x11b1c0[_0x8e18('0x30')]){var _0x29b4f8=_['first'](_0x11b1c0);if(_0x29b4f8){return BPromise[_0x8e18('0x24')]({'id':_0x29b4f8['Id'],'name':_0x29b4f8['Name'],'phone':_0x29b4f8[_0x8e18('0x37')],'endUserType':_0x29b4f8[_0x8e18('0x38')][_0x8e18('0x39')]['toLowerCase']()});}}})[_0x8e18('0x21')](function(_0x2c69be){if(_0x2c69be){logger['info'](_0x8e18('0x3a'),_0x2c69be[_0x8e18('0x13')],_0x5bfceb);return BPromise[_0x8e18('0x24')](_0x2c69be);}else{logger[_0x8e18('0x1a')](_0x8e18('0x3b'),_0x5bfceb);var _0x38e9bd={'Phone':_0x5bfceb};if(_0x1773db['moduleCreate']){if(_0x1773db[_0x8e18('0x3c')]===_0x8e18('0x17')){logger[_0x8e18('0x1a')](_0x8e18('0x3d'),_0x5bfceb,_0x1773db[_0x8e18('0x3c')]);_0x38e9bd['LastName']=_0x21ab96!==_0x8e18('0x3e')?_0x21ab96:util[_0x8e18('0x3f')](_0x8e18('0x40'),_0x5bfceb);}else if(_0x1773db[_0x8e18('0x3c')]===_0x8e18('0x14')){logger[_0x8e18('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5bfceb,_0x1773db[_0x8e18('0x3c')]);_0x38e9bd[_0x8e18('0x41')]=_0x21ab96!==_0x8e18('0x3e')?_0x21ab96:util[_0x8e18('0x3f')]('Caller\x20-\x20%s',_0x5bfceb);_0x38e9bd[_0x8e18('0x42')]=_0x8e18('0x43');}else if(_0x1773db[_0x8e18('0x3c')]===_0x8e18('0x36')){logger[_0x8e18('0x1a')](_0x8e18('0x3d'),_0x5bfceb,_0x1773db[_0x8e18('0x3c')]);_0x38e9bd[_0x8e18('0x44')]=_0x21ab96!==''?_0x21ab96:util['format'](_0x8e18('0x40'),_0x5bfceb);}else{return null;}}return _0x3f662a[_0x8e18('0x1e')](_[_0x8e18('0x45')](_0x1773db[_0x8e18('0x3c')]))[_0x8e18('0x1b')](_0x38e9bd)[_0x8e18('0x21')](function(_0x11d6e6){return BPromise[_0x8e18('0x24')]({'id':_0x11d6e6['id'],'endUserType':_0x1773db['moduleCreate']});});}});}function getCustomFields(_0x4d97ce,_0x2adfba){var _0x465f96={};if(_0x4d97ce['length']>0x0){_['forEach'](_0x4d97ce,function(_0x4ad7c){if(_[_0x8e18('0x46')]([_0x8e18('0x47'),_0x8e18('0x48')],_0x4ad7c['type'])&&_0x4ad7c[_0x8e18('0x49')]){_0x465f96[_0x4ad7c[_0x8e18('0x49')]]=_0x4ad7c[_0x8e18('0x4a')]['toString']();}else if(_0x4ad7c[_0x8e18('0x39')]===_0x8e18('0x4b')&&_0x4ad7c[_0x8e18('0x4c')]&&_0x4ad7c['idField']){_0x2adfba[_0x4ad7c[_0x8e18('0x4c')]]&&(_0x465f96[_0x4ad7c[_0x8e18('0x49')]]=_0x2adfba[_0x4ad7c['variableName']][_0x8e18('0x4d')]());}else if(_0x4ad7c[_0x8e18('0x39')]==='customVariable'&&_0x4ad7c[_0x8e18('0x4e')]&&_0x4ad7c['Variable'][_0x8e18('0x4f')]&&_0x4ad7c[_0x8e18('0x49')]){_0x2adfba[_0x4ad7c[_0x8e18('0x4e')]['name'][_0x8e18('0x50')]()]&&(_0x465f96[_0x4ad7c[_0x8e18('0x49')]]=_0x2adfba[_0x4ad7c['Variable'][_0x8e18('0x4f')]['toLowerCase']()]['toString']());}});}return _0x465f96;}function getConnection(_0x1f8d6e){var _0x351e74=_0x1f8d6e[_0x8e18('0x51')][_0x8e18('0x52')](_0x1f8d6e['securityToken']);var _0x4d5969=new jsforce[(_0x8e18('0x53'))]({'oauth2':{'loginUrl':_0x1f8d6e['remoteUri']||'https://login.salesforce.com','clientId':_0x1f8d6e[_0x8e18('0x54')],'clientSecret':_0x1f8d6e[_0x8e18('0x55')]}});return _0x4d5969[_0x8e18('0x56')](_0x1f8d6e[_0x8e18('0x57')],_0x351e74)['then'](function(){logger[_0x8e18('0x1a')](_0x8e18('0x58'));return _0x4d5969;});}exports['queue']=function(_0x7ccf1e,_0x470658,_0x208f0e,_0x642b0b,_0x5c8064,_0x2283c0){var _0x5948ce,_0x7609a4,_0x6c172c,_0x4fef19;_0x2283c0[_0x8e18('0x59')]=intUtil[_0x8e18('0x5a')](_0x2283c0[_0x8e18('0x59')]);_0x2283c0[_0x8e18('0x5b')]=intUtil[_0x8e18('0x5a')](_0x2283c0['remoteUri']);if(_0x5c8064&&_0x5c8064[_0x8e18('0x5c')]){logger[_0x8e18('0x1a')](_0x8e18('0x5d'),_0x8e18('0x5e'));_0x470658[_0x8e18('0x5f')]=util[_0x8e18('0x3f')](_0x8e18('0x60'),_0x2283c0[_0x8e18('0x59')],_0x470658['uniqueid'],md5(_0x470658['uniqueid']));}else{_0x470658['recordingURL']='';}return getConnection(_0x2283c0)['then'](function(_0x33dcf3){_0x4fef19=_0x33dcf3;return getUser(_0x2283c0,_0x642b0b[_0x8e18('0x61')],_0x4fef19);})[_0x8e18('0x21')](function(_0x3e6ee1){_0x5948ce=_0x3e6ee1;return getEndUser(_0x2283c0,_0x208f0e,_0x470658[_0x8e18('0x62')],_0x470658[_0x8e18('0x63')],_0x4fef19);})[_0x8e18('0x21')](function(_0x449b1d){_0x7609a4=_0x449b1d;return getTicket(_0x2283c0,_0x5948ce,_0x7609a4,_0x208f0e,_0x470658,_0x208f0e[_0x8e18('0x64')],_0x4fef19,_0x8e18('0x65'));})[_0x8e18('0x21')](function(_0x24eeb3){_0x6c172c=_0x24eeb3;logger[_0x8e18('0x1a')](_0x8e18('0x66'),_0x6c172c['id']);logger[_0x8e18('0x1a')](_0x8e18('0x67'),_0x6c172c['id'],_0x642b0b[_0x8e18('0x4f')],_0x2283c0[_0x8e18('0x39')]);switch(_0x2283c0[_0x8e18('0x39')]){case _0x8e18('0x68'):emit(util[_0x8e18('0x3f')](_0x8e18('0x69'),_0x642b0b[_0x8e18('0x4f')]),_0x8e18('0x6a'),{'recordId':_0x6c172c['id']});break;case _0x8e18('0x6b'):emit(util[_0x8e18('0x3f')](_0x8e18('0x69'),_0x642b0b['name']),_0x8e18('0x6c'),{'uri':util[_0x8e18('0x3f')](_0x8e18('0x6d'),_0x4fef19['instanceUrl'],_0x6c172c['id'])});break;default:logger[_0x8e18('0x6e')](_0x8e18('0x6f'));}})['catch'](function(_0x3f6662){logger['error'](_0x8e18('0x5d'),_0x3f6662);});};exports[_0x8e18('0x70')]=function(_0x2b745e,_0x40ca69,_0x227b3b,_0x4505f7,_0x29bf82,_0x4d462a,_0x43815a){var _0x219b6f,_0x137806,_0x40ae85,_0xdb5f77;_0x4d462a['serverUrl']=intUtil[_0x8e18('0x5a')](_0x4d462a[_0x8e18('0x59')]);_0x4d462a['remoteUri']=intUtil[_0x8e18('0x5a')](_0x4d462a[_0x8e18('0x5b')]);if(_0x43815a&&_0x43815a['recordingFormat']&&_0x43815a[_0x8e18('0x71')]!=='none'){logger['info'](_0x8e18('0x72'),_0x8e18('0x5e'));_0x40ca69['recordingURL']=util[_0x8e18('0x3f')](_0x8e18('0x60'),_0x4d462a['serverUrl'],_0x40ca69[_0x8e18('0x73')],md5(_0x40ca69[_0x8e18('0x73')]));}return getConnection(_0x4d462a)[_0x8e18('0x21')](function(_0x579fde){_0xdb5f77=_0x579fde;return getUser(_0x4d462a,_0x4505f7[_0x8e18('0x61')],_0xdb5f77);})[_0x8e18('0x21')](function(_0x388da9){_0x219b6f=_0x388da9;return getEndUser(_0x4d462a,_0x227b3b,_0x40ca69[_0x8e18('0x74')],_0x40ca69[_0x8e18('0x75')],_0xdb5f77);})[_0x8e18('0x21')](function(_0x271e81){_0x137806=_0x271e81;return getTicket(_0x4d462a,_0x219b6f,_0x137806,_0x227b3b,_0x40ca69,_0x227b3b[_0x8e18('0x64')],_0xdb5f77,'outbound');})[_0x8e18('0x21')](function(_0x5cdf40){_0x40ae85=_0x5cdf40;logger[_0x8e18('0x1a')](_0x8e18('0x76'),_0x40ae85['id']);logger[_0x8e18('0x1a')](_0x8e18('0x77'),_0x40ae85['id'],_0x4505f7[_0x8e18('0x4f')],_0x4d462a[_0x8e18('0x39')]);switch(_0x4d462a[_0x8e18('0x39')]){case _0x8e18('0x68'):emit(util['format'](_0x8e18('0x69'),_0x4505f7['name']),'trigger:salesforce:display',{'recordId':_0x40ae85['id']});break;case _0x8e18('0x6b'):emit(util['format'](_0x8e18('0x69'),_0x4505f7[_0x8e18('0x4f')]),_0x8e18('0x6c'),{'uri':util['format'](_0x8e18('0x6d'),_0xdb5f77['instanceUrl'],_0x40ae85['id'])});break;default:logger[_0x8e18('0x6e')](_0x8e18('0x72'),_0x8e18('0x78'));}})['catch'](function(_0x37cd96){logger[_0x8e18('0x6e')]('[OUTBOUND]',_0x37cd96);});};exports['unmanaged']=function(_0x45b391,_0x51c69c,_0x210907,_0x47e530,_0xfe6b33,_0x5e9828){var _0x2e5dde,_0x42a9ac,_0xf1177b,_0x538ed4;_0x5e9828['serverUrl']=intUtil[_0x8e18('0x5a')](_0x5e9828['serverUrl']);_0x5e9828[_0x8e18('0x5b')]=intUtil[_0x8e18('0x5a')](_0x5e9828[_0x8e18('0x5b')]);if(_0xfe6b33&&_0xfe6b33[_0x8e18('0x5c')]){logger[_0x8e18('0x1a')]('['+_0x51c69c[_0x8e18('0x79')][_0x8e18('0x7a')]()+']',_0x8e18('0x5e'));_0x51c69c['recordingURL']=util[_0x8e18('0x3f')](_0x8e18('0x60'),_0x5e9828[_0x8e18('0x59')],_0x51c69c[_0x8e18('0x73')],md5(_0x51c69c[_0x8e18('0x73')]));}else{_0x51c69c['recordingURL']='';}return getConnection(_0x5e9828)[_0x8e18('0x21')](function(_0x4d1c84){_0x538ed4=_0x4d1c84;if(!_[_0x8e18('0x1c')](_0x47e530)){return getUser(_0x5e9828,_0x47e530[_0x8e18('0x4f')],_0x538ed4);}else{return getUser(_0x5e9828,null,_0x538ed4);}})[_0x8e18('0x21')](function(_0x43f7dc){_0x2e5dde=_0x43f7dc;return getEndUser(_0x5e9828,_0x210907,_0x51c69c[_0x8e18('0x62')],_0x51c69c[_0x8e18('0x63')],_0x538ed4);})[_0x8e18('0x21')](function(_0x2728e5){_0x42a9ac=_0x2728e5;return getTicket(_0x5e9828,_0x2e5dde,_0x42a9ac,_0x210907,_0x51c69c,_0x210907[_0x8e18('0x64')],_0x538ed4);})['then'](function(_0x1ec3c5){_0xf1177b=_0x1ec3c5;logger['info']('['+_0x51c69c[_0x8e18('0x79')][_0x8e18('0x7a')]()+']\x20Ticket\x20%s\x20created.',_0xf1177b['id']);logger[_0x8e18('0x1a')]('['+_0x51c69c[_0x8e18('0x79')][_0x8e18('0x7a')]()+_0x8e18('0x7b'),_0x5e9828[_0x8e18('0x39')]);})['catch'](function(_0x1d1df2){logger['error']('['+_0x51c69c[_0x8e18('0x79')][_0x8e18('0x7a')]()+']',_0x1d1df2);});}; \ No newline at end of file +var _0xf6e1=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','uniqueid','recordingURL','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','user:%s','catch','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','md5','jsforce','util','./util','salesforce','redis','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','user_id'];(function(_0x342e1e,_0x2dbe35){var _0x19e093=function(_0x481872){while(--_0x481872){_0x342e1e['push'](_0x342e1e['shift']());}};_0x19e093(++_0x2dbe35);}(_0xf6e1,0x1cc));var _0x1f6e=function(_0x43377b,_0x119772){_0x43377b=_0x43377b-0x0;var _0x33b340=_0xf6e1[_0x43377b];return _0x33b340;};'use strict';var _=require(_0x1f6e('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f6e('0x1'));var md5=require(_0x1f6e('0x2'));var jsforce=require(_0x1f6e('0x3'));var util=require(_0x1f6e('0x4'));var Redis=require('ioredis');var intUtil=require(_0x1f6e('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1f6e('0x6'));config[_0x1f6e('0x7')]=_['defaults'](config[_0x1f6e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x1f6e('0x8'))(new Redis(config[_0x1f6e('0x7')]));function emit(_0x314f7e,_0x2b8da7,_0x44879a){io['to'](_0x314f7e)[_0x1f6e('0x9')](_0x2b8da7,_0x44879a);}function getTicket(_0x261ca2,_0x4046d7,_0x5043b0,_0xebc269,_0x4e4dba,_0x5f1585,_0x4bc64d,_0x128862){var _0x276468=Object[_0x1f6e('0xa')]({},{'OwnerId':_0x4046d7['id'],'Subject':intUtil[_0x1f6e('0xb')](_0xebc269[_0x1f6e('0xc')],_0x4e4dba,'\x20'),'Description':intUtil[_0x1f6e('0xb')](_0xebc269[_0x1f6e('0xd')],_0x4e4dba,'\x0a')},getCustomFields(_0x5f1585,_0x4e4dba));if(_0x5043b0){if(_0xebc269['ticketType']===_0x1f6e('0xe')){_0x276468[_0x1f6e('0xf')]=moment[_0x1f6e('0x10')]();_0x276468[_0x1f6e('0x11')]=![];_0x276468[_0x1f6e('0x12')]=![];if(_0x5043b0[_0x1f6e('0x13')]===_0x1f6e('0x14')||_0x5043b0[_0x1f6e('0x13')]===_0x1f6e('0x15')){_0x276468[_0x1f6e('0x16')]=_0x5043b0['id'];}else if(_0x5043b0[_0x1f6e('0x13')]===_0x1f6e('0x17')){_0x276468[_0x1f6e('0x18')]=_0x5043b0['id'];}}else if(_0xebc269['ticketType']===_0x1f6e('0x19')){if(_0x5043b0[_0x1f6e('0x13')]===_0x1f6e('0x14')){_0x276468[_0x1f6e('0x1a')]=_0x5043b0['id'];}else if(_0x5043b0[_0x1f6e('0x13')]==='account'){_0x276468[_0x1f6e('0x1b')]=_0x5043b0['id'];}else if(_0x5043b0['endUserType']==='lead'&&_0xebc269[_0x1f6e('0x1c')]){_0x276468[_0xebc269['leadId']]=_0x5043b0['id'];}else{logger[_0x1f6e('0x1d')](_0x1f6e('0x1e'));}}}return _0x4bc64d['sobject'](_0xebc269['ticketType'])[_0x1f6e('0x1f')](_0x276468);}function getUser(_0x26d688,_0xc1e5a,_0x366c7f){if(!_[_0x1f6e('0x20')](_0xc1e5a)&&intUtil[_0x1f6e('0x21')](_0xc1e5a)){var _0x9119c={'Email':_0xc1e5a};var _0x5a29a5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x366c7f[_0x1f6e('0x22')](_0x1f6e('0x23'))[_0x1f6e('0x24')](_0x9119c,_0x5a29a5)[_0x1f6e('0x25')]()[_0x1f6e('0x26')](function(_0x42f60c){if(_0x42f60c['length']){var _0x1843ee=_[_0x1f6e('0x24')](_0x42f60c,function(_0x47c4c8){return _0x47c4c8[_0x1f6e('0x27')]===_0xc1e5a;});if(_0x1843ee){logger['info'](_0x1f6e('0x28'),_0xc1e5a);return BPromise[_0x1f6e('0x29')]({'id':_0x1843ee['Id'],'name':_0x1843ee[_0x1f6e('0x2a')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xc1e5a);return _0x366c7f['identity']()[_0x1f6e('0x26')](function(_0xce222){return BPromise[_0x1f6e('0x29')]({'id':_0xce222[_0x1f6e('0x2b')],'name':_0xce222['display_name']});});}});}else{logger[_0x1f6e('0x1d')](_0x1f6e('0x2c'),_0xc1e5a);return _0x366c7f[_0x1f6e('0x2d')]()[_0x1f6e('0x26')](function(_0x1576f8){return BPromise[_0x1f6e('0x29')]({'id':_0x1576f8[_0x1f6e('0x2b')],'name':_0x1576f8[_0x1f6e('0x2e')]});});}}function getEndUser(_0x38dacb,_0x23460d,_0x40f323,_0xc11401,_0x474789){var _0x30e5b2={'$or':{'Phone':_0xc11401}};var _0x1f6379={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1f6e('0x29')]()[_0x1f6e('0x26')](function(){logger['info'](_0x1f6e('0x2f'),_0xc11401,_0x23460d['moduleSearch']);switch(_0x23460d[_0x1f6e('0x30')]){case _0x1f6e('0x31'):var _0x26f65a=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d[_0x1f6e('0x33')]){var _0x34a29b={};_0x34a29b[_0x23460d[_0x1f6e('0x33')]]=_0xc11401;_[_0x1f6e('0x34')](_0x26f65a[_0x1f6e('0x35')],_0x34a29b);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x36'))[_0x1f6e('0x24')](_0x26f65a,_0x1f6379)['execute']()[_0x1f6e('0x26')](function(_0x4ee5fc){if(_0x4ee5fc&&_0x4ee5fc[_0x1f6e('0x37')]){return _0x4ee5fc;}else{var _0x38baaa=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d[_0x1f6e('0x38')]){var _0x69972e={};_0x69972e[_0x23460d[_0x1f6e('0x38')]]=_0xc11401;_[_0x1f6e('0x34')](_0x38baaa[_0x1f6e('0x35')],_0x69972e);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x39'))[_0x1f6e('0x24')](_0x38baaa,_0x1f6379);}});case'account_contact_lead':var _0x4eb593=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d['additionalSearchAccount']){var _0x34a29b={};_0x34a29b[_0x23460d[_0x1f6e('0x3a')]]=_0xc11401;_['merge'](_0x4eb593[_0x1f6e('0x35')],_0x34a29b);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x3b'))[_0x1f6e('0x24')](_0x4eb593,_0x1f6379)[_0x1f6e('0x25')]()[_0x1f6e('0x26')](function(_0x407230){if(_0x407230&&_0x407230[_0x1f6e('0x37')]){return _0x407230;}else{var _0x2813ce=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d[_0x1f6e('0x33')]){var _0x41ad70={};_0x41ad70[_0x23460d[_0x1f6e('0x33')]]=_0xc11401;_[_0x1f6e('0x34')](_0x2813ce[_0x1f6e('0x35')],_0x41ad70);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x36'))[_0x1f6e('0x24')](_0x2813ce,_0x1f6379)['then'](function(_0x15f8d7){if(_0x15f8d7&&_0x15f8d7[_0x1f6e('0x37')]){return _0x15f8d7;}else{var _0x123580=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d['additionalSearchLead']){var _0x4ea278={};_0x4ea278[_0x23460d[_0x1f6e('0x38')]]=_0xc11401;_[_0x1f6e('0x34')](_0x123580[_0x1f6e('0x35')],_0x4ea278);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x39'))[_0x1f6e('0x24')](_0x123580,_0x1f6379);}});}});case _0x1f6e('0x14'):var _0x26f65a=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d[_0x1f6e('0x33')]){var _0x34a29b={};_0x34a29b[_0x23460d['additionalSearchContact']]=_0xc11401;_[_0x1f6e('0x34')](_0x26f65a['$or'],_0x34a29b);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x36'))[_0x1f6e('0x24')](_0x26f65a,_0x1f6379)[_0x1f6e('0x25')]();case _0x1f6e('0x15'):var _0x24a82c=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d['additionalSearchLead']){var _0x34a29b={};_0x34a29b[_0x23460d['additionalSearchLead']]=_0xc11401;_[_0x1f6e('0x34')](_0x24a82c[_0x1f6e('0x35')],_0x34a29b);}return _0x474789['sobject']('Lead')[_0x1f6e('0x24')](_0x24a82c,_0x1f6379);case _0x1f6e('0x17'):var _0x4eb593=_[_0x1f6e('0x32')](_0x30e5b2);if(_0x23460d[_0x1f6e('0x3a')]){var _0x34a29b={};_0x34a29b[_0x23460d[_0x1f6e('0x3a')]]=_0xc11401;_[_0x1f6e('0x34')](_0x4eb593[_0x1f6e('0x35')],_0x34a29b);}return _0x474789[_0x1f6e('0x22')](_0x1f6e('0x3b'))[_0x1f6e('0x24')](_0x4eb593,_0x1f6379);default:return null;}})[_0x1f6e('0x26')](function(_0x49d533){if(_0x49d533&&_0x49d533[_0x1f6e('0x37')]){var _0x441269=_[_0x1f6e('0x3c')](_0x49d533);if(_0x441269){return BPromise[_0x1f6e('0x29')]({'id':_0x441269['Id'],'name':_0x441269[_0x1f6e('0x2a')],'phone':_0x441269[_0x1f6e('0x3d')],'endUserType':_0x441269['attributes']['type'][_0x1f6e('0x3e')]()});}}})[_0x1f6e('0x26')](function(_0x4534f7){if(_0x4534f7){logger[_0x1f6e('0x1d')](_0x1f6e('0x3f'),_0x4534f7[_0x1f6e('0x13')],_0xc11401);return BPromise[_0x1f6e('0x29')](_0x4534f7);}else{logger[_0x1f6e('0x1d')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0xc11401);var _0x354ccc={'Phone':_0xc11401};if(_0x23460d[_0x1f6e('0x40')]){if(_0x23460d['moduleCreate']===_0x1f6e('0x14')){logger['info'](_0x1f6e('0x41'),_0xc11401,_0x23460d['moduleCreate']);_0x354ccc[_0x1f6e('0x42')]=_0x40f323!==_0x1f6e('0x43')?_0x40f323:util[_0x1f6e('0x44')]('Caller\x20-\x20%s',_0xc11401);}else if(_0x23460d[_0x1f6e('0x40')]===_0x1f6e('0x15')){logger[_0x1f6e('0x1d')](_0x1f6e('0x41'),_0xc11401,_0x23460d['moduleCreate']);_0x354ccc[_0x1f6e('0x42')]=_0x40f323!==_0x1f6e('0x43')?_0x40f323:util[_0x1f6e('0x44')](_0x1f6e('0x45'),_0xc11401);_0x354ccc['Company']='No\x20Company';}else if(_0x23460d[_0x1f6e('0x40')]===_0x1f6e('0x17')){logger[_0x1f6e('0x1d')](_0x1f6e('0x41'),_0xc11401,_0x23460d[_0x1f6e('0x40')]);_0x354ccc['Name']=_0x40f323!==''?_0x40f323:util[_0x1f6e('0x44')](_0x1f6e('0x45'),_0xc11401);}else{return null;}}return _0x474789['sobject'](_['upperFirst'](_0x23460d[_0x1f6e('0x40')]))['create'](_0x354ccc)[_0x1f6e('0x26')](function(_0x5b991){return BPromise[_0x1f6e('0x29')]({'id':_0x5b991['id'],'endUserType':_0x23460d[_0x1f6e('0x40')]});});}});}function getCustomFields(_0xc14981,_0xb1363e){var _0x4bda41={};if(_0xc14981[_0x1f6e('0x37')]>0x0){_[_0x1f6e('0x46')](_0xc14981,function(_0xfada55){if(_[_0x1f6e('0x47')]([_0x1f6e('0x48'),_0x1f6e('0x49')],_0xfada55[_0x1f6e('0x4a')])&&_0xfada55['idField']){_0x4bda41[_0xfada55[_0x1f6e('0x4b')]]=_0xfada55['content'][_0x1f6e('0x4c')]();}else if(_0xfada55['type']===_0x1f6e('0x4d')&&_0xfada55[_0x1f6e('0x4e')]&&_0xfada55['idField']){_0xb1363e[_0xfada55[_0x1f6e('0x4e')]]&&(_0x4bda41[_0xfada55[_0x1f6e('0x4b')]]=_0xb1363e[_0xfada55['variableName']][_0x1f6e('0x4c')]());}else if(_0xfada55[_0x1f6e('0x4a')]===_0x1f6e('0x4f')&&_0xfada55[_0x1f6e('0x50')]&&_0xfada55[_0x1f6e('0x50')]['name']&&_0xfada55['idField']){_0xb1363e[_0xfada55[_0x1f6e('0x50')][_0x1f6e('0x51')][_0x1f6e('0x3e')]()]&&(_0x4bda41[_0xfada55[_0x1f6e('0x4b')]]=_0xb1363e[_0xfada55[_0x1f6e('0x50')][_0x1f6e('0x51')]['toLowerCase']()][_0x1f6e('0x4c')]());}});}return _0x4bda41;}function getConnection(_0x2292aa){var _0x3e2f7e=_0x2292aa[_0x1f6e('0x52')][_0x1f6e('0x53')](_0x2292aa[_0x1f6e('0x54')]);var _0x26eac5=new jsforce[(_0x1f6e('0x55'))]({'oauth2':{'loginUrl':_0x2292aa['remoteUri']||_0x1f6e('0x56'),'clientId':_0x2292aa[_0x1f6e('0x57')],'clientSecret':_0x2292aa['clientSecret']}});return _0x26eac5[_0x1f6e('0x58')](_0x2292aa[_0x1f6e('0x59')],_0x3e2f7e)['then'](function(){logger[_0x1f6e('0x1d')](_0x1f6e('0x5a'));return _0x26eac5;});}exports[_0x1f6e('0x5b')]=function(_0x52c5e5,_0x3c007b,_0x3cffc6,_0x5e9f17,_0x523e8e,_0x4ca438){var _0x3d96c6,_0x569bca,_0x3a1beb,_0xca7924;_0x4ca438[_0x1f6e('0x5c')]=intUtil[_0x1f6e('0x5d')](_0x4ca438[_0x1f6e('0x5c')]);_0x4ca438[_0x1f6e('0x5e')]=intUtil[_0x1f6e('0x5d')](_0x4ca438['remoteUri']);if(_0x523e8e&&_0x523e8e[_0x1f6e('0x5f')]){logger[_0x1f6e('0x1d')](_0x1f6e('0x60'),'Recording\x20is\x20enabled!');_0x3c007b['recordingURL']=util[_0x1f6e('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ca438[_0x1f6e('0x5c')],_0x3c007b[_0x1f6e('0x61')],md5(_0x3c007b['uniqueid']));}else{_0x3c007b[_0x1f6e('0x62')]='';}return getConnection(_0x4ca438)['then'](function(_0x180cfa){_0xca7924=_0x180cfa;return getUser(_0x4ca438,_0x5e9f17['email'],_0xca7924);})[_0x1f6e('0x26')](function(_0x340256){_0x3d96c6=_0x340256;return getEndUser(_0x4ca438,_0x3cffc6,_0x3c007b['calleridname'],_0x3c007b[_0x1f6e('0x63')],_0xca7924);})[_0x1f6e('0x26')](function(_0x49fb53){_0x569bca=_0x49fb53;return getTicket(_0x4ca438,_0x3d96c6,_0x569bca,_0x3cffc6,_0x3c007b,_0x3cffc6[_0x1f6e('0x64')],_0xca7924,_0x1f6e('0x5b'));})['then'](function(_0xc4663e){_0x3a1beb=_0xc4663e;logger[_0x1f6e('0x1d')](_0x1f6e('0x65'),_0x3a1beb['id']);logger[_0x1f6e('0x1d')](_0x1f6e('0x66'),_0x3a1beb['id'],_0x5e9f17['name'],_0x4ca438[_0x1f6e('0x4a')]);switch(_0x4ca438['type']){case _0x1f6e('0x67'):emit(util['format']('user:%s',_0x5e9f17[_0x1f6e('0x51')]),_0x1f6e('0x68'),{'recordId':_0x3a1beb['id']});break;case _0x1f6e('0x69'):emit(util[_0x1f6e('0x44')]('user:%s',_0x5e9f17[_0x1f6e('0x51')]),_0x1f6e('0x6a'),{'uri':util[_0x1f6e('0x44')](_0x1f6e('0x6b'),_0xca7924[_0x1f6e('0x6c')],_0x3a1beb['id'])});break;default:logger[_0x1f6e('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x368766){logger[_0x1f6e('0x6d')](_0x1f6e('0x60'),_0x368766);});};exports[_0x1f6e('0x6e')]=function(_0x22e8ad,_0x3ed5f4,_0x39d71d,_0x40f7f0,_0x1e9eec,_0x368977,_0x2c144d){var _0xc90880,_0x383826,_0x35d802,_0x124cd3;_0x368977[_0x1f6e('0x5c')]=intUtil[_0x1f6e('0x5d')](_0x368977[_0x1f6e('0x5c')]);_0x368977[_0x1f6e('0x5e')]=intUtil[_0x1f6e('0x5d')](_0x368977[_0x1f6e('0x5e')]);if(_0x2c144d&&_0x2c144d[_0x1f6e('0x6f')]&&_0x2c144d[_0x1f6e('0x6f')]!==_0x1f6e('0x70')){logger[_0x1f6e('0x1d')](_0x1f6e('0x71'),_0x1f6e('0x72'));_0x3ed5f4[_0x1f6e('0x62')]=util[_0x1f6e('0x44')](_0x1f6e('0x73'),_0x368977[_0x1f6e('0x5c')],_0x3ed5f4[_0x1f6e('0x61')],md5(_0x3ed5f4[_0x1f6e('0x61')]));}return getConnection(_0x368977)[_0x1f6e('0x26')](function(_0x457774){_0x124cd3=_0x457774;return getUser(_0x368977,_0x40f7f0[_0x1f6e('0x74')],_0x124cd3);})[_0x1f6e('0x26')](function(_0x5e72b2){_0xc90880=_0x5e72b2;return getEndUser(_0x368977,_0x39d71d,_0x3ed5f4[_0x1f6e('0x75')],_0x3ed5f4['destcalleridnum'],_0x124cd3);})[_0x1f6e('0x26')](function(_0x52a395){_0x383826=_0x52a395;return getTicket(_0x368977,_0xc90880,_0x383826,_0x39d71d,_0x3ed5f4,_0x39d71d[_0x1f6e('0x64')],_0x124cd3,'outbound');})[_0x1f6e('0x26')](function(_0x487d34){_0x35d802=_0x487d34;logger['info'](_0x1f6e('0x76'),_0x35d802['id']);logger[_0x1f6e('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x35d802['id'],_0x40f7f0[_0x1f6e('0x51')],_0x368977[_0x1f6e('0x4a')]);switch(_0x368977[_0x1f6e('0x4a')]){case _0x1f6e('0x67'):emit(util[_0x1f6e('0x44')](_0x1f6e('0x77'),_0x40f7f0[_0x1f6e('0x51')]),_0x1f6e('0x68'),{'recordId':_0x35d802['id']});break;case _0x1f6e('0x69'):emit(util[_0x1f6e('0x44')](_0x1f6e('0x77'),_0x40f7f0[_0x1f6e('0x51')]),_0x1f6e('0x6a'),{'uri':util[_0x1f6e('0x44')](_0x1f6e('0x6b'),_0x124cd3[_0x1f6e('0x6c')],_0x35d802['id'])});break;default:logger[_0x1f6e('0x6d')](_0x1f6e('0x71'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x1f6e('0x78')](function(_0x5844ac){logger[_0x1f6e('0x6d')]('[OUTBOUND]',_0x5844ac);});};exports[_0x1f6e('0x79')]=function(_0x48fba9,_0x4dc655,_0xebbc96,_0x1860ac,_0x154b28,_0x13a824){var _0x11e8cc,_0x486a62,_0x2aa633,_0x45c176;_0x13a824['serverUrl']=intUtil[_0x1f6e('0x5d')](_0x13a824[_0x1f6e('0x5c')]);_0x13a824['remoteUri']=intUtil[_0x1f6e('0x5d')](_0x13a824[_0x1f6e('0x5e')]);if(_0x154b28&&_0x154b28[_0x1f6e('0x5f')]){logger['info']('['+_0x4dc655[_0x1f6e('0x7a')][_0x1f6e('0x7b')]()+']','Recording\x20is\x20enabled!');_0x4dc655[_0x1f6e('0x62')]=util['format'](_0x1f6e('0x73'),_0x13a824['serverUrl'],_0x4dc655[_0x1f6e('0x61')],md5(_0x4dc655['uniqueid']));}else{_0x4dc655[_0x1f6e('0x62')]='';}return getConnection(_0x13a824)['then'](function(_0x480230){_0x45c176=_0x480230;if(!_[_0x1f6e('0x20')](_0x1860ac)){return getUser(_0x13a824,_0x1860ac[_0x1f6e('0x51')],_0x45c176);}else{return getUser(_0x13a824,null,_0x45c176);}})[_0x1f6e('0x26')](function(_0x5a5d71){_0x11e8cc=_0x5a5d71;return getEndUser(_0x13a824,_0xebbc96,_0x4dc655['calleridname'],_0x4dc655[_0x1f6e('0x63')],_0x45c176);})[_0x1f6e('0x26')](function(_0x314e4d){_0x486a62=_0x314e4d;return getTicket(_0x13a824,_0x11e8cc,_0x486a62,_0xebbc96,_0x4dc655,_0xebbc96['Fields'],_0x45c176);})['then'](function(_0x5a34e7){_0x2aa633=_0x5a34e7;logger[_0x1f6e('0x1d')]('['+_0x4dc655[_0x1f6e('0x7a')][_0x1f6e('0x7b')]()+_0x1f6e('0x7c'),_0x2aa633['id']);logger['info']('['+_0x4dc655[_0x1f6e('0x7a')][_0x1f6e('0x7b')]()+_0x1f6e('0x7d'),_0x13a824['type']);})['catch'](function(_0x4397f6){logger[_0x1f6e('0x6d')]('['+_0x4dc655[_0x1f6e('0x7a')][_0x1f6e('0x7b')]()+']',_0x4397f6);});}; \ 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 f475aeb..ef4ba4a 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 _0x1f29=['redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','customField','idField','variableName','customVariable','Variable','name','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','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','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','isNil','email','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults'];(function(_0x509ad5,_0x3ba144){var _0x4f2215=function(_0x5c32ae){while(--_0x5c32ae){_0x509ad5['push'](_0x509ad5['shift']());}};_0x4f2215(++_0x3ba144);}(_0x1f29,0xdd));var _0x91f2=function(_0x26eb20,_0x48f785){_0x26eb20=_0x26eb20-0x0;var _0x14e682=_0x1f29[_0x26eb20];return _0x14e682;};'use strict';var _=require(_0x91f2('0x0'));var Promise=require(_0x91f2('0x1'));var rp=require(_0x91f2('0x2'));var util=require(_0x91f2('0x3'));var md5=require(_0x91f2('0x4'));var Redis=require(_0x91f2('0x5'));var intUtil=require(_0x91f2('0x6'));var config=require(_0x91f2('0x7'));var logger=require(_0x91f2('0x8'))(_0x91f2('0x9'));config['redis']=_[_0x91f2('0xa')](config[_0x91f2('0xb')],{'host':_0x91f2('0xc'),'port':0x18eb});var io=require(_0x91f2('0xd'))(new Redis(config[_0x91f2('0xb')]));function getAdminUser(_0x580ebb,_0x4a5b87,_0x316199,_0x4b6bb3,_0x1dd0f0,_0x58f682){return new Promise(function(_0x54f844,_0x345038){var _0x8fbbaf={'method':_0x91f2('0xe'),'uri':_0x4b6bb3+_0x91f2('0xf')+'&'+_0x1dd0f0+'&'+_0x58f682,'auth':_0x4a5b87,'json':!![]};return rp(_0x8fbbaf)[_0x91f2('0x10')](function(_0x32aa02){if(_0x32aa02[_0x91f2('0x11')]['length']>0x0){_0x316199[_0x91f2('0x12')]=_0x32aa02[_0x91f2('0x11')][0x0][_0x91f2('0x13')];}logger[_0x91f2('0x14')]('['+[_0x580ebb[_0x91f2('0x15')]()]+_0x91f2('0x16'),_0x316199);_0x54f844(_0x316199);})[_0x91f2('0x17')](function(_0x4029be){logger[_0x91f2('0x18')]('['+[_0x580ebb['toUpperCase']()]+']',_0x4029be['message']);_0x345038(_0x4029be[_0x91f2('0x19')]);});});}function getUser(_0x5a5c92,_0x3f44f4,_0x49c039,_0x515c2a,_0x522a46){return function(_0xda84c7){logger[_0x91f2('0x14')]('['+[_0x5a5c92['toUpperCase']()]+_0x91f2('0x1a'),_0xda84c7);return new Promise(function(_0x3f2eb8,_0x25e8a9){if(intUtil['validateEmail'](_0xda84c7[_0x91f2('0x1b')])){var _0x7fdd08={'method':'GET','uri':_0x49c039+_0x91f2('0x1c')+_0xda84c7['userEmail']+'&'+_0x515c2a+'&'+_0x522a46,'auth':_0x3f44f4,'json':!![]};logger[_0x91f2('0x14')]('['+[_0x5a5c92[_0x91f2('0x15')]()]+_0x91f2('0x1d'),_0x7fdd08);return rp(_0x7fdd08)[_0x91f2('0x10')](function(_0x9e9d5e){logger[_0x91f2('0x14')]('['+[_0x5a5c92['toUpperCase']()]+_0x91f2('0x1e'),_0x9e9d5e);if(_0x9e9d5e[_0x91f2('0x11')][_0x91f2('0x1f')]>0x0&&String(_0x9e9d5e[_0x91f2('0x11')][0x0]['active'])==='true'){_0xda84c7['userId']=_0x9e9d5e[_0x91f2('0x11')][0x0]['sys_id'];}else{_0xda84c7[_0x91f2('0x20')]=_0xda84c7[_0x91f2('0x12')];_0xda84c7[_0x91f2('0x1b')]=_0xda84c7[_0x91f2('0x21')];}logger[_0x91f2('0x14')]('['+[_0x5a5c92['toUpperCase']()]+_0x91f2('0x22'),_0xda84c7);_0x3f2eb8(_0xda84c7);})['catch'](function(_0x367df3){logger[_0x91f2('0x18')]('['+[_0x5a5c92[_0x91f2('0x15')]()]+']',_0x367df3[_0x91f2('0x19')]);_0x25e8a9(_0x367df3[_0x91f2('0x19')]);});}else{logger[_0x91f2('0x14')]('['+[_0x5a5c92['toUpperCase']()]+_0x91f2('0x23'));_0xda84c7['userId']=_0xda84c7[_0x91f2('0x12')];_0xda84c7[_0x91f2('0x1b')]=_0xda84c7[_0x91f2('0x21')];_0x3f2eb8(_0xda84c7);}});};}function createEndUser(_0x26e5a6,_0x68cabd,_0xc260d6,_0x13eabc,_0x3718c4){logger[_0x91f2('0x14')]('['+[_0x26e5a6[_0x91f2('0x15')]()]+_0x91f2('0x24'),_0xc260d6);return new Promise(function(_0x4cbbce,_0x3bb75a){var _0x2f3866={'method':_0x91f2('0x25'),'uri':_0x13eabc+_0x91f2('0x26')+_0x3718c4,'body':{'user_name':_0xc260d6['endUserNumber'],'roles':'user','first_name':_0xc260d6[_0x91f2('0x27')],'active':_0x91f2('0x28'),'date_format':_0x91f2('0x29'),'phone':_0xc260d6[_0x91f2('0x27')]},'auth':_0x68cabd,'json':!![]};return rp(_0x2f3866)[_0x91f2('0x10')](function(_0x220b24){logger[_0x91f2('0x14')]('['+[_0x26e5a6[_0x91f2('0x15')]()]+'],\x20EndUser\x20schema',_0x220b24[_0x91f2('0x11')]);_0xc260d6[_0x91f2('0x2a')]=_0x220b24[_0x91f2('0x11')]['sys_id'];_0x4cbbce(_0xc260d6);})[_0x91f2('0x17')](function(_0x2c5482){logger['error']('['+[_0x26e5a6['toUpperCase']()]+']',_0x2c5482[_0x91f2('0x19')]);_0x3bb75a(_0x2c5482['message']);});});}function getEndUser(_0x1a2e2a,_0x419c4d,_0x41d7e6,_0x5239eb,_0x4ece27){return function(_0x23c664){logger[_0x91f2('0x14')]('['+[_0x1a2e2a[_0x91f2('0x15')]()]+_0x91f2('0x2b'),_0x23c664);return new Promise(function(_0x3b0d3d,_0x54e471){var _0x1b4bf6={'method':_0x91f2('0xe'),'uri':_0x41d7e6+_0x91f2('0x2c')+_0x23c664[_0x91f2('0x27')]+'&'+_0x5239eb+'&'+_0x4ece27,'auth':_0x419c4d,'json':!![]};return rp(_0x1b4bf6)[_0x91f2('0x10')](function(_0x40e446){if(_0x40e446[_0x91f2('0x11')][_0x91f2('0x1f')]>0x0){_0x23c664[_0x91f2('0x2a')]=_0x40e446['result'][0x0][_0x91f2('0x13')];logger[_0x91f2('0x14')]('['+[_0x1a2e2a[_0x91f2('0x15')]()]+_0x91f2('0x2d'),_0x23c664);_0x3b0d3d(_0x23c664);}else{return createEndUser(_0x1a2e2a,_0x419c4d,_0x23c664,_0x41d7e6,_0x5239eb)[_0x91f2('0x10')](function(_0x360581){logger[_0x91f2('0x14')]('['+[_0x1a2e2a[_0x91f2('0x15')]()]+_0x91f2('0x2e'),_0x360581);_0x3b0d3d(_0x360581);});}})[_0x91f2('0x17')](function(_0x365e1e){logger[_0x91f2('0x18')]('['+[_0x1a2e2a['toUpperCase']()]+']',_0x365e1e[_0x91f2('0x19')]);_0x54e471(_0x365e1e[_0x91f2('0x19')]);});});};}function getCustomFields(_0x4a6735,_0xa69c3b){var _0x8038f6={};if(_0x4a6735[_0x91f2('0x1f')]>0x0){_[_0x91f2('0x2f')](_0x4a6735,function(_0x4e343a){if(_[_0x91f2('0x30')]([_0x91f2('0x31'),_0x91f2('0x32')],_0x4e343a[_0x91f2('0x33')])&&_0x4e343a[_0x91f2('0x34')]&&!_0x4e343a['customField']){_0x8038f6[_0x4e343a['nameField'][_0x91f2('0x35')]()]=_0x4e343a[_0x91f2('0x36')][_0x91f2('0x37')]();}else if(_[_0x91f2('0x30')]([_0x91f2('0x31'),_0x91f2('0x32')],_0x4e343a[_0x91f2('0x33')])&&_0x4e343a['idField']&&_0x4e343a[_0x91f2('0x38')]){_0x8038f6[_0x4e343a[_0x91f2('0x39')][_0x91f2('0x35')]()]=_0x4e343a['content']['toString']();}else if(_0x4e343a[_0x91f2('0x33')]==='variable'&&_0x4e343a[_0x91f2('0x3a')]&&_0x4e343a['idField']&&_0x4e343a[_0x91f2('0x38')]){_0x8038f6[_0x4e343a['idField'][_0x91f2('0x35')]()]=_0xa69c3b[_0x4e343a[_0x91f2('0x3a')]]['toString']();}else if(_0x4e343a[_0x91f2('0x33')]===_0x91f2('0x3b')&&_0x4e343a[_0x91f2('0x3c')]&&_0x4e343a[_0x91f2('0x3c')]['name']&&_0x4e343a[_0x91f2('0x39')]&&_0x4e343a['customField']){_0x8038f6[_0x4e343a[_0x91f2('0x39')]['toLowerCase']()]=_0xa69c3b[_0x4e343a[_0x91f2('0x3c')][_0x91f2('0x3d')][_0x91f2('0x35')]()][_0x91f2('0x37')]();}});}return _0x8038f6;}function getTicket(_0x38a915,_0x44fe0a,_0x31eb66,_0x218c8d,_0x2ced0f,_0x12bbe7){return function(_0x37023e){logger['info']('['+[_0x38a915[_0x91f2('0x15')]()]+']\x20getTicket\x20input\x20crm',_0x37023e);return new Promise(function(_0x4db7d4,_0x1a7a73){var _0x508d66=_0x38a915[_0x91f2('0x35')]()==='outbound'?_0x37023e[_0x91f2('0x20')]:_0x37023e[_0x91f2('0x2a')];var _0x459f68={'method':_0x91f2('0x25'),'uri':_0x31eb66+_0x91f2('0x3e')+'?'+_0x12bbe7,'body':Object[_0x91f2('0x3f')]({},{'active':'true','caller_id':_0x508d66,'assigned_to':_0x37023e['userId'],'short_description':intUtil['getString'](_0x218c8d[_0x91f2('0x40')],_0x2ced0f,'\x20'),'description':intUtil['getString'](_0x218c8d[_0x91f2('0x41')],_0x2ced0f,'\x0a')},getCustomFields(_0x218c8d[_0x91f2('0x42')],_0x2ced0f)),'auth':_0x44fe0a,'json':!![]};return rp(_0x459f68)[_0x91f2('0x10')](function(_0x3cb1d9){logger[_0x91f2('0x14')]('['+[_0x38a915[_0x91f2('0x15')]()]+_0x91f2('0x43'),_0x3cb1d9[_0x91f2('0x11')]);_0x37023e[_0x91f2('0x44')]=_0x3cb1d9['result'][_0x91f2('0x13')];_0x37023e[_0x91f2('0x45')]=_0x3cb1d9[_0x91f2('0x11')][_0x91f2('0x46')];logger['info']('['+[_0x38a915[_0x91f2('0x15')]()]+_0x91f2('0x47'),_0x37023e);_0x4db7d4(_0x37023e);})[_0x91f2('0x17')](function(_0x30d230){logger[_0x91f2('0x18')]('['+[_0x38a915[_0x91f2('0x15')]()]+']',_0x30d230[_0x91f2('0x19')]);_0x1a7a73(_0x30d230[_0x91f2('0x19')]);});});};}function createRemoteTag(_0x1311be,_0x290d45,_0x2b67fa,_0xda938b){return new Promise(function(_0x383e7b,_0x265eac){var _0x32a102={'method':_0x91f2('0x25'),'uri':_0x2b67fa+_0x91f2('0x48')+'?'+_0xda938b,'body':{'short_description':_0x1311be,'global':!![],'active':!![],'name':_0x1311be},'auth':_0x290d45,'json':!![]};return rp(_0x32a102)[_0x91f2('0x10')](function(_0x56d4e1){var _0x5d5f62=_0x56d4e1[_0x91f2('0x11')][_0x91f2('0x13')];_0x383e7b(_0x5d5f62);});});}function getRemoteTag(_0x48b269,_0x4a69a2,_0x2366a9,_0x5cee8b,_0x2cf68e){return new Promise(function(_0x2fba48,_0x5dcdf6){var _0xaced56={'method':_0x91f2('0xe'),'uri':_0x2366a9+'label'+_0x91f2('0x49')+_0x48b269+'&'+_0x5cee8b,'auth':_0x4a69a2,'json':!![]};return rp(_0xaced56)[_0x91f2('0x10')](function(_0x396b42){if(_0x396b42[_0x91f2('0x11')][_0x91f2('0x1f')]>0x0){var _0x265634=_0x396b42['result'][0x0][_0x91f2('0x13')];_0x2fba48(_0x265634);}else{return createRemoteTag(_0x48b269,_0x4a69a2,_0x2366a9,_0x5cee8b)[_0x91f2('0x10')](function(_0x42b51e){_0x2fba48(_0x42b51e);});}});});}function assignTagToIncident(_0x44ada4,_0x23c6d8,_0x1c0cf3,_0x1fa86c,_0x52b277){return new Promise(function(_0x4a8888,_0x1a595e){var _0x193589={'method':'POST','uri':_0x1c0cf3+_0x91f2('0x4a')+'?'+_0x52b277,'body':{'label':_0x44ada4,'table':_0x91f2('0x3e'),'id_type':_0x91f2('0x4b'),'table_key':_0x1fa86c['ticketId'],'title':_0x91f2('0x4c')+_0x1fa86c[_0x91f2('0x45')],'id_display':_0x1fa86c[_0x91f2('0x45')]},'auth':_0x23c6d8,'json':!![]};return rp(_0x193589)[_0x91f2('0x10')](function(_0x4b569b){_0x4a8888();})[_0x91f2('0x17')](function(){_0x4a8888();});});}function manageTags(_0x402dc3,_0x3e8e29,_0x3325d6,_0x1eea58,_0x54b981,_0x4910f6,_0x2881e9){return new Promise(function(_0x30e657,_0x42253b){var _0x1abf31=[];_0x3e8e29[_0x91f2('0x2f')](function(_0x465d86){_0x1abf31['push'](getRemoteTag(_0x465d86,_0x3325d6,_0x1eea58,_0x4910f6,_0x2881e9));});return Promise[_0x91f2('0x4d')](_0x1abf31)[_0x91f2('0x10')](function(_0x93b2aa){if(_0x93b2aa[_0x91f2('0x1f')]){logger[_0x91f2('0x14')]('['+[_0x402dc3[_0x91f2('0x15')]()]+_0x91f2('0x4e'),_0x93b2aa);var _0x393627=[];_0x93b2aa[_0x91f2('0x2f')](function(_0x13fa02){_0x393627['push'](assignTagToIncident(_0x13fa02,_0x3325d6,_0x1eea58,_0x54b981,_0x4910f6));});return Promise[_0x91f2('0x4d')](_0x393627)[_0x91f2('0x10')](function(){_0x30e657();})[_0x91f2('0x17')](function(){_0x30e657();});}else{_0x30e657();}});});}function getTags(_0x5599d7,_0x452f5e,_0x414419,_0x4877d5,_0x4153d0,_0x299b5c){return function(_0x586387){return new Promise(function(_0x4b5e3a,_0x3a8ee9){var _0x16afc9=[];var _0x4138f3=_0x4877d5[_0x91f2('0x4f')];if(_0x4138f3&&_0x4138f3[_0x91f2('0x1f')]>0x0){_0x16afc9=_[_0x91f2('0x50')](_0x4138f3,'name');}if(_0x16afc9[_0x91f2('0x1f')]>0x0){return manageTags(_0x5599d7,_0x16afc9,_0x452f5e,_0x414419,_0x586387,_0x4153d0,_0x299b5c)[_0x91f2('0x10')](function(){_0x4b5e3a(_0x586387);});}else{_0x4b5e3a(_0x586387);}});};}function emit(_0x48c77e,_0x4bf808,_0x526109){var _0x400dd2=_0x91f2('0x51')+_0x91f2('0x52')+_0x91f2('0x53')+_0x91f2('0x54');var _0x4f5cbd={'uri':_0x48c77e+_0x91f2('0x55')+_0x526109+_0x400dd2};io['to'](util[_0x91f2('0x56')](_0x91f2('0x57'),_0x4bf808))[_0x91f2('0x58')](_0x91f2('0x59'),_0x4f5cbd);}exports['cs']=function(_0x2dbc1a,_0x3b4657,_0x4a4cac,_0x2d52e3,_0x565a74,_0x5ebbca,_0xb97f51,_0x5935de){var _0x4c6b3e={};var _0x5cd644={'user':_0x5ebbca['username'],'pass':_0x5ebbca['password']};var _0x32b032=_0x91f2('0x5a');var _0x22e30e=_0x91f2('0x5b');_0x5ebbca[_0x91f2('0x5c')]=intUtil['stripTrailingSlash'](_0x5ebbca['remoteUri']);_0x5ebbca[_0x91f2('0x5d')]=intUtil[_0x91f2('0x5e')](_0x5ebbca[_0x91f2('0x5d')]);var _0x4146bc=util['format']('%s/api/now/table/',_0x5ebbca[_0x91f2('0x5c')]);_0x4c6b3e[_0x91f2('0x1b')]=!_[_0x91f2('0x5f')](_0x2d52e3)?_0x2d52e3[_0x91f2('0x60')]:null;_0x4c6b3e[_0x91f2('0x21')]=_0x5ebbca[_0x91f2('0x60')];_0x4c6b3e[_0x91f2('0x27')]=_0x5935de[_0x91f2('0x35')]()===_0x91f2('0x61')?_0x3b4657[_0x91f2('0x62')]:_0x3b4657[_0x91f2('0x63')];_0x4c6b3e['callDirection']=_0x5935de===_0x91f2('0x64')||_0x5935de==='unmanaged'?_0x91f2('0x64'):_0x91f2('0x61');var _0x2673db=util[_0x91f2('0x56')](_0x91f2('0x65'),_0x5ebbca[_0x91f2('0x5d')],_0x3b4657[_0x91f2('0x66')],md5(_0x3b4657[_0x91f2('0x66')]));if(_0x565a74&&_0x565a74[_0x91f2('0x67')]){logger[_0x91f2('0x14')](_0x91f2('0x68'),'Recording\x20is\x20enabled!');_0x3b4657[_0x91f2('0x69')]=_0x2673db;}else if(_0xb97f51&&_0xb97f51[_0x91f2('0x6a')]&&_0xb97f51[_0x91f2('0x6a')]!==_0x91f2('0x6b')){logger[_0x91f2('0x14')](_0x91f2('0x6c'),_0x91f2('0x6d'));_0x3b4657[_0x91f2('0x69')]=_0x2673db;}else{_0x3b4657['recordingURL']='';}return getAdminUser(_0x5935de,_0x5cd644,_0x4c6b3e,_0x4146bc,_0x22e30e,_0x32b032)[_0x91f2('0x10')](getUser(_0x5935de,_0x5cd644,_0x4146bc,_0x22e30e,_0x32b032))[_0x91f2('0x10')](getEndUser(_0x5935de,_0x5cd644,_0x4146bc,_0x22e30e,_0x32b032))[_0x91f2('0x10')](getTicket(_0x5935de,_0x5cd644,_0x4146bc,_0x4a4cac,_0x3b4657,_0x22e30e))[_0x91f2('0x10')](function(_0x1bffca){logger[_0x91f2('0x14')](util[_0x91f2('0x56')](_0x91f2('0x6e'),_0x1bffca[_0x91f2('0x44')]));logger[_0x91f2('0x14')](util[_0x91f2('0x56')](_0x91f2('0x6f'),_0x5935de));if(_0x5935de!==_0x91f2('0x70')){logger['info']('['+[_0x5935de[_0x91f2('0x15')]()]+']',_0x91f2('0x71'));emit(_0x5ebbca['remoteUri'],_0x2d52e3['name'],_0x1bffca['ticketId']);}})[_0x91f2('0x17')](function(_0x36d6d5){logger[_0x91f2('0x18')]('['+[_0x5935de[_0x91f2('0x15')]()]+_0x91f2('0x72'),util[_0x91f2('0x73')](_0x36d6d5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8e67=['outbound','assign','Subjects','Descriptions','Fields','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','true','userId',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','endUserNumber','],\x20createEndUser\x20crm','forEach','includes','string','type','customField','nameField','toLowerCase','toString','picklist','idField','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x8e67,0xa1));var _0x78e6=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8e67[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var Promise=require(_0x78e6('0x0'));var rp=require(_0x78e6('0x1'));var util=require('util');var md5=require(_0x78e6('0x2'));var Redis=require('ioredis');var intUtil=require(_0x78e6('0x3'));var config=require(_0x78e6('0x4'));var logger=require(_0x78e6('0x5'))('servicenow');config[_0x78e6('0x6')]=_['defaults'](config[_0x78e6('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x78e6('0x7'))(new Redis(config[_0x78e6('0x6')]));function getAdminUser(_0x5735a8,_0x176993,_0x2f82af,_0x83a7ff,_0xf1f16c,_0x38ed15){return new Promise(function(_0x3c6525,_0x1244c1){var _0x353183={'method':_0x78e6('0x8'),'uri':_0x83a7ff+_0x78e6('0x9')+'&'+_0xf1f16c+'&'+_0x38ed15,'auth':_0x176993,'json':!![]};return rp(_0x353183)[_0x78e6('0xa')](function(_0x662682){if(_0x662682[_0x78e6('0xb')][_0x78e6('0xc')]>0x0){_0x2f82af[_0x78e6('0xd')]=_0x662682[_0x78e6('0xb')][0x0][_0x78e6('0xe')];}logger[_0x78e6('0xf')]('['+[_0x5735a8['toUpperCase']()]+_0x78e6('0x10'),_0x2f82af);_0x3c6525(_0x2f82af);})[_0x78e6('0x11')](function(_0x4d5e20){logger[_0x78e6('0x12')]('['+[_0x5735a8[_0x78e6('0x13')]()]+']',_0x4d5e20[_0x78e6('0x14')]);_0x1244c1(_0x4d5e20[_0x78e6('0x14')]);});});}function getUser(_0x3c54e3,_0xcbda09,_0x5279d6,_0x1262f0,_0x3cd226){return function(_0x43a781){logger[_0x78e6('0xf')]('['+[_0x3c54e3[_0x78e6('0x13')]()]+_0x78e6('0x15'),_0x43a781);return new Promise(function(_0x26492d,_0x322727){if(intUtil[_0x78e6('0x16')](_0x43a781['userEmail'])){var _0x59dbac={'method':_0x78e6('0x8'),'uri':_0x5279d6+_0x78e6('0x17')+_0x43a781[_0x78e6('0x18')]+'&'+_0x1262f0+'&'+_0x3cd226,'auth':_0xcbda09,'json':!![]};logger[_0x78e6('0xf')]('['+[_0x3c54e3['toUpperCase']()]+_0x78e6('0x19'),_0x59dbac);return rp(_0x59dbac)['then'](function(_0x2a9c26){logger[_0x78e6('0xf')]('['+[_0x3c54e3['toUpperCase']()]+'],\x20getUser\x20entity',_0x2a9c26);if(_0x2a9c26['result'][_0x78e6('0xc')]>0x0&&String(_0x2a9c26[_0x78e6('0xb')][0x0]['active'])===_0x78e6('0x1a')){_0x43a781[_0x78e6('0x1b')]=_0x2a9c26['result'][0x0][_0x78e6('0xe')];}else{_0x43a781[_0x78e6('0x1b')]=_0x43a781['adminId'];_0x43a781[_0x78e6('0x18')]=_0x43a781['adminEmail'];}logger[_0x78e6('0xf')]('['+[_0x3c54e3[_0x78e6('0x13')]()]+'],\x20getUser\x20crm',_0x43a781);_0x26492d(_0x43a781);})[_0x78e6('0x11')](function(_0x223826){logger['error']('['+[_0x3c54e3['toUpperCase']()]+']',_0x223826[_0x78e6('0x14')]);_0x322727(_0x223826[_0x78e6('0x14')]);});}else{logger[_0x78e6('0xf')]('['+[_0x3c54e3[_0x78e6('0x13')]()]+_0x78e6('0x1c'));_0x43a781[_0x78e6('0x1b')]=_0x43a781[_0x78e6('0xd')];_0x43a781[_0x78e6('0x18')]=_0x43a781[_0x78e6('0x1d')];_0x26492d(_0x43a781);}});};}function createEndUser(_0x59d114,_0x202662,_0x188fce,_0x142eef,_0x59a406){logger[_0x78e6('0xf')]('['+[_0x59d114[_0x78e6('0x13')]()]+_0x78e6('0x1e'),_0x188fce);return new Promise(function(_0x3c50e6,_0xbc6510){var _0xec864f={'method':_0x78e6('0x1f'),'uri':_0x142eef+_0x78e6('0x20')+_0x59a406,'body':{'user_name':_0x188fce['endUserNumber'],'roles':_0x78e6('0x21'),'first_name':_0x188fce['endUserNumber'],'active':_0x78e6('0x1a'),'date_format':_0x78e6('0x22'),'phone':_0x188fce['endUserNumber']},'auth':_0x202662,'json':!![]};return rp(_0xec864f)['then'](function(_0x2ab0f1){logger[_0x78e6('0xf')]('['+[_0x59d114[_0x78e6('0x13')]()]+_0x78e6('0x23'),_0x2ab0f1['result']);_0x188fce[_0x78e6('0x24')]=_0x2ab0f1[_0x78e6('0xb')]['sys_id'];_0x3c50e6(_0x188fce);})[_0x78e6('0x11')](function(_0x9f5618){logger[_0x78e6('0x12')]('['+[_0x59d114[_0x78e6('0x13')]()]+']',_0x9f5618[_0x78e6('0x14')]);_0xbc6510(_0x9f5618[_0x78e6('0x14')]);});});}function getEndUser(_0x361598,_0x420aeb,_0x39bce0,_0x54b179,_0x815e33){return function(_0x1ea01e){logger['info']('['+[_0x361598[_0x78e6('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x1ea01e);return new Promise(function(_0x1ff777,_0x38caad){var _0x4aea1b={'method':_0x78e6('0x8'),'uri':_0x39bce0+_0x78e6('0x25')+_0x1ea01e[_0x78e6('0x26')]+'&'+_0x54b179+'&'+_0x815e33,'auth':_0x420aeb,'json':!![]};return rp(_0x4aea1b)[_0x78e6('0xa')](function(_0x2bc729){if(_0x2bc729['result'][_0x78e6('0xc')]>0x0){_0x1ea01e[_0x78e6('0x24')]=_0x2bc729['result'][0x0][_0x78e6('0xe')];logger[_0x78e6('0xf')]('['+[_0x361598[_0x78e6('0x13')]()]+'],\x20getEndUser\x20crm',_0x1ea01e);_0x1ff777(_0x1ea01e);}else{return createEndUser(_0x361598,_0x420aeb,_0x1ea01e,_0x39bce0,_0x54b179)[_0x78e6('0xa')](function(_0x1e568a){logger['info']('['+[_0x361598[_0x78e6('0x13')]()]+_0x78e6('0x27'),_0x1e568a);_0x1ff777(_0x1e568a);});}})['catch'](function(_0x5a41dd){logger[_0x78e6('0x12')]('['+[_0x361598[_0x78e6('0x13')]()]+']',_0x5a41dd[_0x78e6('0x14')]);_0x38caad(_0x5a41dd['message']);});});};}function getCustomFields(_0x2c472b,_0x1b6963){var _0x574ce2={};if(_0x2c472b[_0x78e6('0xc')]>0x0){_[_0x78e6('0x28')](_0x2c472b,function(_0x3b0d45){if(_[_0x78e6('0x29')]([_0x78e6('0x2a'),'picklist'],_0x3b0d45[_0x78e6('0x2b')])&&_0x3b0d45['nameField']&&!_0x3b0d45[_0x78e6('0x2c')]){_0x574ce2[_0x3b0d45[_0x78e6('0x2d')][_0x78e6('0x2e')]()]=_0x3b0d45['content'][_0x78e6('0x2f')]();}else if(_['includes']([_0x78e6('0x2a'),_0x78e6('0x30')],_0x3b0d45[_0x78e6('0x2b')])&&_0x3b0d45[_0x78e6('0x31')]&&_0x3b0d45[_0x78e6('0x2c')]){_0x574ce2[_0x3b0d45[_0x78e6('0x31')]['toLowerCase']()]=_0x3b0d45[_0x78e6('0x32')]['toString']();}else if(_0x3b0d45[_0x78e6('0x2b')]===_0x78e6('0x33')&&_0x3b0d45['variableName']&&_0x3b0d45[_0x78e6('0x31')]&&_0x3b0d45['customField']){_0x574ce2[_0x3b0d45['idField'][_0x78e6('0x2e')]()]=_0x1b6963[_0x3b0d45[_0x78e6('0x34')]][_0x78e6('0x2f')]();}else if(_0x3b0d45[_0x78e6('0x2b')]===_0x78e6('0x35')&&_0x3b0d45[_0x78e6('0x36')]&&_0x3b0d45[_0x78e6('0x36')]['name']&&_0x3b0d45['idField']&&_0x3b0d45[_0x78e6('0x2c')]){_0x574ce2[_0x3b0d45[_0x78e6('0x31')]['toLowerCase']()]=_0x1b6963[_0x3b0d45['Variable'][_0x78e6('0x37')]['toLowerCase']()]['toString']();}});}return _0x574ce2;}function getTicket(_0x59a0b6,_0x29a723,_0x51322f,_0x47822b,_0x4a4d1a,_0x1a8f09){return function(_0x1843a2){logger[_0x78e6('0xf')]('['+[_0x59a0b6[_0x78e6('0x13')]()]+_0x78e6('0x38'),_0x1843a2);return new Promise(function(_0x3e4654,_0x33c3e2){var _0x16cb09=_0x59a0b6[_0x78e6('0x2e')]()===_0x78e6('0x39')?_0x1843a2[_0x78e6('0x1b')]:_0x1843a2[_0x78e6('0x24')];var _0x1719cb={'method':_0x78e6('0x1f'),'uri':_0x51322f+'incident'+'?'+_0x1a8f09,'body':Object[_0x78e6('0x3a')]({},{'active':_0x78e6('0x1a'),'caller_id':_0x16cb09,'assigned_to':_0x1843a2[_0x78e6('0x1b')],'short_description':intUtil['getString'](_0x47822b[_0x78e6('0x3b')],_0x4a4d1a,'\x20'),'description':intUtil['getString'](_0x47822b[_0x78e6('0x3c')],_0x4a4d1a,'\x0a')},getCustomFields(_0x47822b[_0x78e6('0x3d')],_0x4a4d1a)),'auth':_0x29a723,'json':!![]};return rp(_0x1719cb)['then'](function(_0x58e561){logger[_0x78e6('0xf')]('['+[_0x59a0b6[_0x78e6('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x58e561['result']);_0x1843a2[_0x78e6('0x3e')]=_0x58e561[_0x78e6('0xb')][_0x78e6('0xe')];_0x1843a2[_0x78e6('0x3f')]=_0x58e561[_0x78e6('0xb')]['number'];logger[_0x78e6('0xf')]('['+[_0x59a0b6[_0x78e6('0x13')]()]+_0x78e6('0x40'),_0x1843a2);_0x3e4654(_0x1843a2);})[_0x78e6('0x11')](function(_0x4a9d2e){logger[_0x78e6('0x12')]('['+[_0x59a0b6[_0x78e6('0x13')]()]+']',_0x4a9d2e['message']);_0x33c3e2(_0x4a9d2e[_0x78e6('0x14')]);});});};}function createRemoteTag(_0x354e37,_0x175815,_0x254589,_0x9e6836){return new Promise(function(_0x2f5335,_0x524202){var _0x4d4e26={'method':_0x78e6('0x1f'),'uri':_0x254589+_0x78e6('0x41')+'?'+_0x9e6836,'body':{'short_description':_0x354e37,'global':!![],'active':!![],'name':_0x354e37},'auth':_0x175815,'json':!![]};return rp(_0x4d4e26)[_0x78e6('0xa')](function(_0xd768db){var _0x491ac5=_0xd768db[_0x78e6('0xb')][_0x78e6('0xe')];_0x2f5335(_0x491ac5);});});}function getRemoteTag(_0x3256ed,_0x19e70a,_0x4e95c7,_0x3ca2fb,_0x3e2851){return new Promise(function(_0x2fcee9,_0x1f1b6a){var _0x7524c5={'method':_0x78e6('0x8'),'uri':_0x4e95c7+_0x78e6('0x41')+'?sysparm_query=name%3D'+_0x3256ed+'&'+_0x3ca2fb,'auth':_0x19e70a,'json':!![]};return rp(_0x7524c5)[_0x78e6('0xa')](function(_0x11e9ab){if(_0x11e9ab['result']['length']>0x0){var _0x258746=_0x11e9ab[_0x78e6('0xb')][0x0]['sys_id'];_0x2fcee9(_0x258746);}else{return createRemoteTag(_0x3256ed,_0x19e70a,_0x4e95c7,_0x3ca2fb)[_0x78e6('0xa')](function(_0x3c7515){_0x2fcee9(_0x3c7515);});}});});}function assignTagToIncident(_0x3e90ea,_0x2b2966,_0x1b4ff9,_0x365f65,_0x440d28){return new Promise(function(_0x4bcc80,_0x382798){var _0x4c532f={'method':_0x78e6('0x1f'),'uri':_0x1b4ff9+_0x78e6('0x42')+'?'+_0x440d28,'body':{'label':_0x3e90ea,'table':_0x78e6('0x43'),'id_type':_0x78e6('0x44'),'table_key':_0x365f65[_0x78e6('0x3e')],'title':_0x78e6('0x45')+_0x365f65[_0x78e6('0x3f')],'id_display':_0x365f65['ticketNumber']},'auth':_0x2b2966,'json':!![]};return rp(_0x4c532f)['then'](function(_0x22d6ba){_0x4bcc80();})[_0x78e6('0x11')](function(){_0x4bcc80();});});}function manageTags(_0x484da4,_0x584cb5,_0x4e05be,_0x4ba70d,_0x489aa6,_0xaca328,_0x3bd2e1){return new Promise(function(_0x5a0b3b,_0x7afb96){var _0xdf8878=[];_0x584cb5[_0x78e6('0x28')](function(_0x56ac00){_0xdf8878[_0x78e6('0x46')](getRemoteTag(_0x56ac00,_0x4e05be,_0x4ba70d,_0xaca328,_0x3bd2e1));});return Promise[_0x78e6('0x47')](_0xdf8878)[_0x78e6('0xa')](function(_0x748a20){if(_0x748a20['length']){logger[_0x78e6('0xf')]('['+[_0x484da4['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x748a20);var _0x5c96f2=[];_0x748a20['forEach'](function(_0x310139){_0x5c96f2[_0x78e6('0x46')](assignTagToIncident(_0x310139,_0x4e05be,_0x4ba70d,_0x489aa6,_0xaca328));});return Promise[_0x78e6('0x47')](_0x5c96f2)[_0x78e6('0xa')](function(){_0x5a0b3b();})['catch'](function(){_0x5a0b3b();});}else{_0x5a0b3b();}});});}function getTags(_0x55e0b2,_0x5a1427,_0x1ad027,_0x2a8cb9,_0x44b21f,_0x2ed00a){return function(_0x489897){return new Promise(function(_0x458539,_0x51430d){var _0x3a5078=[];var _0x29b24c=_0x2a8cb9[_0x78e6('0x48')];if(_0x29b24c&&_0x29b24c[_0x78e6('0xc')]>0x0){_0x3a5078=_[_0x78e6('0x49')](_0x29b24c,_0x78e6('0x37'));}if(_0x3a5078[_0x78e6('0xc')]>0x0){return manageTags(_0x55e0b2,_0x3a5078,_0x5a1427,_0x1ad027,_0x489897,_0x44b21f,_0x2ed00a)['then'](function(){_0x458539(_0x489897);});}else{_0x458539(_0x489897);}});};}function emit(_0x11e4c6,_0x2f68a6,_0x219afb){var _0x11134f=_0x78e6('0x4a')+_0x78e6('0x4b')+_0x78e6('0x4c')+'%255EORDERBYDESCnumber';var _0x101b29={'uri':_0x11e4c6+_0x78e6('0x4d')+_0x219afb+_0x11134f};io['to'](util[_0x78e6('0x4e')](_0x78e6('0x4f'),_0x2f68a6))[_0x78e6('0x50')](_0x78e6('0x51'),_0x101b29);}exports['cs']=function(_0x52dd9d,_0x8db933,_0x552a31,_0x52acc3,_0x246cbb,_0x51c078,_0x3dfa83,_0x556771){var _0x4ae4a9={};var _0x32bf68={'user':_0x51c078[_0x78e6('0x52')],'pass':_0x51c078[_0x78e6('0x53')]};var _0x127847=_0x78e6('0x54');var _0x33147f=_0x78e6('0x55');_0x51c078[_0x78e6('0x56')]=intUtil[_0x78e6('0x57')](_0x51c078['remoteUri']);_0x51c078[_0x78e6('0x58')]=intUtil[_0x78e6('0x57')](_0x51c078[_0x78e6('0x58')]);var _0xd6cfa2=util[_0x78e6('0x4e')](_0x78e6('0x59'),_0x51c078[_0x78e6('0x56')]);_0x4ae4a9[_0x78e6('0x18')]=!_[_0x78e6('0x5a')](_0x52acc3)?_0x52acc3[_0x78e6('0x5b')]:null;_0x4ae4a9['adminEmail']=_0x51c078[_0x78e6('0x5b')];_0x4ae4a9[_0x78e6('0x26')]=_0x556771[_0x78e6('0x2e')]()===_0x78e6('0x39')?_0x8db933[_0x78e6('0x5c')]:_0x8db933[_0x78e6('0x5d')];_0x4ae4a9[_0x78e6('0x5e')]=_0x556771===_0x78e6('0x5f')||_0x556771===_0x78e6('0x60')?_0x78e6('0x5f'):'outbound';var _0x3daa7a=util[_0x78e6('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51c078[_0x78e6('0x58')],_0x8db933['uniqueid'],md5(_0x8db933[_0x78e6('0x61')]));if(_0x246cbb&&_0x246cbb[_0x78e6('0x62')]){logger['info'](_0x78e6('0x63'),_0x78e6('0x64'));_0x8db933[_0x78e6('0x65')]=_0x3daa7a;}else if(_0x3dfa83&&_0x3dfa83[_0x78e6('0x66')]&&_0x3dfa83[_0x78e6('0x66')]!=='none'){logger['info'](_0x78e6('0x67'),_0x78e6('0x64'));_0x8db933[_0x78e6('0x65')]=_0x3daa7a;}else{_0x8db933[_0x78e6('0x65')]='';}return getAdminUser(_0x556771,_0x32bf68,_0x4ae4a9,_0xd6cfa2,_0x33147f,_0x127847)['then'](getUser(_0x556771,_0x32bf68,_0xd6cfa2,_0x33147f,_0x127847))[_0x78e6('0xa')](getEndUser(_0x556771,_0x32bf68,_0xd6cfa2,_0x33147f,_0x127847))[_0x78e6('0xa')](getTicket(_0x556771,_0x32bf68,_0xd6cfa2,_0x552a31,_0x8db933,_0x33147f))['then'](function(_0x1fec1b){logger['info'](util['format'](_0x78e6('0x68'),_0x1fec1b[_0x78e6('0x3e')]));logger[_0x78e6('0xf')](util[_0x78e6('0x4e')](_0x78e6('0x69'),_0x556771));if(_0x556771!==_0x78e6('0x60')){logger['info']('['+[_0x556771[_0x78e6('0x13')]()]+']',_0x78e6('0x6a'));emit(_0x51c078[_0x78e6('0x56')],_0x52acc3['name'],_0x1fec1b['ticketId']);}})[_0x78e6('0x11')](function(_0x3cf1e7){logger[_0x78e6('0x12')]('['+[_0x556771[_0x78e6('0x13')]()]+_0x78e6('0x6b'),util[_0x78e6('0x6c')](_0x3cf1e7,{'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 15cd7f0..41a32f8 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 _0x6c65=['PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','Outbound','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','trigger:browser:url','catch','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','forEach','type','string','nameField','toLowerCase','customField','custom_fields','content','toString','variable','Variable','username'];(function(_0x1e3444,_0x250078){var _0x5b8536=function(_0xe8bce6){while(--_0xe8bce6){_0x1e3444['push'](_0x1e3444['shift']());}};_0x5b8536(++_0x250078);}(_0x6c65,0x198));var _0x56c6=function(_0x3a467a,_0x4cb7f6){_0x3a467a=_0x3a467a-0x0;var _0x1af0cd=_0x6c65[_0x3a467a];return _0x1af0cd;};'use strict';var _=require('lodash');var rp=require(_0x56c6('0x0'));var BPromise=require('bluebird');var md5=require(_0x56c6('0x1'));var util=require(_0x56c6('0x2'));var Redis=require(_0x56c6('0x3'));var intUtil=require(_0x56c6('0x4'));var config=require(_0x56c6('0x5'));var logger=require(_0x56c6('0x6'))(_0x56c6('0x7'));config[_0x56c6('0x8')]=_[_0x56c6('0x9')](config[_0x56c6('0x8')],{'host':_0x56c6('0xa'),'port':0x18eb});var io=require(_0x56c6('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x5099d5,_0x299a3b,_0x1e76be){io['to'](_0x5099d5)[_0x56c6('0xc')](_0x299a3b,_0x1e76be);}function getTicket(_0x24c604,_0x2e2e5b,_0x2bcabf,_0x553b69,_0x336bf9,_0xac6198,_0x32d083,_0x314841){logger['info'](_0x56c6('0xd'));var _0x1e7905=new Date();var _0x5026e8=[{'name':_0x56c6('0xe'),'value':intUtil[_0x56c6('0xf')](_0x553b69['Subjects'],_0x336bf9,'\x20')},{'name':_0x56c6('0x10'),'value':_0x2e2e5b['id']},{'name':'created_by','value':_0x2e2e5b['id']},{'name':_0x56c6('0x11'),'value':intUtil[_0x56c6('0xf')](_0x553b69[_0x56c6('0x12')],_0x336bf9,'\x0a')},{'name':'date_start','value':_0x1e7905[_0x56c6('0x13')]()[_0x56c6('0x14')](0x0,0x13)[_0x56c6('0x15')]('T','\x20')},{'name':_0x56c6('0x16'),'value':'0'},{'name':_0x56c6('0x17'),'value':'15'},{'name':_0x56c6('0x18'),'value':_0x2bcabf['id']},{'name':_0x56c6('0x19'),'value':_0x56c6('0x1a')},{'name':_0x56c6('0x1b'),'value':_0x2bcabf[_0x56c6('0xe')]},{'name':_0x56c6('0x1c'),'value':_0x314841}];if(_0xac6198[_0x56c6('0x1d')]){_['forEach'](_0xac6198,function(_0x36c6d6){if(_0x336bf9[_0x36c6d6[_0x56c6('0x1e')]]){_0x5026e8[_0x56c6('0x1f')]({'name':_0x36c6d6[_0x56c6('0x20')],'value':_0x336bf9[_0x36c6d6[_0x56c6('0x1e')]]});}});}return request({'form':{'method':_0x56c6('0x21'),'input_type':_0x56c6('0x22'),'response_type':_0x56c6('0x22'),'rest_data':JSON[_0x56c6('0x23')]({'session':_0x32d083['id'],'module_name':_0x56c6('0x24'),'name_value_list':_0x5026e8})}});}function getAuth(_0x277cf8){return util[_0x56c6('0x25')](_0x56c6('0x26'),new Buffer(_0x277cf8[_0x56c6('0x27')]+':X')['toString'](_0x56c6('0x28')));}function getServerInfo(_0x460cf1){return request({'form':{'method':'get_server_info','input_type':_0x56c6('0x22'),'response_type':'JSON','rest_data':JSON[_0x56c6('0x23')]({'session':_0x460cf1['id']})}});}function getUser(_0x545978,_0x572dce,_0x113cd7){if(!_[_0x56c6('0x29')](_0x572dce)){logger[_0x56c6('0x2a')](_0x56c6('0x2b'),_0x572dce);return request({'form':{'method':_0x56c6('0x2c'),'input_type':_0x56c6('0x22'),'response_type':_0x56c6('0x22'),'rest_data':JSON['stringify']({'session':_0x113cd7['id'],'module_name':_0x56c6('0x2d'),'query':util[_0x56c6('0x25')](_0x56c6('0x2e'),_0x572dce),'order_by':'','offset':'0','select_fields':['id',_0x56c6('0xe'),_0x56c6('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x56c6('0x30')](function(_0x3f1572){if(_0x3f1572['entry_list'][_0x56c6('0x1d')]){var _0x505f35=_[_0x56c6('0x31')](_0x3f1572[_0x56c6('0x32')],function(_0x1af9ed){return _0x1af9ed[_0x56c6('0x33')]['user_name'][_0x56c6('0x34')]===_0x572dce;});if(_0x505f35){logger[_0x56c6('0x2a')](_0x56c6('0x35'));return BPromise[_0x56c6('0x36')]({'id':_0x505f35[_0x56c6('0x33')]['id'][_0x56c6('0x34')],'name':_0x505f35[_0x56c6('0x33')][_0x56c6('0xe')]['value']});}}logger[_0x56c6('0x2a')](_0x56c6('0x37'));return BPromise['resolve']({'id':_0x113cd7[_0x56c6('0x33')][_0x56c6('0x38')][_0x56c6('0x34')],'name':_0x113cd7[_0x56c6('0x33')][_0x56c6('0x2f')][_0x56c6('0x34')]});});}else{logger['info'](_0x56c6('0x39'));return BPromise['resolve']({'id':_0x113cd7['name_value_list']['user_id'][_0x56c6('0x34')],'name':_0x113cd7[_0x56c6('0x33')][_0x56c6('0x2f')][_0x56c6('0x34')]});}}function getEndUser(_0x280488,_0x3fcfe9,_0x42eaca,_0x39d067){logger['info'](_0x56c6('0x3a'),_0x42eaca);return request({'form':{'method':_0x56c6('0x2c'),'input_type':_0x56c6('0x22'),'response_type':_0x56c6('0x22'),'rest_data':JSON[_0x56c6('0x23')]({'session':_0x39d067['id'],'module_name':_0x56c6('0x1a'),'query':util[_0x56c6('0x25')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x42eaca),'order_by':'','offset':'0','select_fields':['id',_0x56c6('0xe'),_0x56c6('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x56c6('0x30')](function(_0x26246){if(_0x26246[_0x56c6('0x32')][_0x56c6('0x1d')]){var _0x184489=_[_0x56c6('0x31')](_0x26246[_0x56c6('0x32')],function(_0xc190d9){return _0xc190d9[_0x56c6('0x33')][_0x56c6('0x3b')]['value']===_0x42eaca;});if(_0x184489){logger[_0x56c6('0x2a')](_0x56c6('0x3c'));return BPromise['resolve']({'id':_0x184489[_0x56c6('0x33')]['id'][_0x56c6('0x34')],'name':_0x184489[_0x56c6('0x33')][_0x56c6('0xe')][_0x56c6('0x34')],'phone':_0x184489['name_value_list'][_0x56c6('0x3b')][_0x56c6('0x34')]});}}else{logger[_0x56c6('0x2a')](_0x56c6('0x3d'));return request({'form':{'method':_0x56c6('0x21'),'input_type':_0x56c6('0x22'),'response_type':_0x56c6('0x22'),'rest_data':JSON[_0x56c6('0x23')]({'session':_0x39d067['id'],'module_name':_0x56c6('0x1a'),'name_value_list':[{'name':_0x56c6('0x3e'),'value':_0x3fcfe9!==''?_0x3fcfe9:util['format'](_0x56c6('0x3f'),_0x42eaca)},{'name':_0x56c6('0x3b'),'value':_0x42eaca}]})}})[_0x56c6('0x30')](function(_0x4af005){logger['info'](_0x56c6('0x40'));return BPromise[_0x56c6('0x36')]({'id':_0x4af005['id'],'name':_0x4af005['entry_list'][_0x56c6('0x3e')]['value'],'phone':_0x4af005[_0x56c6('0x32')][_0x56c6('0x3b')][_0x56c6('0x34')]});});}});}function request(_0x44d818){logger[_0x56c6('0x41')]('[HTTP]',JSON[_0x56c6('0x23')](_0x44d818));return rp(_[_0x56c6('0x42')](def,_0x44d818));}function getTags(_0x4541ab,_0x327291){var _0x4d2a41=[];if(_0x4541ab&&_0x4541ab['length']>0x0){_0x4d2a41=_[_0x56c6('0x43')](_0x4541ab,_0x327291);}return _0x4d2a41;}function getCustomFields(_0x26a6a9,_0x5bf98d){var _0x687848=[];var _0x4001da={'custom_fields':[]};if(_0x26a6a9['length']>0x0){_[_0x56c6('0x44')](_0x26a6a9,function(_0x4ade8e){if(_0x4ade8e[_0x56c6('0x45')]===_0x56c6('0x46')&&_0x4ade8e['nameField']&&!_0x4ade8e['customField']){_0x4001da[_0x4ade8e[_0x56c6('0x47')][_0x56c6('0x48')]()]=_0x4ade8e['content']['toString']();}else if(_0x4ade8e[_0x56c6('0x45')]==='string'&&_0x4ade8e['idField']&&_0x4ade8e[_0x56c6('0x49')]){_0x4001da[_0x56c6('0x4a')]['push']({'id':_0x4ade8e['idField'],'value':_0x4ade8e[_0x56c6('0x4b')][_0x56c6('0x4c')]()});}else if(_0x4ade8e[_0x56c6('0x45')]===_0x56c6('0x4d')&&_0x4ade8e[_0x56c6('0x1e')]&&_0x4ade8e[_0x56c6('0x20')]&&_0x4ade8e[_0x56c6('0x49')]){_0x5bf98d[_0x4ade8e['variableName']]&&_0x4001da[_0x56c6('0x4a')]['push']({'id':_0x4ade8e[_0x56c6('0x20')],'value':_0x5bf98d[_0x4ade8e[_0x56c6('0x1e')]][_0x56c6('0x4c')]()});}else if(_0x4ade8e[_0x56c6('0x45')]==='customVariable'&&_0x4ade8e[_0x56c6('0x4e')]&&_0x4ade8e['Variable']['name']&&_0x4ade8e['idField']&&_0x4ade8e[_0x56c6('0x49')]){_0x5bf98d[_0x4ade8e[_0x56c6('0x4e')]['name'][_0x56c6('0x48')]()]&&_0x4001da[_0x56c6('0x4a')][_0x56c6('0x1f')]({'id':_0x4ade8e['idField'],'value':_0x5bf98d[_0x4ade8e['Variable'][_0x56c6('0xe')][_0x56c6('0x48')]()][_0x56c6('0x4c')]()});}});}return _0x4001da;}function getConnection(_0x407342){return request({'method':'POST','form':{'method':'login','input_type':'JSON','response_type':_0x56c6('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x407342[_0x56c6('0x4f')],'password':_0x407342['password'],'encryption':_0x56c6('0x50')},'application':_0x56c6('0x51')})}})[_0x56c6('0x30')](function(_0x51b039){var _0x337a72=_0x51b039;if(_0x337a72['id']){def[_0x56c6('0x52')]=_0x337a72['id'];return BPromise[_0x56c6('0x36')](_0x337a72);}else{throw new Error(util[_0x56c6('0x25')](_0x56c6('0x53'),_0x407342['id']));}});}function setRelationship(_0x13ca29,_0x2037a7,_0x52f766,_0x28bdf8){return request({'form':{'method':_0x56c6('0x54'),'input_type':_0x56c6('0x22'),'response_type':_0x56c6('0x22'),'rest_data':JSON[_0x56c6('0x23')]({'session':_0x13ca29['id'],'module_name':_0x56c6('0x24'),'module_id':_0x52f766['id'],'link_field_name':_0x28bdf8,'related_ids':[_0x2037a7['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x56c6('0x55')]=function(_0x19cdb8,_0x5ca628,_0x40210a,_0x6611af,_0x464cb1,_0x4aad65){var _0x3160dc,_0xadad24,_0x344bda,_0x5f0f8c;_0x4aad65[_0x56c6('0x56')]=intUtil[_0x56c6('0x57')](_0x4aad65[_0x56c6('0x56')]);_0x4aad65[_0x56c6('0x58')]=intUtil['stripTrailingSlash'](_0x4aad65[_0x56c6('0x58')]);def[_0x56c6('0x59')]=util[_0x56c6('0x25')](_0x56c6('0x5a'),_0x4aad65['remoteUri']);if(_0x464cb1&&_0x464cb1[_0x56c6('0x5b')]){logger['info'](_0x56c6('0x5c'),_0x56c6('0x5d'));_0x5ca628['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4aad65[_0x56c6('0x58')],_0x5ca628['uniqueid'],md5(_0x5ca628[_0x56c6('0x5e')]));}else{_0x5ca628[_0x56c6('0x5f')]='';}return getConnection(_0x4aad65)['then'](function(_0x2427de){_0x5f0f8c=_0x2427de;return getUser(_0x4aad65,_0x6611af['name'],_0x5f0f8c);})[_0x56c6('0x30')](function(_0x4d8ab1){_0x3160dc=_0x4d8ab1;logger['info']('The\x20User\x20ID\x20is:',_0x3160dc['id']);return getEndUser(_0x4aad65,_0x5ca628[_0x56c6('0x60')],_0x5ca628[_0x56c6('0x61')],_0x5f0f8c);})['then'](function(_0x2460f4){_0xadad24=_0x2460f4;logger[_0x56c6('0x2a')](_0x56c6('0x62'),_0xadad24['id']);return getTicket(_0x4aad65,_0x3160dc,_0xadad24,_0x40210a,_0x5ca628,_0x40210a[_0x56c6('0x63')],_0x5f0f8c,_0x56c6('0x64'));})[_0x56c6('0x30')](function(_0x259753){_0x344bda=_0x259753;logger[_0x56c6('0x2a')](_0x56c6('0x65'));logger[_0x56c6('0x2a')](_0x56c6('0x66'),_0x344bda['id']);return setRelationship(_0x5f0f8c,_0x3160dc,_0x344bda,_0x56c6('0x67'));})[_0x56c6('0x30')](function(){return setRelationship(_0x5f0f8c,_0xadad24,_0x344bda,_0x56c6('0x68'));})['then'](function(){return getServerInfo(_0x5f0f8c);})['then'](function(_0x275558){var _0x45b825=parseInt(_0x275558[_0x56c6('0x69')]['charAt'](0x0));var _0x3ce95f=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4aad65['remoteUri'],_0x344bda['id']);if(_0x45b825>0x6){_0x3ce95f=util[_0x56c6('0x25')](_0x56c6('0x6a'),_0x4aad65[_0x56c6('0x56')],_0x344bda['id']);}logger[_0x56c6('0x2a')]('[QUEUE]',_0x56c6('0x6b'));emit(util[_0x56c6('0x25')](_0x56c6('0x6c'),_0x6611af[_0x56c6('0xe')]),'trigger:browser:url',{'uri':_0x3ce95f});})['catch'](function(_0x85e32e){logger[_0x56c6('0x6d')](_0x56c6('0x5c'),JSON['stringify'](_0x85e32e));});};exports['outbound']=function(_0x2f6306,_0x541665,_0x1a1aaa,_0x5dff56,_0x25c3b5,_0x2c8352,_0x5b3d2a){var _0x3e8172,_0x1091c9,_0x2f3671,_0x538574;_0x2c8352[_0x56c6('0x56')]=intUtil[_0x56c6('0x57')](_0x2c8352[_0x56c6('0x56')]);_0x2c8352[_0x56c6('0x58')]=intUtil[_0x56c6('0x57')](_0x2c8352[_0x56c6('0x58')]);def[_0x56c6('0x59')]=util['format']('%s/service/v4_1/rest.php',_0x2c8352[_0x56c6('0x56')]);if(_0x5b3d2a&&_0x5b3d2a[_0x56c6('0x6e')]&&_0x5b3d2a[_0x56c6('0x6e')]!==_0x56c6('0x6f')){logger[_0x56c6('0x2a')]('[OUTBOUND]',_0x56c6('0x5d'));_0x541665[_0x56c6('0x5f')]=util[_0x56c6('0x25')](_0x56c6('0x70'),_0x2c8352[_0x56c6('0x58')],_0x541665['uniqueid'],md5(_0x541665[_0x56c6('0x5e')]));}return getConnection(_0x2c8352)[_0x56c6('0x30')](function(_0x4cd505){_0x538574=_0x4cd505;return getUser(_0x2c8352,_0x5dff56[_0x56c6('0xe')],_0x538574);})[_0x56c6('0x30')](function(_0x2bc3de){_0x3e8172=_0x2bc3de;logger['info'](_0x56c6('0x71'),_0x3e8172['id']);return getEndUser(_0x2c8352,_0x541665['destcalleridname'],_0x541665['destcalleridnum'],_0x538574);})[_0x56c6('0x30')](function(_0x2aecab){_0x1091c9=_0x2aecab;logger[_0x56c6('0x2a')](_0x56c6('0x62'),_0x1091c9['id']);return getTicket(_0x2c8352,_0x3e8172,_0x1091c9,_0x1a1aaa,_0x541665,_0x1a1aaa[_0x56c6('0x63')],_0x538574,_0x56c6('0x72'));})[_0x56c6('0x30')](function(_0x1e0f2b){_0x2f3671=_0x1e0f2b;logger[_0x56c6('0x2a')]('Ticket\x20created!');logger[_0x56c6('0x2a')](_0x56c6('0x66'),_0x2f3671['id']);return setRelationship(_0x538574,_0x3e8172,_0x2f3671,'users');})[_0x56c6('0x30')](function(){return setRelationship(_0x538574,_0x1091c9,_0x2f3671,_0x56c6('0x68'));})[_0x56c6('0x30')](function(){return getServerInfo(_0x538574);})[_0x56c6('0x30')](function(_0x565d78){var _0x39984d=parseInt(_0x565d78[_0x56c6('0x69')][_0x56c6('0x73')](0x0));var _0x582fda=util['format'](_0x56c6('0x74'),_0x2c8352[_0x56c6('0x56')],_0x2f3671['id']);if(_0x39984d>0x6){_0x582fda=util[_0x56c6('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2c8352['remoteUri'],_0x2f3671['id']);}logger[_0x56c6('0x2a')](_0x56c6('0x75'),_0x56c6('0x6b'));emit(util[_0x56c6('0x25')]('user:%s',_0x5dff56[_0x56c6('0xe')]),_0x56c6('0x76'),{'uri':_0x582fda});})[_0x56c6('0x77')](function(_0x3bcc36){logger[_0x56c6('0x6d')](_0x56c6('0x75'),JSON['stringify'](_0x3bcc36));});};exports['unmanaged']=function(_0x481a15,_0x269fe3,_0x278b83,_0x26ed35,_0x403cab,_0x813384){var _0x35f0eb,_0x6770cd,_0x2fdde7,_0x162735;_0x813384[_0x56c6('0x56')]=intUtil[_0x56c6('0x57')](_0x813384[_0x56c6('0x56')]);_0x813384['serverUrl']=intUtil[_0x56c6('0x57')](_0x813384[_0x56c6('0x58')]);def[_0x56c6('0x59')]=util[_0x56c6('0x25')](_0x56c6('0x5a'),_0x813384['remoteUri']);if(_0x403cab&&_0x403cab['monitor_format']){logger[_0x56c6('0x2a')]('['+_0x269fe3[_0x56c6('0x78')][_0x56c6('0x79')]()+']','Recording\x20is\x20enabled!');_0x269fe3[_0x56c6('0x5f')]=util[_0x56c6('0x25')](_0x56c6('0x70'),_0x813384['serverUrl'],_0x269fe3[_0x56c6('0x5e')],md5(_0x269fe3['uniqueid']));}else{_0x269fe3['recordingURL']='';}return getConnection(_0x813384)[_0x56c6('0x30')](function(_0x52b64c){_0x162735=_0x52b64c;if(!_[_0x56c6('0x29')](_0x26ed35)){return getUser(_0x813384,_0x26ed35[_0x56c6('0xe')],_0x162735);}else{return getUser(_0x813384,null,_0x162735);}})[_0x56c6('0x30')](function(_0x5667e3){_0x35f0eb=_0x5667e3;logger['info'](_0x56c6('0x71'),_0x35f0eb['id']);return getEndUser(_0x813384,_0x269fe3[_0x56c6('0x60')],_0x269fe3[_0x56c6('0x61')],_0x162735);})[_0x56c6('0x30')](function(_0x195939){_0x6770cd=_0x195939;logger['info'](_0x56c6('0x62'),_0x6770cd['id']);return getTicket(_0x813384,_0x35f0eb,_0x6770cd,_0x278b83,_0x269fe3,_0x278b83[_0x56c6('0x63')],_0x162735,'Inbound');})[_0x56c6('0x30')](function(_0x517221){_0x2fdde7=_0x517221;logger[_0x56c6('0x2a')](_0x56c6('0x65'));logger[_0x56c6('0x2a')](_0x56c6('0x66'),_0x2fdde7['id']);return setRelationship(_0x162735,_0x35f0eb,_0x2fdde7,'users');})[_0x56c6('0x30')](function(){return setRelationship(_0x162735,_0x6770cd,_0x2fdde7,'contacts');})['then'](function(){return getServerInfo(_0x162735);})['catch'](function(_0x2fe4d4){logger['error']('['+_0x269fe3[_0x56c6('0x78')][_0x56c6('0x79')]()+']',JSON[_0x56c6('0x23')](_0x2fe4d4));});}; \ No newline at end of file +var _0x5a60=['set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','catch','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','duration_hours','parent_id','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','string','nameField','toLowerCase','content','type','custom_fields','variable','customField','customVariable','Variable','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid'];(function(_0x3a3578,_0x1574d1){var _0x5c56aa=function(_0x44820e){while(--_0x44820e){_0x3a3578['push'](_0x3a3578['shift']());}};_0x5c56aa(++_0x1574d1);}(_0x5a60,0x192));var _0x05a6=function(_0x322f08,_0x41a89e){_0x322f08=_0x322f08-0x0;var _0x4ad9ec=_0x5a60[_0x322f08];return _0x4ad9ec;};'use strict';var _=require('lodash');var rp=require(_0x05a6('0x0'));var BPromise=require(_0x05a6('0x1'));var md5=require(_0x05a6('0x2'));var util=require(_0x05a6('0x3'));var Redis=require(_0x05a6('0x4'));var intUtil=require('./util');var config=require(_0x05a6('0x5'));var logger=require(_0x05a6('0x6'))('sugarcrm');config[_0x05a6('0x7')]=_['defaults'](config[_0x05a6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x05a6('0x8'))(new Redis(config['redis']));var def={'method':_0x05a6('0x9'),'json':!![]};function emit(_0x528b06,_0x1a9bf2,_0x27548a){io['to'](_0x528b06)[_0x05a6('0xa')](_0x1a9bf2,_0x27548a);}function getTicket(_0x3bcac9,_0x482253,_0x397de0,_0x5001d8,_0x13c1f6,_0x42a3eb,_0x21e4c4,_0x4c283c){logger[_0x05a6('0xb')](_0x05a6('0xc'));var _0x26ec5b=new Date();var _0x461b87=[{'name':_0x05a6('0xd'),'value':intUtil['getString'](_0x5001d8[_0x05a6('0xe')],_0x13c1f6,'\x20')},{'name':_0x05a6('0xf'),'value':_0x482253['id']},{'name':_0x05a6('0x10'),'value':_0x482253['id']},{'name':_0x05a6('0x11'),'value':intUtil[_0x05a6('0x12')](_0x5001d8[_0x05a6('0x13')],_0x13c1f6,'\x0a')},{'name':_0x05a6('0x14'),'value':_0x26ec5b[_0x05a6('0x15')]()[_0x05a6('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':_0x05a6('0x17'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x05a6('0x18'),'value':_0x397de0['id']},{'name':'parent_type','value':_0x05a6('0x19')},{'name':_0x05a6('0x1a'),'value':_0x397de0['name']},{'name':'direction','value':_0x4c283c}];if(_0x42a3eb[_0x05a6('0x1b')]){_[_0x05a6('0x1c')](_0x42a3eb,function(_0x30f318){if(_0x13c1f6[_0x30f318[_0x05a6('0x1d')]]){_0x461b87[_0x05a6('0x1e')]({'name':_0x30f318[_0x05a6('0x1f')],'value':_0x13c1f6[_0x30f318[_0x05a6('0x1d')]]});}});}return request({'form':{'method':_0x05a6('0x20'),'input_type':_0x05a6('0x21'),'response_type':'JSON','rest_data':JSON[_0x05a6('0x22')]({'session':_0x21e4c4['id'],'module_name':_0x05a6('0x23'),'name_value_list':_0x461b87})}});}function getAuth(_0x281b17){return util['format']('Basic\x20%s',new Buffer(_0x281b17[_0x05a6('0x24')]+':X')[_0x05a6('0x25')](_0x05a6('0x26')));}function getServerInfo(_0x578207){return request({'form':{'method':_0x05a6('0x27'),'input_type':_0x05a6('0x21'),'response_type':_0x05a6('0x21'),'rest_data':JSON[_0x05a6('0x22')]({'session':_0x578207['id']})}});}function getUser(_0x19f8b5,_0x3ccd4b,_0xfc7831){if(!_[_0x05a6('0x28')](_0x3ccd4b)){logger['info'](_0x05a6('0x29'),_0x3ccd4b);return request({'form':{'method':_0x05a6('0x2a'),'input_type':_0x05a6('0x21'),'response_type':'JSON','rest_data':JSON[_0x05a6('0x22')]({'session':_0xfc7831['id'],'module_name':'Employees','query':util[_0x05a6('0x2b')](_0x05a6('0x2c'),_0x3ccd4b),'order_by':'','offset':'0','select_fields':['id',_0x05a6('0xd'),_0x05a6('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x05a6('0x2e')](function(_0x3048b4){if(_0x3048b4[_0x05a6('0x2f')][_0x05a6('0x1b')]){var _0x595cc0=_[_0x05a6('0x30')](_0x3048b4[_0x05a6('0x2f')],function(_0x61c22d){return _0x61c22d['name_value_list'][_0x05a6('0x2d')][_0x05a6('0x31')]===_0x3ccd4b;});if(_0x595cc0){logger[_0x05a6('0xb')](_0x05a6('0x32'));return BPromise[_0x05a6('0x33')]({'id':_0x595cc0[_0x05a6('0x34')]['id'][_0x05a6('0x31')],'name':_0x595cc0[_0x05a6('0x34')]['name'][_0x05a6('0x31')]});}}logger['info'](_0x05a6('0x35'));return BPromise[_0x05a6('0x33')]({'id':_0xfc7831[_0x05a6('0x34')][_0x05a6('0x36')][_0x05a6('0x31')],'name':_0xfc7831['name_value_list'][_0x05a6('0x2d')][_0x05a6('0x31')]});});}else{logger[_0x05a6('0xb')](_0x05a6('0x37'));return BPromise[_0x05a6('0x33')]({'id':_0xfc7831[_0x05a6('0x34')]['user_id']['value'],'name':_0xfc7831['name_value_list']['user_name']['value']});}}function getEndUser(_0x216580,_0x536a78,_0xa3fd66,_0x440148){logger[_0x05a6('0xb')](_0x05a6('0x38'),_0xa3fd66);return request({'form':{'method':_0x05a6('0x2a'),'input_type':_0x05a6('0x21'),'response_type':'JSON','rest_data':JSON[_0x05a6('0x22')]({'session':_0x440148['id'],'module_name':_0x05a6('0x19'),'query':util[_0x05a6('0x2b')](_0x05a6('0x39'),_0xa3fd66),'order_by':'','offset':'0','select_fields':['id',_0x05a6('0xd'),_0x05a6('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x05a6('0x2e')](function(_0x32c9e2){if(_0x32c9e2[_0x05a6('0x2f')]['length']){var _0x58a001=_['find'](_0x32c9e2['entry_list'],function(_0x72e86){return _0x72e86[_0x05a6('0x34')][_0x05a6('0x3a')][_0x05a6('0x31')]===_0xa3fd66;});if(_0x58a001){logger[_0x05a6('0xb')](_0x05a6('0x3b'));return BPromise[_0x05a6('0x33')]({'id':_0x58a001[_0x05a6('0x34')]['id'][_0x05a6('0x31')],'name':_0x58a001['name_value_list'][_0x05a6('0xd')]['value'],'phone':_0x58a001[_0x05a6('0x34')][_0x05a6('0x3a')][_0x05a6('0x31')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x05a6('0x20'),'input_type':_0x05a6('0x21'),'response_type':_0x05a6('0x21'),'rest_data':JSON[_0x05a6('0x22')]({'session':_0x440148['id'],'module_name':_0x05a6('0x19'),'name_value_list':[{'name':_0x05a6('0x3c'),'value':_0x536a78!==_0x05a6('0x3d')?_0x536a78:util[_0x05a6('0x2b')](_0x05a6('0x3e'),_0xa3fd66)},{'name':_0x05a6('0x3a'),'value':_0xa3fd66}]})}})['then'](function(_0x19f5e1){logger[_0x05a6('0xb')](_0x05a6('0x3f'));return BPromise[_0x05a6('0x33')]({'id':_0x19f5e1['id'],'name':_0x19f5e1[_0x05a6('0x2f')][_0x05a6('0x3c')][_0x05a6('0x31')],'phone':_0x19f5e1['entry_list'][_0x05a6('0x3a')]['value']});});}});}function request(_0x13d5ff){logger[_0x05a6('0x40')](_0x05a6('0x41'),JSON['stringify'](_0x13d5ff));return rp(_[_0x05a6('0x42')](def,_0x13d5ff));}function getTags(_0x20a9d7,_0x5583c0){var _0x165117=[];if(_0x20a9d7&&_0x20a9d7[_0x05a6('0x1b')]>0x0){_0x165117=_[_0x05a6('0x43')](_0x20a9d7,_0x5583c0);}return _0x165117;}function getCustomFields(_0x123b6a,_0x508447){var _0x5c6ede=[];var _0x1b8729={'custom_fields':[]};if(_0x123b6a[_0x05a6('0x1b')]>0x0){_[_0x05a6('0x1c')](_0x123b6a,function(_0x35f5ad){if(_0x35f5ad['type']===_0x05a6('0x44')&&_0x35f5ad['nameField']&&!_0x35f5ad['customField']){_0x1b8729[_0x35f5ad[_0x05a6('0x45')][_0x05a6('0x46')]()]=_0x35f5ad[_0x05a6('0x47')][_0x05a6('0x25')]();}else if(_0x35f5ad[_0x05a6('0x48')]===_0x05a6('0x44')&&_0x35f5ad[_0x05a6('0x1f')]&&_0x35f5ad['customField']){_0x1b8729[_0x05a6('0x49')][_0x05a6('0x1e')]({'id':_0x35f5ad[_0x05a6('0x1f')],'value':_0x35f5ad[_0x05a6('0x47')][_0x05a6('0x25')]()});}else if(_0x35f5ad['type']===_0x05a6('0x4a')&&_0x35f5ad['variableName']&&_0x35f5ad['idField']&&_0x35f5ad[_0x05a6('0x4b')]){_0x508447[_0x35f5ad['variableName']]&&_0x1b8729[_0x05a6('0x49')][_0x05a6('0x1e')]({'id':_0x35f5ad[_0x05a6('0x1f')],'value':_0x508447[_0x35f5ad[_0x05a6('0x1d')]][_0x05a6('0x25')]()});}else if(_0x35f5ad[_0x05a6('0x48')]===_0x05a6('0x4c')&&_0x35f5ad['Variable']&&_0x35f5ad['Variable'][_0x05a6('0xd')]&&_0x35f5ad[_0x05a6('0x1f')]&&_0x35f5ad[_0x05a6('0x4b')]){_0x508447[_0x35f5ad[_0x05a6('0x4d')][_0x05a6('0xd')][_0x05a6('0x46')]()]&&_0x1b8729[_0x05a6('0x49')][_0x05a6('0x1e')]({'id':_0x35f5ad['idField'],'value':_0x508447[_0x35f5ad[_0x05a6('0x4d')][_0x05a6('0xd')]['toLowerCase']()][_0x05a6('0x25')]()});}});}return _0x1b8729;}function getConnection(_0xc148b1){return request({'method':_0x05a6('0x9'),'form':{'method':'login','input_type':_0x05a6('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0xc148b1[_0x05a6('0x4e')],'password':_0xc148b1[_0x05a6('0x4f')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x05a6('0x2e')](function(_0x2e406f){var _0x5c42c6=_0x2e406f;if(_0x5c42c6['id']){def[_0x05a6('0x50')]=_0x5c42c6['id'];return BPromise[_0x05a6('0x33')](_0x5c42c6);}else{throw new Error(util[_0x05a6('0x2b')](_0x05a6('0x51'),_0xc148b1['id']));}});}function setRelationship(_0x49e17d,_0x31ba3a,_0x49c90a,_0x18f24f){return request({'form':{'method':_0x05a6('0x52'),'input_type':_0x05a6('0x21'),'response_type':_0x05a6('0x21'),'rest_data':JSON[_0x05a6('0x22')]({'session':_0x49e17d['id'],'module_name':'Calls','module_id':_0x49c90a['id'],'link_field_name':_0x18f24f,'related_ids':[_0x31ba3a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x537b81,_0x368714,_0x2f7ff9,_0x3492ea,_0x23197d,_0x54eae6){var _0x1a3a2d,_0x3a93bd,_0x91dfab,_0x1ceb9d;_0x54eae6[_0x05a6('0x53')]=intUtil[_0x05a6('0x54')](_0x54eae6[_0x05a6('0x53')]);_0x54eae6['serverUrl']=intUtil[_0x05a6('0x54')](_0x54eae6[_0x05a6('0x55')]);def[_0x05a6('0x56')]=util[_0x05a6('0x2b')]('%s/service/v4_1/rest.php',_0x54eae6[_0x05a6('0x53')]);if(_0x23197d&&_0x23197d['monitor_format']){logger[_0x05a6('0xb')](_0x05a6('0x57'),_0x05a6('0x58'));_0x368714[_0x05a6('0x59')]=util['format'](_0x05a6('0x5a'),_0x54eae6['serverUrl'],_0x368714[_0x05a6('0x5b')],md5(_0x368714[_0x05a6('0x5b')]));}else{_0x368714[_0x05a6('0x59')]='';}return getConnection(_0x54eae6)[_0x05a6('0x2e')](function(_0x206edf){_0x1ceb9d=_0x206edf;return getUser(_0x54eae6,_0x3492ea['name'],_0x1ceb9d);})[_0x05a6('0x2e')](function(_0x4b5e70){_0x1a3a2d=_0x4b5e70;logger['info'](_0x05a6('0x5c'),_0x1a3a2d['id']);return getEndUser(_0x54eae6,_0x368714[_0x05a6('0x5d')],_0x368714[_0x05a6('0x5e')],_0x1ceb9d);})[_0x05a6('0x2e')](function(_0x258dc5){_0x3a93bd=_0x258dc5;logger[_0x05a6('0xb')](_0x05a6('0x5f'),_0x3a93bd['id']);return getTicket(_0x54eae6,_0x1a3a2d,_0x3a93bd,_0x2f7ff9,_0x368714,_0x2f7ff9[_0x05a6('0x60')],_0x1ceb9d,_0x05a6('0x61'));})[_0x05a6('0x2e')](function(_0x42aff8){_0x91dfab=_0x42aff8;logger[_0x05a6('0xb')](_0x05a6('0x62'));logger[_0x05a6('0xb')]('The\x20Ticket\x20ID\x20is:',_0x91dfab['id']);return setRelationship(_0x1ceb9d,_0x1a3a2d,_0x91dfab,_0x05a6('0x63'));})[_0x05a6('0x2e')](function(){return setRelationship(_0x1ceb9d,_0x3a93bd,_0x91dfab,_0x05a6('0x64'));})[_0x05a6('0x2e')](function(){return getServerInfo(_0x1ceb9d);})[_0x05a6('0x2e')](function(_0x2ac4b9){var _0x27e9ca=parseInt(_0x2ac4b9[_0x05a6('0x65')][_0x05a6('0x66')](0x0));var _0x15ad06=util[_0x05a6('0x2b')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x54eae6[_0x05a6('0x53')],_0x91dfab['id']);if(_0x27e9ca>0x6){_0x15ad06=util['format'](_0x05a6('0x67'),_0x54eae6['remoteUri'],_0x91dfab['id']);}logger[_0x05a6('0xb')](_0x05a6('0x57'),_0x05a6('0x68'));emit(util[_0x05a6('0x2b')]('user:%s',_0x3492ea[_0x05a6('0xd')]),'trigger:browser:url',{'uri':_0x15ad06});})['catch'](function(_0x3881bf){logger[_0x05a6('0x69')]('[QUEUE]',JSON['stringify'](_0x3881bf));});};exports[_0x05a6('0x6a')]=function(_0x1d1274,_0xad7fe,_0x235016,_0xd61df9,_0x475447,_0x17efb3,_0x103d5d){var _0x22daa5,_0x22975e,_0x3ae2ad,_0x34725f;_0x17efb3[_0x05a6('0x53')]=intUtil[_0x05a6('0x54')](_0x17efb3[_0x05a6('0x53')]);_0x17efb3[_0x05a6('0x55')]=intUtil['stripTrailingSlash'](_0x17efb3[_0x05a6('0x55')]);def[_0x05a6('0x56')]=util[_0x05a6('0x2b')](_0x05a6('0x6b'),_0x17efb3[_0x05a6('0x53')]);if(_0x103d5d&&_0x103d5d[_0x05a6('0x6c')]&&_0x103d5d[_0x05a6('0x6c')]!==_0x05a6('0x6d')){logger['info'](_0x05a6('0x6e'),_0x05a6('0x58'));_0xad7fe[_0x05a6('0x59')]=util[_0x05a6('0x2b')](_0x05a6('0x5a'),_0x17efb3[_0x05a6('0x55')],_0xad7fe[_0x05a6('0x5b')],md5(_0xad7fe[_0x05a6('0x5b')]));}return getConnection(_0x17efb3)[_0x05a6('0x2e')](function(_0x1436c4){_0x34725f=_0x1436c4;return getUser(_0x17efb3,_0xd61df9[_0x05a6('0xd')],_0x34725f);})[_0x05a6('0x2e')](function(_0x3b45f1){_0x22daa5=_0x3b45f1;logger[_0x05a6('0xb')](_0x05a6('0x5c'),_0x22daa5['id']);return getEndUser(_0x17efb3,_0xad7fe[_0x05a6('0x6f')],_0xad7fe[_0x05a6('0x70')],_0x34725f);})[_0x05a6('0x2e')](function(_0x5d10c2){_0x22975e=_0x5d10c2;logger[_0x05a6('0xb')]('The\x20Enduser\x20ID\x20is:',_0x22975e['id']);return getTicket(_0x17efb3,_0x22daa5,_0x22975e,_0x235016,_0xad7fe,_0x235016[_0x05a6('0x60')],_0x34725f,'Outbound');})['then'](function(_0x44eb3b){_0x3ae2ad=_0x44eb3b;logger[_0x05a6('0xb')](_0x05a6('0x62'));logger['info'](_0x05a6('0x71'),_0x3ae2ad['id']);return setRelationship(_0x34725f,_0x22daa5,_0x3ae2ad,_0x05a6('0x63'));})[_0x05a6('0x2e')](function(){return setRelationship(_0x34725f,_0x22975e,_0x3ae2ad,_0x05a6('0x64'));})[_0x05a6('0x2e')](function(){return getServerInfo(_0x34725f);})[_0x05a6('0x2e')](function(_0xfbe004){var _0x57bdfa=parseInt(_0xfbe004['version'][_0x05a6('0x66')](0x0));var _0x505e67=util[_0x05a6('0x2b')](_0x05a6('0x72'),_0x17efb3[_0x05a6('0x53')],_0x3ae2ad['id']);if(_0x57bdfa>0x6){_0x505e67=util['format'](_0x05a6('0x67'),_0x17efb3['remoteUri'],_0x3ae2ad['id']);}logger[_0x05a6('0xb')](_0x05a6('0x6e'),_0x05a6('0x68'));emit(util[_0x05a6('0x2b')]('user:%s',_0xd61df9[_0x05a6('0xd')]),_0x05a6('0x73'),{'uri':_0x505e67});})[_0x05a6('0x74')](function(_0x4786c4){logger[_0x05a6('0x69')]('[OUTBOUND]',JSON[_0x05a6('0x22')](_0x4786c4));});};exports[_0x05a6('0x75')]=function(_0x4d8c28,_0x5ce38c,_0x555556,_0x4bf74e,_0x3b1a7d,_0x9c5480){var _0x3eabb4,_0x27ea15,_0x10f558,_0x2251a3;_0x9c5480[_0x05a6('0x53')]=intUtil[_0x05a6('0x54')](_0x9c5480[_0x05a6('0x53')]);_0x9c5480[_0x05a6('0x55')]=intUtil[_0x05a6('0x54')](_0x9c5480['serverUrl']);def[_0x05a6('0x56')]=util['format'](_0x05a6('0x6b'),_0x9c5480[_0x05a6('0x53')]);if(_0x3b1a7d&&_0x3b1a7d[_0x05a6('0x76')]){logger[_0x05a6('0xb')]('['+_0x5ce38c[_0x05a6('0x77')][_0x05a6('0x78')]()+']','Recording\x20is\x20enabled!');_0x5ce38c[_0x05a6('0x59')]=util[_0x05a6('0x2b')](_0x05a6('0x5a'),_0x9c5480['serverUrl'],_0x5ce38c[_0x05a6('0x5b')],md5(_0x5ce38c[_0x05a6('0x5b')]));}else{_0x5ce38c[_0x05a6('0x59')]='';}return getConnection(_0x9c5480)['then'](function(_0x5d6d4b){_0x2251a3=_0x5d6d4b;if(!_['isNil'](_0x4bf74e)){return getUser(_0x9c5480,_0x4bf74e[_0x05a6('0xd')],_0x2251a3);}else{return getUser(_0x9c5480,null,_0x2251a3);}})[_0x05a6('0x2e')](function(_0x2f5d25){_0x3eabb4=_0x2f5d25;logger[_0x05a6('0xb')](_0x05a6('0x5c'),_0x3eabb4['id']);return getEndUser(_0x9c5480,_0x5ce38c[_0x05a6('0x5d')],_0x5ce38c[_0x05a6('0x5e')],_0x2251a3);})[_0x05a6('0x2e')](function(_0x2a312f){_0x27ea15=_0x2a312f;logger[_0x05a6('0xb')](_0x05a6('0x5f'),_0x27ea15['id']);return getTicket(_0x9c5480,_0x3eabb4,_0x27ea15,_0x555556,_0x5ce38c,_0x555556[_0x05a6('0x60')],_0x2251a3,_0x05a6('0x61'));})['then'](function(_0x373bf0){_0x10f558=_0x373bf0;logger[_0x05a6('0xb')](_0x05a6('0x62'));logger['info'](_0x05a6('0x71'),_0x10f558['id']);return setRelationship(_0x2251a3,_0x3eabb4,_0x10f558,_0x05a6('0x63'));})[_0x05a6('0x2e')](function(){return setRelationship(_0x2251a3,_0x27ea15,_0x10f558,'contacts');})[_0x05a6('0x2e')](function(){return getServerInfo(_0x2251a3);})[_0x05a6('0x74')](function(_0x2d35cd){logger[_0x05a6('0x69')]('['+_0x5ce38c[_0x05a6('0x77')]['toUpperCase']()+']',JSON['stringify'](_0x2d35cd));});}; \ 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 5da9ebf..6659e84 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 _0x32d4=['format','%s:\x20%s','keyContent','key','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x55c786,_0x58a0aa){var _0x26e1ed=function(_0x5be4d9){while(--_0x5be4d9){_0x55c786['push'](_0x55c786['shift']());}};_0x26e1ed(++_0x58a0aa);}(_0x32d4,0x107));var _0x432d=function(_0x1660a1,_0x523e18){_0x1660a1=_0x1660a1-0x0;var _0x5334e7=_0x32d4[_0x1660a1];return _0x5334e7;};'use strict';var _=require(_0x432d('0x0'));var util=require(_0x432d('0x1'));exports[_0x432d('0x2')]=function(_0x28a0f1,_0x1a6083,_0x40cf39){var _0x26532f=[];if(_0x28a0f1['length']>0x0){var _0xd78076=_[_0x432d('0x3')](_0x28a0f1,['id']);for(var _0x4bff98=0x0;_0x4bff98<_0xd78076['length'];_0x4bff98++){var _0xd7cd2c=_0xd78076[_0x4bff98];if(_0xd7cd2c[_0x432d('0x4')]===_0x432d('0x5')){_0x26532f[_0x432d('0x6')](_0xd7cd2c[_0x432d('0x7')]);}else if(_0xd7cd2c[_0x432d('0x4')]===_0x432d('0x8')&&_0xd7cd2c[_0x432d('0x9')]){_0x1a6083[_0xd7cd2c['variableName']]&&_0x26532f[_0x432d('0x6')](_0x1a6083[_0xd7cd2c[_0x432d('0x9')]][_0x432d('0xa')]());}else if(_0xd7cd2c[_0x432d('0x4')]===_0x432d('0xb')&&_0xd7cd2c['Variable']&&_0xd7cd2c[_0x432d('0xc')][_0x432d('0xd')]){_0x1a6083[_0xd7cd2c[_0x432d('0xc')][_0x432d('0xd')][_0x432d('0xe')]()]&&_0x26532f[_0x432d('0x6')](_0x1a6083[_0xd7cd2c[_0x432d('0xc')][_0x432d('0xd')]['toLowerCase']()][_0x432d('0xa')]());}else if(_0xd7cd2c[_0x432d('0x4')]===_0x432d('0xf')){if(_0xd7cd2c[_0x432d('0x10')]===_0x432d('0x5')&&_0xd7cd2c['key']){_0x26532f[_0x432d('0x6')](util[_0x432d('0x11')](_0x432d('0x12'),_0xd7cd2c['key'],_0xd7cd2c[_0x432d('0x13')]));}else if(_0xd7cd2c[_0x432d('0x10')]==='variable'&&_0xd7cd2c[_0x432d('0x9')]&&_0xd7cd2c[_0x432d('0x14')]){_0x1a6083[_0xd7cd2c[_0x432d('0x9')]]&&_0x26532f['push'](util[_0x432d('0x11')](_0x432d('0x12'),_0xd7cd2c['key'],_0x1a6083[_0xd7cd2c[_0x432d('0x9')]]));}else if(_0xd7cd2c['keyType']===_0x432d('0xb')&&_0xd7cd2c[_0x432d('0xc')]&&_0xd7cd2c[_0x432d('0xc')][_0x432d('0xd')]&&_0xd7cd2c[_0x432d('0x14')]){_0x1a6083[_0xd7cd2c['Variable']['name'][_0x432d('0xe')]()]&&_0x26532f['push'](util['format'](_0x432d('0x12'),_0xd7cd2c[_0x432d('0x14')],_0x1a6083[_0xd7cd2c[_0x432d('0xc')][_0x432d('0xd')][_0x432d('0xe')]()]));}}}}return _0x26532f[_0x432d('0x15')](_0x40cf39);};exports[_0x432d('0x16')]=function(_0x461cbd){var _0x38422d=_0x461cbd['slice'](-0x1);if(_0x38422d==='/'){_0x461cbd=_0x461cbd[_0x432d('0x17')](0x0,_0x461cbd[_0x432d('0x18')](_0x38422d));}return _0x461cbd;};exports[_0x432d('0x19')]=function(_0x5b018d){if(!_[_0x432d('0x1a')](_0x5b018d)&&_0x5b018d!==''){var _0x40a159=/^(([^<>()\[\]\\.,;:\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 _0x40a159[_0x432d('0x1b')](String(_0x5b018d)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x59ab=['string','push','content','type','variableName','customVariable','name','Variable','toLowerCase','toString','keyValue','keyType','key','%s:\x20%s','keyContent','variable','format','join','slice','substring','validateEmail','isNil','test','lodash','getString','length'];(function(_0x2b4a10,_0x2ab6b7){var _0x633983=function(_0x5423){while(--_0x5423){_0x2b4a10['push'](_0x2b4a10['shift']());}};_0x633983(++_0x2ab6b7);}(_0x59ab,0xcd));var _0xb59a=function(_0x51178d,_0x3f3cf2){_0x51178d=_0x51178d-0x0;var _0x531533=_0x59ab[_0x51178d];return _0x531533;};'use strict';var _=require(_0xb59a('0x0'));var util=require('util');exports[_0xb59a('0x1')]=function(_0x5d62ea,_0x1f67fa,_0x170411){var _0xdbe6ce=[];if(_0x5d62ea[_0xb59a('0x2')]>0x0){var _0x543930=_['sortBy'](_0x5d62ea,['id']);for(var _0x123553=0x0;_0x123553<_0x543930[_0xb59a('0x2')];_0x123553++){var _0x1f7b98=_0x543930[_0x123553];if(_0x1f7b98['type']===_0xb59a('0x3')){_0xdbe6ce[_0xb59a('0x4')](_0x1f7b98[_0xb59a('0x5')]);}else if(_0x1f7b98[_0xb59a('0x6')]==='variable'&&_0x1f7b98[_0xb59a('0x7')]){_0x1f67fa[_0x1f7b98[_0xb59a('0x7')]]&&_0xdbe6ce[_0xb59a('0x4')](_0x1f67fa[_0x1f7b98[_0xb59a('0x7')]]['toString']());}else if(_0x1f7b98[_0xb59a('0x6')]===_0xb59a('0x8')&&_0x1f7b98['Variable']&&_0x1f7b98['Variable'][_0xb59a('0x9')]){_0x1f67fa[_0x1f7b98['Variable'][_0xb59a('0x9')]['toLowerCase']()]&&_0xdbe6ce[_0xb59a('0x4')](_0x1f67fa[_0x1f7b98[_0xb59a('0xa')][_0xb59a('0x9')][_0xb59a('0xb')]()][_0xb59a('0xc')]());}else if(_0x1f7b98[_0xb59a('0x6')]===_0xb59a('0xd')){if(_0x1f7b98[_0xb59a('0xe')]===_0xb59a('0x3')&&_0x1f7b98[_0xb59a('0xf')]){_0xdbe6ce['push'](util['format'](_0xb59a('0x10'),_0x1f7b98[_0xb59a('0xf')],_0x1f7b98[_0xb59a('0x11')]));}else if(_0x1f7b98[_0xb59a('0xe')]===_0xb59a('0x12')&&_0x1f7b98[_0xb59a('0x7')]&&_0x1f7b98['key']){_0x1f67fa[_0x1f7b98[_0xb59a('0x7')]]&&_0xdbe6ce[_0xb59a('0x4')](util['format'](_0xb59a('0x10'),_0x1f7b98[_0xb59a('0xf')],_0x1f67fa[_0x1f7b98[_0xb59a('0x7')]]));}else if(_0x1f7b98['keyType']==='customVariable'&&_0x1f7b98[_0xb59a('0xa')]&&_0x1f7b98[_0xb59a('0xa')][_0xb59a('0x9')]&&_0x1f7b98['key']){_0x1f67fa[_0x1f7b98[_0xb59a('0xa')][_0xb59a('0x9')][_0xb59a('0xb')]()]&&_0xdbe6ce[_0xb59a('0x4')](util[_0xb59a('0x13')](_0xb59a('0x10'),_0x1f7b98['key'],_0x1f67fa[_0x1f7b98[_0xb59a('0xa')][_0xb59a('0x9')][_0xb59a('0xb')]()]));}}}}return _0xdbe6ce[_0xb59a('0x14')](_0x170411);};exports['stripTrailingSlash']=function(_0x39367f){var _0x46431b=_0x39367f[_0xb59a('0x15')](-0x1);if(_0x46431b==='/'){_0x39367f=_0x39367f[_0xb59a('0x16')](0x0,_0x39367f['lastIndexOf'](_0x46431b));}return _0x39367f;};exports[_0xb59a('0x17')]=function(_0x488a9a){if(!_[_0xb59a('0x18')](_0x488a9a)&&_0x488a9a!==''){var _0x5c72ba=/^(([^<>()\[\]\\.,;:\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 _0x5c72ba[_0xb59a('0x19')](String(_0x488a9a)[_0xb59a('0xb')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 9b6e86d..f097746 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');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 emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');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 emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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 0dac42d..78fdad0 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 _0x1788=['authType','password','username','%s/token:%s','token','Basic\x20%s','toString','base64','debug','stringify','length','map','forEach','includes','string','picklist','type','customField','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','inspect','unmanaged','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Subjects','getString','Descriptions','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.'];(function(_0x4ffd2e,_0x12bebc){var _0x540cdb=function(_0x5e69be){while(--_0x5e69be){_0x4ffd2e['push'](_0x4ffd2e['shift']());}};_0x540cdb(++_0x12bebc);}(_0x1788,0x190));var _0x8178=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1788[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x8178('0x0'));var rp=require(_0x8178('0x1'));var md5=require(_0x8178('0x2'));var util=require(_0x8178('0x3'));var Redis=require(_0x8178('0x4'));var intUtil=require(_0x8178('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zendesk');config['redis']=_[_0x8178('0x6')](config[_0x8178('0x7')],{'host':_0x8178('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8178('0x7')]));function emit(_0x2c9b6b,_0x370910,_0x4d6dd2){io['to'](_0x2c9b6b)[_0x8178('0x9')](_0x370910,_0x4d6dd2);}var headers={'Content-Type':'application/json','Accept':_0x8178('0xa')};function getTicket(_0x31f4c3,_0x31fec0,_0x151eaf,_0x3532e2,_0x2698dd){logger[_0x8178('0xb')](_0x8178('0xc'));return request({'uri':util[_0x8178('0xd')](_0x8178('0xe'),_0x31f4c3[_0x8178('0xf')]),'method':_0x8178('0x10'),'body':{'ticket':_[_0x8178('0x11')]({'requester_id':_0x151eaf['id'],'submitter_id':_0x31fec0?_0x31fec0['id']:undefined,'assignee_id':_0x31fec0?_0x31fec0['id']:undefined,'tags':getTags(_0x3532e2['Tags'],'name'),'subject':intUtil['getString'](_0x3532e2[_0x8178('0x12')],_0x2698dd,'\x20'),'description':intUtil[_0x8178('0x13')](_0x3532e2['Descriptions'],_0x2698dd,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8178('0x13')](_0x3532e2[_0x8178('0x14')],_0x2698dd,'\x0a')}},getCustomFields(_0x3532e2['Fields'],_0x2698dd))}})['then'](function(_0x24e97d){logger[_0x8178('0xb')](_0x8178('0x15'));return _0x24e97d['ticket'];});}function getUser(_0x43c2f2,_0x27aba5){if(intUtil[_0x8178('0x16')](_0x27aba5)){logger[_0x8178('0xb')](_0x8178('0x17'),_0x27aba5);return request({'uri':util['format']('%s/search.json',_0x43c2f2[_0x8178('0xf')]),'qs':{'query':util[_0x8178('0xd')](_0x8178('0x18'),_0x27aba5)}})[_0x8178('0x19')](function(_0x4dd6e4){if(_0x4dd6e4[_0x8178('0x1a')]){logger[_0x8178('0xb')](_0x8178('0x1b'));return _[_0x8178('0x1c')](_0x4dd6e4[_0x8178('0x1d')],{'email':_0x27aba5,'role':_0x8178('0x1e')});}else{logger[_0x8178('0xb')](_0x8178('0x1f'));return request({'uri':util['format'](_0x8178('0x20'),_0x43c2f2[_0x8178('0xf')])})[_0x8178('0x19')](function(_0x59ee41){logger[_0x8178('0xb')]('Admin\x20account\x20selected.');return _0x59ee41[_0x8178('0x21')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8178('0xd')](_0x8178('0x20'),_0x43c2f2['remoteUri'])})[_0x8178('0x19')](function(_0x2af3cc){logger[_0x8178('0xb')](_0x8178('0x22'));return _0x2af3cc[_0x8178('0x21')];});}}function getEndUser(_0x3a7fde,_0x10ec24,_0x31b786){logger[_0x8178('0xb')](_0x8178('0x23'),_0x31b786);return request({'uri':util[_0x8178('0xd')](_0x8178('0x24'),_0x3a7fde['remoteUri']),'qs':{'query':util['format'](_0x8178('0x25'),_0x31b786)}})[_0x8178('0x19')](function(_0x22489a){var _0x472210;if(_0x22489a[_0x8178('0x1d')]['length']){_0x22489a[_0x8178('0x1d')]=_[_0x8178('0x26')](_0x22489a[_0x8178('0x1d')],{'suspended':![],'role':'end-user'});if(_0x22489a[_0x8178('0x1d')]['length']){_0x472210=_['first'](_0x22489a['results']);}}if(_0x472210){logger[_0x8178('0xb')](_0x8178('0x27'));return _0x472210;}else{logger[_0x8178('0xb')](_0x8178('0x28'));return request({'uri':util[_0x8178('0xd')](_0x8178('0x29'),_0x3a7fde['remoteUri']),'method':_0x8178('0x10'),'body':{'user':{'role':_0x8178('0x2a'),'name':util['format']('Caller\x20-\x20%s',_0x10ec24||_0x31b786),'phone':_0x31b786}}})[_0x8178('0x19')](function(_0x500c02){logger[_0x8178('0xb')](_0x8178('0x2b'));return _0x500c02[_0x8178('0x21')];});}});}function getAuth(_0x5210e4){var _0x15c379;if(_0x5210e4[_0x8178('0x2c')]===_0x8178('0x2d')){_0x15c379=util[_0x8178('0xd')]('%s:%s',_0x5210e4[_0x8178('0x2e')],_0x5210e4['password']);}else if(_0x5210e4[_0x8178('0x2c')]==='token'){_0x15c379=util[_0x8178('0xd')](_0x8178('0x2f'),_0x5210e4[_0x8178('0x2e')],_0x5210e4[_0x8178('0x30')]);}return util[_0x8178('0xd')](_0x8178('0x31'),new Buffer(_0x15c379)[_0x8178('0x32')](_0x8178('0x33')));}function request(_0x42d63c){logger[_0x8178('0x34')]('[HTTP]',JSON[_0x8178('0x35')](_0x42d63c));return rp(_[_0x8178('0x6')](_0x42d63c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x43b74d,_0x18eeb8){var _0x4ed6da=[];if(_0x43b74d&&_0x43b74d[_0x8178('0x36')]>0x0){_0x4ed6da=_[_0x8178('0x37')](_0x43b74d,_0x18eeb8);}return _0x4ed6da;}function getCustomFields(_0x5ea81e,_0xc0fb4f){var _0x3fa6d7=[];var _0x402111={'custom_fields':[]};if(_0x5ea81e[_0x8178('0x36')]>0x0){_[_0x8178('0x38')](_0x5ea81e,function(_0x1a20e3){if(_[_0x8178('0x39')]([_0x8178('0x3a'),_0x8178('0x3b')],_0x1a20e3[_0x8178('0x3c')])&&_0x1a20e3['nameField']&&!_0x1a20e3[_0x8178('0x3d')]){_0x402111[_0x1a20e3['nameField']['toLowerCase']()]=_0x1a20e3[_0x8178('0x3e')][_0x8178('0x32')]();}else if(_['includes']([_0x8178('0x3a'),'picklist'],_0x1a20e3[_0x8178('0x3c')])&&_0x1a20e3[_0x8178('0x3f')]&&_0x1a20e3[_0x8178('0x3d')]){_0x402111[_0x8178('0x40')][_0x8178('0x41')]({'id':_0x1a20e3[_0x8178('0x3f')],'value':_0x1a20e3[_0x8178('0x3e')][_0x8178('0x32')]()});}else if(_0x1a20e3[_0x8178('0x3c')]===_0x8178('0x42')&&_0x1a20e3[_0x8178('0x43')]&&_0x1a20e3['idField']&&_0x1a20e3[_0x8178('0x3d')]){_0xc0fb4f[_0x1a20e3[_0x8178('0x43')]]&&_0x402111['custom_fields'][_0x8178('0x41')]({'id':_0x1a20e3[_0x8178('0x3f')],'value':_0xc0fb4f[_0x1a20e3[_0x8178('0x43')]][_0x8178('0x32')]()});}else if(_0x1a20e3[_0x8178('0x3c')]===_0x8178('0x44')&&_0x1a20e3[_0x8178('0x45')]&&_0x1a20e3[_0x8178('0x45')][_0x8178('0x46')]&&_0x1a20e3['idField']&&_0x1a20e3['customField']){_0xc0fb4f[_0x1a20e3['Variable']['name']['toLowerCase']()]&&_0x402111[_0x8178('0x40')]['push']({'id':_0x1a20e3['idField'],'value':_0xc0fb4f[_0x1a20e3[_0x8178('0x45')]['name'][_0x8178('0x47')]()][_0x8178('0x32')]()});}});}return _0x402111;}exports['queue']=function(_0x27cbbe,_0x49ed13,_0x446650,_0x4e8eae,_0x1b3dbf,_0x4f0e33){var _0x2e06d7,_0xcb6fb7;_0x4f0e33[_0x8178('0xf')]=intUtil[_0x8178('0x48')](_0x4f0e33[_0x8178('0xf')]);_0x4f0e33[_0x8178('0x49')]=intUtil[_0x8178('0x48')](_0x4f0e33[_0x8178('0x49')]);if(_0x1b3dbf&&_0x1b3dbf[_0x8178('0x4a')]){logger['info'](_0x8178('0x4b'),_0x8178('0x4c'));_0x49ed13[_0x8178('0x4d')]=util[_0x8178('0xd')](_0x8178('0x4e'),_0x4f0e33[_0x8178('0x49')],_0x49ed13[_0x8178('0x4f')],md5(_0x49ed13[_0x8178('0x4f')]));}else{_0x49ed13[_0x8178('0x4d')]='';}headers[_0x8178('0x50')]=getAuth(_0x4f0e33);return getUser(_0x4f0e33,_0x4e8eae[_0x8178('0x51')])[_0x8178('0x19')](function(_0x358fb7){_0x2e06d7=_0x358fb7;logger[_0x8178('0xb')](_0x8178('0x52'),_0x2e06d7['id']);return getEndUser(_0x4f0e33,_0x49ed13['calleridname'],_0x49ed13[_0x8178('0x53')]);})[_0x8178('0x19')](function(_0x1c5daf){_0xcb6fb7=_0x1c5daf;logger[_0x8178('0xb')]('The\x20Enduser\x20ID\x20is:',_0xcb6fb7['id']);return getTicket(_0x4f0e33,_0x2e06d7,_0xcb6fb7,_0x446650,_0x49ed13);})[_0x8178('0x19')](function(_0x14482e){if(_0x14482e){logger[_0x8178('0xb')](_0x8178('0x54'),_0x14482e['id']);switch(_0x4f0e33[_0x8178('0x3c')]){case'integrationTab':logger[_0x8178('0xb')](_0x8178('0x4b'),_0x8178('0x55'));return request({'uri':util[_0x8178('0xd')](_0x8178('0x56'),_0x4f0e33[_0x8178('0xf')],_0x2e06d7['id'],_0x14482e['id']),'method':_0x8178('0x10')});case _0x8178('0x57'):logger['info'](_0x8178('0x4b'),_0x8178('0x58'));emit(util[_0x8178('0xd')](_0x8178('0x59'),_0x4e8eae[_0x8178('0x46')]),_0x8178('0x5a'),{'uri':util[_0x8178('0xd')]('%s/agent/tickets/%s',_0x4f0e33['remoteUri'][_0x8178('0x5b')]('/api/v2',''),_0x14482e['id'])});break;default:logger['error'](_0x8178('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x8178('0x5c')](function(_0x367341){logger[_0x8178('0x5d')](_0x8178('0x5e'),util['inspect'](_0x367341,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x466934,_0x109385,_0x3b61be,_0x4dbb15,_0x4e1efc,_0x2930d3,_0xc27f8e){var _0x245a99,_0x339d4f;_0x2930d3[_0x8178('0xf')]=intUtil[_0x8178('0x48')](_0x2930d3[_0x8178('0xf')]);_0x2930d3['serverUrl']=intUtil[_0x8178('0x48')](_0x2930d3[_0x8178('0x49')]);if(_0xc27f8e&&_0xc27f8e[_0x8178('0x5f')]&&_0xc27f8e[_0x8178('0x5f')]!==_0x8178('0x60')){logger['info'](_0x8178('0x61'),_0x8178('0x4c'));_0x109385[_0x8178('0x4d')]=util[_0x8178('0xd')](_0x8178('0x4e'),_0x2930d3['serverUrl'],_0x109385[_0x8178('0x4f')],md5(_0x109385[_0x8178('0x4f')]));}headers['Authorization']=getAuth(_0x2930d3);return getUser(_0x2930d3,_0x4dbb15[_0x8178('0x51')])['then'](function(_0x625412){_0x245a99=_0x625412;logger[_0x8178('0xb')]('The\x20User\x20ID\x20is:',_0x245a99['id']);return getEndUser(_0x2930d3,_0x109385[_0x8178('0x62')],_0x109385[_0x8178('0x63')]);})[_0x8178('0x19')](function(_0x414785){_0x339d4f=_0x414785;logger['info'](_0x8178('0x64'),_0x339d4f['id']);return getTicket(_0x2930d3,_0x245a99,_0x339d4f,_0x3b61be,_0x109385);})[_0x8178('0x19')](function(_0x4b7c86){if(_0x4b7c86){logger[_0x8178('0xb')](_0x8178('0x54'),_0x4b7c86['id']);switch(_0x2930d3[_0x8178('0x3c')]){case _0x8178('0x65'):logger['info']('[OUTBOUND]',_0x8178('0x55'));return request({'uri':util[_0x8178('0xd')](_0x8178('0x56'),_0x2930d3[_0x8178('0xf')],_0x245a99['id'],_0x4b7c86['id']),'method':_0x8178('0x10')});case _0x8178('0x57'):logger[_0x8178('0xb')](_0x8178('0x61'),_0x8178('0x58'));emit(util['format'](_0x8178('0x59'),_0x4dbb15[_0x8178('0x46')]),'trigger:browser:url',{'uri':util[_0x8178('0xd')](_0x8178('0x66'),_0x2930d3['remoteUri'][_0x8178('0x5b')](_0x8178('0x67'),''),_0x4b7c86['id'])});break;default:logger[_0x8178('0x5d')](_0x8178('0x61'),_0x8178('0x68'));}}})['catch'](function(_0x3b4026){logger[_0x8178('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x8178('0x69')](_0x3b4026,{'showHidden':!![],'depth':null}));});};exports[_0x8178('0x6a')]=function(_0x125109,_0x138f35,_0x3ddbe2,_0x465c89,_0x508783,_0x3098ef){var _0x1ee78a,_0x131ee4;_0x3098ef[_0x8178('0xf')]=intUtil[_0x8178('0x48')](_0x3098ef[_0x8178('0xf')]);_0x3098ef['serverUrl']=intUtil[_0x8178('0x48')](_0x3098ef['serverUrl']);if(_0x508783&&_0x508783[_0x8178('0x4a')]){logger['info']('['+_0x138f35[_0x8178('0x6b')][_0x8178('0x6c')]()+']',_0x8178('0x4c'));_0x138f35[_0x8178('0x4d')]=util['format'](_0x8178('0x4e'),_0x3098ef[_0x8178('0x49')],_0x138f35[_0x8178('0x4f')],md5(_0x138f35['uniqueid']));}else{_0x138f35[_0x8178('0x4d')]='';}headers[_0x8178('0x50')]=getAuth(_0x3098ef);return getUser(_0x3098ef)[_0x8178('0x19')](function(_0x4987d6){_0x1ee78a=_0x4987d6;logger[_0x8178('0xb')](_0x8178('0x52'),_0x1ee78a['id']);return getEndUser(_0x3098ef,_0x138f35[_0x8178('0x6d')],_0x138f35[_0x8178('0x53')]);})[_0x8178('0x19')](function(_0x26d25a){_0x131ee4=_0x26d25a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x131ee4['id']);return getTicket(_0x3098ef,_0x1ee78a,_0x131ee4,_0x3ddbe2,_0x138f35);})[_0x8178('0x19')](function(_0x4f04c4){if(_0x4f04c4){logger['info'](_0x8178('0x54'),_0x4f04c4['id']);}})['catch'](function(_0x56c02e){logger[_0x8178('0x5d')]('['+_0x138f35[_0x8178('0x6b')][_0x8178('0x6c')]()+']'+_0x8178('0x6e'),util[_0x8178('0x69')](_0x56c02e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb459=['integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','replace','/api/v2','error','catch','inspect','outbound','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridnum','toUpperCase','lodash','request-promise','md5','./util','../../../../config/environment','zendesk','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','%s:%s','password','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','content','string','idField','custom_fields','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','The\x20Ticket\x20ID\x20is:'];(function(_0x3ba7fc,_0x2af626){var _0x43d8cd=function(_0x3cc864){while(--_0x3cc864){_0x3ba7fc['push'](_0x3ba7fc['shift']());}};_0x43d8cd(++_0x2af626);}(_0xb459,0xf4));var _0x9b45=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xb459[_0x543084];return _0x306a57;};'use strict';var _=require(_0x9b45('0x0'));var rp=require(_0x9b45('0x1'));var md5=require(_0x9b45('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x9b45('0x3'));var config=require(_0x9b45('0x4'));var logger=require('../../../../config/logger')(_0x9b45('0x5'));config[_0x9b45('0x6')]=_[_0x9b45('0x7')](config['redis'],{'host':_0x9b45('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9b45('0x6')]));function emit(_0x28fe73,_0x1d1020,_0x35e1c3){io['to'](_0x28fe73)[_0x9b45('0x9')](_0x1d1020,_0x35e1c3);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x43ec48,_0x330eeb,_0x32b756,_0x3206db,_0x3a671b){logger[_0x9b45('0xa')](_0x9b45('0xb'));return request({'uri':util[_0x9b45('0xc')](_0x9b45('0xd'),_0x43ec48[_0x9b45('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x32b756['id'],'submitter_id':_0x330eeb?_0x330eeb['id']:undefined,'assignee_id':_0x330eeb?_0x330eeb['id']:undefined,'tags':getTags(_0x3206db[_0x9b45('0xf')],_0x9b45('0x10')),'subject':intUtil[_0x9b45('0x11')](_0x3206db[_0x9b45('0x12')],_0x3a671b,'\x20'),'description':intUtil[_0x9b45('0x11')](_0x3206db['Descriptions'],_0x3a671b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9b45('0x11')](_0x3206db['Descriptions'],_0x3a671b,'\x0a')}},getCustomFields(_0x3206db[_0x9b45('0x13')],_0x3a671b))}})[_0x9b45('0x14')](function(_0x98b66e){logger['info'](_0x9b45('0x15'));return _0x98b66e['ticket'];});}function getUser(_0xf37d65,_0x519d1f){if(intUtil['validateEmail'](_0x519d1f)){logger[_0x9b45('0xa')](_0x9b45('0x16'),_0x519d1f);return request({'uri':util[_0x9b45('0xc')](_0x9b45('0x17'),_0xf37d65[_0x9b45('0xe')]),'qs':{'query':util[_0x9b45('0xc')](_0x9b45('0x18'),_0x519d1f)}})[_0x9b45('0x14')](function(_0x16ec7c){if(_0x16ec7c['count']){logger[_0x9b45('0xa')](_0x9b45('0x19'));return _[_0x9b45('0x1a')](_0x16ec7c[_0x9b45('0x1b')],{'email':_0x519d1f,'role':_0x9b45('0x1c')});}else{logger[_0x9b45('0xa')](_0x9b45('0x1d'));return request({'uri':util[_0x9b45('0xc')](_0x9b45('0x1e'),_0xf37d65[_0x9b45('0xe')])})[_0x9b45('0x14')](function(_0x4d4d9e){logger[_0x9b45('0xa')](_0x9b45('0x1f'));return _0x4d4d9e['user'];});}});}else{logger[_0x9b45('0xa')](_0x9b45('0x1d'));return request({'uri':util[_0x9b45('0xc')](_0x9b45('0x1e'),_0xf37d65[_0x9b45('0xe')])})[_0x9b45('0x14')](function(_0x18b43f){logger[_0x9b45('0xa')](_0x9b45('0x1f'));return _0x18b43f[_0x9b45('0x20')];});}}function getEndUser(_0x25387a,_0xf80a8f,_0x52da9e){logger[_0x9b45('0xa')](_0x9b45('0x21'),_0x52da9e);return request({'uri':util[_0x9b45('0xc')](_0x9b45('0x17'),_0x25387a[_0x9b45('0xe')]),'qs':{'query':util[_0x9b45('0xc')](_0x9b45('0x22'),_0x52da9e)}})[_0x9b45('0x14')](function(_0x3e9af8){var _0x301170;if(_0x3e9af8[_0x9b45('0x1b')][_0x9b45('0x23')]){_0x3e9af8[_0x9b45('0x1b')]=_['filter'](_0x3e9af8[_0x9b45('0x1b')],{'suspended':![],'role':_0x9b45('0x24')});if(_0x3e9af8[_0x9b45('0x1b')]['length']){_0x301170=_[_0x9b45('0x25')](_0x3e9af8['results']);}}if(_0x301170){logger[_0x9b45('0xa')](_0x9b45('0x26'));return _0x301170;}else{logger[_0x9b45('0xa')](_0x9b45('0x27'));return request({'uri':util[_0x9b45('0xc')](_0x9b45('0x28'),_0x25387a['remoteUri']),'method':_0x9b45('0x29'),'body':{'user':{'role':_0x9b45('0x24'),'name':util['format'](_0x9b45('0x2a'),_0xf80a8f||_0x52da9e),'phone':_0x52da9e}}})[_0x9b45('0x14')](function(_0x25c7cd){logger[_0x9b45('0xa')](_0x9b45('0x2b'));return _0x25c7cd[_0x9b45('0x20')];});}});}function getAuth(_0x5bb14d){var _0x485716;if(_0x5bb14d['authType']==='password'){_0x485716=util[_0x9b45('0xc')](_0x9b45('0x2c'),_0x5bb14d['username'],_0x5bb14d[_0x9b45('0x2d')]);}else if(_0x5bb14d[_0x9b45('0x2e')]===_0x9b45('0x2f')){_0x485716=util[_0x9b45('0xc')](_0x9b45('0x30'),_0x5bb14d['username'],_0x5bb14d['token']);}return util[_0x9b45('0xc')](_0x9b45('0x31'),new Buffer(_0x485716)[_0x9b45('0x32')](_0x9b45('0x33')));}function request(_0x42c218){logger[_0x9b45('0x34')](_0x9b45('0x35'),JSON[_0x9b45('0x36')](_0x42c218));return rp(_['defaults'](_0x42c218,{'method':_0x9b45('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x23d27e,_0x4a40cc){var _0x96dd05=[];if(_0x23d27e&&_0x23d27e[_0x9b45('0x23')]>0x0){_0x96dd05=_[_0x9b45('0x38')](_0x23d27e,_0x4a40cc);}return _0x96dd05;}function getCustomFields(_0x5847c5,_0x756fa7){var _0x10b25d=[];var _0xb0dc5d={'custom_fields':[]};if(_0x5847c5['length']>0x0){_[_0x9b45('0x39')](_0x5847c5,function(_0x33ccda){if(_[_0x9b45('0x3a')](['string',_0x9b45('0x3b')],_0x33ccda[_0x9b45('0x3c')])&&_0x33ccda[_0x9b45('0x3d')]&&!_0x33ccda[_0x9b45('0x3e')]){_0xb0dc5d[_0x33ccda['nameField']['toLowerCase']()]=_0x33ccda[_0x9b45('0x3f')][_0x9b45('0x32')]();}else if(_[_0x9b45('0x3a')]([_0x9b45('0x40'),'picklist'],_0x33ccda[_0x9b45('0x3c')])&&_0x33ccda[_0x9b45('0x41')]&&_0x33ccda[_0x9b45('0x3e')]){_0xb0dc5d[_0x9b45('0x42')][_0x9b45('0x43')]({'id':_0x33ccda[_0x9b45('0x41')],'value':_0x33ccda['content'][_0x9b45('0x32')]()});}else if(_0x33ccda[_0x9b45('0x3c')]==='variable'&&_0x33ccda[_0x9b45('0x44')]&&_0x33ccda['idField']&&_0x33ccda[_0x9b45('0x3e')]){_0x756fa7[_0x33ccda[_0x9b45('0x44')]]&&_0xb0dc5d[_0x9b45('0x42')][_0x9b45('0x43')]({'id':_0x33ccda[_0x9b45('0x41')],'value':_0x756fa7[_0x33ccda[_0x9b45('0x44')]][_0x9b45('0x32')]()});}else if(_0x33ccda['type']===_0x9b45('0x45')&&_0x33ccda[_0x9b45('0x46')]&&_0x33ccda[_0x9b45('0x46')][_0x9b45('0x10')]&&_0x33ccda[_0x9b45('0x41')]&&_0x33ccda[_0x9b45('0x3e')]){_0x756fa7[_0x33ccda[_0x9b45('0x46')][_0x9b45('0x10')]['toLowerCase']()]&&_0xb0dc5d['custom_fields'][_0x9b45('0x43')]({'id':_0x33ccda[_0x9b45('0x41')],'value':_0x756fa7[_0x33ccda[_0x9b45('0x46')][_0x9b45('0x10')][_0x9b45('0x47')]()][_0x9b45('0x32')]()});}});}return _0xb0dc5d;}exports[_0x9b45('0x48')]=function(_0x1c7ee2,_0x3bd454,_0x4730cb,_0x1a5d7b,_0x3d4c43,_0x390d3b){var _0x40bc7e,_0x38f618;_0x390d3b['remoteUri']=intUtil[_0x9b45('0x49')](_0x390d3b[_0x9b45('0xe')]);_0x390d3b[_0x9b45('0x4a')]=intUtil[_0x9b45('0x49')](_0x390d3b['serverUrl']);if(_0x3d4c43&&_0x3d4c43[_0x9b45('0x4b')]){logger['info'](_0x9b45('0x4c'),_0x9b45('0x4d'));_0x3bd454[_0x9b45('0x4e')]=util[_0x9b45('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x390d3b[_0x9b45('0x4a')],_0x3bd454[_0x9b45('0x4f')],md5(_0x3bd454[_0x9b45('0x4f')]));}else{_0x3bd454['recordingURL']='';}headers['Authorization']=getAuth(_0x390d3b);return getUser(_0x390d3b,_0x1a5d7b[_0x9b45('0x50')])['then'](function(_0x5a922f){_0x40bc7e=_0x5a922f;logger[_0x9b45('0xa')]('The\x20User\x20ID\x20is:',_0x40bc7e['id']);return getEndUser(_0x390d3b,_0x3bd454[_0x9b45('0x51')],_0x3bd454['calleridnum']);})[_0x9b45('0x14')](function(_0x3a66ed){_0x38f618=_0x3a66ed;logger[_0x9b45('0xa')]('The\x20Enduser\x20ID\x20is:',_0x38f618['id']);return getTicket(_0x390d3b,_0x40bc7e,_0x38f618,_0x4730cb,_0x3bd454);})[_0x9b45('0x14')](function(_0x46a73b){if(_0x46a73b){logger[_0x9b45('0xa')](_0x9b45('0x52'),_0x46a73b['id']);switch(_0x390d3b[_0x9b45('0x3c')]){case _0x9b45('0x53'):logger[_0x9b45('0xa')](_0x9b45('0x4c'),_0x9b45('0x54'));return request({'uri':util[_0x9b45('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x390d3b[_0x9b45('0xe')],_0x40bc7e['id'],_0x46a73b['id']),'method':'POST'});case _0x9b45('0x55'):logger['info'](_0x9b45('0x4c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9b45('0x56'),_0x1a5d7b[_0x9b45('0x10')]),_0x9b45('0x57'),{'uri':util[_0x9b45('0xc')]('%s/agent/tickets/%s',_0x390d3b[_0x9b45('0xe')][_0x9b45('0x58')](_0x9b45('0x59'),''),_0x46a73b['id'])});break;default:logger[_0x9b45('0x5a')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x9b45('0x5b')](function(_0x30e4ab){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9b45('0x5c')](_0x30e4ab,{'showHidden':!![],'depth':null}));});};exports[_0x9b45('0x5d')]=function(_0x42651a,_0x2d2705,_0x35ae2c,_0x5919f0,_0x1d4b6c,_0x5d96fd,_0x5e4c64){var _0x5231da,_0x5e85b8;_0x5d96fd['remoteUri']=intUtil['stripTrailingSlash'](_0x5d96fd['remoteUri']);_0x5d96fd[_0x9b45('0x4a')]=intUtil[_0x9b45('0x49')](_0x5d96fd['serverUrl']);if(_0x5e4c64&&_0x5e4c64[_0x9b45('0x5e')]&&_0x5e4c64[_0x9b45('0x5e')]!=='none'){logger[_0x9b45('0xa')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2d2705[_0x9b45('0x4e')]=util['format'](_0x9b45('0x5f'),_0x5d96fd[_0x9b45('0x4a')],_0x2d2705[_0x9b45('0x4f')],md5(_0x2d2705['uniqueid']));}headers['Authorization']=getAuth(_0x5d96fd);return getUser(_0x5d96fd,_0x5919f0[_0x9b45('0x50')])['then'](function(_0x308539){_0x5231da=_0x308539;logger[_0x9b45('0xa')](_0x9b45('0x60'),_0x5231da['id']);return getEndUser(_0x5d96fd,_0x2d2705[_0x9b45('0x61')],_0x2d2705[_0x9b45('0x62')]);})['then'](function(_0x5ad259){_0x5e85b8=_0x5ad259;logger[_0x9b45('0xa')](_0x9b45('0x63'),_0x5e85b8['id']);return getTicket(_0x5d96fd,_0x5231da,_0x5e85b8,_0x35ae2c,_0x2d2705);})[_0x9b45('0x14')](function(_0x157cc3){if(_0x157cc3){logger[_0x9b45('0xa')](_0x9b45('0x52'),_0x157cc3['id']);switch(_0x5d96fd[_0x9b45('0x3c')]){case _0x9b45('0x53'):logger[_0x9b45('0xa')](_0x9b45('0x64'),_0x9b45('0x54'));return request({'uri':util['format'](_0x9b45('0x65'),_0x5d96fd['remoteUri'],_0x5231da['id'],_0x157cc3['id']),'method':'POST'});case'newTab':logger[_0x9b45('0xa')](_0x9b45('0x64'),_0x9b45('0x66'));emit(util[_0x9b45('0xc')](_0x9b45('0x56'),_0x5919f0[_0x9b45('0x10')]),'trigger:browser:url',{'uri':util[_0x9b45('0xc')](_0x9b45('0x67'),_0x5d96fd[_0x9b45('0xe')][_0x9b45('0x58')](_0x9b45('0x59'),''),_0x157cc3['id'])});break;default:logger[_0x9b45('0x5a')](_0x9b45('0x64'),_0x9b45('0x68'));}}})[_0x9b45('0x5b')](function(_0x1f8ea0){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x9b45('0x5c')](_0x1f8ea0,{'showHidden':!![],'depth':null}));});};exports[_0x9b45('0x69')]=function(_0x529a67,_0x5ab807,_0x5546b0,_0x141539,_0x212708,_0x5c64d6){var _0x111560,_0xe9946a;_0x5c64d6['remoteUri']=intUtil['stripTrailingSlash'](_0x5c64d6[_0x9b45('0xe')]);_0x5c64d6[_0x9b45('0x4a')]=intUtil['stripTrailingSlash'](_0x5c64d6[_0x9b45('0x4a')]);if(_0x212708&&_0x212708[_0x9b45('0x4b')]){logger[_0x9b45('0xa')]('['+_0x5ab807[_0x9b45('0x6a')]['toUpperCase']()+']',_0x9b45('0x4d'));_0x5ab807[_0x9b45('0x4e')]=util['format'](_0x9b45('0x5f'),_0x5c64d6[_0x9b45('0x4a')],_0x5ab807[_0x9b45('0x4f')],md5(_0x5ab807[_0x9b45('0x4f')]));}else{_0x5ab807[_0x9b45('0x4e')]='';}headers['Authorization']=getAuth(_0x5c64d6);return getUser(_0x5c64d6)[_0x9b45('0x14')](function(_0x4c329c){_0x111560=_0x4c329c;logger[_0x9b45('0xa')]('The\x20User\x20ID\x20is:',_0x111560['id']);return getEndUser(_0x5c64d6,_0x5ab807[_0x9b45('0x51')],_0x5ab807[_0x9b45('0x6b')]);})[_0x9b45('0x14')](function(_0x552613){_0xe9946a=_0x552613;logger[_0x9b45('0xa')](_0x9b45('0x63'),_0xe9946a['id']);return getTicket(_0x5c64d6,_0x111560,_0xe9946a,_0x5546b0,_0x5ab807);})['then'](function(_0x5e20e5){if(_0x5e20e5){logger['info'](_0x9b45('0x52'),_0x5e20e5['id']);}})[_0x9b45('0x5b')](function(_0x403cb3){logger[_0x9b45('0x5a')]('['+_0x5ab807[_0x9b45('0x6a')][_0x9b45('0x6c')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x403cb3,{'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 d3714f5..f7686eb 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 _0x1daf=['POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','Rejected','Abandoned','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','stack','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','recordingURL','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','calleridname','lodash','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','socket.io-emitter','redis','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','content','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType'];(function(_0x35a802,_0x98a675){var _0x4e53dd=function(_0xae9c04){while(--_0xae9c04){_0x35a802['push'](_0x35a802['shift']());}};_0x4e53dd(++_0x98a675);}(_0x1daf,0x17c));var _0xf1da=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1daf[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf1da('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf1da('0x1'));var intUtil=require(_0xf1da('0x2'));var moment=require(_0xf1da('0x3'));var Redis=require('ioredis');var BPromise=require(_0xf1da('0x4'));var config=require(_0xf1da('0x5'));var logger=require(_0xf1da('0x6'))(_0xf1da('0x7'));config['redis']=_[_0xf1da('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf1da('0x9'))(new Redis(config[_0xf1da('0xa')]));function emit(_0x1955e5,_0x487131,_0x4863de){io['to'](_0x1955e5)[_0xf1da('0xb')](_0x487131,_0x4863de);}function request(_0xb4b500){logger[_0xf1da('0xc')](_0xf1da('0xd'),JSON[_0xf1da('0xe')](_0xb4b500));return rp(_0xb4b500);}function getCustomFields(_0x4157de,_0xf6372){var _0x13b188={};if(_0x4157de[_0xf1da('0xf')]>0x0){_[_0xf1da('0x10')](_0x4157de,function(_0x8e1272){if(_[_0xf1da('0x11')]([_0xf1da('0x12'),_0xf1da('0x13')],_0x8e1272[_0xf1da('0x14')])&&_0x8e1272['idField']){_0x13b188[_0x8e1272['idField']]=_0x8e1272[_0xf1da('0x15')][_0xf1da('0x16')]();}else if(_0x8e1272[_0xf1da('0x14')]===_0xf1da('0x17')&&_0x8e1272[_0xf1da('0x18')]&&_0x8e1272[_0xf1da('0x19')]&&_0xf6372[_0x8e1272[_0xf1da('0x18')]]){_0x13b188[_0x8e1272[_0xf1da('0x19')]]=_0xf6372[_0x8e1272[_0xf1da('0x18')]][_0xf1da('0x16')]();}else if(_0x8e1272[_0xf1da('0x14')]===_0xf1da('0x1a')&&_0x8e1272[_0xf1da('0x1b')]&&_0x8e1272[_0xf1da('0x1b')]['name']&&_0x8e1272[_0xf1da('0x19')]&&_0xf6372[_0x8e1272[_0xf1da('0x1b')][_0xf1da('0x1c')][_0xf1da('0x1d')]()]){_0x13b188[_0x8e1272[_0xf1da('0x19')]]=_0xf6372[_0x8e1272[_0xf1da('0x1b')][_0xf1da('0x1c')][_0xf1da('0x1d')]()][_0xf1da('0x16')]();}});}return _0x13b188;}function getName(_0x2ccf4c){if(_0x2ccf4c[_0xf1da('0x1e')]('\x20')>0x0){var _0x436d66=_0x2ccf4c[_0xf1da('0x1f')](/ (.+)/);if(_0x436d66[0x1]){return _0x436d66;}}return[_0x2ccf4c,_0x2ccf4c];}var accountsTokens={};function getAccessToken(_0x484a39){return new Promise(function(_0x15c82,_0x284693){if(!_['isNil'](accountsTokens[_0x484a39['id']])&&!_['isNil'](accountsTokens[_0x484a39['id']][_0xf1da('0x20')])){if(moment()[_0xf1da('0x21')](accountsTokens[_0x484a39['id']]['expires_in'])){_0x15c82(accountsTokens[_0x484a39['id']][_0xf1da('0x20')]);}}var _0x3b001c;switch(_0x484a39[_0xf1da('0x22')]){case'US':_0x3b001c=_0xf1da('0x23');break;case'AU':_0x3b001c='https://accounts.zoho.com.au';break;case'EU':_0x3b001c=_0xf1da('0x24');break;case'IN':_0x3b001c='https://accounts.zoho.in';break;case'CN':_0x3b001c=_0xf1da('0x25');break;default:_0x3b001c='https://accounts.zoho.eu';break;}var _0x4de0d1={'method':'POST','uri':_0x3b001c+'/oauth/v2/token','qs':{'refresh_token':_0x484a39[_0xf1da('0x26')],'client_id':_0x484a39[_0xf1da('0x27')],'client_secret':_0x484a39[_0xf1da('0x28')],'grant_type':_0xf1da('0x29')},'json':!![]};return rp(_0x4de0d1)[_0xf1da('0x2a')](function(_0x6bc464){accountsTokens[_0x484a39['id']]={'access_token':_0x6bc464[_0xf1da('0x20')],'expires_in':moment()[_0xf1da('0x2b')](_0x6bc464[_0xf1da('0x2c')],_0xf1da('0x2d'))};_0x15c82(_0x6bc464['access_token']);})['catch'](function(_0x4f161c){logger[_0xf1da('0x2e')](_0xf1da('0x2f'),_0x4f161c['stack']);_0x284693(_0x4f161c);});});}function getUser(_0x97cd6d,_0x236df4,_0x24158c,_0x51c058){logger[_0xf1da('0x30')](_0xf1da('0x31'));return request({'method':_0xf1da('0x32'),'uri':util[_0xf1da('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x236df4),'qs':{'type':_0xf1da('0x34')},'headers':{'Authorization':_0xf1da('0x35')+_0x97cd6d},'json':!![]})[_0xf1da('0x2a')](function(_0x117ab7){if(_0x117ab7['users']){var _0x36a4a2=-0x1;if(_[_0xf1da('0x36')](_0x117ab7[_0xf1da('0x37')])){if(!_[_0xf1da('0x38')](_0x51c058)){_0x36a4a2=_[_0xf1da('0x39')](_0x117ab7[_0xf1da('0x37')],function(_0xa88429){return _0xa88429[_0xf1da('0x3a')]===_0x51c058;});}if(_0x36a4a2>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xf1da('0x30')](_0xf1da('0x3b'));_0x36a4a2=_[_0xf1da('0x39')](_0x117ab7[_0xf1da('0x37')],function(_0x3535f3){return _0x3535f3[_0xf1da('0x3c')][_0xf1da('0x1c')]==='Administrator';});}return _0x117ab7[_0xf1da('0x37')][_0x36a4a2];}else{if(_0x117ab7['user'][_0xf1da('0x3c')][_0xf1da('0x1c')]==='Administrator'){logger['info']('Using\x20the\x20admin\x20account!');user=_0x117ab7[_0xf1da('0x3d')];return user;}else{logger[_0xf1da('0x2e')](_0xf1da('0x3e'),JSON[_0xf1da('0xe')](_0x117ab7));throw new Error(_0xf1da('0x3f')+JSON[_0xf1da('0xe')](_0x117ab7));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf1da('0xe')](_0x117ab7));throw new Error(_0xf1da('0x3f')+JSON[_0xf1da('0xe')](_0x117ab7));}})[_0xf1da('0x40')](function(_0x32ad21){console[_0xf1da('0x2e')](_0x32ad21);});}function getZohoUser(_0x37b969,_0x26a1fd){return new BPromise(function(_0x3b7091,_0x13cdb0){request(_0x37b969)['then'](function(_0x155987){var _0x19a839=null;if(_0x155987){_0x19a839=_0x155987[_0xf1da('0x41')][0x0];_0x19a839[_0xf1da('0x42')]=_0x26a1fd;}_0x3b7091(_0x19a839);})[_0xf1da('0x40')](function(_0x156a9c){_0x13cdb0(_0x156a9c);});});}function createEndUser(_0x588bbd,_0x294714,_0x4633a9,_0x5716f6,_0x284686,_0x4855f3){var _0x4633a9=getName(_0x4633a9);return request({'method':_0xf1da('0x43'),'uri':_0xf1da('0x44')+_0x294714+'/crm/v2/'+_[_0xf1da('0x45')](_0x4855f3[_0xf1da('0x46')])+'s','body':{'data':[{'Last_Name':_0x4633a9[0x1],'First_Name':_0x4633a9[0x0],'Phone':_0x5716f6,'Owner':{'name':!_[_0xf1da('0x38')](_0x284686[_0xf1da('0x47')][_0xf1da('0x1c')])?_0x284686[_0xf1da('0x47')][_0xf1da('0x1c')]:!_[_0xf1da('0x38')](_0x284686[_0xf1da('0x48')])?_0x284686['first_name']+'\x20'+_0x284686[_0xf1da('0x49')]:_0x284686['last_name'],'id':_0x284686['id']}}]},'headers':{'Authorization':_0xf1da('0x35')+_0x588bbd},'json':!![]})[_0xf1da('0x2a')](function(_0x130258){if(_0x130258&&_0x130258[_0xf1da('0x41')][0x0][_0xf1da('0x4a')]==='SUCCESS'){var _0x4bff7a=_0x130258['data'][0x0][_0xf1da('0x4b')];_0x4bff7a[_0xf1da('0x42')]=_[_0xf1da('0x45')](_0x4855f3['moduleCreate'])+'s';return _0x4bff7a;}logger[_0xf1da('0x2e')](_0xf1da('0x3e'),JSON[_0xf1da('0xe')](data));throw new Error(_0xf1da('0x4c')+JSON[_0xf1da('0xe')](data));})[_0xf1da('0x40')](function(_0x49faee){console[_0xf1da('0x4d')](_0xf1da('0x4e'),_0x49faee);});}function getEndUser(_0x2a8fed,_0x32f80d,_0x50e78,_0x4e8af8,_0xabab90,_0x165848,_0x122e1d){var _0x23131b={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a8fed},'json':!![]};switch(_0x122e1d[_0xf1da('0x4f')]){case'contact_lead':_0x23131b['uri']=_0xf1da('0x44')+_0x32f80d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xabab90+'))';return getZohoUser(_0x23131b,'Contacts')['then'](function(_0x30a0dc){if(_0x30a0dc)return _0x30a0dc;_0x23131b['uri']=_0xf1da('0x44')+_0x32f80d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xabab90+'))';return getZohoUser(_0x23131b,'Leads')[_0xf1da('0x2a')](function(_0xf69f79){if(_0xf69f79)return _0xf69f79;if(_0x122e1d['moduleCreate']!='nothing'){return createEndUser(_0x2a8fed,_0x32f80d,_0x4e8af8,_0xabab90,_0x165848,_0x122e1d);}else{return{};}});});break;case'contact':_0x23131b[_0xf1da('0x50')]=_0xf1da('0x44')+_0x32f80d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xabab90+'))';return getZohoUser(_0x23131b,_0xf1da('0x51'))[_0xf1da('0x2a')](function(_0x1ca266){if(_0x1ca266)return _0x1ca266;if(_0x122e1d[_0xf1da('0x46')]!=_0xf1da('0x52')){return createEndUser(_0x2a8fed,_0x32f80d,_0x4e8af8,_0xabab90,_0x165848,_0x122e1d);}else{return{};}});break;case _0xf1da('0x53'):_0x23131b[_0xf1da('0x50')]='https://www.zohoapis.'+_0x32f80d+_0xf1da('0x54')+_0xabab90+'))';return getZohoUser(_0x23131b,_0xf1da('0x55'))['then'](function(_0x147d77){if(_0x147d77)return _0x147d77;if(_0x122e1d[_0xf1da('0x46')]!=_0xf1da('0x52')){return createEndUser(_0x2a8fed,_0x32f80d,_0x4e8af8,_0xabab90,_0x165848,_0x122e1d);}else{return{};}});break;}}function getCall(_0x492b53,_0x3f4f83,_0x130096,_0x32bd30,_0x5b89e8,_0x39ff53,_0x380a84,_0x5ee05b){logger[_0xf1da('0x30')](_0xf1da('0x56'));var _0x367108={};_0x367108['Owner']={'name':!_['isNil'](_0x32bd30[_0xf1da('0x47')][_0xf1da('0x1c')])&&!_[_0xf1da('0x38')](_0x32bd30[_0xf1da('0x3c')][_0xf1da('0x1c')])&&_0x32bd30[_0xf1da('0x3c')][_0xf1da('0x1c')]===_0xf1da('0x57')?_0x32bd30[_0xf1da('0x47')][_0xf1da('0x1c')]:!_[_0xf1da('0x38')](_0x32bd30[_0xf1da('0x48')])?_0x32bd30[_0xf1da('0x48')]+'\x20'+_0x32bd30[_0xf1da('0x49')]:_0x32bd30[_0xf1da('0x49')],'id':_0x32bd30['id']};_0x367108[_0xf1da('0x58')]=intUtil[_0xf1da('0x59')](_0x39ff53[_0xf1da('0x5a')],_0x380a84,'\x20');_0x367108[_0xf1da('0x5b')]=intUtil[_0xf1da('0x59')](_0x39ff53['Descriptions'],_0x380a84,'\x0a');if(_0x5b89e8['enduserType']===_0xf1da('0x51')){_0x367108[_0xf1da('0x5c')]={'name':!_['isNil'](_0x5b89e8[_0xf1da('0x5d')])?_0x5b89e8[_0xf1da('0x5d')]:!_['isNil'](_0x5b89e8[_0xf1da('0x5e')])?_0x5b89e8['First_Name']+'\x20'+_0x5b89e8['Last_Name']:_0x5b89e8[_0xf1da('0x5f')],'id':_0x5b89e8['id']};}if(_0x5b89e8[_0xf1da('0x42')]===_0xf1da('0x55')){_0x367108[_0xf1da('0x60')]={'name':!_[_0xf1da('0x38')](_0x5b89e8['Full_Name'])?_0x5b89e8[_0xf1da('0x5d')]:!_[_0xf1da('0x38')](_0x5b89e8[_0xf1da('0x5e')])?_0x5b89e8[_0xf1da('0x5e')]+'\x20'+_0x5b89e8[_0xf1da('0x5f')]:_0x5b89e8[_0xf1da('0x5f')],'id':_0x5b89e8['id']};_0x367108['$se_module']=_[_0xf1da('0x45')](_0x5b89e8[_0xf1da('0x42')]);}if(_0x380a84['talktime']){_0x367108[_0xf1da('0x61')]=moment[_0xf1da('0x62')](parseInt(_0x380a84['talktime'])*0x3e8)[_0xf1da('0x33')](_0xf1da('0x63'));}else if(_0x380a84[_0xf1da('0x64')]&&_0x380a84['endtime']){_0x367108[_0xf1da('0x61')]=moment['utc'](moment(_0x380a84[_0xf1da('0x65')],_0xf1da('0x66'))[_0xf1da('0x67')](moment(_0x380a84[_0xf1da('0x68')],'YYYY-MM-DDTHH:mm:ss')))[_0xf1da('0x33')](_0xf1da('0x63'));}switch(_0x380a84[_0xf1da('0x69')]){case'called':_0x367108[_0xf1da('0x6a')]=_0xf1da('0x6b');break;case _0xf1da('0x6c'):case _0xf1da('0x6d'):_0x367108[_0xf1da('0x6a')]=_0xf1da('0x6e');break;case'rejected':_0x367108[_0xf1da('0x6a')]=_0xf1da('0x6f');break;case'abandoned':_0x367108['Call_Result']=_0xf1da('0x70');break;case'timeout':_0x367108[_0xf1da('0x6a')]='Timeout';default:}_0x367108[_0xf1da('0x71')]=(_0x5ee05b==='outbound'?moment(_0x380a84[_0xf1da('0x68')])[_0xf1da('0x33')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x380a84[_0xf1da('0x72')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xf1da('0x33')](_0xf1da('0x66'));_0x367108[_0xf1da('0x73')]=_0x5ee05b||_0xf1da('0x74');_0x367108=_[_0xf1da('0x75')](_0x367108,getCustomFields(_0x39ff53[_0xf1da('0x76')],_0x380a84));return request({'method':_0xf1da('0x43'),'uri':_0xf1da('0x44')+_0x3f4f83+_0xf1da('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x492b53},'body':{'data':[_0x367108]},'json':!![]})[_0xf1da('0x2a')](function(_0x26d0ad){if(_0x26d0ad&&_0x26d0ad['data'][0x0]['code']==='SUCCESS'){logger[_0xf1da('0x30')]('Call\x20created!');return{'id':_0x26d0ad[_0xf1da('0x41')][0x0]['details']['id']};}})[_0xf1da('0x40')](function(_0x3b0833){logger[_0xf1da('0x30')](_0xf1da('0x78'),_0x3b0833[_0xf1da('0x79')]);console['log'](_0xf1da('0x78'),_0x3b0833);});}exports['queue']=function(_0x4c71a7,_0x4a7996,_0x5c1dfc,_0x3acca7,_0x4b52a8,_0xad491c){var _0x83adb1,_0x2f9cdc,_0x431799;_0xad491c[_0xf1da('0x7a')]=intUtil[_0xf1da('0x7b')](_0xad491c[_0xf1da('0x7a')]);_0xad491c['serverUrl']=intUtil[_0xf1da('0x7b')](_0xad491c[_0xf1da('0x7c')]);if(_0x4b52a8&&_0x4b52a8['monitor_format']){logger[_0xf1da('0x30')](_0xf1da('0x7d'),_0xf1da('0x7e'));_0x4a7996['recordingURL']=_0xad491c[_0xf1da('0x7c')]+_0xf1da('0x7f')+_0x4a7996[_0xf1da('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x4a7996[_0xf1da('0x80')]);}else{_0x4a7996[_0xf1da('0x81')]='';}var _0x13117a=_0xad491c['host']==='zoho.eu'?'eu':_0xf1da('0x82');return getAccessToken(_0xad491c)[_0xf1da('0x2a')](function(_0x492cec){_0x431799=_0x492cec;return getUser(_0x431799,_0x13117a,_0xad491c,_0x3acca7['email']);})[_0xf1da('0x2a')](function(_0x47a5db){_0x83adb1=_0x47a5db;logger[_0xf1da('0x30')](_0xf1da('0x83'),_0x83adb1['id']);return getEndUser(_0x431799,_0x13117a,_0xad491c,_0x4a7996['calleridname'],_0x4a7996[_0xf1da('0x84')],_0x83adb1,_0x5c1dfc);})[_0xf1da('0x2a')](function(_0x4d1468){_0x2f9cdc=_0x4d1468;return getCall(_0x431799,_0x13117a,_0xad491c,_0x83adb1,_0x2f9cdc,_0x5c1dfc,_0x4a7996,_0xf1da('0x74'));})[_0xf1da('0x2a')](function(_0xafb15f){if(_0xafb15f){logger['info'](_0xf1da('0x85'),_0xafb15f['id']);logger[_0xf1da('0x30')](_0xf1da('0x7d'),_0xf1da('0x86'));emit(util['format'](_0xf1da('0x87'),_0x3acca7[_0xf1da('0x1c')]),'trigger:browser:url',{'uri':'https://crm.'+_0xad491c[_0xf1da('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0xafb15f['id']});}})[_0xf1da('0x40')](function(_0x16b5a4){logger[_0xf1da('0x2e')](_0xf1da('0x7d'),JSON['stringify'](_0x16b5a4));});};exports[_0xf1da('0x88')]=function(_0x96b773,_0x301e5f,_0x1b9ff6,_0x2cfc44,_0xbcd4bb,_0x40d339,_0x1de0fa){var _0x9943ca,_0x2f4a8d,_0x53a60e;_0x40d339[_0xf1da('0x7a')]=intUtil[_0xf1da('0x7b')](_0x40d339[_0xf1da('0x7a')]);_0x40d339[_0xf1da('0x7c')]=intUtil[_0xf1da('0x7b')](_0x40d339[_0xf1da('0x7c')]);if(_0x1de0fa&&_0x1de0fa[_0xf1da('0x89')]&&_0x1de0fa['recordingFormat']!==_0xf1da('0x8a')){logger['info'](_0xf1da('0x8b'),_0xf1da('0x7e'));_0x301e5f['recordingURL']=_0x40d339[_0xf1da('0x7c')]+'/api/voice/recordings/'+_0x301e5f[_0xf1da('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x301e5f[_0xf1da('0x80')]);}var _0x46d591=_0x40d339[_0xf1da('0x7a')]===_0xf1da('0x8c')?'eu':'com';return getAccessToken(_0x40d339)[_0xf1da('0x2a')](function(_0x59c1fb){_0x53a60e=_0x59c1fb;return getUser(_0x53a60e,_0x46d591,_0x40d339,_0x2cfc44[_0xf1da('0x3a')]);})[_0xf1da('0x2a')](function(_0x213915){_0x9943ca=_0x213915;logger[_0xf1da('0x30')](_0xf1da('0x83'),_0x9943ca['id']);return getEndUser(_0x53a60e,_0x46d591,_0x40d339,_0x301e5f[_0xf1da('0x8d')],_0x301e5f['destcalleridnum'],_0x9943ca,_0x1b9ff6);})[_0xf1da('0x2a')](function(_0x511971){_0x2f4a8d=_0x511971;return getCall(_0x53a60e,_0x46d591,_0x40d339,_0x9943ca,_0x2f4a8d,_0x1b9ff6,_0x301e5f,'Outbound');})['then'](function(_0x34998b){if(_0x34998b){logger[_0xf1da('0x30')](_0xf1da('0x85'),_0x34998b['id']);logger[_0xf1da('0x30')](_0xf1da('0x8b'),_0xf1da('0x86'));emit(util[_0xf1da('0x33')](_0xf1da('0x87'),_0x2cfc44[_0xf1da('0x1c')]),_0xf1da('0x8e'),{'uri':_0xf1da('0x8f')+_0x40d339['host']+_0xf1da('0x90')+_0x34998b['id']});}})[_0xf1da('0x40')](function(_0x4cf3cd){logger['error'](_0xf1da('0x8b'),JSON[_0xf1da('0xe')](_0x4cf3cd));});};exports[_0xf1da('0x91')]=function(_0x3d1dc9,_0x480ad1,_0x8e7209,_0x4aa0f1,_0x57b4f9,_0x52acdb){var _0x52c41f,_0x18c8d2,_0x594504;_0x52acdb[_0xf1da('0x7a')]=intUtil['stripTrailingSlash'](_0x52acdb[_0xf1da('0x7a')]);_0x52acdb[_0xf1da('0x7c')]=intUtil[_0xf1da('0x7b')](_0x52acdb[_0xf1da('0x7c')]);if(_0x57b4f9&&_0x57b4f9[_0xf1da('0x92')]){logger[_0xf1da('0x30')]('['+_0x480ad1[_0xf1da('0x69')][_0xf1da('0x93')]()+']',_0xf1da('0x7e'));_0x480ad1['recordingURL']=_0x52acdb[_0xf1da('0x7c')]+'/api/voice/recordings/'+_0x480ad1[_0xf1da('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x480ad1['uniqueid']);}else{_0x480ad1[_0xf1da('0x81')]='';}var _0x2f8d55=_0x52acdb[_0xf1da('0x7a')]===_0xf1da('0x8c')?'eu':_0xf1da('0x82');return getAccessToken(_0x52acdb)[_0xf1da('0x2a')](function(_0x3f53fa){_0x594504=_0x3f53fa;return getUser(_0x594504,_0x2f8d55,_0x52acdb);})[_0xf1da('0x2a')](function(_0x30fe4c){_0x52c41f=_0x30fe4c;logger[_0xf1da('0x30')]('The\x20User\x20ID\x20is:',_0x52c41f['id']);return getEndUser(_0x594504,_0x2f8d55,_0x52acdb,_0x480ad1[_0xf1da('0x94')],_0x480ad1[_0xf1da('0x84')],_0x52c41f,_0x8e7209);})['then'](function(_0x2a0193){_0x18c8d2=_0x2a0193;return getCall(_0x594504,_0x2f8d55,_0x52acdb,_0x52c41f,_0x18c8d2,_0x8e7209,_0x480ad1,_0xf1da('0x74'));})[_0xf1da('0x2a')](function(_0xc3113b){if(_0xc3113b){logger[_0xf1da('0x30')](_0xf1da('0x85'),_0xc3113b['id']);}})[_0xf1da('0x40')](function(_0x2cb2a3){logger[_0xf1da('0x2e')]('['+_0x480ad1[_0xf1da('0x69')]['toUpperCase']()+']',JSON[_0xf1da('0xe')](_0x2cb2a3));});}; \ No newline at end of file +var _0xb578=['zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','add','expires_in','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','info','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','then','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Contacts','Leads','Creating\x20new\x20call...','profile','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','startCase','talktime','Call_Duration','utc','diff','YYYY-MM-DDTHH:mm:ss','mm:ss','called','Call_Result','Called','Answered','rejected','Rejected','Abandoned','timeout','Timeout','outbound','starttime','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','trigger:browser:url','https://crm.','recordingFormat','[OUTBOUND]','/api/voice/recordings/','uniqueid','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','request-promise','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore'];(function(_0x5b40fc,_0x53f91f){var _0x41d86c=function(_0x4f87a2){while(--_0x4f87a2){_0x5b40fc['push'](_0x5b40fc['shift']());}};_0x41d86c(++_0x53f91f);}(_0xb578,0x78));var _0x8b57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb578[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var rp=require(_0x8b57('0x0'));var md5=require('md5');var util=require(_0x8b57('0x1'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x8b57('0x2'));var BPromise=require(_0x8b57('0x3'));var config=require(_0x8b57('0x4'));var logger=require('../../../../config/logger')(_0x8b57('0x5'));config[_0x8b57('0x6')]=_[_0x8b57('0x7')](config[_0x8b57('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x55d91e,_0x57c3a4,_0x2c200f){io['to'](_0x55d91e)[_0x8b57('0x8')](_0x57c3a4,_0x2c200f);}function request(_0x45507d){logger[_0x8b57('0x9')](_0x8b57('0xa'),JSON[_0x8b57('0xb')](_0x45507d));return rp(_0x45507d);}function getCustomFields(_0x53268d,_0x58438a){var _0x3e3697={};if(_0x53268d[_0x8b57('0xc')]>0x0){_[_0x8b57('0xd')](_0x53268d,function(_0x41d659){if(_[_0x8b57('0xe')](['string',_0x8b57('0xf')],_0x41d659[_0x8b57('0x10')])&&_0x41d659[_0x8b57('0x11')]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x41d659[_0x8b57('0x12')]['toString']();}else if(_0x41d659[_0x8b57('0x10')]===_0x8b57('0x13')&&_0x41d659[_0x8b57('0x14')]&&_0x41d659[_0x8b57('0x11')]&&_0x58438a[_0x41d659[_0x8b57('0x14')]]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x58438a[_0x41d659[_0x8b57('0x14')]][_0x8b57('0x15')]();}else if(_0x41d659['type']===_0x8b57('0x16')&&_0x41d659['Variable']&&_0x41d659[_0x8b57('0x17')][_0x8b57('0x18')]&&_0x41d659[_0x8b57('0x11')]&&_0x58438a[_0x41d659['Variable'][_0x8b57('0x18')]['toLowerCase']()]){_0x3e3697[_0x41d659[_0x8b57('0x11')]]=_0x58438a[_0x41d659['Variable'][_0x8b57('0x18')][_0x8b57('0x19')]()][_0x8b57('0x15')]();}});}return _0x3e3697;}function getName(_0x39e30a){if(_0x39e30a['indexOf']('\x20')>0x0){var _0x9bad16=_0x39e30a[_0x8b57('0x1a')](/ (.+)/);if(_0x9bad16[0x1]){return _0x9bad16;}}return[_0x39e30a,_0x39e30a];}var accountsTokens={};function getAccessToken(_0x1acf1f){return new Promise(function(_0x508798,_0x1a3289){if(!_['isNil'](accountsTokens[_0x1acf1f['id']])&&!_[_0x8b57('0x1b')](accountsTokens[_0x1acf1f['id']][_0x8b57('0x1c')])){if(moment()[_0x8b57('0x1d')](accountsTokens[_0x1acf1f['id']]['expires_in'])){_0x508798(accountsTokens[_0x1acf1f['id']]['access_token']);}}var _0x58f67d;switch(_0x1acf1f[_0x8b57('0x1e')]){case'US':_0x58f67d=_0x8b57('0x1f');break;case'AU':_0x58f67d=_0x8b57('0x20');break;case'EU':_0x58f67d=_0x8b57('0x21');break;case'IN':_0x58f67d=_0x8b57('0x22');break;case'CN':_0x58f67d=_0x8b57('0x23');break;default:_0x58f67d=_0x8b57('0x21');break;}var _0x23909b={'method':_0x8b57('0x24'),'uri':_0x58f67d+_0x8b57('0x25'),'qs':{'refresh_token':_0x1acf1f['refreshToken'],'client_id':_0x1acf1f['clientId'],'client_secret':_0x1acf1f[_0x8b57('0x26')],'grant_type':_0x8b57('0x27')},'json':!![]};return rp(_0x23909b)['then'](function(_0x227fe4){accountsTokens[_0x1acf1f['id']]={'access_token':_0x227fe4[_0x8b57('0x1c')],'expires_in':moment()[_0x8b57('0x28')](_0x227fe4[_0x8b57('0x29')],_0x8b57('0x2a'))};_0x508798(_0x227fe4['access_token']);})[_0x8b57('0x2b')](function(_0x2f7ab5){logger['error'](_0x8b57('0x2c'),_0x2f7ab5[_0x8b57('0x2d')]);_0x1a3289(_0x2f7ab5);});});}function getUser(_0x201dc9,_0x54a993,_0x3e71b7,_0x1b19fd){logger['info'](_0x8b57('0x2e'));return request({'method':_0x8b57('0x2f'),'uri':util[_0x8b57('0x30')](_0x8b57('0x31'),_0x54a993),'qs':{'type':_0x8b57('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x201dc9},'json':!![]})['then'](function(_0x115169){if(_0x115169[_0x8b57('0x33')]){var _0x4e2a1e=-0x1;if(_[_0x8b57('0x34')](_0x115169[_0x8b57('0x33')])){if(!_[_0x8b57('0x1b')](_0x1b19fd)){_0x4e2a1e=_['findIndex'](_0x115169[_0x8b57('0x33')],function(_0x3c7217){return _0x3c7217[_0x8b57('0x35')]===_0x1b19fd;});}if(_0x4e2a1e>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x8b57('0x36')](_0x8b57('0x37'));_0x4e2a1e=_[_0x8b57('0x38')](_0x115169[_0x8b57('0x33')],function(_0x3e958a){return _0x3e958a['profile'][_0x8b57('0x18')]==='Administrator';});}return _0x115169[_0x8b57('0x33')][_0x4e2a1e];}else{if(_0x115169['user']['profile'][_0x8b57('0x18')]===_0x8b57('0x39')){logger[_0x8b57('0x36')](_0x8b57('0x37'));user=_0x115169[_0x8b57('0x3a')];return user;}else{logger[_0x8b57('0x3b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x115169));throw new Error(_0x8b57('0x3c')+JSON[_0x8b57('0xb')](_0x115169));}}}else{logger['error'](_0x8b57('0x3d'),JSON[_0x8b57('0xb')](_0x115169));throw new Error(_0x8b57('0x3c')+JSON[_0x8b57('0xb')](_0x115169));}})[_0x8b57('0x2b')](function(_0x500a3d){console[_0x8b57('0x3b')](_0x500a3d);});}function getZohoUser(_0x56a12a,_0x35cb3c){return new BPromise(function(_0xa55a09,_0x4481d4){request(_0x56a12a)[_0x8b57('0x3e')](function(_0x1db0b4){var _0x287e52=null;if(_0x1db0b4){_0x287e52=_0x1db0b4[_0x8b57('0x3f')][0x0];_0x287e52[_0x8b57('0x40')]=_0x35cb3c;}_0xa55a09(_0x287e52);})[_0x8b57('0x2b')](function(_0x383998){_0x4481d4(_0x383998);});});}function createEndUser(_0x5d733e,_0x3c32f4,_0x1c09e4,_0x36e531,_0xfa64c6,_0x1cfef9){var _0x1c09e4=getName(_0x1c09e4);return request({'method':_0x8b57('0x24'),'uri':_0x8b57('0x41')+_0x3c32f4+_0x8b57('0x42')+_['startCase'](_0x1cfef9[_0x8b57('0x43')])+'s','body':{'data':[{'Last_Name':_0x1c09e4[0x1],'First_Name':_0x1c09e4[0x0],'Phone':_0x36e531,'Owner':{'name':!_[_0x8b57('0x1b')](_0xfa64c6[_0x8b57('0x44')]['name'])?_0xfa64c6[_0x8b57('0x44')]['name']:!_[_0x8b57('0x1b')](_0xfa64c6[_0x8b57('0x45')])?_0xfa64c6['first_name']+'\x20'+_0xfa64c6[_0x8b57('0x46')]:_0xfa64c6[_0x8b57('0x46')],'id':_0xfa64c6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5d733e},'json':!![]})[_0x8b57('0x3e')](function(_0x2535e1){if(_0x2535e1&&_0x2535e1[_0x8b57('0x3f')][0x0][_0x8b57('0x47')]===_0x8b57('0x48')){var _0xf51177=_0x2535e1[_0x8b57('0x3f')][0x0][_0x8b57('0x49')];_0xf51177['enduserType']=_['startCase'](_0x1cfef9[_0x8b57('0x43')])+'s';return _0xf51177;}logger['error'](_0x8b57('0x3d'),JSON[_0x8b57('0xb')](data));throw new Error(_0x8b57('0x4a')+JSON[_0x8b57('0xb')](data));})[_0x8b57('0x2b')](function(_0x8162b1){console['log'](_0x8b57('0x4b'),_0x8162b1);});}function getEndUser(_0x368e70,_0x5458ce,_0x4b2fc8,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46){var _0x43c3b9={'method':_0x8b57('0x2f'),'uri':'','headers':{'Authorization':_0x8b57('0x4c')+_0x368e70},'json':!![]};switch(_0x3eaa46[_0x8b57('0x4d')]){case'contact_lead':_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x4f')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,'Contacts')[_0x8b57('0x3e')](function(_0x2a7ea2){if(_0x2a7ea2)return _0x2a7ea2;_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x50')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,'Leads')[_0x8b57('0x3e')](function(_0x284ada){if(_0x284ada)return _0x284ada;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});});break;case'contact':_0x43c3b9[_0x8b57('0x4e')]=_0x8b57('0x41')+_0x5458ce+_0x8b57('0x4f')+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,_0x8b57('0x52'))['then'](function(_0x5040c7){if(_0x5040c7)return _0x5040c7;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});break;case'lead':_0x43c3b9['uri']=_0x8b57('0x41')+_0x5458ce+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4d0d9c+'))';return getZohoUser(_0x43c3b9,_0x8b57('0x53'))[_0x8b57('0x3e')](function(_0x4ef0f4){if(_0x4ef0f4)return _0x4ef0f4;if(_0x3eaa46[_0x8b57('0x43')]!=_0x8b57('0x51')){return createEndUser(_0x368e70,_0x5458ce,_0x13cce3,_0x4d0d9c,_0x3bca9c,_0x3eaa46);}else{return{};}});break;}}function getCall(_0x3ca689,_0x176578,_0x4ec1a4,_0x5430c4,_0x3df107,_0x439ffd,_0x47e30f,_0x2c8f98){logger[_0x8b57('0x36')](_0x8b57('0x54'));var _0x2a0a56={};_0x2a0a56['Owner']={'name':!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x44')]['name'])&&!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x55')][_0x8b57('0x18')])&&_0x5430c4[_0x8b57('0x55')][_0x8b57('0x18')]==='administrator'?_0x5430c4[_0x8b57('0x44')]['name']:!_[_0x8b57('0x1b')](_0x5430c4[_0x8b57('0x45')])?_0x5430c4[_0x8b57('0x45')]+'\x20'+_0x5430c4[_0x8b57('0x46')]:_0x5430c4[_0x8b57('0x46')],'id':_0x5430c4['id']};_0x2a0a56[_0x8b57('0x56')]=intUtil[_0x8b57('0x57')](_0x439ffd[_0x8b57('0x58')],_0x47e30f,'\x20');_0x2a0a56[_0x8b57('0x59')]=intUtil[_0x8b57('0x57')](_0x439ffd[_0x8b57('0x5a')],_0x47e30f,'\x0a');if(_0x3df107['enduserType']===_0x8b57('0x52')){_0x2a0a56[_0x8b57('0x5b')]={'name':!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5c')])?_0x3df107[_0x8b57('0x5c')]:!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5d')])?_0x3df107[_0x8b57('0x5d')]+'\x20'+_0x3df107[_0x8b57('0x5e')]:_0x3df107[_0x8b57('0x5e')],'id':_0x3df107['id']};}if(_0x3df107[_0x8b57('0x40')]===_0x8b57('0x53')){_0x2a0a56[_0x8b57('0x5f')]={'name':!_[_0x8b57('0x1b')](_0x3df107['Full_Name'])?_0x3df107[_0x8b57('0x5c')]:!_[_0x8b57('0x1b')](_0x3df107[_0x8b57('0x5d')])?_0x3df107[_0x8b57('0x5d')]+'\x20'+_0x3df107[_0x8b57('0x5e')]:_0x3df107['Last_Name'],'id':_0x3df107['id']};_0x2a0a56[_0x8b57('0x60')]=_[_0x8b57('0x61')](_0x3df107[_0x8b57('0x40')]);}if(_0x47e30f[_0x8b57('0x62')]){_0x2a0a56[_0x8b57('0x63')]=moment[_0x8b57('0x64')](parseInt(_0x47e30f[_0x8b57('0x62')])*0x3e8)[_0x8b57('0x30')]('mm:ss');}else if(_0x47e30f['answertime']&&_0x47e30f['endtime']){_0x2a0a56[_0x8b57('0x63')]=moment[_0x8b57('0x64')](moment(_0x47e30f['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x8b57('0x65')](moment(_0x47e30f['starttime'],_0x8b57('0x66'))))[_0x8b57('0x30')](_0x8b57('0x67'));}switch(_0x47e30f['lastevent']){case _0x8b57('0x68'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6a');break;case'complete':case'connect':_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6b');break;case _0x8b57('0x6c'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6d');break;case'abandoned':_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x6e');break;case _0x8b57('0x6f'):_0x2a0a56[_0x8b57('0x69')]=_0x8b57('0x70');default:}_0x2a0a56['Call_Start_Time']=(_0x2c8f98===_0x8b57('0x71')?moment(_0x47e30f[_0x8b57('0x72')])['format'](_0x8b57('0x66')):moment(_0x47e30f['agentcalledAt'])['format'](_0x8b57('0x66')))||moment()[_0x8b57('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x2a0a56['Call_Type']=_0x2c8f98||_0x8b57('0x73');_0x2a0a56=_[_0x8b57('0x74')](_0x2a0a56,getCustomFields(_0x439ffd[_0x8b57('0x75')],_0x47e30f));return request({'method':_0x8b57('0x24'),'uri':_0x8b57('0x41')+_0x176578+_0x8b57('0x76'),'headers':{'Authorization':_0x8b57('0x4c')+_0x3ca689},'body':{'data':[_0x2a0a56]},'json':!![]})[_0x8b57('0x3e')](function(_0x56d8e0){if(_0x56d8e0&&_0x56d8e0['data'][0x0]['code']==='SUCCESS'){logger['info'](_0x8b57('0x77'));return{'id':_0x56d8e0['data'][0x0][_0x8b57('0x49')]['id']};}})[_0x8b57('0x2b')](function(_0x87d1ce){logger[_0x8b57('0x36')](_0x8b57('0x78'),_0x87d1ce[_0x8b57('0x2d')]);console[_0x8b57('0x79')](_0x8b57('0x78'),_0x87d1ce);});}exports[_0x8b57('0x7a')]=function(_0x50dd59,_0xe4eb22,_0x35e591,_0x3b046b,_0x3a0225,_0x5982a5){var _0x25e172,_0x49627c,_0x57271e;_0x5982a5['host']=intUtil[_0x8b57('0x7b')](_0x5982a5[_0x8b57('0x7c')]);_0x5982a5[_0x8b57('0x7d')]=intUtil[_0x8b57('0x7b')](_0x5982a5[_0x8b57('0x7d')]);if(_0x3a0225&&_0x3a0225[_0x8b57('0x7e')]){logger['info'](_0x8b57('0x7f'),_0x8b57('0x80'));_0xe4eb22[_0x8b57('0x81')]=_0x5982a5[_0x8b57('0x7d')]+'/api/voice/recordings/'+_0xe4eb22['uniqueid']+_0x8b57('0x82')+md5(_0xe4eb22['uniqueid']);}else{_0xe4eb22[_0x8b57('0x81')]='';}var _0x3faed6=_0x5982a5[_0x8b57('0x7c')]===_0x8b57('0x83')?'eu':_0x8b57('0x84');return getAccessToken(_0x5982a5)[_0x8b57('0x3e')](function(_0x451b32){_0x57271e=_0x451b32;return getUser(_0x57271e,_0x3faed6,_0x5982a5,_0x3b046b[_0x8b57('0x35')]);})[_0x8b57('0x3e')](function(_0x1004f3){_0x25e172=_0x1004f3;logger[_0x8b57('0x36')]('The\x20User\x20ID\x20is:',_0x25e172['id']);return getEndUser(_0x57271e,_0x3faed6,_0x5982a5,_0xe4eb22[_0x8b57('0x85')],_0xe4eb22[_0x8b57('0x86')],_0x25e172,_0x35e591);})[_0x8b57('0x3e')](function(_0x3ef1be){_0x49627c=_0x3ef1be;return getCall(_0x57271e,_0x3faed6,_0x5982a5,_0x25e172,_0x49627c,_0x35e591,_0xe4eb22,_0x8b57('0x73'));})[_0x8b57('0x3e')](function(_0x452c40){if(_0x452c40){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x452c40['id']);logger['info'](_0x8b57('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8b57('0x30')]('user:%s',_0x3b046b['name']),_0x8b57('0x88'),{'uri':_0x8b57('0x89')+_0x5982a5[_0x8b57('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x452c40['id']});}})['catch'](function(_0x2855c1){logger[_0x8b57('0x3b')](_0x8b57('0x7f'),JSON[_0x8b57('0xb')](_0x2855c1));});};exports[_0x8b57('0x71')]=function(_0x3915aa,_0x316d49,_0x188768,_0x2d8cfa,_0x4d3923,_0x25bf61,_0x5ffdde){var _0x22a61b,_0x3befff,_0x7aab23;_0x25bf61[_0x8b57('0x7c')]=intUtil[_0x8b57('0x7b')](_0x25bf61[_0x8b57('0x7c')]);_0x25bf61[_0x8b57('0x7d')]=intUtil['stripTrailingSlash'](_0x25bf61[_0x8b57('0x7d')]);if(_0x5ffdde&&_0x5ffdde['recordingFormat']&&_0x5ffdde[_0x8b57('0x8a')]!=='none'){logger[_0x8b57('0x36')](_0x8b57('0x8b'),_0x8b57('0x80'));_0x316d49[_0x8b57('0x81')]=_0x25bf61['serverUrl']+_0x8b57('0x8c')+_0x316d49[_0x8b57('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x316d49[_0x8b57('0x8d')]);}var _0x1483d5=_0x25bf61['host']===_0x8b57('0x83')?'eu':'com';return getAccessToken(_0x25bf61)[_0x8b57('0x3e')](function(_0x43f60c){_0x7aab23=_0x43f60c;return getUser(_0x7aab23,_0x1483d5,_0x25bf61,_0x2d8cfa[_0x8b57('0x35')]);})[_0x8b57('0x3e')](function(_0x333acc){_0x22a61b=_0x333acc;logger['info']('The\x20User\x20ID\x20is:',_0x22a61b['id']);return getEndUser(_0x7aab23,_0x1483d5,_0x25bf61,_0x316d49['destcalleridname'],_0x316d49[_0x8b57('0x8e')],_0x22a61b,_0x188768);})[_0x8b57('0x3e')](function(_0x1f2e9d){_0x3befff=_0x1f2e9d;return getCall(_0x7aab23,_0x1483d5,_0x25bf61,_0x22a61b,_0x3befff,_0x188768,_0x316d49,_0x8b57('0x8f'));})[_0x8b57('0x3e')](function(_0x2e591f){if(_0x2e591f){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x2e591f['id']);logger[_0x8b57('0x36')](_0x8b57('0x8b'),_0x8b57('0x90'));emit(util[_0x8b57('0x30')](_0x8b57('0x91'),_0x2d8cfa[_0x8b57('0x18')]),_0x8b57('0x88'),{'uri':_0x8b57('0x89')+_0x25bf61['host']+_0x8b57('0x92')+_0x2e591f['id']});}})[_0x8b57('0x2b')](function(_0x390d94){logger[_0x8b57('0x3b')]('[OUTBOUND]',JSON[_0x8b57('0xb')](_0x390d94));});};exports[_0x8b57('0x93')]=function(_0x19401a,_0x59d754,_0x5c07b5,_0x3fce90,_0x3234bc,_0x5f0aa1){var _0x45e3a0,_0x25c8f4,_0x1defe6;_0x5f0aa1[_0x8b57('0x7c')]=intUtil[_0x8b57('0x7b')](_0x5f0aa1[_0x8b57('0x7c')]);_0x5f0aa1['serverUrl']=intUtil[_0x8b57('0x7b')](_0x5f0aa1[_0x8b57('0x7d')]);if(_0x3234bc&&_0x3234bc[_0x8b57('0x7e')]){logger[_0x8b57('0x36')]('['+_0x59d754[_0x8b57('0x94')][_0x8b57('0x95')]()+']',_0x8b57('0x80'));_0x59d754['recordingURL']=_0x5f0aa1[_0x8b57('0x7d')]+_0x8b57('0x8c')+_0x59d754[_0x8b57('0x8d')]+_0x8b57('0x82')+md5(_0x59d754['uniqueid']);}else{_0x59d754[_0x8b57('0x81')]='';}var _0x494bfd=_0x5f0aa1[_0x8b57('0x7c')]===_0x8b57('0x83')?'eu':_0x8b57('0x84');return getAccessToken(_0x5f0aa1)[_0x8b57('0x3e')](function(_0x3ecd2d){_0x1defe6=_0x3ecd2d;return getUser(_0x1defe6,_0x494bfd,_0x5f0aa1);})[_0x8b57('0x3e')](function(_0x4f9f02){_0x45e3a0=_0x4f9f02;logger[_0x8b57('0x36')]('The\x20User\x20ID\x20is:',_0x45e3a0['id']);return getEndUser(_0x1defe6,_0x494bfd,_0x5f0aa1,_0x59d754['calleridname'],_0x59d754[_0x8b57('0x86')],_0x45e3a0,_0x5c07b5);})[_0x8b57('0x3e')](function(_0x717465){_0x25c8f4=_0x717465;return getCall(_0x1defe6,_0x494bfd,_0x5f0aa1,_0x45e3a0,_0x25c8f4,_0x5c07b5,_0x59d754,'Inbound');})['then'](function(_0x2d695c){if(_0x2d695c){logger[_0x8b57('0x36')](_0x8b57('0x87'),_0x2d695c['id']);}})[_0x8b57('0x2b')](function(_0x428a62){logger['error']('['+_0x59d754[_0x8b57('0x94')][_0x8b57('0x95')]()+']',JSON[_0x8b57('0xb')](_0x428a62));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 1d95cf0..3f7fd1b 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 _0xc78a=['exec','data2','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','util','../../../../config/logger'];(function(_0x146a51,_0x5efcf9){var _0x52b8d0=function(_0x1127e2){while(--_0x1127e2){_0x146a51['push'](_0x146a51['shift']());}};_0x52b8d0(++_0x5efcf9);}(_0xc78a,0x130));var _0xac78=function(_0x4a7193,_0x556c6a){_0x4a7193=_0x4a7193-0x0;var _0xc33d94=_0xc78a[_0x4a7193];return _0xc33d94;};'use strict';var util=require(_0xac78('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0xac78('0x1'))('trigger');exports[_0xac78('0x2')]=function(_0x378086,_0x3aa6f5){var _0x2db0fe=_0x378086[_0xac78('0x3')]?_0x378086['data2']:'Script';var _0x413f95=_0x378086[_0xac78('0x4')]?Mustache[_0xac78('0x5')](_0x378086[_0xac78('0x4')],_0x3aa6f5):_0x3aa6f5;sh[_0xac78('0x2')](_0x413f95,function(_0x59b328,_0x57068e,_0x3c2ee9){if(_0x59b328!==0x0){logger[_0xac78('0x6')](util['format'](_0xac78('0x7'),_0x2db0fe,_0x413f95,_0x59b328,_0x3c2ee9));}else{logger['info'](util[_0xac78('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x2db0fe,_0x413f95,_0x57068e));}});}; \ No newline at end of file +var _0xc6d6=['render','data3','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','mustache','../../../../config/logger','trigger','exec','Script'];(function(_0x39da15,_0x7a76f4){var _0xe8e61f=function(_0x206451){while(--_0x206451){_0x39da15['push'](_0x39da15['shift']());}};_0xe8e61f(++_0x7a76f4);}(_0xc6d6,0x7f));var _0x6c6d=function(_0x314085,_0x4235c6){_0x314085=_0x314085-0x0;var _0x26190a=_0xc6d6[_0x314085];return _0x26190a;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x6c6d('0x0'));var logger=require(_0x6c6d('0x1'))(_0x6c6d('0x2'));exports[_0x6c6d('0x3')]=function(_0x41784c,_0x2d21ba){var _0x4e470e=_0x41784c['data2']?_0x41784c['data2']:_0x6c6d('0x4');var _0x44f572=_0x41784c['data3']?Mustache[_0x6c6d('0x5')](_0x41784c[_0x6c6d('0x6')],_0x2d21ba):_0x2d21ba;sh[_0x6c6d('0x3')](_0x44f572,function(_0x18e947,_0x1cebdc,_0x4373c2){if(_0x18e947!==0x0){logger[_0x6c6d('0x7')](util[_0x6c6d('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x4e470e,_0x44f572,_0x18e947,_0x4373c2));}else{logger[_0x6c6d('0x9')](util[_0x6c6d('0x8')](_0x6c6d('0xa'),_0x4e470e,_0x44f572,_0x1cebdc));}});}; \ 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 368a574..fa6dfd5 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 _0x3836=['stringify',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','exec','data5','headers','data6','parse','stack','data1','toUpperCase','GET','PUT','data7','render','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x4db9c2,_0x35237e){var _0x1d26dd=function(_0xd6106c){while(--_0xd6106c){_0x4db9c2['push'](_0x4db9c2['shift']());}};_0x1d26dd(++_0x35237e);}(_0x3836,0xca));var _0x6383=function(_0x29506e,_0x559505){_0x29506e=_0x29506e-0x0;var _0x3c0f62=_0x3836[_0x29506e];return _0x3c0f62;};'use strict';var rp=require(_0x6383('0x0'));var util=require(_0x6383('0x1'));var _=require(_0x6383('0x2'));var Mustache=require(_0x6383('0x3'));var logger=require(_0x6383('0x4'))('trigger');exports[_0x6383('0x5')]=function(_0x19f307,_0x575ba8){var _0x3480d2,_0x5cf729;var _0x25aa93={'method':_0x19f307['data1']['toUpperCase'](),'uri':Mustache['render'](_0x19f307['data2'],_0x575ba8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x19f307['data5'])==='number'&&parseInt(_0x19f307[_0x6383('0x6')])>=0x1&&parseInt(_0x19f307['data5'])<=0xa?parseInt(_0x19f307[_0x6383('0x6')])*0x3e8:0x5*0x3e8};try{_0x25aa93[_0x6383('0x7')]=_0x19f307[_0x6383('0x8')]?JSON[_0x6383('0x9')](Mustache['render'](_0x19f307[_0x6383('0x8')],_0x575ba8)):{};}catch(_0x1facec){logger['error'](_0x1facec[_0x6383('0xa')]);}switch(_0x19f307[_0x6383('0xb')][_0x6383('0xc')]()){case _0x6383('0xd'):case'DELETE':_0x3480d2=null;_0x25aa93['qs']=_0x575ba8;break;case'POST':case _0x6383('0xe'):if(_0x19f307[_0x6383('0xf')]){try{_0x3480d2=JSON[_0x6383('0x9')](Mustache[_0x6383('0x10')](_0x19f307[_0x6383('0xf')],_0x575ba8));_0x25aa93[_0x6383('0x11')]=_0x3480d2;}catch(_0x32da3b){logger[_0x6383('0x12')](_0x32da3b[_0x6383('0xa')]);logger['error'](_0x6383('0x13'));}}else{_0x3480d2=_0x575ba8;_0x25aa93[_0x6383('0x11')]=_0x3480d2;}break;}logger['info'](util[_0x6383('0x14')](_0x6383('0x15'),_0x19f307[_0x6383('0xb')],_0x19f307['data2'],JSON[_0x6383('0x16')](_0x25aa93)));rp(_0x25aa93)['then'](function(_0x238fb1){_0x3480d2=!_['isNil'](_0x3480d2)?_0x6383('0x17')+_0x3480d2:'';_0x5cf729=typeof _0x238fb1[_0x6383('0x11')]===_0x6383('0x18')?JSON[_0x6383('0x16')](_0x238fb1[_0x6383('0x11')]):_0x238fb1[_0x6383('0x11')];logger[_0x6383('0x19')](util['format'](_0x6383('0x1a'),_0x19f307['data1'],_0x19f307[_0x6383('0x1b')],_0x238fb1[_0x6383('0x1c')],_0x5cf729));})[_0x6383('0x1d')](function(_0x32e17e){logger[_0x6383('0x12')](util[_0x6383('0x14')](_0x6383('0x1e'),_0x19f307[_0x6383('0xb')],_0x19f307['data2'],_0x32e17e[_0x6383('0x1c')],_0x32e17e[_0x6383('0x1f')],_0x32e17e['message']));});}; \ No newline at end of file +var _0x7440=['exec','data1','toUpperCase','render','data5','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','util','mustache','../../../../config/logger','trigger'];(function(_0x7606b3,_0x42650f){var _0x583499=function(_0xbe8234){while(--_0xbe8234){_0x7606b3['push'](_0x7606b3['shift']());}};_0x583499(++_0x42650f);}(_0x7440,0x1dc));var _0x0744=function(_0x2e105c,_0x4f9595){_0x2e105c=_0x2e105c-0x0;var _0x326407=_0x7440[_0x2e105c];return _0x326407;};'use strict';var rp=require('request-promise');var util=require(_0x0744('0x0'));var _=require('lodash');var Mustache=require(_0x0744('0x1'));var logger=require(_0x0744('0x2'))(_0x0744('0x3'));exports[_0x0744('0x4')]=function(_0x263f91,_0x47fbba){var _0x9ff1c9,_0x4c9527;var _0x431f69={'method':_0x263f91[_0x0744('0x5')][_0x0744('0x6')](),'uri':Mustache[_0x0744('0x7')](_0x263f91['data2'],_0x47fbba),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x263f91[_0x0744('0x8')])==='number'&&parseInt(_0x263f91['data5'])>=0x1&&parseInt(_0x263f91[_0x0744('0x8')])<=0xa?parseInt(_0x263f91[_0x0744('0x8')])*0x3e8:0x5*0x3e8};try{_0x431f69[_0x0744('0x9')]=_0x263f91[_0x0744('0xa')]?JSON[_0x0744('0xb')](Mustache[_0x0744('0x7')](_0x263f91[_0x0744('0xa')],_0x47fbba)):{};}catch(_0x29f5c3){logger[_0x0744('0xc')](_0x29f5c3[_0x0744('0xd')]);}switch(_0x263f91['data1']['toUpperCase']()){case _0x0744('0xe'):case'DELETE':_0x9ff1c9=null;_0x431f69['qs']=_0x47fbba;break;case _0x0744('0xf'):case _0x0744('0x10'):if(_0x263f91[_0x0744('0x11')]){try{_0x9ff1c9=JSON[_0x0744('0xb')](Mustache[_0x0744('0x7')](_0x263f91[_0x0744('0x11')],_0x47fbba));_0x431f69[_0x0744('0x12')]=_0x9ff1c9;}catch(_0x394eaf){logger[_0x0744('0xc')](_0x394eaf['stack']);logger[_0x0744('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x9ff1c9=_0x47fbba;_0x431f69[_0x0744('0x12')]=_0x9ff1c9;}break;}logger[_0x0744('0x13')](util[_0x0744('0x14')](_0x0744('0x15'),_0x263f91['data1'],_0x263f91[_0x0744('0x16')],JSON['stringify'](_0x431f69)));rp(_0x431f69)[_0x0744('0x17')](function(_0x2e4035){_0x9ff1c9=!_[_0x0744('0x18')](_0x9ff1c9)?_0x0744('0x19')+_0x9ff1c9:'';_0x4c9527=typeof _0x2e4035['body']===_0x0744('0x1a')?JSON[_0x0744('0x1b')](_0x2e4035[_0x0744('0x12')]):_0x2e4035[_0x0744('0x12')];logger['info'](util[_0x0744('0x14')](_0x0744('0x1c'),_0x263f91['data1'],_0x263f91[_0x0744('0x16')],_0x2e4035[_0x0744('0x1d')],_0x4c9527));})['catch'](function(_0x4e872d){logger[_0x0744('0xc')](util[_0x0744('0x14')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x263f91[_0x0744('0x5')],_0x263f91[_0x0744('0x16')],_0x4e872d[_0x0744('0x1d')],_0x4e872d[_0x0744('0x1e')],_0x4e872d[_0x0744('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f44f944..700a9a3 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 _0x7424=['then','debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','Request','request'];(function(_0x219a25,_0x11c686){var _0x2c8c77=function(_0x11c494){while(--_0x11c494){_0x219a25['push'](_0x219a25['shift']());}};_0x2c8c77(++_0x11c686);}(_0x7424,0x1e6));var _0x4742=function(_0x5dfae9,_0x1dcd0b){_0x5dfae9=_0x5dfae9-0x0;var _0x4c134b=_0x7424[_0x5dfae9];return _0x4c134b;};'use strict';var jayson=require(_0x4742('0x0'));var BPromise=require(_0x4742('0x1'));var logger=require(_0x4742('0x2'))(_0x4742('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x4742('0x4')]=function(_0x513d53,_0x363664){return new BPromise(function(_0x274965,_0x48756e){return client[_0x4742('0x5')](_0x513d53,_0x363664)[_0x4742('0x6')](function(_0x29e0af){logger[_0x4742('0x7')](_0x4742('0x8'),'routing',_0x513d53,_0x363664,_0x29e0af);if(_0x29e0af[_0x4742('0x9')]){logger[_0x4742('0x9')](_0x4742('0x8'),_0x4742('0x3'),_0x513d53,_0x29e0af[_0x4742('0x9')]['message'],_0x363664);return _0x48756e(_0x29e0af['error'][_0x4742('0xa')]);}else{return _0x274965(_0x29e0af['result']);}})[_0x4742('0xb')](function(_0x4ef184){logger[_0x4742('0x9')](_0x4742('0x8'),_0x4742('0x3'),_0x513d53,_0x4ef184,_0x363664);return _0x48756e(_0x4ef184);});});};module['exports']=client; \ No newline at end of file +var _0xfc79=['exports','../../config/logger','http','Request','request','rpc','routing','error','message','result'];(function(_0x216202,_0x1550b7){var _0x32661e=function(_0x3de695){while(--_0x3de695){_0x216202['push'](_0x216202['shift']());}};_0x32661e(++_0x1550b7);}(_0xfc79,0x1c3));var _0x9fc7=function(_0x11a35d,_0xd110e2){_0x11a35d=_0x11a35d-0x0;var _0x2cafa9=_0xfc79[_0x11a35d];return _0x2cafa9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x9fc7('0x0'))('routing');var client=jayson['client'][_0x9fc7('0x1')]({'port':0x2329});client[_0x9fc7('0x2')]=function(_0x219bcd,_0x3b18a5){return new BPromise(function(_0x593427,_0x215591){return client[_0x9fc7('0x3')](_0x219bcd,_0x3b18a5)['then'](function(_0x32c028){logger['debug'](_0x9fc7('0x4'),_0x9fc7('0x5'),_0x219bcd,_0x3b18a5,_0x32c028);if(_0x32c028[_0x9fc7('0x6')]){logger[_0x9fc7('0x6')](_0x9fc7('0x4'),_0x9fc7('0x5'),_0x219bcd,_0x32c028['error']['message'],_0x3b18a5);return _0x215591(_0x32c028[_0x9fc7('0x6')][_0x9fc7('0x7')]);}else{return _0x593427(_0x32c028[_0x9fc7('0x8')]);}})['catch'](function(_0x4be759){logger[_0x9fc7('0x6')](_0x9fc7('0x4'),_0x9fc7('0x5'),_0x219bcd,_0x4be759,_0x3b18a5);return _0x215591(_0x4be759);});});};module[_0x9fc7('0x9')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 46f78f5..93e88a1 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 _0x4797=['./server','./realtime','./rpc/setting','resolve','then','initMailAccounts','refresh','listen','getSettings','catch','log','bluebird'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x4797,0x143));var _0x7479=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4797[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x7479('0x0'));var server=require(_0x7479('0x1'));var Realtime=require(_0x7479('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x7479('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x7479('0x4')]()[_0x7479('0x5')](mailAccount['getMailAccounts']())[_0x7479('0x5')](realtime[_0x7479('0x6')]())[_0x7479('0x5')](function(){email[_0x7479('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x7479('0x8')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0x7479('0x9')]();})[_0x7479('0x5')](function(_0x53da80){return setInterval(initRealtime,_0x53da80['loginMailFrequency']*0x3e8);})[_0x7479('0xa')](function(_0x42e149){console[_0x7479('0xb')](_0x42e149);});}main(); \ No newline at end of file +var _0x10b3=['then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts'];(function(_0x100519,_0x50dd2c){var _0x1dd752=function(_0x451bb7){while(--_0x451bb7){_0x100519['push'](_0x100519['shift']());}};_0x1dd752(++_0x50dd2c);}(_0x10b3,0xd8));var _0x310b=function(_0x5b89c1,_0x3376c0){_0x5b89c1=_0x5b89c1-0x0;var _0x1ab8bf=_0x10b3[_0x5b89c1];return _0x1ab8bf;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x310b('0x0'));var setting=require(_0x310b('0x1'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x310b('0x2')]()['then'](mailAccount[_0x310b('0x3')]())[_0x310b('0x4')](realtime[_0x310b('0x5')]())[_0x310b('0x4')](function(){email['refresh'](realtime[_0x310b('0x6')]);return realtime;});}function main(){return server[_0x310b('0x7')](realtime,email)[_0x310b('0x4')](function(){return initRealtime();})[_0x310b('0x4')](function(){return setting[_0x310b('0x8')]();})[_0x310b('0x4')](function(_0x5bf6e1){return setInterval(initRealtime,_0x5bf6e1[_0x310b('0x9')]*0x3e8);})[_0x310b('0xa')](function(_0x136d42){console['log'](_0x136d42);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index d1ac113..b007d91 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 _0xe323=['handleImapError','disabled','messageStatus','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','Imap','status','isNil','stringify','md5','mailAccount:update','prototype','refresh','active','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error'];(function(_0x203dc8,_0x10429d){var _0x3058fb=function(_0x2d2d5b){while(--_0x2d2d5b){_0x203dc8['push'](_0x203dc8['shift']());}};_0x3058fb(++_0x10429d);}(_0xe323,0x151));var _0x3e32=function(_0x3ac096,_0x1c32d0){_0x3ac096=_0x3ac096-0x0;var _0x7d7332=_0xe323[_0x3ac096];return _0x7d7332;};'use strict';var _=require(_0x3e32('0x0'));var moment=require(_0x3e32('0x1'));var BPromise=require(_0x3e32('0x2'));var md5=require('md5');var Redis=require(_0x3e32('0x3'));var config=require(_0x3e32('0x4'));var logger=require('../../../config/logger')(_0x3e32('0x5'));config[_0x3e32('0x6')]=_[_0x3e32('0x7')](config[_0x3e32('0x6')],{'host':_0x3e32('0x8'),'port':0x18eb});var io=require(_0x3e32('0x9'))(new Redis(config[_0x3e32('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x3e32('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x397a7a){logger[_0x3e32('0xb')](_0x3e32('0xc'));this[_0x3e32('0xd')]=_0x397a7a[_0x3e32('0xd')];this[_0x3e32('0xe')]={};this[_0x3e32('0xf')]=new EmailSmtp();}EmailChannel['prototype'][_0x3e32('0x10')]=function(_0x28d80d){var _0x44e30c=this[_0x3e32('0xd')][_0x28d80d];var _0x5eb001={'id':_0x44e30c['id'],'name':_0x44e30c['name'],'key':_0x44e30c['key'],'active':_0x44e30c['active'],'Imap':{'status':_0x44e30c[_0x3e32('0x11')][_0x3e32('0x12')],'messageStatus':_0x44e30c[_0x3e32('0x11')]['messageStatus'],'total':_0x44e30c[_0x3e32('0x11')]['total']}};if(_[_0x3e32('0x13')](md5Accounts[_0x28d80d])){md5Accounts[_0x28d80d]={};}var _0x2ab12b=md5(JSON[_0x3e32('0x14')](_0x5eb001));if(md5Accounts[_0x28d80d][_0x3e32('0x15')]!==_0x2ab12b){md5Accounts[_0x28d80d][_0x3e32('0x15')]=_0x2ab12b;io['emit'](_0x3e32('0x16'),_0x5eb001);}};EmailChannel[_0x3e32('0x17')][_0x3e32('0x18')]=function(_0x23f0cb){for(var _0x16478f in _0x23f0cb){if(_0x23f0cb['hasOwnProperty'](_0x16478f)){if(_0x23f0cb[_0x16478f][_0x3e32('0x11')]&&_0x23f0cb[_0x16478f][_0x3e32('0x19')]){var _0x5e3a7d=_0x23f0cb[_0x16478f]['Imap'];if(!this[_0x3e32('0xe')][_0x3e32('0x1a')](_0x5e3a7d['id'])){this[_0x3e32('0xe')][_0x5e3a7d['id']]=new EmailImap(_0x5e3a7d,_0x23f0cb[_0x16478f]['email']);this[_0x3e32('0xe')][_0x5e3a7d['id']]['on'](_0x3e32('0x1b'),this[_0x3e32('0x1c')][_0x3e32('0x1d')](this,_0x16478f));this['imapAccounts'][_0x5e3a7d['id']]['on'](_0x3e32('0x5'),this[_0x3e32('0x1e')]['bind'](this,_0x16478f));this['imapAccounts'][_0x5e3a7d['id']]['on'](_0x3e32('0x1f'),this[_0x3e32('0x20')][_0x3e32('0x1d')](this,_0x16478f));this[_0x3e32('0xe')][_0x5e3a7d['id']]['on'](_0x3e32('0x21'),this[_0x3e32('0x22')][_0x3e32('0x1d')](this,_0x16478f));}}else{if(_[_0x3e32('0x13')](this[_0x3e32('0xd')][_0x16478f][_0x3e32('0x11')])){this['mailAccounts'][_0x16478f]['Imap']={};}this['mailAccounts'][_0x16478f][_0x3e32('0x11')][_0x3e32('0x12')]=_0x3e32('0x23');this[_0x3e32('0xd')][_0x16478f][_0x3e32('0x11')][_0x3e32('0x24')]='';this[_0x3e32('0x10')](_0x16478f);}}}};EmailChannel[_0x3e32('0x17')][_0x3e32('0x1c')]=function(_0x46cae1,_0x3870b3){if(this['mailAccounts'][_0x46cae1]){this[_0x3e32('0xd')][_0x46cae1]['Imap']['status']='connected';this[_0x3e32('0xd')][_0x46cae1][_0x3e32('0x11')][_0x3e32('0x24')]=_0x3870b3[_0x3e32('0x25')];if(_0x3870b3[_0x3e32('0x26')]){this[_0x3e32('0xd')][_0x46cae1]['Imap']['total']=_0x3870b3[_0x3e32('0x26')][_0x3e32('0x27')];}return this[_0x3e32('0x10')](_0x46cae1);}};EmailChannel[_0x3e32('0x17')][_0x3e32('0x1e')]=function(_0x1f5ffb,_0x41592d){logger[_0x3e32('0xb')](_0x3e32('0x28'),_0x41592d['firstName'],_0x41592d[_0x3e32('0x29')],_0x41592d['from'],_0x1f5ffb);if(this['mailAccounts'][_0x1f5ffb]){return mailAccount[_0x3e32('0x2a')](_0x1f5ffb,_0x41592d)[_0x3e32('0x2b')](function(_0x439b39){if(_0x439b39){logger[_0x3e32('0xb')](_0x3e32('0x2c'));}})[_0x3e32('0x2d')](function(_0x210f26){logger[_0x3e32('0x21')](_0x3e32('0x2e'),JSON[_0x3e32('0x14')](_0x210f26));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x2209d2){if(this['mailAccounts'][_0x2209d2]&&this['mailAccounts'][_0x2209d2][_0x3e32('0x11')]){if(this[_0x3e32('0xe')][this[_0x3e32('0xd')][_0x2209d2][_0x3e32('0x11')]['id']]){delete this['imapAccounts'][this[_0x3e32('0xd')][_0x2209d2][_0x3e32('0x11')]['id']];}this[_0x3e32('0xd')][_0x2209d2][_0x3e32('0x11')][_0x3e32('0x2f')]=moment();this[_0x3e32('0x10')](_0x2209d2);}};EmailChannel['prototype'][_0x3e32('0x22')]=function(_0x112c80,_0x262bc8){if(this['mailAccounts'][_0x112c80]){this[_0x3e32('0xd')][_0x112c80][_0x3e32('0x11')]['status']=_0x3e32('0x21');this[_0x3e32('0xd')][_0x112c80][_0x3e32('0x11')][_0x3e32('0x24')]=_0x262bc8;return this[_0x3e32('0x10')](_0x112c80);}};EmailChannel[_0x3e32('0x17')]['sendMail']=function(_0x33aef0,_0x21e9a1){return this[_0x3e32('0xf')]['send'](_0x33aef0,_0x21e9a1);};EmailChannel[_0x3e32('0x17')][_0x3e32('0x30')]=function(_0x2f0d11){var _0x3c9efb=this;if(this[_0x3e32('0xd')][_0x2f0d11['id']]){if(_[_0x3e32('0x13')](this[_0x3e32('0xd')][_0x2f0d11['id']][_0x3e32('0x31')])){this[_0x3e32('0xd')][_0x2f0d11['id']][_0x3e32('0x31')]={};}this[_0x3e32('0xd')][_0x2f0d11['id']][_0x3e32('0x31')][_0x3e32('0x2f')]=moment();return new BPromise(function(_0x2f870a,_0x2fc7d6){return _0x3c9efb[_0x3e32('0xf')][_0x3e32('0x32')](_0x2f0d11)[_0x3e32('0x2b')](function(_0x4d69a5){_0x3c9efb[_0x3e32('0xd')][_0x2f0d11['id']][_0x3e32('0x31')][_0x3e32('0x12')]=_0x3e32('0x33');_0x3c9efb['mailAccounts'][_0x2f0d11['id']][_0x3e32('0x31')][_0x3e32('0x24')]='';_0x3c9efb[_0x3e32('0x10')](_0x2f0d11['id']);_0x2f870a(_0x4d69a5);})[_0x3e32('0x2d')](function(_0x52f7c1){_0x3c9efb['mailAccounts'][_0x2f0d11['id']][_0x3e32('0x31')][_0x3e32('0x12')]='error';_0x3c9efb[_0x3e32('0xd')][_0x2f0d11['id']][_0x3e32('0x31')]['messageStatus']=_0x52f7c1;_0x3c9efb['emit'](_0x2f0d11['id']);_0x2fc7d6(_0x52f7c1);});});}return this['smtp'][_0x3e32('0x32')](_0x2f0d11);};module[_0x3e32('0x34')]=EmailChannel; \ No newline at end of file +var _0x6dbe=['../../../config/logger','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','prototype','emit','name','key','messageStatus','total','mailAccount:update','refresh','active','Imap','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','verifySmtp','isNil','Smtp','verify','exports','moment','bluebird','md5','ioredis'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x6dbe,0x140));var _0xe6db=function(_0x2c43ac,_0x553034){_0x2c43ac=_0x2c43ac-0x0;var _0x459e84=_0x6dbe[_0x2c43ac];return _0x459e84;};'use strict';var _=require('lodash');var moment=require(_0xe6db('0x0'));var BPromise=require(_0xe6db('0x1'));var md5=require(_0xe6db('0x2'));var Redis=require(_0xe6db('0x3'));var config=require('../../../config/environment');var logger=require(_0xe6db('0x4'))('email');config[_0xe6db('0x5')]=_[_0xe6db('0x6')](config[_0xe6db('0x5')],{'host':_0xe6db('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe6db('0x5')]));var EmailImap=require(_0xe6db('0x8'));var EmailSmtp=require(_0xe6db('0x9'));var mailAccount=require(_0xe6db('0xa'));var md5Accounts={};function EmailChannel(_0xecf241){logger[_0xe6db('0xb')]('start\x20email\x20channel');this[_0xe6db('0xc')]=_0xecf241[_0xe6db('0xc')];this[_0xe6db('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xe6db('0xe')][_0xe6db('0xf')]=function(_0x2f93dd){var _0x349870=this[_0xe6db('0xc')][_0x2f93dd];var _0x4f2712={'id':_0x349870['id'],'name':_0x349870[_0xe6db('0x10')],'key':_0x349870[_0xe6db('0x11')],'active':_0x349870['active'],'Imap':{'status':_0x349870['Imap']['status'],'messageStatus':_0x349870['Imap'][_0xe6db('0x12')],'total':_0x349870['Imap'][_0xe6db('0x13')]}};if(_['isNil'](md5Accounts[_0x2f93dd])){md5Accounts[_0x2f93dd]={};}var _0x3c5370=md5(JSON['stringify'](_0x4f2712));if(md5Accounts[_0x2f93dd][_0xe6db('0x2')]!==_0x3c5370){md5Accounts[_0x2f93dd]['md5']=_0x3c5370;io[_0xe6db('0xf')](_0xe6db('0x14'),_0x4f2712);}};EmailChannel[_0xe6db('0xe')][_0xe6db('0x15')]=function(_0x595b66){for(var _0x24f0e8 in _0x595b66){if(_0x595b66['hasOwnProperty'](_0x24f0e8)){if(_0x595b66[_0x24f0e8]['Imap']&&_0x595b66[_0x24f0e8][_0xe6db('0x16')]){var _0x4ad26c=_0x595b66[_0x24f0e8][_0xe6db('0x17')];if(!this['imapAccounts'][_0xe6db('0x18')](_0x4ad26c['id'])){this[_0xe6db('0xd')][_0x4ad26c['id']]=new EmailImap(_0x4ad26c,_0x595b66[_0x24f0e8][_0xe6db('0x19')]);this['imapAccounts'][_0x4ad26c['id']]['on'](_0xe6db('0x1a'),this[_0xe6db('0x1b')][_0xe6db('0x1c')](this,_0x24f0e8));this[_0xe6db('0xd')][_0x4ad26c['id']]['on'](_0xe6db('0x19'),this[_0xe6db('0x1d')][_0xe6db('0x1c')](this,_0x24f0e8));this[_0xe6db('0xd')][_0x4ad26c['id']]['on']('end',this[_0xe6db('0x1e')][_0xe6db('0x1c')](this,_0x24f0e8));this[_0xe6db('0xd')][_0x4ad26c['id']]['on']('error',this[_0xe6db('0x1f')]['bind'](this,_0x24f0e8));}}else{if(_['isNil'](this[_0xe6db('0xc')][_0x24f0e8][_0xe6db('0x17')])){this[_0xe6db('0xc')][_0x24f0e8][_0xe6db('0x17')]={};}this[_0xe6db('0xc')][_0x24f0e8][_0xe6db('0x17')]['status']=_0xe6db('0x20');this[_0xe6db('0xc')][_0x24f0e8]['Imap'][_0xe6db('0x12')]='';this[_0xe6db('0xf')](_0x24f0e8);}}}};EmailChannel[_0xe6db('0xe')][_0xe6db('0x1b')]=function(_0x30d347,_0x2f3cc1){if(this[_0xe6db('0xc')][_0x30d347]){this[_0xe6db('0xc')][_0x30d347]['Imap'][_0xe6db('0x21')]=_0xe6db('0x22');this[_0xe6db('0xc')][_0x30d347][_0xe6db('0x17')][_0xe6db('0x12')]=_0x2f3cc1[_0xe6db('0x10')];if(_0x2f3cc1[_0xe6db('0x23')]){this[_0xe6db('0xc')][_0x30d347][_0xe6db('0x17')]['total']=_0x2f3cc1['messages'][_0xe6db('0x13')];}return this[_0xe6db('0xf')](_0x30d347);}};EmailChannel[_0xe6db('0xe')][_0xe6db('0x1d')]=function(_0x322302,_0x26c4ca){logger[_0xe6db('0xb')](_0xe6db('0x24'),_0x26c4ca[_0xe6db('0x25')],_0x26c4ca[_0xe6db('0x26')],_0x26c4ca[_0xe6db('0x27')],_0x322302);if(this[_0xe6db('0xc')][_0x322302]){return mailAccount[_0xe6db('0x28')](_0x322302,_0x26c4ca)[_0xe6db('0x29')](function(_0x484ecd){if(_0x484ecd){logger[_0xe6db('0xb')](_0xe6db('0x2a'));}})[_0xe6db('0x2b')](function(_0x47e9f7){logger[_0xe6db('0x2c')](_0xe6db('0x2d'),JSON['stringify'](_0x47e9f7));});}};EmailChannel[_0xe6db('0xe')]['handleImapEnd']=function(_0x203a0e){if(this['mailAccounts'][_0x203a0e]&&this[_0xe6db('0xc')][_0x203a0e][_0xe6db('0x17')]){if(this[_0xe6db('0xd')][this['mailAccounts'][_0x203a0e][_0xe6db('0x17')]['id']]){delete this[_0xe6db('0xd')][this[_0xe6db('0xc')][_0x203a0e][_0xe6db('0x17')]['id']];}this[_0xe6db('0xc')][_0x203a0e]['Imap'][_0xe6db('0x2e')]=moment();this[_0xe6db('0xf')](_0x203a0e);}};EmailChannel[_0xe6db('0xe')][_0xe6db('0x1f')]=function(_0x367a30,_0x39044b){if(this[_0xe6db('0xc')][_0x367a30]){this[_0xe6db('0xc')][_0x367a30][_0xe6db('0x17')][_0xe6db('0x21')]=_0xe6db('0x2c');this['mailAccounts'][_0x367a30][_0xe6db('0x17')][_0xe6db('0x12')]=_0x39044b;return this[_0xe6db('0xf')](_0x367a30);}};EmailChannel[_0xe6db('0xe')][_0xe6db('0x2f')]=function(_0x51ec92,_0x5d6960){return this[_0xe6db('0x30')]['send'](_0x51ec92,_0x5d6960);};EmailChannel['prototype'][_0xe6db('0x31')]=function(_0xd0442e){var _0x10f3e9=this;if(this['mailAccounts'][_0xd0442e['id']]){if(_[_0xe6db('0x32')](this[_0xe6db('0xc')][_0xd0442e['id']]['Smtp'])){this[_0xe6db('0xc')][_0xd0442e['id']][_0xe6db('0x33')]={};}this[_0xe6db('0xc')][_0xd0442e['id']]['Smtp'][_0xe6db('0x2e')]=moment();return new BPromise(function(_0x502185,_0x404a6a){return _0x10f3e9['smtp']['verify'](_0xd0442e)['then'](function(_0x568ada){_0x10f3e9[_0xe6db('0xc')][_0xd0442e['id']][_0xe6db('0x33')][_0xe6db('0x21')]='verified';_0x10f3e9['mailAccounts'][_0xd0442e['id']][_0xe6db('0x33')][_0xe6db('0x12')]='';_0x10f3e9[_0xe6db('0xf')](_0xd0442e['id']);_0x502185(_0x568ada);})['catch'](function(_0x55a1c5){_0x10f3e9[_0xe6db('0xc')][_0xd0442e['id']][_0xe6db('0x33')][_0xe6db('0x21')]='error';_0x10f3e9[_0xe6db('0xc')][_0xd0442e['id']]['Smtp'][_0xe6db('0x12')]=_0x55a1c5;_0x10f3e9[_0xe6db('0xf')](_0xd0442e['id']);_0x404a6a(_0x55a1c5);});});}return this[_0xe6db('0x30')][_0xe6db('0x34')](_0xd0442e);};module[_0xe6db('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 4ab07bc..ba56592 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 _0x6c32=['simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','once','ready','handleReady','handleEnd','bind','error','connect','inherits','prototype','connTimeout','authTimeout','service','user','password','host','port','tls','required','openBox','handleOpenBox','handleError','readUnseen','end','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','email','handleFetchEnd','handleCloseBox','handleFetchError','emit','textCode','upperFirst','path','util','imap','lodash','randomstring','mailparser'];(function(_0x5b7d48,_0x2ca559){var _0xef7ab7=function(_0x3ffdac){while(--_0x3ffdac){_0x5b7d48['push'](_0x5b7d48['shift']());}};_0xef7ab7(++_0x2ca559);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var Imap=require(_0x26c3('0x2'));var _=require(_0x26c3('0x3'));var rs=require(_0x26c3('0x4'));var simpleParser=require(_0x26c3('0x5'))[_0x26c3('0x6')];var Iconv=require(_0x26c3('0x7'))[_0x26c3('0x8')];var EventEmitter=require('events')[_0x26c3('0x9')];var utils=require(_0x26c3('0xa'));var logger=require(_0x26c3('0xb'))('email');function EmailImap(_0x187b81,_0x5b3a5f){this[_0x26c3('0xc')]=_0x26c3('0xd');this[_0x26c3('0xe')]=this[_0x26c3('0xf')](_0x187b81,_0x5b3a5f);this[_0x26c3('0x2')]=new Imap(this[_0x26c3('0xe')]);this[_0x26c3('0x2')][_0x26c3('0x10')](_0x26c3('0x11'),this[_0x26c3('0x12')]['bind'](this));this['imap']['once']('end',this[_0x26c3('0x13')][_0x26c3('0x14')](this));this[_0x26c3('0x2')]['on'](_0x26c3('0x15'),this['handleError']['bind'](this));this[_0x26c3('0x2')][_0x26c3('0x16')]();}util[_0x26c3('0x17')](EmailImap,EventEmitter);EmailImap[_0x26c3('0x18')][_0x26c3('0xf')]=function(_0x568d0b,_0x5d4e9d){var _0x2acfb1={'connTimeout':_0x568d0b[_0x26c3('0x19')]?_0x568d0b['connTimeout']*0x3e8:0x2710,'authTimeout':_0x568d0b['authTimeout']?_0x568d0b[_0x26c3('0x1a')]*0x3e8:0x1388};if(_['isNil'](_0x568d0b[_0x26c3('0x1b')])){if(_0x568d0b['authentication']){_0x2acfb1['user']=_0x568d0b[_0x26c3('0x1c')];_0x2acfb1['password']=_0x568d0b[_0x26c3('0x1d')];}_0x2acfb1['host']=_0x568d0b[_0x26c3('0x1e')];_0x2acfb1[_0x26c3('0x1f')]=_0x568d0b[_0x26c3('0x1f')]||0x3e1;if(_0x568d0b[_0x26c3('0x20')]){_0x2acfb1[_0x26c3('0x20')]=!![];}else{_0x2acfb1['tls']=![];_0x2acfb1['autotls']=_0x26c3('0x21');}}else{_0x2acfb1[_0x26c3('0x1c')]=_0x568d0b['user'];_0x2acfb1['password']=_0x568d0b[_0x26c3('0x1d')];_0x2acfb1['host']=utils['getHost'](_0x568d0b[_0x26c3('0x1b')]);_0x2acfb1['port']=0x3e1;_0x2acfb1[_0x26c3('0x20')]=!![];}_0x2acfb1['email']=_0x5d4e9d||_0x568d0b[_0x26c3('0x1c')]||'anonymous@xcally.com';return _0x2acfb1;};EmailImap[_0x26c3('0x18')][_0x26c3('0x12')]=function(){this[_0x26c3('0x2')][_0x26c3('0x22')](this[_0x26c3('0xc')],![],this[_0x26c3('0x23')][_0x26c3('0x14')](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x23')]=function(_0x3f6a18,_0x52dae1){if(_0x3f6a18){this[_0x26c3('0x24')](_0x3f6a18,!![]);}else{this['emit']('box',_0x52dae1);this[_0x26c3('0x25')]();}};EmailImap[_0x26c3('0x18')]['handleCloseBox']=function(_0x458c89){if(_0x458c89){this['handleError'](_0x458c89,!![]);}else{this[_0x26c3('0x2')][_0x26c3('0x26')]();}};EmailImap[_0x26c3('0x18')][_0x26c3('0x25')]=function(){this[_0x26c3('0x2')]['search']([_0x26c3('0x27')],this[_0x26c3('0x28')][_0x26c3('0x14')](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x28')]=function(_0x19200e,_0x5557b8){if(_0x19200e){this[_0x26c3('0x24')](_0x19200e,!![]);}else{if(_0x5557b8[_0x26c3('0x29')]){try{var _0x2090e0=this['imap'][_0x26c3('0x2a')](_0x5557b8,{'bodies':'','markSeen':!![]});_0x2090e0['on'](_0x26c3('0x2b'),this[_0x26c3('0x2c')][_0x26c3('0x14')](this));_0x2090e0[_0x26c3('0x10')](_0x26c3('0x15'),this['handleFetchError'][_0x26c3('0x14')](this));_0x2090e0[_0x26c3('0x10')]('end',this['handleFetchEnd']['bind'](this));}catch(_0x5a24b3){logger['error'](_0x5a24b3);}}else{this[_0x26c3('0x2')][_0x26c3('0x2d')](!![],this['handleCloseBox'][_0x26c3('0x14')](this));}}};EmailImap[_0x26c3('0x18')]['handleFetchMessage']=function(_0x52ef2b,_0x3dda72){_0x52ef2b['on']('body',this[_0x26c3('0x2e')]['bind'](this));_0x52ef2b[_0x26c3('0x10')](_0x26c3('0x2f'),this[_0x26c3('0x30')][_0x26c3('0x14')](this));_0x52ef2b[_0x26c3('0x10')]('end',this[_0x26c3('0x31')][_0x26c3('0x14')](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x2e')]=function(_0x43145f,_0x29edc6){simpleParser(_0x43145f,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x30')]=function(_0xfc0bd9){};EmailImap[_0x26c3('0x18')][_0x26c3('0x31')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x4c2df1,_0x14b840){if(_0x4c2df1){logger[_0x26c3('0x15')](_0x4c2df1);}else{var _0x832ef2=this;utils[_0x26c3('0x32')](this[_0x26c3('0xe')],_0x14b840,function(_0x5290b3){_0x832ef2['emit'](_0x26c3('0x33'),_0x5290b3);});}};EmailImap[_0x26c3('0x18')][_0x26c3('0x34')]=function(){this[_0x26c3('0x2')]['closeBox'](!![],this[_0x26c3('0x35')][_0x26c3('0x14')](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x36')]=function(_0x4228b8){this[_0x26c3('0x24')](_0x4228b8);this[_0x26c3('0x2')][_0x26c3('0x2d')](!![],this[_0x26c3('0x35')][_0x26c3('0x14')](this));};EmailImap[_0x26c3('0x18')][_0x26c3('0x13')]=function(){this[_0x26c3('0x37')]('end');};EmailImap[_0x26c3('0x18')][_0x26c3('0x24')]=function(_0xfb596a,_0x46ebfb){logger[_0x26c3('0x15')](_0x26c3('0x24'),this['account'][_0x26c3('0x33')],JSON['stringify'](_0xfb596a));var _0x224fc7='';if(_0xfb596a){if(_0xfb596a['textCode']){_0x224fc7=_0xfb596a[_0x26c3('0x38')];}else{for(var _0x1dfb5d in _0xfb596a){if(_0xfb596a['hasOwnProperty'](_0x1dfb5d)){_0x224fc7+=_[_0x26c3('0x39')](_0x1dfb5d)+':\x20'+_0xfb596a[_0x1dfb5d]+'\x0a';}}}}if(_0x46ebfb){this[_0x26c3('0x2')][_0x26c3('0x26')]();}else{this[_0x26c3('0x37')](_0x26c3('0x15'),_0x224fc7);this['emit'](_0x26c3('0x26'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x826a=['once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','util','lodash','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x826a,0x1aa));var _0xa826=function(_0xb292e5,_0x4e9bcf){_0xb292e5=_0xb292e5-0x0;var _0x10eb7b=_0x826a[_0xb292e5];return _0x10eb7b;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xa826('0x0'));var Imap=require('imap');var _=require(_0xa826('0x1'));var rs=require('randomstring');var simpleParser=require(_0xa826('0x2'))[_0xa826('0x3')];var Iconv=require(_0xa826('0x4'))[_0xa826('0x5')];var EventEmitter=require('events')[_0xa826('0x6')];var utils=require(_0xa826('0x7'));var logger=require(_0xa826('0x8'))(_0xa826('0x9'));function EmailImap(_0x45154f,_0x4124f5){this[_0xa826('0xa')]=_0xa826('0xb');this[_0xa826('0xc')]=this[_0xa826('0xd')](_0x45154f,_0x4124f5);this[_0xa826('0xe')]=new Imap(this[_0xa826('0xc')]);this[_0xa826('0xe')][_0xa826('0xf')](_0xa826('0x10'),this[_0xa826('0x11')]['bind'](this));this[_0xa826('0xe')]['once'](_0xa826('0x12'),this[_0xa826('0x13')][_0xa826('0x14')](this));this[_0xa826('0xe')]['on'](_0xa826('0x15'),this[_0xa826('0x16')][_0xa826('0x14')](this));this['imap'][_0xa826('0x17')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xa826('0x18')][_0xa826('0xd')]=function(_0x5dc0c7,_0x512ba9){var _0x49c91e={'connTimeout':_0x5dc0c7[_0xa826('0x19')]?_0x5dc0c7['connTimeout']*0x3e8:0x2710,'authTimeout':_0x5dc0c7['authTimeout']?_0x5dc0c7[_0xa826('0x1a')]*0x3e8:0x1388};if(_[_0xa826('0x1b')](_0x5dc0c7[_0xa826('0x1c')])){if(_0x5dc0c7['authentication']){_0x49c91e[_0xa826('0x1d')]=_0x5dc0c7[_0xa826('0x1d')];_0x49c91e[_0xa826('0x1e')]=_0x5dc0c7[_0xa826('0x1e')];}_0x49c91e[_0xa826('0x1f')]=_0x5dc0c7['host'];_0x49c91e[_0xa826('0x20')]=_0x5dc0c7[_0xa826('0x20')]||0x3e1;if(_0x5dc0c7[_0xa826('0x21')]){_0x49c91e['tls']=!![];}else{_0x49c91e['tls']=![];_0x49c91e[_0xa826('0x22')]=_0xa826('0x23');}}else{_0x49c91e[_0xa826('0x1d')]=_0x5dc0c7[_0xa826('0x1d')];_0x49c91e[_0xa826('0x1e')]=_0x5dc0c7['password'];_0x49c91e[_0xa826('0x1f')]=utils[_0xa826('0x24')](_0x5dc0c7[_0xa826('0x1c')]);_0x49c91e['port']=0x3e1;_0x49c91e['tls']=!![];}_0x49c91e[_0xa826('0x9')]=_0x512ba9||_0x5dc0c7[_0xa826('0x1d')]||_0xa826('0x25');return _0x49c91e;};EmailImap['prototype'][_0xa826('0x11')]=function(){this[_0xa826('0xe')][_0xa826('0x26')](this[_0xa826('0xa')],![],this[_0xa826('0x27')]['bind'](this));};EmailImap[_0xa826('0x18')]['handleOpenBox']=function(_0x17ef2d,_0x174f16){if(_0x17ef2d){this['handleError'](_0x17ef2d,!![]);}else{this[_0xa826('0x28')](_0xa826('0x29'),_0x174f16);this[_0xa826('0x2a')]();}};EmailImap[_0xa826('0x18')][_0xa826('0x2b')]=function(_0x3c6307){if(_0x3c6307){this[_0xa826('0x16')](_0x3c6307,!![]);}else{this[_0xa826('0xe')][_0xa826('0x12')]();}};EmailImap[_0xa826('0x18')][_0xa826('0x2a')]=function(){this[_0xa826('0xe')][_0xa826('0x2c')]([_0xa826('0x2d')],this[_0xa826('0x2e')][_0xa826('0x14')](this));};EmailImap['prototype'][_0xa826('0x2e')]=function(_0x5e8210,_0x2dd810){if(_0x5e8210){this[_0xa826('0x16')](_0x5e8210,!![]);}else{if(_0x2dd810[_0xa826('0x2f')]){try{var _0x27d779=this[_0xa826('0xe')]['fetch'](_0x2dd810,{'bodies':'','markSeen':!![]});_0x27d779['on']('message',this[_0xa826('0x30')][_0xa826('0x14')](this));_0x27d779[_0xa826('0xf')](_0xa826('0x15'),this['handleFetchError'][_0xa826('0x14')](this));_0x27d779[_0xa826('0xf')]('end',this[_0xa826('0x31')]['bind'](this));}catch(_0x189c71){logger[_0xa826('0x15')](_0x189c71);}}else{this[_0xa826('0xe')][_0xa826('0x32')](!![],this[_0xa826('0x2b')]['bind'](this));}}};EmailImap[_0xa826('0x18')][_0xa826('0x30')]=function(_0x29404c,_0x110ce5){_0x29404c['on'](_0xa826('0x33'),this[_0xa826('0x34')][_0xa826('0x14')](this));_0x29404c[_0xa826('0xf')](_0xa826('0x35'),this[_0xa826('0x36')][_0xa826('0x14')](this));_0x29404c['once'](_0xa826('0x12'),this['handleMessageEnd'][_0xa826('0x14')](this));};EmailImap['prototype'][_0xa826('0x34')]=function(_0x2bae70,_0x31889f){simpleParser(_0x2bae70,{'Iconv':Iconv},this[_0xa826('0x37')][_0xa826('0x14')](this));};EmailImap[_0xa826('0x18')][_0xa826('0x36')]=function(_0x18a018){};EmailImap[_0xa826('0x18')][_0xa826('0x38')]=function(){};EmailImap[_0xa826('0x18')][_0xa826('0x37')]=function(_0x5911d3,_0x3abd07){if(_0x5911d3){logger[_0xa826('0x15')](_0x5911d3);}else{var _0x251208=this;utils['parser'](this[_0xa826('0xc')],_0x3abd07,function(_0xeeb2d7){_0x251208['emit'](_0xa826('0x9'),_0xeeb2d7);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0xa826('0xe')][_0xa826('0x32')](!![],this[_0xa826('0x2b')][_0xa826('0x14')](this));};EmailImap[_0xa826('0x18')][_0xa826('0x39')]=function(_0x4de11c){this[_0xa826('0x16')](_0x4de11c);this[_0xa826('0xe')][_0xa826('0x32')](!![],this[_0xa826('0x2b')][_0xa826('0x14')](this));};EmailImap[_0xa826('0x18')]['handleEnd']=function(){this[_0xa826('0x28')](_0xa826('0x12'));};EmailImap[_0xa826('0x18')][_0xa826('0x16')]=function(_0x258e57,_0x53b70e){logger[_0xa826('0x15')](_0xa826('0x16'),this[_0xa826('0xc')][_0xa826('0x9')],JSON[_0xa826('0x3a')](_0x258e57));var _0x1fdc39='';if(_0x258e57){if(_0x258e57[_0xa826('0x3b')]){_0x1fdc39=_0x258e57[_0xa826('0x3b')];}else{for(var _0x459c79 in _0x258e57){if(_0x258e57[_0xa826('0x3c')](_0x459c79)){_0x1fdc39+=_[_0xa826('0x3d')](_0x459c79)+':\x20'+_0x258e57[_0x459c79]+'\x0a';}}}}if(_0x53b70e){this[_0xa826('0xe')]['end']();}else{this[_0xa826('0x28')](_0xa826('0x15'),_0x1fdc39);this[_0xa826('0x28')]('end');}};module[_0xa826('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 5ef9997..92f1369 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 _0x5aa3=['prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x5de33c,_0x349e02){var _0x57dabf=function(_0x1d6c56){while(--_0x1d6c56){_0x5de33c['push'](_0x5de33c['shift']());}};_0x57dabf(++_0x349e02);}(_0x5aa3,0x17d));var _0x35aa=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5aa3[_0x49b207];return _0x2dc8fa;};'use strict';var nodemailer=require(_0x35aa('0x0'));var BPromise=require(_0x35aa('0x1'));var inlineBase64=require(_0x35aa('0x2'));function EmailSmtp(){}EmailSmtp[_0x35aa('0x3')]['send']=function(_0x278dc7,_0xceef85){return new BPromise(function(_0x1b7955,_0x35217b){var _0x24ebbc=nodemailer[_0x35aa('0x4')](_0x278dc7);_0x24ebbc[_0x35aa('0x5')](_0x35aa('0x6'),inlineBase64());_0x24ebbc[_0x35aa('0x7')](_0xceef85,function(_0xff622f,_0x5cc355){if(_0xff622f){_0x35217b(_0xff622f[_0x35aa('0x8')]());}else{_0x1b7955(_0x5cc355);}});});};EmailSmtp[_0x35aa('0x3')]['verify']=function(_0x2b723e){return new BPromise(function(_0x45d4a0,_0x1ef1e8){var _0xec6db9=nodemailer[_0x35aa('0x4')](_0x2b723e);_0xec6db9[_0x35aa('0x9')](function(_0x51147a,_0x4c4c0d){if(_0x51147a){_0x1ef1e8(_0x51147a['toString']());}else{if(_0x4c4c0d){_0x45d4a0(_0x4c4c0d);}else{_0x1ef1e8(_0x35aa('0xa'));}}});});};module[_0x35aa('0xb')]=EmailSmtp; \ No newline at end of file +var _0x4ed6=['use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport'];(function(_0x2654ec,_0x30d1ba){var _0x4c3b5=function(_0x464e80){while(--_0x464e80){_0x2654ec['push'](_0x2654ec['shift']());}};_0x4c3b5(++_0x30d1ba);}(_0x4ed6,0x166));var _0x64ed=function(_0x519976,_0x3f36b1){_0x519976=_0x519976-0x0;var _0x338ac3=_0x4ed6[_0x519976];return _0x338ac3;};'use strict';var nodemailer=require(_0x64ed('0x0'));var BPromise=require(_0x64ed('0x1'));var inlineBase64=require(_0x64ed('0x2'));function EmailSmtp(){}EmailSmtp[_0x64ed('0x3')][_0x64ed('0x4')]=function(_0x391fe3,_0x3b3921){return new BPromise(function(_0x2dc7b3,_0x9e0a82){var _0x3d14ac=nodemailer[_0x64ed('0x5')](_0x391fe3);_0x3d14ac[_0x64ed('0x6')](_0x64ed('0x7'),inlineBase64());_0x3d14ac[_0x64ed('0x8')](_0x3b3921,function(_0x2890f0,_0x4dedda){if(_0x2890f0){_0x9e0a82(_0x2890f0[_0x64ed('0x9')]());}else{_0x2dc7b3(_0x4dedda);}});});};EmailSmtp[_0x64ed('0x3')][_0x64ed('0xa')]=function(_0x11fe9f){return new BPromise(function(_0x1ec815,_0x2ed572){var _0x4e1773=nodemailer[_0x64ed('0x5')](_0x11fe9f);_0x4e1773['verify'](function(_0x4361c8,_0x4e7f25){if(_0x4361c8){_0x2ed572(_0x4361c8[_0x64ed('0x9')]());}else{if(_0x4e7f25){_0x1ec815(_0x4e7f25);}else{_0x2ed572(_0x64ed('0xb'));}}});});};module[_0x64ed('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 8dbf7de..72190e2 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 _0x7334=['Empty\x20message

','Attachments','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','lodash','moment','randomstring','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','pop','html','replace'];(function(_0x224522,_0x1ad035){var _0xb24e1c=function(_0x268508){while(--_0x268508){_0x224522['push'](_0x224522['shift']());}};_0xb24e1c(++_0x1ad035);}(_0x7334,0x184));var _0x4733=function(_0x3c2af9,_0x2108d8){_0x3c2af9=_0x3c2af9-0x0;var _0x84b9b8=_0x7334[_0x3c2af9];return _0x84b9b8;};'use strict';var _=require(_0x4733('0x0'));var moment=require(_0x4733('0x1'));var random=require(_0x4733('0x2'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x4733('0x3'));var logger=require('../../../config/logger')(_0x4733('0x4'));var config=require(_0x4733('0x5'));function getAddress(_0x3645a2){var _0x29d7da=_[_0x4733('0x6')](_0x3645a2[_0x4733('0x7')]);return _0x29d7da&&_0x29d7da[_0x4733('0x8')]?_0x29d7da[_0x4733('0x8')]:_0x4733('0x9')+random[_0x4733('0xa')](0x6)+_0x4733('0xb');}function getFirstName(_0x3562b7){var _0x4c5c0=_[_0x4733('0x6')](_0x3562b7[_0x4733('0x7')]);if(_0x4c5c0&&_0x4c5c0[_0x4733('0xc')]){var _0x2bafad=_0x4c5c0['name'][_0x4733('0xd')](/\s+/);return _0x2bafad[_0x4733('0xe')]?_0x2bafad['slice'](0x0,-0x1)[_0x4733('0xf')]('\x20'):_0x4c5c0['name'];}return _0x4733('0x10');}function getLastName(_0x380b2e){var _0x44cb92=_[_0x4733('0x6')](_0x380b2e[_0x4733('0x7')]);if(_0x44cb92&&_0x44cb92[_0x4733('0xc')]){var _0x2c0f6b=_0x44cb92['name'][_0x4733('0xd')](/\s+/);return _0x2c0f6b['length']>0x1?_0x2c0f6b[_0x4733('0x11')]():'';}return'';}function getMails(_0x1a22e4,_0x2e5b1b){var _0x22283e='';for(var _0x3813df=0x0;_0x3813df<_0x2e5b1b[_0x4733('0x7')][_0x4733('0xe')];_0x3813df+=0x1){if(_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0x8')]!==_0x1a22e4){if(!_['isEmpty'](_0x22283e)){_0x22283e+=',';}_0x22283e+=_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0xc')]||_0x2e5b1b['value'][_0x3813df][_0x4733('0x8')]||'';_0x22283e+='\x20<';_0x22283e+=_0x2e5b1b[_0x4733('0x7')][_0x3813df][_0x4733('0x8')]?_0x2e5b1b[_0x4733('0x7')][_0x3813df]['address']:'anonymous'+random[_0x4733('0xa')](0x6)+_0x4733('0xb');_0x22283e+='>';}}return _0x22283e;}function parseEmail(_0x50c585,_0x32f166,_0x1943bc){if(_0x32f166[_0x4733('0x12')]){var _0x7a4e0=/)<[^<]*)*<\/script>/gi;while(_0x7a4e0['test'](_0x32f166[_0x4733('0x12')])){_0x32f166[_0x4733('0x12')]=_0x32f166['html'][_0x4733('0x13')](_0x7a4e0,'');}if(_0x32f166[_0x4733('0x12')]['includes'](_0x4733('0x14'))){var _0x115ce4=[];_0x32f166[_0x4733('0x15')][_0x4733('0x16')](_0x3a2542=>{_0x115ce4[_0x4733('0x17')](_0x3a2542[_0x4733('0x18')]);});var _0x2bb78f=/]+>/g;var _0x523697=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x3e6976=_0x32f166[_0x4733('0x12')][_0x4733('0x13')](_0x523697,_0x4733('0x19'));var _0x30ee9b=_0x3e6976[_0x4733('0x13')](_0x2bb78f,_0x4733('0x1a'));for(let _0xc3ab0a=0x0;_0xc3ab0a<_0x115ce4[_0x4733('0xe')];_0xc3ab0a++){var _0x23fe6c=_0x30ee9b['replace'](_0x4733('0x1a'),'\x20[Attachment:\x20'+_0x115ce4[_0xc3ab0a]+'\x20]');_0x30ee9b=_0x23fe6c;}_0x32f166[_0x4733('0x12')]=_0x30ee9b;}_0x1943bc['body']=_0x32f166[_0x4733('0x12')];}else{_0x1943bc['body']=_0x32f166['textAsHtml'];}if(_0x1943bc['body']){_0x1943bc[_0x4733('0x1b')]=_0x1943bc[_0x4733('0x1b')][_0x4733('0x13')](/','body','textAsHtml','message','originTo','originCc','isEmpty','bcc','attachments','attach','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xfef3,0x118));var _0x3fef=function(_0x53aaf8,_0x863bcb){_0x53aaf8=_0x53aaf8-0x0;var _0x1fedb1=_0xfef3[_0x53aaf8];return _0x1fedb1;};'use strict';var _=require(_0x3fef('0x0'));var moment=require('moment');var random=require(_0x3fef('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x3fef('0x2'));var tnef=require(_0x3fef('0x3'));var logger=require('../../../config/logger')(_0x3fef('0x4'));var config=require(_0x3fef('0x5'));function getAddress(_0x538f28){var _0x2f88b8=_[_0x3fef('0x6')](_0x538f28['value']);return _0x2f88b8&&_0x2f88b8[_0x3fef('0x7')]?_0x2f88b8[_0x3fef('0x7')]:_0x3fef('0x8')+random[_0x3fef('0x9')](0x6)+_0x3fef('0xa');}function getFirstName(_0x41960c){var _0x356ad8=_[_0x3fef('0x6')](_0x41960c[_0x3fef('0xb')]);if(_0x356ad8&&_0x356ad8[_0x3fef('0xc')]){var _0x67cdd8=_0x356ad8[_0x3fef('0xc')][_0x3fef('0xd')](/\s+/);return _0x67cdd8[_0x3fef('0xe')]?_0x67cdd8['slice'](0x0,-0x1)[_0x3fef('0xf')]('\x20'):_0x356ad8[_0x3fef('0xc')];}return _0x3fef('0x10');}function getLastName(_0x49d216){var _0x1c20b3=_['head'](_0x49d216[_0x3fef('0xb')]);if(_0x1c20b3&&_0x1c20b3[_0x3fef('0xc')]){var _0x2da64b=_0x1c20b3['name'][_0x3fef('0xd')](/\s+/);return _0x2da64b['length']>0x1?_0x2da64b[_0x3fef('0x11')]():'';}return'';}function getMails(_0x14c053,_0x56a65d){var _0x2dec1b='';for(var _0x177e28=0x0;_0x177e28<_0x56a65d[_0x3fef('0xb')][_0x3fef('0xe')];_0x177e28+=0x1){if(_0x56a65d[_0x3fef('0xb')][_0x177e28][_0x3fef('0x7')]!==_0x14c053){if(!_['isEmpty'](_0x2dec1b)){_0x2dec1b+=',';}_0x2dec1b+=_0x56a65d[_0x3fef('0xb')][_0x177e28][_0x3fef('0xc')]||_0x56a65d[_0x3fef('0xb')][_0x177e28][_0x3fef('0x7')]||'';_0x2dec1b+='\x20<';_0x2dec1b+=_0x56a65d[_0x3fef('0xb')][_0x177e28][_0x3fef('0x7')]?_0x56a65d['value'][_0x177e28][_0x3fef('0x7')]:_0x3fef('0x8')+random['generate'](0x6)+_0x3fef('0xa');_0x2dec1b+='>';}}return _0x2dec1b;}function parseEmail(_0x51a554,_0x42e095,_0x218f91){if(_0x42e095[_0x3fef('0x12')]){var _0x2b5226=/)<[^<]*)*<\/script>/gi;while(_0x2b5226[_0x3fef('0x13')](_0x42e095[_0x3fef('0x12')])){_0x42e095[_0x3fef('0x12')]=_0x42e095[_0x3fef('0x12')][_0x3fef('0x14')](_0x2b5226,'');}if(_0x42e095[_0x3fef('0x12')][_0x3fef('0x15')](_0x3fef('0x16'))){var _0x433a3e=[];_0x42e095['attachments']['forEach'](_0x50025f=>{_0x433a3e[_0x3fef('0x17')](_0x50025f[_0x3fef('0x18')]);});var _0xa16dc=/]+>/g;var _0x5f047c=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x4d462c=_0x42e095['html'][_0x3fef('0x14')](_0x5f047c,_0x3fef('0x19'));var _0x64d3e6=_0x4d462c[_0x3fef('0x14')](_0xa16dc,_0x3fef('0x1a'));for(let _0x492ea0=0x0;_0x492ea0<_0x433a3e['length'];_0x492ea0++){var _0x563556=_0x64d3e6[_0x3fef('0x14')](_0x3fef('0x1a'),'\x20[Attachment:\x20'+_0x433a3e[_0x492ea0]+_0x3fef('0x1b'));_0x64d3e6=_0x563556;}_0x42e095[_0x3fef('0x12')]=_0x64d3e6;}_0x218f91['body']=_0x42e095[_0x3fef('0x12')];}else{_0x218f91[_0x3fef('0x1c')]=_0x42e095[_0x3fef('0x1d')];}if(_0x218f91[_0x3fef('0x1c')]){_0x218f91[_0x3fef('0x1c')]=_0x218f91[_0x3fef('0x1c')][_0x3fef('0x14')](/0x0){if(this[_0x388033+_0xbfcd('0x27')]>0x0&&this[_0x388033+_0xbfcd('0x28')]>=this[_0x388033+_0xbfcd('0x27')]){return _0xbfcd('0x29');}else{return'working';}}else{return'idle';}};Agent['prototype']['updateRealtime']=function(){var _0x1b5d46=[_0xbfcd('0x2a'),_0xbfcd('0x2b'),'openchannel',_0xbfcd('0x2c'),_0xbfcd('0x2d'),'whatsapp'];for(var _0x3b421a=0x0;_0x3b421a<_0x1b5d46[_0xbfcd('0x2e')];_0x3b421a+=0x1){var _0xb33394=this['getChannelStatus'](_0x1b5d46[_0x3b421a]);if(this[_0x1b5d46[_0x3b421a]+'Status']!==_0xb33394){this[_0x1b5d46[_0x3b421a]+_0xbfcd('0x2f')]=_[_0xbfcd('0x30')](moment()[_0xbfcd('0x31')]('x'));}this[_0x1b5d46[_0x3b421a]+_0xbfcd('0x32')]=_0xb33394;}var _0x1ecf47={'id':this['id'],'name':this['name'],'online':this[_0xbfcd('0x9')],'voicePause':this[_0xbfcd('0xa')],'chatPause':this[_0xbfcd('0xb')],'mailPause':this[_0xbfcd('0xc')],'smsPause':this[_0xbfcd('0xe')],'faxPause':this[_0xbfcd('0xd')],'openchannelPause':this[_0xbfcd('0xf')],'chatStatus':this[_0xbfcd('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xbfcd('0x11')],'chatCurrentCapacity':this[_0xbfcd('0x12')],'mailStatus':this[_0xbfcd('0x33')],'mailStatusTime':this[_0xbfcd('0x14')],'mailCapacity':this[_0xbfcd('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xbfcd('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xbfcd('0x18')],'faxCurrentCapacity':this[_0xbfcd('0x19')],'smsStatus':this[_0xbfcd('0x1a')],'smsStatusTime':this[_0xbfcd('0x1b')],'smsCapacity':this[_0xbfcd('0x1c')],'smsCurrentCapacity':this[_0xbfcd('0x1d')],'whatsappStatus':this[_0xbfcd('0x34')],'whatsappStatusTime':this[_0xbfcd('0x1e')],'whatsappCapacity':this[_0xbfcd('0x1f')],'whatsappCurrentCapacity':this[_0xbfcd('0x20')],'openchannelStatus':this[_0xbfcd('0x21')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xbfcd('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xbfcd('0x24')],'busyQueue':this[_0xbfcd('0x35')]};var _0xe0d41=md5(JSON[_0xbfcd('0x36')](_0x1ecf47));if(this[_0xbfcd('0x1')]!==_0xe0d41){this[_0xbfcd('0x1')]=_0xe0d41;io[_0xbfcd('0x37')](_0xbfcd('0x38'),_0x1ecf47);}};module[_0xbfcd('0x39')]=Agent; \ No newline at end of file +var _0xcb58=['updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailCapacity','stringify','emit','user:save','exports','lodash','moment','md5','../../../config/environment','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue'];(function(_0x226e55,_0x2b4262){var _0xff48a5=function(_0xb7f95b){while(--_0xb7f95b){_0x226e55['push'](_0x226e55['shift']());}};_0xff48a5(++_0x2b4262);}(_0xcb58,0x93));var _0x8cb5=function(_0x45a933,_0x16bf87){_0x45a933=_0x45a933-0x0;var _0x291398=_0xcb58[_0x45a933];return _0x291398;};'use strict';var _=require(_0x8cb5('0x0'));var moment=require(_0x8cb5('0x1'));var md5=require(_0x8cb5('0x2'));var Redis=require('ioredis');var config=require(_0x8cb5('0x3'));config[_0x8cb5('0x4')]=_['defaults'](config[_0x8cb5('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8cb5('0x4')]));function Agent(_0x54cbed){this['id']=_0x54cbed['id']||0x0;this[_0x8cb5('0x5')]=_0x54cbed[_0x8cb5('0x5')]||'';this[_0x8cb5('0x6')]=_0x54cbed['online']||!![];this['voicePause']=_0x54cbed[_0x8cb5('0x7')]||![];this[_0x8cb5('0x8')]=_0x54cbed['chatPause']||![];this[_0x8cb5('0x9')]=_0x54cbed['mailPause']||![];this[_0x8cb5('0xa')]=_0x54cbed[_0x8cb5('0xa')]||![];this[_0x8cb5('0xb')]=_0x54cbed[_0x8cb5('0xb')]||![];this[_0x8cb5('0xc')]=_0x54cbed[_0x8cb5('0xc')]||![];this[_0x8cb5('0xd')]='unknown';this[_0x8cb5('0xe')]=0x0;this[_0x8cb5('0xf')]=_0x54cbed['chatCapacity']||0x0;this[_0x8cb5('0x10')]=0x0;this[_0x8cb5('0x11')]=_0x8cb5('0x12');this[_0x8cb5('0x13')]=0x0;this['mailCapacity']=_0x54cbed['mailCapacity']||0x0;this[_0x8cb5('0x14')]=0x0;this[_0x8cb5('0x15')]='unknown';this[_0x8cb5('0x16')]=0x0;this['faxCapacity']=_0x54cbed[_0x8cb5('0x17')]||0x0;this[_0x8cb5('0x18')]=0x0;this[_0x8cb5('0x19')]=_0x8cb5('0x12');this[_0x8cb5('0x1a')]=0x0;this[_0x8cb5('0x1b')]=_0x54cbed['smsCapacity']||0x0;this[_0x8cb5('0x1c')]=0x0;this[_0x8cb5('0x1d')]=_0x8cb5('0x12');this[_0x8cb5('0x1e')]=0x0;this[_0x8cb5('0x1f')]=_0x54cbed['whatsappCapacity']||0x0;this[_0x8cb5('0x20')]=0x0;this[_0x8cb5('0x21')]=_0x8cb5('0x12');this[_0x8cb5('0x22')]=0x0;this[_0x8cb5('0x23')]=_0x54cbed[_0x8cb5('0x23')]||0x0;this[_0x8cb5('0x24')]=0x0;this[_0x8cb5('0x25')]=![];this[_0x8cb5('0x26')]=undefined;this[_0x8cb5('0x2')]='';this[_0x8cb5('0x27')]();}Agent[_0x8cb5('0x28')][_0x8cb5('0x29')]=function(_0x5598b1){if(this[_0x5598b1+_0x8cb5('0x2a')]>0x0){if(this[_0x5598b1+_0x8cb5('0x2b')]>0x0&&this[_0x5598b1+_0x8cb5('0x2a')]>=this[_0x5598b1+_0x8cb5('0x2b')]){return _0x8cb5('0x2c');}else{return _0x8cb5('0x2d');}}else{return _0x8cb5('0x2e');}};Agent[_0x8cb5('0x28')]['updateRealtime']=function(){var _0x3bfc7b=['mail',_0x8cb5('0x2f'),_0x8cb5('0x30'),_0x8cb5('0x31'),_0x8cb5('0x32'),_0x8cb5('0x33')];for(var _0x4deb19=0x0;_0x4deb19<_0x3bfc7b[_0x8cb5('0x34')];_0x4deb19+=0x1){var _0x16e92c=this[_0x8cb5('0x29')](_0x3bfc7b[_0x4deb19]);if(this[_0x3bfc7b[_0x4deb19]+_0x8cb5('0x35')]!==_0x16e92c){this[_0x3bfc7b[_0x4deb19]+_0x8cb5('0x36')]=_[_0x8cb5('0x37')](moment()[_0x8cb5('0x38')]('x'));}this[_0x3bfc7b[_0x4deb19]+_0x8cb5('0x35')]=_0x16e92c;}var _0x436509={'id':this['id'],'name':this['name'],'online':this[_0x8cb5('0x6')],'voicePause':this[_0x8cb5('0x7')],'chatPause':this[_0x8cb5('0x8')],'mailPause':this[_0x8cb5('0x9')],'smsPause':this[_0x8cb5('0xb')],'faxPause':this[_0x8cb5('0xa')],'openchannelPause':this[_0x8cb5('0xc')],'chatStatus':this[_0x8cb5('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x8cb5('0xf')],'chatCurrentCapacity':this[_0x8cb5('0x10')],'mailStatus':this[_0x8cb5('0x11')],'mailStatusTime':this[_0x8cb5('0x13')],'mailCapacity':this[_0x8cb5('0x39')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x8cb5('0x15')],'faxStatusTime':this[_0x8cb5('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x8cb5('0x18')],'smsStatus':this[_0x8cb5('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x8cb5('0x1e')],'whatsappCapacity':this[_0x8cb5('0x1f')],'whatsappCurrentCapacity':this[_0x8cb5('0x20')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x8cb5('0x22')],'openchannelCapacity':this[_0x8cb5('0x23')],'openchannelCurrentCapacity':this[_0x8cb5('0x24')],'busy':this[_0x8cb5('0x25')],'busyQueue':this[_0x8cb5('0x26')]};var _0x2d1981=md5(JSON[_0x8cb5('0x3a')](_0x436509));if(this[_0x8cb5('0x2')]!==_0x2d1981){this[_0x8cb5('0x2')]=_0x2d1981;io[_0x8cb5('0x3b')](_0x8cb5('0x3c'),_0x436509);}};module[_0x8cb5('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index b374ba5..6061021 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 _0xe44e=['loggedIn','paused','online','available','waiting','stringify','format','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map'];(function(_0x33d2b6,_0xee05fc){var _0xd23a37=function(_0x527021){while(--_0x527021){_0x33d2b6['push'](_0x33d2b6['shift']());}};_0xd23a37(++_0xee05fc);}(_0xe44e,0xb2));var _0xee44=function(_0x4165a2,_0x569da6){_0x4165a2=_0x4165a2-0x0;var _0x185b75=_0xe44e[_0x4165a2];return _0x185b75;};'use strict';var _=require(_0xee44('0x0'));var md5=require(_0xee44('0x1'));var util=require(_0xee44('0x2'));var Redis=require('ioredis');var config=require(_0xee44('0x3'));config[_0xee44('0x4')]=_[_0xee44('0x5')](config[_0xee44('0x4')],{'host':_0xee44('0x6'),'port':0x18eb});var io=require(_0xee44('0x7'))(new Redis(config[_0xee44('0x4')]));function ChatQueue(_0x1f70fd){this['id']=_0x1f70fd['id']||0x0;this['name']=_0x1f70fd[_0xee44('0x8')]||'';this[_0xee44('0x9')]=_0x1f70fd[_0xee44('0x9')]||0xa;this[_0xee44('0xa')]=_0x1f70fd[_0xee44('0xa')]||_0xee44('0xb');this[_0xee44('0xc')]=_0x1f70fd['Agents'];this[_0xee44('0xd')]={};this['waiting']=0x0;this[_0xee44('0x1')]='';this[_0xee44('0xe')]();this[_0xee44('0xf')]();}ChatQueue['prototype'][_0xee44('0xe')]=function(){var _0x39ceaf=this[_0xee44('0xd')][_0xee44('0x10')];this['mapAgentsId']=_[_0xee44('0x11')](this[_0xee44('0xc')],'id');this[_0xee44('0xd')]['_rr']=_0x39ceaf;};ChatQueue['prototype'][_0xee44('0xf')]=function(){this[_0xee44('0x12')]=0x0;this[_0xee44('0x13')]=0x0;for(var _0x13aef6=0x0;_0x13aef6=0x0?this[_0xee44('0x15')]:0x0;var _0x1a57e0={'id':this['id'],'available':this[_0xee44('0x15')],'loggedIn':this[_0xee44('0x12')],'name':this[_0xee44('0x8')],'paused':this[_0xee44('0x13')],'waiting':this[_0xee44('0x16')]};var _0x46e38d=md5(JSON[_0xee44('0x17')](_0x1a57e0));if(this[_0xee44('0x1')]!==_0x46e38d){this['md5']=_0x46e38d;io['to'](util[_0xee44('0x18')](_0xee44('0x19'),_0x1a57e0[_0xee44('0x8')]))[_0xee44('0x1a')]('chat_queue:save',_0x1a57e0);}};module[_0xee44('0x1b')]=ChatQueue; \ No newline at end of file +var _0x87a3=['prototype','_rr','loggedIn','paused','length','available','name','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x87a3,0x1dc));var _0x387a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x87a3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x387a('0x0'));var md5=require(_0x387a('0x1'));var util=require(_0x387a('0x2'));var Redis=require(_0x387a('0x3'));var config=require(_0x387a('0x4'));config[_0x387a('0x5')]=_[_0x387a('0x6')](config[_0x387a('0x5')],{'host':_0x387a('0x7'),'port':0x18eb});var io=require(_0x387a('0x8'))(new Redis(config['redis']));function ChatQueue(_0x163854){this['id']=_0x163854['id']||0x0;this['name']=_0x163854['name']||'';this[_0x387a('0x9')]=_0x163854[_0x387a('0x9')]||0xa;this[_0x387a('0xa')]=_0x163854[_0x387a('0xa')]||_0x387a('0xb');this[_0x387a('0xc')]=_0x163854[_0x387a('0xc')];this[_0x387a('0xd')]={};this[_0x387a('0xe')]=0x0;this[_0x387a('0x1')]='';this[_0x387a('0xf')]();this[_0x387a('0x10')]();}ChatQueue[_0x387a('0x11')][_0x387a('0xf')]=function(){var _0x4509d2=this[_0x387a('0xd')][_0x387a('0x12')];this[_0x387a('0xd')]=_['map'](this['Agents'],'id');this[_0x387a('0xd')][_0x387a('0x12')]=_0x4509d2;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x387a('0x13')]=0x0;this[_0x387a('0x14')]=0x0;for(var _0x25ede3=0x0;_0x25ede3=0x0?this[_0x387a('0x16')]:0x0;var _0x2d0cf7={'id':this['id'],'available':this[_0x387a('0x16')],'loggedIn':this[_0x387a('0x13')],'name':this[_0x387a('0x17')],'paused':this['paused'],'waiting':this[_0x387a('0xe')]};var _0x40d62f=md5(JSON[_0x387a('0x18')](_0x2d0cf7));if(this[_0x387a('0x1')]!==_0x40d62f){this[_0x387a('0x1')]=_0x40d62f;io['to'](util['format'](_0x387a('0x19'),_0x2d0cf7['name']))[_0x387a('0x1a')](_0x387a('0x1b'),_0x2d0cf7);}};module[_0x387a('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 d357af1..6d02336 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 _0xa26a=['paused','online','loggedIn','available','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0xa26a,0x1b8));var _0xaa26=function(_0xb9a6f7,_0x2e1ffd){_0xb9a6f7=_0xb9a6f7-0x0;var _0x5cc5f6=_0xa26a[_0xb9a6f7];return _0x5cc5f6;};'use strict';var _=require(_0xaa26('0x0'));var md5=require(_0xaa26('0x1'));var util=require(_0xaa26('0x2'));var Redis=require(_0xaa26('0x3'));var config=require(_0xaa26('0x4'));config[_0xaa26('0x5')]=_['defaults'](config[_0xaa26('0x5')],{'host':_0xaa26('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaa26('0x5')]));function FaxQueue(_0x1a9e76){this['id']=_0x1a9e76['id']||0x0;this[_0xaa26('0x7')]=_0x1a9e76[_0xaa26('0x7')]||'';this[_0xaa26('0x8')]=_0x1a9e76[_0xaa26('0x8')]||0xa;this['strategy']=_0x1a9e76[_0xaa26('0x9')]||_0xaa26('0xa');this['Agents']=_0x1a9e76[_0xaa26('0xb')];this[_0xaa26('0xc')]={};this[_0xaa26('0xd')]=0x0;this['md5']='';this[_0xaa26('0xe')]();this['updateRealtime']();}FaxQueue[_0xaa26('0xf')]['updateRouting']=function(){var _0x5c69db=this['mapAgentsId']['_rr'];this[_0xaa26('0xc')]=_[_0xaa26('0x10')](this[_0xaa26('0xb')],'id');this['mapAgentsId'][_0xaa26('0x11')]=_0x5c69db;};FaxQueue[_0xaa26('0xf')][_0xaa26('0x12')]=function(){this['loggedIn']=0x0;this[_0xaa26('0x13')]=0x0;for(var _0x3c74d4=0x0;_0x3c74d4=0x0?this['available']:0x0;var _0x32ecf4={'id':this['id'],'available':this[_0xaa26('0x16')],'loggedIn':this[_0xaa26('0x15')],'name':this[_0xaa26('0x7')],'paused':this[_0xaa26('0x13')],'waiting':this['waiting']};var _0x1e722a=md5(JSON['stringify'](_0x32ecf4));if(this[_0xaa26('0x1')]!==_0x1e722a){this[_0xaa26('0x1')]=_0x1e722a;io['to'](util[_0xaa26('0x17')](_0xaa26('0x18'),_0x32ecf4[_0xaa26('0x7')]))[_0xaa26('0x19')](_0xaa26('0x1a'),_0x32ecf4);}};module['exports']=FaxQueue; \ No newline at end of file +var _0xc13d=['exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','Agents','updateRouting','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','length','faxPause','available','name','waiting','stringify','fax:queue:%s','emit','fax_queue:save'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc13d,0x1dd));var _0xdc13=function(_0x2f5bbc,_0x277b93){_0x2f5bbc=_0x2f5bbc-0x0;var _0x2f6675=_0xc13d[_0x2f5bbc];return _0x2f6675;};'use strict';var _=require('lodash');var md5=require(_0xdc13('0x0'));var util=require(_0xdc13('0x1'));var Redis=require(_0xdc13('0x2'));var config=require(_0xdc13('0x3'));config['redis']=_[_0xdc13('0x4')](config[_0xdc13('0x5')],{'host':_0xdc13('0x6'),'port':0x18eb});var io=require(_0xdc13('0x7'))(new Redis(config[_0xdc13('0x5')]));function FaxQueue(_0x266931){this['id']=_0x266931['id']||0x0;this['name']=_0x266931['name']||'';this[_0xdc13('0x8')]=_0x266931[_0xdc13('0x8')]||0xa;this['strategy']=_0x266931[_0xdc13('0x9')]||'beepall';this[_0xdc13('0xa')]=_0x266931[_0xdc13('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xdc13('0x0')]='';this[_0xdc13('0xb')]();this['updateRealtime']();}FaxQueue['prototype'][_0xdc13('0xb')]=function(){var _0x534d0d=this['mapAgentsId'][_0xdc13('0xc')];this[_0xdc13('0xd')]=_[_0xdc13('0xe')](this['Agents'],'id');this[_0xdc13('0xd')][_0xdc13('0xc')]=_0x534d0d;};FaxQueue['prototype'][_0xdc13('0xf')]=function(){this[_0xdc13('0x10')]=0x0;this[_0xdc13('0x11')]=0x0;for(var _0x21200f=0x0;_0x21200f=0x0?this[_0xdc13('0x14')]:0x0;var _0x2706b6={'id':this['id'],'available':this[_0xdc13('0x14')],'loggedIn':this[_0xdc13('0x10')],'name':this[_0xdc13('0x15')],'paused':this['paused'],'waiting':this[_0xdc13('0x16')]};var _0x3148ce=md5(JSON[_0xdc13('0x17')](_0x2706b6));if(this[_0xdc13('0x0')]!==_0x3148ce){this[_0xdc13('0x0')]=_0x3148ce;io['to'](util['format'](_0xdc13('0x18'),_0x2706b6['name']))[_0xdc13('0x19')](_0xdc13('0x1a'),_0x2706b6);}};module[_0xdc13('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index ac62720..8150327 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 _0xb5a4=['exports','name','Intervals'];(function(_0x916690,_0x55c8db){var _0x278f95=function(_0xd2ec89){while(--_0xd2ec89){_0x916690['push'](_0x916690['shift']());}};_0x278f95(++_0x55c8db);}(_0xb5a4,0xd6));var _0x4b5a=function(_0x15d81a,_0xa02752){_0x15d81a=_0x15d81a-0x0;var _0x85b78=_0xb5a4[_0x15d81a];return _0x85b78;};'use strict';function Interval(_0x478f6a){this['id']=_0x478f6a['id']||0x0;this['name']=_0x478f6a[_0x4b5a('0x0')]||'';this[_0x4b5a('0x1')]=_0x478f6a[_0x4b5a('0x1')]||{};}module[_0x4b5a('0x2')]=Interval; \ No newline at end of file +var _0x621a=['name','Intervals','exports'];(function(_0x215b28,_0xfe7764){var _0x339cd1=function(_0x16a115){while(--_0x16a115){_0x215b28['push'](_0x215b28['shift']());}};_0x339cd1(++_0xfe7764);}(_0x621a,0x162));var _0xa621=function(_0x196ddc,_0x514491){_0x196ddc=_0x196ddc-0x0;var _0x5d15f2=_0x621a[_0x196ddc];return _0x5d15f2;};'use strict';function Interval(_0x35c930){this['id']=_0x35c930['id']||0x0;this[_0xa621('0x0')]=_0x35c930['name']||'';this[_0xa621('0x1')]=_0x35c930[_0xa621('0x1')]||{};}module[_0xa621('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index cf97f51..151a3dc 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 _0x027e=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','prototype','updateRouting','_rr','mapAgentsId','map','updateRealtime','loggedIn','paused','online','available','stringify','format','mail:queue:%s','emit','lodash','md5','util','../../../config/environment','redis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x027e,0xdb));var _0xe027=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x027e[_0x3e32a8];return _0x2997b0;};'use strict';var _=require(_0xe027('0x0'));var md5=require(_0xe027('0x1'));var util=require(_0xe027('0x2'));var Redis=require('ioredis');var config=require(_0xe027('0x3'));config[_0xe027('0x4')]=_[_0xe027('0x5')](config[_0xe027('0x4')],{'host':_0xe027('0x6'),'port':0x18eb});var io=require(_0xe027('0x7'))(new Redis(config[_0xe027('0x4')]));function MailQueue(_0xefc1b4){this['id']=_0xefc1b4['id']||0x0;this[_0xe027('0x8')]=_0xefc1b4[_0xe027('0x8')]||'';this[_0xe027('0x9')]=_0xefc1b4[_0xe027('0x9')]||0xa;this[_0xe027('0xa')]=_0xefc1b4[_0xe027('0xa')]||_0xe027('0xb');this[_0xe027('0xc')]=_0xefc1b4['Agents'];this['mapAgentsId']={};this[_0xe027('0xd')]=0x0;this[_0xe027('0x1')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xe027('0xe')][_0xe027('0xf')]=function(){var _0x1b2840=this['mapAgentsId'][_0xe027('0x10')];this[_0xe027('0x11')]=_[_0xe027('0x12')](this[_0xe027('0xc')],'id');this[_0xe027('0x11')][_0xe027('0x10')]=_0x1b2840;};MailQueue[_0xe027('0xe')][_0xe027('0x13')]=function(){this[_0xe027('0x14')]=0x0;this[_0xe027('0x15')]=0x0;for(var _0x27a31e=0x0;_0x27a31e=0x0?this[_0xe027('0x17')]:0x0;var _0x28bbdf={'id':this['id'],'available':this[_0xe027('0x17')],'loggedIn':this[_0xe027('0x14')],'name':this[_0xe027('0x8')],'paused':this['paused'],'waiting':this[_0xe027('0xd')]};var _0x45af3a=md5(JSON[_0xe027('0x18')](_0x28bbdf));if(this[_0xe027('0x1')]!==_0x45af3a){this[_0xe027('0x1')]=_0x45af3a;io['to'](util[_0xe027('0x19')](_0xe027('0x1a'),_0x28bbdf[_0xe027('0x8')]))[_0xe027('0x1b')]('mail_queue:save',_0x28bbdf);}};module['exports']=MailQueue; \ No newline at end of file +var _0xed02=['beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','available','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','strategy'];(function(_0x38acde,_0x20a2f6){var _0x47185a=function(_0x312587){while(--_0x312587){_0x38acde['push'](_0x38acde['shift']());}};_0x47185a(++_0x20a2f6);}(_0xed02,0x16e));var _0x2ed0=function(_0x42c410,_0x18238c){_0x42c410=_0x42c410-0x0;var _0x45df40=_0xed02[_0x42c410];return _0x45df40;};'use strict';var _=require(_0x2ed0('0x0'));var md5=require(_0x2ed0('0x1'));var util=require(_0x2ed0('0x2'));var Redis=require(_0x2ed0('0x3'));var config=require(_0x2ed0('0x4'));config[_0x2ed0('0x5')]=_[_0x2ed0('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2ed0('0x5')]));function MailQueue(_0x47056b){this['id']=_0x47056b['id']||0x0;this[_0x2ed0('0x7')]=_0x47056b[_0x2ed0('0x7')]||'';this['timeout']=_0x47056b['timeout']||0xa;this['strategy']=_0x47056b[_0x2ed0('0x8')]||_0x2ed0('0x9');this[_0x2ed0('0xa')]=_0x47056b[_0x2ed0('0xa')];this[_0x2ed0('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x2ed0('0xc')]();this[_0x2ed0('0xd')]();}MailQueue[_0x2ed0('0xe')]['updateRouting']=function(){var _0xe48431=this[_0x2ed0('0xb')][_0x2ed0('0xf')];this['mapAgentsId']=_[_0x2ed0('0x10')](this[_0x2ed0('0xa')],'id');this[_0x2ed0('0xb')][_0x2ed0('0xf')]=_0xe48431;};MailQueue[_0x2ed0('0xe')][_0x2ed0('0xd')]=function(){this[_0x2ed0('0x11')]=0x0;this[_0x2ed0('0x12')]=0x0;for(var _0x3bff1f=0x0;_0x3bff1f=0x0?this[_0x2ed0('0x14')]:0x0;var _0x2b37fd={'id':this['id'],'available':this[_0x2ed0('0x14')],'loggedIn':this[_0x2ed0('0x11')],'name':this['name'],'paused':this[_0x2ed0('0x12')],'waiting':this['waiting']};var _0x575039=md5(JSON['stringify'](_0x2b37fd));if(this[_0x2ed0('0x1')]!==_0x575039){this[_0x2ed0('0x1')]=_0x575039;io['to'](util[_0x2ed0('0x15')](_0x2ed0('0x16'),_0x2b37fd[_0x2ed0('0x7')]))[_0x2ed0('0x17')]('mail_queue:save',_0x2b37fd);}};module[_0x2ed0('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 1c27f0f..8ab2e4c 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x326f,0xd1));var _0xf326=function(_0x130263,_0x468ba5){_0x130263=_0x130263-0x0;var _0x1b7869=_0x326f[_0x130263];return _0x1b7869;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('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 7a4bad6..0cae43f 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 _0x3299=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','online','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment'];(function(_0x27b215,_0x2ce5fb){var _0x5d9e64=function(_0x1972c0){while(--_0x1972c0){_0x27b215['push'](_0x27b215['shift']());}};_0x5d9e64(++_0x2ce5fb);}(_0x3299,0x1bc));var _0x9329=function(_0x385d93,_0x230aed){_0x385d93=_0x385d93-0x0;var _0x570924=_0x3299[_0x385d93];return _0x570924;};'use strict';var _=require('lodash');var md5=require(_0x9329('0x0'));var util=require(_0x9329('0x1'));var Redis=require(_0x9329('0x2'));var config=require(_0x9329('0x3'));config[_0x9329('0x4')]=_[_0x9329('0x5')](config[_0x9329('0x4')],{'host':_0x9329('0x6'),'port':0x18eb});var io=require(_0x9329('0x7'))(new Redis(config[_0x9329('0x4')]));function SmsQueue(_0x404689){this['id']=_0x404689['id']||0x0;this[_0x9329('0x8')]=_0x404689[_0x9329('0x8')]||'';this[_0x9329('0x9')]=_0x404689[_0x9329('0x9')]||0xa;this[_0x9329('0xa')]=_0x404689[_0x9329('0xa')]||'beepall';this[_0x9329('0xb')]=_0x404689[_0x9329('0xb')];this[_0x9329('0xc')]={};this[_0x9329('0xd')]=0x0;this[_0x9329('0x0')]='';this['updateRouting']();this[_0x9329('0xe')]();}SmsQueue[_0x9329('0xf')]['updateRouting']=function(){var _0x5604d8=this['mapAgentsId'][_0x9329('0x10')];this[_0x9329('0xc')]=_[_0x9329('0x11')](this[_0x9329('0xb')],'id');this[_0x9329('0xc')]['_rr']=_0x5604d8;};SmsQueue[_0x9329('0xf')][_0x9329('0xe')]=function(){this[_0x9329('0x12')]=0x0;this['paused']=0x0;for(var _0x1ee23e=0x0;_0x1ee23e=0x0?this[_0x9329('0x16')]:0x0;var _0x57718b={'id':this['id'],'available':this[_0x9329('0x16')],'loggedIn':this[_0x9329('0x12')],'name':this['name'],'paused':this[_0x9329('0x15')],'waiting':this['waiting']};var _0x21bdb=md5(JSON['stringify'](_0x57718b));if(this[_0x9329('0x0')]!==_0x21bdb){this['md5']=_0x21bdb;io['to'](util[_0x9329('0x17')](_0x9329('0x18'),_0x57718b[_0x9329('0x8')]))[_0x9329('0x19')](_0x9329('0x1a'),_0x57718b);}};module[_0x9329('0x1b')]=SmsQueue; \ No newline at end of file +var _0xdb4b=['_rr','map','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdb4b,0xd7));var _0xbdb4=function(_0xb953a,_0x3d230e){_0xb953a=_0xb953a-0x0;var _0x27ea69=_0xdb4b[_0xb953a];return _0x27ea69;};'use strict';var _=require('lodash');var md5=require(_0xbdb4('0x0'));var util=require('util');var Redis=require(_0xbdb4('0x1'));var config=require(_0xbdb4('0x2'));config[_0xbdb4('0x3')]=_[_0xbdb4('0x4')](config['redis'],{'host':_0xbdb4('0x5'),'port':0x18eb});var io=require(_0xbdb4('0x6'))(new Redis(config[_0xbdb4('0x3')]));function SmsQueue(_0xf0cf67){this['id']=_0xf0cf67['id']||0x0;this[_0xbdb4('0x7')]=_0xf0cf67[_0xbdb4('0x7')]||'';this[_0xbdb4('0x8')]=_0xf0cf67['timeout']||0xa;this['strategy']=_0xf0cf67[_0xbdb4('0x9')]||_0xbdb4('0xa');this[_0xbdb4('0xb')]=_0xf0cf67[_0xbdb4('0xb')];this['mapAgentsId']={};this[_0xbdb4('0xc')]=0x0;this['md5']='';this[_0xbdb4('0xd')]();this[_0xbdb4('0xe')]();}SmsQueue[_0xbdb4('0xf')]['updateRouting']=function(){var _0x5b4412=this[_0xbdb4('0x10')][_0xbdb4('0x11')];this[_0xbdb4('0x10')]=_[_0xbdb4('0x12')](this['Agents'],'id');this['mapAgentsId'][_0xbdb4('0x11')]=_0x5b4412;};SmsQueue[_0xbdb4('0xf')][_0xbdb4('0xe')]=function(){this[_0xbdb4('0x13')]=0x0;this[_0xbdb4('0x14')]=0x0;for(var _0x310780=0x0;_0x310780=0x0?this[_0xbdb4('0x17')]:0x0;var _0x4a180b={'id':this['id'],'available':this[_0xbdb4('0x17')],'loggedIn':this[_0xbdb4('0x13')],'name':this[_0xbdb4('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x995070=md5(JSON[_0xbdb4('0x18')](_0x4a180b));if(this['md5']!==_0x995070){this[_0xbdb4('0x0')]=_0x995070;io['to'](util[_0xbdb4('0x19')](_0xbdb4('0x1a'),_0x4a180b['name']))[_0xbdb4('0x1b')]('sms_queue:save',_0x4a180b);}};module[_0xbdb4('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ddbe2cc..9b6c62a 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2134=['beepall','Agents','mapAgentsId','updateRouting','updateRealtime','loggedIn','length','whatsappPause','paused','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','localhost','socket.io-emitter','redis','name','timeout','strategy'];(function(_0x29db36,_0x552f1c){var _0x2ce948=function(_0x38f175){while(--_0x38f175){_0x29db36['push'](_0x29db36['shift']());}};_0x2ce948(++_0x552f1c);}(_0x2134,0x1a6));var _0x4213=function(_0x54ad0d,_0x4ad589){_0x54ad0d=_0x54ad0d-0x0;var _0x41d2ed=_0x2134[_0x54ad0d];return _0x41d2ed;};'use strict';var _=require(_0x4213('0x0'));var md5=require(_0x4213('0x1'));var util=require(_0x4213('0x2'));var Redis=require(_0x4213('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0x4213('0x4'),'port':0x18eb});var io=require(_0x4213('0x5'))(new Redis(config[_0x4213('0x6')]));function WhatsappQueue(_0x598bf6){this['id']=_0x598bf6['id']||0x0;this[_0x4213('0x7')]=_0x598bf6[_0x4213('0x7')]||'';this[_0x4213('0x8')]=_0x598bf6[_0x4213('0x8')]||0xa;this['strategy']=_0x598bf6[_0x4213('0x9')]||_0x4213('0xa');this['Agents']=_0x598bf6[_0x4213('0xb')];this[_0x4213('0xc')]={};this['waiting']=0x0;this[_0x4213('0x1')]='';this[_0x4213('0xd')]();this[_0x4213('0xe')]();}WhatsappQueue['prototype'][_0x4213('0xd')]=function(){var _0xbb99d4=this['mapAgentsId']['_rr'];this[_0x4213('0xc')]=_['map'](this[_0x4213('0xb')],'id');this[_0x4213('0xc')]['_rr']=_0xbb99d4;};WhatsappQueue['prototype'][_0x4213('0xe')]=function(){this[_0x4213('0xf')]=0x0;this['paused']=0x0;for(var _0x49414e=0x0;_0x49414e=0x0?this[_0x4213('0x13')]:0x0;var _0x20501f={'id':this['id'],'available':this[_0x4213('0x13')],'loggedIn':this[_0x4213('0xf')],'name':this[_0x4213('0x7')],'paused':this['paused'],'waiting':this[_0x4213('0x14')]};var _0x20984d=md5(JSON[_0x4213('0x15')](_0x20501f));if(this[_0x4213('0x1')]!==_0x20984d){this['md5']=_0x20984d;io['to'](util[_0x4213('0x16')](_0x4213('0x17'),_0x20501f[_0x4213('0x7')]))[_0x4213('0x18')](_0x4213('0x19'),_0x20501f);}};module[_0x4213('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x5c51=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','stringify','format','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x5c51,0xc5));var _0x15c5=function(_0x2f8530,_0x5cbd67){_0x2f8530=_0x2f8530-0x0;var _0x5e814e=_0x5c51[_0x2f8530];return _0x5e814e;};'use strict';var _=require(_0x15c5('0x0'));var md5=require('md5');var util=require(_0x15c5('0x1'));var Redis=require('ioredis');var config=require(_0x15c5('0x2'));config[_0x15c5('0x3')]=_[_0x15c5('0x4')](config[_0x15c5('0x3')],{'host':_0x15c5('0x5'),'port':0x18eb});var io=require(_0x15c5('0x6'))(new Redis(config[_0x15c5('0x3')]));function WhatsappQueue(_0x232e82){this['id']=_0x232e82['id']||0x0;this[_0x15c5('0x7')]=_0x232e82[_0x15c5('0x7')]||'';this[_0x15c5('0x8')]=_0x232e82[_0x15c5('0x8')]||0xa;this['strategy']=_0x232e82[_0x15c5('0x9')]||_0x15c5('0xa');this[_0x15c5('0xb')]=_0x232e82['Agents'];this[_0x15c5('0xc')]={};this[_0x15c5('0xd')]=0x0;this[_0x15c5('0xe')]='';this[_0x15c5('0xf')]();this[_0x15c5('0x10')]();}WhatsappQueue[_0x15c5('0x11')][_0x15c5('0xf')]=function(){var _0x490ca3=this[_0x15c5('0xc')][_0x15c5('0x12')];this[_0x15c5('0xc')]=_[_0x15c5('0x13')](this[_0x15c5('0xb')],'id');this[_0x15c5('0xc')][_0x15c5('0x12')]=_0x490ca3;};WhatsappQueue[_0x15c5('0x11')][_0x15c5('0x10')]=function(){this[_0x15c5('0x14')]=0x0;this[_0x15c5('0x15')]=0x0;for(var _0x407e8c=0x0;_0x407e8c=0x0?this[_0x15c5('0x18')]:0x0;var _0x5bdd62={'id':this['id'],'available':this[_0x15c5('0x18')],'loggedIn':this[_0x15c5('0x14')],'name':this['name'],'paused':this[_0x15c5('0x15')],'waiting':this[_0x15c5('0xd')]};var _0xd95db1=md5(JSON[_0x15c5('0x19')](_0x5bdd62));if(this[_0x15c5('0xe')]!==_0xd95db1){this[_0x15c5('0xe')]=_0xd95db1;io['to'](util[_0x15c5('0x1a')]('whatsapp:queue:%s',_0x5bdd62[_0x15c5('0x7')]))[_0x15c5('0x1b')]('whatsapp_queue:save',_0x5bdd62);}};module[_0x15c5('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 39a28a1..c2049e5 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x16ae92,_0x1abafe){var _0x2a7904=function(_0x1203a6){while(--_0x1203a6){_0x16ae92['push'](_0x16ae92['shift']());}};_0x2a7904(++_0x1abafe);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d247c,_0x3dff9e){_0x4d247c=_0x4d247c-0x0;var _0x42c60c=_0xb10b[_0x4d247c];return _0x42c60c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x455c51,_0x4bb4f6){var _0x4ac7d7=function(_0xbcc3bf){while(--_0xbcc3bf){_0x455c51['push'](_0x455c51['shift']());}};_0x4ac7d7(++_0x4bb4f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x1bc42d,_0x1b8a92){_0x1bc42d=_0x1bc42d-0x0;var _0x2a4351=_0xb10b[_0x1bc42d];return _0x2a4351;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 0ccf75e..72b407b 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 _0x8af0=['../client','update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x588f29,_0x1f56c0){var _0x3b0cae=function(_0x3df152){while(--_0x3df152){_0x588f29['push'](_0x588f29['shift']());}};_0x3b0cae(++_0x1f56c0);}(_0x8af0,0xf6));var _0x08af=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x8af0[_0x440917];return _0x5e906b;};'use strict';var client=require(_0x08af('0x0'));exports[_0x08af('0x1')]=function(_0x3af636,_0x5e37d2){return client[_0x08af('0x2')]('UpdateChatInteraction',{'body':_0x5e37d2,'options':{'where':{'id':_0x3af636}},'log':'updateChatInteraction'});};exports[_0x08af('0x3')]=function(_0x416477,_0x10f59d){return client['Request'](_0x08af('0x4'),{'body':_0x10f59d,'options':{'where':{'id':_0x416477}},'log':_0x08af('0x5')});}; \ No newline at end of file +var _0xebbb=['UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2c5826,_0x47bf55){var _0x1058e1=function(_0xbe91d8){while(--_0xbe91d8){_0x2c5826['push'](_0x2c5826['shift']());}};_0x1058e1(++_0x47bf55);}(_0xebbb,0x177));var _0xbebb=function(_0x4fcc90,_0x3443c1){_0x4fcc90=_0x4fcc90-0x0;var _0xf775eb=_0xebbb[_0x4fcc90];return _0xf775eb;};'use strict';var client=require(_0xbebb('0x0'));exports[_0xbebb('0x1')]=function(_0x19ce6e,_0x33bdcd){return client[_0xbebb('0x2')](_0xbebb('0x3'),{'body':_0x33bdcd,'options':{'where':{'id':_0x19ce6e}},'log':'updateChatInteraction'});};exports[_0xbebb('0x4')]=function(_0x23c90b,_0x2ba059){return client[_0xbebb('0x2')](_0xbebb('0x5'),{'body':_0x2ba059,'options':{'where':{'id':_0x23c90b}},'log':_0xbebb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c085b17..f3f0823 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 _0xe52b=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x502972,_0x35ccfb){var _0x288c35=function(_0x145459){while(--_0x145459){_0x502972['push'](_0x502972['shift']());}};_0x288c35(++_0x35ccfb);}(_0xe52b,0x1cf));var _0xbe52=function(_0x223ed6,_0x137718){_0x223ed6=_0x223ed6-0x0;var _0x12f224=_0xe52b[_0x223ed6];return _0x12f224;};'use strict';var client=require(_0xbe52('0x0'));exports[_0xbe52('0x1')]=function(_0x585ccf){return client[_0xbe52('0x2')](_0xbe52('0x3'),{'body':_0x585ccf,'log':_0xbe52('0x4')});}; \ No newline at end of file +var _0x7f38=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7f38,0x1b6));var _0x87f3=function(_0x31b676,_0x473ee5){_0x31b676=_0x31b676-0x0;var _0x49e3e1=_0x7f38[_0x31b676];return _0x49e3e1;};'use strict';var client=require(_0x87f3('0x0'));exports[_0x87f3('0x1')]=function(_0x94086){return client[_0x87f3('0x2')](_0x87f3('0x3'),{'body':_0x94086,'log':_0x87f3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 977d057..3f49973 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 _0x6bac=['name','timeout','online','getChatQueues','../client','Request','GetChatQueue'];(function(_0x2089b3,_0x31fbde){var _0x181087=function(_0x31d19b){while(--_0x31d19b){_0x2089b3['push'](_0x2089b3['shift']());}};_0x181087(++_0x31fbde);}(_0x6bac,0xa5));var _0xc6ba=function(_0x5e99cf,_0x5945c7){_0x5e99cf=_0x5e99cf-0x0;var _0x5329be=_0x6bac[_0x5e99cf];return _0x5329be;};'use strict';var client=require(_0xc6ba('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xc6ba('0x1')](_0xc6ba('0x2'),{'options':{'raw':![],'attributes':['id',_0xc6ba('0x3'),_0xc6ba('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xc6ba('0x3'),_0xc6ba('0x5'),'chatPause']}]},'log':_0xc6ba('0x6')});};}; \ No newline at end of file +var _0xcdd0=['chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','Agents','online'];(function(_0x33747e,_0x219a50){var _0x4a61c1=function(_0x13e401){while(--_0x13e401){_0x33747e['push'](_0x33747e['shift']());}};_0x4a61c1(++_0x219a50);}(_0xcdd0,0xd9));var _0x0cdd=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xcdd0[_0x31cb5f];return _0x586042;};'use strict';var client=require(_0x0cdd('0x0'));exports[_0x0cdd('0x1')]=function(){return function(){return client[_0x0cdd('0x2')](_0x0cdd('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0cdd('0x4'),'strategy'],'include':[{'model':'User','as':_0x0cdd('0x5'),'attributes':['id','name',_0x0cdd('0x6'),_0x0cdd('0x7')]}]},'log':_0x0cdd('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 42eae53..ef967d7 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 _0xfdb5=['update','Request','DESC','../client','create','CreateChatQueueReport'];(function(_0xf74319,_0x322518){var _0x42c7e1=function(_0x1968da){while(--_0x1968da){_0xf74319['push'](_0xf74319['shift']());}};_0x42c7e1(++_0x322518);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfdb5[_0x4c445a];return _0x2f611c;};'use strict';var client=require(_0x5fdb('0x0'));exports[_0x5fdb('0x1')]=function(_0x18abfe){return client['Request'](_0x5fdb('0x2'),{'body':_0x18abfe,'log':_0x5fdb('0x2')});};exports[_0x5fdb('0x3')]=function(_0x49fd4d,_0x55124b){return client[_0x5fdb('0x4')]('UpdateChatQueueReport',{'body':_0x55124b,'options':{'where':{'uniqueid':_0x49fd4d},'order':[['id',_0x5fdb('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x4bd1=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x4c6ca2,_0x355f5c){var _0x54c3a2=function(_0x4db5ac){while(--_0x4db5ac){_0x4c6ca2['push'](_0x4c6ca2['shift']());}};_0x54c3a2(++_0x355f5c);}(_0x4bd1,0x90));var _0x14bd=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x4bd1[_0x5af97c];return _0x3472ae;};'use strict';var client=require('../client');exports[_0x14bd('0x0')]=function(_0x5ef5c7){return client[_0x14bd('0x1')](_0x14bd('0x2'),{'body':_0x5ef5c7,'log':'CreateChatQueueReport'});};exports[_0x14bd('0x3')]=function(_0x45948d,_0x51fcdb){return client[_0x14bd('0x1')](_0x14bd('0x4'),{'body':_0x51fcdb,'options':{'where':{'uniqueid':_0x45948d},'order':[['id',_0x14bd('0x5')]],'limit':0x1},'log':_0x14bd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 7664b47..d2813f2 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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x7a54,0x106));var _0x47a5=function(_0x2e5694,_0x2d624a){_0x2e5694=_0x2e5694-0x0;var _0xdef189=_0x7a54[_0x2e5694];return _0xdef189;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 6ee05a7..d68c679 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 _0x40cd=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x40cd,0x14f));var _0xd40c=function(_0xa68324,_0x424be1){_0xa68324=_0xa68324-0x0;var _0x19dd73=_0x40cd[_0xa68324];return _0x19dd73;};'use strict';var client=require('../client');exports['create']=function(_0x76ae4b){return client[_0xd40c('0x0')](_0xd40c('0x1'),{'body':_0x76ae4b,'log':_0xd40c('0x2')});}; \ No newline at end of file +var _0x1e0e=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x2a6e0c,_0x31f481){var _0x408b4c=function(_0x2cdd89){while(--_0x2cdd89){_0x2a6e0c['push'](_0x2a6e0c['shift']());}};_0x408b4c(++_0x31f481);}(_0x1e0e,0xc9));var _0xe1e0=function(_0x284061,_0x2c8b1c){_0x284061=_0x284061-0x0;var _0x290de2=_0x1e0e[_0x284061];return _0x290de2;};'use strict';var client=require('../client');exports[_0xe1e0('0x0')]=function(_0x313fa1){return client[_0xe1e0('0x1')](_0xe1e0('0x2'),{'body':_0x313fa1,'log':_0xe1e0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 73f0e0d..fc885c9 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 _0x8c82=['name','strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x8c82,0xec));var _0x28c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c82[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x28c8('0x0'));exports[_0x28c8('0x1')]=function(){return function(){return client[_0x28c8('0x2')](_0x28c8('0x3'),{'options':{'raw':![],'attributes':['id',_0x28c8('0x4'),'timeout',_0x28c8('0x5')],'include':[{'model':_0x28c8('0x6'),'as':_0x28c8('0x7'),'attributes':['id',_0x28c8('0x4'),_0x28c8('0x8'),_0x28c8('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xe460=['Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User'];(function(_0x3c0c5d,_0x5e4829){var _0x2b9552=function(_0x3eb1bc){while(--_0x3eb1bc){_0x3c0c5d['push'](_0x3c0c5d['shift']());}};_0x2b9552(++_0x5e4829);}(_0xe460,0xd5));var _0x0e46=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xe460[_0x3e0dc4];return _0x586111;};'use strict';var client=require(_0x0e46('0x0'));exports[_0x0e46('0x1')]=function(){return function(){return client[_0x0e46('0x2')](_0x0e46('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0e46('0x4'),_0x0e46('0x5')],'include':[{'model':_0x0e46('0x6'),'as':_0x0e46('0x7'),'attributes':['id','name',_0x0e46('0x8'),_0x0e46('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 47fe70b..35396dd 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 _0xb982=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x2327ae,_0x3d2eae){var _0x471a4d=function(_0x1af8b9){while(--_0x1af8b9){_0x2327ae['push'](_0x2327ae['shift']());}};_0x471a4d(++_0x3d2eae);}(_0xb982,0x12f));var _0x2b98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb982[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x2b98('0x0'));exports[_0x2b98('0x1')]=function(_0x2e39a5){return client[_0x2b98('0x2')](_0x2b98('0x3'),{'body':_0x2e39a5,'log':_0x2b98('0x3')});};exports['update']=function(_0x48c559,_0x1c6f29){return client[_0x2b98('0x2')](_0x2b98('0x4'),{'body':_0x1c6f29,'options':{'where':{'uniqueid':_0x48c559},'order':[['id',_0x2b98('0x5')]],'limit':0x1},'log':_0x2b98('0x4')});}; \ No newline at end of file +var _0x48ae=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x19fddd,_0x13c8ad){var _0x59f7ac=function(_0x3a9d0e){while(--_0x3a9d0e){_0x19fddd['push'](_0x19fddd['shift']());}};_0x59f7ac(++_0x13c8ad);}(_0x48ae,0x1bc));var _0xe48a=function(_0x477732,_0x174917){_0x477732=_0x477732-0x0;var _0x4bf8b1=_0x48ae[_0x477732];return _0x4bf8b1;};'use strict';var client=require(_0xe48a('0x0'));exports['create']=function(_0x3b12c8){return client[_0xe48a('0x1')](_0xe48a('0x2'),{'body':_0x3b12c8,'log':_0xe48a('0x2')});};exports[_0xe48a('0x3')]=function(_0x5806c4,_0x53ff74){return client['Request'](_0xe48a('0x4'),{'body':_0x53ff74,'options':{'where':{'uniqueid':_0x5806c4},'order':[['id',_0xe48a('0x5')]],'limit':0x1},'log':_0xe48a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9493e35..35aa982 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 _0x96e5=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x96e5,0xaf));var _0x596e=function(_0x52ad48,_0x1fd591){_0x52ad48=_0x52ad48-0x0;var _0x47e25b=_0x96e5[_0x52ad48];return _0x47e25b;};'use strict';var client=require(_0x596e('0x0'));exports[_0x596e('0x1')]=function(){return function(){return client[_0x596e('0x2')](_0x596e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x596e('0x4')],'include':[{'model':_0x596e('0x5'),'as':_0x596e('0x6'),'attributes':['id',_0x596e('0x4'),_0x596e('0x7')]}]},'log':_0x596e('0x1')});};}; \ No newline at end of file +var _0x465d=['name','Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x1d90cb,_0xdac737){var _0x5d5793=function(_0x27d462){while(--_0x27d462){_0x1d90cb['push'](_0x1d90cb['shift']());}};_0x5d5793(++_0xdac737);}(_0x465d,0x65));var _0xd465=function(_0xf3e31a,_0x3b9ea3){_0xf3e31a=_0xf3e31a-0x0;var _0x18333a=_0x465d[_0xf3e31a];return _0x18333a;};'use strict';var client=require(_0xd465('0x0'));exports[_0xd465('0x1')]=function(){return function(){return client[_0xd465('0x2')](_0xd465('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd465('0x4')],'include':[{'model':'Interval','as':_0xd465('0x5'),'attributes':['id',_0xd465('0x4'),_0xd465('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 6d4b58e..c5d61cc 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 _0x0b0e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x13c12b,_0x4baa0d){var _0x4fcf37=function(_0xcd644e){while(--_0xcd644e){_0x13c12b['push'](_0x13c12b['shift']());}};_0x4fcf37(++_0x4baa0d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34aec4,_0x3801da){_0x34aec4=_0x34aec4-0x0;var _0x51e1a7=_0x0b0e[_0x34aec4];return _0x51e1a7;};'use strict';var client=require(_0xe0b0('0x0'));exports['update']=function(_0xc416e3,_0x536e9b){return client[_0xe0b0('0x1')](_0xe0b0('0x2'),{'body':_0x536e9b,'options':{'where':{'id':_0xc416e3}},'log':_0xe0b0('0x3')});};exports[_0xe0b0('0x4')]=function(_0x28040c,_0x38a058){return client[_0xe0b0('0x1')](_0xe0b0('0x5'),{'body':_0x38a058,'options':{'where':{'id':_0x28040c}},'log':_0xe0b0('0x6')});}; \ No newline at end of file +var _0x6a95=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x6a95,0x1db));var _0x56a9=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x6a95[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x15574a,_0xce37aa){return client[_0x56a9('0x2')](_0x56a9('0x3'),{'body':_0xce37aa,'options':{'where':{'id':_0x15574a}},'log':_0x56a9('0x4')});};exports['addTags']=function(_0x512f52,_0x12cd60){return client[_0x56a9('0x2')](_0x56a9('0x5'),{'body':_0x12cd60,'options':{'where':{'id':_0x512f52}},'log':_0x56a9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 0183bf6..ba4a977 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 _0x4d2a=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x4d2a,0xed));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa4d2('0x0'));exports[_0xa4d2('0x1')]=function(_0x14f651){return client[_0xa4d2('0x2')](_0xa4d2('0x3'),{'body':_0x14f651,'log':_0xa4d2('0x4')});}; \ No newline at end of file +var _0x3d28=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x3d28,0x65));var _0x83d2=function(_0x349986,_0xac79fd){_0x349986=_0x349986-0x0;var _0x443ffe=_0x3d28[_0x349986];return _0x443ffe;};'use strict';var client=require(_0x83d2('0x0'));exports['create']=function(_0x39170e){return client[_0x83d2('0x1')](_0x83d2('0x2'),{'body':_0x39170e,'log':_0x83d2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b5bca9f..274d723 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 _0x2374=['getMailQueues','../client','Request','GetMailQueue','strategy','Agents','name','online','mailPause'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x2374,0x88));var _0x4237=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2374[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0x4237('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x4237('0x1')](_0x4237('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x4237('0x3')],'include':[{'model':'User','as':_0x4237('0x4'),'attributes':['id',_0x4237('0x5'),_0x4237('0x6'),_0x4237('0x7')]}]},'log':_0x4237('0x8')});};}; \ No newline at end of file +var _0xa666=['../client','getMailQueues','name','timeout','strategy','User','Agents','online','mailPause'];(function(_0x4b8b61,_0x5baafe){var _0x568f3=function(_0x36849c){while(--_0x36849c){_0x4b8b61['push'](_0x4b8b61['shift']());}};_0x568f3(++_0x5baafe);}(_0xa666,0x132));var _0x6a66=function(_0x189947,_0x25fd64){_0x189947=_0x189947-0x0;var _0x222917=_0xa666[_0x189947];return _0x222917;};'use strict';var client=require(_0x6a66('0x0'));exports[_0x6a66('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x6a66('0x2'),_0x6a66('0x3'),_0x6a66('0x4')],'include':[{'model':_0x6a66('0x5'),'as':_0x6a66('0x6'),'attributes':['id',_0x6a66('0x2'),_0x6a66('0x7'),_0x6a66('0x8')]}]},'log':_0x6a66('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1b0850e..f9ba16e 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 _0x482e=['CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x482e,0x159));var _0xe482=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x482e[_0x36884e];return _0x1cc367;};'use strict';var client=require(_0xe482('0x0'));exports[_0xe482('0x1')]=function(_0xeaabb0){return client[_0xe482('0x2')](_0xe482('0x3'),{'body':_0xeaabb0,'log':_0xe482('0x3')});};exports['update']=function(_0x1e37b9,_0x35066a){return client[_0xe482('0x2')](_0xe482('0x4'),{'body':_0x35066a,'options':{'where':{'uniqueid':_0x1e37b9},'order':[['id',_0xe482('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x2168=['DESC','create','Request','update','UpdateMailQueueReport'];(function(_0x2ef972,_0x34291b){var _0x548d5f=function(_0x2610ee){while(--_0x2610ee){_0x2ef972['push'](_0x2ef972['shift']());}};_0x548d5f(++_0x34291b);}(_0x2168,0x6a));var _0x8216=function(_0x3c364c,_0x3296a3){_0x3c364c=_0x3c364c-0x0;var _0x1a8b69=_0x2168[_0x3c364c];return _0x1a8b69;};'use strict';var client=require('../client');exports[_0x8216('0x0')]=function(_0x1ad33c){return client[_0x8216('0x1')]('CreateMailQueueReport',{'body':_0x1ad33c,'log':'CreateMailQueueReport'});};exports[_0x8216('0x2')]=function(_0x13ea30,_0x524ccf){return client[_0x8216('0x1')](_0x8216('0x3'),{'body':_0x524ccf,'options':{'where':{'uniqueid':_0x13ea30},'order':[['id',_0x8216('0x4')]],'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 a44c1bc..e073793 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 _0x758c=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x41dfde,_0x583bea){var _0x190999=function(_0x202796){while(--_0x202796){_0x41dfde['push'](_0x41dfde['shift']());}};_0x190999(++_0x583bea);}(_0x758c,0x173));var _0xc758=function(_0x39e545,_0x15effc){_0x39e545=_0x39e545-0x0;var _0x63c26b=_0x758c[_0x39e545];return _0x63c26b;};'use strict';var client=require(_0xc758('0x0'));exports[_0xc758('0x1')]=function(_0x7e4627,_0x1e2fb1){return client[_0xc758('0x2')](_0xc758('0x3'),{'body':_0x1e2fb1,'options':{'where':{'id':_0x7e4627}},'log':_0xc758('0x4')});};exports[_0xc758('0x5')]=function(_0x52967d,_0x5a8ed2){return client[_0xc758('0x2')](_0xc758('0x6'),{'body':_0x5a8ed2,'options':{'where':{'id':_0x52967d}},'log':_0xc758('0x7')});}; \ No newline at end of file +var _0x2d68=['addTagsToChatInteraction','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x476a7e,_0x1c2720){var _0x1be744=function(_0x3b5485){while(--_0x3b5485){_0x476a7e['push'](_0x476a7e['shift']());}};_0x1be744(++_0x1c2720);}(_0x2d68,0x169));var _0x82d6=function(_0x449607,_0x287561){_0x449607=_0x449607-0x0;var _0x972d5=_0x2d68[_0x449607];return _0x972d5;};'use strict';var client=require('../client');exports[_0x82d6('0x0')]=function(_0x4d1881,_0x34a93c){return client[_0x82d6('0x1')]('UpdateOpenchannelInteraction',{'body':_0x34a93c,'options':{'where':{'id':_0x4d1881}},'log':_0x82d6('0x2')});};exports[_0x82d6('0x3')]=function(_0x12c8a3,_0x245835){return client['Request'](_0x82d6('0x4'),{'body':_0x245835,'options':{'where':{'id':_0x12c8a3}},'log':_0x82d6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 369e482..9ffa997 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 _0xc350=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xc350,0x6b));var _0x0c35=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xc350[_0x4e7d25];return _0x526fe6;};'use strict';var client=require(_0x0c35('0x0'));exports[_0x0c35('0x1')]=function(_0x4df425){return client[_0x0c35('0x2')](_0x0c35('0x3'),{'body':_0x4df425,'log':_0x0c35('0x4')});}; \ No newline at end of file +var _0x71eb=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x1ee33d,_0x103e52){var _0x19818a=function(_0x576113){while(--_0x576113){_0x1ee33d['push'](_0x1ee33d['shift']());}};_0x19818a(++_0x103e52);}(_0x71eb,0x1e9));var _0xb71e=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0x71eb[_0x3ff685];return _0x2046c9;};'use strict';var client=require('../client');exports['create']=function(_0x1d6fac){return client[_0xb71e('0x0')](_0xb71e('0x1'),{'body':_0x1d6fac,'log':_0xb71e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 92875e9..a013073 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 _0x0607=['timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues','GetOpenchannelQueue','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0607,0x16e));var _0x7060=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0607[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports[_0x7060('0x0')]=function(){return function(){return client['Request'](_0x7060('0x1'),{'options':{'raw':![],'attributes':['id',_0x7060('0x2'),_0x7060('0x3'),_0x7060('0x4')],'include':[{'model':_0x7060('0x5'),'as':_0x7060('0x6'),'attributes':['id','name',_0x7060('0x7'),_0x7060('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x8e24=['name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x8e24,0x1bf));var _0x48e2=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x8e24[_0x595013];return _0x2a29e3;};'use strict';var client=require(_0x48e2('0x0'));exports[_0x48e2('0x1')]=function(){return function(){return client['Request'](_0x48e2('0x2'),{'options':{'raw':![],'attributes':['id',_0x48e2('0x3'),_0x48e2('0x4'),_0x48e2('0x5')],'include':[{'model':_0x48e2('0x6'),'as':_0x48e2('0x7'),'attributes':['id',_0x48e2('0x3'),_0x48e2('0x8'),_0x48e2('0x9')]}]},'log':_0x48e2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 48dee33..8d7d908 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 _0x2dcf=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x2870fa,_0x3a9f82){var _0x44f6d0=function(_0x37e68a){while(--_0x37e68a){_0x2870fa['push'](_0x2870fa['shift']());}};_0x44f6d0(++_0x3a9f82);}(_0x2dcf,0x1c5));var _0xf2dc=function(_0x513675,_0x498821){_0x513675=_0x513675-0x0;var _0x361b72=_0x2dcf[_0x513675];return _0x361b72;};'use strict';var client=require(_0xf2dc('0x0'));exports[_0xf2dc('0x1')]=function(_0x1a3184){return client[_0xf2dc('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1a3184,'log':'CreateOpenchannelQueueReport'});};exports[_0xf2dc('0x3')]=function(_0x1657cb,_0x35ca48){return client[_0xf2dc('0x2')](_0xf2dc('0x4'),{'body':_0x35ca48,'options':{'where':{'uniqueid':_0x1657cb},'order':[['id',_0xf2dc('0x5')]],'limit':0x1},'log':_0xf2dc('0x4')});}; \ No newline at end of file +var _0xc196=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x594616,_0x56dd94){var _0x24080b=function(_0x427afe){while(--_0x427afe){_0x594616['push'](_0x594616['shift']());}};_0x24080b(++_0x56dd94);}(_0xc196,0x1bc));var _0x6c19=function(_0x317940,_0x41432e){_0x317940=_0x317940-0x0;var _0x47c9c7=_0xc196[_0x317940];return _0x47c9c7;};'use strict';var client=require(_0x6c19('0x0'));exports[_0x6c19('0x1')]=function(_0x17a79c){return client[_0x6c19('0x2')](_0x6c19('0x3'),{'body':_0x17a79c,'log':_0x6c19('0x3')});};exports['update']=function(_0x50189b,_0x26b087){return client[_0x6c19('0x2')](_0x6c19('0x4'),{'body':_0x26b087,'options':{'where':{'uniqueid':_0x50189b},'order':[['id',_0x6c19('0x5')]],'limit':0x1},'log':_0x6c19('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 4ecfa06..ebf44d7 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 _0x7722=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update'];(function(_0xcb1d60,_0x32603e){var _0x3beee9=function(_0x211a77){while(--_0x211a77){_0xcb1d60['push'](_0xcb1d60['shift']());}};_0x3beee9(++_0x32603e);}(_0x7722,0x14e));var _0x2772=function(_0x498953,_0x82d4af){_0x498953=_0x498953-0x0;var _0x4b2237=_0x7722[_0x498953];return _0x4b2237;};'use strict';var client=require(_0x2772('0x0'));exports[_0x2772('0x1')]=function(_0x1f7a11,_0x417876){return client[_0x2772('0x2')](_0x2772('0x3'),{'body':_0x417876,'options':{'where':{'id':_0x1f7a11}},'log':_0x2772('0x4')});};exports[_0x2772('0x5')]=function(_0x1c4d7f,_0x53f112){return client[_0x2772('0x2')]('AddTagsToSmsInteraction',{'body':_0x53f112,'options':{'where':{'id':_0x1c4d7f}},'log':_0x2772('0x6')});}; \ No newline at end of file +var _0xadec=['../client','update','Request'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0xadec,0x156));var _0xcade=function(_0x5d1ee8,_0x2edc1f){_0x5d1ee8=_0x5d1ee8-0x0;var _0x4a6a79=_0xadec[_0x5d1ee8];return _0x4a6a79;};'use strict';var client=require(_0xcade('0x0'));exports[_0xcade('0x1')]=function(_0x11d900,_0x210817){return client[_0xcade('0x2')]('UpdateSmsInteraction',{'body':_0x210817,'options':{'where':{'id':_0x11d900}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x475533,_0x875b81){return client[_0xcade('0x2')]('AddTagsToSmsInteraction',{'body':_0x875b81,'options':{'where':{'id':_0x475533}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8df422e..5c528f3 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 _0x1c31=['../client','create','Request'];(function(_0x114a5c,_0x1dced0){var _0x5536c6=function(_0x39e778){while(--_0x39e778){_0x114a5c['push'](_0x114a5c['shift']());}};_0x5536c6(++_0x1dced0);}(_0x1c31,0x174));var _0x11c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1c31[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x11c3('0x0'));exports[_0x11c3('0x1')]=function(_0x374b16){return client[_0x11c3('0x2')]('CreateSmsMessage',{'body':_0x374b16,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x7efa=['CreateSmsMessage','../client','create'];(function(_0x1903bc,_0x3a7faf){var _0x414f9f=function(_0x5184eb){while(--_0x5184eb){_0x1903bc['push'](_0x1903bc['shift']());}};_0x414f9f(++_0x3a7faf);}(_0x7efa,0x94));var _0xa7ef=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x7efa[_0x4d2993];return _0x427374;};'use strict';var client=require(_0xa7ef('0x0'));exports[_0xa7ef('0x1')]=function(_0x3ca580){return client['Request'](_0xa7ef('0x2'),{'body':_0x3ca580,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index dc29d20..ec69fa4 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x551349,_0x52cc8f){var _0x418cee=function(_0x5eb6f4){while(--_0x5eb6f4){_0x551349['push'](_0x551349['shift']());}};_0x418cee(++_0x52cc8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x4bb0b3,_0x547f2a){var _0x538a1b=function(_0x505fc0){while(--_0x505fc0){_0x4bb0b3['push'](_0x4bb0b3['shift']());}};_0x538a1b(++_0x547f2a);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f3bfb1d..a42e4cc 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x197603,_0x54ca39){var _0x1bac9a=function(_0x32e8c7){while(--_0x32e8c7){_0x197603['push'](_0x197603['shift']());}};_0x1bac9a(++_0x54ca39);}(_0x34e8,0x12c));var _0x834e=function(_0x3552b3,_0x4de3bd){_0x3552b3=_0x3552b3-0x0;var _0xf17cb0=_0x34e8[_0x3552b3];return _0xf17cb0;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x2347f8,_0xbb63a6){var _0x4acc7f=function(_0x286d9b){while(--_0x286d9b){_0x2347f8['push'](_0x2347f8['shift']());}};_0x4acc7f(++_0xbb63a6);}(_0x70e0,0x17b));var _0x070e=function(_0x4fdd44,_0x4c3c84){_0x4fdd44=_0x4fdd44-0x0;var _0x107d4b=_0x70e0[_0x4fdd44];return _0x107d4b;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 080721f..bb2bbdc 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2a8869,_0x37b48d){var _0x4811cf=function(_0x4041f2){while(--_0x4041f2){_0x2a8869['push'](_0x2a8869['shift']());}};_0x4811cf(++_0x37b48d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x47b1da,_0x16b11e){var _0x5f36f5=function(_0x33e2dd){while(--_0x33e2dd){_0x47b1da['push'](_0x47b1da['shift']());}};_0x5f36f5(++_0x16b11e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 7622281..13c490f 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd046=['update','UpdateWhatsappInteraction','Request'];(function(_0x4052af,_0x5c085c){var _0x27eac1=function(_0x300df0){while(--_0x300df0){_0x4052af['push'](_0x4052af['shift']());}};_0x27eac1(++_0x5c085c);}(_0xd046,0x129));var _0x6d04=function(_0x15dfe2,_0xa3da57){_0x15dfe2=_0x15dfe2-0x0;var _0x260feb=_0xd046[_0x15dfe2];return _0x260feb;};'use strict';var client=require('../client');exports[_0x6d04('0x0')]=function(_0x1a46d8,_0x32aaa4){return client['Request'](_0x6d04('0x1'),{'body':_0x32aaa4,'options':{'where':{'id':_0x1a46d8}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x33720a,_0x4d2121){return client[_0x6d04('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x4d2121,'options':{'where':{'id':_0x33720a}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x14b2=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x14b2,0x1a1));var _0x214b=function(_0x2fce02,_0x587df7){_0x2fce02=_0x2fce02-0x0;var _0x566ef1=_0x14b2[_0x2fce02];return _0x566ef1;};'use strict';var client=require(_0x214b('0x0'));exports[_0x214b('0x1')]=function(_0x4d4760,_0x2579a8){return client[_0x214b('0x2')](_0x214b('0x3'),{'body':_0x2579a8,'options':{'where':{'id':_0x4d4760}},'log':_0x214b('0x4')});};exports['addTags']=function(_0x1f27f5,_0x445396){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x445396,'options':{'where':{'id':_0x1f27f5}},'log':_0x214b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index daa9605..af13f22 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde1a=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xde1a,0x12a));var _0xade1=function(_0x5720f5,_0x2f20ba){_0x5720f5=_0x5720f5-0x0;var _0x477d2f=_0xde1a[_0x5720f5];return _0x477d2f;};'use strict';var client=require(_0xade1('0x0'));exports[_0xade1('0x1')]=function(_0x3e2999){return client[_0xade1('0x2')](_0xade1('0x3'),{'body':_0x3e2999,'log':_0xade1('0x4')});}; \ No newline at end of file +var _0x1258=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x4888d3,_0x2ca58a){var _0x24dec6=function(_0x427ce9){while(--_0x427ce9){_0x4888d3['push'](_0x4888d3['shift']());}};_0x24dec6(++_0x2ca58a);}(_0x1258,0xda));var _0x8125=function(_0x4fd139,_0x187257){_0x4fd139=_0x4fd139-0x0;var _0x3396cd=_0x1258[_0x4fd139];return _0x3396cd;};'use strict';var client=require(_0x8125('0x0'));exports[_0x8125('0x1')]=function(_0x39a4fa){return client[_0x8125('0x2')](_0x8125('0x3'),{'body':_0x39a4fa,'log':_0x8125('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 29f26ea..06137af 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbae6=['whatsappPause','../client','Request','GetWhatsappQueue','timeout','User','Agents','name'];(function(_0x3302c3,_0x4d648d){var _0x5ab9cc=function(_0x2b5e4f){while(--_0x2b5e4f){_0x3302c3['push'](_0x3302c3['shift']());}};_0x5ab9cc(++_0x4d648d);}(_0xbae6,0xb1));var _0x6bae=function(_0x588327,_0x332143){_0x588327=_0x588327-0x0;var _0x4ad0d9=_0xbae6[_0x588327];return _0x4ad0d9;};'use strict';var client=require(_0x6bae('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x6bae('0x1')](_0x6bae('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x6bae('0x3'),'strategy'],'include':[{'model':_0x6bae('0x4'),'as':_0x6bae('0x5'),'attributes':['id',_0x6bae('0x6'),'online',_0x6bae('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0xbdf4=['online','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdf4,0xa1));var _0x4bdf=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xbdf4[_0x2fc012];return _0x2891f9;};'use strict';var client=require('../client');exports[_0x4bdf('0x0')]=function(){return function(){return client[_0x4bdf('0x1')](_0x4bdf('0x2'),{'options':{'raw':![],'attributes':['id',_0x4bdf('0x3'),_0x4bdf('0x4'),_0x4bdf('0x5')],'include':[{'model':'User','as':_0x4bdf('0x6'),'attributes':['id',_0x4bdf('0x3'),_0x4bdf('0x7'),'whatsappPause']}]},'log':_0x4bdf('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 48c309a..2e3b9ca 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa90c=['update','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xa90c,0x6e));var _0xca90=function(_0x5ee3c2,_0x5c2ffe){_0x5ee3c2=_0x5ee3c2-0x0;var _0x3b0fe5=_0xa90c[_0x5ee3c2];return _0x3b0fe5;};'use strict';var client=require(_0xca90('0x0'));exports[_0xca90('0x1')]=function(_0x5d0685){return client[_0xca90('0x2')]('CreateWhatsappQueueReport',{'body':_0x5d0685,'log':_0xca90('0x3')});};exports[_0xca90('0x4')]=function(_0xcb455d,_0x544a96){return client[_0xca90('0x2')](_0xca90('0x5'),{'body':_0x544a96,'options':{'where':{'uniqueid':_0xcb455d},'order':[['id','DESC']],'limit':0x1},'log':_0xca90('0x5')});}; \ No newline at end of file +var _0x5cc6=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x5d9468,_0x836e83){var _0x4b07e8=function(_0x26dd60){while(--_0x26dd60){_0x5d9468['push'](_0x5d9468['shift']());}};_0x4b07e8(++_0x836e83);}(_0x5cc6,0x19b));var _0x65cc=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0x5cc6[_0x52bfa5];return _0x26f80b;};'use strict';var client=require(_0x65cc('0x0'));exports[_0x65cc('0x1')]=function(_0x393331){return client[_0x65cc('0x2')]('CreateWhatsappQueueReport',{'body':_0x393331,'log':_0x65cc('0x3')});};exports[_0x65cc('0x4')]=function(_0x4a6ead,_0x28e4d5){return client['Request'](_0x65cc('0x5'),{'body':_0x28e4d5,'options':{'where':{'uniqueid':_0x4a6ead},'order':[['id',_0x65cc('0x6')]],'limit':0x1},'log':_0x65cc('0x5')});}; \ 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 4a6ab87..2109d78 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 _0xfe42=['START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','format'];(function(_0x42a57a,_0x3fd9d0){var _0x53c4d4=function(_0x41d231){while(--_0x41d231){_0x42a57a['push'](_0x42a57a['shift']());}};_0x53c4d4(++_0x3fd9d0);}(_0xfe42,0x101));var _0x2fe4=function(_0x47908b,_0xc210d0){_0x47908b=_0x47908b-0x0;var _0x3aa373=_0xfe42[_0x47908b];return _0x3aa373;};'use strict';var schema=require(_0x2fe4('0x0'));var _=require(_0x2fe4('0x1'));var util=require(_0x2fe4('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')('routing');var strategy=require(_0x2fe4('0x3'));var queue=schema({'name':{'type':_0x2fe4('0x4'),'required':!![],'message':_0x2fe4('0x5')},'timeout':{'type':_0x2fe4('0x6'),'message':_0x2fe4('0x7')}});function writeLog(_0x570197,_0x3f0faa,_0x41a03c){return logger[_0x2fe4('0x8')](util['format'](_0x2fe4('0x9'),_0x570197,_0x3f0faa[_0x2fe4('0xa')],_0x41a03c));}function handleFindAgent(_0x2f8a37){return function(_0x5b7795){return _0x5b7795[_0x2fe4('0xa')][_0x2fe4('0xb')]()===_0x2f8a37[_0x2fe4('0xb')]();};}exports[_0x2fe4('0xc')]=function(_0x16619a,_0x3a973b,_0x352181,_0x2e9dd2){return function(_0xa229c7){try{var _0x1c6602={'name':_0x3a973b[0x0],'timeout':_0x3a973b[0x1]};var _0x31c2f=queue[_0x2fe4('0x0')](_0x1c6602,{'typecast':!![]});if(_0x31c2f['length']){logger[_0x2fe4('0xd')](_0x2fe4('0xe'),_0x16619a,_[_0x2fe4('0xf')](_0x31c2f,_0x2fe4('0x10'))[_0x2fe4('0x11')](',\x20'));_0xa229c7[_0x2fe4('0x12')]();}else{var _0x3ab007=_[_0x2fe4('0x13')](_0x352181[_0x2fe4('0x14')],handleFindAgent(_0x1c6602[_0x2fe4('0xa')]));if(_0x3ab007){var _0x5371d2=(_0x1c6602['timeout']||0xa)*0x3e8;var _0x54fd1e,_0x4fcc54;var _0xa27ed1=seqqueue[_0x2fe4('0x15')](_0x5371d2);_0xa27ed1['id']=_0x16619a;_0xa27ed1['atimeout']=_0x5371d2;_0xa27ed1['channel']=_0x2e9dd2['channel'];writeLog(_0x16619a,_0x3ab007,util[_0x2fe4('0x16')](_0x2fe4('0x17'),_0x5371d2));_0x352181[_0x2fe4('0x18')][_0x16619a]['on'](_0x2fe4('0x19'),function(){logger[_0x2fe4('0x8')](_0x2fe4('0x1a'),_0x16619a);clearTimeout(_0x4fcc54);_0x4fcc54=undefined;_0xa27ed1['close']();if(_0x352181[_0x2fe4('0x18')][_0x16619a]){delete _0x352181[_0x2fe4('0x18')][_0x16619a];}_0xa229c7[_0x2fe4('0x12')]();});_0x352181['rules'][_0x16619a]['on'](_0x2fe4('0x1b'),function(){if(_0x352181[_0x2fe4('0x18')][_0x16619a]){delete _0x352181[_0x2fe4('0x18')][_0x16619a];}});_0x4fcc54=setTimeout(function(){logger[_0x2fe4('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x16619a);clearTimeout(_0x4fcc54);_0xa27ed1[_0x2fe4('0x1c')]();_0xa229c7[_0x2fe4('0x1d')]();},_0x5371d2);strategy[_0x2fe4('0x1e')](_0xa27ed1,_0x3ab007,_0x352181,_0x2e9dd2);}else{logger[_0x2fe4('0xd')](_0x2fe4('0x1f'),_0x16619a,_0x1c6602[_0x2fe4('0xa')]);_0xa229c7[_0x2fe4('0x12')]();}}}catch(_0x59b0b3){console[_0x2fe4('0x20')](_0x59b0b3);logger[_0x2fe4('0xd')](_0x2fe4('0x21'),_0x16619a,_0x59b0b3[_0x2fe4('0x22')]);_0xa229c7[_0x2fe4('0x12')]();}};}; \ No newline at end of file +var _0x80e5=['seq-queue','routing','./strategy','string','number','info','format','name','toLowerCase','length','[%s][AGENT]\x20%s','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80e5,0x7e));var _0x580e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x80e5[_0x17d9e3];return _0x14192d;};'use strict';var schema=require(_0x580e('0x0'));var _=require('lodash');var util=require(_0x580e('0x1'));var seqqueue=require(_0x580e('0x2'));var logger=require('../../../../config/logger')(_0x580e('0x3'));var strategy=require(_0x580e('0x4'));var queue=schema({'name':{'type':_0x580e('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x580e('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1c773e,_0x1e0dbb,_0x1d6fa9){return logger[_0x580e('0x7')](util[_0x580e('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x1c773e,_0x1e0dbb[_0x580e('0x9')],_0x1d6fa9));}function handleFindAgent(_0x4e4874){return function(_0x1963f2){return _0x1963f2[_0x580e('0x9')][_0x580e('0xa')]()===_0x4e4874[_0x580e('0xa')]();};}exports['consequence']=function(_0x1c21ad,_0x2d4645,_0x4978a5,_0x1b9f95){return function(_0x38b605){try{var _0xd7cc09={'name':_0x2d4645[0x0],'timeout':_0x2d4645[0x1]};var _0x45c11f=queue[_0x580e('0x0')](_0xd7cc09,{'typecast':!![]});if(_0x45c11f[_0x580e('0xb')]){logger['error'](_0x580e('0xc'),_0x1c21ad,_['map'](_0x45c11f,'message')[_0x580e('0xd')](',\x20'));_0x38b605[_0x580e('0xe')]();}else{var _0x4db0fe=_[_0x580e('0xf')](_0x4978a5[_0x580e('0x10')],handleFindAgent(_0xd7cc09[_0x580e('0x9')]));if(_0x4db0fe){var _0x32d834=(_0xd7cc09[_0x580e('0x11')]||0xa)*0x3e8;var _0x5959b6,_0x1aa813;var _0x550d2c=seqqueue[_0x580e('0x12')](_0x32d834);_0x550d2c['id']=_0x1c21ad;_0x550d2c[_0x580e('0x13')]=_0x32d834;_0x550d2c[_0x580e('0x14')]=_0x1b9f95[_0x580e('0x14')];writeLog(_0x1c21ad,_0x4db0fe,util[_0x580e('0x8')](_0x580e('0x15'),_0x32d834));_0x4978a5['rules'][_0x1c21ad]['on'](_0x580e('0x16'),function(){logger[_0x580e('0x7')](_0x580e('0x17'),_0x1c21ad);clearTimeout(_0x1aa813);_0x1aa813=undefined;_0x550d2c[_0x580e('0x18')]();if(_0x4978a5['rules'][_0x1c21ad]){delete _0x4978a5[_0x580e('0x19')][_0x1c21ad];}_0x38b605['stop']();});_0x4978a5[_0x580e('0x19')][_0x1c21ad]['on'](_0x580e('0x1a'),function(){if(_0x4978a5[_0x580e('0x19')][_0x1c21ad]){delete _0x4978a5[_0x580e('0x19')][_0x1c21ad];}});_0x1aa813=setTimeout(function(){logger[_0x580e('0x7')]('[%s][AGENT]\x20ROUTING\x20END',_0x1c21ad);clearTimeout(_0x1aa813);_0x550d2c[_0x580e('0x18')]();_0x38b605['next']();},_0x32d834);strategy[_0x580e('0x1b')](_0x550d2c,_0x4db0fe,_0x4978a5,_0x1b9f95);}else{logger[_0x580e('0x1c')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1c21ad,_0xd7cc09[_0x580e('0x9')]);_0x38b605[_0x580e('0xe')]();}}}catch(_0x52e0d8){console[_0x580e('0x1d')](_0x52e0d8);logger[_0x580e('0x1c')](_0x580e('0x1e'),_0x1c21ad,_0x52e0d8[_0x580e('0x1f')]);_0x38b605[_0x580e('0xe')]();}};}; \ 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 d7c73a4..2c89066 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 _0x14af=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','getMustacheRender','create','info','error','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','toString','next','amazonlex','providerName','providerResponse','Message','dialogState','Failed','catch','lodash','moment','aws-sdk'];(function(_0xdfa07f,_0x17cd1c){var _0x11387d=function(_0xec67ec){while(--_0xec67ec){_0xdfa07f['push'](_0xdfa07f['shift']());}};_0x11387d(++_0x17cd1c);}(_0x14af,0x18d));var _0xf14a=function(_0x3f17a2,_0x3a1f1e){_0x3f17a2=_0x3f17a2-0x0;var _0x8fca68=_0x14af[_0x3f17a2];return _0x8fca68;};'use strict';var _=require(_0xf14a('0x0'));var moment=require(_0xf14a('0x1'));var AWS=require(_0xf14a('0x2'));var utils=require(_0xf14a('0x3'));var logger=require(_0xf14a('0x4'))(_0xf14a('0x5'));var rpc={'chatMessage':require(_0xf14a('0x6')),'openchannelMessage':require(_0xf14a('0x7')),'mailMessage':require(_0xf14a('0x8')),'smsMessage':require(_0xf14a('0x9')),'faxMessage':require(_0xf14a('0xa')),'whatsappMessage':require(_0xf14a('0xb'))};exports[_0xf14a('0xc')]=function(_0xa88cd1,_0x44d8e5){return function(_0x1e7c5a){try{if(!_[_0xf14a('0xd')](this['interaction']['UserId'])){logger['info']('[%s][AMAZONLEX]\x20%s',_0xa88cd1,_0xf14a('0xe'));return _0x1e7c5a['next']();}var _0x2b58fd={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf14a('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf14a('0x10')};if(this[_0xf14a('0x11')]===_0xf14a('0x12')||this[_0xf14a('0x11')]===_0xf14a('0x13')){_0x2b58fd[_0xf14a('0x14')]=this[_0xf14a('0x15')][_0xf14a('0x14')];}var _0x233d02=this[_0xf14a('0x11')];if(_0x233d02===_0xf14a('0x16')){_0x2b58fd[_0xf14a('0x17')]=this[_0xf14a('0x18')]['id'];}else{_0x2b58fd[_['upperFirst'](_0x233d02)+_0xf14a('0x19')]=this[_0xf14a('0x18')]['id'];}_0x2b58fd[_[_0xf14a('0x1a')](_0x233d02)+'InteractionId']=this['interaction']['id'];if(this[_0xf14a('0x15')]['created']){var _0xf0b79e=_0x44d8e5[0x4];if(!_[_0xf14a('0x1b')](_0xf0b79e)){_0x2b58fd[_0xf14a('0x1c')]=utils[_0xf14a('0x1d')](_0xf0b79e,this);return rpc[_0x233d02+'Message'][_0xf14a('0x1e')](_0x2b58fd)['then'](function(_0x1f512b){logger[_0xf14a('0x1f')]('[%s][AMAZONLEX]\x20%s',_0xa88cd1,_0x2b58fd['body']);})['catch'](function(_0x4bc3fa){logger[_0xf14a('0x20')](_0xf14a('0x21'),_0xa88cd1,JSON[_0xf14a('0x22')](_0x4bc3fa));})[_0xf14a('0x23')](function(){logger['info'](_0xf14a('0x24'),_0xa88cd1);_0x1e7c5a['stop']();});}else{logger[_0xf14a('0x1f')](_0xf14a('0x25'),_0xa88cd1);_0x1e7c5a[_0xf14a('0x26')]();}}else{var _0x1790a9=this;var _0x59e070=new AWS['LexRuntime']({'accessKeyId':_0x44d8e5[0x0],'secretAccessKey':_0x44d8e5[0x1],'region':_0x44d8e5[0x2]});var _0x3677e9={'botAlias':_0xf14a('0x27'),'botName':_0x44d8e5[0x3],'inputText':this[_0xf14a('0x28')][_0xf14a('0x1c')],'userId':this[_0xf14a('0x11')]+':'+this['interaction']['id'][_0xf14a('0x29')]()};_0x59e070['postText'](_0x3677e9,function(_0x1bb8c9,_0x55be19){if(_0x1bb8c9){logger[_0xf14a('0x20')]('[%s][AMAZONLEX]\x20%s',_0xa88cd1,_0x1bb8c9[_0xf14a('0x28')]);_0x1e7c5a[_0xf14a('0x2a')]();}else if(_0x55be19&&_0x55be19[_0xf14a('0x28')]){_0x1790a9['body'][_0xf14a('0x2b')]=_0x55be19;_0x2b58fd[_0xf14a('0x1c')]=_0x55be19[_0xf14a('0x28')];_0x2b58fd[_0xf14a('0x2c')]=_0xf14a('0x2b');_0x2b58fd[_0xf14a('0x2d')]=JSON[_0xf14a('0x22')](_0x55be19);return rpc[_0x233d02+_0xf14a('0x2e')][_0xf14a('0x1e')](_0x2b58fd)['then'](function(_0x3a0ec3){logger[_0xf14a('0x1f')]('[%s][AMAZONLEX]\x20%s',_0xa88cd1,_0x2b58fd['body']);if(_0x55be19[_0xf14a('0x2f')]==_0xf14a('0x30')){_0x1e7c5a[_0xf14a('0x2a')]();}else{_0x1e7c5a[_0xf14a('0x26')]();}})[_0xf14a('0x31')](function(_0xc63ff1){logger['error']('[%s][AMAZONLEX]\x20%s',_0xa88cd1,JSON[_0xf14a('0x22')](_0xc63ff1));_0x1e7c5a[_0xf14a('0x2a')]();});}else{_0x1e7c5a[_0xf14a('0x2a')]();}});}}catch(_0x2863e0){logger[_0xf14a('0x20')](_0xf14a('0x21'),_0xa88cd1,JSON[_0xf14a('0x22')](_0x2863e0));_0x1e7c5a[_0xf14a('0x26')]();}};}; \ No newline at end of file +var _0xa801=['catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','body','toString','postText','error','amazonlex','providerName','providerResponse','Failed','next','stop','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','ChatWebsiteId','AccountId','upperFirst','created','isEmpty','getMustacheRender','Message','create','then'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa801,0x138));var _0x1a80=function(_0x1eee9a,_0x4a4a19){_0x1eee9a=_0x1eee9a-0x0;var _0x5e38c5=_0xa801[_0x1eee9a];return _0x5e38c5;};'use strict';var _=require('lodash');var moment=require(_0x1a80('0x0'));var AWS=require('aws-sdk');var utils=require(_0x1a80('0x1'));var logger=require(_0x1a80('0x2'))(_0x1a80('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1a80('0x4')),'smsMessage':require(_0x1a80('0x5')),'faxMessage':require(_0x1a80('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x1a80('0x7')]=function(_0x3f8a79,_0x15d7de){return function(_0x5485ce){try{if(!_[_0x1a80('0x8')](this[_0x1a80('0x9')][_0x1a80('0xa')])){logger[_0x1a80('0xb')](_0x1a80('0xc'),_0x3f8a79,_0x1a80('0xd'));return _0x5485ce['next']();}var _0x3528df={'ContactId':this[_0x1a80('0xe')]['id'],'sentAt':moment()[_0x1a80('0xf')](_0x1a80('0x10')),'direction':_0x1a80('0x11')};if(this['channel']===_0x1a80('0x12')||this['channel']===_0x1a80('0x13')){_0x3528df[_0x1a80('0x14')]=this[_0x1a80('0x9')][_0x1a80('0x14')];}var _0x26b20c=this[_0x1a80('0x15')];if(_0x26b20c==='chat'){_0x3528df[_0x1a80('0x16')]=this['account']['id'];}else{_0x3528df[_['upperFirst'](_0x26b20c)+_0x1a80('0x17')]=this['account']['id'];}_0x3528df[_[_0x1a80('0x18')](_0x26b20c)+'InteractionId']=this[_0x1a80('0x9')]['id'];if(this[_0x1a80('0x9')][_0x1a80('0x19')]){var _0x2ee5f9=_0x15d7de[0x4];if(!_[_0x1a80('0x1a')](_0x2ee5f9)){_0x3528df['body']=utils[_0x1a80('0x1b')](_0x2ee5f9,this);return rpc[_0x26b20c+_0x1a80('0x1c')][_0x1a80('0x1d')](_0x3528df)[_0x1a80('0x1e')](function(_0x2c725b){logger[_0x1a80('0xb')](_0x1a80('0xc'),_0x3f8a79,_0x3528df['body']);})[_0x1a80('0x1f')](function(_0xf9ee0c){logger['error'](_0x1a80('0xc'),_0x3f8a79,JSON[_0x1a80('0x20')](_0xf9ee0c));})[_0x1a80('0x21')](function(){logger[_0x1a80('0xb')](_0x1a80('0x22'),_0x3f8a79);_0x5485ce['stop']();});}else{logger['info'](_0x1a80('0x23'),_0x3f8a79);_0x5485ce['stop']();}}else{var _0x5b5246=this;var _0x289bc5=new AWS[(_0x1a80('0x24'))]({'accessKeyId':_0x15d7de[0x0],'secretAccessKey':_0x15d7de[0x1],'region':_0x15d7de[0x2]});var _0x6644c3={'botAlias':_0x1a80('0x25'),'botName':_0x15d7de[0x3],'inputText':this[_0x1a80('0x26')][_0x1a80('0x27')],'userId':this['channel']+':'+this[_0x1a80('0x9')]['id'][_0x1a80('0x28')]()};_0x289bc5[_0x1a80('0x29')](_0x6644c3,function(_0x3b8f57,_0x5b2a65){if(_0x3b8f57){logger[_0x1a80('0x2a')](_0x1a80('0xc'),_0x3f8a79,_0x3b8f57['message']);_0x5485ce['next']();}else if(_0x5b2a65&&_0x5b2a65[_0x1a80('0x26')]){_0x5b5246[_0x1a80('0x27')][_0x1a80('0x2b')]=_0x5b2a65;_0x3528df[_0x1a80('0x27')]=_0x5b2a65[_0x1a80('0x26')];_0x3528df[_0x1a80('0x2c')]='amazonlex';_0x3528df[_0x1a80('0x2d')]=JSON[_0x1a80('0x20')](_0x5b2a65);return rpc[_0x26b20c+'Message'][_0x1a80('0x1d')](_0x3528df)[_0x1a80('0x1e')](function(_0x8e9568){logger['info'](_0x1a80('0xc'),_0x3f8a79,_0x3528df[_0x1a80('0x27')]);if(_0x5b2a65['dialogState']==_0x1a80('0x2e')){_0x5485ce[_0x1a80('0x2f')]();}else{_0x5485ce[_0x1a80('0x30')]();}})[_0x1a80('0x1f')](function(_0x1fbb09){logger['error'](_0x1a80('0xc'),_0x3f8a79,JSON['stringify'](_0x1fbb09));_0x5485ce[_0x1a80('0x2f')]();});}else{_0x5485ce[_0x1a80('0x2f')]();}});}}catch(_0x4cedbc){logger[_0x1a80('0x2a')](_0x1a80('0xc'),_0x3f8a79,JSON[_0x1a80('0x20')](_0x4cedbc));_0x5485ce[_0x1a80('0x30')]();}};}; \ 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 ea36960..5a3c419 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 _0x2a09=['finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','body','message','mail','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','port','secure','auth','user','pass','html','','','headers','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','catch','error'];(function(_0x4e544f,_0x5d7cf6){var _0x594331=function(_0x36f444){while(--_0x36f444){_0x4e544f['push'](_0x4e544f['shift']());}};_0x594331(++_0x5d7cf6);}(_0x2a09,0x1bf));var _0x92a0=function(_0x3b6cec,_0x6cacdd){_0x3b6cec=_0x3b6cec-0x0;var _0x340f99=_0x2a09[_0x3b6cec];return _0x340f99;};'use strict';var _=require(_0x92a0('0x0'));var moment=require('moment');var utils=require(_0x92a0('0x1'));var logger=require(_0x92a0('0x2'))(_0x92a0('0x3'));var rpc={'chatMessage':require(_0x92a0('0x4')),'openchannelMessage':require(_0x92a0('0x5')),'mailMessage':require(_0x92a0('0x6')),'smsMessage':require(_0x92a0('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x92a0('0x8')),'chatInteraction':require(_0x92a0('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x92a0('0xa')),'smsInteraction':require(_0x92a0('0xb')),'faxInteraction':require(_0x92a0('0xc')),'whatsappInteraction':require(_0x92a0('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x92a0('0xe')]=function(_0x4043c1,_0x4ea8fd){return function(_0x4b700e){try{if(_0x4ea8fd[0x0]==='1'&&(_[_0x92a0('0xf')](this[_0x92a0('0x10')]['created'])||!this[_0x92a0('0x10')][_0x92a0('0x11')])){logger['info'](_0x92a0('0x12'),_0x4043c1,_0x92a0('0x13'));return _0x4b700e[_0x92a0('0x14')]();}if(_0x4ea8fd[0x0]==='2'&&this['interaction'][_0x92a0('0x15')]){logger[_0x92a0('0x16')](_0x92a0('0x17'),_0x4043c1,_0x92a0('0x18'));return _0x4b700e[_0x92a0('0x14')]();}var _0x19aa32=this['channel'];var _0x3c024e={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x92a0('0x19')),'direction':_0x92a0('0x1a')};if(this[_0x92a0('0x1b')]==='mail'){_0x3c024e['body']=utils[_0x92a0('0x1c')](_0x4ea8fd[0x2],this);}else{_0x3c024e[_0x92a0('0x1d')]=utils[_0x92a0('0x1c')](_0x4ea8fd[0x1],this);}if(this[_0x92a0('0x1e')]){_0x3c024e['to']=this[_0x92a0('0x1e')]['from']||'';if(this['channel']===_0x92a0('0x1f')&&_0x4ea8fd[0x1]==='1'){_0x3c024e['cc']=this[_0x92a0('0x1e')]['cc']||'';}_0x3c024e[_0x92a0('0x20')]=this['message']['to']||'';_0x3c024e[_0x92a0('0x21')]=this[_0x92a0('0x1e')]['phone']||'';_0x3c024e[_0x92a0('0x22')]=!![];if(this['message']['subject']){_0x3c024e[_0x92a0('0x23')]='';_0x3c024e['subject']+=_['startsWith'](this[_0x92a0('0x1e')][_0x92a0('0x23')],_0x92a0('0x24'))?'':_0x92a0('0x25');_0x3c024e[_0x92a0('0x23')]+=this[_0x92a0('0x1e')]['subject'];}}if(this[_0x92a0('0x1b')]===_0x92a0('0x26')){_0x3c024e[_0x92a0('0x27')]=this['account']['id'];}else{_0x3c024e[_[_0x92a0('0x28')](this[_0x92a0('0x1b')])+_0x92a0('0x29')]=this[_0x92a0('0x2a')]['id'];}_0x3c024e[_['upperFirst'](this[_0x92a0('0x1b')])+'InteractionId']=this[_0x92a0('0x10')]['id'];var _0x19a99b=this[_0x92a0('0x10')];if(rpc[this[_0x92a0('0x1b')]+_0x92a0('0x2b')]){if(this[_0x92a0('0x1b')]===_0x92a0('0x1f')){var _0x1d0ee6={'tls':{'rejectUnauthorized':![]}};if(this[_0x92a0('0x2a')][_0x92a0('0x2c')][_0x92a0('0x2d')]){_0x1d0ee6[_0x92a0('0x2d')]=this[_0x92a0('0x2a')][_0x92a0('0x2c')]['service'];}else{_0x1d0ee6['host']=this[_0x92a0('0x2a')]['Smtp']['host'];_0x1d0ee6['port']=this['account']['Smtp'][_0x92a0('0x2e')];_0x1d0ee6[_0x92a0('0x2f')]=this[_0x92a0('0x2a')][_0x92a0('0x2c')][_0x92a0('0x2f')];}if(this['account']['Smtp']['authentication']){_0x1d0ee6[_0x92a0('0x30')]={'user':this[_0x92a0('0x2a')][_0x92a0('0x2c')][_0x92a0('0x31')],'pass':this['account'][_0x92a0('0x2c')][_0x92a0('0x32')]};}_0x3c024e['inReplyTo']=this[_0x92a0('0x1e')]['messageId'];_0x3c024e[_0x92a0('0x33')]=_0x92a0('0x34')+_['replace'](_0x3c024e[_0x92a0('0x1d')],_0x92a0('0x35'),_0x92a0('0x36'))+_0x92a0('0x37');_0x3c024e[_0x92a0('0x38')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x92a0('0x39'),'Precedence':_0x92a0('0x3a')};return mailRpc[_0x92a0('0x3b')](_0x1d0ee6,_0x3c024e)[_0x92a0('0x3c')](function(_0x278b56){logger[_0x92a0('0x16')](_0x92a0('0x3d'),_0x4043c1);_0x3c024e[_0x92a0('0x3e')]=_0x278b56['message'][_0x92a0('0x3e')];return rpc[_0x19aa32+_0x92a0('0x2b')][_0x92a0('0x3f')](_0x3c024e);})[_0x92a0('0x3c')](function(_0x269076){logger[_0x92a0('0x16')]('[%s][AUTOREPLY]\x20%s',_0x4043c1,JSON[_0x92a0('0x40')](_0x269076));})['catch'](function(_0x3922c4){logger['error'](_0x92a0('0x41'),_0x4043c1,JSON[_0x92a0('0x40')](_0x3922c4));})['finally'](function(){Promise[_0x92a0('0x42')]()[_0x92a0('0x3c')](function(){if(_0x4ea8fd[0x0]!=='2'||_0x19a99b[_0x92a0('0x15')])return;return rpc[_0x19aa32+_0x92a0('0x43')][_0x92a0('0x44')](_0x19a99b['id'],{'autoreplyExecuted':!![]})[_0x92a0('0x3c')](function(_0x1045d0){logger[_0x92a0('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4043c1,JSON[_0x92a0('0x40')](_0x1045d0));})[_0x92a0('0x45')](function(_0x23b67b){logger[_0x92a0('0x46')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4043c1,JSON[_0x92a0('0x40')](_0x23b67b));});})[_0x92a0('0x3c')](function(){_0x4b700e[_0x92a0('0x14')]();});});}else{return rpc[this['channel']+_0x92a0('0x2b')][_0x92a0('0x3f')](_0x3c024e)[_0x92a0('0x3c')](function(_0xf563ca){logger[_0x92a0('0x16')]('[%s][AUTOREPLY]\x20%s',_0x4043c1,_0x3c024e['body']);})['catch'](function(_0x1b3f36){logger[_0x92a0('0x46')]('[%s][AUTOREPLY]\x20%s',_0x4043c1,JSON[_0x92a0('0x40')](_0x1b3f36));})[_0x92a0('0x47')](function(){Promise[_0x92a0('0x42')]()[_0x92a0('0x3c')](function(){if(_0x4ea8fd[0x0]!=='2'||_0x19a99b['autoreplyExecuted'])return;return rpc[_0x19aa32+'Interaction'][_0x92a0('0x44')](_0x19a99b['id'],{'autoreplyExecuted':!![]})[_0x92a0('0x3c')](function(_0x268faa){logger['info'](_0x92a0('0x17'),_0x4043c1,JSON['stringify'](_0x268faa));})[_0x92a0('0x45')](function(_0x3f7fdf){logger['error'](_0x92a0('0x48'),_0x4043c1,JSON['stringify'](_0x3f7fdf));});})['then'](function(){_0x4b700e[_0x92a0('0x14')]();});});}}}catch(_0x1debb5){logger[_0x92a0('0x46')](_0x92a0('0x12'),_0x4043c1,JSON['stringify'](_0x1debb5));_0x4b700e[_0x92a0('0x49')]();}};}; \ No newline at end of file +var _0xe092=['All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','then','Interaction','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','mail','body','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','html','','replace','';_0x389239['headers']={'Auto-Submitted':_0x2e09('0x3a'),'X-Auto-Response-Suppress':_0x2e09('0x3b'),'Precedence':_0x2e09('0x3c')};return mailRpc[_0x2e09('0x3d')](_0x4116bb,_0x389239)['then'](function(_0x2f8627){logger[_0x2e09('0x11')](_0x2e09('0x3e'),_0x8fdf90);_0x389239['messageId']=_0x2f8627['message'][_0x2e09('0x3f')];return rpc[_0x5636d2+_0x2e09('0x2c')][_0x2e09('0x40')](_0x389239);})['then'](function(_0x692830){logger[_0x2e09('0x11')](_0x2e09('0x12'),_0x8fdf90,JSON['stringify'](_0x692830));})[_0x2e09('0x41')](function(_0x3636e3){logger[_0x2e09('0x42')](_0x2e09('0x43'),_0x8fdf90,JSON[_0x2e09('0x44')](_0x3636e3));})[_0x2e09('0x45')](function(){Promise[_0x2e09('0x46')]()['then'](function(){if(_0x4057bc[0x0]!=='2'||_0x59cb7d[_0x2e09('0x15')])return;return rpc[_0x5636d2+'Interaction'][_0x2e09('0x47')](_0x59cb7d['id'],{'autoreplyExecuted':!![]})['then'](function(_0x294e5f){logger[_0x2e09('0x11')](_0x2e09('0x16'),_0x8fdf90,JSON[_0x2e09('0x44')](_0x294e5f));})[_0x2e09('0x41')](function(_0x404a25){logger[_0x2e09('0x42')](_0x2e09('0x48'),_0x8fdf90,JSON[_0x2e09('0x44')](_0x404a25));});})[_0x2e09('0x49')](function(){_0x220b17['next']();});});}else{return rpc[this[_0x2e09('0x20')]+_0x2e09('0x2c')]['create'](_0x389239)['then'](function(_0x3fa953){logger[_0x2e09('0x11')](_0x2e09('0x12'),_0x8fdf90,_0x389239[_0x2e09('0x1c')]);})[_0x2e09('0x41')](function(_0x3b37af){logger[_0x2e09('0x42')]('[%s][AUTOREPLY]\x20%s',_0x8fdf90,JSON[_0x2e09('0x44')](_0x3b37af));})[_0x2e09('0x45')](function(){Promise[_0x2e09('0x46')]()[_0x2e09('0x49')](function(){if(_0x4057bc[0x0]!=='2'||_0x59cb7d[_0x2e09('0x15')])return;return rpc[_0x5636d2+_0x2e09('0x4a')][_0x2e09('0x47')](_0x59cb7d['id'],{'autoreplyExecuted':!![]})[_0x2e09('0x49')](function(_0x43dcd8){logger[_0x2e09('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x8fdf90,JSON[_0x2e09('0x44')](_0x43dcd8));})['catch'](function(_0x204664){logger['error'](_0x2e09('0x48'),_0x8fdf90,JSON[_0x2e09('0x44')](_0x204664));});})[_0x2e09('0x49')](function(){_0x220b17[_0x2e09('0x14')]();});});}}}catch(_0x4e590a){logger[_0x2e09('0x42')](_0x2e09('0x12'),_0x8fdf90,JSON[_0x2e09('0x44')](_0x4e590a));_0x220b17[_0x2e09('0x4b')]();}};}; \ 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 7ea31f5..51d369f 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 _0xf33d=['channel','Interaction','update','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xf33d,0xb2));var _0xdf33=function(_0x357dc4,_0x4ca350){_0x357dc4=_0x357dc4-0x0;var _0x20ca7b=_0xf33d[_0x357dc4];return _0x20ca7b;};'use strict';var moment=require(_0xdf33('0x0'));var logger=require(_0xdf33('0x1'))(_0xdf33('0x2'));var rpc={'chatInteraction':require(_0xdf33('0x3')),'openchannelInteraction':require(_0xdf33('0x4')),'smsInteraction':require(_0xdf33('0x5')),'mailInteraction':require(_0xdf33('0x6')),'faxInteraction':require(_0xdf33('0x7')),'whatsappInteraction':require(_0xdf33('0x8'))};exports[_0xdf33('0x9')]=function(_0x1d8378,_0x2c8261,_0x35e391,_0x4921a2){return function(_0x2909d1){try{logger[_0xdf33('0xa')](_0xdf33('0xb'),_0x1d8378,_0x2c8261[0x0]);var _0xff1b4c={'closed':0x1,'closedAt':moment()[_0xdf33('0xc')](_0xdf33('0xd')),'closeReason':'system','disposition':_0x2c8261[0x0]};if(rpc[_0x4921a2[_0xdf33('0xe')]+'Interaction']){rpc[_0x4921a2['channel']+_0xdf33('0xf')][_0xdf33('0x10')](_0x4921a2[_0xdf33('0x11')]['id'],_0xff1b4c)[_0xdf33('0x12')](function(_0x5d88e4){logger[_0xdf33('0xa')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1d8378,_0x4921a2[_0xdf33('0x11')]['id']);})[_0xdf33('0x13')](function(_0x465907){logger[_0xdf33('0x14')](_0xdf33('0x15'),_0x1d8378,JSON[_0xdf33('0x16')](_0x465907));})['finally'](function(){_0x2909d1[_0xdf33('0x17')]();});}}catch(_0x534483){logger['error']('[%s][CLOSE]\x20%s',_0x1d8378,JSON['stringify'](_0x534483));_0x2909d1[_0xdf33('0x17')]();}};}; \ No newline at end of file +var _0x958c=['Interaction','channel','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4fa777,_0x18f2a8){var _0x19d924=function(_0x5dd668){while(--_0x5dd668){_0x4fa777['push'](_0x4fa777['shift']());}};_0x19d924(++_0x18f2a8);}(_0x958c,0x16f));var _0xc958=function(_0x435b2f,_0x4c44da){_0x435b2f=_0x435b2f-0x0;var _0x181648=_0x958c[_0x435b2f];return _0x181648;};'use strict';var moment=require(_0xc958('0x0'));var logger=require(_0xc958('0x1'))(_0xc958('0x2'));var rpc={'chatInteraction':require(_0xc958('0x3')),'openchannelInteraction':require(_0xc958('0x4')),'smsInteraction':require(_0xc958('0x5')),'mailInteraction':require(_0xc958('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xc958('0x7'))};exports['consequence']=function(_0x315580,_0x55f27c,_0x56caf9,_0x683bbe){return function(_0xb2c07a){try{logger[_0xc958('0x8')](_0xc958('0x9'),_0x315580,_0x55f27c[0x0]);var _0x23be0c={'closed':0x1,'closedAt':moment()['format'](_0xc958('0xa')),'closeReason':'system','disposition':_0x55f27c[0x0]};if(rpc[_0x683bbe['channel']+_0xc958('0xb')]){rpc[_0x683bbe[_0xc958('0xc')]+_0xc958('0xb')][_0xc958('0xd')](_0x683bbe[_0xc958('0xe')]['id'],_0x23be0c)['then'](function(_0x54ec37){logger[_0xc958('0x8')](_0xc958('0xf'),_0x315580,_0x683bbe['interaction']['id']);})[_0xc958('0x10')](function(_0x555e87){logger[_0xc958('0x11')](_0xc958('0x12'),_0x315580,JSON[_0xc958('0x13')](_0x555e87));})['finally'](function(){_0xb2c07a[_0xc958('0x14')]();});}}catch(_0x289915){logger['error'](_0xc958('0x12'),_0x315580,JSON[_0xc958('0x13')](_0x289915));_0xb2c07a[_0xc958('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 da8c418..dabea2b 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 _0xbd0a=['dialogflow','result','speech','providerName','providerResponse','stringify','Message','metadata','endConversation','lodash','apiai-promise','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','[%s][DIALOGFLOW]\x20%s','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','then'];(function(_0x5ab296,_0xeb2a6d){var _0x5cfd6c=function(_0x4b23e3){while(--_0x4b23e3){_0x5ab296['push'](_0x5ab296['shift']());}};_0x5cfd6c(++_0xeb2a6d);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x544b1e,_0x12b2a1){_0x544b1e=_0x544b1e-0x0;var _0xb9a2c1=_0xbd0a[_0x544b1e];return _0xb9a2c1;};'use strict';var _=require(_0xabd0('0x0'));var moment=require('moment');var apiai=require(_0xabd0('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xabd0('0x2'));var rpc={'chatMessage':require(_0xabd0('0x3')),'openchannelMessage':require(_0xabd0('0x4')),'mailMessage':require(_0xabd0('0x5')),'smsMessage':require(_0xabd0('0x6')),'faxMessage':require(_0xabd0('0x7')),'whatsappMessage':require(_0xabd0('0x8'))};exports[_0xabd0('0x9')]=function(_0xe18a18,_0x4ac4ad){return function(_0xf44097){try{if(!_[_0xabd0('0xa')](this[_0xabd0('0xb')]['UserId'])){logger[_0xabd0('0xc')]('[%s][DIALOGFLOW]\x20%s',_0xe18a18,_0xabd0('0xd'));return _0xf44097[_0xabd0('0xe')]();}var _0x2c31c9={'ContactId':this[_0xabd0('0xf')]['id'],'sentAt':moment()['format'](_0xabd0('0x10')),'direction':'out'};if(this[_0xabd0('0x11')]===_0xabd0('0x12')||this[_0xabd0('0x11')]===_0xabd0('0x13')){_0x2c31c9[_0xabd0('0x14')]=this[_0xabd0('0xb')]['phone'];}var _0x3ae1a7=this['channel'];if(_0x3ae1a7===_0xabd0('0x15')){_0x2c31c9[_0xabd0('0x16')]=this['account']['id'];}else{_0x2c31c9[_['upperFirst'](_0x3ae1a7)+'AccountId']=this['account']['id'];}_0x2c31c9[_[_0xabd0('0x17')](_0x3ae1a7)+_0xabd0('0x18')]=this[_0xabd0('0xb')]['id'];if(this[_0xabd0('0xb')][_0xabd0('0x19')]){var _0x28ddcf=_0x4ac4ad[0x2];if(!_[_0xabd0('0x1a')](_0x28ddcf)){_0x2c31c9[_0xabd0('0x1b')]=utils[_0xabd0('0x1c')](_0x28ddcf,this);return rpc[_0x3ae1a7+'Message'][_0xabd0('0x1d')](_0x2c31c9)['then'](function(_0x579dcd){logger[_0xabd0('0xc')](_0xabd0('0x1e'),_0xe18a18,_0x2c31c9[_0xabd0('0x1b')]);})[_0xabd0('0x1f')](function(_0x495c6d){logger[_0xabd0('0x20')](_0xabd0('0x1e'),_0xe18a18,JSON['stringify'](_0x495c6d));})['finally'](function(){logger[_0xabd0('0xc')](_0xabd0('0x21'),_0xe18a18);_0xf44097['stop']();});}else{logger[_0xabd0('0xc')](_0xabd0('0x22'),_0xe18a18);_0xf44097[_0xabd0('0x23')]();}}else{var _0x1e077e=this;var _0x4c9f3a=apiai(_0x4ac4ad[0x0],{'language':_0x4ac4ad[0x1]||'en'});return _0x4c9f3a[_0xabd0('0x24')](this[_0xabd0('0x25')][_0xabd0('0x1b')],{'sessionId':md5(this[_0xabd0('0xb')]['id'])})[_0xabd0('0x26')](function(_0xf6dbad){_0x1e077e[_0xabd0('0x1b')][_0xabd0('0x27')]=_0xf6dbad;_0x2c31c9[_0xabd0('0x1b')]=_0xf6dbad[_0xabd0('0x28')]['fulfillment'][_0xabd0('0x29')];_0x2c31c9[_0xabd0('0x2a')]=_0xabd0('0x27');_0x2c31c9[_0xabd0('0x2b')]=JSON[_0xabd0('0x2c')](_0xf6dbad);return rpc[_0x3ae1a7+_0xabd0('0x2d')][_0xabd0('0x1d')](_0x2c31c9)[_0xabd0('0x26')](function(_0x392b05){logger[_0xabd0('0xc')](_0xabd0('0x1e'),_0xe18a18,_0x2c31c9[_0xabd0('0x1b')]);if(_0xf6dbad[_0xabd0('0x28')][_0xabd0('0x2e')][_0xabd0('0x2f')]){_0xf44097[_0xabd0('0xe')]();}else{_0xf44097['stop']();}})[_0xabd0('0x1f')](function(_0x2d4c55){logger[_0xabd0('0x20')](_0xabd0('0x1e'),_0xe18a18,JSON['stringify'](_0x2d4c55));_0xf44097[_0xabd0('0xe')]();});})[_0xabd0('0x1f')](function(_0x20ff0a){logger['error'](_0xabd0('0x1e'),_0xe18a18,_0x20ff0a[_0xabd0('0x25')]);_0xf44097['next']();});}}catch(_0xd6d0c2){logger['error'](_0xabd0('0x1e'),_0xe18a18,JSON[_0xabd0('0x2c')](_0xd6d0c2));_0xf44097[_0xabd0('0x23')]();}};}; \ No newline at end of file +var _0xe928=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','then','error','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','dialogflow','result','speech','providerName','providerResponse','stringify','metadata','catch','message','lodash','moment','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction'];(function(_0x251334,_0x4ad9f1){var _0x5ddeef=function(_0x1d59be){while(--_0x1d59be){_0x251334['push'](_0x251334['shift']());}};_0x5ddeef(++_0x4ad9f1);}(_0xe928,0x145));var _0x8e92=function(_0x9ded14,_0x34dbc9){_0x9ded14=_0x9ded14-0x0;var _0x20c47c=_0xe928[_0x9ded14];return _0x20c47c;};'use strict';var _=require(_0x8e92('0x0'));var moment=require(_0x8e92('0x1'));var apiai=require(_0x8e92('0x2'));var md5=require('md5');var utils=require(_0x8e92('0x3'));var logger=require('../../../../config/logger')(_0x8e92('0x4'));var rpc={'chatMessage':require(_0x8e92('0x5')),'openchannelMessage':require(_0x8e92('0x6')),'mailMessage':require(_0x8e92('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8e92('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x8e92('0x9')]=function(_0xe4eff3,_0x14811b){return function(_0x76e11){try{if(!_['isNil'](this[_0x8e92('0xa')]['UserId'])){logger[_0x8e92('0xb')](_0x8e92('0xc'),_0xe4eff3,_0x8e92('0xd'));return _0x76e11[_0x8e92('0xe')]();}var _0x45c1a4={'ContactId':this[_0x8e92('0xf')]['id'],'sentAt':moment()['format'](_0x8e92('0x10')),'direction':_0x8e92('0x11')};if(this[_0x8e92('0x12')]==='sms'||this[_0x8e92('0x12')]===_0x8e92('0x13')){_0x45c1a4[_0x8e92('0x14')]=this[_0x8e92('0xa')][_0x8e92('0x14')];}var _0x2fe37b=this[_0x8e92('0x12')];if(_0x2fe37b==='chat'){_0x45c1a4[_0x8e92('0x15')]=this['account']['id'];}else{_0x45c1a4[_[_0x8e92('0x16')](_0x2fe37b)+_0x8e92('0x17')]=this['account']['id'];}_0x45c1a4[_[_0x8e92('0x16')](_0x2fe37b)+'InteractionId']=this[_0x8e92('0xa')]['id'];if(this[_0x8e92('0xa')][_0x8e92('0x18')]){var _0x1380ef=_0x14811b[0x2];if(!_[_0x8e92('0x19')](_0x1380ef)){_0x45c1a4[_0x8e92('0x1a')]=utils[_0x8e92('0x1b')](_0x1380ef,this);return rpc[_0x2fe37b+_0x8e92('0x1c')]['create'](_0x45c1a4)[_0x8e92('0x1d')](function(_0x192b0b){logger[_0x8e92('0xb')](_0x8e92('0xc'),_0xe4eff3,_0x45c1a4[_0x8e92('0x1a')]);})['catch'](function(_0x261b07){logger[_0x8e92('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0xe4eff3,JSON['stringify'](_0x261b07));})['finally'](function(){logger[_0x8e92('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xe4eff3);_0x76e11[_0x8e92('0x1f')]();});}else{logger[_0x8e92('0xb')](_0x8e92('0x20'),_0xe4eff3);_0x76e11[_0x8e92('0x1f')]();}}else{var _0x368253=this;var _0x70f846=apiai(_0x14811b[0x0],{'language':_0x14811b[0x1]||'en'});return _0x70f846['textRequest'](this['message']['body'],{'sessionId':md5(this['interaction']['id'])})[_0x8e92('0x1d')](function(_0x3a86e4){_0x368253[_0x8e92('0x1a')][_0x8e92('0x21')]=_0x3a86e4;_0x45c1a4[_0x8e92('0x1a')]=_0x3a86e4[_0x8e92('0x22')]['fulfillment'][_0x8e92('0x23')];_0x45c1a4[_0x8e92('0x24')]=_0x8e92('0x21');_0x45c1a4[_0x8e92('0x25')]=JSON[_0x8e92('0x26')](_0x3a86e4);return rpc[_0x2fe37b+_0x8e92('0x1c')]['create'](_0x45c1a4)['then'](function(_0x510349){logger[_0x8e92('0xb')]('[%s][DIALOGFLOW]\x20%s',_0xe4eff3,_0x45c1a4[_0x8e92('0x1a')]);if(_0x3a86e4['result'][_0x8e92('0x27')]['endConversation']){_0x76e11[_0x8e92('0xe')]();}else{_0x76e11[_0x8e92('0x1f')]();}})[_0x8e92('0x28')](function(_0x3c8897){logger[_0x8e92('0x1e')](_0x8e92('0xc'),_0xe4eff3,JSON['stringify'](_0x3c8897));_0x76e11[_0x8e92('0xe')]();});})[_0x8e92('0x28')](function(_0x4c11ef){logger[_0x8e92('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0xe4eff3,_0x4c11ef[_0x8e92('0x29')]);_0x76e11[_0x8e92('0xe')]();});}}catch(_0x4fb57b){logger[_0x8e92('0x1e')](_0x8e92('0xc'),_0xe4eff3,JSON[_0x8e92('0x26')](_0x4fb57b));_0x76e11[_0x8e92('0x1f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 48b3827..cbd18cb 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1e8=['[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','getMustacheRender','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','fields','diagnosticInfo','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','all','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','body','catch','error'];(function(_0x55a16b,_0x3cebbc){var _0x4cb5ba=function(_0x4de971){while(--_0x4de971){_0x55a16b['push'](_0x55a16b['shift']());}};_0x4cb5ba(++_0x3cebbc);}(_0xd1e8,0x101));var _0x8d1e=function(_0x1222d8,_0x102696){_0x1222d8=_0x1222d8-0x0;var _0x333952=_0xd1e8[_0x1222d8];return _0x333952;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x8d1e('0x0'));var moment=require(_0x8d1e('0x1'));var Promise=require(_0x8d1e('0x2'));var logger=require(_0x8d1e('0x3'))(_0x8d1e('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8d1e('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8d1e('0x6'))};function createMessage(_0x242fd8,_0x3d6083,_0x58919c,_0x50672f){return new Promise(function(_0x4384cd,_0x21925b){var _0x279773=_[_0x8d1e('0x7')](_0x58919c);_0x279773['body']=_0x50672f;return rpc[_0x3d6083+_0x8d1e('0x8')][_0x8d1e('0x9')](_0x279773)[_0x8d1e('0xa')](function(){logger[_0x8d1e('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x242fd8,_0x279773[_0x8d1e('0xc')]);_0x4384cd();})[_0x8d1e('0xd')](function(_0x12f26c){logger[_0x8d1e('0xe')](_0x8d1e('0xf'),_0x242fd8,JSON[_0x8d1e('0x10')](_0x12f26c));_0x21925b(_0x12f26c);});});}exports[_0x8d1e('0x11')]=function(_0x2fbfe3,_0xf57768){return function(_0x5b3f66){try{if(!_['isNil'](this[_0x8d1e('0x12')][_0x8d1e('0x13')])){logger[_0x8d1e('0xb')](_0x8d1e('0xf'),_0x2fbfe3,_0x8d1e('0x14'));return _0x5b3f66[_0x8d1e('0x15')]();}var _0x1e9520={'ContactId':this[_0x8d1e('0x16')]['id'],'sentAt':moment()['format'](_0x8d1e('0x17')),'direction':_0x8d1e('0x18')};if(this[_0x8d1e('0x19')]===_0x8d1e('0x1a')||this[_0x8d1e('0x19')]==='whatsapp'){_0x1e9520['phone']=this[_0x8d1e('0x12')][_0x8d1e('0x1b')];}var _0x3bf896=this[_0x8d1e('0x19')];if(_0x3bf896===_0x8d1e('0x1c')){_0x1e9520[_0x8d1e('0x1d')]=this[_0x8d1e('0x1e')]['id'];}else{_0x1e9520[_['upperFirst'](_0x3bf896)+'AccountId']=this['account']['id'];}_0x1e9520[_[_0x8d1e('0x1f')](_0x3bf896)+_0x8d1e('0x20')]=this[_0x8d1e('0x12')]['id'];if(this['interaction'][_0x8d1e('0x21')]){var _0x42a2ef=_0xf57768[0x4];if(!_['isEmpty'](_0x42a2ef)){_0x1e9520['body']=utils[_0x8d1e('0x22')](_0x42a2ef,this);return rpc[_0x3bf896+_0x8d1e('0x8')][_0x8d1e('0x9')](_0x1e9520)[_0x8d1e('0xa')](function(_0x50cf72){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x2fbfe3,_0x1e9520[_0x8d1e('0xc')]);})['catch'](function(_0x4cd852){logger['error'](_0x8d1e('0xf'),_0x2fbfe3,JSON['stringify'](_0x4cd852));})[_0x8d1e('0x23')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2fbfe3);_0x5b3f66[_0x8d1e('0x24')]();});}else{logger[_0x8d1e('0xb')](_0x8d1e('0x25'),_0x2fbfe3);_0x5b3f66[_0x8d1e('0x24')]();}}else{var _0x36c7b5=this;var _0x417d87=_0xf57768[0x2][_0x8d1e('0x26')](/\\n/g,'\x0a');var _0x2243a0={'credentials':{'private_key':_0x417d87,'client_email':_0xf57768[0x1]}};var _0x4a30d6=new dialogflow[(_0x8d1e('0x27'))](_0x2243a0);var _0x5c69fd=_0x4a30d6[_0x8d1e('0x28')](_0xf57768[0x0],md5(_0x36c7b5[_0x8d1e('0x12')]['id']));var _0x3687d3={'session':_0x5c69fd,'queryInput':{'text':{'text':_0x36c7b5[_0x8d1e('0x29')]['body'],'languageCode':_0xf57768[0x3]||'en'}}};return _0x4a30d6[_0x8d1e('0x2a')](_0x3687d3)[_0x8d1e('0xa')](function(_0x3cef91){if(_0x3cef91&&_0x3cef91[_0x8d1e('0x2b')]){_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x2c')]=_0x3cef91;var _0x1ef300=_0x3cef91[0x0];var _0x41290b=_0x1ef300[_0x8d1e('0x2d')]['diagnosticInfo']&&_0x1ef300[_0x8d1e('0x2d')]['diagnosticInfo'][_0x8d1e('0x2e')]?_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x2f')]['fields']['end_conversation']['boolValue']:![];_0x36c7b5[_0x8d1e('0xc')]['DIALOGFLOWV2_ACTION']=_0x1ef300['queryResult'][_0x8d1e('0x30')];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x31')]=_0x1ef300['queryResult'][_0x8d1e('0x32')];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x33')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x2f')]&&_0x1ef300['queryResult'][_0x8d1e('0x2f')]['fields']?_0x1ef300['queryResult'][_0x8d1e('0x2f')][_0x8d1e('0x2e')]['end_conversation']['boolValue']:![];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x34')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x35')][_0x8d1e('0x36')];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x37')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x35')][_0x8d1e('0x38')];_0x36c7b5['body'][_0x8d1e('0x39')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x35')][_0x8d1e('0x3a')];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x3b')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x3c')];_0x36c7b5['body'][_0x8d1e('0x3d')]=_0x1ef300[_0x8d1e('0x2d')]['queryText'];_0x36c7b5[_0x8d1e('0xc')][_0x8d1e('0x3e')]=_0x1ef300[_0x8d1e('0x2d')][_0x8d1e('0x3f')];_0x1e9520[_0x8d1e('0x40')]=_0x8d1e('0x2c');_0x1e9520['providerResponse']=JSON[_0x8d1e('0x10')](_0x3cef91);var _0x593170=[];for(var _0x3f19f8=0x0;_0x3f19f8<_0x3cef91['length'];_0x3f19f8++){var _0x3b8faf=_0x3cef91[_0x3f19f8];if(_0x3b8faf&&_0x3b8faf[_0x8d1e('0x2d')]&&_0x3b8faf[_0x8d1e('0x2d')][_0x8d1e('0x41')]){_0x593170[_0x8d1e('0x42')](createMessage(_0x2fbfe3,_0x3bf896,_0x1e9520,_0x3b8faf[_0x8d1e('0x2d')][_0x8d1e('0x41')]));}}return Promise[_0x8d1e('0x43')](_0x593170)[_0x8d1e('0xa')](function(){if(_0x41290b){_0x5b3f66['next']();}else{_0x5b3f66[_0x8d1e('0x24')]();}})[_0x8d1e('0xd')](function(_0x2d3a1e){logger[_0x8d1e('0xe')](_0x8d1e('0xf'),_0x2fbfe3,JSON[_0x8d1e('0x10')](_0x2d3a1e));_0x5b3f66['next']();});}})[_0x8d1e('0xd')](function(_0x581176){logger[_0x8d1e('0xe')](_0x8d1e('0xf'),_0x2fbfe3,_0x581176[_0x8d1e('0x29')]);_0x5b3f66['next']();});}}catch(_0x215f88){logger[_0x8d1e('0xe')](_0x8d1e('0xf'),_0x2fbfe3,JSON[_0x8d1e('0x10')](_0x215f88));_0x5b3f66[_0x8d1e('0x24')]();}};}; \ No newline at end of file +var _0xb6c2=['AccountId','InteractionId','created','isEmpty','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','all','lodash','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst'];(function(_0x2162e7,_0x3e88f4){var _0x23ffe0=function(_0x34e5ac){while(--_0x34e5ac){_0x2162e7['push'](_0x2162e7['shift']());}};_0x23ffe0(++_0x3e88f4);}(_0xb6c2,0x182));var _0x2b6c=function(_0x9ac1af,_0x209771){_0x9ac1af=_0x9ac1af-0x0;var _0xc154d4=_0xb6c2[_0x9ac1af];return _0xc154d4;};'use strict';var _=require(_0x2b6c('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x2b6c('0x1'))('routing');var utils=require(_0x2b6c('0x2'));var rpc={'chatMessage':require(_0x2b6c('0x3')),'openchannelMessage':require(_0x2b6c('0x4')),'mailMessage':require(_0x2b6c('0x5')),'smsMessage':require(_0x2b6c('0x6')),'faxMessage':require(_0x2b6c('0x7')),'whatsappMessage':require(_0x2b6c('0x8'))};function createMessage(_0x26a675,_0x337f33,_0x4daa7c,_0x2aa8f3){return new Promise(function(_0x3e7cb4,_0x7b7f07){var _0x9671bf=_[_0x2b6c('0x9')](_0x4daa7c);_0x9671bf[_0x2b6c('0xa')]=_0x2aa8f3;return rpc[_0x337f33+_0x2b6c('0xb')][_0x2b6c('0xc')](_0x9671bf)[_0x2b6c('0xd')](function(){logger[_0x2b6c('0xe')](_0x2b6c('0xf'),_0x26a675,_0x9671bf['body']);_0x3e7cb4();})[_0x2b6c('0x10')](function(_0x9936db){logger[_0x2b6c('0x11')](_0x2b6c('0xf'),_0x26a675,JSON[_0x2b6c('0x12')](_0x9936db));_0x7b7f07(_0x9936db);});});}exports['consequence']=function(_0xe75365,_0x1618a2){return function(_0x2cdc4e){try{if(!_[_0x2b6c('0x13')](this['interaction'][_0x2b6c('0x14')])){logger['info'](_0x2b6c('0xf'),_0xe75365,_0x2b6c('0x15'));return _0x2cdc4e[_0x2b6c('0x16')]();}var _0x1ae8a7={'ContactId':this[_0x2b6c('0x17')]['id'],'sentAt':moment()['format'](_0x2b6c('0x18')),'direction':'out'};if(this[_0x2b6c('0x19')]===_0x2b6c('0x1a')||this[_0x2b6c('0x19')]===_0x2b6c('0x1b')){_0x1ae8a7[_0x2b6c('0x1c')]=this[_0x2b6c('0x1d')]['phone'];}var _0x18914e=this[_0x2b6c('0x19')];if(_0x18914e===_0x2b6c('0x1e')){_0x1ae8a7[_0x2b6c('0x1f')]=this[_0x2b6c('0x20')]['id'];}else{_0x1ae8a7[_[_0x2b6c('0x21')](_0x18914e)+_0x2b6c('0x22')]=this['account']['id'];}_0x1ae8a7[_['upperFirst'](_0x18914e)+_0x2b6c('0x23')]=this[_0x2b6c('0x1d')]['id'];if(this[_0x2b6c('0x1d')][_0x2b6c('0x24')]){var _0x3a34b5=_0x1618a2[0x4];if(!_[_0x2b6c('0x25')](_0x3a34b5)){_0x1ae8a7[_0x2b6c('0xa')]=utils['getMustacheRender'](_0x3a34b5,this);return rpc[_0x18914e+_0x2b6c('0xb')]['create'](_0x1ae8a7)['then'](function(_0x2c72a3){logger[_0x2b6c('0xe')](_0x2b6c('0xf'),_0xe75365,_0x1ae8a7[_0x2b6c('0xa')]);})[_0x2b6c('0x10')](function(_0xe779ed){logger['error'](_0x2b6c('0xf'),_0xe75365,JSON['stringify'](_0xe779ed));})[_0x2b6c('0x26')](function(){logger[_0x2b6c('0xe')](_0x2b6c('0x27'),_0xe75365);_0x2cdc4e[_0x2b6c('0x28')]();});}else{logger['info'](_0x2b6c('0x29'),_0xe75365);_0x2cdc4e[_0x2b6c('0x28')]();}}else{var _0x37d6bc=this;var _0xeef0ba=_0x1618a2[0x2]['replace'](/\\n/g,'\x0a');var _0x1b30df={'credentials':{'private_key':_0xeef0ba,'client_email':_0x1618a2[0x1]}};var _0x488c58=new dialogflow[(_0x2b6c('0x2a'))](_0x1b30df);var _0x5c229f=_0x488c58[_0x2b6c('0x2b')](_0x1618a2[0x0],md5(_0x37d6bc[_0x2b6c('0x1d')]['id']));var _0x452236={'session':_0x5c229f,'queryInput':{'text':{'text':_0x37d6bc[_0x2b6c('0x2c')][_0x2b6c('0xa')],'languageCode':_0x1618a2[0x3]||'en'}}};return _0x488c58[_0x2b6c('0x2d')](_0x452236)[_0x2b6c('0xd')](function(_0x42218b){if(_0x42218b&&_0x42218b[_0x2b6c('0x2e')]){_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x2f')]=_0x42218b;var _0x4c111d=_0x42218b[0x0];var _0x137d62=_0x4c111d[_0x2b6c('0x30')]['diagnosticInfo']&&_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x31')][_0x2b6c('0x32')]?_0x4c111d[_0x2b6c('0x30')]['diagnosticInfo'][_0x2b6c('0x32')][_0x2b6c('0x33')][_0x2b6c('0x34')]:![];_0x37d6bc['body'][_0x2b6c('0x35')]=_0x4c111d['queryResult'][_0x2b6c('0x36')];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x37')]=_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x38')];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x39')]=_0x4c111d[_0x2b6c('0x30')]['diagnosticInfo']&&_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x31')][_0x2b6c('0x32')]?_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x31')][_0x2b6c('0x32')][_0x2b6c('0x33')][_0x2b6c('0x34')]:![];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x3a')]=_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x3b')]['name'];_0x37d6bc[_0x2b6c('0xa')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4c111d['queryResult'][_0x2b6c('0x3b')][_0x2b6c('0x3c')];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x3d')]=_0x4c111d[_0x2b6c('0x30')]['intent']['isFallback'];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x3e')]=_0x4c111d['queryResult']['languageCode'];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x3f')]=_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x40')];_0x37d6bc[_0x2b6c('0xa')][_0x2b6c('0x41')]=_0x4c111d[_0x2b6c('0x30')][_0x2b6c('0x42')];_0x1ae8a7[_0x2b6c('0x43')]=_0x2b6c('0x2f');_0x1ae8a7['providerResponse']=JSON[_0x2b6c('0x12')](_0x42218b);var _0x1b06ec=[];for(var _0x19f0cc=0x0;_0x19f0cc<_0x42218b[_0x2b6c('0x2e')];_0x19f0cc++){var _0x57c3c7=_0x42218b[_0x19f0cc];if(_0x57c3c7&&_0x57c3c7[_0x2b6c('0x30')]&&_0x57c3c7['queryResult']['fulfillmentText']){_0x1b06ec['push'](createMessage(_0xe75365,_0x18914e,_0x1ae8a7,_0x57c3c7[_0x2b6c('0x30')][_0x2b6c('0x44')]));}}return Promise[_0x2b6c('0x45')](_0x1b06ec)['then'](function(){if(_0x137d62){_0x2cdc4e[_0x2b6c('0x16')]();}else{_0x2cdc4e['stop']();}})['catch'](function(_0x40112c){logger[_0x2b6c('0x11')](_0x2b6c('0xf'),_0xe75365,JSON[_0x2b6c('0x12')](_0x40112c));_0x2cdc4e['next']();});}})[_0x2b6c('0x10')](function(_0x498cb5){logger[_0x2b6c('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xe75365,_0x498cb5[_0x2b6c('0x2c')]);_0x2cdc4e[_0x2b6c('0x16')]();});}}catch(_0xb65c2b){logger[_0x2b6c('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0xe75365,JSON[_0x2b6c('0x12')](_0xb65c2b));_0x2cdc4e[_0x2b6c('0x28')]();}};}; \ 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 616aa3c..90d9d86 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 _0x3f4a=['priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number'];(function(_0x5a8e0a,_0x2dded6){var _0x23bd31=function(_0x4ed20f){while(--_0x4ed20f){_0x5a8e0a['push'](_0x5a8e0a['shift']());}};_0x23bd31(++_0x2dded6);}(_0x3f4a,0x19c));var _0xa3f4=function(_0x55f77b,_0x57b4c3){_0x55f77b=_0x55f77b-0x0;var _0x33fe87=_0x3f4a[_0x55f77b];return _0x33fe87;};'use strict';var schema=require(_0xa3f4('0x0'));var _=require(_0xa3f4('0x1'));var htmlToText=require(_0xa3f4('0x2'));var utils=require(_0xa3f4('0x3'));var logger=require(_0xa3f4('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xa3f4('0x5'),'required':!![],'message':_0xa3f4('0x6')},'priorityTrue':{'type':_0xa3f4('0x7'),'message':_0xa3f4('0x8')},'priorityFalse':{'type':_0xa3f4('0x7'),'message':_0xa3f4('0x9')}});exports[_0xa3f4('0xa')]=function(_0x1faba4,_0x49354b){return function(_0x3cbc54){try{var _0x1df7ce={'condition':htmlToText[_0xa3f4('0xb')](utils[_0xa3f4('0xc')](_0x49354b[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x49354b[0x1],'priorityFalse':_0x49354b[0x2]};var _0x2de33b=gotoif['validate'](_0x1df7ce,{'typecast':!![]});if(_0x2de33b[_0xa3f4('0xd')]){logger[_0xa3f4('0xe')](_0xa3f4('0xf'),_0x1faba4,_[_0xa3f4('0x10')](_0x2de33b,'message')[_0xa3f4('0x11')](',\x20'));_0x3cbc54[_0xa3f4('0x12')]();}else{try{var _0x5f3975=eval('('+_0x1df7ce[_0xa3f4('0x13')]+')');var _0x17b5ac=_0x5f3975?_0x1df7ce['priorityTrue']:_0x1df7ce['priorityFalse'];logger[_0xa3f4('0x14')](_0xa3f4('0x15'),_0x1faba4,_0x1df7ce['condition'],_0x5f3975,_0x17b5ac||_0xa3f4('0x16'));if(_0x17b5ac){var _0x5b78ba=_[_0xa3f4('0x17')](_0x3cbc54[_0xa3f4('0x18')](),{'p':_0x17b5ac});if(_0x5b78ba>=0x0){logger[_0xa3f4('0x14')](_0xa3f4('0x19'),_0x1faba4,_0x17b5ac||_0xa3f4('0x16'),_0x5b78ba);_0x3cbc54[_0xa3f4('0x16')](_0x5b78ba);}else{logger[_0xa3f4('0x14')](_0xa3f4('0x1a'),_0x1faba4,_0x17b5ac||'next');_0x3cbc54[_0xa3f4('0x12')]();}}else{_0x3cbc54[_0xa3f4('0x16')]();}}catch(_0x3c5048){logger[_0xa3f4('0xe')](_0xa3f4('0x1b'),_0x1faba4,_0x3c5048[_0xa3f4('0x1c')]);_0x3cbc54['stop']();}}}catch(_0x48b61e){logger[_0xa3f4('0xe')]('[%s][GOTOIF]\x20%s',_0x1faba4,JSON[_0xa3f4('0x1d')](_0x48b61e));_0x3cbc54['stop']();}};}; \ No newline at end of file +var _0xd743=['getMustacheRender','replace','stop','priorityTrue','priorityFalse','info','condition','rules','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','error','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString'];(function(_0x31567c,_0x2f91d1){var _0x24d0bc=function(_0x237fd1){while(--_0x237fd1){_0x31567c['push'](_0x31567c['shift']());}};_0x24d0bc(++_0x2f91d1);}(_0xd743,0xee));var _0x3d74=function(_0x3ad13b,_0x4bf486){_0x3ad13b=_0x3ad13b-0x0;var _0x4e83fc=_0xd743[_0x3ad13b];return _0x4e83fc;};'use strict';var schema=require('validate');var _=require(_0x3d74('0x0'));var htmlToText=require(_0x3d74('0x1'));var utils=require(_0x3d74('0x2'));var logger=require(_0x3d74('0x3'))(_0x3d74('0x4'));var gotoif=schema({'condition':{'type':_0x3d74('0x5'),'required':!![],'message':_0x3d74('0x6')},'priorityTrue':{'type':_0x3d74('0x7'),'message':_0x3d74('0x8')},'priorityFalse':{'type':_0x3d74('0x7'),'message':_0x3d74('0x9')}});exports[_0x3d74('0xa')]=function(_0x3647a4,_0x39768d){return function(_0x1b9d78){try{var _0x473056={'condition':htmlToText[_0x3d74('0xb')](utils[_0x3d74('0xc')](_0x39768d[0x0],this),{'wordwrap':![]})[_0x3d74('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x39768d[0x1],'priorityFalse':_0x39768d[0x2]};var _0x2a804c=gotoif['validate'](_0x473056,{'typecast':!![]});if(_0x2a804c['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x3647a4,_['map'](_0x2a804c,'message')['join'](',\x20'));_0x1b9d78[_0x3d74('0xe')]();}else{try{var _0x672661=eval('('+_0x473056['condition']+')');var _0x45e443=_0x672661?_0x473056[_0x3d74('0xf')]:_0x473056[_0x3d74('0x10')];logger[_0x3d74('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x3647a4,_0x473056[_0x3d74('0x12')],_0x672661,_0x45e443||'next');if(_0x45e443){var _0x48ffc0=_['findIndex'](_0x1b9d78[_0x3d74('0x13')](),{'p':_0x45e443});if(_0x48ffc0>=0x0){logger[_0x3d74('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3647a4,_0x45e443||'next',_0x48ffc0);_0x1b9d78[_0x3d74('0x14')](_0x48ffc0);}else{logger[_0x3d74('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3647a4,_0x45e443||_0x3d74('0x14'));_0x1b9d78[_0x3d74('0xe')]();}}else{_0x1b9d78['next']();}}catch(_0x3b0771){logger['error'](_0x3d74('0x15'),_0x3647a4,_0x3b0771['message']);_0x1b9d78['stop']();}}}catch(_0x34f1ee){logger[_0x3d74('0x16')](_0x3d74('0x17'),_0x3647a4,JSON[_0x3d74('0x18')](_0x34f1ee));_0x1b9d78[_0x3d74('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 b3eac21..0369381 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 _0x587e=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority'];(function(_0x3136d5,_0x1c11fe){var _0x4e6a00=function(_0x105c98){while(--_0x105c98){_0x3136d5['push'](_0x3136d5['shift']());}};_0x4e6a00(++_0x1c11fe);}(_0x587e,0x1be));var _0xe587=function(_0x22aac1,_0x2d64e2){_0x22aac1=_0x22aac1-0x0;var _0x1b324d=_0x587e[_0x22aac1];return _0x1b324d;};'use strict';var schema=require(_0xe587('0x0'));var _=require(_0xe587('0x1'));var logger=require(_0xe587('0x2'))('routing');var gotop=schema({'priority':{'type':_0xe587('0x3'),'required':!![],'message':_0xe587('0x4')}});exports['consequence']=function(_0x183ad1,_0x676fad){return function(_0x36134e){try{var _0x3ce4f2={'priority':_0x676fad[0x0]};var _0x24fdb8=gotop[_0xe587('0x0')](_0x3ce4f2,{'typecast':!![]});if(_0x24fdb8[_0xe587('0x5')]){logger[_0xe587('0x6')](_0xe587('0x7'),_0x183ad1,_['map'](_0x24fdb8,_0xe587('0x8'))[_0xe587('0x9')](',\x20'));_0x36134e[_0xe587('0xa')]();}else{logger[_0xe587('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x183ad1,_0x3ce4f2[_0xe587('0xc')]);if(_0x3ce4f2[_0xe587('0xc')]){var _0x5b514d=_['findIndex'](_0x36134e[_0xe587('0xd')](),{'p':_0x3ce4f2[_0xe587('0xc')]});if(_0x5b514d>=0x0){logger['info'](_0xe587('0xe'),_0x183ad1,_0x3ce4f2[_0xe587('0xc')]||_0xe587('0xf'),_0x5b514d);_0x36134e['next'](_0x5b514d);}else{logger[_0xe587('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x183ad1,_0x3ce4f2[_0xe587('0xc')]||_0xe587('0xf'));_0x36134e[_0xe587('0xa')]();}}else{_0x36134e[_0xe587('0xf')]();}}}catch(_0x57719b){logger['error']('[%s][GOTOP]\x20%s',_0x183ad1,JSON[_0xe587('0x10')](_0x57719b));_0x36134e[_0xe587('0xa')]();}};}; \ No newline at end of file +var _0x242b=['priority','findIndex','rules','next','stop','stringify','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x5a0d6c,_0x180ba4){var _0x1b9fc1=function(_0x5728e3){while(--_0x5728e3){_0x5a0d6c['push'](_0x5a0d6c['shift']());}};_0x1b9fc1(++_0x180ba4);}(_0x242b,0x138));var _0xb242=function(_0x22b465,_0x3c6511){_0x22b465=_0x22b465-0x0;var _0x543e0b=_0x242b[_0x22b465];return _0x543e0b;};'use strict';var schema=require(_0xb242('0x0'));var _=require('lodash');var logger=require(_0xb242('0x1'))('routing');var gotop=schema({'priority':{'type':_0xb242('0x2'),'required':!![],'message':_0xb242('0x3')}});exports[_0xb242('0x4')]=function(_0x2567e2,_0x30d04a){return function(_0x55ecb3){try{var _0x8f3a39={'priority':_0x30d04a[0x0]};var _0x57637b=gotop[_0xb242('0x0')](_0x8f3a39,{'typecast':!![]});if(_0x57637b['length']){logger[_0xb242('0x5')](_0xb242('0x6'),_0x2567e2,_[_0xb242('0x7')](_0x57637b,_0xb242('0x8'))['join'](',\x20'));_0x55ecb3['stop']();}else{logger[_0xb242('0x9')](_0xb242('0xa'),_0x2567e2,_0x8f3a39[_0xb242('0xb')]);if(_0x8f3a39[_0xb242('0xb')]){var _0x20c2fb=_[_0xb242('0xc')](_0x55ecb3[_0xb242('0xd')](),{'p':_0x8f3a39['priority']});if(_0x20c2fb>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2567e2,_0x8f3a39[_0xb242('0xb')]||_0xb242('0xe'),_0x20c2fb);_0x55ecb3['next'](_0x20c2fb);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x2567e2,_0x8f3a39[_0xb242('0xb')]||_0xb242('0xe'));_0x55ecb3[_0xb242('0xf')]();}}else{_0x55ecb3[_0xb242('0xe')]();}}}catch(_0x125f3a){logger[_0xb242('0x5')]('[%s][GOTOP]\x20%s',_0x2567e2,JSON[_0xb242('0x10')](_0x125f3a));_0x55ecb3[_0xb242('0xf')]();}};}; \ 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 c21062d..cfb01b8 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 _0xef35=['lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/whatsappMessage','getMustacheRender','ChatWebsiteId','account','upperFirst','AccountId','channel','interaction','Message','info','[%s][MESSAGE]\x20%s','next','catch','error','stop','stringify'];(function(_0x10b8f0,_0x2f3e73){var _0x297bd0=function(_0x379c5c){while(--_0x379c5c){_0x10b8f0['push'](_0x10b8f0['shift']());}};_0x297bd0(++_0x2f3e73);}(_0xef35,0xa8));var _0x5ef3=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xef35[_0xdeac17];return _0x33aabd;};'use strict';var _=require(_0x5ef3('0x0'));var utils=require(_0x5ef3('0x1'));var logger=require(_0x5ef3('0x2'))('routing');var rpc={'chatMessage':require(_0x5ef3('0x3')),'openchannelMessage':require(_0x5ef3('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5ef3('0x5'))};exports['consequence']=function(_0x56992b,_0x2337b4){return function(_0xffaa70){try{var _0x4b3014={'body':utils[_0x5ef3('0x6')](_0x2337b4[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x4b3014[_0x5ef3('0x7')]=this[_0x5ef3('0x8')]['id'];}else{_0x4b3014[_[_0x5ef3('0x9')](this['channel'])+_0x5ef3('0xa')]=this[_0x5ef3('0x8')]['id'];}_0x4b3014[_[_0x5ef3('0x9')](this[_0x5ef3('0xb')])+'InteractionId']=this[_0x5ef3('0xc')]['id'];if(rpc[this[_0x5ef3('0xb')]+_0x5ef3('0xd')]){return rpc[this[_0x5ef3('0xb')]+'Message']['create'](_0x4b3014)['then'](function(_0x31f3db){logger[_0x5ef3('0xe')](_0x5ef3('0xf'),_0x56992b,_0x4b3014['body']);_0xffaa70[_0x5ef3('0x10')]();})[_0x5ef3('0x11')](function(_0x1b984e){logger[_0x5ef3('0x12')](_0x5ef3('0xf'),_0x56992b,JSON['stringify'](_0x1b984e));_0xffaa70[_0x5ef3('0x13')]();});}}catch(_0x2fc0b2){logger[_0x5ef3('0x12')](_0x5ef3('0xf'),_0x56992b,JSON[_0x5ef3('0x14')](_0x2fc0b2));_0xffaa70[_0x5ef3('0x13')]();}};}; \ No newline at end of file +var _0x6372=['lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','channel','account','upperFirst','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6372,0x1b8));var _0x2637=function(_0x20c70d,_0x54e3b8){_0x20c70d=_0x20c70d-0x0;var _0x31b2c2=_0x6372[_0x20c70d];return _0x31b2c2;};'use strict';var _=require(_0x2637('0x0'));var utils=require('./utils');var logger=require(_0x2637('0x1'))('routing');var rpc={'chatMessage':require(_0x2637('0x2')),'openchannelMessage':require(_0x2637('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2637('0x4')),'faxMessage':require(_0x2637('0x5')),'whatsappMessage':require(_0x2637('0x6'))};exports[_0x2637('0x7')]=function(_0x24ab39,_0x5da891){return function(_0x33d56c){try{var _0x54bdd1={'body':utils['getMustacheRender'](_0x5da891[0x0],this),'ContactId':this['contact']['id']};if(this[_0x2637('0x8')]==='chat'){_0x54bdd1['ChatWebsiteId']=this[_0x2637('0x9')]['id'];}else{_0x54bdd1[_[_0x2637('0xa')](this[_0x2637('0x8')])+'AccountId']=this['account']['id'];}_0x54bdd1[_[_0x2637('0xa')](this[_0x2637('0x8')])+_0x2637('0xb')]=this[_0x2637('0xc')]['id'];if(rpc[this[_0x2637('0x8')]+_0x2637('0xd')]){return rpc[this[_0x2637('0x8')]+_0x2637('0xd')][_0x2637('0xe')](_0x54bdd1)['then'](function(_0x2e1052){logger[_0x2637('0xf')](_0x2637('0x10'),_0x24ab39,_0x54bdd1['body']);_0x33d56c[_0x2637('0x11')]();})[_0x2637('0x12')](function(_0x4630fe){logger[_0x2637('0x13')]('[%s][MESSAGE]\x20%s',_0x24ab39,JSON[_0x2637('0x14')](_0x4630fe));_0x33d56c[_0x2637('0x15')]();});}}catch(_0x3f69d9){logger[_0x2637('0x13')](_0x2637('0x10'),_0x24ab39,JSON[_0x2637('0x14')](_0x3f69d9));_0x33d56c['stop']();}};}; \ 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 14819bb..b166b6c 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 _0xd223=['routing','consequence','info','getMustacheRender','error','[%s][NOOP]\x20%s','./utils','../../../../config/logger'];(function(_0x48f0f9,_0xd3b833){var _0x50213f=function(_0x28887a){while(--_0x28887a){_0x48f0f9['push'](_0x48f0f9['shift']());}};_0x50213f(++_0xd3b833);}(_0xd223,0x10e));var _0x3d22=function(_0x59cbad,_0x185241){_0x59cbad=_0x59cbad-0x0;var _0x593f4d=_0xd223[_0x59cbad];return _0x593f4d;};'use strict';var utils=require(_0x3d22('0x0'));var logger=require(_0x3d22('0x1'))(_0x3d22('0x2'));exports[_0x3d22('0x3')]=function(_0x577850,_0x15d17c){return function(_0x411373){try{logger[_0x3d22('0x4')]('[%s][NOOP]\x20%s',_0x577850,utils[_0x3d22('0x5')](_0x15d17c[0x0],this));_0x411373['next']();}catch(_0x3c20e1){logger[_0x3d22('0x6')](_0x3d22('0x7'),_0x577850,JSON['stringify'](_0x3c20e1));_0x411373['stop']();}};}; \ No newline at end of file +var _0x3b0d=['../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils'];(function(_0x180063,_0x4f40d7){var _0x1b7297=function(_0x2233a8){while(--_0x2233a8){_0x180063['push'](_0x180063['shift']());}};_0x1b7297(++_0x4f40d7);}(_0x3b0d,0x87));var _0xd3b0=function(_0xd51999,_0x4b24d0){_0xd51999=_0xd51999-0x0;var _0x16c68a=_0x3b0d[_0xd51999];return _0x16c68a;};'use strict';var utils=require(_0xd3b0('0x0'));var logger=require(_0xd3b0('0x1'))('routing');exports[_0xd3b0('0x2')]=function(_0x7c80da,_0x38acad){return function(_0x4828ae){try{logger[_0xd3b0('0x3')](_0xd3b0('0x4'),_0x7c80da,utils[_0xd3b0('0x5')](_0x38acad[0x0],this));_0x4828ae['next']();}catch(_0x43cc84){logger[_0xd3b0('0x6')]('[%s][NOOP]\x20%s',_0x7c80da,JSON[_0xd3b0('0x7')](_0x43cc84));_0x4828ae['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 7af92be..5badfef 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 _0x129f=['end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x129f,0x13f));var _0xf129=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x129f[_0x2d7f0e];return _0x110b07;};'use strict';var schema=require(_0xf129('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xf129('0x1'));var moment=require(_0xf129('0x2'));var Redis=require(_0xf129('0x3'));var config=require(_0xf129('0x4'));var logger=require(_0xf129('0x5'))(_0xf129('0x6'));var strategy=require(_0xf129('0x7'));config[_0xf129('0x8')]=_['defaults'](config[_0xf129('0x8')],{'host':_0xf129('0x9'),'port':0x18eb});var io=require(_0xf129('0xa'))(new Redis(config[_0xf129('0x8')]));var attributes=['id','queue_id','account',_0xf129('0xb'),'from',_0xf129('0xc')];function emit(_0x2f66b5,_0x31f877,_0x200e06){io['to'](_0x2f66b5)[_0xf129('0xd')](_0x31f877,_0x200e06);}function emitChannelQueueInteraction(_0x4fed21,_0x3e5859,_0x3ee5f3,_0x46c758,_0x5d721f,_0x22db94,_0x2d83d6,_0x4704fc){var _0x527789=_[_0xf129('0xe')](_0x3ee5f3);_0x527789[_0xf129('0xf')]=_0x4704fc;_0x527789[_0xf129('0xb')]=_0x3e5859;_0x527789['account']=_0x46c758;_0x527789['id']=_0x5d721f;if(_0x22db94){_0x2d83d6[util[_0xf129('0x10')](_0xf129('0x11'),_0x4fed21)][_0x5d721f]=_['pick'](_0x527789,attributes);}else{delete _0x2d83d6[util[_0xf129('0x10')]('%sQueuesWaitingInteractions',_0x4fed21)][_0x5d721f];}emit(util[_0xf129('0x10')](_0xf129('0x12'),_0x4fed21,_0x3e5859),util['format']('%s_queue_waiting_interaction:%s',_0x4fed21,_0x22db94?_0xf129('0x13'):_0xf129('0x14')),_['pick'](_0x527789,attributes));}var rpc={'openchannelQueueReport':require(_0xf129('0x15')),'mailQueueReport':require(_0xf129('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xf129('0x17')),'faxQueueReport':require(_0xf129('0x18')),'whatsappQueueReport':require(_0xf129('0x19'))};var queue=schema({'name':{'type':_0xf129('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xf129('0x1b')}});function startRouting(_0x2c684e,_0x87334c,_0xbaa68c,_0x3620b9){if(_0x2c684e&&_0x87334c&&_0xbaa68c){_0x87334c[_0xf129('0x1c')]+=0x1;var _0xbd9489={'uniqueid':_0x2c684e,'from':_0xbaa68c['body']?_0xbaa68c[_0xf129('0x1d')]['from']:'','joinAt':moment()['format'](_0xf129('0x1e')),'ContactId':_0xbaa68c[_0xf129('0x1f')]?_0xbaa68c[_0xf129('0x1f')]['id']:null,'ListId':_0xbaa68c[_0xf129('0x20')]?_0xbaa68c[_0xf129('0x20')]['id']:null};_0xbd9489[_[_0xf129('0x21')](_0xbaa68c[_0xf129('0x22')])+_0xf129('0x23')]=_0x87334c['id']||null;_0xbd9489[_['upperFirst'](_0xbaa68c[_0xf129('0x22')])+_0xf129('0x24')]=_0xbaa68c[_0xf129('0x25')]?_0xbaa68c['interaction']['id']:null;_0xbd9489[_[_0xf129('0x21')](_0xbaa68c[_0xf129('0x22')])+_0xf129('0x26')]=_0xbaa68c['message']?_0xbaa68c[_0xf129('0x27')]['id']:null;_0xbd9489[_['upperFirst'](_0xbaa68c['channel'])+(_0xbaa68c[_0xf129('0x22')]!==_0xf129('0x28')?_0xf129('0x29'):_0xf129('0x2a'))]=_0xbaa68c[_0xf129('0x2b')]?_0xbaa68c[_0xf129('0x2b')]['id']:null;logger[_0xf129('0x2c')](util[_0xf129('0x10')](_0xf129('0x2d'),_0x2c684e,_0x87334c[_0xf129('0x2e')]));emitChannelQueueInteraction(_0xbaa68c[_0xf129('0x22')],_0x87334c[_0xf129('0x2e')],_0xbd9489,_0xbaa68c[_0xf129('0x2b')][_0xf129('0x2e')],_0xbaa68c['message']['id'],!![],_0x3620b9,_0x87334c['id']);if(rpc[_0xbaa68c['channel']+_0xf129('0x2f')]){return rpc[_0xbaa68c['channel']+_0xf129('0x2f')]['create'](_0xbd9489)[_0xf129('0x30')](function(_0x74f902){logger[_0xf129('0x31')](_0xf129('0x32'));});}}}function stopRouting(_0x35eb9b,_0x23dcaf,_0x3c591d,_0x2a6c6d){if(_0x35eb9b&&_0x23dcaf){_0x23dcaf[_0xf129('0x1c')]-=0x1;var _0x54ea04={'leaveAt':moment()[_0xf129('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xf129('0x10')](_0xf129('0x1e')),'reason':_0xf129('0x33')};logger['info'](util[_0xf129('0x10')](_0xf129('0x34'),_0x35eb9b,_0x23dcaf[_0xf129('0x2e')]));emitChannelQueueInteraction(_0x3c591d[_0xf129('0x22')],_0x23dcaf['name'],_0x3c591d['body'],_0x3c591d['account'][_0xf129('0x2e')],_0x3c591d['message']['id'],![],_0x2a6c6d,_0x23dcaf['id']);if(rpc[_0x3c591d[_0xf129('0x22')]+_0xf129('0x2f')]){return rpc[_0x3c591d[_0xf129('0x22')]+_0xf129('0x2f')][_0xf129('0x35')](_0x35eb9b,_0x54ea04)[_0xf129('0x30')](function(_0x4dd66e){logger['error'](_0xf129('0x36'));});}}}function endRouting(_0x54802c,_0x1a2e9,_0x27bf8f,_0x4e32b4){if(_0x54802c&&_0x1a2e9){_0x1a2e9[_0xf129('0x1c')]-=0x1;var _0x18ca15={'leaveAt':moment()[_0xf129('0x10')](_0xf129('0x1e')),'exitAt':moment()[_0xf129('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf129('0x37')};logger[_0xf129('0x2c')](util[_0xf129('0x10')](_0xf129('0x38'),_0x54802c,_0x1a2e9[_0xf129('0x2e')]));emitChannelQueueInteraction(_0x27bf8f[_0xf129('0x22')],_0x1a2e9[_0xf129('0x2e')],_0x27bf8f[_0xf129('0x1d')],_0x27bf8f[_0xf129('0x2b')][_0xf129('0x2e')],_0x27bf8f[_0xf129('0x27')]['id'],![],_0x4e32b4);if(rpc[_0x27bf8f[_0xf129('0x22')]+'QueueReport']){return rpc[_0x27bf8f['channel']+'QueueReport'][_0xf129('0x35')](_0x54802c,_0x18ca15)[_0xf129('0x30')](function(_0x5d4ae6){logger[_0xf129('0x31')](_0xf129('0x36'));});}}}function handleFindQueue(_0x4f70d0){return function(_0x1f9456){return _0x1f9456[_0xf129('0x2e')][_0xf129('0x39')]()===_0x4f70d0['toLowerCase']();};}exports['consequence']=function(_0x4b3690,_0x534bea,_0x3da971,_0x38001a){return function(_0x526416){try{var _0x3c6fe9={'name':_0x534bea[0x0],'timeout':_0x534bea[0x1]};var _0x407d90=queue[_0xf129('0x0')](_0x3c6fe9,{'typecast':!![]});if(_0x407d90['length']){logger[_0xf129('0x31')]('[%s][QUEUE]\x20%s',_0x4b3690,_[_0xf129('0x3a')](_0x407d90,_0xf129('0x27'))['join'](',\x20'));_0x526416[_0xf129('0x3b')]();}else{var _0x30e7f7=_[_0xf129('0x3c')](_0x3da971[_0x38001a[_0xf129('0x22')]+_0xf129('0x3d')],handleFindQueue(_0x3c6fe9[_0xf129('0x2e')]));if(_0x30e7f7){startRouting(_0x4b3690,_0x30e7f7,_0x38001a,_0x3da971);var _0xbc41d2=(_0x30e7f7['timeout']||0xa)*0x3e8;var _0x4f3f90=(_0x3c6fe9[_0xf129('0x37')]||0x14)*0x3e8;var _0x204ad1,_0x11fa9b;if(_0xbc41d2>_0x4f3f90){_0x4f3f90=_0xbc41d2;}var _0x2633a7=seqqueue[_0xf129('0x3e')](_0xbc41d2);_0x2633a7['id']=_0x4b3690;_0x2633a7[_0xf129('0x3f')]=_0xbc41d2;_0x2633a7[_0xf129('0x40')]=_0x4f3f90;_0x2633a7[_0xf129('0x22')]=_0x38001a[_0xf129('0x22')];_0x3da971[_0xf129('0x41')][_0x4b3690]['on'](_0xf129('0x42'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4b3690);stopRouting(_0x4b3690,_0x30e7f7,_0x38001a,_0x3da971);clearTimeout(_0x204ad1);_0x204ad1=undefined;_0x2633a7[_0xf129('0x43')](!![]);if(_0x3da971['rules'][_0x4b3690]){delete _0x3da971[_0xf129('0x41')][_0x4b3690];}_0x526416[_0xf129('0x3b')]();});_0x3da971[_0xf129('0x41')][_0x4b3690]['on'](_0xf129('0x44'),function(){if(_0x3da971[_0xf129('0x41')][_0x4b3690]){delete _0x3da971[_0xf129('0x41')][_0x4b3690];}});_0x204ad1=setTimeout(function(){logger[_0xf129('0x2c')](_0xf129('0x45'),_0x4b3690);endRouting(_0x4b3690,_0x30e7f7,_0x38001a,_0x3da971);clearTimeout(_0x204ad1);_0x2633a7[_0xf129('0x43')](!![]);_0x526416[_0xf129('0x46')]();},_0x4f3f90);switch(_0x30e7f7[_0xf129('0x47')]){case _0xf129('0x48'):strategy[_0xf129('0x48')](_0x2633a7,_0x30e7f7,_0x3da971,_0x38001a);break;default:strategy[_0xf129('0x49')](_0x2633a7,_0x30e7f7,_0x3da971,_0x38001a);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4b3690,_0x3c6fe9[_0xf129('0x2e')]);_0x526416[_0xf129('0x3b')]();}}}catch(_0x2268f9){console[_0xf129('0x4a')](_0x2268f9);logger[_0xf129('0x31')](_0xf129('0x4b'),_0x4b3690,_0x2268f9[_0xf129('0x4c')]);_0x526416[_0xf129('0x3b')]();}};}; \ No newline at end of file +var _0x5cee=['rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','log','validate','lodash','util','seq-queue','moment','../../../../config/logger','routing','./strategy','defaults','redis','socket.io-emitter','account','queue','joinAt','emit','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','info','[%s][STOP:QUEUE][NAME:%s]','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','qtimeout'];(function(_0x5a0f26,_0x4bee1f){var _0x1f42b2=function(_0x198d0a){while(--_0x198d0a){_0x5a0f26['push'](_0x5a0f26['shift']());}};_0x1f42b2(++_0x4bee1f);}(_0x5cee,0x1b3));var _0xe5ce=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5cee[_0xfae23b];return _0x200640;};'use strict';var schema=require(_0xe5ce('0x0'));var _=require(_0xe5ce('0x1'));var util=require(_0xe5ce('0x2'));var seqqueue=require(_0xe5ce('0x3'));var moment=require(_0xe5ce('0x4'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xe5ce('0x5'))(_0xe5ce('0x6'));var strategy=require(_0xe5ce('0x7'));config['redis']=_[_0xe5ce('0x8')](config[_0xe5ce('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe5ce('0xa'))(new Redis(config['redis']));var attributes=['id','queue_id',_0xe5ce('0xb'),_0xe5ce('0xc'),'from',_0xe5ce('0xd')];function emit(_0x97974c,_0x194558,_0x9be6ce){io['to'](_0x97974c)[_0xe5ce('0xe')](_0x194558,_0x9be6ce);}function emitChannelQueueInteraction(_0x14bf90,_0x3366a4,_0x5db9c2,_0x54ea4d,_0x3e6ce5,_0x1d16bf,_0x4a8933,_0x225b73){var _0x33055a=_['clone'](_0x5db9c2);_0x33055a[_0xe5ce('0xf')]=_0x225b73;_0x33055a['queue']=_0x3366a4;_0x33055a['account']=_0x54ea4d;_0x33055a['id']=_0x3e6ce5;if(_0x1d16bf){_0x4a8933[util[_0xe5ce('0x10')](_0xe5ce('0x11'),_0x14bf90)][_0x3e6ce5]=_[_0xe5ce('0x12')](_0x33055a,attributes);}else{delete _0x4a8933[util[_0xe5ce('0x10')](_0xe5ce('0x11'),_0x14bf90)][_0x3e6ce5];}emit(util[_0xe5ce('0x10')](_0xe5ce('0x13'),_0x14bf90,_0x3366a4),util['format']('%s_queue_waiting_interaction:%s',_0x14bf90,_0x1d16bf?_0xe5ce('0x14'):_0xe5ce('0x15')),_['pick'](_0x33055a,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xe5ce('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xe5ce('0x17')),'faxQueueReport':require(_0xe5ce('0x18')),'whatsappQueueReport':require(_0xe5ce('0x19'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xe5ce('0x1a')},'timeout':{'type':'number','message':_0xe5ce('0x1b')}});function startRouting(_0x1f6ab3,_0xdebad7,_0x57a449,_0xf0e421){if(_0x1f6ab3&&_0xdebad7&&_0x57a449){_0xdebad7[_0xe5ce('0x1c')]+=0x1;var _0x54258e={'uniqueid':_0x1f6ab3,'from':_0x57a449[_0xe5ce('0x1d')]?_0x57a449[_0xe5ce('0x1d')][_0xe5ce('0x1e')]:'','joinAt':moment()[_0xe5ce('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57a449['contact']?_0x57a449['contact']['id']:null,'ListId':_0x57a449[_0xe5ce('0x1f')]?_0x57a449['list']['id']:null};_0x54258e[_['upperFirst'](_0x57a449[_0xe5ce('0x20')])+_0xe5ce('0x21')]=_0xdebad7['id']||null;_0x54258e[_[_0xe5ce('0x22')](_0x57a449[_0xe5ce('0x20')])+_0xe5ce('0x23')]=_0x57a449['interaction']?_0x57a449[_0xe5ce('0x24')]['id']:null;_0x54258e[_['upperFirst'](_0x57a449[_0xe5ce('0x20')])+_0xe5ce('0x25')]=_0x57a449[_0xe5ce('0x26')]?_0x57a449[_0xe5ce('0x26')]['id']:null;_0x54258e[_[_0xe5ce('0x22')](_0x57a449[_0xe5ce('0x20')])+(_0x57a449[_0xe5ce('0x20')]!==_0xe5ce('0x27')?_0xe5ce('0x28'):_0xe5ce('0x29'))]=_0x57a449[_0xe5ce('0xb')]?_0x57a449[_0xe5ce('0xb')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x1f6ab3,_0xdebad7[_0xe5ce('0x2a')]));emitChannelQueueInteraction(_0x57a449[_0xe5ce('0x20')],_0xdebad7[_0xe5ce('0x2a')],_0x54258e,_0x57a449[_0xe5ce('0xb')][_0xe5ce('0x2a')],_0x57a449[_0xe5ce('0x26')]['id'],!![],_0xf0e421,_0xdebad7['id']);if(rpc[_0x57a449['channel']+_0xe5ce('0x2b')]){return rpc[_0x57a449[_0xe5ce('0x20')]+_0xe5ce('0x2b')]['create'](_0x54258e)[_0xe5ce('0x2c')](function(_0x358e11){logger[_0xe5ce('0x2d')](_0xe5ce('0x2e'));});}}}function stopRouting(_0x297df6,_0x1f5ebc,_0x5e9abe,_0xd8ecb0){if(_0x297df6&&_0x1f5ebc){_0x1f5ebc[_0xe5ce('0x1c')]-=0x1;var _0x2b891d={'leaveAt':moment()[_0xe5ce('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xe5ce('0x10')](_0xe5ce('0x2f')),'reason':'accepted'};logger[_0xe5ce('0x30')](util['format'](_0xe5ce('0x31'),_0x297df6,_0x1f5ebc[_0xe5ce('0x2a')]));emitChannelQueueInteraction(_0x5e9abe[_0xe5ce('0x20')],_0x1f5ebc[_0xe5ce('0x2a')],_0x5e9abe[_0xe5ce('0x1d')],_0x5e9abe[_0xe5ce('0xb')][_0xe5ce('0x2a')],_0x5e9abe[_0xe5ce('0x26')]['id'],![],_0xd8ecb0,_0x1f5ebc['id']);if(rpc[_0x5e9abe['channel']+_0xe5ce('0x2b')]){return rpc[_0x5e9abe[_0xe5ce('0x20')]+_0xe5ce('0x2b')]['update'](_0x297df6,_0x2b891d)[_0xe5ce('0x2c')](function(_0x352d5e){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x4881fa,_0x294747,_0xa700a0,_0x384019){if(_0x4881fa&&_0x294747){_0x294747['waiting']-=0x1;var _0x4fbbd3={'leaveAt':moment()[_0xe5ce('0x10')](_0xe5ce('0x2f')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xe5ce('0x32')};logger[_0xe5ce('0x30')](util[_0xe5ce('0x10')]('[%s][END:QUEUE][NAME:%s]',_0x4881fa,_0x294747['name']));emitChannelQueueInteraction(_0xa700a0['channel'],_0x294747[_0xe5ce('0x2a')],_0xa700a0['body'],_0xa700a0['account'][_0xe5ce('0x2a')],_0xa700a0[_0xe5ce('0x26')]['id'],![],_0x384019);if(rpc[_0xa700a0['channel']+_0xe5ce('0x2b')]){return rpc[_0xa700a0['channel']+'QueueReport'][_0xe5ce('0x33')](_0x4881fa,_0x4fbbd3)[_0xe5ce('0x2c')](function(_0x48282a){logger[_0xe5ce('0x2d')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x396d74){return function(_0x265ba7){return _0x265ba7[_0xe5ce('0x2a')][_0xe5ce('0x34')]()===_0x396d74[_0xe5ce('0x34')]();};}exports[_0xe5ce('0x35')]=function(_0x29a9b3,_0x381fd5,_0x1c7600,_0x13e130){return function(_0x228234){try{var _0x1b25ea={'name':_0x381fd5[0x0],'timeout':_0x381fd5[0x1]};var _0x4d3911=queue[_0xe5ce('0x0')](_0x1b25ea,{'typecast':!![]});if(_0x4d3911[_0xe5ce('0x36')]){logger[_0xe5ce('0x2d')](_0xe5ce('0x37'),_0x29a9b3,_[_0xe5ce('0x38')](_0x4d3911,'message')[_0xe5ce('0x39')](',\x20'));_0x228234[_0xe5ce('0x3a')]();}else{var _0x22d2d7=_[_0xe5ce('0x3b')](_0x1c7600[_0x13e130[_0xe5ce('0x20')]+_0xe5ce('0x3c')],handleFindQueue(_0x1b25ea[_0xe5ce('0x2a')]));if(_0x22d2d7){startRouting(_0x29a9b3,_0x22d2d7,_0x13e130,_0x1c7600);var _0x411f47=(_0x22d2d7[_0xe5ce('0x32')]||0xa)*0x3e8;var _0x2eaab9=(_0x1b25ea[_0xe5ce('0x32')]||0x14)*0x3e8;var _0x20e3fb,_0x224fb5;if(_0x411f47>_0x2eaab9){_0x2eaab9=_0x411f47;}var _0x27eb81=seqqueue['createQueue'](_0x411f47);_0x27eb81['id']=_0x29a9b3;_0x27eb81['atimeout']=_0x411f47;_0x27eb81[_0xe5ce('0x3d')]=_0x2eaab9;_0x27eb81[_0xe5ce('0x20')]=_0x13e130[_0xe5ce('0x20')];_0x1c7600[_0xe5ce('0x3e')][_0x29a9b3]['on'](_0xe5ce('0x3f'),function(){logger['info'](_0xe5ce('0x40'),_0x29a9b3);stopRouting(_0x29a9b3,_0x22d2d7,_0x13e130,_0x1c7600);clearTimeout(_0x20e3fb);_0x20e3fb=undefined;_0x27eb81[_0xe5ce('0x41')](!![]);if(_0x1c7600['rules'][_0x29a9b3]){delete _0x1c7600[_0xe5ce('0x3e')][_0x29a9b3];}_0x228234[_0xe5ce('0x3a')]();});_0x1c7600[_0xe5ce('0x3e')][_0x29a9b3]['on']('complete',function(){if(_0x1c7600[_0xe5ce('0x3e')][_0x29a9b3]){delete _0x1c7600[_0xe5ce('0x3e')][_0x29a9b3];}});_0x20e3fb=setTimeout(function(){logger['info'](_0xe5ce('0x42'),_0x29a9b3);endRouting(_0x29a9b3,_0x22d2d7,_0x13e130,_0x1c7600);clearTimeout(_0x20e3fb);_0x27eb81['close'](!![]);_0x228234[_0xe5ce('0x43')]();},_0x2eaab9);switch(_0x22d2d7[_0xe5ce('0x44')]){case _0xe5ce('0x45'):strategy[_0xe5ce('0x45')](_0x27eb81,_0x22d2d7,_0x1c7600,_0x13e130);break;default:strategy['beepall'](_0x27eb81,_0x22d2d7,_0x1c7600,_0x13e130);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x29a9b3,_0x1b25ea['name']);_0x228234[_0xe5ce('0x3a')]();}}}catch(_0x47ec67){console[_0xe5ce('0x46')](_0x47ec67);logger[_0xe5ce('0x2d')](_0xe5ce('0x37'),_0x29a9b3,_0x47ec67['stack']);_0x228234[_0xe5ce('0x3a')]();}};}; \ 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 cb31630..373242e 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 _0x051d=['push','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING','hideNotification','STOP','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','bind','handleTimeout','drained','handleDrained','prototype'];(function(_0x42d2af,_0x3961b5){var _0x1d6d63=function(_0x10833e){while(--_0x10833e){_0x42d2af['push'](_0x42d2af['shift']());}};_0x1d6d63(++_0x3961b5);}(_0x051d,0x6f));var _0xd051=function(_0xf4708c,_0x20fbd1){_0xf4708c=_0xf4708c-0x0;var _0x19f3e6=_0x051d[_0xf4708c];return _0x19f3e6;};'use strict';var _=require(_0xd051('0x0'));var uuid=require(_0xd051('0x1'));var util=require(_0xd051('0x2'));var logger=require(_0xd051('0x3'))(_0xd051('0x4'));var Agent=function(_0x49739d,_0x55974d,_0x21d68d,_0x2966cf){this[_0xd051('0x5')]=uuid['v4']();this[_0xd051('0x6')]=_0x49739d;this[_0xd051('0x7')]=_0x55974d;this['realtime']=_0x21d68d;this[_0xd051('0x4')]=_0x2966cf;this[_0xd051('0x6')]['push'](this['handleRun'][_0xd051('0x8')](this),this[_0xd051('0x9')][_0xd051('0x8')](this));this[_0xd051('0x6')]['on']('timeout',this['handleTimeout'][_0xd051('0x8')](this));this[_0xd051('0x6')]['on'](_0xd051('0xa'),this[_0xd051('0xb')][_0xd051('0x8')](this));};Agent[_0xd051('0xc')][_0xd051('0xd')]=function(){this[_0xd051('0x6')][_0xd051('0xd')](this[_0xd051('0xe')][_0xd051('0x8')](this),this[_0xd051('0x9')][_0xd051('0x8')](this));};Agent['prototype'][_0xd051('0xb')]=function(){this[_0xd051('0x9')](!![]);};Agent[_0xd051('0xc')]['handleRun']=function(_0x194fdd){logger[_0xd051('0xf')](_0xd051('0x10'),this[_0xd051('0x6')]['id'],this['agent']['id']);if(_[_0xd051('0x11')](this[_0xd051('0x12')]['agents'][this[_0xd051('0x7')]['id']])){logger[_0xd051('0xf')](_0xd051('0x13'),this[_0xd051('0x6')]['id'],this[_0xd051('0x7')]['id']);setTimeout(this['push'][_0xd051('0x8')](this),0x3e8);}else{if(this[_0xd051('0x4')][_0xd051('0x14')]||util[_0xd051('0x15')](this[_0xd051('0x6')]['id'],this[_0xd051('0x12')][_0xd051('0x16')][this['agent']['id']],this[_0xd051('0x6')][_0xd051('0x17')],![])){this[_0xd051('0x12')][_0xd051('0x16')][this[_0xd051('0x7')]['id']][_0xd051('0x18')]=!![];this['realtime'][_0xd051('0x16')][this[_0xd051('0x7')]['id']][_0xd051('0x19')]=undefined;util[_0xd051('0x1a')](this[_0xd051('0x5')],this['squeue']['id'],this[_0xd051('0x12')][_0xd051('0x16')][this[_0xd051('0x7')]['id']],null,this[_0xd051('0x4')]);util[_0xd051('0x1b')](this[_0xd051('0x6')]['id'],this[_0xd051('0x12')][_0xd051('0x16')][this[_0xd051('0x7')]['id']],_0xd051('0x1c')+(this['routing'][_0xd051('0x14')]?':FORCED':''));}else{logger[_0xd051('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xd051('0x8')](this),0x3e8);}}};Agent[_0xd051('0xc')][_0xd051('0x9')]=function(_0x56d043){if(_[_0xd051('0x11')](this['realtime'][_0xd051('0x16')][this[_0xd051('0x7')]['id']])){return logger[_0xd051('0xf')](_0xd051('0x13'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xd051('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xd051('0x7')]['id']);util[_0xd051('0x1d')](this[_0xd051('0x5')],this['squeue']['id'],this[_0xd051('0x12')][_0xd051('0x16')][this[_0xd051('0x7')]['id']],null,this['routing']);this[_0xd051('0x12')][_0xd051('0x16')][this[_0xd051('0x7')]['id']][_0xd051('0x18')]=![];this['realtime'][_0xd051('0x16')][this['agent']['id']][_0xd051('0x19')]=undefined;util[_0xd051('0x1b')](this[_0xd051('0x6')]['id'],this['realtime'][_0xd051('0x16')][this[_0xd051('0x7')]['id']],_0x56d043?_0xd051('0x1e'):'TIMEOUT');}if(!_0x56d043){setTimeout(this[_0xd051('0xd')][_0xd051('0x8')](this),0x3e8);}};function agent(_0x2408ae,_0x2a0646,_0x4ad5ac,_0xcf6547){return new Agent(_0x2408ae,_0x2a0646,_0x4ad5ac,_0xcf6547);}module['exports']=agent; \ No newline at end of file +var _0x7a50=['uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','drained','prototype','handleDrained','agent','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busyQueue','showNotification','writeLog','RINGING',':FORCED','info','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','TIMEOUT','exports','lodash'];(function(_0x3adb4d,_0x54e5d0){var _0x94f68f=function(_0x108661){while(--_0x108661){_0x3adb4d['push'](_0x3adb4d['shift']());}};_0x94f68f(++_0x54e5d0);}(_0x7a50,0xbf));var _0x07a5=function(_0x5de56e,_0x252350){_0x5de56e=_0x5de56e-0x0;var _0x3266bd=_0x7a50[_0x5de56e];return _0x3266bd;};'use strict';var _=require(_0x07a5('0x0'));var uuid=require(_0x07a5('0x1'));var util=require(_0x07a5('0x2'));var logger=require('../../../../../config/logger')(_0x07a5('0x3'));var Agent=function(_0x596e9c,_0x426b76,_0x3caeb6,_0xc2b86){this[_0x07a5('0x4')]=uuid['v4']();this[_0x07a5('0x5')]=_0x596e9c;this['agent']=_0x426b76;this[_0x07a5('0x6')]=_0x3caeb6;this[_0x07a5('0x3')]=_0xc2b86;this['squeue'][_0x07a5('0x7')](this[_0x07a5('0x8')][_0x07a5('0x9')](this),this[_0x07a5('0xa')][_0x07a5('0x9')](this));this['squeue']['on']('timeout',this[_0x07a5('0xa')][_0x07a5('0x9')](this));this[_0x07a5('0x5')]['on'](_0x07a5('0xb'),this['handleDrained']['bind'](this));};Agent[_0x07a5('0xc')][_0x07a5('0x7')]=function(){this[_0x07a5('0x5')][_0x07a5('0x7')](this[_0x07a5('0x8')][_0x07a5('0x9')](this),this[_0x07a5('0xa')][_0x07a5('0x9')](this));};Agent['prototype'][_0x07a5('0xd')]=function(){this[_0x07a5('0xa')](!![]);};Agent['prototype'][_0x07a5('0x8')]=function(_0x551cd2){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x07a5('0x5')]['id'],this[_0x07a5('0xe')]['id']);if(_[_0x07a5('0xf')](this[_0x07a5('0x6')]['agents'][this['agent']['id']])){logger['info'](_0x07a5('0x10'),this[_0x07a5('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x07a5('0x7')][_0x07a5('0x9')](this),0x3e8);}else{if(this[_0x07a5('0x3')][_0x07a5('0x11')]||util[_0x07a5('0x12')](this['squeue']['id'],this[_0x07a5('0x6')][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']],this[_0x07a5('0x5')][_0x07a5('0x14')],![])){this['realtime'][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']]['busy']=!![];this[_0x07a5('0x6')][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']][_0x07a5('0x15')]=undefined;util[_0x07a5('0x16')](this[_0x07a5('0x4')],this['squeue']['id'],this['realtime'][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']],null,this[_0x07a5('0x3')]);util[_0x07a5('0x17')](this[_0x07a5('0x5')]['id'],this[_0x07a5('0x6')][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']],_0x07a5('0x18')+(this['routing'][_0x07a5('0x11')]?_0x07a5('0x19'):''));}else{logger[_0x07a5('0x1a')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x07a5('0x5')]['id'],this[_0x07a5('0xe')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x07a5('0xc')]['handleTimeout']=function(_0x1f8c1a){if(_[_0x07a5('0xf')](this[_0x07a5('0x6')][_0x07a5('0x13')][this['agent']['id']])){return logger[_0x07a5('0x1a')](_0x07a5('0x10'),this[_0x07a5('0x5')]['id'],this['agent']['id']);}else{logger['info'](_0x07a5('0x1b'),this[_0x07a5('0x5')]['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x07a5('0x5')]['id'],this['realtime'][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']],null,this[_0x07a5('0x3')]);this[_0x07a5('0x6')][_0x07a5('0x13')][this[_0x07a5('0xe')]['id']][_0x07a5('0x1c')]=![];this['realtime']['agents'][this[_0x07a5('0xe')]['id']][_0x07a5('0x15')]=undefined;util[_0x07a5('0x17')](this[_0x07a5('0x5')]['id'],this[_0x07a5('0x6')]['agents'][this[_0x07a5('0xe')]['id']],_0x1f8c1a?_0x07a5('0x1d'):_0x07a5('0x1e'));}if(!_0x1f8c1a){setTimeout(this[_0x07a5('0x7')][_0x07a5('0x9')](this),0x3e8);}};function agent(_0x5df401,_0x5ce79a,_0x40734c,_0x22c040){return new Agent(_0x5df401,_0x5ce79a,_0x40734c,_0x22c040);}module[_0x07a5('0x1f')]=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 af8c3ef..0c9565e 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 _0x4be6=['squeue','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','push','prototype','isNil','queue','Agents','length','agents','info','channel','writeLog','busy','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','busyQueue','exports','uuid','./util','../../../../../config/logger','routing','notificationId'];(function(_0x42277b,_0x1b512c){var _0x5c1e6c=function(_0x9f9ed3){while(--_0x9f9ed3){_0x42277b['push'](_0x42277b['shift']());}};_0x5c1e6c(++_0x1b512c);}(_0x4be6,0xb5));var _0x64be=function(_0x320cb3,_0x49c0cf){_0x320cb3=_0x320cb3-0x0;var _0x899c86=_0x4be6[_0x320cb3];return _0x899c86;};'use strict';var _=require('lodash');var uuid=require(_0x64be('0x0'));var util=require(_0x64be('0x1'));var logger=require(_0x64be('0x2'))(_0x64be('0x3'));var Beepall=function(_0x1cb7dd,_0x2dea47,_0xebbf1b,_0x85d7a2){this[_0x64be('0x4')]=uuid['v4']();this[_0x64be('0x5')]=_0x1cb7dd;this['queue']=_0x2dea47;this[_0x64be('0x6')]=_0xebbf1b;this[_0x64be('0x3')]=_0x85d7a2;this[_0x64be('0x5')]['push'](this[_0x64be('0x7')][_0x64be('0x8')](this),this['handleTimeout'][_0x64be('0x8')](this));this['squeue']['on'](_0x64be('0x9'),this[_0x64be('0xa')]['bind'](this));this[_0x64be('0x5')]['on'](_0x64be('0xb'),this[_0x64be('0xc')][_0x64be('0x8')](this));};Beepall['prototype'][_0x64be('0xd')]=function(){this['squeue'][_0x64be('0xd')](this[_0x64be('0x7')][_0x64be('0x8')](this),this[_0x64be('0xa')][_0x64be('0x8')](this));};Beepall['prototype'][_0x64be('0xc')]=function(_0x5aef83){this[_0x64be('0xa')](!![]);};Beepall[_0x64be('0xe')][_0x64be('0x7')]=function(_0x46d207){var _0x17ba47=!![];if(!_['isNil'](this['queue'])&&!_[_0x64be('0xf')](this[_0x64be('0x10')][_0x64be('0x11')])&&this[_0x64be('0x10')][_0x64be('0x11')]['length']>0x0){for(var _0x2093a9=0x0,_0xe80165;_0x2093a90x0){for(var _0x49cb73=0x0,_0x38a9b0;_0x49cb730x0&&_0x502c2e[_0x18680f+'CurrentCapacity']>=_0x502c2e[_0x18680f+'Capacity']){writeLog(_0x379cbd,_0x502c2e,_0x18680f[_0x5645('0x27')]()+_0x5645('0x28'));return![];}}return!![];};exports[_0x5645('0x29')]=function(_0x308991,_0x3a5c61,_0x351cbb,_0x3b9d8e,_0xc585f3){return sendNotification(!![],_0x308991,_0x3a5c61,_0x351cbb,_0x3b9d8e,_0xc585f3);};exports[_0x5645('0x2a')]=function(_0x30a5d0,_0x1c0aa2,_0x2154a7,_0x406782,_0xa2a4a1){return sendNotification(![],_0x30a5d0,_0x1c0aa2,_0x2154a7,_0x406782,_0xa2a4a1);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xda19=['isAgentAvailable','busy','online','OFFLINE','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','showNotification','util','../utils','ioredis','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','notification:%s','save','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x25bdd0,_0x28ed57){_0x25bdd0=_0x25bdd0-0x0;var _0x11430e=_0xda19[_0x25bdd0];return _0x11430e;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var utils=require(_0x9da1('0x1'));var Mustache=require('mustache');var Redis=require(_0x9da1('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x9da1('0x3'))('routing');config[_0x9da1('0x4')]=_[_0x9da1('0x5')](config[_0x9da1('0x4')],{'host':_0x9da1('0x6'),'port':0x18eb});var io=require(_0x9da1('0x7'))(new Redis(config[_0x9da1('0x4')]));function emit(_0x23e4f7,_0x2c3cdd,_0x1c24e6){io['to'](_0x23e4f7)[_0x9da1('0x8')](_0x2c3cdd,_0x1c24e6);}function sendNotification(_0x47df89,_0x55f66b,_0x4cb9f7,_0x417312,_0x493d0b,_0x33cfe5){io['to'](util[_0x9da1('0x9')](_0x9da1('0xa'),_0x417312[_0x9da1('0xb')]))[_0x9da1('0x8')](_0x9da1('0xc'),_0x417312);var _0x9fd032=_0x33cfe5||{};var _0x5807ec=_0x4cb9f7['split']('.');var _0x3114f7={'uniqueid':_0x55f66b,'channel':_0x5807ec[0x0],'id':_0x5807ec[0x1],'title':_0x5807ec[0x0]+'\x20interaction','interactionId':_0x5807ec[0x2],'queue':_0x493d0b?_0x493d0b[_0x9da1('0xb')]:null,'sound':_0x9fd032[_0x9da1('0xd')][_0x9da1('0xe')],'shake':_0x9fd032[_0x9da1('0xd')]['notificationShake']};try{if(!_0x9fd032[_0x9da1('0xf')]){_0x9fd032['body']={};}if(_0x493d0b){_0x9fd032['body'][_0x9da1('0x10')]=_0x493d0b;}else if(_0x9fd032['body'][_0x9da1('0x10')]){delete _0x9fd032[_0x9da1('0xf')][_0x9da1('0x10')];}_0x3114f7[_0x9da1('0x11')]=utils[_0x9da1('0x12')](_0x9fd032['account'][_0x9da1('0x13')],_0x9fd032);}catch(_0x116a76){_0x3114f7[_0x9da1('0x11')]=_0x9da1('0x14');logger[_0x9da1('0x15')](util[_0x9da1('0x9')]('[%s][QUEUE]\x20%s',_0x55f66b,_0x116a76['message']));}io['to'](util[_0x9da1('0x9')](_0x9da1('0xa'),_0x417312[_0x9da1('0xb')]))[_0x9da1('0x8')](util[_0x9da1('0x9')](_0x9da1('0x16'),_0x47df89?_0x9da1('0x17'):'remove'),_0x3114f7);}function writeLog(_0x1a459c,_0x554845,_0x9c3b37){return logger[_0x9da1('0x18')](util[_0x9da1('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1a459c,_0x554845['name'],_0x9c3b37));}exports[_0x9da1('0x19')]=function(_0x3e6f85,_0x16ee0c,_0x330219,_0x32eb55){if(_0x16ee0c[_0x9da1('0x1a')]){writeLog(_0x3e6f85,_0x16ee0c,'BUSY');return![];}if(!_0x16ee0c[_0x9da1('0x1b')]){writeLog(_0x3e6f85,_0x16ee0c,_0x9da1('0x1c'));return![];}if(_0x16ee0c[_0x330219+'Pause']){writeLog(_0x3e6f85,_0x16ee0c,_0x9da1('0x1d'));return![];}if(_0x32eb55&&_0x16ee0c[_0x9da1('0x1e')](_0x330219+'Capacity')&&_0x16ee0c[_0x9da1('0x1e')](_0x330219+_0x9da1('0x1f'))){if(_0x16ee0c[_0x330219+'Capacity']>0x0&&_0x16ee0c[_0x330219+_0x9da1('0x1f')]>=_0x16ee0c[_0x330219+_0x9da1('0x20')]){writeLog(_0x3e6f85,_0x16ee0c,_0x330219['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x9da1('0x21')]=function(_0x47055e,_0x5eca5b,_0x27c6e2,_0x5db5c2,_0x5a6f2d){return sendNotification(!![],_0x47055e,_0x5eca5b,_0x27c6e2,_0x5db5c2,_0x5a6f2d);};exports['hideNotification']=function(_0x31b826,_0x404b86,_0x24c6d5,_0x26dd58,_0x140c6c){return sendNotification(![],_0x31b826,_0x404b86,_0x24c6d5,_0x26dd58,_0x140c6c);};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 c876037..9fe9bbb 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 _0x3397=['[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','validate','shelljs','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x19ceb9,_0x48d9bb){var _0x5785f6=function(_0x3ecb1e){while(--_0x3ecb1e){_0x19ceb9['push'](_0x19ceb9['shift']());}};_0x5785f6(++_0x48d9bb);}(_0x3397,0x1a3));var _0x7339=function(_0x1820f1,_0x1403e7){_0x1820f1=_0x1820f1-0x0;var _0x167aed=_0x3397[_0x1820f1];return _0x167aed;};'use strict';var schema=require(_0x7339('0x0'));var sh=require(_0x7339('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x7339('0x2'))(_0x7339('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x7339('0x4')}});exports[_0x7339('0x5')]=function(_0x2cdef4,_0x52ef01){return function(_0x22dd50){try{var _0x25df02={'command':_0x52ef01[0x0]};var _0x1e42c4=system[_0x7339('0x0')](_0x25df02,{'typecast':!![]});if(_0x1e42c4['length']){logger['error'](_0x7339('0x6'),_0x2cdef4,_[_0x7339('0x7')](_0x1e42c4,_0x7339('0x8'))[_0x7339('0x9')](',\x20'));logger[_0x7339('0xa')](_0x7339('0xb'),_0x2cdef4);_0x22dd50['next']();}else{var _0x2d5832=this;var _0x243008=utils[_0x7339('0xc')](_0x52ef01[0x0],this);logger['info'](_0x7339('0xd'),_0x2cdef4,_0x243008);sh[_0x7339('0xe')](_['trim'](_0x243008),function(_0x228edc,_0x4c287b){logger['info'](_0x7339('0xf'),_0x2cdef4,_0x228edc);if(_0x228edc==0x0){var _0x3f0030=_0x4c287b[_0x7339('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x7339('0x11')](_0x52ef01[0x1])||_[_0x7339('0x12')](_0x52ef01[0x1])){logger[_0x7339('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x2cdef4);_0x2d5832[_0x7339('0x13')][_0x52ef01[0x1]]=_0x3f0030;}else{logger['info'](_0x7339('0x14'),_0x2cdef4,_0x52ef01[0x1],_0x3f0030);_0x2d5832['body'][_0x52ef01[0x1]]=_0x3f0030;}}_0x22dd50[_0x7339('0x15')]();});}}catch(_0x4b18a7){logger[_0x7339('0x16')](_0x7339('0x6'),_0x2cdef4,_[_0x7339('0x17')](_0x4b18a7)?JSON[_0x7339('0x18')](_0x4b18a7):_0x4b18a7);logger[_0x7339('0xa')](_0x7339('0xb'),_0x2cdef4);_0x22dd50[_0x7339('0x15')]();}};}; \ No newline at end of file +var _0x0ef0=['join','[%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','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','info','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ef0,0x80));var _0x00ef=function(_0x68c4e3,_0x5b18b0){_0x68c4e3=_0x68c4e3-0x0;var _0xaca048=_0x0ef0[_0x68c4e3];return _0xaca048;};'use strict';var schema=require(_0x00ef('0x0'));var sh=require(_0x00ef('0x1'));var _=require('lodash');var utils=require(_0x00ef('0x2'));var logger=require(_0x00ef('0x3'))(_0x00ef('0x4'));var system=schema({'command':{'type':_0x00ef('0x5'),'required':!![],'message':_0x00ef('0x6')}});exports[_0x00ef('0x7')]=function(_0x53bad3,_0x5743e8){return function(_0x3536c3){try{var _0x406d13={'command':_0x5743e8[0x0]};var _0x471ebf=system[_0x00ef('0x0')](_0x406d13,{'typecast':!![]});if(_0x471ebf['length']){logger[_0x00ef('0x8')](_0x00ef('0x9'),_0x53bad3,_[_0x00ef('0xa')](_0x471ebf,_0x00ef('0xb'))[_0x00ef('0xc')](',\x20'));logger['info'](_0x00ef('0xd'),_0x53bad3);_0x3536c3[_0x00ef('0xe')]();}else{var _0x2dce41=this;var _0x58cbca=utils[_0x00ef('0xf')](_0x5743e8[0x0],this);logger['info'](_0x00ef('0x10'),_0x53bad3,_0x58cbca);sh[_0x00ef('0x11')](_[_0x00ef('0x12')](_0x58cbca),function(_0xdbfd10,_0x30ac06){logger['info'](_0x00ef('0x13'),_0x53bad3,_0xdbfd10);if(_0xdbfd10==0x0){var _0x4c9a9c=_0x30ac06[_0x00ef('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x00ef('0x15')](_0x5743e8[0x1])||_[_0x00ef('0x16')](_0x5743e8[0x1])){logger['info'](_0x00ef('0x17'),_0x53bad3);_0x2dce41['body'][_0x5743e8[0x1]]=_0x4c9a9c;}else{logger['info'](_0x00ef('0x18'),_0x53bad3,_0x5743e8[0x1],_0x4c9a9c);_0x2dce41[_0x00ef('0x19')][_0x5743e8[0x1]]=_0x4c9a9c;}}_0x3536c3[_0x00ef('0xe')]();});}}catch(_0x250c3d){logger['error'](_0x00ef('0x9'),_0x53bad3,_['isObject'](_0x250c3d)?JSON[_0x00ef('0x1a')](_0x250c3d):_0x250c3d);logger[_0x00ef('0x1b')](_0x00ef('0xd'),_0x53bad3);_0x3536c3['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 7ab0fbe..d1bb762 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 _0x85be=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','info','next','channel','Interaction','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','error','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate'];(function(_0x4d97f8,_0xb891ac){var _0x2cc9d0=function(_0x2bf658){while(--_0x2bf658){_0x4d97f8['push'](_0x4d97f8['shift']());}};_0x2cc9d0(++_0xb891ac);}(_0x85be,0x6f));var _0xe85b=function(_0x26fe62,_0x59be8a){_0x26fe62=_0x26fe62-0x0;var _0x11f8c5=_0x85be[_0x26fe62];return _0x11f8c5;};'use strict';var schema=require(_0xe85b('0x0'));var _=require(_0xe85b('0x1'));var rpc={'chatInteraction':require(_0xe85b('0x2')),'openchannelInteraction':require(_0xe85b('0x3')),'smsInteraction':require(_0xe85b('0x4')),'mailInteraction':require(_0xe85b('0x5')),'faxInteraction':require(_0xe85b('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xe85b('0x7'))(_0xe85b('0x8'));var tag=schema({'tag':{'type':_0xe85b('0x9'),'required':!![],'message':_0xe85b('0xa')}});exports[_0xe85b('0xb')]=function(_0x3ac797,_0x1ab289,_0x55243f,_0xed4c6d){return function(_0x33234e){try{var _0x5becfc={'tag':_0x1ab289[0x0]};var _0x18f7b0=tag[_0xe85b('0x0')](_0x5becfc,{'typecast':!![]});if(_0x18f7b0[_0xe85b('0xc')]){logger['error'](_0xe85b('0xd'),_0x3ac797,_['map'](_0x18f7b0,_0xe85b('0xe'))[_0xe85b('0xf')](',\x20'));logger[_0xe85b('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3ac797);_0x33234e[_0xe85b('0x11')]();}else{var _0x260726={'ids':[_0x1ab289[0x0]]};if(rpc[_0xed4c6d[_0xe85b('0x12')]+'Interaction']){rpc[_0xed4c6d[_0xe85b('0x12')]+_0xe85b('0x13')][_0xe85b('0x14')](_0xed4c6d['interaction']['id'],_0x260726)['then'](function(_0x367191){logger[_0xe85b('0x10')](_0xe85b('0x15'),_0x3ac797,_0x1ab289[0x1],_0xed4c6d[_0xe85b('0x12')],_0xed4c6d[_0xe85b('0x16')]['id']);})[_0xe85b('0x17')](function(_0xfc6c51){logger[_0xe85b('0x18')]('[%s][TAG]\x20%s',_0x3ac797,JSON[_0xe85b('0x19')](_0xfc6c51));logger[_0xe85b('0x10')](_0xe85b('0x1a'),_0x3ac797);})['finally'](function(){_0x33234e[_0xe85b('0x11')]();});}}}catch(_0xe20909){logger[_0xe85b('0x18')](_0xe85b('0xd'),_0x3ac797,_[_0xe85b('0x1b')](_0xe20909)?JSON['stringify'](_0xe20909):_0xe20909);logger[_0xe85b('0x10')](_0xe85b('0x1a'),_0x3ac797);_0x33234e[_0xe85b('0x11')]();}};}; \ No newline at end of file +var _0xa39b=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0x11d678,_0x19f168){var _0x3532a2=function(_0x5b0bff){while(--_0x5b0bff){_0x11d678['push'](_0x11d678['shift']());}};_0x3532a2(++_0x19f168);}(_0xa39b,0x1d8));var _0xba39=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa39b[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0xba39('0x0'));var _=require(_0xba39('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xba39('0x2')),'smsInteraction':require(_0xba39('0x3')),'mailInteraction':require(_0xba39('0x4')),'faxInteraction':require(_0xba39('0x5')),'whatsappInteraction':require(_0xba39('0x6'))};var logger=require(_0xba39('0x7'))(_0xba39('0x8'));var tag=schema({'tag':{'type':_0xba39('0x9'),'required':!![],'message':_0xba39('0xa')}});exports[_0xba39('0xb')]=function(_0x30c553,_0x217a1f,_0x5649a5,_0x324740){return function(_0x38ce0e){try{var _0x479274={'tag':_0x217a1f[0x0]};var _0x3ec48c=tag['validate'](_0x479274,{'typecast':!![]});if(_0x3ec48c[_0xba39('0xc')]){logger[_0xba39('0xd')](_0xba39('0xe'),_0x30c553,_[_0xba39('0xf')](_0x3ec48c,_0xba39('0x10'))[_0xba39('0x11')](',\x20'));logger['info'](_0xba39('0x12'),_0x30c553);_0x38ce0e[_0xba39('0x13')]();}else{var _0x2b6144={'ids':[_0x217a1f[0x0]]};if(rpc[_0x324740[_0xba39('0x14')]+_0xba39('0x15')]){rpc[_0x324740[_0xba39('0x14')]+_0xba39('0x15')][_0xba39('0x16')](_0x324740[_0xba39('0x17')]['id'],_0x2b6144)[_0xba39('0x18')](function(_0x143cbb){logger[_0xba39('0x19')](_0xba39('0x1a'),_0x30c553,_0x217a1f[0x1],_0x324740[_0xba39('0x14')],_0x324740[_0xba39('0x17')]['id']);})[_0xba39('0x1b')](function(_0x5166b3){logger[_0xba39('0xd')](_0xba39('0xe'),_0x30c553,JSON[_0xba39('0x1c')](_0x5166b3));logger[_0xba39('0x19')](_0xba39('0x12'),_0x30c553);})[_0xba39('0x1d')](function(){_0x38ce0e['next']();});}}}catch(_0x1709a2){logger[_0xba39('0xd')](_0xba39('0xe'),_0x30c553,_['isObject'](_0x1709a2)?JSON[_0xba39('0x1c')](_0x1709a2):_0x1709a2);logger[_0xba39('0x19')](_0xba39('0x12'),_0x30c553);_0x38ce0e[_0xba39('0x13')]();}};}; \ 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 c451b61..22e6b01 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x2401f8,_0x3ab12a){var _0x2f9877=function(_0x204e2e){while(--_0x204e2e){_0x2401f8['push'](_0x2401f8['shift']());}};_0x2f9877(++_0x3ab12a);}(_0xe706,0xa3));var _0x6e70=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xe706[_0x413727];return _0x5f46d7;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x45ea8b,_0x5c2637){var _0x1e2cde=function(_0x492212){while(--_0x492212){_0x45ea8b['push'](_0x45ea8b['shift']());}};_0x1e2cde(++_0x5c2637);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index de6bc0e..1308f13 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 _0x0d63=['info','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','busyQueue','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','interval','listen','channel','interaction','isArray','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','message','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','rules','execute'];(function(_0x5f50eb,_0x3e7d18){var _0xb912b6=function(_0x19d99d){while(--_0x19d99d){_0x5f50eb['push'](_0x5f50eb['shift']());}};_0xb912b6(++_0x3e7d18);}(_0x0d63,0x1b1));var _0x30d6=function(_0x4be876,_0xd390b0){_0x4be876=_0x4be876-0x0;var _0x34dda2=_0x0d63[_0x4be876];return _0x34dda2;};'use strict';var _=require(_0x30d6('0x0'));var util=require(_0x30d6('0x1'));var path=require(_0x30d6('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x30d6('0x3'));var uuid=require(_0x30d6('0x4'));var config=require(_0x30d6('0x5'));var logger=require(_0x30d6('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x30d6('0x7')),'mailQueueReport':require(_0x30d6('0x8')),'chatQueueReport':require(_0x30d6('0x9')),'smsQueueReport':require(_0x30d6('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x30d6('0xb'))};var RuleEngine=require(_0x30d6('0xc'));function getId(_0x2f7b40,_0x3516ba,_0x2e800e){return util[_0x30d6('0xd')](_0x30d6('0xe'),_0x2f7b40,_0x3516ba||0x0,_0x2e800e||0x0);}function getIntervals(_0x3bf560,_0x4959fd){var _0x1afb5e=[];if(!_[_0x30d6('0xf')](_0x4959fd[_0x30d6('0x10')])&&!_[_0x30d6('0xf')](_0x3bf560[_0x4959fd[_0x30d6('0x10')]])&&!_[_0x30d6('0xf')](_0x3bf560[_0x4959fd[_0x30d6('0x10')]]['Intervals'])){_0x1afb5e=_[_0x30d6('0x11')](_0x3bf560[_0x4959fd[_0x30d6('0x10')]]['Intervals'],_0x30d6('0x12'));}else if(!_[_0x30d6('0xf')](_0x4959fd[_0x30d6('0x12')])){_0x1afb5e=[_0x4959fd[_0x30d6('0x12')]];}return _0x1afb5e;}exports[_0x30d6('0x13')]=function(_0x394b91){_0x394b91['rules']={};return new BPromise(function(_0x28d8a7,_0x596ad8){var _0x5e6c38={'Start':function(_0x24f4f2){var _0x2340b1=this;return new Promise(function(_0x4d9e2a,_0x151afe){if(_0x24f4f2){try{var _0x236ed8=[];var _0x21b388=getId(_0x24f4f2[_0x30d6('0x14')],_0x24f4f2['message']?_0x24f4f2['message']['id']:0x0,_0x24f4f2[_0x30d6('0x15')]?_0x24f4f2[_0x30d6('0x15')]['id']:0x0);if(_0x24f4f2['applications']&&_[_0x30d6('0x16')](_0x24f4f2[_0x30d6('0x17')])&&_0x24f4f2[_0x30d6('0x17')][_0x30d6('0x18')]){for(var _0x4f1eeb=0x0;_0x4f1eeb<_0x24f4f2[_0x30d6('0x17')][_0x30d6('0x18')];_0x4f1eeb+=0x1){var _0xdcc95d=_0x24f4f2[_0x30d6('0x17')][_0x4f1eeb];if(fs['existsSync'](path[_0x30d6('0x19')](__dirname,_0x30d6('0x17'),_0xdcc95d[_0x30d6('0x1a')]+_0x30d6('0x1b')))){var _0x39c5be=[];switch(_0xdcc95d[_0x30d6('0x1a')][_0x30d6('0x1c')]()){case _0x30d6('0x1d'):var _0x363506=_0xdcc95d[_0x30d6('0x1e')][_0x30d6('0x1f')](',');if(_0x24f4f2[_0x30d6('0x14')]===_0x30d6('0x20')){_0x39c5be[_0x30d6('0x21')](_0x363506[0x0]);_0x39c5be[_0x30d6('0x21')](_0x363506[0x1]);_0x39c5be[_0x30d6('0x21')](_0x363506[_0x30d6('0x22')](0x2,_0x363506[_0x30d6('0x18')])[_0x30d6('0x19')](','));}else{_0x39c5be[_0x30d6('0x21')](_0x363506[0x0]);_0x39c5be['push'](_0x363506['slice'](0x1,_0x363506[_0x30d6('0x18')])[_0x30d6('0x19')](','));}break;case _0x30d6('0x23'):var _0x547092=_0xdcc95d[_0x30d6('0x1e')][_0x30d6('0x1f')](',');_0x39c5be['push'](_0x547092[0x0]);_0x39c5be['push'](_0x547092[0x1]);_0x39c5be[_0x30d6('0x21')](_0x547092['slice'](0x2,_0x547092[_0x30d6('0x18')])['join'](','));break;case _0x30d6('0x24'):var _0x1b6856=_0xdcc95d[_0x30d6('0x1e')][_0x30d6('0x1f')](',');_0x39c5be[_0x30d6('0x21')](_0x1b6856[0x0]);_0x39c5be['push'](_0x1b6856[0x1]);_0x39c5be[_0x30d6('0x21')](_0x1b6856[0x2]);_0x39c5be['push'](_0x1b6856[0x3]);_0x39c5be[_0x30d6('0x21')](_0x1b6856['slice'](0x4,_0x1b6856[_0x30d6('0x18')])['join'](','));break;case _0x30d6('0x25'):var _0x41cb60=_0xdcc95d[_0x30d6('0x1e')]['split'](',');_0x39c5be[_0x30d6('0x21')](_0x41cb60[0x0]);_0x39c5be['push'](_0x41cb60[0x1]);_0x39c5be[_0x30d6('0x21')](_0x41cb60[0x2]);_0x39c5be['push'](_0x41cb60[0x3]);_0x39c5be[_0x30d6('0x21')](_0x41cb60[_0x30d6('0x22')](0x4,_0x41cb60[_0x30d6('0x18')])[_0x30d6('0x19')](','));break;case _0x30d6('0x26'):_0x39c5be[_0x30d6('0x21')](_0xdcc95d[_0x30d6('0x1e')]);break;case _0x30d6('0x27'):_0x39c5be[_0x30d6('0x21')](_0xdcc95d[_0x30d6('0x28')]);_0x39c5be[_0x30d6('0x21')](_0xdcc95d[_0x30d6('0x1e')]);break;default:_0x39c5be=_[_0x30d6('0xf')](_0xdcc95d[_0x30d6('0x1e')])?[]:_0xdcc95d[_0x30d6('0x1e')][_0x30d6('0x1f')](',');}var _0x30d260={'id':util[_0x30d6('0xd')](_0x30d6('0x29'),_0x21b388,_0xdcc95d['id'],_0xdcc95d[_0x30d6('0x1a')]),'condition':require(_0x30d6('0x2a'))[_0x30d6('0x2b')](_0x21b388,getIntervals(_0x394b91[_0x30d6('0x2c')],_0xdcc95d),_0x394b91),'consequence':require(_0x30d6('0x2d')+_0xdcc95d[_0x30d6('0x1a')])['consequence'](_0x21b388,_0x39c5be,_0x394b91,_0x24f4f2),'p':_0xdcc95d[_0x30d6('0x2e')]||0x0};logger['info'](_0x30d6('0x2f'),_0x30d260['id'],_0x30d6('0x30'),getIntervals(_0x394b91[_0x30d6('0x2c')],_0xdcc95d)[_0x30d6('0x19')]('\x20|\x20'));_0x236ed8['push'](_0x30d260);}else{logger['error'](_0x30d6('0x31'),path[_0x30d6('0x19')](__dirname,'applications',_0xdcc95d['app']+_0x30d6('0x1b')));}}_0x394b91[_0x30d6('0x32')][_0x21b388]=new RuleEngine(_0x236ed8);_0x394b91[_0x30d6('0x32')][_0x21b388][_0x30d6('0x33')](_0x24f4f2,function(_0x1dc755){logger[_0x30d6('0x34')](_0x30d6('0x35'),JSON[_0x30d6('0x36')](_0x1dc755[_0x30d6('0x37')]));if(_0x394b91[_0x30d6('0x32')][_0x21b388]){_0x394b91[_0x30d6('0x32')][_0x21b388][_0x30d6('0x38')]('complete');}});return _0x4d9e2a({'code':0xc8,'message':_0x24f4f2});}else{logger[_0x30d6('0x34')](_0x30d6('0x39'));return _0x4d9e2a({'code':0xc8,'message':_0x24f4f2});}}catch(_0x32c1be){logger[_0x30d6('0x3a')](_0x32c1be[_0x30d6('0x3b')]);return _0x151afe(_0x2340b1[_0x30d6('0x3a')](0x1f4,_0x32c1be));}}return _0x151afe(_0x30d6('0x3c'));});},'AcceptMessage':function(_0x5b2063){var _0x5d021d=this;return new Promise(function(_0x2ebf45,_0x196fe5){if(_0x5b2063[_0x30d6('0x3d')]&&_0x5b2063[_0x30d6('0x3d')]['id']){if(_0x394b91['agents'][_0x5b2063[_0x30d6('0x3d')]['id']]){_0x394b91[_0x30d6('0x3e')][_0x5b2063[_0x30d6('0x3d')]['id']][_0x30d6('0x3f')]=![];_0x394b91['agents'][_0x5b2063['agent']['id']]['busyQueue']=undefined;}}if(_0x5b2063[_0x30d6('0x26')]&&_0x5b2063[_0x30d6('0x26')]['id']){try{var _0x36f322=getId(_0x5b2063[_0x30d6('0x14')],_0x5b2063[_0x30d6('0x26')]?_0x5b2063[_0x30d6('0x26')]['id']:0x0,_0x5b2063[_0x30d6('0x15')]?_0x5b2063[_0x30d6('0x15')]['id']:0x0);if(_0x394b91['rules'][_0x36f322]){_0x394b91['rules'][_0x36f322][_0x30d6('0x38')](_0x30d6('0x40'));if(rpc[_0x5b2063[_0x30d6('0x14')]+_0x30d6('0x41')]){rpc[_0x5b2063[_0x30d6('0x14')]+_0x30d6('0x41')][_0x30d6('0x42')](_0x36f322,{'UserId':_0x5b2063[_0x30d6('0x26')][_0x30d6('0x43')]})[_0x30d6('0x44')](function(_0x7798b3){logger[_0x30d6('0x3a')](_0x30d6('0x45'));});}}return _0x2ebf45({'code':0xc8,'message':_0x5b2063});}catch(_0x1238a6){logger['error'](_0x1238a6['stack']);return _0x196fe5(_0x5d021d[_0x30d6('0x3a')](0x1f4,_0x1238a6));}}logger[_0x30d6('0x3a')]('message\x20is\x20empty');return _0x196fe5(_0x5d021d['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x14a63f){var _0x58f225=this;return new Promise(function(_0x30c39a,_0x587272){if(_0x14a63f[_0x30d6('0x3d')]&&_0x14a63f['agent']['id']){try{if(_0x394b91[_0x30d6('0x3e')][_0x14a63f[_0x30d6('0x3d')]['id']]){_0x394b91[_0x30d6('0x3e')][_0x14a63f[_0x30d6('0x3d')]['id']]['busy']=![];_0x394b91['agents'][_0x14a63f[_0x30d6('0x3d')]['id']][_0x30d6('0x46')]=undefined;}return _0x30c39a({'code':0xc8,'message':_0x14a63f});}catch(_0x14a0f4){logger[_0x30d6('0x3a')](_0x14a0f4[_0x30d6('0x3b')]);return _0x587272(_0x58f225[_0x30d6('0x3a')](0x1f4,_0x14a0f4));}}logger[_0x30d6('0x3a')]('message\x20is\x20empty');return _0x587272(_0x58f225['error'](0x1f4,_0x30d6('0x47')));});},'AbandonInteraction':function(_0x85a1a9){var _0x50d3d5=this;return new Promise(function(_0x5bf97b,_0x5588b7){if(_0x85a1a9[_0x30d6('0x14')]&&_0x85a1a9[_0x30d6('0x15')]&&_0x85a1a9['interaction']['id']){try{var _0x7da799=getId(_0x85a1a9['channel'],_0x85a1a9[_0x30d6('0x26')]?_0x85a1a9[_0x30d6('0x26')]['id']:0x0,_0x85a1a9[_0x30d6('0x15')]?_0x85a1a9[_0x30d6('0x15')]['id']:0x0);if(_0x394b91[_0x30d6('0x32')][_0x7da799]){_0x394b91[_0x30d6('0x32')][_0x7da799]['emit'](_0x30d6('0x40'));}return _0x5bf97b({'code':0xc8,'message':_0x85a1a9});}catch(_0x5b5393){logger[_0x30d6('0x3a')](_0x5b5393[_0x30d6('0x3b')]);return _0x5588b7(_0x50d3d5['error'](0x1f4,_0x5b5393));}}logger[_0x30d6('0x3a')]('message\x20is\x20empty');return _0x5588b7(_0x50d3d5['error'](0x1f4,_0x30d6('0x47')));});},'AgentCapacity':function(_0x1187ed){var _0x393de8=this;return new Promise(function(_0xb9bbde,_0x120df1){if(_0x394b91[_0x30d6('0x3e')]['hasOwnProperty'](_0x1187ed['id'])){for(var _0x1dd2c9 in _0x1187ed[_0x30d6('0x48')]){if(_0x1187ed[_0x30d6('0x48')][_0x30d6('0x49')](_0x1dd2c9)){if(_0x394b91[_0x30d6('0x3e')][_0x1187ed['id']][_0x30d6('0x49')](_0x1dd2c9+'CurrentCapacity')){_0x394b91[_0x30d6('0x3e')][_0x1187ed['id']][_0x1dd2c9+_0x30d6('0x4a')]=parseInt(_0x1187ed[_0x30d6('0x48')][_0x1dd2c9],0xa);}}}_0x394b91[_0x30d6('0x3e')][_0x1187ed['id']][_0x30d6('0x4b')]();return _0xb9bbde({'code':0xc8,'message':_0x394b91['agents'][_0x1187ed['id']]});}else{return _0x120df1(_0x393de8['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x562158){return new Promise(function(_0x319ce4,_0x9485dc){var _0x5164dd=_['values'](_0x394b91[_0x30d6('0x3e')]);_0x319ce4({'count':_0x5164dd['length'],'rows':_0x5164dd});});},'ChatQueues':function(_0x2f4f37){return new Promise(function(_0x295d9f,_0x4ab423){var _0x33db87=[];for(var _0x1677fa in _0x394b91[_0x30d6('0x4c')]){if(_0x394b91[_0x30d6('0x4c')][_0x30d6('0x49')](_0x1677fa)){var _0x31af5f=_0x394b91[_0x30d6('0x4c')][_0x1677fa];var _0x53392a={'id':_0x31af5f['id'],'available':_0x31af5f['available'],'loggedIn':_0x31af5f[_0x30d6('0x4d')],'name':_0x31af5f[_0x30d6('0x4e')],'paused':_0x31af5f[_0x30d6('0x4f')],'waiting':_0x31af5f[_0x30d6('0x50')]};_0x33db87[_0x30d6('0x21')](_0x53392a);}}_0x295d9f({'count':_0x33db87[_0x30d6('0x18')],'rows':_0x33db87});});},'MailQueues':function(_0x5807f7){return new Promise(function(_0xe84a6,_0x45ec44){var _0x329f92=[];for(var _0x443da4 in _0x394b91[_0x30d6('0x51')]){if(_0x394b91['mailQueues'][_0x30d6('0x49')](_0x443da4)){var _0x188871=_0x394b91[_0x30d6('0x51')][_0x443da4];var _0x458fba={'id':_0x188871['id'],'available':_0x188871[_0x30d6('0x52')],'loggedIn':_0x188871[_0x30d6('0x4d')],'name':_0x188871[_0x30d6('0x4e')],'paused':_0x188871[_0x30d6('0x4f')],'waiting':_0x188871[_0x30d6('0x50')]};_0x329f92[_0x30d6('0x21')](_0x458fba);}}_0xe84a6({'count':_0x329f92['length'],'rows':_0x329f92});});},'OpenchannelQueues':function(_0x2aec9c){return new Promise(function(_0x43906e,_0x25fc19){var _0x4d1a02=[];for(var _0x4f32e4 in _0x394b91[_0x30d6('0x53')]){if(_0x394b91[_0x30d6('0x53')][_0x30d6('0x49')](_0x4f32e4)){var _0x36df4b=_0x394b91[_0x30d6('0x53')][_0x4f32e4];var _0x3fb9e0={'id':_0x36df4b['id'],'available':_0x36df4b[_0x30d6('0x52')],'loggedIn':_0x36df4b[_0x30d6('0x4d')],'name':_0x36df4b[_0x30d6('0x4e')],'paused':_0x36df4b[_0x30d6('0x4f')],'waiting':_0x36df4b['waiting']};_0x4d1a02[_0x30d6('0x21')](_0x3fb9e0);}}_0x43906e({'count':_0x4d1a02[_0x30d6('0x18')],'rows':_0x4d1a02});});},'SmsQueues':function(_0x55815c){return new Promise(function(_0x2f9ccc,_0x44347a){var _0x5f8dc2=[];for(var _0xb3ad7c in _0x394b91[_0x30d6('0x54')]){if(_0x394b91['smsQueues']['hasOwnProperty'](_0xb3ad7c)){var _0x122ebd=_0x394b91[_0x30d6('0x54')][_0xb3ad7c];var _0x42aedf={'id':_0x122ebd['id'],'available':_0x122ebd[_0x30d6('0x52')],'loggedIn':_0x122ebd[_0x30d6('0x4d')],'name':_0x122ebd[_0x30d6('0x4e')],'paused':_0x122ebd[_0x30d6('0x4f')],'waiting':_0x122ebd[_0x30d6('0x50')]};_0x5f8dc2['push'](_0x42aedf);}}_0x2f9ccc({'count':_0x5f8dc2[_0x30d6('0x18')],'rows':_0x5f8dc2});});},'FaxQueues':function(_0x5b94a4){return new Promise(function(_0x2b3d96,_0x9de3a0){var _0x5341aa=[];for(var _0x4b5ff6 in _0x394b91['faxQueues']){if(_0x394b91[_0x30d6('0x55')]['hasOwnProperty'](_0x4b5ff6)){var _0xdeccae=_0x394b91[_0x30d6('0x55')][_0x4b5ff6];var _0x4987a8={'id':_0xdeccae['id'],'available':_0xdeccae['available'],'loggedIn':_0xdeccae['loggedIn'],'name':_0xdeccae[_0x30d6('0x4e')],'paused':_0xdeccae[_0x30d6('0x4f')],'waiting':_0xdeccae[_0x30d6('0x50')]};_0x5341aa[_0x30d6('0x21')](_0x4987a8);}}_0x2b3d96({'count':_0x5341aa[_0x30d6('0x18')],'rows':_0x5341aa});});},'WhatsappQueues':function(_0x45d6bc){return new Promise(function(_0x33a624,_0x1091b0){var _0x3bf26c=[];for(var _0x41fc9e in _0x394b91['whatsappQueues']){if(_0x394b91[_0x30d6('0x56')][_0x30d6('0x49')](_0x41fc9e)){var _0x235666=_0x394b91[_0x30d6('0x56')][_0x41fc9e];var _0x547eb1={'id':_0x235666['id'],'available':_0x235666[_0x30d6('0x52')],'loggedIn':_0x235666[_0x30d6('0x4d')],'name':_0x235666[_0x30d6('0x4e')],'paused':_0x235666['paused'],'waiting':_0x235666['waiting']};_0x3bf26c[_0x30d6('0x21')](_0x547eb1);}}_0x33a624({'count':_0x3bf26c[_0x30d6('0x18')],'rows':_0x3bf26c});});},'ChatQueuesWaitingInteractions':function(_0x1072d9){return new Promise(function(_0x4bbd73,_0x3b58dc){var _0x396126=_[_0x30d6('0x57')](_0x394b91[_0x30d6('0x58')]);_0x4bbd73({'count':_0x396126[_0x30d6('0x18')],'rows':_0x396126});});},'MailQueuesWaitingInteractions':function(_0x53c0a3){return new Promise(function(_0x4bf37e,_0x35dfc8){var _0x3e790c=_[_0x30d6('0x57')](_0x394b91[_0x30d6('0x59')]);_0x4bf37e({'count':_0x3e790c[_0x30d6('0x18')],'rows':_0x3e790c});});},'OpenchannelQueuesWaitingInteractions':function(_0xdd2296){return new Promise(function(_0x3b8752,_0x29aa2d){var _0x5d4cbc=_[_0x30d6('0x57')](_0x394b91[_0x30d6('0x5a')]);_0x3b8752({'count':_0x5d4cbc[_0x30d6('0x18')],'rows':_0x5d4cbc});});},'SmsQueuesWaitingInteractions':function(_0x3f73d2){return new Promise(function(_0x1ae7b6,_0x22a05b){var _0x4309be=_[_0x30d6('0x57')](_0x394b91[_0x30d6('0x5b')]);_0x1ae7b6({'count':_0x4309be[_0x30d6('0x18')],'rows':_0x4309be});});},'FaxQueuesWaitingInteractions':function(_0x332215){return new Promise(function(_0x174787,_0x495592){var _0x3f49e3=_[_0x30d6('0x57')](_0x394b91[_0x30d6('0x5c')]);_0x174787({'count':_0x3f49e3[_0x30d6('0x18')],'rows':_0x3f49e3});});},'WhatsappQueuesWaitingInteractions':function(_0x5b1a5d){return new Promise(function(_0x4d974c,_0x2eb91c){var _0x52a40a=_[_0x30d6('0x57')](_0x394b91['whatsappQueuesWaitingInteractions']);_0x4d974c({'count':_0x52a40a['length'],'rows':_0x52a40a});});}};var _0xb0e62c=jayson[_0x30d6('0x5d')](_0x5e6c38)[_0x30d6('0x5e')]();_0xb0e62c['on']('error',function(_0x41f051){logger['error'](JSON[_0x30d6('0x36')](_0x41f051));return _0x596ad8(_0x41f051);});_0xb0e62c[_0x30d6('0x13')](0x232c,_0x30d6('0x5f'),function(){console['log'](_0x30d6('0x60'),0x232c);return _0x28d8a7('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xc47a=['openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','channel','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','tag','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','name','waiting','mailQueues','loggedIn','paused'];(function(_0x2d523d,_0x51d83c){var _0x297942=function(_0x70b559){while(--_0x70b559){_0x2d523d['push'](_0x2d523d['shift']());}};_0x297942(++_0x51d83c);}(_0xc47a,0xcc));var _0xac47=function(_0x5d470c,_0x5719c0){_0x5d470c=_0x5d470c-0x0;var _0x101c2a=_0xc47a[_0x5d470c];return _0x101c2a;};'use strict';var _=require('lodash');var util=require(_0xac47('0x0'));var path=require(_0xac47('0x1'));var fs=require('fs');var jayson=require(_0xac47('0x2'));var BPromise=require(_0xac47('0x3'));var uuid=require(_0xac47('0x4'));var config=require('../../../config/environment');var logger=require(_0xac47('0x5'))(_0xac47('0x6'));var rpc={'openchannelQueueReport':require(_0xac47('0x7')),'mailQueueReport':require(_0xac47('0x8')),'chatQueueReport':require(_0xac47('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xac47('0xa')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x285299,_0x3ce92b,_0x5d7b85){return util[_0xac47('0xb')](_0xac47('0xc'),_0x285299,_0x3ce92b||0x0,_0x5d7b85||0x0);}function getIntervals(_0x39ad02,_0x178581){var _0x5f0984=[];if(!_['isNil'](_0x178581[_0xac47('0xd')])&&!_[_0xac47('0xe')](_0x39ad02[_0x178581[_0xac47('0xd')]])&&!_[_0xac47('0xe')](_0x39ad02[_0x178581[_0xac47('0xd')]]['Intervals'])){_0x5f0984=_['map'](_0x39ad02[_0x178581[_0xac47('0xd')]][_0xac47('0xf')],_0xac47('0x10'));}else if(!_[_0xac47('0xe')](_0x178581[_0xac47('0x10')])){_0x5f0984=[_0x178581['interval']];}return _0x5f0984;}exports['listen']=function(_0x467b41){_0x467b41['rules']={};return new BPromise(function(_0x143fe7,_0x4ee4ee){var _0x562ec0={'Start':function(_0x416a7a){var _0x1d0787=this;return new Promise(function(_0x2b466b,_0x283e96){if(_0x416a7a){try{var _0x3ccb10=[];var _0x35eafe=getId(_0x416a7a[_0xac47('0x11')],_0x416a7a['message']?_0x416a7a[_0xac47('0x12')]['id']:0x0,_0x416a7a['interaction']?_0x416a7a[_0xac47('0x13')]['id']:0x0);if(_0x416a7a[_0xac47('0x14')]&&_[_0xac47('0x15')](_0x416a7a[_0xac47('0x14')])&&_0x416a7a[_0xac47('0x14')]['length']){for(var _0x4c4882=0x0;_0x4c4882<_0x416a7a[_0xac47('0x14')][_0xac47('0x16')];_0x4c4882+=0x1){var _0x12cd66=_0x416a7a[_0xac47('0x14')][_0x4c4882];if(fs['existsSync'](path[_0xac47('0x17')](__dirname,'applications',_0x12cd66[_0xac47('0x18')]+_0xac47('0x19')))){var _0x2bc311=[];switch(_0x12cd66[_0xac47('0x18')][_0xac47('0x1a')]()){case _0xac47('0x1b'):var _0x2cb7cf=_0x12cd66[_0xac47('0x1c')][_0xac47('0x1d')](',');if(_0x416a7a[_0xac47('0x11')]===_0xac47('0x1e')){_0x2bc311[_0xac47('0x1f')](_0x2cb7cf[0x0]);_0x2bc311['push'](_0x2cb7cf[0x1]);_0x2bc311[_0xac47('0x1f')](_0x2cb7cf['slice'](0x2,_0x2cb7cf[_0xac47('0x16')])['join'](','));}else{_0x2bc311[_0xac47('0x1f')](_0x2cb7cf[0x0]);_0x2bc311['push'](_0x2cb7cf[_0xac47('0x20')](0x1,_0x2cb7cf[_0xac47('0x16')])[_0xac47('0x17')](','));}break;case _0xac47('0x21'):var _0xc02f51=_0x12cd66[_0xac47('0x1c')][_0xac47('0x1d')](',');_0x2bc311[_0xac47('0x1f')](_0xc02f51[0x0]);_0x2bc311[_0xac47('0x1f')](_0xc02f51[0x1]);_0x2bc311[_0xac47('0x1f')](_0xc02f51['slice'](0x2,_0xc02f51[_0xac47('0x16')])['join'](','));break;case _0xac47('0x22'):var _0x55b475=_0x12cd66[_0xac47('0x1c')]['split'](',');_0x2bc311[_0xac47('0x1f')](_0x55b475[0x0]);_0x2bc311[_0xac47('0x1f')](_0x55b475[0x1]);_0x2bc311[_0xac47('0x1f')](_0x55b475[0x2]);_0x2bc311[_0xac47('0x1f')](_0x55b475[0x3]);_0x2bc311['push'](_0x55b475['slice'](0x4,_0x55b475[_0xac47('0x16')])[_0xac47('0x17')](','));break;case'amazonlex':var _0x274d9e=_0x12cd66[_0xac47('0x1c')][_0xac47('0x1d')](',');_0x2bc311[_0xac47('0x1f')](_0x274d9e[0x0]);_0x2bc311[_0xac47('0x1f')](_0x274d9e[0x1]);_0x2bc311[_0xac47('0x1f')](_0x274d9e[0x2]);_0x2bc311[_0xac47('0x1f')](_0x274d9e[0x3]);_0x2bc311[_0xac47('0x1f')](_0x274d9e[_0xac47('0x20')](0x4,_0x274d9e[_0xac47('0x16')])[_0xac47('0x17')](','));break;case _0xac47('0x12'):_0x2bc311[_0xac47('0x1f')](_0x12cd66['appdata']);break;case _0xac47('0x23'):_0x2bc311[_0xac47('0x1f')](_0x12cd66['TagId']);_0x2bc311[_0xac47('0x1f')](_0x12cd66[_0xac47('0x1c')]);break;default:_0x2bc311=_[_0xac47('0xe')](_0x12cd66[_0xac47('0x1c')])?[]:_0x12cd66[_0xac47('0x1c')][_0xac47('0x1d')](',');}var _0x3b2177={'id':util[_0xac47('0xb')](_0xac47('0x24'),_0x35eafe,_0x12cd66['id'],_0x12cd66[_0xac47('0x18')]),'condition':require(_0xac47('0x25'))[_0xac47('0x26')](_0x35eafe,getIntervals(_0x467b41[_0xac47('0x27')],_0x12cd66),_0x467b41),'consequence':require(_0xac47('0x28')+_0x12cd66[_0xac47('0x18')])[_0xac47('0x29')](_0x35eafe,_0x2bc311,_0x467b41,_0x416a7a),'p':_0x12cd66[_0xac47('0x2a')]||0x0};logger['info']('Push\x20new\x20rule',_0x3b2177['id'],_0xac47('0x2b'),getIntervals(_0x467b41[_0xac47('0x27')],_0x12cd66)[_0xac47('0x17')]('\x20|\x20'));_0x3ccb10[_0xac47('0x1f')](_0x3b2177);}else{logger[_0xac47('0x2c')](_0xac47('0x2d'),path[_0xac47('0x17')](__dirname,_0xac47('0x14'),_0x12cd66[_0xac47('0x18')]+'.js'));}}_0x467b41['rules'][_0x35eafe]=new RuleEngine(_0x3ccb10);_0x467b41[_0xac47('0x2e')][_0x35eafe][_0xac47('0x2f')](_0x416a7a,function(_0x3d7e6a){logger[_0xac47('0x30')](_0xac47('0x31'),JSON[_0xac47('0x32')](_0x3d7e6a[_0xac47('0x33')]));if(_0x467b41[_0xac47('0x2e')][_0x35eafe]){_0x467b41['rules'][_0x35eafe]['emit'](_0xac47('0x34'));}});return _0x2b466b({'code':0xc8,'message':_0x416a7a});}else{logger[_0xac47('0x30')](_0xac47('0x35'));return _0x2b466b({'code':0xc8,'message':_0x416a7a});}}catch(_0x3db5e9){logger['error'](_0x3db5e9['stack']);return _0x283e96(_0x1d0787[_0xac47('0x2c')](0x1f4,_0x3db5e9));}}return _0x283e96(_0xac47('0x36'));});},'AcceptMessage':function(_0x20cf9b){var _0x55e7d6=this;return new Promise(function(_0x2e8332,_0x147a2d){if(_0x20cf9b['agent']&&_0x20cf9b[_0xac47('0x37')]['id']){if(_0x467b41[_0xac47('0x38')][_0x20cf9b[_0xac47('0x37')]['id']]){_0x467b41[_0xac47('0x38')][_0x20cf9b[_0xac47('0x37')]['id']]['busy']=![];_0x467b41[_0xac47('0x38')][_0x20cf9b[_0xac47('0x37')]['id']][_0xac47('0x39')]=undefined;}}if(_0x20cf9b[_0xac47('0x12')]&&_0x20cf9b[_0xac47('0x12')]['id']){try{var _0x3857f2=getId(_0x20cf9b[_0xac47('0x11')],_0x20cf9b['message']?_0x20cf9b[_0xac47('0x12')]['id']:0x0,_0x20cf9b[_0xac47('0x13')]?_0x20cf9b[_0xac47('0x13')]['id']:0x0);if(_0x467b41['rules'][_0x3857f2]){_0x467b41[_0xac47('0x2e')][_0x3857f2][_0xac47('0x3a')](_0xac47('0x3b'));if(rpc[_0x20cf9b[_0xac47('0x11')]+'QueueReport']){rpc[_0x20cf9b[_0xac47('0x11')]+_0xac47('0x3c')]['update'](_0x3857f2,{'UserId':_0x20cf9b[_0xac47('0x12')][_0xac47('0x3d')]})[_0xac47('0x3e')](function(_0x3c6e2d){logger[_0xac47('0x2c')](_0xac47('0x3f'));});}}return _0x2e8332({'code':0xc8,'message':_0x20cf9b});}catch(_0x5d90f1){logger['error'](_0x5d90f1[_0xac47('0x40')]);return _0x147a2d(_0x55e7d6[_0xac47('0x2c')](0x1f4,_0x5d90f1));}}logger[_0xac47('0x2c')](_0xac47('0x41'));return _0x147a2d(_0x55e7d6[_0xac47('0x2c')](0x1f4,_0xac47('0x41')));});},'RejectMessage':function(_0xd796c){var _0x34c6b2=this;return new Promise(function(_0x7eadc1,_0x15babd){if(_0xd796c[_0xac47('0x37')]&&_0xd796c[_0xac47('0x37')]['id']){try{if(_0x467b41['agents'][_0xd796c[_0xac47('0x37')]['id']]){_0x467b41['agents'][_0xd796c['agent']['id']][_0xac47('0x42')]=![];_0x467b41[_0xac47('0x38')][_0xd796c['agent']['id']][_0xac47('0x39')]=undefined;}return _0x7eadc1({'code':0xc8,'message':_0xd796c});}catch(_0x35bf3c){logger[_0xac47('0x2c')](_0x35bf3c[_0xac47('0x40')]);return _0x15babd(_0x34c6b2[_0xac47('0x2c')](0x1f4,_0x35bf3c));}}logger['error'](_0xac47('0x41'));return _0x15babd(_0x34c6b2[_0xac47('0x2c')](0x1f4,_0xac47('0x41')));});},'AbandonInteraction':function(_0x2b49c3){var _0x29768a=this;return new Promise(function(_0x17d93a,_0x2ca008){if(_0x2b49c3[_0xac47('0x11')]&&_0x2b49c3[_0xac47('0x13')]&&_0x2b49c3[_0xac47('0x13')]['id']){try{var _0xb5ce4=getId(_0x2b49c3[_0xac47('0x11')],_0x2b49c3[_0xac47('0x12')]?_0x2b49c3[_0xac47('0x12')]['id']:0x0,_0x2b49c3[_0xac47('0x13')]?_0x2b49c3[_0xac47('0x13')]['id']:0x0);if(_0x467b41[_0xac47('0x2e')][_0xb5ce4]){_0x467b41[_0xac47('0x2e')][_0xb5ce4][_0xac47('0x3a')](_0xac47('0x3b'));}return _0x17d93a({'code':0xc8,'message':_0x2b49c3});}catch(_0x3617a7){logger[_0xac47('0x2c')](_0x3617a7[_0xac47('0x40')]);return _0x2ca008(_0x29768a[_0xac47('0x2c')](0x1f4,_0x3617a7));}}logger[_0xac47('0x2c')](_0xac47('0x41'));return _0x2ca008(_0x29768a[_0xac47('0x2c')](0x1f4,_0xac47('0x41')));});},'AgentCapacity':function(_0x4fcdec){var _0x1d9018=this;return new Promise(function(_0x40be65,_0x4cca93){if(_0x467b41['agents'][_0xac47('0x43')](_0x4fcdec['id'])){for(var _0x15118b in _0x4fcdec['capacity']){if(_0x4fcdec[_0xac47('0x44')]['hasOwnProperty'](_0x15118b)){if(_0x467b41['agents'][_0x4fcdec['id']][_0xac47('0x43')](_0x15118b+_0xac47('0x45'))){_0x467b41['agents'][_0x4fcdec['id']][_0x15118b+_0xac47('0x45')]=parseInt(_0x4fcdec[_0xac47('0x44')][_0x15118b],0xa);}}}_0x467b41[_0xac47('0x38')][_0x4fcdec['id']]['updateRealtime']();return _0x40be65({'code':0xc8,'message':_0x467b41[_0xac47('0x38')][_0x4fcdec['id']]});}else{return _0x4cca93(_0x1d9018[_0xac47('0x2c')](0x1f4,_0xac47('0x46')));}});},'Agents':function(_0x4ba0c2){return new Promise(function(_0x2e8cf2,_0xe312da){var _0x212c04=_['values'](_0x467b41['agents']);_0x2e8cf2({'count':_0x212c04[_0xac47('0x16')],'rows':_0x212c04});});},'ChatQueues':function(_0x1be985){return new Promise(function(_0x50a5b2,_0x3cdd3a){var _0x152b3f=[];for(var _0x57469d in _0x467b41[_0xac47('0x47')]){if(_0x467b41[_0xac47('0x47')][_0xac47('0x43')](_0x57469d)){var _0x5794ee=_0x467b41[_0xac47('0x47')][_0x57469d];var _0x31651b={'id':_0x5794ee['id'],'available':_0x5794ee[_0xac47('0x48')],'loggedIn':_0x5794ee['loggedIn'],'name':_0x5794ee[_0xac47('0x49')],'paused':_0x5794ee['paused'],'waiting':_0x5794ee[_0xac47('0x4a')]};_0x152b3f[_0xac47('0x1f')](_0x31651b);}}_0x50a5b2({'count':_0x152b3f[_0xac47('0x16')],'rows':_0x152b3f});});},'MailQueues':function(_0x44a2d0){return new Promise(function(_0x498e90,_0x5974d3){var _0x3ba799=[];for(var _0x45a657 in _0x467b41[_0xac47('0x4b')]){if(_0x467b41['mailQueues']['hasOwnProperty'](_0x45a657)){var _0xcf71b1=_0x467b41[_0xac47('0x4b')][_0x45a657];var _0x110dbe={'id':_0xcf71b1['id'],'available':_0xcf71b1['available'],'loggedIn':_0xcf71b1[_0xac47('0x4c')],'name':_0xcf71b1[_0xac47('0x49')],'paused':_0xcf71b1[_0xac47('0x4d')],'waiting':_0xcf71b1['waiting']};_0x3ba799[_0xac47('0x1f')](_0x110dbe);}}_0x498e90({'count':_0x3ba799[_0xac47('0x16')],'rows':_0x3ba799});});},'OpenchannelQueues':function(_0x22ae10){return new Promise(function(_0x3fee71,_0x1fb2a4){var _0x34911c=[];for(var _0x22c345 in _0x467b41[_0xac47('0x4e')]){if(_0x467b41['openchannelQueues']['hasOwnProperty'](_0x22c345)){var _0x3aa504=_0x467b41[_0xac47('0x4e')][_0x22c345];var _0x3fcf1a={'id':_0x3aa504['id'],'available':_0x3aa504['available'],'loggedIn':_0x3aa504[_0xac47('0x4c')],'name':_0x3aa504['name'],'paused':_0x3aa504[_0xac47('0x4d')],'waiting':_0x3aa504['waiting']};_0x34911c['push'](_0x3fcf1a);}}_0x3fee71({'count':_0x34911c[_0xac47('0x16')],'rows':_0x34911c});});},'SmsQueues':function(_0x424cf6){return new Promise(function(_0x5f4f56,_0x4d751e){var _0x28165a=[];for(var _0x202fdb in _0x467b41['smsQueues']){if(_0x467b41['smsQueues'][_0xac47('0x43')](_0x202fdb)){var _0x28abf5=_0x467b41[_0xac47('0x4f')][_0x202fdb];var _0x42bbca={'id':_0x28abf5['id'],'available':_0x28abf5[_0xac47('0x48')],'loggedIn':_0x28abf5['loggedIn'],'name':_0x28abf5[_0xac47('0x49')],'paused':_0x28abf5[_0xac47('0x4d')],'waiting':_0x28abf5[_0xac47('0x4a')]};_0x28165a[_0xac47('0x1f')](_0x42bbca);}}_0x5f4f56({'count':_0x28165a['length'],'rows':_0x28165a});});},'FaxQueues':function(_0x3cbe8c){return new Promise(function(_0x411182,_0x136694){var _0x343280=[];for(var _0x2dfaf2 in _0x467b41['faxQueues']){if(_0x467b41[_0xac47('0x50')][_0xac47('0x43')](_0x2dfaf2)){var _0x32e44=_0x467b41['faxQueues'][_0x2dfaf2];var _0x3bef50={'id':_0x32e44['id'],'available':_0x32e44[_0xac47('0x48')],'loggedIn':_0x32e44[_0xac47('0x4c')],'name':_0x32e44[_0xac47('0x49')],'paused':_0x32e44['paused'],'waiting':_0x32e44[_0xac47('0x4a')]};_0x343280[_0xac47('0x1f')](_0x3bef50);}}_0x411182({'count':_0x343280[_0xac47('0x16')],'rows':_0x343280});});},'WhatsappQueues':function(_0x2d52a0){return new Promise(function(_0x117f76,_0x37bb83){var _0x582bec=[];for(var _0x4c3ee3 in _0x467b41[_0xac47('0x51')]){if(_0x467b41[_0xac47('0x51')][_0xac47('0x43')](_0x4c3ee3)){var _0x1dd04c=_0x467b41['whatsappQueues'][_0x4c3ee3];var _0x4df9a4={'id':_0x1dd04c['id'],'available':_0x1dd04c[_0xac47('0x48')],'loggedIn':_0x1dd04c['loggedIn'],'name':_0x1dd04c[_0xac47('0x49')],'paused':_0x1dd04c[_0xac47('0x4d')],'waiting':_0x1dd04c['waiting']};_0x582bec['push'](_0x4df9a4);}}_0x117f76({'count':_0x582bec[_0xac47('0x16')],'rows':_0x582bec});});},'ChatQueuesWaitingInteractions':function(_0x4d5534){return new Promise(function(_0x14a156,_0x266170){var _0x1b8d97=_[_0xac47('0x52')](_0x467b41[_0xac47('0x53')]);_0x14a156({'count':_0x1b8d97[_0xac47('0x16')],'rows':_0x1b8d97});});},'MailQueuesWaitingInteractions':function(_0x5f55e0){return new Promise(function(_0x1770ee,_0x2817e6){var _0x322520=_[_0xac47('0x52')](_0x467b41[_0xac47('0x54')]);_0x1770ee({'count':_0x322520[_0xac47('0x16')],'rows':_0x322520});});},'OpenchannelQueuesWaitingInteractions':function(_0xf11e25){return new Promise(function(_0x115b55,_0x48e76d){var _0x2d1ff4=_[_0xac47('0x52')](_0x467b41[_0xac47('0x55')]);_0x115b55({'count':_0x2d1ff4[_0xac47('0x16')],'rows':_0x2d1ff4});});},'SmsQueuesWaitingInteractions':function(_0x5b03d9){return new Promise(function(_0x267b32,_0x32692c){var _0x2039b4=_[_0xac47('0x52')](_0x467b41[_0xac47('0x56')]);_0x267b32({'count':_0x2039b4[_0xac47('0x16')],'rows':_0x2039b4});});},'FaxQueuesWaitingInteractions':function(_0x547dd7){return new Promise(function(_0x42576a,_0x1a47aa){var _0x39c109=_[_0xac47('0x52')](_0x467b41[_0xac47('0x57')]);_0x42576a({'count':_0x39c109[_0xac47('0x16')],'rows':_0x39c109});});},'WhatsappQueuesWaitingInteractions':function(_0x50934f){return new Promise(function(_0x20b404,_0x45e89e){var _0x46b97e=_[_0xac47('0x52')](_0x467b41['whatsappQueuesWaitingInteractions']);_0x20b404({'count':_0x46b97e[_0xac47('0x16')],'rows':_0x46b97e});});}};var _0x4a6242=jayson[_0xac47('0x58')](_0x562ec0)['http']();_0x4a6242['on'](_0xac47('0x2c'),function(_0x4bf832){logger[_0xac47('0x2c')](JSON[_0xac47('0x32')](_0x4bf832));return _0x4ee4ee(_0x4bf832);});_0x4a6242[_0xac47('0x59')](0x232c,_0xac47('0x5a'),function(){console[_0xac47('0x5b')](_0xac47('0x5c'),0x232c);return _0x143fe7(_0xac47('0x5d')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c619d79..f6f365f 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 _0xeb21=['message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error'];(function(_0x310a8a,_0xdb37c7){var _0x2f44ff=function(_0x24f43d){while(--_0x24f43d){_0x310a8a['push'](_0x310a8a['shift']());}};_0x2f44ff(++_0xdb37c7);}(_0xeb21,0x147));var _0x1eb2=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xeb21[_0x38a7ac];return _0x53061a;};'use strict';var util=require(_0x1eb2('0x0'));var BPromise=require('bluebird');var jayson=require(_0x1eb2('0x1'));var _=require(_0x1eb2('0x2'));var logger=require(_0x1eb2('0x3'))(_0x1eb2('0x4'));var client=jayson[_0x1eb2('0x5')][_0x1eb2('0x6')]({'port':0x232a});function request(_0x3b3d68,_0x4aae3b){return new BPromise(function(_0xee0e22,_0x162306){return client[_0x1eb2('0x7')](_0x3b3d68,_0x4aae3b)['then'](function(_0x3283eb){if(_0x3283eb[_0x1eb2('0x8')]){return _0x162306(_0x3283eb[_0x1eb2('0x8')][_0x1eb2('0x9')]);}else{return _0xee0e22(_0x3283eb[_0x1eb2('0xa')]);}})[_0x1eb2('0xb')](function(_0x117974){return _0x162306(_0x117974);});});}exports[_0x1eb2('0xc')]=function(_0x402f4e,_0x440db1,_0x520163){return function(_0x3a3bc7){if(_0x520163[_0x1eb2('0xd')]&&!_0x520163[_0x1eb2('0xd')][_0x402f4e]){logger[_0x1eb2('0xe')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x402f4e);return _0x3a3bc7[_0x1eb2('0xf')]();}var _0x4f6ca8=[];for(var _0x4192ee=0x0;_0x4192ee<_0x440db1[_0x1eb2('0x10')];_0x4192ee+=0x1){_0x4f6ca8[_0x1eb2('0x11')](request(_0x1eb2('0x12'),{'command':util['format'](_0x1eb2('0x13'),_0x440db1[_0x4192ee])})['then'](function(_0x58c4af){return _0x58c4af&&_0x58c4af[_0x1eb2('0x9')]&&_0x58c4af[_0x1eb2('0x9')]['indexOf'](_0x1eb2('0x14'))>=0x0?!![]:![];})[_0x1eb2('0xb')](function(_0x3d2943){logger[_0x1eb2('0x8')](_0x1eb2('0x15'),_0x402f4e,_0x440db1[_0x4192ee]);}));}BPromise[_0x1eb2('0x16')](_0x4f6ca8)['then'](function(_0x544d6f){var _0x180bf1=_[_0x1eb2('0x17')](_0x544d6f);logger[_0x1eb2('0xe')](_0x1eb2('0x18'),_0x402f4e,_0x440db1[_0x1eb2('0x19')](_0x1eb2('0x1a')),_0x180bf1);_0x3a3bc7['when'](_0x180bf1);})[_0x1eb2('0xb')](function(_0x2d151c){console['log'](_0x2d151c);logger[_0x1eb2('0x8')](_0x1eb2('0x18'),_0x402f4e,_0x440db1[_0x1eb2('0x19')](_0x1eb2('0x1a')),_0x2d151c[_0x1eb2('0x1b')]);_0x3a3bc7['stop']();});};}; \ No newline at end of file +var _0x1f02=['format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','when','catch','log','\x20|\x20','stack','util','../../../config/logger','routing','client','request','error','message','result','condition','rules','info','stop','push'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1f02,0xd3));var _0x21f0=function(_0x453002,_0x3ea25a){_0x453002=_0x453002-0x0;var _0x31480f=_0x1f02[_0x453002];return _0x31480f;};'use strict';var util=require(_0x21f0('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x21f0('0x1'))(_0x21f0('0x2'));var client=jayson[_0x21f0('0x3')]['http']({'port':0x232a});function request(_0x476136,_0x2a3c26){return new BPromise(function(_0x4a4c10,_0x27f09b){return client[_0x21f0('0x4')](_0x476136,_0x2a3c26)['then'](function(_0xaebf47){if(_0xaebf47[_0x21f0('0x5')]){return _0x27f09b(_0xaebf47[_0x21f0('0x5')][_0x21f0('0x6')]);}else{return _0x4a4c10(_0xaebf47[_0x21f0('0x7')]);}})['catch'](function(_0x1b8bd6){return _0x27f09b(_0x1b8bd6);});});}exports[_0x21f0('0x8')]=function(_0x806fea,_0x40cb88,_0xcab052){return function(_0x311458){if(_0xcab052[_0x21f0('0x9')]&&!_0xcab052['rules'][_0x806fea]){logger[_0x21f0('0xa')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x806fea);return _0x311458[_0x21f0('0xb')]();}var _0x1fd17f=[];for(var _0x5cd2b8=0x0;_0x5cd2b8<_0x40cb88['length'];_0x5cd2b8+=0x1){_0x1fd17f[_0x21f0('0xc')](request('Command',{'command':util[_0x21f0('0xd')](_0x21f0('0xe'),_0x40cb88[_0x5cd2b8])})['then'](function(_0x5be7a1){return _0x5be7a1&&_0x5be7a1[_0x21f0('0x6')]&&_0x5be7a1[_0x21f0('0x6')][_0x21f0('0xf')](_0x21f0('0x10'))>=0x0?!![]:![];})['catch'](function(_0x4f4210){logger[_0x21f0('0x5')](_0x21f0('0x11'),_0x806fea,_0x40cb88[_0x5cd2b8]);}));}BPromise[_0x21f0('0x12')](_0x1fd17f)[_0x21f0('0x13')](function(_0x10bc34){var _0x4ce8ac=_[_0x21f0('0x14')](_0x10bc34);logger['info'](_0x21f0('0x15'),_0x806fea,_0x40cb88[_0x21f0('0x16')]('\x20|\x20'),_0x4ce8ac);_0x311458[_0x21f0('0x17')](_0x4ce8ac);})[_0x21f0('0x18')](function(_0x474b2a){console[_0x21f0('0x19')](_0x474b2a);logger[_0x21f0('0x5')](_0x21f0('0x15'),_0x806fea,_0x40cb88['join'](_0x21f0('0x1a')),_0x474b2a[_0x21f0('0x1b')]);_0x311458[_0x21f0('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 19c6205..ae82b2e 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 _0x96cc=['rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause'];(function(_0x204c0f,_0xa616ed){var _0x1b0403=function(_0x1861d0){while(--_0x1861d0){_0x204c0f['push'](_0x204c0f['shift']());}};_0x1b0403(++_0xa616ed);}(_0x96cc,0x16c));var _0xc96c=function(_0x169efd,_0x1d3c20){_0x169efd=_0x169efd-0x0;var _0x52d4d4=_0x96cc[_0x169efd];return _0x52d4d4;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var utils=require(_0xc96c('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f11f2,_0x30bf8a){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x4'),_0x5f11f2[_0xc96c('0x5')],_0x5f11f2[_0xc96c('0x6')],_0x5f11f2[_0xc96c('0x7')],_0x5f11f2[_0xc96c('0x8')],_0x5f11f2[_0xc96c('0x9')],_0x5f11f2['calleridnum'],_0x5f11f2[_0xc96c('0xa')],_0x5f11f2[_0xc96c('0xb')]));if(_0x5f11f2[_0xc96c('0x7')]){utils[_0xc96c('0xc')](_0x5f11f2[_0xc96c('0x7')])[_0xc96c('0xd')](function(_0x36b2b4){if(_0x36b2b4){_0x5f11f2['type']=_0x36b2b4[_0xc96c('0xe')];_0x5f11f2[_0xc96c('0xf')]=_0x5f11f2[_0xc96c('0x10')]?_0x36b2b4['acw']:![];_0x5f11f2[_0xc96c('0x11')]=_0x5f11f2['agentacw']?_0x36b2b4[_0xc96c('0x12')]:0x0;}utils['request'](_0xc96c('0x13'),_0x5f11f2);});}else{utils[_0xc96c('0x14')](_0xc96c('0x13'),_0x5f11f2);}if(_0x30bf8a){delete transfers[_0x5f11f2[_0xc96c('0x5')]];}else{delete agents[_0x5f11f2['destuniqueid']];}}exports[_0xc96c('0x15')]=function(_0x43fcaa){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')]('[%s][agents][agentcalled]',_0x43fcaa[_0xc96c('0x5')]),_0x43fcaa);agents[_0x43fcaa[_0xc96c('0x17')]]=_0x43fcaa;agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0x18')]=utils[_0xc96c('0x19')]();agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x1a');agents[_0x43fcaa[_0xc96c('0x17')]][_0xc96c('0xa')]=null;agents[_0x43fcaa[_0xc96c('0x17')]]['connectedlinename']=null;utils['info'](util[_0xc96c('0x3')](_0xc96c('0x1b'),_0x43fcaa[_0xc96c('0x5')],agents[_0x43fcaa[_0xc96c('0x17')]]['membername'],_0x43fcaa[_0xc96c('0x17')]));}catch(_0x100fdb){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x1d'),_0x43fcaa[_0xc96c('0x5')]),_0x100fdb);}};exports[_0xc96c('0x1e')]=function(_0x41daba){try{if(!_[_0xc96c('0x1f')](agents[_0x41daba[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x41daba);utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x21'),_0x41daba['uniqueid'],agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x8')],_0x41daba[_0xc96c('0x17')]));agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x1e')]=!![];agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x22')]=utils[_0xc96c('0x19')]();agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0xb')]='timeout';agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x23')]=_0xc96c('0x24');agents[_0x41daba[_0xc96c('0x17')]]['holdtime']=_0x41daba['ringtime']?parseInt(_0x41daba[_0xc96c('0x25')])/0x3e8:0x0;agents[_0x41daba[_0xc96c('0x17')]][_0xc96c('0x26')]=0x0;unanswered[_0xc96c('0x27')](_0x41daba[_0xc96c('0x17')]);}}catch(_0x5e1727){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x20'),_0x41daba[_0xc96c('0x5')]),_0x5e1727);}};exports[_0xc96c('0x28')]=function(_0x40c72b){try{_[_0xc96c('0x29')](agents,function(_0x328ee4,_0x556108){if(_0x328ee4[_0xc96c('0x5')]==_0x40c72b['uniqueid']&&!_[_0xc96c('0x2a')](unanswered,_0x328ee4[_0xc96c('0x17')])){utils[_0xc96c('0x16')](util['format'](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x40c72b);utils[_0xc96c('0x2')](util[_0xc96c('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x40c72b['uniqueid'],_0x328ee4[_0xc96c('0x8')],_0x328ee4[_0xc96c('0x17')]));_0x328ee4[_0xc96c('0x1e')]=!![];_0x328ee4['agentringnoanswerAt']=utils[_0xc96c('0x19')]();_0x328ee4[_0xc96c('0xb')]=_0xc96c('0x2c');_0x328ee4[_0xc96c('0x23')]='abandoned';_0x328ee4[_0xc96c('0x2d')]=_0x40c72b[_0xc96c('0x2d')];_0x328ee4['talktime']=0x0;writeDB(_0x328ee4);}});}catch(_0x2b1dec){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2b'),_0x40c72b[_0xc96c('0x5')]),_0x2b1dec);}};exports[_0xc96c('0x2e')]=function(_0x4e8241){try{if(agents[_0x4e8241[_0xc96c('0x17')]]){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4e8241);utils[_0xc96c('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4e8241[_0xc96c('0x5')],agents[_0x4e8241[_0xc96c('0x17')]]['membername'],_0x4e8241['destuniqueid']));agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xa')]=_0x4e8241[_0xc96c('0xa')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x31')]=_0x4e8241[_0xc96c('0x31')];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0x2d')]=_0x4e8241['ringtime'];agents[_0x4e8241[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x32');_[_0xc96c('0x29')](agents,function(_0x4eb180,_0x167671){if(_0x4eb180[_0xc96c('0x17')]!=_0x4e8241[_0xc96c('0x17')]&&_0x4eb180['uniqueid']==_0x4e8241['uniqueid']){_0x4eb180[_0xc96c('0x26')]=0x0;_0x4eb180[_0xc96c('0x2d')]=_0x4e8241[_0xc96c('0x25')];_0x4eb180['agentringnoanswer']=!![];_0x4eb180[_0xc96c('0x22')]=utils[_0xc96c('0x19')]();_0x4eb180[_0xc96c('0xb')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x23')]=_0xc96c('0x33');_0x4eb180[_0xc96c('0x34')]=_0x4e8241[_0xc96c('0x17')];_0x4eb180[_0xc96c('0x35')]=_0x4e8241['membername'];writeDB(_0x4eb180);}});}}catch(_0x4c3088){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')](_0xc96c('0x2f'),_0x4e8241[_0xc96c('0x5')]),_0x4c3088);}};exports['agentcomplete']=function(_0x5ee6ac){try{if(!_[_0xc96c('0x1f')](agents[_0x5ee6ac[_0xc96c('0x17')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x5ee6ac);utils[_0xc96c('0x2')](util['format'](_0xc96c('0x37'),_0x5ee6ac[_0xc96c('0x5')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x8')],_0x5ee6ac['destuniqueid']));agents[_0x5ee6ac['destuniqueid']][_0xc96c('0x10')]=!![];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x38')],agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x30')]);agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0x23')]=_0x5ee6ac['reason'];agents[_0x5ee6ac[_0xc96c('0x17')]][_0xc96c('0xb')]=_0xc96c('0x3a');writeDB(agents[_0x5ee6ac[_0xc96c('0x17')]]);}}catch(_0x56bce1){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x36'),_0x5ee6ac[_0xc96c('0x5')]),_0x56bce1);}};exports['blindtransfer']=function(_0x2581ae){try{if(!_[_0xc96c('0x1f')](agents[_0x2581ae[_0xc96c('0x3b')]])){utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x3c'),_0x2581ae['uniqueid']),_0x2581ae);utils['info'](util['format'](_0xc96c('0x3d'),_0x2581ae['uniqueid'],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x8')],agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')]));agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3e')]=!![];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x3f')]=_0xc96c('0x40');agents[_0x2581ae[_0xc96c('0x3b')]]['transferexten']=_0x2581ae[_0xc96c('0x41')];agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x42')]=agents[_0x2581ae[_0xc96c('0x3b')]][_0xc96c('0x5')];}}catch(_0xcde9){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][blindtransfer]',_0x2581ae['uniqueid']),_0xcde9);}};exports['attendedtransfer']=function(_0x5c3d95){try{utils[_0xc96c('0x16')](util[_0xc96c('0x3')](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0x5c3d95);if(_0x5c3d95[_0xc96c('0x44')]==_0x5c3d95[_0xc96c('0x45')]){if(!_[_0xc96c('0x1f')](agents[_0x5c3d95['secondtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x8')]));agents[_0x5c3d95[_0xc96c('0x47')]]['transfer']=!![];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x3f')]=_0xc96c('0x48');agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x4a')];agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x42')]=_0x5c3d95[_0xc96c('0x44')];}if(_0x5c3d95[_0xc96c('0x4b')]&&agents[_0x5c3d95[_0xc96c('0x4b')]]){agents[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x4b')]]=_['clone'](agents[_0x5c3d95[_0xc96c('0x4b')]]);transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4d')];transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x4e')]=agents[_0x5c3d95[_0xc96c('0x47')]][_0xc96c('0x4e')];transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentcalledAt']=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x4b')]]['agentconnectAt']=utils['now']();transfers[_0x5c3d95['transfereeuniqueid']][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x4b')]][_0xc96c('0x4c')]=0x2;}}else if(_0x5c3d95[_0xc96c('0x47')]==_0x5c3d95[_0xc96c('0x4f')]){if(!_['isNil'](agents[_0x5c3d95['origtransfereruniqueid']])){utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x46'),_0x5c3d95[_0xc96c('0x44')],agents[_0x5c3d95[_0xc96c('0x44')]]['membername']));agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3e')]=!![];agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x3f')]='ATTENDED';agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x49')]=_0x5c3d95[_0xc96c('0x50')];agents[_0x5c3d95['origtransfereruniqueid']][_0xc96c('0x42')]=_0x5c3d95['secondtransfereruniqueid'];}if(_0x5c3d95[_0xc96c('0x51')]&&agents[_0x5c3d95[_0xc96c('0x51')]]){agents[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x1;transfers[_0x5c3d95[_0xc96c('0x51')]]=_[_0xc96c('0x52')](agents[_0x5c3d95[_0xc96c('0x51')]]);transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4d')]=agents[_0x5c3d95[_0xc96c('0x44')]]['calleridnum'];transfers[_0x5c3d95[_0xc96c('0x51')]]['calleridname']=agents[_0x5c3d95[_0xc96c('0x44')]][_0xc96c('0x4e')];transfers[_0x5c3d95['transfertargetuniqueid']][_0xc96c('0x18')]=utils['now']();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x30')]=utils[_0xc96c('0x19')]();transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x2d')]=0x0;transfers[_0x5c3d95[_0xc96c('0x51')]][_0xc96c('0x4c')]=0x2;}}}catch(_0xbd6525){utils[_0xc96c('0x1c')](util['format'](_0xc96c('0x43'),_0x5c3d95[_0xc96c('0x44')]),_0xbd6525);}};exports[_0xc96c('0x53')]=function(_0x43f94e){try{utils['debug'](util[_0xc96c('0x3')](_0xc96c('0x54'),_0x43f94e['uniqueid']),_0x43f94e);if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]]['reason']===_0xc96c('0x24')){if(_0x43f94e[_0xc96c('0x55')]==='21'){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')]=_0xc96c('0x56');agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]=_0xc96c('0x56');}utils[_0xc96c('0x2')](util['format'](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e[_0xc96c('0x5')]]['membername'],agents[_0x43f94e['uniqueid']][_0xc96c('0x23')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);var _0x1efa88=unanswered[_0xc96c('0x58')](_0x43f94e[_0xc96c('0x5')]);if(_0x1efa88>-0x1){unanswered['splice'](_0x1efa88,0x1);}}if(transfers[_0x43f94e[_0xc96c('0x5')]]){transfers[_0x43f94e[_0xc96c('0x5')]]['agentcomplete']=!![];transfers[_0x43f94e[_0xc96c('0x5')]]['agentcompleteAt']=utils[_0xc96c('0x19')]();transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);transfers[_0x43f94e[_0xc96c('0x5')]]['reason']=_0xc96c('0x59');transfers[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils['info'](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],transfers[_0x43f94e['uniqueid']][_0xc96c('0x8')],transfers[_0x43f94e[_0xc96c('0x5')]]['reason'],transfers[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0xb')]));writeDB(transfers[_0x43f94e[_0xc96c('0x5')]],!![]);}if(agents[_0x43f94e['uniqueid']]&&agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]){agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x10')]=!![];agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')]=utils[_0xc96c('0x19')]();agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x26')]=utils[_0xc96c('0x39')](agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x38')],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x30')]);agents[_0x43f94e[_0xc96c('0x5')]]['reason']=agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x3e')]?_0xc96c('0x3e'):_0xc96c('0x59');agents[_0x43f94e[_0xc96c('0x5')]]['lastevent']=_0xc96c('0x3a');utils[_0xc96c('0x2')](util[_0xc96c('0x3')](_0xc96c('0x57'),_0x43f94e[_0xc96c('0x5')],agents[_0x43f94e['uniqueid']]['membername'],agents[_0x43f94e[_0xc96c('0x5')]][_0xc96c('0x23')],agents[_0x43f94e['uniqueid']][_0xc96c('0xb')]));writeDB(agents[_0x43f94e[_0xc96c('0x5')]]);}}catch(_0x563449){utils[_0xc96c('0x1c')](util[_0xc96c('0x3')]('[%s][agents][hangup]',_0x43f94e[_0xc96c('0x5')]),_0x563449);}}; \ No newline at end of file +var _0x2e54=['connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','error','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','lodash','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2e54,0x1dd));var _0x42e5=function(_0x2f78da,_0x44a2f9){_0x2f78da=_0x2f78da-0x0;var _0x41f414=_0x2e54[_0x2f78da];return _0x41f414;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x216de4,_0x23f008){utils[_0x42e5('0x1')](util[_0x42e5('0x2')](_0x42e5('0x3'),_0x216de4[_0x42e5('0x4')],_0x216de4[_0x42e5('0x5')],_0x216de4['queue'],_0x216de4[_0x42e5('0x6')],_0x216de4[_0x42e5('0x7')],_0x216de4[_0x42e5('0x8')],_0x216de4['connectedlinenum'],_0x216de4[_0x42e5('0x9')]));if(_0x216de4['queue']){utils[_0x42e5('0xa')](_0x216de4['queue'])[_0x42e5('0xb')](function(_0x224b11){if(_0x224b11){_0x216de4[_0x42e5('0xc')]=_0x224b11[_0x42e5('0xc')];_0x216de4[_0x42e5('0xd')]=_0x216de4[_0x42e5('0xe')]?_0x224b11[_0x42e5('0xf')]:![];_0x216de4[_0x42e5('0x10')]=_0x216de4[_0x42e5('0xd')]?_0x224b11['acwTimeout']:0x0;}utils[_0x42e5('0x11')](_0x42e5('0x12'),_0x216de4);});}else{utils['request'](_0x42e5('0x12'),_0x216de4);}if(_0x23f008){delete transfers[_0x216de4[_0x42e5('0x4')]];}else{delete agents[_0x216de4[_0x42e5('0x13')]];}}exports[_0x42e5('0x14')]=function(_0x144fb4){try{utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x16'),_0x144fb4[_0x42e5('0x4')]),_0x144fb4);agents[_0x144fb4[_0x42e5('0x13')]]=_0x144fb4;agents[_0x144fb4['destuniqueid']][_0x42e5('0x17')]=utils[_0x42e5('0x18')]();agents[_0x144fb4[_0x42e5('0x13')]][_0x42e5('0x9')]=_0x42e5('0x19');agents[_0x144fb4[_0x42e5('0x13')]][_0x42e5('0x1a')]=null;agents[_0x144fb4[_0x42e5('0x13')]][_0x42e5('0x1b')]=null;utils[_0x42e5('0x1')](util[_0x42e5('0x2')](_0x42e5('0x1c'),_0x144fb4[_0x42e5('0x4')],agents[_0x144fb4[_0x42e5('0x13')]]['membername'],_0x144fb4[_0x42e5('0x13')]));}catch(_0x4a129e){utils['error'](util[_0x42e5('0x2')](_0x42e5('0x16'),_0x144fb4['uniqueid']),_0x4a129e);}};exports[_0x42e5('0x1d')]=function(_0x39a3e2){try{if(!_[_0x42e5('0x1e')](agents[_0x39a3e2[_0x42e5('0x13')]])){utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x1f'),_0x39a3e2['uniqueid']),_0x39a3e2);utils['info'](util[_0x42e5('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39a3e2[_0x42e5('0x4')],agents[_0x39a3e2[_0x42e5('0x13')]][_0x42e5('0x6')],_0x39a3e2[_0x42e5('0x13')]));agents[_0x39a3e2[_0x42e5('0x13')]]['agentringnoanswer']=!![];agents[_0x39a3e2[_0x42e5('0x13')]][_0x42e5('0x20')]=utils[_0x42e5('0x18')]();agents[_0x39a3e2[_0x42e5('0x13')]][_0x42e5('0x9')]='timeout';agents[_0x39a3e2['destuniqueid']][_0x42e5('0x21')]='timeout';agents[_0x39a3e2['destuniqueid']][_0x42e5('0x22')]=_0x39a3e2['ringtime']?parseInt(_0x39a3e2[_0x42e5('0x23')])/0x3e8:0x0;agents[_0x39a3e2[_0x42e5('0x13')]][_0x42e5('0x24')]=0x0;unanswered[_0x42e5('0x25')](_0x39a3e2[_0x42e5('0x13')]);}}catch(_0x2f1edc){utils['error'](util[_0x42e5('0x2')](_0x42e5('0x1f'),_0x39a3e2[_0x42e5('0x4')]),_0x2f1edc);}};exports[_0x42e5('0x26')]=function(_0x1d22ba){try{_[_0x42e5('0x27')](agents,function(_0x383e97,_0x282cbf){if(_0x383e97[_0x42e5('0x4')]==_0x1d22ba[_0x42e5('0x4')]&&!_[_0x42e5('0x28')](unanswered,_0x383e97[_0x42e5('0x13')])){utils[_0x42e5('0x15')](util['format'](_0x42e5('0x29'),_0x1d22ba[_0x42e5('0x4')]),_0x1d22ba);utils[_0x42e5('0x1')](util[_0x42e5('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1d22ba['uniqueid'],_0x383e97[_0x42e5('0x6')],_0x383e97['destuniqueid']));_0x383e97[_0x42e5('0x1d')]=!![];_0x383e97['agentringnoanswerAt']=utils[_0x42e5('0x18')]();_0x383e97[_0x42e5('0x9')]=_0x42e5('0x2a');_0x383e97['reason']=_0x42e5('0x2a');_0x383e97[_0x42e5('0x22')]=_0x1d22ba['holdtime'];_0x383e97[_0x42e5('0x24')]=0x0;writeDB(_0x383e97);}});}catch(_0x57558d){utils[_0x42e5('0x2b')](util[_0x42e5('0x2')](_0x42e5('0x29'),_0x1d22ba[_0x42e5('0x4')]),_0x57558d);}};exports[_0x42e5('0x2c')]=function(_0x41f891){try{if(agents[_0x41f891[_0x42e5('0x13')]]){utils['debug'](util['format'](_0x42e5('0x2d'),_0x41f891[_0x42e5('0x4')]),_0x41f891);utils[_0x42e5('0x1')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x41f891['uniqueid'],agents[_0x41f891['destuniqueid']][_0x42e5('0x6')],_0x41f891[_0x42e5('0x13')]));agents[_0x41f891[_0x42e5('0x13')]][_0x42e5('0x2e')]=utils[_0x42e5('0x18')]();agents[_0x41f891[_0x42e5('0x13')]][_0x42e5('0x1a')]=_0x41f891[_0x42e5('0x1a')];agents[_0x41f891['destuniqueid']][_0x42e5('0x1b')]=_0x41f891['connectedlinename'];agents[_0x41f891[_0x42e5('0x13')]][_0x42e5('0x22')]=_0x41f891[_0x42e5('0x23')];agents[_0x41f891[_0x42e5('0x13')]][_0x42e5('0x9')]=_0x42e5('0x2f');_[_0x42e5('0x27')](agents,function(_0x5ab9b8,_0x20f372){if(_0x5ab9b8[_0x42e5('0x13')]!=_0x41f891['destuniqueid']&&_0x5ab9b8[_0x42e5('0x4')]==_0x41f891['uniqueid']){_0x5ab9b8['talktime']=0x0;_0x5ab9b8['holdtime']=_0x41f891[_0x42e5('0x23')];_0x5ab9b8[_0x42e5('0x1d')]=!![];_0x5ab9b8[_0x42e5('0x20')]=utils[_0x42e5('0x18')]();_0x5ab9b8[_0x42e5('0x9')]=_0x42e5('0x30');_0x5ab9b8[_0x42e5('0x21')]='answered_elsewhere';_0x5ab9b8[_0x42e5('0x31')]=_0x41f891[_0x42e5('0x13')];_0x5ab9b8['answeredelsewheremembername']=_0x41f891[_0x42e5('0x6')];writeDB(_0x5ab9b8);}});}}catch(_0x1c697a){utils['error'](util[_0x42e5('0x2')](_0x42e5('0x2d'),_0x41f891[_0x42e5('0x4')]),_0x1c697a);}};exports[_0x42e5('0xe')]=function(_0x424304){try{if(!_['isNil'](agents[_0x424304[_0x42e5('0x13')]])){utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x32'),_0x424304['uniqueid']),_0x424304);utils[_0x42e5('0x1')](util[_0x42e5('0x2')](_0x42e5('0x33'),_0x424304[_0x42e5('0x4')],agents[_0x424304[_0x42e5('0x13')]][_0x42e5('0x6')],_0x424304[_0x42e5('0x13')]));agents[_0x424304[_0x42e5('0x13')]]['agentcomplete']=!![];agents[_0x424304[_0x42e5('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x424304[_0x42e5('0x13')]][_0x42e5('0x24')]=utils[_0x42e5('0x34')](agents[_0x424304[_0x42e5('0x13')]][_0x42e5('0x35')],agents[_0x424304[_0x42e5('0x13')]][_0x42e5('0x2e')]);agents[_0x424304['destuniqueid']][_0x42e5('0x21')]=_0x424304[_0x42e5('0x21')];agents[_0x424304[_0x42e5('0x13')]][_0x42e5('0x9')]=_0x42e5('0x36');writeDB(agents[_0x424304[_0x42e5('0x13')]]);}}catch(_0x3d910a){utils[_0x42e5('0x2b')](util['format'](_0x42e5('0x32'),_0x424304[_0x42e5('0x4')]),_0x3d910a);}};exports[_0x42e5('0x37')]=function(_0x48757e){try{if(!_[_0x42e5('0x1e')](agents[_0x48757e[_0x42e5('0x38')]])){utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x39'),_0x48757e['uniqueid']),_0x48757e);utils[_0x42e5('0x1')](util['format'](_0x42e5('0x3a'),_0x48757e[_0x42e5('0x4')],agents[_0x48757e[_0x42e5('0x38')]]['membername'],agents[_0x48757e['transfereruniqueid']]['uniqueid']));agents[_0x48757e[_0x42e5('0x38')]][_0x42e5('0x3b')]=!![];agents[_0x48757e[_0x42e5('0x38')]][_0x42e5('0x3c')]='blind';agents[_0x48757e[_0x42e5('0x38')]][_0x42e5('0x3d')]=_0x48757e[_0x42e5('0x3e')];agents[_0x48757e['transfereruniqueid']][_0x42e5('0x3f')]=agents[_0x48757e['transfereruniqueid']][_0x42e5('0x4')];}}catch(_0x2583cd){utils['error'](util[_0x42e5('0x2')](_0x42e5('0x39'),_0x48757e[_0x42e5('0x4')]),_0x2583cd);}};exports[_0x42e5('0x40')]=function(_0x24682c){try{utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x41'),_0x24682c[_0x42e5('0x42')]),_0x24682c);if(_0x24682c[_0x42e5('0x42')]==_0x24682c['origtransfererlinkedid']){if(!_[_0x42e5('0x1e')](agents[_0x24682c[_0x42e5('0x43')]])){utils[_0x42e5('0x1')](util[_0x42e5('0x2')](_0x42e5('0x44'),_0x24682c['origtransfereruniqueid'],agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x6')]));agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x3b')]=!![];agents[_0x24682c['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x3d')]=_0x24682c['origtransfererexten'];agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x3f')]=_0x24682c[_0x42e5('0x42')];}if(_0x24682c[_0x42e5('0x45')]&&agents[_0x24682c[_0x42e5('0x45')]]){agents[_0x24682c[_0x42e5('0x45')]][_0x42e5('0x46')]=0x1;transfers[_0x24682c[_0x42e5('0x45')]]=_[_0x42e5('0x47')](agents[_0x24682c['transfereeuniqueid']]);transfers[_0x24682c[_0x42e5('0x45')]]['calleridnum']=agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x8')];transfers[_0x24682c[_0x42e5('0x45')]][_0x42e5('0x48')]=agents[_0x24682c[_0x42e5('0x43')]][_0x42e5('0x48')];transfers[_0x24682c[_0x42e5('0x45')]][_0x42e5('0x17')]=utils[_0x42e5('0x18')]();transfers[_0x24682c[_0x42e5('0x45')]][_0x42e5('0x2e')]=utils['now']();transfers[_0x24682c[_0x42e5('0x45')]]['holdtime']=0x0;transfers[_0x24682c[_0x42e5('0x45')]]['agententerreason']=0x2;}}else if(_0x24682c[_0x42e5('0x43')]==_0x24682c[_0x42e5('0x49')]){if(!_['isNil'](agents[_0x24682c[_0x42e5('0x42')]])){utils[_0x42e5('0x1')](util['format'](_0x42e5('0x44'),_0x24682c[_0x42e5('0x42')],agents[_0x24682c['origtransfereruniqueid']][_0x42e5('0x6')]));agents[_0x24682c[_0x42e5('0x42')]][_0x42e5('0x3b')]=!![];agents[_0x24682c['origtransfereruniqueid']][_0x42e5('0x3c')]=_0x42e5('0x4a');agents[_0x24682c[_0x42e5('0x42')]][_0x42e5('0x3d')]=_0x24682c['secondtransfererexten'];agents[_0x24682c[_0x42e5('0x42')]]['transferuniqueid']=_0x24682c[_0x42e5('0x43')];}if(_0x24682c[_0x42e5('0x4b')]&&agents[_0x24682c[_0x42e5('0x4b')]]){agents[_0x24682c[_0x42e5('0x4b')]][_0x42e5('0x46')]=0x1;transfers[_0x24682c[_0x42e5('0x4b')]]=_[_0x42e5('0x47')](agents[_0x24682c['transfertargetuniqueid']]);transfers[_0x24682c[_0x42e5('0x4b')]][_0x42e5('0x8')]=agents[_0x24682c[_0x42e5('0x42')]][_0x42e5('0x8')];transfers[_0x24682c[_0x42e5('0x4b')]][_0x42e5('0x48')]=agents[_0x24682c[_0x42e5('0x42')]][_0x42e5('0x48')];transfers[_0x24682c[_0x42e5('0x4b')]]['agentcalledAt']=utils[_0x42e5('0x18')]();transfers[_0x24682c[_0x42e5('0x4b')]][_0x42e5('0x2e')]=utils[_0x42e5('0x18')]();transfers[_0x24682c['transfertargetuniqueid']][_0x42e5('0x22')]=0x0;transfers[_0x24682c[_0x42e5('0x4b')]][_0x42e5('0x46')]=0x2;}}}catch(_0x3a0942){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x24682c[_0x42e5('0x42')]),_0x3a0942);}};exports[_0x42e5('0x4c')]=function(_0x8c7c57){try{utils[_0x42e5('0x15')](util[_0x42e5('0x2')](_0x42e5('0x4d'),_0x8c7c57[_0x42e5('0x4')]),_0x8c7c57);if(agents[_0x8c7c57[_0x42e5('0x4')]]&&agents[_0x8c7c57[_0x42e5('0x4')]]['reason']===_0x42e5('0x4e')){if(_0x8c7c57[_0x42e5('0x4f')]==='21'){agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x21')]=_0x42e5('0x50');agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x9')]=_0x42e5('0x50');}utils['info'](util['format'](_0x42e5('0x51'),_0x8c7c57[_0x42e5('0x4')],agents[_0x8c7c57['uniqueid']]['membername'],agents[_0x8c7c57['uniqueid']][_0x42e5('0x21')],agents[_0x8c7c57[_0x42e5('0x4')]]['lastevent']));writeDB(agents[_0x8c7c57[_0x42e5('0x4')]]);var _0x3603df=unanswered['indexOf'](_0x8c7c57[_0x42e5('0x4')]);if(_0x3603df>-0x1){unanswered[_0x42e5('0x52')](_0x3603df,0x1);}}if(transfers[_0x8c7c57['uniqueid']]){transfers[_0x8c7c57[_0x42e5('0x4')]]['agentcomplete']=!![];transfers[_0x8c7c57['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x24')]=utils['diffTime'](transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x35')],transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x2e')]);transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x21')]='agent';transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x9')]='complete';utils['info'](util[_0x42e5('0x2')](_0x42e5('0x51'),_0x8c7c57[_0x42e5('0x4')],transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x6')],transfers[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x21')],transfers[_0x8c7c57['uniqueid']]['lastevent']));writeDB(transfers[_0x8c7c57['uniqueid']],!![]);}if(agents[_0x8c7c57['uniqueid']]&&agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x2e')]){agents[_0x8c7c57['uniqueid']][_0x42e5('0xe')]=!![];agents[_0x8c7c57['uniqueid']][_0x42e5('0x35')]=utils[_0x42e5('0x18')]();agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x24')]=utils[_0x42e5('0x34')](agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x35')],agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x2e')]);agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x21')]=agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x3b')]?_0x42e5('0x3b'):_0x42e5('0x53');agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x9')]=_0x42e5('0x36');utils['info'](util[_0x42e5('0x2')](_0x42e5('0x51'),_0x8c7c57[_0x42e5('0x4')],agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x6')],agents[_0x8c7c57[_0x42e5('0x4')]][_0x42e5('0x21')],agents[_0x8c7c57[_0x42e5('0x4')]]['lastevent']));writeDB(agents[_0x8c7c57[_0x42e5('0x4')]]);}}catch(_0x5777c2){utils[_0x42e5('0x2b')](util[_0x42e5('0x2')](_0x42e5('0x4d'),_0x8c7c57['uniqueid']),_0x5777c2);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2e5b495..cfc435e 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 _0xc763=['lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','ANSWERED','BUSY','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','channelstate','context','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][newstate]','debug','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','Queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','split','substring','lastIndexOf','includes','hangup','noop','gotoif'];(function(_0x351bd8,_0x35d623){var _0x2db945=function(_0xa80c6e){while(--_0xa80c6e){_0x351bd8['push'](_0x351bd8['shift']());}};_0x2db945(++_0x35d623);}(_0xc763,0xd7));var _0x3c76=function(_0x2214bb,_0x532a2c){_0x2214bb=_0x2214bb-0x0;var _0x2dd1c4=_0xc763[_0x2214bb];return _0x2dd1c4;};'use strict';var _=require(_0x3c76('0x0'));var util=require(_0x3c76('0x1'));var utils=require(_0x3c76('0x2'));var transfers=require(_0x3c76('0x3'));var dispositions=[_0x3c76('0x4'),'FAILED','FAILED',_0x3c76('0x4'),_0x3c76('0x4'),_0x3c76('0x4'),_0x3c76('0x5'),_0x3c76('0x6'),_0x3c76('0x7'),_0x3c76('0x7'),'FAILED'];var channels={};function writeDB(_0x548bb1){var _0x2ac26b;if(transfers[_0x3c76('0x8')][_0x548bb1[_0x3c76('0x9')]]){_0x2ac26b=_0x548bb1['uniqueid'];_0x548bb1[_0x3c76('0x9')]=transfers[_0x3c76('0x8')][_0x548bb1[_0x3c76('0x9')]][_0x3c76('0xa')];}utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0xd'),_0x548bb1[_0x3c76('0x9')],_0x548bb1[_0x3c76('0xe')],_0x548bb1['queue'],_0x548bb1[_0x3c76('0xf')],_0x548bb1[_0x3c76('0x10')],_0x548bb1[_0x3c76('0x11')],_0x548bb1[_0x3c76('0x12')],_0x548bb1['lastevent']));if(_0x548bb1[_0x3c76('0x13')]){utils['getUserByInternal'](_0x548bb1[_0x3c76('0x13')])[_0x3c76('0x14')](function(_0x55f39d){if(_0x55f39d){_0x548bb1[_0x3c76('0x15')]=_0x55f39d['id'];}utils[_0x3c76('0x16')](_0x3c76('0x17'),_0x548bb1);});}else{utils[_0x3c76('0x16')](_0x3c76('0x17'),_0x548bb1);}if(channels[_0x548bb1[_0x3c76('0x9')]]){delete channels[_0x548bb1[_0x3c76('0x9')]];}else if(_0x2ac26b&&channels[_0x2ac26b]){delete transfers[_0x3c76('0x8')][_0x2ac26b];delete channels[_0x2ac26b];}}exports[_0x3c76('0x18')]=function(_0x31d51f){try{utils['debug'](util[_0x3c76('0xc')](_0x3c76('0x19'),_0x31d51f[_0x3c76('0x9')]),_0x31d51f);if(_0x31d51f[_0x3c76('0x9')]==_0x31d51f[_0x3c76('0x1a')]&&_0x31d51f[_0x3c76('0xe')]!=_0x3c76('0x1b')){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x1c'),_0x31d51f[_0x3c76('0x9')],_0x31d51f['context'],_0x31d51f[_0x3c76('0x1d')]));channels[_0x31d51f[_0x3c76('0x9')]]={'uniqueid':_0x31d51f[_0x3c76('0x9')],'accountcode':_0x31d51f[_0x3c76('0x13')],'source':_0x31d51f[_0x3c76('0x11')],'destination':_0x31d51f['exten'],'destinationcontext':_0x31d51f['context'],'channel':_0x31d51f[_0x3c76('0xe')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x4c3c8a){utils['error'](util[_0x3c76('0xc')](_0x3c76('0x19'),_0x31d51f[_0x3c76('0x9')]),_0x4c3c8a);}};exports['newstate']=function(_0x356bd4){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x356bd4[_0x3c76('0x9')]),_0x356bd4);if(!_['isNil'](channels[_0x356bd4['uniqueid']])&&_0x356bd4['channelstate']==0x6){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x1e'),_0x356bd4[_0x3c76('0x9')],_0x356bd4['context'],_0x356bd4[_0x3c76('0xe')]));if(_[_0x3c76('0x1f')](channels[_0x356bd4[_0x3c76('0x9')]][_0x3c76('0x20')])){channels[_0x356bd4['uniqueid']][_0x3c76('0x20')]=utils[_0x3c76('0x21')]();}}else if(!_[_0x3c76('0x1f')](channels[_0x356bd4[_0x3c76('0x1a')]])&&_0x356bd4[_0x3c76('0x22')]==0x6&&_0x356bd4[_0x3c76('0x23')]!='transfer'){utils['info'](util[_0x3c76('0xc')](_0x3c76('0x24'),_0x356bd4['uniqueid'],_0x356bd4[_0x3c76('0x1a')],_0x356bd4[_0x3c76('0x23')],_0x356bd4[_0x3c76('0xe')]));channels[_0x356bd4['linkedid']][_0x3c76('0x13')]=_0x356bd4[_0x3c76('0x13')];channels[_0x356bd4[_0x3c76('0x1a')]][_0x3c76('0x25')]=_0x356bd4[_0x3c76('0xe')];if(_[_0x3c76('0x1f')](channels[_0x356bd4[_0x3c76('0x1a')]][_0x3c76('0x26')])){channels[_0x356bd4[_0x3c76('0x1a')]][_0x3c76('0x26')]=utils['now']();}channels[_0x356bd4[_0x3c76('0x1a')]][_0x3c76('0x27')]=dispositions[_[_0x3c76('0x28')](_0x356bd4['channelstate'])]||_0x3c76('0x5');}}catch(_0x42e647){utils[_0x3c76('0x29')](util[_0x3c76('0xc')](_0x3c76('0x2a'),_0x356bd4[_0x3c76('0x9')]),_0x42e647);}};exports['hangup']=function(_0x368121){try{if(!_[_0x3c76('0x1f')](channels[_0x368121[_0x3c76('0x9')]])){utils[_0x3c76('0x2b')](util[_0x3c76('0xc')](_0x3c76('0x2c'),_0x368121[_0x3c76('0x9')]),_0x368121);if(_[_0x3c76('0x1f')](channels[_0x368121[_0x3c76('0x9')]]['callerid'])){channels[_0x368121['uniqueid']][_0x3c76('0x2d')]=_0x368121[_0x3c76('0x2e')]+'\x20<'+_0x368121[_0x3c76('0x11')]+'>';}utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x2f'),_0x368121['uniqueid'],channels[_0x368121['uniqueid']][_0x3c76('0x2d')],_0x368121[_0x3c76('0x30')]));channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x31')]=utils[_0x3c76('0x21')]();channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x32')]=utils[_0x3c76('0x33')](channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x31')],channels[_0x368121[_0x3c76('0x9')]]['starttime']);channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x34')]=channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x26')]?utils[_0x3c76('0x33')](channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x31')],channels[_0x368121[_0x3c76('0x9')]][_0x3c76('0x26')]):0x0;writeDB(channels[_0x368121[_0x3c76('0x9')]]);}}catch(_0x29e9ae){utils[_0x3c76('0x29')](util[_0x3c76('0xc')](_0x3c76('0x2c'),_0x368121['uniqueid']),_0x29e9ae);}};exports[_0x3c76('0x35')]=function(_0x57f5d8){try{if(!_['isNil'](channels[_0x57f5d8[_0x3c76('0x36')]])){utils[_0x3c76('0x2b')](util[_0x3c76('0xc')]('[%s][calls][attendedtransfer]',_0x57f5d8[_0x3c76('0x37')]),_0x57f5d8);if(channels[_0x57f5d8['localtwolinkedid']][_0x3c76('0xe')]==_0x57f5d8[_0x3c76('0x38')]){utils['info'](util[_0x3c76('0xc')](_0x3c76('0x39'),_0x57f5d8[_0x3c76('0x37')],_0x57f5d8[_0x3c76('0x36')],_0x57f5d8[_0x3c76('0x3a')]));channels[_0x57f5d8[_0x3c76('0x36')]]['destinationchannel']=_0x57f5d8[_0x3c76('0x3a')];channels[_0x57f5d8['localtwolinkedid']][_0x3c76('0x3b')]='_attended';}else if(channels[_0x57f5d8['localtwolinkedid']][_0x3c76('0xe')]=_0x57f5d8[_0x3c76('0x3c')]){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x39'),_0x57f5d8[_0x3c76('0x37')],_0x57f5d8['localtwolinkedid'],_0x57f5d8[_0x3c76('0x3d')]));channels[_0x57f5d8['localtwolinkedid']][_0x3c76('0x25')]=_0x57f5d8[_0x3c76('0x3d')];channels[_0x57f5d8[_0x3c76('0x36')]]['userfield']=_0x3c76('0x3e');}}}catch(_0x17bddc){utils['error'](util[_0x3c76('0xc')](_0x3c76('0x3f'),_0x57f5d8['origtransfereruniqueid']),_0x17bddc);}};exports[_0x3c76('0x40')]=function(_0x3c1ff7){try{if(!_[_0x3c76('0x1f')](channels[_0x3c1ff7[_0x3c76('0x9')]])){utils['debug'](util[_0x3c76('0xc')]('[%s][calls][musiconholdstart]',_0x3c1ff7[_0x3c76('0x9')]),_0x3c1ff7);channels[_0x3c1ff7[_0x3c76('0x9')]]['musiconholdstartAt']=utils[_0x3c76('0x21')]();utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x41'),_0x3c1ff7['uniqueid'],channels[_0x3c1ff7['uniqueid']][_0x3c76('0x42')]));}}catch(_0x9d48c){utils[_0x3c76('0x29')](util['format']('[%s][calls][musiconholdstart]',_0x3c1ff7[_0x3c76('0x9')]),_0x9d48c);}};exports['musiconholdstop']=function(_0x56210d){try{if(!_[_0x3c76('0x1f')](channels[_0x56210d[_0x3c76('0x9')]])){utils[_0x3c76('0x2b')](util[_0x3c76('0xc')](_0x3c76('0x43'),_0x56210d[_0x3c76('0x9')]),_0x56210d);if(!_[_0x3c76('0x1f')](channels[_0x56210d[_0x3c76('0x9')]]['musiconholdstartAt'])){channels[_0x56210d['uniqueid']]['mohtime']+=utils[_0x3c76('0x33')](utils[_0x3c76('0x21')](),channels[_0x56210d[_0x3c76('0x9')]][_0x3c76('0x42')]);utils['info'](util[_0x3c76('0xc')](_0x3c76('0x44'),_0x56210d[_0x3c76('0x9')],channels[_0x56210d['uniqueid']][_0x3c76('0x45')]));delete channels[_0x56210d[_0x3c76('0x9')]][_0x3c76('0x42')];}}}catch(_0x27a96b){utils[_0x3c76('0x29')](util[_0x3c76('0xc')](_0x3c76('0x43'),_0x56210d[_0x3c76('0x9')]),_0x27a96b);}};exports[_0x3c76('0x46')]=function(_0x121a79){try{if(!_[_0x3c76('0x1f')](channels[_0x121a79['uniqueid']])){utils[_0x3c76('0x2b')](util[_0x3c76('0xc')]('[%s][calls][varset]',_0x121a79['uniqueid']),_0x121a79);if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')][_0x3c76('0x48')])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x49'),_0x121a79[_0x3c76('0x9')],_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79['uniqueid']][_0x3c76('0x4b')]=_0x121a79['value'];}if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')][_0x3c76('0x4c')])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x4d'),_0x121a79[_0x3c76('0x9')],_0x121a79['value']));channels[_0x121a79[_0x3c76('0x9')]][_0x3c76('0x4e')]=_0x121a79[_0x3c76('0x4a')];channels[_0x121a79[_0x3c76('0x9')]]['callerid']='\x22'+_0x121a79[_0x3c76('0x4a')]+_0x3c76('0x4f')+_0x121a79['value']+'>';}if(!_[_0x3c76('0x1f')](_0x121a79['variable'][_0x3c76('0x50')])||!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')][_0x3c76('0x51')])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x121a79[_0x3c76('0x9')],!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')]['xmd-callerid-preview'])?_0x3c76('0x50'):_0x3c76('0x51'),_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79[_0x3c76('0x9')]]['callerid']=_0x121a79[_0x3c76('0x4a')];}if(!_[_0x3c76('0x1f')](_0x121a79['variable']['xmd-queue'])||!_[_0x3c76('0x1f')](_0x121a79['variable'][_0x3c76('0x52')])){utils['info'](util['format'](_0x3c76('0x53'),_0x121a79[_0x3c76('0x9')],!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')][_0x3c76('0x54')])?_0x3c76('0x54'):_0x3c76('0x52'),_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79[_0x3c76('0x9')]]['lastapplication']=_0x3c76('0x55');channels[_0x121a79[_0x3c76('0x9')]]['lastdata']=_0x121a79['value'];channels[_0x121a79[_0x3c76('0x9')]]['queue']=!![];}if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')]['xmd-contactid'])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x56'),_0x121a79[_0x3c76('0x9')],_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79[_0x3c76('0x9')]][_0x3c76('0x57')]=_0x121a79[_0x3c76('0x4a')];}if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')]['xmd-cdrtype'])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x121a79[_0x3c76('0x9')],_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79[_0x3c76('0x9')]][_0x3c76('0x58')]=_0x121a79[_0x3c76('0x4a')];}if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')]['outboundrouteid'])){utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x59'),_0x121a79[_0x3c76('0x9')],_0x121a79[_0x3c76('0x4a')]));channels[_0x121a79['uniqueid']]['routeid']=_0x121a79[_0x3c76('0x4a')];}if(!_[_0x3c76('0x1f')](_0x121a79[_0x3c76('0x47')][_0x3c76('0x5a')])){utils['info'](util[_0x3c76('0xc')](_0x3c76('0x5b'),_0x121a79['uniqueid'],_0x121a79['value']));channels[_0x121a79[_0x3c76('0x9')]]['sipcallid']=_0x121a79[_0x3c76('0x4a')];}}}catch(_0x1253e9){utils[_0x3c76('0x29')](util['format'](_0x3c76('0x5c'),_0x121a79[_0x3c76('0x9')]),_0x1253e9);}};exports['newexten']=function(_0x32abb2){try{if(!_[_0x3c76('0x1f')](channels[_0x32abb2['uniqueid']])){utils[_0x3c76('0x2b')](util[_0x3c76('0xc')](_0x3c76('0x5d'),_0x32abb2[_0x3c76('0x9')]),_0x32abb2);utils[_0x3c76('0xb')](util[_0x3c76('0xc')](_0x3c76('0x5e'),_0x32abb2[_0x3c76('0x9')],_0x32abb2[_0x3c76('0x5f')],_0x32abb2[_0x3c76('0x60')]));if(_0x32abb2[_0x3c76('0x5f')]['toLowerCase']()==_0x3c76('0x61')&&_['startsWith'](_0x32abb2[_0x3c76('0x60')][_0x3c76('0x62')](),'cdr')){var _0x6ae48b=_0x32abb2[_0x3c76('0x60')][_0x3c76('0x63')]('=');var _0x16d7a5=_0x6ae48b[0x0][_0x3c76('0x64')](_0x6ae48b[0x0]['lastIndexOf']('(')+0x1,_0x6ae48b[0x0][_0x3c76('0x65')](')'));var _0x390eb6=_0x6ae48b[0x1];channels[_0x32abb2[_0x3c76('0x9')]][_0x16d7a5]=_0x390eb6;}if(!_[_0x3c76('0x66')]([_0x3c76('0x67'),_0x3c76('0x68'),'execif',_0x3c76('0x61'),_0x3c76('0x69')],_0x32abb2[_0x3c76('0x5f')][_0x3c76('0x62')]())){channels[_0x32abb2[_0x3c76('0x9')]][_0x3c76('0x6a')]=_0x32abb2[_0x3c76('0x5f')];channels[_0x32abb2[_0x3c76('0x9')]]['lastdata']=_0x32abb2[_0x3c76('0x60')];}}}catch(_0x30c42b){utils[_0x3c76('0x29')](util[_0x3c76('0xc')](_0x3c76('0x5d'),_0x32abb2[_0x3c76('0x9')]),_0x30c42b);}}; \ No newline at end of file +var _0xd929=['context','exten','calleridnum','DOCUMENTATION','error','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','channelstate','answertime','disposition','toNumber','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','billableseconds','[%s][calls][hangup]','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','value','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]','[%s][calls][newexten]','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','lastdata','lodash','util','./transfers.controller','NO\x20ANSWER','ANSWERED','FAILED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','interface','connectedlinenum','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed'];(function(_0x55ae3f,_0x22d6c2){var _0x130e8d=function(_0x343294){while(--_0x343294){_0x55ae3f['push'](_0x55ae3f['shift']());}};_0x130e8d(++_0x22d6c2);}(_0xd929,0x183));var _0x9d92=function(_0xb1432f,_0x1583ea){_0xb1432f=_0xb1432f-0x0;var _0x45e84f=_0xd929[_0xb1432f];return _0x45e84f;};'use strict';var _=require(_0x9d92('0x0'));var util=require(_0x9d92('0x1'));var utils=require('./utils');var transfers=require(_0x9d92('0x2'));var dispositions=[_0x9d92('0x3'),'FAILED','FAILED',_0x9d92('0x3'),_0x9d92('0x3'),'NO\x20ANSWER',_0x9d92('0x4'),'BUSY','FAILED','FAILED',_0x9d92('0x5')];var channels={};function writeDB(_0x4e88d8){var _0x15f7c7;if(transfers[_0x9d92('0x6')][_0x4e88d8['uniqueid']]){_0x15f7c7=_0x4e88d8['uniqueid'];_0x4e88d8[_0x9d92('0x7')]=transfers['blinds'][_0x4e88d8[_0x9d92('0x7')]][_0x9d92('0x8')];}utils[_0x9d92('0x9')](util[_0x9d92('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4e88d8['uniqueid'],_0x4e88d8[_0x9d92('0xb')],_0x4e88d8[_0x9d92('0xc')],_0x4e88d8['membername'],_0x4e88d8[_0x9d92('0xd')],_0x4e88d8['calleridnum'],_0x4e88d8[_0x9d92('0xe')],_0x4e88d8['lastevent']));if(_0x4e88d8[_0x9d92('0xf')]){utils[_0x9d92('0x10')](_0x4e88d8[_0x9d92('0xf')])[_0x9d92('0x11')](function(_0x3d6de1){if(_0x3d6de1){_0x4e88d8['UserId']=_0x3d6de1['id'];}utils['request'](_0x9d92('0x12'),_0x4e88d8);});}else{utils[_0x9d92('0x13')](_0x9d92('0x12'),_0x4e88d8);}if(channels[_0x4e88d8[_0x9d92('0x7')]]){delete channels[_0x4e88d8[_0x9d92('0x7')]];}else if(_0x15f7c7&&channels[_0x15f7c7]){delete transfers['blinds'][_0x15f7c7];delete channels[_0x15f7c7];}}exports[_0x9d92('0x14')]=function(_0x2425ca){try{utils[_0x9d92('0x15')](util[_0x9d92('0xa')](_0x9d92('0x16'),_0x2425ca[_0x9d92('0x7')]),_0x2425ca);if(_0x2425ca[_0x9d92('0x7')]==_0x2425ca[_0x9d92('0x17')]&&_0x2425ca[_0x9d92('0xb')]!=_0x9d92('0x18')){utils['info'](util[_0x9d92('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x2425ca[_0x9d92('0x7')],_0x2425ca[_0x9d92('0x19')],_0x2425ca[_0x9d92('0x1a')]));channels[_0x2425ca['uniqueid']]={'uniqueid':_0x2425ca[_0x9d92('0x7')],'accountcode':_0x2425ca[_0x9d92('0xf')],'source':_0x2425ca[_0x9d92('0x1b')],'destination':_0x2425ca['exten'],'destinationcontext':_0x2425ca['context'],'channel':_0x2425ca[_0x9d92('0xb')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9d92('0x3'),'amaflags':_0x9d92('0x1c')};}}catch(_0x1ef885){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')](_0x9d92('0x16'),_0x2425ca[_0x9d92('0x7')]),_0x1ef885);}};exports['newstate']=function(_0x3e42b9){try{utils[_0x9d92('0x15')](util[_0x9d92('0xa')](_0x9d92('0x1e'),_0x3e42b9[_0x9d92('0x7')]),_0x3e42b9);if(!_[_0x9d92('0x1f')](channels[_0x3e42b9[_0x9d92('0x7')]])&&_0x3e42b9['channelstate']==0x6){utils['info'](util[_0x9d92('0xa')](_0x9d92('0x20'),_0x3e42b9[_0x9d92('0x7')],_0x3e42b9['context'],_0x3e42b9[_0x9d92('0xb')]));if(_[_0x9d92('0x1f')](channels[_0x3e42b9[_0x9d92('0x7')]][_0x9d92('0x21')])){channels[_0x3e42b9[_0x9d92('0x7')]]['systemanswertime']=utils[_0x9d92('0x22')]();}}else if(!_[_0x9d92('0x1f')](channels[_0x3e42b9['linkedid']])&&_0x3e42b9[_0x9d92('0x23')]==0x6&&_0x3e42b9[_0x9d92('0x19')]!='transfer'){utils[_0x9d92('0x9')](util[_0x9d92('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3e42b9[_0x9d92('0x7')],_0x3e42b9[_0x9d92('0x17')],_0x3e42b9[_0x9d92('0x19')],_0x3e42b9[_0x9d92('0xb')]));channels[_0x3e42b9[_0x9d92('0x17')]][_0x9d92('0xf')]=_0x3e42b9[_0x9d92('0xf')];channels[_0x3e42b9[_0x9d92('0x17')]]['destinationchannel']=_0x3e42b9[_0x9d92('0xb')];if(_[_0x9d92('0x1f')](channels[_0x3e42b9[_0x9d92('0x17')]][_0x9d92('0x24')])){channels[_0x3e42b9[_0x9d92('0x17')]][_0x9d92('0x24')]=utils[_0x9d92('0x22')]();}channels[_0x3e42b9[_0x9d92('0x17')]][_0x9d92('0x25')]=dispositions[_[_0x9d92('0x26')](_0x3e42b9[_0x9d92('0x23')])]||_0x9d92('0x4');}}catch(_0x31812d){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')]('[%s][calls][newstate]',_0x3e42b9['uniqueid']),_0x31812d);}};exports[_0x9d92('0x27')]=function(_0x2b7e37){try{if(!_['isNil'](channels[_0x2b7e37[_0x9d92('0x7')]])){utils[_0x9d92('0x15')](util[_0x9d92('0xa')]('[%s][calls][hangup]',_0x2b7e37[_0x9d92('0x7')]),_0x2b7e37);if(_[_0x9d92('0x1f')](channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x28')])){channels[_0x2b7e37['uniqueid']][_0x9d92('0x28')]=_0x2b7e37[_0x9d92('0x29')]+'\x20<'+_0x2b7e37[_0x9d92('0x1b')]+'>';}utils['info'](util[_0x9d92('0xa')](_0x9d92('0x2a'),_0x2b7e37[_0x9d92('0x7')],channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x28')],_0x2b7e37[_0x9d92('0x2b')]));channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x2c')]=utils['now']();channels[_0x2b7e37['uniqueid']]['duration']=utils[_0x9d92('0x2d')](channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x2c')],channels[_0x2b7e37['uniqueid']]['starttime']);channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x2e')]=channels[_0x2b7e37['uniqueid']][_0x9d92('0x24')]?utils[_0x9d92('0x2d')](channels[_0x2b7e37[_0x9d92('0x7')]][_0x9d92('0x2c')],channels[_0x2b7e37['uniqueid']][_0x9d92('0x24')]):0x0;writeDB(channels[_0x2b7e37[_0x9d92('0x7')]]);}}catch(_0x17823e){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')](_0x9d92('0x2f'),_0x2b7e37[_0x9d92('0x7')]),_0x17823e);}};exports['attendedtransfer']=function(_0x37490c){try{if(!_[_0x9d92('0x1f')](channels[_0x37490c[_0x9d92('0x30')]])){utils[_0x9d92('0x15')](util[_0x9d92('0xa')]('[%s][calls][attendedtransfer]',_0x37490c[_0x9d92('0x31')]),_0x37490c);if(channels[_0x37490c[_0x9d92('0x30')]]['channel']==_0x37490c[_0x9d92('0x32')]){utils[_0x9d92('0x9')](util[_0x9d92('0xa')](_0x9d92('0x33'),_0x37490c[_0x9d92('0x31')],_0x37490c[_0x9d92('0x30')],_0x37490c[_0x9d92('0x34')]));channels[_0x37490c[_0x9d92('0x30')]][_0x9d92('0x35')]=_0x37490c[_0x9d92('0x34')];channels[_0x37490c[_0x9d92('0x30')]][_0x9d92('0x36')]=_0x9d92('0x37');}else if(channels[_0x37490c[_0x9d92('0x30')]][_0x9d92('0xb')]=_0x37490c['transfertargetchannel']){utils[_0x9d92('0x9')](util['format'](_0x9d92('0x33'),_0x37490c[_0x9d92('0x31')],_0x37490c[_0x9d92('0x30')],_0x37490c[_0x9d92('0x38')]));channels[_0x37490c[_0x9d92('0x30')]]['destinationchannel']=_0x37490c[_0x9d92('0x38')];channels[_0x37490c['localtwolinkedid']][_0x9d92('0x36')]=_0x9d92('0x37');}}}catch(_0x1efb87){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')](_0x9d92('0x39'),_0x37490c[_0x9d92('0x31')]),_0x1efb87);}};exports[_0x9d92('0x3a')]=function(_0x38909b){try{if(!_[_0x9d92('0x1f')](channels[_0x38909b[_0x9d92('0x7')]])){utils[_0x9d92('0x15')](util[_0x9d92('0xa')](_0x9d92('0x3b'),_0x38909b[_0x9d92('0x7')]),_0x38909b);channels[_0x38909b[_0x9d92('0x7')]]['musiconholdstartAt']=utils['now']();utils[_0x9d92('0x9')](util['format'](_0x9d92('0x3c'),_0x38909b[_0x9d92('0x7')],channels[_0x38909b[_0x9d92('0x7')]][_0x9d92('0x3d')]));}}catch(_0x17224a){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')](_0x9d92('0x3b'),_0x38909b[_0x9d92('0x7')]),_0x17224a);}};exports['musiconholdstop']=function(_0x22d912){try{if(!_[_0x9d92('0x1f')](channels[_0x22d912['uniqueid']])){utils[_0x9d92('0x15')](util['format'](_0x9d92('0x3e'),_0x22d912['uniqueid']),_0x22d912);if(!_[_0x9d92('0x1f')](channels[_0x22d912[_0x9d92('0x7')]]['musiconholdstartAt'])){channels[_0x22d912['uniqueid']][_0x9d92('0x3f')]+=utils['diffTime'](utils[_0x9d92('0x22')](),channels[_0x22d912['uniqueid']][_0x9d92('0x3d')]);utils[_0x9d92('0x9')](util[_0x9d92('0xa')](_0x9d92('0x40'),_0x22d912[_0x9d92('0x7')],channels[_0x22d912['uniqueid']][_0x9d92('0x3f')]));delete channels[_0x22d912[_0x9d92('0x7')]][_0x9d92('0x3d')];}}}catch(_0x48f15d){utils['error'](util[_0x9d92('0xa')]('[%s][calls][musiconholdstop]',_0x22d912[_0x9d92('0x7')]),_0x48f15d);}};exports['varset']=function(_0x1ff789){try{if(!_[_0x9d92('0x1f')](channels[_0x1ff789[_0x9d92('0x7')]])){utils['debug'](util[_0x9d92('0xa')]('[%s][calls][varset]',_0x1ff789[_0x9d92('0x7')]),_0x1ff789);if(!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x42')])){utils[_0x9d92('0x9')](util[_0x9d92('0xa')](_0x9d92('0x43'),_0x1ff789[_0x9d92('0x7')],_0x1ff789['value']));channels[_0x1ff789['uniqueid']][_0x9d92('0x44')]=_0x1ff789['value'];}if(!_['isNil'](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x45')])){utils['info'](util[_0x9d92('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1ff789[_0x9d92('0x7')],_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789[_0x9d92('0x7')]][_0x9d92('0x47')]=_0x1ff789[_0x9d92('0x46')];channels[_0x1ff789[_0x9d92('0x7')]][_0x9d92('0x28')]='\x22'+_0x1ff789[_0x9d92('0x46')]+_0x9d92('0x48')+_0x1ff789['value']+'>';}if(!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')]['xmd-callerid-preview'])||!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x49')])){utils[_0x9d92('0x9')](util[_0x9d92('0xa')](_0x9d92('0x4a'),_0x1ff789[_0x9d92('0x7')],!_['isNil'](_0x1ff789[_0x9d92('0x41')]['xmd-callerid-preview'])?_0x9d92('0x4b'):_0x9d92('0x49'),_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789[_0x9d92('0x7')]]['callerid']=_0x1ff789[_0x9d92('0x46')];}if(!_['isNil'](_0x1ff789['variable'][_0x9d92('0x4c')])||!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x4d')])){utils[_0x9d92('0x9')](util['format'](_0x9d92('0x4a'),_0x1ff789['uniqueid'],!_[_0x9d92('0x1f')](_0x1ff789['variable'][_0x9d92('0x4c')])?'xmd-queue':_0x9d92('0x4d'),_0x1ff789['value']));channels[_0x1ff789[_0x9d92('0x7')]][_0x9d92('0x4e')]=_0x9d92('0x4f');channels[_0x1ff789[_0x9d92('0x7')]]['lastdata']=_0x1ff789['value'];channels[_0x1ff789['uniqueid']][_0x9d92('0xc')]=!![];}if(!_['isNil'](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x50')])){utils[_0x9d92('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1ff789[_0x9d92('0x7')],_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789['uniqueid']][_0x9d92('0x51')]=_0x1ff789[_0x9d92('0x46')];}if(!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x52')])){utils['info'](util['format'](_0x9d92('0x53'),_0x1ff789[_0x9d92('0x7')],_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789[_0x9d92('0x7')]][_0x9d92('0x54')]=_0x1ff789[_0x9d92('0x46')];}if(!_['isNil'](_0x1ff789[_0x9d92('0x41')][_0x9d92('0x55')])){utils['info'](util[_0x9d92('0xa')](_0x9d92('0x56'),_0x1ff789[_0x9d92('0x7')],_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789[_0x9d92('0x7')]][_0x9d92('0x57')]=_0x1ff789['value'];}if(!_[_0x9d92('0x1f')](_0x1ff789[_0x9d92('0x41')]['sipcallid'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1ff789[_0x9d92('0x7')],_0x1ff789[_0x9d92('0x46')]));channels[_0x1ff789[_0x9d92('0x7')]]['sipcallid']=_0x1ff789[_0x9d92('0x46')];}}}catch(_0x475b68){utils[_0x9d92('0x1d')](util['format'](_0x9d92('0x58'),_0x1ff789['uniqueid']),_0x475b68);}};exports['newexten']=function(_0x7c28f0){try{if(!_[_0x9d92('0x1f')](channels[_0x7c28f0[_0x9d92('0x7')]])){utils['debug'](util[_0x9d92('0xa')](_0x9d92('0x59'),_0x7c28f0[_0x9d92('0x7')]),_0x7c28f0);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x7c28f0['uniqueid'],_0x7c28f0[_0x9d92('0x5a')],_0x7c28f0[_0x9d92('0x5b')]));if(_0x7c28f0[_0x9d92('0x5a')]['toLowerCase']()==_0x9d92('0x5c')&&_[_0x9d92('0x5d')](_0x7c28f0['appdata'][_0x9d92('0x5e')](),_0x9d92('0x5f'))){var _0x5b3b94=_0x7c28f0[_0x9d92('0x5b')][_0x9d92('0x60')]('=');var _0x2ce74c=_0x5b3b94[0x0][_0x9d92('0x61')](_0x5b3b94[0x0][_0x9d92('0x62')]('(')+0x1,_0x5b3b94[0x0][_0x9d92('0x62')](')'));var _0x258ac1=_0x5b3b94[0x1];channels[_0x7c28f0[_0x9d92('0x7')]][_0x2ce74c]=_0x258ac1;}if(!_[_0x9d92('0x63')]([_0x9d92('0x27'),_0x9d92('0x64'),_0x9d92('0x65'),_0x9d92('0x5c'),'gotoif'],_0x7c28f0[_0x9d92('0x5a')][_0x9d92('0x5e')]())){channels[_0x7c28f0[_0x9d92('0x7')]][_0x9d92('0x4e')]=_0x7c28f0[_0x9d92('0x5a')];channels[_0x7c28f0[_0x9d92('0x7')]][_0x9d92('0x66')]=_0x7c28f0[_0x9d92('0x5b')];}}}catch(_0x3577da){utils[_0x9d92('0x1d')](util[_0x9d92('0xa')](_0x9d92('0x59'),_0x7c28f0[_0x9d92('0x7')]),_0x3577da);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index fbf5414..f961cc1 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 _0xfd03=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x35878b,_0x37ea4a){var _0x4a89ad=function(_0x2d4272){while(--_0x2d4272){_0x35878b['push'](_0x35878b['shift']());}};_0x4a89ad(++_0x37ea4a);}(_0xfd03,0x1de));var _0x3fd0=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0xfd03[_0x145b3c];return _0x1b6e36;};'use strict';var utils=require('./utils');exports[_0x3fd0('0x0')]=function(){utils[_0x3fd0('0x1')](_0x3fd0('0x2'));};exports[_0x3fd0('0x3')]=function(){utils['info'](_0x3fd0('0x4'));};exports[_0x3fd0('0x5')]=function(){utils['info'](_0x3fd0('0x6'));};exports[_0x3fd0('0x7')]=function(_0x2fe8d6){utils[_0x3fd0('0x7')](_0x3fd0('0x8'),_0x2fe8d6);};exports[_0x3fd0('0x9')]=function(){utils[_0x3fd0('0x1')](_0x3fd0('0xa'));};exports['managerevent']=function(_0x409a49){}; \ No newline at end of file +var _0x4283=['info','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x136492,_0x59857e){var _0x53b7b1=function(_0x4fc657){while(--_0x4fc657){_0x136492['push'](_0x136492['shift']());}};_0x53b7b1(++_0x59857e);}(_0x4283,0x119));var _0x3428=function(_0x6ebcf6,_0x3c2326){_0x6ebcf6=_0x6ebcf6-0x0;var _0x41dd93=_0x4283[_0x6ebcf6];return _0x41dd93;};'use strict';var utils=require(_0x3428('0x0'));exports['connect']=function(){utils['info'](_0x3428('0x1'));};exports[_0x3428('0x2')]=function(){utils['info'](_0x3428('0x3'));};exports[_0x3428('0x4')]=function(){utils[_0x3428('0x5')]('[core]\x20fullybooted');};exports[_0x3428('0x6')]=function(_0x4d989e){utils['error'](_0x3428('0x7'),_0x4d989e);};exports[_0x3428('0x8')]=function(){utils['info'](_0x3428('0x9'));};exports[_0x3428('0xa')]=function(_0x481239){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index f465dde..6cd8f7d 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 _0xff1b=['diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','debug','[%s][dials][newexten]','appdata','application','toLowerCase','set','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','dialstatus','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','calleridname','cause-txt','complete','duration'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xff1b,0x19d));var _0xbff1=function(_0x48a0b4,_0x2a4c3f){_0x48a0b4=_0x48a0b4-0x0;var _0x44b1e6=_0xff1b[_0x48a0b4];return _0x44b1e6;};'use strict';var _=require(_0xbff1('0x0'));var util=require(_0xbff1('0x1'));var utils=require(_0xbff1('0x2'));var dials={};function writeDB(_0x246c31){utils['info'](util[_0xbff1('0x3')](_0xbff1('0x4'),_0x246c31[_0xbff1('0x5')],_0x246c31[_0xbff1('0x6')],_0x246c31['dialstring'],_0x246c31[_0xbff1('0x7')],_0x246c31[_0xbff1('0x8')],_0x246c31['dialstatus']));utils['request'](_0xbff1('0x9'),_0x246c31);delete dials[_0x246c31[_0xbff1('0x5')]];}exports['newexten']=function(_0x28307a){try{utils[_0xbff1('0xa')](util[_0xbff1('0x3')](_0xbff1('0xb'),_0x28307a[_0xbff1('0x5')]),_0x28307a);utils['info'](util[_0xbff1('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x28307a[_0xbff1('0x5')],_0x28307a['application'],_0x28307a[_0xbff1('0xc')]));if(_0x28307a[_0xbff1('0xd')][_0xbff1('0xe')]()==_0xbff1('0xf')&&_['startsWith'](_0x28307a[_0xbff1('0xc')][_0xbff1('0xe')](),_0xbff1('0x10'))){var _0x388390=_0x28307a[_0xbff1('0xc')][_0xbff1('0x11')]('=');dials[_0x28307a[_0xbff1('0x5')]]={'routeId':_0x388390[0x1]};}}catch(_0x21d560){utils[_0xbff1('0x12')](util['format']('[%s][dials][newexten]',_0x28307a['uniqueid']),_0x21d560);}};exports[_0xbff1('0x13')]=function(_0xbba7a1){try{utils[_0xbff1('0xa')](util[_0xbff1('0x3')](_0xbff1('0x14'),_0xbba7a1[_0xbff1('0x5')]),_0xbba7a1);if(!_[_0xbff1('0x15')](_0xbba7a1[_0xbff1('0x16')][_0xbff1('0x17')])){utils[_0xbff1('0x18')](util['format'](_0xbff1('0x19'),_0xbba7a1[_0xbff1('0x5')],_0xbba7a1[_0xbff1('0x1a')]));dials[_0xbba7a1['uniqueid']]={'routeId':_0xbba7a1[_0xbff1('0x1a')]};}}catch(_0x365e8f){utils[_0xbff1('0x12')](util[_0xbff1('0x3')](_0xbff1('0x14'),_0xbba7a1[_0xbff1('0x5')]),_0x365e8f);}};exports[_0xbff1('0x1b')]=function(_0x1b6253){try{if(!_[_0xbff1('0x15')](dials[_0x1b6253[_0xbff1('0x5')]])){utils['debug'](util[_0xbff1('0x3')](_0xbff1('0x1c'),_0x1b6253[_0xbff1('0x5')]),_0x1b6253);dials[_0x1b6253[_0xbff1('0x5')]]=_['assign'](dials[_0x1b6253[_0xbff1('0x5')]],_0x1b6253);dials[_0x1b6253['uniqueid']]['starttime']=utils[_0xbff1('0x1d')]();dials[_0x1b6253['uniqueid']][_0xbff1('0x1e')]=_0xbff1('0x1f');utils[_0xbff1('0x18')](util[_0xbff1('0x3')](_0xbff1('0x20'),_0x1b6253[_0xbff1('0x5')],dials[_0x1b6253[_0xbff1('0x5')]][_0xbff1('0x21')]));}}catch(_0x10a631){utils[_0xbff1('0x12')](util[_0xbff1('0x3')](_0xbff1('0x1c'),_0x1b6253[_0xbff1('0x5')]),_0x10a631);}};exports[_0xbff1('0x22')]=function(_0x1b2541){try{if(!_['isNil'](dials[_0x1b2541[_0xbff1('0x5')]])){utils[_0xbff1('0xa')](util['format']('[%s][dials][dialend]',_0x1b2541[_0xbff1('0x5')]),_0x1b2541);dials[_0x1b2541[_0xbff1('0x5')]][_0xbff1('0x23')]=_0x1b2541[_0xbff1('0x23')];if(_0x1b2541['dialstatus']=='ANSWER'){dials[_0x1b2541[_0xbff1('0x5')]]=_[_0xbff1('0x24')](dials[_0x1b2541[_0xbff1('0x5')]],_0x1b2541);dials[_0x1b2541[_0xbff1('0x5')]][_0xbff1('0x25')]=utils[_0xbff1('0x1d')]();dials[_0x1b2541['uniqueid']][_0xbff1('0x1e')]=_0xbff1('0x26');utils[_0xbff1('0x18')](util[_0xbff1('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1b2541[_0xbff1('0x5')],_0x1b2541[_0xbff1('0x23')],dials[_0x1b2541['uniqueid']][_0xbff1('0x25')]));}else{utils['info'](util[_0xbff1('0x3')](_0xbff1('0x27'),_0x1b2541[_0xbff1('0x5')],_0x1b2541['dialstatus']));}}}catch(_0x264b95){utils[_0xbff1('0x12')](util[_0xbff1('0x3')](_0xbff1('0x28'),_0x1b2541[_0xbff1('0x5')]),_0x264b95);}};exports[_0xbff1('0x29')]=function(_0x531e4){try{if(!_[_0xbff1('0x15')](dials[_0x531e4[_0xbff1('0x5')]])){utils[_0xbff1('0xa')](util[_0xbff1('0x3')]('[%s][dials][hangup]',_0x531e4['uniqueid']),_0x531e4);utils[_0xbff1('0x18')](util[_0xbff1('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x531e4['uniqueid'],_0x531e4[_0xbff1('0x7')],_0x531e4[_0xbff1('0x2a')],_0x531e4[_0xbff1('0x2b')]));dials[_0x531e4[_0xbff1('0x5')]]=_[_0xbff1('0x24')](dials[_0x531e4[_0xbff1('0x5')]],{'endtime':utils['now'](),'lastevent':_0xbff1('0x2c')});dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x2d')]=utils[_0xbff1('0x2e')](dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x2f')],dials[_0x531e4[_0xbff1('0x5')]]['starttime']);dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x30')]=utils[_0xbff1('0x2e')](dials[_0x531e4[_0xbff1('0x5')]]['answertime']||dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x2f')],dials[_0x531e4['uniqueid']][_0xbff1('0x21')]);dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x31')]=dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x25')]?utils[_0xbff1('0x2e')](dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x2f')],dials[_0x531e4[_0xbff1('0x5')]][_0xbff1('0x25')]):0x0;writeDB(dials[_0x531e4[_0xbff1('0x5')]]);}}catch(_0x263082){utils[_0xbff1('0x12')](util[_0xbff1('0x3')](_0xbff1('0x32'),_0x531e4[_0xbff1('0x5')]),_0x263082);}}; \ No newline at end of file +var _0x806d=['diffTime','billableseconds','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','toLowerCase','set','startsWith','appdata','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','hangup','[%s][dials][hangup]','complete','endtime','holdtime'];(function(_0x3563fb,_0x39283a){var _0x308f92=function(_0x14fd82){while(--_0x14fd82){_0x3563fb['push'](_0x3563fb['shift']());}};_0x308f92(++_0x39283a);}(_0x806d,0x16a));var _0xd806=function(_0x3d8dd4,_0x446c64){_0x3d8dd4=_0x3d8dd4-0x0;var _0x3c48ee=_0x806d[_0x3d8dd4];return _0x3c48ee;};'use strict';var _=require('lodash');var util=require(_0xd806('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x2542b1){utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x3'),_0x2542b1[_0xd806('0x4')],_0x2542b1[_0xd806('0x5')],_0x2542b1['dialstring'],_0x2542b1[_0xd806('0x6')],_0x2542b1['connectedlinenum'],_0x2542b1[_0xd806('0x7')]));utils[_0xd806('0x8')](_0xd806('0x9'),_0x2542b1);delete dials[_0x2542b1['uniqueid']];}exports[_0xd806('0xa')]=function(_0x29a9a7){try{utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0xc'),_0x29a9a7[_0xd806('0x4')]),_0x29a9a7);utils[_0xd806('0x1')](util[_0xd806('0x2')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x29a9a7[_0xd806('0x4')],_0x29a9a7[_0xd806('0xd')],_0x29a9a7['appdata']));if(_0x29a9a7['application'][_0xd806('0xe')]()==_0xd806('0xf')&&_[_0xd806('0x10')](_0x29a9a7[_0xd806('0x11')]['toLowerCase'](),'cdr(routeid)')){var _0x137dbc=_0x29a9a7['appdata']['split']('=');dials[_0x29a9a7[_0xd806('0x4')]]={'routeId':_0x137dbc[0x1]};}}catch(_0x211100){utils[_0xd806('0x12')](util[_0xd806('0x2')]('[%s][dials][newexten]',_0x29a9a7[_0xd806('0x4')]),_0x211100);}};exports[_0xd806('0x13')]=function(_0x2b60eb){try{utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0x14'),_0x2b60eb[_0xd806('0x4')]),_0x2b60eb);if(!_[_0xd806('0x15')](_0x2b60eb[_0xd806('0x16')][_0xd806('0x17')])){utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x18'),_0x2b60eb[_0xd806('0x4')],_0x2b60eb[_0xd806('0x19')]));dials[_0x2b60eb[_0xd806('0x4')]]={'routeId':_0x2b60eb[_0xd806('0x19')]};}}catch(_0x5b5dfc){utils['error'](util['format'](_0xd806('0x14'),_0x2b60eb[_0xd806('0x4')]),_0x5b5dfc);}};exports[_0xd806('0x1a')]=function(_0x52fd71){try{if(!_['isNil'](dials[_0x52fd71['uniqueid']])){utils[_0xd806('0xb')](util['format'](_0xd806('0x1b'),_0x52fd71[_0xd806('0x4')]),_0x52fd71);dials[_0x52fd71[_0xd806('0x4')]]=_['assign'](dials[_0x52fd71[_0xd806('0x4')]],_0x52fd71);dials[_0x52fd71[_0xd806('0x4')]]['starttime']=utils['now']();dials[_0x52fd71['uniqueid']][_0xd806('0x1c')]=_0xd806('0x1d');utils[_0xd806('0x1')](util[_0xd806('0x2')](_0xd806('0x1e'),_0x52fd71['uniqueid'],dials[_0x52fd71[_0xd806('0x4')]][_0xd806('0x1f')]));}}catch(_0x1fbc7e){utils[_0xd806('0x12')](util[_0xd806('0x2')](_0xd806('0x1b'),_0x52fd71[_0xd806('0x4')]),_0x1fbc7e);}};exports[_0xd806('0x20')]=function(_0x544de8){try{if(!_[_0xd806('0x15')](dials[_0x544de8['uniqueid']])){utils[_0xd806('0xb')](util[_0xd806('0x2')](_0xd806('0x21'),_0x544de8['uniqueid']),_0x544de8);dials[_0x544de8['uniqueid']]['dialstatus']=_0x544de8[_0xd806('0x7')];if(_0x544de8[_0xd806('0x7')]==_0xd806('0x22')){dials[_0x544de8[_0xd806('0x4')]]=_['assign'](dials[_0x544de8[_0xd806('0x4')]],_0x544de8);dials[_0x544de8[_0xd806('0x4')]][_0xd806('0x23')]=utils[_0xd806('0x24')]();dials[_0x544de8['uniqueid']][_0xd806('0x1c')]=_0xd806('0x25');utils[_0xd806('0x1')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x544de8[_0xd806('0x4')],_0x544de8[_0xd806('0x7')],dials[_0x544de8[_0xd806('0x4')]]['answertime']));}else{utils['info'](util[_0xd806('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x544de8['uniqueid'],_0x544de8['dialstatus']));}}}catch(_0x20671c){utils[_0xd806('0x12')](util['format'](_0xd806('0x21'),_0x544de8[_0xd806('0x4')]),_0x20671c);}};exports[_0xd806('0x26')]=function(_0x1b68eb){try{if(!_[_0xd806('0x15')](dials[_0x1b68eb['uniqueid']])){utils[_0xd806('0xb')](util['format'](_0xd806('0x27'),_0x1b68eb[_0xd806('0x4')]),_0x1b68eb);utils[_0xd806('0x1')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1b68eb[_0xd806('0x4')],_0x1b68eb[_0xd806('0x6')],_0x1b68eb['calleridname'],_0x1b68eb['cause-txt']));dials[_0x1b68eb[_0xd806('0x4')]]=_['assign'](dials[_0x1b68eb['uniqueid']],{'endtime':utils[_0xd806('0x24')](),'lastevent':_0xd806('0x28')});dials[_0x1b68eb[_0xd806('0x4')]]['duration']=utils['diffTime'](dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x1f')]);dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x2a')]=utils[_0xd806('0x2b')](dials[_0x1b68eb[_0xd806('0x4')]]['answertime']||dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x1f')]);dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x2c')]=dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x23')]?utils[_0xd806('0x2b')](dials[_0x1b68eb['uniqueid']][_0xd806('0x29')],dials[_0x1b68eb[_0xd806('0x4')]][_0xd806('0x23')]):0x0;writeDB(dials[_0x1b68eb[_0xd806('0x4')]]);}}catch(_0x41e92f){utils[_0xd806('0x12')](util[_0xd806('0x2')](_0xd806('0x27'),_0x1b68eb['uniqueid']),_0x41e92f);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index d4e3991..23af274 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 _0xceab=['cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','password','keepConnected','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','format','device','devicestatechange','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','agentringnoanswer','debug','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]'];(function(_0x564f44,_0x37f8ae){var _0xf563e9=function(_0x3f2779){while(--_0x3f2779){_0x564f44['push'](_0x564f44['shift']());}};_0xf563e9(++_0x37f8ae);}(_0xceab,0x1a3));var _0xbcea=function(_0x7c9922,_0x1306e){_0x7c9922=_0x7c9922-0x0;var _0x6ff4b6=_0xceab[_0x7c9922];return _0x6ff4b6;};var AsteriskManager=require(_0xbcea('0x0'));var config=require(_0xbcea('0x1'));var utils=require('./utils');var util=require(_0xbcea('0x2'));var ami=new AsteriskManager(config[_0xbcea('0x3')][_0xbcea('0x4')],config[_0xbcea('0x3')]['ip'],config[_0xbcea('0x3')]['username'],config['asterisk'][_0xbcea('0x5')],!![]);ami[_0xbcea('0x6')]();if(config[_0xbcea('0x7')]&&config[_0xbcea('0x7')][_0xbcea('0x8')]){utils['info'](_0xbcea('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0xbcea('0xa'));var queues=require(_0xbcea('0xb'));var recordings=require(_0xbcea('0xc'));var members=require(_0xbcea('0xd'));var dials=require(_0xbcea('0xe'));var transfers=require(_0xbcea('0xf'));var core=require('./core.controller');ami['on'](_0xbcea('0x10'),core[_0xbcea('0x10')]);ami['on']('shutdown',core[_0xbcea('0x11')]);ami['on'](_0xbcea('0x12'),core[_0xbcea('0x12')]);ami['on'](_0xbcea('0x13'),core[_0xbcea('0x13')]);ami['on']('close',core[_0xbcea('0x14')]);ami['on']('managerevent',core[_0xbcea('0x15')]);ami['on']('devicestatechange',function(_0x14614c){try{utils['debug'](util[_0xbcea('0x16')]('[%s][index][devicestatechange]',_0x14614c[_0xbcea('0x17')]),_0x14614c);members[_0xbcea('0x18')](_0x14614c);}catch(_0x44700f){utils[_0xbcea('0x13')](util['format'](_0xbcea('0x19'),_0x14614c[_0xbcea('0x17')]),_0x44700f);}});ami['on'](_0xbcea('0x1a'),function(_0x147007){try{utils['debug'](util['format'](_0xbcea('0x1b'),_0x147007['uniqueid']),_0x147007);agents[_0xbcea('0x1a')](_0x147007);}catch(_0x458b11){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x1b'),_0x147007['uniqueid']),_0x458b11);}});ami['on'](_0xbcea('0x1c'),function(_0x202d12){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x1e'),_0x202d12[_0xbcea('0x1f')]),_0x202d12);agents[_0xbcea('0x1c')](_0x202d12);}catch(_0x28f334){utils[_0xbcea('0x13')](util[_0xbcea('0x16')]('[%s][index][agentringnoanswer]',_0x202d12[_0xbcea('0x1f')]),_0x28f334);}});ami['on'](_0xbcea('0x20'),function(_0x5df869){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x21'),_0x5df869[_0xbcea('0x1f')]),_0x5df869);agents[_0xbcea('0x20')](_0x5df869);queues[_0xbcea('0x20')](_0x5df869);}catch(_0x10fa4a){utils['error'](util[_0xbcea('0x16')]('[%s][index][agentconnect]',_0x5df869['uniqueid']),_0x10fa4a);}});ami['on']('agentcomplete',function(_0x309a42){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x22'),_0x309a42[_0xbcea('0x1f')]),_0x309a42);agents[_0xbcea('0x23')](_0x309a42);queues[_0xbcea('0x23')](_0x309a42);members[_0xbcea('0x23')](_0x309a42);}catch(_0x4f4f15){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x22'),_0x309a42[_0xbcea('0x1f')]),_0x4f4f15);}});ami['on'](_0xbcea('0x24'),function(_0x692f32){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x25'),_0x692f32[_0xbcea('0x1f')]),_0x692f32);agents[_0xbcea('0x24')](_0x692f32);queues[_0xbcea('0x24')](_0x692f32);}catch(_0x4dd782){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x25'),_0x692f32[_0xbcea('0x1f')]),_0x4dd782);}});ami['on'](_0xbcea('0x26'),function(_0x25706e){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x27'),_0x25706e[_0xbcea('0x1f')]),_0x25706e);queues[_0xbcea('0x26')](_0x25706e);recordings[_0xbcea('0x26')](_0x25706e);}catch(_0x565153){utils['error'](util[_0xbcea('0x16')](_0xbcea('0x27'),_0x25706e['uniqueid']),_0x565153);}});ami['on'](_0xbcea('0x28'),function(_0x51581e){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')]('[%s][index][queuecallerleave]',_0x51581e[_0xbcea('0x1f')]),_0x51581e);queues[_0xbcea('0x28')](_0x51581e);}catch(_0x252558){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x29'),_0x51581e[_0xbcea('0x1f')]),_0x252558);}});ami['on'](_0xbcea('0x2a'),function(_0x47d581){try{utils[_0xbcea('0x1d')](util['format'](_0xbcea('0x2b'),_0x47d581[_0xbcea('0x1f')]),_0x47d581);queues[_0xbcea('0x2a')](_0x47d581);calls[_0xbcea('0x2a')](_0x47d581);}catch(_0x26e8f0){utils[_0xbcea('0x13')](util['format'](_0xbcea('0x2b'),_0x47d581[_0xbcea('0x1f')]),_0x26e8f0);}});ami['on'](_0xbcea('0x2c'),function(_0x12a783){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')]('[%s][index][musiconholdstop]',_0x12a783['uniqueid']),_0x12a783);queues[_0xbcea('0x2c')](_0x12a783);calls[_0xbcea('0x2c')](_0x12a783);}catch(_0x5ad5e0){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x2d'),_0x12a783['uniqueid']),_0x5ad5e0);}});ami['on'](_0xbcea('0x2e'),function(_0x20a233){try{utils[_0xbcea('0x1d')](util['format']('[%s][index][newstate]',_0x20a233['uniqueid']),_0x20a233);calls[_0xbcea('0x2e')](_0x20a233);recordings[_0xbcea('0x2e')](_0x20a233);}catch(_0x84b2d1){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x2f'),_0x20a233['uniqueid']),_0x84b2d1);}});ami['on'](_0xbcea('0x30'),function(_0x49371d){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')]('[%s][index][hangup]',_0x49371d['uniqueid']),_0x49371d);calls[_0xbcea('0x30')](_0x49371d);recordings[_0xbcea('0x30')](_0x49371d);dials[_0xbcea('0x30')](_0x49371d);agents['hangup'](_0x49371d);queues[_0xbcea('0x30')](_0x49371d);}catch(_0x2dd47b){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x31'),_0x49371d[_0xbcea('0x1f')]),_0x2dd47b);}});ami['on'](_0xbcea('0x32'),function(_0x9c6035){try{utils[_0xbcea('0x1d')](util['format'](_0xbcea('0x33'),_0x9c6035[_0xbcea('0x1f')]),_0x9c6035);members[_0xbcea('0x32')](_0x9c6035);}catch(_0x42c4db){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x33'),_0x9c6035['uniqueid']),_0x42c4db);}});ami['on'](_0xbcea('0x34'),function(_0x3fc962){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x35'),_0x3fc962[_0xbcea('0x1f')]),_0x3fc962);queues[_0xbcea('0x34')](_0x3fc962);agents[_0xbcea('0x34')](_0x3fc962);transfers[_0xbcea('0x34')](_0x3fc962);}catch(_0x5a6899){utils[_0xbcea('0x13')](util['format'](_0xbcea('0x35'),_0x3fc962['uniqueid']),_0x5a6899);}});ami['on'](_0xbcea('0x36'),function(_0x26869b){try{utils['debug'](util['format'](_0xbcea('0x37'),_0x26869b[_0xbcea('0x38')]),_0x26869b);queues[_0xbcea('0x36')](_0x26869b);transfers[_0xbcea('0x36')](_0x26869b);agents[_0xbcea('0x36')](_0x26869b);calls[_0xbcea('0x36')](_0x26869b);}catch(_0x21f959){utils['error'](util[_0xbcea('0x16')](_0xbcea('0x37'),_0x26869b['origtransfereruniqueid']),_0x21f959);}});ami['on'](_0xbcea('0x39'),function(_0x767787){try{utils['debug'](util[_0xbcea('0x16')](_0xbcea('0x3a'),_0x767787[_0xbcea('0x1f')]),_0x767787);queues[_0xbcea('0x39')](_0x767787);recordings[_0xbcea('0x39')](_0x767787);calls[_0xbcea('0x39')](_0x767787);dials[_0xbcea('0x39')](_0x767787);}catch(_0x2a6074){utils['error'](util[_0xbcea('0x16')](_0xbcea('0x3a'),_0x767787[_0xbcea('0x1f')]),_0x2a6074);}});ami['on'](_0xbcea('0x3b'),function(_0x267172){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x3c'),_0x267172[_0xbcea('0x1f')]),_0x267172);calls[_0xbcea('0x3b')](_0x267172);recordings[_0xbcea('0x3b')](_0x267172);dials[_0xbcea('0x3b')](_0x267172);}catch(_0x3571c3){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x3c'),_0x267172[_0xbcea('0x1f')]),_0x3571c3);}});ami['on'](_0xbcea('0x3d'),function(_0x3eb37c){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x3e'),_0x3eb37c[_0xbcea('0x1f')]),_0x3eb37c);calls[_0xbcea('0x3d')](_0x3eb37c);recordings[_0xbcea('0x3d')](_0x3eb37c);}catch(_0x18c71e){utils[_0xbcea('0x13')](util['format'](_0xbcea('0x3e'),_0x3eb37c[_0xbcea('0x1f')]),_0x18c71e);}});ami['on'](_0xbcea('0x3f'),function(_0x5d291b){try{utils['debug'](util['format'](_0xbcea('0x40'),_0x5d291b[_0xbcea('0x1f')]),_0x5d291b);dials[_0xbcea('0x3f')](_0x5d291b);}catch(_0x4ecd27){utils[_0xbcea('0x13')](util[_0xbcea('0x16')]('[%s]dialbegin',_0x5d291b[_0xbcea('0x1f')]),_0x4ecd27);}});ami['on'](_0xbcea('0x41'),function(_0x59fcb8){try{utils[_0xbcea('0x1d')](util[_0xbcea('0x16')](_0xbcea('0x42'),_0x59fcb8[_0xbcea('0x1f')]),_0x59fcb8);dials[_0xbcea('0x41')](_0x59fcb8);}catch(_0x2cb159){utils[_0xbcea('0x13')](util[_0xbcea('0x16')](_0xbcea('0x42'),_0x59fcb8['uniqueid']),_0x2cb159);}});} \ No newline at end of file +var _0x1d3c=['[%s][index][devicestatechange]','device','error','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','close','managerevent','devicestatechange','debug','format'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x1d3c,0x1da));var _0xc1d3=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x1d3c[_0x43c8b8];return _0x413be3;};var AsteriskManager=require(_0xc1d3('0x0'));var config=require(_0xc1d3('0x1'));var utils=require('./utils');var util=require(_0xc1d3('0x2'));var ami=new AsteriskManager(config[_0xc1d3('0x3')][_0xc1d3('0x4')],config[_0xc1d3('0x3')]['ip'],config['asterisk']['username'],config['asterisk']['password'],!![]);ami[_0xc1d3('0x5')]();if(config['xdr']&&config['xdr']['disabled']){utils[_0xc1d3('0x6')](_0xc1d3('0x7'));}else{var agents=require(_0xc1d3('0x8'));var calls=require(_0xc1d3('0x9'));var queues=require('./queues.controller');var recordings=require(_0xc1d3('0xa'));var members=require(_0xc1d3('0xb'));var dials=require(_0xc1d3('0xc'));var transfers=require('./transfers.controller');var core=require(_0xc1d3('0xd'));ami['on']('connect',core[_0xc1d3('0xe')]);ami['on'](_0xc1d3('0xf'),core[_0xc1d3('0xf')]);ami['on'](_0xc1d3('0x10'),core[_0xc1d3('0x10')]);ami['on']('error',core['error']);ami['on'](_0xc1d3('0x11'),core[_0xc1d3('0x11')]);ami['on'](_0xc1d3('0x12'),core['managerevent']);ami['on'](_0xc1d3('0x13'),function(_0x42022b){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x16'),_0x42022b[_0xc1d3('0x17')]),_0x42022b);members[_0xc1d3('0x13')](_0x42022b);}catch(_0x3762d0){utils[_0xc1d3('0x18')](util['format'](_0xc1d3('0x16'),_0x42022b[_0xc1d3('0x17')]),_0x3762d0);}});ami['on'](_0xc1d3('0x19'),function(_0x3b3072){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')]('[%s][index][agentcalled]',_0x3b3072[_0xc1d3('0x1a')]),_0x3b3072);agents[_0xc1d3('0x19')](_0x3b3072);}catch(_0x545f0b){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')]('[%s][index][agentcalled]',_0x3b3072['uniqueid']),_0x545f0b);}});ami['on'](_0xc1d3('0x1b'),function(_0x2dd793){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')]('[%s][index][agentringnoanswer]',_0x2dd793[_0xc1d3('0x1a')]),_0x2dd793);agents[_0xc1d3('0x1b')](_0x2dd793);}catch(_0x1b1e9f){utils['error'](util[_0xc1d3('0x15')](_0xc1d3('0x1c'),_0x2dd793[_0xc1d3('0x1a')]),_0x1b1e9f);}});ami['on'](_0xc1d3('0x1d'),function(_0x3ae489){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x1e'),_0x3ae489[_0xc1d3('0x1a')]),_0x3ae489);agents[_0xc1d3('0x1d')](_0x3ae489);queues[_0xc1d3('0x1d')](_0x3ae489);}catch(_0x36a716){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')]('[%s][index][agentconnect]',_0x3ae489['uniqueid']),_0x36a716);}});ami['on']('agentcomplete',function(_0x57d2ff){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x1f'),_0x57d2ff['uniqueid']),_0x57d2ff);agents[_0xc1d3('0x20')](_0x57d2ff);queues[_0xc1d3('0x20')](_0x57d2ff);members[_0xc1d3('0x20')](_0x57d2ff);}catch(_0x2f1ce0){utils['error'](util[_0xc1d3('0x15')](_0xc1d3('0x1f'),_0x57d2ff[_0xc1d3('0x1a')]),_0x2f1ce0);}});ami['on'](_0xc1d3('0x21'),function(_0x205894){try{utils['debug'](util[_0xc1d3('0x15')](_0xc1d3('0x22'),_0x205894[_0xc1d3('0x1a')]),_0x205894);agents[_0xc1d3('0x21')](_0x205894);queues[_0xc1d3('0x21')](_0x205894);}catch(_0x42cc3d){utils[_0xc1d3('0x18')](util['format'](_0xc1d3('0x22'),_0x205894['uniqueid']),_0x42cc3d);}});ami['on'](_0xc1d3('0x23'),function(_0x552c71){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x24'),_0x552c71[_0xc1d3('0x1a')]),_0x552c71);queues['queuecallerjoin'](_0x552c71);recordings[_0xc1d3('0x23')](_0x552c71);}catch(_0x387509){utils[_0xc1d3('0x18')](util['format'](_0xc1d3('0x24'),_0x552c71['uniqueid']),_0x387509);}});ami['on']('queuecallerleave',function(_0x2915ac){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x25'),_0x2915ac[_0xc1d3('0x1a')]),_0x2915ac);queues[_0xc1d3('0x26')](_0x2915ac);}catch(_0x379cc4){utils['error'](util[_0xc1d3('0x15')](_0xc1d3('0x25'),_0x2915ac[_0xc1d3('0x1a')]),_0x379cc4);}});ami['on'](_0xc1d3('0x27'),function(_0x340bc9){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')]('[%s][index][musiconholdstart]',_0x340bc9[_0xc1d3('0x1a')]),_0x340bc9);queues['musiconholdstart'](_0x340bc9);calls[_0xc1d3('0x27')](_0x340bc9);}catch(_0x34ebdc){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')]('[%s][index][musiconholdstart]',_0x340bc9[_0xc1d3('0x1a')]),_0x34ebdc);}});ami['on'](_0xc1d3('0x28'),function(_0x4c9685){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x29'),_0x4c9685[_0xc1d3('0x1a')]),_0x4c9685);queues['musiconholdstop'](_0x4c9685);calls[_0xc1d3('0x28')](_0x4c9685);}catch(_0x27b17b){utils['error'](util['format'](_0xc1d3('0x29'),_0x4c9685[_0xc1d3('0x1a')]),_0x27b17b);}});ami['on'](_0xc1d3('0x2a'),function(_0x450e5f){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x2b'),_0x450e5f[_0xc1d3('0x1a')]),_0x450e5f);calls['newstate'](_0x450e5f);recordings[_0xc1d3('0x2a')](_0x450e5f);}catch(_0x429081){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')]('[%s][index][newstate]',_0x450e5f[_0xc1d3('0x1a')]),_0x429081);}});ami['on'](_0xc1d3('0x2c'),function(_0x8c97ab){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')](_0xc1d3('0x2d'),_0x8c97ab[_0xc1d3('0x1a')]),_0x8c97ab);calls[_0xc1d3('0x2c')](_0x8c97ab);recordings[_0xc1d3('0x2c')](_0x8c97ab);dials['hangup'](_0x8c97ab);agents['hangup'](_0x8c97ab);queues[_0xc1d3('0x2c')](_0x8c97ab);}catch(_0xd595f9){utils['error'](util[_0xc1d3('0x15')](_0xc1d3('0x2d'),_0x8c97ab[_0xc1d3('0x1a')]),_0xd595f9);}});ami['on'](_0xc1d3('0x2e'),function(_0x13ced2){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')]('[%s][index][cdr]',_0x13ced2[_0xc1d3('0x1a')]),_0x13ced2);members[_0xc1d3('0x2e')](_0x13ced2);}catch(_0x3f3481){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')](_0xc1d3('0x2f'),_0x13ced2['uniqueid']),_0x3f3481);}});ami['on'](_0xc1d3('0x30'),function(_0x5e5c4e){try{utils[_0xc1d3('0x14')](util['format'](_0xc1d3('0x31'),_0x5e5c4e['uniqueid']),_0x5e5c4e);queues[_0xc1d3('0x30')](_0x5e5c4e);agents[_0xc1d3('0x30')](_0x5e5c4e);transfers[_0xc1d3('0x30')](_0x5e5c4e);}catch(_0x4c1d43){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')](_0xc1d3('0x31'),_0x5e5c4e[_0xc1d3('0x1a')]),_0x4c1d43);}});ami['on'](_0xc1d3('0x32'),function(_0x34b4a0){try{utils['debug'](util['format'](_0xc1d3('0x33'),_0x34b4a0[_0xc1d3('0x34')]),_0x34b4a0);queues['attendedtransfer'](_0x34b4a0);transfers[_0xc1d3('0x32')](_0x34b4a0);agents[_0xc1d3('0x32')](_0x34b4a0);calls[_0xc1d3('0x32')](_0x34b4a0);}catch(_0xddedc3){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')](_0xc1d3('0x33'),_0x34b4a0[_0xc1d3('0x34')]),_0xddedc3);}});ami['on']('varset',function(_0xd4f41f){try{utils[_0xc1d3('0x14')](util[_0xc1d3('0x15')]('[%s][index][varset]',_0xd4f41f[_0xc1d3('0x1a')]),_0xd4f41f);queues[_0xc1d3('0x35')](_0xd4f41f);recordings[_0xc1d3('0x35')](_0xd4f41f);calls[_0xc1d3('0x35')](_0xd4f41f);dials['varset'](_0xd4f41f);}catch(_0xc706f1){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')]('[%s][index][varset]',_0xd4f41f[_0xc1d3('0x1a')]),_0xc706f1);}});ami['on'](_0xc1d3('0x36'),function(_0x21d7b7){try{utils['debug'](util[_0xc1d3('0x15')](_0xc1d3('0x37'),_0x21d7b7[_0xc1d3('0x1a')]),_0x21d7b7);calls[_0xc1d3('0x36')](_0x21d7b7);recordings[_0xc1d3('0x36')](_0x21d7b7);dials[_0xc1d3('0x36')](_0x21d7b7);}catch(_0x5979c0){utils[_0xc1d3('0x18')](util['format'](_0xc1d3('0x37'),_0x21d7b7[_0xc1d3('0x1a')]),_0x5979c0);}});ami['on'](_0xc1d3('0x38'),function(_0x5388fd){try{utils[_0xc1d3('0x14')](util['format'](_0xc1d3('0x39'),_0x5388fd['uniqueid']),_0x5388fd);calls['newchannel'](_0x5388fd);recordings[_0xc1d3('0x38')](_0x5388fd);}catch(_0x2cb6ad){utils['error'](util[_0xc1d3('0x15')](_0xc1d3('0x39'),_0x5388fd['uniqueid']),_0x2cb6ad);}});ami['on'](_0xc1d3('0x3a'),function(_0x425437){try{utils['debug'](util['format'](_0xc1d3('0x3b'),_0x425437['uniqueid']),_0x425437);dials[_0xc1d3('0x3a')](_0x425437);}catch(_0x3efc50){utils['error'](util[_0xc1d3('0x15')]('[%s]dialbegin',_0x425437[_0xc1d3('0x1a')]),_0x3efc50);}});ami['on'](_0xc1d3('0x3c'),function(_0x1fefdc){try{utils['debug'](util[_0xc1d3('0x15')](_0xc1d3('0x3d'),_0x1fefdc[_0xc1d3('0x1a')]),_0x1fefdc);dials[_0xc1d3('0x3c')](_0x1fefdc);}catch(_0x39afc0){utils[_0xc1d3('0x18')](util[_0xc1d3('0x15')](_0xc1d3('0x3d'),_0x1fefdc[_0xc1d3('0x1a')]),_0x39afc0);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 517c894..e31dfc2 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 _0xb358=['request','then','CreateMemberReport','catch','error','[%s][members][writeDB]','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','split','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','name','internal'];(function(_0x13f196,_0x5e3b46){var _0x247fe4=function(_0x407658){while(--_0x407658){_0x13f196['push'](_0x13f196['shift']());}};_0x247fe4(++_0x5e3b46);}(_0xb358,0x1b5));var _0x8b35=function(_0x8632d7,_0x2199ee){_0x8632d7=_0x8632d7-0x0;var _0x1ec5f2=_0xb358[_0x8632d7];return _0x1ec5f2;};'use strict';var _=require('lodash');var util=require(_0x8b35('0x0'));var utils=require(_0x8b35('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x14ffb6){utils[_0x8b35('0x2')](util[_0x8b35('0x3')](_0x8b35('0x4'),_0x14ffb6[_0x8b35('0x5')],_0x14ffb6[_0x8b35('0x6')],_0x14ffb6[_0x8b35('0x7')],_0x14ffb6[_0x8b35('0x8')],_0x14ffb6[_0x8b35('0x9')],_0x14ffb6['type']));if(_0x14ffb6[_0x8b35('0x6')]){utils[_0x8b35('0xa')](_0x14ffb6[_0x8b35('0x6')])['then'](function(_0x2c3640){if(_0x2c3640){_0x14ffb6[_0x8b35('0x9')]=_0x2c3640[_0x8b35('0xb')];_0x14ffb6[_0x8b35('0xc')]=_0x2c3640['internal'];utils[_0x8b35('0xd')]('CreateMemberReport',_0x14ffb6);}else{utils['getUserByName'](_0x14ffb6['interface']['split']('/')[0x1])[_0x8b35('0xe')](function(_0x3c92a9){if(_0x3c92a9){_0x14ffb6[_0x8b35('0x9')]=_0x3c92a9['name'];_0x14ffb6['internal']=_0x3c92a9[_0x8b35('0xc')];utils[_0x8b35('0xd')](_0x8b35('0xf'),_0x14ffb6);}});}})[_0x8b35('0x10')](function(_0x4e572f){utils[_0x8b35('0x11')](util[_0x8b35('0x3')](_0x8b35('0x12'),_0x14ffb6[_0x8b35('0x5')]),_0x4e572f);});}delete members[_0x14ffb6[_0x8b35('0x6')]];}function startsWith(_0x3254a7,_0x4c4539){return _['some'](_0x3254a7,function(_0x5e53e7){return _[_0x8b35('0x13')](_0x4c4539,_0x5e53e7);});}exports['devicestatechange']=function(_0x5398b3){try{utils[_0x8b35('0x14')](util['format'](_0x8b35('0x15'),members[_0x5398b3[_0x8b35('0x16')]]?members[_0x5398b3[_0x8b35('0x16')]]['uniqueid']:_0x5398b3[_0x8b35('0x16')]),_0x5398b3);utils[_0x8b35('0x2')](util['format'](_0x8b35('0x17'),members[_0x5398b3[_0x8b35('0x16')]]?members[_0x5398b3['device']][_0x8b35('0x5')]:_0x5398b3[_0x8b35('0x16')],_0x5398b3[_0x8b35('0x18')],_0x5398b3[_0x8b35('0x16')]));switch(_0x5398b3['state']){case _0x8b35('0x19'):case _0x8b35('0x1a'):if(!startsWith(exclude,_0x5398b3[_0x8b35('0x16')])){members[_0x5398b3['device']]={'channel':_0x8b35('0x1b'),'interface':_0x5398b3[_0x8b35('0x16')],'type':_0x8b35('0x1c'),'enterAt':utils[_0x8b35('0x1d')](),'role':_0x8b35('0x1e')};}break;case'NOT_INUSE':if(!_[_0x8b35('0x1f')](members[_0x5398b3[_0x8b35('0x16')]])){members[_0x5398b3['device']][_0x8b35('0x20')]=utils[_0x8b35('0x1d')]();members[_0x5398b3[_0x8b35('0x16')]][_0x8b35('0x21')]=utils['diffTime'](members[_0x5398b3[_0x8b35('0x16')]]['exitAt'],members[_0x5398b3[_0x8b35('0x16')]][_0x8b35('0x22')]);if(members[_0x5398b3[_0x8b35('0x16')]][_0x8b35('0x5')]){writeDB(members[_0x5398b3[_0x8b35('0x16')]]);}}break;default:break;}}catch(_0x4e5ecc){utils[_0x8b35('0x11')](util[_0x8b35('0x3')](_0x8b35('0x15'),members[_0x5398b3[_0x8b35('0x16')]]?members[_0x5398b3[_0x8b35('0x16')]][_0x8b35('0x5')]:_0x5398b3[_0x8b35('0x16')]),_0x4e5ecc);}};exports[_0x8b35('0x23')]=function(_0x53dd49){try{if(!_[_0x8b35('0x1f')](members[_0x53dd49[_0x8b35('0x6')]])){utils[_0x8b35('0x14')](util[_0x8b35('0x3')]('[%s][members][agentcomplete]',_0x53dd49[_0x8b35('0x5')]),_0x53dd49);utils['info'](util[_0x8b35('0x3')](_0x8b35('0x24'),_0x53dd49['uniqueid'],_0x53dd49[_0x8b35('0x6')],_0x53dd49[_0x8b35('0x25')]));members[_0x53dd49['interface']]=_[_0x8b35('0x26')](members[_0x53dd49[_0x8b35('0x6')]],{'data4':_0x53dd49['queue'],'uniqueid':_0x53dd49[_0x8b35('0x5')]});}}catch(_0x1345ef){utils['error'](util[_0x8b35('0x3')](_0x8b35('0x27'),_0x53dd49[_0x8b35('0x5')]),_0x1345ef);}};exports[_0x8b35('0x28')]=function(_0x2c2580){try{utils[_0x8b35('0x14')](util['format']('[%s][members][cdr]',_0x2c2580['uniqueid']),_0x2c2580);if(_0x2c2580['channel']){var _0x17eef3=_0x2c2580[_0x8b35('0x7')][_0x8b35('0x29')]('-')[0x0];if(!_['isNil'](members[_0x17eef3])){members[_0x17eef3]=_[_0x8b35('0x26')](members[_0x17eef3],{'data1':members[_0x17eef3][_0x8b35('0x2a')]||_0x2c2580[_0x8b35('0x2b')],'data2':members[_0x17eef3][_0x8b35('0x8')]||_0x2c2580[_0x8b35('0x2c')],'data3':members[_0x17eef3][_0x8b35('0x2d')]||_0x2c2580[_0x8b35('0x2e')],'uniqueid':members[_0x17eef3][_0x8b35('0x5')]||_0x2c2580[_0x8b35('0x5')]});utils[_0x8b35('0x2')](util[_0x8b35('0x3')](_0x8b35('0x2f'),_0x2c2580[_0x8b35('0x5')],members[_0x17eef3]['data1'],members[_0x17eef3][_0x8b35('0x8')],members[_0x17eef3][_0x8b35('0x2d')]));if(members[_0x17eef3][_0x8b35('0x20')]){writeDB(members[_0x17eef3]);}}}if(_0x2c2580[_0x8b35('0x30')]){var _0x52a581=_0x2c2580[_0x8b35('0x30')][_0x8b35('0x29')]('-')[0x0];if(!_[_0x8b35('0x1f')](members[_0x52a581])){members[_0x52a581]=_[_0x8b35('0x26')](members[_0x52a581],{'data1':members[_0x52a581]['data1']||_0x2c2580[_0x8b35('0x2b')],'data2':members[_0x52a581]['data2']||_0x2c2580[_0x8b35('0x2c')],'data3':members[_0x52a581]['data3']||_0x2c2580[_0x8b35('0x2e')],'uniqueid':members[_0x52a581]['uniqueid']||_0x2c2580[_0x8b35('0x5')]});utils[_0x8b35('0x2')](util[_0x8b35('0x3')](_0x8b35('0x2f'),_0x2c2580[_0x8b35('0x5')],members[_0x52a581][_0x8b35('0x2a')],members[_0x52a581][_0x8b35('0x8')],members[_0x52a581][_0x8b35('0x2d')]));if(members[_0x52a581][_0x8b35('0x20')]){writeDB(members[_0x52a581]);}}}}catch(_0x6444f5){utils[_0x8b35('0x11')](util['format'](_0x8b35('0x31'),_0x2c2580[_0x8b35('0x5')]),_0x6444f5);}}; \ No newline at end of file +var _0x2209=['data2','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','catch','error','[%s][members][writeDB]','some','format','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','enterAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','debug','assign','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data3','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel'];(function(_0x307e58,_0x45417d){var _0x56f17e=function(_0x2431ee){while(--_0x2431ee){_0x307e58['push'](_0x307e58['shift']());}};_0x56f17e(++_0x45417d);}(_0x2209,0x95));var _0x9220=function(_0x3791a6,_0x514f2c){_0x3791a6=_0x3791a6-0x0;var _0x5a57d5=_0x2209[_0x3791a6];return _0x5a57d5;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var utils=require(_0x9220('0x2'));var members={};var exclude=[_0x9220('0x3'),_0x9220('0x4')];function writeDB(_0x5d3fe2){utils[_0x9220('0x5')](util['format'](_0x9220('0x6'),_0x5d3fe2[_0x9220('0x7')],_0x5d3fe2[_0x9220('0x8')],_0x5d3fe2[_0x9220('0x9')],_0x5d3fe2[_0x9220('0xa')],_0x5d3fe2[_0x9220('0xb')],_0x5d3fe2[_0x9220('0xc')]));if(_0x5d3fe2[_0x9220('0x8')]){utils[_0x9220('0xd')](_0x5d3fe2['interface'])[_0x9220('0xe')](function(_0x1acce5){if(_0x1acce5){_0x5d3fe2['membername']=_0x1acce5[_0x9220('0xf')];_0x5d3fe2[_0x9220('0x10')]=_0x1acce5[_0x9220('0x10')];utils[_0x9220('0x11')]('CreateMemberReport',_0x5d3fe2);}else{utils[_0x9220('0x12')](_0x5d3fe2[_0x9220('0x8')][_0x9220('0x13')]('/')[0x1])[_0x9220('0xe')](function(_0x2c5d71){if(_0x2c5d71){_0x5d3fe2[_0x9220('0xb')]=_0x2c5d71[_0x9220('0xf')];_0x5d3fe2[_0x9220('0x10')]=_0x2c5d71['internal'];utils[_0x9220('0x11')]('CreateMemberReport',_0x5d3fe2);}});}})[_0x9220('0x14')](function(_0x596018){utils[_0x9220('0x15')](util['format'](_0x9220('0x16'),_0x5d3fe2[_0x9220('0x7')]),_0x596018);});}delete members[_0x5d3fe2[_0x9220('0x8')]];}function startsWith(_0x1f7bf7,_0x493744){return _[_0x9220('0x17')](_0x1f7bf7,function(_0x1f484b){return _['startsWith'](_0x493744,_0x1f484b);});}exports['devicestatechange']=function(_0x3c3473){try{utils['debug'](util[_0x9220('0x18')](_0x9220('0x19'),members[_0x3c3473[_0x9220('0x1a')]]?members[_0x3c3473['device']][_0x9220('0x7')]:_0x3c3473[_0x9220('0x1a')]),_0x3c3473);utils['info'](util[_0x9220('0x18')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3c3473['device']]?members[_0x3c3473[_0x9220('0x1a')]][_0x9220('0x7')]:_0x3c3473[_0x9220('0x1a')],_0x3c3473[_0x9220('0x1b')],_0x3c3473[_0x9220('0x1a')]));switch(_0x3c3473[_0x9220('0x1b')]){case _0x9220('0x1c'):case _0x9220('0x1d'):if(!startsWith(exclude,_0x3c3473[_0x9220('0x1a')])){members[_0x3c3473[_0x9220('0x1a')]]={'channel':_0x9220('0x1e'),'interface':_0x3c3473[_0x9220('0x1a')],'type':_0x9220('0x1f'),'enterAt':utils['now'](),'role':_0x9220('0x20')};}break;case _0x9220('0x21'):if(!_[_0x9220('0x22')](members[_0x3c3473[_0x9220('0x1a')]])){members[_0x3c3473['device']][_0x9220('0x23')]=utils[_0x9220('0x24')]();members[_0x3c3473[_0x9220('0x1a')]][_0x9220('0x25')]=utils[_0x9220('0x26')](members[_0x3c3473[_0x9220('0x1a')]]['exitAt'],members[_0x3c3473[_0x9220('0x1a')]][_0x9220('0x27')]);if(members[_0x3c3473[_0x9220('0x1a')]][_0x9220('0x7')]){writeDB(members[_0x3c3473['device']]);}}break;default:break;}}catch(_0x5e6918){utils[_0x9220('0x15')](util[_0x9220('0x18')](_0x9220('0x19'),members[_0x3c3473['device']]?members[_0x3c3473['device']][_0x9220('0x7')]:_0x3c3473[_0x9220('0x1a')]),_0x5e6918);}};exports['agentcomplete']=function(_0x44dffb){try{if(!_[_0x9220('0x22')](members[_0x44dffb[_0x9220('0x8')]])){utils['debug'](util[_0x9220('0x18')](_0x9220('0x28'),_0x44dffb[_0x9220('0x7')]),_0x44dffb);utils[_0x9220('0x5')](util[_0x9220('0x18')](_0x9220('0x29'),_0x44dffb[_0x9220('0x7')],_0x44dffb[_0x9220('0x8')],_0x44dffb[_0x9220('0x2a')]));members[_0x44dffb[_0x9220('0x8')]]=_['assign'](members[_0x44dffb[_0x9220('0x8')]],{'data4':_0x44dffb[_0x9220('0x2a')],'uniqueid':_0x44dffb['uniqueid']});}}catch(_0x4a400a){utils[_0x9220('0x15')](util['format'](_0x9220('0x28'),_0x44dffb[_0x9220('0x7')]),_0x4a400a);}};exports[_0x9220('0x2b')]=function(_0x4110c8){try{utils[_0x9220('0x2c')](util[_0x9220('0x18')]('[%s][members][cdr]',_0x4110c8[_0x9220('0x7')]),_0x4110c8);if(_0x4110c8[_0x9220('0x9')]){var _0xfb77d1=_0x4110c8[_0x9220('0x9')][_0x9220('0x13')]('-')[0x0];if(!_[_0x9220('0x22')](members[_0xfb77d1])){members[_0xfb77d1]=_[_0x9220('0x2d')](members[_0xfb77d1],{'data1':members[_0xfb77d1]['data1']||_0x4110c8['type'],'data2':members[_0xfb77d1]['data2']||_0x4110c8[_0x9220('0x2e')],'data3':members[_0xfb77d1]['data3']||_0x4110c8[_0x9220('0x2f')],'uniqueid':members[_0xfb77d1][_0x9220('0x7')]||_0x4110c8[_0x9220('0x7')]});utils[_0x9220('0x5')](util['format'](_0x9220('0x30'),_0x4110c8[_0x9220('0x7')],members[_0xfb77d1][_0x9220('0x31')],members[_0xfb77d1][_0x9220('0xa')],members[_0xfb77d1][_0x9220('0x32')]));if(members[_0xfb77d1][_0x9220('0x23')]){writeDB(members[_0xfb77d1]);}}}if(_0x4110c8[_0x9220('0x33')]){var _0x2a4549=_0x4110c8['destinationchannel']['split']('-')[0x0];if(!_[_0x9220('0x22')](members[_0x2a4549])){members[_0x2a4549]=_[_0x9220('0x2d')](members[_0x2a4549],{'data1':members[_0x2a4549][_0x9220('0x31')]||_0x4110c8[_0x9220('0xc')],'data2':members[_0x2a4549][_0x9220('0xa')]||_0x4110c8['source'],'data3':members[_0x2a4549]['data3']||_0x4110c8[_0x9220('0x2f')],'uniqueid':members[_0x2a4549][_0x9220('0x7')]||_0x4110c8[_0x9220('0x7')]});utils[_0x9220('0x5')](util[_0x9220('0x18')](_0x9220('0x30'),_0x4110c8[_0x9220('0x7')],members[_0x2a4549][_0x9220('0x31')],members[_0x2a4549][_0x9220('0xa')],members[_0x2a4549]['data3']));if(members[_0x2a4549][_0x9220('0x23')]){writeDB(members[_0x2a4549]);}}}}catch(_0x3d3410){utils[_0x9220('0x15')](util['format'](_0x9220('0x34'),_0x4110c8[_0x9220('0x7')]),_0x3d3410);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 220d335..1e2f2ee 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 _0x2d83=['queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','origtransfererlinkedid','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon'];(function(_0x1a24b1,_0x228b04){var _0xd5c758=function(_0xc427b){while(--_0xc427b){_0x1a24b1['push'](_0x1a24b1['shift']());}};_0xd5c758(++_0x228b04);}(_0x2d83,0x18f));var _0x32d8=function(_0x197cd0,_0x5b1f91){_0x197cd0=_0x197cd0-0x0;var _0x1f3627=_0x2d83[_0x197cd0];return _0x1f3627;};'use strict';var _=require(_0x32d8('0x0'));var util=require(_0x32d8('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x250c77){utils['info'](util[_0x32d8('0x2')](_0x32d8('0x3'),_0x250c77[_0x32d8('0x4')],_0x250c77[_0x32d8('0x5')],_0x250c77[_0x32d8('0x6')],_0x250c77[_0x32d8('0x7')],_0x250c77[_0x32d8('0x8')],_0x250c77[_0x32d8('0x9')],_0x250c77[_0x32d8('0xa')]));if(_0x250c77['queue']){utils[_0x32d8('0xb')](_0x250c77[_0x32d8('0x6')])[_0x32d8('0xc')](function(_0x5b031e){if(_0x5b031e){_0x250c77[_0x32d8('0xd')]=_0x5b031e[_0x32d8('0xd')];}utils[_0x32d8('0xe')](_0x32d8('0xf'),_0x250c77);});}else{utils['request'](_0x32d8('0xf'),_0x250c77);}if(_0x250c77[_0x32d8('0x10')]){delete queues[_0x250c77[_0x32d8('0x10')]];}else{delete queues[_0x250c77['uniqueid']];}}exports[_0x32d8('0x11')]=function(_0x1ef502){try{utils[_0x32d8('0x12')](util['format'](_0x32d8('0x13'),_0x1ef502[_0x32d8('0x4')]),_0x1ef502);utils['info'](util[_0x32d8('0x2')](_0x32d8('0x14'),_0x1ef502['uniqueid'],_0x1ef502[_0x32d8('0x6')],_0x1ef502[_0x32d8('0x15')]));queues[_0x1ef502[_0x32d8('0x4')]]=_[_0x32d8('0x16')](_0x1ef502,{'originalposition':_0x1ef502['position'],'queuecallerjoinAt':utils[_0x32d8('0x17')](),'mohtime':0x0});}catch(_0x2e962c){utils[_0x32d8('0x18')](util[_0x32d8('0x2')]('[%s][queues][queuecallerjoin]',_0x1ef502[_0x32d8('0x4')]),_0x2e962c);}};exports[_0x32d8('0x19')]=function(_0x204d53){try{if(!_[_0x32d8('0x1a')](queues[_0x204d53[_0x32d8('0x4')]])){utils['debug'](util[_0x32d8('0x2')](_0x32d8('0x1b'),_0x204d53[_0x32d8('0x4')]),_0x204d53);if(queues[_0x204d53[_0x32d8('0x4')]]['queuecallerleaveAt']){if(!queues[_0x204d53['uniqueid']][_0x32d8('0x1c')]&&!queues[_0x204d53['uniqueid']][_0x32d8('0x1d')]){queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0x1e')]=!![];queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0x1f')]=utils['now']();queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0xa')]=_0x32d8('0x20');}utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x22'),_0x204d53[_0x32d8('0x4')],queues[_0x204d53[_0x32d8('0x4')]]['name'],queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0xa')]));writeDB(queues[_0x204d53[_0x32d8('0x4')]]);}else if(queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0x10')]){utils['info'](util[_0x32d8('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x204d53[_0x32d8('0x4')],queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0x23')],queues[_0x204d53['uniqueid']][_0x32d8('0x10')]));queues[queues[_0x204d53['uniqueid']]['transfereduniqueid']]=queues[_0x204d53['uniqueid']];queues[queues[_0x204d53[_0x32d8('0x4')]][_0x32d8('0x10')]][_0x32d8('0x24')]=0x2;delete queues[_0x204d53[_0x32d8('0x4')]];}}}catch(_0x2e57b1){utils[_0x32d8('0x18')](util[_0x32d8('0x2')](_0x32d8('0x1b'),_0x204d53['uniqueid']),_0x2e57b1);}};exports['varset']=function(_0x4e82d3){try{utils[_0x32d8('0x12')](util['format'](_0x32d8('0x25'),_0x4e82d3[_0x32d8('0x4')]),_0x4e82d3);if(!_[_0x32d8('0x1a')](_0x4e82d3[_0x32d8('0x26')][_0x32d8('0x27')])&&_0x4e82d3[_0x32d8('0x28')][_0x32d8('0x29')]()!==_0x32d8('0x2a')){if(!_[_0x32d8('0x1a')](queues[_0x4e82d3['uniqueid']])){queues[_0x4e82d3['uniqueid']][_0x32d8('0x1c')]=![];queues[_0x4e82d3['uniqueid']][_0x32d8('0x2b')]=null;queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x1d')]=!![];queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x2c')]=utils['now']();queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0xa')]=_0x4e82d3[_0x32d8('0x28')][_0x32d8('0x29')]();utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x2d'),_0x4e82d3[_0x32d8('0x4')],queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x23')],_0x4e82d3[_0x32d8('0x28')],queues[_0x4e82d3['uniqueid']][_0x32d8('0xa')]));writeDB(queues[_0x4e82d3['uniqueid']]);}}else if(!_['isNil'](_0x4e82d3['variable'][_0x32d8('0x2e')])){if(!_[_0x32d8('0x1a')](queues[_0x4e82d3['uniqueid']])&&!queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x1c')]){queues[_0x4e82d3['uniqueid']]['queuecallerabandon']=![];queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x2b')]=null;queues[_0x4e82d3[_0x32d8('0x4')]]['queuecallerexit']=!![];queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0x2c')]=utils['now']();queues[_0x4e82d3[_0x32d8('0x4')]][_0x32d8('0xa')]='EXITWITHKEY';utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x2f'),_0x4e82d3[_0x32d8('0x4')],queues[_0x4e82d3[_0x32d8('0x4')]]['name'],_0x4e82d3['value'],queues[_0x4e82d3[_0x32d8('0x4')]]['queuecallerexitreason']));}}}catch(_0x37b00c){utils['error'](util[_0x32d8('0x2')](_0x32d8('0x25'),_0x4e82d3[_0x32d8('0x4')]),_0x37b00c);}};exports['queuecallerabandon']=function(_0x3f09d7){try{if(!_['isNil'](queues[_0x3f09d7[_0x32d8('0x4')]])){utils[_0x32d8('0x12')](util[_0x32d8('0x2')](_0x32d8('0x30'),_0x3f09d7[_0x32d8('0x4')]),_0x3f09d7);queues[_0x3f09d7['uniqueid']][_0x32d8('0x1d')]=![];queues[_0x3f09d7[_0x32d8('0x4')]][_0x32d8('0x2c')]=null;queues[_0x3f09d7['uniqueid']][_0x32d8('0x1c')]=!![];queues[_0x3f09d7[_0x32d8('0x4')]][_0x32d8('0x2b')]=utils[_0x32d8('0x17')]();queues[_0x3f09d7[_0x32d8('0x4')]][_0x32d8('0xa')]='ABANDONED';utils[_0x32d8('0x21')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3f09d7[_0x32d8('0x4')],queues[_0x3f09d7[_0x32d8('0x4')]][_0x32d8('0x23')],queues[_0x3f09d7[_0x32d8('0x4')]][_0x32d8('0xa')]));}}catch(_0x1bf635){utils['error'](util['format'](_0x32d8('0x30'),_0x3f09d7['uniqueid']),_0x1bf635);}};exports[_0x32d8('0x31')]=function(_0x34d476){try{if(!_[_0x32d8('0x1a')](queues[_0x34d476[_0x32d8('0x4')]])){utils[_0x32d8('0x12')](util[_0x32d8('0x2')](_0x32d8('0x32'),_0x34d476[_0x32d8('0x4')]),_0x34d476);utils[_0x32d8('0x21')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x34d476[_0x32d8('0x4')],queues[_0x34d476[_0x32d8('0x4')]][_0x32d8('0x23')],_0x34d476[_0x32d8('0x33')],_0x34d476[_0x32d8('0x34')]));queues[_0x34d476[_0x32d8('0x4')]][_0x32d8('0x31')]=!![];queues[_0x34d476[_0x32d8('0x4')]][_0x32d8('0x35')]=utils[_0x32d8('0x17')]();queues[_0x34d476[_0x32d8('0x4')]][_0x32d8('0x36')]=utils['diffTime'](queues[_0x34d476['uniqueid']][_0x32d8('0x35')],queues[_0x34d476[_0x32d8('0x4')]][_0x32d8('0x37')]);queues[_0x34d476[_0x32d8('0x4')]]['position']=_0x34d476[_0x32d8('0x15')];queues[_0x34d476[_0x32d8('0x4')]]['count']=_0x34d476[_0x32d8('0x38')];queues[_0x34d476['uniqueid']][_0x32d8('0x33')]=_0x34d476[_0x32d8('0x33')];queues[_0x34d476['uniqueid']][_0x32d8('0x34')]=_0x34d476[_0x32d8('0x34')];}}catch(_0x2b1f87){utils[_0x32d8('0x18')](util[_0x32d8('0x2')]('[%s][queues][queuecallerleave]',_0x34d476[_0x32d8('0x4')]),_0x2b1f87);}};exports[_0x32d8('0x39')]=function(_0x10562d){try{if(!_[_0x32d8('0x1a')](queues[_0x10562d[_0x32d8('0x4')]])){utils[_0x32d8('0x12')](util[_0x32d8('0x2')](_0x32d8('0x3a'),_0x10562d['uniqueid']),_0x10562d);utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x3b'),_0x10562d[_0x32d8('0x4')],queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x23')],_0x10562d[_0x32d8('0x3c')],_0x10562d[_0x32d8('0x3d')]));queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x1c')]=![];queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x1c')]=![];queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x2b')]=null;queues[_0x10562d[_0x32d8('0x4')]]['queuecallerexit']=![];queues[_0x10562d[_0x32d8('0x4')]]['queuecallerexitreason']=null;queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x2c')]=null;queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x3e')]=!![];queues[_0x10562d['uniqueid']]['accountcode']=_0x10562d[_0x32d8('0x3d')];queues[_0x10562d[_0x32d8('0x4')]][_0x32d8('0x7')]=_0x10562d['membername'];}}catch(_0x1042d5){utils[_0x32d8('0x18')](util[_0x32d8('0x2')](_0x32d8('0x3a'),_0x10562d['uniqueid']),_0x1042d5);}};exports[_0x32d8('0x3f')]=function(_0x3b9629){try{if(!_[_0x32d8('0x1a')](queues[_0x3b9629[_0x32d8('0x4')]])){if(queues[_0x3b9629['uniqueid']][_0x32d8('0x35')]){utils[_0x32d8('0x12')](util['format']('[%s][queues][agentcomplete]',_0x3b9629['uniqueid']),_0x3b9629);queues[_0x3b9629[_0x32d8('0x4')]]['queuecallerabandon']=![];queues[_0x3b9629[_0x32d8('0x4')]][_0x32d8('0x1c')]=![];queues[_0x3b9629['uniqueid']][_0x32d8('0x2b')]=null;queues[_0x3b9629['uniqueid']]['queuecallerexit']=![];queues[_0x3b9629[_0x32d8('0x4')]]['queuecallerexitAt']=null;queues[_0x3b9629[_0x32d8('0x4')]][_0x32d8('0x3e')]=!![];queues[_0x3b9629[_0x32d8('0x4')]]['lastAssignedTo']=_0x3b9629[_0x32d8('0x3c')];queues[_0x3b9629[_0x32d8('0x4')]]['queuecallercomplete']=!![];queues[_0x3b9629[_0x32d8('0x4')]][_0x32d8('0x1f')]=utils['now']();if(_0x3b9629['reason']==_0x32d8('0x40')){if(!queues[_0x3b9629[_0x32d8('0x4')]]['transfer']){queues[_0x3b9629[_0x32d8('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x3b9629[_0x32d8('0x4')]]['queuecallerexitreason']=_0x32d8('0x41')+_0x3b9629['reason']['toUpperCase']();}utils['info'](util[_0x32d8('0x2')](_0x32d8('0x42'),_0x3b9629[_0x32d8('0x4')],queues[_0x3b9629[_0x32d8('0x4')]]['name'],_0x3b9629[_0x32d8('0x3c')],queues[_0x3b9629[_0x32d8('0x4')]][_0x32d8('0xa')]));writeDB(queues[_0x3b9629['uniqueid']]);}}}catch(_0x29d485){utils[_0x32d8('0x18')](util[_0x32d8('0x2')](_0x32d8('0x43'),_0x3b9629[_0x32d8('0x4')]),_0x29d485);}};exports[_0x32d8('0x44')]=function(_0x40c445){try{if(!_[_0x32d8('0x1a')](queues[_0x40c445[_0x32d8('0x45')]])){utils[_0x32d8('0x12')](util['format'](_0x32d8('0x46'),_0x40c445['uniqueid']),_0x40c445);queues[_0x40c445[_0x32d8('0x45')]][_0x32d8('0x40')]=!![];queues[_0x40c445[_0x32d8('0x45')]][_0x32d8('0x47')]=_0x32d8('0x48');queues[_0x40c445[_0x32d8('0x45')]][_0x32d8('0x49')]=_0x40c445[_0x32d8('0x4a')];queues[_0x40c445[_0x32d8('0x45')]][_0x32d8('0x4b')]=_0x40c445[_0x32d8('0x45')];queues[_0x40c445[_0x32d8('0x45')]][_0x32d8('0xa')]=_0x32d8('0x4c');utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x4d'),_0x40c445[_0x32d8('0x4')],queues[_0x40c445['transfereeuniqueid']][_0x32d8('0x23')],_0x40c445['transfereeuniqueid'],_0x40c445[_0x32d8('0x4a')]));}}catch(_0x1a268b){utils[_0x32d8('0x18')](util[_0x32d8('0x2')](_0x32d8('0x46'),_0x40c445[_0x32d8('0x4')]),_0x1a268b);}};exports[_0x32d8('0x4e')]=function(_0x4a366e){try{utils['debug'](util[_0x32d8('0x2')](_0x32d8('0x4f'),_0x4a366e[_0x32d8('0x50')]),_0x4a366e);if(_0x4a366e[_0x32d8('0x50')]==_0x4a366e['origtransfererlinkedid']){if(!_['isNil'](queues[_0x4a366e['secondtransfererlinkedid']])){utils['info'](util['format'](_0x32d8('0x51'),_0x4a366e[_0x32d8('0x50')],queues[_0x4a366e[_0x32d8('0x52')]][_0x32d8('0x23')],_0x4a366e[_0x32d8('0x53')]));queues[_0x4a366e[_0x32d8('0x52')]][_0x32d8('0x40')]=!![];queues[_0x4a366e[_0x32d8('0x52')]][_0x32d8('0x47')]=_0x32d8('0x54');queues[_0x4a366e['secondtransfererlinkedid']][_0x32d8('0x49')]=_0x4a366e['origtransfererexten'];queues[_0x4a366e[_0x32d8('0x52')]][_0x32d8('0x4b')]=_0x4a366e[_0x32d8('0x50')];queues[_0x4a366e[_0x32d8('0x52')]][_0x32d8('0xa')]=_0x32d8('0x55');}if(!_[_0x32d8('0x1a')](queues[_0x4a366e['origtransfererlinkedid']])){if(_0x4a366e[_0x32d8('0x56')]&&queues[_0x4a366e['transfereelinkedid']]){queues[_0x4a366e['transfereelinkedid']][_0x32d8('0x24')]=0x1;queues[_0x4a366e[_0x32d8('0x45')]]=_[_0x32d8('0x57')](queues[_0x4a366e[_0x32d8('0x56')]]);queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x10')]=_0x4a366e[_0x32d8('0x58')];queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x24')]=0x2;queues[_0x4a366e[_0x32d8('0x45')]][_0x32d8('0x8')]=queues[_0x4a366e[_0x32d8('0x52')]]['calleridnum'];queues[_0x4a366e[_0x32d8('0x45')]][_0x32d8('0x59')]=queues[_0x4a366e['secondtransfererlinkedid']][_0x32d8('0x59')];queues[_0x4a366e[_0x32d8('0x45')]]['queuecallerjoinAt']=utils['now']();queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x35')]=utils[_0x32d8('0x17')]();queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x36')]=0x0;queues[_0x4a366e[_0x32d8('0x45')]][_0x32d8('0x5a')]=0x0;utils[_0x32d8('0x21')](util['format'](_0x32d8('0x5b'),_0x4a366e[_0x32d8('0x50')],queues[_0x4a366e[_0x32d8('0x45')]][_0x32d8('0x23')],queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x8')],queues[_0x4a366e['transfereeuniqueid']][_0x32d8('0x59')]));}else{utils[_0x32d8('0x21')](util[_0x32d8('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4a366e['origtransfereruniqueid'],queues[_0x4a366e[_0x32d8('0x5c')]]['name'],_0x4a366e[_0x32d8('0x52')]));queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x10')]=_0x4a366e[_0x32d8('0x52')];}}}else if(_0x4a366e[_0x32d8('0x5d')]==_0x4a366e[_0x32d8('0x52')]){if(!_[_0x32d8('0x1a')](queues[_0x4a366e[_0x32d8('0x5c')]])){utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x5e'),_0x4a366e['origtransfereruniqueid'],queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x23')],_0x4a366e[_0x32d8('0x5d')],_0x4a366e[_0x32d8('0x5f')]));queues[_0x4a366e[_0x32d8('0x5c')]]['transfer']=!![];queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x47')]=_0x32d8('0x54');queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x49')]=_0x4a366e[_0x32d8('0x5f')];queues[_0x4a366e['origtransfererlinkedid']][_0x32d8('0x4b')]=_0x4a366e[_0x32d8('0x5d')];queues[_0x4a366e['origtransfererlinkedid']][_0x32d8('0xa')]=_0x32d8('0x55');}if(!_[_0x32d8('0x1a')](queues[_0x4a366e[_0x32d8('0x52')]])){if(_0x4a366e[_0x32d8('0x60')]&&queues[_0x4a366e[_0x32d8('0x60')]]){queues[_0x4a366e[_0x32d8('0x60')]]['queuecallerenterreason']=0x1;queues[_0x4a366e[_0x32d8('0x58')]]=_['clone'](queues[_0x4a366e[_0x32d8('0x60')]]);queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x10')]=_0x4a366e['transfertargetuniqueid'];queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x24')]=0x2;queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x8')]=queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x8')];queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x59')]=queues[_0x4a366e[_0x32d8('0x5c')]][_0x32d8('0x59')];queues[_0x4a366e[_0x32d8('0x58')]]['queuecallerjoinAt']=utils[_0x32d8('0x17')]();queues[_0x4a366e['transfertargetuniqueid']][_0x32d8('0x35')]=utils[_0x32d8('0x17')]();queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x36')]=0x0;queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x5a')]=0x0;utils[_0x32d8('0x21')](util[_0x32d8('0x2')](_0x32d8('0x61'),_0x4a366e[_0x32d8('0x50')],queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x23')],queues[_0x4a366e[_0x32d8('0x58')]]['transfereduniqueid'],queues[_0x4a366e[_0x32d8('0x58')]][_0x32d8('0x8')],queues[_0x4a366e['transfertargetuniqueid']]['calleridname']));}else{utils[_0x32d8('0x21')](util['format'](_0x32d8('0x62'),_0x4a366e[_0x32d8('0x50')],queues[_0x4a366e['secondtransfererlinkedid']]['name'],_0x4a366e['origtransfererlinkedid']));queues[_0x4a366e['secondtransfererlinkedid']][_0x32d8('0x10')]=_0x4a366e[_0x32d8('0x5c')];}}}}catch(_0x2a9155){utils['error'](util[_0x32d8('0x2')]('[%s][queues][attendedtransfer]',_0x4a366e[_0x32d8('0x50')]),_0x2a9155);}};exports[_0x32d8('0x63')]=function(_0x27bdc9){try{if(!_[_0x32d8('0x1a')](queues[_0x27bdc9[_0x32d8('0x4')]])){utils[_0x32d8('0x12')](util[_0x32d8('0x2')](_0x32d8('0x64'),_0x27bdc9[_0x32d8('0x4')]),_0x27bdc9);queues[_0x27bdc9[_0x32d8('0x4')]][_0x32d8('0x65')]=utils['now']();utils[_0x32d8('0x21')](util['format'](_0x32d8('0x66'),_0x27bdc9[_0x32d8('0x4')],queues[_0x27bdc9['uniqueid']][_0x32d8('0x23')],queues[_0x27bdc9[_0x32d8('0x4')]]['musiconholdstartAt']));}}catch(_0xe5b2ef){utils[_0x32d8('0x18')](util[_0x32d8('0x2')]('[%s][queues][musiconholdstart]',_0x27bdc9[_0x32d8('0x4')]),_0xe5b2ef);}};exports[_0x32d8('0x67')]=function(_0x2a9cca){try{if(!_['isNil'](queues[_0x2a9cca[_0x32d8('0x4')]])){if(!_[_0x32d8('0x1a')](queues[_0x2a9cca[_0x32d8('0x4')]]['musiconholdstartAt'])){utils['debug'](util['format'](_0x32d8('0x68'),_0x2a9cca[_0x32d8('0x4')]),_0x2a9cca);queues[_0x2a9cca[_0x32d8('0x4')]][_0x32d8('0x5a')]+=utils[_0x32d8('0x69')](utils[_0x32d8('0x17')](),queues[_0x2a9cca[_0x32d8('0x4')]]['musiconholdstartAt']);utils['info'](util[_0x32d8('0x2')](_0x32d8('0x6a'),_0x2a9cca['uniqueid'],queues[_0x2a9cca[_0x32d8('0x4')]][_0x32d8('0x23')],queues[_0x2a9cca['uniqueid']][_0x32d8('0x5a')]));delete queues[_0x2a9cca[_0x32d8('0x4')]]['musiconholdstartAt'];}}}catch(_0x2b9b6c){utils[_0x32d8('0x18')](util[_0x32d8('0x2')](_0x32d8('0x68'),_0x2a9cca[_0x32d8('0x4')]),_0x2b9b6c);}}; \ No newline at end of file +var _0xe31a=['ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','membername','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfer','transfertype','BLIND','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','position','assign','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','now','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]'];(function(_0x4fbfad,_0x3c2980){var _0x9527f4=function(_0x22bcba){while(--_0x22bcba){_0x4fbfad['push'](_0x4fbfad['shift']());}};_0x9527f4(++_0x3c2980);}(_0xe31a,0x17f));var _0xae31=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe31a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xae31('0x0'));var util=require(_0xae31('0x1'));var utils=require(_0xae31('0x2'));var queues={};function writeDB(_0x478f15){utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x5'),_0x478f15[_0xae31('0x6')],_0x478f15[_0xae31('0x7')],_0x478f15[_0xae31('0x8')],_0x478f15[_0xae31('0x9')],_0x478f15[_0xae31('0xa')],_0x478f15[_0xae31('0xb')],_0x478f15['queuecallerexitreason']));if(_0x478f15['queue']){utils['getVoiceQueueByName'](_0x478f15[_0xae31('0x8')])[_0xae31('0xc')](function(_0x283da5){if(_0x283da5){_0x478f15[_0xae31('0xd')]=_0x283da5['type'];}utils[_0xae31('0xe')](_0xae31('0xf'),_0x478f15);});}else{utils['request']('CreateVoiceQueueReport',_0x478f15);}if(_0x478f15[_0xae31('0x10')]){delete queues[_0x478f15['transfereduniqueid']];}else{delete queues[_0x478f15[_0xae31('0x6')]];}}exports[_0xae31('0x11')]=function(_0x5cb13f){try{utils['debug'](util['format'](_0xae31('0x12'),_0x5cb13f[_0xae31('0x6')]),_0x5cb13f);utils[_0xae31('0x3')](util[_0xae31('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x5cb13f[_0xae31('0x6')],_0x5cb13f[_0xae31('0x8')],_0x5cb13f[_0xae31('0x13')]));queues[_0x5cb13f['uniqueid']]=_[_0xae31('0x14')](_0x5cb13f,{'originalposition':_0x5cb13f[_0xae31('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x523512){utils[_0xae31('0x15')](util[_0xae31('0x4')]('[%s][queues][queuecallerjoin]',_0x5cb13f['uniqueid']),_0x523512);}};exports[_0xae31('0x16')]=function(_0xc9da19){try{if(!_[_0xae31('0x17')](queues[_0xc9da19[_0xae31('0x6')]])){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x19'),_0xc9da19[_0xae31('0x6')]),_0xc9da19);if(queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x1a')]){if(!queues[_0xc9da19['uniqueid']]['queuecallerabandon']&&!queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x1b')]){queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x1c')]=!![];queues[_0xc9da19[_0xae31('0x6')]]['queuecallercompleteAt']=utils[_0xae31('0x1d')]();queues[_0xc9da19['uniqueid']][_0xae31('0x1e')]='COMPLETEDBYAGENT';}utils[_0xae31('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0xc9da19[_0xae31('0x6')],queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x1f')],queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x1e')]));writeDB(queues[_0xc9da19[_0xae31('0x6')]]);}else if(queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x10')]){utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x20'),_0xc9da19[_0xae31('0x6')],queues[_0xc9da19['uniqueid']][_0xae31('0x1f')],queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x10')]));queues[queues[_0xc9da19[_0xae31('0x6')]][_0xae31('0x10')]]=queues[_0xc9da19[_0xae31('0x6')]];queues[queues[_0xc9da19[_0xae31('0x6')]]['transfereduniqueid']][_0xae31('0x21')]=0x2;delete queues[_0xc9da19[_0xae31('0x6')]];}}}catch(_0xc851b2){utils['error'](util[_0xae31('0x4')](_0xae31('0x19'),_0xc9da19[_0xae31('0x6')]),_0xc851b2);}};exports[_0xae31('0x22')]=function(_0x12088f){try{utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x23'),_0x12088f[_0xae31('0x6')]),_0x12088f);if(!_[_0xae31('0x17')](_0x12088f[_0xae31('0x24')][_0xae31('0x25')])&&_0x12088f[_0xae31('0x26')][_0xae31('0x27')]()!==_0xae31('0x28')){if(!_[_0xae31('0x17')](queues[_0x12088f[_0xae31('0x6')]])){queues[_0x12088f[_0xae31('0x6')]]['queuecallerabandon']=![];queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x29')]=null;queues[_0x12088f['uniqueid']]['queuecallerexit']=!![];queues[_0x12088f['uniqueid']][_0xae31('0x2a')]=utils['now']();queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x1e')]=_0x12088f['value'][_0xae31('0x27')]();utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x2b'),_0x12088f[_0xae31('0x6')],queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x1f')],_0x12088f['value'],queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x1e')]));writeDB(queues[_0x12088f[_0xae31('0x6')]]);}}else if(!_[_0xae31('0x17')](_0x12088f[_0xae31('0x24')][_0xae31('0x2c')])){if(!_['isNil'](queues[_0x12088f[_0xae31('0x6')]])&&!queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x2d')]){queues[_0x12088f[_0xae31('0x6')]]['queuecallerabandon']=![];queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x29')]=null;queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x1b')]=!![];queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x2a')]=utils[_0xae31('0x1d')]();queues[_0x12088f['uniqueid']][_0xae31('0x1e')]=_0xae31('0x2e');utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x2f'),_0x12088f[_0xae31('0x6')],queues[_0x12088f['uniqueid']][_0xae31('0x1f')],_0x12088f['value'],queues[_0x12088f[_0xae31('0x6')]][_0xae31('0x1e')]));}}}catch(_0x2dac8a){utils[_0xae31('0x15')](util['format'](_0xae31('0x23'),_0x12088f['uniqueid']),_0x2dac8a);}};exports[_0xae31('0x2d')]=function(_0x295948){try{if(!_[_0xae31('0x17')](queues[_0x295948[_0xae31('0x6')]])){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x30'),_0x295948[_0xae31('0x6')]),_0x295948);queues[_0x295948[_0xae31('0x6')]][_0xae31('0x1b')]=![];queues[_0x295948[_0xae31('0x6')]]['queuecallerexitAt']=null;queues[_0x295948[_0xae31('0x6')]]['queuecallerabandon']=!![];queues[_0x295948[_0xae31('0x6')]][_0xae31('0x29')]=utils['now']();queues[_0x295948['uniqueid']][_0xae31('0x1e')]=_0xae31('0x31');utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x32'),_0x295948[_0xae31('0x6')],queues[_0x295948[_0xae31('0x6')]]['name'],queues[_0x295948['uniqueid']][_0xae31('0x1e')]));}}catch(_0x1cf692){utils[_0xae31('0x15')](util['format'](_0xae31('0x30'),_0x295948['uniqueid']),_0x1cf692);}};exports['queuecallerleave']=function(_0x4d2d1b){try{if(!_['isNil'](queues[_0x4d2d1b[_0xae31('0x6')]])){utils[_0xae31('0x18')](util['format'](_0xae31('0x33'),_0x4d2d1b[_0xae31('0x6')]),_0x4d2d1b);utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x34'),_0x4d2d1b['uniqueid'],queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x1f')],_0x4d2d1b[_0xae31('0x35')],_0x4d2d1b[_0xae31('0x36')]));queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x37')]=!![];queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x1a')]=utils[_0xae31('0x1d')]();queues[_0x4d2d1b['uniqueid']][_0xae31('0x38')]=utils[_0xae31('0x39')](queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x1a')],queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x3a')]);queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x13')]=_0x4d2d1b['position'];queues[_0x4d2d1b['uniqueid']][_0xae31('0x3b')]=_0x4d2d1b[_0xae31('0x3b')];queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x35')]=_0x4d2d1b[_0xae31('0x35')];queues[_0x4d2d1b[_0xae31('0x6')]][_0xae31('0x36')]=_0x4d2d1b['connectedlinename'];}}catch(_0x143034){utils[_0xae31('0x15')](util['format'](_0xae31('0x33'),_0x4d2d1b[_0xae31('0x6')]),_0x143034);}};exports[_0xae31('0x3c')]=function(_0xdf540e){try{if(!_['isNil'](queues[_0xdf540e[_0xae31('0x6')]])){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x3d'),_0xdf540e[_0xae31('0x6')]),_0xdf540e);utils['info'](util['format'](_0xae31('0x3e'),_0xdf540e[_0xae31('0x6')],queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x1f')],_0xdf540e['membername'],_0xdf540e['destaccountcode']));queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x2d')]=![];queues[_0xdf540e[_0xae31('0x6')]]['queuecallerabandon']=![];queues[_0xdf540e['uniqueid']][_0xae31('0x29')]=null;queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x1b')]=![];queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x1e')]=null;queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x2a')]=null;queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x3f')]=!![];queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0xb')]=_0xdf540e[_0xae31('0x40')];queues[_0xdf540e[_0xae31('0x6')]][_0xae31('0x9')]=_0xdf540e[_0xae31('0x41')];}}catch(_0x298993){utils['error'](util[_0xae31('0x4')](_0xae31('0x3d'),_0xdf540e['uniqueid']),_0x298993);}};exports['agentcomplete']=function(_0x49dd5a){try{if(!_[_0xae31('0x17')](queues[_0x49dd5a[_0xae31('0x6')]])){if(queues[_0x49dd5a[_0xae31('0x6')]]['queuecallerleaveAt']){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x42'),_0x49dd5a[_0xae31('0x6')]),_0x49dd5a);queues[_0x49dd5a[_0xae31('0x6')]]['queuecallerabandon']=![];queues[_0x49dd5a[_0xae31('0x6')]][_0xae31('0x2d')]=![];queues[_0x49dd5a['uniqueid']]['queuecallerabandonAt']=null;queues[_0x49dd5a['uniqueid']][_0xae31('0x1b')]=![];queues[_0x49dd5a[_0xae31('0x6')]][_0xae31('0x2a')]=null;queues[_0x49dd5a['uniqueid']][_0xae31('0x3f')]=!![];queues[_0x49dd5a['uniqueid']][_0xae31('0x9')]=_0x49dd5a[_0xae31('0x41')];queues[_0x49dd5a['uniqueid']][_0xae31('0x1c')]=!![];queues[_0x49dd5a[_0xae31('0x6')]][_0xae31('0x43')]=utils[_0xae31('0x1d')]();if(_0x49dd5a[_0xae31('0x44')]=='transfer'){if(!queues[_0x49dd5a['uniqueid']]['transfer']){queues[_0x49dd5a[_0xae31('0x6')]][_0xae31('0x1e')]=_0xae31('0x45');}}else{queues[_0x49dd5a['uniqueid']][_0xae31('0x1e')]=_0xae31('0x46')+_0x49dd5a[_0xae31('0x44')][_0xae31('0x27')]();}utils[_0xae31('0x3')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x49dd5a[_0xae31('0x6')],queues[_0x49dd5a['uniqueid']]['name'],_0x49dd5a[_0xae31('0x41')],queues[_0x49dd5a[_0xae31('0x6')]][_0xae31('0x1e')]));writeDB(queues[_0x49dd5a['uniqueid']]);}}}catch(_0x11a7e1){utils[_0xae31('0x15')](util[_0xae31('0x4')](_0xae31('0x42'),_0x49dd5a[_0xae31('0x6')]),_0x11a7e1);}};exports[_0xae31('0x47')]=function(_0x1353d7){try{if(!_[_0xae31('0x17')](queues[_0x1353d7[_0xae31('0x48')]])){utils[_0xae31('0x18')](util['format'](_0xae31('0x49'),_0x1353d7[_0xae31('0x6')]),_0x1353d7);queues[_0x1353d7[_0xae31('0x48')]][_0xae31('0x4a')]=!![];queues[_0x1353d7[_0xae31('0x48')]][_0xae31('0x4b')]=_0xae31('0x4c');queues[_0x1353d7[_0xae31('0x48')]]['transferexten']=_0x1353d7['extension'];queues[_0x1353d7['transfereeuniqueid']][_0xae31('0x4d')]=_0x1353d7['transfereeuniqueid'];queues[_0x1353d7[_0xae31('0x48')]][_0xae31('0x1e')]=_0xae31('0x4e');utils[_0xae31('0x3')](util['format'](_0xae31('0x4f'),_0x1353d7[_0xae31('0x6')],queues[_0x1353d7[_0xae31('0x48')]]['name'],_0x1353d7[_0xae31('0x48')],_0x1353d7['extension']));}}catch(_0x408420){utils[_0xae31('0x15')](util['format']('[%s][queues][blindtransfer]',_0x1353d7['uniqueid']),_0x408420);}};exports[_0xae31('0x50')]=function(_0xa5cca){try{utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x51'),_0xa5cca[_0xae31('0x52')]),_0xa5cca);if(_0xa5cca['origtransfereruniqueid']==_0xa5cca[_0xae31('0x53')]){if(!_[_0xae31('0x17')](queues[_0xa5cca[_0xae31('0x54')]])){utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x55'),_0xa5cca[_0xae31('0x52')],queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0x1f')],_0xa5cca[_0xae31('0x56')]));queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0x4a')]=!![];queues[_0xa5cca['secondtransfererlinkedid']]['transfertype']=_0xae31('0x57');queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0x58')]=_0xa5cca[_0xae31('0x56')];queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0x4d')]=_0xa5cca[_0xae31('0x52')];queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0x1e')]='ATTENDEDTRANSFER';}if(!_[_0xae31('0x17')](queues[_0xa5cca[_0xae31('0x53')]])){if(_0xa5cca[_0xae31('0x59')]&&queues[_0xa5cca[_0xae31('0x59')]]){queues[_0xa5cca[_0xae31('0x59')]][_0xae31('0x21')]=0x1;queues[_0xa5cca['transfereeuniqueid']]=_['clone'](queues[_0xa5cca[_0xae31('0x59')]]);queues[_0xa5cca['transfereeuniqueid']][_0xae31('0x10')]=_0xa5cca['transfertargetuniqueid'];queues[_0xa5cca[_0xae31('0x48')]][_0xae31('0x21')]=0x2;queues[_0xa5cca[_0xae31('0x48')]]['calleridnum']=queues[_0xa5cca[_0xae31('0x54')]][_0xae31('0xa')];queues[_0xa5cca[_0xae31('0x48')]]['calleridname']=queues[_0xa5cca[_0xae31('0x54')]]['calleridname'];queues[_0xa5cca['transfereeuniqueid']][_0xae31('0x3a')]=utils['now']();queues[_0xa5cca[_0xae31('0x48')]][_0xae31('0x1a')]=utils[_0xae31('0x1d')]();queues[_0xa5cca[_0xae31('0x48')]][_0xae31('0x38')]=0x0;queues[_0xa5cca['transfereeuniqueid']][_0xae31('0x5a')]=0x0;utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x5b'),_0xa5cca[_0xae31('0x52')],queues[_0xa5cca[_0xae31('0x48')]]['name'],queues[_0xa5cca[_0xae31('0x48')]][_0xae31('0xa')],queues[_0xa5cca['transfereeuniqueid']][_0xae31('0x5c')]));}else{utils[_0xae31('0x3')](util[_0xae31('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xa5cca[_0xae31('0x52')],queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0x1f')],_0xa5cca[_0xae31('0x54')]));queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0x10')]=_0xa5cca[_0xae31('0x54')];}}}else if(_0xa5cca[_0xae31('0x5d')]==_0xa5cca[_0xae31('0x54')]){if(!_[_0xae31('0x17')](queues[_0xa5cca[_0xae31('0x53')]])){utils[_0xae31('0x3')](util['format'](_0xae31('0x5e'),_0xa5cca[_0xae31('0x52')],queues[_0xa5cca[_0xae31('0x53')]]['name'],_0xa5cca[_0xae31('0x5d')],_0xa5cca[_0xae31('0x5f')]));queues[_0xa5cca[_0xae31('0x53')]]['transfer']=!![];queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0x4b')]=_0xae31('0x57');queues[_0xa5cca[_0xae31('0x53')]]['transferexten']=_0xa5cca[_0xae31('0x5f')];queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0x4d')]=_0xa5cca[_0xae31('0x5d')];queues[_0xa5cca[_0xae31('0x53')]]['queuecallerexitreason']=_0xae31('0x60');}if(!_[_0xae31('0x17')](queues[_0xa5cca[_0xae31('0x54')]])){if(_0xa5cca['transfertargetlinkedid']&&queues[_0xa5cca[_0xae31('0x61')]]){queues[_0xa5cca['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0xa5cca['transfertargetuniqueid']]=_[_0xae31('0x62')](queues[_0xa5cca[_0xae31('0x61')]]);queues[_0xa5cca['transfertargetuniqueid']]['transfereduniqueid']=_0xa5cca[_0xae31('0x63')];queues[_0xa5cca[_0xae31('0x63')]]['queuecallerenterreason']=0x2;queues[_0xa5cca[_0xae31('0x63')]][_0xae31('0xa')]=queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0xa')];queues[_0xa5cca[_0xae31('0x63')]][_0xae31('0x5c')]=queues[_0xa5cca[_0xae31('0x53')]][_0xae31('0x5c')];queues[_0xa5cca[_0xae31('0x63')]]['queuecallerjoinAt']=utils[_0xae31('0x1d')]();queues[_0xa5cca[_0xae31('0x63')]]['queuecallerleaveAt']=utils['now']();queues[_0xa5cca[_0xae31('0x63')]]['holdtime']=0x0;queues[_0xa5cca['transfertargetuniqueid']]['mohtime']=0x0;utils[_0xae31('0x3')](util[_0xae31('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0xa5cca[_0xae31('0x52')],queues[_0xa5cca[_0xae31('0x63')]]['name'],queues[_0xa5cca[_0xae31('0x63')]]['transfereduniqueid'],queues[_0xa5cca['transfertargetuniqueid']][_0xae31('0xa')],queues[_0xa5cca[_0xae31('0x63')]][_0xae31('0x5c')]));}else{utils['info'](util[_0xae31('0x4')](_0xae31('0x64'),_0xa5cca[_0xae31('0x52')],queues[_0xa5cca['secondtransfererlinkedid']][_0xae31('0x1f')],_0xa5cca[_0xae31('0x53')]));queues[_0xa5cca[_0xae31('0x54')]]['transfereduniqueid']=_0xa5cca['origtransfererlinkedid'];}}}}catch(_0x3a2f96){utils[_0xae31('0x15')](util['format'](_0xae31('0x51'),_0xa5cca[_0xae31('0x52')]),_0x3a2f96);}};exports[_0xae31('0x65')]=function(_0x24e12e){try{if(!_['isNil'](queues[_0x24e12e[_0xae31('0x6')]])){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x66'),_0x24e12e[_0xae31('0x6')]),_0x24e12e);queues[_0x24e12e[_0xae31('0x6')]][_0xae31('0x67')]=utils[_0xae31('0x1d')]();utils[_0xae31('0x3')](util[_0xae31('0x4')](_0xae31('0x68'),_0x24e12e[_0xae31('0x6')],queues[_0x24e12e[_0xae31('0x6')]][_0xae31('0x1f')],queues[_0x24e12e[_0xae31('0x6')]][_0xae31('0x67')]));}}catch(_0x5a81ba){utils[_0xae31('0x15')](util[_0xae31('0x4')](_0xae31('0x66'),_0x24e12e[_0xae31('0x6')]),_0x5a81ba);}};exports[_0xae31('0x69')]=function(_0x1f392d){try{if(!_['isNil'](queues[_0x1f392d[_0xae31('0x6')]])){if(!_[_0xae31('0x17')](queues[_0x1f392d[_0xae31('0x6')]]['musiconholdstartAt'])){utils[_0xae31('0x18')](util[_0xae31('0x4')](_0xae31('0x6a'),_0x1f392d['uniqueid']),_0x1f392d);queues[_0x1f392d[_0xae31('0x6')]]['mohtime']+=utils[_0xae31('0x39')](utils[_0xae31('0x1d')](),queues[_0x1f392d[_0xae31('0x6')]][_0xae31('0x67')]);utils['info'](util['format'](_0xae31('0x6b'),_0x1f392d['uniqueid'],queues[_0x1f392d[_0xae31('0x6')]][_0xae31('0x1f')],queues[_0x1f392d[_0xae31('0x6')]][_0xae31('0x5a')]));delete queues[_0x1f392d[_0xae31('0x6')]][_0xae31('0x67')];}}}catch(_0x563ea1){utils['error'](util['format'](_0xae31('0x6a'),_0x1f392d[_0xae31('0x6')]),_0x563ea1);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 240939d..8be0512 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 _0x488b=['hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','find','monitors','push'];(function(_0x20e9a8,_0x34d548){var _0x2dbeb4=function(_0x1e0e30){while(--_0x1e0e30){_0x20e9a8['push'](_0x20e9a8['shift']());}};_0x2dbeb4(++_0x34d548);}(_0x488b,0xdd));var _0xb488=function(_0x460346,_0x3a2c62){_0x460346=_0x460346-0x0;var _0x239345=_0x488b[_0x460346];return _0x239345;};'use strict';var _=require('lodash');var util=require(_0xb488('0x0'));var utils=require(_0xb488('0x1'));var recordings={};function writeDB(_0x6fcd1b){utils['info'](util[_0xb488('0x2')](_0xb488('0x3'),_0x6fcd1b['uniqueid']));if(_0x6fcd1b[_0xb488('0x4')]){utils[_0xb488('0x5')](_0x6fcd1b['accountcode'])[_0xb488('0x6')](function(_0x2dee11){if(_0x2dee11){_0x6fcd1b['membername']=_0x2dee11[_0xb488('0x7')];_0x6fcd1b[_0xb488('0x8')]=_0x2dee11['id'];}utils['request']('CreateVoiceRecording',_0x6fcd1b);});}else{utils[_0xb488('0x9')](_0xb488('0xa'),_0x6fcd1b);}}exports[_0xb488('0xb')]=function(_0x413eb1){try{utils[_0xb488('0xc')](util['format'](_0xb488('0xd'),_0x413eb1[_0xb488('0xe')]),_0x413eb1);if(_0x413eb1[_0xb488('0xe')]==_0x413eb1[_0xb488('0xf')]){utils[_0xb488('0x10')](util[_0xb488('0x2')](_0xb488('0x11'),_0x413eb1[_0xb488('0xe')],_0x413eb1[_0xb488('0x12')],_0x413eb1[_0xb488('0x13')]));recordings[_0x413eb1['uniqueid']]={'uniqueid':_0x413eb1[_0xb488('0xe')],'accountcode':_0x413eb1[_0xb488('0x4')],'exten':_0x413eb1[_0xb488('0x13')],'context':_0x413eb1[_0xb488('0x12')],'channel':_0x413eb1[_0xb488('0x14')],'monitors':[]};}}catch(_0x510f15){utils[_0xb488('0x15')](util[_0xb488('0x2')](_0xb488('0xd'),_0x413eb1[_0xb488('0xe')]),_0x510f15);}};exports['newstate']=function(_0x17873d){try{utils[_0xb488('0xc')](util['format'](_0xb488('0x16'),_0x17873d[_0xb488('0xe')]),_0x17873d);if(!_[_0xb488('0x17')](recordings[_0x17873d['uniqueid']])&&_0x17873d[_0xb488('0x18')]==0x6){utils[_0xb488('0x10')](util[_0xb488('0x2')](_0xb488('0x19'),_0x17873d[_0xb488('0xe')],_0x17873d[_0xb488('0x12')],_0x17873d[_0xb488('0x14')]));}else if(!_[_0xb488('0x17')](recordings[_0x17873d[_0xb488('0xf')]])&&_0x17873d[_0xb488('0x18')]==0x6&&_0x17873d[_0xb488('0x12')]!=_0xb488('0x1a')){utils['info'](util[_0xb488('0x2')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x17873d[_0xb488('0xe')],_0x17873d[_0xb488('0xf')],_0x17873d[_0xb488('0x12')],_0x17873d['channel']));recordings[_0x17873d['linkedid']][_0xb488('0x4')]=_0x17873d['accountcode'];}}catch(_0x1fe7f5){utils[_0xb488('0x15')](util['format'](_0xb488('0x16'),_0x17873d[_0xb488('0xe')]),_0x1fe7f5);}};exports[_0xb488('0x1b')]=function(_0x5421cf){try{if(!_['isNil'](_0x5421cf[_0xb488('0x1c')])&&!_[_0xb488('0x17')](_0x5421cf[_0xb488('0x1c')][_0xb488('0x1d')])){utils[_0xb488('0xc')](util[_0xb488('0x2')](_0xb488('0x1e'),_0x5421cf[_0xb488('0xe')]),_0x5421cf);utils['info'](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x5421cf[_0xb488('0xe')],_0x5421cf[_0xb488('0x1c')],_0x5421cf[_0xb488('0x1f')]));if(_[_0xb488('0x20')](_0x5421cf[_0xb488('0x1f')],_0xb488('0x21'))){_0x5421cf['value']=_0x5421cf[_0xb488('0x1f')][_0xb488('0x22')](_0xb488('0x21'),_0xb488('0x23'));}if(recordings[_0x5421cf['linkedid']]){var _0xe7e35b=_[_0xb488('0x24')](recordings[_0x5421cf[_0xb488('0xf')]]['monitors'],{'value':_0x5421cf['value']});if(_[_0xb488('0x17')](_0xe7e35b)){recordings[_0x5421cf[_0xb488('0xf')]][_0xb488('0x25')][_0xb488('0x26')]({'value':_0x5421cf['value']});}}}}catch(_0x1b6413){utils[_0xb488('0x15')](util[_0xb488('0x2')]('[%s][recordings][varset]',_0x5421cf[_0xb488('0xe')]),_0x1b6413);}};exports[_0xb488('0x27')]=function(_0x3dcbdf){try{if(!_[_0xb488('0x17')](recordings[_0x3dcbdf[_0xb488('0xe')]])){utils[_0xb488('0xc')](util[_0xb488('0x2')](_0xb488('0x28'),_0x3dcbdf['uniqueid']),_0x3dcbdf);utils['info'](util[_0xb488('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x3dcbdf['uniqueid'],_0x3dcbdf[_0xb488('0x29')],_0x3dcbdf[_0xb488('0x2a')],_0x3dcbdf[_0xb488('0x2b')]));recordings[_0x3dcbdf['uniqueid']][_0xb488('0x29')]=_0x3dcbdf[_0xb488('0x29')];recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x2a')]=_0x3dcbdf['calleridname'];recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x2c')]=_0x3dcbdf[_0xb488('0x2c')];recordings[_0x3dcbdf[_0xb488('0xe')]]['connectedlinename']=_0x3dcbdf[_0xb488('0x2d')];if(recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x2e')]==_0xb488('0x2f')&&recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x4')]){recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x2c')]=recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x4')];recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x2d')]='';}recordings[_0x3dcbdf[_0xb488('0xe')]][_0xb488('0x25')][_0xb488('0x30')](function(_0x365815){var _0x19e145=_[_0xb488('0x31')](recordings[_0x3dcbdf['uniqueid']]);_0x19e145[_0xb488('0x1f')]=_0x365815[_0xb488('0x1f')];writeDB(_0x19e145);});delete recordings[_0x3dcbdf[_0xb488('0xe')]];}}catch(_0x4e3b4f){utils[_0xb488('0x15')](util[_0xb488('0x2')]('[%s][recordings][hangup]',_0x3dcbdf[_0xb488('0xe')]),_0x4e3b4f);}};exports[_0xb488('0x32')]=function(_0x19985f){try{if(!_['isNil'](recordings[_0x19985f[_0xb488('0xe')]])){utils[_0xb488('0xc')](util['format']('[%s][recordings][newexten]',_0x19985f[_0xb488('0xe')]),_0x19985f);utils[_0xb488('0x10')](util[_0xb488('0x2')](_0xb488('0x33'),_0x19985f[_0xb488('0xe')],_0x19985f[_0xb488('0x34')],_0x19985f[_0xb488('0x35')]));if(_0x19985f[_0xb488('0x34')][_0xb488('0x36')]()==_0xb488('0x37')&&_['startsWith'](_0x19985f[_0xb488('0x35')][_0xb488('0x36')](),_0xb488('0x38'))){var _0x1991db=_0x19985f[_0xb488('0x35')][_0xb488('0x39')]('=');var _0x5c2a69=_0x1991db[0x0][_0xb488('0x3a')](_0x1991db[0x0][_0xb488('0x3b')]('(')+0x1,_0x1991db[0x0][_0xb488('0x3b')](')'));var _0x3633b7=_0x1991db[0x1];recordings[_0x19985f[_0xb488('0xe')]][_0x5c2a69]=_0x3633b7;}}}catch(_0x250cd9){utils[_0xb488('0x15')](util['format'](_0xb488('0x3c'),_0x19985f[_0xb488('0xe')]),_0x250cd9);}};exports[_0xb488('0x3d')]=function(_0x1cf91c){try{if(!_[_0xb488('0x17')](recordings[_0x1cf91c['uniqueid']])){utils['debug'](util[_0xb488('0x2')](_0xb488('0x3e'),_0x1cf91c[_0xb488('0xe')]),_0x1cf91c);utils[_0xb488('0x10')](util['format'](_0xb488('0x3f'),_0x1cf91c[_0xb488('0xe')],_0x1cf91c[_0xb488('0x40')]));recordings[_0x1cf91c[_0xb488('0xe')]][_0xb488('0x40')]=_0x1cf91c[_0xb488('0x40')];}}catch(_0x54946c){utils[_0xb488('0x15')](util[_0xb488('0x2')](_0xb488('0x3e'),_0x1cf91c[_0xb488('0xe')]),_0x54946c);}}; \ No newline at end of file +var _0x23e6=['[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','application','appdata','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash','util','./utils','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','membername','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','uniqueid','linkedid'];(function(_0x5e7f60,_0x44c606){var _0x5f1e84=function(_0x24d4d1){while(--_0x24d4d1){_0x5e7f60['push'](_0x5e7f60['shift']());}};_0x5f1e84(++_0x44c606);}(_0x23e6,0x9c));var _0x623e=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0x23e6[_0x499001];return _0x320c65;};'use strict';var _=require(_0x623e('0x0'));var util=require(_0x623e('0x1'));var utils=require(_0x623e('0x2'));var recordings={};function writeDB(_0x4802d4){utils['info'](util[_0x623e('0x3')](_0x623e('0x4'),_0x4802d4['uniqueid']));if(_0x4802d4[_0x623e('0x5')]){utils[_0x623e('0x6')](_0x4802d4['accountcode'])['then'](function(_0x207299){if(_0x207299){_0x4802d4[_0x623e('0x7')]=_0x207299['name'];_0x4802d4[_0x623e('0x8')]=_0x207299['id'];}utils[_0x623e('0x9')](_0x623e('0xa'),_0x4802d4);});}else{utils[_0x623e('0x9')](_0x623e('0xa'),_0x4802d4);}}exports['newchannel']=function(_0x654577){try{utils[_0x623e('0xb')](util[_0x623e('0x3')](_0x623e('0xc'),_0x654577['uniqueid']),_0x654577);if(_0x654577[_0x623e('0xd')]==_0x654577[_0x623e('0xe')]){utils['info'](util[_0x623e('0x3')](_0x623e('0xf'),_0x654577[_0x623e('0xd')],_0x654577[_0x623e('0x10')],_0x654577[_0x623e('0x11')]));recordings[_0x654577['uniqueid']]={'uniqueid':_0x654577['uniqueid'],'accountcode':_0x654577[_0x623e('0x5')],'exten':_0x654577[_0x623e('0x11')],'context':_0x654577[_0x623e('0x10')],'channel':_0x654577[_0x623e('0x12')],'monitors':[]};}}catch(_0x340f0f){utils[_0x623e('0x13')](util[_0x623e('0x3')](_0x623e('0xc'),_0x654577['uniqueid']),_0x340f0f);}};exports['newstate']=function(_0x20e7f5){try{utils[_0x623e('0xb')](util[_0x623e('0x3')](_0x623e('0x14'),_0x20e7f5[_0x623e('0xd')]),_0x20e7f5);if(!_[_0x623e('0x15')](recordings[_0x20e7f5[_0x623e('0xd')]])&&_0x20e7f5[_0x623e('0x16')]==0x6){utils[_0x623e('0x17')](util[_0x623e('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x20e7f5[_0x623e('0xd')],_0x20e7f5[_0x623e('0x10')],_0x20e7f5['channel']));}else if(!_[_0x623e('0x15')](recordings[_0x20e7f5[_0x623e('0xe')]])&&_0x20e7f5[_0x623e('0x16')]==0x6&&_0x20e7f5[_0x623e('0x10')]!='transfer'){utils[_0x623e('0x17')](util[_0x623e('0x3')](_0x623e('0x18'),_0x20e7f5[_0x623e('0xd')],_0x20e7f5[_0x623e('0xe')],_0x20e7f5[_0x623e('0x10')],_0x20e7f5['channel']));recordings[_0x20e7f5[_0x623e('0xe')]][_0x623e('0x5')]=_0x20e7f5['accountcode'];}}catch(_0x13325d){utils[_0x623e('0x13')](util[_0x623e('0x3')](_0x623e('0x14'),_0x20e7f5['uniqueid']),_0x13325d);}};exports[_0x623e('0x19')]=function(_0x5419e2){try{if(!_[_0x623e('0x15')](_0x5419e2['variable'])&&!_['isNil'](_0x5419e2[_0x623e('0x1a')]['mixmonitor_filename'])){utils['debug'](util['format'](_0x623e('0x1b'),_0x5419e2[_0x623e('0xd')]),_0x5419e2);utils[_0x623e('0x17')](util[_0x623e('0x3')](_0x623e('0x1c'),_0x5419e2[_0x623e('0xd')],_0x5419e2['variable'],_0x5419e2['value']));if(_[_0x623e('0x1d')](_0x5419e2[_0x623e('0x1e')],'.wav49')){_0x5419e2[_0x623e('0x1e')]=_0x5419e2[_0x623e('0x1e')]['replace'](_0x623e('0x1f'),_0x623e('0x20'));}if(recordings[_0x5419e2[_0x623e('0xe')]]){var _0x34b312=_[_0x623e('0x21')](recordings[_0x5419e2['linkedid']][_0x623e('0x22')],{'value':_0x5419e2[_0x623e('0x1e')]});if(_['isNil'](_0x34b312)){recordings[_0x5419e2[_0x623e('0xe')]][_0x623e('0x22')][_0x623e('0x23')]({'value':_0x5419e2['value']});}}}}catch(_0x20b37d){utils['error'](util[_0x623e('0x3')](_0x623e('0x1b'),_0x5419e2[_0x623e('0xd')]),_0x20b37d);}};exports[_0x623e('0x24')]=function(_0x1e7b9d){try{if(!_['isNil'](recordings[_0x1e7b9d[_0x623e('0xd')]])){utils[_0x623e('0xb')](util[_0x623e('0x3')](_0x623e('0x25'),_0x1e7b9d[_0x623e('0xd')]),_0x1e7b9d);utils['info'](util[_0x623e('0x3')](_0x623e('0x26'),_0x1e7b9d[_0x623e('0xd')],_0x1e7b9d[_0x623e('0x27')],_0x1e7b9d[_0x623e('0x28')],_0x1e7b9d[_0x623e('0x29')]));recordings[_0x1e7b9d[_0x623e('0xd')]]['calleridnum']=_0x1e7b9d[_0x623e('0x27')];recordings[_0x1e7b9d['uniqueid']][_0x623e('0x28')]=_0x1e7b9d[_0x623e('0x28')];recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x2a')]=_0x1e7b9d[_0x623e('0x2a')];recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x2b')]=_0x1e7b9d['connectedlinename'];if(recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x2c')]=='outbound'&&recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x5')]){recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x2a')]=recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x5')];recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x2b')]='';}recordings[_0x1e7b9d[_0x623e('0xd')]][_0x623e('0x22')]['forEach'](function(_0xcdc77a){var _0x54a1f6=_[_0x623e('0x2d')](recordings[_0x1e7b9d[_0x623e('0xd')]]);_0x54a1f6['value']=_0xcdc77a[_0x623e('0x1e')];writeDB(_0x54a1f6);});delete recordings[_0x1e7b9d[_0x623e('0xd')]];}}catch(_0x2f2c63){utils[_0x623e('0x13')](util[_0x623e('0x3')](_0x623e('0x25'),_0x1e7b9d['uniqueid']),_0x2f2c63);}};exports[_0x623e('0x2e')]=function(_0x5049ef){try{if(!_[_0x623e('0x15')](recordings[_0x5049ef[_0x623e('0xd')]])){utils[_0x623e('0xb')](util['format']('[%s][recordings][newexten]',_0x5049ef[_0x623e('0xd')]),_0x5049ef);utils[_0x623e('0x17')](util[_0x623e('0x3')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5049ef[_0x623e('0xd')],_0x5049ef[_0x623e('0x2f')],_0x5049ef[_0x623e('0x30')]));if(_0x5049ef[_0x623e('0x2f')]['toLowerCase']()=='set'&&_[_0x623e('0x31')](_0x5049ef[_0x623e('0x30')]['toLowerCase'](),_0x623e('0x32'))){var _0xa034a5=_0x5049ef[_0x623e('0x30')][_0x623e('0x33')]('=');var _0x10b5c1=_0xa034a5[0x0]['substring'](_0xa034a5[0x0][_0x623e('0x34')]('(')+0x1,_0xa034a5[0x0]['lastIndexOf'](')'));var _0x22bbcb=_0xa034a5[0x1];recordings[_0x5049ef[_0x623e('0xd')]][_0x10b5c1]=_0x22bbcb;}}}catch(_0x574c84){utils[_0x623e('0x13')](util[_0x623e('0x3')]('[%s][recordings][newexten]',_0x5049ef['uniqueid']),_0x574c84);}};exports[_0x623e('0x35')]=function(_0x180708){try{if(!_[_0x623e('0x15')](recordings[_0x180708['uniqueid']])){utils[_0x623e('0xb')](util[_0x623e('0x3')]('[%s][recordings][queuecallerjoin]',_0x180708[_0x623e('0xd')]),_0x180708);utils[_0x623e('0x17')](util[_0x623e('0x3')](_0x623e('0x36'),_0x180708[_0x623e('0xd')],_0x180708[_0x623e('0x37')]));recordings[_0x180708[_0x623e('0xd')]][_0x623e('0x37')]=_0x180708['queue'];}}catch(_0x3adbd6){utils['error'](util['format'](_0x623e('0x38'),_0x180708[_0x623e('0xd')]),_0x3adbd6);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5fb2434..3ec42d8 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 _0x42fc=['transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','transferercalleridnum'];(function(_0x25de52,_0x5a8328){var _0x11a302=function(_0xf66e41){while(--_0xf66e41){_0x25de52['push'](_0x25de52['shift']());}};_0x11a302(++_0x5a8328);}(_0x42fc,0x165));var _0xc42f=function(_0x2f583d,_0x5abeab){_0x2f583d=_0x2f583d-0x0;var _0x54ec19=_0x42fc[_0x2f583d];return _0x54ec19;};'use strict';var _=require('lodash');var util=require(_0xc42f('0x0'));var utils=require('./utils');function writeDB(_0x5e7559){utils[_0xc42f('0x1')](util[_0xc42f('0x2')](_0xc42f('0x3'),_0x5e7559[_0xc42f('0x4')]===_0xc42f('0x5')?_0x5e7559[_0xc42f('0x6')]:_0x5e7559[_0xc42f('0x7')],_0x5e7559[_0xc42f('0x4')]));utils[_0xc42f('0x8')](_0xc42f('0x9'),_0x5e7559);}exports[_0xc42f('0xa')]={};exports['blindtransfer']=function(_0x4220a8){try{utils['debug'](util[_0xc42f('0x2')]('[%s][transfers][blindtransfer]',_0x4220a8[_0xc42f('0x7')]),_0x4220a8);utils['info'](util[_0xc42f('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4220a8[_0xc42f('0x7')],_0x4220a8[_0xc42f('0xb')],_0x4220a8[_0xc42f('0xc')],_0x4220a8[_0xc42f('0xd')],_0x4220a8[_0xc42f('0xe')]));_0x4220a8['type']=_0xc42f('0xf');exports[_0xc42f('0xa')][_0x4220a8[_0xc42f('0x10')]]=_0x4220a8;writeDB(_0x4220a8);}catch(_0x46ec4e){utils[_0xc42f('0x11')](util[_0xc42f('0x2')]('[%s][transfers][blindtransfer]',_0x4220a8[_0xc42f('0x7')]),_0x46ec4e);}};exports[_0xc42f('0x12')]=function(_0x6a54ab){try{utils[_0xc42f('0x13')](util[_0xc42f('0x2')](_0xc42f('0x14'),_0x6a54ab['origtransfereruniqueid']),_0x6a54ab);utils[_0xc42f('0x1')](util[_0xc42f('0x2')](_0xc42f('0x15'),_0x6a54ab[_0xc42f('0x6')],_0x6a54ab[_0xc42f('0x16')],_0x6a54ab[_0xc42f('0x17')],_0x6a54ab[_0xc42f('0x18')],_0x6a54ab[_0xc42f('0x19')]));_0x6a54ab=_['assign'](_0x6a54ab,{'transfererchannel':_0x6a54ab['origtransfererchannel'],'transferercalleridnum':_0x6a54ab[_0xc42f('0x16')],'transferercalleridname':_0x6a54ab['origtransferercalleridname'],'transfererconnectedlinenum':_0x6a54ab[_0xc42f('0x1a')],'transfererconnectedlinename':_0x6a54ab[_0xc42f('0x1b')],'transfereraccountcode':_0x6a54ab[_0xc42f('0x1c')],'transferercontext':_0x6a54ab[_0xc42f('0x1d')],'transfererexten':_0x6a54ab[_0xc42f('0x1e')],'transfererlinkedid':_0x6a54ab[_0xc42f('0x1f')],'context':_0x6a54ab[_0xc42f('0x20')],'extension':_0x6a54ab[_0xc42f('0x21')],'type':'attended'});if(_['isNil'](_0x6a54ab[_0xc42f('0x22')])){_0x6a54ab=_[_0xc42f('0x23')](_0x6a54ab,{'transfereechannel':_0x6a54ab[_0xc42f('0x24')],'transfereecalleridnum':_0x6a54ab[_0xc42f('0x18')],'transfereecalleridname':_0x6a54ab[_0xc42f('0x19')],'transfereeconnectedlinenum':_0x6a54ab[_0xc42f('0x25')],'transfereeconnectedlinename':_0x6a54ab['transfertargetconnectedlinename'],'transfereeaccountcode':_0x6a54ab[_0xc42f('0x26')],'transfereecontext':_0x6a54ab[_0xc42f('0x27')],'transfereeexten':_0x6a54ab['transfertargetexten'],'transfereelinkedid':_0x6a54ab[_0xc42f('0x28')]});}writeDB(_0x6a54ab);}catch(_0x386fe2){utils[_0xc42f('0x11')](util[_0xc42f('0x2')]('[%s][transfers][attendedtransfer]',_0x6a54ab[_0xc42f('0x6')]),_0x386fe2);}}; \ No newline at end of file +var _0x6a79=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','format','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid'];(function(_0x4219b3,_0x5aedc1){var _0x42a9b1=function(_0x25b4ca){while(--_0x25b4ca){_0x4219b3['push'](_0x4219b3['shift']());}};_0x42a9b1(++_0x5aedc1);}(_0x6a79,0x1c1));var _0x96a7=function(_0x192772,_0x100b16){_0x192772=_0x192772-0x0;var _0x2b50bd=_0x6a79[_0x192772];return _0x2b50bd;};'use strict';var _=require(_0x96a7('0x0'));var util=require(_0x96a7('0x1'));var utils=require(_0x96a7('0x2'));function writeDB(_0x4f81c6){utils[_0x96a7('0x3')](util['format'](_0x96a7('0x4'),_0x4f81c6[_0x96a7('0x5')]===_0x96a7('0x6')?_0x4f81c6['origtransfereruniqueid']:_0x4f81c6[_0x96a7('0x7')],_0x4f81c6[_0x96a7('0x5')]));utils['request'](_0x96a7('0x8'),_0x4f81c6);}exports[_0x96a7('0x9')]={};exports[_0x96a7('0xa')]=function(_0x3623d1){try{utils[_0x96a7('0xb')](util['format'](_0x96a7('0xc'),_0x3623d1[_0x96a7('0x7')]),_0x3623d1);utils['info'](util[_0x96a7('0xd')](_0x96a7('0xe'),_0x3623d1[_0x96a7('0x7')],_0x3623d1[_0x96a7('0xf')],_0x3623d1[_0x96a7('0x10')],_0x3623d1[_0x96a7('0x11')],_0x3623d1['transfereecalleridname']));_0x3623d1[_0x96a7('0x5')]=_0x96a7('0x12');exports[_0x96a7('0x9')][_0x3623d1[_0x96a7('0x13')]]=_0x3623d1;writeDB(_0x3623d1);}catch(_0x404df5){utils[_0x96a7('0x14')](util['format']('[%s][transfers][blindtransfer]',_0x3623d1[_0x96a7('0x7')]),_0x404df5);}};exports[_0x96a7('0x15')]=function(_0x5c50c3){try{utils['debug'](util[_0x96a7('0xd')](_0x96a7('0x16'),_0x5c50c3[_0x96a7('0x17')]),_0x5c50c3);utils[_0x96a7('0x3')](util[_0x96a7('0xd')](_0x96a7('0x18'),_0x5c50c3[_0x96a7('0x17')],_0x5c50c3[_0x96a7('0x19')],_0x5c50c3[_0x96a7('0x1a')],_0x5c50c3['transfertargetcalleridnum'],_0x5c50c3[_0x96a7('0x1b')]));_0x5c50c3=_[_0x96a7('0x1c')](_0x5c50c3,{'transfererchannel':_0x5c50c3[_0x96a7('0x1d')],'transferercalleridnum':_0x5c50c3['origtransferercalleridnum'],'transferercalleridname':_0x5c50c3[_0x96a7('0x1a')],'transfererconnectedlinenum':_0x5c50c3[_0x96a7('0x1e')],'transfererconnectedlinename':_0x5c50c3['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5c50c3[_0x96a7('0x1f')],'transferercontext':_0x5c50c3[_0x96a7('0x20')],'transfererexten':_0x5c50c3[_0x96a7('0x21')],'transfererlinkedid':_0x5c50c3[_0x96a7('0x22')],'context':_0x5c50c3['origtransferercontext'],'extension':_0x5c50c3[_0x96a7('0x23')],'type':_0x96a7('0x6')});if(_['isNil'](_0x5c50c3[_0x96a7('0x24')])){_0x5c50c3=_[_0x96a7('0x1c')](_0x5c50c3,{'transfereechannel':_0x5c50c3[_0x96a7('0x25')],'transfereecalleridnum':_0x5c50c3[_0x96a7('0x26')],'transfereecalleridname':_0x5c50c3[_0x96a7('0x1b')],'transfereeconnectedlinenum':_0x5c50c3['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5c50c3['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5c50c3[_0x96a7('0x27')],'transfereecontext':_0x5c50c3[_0x96a7('0x28')],'transfereeexten':_0x5c50c3[_0x96a7('0x29')],'transfereelinkedid':_0x5c50c3[_0x96a7('0x2a')]});}writeDB(_0x5c50c3);}catch(_0x34f1f6){utils[_0x96a7('0x14')](util[_0x96a7('0xd')](_0x96a7('0x16'),_0x5c50c3[_0x96a7('0x17')]),_0x34f1f6);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index beaccc2..fe3dd9f 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 _0xc9b1=['acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','isAfter','isBefore','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','request','[utils][request]\x20name:%s','catch','error','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','then','notfound','[utils][getUserByInternal]','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc9b1,0xb8));var _0x1c9b=function(_0x5204c9,_0x87afb3){_0x5204c9=_0x5204c9-0x0;var _0x599c5c=_0xc9b1[_0x5204c9];return _0x599c5c;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x1c9b('0x0'));var util=require(_0x1c9b('0x1'));var client=jayson[_0x1c9b('0x2')][_0x1c9b('0x3')]({'port':0x2329});var logger=require(_0x1c9b('0x4'))(_0x1c9b('0x5'));exports[_0x1c9b('0x6')]=function(_0x246704,_0x265905){logger[_0x1c9b('0x6')](_0x246704,_0x265905?util[_0x1c9b('0x7')](_0x265905,{'showHidden':![],'depth':null}):'');};exports[_0x1c9b('0x8')]=function(_0x4a7903,_0x3375f6){logger[_0x1c9b('0x8')](_0x4a7903,_0x3375f6?util['inspect'](_0x3375f6,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4a00e4,_0x558baa){logger['error'](_0x4a00e4,_0x558baa?util[_0x1c9b('0x7')](_0x558baa,{'showHidden':![],'depth':null}):'');};exports[_0x1c9b('0x9')]=function(_0x51d8d0,_0x5c3e2a){return client[_0x1c9b('0x9')](_0x51d8d0,{'body':_0x5c3e2a})['then'](function(_0x15d0e1){logger[_0x1c9b('0x8')](_0x1c9b('0xa'),_0x51d8d0,_0x15d0e1?util[_0x1c9b('0x7')](_0x15d0e1,{'showHidden':![],'depth':null}):'');})[_0x1c9b('0xb')](function(_0x422c80){logger[_0x1c9b('0xc')](_0x1c9b('0xa'),_0x51d8d0,_0x422c80?util[_0x1c9b('0x7')](_0x422c80,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1b94ba){return client['request'](_0x1c9b('0xd'),{'options':{'raw':!![],'attributes':['id',_0x1c9b('0xe'),_0x1c9b('0xf'),_0x1c9b('0x10')],'where':_0x1b94ba,'limit':0x1}})['then'](function(_0x4820a1){logger[_0x1c9b('0x8')](_0x1c9b('0x11'),JSON[_0x1c9b('0x12')](_0x1b94ba),_0x4820a1?util['inspect'](_0x4820a1,{'showHidden':![],'depth':null}):'');return _0x4820a1[_0x1c9b('0x13')][_0x1c9b('0x14')]?_0x4820a1[_0x1c9b('0x13')][0x0]:null;});}exports[_0x1c9b('0x15')]=function(_0x1b91f6){return new BPromise(function(_0x54e2de,_0x517f3d){if(_0x1b91f6){return getUser({'internal':_0x1b91f6})[_0x1c9b('0x16')](function(_0x5df86f){logger[_0x1c9b('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1b91f6,_0x5df86f?'found':_0x1c9b('0x17'));return _0x54e2de(_0x5df86f);})[_0x1c9b('0xb')](function(_0x4c1dca){logger[_0x1c9b('0xc')](_0x1c9b('0x18'),_0x4c1dca?util['inspect'](_0x4c1dca,{'showHidden':![],'depth':null}):'');return _0x54e2de(null);});}return _0x54e2de(null);});};exports['getUserByInterface']=function(_0x494408){return new BPromise(function(_0xe92023,_0x472772){if(_0x494408){return getUser({'interface':_0x494408})[_0x1c9b('0x16')](function(_0x38b0f1){logger[_0x1c9b('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x494408,_0x38b0f1?_0x1c9b('0x19'):'notfound');return _0xe92023(_0x38b0f1);})['catch'](function(_0x32787a){logger['error']('[utils][getUserByInterface]',_0x32787a?util[_0x1c9b('0x7')](_0x32787a,{'showHidden':![],'depth':null}):'');return _0xe92023(null);});}return _0xe92023(null);});};exports[_0x1c9b('0x1a')]=function(_0x5dbbeb){return new BPromise(function(_0x6e423e,_0x152d40){if(_0x5dbbeb){return getUser({'name':_0x5dbbeb})[_0x1c9b('0x16')](function(_0x30eb3b){logger[_0x1c9b('0x6')](_0x1c9b('0x1b'),_0x5dbbeb,_0x30eb3b?'found':_0x1c9b('0x17'));return _0x6e423e(_0x30eb3b);})[_0x1c9b('0xb')](function(_0x182c2d){logger[_0x1c9b('0xc')](_0x1c9b('0x1c'),_0x182c2d?util[_0x1c9b('0x7')](_0x182c2d,{'showHidden':![],'depth':null}):'');return _0x6e423e(null);});}return _0x6e423e(null);});};exports[_0x1c9b('0x1d')]=function(_0x390d2e){return new BPromise(function(_0xdfce64,_0xb69c71){if(_0x390d2e){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x1c9b('0x1e'),_0x1c9b('0x1f'),_0x1c9b('0x20')],'where':{'name':_0x390d2e},'limit':0x1}})[_0x1c9b('0x16')](function(_0x11d550){logger[_0x1c9b('0x8')]('[utils][getVoiceQueueByName]\x20name:%s',_0x390d2e,_0x11d550?util[_0x1c9b('0x7')](_0x11d550,{'showHidden':![],'depth':null}):'');logger[_0x1c9b('0x6')](_0x1c9b('0x21'),_0x390d2e,_0x11d550?_0x1c9b('0x19'):_0x1c9b('0x17'));return _0xdfce64(_0x11d550[_0x1c9b('0x13')]['length']?_0x11d550[_0x1c9b('0x13')][0x0]:null);})[_0x1c9b('0xb')](function(_0x17464a){logger['error'](_0x1c9b('0x22'),_0x17464a?util['inspect'](_0x17464a,{'showHidden':![],'depth':null}):'');return _0xdfce64(null);});}return _0xdfce64(null);});};exports['addTime']=function(_0x58e489,_0x36da5e){return moment(_0x58e489)['add'](_0x36da5e,_0x1c9b('0x23'))[_0x1c9b('0x24')](_0x1c9b('0x25'));};exports['subtractTime']=function(_0x4e8328,_0x26433b){return moment(_0x4e8328)[_0x1c9b('0x26')](_0x26433b,_0x1c9b('0x23'))[_0x1c9b('0x24')](_0x1c9b('0x25'));};exports[_0x1c9b('0x27')]=function(_0x3860d7,_0xefd46d){return moment(_0x3860d7)['diff'](moment(_0xefd46d),_0x1c9b('0x23'));};exports[_0x1c9b('0x28')]=function(_0x5f29dc,_0x385662){return parseInt(_0x5f29dc,0xa)+parseInt(_0x385662,0xa);};exports['now']=function(){return moment()[_0x1c9b('0x24')](_0x1c9b('0x25'));};exports['isAfter']=function(_0x5e2f67,_0x1c9d4b){if(_0x1c9d4b){return moment(_0x5e2f67)[_0x1c9b('0x29')](_0x1c9d4b);}return!![];};exports[_0x1c9b('0x2a')]=function(_0x596a9a,_0x4f521e){if(_0x4f521e){return moment(_0x596a9a)[_0x1c9b('0x2a')](_0x4f521e);}else if(_0x596a9a){return!![];}return![];}; \ No newline at end of file +var _0xfd52=['bluebird','moment','util','client','http','xdr','inspect','debug','error','[utils][request]\x20name:%s','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','then','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','request','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','isAfter','isBefore'];(function(_0x47bf4b,_0x4c7722){var _0x256976=function(_0x18c9e9){while(--_0x18c9e9){_0x47bf4b['push'](_0x47bf4b['shift']());}};_0x256976(++_0x4c7722);}(_0xfd52,0xc0));var _0x2fd5=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xfd52[_0x31cb5f];return _0x586042;};'use strict';var BPromise=require(_0x2fd5('0x0'));var jayson=require('jayson/promise');var moment=require(_0x2fd5('0x1'));var util=require(_0x2fd5('0x2'));var client=jayson[_0x2fd5('0x3')][_0x2fd5('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x2fd5('0x5'));exports['info']=function(_0x26d1f9,_0x547d34){logger['info'](_0x26d1f9,_0x547d34?util[_0x2fd5('0x6')](_0x547d34,{'showHidden':![],'depth':null}):'');};exports[_0x2fd5('0x7')]=function(_0x2279e0,_0xe0a49a){logger[_0x2fd5('0x7')](_0x2279e0,_0xe0a49a?util[_0x2fd5('0x6')](_0xe0a49a,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x161c9a,_0x41a00a){logger[_0x2fd5('0x8')](_0x161c9a,_0x41a00a?util[_0x2fd5('0x6')](_0x41a00a,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4a2ae9,_0x178bd2){return client['request'](_0x4a2ae9,{'body':_0x178bd2})['then'](function(_0x3b30ae){logger['debug'](_0x2fd5('0x9'),_0x4a2ae9,_0x3b30ae?util[_0x2fd5('0x6')](_0x3b30ae,{'showHidden':![],'depth':null}):'');})[_0x2fd5('0xa')](function(_0x345477){logger[_0x2fd5('0x8')](_0x2fd5('0x9'),_0x4a2ae9,_0x345477?util[_0x2fd5('0x6')](_0x345477,{'showHidden':![],'depth':null}):'');});};function getUser(_0x38d655){return client['request'](_0x2fd5('0xb'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x2fd5('0xc')],'where':_0x38d655,'limit':0x1}})['then'](function(_0x2050fd){logger['debug'](_0x2fd5('0xd'),JSON[_0x2fd5('0xe')](_0x38d655),_0x2050fd?util[_0x2fd5('0x6')](_0x2050fd,{'showHidden':![],'depth':null}):'');return _0x2050fd[_0x2fd5('0xf')][_0x2fd5('0x10')]?_0x2050fd[_0x2fd5('0xf')][0x0]:null;});}exports[_0x2fd5('0x11')]=function(_0x34a931){return new BPromise(function(_0x49733a,_0x557be3){if(_0x34a931){return getUser({'internal':_0x34a931})[_0x2fd5('0x12')](function(_0x1a5a60){logger[_0x2fd5('0x13')](_0x2fd5('0x14'),_0x34a931,_0x1a5a60?_0x2fd5('0x15'):_0x2fd5('0x16'));return _0x49733a(_0x1a5a60);})[_0x2fd5('0xa')](function(_0x1bde40){logger[_0x2fd5('0x8')](_0x2fd5('0x17'),_0x1bde40?util[_0x2fd5('0x6')](_0x1bde40,{'showHidden':![],'depth':null}):'');return _0x49733a(null);});}return _0x49733a(null);});};exports[_0x2fd5('0x18')]=function(_0x171468){return new BPromise(function(_0x4ec9aa,_0x213c94){if(_0x171468){return getUser({'interface':_0x171468})['then'](function(_0x38677a){logger[_0x2fd5('0x13')](_0x2fd5('0x19'),_0x171468,_0x38677a?_0x2fd5('0x15'):_0x2fd5('0x16'));return _0x4ec9aa(_0x38677a);})[_0x2fd5('0xa')](function(_0x51f9b4){logger[_0x2fd5('0x8')]('[utils][getUserByInterface]',_0x51f9b4?util['inspect'](_0x51f9b4,{'showHidden':![],'depth':null}):'');return _0x4ec9aa(null);});}return _0x4ec9aa(null);});};exports[_0x2fd5('0x1a')]=function(_0x86b699){return new BPromise(function(_0x528508,_0x53aaa4){if(_0x86b699){return getUser({'name':_0x86b699})[_0x2fd5('0x12')](function(_0x2102f0){logger['info'](_0x2fd5('0x1b'),_0x86b699,_0x2102f0?_0x2fd5('0x15'):_0x2fd5('0x16'));return _0x528508(_0x2102f0);})[_0x2fd5('0xa')](function(_0x25b9d1){logger['error'](_0x2fd5('0x1c'),_0x25b9d1?util['inspect'](_0x25b9d1,{'showHidden':![],'depth':null}):'');return _0x528508(null);});}return _0x528508(null);});};exports[_0x2fd5('0x1d')]=function(_0x11eb78){return new BPromise(function(_0xb02368,_0xa0ce3e){if(_0x11eb78){return client[_0x2fd5('0x1e')](_0x2fd5('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x2fd5('0x20'),_0x2fd5('0x21'),_0x2fd5('0x22'),_0x2fd5('0x23')],'where':{'name':_0x11eb78},'limit':0x1}})[_0x2fd5('0x12')](function(_0x171d10){logger[_0x2fd5('0x7')](_0x2fd5('0x24'),_0x11eb78,_0x171d10?util[_0x2fd5('0x6')](_0x171d10,{'showHidden':![],'depth':null}):'');logger[_0x2fd5('0x13')](_0x2fd5('0x25'),_0x11eb78,_0x171d10?_0x2fd5('0x15'):_0x2fd5('0x16'));return _0xb02368(_0x171d10['result']['length']?_0x171d10['result'][0x0]:null);})[_0x2fd5('0xa')](function(_0x1406bc){logger['error'](_0x2fd5('0x26'),_0x1406bc?util[_0x2fd5('0x6')](_0x1406bc,{'showHidden':![],'depth':null}):'');return _0xb02368(null);});}return _0xb02368(null);});};exports['addTime']=function(_0x3095fd,_0x575422){return moment(_0x3095fd)[_0x2fd5('0x27')](_0x575422,_0x2fd5('0x28'))[_0x2fd5('0x29')](_0x2fd5('0x2a'));};exports['subtractTime']=function(_0xe72928,_0x411669){return moment(_0xe72928)[_0x2fd5('0x2b')](_0x411669,_0x2fd5('0x28'))[_0x2fd5('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x2fd5('0x2c')]=function(_0x91f3f9,_0x1f0a3e){return moment(_0x91f3f9)['diff'](moment(_0x1f0a3e),_0x2fd5('0x28'));};exports[_0x2fd5('0x2d')]=function(_0x48905d,_0x4348b2){return parseInt(_0x48905d,0xa)+parseInt(_0x4348b2,0xa);};exports['now']=function(){return moment()['format'](_0x2fd5('0x2a'));};exports[_0x2fd5('0x2e')]=function(_0x3c7441,_0x516c55){if(_0x516c55){return moment(_0x3c7441)['isAfter'](_0x516c55);}return!![];};exports[_0x2fd5('0x2f')]=function(_0x2332f4,_0x54dca9){if(_0x54dca9){return moment(_0x2332f4)[_0x2fd5('0x2f')](_0x54dca9);}else if(_0x2332f4){return!![];}return![];}; \ No newline at end of file